/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}function fe(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}ce.fn=ce.prototype={jquery:t,constructor:ce,length:0,toArray:function(){return ae.call(this)},get:function(e){return null==e?ae.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=ce.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return ce.each(this,e)},map:function(n){return this.pushStack(ce.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(ae.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(ce.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(ce.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:oe.sort,splice:oe.splice},ce.extend=ce.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(ce.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||ce.isPlainObject(n)?n:{},i=!1,a[t]=ce.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},ce.extend({expando:"jQuery"+(t+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==i.call(e))&&(!(t=r(e))||"function"==typeof(n=ue.call(t,"constructor")&&t.constructor)&&o.call(n)===a)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){m(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(c(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)while(t=e[r++])n+=ce.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(c(Object(e))?ce.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:se.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!l.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(c(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:le}),"function"==typeof Symbol&&(ce.fn[Symbol.iterator]=oe[Symbol.iterator]),ce.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var pe=oe.pop,de=oe.sort,he=oe.splice,ge="[\\x20\\t\\r\\n\\f]",ve=new RegExp("^"+ge+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ge+"+$","g");ce.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var f=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function p(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}ce.escapeSelector=function(e){return(e+"").replace(f,p)};var ye=C,me=s;!function(){var e,b,w,o,a,T,r,C,d,i,k=me,S=ce.expando,E=0,n=0,s=W(),c=W(),u=W(),h=W(),l=function(e,t){return e===t&&(a=!0),0},f="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",t="(?:\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",p="\\["+ge+"*("+t+")(?:"+ge+"*([*^$|!~]?=)"+ge+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+t+"))|)"+ge+"*\\]",g=":("+t+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+p+")*)|.*)\\)|)",v=new RegExp(ge+"+","g"),y=new RegExp("^"+ge+"*,"+ge+"*"),m=new RegExp("^"+ge+"*([>+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="<a id='"+S+"' href='' disabled='disabled'></a><select id='"+S+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0<I(t,T,null,[e]).length},I.contains=function(e,t){return(e.ownerDocument||e)!=T&&V(e),ce.contains(e,t)},I.attr=function(e,t){(e.ownerDocument||e)!=T&&V(e);var n=b.attrHandle[t.toLowerCase()],r=n&&ue.call(b.attrHandle,t.toLowerCase())?n(e,t,!C):void 0;return void 0!==r?r:e.getAttribute(t)},I.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ce.uniqueSort=function(e){var t,n=[],r=0,i=0;if(a=!le.sortStable,o=!le.sortStable&&ae.call(e,0),de.call(e,l),a){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)he.call(e,n[r],1)}return o=null,e},ce.fn.uniqueSort=function(){return this.pushStack(ce.uniqueSort(ae.apply(this)))},(b=ce.expr={cacheLength:50,createPseudo:F,match:D,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(v," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(d,e,t,h,g){var v="nth"!==d.slice(0,3),y="last"!==d.slice(-4),m="of-type"===e;return 1===h&&0===g?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u=v!==y?"nextSibling":"previousSibling",l=e.parentNode,c=m&&e.nodeName.toLowerCase(),f=!n&&!m,p=!1;if(l){if(v){while(u){o=e;while(o=o[u])if(m?fe(o,c):1===o.nodeType)return!1;s=u="only"===d&&!s&&"nextSibling"}return!0}if(s=[y?l.firstChild:l.lastChild],y&&f){p=(a=(r=(i=l[S]||(l[S]={}))[d]||[])[0]===E&&r[1])&&r[2],o=a&&l.childNodes[a];while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if(1===o.nodeType&&++p&&o===e){i[d]=[E,a,p];break}}else if(f&&(p=a=(r=(i=e[S]||(e[S]={}))[d]||[])[0]===E&&r[1]),!1===p)while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if((m?fe(o,c):1===o.nodeType)&&++p&&(f&&((i=o[S]||(o[S]={}))[d]=[E,p]),o===e))break;return(p-=g)===h||p%h==0&&0<=p/h}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||I.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?F(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=se.call(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:F(function(e){var r=[],i=[],s=ne(e.replace(ve,"$1"));return s[S]?F(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:F(function(t){return function(e){return 0<I(t,e).length}}),contains:F(function(t){return t=t.replace(O,P),function(e){return-1<(e.textContent||ce.text(e)).indexOf(t)}}),lang:F(function(n){return A.test(n||"")||I.error("unsupported lang: "+n),n=n.replace(O,P).toLowerCase(),function(e){var t;do{if(t=C?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=ie.location&&ie.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===r},focus:function(e){return e===function(){try{return T.activeElement}catch(e){}}()&&T.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:z(!1),disabled:z(!0),checked:function(e){return fe(e,"input")&&!!e.checked||fe(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return q.test(e.nodeName)},input:function(e){return N.test(e.nodeName)},button:function(e){return fe(e,"input")&&"button"===e.type||fe(e,"button")},text:function(e){var t;return fe(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:X(function(){return[0]}),last:X(function(e,t){return[t-1]}),eq:X(function(e,t,n){return[n<0?n+t:n]}),even:X(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:X(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:X(function(e,t,n){var r;for(r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:X(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=B(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=_(e);function G(){}function Y(e,t){var n,r,i,o,a,s,u,l=c[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=y.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=m.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(ve," ")}),a=a.slice(n.length)),b.filter)!(r=D[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?I.error(e):c(e,s).slice(0)}function Q(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function J(a,e,t){var s=e.dir,u=e.next,l=u||s,c=t&&"parentNode"===l,f=n++;return e.first?function(e,t,n){while(e=e[s])if(1===e.nodeType||c)return a(e,t,n);return!1}:function(e,t,n){var r,i,o=[E,f];if(n){while(e=e[s])if((1===e.nodeType||c)&&a(e,t,n))return!0}else while(e=e[s])if(1===e.nodeType||c)if(i=e[S]||(e[S]={}),u&&fe(e,u))e=e[s]||e;else{if((r=i[l])&&r[0]===E&&r[1]===f)return o[2]=r[2];if((i[l]=o)[2]=a(e,t,n))return!0}return!1}}function K(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Z(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function ee(d,h,g,v,y,e){return v&&!v[S]&&(v=ee(v)),y&&!y[S]&&(y=ee(y,e)),F(function(e,t,n,r){var i,o,a,s,u=[],l=[],c=t.length,f=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)I(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),p=!d||!e&&h?f:Z(f,u,d,n,r);if(g?g(p,s=y||(e?d:c||v)?[]:t,n,r):s=p,v){i=Z(s,l),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(s[l[o]]=!(p[l[o]]=a))}if(e){if(y||d){if(y){i=[],o=s.length;while(o--)(a=s[o])&&i.push(p[o]=a);y(null,s=[],i,r)}o=s.length;while(o--)(a=s[o])&&-1<(i=y?se.call(e,a):u[o])&&(e[i]=!(t[i]=a))}}else s=Z(s===t?s.splice(c,s.length):s),y?y(null,t,s,r):k.apply(t,s)})}function te(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=J(function(e){return e===i},a,!0),l=J(function(e){return-1<se.call(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!=w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[J(K(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return ee(1<s&&K(c),1<s&&Q(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(ve,"$1"),t,s<n&&te(e.slice(s,n)),n<r&&te(e=e.slice(n)),n<r&&Q(e))}c.push(t)}return K(c)}function ne(e,t){var n,v,y,m,x,r,i=[],o=[],a=u[e+" "];if(!a){t||(t=Y(e)),n=t.length;while(n--)(a=te(t[n]))[S]?i.push(a):o.push(a);(a=u(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=E+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==T||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==T||(V(o),n=!C);while(s=v[a++])if(s(o,t||T,n)){k.call(r,o);break}i&&(E=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=pe.call(r));f=Z(f)}k.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&ce.uniqueSort(r)}return i&&(E=h,w=p),c},m?F(r):r))).selector=e}return a}function re(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&Y(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&C&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(O,P),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=D.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(O,P),H.test(o[0].type)&&U(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&Q(o)))return k.apply(n,r),n;break}}}return(l||ne(e,c))(r,t,!C,n,!t||H.test(e)&&U(t.parentNode)||t),n}G.prototype=b.filters=b.pseudos,b.setFilters=new G,le.sortStable=S.split("").sort(l).join("")===S,V(),le.sortDetached=$(function(e){return 1&e.compareDocumentPosition(T.createElement("fieldset"))}),ce.find=I,ce.expr[":"]=ce.expr.pseudos,ce.unique=ce.uniqueSort,I.compile=ne,I.select=re,I.setDocument=V,I.tokenize=Y,I.escape=ce.escapeSelector,I.getText=ce.text,I.isXML=ce.isXMLDoc,I.selectors=ce.expr,I.support=ce.support,I.uniqueSort=ce.uniqueSort}();var d=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&ce(e).is(n))break;r.push(e)}return r},h=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},b=ce.expr.match.needsContext,w=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1<se.call(n,e)!==r}):ce.filter(n,e,r)}ce.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?ce.find.matchesSelector(r,e)?[r]:[]:ce.find.matches(e,ce.grep(t,function(e){return 1===e.nodeType}))},ce.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(ce(e).filter(function(){for(t=0;t<r;t++)if(ce.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)ce.find(e,i[t],n);return 1<r?ce.uniqueSort(n):n},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&b.test(e)?ce(e):e||[],!1).length}});var k,S=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(ce.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&ce(e);if(!b.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&ce.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?ce.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?se.call(ce(e),this[0]):se.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ce.uniqueSort(ce.merge(this.get(),ce(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ce.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return d(e,"parentNode")},parentsUntil:function(e,t,n){return d(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return d(e,"nextSibling")},prevAll:function(e){return d(e,"previousSibling")},nextUntil:function(e,t,n){return d(e,"nextSibling",n)},prevUntil:function(e,t,n){return d(e,"previousSibling",n)},siblings:function(e){return h((e.parentNode||{}).firstChild,e)},children:function(e){return h(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(fe(e,"template")&&(e=e.content||e),ce.merge([],e.childNodes))}},function(r,i){ce.fn[r]=function(e,t){var n=ce.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=ce.filter(t,n)),1<this.length&&(j[r]||ce.uniqueSort(n),E.test(r)&&n.reverse()),this.pushStack(n)}});var D=/[^\x20\t\r\n\f]+/g;function N(e){return e}function q(e){throw e}function L(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}ce.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},ce.each(e.match(D)||[],function(e,t){n[t]=!0}),n):ce.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){ce.each(e,function(e,t){v(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==x(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return ce.each(arguments,function(e,t){var n;while(-1<(n=ce.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<ce.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},ce.extend({Deferred:function(e){var o=[["notify","progress",ce.Callbacks("memory"),ce.Callbacks("memory"),2],["resolve","done",ce.Callbacks("once memory"),ce.Callbacks("once memory"),0,"resolved"],["reject","fail",ce.Callbacks("once memory"),ce.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return ce.Deferred(function(r){ce.each(o,function(e,t){var n=v(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&v(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,v(t)?s?t.call(e,l(u,o,N,s),l(u,o,q,s)):(u++,t.call(e,l(u,o,N,s),l(u,o,q,s),l(u,o,N,o.notifyWith))):(a!==N&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){ce.Deferred.exceptionHook&&ce.Deferred.exceptionHook(e,t.error),u<=i+1&&(a!==q&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(ce.Deferred.getErrorHook?t.error=ce.Deferred.getErrorHook():ce.Deferred.getStackHook&&(t.error=ce.Deferred.getStackHook()),ie.setTimeout(t))}}return ce.Deferred(function(e){o[0][3].add(l(0,e,v(r)?r:N,e.notifyWith)),o[1][3].add(l(0,e,v(t)?t:N)),o[2][3].add(l(0,e,v(n)?n:q))}).promise()},promise:function(e){return null!=e?ce.extend(e,a):a}},s={};return ce.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=ae.call(arguments),o=ce.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?ae.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(L(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||v(i[t]&&i[t].then)))return o.then();while(t--)L(i[t],a(t),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;ce.Deferred.exceptionHook=function(e,t){ie.console&&ie.console.warn&&e&&H.test(e.name)&&ie.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},ce.readyException=function(e){ie.setTimeout(function(){throw e})};var O=ce.Deferred();function P(){C.removeEventListener("DOMContentLoaded",P),ie.removeEventListener("load",P),ce.ready()}ce.fn.ready=function(e){return O.then(e)["catch"](function(e){ce.readyException(e)}),this},ce.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--ce.readyWait:ce.isReady)||(ce.isReady=!0)!==e&&0<--ce.readyWait||O.resolveWith(C,[ce])}}),ce.ready.then=O.then,"complete"===C.readyState||"loading"!==C.readyState&&!C.documentElement.doScroll?ie.setTimeout(ce.ready):(C.addEventListener("DOMContentLoaded",P),ie.addEventListener("load",P));var M=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n))for(s in i=!0,n)M(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(ce(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},R=/^-ms-/,I=/-([a-z])/g;function W(e,t){return t.toUpperCase()}function F(e){return e.replace(R,"ms-").replace(I,W)}var $=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function B(){this.expando=ce.expando+B.uid++}B.uid=1,B.prototype={cache:function(e){var t=e[this.expando];return t||(t={},$(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[F(t)]=n;else for(r in t)i[F(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][F(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(F):(t=F(t))in r?[t]:t.match(D)||[]).length;while(n--)delete r[t[n]]}(void 0===t||ce.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!ce.isEmptyObject(t)}};var _=new B,z=new B,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,U=/[A-Z]/g;function V(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(U,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:X.test(i)?JSON.parse(i):i)}catch(e){}z.set(e,t,n)}else n=void 0;return n}ce.extend({hasData:function(e){return z.hasData(e)||_.hasData(e)},data:function(e,t,n){return z.access(e,t,n)},removeData:function(e,t){z.remove(e,t)},_data:function(e,t,n){return _.access(e,t,n)},_removeData:function(e,t){_.remove(e,t)}}),ce.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=z.get(o),1===o.nodeType&&!_.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=F(r.slice(5)),V(o,r,i[r]));_.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){z.set(this,n)}):M(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=z.get(o,n))?t:void 0!==(t=V(o,n))?t:void 0;this.each(function(){z.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){z.remove(this,e)})}}),ce.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=_.get(e,t),n&&(!r||Array.isArray(n)?r=_.access(e,t,ce.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=ce.queue(e,t),r=n.length,i=n.shift(),o=ce._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){ce.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return _.get(e,n)||_.access(e,n,{empty:ce.Callbacks("once memory").add(function(){_.remove(e,[t+"queue",n])})})}}),ce.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?ce.queue(this[0],t):void 0===n?this:this.each(function(){var e=ce.queue(this,t,n);ce._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&ce.dequeue(this,t)})},dequeue:function(e){return this.each(function(){ce.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=ce.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=_.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var G=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Y=new RegExp("^(?:([+-])=|)("+G+")([a-z%]*)$","i"),Q=["Top","Right","Bottom","Left"],J=C.documentElement,K=function(e){return ce.contains(e.ownerDocument,e)},Z={composed:!0};J.getRootNode&&(K=function(e){return ce.contains(e.ownerDocument,e)||e.getRootNode(Z)===e.ownerDocument});var ee=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&K(e)&&"none"===ce.css(e,"display")};function te(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return ce.css(e,t,"")},u=s(),l=n&&n[3]||(ce.cssNumber[t]?"":"px"),c=e.nodeType&&(ce.cssNumber[t]||"px"!==l&&+u)&&Y.exec(ce.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)ce.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,ce.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ne={};function re(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=_.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ee(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ne[s])||(o=a.body.appendChild(a.createElement(s)),u=ce.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ne[s]=u)))):"none"!==n&&(l[c]="none",_.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}ce.fn.extend({show:function(){return re(this,!0)},hide:function(){return re(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ee(this)?ce(this).show():ce(this).hide()})}});var xe,be,we=/^(?:checkbox|radio)$/i,Te=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="<textarea>x</textarea>",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="<option></option>",le.option=!!xe.lastChild;var ke={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n<r;n++)_.set(e[n],"globalEval",!t||_.get(t[n],"globalEval"))}ke.tbody=ke.tfoot=ke.colgroup=ke.caption=ke.thead,ke.th=ke.td,le.option||(ke.optgroup=ke.option=[1,"<select multiple='multiple'>","</select>"]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))ce.merge(p,o.nodeType?[o]:o);else if(je.test(o)){a=a||f.appendChild(t.createElement("div")),s=(Te.exec(o)||["",""])[1].toLowerCase(),u=ke[s]||ke._default,a.innerHTML=u[1]+ce.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;ce.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<ce.inArray(o,r))i&&i.push(o);else if(l=K(o),a=Se(f.appendChild(o),"script"),l&&Ee(a),n){c=0;while(o=a[c++])Ce.test(o.type||"")&&n.push(o)}return f}var De=/^([^.]*)(?:\.(.+)|)/;function Ne(){return!0}function qe(){return!1}function Le(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Le(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=qe;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return ce().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=ce.guid++)),e.each(function(){ce.event.add(this,t,i,r,n)})}function He(e,r,t){t?(_.set(e,r,!1),ce.event.add(e,r,{namespace:!1,handler:function(e){var t,n=_.get(this,r);if(1&e.isTrigger&&this[r]){if(n)(ce.event.special[r]||{}).delegateType&&e.stopPropagation();else if(n=ae.call(arguments),_.set(this,r,n),this[r](),t=_.get(this,r),_.set(this,r,!1),n!==t)return e.stopImmediatePropagation(),e.preventDefault(),t}else n&&(_.set(this,r,ce.event.trigger(n[0],n.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Ne)}})):void 0===_.get(e,r)&&ce.event.add(e,r,Ne)}ce.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.get(t);if($(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&ce.find.matchesSelector(J,i),n.guid||(n.guid=ce.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof ce&&ce.event.triggered!==e.type?ce.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(D)||[""]).length;while(l--)d=g=(s=De.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=ce.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=ce.event.special[d]||{},c=ce.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&ce.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),ce.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.hasData(e)&&_.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(D)||[""]).length;while(l--)if(d=g=(s=De.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=ce.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||ce.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)ce.event.remove(e,d+t[l],n,r,!0);ce.isEmptyObject(u)&&_.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=ce.event.fix(e),l=(_.get(this,"events")||Object.create(null))[u.type]||[],c=ce.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=ce.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((ce.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<ce(i,this).index(l):ce.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(ce.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[ce.expando]?e:new ce.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click",!0),!1},trigger:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click"),!0},_default:function(e){var t=e.target;return we.test(t.type)&&t.click&&fe(t,"input")&&_.get(t,"click")||fe(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},ce.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},ce.Event=function(e,t){if(!(this instanceof ce.Event))return new ce.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ne:qe,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&ce.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[ce.expando]=!0},ce.Event.prototype={constructor:ce.Event,isDefaultPrevented:qe,isPropagationStopped:qe,isImmediatePropagationStopped:qe,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ne,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ne,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ne,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},ce.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},ce.event.addProp),ce.each({focus:"focusin",blur:"focusout"},function(r,i){function o(e){if(C.documentMode){var t=_.get(this,"handle"),n=ce.event.fix(e);n.type="focusin"===e.type?"focus":"blur",n.isSimulated=!0,t(e),n.target===n.currentTarget&&t(n)}else ce.event.simulate(i,e.target,ce.event.fix(e))}ce.event.special[r]={setup:function(){var e;if(He(this,r,!0),!C.documentMode)return!1;(e=_.get(this,i))||this.addEventListener(i,o),_.set(this,i,(e||0)+1)},trigger:function(){return He(this,r),!0},teardown:function(){var e;if(!C.documentMode)return!1;(e=_.get(this,i)-1)?_.set(this,i,e):(this.removeEventListener(i,o),_.remove(this,i))},_default:function(e){return _.get(e.target,r)},delegateType:i},ce.event.special[i]={setup:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i);n||(C.documentMode?this.addEventListener(i,o):e.addEventListener(r,o,!0)),_.set(t,i,(n||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i)-1;n?_.set(t,i,n):(C.documentMode?this.removeEventListener(i,o):e.removeEventListener(r,o,!0),_.remove(t,i))}}}),ce.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){ce.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||ce.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),ce.fn.extend({on:function(e,t,n,r){return Le(this,e,t,n,r)},one:function(e,t,n,r){return Le(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,ce(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=qe),this.each(function(){ce.event.remove(this,e,n,t)})}});var Oe=/<script|<style|<link/i,Pe=/checked\s*(?:[^=]|=\s*.checked.)/i,Me=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)ce.event.add(t,i,s[i][n]);z.hasData(e)&&(o=z.access(e),a=ce.extend({},o),z.set(t,a))}}function $e(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=v(d);if(h||1<f&&"string"==typeof d&&!le.checkClone&&Pe.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),$e(t,r,i,o)});if(f&&(t=(e=Ae(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=ce.map(Se(e,"script"),Ie)).length;c<f;c++)u=e,c!==p&&(u=ce.clone(u,!0,!0),s&&ce.merge(a,Se(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,ce.map(a,We),c=0;c<s;c++)u=a[c],Ce.test(u.type||"")&&!_.access(u,"globalEval")&&ce.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?ce._evalUrl&&!u.noModule&&ce._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):m(u.textContent.replace(Me,""),u,l))}return n}function Be(e,t,n){for(var r,i=t?ce.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||ce.cleanData(Se(r)),r.parentNode&&(n&&K(r)&&Ee(Se(r,"script")),r.parentNode.removeChild(r));return e}ce.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=K(e);if(!(le.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ce.isXMLDoc(e)))for(a=Se(c),r=0,i=(o=Se(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&we.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||Se(e),a=a||Se(c),r=0,i=o.length;r<i;r++)Fe(o[r],a[r]);else Fe(e,c);return 0<(a=Se(c,"script")).length&&Ee(a,!f&&Se(e,"script")),c},cleanData:function(e){for(var t,n,r,i=ce.event.special,o=0;void 0!==(n=e[o]);o++)if($(n)){if(t=n[_.expando]){if(t.events)for(r in t.events)i[r]?ce.event.remove(n,r):ce.removeEvent(n,r,t.handle);n[_.expando]=void 0}n[z.expando]&&(n[z.expando]=void 0)}}}),ce.fn.extend({detach:function(e){return Be(this,e,!0)},remove:function(e){return Be(this,e)},text:function(e){return M(this,function(e){return void 0===e?ce.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return $e(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Re(this,e).appendChild(e)})},prepend:function(){return $e(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Re(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ce.cleanData(Se(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ce.clone(this,e,t)})},html:function(e){return M(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Oe.test(e)&&!ke[(Te.exec(e)||["",""])[1].toLowerCase()]){e=ce.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(ce.cleanData(Se(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return $e(this,arguments,function(e){var t=this.parentNode;ce.inArray(this,n)<0&&(ce.cleanData(Se(this)),t&&t.replaceChild(e,this))},n)}}),ce.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){ce.fn[e]=function(e){for(var t,n=[],r=ce(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),ce(r[o])[a](t),s.apply(n,t.get());return this.pushStack(n)}});var _e=new RegExp("^("+G+")(?!px)[a-z%]+$","i"),ze=/^--/,Xe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=ie),t.getComputedStyle(e)},Ue=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ve=new RegExp(Q.join("|"),"i");function Ge(e,t,n){var r,i,o,a,s=ze.test(t),u=e.style;return(n=n||Xe(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace(ve,"$1")||void 0),""!==a||K(e)||(a=ce.style(e,t)),!le.pixelBoxStyles()&&_e.test(a)&&Ve.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function Ye(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",J.appendChild(u).appendChild(l);var e=ie.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),J.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=C.createElement("div"),l=C.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",le.clearCloneStyle="content-box"===l.style.backgroundClip,ce.extend(le,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=C.createElement("table"),t=C.createElement("tr"),n=C.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",J.appendChild(e).appendChild(t).appendChild(n),r=ie.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,J.removeChild(e)),a}}))}();var Qe=["Webkit","Moz","ms"],Je=C.createElement("div").style,Ke={};function Ze(e){var t=ce.cssProps[e]||Ke[e];return t||(e in Je?e:Ke[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Qe.length;while(n--)if((e=Qe[n]+t)in Je)return e}(e)||e)}var et=/^(none|table(?!-c[ea]).+)/,tt={position:"absolute",visibility:"hidden",display:"block"},nt={letterSpacing:"0",fontWeight:"400"};function rt(e,t,n){var r=Y.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function it(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=ce.css(e,n+Q[a],!0,i)),r?("content"===n&&(u-=ce.css(e,"padding"+Q[a],!0,i)),"margin"!==n&&(u-=ce.css(e,"border"+Q[a]+"Width",!0,i))):(u+=ce.css(e,"padding"+Q[a],!0,i),"padding"!==n?u+=ce.css(e,"border"+Q[a]+"Width",!0,i):s+=ce.css(e,"border"+Q[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u+l}function ot(e,t,n){var r=Xe(e),i=(!le.boxSizingReliable()||n)&&"border-box"===ce.css(e,"boxSizing",!1,r),o=i,a=Ge(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(_e.test(a)){if(!n)return a;a="auto"}return(!le.boxSizingReliable()&&i||!le.reliableTrDimensions()&&fe(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===ce.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===ce.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+it(e,t,n||(i?"border":"content"),o,r,a)+"px"}function at(e,t,n,r,i){return new at.prototype.init(e,t,n,r,i)}ce.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ge(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=F(t),u=ze.test(t),l=e.style;if(u||(t=Ze(s)),a=ce.cssHooks[t]||ce.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=Y.exec(n))&&i[1]&&(n=te(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(ce.cssNumber[s]?"":"px")),le.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=F(t);return ze.test(t)||(t=Ze(s)),(a=ce.cssHooks[t]||ce.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Ge(e,t,r)),"normal"===i&&t in nt&&(i=nt[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),ce.each(["height","width"],function(e,u){ce.cssHooks[u]={get:function(e,t,n){if(t)return!et.test(ce.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ot(e,u,n):Ue(e,tt,function(){return ot(e,u,n)})},set:function(e,t,n){var r,i=Xe(e),o=!le.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===ce.css(e,"boxSizing",!1,i),s=n?it(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-it(e,u,"border",!1,i)-.5)),s&&(r=Y.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=ce.css(e,u)),rt(0,t,s)}}}),ce.cssHooks.marginLeft=Ye(le.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ge(e,"marginLeft"))||e.getBoundingClientRect().left-Ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),ce.each({margin:"",padding:"",border:"Width"},function(i,o){ce.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+Q[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(ce.cssHooks[i+o].set=rt)}),ce.fn.extend({css:function(e,t){return M(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Xe(e),i=t.length;a<i;a++)o[t[a]]=ce.css(e,t[a],!1,r);return o}return void 0!==n?ce.style(e,t,n):ce.css(e,t)},e,t,1<arguments.length)}}),((ce.Tween=at).prototype={constructor:at,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||ce.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(ce.cssNumber[n]?"":"px")},cur:function(){var e=at.propHooks[this.prop];return e&&e.get?e.get(this):at.propHooks._default.get(this)},run:function(e){var t,n=at.propHooks[this.prop];return this.options.duration?this.pos=t=ce.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):at.propHooks._default.set(this),this}}).init.prototype=at.prototype,(at.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=ce.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){ce.fx.step[e.prop]?ce.fx.step[e.prop](e):1!==e.elem.nodeType||!ce.cssHooks[e.prop]&&null==e.elem.style[Ze(e.prop)]?e.elem[e.prop]=e.now:ce.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=at.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ce.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},ce.fx=at.prototype.init,ce.fx.step={};var st,ut,lt,ct,ft=/^(?:toggle|show|hide)$/,pt=/queueHooks$/;function dt(){ut&&(!1===C.hidden&&ie.requestAnimationFrame?ie.requestAnimationFrame(dt):ie.setTimeout(dt,ce.fx.interval),ce.fx.tick())}function ht(){return ie.setTimeout(function(){st=void 0}),st=Date.now()}function gt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=Q[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function vt(e,t,n){for(var r,i=(yt.tweeners[t]||[]).concat(yt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function yt(o,e,t){var n,a,r=0,i=yt.prefilters.length,s=ce.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=st||ht(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:ce.extend({},e),opts:ce.extend(!0,{specialEasing:{},easing:ce.easing._default},t),originalProperties:e,originalOptions:t,startTime:st||ht(),duration:t.duration,tweens:[],createTween:function(e,t){var n=ce.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=F(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=ce.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=yt.prefilters[r].call(l,o,c,l.opts))return v(n.stop)&&(ce._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return ce.map(c,vt,l),v(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),ce.fx.timer(ce.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}ce.Animation=ce.extend(yt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return te(n.elem,e,Y.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(D);for(var n,r=0,i=e.length;r<i;r++)n=e[r],yt.tweeners[n]=yt.tweeners[n]||[],yt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ee(e),v=_.get(e,"fxshow");for(r in n.queue||(null==(a=ce._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,ce.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ft.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||ce.style(e,r)}if((u=!ce.isEmptyObject(t))||!ce.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=_.get(e,"display")),"none"===(c=ce.css(e,"display"))&&(l?c=l:(re([e],!0),l=e.style.display||l,c=ce.css(e,"display"),re([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===ce.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=_.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&re([e],!0),p.done(function(){for(r in g||re([e]),_.remove(e,"fxshow"),d)ce.style(e,r,d[r])})),u=vt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?yt.prefilters.unshift(e):yt.prefilters.push(e)}}),ce.speed=function(e,t,n){var r=e&&"object"==typeof e?ce.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return ce.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in ce.fx.speeds?r.duration=ce.fx.speeds[r.duration]:r.duration=ce.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&ce.dequeue(this,r.queue)},r},ce.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ee).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=ce.isEmptyObject(t),o=ce.speed(e,n,r),a=function(){var e=yt(this,ce.extend({},t),o);(i||_.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=ce.timers,r=_.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&pt.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||ce.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=_.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=ce.timers,o=n?n.length:0;for(t.finish=!0,ce.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),ce.each(["toggle","show","hide"],function(e,r){var i=ce.fn[r];ce.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(gt(r,!0),e,t,n)}}),ce.each({slideDown:gt("show"),slideUp:gt("hide"),slideToggle:gt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){ce.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),ce.timers=[],ce.fx.tick=function(){var e,t=0,n=ce.timers;for(st=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||ce.fx.stop(),st=void 0},ce.fx.timer=function(e){ce.timers.push(e),ce.fx.start()},ce.fx.interval=13,ce.fx.start=function(){ut||(ut=!0,dt())},ce.fx.stop=function(){ut=null},ce.fx.speeds={slow:600,fast:200,_default:400},ce.fn.delay=function(r,e){return r=ce.fx&&ce.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=ie.setTimeout(e,r);t.stop=function(){ie.clearTimeout(n)}})},lt=C.createElement("input"),ct=C.createElement("select").appendChild(C.createElement("option")),lt.type="checkbox",le.checkOn=""!==lt.value,le.optSelected=ct.selected,(lt=C.createElement("input")).value="t",lt.type="radio",le.radioValue="t"===lt.value;var mt,xt=ce.expr.attrHandle;ce.fn.extend({attr:function(e,t){return M(this,ce.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){ce.removeAttr(this,e)})}}),ce.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?ce.prop(e,t,n):(1===o&&ce.isXMLDoc(e)||(i=ce.attrHooks[t.toLowerCase()]||(ce.expr.match.bool.test(t)?mt:void 0)),void 0!==n?null===n?void ce.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=ce.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!le.radioValue&&"radio"===t&&fe(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(D);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),mt={set:function(e,t,n){return!1===t?ce.removeAttr(e,n):e.setAttribute(n,n),n}},ce.each(ce.expr.match.bool.source.match(/\w+/g),function(e,t){var a=xt[t]||ce.find.attr;xt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=xt[o],xt[o]=r,r=null!=a(e,t,n)?o:null,xt[o]=i),r}});var bt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;function Tt(e){return(e.match(D)||[]).join(" ")}function Ct(e){return e.getAttribute&&e.getAttribute("class")||""}function kt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(D)||[]}ce.fn.extend({prop:function(e,t){return M(this,ce.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[ce.propFix[e]||e]})}}),ce.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&ce.isXMLDoc(e)||(t=ce.propFix[t]||t,i=ce.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=ce.find.attr(e,"tabindex");return t?parseInt(t,10):bt.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),le.optSelected||(ce.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),ce.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ce.propFix[this.toLowerCase()]=this}),ce.fn.extend({addClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).addClass(t.call(this,e,Ct(this)))}):(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).removeClass(t.call(this,e,Ct(this)))}):arguments.length?(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++){i=e[o];while(-1<n.indexOf(" "+i+" "))n=n.replace(" "+i+" "," ")}a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(t,n){var e,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return v(t)?this.each(function(e){ce(this).toggleClass(t.call(this,e,Ct(this),n),n)}):"boolean"==typeof n&&s?n?this.addClass(t):this.removeClass(t):(e=kt(t),this.each(function(){if(s)for(o=ce(this),i=0;i<e.length;i++)r=e[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==t&&"boolean"!==a||((r=Ct(this))&&_.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":_.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+Tt(Ct(n))+" ").indexOf(t))return!0;return!1}});var St=/\r/g;ce.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=v(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,ce(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=ce.map(t,function(e){return null==e?"":e+""})),(r=ce.valHooks[this.type]||ce.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=ce.valHooks[t.type]||ce.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(St,""):null==e?"":e:void 0}}),ce.extend({valHooks:{option:{get:function(e){var t=ce.find.attr(e,"value");return null!=t?t:Tt(ce.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!fe(n.parentNode,"optgroup"))){if(t=ce(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=ce.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<ce.inArray(ce.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),ce.each(["radio","checkbox"],function(){ce.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<ce.inArray(ce(e).val(),t)}},le.checkOn||(ce.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Et=ie.location,jt={guid:Date.now()},At=/\?/;ce.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new ie.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||ce.error("Invalid XML: "+(n?ce.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Dt=/^(?:focusinfocus|focusoutblur)$/,Nt=function(e){e.stopPropagation()};ce.extend(ce.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||C],d=ue.call(e,"type")?e.type:e,h=ue.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||C,3!==n.nodeType&&8!==n.nodeType&&!Dt.test(d+ce.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[ce.expando]?e:new ce.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:ce.makeArray(t,[e]),c=ce.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!y(n)){for(s=c.delegateType||d,Dt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||C)&&p.push(a.defaultView||a.parentWindow||ie)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(_.get(o,"events")||Object.create(null))[e.type]&&_.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&$(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!$(n)||u&&v(n[d])&&!y(n)&&((a=n[u])&&(n[u]=null),ce.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Nt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Nt),ce.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=ce.extend(new ce.Event,n,{type:e,isSimulated:!0});ce.event.trigger(r,null,t)}}),ce.fn.extend({trigger:function(e,t){return this.each(function(){ce.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return ce.event.trigger(e,t,n,!0)}});var qt=/\[\]$/,Lt=/\r?\n/g,Ht=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;function Pt(n,e,r,i){var t;if(Array.isArray(e))ce.each(e,function(e,t){r||qt.test(n)?i(n,t):Pt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==x(e))i(n,e);else for(t in e)Pt(n+"["+t+"]",e[t],r,i)}ce.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!ce.isPlainObject(e))ce.each(e,function(){i(this.name,this.value)});else for(n in e)Pt(n,e[n],t,i);return r.join("&")},ce.fn.extend({serialize:function(){return ce.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ce.prop(this,"elements");return e?ce.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ce(this).is(":disabled")&&Ot.test(this.nodeName)&&!Ht.test(e)&&(this.checked||!we.test(e))}).map(function(e,t){var n=ce(this).val();return null==n?null:Array.isArray(n)?ce.map(n,function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}}):{name:t.name,value:n.replace(Lt,"\r\n")}}).get()}});var Mt=/%20/g,Rt=/#.*$/,It=/([?&])_=[^&]*/,Wt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ft=/^(?:GET|HEAD)$/,$t=/^\/\//,Bt={},_t={},zt="*/".concat("*"),Xt=C.createElement("a");function Ut(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(D)||[];if(v(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Vt(t,i,o,a){var s={},u=t===_t;function l(e){var r;return s[e]=!0,ce.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Gt(e,t){var n,r,i=ce.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&ce.extend(!0,e,r),e}Xt.href=Et.href,ce.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":ce.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Gt(Gt(e,ce.ajaxSettings),t):Gt(ce.ajaxSettings,e)},ajaxPrefilter:Ut(Bt),ajaxTransport:Ut(_t),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=ce.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?ce(y):ce.event,x=ce.Deferred(),b=ce.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Wt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Et.href)+"").replace($t,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(D)||[""],null==v.crossDomain){r=C.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Xt.protocol+"//"+Xt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=ce.param(v.data,v.traditional)),Vt(Bt,v,t,T),h)return T;for(i in(g=ce.event&&v.global)&&0==ce.active++&&ce.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ft.test(v.type),f=v.url.replace(Rt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Mt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(At.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(It,"$1"),o=(At.test(f)?"&":"?")+"_="+jt.guid+++o),v.url=f+o),v.ifModified&&(ce.lastModified[f]&&T.setRequestHeader("If-Modified-Since",ce.lastModified[f]),ce.etag[f]&&T.setRequestHeader("If-None-Match",ce.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+zt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Vt(_t,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=ie.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&ie.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<ce.inArray("script",v.dataTypes)&&ce.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(ce.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(ce.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--ce.active||ce.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return ce.get(e,t,n,"json")},getScript:function(e,t){return ce.get(e,void 0,t,"script")}}),ce.each(["get","post"],function(e,i){ce[i]=function(e,t,n,r){return v(t)&&(r=r||n,n=t,t=void 0),ce.ajax(ce.extend({url:e,type:i,dataType:r,data:t,success:n},ce.isPlainObject(e)&&e))}}),ce.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),ce._evalUrl=function(e,t,n){return ce.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){ce.globalEval(e,t,n)}})},ce.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=ce(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return v(n)?this.each(function(e){ce(this).wrapInner(n.call(this,e))}):this.each(function(){var e=ce(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=v(t);return this.each(function(e){ce(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){ce(this).replaceWith(this.childNodes)}),this}}),ce.expr.pseudos.hidden=function(e){return!ce.expr.pseudos.visible(e)},ce.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},ce.ajaxSettings.xhr=function(){try{return new ie.XMLHttpRequest}catch(e){}};var Yt={0:200,1223:204},Qt=ce.ajaxSettings.xhr();le.cors=!!Qt&&"withCredentials"in Qt,le.ajax=Qt=!!Qt,ce.ajaxTransport(function(i){var o,a;if(le.cors||Qt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Yt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&ie.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),ce.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),ce.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return ce.globalEval(e),e}}}),ce.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ce.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=ce("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=Tt(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&ce.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?ce("<div>").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var en=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;ce.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=ae.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(ae.call(arguments)))}).guid=e.guid=e.guid||ce.guid++,i},ce.holdReady=function(e){e?ce.readyWait++:ce.ready(!0)},ce.isArray=Array.isArray,ce.parseJSON=JSON.parse,ce.nodeName=fe,ce.isFunction=v,ce.isWindow=y,ce.camelCase=F,ce.type=x,ce.now=Date.now,ce.isNumeric=function(e){var t=ce.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},ce.trim=function(e){return null==e?"":(e+"").replace(en,"$1")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return ce});var tn=ie.jQuery,nn=ie.$;return ce.noConflict=function(e){return ie.$===ce&&(ie.$=nn),e&&ie.jQuery===ce&&(ie.jQuery=tn),ce},"undefined"==typeof e&&(ie.jQuery=ie.$=ce),ce});

/*! jQuery UI - v1.12.1 - 2018-03-16
* http://jqueryui.com
* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/droppable.js, widgets/resizable.js, widgets/selectable.js, widgets/sortable.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/selectmenu.js, widgets/slider.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}function i(t){for(var e,i;t.length&&t[0]!==document;){if(e=t.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}function s(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=n(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",i,function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,o)}function o(){t.datepicker._isDisabledDatepicker(p.inline?p.dpDiv.parent()[0]:p.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function a(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}function r(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.ui=t.ui||{},t.ui.version="1.12.1";var l=0,h=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},l=e.split(".")[0];e=e.split(".")[1];var h=l+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},n=t[l][e],o=t[l][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:l,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,s,n=h.call(arguments,1),o=0,a=n.length;a>o;o++)for(i in n[o])s=n[o][i],n[o].hasOwnProperty(i)&&void 0!==s&&(e[i]=t.isPlainObject(s)?t.isPlainObject(e[i])?t.widget.extend({},e[i],s):t.widget.extend({},s):s);return e},t.widget.bridge=function(e,i){var s=i.prototype.widgetFullName||e;t.fn[e]=function(n){var o="string"==typeof n,a=h.call(arguments,1),r=this;return o?this.length||"instance"!==n?this.each(function(){var i,o=t.data(this,s);return"instance"===n?(r=o,!1):o?t.isFunction(o[n])&&"_"!==n.charAt(0)?(i=o[n].apply(o,a),i!==o&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+n+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+n+"'")}):r=void 0:(a.length&&(n=t.widget.extend.apply(null,[n].concat(a))),this.each(function(){var e=t.data(this,s);e?(e.option(n||{}),e._init&&e._init()):t.data(this,s,new i(n,this))})),r}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.on(h,c,r):i.on(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType,o=!s&&!n;return{element:i,isWindow:s,isDocument:n,offset:o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(n){if(!n||!n.of)return d.apply(this,arguments);n=t.extend({},n);var u,p,f,g,m,_,v=t(n.of),b=t.position.getWithinInfo(n.within),y=t.position.getScrollInfo(b),w=(n.collision||"flip").split(" "),k={};return _=s(v),v[0].preventDefault&&(n.at="left top"),p=_.width,f=_.height,g=_.offset,m=t.extend({},g),t.each(["my","at"],function(){var t,e,i=(n[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),k[this]=[t?t[0]:0,e?e[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===n.at[0]?m.left+=p:"center"===n.at[0]&&(m.left+=p/2),"bottom"===n.at[1]?m.top+=f:"center"===n.at[1]&&(m.top+=f/2),u=e(k.at,p,f),m.left+=u[0],m.top+=u[1],this.each(function(){var s,r,l=t(this),h=l.outerWidth(),c=l.outerHeight(),d=i(this,"marginLeft"),_=i(this,"marginTop"),x=h+d+i(this,"marginRight")+y.width,C=c+_+i(this,"marginBottom")+y.height,D=t.extend({},m),T=e(k.my,l.outerWidth(),l.outerHeight());"right"===n.my[0]?D.left-=h:"center"===n.my[0]&&(D.left-=h/2),"bottom"===n.my[1]?D.top-=c:"center"===n.my[1]&&(D.top-=c/2),D.left+=T[0],D.top+=T[1],s={marginLeft:d,marginTop:_},t.each(["left","top"],function(e,i){t.ui.position[w[e]]&&t.ui.position[w[e]][i](D,{targetWidth:p,targetHeight:f,elemWidth:h,elemHeight:c,collisionPosition:s,collisionWidth:x,collisionHeight:C,offset:[u[0]+T[0],u[1]+T[1]],my:n.my,at:n.at,within:b,elem:l})}),n.using&&(r=function(t){var e=g.left-D.left,i=e+p-h,s=g.top-D.top,r=s+f-c,u={target:{element:v,left:g.left,top:g.top,width:p,height:f},element:{element:l,left:D.left,top:D.top,width:h,height:c},horizontal:0>i?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};h>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),l.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-r-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-r-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,(i>0||u>a(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,a,r,l,h=i.nodeName.toLowerCase();return"area"===h?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(h)?(r=!i.disabled,r&&(l=t(i).closest("fieldset")[0],l&&(r=!l.disabled))):r="a"===h?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var c=!1;t(document).on("mouseup",function(){c=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!c){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,n="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),c=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,c=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")},t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(this._blurActiveElement(e),this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]),s=t(e.target);s.closest(i).length||t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper),n=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options,o=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)
},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,a=this.options,r=this._isRootNode(this.scrollParent[0]),l=t.pageX,h=t.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(h=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(l=this.originalPageX),"x"===a.axis&&(h=this.originalPageY)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var n=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,n))})},stop:function(e,i,s){var n=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,n))})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0,t.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(n=!1),n})),n?(o.isOver||(o.isOver=1,s._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=s.offset.click.top,o.offset.click.left=s.offset.click.left,o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top,s._trigger("toSortable",e),s.dropped=o.element,t.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,o.fromOutside=s),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(e),i.position=s._generatePosition(e,!0),s._trigger("fromSortable",e),s.dropped=!1,t.each(s.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var n=t("body"),o=s.options;n.css("cursor")&&(o._cursor=n.css("cursor")),n.css("cursor",o.cursor)},stop:function(e,i,s){var n=s.options;n._cursor&&t("body").css("cursor",n._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("opacity")&&(o._opacity=n.css("opacity")),n.css("opacity",o.opacity)},stop:function(e,i,s){var n=s.options;n._opacity&&t(i.helper).css("opacity",n._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,s){var n=s.options,o=!1,a=s.scrollParentNotHidden[0],r=s.document[0];a!==r&&"HTML"!==a.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+a.offsetHeight-e.pageY<n.scrollSensitivity?a.scrollTop=o=a.scrollTop+n.scrollSpeed:e.pageY-s.overflowOffset.top<n.scrollSensitivity&&(a.scrollTop=o=a.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+a.offsetWidth-e.pageX<n.scrollSensitivity?a.scrollLeft=o=a.scrollLeft+n.scrollSpeed:e.pageX-s.overflowOffset.left<n.scrollSensitivity&&(a.scrollLeft=o=a.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(e.pageY-t(r).scrollTop()<n.scrollSensitivity?o=t(r).scrollTop(t(r).scrollTop()-n.scrollSpeed):t(window).height()-(e.pageY-t(r).scrollTop())<n.scrollSensitivity&&(o=t(r).scrollTop(t(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(e.pageX-t(r).scrollLeft()<n.scrollSensitivity?o=t(r).scrollLeft(t(r).scrollLeft()-n.scrollSpeed):t(window).width()-(e.pageX-t(r).scrollLeft())<n.scrollSensitivity&&(o=t(r).scrollLeft(t(r).scrollLeft()+n.scrollSpeed)))),o!==!1&&t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(s,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i,s){var n=s.options;s.snapElements=[],t(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var e=t(this),i=e.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(e,i,s){var n,o,a,r,l,h,c,u,d,p,f=s.options,g=f.snapTolerance,m=i.offset.left,_=m+s.helperProportions.width,v=i.offset.top,b=v+s.helperProportions.height;for(d=s.snapElements.length-1;d>=0;d--)l=s.snapElements[d].left-s.margins.left,h=l+s.snapElements[d].width,c=s.snapElements[d].top-s.margins.top,u=c+s.snapElements[d].height,l-g>_||m>h+g||c-g>b||v>u+g||!t.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=g>=Math.abs(c-b),o=g>=Math.abs(u-v),a=g>=Math.abs(l-_),r=g>=Math.abs(h-m),n&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left)),p=n||o||a||r,"outer"!==f.snapMode&&(n=g>=Math.abs(c-v),o=g>=Math.abs(u-b),a=g>=Math.abs(l-m),r=g>=Math.abs(h-_),n&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left)),!s.snapElements[d].snapping&&(n||o||a||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||o||a||r||p)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,o=s.options,a=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});a.length&&(n=parseInt(t(a[0]).css("zIndex"),10)||0,t(a).each(function(e){t(this).css("zIndex",n+e)}),this.css("zIndex",n+a.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("zIndex")&&(o._zIndex=n.css("zIndex")),n.css("zIndex",o.zIndex)},stop:function(e,i,s){var n=s.options;n._zIndex&&t(i.helper).css("zIndex",n._zIndex)}}),t.ui.draggable,t.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],void 0):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[],t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){for(var e=0;t.length>e;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,i){if("accept"===e)this.accept=t.isFunction(i)?i:function(t){return t.is(i)};else if("scope"===e){var s=t.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(e,i)},_activate:function(e){var i=t.ui.ddmanager.current;this._addActiveClass(),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this._removeActiveClass(),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._addHoverClass(),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeHoverClass(),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=t(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&u(s,t.extend(i,{offset:i.element.offset()}),i.options.tolerance,e)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var u=t.ui.intersect=function(){function t(t,e,i){return t>=e&&e+i>t}return function(e,i,s,n){if(!i.offset)return!1;var o=(e.positionAbs||e.position.absolute).left+e.margins.left,a=(e.positionAbs||e.position.absolute).top+e.margins.top,r=o+e.helperProportions.width,l=a+e.helperProportions.height,h=i.offset.left,c=i.offset.top,u=h+i.proportions().width,d=c+i.proportions().height;switch(s){case"fit":return o>=h&&u>=r&&a>=c&&d>=l;case"intersect":return o+e.helperProportions.width/2>h&&u>r-e.helperProportions.width/2&&a+e.helperProportions.height/2>c&&d>l-e.helperProportions.height/2;case"pointer":return t(n.pageY,c,i.proportions().height)&&t(n.pageX,h,i.proportions().width);case"touch":return(a>=c&&d>=a||l>=c&&d>=l||c>a&&l>d)&&(o>=h&&u>=o||r>=h&&u>=r||h>o&&r>u);default:return!1}}}();t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&u(e,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").on("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,o,a=u(e,this,this.options.tolerance,i),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return t(this).droppable("instance").options.scope===n}),o.length&&(s=t(o[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").off("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}},t.uiBackCompat!==!1&&t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),t.ui.droppable,t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t("<div>"),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,l=this._change[o];return this._updatePrevProperties(),l?(i=l.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,l,h=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,l=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,h.animate||this.element.css(t.extend(a,{top:l,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!h.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&h&&(t.left=r-e.minWidth),s&&h&&(t.left=r-e.maxWidth),a&&c&&(t.top=l-e.minHeight),n&&c&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,l={width:i.size.width-r,height:i.size.height-a},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(l,c&&h?{top:c,left:h}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,l=t(this).resizable("instance"),h=l.options,c=l.element,u=h.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(l.containerElement=t(d),/document/.test(u)||u===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=l._num(e.css("padding"+s))}),l.containerOffset=e.offset(),l.containerPosition=e.position(),l.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=l.containerOffset,n=l.containerSize.height,o=l.containerSize.width,a=l._hasScroll(d,"left")?d.scrollWidth:o,r=l._hasScroll(d)?d.scrollHeight:n,l.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,l=a.containerOffset,h=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=l),h.left<(a._helper?l.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-l.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?l.left:0),h.top<(a._helper?l.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-l.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?l.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-l.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-l.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),l=a.outerWidth()-e.sizeDiff.width,h=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:l,height:h}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:l,height:h})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};
t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,l="number"==typeof s.grid?[s.grid,s.grid]:s.grid,h=l[0]||1,c=l[1]||1,u=Math.round((n.width-o.width)/h)*h,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,g=s.maxWidth&&p>s.maxWidth,m=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=l,_&&(p+=h),v&&(f+=c),g&&(p-=h),m&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-h)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-h>0?(i.size.width=p,i.position.left=a.left-u):(p=h-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable,t.widget("ui.selectable",t.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e.elementPos=t(e.element[0]).offset(),e.selectees=t(e.options.filter,e.element[0]),e._addClass(e.selectees,"ui-selectee"),e.selectees.each(function(){var i=t(this),s=i.offset(),n={left:s.left-e.elementPos.left,top:s.top-e.elementPos.top};t.data(this,"selectable-item",{element:this,$element:i,left:n.left,top:n.top,right:n.left+i.outerWidth(),bottom:n.top+i.outerHeight(),startselected:!1,selected:i.hasClass("ui-selected"),selecting:i.hasClass("ui-selecting"),unselecting:i.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=t("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.elementPos=t(this.element[0]).offset(),this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(i._removeClass(s.$element,"ui-selected"),s.selected=!1,i._addClass(s.$element,"ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),i._removeClass(n.$element,s?"ui-unselecting":"ui-selected")._addClass(n.$element,s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,o=this.opos[0],a=this.opos[1],r=e.pageX,l=e.pageY;return o>r&&(i=r,r=o,o=i),a>l&&(i=l,l=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:l-a}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),h=!1,c={};i&&i.element!==s.element[0]&&(c.left=i.left+s.elementPos.left,c.right=i.right+s.elementPos.left,c.top=i.top+s.elementPos.top,c.bottom=i.bottom+s.elementPos.top,"touch"===n.tolerance?h=!(c.left>r||o>c.right||c.top>l||a>c.bottom):"fit"===n.tolerance&&(h=c.left>o&&r>c.right&&c.top>a&&l>c.bottom),h?(i.selected&&(s._removeClass(i.$element,"ui-selected"),i.selected=!1),i.unselecting&&(s._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1),i.selecting||(s._addClass(i.$element,"ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,s._addClass(i.$element,"ui-selected"),i.selected=!0):(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,i.startselected&&(s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(s._removeClass(i.$element,"ui-selected"),i.selected=!1,s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-selecting")._addClass(s.$element,"ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,l=r+t.height,h=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+h>r&&l>s+h,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&l>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=s&&n;return o?(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1)):!1},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],l=[],h=this._connectWith();if(h&&e)for(s=h.length-1;s>=0;s--)for(o=t(h[s],this.document[0]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&l.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(l.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=l.length-1;s>=0;s--)l[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,l,h,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,h=r.length;h>s;s++)l=t(r[s]),l.data(this.widgetName+"-item",a),c.push({item:l,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]);return e._addClass(n,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(n,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t("<td>&#160;</td>",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,a,r,l,h,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),a=c?"left":"top",r=c?"width":"height",u=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(l=this.items[s].item.offset()[a],h=!1,e[u]-l>this.items[s][r]/2&&(h=!0),n>Math.abs(e[u]-l)&&(n=Math.abs(e[u]-l),o=this.items[s],this.direction=h?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t()}},_createIcons:function(){var e,i,s=this.options.icons;s&&(e=t("<span>"),this._addClass(e,"ui-accordion-header-icon","ui-icon "+s.header),e.prependTo(this.headers),i=this.active.children(".ui-accordion-header-icon"),this._removeClass(i,s.header)._addClass(i,null,s.activeHeader)._addClass(this.headers,"ui-accordion-icons"))
},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),void 0)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),t(o).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var e,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var e=t(this),i=e.uniqueId().attr("id"),s=e.next(),n=s.uniqueId().attr("id");e.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(e=n.height(),this.element.siblings(":visible").each(function(){var i=t(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(e-=i.outerHeight(!0))}),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===s&&(e=0,this.headers.next().each(function(){var i=t(this).is(":visible");i||t(this).show(),e=Math.max(e,t(this).css("height","").height()),i||t(this).hide()}).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i,s,n=this.options,o=this.active,a=t(e.currentTarget),r=a[0]===o[0],l=r&&n.collapsible,h=l?t():a.next(),c=o.next(),u={oldHeader:o,oldPanel:c,newHeader:l?t():a,newPanel:h};e.preventDefault(),r&&!n.collapsible||this._trigger("beforeActivate",e,u)===!1||(n.active=l?!1:this.headers.index(a),this.active=r?t():a,this._toggle(u),this._removeClass(o,"ui-accordion-header-active","ui-state-active"),n.icons&&(i=o.children(".ui-accordion-header-icon"),this._removeClass(i,null,n.icons.activeHeader)._addClass(i,null,n.icons.header)),r||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),n.icons&&(s=a.children(".ui-accordion-header-icon"),this._removeClass(s,null,n.icons.header)._addClass(s,null,n.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(t(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,e,i){var s,n,o,a=this,r=0,l=t.css("box-sizing"),h=t.length&&(!e.length||t.index()<e.index()),c=this.options.animate||{},u=h&&c.down||c,d=function(){a._toggleComplete(i)};return"number"==typeof u&&(o=u),"string"==typeof u&&(n=u),n=n||u.easing||c.easing,o=o||u.duration||c.duration,e.length?t.length?(s=t.show().outerHeight(),e.animate(this.hideProps,{duration:o,easing:n,step:function(t,e){e.now=Math.round(t)}}),t.hide().animate(this.showProps,{duration:o,easing:n,complete:d,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?"content-box"===l&&(r+=i.now):"content"!==a.options.heightStyle&&(i.now=Math.round(s-e.outerHeight()-r),r=0)}}),void 0):e.animate(this.hideProps,o,n,d):t.animate(this.showProps,o,n,d)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),t.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var i=t(e.target),s=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&s.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var i=t(e.target).closest(".ui-menu-item"),s=t(e.currentTarget);i[0]===s[0]&&(this._removeClass(s.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,s))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){var i=!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]));i&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),i=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),i.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var i,s,n,o,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,s=this.previousFilter||"",o=!1,n=e.keyCode>=96&&105>=e.keyCode?""+(e.keyCode-96):String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),n===s?o=!0:n=s+n,i=this._filterMenuItems(n),i=o&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(e.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(e,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i,s,n,o,a=this,r=this.options.icons.submenu,l=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),s=l.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev(),s=t("<span>").data("ui-menu-submenu-caret",!0);a._addClass(s,"ui-menu-icon","ui-icon "+r),i.attr("aria-haspopup","true").prepend(s),e.attr("aria-labelledby",i.attr("id"))}),this._addClass(s,"ui-menu","ui-widget ui-widget-content ui-front"),e=l.add(this.element),i=e.find(this.options.items),i.not(".ui-menu-item").each(function(){var e=t(this);a._isDivider(e)&&a._addClass(e,"ui-menu-divider","ui-widget-content")}),n=i.not(".ui-menu-item, .ui-menu-divider"),o=n.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(n,"ui-menu-item")._addClass(o,"ui-menu-item-wrapper"),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t+""),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,s,n;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),n=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.outerHeight(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this._removeClass(s.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(e),void 0)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items).first())),void 0):(this.next(e),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)},_filterMenuItems:function(e){var i=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()))})}}),t.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n;this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,void 0;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),void 0):(this._searchTimeout(t),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(t),this._change(t),void 0)}}),this._initSource(),this.menu=t("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(e,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:n})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&t.trim(s).length&&(this.liveRegion.children().hide(),t("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,i){var s=i.item.data("ui-autocomplete-item"),n=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=n,this._delay(function(){this.previous=n,this.selectedItem=s})),!1!==this._trigger("select",e,{item:s})&&this._value(s.value),this.term=this._value(),this.close(e),this.selectedItem=s}}),this.liveRegion=t("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var i=this.menu.element[0];return e.target===this.element[0]||e.target===i||t.contains(i,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),i=this.menu.element.is(":visible"),s=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;(!e||e&&!i&&!s)&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<div>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[t](e),void 0):(this.search(null,e),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("<div>").text(i).appendTo(this.liveRegion))}}),t.ui.autocomplete;var d=/ui-corner-([a-z]){2,6}/g;t.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,function(s,n){var o,a={};return n?"controlgroupLabel"===s?(o=e.element.find(n),o.each(function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),e._addClass(o,null,"ui-widget ui-widget-content ui-state-default"),i=i.concat(o.get()),void 0):(t.fn[s]&&(a=e["_"+s+"Options"]?e["_"+s+"Options"]("middle"):{classes:{}},e.element.find(n).each(function(){var n=t(this),o=n[s]("instance"),r=t.widget.extend({},a);if("button"!==s||!n.parent(".ui-spinner").length){o||(o=n[s]()[s]("instance")),o&&(r.classes=e._resolveClassesValues(r.classes,o)),n[s](r);var l=n[s]("widget");t.data(l[0],"ui-controlgroup-data",o?o:n[s]("instance")),i.push(l[0])}})),void 0):void 0}),this.childWidgets=t(t.unique(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var i=t(this),s=i.data("ui-controlgroup-data");s&&s[e]&&s[e]()})},_updateCornerClass:function(t,e){var i="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",s=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,i),this._addClass(t,null,s)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e?"auto":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(e,i){var s={};return t.each(e,function(n){var o=i.options.classes[n]||"";o=t.trim(o.replace(d,"")),s[n]=(o+" "+e[n]).replace(/\s+/g," ")}),s},_setOption:function(t,e){return"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"===t?(this._callChildMethod(e?"disable":"enable"),void 0):(this.refresh(),void 0)},refresh:function(){var e,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],function(t,s){var n=e[s]().data("ui-controlgroup-data");if(n&&i["_"+n.widgetName+"Options"]){var o=i["_"+n.widgetName+"Options"](1===e.length?"only":s);o.classes=i._resolveClassesValues(o.classes,n),n.element[n.widgetName](o)}else i._updateCornerClass(e[s](),s)}),this._callChildMethod("refresh"))}}),t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,s=this,n=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){s.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML}),this.originalLabel&&(n.label=this.originalLabel),e=this.element[0].disabled,null!=e&&(n.disabled=e),n},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e,i=this.element[0].name,s="input[name='"+t.ui.escapeSelector(i)+"']";return i?(e=this.form.length?t(this.form[0].elements).filter(s):t(s).filter(function(){return 0===t(this).form().length}),e.not(this.element)):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){return"label"!==t||e?(this._super(t,e),"disabled"===t?(this._toggleClass(this.label,null,"ui-state-disabled",e),this.element[0].disabled=e,void 0):(this.refresh(),void 0)):void 0},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)
},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio,t.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),t=this.element[0].disabled,null!=t&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,i){var s="iconPosition"!==e,n=s?this.options.iconPosition:i,o="top"===n||"bottom"===n;this.icon?s&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),s&&this._addClass(this.icon,null,i),this._attachIcon(n),o?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(n))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0===t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),t.uiBackCompat!==!1&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){return"text"===t?(this._super("showLabel",e),void 0):("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments),void 0)}}),t.fn.button=function(e){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t.ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(t.fn.button),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),t.ui.button,t.extend(t.ui,{datepicker:{version:"1.12.1"}});var p;t.extend(s.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return a(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),n),o.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var s=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),t.data(e,"datepicker",i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.on("focus",this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.on("click",function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,n,o){var r,l,h,c,u,d=this._dialogInst;return d||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},t.data(this._dialogInput[0],"datepicker",d)),a(d.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(l=document.documentElement.clientWidth,h=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,u=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+c,h/2-150+u]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,"datepicker");s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),p===n&&(p=null))},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,i,s){var n,o,r,l,h=this._getInst(e);return 2===arguments.length&&"string"==typeof i?"defaults"===i?t.extend({},t.datepicker._defaults):h?"all"===i?t.extend({},h.settings):this._get(h,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),h&&(this._curInst===h&&this._hideDatepicker(),o=this._getDateDatepicker(e,!0),r=this._getMinMaxDate(h,"min"),l=this._getMinMaxDate(h,"max"),a(h.settings,n),null!==r&&void 0!==n.dateFormat&&void 0===n.minDate&&(h.settings.minDate=this._formatDate(h,r)),null!==l&&void 0!==n.dateFormat&&void 0===n.maxDate&&(h.settings.maxDate=this._formatDate(h,l)),"disabled"in n&&(n.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),h),this._autoSize(h),this._setDate(h,o),this._updateAlternate(h),this._updateDatepicker(h)),void 0)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),n[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),i=t.datepicker._get(o,"onSelect"),i?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var i,s,n=t.datepicker._getInst(e.target);return t.datepicker._get(n,"constrainInput")?(i=t.datepicker._possibleChars(t.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var s,n,o,r,l,h,c;s=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==s&&(t.datepicker._curInst.dpDiv.stop(!0,!0),s&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),n=t.datepicker._get(s,"beforeShow"),o=n?n.apply(e,[e,s]):{},o!==!1&&(a(s.settings,o),s.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(s),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),l={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,s.dpDiv.empty(),s.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(s),l=t.datepicker._checkOffset(s,l,r),s.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:l.left+"px",top:l.top+"px"}),s.inline||(h=t.datepicker._get(s,"showAnim"),c=t.datepicker._get(s,"duration"),s.dpDiv.css("z-index",i(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?s.dpDiv.show(h,t.datepicker._get(s,"showOptions"),c):s.dpDiv[h||"show"](h?c:null),t.datepicker._shouldFocusInput(s)&&s.input.trigger("focus"),t.datepicker._curInst=s))}},_updateDatepicker:function(e){this.maxRows=4,p=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var i,s=this._getNumberOfMonths(e),n=s[1],a=17,r=e.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,l=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),h=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>l&&l>n?Math.abs(i.left+n-l):0),i.top-=Math.min(i.top,i.top+o>h&&h>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,o,a=this._curInst;!a||e&&a!==t.data(e,"datepicker")||this._datepickerShowing&&(i=this._get(a,"showAnim"),s=this._get(a,"duration"),n=function(){t.datepicker._tidyDialog(a)},t.effects&&(t.effects.effect[i]||t.effects[i])?a.dpDiv.hide(i,t.datepicker._get(a,"showOptions"),s,n):a.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,o=this._get(a,"onClose"),o&&o.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),o=this._getInst(n[0]);o["selected"+("M"===s?"Month":"Year")]=o["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(e,i,s,n){var o,a=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=t("a",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),s=this._get(o,"onSelect"),s?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(o).val(n))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(e,i,s){if(null==e||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,o,a,r,l=0,h=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,c="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),u=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,d=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,g=-1,m=-1,_=-1,v=-1,b=!1,y=function(t){var i=e.length>n+1&&e.charAt(n+1)===t;return i&&n++,i},w=function(t){var e=y(t),s="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n="y"===t?s:1,o=RegExp("^\\d{"+n+","+s+"}"),a=i.substring(l).match(o);if(!a)throw"Missing number at position "+l;return l+=a[0].length,parseInt(a[0],10)},k=function(e,s,n){var o=-1,a=t.map(y(e)?n:s,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(a,function(t,e){var s=e[1];return i.substr(l,s.length).toLowerCase()===s.toLowerCase()?(o=e[0],l+=s.length,!1):void 0}),-1!==o)return o+1;throw"Unknown name at position "+l},x=function(){if(i.charAt(l)!==e.charAt(n))throw"Unexpected literal at position "+l;l++};for(n=0;e.length>n;n++)if(b)"'"!==e.charAt(n)||y("'")?x():b=!1;else switch(e.charAt(n)){case"d":_=w("d");break;case"D":k("D",u,d);break;case"o":v=w("o");break;case"m":m=w("m");break;case"M":m=k("M",p,f);break;case"y":g=w("y");break;case"@":r=new Date(w("@")),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"!":r=new Date((w("!")-this._ticksTo1970)/1e4),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"'":y("'")?x():b=!0;break;default:x()}if(i.length>l&&(a=i.substr(l),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c>=g?0:-100)),v>-1)for(m=1,_=v;;){if(o=this._getDaysInMonth(g,m-1),o>=_)break;m++,_-=o}if(r=this._daylightSavingAdjust(new Date(g,m-1,_)),r.getFullYear()!==g||r.getMonth()+1!==m||r.getDate()!==_)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,l=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},h=function(t,e,i){var s=""+e;if(l(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return l(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||l("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=h("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,o);break;case"o":u+=h("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=h("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),a,r);break;case"y":u+=l("y")?e.getFullYear():(10>e.getFullYear()%100?"0":"")+e.getFullYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":l("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,e){return void 0!==t.settings[e]?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(r){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},o=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=n.getFullYear(),a=n.getMonth(),r=n.getDate(),l=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,h=l.exec(i);h;){switch(h[2]||"d"){case"d":case"D":r+=parseInt(h[1],10);break;case"w":case"W":r+=7*parseInt(h[1],10);break;case"m":case"M":a+=parseInt(h[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a));break;case"y":case"Y":o+=parseInt(h[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a))}h=l.exec(i)}return new Date(o,a,r)},a=null==i||""===i?s:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return a=a&&"Invalid Date"==""+a?s:a,a&&(a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)),this._daylightSavingAdjust(a)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,l,h,c,u,d,p,f,g,m,_,v,b,y,w,k,x,C,D,T,I,M,P,S,N,H,A,z,O,E,W,F,L,R=new Date,Y=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),B=this._get(t,"isRTL"),j=this._get(t,"showButtonPanel"),q=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),U=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),X=this._get(t,"stepMonths"),$=1!==U[0]||1!==U[1],G=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),J=this._getMinMaxDate(t,"min"),Q=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),Q)for(e=this._daylightSavingAdjust(new Date(Q.getFullYear(),Q.getMonth()-U[0]*U[1]+1,Q.getDate())),e=J&&J>e?J:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-X,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(B?"e":"w")+"'>"+i+"</span></a>":q?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(B?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+X,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(B?"w":"e")+"'>"+n+"</span></a>":q?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(B?"w":"e")+"'>"+n+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?G:Y,a=K?this.formatDate(a,r,this._getFormatConfig(t)):a,l=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",h=j?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(B?l:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(B?"":l)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),_=this._get(t,"showOtherMonths"),v=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;U[0]>k;k++){for(x="",this.maxRows=4,C=0;U[1]>C;C++){if(D=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),T=" ui-corner-all",I="",$){if(I+="<div class='ui-datepicker-group",U[1]>1)switch(C){case 0:I+=" ui-datepicker-group-first",T=" ui-corner-"+(B?"right":"left");
break;case U[1]-1:I+=" ui-datepicker-group-last",T=" ui-corner-"+(B?"left":"right");break;default:I+=" ui-datepicker-group-middle",T=""}I+="'>"}for(I+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+T+"'>"+(/all|left/.test(T)&&0===k?B?o:s:"")+(/all|right/.test(T)&&0===k?B?s:o:"")+this._generateMonthYearHeader(t,Z,te,J,Q,k>0||C>0,f,g)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",M=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)P=(w+c)%7,M+="<th scope='col'"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[P]+"'>"+p[P]+"</span></th>";for(I+=M+"</tr></thead><tbody>",S=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),N=(this._getFirstDayOfMonth(te,Z)-c+7)%7,H=Math.ceil((N+S)/7),A=$?this.maxRows>H?this.maxRows:H:H,this.maxRows=A,z=this._daylightSavingAdjust(new Date(te,Z,1-N)),O=0;A>O;O++){for(I+="<tr>",E=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(z)+"</td>":"",w=0;7>w;w++)W=m?m.apply(t.input?t.input[0]:null,[z]):[!0,""],F=z.getMonth()!==Z,L=F&&!v||!W[0]||J&&J>z||Q&&z>Q,E+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(z.getTime()===D.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===z.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!_?"":" "+W[1]+(z.getTime()===G.getTime()?" "+this._currentClass:"")+(z.getTime()===Y.getTime()?" ui-datepicker-today":""))+"'"+(F&&!_||!W[2]?"":" title='"+W[2].replace(/'/g,"&#39;")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(F&&!_?"&#xa0;":L?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===Y.getTime()?" ui-state-highlight":"")+(z.getTime()===G.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);I+=E+"</tr>"}Z++,Z>11&&(Z=0,te++),I+="</tbody></table>"+($?"</div>"+(U[0]>0&&C===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=I}y+=x}return y+=h,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var l,h,c,u,d,p,f,g,m=this._get(t,"changeMonth"),_=this._get(t,"changeYear"),v=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(l=s&&s.getFullYear()===i,h=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!l||c>=s.getMonth())&&(!h||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(v||(b+=y+(!o&&m&&_?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!_)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";g>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),v&&(b+=(!o&&m&&_?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,l=this._get(t,"yearRange");return l&&(i=l.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||r>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).on("mousedown",t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new s,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.12.1",t.datepicker,t.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||t.ui.safeBlur(t.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+t(this).css("z-index")}).get(),o=Math.max.apply(null,n);return o>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",o+1),s=!0),s&&!i&&this._trigger("focus",e),s},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=t(t.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var t=this._focusedElement;t||(t=this.element.find("[autofocus]")),t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_keepFocus:function(e){function i(){var e=t.ui.safeActiveElement(this.document[0]),i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),void 0;if(e.keyCode===t.ui.keyCode.TAB&&!e.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(this._delay(function(){n.trigger("focus")}),e.preventDefault()):(this._delay(function(){s.trigger("focus")}),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:t("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(e,"ui-dialog-title"),this._title(e),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this._removeClass(this.uiDialog,"ui-dialog-buttons"),void 0):(t.each(i,function(i,s){var n,o;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,o={icon:s.icon,iconPosition:s.iconPosition,showLabel:s.showLabel,icons:s.icons,text:s.text},delete s.click,delete s.icon,delete s.iconPosition,delete s.showLabel,delete s.icons,"boolean"==typeof s.text&&delete s.text,t("<button></button>",s).button(o).appendTo(e.uiButtonSet).on("click",function(){n.apply(e.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){i._addClass(t(this),"ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,o){var a=o.offset.left-i.document.scrollLeft(),r=o.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" "+"top"+(r>=0?"+":"")+r,of:i.window},i._removeClass(t(this),"ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(o))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,o=this.uiDialog.css("position"),a="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:a,start:function(s,n){i._addClass(t(this),"ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,o){var a=i.uiDialog.offset(),r=a.left-i.document.scrollLeft(),l=a.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(l>=0?"+":"")+l,of:i.window},i._removeClass(t(this),"ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(o))}}).css("position",o)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget(),this._focusedElement=t(e.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),i=t.inArray(this,e);-1!==i&&e.splice(i,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(e){var i=this,s=!1,n={};t.each(e,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,i){var s,n,o=this.uiDialog;"disabled"!==e&&(this._super(e,i),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:t("<a>").text(""+this.options.closeText).html()}),"draggable"===e&&(s=o.is(":data(ui-draggable)"),s&&!i&&o.draggable("destroy"),!s&&i&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(n=o.is(":data(ui-resizable)"),n&&!i&&o.resizable("destroy"),n&&"string"==typeof i&&o.resizable("option","handles",i),n||i===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=!0;this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(t){e||this._allowInteraction(t)||(t.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=t("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var t=this.document.data("ui-dialog-overlays")-1;t?this.document.data("ui-dialog-overlays",t):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}}),t.ui.dialog,t.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=t("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){return void 0===t?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),void 0)},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).width(i.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,e===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}}),t.widget("ui.selectmenu",[t.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=t()},_drawButton:function(){var e,i=this,s=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.focus(),t.preventDefault()}}),this.element.hide(),this.button=t("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),e=t("<span>").appendTo(this.button),this._addClass(e,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(s).appendTo(this.button),this.options.width!==!1&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){i._rendered||i._refreshMenu()})},_drawMenu:function(){var e=this;this.menu=t("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=t("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,i){t.preventDefault(),e._setSelection(),e._select(i.item.data("ui-selectmenu-item"),t)},focus:function(t,i){var s=i.item.data("ui-selectmenu-item");null!=e.focusIndex&&s.index!==e.focusIndex&&(e._trigger("focus",t,{item:s}),e.isOpen||e._select(s,t)),e.focusIndex=s.index,e.button.attr("aria-activedescendant",e.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t,e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(t.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(e){var i=t("<span>");return this._setText(i,e.label),this._addClass(i,"ui-selectmenu-text"),i},_renderMenu:function(e,i){var s=this,n="";t.each(i,function(i,o){var a;o.optgroup!==n&&(a=t("<li>",{text:o.optgroup}),s._addClass(a,"ui-selectmenu-optgroup","ui-menu-divider"+(o.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),a.appendTo(e),n=o.optgroup),s._renderItemData(e,o)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(e,i){var s=t("<li>"),n=t("<div>",{title:i.element.attr("title")});return i.disabled&&this._addClass(s,null,"ui-state-disabled"),this._setText(n,i.label),s.append(n).appendTo(e)},_setText:function(t,e){e?t.text(e):t.html("&#160;")},_move:function(t,e){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),n+=":not(.ui-state-disabled)"),s="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](n).eq(-1):i[t+"All"](n).eq(0),s.length&&this.menuInstance.focus(e,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?(t=window.getSelection(),t.removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(e){this.isOpen&&(t(e.target).closest(".ui-selectmenu-menu, #"+t.ui.escapeSelector(this.ids.button)).length||this.close(e))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection(),t.rangeCount&&(this.range=t.getRangeAt(0))):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(e){var i=!0;switch(e.keyCode){case t.ui.keyCode.TAB:case t.ui.keyCode.ESCAPE:this.close(e),i=!1;break;case t.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(e);break;case t.ui.keyCode.UP:e.altKey?this._toggle(e):this._move("prev",e);break;case t.ui.keyCode.DOWN:e.altKey?this._toggle(e):this._move("next",e);break;case t.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(e):this._toggle(e);break;case t.ui.keyCode.LEFT:this._move("prev",e);break;case t.ui.keyCode.RIGHT:this._move("next",e);break;case t.ui.keyCode.HOME:case t.ui.keyCode.PAGE_UP:this._move("first",e);break;case t.ui.keyCode.END:case t.ui.keyCode.PAGE_DOWN:this._move("last",e);break;default:this.menu.trigger(e),i=!1}i&&e.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){var e=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(t,e){if("icons"===t){var i=this.button.find("span.ui-icon");this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)}this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;return t===!1?(this.button.css("width",""),void 0):(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t),void 0)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(e){var i=this,s=[];e.each(function(e,n){s.push(i._parseOption(t(n),e))}),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),t.widget("ui.slider",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle"),o="<span tabindex='0'></span>",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e).attr("tabIndex",0)})},_createRange:function(){var e=this.options;e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=t("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),("min"===e.range||"max"===e.range)&&this._addClass(this.range,"ui-slider-range-"+e.range)):(this.range&&this.range.remove(),this.range=null)
},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,l,h,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,o=t(this),a=e)}),r=this._start(e,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,this._addClass(o,null,"ui-state-active"),o.trigger("focus"),l=o.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-o.width()/2,top:e.pageY-l.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n,o=this.value(),a=this.values();this._hasMultipleValues()&&(n=this.values(e?0:1),o=this.values(e),2===this.options.values.length&&this.options.range===!0&&(i=0===e?Math.min(n,i):Math.max(n,i)),a[e]=i),i!==o&&(s=this._trigger("slide",t,this._uiHash(e,i,a)),s!==!1&&(this._hasMultipleValues()?this.values(e,i):this.value(i)))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),void 0;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this._hasMultipleValues()?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),this._super(e,i),e){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(i),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=n-1;s>=0;s--)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this._hasMultipleValues()){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step,s=Math.round((t-e)/i)*i;t=s+e,t>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,l=this,h=this._animateOff?!1:r.animate,c={};this._hasMultipleValues()?this.handles.each(function(s){i=100*((l.values(s)-l._valueMin())/(l._valueMax()-l._valueMin())),c["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](c,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===s&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:100-i+"%"},r.animate),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:100-i+"%"},r.animate))},_handleEvents:{keydown:function(e){var i,s,n,o,a=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(t(e.target),null,"ui-state-active"),i=this._start(e,a),i===!1))return}switch(o=this.options.step,s=n=this._hasMultipleValues()?this.values(a):this.value(),e.keyCode){case t.ui.keyCode.HOME:n=this._valueMin();break;case t.ui.keyCode.END:n=this._valueMax();break;case t.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-o)}this._slide(e,a,n)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),this._removeClass(t(e.target),null,"ui-state-active"))}}}),t.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e=this._super(),i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);null!=n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var e=this.element[0]===t.ui.safeActiveElement(this.document[0]);e||(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===t.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i,s,n;return"culture"===t||"numberFormat"===t?(i=this._parse(this.element.val()),this.options[t]=e,this.element.val(this._format(i)),void 0):(("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(s=this.buttons.first().find(".ui-icon"),this._removeClass(s,null,this.options.icons.up),this._addClass(s,null,e.up),n=this.buttons.last().find(".ui-icon"),this._removeClass(n,null,this.options.icons.down),this._addClass(n,null,e.down)),this._super(t,e),void 0)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:r(function(t){this._super(t)}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null===t?!1:t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:r(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:r(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:r(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:r(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(r(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),t.uiBackCompat!==!1&&t.widget("ui.spinner",t.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),t.ui.spinner,t.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var t=/#.*$/;return function(e){var i,s;i=e.href.replace(t,""),s=location.href.replace(t,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return e.hash.length>1&&i===s}}(),_create:function(){var e=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var e=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===e&&(s&&this.tabs.each(function(i,n){return t(n).attr("aria-controls")===s?(e=i,!1):void 0}),null===e&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===e||-1===e)&&(e=this.tabs.length?0:!1)),e!==!1&&(e=this.tabs.index(this.tabs.eq(e)),-1===e&&(e=i?!1:0)),!i&&e===!1&&this.anchors.length&&(e=0),e},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var i=t(t.ui.safeActiveElement(this.document[0])).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:s++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:n=!1,s--;break;case t.ui.keyCode.END:s=this.anchors.length-1;break;case t.ui.keyCode.HOME:s=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}e.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),e.ctrlKey||e.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e),void 0)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=t(),this.anchors.each(function(i,s){var n,o,a,r=t(s).uniqueId().attr("id"),l=t(s).closest("li"),h=l.attr("aria-controls");e._isLocal(s)?(n=s.hash,a=n.substring(1),o=e.element.find(e._sanitizeSelector(n))):(a=l.attr("aria-controls")||t({}).uniqueId()[0].id,n="#"+a,o=e.element.find(n),o.length||(o=e._createPanel(a),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),h&&l.data("ui-tabs-aria-controls",h),l.attr({"aria-controls":a,"aria-labelledby":r}),o.attr("aria-labelledby",r)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(e){var i,s,n;for(t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1),n=0;s=this.tabs[n];n++)i=t(s),e===!0||-1!==t.inArray(n,e)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=e,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,e===!0)},_setupEvents:function(e){var i={};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n.closest("li"),a=o[0]===s[0],r=a&&i.collapsible,l=r?t():this._getPanelForTab(o),h=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:h,newTab:r?t():o,newPanel:l};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?t():o,this.xhr&&this.xhr.abort(),h.length||l.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),l.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,i){function s(){o.running=!1,o._trigger("activate",e,i)}function n(){o._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){o._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n()}):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+t.ui.escapeSelector(e)+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){var i=this.options.disabled;i!==!1&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isArray(i)?t.map(i,function(t){return t!==e?t:null}):t.map(this.tabs,function(t,i){return i!==e?i:null})),this._setOptionDisabled(i))},disable:function(e){var i=this.options.disabled;if(i!==!0){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1!==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort():[e]}this._setOptionDisabled(i)}},load:function(e,i){e=this._getIndex(e);var s=this,n=this.tabs.eq(e),o=n.find(".ui-tabs-anchor"),a=this._getPanelForTab(n),r={tab:n,panel:a},l=function(t,e){"abort"===e&&s.panels.stop(!1,!0),s._removeClass(n,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===s.xhr&&delete s.xhr};this._isLocal(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(n,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,n){setTimeout(function(){a.html(t),s._trigger("load",i,r),l(n,e)},1)}).fail(function(t,e){setTimeout(function(){l(t,e)},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href").replace(/#.*$/,""),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),t.uiBackCompat!==!1&&t.widget("ui.tabs",t.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),t.ui.tabs,t.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))},_removeDescribedBy:function(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=t([])},_setOption:function(e,i){var s=this;this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s.element[0],e.close(n,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var e=t(this);return e.is("[title]")?e.data("ui-tooltip-title",e.attr("title")).removeAttr("title"):void 0}))},_enable:function(){this.disabledTitles.each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))}),this.disabledTitles=t([])},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(e,s),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s||s.nodeType||s.jquery?this._open(e,t,s):(i=s.call(t[0],function(i){n._delay(function(){t.data("ui-tooltip-open")&&(e&&(e.type=o),this._open(e,t,i))})}),i&&this._open(e,t,i),void 0)},_open:function(e,i,s){function n(t){h.of=t,a.is(":hidden")||a.position(h)}var o,a,r,l,h=t.extend({},this.options.position);if(s){if(o=this._find(i))return o.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),o=this._tooltip(i),a=o.tooltip,this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),l=t("<div>").html(a.find(".ui-tooltip-content").html()),l.removeAttr("name").find("[name]").removeAttr("name"),l.removeAttr("id").find("[id]").removeAttr("id"),l.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:n}),n(e)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(n(h.of),clearInterval(r))},t.fx.interval)),this._trigger("open",e,{tooltip:a})}},_registerCloseHandlers:function(e,i){var s={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),e&&"mouseover"!==e.type||(s.mouseleave="close"),e&&"focusin"!==e.type||(s.focusout="close"),this._on(!0,i,s)},close:function(e){var i,s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);return o?(i=o.tooltip,o.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),o.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]
}),o.closing=!0,this._trigger("close",e,{tooltip:i}),o.hiding||(o.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(e){var i=t("<div>").attr("role","tooltip"),s=t("<div>").appendTo(i),n=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[n]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur"),o=s.element;n.target=n.currentTarget=o[0],e.close(n,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),t.uiBackCompat!==!1&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip;var f="ui-effects-",g="ui-effects-style",m="ui-effects-animated",_=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),f(l,function(t,o){var a,r=o.re.exec(i),l=r&&o.parse(r),h=o.space||"rgba";return l?(a=s[h](l),s[c[h].cache]=a[c[h].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,a,r,l){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,l],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof h?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),o=c[n],a=0===this.alpha()?h("transparent"):this,r=a[o.cache]||o.to(a._rgba),l=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],h=s[o],c=u[n.type]||{};null!==h&&(null===a?l[o]=h:(c.mod&&(h-a>c.mod/2?a+=c.mod:a-h>c.mod/2&&(a-=c.mod)),l[o]=i((h-a)*e+a,n)))}),this[n](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),l=Math.min(s,n,o),h=r-l,c=r+l,u=.5*c;return e=l===r?0:s===r?60*(n-o)/h+360:n===r?60*(o-s)/h+120:60*(s-n)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[a]&&(this[a]=l(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=h(c(d)),n[a]=d,n):h(d)},f(o,function(e,i){h.fn[e]||(h.fn[e]=function(n){var o,a=t.type(n),l="alpha"===e?this._hsla?"hsla":"rgba":s,h=this[l](),c=h[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),h[i.idx]=n,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=h(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(l){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(_),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(_.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var l=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",h=l.children?a.find("*").addBack():a;h=h.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(s,function(t,e){n[e]&&a[e+"Class"](n[e])})},o(),h=h.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),s=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,h.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}function s(t,e){var i=e.outerWidth(),s=e.outerHeight(),n=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=n.exec(t)||["",0,i,s,0];return{top:parseFloat(o[1])||0,right:"auto"===o[2]?i:parseFloat(o[2]),bottom:"auto"===o[3]?s:parseFloat(o[3]),left:parseFloat(o[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=function(e){return function(i){return!!t(i).data(m)||e(i)}}(t.expr.filters.animated)),t.uiBackCompat!==!1&&t.extend(t.effects,{save:function(t,e){for(var i=0,s=e.length;s>i;i++)null!==e[i]&&t.data(f+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;n>s;s++)null!==e[s]&&(i=t.data(f+e[s]),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.1",define:function(e,i,s){return s||(s=i,i="effect"),t.effects.effect[e]=s,t.effects.effect[e].mode=i,s},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();e>1&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(g,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(g)||"",t.removeData(g)},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(e){var i,s=e.css("position"),n=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(s)&&(s="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),"float":e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data(f+"placeholder",i)),e.css({position:s,left:n.left,top:n.top}),i},removePlaceholder:function(t){var e=f+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){r.removeData(m),t.effects.cleanUp(r),"hide"===s.mode&&r.hide(),a()}function a(){t.isFunction(l)&&l.call(r[0]),t.isFunction(e)&&e()}var r=t(this);s.mode=c.shift(),t.uiBackCompat===!1||o?"none"===s.mode?(r[h](),a()):n.call(r[0],s,i):(r.is(":hidden")?"hide"===h:"show"===h)?(r[h](),a()):n.call(r[0],s,a)}var s=e.apply(this,arguments),n=t.effects.effect[s.effect],o=n.mode,a=s.queue,r=a||"fx",l=s.complete,h=s.mode,c=[],u=function(e){var i=t(this),s=t.effects.mode(i,h)||o;i.data(m,!0),c.push(s),o&&("show"===s||s===o&&"hide"===s)&&i.show(),o&&"none"===s||t.effects.saveStyle(i),t.isFunction(e)&&e()};return t.fx.off||!n?h?this[h](s.duration,l):this.each(function(){l&&l.call(this)}):a===!1?this.each(u).each(i):this.queue(r,u).queue(r,i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):s(this.css("clip"),this)},transfer:function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,l=o?a.scrollLeft():0,h=n.offset(),c={top:h.top-r,left:h.left-l,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(e.className).css({top:u.top-r,left:u.left-l,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),t.isFunction(i)&&i()})}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=s(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}();var v=t.effects;t.effects.define("blind","hide",function(e,i){var s={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},n=t(this),o=e.direction||"up",a=n.cssClip(),r={clip:t.extend({},a)},l=t.effects.createPlaceholder(n);r.clip[s[o][0]]=r.clip[s[o][1]],"show"===e.mode&&(n.cssClip(r.clip),l&&l.css(t.effects.clipToBox(r)),r.clip=a),l&&l.animate(t.effects.clipToBox(r),e.duration,e.easing),n.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("bounce",function(e,i){var s,n,o,a=t(this),r=e.mode,l="hide"===r,h="show"===r,c=e.direction||"up",u=e.distance,d=e.times||5,p=2*d+(h||l?1:0),f=e.duration/p,g=e.easing,m="up"===c||"down"===c?"top":"left",_="up"===c||"left"===c,v=0,b=a.queue().length;for(t.effects.createPlaceholder(a),o=a.css(m),u||(u=a["top"===m?"outerHeight":"outerWidth"]()/3),h&&(n={opacity:1},n[m]=o,a.css("opacity",0).css(m,_?2*-u:2*u).animate(n,f,g)),l&&(u/=Math.pow(2,d-1)),n={},n[m]=o;d>v;v++)s={},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g).animate(n,f,g),u=l?2*u:u/2;l&&(s={opacity:0},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g)),a.queue(i),t.effects.unshift(a,b,p+1)}),t.effects.define("clip","hide",function(e,i){var s,n={},o=t(this),a=e.direction||"vertical",r="both"===a,l=r||"horizontal"===a,h=r||"vertical"===a;s=o.cssClip(),n.clip={top:h?(s.bottom-s.top)/2:s.top,right:l?(s.right-s.left)/2:s.right,bottom:h?(s.bottom-s.top)/2:s.bottom,left:l?(s.right-s.left)/2:s.left},t.effects.createPlaceholder(o),"show"===e.mode&&(o.cssClip(n.clip),n.clip=s),o.animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("drop","hide",function(e,i){var s,n=t(this),o=e.mode,a="show"===o,r=e.direction||"left",l="up"===r||"down"===r?"top":"left",h="up"===r||"left"===r?"-=":"+=",c="+="===h?"-=":"+=",u={opacity:0};t.effects.createPlaceholder(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,u[l]=h+s,a&&(n.css(u),u[l]=c+s,u.opacity=1),n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("explode","hide",function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),i()}var o,a,r,l,h,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=e.mode,g="show"===f,m=p.show().css("visibility","hidden").offset(),_=Math.ceil(p.outerWidth()/d),v=Math.ceil(p.outerHeight()/u),b=[];for(o=0;u>o;o++)for(l=m.top+o*v,c=o-(u-1)/2,a=0;d>a;a++)r=m.left+a*_,h=a-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*_,top:-o*v}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:_,height:v,left:r+(g?h*_:0),top:l+(g?c*v:0),opacity:g?0:1}).animate({left:r+(g?0:h*_),top:l+(g?0:c*v),opacity:g?1:0},e.duration||500,e.easing,s)}),t.effects.define("fade","toggle",function(e,i){var s="show"===e.mode;t(this).css("opacity",s?0:1).animate({opacity:s?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("fold","hide",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=e.size||15,l=/([0-9]+)%/.exec(r),h=!!e.horizFirst,c=h?["right","bottom"]:["bottom","right"],u=e.duration/2,d=t.effects.createPlaceholder(s),p=s.cssClip(),f={clip:t.extend({},p)},g={clip:t.extend({},p)},m=[p[c[0]],p[c[1]]],_=s.queue().length;l&&(r=parseInt(l[1],10)/100*m[a?0:1]),f.clip[c[0]]=r,g.clip[c[0]]=r,g.clip[c[1]]=0,o&&(s.cssClip(g.clip),d&&d.css(t.effects.clipToBox(g)),g.clip=p),s.queue(function(i){d&&d.animate(t.effects.clipToBox(f),u,e.easing).animate(t.effects.clipToBox(g),u,e.easing),i()}).animate(f,u,e.easing).animate(g,u,e.easing).queue(i),t.effects.unshift(s,_,4)}),t.effects.define("highlight","show",function(e,i){var s=t(this),n={backgroundColor:s.css("backgroundColor")};"hide"===e.mode&&(n.opacity=0),t.effects.saveStyle(s),s.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("size",function(e,i){var s,n,o,a=t(this),r=["fontSize"],l=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],c=e.mode,u="effect"!==c,d=e.scale||"both",p=e.origin||["middle","center"],f=a.css("position"),g=a.position(),m=t.effects.scaledDimensions(a),_=e.from||m,v=e.to||t.effects.scaledDimensions(a,0);t.effects.createPlaceholder(a),"show"===c&&(o=_,_=v,v=o),n={from:{y:_.height/m.height,x:_.width/m.width},to:{y:v.height/m.height,x:v.width/m.width}},("box"===d||"both"===d)&&(n.from.y!==n.to.y&&(_=t.effects.setTransition(a,l,n.from.y,_),v=t.effects.setTransition(a,l,n.to.y,v)),n.from.x!==n.to.x&&(_=t.effects.setTransition(a,h,n.from.x,_),v=t.effects.setTransition(a,h,n.to.x,v))),("content"===d||"both"===d)&&n.from.y!==n.to.y&&(_=t.effects.setTransition(a,r,n.from.y,_),v=t.effects.setTransition(a,r,n.to.y,v)),p&&(s=t.effects.getBaseline(p,m),_.top=(m.outerHeight-_.outerHeight)*s.y+g.top,_.left=(m.outerWidth-_.outerWidth)*s.x+g.left,v.top=(m.outerHeight-v.outerHeight)*s.y+g.top,v.left=(m.outerWidth-v.outerWidth)*s.x+g.left),a.css(_),("content"===d||"both"===d)&&(l=l.concat(["marginTop","marginBottom"]).concat(r),h=h.concat(["marginLeft","marginRight"]),a.find("*[width]").each(function(){var i=t(this),s=t.effects.scaledDimensions(i),o={height:s.height*n.from.y,width:s.width*n.from.x,outerHeight:s.outerHeight*n.from.y,outerWidth:s.outerWidth*n.from.x},a={height:s.height*n.to.y,width:s.width*n.to.x,outerHeight:s.height*n.to.y,outerWidth:s.width*n.to.x};n.from.y!==n.to.y&&(o=t.effects.setTransition(i,l,n.from.y,o),a=t.effects.setTransition(i,l,n.to.y,a)),n.from.x!==n.to.x&&(o=t.effects.setTransition(i,h,n.from.x,o),a=t.effects.setTransition(i,h,n.to.x,a)),u&&t.effects.saveStyle(i),i.css(o),i.animate(a,e.duration,e.easing,function(){u&&t.effects.restoreStyle(i)})})),a.animate(v,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){var e=a.offset();0===v.opacity&&a.css("opacity",_.opacity),u||(a.css("position","static"===f?"relative":f).offset(e),t.effects.saveStyle(a)),i()}})}),t.effects.define("scale",function(e,i){var s=t(this),n=e.mode,o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"effect"!==n?0:100),a=t.extend(!0,{from:t.effects.scaledDimensions(s),to:t.effects.scaledDimensions(s,o,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(a.from.opacity=1,a.to.opacity=0),t.effects.effect.size.call(this,a,i)}),t.effects.define("puff","hide",function(e,i){var s=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,s,i)}),t.effects.define("pulsate","show",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=o||a,l=2*(e.times||5)+(r?1:0),h=e.duration/l,c=0,u=1,d=s.queue().length;for((o||!s.is(":visible"))&&(s.css("opacity",0).show(),c=1);l>u;u++)s.animate({opacity:c},h,e.easing),c=1-c;s.animate({opacity:c},h,e.easing),s.queue(i),t.effects.unshift(s,d,l+1)}),t.effects.define("shake",function(e,i){var s=1,n=t(this),o=e.direction||"left",a=e.distance||20,r=e.times||3,l=2*r+1,h=Math.round(e.duration/l),c="up"===o||"down"===o?"top":"left",u="up"===o||"left"===o,d={},p={},f={},g=n.queue().length;for(t.effects.createPlaceholder(n),d[c]=(u?"-=":"+=")+a,p[c]=(u?"+=":"-=")+2*a,f[c]=(u?"-=":"+=")+2*a,n.animate(d,h,e.easing);r>s;s++)n.animate(p,h,e.easing).animate(f,h,e.easing);n.animate(p,h,e.easing).animate(d,h/2,e.easing).queue(i),t.effects.unshift(n,g,l+1)}),t.effects.define("slide","show",function(e,i){var s,n,o=t(this),a={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},r=e.mode,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,u=e.distance||o["top"===h?"outerHeight":"outerWidth"](!0),d={};t.effects.createPlaceholder(o),s=o.cssClip(),n=o.position()[h],d[h]=(c?-1:1)*u+n,d.clip=o.cssClip(),d.clip[a[l][1]]=d.clip[a[l][0]],"show"===r&&(o.cssClip(d.clip),o.css(h,d[h]),d.clip=s,d[h]=n),o.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:i})});var v;t.uiBackCompat!==!1&&(v=t.effects.define("transfer",function(e,i){t(this).transfer(e,i)}))});
/**
 * @preserve jQuery DateTimePicker plugin v2.3.4
 * @homepage http://xdsoft.net/jqplugins/datetimepicker/
 * (c) 2014, Chupurnov Valeriy.
 */
(function( $ ) {
	'use strict';
	var default_options  = {
		i18n:{
			ar: { // Arabic
				months: [
					"كانون الثاني", "شباط", "آذار", "نيسان", "مايو", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"
				],
				dayOfWeek: [
					"ن", "ث", "ع", "خ", "ج", "س", "ح"
				]
			},
			ro: { // Romanian
				months: [
					"ianuarie", "februarie", "martie", "aprilie", "mai", "iunie", "iulie", "august", "septembrie", "octombrie", "noiembrie", "decembrie"
				],
				dayOfWeek: [
					"l", "ma", "mi", "j", "v", "s", "d"
				]
			},
			id: { // Indonesian
				months: [
					"Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"
				],
				dayOfWeek: [
					"Sen", "Sel", "Rab", "Kam", "Jum", "Sab", "Min"
				]
			},
			bg:{ // Bulgarian
				months:[
					"Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"
				],
				dayOfWeek:[
					"Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
				]
			},
			fa:{ // Persian/Farsi
				months:[
					'فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'
				],
				dayOfWeek:[
					'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'
				]
			},
			ru:{ // Russian
				months:[
					'Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'
				],
				dayOfWeek:[
					"Вск", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
				]
			},
			uk:{ // Ukrainian
				months:[
					'Січень','Лютий','Березень','Квітень','Травень','Червень','Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'
				],
				dayOfWeek:[
					"Ндл", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Сбт"
				]
			},
			en:{ // English
				months: [
					"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
				],
				dayOfWeek: [
					"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
				]
			},
			el:{ // Ελληνικά
				months: [
					"Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"
				],
				dayOfWeek: [
					"Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ"
				]
			},
			de:{ // German
				months:[
					'Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'
				],
				dayOfWeek:[
					"So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"
				]
			},
			nl:{ // Dutch
				months:[
					"januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"
				],
				dayOfWeek:[
					"zo", "ma", "di", "wo", "do", "vr", "za"
				]
			},
			tr:{ // Turkish
				months:[
					"Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
				],
				dayOfWeek:[
					"Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"
				]
			},
			fr:{ //French
				months:[
			    "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"
				],
				dayOfWeek:[
					"Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"
				]
			},
			es:{ // Spanish
				months: [
					"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
				],
				dayOfWeek: [
					"Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"
				]
			},
			th:{ // Thai
				months:[
					'มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน','กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'
				],
				dayOfWeek:[
					'อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'
				]
			},
			pl:{ // Polish
				months: [
					"styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień"
				],
				dayOfWeek: [
					"nd", "pn", "wt", "śr", "cz", "pt", "sb"
				]
			},
			pt:{ // Portuguese
				months: [
					"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
				],
				dayOfWeek: [
					"Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"
				]
			},
			ch:{ // Simplified Chinese
				months: [
					"一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"
				],
				dayOfWeek: [
					"日", "一","二","三","四","五","六"
				]
			},
			se:{ // Swedish
				months: [
					"Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September","Oktober", "November", "December"
				],
				dayOfWeek: [
					"Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
				]
			},
			kr:{ // Korean
				months: [
					"1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
				],
				dayOfWeek: [
					"일", "월", "화", "수", "목", "금", "토"
				]
			},
			it:{ // Italian
				months: [
					"Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"
				],
				dayOfWeek: [
					"Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"
				]
			},
			da:{ // Dansk
				months: [
					"January", "Februar", "Marts", "April", "Maj", "Juni", "July", "August", "September", "Oktober", "November", "December"
				],
				dayOfWeek: [
					"Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
				]
			},
			no:{ // Norwegian
				months: [
					"Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"
				],
				dayOfWeek: [
					"Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
				]
			},
			ja:{ // Japanese
				months: [
					"1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"
				],
				dayOfWeek: [
					"日", "月", "火", "水", "木", "金", "土"
				]
			},
			vi:{ // Vietnamese
				months: [
					"Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12"
				],
				dayOfWeek: [
					"CN", "T2", "T3", "T4", "T5", "T6", "T7"
				]
			},
			sl:{ // Slovenščina
				months: [
					"Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"
				],
				dayOfWeek: [
					"Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"
				]
			},
			cs:{ // Čeština
				months: [
					"Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"
				],
				dayOfWeek: [
					"Ne", "Po", "Út", "St", "Čt", "Pá", "So"
				]
			},
			hu:{ // Hungarian
			    months: [
					"Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"
			    ],
			    dayOfWeek: [
					"Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo"
			    ]
			}
		},
		value:'',
		lang:'en',
		
		format:	'Y/m/d H:i',
		formatTime:	'H:i',
		formatDate:	'Y/m/d',
		
		startDate:	false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05', 
		
		step:60,
		monthChangeSpinner:true,
		closeOnDateSelect:false,
		closeOnWithoutClick:true,
		closeOnInputClick: true,
		
		timepicker:true,
		datepicker:true,
		weeks:false,
		
		defaultTime:false,		// use formatTime format (ex. '10:00' for formatTime:	'H:i')
		defaultDate:false, 		// use formatDate format (ex new Date() or '1986/12/08' or '-1970/01/05' or '-1970/01/05')
		
		minDate:false,
		maxDate:false,
		minTime:false,
		maxTime:false,
		
		allowTimes:[],
		opened:false,
		initTime:true,
		inline:false,
		
		onSelectDate:function() {},
		onSelectTime:function() {},
		onChangeMonth:function() {},
		onChangeDateTime:function() {},
		onShow:function() {},
		onClose:function() {},
		onGenerate:function() {},
		
		withoutCopyright:true,
		
		inverseButton:false,
		hours12:false,
		next:	'xdsoft_next',
		prev : 'xdsoft_prev',
		dayOfWeekStart:0,
		
		timeHeightInTimePicker:25,
		timepickerScrollbar:true,
		
		todayButton:true, // 2.1.0
		defaultSelect:true, // 2.1.0
		
		scrollMonth:true,
		scrollTime:true,
		scrollInput:true,
		
		lazyInit:false,
		
		mask:false,
		validateOnBlur:true,
		allowBlank:true,
		
		yearStart:1950,
		yearEnd:2050,
		
		style:'',
		id:'',
		
		fixed: false,
		
		roundTime:'round', // ceil, floor
		className:'',
		
		weekends	: 	[],
		yearOffset:0,
		beforeShowDay: null
	};
	
	// fix for ie8
	if ( !Array.prototype.indexOf ) {
		Array.prototype.indexOf = function(obj, start) {
			 for (var i = (start || 0), j = this.length; i < j; i++) {
				 if (this[i] === obj) { return i; }
			 }
			 return -1;
		}
	}
	
	Date.prototype.countDaysInMonth = function(){
		return new Date(this.getFullYear(), this.getMonth()+1, 0).getDate();
	};
	
	$.fn.xdsoftScroller = function( _percent ) {
		return this.each(function() {
			var timeboxparent = $(this);
			if( !$(this).hasClass('xdsoft_scroller_box') ) {
				var pointerEventToXY = function( e ) {
						var out = {x:0, y:0};
						if( e.type == 'touchstart' || e.type == 'touchmove' || e.type == 'touchend' || e.type == 'touchcancel' ) {
							var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
							out.x = touch.pageX;
							out.y = touch.pageY;
						}else if (e.type == 'mousedown' || e.type == 'mouseup' || e.type == 'mousemove' || e.type == 'mouseover'|| e.type=='mouseout' || e.type=='mouseenter' || e.type=='mouseleave') {
							out.x = e.pageX;
							out.y = e.pageY;
						}
						return out;
					},
					move = 0,
					timebox = timeboxparent.children().eq(0),
					parentHeight = timeboxparent[0].clientHeight,
					height = timebox[0].offsetHeight,
					scrollbar = $('<div class="xdsoft_scrollbar"></div>'),
					scroller = $('<div class="xdsoft_scroller"></div>'),
					maximumOffset = 100,
					start = false;

				scrollbar.append(scroller);

				timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar);
				scroller.on('mousedown.xdsoft_scroller',function ( event ) {
					if( !parentHeight )
						timeboxparent.trigger('resize_scroll.xdsoft_scroller',[_percent]);
					var pageY = event.pageY,
						top = parseInt(scroller.css('margin-top')),
						h1 = scrollbar[0].offsetHeight;
					$(document.body).addClass('xdsoft_noselect');
					$([document.body,window]).on('mouseup.xdsoft_scroller',function arguments_callee() {
						$([document.body,window]).off('mouseup.xdsoft_scroller',arguments_callee)
							.off('mousemove.xdsoft_scroller',move)
							.removeClass('xdsoft_noselect');
					});
					$(document.body).on('mousemove.xdsoft_scroller',move = function(event) {
						var offset = event.pageY-pageY+top;
						if( offset<0 )
							offset = 0;
						if( offset+scroller[0].offsetHeight>h1 )
							offset = h1-scroller[0].offsetHeight;
						timeboxparent.trigger('scroll_element.xdsoft_scroller',[maximumOffset?offset/maximumOffset:0]);
					});
				});

				timeboxparent
					.on('scroll_element.xdsoft_scroller',function( event,percent ) {
						if( !parentHeight )
							timeboxparent.trigger('resize_scroll.xdsoft_scroller',[percent,true]);
						percent = percent>1?1:(percent<0||isNaN(percent))?0:percent;
						scroller.css('margin-top',maximumOffset*percent);
						setTimeout(function(){
							timebox.css('marginTop',-parseInt((timebox[0].offsetHeight-parentHeight)*percent))
						},10);						
					})
					.on('resize_scroll.xdsoft_scroller',function( event,_percent,noTriggerScroll ) {
						parentHeight = timeboxparent[0].clientHeight;
						height = timebox[0].offsetHeight;
						var percent = parentHeight/height,
							sh = percent*scrollbar[0].offsetHeight;
						if( percent>1 )
							scroller.hide();
						else{
							scroller.show();
							scroller.css('height',parseInt(sh>10?sh:10));
							maximumOffset = scrollbar[0].offsetHeight-scroller[0].offsetHeight;
							if( noTriggerScroll!==true )
								timeboxparent.trigger('scroll_element.xdsoft_scroller',[_percent?_percent:Math.abs(parseInt(timebox.css('marginTop')))/(height-parentHeight)]);
						}
					});
				timeboxparent.mousewheel&&timeboxparent.mousewheel(function(event, delta, deltaX, deltaY) {
					var top = Math.abs(parseInt(timebox.css('marginTop')));
					timeboxparent.trigger('scroll_element.xdsoft_scroller',[(top-delta*20)/(height-parentHeight)]);
					event.stopPropagation();
					return false;
				});
				timeboxparent.on('touchstart',function( event ) {
					start = pointerEventToXY(event);
				});
				timeboxparent.on('touchmove',function( event ) {
					if( start ) {
						var coord = pointerEventToXY(event), top = Math.abs(parseInt(timebox.css('marginTop')));
						timeboxparent.trigger('scroll_element.xdsoft_scroller',[(top-(coord.y-start.y))/(height-parentHeight)]);
						event.stopPropagation();
						event.preventDefault();
						start = pointerEventToXY(event);
					}
				});
				timeboxparent.on('touchend touchcancel',function( event ) {
					start = false;
				});
			}
			timeboxparent.trigger('resize_scroll.xdsoft_scroller',[_percent]);
		});
	};
	$.fn.datetimepicker = function( opt ) {
		var KEY0 = 48,
			KEY9 = 57,
			_KEY0 = 96,
			_KEY9 = 105,
			CTRLKEY = 17,
			DEL = 46,
			ENTER = 13,
			ESC = 27,
			BACKSPACE = 8,
			ARROWLEFT = 37,
			ARROWUP = 38,
			ARROWRIGHT = 39,
			ARROWDOWN = 40,
			TAB = 9,
			F5 = 116,
			AKEY = 65,
			CKEY = 67,
			VKEY = 86,
			ZKEY = 90,
			YKEY = 89,
			ctrlDown	=	false,
			options = ($.isPlainObject(opt)||!opt)?$.extend(true,{},default_options,opt):$.extend({},default_options),

			lazyInitTimer = 0,

			lazyInit = function( input ){
				input
					.on('open.xdsoft focusin.xdsoft mousedown.xdsoft',function initOnActionCallback(event) {
						if( input.is(':disabled')||input.is(':hidden')||!input.is(':visible')||input.data( 'xdsoft_datetimepicker') )
							return;
				
						clearTimeout(lazyInitTimer);
						
						lazyInitTimer = setTimeout(function() {

							if( !input.data( 'xdsoft_datetimepicker') )
								createDateTimePicker(input);
								
							input
								.off('open.xdsoft focusin.xdsoft mousedown.xdsoft',initOnActionCallback)
								.trigger('open.xdsoft');
						},100);
						
					});
			},
			
			createDateTimePicker = function( input ) {
				
				var datetimepicker = $('<div '+(options.id?'id="'+options.id+'"':'')+' '+(options.style?'style="'+options.style+'"':'')+' class="xdsoft_datetimepicker xdsoft_noselect '+(options.weeks?' xdsoft_showweeks':'')+options.className+'"></div>'),
					xdsoft_copyright = $('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),
					datepicker = $('<div class="xdsoft_datepicker active"></div>'),
					mounth_picker = $('<div class="xdsoft_mounthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button><div class="xdsoft_label xdsoft_month"><span></span></div><div class="xdsoft_label xdsoft_year"><span></span></div><button type="button" class="xdsoft_next"></button></div>'),
					calendar = $('<div class="xdsoft_calendar"></div>'),
					timepicker = $('<div class="xdsoft_timepicker active"><button type="button" class="xdsoft_prev"></button><div class="xdsoft_time_box"></div><button type="button" class="xdsoft_next"></button></div>'),
					timeboxparent = timepicker.find('.xdsoft_time_box').eq(0),
					timebox = $('<div class="xdsoft_time_variant"></div>'),
					scrollbar = $('<div class="xdsoft_scrollbar"></div>'),
					scroller = $('<div class="xdsoft_scroller"></div>'),
					monthselect =$('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),
					yearselect =$('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>');

				//constructor lego
				mounth_picker
					.find('.xdsoft_month span')
						.after(monthselect);
				mounth_picker
					.find('.xdsoft_year span')
						.after(yearselect);

				mounth_picker
					.find('.xdsoft_month,.xdsoft_year')
						.on('mousedown.xdsoft',function(event) {
							mounth_picker
								.find('.xdsoft_select')
									.hide();
									
							var select = $(this).find('.xdsoft_select').eq(0),
								val = 0,
								top = 0;

							if( _xdsoft_datetime.currentTime )
								val = _xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month')?'getMonth':'getFullYear']();

							select.show();
							
							for(var items = select.find('div.xdsoft_option'),i = 0;i<items.length;i++) {
								if( items.eq(i).data('value')==val ) {
									break;
								}else top+=items[0].offsetHeight;
							}

							select.xdsoftScroller(top/(select.children()[0].offsetHeight-(select[0].clientHeight)));
							event.stopPropagation();
							
							return false;
						});

				mounth_picker
					.find('.xdsoft_select')
						.xdsoftScroller()
						.on('mousedown.xdsoft',function( event ) {
							event.stopPropagation();
							event.preventDefault();
						})
						.on('mousedown.xdsoft','.xdsoft_option',function( event ) {
							if( _xdsoft_datetime&&_xdsoft_datetime.currentTime )
								_xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect')?'setMonth':'setFullYear']($(this).data('value'));
							
							$(this).parent().parent().hide();
							
							datetimepicker.trigger('xchange.xdsoft');
							options.onChangeMonth&&options.onChangeMonth.call&&options.onChangeMonth.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'));
						});


				// set options
				datetimepicker.setOptions = function( _options ) {
					options = $.extend(true,{},options,_options);
					
					if( _options.allowTimes && $.isArray(_options.allowTimes) && _options.allowTimes.length ){
						options['allowTimes'] = $.extend(true,[],_options.allowTimes);
					}
					
					if( _options.weekends && $.isArray(_options.weekends) && _options.weekends.length ){
						options['weekends'] = $.extend(true,[],_options.weekends);
					}
					
					if( (options.open||options.opened)&&(!options.inline) ) {
						input.trigger('open.xdsoft');
					}

					if( options.inline ) {
						triggerAfterOpen = true;
						datetimepicker.addClass('xdsoft_inline');
						input.after(datetimepicker).hide();
					}

					if( options.inverseButton ) {
						options.next = 'xdsoft_prev';
						options.prev = 'xdsoft_next';
					}

					if( options.datepicker )
						datepicker.addClass('active');
					else
						datepicker.removeClass('active');

					if( options.timepicker )
						timepicker.addClass('active');
					else
						timepicker.removeClass('active');

					if( options.value ){
						input&&input.val&&input.val(options.value);
						_xdsoft_datetime.setCurrentTime(options.value);
					}

					if( isNaN(options.dayOfWeekStart) )
						options.dayOfWeekStart = 0;
					else
						options.dayOfWeekStart = parseInt(options.dayOfWeekStart)%7;

					if( !options.timepickerScrollbar )
						scrollbar.hide();
					
					if( options.minDate && /^-(.*)$/.test(options.minDate) ){
						options.minDate = _xdsoft_datetime.strToDateTime(options.minDate).dateFormat( options.formatDate );
					}
					
					if( options.maxDate &&  /^\+(.*)$/.test(options.maxDate) ) {
						options.maxDate = _xdsoft_datetime.strToDateTime(options.maxDate).dateFormat( options.formatDate );
					}
					
					mounth_picker
						.find('.xdsoft_today_button')
							.css('visibility',!options.todayButton?'hidden':'visible');

					if( options.mask ) {
						var e,
							getCaretPos = function ( input ) {
								try{
									if ( document.selection && document.selection.createRange ) {
										var range = document.selection.createRange();
										return range.getBookmark().charCodeAt(2) - 2;
									}else
										if ( input.setSelectionRange )
											return input.selectionStart;
								}catch(e) {
									return 0;
								}
							},
							setCaretPos = function ( node,pos ) {
								node = (typeof node == "string" || node instanceof String) ? document.getElementById(node) : node;
								if(!node) {
									return false;
								}else if(node.createTextRange) {
									var textRange = node.createTextRange();
									textRange.collapse(true);
									textRange.moveEnd(pos);
									textRange.moveStart(pos);
									textRange.select();
									return true;
								}else if(node.setSelectionRange) {
									node.setSelectionRange(pos,pos);
									return true;
								}
								return false;
							},
							isValidValue = function ( mask,value ) {
								var reg = mask
									.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g,'\\$1')
									.replace(/_/g,'{digit+}')
									.replace(/([0-9]{1})/g,'{digit$1}')
									.replace(/\{digit([0-9]{1})\}/g,'[0-$1_]{1}')
									.replace(/\{digit[\+]\}/g,'[0-9_]{1}');
								return RegExp(reg).test(value);
							};
						input.off('keydown.xdsoft');
						switch(true) {
							case ( options.mask===true ):
							
								options.mask = options.format
									.replace(/Y/g,'9999')
									.replace(/F/g,'9999')
									.replace(/m/g,'19')
									.replace(/d/g,'39')
									.replace(/H/g,'29')
									.replace(/i/g,'59')
									.replace(/s/g,'59');
									
							case ( $.type(options.mask) == 'string' ):
							
								if( !isValidValue( options.mask,input.val() ) )
									input.val(options.mask.replace(/[0-9]/g,'_'));

								input.on('keydown.xdsoft',function( event ) {
									var val = this.value,
										key = event.which;
										
									switch(true) {
										case (( key>=KEY0&&key<=KEY9 )||( key>=_KEY0&&key<=_KEY9 ))||(key==BACKSPACE||key==DEL):
											var pos = getCaretPos(this),
												digit = ( key!=BACKSPACE&&key!=DEL )?String.fromCharCode((_KEY0 <= key && key <= _KEY9)? key-KEY0 : key):'_';
											
											if( (key==BACKSPACE||key==DEL)&&pos ) {
												pos--;
												digit='_';
											}
											
											while( /[^0-9_]/.test(options.mask.substr(pos,1))&&pos<options.mask.length&&pos>0 )
												pos+=( key==BACKSPACE||key==DEL )?-1:1;

											val = val.substr(0,pos)+digit+val.substr(pos+1);
											if( $.trim(val)=='' ){
												val = options.mask.replace(/[0-9]/g,'_');
											}else{
												if( pos==options.mask.length )
													break;
											}
											
											pos+=(key==BACKSPACE||key==DEL)?0:1;
											while( /[^0-9_]/.test(options.mask.substr(pos,1))&&pos<options.mask.length&&pos>0 )
												pos+=(key==BACKSPACE||key==DEL)?-1:1;
												
											if( isValidValue( options.mask,val ) ) {
												this.value = val;
												setCaretPos(this,pos);
											}else if( $.trim(val)=='' )
												this.value = options.mask.replace(/[0-9]/g,'_');
											else{
												input.trigger('error_input.xdsoft');
											}
										break;
										case ( !!~([AKEY,CKEY,VKEY,ZKEY,YKEY].indexOf(key))&&ctrlDown ):
										 case !!~([ESC,ARROWUP,ARROWDOWN,ARROWLEFT,ARROWRIGHT,F5,CTRLKEY,TAB,ENTER].indexOf(key)):
										return true;
									}
									event.preventDefault();
									return false;
								});
							break;
						}
					}
					if( options.validateOnBlur ) {
						input
							.off('blur.xdsoft')
							.on('blur.xdsoft', function() {
								if( options.allowBlank && !$.trim($(this).val()).length ) {
									$(this).val(null);
									datetimepicker.data('xdsoft_datetime').empty();
								}else if( !Date.parseDate( $(this).val(), options.format ) ) {
									$(this).val((_xdsoft_datetime.now()).dateFormat( options.format ));
									datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
								}
								else{
									datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
 								}
								datetimepicker.trigger('changedatetime.xdsoft');
							});
					}
					options.dayOfWeekStartPrev = (options.dayOfWeekStart==0)?6:options.dayOfWeekStart-1;
					
					datetimepicker
						.trigger('xchange.xdsoft')
						.trigger('afterOpen.xdsoft')
				};

				datetimepicker
					.data('options',options)
					.on('mousedown.xdsoft',function( event ) {
						event.stopPropagation();
						event.preventDefault();
						yearselect.hide();
						monthselect.hide();
						return false;
					});

				var scroll_element = timepicker.find('.xdsoft_time_box');
				scroll_element.append(timebox);
				scroll_element.xdsoftScroller();
				
				datetimepicker.on('afterOpen.xdsoft',function() {
					scroll_element.xdsoftScroller();
				});

				datetimepicker
					.append(datepicker)
					.append(timepicker);

				if( options.withoutCopyright!==true )
					datetimepicker
						.append(xdsoft_copyright);

				datepicker
					.append(mounth_picker)
					.append(calendar);

				$('body').append(datetimepicker);

				var _xdsoft_datetime = new function() {
					var _this = this;
					_this.now = function( norecursion ) {
						var d = new Date();
						
						if( !norecursion && options.defaultDate  ){
							var date = _this.strToDate(options.defaultDate);
							d.setFullYear( date.getFullYear() );
							d.setMonth( date.getMonth() );
							d.setDate( date.getDate() );
						}
						
						if( options.yearOffset  ){
							d.setFullYear(d.getFullYear()+options.yearOffset);
						}
						
						if( !norecursion && options.defaultTime ){
							var time = _this.strtotime(options.defaultTime);
							d.setHours( time.getHours() );
							d.setMinutes( time.getMinutes() );
						}
							
						return d;
					};

					
					_this.isValidDate = function (d) {
						if ( Object.prototype.toString.call(d) !== "[object Date]" )
							return false;
						return !isNaN(d.getTime());
					};

					_this.setCurrentTime = function( dTime ) {
						_this.currentTime = (typeof dTime == 'string')? _this.strToDateTime(dTime) : _this.isValidDate(dTime) ? dTime: _this.now();
						datetimepicker.trigger('xchange.xdsoft');
					};

					_this.empty = function() {
						_this.currentTime = null;
					};

					_this.getCurrentTime = function( dTime) {
						return _this.currentTime;
					};

					_this.nextMonth = function() {
						var month = _this.currentTime.getMonth()+1;
						if( month==12 ) {
							_this.currentTime.setFullYear(_this.currentTime.getFullYear()+1);
							month = 0;
						}
						_this.currentTime.setDate(
							Math.min(
								// Day 0 is the last day in the previous month, but we want to know the number of days in the current month, so we need to evaluate the subsequent month (month+1)
								new Date(_this.currentTime.getFullYear(), month+1, 0).getDate(),
								_this.currentTime.getDate()
							)
						);
						_this.currentTime.setMonth(month);
						options.onChangeMonth&&options.onChangeMonth.call&&options.onChangeMonth.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'));
						datetimepicker.trigger('xchange.xdsoft');
						return month;
					};

					_this.prevMonth = function() {
						var month = _this.currentTime.getMonth()-1;
						if( month==-1 ) {
							_this.currentTime.setFullYear(_this.currentTime.getFullYear()-1);
							month = 11;
						}
						_this.currentTime.setDate(
							Math.min(
								// Day 0 is the last day in the previous month, but we want to know the number of days in the current month, so we need to evaluate the subsequent month (month+1)
								new Date(_this.currentTime.getFullYear(), month+1, 0).getDate(),
								_this.currentTime.getDate()
							)
						);
						_this.currentTime.setMonth(month);
						options.onChangeMonth&&options.onChangeMonth.call&&options.onChangeMonth.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'));
						datetimepicker.trigger('xchange.xdsoft');
						return month;
					};

					_this.strToDateTime = function( sDateTime ) {
						if( sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime) )
							return sDateTime;
						
						var tmpDate = [],timeOffset,currentTime;
					
						if( ( tmpDate = /^(\+|\-)(.*)$/.exec(sDateTime) )  && ( tmpDate[2]=Date.parseDate(tmpDate[2], options.formatDate) ) ) {
							timeOffset = tmpDate[2].getTime()-(tmpDate[2].getTimezoneOffset())*60000;
							currentTime = new Date((_xdsoft_datetime.now()).getTime()+parseInt(tmpDate[1]+'1')*timeOffset);
						}else
							currentTime = sDateTime?Date.parseDate(sDateTime, options.format):_this.now();
							
						if( !_this.isValidDate(currentTime) )
							currentTime = _this.now();
							
						return currentTime;
					};

					_this.strToDate = function( sDate ) {
						if( sDate && sDate instanceof Date && _this.isValidDate(sDate) )
							return sDate;
						
						var currentTime = sDate?Date.parseDate(sDate, options.formatDate):_this.now(true);
						if( !_this.isValidDate(currentTime) )
							currentTime = _this.now(true);
							
						return currentTime;
					};

					_this.strtotime = function( sTime ) {
						if( sTime && sTime instanceof Date && _this.isValidDate(sTime) )
							return sTime;
							
						var currentTime = sTime?Date.parseDate(sTime, options.formatTime):_this.now();
						if( !_this.isValidDate(currentTime) )
							currentTime = _this.now(true);
							
						return currentTime;
					};

					_this.str = function() {
						return _this.currentTime.dateFormat(options.format);
					};
					
					_this.currentTime = this.now();
				};
				mounth_picker
					.find('.xdsoft_today_button')
						.on('mousedown.xdsoft',function() {
							datetimepicker.data('changed',true);
							_xdsoft_datetime.setCurrentTime(0);
							datetimepicker.trigger('afterOpen.xdsoft');
						}).on('dblclick.xdsoft',function(){
							input.val( _xdsoft_datetime.str() );
							datetimepicker.trigger('close.xdsoft');
						});
				mounth_picker
					.find('.xdsoft_prev,.xdsoft_next')
						.on('mousedown.xdsoft',function() {
							var $this = $(this),
								timer = 0,
								stop = false;

							(function arguments_callee1(v) {
								var month =  _xdsoft_datetime.currentTime.getMonth();
								if( $this.hasClass( options.next ) ) {
									_xdsoft_datetime.nextMonth();
								}else if( $this.hasClass( options.prev ) ) {
									_xdsoft_datetime.prevMonth();
								}
								if (options.monthChangeSpinner) {
									!stop&&(timer = setTimeout(arguments_callee1,v?v:100));
								}
							})(500);

							$([document.body,window]).on('mouseup.xdsoft',function arguments_callee2() {
								clearTimeout(timer);
								stop = true;
								$([document.body,window]).off('mouseup.xdsoft',arguments_callee2);
							});
						});

				timepicker
					.find('.xdsoft_prev,.xdsoft_next')
						.on('mousedown.xdsoft',function() {
							var $this = $(this),
								timer = 0,
								stop = false,
								period = 110;
							(function arguments_callee4(v) {
								var pheight = timeboxparent[0].clientHeight,
									height = timebox[0].offsetHeight,
									top = Math.abs(parseInt(timebox.css('marginTop')));
								if( $this.hasClass(options.next) && (height-pheight)- options.timeHeightInTimePicker>=top ) {
									timebox.css('marginTop','-'+(top+options.timeHeightInTimePicker)+'px')
								}else if( $this.hasClass(options.prev) && top-options.timeHeightInTimePicker>=0  ) {
									timebox.css('marginTop','-'+(top-options.timeHeightInTimePicker)+'px')
								}
								timeboxparent.trigger('scroll_element.xdsoft_scroller',[Math.abs(parseInt(timebox.css('marginTop'))/(height-pheight))]);
								period= ( period>10 )?10:period-10;
								!stop&&(timer = setTimeout(arguments_callee4,v?v:period));
							})(500);
							$([document.body,window]).on('mouseup.xdsoft',function arguments_callee5() {
								clearTimeout(timer);
								stop = true;
								$([document.body,window])
									.off('mouseup.xdsoft',arguments_callee5);
							});
						});

				var xchangeTimer = 0;
				// base handler - generating a calendar and timepicker
				datetimepicker
					.on('xchange.xdsoft',function( event ) {
						clearTimeout(xchangeTimer);
						xchangeTimer = setTimeout(function(){
							var table 	=	'',
									start	= new Date(_xdsoft_datetime.currentTime.getFullYear(),_xdsoft_datetime.currentTime.getMonth(),1, 12, 0, 0),
									i = 0,
									today = _xdsoft_datetime.now();
								
								while( start.getDay()!=options.dayOfWeekStart )
									start.setDate(start.getDate()-1);

								//generate calendar
								table+='<table><thead><tr>';

								if(options.weeks) {
									table+='<th></th>';
								}

								// days
								for(var j = 0; j<7; j++) {
									table+='<th>'+options.i18n[options.lang].dayOfWeek[(j+options.dayOfWeekStart)%7]+'</th>';
								}

								table+='</tr></thead>';
								table+='<tbody>';
								var maxDate = false, minDate = false;
								
								if( options.maxDate!==false ) {
									maxDate = _xdsoft_datetime.strToDate(options.maxDate);
									maxDate = new Date(maxDate.getFullYear(),maxDate.getMonth(),maxDate.getDate(),23,59,59,999);
								}
								
								if( options.minDate!==false ) {
									minDate = _xdsoft_datetime.strToDate(options.minDate);
									minDate = new Date(minDate.getFullYear(),minDate.getMonth(),minDate.getDate());
								}
								
								var d,y,m,w,classes = [],customDateSettings,newRow=true;
								
								while( i<_xdsoft_datetime.currentTime.countDaysInMonth()||start.getDay()!=options.dayOfWeekStart||_xdsoft_datetime.currentTime.getMonth()==start.getMonth() ) {
									classes = [];
									i++;

									d = start.getDate(); y = start.getFullYear(); m = start.getMonth(); w = start.getWeekOfYear();

									classes.push('xdsoft_date');

									if ( options.beforeShowDay && options.beforeShowDay.call ) {
										customDateSettings = options.beforeShowDay.call(datetimepicker, start);
									} else {
										customDateSettings = null;
									}

									if( ( maxDate!==false && start > maxDate )||(  minDate!==false && start < minDate )||(customDateSettings && customDateSettings[0] === false) ){
										classes.push('xdsoft_disabled');
									}

									if ( customDateSettings && customDateSettings[1] != "" ) {
										classes.push(customDateSettings[1]);
									}

									if( _xdsoft_datetime.currentTime.getMonth()!=m ) classes.push('xdsoft_other_month');

									if( (options.defaultSelect||datetimepicker.data('changed')) && _xdsoft_datetime.currentTime.dateFormat( options.formatDate )==start.dateFormat( options.formatDate ) ) {
										classes.push('xdsoft_current');
									}

									if( today.dateFormat( options.formatDate )==start.dateFormat( options.formatDate ) ) {
										classes.push('xdsoft_today');
									}

									if( start.getDay()==0||start.getDay()==6||~options.weekends.indexOf(start.dateFormat( options.formatDate )) ) {
										classes.push('xdsoft_weekend');
									}

									if(options.beforeShowDay && typeof options.beforeShowDay == 'function') {
										classes.push(options.beforeShowDay(start))
									}

									if(newRow) {
										table+='<tr>';
										newRow = false;
										
										if(options.weeks) {
											table+='<th>'+w+'</th>';
										}
									}

									table+='<td data-date="'+d+'" data-month="'+m+'" data-year="'+y+'"'+' class="xdsoft_date xdsoft_day_of_week'+start.getDay()+' '+ classes.join(' ')+'">'+
												'<div>'+d+'</div>'+
											'</td>';

									if( start.getDay()==options.dayOfWeekStartPrev ) {
										table+='</tr>';
										newRow = true;
									}

									start.setDate(d+1);
								}
								table+='</tbody></table>';

								calendar.html(table);

								mounth_picker.find('.xdsoft_label span').eq(0).text(options.i18n[options.lang].months[_xdsoft_datetime.currentTime.getMonth()]);
								mounth_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear());

								// generate timebox
								var time = '',
									h = '',
									m ='',
									line_time = function line_time( h,m ) {
										var now = _xdsoft_datetime.now();
										now.setHours(h);
										h = parseInt(now.getHours());
										now.setMinutes(m);
										m = parseInt(now.getMinutes());

										classes = [];
										if( (options.maxTime!==false&&_xdsoft_datetime.strtotime(options.maxTime).getTime()<now.getTime())||(options.minTime!==false&&_xdsoft_datetime.strtotime(options.minTime).getTime()>now.getTime()))
											classes.push('xdsoft_disabled');
										if( (options.initTime||options.defaultSelect||datetimepicker.data('changed')) && parseInt(_xdsoft_datetime.currentTime.getHours())==parseInt(h)&&(options.step>59||Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes()/options.step)*options.step==parseInt(m))) {
											if( options.defaultSelect||datetimepicker.data('changed')) {
												classes.push('xdsoft_current');
											} else if( options.initTime ) {
												classes.push('xdsoft_init_time');
											}
										}
										if( parseInt(today.getHours())==parseInt(h)&&parseInt(today.getMinutes())==parseInt(m))
											classes.push('xdsoft_today');
										time+= '<div class="xdsoft_time '+classes.join(' ')+'" data-hour="'+h+'" data-minute="'+m+'">'+now.dateFormat(options.formatTime)+'</div>';
									};

								if( !options.allowTimes || !$.isArray(options.allowTimes) || !options.allowTimes.length ) {
									for( var i=0,j=0;i<(options.hours12?12:24);i++ ) {
										for( j=0;j<60;j+=options.step ) {
											h = (i<10?'0':'')+i;
											m = (j<10?'0':'')+j;
											line_time( h,m );
										}
									}
								}else{
									for( var i=0;i<options.allowTimes.length;i++ ) {
										h = _xdsoft_datetime.strtotime(options.allowTimes[i]).getHours();
										m = _xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes();
										line_time( h,m );
									}
								}

								timebox.html(time);

								var opt = '',
									i = 0;

								for( i = parseInt(options.yearStart,10)+options.yearOffset;i<= parseInt(options.yearEnd,10)+options.yearOffset;i++ ) {
									opt+='<div class="xdsoft_option '+(_xdsoft_datetime.currentTime.getFullYear()==i?'xdsoft_current':'')+'" data-value="'+i+'">'+i+'</div>';
								}
								yearselect.children().eq(0)
														.html(opt);

								for( i = 0,opt = '';i<= 11;i++ ) {
									opt+='<div class="xdsoft_option '+(_xdsoft_datetime.currentTime.getMonth()==i?'xdsoft_current':'')+'" data-value="'+i+'">'+options.i18n[options.lang].months[i]+'</div>';
								}
								monthselect.children().eq(0).html(opt);
								$(datetimepicker)
									.trigger('generate.xdsoft');
						},10);
						event.stopPropagation();
					})
					.on('afterOpen.xdsoft',function() {
						if( options.timepicker ) {
							var classType;
							if( timebox.find('.xdsoft_current').length ) {
								classType = '.xdsoft_current';
							} else if( timebox.find('.xdsoft_init_time').length ) {
								classType = '.xdsoft_init_time';
							}
							
							if( classType ) {
								var pheight = timeboxparent[0].clientHeight,
									height = timebox[0].offsetHeight,
									top = timebox.find(classType).index()*options.timeHeightInTimePicker+1;
								if( (height-pheight)<top )
									top = height-pheight;
								timeboxparent.trigger('scroll_element.xdsoft_scroller',[parseInt(top)/(height-pheight)]);
							}else{
								timeboxparent.trigger('scroll_element.xdsoft_scroller',[0]);
							}
						}
					});
				
				var timerclick = 0;
				
				calendar
					.on('click.xdsoft', 'td', function (xdevent) {
					  xdevent.stopPropagation();  // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap
						timerclick++;
						var $this = $(this),
							currentTime = _xdsoft_datetime.currentTime;
						
						if( currentTime===undefined||currentTime===null ){
                            _xdsoft_datetime.currentTime = _xdsoft_datetime.now();
                            currentTime = _xdsoft_datetime.currentTime;
                        }
						
						if( $this.hasClass('xdsoft_disabled') )
							return false;

						currentTime.setDate( 1 );
						currentTime.setFullYear( $this.data('year') );
						currentTime.setMonth( $this.data('month') );
						currentTime.setDate( $this.data('date') );
						
						datetimepicker.trigger('select.xdsoft',[currentTime]);

						input.val( _xdsoft_datetime.str() );
						if( (timerclick>1||(options.closeOnDateSelect===true||( options.closeOnDateSelect===0&&!options.timepicker )))&&!options.inline ) {
							datetimepicker.trigger('close.xdsoft');
						}

						if( options.onSelectDate &&	options.onSelectDate.call ) {
							options.onSelectDate.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'));
						}

						datetimepicker.data('changed',true);
						datetimepicker.trigger('xchange.xdsoft');
						datetimepicker.trigger('changedatetime.xdsoft');
						setTimeout(function(){
							timerclick = 0;
						},200);
					});

				timebox
					.on('click.xdsoft', 'div', function (xdevent) {
					    xdevent.stopPropagation(); // NAJ: Prevents closing of Pop-ups, Modals and Flyouts
						var $this = $(this),
							currentTime = _xdsoft_datetime.currentTime;
						
						if( currentTime===undefined||currentTime===null ){
                            _xdsoft_datetime.currentTime = _xdsoft_datetime.now();
                            currentTime = _xdsoft_datetime.currentTime;
                        }
						
						if( $this.hasClass('xdsoft_disabled') )
							return false;
						currentTime.setHours($this.data('hour'));
						currentTime.setMinutes($this.data('minute'));
						datetimepicker.trigger('select.xdsoft',[currentTime]);

						datetimepicker.data('input').val( _xdsoft_datetime.str() );

						!options.inline&&datetimepicker.trigger('close.xdsoft');

						if( options.onSelectTime&&options.onSelectTime.call ) {
							options.onSelectTime.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'));
						}
						datetimepicker.data('changed',true);
						datetimepicker.trigger('xchange.xdsoft');
						datetimepicker.trigger('changedatetime.xdsoft');
					});

				datetimepicker.mousewheel&&datepicker.mousewheel(function(event, delta, deltaX, deltaY) {
					if( !options.scrollMonth )
						return true;
					if( delta<0 )
						_xdsoft_datetime.nextMonth();
					else
						_xdsoft_datetime.prevMonth();
					return false;
				});

				datetimepicker.mousewheel&&timeboxparent.unmousewheel().mousewheel(function(event, delta, deltaX, deltaY) {
					if( !options.scrollTime )
						return true;
					var pheight = timeboxparent[0].clientHeight,
						height = timebox[0].offsetHeight,
						top = Math.abs(parseInt(timebox.css('marginTop'))),
						fl = true;
					if( delta<0 && (height-pheight)-options.timeHeightInTimePicker>=top ) {
						timebox.css('marginTop','-'+(top+options.timeHeightInTimePicker)+'px');
						fl = false;
					}else if( delta>0&&top-options.timeHeightInTimePicker>=0 ) {
						timebox.css('marginTop','-'+(top-options.timeHeightInTimePicker)+'px');
						fl = false;
					}
					timeboxparent.trigger('scroll_element.xdsoft_scroller',[Math.abs(parseInt(timebox.css('marginTop'))/(height-pheight))]);
					event.stopPropagation();
					return fl;
				});
				
				var triggerAfterOpen = false;
				datetimepicker
					.on('changedatetime.xdsoft',function() {
						if( options.onChangeDateTime&&options.onChangeDateTime.call ) {
							var $input = datetimepicker.data('input');
							options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input);
							delete options.value;
							$input.trigger('change');
						}
					})
					.on('generate.xdsoft',function() {
						if( options.onGenerate&&options.onGenerate.call )
							options.onGenerate.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'));
						if( triggerAfterOpen ){
							datetimepicker.trigger('afterOpen.xdsoft');
							triggerAfterOpen = false;
						}
					})
					.on( 'click.xdsoft', function( xdevent )
					{
						xdevent.stopPropagation();  // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap
					});

				var current_time_index = 0;
				input.mousewheel&&input.mousewheel(function( event, delta, deltaX, deltaY ) {
					if( !options.scrollInput )
						return true;
					if( !options.datepicker && options.timepicker ) {
						current_time_index = timebox.find('.xdsoft_current').length?timebox.find('.xdsoft_current').eq(0).index():0;
						if( current_time_index+delta>=0&&current_time_index+delta<timebox.children().length )
							current_time_index+=delta;
						timebox.children().eq(current_time_index).length&&timebox.children().eq(current_time_index).trigger('mousedown');
						return false;
					}else if( options.datepicker && !options.timepicker ) {
						datepicker.trigger( event, [delta, deltaX, deltaY]);
						input.val&&input.val( _xdsoft_datetime.str() );
						datetimepicker.trigger('changedatetime.xdsoft');
						return false;
					}
				});
				var setPos = function() {
					var offset = datetimepicker.data('input').offset(), top = offset.top+datetimepicker.data('input')[0].offsetHeight-1, left = offset.left, position = "absolute";
					if (options.fixed) {
						top -= $(window).scrollTop();
						left -= $(window).scrollLeft();
						position = "fixed";
					}else {
						if( top+datetimepicker[0].offsetHeight>$(window).height()+$(window).scrollTop() )
							top = offset.top-datetimepicker[0].offsetHeight+1;
							if (top < 0)
								top = 0;
						if( left+datetimepicker[0].offsetWidth>$(window).width() )
							left = offset.left-datetimepicker[0].offsetWidth+datetimepicker.data('input')[0].offsetWidth;
					}
					datetimepicker.css({
						left:left,
						top:top,
						position: position
					});
				};
				datetimepicker
					.on('open.xdsoft', function() {
						var onShow = true;
						if( options.onShow&&options.onShow.call) {
							onShow = options.onShow.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'));
						}
						if( onShow!==false ) {
							datetimepicker.show();
							setPos();
							$(window)
								.off('resize.xdsoft',setPos)
								.on('resize.xdsoft',setPos);

							if( options.closeOnWithoutClick ) {
								$([document.body,window]).on('mousedown.xdsoft',function arguments_callee6() {
									datetimepicker.trigger('close.xdsoft');
									$([document.body,window]).off('mousedown.xdsoft',arguments_callee6);
								});
							}
						}
					})
					.on('close.xdsoft', function( event ) {
						var onClose = true;
						if( options.onClose&&options.onClose.call ) {
							onClose=options.onClose.call(datetimepicker,_xdsoft_datetime.currentTime,datetimepicker.data('input'));
						}
						if( onClose!==false&&!options.opened&&!options.inline ) {
							datetimepicker.hide();
						}
						event.stopPropagation();
					})
					.data('input',input);

				var timer = 0,
					timer1 = 0;

				datetimepicker.data('xdsoft_datetime',_xdsoft_datetime);
				datetimepicker.setOptions(options);
				
				function getCurrentValue(){

					var ct = false;

                    if ( options.startDate ) {
                        ct = _xdsoft_datetime.strToDate(options.startDate);
                    } else {
                        ct = options.value?options.value:(input&&input.val&&input.val())?input.val():'';
						if( ct ) {
							ct = _xdsoft_datetime.strToDateTime(ct);
						} else if ( options.defaultDate ) {
							ct = _xdsoft_datetime.strToDate(options.defaultDate);
						}
                    }

					if ( ct && _xdsoft_datetime.isValidDate(ct) ) {
						datetimepicker.data('changed',true);
					} else {
                        ct = '';
                    }
					
					return ct?ct:0;
				}
				//debugger
				_xdsoft_datetime.setCurrentTime( getCurrentValue() );

				input
					.data( 'xdsoft_datetimepicker',datetimepicker )
					.on('open.xdsoft focusin.xdsoft mousedown.xdsoft',function(event) {
						if( input.is(':disabled')||input.is(':hidden')||!input.is(':visible')||(input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick) )
							return;
						clearTimeout(timer);
						timer = setTimeout(function() {
							if( input.is(':disabled')||input.is(':hidden')||!input.is(':visible') )
								return;
								
							triggerAfterOpen = true;
							_xdsoft_datetime.setCurrentTime(getCurrentValue());
							
							datetimepicker.trigger('open.xdsoft');
						},100);
					})
					.on('keydown.xdsoft',function( event ) {
						var val = this.value,
							key = event.which;
						switch(true) {
							case !!~([ENTER].indexOf(key)):
								var elementSelector = $("input:visible,textarea:visible");
								datetimepicker.trigger('close.xdsoft');
								elementSelector.eq(elementSelector.index(this) + 1).focus();
							return false;
							case !!~[TAB].indexOf(key):
								datetimepicker.trigger('close.xdsoft');
							return true;
						}
					});
			},
			destroyDateTimePicker = function( input ) {
				var datetimepicker = input.data('xdsoft_datetimepicker');
				if( datetimepicker ) {
					datetimepicker.data('xdsoft_datetime',null);
					datetimepicker.remove();
					input
						.data( 'xdsoft_datetimepicker',null )
						.off( 'open.xdsoft focusin.xdsoft focusout.xdsoft mousedown.xdsoft blur.xdsoft keydown.xdsoft' );
					$(window).off('resize.xdsoft');
					$([window,document.body]).off('mousedown.xdsoft');
					input.unmousewheel&&input.unmousewheel();
				}
			};
		$(document)
			.off('keydown.xdsoftctrl keyup.xdsoftctrl')
			.on('keydown.xdsoftctrl',function(e) {
				if ( e.keyCode == CTRLKEY )
					ctrlDown = true;
			})
			.on('keyup.xdsoftctrl',function(e) {
				if ( e.keyCode == CTRLKEY )
					ctrlDown = false;
			});
		return this.each(function() {
			var datetimepicker;
			if( datetimepicker = $(this).data('xdsoft_datetimepicker') ) {
				if( $.type(opt) === 'string' ) {
					switch(opt) {
						case 'show':
							$(this).select().focus();
							datetimepicker.trigger( 'open.xdsoft' );
						break;
						case 'hide':
							datetimepicker.trigger('close.xdsoft');
						break;
						case 'destroy':
							destroyDateTimePicker($(this));
						break;
						case 'reset':
							this.value = this.defaultValue;
							if(!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(Date.parseDate(this.value, options.format)))
								datetimepicker.data('changed',false);
							datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value);
						break;
					}
				}else{
					datetimepicker
						.setOptions(opt);
				}
				return 0;
			}else
				if( ($.type(opt) !== 'string') ){
					if( !options.lazyInit||options.open||options.inline ){
						createDateTimePicker($(this));
					}else
						lazyInit($(this));
				}
		});
	};
	$.fn.datetimepicker.defaults = default_options;
})( jQuery );

/*
 * Copyright (c) 2013 Brandon Aaron (http://brandonaaron.net)
 *
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 * Thanks to: Seamus Leahy for adding deltaX and deltaY
 *
 * Version: 3.1.3
 *
 * Requires: 1.2.2+
 */
(function(factory) {if(typeof define==='function'&&define.amd) {define(['jquery'],factory)}else if(typeof exports==='object') {module.exports=factory}else{factory(jQuery)}}(function($) {var toFix=['wheel','mousewheel','DOMMouseScroll','MozMousePixelScroll'];var toBind='onwheel'in document||document.documentMode>=9?['wheel']:['mousewheel','DomMouseScroll','MozMousePixelScroll'];var lowestDelta,lowestDeltaXY;if($.event.fixHooks) {for(var i=toFix.length;i;) {$.event.fixHooks[toFix[--i]]=$.event.mouseHooks}}$.event.special.mousewheel={setup:function() {if(this.addEventListener) {for(var i=toBind.length;i;) {this.addEventListener(toBind[--i],handler,false)}}else{this.onmousewheel=handler}},teardown:function() {if(this.removeEventListener) {for(var i=toBind.length;i;) {this.removeEventListener(toBind[--i],handler,false)}}else{this.onmousewheel=null}}};$.fn.extend({mousewheel:function(fn) {return fn?this.bind("mousewheel",fn):this.trigger("mousewheel")},unmousewheel:function(fn) {return this.unbind("mousewheel",fn)}});function handler(event) {var orgEvent=event||window.event,args=[].slice.call(arguments,1),delta=0,deltaX=0,deltaY=0,absDelta=0,absDeltaXY=0,fn;event=$.event.fix(orgEvent);event.type="mousewheel";if(orgEvent.wheelDelta) {delta=orgEvent.wheelDelta}if(orgEvent.detail) {delta=orgEvent.detail*-1}if(orgEvent.deltaY) {deltaY=orgEvent.deltaY*-1;delta=deltaY}if(orgEvent.deltaX) {deltaX=orgEvent.deltaX;delta=deltaX*-1}if(orgEvent.wheelDeltaY!==undefined) {deltaY=orgEvent.wheelDeltaY}if(orgEvent.wheelDeltaX!==undefined) {deltaX=orgEvent.wheelDeltaX*-1}absDelta=Math.abs(delta);if(!lowestDelta||absDelta<lowestDelta) {lowestDelta=absDelta}absDeltaXY=Math.max(Math.abs(deltaY),Math.abs(deltaX));if(!lowestDeltaXY||absDeltaXY<lowestDeltaXY) {lowestDeltaXY=absDeltaXY}fn=delta>0?'floor':'ceil';delta=Math[fn](delta/lowestDelta);deltaX=Math[fn](deltaX/lowestDeltaXY);deltaY=Math[fn](deltaY/lowestDeltaXY);args.unshift(event,delta,deltaX,deltaY);return($.event.dispatch||$.event.handle).apply(this,args)}}));


// Parse and Format Library
//http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/
/*
 * Copyright (C) 2004 Baron Schwartz <baron at sequent dot org>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by the
 * Free Software Foundation, version 2.1.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
 * details.
 */
Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(b){if(b=="unixtime"){return parseInt(this.getTime()/1000);}if(Date.formatFunctions[b]==null){Date.createNewFormat(b);}var a=Date.formatFunctions[b];return this[a]();};Date.createNewFormat=function(format){var funcName="format"+Date.formatFunctions.count++;Date.formatFunctions[format]=funcName;var code="Date.prototype."+funcName+" = function() {return ";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true;}else{if(special){special=false;code+="'"+String.escape(ch)+"' + ";}else{code+=Date.getFormatCode(ch);}}}eval(code.substring(0,code.length-3)+";}");};Date.getFormatCode=function(a){switch(a){case"d":return"String.leftPad(this.getDate(), 2, '0') + ";case"D":return"Date.dayNames[this.getDay()].substring(0, 3) + ";case"j":return"this.getDate() + ";case"l":return"Date.dayNames[this.getDay()] + ";case"S":return"this.getSuffix() + ";case"w":return"this.getDay() + ";case"z":return"this.getDayOfYear() + ";case"W":return"this.getWeekOfYear() + ";case"F":return"Date.monthNames[this.getMonth()] + ";case"m":return"String.leftPad(this.getMonth() + 1, 2, '0') + ";case"M":return"Date.monthNames[this.getMonth()].substring(0, 3) + ";case"n":return"(this.getMonth() + 1) + ";case"t":return"this.getDaysInMonth() + ";case"L":return"(this.isLeapYear() ? 1 : 0) + ";case"Y":return"this.getFullYear() + ";case"y":return"('' + this.getFullYear()).substring(2, 4) + ";case"a":return"(this.getHours() < 12 ? 'am' : 'pm') + ";case"A":return"(this.getHours() < 12 ? 'AM' : 'PM') + ";case"g":return"((this.getHours() %12) ? this.getHours() % 12 : 12) + ";case"G":return"this.getHours() + ";case"h":return"String.leftPad((this.getHours() %12) ? this.getHours() % 12 : 12, 2, '0') + ";case"H":return"String.leftPad(this.getHours(), 2, '0') + ";case"i":return"String.leftPad(this.getMinutes(), 2, '0') + ";case"s":return"String.leftPad(this.getSeconds(), 2, '0') + ";case"O":return"this.getGMTOffset() + ";case"T":return"this.getTimezone() + ";case"Z":return"(this.getTimezoneOffset() * -60) + ";default:return"'"+String.escape(a)+"' + ";}};Date.parseDate=function(a,c){if(c=="unixtime"){return new Date(!isNaN(parseInt(a))?parseInt(a)*1000:0);}if(Date.parseFunctions[c]==null){Date.createParser(c);}var b=Date.parseFunctions[c];return Date[b](a);};Date.createParser=function(format){var funcName="parse"+Date.parseFunctions.count++;var regexNum=Date.parseRegexes.length;var currentGroup=1;Date.parseFunctions[format]=funcName;var code="Date."+funcName+" = function(input) {\nvar y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, z = -1;\nvar d = new Date();\ny = d.getFullYear();\nm = d.getMonth();\nd = d.getDate();\nvar results = input.match(Date.parseRegexes["+regexNum+"]);\nif (results && results.length > 0) {";var regex="";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true;}else{if(special){special=false;regex+=String.escape(ch);}else{obj=Date.formatCodeToRegex(ch,currentGroup);currentGroup+=obj.g;regex+=obj.s;if(obj.g&&obj.c){code+=obj.c;}}}}code+="if (y > 0 && z > 0){\nvar doyDate = new Date(y,0);\ndoyDate.setDate(z);\nm = doyDate.getMonth();\nd = doyDate.getDate();\n}";code+="if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n{return new Date(y, m, d, h, i, s);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n{return new Date(y, m, d, h, i);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0)\n{return new Date(y, m, d, h);}\nelse if (y > 0 && m >= 0 && d > 0)\n{return new Date(y, m, d);}\nelse if (y > 0 && m >= 0)\n{return new Date(y, m);}\nelse if (y > 0)\n{return new Date(y);}\n}return null;}";Date.parseRegexes[regexNum]=new RegExp("^"+regex+"$");eval(code);};Date.formatCodeToRegex=function(b,a){switch(b){case"D":return{g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case"j":case"d":return{g:1,c:"d = parseInt(results["+a+"], 10);\n",s:"(\\d{1,2})"};case"l":return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case"S":return{g:0,c:null,s:"(?:st|nd|rd|th)"};case"w":return{g:0,c:null,s:"\\d"};case"z":return{g:1,c:"z = parseInt(results["+a+"], 10);\n",s:"(\\d{1,3})"};case"W":return{g:0,c:null,s:"(?:\\d{2})"};case"F":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case"M":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case"n":case"m":return{g:1,c:"m = parseInt(results["+a+"], 10) - 1;\n",s:"(\\d{1,2})"};case"t":return{g:0,c:null,s:"\\d{1,2}"};case"L":return{g:0,c:null,s:"(?:1|0)"};case"Y":return{g:1,c:"y = parseInt(results["+a+"], 10);\n",s:"(\\d{4})"};case"y":return{g:1,c:"var ty = parseInt(results["+a+"], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case"a":return{g:1,c:"if (results["+a+"] == 'am') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case"A":return{g:1,c:"if (results["+a+"] == 'AM') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case"g":case"G":case"h":case"H":return{g:1,c:"h = parseInt(results["+a+"], 10);\n",s:"(\\d{1,2})"};case"i":return{g:1,c:"i = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"s":return{g:1,c:"s = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"O":return{g:0,c:null,s:"[+-]\\d{4}"};case"T":return{g:0,c:null,s:"[A-Z]{3}"};case"Z":return{g:0,c:null,s:"[+-]\\d{1,5}"};default:return{g:0,c:null,s:String.escape(b)};}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{3}) [0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3");};Date.prototype.getGMTOffset=function(){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+String.leftPad(Math.abs(this.getTimezoneOffset())%60,2,"0");};Date.prototype.getDayOfYear=function(){var a=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var b=0;b<this.getMonth();++b){a+=Date.daysInMonth[b];}return a+this.getDate();};Date.prototype.getWeekOfYear=function(){var b=this.getDayOfYear()+(4-this.getDay());var a=new Date(this.getFullYear(),0,1);var c=(7-a.getDay()+4);return String.leftPad(Math.ceil((b-c)/7)+1,2,"0");};Date.prototype.isLeapYear=function(){var a=this.getFullYear();return((a&3)==0&&(a%100||(a%400==0&&a)));};Date.prototype.getFirstDayOfMonth=function(){var a=(this.getDay()-(this.getDate()-1))%7;return(a<0)?(a+7):a;};Date.prototype.getLastDayOfMonth=function(){var a=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return(a<0)?(a+7):a;};Date.prototype.getDaysInMonth=function(){Date.daysInMonth[1]=this.isLeapYear()?29:28;return Date.daysInMonth[this.getMonth()];};Date.prototype.getSuffix=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";}};String.escape=function(a){return a.replace(/('|\\)/g,"\\$1");};String.leftPad=function(d,b,c){var a=new String(d);if(c==null){c=" ";}while(a.length<b){a=c+a;}return a;};Date.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.y2kYear=50;Date.monthNumbers={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11};Date.patterns={ISO8601LongPattern:"Y-m-d H:i:s",ISO8601ShortPattern:"Y-m-d",ShortDatePattern:"n/j/Y",LongDatePattern:"l, F d, Y",FullDateTimePattern:"l, F d, Y g:i:s A",MonthDayPattern:"F d",ShortTimePattern:"g:i A",LongTimePattern:"g:i:s A",SortableDateTimePattern:"Y-m-d\\TH:i:s",UniversalSortableDateTimePattern:"Y-m-d H:i:sO",YearMonthPattern:"F, Y"};

//
//For more jquery css classes, especially jqbutton classes go here:  https://api.jqueryui.com/theming/icons/
//-------------------------------------------------------------------------------------------------------------------------------

$(document).ready(function () {
    LoadMedchartJqueryUi();
});

function LoadMedchartJqueryUi() {
    $(".mcaccordion").accordion({
        heightStyle: "content"
    });
    $(".mcaccordion-show").accordion({
        heightStyle: "content"
    }).show();
    $(".mcaccordion-collapse").accordion({
        collapsible: true,
        heightStyle: "content"
    });
    $(".jqbutton").button();
    $(".jqbutton-submit").button({
        icon: 'ui-icon-check'
    });
    $(".jqbutton-save").button({
        icon: 'ui-icon-disk'
    });
    $(".jqbutton-arrow-in").button({
        icon: 'ui-icon-arrow-1-se'
    });
    $(".jqbutton-arrow-out").button({
        icon: 'ui-icon-arrow-1-ne',
        iconPosition: "end"
    });
    $(".jqbutton-arrow-transfer").button({
        icon: 'ui-icon-transfer-e-w'
    });
    $(".jqbutton-search").button({
        icon: 'ui-icon-search'
    });
    $(".jqbutton-previous").button({
        icon: 'ui-icon-caret-1-w'
    });

    $(".jqbutton-reset").button({
        icon: 'ui-icon-arrowreturnthick-1-s'
    });

    $(".jqbutton-next").button({
        icon: 'ui-icon-arrow-1-e',
        iconPosition: "end"
    });
    $(".jqbutton-close").button({
        icon: 'ui-icon-close'
    });
    $(".jqbutton-lock").button({
        icon: 'ui-icon-locked'
    });
    $(".jqbutton-power").button({
        icon: 'ui-icon-power'
    });
    $(".jqbutton-refresh").button({
        icon: 'ui-icon-refresh'
    });
    $(".jqbutton-export").button({
        icon: 'ui-icon-extlink',
        iconPosition: "end"
    });
    $(".jqbutton-edit").button({
        icon: 'ui-icon-wrench',
        iconPosition: "end"
    });
    $(".jqbutton-disabled").button({
        disabled: true,
    });
    $(".jqradio").buttonset();
    $(".jqcheck").buttonset();
    $(".jqradio input:radio").checkboxradio({ icon: false });
    $(".jqcheck input:checkbox").checkboxradio({ icon: false });
    $(".jqtabs").tabs();
    $(".jqAutoModalDialog").dialog({
        autoOpen: false,
        resizable: false,
        height: 'auto',
        width: 'auto',
        modal: true,
        buttons: {
            "OK": function () {
                $(this).dialog("close");
            }
        }
    });
    $(".jqtabs-show").tabs().show();
    $(".jqLargeModalDialog").dialog({
        autoOpen: false,
        resizable: false,
        height: 'auto',
        width: 450,
        modal: true,
        buttons: {
            "OK": function () {
                $(this).dialog("close");
            }
        }
    });
    $(".jqMediumModalDialog").dialog({
        autoOpen: false,
        resizable: false,
        height: 210,
        modal: true,
        buttons: {
            "OK": function () {
                $(this).dialog("close");
            }
        }
    });
    $(".jqSmallModalDialog").dialog({
        autoOpen: false,
        resizable: false,
        height: 140,
        modal: true,
        buttons: {
            "OK": function () {
                $(this).dialog("close");
            }
        }
    });
    $(".jqUpdatingModalDialog").dialog({
        autoOpen: false,
        resizable: false,
        draggable: false,
        height: 120,
        modal: true,
        title: "Loading",
        hide: {
            effect: "fade",
            duration: 250
        }
    });
    $(".jqLoadingModalDialog").dialog({
        autoOpen: false,
        resizable: false,
        draggable: false,
        height: 120,
        modal: true,
        title: "Loading",
        hide: {
            effect: "fade",
            duration: 500
        }
    });

    $(".jqLoadingDocumentsModalDialog").dialog({
        autoOpen: false,
        resizable: false,
        draggable: false,
        height: 120,
        modal: true,
        title: "Loading",
        open: function (event, ui) {
            var win = $(window);
            $(this).parent().css({
                position: 'absolute',
                left: (win.width() - $(this).parent().outerWidth()) / 2,
                top: (win.height() - $(this).parent().outerHeight()) / 2
            });
            //$(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
            $(this).parent().focus();
        },
        hide: {
            effect: "fade",
            duration: 250
        }
    });

    $(".jqProgressBar").progressbar({
        value: false
    });

    $(".jqTimeoutModalDialog").dialog({
        autoOpen: false,
        resizable: false,
        height: 230,
        width: 400,
        modal: true,
        close: function () {
            //__doPostBack($_MASTER_POSTBACK_BUTTON_CLIENTID, '');
            RaiseMasterEvent('MasterCustomEvent', '');  // defined in Master.Master
            ResetTimer();                               // defined in TimeoutDialog.js
        },
        buttons: {
            "Continue": function () {
                $(this).dialog("close");
            },

            "Logout": function () {
                var logoutUrl = $_APP_ROOT_PATH + "Public/Logout.aspx";
                window.location.replace(logoutUrl);
            }
        }
    });

    $(".jqSingleErrorLogModalDialog").dialog({
        autoOpen: false,
        resizable: false,
        height: 500,
        width: 880,
        modal: true,
        buttons: {
            "OK": function () {
                $(this).dialog("close");
            }
        }
    });

    $(".jqSingleAuditLogModalDialog").dialog({
        autoOpen: false,
        resizable: false,
        height: 'auto',
        width: 750,
        modal: true,
        buttons: {
            "OK": function () {
                $(this).dialog("close");
            }
        }
    });

    $(".jqSingleSystemMessageModalDialog").dialog({
        autoOpen: false,
        resizable: false,
        height: 'auto',
        width: 700,
        modal: true,
        buttons: {
            "OK": function () {
                $(this).dialog("close");
            }
        }
    });

    $(".jqSaveUserDetailsModalDialog").dialog({            
        id: "jqSaveUserDetailsModal",
        autoOpen: false,
        resizable: false,
        height: 130,
        width: 300,
        modal: true,
        title: "Save User Details",
        buttons: {
            "Submit": {
                id: "UserDetailsModalSubmitButton",
                text: "Submit",
                click: function () {
                    $(this).dialog("close");
                    CallUserDetailsRaiseCustomEventMethod();    // Defined in CACSecureOnly/Registration/UserDetails.aspx
                }
            },

            "Cancel": {
                id: "UserDetailsModalCancelButton",
                text: "Cancel",
                click: function () {
                    $(this).dialog("close");
                }
            }
        }
    });

    $(".jqSaveUserDetailsWithGoBackModalDialog").dialog({             
        autoOpen: false,
        resizable: false,
        height: 130,
        width: 300,
        modal: true,
        title: "Save User Details",
        buttons: {
            "Submit & Go Back": function () {
                $(this).dialog("close");
                CallUserDetailsRaiseCustomEventMethod(true);    // Defined in CACSecureOnly/Registration/UserDetails.aspx
            },

            "Submit": function () {
                $(this).dialog("close");
                CallUserDetailsRaiseCustomEventMethod(false);    // Defined in CACSecureOnly/Registration/UserDetails.aspx
            },

            "Cancel": function () {
                $(this).dialog("close");
            }
        }
    });


    // Only display the extended MedchartSoldier details
    $(".jqSaveUserDetailsNotification").dialog({
        autoOpen: false,
        resizable: false,
        height: 140,
        width: 230,
        modal: true,
        buttons: {
            "OK": function () {
                $(this).dialog("close");
            }
        }
    });

    $(".jqGo2InstallActiveXModalDialog").dialog({             // Defined in UserControls/FileUpload.ascx
        autoOpen: false,
        resizable: false,
        height: 'auto',
        width: 400,
        modal: true,
        title: "Install Dynamsoft Service",
        buttons: {
            "OK": function () {
                $(this).dialog("close");
            }
        }
    });


    // Handling the MedchartSoldier Demographics update dialog
    $(".jqSaveSoldierDemographicsModalDialog").dialog({             // Defined in UserControls/SoldierInfo.ascx
        autoOpen: false,
        resizable: false,
        height: 625,
        width: 850,
        modal: true,
        buttons: {
            "Submit": function () {
                var sdAllFields = soldierDemographicsGetValidationFields();
                sdAllFields.removeClass("ui-state-error");
                var valid = true;
                var bValid = GetFieldsValidateValue(valid, 'ALL');
                if (bValid) {
                    CallSoldierDemographicRaiseCustomEventMethod();
                    $(this).dialog("close");
                }
            },
            "Cancel": function () {
                var sdAllFields = soldierDemographicsGetValidationFields();
                sdAllFields.removeClass("ui-state-error");
                ReloadSoldierInfoByWebMethod();  // Defined in SoldierDemographics.js
                $(this).dialog("close");
            }
        }
    });

    // Only display the extended MedchartSoldier details
    $(".jqSoldierExtendedDetailsModalDialog").dialog({
        autoOpen: false,
        resizable: false,
        height: 570,
        width: 850,
        modal: true,
        buttons: {
            "OK": function () {
                $(this).dialog("close");
            }
        }
    });

    // Handling the View Hipaa Certificate dialog
    $(".jqViewHipaaCertificateModalDialog").dialog({            
        autoOpen: false,
        resizable: false,
        height: 'auto',
        width: 1000,
        modal: true,
        title: "View HIPAA Certificate",
        buttons: {
            "Disapprove": function () {
                DisapproveChildUserApprovedHipaaCertificate();    // Defined in Administration/UserDetailsNew.aspx
                HideViewCertificateIframe();
                $(this).dialog("close");
            },
            "Cancel": function () {
                HideViewCertificateIframe();
                $(this).dialog("close");
            }
        }
    });


    // Handling the Approve Hipaa Certificate dialog
    $(".jqApproveHipaaCertificateModalDialog").dialog({             
        autoOpen: false,
        resizable: false,
        height: 'auto',
        width: 1000,
        modal: true,
        title: "Approve HIPAA Certificate",
        buttons: {
            "Submit": function () {
                if (checkRequiredFields() === true) {    // checkRequiredFields() is defined in UserDetails.asp
                    ApproveRejectChildUserPendingHipaaCertificate();    // Defined in Administration/UserDetailsNew.aspx
                    HideApproveCertificateIframe();
                    $(this).dialog("close");
                }
            },
            "Cancel": function () {
                HideApproveCertificateIframe();
                $(this).dialog("close");
            }
        }
    });


    //Medchart Notification Dialog
    var closedialog;
    $(".jqNotificationDialog").dialog({
        autoOpen: false,
        autoResize: true,
        height: "auto",
        maxHeight: 400,
        title: "Notifications",
        resizable: "false",
        position: {
            my: "right top",
            at: "left bottom",
            of: ".notification-div"
        },
        show: {
            effect: "blind",
            duration: 300
        },
        hide: {
            effect: "blind",
            duration: 300
        }//,
        //The following commented out code will close the notification dialog when clicked outside of the dialog
        //
        //open: function() {
        //    closedialog = 0;
        //    $(document).bind('click', overlayclickclose);
        //},
        //focus: function() {
        //    closedialog = 0;
        //},
        //close: function() {
        //    $(document).unbind('click');
        //}          
    });
    //function overlayclickclose() {
    //    if (closedialog) {
    //        $('.jqNotificationDialog').dialog('close');
    //    }
    //    closedialog = 1;
    //}

    // Mats Manage Installations Dialog in UserDetails page
    // Mats Manage Installations Dialog in UserDetails page
    $(".jqManageInstallationsDialog").dialog(
        {
            autoOpen: false,
            resizable: false,
            height: 390,
            width: 320,
            modal: true,
            title: "Manage Installations",
            open: function (type, data) {
                $(this).parent().appendTo("form");
            }
        });
    // Mats Manage Installations Dialog in UserDetails page
    // Mats Manage Installations Dialog in UserDetails page


    $(".jqPageAllErrorsModalDialog").dialog({   // Defined in MyAccount.aspx
        autoOpen: false,
        resizable: false,
        width: 650,
        height: "auto",
        maxHeight: 500,
        modal: true,
        buttons: {
            "OK": function () {
                $(this).dialog("close");
            }
        }
    });

    $(".jqAnnualValidationModalDialog").dialog({
        autoOpen: false,
        closeOnEscape: false,
        resizable: false,
        height: 'auto',
        width: 350,
        modal: true,
        open: function (event, ui) {
            $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
        },
        buttons: {
            "OK": function () {
                ResetAnnualValidationDate();
                $(this).dialog("close");
            }
        }
    });

    //DisapproveDisallowCommentDialog for when a user is disallowed on Userdetail/UserModuleAccessStatus.ascx
    $(".jqDisapproveDiallowCommentsDialog").dialog({
            autoOpen: false,
            resizable: false,
            height: 390,
            width: 320,
            modal: true,
            title: "Comments",
            open: function (type, data) {
                $(this).parent().appendTo("form");
            }
    });
    $(".jqLockoutLockinCommentsDialog").dialog({
        autoOpen: false,
        resizable: false,
        height: 390,
        width: 320,
        modal: true,
        title: "Comments",
        open: function (type, data) {
            $(this).parent().appendTo("form");
        }
    });

    $(".jqSpecialCharacterModalDialog")
        .dialog({
        autoOpen: false,
        open: function () {
            $(this).focus();

            //This is code to fix an IE issue with iframes rendering on top of all other elements
            //Can be removed when IE is no longer being supported
            var $divToFix = $(this);

            if ($(".outer").length == 0) {
                $divToFix.wrap("<div class='outer'></div>");

                $(".outer").append("<iframe src='about:blank' class='cover'>");
                $(".cover").css({
                    'min-width': '100%',
                    'min-height': '100%',
                    'overflow': 'hidden',
                    'position': 'absolute',
                    'border': 'none',
                    'left': 0,
                    'top': 0,
                    'z-index': -1
                });
            }
        },
        resizable: false,
        height: 'auto',
        width: 400,
        modal: true,
        title: "Special Character Notification",
        buttons: {
            "OK": function () {
                $(this).dialog("close");
            }
        }
    });

    $(".jqDisapproveSTRModalDialog").dialog({
        autoOpen: false,
        resizable: false,
        height: 685,
        width: 1250,
        modal: true,
        open: function (event, ui) {
            //var selectedValue = "4";
            ////$('#DisapprovalStatusRadioButtonList').find("input[value='3']").prop("checked", true);
            //$(':radio[value="' + selectedValue + '"]').prop('checked', 'checked');

            //$('#jqDocTypeDropDownList option:contains("Foo")').attr('selected', 'selected');
            //$('#jqDocTypeDropDownList option').map(function () {
            //    if ($(this).text() == docDescription) return this;
            //}).attr('selected', 'selected');
        },
        buttons: [{
            id: "dialogSave",
            text: "Save",
            click: function () {
                $('#MessageLabel').text("");
                var checkedRadio = $("[id*=DisapprovalStatusRadioButtonList] input:checked");
                var value = checkedRadio.val();
                if (value == "4") {
                    if (verifyQuestionsCompleted()) {
                        DisapproveSTRSave(); // Defined in STRDisapproval.ascx

                    }
                }
                else if (value == "5") { 
                    if (verifyAnswersCompleted()) {
                        DisapproveSTRSave(); // Defined in STRDisapproval.ascx

                    }
                }
                else if (value == "6") {
                    if (validateDisapproveVerified())
                        confirmAction(DisapproveSTRSave, "No further changes may be made once Disapproval is Resolved. Do you want to Resolve this Disapproval?", "Resolve Disapproval");
                }
                else
                    DisapproveSTRSave(); // Defined in STRDisapproval.ascx
                    //alert('Resolved button clicked!');
            }
        },
        {
            id: "dialogSubmit",
            text: "Submit",
            click: function () {
                confirmAction(DisapproveSTRFinalize, "No further documents may be added after Submitting. Do you want to Continue?", "Submit Disapproval");
            }
        },
        {
            id: "dialogClose",
            text: "Close",
            click: function () {
                $(this).dialog("close");
            }
        }],
        close: function () {
            DisapproveSTRCancel(); // Defined in STRDisapproval.ascx
        }
    });     

    $("#jqEditDisapproveDocumentModalDialog").dialog({
        title: "Edit Document Disapproval",
        autoOpen: false,
        open: function (event, ui) {


            //$('#jqDocTypeDropDownList option:contains("Foo")').attr('selected', 'selected');
            //$('#jqDocTypeDropDownList option').map(function () {
            //    if ($(this).text() == docDescription) return this;
            //}).attr('selected', 'selected');
        },
        buttons: [{
            id: "btnUpdate",
            text: "Update",
            click: function () {
                var comments = $('#jqCommentsTextBox').text();
                //var pageList = $('#jqPageListTextBox').text();
                if (validateDisapprovalDetailEdit()) {
                    DisapproveDetailUpdate();
                    $(this).dialog("close");
                }
            }
        },
        {
            id: "btnRemove",
            text: "Remove",
            click: function () {
                confirmAction(DisapproveDetailRemove, "This item will be removed from disapproval corrections. Continue?", "Remove Correction Item");
                //DisapproveDetailRemove();
                $(this).dialog("close");
            }
        },
        {
            id: "btnSubmitQuestion",
            text: "Add Question",
            click: function () {
                if (validateDisapprovalDetailEdit()) {
                    DisapproveDetailSubmitQuestion();
                    $(this).dialog("close");
                }
            }
        },
        {
            id: "btnSubmitAnswer",
            text: "Add Answer",
            click: function () {
                if (validateDisapprovalDetailEdit()) {
                    DisapproveDetailSubmitAnswer();
                    $(this).dialog("close");
                }
            }
        },
        {
            id: "btnComplete",
            text: "Complete",
            click: function () {
                DisapproveDetailComplete();
                $(this).dialog("close");
            }
        }],
        height: 'auto',
        width: '600px',
        close: function () {
            return false;
        },
        modal: true
    });

}

// :: UTILITY FUNCTIONS ::

// (NOT READY) Open a page loading dialog notice
function ModalPageLoad() {
    $(".jqLoadingModalDialog").dialog("open");
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(ModalPageLoadingDelayedClose);
    return false;
}

// Force a delay between open and close
function ModalPageLoadingDelayedClose() {
    setTimeout(function () { EndModalPageLoading(); }, 500);
}

// (Automatic) Closes the loading modal notice
function EndModalPageLoading() {
    $(".jqLoadingModalDialog").dialog("close");
}

// Open the in page modal notice
function ModalUpdate() {
    $(".jqUpdatingModalDialog").dialog("open");
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(ModalUpdateDelayedClose);
    return false;
}

// Force a delay between open and close
function ModalUpdateDelayedClose() {
    setTimeout(function () { EndModalUpdate(); }, 500);
}

// (Automatic) Closes the update modal notice
function EndModalUpdate() {
    Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(ModalUpdateDelayedClose);
    $(".jqUpdatingModalDialog").dialog("close");
}

function checkRegularExpression(o, regexp, n) {
    if (!(regexp.test(o.value))) {
        o.className += " " + "ui-state-error";
        //updateTips(n);
        return false;
    }
    else {
        return true;
    }
}

function ValidateSingleSoldierDemographicsFieldOnBlur(elementName) {
    if (GetFieldsValidateValue(true, elementName)) {
        document.getElementById(elementName).className = document.getElementById(elementName).className.replace(/(?:^|\s)ui-state-error(?!\S)/g, '');
    } else {
        document.getElementById(elementName).className += " " + "ui-state-error";
    }
}

function soldierDemographicsGetValidationFields() {
    return $([]).add(document.getElementById('ZipCodeTextBox')).add(document.getElementById('PrimaryPhoneTextBox')).add(document.getElementById('SecondaryPhoneTextBox')).add(document.getElementById('PrimaryPhoneExtTextBox')).add(document.getElementById('SecondaryPhoneExtTextBox')).add(document.getElementById('EmailAddressTextBox')).add(document.getElementById('AlternateZipCodeTextBox'));
}

function GetFieldsValidateValue(valid, elementName) {

    var bValid = valid;

    if (document.getElementById('ZipCodeTextBox').value != '' && (elementName == 'ALL' || elementName == 'ZipCodeTextBox')) {
        if (!checkRegularExpression(document.getElementById('ZipCodeTextBox'), /\d{5}/, "Please enter a valid 5 digit zip code.")) {
            bValid = false;
        }
    }
    if (document.getElementById('PrimaryPhoneTextBox').value != '' && (elementName == 'ALL' || elementName == 'PrimaryPhoneTextBox')) {
        if (!checkRegularExpression(document.getElementById('PrimaryPhoneTextBox'), /^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-?|\ ?))[2-9]\d{2}[- ]?\d{4}$/, "Please enter a valid phone number")) {
            bValid = false;
        }
    }
    if (document.getElementById('SecondaryPhoneTextBox').value != '' && (elementName == 'ALL' || elementName == 'SecondaryPhoneTextBox')) {
        if (!checkRegularExpression(document.getElementById('SecondaryPhoneTextBox'), /^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-?|\ ?))[2-9]\d{2}[- ]?\d{4}$/, "Please enter a valid phone number")) {
            bValid = false;
        }
    }
    if (document.getElementById('PrimaryPhoneExtTextBox').value != '' && (elementName == 'ALL' || elementName == 'PrimaryPhoneExtTextBox')) {
        if (!checkRegularExpression(document.getElementById('PrimaryPhoneExtTextBox'), /^\d*$/, "Please enter a valid numeric extension")) {
            bValid = false;
        }
    }
    if (document.getElementById('SecondaryPhoneExtTextBox').value != '' && (elementName == 'ALL' || elementName == 'SecondaryPhoneExtTextBox')) {
        if (!checkRegularExpression(document.getElementById('SecondaryPhoneExtTextBox'), /^\d*$/, "Please enter a valid numeric extension")) {
            bValid = false;
        }
    }
    if (document.getElementById('EmailAddressTextBox').value != '' && (elementName == 'ALL' || elementName == 'EmailAddressTextBox')) {
        if (!checkRegularExpression(document.getElementById('EmailAddressTextBox'), /^([\w-_]+\.)*[\w-_]+@([\w-_]+\.)*[\w-_]+\.(([Gg][Oo][Vv])|([Mm][Ii][Ll]))$/, "Please enter a valid government-issued email address.")) {
            bValid = false;
        }
    }
    if (document.getElementById('CivilianEmailTextBox').value != '' && (elementName == 'ALL' || elementName == 'CivilianEmailTextBox')) {
        if (!checkRegularExpression(document.getElementById('CivilianEmailTextBox'), /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/, "Please enter a valid email address")) {
            bValid = false;
        }
    }
    if (document.getElementById('AlternateZipCodeTextBox').value != '' && (elementName == 'ALL' || elementName == 'AlternateZipCodeTextBox')) {
        if (!checkRegularExpression(document.getElementById('AlternateZipCodeTextBox'), /\d{5}/, "Please enter a valid 5 digit zip code.")) {
            bValid = false;
        }
    }
    return bValid;
}


// Removes the value of the textbox when locked to population by a date picker
function RemoveDateFromTextbox(field) {
    document.getElementById(field).value = '';
}

// Brokers an AJAX data exchange between the client and the server.
// Requires a page element to display a wait message and a page element to output the returned data.
function AjaxServerBroker(messageElement, message, methodUrl, outputElement) {
    // Display the retrieval message
    var pageMessage = document.getElementById(messageElement);
    pageMessage.innerHTML = message;
    $.ajax({
        url: methodUrl,
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            AjaxServerBrokerSuccess(data, outputElement);
        },
        error: function (xhr, status, error) {
            AjaxServerBrokerError(error, outputElement);
        },
        cache: false
    });
}
function AjaxServerBrokerSuccess(data, outputElement) {
    var pageMessage = document.getElementById(outputElement);
    var deserializedData = JSON.parse(data.d);
    pageMessage.innerHTML = deserializedData;
}
function AjaxServerBrokerError(error, outputElement) {
    var pageMessage = document.getElementById(outputElement);
    pageMessage.innerHTML = error;
}
// Binds all existing <textarea> fields to a function that removes non-printing
// characters from them on KeyDown, KeyUp, Paste and Blur events.
function filterTextareaInput() {
    $("textarea, input[type='text']")
        .not("[data-ignore-invisible-char-filter], [ignore-invisible-char-filter]")
        .bind("keydown keyup paste blur", function (event) {
            var field = $(this);
            var invalidChars = /[\u0000-\u001F\u007F]/g;        // ASCII 0-31 and 127 (in unicode form) regexp
            if (invalidChars.test(field.val())) {
                field.val(field.val()
                    .replace(/\r\n/g, " ")                      // CR + LF (replace to space)
                    .replace(/[\r\n\t\v]/g, " ")                // CR, LF, HorizTab, VertTab (replace to space)
                    .replace(/[\u0000-\u001F\u007F]/g, "")      // Fail safe check for any other non-printing character (http://en.wikipedia.org/wiki/ASCII#ASCII_control_code_chart) (replace to empty string)
                    .replace(/\u0020+$/, " ")                   // Fix multiple spaces at the end issue (replace to single space)
                );
            }
        });
}

// Binds all existing <textarea> fields to a function that removes special characters from them on Focus, KeyDown, KeyUp, Paste, Input events.
// Input event was added because replace logic was not working for IE when pasting using the mouse.
// Supports applying special character check to all textboxes or a specific textbox. 
// Pass in null to apply to all textboxes or controlName to apply to a specific textbox.
function filterTextareaInputSpecialCharacters(controlName) {
    $("textarea, input[type='search'],input[type='text']")
        .not("[data-ignore-invisible-char-filter], [ignore-invisible-char-filter]")
        .bind("focus keydown keyup paste input", function (event) {
            var field = $(this);
            if (controlName == null || field.attr('id').indexOf(controlName) > -1) {
                var invalidChars = /[&<>]/g;            // & < > regexp
                if (invalidChars.test(field.val())) {
                    this.value = this.value
                        .replace(/&amp;/g, "+")         // & encoded value (replace with +)
                        .replace(/&lt;/g, "[")          // < encoded value (replace with [)
                        .replace(/&gt;/g, "]")          // > encoded value (replace with ])
                        .replace(/&/g, "+")             // & (replace with +)
                        .replace(/</g, "[")             // < (replace with [)
                        .replace(/>/g, "]")             // > (replace with ])
                    $(".jqSpecialCharacterModalDialog").dialog("open");
                }
            }
        });
}

//choose to valdiate XSS chars for entire page or indivudual controls
function RunSpecialCharValidation(validateEntirePage, controlArray) {

    if (validateEntirePage === true) {
        filterTextareaInputSpecialCharacters();
    } else {
        //for each item in array run filter for special character
        var length = controlArray.length,
            element = null;
        for (var i = 0; i < length; i++) {
            element = controlArray[i];

            filterTextareaInputSpecialCharacters(element);
        }
    }
}

/*!
* TableSorter 2.17.8 min - Client-side table sorting with ease!
* Copyright (c) 2007 Christian Bach
*/
!function(h){h.extend({tablesorter:new function(){function d(){var b=arguments[0],a=1<arguments.length?Array.prototype.slice.call(arguments):b;if("undefined"!==typeof console&&"undefined"!==typeof console.log)console[/error/i.test(b)?"error":/warn/i.test(b)?"warn":"log"](a);else alert(a)}function q(b,a){d(b+" ("+((new Date).getTime()-a.getTime())+"ms)")}function p(b){for(var a in b)return!1;return!0}function r(b,a,c){if(!a)return"";var f,e=b.config,l=e.textExtraction||"",d="",d="basic"===l?h(a).attr(e.textAttribute)|| a.textContent||a.innerText||h(a).text()||"":"function"===typeof l?l(a,b,c):"function"===typeof(f=g.getColumnData(b,l,c))?f(a,b,c):a.textContent||a.innerText||h(a).text()||"";return h.trim(d)}function v(b){var a,c,f=b.config,e=f.$tbodies=f.$table.children("tbody:not(."+f.cssInfoBlock+")"),l,x,k,h,m,B,u,s,t,p=0,v="",w=e.length;if(0===w)return f.debug?d("Warning: *Empty table!* Not building a parser cache"):"";f.debug&&(t=new Date,d("Detecting parsers for each column"));a=[];for(c=[];p<w;){l=e[p].rows; if(l[p])for(x=f.columns,k=0;k<x;k++){h=f.$headers.filter('[data-column="'+k+'"]:last');m=g.getColumnData(b,f.headers,k);s=g.getParserById(g.getData(h,m,"extractor"));u=g.getParserById(g.getData(h,m,"sorter"));B="false"===g.getData(h,m,"parser");f.empties[k]=(g.getData(h,m,"empty")||f.emptyTo||(f.emptyToBottom?"bottom":"top")).toLowerCase();f.strings[k]=(g.getData(h,m,"string")||f.stringTo||"max").toLowerCase();B&&(u=g.getParserById("no-parser"));s||(s=!1);if(!u)a:{h=b;m=l;B=-1;u=k;for(var A=void 0, K=g.parsers.length,G=!1,z="",A=!0;""===z&&A;)B++,m[B]?(G=m[B].cells[u],z=r(h,G,u),h.config.debug&&d("Checking if value was empty on row "+B+", column: "+u+': "'+z+'"')):A=!1;for(;0<=--K;)if((A=g.parsers[K])&&"text"!==A.id&&A.is&&A.is(z,h,G)){u=A;break a}u=g.getParserById("text")}f.debug&&(v+="column:"+k+"; extractor:"+s.id+"; parser:"+u.id+"; string:"+f.strings[k]+"; empty: "+f.empties[k]+"\n");c[k]=u;a[k]=s}p+=c.length?w:1}f.debug&&(d(v?v:"No parsers detected"),q("Completed detecting parsers",t)); f.parsers=c;f.extractors=a}function w(b){var a,c,f,e,l,x,k,n,m,p,u,s=b.config,t=s.$table.children("tbody"),v=s.extractors,w=s.parsers;s.cache={};s.totalRows=0;if(!w)return s.debug?d("Warning: *Empty table!* Not building a cache"):"";s.debug&&(n=new Date);s.showProcessing&&g.isProcessing(b,!0);for(l=0;l<t.length;l++)if(u=[],a=s.cache[l]={normalized:[]},!t.eq(l).hasClass(s.cssInfoBlock)){m=t[l]&&t[l].rows.length||0;for(f=0;f<m;++f)if(p={child:[]},x=h(t[l].rows[f]),k=[],x.hasClass(s.cssChildRow)&&0!== f)c=a.normalized.length-1,a.normalized[c][s.columns].$row=a.normalized[c][s.columns].$row.add(x),x.prev().hasClass(s.cssChildRow)||x.prev().addClass(g.css.cssHasChild),p.child[c]=h.trim(x[0].textContent||x[0].innerText||x.text()||"");else{p.$row=x;p.order=f;for(e=0;e<s.columns;++e)"undefined"===typeof w[e]?s.debug&&d("No parser found for cell:",x[0].cells[e],"does it have a header?"):(c=r(b,x[0].cells[e],e),c="undefined"===typeof v[e].id?c:v[e].format(c,b,x[0].cells[e],e),c="no-parser"===w[e].id? "":w[e].format(c,b,x[0].cells[e],e),k.push(s.ignoreCase&&"string"===typeof c?c.toLowerCase():c),"numeric"===(w[e].type||"").toLowerCase()&&(u[e]=Math.max(Math.abs(c)||0,u[e]||0)));k[s.columns]=p;a.normalized.push(k)}a.colMax=u;s.totalRows+=a.normalized.length}s.showProcessing&&g.isProcessing(b);s.debug&&q("Building cache for "+m+" rows",n)}function z(b,a){var c=b.config,f=c.widgetOptions,e=b.tBodies,l=[],d=c.cache,k,n,m,r,u,s;if(p(d))return c.appender?c.appender(b,l):b.isUpdating?c.$table.trigger("updateComplete", b):"";c.debug&&(s=new Date);for(u=0;u<e.length;u++)if(k=h(e[u]),k.length&&!k.hasClass(c.cssInfoBlock)){m=g.processTbody(b,k,!0);k=d[u].normalized;n=k.length;for(r=0;r<n;r++)l.push(k[r][c.columns].$row),c.appender&&(!c.pager||c.pager.removeRows&&f.pager_removeRows||c.pager.ajax)||m.append(k[r][c.columns].$row);g.processTbody(b,m,!1)}c.appender&&c.appender(b,l);c.debug&&q("Rebuilt table",s);a||c.appender||g.applyWidget(b);b.isUpdating&&c.$table.trigger("updateComplete",b)}function D(b){return/^d/i.test(b)|| 1===b}function E(b){var a,c,f,e,l,x,k,n=b.config;n.headerList=[];n.headerContent=[];n.debug&&(k=new Date);n.columns=g.computeColumnIndex(n.$table.children("thead, tfoot").children("tr"));e=n.cssIcon?'<i class="'+(n.cssIcon===g.css.icon?g.css.icon:n.cssIcon+" "+g.css.icon)+'"></i>':"";n.$headers=h(b).find(n.selectorHeaders).each(function(k){c=h(this);a=g.getColumnData(b,n.headers,k,!0);n.headerContent[k]=h(this).html();""!==n.headerTemplate&&(l=n.headerTemplate.replace(/\{content\}/g,h(this).html()).replace(/\{icon\}/g, e),n.onRenderTemplate&&(f=n.onRenderTemplate.apply(c,[k,l]))&&"string"===typeof f&&(l=f),h(this).html('<div class="'+g.css.headerIn+'">'+l+"</div>"));n.onRenderHeader&&n.onRenderHeader.apply(c,[k]);this.column=parseInt(h(this).attr("data-column"),10);this.order=D(g.getData(c,a,"sortInitialOrder")||n.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;x=g.getData(c,a,"lockedOrder")||!1;"undefined"!==typeof x&&!1!==x&&(this.order=this.lockedOrder=D(x)?[1,1,1]:[0,0,0]);c.addClass(g.css.header+ " "+n.cssHeader);n.headerList[k]=this;c.parent().addClass(g.css.headerRow+" "+n.cssHeaderRow).attr("role","row");n.tabIndex&&c.attr("tabindex",0)}).attr({scope:"col",role:"columnheader"});H(b);n.debug&&(q("Built headers:",k),d(n.$headers))}function C(b,a,c){var f=b.config;f.$table.find(f.selectorRemove).remove();v(b);w(b);I(f.$table,a,c)}function H(b){var a,c,f,e=b.config;e.$headers.each(function(l,d){c=h(d);f=g.getColumnData(b,e.headers,l,!0);a="false"===g.getData(d,f,"sorter")||"false"===g.getData(d, f,"parser");d.sortDisabled=a;c[a?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+a);b.id&&(a?c.removeAttr("aria-controls"):c.attr("aria-controls",b.id))})}function F(b){var a,c,f=b.config,e=f.sortList,l=e.length,d=g.css.sortNone+" "+f.cssNone,k=[g.css.sortAsc+" "+f.cssAsc,g.css.sortDesc+" "+f.cssDesc],n=["ascending","descending"],m=h(b).find("tfoot tr").children().add(f.$extraHeaders).removeClass(k.join(" "));f.$headers.removeClass(k.join(" ")).addClass(d).attr("aria-sort","none"); for(a=0;a<l;a++)if(2!==e[a][1]&&(b=f.$headers.not(".sorter-false").filter('[data-column="'+e[a][0]+'"]'+(1===l?":last":"")),b.length)){for(c=0;c<b.length;c++)b[c].sortDisabled||b.eq(c).removeClass(d).addClass(k[e[a][1]]).attr("aria-sort",n[e[a][1]]);m.length&&m.filter('[data-column="'+e[a][0]+'"]').removeClass(d).addClass(k[e[a][1]])}f.$headers.not(".sorter-false").each(function(){var b=h(this),a=this.order[(this.count+1)%(f.sortReset?3:2)],a=b.text()+": "+g.language[b.hasClass(g.css.sortAsc)?"sortAsc": b.hasClass(g.css.sortDesc)?"sortDesc":"sortNone"]+g.language[0===a?"nextAsc":1===a?"nextDesc":"nextNone"];b.attr("aria-label",a)})}function O(b){var a,c,f=b.config;f.widthFixed&&0===f.$table.find("colgroup").length&&(a=h("<colgroup>"),c=h(b).width(),h(b.tBodies).not("."+f.cssInfoBlock).find("tr:first").children(":visible").each(function(){a.append(h("<col>").css("width",parseInt(h(this).width()/c*1E3,10)/10+"%"))}),f.$table.prepend(a))}function P(b,a){var c,f,e,l,g,k=b.config,d=a||k.sortList;k.sortList= [];h.each(d,function(b,a){l=parseInt(a[0],10);if(e=k.$headers.filter('[data-column="'+l+'"]:last')[0]){f=(f=(""+a[1]).match(/^(1|d|s|o|n)/))?f[0]:"";switch(f){case "1":case "d":f=1;break;case "s":f=g||0;break;case "o":c=e.order[(g||0)%(k.sortReset?3:2)];f=0===c?1:1===c?0:2;break;case "n":e.count+=1;f=e.order[e.count%(k.sortReset?3:2)];break;default:f=0}g=0===b?f:g;c=[l,parseInt(f,10)||0];k.sortList.push(c);f=h.inArray(c[1],e.order);e.count=0<=f?f:c[1]%(k.sortReset?3:2)}})}function Q(b,a){return b&& b[a]?b[a].type||"":""}function L(b,a,c){if(b.isUpdating)return setTimeout(function(){L(b,a,c)},50);var f,e,l,d,k=b.config,n=!c[k.sortMultiSortKey],m=k.$table;m.trigger("sortStart",b);a.count=c[k.sortResetKey]?2:(a.count+1)%(k.sortReset?3:2);k.sortRestart&&(e=a,k.$headers.each(function(){this===e||!n&&h(this).is("."+g.css.sortDesc+",."+g.css.sortAsc)||(this.count=-1)}));e=a.column;if(n){k.sortList=[];if(null!==k.sortForce)for(f=k.sortForce,l=0;l<f.length;l++)f[l][0]!==e&&k.sortList.push(f[l]);f=a.order[a.count]; if(2>f&&(k.sortList.push([e,f]),1<a.colSpan))for(l=1;l<a.colSpan;l++)k.sortList.push([e+l,f])}else{if(k.sortAppend&&1<k.sortList.length)for(l=0;l<k.sortAppend.length;l++)d=g.isValueInArray(k.sortAppend[l][0],k.sortList),0<=d&&k.sortList.splice(d,1);if(0<=g.isValueInArray(e,k.sortList))for(l=0;l<k.sortList.length;l++)d=k.sortList[l],f=k.$headers.filter('[data-column="'+d[0]+'"]:last')[0],d[0]===e&&(d[1]=f.order[a.count],2===d[1]&&(k.sortList.splice(l,1),f.count=-1));else if(f=a.order[a.count],2>f&& (k.sortList.push([e,f]),1<a.colSpan))for(l=1;l<a.colSpan;l++)k.sortList.push([e+l,f])}if(null!==k.sortAppend)for(f=k.sortAppend,l=0;l<f.length;l++)f[l][0]!==e&&k.sortList.push(f[l]);m.trigger("sortBegin",b);setTimeout(function(){F(b);J(b);z(b);m.trigger("sortEnd",b)},1)}function J(b){var a,c,f,e,l,d,k,h,m,r,u,s=0,t=b.config,v=t.textSorter||"",w=t.sortList,y=w.length,z=b.tBodies.length;if(!t.serverSideSorting&&!p(t.cache)){t.debug&&(l=new Date);for(c=0;c<z;c++)d=t.cache[c].colMax,k=t.cache[c].normalized, k.sort(function(c,l){for(a=0;a<y;a++){e=w[a][0];h=w[a][1];s=0===h;if(t.sortStable&&c[e]===l[e]&&1===y)break;(f=/n/i.test(Q(t.parsers,e)))&&t.strings[e]?(f="boolean"===typeof t.string[t.strings[e]]?(s?1:-1)*(t.string[t.strings[e]]?-1:1):t.strings[e]?t.string[t.strings[e]]||0:0,m=t.numberSorter?t.numberSorter(c[e],l[e],s,d[e],b):g["sortNumeric"+(s?"Asc":"Desc")](c[e],l[e],f,d[e],e,b)):(r=s?c:l,u=s?l:c,m="function"===typeof v?v(r[e],u[e],s,e,b):"object"===typeof v&&v.hasOwnProperty(e)?v[e](r[e],u[e], s,e,b):g["sortNatural"+(s?"Asc":"Desc")](c[e],l[e],e,b,t));if(m)return m}return c[t.columns].order-l[t.columns].order});t.debug&&q("Sorting on "+w.toString()+" and dir "+h+" time",l)}}function M(b,a){var c=b[0];c.isUpdating&&b.trigger("updateComplete",c);h.isFunction(a)&&a(b[0])}function I(b,a,c){var f=b[0].config.sortList;!1!==a&&!b[0].isProcessing&&f.length?b.trigger("sorton",[f,function(){M(b,c)},!0]):(M(b,c),g.applyWidget(b[0],!1))}function N(b){var a=b.config,c=a.$table;c.unbind("sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(a.namespace+ " ")).bind("sortReset"+a.namespace,function(f,e){f.stopPropagation();a.sortList=[];F(b);J(b);z(b);h.isFunction(e)&&e(b)}).bind("updateAll"+a.namespace,function(f,e,c){f.stopPropagation();b.isUpdating=!0;g.refreshWidgets(b,!0,!0);g.restoreHeaders(b);E(b);g.bindEvents(b,a.$headers,!0);N(b);C(b,e,c)}).bind("update"+a.namespace+" updateRows"+a.namespace,function(a,e,c){a.stopPropagation();b.isUpdating=!0;H(b);C(b,e,c)}).bind("updateCell"+a.namespace,function(f,e,l,g){f.stopPropagation();b.isUpdating= !0;c.find(a.selectorRemove).remove();var d,n,m;n=c.find("tbody");m=h(e);f=n.index(h.fn.closest?m.closest("tbody"):m.parents("tbody").filter(":first"));d=h.fn.closest?m.closest("tr"):m.parents("tr").filter(":first");e=m[0];n.length&&0<=f&&(n=n.eq(f).find("tr").index(d),m=m.index(),a.cache[f].normalized[n][a.columns].$row=d,d="undefined"===typeof a.extractors[m].id?r(b,e,m):a.extractors[m].format(r(b,e,m),b,e,m),e="no-parser"===a.parsers[m].id?"":a.parsers[m].format(d,b,e,m),a.cache[f].normalized[n][m]= a.ignoreCase&&"string"===typeof e?e.toLowerCase():e,"numeric"===(a.parsers[m].type||"").toLowerCase()&&(a.cache[f].colMax[m]=Math.max(Math.abs(e)||0,a.cache[f].colMax[m]||0)),I(c,l,g))}).bind("addRows"+a.namespace,function(f,e,l,g){f.stopPropagation();b.isUpdating=!0;if(p(a.cache))H(b),C(b,l,g);else{e=h(e).attr("role","row");var d,n,m,q,u,s=e.filter("tr").length,t=c.find("tbody").index(e.parents("tbody").filter(":first"));a.parsers&&a.parsers.length||v(b);for(f=0;f<s;f++){n=e[f].cells.length;u=[]; q={child:[],$row:e.eq(f),order:a.cache[t].normalized.length};for(d=0;d<n;d++)m="undefined"===typeof a.extractors[d].id?r(b,e[f].cells[d],d):a.extractors[d].format(r(b,e[f].cells[d],d),b,e[f].cells[d],d),m="no-parser"===a.parsers[d].id?"":a.parsers[d].format(m,b,e[f].cells[d],d),u[d]=a.ignoreCase&&"string"===typeof m?m.toLowerCase():m,"numeric"===(a.parsers[d].type||"").toLowerCase()&&(a.cache[t].colMax[d]=Math.max(Math.abs(u[d])||0,a.cache[t].colMax[d]||0));u.push(q);a.cache[t].normalized.push(u)}I(c, l,g)}}).bind("updateComplete"+a.namespace,function(){b.isUpdating=!1}).bind("sorton"+a.namespace,function(a,e,d,x){var k=b.config;a.stopPropagation();c.trigger("sortStart",this);P(b,e);F(b);k.delayInit&&p(k.cache)&&w(b);c.trigger("sortBegin",this);J(b);z(b,x);c.trigger("sortEnd",this);g.applyWidget(b);h.isFunction(d)&&d(b)}).bind("appendCache"+a.namespace,function(a,e,c){a.stopPropagation();z(b,c);h.isFunction(e)&&e(b)}).bind("updateCache"+a.namespace,function(c,e){a.parsers&&a.parsers.length||v(b); w(b);h.isFunction(e)&&e(b)}).bind("applyWidgetId"+a.namespace,function(c,e){c.stopPropagation();g.getWidgetById(e).format(b,a,a.widgetOptions)}).bind("applyWidgets"+a.namespace,function(a,c){a.stopPropagation();g.applyWidget(b,c)}).bind("refreshWidgets"+a.namespace,function(a,c,d){a.stopPropagation();g.refreshWidgets(b,c,d)}).bind("destroy"+a.namespace,function(a,c,d){a.stopPropagation();g.destroy(b,c,d)}).bind("resetToLoadState"+a.namespace,function(){g.refreshWidgets(b,!0,!0);a=h.extend(!0,g.defaults, a.originalSettings);b.hasInitialized=!1;g.setup(b,a)})}var g=this;g.version="2.17.8";g.parsers=[];g.widgets=[];g.defaults={theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc", sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:!0,initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssIcon:"tablesorter-icon",cssInfoBlock:"tablesorter-infoOnly",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me", debug:!1,headerList:[],empties:{},strings:{},parsers:[]};g.css={table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",info:"tablesorter-infoOnly",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"};g.language={sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ", sortNone:"No sort applied, ",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"};g.log=d;g.benchmark=q;g.construct=function(b){return this.each(function(){var a=h.extend(!0,{},g.defaults,b);a.originalSettings=b;!this.hasInitialized&&g.buildTable&&"TABLE"!==this.tagName?g.buildTable(this,a):g.setup(this,a)})};g.setup=function(b,a){if(!b||!b.tHead||0===b.tBodies.length||!0===b.hasInitialized)return a.debug?d("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"): "";var c="",f=h(b),e=h.metadata;b.hasInitialized=!1;b.isProcessing=!0;b.config=a;h.data(b,"tablesorter",a);a.debug&&h.data(b,"startoveralltimer",new Date);a.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1<a[0]||1===a[0]&&4<=parseInt(a[1],10)}(h.fn.jquery.split("."));a.string={max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1};a.emptyTo=a.emptyTo.toLowerCase();a.stringTo=a.stringTo.toLowerCase();/tablesorter\-/.test(f.attr("class"))||(c=""!==a.theme?" tablesorter-"+ a.theme:"");a.table=b;a.$table=f.addClass(g.css.table+" "+a.tableClass+c).attr("role","grid");a.$headers=f.find(a.selectorHeaders);a.namespace=a.namespace?"."+a.namespace.replace(/\W/g,""):".tablesorter"+Math.random().toString(16).slice(2);a.$table.children().children("tr").attr("role","row");a.$tbodies=f.children("tbody:not(."+a.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"});a.$table.find("caption").length&&a.$table.attr("aria-labelledby","theCaption");a.widgetInit={};a.textExtraction= a.$table.attr("data-text-extraction")||a.textExtraction||"basic";E(b);O(b);v(b);a.totalRows=0;a.delayInit||w(b);g.bindEvents(b,a.$headers,!0);N(b);a.supportsDataObject&&"undefined"!==typeof f.data().sortlist?a.sortList=f.data().sortlist:e&&f.metadata()&&f.metadata().sortlist&&(a.sortList=f.metadata().sortlist);g.applyWidget(b,!0);0<a.sortList.length?f.trigger("sorton",[a.sortList,{},!a.initWidgets,!0]):(F(b),a.initWidgets&&g.applyWidget(b,!1));a.showProcessing&&f.unbind("sortBegin"+a.namespace+" sortEnd"+ a.namespace).bind("sortBegin"+a.namespace+" sortEnd"+a.namespace,function(c){clearTimeout(a.processTimer);g.isProcessing(b);"sortBegin"===c.type&&(a.processTimer=setTimeout(function(){g.isProcessing(b,!0)},500))});b.hasInitialized=!0;b.isProcessing=!1;a.debug&&g.benchmark("Overall initialization time",h.data(b,"startoveralltimer"));f.trigger("tablesorter-initialized",b);"function"===typeof a.initialized&&a.initialized(b)};g.getColumnData=function(b,a,c,f){if("undefined"!==typeof a&&null!==a){b=h(b)[0]; var e,d=b.config;if(a[c])return f?a[c]:a[d.$headers.index(d.$headers.filter('[data-column="'+c+'"]:last'))];for(e in a)if("string"===typeof e&&(b=f?d.$headers.eq(c).filter(e):d.$headers.filter('[data-column="'+c+'"]:last').filter(e),b.length))return a[e]}};g.computeColumnIndex=function(b){var a=[],c=0,f,e,d,g,k,n,m,p,q,s;for(f=0;f<b.length;f++)for(k=b[f].cells,e=0;e<k.length;e++){d=k[e];g=h(d);n=d.parentNode.rowIndex;g.index();m=d.rowSpan||1;p=d.colSpan||1;"undefined"===typeof a[n]&&(a[n]=[]);for(d= 0;d<a[n].length+1;d++)if("undefined"===typeof a[n][d]){q=d;break}c=Math.max(q,c);g.attr({"data-column":q});for(d=n;d<n+m;d++)for("undefined"===typeof a[d]&&(a[d]=[]),s=a[d],g=q;g<q+p;g++)s[g]="x"}return c+1};g.isProcessing=function(b,a,c){b=h(b);var f=b[0].config,e=c||b.find("."+g.css.header);a?("undefined"!==typeof c&&0<f.sortList.length&&(e=e.filter(function(){return this.sortDisabled?!1:0<=g.isValueInArray(parseFloat(h(this).attr("data-column")),f.sortList)})),b.add(e).addClass(g.css.processing+ " "+f.cssProcessing)):b.add(e).removeClass(g.css.processing+" "+f.cssProcessing)};g.processTbody=function(b,a,c){b=h(b)[0];if(c)return b.isProcessing=!0,a.before('<span class="tablesorter-savemyplace"/>'),c=h.fn.detach?a.detach():a.remove();c=h(b).find("span.tablesorter-savemyplace");a.insertAfter(c);c.remove();b.isProcessing=!1};g.clearTableBody=function(b){h(b)[0].config.$tbodies.children().detach()};g.bindEvents=function(b,a,c){b=h(b)[0];var f,e=b.config;!0!==c&&(e.$extraHeaders=e.$extraHeaders? e.$extraHeaders.add(a):a);a.find(e.selectorSort).add(a.filter(e.selectorSort)).unbind(["mousedown","mouseup","sort","keyup",""].join(e.namespace+" ")).bind(["mousedown","mouseup","sort","keyup",""].join(e.namespace+" "),function(c,d){var g;g=c.type;if(!(1!==(c.which||c.button)&&!/sort|keyup/.test(g)||"keyup"===g&&13!==c.which||"mouseup"===g&&!0!==d&&250<(new Date).getTime()-f)){if("mousedown"===g)return f=(new Date).getTime(),/(input|select|button|textarea)/i.test(c.target.tagName)?"":!e.cancelSelection; e.delayInit&&p(e.cache)&&w(b);g=h.fn.closest?h(this).closest("th, td")[0]:/TH|TD/.test(this.tagName)?this:h(this).parents("th, td")[0];g=e.$headers[a.index(g)];g.sortDisabled||L(b,g,c)}});e.cancelSelection&&a.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})};g.restoreHeaders=function(b){var a=h(b)[0].config;a.$table.find(a.selectorHeaders).each(function(b){h(this).find("."+g.css.headerIn).length&&h(this).html(a.headerContent[b])})};g.destroy=function(b, a,c){b=h(b)[0];if(b.hasInitialized){g.refreshWidgets(b,!0,!0);var f=h(b),e=b.config,d=f.find("thead:first"),q=d.find("tr."+g.css.headerRow).removeClass(g.css.headerRow+" "+e.cssHeaderRow),k=f.find("tfoot:first > tr").children("th, td");!1===a&&0<=h.inArray("uitheme",e.widgets)&&(f.trigger("applyWidgetId",["uitheme"]),f.trigger("applyWidgetId",["zebra"]));d.find("tr").not(q).remove();f.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState ".split(" ").join(e.namespace+ " "));e.$headers.add(k).removeClass([g.css.header,e.cssHeader,e.cssAsc,e.cssDesc,g.css.sortAsc,g.css.sortDesc,g.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true");q.find(e.selectorSort).unbind(["mousedown","mouseup","keypress",""].join(e.namespace+" "));g.restoreHeaders(b);f.toggleClass(g.css.table+" "+e.tableClass+" tablesorter-"+e.theme,!1===a);b.hasInitialized=!1;delete b.config.cache;"function"===typeof c&&c(b)}};g.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi, chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i};g.sortNatural=function(b,a){if(b===a)return 0;var c,f,e,d,h,k;f=g.regex;if(f.hex.test(a)){c=parseInt(b.match(f.hex),16);e=parseInt(a.match(f.hex),16);if(c<e)return-1;if(c>e)return 1}c=b.replace(f.chunk,"\\0$1\\0").replace(f.chunks,"").split("\\0");f=a.replace(f.chunk,"\\0$1\\0").replace(f.chunks,"").split("\\0");k=Math.max(c.length,f.length);for(h=0;h<k;h++){e=isNaN(c[h])?c[h]||0:parseFloat(c[h])||0;d=isNaN(f[h])?f[h]||0:parseFloat(f[h])||0;if(isNaN(e)!== isNaN(d))return isNaN(e)?1:-1;typeof e!==typeof d&&(e+="",d+="");if(e<d)return-1;if(e>d)return 1}return 0};g.sortNaturalAsc=function(b,a,c,f,e){if(b===a)return 0;c=e.string[e.empties[c]||e.emptyTo];return""===b&&0!==c?"boolean"===typeof c?c?-1:1:-c||-1:""===a&&0!==c?"boolean"===typeof c?c?1:-1:c||1:g.sortNatural(b,a)};g.sortNaturalDesc=function(b,a,c,f,e){if(b===a)return 0;c=e.string[e.empties[c]||e.emptyTo];return""===b&&0!==c?"boolean"===typeof c?c?-1:1:c||1:""===a&&0!==c?"boolean"===typeof c?c? 1:-1:-c||-1:g.sortNatural(a,b)};g.sortText=function(b,a){return b>a?1:b<a?-1:0};g.getTextValue=function(b,a,c){if(c){var f=b?b.length:0,e=c+a;for(c=0;c<f;c++)e+=b.charCodeAt(c);return a*e}return 0};g.sortNumericAsc=function(b,a,c,f,e,d){if(b===a)return 0;d=d.config;e=d.string[d.empties[e]||d.emptyTo];if(""===b&&0!==e)return"boolean"===typeof e?e?-1:1:-e||-1;if(""===a&&0!==e)return"boolean"===typeof e?e?1:-1:e||1;isNaN(b)&&(b=g.getTextValue(b,c,f));isNaN(a)&&(a=g.getTextValue(a,c,f));return b-a};g.sortNumericDesc= function(b,a,c,f,e,d){if(b===a)return 0;d=d.config;e=d.string[d.empties[e]||d.emptyTo];if(""===b&&0!==e)return"boolean"===typeof e?e?-1:1:e||1;if(""===a&&0!==e)return"boolean"===typeof e?e?1:-1:-e||-1;isNaN(b)&&(b=g.getTextValue(b,c,f));isNaN(a)&&(a=g.getTextValue(a,c,f));return a-b};g.sortNumeric=function(b,a){return b-a};g.characterEquivalents={a:"\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5",A:"\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5",c:"\u00e7\u0107\u010d",C:"\u00c7\u0106\u010c",e:"\u00e9\u00e8\u00ea\u00eb\u011b\u0119", E:"\u00c9\u00c8\u00ca\u00cb\u011a\u0118",i:"\u00ed\u00ec\u0130\u00ee\u00ef\u0131",I:"\u00cd\u00cc\u0130\u00ce\u00cf",o:"\u00f3\u00f2\u00f4\u00f5\u00f6",O:"\u00d3\u00d2\u00d4\u00d5\u00d6",ss:"\u00df",SS:"\u1e9e",u:"\u00fa\u00f9\u00fb\u00fc\u016f",U:"\u00da\u00d9\u00db\u00dc\u016e"};g.replaceAccents=function(b){var a,c="[",d=g.characterEquivalents;if(!g.characterRegex){g.characterRegexArray={};for(a in d)"string"===typeof a&&(c+=d[a],g.characterRegexArray[a]=new RegExp("["+d[a]+"]","g"));g.characterRegex= new RegExp(c+"]")}if(g.characterRegex.test(b))for(a in d)"string"===typeof a&&(b=b.replace(g.characterRegexArray[a],a));return b};g.isValueInArray=function(b,a){var c,d=a.length;for(c=0;c<d;c++)if(a[c][0]===b)return c;return-1};g.addParser=function(b){var a,c=g.parsers.length,d=!0;for(a=0;a<c;a++)g.parsers[a].id.toLowerCase()===b.id.toLowerCase()&&(d=!1);d&&g.parsers.push(b)};g.getParserById=function(b){if("false"==b)return!1;var a,c=g.parsers.length;for(a=0;a<c;a++)if(g.parsers[a].id.toLowerCase()=== b.toString().toLowerCase())return g.parsers[a];return!1};g.addWidget=function(b){g.widgets.push(b)};g.hasWidget=function(b,a){b=h(b);return b.length&&b[0].config&&b[0].config.widgetInit[a]||!1};g.getWidgetById=function(b){var a,c,d=g.widgets.length;for(a=0;a<d;a++)if((c=g.widgets[a])&&c.hasOwnProperty("id")&&c.id.toLowerCase()===b.toLowerCase())return c};g.applyWidget=function(b,a){b=h(b)[0];var c=b.config,d=c.widgetOptions,e=[],l,p,k;!1!==a&&b.hasInitialized&&(b.isApplyingWidgets||b.isUpdating)|| (c.debug&&(l=new Date),c.widgets.length&&(b.isApplyingWidgets=!0,c.widgets=h.grep(c.widgets,function(a,b){return h.inArray(a,c.widgets)===b}),h.each(c.widgets||[],function(a,b){(k=g.getWidgetById(b))&&k.id&&(k.priority||(k.priority=10),e[a]=k)}),e.sort(function(a,b){return a.priority<b.priority?-1:a.priority===b.priority?0:1}),h.each(e,function(e,g){if(g){if(a||!c.widgetInit[g.id])c.widgetInit[g.id]=!0,g.hasOwnProperty("options")&&(d=b.config.widgetOptions=h.extend(!0,{},g.options,d)),g.hasOwnProperty("init")&& g.init(b,g,c,d);!a&&g.hasOwnProperty("format")&&g.format(b,c,d,!1)}})),setTimeout(function(){b.isApplyingWidgets=!1},0),c.debug&&(p=c.widgets.length,q("Completed "+(!0===a?"initializing ":"applying ")+p+" widget"+(1!==p?"s":""),l)))};g.refreshWidgets=function(b,a,c){b=h(b)[0];var f,e=b.config,l=e.widgets,q=g.widgets,k=q.length;for(f=0;f<k;f++)q[f]&&q[f].id&&(a||0>h.inArray(q[f].id,l))&&(e.debug&&d('Refeshing widgets: Removing "'+q[f].id+'"'),q[f].hasOwnProperty("remove")&&e.widgetInit[q[f].id]&&(q[f].remove(b, e,e.widgetOptions),e.widgetInit[q[f].id]=!1));!0!==c&&g.applyWidget(b,a)};g.getData=function(b,a,c){var d="";b=h(b);var e,g;if(!b.length)return"";e=h.metadata?b.metadata():!1;g=" "+(b.attr("class")||"");"undefined"!==typeof b.data(c)||"undefined"!==typeof b.data(c.toLowerCase())?d+=b.data(c)||b.data(c.toLowerCase()):e&&"undefined"!==typeof e[c]?d+=e[c]:a&&"undefined"!==typeof a[c]?d+=a[c]:" "!==g&&g.match(" "+c+"-")&&(d=g.match(new RegExp("\\s"+c+"-([\\w-]+)"))[1]||"");return h.trim(d)};g.formatFloat= function(b,a){if("string"!==typeof b||""===b)return b;var c;b=(a&&a.config?!1!==a.config.usNumberFormat:"undefined"!==typeof a?a:1)?b.replace(/,/g,""):b.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(b)&&(b=b.replace(/^\s*\(([.\d]+)\)/,"-$1"));c=parseFloat(b);return isNaN(c)?h.trim(b):c};g.isDigit=function(b){return isNaN(b)?/^[\-+(]?\d+[)]?$/.test(b.toString().replace(/[,.'"\s]/g,"")):!0}}});var r=h.tablesorter;h.fn.extend({tablesorter:r.construct});r.addParser({id:"no-parser",is:function(){return!1}, format:function(){return""},type:"text"});r.addParser({id:"text",is:function(){return!0},format:function(d,q){var p=q.config;d&&(d=h.trim(p.ignoreCase?d.toLocaleLowerCase():d),d=p.sortLocaleCompare?r.replaceAccents(d):d);return d},type:"text"});r.addParser({id:"digit",is:function(d){return r.isDigit(d)},format:function(d,q){var p=r.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),q);return d&&"number"===typeof p?p:d?h.trim(d&&q.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});r.addParser({id:"currency", is:function(d){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((d||"").replace(/[+\-,. ]/g,""))},format:function(d,q){var p=r.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),q);return d&&"number"===typeof p?p:d?h.trim(d&&q.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});r.addParser({id:"ipAddress",is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,h){var p,y=d?d.split("."):"",v="",w=y.length; for(p=0;p<w;p++)v+=("00"+y[p]).slice(-3);return d?r.formatFloat(v,h):d},type:"numeric"});r.addParser({id:"url",is:function(d){return/^(https?|ftp|file):\/\//.test(d)},format:function(d){return d?h.trim(d.replace(/(https?|ftp|file):\/\//,"")):d},parsed:!0,type:"text"});r.addParser({id:"isoDate",is:function(d){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/.test(d)},format:function(d,h){return d?r.formatFloat(""!==d?(new Date(d.replace(/-/g,"/"))).getTime()||d:"",h):d},type:"numeric"});r.addParser({id:"percent", is:function(d){return/(\d\s*?%|%\s*?\d)/.test(d)&&15>d.length},format:function(d,h){return d?r.formatFloat(d.replace(/%/g,""),h):d},type:"numeric"});r.addParser({id:"usLongDate",is:function(d){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(d)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(d)},format:function(d,h){return d?r.formatFloat((new Date(d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,h):d},type:"numeric"});r.addParser({id:"shortDate",is:function(d){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((d|| "").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(d,h,p,y){if(d){p=h.config;var v=p.$headers.filter("[data-column="+y+"]:last");y=v.length&&v[0].dateFormat||r.getData(v,r.getColumnData(h,p.headers,y),"dateFormat")||p.dateFormat;d=d.replace(/\s+/g," ").replace(/[\-.,]/g,"/");"mmddyyyy"===y?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===y?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===y&&(d=d.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/, "$1/$2/$3"))}return d?r.formatFloat((new Date(d)).getTime()||d,h):d},type:"numeric"});r.addParser({id:"time",is:function(d){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(d)},format:function(d,h){return d?r.formatFloat((new Date("2000/01/01 "+d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,h):d},type:"numeric"});r.addParser({id:"metadata",is:function(){return!1},format:function(d,q,p){d=q.config;d=d.parserMetadataName?d.parserMetadataName:"sortValue";return h(p).metadata()[d]}, type:"numeric"});r.addWidget({id:"zebra",priority:90,format:function(d,q,p){var y,v,w,z,D,E=new RegExp(q.cssChildRow,"i"),C=q.$tbodies;q.debug&&(D=new Date);for(d=0;d<C.length;d++)w=0,y=C.eq(d),y=y.children("tr:visible").not(q.selectorRemove),y.each(function(){v=h(this);E.test(this.className)||w++;z=0===w%2;v.removeClass(p.zebra[z?1:0]).addClass(p.zebra[z?0:1])});q.debug&&r.benchmark("Applying Zebra widget",D)},remove:function(d,q,p){var r;q=q.$tbodies;var v=(p.zebra||["even","odd"]).join(" ");for(p= 0;p<q.length;p++)r=h.tablesorter.processTbody(d,q.eq(p),!0),r.children().removeClass(v),h.tablesorter.processTbody(d,r,!1)}})}(jQuery);

function loadAccordion() {
    $(document).ready(function () {
        $('.mcaccordion-Single').accordion(
            {
                header: "h3",
                collapsible: true,
                active: getAccordionOpenOrClosed()
            });
    });
}

// Use when you want to keep an all collapsed accordion open. Use a hidden control named hidOpenAccordionSection
// and be sure to set its value to "0" whenever you need it to remain open.
function getAccordionOpenOrClosed() {
    if (document.getElementById('hidOpenAccordionSection') != null && document.getElementById('hidOpenAccordionSection').value != "false") {
        return 0;
    }
    else {
        return false;
    }
}

function loadAccordionChecker(force) {
    if (force) {
        loadAccordion();
        return;
    }
    if (document.getElementById('hidUpdateAccordion') != null && document.getElementById('hidUpdateAccordion').value == "1") {
        document.getElementById('hidUpdateAccordion').value = "0";
        loadAccordion();
    }
}
function SDRaiseEvent(pEventName, pEventValue) {

    var soldierDemographics = pEventName + '|' +
                              pEventValue + '|' +
                              '0' + '|' +
                              document.getElementById('Address1TextBox').value + '|' +
                              document.getElementById('Address2TextBox').value + '|' +
                              document.getElementById('CityTextBox').value + '|' +
                              document.getElementById('RegionDropDownList').value + '|' +
                              document.getElementById('ZipCodeTextBox').value + '|' +
                              document.getElementById('EmailAddressTextBox').value + '|' +
                              document.getElementById('PrimaryPhoneTextBox').value + '|' +
                              document.getElementById('SecondaryPhoneTextBox').value + '|' +
                              document.getElementById('PrimaryPhoneExtTextBox').value + '|' +
                              document.getElementById('SecondaryPhoneExtTextBox').value + '|' +
                              document.getElementById('CivilianEmailTextBox').value + '|' +
                              document.getElementById('AlternateAddress1TextBox').value + '|' +
                              document.getElementById('AlternateAddress2TextBox').value + '|' +
                              document.getElementById('AlternateCityTextBox').value + '|' +
                              document.getElementById('AlternateRegionDropDownList').value + '|' +
                              document.getElementById('AlternateZipCodeTextBox').value + '|';

    if (document.getElementById('btnHidden') != null) {
        __doPostBack('btnHidden', soldierDemographics);
    }
}

function ShowjqSoldierDemographicUdpateDialog() {
    $('.jqSaveSoldierDemographicsModalDialog').dialog('open'); 
    return false;
}

function ShowjqSoldierExtendedDetailsDialog() {
    $('.jqSoldierExtendedDetailsModalDialog').dialog('open');
    return false;
}

function CallSoldierDemographicRaiseCustomEventMethod() {
    SDRaiseEvent('SDCustomEvent', 'SaveSoldierDemographics');
}

function FillSoldierFields(soliderInfo)
{
    var soldierInfoFieldsArray = [];
    soldierInfoFieldsArray = soliderInfo.split('|');

    document.getElementById('EmailAddressTextBox').value = soldierInfoFieldsArray[0];
    document.getElementById('CivilianEmailTextBox').value = soldierInfoFieldsArray[1];
    document.getElementById('PrimaryPhoneTextBox').value = soldierInfoFieldsArray[2];
    document.getElementById('SecondaryPhoneTextBox').value = soldierInfoFieldsArray[3];
    document.getElementById('PrimaryPhoneExtTextBox').value = soldierInfoFieldsArray[4];
    document.getElementById('SecondaryPhoneExtTextBox').value = soldierInfoFieldsArray[5];

    document.getElementById('Address1TextBox').value = soldierInfoFieldsArray[6];
    document.getElementById('Address2TextBox').value = soldierInfoFieldsArray[7];
    document.getElementById('CityTextBox').value = soldierInfoFieldsArray[8];
    document.getElementById('RegionDropDownList').value = soldierInfoFieldsArray[9];
    document.getElementById('ZipCodeTextBox').value = soldierInfoFieldsArray[10];

    document.getElementById('AlternateAddress1TextBox').value = soldierInfoFieldsArray[11];
    document.getElementById('AlternateAddress2TextBox').value = soldierInfoFieldsArray[12];
    document.getElementById('AlternateCityTextBox').value = soldierInfoFieldsArray[13];
    document.getElementById('AlternateRegionDropDownList').value = soldierInfoFieldsArray[14];
    document.getElementById('AlternateZipCodeTextBox').value = soldierInfoFieldsArray[15];
}

function ReloadSoldierInfoByWebMethod() {

    var homePageUrl = document.getElementById('hidHomePageUrl').value;

    $.ajax({
        type: 'POST',
        url: homePageUrl + '/GetSoldierInfoById',
        //data: "{'soldierId' : '" + soldierId + "'}",
        dataType: 'json',
        contentType: 'application/json; charset=utf-8',
        success: function (r) {
            var successfulResult = r.d;
            FillSoldierFields(successfulResult);
        },
        error: function (e) {
            var failResult = e.d;
        }
    });

}

function ShowjqManageInstallationsDialog() {
     $(".jqManageInstallationsDialog").dialog("open");
}

function CheckInstallationSelected(gridId, labelId) {
    var errorLabel = document.getElementById(labelId);
    var grid = document.getElementById(gridId);
    var cell;

    if (grid.rows.length > 0) {
        for (var i = 1; i < grid.rows.length; i++) {
            cell = grid.rows[i].cells[1];

            for (var j = 0; j < cell.childNodes.length; j++) {
                if (cell.childNodes[j].type == "checkbox" && cell.childNodes[j].checked) {
                    errorLabel.style.display = "none";
                    ModalUpdate();
                    $(".jqManageInstallationsDialog").dialog("close");
                    return true;
                }
            }
        }
    }
    errorLabel.style.display = "block";
    return false;
}
/*
 * jsGrid v1.5.3 (http://js-grid.com)
 * (c) 2016 Artem Tabalin
 * Licensed under MIT (https://github.com/tabalinas/jsgrid/blob/master/LICENSE)
 */

!function(a,b,c){function d(a,c){var d=b(a);d.data(f,this),this._container=d,this.data=[],this.fields=[],this._editingRow=null,this._sortField=null,this._sortOrder=i,this._firstDisplayingPage=1,this._init(c),this.render()}var e="JSGrid",f=e,g="JSGridItem",h="JSGridEditRow",i="asc",j="desc",k="{first}",l="{pages}",m="{prev}",n="{next}",o="{last}",p="{pageIndex}",q="{pageCount}",r="{itemCount}",s="javascript:void(0);",t=function(a,c){return b.isFunction(a)?a.apply(c,b.makeArray(arguments).slice(2)):a},u=function(a){var c=b.Deferred();return a&&a.then?a.then(function(){c.resolve.apply(c,arguments)},function(){c.reject.apply(c,arguments)}):c.resolve(a),c.promise()},v={loadData:b.noop,insertItem:b.noop,updateItem:b.noop,deleteItem:b.noop};d.prototype={width:"auto",height:"auto",updateOnResize:!0,rowClass:b.noop,rowRenderer:null,rowClick:function(a){this.editing&&this.editItem(b(a.event.target).closest("tr"))},rowDoubleClick:b.noop,noDataContent:"Not found",noDataRowClass:"jsgrid-nodata-row",heading:!0,headerRowRenderer:null,headerRowClass:"jsgrid-header-row",headerCellClass:"jsgrid-header-cell",filtering:!1,filterRowRenderer:null,filterRowClass:"jsgrid-filter-row",inserting:!1,insertRowRenderer:null,insertRowClass:"jsgrid-insert-row",editing:!1,editRowRenderer:null,editRowClass:"jsgrid-edit-row",confirmDeleting:!0,deleteConfirm:"Are you sure?",selecting:!0,selectedRowClass:"jsgrid-selected-row",oddRowClass:"jsgrid-row",evenRowClass:"jsgrid-alt-row",cellClass:"jsgrid-cell",sorting:!1,sortableClass:"jsgrid-header-sortable",sortAscClass:"jsgrid-header-sort jsgrid-header-sort-asc",sortDescClass:"jsgrid-header-sort jsgrid-header-sort-desc",paging:!1,pagerContainer:null,pageIndex:1,pageSize:20,pageButtonCount:15,pagerFormat:"Pages: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} of {pageCount}",pagePrevText:"Prev",pageNextText:"Next",pageFirstText:"First",pageLastText:"Last",pageNavigatorNextText:"...",pageNavigatorPrevText:"...",pagerContainerClass:"jsgrid-pager-container",pagerClass:"jsgrid-pager",pagerNavButtonClass:"jsgrid-pager-nav-button",pagerNavButtonInactiveClass:"jsgrid-pager-nav-inactive-button",pageClass:"jsgrid-pager-page",currentPageClass:"jsgrid-pager-current-page",customLoading:!1,pageLoading:!1,autoload:!1,controller:v,loadIndication:!0,loadIndicationDelay:500,loadMessage:"Please, wait...",loadShading:!0,invalidMessage:"Invalid data entered!",invalidNotify:function(c){var d=b.map(c.errors,function(a){return a.message||null});a.alert([this.invalidMessage].concat(d).join("\n"))},onInit:b.noop,onRefreshing:b.noop,onRefreshed:b.noop,onPageChanged:b.noop,onItemDeleting:b.noop,onItemDeleted:b.noop,onItemInserting:b.noop,onItemInserted:b.noop,onItemEditing:b.noop,onItemUpdating:b.noop,onItemUpdated:b.noop,onItemInvalid:b.noop,onDataLoading:b.noop,onDataLoaded:b.noop,onOptionChanging:b.noop,onOptionChanged:b.noop,onError:b.noop,invalidClass:"jsgrid-invalid",containerClass:"jsgrid",tableClass:"jsgrid-table",gridHeaderClass:"jsgrid-grid-header",gridBodyClass:"jsgrid-grid-body",_init:function(a){b.extend(this,a),this._initLoadStrategy(),this._initController(),this._initFields(),this._attachWindowLoadResize(),this._attachWindowResizeCallback(),this._callEventHandler(this.onInit)},loadStrategy:function(){return this.pageLoading?new jsGrid.loadStrategies.PageLoadingStrategy(this):new jsGrid.loadStrategies.DirectLoadingStrategy(this)},_initLoadStrategy:function(){this._loadStrategy=t(this.loadStrategy,this)},_initController:function(){this._controller=b.extend({},v,t(this.controller,this))},renderTemplate:function(a,b,d){args=[];for(var e in d)args.push(d[e]);return args.unshift(a,b),a=t.apply(null,args),a===c||null===a?"":a},loadIndicator:function(a){return new jsGrid.LoadIndicator(a)},validation:function(a){return jsGrid.Validation&&new jsGrid.Validation(a)},_initFields:function(){var a=this;a.fields=b.map(a.fields,function(c){if(b.isPlainObject(c)){var d=c.type&&jsGrid.fields[c.type]||jsGrid.Field;c=new d(c)}return c._grid=a,c})},_attachWindowLoadResize:function(){b(a).on("load",b.proxy(this._refreshSize,this))},_attachWindowResizeCallback:function(){this.updateOnResize&&b(a).on("resize",b.proxy(this._refreshSize,this))},_detachWindowResizeCallback:function(){b(a).off("resize",this._refreshSize)},option:function(a,b){var c,d;return 1===arguments.length?this[a]:(c={option:a,oldValue:this[a],newValue:b},this._callEventHandler(this.onOptionChanging,c),this._handleOptionChange(c.option,c.newValue),d={option:c.option,value:c.newValue},void this._callEventHandler(this.onOptionChanged,d))},fieldOption:function(a,b,c){return a=this._normalizeField(a),2===arguments.length?a[b]:(a[b]=c,void this._renderGrid())},_handleOptionChange:function(a,b){switch(this[a]=b,a){case"width":case"height":this._refreshSize();break;case"rowClass":case"rowRenderer":case"rowClick":case"rowDoubleClick":case"noDataRowClass":case"noDataContent":case"selecting":case"selectedRowClass":case"oddRowClass":case"evenRowClass":this._refreshContent();break;case"pageButtonCount":case"pagerFormat":case"pagePrevText":case"pageNextText":case"pageFirstText":case"pageLastText":case"pageNavigatorNextText":case"pageNavigatorPrevText":case"pagerClass":case"pagerNavButtonClass":case"pageClass":case"currentPageClass":case"pagerRenderer":this._refreshPager();break;case"fields":this._initFields(),this.render();break;case"data":case"editing":case"heading":case"filtering":case"inserting":case"paging":this.refresh();break;case"loadStrategy":case"pageLoading":this._initLoadStrategy(),this.search();break;case"pageIndex":this.openPage(b);break;case"pageSize":this.refresh(),this.search();break;case"editRowRenderer":case"editRowClass":this.cancelEdit();break;case"updateOnResize":this._detachWindowResizeCallback(),this._attachWindowResizeCallback();break;case"invalidNotify":case"invalidMessage":break;default:this.render()}},destroy:function(){this._detachWindowResizeCallback(),this._clear(),this._container.removeData(f)},render:function(){return this._renderGrid(),this.autoload?this.loadData():b.Deferred().resolve().promise()},_renderGrid:function(){this._clear(),this._container.addClass(this.containerClass).css("position","relative").append(this._createHeader()).append(this._createBody()),this._pagerContainer=this._createPagerContainer(),this._loadIndicator=this._createLoadIndicator(),this._validation=this._createValidation(),this.refresh()},_createLoadIndicator:function(){return t(this.loadIndicator,this,{message:this.loadMessage,shading:this.loadShading,container:this._container})},_createValidation:function(){return t(this.validation,this)},_clear:function(){this.cancelEdit(),clearTimeout(this._loadingTimer),this._pagerContainer&&this._pagerContainer.empty(),this._container.empty().css({position:"",width:"",height:""})},_createHeader:function(){var a=this._headerRow=this._createHeaderRow(),c=this._filterRow=this._createFilterRow(),d=this._insertRow=this._createInsertRow(),e=this._headerGrid=b("<table>").addClass(this.tableClass).append(a).append(c).append(d),f=this._header=b("<div>").addClass(this.gridHeaderClass).addClass(this._scrollBarWidth()?"jsgrid-header-scrollbar":"").append(e);return f},_createBody:function(){var a=this._content=b("<tbody>"),c=this._bodyGrid=b("<table>").addClass(this.tableClass).append(a),d=this._body=b("<div>").addClass(this.gridBodyClass).append(c).on("scroll",b.proxy(function(a){this._header.scrollLeft(a.target.scrollLeft)},this));return d},_createPagerContainer:function(){var a=this.pagerContainer||b("<div>").appendTo(this._container);return b(a).addClass(this.pagerContainerClass)},_eachField:function(a){var c=this;b.each(this.fields,function(b,d){d.visible&&a.call(c,d,b)})},_createHeaderRow:function(){if(b.isFunction(this.headerRowRenderer))return b(this.renderTemplate(this.headerRowRenderer,this));var a=b("<tr>").addClass(this.headerRowClass);return this._eachField(function(c,d){var e=this._prepareCell("<th>",c,"headercss",this.headerCellClass).append(this.renderTemplate(c.headerTemplate,c)).appendTo(a);this.sorting&&c.sorting&&e.addClass(this.sortableClass).on("click",b.proxy(function(){this.sort(d)},this))}),a},_prepareCell:function(a,c,d,e){return b(a).css("width",c.width).addClass(e||this.cellClass).addClass(d&&c[d]||c.css).addClass(c.align?"jsgrid-align-"+c.align:"")},_createFilterRow:function(){if(b.isFunction(this.filterRowRenderer))return b(this.renderTemplate(this.filterRowRenderer,this));var a=b("<tr>").addClass(this.filterRowClass);return this._eachField(function(b){this._prepareCell("<td>",b,"filtercss").append(this.renderTemplate(b.filterTemplate,b)).appendTo(a)}),a},_createInsertRow:function(){if(b.isFunction(this.insertRowRenderer))return b(this.renderTemplate(this.insertRowRenderer,this));var a=b("<tr>").addClass(this.insertRowClass);return this._eachField(function(b){this._prepareCell("<td>",b,"insertcss").append(this.renderTemplate(b.insertTemplate,b)).appendTo(a)}),a},_callEventHandler:function(a,c){return a.call(this,b.extend(c,{grid:this})),c},reset:function(){return this._resetSorting(),this._resetPager(),this._loadStrategy.reset()},_resetPager:function(){this._firstDisplayingPage=1,this._setPage(1)},_resetSorting:function(){this._sortField=null,this._sortOrder=i,this._clearSortingCss()},refresh:function(){this._callEventHandler(this.onRefreshing),this.cancelEdit(),this._refreshHeading(),this._refreshFiltering(),this._refreshInserting(),this._refreshContent(),this._refreshPager(),this._refreshSize(),this._callEventHandler(this.onRefreshed)},_refreshHeading:function(){this._headerRow.toggle(this.heading)},_refreshFiltering:function(){this._filterRow.toggle(this.filtering)},_refreshInserting:function(){this._insertRow.toggle(this.inserting)},_refreshContent:function(){var a=this._content;if(a.empty(),!this.data.length)return a.append(this._createNoDataRow()),this;for(var b=this._loadStrategy.firstDisplayIndex(),c=this._loadStrategy.lastDisplayIndex(),d=b;c>d;d++){var e=this.data[d];a.append(this._createRow(e,d))}},_createNoDataRow:function(){var a=0;return this._eachField(function(){a++}),b("<tr>").addClass(this.noDataRowClass).append(b("<td>").addClass(this.cellClass).attr("colspan",a).append(this.renderTemplate(this.noDataContent,this)))},_createRow:function(a,c){var d;return b.isFunction(this.rowRenderer)?d=this.renderTemplate(this.rowRenderer,this,{item:a,itemIndex:c}):(d=b("<tr>"),this._renderCells(d,a)),d.addClass(this._getRowClasses(a,c)).data(g,a).on("click",b.proxy(function(b){this.rowClick({item:a,itemIndex:c,event:b})},this)).on("dblclick",b.proxy(function(b){this.rowDoubleClick({item:a,itemIndex:c,event:b})},this)),this.selecting&&this._attachRowHover(d),d},_getRowClasses:function(a,b){var c=[];return c.push((b+1)%2?this.oddRowClass:this.evenRowClass),c.push(t(this.rowClass,this,a,b)),c.join(" ")},_attachRowHover:function(a){var c=this.selectedRowClass;a.hover(function(){b(this).addClass(c)},function(){b(this).removeClass(c)})},_renderCells:function(a,b){return this._eachField(function(c){a.append(this._createCell(b,c))}),this},_createCell:function(a,c){var d,e=this._getItemFieldValue(a,c),f={value:e,item:a};return d=b.isFunction(c.cellRenderer)?this.renderTemplate(c.cellRenderer,c,f):b("<td>").append(this.renderTemplate(c.itemTemplate||e,c,f)),this._prepareCell(d,c)},_getItemFieldValue:function(a,b){for(var c=b.name.split("."),d=a[c.shift()];d&&c.length;)d=d[c.shift()];return d},_setItemFieldValue:function(a,b,c){for(var d=b.name.split("."),e=a,f=d[0];e&&d.length;)a=e,f=d.shift(),e=a[f];if(!e)for(;d.length;)a=a[f]={},f=d.shift();a[f]=c},sort:function(a,c){return b.isPlainObject(a)&&(c=a.order,a=a.field),this._clearSortingCss(),this._setSortingParams(a,c),this._setSortingCss(),this._loadStrategy.sort()},_clearSortingCss:function(){this._headerRow.find("th").removeClass(this.sortAscClass).removeClass(this.sortDescClass)},_setSortingParams:function(a,b){a=this._normalizeField(a),b=b||(this._sortField===a?this._reversedSortOrder(this._sortOrder):i),this._sortField=a,this._sortOrder=b},_normalizeField:function(a){return b.isNumeric(a)?this.fields[a]:"string"==typeof a?b.grep(this.fields,function(b){return b.name===a})[0]:a},_reversedSortOrder:function(a){return a===i?j:i},_setSortingCss:function(){var a=this._visibleFieldIndex(this._sortField);this._headerRow.find("th").eq(a).addClass(this._sortOrder===i?this.sortAscClass:this.sortDescClass)},_visibleFieldIndex:function(a){return b.inArray(a,b.grep(this.fields,function(a){return a.visible}))},_sortData:function(){var a=this._sortFactor(),b=this._sortField;b&&this.data.sort(function(c,d){return a*b.sortingFunc(c[b.name],d[b.name])})},_sortFactor:function(){return this._sortOrder===i?1:-1},_itemsCount:function(){return this._loadStrategy.itemsCount()},_pagesCount:function(){var a=this._itemsCount(),b=this.pageSize;return Math.floor(a/b)+(a%b?1:0)},_refreshPager:function(){var a=this._pagerContainer;a.empty(),this.paging&&a.append(this._createPager());var b=this.paging&&this._pagesCount()>1;a.toggle(b)},_createPager:function(){var a;return a=b.isFunction(this.pagerRenderer)?b(this.pagerRenderer({pageIndex:this.pageIndex,pageCount:this._pagesCount()})):b("<div>").append(this._createPagerByFormat()),a.addClass(this.pagerClass),a},_createPagerByFormat:function(){var a=this.pageIndex,c=this._pagesCount(),d=this._itemsCount(),e=this.pagerFormat.split(" ");return b.map(e,b.proxy(function(e){var f=e;return e===l?f=this._createPages():e===k?f=this._createPagerNavButton(this.pageFirstText,1,a>1):e===m?f=this._createPagerNavButton(this.pagePrevText,a-1,a>1):e===n?f=this._createPagerNavButton(this.pageNextText,a+1,c>a):e===o?f=this._createPagerNavButton(this.pageLastText,c,c>a):e===p?f=a:e===q?f=c:e===r&&(f=d),b.isArray(f)?f.concat([" "]):[f," "]},this))},_createPages:function(){var a=this._pagesCount(),b=this.pageButtonCount,c=this._firstDisplayingPage,d=[];c>1&&d.push(this._createPagerPageNavButton(this.pageNavigatorPrevText,this.showPrevPages));for(var e=0,f=c;b>e&&a>=f;e++,f++)d.push(f===this.pageIndex?this._createPagerCurrentPage():this._createPagerPage(f));return a>c+b-1&&d.push(this._createPagerPageNavButton(this.pageNavigatorNextText,this.showNextPages)),d},_createPagerNavButton:function(a,c,d){return this._createPagerButton(a,this.pagerNavButtonClass+(d?"":" "+this.pagerNavButtonInactiveClass),d?function(){this.openPage(c)}:b.noop)},_createPagerPageNavButton:function(a,b){return this._createPagerButton(a,this.pagerNavButtonClass,b)},_createPagerPage:function(a){return this._createPagerButton(a,this.pageClass,function(){this.openPage(a)})},_createPagerButton:function(a,c,d){var e=b("<a>").attr("href",s).html(a).on("click",b.proxy(d,this));return b("<span>").addClass(c).append(e)},_createPagerCurrentPage:function(){return b("<span>").addClass(this.pageClass).addClass(this.currentPageClass).text(this.pageIndex)},_refreshSize:function(){this._refreshHeight(),this._refreshWidth()},_refreshWidth:function(){var a="auto"===this.width?this._getAutoWidth():this.width;this._container.width(a)},_getAutoWidth:function(){var a=this._headerGrid,b=this._header;a.width("auto");var c=a.outerWidth(),d=b.outerWidth()-b.innerWidth();return a.width(""),c+d},_scrollBarWidth:function(){var a;return function(){if(a===c){var d=b("<div style='width:50px;height:50px;overflow:hidden;position:absolute;top:-10000px;left:-10000px;'></div>"),e=b("<div style='height:100px;'></div>");d.append(e).appendTo("body");var f=e.innerWidth();d.css("overflow-y","auto");var g=e.innerWidth();d.remove(),a=f-g}return a}}(),_refreshHeight:function(){var a,b=this._container,c=this._pagerContainer,d=this.height;b.height(d),"auto"!==d&&(d=b.height(),a=this._header.outerHeight(!0),c.parents(b).length&&(a+=c.outerHeight(!0)),this._body.outerHeight(d-a))},showPrevPages:function(){var a=this._firstDisplayingPage,b=this.pageButtonCount;this._firstDisplayingPage=a>b?a-b:1,this._refreshPager()},showNextPages:function(){var a=this._firstDisplayingPage,b=this.pageButtonCount,c=this._pagesCount();this._firstDisplayingPage=a+2*b>c?c-b+1:a+b,this._refreshPager()},openPage:function(a){1>a||a>this._pagesCount()||(this._setPage(a),this._loadStrategy.openPage(a))},_setPage:function(a){var b=this._firstDisplayingPage,c=this.pageButtonCount;this.pageIndex=a,b>a&&(this._firstDisplayingPage=a),a>b+c-1&&(this._firstDisplayingPage=a-c+1),this._callEventHandler(this.onPageChanged,{pageIndex:a})},_controllerCall:function(a,c,d,e){if(d)return b.Deferred().reject().promise();this._showLoading();var f=this._controller;if(!f||!f[a])throw Error("controller has no method '"+a+"'");return u(f[a](c)).done(b.proxy(e,this)).fail(b.proxy(this._errorHandler,this)).always(b.proxy(this._hideLoading,this))},_errorHandler:function(){this._callEventHandler(this.onError,{args:b.makeArray(arguments)})},_showLoading:function(){this.loadIndication&&(clearTimeout(this._loadingTimer),this._loadingTimer=setTimeout(b.proxy(function(){this._loadIndicator.show()},this),this.loadIndicationDelay))},_hideLoading:function(){this.loadIndication&&(clearTimeout(this._loadingTimer),this._loadIndicator.hide())},search:function(a){return this._resetSorting(),this._resetPager(),this.loadData(a)},loadData:function(a){a=a||(this.filtering?this.getFilter():{}),b.extend(a,this._loadStrategy.loadParams(),this._sortingParams());var c=this._callEventHandler(this.onDataLoading,{filter:a});return this._controllerCall("loadData",a,c.cancel,function(a){a&&(this._loadStrategy.finishLoad(a),this._callEventHandler(this.onDataLoaded,{data:a}))})},getFilter:function(){var a={};return this._eachField(function(b){b.filtering&&this._setItemFieldValue(a,b,b.filterValue())}),a},_sortingParams:function(){return this.sorting&&this._sortField?{sortField:this._sortField.name,sortOrder:this._sortOrder}:{}},getSorting:function(){var a=this._sortingParams();return{field:a.sortField,order:a.sortOrder}},clearFilter:function(){var a=this._createFilterRow();return this._filterRow.replaceWith(a),this._filterRow=a,this.search()},insertItem:function(a){var c=a||this._getValidatedInsertItem();if(!c)return b.Deferred().reject().promise();var d=this._callEventHandler(this.onItemInserting,{item:c});return this._controllerCall("insertItem",c,d.cancel,function(a){a=a||c,this._loadStrategy.finishInsert(a),this._callEventHandler(this.onItemInserted,{item:a})})},_getValidatedInsertItem:function(){var a=this._getInsertItem();return this._validateItem(a,this._insertRow)?a:null},_getInsertItem:function(){var a={};return this._eachField(function(b){b.inserting&&this._setItemFieldValue(a,b,b.insertValue())}),a},_validateItem:function(a,c){var d=[],e={item:a,itemIndex:this._rowIndex(c),row:c};if(this._eachField(function(f){if(f.validate&&(c!==this._insertRow||f.inserting)&&(c!==this._getEditRow()||f.editing)){var g=this._getItemFieldValue(a,f),h=this._validation.validate(b.extend({value:g,rules:f.validate},e));this._setCellValidity(c.children().eq(this._visibleFieldIndex(f)),h),h.length&&d.push.apply(d,b.map(h,function(a){return{field:f,message:a}}))}}),!d.length)return!0;var f=b.extend({errors:d},e);return this._callEventHandler(this.onItemInvalid,f),this.invalidNotify(f),!1},_setCellValidity:function(a,b){a.toggleClass(this.invalidClass,!!b.length).attr("title",b.join("\n"))},clearInsert:function(){var a=this._createInsertRow();this._insertRow.replaceWith(a),this._insertRow=a,this.refresh()},editItem:function(a){var b=this.rowByItem(a);b.length&&this._editRow(b)},rowByItem:function(a){return a.jquery||a.nodeType?b(a):this._content.find("tr").filter(function(){return b.data(this,g)===a})},_editRow:function(a){if(this.editing){var b=a.data(g),c=this._callEventHandler(this.onItemEditing,{row:a,item:b,itemIndex:this._itemIndex(b)});if(!c.cancel){this._editingRow&&this.cancelEdit();var d=this._createEditRow(b);this._editingRow=a,a.hide(),d.insertBefore(a),a.data(h,d)}}},_createEditRow:function(a){if(b.isFunction(this.editRowRenderer))return b(this.renderTemplate(this.editRowRenderer,this,{item:a,itemIndex:this._itemIndex(a)}));var c=b("<tr>").addClass(this.editRowClass);return this._eachField(function(b){var d=this._getItemFieldValue(a,b);this._prepareCell("<td>",b,"editcss").append(this.renderTemplate(b.editTemplate||"",b,{value:d,item:a})).appendTo(c)}),c},updateItem:function(a,b){1===arguments.length&&(b=a);var c=a?this.rowByItem(a):this._editingRow;return(b=b||this._getValidatedEditedItem())?this._updateRow(c,b):void 0},_getValidatedEditedItem:function(){var a=this._getEditedItem();return this._validateItem(a,this._getEditRow())?a:null},_updateRow:function(a,c){var d=a.data(g),e=this._itemIndex(d),f=b.extend(!0,{},d,c),h=this._callEventHandler(this.onItemUpdating,{row:a,item:f,itemIndex:e,previousItem:d});return this._controllerCall("updateItem",f,h.cancel,function(g){var h=b.extend(!0,{},d);f=g||b.extend(!0,d,c);var i=this._finishUpdate(a,f,e);this._callEventHandler(this.onItemUpdated,{row:i,item:f,itemIndex:e,previousItem:h})})},_rowIndex:function(a){return this._content.children().index(b(a))},_itemIndex:function(a){return b.inArray(a,this.data)},_finishUpdate:function(a,b,c){this.cancelEdit(),this.data[c]=b;var d=this._createRow(b,c);return a.replaceWith(d),d},_getEditedItem:function(){var a={};return this._eachField(function(b){b.editing&&this._setItemFieldValue(a,b,b.editValue())}),a},cancelEdit:function(){this._editingRow&&(this._getEditRow().remove(),this._editingRow.show(),this._editingRow=null)},_getEditRow:function(){return this._editingRow&&this._editingRow.data(h)},deleteItem:function(b){var c=this.rowByItem(b);if(c.length&&(!this.confirmDeleting||a.confirm(t(this.deleteConfirm,this,c.data(g)))))return this._deleteRow(c)},_deleteRow:function(a){var b=a.data(g),c=this._itemIndex(b),d=this._callEventHandler(this.onItemDeleting,{row:a,item:b,itemIndex:c});return this._controllerCall("deleteItem",b,d.cancel,function(){this._loadStrategy.finishDelete(b,c),this._callEventHandler(this.onItemDeleted,{row:a,item:b,itemIndex:c})})}},b.fn.jsGrid=function(a){var e=b.makeArray(arguments),g=e.slice(1),h=this;return this.each(function(){var e,i=b(this),j=i.data(f);if(j)if("string"==typeof a){if(e=j[a].apply(j,g),e!==c&&e!==j)return h=e,!1}else j._detachWindowResizeCallback(),j._init(a),j.render();else new d(i,a)}),h};var w={},x=function(a){var c;b.isPlainObject(a)?c=d.prototype:(c=w[a].prototype,a=arguments[1]||{}),b.extend(c,a)},y={},z=function(a){var c=b.isPlainObject(a)?a:y[a];if(!c)throw Error("unknown locale "+a);A(jsGrid,c)},A=function(a,c){b.each(c,function(c,d){return b.isPlainObject(d)?void A(a[c]||a[c[0].toUpperCase()+c.slice(1)],d):void(a.hasOwnProperty(c)?a[c]=d:a.prototype[c]=d)})};a.jsGrid={Grid:d,fields:w,setDefaults:x,locales:y,locale:z,version:"1.5.3"}}(window,jQuery),function(a,b){function c(a){this._init(a)}c.prototype={container:"body",message:"Loading...",shading:!0,zIndex:1e3,shaderClass:"jsgrid-load-shader",loadPanelClass:"jsgrid-load-panel",_init:function(a){b.extend(!0,this,a),this._initContainer(),this._initShader(),this._initLoadPanel()},_initContainer:function(){this._container=b(this.container)},_initShader:function(){this.shading&&(this._shader=b("<div>").addClass(this.shaderClass).hide().css({position:"absolute",top:0,right:0,bottom:0,left:0,zIndex:this.zIndex}).appendTo(this._container))},_initLoadPanel:function(){this._loadPanel=b("<div>").addClass(this.loadPanelClass).text(this.message).hide().css({position:"absolute",top:"50%",left:"50%",zIndex:this.zIndex}).appendTo(this._container)},show:function(){var a=this._loadPanel.show(),b=a.outerWidth(),c=a.outerHeight();a.css({marginTop:-c/2,marginLeft:-b/2}),this._shader.show()},hide:function(){this._loadPanel.hide(),this._shader.hide()}},a.LoadIndicator=c}(jsGrid,jQuery),function(a,b){function c(a){this._grid=a}function d(a){this._grid=a,this._itemsCount=0}c.prototype={firstDisplayIndex:function(){var a=this._grid;return a.option("paging")?(a.option("pageIndex")-1)*a.option("pageSize"):0},lastDisplayIndex:function(){var a=this._grid,b=a.option("data").length;return a.option("paging")?Math.min(a.option("pageIndex")*a.option("pageSize"),b):b},itemsCount:function(){return this._grid.option("data").length},openPage:function(){this._grid.refresh()},loadParams:function(){return{}},sort:function(){return this._grid._sortData(),this._grid.refresh(),b.Deferred().resolve().promise()},reset:function(){return this._grid.refresh(),b.Deferred().resolve().promise()},finishLoad:function(a){this._grid.option("data",a)},finishInsert:function(a){var b=this._grid;b.option("data").push(a),b.refresh()},finishDelete:function(a,b){var c=this._grid;c.option("data").splice(b,1),c.reset()}},d.prototype={firstDisplayIndex:function(){return 0},lastDisplayIndex:function(){return this._grid.option("data").length},itemsCount:function(){return this._itemsCount},openPage:function(){this._grid.loadData()},loadParams:function(){var a=this._grid;return{pageIndex:a.option("pageIndex"),pageSize:a.option("pageSize")}},reset:function(){return this._grid.loadData()},sort:function(){return this._grid.loadData()},finishLoad:function(a){this._itemsCount=a.itemsCount,this._grid.option("data",a.data)},finishInsert:function(){this._grid.search()},finishDelete:function(){this._grid.search()}},a.loadStrategies={DirectLoadingStrategy:c,PageLoadingStrategy:d}}(jsGrid,jQuery),function(a){var b=function(a){return"undefined"!=typeof a&&null!==a},c={string:function(a,c){return b(a)||b(c)?b(a)?b(c)?(""+a).localeCompare(""+c):1:-1:0},number:function(a,b){return a-b},date:function(a,b){return a-b},numberAsString:function(a,b){return parseFloat(a)-parseFloat(b)}};a.sortStrategies=c}(jsGrid,jQuery),function(a,b,c){function d(a){this._init(a)}d.prototype={_init:function(a){b.extend(!0,this,a)},validate:function(a){var c=[];return b.each(this._normalizeRules(a.rules),function(d,e){if(!e.validator(a.value,a.item,e.param)){var f=b.isFunction(e.message)?e.message(a.value,a.item):e.message;c.push(f)}}),c},_normalizeRules:function(a){return b.isArray(a)||(a=[a]),b.map(a,b.proxy(function(a){return this._normalizeRule(a)},this))},_normalizeRule:function(a){if("string"==typeof a&&(a={validator:a}),b.isFunction(a)&&(a={validator:a}),!b.isPlainObject(a))throw Error("wrong validation config specified");return a=b.extend({},a),b.isFunction(a.validator)?a:this._applyNamedValidator(a,a.validator)},_applyNamedValidator:function(a,c){delete a.validator;var d=e[c];if(!d)throw Error('unknown validator "'+c+'"');return b.isFunction(d)&&(d={validator:d}),b.extend({},d,a)}},a.Validation=d;var e={required:{message:"Field is required",validator:function(a){return a!==c&&null!==a&&""!==a}},rangeLength:{message:"Field value length is out of the defined range",validator:function(a,b,c){return a.length>=c[0]&&a.length<=c[1]}},minLength:{message:"Field value is too short",validator:function(a,b,c){return a.length>=c}},maxLength:{message:"Field value is too long",validator:function(a,b,c){return a.length<=c}},pattern:{message:"Field value is not matching the defined pattern",validator:function(a,b,c){return"string"==typeof c&&(c=new RegExp("^(?:"+c+")$")),c.test(a)}},range:{message:"Field value is out of the defined range",validator:function(a,b,c){return a>=c[0]&&a<=c[1]}},min:{message:"Field value is too small",validator:function(a,b,c){return a>=c}},max:{message:"Field value is too large",validator:function(a,b,c){return c>=a}}};a.validators=e}(jsGrid,jQuery),function(a,b,c){function d(a){b.extend(!0,this,a),this.sortingFunc=this._getSortingFunc()}d.prototype={name:"",title:null,css:"",align:"",width:100,visible:!0,filtering:!0,inserting:!0,editing:!0,sorting:!0,sorter:"string",headerTemplate:function(){return this.title===c||null===this.title?this.name:this.title},itemTemplate:function(a){return a},filterTemplate:function(){return""},insertTemplate:function(){return""},editTemplate:function(a,b){return this._value=a,this.itemTemplate(a,b)},filterValue:function(){return""},insertValue:function(){return""},editValue:function(){return this._value},_getSortingFunc:function(){var c=this.sorter;if(b.isFunction(c))return c;if("string"==typeof c)return a.sortStrategies[c];throw Error('wrong sorter for the field "'+this.name+'"!')}},a.Field=d}(jsGrid,jQuery),function(a,b){function c(a){d.call(this,a)}var d=a.Field;c.prototype=new d({autosearch:!0,readOnly:!1,filterTemplate:function(){if(!this.filtering)return"";var a=this._grid,b=this.filterControl=this._createTextBox();return this.autosearch&&b.on("keypress",function(b){13===b.which&&(a.search(),b.preventDefault())}),b},insertTemplate:function(){return this.inserting?this.insertControl=this._createTextBox():""},editTemplate:function(a){if(!this.editing)return this.itemTemplate.apply(this,arguments);var b=this.editControl=this._createTextBox();return b.val(a),b},filterValue:function(){return this.filterControl.val()},insertValue:function(){return this.insertControl.val()},editValue:function(){return this.editControl.val()},_createTextBox:function(){return b("<input>").attr("type","text").prop("readonly",!!this.readOnly)}}),a.fields.text=a.TextField=c}(jsGrid,jQuery),function(a,b,c){function d(a){e.call(this,a)}var e=a.TextField;d.prototype=new e({sorter:"number",align:"right",readOnly:!1,filterValue:function(){return this.filterControl.val()?parseInt(this.filterControl.val()||0,10):c},insertValue:function(){return this.insertControl.val()?parseInt(this.insertControl.val()||0,10):c},editValue:function(){return this.editControl.val()?parseInt(this.editControl.val()||0,10):c},_createTextBox:function(){return b("<input>").attr("type","number").prop("readonly",!!this.readOnly)}}),a.fields.number=a.NumberField=d}(jsGrid,jQuery),function(a,b){function c(a){d.call(this,a)}var d=a.TextField;c.prototype=new d({insertTemplate:function(){return this.inserting?this.insertControl=this._createTextArea():""},editTemplate:function(a){if(!this.editing)return this.itemTemplate.apply(this,arguments);var b=this.editControl=this._createTextArea();return b.val(a),b},_createTextArea:function(){return b("<textarea>").prop("readonly",!!this.readOnly)}}),a.fields.textarea=a.TextAreaField=c}(jsGrid,jQuery),function(a,b,c){function d(a){if(this.items=[],this.selectedIndex=-1,this.valueField="",this.textField="",a.valueField&&a.items.length){var b=a.items[0][a.valueField];this.valueType=typeof b===f?f:g}this.sorter=this.valueType,e.call(this,a)}var e=a.NumberField,f="number",g="string";d.prototype=new e({align:"center",valueType:f,itemTemplate:function(a){var d,e=this.items,f=this.valueField,g=this.textField;d=f?b.grep(e,function(b){return b[f]===a})[0]||{}:e[a];var h=g?d[g]:d;return h===c||null===h?"":h},filterTemplate:function(){if(!this.filtering)return"";var a=this._grid,b=this.filterControl=this._createSelect();return this.autosearch&&b.on("change",function(){a.search()}),b},insertTemplate:function(){return this.inserting?this.insertControl=this._createSelect():""},editTemplate:function(a){if(!this.editing)return this.itemTemplate.apply(this,arguments);var b=this.editControl=this._createSelect();return a!==c&&b.val(a),b},filterValue:function(){var a=this.filterControl.val();return this.valueType===f?parseInt(a||0,10):a},insertValue:function(){var a=this.insertControl.val();return this.valueType===f?parseInt(a||0,10):a},editValue:function(){var a=this.editControl.val();return this.valueType===f?parseInt(a||0,10):a},_createSelect:function(){var a=b("<select>"),c=this.valueField,d=this.textField,e=this.selectedIndex;return b.each(this.items,function(f,g){var h=c?g[c]:f,i=d?g[d]:g,j=b("<option>").attr("value",h).text(i).appendTo(a);j.prop("selected",e===f)}),a.prop("disabled",!!this.readOnly),a}}),a.fields.select=a.SelectField=d}(jsGrid,jQuery),function(a,b,c){function d(a){e.call(this,a)}var e=a.Field;d.prototype=new e({sorter:"number",align:"center",autosearch:!0,itemTemplate:function(a){return this._createCheckbox().prop({checked:a,disabled:!0})},filterTemplate:function(){if(!this.filtering)return"";var a=this._grid,c=this.filterControl=this._createCheckbox();return c.prop({readOnly:!0,indeterminate:!0}),c.on("click",function(){var a=b(this);
a.prop("readOnly")?a.prop({checked:!1,readOnly:!1}):a.prop("checked")||a.prop({readOnly:!0,indeterminate:!0})}),this.autosearch&&c.on("click",function(){a.search()}),c},insertTemplate:function(){return this.inserting?this.insertControl=this._createCheckbox():""},editTemplate:function(a){if(!this.editing)return this.itemTemplate.apply(this,arguments);var b=this.editControl=this._createCheckbox();return b.prop("checked",a),b},filterValue:function(){return this.filterControl.get(0).indeterminate?c:this.filterControl.is(":checked")},insertValue:function(){return this.insertControl.is(":checked")},editValue:function(){return this.editControl.is(":checked")},_createCheckbox:function(){return b("<input>").attr("type","checkbox")}}),a.fields.checkbox=a.CheckboxField=d}(jsGrid,jQuery),function(a,b){function c(a){d.call(this,a),this._configInitialized=!1}var d=a.Field;c.prototype=new d({css:"jsgrid-control-field",align:"center",width:50,filtering:!1,inserting:!1,editing:!1,sorting:!1,buttonClass:"jsgrid-button",modeButtonClass:"jsgrid-mode-button",modeOnButtonClass:"jsgrid-mode-on-button",searchModeButtonClass:"jsgrid-search-mode-button",insertModeButtonClass:"jsgrid-insert-mode-button",editButtonClass:"jsgrid-edit-button",deleteButtonClass:"jsgrid-delete-button",searchButtonClass:"jsgrid-search-button",clearFilterButtonClass:"jsgrid-clear-filter-button",insertButtonClass:"jsgrid-insert-button",updateButtonClass:"jsgrid-update-button",cancelEditButtonClass:"jsgrid-cancel-edit-button",searchModeButtonTooltip:"Switch to searching",insertModeButtonTooltip:"Switch to inserting",editButtonTooltip:"Edit",deleteButtonTooltip:"Delete",searchButtonTooltip:"Search",clearFilterButtonTooltip:"Clear filter",insertButtonTooltip:"Insert",updateButtonTooltip:"Update",cancelEditButtonTooltip:"Cancel edit",editButton:!0,deleteButton:!0,clearFilterButton:!0,modeSwitchButton:!0,_initConfig:function(){this._hasFiltering=this._grid.filtering,this._hasInserting=this._grid.inserting,this._hasInserting&&this.modeSwitchButton&&(this._grid.inserting=!1),this._configInitialized=!0},headerTemplate:function(){this._configInitialized||this._initConfig();var a=this._hasFiltering,b=this._hasInserting;return this.modeSwitchButton&&(a||b)?a&&!b?this._createFilterSwitchButton():b&&!a?this._createInsertSwitchButton():this._createModeSwitchButton():""},itemTemplate:function(a,c){var d=b([]);return this.editButton&&(d=d.add(this._createEditButton(c))),this.deleteButton&&(d=d.add(this._createDeleteButton(c))),d},filterTemplate:function(){var a=this._createSearchButton();return this.clearFilterButton?a.add(this._createClearFilterButton()):a},insertTemplate:function(){return this._createInsertButton()},editTemplate:function(){return this._createUpdateButton().add(this._createCancelEditButton())},_createFilterSwitchButton:function(){return this._createOnOffSwitchButton("filtering",this.searchModeButtonClass,!0)},_createInsertSwitchButton:function(){return this._createOnOffSwitchButton("inserting",this.insertModeButtonClass,!1)},_createOnOffSwitchButton:function(a,c,d){var e=d,f=b.proxy(function(){g.toggleClass(this.modeOnButtonClass,e)},this),g=this._createGridButton(this.modeButtonClass+" "+c,"",function(b){e=!e,b.option(a,e),f()});return f(),g},_createModeSwitchButton:function(){var a=!1,c=b.proxy(function(){d.attr("title",a?this.searchModeButtonTooltip:this.insertModeButtonTooltip).toggleClass(this.insertModeButtonClass,!a).toggleClass(this.searchModeButtonClass,a)},this),d=this._createGridButton(this.modeButtonClass,"",function(b){a=!a,b.option("inserting",a),b.option("filtering",!a),c()});return c(),d},_createEditButton:function(a){return this._createGridButton(this.editButtonClass,this.editButtonTooltip,function(b,c){b.editItem(a),c.stopPropagation()})},_createDeleteButton:function(a){return this._createGridButton(this.deleteButtonClass,this.deleteButtonTooltip,function(b,c){b.deleteItem(a),c.stopPropagation()})},_createSearchButton:function(){return this._createGridButton(this.searchButtonClass,this.searchButtonTooltip,function(a){a.search()})},_createClearFilterButton:function(){return this._createGridButton(this.clearFilterButtonClass,this.clearFilterButtonTooltip,function(a){a.clearFilter()})},_createInsertButton:function(){return this._createGridButton(this.insertButtonClass,this.insertButtonTooltip,function(a){a.insertItem().done(function(){a.clearInsert()})})},_createUpdateButton:function(){return this._createGridButton(this.updateButtonClass,this.updateButtonTooltip,function(a,b){a.updateItem(),b.stopPropagation()})},_createCancelEditButton:function(){return this._createGridButton(this.cancelEditButtonClass,this.cancelEditButtonTooltip,function(a,b){a.cancelEdit(),b.stopPropagation()})},_createGridButton:function(a,c,d){var e=this._grid;return b("<input>").addClass(this.buttonClass).addClass(a).attr({type:"button",title:c}).on("click",function(a){d(e,a)})},editValue:function(){return""}}),a.fields.control=a.ControlField=c}(jsGrid,jQuery);
function addOnFocusToOnMouseOver(el) {
    el.attr("onfocus", el.attr("onmouseover"));
}
function fix508MainMenuItems() {
    ////fix Device dependent event handler 
    var mainMenun = $("#MenuContents").find("[id^=MasterMenun]");
    mainMenun.attr("onfocus", mainMenun.attr("onmouseover"));
    addOnFocusToOnMouseOver(mainMenun)

    $("#MenuContents").find("[id*=MasterMenu] table").attr("role", "presentation");
    $("#MenuContents").find("[id*=MasterMenu] table tr td img").attr("tabindex", "0");

    $("#ChildPageContainer").find("[id*=PageContent] table").attr("role", "presentation");
    $("#ChildPageContainer").find("[id*=PageContent] table tr td img").attr("tabindex", "0");

    $("#ShowNotification").attr("tabindex", "0");
    $("#AdminUserDetailImage").attr("tabindex", "0");
}

function fix508PopupCalendar() {
    $(".xdsoft_prev").text("prev");
    $(".xdsoft_next").text("next");
    $(".xdsoft_today_button").text("today");
}

function fix508ValidatorCallout(){   
    //fix Select Missing Label alert on ValidatorCallout Images
    setTimeout(function () {
        $("img[src$='../Content/AjaxControlToolkit/Images/ValidatorCallout.Alert-Large.gif']").attr('alt', 'Validation Warning');
        $("img[src$='../Content/AjaxControlToolkit/Images/ValidatorCallout.Close.gif']").attr('alt', 'Close Validation Warning');
        $(".ajax__validatorcallout_popup_table").attr("role", "presentation");
    }, 1000);
}
function fix508DatePickerMissingLabel() {
    //fix Select Missing Label alert on date picker calendar
    setTimeout(function () {
        $(".ui-datepicker-month").attr("aria-label", "month");
        $(".ui-datepicker-year").attr("aria-label", "year");
    }, 1000);
}
var ej=function(g){"use strict";var m="ej2_instances",f=0,N=!1;function y(e,t){return t.unshift(void 0),new(Function.prototype.bind.apply(e,t))}function v(t){var i,e=new Uint16Array(5),n=((window.msCrypto||window.crypto).getRandomValues(e),"ej2"+function(e){for(var t="",i=0;i<5;i++)t+=(i?",":"")+e[parseInt(i.toString(),10)];return t}(e)),o=function(e){e.source===window&&"string"==typeof e.data&&e.data.length<=32&&e.data===n&&(t(),i())};return window.addEventListener("message",o,!1),window.postMessage(n,"*"),i=function(){window.removeEventListener("message",o),t=o=n=void 0}}function R(e,t){for(var i=t,n=e.replace(/\[/g,".").replace(/\]/g,"").split("."),o=0;o<n.length&&!ee(i);o++)i=i[n[parseInt(o.toString(),10)]];return i}function x(e,t,i){for(var n,o=e.replace(/\[/g,".").replace(/\]/g,"").split("."),e=i||{},r=e,s=o.length,a=0;a<s;a++)"__proto__"!==(n=o[parseInt(a.toString(),10)])&&"constructor"!==n&&"prototype"!==n&&(a+1===s?r[""+n]=void 0===t?{}:t:je(r[""+n])&&(r[""+n]={}),r=r[""+n]);return e}function b(e,t){delete e[""+t]}var w="undefined"!=typeof window?window:{};function S(e){return!je(e)&&e.constructor==={}.constructor}function M(e,t){return e[""+t]}function I(e,t){if(!je(t))for(var i=e,n=t,o=0,r=Object.keys(t);o<r.length;o++){var s=r[o];je(i.deepMerge)||-1===i.deepMerge.indexOf(s)||!S(n[""+s])&&!Array.isArray(n[""+s])?i[""+s]=n[""+s]:Pe(i[""+s],i[""+s],n[""+s],!0)}}function Pe(e,t,i,s){for(var a=e&&"object"==typeof e?e:{},n=arguments.length,o=[e,t,i,s],r=(s&&(n-=1),1);r<n;r++)!function(e){if(!o[parseInt(e.toString(),10)])return;var r=o[parseInt(e.toString(),10)];Object.keys(r).forEach(function(e){var t,i=a[""+e],n=r[""+e],o=Array.isArray(n)&&Array.isArray(i)&&n.length!==i.length,o=!N||!(i instanceof Event||o);s&&o&&(S(n)||Array.isArray(n))?S(n)?(t=i||{},Array.isArray(t)&&Object.prototype.hasOwnProperty.call(t,"isComplexArray")?Pe(t,{},n,s):a[""+e]=Pe(t,{},n,s)):(t=N?i&&Object.keys(n).length:i||[],a[""+e]=Pe([],t,n,t&&t.length||n&&n.length)):a[""+e]=n})}(r);return a}function je(e){return null==e}function ee(e){return void 0===e}function D(e){return e+"_"+f++}function P(n,o){var r;return function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];clearTimeout(r),r=setTimeout(function(){return r=null,n.apply(e,t)},o)}}function B(e){var t=Object.prototype.toString;return"[object Array]"===t.call(e)&&"[object Object]"===t.call(e[0])}function L(e,t){return e===t||!(e===document||!e)&&L(e.parentNode,t)}function O(e){try{throw new Error(e)}catch(e){throw new Error(e.message+"\n"+e.stack)}}function V(e,t){var i=document.createElement("div"),n=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("base, link, style")),o=[].slice.call(document.getElementsByTagName("body")[0].querySelectorAll("link, style"));if(o.length)for(var r=0,s=o.length;r<s;r++)n.push(o[parseInt(r.toString(),10)]);var a="";je(t)&&(t=window.open("","print","height=452,width=1024,tabbar=no")),i.appendChild(e.cloneNode(!0));for(var l=0,s=n.length;l<s;l++)a+=n[parseInt(l.toString(),10)].outerHTML;t.document.write("<!DOCTYPE html> <html><head>"+a+"</head><body>"+i.innerHTML+"<script> (function() { window.ready = true; })(); <\/script></body></html>"),t.document.close(),t.focus();var h=setInterval(function(){t.ready&&(t.print(),t.close(),clearInterval(h))},500);return t}function T(e){e+="";return e.match(/auto|cm|mm|in|px|pt|pc|%|em|ex|ch|rem|vw|vh|vmin|vmax/)?e:e+"px"}function _(){return N}function H(e){return e instanceof Node||!N||je(e.xPath)?e:document.evaluate(e.xPath,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}function K(e,t){e="string"==typeof e?document.querySelector(e):e;if(e[m])for(var i=0,n=e[m];i<n.length;i++){var o=n[i];if(o instanceof t)return o}return null}function j(){var e;if("undefined"!=typeof window)return e=new Uint16Array(5),(window.msCrypto||window.crypto).getRandomValues(e)}var W={latn:{_digits:"0123456789",_type:"numeric"}},J={decimal:".",group:",",percentSign:"%",plusSign:"+",minusSign:"-",infinity:"∞",nan:"NaN",exponential:"E"},Z=[0,1,2,3,4,5,6,7,8,9],$=(te.getMainObject=function(e,t){return R(N?t:"main."+t,e)},te.getNumberingSystem=function(e){return R("supplemental.numberingSystems",e)||this.numberingSystems},te.reverseObject=function(e,t){for(var i={},n=0,o=t||Object.keys(e);n<o.length;n++){var r=o[n];Object.prototype.hasOwnProperty.call(i,e[""+r])||(i[e[""+r]]=r)}return i},te.getSymbolRegex=function(e){e=e.map(function(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}).join("|");return new RegExp(e,"g")},te.getSymbolMatch=function(e){for(var t={},i=0,n=Object.keys(J);i<n.length;i++){var o=n[i];t[e[""+o]]=J[""+o]}return t},te.constructRegex=function(e){for(var t=e.length,i="",n=0;n<t;n++)i+=n!==t-1?e[parseInt(n.toString(),10)]+"|":e[parseInt(n.toString(),10)];return i},te.convertValueParts=function(e,t,i){return e.replace(t,function(e){return i[""+e]})},te.getDefaultNumberingSystem=function(e){var t={};return t.obj=R("numbers",e),t.nSystem=R("defaultNumberingSystem",t.obj),t},te.getCurrentNumericOptions=function(e,t,i,n){var o,r={},e=this.getDefaultNumberingSystem(e);return ee(e.nSystem)&&!n||ee(t=n?R("obj.mapperDigits",e):R(e.nSystem+"._digits",t))||(r.numericPair=this.reverseObject(t,Z),o=RegExp,r.numberParseRegex=new o(this.constructRegex(t),"g"),r.numericRegex="["+t[0]+"-"+t[9]+"]",i&&(r.numericRegex=t[0]+"-"+t[9],r.symbolNumberSystem=R(n?"numberSymbols":"symbols-numberSystem-"+e.nSystem,e.obj),r.symbolMatch=this.getSymbolMatch(r.symbolNumberSystem),r.numberSystem=e.nSystem)),r},te.getNumberMapper=function(e,t,i){var n={mapper:{}},e=this.getDefaultNumberingSystem(e);if(!ee(e.nSystem)){n.numberSystem=e.nSystem,n.numberSymbols=R("symbols-numberSystem-"+e.nSystem,e.obj),n.timeSeparator=R("timeSeparator",n.numberSymbols);var o=R(e.nSystem+"._digits",t);if(!ee(o))for(var r=0,s=Z;r<s.length;r++){var a=s[r];n.mapper[parseInt(a.toString(),10)]=o[parseInt(a.toString(),10)]}}return n},te.nPair="numericPair",te.nRegex="numericRegex",te.numberingSystems=W,te);function te(){}var ne={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$"};var oe="USD",re=null,le=null;function he(e){oe=e}function de(e){re=e}function pe(e){le=e}var ce,fe,ye,ve,be,we,Ce,Se,W=RegExp,Ae={"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 xe(e,t,i,n,o){var r,i=i||"date";return o?r=De({skeleton:e},o).format||De({skeleton:"d"},"en-US").format:(-1!==fe.basicPatterns.indexOf(e)?(r=R(i+"Formats."+e,t),"dateTime"===i&&(o=R("dateFormats."+e,t),i=R("timeFormats."+e,t),r=r.replace("{1}",o).replace("{0}",i))):r=R("dateTimeFormats.availableFormats."+e,t),ee(r)&&"yMd"===e&&(r="M/d/y")),r}function Ie(e,t,i,n){var o={},i=i||"gregorian";return o.parserObject=$.getMainObject(e,t)||(N?fe.blazorDefaultObject:fe.defaultObject),n?o.numericObject=R("numbers",o.parserObject):(e=N?"dates":"dates.calendars."+i,o.dateObject=R(e,o.parserObject)),o}function Te(e,t,i,n){return R(e+"Formats-numberSystem-"+t+(n?".accounting":".standard"),i)||(n?R(e+"Formats-numberSystem-"+t+".standard",i):"")}function Ee(e){var t=e.match(fe.dateConverterMapper);return t&&N?(t=3===t[0].length?"EEE":"EEEE",e.replace(fe.dateConverterMapper,t)):e}function De(e,t){var i=e.format||e.skeleton,t=R((t||"en-US")+"."+i,Ae);return(t=t||R("en-US."+i,Ae))&&(t=Ee(t),e.format=t.replace(/tt/,"a")),e}function Me(e){var t=e.match(fe.formatRegex),i={},n=t[1].toUpperCase();return i.isAccount="A"===n,i.type=fe.patternMatcher[""+n],1<e.length&&(i.fractionDigits=parseInt(t[2],10)),i}function ke(e,t,i,n){var o=n?{}:{nlead:"",nend:""},e=e.match(fe.customRegex);return e&&(n||(o.nlead=Be(e[1],i),o.nend=Be(e[10],i),o.groupPattern=e[4]),n=e[7])&&t&&(je(i=n.match(ye))?o.minimumFraction=0:o.minimumFraction=i.length,o.maximumFraction=n.length-1),o}function Be(e,t){return e?(e=e.replace(fe.defaultCurrency,t),""===t?e.trim():e):""}function Fe(e,t,i,n){return!n&&(R("currencies."+t+(i?"."+i:".symbol"),e)||R("currencies."+t+".symbol-alt-narrow",e))||"$"}function Le(e,t,i){var n,o,r={type:"decimal",minimumFractionDigits:0,maximumFractionDigits:0},s=e.match(fe.customRegex);return je(s)||""===s[5]&&"N/A"!==e?r.type=void 0:(r.nlead=s[1],r.nend=s[10],n=!!(e=s[6]).match(/ $/g),o=-1!==e.replace(/ $/g,"").indexOf(" "),s=(r.useGrouping=-1!==e.indexOf(",")||o,e=e.replace(/,/g,""),e=/\s$/.test(e)?e.replace(/ /g,""):e,s[7]),-1!==e.indexOf("0")&&(r.minimumIntegerDigits=e.length-e.indexOf("0")),!je(s)&&(r.minimumFractionDigits=s.lastIndexOf("0"),r.maximumFractionDigits=s.lastIndexOf("#"),-1===r.minimumFractionDigits&&(r.minimumFractionDigits=0),-1===r.maximumFractionDigits||r.maximumFractionDigits<r.minimumFractionDigits)&&(r.maximumFractionDigits=r.minimumFractionDigits),je(t)?Pe(r,Re([r.nlead,r.nend],"%","%")):(t.isCustomFormat=!0,Pe(r,Re([r.nlead,r.nend],"$",t.currencySymbol)),r.isCurrency||Pe(r,Re([r.nlead,r.nend],"%",t.percentSymbol))),je(i)||(e=Te(r.type,t.numberMapper.numberSystem,i,!1),r.useGrouping&&(r.groupSeparator=o?" ":t.numberMapper.numberSymbols[ve[2]],r.groupData=re.getGroupingDetails(e.split(";")[0])),r.nlead=r.nlead.replace(/'/g,""),r.nend=n?" "+r.nend.replace(/'/g,""):r.nend.replace(/'/g,""))),r}function Re(e,t,i){for(var n={nlead:e[0],nend:e[1]},o=0;o<2;o++){var r=e[parseInt(o.toString(),10)],s=r.indexOf(t);if(-1!==s&&(s<r.indexOf("'")||s>r.lastIndexOf("'"))){n[""+Se[parseInt(o.toString(),10)]]=r.substr(0,s)+i+r.substr(s+1),n[""+Se[""+t]]=!0,n.type=n.isCurrency?"currency":"percent";break}}return n}function Oe(e,t){var i;return e=-1!==e.indexOf(",")?(i=e.split(","))[0]+R("numberMapper.numberSymbols.group",t)+i[1].replace(".",R("numberMapper.numberSymbols.decimal",t)):e.replace(".",R("numberMapper.numberSymbols.decimal",t))}function Ne(e,t,i){e+=".";for(var n=0;n<t;n++)e+="0";if(t<i)for(var o=i-t,r=0;r<o;r++)e+="#";return e}function Ve(e,t){for(var e=e.split("."),i="",n=0;n<t;n++)i+="0";return e[1]?i+"."+e[1]:i}function _e(e){var t=e.split("."),i=t[0],n=3-i.length%3;e="";for(var o=(i=(n&&1==n?"#":2==n?"##":"")+i).length-1;0<o;o-=3)e=","+i[o-2]+i[o-1]+i[parseInt(o.toString(),10)]+e;return e=e.slice(1),t[1]?e+"."+t[1]:e}(fe=ce=ce||{}).negativeDataRegex=/^(('[^']+'|''|[^*#@0,.E])*)(\*.)?((([#,]*[0,]*0+)(\.0*[0-9]*#*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/,fe.customRegex=/^(('[^']+'|''|[^*#@0,.])*)(\*.)?((([0#,]*[0,]*[0#]*[0# ]*)(\.[0#]*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/,fe.latnParseRegex=/0|1|2|3|4|5|6|7|8|9/g,ye=/[0-9]/g,fe.defaultCurrency="$",ve=["infinity","nan","group","decimal"],be=/G|M|L|H|c|'| a|yy|y|EEEE|E/g,we={G:"",M:"m",L:"m",H:"h",c:"d","'":'"'," a":" AM/PM",yy:"yy",y:"yyyy",EEEE:"dddd",E:"ddd"},fe.dateConverterMapper=/dddd|ddd/gi,fe.islamicRegex=/^islamic/,Ce={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},fe.formatRegex=new W("(^[ncpae]{1})([0-1]?[0-9]|20)?$","i"),fe.currencyFormatRegex=new W("(^[ca]{1})([0-1]?[0-9]|20)?$","i"),fe.curWithoutNumberRegex=/(c|a)$/gi,Se={$:"isCurrency","%":"isPercent","-":"isNegative",0:"nlead",1:"nend"},fe.dateParseRegex=/([a-z])\1*|'([^']|'')+'|''|./gi,fe.basicPatterns=["short","medium","long","full"],fe.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"}}},fe.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"}}},fe.monthIndex={3:"abbreviated",4:"wide",5:"narrow",1:"abbreviated"},fe.month="months",fe.days="days",fe.patternMatcher={C:"currency",P:"percent",N:"decimal",A:"currency",E:"scientific"},fe.getResultantPattern=xe,fe.getDependables=Ie,fe.getSymbolPattern=Te,fe.ConvertDateToWeekFormat=Ee,fe.compareBlazorDateFormats=De,fe.getProperNumericSkeleton=Me,fe.getFormatData=ke,fe.changeCurrencySymbol=Be,fe.getCurrencySymbol=Fe,fe.customFormat=function(e,t,i){for(var n={},o=e.split(";"),r=["pData","nData","zeroData"],s=0;s<o.length;s++)n[""+r[parseInt(s.toString(),10)]]=Le(o[parseInt(s.toString(),10)],t,i);return je(n.nData)&&(n.nData=Pe({},n.pData),n.nData.nlead=je(t)?"-"+n.nData.nlead:t.minusSymbol+n.nData.nlead),n},fe.customNumberFormat=Le,fe.isCurrencyPercent=Re,fe.getDateSeparator=function(e){return(e=(R("dateFormats.short",e)||"").match(/[dM]([^dM])[dM]/i))?e[1]:"/"},fe.getActualDateTimeFormat=function(e,t,i,n){var o,r=Ie(i,e,t.calendar),e=(t=N?De(t,e):t).format||xe(t.skeleton,r.dateObject,t.type);return n&&(-1!==(e=e.replace(be,function(e){return we[""+e]})).indexOf("z")&&(t=e.match(/z/g).length,n=void 0,(o={timeZone:{}}).numMapper=$.getNumberMapper(r.parserObject,$.getNumberingSystem(i)),o.timeZone=R("dates.timeZoneNames",r.parserObject),i=(new Date).getTimezoneOffset(),r=(r=t<4?"+H;-H":o.timeZone.hourFormat).replace(/:/g,o.numMapper.timeSeparator),n=0===i?o.timeZone.gmtZeroFormat:(n=le.getTimeZoneValue(i,r),o.timeZone.gmtFormat.replace(/\{0\}/,n)),e=e.replace(/[z]+/,'"'+n+'"')),e=e.replace(/ $/,"")),e},fe.processSymbol=Oe,fe.getActualNumberFormat=function(e,t,i,n){var o,r,s,e=Ie(i,e,"",!0),a={custom:!0},l=e.numericObject,h={},d=(t.format||"").match(fe.currencyFormatRegex),p=fe.formatRegex.test(t.format)?Me(t.format||"N"):{},c={};return d&&(c.numberMapper=N?Pe({},e.numericObject):$.getNumberMapper(e.parserObject,$.getNumberingSystem(i),!0),i=N?R("currencySymbol",e.numericObject):Fe(e.numericObject,t.currency||oe,t.altSymbol),r=(e=(e=Te("currency",c.numberMapper.numberSystem,e.numericObject,/a/i.test(t.format))).replace(/\u00A4/g,i)).split(";"),h.hasNegativePattern=!!N||1<r.length,h.nData=N?R(p.type+"nData",l):ke(r[1]||"-"+r[0],!0,i),h.pData=N?R(p.type+"pData",l):ke(r[0],!1,i),d[2]||t.minimumFractionDigits||t.maximumFractionDigits||(o=ke(e.split(";")[0],!0,"",!0).minimumFraction)),fe.formatRegex.test(t.format)||!t.format?(Pe(a,Me(t.format||"N")),a.custom=!1,s="###0",(a.fractionDigits||t.minimumFractionDigits||t.maximumFractionDigits||o)&&(a.fractionDigits&&(t.minimumFractionDigits=t.maximumFractionDigits=a.fractionDigits),s=Ne(s,o||a.fractionDigits||t.minimumFractionDigits||0,t.maximumFractionDigits||0)),t.minimumIntegerDigits&&(s=Ve(s,t.minimumIntegerDigits)),t.useGrouping&&(s=_e(s)),("currency"===a.type||a.type&&N)&&(N&&"currency"!==a.type&&(h.pData=R(a.type+"pData",l),h.nData=R(a.type+"nData",l)),p=s,s=h.pData.nlead+p+h.pData.nend,h.hasNegativePattern||N)&&(s+=";"+h.nData.nlead+p+h.nData.nend),"percent"!==a.type||N||(s+=" %")):s=t.format.replace(/'/g,'"'),s=0<Object.keys(c).length?n?s:Oe(s,c):s},fe.fractionDigitsPattern=Ne,fe.minimumIntegerPattern=Ve,fe.groupingPattern=_e,fe.getWeekData=function(e,t){var i="sun",t=R("supplemental.weekData.firstDay",t),e=(e=/en-/.test(e)?e.slice(3):e).slice(0,2).toUpperCase()+e.substr(2);return t&&(i=t[""+e]||t[e.slice(0,2)]||"sun"),Ce[""+i]},fe.replaceBlazorCurrency=function(e,t,i){var n=R(i||"",ne);if(t!==n)for(var o=0,r=e;o<r.length;o++){var s=r[o];s.nend=s.nend.replace(t,n),s.nlead=s.nlead.replace(t,n)}},fe.getWeekOfYear=function(e,t){var i,n=new Date(e.getFullYear(),0,1),o=0<=(o=n.getDay())?o:o+7,n=Math.floor((e.getTime()-n.getTime()-6e4*(e.getTimezoneOffset()-n.getTimezoneOffset()))/864e5)+1;return o<4?52<(i=Math.floor((n+o-t-1)/7)+1)&&(i=(e=0<=(e=new Date(e.getFullYear()+1,0,1).getDay())?e:e+7)<4?1:53):i=Math.floor((n+o-t-1)/7),i};var He=/^(.*?):[ \t]*([^\r\n]*)$/gm,ze=(We.prototype.send=function(e){var i=this,n=(this.data=je(e)?this.data:e,{cancel:!1,httpRequest:null});return new Promise(function(e,t){i.httpRequest=new XMLHttpRequest,i.httpRequest.onreadystatechange=function(){i.stateChange(e,t)},je(i.onLoad)||(i.httpRequest.onload=i.onLoad),je(i.onProgress)||(i.httpRequest.onprogress=i.onProgress),je(i.onAbort)||(i.httpRequest.onabort=i.onAbort),je(i.onError)||(i.httpRequest.onerror=i.onError),je(i.onUploadProgress)||(i.httpRequest.upload.onprogress=i.onUploadProgress),i.httpRequest.open(i.type,i.url,i.mode),je(i.data)||null===i.contentType||i.httpRequest.setRequestHeader("Content-Type",i.contentType||"application/json; charset=utf-8"),i.beforeSend&&(n.httpRequest=i.httpRequest,i.beforeSend(n)),n.cancel||i.httpRequest.send(je(i.data)?null:i.data)})},We.prototype.successHandler=function(e){return this.onSuccess&&this.onSuccess(e,this),e},We.prototype.failureHandler=function(e){return this.onFailure&&this.onFailure(this.httpRequest),e},We.prototype.stateChange=function(e,t){var i=this.httpRequest.responseText;if(this.dataType&&"json"===this.dataType.toLowerCase())if(""===i)i=void 0;else try{i=JSON.parse(i)}catch(e){}4===this.httpRequest.readyState&&(200<=this.httpRequest.status&&this.httpRequest.status<=299||304===this.httpRequest.status?e(this.successHandler(i)):this.emitError?t(new Error(this.failureHandler(this.httpRequest.statusText))):e())},We.prototype.getResponseHeader=function(e){for(var t={},i=He.exec(this.httpRequest.getAllResponseHeaders());i;)t[i[1].toLowerCase()]=i[2],i=He.exec(this.httpRequest.getAllResponseHeaders());e=t[e.toLowerCase()];return je(e)?null:e},We);function We(e,t,i,n){this.mode=!0,this.emitError=!0,this.options={},"string"==typeof e?(this.url=e,this.type=t?t.toUpperCase():"GET",this.mode=!!je(i)||i):"object"==typeof e&&(this.options=e,I(this,this.options)),this.type=this.type?this.type.toUpperCase():"GET",this.contentType=void 0!==this.contentType?this.contentType:n}Ue.prototype.send=function(e){var r=this,s={"application/json":"json","multipart/form-data":"formData","application/octet-stream":"blob","application/x-www-form-urlencoded":"formData"};try{je(this.fetchRequest)&&"GET"===this.type?this.fetchRequest=new Request(this.url,{method:this.type}):je(this.fetchRequest)&&(this.data=je(e)?this.data:e,this.fetchRequest=new Request(this.url,{method:this.type,headers:{"Content-Type":this.contentType},body:this.data}));var t={cancel:!1,fetchRequest:this.fetchRequest};return(this.triggerEvent(this.beforeSend,t),t.cancel)?null:(this.fetchResponse=fetch(this.fetchRequest),this.fetchResponse.then(function(e){if(r.triggerEvent(r.onLoad,e),!e.ok)throw e;for(var t="text",i=0,n=Object.keys(s);i<n.length;i++){var o=n[i];e.headers.get("Content-Type")&&-1!==e.headers.get("Content-Type").indexOf(o)&&(t=s[o])}return e[t]()}).then(function(e){return r.triggerEvent(r.onSuccess,e,r),e}).catch(function(e){var t={};return r.emitError&&(r.triggerEvent(r.onFailure,e),t=Promise.reject(e)),t}))}catch(e){return e}},Ue.prototype.triggerEvent=function(e,t,i){je(e)||"function"!=typeof e||e(t,i)};var Qe=Ue;function Ue(e,t,i){this.type="GET",this.emitError=!0,"string"==typeof e?(this.url=e,this.type=je(t)?this.type:t.toUpperCase(),this.contentType=i):S(e)&&0<Object.keys(e).length&&I(this,e),this.contentType=je(this.contentType)?"application/json; charset=utf-8":this.contentType}var qe=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i,Ge=/msie|trident/i,Ye=/Trident\/7\./,Xe=/(ipad|iphone|ipod touch)/i,Ke=/(ipad|iphone|ipod touch);.*os 7_\d|(ipad|iphone|ipod touch);.*os 8_\d/i,Je=/android/i,Ze=/trident|windows phone|edge/i,$e=/(version)[ /]([\w.]+)/i,et={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},F=("undefined"!=typeof window&&(window.browserDetails=window.browserDetails||{}),tt.extractBrowserDetail=function(){for(var e={culture:{}},t=[],i=0,n=Object.keys(et);i<n.length;i++){var o=n[i];if(t=tt.userAgent.match(et[""+o])){if(e.name="opr"===t[1].toLowerCase()?"opera":t[1].toLowerCase(),e.name="crios"===t[1].toLowerCase()?"chrome":e.name,e.version=t[2],e.culture.name=e.culture.language=navigator.language,tt.userAgent.match(Ye)){e.name="msie";break}o=tt.userAgent.match($e);"safari"===e.name&&o&&(e.version=o[2]);break}}return e},tt.getEvent=function(e){var t={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 tt.isPointer?t[""+e].isPointer:tt.isTouch?t[""+e].isTouch+(tt.isDevice?"":" "+t[""+e].isDevice):t[""+e].isDevice},tt.getTouchStartEvent=function(){return tt.getEvent("start")},tt.getTouchEndEvent=function(){return tt.getEvent("end")},tt.getTouchMoveEvent=function(){return tt.getEvent("move")},tt.getTouchCancelEvent=function(){return tt.getEvent("cancel")},tt.isSafari=function(){return tt.isDevice&&tt.isIos&&tt.isTouch&&"undefined"!=typeof window&&-1===window.navigator.userAgent.toLowerCase().indexOf("iphone")&&-1<window.navigator.userAgent.toLowerCase().indexOf("safari")},tt.getValue=function(e,t){var i="undefined"!=typeof window?window.browserDetails:{};return"undefined"!=typeof navigator&&"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints&&!0===tt.isTouch&&!et.CHROME.test(navigator.userAgent)&&(i.isIos=!0,i.isDevice=!0,i.isTouch=!0,i.isPointer=!0,i.isPointer="pointerEnabled"in window.navigator),"undefined"!=typeof window&&window.Capacitor&&"ios"===window.Capacitor.getPlatform()&&(i.isPointer=!1),void 0===i[""+e]?i[""+e]=t.test(tt.userAgent):i[""+e]},Object.defineProperty(tt,"userAgent",{get:function(){return tt.uA},set:function(e){tt.uA=e,window.browserDetails={}},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"info",{get:function(){return ee(window.browserDetails.info)?window.browserDetails.info=tt.extractBrowserDetail():window.browserDetails.info},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"isIE",{get:function(){return tt.getValue("isIE",Ge)},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"isTouch",{get:function(){return ee(window.browserDetails.isTouch)?window.browserDetails.isTouch="ontouchstart"in window.navigator||window&&window.navigator&&0<window.navigator.maxTouchPoints||"ontouchstart"in window:window.browserDetails.isTouch},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"isPointer",{get:function(){return ee(window.browserDetails.isPointer)?window.browserDetails.isPointer="pointerEnabled"in window.navigator:window.browserDetails.isPointer},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"isMSPointer",{get:function(){return ee(window.browserDetails.isMSPointer)?window.browserDetails.isMSPointer="msPointerEnabled"in window.navigator:window.browserDetails.isMSPointer},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"isDevice",{get:function(){return tt.getValue("isDevice",qe)},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"isIos",{get:function(){return tt.getValue("isIos",Xe)},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"isIos7",{get:function(){return tt.getValue("isIos7",Ke)},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"isAndroid",{get:function(){return tt.getValue("isAndroid",Je)},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"isWebView",{get:function(){return ee(window.browserDetails.isWebView)&&(window.browserDetails.isWebView=!(ee(window.cordova)&&ee(window.PhoneGap)&&ee(window.phonegap)&&"object"!==window.forge)),window.browserDetails.isWebView},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"isWindows",{get:function(){return tt.getValue("isWindows",Ze)},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"touchStartEvent",{get:function(){return ee(window.browserDetails.touchStartEvent)?window.browserDetails.touchStartEvent=tt.getTouchStartEvent():window.browserDetails.touchStartEvent},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"touchMoveEvent",{get:function(){return ee(window.browserDetails.touchMoveEvent)?window.browserDetails.touchMoveEvent=tt.getTouchMoveEvent():window.browserDetails.touchMoveEvent},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"touchEndEvent",{get:function(){return ee(window.browserDetails.touchEndEvent)?window.browserDetails.touchEndEvent=tt.getTouchEndEvent():window.browserDetails.touchEndEvent},enumerable:!0,configurable:!0}),Object.defineProperty(tt,"touchCancelEvent",{get:function(){return ee(window.browserDetails.touchCancelEvent)?window.browserDetails.touchCancelEvent=tt.getTouchCancelEvent():window.browserDetails.touchCancelEvent},enumerable:!0,configurable:!0}),tt.uA="undefined"!=typeof navigator?navigator.userAgent:"",tt);function tt(){}it.addOrGetEventData=function(e){return"__eventList"in e?e.__eventList.events:(e.__eventList={},e.__eventList.events=[])},it.add=function(e,t,i,n,o){var r=it.addOrGetEventData(e),s=o?P(i,o):i;n&&(s=s.bind(n));for(var a=t.split(" "),l=0;l<a.length;l++)r.push({name:a[parseInt(l.toString(),10)],listener:i,debounce:s}),F.isIE?e.addEventListener(a[parseInt(l.toString(),10)],s):e.addEventListener(a[parseInt(l.toString(),10)],s,{passive:!1});return s},it.remove=function(e,t,r){for(var s=it.addOrGetEventData(e),a=t.split(" "),i=0;i<a.length;i++)!function(i){var n,o=-1;s&&0!==s.length&&s.some(function(e,t){return e.name===a[parseInt(i.toString(),10)]&&e.listener===r&&(o=t,n=e.debounce,!0)}),-1!==o&&s.splice(o,1),n&&e.removeEventListener(a[parseInt(i.toString(),10)],n)}(i)},it.clearEvents=function(e){for(var t=it.addOrGetEventData(e),i=Pe([],void 0,t),n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)];e.removeEventListener(o.name,o.debounce),t.shift()}},it.trigger=function(e,t,i){for(var n=0,o=it.addOrGetEventData(e);n<o.length;n++){var r=o[n];r.name===t&&r.debounce.call(this,i)}};var E=it;function it(){}var nt=function(){return(nt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ot=/^svg|^path|^g/;function Q(e,t){e=ot.test(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return void 0!==t&&(e.innerHTML=t.innerHTML||"",void 0!==t.className&&(e.className=t.className),void 0!==t.id&&(e.id=t.id),void 0!==t.styles&&(e.style.cssText=t.styles),void 0!==t.attrs)&&pt(e,t.attrs),e}function rt(e,t){var i=e.style.cssText.split(";").reduce(function(e,t){var t=t.split(":"),i=t[0],t=t[1];return i&&t&&(e[i.trim()]=t.trim()),e},{}),n=t.split(";").reduce(function(e,t){var t=t.split(":"),i=t[0],t=t[1];return i&&t&&(e[i.trim()]=t.trim()),e},{}),o=document.createElement("div");Object.keys(nt({},i,n)).forEach(function(e){o.style.setProperty(e,n[e]||i[e])}),e.style.cssText=o.style.cssText}function U(e,t){for(var i=st(t),n=RegExp,o=0,r=e;o<r.length;o++)for(var s=r[o],a=0,l=i;a<l.length;a++){var h,d=l[a];S(s)?je(h=R("attributes.className",s))?x("attributes.className",d,s):new n("\\b"+d+"\\b","i").test(h)||x("attributes.className",h+" "+d,s):s.classList.contains(d)||s.classList.add(d)}return e}function q(e,t){for(var i=st(t),n=0,o=e;n<o.length;n++){var r=o[n],s=S(r);if(s?R("attributes.className",r):""!==r.className)for(var a=0,l=i;a<l.length;a++){var h,d,p=l[a];s?(-1!==(d=(h=R("attributes.className",r).split(" ")).indexOf(p))&&h.splice(d,1),x("attributes.className",h.join(" "),r)):r.classList.remove(p)}}return e}function st(e){var t=[];return"string"==typeof e?t.push(e):t=e,t}function at(e){return""===e.style.visibility&&0<e.offsetWidth}function lt(e,t,i){for(var n=document.createDocumentFragment(),o=0,r=e;o<r.length;o++){var s=r[o];n.appendChild(s)}return t.insertBefore(n,t.firstElementChild),i&&dt(t),e}function ht(e,t,i){var n=document.createDocumentFragment();if(e instanceof NodeList)for(;0<e.length;)n.appendChild(e[0]);else for(var o=0,r=e;o<r.length;o++){var s=r[o];n.appendChild(s)}return t.appendChild(n),i&&dt(t),e}function dt(e){e.querySelectorAll("script").forEach(function(e){var t=document.createElement("script");t.text=e.innerHTML,document.head.appendChild(t),G(t)})}function G(e){var t=e.parentNode;if(t)return t.removeChild(e)}function ue(e){var t=e.parentNode;E.clearEvents(e),t.removeChild(e)}function pt(e,t){for(var i=e,n=0,o=Object.keys(t);n<o.length;n++){var r=o[n];S(i)?i.attributes[""+("tabindex"===r?"tabIndex":r)]=t[""+r]:i.setAttribute(r,t[""+r])}return i}function ge(e,t,i){return void 0===t&&(t=document),e=ut(e),t.querySelector(e)}function ct(e,t,i){return void 0===t&&(t=document),e=ut(e),t.querySelectorAll(e)}function ut(e){var t=/(!|"|\$|%|&|'|\(|\)|\*|\/|:|;|<|=|\?|@|\]|\^|`|{|}|\||\+|~)/g;if(e.match(/#[0-9]/g)||e.match(t)){for(var i=e.split(","),n=0;n<i.length;n++){for(var o,r=i[parseInt(n.toString(),10)].split(" "),s=0;s<r.length;s++)-1<r[parseInt(s.toString(),10)].indexOf("#")&&(r[parseInt(s.toString(),10)].match(/\[.*\]/)||!(o=r[parseInt(s.toString(),10)].split("#"))[1].match(/^\d/)&&!o[1].match(t)||((o=r[parseInt(s.toString(),10)].split("."))[0]=o[0].replace(/#/,"[id='")+"']",r[parseInt(s.toString(),10)]=o.join(".")));i[parseInt(n.toString(),10)]=r.join(" ")}return i.join(",")}return e}function z(e,t){var i=e;if("function"==typeof i.closest)return i.closest(t);for(;i&&1===i.nodeType;){if(ft(i,t))return i;i=i.parentNode}return null}function gt(t,i){void 0!==i&&Object.keys(i).forEach(function(e){t.style[""+e]=i[""+e]})}function mt(e,t,i){U([e],t),q([e],i)}function ft(e,t){var i=e.matches||e.msMatchesSelector||e.webkitMatchesSelector;return i?i.call(e,t):-1!==[].indexOf.call(document.querySelectorAll(t),e)}vt.prototype.on=function(e,t,i,n){je(t)||(i=i||this.context,this.notExist(e)?this.boundedEvents[""+e]=[{handler:t,context:i,id:n}]:je(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})))},vt.prototype.off=function(e,t,i){if(!this.notExist(e)){var n=R(e,this.boundedEvents);if(t){for(var o=0;o<n.length;o++)if(i){if(n[parseInt(o.toString(),10)].id===i){n.splice(o,1);var r=this.ranArray.indexOf(i);-1!==r&&this.ranArray.splice(r,1);break}}else if(t===n[parseInt(o.toString(),10)].handler){n.splice(o,1);break}}else delete this.boundedEvents[""+e]}},vt.prototype.notify=function(e,t,i,n){if(!this.notExist(e)){if(t&&(t.name=e),e=R(e,this.boundedEvents).slice(0),window.Blazor)return this.blazorCallback(e,t,i,n,0);for(var o=0,r=e;o<r.length;o++){var s=r[o];s.handler.call(s.context,t)}}i&&i.call(this,t)},vt.prototype.blazorCallback=function(t,i,n,o,r){var s=this,a=r===t.length-1;if(r<t.length){var l=t[parseInt(r.toString(),10)],e=l.handler.call(l.context,i);if(e&&"function"==typeof e.then){if(!n)return e;e.then(function(e){if(e="string"==typeof e&&s.isJson(e)?JSON.parse(e,s.dateReviver):e,Pe(i,i,e,!0),!n||!a)return s.blazorCallback(t,i,n,o,r+1);n.call(l.context,i)}).catch(function(e){o&&o.call(l.context,"string"==typeof e&&s.isJson(e)?JSON.parse(e,s.dateReviver):e)})}else{if(!n||!a)return this.blazorCallback(t,i,n,o,r+1);n.call(l.context,i)}}},vt.prototype.dateReviver=function(e,t){return"string"==typeof t&&null!==t.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/)?new Date(t):t},vt.prototype.isJson=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},vt.prototype.destroy=function(){this.boundedEvents=this.context=void 0},vt.prototype.offIntlEvents=function(){var e=this.boundedEvents.notifyExternalChange;if(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)].context;i&&i.detectFunction&&i.randomId&&i.isReactMock&&(this.off("notifyExternalChange",i.detectFunction,i.randomId),t--)}this.boundedEvents.notifyExternalChange.length||delete this.boundedEvents.notifyExternalChange}},vt.prototype.notExist=function(e){return!1===Object.prototype.hasOwnProperty.call(this.boundedEvents,e)||this.boundedEvents[""+e].length<=0},vt.prototype.isHandlerPresent=function(e,t){for(var i=0,n=e;i<n.length;i++)if(n[i].handler===t)return!0;return!1};var yt=vt;function vt(e){this.ranArray=[],this.boundedEvents={},je(e)||(this.context=e)}var bt,wt=new RegExp("]"),Ct=(St.prototype.setProperties=function(e,t){var i=this.isProtectedOnChange;this.isProtectedOnChange=!!t,I(this,e),!0!==t?(I(this.changedProperties,e),this.dataBind()):N&&this.isRendered&&this.serverDataBind(e),this.finalUpdate(),this.changedProperties={},this.oldProperties={},this.isProtectedOnChange=i},St.callChildDataBind=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];if(t[""+o]instanceof Array)for(var r=0,s=t[""+o];r<s.length;r++){var a=s[r];void 0!==a.dataBind&&a.dataBind()}else t[""+o].dataBind()}},St.prototype.clearChanges=function(){this.finalUpdate(),this.changedProperties={},this.oldProperties={},this.childChangedProperties={}},St.prototype.dataBind=function(){var e,t,i;St.callChildDataBind(this.childChangedProperties,this),Object.getOwnPropertyNames(this.changedProperties).length&&(e=this.isProtectedOnChange,t=this.changedProperties,i=this.oldProperties,this.clearChanges(),this.isProtectedOnChange=!0,this.onPropertyChanged(t,i),this.isProtectedOnChange=e)},St.prototype.serverDataBind=function(e){N&&(Pe(this.bulkChanges,{},e=e||{},!0),this.allowServerDataBinding)&&window.sfBlazor.updateModel&&(window.sfBlazor.updateModel(this),this.bulkChanges={})},St.prototype.saveChanges=function(e,t,i){var n;N&&((n={})[""+e]=t,this.serverDataBind(n)),this.isProtectedOnChange||(this.oldProperties[""+e]=i,this.changedProperties[""+e]=t,this.finalUpdate(),this.finalUpdate=v(this.dataBind.bind(this)))},St.prototype.addEventListener=function(e,t){this.modelObserver.on(e,t)},St.prototype.removeEventListener=function(e,t){this.modelObserver.off(e,t)},St.prototype.trigger=function(e,t,i,n){var o,r,s,a=this;if(!0!==this.isDestroyed)return o=this.isProtectedOnChange,this.isProtectedOnChange=!1,r=this.modelObserver.notify(e,t,i,n),wt.test(e)&&((e=R(e,this))?window.Blazor?(s=e.call(this,t))&&"function"==typeof s.then?i?s.then(function(e){i&&(e="string"==typeof e&&a.modelObserver.isJson(e)?JSON.parse(e):e,i.call(a,e))}).catch(function(e){n&&(e="string"==typeof e&&a.modelObserver.isJson(e)?JSON.parse(e):e,n.call(a,e))}):r=s:i&&i.call(this,t):(e.call(this,t),i&&i.call(this,t)):i&&i.call(this,t)),this.isProtectedOnChange=o,r},St.prototype.addInstance=function(){var e="e-"+this.getModuleName().toLowerCase();U([this.element],["e-lib",e]),je(this.element.ej2_instances)?x("ej2_instances",[this],this.element):this.element.ej2_instances.push(this)},St.prototype.destroy=function(){var t=this;this.element.ej2_instances=this.element.ej2_instances?this.element.ej2_instances.filter(function(e){return bt?bt(e)!==bt(t):e!==t}):[],q([this.element],["e-"+this.getModuleName()]),0===this.element.ej2_instances.length&&q([this.element],["e-lib"]),this.clearChanges(),this.modelObserver.destroy(),this.isDestroyed=!0},St);function St(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 yt(this),ee(t)||(this.element="string"==typeof t?document.querySelector(t):t,je(this.element))||(this.isProtectedOnChange=!1,this.addInstance()),ee(e)||this.setProperties(e,!0),this.isDestroyed=!1}function At(e,t){var i,n="string"==typeof e?document.getElementById(e):e;if(n&&n.ej2_instances)for(i=0;i<n.ej2_instances.length;i++){var o=n.ej2_instances[parseInt(i.toString(),10)];if("string"==typeof t){if(t===o.getModuleName())return o}else if(o instanceof t)return o}}function xt(e,t,i,n){return Object.prototype.hasOwnProperty.call(e.properties,t)&&e.properties[""+t]instanceof n||(e.properties[""+t]=y(n,[e,t,i])),e.properties[""+t]}function It(e,t,i,n,o,r){for(var s=[],a=i?i.length:0,l=0;l<a;l++){var h,d=n;r&&(d=n(i[parseInt(l.toString(),10)],e)),o?((h=y(d,[e,t,{},!0])).setProperties(i[parseInt(l.toString(),10)],!0),s.push(h)):s.push(y(d,[e,t,i[parseInt(l.toString(),10)],!1]))}return s}function Tt(e,t){return function(){return Object.prototype.hasOwnProperty.call(this.properties,t)||(this.properties[""+t]=e),this.properties[""+t]}}function Et(t,n,o){return function(){var i=this,e=(Object.prototype.hasOwnProperty.call(this.properties,n)||(e=It(this,n,t,o,!1),this.properties[""+n]=e),void 0!==this.controlParent&&this.controlParent.ignoreCollectionWatch||this.ignoreCollectionWatch);return Object.prototype.hasOwnProperty.call(this.properties[""+n],"push")||e||["push","pop"].forEach(function(e){var s,a,l,t={value:(s=e,a=n,l=i.properties[""+n],function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this.propName?this.getParentKey()+"."+a+"-":a+"-";switch(s){case"push":for(var n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)],r=(Array.prototype[""+s].apply(l,[o]),Dt(i+(l.length-1),o,!this.controlParent,s));this.serverDataBind(r,e[parseInt(n.toString(),10)],!1,s)}break;case"pop":Array.prototype[""+s].apply(l);r=Dt(i+l.length,null,!this.controlParent,s);this.serverDataBind(r,{ejsAction:"pop"},!1,s)}return l}.bind(i)),configurable:!0};Object.defineProperty(i.properties[""+n],e,t)}),Object.prototype.hasOwnProperty.call(this.properties[""+n],"isComplexArray")||Object.defineProperty(this.properties[""+n],"isComplexArray",{value:!0}),this.properties[""+n]}}function Dt(e,t,i,n){var o=e;return i&&((o={})[""+e]=t)&&"object"==typeof t&&(o[""+e].ejsAction=n),o}function e(r){return function(e,t){var i,n,o={set:function(e){var t;this.properties[""+n]!==e&&(t=Object.prototype.hasOwnProperty.call(this.properties,n)?this.properties[""+n]:i,this.saveChanges(n,e,t),this.properties[""+n]=e)},get:Tt(i=r,n=t),enumerable:!0,configurable:!0};Object.defineProperty(e,t,o),Ft(e,t,"prop",r)}}function t(h,d){return function(e,t){var i,n,o,r,s,a,l={set:function(e){xt(this,s,r,a).setProperties(e)},get:(i=r=h,n=s=t,o=a=d,function(){return xt(this,n,i,o)}),enumerable:!0,configurable:!0};Object.defineProperty(e,t,l),Ft(e,t,"complexProp",h,d)}}function Mt(h){return function(e,t){var i,n,o,r,s,a,l={set:(r={},function(e){var t=a(e,this);xt(this,s,r,t).setProperties(e)}),get:(i={},n=s=t,o=a=h,function(){var e=o({});return Object.prototype.hasOwnProperty.call(this.properties,n)?this.properties[""+n]:xt(this,n,i,e)}),enumerable:!0,configurable:!0};Object.defineProperty(e,t,l),Ft(e,t,"complexProp",{},h)}}function kt(s,a){return function(e,t){var i,n,o,r={set:function(e){this.isComplexArraySetter=!0;var t=It(this,n,i,o,!1),e=It(this,n,e,o,!0);this.isComplexArraySetter=!1,this.saveChanges(n,e,t),this.properties[""+n]=e},get:Et(i=s,n=t,o=a),enumerable:!0,configurable:!0};Object.defineProperty(e,t,r),Ft(e,t,"colProp",s,a)}}function Pt(h){return function(e,t){var i,n,o,r,s,a,l={set:(r=[],function(e){var t=Object.prototype.hasOwnProperty.call(this.properties,s)?this.properties[""+s]:r,e=It(this,s,e,a,!0,!0);this.saveChanges(s,e,t),this.properties[""+s]=e}),get:(i=[],n=s=t,o=a=h,function(){var e=o({});return Object.prototype.hasOwnProperty.call(this.properties,n)||(e=It(this,n,i,e,!1),this.properties[""+n]=e),this.properties[""+n]}),enumerable:!0,configurable:!0};Object.defineProperty(e,t,l),Ft(e,t,"colProp",{},h)}}function i(){return function(e,n){var t={set:function(e){var t,i=this.properties[""+n];i!==e&&(t=function e(t,i){{var n;return!1===Object.prototype.hasOwnProperty.call(t,"parentObj")?{context:t,prefix:i}:((n=R("propName",t))&&(i=n+"-"+i),e(R("parentObj",t),i))}}(this,n),!1===ee(i)&&t.context.removeEventListener(t.prefix,i),t.context.addEventListener(t.prefix,e),this.properties[""+n]=e)},get:Tt(void 0,n),enumerable:!0,configurable:!0};Object.defineProperty(e,n,t),Ft(e,n,"event")}}function Bt(e){}function Ft(e,t,i,n,o){ee(e.propList)&&(e.propList={props:[],complexProps:[],colProps:[],events:[],propNames:[],complexPropNames:[],colPropNames:[],eventNames:[]}),e.propList[i+"s"].push({propertyName:t,defaultValue:n,type:o}),e.propList[i+"Names"].push(t)}function Lt(e){if(ee(e.prototype.builderObject)){e.prototype.builderObject={properties:{},propCollections:[],add:function(){this.isPropertyArray=!0,this.propCollections.push(Pe({},this.properties,{}))}};for(var t=/complex/,i=0,n=Object.keys(e.prototype.propList);i<n.length;i++)for(var o=n[i],r=0,s=e.prototype.propList[""+o];r<s.length;r++)!function(i){t.test(o)?e.prototype.builderObject[i.propertyName]=function(e){var t={};return I(t,Lt(i.type)),e(t),e=t.isPropertyArray?t.propCollections:Pe({},t.properties,{}),this.properties[i.propertyName]=e,t.properties={},t.propCollections=[],t.isPropertyArray=!1,this}:e.prototype.builderObject[i.propertyName]=function(e){return this.properties[i.propertyName]=e,this}}(s[r])}return e.prototype.builderObject}Rt=function(e,t){return(Rt=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])}))(e,t)};var Rt,Ot,Nt,W=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Vt=(function(e,t){function i(){this.constructor=e}Rt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(_t,Ot=Ct),(Nt=_t).prototype.animate=function(e,t){var i=this.getModel(t=t||{});if("string"==typeof e)for(var n=0,o=Array.prototype.slice.call(ct(e,document));n<o.length;n++){var r=o[n];i.element=r,Nt.delayAnimation(i)}else i.element=e,Nt.delayAnimation(i)},_t.stop=function(e,t){e.style.animation="",e.removeAttribute("e-animate");var i=e.getAttribute("e-animation-id");i&&(i=parseInt(i,10),cancelAnimationFrame(i),e.removeAttribute("e-animation-id")),t&&t.end&&t.end.call(this,t)},_t.delayAnimation=function(e){"Disable"===Ut||Ut===qt.Disable?(e.begin&&e.begin.call(this,e),e.end&&e.end.call(this,e)):e.delay?setTimeout(function(){Nt.applyAnimation(e)},e.delay):Nt.applyAnimation(e)},_t.applyAnimation=function(i){var n=this,o=i.timeStamp=0,r=0,s=0,a=i.duration,l=(i.element.setAttribute("e-animate","true"),function(e){try{var t;e?(s=0===s?e:s,i.timeStamp=e+i.timeStamp-s,s=e,!o&&i.begin&&i.begin.call(n,i),o+=1,t=i.timeStamp/o,i.timeStamp<a&&i.timeStamp+t<a&&i.element.getAttribute("e-animate")?(i.element.style.animation=i.name+" "+i.duration+"ms "+i.timingFunction,i.progress&&i.progress.call(n,i),requestAnimationFrame(l)):(cancelAnimationFrame(r),i.element.removeAttribute("e-animation-id"),i.element.removeAttribute("e-animate"),i.element.style.animation="",i.end&&i.end.call(n,i))):(r=requestAnimationFrame(l),i.element.setAttribute("e-animation-id",r.toString()))}catch(e){cancelAnimationFrame(r),i.element.removeAttribute("e-animation-id"),i.fail&&i.fail.call(n,e)}});l()},_t.prototype.getModel=function(e){return{name:e.name||this.name,delay:e.delay||this.delay,duration:(void 0!==e.duration?e: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]||e.timingFunction||this.easing[this.timingFunction]}},_t.prototype.onPropertyChanged=function(e,t){},_t.prototype.getModuleName=function(){return"animation"},_t.prototype.destroy=function(){},W([e("FadeIn")],_t.prototype,"name",void 0),W([e(400)],_t.prototype,"duration",void 0),W([e("ease")],_t.prototype,"timingFunction",void 0),W([e(0)],_t.prototype,"delay",void 0),W([i()],_t.prototype,"progress",void 0),W([i()],_t.prototype,"begin",void 0),W([i()],_t.prototype,"end",void 0),W([i()],_t.prototype,"fail",void 0),Nt=W([Bt],_t));function _t(e){e=Ot.call(this,e,void 0)||this;return e.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)"},e}function Ht(e,t,i){t={selector:(t=t)&&t.selector?t.selector:null,ignore:t&&t.ignore?t.ignore:null,rippleFlag:t&&t.rippleFlag,isCenterRipple:t&&t.isCenterRipple,duration:t&&t.duration?t.duration:350};return!1===t.rippleFlag||void 0===t.rippleFlag&&!Gt?function(){}:(e.setAttribute("data-ripple","true"),E.add(e,"mousedown",zt,{parent:e,rippleOptions:t}),E.add(e,"mouseup",jt,{parent:e,rippleOptions:t,done:i}),E.add(e,"mouseleave",Wt,{parent:e,rippleOptions:t}),F.isPointer&&E.add(e,"transitionend",Wt,{parent:e,rippleOptions:t}),function(){e.removeAttribute("data-ripple"),E.remove(e,"mousedown",zt),E.remove(e,"mouseup",jt),E.remove(e,"mouseleave",Wt),E.remove(e,"transitionend",Wt)})}function zt(e){var t,i,n,o=e.target,r=this.rippleOptions.selector,r=r?z(o,r):o;!r||this.rippleOptions&&z(o,this.rippleOptions.ignore)||(o=r.getBoundingClientRect(),n=e.pageX-document.body.scrollLeft,e=e.pageY-(!document.body.scrollTop&&document.documentElement?document.documentElement:document.body).scrollTop,t=Math.max(Math.abs(n-o.left),Math.abs(n-o.right)),i=Math.max(Math.abs(e-o.top),Math.abs(e-o.bottom)),i=2*(t=Math.sqrt(t*t+i*i))+"px",n=n-o.left-t,e=e-o.top-t,this.rippleOptions&&this.rippleOptions.isCenterRipple&&(e=n=0,i="100%"),r.classList.add("e-ripple"),o=Q("div",{className:"e-ripple-element",styles:"width: "+i+";height: "+i+";left: "+n+"px;top: "+e+"px;transition-duration: "+this.rippleOptions.duration.toString()+"ms;"}),r.appendChild(o),window.getComputedStyle(o).getPropertyValue("opacity"),o.style.transform="scale(1)",r!==this.parent&&E.add(r,"mouseleave",Wt,{parent:this.parent,rippleOptions:this.rippleOptions}))}function jt(e){Qt(e,this)}function Wt(e){Qt(e,this)}function Qt(e,t){var i,n=t.rippleOptions.duration,o=e.target,r=t.rippleOptions.selector,s=r?z(o,r):o;s&&-1!==s.className.indexOf("e-ripple")&&(r=ct(".e-ripple-element",s),(i=r[r.length-1])&&(i.style.opacity="0.5"),t.parent!==s&&E.remove(s,"mouseleave",Wt),setTimeout(function(){i&&i.parentNode&&i.parentNode.removeChild(i),s.getElementsByClassName("e-ripple-element").length||s.classList.remove("e-ripple"),t.done&&t.done(e)},n))}var Ut,qt,Gt=!1;function Yt(e){return Gt=e}(W=qt=qt||{}).Default="Default",W.Enable="Enable",W.Disable="Disable";Kt.prototype.inject=function(e,t){var i=e.length;if(0===i)this.clean();else{this.loadedModules.length&&this.clearUnusedModule(e);for(var n=0;n<i;n++)for(var o=e[parseInt(n.toString(),10)],r=0,s=t;r<s.length;r++){var a,l=s[r],h=o.member;l&&l.prototype.getModuleName()===o.member&&!this.isModuleLoaded(h)&&(a=y(l,o.args),h=this.getMemberName(h),o.isProperty?x(h,l,this.parent):x(h,a,this.parent),(l=o).member=h,this.loadedModules.push(l))}}},Kt.prototype.clean=function(){for(var e=0,t=this.loadedModules;e<t.length;e++){var i=t[e];i.isProperty||R(i.member,this.parent).destroy()}this.loadedModules=[]},Kt.prototype.getNonInjectedModules=function(e){var t=this;return e.filter(function(e){return!t.isModuleLoaded(e.member)})},Kt.prototype.clearUnusedModule=function(e){for(var t=this,i=e.map(function(e){return t.getMemberName(e.member)}),n=0,o=this.loadedModules.filter(function(e){return-1===i.indexOf(e.member)});n<o.length;n++){var r=o[n];r.isProperty||R(r.member,this.parent).destroy(),this.loadedModules.splice(this.loadedModules.indexOf(r),1),b(this.parent,r.member)}},Kt.prototype.getMemberName=function(e){return e[0].toLowerCase()+e.substring(1)+"Module"},Kt.prototype.isModuleLoaded=function(e){for(var t=0,i=this.loadedModules;t<i.length;t++)if(i[t].member===this.getMemberName(e))return!0;return!1};var Xt=Kt;function Kt(e){this.loadedModules=[],this.parent=e}$t.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)},$t.prototype.updateTimeOut=function(){var e;this.parentObj.updateTimeOut?(this.parentObj.finalUpdate(),this.parentObj.updateTimeOut()):(e=setTimeout(this.parentObj.dataBind.bind(this.parentObj)),this.finalUpdate=function(){clearTimeout(e)})},$t.prototype.clearChanges=function(){this.finalUpdate(),this.updateChange(!1,this.propName),this.oldProperties={},this.changedProperties={}},$t.prototype.setProperties=function(e,t){!0===t?(I(this,e),this.updateChange(!1,this.propName),this.clearChanges()):I(this,e)},$t.prototype.dataBind=function(){var e;this.callChildDataBind(this.childChangedProperties,this),this.isParentArray?(e=this.parentObj[this.propName].indexOf(this),Object.keys(this.changedProperties).length&&(x(this.propName+"."+e,this.changedProperties,this.parentObj.changedProperties),x(this.propName+"."+e,this.oldProperties,this.parentObj.oldProperties))):(this.parentObj.changedProperties[this.propName]=this.changedProperties,this.parentObj.oldProperties[this.propName]=this.oldProperties),this.clearChanges()},$t.prototype.saveChanges=function(e,t,i,n){this.controlParent.isProtectedOnChange||(n||this.serverDataBind(e,t,!0),this.oldProperties[""+e]=i,this.changedProperties[""+e]=t,this.updateChange(!0,this.propName),this.finalUpdate(),this.updateTimeOut())},$t.prototype.serverDataBind=function(e,t,i,n){if(N&&!this.parentObj.isComplexArraySetter){var o={},i=i?this.getParentKey(!0)+"."+e:e;if(-1!==i.indexOf("."))for(var r=i.split("."),s=o,a=0;a<r.length;a++){var l=a===r.length-1;s[r[parseInt(a.toString(),10)]]=l?t:{},s=l?s:s[r[parseInt(a.toString(),10)]]}else o[""+i]={},s=o[""+i],o[""+i][""+e]=t;this.isParentArray&&(s.ejsAction=n||"none"),this.controlParent.serverDataBind(o)}},$t.prototype.getParentKey=function(e){var t,i="",n=this.propName;return this.isParentArray&&(i=this.parentObj[this.propName].indexOf(this),t=this.parentObj[this.propName].length,t=e?t:0<t?t-1:0,n+=i=-1!==i?"-"+i:"-"+t),n=this.controlParent!==this.parentObj?this.parentObj.getParentKey()+"."+this.propName+i:n};var Jt,Zt,n=$t;function $t(e,t,i,n){this.isComplexArraySetter=!1,this.properties={},this.changedProperties={},this.childChangedProperties={},this.oldProperties={},this.finalUpdate=function(){},this.callChildDataBind=R("callChildDataBind",Ct),this.parentObj=e,this.controlParent=this.parentObj.controlParent||this.parentObj,this.propName=t,this.isParentArray=n,this.setProperties(i,!0)}W=Jt=Jt||{},Zt=[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],W.getHijriDate=function(e){var t=e.getDate(),i=e.getMonth(),n=i+1,e=e.getFullYear();n<3&&(--e,n+=12);var o=(r=Math.floor(e/100))-Math.floor(r/4)-2,n=(e=Math.floor(365.25*(e+4716))+Math.floor(30.6001*(n+1))+t-o-1524)+((r=Math.floor((e-1867216.25)/36524.25))-Math.floor(r/4)+1)+1524,t=Math.floor((n-122.1)/365.25),o=Math.floor(365.25*t),r=Math.floor((n-o)/30.6001),s=(Math.floor(30.6001*r),13<(i=Math.floor((n-o)/20.6001))&&(t+=1,i-=12),--i,e-24e5),r=e-1948084,n=Math.floor(r/10631),o=(r-=10631*n,Math.floor((r-.1335)/(10631/30))),t=30*n+o;r-=Math.floor(o*(10631/30)+.1335);13===(i=Math.floor((28.5001+r)/29.5))&&(i=12);for(var e=r-Math.floor(29.5001*i-29),a=0;a<Zt.length&&!(Zt[parseInt(a.toString(),10)]>s);a++);return n=a+16260,o=Math.floor((n-1)/12),r=o+1,n-=12*o,2<((o=s-Zt[a-1]+1)+"").length&&(o=e,n=i,r=t),{year:r,month:n,date:o}},W.toGregorian=function(e,t,i){var i=Math.floor(.5+(24e5+(i+Zt[12*(e-1)+1+(t-1)-16260-1]-1))),e=Math.floor((i-1867216.25)/36524.25),t=1524+(i+1+e-Math.floor(e/4)),i=Math.floor((t-122.1)/365.25),e=Math.floor(365.25*i),n=Math.floor((t-e)/30.6001),t=t-e-Math.floor(30.6001*n);return(n=i-(2.5<(e=n-(13.5<n?13:1))?4716:4715))<=0&&e--,new Date(n+"/"+e+"/"+t)};var ei=/\/MMMMM|MMMM|MMM|a|LLLL|LLL|EEEEE|EEEE|E|K|cccc|ccc|WW|W|G+|z+/gi,ti="stand-alone",ii=["sun","mon","tue","wed","thu","fri","sat"],ni={m:"getMinutes",h:"getHours",H:"getHours",s:"getSeconds",d:"getDate",f:"getMilliseconds"},oi={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"},ri=(si.dateFormat=function(e,t,i){var n=this,o=ce.getDependables(i,e,t.calendar),r=R("parserObject.numbers",o),s=o.dateObject,a={isIslamic:ce.islamicRegex.test(t.calendar)},t=(a.firstDayOfWeek=ce.getWeekData(e,i),(t=N&&t.isServerRendered?ce.compareBlazorDateFormats(t,e):t).format||ce.getResultantPattern(t.skeleton,o.dateObject,t.type,!1,N?e:""));if(a.dateSeperator=N?R("dateSeperator",s):ce.getDateSeparator(o.dateObject),ee(t))O("Format options or type given must be invalid");else{t=ce.ConvertDateToWeekFormat(t),N&&(t=t.replace(/tt/,"a")),a.pattern=t,a.numMapper=N?Pe({},r):$.getNumberMapper(o.parserObject,$.getNumberingSystem(i));for(var l=0,h=t.match(ei)||[];l<h.length;l++){var d=h[l],p=d.length,d=d[0];switch(d="K"===d?"h":d){case"E":case"c":a.weekday=N?R("days."+ce.monthIndex[""+p],s):o.dateObject[""+ce.days][ti][ce.monthIndex[""+p]];break;case"M":case"L":a.month=N?R("months."+ce.monthIndex[""+p],s):o.dateObject[""+ce.month][ti][ce.monthIndex[""+p]];break;case"a":a.designator=R(N?"dayPeriods":"dayPeriods.format.wide",s);break;case"G":var c=p<=3?"eraAbbr":4===p?"eraNames":"eraNarrow";a.era=N?R("eras",s):R("eras."+c,o.dateObject);break;case"z":a.timeZone=R("dates.timeZoneNames",o.parserObject)}}}return function(e){return isNaN(e.getDate())?null:n.intDateFormatter(e,a)}},si.intDateFormatter=function(e,t){for(var i="",n=t.pattern.match(ce.dateParseRegex),o=this.getCurrentDateValue(e,t.isIslamic),r=0,s=n;r<s.length;r++){var a=s[r],l=a.length,h=a[0],d=void 0,p="",c=void 0,u=void 0,g="";switch(h="K"===h?"h":h){case"M":case"L":d=o.month,2<l?i+=t.month[""+d]:c=!0;break;case"E":case"c":i+=t.weekday[""+ii[e.getDay()]];break;case"H":case"h":case"m":case"s":case"d":case"f":if(c=!0,"d"===h)d=o.date;else if("f"===h){var u=!(c=!1),m=(p=(p=e[""+ni[""+h]]().toString()).substring(0,l)).length;if(l!==m){if(3<l)continue;for(var f=0;f<l-m;f++)p="0"+p.toString()}g+=p}else d=e[""+ni[""+h]]();"h"===h&&(d=d%12||12);break;case"y":u=!0,g+=o.year,2===l&&(g=g.substr(g.length-2));break;case"a":var y=e.getHours()<12?"am":"pm";i+=t.designator[y];break;case"G":var y=e.getFullYear()<0?0:1,v=t.era[""+y];i+=(v=je(v)?t.era[y?0:1]:v)||"";break;case"'":i+="''"===a?"'":a.replace(/'/g,"");break;case"z":var v=e.getTimezoneOffset(),b=(b=l<4?"+H;-H":t.timeZone.hourFormat).replace(/:/g,t.numMapper.timeSeparator);0===v?i+=t.timeZone.gmtZeroFormat:(u=!0,g=this.getTimeZoneValue(v,b)),g=t.timeZone.gmtFormat.replace(/\{0\}/,g);break;case":":i+=t.numMapper.numberSymbols.timeSeparator;break;case"/":i+=t.dateSeperator;break;case"W":c=!0,d=ce.getWeekOfYear(e,t.firstDayOfWeek);break;default:i+=a}c&&(u=!0,g=this.checkTwodigitNumber(d,l)),u&&(i+=$.convertValueParts(g,ce.latnParseRegex,t.numMapper.mapper))}return i},si.getCurrentDateValue=function(e,t){return t?Jt.getHijriDate(e):{year:e.getFullYear(),month:e.getMonth()+1,date:e.getDate()}},si.checkTwodigitNumber=function(e,t){e+="";return 2===t&&2!==e.length?"0"+e:e},si.getTimeZoneValue=function(e,t){var i=this,t=t.split(";")[0<e?1:0],n=Math.abs(e);return t.replace(/HH?|mm/g,function(e){var t=e.length,e=-1!==e.indexOf("H");return i.checkTwodigitNumber(Math.floor(e?n/60:n%60),t)})},si);function si(){}pe(ri);var ai={ms:"minimumSignificantDigits",ls:"maximumSignificantDigits",mf:"minimumFractionDigits",lf:"maximumFractionDigits"},li=["infinity","nan","group","decimal","exponential"],hi=(di.numberFormatter=function(e,t,i){var n,o=this,r=Pe({},t),s={},a={},e=ce.getDependables(i,e,"",!0),l=e.numericObject,h=(a.numberMapper=N?Pe({},l):$.getNumberMapper(e.parserObject,$.getNumberingSystem(i),!0),a.currencySymbol=N?R("currencySymbol",l):ce.getCurrencySymbol(e.numericObject,r.currency||oe,t.altSymbol,t.ignoreCurrency),a.percentSymbol=N?R("numberSymbols.percentSign",l):a.numberMapper.numberSymbols.percentSign,a.minusSymbol=N?R("numberSymbols.minusSign",l):a.numberMapper.numberSymbols.minusSign,a.numberMapper.numberSymbols);return t.format&&!ce.formatRegex.test(t.format)?(s=ce.customFormat(t.format,a,e.numericObject),!ee(r.useGrouping)&&r.useGrouping&&(r.useGrouping=s.pData.useGrouping)):(Pe(r,ce.getProperNumericSkeleton(t.format||"N")),r.isCurrency="currency"===r.type,r.isPercent="percent"===r.type,N||(n=ce.getSymbolPattern(r.type,a.numberMapper.numberSystem,e.numericObject,r.isAccount)),r.groupOne=this.checkValueRange(r.maximumSignificantDigits,r.minimumSignificantDigits,!0),this.checkValueRange(r.maximumFractionDigits,r.minimumFractionDigits,!1,!0),ee(r.fractionDigits)||(r.minimumFractionDigits=r.maximumFractionDigits=r.fractionDigits),ee(r.useGrouping)&&(r.useGrouping=!0),r.isCurrency&&!N&&(n=n.replace(/\u00A4/g,ce.defaultCurrency)),N?(s.nData=Pe({},{},R(r.type+"nData",l)),s.pData=Pe({},{},R(r.type+"pData",l)),"currency"===r.type&&t.currency&&ce.replaceBlazorCurrency([s.pData,s.nData],a.currencySymbol,t.currency)):(i=n.split(";"),s.nData=ce.getFormatData(i[1]||"-"+i[0],!0,a.currencySymbol),s.pData=ce.getFormatData(i[0],!1,a.currencySymbol),r.useGrouping&&(r.groupSeparator=h[li[2]],r.groupData=this.getGroupingDetails(i[0]))),ee(r.minimumFractionDigits)&&(r.minimumFractionDigits=s.nData.minimumFraction),ee(r.maximumFractionDigits)&&(e=s.nData.maximumFraction,r.maximumFractionDigits=ee(e)&&r.isPercent?0:e),l=r.minimumFractionDigits,n=r.maximumFractionDigits,ee(l)||ee(n)||n<l&&(r.maximumFractionDigits=l)),Pe(s.nData,r),Pe(s.pData,r),function(e){return isNaN(e)?h[li[1]]:isFinite(e)?o.intNumberFormatter(e,s,a,t):h[li[0]]}},di.getGroupingDetails=function(e){var t,i,n={},e=e.match(ce.negativeDataRegex);return e&&e[4]&&-1!==(t=(e=e[4]).lastIndexOf(","))&&(i=e.split(".")[0],n.primary=i.length-t-1,-1!==(i=e.lastIndexOf(",",t-1)))&&(n.secondary=t-1-i),n},di.checkValueRange=function(e,t,i,n){var o=n?"f":"s",r=0,s=ai["l"+o],o=ai["m"+o];if(ee(e)||(this.checkRange(e,s,n),r++),ee(t)||(this.checkRange(t,o,n),r++),2===r){if(!(e<t))return!0;O(o+"specified must be less than the"+s)}else i&&1===r&&O("Both"+o+"and"+o+"must be present");return!1},di.checkRange=function(e,t,i){i=i?[0,20]:[1,21];(e<i[0]||i[1]<e)&&O(t+"value must be within the range"+i[0]+"to"+i[1])},di.intNumberFormatter=function(e,t,i,n){if(!ee(t.nData.type)){var o,r="";if((o=e<0?(e*=-1,t.nData):0===e&&t.zeroData||t.pData).isPercent&&(e*=100),o.groupOne)r=this.processSignificantDigits(e,o.minimumSignificantDigits,o.maximumSignificantDigits);else if(r=this.processFraction(e,o.minimumFractionDigits,o.maximumFractionDigits,n),o.minimumIntegerDigits&&(r=this.processMinimumIntegers(r,o.minimumIntegerDigits)),i.isCustomFormat&&o.minimumFractionDigits<o.maximumFractionDigits&&/\d+\.\d+/.test(r)){for(var t=r.split("."),s=t[1],a=s.length-1;0<=a&&("0"===s[parseInt(a.toString(),10)]&&a>=o.minimumFractionDigits);a--)s=s.slice(0,a);r=t[0]+"."+s}return r=(r="scientific"===o.type?(r=e.toExponential(o.maximumFractionDigits)).replace("e",i.numberMapper.numberSymbols[li[4]]):r).replace(".",i.numberMapper.numberSymbols[li[3]]),r="#,###,,;(#,###,,)"===o.format?this.customPivotFormat(parseInt(r,10)):r,o.useGrouping&&(r=this.groupNumbers(r,o.groupData.primary,o.groupSeparator||",",i.numberMapper.numberSymbols[li[3]]||".",o.groupData.secondary)),r=$.convertValueParts(r,ce.latnParseRegex,i.numberMapper.mapper),"N/A"===o.nlead?o.nlead:"0"===r&&n&&"0"===n.format?r+o.nend:o.nlead+r+o.nend}},di.processSignificantDigits=function(e,t,i){return(e+"").length<t?e.toPrecision(t):+e.toPrecision(i)+""},di.groupNumbers=function(e,t,i,n,o){for(var r=!je(o)&&0!==o,e=e.split(n),s=e[0],a=s.length,l="";t<a;)l=s.slice(a-t,a)+(l.length?i+l:""),a-=t,r&&(t=o,r=!1);return e[0]=s.slice(0,a)+(l.length?i:"")+l,e.join(n)},di.processFraction=function(e,t,i,n){var o=(e+"").split(".")[1],r=o?o.length:0;if(t&&r<t){var s="";if(0===r)return s=e.toFixed(t),e.toFixed(t);s+=e;for(var a=0;a<t-r;a++)s+="0";return s}return!je(i)&&(i<r||0===i)?e.toFixed(i):"0"===(o=e+"")[0]&&n&&"###.00"===n.format?o.slice(1):o},di.processMinimumIntegers=function(e,t){var e=e.split("."),i=e[0],n=i.length;if(n<t){for(var o=0;o<t-n;o++)i="0"+i;e[0]=i}return e.join(".")},di.customPivotFormat=function(e){var t;return 5e5<=e?((t=(e/=1e6).toString().split("."))[0],((t=t[1])&&5<=+t.substring(0,1)?Math.ceil(e):Math.floor(e)).toString()):""},di);function di(){}de(hi);var pi="stand-alone",ci=/^[0-9]*$/,ui={minute:"setMinutes",hour:"setHours",second:"setSeconds",day:"setDate",month:"setMonth",milliseconds:"setMilliseconds"},gi=(mi.dateParser=function(e,t,i){var a=this,n=ce.getDependables(i,e,t.calendar),l=$.getCurrentNumericOptions(n.parserObject,$.getNumberingSystem(i),!1,N),h={},o="";if(ee(r=(t=N&&t.isServerRendered?ce.compareBlazorDateFormats(t,e):t).format||ce.getResultantPattern(t.skeleton,n.dateObject,t.type,!1,N?e:"")))O("Format options or type given must be invalid");else for(var r=ce.ConvertDateToWeekFormat(r),h={isIslamic:ce.islamicRegex.test(t.calendar),pattern:r,evalposition:{},culture:e},s=r.match(ce.dateParseRegex)||[],d=s.length,p=0,c=0,u=!1,g=l.numericRegex,m=N?n.parserObject.numbers:$.getNumberMapper(n.parserObject,$.getNumberingSystem(i)),f=0;f<d;f++){var y,v=s[parseInt(f.toString(),10)],b=v.length,w="K"===v[0]?"h":v[0],C=void 0,S=void 0,A=oi[""+w],x=2===b?"":"?";switch(u&&(p=c,u=!1),w){case"E":case"c":var I=void 0,I=N?R("days."+ce.monthIndex[""+b],n.dateObject):n.dateObject[""+ce.days][pi][ce.monthIndex[""+b]],I=$.reverseObject(I);o+="("+Object.keys(I).join("|")+")";break;case"M":case"L":case"d":case"m":case"s":case"h":case"H":case"f":if(S=!0,("M"===w||"L"===w)&&2<b){I=void 0,I=N?R("months."+ce.monthIndex[""+b],n.dateObject):n.dateObject.months[pi][ce.monthIndex[""+b]];h[""+A]=$.reverseObject(I),o+="("+Object.keys(h[""+A]).join("|")+")"}else if("f"===w){if(3<b)continue;C=!0,o+="("+g+g+"?"+g+"?)"}else C=!0,o+="("+g+g+x+")";"h"===w&&(h.hour12=!0);break;case"W":o+="("+g+(1===b?"?":"")+g+")";break;case"y":S=C=!0,o+=2===b?"("+g+g+")":"("+g+"{"+b+",})";break;case"a":var S=!0,T=R(N?"dayPeriods":"dayPeriods.format.wide",n.dateObject);h[""+A]=$.reverseObject(T),o+="("+Object.keys(h[""+A]).join("|")+")";break;case"G":S=!0,h[""+A]=$.reverseObject(R(N?"eras":"eras."+(b<=3?"eraAbbr":4===b?"eraNames":"eraNarrow"),n.dateObject)),o+="("+Object.keys(h[""+A]).join("|")+"?)";break;case"z":S=0!==(new Date).getTimezoneOffset(),h[""+A]=R("dates.timeZoneNames",n.parserObject);var E,T=h[""+A],D=(D=(E=b<4)?"+H;-H":T.hourFormat).replace(/:/g,m.timeSeparator);o+="("+this.parseTimeZoneRegx(D,T,g)+")?",u=!0,c=E?6:12;break;case"'":o+="("+v.replace(/'/g,"")+")?";break;default:o+="([\\D])"}S&&(h.evalposition[""+A]={isNumber:C,pos:f+1+p,hourOnly:E}),f!==d-1||je(o)||(y=RegExp,h.parserRegex=new y("^"+o+"$","i"))}return function(e){var t,i,n,o,r,s,e=a.internalDateParse(e,h,l);return je(e)||!Object.keys(e).length?null:(h.isIslamic&&(t={},i=e.year,n=e.day,o=e.month,s=2===(r=i?i+"":"").length,i&&o&&n&&!s||(t=Jt.getHijriDate(new Date)),s&&(i=parseInt((t.year+"").slice(0,2)+r,10)),s=Jt.toGregorian(i||t.year,o||t.month,n||t.date),e.year=s.getFullYear(),e.month=s.getMonth()+1,e.day=s.getDate()),a.getDateObject(e))}},mi.getDateObject=function(e,t){var i=t||new Date,t=(i.setMilliseconds(0),e.year),n=e.designator,o=e.timeZone;ee(t)||((t+"").length<=2&&(t+=100*Math.floor(i.getFullYear()/100)),i.setFullYear(t));for(var r=0,s=["hour","minute","second","milliseconds","month","day"];r<s.length;r++){var a=s[r],l=e[""+a];if(ee(l)&&"day"===a&&i.setDate(1),!ee(l))if("month"===a){if(--l<0||11<l)return new Date("invalid");var h=i.getDate(),d=(i.setDate(1),i[ui[""+a]](l),new Date(i.getFullYear(),l+1,0).getDate());i.setDate(h<d?h:d)}else{if("day"===a){h=new Date(i.getFullYear(),i.getMonth()+1,0).getDate();if(l<1||h<l)return null}i[""+ui[""+a]](l)}}return ee(n)||(t=i.getHours(),"pm"===n?i.setHours(t+(12===t?0:12)):12===t&&i.setHours(0)),ee(o)||0!=(n=o-i.getTimezoneOffset())&&i.setMinutes(i.getMinutes()+n),i},mi.internalDateParse=function(e,t,i){var n=e.match(t.parserRegex),o={hour:0,minute:0,second:0};if(je(n))return null;for(var r=0,s=Object.keys(t.evalposition);r<s.length;r++){var a,l,h,d=s[r],p=t.evalposition[""+d],c=n[p.pos];p.isNumber?o[""+d]=this.internalNumberParser(c,i):"timeZone"!==d||ee(c)?(c="month"!==d||t.isIslamic||"en"!==t.culture&&"en-GB"!==t.culture&&"en-US"!==t.culture?c:c[0].toUpperCase()+c.substring(1).toLowerCase(),c="month"!==d&&"designator"===d&&t.culture&&-1!==t.culture.indexOf("en-")&&-1===["en-US","en-MH","en-MP"].indexOf(t.culture)?c.toLowerCase():c,o[""+d]=t[""+d][""+c]):(c=void 0,h=!ee(l=n[(a=p.pos)+1]),p.hourOnly?c=60*this.getZoneValue(h,l,n[a+4],i):(c=60*this.getZoneValue(h,l,n[a+7],i),c+=this.getZoneValue(h,n[a+4],n[a+10],i)),je(c)||(o[""+d]=c))}return t.hour12&&(o.hour12=!0),o},mi.internalNumberParser=function(e,t){return e=$.convertValueParts(e,t.numberParseRegex,t.numericPair),ci.test(e)?+e:null},mi.parseTimeZoneRegx=function(e,t,i){var n=t.gmtFormat,i="("+i+")("+i+")",o=e.replace("+","\\+");return o=(o=-1!==e.indexOf("HH")?o.replace(/HH|mm/g,"("+i+")"):o.replace(/H|m/g,"("+i+"?)")).split(";").map(function(e){return n.replace("{0}",e)}).join("|")+"|"+t.gmtZeroFormat},mi.getZoneValue=function(e,t,i,n){t=e?t:i;return t?(i=this.internalNumberParser(t,n),e?-i:i):0},mi);function mi(){}var fi=new RegExp("^([^0-9]*)(([0-9,]*[0-9]+)(.[0-9]+)?)([Ee][+-]?[0-9]+)?([^0-9]*)$"),yi=/,/g,vi=["minusSign","infinity"],bi=(wi.numberParser=function(e,t,i){var n=this,e=ce.getDependables(i,e,"",!0),o={custom:!0},r=(ce.formatRegex.test(t.format)||!t.format?(Pe(o,ce.getProperNumericSkeleton(t.format||"N")),o.custom=!1,o.fractionDigits||t.maximumFractionDigits&&(o.maximumFractionDigits=t.maximumFractionDigits)):Pe(o,ce.customFormat(t.format,null,null)),R("numbers",e.parserObject)),s=$.getCurrentNumericOptions(e.parserObject,$.getNumberingSystem(i),!0,N);return o.symbolRegex=$.getSymbolRegex(Object.keys(s.symbolMatch)),o.infinity=s.symbolNumberSystem[vi[1]],N?(o.nData=Pe({},{},R(o.type+"nData",r)),o.pData=Pe({},{},R(o.type+"pData",r)),"currency"===o.type&&t.currency&&ce.replaceBlazorCurrency([o.pData,o.nData],R("currencySymbol",r),t.currency)):(i=ce.getSymbolPattern(o.type,s.numberSystem,e.numericObject,o.isAccount))&&(r=(i=i.replace(/\u00A4/g,ce.defaultCurrency)).split(";"),o.nData=ce.getFormatData(r[1]||"-"+r[0],!0,""),o.pData=ce.getFormatData(r[0],!0,"")),function(e){return n.getParsedNumber(e,o,s)}},wi.getParsedNumber=function(e,t,i){var n,o;return-1!==e.indexOf(t.infinity)?1/0:(e=$.convertValueParts(e,t.symbolRegex,i.symbolMatch),je(i=(e=0===(e=-1!==(e=$.convertValueParts(e,i.numberParseRegex,i.numericPair)).indexOf("-")?e.replace("-.","-0."):e).indexOf(".")?"0"+e:e).match(fi))?NaN:(e=i[1],n=i[2],o=i[5],i=i[6],i=((e=t.custom?e===t.nData.nlead&&i===t.nData.nend:-1!==e.indexOf(t.nData.nlead)&&-1!==i.indexOf(t.nData.nend))?t.nData:t.pData).isPercent,n=n.replace(yi,""),o&&(n+=o),o=+n,"percent"!==t.type&&!i||(o/=100),(t.custom||t.fractionDigits)&&(o=parseFloat(o.toFixed(t.custom?(e?t.nData:t.pData).maximumFractionDigits:t.fractionDigits))),t.maximumFractionDigits&&(o=this.convertMaxFracDigits(n,t,o,e)),e&&(o*=-1),o))},wi.convertMaxFracDigits=function(e,t,i,n){e=e.split(".");return i=e[1]&&e[1].length>t.maximumFractionDigits?+i.toFixed((t.custom?n?t.nData:t.pData:t).maximumFractionDigits):i},wi);function wi(){}var Ci=new yt,Si=!1,Ai={},xi="en-US",Ii=["numericObject","dateObject"],Ti=(Ei.prototype.getDateFormat=function(e){return ri.dateFormat(this.getCulture(),e||{type:"date",skeleton:"short"},Ai)},Ei.prototype.getNumberFormat=function(e){return e&&!e.currency&&(e.currency=oe),N&&e&&!e.format&&(e.minimumFractionDigits=0),hi.numberFormatter(this.getCulture(),e||{},Ai)},Ei.prototype.getDateParser=function(e){return gi.dateParser(this.getCulture(),e||{skeleton:"short",type:"date"},Ai)},Ei.prototype.getNumberParser=function(e){return N&&e&&!e.format&&(e.minimumFractionDigits=0),bi.numberParser(this.getCulture(),e||{format:"N"},Ai)},Ei.prototype.formatNumber=function(e,t){return this.getNumberFormat(t)(e)},Ei.prototype.formatDate=function(e,t){return this.getDateFormat(t)(e)},Ei.prototype.parseDate=function(e,t){return this.getDateParser(t)(e)},Ei.prototype.parseNumber=function(e,t){return this.getNumberParser(t)(e)},Ei.prototype.getDatePattern=function(e,t){return ce.getActualDateTimeFormat(this.getCulture(),e,Ai,t)},Ei.prototype.getNumberPattern=function(e,t){return ce.getActualNumberFormat(this.getCulture(),e,Ai,t)},Ei.prototype.getFirstDayOfWeek=function(){return ce.getWeekData(this.getCulture(),Ai)},Ei.prototype.getCulture=function(){return this.culture||xi},Ei);function Ei(e){e&&(this.culture=e)}function Di(e){xi=e,Ci.notify("notifyExternalChange",{locale:xi})}function Mi(e,t){var i=ce.getDependables(Ai,e,"",!0)[Ii[0]],e=ce.getDependables(Ai,e,"")[Ii[1]],n=R("defaultNumberingSystem",i),o=R(N?"numberSymbols":"symbols-numberSystem-"+n,i),t=ce.getSymbolPattern(t||"decimal",n,i,!1);return Pe(o,ce.getFormatData(t,!0,"",!0),{dateSeparator:ce.getDateSeparator(e)})}function ki(e,t){e=ce.getDependables(Ai,e,"",!0);return ce.getCurrencySymbol(e.numericObject,t)}function Pi(e){return ce.getDependables(Ai,"",e,!1)[Ii[1]]}var Bi,Fi=["grid","pivotview","treegrid","spreadsheet","rangeNavigator","DocumentEditor","listbox","inplaceeditor","PdfViewer","richtexteditor","DashboardLayout","chart","stockChart","circulargauge","diagram","heatmap","lineargauge","maps","slider","smithchart","barcode","sparkline","treemap","bulletChart","kanban","daterangepicker","schedule","gantt","signature","query-builder","drop-down-tree","carousel","filemanager","uploader","accordion","tab","treeview"],Li=[115,121,110,99,102,117,115,105,111,110,46,105,115,76,105,99,86,97,108,105,100,97,116,101,100],Ri=(Oi.prototype.validate=function(){if(!this.isValidated&&w&&!R(Vi(Li),w)&&!R("Blazor",w)){var e=void 0,t=void 0;if(this.manager&&this.manager.getKey()||this.npxManager&&"npxKeyReplace"!==this.npxManager.getKey()){var i=this.getInfoFromKey();if(i&&i.length)for(var n=0,o=i;n<o.length;n++){var r=o[n];if(!this.platform.test(r.platform)||r.invalidPlatform)e=this.errors.platformMismatched;else if(!(r.minVersion>=r.lastValue&&r.minVersion!==r.lastValue||r.lastValue<parseInt(this.version,10))&&null!=r.lastValue&&!isNaN(r.lastValue)||(e=(e=(e=this.errors.versionMismatched).replace("##LicenseVersion",r.version)).replace("##Requireversion",this.version+".x")),r.expiryDate){var r=new Date(r.expiryDate),s=new Date;if(!(r!==s&&r<s))break;e=this.errors.trailExpired}}else e=this.errors.invalidKey}else var i=R(Vi([115,121,110,99,102,117,115,105,111,110,46,108,105,99,101,110,115,101,67,111,110,116,101,110,116]),w),t=R(Vi([115,121,110,99,102,117,115,105,111,110,46,99,108,97,105,109,65,99,99,111,117,110,116,85,82,76]),w),e=i&&""!==i?i:this.errors.noLicense;e&&"undefined"!=typeof document&&!je(document)&&((i=Q("div",{innerHTML:"<img src='data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzE5OV80KSI+CjxwYXRoIGQ9Ik0xMiAyMUMxNi45NzA2IDIxIDIxIDE2Ljk3MDYgMjEgMTJDMjEgNy4wMjk0NCAxNi45NzA2IDMgMTIgM0M3LjAyOTQ0IDMgMyA3LjAyOTQ0IDMgMTJDMyAxNi45NzA2IDcuMDI5NDQgMjEgMTIgMjFaIiBzdHJva2U9IiM3MzczNzMiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0xMS4yNSAxMS4yNUgxMlYxNi41SDEyLjc1IiBmaWxsPSIjNjE2MDYzIi8+CjxwYXRoIGQ9Ik0xMS4yNSAxMS4yNUgxMlYxNi41SDEyLjc1IiBzdHJva2U9IiM3MzczNzMiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0xMS44MTI1IDlDMTIuNDMzOCA5IDEyLjkzNzUgOC40OTYzMiAxMi45Mzc1IDcuODc1QzEyLjkzNzUgNy4yNTM2OCAxMi40MzM4IDYuNzUgMTEuODEyNSA2Ljc1QzExLjE5MTIgNi43NSAxMC42ODc1IDcuMjUzNjggMTAuNjg3NSA3Ljg3NUMxMC42ODc1IDguNDk2MzIgMTEuMTkxMiA5IDExLjgxMjUgOVoiIGZpbGw9IiM3MzczNzMiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xOTlfNCI+CjxyZWN0IHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K' style=\"top: 6px;\n                    position: absolute;\n                    left: 16px;\n                    width: 24px;\n                    height: 24px;\"/>"+e+' <a style="text-decoration: none;color: #0D6EFD;font-weight: 500;" href='+(Bi=t&&""!==t?t:"https://www.syncfusion.com/account/claim-license-key?pl=SmF2YVNjcmlwdA==&vs=Mjk=&utm_source=es_license_validation_banner&utm_medium=listing&utm_campaign=license-information")+">Claim your free account</a>"})).setAttribute("style","position: fixed;\n                top: 10px;\n                left: 10px;\n                right: 10px;\n                font-size: 14px;\n                background: #EEF2FF;\n                color: #222222;\n                z-index: 999999999;\n                text-align: left;\n                border: 1px solid #EEEEEE;\n                padding: 10px 11px 10px 50px;\n                border-radius: 8px;\n                font-family: Helvetica Neue, Helvetica, Arial;"),document.body.appendChild(i),this.isLicensed=!1),this.isValidated=!0,x(Vi(Li),this.isValidated,w)}return this.isLicensed},Oi.prototype.getDecryptedData=function(e){try{return atob(e)}catch(e){return""}},Oi.prototype.getInfoFromKey=function(){try{for(var e=[5439488,7929856,5111808,6488064,4587520,7667712,5439488,6881280,5177344,7208960,4194304,4456448,6619136,7733248,5242880,7077888,6356992,7602176,4587520,7274496,7471104,7143424],t=[],i=[],n=!1,o=!1,r=(this.manager.getKey()?this.manager.getKey():(o=!0,this.npxManager.getKey().split("npxKeyReplace")[1])).split(";"),s=0,a=r;s<a.length;s++){var l=a[s],h=this.getDecryptedData(l);if(h){var d,p,c=0,u="";if(o){for(var g=h[h.length-1],m=[],f=0;f<h.length;f++)m[parseInt(f.toString(),10)]=h[parseInt(f.toString(),10)].charCodeAt(0)-g.charCodeAt(0);for(f=0;f<m.length;f++)u+=String.fromCharCode(m[parseInt(f.toString(),10)])}else for(var f=0;f<h.length;f++,c++){c===e.length&&(c=0);var y=h.charCodeAt(f);u+=String.fromCharCode(y^e[parseInt(c.toString(),10)]>>16)}this.platform.test(u)?(t=u.split(";"),n=!1,3<t.length&&(d=parseInt(t[1].split(".")[0],10),p=parseInt(t[4],10),i.push({platform:t[0],version:t[1],expiryDate:t[2],lastValue:p,minVersion:d}))):u&&3<u.split(";").length&&(n=!0)}}return n&&!i.length?[{invalidPlatform:n}]:i.length?i:null}catch(e){return null}},Oi);function Oi(e){var t,i;this.isValidated=!1,this.isLicensed=!0,this.version="29",this.platform=/JavaScript|ASPNET|ASPNETCORE|ASPNETMVC|FileFormats|essentialstudio/i,this.errors={noLicense:"<span>This application was built using a trial version of Syncfusion<sup>®</sup> Essential Studio<sup>®</sup>. To remove the license validation message permanently, a valid license key must be included.</span>",trailExpired:"<span>This application was built using a trial version of Syncfusion<sup>®</sup> Essential Studio<sup>®</sup>. To remove the license validation message permanently, a valid license key must be included.</span>",versionMismatched:"<span>The included Syncfusion<sup>®</sup> license key is invalid.</span>",platformMismatched:"<span>The included Syncfusion<sup>®</sup> license key is invalid.</span>",invalidKey:"<span>The included Syncfusion<sup>®</sup> license key is invalid.</span>"},this.minVersion=null,this.manager=(t=null,{setKey:function(e){t=e},getKey:function(){return t}}),this.npxManager=(i="npxKeyReplace",{getKey:function(){return i}}),this.manager.setKey(e)}var Ni=new Ri;function Vi(e){for(var t="",i=0,n=e;i<n.length;i++){var o=n[i];t+=String.fromCharCode(o)}return t}function _i(e){Ni=new Ri(e)}function Hi(e){return e&&_i(e),Ni.validate()}function zi(){var e;"undefined"==typeof document||je(document)||(e=Q("div",{innerHTML:'\n    <div style="\n    position: fixed;\n    width: 100%;\n    height: 100%;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background-color: rgba(0, 0, 0, 0.5);\n    z-index: 99999;\n    ">\n        <div style="\n    background: #FFFFFF;\n    height: 455px;\n    width: 840px;\n    font-family: Helvetica Neue, Helvetica, Arial;\n    color: #000000;\n    box-shadow: 0px 4.8px 14.4px rgb(0 0 0 / 18%), 0px 25.6px 57.6px rgb(0 0 0 / 22%);\n    display: block;\n    margin: 8% auto;\n    border-radius: 20px;\n    ">\n            <div style="\n    position: absolute;\nwidth: 838px;\nheight: 62px;\nbackground-color: #F9F9F9;\nborder: 1px solid #EEEEEE;\nborder-top-left-radius: 20px;\nborder-top-right-radius: 20px;\n">\n                <img src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQ2IiBoZWlnaHQ9IjMyIiB2aWV3Qm94PSIwIDAgMTQ2IDMyIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNNDAuNTk2NSAxNS4wMDc4SDMyLjQyNUMzMS41NTU3IDE1LjAwNzggMzAuOTAzNyAxNS4xODEyIDMwLjUxMjUgMTUuNDg0NkMzMC4xMjEzIDE1LjgzMTQgMjkuOTA0IDE2LjMwODIgMjkuOTA0IDE3LjA0NTFDMjkuOTA0IDE3LjYwODYgMzAuMDc3OCAxOC4wNDIxIDMwLjQyNTYgMTguMzAyMkMzMC43NzMzIDE4LjYwNTYgMzEuMjk0OSAxOC43MzU2IDMxLjk5MDMgMTguNzM1NkgzNi4zMzY5QzM4LjExODkgMTguNzM1NiAzOS40MjI5IDE5LjA4MjQgNDAuMTYxOCAxOS43MzI2QzQwLjk0NDIgMjAuNDI2MiA0MS4yOTE5IDIxLjU1MzIgNDEuMjkxOSAyMy4xMTM3QzQxLjI5MTkgMjQuNzE3NiA0MC44NTcyIDI1Ljg4OCAzOS45ODc5IDI2LjY2ODJDMzkuMTE4NiAyNy40MDUxIDM3LjcyNzcgMjcuNzk1MyAzNS44NTg3IDI3Ljc5NTNIMjcuMDc4N1YyNS4wMjFIMzUuMzM3MkMzNi4yOTM0IDI1LjAyMSAzNi45NDU0IDI0Ljg5MSAzNy4zMzY2IDI0LjYzMDlDMzcuNzI3NyAyNC4zNzA4IDM3LjkwMTYgMjMuODk0IDM3LjkwMTYgMjMuMjg3MUMzNy45MDE2IDIyLjYzNjkgMzcuNzI3NyAyMi4xNjAxIDM3LjM4IDIxLjlDMzcuMDMyMyAyMS42Mzk5IDM2LjQyMzggMjEuNDY2NSAzNS41NTQ1IDIxLjQ2NjVIMzEuNjQyNkMyOS44NjA1IDIxLjQ2NjUgMjguNTEzMSAyMS4xMTk4IDI3LjY4NzMgMjAuMzgyOEMyNi44NjE0IDE5LjY0NTkgMjYuNDI2OCAxOC41MTg5IDI2LjQyNjggMTcuMDAxN0MyNi40MjY4IDE1LjM1NDUgMjYuODYxNCAxNC4xNDA4IDI3LjczMDcgMTMuMzYwNkMyOC42IDEyLjU4MDMgMjkuOTkwOSAxMi4yMzM1IDMxLjkwMzQgMTIuMjMzNUg0MC41OTY1VjE1LjAwNzhaIiBmaWxsPSIjMzU0M0E4Ii8+CjxwYXRoIGQ9Ik00OC4wNzI3IDI1LjI4MTFINTAuNTA2OFYxNi4zOTQ5SDUzLjU0OTNWMjcuNTM1MkM1My41NDkzIDI5LjA1MjQgNTMuMjAxNiAzMC4xNzk0IDUyLjUwNjIgMzAuOTE2M0M1MS44MTA3IDMxLjY1MzIgNTAuNzI0MSAzMiA0OS4yNDYzIDMySDQzLjMzNVYyOS42NTkySDQ4LjcyNDdDNDkuMjg5NyAyOS42NTkyIDQ5Ljc2NzkgMjkuNTI5MiA1MC4wNzIxIDI5LjIyNThDNTAuMzc2NCAyOC45NjU3IDUwLjU1MDIgMjguNTMyMiA1MC41NTAyIDI4LjAxMlYyNy44Mzg2SDQ3Ljg5ODlDNDYuMjAzNyAyNy44Mzg2IDQ0Ljk0MzIgMjcuNDkxOSA0NC4yNDc4IDI2Ljg0MTZDNDMuNTA4OSAyNi4xNDgxIDQzLjE2MTEgMjUuMDY0NCA0My4xNjExIDIzLjQ2MDVWMTYuMzk0OUg0Ni4xNjAyVjIzLjIwMDVDNDYuMTYwMiAyNC4wNjc0IDQ2LjI5MDYgMjQuNjMwOSA0Ni41NTE0IDI0Ljg5MUM0Ni43MjUzIDI1LjE1MTEgNDcuMjQ2OSAyNS4yODExIDQ4LjA3MjcgMjUuMjgxMVoiIGZpbGw9IiMzNTQzQTgiLz4KPHBhdGggZD0iTTU1Ljg5NjUgMTYuMzk0OUg2MS41OTA0QzYzLjMyOTEgMTYuMzk0OSA2NC41NDYxIDE2LjY5ODMgNjUuMjg1IDE3LjM0ODVDNjYuMDIzOSAxNy45OTg4IDY2LjM3MTYgMTkuMDgyNCA2Ni4zNzE2IDIwLjU1NjNWMjcuNzk1M0g2My4zMjkxVjIwLjk0NjRDNjMuMzI5MSAyMC4wNzk0IDYzLjE5ODcgMTkuNTE1OSA2Mi45Mzc5IDE5LjI5OTJDNjIuNjc3MSAxOS4wMzkxIDYyLjE1NTUgMTguOTA5MSA2MS4zMjk3IDE4LjkwOTFINTguODk1NlYyNy44Mzg2SDU1Ljg1M1YxNi4zOTQ5SDU1Ljg5NjVaIiBmaWxsPSIjMzU0M0E4Ii8+CjxwYXRoIGQ9Ik03NC45MzQyIDI1LjM2NzhINzguMTUwNlYyNy43OTUySDc0LjAyMTRDNzIuOTc4MiAyNy43OTUyIDcyLjEwODkgMjcuNjY1MiA3MS40NTcgMjcuNDkxOEM3MC44MDUgMjcuMjc1IDcwLjE5NjUgMjYuOTI4MyA2OS43MTgzIDI2LjQ1MTRDNjkuMTk2OCAyNS45MzEzIDY4Ljc2MjEgMjUuMjgxMSA2OC40NTc4IDI0LjU0NDJDNjguMTUzNiAyMy44MDcyIDY4LjAyMzIgMjIuOTgzNiA2OC4wMjMyIDIyLjE2QzY4LjAyMzIgMjEuMjkzMSA2OC4xNTM2IDIwLjQ2OTUgNjguNDU3OCAxOS42ODkyQzY4Ljc2MjEgMTguOTA5IDY5LjE1MzMgMTguMzAyMSA2OS43MTgzIDE3Ljc4MTlDNzAuMjM5OSAxNy4zMDUxIDcwLjgwNSAxNi45NTgzIDcxLjUwMDQgMTYuNzQxNkM3Mi4xOTU5IDE2LjUyNDkgNzMuMDIxNyAxNi40MzgyIDc0LjA2NDkgMTYuNDM4Mkg3OC4xOTQxVjE4LjkwOUg3NC45MzQyQzczLjQ5OTggMTguOTA5IDcyLjU0MzYgMTkuMTY5MSA3MS45Nzg1IDE5LjY0NTlDNzEuNDU2OSAyMC4xMjI3IDcxLjE1MjcgMjAuOTg5NyA3MS4xNTI3IDIyLjIwMzRDNzEuMTUyNyAyMi44OTY5IDcxLjI4MzEgMjMuNDYwNSA3MS41MDA0IDIzLjkzNzNDNzEuNzE3NyAyNC40MTQxIDcyLjA2NTUgMjQuNzYwOSA3Mi41MDAxIDI1LjA2NDNDNzIuNzE3NCAyNS4xOTQ0IDcyLjk3ODIgMjUuMjgxMSA3My4yODI1IDI1LjM2NzhDNzMuNjMwMiAyNS4zMjQ0IDc0LjE1MTggMjUuMzY3OCA3NC45MzQyIDI1LjM2NzhaIiBmaWxsPSIjMzU0M0E4Ii8+CjxwYXRoIGQ9Ik04MC44NDU2IDE4LjY0ODlINzguNjcyNFYxNi4zNTE1SDgwLjg0NTZWMTUuMTgxMUM4MC44NDU2IDE0LjAxMDggODEuMDYzIDEzLjIzMDUgODEuNDk3NiAxMi44NDA0QzgxLjkzMjMgMTIuNDUwMyA4Mi43NTgxIDEyLjIzMzUgODMuOTc1MSAxMi4yMzM1SDg2Ljg0MzhWMTQuNDAwOUg4NS40MDk1Qzg0Ljg4NzkgMTQuNDAwOSA4NC41NDAyIDE0LjQ4NzYgODQuMzIyOSAxNC42NjFDODQuMTA1NSAxNC44MzQ0IDgzLjk3NTEgMTUuMDk0NSA4My45NzUxIDE1LjQ0MTJWMTYuMzUxNUg4Ni44NDM4VjE4LjY0ODlIODMuOTc1MVYyNy43OTUzSDgwLjg0NTZWMTguNjQ4OVoiIGZpbGw9IiMzNTQzQTgiLz4KPHBhdGggZD0iTTk4LjQwNTYgMjcuNzk1M0g5Mi43MTE2QzkxLjAxNjUgMjcuNzk1MyA4OS44NDI5IDI3LjQ0ODUgODkuMDYwNSAyNi43OTgzQzg4LjMyMTYgMjYuMTQ4MSA4Ny45MzA0IDI1LjA2NDQgODcuOTMwNCAyMy41OTA2VjE2LjM5NDlIOTAuOTI5NVYyMy40MTcyQzkwLjkyOTUgMjQuMTk3NCA5MS4wNTk5IDI0LjY3NDMgOTEuMzIwNyAyNC45MzQ0QzkxLjU4MTUgMjUuMTk0NCA5Mi4xMDMxIDI1LjMyNDUgOTIuOTI4OSAyNS4zMjQ1SDk1LjM2M1YxNi4zOTQ5SDk4LjQwNTZWMjcuNzk1M1oiIGZpbGw9IiMzNTQzQTgiLz4KPHBhdGggZD0iTTEwMC42MjIgMjUuNDExMkgxMDcuMDExQzEwNy41NzcgMjUuNDExMiAxMDguMDExIDI1LjMyNDUgMTA4LjI3MiAyNS4xNTExQzEwOC41MzMgMjQuOTc3NyAxMDguNjYzIDI0LjY3NDMgMTA4LjY2MyAyNC4zMjc1QzEwOC42NjMgMjMuOTM3NCAxMDguNTMzIDIzLjY3NzMgMTA4LjI3MiAyMy40NjA1QzEwOC4wMTEgMjMuMjg3MSAxMDcuNTc3IDIzLjIwMDUgMTA3LjA1NSAyMy4yMDA1SDEwNC40NDdDMTAyLjg4MiAyMy4yMDA1IDEwMS44MzkgMjIuOTgzNyAxMDEuMzE4IDIyLjUwNjlDMTAwLjc1MiAyMi4wMzAxIDEwMC40OTIgMjEuMjA2NSAxMDAuNDkyIDE5Ljk5MjdDMTAwLjQ5MiAxOC43NzkgMTAwLjgzOSAxNy44Njg3IDEwMS40OTEgMTcuMjYxOEMxMDIuMTQzIDE2LjY5ODMgMTAzLjE4NyAxNi4zOTQ5IDEwNC41MzQgMTYuMzk0OUgxMTEuMDU0VjE4Ljc3OUgxMDUuNzA4QzEwNC44MzggMTguNzc5IDEwNC4yNzMgMTguODY1NyAxMDQuMDEyIDE4Ljk5NTdDMTAzLjc1MiAxOS4xNjkxIDEwMy42MjEgMTkuNDI5MiAxMDMuNjIxIDE5LjgxOTRDMTAzLjYyMSAyMC4xNjYxIDEwMy43NTIgMjAuNDI2MiAxMDMuOTY5IDIwLjU5OTZDMTA0LjE4NiAyMC43NzMgMTA0LjU3NyAyMC44NTk3IDEwNS4wNTYgMjAuODU5N0gxMDcuNzk0QzEwOS4wNTQgMjAuODU5NyAxMTAuMDExIDIxLjE2MzEgMTEwLjY2MyAyMS43MjY2QzExMS4zMTUgMjIuMjkwMiAxMTEuNjYyIDIzLjE1NzEgMTExLjY2MiAyNC4yNDA4QzExMS42NjIgMjUuMjgxMSAxMTEuMzU4IDI2LjE0ODEgMTEwLjc5MyAyNi43OTgzQzExMC4yMjggMjcuNDQ4NSAxMDkuNDQ2IDI3Ljc5NTMgMTA4LjUzMyAyNy43OTUzSDEwMC43MDlWMjUuNDExMkgxMDAuNjIyWiIgZmlsbD0iIzM1NDNBOCIvPgo8cGF0aCBkPSJNMTE2LjU3NCAxNS4wOTQ0SDExMy40MDFWMTIuMjc2OUgxMTYuNTc0VjE1LjA5NDRaTTExNi41NzQgMjcuNzk1M0gxMTMuNDAxVjE2LjM5NDlIMTE2LjU3NFYyNy43OTUzWiIgZmlsbD0iIzM1NDNBOCIvPgo8cGF0aCBkPSJNMTMwLjMwOSAyMi4xMTY3QzEzMC4zMDkgMjMuODkzOSAxMjkuNzQ0IDI1LjMyNDQgMTI4LjY1NyAyNi40MDgxQzEyNy41NzEgMjcuNDkxOCAxMjYuMDkzIDI4LjAxMiAxMjQuMjI0IDI4LjAxMkMxMjIuMzU1IDI4LjAxMiAxMjAuODc3IDI3LjQ5MTggMTE5Ljc5IDI2LjQwODFDMTE4LjcwNCAyNS4zMjQ0IDExOC4xMzkgMjMuODkzOSAxMTguMTM5IDIyLjExNjdDMTE4LjEzOSAyMC4zMzk0IDExOC43MDQgMTguOTA5IDExOS43OSAxNy44MjUzQzEyMC44NzcgMTYuNzQxNiAxMjIuMzk4IDE2LjIyMTQgMTI0LjIyNCAxNi4yMjE0QzEyNi4wNDkgMTYuMjIxNCAxMjcuNTI3IDE2Ljc0MTYgMTI4LjY1NyAxNy44MjUzQzEyOS43NDQgMTguODY1NiAxMzAuMzA5IDIwLjI5NjEgMTMwLjMwOSAyMi4xMTY3Wk0xMjEuMjY4IDIyLjExNjdDMTIxLjI2OCAyMy4yMDA0IDEyMS41MjkgMjQuMDY3MyAxMjIuMDUxIDI0LjY3NDJDMTIyLjU3MiAyNS4yODExIDEyMy4yNjggMjUuNTg0NSAxMjQuMTggMjUuNTg0NUMxMjUuMDkzIDI1LjU4NDUgMTI1Ljc4OSAyNS4yODExIDEyNi4zMSAyNC42NzQyQzEyNi44MzIgMjQuMDY3MyAxMjcuMDkzIDIzLjIwMDQgMTI3LjA5MyAyMi4xMTY3QzEyNy4wOTMgMjEuMDMzIDEyNi44MzIgMjAuMTY2MSAxMjYuMzEgMTkuNjAyNUMxMjUuNzg5IDE4Ljk5NTcgMTI1LjA5MyAxOC42OTIyIDEyNC4xMzcgMTguNjkyMkMxMjMuMjI0IDE4LjY5MjIgMTIyLjUyOSAxOC45OTU3IDEyMi4wMDcgMTkuNjAyNUMxMjEuNTI5IDIwLjE2NjEgMTIxLjI2OCAyMS4wMzMgMTIxLjI2OCAyMi4xMTY3WiIgZmlsbD0iIzM1NDNBOCIvPgo8cGF0aCBkPSJNMTMxLjc4NyAxNi4zOTQ5SDEzNy40ODFDMTM5LjIxOSAxNi4zOTQ5IDE0MC40MzYgMTYuNjk4MyAxNDEuMTc1IDE3LjM0ODVDMTQxLjkxNCAxNy45OTg4IDE0Mi4yNjIgMTkuMDgyNCAxNDIuMjYyIDIwLjU1NjNWMjcuNzk1M0gxMzkuMjE5VjIwLjk0NjRDMTM5LjIxOSAyMC4wNzk0IDEzOS4wODkgMTkuNTE1OSAxMzguODI4IDE5LjI5OTJDMTM4LjU2NyAxOS4wMzkxIDEzOC4wNDYgMTguOTA5MSAxMzcuMjIgMTguOTA5MUgxMzQuNzg2VjI3LjgzODZIMTMxLjc0M1YxNi4zOTQ5SDEzMS43ODdaIiBmaWxsPSIjMzU0M0E4Ii8+CjxwYXRoIGQ9Ik03LjEyODMxIDMuNzM3NDNIMFYxMC44NDY0SDcuMTI4MzFWMy43Mzc0M1oiIGZpbGw9IiMzNTQzQTgiLz4KPHBhdGggZD0iTTIzLjI1MTMgLTIuMTU3MjVlLTA1TDE4LjU1MTMgNS41MTY4NUwyNC4wODMxIDEwLjIwNDFMMjguNzgzMSA0LjY4NzI1TDIzLjI1MTMgLTIuMTU3MjVlLTA1WiIgZmlsbD0iI0ZGODYwMCIvPgo8cGF0aCBkPSJNMTUuNjA0MSAzLjczNzQzSDguNDc1ODNWMTAuODQ2NEgxNS42MDQxVjMuNzM3NDNaIiBmaWxsPSIjMzU0M0E4Ii8+CjxwYXRoIGQ9Ik03LjEyODMxIDEyLjE5MDJIMFYxOS4yOTkySDcuMTI4MzFWMTIuMTkwMloiIGZpbGw9IiMzNTQzQTgiLz4KPHBhdGggZD0iTTE1LjYwNDEgMTIuMTkwMkg4LjQ3NTgzVjE5LjI5OTJIMTUuNjA0MVYxMi4xOTAyWiIgZmlsbD0iIzM1NDNBOCIvPgo8cGF0aCBkPSJNMjQuMDc5NyAxMi4xOTAySDE2Ljk1MTRWMTkuMjk5MkgyNC4wNzk3VjEyLjE5MDJaIiBmaWxsPSIjRkY4NjAwIi8+CjxwYXRoIGQ9Ik03LjEyODMxIDIwLjY4NjNIMFYyNy43OTUzSDcuMTI4MzFWMjAuNjg2M1oiIGZpbGw9IiMzNTQzQTgiLz4KPHBhdGggZD0iTTE1LjYwNDEgMjAuNjg2M0g4LjQ3NTgzVjI3Ljc5NTNIMTUuNjA0MVYyMC42ODYzWiIgZmlsbD0iIzM1NDNBOCIvPgo8cGF0aCBkPSJNMjQuMTIzMiAyMC42ODYzSDE2Ljk5NDlWMjcuNzk1M0gyNC4xMjMyVjIwLjY4NjNaIiBmaWxsPSIjMzU0M0E4Ii8+CjxwYXRoIGQ9Ik0xNDYgMTUuODMxM0MxNDYgMTYuODcxNyAxNDUuMTc0IDE3LjY5NTMgMTQ0LjEzMSAxNy42OTUzQzE0My4wODggMTcuNjk1MyAxNDIuMjYyIDE2Ljg3MTcgMTQyLjI2MiAxNS44MzEzQzE0Mi4yNjIgMTQuNzkxIDE0My4wODggMTQuMDEwNyAxNDQuMTMxIDE0LjAxMDdDMTQ1LjEzMSAxMy45Njc0IDE0NiAxNC43OTEgMTQ2IDE1LjgzMTNaTTE0Mi45NTcgMTQuNzkxQzE0Mi42OTcgMTUuMDUxMSAxNDIuNTY2IDE1LjQ0MTIgMTQyLjU2NiAxNS44MzEzQzE0Mi41NjYgMTYuNjk4MyAxNDMuMjYyIDE3LjM5MTggMTQ0LjEzMSAxNy4zOTE4QzE0NSAxNy4zOTE4IDE0NS42OTYgMTYuNjk4MyAxNDUuNjk2IDE1LjgzMTNDMTQ1LjY5NiAxNS4wMDc3IDE0NSAxNC4yNzA4IDE0NC4xNzQgMTQuMjcwOEMxNDMuNjUzIDE0LjI3MDggMTQzLjI2MiAxNC40NDQyIDE0Mi45NTcgMTQuNzkxWk0xNDQuODcgMTYuOTE1SDE0NC40NzlMMTQzLjkxNCAxNi4wOTE0VjE2LjkxNUgxNDMuNjA5VjE0Ljc0NzZIMTQzLjk1N0MxNDQuNDM1IDE0Ljc0NzYgMTQ0LjY1MyAxNC45NjQ0IDE0NC42NTMgMTUuMzU0NUMxNDQuNjUzIDE1LjY1NzkgMTQ0LjQ3OSAxNS44NzQ3IDE0NC4xNzQgMTUuOTYxNEwxNDQuODcgMTYuOTE1Wk0xNDQuMDQ0IDE1LjY1NzlDMTQ0LjI2MSAxNS42NTc5IDE0NC4zOTIgMTUuNTI3OSAxNDQuMzkyIDE1LjM1NDVDMTQ0LjM5MiAxNS4xMzc4IDE0NC4yNjEgMTUuMDUxMSAxNDQuMDAxIDE1LjA1MTFIMTQzLjkxNFYxNS42NTc5SDE0NC4wNDRaIiBmaWxsPSIjMzU0M0E4Ii8+Cjwvc3ZnPgo=" style="\n    text-align: left;\n    width: 146px;\n    position: absolute;\n    top: 14px;\n    left: 31px;\n">\n            </div>\n            <div style="\n    position: relative;\n    top: 80px;\n    left: 32px;\n    font-size: 20px;\n    text-align: left;\n    font-weight: 700;\n    letter-spacing: 0.02em;\n    font-style: normal;\n    line-height: 125%;\n    ">Claim your FREE account and get a key in less than a minute</div>\n            <ul style="\n        font-size: 15px;\n        font-weight: 400;\n        color: #333333;\n        letter-spacing: 0.01em;\n        position: relative;\n        left: 32px;\n        top: 88px;\n        line-height: 180%;\n        ">\n                <li><span>Access to a 30-day free trial of any of our products.</span></li>\n                <li><span>Access to 24x5 support by developers via the <a href="https://support.syncfusion.com/create?utm_source=es_license_validation_banner&utm_medium=listing&utm_campaign=license-information" style="text-decoration: none;\n                color: #0D6EFD;\n                font-weight: 500;">support tickets</a>, <a href="https://www.syncfusion.com/forums?utm_source=es_license_validation_banner&utm_medium=listing&utm_campaign=license-information" style="text-decoration: none;\n                color: #0D6EFD;\n                font-weight: 500;">forum</a>, <a href="https://www.syncfusion.com/feedback?utm_source=es_license_validation_banner&utm_medium=listing&utm_campaign=license-information\n                " style="text-decoration: none;\n                color: #0D6EFD;\n                font-weight: 500;">feature &amp; feedback page</a> and chat.</span></li>\n                <li><span>200+ <a href="https://www.syncfusion.com/succinctly-free-ebooks?utm_source=es_license_validation_banner&utm_medium=listing&utm_campaign=license-information" style="text-decoration: none;\n                color: #0D6EFD;\n                font-weight: 500;">ebooks </a>on the latest technologies, industry trends, and research topics.</span>\n                </li>\n                <li><span>Largest collection of over 7500 flat and wireframe icons for free with Syncfusion<sup>®</sup> <a href="https://www.syncfusion.com/downloads/metrostudio?utm_source=es_license_validation_banner&utm_medium=listing&utm_campaign=license-information\n                " style="text-decoration: none;\n                color: #0D6EFD;\n                font-weight: 500;">Metro Studio.</a></span></li>\n                <li><span>Free and unlimited access to Syncfusion<sup>®</sup> technical <a href="https://www.syncfusion.com/blogs/?utm_source=es_license_validation_banner&utm_medium=listing&utm_campaign=license-information\n                " style="text-decoration: none;\n                color: #0D6EFD;\n                font-weight: 500;">blogs</a> and <a href="https://www.syncfusion.com/resources/techportal/whitepapers?utm_source=es_license_validation_banner&utm_medium=listing&utm_campaign=license-information" style="text-decoration: none;\n                color: #0D6EFD;\n                font-weight: 500;">whitepapers.</a></span></li>\n            </ul>\n            <div style="\n            font-size: 18px;\n            font-weight: 700;\n            position: relative;\n            line-height: 125%;\n            letter-spacing: 0.02em;\n            top: 90px;\n            left: 32px;\n    ">Syncfusion is trusted by 29,000+ businesses worldwide</div>\n            <img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjIyMzAiIGhlaWdodD0iMTU2Ij4KPHBhdGggZD0iTTAgMCBDMTAuMjAxNTE3OTEgOC44MjE1MTgwNSAxNi4yMjU4NjAxNyAxOS4zODQ1MTIyMiAxNy4yODEyNSAzMi45NzI2NTYyNSBDMTcuNDE3OTUwMTYgNDUuOTc2MjU4NTUgMTMuMTkyNTE4MDQgNTcuNjM2ODk1NzMgNC4yNDYwOTM3NSA2Ny4xMzI4MTI1IEMtNS44MzQzNzk4NyA3Ni42NDQzNzA1IC0xNi43MjM2MTUyMyA4MC40NzU4MTc3IC0zMC40MTAxNTYyNSA4MC4yMjI2NTYyNSBDLTQzLjEyNjA0NDAyIDc5LjI2MTgzMzU2IC01NC4yMDMwOTQ1MyA3My40MDM0NzMyNCAtNjIuNzE4NzUgNjMuOTcyNjU2MjUgQy03MS4xNDgwNjkyNSA1MS44OTg2NTk5MiAtNzMuMTk0NzM3MSA0MC4zOTM3NzYxNCAtNzEuNzE4NzUgMjUuOTcyNjU2MjUgQy02OS4wOTkxNjQzNyAxNC41NTg3NDc0NCAtNjIuMzc0NTczNzggNC42NDI1NDI1NiAtNTIuNzE4NzUgLTIuMDI3MzQzNzUgQy0zNS45MDE4NDE2MSAtMTEuOTUyMDc2NTcgLTE1Ljg5MjUyMDU5IC0xMi4xNTE1ODYzNiAwIDAgWiAiIGZpbGw9IiMwODY4NDIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzODguNzE4NzUsNDIuMDI3MzQzNzUpIi8+CjxwYXRoIGQ9Ik0wIDAgQzcuMzY3MjM5MTYgNC4wNDIzMjQxMSAxMS4xMDI1Mzc1MyAxMS4zOTA0MDEzMyAxNCAxOSBDMTQuMzg5NjU4MjYgMjAuOTg5NzkzMzQgMTQuNzQwMDUyODkgMjIuOTg5MTQ0ODEgMTUgMjUgQzE1LjY2IDI1IDE2LjMyIDI1IDE3IDI1IEMxNy4xMDA1NDY4NyAyNC4xNDQwNjI1IDE3LjIwMTA5Mzc1IDIzLjI4ODEyNSAxNy4zMDQ2ODc1IDIyLjQwNjI1IEMxOC45MTc0Mjc1NSAxNC41MDU2MzU4IDIzLjYwODM5NDI3IDUuNzcxNDMyNzMgMzAuMTc5Njg3NSAwLjg5NDUzMTI1IEMzMy43MzEzMzY1NCAtMC44NTA4MDcwMSAzNi4wNzI1NTM3NiAtMC42MjM0MDQxNyA0MCAwIEM0Ny43ODg2NDkxMyAzLjU4Mjc3ODYgNTEuMzQ3MDc2MTEgMTAuOTI1MDE3NDYgNTQuMzUyNzgzMiAxOC41ODg4NjcxOSBDNjAuNjYxMjYyNjMgMzUuNzMzMjUxOTkgNjMuMjM3ODY0ODggNTQuNDE0MDMxNTkgNjMuMDYyNSA3Mi42MjUgQzYzLjA1Nzk4ODI4IDczLjUzMzc4OTA2IDYzLjA1MzQ3NjU2IDc0LjQ0MjU3ODEyIDYzLjA0ODgyODEyIDc1LjM3ODkwNjI1IEM2My4wMzcyMTIwMiA3Ny41ODU5NjY5NSA2My4wMTkyODQ1MyA3OS43OTI5OTI5OSA2MyA4MiBDNTkuMDQgODIgNTUuMDggODIgNTEgODIgQzUwLjkzMDA2ODM2IDgwLjkwMzQ5MTIxIDUwLjg2MDEzNjcyIDc5LjgwNjk4MjQyIDUwLjc4ODA4NTk0IDc4LjY3NzI0NjA5IEM1MC4zMzA4MzIxNSA0MS45ODYzMDU3MyA1MC4zMzA4MzIxNSA0MS45ODYzMDU3MyAzOSA4IEMzOC4wMSA3LjY3IDM3LjAyIDcuMzQgMzYgNyBDMjUuMTQyMTkxNjggMTYuMjQ0MTIxMzEgMjQuODI2NDcwMzkgMzguNDA3NTg2NzUgMjMuNjgzNTkzNzUgNTEuNjcyMzYzMjggQzIzLjA0MTM0NzcxIDU5Ljc3NjY1NDY5IDIyLjUwMDE0OTM2IDY3Ljg4NTgxMjE3IDIyIDc2IEMxOC4wNCA3NiAxNC4wOCA3NiAxMCA3NiBDOS44OTUxMDI1NCA3NC40NzU4NDQ3MyA5Ljg5NTEwMjU0IDc0LjQ3NTg0NDczIDkuNzg4MDg1OTQgNzIuOTIwODk4NDQgQzkuMjg4Njk2MTIgMzkuNjQwNjkzMTMgOS4yODg2OTYxMiAzOS42NDA2OTMxMyAtMSA5IEMtMy4wMzU2NDA0IDcuNzQxNDM2NTkgLTMuMDM1NjQwNCA3Ljc0MTQzNjU5IC01IDcgQy0xNS44NDgzODY5NyAxNi40OTIzMzg2IC0xNi4wNTg3MjYyNSA0MC4yNTk3NTY0MSAtMTcgNTQgQy0xNy40NzQyMTEwMiA2My4zMjgyOTc4NCAtMTcuNzQ3NjYxNTkgNzIuNjYzNDc4NzQgLTE4IDgyIEMtMjIuMjkgODIgLTI2LjU4IDgyIC0zMSA4MiBDLTMxLjg5MjU5MjA1IDU1LjgxNzI5OTc3IC0yOS45NTA2NDQ2MiAyMi44Mzc1NTI0MSAtMTIgMiBDLTguNDczMzg5NDMgLTAuNjQ0OTU3OTMgLTQuMjE5NTgzOTggLTAuOTU4OTk2MzYgMCAwIFogIiBmaWxsPSIjRkZDQzAwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg4MjgsMzcpIi8+CjxwYXRoIGQ9Ik0wIDAgQzUuODg3MjkwNzMgMS40NDk4NTUxOCA5LjE2NjM4NTEzIDEuMjgxNTYyNTYgMTQuNzUgLTAuODM5ODQzNzUgQzIwLjM1Nzc0OTYyIC0yLjU0NjE0OTE0IDI1LjU0MDY3MjkyIC0xLjM4Mjk1NTEgMzAuNjI1IDEuMjUgQzMyLjkzNzM1MDYzIDMuMjczMzA2OCAzNC4xMDM0MzU0MiA0LjU3NzExOTE4IDM1LjEyNSA3LjQzNzUgQzM0LjM0MTI1IDguMTggMzMuNTU3NSA4LjkyMjUgMzIuNzUgOS42ODc1IEMyOS4xMTkwMTcwMyAxMy40OTEzODY5MiAyOC4yMzgzODk0NyAxNS4wMzE0NzA1OCAyNy44MTI1IDIwLjMxMjUgQzI3Ljk2MDg4MjA0IDI1LjAxNzA4MzQ0IDI5LjE5MzUzOTM2IDI4LjU3NDg0NDU4IDMyLjY2MDE1NjI1IDMxLjkxNzk2ODc1IEMzNC4xMDgzOTEwMSAzMy4xNDAyMzc4IDM1LjYxMjk3ODE1IDM0LjI5NTA4MzQ5IDM3LjEyNSAzNS40Mzc1IEMzNi4wNzAxOTM1MiA0Mi40Njk1NDMyIDMyLjAzNjA5MDQ5IDQ3Ljk3MzE5OTEgMjcuNzUgNTMuNSBDMjQuMjczODU5MzcgNTYuMDY1NzIyODUgMjEuNDA5Njc2NTkgNTYuNjI0MTU5MTggMTcuMTI1IDU2LjQzNzUgQzE1LjExMjc3OTUzIDU1LjgwODY4MTEgMTMuMTEyMjMyNjggNTUuMTQxMzExNTcgMTEuMTI1IDU0LjQzNzUgQzcuMTMyMjAwNjEgNTQuMDEwODUwMDcgMy44Njk5NzIwNCA1NC4xNzkwNDAzMSAwLjA2MjUgNTUuNSBDLTMuNzQ1OTgyNzYgNTYuNzE1NDczMjIgLTYuMDIwMDcxMDYgNTYuNDcwMDcwMjUgLTkuODc1IDU1LjQzNzUgQy0xNy44OTY4MjA0OCA1MC4zNjI0NzA3MiAtMjMuMjI0ODkxNjcgNDAuMjQ1NjM5MjYgLTI1LjQzMzU5Mzc1IDMxLjEzMjgxMjUgQy0yNi42OTE4Nzk2IDIzLjQ0OTQ3NDE1IC0yNy4zMTA4Njc4MiAxNC4yMDI1NjkzMiAtMjIuODc1IDcuNDM3NSBDLTE5LjE4NzExNTEzIDMuMTY0NjQwMjkgLTE0Ljk1ODc1MDk1IC0wLjQ2NDczMTYxIC05LjI2NTYyNSAtMS41NzQyMTg3NSBDLTYuMDIyMDAxNTYgLTEuNTU4MzE4NjQgLTMuMTQ1MDkxMDYgLTAuNzc5NDY1MjEgMCAwIFogIiBmaWxsPSIjMDAwMDAwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgzMjIuODc1LDU1LjU2MjUpIi8+CjxwYXRoIGQ9Ik0wIDAgQzYuOTk4NjY1NzYgNi41NjU2MTQ1OCAxMy4yMzU0MjQ3IDEzLjIxNDc1OTU1IDE0LjE3OTY4NzUgMjMuMTg3NSBDMTMuOTYxMTk2MzQgMjguMjczOTc0MSAxMi4yNTY2NDk1NCAzMi4wNjY5ODMyNiA5LjAzNTE1NjI1IDM1Ljk3NjU2MjUgQzAuNTMzMzg4MDQgNDMuNTgzNDA3NzQgLTguOTc3NTY4MjUgNDUuMDAzODkwNjcgLTE5Ljg1NTQ2ODc1IDQ0Ljg5ODQzNzUgQy0yMS4xODA5NDcyNyA0NC44OTE2Njk5MiAtMjEuMTgwOTQ3MjcgNDQuODkxNjY5OTIgLTIyLjUzMzIwMzEyIDQ0Ljg4NDc2NTYyIEMtMjQuNzAzMTU0MzQgNDQuODczMDM2MTYgLTI2Ljg3MzA3MDQ3IDQ0Ljg1NTEwMjQ1IC0yOS4wNDI5Njg3NSA0NC44MzU5Mzc1IEMtMjkuMzcyOTY4NzUgNDUuNDk1OTM3NSAtMjkuNzAyOTY4NzUgNDYuMTU1OTM3NSAtMzAuMDQyOTY4NzUgNDYuODM1OTM3NSBDLTMyLjQxNzk2ODc1IDQ2Ljk2MDkzNzUgLTMyLjQxNzk2ODc1IDQ2Ljk2MDkzNzUgLTM1LjA0Mjk2ODc1IDQ2LjgzNTkzNzUgQy0zNy4wNDI5Njg3NSA0NC44MzU5Mzc1IC0zNy4wNDI5Njg3NSA0NC44MzU5Mzc1IC0zNy40MTQwNjI1IDQyLjM1NTQ2ODc1IEMtMzcuNzgyMzI5OTcgMzkuNzMzNjQ1MzEgLTM3Ljc4MjMyOTk3IDM5LjczMzY0NTMxIC0zOS44MjgxMjUgMzguNTM1MTU2MjUgQy00MC41Nzk2NDg0NCAzOC4yMDEyODkwNiAtNDEuMzMxMTcxODcgMzcuODY3NDIxODcgLTQyLjEwNTQ2ODc1IDM3LjUyMzQzNzUgQy00Ny4zNTI0NjU4MyAzNC44NTM3NjUzOCAtNTEuNDU1NzUyNzEgMzEuNTMwNDMxOTUgLTU1LjA0Mjk2ODc1IDI2LjgzNTkzNzUgQy01Ni4wNDI5Njg3NSAyMy4zMzU5Mzc1IC01Ni4wNDI5Njg3NSAyMy4zMzU5Mzc1IC01Ni4wNDI5Njg3NSAyMC44MzU5Mzc1IEMtNTEuMzM2NTk3OTUgMTYuMTI5NTY2NyAtNDUuMzAzOTE4MTcgMTQuNTc0NTc2MzMgLTM5LjA0Mjk2ODc1IDEyLjgzNTkzNzUgQy0zOC4zODI5Njg3NSAxMi44MzU5Mzc1IC0zNy43MjI5Njg3NSAxMi44MzU5Mzc1IC0zNy4wNDI5Njg3NSAxMi44MzU5Mzc1IEMtMzYuOTIxNzk2ODggMTEuOTA5MTAxNTYgLTM2LjgwMDYyNSAxMC45ODIyNjU2MiAtMzYuNjc1NzgxMjUgMTAuMDI3MzQzNzUgQy0zNi41MDgyMDMxMyA4LjgyOTgwNDY5IC0zNi4zNDA2MjUgNy42MzIyNjU2MyAtMzYuMTY3OTY4NzUgNi4zOTg0Mzc1IEMtMzYuMDA1NTQ2ODggNS4yMDM0NzY1NiAtMzUuODQzMTI1IDQuMDA4NTE1NjMgLTM1LjY3NTc4MTI1IDIuNzc3MzQzNzUgQy0zNS40NjY5NTMxMyAxLjgwNjY3OTY5IC0zNS4yNTgxMjUgMC44MzYwMTU2MyAtMzUuMDQyOTY4NzUgLTAuMTY0MDYyNSBDLTM0LjM4Mjk2ODc1IC0wLjQ5NDA2MjUgLTMzLjcyMjk2ODc1IC0wLjgyNDA2MjUgLTMzLjA0Mjk2ODc1IC0xLjE2NDA2MjUgQy0zMC4wNzc2OTExNyAxLjI4MTI3NiAtMjkuNDg3MTQ2NjEgMy4yODE5NjA5NyAtMjguODU1NDY4NzUgNy4wMjM0Mzc1IEMtMjguNjk2OTE0MDYgNy45MjQ0OTIxOSAtMjguNTM4MzU5MzggOC44MjU1NDY4OCAtMjguMzc1IDkuNzUzOTA2MjUgQy0yOC4yNjU0Mjk2OSAxMC40NDA5NzY1NiAtMjguMTU1ODU5MzcgMTEuMTI4MDQ2ODcgLTI4LjA0Mjk2ODc1IDExLjgzNTkzNzUgQy0yNy4xMjUxNTYyNSAxMS45MzM5MDYyNSAtMjYuMjA3MzQzNzUgMTIuMDMxODc1IC0yNS4yNjE3MTg3NSAxMi4xMzI4MTI1IEMtMTguMDQ1MDgyNTkgMTMuMDEyMTUwNTIgLTEyLjIzNzYzMDI1IDEzLjk0OTA5MTA3IC02LjA0Mjk2ODc1IDE3LjgzNTkzNzUgQy00LjY2MTcxODU3IDIwLjU5ODQzNzg2IC00Ljg1MjE3NTY5IDIyLjc4MzI0ODQ5IC01LjA0Mjk2ODc1IDI1LjgzNTkzNzUgQy03LjA0Mjk2ODc1IDI3LjgzNTkzNzUgLTcuMDQyOTY4NzUgMjcuODM1OTM3NSAtMTAuNjY3OTY4NzUgMjcuOTYwOTM3NSBDLTExLjc4MTcxODc1IDI3LjkxOTY4NzUgLTEyLjg5NTQ2ODc1IDI3Ljg3ODQzNzUgLTE0LjA0Mjk2ODc1IDI3LjgzNTkzNzUgQy0xMy4zODI5Njg3NSAyNi41MTU5Mzc1IC0xMi43MjI5Njg3NSAyNS4xOTU5Mzc1IC0xMi4wNDI5Njg3NSAyMy44MzU5Mzc1IEMtMTUuNzk1MjI3MTUgMjIuMTc5MDk2MTMgLTE5LjMwNjQ5OTM2IDIxLjMzMzg1NTg3IC0yMy4zNTU0Njg3NSAyMC43MTA5Mzc1IEMtMjUuMjMyMzQzNzUgMjAuNDIyMTg3NSAtMjcuMTA5MjE4NzUgMjAuMTMzNDM3NSAtMjkuMDQyOTY4NzUgMTkuODM1OTM3NSBDLTI4LjU0Nzk2ODc1IDI4LjI1MDkzNzUgLTI4LjU0Nzk2ODc1IDI4LjI1MDkzNzUgLTI4LjA0Mjk2ODc1IDM2LjgzNTkzNzUgQy0xMi4wNjE3Nzk5MSAzNy4zODI2NDE3MiAtMTIuMDYxNzc5OTEgMzcuMzgyNjQxNzIgMi4wODIwMzEyNSAzMC42NDg0Mzc1IEM0Ljc2MDcwNTQxIDI2LjYzMDQyNjI2IDQuNzc1MjY3NDcgMjMuNTI1MDYwNDMgMy45NTcwMzEyNSAxOC44MzU5Mzc1IEMxLjAxMTM1NTYzIDguNTI2MDcyODEgLTguODY3NTEyMiAyLjM4NDg3MDU4IC0xNy43MzQzNzUgLTIuNTYyNSBDLTMxLjY3NjMzMzk0IC05LjMxMTI2NDA3IC00NS42NDMxNzQyMiAtMTEuNTY4NzI4NjMgLTYxLjA0Mjk2ODc1IC0xMS4xNjQwNjI1IEMtNjEuMDQyOTY4NzUgLTEwLjE3NDA2MjUgLTYxLjA0Mjk2ODc1IC05LjE4NDA2MjUgLTYxLjA0Mjk2ODc1IC04LjE2NDA2MjUgQy02My4wMjI5Njg3NSAtOC4xNjQwNjI1IC02NS4wMDI5Njg3NSAtOC4xNjQwNjI1IC02Ny4wNDI5Njg3NSAtOC4xNjQwNjI1IEMtNjcuNzkyOTY4NzUgLTkuOTE0MDYyNSAtNjcuNzkyOTY4NzUgLTkuOTE0MDYyNSAtNjguMDQyOTY4NzUgLTEyLjE2NDA2MjUgQy02NS45Njg1NDMxOCAtMTUuNTIyNjU2MjggLTYzLjQ3ODY1NTM5IC0xNi41NTA0NzkzNSAtNTkuNzkyOTY4NzUgLTE3LjQ3NjU2MjUgQy0zOS4xODA0NTMyNSAtMjAuODM2MzExNzIgLTE1Ljg1MjQ2NDU2IC0xMy4zOTczMDI3NCAwIDAgWiBNLTQ3LjM1NTQ2ODc1IDIwLjgzNTkzNzUgQy00OC4yMzg0NzY1NiAyMS4wMjE1NjI1IC00OS4xMjE0ODQzOCAyMS4yMDcxODc1IC01MC4wMzEyNSAyMS4zOTg0Mzc1IEMtNTAuNjk1MTE3MTkgMjEuNTQyODEyNSAtNTEuMzU4OTg0MzcgMjEuNjg3MTg3NSAtNTIuMDQyOTY4NzUgMjEuODM1OTM3NSBDLTUyLjUwMDI0MDQ0IDI1LjcyNDc4Mzk5IC01Mi41MDAyNDA0NCAyNS43MjQ3ODM5OSAtNTAuNTAzOTA2MjUgMjcuNDY4NzUgQy00Ni40NjI2MDg1IDMwLjM1OTcxNTgxIC00Mi45NDE1MjEwNyAzMi42MTEyOTk0MiAtMzguMDQyOTY4NzUgMzMuODM1OTM3NSBDLTM2LjcwMzk1MDgzIDMyLjcyNDY3MDkxIC0zNi43MDM5NTA4MyAzMi43MjQ2NzA5MSAtMzYuOTQ1MzEyNSAyOS44OTQ1MzEyNSBDLTM2Ljk1NjkxNDA2IDI4LjY5OTU3MDMxIC0zNi45Njg1MTU2MyAyNy41MDQ2MDkzOCAtMzYuOTgwNDY4NzUgMjYuMjczNDM3NSBDLTM2Ljk4OTQ5MjE5IDI1LjA3NTg5ODQ0IC0zNi45OTg1MTU2MiAyMy44NzgzNTkzOCAtMzcuMDA3ODEyNSAyMi42NDQ1MzEyNSBDLTM3LjAxOTQxNDA2IDIxLjcxNzY5NTMxIC0zNy4wMzEwMTU2MyAyMC43OTA4NTkzNyAtMzcuMDQyOTY4NzUgMTkuODM1OTM3NSBDLTQwLjYzODE2MTY3IDE5LjczMjI5MjMgLTQzLjg0MDg2MTA3IDIwLjA4NjE1NDUzIC00Ny4zNTU0Njg3NSAyMC44MzU5Mzc1IFogIiBmaWxsPSIjMjIxRTIwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1NTEuMDQyOTY4NzUsNTguMTY0MDYyNSkiLz4KPHBhdGggZD0iTTAgMCBDMy4zIDAgNi42IDAgMTAgMCBDMTMuOTk1NTQ4MTcgOC40NTIxMjExMyAxNi45NDE0Njg4MSAxNy4xNzE5NjY3OSAyMCAyNiBDMjAuMzMgMTcuNDIgMjAuNjYgOC44NCAyMSAwIEMyNC42MyAwIDI4LjI2IDAgMzIgMCBDMzIgMTguNDggMzIgMzYuOTYgMzIgNTYgQzI4IDU3IDI4IDU3IDIwIDU3IEMxNy4zNiA0OS40MSAxNC43MiA0MS44MiAxMiAzNCBDMTEuNjcgNDIuMjUgMTEuMzQgNTAuNSAxMSA1OSBDNS41NTUgNTkuNDk1IDUuNTU1IDU5LjQ5NSAwIDYwIEMwIDQwLjIgMCAyMC40IDAgMCBaICIgZmlsbD0iI0Q4MUYyNSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOTk1LDUyKSIvPgo8cGF0aCBkPSJNMCAwIEMxLjE3MDQ2ODc1IDAuMDI3MDcwMzEgMi4zNDA5Mzc1IDAuMDU0MTQwNjMgMy41NDY4NzUgMC4wODIwMzEyNSBDNC40Mzg5MDYyNSAwLjExNjgzNTk0IDUuMzMwOTM3NSAwLjE1MTY0MDYyIDYuMjUgMC4xODc1IEM3LjUzODE4NzMxIDYuMjE4NDU0OTcgOC44MTk3NDQ4OSAxMi4yNTA3NjY0NyAxMC4wOTUyMTQ4NCAxOC4yODQ0MjM4MyBDMTAuNTI5OTIzMzUgMjAuMzM2MjQxNDggMTAuOTY2NDMxOTEgMjIuMzg3Njc4NjMgMTEuNDA0Nzg1MTYgMjQuNDM4NzIwNyBDMTIuMDM1MDI5NTggMjcuMzg5MTUwNjYgMTIuNjU4NzU5NzQgMzAuMzQwODk0MzcgMTMuMjgxMjUgMzMuMjkyOTY4NzUgQzEzLjQ3ODExNDAxIDM0LjIwNzczNDgzIDEzLjY3NDk3ODAzIDM1LjEyMjUwMDkyIDEzLjg3NzgwNzYyIDM2LjA2NDk4NzE4IEMxNC4wNTc5OTQzOCAzNi45MjU1MDE4NiAxNC4yMzgxODExNSAzNy43ODYwMTY1NCAxNC40MjM4MjgxMiAzOC42NzI2MDc0MiBDMTQuNTgzNzEyMTYgMzkuNDI1Mzk0NzQgMTQuNzQzNTk2MTkgNDAuMTc4MTgyMDcgMTQuOTA4MzI1MiA0MC45NTM3ODExMyBDMTUuMjUgNDMuMTg3NSAxNS4yNSA0My4xODc1IDE1LjI1IDQ4LjE4NzUgQzExLjI5IDQ4LjE4NzUgNy4zMyA0OC4xODc1IDMuMjUgNDguMTg3NSBDMi45MiA0NS44Nzc1IDIuNTkgNDMuNTY3NSAyLjI1IDQxLjE4NzUgQy0yLjcgNDEuNTE3NSAtNy42NSA0MS44NDc1IC0xMi43NSA0Mi4xODc1IEMtMTMuNDEgNDQuMTY3NSAtMTQuMDcgNDYuMTQ3NSAtMTQuNzUgNDguMTg3NSBDLTE5LjM3IDQ4LjE4NzUgLTIzLjk5IDQ4LjE4NzUgLTI4Ljc1IDQ4LjE4NzUgQy0yNi44MDgzMTEyNiA0Mi4yMDY0MzQ4NSAtMjQuNzAyMzE0NTggMzYuMzU1OTk3NzMgLTIyLjMxNjQwNjI1IDMwLjUzOTA2MjUgQy0yMS45OTcxOTcxMSAyOS43NTk4NTQ0MyAtMjEuNjc3OTg3OTggMjguOTgwNjQ2MzYgLTIxLjM0OTEwNTgzIDI4LjE3NzgyNTkzIEMtMjAuNjc5NDY4MTMgMjYuNTQ4NjI2IC0yMC4wMDc5ODYzNCAyNC45MjAxODI4OSAtMTkuMzM0NzE2OCAyMy4yOTI0ODA0NyBDLTE4LjY0OTcxMDY3IDIxLjYzMDYwMDMgLTE3Ljk3MDA3MDg4IDE5Ljk2NjQ5ODY1IC0xNy4yOTU2NTQzIDE4LjMwMDI5Mjk3IEMtMTYuMzEzOTk1MTggMTUuODc1MDE3NSAtMTUuMzE3MDg2OTUgMTMuNDU2NTQxMzggLTE0LjMxNjQwNjI1IDExLjAzOTA2MjUgQy0xNC4wMTgzNTU4NyAxMC4yOTUzMjM3OSAtMTMuNzIwMzA1NDggOS41NTE1ODUwOCAtMTMuNDEzMjIzMjcgOC43ODUzMDg4NCBDLTEwLjMyNjYxNzczIDEuNDMzOTIzMTMgLTcuOTE5NDc2MjUgLTAuMjM3NTg0MjkgMCAwIFogTS0zLjc1IDE1LjE4NzUgQy01LjQgMjAuMTM3NSAtNy4wNSAyNS4wODc1IC04Ljc1IDMwLjE4NzUgQy02LjExIDMwLjE4NzUgLTMuNDcgMzAuMTg3NSAtMC43NSAzMC4xODc1IEMtMS40MDM0OTYzMyAyMi42MzcxMTU3OCAtMS40MDM0OTYzMyAyMi42MzcxMTU3OCAtMi43NSAxNS4xODc1IEMtMy4wOCAxNS4xODc1IC0zLjQxIDE1LjE4NzUgLTMuNzUgMTUuMTg3NSBaICIgZmlsbD0iIzIzNDM5QSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTcwLjc1LDUzLjgxMjUpIi8+CjxwYXRoIGQ9Ik0wIDAgQzIuNzg5Mjg3NzggMi4zMDgzNzYwOSAzLjc1MTc2ODg4IDQuMjY1OTI4MzQgNC4yNzM0Mzc1IDcuOTEwMTU2MjUgQzQuNjM2ODE4NzQgMTUuNjExMDQzMzQgMS45NDAyMDM5IDIxLjI4NjM5NDY0IC0yLjc5Njg3NSAyNy4yNjk1MzEyNSBDLTkuMDAxNDUwMzQgMzMuOTU4MDYzNDcgLTE1LjA5NjEwOTIxIDM3LjE0MTAyMzg5IC0yNC4yNSAzNy41IEMtMjguMDQyMTE1NTYgMzcuMzY0OTExOTEgLTI5Ljc2NDgxODA0IDM3LjEzMTcwMTkgLTMzLjEyNSAzNS4yNSBDLTM2LjYxNDUyNjY5IDMxLjA2MjU2Nzk3IC0zNy40NTgyNTE2IDI3Ljc5OTc2MzM3IC0zNy4zMDg1OTM3NSAyMi40Mjk2ODc1IEMtMzYuMzE4MDI0MjMgMTQuNjMwNTE5ODYgLTMxLjc1MTQwMDU4IDguMTU2MDQwNzUgLTI2IDMgQy0xNy42OTY1MDc2NiAtMi42NTI1NDYzMSAtOS4yMjAwNTQ5MyAtNS42NTc3NjA5OCAwIDAgWiAiIGZpbGw9IiMwNjg4MkYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIwNDUsNzkpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuNzQ5ODUzMjUgLTAuMDg3MTc0NyA3LjQ5OTQ0NTU1IC0wLjE0MDQ1MDAzIDExLjI1IC0wLjE4NzUgQzEyLjMxMzQ3NjU2IC0wLjIxMjYzNjcyIDEzLjM3Njk1MzEyIC0wLjIzNzc3MzQ0IDE0LjQ3MjY1NjI1IC0wLjI2MzY3MTg4IEMxNS40OTc0NjA5NCAtMC4yNzMzMzk4NCAxNi41MjIyNjU2MyAtMC4yODMwMDc4MSAxNy41NzgxMjUgLTAuMjkyOTY4NzUgQzE4LjUyMDc1MTk1IC0wLjMwODY3OTIgMTkuNDYzMzc4OTEgLTAuMzI0Mzg5NjUgMjAuNDM0NTcwMzEgLTAuMzQwNTc2MTcgQzIzLjU2MjEwMzM5IDAuMDc0NjIyNTkgMjQuODI1NjM1MDMgMC43MTY2NzQ2NSAyNyAzIEMyNy45MTMwODU5NCA1LjYzNTQ5ODA1IDI3LjkxMzA4NTk0IDUuNjM1NDk4MDUgMjguNDg0Mzc1IDguNzYxNzE4NzUgQzI4LjgwMzQxNzk3IDEwLjQzOTExMTMzIDI4LjgwMzQxNzk3IDEwLjQzOTExMTMzIDI5LjEyODkwNjI1IDEyLjE1MDM5MDYyIEMyOS4zMzM4NjcxOSAxMy4zMTc2MzY3MiAyOS41Mzg4MjgxMiAxNC40ODQ4ODI4MSAyOS43NSAxNS42ODc1IEMyOS45NzA0Mjk2OSAxNi44NjYzNDc2NiAzMC4xOTA4NTkzOCAxOC4wNDUxOTUzMSAzMC40MTc5Njg3NSAxOS4yNTk3NjU2MiBDMzAuOTYwMTAyNjQgMjIuMTcwNzg4OTEgMzEuNDg2NzY4MjIgMjUuMDgzNzY2MzEgMzIgMjggQzM1LjA3NTc1MDg3IDIxLjMyMzQ4NDU3IDM4LjA0NTYyMTcyIDE0LjYyMjgwNzQ2IDQwLjgxMjUgNy44MTI1IEM0MS4xMjM4MDg1OSA3LjA1MTMwODU5IDQxLjQzNTExNzE5IDYuMjkwMTE3MTkgNDEuNzU1ODU5MzggNS41MDU4NTkzOCBDNDIuNTA1ODE1MTcgMy42NzEzNTIxMyA0My4yNTMxOTk4MiAxLjgzNTc5NDExIDQ0IDAgQzQ4LjI5IDAgNTIuNTggMCA1NyAwIEM1NS44NzQ5NzQ1OCA2Ljc1MDE1MjU0IDU1Ljg3NDk3NDU4IDYuNzUwMTUyNTQgNTQuMzQxNzk2ODggMTAuMzIxMjg5MDYgQzU0LjAwNDc0NzMxIDExLjExNTIxMDU3IDUzLjY2NzY5Nzc1IDExLjkwOTEzMjA4IDUzLjMyMDQzNDU3IDEyLjcyNzExMTgyIEM1Mi45NTY4Nzg2NiAxMy41NjQ4MjExNyA1Mi41OTMzMjI3NSAxNC40MDI1MzA1MiA1Mi4yMTg3NSAxNS4yNjU2MjUgQzUxLjg0NTIwMzg2IDE2LjE0MDIzMzc2IDUxLjQ3MTY1NzcxIDE3LjAxNDg0MjUzIDUxLjA4Njc5MTk5IDE3LjkxNTk1NDU5IEM0OS44OTczNDQ2IDIwLjY5NjY1Mjc4IDQ4LjY5ODc0NTQ1IDIzLjQ3MzI5OTM5IDQ3LjUgMjYuMjUgQzQ2LjY5MzQyMDAxIDI4LjEzMjU1OTY1IDQ1Ljg4NzQyNDAyIDMwLjAxNTM2OTYzIDQ1LjA4MjAzMTI1IDMxLjg5ODQzNzUgQzQzLjYxMDkxMDIyIDM1LjMzMjU2NDA1IDQyLjEzODAzMjE4IDM4Ljc2NTkwNDg3IDQwLjY1ODIwMzEyIDQyLjE5NjI4OTA2IEM0MC4zNjE0MzY3NyA0Mi44ODQzNDYzMSA0MC4wNjQ2NzA0MSA0My41NzI0MDM1NiAzOS43NTg5MTExMyA0NC4yODEzMTEwNCBDMzkuMjA1MDIxMiA0NS41MzU2OTMxMSAzOC42MTMyMzIxNyA0Ni43NzM1MzU2NyAzOCA0OCBDMzMuMzggNDggMjguNzYgNDggMjQgNDggQzIzLjcxODAxNzU4IDQ2Ljg2OTgxNDQ1IDIzLjQzNjAzNTE2IDQ1LjczOTYyODkxIDIzLjE0NTUwNzgxIDQ0LjU3NTE5NTMxIEMyMi4wOTM1MjM1MyA0MC4zNzQ2MTE1MyAyMS4wMjMxNzA3NiAzNi4xNzg4ODk2NSAxOS45NDcyNjU2MiAzMS45ODQzNzUgQzE5LjQ4NDU3MjAzIDMwLjE2OTg5MDMxIDE5LjAyNjgzOTQ1IDI4LjM1NDEzMjkyIDE4LjU3NDIxODc1IDI2LjUzNzEwOTM4IEMxNy45MjE5MzU4OSAyMy45MjIyNTYxNiAxNy4yNTE4MjE4MSAyMS4zMTI1MzE3MyAxNi41NzgxMjUgMTguNzAzMTI1IEMxNi4yODA5ODYwMiAxNy40ODcyODcyOSAxNi4yODA5ODYwMiAxNy40ODcyODcyOSAxNS45Nzc4NDQyNCAxNi4yNDY4ODcyMSBDMTQuODEwMjA5MzQgMTEuODA0OTMzNDYgMTMuNzk5Njc2MzYgOC44OTA1NzQxMSAxMCA2IEM3LjQ0MzcyNDc1IDQuODk3OTA2NjcgNy40NDM3MjQ3NSA0Ljg5NzkwNjY3IDQuNzUgNC4yNSBDMy44NTc5Njg3NSA0LjAwNzY1NjI1IDIuOTY1OTM3NSAzLjc2NTMxMjUgMi4wNDY4NzUgMy41MTU2MjUgQzEuMzcxNDA2MjUgMy4zNDU0Njg3NSAwLjY5NTkzNzUgMy4xNzUzMTI1IDAgMyBDMCAyLjAxIDAgMS4wMiAwIDAgWiAiIGZpbGw9IiMyMTI5NjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM2LDU0KSIvPgo8cGF0aCBkPSJNMCAwIEMzLjYzIDAgNy4yNiAwIDExIDAgQzE1IDkuNjI1IDE1IDkuNjI1IDE1IDEzIEMxNS42NiAxMyAxNi4zMiAxMyAxNyAxMyBDMTcuMTkzMzU5MzggMTIuMzk2NzE4NzUgMTcuMzg2NzE4NzUgMTEuNzkzNDM3NSAxNy41ODU5Mzc1IDExLjE3MTg3NSBDMTcuODQ2MzI4MTIgMTAuMzcyNjU2MjUgMTguMTA2NzE4NzUgOS41NzM0Mzc1IDE4LjM3NSA4Ljc1IEMxOC43NTc4NTE1NiA3LjU2NjY0MDYyIDE4Ljc1Nzg1MTU2IDcuNTY2NjQwNjIgMTkuMTQ4NDM3NSA2LjM1OTM3NSBDMjAgNCAyMCA0IDIyIDAgQzI1LjYzIDAgMjkuMjYgMCAzMyAwIEMzMS42MTIzNzc3OCA0LjQ4OTM2NjAxIDMwLjA5OTAyNzU4IDguODM1MTMyMDUgMjguMjA3MDMxMjUgMTMuMTM2NzE4NzUgQzI3LjcyNjY1NDA1IDE0LjI0Mjg1NTIyIDI3LjcyNjY1NDA1IDE0LjI0Mjg1NTIyIDI3LjIzNjU3MjI3IDE1LjM3MTMzNzg5IEMyNi41ODgzNzkzNiAxNi44NTIwMjc5OSAyNS45MjY0NjI4MyAxOC4zMjY4MDAwNiAyNS4yNDk3NTU4NiAxOS43OTQ2Nzc3MyBDMjEuMjM0Nzg2MTQgMjkuMDI3NTEyNzMgMjUuMDc1MDY3NzkgMzYuMzYzMTg5NTkgMjguNTYyNSA0NS4yNSBDMjkuNDAxNTk1MTQgNDcuMzk5MzA1OTEgMzAuMjM2NDQwNzggNDkuNTUwMjc3MTYgMzEuMDY2NDA2MjUgNTEuNzAzMTI1IEMzMS40MzcwOTIyOSA1Mi42NDgzMzAwOCAzMS44MDc3NzgzMiA1My41OTM1MzUxNiAzMi4xODk2OTcyNyA1NC41NjczODI4MSBDMzMgNTcgMzMgNTcgMzMgNjAgQzMxLjU2MTYzMjQ5IDU5Ljg4NTQxMzA3IDMwLjEyNDI5MDM0IDU5Ljc1NzkwODg0IDI4LjY4NzUgNTkuNjI1IEMyNy44ODY5OTIxOSA1OS41NTUzOTA2MyAyNy4wODY0ODQzOCA1OS40ODU3ODEyNSAyNi4yNjE3MTg3NSA1OS40MTQwNjI1IEMyNCA1OSAyNCA1OSAyMSA1NyBDMTkuNjEzMjgxMjUgNTMuOTYwOTM3NSAxOS42MTMyODEyNSA1My45NjA5Mzc1IDE4LjMxMjUgNTAuMzc1IEMxNy44NzU1MDc4MSA0OS4xODY0ODQzNyAxNy40Mzg1MTU2MyA0Ny45OTc5Njg3NSAxNi45ODgyODEyNSA0Ni43NzM0Mzc1IEMxNi42NjIxNDg0NCA0NS44NTgyMDMxMyAxNi4zMzYwMTU2MyA0NC45NDI5Njg3NSAxNiA0NCBDMTQuMjExNzgyMjYgNDYuNjgyMzI2NjEgMTIuNzk4NTczOTYgNDkuMzAyODg5NjEgMTEuMzc1IDUyLjE4NzUgQzEwLjkyODk4NDM4IDUzLjA4ODU1NDY5IDEwLjQ4Mjk2ODc1IDUzLjk4OTYwOTM4IDEwLjAyMzQzNzUgNTQuOTE3OTY4NzUgQzkuNjg1NzAzMTIgNTUuNjA1MDM5MDYgOS4zNDc5Njg3NSA1Ni4yOTIxMDkzNyA5IDU3IEM1LjcgNTYuNjcgMi40IDU2LjM0IC0xIDU2IEMtMC4zOTQ5ODQ5MyA0OS4xNzY3NzQ1NCAyLjkyNjY1MjAyIDQzLjQ2Njc3Nzg3IDUuOTM3NSAzNy40MzE2NDA2MiBDOC40NDU2MTQ0IDMyLjE0NzgyNjM3IDkuNzA2Nzk0NDIgMjguODM0MjUxNjYgOCAyMyBDNi43NTQ5MDE0NiAxOS41MzQxMTc5NSA1LjM3Mjc0NjExIDE2LjE0MTA0NzgxIDMuOTM3NSAxMi43NSBDMy4xOTE5Mjc4NyAxMC45NzU5MjA2OSAyLjQ1MDgyOTQ5IDkuMTk5OTUyNjcgMS43MTQ4NDM3NSA3LjQyMTg3NSBDMS4zODYwNTIyNSA2LjY0NDI0ODA1IDEuMDU3MjYwNzQgNS44NjY2MjEwOSAwLjcxODUwNTg2IDUuMDY1NDI5NjkgQzAgMyAwIDMgMCAwIFogIiBmaWxsPSIjRDgxRTI1IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMTgzLDUyKSIvPgo8cGF0aCBkPSJNMCAwIEMtMC42NiAzLjYzIC0xLjMyIDcuMjYgLTIgMTEgQy0yLjgyNSAxMC44MzUgLTMuNjUgMTAuNjcgLTQuNSAxMC41IEMtMTEuNDA5NDk0MjQgOS40MzI1NTU0MyAtMTEuNDA5NDk0MjQgOS40MzI1NTU0MyAtMTggMTEgQy0xNy45MDQ4MDU0NiAxMi44OTU3NjM2NiAtMTcuOTA0ODA1NDYgMTIuODk1NzYzNjYgLTE3IDE1IEMtMTQuNTcyODYxMyAxNi44NzM4MTgyMSAtMTQuNTcyODYxMyAxNi44NzM4MTgyMSAtMTEuNjI1IDE4LjUgQy03LjkzODczNzE5IDIwLjYzOTc4MzE2IC01LjIyOTM2OTIyIDIyLjMxNTc1MDIyIC0zIDI2IEMtMS41MDg4MTc1MSAzMS42NDUxOTA4NSAtMi4xNzg0MTgzNiAzNC45MjExNTMwNiAtNSA0MCBDLTkuMzQ2NDcyNTcgNDUuMTQ3MTM4NTcgLTEzLjQ5MjA4MjkgNDcuMDc2ODA4NDEgLTIwLjEyNSA0Ny43NSBDLTI1Ljk4NTQzMDQyIDQ4LjIyMDQyOTExIC0zMS4zMDM1NDk3NiA0Ny4zMzMyMTE3NiAtMzcgNDYgQy0zOC4wOTg5ODcwMiA0Mi43MDMwMzg5NSAtMzcuODcxMjQ0NDQgNDEuNTk1MDUwOTcgLTM3LjA2MjUgMzguMzEyNSBDLTM2Ljg2Nzg1MTU2IDM3LjUwNDI1NzgxIC0zNi42NzMyMDMxMyAzNi42OTYwMTU2MyAtMzYuNDcyNjU2MjUgMzUuODYzMjgxMjUgQy0zNi4zMTY2Nzk2OSAzNS4yNDgzOTg0NCAtMzYuMTYwNzAzMTIgMzQuNjMzNTE1NjMgLTM2IDM0IEMtMzQuODQ1IDM0LjMzIC0zMy42OSAzNC42NiAtMzIuNSAzNSBDLTI4LjE4MjA3NzU3IDM2LjA3MzcyODQ5IC0yNC40NDM3NDM0NCAzNi4zMDEyNzA3NCAtMjAgMzYgQy0xOS4wMSAzNS4zNCAtMTguMDIgMzQuNjggLTE3IDM0IEMtMTcuMTc4MjU1OTkgMzIuMDY3MDg1MjEgLTE3LjE3ODI1NTk5IDMyLjA2NzA4NTIxIC0xOCAzMCBDLTE5LjkwMzM3ODEzIDI4LjYwODcxNTU2IC0xOS45MDMzNzgxMyAyOC42MDg3MTU1NiAtMjIuMjUgMjcuNTYyNSBDLTMxLjA3MTA4MzE3IDIyLjkxMzE3MTEzIC0zMS4wNzEwODMxNyAyMi45MTMxNzExMyAtMzIuNjYwMTU2MjUgMTcuOTI5Njg3NSBDLTMzLjUwOTcyNjg3IDEzLjA2MzIxNTAxIC0zMy4wODExMzgwMSA5LjYxMDg4NDM3IC0zMC4yOTI5Njg3NSA1LjUgQy0yMi4zNjg4Mzc3IC0zLjY5Mjk0OTYyIC0xMC42NjIyMzUzMyAtMi42NjU1NTg4MyAwIDAgWiAiIGZpbGw9IiMyMjM5ODUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE0Niw1NSkiLz4KPHBhdGggZD0iTTAgMCBDNC4yNTM4MDEzOCAxLjUxOTIxNDc4IDUuODUwNjA1NjkgNC4xMzEwOTAyNCA4IDggQzEwLjIxNjIxNjM0IDE0LjEzODE3MjIyIDExLjE3ODUwNDM3IDIwLjIzMzA3NjcgOC41NjI1IDI2LjM3NSBDNyAyOSA3IDI5IDYgMzAgQzMuNjM2NzE4NzUgMzAuMjk2ODc1IDMuNjM2NzE4NzUgMzAuMjk2ODc1IDEgMzAgQy0wLjczMDQ2ODc1IDI4LjM5MDYyNSAtMC43MzA0Njg3NSAyOC4zOTA2MjUgLTIuMTg3NSAyNi4yNSBDLTIuOTIwMzMyMDMgMjUuMjA1ODU5MzggLTIuOTIwMzMyMDMgMjUuMjA1ODU5MzggLTMuNjY3OTY4NzUgMjQuMTQwNjI1IEMtNC45MTMwODMwNCAyMi4xMzk2Nzg4OCAtNS45ODkwNDQ2MiAyMC4xMjczMTg0MyAtNyAxOCBDLTcuMTk5MTYwMTYgMTkuMjY0NTcwMzEgLTcuMTk5MTYwMTYgMTkuMjY0NTcwMzEgLTcuNDAyMzQzNzUgMjAuNTU0Njg3NSBDLTcuNTc4OTQ1MzEgMjEuNjUwMzkwNjIgLTcuNzU1NTQ2ODggMjIuNzQ2MDkzNzUgLTcuOTM3NSAyMy44NzUgQy04LjExMTUyMzQ0IDI0Ljk2NTU0Njg4IC04LjI4NTU0Njg4IDI2LjA1NjA5Mzc1IC04LjQ2NDg0Mzc1IDI3LjE3OTY4NzUgQy05IDMwIC05IDMwIC0xMCAzMiBDLTExLjg3NSAzMS43NSAtMTEuODc1IDMxLjc1IC0xNCAzMSBDLTE1LjI1IDI4LjkzNzUgLTE1LjI1IDI4LjkzNzUgLTE2IDI3IEMtMTYuNDMzMTI1IDI3LjQ3NDM3NSAtMTYuODY2MjUgMjcuOTQ4NzUgLTE3LjMxMjUgMjguNDM3NSBDLTIxLjI2ODUzMTg1IDMyLjEwMDQ5MjQ1IC0yNi43NTQ4NDI1IDMxLjMyNjM3NjY4IC0zMS44MjAzMTI1IDMxLjI4MTI1IEMtMzYuMjA3MDY0MDkgMzAuODkzMjMyNjYgLTM3LjkwMzMwOTI4IDMwLjA5NjY5MDcyIC00MSAyNyBDLTQyLjU2MjUgMjQuNSAtNDIuNTYyNSAyNC41IC00MyAyMiBDLTQxLjYyNSAxOS42ODc1IC00MS42MjUgMTkuNjg3NSAtNDAgMTggQy00MS4zMiAxNy4wMSAtNDIuNjQgMTYuMDIgLTQ0IDE1IEMtNDQgMTEuNzUgLTQ0IDExLjc1IC00MyA4IEMtMzcuODIzNzMwOTQgMy44MDUyMDc0OSAtMzIuMDE2MTEwNTQgMy40NTA1OTcyMiAtMjUuNjI1IDMuNjg3NSBDLTI0LjgxOTMzNTk0IDMuNjk3MTY3OTcgLTI0LjAxMzY3MTg4IDMuNzA2ODM1OTQgLTIzLjE4MzU5Mzc1IDMuNzE2Nzk2ODggQy0xNy4zNDEzMjczMSAzLjgyOTMzNjM1IC0xNy4zNDEzMjczMSAzLjgyOTMzNjM1IC0xNSA1IEMtMTUuMzEyNSA2LjkzNzUgLTE1LjMxMjUgNi45Mzc1IC0xNiA5IEMtMjAuMjg5NzAxMzQgMTAuNDI5OTAwNDUgLTI0LjU3MTM0MzI0IDEwLjQzODEyMTc2IC0yOS4wNjY0MDYyNSAxMC43MTg3NSBDLTMxLjkzMTY1NzQ2IDEwLjgxNTkwNjYxIC0zMS45MzE2NTc0NiAxMC44MTU5MDY2MSAtMzQgMTIgQy0zMy4wMzU3ODEyNSAxMi4xMDk1NzAzMSAtMzIuMDcxNTYyNSAxMi4yMTkxNDA2MiAtMzEuMDc4MTI1IDEyLjMzMjAzMTI1IEMtMjkuODE0ODQzNzUgMTIuNDkwNTg1OTQgLTI4LjU1MTU2MjUgMTIuNjQ5MTQwNjMgLTI3LjI1IDEyLjgxMjUgQy0yNS4zNzA1NDY4NyAxMy4wMzg3MzA0NyAtMjUuMzcwNTQ2ODcgMTMuMDM4NzMwNDcgLTIzLjQ1MzEyNSAxMy4yNjk1MzEyNSBDLTIwLjA1NDQ1OTUzIDEzLjk4ODQ3OTcxIC0xOC40MjUxMDM5MSAxNC41NjkwMDk5MSAtMTYgMTcgQy0xNS42NyAxNy45OSAtMTUuMzQgMTguOTggLTE1IDIwIEMtMTQuODc4ODI4MTMgMTkuMzI0NTMxMjUgLTE0Ljc1NzY1NjI1IDE4LjY0OTA2MjUgLTE0LjYzMjgxMjUgMTcuOTUzMTI1IEMtMTQuNDY1MjM0MzggMTcuMDYxMDkzNzUgLTE0LjI5NzY1NjI1IDE2LjE2OTA2MjUgLTE0LjEyNSAxNS4yNSBDLTEzLjk2MjU3ODEzIDE0LjM2ODI4MTI1IC0xMy44MDAxNTYyNSAxMy40ODY1NjI1IC0xMy42MzI4MTI1IDEyLjU3ODEyNSBDLTEzLjAzMjAzNzM2IDEwLjEzMDUyMjU2IC0xMi4yMjAwMjg4MyA4LjE5NDAwMTQzIC0xMSA2IEMtOC43Njk1MzEyNSA2LjEyMTA5Mzc1IC04Ljc2OTUzMTI1IDYuMTIxMDkzNzUgLTYgNyBDLTMuNzYxNzE4NzUgOS43MjI2NTYyNSAtMy43NjE3MTg3NSA5LjcyMjY1NjI1IC0xLjY4NzUgMTMuMDYyNSBDLTAuOTkwMTE3MTkgMTQuMTY3MjI2NTYgLTAuMjkyNzM0MzggMTUuMjcxOTUzMTIgMC40MjU3ODEyNSAxNi40MTAxNTYyNSBDMS4yMDUwMTk1MyAxNy42OTIxMjg5MSAxLjIwNTAxOTUzIDE3LjY5MjEyODkxIDIgMTkgQzEuODAwODM5ODQgMTcuODA1MDM5MDYgMS44MDA4Mzk4NCAxNy44MDUwMzkwNiAxLjU5NzY1NjI1IDE2LjU4NTkzNzUgQzEuMDY1MTA0MTcgMTMuMzkwNjI1IDAuNTMyNTUyMDggMTAuMTk1MzEyNSAwIDcgQy0wLjIwNzUzOTA2IDUuODk5MTQwNjMgLTAuNDE1MDc4MTMgNC43OTgyODEyNSAtMC42Mjg5MDYyNSAzLjY2NDA2MjUgQy0wLjc1MTM2NzE5IDIuNzg0OTIxODcgLTAuODczODI4MTMgMS45MDU3ODEyNSAtMSAxIEMtMC42NyAwLjY3IC0wLjM0IDAuMzQgMCAwIFogTS0yOCAxOCBDLTI2LjE4Nzc3NDY2IDIwLjA2MjQ5OTQgLTI2LjE4Nzc3NDY2IDIwLjA2MjQ5OTQgLTI0IDIyIEMtMjMuMDEgMjIgLTIyLjAyIDIyIC0yMSAyMiBDLTIxLjMzIDIxLjAxIC0yMS42NiAyMC4wMiAtMjIgMTkgQy0yNC45NyAxOC41MDUgLTI0Ljk3IDE4LjUwNSAtMjggMTggWiBNLTM5IDIyIEMtMzkgMjIuNjYgLTM5IDIzLjMyIC0zOSAyNCBDLTM2LjAzIDI0LjMzIC0zMy4wNiAyNC42NiAtMzAgMjUgQy0zMi4zNTk2ODc0NCAyMi45MDI1MDAwNSAtMzMuNTQ2MTY5OTQgMjIuMDMwOTQyOTYgLTM2Ljc1IDIxLjgxMjUgQy0zNy40OTI1IDIxLjg3NDM3NSAtMzguMjM1IDIxLjkzNjI1IC0zOSAyMiBaICIgZmlsbD0iIzIyMUUyMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNjIwLDY3KSIvPgo8cGF0aCBkPSJNMCAwIEMyLjA1NDY4NzUgLTAuMTk5MjE4NzUgMi4wNTQ2ODc1IC0wLjE5OTIxODc1IDUuODY3MTg3NSAwLjM2MzI4MTI1IEM4LjI4Mjg5NDcyIDIuNDI4NzM2NjggMTAuMDk2NDE2NDkgNC43MzM5NTQ2IDExLjg2NzE4NzUgNy4zNjMyODEyNSBDMTIuMTQ5NDkyMTkgNi44NDYzNjcxOSAxMi40MzE3OTY4NyA2LjMyOTQ1MzEzIDEyLjcyMjY1NjI1IDUuNzk2ODc1IEMxNC4yNzE2ODgxMyAzLjQ3NTU5ODQ4IDE1LjU3MTg3NDIgMS45NzEyNTAyOCAxNy44NjcxODc1IDAuMzYzMjgxMjUgQzI2LjQ3NDM3MzUgLTAuNzg0MzQzNTUgMzQuOTQxNzAyNzcgMi4yOTMwNDg0MyA0Mi44NjcxODc1IDUuMzYzMjgxMjUgQzQxLjE2MTc1MzAxIDkuMTA0MjM0MzIgMzkuMjkzODYwOCAxMS4wMjMxMTQxMiAzNS44NjcxODc1IDEzLjM2MzI4MTI1IEMzNC44NzcxODc1IDEzLjM2MzI4MTI1IDMzLjg4NzE4NzUgMTMuMzYzMjgxMjUgMzIuODY3MTg3NSAxMy4zNjMyODEyNSBDMzIuMjA3MTg3NSAxMi4zNzMyODEyNSAzMS41NDcxODc1IDExLjM4MzI4MTI1IDMwLjg2NzE4NzUgMTAuMzYzMjgxMjUgQzI4LjY3MjY0MDY5IDkuNzgzMzQ0MjYgMjguNjcyNjQwNjkgOS43ODMzNDQyNiAyNi4yNDIxODc1IDkuNjc1NzgxMjUgQzI1LjQyNDkyMTg4IDkuNjEwMDM5MDYgMjQuNjA3NjU2MjUgOS41NDQyOTY4OCAyMy43NjU2MjUgOS40NzY1NjI1IEMyMi44MjU4OTg0NCA5LjQyMDQ4ODI4IDIyLjgyNTg5ODQ0IDkuNDIwNDg4MjggMjEuODY3MTg3NSA5LjM2MzI4MTI1IEMyMS43NTg4NzYwNCA5Ljk5OTk5MjUyIDIxLjY1MDU2NDU4IDEwLjYzNjcwMzggMjEuNTM4OTcwOTUgMTEuMjkyNzA5MzUgQzIwLjQxMzg1NTQzIDE3Ljg5NjI5MTI1IDE5LjI3NjQ4MDM1IDI0LjQ5NzY3NjE0IDE4LjEzMTgzNTk0IDMxLjA5NzkwMDM5IEMxNy43MDU4MDczNiAzMy41NjQxNTA1NiAxNy4yODI5NDkwNyAzNi4wMzA5NTA1MSAxNi44NjMyODEyNSAzOC40OTgyOTEwMiBDMTYuMjYwODYwODcgNDIuMDM2ODAwMzYgMTUuNjQ3MjEwNTMgNDUuNTczMjAwOSAxNS4wMzEyNSA0OS4xMDkzNzUgQzE0Ljg0NDcwODU2IDUwLjIxOTc3NjQ2IDE0LjY1ODE2NzExIDUxLjMzMDE3NzkyIDE0LjQ2NTk3MjkgNTIuNDc0MjI3OTEgQzE0LjI4NTkzNzE5IDUzLjQ5NTIxMDcyIDE0LjEwNTkwMTQ5IDU0LjUxNjE5MzU0IDEzLjkyMDQxMDE2IDU1LjU2ODExNTIzIEMxMy42ODcyNDU5NCA1Ni45MjM3OTg2IDEzLjY4NzI0NTk0IDU2LjkyMzc5ODYgMTMuNDQ5MzcxMzQgNTguMzA2ODY5NTEgQzEzLjI1NzI1MDY3IDU4Ljk4NTQ4NTM4IDEzLjA2NTEzIDU5LjY2NDEwMTI2IDEyLjg2NzE4NzUgNjAuMzYzMjgxMjUgQzExLjg3NzE4NzUgNjAuODU4MjgxMjUgMTEuODc3MTg3NSA2MC44NTgyODEyNSAxMC44NjcxODc1IDYxLjM2MzI4MTI1IEM5LjU4MDQ1Mjg0IDU0LjQ1OTA5MjQzIDguMjk5Mjc3MDIgNDcuNTUzODg4ODYgNy4wMjE5NzI2NiA0MC42NDc5NDkyMiBDNi41ODY3MzE3NyAzOC4yOTg0Mjc0MSA2LjE1MDIxNTc5IDM1Ljk0OTE0MTQ1IDUuNzEyNDAyMzQgMzMuNjAwMDk3NjYgQzUuMDgzNTYyMzcgMzAuMjI0ODk1MzcgNC40NTkzMDI5NCAyNi44NDg4NzMzNSAzLjgzNTkzNzUgMjMuNDcyNjU2MjUgQzMuNTQwNjQxNDggMjEuODk1OTAxMTggMy41NDA2NDE0OCAyMS44OTU5MDExOCAzLjIzOTM3OTg4IDIwLjI4NzI5MjQ4IEMzLjA1OTE5MzEyIDE5LjMwNjU3Nzc2IDIuODc5MDA2MzUgMTguMzI1ODYzMDQgMi42OTMzNTkzOCAxNy4zMTU0Mjk2OSBDMi41MzM0NzUzNCAxNi40NTM4MzI0IDIuMzczNTkxMzEgMTUuNTkyMjM1MTEgMi4yMDg4NjIzIDE0LjcwNDUyODgxIEMxLjg2NzE4NzUgMTIuMzYzMjgxMjUgMS44NjcxODc1IDEyLjM2MzI4MTI1IDEuODY3MTg3NSA4LjM2MzI4MTI1IEMtMS43NjI4MTI1IDkuMDIzMjgxMjUgLTUuMzkyODEyNSA5LjY4MzI4MTI1IC05LjEzMjgxMjUgMTAuMzYzMjgxMjUgQy05LjQ2MjgxMjUgMTEuMzUzMjgxMjUgLTkuNzkyODEyNSAxMi4zNDMyODEyNSAtMTAuMTMyODEyNSAxMy4zNjMyODEyNSBDLTE1LjA4OTc3ODMxIDEyLjEyNDAzOTggLTE3LjI0OTM5NzE2IDEwLjU3NzUwMzY3IC0yMC4xMzI4MTI1IDYuMzYzMjgxMjUgQy0xMy40NzU0Nzc3IDMuMTIxMTc0OTQgLTcuMjY2ODA3MzkgMS4yMzc3NTI5MSAwIDAgWiAiIGZpbGw9IiNFODIwMjYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE3NzUuMTMyODEyNSwzNS42MzY3MTg3NSkiLz4KPHBhdGggZD0iTTAgMCBDOC41OCAwIDE3LjE2IDAgMjYgMCBDMjYgMy4zIDI2IDYuNiAyNiAxMCBDMjAuNzIgMTAgMTUuNDQgMTAgMTAgMTAgQzEwIDEzLjYzIDEwIDE3LjI2IDEwIDIxIEMxMy45NiAyMSAxNy45MiAyMSAyMiAyMSBDMjIgMjQuMyAyMiAyNy42IDIyIDMxIEMxOC4wNCAzMSAxNC4wOCAzMSAxMCAzMSBDMTAgMzUuMjkgMTAgMzkuNTggMTAgNDQgQzE3LjkyIDQzLjUwNSAxNy45MiA0My41MDUgMjYgNDMgQzI2IDQ2LjMgMjYgNDkuNiAyNiA1MyBDMjIuODY0NjI0MDIgNTQuMDQ1MTI1MzMgMjAuMjI4NTQ5MDIgNTQuMzE1Mzc3MTMgMTYuOTM3NSA1NC41NjI1IEMxNS44NzQwMjM0NCA1NC42NDYyODkwNiAxNC44MTA1NDY4OCA1NC43MzAwNzgxMyAxMy43MTQ4NDM3NSA1NC44MTY0MDYyNSBDOS4xNDgzOTI5NSA1NS4wNDIwODc4NCA0LjU3MjAyNDE4IDU1IDAgNTUgQzAgMzYuODUgMCAxOC43IDAgMCBaICIgZmlsbD0iI0Q4MUUyNiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAzNSw1MikiLz4KPHBhdGggZD0iTTAgMCBDMS45MTAxNTYyNSAwLjgyMDMxMjUgMS45MTAxNTYyNSAwLjgyMDMxMjUgNC41MzUxNTYyNSAyLjMyMDMxMjUgQzQuNTM1MTU2MjUgNC45NjAzMTI1IDQuNTM1MTU2MjUgNy42MDAzMTI1IDQuNTM1MTU2MjUgMTAuMzIwMzEyNSBDMS43NzIzOTQ0OCA5Ljc5NzYyNzg0IC0wLjc5MDkzMTM1IDkuMjExNjE2NjMgLTMuNDY0ODQzNzUgOC4zMjAzMTI1IEMtNS4wMjYwMjgwMyA4LjI1MjkwMzg1IC02LjU4OTg2ODk1IDguMjM1MTY3OTQgLTguMTUyMzQzNzUgOC4yNTc4MTI1IEMtOC45NjA1ODU5NCA4LjI2NjgzNTk0IC05Ljc2ODgyODEzIDguMjc1ODU5MzcgLTEwLjYwMTU2MjUgOC4yODUxNTYyNSBDLTExLjIxNjQ0NTMxIDguMjk2NzU3ODEgLTExLjgzMTMyODEzIDguMzA4MzU5MzggLTEyLjQ2NDg0Mzc1IDguMzIwMzEyNSBDLTEyLjc5NDg0Mzc1IDkuMzEwMzEyNSAtMTMuMTI0ODQzNzUgMTAuMzAwMzEyNSAtMTMuNDY0ODQzNzUgMTEuMzIwMzEyNSBDLTEyLjU4NDQxNDA2IDExLjcwNzAzMTI1IC0xMS43MDM5ODQzNyAxMi4wOTM3NSAtMTAuNzk2ODc1IDEyLjQ5MjE4NzUgQy05LjYzNTQyOTY5IDEzLjAxMjk2ODc1IC04LjQ3Mzk4NDM4IDEzLjUzMzc1IC03LjI3NzM0Mzc1IDE0LjA3MDMxMjUgQy01LjU1NDUxMTcyIDE0LjgzNjAxNTYzIC01LjU1NDUxMTcyIDE0LjgzNjAxNTYzIC0zLjc5Njg3NSAxNS42MTcxODc1IEMwLjI0MTM3MzEyIDE3LjY4MTI4NjE5IDMuNTY0NTg1NyAxOS42ODc5ODkzIDUuOTEwMTU2MjUgMjMuNjMyODEyNSBDNi45OTYzOTk0NiAyOC4zMDM2NTgzIDYuMzE4NTczOSAzMS44ODQwNDY4MSA0LjAzNTE1NjI1IDM2LjA3MDMxMjUgQy0wLjE5NDIwMDc5IDM5Ljg3NjczMzg0IC00LjYxMjE4MDA4IDQxLjI1NzA5NTU4IC0xMC4yODUxNTYyNSA0MS4zODI4MTI1IEMtMTUuNjc4ODQ0MzEgNDEuMDMwMDkxNzUgLTE5Ljg2NjQ0MTQ4IDQwLjE3ODc3ODc4IC0yNC40NjQ4NDM3NSAzNy4zMjAzMTI1IEMtMjQuNDY0ODQzNzUgMzQuMDIwMzEyNSAtMjQuNDY0ODQzNzUgMzAuNzIwMzEyNSAtMjQuNDY0ODQzNzUgMjcuMzIwMzEyNSBDLTIzLjE2NTQ2ODc1IDI3Ljk4MDMxMjUgLTIxLjg2NjA5Mzc1IDI4LjY0MDMxMjUgLTIwLjUyNzM0Mzc1IDI5LjMyMDMxMjUgQy0xNS41OTQwNTE2OSAzMS41NDQyMDkyNCAtMTEuODI1MTI2MDMgMzEuNjYwNjQ3ODggLTYuNDY0ODQzNzUgMzEuMzIwMzEyNSBDLTYuNDY0ODQzNzUgMzAuMDAwMzEyNSAtNi40NjQ4NDM3NSAyOC42ODAzMTI1IC02LjQ2NDg0Mzc1IDI3LjMyMDMxMjUgQy03LjQxNzQ2MDk0IDI2Ljk1Njc5Njg3IC04LjM3MDA3ODEyIDI2LjU5MzI4MTI1IC05LjM1MTU2MjUgMjYuMjE4NzUgQy0yMi40OTU3MTQwNSAyMS4wMzAxNzczIC0yMi40OTU3MTQwNSAyMS4wMzAxNzczIC0yNS40NjQ4NDM3NSAxNS4zMjAzMTI1IEMtMjYuMjE3MDIwNTkgMTEuNDI4OTQ4NjQgLTI1LjgyMjM5NTM5IDguMjE0MTkxNTkgLTI0LjMzOTg0Mzc1IDQuNTA3ODEyNSBDLTE4LjQ5MTUxODczIC0yLjMxNTIzMzM1IC04LjEzNzk4MzIgLTIuMjQ0MDcxNDQgMCAwIFogIiBmaWxsPSIjMDA4NDI5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxOTY5LjQ2NDg0Mzc1LDQwLjY3OTY4NzUpIi8+CjxwYXRoIGQ9Ik0wIDAgQzguOTEgMCAxNy44MiAwIDI3IDAgQzI3IDMuMyAyNyA2LjYgMjcgMTAgQzIxLjM5IDEwIDE1Ljc4IDEwIDEwIDEwIEMxMCAxMy42MyAxMCAxNy4yNiAxMCAyMSBDMTQuMjkgMjEgMTguNTggMjEgMjMgMjEgQzIzIDI0LjMgMjMgMjcuNiAyMyAzMSBDMTguNzEgMzEgMTQuNDIgMzEgMTAgMzEgQzEwIDM3LjkzIDEwIDQ0Ljg2IDEwIDUyIEM2LjcgNTIgMy40IDUyIDAgNTIgQzAgMzQuODQgMCAxNy42OCAwIDAgWiAiIGZpbGw9IiNEODFFMjYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDExMDEsNTIpIi8+CjxwYXRoIGQ9Ik0wIDAgQzIuOTcgMCA1Ljk0IDAgOSAwIEM5IDEzLjUzIDkgMjcuMDYgOSA0MSBDNS4zNyA0MSAxLjc0IDQxIC0yIDQxIEMtMy4yMTY4NzUgNDEuMjQ3NSAtNC40MzM3NSA0MS40OTUgLTUuNjg3NSA0MS43NSBDLTEwLjMxMDAyNjQxIDQyLjA5ODg2OTkyIC0xMy4zMDg5OTE4NSA0MC43MzUwMDM3OSAtMTcgMzggQy0yMC42ODY4MTg5NSAzMy4xNjEwNTAxMyAtMjAuNjk0NzYzNjEgMjcuODUzMTQ1NTEgLTIwIDIyIEMtMTguNzI2MDcyMzggMTguMzEyMzE0NzcgLTE3Ljc0NDY5MDYyIDE2LjU4MzY3NjQzIC0xNC42ODc1IDE0LjE4NzUgQy05LjYzMTE5NDU5IDExLjk1MzMxODU0IC02LjQ1NjIyNjA3IDExLjkwODc1NDc5IC0xIDEzIEMtMC42NyA4LjcxIC0wLjM0IDQuNDIgMCAwIFogTS05LjQzNzUgMjEuMDYyNSBDLTExLjI1OTI1OTU5IDI0LjQ4NzQwODAyIC0xMS42MzY3NDE4MyAyNi4xNzk1NDkgLTExIDMwIEMtOS40NTY2NDk3MSAzMi45NTA0NzU1MyAtOS40NTY2NDk3MSAzMi45NTA0NzU1MyAtNyAzNSBDLTQuNDE0MTc4NzIgMzUuNTg0MDIxMzMgLTQuNDE0MTc4NzIgMzUuNTg0MDIxMzMgLTIgMzUgQzAuMzI4NjYyMjkgMzMuMTExNTM4MTcgMC4zMjg2NjIyOSAzMy4xMTE1MzgxNyAwLjE5NTMxMjUgMjkuOTYwOTM3NSBDMC4xNzIxMDkzOCAyOC43Nzc1NzgxMiAwLjE0ODkwNjI1IDI3LjU5NDIxODc1IDAuMTI1IDI2LjM3NSBDMC4xMDY5NTMxMyAyNS4xODY0ODQzNyAwLjA4ODkwNjI1IDIzLjk5Nzk2ODc1IDAuMDcwMzEyNSAyMi43NzM0Mzc1IEMwLjA0NzEwOTM4IDIxLjg1ODIwMzEzIDAuMDIzOTA2MjUgMjAuOTQyOTY4NzUgMCAyMCBDLTUuMTAxNDUzNyAxOC41Nzg2MzU2MiAtNS4xMDE0NTM3IDE4LjU3ODYzNTYyIC05LjQzNzUgMjEuMDYyNSBaICIgZmlsbD0iIzAwODQyOSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjEzMSw0MCkiLz4KPHBhdGggZD0iTTAgMCBDOS45IDAgMTkuOCAwIDMwIDAgQzMwIDMuMyAzMCA2LjYgMzAgMTAgQzI2LjcgMTAgMjMuNCAxMCAyMCAxMCBDMjAgMjMuODYgMjAgMzcuNzIgMjAgNTIgQzE1LjA1IDUyLjQ5NSAxNS4wNSA1Mi40OTUgMTAgNTMgQzEwIDM4LjgxIDEwIDI0LjYyIDEwIDEwIEM2LjcgMTAgMy40IDEwIDAgMTAgQzAgNi43IDAgMy40IDAgMCBaICIgZmlsbD0iI0Q4MUUyNiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTA2Niw1MikiLz4KPHBhdGggZD0iTTAgMCBDLTAuNDgxMTQ5MSA1Ljc3Mzc4OTI1IC0yLjE4NDY3MTgxIDkuOTU4NTk4MzYgLTUgMTUgQy00LjMxOTM3NSAxNC4yOTg3NSAtMy42Mzg3NSAxMy41OTc1IC0yLjkzNzUgMTIuODc1IEMtMS45NjMyMDUxNCAxMS45MTE3MTQxMyAtMC45ODM1MTk0NiAxMC45NTM4NjU2MSAwIDEwIEMwLjU1NDI5Njg3IDkuNDYxMTcxODggMS4xMDg1OTM3NSA4LjkyMjM0Mzc1IDEuNjc5Njg3NSA4LjM2NzE4NzUgQzUuMjUwOTM2OCA1LjA4MTYzODE0IDcuODk2NjgzMzIgMi44ODQwMTU1MyAxMyAzIEMxNS4wMDY0OTYwNyA0LjUzNjM3NTAxIDE1Ljg3Mzg5MDQ5IDUuNTg4MTQ4NyAxNi42MTcxODc1IDguMDE1NjI1IEMxNy4yNTE1NjExIDEzLjUxMzUyOTUzIDE2Ljg0OTMwMTA3IDE3LjA2MTIxMTQ3IDE0IDIyIEMxMS4wNTUwNzk0MyAyNS40MDk5MDgwMyA4LjEyMTcwMjE1IDI4LjEzNTQyMDQ2IDQgMzAgQzEuNjY3MTQ1MiAzMC4wNDcyNTM5OSAtMC42NjcyNDM5MyAzMC4wNTE4OTk3MyAtMyAzMCBDLTMuMjY1NTQ2ODggMzEuMDczNzg5MDYgLTMuNTMxMDkzNzUgMzIuMTQ3NTc4MTIgLTMuODA0Njg3NSAzMy4yNTM5MDYyNSBDLTQuMTYxMzk0MjEgMzQuNjkwMTIwMSAtNC41MTgxNjg2NiAzNi4xMjYzMTcxMiAtNC44NzUgMzcuNTYyNSBDLTUuMDQ5MDIzNDQgMzguMjY2OTcyNjYgLTUuMjIzMDQ2ODggMzguOTcxNDQ1MzEgLTUuNDAyMzQzNzUgMzkuNjk3MjY1NjIgQy02LjUxMjk0ODE1IDQ0LjE2MDI0OTk4IC03LjcxMjAxMjE2IDQ4LjU4NDg3MDUyIC05IDUzIEMtMTMuODc1IDUxLjI1IC0xMy44NzUgNTEuMjUgLTE1IDQ5IEMtMTUuODA3NzM2NjkgNDEuNjExMTk1NTcgLTE0LjQ0MzM4Mzc0IDM1LjkyMzE3NjkzIC0xMS44NzEwOTM3NSAyOS4wNDI5Njg3NSBDLTEwLjkzNjk5MDk5IDI1Ljc3OTg5MjMxIC0xMC44OTM4OTA4MiAyMy4yNTE1MDY5MSAtMTEuMDYyNSAxOS44NzUgQy0xMS4zNDcwMDEzMyAxMi4zOTk0ODI0MiAtOC41MjkxMDMxNSA3LjAzNDkyMzc4IC0zLjgxMjUgMS4zNzUgQy0yIDAgLTIgMCAwIDAgWiBNMTAgMTAgQzcuOTU1NDM5NDEgMTIuMTcyNjQ2NTUgNy45NTU0Mzk0MSAxMi4xNzI2NDY1NSA1Ljg3NSAxNC44NzUgQzUuMTUwNTQ2ODggMTUuNzc5OTIxODcgNC40MjYwOTM3NSAxNi42ODQ4NDM3NSAzLjY3OTY4NzUgMTcuNjE3MTg3NSBDMS44MDc5NDc2NiAxOS43ODY1NTgxMSAxLjgwNzk0NzY2IDE5Ljc4NjU1ODExIDIgMjIgQzYuMDE1MzA1MDUgMjEuMDg3NDMwNjcgNy43MTEyODI3NSAyMC4zNDk0OTk4MyAxMC4zNzUgMTcuMTI1IEMxMi4zMDc1Njg0OSAxMy45OTU1NjM5MiAxMi4zMDc1Njg0OSAxMy45OTU1NjM5MiAxMiAxMCBDMTEuMzQgMTAgMTAuNjggMTAgMTAgMTAgWiAiIGZpbGw9IiMyMjFFMjAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDY2NSw3MCkiLz4KPHBhdGggZD0iTTAgMCBDMy4zIDAgNi42IDAgMTAgMCBDMTAgMTQuMTkgMTAgMjguMzggMTAgNDMgQzEzLjk2IDQzIDE3LjkyIDQzIDIyIDQzIEMyMy4zMiA0My4zMyAyNC42NCA0My42NiAyNiA0NCBDMjYgNDcuMyAyNiA1MC42IDI2IDU0IEMxMy4xMyA1My41MDUgMTMuMTMgNTMuNTA1IDAgNTMgQzAgMzUuNTEgMCAxOC4wMiAwIDAgWiAiIGZpbGw9IiNEODFFMjYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDExMzMsNTIpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuMyAwIDYuNiAwIDEwIDAgQzEwLjMzIDQuNjIgMTAuNjYgOS4yNCAxMSAxNCBDMTIuNTQ2ODc1IDEzLjQ0MzEyNSAxMi41NDY4NzUgMTMuNDQzMTI1IDE0LjEyNSAxMi44NzUgQzE4LjM5OTA1MzgzIDExLjkwOTg5MTA3IDIwLjEwMjI4MDU4IDEyLjEzOTcyNDgyIDI0IDE0IEMyNS45NTA0Njk0MiAxNS42MTQxODE1OSAyNi44NzAxODY5MyAxNi43NDAzNzM4NiAyOCAxOSBDMjguMDcxODE4MjEgMjEuNzE3NjAxMDggMjguMDkyOTk1MDYgMjQuNDA4NTkzODggMjguMDYyNSAyNy4xMjUgQzI4LjA1Nzk4ODI4IDI3Ljg3OTEwMTU2IDI4LjA1MzQ3NjU2IDI4LjYzMzIwMzEyIDI4LjA0ODgyODEyIDI5LjQxMDE1NjI1IEMyOC4wMzcwMzQ5OSAzMS4yNzM0NzEyNyAyOC4wMTkwOTk0MiAzMy4xMzY3NDU1NSAyOCAzNSBDMjMuNTQ1IDM1LjQ5NSAyMy41NDUgMzUuNDk1IDE5IDM2IEMxOC45Mzk0MTQwNiAzNS4wODQ3NjU2MyAxOC44Nzg4MjgxMiAzNC4xNjk1MzEyNSAxOC44MTY0MDYyNSAzMy4yMjY1NjI1IEMxOC43MzI2MTcxOSAzMi4wMzgwNDY4NyAxOC42NDg4MjgxMiAzMC44NDk1MzEyNSAxOC41NjI1IDI5LjYyNSBDMTguNDgxMjg5MDYgMjguNDQxNjQwNjMgMTguNDAwMDc4MTIgMjcuMjU4MjgxMjUgMTguMzE2NDA2MjUgMjYuMDM5MDYyNSBDMTguMTg5MTUwNjQgMjMuMDg0ODEwOTkgMTguMTg5MTUwNjQgMjMuMDg0ODEwOTkgMTcgMjEgQzE1LjMzMzg4MDk1IDIwLjk1NzI3OSAxMy42NjYxNzExNSAyMC45NTkzNjE2OCAxMiAyMSBDMTAuNDUwNDk3MzIgMjIuNTQ5NTAyNjggMTAuNzgzNDQ4MDcgMjQuMDk5OTA1OTQgMTAuNjgzNTkzNzUgMjYuMjUzOTA2MjUgQzEwLjY0MTY5OTIyIDI3LjEwNzkxMDE2IDEwLjU5OTgwNDY5IDI3Ljk2MTkxNDA2IDEwLjU1NjY0MDYyIDI4Ljg0MTc5Njg4IEMxMC41MTczMjQyMiAyOS43Mzk2Mjg5MSAxMC40NzgwMDc4MSAzMC42Mzc0NjA5NCAxMC40Mzc1IDMxLjU2MjUgQzEwLjM5NDMxNjQxIDMyLjQ2NDE5OTIyIDEwLjM1MTEzMjgxIDMzLjM2NTg5ODQ0IDEwLjMwNjY0MDYyIDM0LjI5NDkyMTg4IEMxMC4yMDAyMjAxNiAzNi41Mjk3NTE1NiAxMC4wOTk1NzUxOSAzOC43NjQ4NTQ4NiAxMCA0MSBDNi43IDQxIDMuNCA0MSAwIDQxIEMwIDI3LjQ3IDAgMTMuOTQgMCAwIFogIiBmaWxsPSIjMDA4NDI5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyMDA1LDQwKSIvPgo8cGF0aCBkPSJNMCAwIEM0LjI5IDAgOC41OCAwIDEzIDAgQzkuOTk1NDE0NiAxNi4wODQxMjA5OCA2Ljc1MDQyOTQ2IDMyLjA3MjY0NDI3IDMgNDggQy0xLjI5IDQ4IC01LjU4IDQ4IC0xMCA0OCBDLTkuMzUyMDc5OTYgNDIuMjQzMTY0OTggLTguMzkyNDE1OTEgMzYuNjQxMDIxMyAtNy4xODc1IDMwLjk3NjU2MjUgQy03LjAxMzcxODI2IDMwLjE0OTE3NTcyIC02LjgzOTkzNjUyIDI5LjMyMTc4ODk0IC02LjY2MDg4ODY3IDI4LjQ2OTMyOTgzIEMtNi4yOTYwMjY4NiAyNi43MzYyMTU3NCAtNS45Mjk1NTA3IDI1LjAwMzQ0MDc3IC01LjU2MTUyMzQ0IDIzLjI3MDk5NjA5IEMtNC45OTczNjgxOSAyMC42MTI1OTg0NyAtNC40Mzk3NTU1NCAxNy45NTI4ODU2NSAtMy44ODI4MTI1IDE1LjI5Mjk2ODc1IEMtMy41MjY0Mjg0MSAxMy42MDQwODUwMSAtMy4xNjk2NzA5OSAxMS45MTUyOCAtMi44MTI1IDEwLjIyNjU2MjUgQy0yLjY0NTgwODExIDkuNDMwNzc3ODkgLTIuNDc5MTE2MjEgOC42MzQ5OTMyOSAtMi4zMDczNzMwNSA3LjgxNTA5Mzk5IEMtMS4xMTUxOTMxMyAyLjIzMDM4NjI2IC0xLjExNTE5MzEzIDIuMjMwMzg2MjYgMCAwIFogIiBmaWxsPSIjMjIzMTc1IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5OCw1NCkiLz4KPHBhdGggZD0iTTAgMCBDMCAzIDAgMyAtMSA1IEMtMS4yMTM3NzcyMSAxMC42MDcwMzIxMyAtMS4yMTM3NzcyMSAxMC42MDcwMzIxMyAwIDE2IEMwLjc1NDE0MjM1IDIyLjQ5MDU2OTM3IC0wLjI2NzY1MDE5IDI1LjU4MjA3Mjg1IC00IDMxIEMtMy45Mjc0OTIxNCAzNC41NTI4ODQ5NCAtMy4zMTc3NDE2NCAzNi40OTE2MTMzNyAtMS40Mzc1IDM5LjUgQzAuNDMyMjMyNTQgNDIuNzUxNzA4NzYgMC40OTI4MjA0OCA0NC4yNjg2NDQ5NCAwIDQ4IEMtMS4xNzkwNDA1IDUxLjQwNDQxNTYzIC0yLjU0MTk2MzU0IDU0LjcwNjM5OTc4IC00IDU4IEMtMTMuMDQyMzMyOTIgNTUuOTEzMzA3NzkgLTE5LjIzMTExMzk5IDQ5LjIyNDI2NTc5IC0yNC42ODc1IDQyLjExMzI4MTI1IEMtMjUuOTc2NzY1MDIgNDAuMDM3NDExMDkgLTI2LjU2ODUwMjU3IDM4LjM4OTQxNzA0IC0yNyAzNiBDLTIyLjM3NSAzMyAtMjIuMzc1IDMzIC0xOSAzMyBDLTE5IDMzLjk5IC0xOSAzNC45OCAtMTkgMzYgQy0xNi4wMjk4MjMwNiAzNS4zNzE4OTgyNyAtMTYuMDI5ODIzMDYgMzUuMzcxODk4MjcgLTEzIDM0IEMtMTEuODAxNjE3OTEgMzEuNjcxNDU1MzcgLTExLjgwMTYxNzkxIDMxLjY3MTQ1NTM3IC0xMSAyOSBDLTEwLjMyMzI0MjE5IDI4LjI5NDg4MjgxIC05LjY0NjQ4NDM4IDI3LjU4OTc2NTYyIC04Ljk0OTIxODc1IDI2Ljg2MzI4MTI1IEMtNi4yODY2NTkzNyAyMi45NTIxNDY5MyAtNi42NDc5NDA5OCAyMC4wOTMyNzg3OCAtNi45Mzc1IDE1LjUgQy03LjQ2Nzc4NzQgNi4zMzQ3MzQyNSAtNy40Njc3ODc0IDYuMzM0NzM0MjUgLTQgMiBDLTEuODEyNSAwLjY4NzUgLTEuODEyNSAwLjY4NzUgMCAwIFogIiBmaWxsPSIjMTg3MjRFIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzQ4LDYwKSIvPgo8cGF0aCBkPSJNMCAwIEM0LjIyNzM1OTE0IDUuMDI2MTMzNCA0LjM0Mzc1IDYuNjc1NjQ0OTEgNC4zNDM3NSAxMy41OTc2NTYyNSBDLTEuOTI2MjUgMTMuNTk3NjU2MjUgLTguMTk2MjUgMTMuNTk3NjU2MjUgLTE0LjY1NjI1IDEzLjU5NzY1NjI1IEMtMTIuMzAwNDg3NzkgMTguNzcwMzg3NjYgLTEyLjMwMDQ4Nzc5IDE4Ljc3MDM4NzY2IC04LjUzMTI1IDE5LjU5NzY1NjI1IEMtMy43NTI5OTc1NyAxOS41OTc2NTYyNSAtMC4wNTEzNDIxNSAxOC4zNjE2NzI4MyA0LjM0Mzc1IDE2LjU5NzY1NjI1IEM0LjY1NjI1IDE5LjQxMDE1NjI1IDQuNjU2MjUgMTkuNDEwMTU2MjUgNC4zNDM3NSAyMi41OTc2NTYyNSBDMC45MDEyMjIwNSAyNS45MjU0MzMyNyAtMy40MTQ1NjU0OCAyNi4zMjk5Njg0IC04LjAyMzQzNzUgMjYuNjYwMTU2MjUgQy0xMy42ODcyNjY0IDI2LjUyNTcwMzM0IC0xOC4xMzQxNTE4MiAyNS4xMTk3NTQ0MyAtMjIuMTU2MjUgMjEuMDk3NjU2MjUgQy0yNC43NzM1ODM1MyAxNi43MzU0MzM3IC0yNS4zMTY1NTAzOCAxMi41OTU3NjMyOCAtMjQuNjU2MjUgNy41OTc2NTYyNSBDLTIzLjI5NDg1NjcgMy44NjEyMjM1NSAtMjEuNDAxMzMxNDIgMS4xNzA3OTU4IC0xOC4yMTg3NSAtMS4yNzczNDM3NSBDLTEyLjMxODQ0Njg5IC0zLjg2NzcyMDcyIC01LjI1NTA1Mjk0IC00LjQ0OTQ0MzQxIDAgMCBaIE0tMTMuNjU2MjUgNC41OTc2NTYyNSBDLTEzLjk4NjI1IDUuOTE3NjU2MjUgLTE0LjMxNjI1IDcuMjM3NjU2MjUgLTE0LjY1NjI1IDguNTk3NjU2MjUgQy0xMS4wMjYyNSA4LjU5NzY1NjI1IC03LjM5NjI1IDguNTk3NjU2MjUgLTMuNjU2MjUgOC41OTc2NTYyNSBDLTQuOTgzMjM1NTkgMy42NzQ2NDYzMyAtNC45ODMyMzU1OSAzLjY3NDY0NjMzIC03LjUzMTI1IDIuNjYwMTU2MjUgQy0xMC4yMTA5NzMzNSAyLjU4MTM0MDg2IC0xMS40ODU2NTkxNSAzLjAyNTg0OTA4IC0xMy42NTYyNSA0LjU5NzY1NjI1IFogIiBmaWxsPSIjMDA4NDI5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyMDkxLjY1NjI1LDU1LjQwMjM0Mzc1KSIvPgo8cGF0aCBkPSJNMCAwIEMzLjUyMDkwNTk1IDQuNTExMTYwNzUgMyA2LjQxMTcwNDg5IDMgMTIuNTYyNSBDLTMuMjcgMTIuNTYyNSAtOS41NCAxMi41NjI1IC0xNiAxMi41NjI1IEMtMTMuNjQ0MjM3NzkgMTcuNzM1MjMxNDEgLTEzLjY0NDIzNzc5IDE3LjczNTIzMTQxIC05Ljg3NSAxOC41NjI1IEMtNS4wOTY3NDc1NyAxOC41NjI1IC0xLjM5NTA5MjE1IDE3LjMyNjUxNjU4IDMgMTUuNTYyNSBDMy4zMTI1IDE4LjM3NSAzLjMxMjUgMTguMzc1IDMgMjEuNTYyNSBDLTAuNDQyNTI3OTUgMjQuODkwMjc3MDIgLTQuNzU4MzE1NDggMjUuMjk0ODEyMTUgLTkuMzY3MTg3NSAyNS42MjUgQy0xNS4wMzEwMTY0IDI1LjQ5MDU0NzA5IC0xOS40Nzc5MDE4MiAyNC4wODQ1OTgxOCAtMjMuNSAyMC4wNjI1IEMtMjYuMTE3MzMzNTMgMTUuNzAwMjc3NDUgLTI2LjY2MDMwMDM4IDExLjU2MDYwNzAzIC0yNiA2LjU2MjUgQy0yNC42Mzg2MDY3IDIuODI2MDY3MyAtMjIuNzQ1MDgxNDIgMC4xMzU2Mzk1NSAtMTkuNTYyNSAtMi4zMTI1IEMtMTIuNjA1NTU1NjYgLTUuMzY2NzY4MjUgLTUuOTgyNDU3MiAtNC44NjA3NDY0OCAwIDAgWiBNLTE1IDMuNTYyNSBDLTE1LjMzIDQuODgyNSAtMTUuNjYgNi4yMDI1IC0xNiA3LjU2MjUgQy0xMi4zNyA3LjU2MjUgLTguNzQgNy41NjI1IC01IDcuNTYyNSBDLTYuMzI2OTg1NTkgMi42Mzk0OTAwOCAtNi4zMjY5ODU1OSAyLjYzOTQ5MDA4IC04Ljg3NSAxLjYyNSBDLTExLjU1NDcyMzM1IDEuNTQ2MTg0NjEgLTEyLjgyOTQwOTE1IDEuOTkwNjkyODMgLTE1IDMuNTYyNSBaICIgZmlsbD0iIzAwODQyOSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjE2OSw1Ni40Mzc1KSIvPgo8cGF0aCBkPSJNMCAwIEMzLjMgMCA2LjYgMCAxMCAwIEMxMCAxOC4xNSAxMCAzNi4zIDEwIDU1IEM3LjAzIDU1IDQuMDYgNTUgMSA1NSBDMCA1NCAwIDU0IC0wLjEyMDI1NDUyIDUxLjgyOTY5NjY2IEMtMC4xMTgwMzM5MSA1MC44NzI2MTMwNyAtMC4xMTU4MTMyOSA0OS45MTU1Mjk0OCAtMC4xMTM1MjUzOSA0OC45Mjk0NDMzNiBDLTAuMTEzNDQ5ODYgNDcuODQ4Mzk4MjggLTAuMTEzMzc0MzMgNDYuNzY3MzUzMjEgLTAuMTEzMjk2NTEgNDUuNjUzNTQ5MTkgQy0wLjEwODEzNTIyIDQ0LjQ3NzUyNjQgLTAuMTAyOTczOTQgNDMuMzAxNTAzNiAtMC4wOTc2NTYyNSA0Mi4wODk4NDM3NSBDLTAuMDk2MjQxMyA0MC44OTI2NzIyNyAtMC4wOTQ4MjYzNSAzOS42OTU1MDA3OSAtMC4wOTMzNjg1MyAzOC40NjIwNTEzOSBDLTAuMDg3NzQ5NzkgMzQuNjIwNTA5MzQgLTAuMDc1MTk0MTEgMzAuNzc5MDI0NTcgLTAuMDYyNSAyNi45Mzc1IEMtMC4wNTc0ODc0MSAyNC4zNDA0OTU2MyAtMC4wNTI5MjQwOSAyMS43NDM0OTAzNSAtMC4wNDg4MjgxMiAxOS4xNDY0ODQzOCBDLTAuMDM3Nzc0MjcgMTIuNzY0MzAwNjggLTAuMDIwNDk3MDggNi4zODIxNjAwNyAwIDAgWiAiIGZpbGw9IiNEODFGMjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDExNjYsNTIpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuMyAwIDYuNiAwIDEwIDAgQzEwIDAuNjYgMTAgMS4zMiAxMCAyIEMxMC45OSAxLjM0IDExLjk4IDAuNjggMTMgMCBDMTYuMzkyMTAyODcgLTAuNTQ2MTg2MDYgMTkuNjA2NTQzNSAtMC41MzU4MDg5MiAyMyAwIEMyNi42MTk5NTgyMSAyLjY1OTU2MTEzIDI4LjIwNjgzODE3IDQuNjQ4NDIzNTEgMjkgOSBDMjkuMDc4MTg2MzYgMTAuNTEzOTU2OTYgMjkuMTA3ODk5MDkgMTIuMDMwOTM1MDcgMjkuMDk3NjU2MjUgMTMuNTQ2ODc1IEMyOS4wOTQ0MzM1OSAxNC4zOTEyMTA5NCAyOS4wOTEyMTA5NCAxNS4yMzU1NDY4NyAyOS4wODc4OTA2MiAxNi4xMDU0Njg3NSBDMjkuMDc5NTExNzIgMTYuOTc4MTY0MDYgMjkuMDcxMTMyODEgMTcuODUwODU5MzcgMjkuMDYyNSAxOC43NSBDMjkuMDU3OTg4MjggMTkuNjM4MTY0MDYgMjkuMDUzNDc2NTYgMjAuNTI2MzI4MTIgMjkuMDQ4ODI4MTIgMjEuNDQxNDA2MjUgQzI5LjAzNzA3NDIyIDIzLjYyNzYzMzE2IDI5LjAxOTEzOTY2IDI1LjgxMzgyNTI4IDI5IDI4IEMyNS43IDI4IDIyLjQgMjggMTkgMjggQzE4LjUwNSAxOC4xIDE4LjUwNSAxOC4xIDE4IDggQzE2LjY4IDcuNjcgMTUuMzYgNy4zNCAxNCA3IEMxMy4wMSA3LjY2IDEyLjAyIDguMzIgMTEgOSBDMTAuNDE0MDczNjYgMTIuMTE2MTA1NTQgMTAuNDE0MDczNjYgMTIuMTE2MTA1NTQgMTAuMzEyNSAxNS42MjUgQzEwLjI0Njc1NzgxIDE2LjgxMzUxNTYzIDEwLjE4MTAxNTYzIDE4LjAwMjAzMTI1IDEwLjExMzI4MTI1IDE5LjIyNjU2MjUgQzEwLjA3NTg5ODQ0IDIwLjE0MTc5Njg3IDEwLjAzODUxNTYyIDIxLjA1NzAzMTI1IDEwIDIyIEM2LjcgMjEuNjcgMy40IDIxLjM0IDAgMjEgQzAgMTQuMDcgMCA3LjE0IDAgMCBaICIgZmlsbD0iIzAwODQyOSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjAzNiw1MykiLz4KPHBhdGggZD0iTTAgMCBDNy44MjQzNDA1OCAtMC4xMTcwMzA3NCA3LjgyNDM0MDU4IC0wLjExNzAzMDc0IDEwLjQ4ODI4MTI1IDIuNDE0MDYyNSBDMTIuNzg3NDM3MTMgNi4yMDk3NTk4NSAxMy43NDA2OTg2IDkuNTU1ODA4MzkgMTMgMTQgQzExLjk1MTAwNjYgMTUuNzE2NTM0NjYgMTAuOTAxMjc3MjcgMTcuNDMyNzI1OTggOS44MzIwMzEyNSAxOS4xMzY3MTg3NSBDOC4yODEzNDc3OCAyMi42MDkzNzYxMSA5LjE2NDUxNTkyIDI1LjM1OTY3NjUzIDEwIDI5IEMxMC4zNTA2MjUgMjkuNzAxMjUgMTAuNzAxMjUgMzAuNDAyNSAxMS4wNjI1IDMxLjEyNSBDMTIuMzk2NjM0OTIgMzMuNzkzMjY5ODUgMTIuMTk1NTczOTMgMzYuMDY2MzkwOTggMTIgMzkgQzExIDQwIDExIDQwIDguMTI4OTA2MjUgNDAuMTMyODEyNSBDNi45NTE5OTIxOSA0MC4xMzAyMzQzOCA1Ljc3NTA3ODEyIDQwLjEyNzY1NjI1IDQuNTYyNSA0MC4xMjUgQzMuMzg4MTY0MDYgNDAuMTI3NTc4MTIgMi4yMTM4MjgxMiA0MC4xMzAxNTYyNSAxLjAwMzkwNjI1IDQwLjEzMjgxMjUgQy0yIDQwIC0yIDQwIC00IDM5IEMtMy4yNDgxNzUxOCAzMS40ODE3NTE4MiAtMy4yNDgxNzUxOCAzMS40ODE3NTE4MiAtMS45Mzc1IDI4LjkzNzUgQy0wLjQzNzQ4NjY0IDI1LjgzNzQ3MjM5IC0wLjY0OTM5MDYgMjMuMzg5MjI0MiAtMSAyMCBDLTIuMzE0MzE2OTUgMTcuOTg3NDUyMTggLTMuNjQ3MjE4ODUgMTUuOTg2ODk3MzEgLTUgMTQgQy01Ljg1NTE0NzQgOS42MjkyNDY2MSAtNC43NjA4MzQzNiA3LjI4MzU1ODE3IC0yLjUgMy42MjUgQy0xLjY3OTQ5NTggMi40MDc5MTg3NiAtMC44NTAyODE2NCAxLjE5NjQ2NzczIDAgMCBaICIgZmlsbD0iI0ZBRkJGQiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM1Nyw4MikiLz4KPHBhdGggZD0iTTAgMCBDMy45MDkzODcwMyAzLjczOTQxMzY4IDMuOTA5Mzg3MDMgMy43Mzk0MTM2OCA0LjEzMjgxMjUgNi44NDc2NTYyNSBDNC4xMzAyMzQzOCA3LjU3ODU1NDY5IDQuMTI3NjU2MjUgOC4zMDk0NTMxMyA0LjEyNSA5LjA2MjUgQzQuMTIzNzEwOTQgOS44NjU1ODU5NCA0LjEyMjQyMTg4IDEwLjY2ODY3MTg4IDQuMTIxMDkzNzUgMTEuNDk2MDkzNzUgQzQuMDAyNzk5MjggMTMuOTQyMTE4MSAzLjYyMDk4NDQgMTYuMjE4MTI5NDkgMy4xODc1IDE4LjYyNSBDMi43MDMyNTg3MiAyMi4yNzU5MjQ0MiAzLjIxMzk4MTIzIDIzLjg4MzIwMTQgNS40Mzc1IDI2LjgxMjUgQzUuOTEwNTg1OTQgMjcuMzM0NTcwMzEgNi4zODM2NzE4NyAyNy44NTY2NDA2MiA2Ljg3MTA5Mzc1IDI4LjM5NDUzMTI1IEM4IDMwIDggMzAgOCAzNCBDOC42NiAzNCA5LjMyIDM0IDEwIDM0IEM3Ljk4MzAzMjM0IDI5LjA1NjczNDA2IDcuOTgzMDMyMzQgMjkuMDU2NzM0MDYgNS4yNSAyNC41IEMzLjUwMjExMTMyIDIxLjAwNDIyMjYzIDQuMzAxODA1ODYgMTguODA4MzMxNjUgNSAxNSBDNS4yMjA5MzE1MSAxMC40OTc1NjgxMyA1LjIzOTU1NzQ5IDYuMzU4MTI2NzUgNCAyIEM3LjQ0NTAwNjYgNC45MzU2NjQyMyA3LjU3NDgyNDY0IDcuMjU3NDQyOTQgNy45Njg3NSAxMS41OTc2NTYyNSBDNy45OTg4MzUyIDEzLjkxMDQ1NTggNy43MDc4ODYzOCAxNS44NjYzODczNSA3LjI1IDE4LjEyNSBDNi45ODQxMjA2MSAyMi4yNDYxMzA1MyA3LjEwOTg0MDQyIDIyLjY4NTU3NDIyIDkuNDM3NSAyNS43NSBDOS45MTA1ODU5NCAyNi4yODEwOTM3NSAxMC4zODM2NzE4NyAyNi44MTIxODc1IDEwLjg3MTA5Mzc1IDI3LjM1OTM3NSBDMTIgMjkgMTIgMjkgMTIgMzMgQzE0LjMxIDMzLjY2IDE2LjYyIDM0LjMyIDE5IDM1IEMxOSAzNS45OSAxOSAzNi45OCAxOSAzOCBDMTkuNjM5Mzc1IDM4LjI4ODc1IDIwLjI3ODc1IDM4LjU3NzUgMjAuOTM3NSAzOC44NzUgQzIzIDQwIDIzIDQwIDI0IDQyIEMxOS4yNDAwNTc5OSA0OC4wNjgxMzc5OSAxMy45MjU3ODgzNiA1My40MjgxMzM2MyA3IDU3IEM0IDU2IDQgNTYgMi43OTY4NzUgNTMuOTI1NzgxMjUgQy0wLjc2MDI4NTczIDQ1LjA0NjE1MjQyIC0wLjc2MDI4NTczIDQ1LjA0NjE1MjQyIDEgNDAgQzEuNTE1NjI1IDM5LjE3NSAyLjAzMTI1IDM4LjM1IDIuNTYyNSAzNy41IEM0LjM4NzAyNzU2IDM0LjMyNjkwODU4IDQuNTE2NDQxMTggMzIuNjE1MDg4MjUgNCAyOSBDMy4zNCAyOC4wMzA2MjUgMi42OCAyNy4wNjEyNSAyIDI2LjA2MjUgQy0wLjQxMDU3NzgyIDIyLjM3MTMwMjcyIC0wLjQwODMyNzU1IDIwLjMyODI3MTk5IDAgMTYgQzAuMzMgMTUuMDEgMC42NiAxNC4wMiAxIDEzIEMxLjA5MjQ3MzgxIDExLjUyMzEzODg5IDEuMTI5OTkwNzEgMTAuMDQyMjQ0OTkgMS4xMjUgOC41NjI1IEMxLjEyODg2NzE5IDcuNDE5NzQ2MDkgMS4xMjg4NjcxOSA3LjQxOTc0NjA5IDEuMTMyODEyNSA2LjI1MzkwNjI1IEMxLjAwMjc2MDE1IDQuMDQ2ODQxNDEgMC42MDg1NjE5OSAyLjEyMDMwNzI0IDAgMCBaICIgZmlsbD0iIzI5N0Q1QiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM3NCw2MSkiLz4KPHBhdGggZD0iTTAgMCBDMCAyLjY0IDAgNS4yOCAwIDggQy0wLjk5IDcuNjcgLTEuOTggNy4zNCAtMyA3IEMtNi41NTg4MDA1MSA2LjYyNjg5OTk1IC05LjgyNzU4NTIyIDYuMzQwNTE2NjkgLTEzIDguMTI1IEMtMTQuNDYyMjEyMTcgMTAuODY2NjQ3ODEgLTE0LjMxODMzNzMzIDEyLjk0Mzk2MTYyIC0xNCAxNiBDLTEyLjMyMDg1NTg1IDE5LjIyNTQwMTU2IC0xMi4zMjA4NTU4NSAxOS4yMjU0MDE1NiAtOS4zMTI1IDE5Ljc1IEMtNS43MDcwOTgyNCAyMC4wMjIxMDU3OSAtMi41NTAxMDA2NiAxOS42MzkwMTgxMiAxIDE5IEMxIDIxLjMxIDEgMjMuNjIgMSAyNiBDLTYuMzQ1MjM2NzIgMjguMjcwMzQ1ODkgLTEyLjM4MTY4ODY4IDI4Ljg3NjE2MTQyIC0xOS4zNzUgMjUuMjUgQy0yMi44MjkzNDgyMSAyMi4yODkxMzAxIC0yNC42OTA4NzcyNCAyMC4yNzgzNDkyMiAtMjUuMzE2NDA2MjUgMTUuNjY3OTY4NzUgQy0yNS41ODIxMzY1MiA5Ljk1MDQ4MTkxIC0yNC45Njg0NzE1MiA2LjM5NzQ5NTQ3IC0yMSAyIEMtMTQuMTcwMDE0MTEgLTMuMjEyMzU3NjUgLTcuODE4OTkzNjcgLTEuODY5NzU5MzYgMCAwIFogIiBmaWxsPSIjMDA4NDI5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyMDAyLDU0KSIvPgo8cGF0aCBkPSJNMCAwIEMzIDMuMTkwMzcxOTkgMyAzLjE5MDM3MTk5IDMgNiBDLTAuMDkyNjI3NjcgNy41NDYzMTM4NCAtMy4zNjcwODkxIDcuMzkwNjA3MTYgLTYuNzg1MTU2MjUgNy42MjEwOTM3NSBDLTcuODgxNTAzOTEgNy44MDg2NTIzNCAtNy44ODE1MDM5MSA3LjgwODY1MjM0IC05IDggQy05LjMzIDguNjYgLTkuNjYgOS4zMiAtMTAgMTAgQy03LjY5IDEwLjMzIC01LjM4IDEwLjY2IC0zIDExIEMtMi40Mzc1IDEyLjkzNzUgLTIuNDM3NSAxMi45Mzc1IC0yIDE1IEMtMyAxNiAtMyAxNiAtNS4yODUxNTYyNSAxNi4wOTc2NTYyNSBDLTYuNjU5OTQxNDEgMTYuMDgwMjUzOTEgLTYuNjU5OTQxNDEgMTYuMDgwMjUzOTEgLTguMDYyNSAxNi4wNjI1IEMtOC45ODE2MDE1NiAxNi4wNTM0NzY1NiAtOS45MDA3MDMxMiAxNi4wNDQ0NTMxMyAtMTAuODQ3NjU2MjUgMTYuMDM1MTU2MjUgQy0xMS41NTc5Mjk2OSAxNi4wMjM1NTQ2OSAtMTIuMjY4MjAzMTMgMTYuMDExOTUzMTMgLTEzIDE2IEMtMTMuMzMgMTcuNjUgLTEzLjY2IDE5LjMgLTE0IDIxIEMtMTIuNzYyNSAyMC42NDkzNzUgLTExLjUyNSAyMC4yOTg3NSAtMTAuMjUgMTkuOTM3NSBDLTcuMDk2NzA4IDE5LjA0NDA2NzI3IC01LjEzMjI1ODM2IDE4Ljk5MTE4NzA2IC0yIDIwIEMtMS42NyAyMS4zMiAtMS4zNCAyMi42NCAtMSAyNCBDLTcuMDgzMDUwMzggMjguMTkwNTQ1ODIgLTExLjYyMjE1Nzc3IDI5Ljk3NTQ2ODkgLTE5IDI5IEMtMjEuMDYyNSAyNy4zNzUgLTIxLjA2MjUgMjcuMzc1IC0yMiAyNSBDLTIyLjU2NDA4OTkgMjAuMDM2MDA4OTIgLTIxLjQ2ODAwNjg0IDE1LjcxMzA3NDU4IC0yMCAxMSBDLTE4LjM3NSA5IC0xOC4zNzUgOSAtMTcgOCBDLTE3LjQ5NSA3LjU2Njg3NSAtMTcuOTkgNy4xMzM3NSAtMTguNSA2LjY4NzUgQy0yMCA1IC0yMCA1IC0yMCAyIEMtNi4wODE1NDUwNiAtMS4zMTY3MzgyIC02LjA4MTU0NTA2IC0xLjMxNjczODIgMCAwIFogIiBmaWxsPSIjMjIxRTIwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg2NTIsNzEpIi8+CjxwYXRoIGQ9Ik0wIDAgQzIgMiAyIDIgMi4zMTI1IDUuMTg3NSBDMS45Njk4MjgxOCA5LjM2ODA5NjIyIDAuNjY2NjA4NjQgMTIuMTgwNjg4NTMgLTEgMTYgQy0xLjU4NzYzMjQ0IDIwLjExMzQyNzEgLTEuMzMwNDM1NTggMjEuNTA0MzQ2NjQgMSAyNSBDMy4zMzQ1ODYzNSAyOC41MDE4Nzk1MyAzLjY3MjYwNzI3IDI5Ljg4MDI4MDQ3IDMgMzQgQzEuOTUxMDA2NiAzNS43MTY1MzQ2NiAwLjkwMTI3NzI3IDM3LjQzMjcyNTk4IC0wLjE2Nzk2ODc1IDM5LjEzNjcxODc1IEMtMS43MTg2NTIyMiA0Mi42MDkzNzYxMSAtMC44MzU0ODQwOCA0NS4zNTk2NzY1MyAwIDQ5IEMwLjM1MDYyNSA0OS43MDEyNSAwLjcwMTI1IDUwLjQwMjUgMS4wNjI1IDUxLjEyNSBDMi4zODM4NTAwOCA1My43Njc3MDAxNyAyLjEzMjA5ODM3IDU2LjA5MzgzNTkxIDIgNTkgQzEuMDEgNTkgMC4wMiA1OSAtMSA1OSBDLTEuMjg4NzUgNTcuNzgzMTI1IC0xLjU3NzUgNTYuNTY2MjUgLTEuODc1IDU1LjMxMjUgQy0yLjQ4MDE5MTExIDUyLjgzMDc4MTA3IC0zLjEwNzk3MDM0IDUwLjc2NzAxMTM3IC00LjE4NzUgNDguNDM3NSBDLTUuMzQyMzE4NDQgNDQuOTczMDQ0NjggLTQuODE4NjU2ODYgNDIuNTI2NTIxODcgLTQgMzkgQy0zLjIyNjU2MjUgMzcuNzMxNTYyNSAtMy4yMjY1NjI1IDM3LjczMTU2MjUgLTIuNDM3NSAzNi40Mzc1IEMtMC42MTEwNTMyMSAzMy4zNDA0ODE1MiAtMC41NTY2MDA4MSAzMS41NDcxOTM1MyAtMSAyOCBDLTIuNDI2MjE2ODQgMjUuMjg4NzM2MTYgLTIuNDI2MjE2ODQgMjUuMjg4NzM2MTYgLTQgMjMgQy00IDIyLjM0IC00IDIxLjY4IC00IDIxIEMtNi45NyAyMSAtOS45NCAyMSAtMTMgMjEgQy0xNi44OTY3Nzg1MSAyNy4wMDIyMTQ0NSAtMTYuODk2Nzc4NTEgMjcuMDAyMjE0NDUgLTE3IDM0IEMtMTYuMzQgMzQuOTY5Mzc1IC0xNS42OCAzNS45Mzg3NSAtMTUgMzYuOTM3NSBDLTEyLjUzNTY0NjkzIDQwLjcxMTA0MDY0IC0xMi40NTUwODUxNiA0Mi41NjI4MzYyOCAtMTMgNDcgQy0xMy45MzU3ODk5NSA0OS4zNTk4MTgxMyAtMTQuOTMzNDc4MDggNTEuNjk2MzEyNjQgLTE2IDU0IEMtMTYuNjkxNDA1MjIgNTYuNzc4ODg2MTMgLTE2LjY5MTQwNTIyIDU2Ljc3ODg4NjEzIC0xNyA1OSBDLTE3Ljk5IDU5IC0xOC45OCA1OSAtMjAgNTkgQy0yMC4yNTgxMzMwMiA1NS4zODYxMzc3NCAtMjAuMTY4MTU2NjcgNTMuMzI5MzA2OCAtMTguNSA1MC4wNjI1IEMtMTYuNjczNDE0OTMgNDYuMzMzMjIyMTUgLTE2LjQ4NjE3MTMzIDQ0LjExMDYyOTM5IC0xNyA0MCBDLTE4LjMxNDMxNjk1IDM3Ljk4NzQ1MjE4IC0xOS42NDcyMTg4NSAzNS45ODY4OTczMSAtMjEgMzQgQy0yMS41IDMxIC0yMS41IDMxIC0yMSAyOCBDLTIwLjMxOTM3NSAyNy4wNzE4NzUgLTE5LjYzODc1IDI2LjE0Mzc1IC0xOC45Mzc1IDI1LjE4NzUgQy0xNi4yOTQzMTIzNCAyMC44MzkwMjk5NyAtMTYuODYxMjA4MTUgMTcuODI0MTczMzMgLTE4IDEzIEMtMTguNjU5OTY3OSAxMS4zMzA2Njk0MiAtMTkuMzI1NTg4NjkgOS42NjM1NDc5IC0yMCA4IEMtMjAuMTI1IDQuNjg3NSAtMjAuMTI1IDQuNjg3NSAtMjAgMiBDLTE5LjM0IDIgLTE4LjY4IDIgLTE4IDIgQy0xOCAyLjY2IC0xOCAzLjMyIC0xOCA0IEMtMTYuNjggNCAtMTUuMzYgNCAtMTQgNCBDLTE0IDQuNjYgLTE0IDUuMzIgLTE0IDYgQy0xNC45OSA2IC0xNS45OCA2IC0xNyA2IEMtMTUuOTcwMjgxNCAxMS4yMzU1MDE3NyAtMTUuOTcwMjgxNCAxMS4yMzU1MDE3NyAtMTMuNzUgMTYgQy0xMC45NzQxNDAxOSAxNy41ODYyMDU2MSAtOS4xMjcxMzUyNSAxNy41MTA1NTI2OSAtNiAxNyBDLTIuMzk2ODM5NzggMTMuNjg4OTg3OTEgLTEuNDQ3Mjk0NzYgMTAuODA4NDE4NyAtMSA2IEMtMy4zMSA2LjMzIC01LjYyIDYuNjYgLTggNyBDLTguMDQyNzIxIDUuMzMzODgwOTUgLTguMDQwNjM4MzIgMy42NjYxNzExNSAtOCAyIEMtNS45NTQ0Nzk1OCAtMC4wNDU1MjA0MiAtMi43Mjk0MTkxNCAwLjIzOTQyMjczIDAgMCBaICIgZmlsbD0iIzIyNzg1NSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM3MCw2MikiLz4KPHBhdGggZD0iTTAgMCBDMC45NDg3NSAwLjY2IDEuODk3NSAxLjMyIDIuODc1IDIgQzMuMzAxNTM3MjcgNi4zNTA2ODAxOCAzLjQ1MjcyODcyIDguMjkzODg3MTIgMC42MjUgMTEuNzUgQy0wLjI4MjUgMTIuNDkyNSAtMS4xOSAxMy4yMzUgLTIuMTI1IDE0IEMtMi43MDYzNjcxOSAxNC41MTY5MTQwNiAtMy4yODc3MzQzOCAxNS4wMzM4MjgxMiAtMy44ODY3MTg3NSAxNS41NjY0MDYyNSBDLTYuNzk2MjA2MzYgMTcuNDI5OTAwMDYgLTkuMjc0ODQ0NzUgMTcuNzMzMjU1NzkgLTEyLjY4NzUgMTguMTg3NSBDLTEzLjgyMzE2NDA2IDE4LjM0NjA1NDY5IC0xNC45NTg4MjgxMiAxOC41MDQ2MDkzOCAtMTYuMTI4OTA2MjUgMTguNjY3OTY4NzUgQy0xOS4xMjUgMTkgLTE5LjEyNSAxOSAtMjIuMTI1IDE5IEMtMjMuOTMxNDYxMTggMTUuMzg3MDc3NjQgLTI1LjEyNSAxMi45OTMwMDYgLTI1LjEyNSA4LjkzNzUgQy0yMy41NjkwNzIyNyA0LjM2Njk2MjI5IC0yMS4wMzM3Mjg5IDEuMTk5NzcyNDUgLTE2LjkzNzUgLTEuMzc1IEMtMTEuMDE1MDAyNTMgLTIuNjkxMTEwNTUgLTUuMzkzODE5MTMgLTMuMDkxNTc5MjYgMCAwIFogTS0xOC4xMjUgNSBDLTE4Ljc4NSA2LjMyIC0xOS40NDUgNy42NCAtMjAuMTI1IDkgQy0xOC44MDUgNy42OCAtMTcuNDg1IDYuMzYgLTE2LjEyNSA1IEMtMTYuNzg1IDUgLTE3LjQ0NSA1IC0xOC4xMjUgNSBaIE0tMTIuMTI1IDkgQy0xMy45NTgwMDkwOSAxMS4xMDU3NTY0MyAtMTMuOTU4MDA5MDkgMTEuMTA1NzU2NDMgLTE1LjEyNSAxMyBDLTkuMzI4NzM4OTMgMTIuNjAwMjU3ODYgLTUuNzEwMjc1MzcgMTEuODk3NDg0MDcgLTEuMTI1IDggQy0xLjEyNSA3LjAxIC0xLjEyNSA2LjAyIC0xLjEyNSA1IEMtNS45NTc3NzI2OCA0LjQzMTQzODUxIC04LjM2ODA4Njg2IDYuMDU5ODA3MTEgLTEyLjEyNSA5IFogIiBmaWxsPSIjMjIxRTIwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1ODUuMTI1LDQ5KSIvPgo8cGF0aCBkPSJNMCAwIEMyLjk3IDAgNS45NCAwIDkgMCBDOS4zMyAxLjMyIDkuNjYgMi42NCAxMCA0IEMxMC41MTU2MjUgMy4zNCAxMS4wMzEyNSAyLjY4IDExLjU2MjUgMiBDMTQuODI2NDEzMTkgLTAuNjc4MDgyNjIgMTYuODgzOTk1MjUgLTAuMzgxMTExNTUgMjEgMCBDMjEuNjYgMC4zMyAyMi4zMiAwLjY2IDIzIDEgQzIyLjY3IDMuNjQgMjIuMzQgNi4yOCAyMiA5IEMxOSAxMCAxOSAxMCAxNy4wNjI1IDkuMzEyNSBDMTYuMzgxODc1IDkuMjA5Mzc1IDE1LjcwMTI1IDkuMTA2MjUgMTUgOSBDMTEuNjQ5OTE3OTUgMTEuNzc1NzgyMjcgMTAuMTM2Mzk1ODYgMTMuNjg5OTI2MiA5LjY4MzU5Mzc1IDE4LjAzOTA2MjUgQzkuNjAyMzgyODEgMTkuMjIyNDIxODcgOS41MjExNzE4OCAyMC40MDU3ODEyNSA5LjQzNzUgMjEuNjI1IEM5LjM1MzcxMDk0IDIyLjgxMzUxNTYzIDkuMjY5OTIxODcgMjQuMDAyMDMxMjUgOS4xODM1OTM3NSAyNS4yMjY1NjI1IEM5LjEyMzAwNzgxIDI2LjE0MTc5Njg3IDkuMDYyNDIxODcgMjcuMDU3MDMxMjUgOSAyOCBDNi4wMyAyOCAzLjA2IDI4IDAgMjggQzAgMTguNzYgMCA5LjUyIDAgMCBaICIgZmlsbD0iIzAwODQyOSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjE3Niw1MykiLz4KPHBhdGggZD0iTTAgMCBDMC40OTUgMS40ODUgMC40OTUgMS40ODUgMSAzIEMwLjAxIDMuOTkgLTAuOTggNC45OCAtMiA2IEMtMi43MjcwMzEyNSA1LjczNDQ1MzEzIC0zLjQ1NDA2MjUgNS40Njg5MDYyNSAtNC4yMDMxMjUgNS4xOTUzMTI1IEMtMjUuMTQ4Njk1MTMgLTIuMTYyNDkwMzQgLTQ1LjE2MzM2MjQ5IC0xLjA2MjQxOCAtNjYgNiBDLTY2LjMzIDQuMzUgLTY2LjY2IDIuNyAtNjcgMSBDLTQ4Ljc3Mzk1ODUzIC05LjkzNTYyNDg4IC0xOC43MTE0Nzg5MyAtOC4zODU4NDYyMiAwIDAgWiAiIGZpbGw9IiNFODIwMjYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE4MjAsMzUpIi8+CjxwYXRoIGQ9Ik0wIDAgQzAuNjYgMCAxLjMyIDAgMiAwIEMyLjMzIDEuNjUgMi42NiAzLjMgMyA1IEM0LjY1IDUgNi4zIDUgOCA1IEM3LjAxIDYuNDg1IDcuMDEgNi40ODUgNiA4IEM1LjgzMjg2NDMxIDEwLjYyNTMxNTI0IDUuODMyODY0MzEgMTAuNjI1MzE1MjQgNiAxMyBDNi45MDc1IDEyLjQ4NDM3NSA3LjgxNSAxMS45Njg3NSA4Ljc1IDExLjQzNzUgQzEyIDEwIDEyIDEwIDE0LjM3NSAxMC4zMTI1IEMxNC45MTEyNSAxMC41MzkzNzUgMTUuNDQ3NSAxMC43NjYyNSAxNiAxMSBDMTUuNjcgMTIuMzIgMTUuMzQgMTMuNjQgMTUgMTUgQzE2Ljk4IDE0LjY3IDE4Ljk2IDE0LjM0IDIxIDE0IEMxOS42OCAxNi42NCAxOC4zNiAxOS4yOCAxNyAyMiBDMTYuMjM4MTY0MDYgMjEuNzgzNDM3NSAxNS40NzYzMjgxMyAyMS41NjY4NzUgMTQuNjkxNDA2MjUgMjEuMzQzNzUgQzMuNTQ5MjExNDUgMTguMzM5MTEzMiAtMy45OTQ5NjA1MyAxOC41NDQyMTE5MSAtMTUgMjIgQy0xNi4zMiAxOS4zNiAtMTcuNjQgMTYuNzIgLTE5IDE0IEMtMTYuNjkgMTQuMzMgLTE0LjM4IDE0LjY2IC0xMiAxNSBDLTEyLjY2IDEzLjM1IC0xMy4zMiAxMS43IC0xNCAxMCBDLTEwLjI4MTExNzYxIDEwLjUwNzEyMDMzIC03LjI2NTQ1NzYxIDExLjExNjA4MjE1IC00IDEzIEMtMy43OTkxMzU1NyA5LjI4NDAwODA5IC0zLjg0ODA1NjMgOC4yMjc5MTU1NSAtNiA1IEMtNC4zNSA1IC0yLjcgNSAtMSA1IEMtMC42NyAzLjM1IC0wLjM0IDEuNyAwIDAgWiAiIGZpbGw9IiNGM0Y4RjYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNjAsMzcpIi8+CjxwYXRoIGQ9Ik0wIDAgQzEuNzQyMTY3OTcgMC4wNTQxNDA2MyAxLjc0MjE2Nzk3IDAuMDU0MTQwNjMgMy41MTk1MzEyNSAwLjEwOTM3NSBDNC4zOTk5NjA5NCAwLjE1NTc4MTI1IDUuMjgwMzkwNjMgMC4yMDIxODc1IDYuMTg3NSAwLjI1IEM1Ljg1NzUgMS45IDUuNTI3NSAzLjU1IDUuMTg3NSA1LjI1IEMzLjIwNzUgNS41OCAxLjIyNzUgNS45MSAtMC44MTI1IDYuMjUgQy0xLjA1MDMzMjAzIDcuMzU0MDgyMDMgLTEuMDUwMzMyMDMgNy4zNTQwODIwMyAtMS4yOTI5Njg3NSA4LjQ4MDQ2ODc1IEMtMi43NDE2MTc3NyAxNC41MzkxODMxOCAtMy44MTM2MDk0MSAxOC40MDQ2OTk1NSAtOC44MTI1IDIyLjI1IEMtMTEuNTc3MDIwMzMgMjMuNjMyMjYwMTYgLTEzLjg1ODYzNjMgMjMuMzQ1MjUzODcgLTE2LjkzNzUgMjMuMzEyNSBDLTE4LjAzMzIwMzEyIDIzLjMwMzQ3NjU2IC0xOS4xMjg5MDYyNSAyMy4yOTQ0NTMxMyAtMjAuMjU3ODEyNSAyMy4yODUxNTYyNSBDLTIxLjUyMjM4MjgxIDIzLjI2Nzc1MzkxIC0yMS41MjIzODI4MSAyMy4yNjc3NTM5MSAtMjIuODEyNSAyMy4yNSBDLTIyLjQ4MjUgMjEuNiAtMjIuMTUyNSAxOS45NSAtMjEuODEyNSAxOC4yNSBDLTE5LjgzMjUgMTcuOTIgLTE3Ljg1MjUgMTcuNTkgLTE1LjgxMjUgMTcuMjUgQy0xNS41ODE3NTc4MSAxNi4zNTc5Njg3NSAtMTUuMzUxMDE1NjIgMTUuNDY1OTM3NSAtMTUuMTEzMjgxMjUgMTQuNTQ2ODc1IEMtMTQuNzg3MTQ4NDQgMTMuMzc2NDA2MjUgLTE0LjQ2MTAxNTYzIDEyLjIwNTkzNzUgLTE0LjEyNSAxMSBDLTEzLjgxMTc1NzgxIDkuODM5ODQzNzUgLTEzLjQ5ODUxNTYyIDguNjc5Njg3NSAtMTMuMTc1NzgxMjUgNy40ODQzNzUgQy0xMC40NDExMzY5OSAwLjk5NjQ1MTA5IC02Ljc2ODAwODc1IC0wLjI3MzQ1NDkgMCAwIFogIiBmaWxsPSIjRjVGOUY2IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyMDM2LjgxMjUsODQuNzUpIi8+CjxwYXRoIGQ9Ik0wIDAgQzIuOTcgMCA1Ljk0IDAgOSAwIEM5IDkuMjQgOSAxOC40OCA5IDI4IEM2LjAzIDI4IDMuMDYgMjggMCAyOCBDMCAxOC43NiAwIDkuNTIgMCAwIFogIiBmaWxsPSIjMDA4NDJBIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyMDk5LDUzKSIvPgo8cGF0aCBkPSJNMCAwIEM0LjgwODE5NTIyIDAuMDEzNzU3MzUgNC44MDgxOTUyMiAwLjAxMzc1NzM1IDcuODEyNSAyLjg3NSBDOC40OTMxMjUgNC4xMTI1IDguNDkzMTI1IDQuMTEyNSA5LjE4NzUgNS4zNzUgQzYuODc3NSA1LjcwNSA0LjU2NzUgNi4wMzUgMi4xODc1IDYuMzc1IEMxLjg1NzUgOC4wMjUgMS41Mjc1IDkuNjc1IDEuMTg3NSAxMS4zNzUgQzQuNjUyNSAxMC44OCA0LjY1MjUgMTAuODggOC4xODc1IDEwLjM3NSBDOC42ODA5ODE3NSAxNC41MjAyNDY3MSA4LjMyNjA0MzA3IDE2LjE1NDk2MSA2LjA2MjUgMTkuNzUgQzMuMTg3NSAyMi4zNzUgMy4xODc1IDIyLjM3NSAwLjE4NzUgMjMuMTI1IEMtNC4xMzU1MDE1OSAyMi4wNDQyNDk2IC01LjQ3Mjc4ODMxIDIwLjA5MTAxMjY4IC03LjgxMjUgMTYuMzc1IEMtOC4xMjUgMTMgLTguMTI1IDEzIC03LjgxMjUgMTAuMzc1IEMtNS41MDI1IDEwLjM3NSAtMy4xOTI1IDEwLjM3NSAtMC44MTI1IDEwLjM3NSBDLTEuMTQyNSA5LjA1NSAtMS40NzI1IDcuNzM1IC0xLjgxMjUgNi4zNzUgQy00Ljc4MjUgNS44OCAtNC43ODI1IDUuODggLTcuODEyNSA1LjM3NSBDLTUuNjI4MjEwMTUgMC44NjA4MDA5NyAtNS4wOTkzMDg2NyAwLjE5NDExNzE3IDAgMCBaICIgZmlsbD0iI0U1RUZFQiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM2MC44MTI1LDU3LjYyNSkiLz4KPHBhdGggZD0iTTAgMCBDMTUuNTEgMCAzMS4wMiAwIDQ3IDAgQzQ3IDEuNjUgNDcgMy4zIDQ3IDUgQzMxLjQ5IDUgMTUuOTggNSAwIDUgQzAgMy4zNSAwIDEuNyAwIDAgWiAiIGZpbGw9IiMxRTcwQzAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE1OTUsNzIpIi8+CjxwYXRoIGQ9Ik0wIDAgQzQuNjIgMCA5LjI0IDAgMTQgMCBDMTQgMS4zMiAxNCAyLjY0IDE0IDQgQzEwLjcgNCA3LjQgNCA0IDQgQzQgNS45OCA0IDcuOTYgNCAxMCBDNy4zIDEwIDEwLjYgMTAgMTQgMTAgQzE0IDExLjMyIDE0IDEyLjY0IDE0IDE0IEMxMC43IDE0IDcuNCAxNCA0IDE0IEM0IDE1Ljk4IDQgMTcuOTYgNCAyMCBDNy4zIDIwIDEwLjYgMjAgMTQgMjAgQzE0LjMzIDIxLjMyIDE0LjY2IDIyLjY0IDE1IDI0IEMxMC4wNSAyNCA1LjEgMjQgMCAyNCBDMCAxNi4wOCAwIDguMTYgMCAwIFogIiBmaWxsPSIjMDA4NDI5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyMDU2LDg1KSIvPgo8cGF0aCBkPSJNMCAwIEMxNC41MiAwIDI5LjA0IDAgNDQgMCBDNDMuMzQgMS42NSA0Mi42OCAzLjMgNDIgNSBDMjguMTQgNSAxNC4yOCA1IDAgNSBDMCAzLjM1IDAgMS43IDAgMCBaICIgZmlsbD0iIzFFNzBDMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTU0MSw5NCkiLz4KPHBhdGggZD0iTTAgMCBDMTMuODYgMCAyNy43MiAwIDQyIDAgQzQyLjY2IDEuNjUgNDMuMzIgMy4zIDQ0IDUgQzI5LjQ4IDUgMTQuOTYgNSAwIDUgQzAgMy4zNSAwIDEuNyAwIDAgWiAiIGZpbGw9IiMxRTcwQzAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE1NDEsNTcpIi8+CjxwYXRoIGQ9Ik0wIDAgQzEuOTUxOTMyMjEgNS44NTU3OTY2MyAzLjYyOTIyNzk1IDE1LjU1OTg2NzYxIDAuOTE0MDYyNSAyMS4yOTI5Njg3NSBDMC40NDc0MjE4NyAyMS44MzU2NjQwNiAtMC4wMTkyMTg3NSAyMi4zNzgzNTkzOCAtMC41IDIyLjkzNzUgQy0zLjIyMjkwNTM0IDI1LjY1Mjg1NDI2IC0zLjIyMjkwNTM0IDI1LjY1Mjg1NDI2IC0zLjExMzI4MTI1IDI4LjQwNjI1IEMtMi44NDc1MjI1NiAzMC42NDI3NjQ2OSAtMi41MDI2MTIyNCAzMi44MDU0MjU3OCAtMiAzNSBDLTYuNjI1IDM4IC02LjYyNSAzOCAtMTAgMzggQy0xMC4zMyAzOS4zMiAtMTAuNjYgNDAuNjQgLTExIDQyIEMtMTIuMzIgNDIgLTEzLjY0IDQyIC0xNSA0MiBDLTE2LjcwMzEyNSA0MC4xMDE1NjI1IC0xNi43MDMxMjUgNDAuMTAxNTYyNSAtMTguMjUgMzcuNjI1IEMtMTguNzcwNzgxMjUgMzYuODEyODkwNjIgLTE5LjI5MTU2MjUgMzYuMDAwNzgxMjUgLTE5LjgyODEyNSAzNS4xNjQwNjI1IEMtMjEgMzMgLTIxIDMzIC0yMSAzMSBDLTE4LjA5NDUxMTE4IDI4Ljk1ODMwNTE1IC0xNi41OTg1Nzk1NCAyOCAtMTMgMjggQy0xMyAyOC45OSAtMTMgMjkuOTggLTEzIDMxIEMtMTAuMDI5ODIzMDYgMzAuMzcxODk4MjcgLTEwLjAyOTgyMzA2IDMwLjM3MTg5ODI3IC03IDI5IEMtNS44MDE2MTc5MSAyNi42NzE0NTUzNyAtNS44MDE2MTc5MSAyNi42NzE0NTUzNyAtNSAyNCBDLTQuMzI1ODIwMzEgMjMuMjk4NzUgLTMuNjUxNjQwNjMgMjIuNTk3NSAtMi45NTcwMzEyNSAyMS44NzUgQy0wLjI3MTkxNzk2IDE3LjkzMDQwMjQ0IC0wLjU4MDIxNDc2IDE0Ljk1NDI2NzczIC0wLjgxMjUgMTAuMzEyNSBDLTEuMDkwOTg5MDUgMi4xODE5NzgxMSAtMS4wOTA5ODkwNSAyLjE4MTk3ODExIDAgMCBaICIgZmlsbD0iI0VCRjNFRiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM0Miw2NSkiLz4KPHBhdGggZD0iTTAgMCBDLTAuNDAyODE3NzEgNS44NDA4NTY3NCAtMS4xMTI3NzkgOS4zNzczNTg4MSAtNSAxNCBDLTguMjkwNzY2NiAxNi43MTg0NTkzNyAtMTAuMDk2NDA4NjQgMTcuOTMzMDY3MzEgLTE0LjM3NSAxOC4yNSBDLTE1LjI0MTI1IDE4LjE2NzUgLTE2LjEwNzUgMTguMDg1IC0xNyAxOCBDLTE2LjY2ODA5NTE4IDExLjY5MzgwODQyIC0xNS41MDUxNjQ5NyA3LjU2NTU1NTkzIC0xMSAzIEMtNy4yMTg5MzIxOCAwLjU1ODA2MDM3IC00LjQ5MzYzOTc2IC0wLjM5NjQ5NzYzIDAgMCBaICIgZmlsbD0iIzAwMDAwMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ1LDM3KSIvPgo8cGF0aCBkPSJNMCAwIEM0Ljc1MDUzNTExIC0wLjA3NDM1MjIyIDkuNTAwNzI4ODcgLTAuMTI4Njk2OTEgMTQuMjUxNzA4OTggLTAuMTY0Nzk0OTIgQzE1Ljg2NjY3Nzg5IC0wLjE3OTg0ODc2IDE3LjQ4MTYwNjEzIC0wLjIwMDI5NjQ4IDE5LjA5NjQzNTU1IC0wLjIyNjMxODM2IEMyMS40MjI0NjU1NSAtMC4yNjI4NTI4NiAyMy43NDc5NTM0MSAtMC4yNzk3NjAxNSAyNi4wNzQyMTg3NSAtMC4yOTI5Njg3NSBDMjcuMTUxMDcxODUgLTAuMzE2MTk0NTMgMjcuMTUxMDcxODUgLTAuMzE2MTk0NTMgMjguMjQ5Njc5NTcgLTAuMzM5ODg5NTMgQzMyLjY1ODMwNTk5IC0wLjM0MTM1Nzg4IDM1LjUyNjI3Nzc5IDAuMjE1ODYwOTQgMzkgMyBDMzkgMy42NiAzOSA0LjMyIDM5IDUgQzI2LjEzIDUgMTMuMjYgNSAwIDUgQzAgMy4zNSAwIDEuNyAwIDAgWiAiIGZpbGw9IiMxRTcwQzAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE1NDEsNTApIi8+CjxwYXRoIGQ9Ik0wIDAgQzAuNjYgMCAxLjMyIDAgMiAwIEM1LjE4NDE5OTU5IDMuNzk2NTQ1NjcgNS4zODczNDU0OCA3LjExNjc2MjIgNS4yMzgyODEyNSAxMS44NjMyODEyNSBDNC45NDYwNDkxMyAxNC40ODM3ODg5NyA0LjA0MjM4MTk1IDE2LjU4OTQ5MTczIDMgMTkgQzIuNDgyMDk2ODIgMjMuMDU2OTA4MjUgMi42OTk5NDI5NCAyNC41NDk5MTQ0MSA1IDI4IEM3LjMzNDU4NjM1IDMxLjUwMTg3OTUzIDcuNjcyNjA3MjcgMzIuODgwMjgwNDcgNyAzNyBDNi4zNDg5OTE3IDM4LjE2Njk1MjY0IDUuNjU4MzE0NjEgMzkuMzEyMzI1OTggNC45Mzc1IDQwLjQzNzUgQzMuMTY4MTQxMTcgNDMuMjg2MDQyMjIgMi45OTk2OTkxNiA0My45ODI4NTIyOSAzLjA2MjUgNDcuNTYyNSBDNC4wMDI5NTg2MSA1MS4wMTA4NDgyMyA1LjM3ODg4Njc3IDUzLjgyODI1NjcyIDcgNTcgQzcgNTguMzIgNyA1OS42NCA3IDYxIEM1LjAyIDYxLjQ5NSA1LjAyIDYxLjQ5NSAzIDYyIEMyLjcxMTI1IDYwLjc4MzEyNSAyLjQyMjUgNTkuNTY2MjUgMi4xMjUgNTguMzEyNSBDMS41MTk4MDg4OSA1NS44MzA3ODEwNyAwLjg5MjAyOTY2IDUzLjc2NzAxMTM3IC0wLjE4NzUgNTEuNDM3NSBDLTEuMzQyMzE4NDQgNDcuOTczMDQ0NjggLTAuODE4NjU2ODYgNDUuNTI2NTIxODcgMCA0MiBDMC43NzM0Mzc1IDQwLjczMTU2MjUgMC43NzM0Mzc1IDQwLjczMTU2MjUgMS41NjI1IDM5LjQzNzUgQzMuNDExMzY2MjEgMzYuMzAyNDY1OTkgMy41MTMyNzU5MiAzNC41OTI5MzE0MSAzIDMxIEMyLjM0IDMwLjAxIDEuNjggMjkuMDIgMSAyOCBDLTEuMzMwNDM1NTggMjQuNTA0MzQ2NjQgLTEuNTg3NjMyNDQgMjMuMTEzNDI3MSAtMSAxOSBDLTAuNTA1IDE3Ljg2NTYyNSAtMC4wMSAxNi43MzEyNSAwLjUgMTUuNTYyNSBDMi41NDM3NjAwOCAxMC43MDg1Njk4MSAyLjY5NzAxMDU0IDcuMDQ3NDY4NDUgMSAyLjA2MjUgQzAuNjcgMS4zODE4NzUgMC4zNCAwLjcwMTI1IDAgMCBaICIgZmlsbD0iI0U5RjFFRSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM2OSw1OSkiLz4KPHBhdGggZD0iTTAgMCBDMS4zMiAwLjMzIDIuNjQgMC42NiA0IDEgQzUuMTU2NjQ3MzcgNi40ODI2OTA2OSA1LjExNDE2MjU1IDExLjgwMzM5Mjc0IDUuMDYyNSAxNy4zNzUgQzUuMDU3OTg4MjggMTguMzAxODM1OTQgNS4wNTM0NzY1NiAxOS4yMjg2NzE4OCA1LjA0ODgyODEyIDIwLjE4MzU5Mzc1IEM1LjAzNzExNTc0IDIyLjQ1NTc5NzA5IDUuMDIwNzEzNzIgMjQuNzI3ODYzODggNSAyNyBDMy4zNSAyNy4zMyAxLjcgMjcuNjYgMCAyOCBDLTIuNjA1MTM5NTkgMjQuMDkyMjkwNjIgLTIuMjkzNjc1NjUgMjAuNzc3NzA5MjEgLTIuMjUgMTYuMjUgQy0yLjI1NzczNDM4IDE1LjQ2MzY3MTg4IC0yLjI2NTQ2ODc1IDE0LjY3NzM0Mzc1IC0yLjI3MzQzNzUgMTMuODY3MTg3NSBDLTIuMjU2ODM4MzYgOC44NzA4NDc1NSAtMS41OTU2NjE5NSA0LjczNjMyOTkxIDAgMCBaICIgZmlsbD0iIzIyMUUyMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNTY5LDcxKSIvPgo8cGF0aCBkPSJNMCAwIEMxLjY3NTQyOTc2IDAuMjg2MDQ4OTggMy4zNDM4NTM0MyAwLjYxNzgxMjMzIDUgMSBDNi4wNjgwODM3NCA3LjI3NDk5MTk3IDcuMDQzNjc4MzkgMTMuODY4OTY0ODMgNSAyMCBDNC40NDQ5NTIwOSAyNS44ODM1MDc4OCA1Ljc0ODA2MTcyIDI4LjIyMzcxNTY1IDkgMzMgQzkuNjgyNDU2MDcgMzcuMDA5NDI5NCA5LjA2MjU0MzA2IDM5LjEyMDM1OTYxIDYuOTM3NSA0Mi40Mzc1IEM1LjE4NzQ3ODQxIDQ1LjI2MTExNjM5IDQuOTk5MzU1NTggNDUuOTYzOTEyNyA1LjA2MjUgNDkuNSBDNi4wNjQxNTYzNSA1My4yMzk1MTcwMiA3LjQxMDgyMDg0IDU2LjQ3NjE2Nzk1IDkgNjAgQzkgNjAuNjYgOSA2MS4zMiA5IDYyIEM4LjAxIDYyIDcuMDIgNjIgNiA2MiBDNS4xMjcyMDEzOCA2MC4xMzM2MDAxOSA0LjI3NzQ4OTczIDU4LjI1NjM5Mzg5IDMuNDM3NSA1Ni4zNzUgQzIuOTYxODM1OTQgNTUuMzMwODU5MzggMi40ODYxNzE4OCA1NC4yODY3MTg3NSAxLjk5NjA5Mzc1IDUzLjIxMDkzNzUgQzAuODc4NDcyMzMgNDkuNjA4MjUxOTcgMS4wMTg2Mjk2NiA0Ny42MDg1ODA1MSAyIDQ0IEMyLjUxNTYyNSA0My4xNzUgMy4wMzEyNSA0Mi4zNSAzLjU2MjUgNDEuNSBDNS4zODcwMjc1NiAzOC4zMjY5MDg1OCA1LjUxNjQ0MTE4IDM2LjYxNTA4ODI1IDUgMzMgQzQuMzE5Mzc1IDMyLjA3MTg3NSAzLjYzODc1IDMxLjE0Mzc1IDIuOTM3NSAzMC4xODc1IEMwLjMyMzM1MDI2IDI1Ljg4NjgwMjA0IDAuODgyMTgxNzcgMjIuNzc3MDAxIDIgMTggQzIuMzMgMTcuMzQgMi42NiAxNi42OCAzIDE2IEMzLjQxNzQwMjY4IDExLjA1OTExNzE1IDMuNDg3NDY4NzMgNi40MjIxNjY2NCAxIDIgQzAuMzQgMS42NyAtMC4zMiAxLjM0IC0xIDEgQy0wLjY3IDAuNjcgLTAuMzQgMC4zNCAwIDAgWiAiIGZpbGw9IiMxRDc1NTIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNzAsNTcpIi8+CjxwYXRoIGQ9Ik0wIDAgQzAuMzMgMC42NiAwLjY2IDEuMzIgMSAyIEMwLjY3IDIuNjYgMC4zNCAzLjMyIDAgNCBDMC4wMjM3OTA0IDYuMzExMDc4NzggMC4wMjM3OTA0IDYuMzExMDc4NzggMC4zMTI1IDguODc1IEMwLjM5MTEzMjgxIDkuNzM4NjcxODcgMC40Njk3NjU2MyAxMC42MDIzNDM3NSAwLjU1MDc4MTI1IDExLjQ5MjE4NzUgQzEuMDAzMjA3MjQgMTQuMDE3OTA0NzUgMS44MTI2MDgzMyAxNS43NDgyMTM0IDMgMTggQzMuNzA0NDkyODkgMjMuNDAxMTEyMTcgMS45Mjk0NDIzOSAyNS42MDU4MzY0MiAtMSAzMCBDLTEuNjc4NzgwNTkgMzQuMDcyNjgzNTYgLTEuMzQxNzI0MDYgMzUuNDk4MDkyNzkgMSAzOC45Mzc1IEMzLjQ1MjU5MTI5IDQyLjY5MzAzMDQxIDMuNTUxNTQyOTEgNDQuNTg3NjU2NyAzIDQ5IEMyLjA2NTUzNDY1IDUxLjAzMTQ0NjQxIDEuMDY3NzUyMjQgNTMuMDM1MzM1ODcgMCA1NSBDLTAuNjk5MDc0MTQgNTcuNzM1NzI1ODUgLTAuNjk5MDc0MTQgNTcuNzM1NzI1ODUgLTEgNjAgQy0yLjMyIDU5LjY3IC0zLjY0IDU5LjM0IC01IDU5IEMtNC41MjI2OTE2MiA1Ny41NDEwNTc0IC00LjA0MzA4OTU4IDU2LjA4Mjg2NTA0IC0zLjU2MjUgNTQuNjI1IEMtMy4xNjIyNDYwOSA1My40MDY4MzU5NCAtMy4xNjIyNDYwOSA1My40MDY4MzU5NCAtMi43NTM5MDYyNSA1Mi4xNjQwNjI1IEMtMiA1MCAtMiA1MCAtMSA0OCBDLTAuNTQzMTA3NzYgNDQuMDcwNzI2NzUgLTAuOTU5NzA3MDkgNDEuNzM5NDU4MTMgLTMgMzguNDM3NSBDLTUuNzU4MjkzODQgMzMuNjk2NjgyNDYgLTUuNzU4MjkzODQgMzMuNjk2NjgyNDYgLTUgMzAgQy00LjM0IDI5LjA1MTI1IC0zLjY4IDI4LjEwMjUgLTMgMjcuMTI1IEMtMC41ODgzOTUzIDIzLjM1Njg2NzY2IC0wLjUyMDEwNzIzIDIxLjM5OTAxNzAyIC0xIDE3IEMtMS4zMyAxNi4xOTU2MjUgLTEuNjYgMTUuMzkxMjUgLTIgMTQuNTYyNSBDLTMuNDY1MDU4MjkgMTAuODA4Mjg4MTIgLTMuMzIwMjAxNTkgOC4wMzQ1NDAwMiAtMyA0IEMtMS41IDEuNSAtMS41IDEuNSAwIDAgWiAiIGZpbGw9IiNGMUY2RjQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNTEsNjApIi8+CjxwYXRoIGQ9Ik0wIDAgQzMgMSAzIDEgNSA0IEM1IDQuOTkgNSA1Ljk4IDUgNyBDNS42NiA2LjY3IDYuMzIgNi4zNCA3IDYgQzguNTQwMjM5OTYgNS45MzA0OTQ1OSAxMC4wODMzNDk4OCA1LjkxNTQ3NjQzIDExLjYyNSA1LjkzNzUgQzEyLjg1MDg5ODQ0IDUuOTUxMDM1MTYgMTIuODUwODk4NDQgNS45NTEwMzUxNiAxNC4xMDE1NjI1IDUuOTY0ODQzNzUgQzE1LjA0MTI4OTA2IDUuOTgyMjQ2MDkgMTUuMDQxMjg5MDYgNS45ODIyNDYwOSAxNiA2IEMxNS4yMzY4NzUgNi43NDI1IDE0LjQ3Mzc1IDcuNDg1IDEzLjY4NzUgOC4yNSBDMTEuMDU1OTU5NzIgMTAuNzU4MDE3NDUgMTEuMDU1OTU5NzIgMTAuNzU4MDE3NDUgOS42NTIzNDM3NSAxMy4wOTc2NTYyNSBDNy41MTM0ODk4OSAxNS41NjAxMTkyIDYuMDYwMDUxNDUgMTUuNzE4NTYzODUgMi44NzUgMTYuMTg3NSBDLTAuMzYzMTQzNTQgMTYuNDU4MzM3OTMgLTAuMzYzMTQzNTQgMTYuNDU4MzM3OTMgLTMgMTggQy00LjY2NjE3MTE1IDE4LjA0MDYzODMyIC02LjMzMzg4MDk1IDE4LjA0MjcyMSAtOCAxOCBDLTcuMjU5NDMzNTkgMTYuOTMwNzIyNjYgLTcuMjU5NDMzNTkgMTYuOTMwNzIyNjYgLTYuNTAzOTA2MjUgMTUuODM5ODQzNzUgQy0xLjU0NzYwNyA4LjUwMTAxOTAzIC0xLjU0NzYwNyA4LjUwMTAxOTAzIDAgMCBaICIgZmlsbD0iI0VGRjVGMyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTMyNiw1NSkiLz4KPHBhdGggZD0iTTAgMCBDMS44NzUgMS4xMjUgMS44NzUgMS4xMjUgMyAzIEMzLjY4NzUgNi4xODc1IDMuNjg3NSA2LjE4NzUgNCA5IEMwLjM3IDkgLTMuMjYgOSAtNyA5IEMtNi4wMSA5Ljk5IC01LjAyIDEwLjk4IC00IDEyIEMtMC4zNTQ1ODE1NSAxMS43NjUyMjgwMSAtMC4zNTQ1ODE1NSAxMS43NjUyMjgwMSAzIDExIEMyLjY3IDEyLjY1IDIuMzQgMTQuMyAyIDE2IEMtNC4yNDE1OTc5NyAxNy4zNDYyMjcwMSAtNC4yNDE1OTc5NyAxNy4zNDYyMjcwMSAtNy44NzUgMTUuNjg3NSBDLTEwIDE0IC0xMCAxNCAtMTEgMTIgQy0xMS41NzE0Mjg1NyA0LjkxNDI4NTcxIC0xMS41NzE0Mjg1NyA0LjkxNDI4NTcxIC05LjQzNzUgMS41IEMtNi4wODk2NTY1MSAtMC41NjAyMTEzOCAtMy44NTk4NTc1MyAtMC40OTEyNTQ1OSAwIDAgWiBNLTUgMyBDLTUuOTkgNC40ODUgLTUuOTkgNC40ODUgLTcgNiBDLTQuNjkgNiAtMi4zOCA2IDAgNiBDLTAuNjYgNS4wMSAtMS4zMiA0LjAyIC0yIDMgQy0yLjk5IDMgLTMuOTggMyAtNSAzIFogIiBmaWxsPSIjMDA4NDI5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyMTAwLDkzKSIvPgo8cGF0aCBkPSJNMCAwIEMxMC44OSAwIDIxLjc4IDAgMzMgMCBDMzIuNjcgMS4zMiAzMi4zNCAyLjY0IDMyIDQgQzI5LjA3ODAyMzEgNS40NjA5ODg0NSAyNi41MDEwNjUyNSA1LjExMTM0OTAxIDIzLjI0MjE4NzUgNS4wOTc2NTYyNSBDMjIuMjQ3NjEwMzIgNS4wOTU1MzM4MyAyMi4yNDc2MTAzMiA1LjA5NTUzMzgzIDIxLjIzMjk0MDY3IDUuMDkzMzY4NTMgQzE5LjExMzU4MTM3IDUuMDg3NzY3NTQgMTYuOTk0MzI3NDEgNS4wNzUyMTUgMTQuODc1IDUuMDYyNSBDMTMuNDM4ODAzNjEgNS4wNTc0ODUxMiAxMi4wMDI2MDU1NiA1LjA1MjkyMjE5IDEwLjU2NjQwNjI1IDUuMDQ4ODI4MTIgQzcuMDQ0MjM2NTUgNS4wMzc3OTc4MiAzLjUyMjEyODU1IDUuMDIwNTMyNTkgMCA1IEMwIDMuMzUgMCAxLjcgMCAwIFogIiBmaWxsPSIjMUU3MEMwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNTQ5LDcyKSIvPgo8cGF0aCBkPSJNMCAwIEM0LjIxNzQ5MjE5IC0wLjA3NDE5MTM0IDguNDM0NjM4MTEgLTAuMTI4NjIwNCAxMi42NTI1ODc4OSAtMC4xNjQ3OTQ5MiBDMTQuMDg3MjI1NTIgLTAuMTc5ODc1ODkgMTUuNTIxODE3MDggLTAuMjAwMzQzOCAxNi45NTYyOTg4MyAtMC4yMjYzMTgzNiBDMTkuMDE5MTU4NTkgLTAuMjYyNzM0MzcgMjEuMDgxNDA4NTggLTAuMjc5NzMyNDMgMjMuMTQ0NTMxMjUgLTAuMjkyOTY4NzUgQzI1LjAwNjIxOTQ4IC0wLjMxNjUzNDQyIDI1LjAwNjIxOTQ4IC0wLjMxNjUzNDQyIDI2LjkwNTUxNzU4IC0wLjM0MDU3NjE3IEMzMCAwIDMwIDAgMzEuOTI4NDY2OCAxLjM5MzMxMDU1IEMzMyAzIDMzIDMgMzMgNSBDMjIuMTEgNSAxMS4yMiA1IDAgNSBDMCAzLjM1IDAgMS43IDAgMCBaICIgZmlsbD0iIzFGNzBDMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTU0OSw3OSkiLz4KPHBhdGggZD0iTTAgMCBDMC42NiAwIDEuMzIgMCAyIDAgQzIuMDg2MzY3MTkgMC41Njg0NzY1NiAyLjE3MjczNDM3IDEuMTM2OTUzMTIgMi4yNjE3MTg3NSAxLjcyMjY1NjI1IEMzLjM1MjcwNTM2IDcuNzE4MDc4MSA1LjI4MTQzMTU2IDExLjIwNTAwMzg1IDkgMTYgQzkgMTYuNjYgOSAxNy4zMiA5IDE4IEM4LjI3NTU0Njg3IDE3Ljg0NjYwMTU2IDcuNTUxMDkzNzUgMTcuNjkzMjAzMTIgNi44MDQ2ODc1IDE3LjUzNTE1NjI1IEM0LjA3MzM2NjA3IDE2Ljk3MzE0OTc3IDQuMDczMzY2MDcgMTYuOTczMTQ5NzcgMS41NzAzMTI1IDE2Ljc0NjA5Mzc1IEMtNC45MDkwNjM1OCAxNS45Mjg0MDg5MSAtNy44MDY5NTYzOCAxMy44OTExMzYyMyAtMTEuODIwMzEyNSA4Ljc3NzM0Mzc1IEMtMTMgNyAtMTMgNyAtMTMgNiBDLTYuMzc1IDUuODc1IC02LjM3NSA1Ljg3NSAtMyA3IEMtMi44NzYyNSA2LjQwMTg3NSAtMi43NTI1IDUuODAzNzUgLTIuNjI1IDUuMTg3NSBDLTIgMyAtMiAzIDAgMCBaICIgZmlsbD0iI0YyRjdGNSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM5NCw1NSkiLz4KPHBhdGggZD0iTTAgMCBDMSAyIDEgMiAwLjkzNzUgNS44MTI1IEMwLjg3OTY0ODA4IDkuMzg2NDYzMTggMS42NDA2MzE3NyAxMS42ODY1Mzk5NCAzIDE1IEMzLjQ3NzIyODgxIDE5LjM3NDU5NzM5IDMuNDk4NjQwNDQgMjEuMjg5ODE1MTMgMC45Mzc1IDI0LjkzNzUgQy0xLjA1MTY1MDY5IDI4LjA4MTY0MTQxIC0xLjI4MzkwMDM2IDI4LjY1NDU4MTU5IC0wLjkzNzUgMzIuMTI1IEMtMC4wNDE1OTEyMiAzNS44MjgwODk2MSAwLjc4Mzk2MDg3IDM3LjEwOTUxNDE4IDMgNDAgQzMuNjQwNzA0NzggNDQuOTEyMDY5OTQgMi4yODAwNjUxNiA0Ny43MTM0Nzc1IDAgNTIgQy0wLjY5OTA3NDE0IDU0LjczNTcyNTg1IC0wLjY5OTA3NDE0IDU0LjczNTcyNTg1IC0xIDU3IEMtMS45OSA1NyAtMi45OCA1NyAtNCA1NyBDLTMuMjQ3ODEzNDEgNTAuNDgxMDQ5NTYgLTMuMjQ3ODEzNDEgNTAuNDgxMDQ5NTYgLTEuOTM3NSA0Ny45Mzc1IEMtMC41NTU0NjYzNyA0NS4wODEyOTcxNyAtMC42Mjk3ODY4MiA0My4xNDY4MTIgLTEgNDAgQy0xLjkyMzQ0MjExIDM4LjIzNzkyNDggLTEuOTIzNDQyMTEgMzguMjM3OTI0OCAtMy4wNjI1IDM2LjUgQy00LjcyOTM3MDExIDMzLjgyMjM2ODIyIC01LjAwMjU5OTI2IDMzLjEzMjU2MjEgLTQuOTM3NSAyOS44MTI1IEMtNCAyNyAtNCAyNyAtMi40Mzc1IDI1LjE4NzUgQy0wLjE2NjczOTU4IDIxLjczMTk5NTAyIC0wLjYxNDU0MzE5IDE4LjAyNTA1ODY1IC0xIDE0IEMtMS4zMyAxMy4wMSAtMS42NiAxMi4wMiAtMiAxMSBDLTIuMTY3OTY4NzUgOS4wNjI1IC0yLjE2Nzk2ODc1IDkuMDYyNSAtMi4xODc1IDcgQy0yLjIwMTY3OTY5IDYuMzE5Mzc1IC0yLjIxNTg1OTM4IDUuNjM4NzUgLTIuMjMwNDY4NzUgNC45Mzc1IEMtMiAzIC0yIDMgMCAwIFogIiBmaWxsPSIjMTQ3MDRCIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzQ4LDYyKSIvPgo8cGF0aCBkPSJNMCAwIEMxMi44NyAwIDI1Ljc0IDAgMzkgMCBDMzUuMDM1MDk2OTkgMy45NjQ5MDMwMSAzNS4wMzUwOTY5OSAzLjk2NDkwMzAxIDMwLjY1MTg1NTQ3IDQuMTEzNTI1MzkgQzI5LjIyMzYyMzAzIDQuMTEzMzY2ODggMjcuNzk1Mzg0NTggNC4xMDc3MDczNSAyNi4zNjcxODc1IDQuMDk3NjU2MjUgQzI1LjIzOTQzNDA1IDQuMDk1NTMzODMgMjUuMjM5NDM0MDUgNC4wOTU1MzM4MyAyNC4wODg4OTc3MSA0LjA5MzM2ODUzIEMyMS42ODQyMjQ5IDQuMDg3NzY0NjUgMTkuMjc5NjQ0NzMgNC4wNzUyMTE1NyAxNi44NzUgNC4wNjI1IEMxNS4yNDYwOTUwOSA0LjA1NzQ4NTUgMTMuNjE3MTg4NzMgNC4wNTI5MjI1IDExLjk4ODI4MTI1IDQuMDQ4ODI4MTIgQzcuOTkyMTUxNzMgNC4wMzc3OTM5NyAzLjk5NjA5MTU4IDQuMDIwNTI2NzkgMCA0IEMwIDIuNjggMCAxLjM2IDAgMCBaICIgZmlsbD0iIzFGNzBDMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTU0MSwxMDIpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuNDQ1MDA2NiAyLjkzNTY2NDIzIDMuNTc0ODI0NjQgNS4yNTc0NDI5NCAzLjk2ODc1IDkuNTk3NjU2MjUgQzMuOTk4ODM1MiAxMS45MTA0NTU4IDMuNzA3ODg2MzggMTMuODY2Mzg3MzUgMy4yNSAxNi4xMjUgQzIuOTg0MTIwNjEgMjAuMjQ2MTMwNTMgMy4xMDk4NDA0MiAyMC42ODU1NzQyMiA1LjQzNzUgMjMuNzUgQzUuOTEwNTg1OTQgMjQuMjgxMDkzNzUgNi4zODM2NzE4NyAyNC44MTIxODc1IDYuODcxMDkzNzUgMjUuMzU5Mzc1IEM4IDI3IDggMjcgOCAzMSBDMTAuMzEgMzEuNjYgMTIuNjIgMzIuMzIgMTUgMzMgQzE1IDMzLjk5IDE1IDM0Ljk4IDE1IDM2IEMxNi4zMiAzNi42NiAxNy42NCAzNy4zMiAxOSAzOCBDMTkgMzguOTkgMTkgMzkuOTggMTkgNDEgQzE3LjkxNzE4NzUgNDAuNDc0MDYyNSAxNy45MTcxODc1IDQwLjQ3NDA2MjUgMTYuODEyNSAzOS45Mzc1IEMxNC4wNzY4ODc3IDM4Ljc1NjQ4MjEyIDE0LjA3Njg4NzcgMzguNzU2NDgyMTIgMTEuNSAzOS41NjI1IEM5IDQwIDkgNDAgNi4xODc1IDM4LjU2MjUgQzUuNDY1NjI1IDM4LjA0Njg3NSA0Ljc0Mzc1IDM3LjUzMTI1IDQgMzcgQzQuMTk1MjkyOTcgMzYuMTY0Njg3NSA0LjE5NTI5Mjk3IDM2LjE2NDY4NzUgNC4zOTQ1MzEyNSAzNS4zMTI1IEM1LjMwMzg2MTMxIDMwLjQ2NzI5MzAxIDUuMzAzODYxMzEgMzAuNDY3MjkzMDEgMy45MTc5Njg3NSAyNS44NjcxODc1IEMyLjk3NDUwMDc2IDI0LjU0MTY1Mzk2IDIuMDI5MTkzNjQgMjMuMjE3NDI3NDggMS4wODIwMzEyNSAyMS44OTQ1MzEyNSBDLTAuNjgwNTA5NzQgMTguODA4NDkzNzggMC4yMzQyODE5NyAxNi4zNTczNzkwNyAxIDEzIEMxLjA4MjI5MTcgMTEuNDM5MTEyMjkgMS4xMjI0NDU5OSA5Ljg3NTU1MzM3IDEuMTI1IDguMzEyNSBDMS4xMjg4NjcxOSA3LjIyMzg4NjcyIDEuMTI4ODY3MTkgNy4yMjM4ODY3MiAxLjEzMjgxMjUgNi4xMTMyODEyNSBDMC45OTc4MDczMiAzLjk2NTExMDU5IDAuNTg3NzI5NCAyLjA2NjM4MTk1IDAgMCBaICIgZmlsbD0iI0VGRjVGMiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM3OCw2MykiLz4KPHBhdGggZD0iTTAgMCBDOS4yNCAwIDE4LjQ4IDAgMjggMCBDMjggMS42NSAyOCAzLjMgMjggNSBDMTguNzYgNSA5LjUyIDUgMCA1IEMwIDMuMzUgMCAxLjcgMCAwIFogIiBmaWxsPSIjMUU3MEMxIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNTEwLDk0KSIvPgo8cGF0aCBkPSJNMCAwIEM5LjI0IDAgMTguNDggMCAyOCAwIEMyOCAxLjY1IDI4IDMuMyAyOCA1IEMxOC43NiA1IDkuNTIgNSAwIDUgQzAgMy4zNSAwIDEuNyAwIDAgWiAiIGZpbGw9IiMxRTcwQzEiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE1MTAsNTcpIi8+CjxwYXRoIGQ9Ik0wIDAgQzkuMjQgMCAxOC40OCAwIDI4IDAgQzI4IDEuNjUgMjggMy4zIDI4IDUgQzE4Ljc2IDUgOS41MiA1IDAgNSBDMCAzLjM1IDAgMS43IDAgMCBaICIgZmlsbD0iIzFGNzBDMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTUxMCw1MCkiLz4KPHBhdGggZD0iTTAgMCBDMCAzIDAgMyAtMSA1IEMtMS4yMTM3NzcyMSAxMC42MDcwMzIxMyAtMS4yMTM3NzcyMSAxMC42MDcwMzIxMyAwIDE2IEMwLjc1NDE0MjM1IDIyLjQ5MDU2OTM3IC0wLjI2NzY1MDE5IDI1LjU4MjA3Mjg1IC00IDMxIEMtMy45Mjc0OTIxNCAzNC41NTI4ODQ5NCAtMy4zMTc3NDE2NCAzNi40OTE2MTMzNyAtMS40Mzc1IDM5LjUgQzAuNDMyMjMyNTQgNDIuNzUxNzA4NzYgMC40OTI4MjA0OCA0NC4yNjg2NDQ5NCAwIDQ4IEMtMS4xNzkwNDA1IDUxLjQwNDQxNTYzIC0yLjU0MTk2MzU0IDU0LjcwNjM5OTc4IC00IDU4IEMtNC45OSA1Ny42NyAtNS45OCA1Ny4zNCAtNyA1NyBDLTYuNTc1MjcyMSA1NC40NTE2MzI2IC02LjE4NjYwNjY3IDUyLjM0MDI4Mjc1IC00LjkzNzUgNTAuMDYyNSBDLTMuNjI5MDkzODEgNDcuMTg0MDA2MzkgLTMuNjg2MTgxNDMgNDUuMTM4MTg1NzMgLTQgNDIgQy00LjQ5NSA0MS4wMSAtNC45OSA0MC4wMiAtNS41IDM5IEMtNy4yMTc0NTA3IDM1LjU2NTA5ODYgLTcuNTUyMzU3MzMgMzMuNzg3NTkzMTMgLTcgMzAgQy01Ljk4MjkyOTY5IDI4LjY2Nzc1MzkxIC01Ljk4MjkyOTY5IDI4LjY2Nzc1MzkxIC00Ljk0NTMxMjUgMjcuMzA4NTkzNzUgQy0yLjU3NzgwMDU3IDIzLjI4MTkyMTg1IC0yLjgyMDAzNjc0IDIwLjUwMjM1NDg2IC0zLjQzNzUgMTYuMDYyNSBDLTQuMjQwNTQ3MzkgMTAuMDc2NjY0NDYgLTMuNzgyNzc2OTMgNi4zMjc0MTg5MSAtMSAxIEMtMC42NyAwLjY3IC0wLjM0IDAuMzQgMCAwIFogIiBmaWxsPSIjRTRFRUVBIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzQ4LDYwKSIvPgo8cGF0aCBkPSJNMCAwIEMzLjkwOTM4NzAzIDMuNzM5NDEzNjggMy45MDkzODcwMyAzLjczOTQxMzY4IDQuMTMyODEyNSA2Ljg0NzY1NjI1IEM0LjEzMDIzNDM4IDcuNTc4NTU0NjkgNC4xMjc2NTYyNSA4LjMwOTQ1MzEzIDQuMTI1IDkuMDYyNSBDNC4xMjI0MjE4OCA5Ljg2MzAwNzgxIDQuMTE5ODQzNzUgMTAuNjYzNTE1NjMgNC4xMTcxODc1IDExLjQ4ODI4MTI1IEM0LjAwMTcwMTk1IDEzLjk2MzUyMTY0IDMuNjUxMDI0NzkgMTYuMzA3MDIyNDggMy4yNSAxOC43NSBDMi43NjIwMjY5NSAyMi40MjA4OTQxOCAyLjc2MjAyNjk1IDIyLjQyMDg5NDE4IDQuOTM3NSAyNS41NjI1IEM1Ljk1ODQzNzUgMjYuNzY5MDYyNSA1Ljk1ODQzNzUgMjYuNzY5MDYyNSA3IDI4IEM4LjA0NzU1MTk0IDMzLjMxNDE0MzcgNi44NDIyMzI0NCAzNi40OTk3OTg2MyA0IDQxIEMzLjM3MDk3MDM5IDQ1LjkyNzM5ODU3IDQuNzQ3ODkzNDUgNDguNjgzNDYyNDQgNyA1MyBDNyA1NC4zMiA3IDU1LjY0IDcgNTcgQzQgNTYgNCA1NiAyLjc5Njg3NSA1My45MjU3ODEyNSBDLTAuNzYwMjg1NzMgNDUuMDQ2MTUyNDIgLTAuNzYwMjg1NzMgNDUuMDQ2MTUyNDIgMSA0MCBDMS41MTU2MjUgMzkuMTc1IDIuMDMxMjUgMzguMzUgMi41NjI1IDM3LjUgQzQuMzg3MDI3NTYgMzQuMzI2OTA4NTggNC41MTY0NDExOCAzMi42MTUwODgyNSA0IDI5IEMzLjM0IDI4LjAzMDYyNSAyLjY4IDI3LjA2MTI1IDIgMjYuMDYyNSBDLTAuNDEwNTc3ODIgMjIuMzcxMzAyNzIgLTAuNDA4MzI3NTUgMjAuMzI4MjcxOTkgMCAxNiBDMC4zMyAxNS4wMSAwLjY2IDE0LjAyIDEgMTMgQzEuMDkyNDczODEgMTEuNTIzMTM4ODkgMS4xMjk5OTA3MSAxMC4wNDIyNDQ5OSAxLjEyNSA4LjU2MjUgQzEuMTI4ODY3MTkgNy40MTk3NDYwOSAxLjEyODg2NzE5IDcuNDE5NzQ2MDkgMS4xMzI4MTI1IDYuMjUzOTA2MjUgQzEuMDAyNzYwMTUgNC4wNDY4NDE0MSAwLjYwODU2MTk5IDIuMTIwMzA3MjQgMCAwIFogIiBmaWxsPSIjRTZGMEVDIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzc0LDYxKSIvPgo8cGF0aCBkPSJNMCAwIEM4LjI1IDAgMTYuNSAwIDI1IDAgQzI1LjY2IDEuNjUgMjYuMzIgMy4zIDI3IDUgQzE4LjA5IDUgOS4xOCA1IDAgNSBDMCAzLjM1IDAgMS43IDAgMCBaICIgZmlsbD0iIzFFNzBDMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTU4Nyw1NykiLz4KPHBhdGggZD0iTTAgMCBDOC4yNSAwIDE2LjUgMCAyNSAwIEMyNSAxLjY1IDI1IDMuMyAyNSA1IEMxNi40MiA1IDcuODQgNSAtMSA1IEMtMC42NyAzLjM1IC0wLjM0IDEuNyAwIDAgWiAiIGZpbGw9IiMxRTcwQzAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE2MjQsNTcpIi8+CjxwYXRoIGQ9Ik0wIDAgQzAuNjYgMCAxLjMyIDAgMiAwIEMyLjMzIDEuNjUgMi42NiAzLjMgMyA1IEM0LjY1IDUgNi4zIDUgOCA1IEM3LjAxIDYuNDg1IDcuMDEgNi40ODUgNiA4IEM1LjgzMjg2NDMxIDEwLjYyNTMxNTI0IDUuODMyODY0MzEgMTAuNjI1MzE1MjQgNiAxMyBDNi42NiAxMy4zMyA3LjMyIDEzLjY2IDggMTQgQzcuMzQgMTQgNi42OCAxNCA2IDE0IEM2IDE0LjY2IDYgMTUuMzIgNiAxNiBDMi43IDE2IC0wLjYgMTYgLTQgMTYgQy00IDE1LjM0IC00IDE0LjY4IC00IDE0IEMtNC42NiAxMy42NyAtNS4zMiAxMy4zNCAtNiAxMyBDLTUuMzQgMTMgLTQuNjggMTMgLTQgMTMgQy0zLjc5OTEzNTU3IDkuMjg0MDA4MDkgLTMuODQ4MDU2MyA4LjIyNzkxNTU1IC02IDUgQy00LjM1IDUgLTIuNyA1IC0xIDUgQy0wLjY3IDMuMzUgLTAuMzQgMS43IDAgMCBaICIgZmlsbD0iI0Q4RTdFMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM2MCwzNykiLz4KPHBhdGggZD0iTTAgMCBDMCAxLjY1IDAgMy4zIDAgNSBDLTAuNzYzMTI1IDQuNzczMTI1IC0xLjUyNjI1IDQuNTQ2MjUgLTIuMzEyNSA0LjMxMjUgQy0zLjE5OTM3NSA0LjIwOTM3NSAtNC4wODYyNSA0LjEwNjI1IC01IDQgQy02LjgzNTQ3OTkgNS4zMzM3ODU3NSAtNi44MzU0Nzk5IDUuMzMzNzg1NzUgLTggNyBDLTcuMzQgOC42NSAtNi42OCAxMC4zIC02IDEyIEMtMy42OSAxMiAtMS4zOCAxMiAxIDEyIEMxIDEzLjMyIDEgMTQuNjQgMSAxNiBDLTUuMjAwODE5NjcgMTcuMzM3NDMxNjkgLTUuMjAwODE5NjcgMTcuMzM3NDMxNjkgLTguODEyNSAxNS44MTI1IEMtMTEuMTQwMzY2MTcgMTMuODgzNjk2NiAtMTIuMTcyMjU2MTEgMTIuODk3MTAzNjEgLTEzIDEwIEMtMTIuODU1NzAyNCA2LjUzNjg1NzUgLTEyLjM0NTYyNDk3IDQuNTI1MzQ5OTYgLTEwLjQzNzUgMS42MjUgQy02Ljg1NzUyODY3IC0wLjc2MTY0NzU1IC00LjI0ODUyOTc0IC0wLjI4MzIzNTMyIDAgMCBaICIgZmlsbD0iIzAwODQyOSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjE5Miw5MykiLz4KPHBhdGggZD0iTTAgMCBDMCAwLjk5IDAgMS45OCAwIDMgQzEuNjUgMyAzLjMgMyA1IDMgQzUgNC4zMiA1IDUuNjQgNSA3IEMzLjM1IDcgMS43IDcgMCA3IEMwIDkuOTcgMCAxMi45NCAwIDE2IEMxLjY1IDE1LjY3IDMuMyAxNS4zNCA1IDE1IEM1IDE2LjMyIDUgMTcuNjQgNSAxOSBDMS43MTMwMzc2NyAxOS43OTk1MzEzOCAwLjI4OTc2ODA4IDIwLjA5NjU4OTM2IC0zIDE5IEMtNC4yNjIzNzczMSAxNi40NzUyNDUzOCAtNC4wOTg1NjQwNCAxNC42ODc5OTUzNCAtNC4wNjI1IDExLjg3NSBDLTQuMDUzNDc2NTYgMTAuOTY0OTIxODggLTQuMDQ0NDUzMTMgMTAuMDU0ODQzNzUgLTQuMDM1MTU2MjUgOS4xMTcxODc1IEMtNC4wMjM1NTQ2OSA4LjQxODUxNTYyIC00LjAxMTk1MzEzIDcuNzE5ODQzNzUgLTQgNyBDLTQuOTkgNyAtNS45OCA3IC03IDcgQy0zLjg2MjA2ODk3IDAgLTMuODYyMDY4OTcgMCAwIDAgWiAiIGZpbGw9IiMwMDg0MjkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIxMzcsOTApIi8+CjxwYXRoIGQ9Ik0wIDAgQzAuMzMgMS42NSAwLjY2IDMuMyAxIDUgQzAuMDUxMjUgNC43OTM3NSAtMC44OTc1IDQuNTg3NSAtMS44NzUgNC4zNzUgQy0zLjQyMTg3NSA0LjE4OTM3NSAtMy40MjE4NzUgNC4xODkzNzUgLTUgNCBDLTcuMzQ5NzM4MTggNS44OTc1NTE0NCAtNy4zNDk3MzgxOCA1Ljg5NzU1MTQ0IC03LjEyNSA5LjEyNSBDLTcuMDYzMTI1IDEwLjU0ODEyNSAtNy4wNjMxMjUgMTAuNTQ4MTI1IC03IDEyIEMtNC4zNiAxMiAtMS43MiAxMiAxIDEyIEMxIDEzLjMyIDEgMTQuNjQgMSAxNiBDLTUuMzI5OTc5ODggMTcuMjE3MzAzODIgLTUuMzI5OTc5ODggMTcuMjE3MzAzODIgLTguMzEyNSAxNi4yNSBDLTEwIDE1IC0xMCAxNSAtMTIgMTIgQy0xMi40NDUwNTU3NiA3Ljk5NDQ5ODEzIC0xMi4zNDMxOTE2NyA1LjY3MjA4MzY5IC0xMC41IDIuMDYyNSBDLTYuODg4MjI0MDkgLTAuOTE3MjE1MTMgLTQuNTg5MTk0MjEgLTAuMzgyNDMyODUgMCAwIFogIiBmaWxsPSIjMDA4NDI5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyMTIyLDkzKSIvPgo8cGF0aCBkPSJNMCAwIEM3LjU5IDAgMTUuMTggMCAyMyAwIEMyMy4zMyAxLjY1IDIzLjY2IDMuMyAyNCA1IEMxNi4wOCA1IDguMTYgNSAwIDUgQzAgMy4zNSAwIDEuNyAwIDAgWiAiIGZpbGw9IiMxRjcwQzAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE1ODcsNTApIi8+CjxwYXRoIGQ9Ik0wIDAgQzcuMjYgMCAxNC41MiAwIDIyIDAgQzIyIDEuNjUgMjIgMy4zIDIyIDUgQzE0LjQxIDUgNi44MiA1IC0xIDUgQy0wLjY3IDMuMzUgLTAuMzQgMS43IDAgMCBaICIgZmlsbD0iIzFGNzBDMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTYyNyw1MCkiLz4KPHBhdGggZD0iTTAgMCBDMy45NiAwIDcuOTIgMCAxMiAwIEMxMiAzLjY2NjY2NjY3IDEyIDcuMzMzMzMzMzMgMTIgMTEgQzguMDQgMTEgNC4wOCAxMSAwIDExIEMwIDcuMzMzMzMzMzMgMCAzLjY2NjY2NjY3IDAgMCBaICIgZmlsbD0iI0U4MjAyNiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTc4MiwxMTYpIi8+CjxwYXRoIGQ9Ik0wIDAgQzkuMjQgMCAxOC40OCAwIDI4IDAgQzI4IDEuMzIgMjggMi42NCAyOCA0IEMxOC43NiA0IDkuNTIgNCAwIDQgQzAgMi42OCAwIDEuMzYgMCAwIFogIiBmaWxsPSIjMUU3MEMwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNTEwLDEwMikiLz4KPHBhdGggZD0iTTAgMCBDMCAxLjY1IDAgMy4zIDAgNSBDLTAuNTU1NTg1OTQgNC41MTQwMjM0NCAtMS4xMTExNzE4OCA0LjAyODA0Njg4IC0xLjY4MzU5Mzc1IDMuNTI3MzQzNzUgQy00LjM3OTY1MzUgMS43NDk2NzE5NyAtNS44NjQwNjM4NiAxLjU2NzMyNDE5IC05LjA2MjUgMS41NjI1IEMtOS45MTk3MjY1NiAxLjU0MzE2NDA2IC0xMC43NzY5NTMxMyAxLjUyMzgyODEzIC0xMS42NjAxNTYyNSAxLjUwMzkwNjI1IEMtMTQuMTc3NTgwNDEgMS43OTY0NDEzNyAtMTQuMTc3NTgwNDEgMS43OTY0NDEzNyAtMTUuODA4NTkzNzUgNC4wMjczNDM3NSBDLTE2LjM5ODMzOTg0IDUuMDAzODA4NTkgLTE2LjM5ODMzOTg0IDUuMDAzODA4NTkgLTE3IDYgQy0xNS4wMiA2IC0xMy4wNCA2IC0xMSA2IEMtMTAuNjcgNy42NSAtMTAuMzQgOS4zIC0xMCAxMSBDLTExLjMyIDExIC0xMi42NCAxMSAtMTQgMTEgQy0xNCAxMC4zNCAtMTQgOS42OCAtMTQgOSBDLTE1LjMyIDkgLTE2LjY0IDkgLTE4IDkgQy0xOC4zMyA3LjM1IC0xOC42NiA1LjcgLTE5IDQgQy0xOS42NiA0LjY2IC0yMC4zMiA1LjMyIC0yMSA2IEMtMjEgNC4wMiAtMjEgMi4wNCAtMjEgMCBDLTEzLjk3OTM2NDY0IC0yLjM5MDAwMzUzIC02Ljg1MjIxNDU0IC0zLjUzNjYyNjg2IDAgMCBaICIgZmlsbD0iIzE5NzM0RiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM3MCw1NykiLz4KPHBhdGggZD0iTTAgMCBDNi45MyAwIDEzLjg2IDAgMjEgMCBDMjEgMS42NSAyMSAzLjMgMjEgNSBDMTQuMDcgNSA3LjE0IDUgMCA1IEMwIDMuMzUgMCAxLjcgMCAwIFogIiBmaWxsPSIjMUU3MEMwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNjI5LDk0KSIvPgo8cGF0aCBkPSJNMCAwIEMwIDAuOTkgMCAxLjk4IDAgMyBDLTAuOTkgMyAtMS45OCAzIC0zIDMgQy0zIDMuNjYgLTMgNC4zMiAtMyA1IEMtMi4wMSA1LjMzIC0xLjAyIDUuNjYgMCA2IEMwIDcuMzIgMCA4LjY0IDAgMTAgQy02LjYyNSAxMi44NzUgLTYuNjI1IDEyLjg3NSAtMTAgMTQgQy0xMS4xOTI4NzQxMSAxMC4xMjMxNTkxMyAtMTIgNy4wODM3ODA3NyAtMTIgMyBDLTEwLjc1MzM2NjY5IDIuNDkxNjY0MDkgLTkuNTAyNTA2MTMgMS45OTM2ODg1NSAtOC4yNSAxLjUgQy03LjU1MzkwNjI1IDEuMjIxNTYyNSAtNi44NTc4MTI1IDAuOTQzMTI1IC02LjE0MDYyNSAwLjY1NjI1IEMtNCAwIC00IDAgMCAwIFogIiBmaWxsPSIjMUM3NTUxIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzI5LDgwKSIvPgo8cGF0aCBkPSJNMCAwIEM2LjYgMCAxMy4yIDAgMjAgMCBDMjAgMS42NSAyMCAzLjMgMjAgNSBDMTMuNCA1IDYuOCA1IDAgNSBDMCAzLjM1IDAgMS43IDAgMCBaICIgZmlsbD0iIzFFNzBDMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTU4Nyw5NCkiLz4KPHBhdGggZD0iTTAgMCBDMS4zMiAwIDIuNjQgMCA0IDAgQzQgNy45MiA0IDE1Ljg0IDQgMjQgQzIuNjggMjQgMS4zNiAyNCAwIDI0IEMwIDE2LjA4IDAgOC4xNiAwIDAgWiAiIGZpbGw9IiMwMDg0MjkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIwNzcsODUpIi8+CjxwYXRoIGQ9Ik0wIDAgQzEuNjA4NzUgLTAuMDIwNjI1IDMuMjE3NSAtMC4wNDEyNSA0Ljg3NSAtMC4wNjI1IEM1Ljc3OTkyMTg4IC0wLjA3NDEwMTU2IDYuNjg0ODQzNzUgLTAuMDg1NzAzMTIgNy42MTcxODc1IC0wLjA5NzY1NjI1IEMxMCAwIDEwIDAgMTIgMSBDMTEuMzQgMi4zMiAxMC42OCAzLjY0IDEwIDUgQzguMzUgNSA2LjcgNSA1IDUgQzQuNjcgOC42MyA0LjM0IDEyLjI2IDQgMTYgQzIuNjggMTYgMS4zNiAxNiAwIDE2IEMwIDEwLjcyIDAgNS40NCAwIDAgWiAiIGZpbGw9IiMwMDg0MjkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIxNDksOTMpIi8+CjxwYXRoIGQ9Ik0wIDAgQzYuMjcgMCAxMi41NCAwIDE5IDAgQzE4LjY3IDEuNjUgMTguMzQgMy4zIDE4IDUgQzEyLjM5IDUgNi43OCA1IDEgNSBDMC42NyAzLjM1IDAuMzQgMS43IDAgMCBaICIgZmlsbD0iIzFGNzBDMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTYwOSw3OSkiLz4KPHBhdGggZD0iTTAgMCBDNi45MyAwIDEzLjg2IDAgMjEgMCBDMjEgMS4zMiAyMSAyLjY0IDIxIDQgQzEzLjc0IDQgNi40OCA0IC0xIDQgQy0wLjY3IDIuNjggLTAuMzQgMS4zNiAwIDAgWiAiIGZpbGw9IiMxRTcwQzAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE2MjEsNjUpIi8+CjxwYXRoIGQ9Ik0wIDAgQzAuODEyNSAyLjE4NzUgMC44MTI1IDIuMTg3NSAxIDUgQy0xLjEyNSA3Ljg3NSAtMS4xMjUgNy44NzUgLTQgMTAgQy02LjgxMjUgOS44MTI1IC02LjgxMjUgOS44MTI1IC05IDkgQy05Ljc1IDYuNzUgLTkuNzUgNi43NSAtMTAgNCBDLTcuMTk2NDEzNTIgLTAuMTQ5MzA3OTkgLTQuODI5NDYzOCAtMC40MzkwNDIxNiAwIDAgWiAiIGZpbGw9IiMwMDg0MjkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIxMDgsNDApIi8+CjxwYXRoIGQ9Ik0wIDAgQzYuOTMgMCAxMy44NiAwIDIxIDAgQzIxIDEuMzIgMjEgMi42NCAyMSA0IEMxNC4wNyA0IDcuMTQgNCAwIDQgQzAgMi42OCAwIDEuMzYgMCAwIFogIiBmaWxsPSIjMUU3MEMwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNjI5LDEwMikiLz4KPHBhdGggZD0iTTAgMCBDNi42IDAgMTMuMiAwIDIwIDAgQzIwLjMzIDEuMzIgMjAuNjYgMi42NCAyMSA0IEMxNC4wNyA0IDcuMTQgNCAwIDQgQzAgMi42OCAwIDEuMzYgMCAwIFogIiBmaWxsPSIjMUU3MEMwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNTk1LDY1KSIvPgo8cGF0aCBkPSJNMCAwIEM2LjYgMCAxMy4yIDAgMjAgMCBDMjAgMS4zMiAyMCAyLjY0IDIwIDQgQzEzLjQgNCA2LjggNCAwIDQgQzAgMi42OCAwIDEuMzYgMCAwIFogIiBmaWxsPSIjMUU3MEMxIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNTg3LDEwMikiLz4KPHBhdGggZD0iTTAgMCBDMC4zMyAwLjY2IDAuNjYgMS4zMiAxIDIgQzAuNjcgMi42NiAwLjM0IDMuMzIgMCA0IEMwLjAyMzc5MDQgNi4zMTEwNzg3OCAwLjAyMzc5MDQgNi4zMTEwNzg3OCAwLjMxMjUgOC44NzUgQzAuMzkxMTMyODEgOS43Mzg2NzE4NyAwLjQ2OTc2NTYzIDEwLjYwMjM0Mzc1IDAuNTUwNzgxMjUgMTEuNDkyMTg3NSBDMS4wMDMyMDcyNCAxNC4wMTc5MDQ3NSAxLjgxMjYwODMzIDE1Ljc0ODIxMzQgMyAxOCBDMy42ODc1MDI5NCAyMy4yNzA4NTU4NiAyLjE2OTQxODg1IDI1Ljg0MDEzNzc1IC0xIDMwIEMtMS42NiAyOS42NyAtMi4zMiAyOS4zNCAtMyAyOSBDLTIuNTA1IDI3Ljk3OTA2MjUgLTIuNTA1IDI3Ljk3OTA2MjUgLTIgMjYuOTM3NSBDLTAuNTQwNjAwMTQgMjIuNjUwNTEyOSAtMC4yNjA1MDE3MyAxOC44MDI1MjcwNCAtMiAxNC41NjI1IEMtMy40NjUwNTgyOSAxMC44MDgyODgxMiAtMy4zMjAyMDE1OSA4LjAzNDU0MDAyIC0zIDQgQy0xLjUgMS41IC0xLjUgMS41IDAgMCBaICIgZmlsbD0iI0U1RUZFQiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM1MSw2MCkiLz4KPHBhdGggZD0iTTAgMCBDMC4zMyAwIDAuNjYgMCAxIDAgQzAuOTg4Mzk4NDQgMC43NTAyMzQzNyAwLjk3Njc5Njg3IDEuNTAwNDY4NzUgMC45NjQ4NDM3NSAyLjI3MzQzNzUgQzAuOTE5NjU0NTMgNy4zOTkxODY2NiAwLjk4NDI4NjYxIDEyLjMwMTE4MTk1IDEuNzUgMTcuMzc1IEMyLjE5NjY0NjM5IDIxLjE0NzM1MTI3IDIuMTA3NDI3NTkgMjEuODEwMjExMjYgMC4xMjUgMjUuMzEyNSBDLTAuOTI2ODc1IDI2LjY0MjgxMjUgLTAuOTI2ODc1IDI2LjY0MjgxMjUgLTIgMjggQy0yLjc4MjE1NTg4IDMwLjcyODI1MDQgLTIuNzgyMTU1ODggMzAuNzI4MjUwNCAtMyAzMyBDLTMuOTkgMzMgLTQuOTggMzMgLTYgMzMgQy01LjY2Mzk0OTIgMjkuMzg3NDUzODUgLTUuNDU0NzA0MzIgMjcuNDg1NTg5OSAtMi45Mjk2ODc1IDI0Ljc4OTA2MjUgQy0wLjM4MTE3MzczIDIxLjEwNTU4MzA5IC0wLjgyNDUyNDMzIDE4LjI5NzIzMDcyIC0xLjM3NSAxNC4wNjI1IEMtMS45OTMyNTI0NiA4Ljg4OTQ2NTc5IC0yLjA0NDM3NzU4IDQuOTExMTE3NTYgMCAwIFogIiBmaWxsPSIjMkE3RDVDIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzQ0LDYyKSIvPgo8cGF0aCBkPSJNMCAwIEMzLjE2MTE1Nzc2IDEuMzY5ODM1MDMgMy45OTI3MDkyIDEuOTg5MDYzOCA2IDUgQzYuNTMwNzQ3NDEgMTAuNTE5NzczMDggNS4zMDE0OTUxMSAxNC4wMjg3NzA1NSAzIDE5IEMyLjMwODU5NDc4IDIxLjc3ODg4NjEzIDIuMzA4NTk0NzggMjEuNzc4ODg2MTMgMiAyNCBDMS4wMSAyNCAwLjAyIDI0IC0xIDI0IEMtMS4yNTgxMzMwMiAyMC4zODYxMzc3NCAtMS4xNjgxNTY2NyAxOC4zMjkzMDY4IDAuNSAxNS4wNjI1IEMyLjczMzE5NzQyIDEwLjUwMzA1NTI2IDIuNjIzNDM0NjEgNi44MzEzMzkxNiAxIDIuMDYyNSBDMC42NyAxLjM4MTg3NSAwLjM0IDAuNzAxMjUgMCAwIFogIiBmaWxsPSIjMTc3MjREIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzUxLDk3KSIvPgo8cGF0aCBkPSJNMCAwIEMwLjMzIDAuOTkgMC42NiAxLjk4IDEgMyBDMC41MDUgMy45MDc1IDAuMDEgNC44MTUgLTAuNSA1Ljc1IEMtMi4zNzE1ODI0MSA5LjgwNTA5NTIzIC0yLjA1NTkwNDQyIDExLjcwMDk2MDU3IC0xIDE2IEMtMC4wODA4Mzc4IDE4LjM3NzMwOTU2IDAuOTUxMzM0NzMgMjAuNjc0Njk4NzUgMiAyMyBDMiAyMy42NiAyIDI0LjMyIDIgMjUgQzEuMDEgMjUgMC4wMiAyNSAtMSAyNSBDLTEuODcyNzk4NjIgMjMuMTMzNjAwMTkgLTIuNzIyNTEwMjcgMjEuMjU2MzkzODkgLTMuNTYyNSAxOS4zNzUgQy00LjI3NTk5NjA5IDE3LjgwODc4OTA2IC00LjI3NTk5NjA5IDE3LjgwODc4OTA2IC01LjAwMzkwNjI1IDE2LjIxMDkzNzUgQy02LjEzMjU2NzY4IDEyLjU3MjY2NDE5IC02LjAzOTIzNjQyIDEwLjYzNzMyNzQ1IC01IDcgQy0zLjU1NDMxMTQ1IDQuNDMwOTQwMzUgLTEuODIzMDY5ODYgMi4zMzcyNjkwNSAwIDAgWiAiIGZpbGw9IiMxMzZGNEEiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNzcsOTQpIi8+CjxwYXRoIGQ9Ik0wIDAgQzAuNjYgMCAxLjMyIDAgMiAwIEM1LjE4NDE5OTU5IDMuNzk2NTQ1NjcgNS4zODczNDU0OCA3LjExNjc2MjIgNS4yMzgyODEyNSAxMS44NjMyODEyNSBDNC45NDYwNDkxMyAxNC40ODM3ODg5NyA0LjA0MjM4MTk1IDE2LjU4OTQ5MTczIDMgMTkgQzIuNzkzNDQ5MzQgMjIuNDQyNTEwOTcgMi45MDYxNjA2OSAyNC43MTg0ODIwOCA0IDI4IEMyLjA2MjUgMjcuNjI1IDIuMDYyNSAyNy42MjUgMCAyNyBDLTEuNDIxNTEzNDUgMjQuMTU2OTczMDkgLTEuMjM5MjI2MDYgMjIuMTY5NzQ1MjggLTEgMTkgQy0wLjUwNSAxNy44NjU2MjUgLTAuMDEgMTYuNzMxMjUgMC41IDE1LjU2MjUgQzIuNTQzNzYwMDggMTAuNzA4NTY5ODEgMi42OTcwMTA1NCA3LjA0NzQ2ODQ1IDEgMi4wNjI1IEMwLjY3IDEuMzgxODc1IDAuMzQgMC43MDEyNSAwIDAgWiAiIGZpbGw9IiNEREVBRTUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNjksNTkpIi8+CjxwYXRoIGQ9Ik0wIDAgQzIgMiAyIDIgMi4yNSA1LjMxMjUgQzIuMDE4NjM0NTIgOC43MjUxNDA4NCAxLjQ3NjUyODggMTAuOTU0NjU5MzUgMCAxNCBDLTAuNjYgMTMuMzQgLTEuMzIgMTIuNjggLTIgMTIgQy0xLjYyNSA4Ljg3NSAtMS42MjUgOC44NzUgLTEgNiBDLTMuMzEgNi4zMyAtNS42MiA2LjY2IC04IDcgQy04LjA0MjcyMSA1LjMzMzg4MDk1IC04LjA0MDYzODMyIDMuNjY2MTcxMTUgLTggMiBDLTUuOTU0NDc5NTggLTAuMDQ1NTIwNDIgLTIuNzI5NDE5MTQgMC4yMzk0MjI3MyAwIDAgWiAiIGZpbGw9IiMwQzZCNDUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNzAsNjIpIi8+CjxwYXRoIGQ9Ik0wIDAgQzQuMjkgMCA4LjU4IDAgMTMgMCBDMTMgMS42NSAxMyAzLjMgMTMgNSBDOC43MSA1IDQuNDIgNSAwIDUgQzAgMy4zNSAwIDEuNyAwIDAgWiAiIGZpbGw9IiMxRTcwQzEiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE2MjksNzkpIi8+CjxwYXRoIGQ9Ik0wIDAgQzEuMzIgMCAyLjY0IDAgNCAwIEM0IDUuMjggNCAxMC41NiA0IDE2IEMyLjY4IDE2IDEuMzYgMTYgMCAxNiBDMCAxMC43MiAwIDUuNDQgMCAwIFogIiBmaWxsPSIjMDA4NDI5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyMTY5LDkzKSIvPgo8cGF0aCBkPSJNMCAwIEM0LjI5IDAgOC41OCAwIDEzIDAgQzEyLjY3IDAuOTkgMTIuMzQgMS45OCAxMiAzIEMxMC42OCAzIDkuMzYgMyA4IDMgQzggNS42NCA4IDguMjggOCAxMSBDNy4wMSAxMSA2LjAyIDExIDUgMTEgQzUgOC4zNiA1IDUuNzIgNSAzIEMzLjM1IDIuNjcgMS43IDIuMzQgMCAyIEMwIDEuMzQgMCAwLjY4IDAgMCBaICIgZmlsbD0iI0U4MjAyNiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTc0OSwxMTYpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuOTYgMCA3LjkyIDAgMTIgMCBDMTIgMS42NSAxMiAzLjMgMTIgNSBDOC4wNCA1IDQuMDggNSAwIDUgQzAgMy4zNSAwIDEuNyAwIDAgWiAiIGZpbGw9IiMxRTcwQzEiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE1OTUsNzkpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuOTYgMCA3LjkyIDAgMTIgMCBDMTIgMS42NSAxMiAzLjMgMTIgNSBDOC4wNCA1IDQuMDggNSAwIDUgQzAgMy4zNSAwIDEuNyAwIDAgWiAiIGZpbGw9IiMxRTcwQzEiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE1MTgsNzkpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuOTYgMCA3LjkyIDAgMTIgMCBDMTIgMS42NSAxMiAzLjMgMTIgNSBDOC4wNCA1IDQuMDggNSAwIDUgQzAgMy4zNSAwIDEuNyAwIDAgWiAiIGZpbGw9IiMxRjcwQzAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE1MTgsNzIpIi8+CjxwYXRoIGQ9Ik0wIDAgQzAuOTkgMCAxLjk4IDAgMyAwIEMzIDIuNjQgMyA1LjI4IDMgOCBDNS42NCA4IDguMjggOCAxMSA4IEMxMC42NyA4Ljk5IDEwLjM0IDkuOTggMTAgMTEgQzYuNyAxMSAzLjQgMTEgMCAxMSBDMCA3LjM3IDAgMy43NCAwIDAgWiAiIGZpbGw9IiNFODIwMjYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE3OTgsMTE2KSIvPgo8cGF0aCBkPSJNMCAwIEMwLjEyMTE3MTg4IDAuNjAzMjgxMjUgMC4yNDIzNDM3NSAxLjIwNjU2MjUgMC4zNjcxODc1IDEuODI4MTI1IEMwLjUzNDc2NTYzIDIuNjI3MzQzNzUgMC43MDIzNDM3NSAzLjQyNjU2MjUgMC44NzUgNC4yNSBDMS4wMzc0MjE4OCA1LjAzODkwNjI1IDEuMTk5ODQzNzUgNS44Mjc4MTI1IDEuMzY3MTg3NSA2LjY0MDYyNSBDMS45MTcxMzYxNyA5LjAxNDkwNDM4IDEuOTE3MTM2MTcgOS4wMTQ5MDQzOCAzLjA2MjUgMTEuMDkzNzUgQzQuMzcxMjUzNjQgMTMuNzU0ODgyNCA0LjEzMjY4NDUxIDE2LjA4MDk0MDc2IDQgMTkgQzMuMDEgMTkgMi4wMiAxOSAxIDE5IEMwLjcxMTI1IDE3Ljc4MzEyNSAwLjQyMjUgMTYuNTY2MjUgMC4xMjUgMTUuMzEyNSBDLTAuNDgzNjM3NyAxMi44NDMxNjk5MSAtMS4xMzkxMzY4MSAxMC42Njc2MTc2MyAtMi4xMjUgOC4zMTI1IEMtMy4xMDE2MzIyIDUuNzMxNDAwNjMgLTMuMTU2Mzg1NjggMy43MzY3NDk0NSAtMyAxIEMtMSAwIC0xIDAgMCAwIFogIiBmaWxsPSIjMEU2QzQ3IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzY4LDEwMikiLz4KPHBhdGggZD0iTTAgMCBDNC45NSAwIDkuOSAwIDE1IDAgQzE0LjM0IDEuMzIgMTMuNjggMi42NCAxMyA0IEM5LjA0IDQgNS4wOCA0IDEgNCBDMC42NyAyLjY4IDAuMzQgMS4zNiAwIDAgWiAiIGZpbGw9IiMxRTcwQzAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE2MTEsODcpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuNjI1NDM5MjIgMC41MTc5MTk4OSA3LjI1MDczNjc2IDEuMDM2Mzk3MjcgMTAuODc1IDEuNTYyNSBDMTIuOTMwODIyNzEgMS44NzcxMDUwMiAxMi45MzA4MjI3MSAxLjg3NzEwNTAyIDE1IDIgQzE1IDMuNjUgMTUgNS4zIDE1IDcgQzkuNTQ1MjA4MTUgNi40MzE3OTI1MiA1LjA4OTQwNzQ0IDUuMDUzNjIwNTUgMCAzIEMwIDIuMDEgMCAxLjAyIDAgMCBaICIgZmlsbD0iI0VFRjRGMiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM5MSw3MykiLz4KPHBhdGggZD0iTTAgMCBDMy42MyAwIDcuMjYgMCAxMSAwIEMxMSAyLjMxIDExIDQuNjIgMTEgNyBDMTAuMzQgNyA5LjY4IDcgOSA3IEM5IDUuNjggOSA0LjM2IDkgMyBDNy4wMiAzIDUuMDQgMyAzIDMgQzIuNjcgNC4zMiAyLjM0IDUuNjQgMiA3IEMxLjM0IDcgMC42OCA3IDAgNyBDMCA0LjY5IDAgMi4zOCAwIDAgWiAiIGZpbGw9IiNFODIwMjYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE4MTMsMTIwKSIvPgo8cGF0aCBkPSJNMCAwIEM0LjI5IDAgOC41OCAwIDEzIDAgQzEzIDEuMzIgMTMgMi42NCAxMyA0IEM4LjcxIDQgNC40MiA0IDAgNCBDMCAyLjY4IDAgMS4zNiAwIDAgWiAiIGZpbGw9IiMxRjcwQzAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE2MjksODcpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuOTYgMCA3LjkyIDAgMTIgMCBDMTIuMzMgMS4zMiAxMi42NiAyLjY0IDEzIDQgQzguNzEgNCA0LjQyIDQgMCA0IEMwIDIuNjggMCAxLjM2IDAgMCBaICIgZmlsbD0iIzFFNzBDMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTU3Miw4NykiLz4KPHBhdGggZD0iTTAgMCBDMy40NDQ0NzI5OSAyLjkzNTIwOTUxIDMuNTc3ODc2MSA1LjI1NjU4Mjc0IDMuOTY0ODQzNzUgOS41OTc2NTYyNSBDMy45OTg0NTQwNiAxMS44OTQzNjEgMy43Mzc5MTUwOSAxMy44NzUxMjQzMyAzLjMxMjUgMTYuMTI1IEMyLjkwNDY5NjM3IDIxLjE4MTc2NSA0LjE4MDYwNDkgMjIuODk5MDYxNjcgNyAyNyBDNi4zNCAyNy4zMyA1LjY4IDI3LjY2IDUgMjggQy0wLjA2ODA5Mzg0IDIxLjI0ODM4NzEgLTAuMDY4MDkzODQgMjEuMjQ4Mzg3MSAwLjE4NzUgMTYuNTYyNSBDMC40NTU2MjUgMTUuMzg2ODc1IDAuNzIzNzUgMTQuMjExMjUgMSAxMyBDMS4wODIyOTE3IDExLjQzOTExMjI5IDEuMTIyNDQ1OTkgOS44NzU1NTMzNyAxLjEyNSA4LjMxMjUgQzEuMTI4ODY3MTkgNy4yMjM4ODY3MiAxLjEyODg2NzE5IDcuMjIzODg2NzIgMS4xMzI4MTI1IDYuMTEzMjgxMjUgQzAuOTk3ODA3MzIgMy45NjUxMTA1OSAwLjU4NzcyOTQgMi4wNjYzODE5NSAwIDAgWiAiIGZpbGw9IiNEMEUyREIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNzgsNjMpIi8+CjxwYXRoIGQ9Ik0wIDAgQzQuMjkgMCA4LjU4IDAgMTMgMCBDMTIuNjcgMS4zMiAxMi4zNCAyLjY0IDEyIDQgQzguMDQgNCA0LjA4IDQgMCA0IEMwIDIuNjggMCAxLjM2IDAgMCBaICIgZmlsbD0iIzFFNzBDMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTU3Miw2NSkiLz4KPHBhdGggZD0iTTAgMCBDMCAwLjk5IDAgMS45OCAwIDMgQy0xLjU3OTY3ODA3IDMuNjc1MjgyMjMgLTMuMTYzOTE5MDMgNC4zMzk4OTY5NCAtNC43NSA1IEMtNi4wNzI1NzgxMyA1LjU1Njg3NSAtNi4wNzI1NzgxMyA1LjU1Njg3NSAtNy40MjE4NzUgNi4xMjUgQy0xMCA3IC0xMCA3IC0xNCA3IEMtMTQgNS42OCAtMTQgNC4zNiAtMTQgMyBDLTQuNTg5OTc3MjIgLTAuNDQ0MTkxMzQgLTQuNTg5OTc3MjIgLTAuNDQ0MTkxMzQgMCAwIFogIiBmaWxsPSIjRUZGNUYzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzMxLDczKSIvPgo8cGF0aCBkPSJNMCAwIEMzLjk2IDAgNy45MiAwIDEyIDAgQzEyIDEuMzIgMTIgMi42NCAxMiA0IEM4LjA0IDQgNC4wOCA0IDAgNCBDMCAyLjY4IDAgMS4zNiAwIDAgWiAiIGZpbGw9IiMxRTcwQzAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE1OTUsODcpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuOTYgMCA3LjkyIDAgMTIgMCBDMTIgMS4zMiAxMiAyLjY0IDEyIDQgQzguMDQgNCA0LjA4IDQgMCA0IEMwIDIuNjggMCAxLjM2IDAgMCBaICIgZmlsbD0iIzFFNzBDMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTU0OSw4NykiLz4KPHBhdGggZD0iTTAgMCBDMy45NiAwIDcuOTIgMCAxMiAwIEMxMiAxLjMyIDEyIDIuNjQgMTIgNCBDOC4wNCA0IDQuMDggNCAwIDQgQzAgMi42OCAwIDEuMzYgMCAwIFogIiBmaWxsPSIjMUU3MEMwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNTE4LDg3KSIvPgo8cGF0aCBkPSJNMCAwIEMzLjk2IDAgNy45MiAwIDEyIDAgQzEyIDEuMzIgMTIgMi42NCAxMiA0IEM4LjA0IDQgNC4wOCA0IDAgNCBDMCAyLjY4IDAgMS4zNiAwIDAgWiAiIGZpbGw9IiMxRTcwQzAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE1NDksNjUpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuOTYgMCA3LjkyIDAgMTIgMCBDMTIgMS4zMiAxMiAyLjY0IDEyIDQgQzguMDQgNCA0LjA4IDQgMCA0IEMwIDIuNjggMCAxLjM2IDAgMCBaICIgZmlsbD0iIzFFNzBDMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTUxOCw2NSkiLz4KPHBhdGggZD0iTTAgMCBDMy4zNzQ2MjcxNSAwLjU0NzIzNjgzIDUuMDgyMzUgMS4wNTQ5IDggMyBDNy4zNCA0Ljk4IDYuNjggNi45NiA2IDkgQzQgOCAyIDcgMCA2IEMwIDQuMDIgMCAyLjA0IDAgMCBaICIgZmlsbD0iIzFENzY1MiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM5Myw5MykiLz4KPHBhdGggZD0iTTAgMCBDMCAzIDAgMyAtMSA1IEMtMS4yMTM3NzcyMSAxMC42MDcwMzIxMyAtMS4yMTM3NzcyMSAxMC42MDcwMzIxMyAwIDE2IEMwLjEyNzgxNzg2IDE4LjY3Mzk0OTY0IDAuMDQzOTE4NzEgMjEuMzIwOTU4NTcgMCAyNCBDLTAuNjYgMjQgLTEuMzIgMjQgLTIgMjQgQy0zLjcyNzI5MzA0IDE3LjI5MDY3OTkxIC00Ljc4MjM1NDYyIDEwLjgxODQwMzYgLTMgNCBDLTEuNDQ5MjE4NzUgMS43MTA5Mzc1IC0xLjQ0OTIxODc1IDEuNzEwOTM3NSAwIDAgWiAiIGZpbGw9IiNEOUU4RTIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNDgsNjApIi8+CjxwYXRoIGQ9Ik0wIDAgQzAuMzMgMCAwLjY2IDAgMSAwIEMxIDEuNjUgMSAzLjMgMSA1IEMxLjg4Njg3NSA0LjY5MDYyNSAyLjc3Mzc1IDQuMzgxMjUgMy42ODc1IDQuMDYyNSBDOS4xNjA2NzE0NiAyLjMwNjk1NDQ0IDkuMTYwNjcxNDYgMi4zMDY5NTQ0NCAxMiAyIEMxMi45OSAyLjY2IDEzLjk4IDMuMzIgMTUgNCBDMTQuNjcgNC42NiAxNC4zNCA1LjMyIDE0IDYgQzExLjY4MDI1NzY2IDYuNDE3NTUzNjIgOS4zNDIxNDIwNyA2LjczNTU2NDYgNyA3IEM1LjA1MDkzNzUgNy4yNzg0Mzc1IDUuMDUwOTM3NSA3LjI3ODQzNzUgMy4wNjI1IDcuNTYyNSBDMi4wNTE4NzUgNy43MDY4NzUgMS4wNDEyNSA3Ljg1MTI1IDAgOCBDMCA1LjM2IDAgMi43MiAwIDAgWiAiIGZpbGw9IiMxODcyNEUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzMTcsNjgpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuMzMzMzMzMzMgMCA2LjY2NjY2NjY3IDAgMTAgMCBDMTAgMS45OCAxMCAzLjk2IDEwIDYgQzcuMzYgNiA0LjcyIDYgMiA2IEMyIDQuNjggMiAzLjM2IDIgMiBDMS4zNCAyIDAuNjggMiAwIDIgQzAgMS4zNCAwIDAuNjggMCAwIFogIiBmaWxsPSIjMDA2NDNDIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzg1LDExNykiLz4KPHBhdGggZD0iTTAgMCBDMi45NyAwIDUuOTQgMCA5IDAgQzguNjcgMS42NSA4LjM0IDMuMyA4IDUgQzUuNjkgNSAzLjM4IDUgMSA1IEMwLjY3IDMuMzUgMC4zNCAxLjcgMCAwIFogIiBmaWxsPSIjMUU3MEMxIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNjE0LDk0KSIvPgo8cGF0aCBkPSJNMCAwIEMwIDAuOTkgMCAxLjk4IDAgMyBDLTMuNjMgNC4zMiAtNy4yNiA1LjY0IC0xMSA3IEMtMTEuMzMgNS42OCAtMTEuNjYgNC4zNiAtMTIgMyBDLTEwLjc1MzM2NjY5IDIuNDkxNjY0MDkgLTkuNTAyNTA2MTMgMS45OTM2ODg1NSAtOC4yNSAxLjUgQy03LjU1MzkwNjI1IDEuMjIxNTYyNSAtNi44NTc4MTI1IDAuOTQzMTI1IC02LjE0MDYyNSAwLjY1NjI1IEMtNCAwIC00IDAgMCAwIFogIiBmaWxsPSIjRUZGNUYyIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzI5LDgwKSIvPgo8cGF0aCBkPSJNMCAwIEMxLjA3MDc3Mzc1IDMuMjEyMzIxMjUgMSA1LjYzOTM3ODA3IDEgOSBDMS4zMyA5Ljk5IDEuNjYgMTAuOTggMiAxMiBDMS4wMSAxMiAwLjAyIDEyIC0xIDEyIEMtMS4zMyAxMC4zNSAtMS42NiA4LjcgLTIgNyBDLTMuOTggNyAtNS45NiA3IC04IDcgQy03LjIzNjg3NSA2LjQwMTg3NSAtNi40NzM3NSA1LjgwMzc1IC01LjY4NzUgNS4xODc1IEMtMy42NTE2NDI1IDMuNTMwNDA2NjggLTEuODAyMTcyMSAxLjg5NzAyMzI2IDAgMCBaICIgZmlsbD0iIzBENkI0NSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM2OCw3NSkiLz4KPHBhdGggZD0iTTAgMCBDMS4yMDE1NzEzMSAzLjYwNDcxMzkzIDEuNTQ5ODEzNDggNy4xMTUwMzA4OCAxLjg3NSAxMC44NzUgQzEuOTYwMDc4MTMgMTEuNTgyNjk1MzEgMi4wNDUxNTYyNSAxMi4yOTAzOTA2MyAyLjEzMjgxMjUgMTMuMDE5NTMxMjUgQzIuNDc2OTI2MjggMTcuMjE5MjgzNTEgMi4yMzk3Mzc5MiAxOC43MTA2NjExMyAtMC40OTIxODc1IDIyLjAwNzgxMjUgQy0xLjMxOTc2NTYyIDIyLjY2NTIzNDM3IC0yLjE0NzM0Mzc1IDIzLjMyMjY1NjI1IC0zIDI0IEMtMi4xMjUgMjAuMTI1IC0yLjEyNSAyMC4xMjUgLTEgMTkgQy0wLjkzOTY4OTYzIDE1LjM4NTE0NzQyIC0wLjk4MDA1NDkzIDExLjc4NDEzNTc2IC0xLjAzOTA2MjUgOC4xNjk5MjE4OCBDLTEuMTAwMTMzMTUgMi4yMDAyNjYyOSAtMS4xMDAxMzMxNSAyLjIwMDI2NjI5IDAgMCBaICIgZmlsbD0iI0RERUFFNSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM0Miw2NSkiLz4KPHBhdGggZD0iTTAgMCBDMSAyIDEgMiAwLjkzNzUgNS42ODc1IEMwLjg2OTQ3NzA3IDkuODIxNzgyMyAxLjY5NjU0Mzg5IDEzLjA4OTYzMTY4IDMgMTcgQzIuMzQgMTcgMS42OCAxNyAxIDE3IEMwLjY3IDE4LjMyIDAuMzQgMTkuNjQgMCAyMSBDLTEuMzk3NzM2NjEgMTQuOTA5ODYxOSAtMi40MzkxOTg3NCA5LjI1ODU4MjExIC0yIDMgQy0xLjM0IDIuMDEgLTAuNjggMS4wMiAwIDAgWiAiIGZpbGw9IiMyMTc4NTUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNDgsNjIpIi8+CjxwYXRoIGQ9Ik0wIDAgQzQuMTk0Njk1NzEgMC41OTkyNDIyNCA4LjAwOTk5ODM0IDEuNTc0OTk5NDEgMTIgMyBDMTIgMy45OSAxMiA0Ljk4IDEyIDYgQzcuNjgyMjU0MiA1LjQ5MjAyOTkxIDMuOTY2OTc4ODYgNC44MDMxNzIyMSAwIDMgQzAgMi4wMSAwIDEuMDIgMCAwIFogIiBmaWxsPSIjRTdGMEVDIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzkzLDgwKSIvPgo8cGF0aCBkPSJNMCAwIEMxLjY3NTQyOTc2IDAuMjg2MDQ4OTggMy4zNDM4NTM0MyAwLjYxNzgxMjMzIDUgMSBDNS44NDY4MTEzMyA2LjA4MDg2Nzk2IDYuMDkwMzgwOTkgMTAuODQ4MjgzNzcgNiAxNiBDNS4zNCAxNiA0LjY4IDE2IDQgMTYgQzMuOTUxMDE1NjMgMTUuNDA4MzIwMzEgMy45MDIwMzEyNSAxNC44MTY2NDA2MyAzLjg1MTU2MjUgMTQuMjA3MDMxMjUgQzMuMjYxOTU4IDcuODg5NzQ5MDkgMy4yNjE5NTggNy44ODk3NDkwOSAxIDIgQzAuMzQgMS42NyAtMC4zMiAxLjM0IC0xIDEgQy0wLjY3IDAuNjcgLTAuMzQgMC4zNCAwIDAgWiAiIGZpbGw9IiMxNzcyNEUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNzAsNTcpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuNjA4ODEzMSAwLjgzNTA2MTE3IDMuNjA4ODEzMSAwLjgzNTA2MTE3IDUuODEyNSAtMC41IEM1LjgxMjUgMS4xNSA1LjgxMjUgMi44IDUuODEyNSA0LjUgQzMuNDc5MTY2NjcgNC4xNjY2NjY2NyAxLjE0NTgzMzMzIDMuODMzMzMzMzMgLTEuMTg3NSAzLjUgQy0yLjQ2NjI1IDMuMzU1NjI1IC0zLjc0NSAzLjIxMTI1IC01LjA2MjUgMy4wNjI1IEMtNi4wOTM3NSAyLjg3Njg3NSAtNy4xMjUgMi42OTEyNSAtOC4xODc1IDIuNSBDLTguNTE3NSAxLjg0IC04Ljg0NzUgMS4xOCAtOS4xODc1IDAuNSBDLTUuOTIyMjU5MDcgLTAuNDE4MzQ5MDEgLTMuMzE1NTMyMDkgLTAuNDc3MDk4NDIgMCAwIFogIiBmaWxsPSIjMUI3NDUxIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzk5LjE4NzUsNzEuNSkiLz4KPHBhdGggZD0iTTAgMCBDMi45NyAwIDUuOTQgMCA5IDAgQzguNjcgMS4zMiA4LjM0IDIuNjQgOCA0IEM1LjAzIDQgMi4wNiA0IC0xIDQgQy0wLjY3IDIuNjggLTAuMzQgMS4zNiAwIDAgWiAiIGZpbGw9IiNEQ0VERTIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIwNDAsOTIpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuOTYgMCA3LjkyIDAgMTIgMCBDMTEuNjcgMC45OSAxMS4zNCAxLjk4IDExIDMgQzcuNyAzIDQuNCAzIDEgMyBDMC42NyAyLjAxIDAuMzQgMS4wMiAwIDAgWiAiIGZpbGw9IiNFNzIwMjYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE3NjYsMTIwKSIvPgo8cGF0aCBkPSJNMCAwIEMzLjk2IDAgNy45MiAwIDEyIDAgQzExLjY3IDAuOTkgMTEuMzQgMS45OCAxMSAzIEM3LjcgMyA0LjQgMyAxIDMgQzAuNjcgMi4wMSAwLjM0IDEuMDIgMCAwIFogIiBmaWxsPSIjRTkyMDI2IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNzY2LDExNikiLz4KPHBhdGggZD0iTTAgMCBDOS40MTAwMjI3OCAtMC4zNjkwMjA1IDkuNDEwMDIyNzggLTAuMzY5MDIwNSAxNCAyIEMxNCAzLjY1IDE0IDUuMyAxNCA3IEMxMy41MDUgNi41MjU2MjUgMTMuMDEgNi4wNTEyNSAxMi41IDUuNTYyNSBDOS45MzI3MzUyOSAzLjk1Nzk1OTU1IDguODAwMzY5MDkgMy43NDk5ODYwOSA1Ljg3NSAzLjUgQzQuNTk2MjUgMy4zMzUgMy4zMTc1IDMuMTcgMiAzIEMxLjM0IDIuMDEgMC42OCAxLjAyIDAgMCBaICIgZmlsbD0iIzNEODk2QiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM1Niw1NSkiLz4KPHBhdGggZD0iTTAgMCBDMC4yODQ4ODI4MSAwLjU3NDkyMTg4IDAuNTY5NzY1NjIgMS4xNDk4NDM3NSAwLjg2MzI4MTI1IDEuNzQyMTg3NSBDMS41OTM5MzI5NyAzLjE5MzQ0NzYyIDIuMzQwMTUwNTEgNC42MzcwMzEgMy4xMDU0Njg3NSA2LjA3MDMxMjUgQzMuNDYyNTM5MDYgNi43NDgzNTkzOCAzLjgxOTYwOTM4IDcuNDI2NDA2MjUgNC4xODc1IDguMTI1IEM0LjU1MjMwNDY5IDguODA4MjAzMTMgNC45MTcxMDkzOCA5LjQ5MTQwNjI1IDUuMjkyOTY4NzUgMTAuMTk1MzEyNSBDNS41MjYyODkwNiAxMC43OTA4NTkzNyA1Ljc1OTYwOTM4IDExLjM4NjQwNjI1IDYgMTIgQzUuNjcgMTIuNjYgNS4zNCAxMy4zMiA1IDE0IEM0LjM0IDE0IDMuNjggMTQgMyAxNCBDLTEuMDc4Nzc0NjIgNS45NjQ5ODkwNiAtMS4wNzg3NzQ2MiA1Ljk2NDk4OTA2IC0wLjc1IDEuOTM3NSBDLTAuNTAyNSAxLjI5ODEyNSAtMC4yNTUgMC42NTg3NSAwIDAgWiAiIGZpbGw9IiMwQzZCNDUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNzgsMTAzKSIvPgo8cGF0aCBkPSJNMCAwIEMzLjk2IDAgNy45MiAwIDEyIDAgQzExLjAxIDEuNDg1IDExLjAxIDEuNDg1IDEwIDMgQzguMTI1IDMuMzI4MTI1IDguMTI1IDMuMzI4MTI1IDYgMy4yNSBDNS4yOTg3NSAzLjIzNDUzMTI1IDQuNTk3NSAzLjIxOTA2MjUgMy44NzUgMy4yMDMxMjUgQzIgMyAyIDMgMCAyIEMwIDEuMzQgMCAwLjY4IDAgMCBaICIgZmlsbD0iI0U4MjAyNiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTc2NiwxMjQpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuNjMgMCA3LjI2IDAgMTEgMCBDMTAuNjcgMC45OSAxMC4zNCAxLjk4IDEwIDMgQzcuMDMgMyA0LjA2IDMgMSAzIEMwLjY3IDIuMDEgMC4zNCAxLjAyIDAgMCBaICIgZmlsbD0iI0U4MjAyNiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTgxMywxMTYpIi8+CjxwYXRoIGQ9Ik0wIDAgQzAuNDk1IDAuMzkxODc1IDAuOTkgMC43ODM3NSAxLjUgMS4xODc1IEMwLjE2NjY2NjY3IDEuODU0MTY2NjcgLTEuMTY2NjY2NjcgMi41MjA4MzMzMyAtMi41IDMuMTg3NSBDLTMuNDkgMy43NDQzNzUgLTMuNDkgMy43NDQzNzUgLTQuNSA0LjMxMjUgQy02LjUgNS4xODc1IC02LjUgNS4xODc1IC0xMC41IDUuMTg3NSBDLTEwLjUgNC4xOTc1IC0xMC41IDMuMjA3NSAtMTAuNSAyLjE4NzUgQy0zLjI4Nzc0NjE3IC0xLjA2ODUxNzUxIC0zLjI4Nzc0NjE3IC0xLjA2ODUxNzUxIDAgMCBaICIgZmlsbD0iIzEyNkY0QSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTMyNy41LDc3LjgxMjUpIi8+CjxwYXRoIGQ9Ik0wIDAgQzIuNjQgMCA1LjI4IDAgOCAwIEM3LjY3IDEuMzIgNy4zNCAyLjY0IDcgNCBDNC42OSA0IDIuMzggNCAwIDQgQzAgMi42OCAwIDEuMzYgMCAwIFogIiBmaWxsPSIjRDdFQkRFIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyMDA5LDk2KSIvPgo8cGF0aCBkPSJNMCAwIEMzLjU1NzgwMTk2IDAuNjA5OTA4OTEgNi42ODI4NTg5IDEuNTc4MzY4MSAxMCAzIEM5LjY3IDMuOTkgOS4zNCA0Ljk4IDkgNiBDNS44NTI2MjgxOCA1LjMwMDU4NDA0IDIuOTc0MTExMjQgNC4yMzkyMTMwMiAwIDMgQzAgMi4wMSAwIDEuMDIgMCAwIFogIiBmaWxsPSIjREZFQkU2IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzk0LDg3KSIvPgo8cGF0aCBkPSJNMCAwIEMtMSAzIC0xIDMgLTIuODQ3NjU2MjUgNC4xNjc5Njg3NSBDLTMuNTc4NTU0NjkgNC41MDQ0MTQwNiAtNC4zMDk0NTMxMiA0Ljg0MDg1OTM3IC01LjA2MjUgNS4xODc1IEMtNS43OTU5NzY1NiA1LjUzMTY3OTY5IC02LjUyOTQ1MzEyIDUuODc1ODU5MzggLTcuMjg1MTU2MjUgNi4yMzA0Njg3NSBDLTguMTM0MDAzOTEgNi42MTEzODY3MiAtOC4xMzQwMDM5MSA2LjYxMTM4NjcyIC05IDcgQy05LjMzIDUuNjggLTkuNjYgNC4zNiAtMTAgMyBDLTYuMjcwMzQ4NjEgMC45NjU2NDQ2OSAtNC4zMzA5NDk1OCAwIDAgMCBaICIgZmlsbD0iI0U4RjFFRCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTMyOCw4NykiLz4KPHBhdGggZD0iTTAgMCBDMi4zOTI3MzIzNSAzLjU4OTA5ODUzIDMuMTUzMTA5ODYgNS4yNjMxMzQ3OCAzLjE4NzUgOS41IEMzLjIwMTY3OTY5IDEwLjI5NDA2MjUgMy4yMTU4NTkzOCAxMS4wODgxMjUgMy4yMzA0Njg3NSAxMS45MDYyNSBDMyAxNCAzIDE0IDEgMTYgQy0wLjE1NzAzOTggMTIuNTI4ODgwNTkgLTAuMDMzOTY0ODkgOS43NzM2ODM0NiAwLjA2MjUgNi4xNTYyNSBDMC4wOTg0MjE3OSAzLjgxNDI1MTIzIDAuMDk4NDIxNzkgMy44MTQyNTEyMyAtMSAxIEMtMC42NyAwLjY3IC0wLjM0IDAuMzQgMCAwIFogIiBmaWxsPSIjMjI3OTU2IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzc3LDYyKSIvPgo8cGF0aCBkPSJNMCAwIEMwLjY2IDAuMzMgMS4zMiAwLjY2IDIgMSBDMS4zNCAzLjk3IDAuNjggNi45NCAwIDEwIEMtMC45OSA5LjY3IC0xLjk4IDkuMzQgLTMgOSBDLTIuNDQyNzEwODcgNS42NTYyNjUyNSAtMS42NDgyNjExMSAyLjk2Njg3MDAxIDAgMCBaICIgZmlsbD0iI0RDRUFFNCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM0NCwxMDgpIi8+CjxwYXRoIGQ9Ik0wIDAgQzMuMjcyODY2ODIgMi43ODE5MzY4IDQuOTY0Mjc2OTcgNi4yNzk1NDA2NyA3IDEwIEM2LjAxIDEwLjMzIDUuMDIgMTAuNjYgNCAxMSBDMy4zMjU5MTY5MiA5LjczMzA4NDkzIDIuNjYwOTk1MDMgOC40NjEyOTI1MSAyIDcuMTg3NSBDMS42Mjg3NSA2LjQ3OTgwNDY5IDEuMjU3NSA1Ljc3MjEwOTM3IDAuODc1IDUuMDQyOTY4NzUgQzAgMyAwIDMgMCAwIFogIiBmaWxsPSIjRDVFNURGIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzc5LDEwNCkiLz4KPHBhdGggZD0iTTAgMCBDMi42NCAwIDUuMjggMCA4IDAgQzcuMzQgMS4zMiA2LjY4IDIuNjQgNiA0IEMzLjAzIDMuNTA1IDMuMDMgMy41MDUgMCAzIEMwIDIuMDEgMCAxLjAyIDAgMCBaICIgZmlsbD0iI0ZDRkRGQyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjAzOCw5OSkiLz4KPHBhdGggZD0iTTAgMCBDMCAwLjk5IDAgMS45OCAwIDMgQy0zLjQ2NSA0LjQ4NSAtMy40NjUgNC40ODUgLTcgNiBDLTcuMzMgNS4wMSAtNy42NiA0LjAyIC04IDMgQy0zLjM3NSAwIC0zLjM3NSAwIDAgMCBaICIgZmlsbD0iI0Q2RTZERiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTMyOSw5MykiLz4KPHBhdGggZD0iTTAgMCBDLTAuNzUgNy43NSAtMC43NSA3Ljc1IC0zIDEwIEMtNC40NzgzMjI2IDcuMDQzMzU0ODEgLTQuMDYwMzI3ODMgNC4yNTc3MDI2MyAtNCAxIEMtMiAwIC0yIDAgMCAwIFogIiBmaWxsPSIjMkM3RTVEIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzcyLDY2KSIvPgo8cGF0aCBkPSJNMCAwIEMwLjkzMDQ1OTMzIDIuNTUxNDQ4MjQgMS4wODU2NDA5MSAzLjc0MDA2NDc4IDAuMjIyNjU2MjUgNi4zNTkzNzUgQy0wLjE2MDE5NTMxIDcuMTQ4MjgxMjUgLTAuNTQzMDQ2ODggNy45MzcxODc1IC0wLjkzNzUgOC43NSBDLTEuNTA3OTEwMTYgOS45NDg4MjgxMyAtMS41MDc5MTAxNiA5Ljk0ODgyODEzIC0yLjA4OTg0Mzc1IDExLjE3MTg3NSBDLTIuMzkwMTk1MzEgMTEuNzc1MTU2MjUgLTIuNjkwNTQ2ODggMTIuMzc4NDM3NSAtMyAxMyBDLTMuNjYgMTIuNjcgLTQuMzIgMTIuMzQgLTUgMTIgQy00LjQ2MjMxMTI4IDguMTI4NjQxMiAtMy40MjI1MjcgNi4wMjgxNTg3NSAtMSAzIEMtMC42NyAyLjAxIC0wLjM0IDEuMDIgMCAwIFogIiBmaWxsPSIjRENFOUU0IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzQyLDEwMykiLz4KPHBhdGggZD0iTTAgMCBDMC45OSAwLjMzIDEuOTggMC42NiAzIDEgQzIuNTQ2MjUgMS43NDI1IDIuMDkyNSAyLjQ4NSAxLjYyNSAzLjI1IEMwLjMxMzU5MjA0IDUuNDY5MzA1NzggLTAuODgyODA4MDMgNy42Nzk2NzgyMiAtMiAxMCBDLTMuMDYzNTE2NzUgNi42MTYwODMwNyAtMy4yMTQ0Mjk4MiA1LjQxOTUzNjYgLTEuNTYyNSAyLjE4NzUgQy0xLjA0Njg3NSAxLjQ2NTYyNSAtMC41MzEyNSAwLjc0Mzc1IDAgMCBaICIgZmlsbD0iI0RCRTlFMyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM3OCw5NikiLz4KPHBhdGggZD0iTTAgMCBDMCAwLjk5IDAgMS45OCAwIDMgQy0yLjUgNC42ODc1IC0yLjUgNC42ODc1IC01IDYgQy01LjY2IDUuMDEgLTYuMzIgNC4wMiAtNyAzIEMtMy4zNzUgMCAtMy4zNzUgMCAwIDAgWiAiIGZpbGw9IiMwRDZDNDYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzMjksOTYpIi8+CjxwYXRoIGQ9Ik0wIDAgQzAuNjYgMCAxLjMyIDAgMiAwIEMyIDAuNjYgMiAxLjMyIDIgMiBDMy4zMiAyIDQuNjQgMiA2IDIgQzYgMi42NiA2IDMuMzIgNiA0IEM0LjY4IDQgMy4zNiA0IDIgNCBDMS42NyA1LjMyIDEuMzQgNi42NCAxIDggQy0wLjM1NDM5NjY4IDUuMjkxMjA2NjUgLTAuMDY1MDE0NTEgMi45OTA2NjczMiAwIDAgWiAiIGZpbGw9IiMxOTczNEYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNTAsNjQpIi8+CjxwYXRoIGQ9Ik0wIDAgQzEuMzIgMC42NiAyLjY0IDEuMzIgNCAyIEM0IDIuOTkgNCAzLjk4IDQgNSBDMSA1IDEgNSAtMC42ODc1IDMuNSBDLTEuMTIwNjI1IDMuMDA1IC0xLjU1Mzc1IDIuNTEgLTIgMiBDLTEuMzQgMS4zNCAtMC42OCAwLjY4IDAgMCBaICIgZmlsbD0iIzE1NzI0QyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM5MiwxMDEpIi8+CjxwYXRoIGQ9Ik0wIDAgQzAuOTkgMC4zMyAxLjk4IDAuNjYgMyAxIEMyLjM0IDMuOTcgMS42OCA2Ljk0IDEgMTAgQzAuMDEgOS4wMSAtMC45OCA4LjAyIC0yIDcgQy0xLjM0IDQuNjkgLTAuNjggMi4zOCAwIDAgWiAiIGZpbGw9IiMyOTdENUIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNzMsNzMpIi8+CjxwYXRoIGQ9Ik0wIDAgQzIgMC42NjY2NjY2NyA0IDEuMzMzMzMzMzMgNiAyIEM1LjY3IDIuNjYgNS4zNCAzLjMyIDUgNCBDMi4zNTEzOTU3MyA0LjU5MzU1NjE0IC0wLjI5MTk3MzIyIDQuNzQyMDkyNjkgLTMgNSBDLTIuNjI1IDMuMDYyNSAtMi42MjUgMy4wNjI1IC0yIDEgQy0xLjM0IDAuNjcgLTAuNjggMC4zNCAwIDAgWiAiIGZpbGw9IiMzMzgzNjMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzMjYsNzApIi8+CjxwYXRoIGQ9Ik0wIDAgQzIuMzEgMCA0LjYyIDAgNyAwIEM3IDEuMzIgNyAyLjY0IDcgNCBDNS42OCA0IDQuMzYgNCAzIDQgQzMgMy4zNCAzIDIuNjggMyAyIEMyLjAxIDIgMS4wMiAyIDAgMiBDMCAxLjM0IDAgMC42OCAwIDAgWiAiIGZpbGw9IiM2N0EyOEEiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNTMsNjQpIi8+CjxwYXRoIGQ9Ik0wIDAgQzAuOTkgMCAxLjk4IDAgMyAwIEMyLjY4NzUgMS44NzUgMi42ODc1IDEuODc1IDIgNCBDMS4wMSA0LjY2IDAuMDIgNS4zMiAtMSA2IEMtMS42MjUgNC4xMjUgLTEuNjI1IDQuMTI1IC0yIDIgQy0xLjM0IDEuMzQgLTAuNjggMC42OCAwIDAgWiAiIGZpbGw9IiMxNDcwNEIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzMjgsMTAxKSIvPgo8cGF0aCBkPSJNMCAwIEM0Ljc1IDEuODc1IDQuNzUgMS44NzUgNyAzIEM2LjY3IDMuOTkgNi4zNCA0Ljk4IDYgNiBDMy45NjE2NjU3NiA0LjcyNjA0MTEgMS45NjE0Nzg3NCAzLjM4OTM4MDc3IDAgMiBDMCAxLjM0IDAgMC42OCAwIDAgWiAiIGZpbGw9IiNFOEYxRUUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzOTQsOTMpIi8+CjxwYXRoIGQ9Ik0wIDAgQzEuOTggMCAzLjk2IDAgNiAwIEM2IDAuOTkgNiAxLjk4IDYgMyBDMy42OSAzIDEuMzggMyAtMSAzIEMtMC42NyAyLjAxIC0wLjM0IDEuMDIgMCAwIFogIiBmaWxsPSIjRjhGQkY5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyMDEyLDkwKSIvPgo8cGF0aCBkPSJNMCAwIEMwLjMzIDEuMzIgMC42NiAyLjY0IDEgNCBDMS42NiA0IDIuMzIgNCAzIDQgQzMuNjYgNS42NSA0LjMyIDcuMyA1IDkgQzMuMDYyNSA4LjYyNSAzLjA2MjUgOC42MjUgMSA4IEMtMC4zNTQzOTY2OCA1LjI5MTIwNjY1IC0wLjA2NTAxNDUxIDIuOTkwNjY3MzIgMCAwIFogIiBmaWxsPSIjRDRFNERFIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzY4LDc4KSIvPgo8cGF0aCBkPSJNMCAwIEMwLjk5IDAuMzMgMS45OCAwLjY2IDMgMSBDMi4zNCAzLjMxIDEuNjggNS42MiAxIDggQzAuMzQgOCAtMC4zMiA4IC0xIDggQy0xLjEyNSAyLjI1IC0xLjEyNSAyLjI1IDAgMCBaICIgZmlsbD0iI0VGRjVGMyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM3MCw3NCkiLz4KPHBhdGggZD0iTTAgMCBDMi4wMDcyMDkyMyAwLjI4Njc0NDE4IDQuMDA4NTk0NCAwLjYxODY2NzAxIDYgMSBDNiAxLjY2IDYgMi4zMiA2IDMgQzQuMzUgMyAyLjcgMyAxIDMgQzEgMy45OSAxIDQuOTggMSA2IEMwLjM0IDYgLTAuMzIgNiAtMSA2IEMtMS4wNDI3MjEgNC4zMzM4ODA5NSAtMS4wNDA2MzgzMiAyLjY2NjE3MTE1IC0xIDEgQy0wLjY3IDAuNjcgLTAuMzQgMC4zNCAwIDAgWiAiIGZpbGw9IiM3MkE5OTMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNjMsNjMpIi8+CjxwYXRoIGQ9Ik0wIDAgQzEuOTM3NSAwLjY4NzUgMS45Mzc1IDAuNjg3NSA0IDIgQzQuNzUgNC42MjUgNC43NSA0LjYyNSA1IDcgQzQuMzQgNyAzLjY4IDcgMyA3IEMwIDIuNjE1Mzg0NjIgMCAyLjYxNTM4NDYyIDAgMCBaICIgZmlsbD0iIzBDNkI0NSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTM1MSw5NykiLz4KPHBhdGggZD0iTTAgMCBDMS4zMiAwIDIuNjQgMCA0IDAgQzQgMC45OSA0IDEuOTggNCAzIEMyLjAyIDMuNjYgMC4wNCA0LjMyIC0yIDUgQy0xLjM0IDMuMzUgLTAuNjggMS43IDAgMCBaICIgZmlsbD0iI0U2RjBFQyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTMyNSw4MCkiLz4KPHBhdGggZD0iTTAgMCBDMS4zMiAwIDIuNjQgMCA0IDAgQzMuNjcgMS4zMiAzLjM0IDIuNjQgMyA0IEMyLjAxIDQgMS4wMiA0IDAgNCBDMCAyLjY4IDAgMS4zNiAwIDAgWiAiIGZpbGw9IiMwMDg0MjgiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIxNjksODcpIi8+CjxwYXRoIGQ9Ik0wIDAgQzAuOTkgMCAxLjk4IDAgMyAwIEMyLjM0IDEuMzIgMS42OCAyLjY0IDEgNCBDMC42NyAyLjY4IDAuMzQgMS4zNiAwIDAgWiAiIGZpbGw9IiMxRTcwQzEiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE2MTcsMTAyKSIvPgo8L3N2Zz4K" style="\n            width: 742.5px;\n            position: relative;\n            top: 107px;\n            left: 32px;\n            ">\n            <a href='+Bi+' style="\n        float: left;\n        border-radius: 56px;\n        background: #0D6EFD;\n        padding-top: 8px;\n        width: 280px;\n        height: 38px;\n        text-align: center;\n        position: relative;\n        top: 127px;\n        left: 274px;\n        font-size: 16px;\n        color: white;\n        text-decoration: none;\n        letter-spacing: 0.02em;\n    ">Claim your FREE account</a>\n            <div style="\n    font-size: 14px;\n    position: relative;\n    top: 180px;\n    left: 19px;\n    letter-spacing: 0.02em;\n    font-weight: 500;\n    line-height: 125%;\n">have a Syncfusion<sup>®</sup> account? <a href="https://www.syncfusion.com/account/login?ReturnUrl=/account/login" style="text-decoration: none;\ncolor: #0D6EFD;\nfont-weight: 500;">Sign In</a></div>\n        </div>\n    </div>'}),document.body.appendChild(e))}var ji,Wi,W=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Qi=0,Ui=0,qi=0,Gi=!0,Yi=!(ji=function(e,t){return(ji=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])}))(e,t)}),Xi=!1;(function(e,t){function i(){this.constructor=e}ji(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Zi,Ki=Ct),Zi.prototype.requiredModules=function(){return[]},Zi.prototype.destroy=function(){this.isDestroyed||(this.enablePersistence&&(this.setPersistData(),this.detachUnloadEvent()),this.localObserver.destroy(),this.refreshing)||(q([this.element],["e-control"]),this.trigger("destroyed",{cancel:!1}),Ki.prototype.destroy.call(this),this.moduleLoader.clean(),Ci.off("notifyExternalChange",this.detectFunction,this.randomId))},Zi.prototype.refresh=function(){this.refreshing=!0,this.moduleLoader.clean(),this.destroy(),this.clearChanges(),this.localObserver=new yt(this),this.preRender(),this.injectModules(),this.render(),this.refreshing=!1},Zi.prototype.accessMount=function(){this.mount&&!this.isReactHybrid&&this.mount()},Zi.prototype.getRootElement=function(){return this.isReactHybrid?this.actualElement:this.element},Zi.prototype.getLocalData=function(){var e=this.getModuleName()+this.element.id;return Xi?window.localStorage.getItem(e+this.ej2StatePersistenceVersion):window.localStorage.getItem(e)},Zi.prototype.attachUnloadEvent=function(){this.handleUnload=this.handleUnload.bind(this),window.addEventListener("pagehide",this.handleUnload)},Zi.prototype.handleUnload=function(){this.setPersistData()},Zi.prototype.detachUnloadEvent=function(){window.removeEventListener("pagehide",this.handleUnload)},Zi.prototype.appendTo=function(e){if(je(e)||"string"!=typeof e?je(e)||(this.element=e):this.element=ge(e,document),!je(this.element)){var e="e-"+this.getModuleName().toLowerCase(),e=(U([this.element],["e-control",e]),this.isProtectedOnChange=!1,this.needsID&&!this.element.id&&(this.element.id=this.getUniqueID(this.getModuleName())),this.enablePersistence&&(this.mergePersistData(),this.attachUnloadEvent()),R("ej2_instances",this.element)),t=(e&&-1!==e.indexOf(this)||Ki.prototype.addInstance.call(this),this.preRender(),this.injectModules(),{schedule:"all",diagram:"all",PdfViewer:"all",grid:["logger"],richtexteditor:["link","table","image","audio","video","formatPainter","emojiPicker","pasteCleanup","htmlEditor","toolbar","importExport"],treegrid:["filter"],gantt:["tooltip"],chart:["Export","Zoom"],accumulationchart:["Export"],"query-builder":"all"}),i=this.getModuleName();if(this.requiredModules&&(!t[""+i]||"all"!==t[""+i]))for(var e=this.requiredModules(),n=0,o=this.moduleLoader.getNonInjectedModules(e);n<o.length;n++){var r=o[n],s=r.name||r.member;t[""+i]&&-1!==t[""+i].indexOf(r.member)||(r=i.charAt(0).toUpperCase()+i.slice(1),console.warn('[WARNING] :: Module "'+s+'" is not available in '+r+" component! You either misspelled the module name or forgot to load it."))}Gi||Yi||(zi(),Yi=!0),this.render(),this.mount?this.accessMount():this.trigger("created")}},Zi.prototype.renderComplete=function(e){N&&window.sfBlazor.renderComplete(this.element,e),this.isRendered=!0},Zi.prototype.dataBind=function(){this.injectModules(),Ki.prototype.dataBind.call(this)},Zi.prototype.on=function(e,t,i){if("string"==typeof e)this.localObserver.on(e,t,i);else for(var n=0,o=e;n<o.length;n++){var r=o[n];this.localObserver.on(r.event,r.handler,r.context)}},Zi.prototype.off=function(e,t){if("string"==typeof e)this.localObserver.off(e,t);else for(var i=0,n=e;i<n.length;i++){var o=n[i];this.localObserver.off(o.event,o.handler)}},Zi.prototype.notify=function(e,t){!0!==this.isDestroyed&&this.localObserver.notify(e,t)},Zi.prototype.getInjectedModules=function(){return this.injectedModules},Zi.Inject=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.prototype.injectedModules||(this.prototype.injectedModules=[]);for(var i=0;i<e.length;i++)-1===this.prototype.injectedModules.indexOf(e[parseInt(i.toString(),10)])&&this.prototype.injectedModules.push(e[parseInt(i.toString(),10)])},Zi.prototype.createElement=function(e,t,i){return Q(e,t)},Zi.prototype.triggerStateChange=function(e,t){this.isReactHybrid&&(this.setState(),this.currentContext={calls:e,args:t})},Zi.prototype.injectModules=function(){this.injectedModules&&this.injectedModules.length&&this.moduleLoader.inject(this.requiredModules(),this.injectedModules)},Zi.prototype.detectFunction=function(e){var t=Object.keys(e);t.length&&(this[t[0]]=e[t[0]])},Zi.prototype.mergePersistData=function(){var e=Xi?window.localStorage.getItem(this.getModuleName()+this.element.id+this.ej2StatePersistenceVersion):window.localStorage.getItem(this.getModuleName()+this.element.id);je(e)||""===e||this.setProperties(JSON.parse(e),!0)},Zi.prototype.setPersistData=function(){this.isDestroyed||(Xi?window.localStorage.setItem(this.getModuleName()+this.element.id+this.ej2StatePersistenceVersion,this.getPersistData()):window.localStorage.setItem(this.getModuleName()+this.element.id,this.getPersistData()))},Zi.prototype.renderReactTemplates=function(e){je(e)||e()},Zi.prototype.clearTemplate=function(e,t){},Zi.prototype.getUniqueID=function(e){return this.isHistoryChanged()&&(Qi=0),Wi=this.pageID(location.href),Ui=history.length,e+"_"+Wi+"_"+Qi++},Zi.prototype.pageID=function(e){var t=0;if(0===e.length)return t;for(var i=0;i<e.length;i++){t=(t<<5)-t+e.charCodeAt(i);t&=t}return Math.abs(t)},Zi.prototype.isHistoryChanged=function(){return Wi!==this.pageID(location.href)||Ui!==history.length},Zi.prototype.addOnPersist=function(e){for(var i=this,t={},n=0,o=e;n<o.length;n++){var r=o[n],s=R(r,this);ee(s)||x(r,this.getActualProperties(s),t)}return JSON.stringify(t,function(e,t){return i.getActualProperties(t)})},Zi.prototype.getActualProperties=function(e){return e instanceof n?R("properties",e):e},Zi.prototype.ignoreOnPersist=function(e){return JSON.stringify(this.iterateJsonProperties(this.properties,e))},W([e(!(Zi.prototype.iterateJsonProperties=function(n,o){for(var r={},s=this,e=0,t=Object.keys(n);e<t.length;e++)!function(t){var e,i;-1===o.indexOf(t)&&("object"!=typeof(e=n[""+t])||e instanceof Array?r[""+t]=e:(i=o.filter(function(e){return new RegExp(t+".").test(e)}).map(function(e){return e.replace(t+".","")}),r[""+t]=s.iterateJsonProperties(s.getActualProperties(e),i)))}(t[e]);return r}))],Zi.prototype,"enablePersistence",void 0),W([e()],Zi.prototype,"enableRtl",void 0),W([e()],Zi.prototype,"locale",void 0);var Ki,Ji=W([Bt],Zi);function Zi(e,t){e=Ki.call(this,e,t)||this;return e.randomId=j(),e.isStringTemplate=!1,e.needsID=!1,e.isReactHybrid=!1,e.isAngular=!1,e.isReact=!1,e.isVue=!1,je(e.enableRtl)&&e.setProperties({enableRtl:Si},!0),je(e.locale)&&e.setProperties({locale:xi},!0),e.moduleLoader=new Xt(e),e.localObserver=new yt(e),Ci.on("notifyExternalChange",e.detectFunction,e,e.randomId),"undefined"==typeof window||"undefined"==typeof document||Hi()||-1!==Fi.indexOf(e.getModuleName())&&5<(qi+=1)&&(Gi=!1),ee(t)||e.appendTo(),e}"undefined"!=typeof window&&window.addEventListener("popstate",function(){Qi=0});var $i,en,W=function(e,t){function i(){this.constructor=e}$i(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},tn=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},nn={left:0,top:0,bottom:0,right:0},on={isDragged:!($i=function(e,t){return($i=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])}))(e,t)})},rn=(W(sn,en=n),tn([e(0)],sn.prototype,"left",void 0),tn([e(0)],sn.prototype,"top",void 0),sn);function sn(){return null!==en&&en.apply(this,arguments)||this}W(dn,an=Ct),(ln=dn).prototype.bind=function(){this.toggleEvents(),F.isIE&&U([this.element],"e-block-touch"),this.droppables[this.scope]={}},dn.getDefaultPosition=function(){return Pe({},nn)},dn.prototype.toggleEvents=function(e){ee(this.handle)||(t=ge(this.handle,this.element));var t,i=this.enableTapHold&&F.isDevice&&F.isTouch?this.mobileInitialize:this.initialize;e?E.remove(t||this.element,F.isSafari()?"touchstart":F.touchStartEvent,i):E.add(t||this.element,F.isSafari()?"touchstart":F.touchStartEvent,i,this)},dn.prototype.mobileInitialize=function(e){var t=this,i=e.currentTarget;this.tapHoldTimer=setTimeout(function(){t.externalInitialize=!0,t.removeTapholdTimer(),t.initialize(e,i)},this.tapHoldThreshold),E.add(document,F.isSafari()?"touchmove":F.touchMoveEvent,this.removeTapholdTimer,this),E.add(document,F.isSafari()?"touchend":F.touchEndEvent,this.removeTapholdTimer,this)},dn.prototype.removeTapholdTimer=function(){clearTimeout(this.tapHoldTimer),E.remove(document,F.isSafari()?"touchmove":F.touchMoveEvent,this.removeTapholdTimer),E.remove(document,F.isSafari()?"touchend":F.touchEndEvent,this.removeTapholdTimer)},dn.prototype.getScrollableParent=function(e,t){return je(e)?null:e[{vertical:"scrollHeight",horizontal:"scrollWidth"}[""+t]]>e[{vertical:"clientHeight",horizontal:"clientWidth"}[""+t]]&&("vertical"===t?0<e.scrollTop:0<e.scrollLeft)&&("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),je(e))?e:this.getScrollableParent(e.parentNode,t)},dn.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")},dn.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 i=this.abort;"string"==typeof i&&(i=[i]);for(var n=0;n<i.length;n++)if(!je(z(e.target,i[parseInt(n.toString(),10)])))return void(this.isDragStarted()&&this.isDragStarted(!0))}this.preventDefault&&!ee(e.changedTouches)&&"touchstart"!==e.type&&e.preventDefault(),this.element.setAttribute("aria-grabbed","true");var o,t=this.getCoordinates(e);this.initialPosition={x:t.pageX,y:t.pageY},this.clone||(o=this.element.getBoundingClientRect(),this.getScrollableValues(),e.clientX===e.pageX&&(this.parentScrollX=0),e.clientY===e.pageY&&(this.parentScrollY=0),this.relativeXPosition=t.pageX-(o.left+this.parentScrollX),this.relativeYPosition=t.pageY-(o.top+this.parentScrollY)),this.externalInitialize?this.intDragStart(e):(E.add(document,F.isSafari()?"touchmove":F.touchMoveEvent,this.intDragStart,this),E.add(document,F.isSafari()?"touchend":F.touchEndEvent,this.intDestroy,this)),this.toggleEvents(!0),"touchstart"!==e.type&&this.isPreventSelect&&document.body.classList.add("e-prevent-select"),this.externalInitialize=!1,E.trigger(document.documentElement,F.isSafari()?"touchstart":F.touchStartEvent,e)}},dn.prototype.intDragStart=function(e){this.removeTapholdTimer();var t,i,n,o=!ee(e.changedTouches);o&&1!==e.changedTouches.length||(i=this.getCoordinates(e),n=getComputedStyle(this.element),this.margin={left:parseInt(n.marginLeft,10),top:parseInt(n.marginTop,10),right:parseInt(n.marginRight,10),bottom:parseInt(n.marginBottom,10)},n=this.element,this.clone&&this.dragTarget&&(je(t=z(e.target,this.dragTarget))||(n=t)),this.isReplaceDragEle&&(n=this.currentStateCheck(e.target,n)),this.offset=this.calculateParentPosition(n),this.position=this.getMousePosition(e,this.isDragScroll),t=this.initialPosition.x-i.pageX,i=this.initialPosition.y-i.pageY,!(Math.sqrt(t*t+i*i)>=this.distance||this.externalInitialize))||!(t=this.getHelperElement(e))||je(t)||(o&&e.preventDefault(),i=this.helperElement=t,this.parentClientRect=this.calculateParentPosition(i.offsetParent),this.dragStart&&(o={event:e,element:n,target:this.getProperTargetElement(e),bindEvents:N?this.bindDragEvents.bind(this):null,dragElement:i},this.trigger("dragStart",o)),this.dragArea?this.setDragArea():(this.dragLimit={left:0,right:0,bottom:0,top:0},this.borderWidth={top:0,left:0}),t={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(),e=getComputedStyle(n),o=parseFloat(e.marginTop),this.clone&&0!==o&&(t.top+=o),this.eleTop=isNaN(parseFloat(e.top))?0:parseFloat(e.top)-this.offset.top,this.enableScrollHandler&&!this.clone&&(t.top-=this.parentScrollY,t.left-=this.parentScrollX),n=this.getProcessedPositionValue({top:t.top-this.diffY+"px",left:t.left-this.diffX+"px"}),this.dragArea&&"string"!=typeof this.dragArea&&this.dragArea.classList.contains("e-kanban-content")&&"relative"===this.dragArea.style.position&&(t.top+=this.dragArea.scrollTop),this.dragElePosition={top:t.top,left:t.left},gt(i,this.getDragPosition({position:"absolute",left:n.left,top:n.top})),E.remove(document,F.isSafari()?"touchmove":F.touchMoveEvent,this.intDragStart),E.remove(document,F.isSafari()?"touchend":F.touchEndEvent,this.intDestroy),N)||this.bindDragEvents(i)},dn.prototype.bindDragEvents=function(e){at(e)?(E.add(document,F.isSafari()?"touchmove":F.touchMoveEvent,this.intDrag,this),E.add(document,F.isSafari()?"touchend":F.touchEndEvent,this.intDragStop,this),this.setGlobalDroppables(!1,this.element,e)):(this.toggleEvents(),document.body.classList.remove("e-prevent-select"))},dn.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},dn.prototype.getProcessedPositionValue=function(e){return this.queryPositionInfo?this.queryPositionInfo(e):e},dn.prototype.calculateParentPosition=function(e){var t;return je(e)?{left:0,top:0}:(t=e.getBoundingClientRect(),e=getComputedStyle(e),{left:t.left+window.pageXOffset-parseInt(e.marginLeft,10),top:t.top+window.pageYOffset-parseInt(e.marginTop,10)})},dn.prototype.intDrag=function(e){var t,i,n,o,r,s,a,l,h,d,p,c;!ee(e.changedTouches)&&1!==e.changedTouches.length||(this.clone&&e.changedTouches&&F.isDevice&&F.isTouch&&e.preventDefault(),this.position=this.getMousePosition(e,this.isDragScroll),(a=this.getDocumentWidthHeight("Height"))<this.position.top&&(this.position.top=a),(a=this.getDocumentWidthHeight("Width"))<this.position.left&&(this.position.left=a),this.drag&&(a=this.getProperTargetElement(e),this.trigger("drag",{event:e,element:this.element,target:a})),(a=this.checkTargetElement(e)).target&&a.instance?(t=!0,this.hoverObject&&(this.hoverObject.instance!==a.instance?this.triggerOutFunction(e,a):t=!1),t&&(a.instance.dragData[this.scope]=this.droppables[this.scope],a.instance.intOver(e,a.target),this.hoverObject=a)):this.hoverObject&&this.triggerOutFunction(e,a),t=this.droppables[this.scope].helper,this.parentClientRect=this.calculateParentPosition(this.helperElement.offsetParent),a=this.parentClientRect.left,d=this.parentClientRect.top,i=(n=this.getCoordinates(e)).pageX,n=n.pageY,p=this.position.left-this.diffX,c=this.position.top-this.diffY,o=getComputedStyle(t),this.dragArea?(this.enableAutoScroll&&this.setDragArea(),this.pageX===i&&!this.skipDistanceCheck||(r=t.offsetWidth+(parseFloat(o.marginLeft)+parseFloat(o.marginRight)),r=this.dragLimit.left>p&&0<p?this.dragLimit.left:this.dragLimit.right+window.pageXOffset<p+r&&0<p?p-(p-this.dragLimit.right)+window.pageXOffset-r:p<0?this.dragLimit.left:p),this.pageY===n&&!this.skipDistanceCheck||(l=t.offsetHeight+(parseFloat(o.marginTop)+parseFloat(o.marginBottom)),s=this.dragLimit.top>c&&0<c?this.dragLimit.top:this.dragLimit.bottom+window.pageYOffset<c+l&&0<c?c-(c-this.dragLimit.bottom)+window.pageYOffset-l:c<0?this.dragLimit.top:c)):(r=p,s=c),p=d+this.borderWidth.top,d=a+this.borderWidth.left,this.dragProcessStarted&&(je(s)&&(s=this.prevTop),je(r))&&(r=this.prevLeft),a=this.helperElement.classList.contains("e-treeview")?this.dragArea?(this.dragLimit.top=this.clone?this.dragLimit.top:0,h=s-p<0?this.dragLimit.top:s-this.borderWidth.top,r-d<0?this.dragLimit.left:r-this.borderWidth.left):(h=s-this.borderWidth.top,r-this.borderWidth.left):this.dragArea?(a=this.helperElement.classList.contains("e-dialog"),this.dragLimit.top=this.clone?this.dragLimit.top:0,h=s-p<0?this.dragLimit.top:s-p,r-d<0?a?r-(d-this.borderWidth.left):this.dragElePosition.left:r-d):(h=s-p,r-d),0<(d=parseFloat(getComputedStyle(this.element).marginTop))&&(this.clone&&(h+=d,c<0&&(0<=d+c?h=d+c:h-=d),this.dragArea)&&(h=this.dragLimit.bottom<h?this.dragLimit.bottom:h),s-p<0)&&(!(0<=c+d+(t.offsetHeight-p))||(c=this.dragLimit.top+c-p)+d+p<0?h-=d+p:h=c),this.dragArea&&this.helperElement.classList.contains("e-treeview")&&(h=h+(l=t.offsetHeight+(parseFloat(o.marginTop)+parseFloat(o.marginBottom)))>this.dragLimit.bottom?this.dragLimit.bottom-l:h),this.enableScrollHandler&&!this.clone&&(h-=this.parentScrollY,a-=this.parentScrollX),this.dragArea&&"string"!=typeof this.dragArea&&this.dragArea.classList.contains("e-kanban-content")&&"relative"===this.dragArea.style.position&&(h+=this.dragArea.scrollTop),d=this.getProcessedPositionValue({top:h+"px",left:a+"px"}),this.isPreventScroll&&(d=this.getProcessedPositionValue({top:this.position.top-this.parentClientRect.top-2+"px",left:this.position.left-this.parentClientRect.left-2+"px"})),gt(t,this.getDragPosition(d)),this.elementInViewport(t)||!this.enableAutoScroll||this.helperElement.classList.contains("e-treeview")||this.helperElement.scrollIntoView(),p=document.querySelectorAll(":hover"),this.enableAutoScroll&&this.helperElement.classList.contains("e-treeview")&&(0===p.length&&(p=this.getPathElements(e)),c=this.getScrollParent(p,!1),this.elementInViewport(this.helperElement)?this.getScrollPosition(c,h):this.elementInViewport(this.helperElement)||(0===(p=[].slice.call(document.querySelectorAll(":hover"))).length&&(p=this.getPathElements(e)),c=this.getScrollParent(p,!0),this.getScrollPosition(c,h))),this.dragProcessStarted=!0,this.prevLeft=r,this.prevTop=s,this.position.left=r,this.position.top=s,this.pageX=i,this.pageY=n)},dn.prototype.getScrollParent=function(e,t){for(var i,n=t?e.reverse():e,o=n.length-1;0<=o;o--)if(("auto"===(i=window.getComputedStyle(n[parseInt(o.toString(),10)])["overflow-y"])||"scroll"===i)&&n[parseInt(o.toString(),10)].scrollHeight>n[parseInt(o.toString(),10)].clientHeight)return n[parseInt(o.toString(),10)];if("visible"===(i=window.getComputedStyle(document.scrollingElement)["overflow-y"]))return document.scrollingElement.style.overflow="auto",document.scrollingElement},dn.prototype.getScrollPosition=function(e,t){var i,n;e&&e===document.scrollingElement?e.clientHeight+document.scrollingElement.scrollTop-this.helperElement.clientHeight<t&&e.getBoundingClientRect().height+this.parentClientRect.top>t?e.scrollTop+=this.helperElement.clientHeight:e.scrollTop>t-this.helperElement.clientHeight&&(e.scrollTop-=this.helperElement.clientHeight):e&&e!==document.scrollingElement&&(i=document.scrollingElement.scrollTop,n=this.helperElement.clientHeight,e.clientHeight+e.getBoundingClientRect().top-n+i<t?e.scrollTop+=this.helperElement.clientHeight:e.getBoundingClientRect().top>t-n-i&&(e.scrollTop-=this.helperElement.clientHeight))},dn.prototype.getPathElements=function(e){var t=0<e.clientX?e.clientX:0,e=0<e.clientY?e.clientY:0;return document.elementsFromPoint(t,e)},dn.prototype.triggerOutFunction=function(e,t){this.hoverObject.instance.intOut(e,t.target),this.hoverObject.instance.dragData[this.scope]=null,this.hoverObject=null},dn.prototype.getDragPosition=function(e){e=Pe({},e);return this.axis&&("x"===this.axis?delete e.top:"y"===this.axis&&delete e.left),e},dn.prototype.getDocumentWidthHeight=function(e){var t=document.body,i=document.documentElement;return Math.max(t["scroll"+e],i["scroll"+e],t["offset"+e],i["offset"+e],i["client"+e])},dn.prototype.intDragStop=function(e){var t;this.dragProcessStarted=!1,!ee(e.changedTouches)&&1!==e.changedTouches.length||(-1!==["touchend","pointerup","mouseup"].indexOf(e.type)?(this.dragStop&&(t=this.getProperTargetElement(e),this.trigger("dragStop",{event:e,element:this.element,target:t,helper:this.helperElement})),this.intDestroy(e)):this.element.setAttribute("aria-grabbed","false"),(t=this.checkTargetElement(e)).target&&t.instance&&(t.instance.dragStopCalled=!0,t.instance.dragData[this.scope]=this.droppables[this.scope],t.instance.intDrop(e,t.target)),this.setGlobalDroppables(!0),document.body.classList.remove("e-prevent-select"))},dn.prototype.intDestroy=function(e){this.dragProcessStarted=!1,this.toggleEvents(),document.body.classList.remove("e-prevent-select"),this.element.setAttribute("aria-grabbed","false"),E.remove(document,F.isSafari()?"touchmove":F.touchMoveEvent,this.intDragStart),E.remove(document,F.isSafari()?"touchend":F.touchEndEvent,this.intDragStop),E.remove(document,F.isSafari()?"touchend":F.touchEndEvent,this.intDestroy),E.remove(document,F.isSafari()?"touchmove":F.touchMoveEvent,this.intDrag),this.isDragStarted()&&this.isDragStarted(!0)},dn.prototype.onPropertyChanged=function(e,t){},dn.prototype.getModuleName=function(){return"draggable"},dn.prototype.isDragStarted=function(e){return e&&(on.isDragged=!on.isDragged),on.isDragged},dn.prototype.setDragArea=function(){var e=0,t="string"==typeof this.dragArea?ge(this.dragArea):this.dragArea;if(t){for(var i=t.getBoundingClientRect(),n=t.scrollWidth||i.right-i.left,o=t.scrollHeight?this.dragArea&&!je(this.helperElement)&&this.helperElement.classList.contains("e-treeview")?t.clientHeight:t.scrollHeight:i.bottom-i.top,r=["Top","Left","Bottom","Right"],s=getComputedStyle(t),a=0;a<r.length;a++){var l=r[parseInt(a.toString(),10)],h=s["border"+l+"Width"],d=s["padding"+l],l=l.toLowerCase();this.borderWidth[""+l]=isNaN(parseFloat(h))?0:parseFloat(h),this.padding[""+l]=isNaN(parseFloat(d))?0:parseFloat(d)}e=this.dragArea&&!je(this.helperElement)&&this.helperElement.classList.contains("e-treeview")?i.top+document.scrollingElement.scrollTop:i.top,i=i.left,this.dragLimit.left=i+this.borderWidth.left+this.padding.left,this.dragLimit.top=t.offsetTop+this.borderWidth.top+this.padding.top,this.dragLimit.right=i+n-(this.borderWidth.right+this.padding.right),this.dragLimit.bottom=e+o-(this.borderWidth.bottom+this.padding.bottom)}},dn.prototype.getProperTargetElement=function(e){var t,i=this.getCoordinates(e),n=this.helperElement.style.pointerEvents||"",o=-1!==e.type.indexOf("pointer")&&"safari"===F.info.name&&12<parseInt(F.info.version,10);return L(e.target,this.helperElement)||-1!==e.type.indexOf("touch")||o?(this.helperElement.style.pointerEvents="none",t=document.elementFromPoint(i.clientX,i.clientY),this.helperElement.style.pointerEvents=n):t=e.target,t},dn.prototype.currentStateCheck=function(e,t){e=je(this.currentStateTarget)||this.currentStateTarget===e?je(t)?e:t:this.currentStateTarget;return e},dn.prototype.getMousePosition=function(e,t){var i,n=void 0!==e.srcElement?e.srcElement:e.target,e=this.getCoordinates(e),o=je(n.offsetParent);return o=t?(i=this.clone?e.pageX:e.pageX+(o?0:n.offsetParent.scrollLeft)-this.relativeXPosition,this.clone?e.pageY:e.pageY+(o?0:n.offsetParent.scrollTop)-this.relativeYPosition):(i=this.clone?e.pageX:e.pageX+window.pageXOffset-this.relativeXPosition,this.clone?e.pageY:e.pageY+window.pageYOffset-this.relativeYPosition),!document.scrollingElement||t||this.clone||(e=0<(n=document.scrollingElement).scrollHeight&&n.scrollHeight>n.clientHeight&&0<n.scrollTop,i=0<n.scrollWidth&&n.scrollWidth>n.clientWidth&&0<n.scrollLeft?i-n.scrollLeft:i,o=e?o-n.scrollTop:o),{left:i-(this.margin.left+this.cursorAt.left),top:o-(this.margin.top+this.cursorAt.top)}},dn.prototype.getCoordinates=function(e){return-1<e.type.indexOf("touch")?e.changedTouches[0]:e},dn.prototype.getHelperElement=function(e){var t;return this.clone?this.helper?t=this.helper({sender:e,element:this.target,currentTargetElement:this.currentStateTarget}):(t=Q("div",{className:"e-drag-helper e-block-touch",innerHTML:"Draggable"}),document.body.appendChild(t)):t=this.element,t},dn.prototype.setGlobalDroppables=function(e,t,i){this.droppables[this.scope]=e?null:{draggable:t,helper:i,draggedElement:this.element}},dn.prototype.checkTargetElement=function(e){var t,e=this.getProperTargetElement(e),i=this.getDropInstance(e);return i||!e||je(e.parentNode)||(t=z(e.parentNode,".e-droppable")||e.parentElement)&&(i=this.getDropInstance(t)),{target:e,instance:i}},dn.prototype.getDropInstance=function(e){var t,e=e&&e.ej2_instances;if(e)for(var i=0,n=e;i<n.length;i++){var o=n[i];if("droppable"===o.getModuleName()){t=o;break}}return t},dn.prototype.destroy=function(){this.toggleEvents(!0),an.prototype.destroy.call(this)},tn([t({},rn)],dn.prototype,"cursorAt",void 0),tn([e(!0)],dn.prototype,"clone",void 0),tn([e()],dn.prototype,"dragArea",void 0),tn([e()],dn.prototype,"isDragScroll",void 0),tn([e()],dn.prototype,"isReplaceDragEle",void 0),tn([e(!0)],dn.prototype,"isPreventSelect",void 0),tn([e(!1)],dn.prototype,"isPreventScroll",void 0),tn([i()],dn.prototype,"drag",void 0),tn([i()],dn.prototype,"dragStart",void 0),tn([i()],dn.prototype,"dragStop",void 0),tn([e(1)],dn.prototype,"distance",void 0),tn([e()],dn.prototype,"handle",void 0),tn([e()],dn.prototype,"abort",void 0),tn([e()],dn.prototype,"helper",void 0),tn([e("default")],dn.prototype,"scope",void 0),tn([e("")],dn.prototype,"dragTarget",void 0),tn([e()],dn.prototype,"axis",void 0),tn([e()],dn.prototype,"queryPositionInfo",void 0),tn([e(!1)],dn.prototype,"enableTailMode",void 0),tn([e(!1)],dn.prototype,"skipDistanceCheck",void 0),tn([e(!0)],dn.prototype,"preventDefault",void 0),tn([e(!1)],dn.prototype,"enableAutoScroll",void 0),tn([e(!1)],dn.prototype,"enableTapHold",void 0),tn([e(750)],dn.prototype,"tapHoldThreshold",void 0),tn([e(!1)],dn.prototype,"enableScrollHandler",void 0);var an,ln,hn=ln=tn([Bt],dn);function dn(e,t){t=an.call(this,t,e)||this;return t.dragLimit=ln.getDefaultPosition(),t.borderWidth=ln.getDefaultPosition(),t.padding=ln.getDefaultPosition(),t.diffX=0,t.prevLeft=0,t.prevTop=0,t.dragProcessStarted=!1,t.eleTop=0,t.tapHoldTimer=0,t.externalInitialize=!1,t.diffY=0,t.parentScrollX=0,t.parentScrollY=0,t.droppables={},t.bind(),t}pn=function(e,t){return(pn=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])}))(e,t)};var pn,cn,W=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},un=(function(e,t){function i(){this.constructor=e}pn(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(gn,cn=Ct),gn.prototype.bind=function(){this.wireEvents()},gn.prototype.wireEvents=function(){E.add(this.element,F.isSafari()?"touchend":F.touchEndEvent,this.intDrop,this)},gn.prototype.onPropertyChanged=function(e,t){},gn.prototype.getModuleName=function(){return"droppable"},gn.prototype.intOver=function(e,t){var i;this.mouseOver||(i=this.dragData[this.scope],this.trigger("over",{event:e,target:t,dragData:i}),this.mouseOver=!0)},gn.prototype.intOut=function(e,t){this.mouseOver&&(this.trigger("out",{evt:e,target:t}),this.mouseOver=!1)},gn.prototype.intDrop=function(e,t){var i,n,o,r;this.dragStopCalled&&(i=!(this.dragStopCalled=!1),(o=!!(n=this.dragData[this.scope])&&n.helper&&at(n.helper))&&(r=this.isDropArea(e,n.helper,t),this.accept)&&(i=ft(n.helper,this.accept)),o&&this.drop&&r.canDrop&&i&&this.trigger("drop",{event:e,target:r.target,droppedElement:n.helper,dragData:n}),this.mouseOver=!1)},gn.prototype.isDropArea=function(e,t,i){var i={canDrop:!0,target:i||e.target},n="touchend"===e.type;return!n&&i.target!==t||(t.style.display="none",n=n?e.changedTouches[0]:e,e=document.elementFromPoint(n.clientX,n.clientY),i.canDrop=!1,i.canDrop=L(e,this.element),i.canDrop&&(i.target=e),t.style.display=""),i},gn.prototype.destroy=function(){E.remove(this.element,F.isSafari()?"touchend":F.touchEndEvent,this.intDrop),cn.prototype.destroy.call(this)},W([e()],gn.prototype,"accept",void 0),W([e("default")],gn.prototype,"scope",void 0),W([i()],gn.prototype,"drop",void 0),W([i()],gn.prototype,"over",void 0),W([i()],gn.prototype,"out",void 0),W([Bt],gn));function gn(e,t){t=cn.call(this,t,e)||this;return t.mouseOver=!1,t.dragData={},t.dragStopCalled=!1,t.bind(),t}mn=function(e,t){return(mn=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])}))(e,t)};var mn,fn,yn,tn=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},vn={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},bn=(function(e,t){function i(){this.constructor=e}mn(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(wn,fn=Ct),(yn=wn).prototype.destroy=function(){this.unwireEvents(),fn.prototype.destroy.call(this)},wn.prototype.onPropertyChanged=function(e,t){},wn.prototype.bind=function(){this.wireEvents()},wn.prototype.getModuleName=function(){return"keyboard"},wn.prototype.wireEvents=function(){this.element.addEventListener(this.eventName,this.keyPressHandler)},wn.prototype.unwireEvents=function(){this.element.removeEventListener(this.eventName,this.keyPressHandler)},wn.getKeyConfigData=function(e){var t,i;return e in this.configCache?this.configCache[""+e]:(i={altKey:-1!==(t=e.toLowerCase().split("+")).indexOf("alt"),ctrlKey:-1!==t.indexOf("ctrl"),shiftKey:-1!==t.indexOf("shift"),keyCode:null},1<t[t.length-1].length&&Number(t[t.length-1])?i.keyCode=Number(t[t.length-1]):i.keyCode=yn.getKeyCode(t[t.length-1]),yn.configCache[""+e]=i)},wn.getKeyCode=function(e){return vn[""+e]||e.toUpperCase().charCodeAt(0)},wn.configCache={},tn([e({})],wn.prototype,"keyConfigs",void 0),tn([e("keyup")],wn.prototype,"eventName",void 0),tn([i()],wn.prototype,"keyAction",void 0),yn=tn([Bt],wn));function wn(e,t){var p=fn.call(this,t,e)||this;return p.keyPressHandler=function(e){for(var t=e.altKey,i=e.ctrlKey,n=e.shiftKey,o=e.which,r=0,s=Object.keys(p.keyConfigs);r<s.length;r++)for(var a=s[r],l=0,h=p.keyConfigs[""+a].split(",");l<h.length;l++){var d=h[l],d=yn.getKeyConfigData(d.trim());t===d.altKey&&i===d.ctrlKey&&n===d.shiftKey&&o===d.keyCode&&(e.action=a,p.keyAction)&&p.keyAction(e)}},p.bind(),p}Sn.prototype.setLocale=function(e){e=this.intGetControlConstant(Sn.locale,e);this.currentLocale=e||this.localeStrings},Sn.load=function(e){this.locale=Pe(this.locale,e,{},!0)},Sn.prototype.getConstant=function(e){return je(this.currentLocale[""+e])?this.localeStrings[""+e]||"":this.currentLocale[""+e]},Sn.prototype.intGetControlConstant=function(e,t){return e[""+t]?e[""+t][this.controlName]:null},Sn.locale={};var Cn=Sn;function Sn(e,t,i){this.controlName=e,this.localeStrings=t,this.setLocale(i||xi)}An=function(e,t){return(An=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])}))(e,t)};var An,xn,W=function(e,t){function i(){this.constructor=e}An(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},tn=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},In=(W(Tn,xn=n),tn([e(50)],Tn.prototype,"swipeThresholdDistance",void 0),Tn);function Tn(){return null!==xn&&xn.apply(this,arguments)||this}var En,Dn=/(Up|Down)/,Mn=(W(kn,En=Ct),kn.prototype.onPropertyChanged=function(e,t){},kn.prototype.bind=function(){this.wireEvents(),F.isIE&&this.element.classList.add("e-block-touch")},kn.prototype.destroy=function(){this.unwireEvents(),En.prototype.destroy.call(this)},kn.prototype.wireEvents=function(){E.add(this.element,F.touchStartEvent,this.startEvent,this)},kn.prototype.unwireEvents=function(){E.remove(this.element,F.touchStartEvent,this.startEvent)},kn.prototype.getModuleName=function(){return"touch"},kn.prototype.isScrollable=function(e){e=getComputedStyle(e),e=e.overflow+e.overflowX+e.overflowY;return!!/(auto|scroll)/.test(e)},kn.prototype.tapHoldEvent=function(e){this.tapCount=0,this.touchAction=!0,E.remove(this.element,F.touchMoveEvent,this.moveEvent),E.remove(this.element,F.touchEndEvent,this.endEvent),this.trigger("tapHold",{originalEvent:e}),E.remove(this.element,F.touchCancelEvent,this.cancelEvent)},kn.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"},kn.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)},kn.prototype.getVelocity=function(e){var t=e.clientX,e=e.clientY,i=Date.now(),t=t-this.startPoint.clientX,e=e-this.startPoint.clientX,i=i-this.tStampStart;return Math.sqrt(t*t+e*e)/i},kn.prototype.checkSwipe=function(e,t){var i=["scroll","offset"],t=t?["Height","Top"]:["Width","Left"];return e[i[0]+t[0]]<=e[i[1]+t[0]]||0===e[i[0]+t[1]]||e[i[1]+t[0]]+e[i[0]+t[1]]>=e[i[0]+t[0]]},kn.prototype.updateChangeTouches=function(e){return e.changedTouches&&0!==e.changedTouches.length?e.changedTouches[0]:e},tn([i()],kn.prototype,"tap",void 0),tn([i()],kn.prototype,"tapHold",void 0),tn([i()],kn.prototype,"swipe",void 0),tn([i()],kn.prototype,"scroll",void 0),tn([e(350)],kn.prototype,"tapThreshold",void 0),tn([e(750)],kn.prototype,"tapHoldThreshold",void 0),tn([t({},In)],kn.prototype,"swipeSettings",void 0),tn([Bt],kn));function kn(e,t){var s=En.call(this,t,e)||this;return s.touchAction=!0,s.tapCount=0,s.startEvent=function(e){var t;!0===s.touchAction&&(t=s.updateChangeTouches(e),void 0!==e.changedTouches&&(s.touchAction=!1),s.isTouchMoved=!1,s.movedDirection="",s.startPoint=s.lastMovedPoint={clientX:t.clientX,clientY:t.clientY},s.startEventData=t,s.hScrollLocked=s.vScrollLocked=!1,s.tStampStart=Date.now(),s.timeOutTapHold=setTimeout(function(){s.tapHoldEvent(e)},s.tapHoldThreshold),E.add(s.element,F.touchMoveEvent,s.moveEvent,s),E.add(s.element,F.touchEndEvent,s.endEvent,s),E.add(s.element,F.touchCancelEvent,s.cancelEvent,s))},s.moveEvent=function(e){var t=s.updateChangeTouches(e),i=(s.movedPoint=t,s.isTouchMoved=!(t.clientX===s.startPoint.clientX&&t.clientY===s.startPoint.clientY),{});s.isTouchMoved&&(clearTimeout(s.timeOutTapHold),s.calcScrollPoints(e),i=Pe(i,{},{startEvents:s.startEventData,originalEvent:e,startX:s.startPoint.clientX,startY:s.startPoint.clientY,distanceX:s.distanceX,distanceY:s.distanceY,scrollDirection:s.scrollDirection,velocity:s.getVelocity(t)}),s.trigger("scroll",i),s.lastMovedPoint={clientX:t.clientX,clientY:t.clientY})},s.cancelEvent=function(e){clearTimeout(s.timeOutTapHold),clearTimeout(s.timeOutTap),s.tapCount=0,s.swipeFn(e),E.remove(s.element,F.touchCancelEvent,s.cancelEvent)},s.endEvent=function(e){s.swipeFn(e),s.isTouchMoved||"function"==typeof s.tap&&(s.trigger("tap",{originalEvent:e,tapCount:++s.tapCount}),s.timeOutTap=setTimeout(function(){s.tapCount=0},s.tapThreshold)),s.modeclear()},s.swipeFn=function(e){clearTimeout(s.timeOutTapHold),clearTimeout(s.timeOutTap);var t=s.updateChangeTouches(e),i=t.clientX-s.startPoint.clientX,n=t.clientY-s.startPoint.clientY,i=Math.floor(i<0?-1*i:i),n=Math.floor(n<0?-1*n:i);s.isTouchMoved=1<i||1<n;/Firefox/.test(F.userAgent)&&0===t.clientX&&0===t.clientY&&"mouseup"===e.type&&(s.isTouchMoved=!1),s.endPoint=t,s.calcPoints(e);var o,r,i={originalEvent:e,startEvents:s.startEventData,startX:s.startPoint.clientX,startY:s.startPoint.clientY,distanceX:s.distanceX,distanceY:s.distanceY,swipeDirection:s.movedDirection,velocity:s.getVelocity(t)};s.isTouchMoved&&(n=s.swipeSettings.swipeThresholdDistance,e=Pe(void 0,s.defaultArgs,i),t=!1,i=s.element,o=s.isScrollable(i),r=Dn.test(s.movedDirection),t=n<s.distanceX&&!r||n<s.distanceY&&r?!o||s.checkSwipe(i,r):t)&&s.trigger("swipe",e),s.modeclear()},s.modeclear=function(){s.modeClear=setTimeout(function(){s.touchAction=!0},"function"!=typeof s.tap?0:20),s.lastTapTime=(new Date).getTime(),E.remove(s.element,F.touchMoveEvent,s.moveEvent),E.remove(s.element,F.touchEndEvent,s.endEvent),E.remove(s.element,F.touchCancelEvent,s.cancelEvent)},s.bind(),s}var Pn=new RegExp("\\n|\\r|\\s\\s+","g"),Bn=new RegExp(/'|"/g),Fn=new RegExp("if ?\\("),Ln=new RegExp("else if ?\\("),Rn=new RegExp("else"),On=new RegExp("for ?\\("),Nn=new RegExp("(/if|/for)"),Vn=new RegExp("\\((.*)\\)",""),_n=new RegExp("^[0-9]+$","g"),Hn=new RegExp("[\\w\"'.\\s+]+","g"),zn=new RegExp('"(.*?)"',"g"),jn=new RegExp("[\\w\"'@#$.\\s-+]+","g"),Wn=new RegExp("\\${([^}]*)}","g"),Qn=/^\..*/gm,Un=/\\/gi,qn=/\\\\/gi,Gn=new RegExp("[\\w\"'@#$.\\s+]+","g"),Yn=/\window\./gm;function Xn(e,t,i){return"function"==typeof e?e:(e=function(t,h,d,p){var c=0,u=[],e=t.match(/class="([^"]+|)\s{2}/g),i="";e&&e.forEach(function(e){i=e.replace(/\s\s+/g," "),t=t.replace(e,i)});if(Wn.test(t)){for(var n=!1,o="",r=0;r<t.length;r++)"$"===t[r+""]&&"{"===t[r+1]?n=!0:"}"===t[r+""]&&(n=!1),o+='"'!==t[r+""]||n?t[r+""]:'\\"';t=o}else t=t.replace(/\\?"/g,'\\"');return t.replace(Pn,"").replace(zn,"'$1'").replace(Wn,function(e,t,i,n){var o,r,s,a,l=t.match(Vn);return l?(o=l[1],Ln.test(t)?t='";} '+t.replace(l[1],o.replace(Hn,function(e){return Kn(e=e.trim(),!Bn.test(e)&&-1===u.indexOf(e),h,u,p)}))+'{ \n str = str + "':Fn.test(t)?t='"; '+t.replace(l[1],o.replace(jn,function(e){return $n(e,h,u,p)}))+'{ \n str = str + "':On.test(t)?(r=l[1].split(" of "),t='"; '+t.replace(l[1],function(e){return u.push(r[0]),u.push(r[0]+"Index"),"var i"+(c+=1)+"=0; i"+c+" < "+Kn(r[1],!0,h,u,p)+".length; i"+c+"++"})+"{ \n "+r[0]+"= "+Kn(r[1],!0,h,u,p)+"[i"+c+"]; \n var "+r[0]+"Index=i"+c+'; \n str = str + "'):(a=t.split("("),s=d&&Object.prototype.hasOwnProperty.call(d,a[0])?"this.":"global",s=/\./.test(a[0])?"":s,a=l[1].split(","),0===l[1].length||/data/.test(a[0])||/window./.test(a[0])||(l[1]="global"==s?h+"."+l[1]:l[1]),Yn.test(t)&&/\]\./gm.test(t)||/@|\$|#/gm.test(t)?/@|\$|#|\]\./gm.test(t)&&(t='"+ '+("global"==s?"":s)+t.replace(l[1],o.replace(Gn,function(e){return $n(e,h,u,p)}))+'+ "'):t='" + '+("global"==s?"":s)+t.replace(o,Kn(l[1].replace(/,( |)data.|,/gi,","+h+".").replace(/,( |)data.window/gi,",window"),"global"!=s,h,u,p))+'+"')):t=Rn.test(t)?'"; '+t.replace(Rn,'} else { \n str = str + "'):t.match(Nn)?t.replace(Nn,'"; \n } \n str = str + "'):/@|#|\$/gm.test(t)?'"+'+Jn(t=t.match(Un)?Zn(t):t,-1===u.indexOf(t),h,u)+'"]+"':t.match(Un)?'"+'+Jn(t=Zn(t),-1===u.indexOf(t),h,u)+'"]+"':""!==t?'"+'+Kn(t.replace(/,/gi,"+"+h+"."),-1===u.indexOf(t),h,u,p)+'+"':"${}",t})}(e,"data",t,i),new Function("data",'var str="'+e+"\";var valueRegEx = (/value=\\'([A-Za-z0-9 _]*)((.)([\\w)(!-;?-■\\s]+)['])/g);\n        var hrefRegex = (/(?:href)([\\s='\"./]+)([\\w-./?=&\\\\#\"]+)((.)([\\w)(!-;/?-■\\s]+)['])/g);\n        if(str.match(valueRegEx)){\n            var check = str.match(valueRegEx);\n            var str1 = str;\n            for (var i=0; i < check.length; i++) {\n                var check1 = str.match(valueRegEx)[i].split('value=')[1];\n                var change = check1.match(/^'/) !== null ? check1.replace(/^'/, '\"') : check1;\n                change =change.match(/.$/)[0] === '\\'' ? change.replace(/.$/,'\"') : change;\n                str1 = str1.replace(check1, change);\n            }\n            str = str.replace(str, str1);\n        }\n        else if (str.match(/(?:href='')/) === null) {\n            if(str.match(hrefRegex)) {\n                var check = str.match(hrefRegex);\n                var str1 = str;\n                for (var i=0; i < check.length; i++) {\n                    var check1 = str.match(hrefRegex)[i].split('href=')[1];\n                    if (check1) {\n                        var change = check1.match(/^'/) !== null ? check1.replace(/^'/, '\"') : check1;\n                        change =change.match(/.$/)[0] === '\\'' ? change.replace(/.$/,'\"') : change;\n                        str1 = str1.replace(check1, change);\n                    }\n                }\n                str = str.replace(str, str1);\n            }\n        }\n         return str;").bind(t))}function Kn(e,t,i,n,o){return!t||_n.test(e)||-1!==n.indexOf(e.split(".")[0])||o||"true"===e||"false"===e?e:i+"."+e}function Jn(e,t,i,n){return t&&!_n.test(e)&&-1===n.indexOf(e.split(".")[0])?i+'["'+e:e}function Zn(e){return e.match(qn)?e:e.replace(Un,"\\\\")}function $n(e,t,i,n){e=e.trim();var o,r,s,a,l;return/\window\./gm.test(e)?e:(o=/'|"/gm,/@|\$|#/gm.test(e)&&(e=Jn(e,-1===i.indexOf(e),t,i)+'"]'),Qn.test(e)?(r=e,s=!o.test(e)&&-1===i.indexOf(e),a=t,l=i,!s||_n.test(r)||-1!==l.indexOf(r.split(".")[0])||/^\..*/gm.test(r)?r:a+"."+r):Kn(e,!o.test(e)&&-1===i.indexOf(e),t,i,n))}var eo=/^[\n\r.]+<tr|^<tr/,to=/^[\n\r.]+<svg|^<path|^<g/,io={};function no(){return"-"+Math.random().toString(36).substr(2,5)}function oo(e,t,i){var u=ho.compile(e,t,i);return function(e,t,i,n,o,r,s,a){var t=u(e,t,i,s,a),l="BlazorTemplateId";if(!N||o)return"string"==typeof t?(to.test(t)?Q("svg",{innerHTML:t}):Q(eo.test(t)?"table":"div",{innerHTML:t})).childNodes:t;var h=n+no();if(io[""+n]||(io[""+n]=[]),je(r))e[l]=h,io[""+n].push(e);else for(var d=0,p=Object.keys(io[""+n][parseInt(r.toString(),10)]);d<p.length;d++){var c=p[d];c!==l&&e[""+c]&&(io[""+n][parseInt(r.toString(),10)][""+c]=e[""+c]),c===l&&(h=io[""+n][parseInt(r.toString(),10)][""+c])}return"rowTemplate"===i?[Q("tr",{id:h,className:"e-blazor-template"})]:[Q("div",{id:h,className:"e-blazor-template"})]}}function ro(e,t,i,n,o){N&&(window.sfBlazor.updateTemplate(t,io[""+e],e,i,o),!1!==n)&&(io[""+e]=[])}function so(e,t,i){e=document.getElementById(e);if(e)for(var n=e.getElementsByClassName("blazor-inner-template"),o=0;o<n.length;o++){var r=" ",r=(je(i)?n[parseInt(o.toString(),10)]:n[parseInt(i.toString(),10)]).getAttribute("data-templateId"),s=document.getElementById(r);if(s)for(var a=s.childNodes.length,l=0;l<a;l++)je(i)?n[parseInt(o.toString(),10)].appendChild(s.childNodes[0]):(n[parseInt(i.toString(),10)].appendChild(s.childNodes[0]),o=n.length)}}function ao(e,t){var i;return e.prototype.CSPTemplate=!0,je(t)?i=e:(i=e.bind(t)).prototype=Object.create(e.prototype),i}function lo(){}lo.prototype.compile=function(e,t,i){return Xn(e,t=void 0===t?{}:t)};var ho={compile:(new lo).compile},po=["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"]'],co=[{attribute:"href",selector:'[href*="javascript:"]'},{attribute:"href",selector:"a[href]"},{attribute:"background",selector:'[background^="javascript:"]'},{attribute:"style",selector:'[style*="javascript:"]'},{attribute:"style",selector:'[style*="expression("]'},{attribute:"href",selector:'a[href^="data:text/html;base64"]'}],uo=["onchange","onclick","onmouseover","onmouseout","onkeydown","onload","onerror","onblur","onfocus","onbeforeload","onbeforeunload","onkeyup","onsubmit","onafterprint","onbeforeonload","onbeforeprint","oncanplay","oncanplaythrough","oncontextmenu","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onformchange","onforminput","onhaschange","oninput","oninvalid","onkeypress","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmousedown","onmousemove","onmouseup","onmousewheel","onoffline","onoine","ononline","onpagehide","onpageshow","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreadystatechange","onredo","onresize","onscroll","onseeked","onseeking","onselect","onstalled","onstorage","onsuspend","ontimeupdate","onundo","onunload","onvolumechange","onwaiting","onmouseenter","onmouseleave","onstart","onpropertychange","oncopy","ontoggle","onpointerout","onpointermove","onpointerleave","onpointerenter","onpointerrawupdate","onpointerover","onbeforecopy","onbeforecut","onbeforeinput"],go=(mo.beforeSanitize=function(){return{selectors:{tags:po,attributes:co}}},mo.sanitize=function(e){var t;return je(e)?e:(t=this.beforeSanitize(),this.serializeValue(t,e))},mo.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();e=this.wrapElement.innerHTML;return this.removeElement(),this.wrapElement=null,e.replace(/&amp;/g,"&")},mo.removeElement=function(){for(var e=this.wrapElement.children,t=0;t<e.length;t++)for(var i=e[parseInt(t.toString(),10)].attributes,n=0;n<i.length;n++)this.wrapElement.children[parseInt(t.toString(),10)].removeAttribute(i[parseInt(n.toString(),10)].localName)},mo.removeXssTags=function(){var e=this.wrapElement.querySelectorAll(this.removeTags.join(","));0<e.length&&e.forEach(function(e){G(e)})},mo.removeJsEvents=function(){var e=this.wrapElement.querySelectorAll("["+uo.join("],[")+"]");0<e.length&&e.forEach(function(t){uo.forEach(function(e){t.hasAttribute(e)&&t.removeAttribute(e)})})},mo.removeXssAttrs=function(){var n=this;this.removeAttrs.forEach(function(t,e){var i=n.wrapElement.querySelectorAll(t.selector);0<i.length&&("a[href]"===t.selector?i.forEach(function(e){-1!==e.getAttribute(t.attribute).replace(/\t|\s|&/,"").indexOf("javascript:alert")&&e.removeAttribute(t.attribute)}):i.forEach(function(e){e.removeAttribute(t.attribute)}))})},mo);function mo(){}yo.prototype.getOptionValue=function(e,t){return e[t]},yo.prototype.createSvg=function(e){return je(e.id)&&(e.id=this.rootId+"_svg"),this.svgObj=document.getElementById(e.id),je(document.getElementById(e.id))&&(this.svgObj=document.createElementNS(this.svgLink,"svg")),this.svgObj=this.setElementAttributes(e,this.svgObj),this.setSVGSize(e.width,e.height),this.svgObj},yo.prototype.setSVGSize=function(e,t){var i=document.getElementById(this.rootId),i=je(i)?null:i.getBoundingClientRect();je(this.width)||this.width<=0?this.svgObj.setAttribute("width",(e||i.width).toString()):this.svgObj.setAttribute("width",this.width.toString()),je(this.height)||this.height<=0?this.svgObj.setAttribute("height",t?t.toString():"450"):this.svgObj.setAttribute("height",this.height.toString())},yo.prototype.drawPath=function(e){var t=document.getElementById(e.id);return null===t&&(t=document.createElementNS(this.svgLink,"path")),t=this.setElementAttributes(e,t)},yo.prototype.drawLine=function(e){var t=document.getElementById(e.id);return null===t&&(t=document.createElementNS(this.svgLink,"line")),t=this.setElementAttributes(e,t)},yo.prototype.drawRectangle=function(e){var t=document.getElementById(e.id);return null===t&&(t=document.createElementNS(this.svgLink,"rect")),t=this.setElementAttributes(e,t)},yo.prototype.drawCircle=function(e){var t=document.getElementById(e.id);return null===t&&(t=document.createElementNS(this.svgLink,"circle")),t=this.setElementAttributes(e,t)},yo.prototype.drawPolyline=function(e){var t=document.getElementById(e.id);return null===t&&(t=document.createElementNS(this.svgLink,"polyline")),t=this.setElementAttributes(e,t)},yo.prototype.drawEllipse=function(e){var t=document.getElementById(e.id);return null===t&&(t=document.createElementNS(this.svgLink,"ellipse")),t=this.setElementAttributes(e,t)},yo.prototype.drawPolygon=function(e){var t=document.getElementById(e.id);return null===t&&(t=document.createElementNS(this.svgLink,"polygon")),t=this.setElementAttributes(e,t)},yo.prototype.drawImage=function(e){var t=document.createElementNS(this.svgLink,"image");return t.setAttributeNS(null,"height",e.height.toString()),t.setAttributeNS(null,"width",e.width.toString()),t.setAttributeNS("http://www.w3.org/1999/xlink","href",e.href),t.setAttributeNS(null,"x",e.x.toString()),t.setAttributeNS(null,"y",e.y.toString()),t.setAttributeNS(null,"id",e.id),t.setAttributeNS(null,"visibility",e.visibility),je(this.getOptionValue(e,"clip-path"))||t.setAttributeNS(null,"clip-path",this.getOptionValue(e,"clip-path")),je(e.preserveAspectRatio)||t.setAttributeNS(null,"preserveAspectRatio",e.preserveAspectRatio),t},yo.prototype.createText=function(e,t){var i=document.createElementNS(this.svgLink,"text"),i=this.setElementAttributes(e,i);return je(t)||(i.textContent=t),i},yo.prototype.createTSpan=function(e,t){var i=document.createElementNS(this.svgLink,"tspan"),i=this.setElementAttributes(e,i);return je(t)||(i.textContent=t),i},yo.prototype.createTitle=function(e){var t=document.createElementNS(this.svgLink,"title");return t.textContent=e,t},yo.prototype.createDefs=function(){return document.createElementNS(this.svgLink,"defs")},yo.prototype.createClipPath=function(e){var t=document.createElementNS(this.svgLink,"clipPath");return this.setElementAttributes(e,t)},yo.prototype.createForeignObject=function(e){var t=document.createElementNS(this.svgLink,"foreignObject");return this.setElementAttributes(e,t)},yo.prototype.createGroup=function(e){var t=document.createElementNS(this.svgLink,"g");return this.setElementAttributes(e,t)},yo.prototype.createPattern=function(e,t){t=document.createElementNS(this.svgLink,t);return this.setElementAttributes(e,t)},yo.prototype.createRadialGradient=function(e,t,i){i=je(e[0].colorStop)?e[0].color.toString():(i={id:this.rootId+"_"+t+"radialGradient",cx:i.cx+"%",cy:i.cy+"%",r:i.r+"%",fx:i.fx+"%",fy:i.fy+"%"},this.drawGradient("radialGradient",i,e),"url(#"+this.rootId+"_"+t+"radialGradient)");return i},yo.prototype.createLinearGradient=function(e,t,i){i=je(e[0].colorStop)?e[0].color.toString():(i={id:this.rootId+"_"+t+"linearGradient",x1:i.x1+"%",y1:i.y1+"%",x2:i.x2+"%",y2:i.y2+"%"},this.drawGradient("linearGradient",i,e),"url(#"+this.rootId+"_"+t+"linearGradient)");return i},yo.prototype.drawGradient=function(e,t,i){for(var n=this.createDefs(),o=document.createElementNS(this.svgLink,e),o=this.setElementAttributes(t,o),r=0;r<i.length;r++){var s=document.createElementNS(this.svgLink,"stop");s.setAttribute("offset",i[r].colorStop),s.setAttribute("stop-color",i[r].color),s.setAttribute("stop-opacity",i[r].opacity||"1"),je(i[r].style)||(s.style.cssText=i[r].style),o.appendChild(s)}return n.appendChild(o),n},yo.prototype.drawClipPath=function(e){var t=this.createDefs(),i=this.createClipPath({id:e.id}),e=(e.id=e.id+"_Rect",this.drawRectangle(e));return i.appendChild(e),t.appendChild(i),t},yo.prototype.drawCircularClipPath=function(e){var t=this.createDefs(),i=this.createClipPath({id:e.id}),e=(e.id=e.id+"_Circle",this.drawCircle(e));return i.appendChild(e),t.appendChild(i),t},yo.prototype.setElementAttributes=function(e,t){for(var i=Object.keys(e),n=0;n<i.length;n++)"style"===i[n]?t.style.cssText=e[i[n]]:t.setAttribute(i[n],e[i[n]]);return t},yo.prototype.createCanvas=function(){return null};var fo=yo;function yo(e){this.svgLink="http://www.w3.org/2000/svg",this.rootId=e}bo.prototype.getOptionValue=function(e,t){return e[t]},bo.prototype.createCanvas=function(e){var t=document.createElement("canvas");return t.setAttribute("id",this.rootId+"_canvas"),this.ctx=t.getContext("2d"),this.canvasObj=t,this.setCanvasSize(e.width,e.height),this.canvasObj},bo.prototype.setCanvasSize=function(e,t){var i=document.getElementById(this.rootId),i=je(i)?null:i.getBoundingClientRect();je(this.width)?this.canvasObj.setAttribute("width",(e||i.width).toString()):this.canvasObj.setAttribute("width",this.width.toString()),je(this.height)?this.canvasObj.setAttribute("height",t?t.toString():"450"):this.canvasObj.setAttribute("height",this.height.toString())},bo.prototype.setAttributes=function(e){this.ctx.lineWidth=this.getOptionValue(e,"stroke-width");var t=this.getOptionValue(e,"stroke-dasharray");je(t)||(t=t.split(","),this.ctx.setLineDash([parseInt(t[0],10),parseInt(t[1],10)])),this.ctx.strokeStyle=this.getOptionValue(e,"stroke")},bo.prototype.drawLine=function(e){this.ctx.save(),this.ctx.beginPath(),this.ctx.lineWidth=this.getOptionValue(e,"stroke-width"),this.ctx.strokeStyle=e.stroke,this.ctx.moveTo(e.x1,e.y1),this.ctx.lineTo(e.x2,e.y2),this.ctx.stroke(),this.ctx.restore()},bo.prototype.drawRectangle=function(e,t){var i=this.ctx,n=e.rx;return this.ctx.save(),this.ctx.beginPath(),t&&this.ctx.translate(t[0],t[1]),this.ctx.globalAlpha=this.getOptionValue(e,"opacity"),this.setAttributes(e),this.ctx.rect(e.x,e.y,e.width,e.height),null!==n&&0<=n?this.drawCornerRadius(e):("none"===e.fill&&(e.fill="transparent"),this.ctx.fillStyle=e.fill,this.ctx.fillRect(e.x,e.y,e.width,e.height),this.ctx.stroke()),this.ctx.restore(),this.ctx=i,this.canvasObj},bo.prototype.drawCornerRadius=function(e){var t=e.rx,i=e.x,n=e.y,o=e.width,r=e.height;"none"===e.fill&&(e.fill="transparent"),this.ctx.fillStyle=e.fill,r<2*(t=o<2*t?o/2:t)&&(t=r/2),this.ctx.beginPath(),this.ctx.moveTo(i+o-t,n),this.ctx.arcTo(i+o,n,i+o,n+r,t),this.ctx.arcTo(i+o,n+r,i,n+r,t),this.ctx.arcTo(i,n+r,i,n,t),this.ctx.arcTo(i,n,i+o,n,t),this.ctx.closePath(),this.ctx.fill(),this.ctx.stroke()},bo.prototype.drawPath=function(e,t){var i=e.d.split(" "),n=this.getOptionValue(e,"stroke-width"),o=this.ctx,r=!0;this.ctx.save(),this.ctx.beginPath(),t&&this.ctx.translate(t[0],t[1]),this.ctx.globalAlpha=e.opacity||this.getOptionValue(e,"fill-opacity"),this.setAttributes(e);for(var s=0;s<i.length;s+=3){var a=parseFloat(i[s+1]),l=parseFloat(i[s+2]);switch(i[s]){case"M":e.innerR||e.cx||this.ctx.moveTo(a,l);break;case"L":e.innerR||this.ctx.lineTo(a,l);break;case"Q":var h=parseFloat(i[s+3]),d=parseFloat(i[s+4]);this.ctx.quadraticCurveTo(a,l,h,d),s+=2;break;case"C":var h=parseFloat(i[s+3]),d=parseFloat(i[s+4]),p=parseFloat(i[s+5]),c=parseFloat(i[s+6]);this.ctx.bezierCurveTo(a,l,h,d,p,c),s+=4;break;case"A":e.innerR?r&&(this.ctx.arc(e.x,e.y,e.radius,e.start,e.end,e.counterClockWise),this.ctx.arc(e.x,e.y,e.innerR,e.end,e.start,!e.counterClockWise),r=!1):e.cx?this.ctx.arc(e.cx,e.cy,e.radius,0,2*Math.PI,e.counterClockWise):(this.ctx.moveTo(e.x,e.y),this.ctx.arc(e.x,e.y,e.radius,e.start,e.end,e.counterClockWise),this.ctx.lineTo(e.x,e.y)),s+=5;break;case"z":case"Z":this.ctx.closePath(),s-=2}}return"none"!==e.fill&&void 0!==e.fill&&(this.ctx.fillStyle=e.fill,this.ctx.fill()),0<n&&this.ctx.stroke(),this.ctx.restore(),this.ctx=o,this.canvasObj},bo.prototype.createText=function(e,t,i,n,o,r){var s=this.getOptionValue(e,"font-weight"),a=(je(s)||"regular"!==s.toLowerCase()||(s="normal"),this.getOptionValue(e,"font-size")),l=this.getOptionValue(e,"font-family"),s=this.getOptionValue(e,"font-style").toLowerCase()+" "+s+" "+a+" "+l,a=this.getOptionValue(e,"text-anchor"),l=void 0!==e.opacity?e.opacity:1;return"middle"===a&&(a="center"),this.ctx.save(),this.ctx.fillStyle=e.fill,this.ctx.font=s,this.ctx.textAlign=a,this.ctx.globalAlpha=l,e.baseline&&(this.ctx.textBaseline=e.baseline),r||(this.ctx.translate(e.x+0+(i||0),e.y+(n||0)),this.ctx.rotate(e.labelRotation*Math.PI/180)),this.ctx.fillText(t,r?e.x:0,r?o:0),this.ctx.restore(),this.canvasObj},bo.prototype.drawCircle=function(e,t){var i=this.ctx;return this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(e.cx,e.cy,e.r,0,2*Math.PI),this.ctx.fillStyle=e.fill,this.ctx.globalAlpha=e.opacity,this.ctx.fill(),t&&this.ctx.translate(t[0],t[1]),this.setAttributes(e),this.ctx.stroke(),this.ctx.restore(),this.ctx=i,this.canvasObj},bo.prototype.drawPolyline=function(e){this.ctx.save(),this.ctx.beginPath();for(var t=e.points.split(" "),i=0;i<t.length-1;i++){var n=t[i].split(","),o=parseFloat(n[0]),n=parseFloat(n[1]);0===i?this.ctx.moveTo(o,n):this.ctx.lineTo(o,n)}this.ctx.lineWidth=this.getOptionValue(e,"stroke-width"),this.ctx.strokeStyle=e.stroke,this.ctx.stroke(),this.ctx.restore()},bo.prototype.drawEllipse=function(e,t){var i=this.ctx,n=Math.max(e.rx,e.ry),o=e.rx/n,r=e.ry/n;this.ctx.save(),this.ctx.beginPath(),this.ctx.translate(e.cx,e.cy),t&&this.ctx.translate(t[0],t[1]),this.ctx.save(),this.ctx.scale(o,r),this.ctx.arc(0,0,n,0,2*Math.PI,!1),this.ctx.fillStyle=e.fill,this.ctx.fill(),this.ctx.restore(),this.ctx.lineWidth=this.getOptionValue(e,"stroke-width"),this.ctx.strokeStyle=e.stroke,this.ctx.stroke(),this.ctx.restore(),this.ctx=i},bo.prototype.drawImage=function(e){this.ctx.save();var t=new Image;je(e.href)||(t.src=e.href,this.ctx.drawImage(t,e.x,e.y,e.width,e.height)),this.ctx.restore()},bo.prototype.createLinearGradient=function(e){var t;return je(e[0].colorStop)||(t=this.ctx.createLinearGradient(0,0,0,this.canvasObj.height)),this.setGradientValues(e,t)},bo.prototype.createRadialGradient=function(e){var t;return je(e[0].colorStop)||(t=this.ctx.createRadialGradient(0,0,0,0,0,this.canvasObj.height)),this.setGradientValues(e,t)},bo.prototype.setGradientValues=function(e,t){var i;if(je(e[0].colorStop))i=e[0].color.toString();else{for(var n=0;n<=e.length-1;n++){var o=e[n].color,r=e[n].colorStop.slice(0,-1),r=parseInt(r,10)/100;t.addColorStop(r,o)}i=t.toString()}return i},bo.prototype.setElementAttributes=function(t,e){for(var i=Object.keys(t),n=Object.keys(t).map(function(e){return t[e]}),o=0;o<i.length;o++)e.setAttribute(i[o],n[o]);return null},bo.prototype.updateCanvasAttributes=function(e){this.setElementAttributes(e,this.canvasObj);var t,i=this.ctx;je(this.dataUrl)||((t=new Image).onload=function(){i.drawImage(t,0,0)},t.src=this.dataUrl)},bo.prototype.clearRect=function(e){this.ctx.restore(),this.ctx.clearRect(e.x,e.y,e.width,e.height)},bo.prototype.createGroup=function(){return null},bo.prototype.drawClipPath=function(){return null},bo.prototype.drawCircularClipPath=function(){return null},bo.prototype.canvasClip=function(e){this.ctx.save(),this.ctx.fillStyle="transparent",this.ctx.rect(e.x,e.y,e.width,e.height),this.ctx.fill(),this.ctx.clip()},bo.prototype.canvasRestore=function(){this.ctx.restore()},bo.prototype.drawPolygon=function(){return null},bo.prototype.createDefs=function(){return null},bo.prototype.createClipPath=function(){return null},bo.prototype.createSvg=function(){return null};var vo=bo;function bo(e){this.rootId=e}function wo(e){var t;switch(e){case"Highcontrast":case"HighContrast":t={tooltipFill:"#ffffff",tooltipBoldLabel:"#000000",tooltipLightLabel:"#000000",tooltipHeaderLine:"#969696",textStyle:{fontFamily:"Segoe UI",color:"#000000",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}};break;case"MaterialDark":case"FabricDark":case"BootstrapDark":t={tooltipFill:"MaterialDark"===e?"#F4F4F4":"FabricDark"===e?"#A19F9D":"#F0F0F0",tooltipBoldLabel:"MaterialDark"===e?"rgba(18, 18, 18, 1)":"FabricDark"===e?"#DADADA":"#1A1A1A",tooltipLightLabel:"MaterialDark"===e?"rgba(18, 18, 18, 1)":"FabricDark"===e?"#DADADA":"#1A1A1A",tooltipHeaderLine:"#9A9A9A",textStyle:"MaterialDark"===e?{fontFamily:"Roboto",color:"rgba(18, 18, 18, 1)",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}:"FabricDark"===e?{fontFamily:"Segoe UI",color:"#DADADA",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}:{fontFamily:"Helvetica",color:"#1A1A1A",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}};break;case"Bootstrap4":t={tooltipFill:"#212529",tooltipBoldLabel:"#F9FAFB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"rgba(255, 255, 255, 0.2)",textStyle:{fontFamily:"Helvetica",color:"#F9FAFB",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}};break;case"Tailwind3":t={tooltipFill:"#111827",tooltipBoldLabel:"#F9FAFB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#D1D5DB",textStyle:{fontFamily:"Inter",color:"#F9FAFB",fontWeight:"500",size:"12px",headerTextSize:"12px",boldTextSize:"12px"}};break;case"Tailwind3Dark":t={tooltipFill:"#F9FAFB",tooltipBoldLabel:"#1F2937",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#374151",textStyle:{fontFamily:"Inter",color:"#1F2937",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}};break;case"Tailwind":t={tooltipFill:"#111827",tooltipBoldLabel:"#F9FAFB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#6B7280",textStyle:{fontFamily:"Inter",color:"#F9FAFB",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}};break;case"TailwindDark":t={tooltipFill:"#E9ECEF",tooltipBoldLabel:"#1F2937",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#9CA3AF",textStyle:{fontFamily:"Inter",color:"#1F2937",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}};break;case"Bootstrap5":t={tooltipFill:"#000000E5",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#FFFFFF",textStyle:{fontFamily:"Segoe UI",color:"#FFFFFF",fontWeight:null,size:"12px",headerTextSize:"16px",boldTextSize:"14px"}};break;case"Bootstrap5Dark":t={tooltipFill:"#FFFFFFE5",tooltipBoldLabel:"#212529",tooltipLightLabel:"#212529",tooltipHeaderLine:"#212529",textStyle:{fontFamily:"Helvetica",color:"#212529",fontWeight:null,size:"12px",headerTextSize:"16px",boldTextSize:"14px"}};break;case"Fluent":t={tooltipFill:"#FFFFFF",tooltipBoldLabel:"#323130",tooltipLightLabel:"#323130",tooltipHeaderLine:"#D2D0CE",textStyle:{fontFamily:"Segoe UI",color:"#323130",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}};break;case"FluentDark":t={tooltipFill:"#323130",tooltipBoldLabel:"#F3F2F2",tooltipLightLabel:"#F3F2F1",tooltipHeaderLine:"#3B3A39",textStyle:{fontFamily:"Segoe UI",color:"#F3F2F1",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}};break;case"Fluent2":t={tooltipFill:"#FFFFFF",tooltipBoldLabel:"#242424",tooltipLightLabel:"#242424",tooltipHeaderLine:"#D2D0CE",textStyle:{fontFamily:"Segoe UI",color:"#242424",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}};break;case"Fluent2Dark":t={tooltipFill:"#292929",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#3B3A39",textStyle:{fontFamily:"Segoe UI",color:"#FFFFFF",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}};break;case"Fluent2HighContrast":t={tooltipFill:"#000000",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#3B3A39",textStyle:{fontFamily:"Segoe UI",color:"#FFFFFF",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}};break;case"Material3":t={tooltipFill:"#313033",tooltipBoldLabel:"#F4EFF4",tooltipLightLabel:"#F4EFF4",tooltipHeaderLine:"#F4EFF4",textStyle:{fontFamily:"Roboto",color:"#F4EFF4",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}};break;case"Material3Dark":t={tooltipFill:"#E6E1E5",tooltipBoldLabel:"#313033",tooltipLightLabel:"#313033",tooltipHeaderLine:"#313033",textStyle:{fontFamily:"Roboto",color:"#313033",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}};break;default:t={tooltipFill:"Material"===e?"#000816":"Fabric"===e?"#FFFFFF":"#212529",tooltipBoldLabel:"Material"===e?"rgba(249, 250, 251, 1)":"Fabric"===e?"#333333":"#F9FAFB",tooltipLightLabel:"Material"===e?"rgba(249, 250, 251, 1)":"Fabric"===e?"#333333":"#F9FAFB",tooltipHeaderLine:"Fabric"===e?"#D2D0CE":"#ffffff",textStyle:"Material"===e?{fontFamily:"Roboto",color:"rgba(249, 250, 251, 1)",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}:"Fabric"===e?{fontFamily:"Segoe UI",color:"#333333",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}:{fontFamily:"Helvetica",color:"#F9FAFB",fontWeight:null,size:"12px",headerTextSize:"12px",boldTextSize:"12px"}}}return t}Co=function(e,t){return(Co=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])}))(e,t)};var Co,W=function(e,t){function i(){this.constructor=e}Co(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)};function So(e,t,i,n){var o=e||"",r=document.getElementById("chartmeasuretext");if(null===r&&(r=Q("text",{id:"chartmeasuretext"}),document.body.appendChild(r)),"string"==typeof e&&(-1<e.indexOf("<")||-1<e.indexOf(">"))){for(var s=e.split(" "),a=0;a<s.length;a++)-1===s[a].indexOf("<br/>")&&(s[a]=s[a].replace(/[<>]/g,"&"));e=s.join(" ")}r.innerHTML=-1<o.indexOf("<br>")||-1<o.indexOf("<br/>")?o:e,r.style.position="fixed",r.style.fontSize=t.size||(n?i.headerTextSize:i.size),r.style.fontStyle=t.fontStyle||i.fontStyle,r.style.fontFamily=t.fontFamily||i.fontFamily,r.style.visibility="hidden",r.style.top="-100",r.style.left="0",r.style.whiteSpace="nowrap",r.style.lineHeight="normal";o=r.clientWidth,e=r.clientHeight,n=r.style.fontWeight;return r.style.fontWeight=t.fontWeight||i.fontWeight,new Eo("bold"===r.style.fontWeight&&"normal"===n?Math.max(o,r.clientWidth):r.clientWidth,"bold"===r.style.fontWeight&&"normal"===n?Math.max(e,r.clientHeight):r.clientHeight)}function Ao(e,t,i,n,o){return void 0===o&&(o=0),e>=i.x-(n=void 0===n?0:n)&&e<=i.x+i.width+n&&t>=i.y-o&&t<=i.y+i.height+o}function xo(e,t,i,n,o,r,s,a,l,h,d){void 0===d&&(d="");var p="",c=i.x,u=i.y,g=i.x+i.width,i=i.y+i.height;return p=r?(p=(p=p.concat("M "+c+" "+(u+t)+" Q "+c+" "+u+" "+(c+e)+" "+u+"  L "+(g-e)+" "+u+" Q "+g+" "+u+" "+g+" "+(u+t))).concat(" L "+g+" "+(i-t)+" Q "+g+" "+i+" "+(g-e)+" "+i),0!==o&&(p="RangeNavigator"===d?n.x-o>g/2?(p=p.concat(" L "+(n.x+o)+" "+i)).concat(" L "+(l+o)+" "+(i+o)+" L "+n.x+" "+i):(p=p.concat(" L "+n.x+" "+i)).concat(" L "+(l-o)+" "+(i+o)+" L "+(n.x-o)+" "+i):(p=p.concat(" L "+(n.x+o)+" "+i)).concat(" L "+l+" "+(i+o)+" L "+(n.x-o)+" "+i)),n.x-o>c||0===o?p.concat(" L "+(c+e)+" "+i+" Q "+c+" "+i+" "+c+" "+(i-t)+" z"):p.concat(" L "+c+" "+(i+t)+" z")):s?(p=(p=(p=(p=p.concat("M "+c+" "+(u+t)+" Q "+c+" "+u+" "+(c+e)+" "+u+" L "+(n.x-o)+" "+u)).concat(" L "+l+" "+n.y)).concat(" L "+(n.x+o)+" "+u)).concat(" L "+(g-e)+" "+u+" Q "+g+" "+u+" "+g+" "+(u+t))).concat(" L "+g+" "+(i-t)+" Q "+g+" "+i+" "+(g-e)+" "+i+" L "+(c+e)+" "+i+" Q "+c+" "+i+" "+c+" "+(i-t)+" z"):a?(p=(p=p.concat("M "+c+" "+(u+t)+" Q "+c+" "+u+" "+(c+e)+" "+u)).concat(" L "+(g-e)+" "+u+" Q "+g+" "+u+" "+g+" "+("RangeNavigator"===d?0:u+t)+" L "+g+" "+("RangeNavigator"===d?0:n.y-o)),p="RangeNavigator"===d?p.concat(" L "+(g+o)+" 0"):p.concat(" L "+(g+o)+" "+h),(p=(p="RangeNavigator"===d?p.concat(" L "+g+" "+(n.y-t)):p.concat(" L "+g+" "+(n.y+o))).concat(" L "+g+" "+(i-t)+" Q "+g+" "+i+" "+(g-e)+" "+i)).concat(" L "+(c+e)+" "+i+" Q "+c+" "+i+" "+c+" "+(i-t)+" z")):(p=p.concat("M "+(c+e)+" "+u+" Q "+c+" "+u+" "+c+" "+("RangeNavigator"===d?0:u+t)+" L "+c+" "+("RangeNavigator"===d?0:n.y-o)),p="RangeNavigator"===d?p.concat(" L "+(c-o)+" 0"):p.concat(" L "+(c-o)+" "+h),(p=(p="RangeNavigator"===d?p.concat(" L "+c+" "+(n.y-t)):p.concat(" L "+c+" "+(n.y+o))).concat(" L "+c+" "+(i-t)+" Q "+c+" "+i+" "+(c+e)+" "+i)).concat(" L "+(g-e)+" "+i+" Q "+g+" "+i+" "+g+" "+(i-t)+" L "+g+" "+(u+t)+" Q "+g+" "+u+" "+(g-e)+" "+u+" z"))}function Io(e){this.id=e}var To,Eo=function(e,t){this.width=e,this.height=t},Do=function(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n},Mo=function(e,t){this.isRight=t,this.isBottom=e},ko=(W(Po,To=Io),Po);function Po(e,t,i,n,o,r,s,a){void 0===r&&(r="");e=To.call(this,e)||this;return e.transform="",e.baseLine="auto",e.labelRotation=0,e.x=t,e.y=i,e.anchor=n,e.text=o,e.transform=r,e.baseLine=s,e.labelRotation=a,e}function Bo(e){return document.getElementById(e)}function Fo(e){e=Bo(e);e&&ue(e)}function Lo(e,t,i,n,o,r,s){var a=new fo(""),e=Ro(e,i,t,o,n),i=a["draw"+e.functionName](e.renderOption);return i.setAttribute("role",r),i.setAttribute("aria-label",s),i}function Ro(e,t,i,n,o){var r,s="Path",a=t.width,l=t.height,h=e.x,d=e.y,p=e.x+-a/2,c=e.y+-l/2;switch(i){case"Circle":case"Bubble":s="Ellipse",I(n,{rx:a/2,ry:l/2,cx:h,cy:d});break;case"Plus":I(n,{d:r="M "+p+" "+d+" L "+(h+a/2)+" "+d+" M "+h+" "+(d+l/2)+" L "+h+" "+(d+-l/2),stroke:n.fill});break;case"Cross":I(n,{d:r="M "+p+" "+(d+-l/2)+" L "+(h+a/2)+" "+(d+l/2)+" M "+p+" "+(d+l/2)+" L "+(h+a/2)+" "+(d+-l/2),stroke:n.fill});break;case"HorizontalLine":I(n,{d:r="M "+p+" "+d+" L "+(h+a/2)+" "+d,stroke:n.fill});break;case"VerticalLine":I(n,{d:r="M "+h+" "+(d+l/2)+" L "+h+" "+(d+-l/2),stroke:n.fill});break;case"Diamond":I(n,{d:r="M "+p+" "+d+" L "+h+" "+(d+-l/2)+" L "+(h+a/2)+" "+d+" L "+h+" "+(d+l/2)+" L "+p+" "+d+" z"});break;case"Rectangle":I(n,{d:r="M "+p+" "+(d+-l/2)+" L "+(h+a/2)+" "+(d+-l/2)+" L "+(h+a/2)+" "+(d+l/2)+" L "+p+" "+(d+l/2)+" L "+p+" "+(d+-l/2)+" z"});break;case"Triangle":I(n,{d:r="M "+p+" "+(d+l/2)+" L "+h+" "+(d+-l/2)+" L "+(h+a/2)+" "+(d+l/2)+" L "+p+" "+(d+l/2)+" z"});break;case"InvertedTriangle":I(n,{d:r="M "+(h+a/2)+" "+(d-l/2)+" L "+h+" "+(d+l/2)+" L "+(h-a/2)+" "+(d-l/2)+" L "+(h+a/2)+" "+(d-l/2)+" z"});break;case"Pentagon":for(var u,g,m=0;m<=5;m++)u=a/2*Math.cos(Math.PI/180*(72*m)),g=l/2*Math.sin(Math.PI/180*(72*m)),r=0===m?"M "+(h+u)+" "+(d+g)+" ":r.concat("L "+(h+u)+" "+(d+g)+" ");I(n,{d:r=r.concat("Z")});break;case"Image":s="Image",I(n,{href:o,height:l,width:a,x:p,y:c});break;case"Star":for(var f=Math.min(a,l)/2,y=f/2,v=Math.PI/5,b="",m=0;m<10;m++){var w=m%2==0?f:y;b+=(0===m?"M":"L")+(h+w*Math.cos(m*v-Math.PI/2))+","+(d+w*Math.sin(m*v-Math.PI/2))}I(n,{d:b+="Z"})}return{renderOption:n,functionName:s}}W(Vo,Oo=Io);var Oo,No=Vo;function Vo(e,t,i,n,o,r,s){e=Oo.call(this,e)||this;return e.opacity=o,e.fill=t,e.stroke=n,e["stroke-width"]=i,e["stroke-dasharray"]=r,e.d=s,e}function _o(e,t,i,n,o){var r=new fo(""),i={id:e.id,x:e.x,y:e.y,fill:i,"font-size":t.size||o.size,"font-style":t.fontStyle||o.fontStyle,"font-family":t.fontFamily||o.fontFamily,"font-weight":t.fontWeight||o.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:t.opacity,"dominant-baseline":e.baseLine},o="string"==typeof e.text?e.text:e.text[0],t=r.createText(i,o);return n&&n.appendChild(t),t}var Ho,zo,jo=function(e,t){this.x=e,this.y=t},tn=(Ho=function(e,t){return(Ho=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])}))(e,t)},function(e,t){function i(){this.constructor=e}Ho(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),W=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Wo=(tn(Qo,zo=n),W([e(null)],Qo.prototype,"size",void 0),W([e("")],Qo.prototype,"color",void 0),W([e("Segoe UI")],Qo.prototype,"fontFamily",void 0),W([e("Normal")],Qo.prototype,"fontWeight",void 0),W([e("Normal")],Qo.prototype,"fontStyle",void 0),W([e(1)],Qo.prototype,"opacity",void 0),W([e(null)],Qo.prototype,"headerTextSize",void 0),W([e(null)],Qo.prototype,"boldTextSize",void 0),Qo);function Qo(){return null!==zo&&zo.apply(this,arguments)||this}tn(Go,Uo=n),W([e("")],Go.prototype,"color",void 0),W([e(1)],Go.prototype,"width",void 0),W([e("")],Go.prototype,"dashArray",void 0);var Uo,qo=Go;function Go(){return null!==Uo&&Uo.apply(this,arguments)||this}tn(Ko,Yo=n),W([e(0)],Ko.prototype,"x",void 0),W([e(0)],Ko.prototype,"y",void 0),W([e(0)],Ko.prototype,"width",void 0),W([e(0)],Ko.prototype,"height",void 0);var Yo,Xo=Ko;function Ko(){return null!==Yo&&Yo.apply(this,arguments)||this}tn($o,Jo=n),W([e(0)],$o.prototype,"x",void 0),W([e(0)],$o.prototype,"y",void 0);var Jo,Zo=$o;function $o(){return null!==Jo&&Jo.apply(this,arguments)||this}tn(ir,er=Ji),ir.prototype.preRender=function(){this.allowServerDataBinding=!1,this.initPrivateVariable(),this.isCanvas||this.removeSVG(),this.createTooltipElement()},ir.prototype.initPrivateVariable=function(){this.renderer=new fo(this.element.id),this.themeStyle=wo(this.theme),this.formattedText=[],this.padding=5,this.highlightPadding=3,this.areaMargin=10,this.isFirst=!0,this.markerPoint=[]},ir.prototype.removeSVG=function(){var e=document.getElementById(this.element.id+"_svg"),t=document.getElementById(this.element.id+"parent_template");this.blazorTemplate&&so(this.element.id+"parent_template_blazorTemplate"),e&&e.parentNode&&ue(e),t&&t.parentNode&&ue(t)},ir.prototype.render=function(){this.fadeOuted=!1,this.template?(this.updateTemplateFn(),this.createTemplate(this.areaBounds,this.location)):(this.renderText(this.isFirst),this.trigger("tooltipRender",{cancel:!1,name:"tooltipRender",tooltip:this}),e=this.renderTooltipElement(this.areaBounds,this.location),this.drawMarker(e.isBottom,e.isRight,this.markerSize)),this.trigger("loaded",{tooltip:this});var e=document.getElementById("chartmeasuretext");e&&ue(e),this.allowServerDataBinding=!0},ir.prototype.createTooltipElement=function(){var e,t;this.textElements=[],this.template&&!this.shared||(this.enableRTL&&this.element.setAttribute("dir","ltr"),t=this.renderer.createSvg({id:this.element.id+"_svg"}),this.element.appendChild(t),(e=document.getElementById(this.element.id+"_group"))||(e=this.renderer.createGroup({id:this.element.id+"_group"})).setAttribute("transform","translate(0,0)"),t.appendChild(e),t=this.renderer.drawPath({id:this.element.id+"_path","stroke-width":"Fabric"!==this.theme&&"Fluent"!==this.theme&&"Fluent2"!==this.theme&&"Fluent2HighContrast"!==this.theme||this.border.width?this.border.width:1,fill:this.fill||this.themeStyle.tooltipFill,opacity:("TailwindDark"===this.theme||"Tailwind"===this.theme||"Tailwind3Dark"===this.theme||"Tailwind3"===this.theme||"Bootstrap5"===this.theme||"Bootstrap5Dark"===this.theme||-1<this.theme.indexOf("Fluent2"))&&.75===this.opacity?1:this.opacity,stroke:this.border.color||("Fabric"===this.theme||"Fluent"===this.theme||"Fluent2"===this.theme?"#D2D0CE":this.border.color)}),e.appendChild(t))},ir.prototype.drawMarker=function(e,t,i){if(this.shapes.length<=0)return null;var n=0,o=this.renderer.createGroup({id:this.element.id+"_trackball_group"}),r=Bo(this.element.id+"_group");if(!r)return null;for(var s=(this.enableRTL?this.elementSize.width-i/2:2*this.marginX+i/2)+(t?this.arrowPadding:0),a=0,l=this.shapes;a<l.length;a++){var h,d,p,c=l[a];"None"!==c&&(p=new No(this.element.id+"_Trackball_"+n,this.palette[n],1,"#cccccc",1,null),this.markerPoint[n]&&(h=0,-1<this.header.indexOf("<br")&&(h=this.header.split(/<br.*?>/g).length+n),d=this.formattedText&&2<=this.formattedText.length?this.getTooltipTextContent(this.formattedText[1])+", "+this.getTooltipTextContent(this.formattedText[0]):"",o.appendChild(Lo(new jo(s,this.markerPoint[n]-this.padding+(e?this.arrowPadding:h)),c,new Eo(i,i),"",p,"img",d))),n++)}r.appendChild(o)},ir.prototype.renderTooltipElement=function(e,t){var i,n,o=Bo(this.element.id),r=new jo(0,0),s=new jo(0,0),a=Bo(this.element.id+"_svg"),l=Bo(this.element.id+"_group"),h=Bo(this.element.id+"_path"),d=!1,p=!1,c=!1,u=0,g=0;return je(l)||(""!==this.header&&this.showHeaderLine&&(this.elementSize.height+=this.marginY),this.isFixed?(n=this.elementSize.width+2*this.marginX,i=this.elementSize.height+2*this.marginY,n=new Do(t.x,t.y,n,i)):1<this.content.length?(n=this.sharedTooltipLocation(e,this.location.x,this.location.y),d=!0):(n=this.tooltipLocation(e,t,r,s),this.inverted?(u=(p=n.x<t.x+this.clipBounds.x)?0:this.arrowPadding,this.allowHighlight&&(n.x+=p?this.highlightPadding:-2*this.highlightPadding)):(c=!(d=n.y<t.y+this.clipBounds.y),g=d?0:this.arrowPadding)),""!==this.header&&this.showHeaderLine&&(i=2,e=0,t=this.isWrap?this.wrappedText:this.header,this.isWrap&&"string"==typeof t&&(-1<t.indexOf("<")||-1<t.indexOf(">"))&&(i=t.split("<br>").length),-1<this.header.indexOf("<br")&&(e=5*(this.header.split(/<br.*?>/g).length-1)),t=Pe({},this.textStyle,null,!0).properties,t=So(this.isWrap?this.wrappedText:this.header,t,this.themeStyle.textStyle).height+this.marginY*i+(c?this.arrowPadding:0)+(this.isWrap?5:e),i="M "+(3*this.marginX+(p||d||c?0:this.arrowPadding))+" "+t+"L "+(n.width+(p||d||c?0:this.arrowPadding)-2*this.marginX)+" "+t,e=this.renderer.drawPath({id:this.element.id+"_header_path","stroke-width":1,fill:null,opacity:"Material3"===this.theme||"Material3Dark"===this.theme?.2:.8,stroke:this.themeStyle.tooltipHeaderLine,d:i}),l.appendChild(e)),t=this.border.width/2,i=new Do(t+u,t+g,n.width-t,n.height-t),l.setAttribute("opacity","1"),!this.enableAnimation||this.isFirst||this.crosshair?this.updateDiv(o,n.x,n.y):this.animateTooltipDiv(o,n),a.setAttribute("height",(n.height+this.border.width+(this.inverted?0:this.arrowPadding)+5).toString()),a.setAttribute("width",(n.width+this.border.width+(this.inverted?this.arrowPadding:0)+5).toString()),a.setAttribute("opacity","1"),je(this.tooltipPlacement)||(d=-1<this.tooltipPlacement.indexOf("Top"),c=-1<this.tooltipPlacement.indexOf("Bottom"),p=-1<this.tooltipPlacement.indexOf("Left")),h.setAttribute("d",xo(this.rx,this.ry,i,r,this.arrowPadding,d,c,p,s.x,s.y,this.controlName)),(this.enableShadow&&"Bootstrap4"!==this.theme||-1<this.theme.indexOf("Fluent2"))&&(e=this.element.id+"_shadow","Tailwind"===this.theme||"TailwindDark"===this.theme||"Tailwind3"===this.theme||"Tailwind3Dark"===this.theme||"Bootstrap5"===this.theme||"Bootstrap5Dark"===this.theme?h.setAttribute("box-shadow","0px 1px 2px rgba(0, 0, 0, 0.06), 0px 1px 3px rgba(0, 0, 0, 0.1)"):h.setAttribute("filter",F.isIE?"":"url(#"+e+")"),t='<filter id="'+e+'" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="3"/>',-1<this.theme.indexOf("Fluent2")?t+='<feOffset dx="-1" dy="3.6" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="0.2"/>':t+='<feOffset dx="3" dy="3" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="0.5"/>',t+='</feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>',(o=this.renderer.createDefs()).setAttribute("id",this.element.id+"SVG_tooltip_definition"),l.appendChild(o),o.innerHTML=t),n="Fabric"!==this.theme&&"Fluent"!==this.theme&&"Fluent2"!==this.theme||this.border.color?"Fluent2HighContrast"===this.theme?"#FFFFFF":this.border.color:"#D2D0CE",h.setAttribute("stroke",n),je(this.border.dashArray)||h.setAttribute("stroke-dasharray",this.border.dashArray),this.changeText(new jo(u,g),c,!p&&!d&&!c),this.revert&&(this.inverted=!this.inverted,this.revert=!1)),new Mo(c,!p&&!d&&!c)},ir.prototype.changeText=function(e,t,i){var n=document.getElementById(this.element.id+"_text");t&&n.setAttribute("transform","translate(0,"+this.arrowPadding+")"),i&&n.setAttribute("transform","translate("+this.arrowPadding+" 0)")},ir.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)},ir.prototype.renderText=function(e){var t,i,n,o,r=0,s=0,a=0,l="properties",h=Pe({},this.textStyle,null,!0)[l],O=Bo(this.element.id+"_group"),d="";this.findFormattedText(),this.isWrap=!1;for(var p,c="rtl"===document.body.getAttribute("dir")&&!this.enableRTL?"end":"start",u=(this.leftSpace=this.areaBounds.x+this.location.x,this.rightSpace=this.areaBounds.x+this.areaBounds.width-this.leftSpace,this.header.replace(/<b>/g,"").replace(/<\/b>/g,"").trim()),g=-1<this.header.indexOf("<b>")&&-1<this.header.indexOf("</b>"),m=So(this.formattedText[0],h,this.themeStyle.textStyle).width+2*this.marginX+this.arrowPadding,N=this.location.x-m<this.location.x,V=this.areaBounds.x+this.areaBounds.width<this.location.x+m,f=""!==u&&this.showHeaderLine?this.marginY:0,y=!0,v=!0,b=(this.markerPoint=[],0<this.shapes.length?10:0),w=0<this.shapes.length?5:0,C="400",S=this.themeStyle.tooltipLightLabel,A=22/parseFloat("12px")*parseFloat(h.size||this.themeStyle.textStyle.size),x=[],I=0,T=(e&&!this.isCanvas||(Fo(this.element.id+"_text"),Fo(this.element.id+"_header_path"),Fo(this.element.id+"_trackball_group"),Fo(this.element.id+"SVG_tooltip_definition")),"Chart"===this.controlName&&parseFloat("12px")<parseFloat(h.size||this.themeStyle.textStyle.headerTextSize)&&(I=parseFloat(h.size||this.themeStyle.textStyle.size)-parseFloat("12px")),new ko(this.element.id+"_text",2*this.marginX,I+2*this.marginY+2*this.padding+(2===this.marginY?"RangeNavigator"===this.controlName?5:3:0),c,"")),E=_o(T,h,h.color||this.themeStyle.tooltipBoldLabel,O,this.themeStyle.textStyle),_=1===this.formattedText.length&&-1<this.formattedText[0].indexOf(" : <b>"),D=""!==this.header,M=D&&g?16:13,k=0,H=this.formattedText.length;k<H;k++)if(n=this.formattedText[k].replace(/<(b|strong)>/g,"<b>").replace(/<\/(b|strong)>/g,"</b>").split(/<br.*?>/g),this.isTextWrap&&this.header!==this.formattedText[k]&&-1===this.formattedText[k].indexOf("<br")&&(p=Math.round(this.leftSpace>this.rightSpace?this.leftSpace/M:this.rightSpace/M),n=this.formattedText[k].match(new RegExp(".{1,"+p+"}","g"))),0===k&&!_&&this.isTextWrap&&(this.leftSpace<m||N)&&(this.rightSpace<m||V)&&(p=Math.round(this.leftSpace>this.rightSpace?this.leftSpace/M:this.rightSpace/M),n=(""!==u?u:this.formattedText[k]).match(new RegExp(".{1,"+p+"}","g")),this.wrappedText=g?"<b>"+n.join("<br>")+"</b>":n.join("<br>"),this.isWrap=1<n.length),""!==n[0]){0===k&&""!==u||this.markerPoint.push((""!==u&&this.showHeaderLine?this.marginY:0)+T.y+r-(0!==I?I/this.markerSize*(parseFloat(h.size||this.themeStyle.textStyle.headerTextSize)/this.markerSize):0));for(var P=0,z=n.length;P<z;P++){t=n[P].replace(/<b>/g,"<br><b>").replace(/<\/b>/g,"</b><br>").replace(/:/g,this.enableRTL?"<br>‎: <br>":"<br>‎:<br>").split("<br>"),this.enableRTL&&0<t.length&&n[P].match(/:/g)&&(t[0]=t[0].trim(),t.reverse()),v=!(a=0),r+=A;for(var B=0,F=t.length;B<F;B++){var L,R=t[B];this.enableRTL&&""!==R&&this.isRTLText(R)&&(R=R.concat("‎")),/\S/.test(R)||""===R||(R=" "),(v||" "!==R)&&""===R.replace(/<b>/g,"").replace(/<\/b>/g,"").trim()||(a+=" "!==R?4:0,v&&!y?(-1<this.header.indexOf("<br")&&0!==k&&(f+=this.header.split(/<br.*?>/g).length),o={x:2*this.marginX+(b+w),dy:A+(v?f:0),fill:""},f=null):o=y&&v?{x:""===u?2*this.marginX+(b+w):2*this.marginX+(this.isWrap?b+w:0)}:{},v=!1,i=this.renderer.createTSpan(o,""),E.appendChild(i),d=-1<R.indexOf("<b>")||g&&0===B&&0===k&&(D||this.isWrap)?(S=this.themeStyle.tooltipBoldLabel,"font-weight:"+(C="600")):"600"===C?"font-weight:"+C:"",h.fontWeight=C,i.setAttribute("fill",this.textStyle.color||S),(-1<R.indexOf("</b>")||g&&B===F-1&&0===k&&(D||this.isWrap))&&(C="Normal",S=this.themeStyle.tooltipLightLabel),""!==d&&(i.style.fontWeight=d.split("font-weight:")[1],i.style.color=i.getAttribute("fill")),i.style.fontFamily="inherit",i.style.fontStyle="inherit",i.style.fontSize=this.header===this.formattedText[k]?h.size||this.themeStyle.textStyle.headerTextSize:-1<R.indexOf("<b>")||-1<R.indexOf("</b>")?h.size||this.themeStyle.textStyle.boldTextSize:h.size||this.themeStyle.textStyle.size,i.style.fontWeight=this.header!==this.formattedText[k]||-1!==this.header.indexOf("<b>")&&-1!==this.header.indexOf("</b>")?-1<R.indexOf("<b>")||-1<R.indexOf("</b>")?-1<this.theme.indexOf("Bootstrap5")?this.textStyle.fontWeight||"600":"bold":-1!==R.indexOf("<b>")&&-1!==R.indexOf("</b>")||!(-1<this.theme.indexOf("Bootstrap5")||-1<this.theme.indexOf("Tailwind3"))?this.textStyle.fontWeight||h.fontWeight:this.textStyle.fontWeight||(-1<this.theme.indexOf("Tailwind3")?"500":"600"):this.textStyle.fontWeight||(-1<this.theme.indexOf("Tailwind3")?"500":"600"),(L=Pe({},this.textStyle,null,!0)[l]).fontWeight=i.style.fontWeight,L.size=i.style.fontSize,y=!1,i.textContent=R=this.getTooltipTextContent(R),a+=So(R,L,this.themeStyle.textStyle).width)}a-=4,s=Math.max(s,a),x.push(a)}}this.elementSize=new Eo(s+(0<s?2*this.marginX:0),r),this.elementSize.width+=b+w;e=E.childNodes[0];""!==u&&e&&!this.isWrap&&(h.fontWeight="600",c=(this.elementSize.width+2*this.padding)/2-So(u,h,this.themeStyle.textStyle,!0).width/2,e.setAttribute("x",c.toString())),this.renderContentRTL(E,D,b+w,x)},ir.prototype.renderContentRTL=function(e,t,i,n){if(this.enableRTL)for(var o=void 0,r=t?1:0,s=0;s<e.childNodes.length;s++)o=e.childNodes[s],t&&!(0<s)||je(o.getAttribute("x"))||(o.setAttribute("x",(this.elementSize.width-(i+n[r])).toString()),r++)},ir.prototype.getTooltipTextContent=function(e){var t=e.match(/<[a-zA-Z\/](.|\n)*?>/g);if(!je(t))for(var i=this.isRTLText(e),n=0;n<t.length;n++)this.isValidHTMLElement(t[n].replace("<","").replace("/","").replace(">","").trim())&&(e=e.replace(t[n],i?"‎":""));return e},ir.prototype.isValidHTMLElement=function(e){return"[object HTMLUnknownElement]"!==document.createElement(e).toString()},ir.prototype.isRTLText=function(e){return/[\u0590-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC]/.test(e)},ir.prototype.createTemplate=function(t,i){var e={cancel:!1,name:"tooltipRender",tooltip:this},n=(this.trigger("tooltipRender",e),document.getElementById(this.element.id)),o=(this.isCanvas&&this.removeSVG(),je(n)?null:n.firstElementChild);if(o&&ue(o),e.cancel)ue(Bo(this.element.id+"_tooltip"));else{var r=Q("div",{id:this.element.id+"parent_template"}),s=void 0;if("Chart"===this.controlName&&this.shared)for(var a=0;a<this.data.length;a++){var l=this.templateFn(this.data[a],this.controlInstance,r.id,r.id+"_blazorTemplate","");0===a?s=l:1<l.length?s[a].outerHTML=l[a].outerHTML||l[a].textContent:s[s.length-1].outerHTML+=l[0].outerHTML}else s=this.templateFn(this.data,this.controlInstance,r.id,r.id+"_blazorTemplate","");for(;s&&0<s.length;)N||1===s.length?(r.appendChild(s[0]),s=null):r.appendChild(s[0]);je(n)||n.appendChild(r);var h,o=this.isCanvas?r:this.element,e=o.getBoundingClientRect(),n=(this.padding=0,this.elementSize=new Eo(e.width,e.height),this.shared?this.sharedTooltipLocation(t,this.location.x,this.location.y):this.tooltipLocation(t,i,new jo(0,0),new jo(0,0)));!this.enableAnimation||this.isFirst||this.crosshair?this.updateDiv(o,n.x,n.y):this.animateTooltipDiv(this.element,n),this.blazorTemplate&&(h=this,(e=function(){var e=Bo(h.element.id).getBoundingClientRect(),e=(h.elementSize=new Eo(e.width,e.height),h.tooltipLocation(t,i,new jo(0,0),new jo(0,0)));h.updateDiv(Bo(h.element.id),e.x,e.y)}).bind(h,t,i),ro(this.element.id+"parent_template_blazorTemplate",this.blazorTemplate.name,this.blazorTemplate.parent,void 0,e))}},ir.prototype.sharedTooltipLocation=function(e,t,i){var n=this.elementSize.width+2*this.marginX,o=this.elementSize.height+2*this.marginY,t=new Do(t+2*this.padding,i-o-this.padding,n,o);return t.y<e.y&&(t.y+=t.height+2*this.padding),t.y+t.height>e.y+e.height&&(t.y=Math.max(e.y+e.height-(t.height+2*this.padding),e.y)),t.x+t.width>e.x+e.width&&(t.x=e.x+this.location.x-(t.width+4*this.padding)),t.x<e.x&&(t.x=e.x),t},ir.prototype.getCurrentPosition=function(e,t,i,n){var o=this.tooltipPlacement,r=this.clipBounds.x,s=this.clipBounds.y,a=this.offset,l=this.elementSize.width+2*this.marginX,h=this.elementSize.height+2*this.marginY,d=new jo(t.x,t.y);return"Top"===o||"Bottom"===o?(d=new jo(d.x+r-this.elementSize.width/2-this.padding,d.y+s-this.elementSize.height-2*this.padding-this.arrowPadding-a),i.x=n.x=l/2,"Bottom"===o&&(d.y=t.y+s+a),e.x+e.width<d.x+l?(d.x=e.width>l?e.x+e.width-l+6:e.x,i.x=n.x=e.width>l?e.x+t.x-d.x:t.x):e.x>d.x&&(d.x=e.x,i.x=n.x=t.x)):(d=new jo(d.x+r+a,d.y+s-this.elementSize.height/2-this.padding),i.y=n.y=h/2,"Left"===o&&(d.x=t.x+r-a-(l+this.arrowPadding)),e.y+e.height<d.y+h?(d.y=e.height>h?e.y+e.height-h+6:e.y,i.y=n.y=e.height>h?e.y+t.y-d.y:t.y):e.y>d.y&&(d.y=e.y,i.y=n.y=t.y)),new Do(d.x,d.y,l,h)},ir.prototype.tooltipLocation=function(e,t,i,n){var o,r,s,a,l,h,d,p;return je(this.tooltipPlacement)?(o=new jo(t.x,t.y),r=this.elementSize.width+2*this.marginX,s=this.elementSize.height+2*this.marginY,a=this.offset,l=this.clipBounds.x,h=this.clipBounds.y,d=e.x,p=e.y,this.outOfBounds=!1,this.inverted?(o=new jo(o.x+l+a,o.y+h-this.elementSize.height/2-this.padding),i.y=n.y=s/2,(o.x+r+this.arrowPadding>d+e.width||this.isNegative)&&(o.x=(t.x>e.width+e.x?e.width:t.x)+l-a-(r+this.arrowPadding)),o.x<d&&(o.x=(t.x<0?0:t.x)+l+a),o.x+r+this.arrowPadding>d+e.width&&(o.x=(t.x>e.width+e.x?e.width:t.x)+l-a-(r+this.arrowPadding)),o.y<=p&&(i.y-=p-o.y,n.y-=p-o.y,o.y=p),o.y+s>=p+e.height&&(i.y+=o.y+s-(p+e.height),n.y+=o.y+s-(p+e.height),o.y-=o.y+s-(p+e.height)),i.y+this.arrowPadding>s-this.ry&&(i.y=s-this.ry-this.arrowPadding,n.y=s),i.y-this.arrowPadding<this.ry&&(i.y=n.y=this.ry+this.arrowPadding),"Chart"===this.controlName&&((o.y+i.y<this.areaMargin+this.arrowPadding||e.y+e.height-(o.y+i.y)<this.areaMargin+this.arrowPadding)&&(this.outOfBounds=!0),Ao(o.x,o.y,e)&&!this.outOfBounds||(this.inverted=!this.inverted,o=new jo(t.x+l-this.padding-this.elementSize.width/2,t.y+h-this.elementSize.height-2*this.padding-a-this.arrowPadding),this.revert=!0,n.x=i.x=r/2,n.y=i.y=0,(o.y<p||this.isNegative)&&(o.y=(t.y<0?0:t.y)+a+h),o.y+this.arrowPadding+s>p+e.height&&(o.y=Math.min(t.y,p+e.height)+h-this.elementSize.height-2*this.padding-a-this.arrowPadding),n.x=r/2,o.x<d&&(n.x-=d-o.x,i.x-=d-o.x,o.x=d),o.x+r>e.width+d&&(i.x+=o.x+r-(e.width+d),n.x+=o.x+r-(e.width+d),o.x-=o.x+r-(e.width+d)),this.arrowPadding+i.x>r-this.rx&&(n.x=r-this.rx-this.arrowPadding,i.x=r-this.rx-this.arrowPadding),i.x-this.arrowPadding<this.rx&&(i.x=n.x=this.rx+this.arrowPadding)))):(o=new jo(o.x+l-this.elementSize.width/2-this.padding,o.y+h-this.elementSize.height-2*(this.allowHighlight?this.highlightPadding:this.padding)-this.arrowPadding-a),i.x=n.x=r/2,(o.y<p||this.isNegative)&&"Progressbar"!==this.controlName&&(o.y=(t.y<0?0:t.y)+h+a),o.y+s+this.arrowPadding>p+e.height&&(o.y=Math.min(t.y,p+e.height)+h-this.elementSize.height-2*this.padding-this.arrowPadding-a),(o.x+r>d+e.width&&o.y<p||this.isNegative)&&"Progressbar"!==this.controlName&&(o.y=(t.y<0?0:t.y)+h+a),n.x=r/2,o.x<d&&"Progressbar"!==this.controlName&&(i.x-=d-o.x,n.x-=d-o.x,o.x=d),o.x+r>d+e.width&&"Progressbar"!==this.controlName&&(i.x+=o.x+r-(d+e.width),n.x+=o.x+r-(d+e.width),o.x-=o.x+r-(d+e.width)),o.x<d&&"Progressbar"!==this.controlName&&(i.x-=d-o.x,n.x-=d-o.x,o.x=d),i.x+this.arrowPadding>r-this.rx&&(i.x=r-this.rx-this.arrowPadding,n.x=r-this.rx-this.arrowPadding),i.x-this.arrowPadding<this.rx&&(i.x=n.x=this.rx+this.arrowPadding),"Chart"===this.controlName&&((e.x+e.width-(o.x+i.x)<this.areaMargin+this.arrowPadding||o.x+i.x<this.areaMargin+this.arrowPadding)&&(this.outOfBounds=!0),this.template&&o.y<0&&(o.y=t.y+h+a),Ao(o.x,o.y,e)&&!this.outOfBounds||(this.inverted=!this.inverted,this.revert=!0,o=new jo(t.x+a+l,t.y+h-this.elementSize.height/2-this.padding),n.x=i.x=0,n.y=i.y=s/2,(o.x+this.arrowPadding+r>d+e.width||this.isNegative)&&(o.x=(t.x>d+e.width?e.width:t.x)+l-a-(this.arrowPadding+r)),o.x<d&&(o.x=(t.x<0?0:t.x)+a+l),o.y<=p&&(n.y-=p-o.y,i.y-=p-o.y,o.y=p),o.y+s>=e.height+p&&(i.y+=o.y+s-(e.height+p),n.y+=o.y+s-(e.height+p),o.y-=o.y+s-(e.height+p)),this.arrowPadding+i.y>s-this.ry&&(i.y=s-this.arrowPadding-this.ry,n.y=s),i.y-this.arrowPadding<this.ry&&(i.y=this.arrowPadding+this.ry,n.y=0)))),new Do(o.x,o.y,r,s)):this.getCurrentPosition(e,t,i,n)},ir.prototype.animateTooltipDiv=function(t,i){var e,n,o=this,r=parseFloat(t.style.left),s=parseFloat(t.style.top),a=0===this.duration&&"Enable"===Ut?300:this.duration;"Chart"===this.controlName&&this.shared&&!this.enableRTL&&(e=this.element.style.transform.split(/[(),\s]+/),r=parseFloat(e[1]),s=parseFloat(e[2]),t.style.transition="transform "+a+"ms ease"),new Vt({}).animate(t,{duration:a,progress:function(e){n=e.timeStamp/e.duration,t.style.animation=null,"Chart"===o.controlName&&o.shared&&!o.enableRTL?(t.style.transform="translate("+(r+(i.x-r))+"px,"+(s+i.y-s)+"px)",t.style.left="",t.style.top=""):"Chart"===o.controlName&&o.showNearestTooltip?(t.style.transition="left "+e.duration+"ms ease-out, top "+e.duration+"ms ease-out",t.style.left=i.x+"px",t.style.top=i.y+"px"):(t.style.left=r+n*(i.x-r)+"px",t.style.top=s+n*(i.y-s)+"px",t.style.transform="RangeNavigator"===o.controlName?t.style.transform:"")},end:function(e){o.updateDiv(t,i.x,i.y),o.trigger("animationComplete",{tooltip:o})}})},ir.prototype.updateDiv=function(e,t,i){"Chart"!==this.controlName||!this.shared||this.crosshair||this.enableRTL?(e.style.left=t+"px",e.style.top=i+"px",e.style.transform="RangeNavigator"===this.controlName?e.style.transform:""):(e.style.transform="translate("+t+"px,"+i+"px)",e.style.left="",e.style.top="")},ir.prototype.updateTemplateFn=function(){if(this.template)try{"function"!=typeof this.template&&document.querySelectorAll(this.template).length?this.templateFn=oo(document.querySelector(this.template).innerHTML.trim()):this.templateFn=oo(this.template)}catch(e){this.templateFn=oo(this.template)}},ir.prototype.fadeOut=function(){var t=this,e=this.isCanvas&&!this.template?Bo(this.element.id+"_svg"):Bo(this.element.id),i=Bo(this.element.id);if(e){var n=e.firstChild;if(n.nodeType!==Node.ELEMENT_NODE&&(n=e.firstElementChild),!(n=this.isCanvas&&!this.template?document.getElementById(this.element.id+"_group")?document.getElementById(this.element.id+"_group"):n:n))return null;var o=je(o=parseFloat(n.getAttribute("opacity")))?1:o;new Vt({}).animate(n,{duration:200,progress:function(e){t.progressAnimation(n,o,e.timeStamp/e.duration)},end:function(){t.fadeOuted=!0,t.endAnimation(n),i.style.transition=""}})}},ir.prototype.progressAnimation=function(e,t,i){e.style.animation="",e.setAttribute("opacity",(t-i).toString())},ir.prototype.endAnimation=function(e){e.setAttribute("opacity","0"),this.template&&(e.style.display="none"),this.trigger("animationComplete",{tooltip:this})},ir.prototype.getPersistData=function(){return this.addOnPersist([])},ir.prototype.getModuleName=function(){return"tooltip"},ir.prototype.destroy=function(){er.prototype.destroy.call(this),this.element.classList.remove("e-tooltip")},W([e(!(ir.prototype.onPropertyChanged=function(e,t){this.blazorTemplate&&so(this.element.id+"parent_template_blazorTemplate"),this.isFirst=!1,this.render()}))],ir.prototype,"enable",void 0),W([e(!1)],ir.prototype,"shared",void 0),W([e(!1)],ir.prototype,"crosshair",void 0),W([e(!1)],ir.prototype,"enableShadow",void 0),W([e(null)],ir.prototype,"fill",void 0),W([e("")],ir.prototype,"header",void 0),W([e(.75)],ir.prototype,"opacity",void 0),W([t({size:"12px",fontWeight:null,color:null,fontStyle:"Normal",fontFamily:null},Wo)],ir.prototype,"textStyle",void 0),W([e(null)],ir.prototype,"template",void 0),W([e(!0)],ir.prototype,"enableAnimation",void 0),W([e(300)],ir.prototype,"duration",void 0),W([e(!1)],ir.prototype,"inverted",void 0),W([e(!1)],ir.prototype,"isNegative",void 0),W([t({color:null,width:null},qo)],ir.prototype,"border",void 0),W([e([])],ir.prototype,"content",void 0),W([e(10)],ir.prototype,"markerSize",void 0),W([t({x:0,y:0},Zo)],ir.prototype,"clipBounds",void 0),W([e([])],ir.prototype,"palette",void 0),W([e([])],ir.prototype,"shapes",void 0),W([t({x:0,y:0},Zo)],ir.prototype,"location",void 0),W([e(0)],ir.prototype,"offset",void 0),W([e(4)],ir.prototype,"rx",void 0),W([e(4)],ir.prototype,"ry",void 0),W([e(5)],ir.prototype,"marginX",void 0),W([e(5)],ir.prototype,"marginY",void 0),W([e(7)],ir.prototype,"arrowPadding",void 0),W([e(null)],ir.prototype,"data",void 0),W([e("Material")],ir.prototype,"theme",void 0),W([t({x:0,y:0,width:0,height:0},Xo)],ir.prototype,"areaBounds",void 0),W([e(null)],ir.prototype,"availableSize",void 0),W([e()],ir.prototype,"blazorTemplate",void 0),W([e(!1)],ir.prototype,"isCanvas",void 0),W([e(!1)],ir.prototype,"isTextWrap",void 0),W([e(!1)],ir.prototype,"isFixed",void 0),W([e(null)],ir.prototype,"tooltipPlacement",void 0),W([e(null)],ir.prototype,"controlInstance",void 0),W([e("")],ir.prototype,"controlName",void 0),W([e(!1)],ir.prototype,"showNearestTooltip",void 0),W([i()],ir.prototype,"tooltipRender",void 0),W([i()],ir.prototype,"loaded",void 0),W([i()],ir.prototype,"animationComplete",void 0),W([e(!1)],ir.prototype,"enableRTL",void 0),W([e(!1)],ir.prototype,"allowHighlight",void 0),W([e(!0)],ir.prototype,"showHeaderLine",void 0);var er,tr=W([Bt],ir);function ir(e,t){return er.call(this,e,t)||this}var nr,or,rr="beforePrint",sr="itemRendering",ar="drillStart",lr="drillEnd",hr="itemSelected",dr="itemHighlight",pr="tooltipRendering",cr="itemClick",ur="itemMove",gr="click",mr="doubleClick",fr="rightClick",yr="mouseMove",vr="legendItemRendering",br="legendRendering",wr="resize",Cr="Roboto, Segoe UI, Noto, Sans-serif",tn=(nr=function(e,t){return(nr=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])}))(e,t)},function(e,t){function i(){this.constructor=e}nr(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),W=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Sr=(tn(Ar,or=n),W([e("#808080")],Ar.prototype,"color",void 0),W([e(0)],Ar.prototype,"width",void 0),Ar);function Ar(){return null!==or&&or.apply(this,arguments)||this}tn(Tr,xr=n),W([e(10)],Tr.prototype,"left",void 0),W([e(10)],Tr.prototype,"right",void 0),W([e(10)],Tr.prototype,"top",void 0),W([e(10)],Tr.prototype,"bottom",void 0);var xr,Ir=Tr;function Tr(){return null!==xr&&xr.apply(this,arguments)||this}tn(Mr,Er=n),W([e(null)],Mr.prototype,"size",void 0),W([e(null)],Mr.prototype,"color",void 0),W([e(Cr)],Mr.prototype,"fontFamily",void 0),W([e("")],Mr.prototype,"fontWeight",void 0),W([e("Normal")],Mr.prototype,"fontStyle",void 0),W([e(1)],Mr.prototype,"opacity",void 0);var Er,Dr=Mr;function Mr(){return null!==Er&&Er.apply(this,arguments)||this}tn(Br,kr=n),W([e("")],Br.prototype,"text",void 0),W([e("")],Br.prototype,"description",void 0);var kr,Pr=Br;function Br(){return null!==kr&&kr.apply(this,arguments)||this}tn(Rr,Fr=Pr),W([t({fontFamily:null,fontWeight:null},Dr)],Rr.prototype,"textStyle",void 0),W([e("Center")],Rr.prototype,"alignment",void 0);var Fr,Lr=Rr;function Rr(){return null!==Fr&&Fr.apply(this,arguments)||this}tn(Vr,Or=Pr),W([t({fontFamily:null,fontWeight:null},Dr)],Vr.prototype,"textStyle",void 0),W([e("Center")],Vr.prototype,"alignment",void 0),W([t({},Lr)],Vr.prototype,"subtitleSettings",void 0);var Or,Nr=Vr;function Vr(){return null!==Or&&Or.apply(this,arguments)||this}tn(zr,_r=n),W([e(null)],zr.prototype,"from",void 0),W([e(null)],zr.prototype,"to",void 0),W([e(null)],zr.prototype,"color",void 0),W([e(null)],zr.prototype,"label",void 0),W([e(null)],zr.prototype,"value",void 0),W([e(null)],zr.prototype,"minOpacity",void 0),W([e(null)],zr.prototype,"maxOpacity",void 0),W([e(!0)],zr.prototype,"showLegend",void 0);var _r,Hr=zr;function zr(){return null!==_r&&_r.apply(this,arguments)||this}tn(Qr,jr=n),W([e(!1)],Qr.prototype,"visible",void 0),W([e("Default")],Qr.prototype,"mode",void 0),W([e("transparent")],Qr.prototype,"background",void 0),W([e("Circle")],Qr.prototype,"shape",void 0),W([e("")],Qr.prototype,"width",void 0),W([e("")],Qr.prototype,"height",void 0),W([t({size:null,fontFamily:null,fontWeight:null},Dr)],Qr.prototype,"textStyle",void 0),W([e(null)],Qr.prototype,"fill",void 0),W([e(1)],Qr.prototype,"opacity",void 0),W([e(15)],Qr.prototype,"shapeWidth",void 0),W([e(15)],Qr.prototype,"shapeHeight",void 0),W([e(10)],Qr.prototype,"shapePadding",void 0),W([e(null)],Qr.prototype,"imageUrl",void 0),W([t({color:null,width:null},Sr)],Qr.prototype,"border",void 0),W([t({color:"#000000",width:0},Sr)],Qr.prototype,"shapeBorder",void 0),W([t({},Pr)],Qr.prototype,"title",void 0),W([t({size:null,fontFamily:null,fontWeight:null},Dr)],Qr.prototype,"titleStyle",void 0),W([e("Bottom")],Qr.prototype,"position",void 0),W([e("None")],Qr.prototype,"orientation",void 0),W([e(!1)],Qr.prototype,"invertedPointer",void 0),W([e("After")],Qr.prototype,"labelPosition",void 0),W([e("None")],Qr.prototype,"labelDisplayMode",void 0),W([e("Center")],Qr.prototype,"alignment",void 0),W([e({x:0,y:0})],Qr.prototype,"location",void 0),W([e(null)],Qr.prototype,"showLegendPath",void 0),W([e(null)],Qr.prototype,"valuePath",void 0),W([e(!1)],Qr.prototype,"removeDuplicateLegend",void 0);var jr,Wr=Qr;function Qr(){return null!==jr&&jr.apply(this,arguments)||this}tn(Gr,Ur=n),W([e(null)],Gr.prototype,"groupIndex",void 0),W([e(null)],Gr.prototype,"groupName",void 0);var Ur,qr=Gr;function Gr(){return null!==Ur&&Ur.apply(this,arguments)||this}tn(Kr,Yr=n),W([e(null)],Kr.prototype,"fill",void 0),W([e(!1)],Kr.prototype,"autoFill",void 0),W([t({},Sr)],Kr.prototype,"border",void 0),W([e(0)],Kr.prototype,"gap",void 0),W([e(10)],Kr.prototype,"padding",void 0),W([e(1)],Kr.prototype,"opacity",void 0),W([e(!0)],Kr.prototype,"showLabels",void 0),W([e(null)],Kr.prototype,"labelPath",void 0),W([e(null)],Kr.prototype,"labelFormat",void 0),W([e("TopLeft")],Kr.prototype,"labelPosition",void 0),W([t({color:null,size:null,fontFamily:null},Dr)],Kr.prototype,"labelStyle",void 0),W([e(null)],Kr.prototype,"labelTemplate",void 0),W([e("Center")],Kr.prototype,"templatePosition",void 0),W([e("Trim")],Kr.prototype,"interSectAction",void 0),W([kt([],Hr)],Kr.prototype,"colorMapping",void 0);var Yr,Xr=Kr;function Kr(){return null!==Yr&&Yr.apply(this,arguments)||this}tn($r,Jr=n),W([e(!1)],$r.prototype,"visible",void 0),W([e("")],$r.prototype,"template",void 0),W([e(null)],$r.prototype,"format",void 0),W([e(null)],$r.prototype,"fill",void 0),W([e(.75)],$r.prototype,"opacity",void 0),W([e(["Circle"])],$r.prototype,"markerShapes",void 0),W([t({width:null,color:null},Sr)],$r.prototype,"border",void 0),W([t({fontFamily:null,size:null,fontWeight:null,opacity:null},Dr)],$r.prototype,"textStyle",void 0);var Jr,Zr=$r;function $r(){return null!==Jr&&Jr.apply(this,arguments)||this}tn(is,es=n),W([e(!1)],is.prototype,"enable",void 0),W([e(null)],is.prototype,"fill",void 0),W([e("0.5")],is.prototype,"opacity",void 0),W([t({},Sr)],is.prototype,"border",void 0),W([e("Item")],is.prototype,"mode",void 0);var es,ts=is;function is(){return null!==es&&es.apply(this,arguments)||this}tn(os,ns=n),W([e(!1)],os.prototype,"enable",void 0),W([e("#808080")],os.prototype,"fill",void 0),W([e("0.5")],os.prototype,"opacity",void 0),W([t({},Sr)],os.prototype,"border",void 0),W([e("Item")],os.prototype,"mode",void 0);var ns,o=os;function os(){return null!==ns&&ns.apply(this,arguments)||this}tn(ss,rs=n),W([e(null)],ss.prototype,"groupPath",void 0),W([e(0)],ss.prototype,"groupGap",void 0),W([e(10)],ss.prototype,"groupPadding",void 0),W([t({},Sr)],ss.prototype,"border",void 0),W([e(null)],ss.prototype,"fill",void 0),W([e(!1)],ss.prototype,"autoFill",void 0),W([e(1)],ss.prototype,"opacity",void 0),W([e(!0)],ss.prototype,"showHeader",void 0),W([e(20)],ss.prototype,"headerHeight",void 0),W([e(null)],ss.prototype,"headerTemplate",void 0),W([e(null)],ss.prototype,"headerFormat",void 0),W([e("Near")],ss.prototype,"headerAlignment",void 0),W([t({color:null,size:"13px",fontFamily:null},Dr)],ss.prototype,"headerStyle",void 0),W([e("TopLeft")],ss.prototype,"templatePosition",void 0),W([kt([],Hr)],ss.prototype,"colorMapping",void 0);var rs,tn=ss;function ss(){return null!==rs&&rs.apply(this,arguments)||this}var as=function(e,t){this.width=e,this.height=t};function ls(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}var hs=function(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n},ds=function(e,t,i,n,o,r){this.y=o.y,this.x=o.x,this.height=o.height,this.width=o.width,this.id=e,this.fill=t,this.opacity=n,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=r},ps=function(e,t,i,n,o,r,s){this.id=e,this.opacity=o,this.fill=t,this.stroke=n,this["stroke-width"]=i,this["stroke-dasharray"]=r,this.d=s};function cs(e,t){var i=document.getElementById("treeMapMeasureText");return null===i&&(i=Q("text",{id:"treeMapMeasureText"}),document.body.appendChild(i)),i.innerHTML=go.sanitize(e),i.style.position="absolute",i.style.fontSize=t.size,i.style.fontWeight=t.fontWeight,i.style.fontStyle=t.fontStyle,i.style.fontFamily=t.fontFamily,i.style.visibility="hidden",i.style.top="-100",i.style.left="0",i.style.whiteSpace="nowrap",i.style.lineHeight="normal",new as(i.clientWidth,i.clientHeight)}var us=function(e,t,i,n,o,r,s,a){void 0===r&&(r=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=r,this.anchor=n,this.x=t,this.y=i,this.baseLine=s,this.connectorText=a};function gs(e,t,i){var n=t;if(e<cs(t,i).width)for(var o=t.length-1;0<=o;--o)if(cs(n=t.substring(0,o)+"...",i).width<=e||n.length<4)return n=n.length<4?" ":n;return n}var ms=function(e,t){this.x=e,this.y=t};function fs(e,t,i,n){var o;switch(t){case"Near":o=e.x;break;case"Center":o="title"===n?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":o="title"===n?e.width-e.y-i.width:e.x+e.width-i.width}t="title"===n?e.y+i.height/2:e.y+e.height/2+i.height/2;return new ms(o,t)}function ys(e,t,i){e=e.createText(t,i);return e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.style["user-select"]="none",e.style["-moz-user-select"]="none",e.style["-webkit-touch-callout"]="none",e.style["-webkit-user-select"]="none",e.style["-khtml-user-select"]="none",e.style["-ms-user-select"]="none",e.style["-o-user-select"]="none",e}function vs(e,t,i,n,o){void 0===o&&(o=!1);var r,s,a={"font-size":t.size,"font-style":t.fontStyle,"font-family":t.fontFamily,"font-weight":t.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:t.opacity,"dominant-baseline":e.baseLine,id:e.id,x:e.x,y:e.y,fill:i},i="string"==typeof e.text?e.text:o?e.text[e.text.length-1]:e.text[0],l=new fo("");if(!je(i)&&!je(e.connectorText)&&0<=i.search(e.connectorText[1]))for(var h=i.split("#"),d=0;d<h.length;d++){var p=-1===h[d].search(e.connectorText)||je(e.connectorText)?h[d]:e.connectorText,p=(a.id=e.id+"_"+d,s=ys(l,a,p),d%2==0&&0!==d&&(p=p.replace(/\s+/g,"&nbsp")),cs(p,t));a.x=0!==d?a.x+p.width:a.x+p.width+5,n.appendChild(s)}else s=ys(l,a,i),n.appendChild(s);if("string"!=typeof e.text&&1<e.text.length){for(var c=1,u=e.text.length;c<u;c++)r=cs(e.text[c],t).height,r=l.createTSpan({x:e.x,id:e.id,y:e.y+c*r},e.text[c]),s.appendChild(r);n.appendChild(s)}return s}function bs(e,t,i){var n=e.split("_RectPath")[0],e=-1<e.indexOf("_LabelTemplate")?t:document.querySelector("#"+n+"_LabelTemplate");je(e)||(e.innerHTML=i)}function ws(e){return document.getElementById(e)}function Cs(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function Ss(e,t,i,n){for(var o=!1,r="",s=n.leafItemSettings,a=0;a<e.length;a++){var l=i[n.levels[a]?n.levels[a].groupPath:s.labelPath||n.weightValuePath]||"undefined";if(e[a]===l&&(r+=l+(a===e.length-1?"":"#"))===t){o=!0;break}}return o}function As(e){if(e)for(var t=Object.keys(e),i={},n=0;n<t.length;n++)if(e[t[n]]instanceof Array){i.values=e[t[n]],i.key=t[n];break}return i}function xs(e,t,i,n){if("Child"===i){t.push(e.levelOrderName);var o=As(e).values;if(o&&0<o.length){for(var r=0;r<o.length;r++)-1===t.indexOf(o[r].levelOrderName)&&t.push(o[r].levelOrderName);for(var s=0;s<o.length;s++)xs(o[s],t,i,n)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),xs(e.parent,t,i,n));else if("All"===i)for(var a=e.levelOrderName.split("#")[0],l=void 0,r=0;r<n.layout.renderItems.length;r++)-1<(l=n.layout.renderItems[r]).levelOrderName.indexOf(a)&&-1===t.indexOf(l.levelOrderName)&&t.push(l.levelOrderName);else t.push(e.levelOrderName);return t}function Is(t){var i=null;try{i="function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){i=oo(t)}return i}function Ts(e,t,i){for(var n=Q("div",{id:t}),o=(n.style.cssText="position: absolute;pointer-events: auto;",e.length);0<o;)n.appendChild(e[0]),o--;for(var r=n.innerHTML,s=Object.keys(i),a=0;a<s.length;a++)var l=RegExp,r=r.replace(new l("{{:"+s[a]+"}}","g"),i[s[a].toString()]);return n.innerHTML=r,n}function Es(e,t,i,n,o){var r=new ms(0,0),s="Template"===n?o.areaRect.x:0,a="Template"===n?o.areaRect.y:0;return r.x=Math.abs(s-(-1<t.indexOf("Left")?e.x+5:-1<t.indexOf("Right")?e.x+e.width-i.width:e.x+(e.width/2-i.width/2)))-2,!o.enableDrillDown||"BottomLeftTopRight"!==o.renderDirection&&"BottomRightTopLeft"!==o.renderDirection?r.y=Math.abs(a-(-1<t.indexOf("Top")?"Template"===n?e.y:e.y+i.height:-1<t.indexOf("Bottom")?e.y+e.height-i.height:"Template"===n?e.y+(e.height/2-i.height/2):e.y+e.height/2+i.height/4)):r.y=Math.abs(e.y+e.height-i.height+5),r}function Ds(e,t){var i=new as(0,0),t=(t.appendChild(e),i.height=e.offsetHeight,i.width=e.offsetWidth,document.getElementById(e.id));return t.parentNode.removeChild(t),i}function Ms(e){return(e.width-e.x)*(e.height-e.y)}function ks(e){var e=Ps(e),t=e.width,e=e.height;return Math.min(t,e)}function Ps(e){var t=e.x,i=e.y;return{x:t,y:i,width:e.width-t,height:e.height-i}}function Bs(e){var t=e.x,i=e.y;return{x:t,y:i,width:t+e.width,height:i+e.height}}function Fs(e,t,i){var n=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,r=i.ownerDocument.defaultView.pageYOffset,s=i.ownerDocument.documentElement.clientTop,i=i.ownerDocument.documentElement.clientLeft,o=n.left+o-i,i=n.top+r-s;return new ms(e-o,t-i)}function Ls(e,t,i){var n,o,r=[];if(je(t)&&je(i)&&isNaN(i))return null;for(var s=0;s<e.length;s++){var a=!1,l=i;je(e[s].from)||je(e[s].to)||je(e[s].value)?(je(e[s].from)||je(e[s].to))&&je(e[s].value)||(i>=e[s].from&&e[s].to>=i||e[s].value===t)&&(e[s].value===t&&(a=!0),n="[object Array]"===Object.prototype.toString.call(e[s].color)?a?e[s].color[0]:Os(e[s],l):e[s].color):i>=e[s].from&&e[s].to>=i&&e[s].value===t&&(a=!0,n="[object Array]"===Object.prototype.toString.call(e[s].color)?a?e[s].color[0]:Os(e[s],l):e[s].color),(i>=e[s].from&&i<=e[s].to||e[s].value===t)&&!je(e[s].minOpacity)&&!je(e[s].maxOpacity)&&n&&(o=Rs(e[s],i)),(""===n||je(n))&&je(e[s].from)&&je(e[s].to)&&je(e[s].minOpacity)&&je(e[s].maxOpacity)&&je(e[s].value)&&(n="[object Array]"===Object.prototype.toString.call(e[s].color)?e[s].color[0]:e[s].color),o=je(o)?"1":o,r.push(n)}for(var h=r.length-1;0<=h;h--)h=(n=r[h])?-1:h;return{fill:n,opacity:o}}function Rs(e,t){var i=1;return(i=t>=e.from&&t<=e.to?(t-e.from)/(e.to-e.from)*(e.maxOpacity-e.minOpacity)+e.minOpacity:i).toString()}function Os(e,t){return Vs(e,t)}function Ns(e,t,i){return"#"+ea(e)+ea(t)+ea(i)}function Vs(e,t){return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:Ns((t=_s(Number(t),e)).r,t.g,t.b)}function _s(e,t){var i=t.from,n=t.to,o=0,r=n-i,o=(e-i)/r;if(t.color.length<=2)a="#"===t.color[0].charAt(0)?t.color[0]:ia(t.color[0]),l="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:ia(t.color[t.color.length-1]);else{for(var s,a="#"===t.color[0].charAt(0)?t.color[0]:ia(t.color[0]),l="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:ia(t.color[t.color.length-1]),h=r/(t.color.length-1),d=t.color.length-1,p=[],c=1;c<d;c++)s={b:i+c*h,color:t.color[c]},p.push(s);for(var u=0;u<p.length;u++)i<=e&&e<=p[u].b&&0===u?(l="#"===p[u].color.charAt(0)?p[u].color:ia(p[u].color),o=e<p[u].b?1-Math.abs((e-p[u].b)/h):(e-p[u].b)/h):p[u].b<=e&&e<=n&&u===p.length-1&&(a="#"===p[u].color.charAt(0)?p[u].color:ia(p[u].color),o=e<p[u].b?1-Math.abs((e-p[u].b)/h):(e-p[u].b)/h),u!==p.length-1&&u<p.length&&p[u].b<=e&&e<=p[u+1].b&&(a="#"===p[u].color.charAt(0)?p[u].color:ia(p[u].color),l="#"===p[u+1].color.charAt(0)?p[u+1].color:ia(p[u+1].color),o=Math.abs(e-p[u+1].b)/h)}return Hs(o,a,l)}function Hs(e,t,i){var i=i.split("#")[1],t=t.split("#")[1],n=zs(e,parseInt(t.substr(0,2),16),parseInt(i.substr(0,2),16)),o=zs(e,parseInt(t.substr(2,2),16),parseInt(i.substr(2,2),16)),e=zs(e,parseInt(t.substr(4,2),16),parseInt(i.substr(4,2),16));return new Zs(n,o,e)}function zs(e,t,i){return Math.round(t+(i-t)*e)}function js(e,t,i){for(var n,o=t.split(" "),r="",s=[],a=0,l=o.length;a<l;a++)n=o[a],cs(r.concat(n),i).width<e?r=r.concat((""===r?"":" ")+n):""!==r?(s.push(gs(e,r,i)),r=n):s.push(gs(e,n,i)),r&&a===l-1&&s.push(gs(e,r,i));return s}function Ws(e,t,i){var n=[],o=0,r=cs(t,i).width,s=t.length;if(r<=e)n.push(t);else for(var a=t.length;o<a;a--){var l=t.slice(o,a);if(cs(l,i).width<=e){if(n.push(l),s===(o+=l.length))return n;a=s+1}}return n}function Qs(e,t,i,n){n=cs(i,n);return n.width>e||n.height>t?" ":i}function Us(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function qs(e,t,i){var n=e.levelSelection;if(n)for(var o=0;o<n.length;o++)t.getAttribute("id")===n[o]||t.children[0].id===n[o]?0<t.childElementCount&&-1===t.children[0].id.indexOf("_Group")&&(t.children[0].setAttribute("class",i),Xs(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function Gs(e,t){var i=e.legendId;if(i)for(var n=0;n<i.length;n++)if("Interactive"===e.legendSettings.mode)for(var o,r=0;r<t.childElementCount;r++)t.childNodes[r].id!==i[n]&&parseFloat(t.childNodes[r].id.split("Index_")[1])!==parseFloat(i[n].split("Index_")[1])||((o=t.childNodes[r]).setAttribute("fill",e.selectionSettings.fill),o.setAttribute("opacity",e.selectionSettings.opacity),-1===o.id.indexOf("Text")?(o.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),o.setAttribute("stroke",e.selectionSettings.border.color)):(o.setAttribute("stroke",null),o.setAttribute("stroke-width",null)));else{var s=document.getElementById(i[n]);je(s)||(s.setAttribute("fill",e.selectionSettings.fill),s.setAttribute("opacity",e.selectionSettings.opacity),-1===s.id.indexOf("Text")?(s.setAttribute("stroke",e.selectionSettings.border.color),s.setAttribute("stroke-width",e.selectionSettings.border.width.toString())):(s.setAttribute("stroke",null),s.setAttribute("stroke-width",null)))}}function Ys(e,t,i){for(var n,o,r=0;r<e.length;r++)n=je(e[r].childNodes[0])?e[r]:e[r].childNodes[0],o=i.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])].options,Xs(n,o),e[r].classList.remove(t),--r}function Xs(e,t){e.setAttribute("opacity",t.opacity),je(t.fill)?e.setAttribute("fill","black"):e.setAttribute("fill",t.fill),e.setAttribute("stroke",t.border.color),e.setAttribute("stroke-width",t.border.width)}function Ks(e,t,i){if(je(e))return null;for(var n=0,o=Object.keys(t);n<o.length;n++){var r=o[n];e=e.split("${"+r+"}").join(Js(t[r],i).toString())}return e}function Js(e,t){t=t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e;return t||""}var Zs=function(e,t,i){this.r=e,this.g=t,this.b=i};function $s(e){return"#"+ea(e.r)+ea(e.g)+ea(e.b)}function ea(e){e=e.toString(16);return 1===e.length?"0"+e:e}function ta(e){e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return e?new Zs(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)):new Zs(255,255,255)}function ia(e){e="transparent"===e?"white":e;var t=document.getElementById("treeMapMeasureText"),t=(t.style.color=e,(e=window.getComputedStyle(t).color).replace(/[()RGBrgba ]/g,"").split(","));return $s(new Zs(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10)))}function na(e,t,i,n,o){var r=new fo(""),e=oa(e,i,t,o,n);return r["draw"+e.functionName](e.renderOption)}function oa(e,t,i,n,o){var r,s="Path",a=t.width,l=t.height,h=e.x,d=e.y,p=e.x+-a/2,c=e.y+-l/2;switch(i){case"Circle":case"Bubble":s="Ellipse",I(n,{rx:a/2,ry:l/2,cx:h,cy:d});break;case"VerticalLine":I(n,{d:r="M "+h+" "+(d+l/2)+" L "+h+" "+(d+-l/2)});break;case"Diamond":I(n,{d:r="M "+p+" "+d+" L "+h+" "+(d+-l/2)+" L "+(h+a/2)+" "+d+" L "+h+" "+(d+l/2)+" L "+p+" "+d+" z"});break;case"Rectangle":I(n,{d:r="M "+p+" "+(d+-l/2)+" L "+(h+a/2)+" "+(d+-l/2)+" L "+(h+a/2)+" "+(d+l/2)+" L "+p+" "+(d+l/2)+" L "+p+" "+(d+-l/2)+" z"});break;case"Triangle":I(n,{d:r="M "+p+" "+(d+l/2)+" L "+h+" "+(d+-l/2)+" L "+(h+a/2)+" "+(d+l/2)+" L "+p+" "+(d+l/2)+" z"});break;case"InvertedTriangle":I(n,{d:r="M "+(h+a/2)+" "+(d-l/2)+" L "+h+" "+(d+l/2)+" L "+(h-a/2)+" "+(d-l/2)+" L "+(h+a/2)+" "+(d-l/2)+" z"});break;case"Pentagon":for(var u,g,m=0;m<=5;m++)u=a/2*Math.cos(Math.PI/180*(72*m)),g=a/2*Math.sin(Math.PI/180*(72*m)),r=0===m?"M "+(h+u)+" "+(d+g)+" ":r.concat("L "+(h+u)+" "+(d+g)+" ");I(n,{d:r=r.concat("Z")});break;case"Star":I(n,{d:r="M "+(e.x+t.width/3)+" "+(e.y-t.height/2)+" L "+(e.x-t.width/2)+" "+(e.y+t.height/6)+" L "+(e.x+t.width/2)+" "+(e.y+t.height/6)+" L "+(e.x-t.width/3)+" "+(e.y-t.height/2)+" L "+e.x+" "+(e.y+t.height/2)+" L "+(e.x+t.width/3)+" "+(e.y-t.height/2)+" Z"});break;case"Cross":I(n,{d:r="M "+p+" "+d+" L "+(h+a/2)+" "+d+" M "+h+" "+(d+l/2)+" L "+h+" "+(d+-l/2)});break;case"Image":s="Image",I(n,{href:o,height:l,width:a,x:p,y:c})}return{renderOption:n,functionName:s}}function ra(e,t){for(var i=!1,n=0;n<e.length;n++)if(t.levelOrderName===e[n].levelOrderName){i=!0;break}return i}function sa(e,t,i,n,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=n,this.sendData=o}function aa(e){if(0<e.length)for(var t=0;t<e.length;t++){var i=e[t];ha(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth)}}function la(e,t){if(0<e.length)for(var i=0;i<e.length;i++)for(var n=e[i],o=parseFloat(n.legendEle.id.split("_Index_")[1]),r=-1<n.legendEle.id.indexOf("Text")?n.legendEle.id.replace("_Text",""):n.legendEle.id,s="Interactive"===t.legendSettings.mode?document.getElementById(r):document.getElementById(t.element.id+"_Legend_Shape_Index_"+o),r="Interactive"===t.legendSettings.mode?document.getElementById(r+"_Text"):document.getElementById(t.element.id+"_Legend_Text_Index_"+o),a=(je(s)||ha(s,n.oldFill,n.oldOpacity,"none","0px"),je(r)||ha(r,t.legendSettings.textStyle.color||t.themeStyle.legendTextColor,n.oldOpacity,null,null),je(n.ShapeCollection)?0:n.ShapeCollection.Elements.length),l=0;l<a;l++){var h=document.getElementById(n.ShapeCollection.Elements[l].id);je(h)||ha(h,n.shapeOldFill,n.shapeOldOpacity,n.shapeOldBorderColor,n.shapeOldBorderWidth)}}function ha(e,t,i,n,o){e.setAttribute("fill",t),e.setAttribute("opacity",i),je(n)||e.setAttribute("stroke",n),je(o)||e.setAttribute("stroke-width",o)}function da(e,t,i){la(e,i),Ys(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function pa(e,t,i){for(var n,o=""!==i.rangeColorValuePath?i.rangeColorValuePath:null,r=!1,s=0;s<e&&!r;s++){var a=i.treeMapLegendModule.legendCollections[s].legendData.length;if(0<a){for(var l=0;l<a;l++)if(!je(o)&&0<i.leafItemSettings.colorMapping.length?i.treeMapLegendModule.legendCollections[s].legendData[l].data[o]===t.data[o]:i.treeMapLegendModule.legendCollections[s].legendData[l].levelOrderName===t.levelOrderName||-1<t.levelOrderName.indexOf(i.treeMapLegendModule.legendCollections[s].legendName)){n=s,r=!0;break}}else if(i.palette&&0<i.palette.length&&(i.treeMapLegendModule.legendCollections[s].levelOrderName===t.levelOrderName||-1<t.levelOrderName.indexOf(i.treeMapLegendModule.legendCollections[s].levelOrderName))&&i.treeMapLegendModule.legendCollections[s].legendName===t.name){n=s;break}}return n}function ca(e,t,i,n,o,r,s){e.push({legendEle:n,oldFill:s[t].legendFill,oldOpacity:s[t].opacity,oldBorderColor:s[t].borderColor,oldBorderWidth:s[t].borderWidth,shapeElement:o,shapeOldFill:r[i].options.fill,shapeOldOpacity:r[i].options.opacity,shapeOldBorderColor:r[i].options.border.color,shapeOldBorderWidth:r[i].options.border.width})}function ua(e,t,i,n){Q("a",{attrs:{download:e+"."+t.toLocaleLowerCase(),href:i}}).dispatchEvent(new MouseEvent(n?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function ga(e){e=document.getElementById(e);return e?ue(e):null}fa.prototype.processLayoutPanel=function(){var e,t,i,n;this.treemap.treemapLevelData.levelsData&&0<this.treemap.treemapLevelData.levelsData.length&&(i=(je(this.treemap.initialDrillDown.groupIndex)||je(this.treemap.initialDrillDown.groupName)||(je(this.treemap.drilledItems)?!je(this.treemap.drilledItems):0!==this.treemap.drilledItems.length)?this.treemap.treemapLevelData.levelsData:this.getDrilldownData(this.treemap.treemapLevelData.levelsData[0],[]))[0],n=Pe({},this.treemap.areaRect,n,!1),je(this.treemap.treeMapLegendModule)||je(this.treemap.totalRect)||"Float"!==this.treemap.legendSettings.position&&(n=this.treemap.totalRect),je(this.treemap.currentLevel)||(je(this.treemap.drilledItems)?je(this.treemap.drilledItems):0===this.treemap.drilledItems.length)?(!je(this.treemap.initialDrillDown.groupIndex)&&(je(this.treemap.drilledItems)?je(this.treemap.drilledItems):0===this.treemap.drilledItems.length)&&(this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex),this.calculateLayoutItems(i||this.treemap.treemapLevelData.levelsData[0],n)):(i=this.treemap.drilledItems.length-1,e=this.treemap.drilledItems[i].data,(t={})[this.treemap.drilledItems[i].data.groupName]=[e],je(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[i].data.groupIndex),this.calculateLayoutItems(t||this.treemap.treemapLevelData.levelsData[0],n)),this.renderLayoutItems())},fa.prototype.getDrilldownData=function(e,t){var i=this.treemap,n={},o=As(e).values;if(o&&0<o.length&&0===t.length){for(var r=0;r<o.length;r++)o[r].groupIndex===i.initialDrillDown.groupIndex&&o[r].name===i.initialDrillDown.groupName&&(o[r].isDrilled=!0,n[o[r].groupName]=[o[r]],t.push(n));for(var s=0;s<o.length;s++)this.getDrilldownData(o[s],t)}return t},fa.prototype.calculateLayoutItems=function(e,t){this.renderItems=[],this.parentData=[],je(this.treemap.weightValuePath)||(-1<this.treemap.layoutType.indexOf("SliceAndDice")?this.computeSliceAndDiceDimensional(e,t):(t.height=t.height+t.y,t.width=t.width+t.x,this.computeSquarifyDimensional(e,t)))},fa.prototype.computeSliceAndDiceDimensional=function(e,t){var i,n,o,r=this.treemap.leafItemSettings,s=this.treemap.levels,a=As(e).values;if(a&&0<a.length&&(this.sliceAndDiceProcess(a,t),0<this.treemap.levels.length))for(var l=0;l<a.length;l++)o=a[l].groupIndex,n=0===s.length||o===s.length?r.gap:s[o].groupGap,o=0===s.length?0:s[o]?s[o].showHeader?s[o].headerHeight:0:s[o-1].showHeader?s[o-1].headerHeight:0,i=a[l].rect,i=new hs(i.x+n/2,i.y+(o+n/2),i.width-n,Math.abs(i.height-(n+o))),this.computeSliceAndDiceDimensional(a[l],i);return e},fa.prototype.sliceAndDiceProcess=function(e,t){var i,n=t.height*t.width,o=this.treemap.levels,r=0,s=0,a=(e.forEach(function(e){s+=e.weight}),e.forEach(function(e){e.weightArea=n*e.weight/s}),"SliceAndDiceAuto"===this.treemap.layoutType?t.width>t.height:"SliceAndDiceHorizontal"===this.treemap.layoutType);e.sort(Cs);for(var l=0;l<e.length;l++){var h=e[l];h.isLeafItem=0===o.length||(this.treemap.isHierarchicalData||je(this.treemap.leafItemSettings.labelPath)?h.groupIndex===o.length-1:h.groupIndex===this.treemap.levels.length),a?(i=n/s*e[l].weight/t.height,r<=t.width&&(e[l].rect=new hs(r+t.x,t.y,i,t.height))):(i=n/s*e[l].weight/t.width,r<=t.height&&(e[l].rect=new hs(t.x,r+t.y,t.width,i))),r+=i,this.renderItems.push(e[l])}},fa.prototype.computeSquarifyDimensional=function(e,t){var i,n,o,r,s=this.treemap.leafItemSettings,a=this.treemap.levels,l=As(e).values;if(l&&0<l.length&&(0===this.parentData.length&&(this.parentData=[],this.parentData.push(l)),this.calculateChildrenLayout(e,l,t),0<this.treemap.levels.length))for(var h=0;h<l.length;h++)r=(n=l[h]).groupIndex,i=n.rect,o=(n.isLeafItem?s.padding:a[r].groupPadding)/2,r=this.treemap.isHierarchicalData?(0!==r||!n.isLeafItem)&&a[r]&&a[r].showHeader?a[r].headerHeight:0:0!==a.length&&a[r]&&a[r].showHeader?a[r].headerHeight:0,i=new hs(i.x+o,i.y+(r+o),i.width-o,i.height-o),!n.isLeafItem&&0<n.weight&&this.computeSquarifyDimensional(l[h],i)},fa.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,Ms(i)),t.sort(Us),this.performRowsLayout(t,[],i,[])},fa.prototype.performRowsLayout=function(e,t,i,n){var o=e.length;if(0===o)return d=this.getCoordinates(t,i),n.concat(d);var r=ks(i),s=e[0],o=e.slice(1,o);if(this.aspectRatio(t,s,r))return r=t.concat(s),this.performRowsLayout(o,r,i,n);for(var a=t.length,l=0,h=0;h<a;h+=1)l+=t[h].itemArea;var s=this.cutArea(i,l),d=this.getCoordinates(t,i),o=n.concat(d);return this.performRowsLayout(e,[],s,o)},fa.prototype.aspectRatio=function(e,t,i){return 0===e.length||(t=e.concat(t),e=this.findMaxAspectRatio(e,i),this.findMaxAspectRatio(t,i)<=e)},fa.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,n=1/0,o=-1/0,r=0,s=0;s<i;s+=1){var a=e[s].itemArea;a<n&&(n=a),o<a&&(o=a),r+=a}return Math.max(Math.pow(t,2)*o/Math.pow(r,2),Math.pow(r,2)/(Math.pow(t,2)*n))},fa.prototype.cutArea=function(e,t){var i,e=Ps(e),n=e.width,o=e.height,r=e.x,e=e.y;return Bs(o<=n?{x:r+(i=t/o),y:e,width:n-i,height:o}:{x:r,y:e+(i=t/n),width:n,height:o-i})},fa.prototype.getCoordinates=function(e,t){for(var i=Ps(t),n=i.width,o=i.height,r=i.x,i=i.y,s=e.length,a=this.treemap.levels,l=this.treemap.leafItemSettings,h=0,d=0;d<s;d+=1)h+=e[d].itemArea;for(var p,c,u=h/o,g=h/n,m=r,f=i,y=[],d=0;d<s;d+=1){var v,b=e[d],w=b.groupIndex;b.isLeafItem=0===a.length||(this.treemap.isHierarchicalData||!je(l.labelPath))&&w===a.length,c=(p=ra(this.parentData[0],b))?this.treemap.areaRect:b.parent.rect,w=b.isLeafItem?l.padding:a[w].groupPadding,o<=n?(v=f+b.itemArea/u,b.rect={x:m,y:f,width:m+u,height:v},f=v):(v=m+b.itemArea/g,b.rect={x:m,y:f,width:v,height:f+g},m=v),0<b.weight&&(p||Math.round(t.y+w/2)<=Math.round(c.y+(c.height-c.y))&&Math.round(t.x+w/2)<=Math.round(c.x+(c.width-c.x)))&&(this.renderItems.push(b),y.push(b))}return y},fa.prototype.computeTotalArea=function(e,t){for(var i=e.length,n=[],o=0;o<i;o+=1){for(var r=e.length,s=0,a=0;a<r;a+=1)s+=e[a].weight;for(var l=t/s,h=void 0,d=0;d<r;d++)(h=e[d]).itemArea=h.weight*l,n.push(h)}return n},fa.prototype.onDemandProcess=function(e){var t,i=e[0].parent;this.treemap.currentLevel=i.isDrilled?i.groupIndex:null;for(var n={},o=(je(i.groupName)?n=i:n[i.groupName]=[i],t=Pe({},this.treemap.areaRect,t,!1),je(this.treemap.treeMapLegendModule)||je(this.treemap.totalRect)||(t=this.treemap.totalRect),this.treemap.levels.length),r=0;r<o;r++)o===e[0].groupIndex?this.treemap.levels[o]=this.treemap.levels[r]:this.treemap.levels.splice(o-1,1);this.calculateLayoutItems(n,t),this.renderLayoutItems()},fa.prototype.renderLayoutItems=function(){for(var a,l,h,d,p,c,u,g,m,f,y,v,b,w,C,S,A,x,I=this,T=this.treemap,E=(this.renderer=T.renderer,T.element.id),e=T.layoutType,D=this.treemap.leafItemSettings.interSectAction,M="",k=document.getElementById(T.element.id+"_Secondary_Element"),P=T.levels,B=(this.layoutGroup=this.renderer.createGroup({id:E+"_TreeMap_"+e+"_Layout"}),Q("div",{id:T.element.id+"_Label_Template_Group",className:"template"})),F=(B.style.cssText="overflow: hidden; position: absolute;pointer-events: none;top:"+T.areaRect.y+"px;left:"+T.areaRect.x+"px;height:"+T.areaRect.height+"px;width:"+T.areaRect.width+"px;",!1),L=T.leafItemSettings,R=this,t=0;t<this.renderItems.length;t++)!function(e){if(g=R.renderItems[e],d=g.groupIndex,R.treemap.drillDownView&&je(R.treemap.currentLevel)&&0<d||R.treemap.drillDownView&&d>R.treemap.currentLevel+1)return;c=g.rect,F=g.isLeafItem,y=E+"_Level_Index_"+d+"_Item_Index_"+e,w=R.renderer.createGroup({id:y+"_Group"}),A=(F?L.gap:P[d].groupGap)/2;var t,e=R.treemap.totalRect?T.legendSettings.visible?R.treemap.totalRect:Ps(R.treemap.totalRect):R.treemap.areaRect;"Squarified"===T.layoutType&&(c.width=Math.abs(c.x-c.width)-A,c.height=Math.abs(c.y-c.height)-A),"TopRightBottomLeft"===T.renderDirection?c.x=e.x+e.width-c.width-Math.abs(e.x-c.x):"BottomLeftTopRight"===T.renderDirection?c.y=e.y+e.height-c.height-Math.abs(e.y-c.y):"BottomRightTopLeft"===T.renderDirection&&(c.x=e.x+e.width-c.width-Math.abs(e.x-c.x),c.y=e.y+e.height-c.height-Math.abs(e.y-c.y)),A=R.getItemColor(F,g),u=A.fill,f=A.opacity,A=F?L.labelFormat:P[d].headerFormat,l=F?L.showLabels:P[d].showHeader,t=d===R.treemap.currentLevel?R.treemap.enableBreadcrumb?(x="#"+R.treemap.breadcrumbConnector+"#",t=g.levelOrderName.replace(/#/gi,x),0!==d?"#"+t:t):g.name:(R.treemap.enableBreadcrumb&&(g.isDrilled=!1),g.name),m=Ks(A,g.data,R.treemap)||t||"undefined",A=As(g).values,m=!F&&A&&0<A.length&&R.treemap.enableDrillDown?g.isDrilled?T.enableRtl?m+" [-]":"[-] "+m:T.enableRtl?m+" [+]":"[+] "+m:m,T.enableHtmlSanitizer&&(m=go.sanitize(m));var e=(F?L.labelStyle:P[d].headerStyle).fontFamily||R.treemap.themeStyle.labelFontFamily,i=(F?L.labelStyle:P[d].headerStyle).size||R.treemap.themeStyle.labelFontSize,n=(F?L.labelStyle:P[d].headerStyle).fontWeight||R.treemap.themeStyle.fontWeight,o=(F?L.labelStyle:P[d].headerStyle).color,r=(F?L.labelStyle:P[d].headerStyle).fontStyle,s=(F?L.labelStyle:P[d].headerStyle).opacity;b={fontFamily:e,size:i,fontWeight:n,color:o,fontStyle:r,opacity:s},S=(F?L:P[d]).border,a=F?L.labelPosition:"Near"===P[d].headerAlignment?"TopLeft":"Center"===P[d].headerAlignment?"TopCenter":"TopRight",p=(F?L:P[d]).templatePosition,C=F?L.labelTemplate:P[d].headerTemplate,g.options={border:S,opacity:f,fill:u},h={cancel:!1,name:sr,treemap:R.treemap,text:m,currentItem:g,RenderItems:R.renderItems,options:g.options,textColor:b.color},R.treemap.trigger(sr,h,function(e){e.cancel||(M=" M "+c.x+" "+c.y+" L "+(c.x+c.width)+" "+c.y+" L "+(c.x+c.width)+" "+(c.y+c.height)+" L "+c.x+" "+(c.y+c.height)+"z",v=new ps(y+"_RectPath",u,S.width,S.color,f,null,M),e=I.renderer.drawPath(v),w.appendChild(e),l&&(h.text!==m&&(h.text=Ks(h.text,g.data,I.treemap)||t),b.color=h.textColor||b.color,I.renderItemText(h.text.toString(),w,b,c,D,y,u,a,x)),C&&!je(v=I.renderTemplate(k,y,c,p,C,g,F))&&(B.appendChild(v),I.treemap.renderReactTemplates()),w.setAttribute("aria-label",g.name),I.treemap.enableDrillDown&&!F||I.treemap.selectionSettings.enable||I.treemap.highlightSettings.enable?(w.setAttribute("role","button"),w.setAttribute("tabindex",I.treemap.tabIndex.toString()),w.style.outline="none",w.style.cursor=(!I.treemap.highlightSettings.enable||I.treemap.selectionSettings.enable||!I.treemap.enableDrillDown||g.groupIndex!==I.treemap.levels.length-1)&&(!I.treemap.highlightSettings.enable||I.treemap.selectionSettings.enable||I.treemap.enableDrillDown)?"pointer":"default"):w.setAttribute("role","region"),qs(I.treemap,w,"treeMapSelection"),I.layoutGroup.appendChild(w))})}(t);0<B.childNodes.length&&k.appendChild(B),this.treemap.svgObject.appendChild(this.layoutGroup),qs(this.treemap,this.layoutGroup,"treeMapSelection")},fa.prototype.renderItemText=function(e,t,i,n,o,r,s,a,l){var h=[],d=0,p=-1!==e.indexOf("<br>")?e.split("<br>"):null,c=this.labelInterSectAction(n,e,i,o),u=cs(p&&p[0]||c[0],i),e=(this.treemap.enableRtl&&(b=cs(e,i),v=e.search("[+]")||e.search("[-]"),n.width<b.width)&&0<v&&(b=e.substring(v-1,e.length),v=cs("[+]",i),c[0]=gs(n.width-v.width-5,c[0],i)+b),Es(n,a,u,"Text",this.treemap));if(!je(p)){for(var g,m=[],f=[],y=0;y<p.length;y++)d+=(u=cs(g=gs(n.width-5,p[y],i),i)).height,f.push(u.width),m.push(g);c=m,u.width=Math.max.apply(null,f),u.height=d}if("WrapByWord"===o||"Wrap"===o||"Trim"===o){for(var v,b,w=0;w<c.length;w++)d+=(u=cs(c[w],i)).height,n.height-5>d&&h.push(c[w]);"Wrap"===o&&c.length!==h.length&&h.length&&(b=(b=h[v=h.length-1]).substring(0,b.length-1)+"...",h.splice(v),"..."!==b)&&h.push(b)}else a=c,h.push(a);vs(new us(r+"_Text",e.x,e.y,"start",h,"","",l),i,i.color||this.getSaturatedColor(s),t)},fa.prototype.getItemColor=function(e,t){var i=this.treemap,n=(e?i.leafItemSettings:i.levels[t.groupIndex]).fill,o=(e?i.leafItemSettings:i.levels[t.groupIndex]).opacity,r=(je(i.treemapLevelData.defaultLevelsData)||0<i.treemapLevelData.defaultLevelsData.length&&(i.treemapLevelData.levelsData=i.treemapLevelData.defaultLevelsData),As(i.treemapLevelData.levelsData[0]).values),e=(e?i.leafItemSettings:i.levels[t.groupIndex]).colorMapping;if(0<e.length){e=Ls(e,t.data[i.equalColorValuePath],t.data[i.rangeColorValuePath]);je(e)||(n=(je(e.fill)?i.leafItemSettings:e).fill,o=e.opacity)}else for(var s=0;s<r.length;s++)r[s].levelOrderName===t.levelOrderName.split("#")[0]&&(n=je(n)?je(i.colorValuePath)?je(t.options)?!je(i.palette)&&0<i.palette.length?i.palette[s%i.palette.length]:"#808080":t.options.fill:r[s].data[i.colorValuePath]:n);return{fill:n,opacity:o}},fa.prototype.getSaturatedColor=function(e){var t=e,e=ta(ia("transparent"===e?window.getComputedStyle(document.body,null).backgroundColor:t));return 128<=Math.round((299*e.r+587*e.g+114*e.b)/1e3)?"black":"white"},fa.prototype.renderTemplate=function(e,t,i,n,o,r,s){var a,t=s?t+"_LabelTemplate":t+"_HeaderTemplate",s=s?"_LabelTemplate":"_HeaderTemplate";if(je(o.prototype)&&"string"==typeof o)for(var l=Object.keys(r.data),h=0;h<l.length;h++){var d=RegExp;o=o.replace(new d("{{:"+l[h]+"}}","g"),r.data[l[h].toString()])}return this.treemap.enableHtmlSanitizer&&"string"==typeof o&&(o=go.sanitize(o)),je(document.getElementById(this.treemap.element.id+"_Secondary_Element"))||(i=Es(i,n,Ds(a=Ts(Is(o)(r.data,this.treemap,o,this.treemap.element.id+s,!1),t,r.data),e),"Template",this.treemap),a.style.left=i.x+"px",a.style.top=i.y+"px"),a},fa.prototype.labelInterSectAction=function(e,t,i,n){var o,r=e.width-10;switch(n){case"Hide":o=[Qs(r,e.height,t,i)];break;case"Trim":o=[gs(3+r,t,i)];break;case"WrapByWord":o=js(r,t,i);break;case"Wrap":o=Ws(r,t,i)}return o},fa.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]};var ma=fa;function fa(e){this.treemap=e}Object.defineProperty(va.prototype,"moduleName",{get:function(){return"query"},enumerable:!0,configurable:!0}),va.prototype.setKey=function(e){return this.key=e,this},va.prototype.using=function(e){return this.dataManager=e,this},va.prototype.execute=function(e,t,i,n){return(e=e||this.dataManager)?e.executeQuery(this,t,i,n):Sa.throwError('Query - execute() : dataManager needs to be is set using "using" function or should be passed as argument')},va.prototype.executeLocal=function(e){return(e=e||this.dataManager)?e.executeLocal(this):Sa.throwError('Query - executeLocal() : dataManager needs to be is set using "using" function or should be passed as argument')},va.prototype.clone=function(){var e=new va;return e.queries=this.queries.slice(0),e.key=this.key,e.isChild=this.isChild,e.dataManager=this.dataManager,e.fromTable=this.fromTable,e.params=this.params.slice(0),e.expands=this.expands.slice(0),e.sortedColumns=this.sortedColumns.slice(0),e.groupedColumns=this.groupedColumns.slice(0),e.subQuerySelector=this.subQuerySelector,e.subQuery=this.subQuery,e.fKey=this.fKey,e.isCountRequired=this.isCountRequired,e.distincts=this.distincts.slice(0),e.lazyLoad=this.lazyLoad.slice(0),e},va.prototype.from=function(e){return this.fromTable=e,this},va.prototype.addParams=function(e,t){return"function"==typeof t?this.params.push({key:e,fn:t}):this.params.push({key:e,value:t}),this},va.prototype.distinct=function(e){return this.distincts="string"==typeof e?[].slice.call([e],0):e.slice(0),this},va.prototype.expand=function(e){return this.expands="string"==typeof e?[].slice.call([e],0):e.slice(0),this},va.prototype.where=function(e,t,i,n,o,r){t=t?t.toLowerCase():null;var s=null;return"string"==typeof e?s=new ba(e,t,i,n,o,r):e instanceof ba&&(s=e),this.queries.push({fn:"onWhere",e:s}),this},va.prototype.search=function(e,t,i,n,o){var r=Sa.fnOperators[i=i&&"none"!==i?i:"contains"];return this.queries.push({fn:"onSearch",e:{fieldNames:t="string"==typeof t?[t]:t,operator:i,searchKey:e,ignoreCase:n,ignoreAccent:o,comparer:r}}),this},va.prototype.sortBy=function(e,t,i){return this.sortByForeignKey(e,t,i)},va.prototype.sortByForeignKey=function(e,t,i,n){var o,n=je(n)?"ascending":n;if("string"==typeof e&&Sa.endsWith(e.toLowerCase()," desc")&&(e=e.replace(/ desc$/i,""),t="descending"),t&&"string"!=typeof t||(n=t?t.toLowerCase():"ascending",t=Sa.fnSort(t)),i)for(var r=va.filterQueries(this.queries,"onSortBy"),s=0;s<r.length;s++)if("string"==typeof(o=r[s].e.fieldName)){if(o===e)return this}else if(o instanceof Array)for(var a=0;a<o.length;a++)if(o[a]===e||e.toLowerCase()===o[a]+" desc")return this;return this.queries.push({fn:"onSortBy",e:{fieldName:e,comparer:t,direction:n}}),this},va.prototype.sortByDesc=function(e){return this.sortBy(e,"descending")},va.prototype.group=function(e,t,i){return this.sortBy(e,null,!0),this.queries.push({fn:"onGroup",e:{fieldName:e,comparer:t||null,format:i||null}}),this},va.prototype.page=function(e,t){return this.queries.push({fn:"onPage",e:{pageIndex:e,pageSize:t}}),this},va.prototype.range=function(e,t){return this.queries.push({fn:"onRange",e:{start:e,end:t}}),this},va.prototype.take=function(e){return this.queries.push({fn:"onTake",e:{nos:e}}),this},va.prototype.skip=function(e){return this.queries.push({fn:"onSkip",e:{nos:e}}),this},va.prototype.select=function(e){return"string"==typeof e&&(e=[].slice.call([e],0)),this.queries.push({fn:"onSelect",e:{fieldNames:e}}),this},va.prototype.hierarchy=function(e,t){return this.subQuerySelector=t,this.subQuery=e,this},va.prototype.foreignKey=function(e){return this.fKey=e,this},va.prototype.requiresCount=function(){return this.isCountRequired=!0,this},va.prototype.aggregate=function(e,t){return this.queries.push({fn:"onAggregates",e:{field:t,type:e}}),this},va.filterQueries=function(e,t){return e.filter(function(e){return e.fn===t})},va.filterQueryLists=function(e,t){for(var i=e.filter(function(e){return-1!==t.indexOf(e.fn)}),n={},o=0;o<i.length;o++)n[i[o].fn]||(n[i[o].fn]=i[o].e);return n};var ya=va;function va(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}wa.and=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return wa.combinePredicates([].slice.call(e,0),"and")},wa.prototype.and=function(e,t,i,n,o){return wa.combine(this,e,t,i,"and",n,o)},wa.or=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return wa.combinePredicates([].slice.call(e,0),"or")},wa.prototype.or=function(e,t,i,n,o){return wa.combine(this,e,t,i,"or",n,o)},wa.ornot=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return wa.combinePredicates([].slice.call(e,0),"or not")},wa.prototype.ornot=function(e,t,i,n,o){return wa.combine(this,e,t,i,"ornot",n,o)},wa.andnot=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return wa.combinePredicates([].slice.call(e,0),"and not")},wa.prototype.andnot=function(e,t,i,n,o){return wa.combine(this,e,t,i,"andnot",n,o)},wa.fromJson=function(e){if(e instanceof Array){for(var t=[],i=0,n=e.length;i<n;i++)t.push(this.fromJSONData(e[i]));return t}return this.fromJSONData(e)},wa.prototype.validate=function(e){var t,i=this.predicates||[];if(!this.isComplex&&this.comparer)return this.condition&&-1!==this.condition.indexOf("not")?(this.condition=""===this.condition.split("not")[0]?void 0:this.condition.split("not")[0],!this.comparer.call(this,Sa.getObject(this.field,e),this.value,this.ignoreCase,this.ignoreAccent)):this.comparer.call(this,Sa.getObject(this.field,e),this.value,this.ignoreCase,this.ignoreAccent);for(var n=this.condition&&-1!==this.condition.indexOf("not")?-1!==this.condition.indexOf("and"):"and"===this.condition,o=0;o<i.length;o++)if(0<o&&this.condition&&-1!==this.condition.indexOf("not")&&(i[o].condition=i[o].condition?i[o].condition+"not":"not"),t=i[o].validate(e),n){if(!t)return!1}else if(t)return!0;return n},wa.prototype.toJson=function(){if(this.isComplex)for(var e=[],t=this.predicates,i=0;i<t.length;i++)e.push(t[i].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,matchCase:this.matchCase}},wa.combinePredicates=function(e,t){if(1===e.length){if(!(e[0]instanceof Array))return e[0];e=e[0]}return new wa(e[0],t,e.slice(1))},wa.combine=function(e,t,i,n,o,r,s){return t instanceof wa?wa[o](e,t):"string"==typeof t?wa[o](e,new wa(t,i,n,r,s)):Sa.throwError("Predicate - "+o+" : invalid arguments")},wa.fromJSONData=function(e){for(var t=e.predicates||[],i=t.length,n=[],o=0;o<i;o++)n.push(this.fromJSONData(t[o]));return e.isComplex?new wa(n[0],e.condition,n.slice(1)):new wa(e.field,e.operator,e.value,e.ignoreCase,e.ignoreAccent)};var ba=wa;function wa(e,t,i,n,o,r){return void 0===n&&(n=!1),this.ignoreAccent=!1,this.isComplex=!1,"string"==typeof e?(this.field=e,this.operator=t.toLowerCase(),this.value=i,this.matchCase=r,this.ignoreCase=n,this.ignoreAccent=o,this.isComplex=!1,this.comparer=Sa.fnOperators.processOperator(this.operator)):(e instanceof wa&&i instanceof wa||i instanceof Array)&&(this.isComplex=!0,this.condition=t.toLowerCase(),this.predicates=[e],this.matchCase=e.matchCase,this.ignoreCase=e.ignoreCase,this.ignoreAccent=e.ignoreAccent,i instanceof Array?[].push.apply(this.predicates,i):this.predicates.push(i)),this}var Ca={GroupGuid:"{271bbba0-1ee7}"},Sa=(Aa.getValue=function(e,t){return"function"==typeof e?e.call(t||{}):e},Aa.endsWith=function(e,t){return e.slice&&e.slice(-t.length)===t},Aa.notEndsWith=function(e,t){return e.slice&&e.slice(-t.length)!==t},Aa.startsWith=function(e,t){return e.slice(0,t.length)===t},Aa.notStartsWith=function(e,t){return e.slice(0,t.length)!==t},Aa.wildCard=function(e,t){if(-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==t.indexOf("[")?t.split("[").join("[[]"):t).indexOf("(")?t.split("(").join("[(]"):t).indexOf(")")?t.split(")").join("[)]"):t).indexOf("\\")?t.split("\\").join("[\\\\]"):t).indexOf("*")){"*"!==(t="*"!==t.charAt(0)?"^"+t:t).charAt(t.length-1)&&(t+="$");for(var i=t.split("*"),n=0;n<i.length;n++)-1===i[n].indexOf(".")?i[n]=i[n]+".*":i[n]=i[n]+"*";t=i.join("")}return-1===t.indexOf("%3f")&&-1===t.indexOf("?")||(t=(-1!==t.indexOf("%3f")?t.split("%3f"):t.split("?")).join(".")),new RegExp(t,"g").test(e)},Aa.like=function(e,t){return-1!==t.indexOf("%")&&("%"===t.charAt(0)&&t.lastIndexOf("%")<2?(t=t.substring(1,t.length),Aa.startsWith(Aa.toLowerCase(e),Aa.toLowerCase(t))):"%"===t.charAt(t.length-1)&&t.indexOf("%")>t.length-3?(t=t.substring(0,t.length-1),Aa.endsWith(Aa.toLowerCase(e),Aa.toLowerCase(t))):(t.lastIndexOf("%")!==t.indexOf("%")&&t.lastIndexOf("%")>t.indexOf("%")+1&&(t=t.substring(t.indexOf("%")+1,t.lastIndexOf("%"))),-1!==e.indexOf(t)))},Aa.fnSort=function(e){return"ascending"===(e=e?Aa.toLowerCase(e):"ascending")?this.fnAscending:this.fnDescending},Aa.fnAscending=function(e,t){return je(e)&&je(t)?0:null==t?-1:"string"==typeof e?e.localeCompare(t):null==e?1:e-t},Aa.fnDescending=function(e,t){return je(e)&&je(t)?0:null==t?1:"string"==typeof e?-1*e.localeCompare(t):null==e?-1:t-e},Aa.extractFields=function(e,t){for(var i={},n=0;n<t.length;n++)i=this.setValue(t[n],this.getObject(t[n],e),i);return i},Aa.select=function(e,t){for(var i=[],n=0;n<e.length;n++)i.push(this.extractFields(e[n],t));return i},Aa.group=function(e,n,s,t,a,o,r){t=t||1;var l=e;if(l.GroupGuid===Ca.GroupGuid){for(var h=this,i=0;i<l.length;i++)!function(t){var e,i;je(a)?(l[t].items=h.group(l[t].items,n,s,l.level+1,null,o,r),l[t].count=l[t].items.length):(i=-1,e=a.filter(function(e){return e.key===l[t].key}),i=a.indexOf(e[0]),l[t].items=h.group(l[t].items,n,s,l.level+1,a[i].items,o,r),l[t].count=a[i].count)}(i);return l.childLevels+=1,l}for(var d={},p=[],c=(p.GroupGuid=Ca.GroupGuid,p.level=t,p.childLevels=0,p.records=l,this),u=0;u<l.length;u++)!function(e){var t,i=c.getVal(l,e,n);je(o)||(i=o(i,n)),d[i]||(d[i]={key:i,count:0,items:[],aggregates:{},field:n},p.push(d[i]),je(a))||(t=a.filter(function(e){return e.key===d[i].key}),d[i].count=t[0].count),d[i].count=je(a)?d[i].count+=1:d[i].count,r&&!s.length||d[i].items.push(l[e])}(u);if(s&&s.length)for(u=0;u<p.length;u++)!function(t){for(var e={},i=void 0,n=s,o=0;o<s.length;o++){var r,i=Aa.aggregates[s[o].type];je(a)?i&&(e[n[o].field+" - "+n[o].type]=i(p[t].items,n[o].field)):(r=a.filter(function(e){return e.key===p[t].key}),i&&(e[n[o].field+" - "+n[o].type]=i(r[0].items,n[o].field)))}p[t].aggregates=e}(u);if(r&&p.length&&s.length)for(u=0;u<p.length;u++)p[u].items=[];return l.length&&p||l},Aa.buildHierarchy=function(e,t,i,n,o){var r,s={};for((n=n.result?n.result:n).GroupGuid&&this.throwError("DataManager: Do not have support Grouping in hierarchy"),r=0;r<n.length;r++)(s[a=this.getObject(e,n[r])]||(s[a]=[])).push(n[r]);for(r=0;r<i.length;r++){var a=this.getObject(o||e,i[r]);i[r][t]=s[a]}},Aa.getFieldList=function(e,t,i){if(void 0===i&&(i=""),null==t)return this.getFieldList(e,[],i);for(var n=e,o=0,r=Object.keys(e);o<r.length;o++){var s=r[o];"object"!=typeof n[s]||n[s]instanceof Array?t.push(i+s):this.getFieldList(n[s],t,i+s+".")}return t},Aa.getObject=function(e,t){if(!e)return t;if(t){var i,n;if(-1===e.indexOf("."))return je(t[e])?(i=e.charAt(0).toLowerCase()+e.slice(1),n=e.charAt(0).toUpperCase()+e.slice(1),je(t[i])?je(t[n])?null:t[n]:t[i]):t[e];for(var o,r=t,s=e.split("."),a=0;a<s.length&&null!=r;a++)t=r=void 0===(r=r[s[a]])?t[o=s[a].charAt(0).toUpperCase()+s[a].slice(1)]||t[o.charAt(0).toLowerCase()+o.slice(1)]||null:r;return r}},Aa.setValue=function(e,t,i){for(var n,o=e.toString().split("."),e=i||{},r=e,s=o.length,a=0;a<s;a++)n=o[a],a+1===s?r[n]=void 0===t?void 0:t:je(r[n])&&(r[n]={}),r=r[n];return e},Aa.sort=function(e,i,n){var o=this;return e.length<=1?e:e.slice().sort(function(e,t){return n(o.getVal([e],0,i),o.getVal([t],0,i),e,t)})},Aa.ignoreDiacritics=function(e){return"string"!=typeof e?e:e.split("").map(function(e){return e in Aa.diacritics?Aa.diacritics[e]:e}).join("")},Aa.ignoreDiacriticsForArrays=function(e){return Array.isArray(e)?e.map(function(e){return Aa.ignoreDiacritics(e)}):[]},Aa.merge=function(e,t,i,n){for(var o,r=[];0<e.length||0<t.length;)o=0<e.length&&0<t.length?n?n(this.getVal(e,0,i),this.getVal(t,0,i),e[0],t[0])<=0?e:t:e[0][i]<e[0][i]?e:t:0<e.length?e:t,r.push(o.shift());return r},Aa.getVal=function(e,t,i){return i?this.getObject(i,e[t]):e[t]},Aa.toLowerCase=function(e){return je(e)?"":"string"==typeof e?e.toLowerCase():e instanceof Date?e.toString().toLowerCase():e.toString()},Aa.callAdaptorFunction=function(e,t,i,n){return t in e&&(je(e=e[t](i,n))||(i=e)),i},Aa.getAddParams=function(e,t,i){var n={};return Aa.callAdaptorFunction(e,"addParams",{dm:t,query:i,params:i?i.params:[],reqParams:n}),n},Aa.isPlainObject=function(e){return!!e&&e.constructor===Object},Aa.isCors=function(){var e=null;try{e=new window.XMLHttpRequest}catch(e){}return!!e&&"withCredentials"in e},Aa.getGuid=function(e){var n;return(e||"")+"00000000-0000-4000-0000-000000000000".replace(/0/g,function(e,t){var i;return n="crypto"in window&&"getRandomValues"in crypto?(i=new Uint8Array(1),window.crypto.getRandomValues(i),i[0]%16|0):16*Math.random()|0,"0123456789abcdef"[19===t?3&n|8:n]})},Aa.isNull=function(e){return null==e},Aa.getItemFromComparer=function(e,t,i){var n,o,r,s=0,a="string"==typeof Aa.getVal(e,0,t);if(e.length)for(;je(n)&&s<e.length;)n=Aa.getVal(e,s,t),r=e[s++];for(;s<e.length;s++)je(o=Aa.getVal(e,s,t))||(a&&(n=+n,o=+o),0<i(n,o)&&(n=o,r=e[s]));return r},Aa.distinct=function(i,n,o){o=!je(o)&&o;var r,s=[],a={};return i.forEach(function(e,t){(r="object"==typeof i[t]?Aa.getVal(i,t,n):i[t])in a||(s.push(o?i[t]:r),a[r]=1)}),s},Aa.processData=function(e,t){var i=this.prepareQuery(e),t=new me(t),t=(e.requiresCounts&&i.requiresCount(),t.executeLocal(i)),i={result:e.requiresCounts?t.result:t,count:t.count,aggregates:JSON.stringify(t.aggregates)};return e.requiresCounts?i:t},Aa.prepareQuery=function(e){var i=this,n=new ya;return e.select&&n.select(e.select),e.where&&Aa.parse.parseJson(e.where).filter(function(e){var t;je(e.condition)?n.where(e.field,e.operator,e.value,e.ignoreCase,e.ignoreAccent):(t=[],e.field?t.push(new ba(e.field,e.operator,e.value,e.ignoreCase,e.ignoreAccent)):t=t.concat(i.getPredicate(e.predicates)),"or"===e.condition?n.where(ba.or(t)):"and"===e.condition&&n.where(ba.and(t)))}),e.search&&Aa.parse.parseJson(e.search).filter(function(e){return n.search(e.key,e.fields,e.operator,e.ignoreCase,e.ignoreAccent)}),e.aggregates&&e.aggregates.filter(function(e){return n.aggregate(e.type,e.field)}),e.sorted&&e.sorted.filter(function(e){return n.sortBy(e.name,e.direction)}),e.skip&&n.skip(e.skip),e.take&&n.take(e.take),e.group&&e.group.filter(function(e){return n.group(e)}),n},Aa.getPredicate=function(e){for(var t=[],i=0;i<e.length;i++){var n=e[i];if(n.field)t.push(new ba(n.field,n.operator,n.value,n.ignoreCase,n.ignoreAccent));else{for(var o=[],r=this.getPredicate(n.predicates),s=0,a=Object.keys(r);s<a.length;s++){var l=a[s];o.push(r[l])}t.push("or"===n.condition?ba.or(o):ba.and(o))}}return t},Aa.serverTimezoneOffset=null,Aa.timeZoneHandling=!0,Aa.throwError=function(e){try{throw new Error(e)}catch(e){throw e.message+"\n"+e.stack}},Aa.aggregates={sum:function(e,t){for(var i,n=0,o="number"!=typeof Aa.getVal(e,0,t),r=0;r<e.length;r++)i=Aa.getVal(e,r,t),isNaN(i)||null===i||(n+=i=o?+i:i);return n},average:function(e,t){return Aa.aggregates.sum(e,t)/e.length},min:function(e,t){var i;return"function"==typeof t&&(i=t,t=null),Aa.getObject(t,Aa.getItemFromComparer(e,t,i||Aa.fnAscending))},max:function(e,t){var i;return"function"==typeof t&&(i=t,t=null),Aa.getObject(t,Aa.getItemFromComparer(e,t,i||Aa.fnDescending))},truecount:function(e,t){return new me(e).executeLocal((new ya).where(t,"equal",!0,!0)).length},falsecount:function(e,t){return new me(e).executeLocal((new ya).where(t,"equal",!1,!0)).length},count:function(e,t){return e.length}},Aa.operatorSymbols={"<":"lessthan",">":"greaterthan","<=":"lessthanorequal",">=":"greaterthanorequal","==":"equal","!=":"notequal","*=":"contains","$=":"endswith","^=":"startswith"},Aa.odBiOperator={"<":" lt ",">":" gt ","<=":" le ",">=":" ge ","==":" eq ","!=":" ne ",lessthan:" lt ",lessthanorequal:" le ",greaterthan:" gt ",greaterthanorequal:" ge ",equal:" eq ",notequal:" ne "},Aa.odUniOperator={"$=":"endswith","^=":"startswith","*=":"substringof",endswith:"endswith",startswith:"startswith",contains:"substringof",doesnotendwith:"not endswith",doesnotstartwith:"not startswith",doesnotcontain:"not substringof",wildcard:"wildcard",like:"like"},Aa.odv4UniOperator={"$=":"endswith","^=":"startswith","*=":"contains",endswith:"endswith",startswith:"startswith",contains:"contains",doesnotendwith:"not endswith",doesnotstartwith:"not startswith",doesnotcontain:"not contains",wildcard:"wildcard",like:"like"},Aa.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","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"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","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"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","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"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","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"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","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"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","Ⓣ":"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","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"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","ⓐ":"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","ⓒ":"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","ǳ":"dz","ǆ":"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","ⓖ":"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","ƕ":"hv","ⓘ":"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","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"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","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"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","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"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","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"},Aa.fnOperators={equal:function(e,t,i,n){return n&&(e=Aa.ignoreDiacritics(e),t=Aa.ignoreDiacritics(t)),i?Aa.toLowerCase(e)===Aa.toLowerCase(t):e===t},notequal:function(e,t,i,n){return n&&(e=Aa.ignoreDiacritics(e),t=Aa.ignoreDiacritics(t)),!Aa.fnOperators.equal(e,t,i)},lessthan:function(e,t,i){return i?Aa.toLowerCase(e)<Aa.toLowerCase(t):(e=je(e)?void 0:e)<t},greaterthan:function(e,t,i){return i?Aa.toLowerCase(e)>Aa.toLowerCase(t):t<e},lessthanorequal:function(e,t,i){return i?Aa.toLowerCase(e)<=Aa.toLowerCase(t):(e=je(e)?void 0:e)<=t},greaterthanorequal:function(e,t,i){return i?Aa.toLowerCase(e)>=Aa.toLowerCase(t):t<=(e=je(e)?void 0:e)},contains:function(e,t,i,n){return n&&(e=Aa.ignoreDiacritics(e),t=Aa.ignoreDiacritics(t)),i?!je(e)&&!je(t)&&-1!==Aa.toLowerCase(e).indexOf(Aa.toLowerCase(t)):!je(e)&&!je(t)&&-1!==e.toString().indexOf(t)},doesnotcontain:function(e,t,i,n){return n&&(e=Aa.ignoreDiacritics(e),t=Aa.ignoreDiacritics(t)),i?!je(e)&&!je(t)&&-1===Aa.toLowerCase(e).indexOf(Aa.toLowerCase(t)):!je(e)&&!je(t)&&-1===e.toString().indexOf(t)},isnotnull:function(e){return null!=e},isnull:function(e){return null==e},startswith:function(e,t,i,n){return n&&(e=Aa.ignoreDiacritics(e),t=Aa.ignoreDiacritics(t)),i?e&&t&&Aa.startsWith(Aa.toLowerCase(e),Aa.toLowerCase(t)):e&&t&&Aa.startsWith(e,t)},doesnotstartwith:function(e,t,i,n){return n&&(e=Aa.ignoreDiacritics(e),t=Aa.ignoreDiacritics(t)),i?e&&t&&Aa.notStartsWith(Aa.toLowerCase(e),Aa.toLowerCase(t)):e&&t&&Aa.notStartsWith(e,t)},like:function(e,t,i,n){return n&&(e=Aa.ignoreDiacritics(e),t=Aa.ignoreDiacritics(t)),i?e&&t&&Aa.like(Aa.toLowerCase(e),Aa.toLowerCase(t)):e&&t&&Aa.like(e,t)},isempty:function(e){return void 0===e||""===e},isnotempty:function(e){return void 0!==e&&""!==e},wildcard:function(e,t,i,n){return n&&(e=Aa.ignoreDiacritics(e),t=Aa.ignoreDiacritics(t)),i?(e||"boolean"==typeof e)&&t&&"object"!=typeof e&&Aa.wildCard(Aa.toLowerCase(e),Aa.toLowerCase(t)):(e||"boolean"==typeof e)&&t&&Aa.wildCard(e,t)},endswith:function(e,t,i,n){return n&&(e=Aa.ignoreDiacritics(e),t=Aa.ignoreDiacritics(t)),i?e&&t&&Aa.endsWith(Aa.toLowerCase(e),Aa.toLowerCase(t)):e&&t&&Aa.endsWith(e,t)},doesnotendwith:function(e,t,i,n){return n&&(e=Aa.ignoreDiacritics(e),t=Aa.ignoreDiacritics(t)),i?e&&t&&Aa.notEndsWith(Aa.toLowerCase(e),Aa.toLowerCase(t)):e&&t&&Aa.notEndsWith(e,t)},processSymbols:function(e){e=Aa.operatorSymbols[e];return e?Aa.fnOperators[e]:Aa.throwError("Query - Process Operator : Invalid operator")},processOperator:function(e){var t=Aa.fnOperators[e];return t||Aa.fnOperators.processSymbols(e)},in:function(t,e,i,n){return n&&(t=Aa.ignoreDiacritics(t),e=Aa.ignoreDiacriticsForArrays(e)),i?!je(t)&&e&&0<e.length&&-1<e.map(function(e){return Aa.toLowerCase(e)}).indexOf(Aa.toLowerCase(t)):t instanceof Date?!je(t)&&e&&0<e.length&&Array.isArray(e)&&e.some(function(e){return e instanceof Date&&e.getTime()===t.getTime()}):!je(t)&&e&&0<e.length&&-1<e.indexOf(t)},notin:function(t,e,i,n){return n&&(t=Aa.ignoreDiacritics(t),e=Aa.ignoreDiacriticsForArrays(e)),i?!je(t)&&e&&0<e.length&&-1===e.map(function(e){return Aa.toLowerCase(e)}).indexOf(Aa.toLowerCase(t)):t instanceof Date?!je(t)&&e&&0<e.length&&Array.isArray(e)&&e.every(function(e){return!(e instanceof Date)||e.getTime()!==t.getTime()}):!je(t)&&e&&0<e.length&&-1===e.indexOf(t)}},Aa.parse={parseJson:function(e){return"string"!=typeof e||!/^[\s]*\[|^[\s]*\{(.)+:/g.test(e)&&-1!==e.indexOf('"')?e instanceof Array?Aa.parse.iterateAndReviveArray(e):"object"==typeof e&&null!==e&&Aa.parse.iterateAndReviveJson(e):e=JSON.parse(e,Aa.parse.jsonReviver),e},iterateAndReviveArray:function(e){for(var t=0;t<e.length;t++)"object"==typeof e[t]&&null!==e[t]?Aa.parse.iterateAndReviveJson(e[t]):"string"!=typeof e[t]||/^[\s]*\[|^[\s]*\{(.)+:|\"/g.test(e[t])&&-1!==e[t].toString().indexOf('"')?e[t]=Aa.parse.parseJson(e[t]):e[t]=Aa.parse.jsonReviver("",e[t])},iterateAndReviveJson:function(e){for(var t,i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];Aa.startsWith(o,"__")||("object"==typeof(t=e[o])?t instanceof Array?Aa.parse.iterateAndReviveArray(t):t&&Aa.parse.iterateAndReviveJson(t):e[o]=Aa.parse.jsonReviver(e[o],t))}},jsonReviver:function(e,t){if("string"==typeof t){var i=/^\/Date\(([+-]?[0-9]+)([+-][0-9]{4})?\)\/$/.exec(t),n=Aa.timeZoneHandling?Aa.serverTimezoneOffset:null;if(i)return Aa.dateParse.toTimeZone(new Date(parseInt(i[1],10)),n,!0);if(/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(t)){var i=-1<t.indexOf("Z")||-1<t.indexOf("z"),n=t.split(/[^0-9.]/);if(i)-1<n[5].indexOf(".")?(i=n[5].split("."),n[5]=i[0],n[6]=new Date(t).getUTCMilliseconds().toString()):n[6]="00",t=Aa.dateParse.toTimeZone(new Date(parseInt(n[0],10),parseInt(n[1],10)-1,parseInt(n[2],10),parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5]||"00",10),parseInt(n[6],10)),Aa.serverTimezoneOffset,!1);else{var i=new Date(parseInt(n[0],10),parseInt(n[1],10)-1,parseInt(n[2],10),parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5]||"00",10)),o=parseInt(n[6],10),n=parseInt(n[7],10);if(isNaN(o)&&isNaN(n))return i;-1<t.indexOf("+")?i.setHours(i.getHours()-o,i.getMinutes()-n):i.setHours(i.getHours()+o,i.getMinutes()+n),t=Aa.dateParse.toTimeZone(i,Aa.serverTimezoneOffset,!1)}null==Aa.serverTimezoneOffset&&(t=Aa.dateParse.addSelfOffset(t))}}return t},isJson:function(e){return"string"==typeof e[0]?e:Aa.parse.parseJson(e)},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(e,t){return Aa.isPlainObject(e)?Aa.parse.jsonReplacer(e,t):e instanceof Array?Aa.parse.arrayReplacer(e):e instanceof Date?Aa.parse.jsonReplacer({val:e},t).val:e},jsonReplacer:function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++){var o,r=n[i];(o=e[r])instanceof Date&&(o=o,null==Aa.serverTimezoneOffset?e[r]=Aa.dateParse.toTimeZone(o,null).toJSON():(o=new Date(+o+36e5*Aa.serverTimezoneOffset),e[r]=Aa.dateParse.toTimeZone(Aa.dateParse.addSelfOffset(o),null).toJSON()))}return e},arrayReplacer:function(e){for(var t=0;t<e.length;t++)Aa.isPlainObject(e[t])?e[t]=Aa.parse.jsonReplacer(e[t]):e[t]instanceof Date&&(e[t]=Aa.parse.jsonReplacer({date:e[t]}).date);return e},jsonDateReplacer:function(e,t){if("value"===e&&t&&("string"==typeof t&&((e=/^\/Date\(([+-]?[0-9]+)([+-][0-9]{4})?\)\/$/.exec(t))?t=Aa.dateParse.toTimeZone(new Date(parseInt(e[1],10)),null,!0):/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(t)&&(e=t.split(/[^0-9]/),t=Aa.dateParse.toTimeZone(new Date(parseInt(e[0],10),parseInt(e[1],10)-1,parseInt(e[2],10),parseInt(e[3],10),parseInt(e[4],10),parseInt(e[5],10)),null,!0))),t instanceof Date))return t=Aa.dateParse.addSelfOffset(t),(null===Aa.serverTimezoneOffset?Aa.dateParse.toTimeZone(Aa.dateParse.addSelfOffset(t),null):t=Aa.dateParse.toTimeZone(t,t.getTimezoneOffset()/60-Aa.serverTimezoneOffset,!1)).toJSON();return t}},Aa.dateParse={addSelfOffset:function(e){return new Date(+e-6e4*e.getTimezoneOffset())},toUTC:function(e){return new Date(+e+6e4*e.getTimezoneOffset())},toTimeZone:function(e,t,i){return null===t?e:(i=i?Aa.dateParse.toUTC(e):e,new Date(+i-36e5*t))},toLocalTime:function(e){function t(e){return((e=Math.floor(Math.abs(e)))<10?"0":"")+e}var i=-e.getTimezoneOffset(),n=0<=i?"+":"-";return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+n+t(i/60)+":"+t(i%60)}},Aa);function Aa(){}xa=function(e,t){return(xa=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])}))(e,t)};var xa,W=function(e,t){function i(){this.constructor=e}xa(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ia={GroupGuid:"{271bbba0-1ee7}"},Ta=(Ea.prototype.processResponse=function(e,t,i,n){return e},Ea);function Ea(e){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=Ea,this.dataSource=e,this.pvt={}}W(ka,Da=Ta),ka.prototype.processQuery=function(e,t){for(var i,n,o,r=e.dataSource.json.slice(0),s=r.length,a=!0,l={},h=0,d=[],p=[],c=0;c<t.lazyLoad.length;c++)h++,l[t.lazyLoad[c].key]=t.lazyLoad[c].value;var u={},g=!1;if(t.lazyLoad.length)for(c=0;c<t.queries.length;c++)if("onGroup"===(n=t.queries[c]).fn&&!je(n.e.format)){g=!0;break}for(c=0;c<t.queries.length;c++)("onPage"===(n=t.queries[c]).fn||"onGroup"===n.fn||"onSortBy"===n.fn&&!g)&&t.lazyLoad.length?("onGroup"===n.fn&&d.push(n.e),"onPage"===n.fn&&(o=n.e),"onSortBy"===n.fn&&p.unshift(n.e)):(i=this[n.fn].call(this,r,n.e,t),"onAggregates"===n.fn?u[n.e.field+" - "+n.e.type]=i:r=void 0!==i?i:r,(a="onPage"!==n.fn&&"onSkip"!==n.fn&&"onTake"!==n.fn&&"onRange"!==n.fn?a:!1)&&(s=r.length));return h&&(r=(e=this.lazyLoadGroup({query:t,lazyLoad:l,result:r,group:d,page:o,sort:p})).result,s=e.count),r=t.isCountRequired?{result:r,count:s,aggregates:u}:r},ka.prototype.lazyLoadGroup=function(e){var t=0,i=this.getAggregate(e.query),n=e.result;if(je(e.lazyLoad.onDemandGroupInfo)){var o=e.group[0].fieldName,r=(t=(n=Sa.group(n,o,i,null,null,e.group[0].comparer,!0)).length,n);e.sort.length&&(l=(1<e.sort.length?e.sort.filter(function(e){return e.fieldName===o}):e.sort)[0],n=this.onSortBy(n,l,e.query,!0)),e.page&&(n=this.onPage(n,e.page,e.query)),this.formGroupResult(n,r)}else{for(var s=e.lazyLoad.onDemandGroupInfo,a=s.where.length-1;0<=a;a--)n=this.onWhere(n,s.where[a]);if(e.group.length!==s.level){var l=e.group[s.level].fieldName,n=Sa.group(n,l,i,null,null,e.group[s.level].comparer,!0);e.sort.length&&(n=this.onSortBy(n,e.sort[parseInt(s.level.toString(),10)],e.query,!0))}else for(a=e.sort.length-1;a>=s.level;a--)n=this.onSortBy(n,e.sort[parseInt(a.toString(),10)],e.query,!1);var t=n.length,r=n;n=(n=n.slice(s.skip)).slice(0,s.take),e.group.length!==s.level&&this.formGroupResult(n,r)}return{result:n,count:t}},ka.prototype.formGroupResult=function(e,t){var i;return e.length&&t.length&&(i="childLevels",e.GroupGuid=t.GroupGuid,e[i]=t[i],e.level=t.level,e.records=t.records),e},ka.prototype.getAggregate=function(e){var t=ya.filterQueries(e.queries,"onAggregates"),i=[];if(t.length)for(var n,o=0;o<t.length;o++)n=t[o].e,i.push({type:n.type,field:Sa.getValue(n.field,e)});return i},ka.prototype.batchRequest=function(e,t,i){for(var n=t.deletedRecords.length,o=0;o<t.addedRecords.length;o++)this.insert(e,t.addedRecords[o]);for(o=0;o<t.changedRecords.length;o++)this.update(e,i.key,t.changedRecords[o]);for(o=0;o<n;o++)this.remove(e,i.key,t.deletedRecords[o]);return t},ka.prototype.onWhere=function(e,t){return e&&e.length?e.filter(function(e){if(t)return t.validate(e)}):e},ka.prototype.onAggregates=function(e,t){var i=Sa.aggregates[t.type];return e&&i&&0!==e.length?i(e,t.field):null},ka.prototype.onSearch=function(e,i){return e&&e.length?(0===i.fieldNames.length&&Sa.getFieldList(e[0],i.fieldNames),e.filter(function(e){for(var t=0;t<i.fieldNames.length;t++)if(i.comparer.call(e,Sa.getObject(i.fieldNames[t],e),i.searchKey,i.ignoreCase,i.ignoreAccent))return!0;return!1})):e},ka.prototype.onSortBy=function(e,t,i,n){if(!e||!e.length)return e;var o;if(!(r=Sa.getValue(t.fieldName,i)))return e.sort(t.comparer);if(r instanceof Array){for(var r,s=(r=r.slice(0)).length-1;0<=s;s--)r[s]&&(o=t.comparer,Sa.endsWith(r[s]," desc")&&(o=Sa.fnSort("descending"),r[s]=r[s].replace(" desc","")),e=Sa.sort(e,r[s],o));return e}return Sa.sort(e,n?"key":r,t.comparer)},ka.prototype.onGroup=function(e,t,i){var n;return e&&e.length?(n=this.getAggregate(i),Sa.group(e,Sa.getValue(t.fieldName,i),n,null,null,t.comparer)):e},ka.prototype.onPage=function(e,t,i){var n=Sa.getValue(t.pageSize,i),t=(Sa.getValue(t.pageIndex,i)-1)*n;return e&&e.length?e.slice(t,t+n):e},ka.prototype.onRange=function(e,t){return e&&e.length?e.slice(Sa.getValue(t.start),Sa.getValue(t.end)):e},ka.prototype.onTake=function(e,t){return e&&e.length?e.slice(0,Sa.getValue(t.nos)):e},ka.prototype.onSkip=function(e,t){return e&&e.length?e.slice(Sa.getValue(t.nos)):e},ka.prototype.onSelect=function(e,t){return e&&e.length?Sa.select(e,Sa.getValue(t.fieldNames)):e},ka.prototype.insert=function(e,t,i,n,o){return je(o)?e.dataSource.json.push(t):e.dataSource.json.splice(o,0,t)},ka.prototype.remove=function(e,t,i,n){var o,r=e.dataSource.json;for("object"!=typeof i||i instanceof Date||(i=Sa.getObject(t,i)),o=0;o<r.length&&Sa.getObject(t,r[o])!==i;o++);return o!==r.length?r.splice(o,1):null},ka.prototype.update=function(e,t,i,n){var o,r,s=e.dataSource.json;for(je(t)||(r=R(t,i)),o=0;o<s.length&&(je(t)||R(t,s[o])!==r);o++);return o<s.length?I(s[o],i):null};var Da,Ma=ka;function ka(){return null!==Da&&Da.apply(this,arguments)||this}W(Fa,Pa=Ta),Fa.prototype.processQuery=function(e,t,i){var n,o,r=this.getQueryRequest(t),s=ya.filterQueryLists(t.queries,["onSelect","onPage","onSkip","onTake","onRange"]),a=t.params,l=e.dataSource.url,h=null,d=this.options,p={sorts:[],groups:[],filters:[],searches:[],aggregates:[]};"onPage"in s?(n=s.onPage,o=((o=Sa.getValue(n.pageIndex,t))-1)*(h=Sa.getValue(n.pageSize,t))):"onRange"in s&&(o=(n=s.onRange).start,h=n.end-n.start);for(var c=0;c<r.sorts.length;c++)n=Sa.getValue(r.sorts[c].e.fieldName,t),p.sorts.push(Sa.callAdaptorFunction(this,"onEachSort",{name:n,direction:r.sorts[c].e.direction},t));i&&(n=this.getFiltersFrom(i,t))&&p.filters.push(Sa.callAdaptorFunction(this,"onEachWhere",n.toJson(),t));for(c=0;c<r.filters.length;c++){var u=Sa.callAdaptorFunction(this,"onEachWhere",r.filters[c].e.toJson(),t);this.getModuleName&&"ODataV4Adaptor"===this.getModuleName()&&!je(r.filters[c].e.key)&&1<r.filters.length&&(u="("+u+")"),p.filters.push(u);for(var g=0,m="object"==typeof p.filters[c]?Object.keys(p.filters[c]):[];g<m.length;g++){var f=m[g];Sa.isNull(p[f])&&delete p[f]}}for(c=0;c<r.searches.length;c++)n=r.searches[c].e,p.searches.push(Sa.callAdaptorFunction(this,"onEachSearch",{fields:n.fieldNames,operator:n.operator,key:n.searchKey,ignoreCase:n.ignoreCase,ignoreAccent:n.ignoreAccent},t));for(c=0;c<r.groups.length;c++)p.groups.push(Sa.getValue(r.groups[c].e.fieldName,t));for(c=0;c<r.aggregates.length;c++)n=r.aggregates[c].e,p.aggregates.push({type:n.type,field:Sa.getValue(n.field,t)});var y={};if(this.getRequestQuery(d,t,s,p,y),Sa.callAdaptorFunction(this,"addParams",{dm:e,query:t,params:a,reqParams:y}),t.lazyLoad.length)for(c=0;c<t.lazyLoad.length;c++)y[t.lazyLoad[c].key]=t.lazyLoad[c].value;for(var v=0,b=Object.keys(y);v<b.length;v++){f=b[v];!Sa.isNull(y[f])&&""!==y[f]&&0!==y[f].length||delete y[f]}d.skip in y&&d.take in y||null===h||(y[d.skip]=Sa.callAdaptorFunction(this,"onSkip",o,t),y[d.take]=Sa.callAdaptorFunction(this,"onTake",h,t));i=this.pvt;return this.pvt={},"json"===this.options.requestType?{data:JSON.stringify(y,Sa.parse.jsonDateReplacer),url:l,pvtData:i,type:"POST",contentType:"application/json; charset=utf-8"}:(n=this.convertToQueryString(y,t,e),{type:"GET",url:(n=(-1!==e.dataSource.url.indexOf("?")?"&":"/")+n).length?l.replace(/\/*$/,n):l,pvtData:i})},Fa.prototype.getRequestQuery=function(e,t,i,n,o){o[e.from]=t.fromTable,e.apply&&t.distincts.length&&(o[e.apply]="onDistinct"in this?Sa.callAdaptorFunction(this,"onDistinct",t.distincts):""),!t.distincts.length&&e.expand&&(o[e.expand]="onExpand"in this&&"onSelect"in i?Sa.callAdaptorFunction(this,"onExpand",{selects:Sa.getValue(i.onSelect.fieldNames,t),expands:t.expands},t):t.expands),o[e.select]="onSelect"in i&&!t.distincts.length?Sa.callAdaptorFunction(this,"onSelect",Sa.getValue(i.onSelect.fieldNames,t),t):"",o[e.count]=t.isCountRequired?Sa.callAdaptorFunction(this,"onCount",t.isCountRequired,t):"",o[e.search]=n.searches.length?Sa.callAdaptorFunction(this,"onSearch",n.searches,t):"",o[e.skip]="onSkip"in i?Sa.callAdaptorFunction(this,"onSkip",Sa.getValue(i.onSkip.nos,t),t):"",o[e.take]="onTake"in i?Sa.callAdaptorFunction(this,"onTake",Sa.getValue(i.onTake.nos,t),t):"",o[e.where]=n.filters.length||n.searches.length?Sa.callAdaptorFunction(this,"onWhere",n.filters,t):"",o[e.sortBy]=n.sorts.length?Sa.callAdaptorFunction(this,"onSortBy",n.sorts,t):"",o[e.group]=n.groups.length?Sa.callAdaptorFunction(this,"onGroup",n.groups,t):"",o[e.aggregates]=n.aggregates.length?Sa.callAdaptorFunction(this,"onAggregates",n.aggregates,t):"",o.param=[]},Fa.prototype.convertToQueryString=function(e,t,i){return""},Fa.prototype.processResponse=function(e,t,i,n,o,r){n&&n.headers.get("Content-Type")&&-1!==n.headers.get("Content-Type").indexOf("application/json")&&(a=Sa.timeZoneHandling,t&&!t.timeZoneHandling&&(Sa.timeZoneHandling=!1),t.enableCache||(e=Sa.parse.parseJson(e)),Sa.timeZoneHandling=a);var t=o,s=t.pvtData||{},a=e?e.groupDs:[];if(n&&n.headers.get("Content-Type")&&-1!==n.headers.get("Content-Type").indexOf("xml"))return i.isCountRequired?{result:[],count:0}:[];o=JSON.parse(t.data);if(o&&"batch"===o.action&&e&&e.addedRecords&&!je(r))return r.addedRecords=e.addedRecords,r;var n={},l=((e=e&&e.d?e.d:e)&&"count"in e&&(n.count=e.count),n.result=e&&e.result?e.result:e,!1);if(Array.isArray(e.result)&&e.result.length)if(je(e.result[0].key)||(n.result=this.formRemoteGroupedData(n.result,1,s.groups.length-1)),i&&i.lazyLoad.length&&s.groups.length)for(var h,d=0;d<i.lazyLoad.length;d++)"onDemandGroupInfo"===i.lazyLoad[d].key&&(h=i.lazyLoad[d].value.level,s.groups.length===h)&&(l=!0);return l||this.getAggregateResult(s,e,n,a,i),Sa.isNull(n.count)?n.result:{result:n.result,count:n.count,aggregates:n.aggregates}},Fa.prototype.formRemoteGroupedData=function(e,t,i){for(var n=0;n<e.length;n++)e[n].items.length&&-1<Object.keys(e[n].items[0]).indexOf("key")&&this.formRemoteGroupedData(e[n].items,t+1,i-1);return e.GroupGuid=Ia.GroupGuid,e.level=t,e.childLevels=i,e.records=e[0].items.length?this.getGroupedRecords(e,!je(e[0].items.records)):[],e},Fa.prototype.getGroupedRecords=function(e,t){for(var i=[],n=0;n<e.length;n++)if(t)i=i.concat(e[n].items.records);else for(var o=0;o<e[n].items.length;o++)i.push(e[n].items[o]);return i},Fa.prototype.onGroup=function(e){return this.pvt.groups=e},Fa.prototype.onAggregates=function(e){this.pvt.aggregates=e},Fa.prototype.batchRequest=function(e,t,i,n,o){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(Pe({},{changed:t.changedRecords,added:t.addedRecords,deleted:t.deletedRecords,action:"batch",table:i[void 0],key:i[void 0]},Sa.getAddParams(this,e,n)))}},Fa.prototype.beforeSend=function(e,t,i){},Fa.prototype.insert=function(e,t,i,n){return{url:e.dataSource.insertUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(Pe({},{value:t,table:i,action:"insert"},Sa.getAddParams(this,e,n)))}},Fa.prototype.remove=function(e,t,i,n,o){return{type:"POST",url:e.dataSource.removeUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(Pe({},{key:i,keyColumn:t,table:n,action:"remove"},Sa.getAddParams(this,e,o)))}},Fa.prototype.update=function(e,t,i,n,o){return{type:"POST",url:e.dataSource.updateUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(Pe({},{value:i,action:"update",keyColumn:t,key:Sa.getObject(t,i),table:n},Sa.getAddParams(this,e,o)))}},Fa.prototype.getFiltersFrom=function(e,t){var i,n=t.fKey,o=n,r=t.key,s=[];"object"!=typeof e[0]&&(o=null);for(var a=0;a<e.length;a++)i="object"==typeof e[0]?Sa.getObject(r||o,e[a]):e[a],s.push(new ba(n,"equal",i));return ba.or(s)},Fa.prototype.getAggregateResult=function(e,t,i,n,o){var r=t;if(t&&t.result&&(r=t.result),e&&e.aggregates&&e.aggregates.length){var s=e.aggregates,a=void 0,l=r,h={};t.aggregate&&(l=t.aggregate);for(var d=0;d<s.length;d++)(a=Sa.aggregates[s[d].type])&&(h[s[d].field+" - "+s[d].type]=a(l,s[d].field));i.aggregates=h}t=Array.isArray(t.result)&&t.result.length&&!je(t.result[0].key);if(e&&e.groups&&e.groups.length&&!t){for(var p=e.groups,d=0;d<p.length;d++){je(n)||(n=Sa.group(n,p[d]));var c=ya.filterQueries(o.queries,"onGroup")[d].e,r=Sa.group(r,p[d],e.aggregates,null,n,c.comparer)}i.result=r}return i},Fa.prototype.getQueryRequest=function(e){var t={sorts:[],groups:[],filters:[],searches:[],aggregates:[]};return t.sorts=ya.filterQueries(e.queries,"onSortBy"),t.groups=ya.filterQueries(e.queries,"onGroup"),t.filters=ya.filterQueries(e.queries,"onWhere"),t.searches=ya.filterQueries(e.queries,"onSearch"),t.aggregates=ya.filterQueries(e.queries,"onAggregates"),t},Fa.prototype.addParams=function(e){var t=e.reqParams;e.params.length&&(t.params={});for(var i=0,n=e.params;i<n.length;i++){var o=n[i];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]}};var Pa,Ba=Fa;function Fa(){return null!==Pa&&Pa.apply(this,arguments)||this}W(Oa,La=Ba),Oa.prototype.getModuleName=function(){return"ODataAdaptor"},Oa.prototype.onPredicate=function(e,t,i){var n,o,r="",s=e.value,a=typeof s,l=e.field?Oa.getField(e.field):null;if(s instanceof Date&&(s="datetime'"+Sa.parse.replacer(s)+"'"),"string"==a&&(s=s.replace(/'/g,"''"),e.ignoreCase&&(s=s.toLowerCase()),"like"!==e.operator&&(s=encodeURIComponent(s)),"wildcard"!==e.operator&&"like"!==e.operator&&(s="'"+s+"'"),i&&(l="cast("+l+", 'Edm.String')"),Sa.parse.isGuid(s)&&(o="guid"),e.ignoreCase)&&(o||(l="tolower("+l+")"),s=s.toLowerCase()),"isempty"===e.operator||"isnull"===e.operator||"isnotempty"===e.operator||"isnotnull"===e.operator?(n=-1!==e.operator.indexOf("isnot")?Sa.odBiOperator.notequal:Sa.odBiOperator.equal,s="isnull"===e.operator||"isnotnull"===e.operator?null:"''"):n=Sa.odBiOperator[e.operator],n)return r=r+l+n,o&&(r+=o),r+s;if("like"===(n=(je(this.getModuleName)||"ODataV4Adaptor"!==this.getModuleName()?Sa.odUniOperator:Sa.odv4UniOperator)[e.operator]))-1!==s.indexOf("%")&&(n="%"===s.charAt(0)&&s.lastIndexOf("%")<2?(s=s.substring(1,s.length),(je(this.getModuleName)||"ODataV4Adaptor"!==this.getModuleName()?Sa.odUniOperator:Sa.odv4UniOperator).startswith):"%"===s.charAt(s.length-1)&&s.indexOf("%")>s.length-3?(s=s.substring(0,s.length-1),(je(this.getModuleName)||"ODataV4Adaptor"!==this.getModuleName()?Sa.odUniOperator:Sa.odv4UniOperator).endswith):(s.lastIndexOf("%")!==s.indexOf("%")&&s.lastIndexOf("%")>s.indexOf("%")+1&&(s=s.substring(s.indexOf("%")+1,s.lastIndexOf("%"))),(je(this.getModuleName)||"ODataV4Adaptor"!==this.getModuleName()?Sa.odUniOperator:Sa.odv4UniOperator).contains)),s="'"+(s=encodeURIComponent(s))+"'";else if("wildcard"===n)if(-1!==s.indexOf("*")){var h=s.split("*"),d=void 0,p=0;if(0!==s.indexOf("*")&&-1===h[0].indexOf("%3f")&&-1===h[0].indexOf("?")&&(d="'"+(d=h[0])+"'",r=r+((n=(je(this.getModuleName)||"ODataV4Adaptor"!==this.getModuleName()?Sa.odUniOperator:Sa.odv4UniOperator).startswith)+"(")+l+",",o&&(r+=o),r+=d+")",p++),s.lastIndexOf("*")!==s.length-1&&-1===h[h.length-1].indexOf("%3f")&&-1===h[h.length-1].indexOf("?")&&(d="'"+(d=h[h.length-1])+"'",0<p&&(r+=" and "),r=r+((n=(je(this.getModuleName)||"ODataV4Adaptor"!==this.getModuleName()?Sa.odUniOperator:Sa.odv4UniOperator).endswith)+"(")+l+",",o&&(r+=o),r+=d+")",p++),2<h.length)for(var c,u=1;u<h.length-1;u++)-1===h[u].indexOf("%3f")&&-1===h[u].indexOf("?")&&(d="'"+(d=h[u])+"'",0<p&&(r+=" and "),"substringof"!==(n=(je(this.getModuleName)||"ODataV4Adaptor"!==this.getModuleName()?Sa.odUniOperator:Sa.odv4UniOperator).contains)&&"not substringof"!==n||(c=d,d=l,l=c),r=r+(n+"(")+l+",",o&&(r+=o),r+=d+")",p++);0===p?(n=(je(this.getModuleName)||"ODataV4Adaptor"!==this.getModuleName()?Sa.odUniOperator:Sa.odv4UniOperator).contains,s="'"+(s=-1===s.indexOf("?")&&-1===s.indexOf("%3f")?s:(-1!==s.indexOf("?")?s.split("?"):s.split("%3f")).join(""))+"'"):n="wildcard"}else n=(je(this.getModuleName)||"ODataV4Adaptor"!==this.getModuleName()?Sa.odUniOperator:Sa.odv4UniOperator).contains,s="'"+(s=-1===s.indexOf("?")&&-1===s.indexOf("%3f")?s:(-1!==s.indexOf("?")?s.split("?"):s.split("%3f")).join(""))+"'";return"substringof"!==n&&"not substringof"!==n||(c=s,s=l,l=c),"wildcard"!==n&&(r=r+(n+"(")+l+",",o&&(r+=o),r+=s+")"),r},Oa.prototype.addParams=function(e){La.prototype.addParams.call(this,e),delete e.reqParams.params},Oa.prototype.onComplexPredicate=function(e,t,i){for(var n=[],o=0;o<e.predicates.length;o++)n.push("("+this.onEachWhere(e.predicates[o],t,i)+")");return n.join(" "+e.condition+" ")},Oa.prototype.onEachWhere=function(e,t,i){return e.isComplex?this.onComplexPredicate(e,t,i):this.onPredicate(e,t,i)},Oa.prototype.onWhere=function(e){return this.pvt.search&&e.push(this.onEachWhere(this.pvt.search,null,!0)),e.join(" and ")},Oa.prototype.onEachSearch=function(e){e.fields&&0===e.fields.length&&Sa.throwError("Query() - Search : oData search requires list of field names to search");for(var t=this.pvt.search||[],i=0;i<e.fields.length;i++)t.push(new ba(e.fields[i],e.operator,e.key,e.ignoreCase));this.pvt.search=t},Oa.prototype.onSearch=function(e){return this.pvt.search=ba.or(this.pvt.search),""},Oa.prototype.onEachSort=function(e){var t=[];if(e.name instanceof Array)for(var i=0;i<e.name.length;i++)t.push(Oa.getField(e.name[i])+("descending"===e.direction?" desc":""));else t.push(Oa.getField(e.name)+("descending"===e.direction?" desc":""));return t.join(",")},Oa.prototype.onSortBy=function(e){return e.reverse().join(",")},Oa.prototype.onGroup=function(e){return this.pvt.groups=e,[]},Oa.prototype.onSelect=function(e){for(var t=0;t<e.length;t++)e[t]=Oa.getField(e[t]);return e.join(",")},Oa.prototype.onAggregates=function(e){return this.pvt.aggregates=e,""},Oa.prototype.onCount=function(e){return!0===e?"allpages":""},Oa.prototype.beforeSend=function(e,t,i){Sa.endsWith(i.url,this.options.batch)&&"post"===i.type.toLowerCase()?(t.headers.set("Accept",this.options.multipartAccept),t.headers.set("DataServiceVersion","2.0")):t.headers.set("Accept",this.options.accept),t.headers.set("DataServiceVersion","2.0"),t.headers.set("MaxDataServiceVersion","2.0")},Oa.prototype.processResponse=function(e,t,i,n,o,r){var s="odata.metadata";o&&"GET"===o.type&&!this.rootUrl&&e[s]&&(s=e[s].split("/$metadata#"),this.rootUrl=s[0],this.resourceTableName=s[1]);if(!je(e.d)){var a=i&&i.isCountRequired?e.d.results:e.d,l="__metadata";if(!je(a))for(var h=0;h<a.length;h++)je(a[h][l])||delete a[h][l]}var s=o&&o.pvtData,r=this.processBatchResponse(e,i,n,o,r);return r||(r=null,o=(n=n&&o.fetchRequest.headers.get("DataServiceVersion"))&&parseInt(n,10)||2,i&&i.isCountRequired&&((e[n="__count"]||e["odata.count"])&&(r=e[n]||e["odata.count"]),(e=e.d?e.d:e)[n]||e["odata.count"])&&(r=e[n]||e["odata.count"]),(e=3===o&&e.value?e.value:e).d&&(e=e.d),o<3&&e.results&&(e=e.results),(n={}).count=r,n.result=e,this.getAggregateResult(s,e,n,null,i),Sa.isNull(r)?n.result:{result:n.result,count:n.count,aggregates:n.aggregates})},Oa.prototype.convertToQueryString=function(e,t,i){var n=[],o=e.table||"";delete e.table,i.dataSource.requiresFormat&&(e.$format="json");for(var r=0,s=Object.keys(e);r<s.length;r++){var a=s[r];n.push(a+"="+e[a])}return n=n.join("&"),i.dataSource.url&&-1!==i.dataSource.url.indexOf("?")&&!o?n:n.length?o+"?"+n:o||""},Oa.prototype.localTimeReplacer=function(e,t){for(var i=0,n=je(t)?[]:Object.keys(t);i<n.length;i++){var o=n[i];t[o]instanceof Date&&(t[o]=Sa.dateParse.toLocalTime(t[o]))}return t},Oa.prototype.insert=function(e,t,i){return{url:(e.dataSource.insertUrl||e.dataSource.url).replace(/\/*$/,i?"/"+i:""),data:JSON.stringify(t,this.options.localTime?this.localTimeReplacer:null)}},Oa.prototype.remove=function(e,t,i,n){i="string"!=typeof i||Sa.parse.isGuid(i)?"("+i+")":"('"+i+"')";return{type:"DELETE",url:(e.dataSource.removeUrl||e.dataSource.url).replace(/\/*$/,n?"/"+n:"")+i}},Oa.prototype.update=function(e,t,i,n,o,r){r="string"!=typeof(i="PATCH"!==this.options.updateType||je(r)?i:this.compareAndRemove(i,r,t))[t]||Sa.parse.isGuid(i[t])?"("+i[t]+")":"('"+i[t]+"')";return{type:this.options.updateType,url:(e.dataSource.updateUrl||e.dataSource.url).replace(/\/*$/,n?"/"+n:"")+r,data:JSON.stringify(i,this.options.localTime?this.localTimeReplacer:null),accept:this.options.accept}},Oa.prototype.batchRequest=function(e,t,i,n,o){var r=i.guid=Sa.getGuid(this.options.batchPre),s=e.dataSource.batchUrl||this.rootUrl?(e.dataSource.batchUrl||this.rootUrl)+"/"+this.options.batch:(e.dataSource.batchUrl||e.dataSource.url).replace(/\/*$/,"/"+this.options.batch),i=(i.url=this.resourceTableName||i.url,{url:i.url,key:i.key,cid:1,cSet:Sa.getGuid(this.options.changeSet)}),a="--"+r+"\n";return a+="Content-Type: multipart/mixed; boundary="+i.cSet.replace("--","")+"\n",this.pvt.changeSet=0,{type:"POST",url:s,dataType:"json",contentType:"multipart/mixed; charset=UTF-8;boundary="+r,data:(a+=this.generateInsertRequest(t.addedRecords,i,e))+this.generateUpdateRequest(t.changedRecords,i,e,o?o.changedRecords:[])+this.generateDeleteRequest(t.deletedRecords,i,e)+(i.cSet+"--\n")+("--"+r+"--")}},Oa.prototype.generateDeleteRequest=function(e,t,i){return e?this.generateBodyContent(e,t,{method:"DELETE ",url:function(e,t,i){var n=Sa.getObject(i,e[t]);return"number"==typeof n||Sa.parse.isGuid(n)?"("+n+")":n instanceof Date?"("+e[t][i].toJSON()+")":"('"+n+"')"},data:function(e,t){return""}},i)+"\n":""},Oa.prototype.generateInsertRequest=function(e,t,i){return e?this.generateBodyContent(e,t,{method:"POST ",url:function(e,t,i){return""},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}},i):""},Oa.prototype.generateUpdateRequest=function(e,i,t,n){var o,r=this;return e?(e.forEach(function(t){return t=r.compareAndRemove(t,n.filter(function(e){return Sa.getObject(i.key,e)===Sa.getObject(i.key,t)})[0],i.key)}),o={method:this.options.updateType+" ",url:function(e,t,i){return"number"==typeof e[t][i]||Sa.parse.isGuid(e[t][i])?"("+e[t][i]+")":e[t][i]instanceof Date?"("+e[t][i].toJSON()+")":"('"+e[t][i]+"')"},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}},this.generateBodyContent(e,i,o,t)):""},Oa.getField=function(e){return e.replace(/\./g,"/")},Oa.prototype.generateBodyContent=function(e,t,i,n){for(var o="",r=0;r<e.length;r++)o=(o=(o+="\n"+t.cSet+"\n")+this.options.changeSetContent+"\n\n")+i.method,"POST "===i.method?o+=(n.dataSource.insertUrl||n.dataSource.crudUrl||t.url)+i.url(e,r,t.key)+" HTTP/1.1\n":"PUT "===i.method||"PATCH "===i.method?o+=(n.dataSource.updateUrl||n.dataSource.crudUrl||t.url)+i.url(e,r,t.key)+" HTTP/1.1\n":"DELETE "===i.method&&(o+=(n.dataSource.removeUrl||n.dataSource.crudUrl||t.url)+i.url(e,r,t.key)+" HTTP/1.1\n"),o=(o=(o+="Accept: "+this.options.accept+"\n")+"Content-Id: "+this.pvt.changeSet+++"\n")+this.options.batchChangeSetContentType+"\n",je(e[r]["@odata.etag"])?o+="\n":(o+="If-Match: "+e[r]["@odata.etag"]+"\n\n",delete e[r]["@odata.etag"]),o+=i.data(e,r);return o},Oa.prototype.processBatchResponse=function(e,t,i,n,o){if(i&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("xml"))return t.isCountRequired?{result:[],count:0}:[];if(n&&this.options.batch&&Sa.endsWith(n.url,this.options.batch)&&"post"===n.type.toLowerCase()){var r,s,a=e+"",t=(t=i.headers.get("Content-Type")).substring(t.indexOf("=batchresponse")+1);if((a=a.split(t)).length<2)return{};a=a[1];for(var n=/(?:\bContent-Type.+boundary=)(changesetresponse.+)/i.exec(a),e=(n&&a.replace(n[0],""),n?n[1]:""),l=(a=a.split(e)).length;-1<l;l--)/\bContent-ID:/i.test(a[l])&&/\bHTTP.+201/.test(a[l])&&(r=parseInt(/\bContent-ID: (\d+)/i.exec(a[l])[1],10),o.addedRecords[r])&&(s=Sa.parse.parseJson(/^\{.+\}/m.exec(a[l])[0]),Pe({},o.addedRecords[r],this.processResponse(s)));return o}return null},Oa.prototype.compareAndRemove=function(t,i,n){var o=this;return je(i)||Object.keys(t).forEach(function(e){e!==n&&"@odata.etag"!==e&&(Sa.isPlainObject(t[e])?(o.compareAndRemove(t[e],i[e]),0===Object.keys(t[e]).filter(function(e){return"@odata.etag"!==e}).length&&delete t[e]):(t[e]===i[e]||t[e]&&i[e]&&t[e].valueOf()===i[e].valueOf())&&delete t[e])}),t};var La,Ra=Oa;function Oa(e){var t=La.call(this)||this;return t.options=Pe({},t.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"}),Pe(t.options,e||{}),t}W(_a,Na=Ra),_a.prototype.getModuleName=function(){return"ODataV4Adaptor"},_a.prototype.onCount=function(e){return!0===e?"true":""},_a.prototype.onPredicate=function(e,t,i){var n="",o=e.value,r=o instanceof Date;if(t instanceof ya)for(var s=this.getQueryRequest(t),a=0;a<s.filters.length;a++)s.filters[a].e.key===e.value&&(i=!0);return n=Na.prototype.onPredicate.call(this,e,t,i),r&&(n=n.replace(/datetime'(.*)'$/,"$1")),n=Sa.parse.isGuid(o)?n.replace("guid","").replace(/'/g,""):n},_a.prototype.onEachSearch=function(e){var t=this.pvt.searches||[];t.push(e.key),this.pvt.searches=t},_a.prototype.onSearch=function(e){return this.pvt.searches.join(" OR ")},_a.prototype.onExpand=function(e){var s=this,a={},t={},i=e.expands.slice(),n=[];return e.selects.filter(function(e){return-1<e.indexOf(".")}).forEach(function(e){var t=e.split(".");if(t[0]in a||(a[t[0]]=[]),2===t.length)a[t[0]].length&&-1!==Object.keys(a).indexOf(t[0])?-1!==a[t[0]][0].indexOf("$expand")&&-1===a[t[0]][0].indexOf(";$select=")?a[t[0]][0]=a[t[0]][0]+";$select="+t[1]:a[t[0]][0]=a[t[0]][0]+","+t[1]:a[t[0]].push("$select="+t[1]);else{for(var e="$select="+t[t.length-1],i="",n="",o=1;o<t.length-1;o++)i=i+"$expand="+t[o]+"(",n+=")";var r,e=i+e+n;a[t[0]].length&&-1!==Object.keys(a).indexOf(t[0])&&s.expandQueryIndex(a[t[0]],!0)?(r=s.expandQueryIndex(a[t[0]]),a[t[0]][r]=a[t[0]][r]+e.replace("$expand=",",")):a[t[0]].push(e)}}),Object.keys(a).forEach(function(e){-1===i.indexOf(e)&&i.push(e)}),i.forEach(function(e){t[e]=e in a?e+"("+a[e].join(";")+")":e}),Object.keys(t).forEach(function(e){return n.push(t[e])}),n.join(",")},_a.prototype.expandQueryIndex=function(e,t){for(var i=0;i<e.length;i++)if(-1!==e[i].indexOf("$expand"))return!!t||i;return!t&&0},_a.prototype.onDistinct=function(e){return"groupby(("+e.map(function(e){return Ra.getField(e)}).join(",")+"))"},_a.prototype.onSelect=function(e){return Na.prototype.onSelect.call(this,e.filter(function(e){return-1===e.indexOf(".")}))},_a.prototype.beforeSend=function(e,t,i){"POST"!==i.type&&"PUT"!==i.type&&"PATCH"!==i.type||t.headers.set("Prefer","return=representation"),t.headers.set("Accept",this.options.accept)},_a.prototype.processResponse=function(e,t,i,n,o,r){var s="@odata.context",s=(o&&"GET"===o.type&&!this.rootUrl&&(e[s]||e["@context"])&&(s=(e[s]||e["@context"]).split("/$metadata#"),this.rootUrl=s[0],this.resourceTableName=s[1]),o&&o.pvtData),n=Na.prototype.processBatchResponse.call(this,e,i,n,o,r);return n||(o=null,r="@odata.count",i&&i.isCountRequired&&(r in e?o=e[r]:"@count"in e&&(o=e["@count"])),e=je(e.value)?e:e.value,(n={}).count=o,n.result=e,this.getAggregateResult(s,e,n,null,i),Sa.isNull(o)?n.result:{result:n.result,count:o,aggregates:n.aggregates})};var Na,Va=_a;function _a(e){var t=Na.call(this,e)||this;return t.options=Pe({},t.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"}),Pe(t.options,e||{}),t}W(ja,Ha=Ra),ja.prototype.getModuleName=function(){return"WebApiAdaptor"},ja.prototype.insert=function(e,t,i){return{type:"POST",url:e.dataSource.url,data:JSON.stringify(t)}},ja.prototype.remove=function(e,t,i,n){return{type:"DELETE",url:e.dataSource.url+"/"+i,data:JSON.stringify(i)}},ja.prototype.update=function(e,t,i,n){return{type:"PUT",url:e.dataSource.url,data:JSON.stringify(i)}},ja.prototype.batchRequest=function(o,r,s){for(var a=this,l=s.guid=Sa.getGuid(this.options.batchPre),e=o.dataSource.url.replace(/\/*$/,"/"+this.options.batch),h=(s.url=this.resourceTableName||s.url,[]),t=0,i=r.addedRecords.length;t<i;t++)!function(n){r.addedRecords.forEach(function(e,t){var i=function(e,t,i){return""};h.push("--"+l),h.push("Content-Type: application/http; msgtype=request",""),h.push("POST /api/"+(o.dataSource.insertUrl||o.dataSource.crudUrl||s.url)+i(r.addedRecords,n,s.key)+" HTTP/1.1"),h.push("Content-Type: application/json; charset=utf-8"),h.push("Host: "+location.host),h.push("",e?JSON.stringify(e):"")})}(t);for(t=0,i=r.changedRecords.length;t<i;t++)!function(n){r.changedRecords.forEach(function(e,t){a.options.updateType;var i=function(e,t,i){return""};h.push("--"+l),h.push("Content-Type: application/http; msgtype=request",""),h.push("PUT /api/"+(o.dataSource.updateUrl||o.dataSource.crudUrl||s.url)+i(r.changedRecords,n,s.key)+" HTTP/1.1"),h.push("Content-Type: application/json; charset=utf-8"),h.push("Host: "+location.host),h.push("",e?JSON.stringify(e):"")})}(t);for(t=0,i=r.deletedRecords.length;t<i;t++)!function(n){r.deletedRecords.forEach(function(e,t){var i=function(e,t,i){var n=Sa.getObject(i,e[t]);return"number"==typeof n||Sa.parse.isGuid(n)?"/"+n:n instanceof Date?"/"+e[t][i].toJSON():"/'"+n+"'"};h.push("--"+l),h.push("Content-Type: application/http; msgtype=request",""),h.push("DELETE /api/"+(o.dataSource.removeUrl||o.dataSource.crudUrl||s.url)+i(r.deletedRecords,n,s.key)+" HTTP/1.1"),h.push("Content-Type: application/json; charset=utf-8"),h.push("Host: "+location.host),h.push("",e?JSON.stringify(e):"")})}(t);return h.push("--"+l+"--",""),{type:"POST",url:e,contentType:"multipart/mixed; boundary="+l,data:h.join("\r\n")}},ja.prototype.beforeSend=function(e,t,i){t.headers.set("Accept","application/json, text/javascript, */*; q=0.01")},ja.prototype.processResponse=function(e,t,i,n,o,r){var s=o&&o.pvtData,a=null,l={};return o&&"post"!==o.type.toLowerCase()&&(o=(n=n&&o.fetchRequest.headers.get("DataServiceVersion"))&&parseInt(n,10)||2,i&&i.isCountRequired&&(Sa.isNull(e.Count)||(a=e.Count)),o<3&&e.Items&&(e=e.Items),l.count=a,l.result=e,this.getAggregateResult(s,e,l,null,i)),l.result=l.result||e,Sa.isNull(a)?l.result:{result:l.result,count:l.count,aggregates:l.aggregates}};var Ha,za=ja;function ja(){return null!==Ha&&Ha.apply(this,arguments)||this}W(Ua,Wa=Ba),Ua.prototype.processQuery=function(e,t,i){var e=(new Ba).processQuery(e,t,i),n=Sa.parse.parseJson(e.data),o={};if(n.param)for(var r=0;r<n.param.length;r++){var s=n.param[r],a=Object.keys(s)[0];o[a]=s[a]}o.value=n;return{data:JSON.stringify(o,Sa.parse.jsonDateReplacer),url:e.url,pvtData:e.pvtData,type:"POST",contentType:"application/json; charset=utf-8"}};var Wa,Qa=Ua;function Ua(){return null!==Wa&&Wa.apply(this,arguments)||this}W(Ya,qa=Ma),Ya.prototype.insert=function(e,t,i,n,o){return this.pvt.position=o,this.updateType="add",{url:e.dataSource.insertUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(Pe({},{value:t,table:i,action:"insert"},Sa.getAddParams(this,e,n)))}},Ya.prototype.remove=function(e,t,i,n,o){return qa.prototype.remove.call(this,e,t,i),{type:"POST",url:e.dataSource.removeUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(Pe({},{key:i,keyColumn:t,table:n,action:"remove"},Sa.getAddParams(this,e,o)))}},Ya.prototype.update=function(e,t,i,n,o){return this.updateType="update",this.updateKey=t,{type:"POST",url:e.dataSource.updateUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(Pe({},{value:i,action:"update",keyColumn:t,key:i[t],table:n},Sa.getAddParams(this,e,o)))}},Ya.prototype.processResponse=function(e,t,i,n,o,r,s){var a;if(e="batch"===(o?JSON.parse(o.data):e).action?Sa.parse.parseJson(e):e,"add"===this.updateType&&qa.prototype.insert.call(this,t,e,null,null,this.pvt.position),"update"===this.updateType&&qa.prototype.update.call(this,t,this.updateKey,e),this.updateType=void 0,e.added)for(a=0;a<e.added.length;a++)qa.prototype.insert.call(this,t,e.added[a]);if(e.changed)for(a=0;a<e.changed.length;a++)qa.prototype.update.call(this,t,s.key,e.changed[a]);if(e.deleted)for(a=0;a<e.deleted.length;a++)qa.prototype.remove.call(this,t,s.key,e.deleted[a]);return e},Ya.prototype.batchRequest=function(e,t,i,n,o){return{type:"POST",url:e.dataSource.batchUrl||e.dataSource.crudUrl||e.dataSource.url,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(Pe({},{changed:t.changedRecords,added:t.addedRecords,deleted:t.deletedRecords,action:"batch",table:i.url,key:i.key},Sa.getAddParams(this,e,n)))}},Ya.prototype.addParams=function(e){(new Ba).addParams(e)},Ya.prototype.beforeSend=function(e,t,i){};var qa,Ga=Ya;function Ya(){return qa.call(this)||this}W(Ja,Xa=Ba),Ja.prototype.getModuleName=function(){return"CustomDataAdaptor"};var Xa,Ka=Ja;function Ja(e){var t=Xa.call(this)||this;return t.options=Pe({},t.options,{getData:function(){},addRecord:function(){},updateRecord:function(){},deleteRecord:function(){},batchUpdate:function(){}}),Pe(t.options,e||{}),t}W(el,Za=Ba),el.prototype.getModuleName=function(){return"GraphQLAdaptor"},el.prototype.processQuery=function(e,t){var i=Za.prototype.processQuery.apply(this,arguments),n=JSON.parse(i.data),o={},r=(["skip","take","sorted","table","select","where","search","requiresCounts","aggregates","params"].filter(function(e){o[e]=-1<"searchwhereparams".indexOf(e)?JSON.stringify(n[e]):n[e]}),this.getVariables()||{}),r=(r.datamanager=o,JSON.stringify({query:this.getQuery(),variables:r}));return i.data=r,i},el.prototype.processResponse=function(e,t,i,n,o){var r,s,a=R(this.schema.result,e.data),e=(this.schema.count&&(r=R(this.schema.count,e.data)),this.schema.aggregates&&(s=je(s=R(this.schema.aggregates,e.data))?s:Sa.parse.parseJson(s)),o.pvtData||{}),o={result:a,aggregates:s};return e&&e.groups&&e.groups.length&&this.getAggregateResult(e,o,o,null,i),je(r)?o.result:{result:o.result,count:r,aggregates:s}},el.prototype.insert=function(){var e=Za.prototype.insert.apply(this,arguments);return this.generateCrudData(e,"insert")},el.prototype.update=function(){var e=Za.prototype.update.apply(this,arguments);return this.generateCrudData(e,"update")},el.prototype.remove=function(){var e=Za.prototype.remove.apply(this,arguments);return this.generateCrudData(e,"remove")},el.prototype.batchRequest=function(e,t,i,n,o){var r=Za.prototype.batchRequest.apply(this,arguments),s=JSON.parse(r.data);return s.key=i.key,r.data=JSON.stringify(s),this.generateCrudData(r,"batch")},el.prototype.generateCrudData=function(e,t){var i=JSON.parse(e.data);return e.data=JSON.stringify({query:this.opt.getMutation(t),variables:i}),e};var Za,$a=el;function el(e){var t=Za.call(this)||this;return t.opt=e,t.schema=t.opt.response,t.query=t.opt.query,t.getVariables=t.opt.getVariables||function(){},t.getQuery=function(){return t.query},t}W(nl,tl=Ba),nl.prototype.generateKey=function(e,t){var i=this.getQueryRequest(t),n=ya.filterQueryLists(t.queries,["onSelect","onPage","onSkip","onTake","onRange"]),o=e;"onPage"in n&&(o+=n.onPage.pageIndex),i.sorts.forEach(function(e){o+=e.e.direction+e.e.fieldName}),i.groups.forEach(function(e){o+=e.e.fieldName}),i.searches.forEach(function(e){o+=e.e.searchKey});for(var r=0;r<i.filters.length;r++){var s=i.filters[r];if(s.e.isComplex){var a=t.clone();a.queries=[];for(var l=0;l<s.e.predicates.length;l++)a.queries.push({fn:"onWhere",e:s.e.predicates[l],filter:t.queries.filter});o+=s.e.condition+this.generateKey(e,a)}else o+=s.e.field+s.e.operator+s.e.value}return o},nl.prototype.processQuery=function(e,t,i){e=this.generateKey(e.dataSource.url,t),t=Sa.parse.parseJson(window.localStorage.getItem(this.guidId)),t=t?t.results[t.keys.indexOf(e)]:null;return null==t||this.isCrudAction||this.isInsertAction?(this.isCrudAction=null,this.isInsertAction=null,this.cacheAdaptor.processQuery.apply(this.cacheAdaptor,[].slice.call(arguments,0))):t},nl.prototype.processResponse=function(e,t,i,n,o,r){if(this.isInsertAction||o&&this.cacheAdaptor.options.batch&&Sa.endsWith(o.url,this.cacheAdaptor.options.batch)&&"post"===o.type.toLowerCase())return this.cacheAdaptor.processResponse(e,t,i,n,o,r);e=this.cacheAdaptor.processResponse.apply(this.cacheAdaptor,[].slice.call(arguments,0));var n=i?this.generateKey(t.dataSource.url,i):t.dataSource.url,s={},o=(s=Sa.parse.parseJson(window.localStorage.getItem(this.guidId))).keys.indexOf(n);for(-1!==o&&(s.results.splice(o,1),s.keys.splice(o,1)),s.results[s.keys.push(n)-1]={keys:n,result:e.result,timeStamp:new Date,count:e.count};s.results.length>this.pageSize;)s.results.splice(0,1),s.keys.splice(0,1);return window.localStorage.setItem(this.guidId,JSON.stringify(s)),e},nl.prototype.beforeSend=function(e,t,i){!je(this.cacheAdaptor.options.batch)&&Sa.endsWith(i.url,this.cacheAdaptor.options.batch)&&"post"===i.type.toLowerCase()&&t.headers.set("Accept",this.cacheAdaptor.options.multipartAccept),e.dataSource.crossDomain||t.headers.set("Accept",this.cacheAdaptor.options.accept)},nl.prototype.update=function(e,t,i,n){return this.isCrudAction=!0,this.cacheAdaptor.update(e,t,i,n)},nl.prototype.insert=function(e,t,i){return this.isInsertAction=!0,this.cacheAdaptor.insert(e,t,i)},nl.prototype.remove=function(e,t,i,n){return this.isCrudAction=!0,this.cacheAdaptor.remove(e,t,i,n)},nl.prototype.batchRequest=function(e,t,i){return this.cacheAdaptor.batchRequest(e,t,i)};var tl,il=nl;function nl(e,r,t){var i=tl.call(this)||this,s=(i.isCrudAction=!1,i.isInsertAction=!1,je(e)||(i.cacheAdaptor=e),i.pageSize=t,i.guidId=Sa.getGuid("cacheAdaptor"),window.localStorage.setItem(i.guidId,JSON.stringify({keys:[],results:[]})),i.guidId);return je(r)||setInterval(function(){for(var e=Sa.parse.parseJson(window.localStorage.getItem(s)),t=[],i=0;i<e.results.length;i++){var n=+new Date,o=+new Date(e.results[i].timeStamp);e.results[i].timeStamp=n-o,r<n-o&&t.push(i)}for(i=0;i<t.length;i++)e.results.splice(t[i],1),e.keys.splice(t[i],1);window.localStorage.removeItem(s),window.localStorage.setItem(s,JSON.stringify(e))},r),i}var ol=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},rl=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},me=(Object.defineProperty(sl.prototype,"moduleName",{get:function(){return"datamanager"},enumerable:!0,configurable:!0}),sl.prototype.getPersistedData=function(e){e=localStorage.getItem(e||this.dataSource.id);return JSON.parse(e)},sl.prototype.setPersistData=function(e,t,i){localStorage.setItem(t||this.dataSource.id,JSON.stringify(i||this.persistQuery))},sl.prototype.setPersistQuery=function(e){var n=this,t=this.getPersistedData();return this.isInitialLoad&&t&&Object.keys(t).length?(this.persistQuery=t,this.persistQuery.queries=this.persistQuery.queries.filter(function(t){var e,i;return!(n.dataSource.ignoreOnPersist&&n.dataSource.ignoreOnPersist.length&&t.fn&&n.dataSource.ignoreOnPersist.some(function(e){return t.fn===e})||("onWhere"===t.fn&&(e=t.e)&&e.isComplex&&e.predicates instanceof Array&&(i=e.predicates.map(function(e){var t,i,n,o,r;return e.predicates&&e.predicates instanceof Array?(t=e.predicates.map(function(e){var t=e.field,i=e.operator,n=e.value,o=e.ignoreCase,r=e.ignoreAccent,e=e.matchCase;return new ba(t,i,n,o,r,e)}),"and"===e.condition?ba.and(t):ba.or(t)):(t=e.field,i=e.operator,n=e.value,o=e.ignoreCase,r=e.ignoreAccent,e=e.matchCase,new ba(t,i,n,o,r,e))}),t.e=new ba(i[0],e.condition,i.slice(1))),0))}),t=Pe(new ya,this.persistQuery),this.isInitialLoad=!1,t):(this.persistQuery=e,this.isInitialLoad=!1,e)},sl.prototype.setDefaultQuery=function(e){return this.defaultQuery=e,this},sl.prototype.executeLocal=function(e){this.defaultQuery||e instanceof ya||Sa.throwError("DataManager - executeLocal() : A query is required to execute"),this.dataSource.json||Sa.throwError("DataManager - executeLocal() : Json data is required to execute"),e=(e=this.dataSource.enablePersistence&&this.dataSource.id?this.setPersistQuery(e):e)||this.defaultQuery;var t=this.adaptor.processQuery(this,e);if(e.subQuery){var i=e.subQuery.fromTable,n=e.subQuery.lookups,o=e.isCountRequired?t.result:t;n&&n instanceof Array&&Sa.buildHierarchy(e.subQuery.fKey,i,o,n,e.subQuery.key);for(var r=0;r<o.length;r++)o[r][i]instanceof Array&&(o[r]=Pe({},{},o[r]),o[r][i]=this.adaptor.processResponse(e.subQuery.using(new sl(o[r][i].slice(0))).executeLocal(),this,e))}return this.adaptor.processResponse(t,this,e)},sl.prototype.executeQuery=function(t,e,i,n){var o,r=this,s="makeRequest",a=("function"==typeof(t=this.dataSource.enablePersistence&&this.dataSource.id?this.setPersistQuery(t):t)&&(n=i,i=e,e=t,t=null),(t=t||this.defaultQuery)instanceof ya||Sa.throwError("DataManager - executeQuery() : A query is required to execute"),new ll),l={query:t};return!this.dataSource.offline&&void 0!==this.dataSource.url&&""!==this.dataSource.url||!je(this.adaptor[s])||this.isCustomDataAdaptor(this.adaptor)?(o=this.isEnableCache?this.processQuery(t):this.adaptor.processQuery(this,t),je(this.adaptor[s])?!je(o.url)||this.isCustomDataAdaptor(this.adaptor)?(this.requests=[],this.makeRequest(o,a,l,t)):(l=sl.getDeferedArgs(t,o,l),a.resolve(l)):this.adaptor[s](o,a,l,t)):sl.nextTick(function(){var e=r.executeLocal(t);l=sl.getDeferedArgs(t,e,l),a.resolve(l)}),(e||i)&&a.promise.then(e,i),n&&a.promise.then(n,n),a.promise},sl.prototype.getQueryRequest=function(e){var t={sorts:[],groups:[],filters:[],searches:[],aggregates:[]};return t.sorts=ya.filterQueries(e.queries,"onSortBy"),t.groups=ya.filterQueries(e.queries,"onGroup"),t.filters=ya.filterQueries(e.queries,"onWhere"),t.searches=ya.filterQueries(e.queries,"onSearch"),t.aggregates=ya.filterQueries(e.queries,"onAggregates"),t},sl.prototype.generateKey=function(e,t){var i=this.getQueryRequest(t),n=ya.filterQueryLists(t.queries,["onSelect","onPage","onSkip","onTake","onRange"]),o=e;i.sorts.forEach(function(e){o+=e.e.direction+e.e.fieldName}),i.groups.forEach(function(e){o+=e.e.fieldName}),i.searches.forEach(function(e){o+=e.e.searchKey});for(var r=0;r<i.filters.length;r++){var s=i.filters[r];if(s.e.isComplex){var a=t.clone();a.queries=[];for(var l=0;l<s.e.predicates.length;l++)a.queries.push({fn:"onWhere",e:s.e.predicates[l],filter:t.queries.filter});o+=s.e.condition+this.generateKey(e,a)}else o+=s.e.field+s.e.operator+s.e.value}return je(this.previousCacheQuery)||this.previousCacheQuery===o||window.localStorage.setItem(this.guidId,JSON.stringify({keys:[],results:[]})),this.previousCacheQuery=o,"onPage"in n&&(o+=n.onPage.pageIndex),o},sl.prototype.processQuery=function(e){var t=this.generateKey(this.dataSource.url,e),i=JSON.parse(window.localStorage.getItem(this.guidId)),i=i?i.results[i.keys.indexOf(t)]:null;return null!=i?Sa.parse.parseJson(i):this.adaptor.processQuery(this,e)},sl.getDeferedArgs=function(e,t,i){return e.isCountRequired?(i.result=t.result,i.count=t.count,i.aggregates=t.aggregates):i.result=t,i},sl.nextTick=function(e){(window.setImmediate||window.setTimeout)(e,0)},sl.prototype.extendRequest=function(e,t,i){return Pe({},{type:"GET",dataType:this.dataSource.dataType,crossDomain:this.dataSource.crossDomain,jsonp:this.dataSource.jsonp,cache:!0,processData:!1,onSuccess:t,onFailure:i},e)},sl.prototype.makeRequest=function(e,a,l,s){function h(t,e){var i=new ll,n={parent:l},e=(s.subQuery.isChild=!0,d.adaptor.processQuery(d,s.subQuery,t?d.adaptor.processResponse(t):e)),e=d.makeRequest(e,i,n,s.subQuery);return p||i.then(function(e){t&&(Sa.buildHierarchy(s.subQuery.fKey,s.subQuery.fromTable,t,e,s.subQuery.key),u(t,e.count,e.xhr))},c),e}var t,d=this,p=!!s.subQuerySelector,c=function(e){l.error=e,a.reject(l)},u=function(e,t,i,n,o,r,s){l.xhr=i,l.count=t?parseInt(t.toString(),10):0,l.result=e,l.request=n,l.aggregates=r,l.actual=o,l.virtualSelectRecords=s,a.resolve(l)},i=this.extendRequest(e,function(e,o){if(d.isGraphQLAdaptor(d.adaptor)&&!je(e.errors))return c(e.errors);var r;-1===(o=d.isCustomDataAdaptor(d.adaptor)?Pe({},d.fetchReqOption,o):o).contentType.indexOf("xml")&&d.dateParse&&!d.isEnableCache&&(e=Sa.parse.parseJson(e)),d.afterReponseRequest(e).then(function(e){r=d.adaptor.processResponse(e,d,s,o.fetchRequest,o),d.isEnableCache&&(i=s?d.generateKey(d.dataSource.url,s):d.dataSource.url,n={},-1!==(t=(n=JSON.parse(window.localStorage.getItem(d.guidId))).keys.indexOf(i))&&(n.results.splice(t,1),n.keys.splice(t,1)),n.results[n.keys.push(i)-1]={keys:i,result:r.result,timeStamp:new Date,count:r.count},window.localStorage.setItem(d.guidId,JSON.stringify(n))),-1===o.contentType.indexOf("xml")&&d.dateParse&&d.isEnableCache&&(r=Sa.parse.parseJson(r));var t=0,i=null,n=e.virtualSelectRecords;s.isCountRequired&&(t=r.count,i=r.aggregates,r=r.result),s.subQuery?p||h(r,o):u(r,t,o.fetchRequest,o.type,e,i,n)}).catch(function(e){return d.dataManagerFailure(e,a,l)})},c);return this.isCustomDataAdaptor(this.adaptor)?(e=this.fetchReqOption=i,this.adaptor.options.getData({data:e.data,onSuccess:e.onSuccess,onFailure:e.onFailure})):this.useMiddleware(i).then(function(e){(t=new Qe(i)).beforeSend=function(){d.beforeSend(t.fetchRequest,t,e)},(i=t.send()).catch(function(e){return!0}),d.requests.push(t)}).catch(function(e){return d.dataManagerFailure(e,a,l)}),p&&((e=s.subQuerySelector.call(this,{query:s.subQuery,parent:s}))&&e.length?Promise.all([i,h(null,e)]).then(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e[0],n=d.adaptor.processResponse(i[0],d,s,d.requests[0].fetchRequest,d.requests[0]),o=0,i=(s.isCountRequired&&(o=n.count,n=n.result),d.adaptor.processResponse(i[1],d,s.subQuery,d.requests[1].fetchRequest,d.requests[1])),o=0;s.subQuery.isCountRequired&&(o=i.count,i=i.result),Sa.buildHierarchy(s.subQuery.fKey,s.subQuery.fromTable,n,i,s.subQuery.key),p=!1,u(n,o,d.requests[0].fetchRequest)}):p=!1),i},sl.prototype.dataManagerFailure=function(e,t,i){i.error=e,t.reject(i)},sl.prototype.afterReponseRequest=function(n){return ol(this,void 0,void 0,function(){var t,i;return rl(this,function(e){switch(e.label){case 0:return[4,this.applyPostRequestMiddlewares(n)];case 1:return t=e.sent(),(i=new ll).resolve(t),[2,i.promise]}})})},sl.prototype.applyPostRequestMiddlewares=function(t){return ol(this,void 0,void 0,function(){return rl(this,function(e){return[2,t]})})},sl.prototype.useMiddleware=function(n){return ol(this,void 0,void 0,function(){var t,i;return rl(this,function(e){switch(e.label){case 0:return[4,this.applyPreRequestMiddlewares(n)];case 1:return t=e.sent(),(i=new ll).resolve(t),[2,i.promise]}})})},sl.prototype.applyPreRequestMiddlewares=function(t){return ol(this,void 0,void 0,function(){return rl(this,function(e){return[2,t]})})},sl.prototype.beforeSend=function(e,t,i){this.adaptor.beforeSend(this,e,t);var n=[];this.dataSource.headers&&(n=n.concat(this.dataSource.headers)),i&&i.headers&&(n=n.concat(i.headers));for(var o=0;n&&o<n.length;o++)for(var r=[],s=0,a=Object.keys(n[o]);s<a.length;s++){var l=a[s];r.push(l),e.headers.set(l,n[o][l])}},sl.prototype.saveChanges=function(i,e,t,n,o){var r,s,a=this,l=(t instanceof ya&&(n=t,t=null),{url:t,key:e||this.dataSource.key}),t=this.adaptor.batchRequest(this,i,l,n||new ya,o),e="dofetchRequest";return this.dataSource.offline?t:je(this.adaptor[e])?this.isCustomDataAdaptor(this.adaptor)?this.dofetchRequest(t,this.adaptor.options.batchUpdate,i):(r=new ll,(s=new Qe(t)).beforeSend=function(){a.beforeSend(s.fetchRequest,s)},s.onSuccess=function(e,t){a.isGraphQLAdaptor(a.adaptor)&&!je(e.errors)&&s.onFailure(JSON.stringify(e.errors)),r.resolve(a.adaptor.processResponse(e,a,null,t.fetchRequest,t,i,l))},s.onFailure=function(e){r.reject([{error:e}])},s.send().catch(function(e){return!0}),r.promise):this.adaptor[e](t)},sl.prototype.insert=function(e,t,i,n){t instanceof ya&&(i=t,t=null);e=this.adaptor.insert(this,e,t,i,n),t="dofetchRequest";return this.dataSource.offline?e:je(this.adaptor[t])?this.dofetchRequest(e,this.adaptor.options.addRecord):this.adaptor[t](e)},sl.prototype.remove=function(e,t,i,n){"object"==typeof t&&(t=Sa.getObject(e,t)),i instanceof ya&&(n=i,i=null);e=this.adaptor.remove(this,e,t,i,n),t="dofetchRequest";return this.dataSource.offline?e:je(this.adaptor[t])?(i=this.adaptor.options.deleteRecord,this.dofetchRequest(e,i)):this.adaptor[t](e)},sl.prototype.update=function(e,t,i,n,o){i instanceof ya&&(n=i,i=null),this.isEnableCache&&(this.cacheQuery=this.generateKey(this.dataSource.url,n));e=this.adaptor.update(this,e,t,i,n,o),t="dofetchRequest";return this.dataSource.offline?e:je(this.adaptor[t])?(i=this.adaptor.options.updateRecord,this.dofetchRequest(e,i)):this.adaptor[t](e)},sl.prototype.isCustomDataAdaptor=function(e){return this.adaptor.getModuleName&&"CustomDataAdaptor"===this.adaptor.getModuleName()},sl.prototype.isGraphQLAdaptor=function(e){return this.adaptor.getModuleName&&"GraphQLAdaptor"===this.adaptor.getModuleName()},sl.prototype.successFunc=function(t,e,i){this.isGraphQLAdaptor(this.adaptor)&&!je((o="object"==typeof t?t:JSON.parse(t)).errors)&&this.failureFunc(JSON.stringify(o.errors)),this.isCustomDataAdaptor(this.adaptor)&&(e=Pe({},this.fetchReqOption,e));try{Sa.parse.parseJson(t)}catch(e){t=[]}if(this.isEnableCache){var n=JSON.parse(e.data);if("insert"===n.action||"remove"===n.action)window.localStorage.setItem(this.guidId,JSON.stringify({keys:[],results:[]}));else if("update"===n.action){var o,r=JSON.parse(window.localStorage.getItem(this.guidId));if((o=r?r.results[r.keys.indexOf(this.cacheQuery)]:null)&&o.result)for(var s=o.result,a=0;a<s.length;a++)if(s[a][n.keyColumn]===n.key){s[a]=n.value,window.localStorage.setItem(this.guidId,JSON.stringify(r));break}}}t=this.adaptor.processResponse(Sa.parse.parseJson(t),this,null,e.fetchRequest,e,i),this.fetchDeffered.resolve(t)},sl.prototype.failureFunc=function(e){this.isEnableCache&&(this.cacheQuery=""),this.fetchDeffered.reject([{error:e}])},sl.prototype.dofetchRequest=function(e,t,i){var n,o=this;return e=Pe({},{type:"POST",contentType:"application/json; charset=utf-8",processData:!1},e),this.fetchDeffered=new ll,this.isCustomDataAdaptor(this.adaptor)?(this.fetchReqOption=e,t.call(this,{data:e.data,onSuccess:this.successFunc.bind(this),onFailure:this.failureFunc.bind(this),changes:i})):((n=new Qe(e)).beforeSend=function(){o.beforeSend(n.fetchRequest,n)},n.onSuccess=this.successFunc.bind(this),n.onFailure=this.failureFunc.bind(this),n.send().catch(function(e){return!0})),this.fetchDeffered.promise},sl.prototype.clearPersistence=function(){window.removeEventListener("unload",this.setPersistData.bind(this)),this.dataSource.enablePersistence=!1,this.persistQuery={},window.localStorage.setItem(this.dataSource.id,"[]")},sl);function sl(e,t,i){var n,o=this;return this.dateParse=!0,this.timeZoneHandling=!0,this.persistQuery={},this.isInitialLoad=!1,this.requests=[],this.isEnableCache=!1,this.isInitialLoad=!0,this.isEnableCache=!1,e||this.dataSource||(e=[]),i=i||e.adaptor,e&&!1===e.timeZoneHandling&&(this.timeZoneHandling=e.timeZoneHandling),e instanceof Array?n={json:e,offline:!0}:"object"==typeof e?(e.json||(e.json=[]),e.enablePersistence||(e.enablePersistence=!1),e.id||(e.id=""),e.ignoreOnPersist||(e.ignoreOnPersist=[]),n={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,enableCache:e.enableCache,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 Ga||e.adaptor instanceof Ka||e.url),requiresFormat:e.requiresFormat,enablePersistence:e.enablePersistence,id:e.id,ignoreOnPersist:e.ignoreOnPersist}):Sa.throwError("DataManager: Invalid arguments"),void 0!==n.requiresFormat||Sa.isCors()||(n.requiresFormat=!!je(n.crossDomain)||n.crossDomain),void 0===n.dataType&&(n.dataType="json"),this.isEnableCache=n.enableCache,this.dataSource=n,this.defaultQuery=t,this.dataSource.enablePersistence&&this.dataSource.id&&window.addEventListener("unload",this.setPersistData.bind(this)),n.url&&n.offline&&!n.json.length?(this.isDataAvailable=!1,this.adaptor=i||new Ra,this.dataSource.offline=!1,this.ready=this.executeQuery(t||new ya),this.ready.then(function(e){o.dataSource.offline=!0,o.isDataAvailable=!0,n.json=e.result,o.adaptor=new Ma})):this.adaptor=new(n.offline?Ma:Ra),!n.jsonp&&this.adaptor instanceof Ra&&(n.jsonp="callback"),this.adaptor=i||this.adaptor,this.isEnableCache&&(this.guidId=Sa.getGuid("cacheAdaptor"),window.localStorage.setItem(this.guidId,JSON.stringify({keys:[],results:[]}))),n.enableCaching&&(this.adaptor=new il(this.adaptor,n.timeTillExpiration,n.cachingPageSize)),this}var al,ll=function(){var i=this;this.promise=new Promise(function(e,t){i.resolve=e,i.reject=t}),this.then=this.promise.then.bind(this.promise),this.catch=this.promise.catch.bind(this.promise)};function hl(e){var t,i;switch(e.toLowerCase()){case"materialdark":i="#303030";break;case"fabricdark":i="#201F1F";break;case"bootstrapdark":i="#1A1A1A"}switch(e.toLowerCase()){case"bootstrapdark":case"fabricdark":case"materialdark":t={backgroundColor:i,titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#DADADA",legendTextColor:"#DADADA",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:Cr,legendBorderColor:"#000000",legendBorderWidth:0};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",labelFontFamily:Cr,fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",titleFontWeight:"Normal",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"HelveticaNeue",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind":t={backgroundColor:"transparent",titleFontColor:"#374151",titleFontWeight:"Normal",subTitleFontColor:"#374151",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#374151",legendTextColor:"#374151",fontFamily:"Inter",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwinddark":t={backgroundColor:"transparent",titleFontColor:"#D1D5DB",titleFontWeight:"Normal",subTitleFontColor:"#D1D5DB",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#D1D5DB",legendTextColor:"#D1D5DB",fontFamily:"Inter",fontWeight:"Normal",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind3":t={backgroundColor:"transparent",titleFontColor:"#111827",titleFontWeight:"600",subTitleFontColor:"#111827",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#111827",legendTextColor:"#111827",fontFamily:"Inter",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind3dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Inter",fontWeight:"400",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5":t={backgroundColor:"transparent",titleFontColor:"#212529",titleFontWeight:"400",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5dark":t={backgroundColor:"transparent",titleFontColor:"#DEE2E6",titleFontWeight:"400",subTitleFontColor:"#DEE2E6",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#212529",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#DEE2E6",legendTextColor:"#DEE2E6",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",titleFontWeight:"Normal",subTitleFontColor:"#201F1E",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#323130",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#201F1E",legendTextColor:"#201F1E",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",titleFontWeight:"Normal",subTitleFontColor:"#F3F2F1",tooltipFillColor:"#252423",tooltipFontColor:"#F3F2F1",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#F3F2F1",legendTextColor:"#F3F2F1",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3":t={backgroundColor:"transparent",titleFontColor:"#1C1B1F",titleFontWeight:"500",subTitleFontColor:"#1C1B1F",tooltipFillColor:"#313033",tooltipFontColor:"#F4EFF4",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#1C1B1F",legendTextColor:"#49454E",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3dark":t={backgroundColor:"transparent",titleFontColor:"#E6E1E5",titleFontWeight:"500",subTitleFontColor:"#E6E1E5",tooltipFillColor:"#E6E1E5",tooltipFontColor:"#313033",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#E6E1E5",legendTextColor:"#CAC4D0",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2":t={backgroundColor:"transparent",titleFontColor:"#242424",titleFontWeight:"600",subTitleFontColor:"#242424",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#242424",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#242424",legendTextColor:"#242424",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#292929",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2highcontrast":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#FFF",legendBorderWidth:1,tooltipBorderColor:"#FFF",tooltipBorderWidth:1};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",titleFontWeight:"Normal",subTitleFontColor:"#424242",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#353535",legendTextColor:"#353535",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:Cr,legendBorderColor:"#000000",legendBorderWidth:0}}return t}(al=al||{}).mapsTitleFont={size:"14px",fontWeight:"Medium",color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"};pl.prototype.print=function(e,t){var i=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),n=(i.moveTo(0,0),i.resizeTo(screen.availWidth,screen.availHeight),{cancel:!1,htmlContent:this.getHTMLContent(e,t),name:rr});e.trigger(rr,n,function(){n.cancel||V(n.htmlContent,i)})},pl.prototype.getHTMLContent=function(e,t){var i,n,o=Q("div");return t?t instanceof Array?t.forEach(function(e){o.appendChild(ws(e).cloneNode(!0))}):t instanceof Element?o.appendChild(t.cloneNode(!0)):o.appendChild(ws(t).cloneNode(!0)):(je(n=(t=e.element.cloneNode(!0)).getElementsByTagName("svg")[0])||je(n=n.childNodes[0])||(i=n.getAttribute("fill"),"Tailwind"!==e.theme&&"Tailwind3"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==i&&"transparent"!==i?"TailwindDark"!==e.theme&&"Tailwind3Dark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==i&&"transparent"!==i||n.setAttribute("fill","rgba(0, 0, 0, 1)"):n.setAttribute("fill","rgba(255,255,255, 1)")),o.appendChild(t)),o},pl.prototype.getModuleName=function(){return"Print"},pl.prototype.destroy=function(){};var dl=pl;function pl(e){}ul.prototype.export=function(h,d,p,c){return new Promise(function(e,t){var i,n,o=Q("canvas",{id:"ej2-canvas",attrs:{height:h.availableSize.height.toString(),width:h.availableSize.width.toString()}}),r=h.svgObject.cloneNode(!0),s=r.childNodes[0],a=(je(s)||(s=s.getAttribute("fill"),"Tailwind"!==h.theme&&"Tailwind3"!==h.theme&&"Bootstrap5"!==h.theme&&"Fluent"!==h.theme&&"Material3"!==h.theme&&"Fluent2"!==h.theme||"rgba(255,255,255, 0.0)"!==s&&"transparent"!==s?"TailwindDark"!==h.theme&&"Tailwind3Dark"!==h.theme&&"Bootstrap5Dark"!==h.theme&&"FluentDark"!==h.theme&&"Material3Dark"!==h.theme&&"Fluent2Dark"!==h.theme&&"Fluent2HighContrast"!==h.theme||"rgba(255,255,255, 0.0)"!==s&&"transparent"!==s||r.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):r.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")),!(-1<F.userAgent.toString().indexOf("HeadlessChrome"))),s='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+r.outerHTML+"</svg>",l=window.URL.createObjectURL(new Blob("SVG"===d?[s]:[(new XMLSerializer).serializeToString(r)],{type:"image/svg+xml"}));"SVG"===d?c?ua(p,d,l,a):e(null):(i=new Image,n=o.getContext("2d"),i.onload=function(){n.drawImage(i,0,0),window.URL.revokeObjectURL(l),c?ua(p,d,o.toDataURL("image/png").replace("image/png","image/octet-stream"),a):"JPEG"===d?e(o.toDataURL("image/jpeg")):"PNG"===d&&e(o.toDataURL("image/png"))},i.src=l)})},ul.prototype.getModuleName=function(){return"ImageExport"},ul.prototype.destroy=function(){};var cl=ul;function ul(e){}function gl(e){return"[object String]"===Object.prototype.toString.call(e)?"$s"+e:"$o"+e.toString()}fl.prototype.getValue=function(e){e=this.table["$"+this.toStr(e)];if(void 0!==e)return e.value},fl.prototype.setValue=function(e,t){var i="$"+this.toStr(e);this.table[i];this.nElements++,this.table[i]={key:e,value:t}},fl.prototype.remove=function(e){var e="$"+this.toStr(e),t=this.table[e];return delete this.table[e],this.nElements--,t.value},fl.prototype.keys=function(){for(var e=[],t=Object.keys(this.table),i=0;i<t.length;i++){var n=this.table[t[i]];e.push(n.key)}return e},fl.prototype.values=function(){for(var e=[],t=Object.keys(this.table),i=0;i<t.length;i++){var n=this.table[t[i]];e.push(n.value)}return e},fl.prototype.containsKey=function(e){return!(void 0===this.getValue(e))},fl.prototype.clear=function(){this.table={},this.nElements=0},fl.prototype.size=function(){return this.nElements};var ml=fl;function fl(e){this.table={},this.nElements=0,this.toStr=e||gl}Object.defineProperty(vl.prototype,"status",{get:function(){return this.status6},set:function(e){this.status6=e},enumerable:!0,configurable:!0}),Object.defineProperty(vl.prototype,"isSaving",{get:function(){return this.isSaving6},set:function(e){this.isSaving6=e},enumerable:!0,configurable:!0}),Object.defineProperty(vl.prototype,"objectCollectionIndex",{get:function(){return this.index6},set:function(e){this.index6=e},enumerable:!0,configurable:!0}),Object.defineProperty(vl.prototype,"position",{get:function(){return this.position6},set:function(e){this.position6=e},enumerable:!0,configurable:!0}),Object.defineProperty(vl.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(vl.prototype,"value",{get:function(){return this.internalValue},set:function(e){var t=e;null!==e&&0<e.length?this.internalValue=this.normalizeValue(t=e):this.internalValue=t},enumerable:!0,configurable:!0}),vl.prototype.save=function(e){e.write(this.toString())},vl.prototype.toString=function(){return this.stringStartMark+this.escapeString(this.value)},vl.prototype.clone=function(e){var t=new vl;return t.value=this.internalValue,t},vl.prototype.escapeString=function(e){for(var t="",i=0,n=e.length;i<n;i++){var o=e[i];vl.delimiters.indexOf(o);t+=o}return t},vl.prototype.normalizeValue=function(e,t){return e},vl.delimiters="()<>[]{}/%}",vl.replacements=[" ","\t","\n","\r"];var yl=vl;function vl(e){this.stringStartMark="/",this.internalValue="",this.isSaving6=!1,this.position6=-1,this.internalValue=this.normalizeValue(e)}wl.obj="obj",wl.endObj="endobj",wl.r="R",wl.whiteSpace=" ",wl.slash="/",wl.newLine="\r\n",wl.stream="stream",wl.endStream="endstream",wl.xref="xref",wl.f="f",wl.n="n",wl.trailer="trailer",wl.startxref="startxref",wl.eof="%%EOF",wl.header="%PDF-1.5",wl.beginText="BT",wl.endText="ET",wl.beginPath="m",wl.appendLineSegment="l",wl.stroke="S",wl.fill="f",wl.fillEvenOdd="f*",wl.fillStroke="B",wl.fillStrokeEvenOdd="B*",wl.appendbeziercurve="c",wl.appendRectangle="re",wl.saveState="q",wl.restoreState="Q",wl.paintXObject="Do",wl.modifyCtm="cm",wl.modifyTM="Tm",wl.setLineWidth="w",wl.setLineCapStyle="J",wl.setLineJoinStyle="j",wl.setDashPattern="d",wl.setFlatnessTolerance="i",wl.closePath="h",wl.closeStrokePath="s",wl.closeFillStrokePath="b",wl.setCharacterSpace="Tc",wl.setWordSpace="Tw",wl.setHorizontalScaling="Tz",wl.setTextLeading="TL",wl.setFont="Tf",wl.setRenderingMode="Tr",wl.setTextRise="Ts",wl.setTextScaling="Tz",wl.setCoords="Td",wl.goToNextLine="T*",wl.setText="Tj",wl.setTextWithFormatting="TJ",wl.setTextOnNewLine="'",wl.selectcolorspaceforstroking="CS",wl.selectcolorspacefornonstroking="cs",wl.setrbgcolorforstroking="RG",wl.setrbgcolorfornonstroking="rg",wl.setcmykcolorforstroking="K",wl.setcmykcolorfornonstroking="k",wl.setgraycolorforstroking="G",wl.setgraycolorfornonstroking="g",wl.clipPath="W",wl.clipPathEvenOdd="W*",wl.endPath="n",wl.setGraphicsState="gs",wl.comment="%",wl.evenOdd="*",wl.setMiterLimit="M",wl.setColorAndPattern="scn",wl.setColorAndPatternStroking="SCN";var bl=wl;function wl(){this.forTest="test",this.forTest=wl.obj}var Cl=function(){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",this.viewerPreferences="ViewerPreferences",this.centerWindow="CenterWindow",this.displayTitle="DisplayTitle",this.fitWindow="FitWindow",this.hideMenuBar="HideMenubar",this.hideToolBar="HideToolbar",this.hideWindowUI="HideWindowUI",this.pageMode="PageMode",this.pageLayout="PageLayout",this.duplex="Duplex",this.printScaling="PrintScaling"},Sl=(Object.defineProperty(Al.prototype,"items",{get:function(){return this.primitiveItems},enumerable:!0,configurable:!0}),Object.defineProperty(Al.prototype,"status",{get:function(){return this.status7},set:function(e){this.status7=e},enumerable:!0,configurable:!0}),Object.defineProperty(Al.prototype,"isSaving",{get:function(){return this.isSaving7},set:function(e){this.isSaving7=e},enumerable:!0,configurable:!0}),Object.defineProperty(Al.prototype,"objectCollectionIndex",{get:function(){return this.index7},set:function(e){this.index7=e},enumerable:!0,configurable:!0}),Object.defineProperty(Al.prototype,"clonedObject",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(Al.prototype,"position",{get:function(){return this.position7},set:function(e){this.position7=e},enumerable:!0,configurable:!0}),Object.defineProperty(Al.prototype,"Count",{get:function(){return this.primitiveItems.size()},enumerable:!0,configurable:!0}),Object.defineProperty(Al.prototype,"Dictionary",{get:function(){return this},enumerable:!0,configurable:!0}),Al.prototype.getArchive=function(){return this.archive},Al.prototype.setArchive=function(e){this.archive=e},Al.prototype.setEncrypt=function(e){this.encrypt=e,this.modify()},Al.prototype.getEncrypt=function(){return this.encrypt},Al.prototype.freezeChanges=function(e){this.bChanged=!1},Al.prototype.clone=function(e){return new Al},Al.prototype.modify=function(){this.bChanged=!0},Al.prototype.remove=function(e){"string"!=typeof e?(this.primitiveItems.remove(e.value),this.modify()):this.remove(new yl(e))},Al.prototype.containsKey=function(e){return this.primitiveItems.containsKey(e.toString())},Al.prototype.onBeginSave=function(){this.beginSave.sender.beginSave()},Al.prototype.onFontDictionaryBeginSave=function(){this.fontDictionaryBeginSave.sender.fontDictionaryBeginSave()},Al.prototype.onDescendantFontBeginSave=function(){this.descendantFontBeginSave.sender.descendantFontBeginSave()},Al.prototype.onTemplateBeginSave=function(){this.pageBeginDrawTemplate.sender.pageBeginSave()},Al.prototype.onBeginAnnotationSave=function(){this.annotationBeginSave.sender.beginSave()},Al.prototype.onSectionBeginSave=function(e){var t=this.sectionBeginSave;t.sender.beginSave(t.state,e)},Al.prototype.save=function(e,t){void 0===t?this.save(e,!0):(e.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(e),void 0!==this.pageBeginDrawTemplate&&this.onTemplateBeginSave(),0<this.Count&&this.saveItems(e),e.write(this.suffix),e.write(bl.newLine))},Al.prototype.saveItems=function(e){e.write(bl.newLine);for(var t=this.primitiveItems.keys(),i=this.primitiveItems.values(),n=0;n<t.length;n++){var o=t[n];new yl(o).save(e),e.write(bl.whiteSpace),i[n].save(e),e.write(bl.newLine)}},Al);function Al(e){if(this.position7=-1,this.primitiveItems=new ml,this.prefix="<<",this.suffix=">>",this.resources=[],this.object=null,this.archive=!0,this.isResource=!1,void 0===e)this.primitiveItems=new ml;else{this.primitiveItems=new ml;for(var t=e.items.keys(),i=e.items.values(),n=0;n<e.items.size();n++)this.primitiveItems.setValue(t[n],i[n]);this.status=e.status,this.freezeChanges(this)}this.encrypt=!0,this.dictionaryProperties=new Cl}var xl=function(e){this.sender=e},Il=function(e){this.sender=e},Tl=function(e){this.sender=e},El=function(e){this.sender=e},Dl=function(e,t){this.sender=e,this.state=t},Ml=function(e){this.sender=e},kl=(Object.defineProperty(Pl.prototype,"intValue",{get:function(){return this.value},set:function(e){this.value=e},enumerable:!0,configurable:!0}),Object.defineProperty(Pl.prototype,"isInteger",{get:function(){return this.integer},set:function(e){this.integer=e},enumerable:!0,configurable:!0}),Object.defineProperty(Pl.prototype,"status",{get:function(){return this.status5},set:function(e){this.status5=e},enumerable:!0,configurable:!0}),Object.defineProperty(Pl.prototype,"isSaving",{get:function(){return this.isSaving5},set:function(e){this.isSaving5=e},enumerable:!0,configurable:!0}),Object.defineProperty(Pl.prototype,"objectCollectionIndex",{get:function(){return this.index5},set:function(e){this.index5=e},enumerable:!0,configurable:!0}),Object.defineProperty(Pl.prototype,"position",{get:function(){return this.position5},set:function(e){this.position5=e},enumerable:!0,configurable:!0}),Object.defineProperty(Pl.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Pl.prototype.save=function(e){e.write(this.intValue.toString())},Pl.prototype.clone=function(e){return new Pl(this.value)},Pl.floatToString=function(e){e=e.toFixed(2);return e="0.00"===e?".00":e},Pl.min=function(e,t,i){e=Math.min(e,t);return Math.min(i,e)},Pl);function Pl(e){this.position5=-1,this.value=e}Fl.prototype.items=function(e){return this.internalElements[e]},Object.defineProperty(Fl.prototype,"count",{get:function(){return this.internalElements.length},enumerable:!0,configurable:!0}),Object.defineProperty(Fl.prototype,"status",{get:function(){return this.status9},set:function(e){this.status9=e},enumerable:!0,configurable:!0}),Object.defineProperty(Fl.prototype,"isSaving",{get:function(){return this.isSaving9},set:function(e){this.isSaving9=e},enumerable:!0,configurable:!0}),Object.defineProperty(Fl.prototype,"clonedObject",{get:function(){return this.clonedObject9},enumerable:!0,configurable:!0}),Object.defineProperty(Fl.prototype,"position",{get:function(){return this.position9},set:function(e){this.position9=e},enumerable:!0,configurable:!0}),Object.defineProperty(Fl.prototype,"objectCollectionIndex",{get:function(){return this.index9},set:function(e){this.index9=e},enumerable:!0,configurable:!0}),Object.defineProperty(Fl.prototype,"CrossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(Fl.prototype,"elements",{get:function(){return this.internalElements},enumerable:!0,configurable:!0}),Fl.prototype.add=function(e){void 0===this.internalElements&&(this.internalElements=[]),this.internalElements.push(e),this.markedChange()},Fl.prototype.markedChange=function(){this.bChanged=!0},Fl.prototype.contains=function(e){for(var t=0;t<this.internalElements.length;t++){var i=this.internalElements[t],n=e;if(null!=i&&void 0!==i&&null!=n&&void 0!==n&&i.value===n.value)return!0}return!1},Fl.prototype.getItems=function(e){return this.internalElements[e]},Fl.prototype.save=function(e){e.write(this.startMark);for(var t=0,i=this.count;t<i;t++)this.getItems(t).save(e),t+1!==i&&e.write(bl.whiteSpace);e.write(this.endMark)},Fl.prototype.clone=function(e){this.clonedObject9=null;for(var t=new Fl,i=0;i<this.internalElements.length;i++){var n=this.internalElements[i];t.add(n.clone(e))}return t.pdfCrossTable=e,this.clonedObject9=t},Fl.fromRectangle=function(e){return new Fl([e.x,e.y,e.width,e.height])},Fl.prototype.insert=function(e,t){if(e<this.internalElements.length&&0<e){for(var i=[],n=0;n<e;n++)i.push(this.internalElements[n]);i.push(t);for(n=e;n<this.internalElements.length;n++)i.push(this.internalElements[n]);this.internalElements=i}else this.internalElements.push(t);this.markChanged()},Fl.prototype.indexOf=function(e){return this.internalElements.indexOf(e)},Fl.prototype.remove=function(e){e=this.internalElements.indexOf(e);this.internalElements[e]=null,this.markChanged()},Fl.prototype.removeAt=function(e){if(this.internalElements.length>e){for(var t=[],i=0;i<e;i++)t.push(this.internalElements[i]);for(i=e+1;i<this.internalElements.length;i++)t.push(this.internalElements[i]);this.internalElements=t}this.markChanged()},Fl.prototype.clear=function(){this.internalElements=[],this.markChanged()},Fl.prototype.markChanged=function(){this.bChanged=!0};var Bl=Fl;function Fl(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 Fl){var t=e;this.internalElements=[];for(n=0;n<t.elements.length;n++)this.internalElements.push(t.elements[n])}else for(var i=e,n=0;n<i.length;n++){var o=new kl(i[n]);this.add(o)}}Rl.save=function(e,t){if(null==e||""===e)throw new Error("ArgumentException: fileName cannot be undefined, null or empty");var i=e.substring(e.lastIndexOf(".")+1,e.length),n=this.getMimeType(i);""!==n&&(t=new Blob([t],{type:n})),this.isMicrosoftBrowser?navigator.msSaveBlob(t,e):(n=document.createElementNS("http://www.w3.org/1999/xhtml","a"),this.saveInternal(e,i,t,n,"download"in n))},Rl.saveInternal=function(e,t,i,n,o){var r,s;o?(n.download=e,r=window.URL.createObjectURL(i),n.href=r,(o=document.createEvent("MouseEvent")).initEvent("click",!0,!0),n.dispatchEvent(o),setTimeout(function(){window.URL.revokeObjectURL(r),r=void 0})):"docx"!==t&&"xlsx"!==t?(e=window.URL.createObjectURL(i),window.open(e,"_blank")||(window.location.href=e)):((s=new FileReader).onloadend=function(){window.open(s.result,"_blank")||(window.location.href=s.result)},s.readAsDataURL(i))},Rl.getMimeType=function(e){var t="";switch(e){case"html":t="text/html";break;case"pdf":t="application/pdf";break;case"docx":t="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case"xlsx":t="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";break;case"txt":t="text/plain"}return t};var Ll=Rl;function Rl(){}Object.defineProperty(Nl.prototype,"buffer",{get:function(){return this.flush(),this.bufferBlob},enumerable:!0,configurable:!0}),Nl.prototype.writeProcessingInstruction=function(e,t){if(null==e||0===e.length)throw new Error("ArgumentException: name should not be undefined, null or empty");if(this.checkName(e),null==t&&(t=""),3===e.length&&"xml"===e&&"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(e,t)},Nl.prototype.writeStartDocument=function(e){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!=e&&(this.rawText('" standalone="'),this.rawText(e?"yes":"no")),this.rawText('"?>')},Nl.prototype.writeEndDocument=function(){for(;0<this.elementStack.length-1;)this.writeEndElement();this.currentState="EndDocument",this.flush()},Nl.prototype.writeStartElement=function(e,t,i){if(void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");if(null==t||0===t.length)throw new Error("ArgumentException: localName cannot be undefined, null or empty");if(this.checkName(t),"Initial"===this.currentState&&this.writeStartDocument(),"StartElement"===this.currentState&&this.startElementContent(),this.currentState="StartElement",null==e)null==(e=null!=i?this.lookupPrefix(i):e)&&(e="");else if(0<e.length&&(null==(i=null==i?this.lookupNamespace(e):i)||void 0!==i&&0===i.length))throw new Error("ArgumentException: Cannot use a prefix with an empty namespace");null==i&&(i=this.lookupNamespace(e)),this.writeStartElementInternal(e,t,i)},Nl.prototype.writeEndElement=function(){"StartElement"===this.currentState?(this.startElementContent(),this.currentState="ElementContent"):"ElementContent"===this.currentState&&(this.currentState="ElementContent"),this.currentState="EndElement";var e=this.elementStack.length-1;this.writeEndElementInternal(this.elementStack[e].prefix,this.elementStack[e].localName),this.namespaceStack.splice(this.elementStack[e].previousTop+1),this.elementStack.splice(e),10240<this.bufferText.length&&this.flush()},Nl.prototype.writeElementString=function(e,t,i,n){this.writeStartElement(e,t,i),null!=n&&0!==n.length&&this.writeString(n),this.writeEndElement()},Nl.prototype.writeAttributeString=function(e,t,i,n){this.writeStartAttribute(e,t,i,n),this.writeStringInternal(n,!0),this.writeEndAttribute()},Nl.prototype.writeString=function(e){this.writeInternal(e,!1)},Nl.prototype.writeRaw=function(e){this.writeInternal(e,!0)},Nl.prototype.writeInternal=function(e,t){if(null!=e){if("StartElement"!==this.currentState&&"ElementContent"!==this.currentState)throw new Error("InvalidOperationException: Wrong Token");"StartElement"===this.currentState&&this.startElementContent(),this.currentState="ElementContent",t?this.rawText(e):this.writeStringInternal(e,!1)}},Nl.prototype.save=function(e){for(;0<this.elementStack.length-1;)this.writeEndElement();""!==this.bufferText&&this.flush(),Ll.save(e,this.buffer)},Nl.prototype.destroy=function(){this.bufferBlob=void 0;for(var e=0;e<this.namespaceStack.length;e++)this.namespaceStack[e].destroy();this.namespaceStack=[];for(e=0;e<this.elementStack.length;e++)this.elementStack[e].destroy();this.elementStack=[],this.bufferText="",this.contentPos=0},Nl.prototype.flush=function(){void 0!==this.bufferBlob&&(this.bufferBlob=new Blob([this.bufferBlob,this.bufferText],{type:"text/plain"}),this.bufferText="")},Nl.prototype.writeProcessingInstructionInternal=function(e,t){this.bufferText+="<?",this.rawText(e),0<t.length&&(this.bufferText+=" ",t=t.replace(/\?\>/g,"? >"),this.bufferText+=t),this.bufferText+="?",this.bufferText+=">"},Nl.prototype.writeStartAttribute=function(e,t,i,n){if(null==t||0===t.length){if("xmlns"!==e)throw new Error("ArgumentException: localName cannot be undefined, null or empty");t="xmlns",e=""}if("StartElement"!==this.currentState)throw new Error("InvalidOperationException: Wrong Token");this.checkName(t),this.writeStartAttributePrefixAndNameSpace(e,t,i,n)},Nl.prototype.writeStartAttributePrefixAndNameSpace=function(e,t,i,n){null==e&&null==(e=null==i||"xmlns"===t&&"http://www.w3.org/2000/xmlns/"===i?e:this.lookupPrefix(i))&&(e=""),null==i&&null==(i=null!=e&&0<e.length?this.lookupNamespace(e):i)&&(i=""),this.writeStartAttributeSpecialAttribute(e,t,i,n)},Nl.prototype.writeStartAttributeSpecialAttribute=function(e,t,i,n){if(0===e.length){if("x"===t[0]&&"xmlns"===t)return this.skipPushAndWrite(e,t,i),void this.pushNamespaceExplicit("",n);0<i.length&&(e=this.lookupPrefix(i))}else{if("x"===e[0]){if("xmlns"===e)return this.skipPushAndWrite(e,t,i),void this.pushNamespaceExplicit(t,n);if("xml"===e&&("space"===t||"lang"===t))return void this.skipPushAndWrite(e,t,i)}0===i.length&&(e="")}null!=e&&0!==e.length&&this.pushNamespaceImplicit(e,i),this.skipPushAndWrite(e,t,i)},Nl.prototype.writeEndAttribute=function(){this.currentState="StartElement",this.bufferText+='"'},Nl.prototype.writeStartElementInternal=function(e,t,i){this.bufferText+="<",0<e.length&&(this.rawText(e),this.bufferText+=":"),this.rawText(t);var n=this.elementStack.length;this.elementStack.push(new Hl),this.elementStack[n].set(e,t,i,this.namespaceStack.length-1),this.pushNamespaceImplicit(e,i);for(var o=0;o<this.attributeStack.length;o++)this.attributeStack[o].destroy();this.attributeStack=[]},Nl.prototype.writeEndElementInternal=function(e,t){this.contentPos!==this.bufferText.length+1?(this.bufferText+="</",null!=e&&0!==e.length&&(this.rawText(e),this.bufferText+=":"),this.rawText(t),this.bufferText+=">"):(this.bufferText=this.bufferText.substring(0,this.bufferText.length-1),this.bufferText+=" />")},Nl.prototype.writeStartAttributeInternal=function(e,t,i){this.bufferText+=" ",null!=e&&0<e.length&&(this.rawText(e),this.bufferText+=":"),this.rawText(t),this.bufferText+="=",this.bufferText+='"'},Nl.prototype.writeNamespaceDeclaration=function(e,t){this.writeStartNamespaceDeclaration(e),this.writeStringInternal(t,!0),this.bufferText+='"'},Nl.prototype.writeStartNamespaceDeclaration=function(e){null==e||0===e.length?this.rawText(' xmlns="'):(this.rawText(" xmlns:"),this.rawText(e),this.bufferText+="=",this.bufferText+='"')},Nl.prototype.writeStringInternal=function(e,t){e=(e=(e=(e=null==e?"":e).replace(/\&/g,"&amp;")).replace(/\</g,"&lt;")).replace(/\>/g,"&gt;"),t&&(e=e.replace(/\"/g,"&quot;")),this.bufferText+=e,t||(this.contentPos=0)},Nl.prototype.startElementContent=function(){for(var e=this.elementStack[this.elementStack.length-1].previousTop,t=this.namespaceStack.length-1;e<t;t--)"NeedToWrite"===this.namespaceStack[t].kind&&this.writeNamespaceDeclaration(this.namespaceStack[t].prefix,this.namespaceStack[t].namespaceUri);this.bufferText+=">",this.contentPos=this.bufferText.length+1},Nl.prototype.rawText=function(e){this.bufferText+=e},Nl.prototype.addNamespace=function(e,t,i){var n=this.namespaceStack.length;this.namespaceStack.push(new Vl),this.namespaceStack[n].set(e,t,i)},Nl.prototype.lookupPrefix=function(e){for(var t=this.namespaceStack.length-1;0<=t;t--)if(this.namespaceStack[t].namespaceUri===e)return this.namespaceStack[t].prefix},Nl.prototype.lookupNamespace=function(e){for(var t=this.namespaceStack.length-1;0<=t;t--)if(this.namespaceStack[t].prefix===e)return this.namespaceStack[t].namespaceUri},Nl.prototype.lookupNamespaceIndex=function(e){for(var t=this.namespaceStack.length-1;0<=t;t--)if(this.namespaceStack[t].prefix===e)return t;return-1},Nl.prototype.pushNamespaceImplicit=function(e,t){var i,n=this.lookupNamespaceIndex(e);if(-1!==n){if(n>this.elementStack[this.elementStack.length-1].previousTop){if(this.namespaceStack[n].namespaceUri!==t)throw new Error("XmlException namespace Uri needs to be the same as the one that is already declared");return}if("Special"===this.namespaceStack[n].kind){if("xml"!==e)throw new Error('InvalidArgumentException: Prefix "xmlns" is reserved for use by XML.');if(t!==this.namespaceStack[n].namespaceUri)throw new Error("InvalidArgumentException: Xml String");i="Implied"}else i=this.namespaceStack[n].namespaceUri===t?"Implied":"NeedToWrite"}else{if("http://www.w3.org/XML/1998/namespace"===t&&"xml"!==e||"http://www.w3.org/2000/xmlns/"===t&&"xmlns"!==e)throw new Error("InvalidArgumentException");i="NeedToWrite"}this.addNamespace(e,t,i)},Nl.prototype.pushNamespaceExplicit=function(e,t){var i=this.lookupNamespaceIndex(e);-1!==i&&i>this.elementStack[this.elementStack.length-1].previousTop?this.namespaceStack[i].kind="Written":this.addNamespace(e,t,"Written")},Nl.prototype.addAttribute=function(e,t,i){var n=this.attributeStack.length;this.attributeStack.push(new jl),this.attributeStack[n].set(e,t,i);for(var o=0;o<n;o++)if(this.attributeStack[o].isDuplicate(e,t,i))throw new Error("XmlException: duplicate attribute name")},Nl.prototype.skipPushAndWrite=function(e,t,i){this.addAttribute(e,t,i),this.writeStartAttributeInternal(e,t,i)},Nl.prototype.checkName=function(e){if(/[ !@#$%^&*()+\=\[\]{};':"\\|,<>\/?]/.test(e))throw new Error("InvalidArgumentException: invalid name character")};var Ol=Nl;function Nl(){this.contentPos=0,this.bufferText="",this.bufferBlob=new Blob([""],{type:"text/plain"}),this.currentState="Initial",this.namespaceStack=[],this.namespaceStack.push(new Vl),this.namespaceStack[0].set("xmlns","http://www.w3.org/2000/xmlns/","Special"),this.namespaceStack.push(new Vl),this.namespaceStack[1].set("xml","http://www.w3.org/XML/1998/namespace","Special"),this.namespaceStack.push(new Vl),this.namespaceStack[2].set("","","Implied"),this.elementStack=[],this.elementStack.push(new Hl),this.elementStack[0].set("","","",this.namespaceStack.length-1),this.attributeStack=[],Ll.isMicrosoftBrowser=!!navigator.msSaveBlob}_l.prototype.set=function(e,t,i){this.prefix=e,this.namespaceUri=t,this.kind=i},_l.prototype.destroy=function(){this.prefix=void 0,this.namespaceUri=void 0,this.kind=void 0};var Vl=_l;function _l(){}zl.prototype.set=function(e,t,i,n){this.previousTop=n,this.prefix=e,this.namespaceUri=i,this.localName=t},zl.prototype.destroy=function(){this.previousTop=void 0,this.prefix=void 0,this.localName=void 0,this.namespaceUri=void 0};var Hl=zl;function zl(){}Wl.prototype.set=function(e,t,i){this.prefix=e,this.namespaceUri=i,this.localName=t},Wl.prototype.isDuplicate=function(e,t,i){return this.localName===t&&(this.prefix===e||this.namespaceUri===i)},Wl.prototype.destroy=function(){this.prefix=void 0,this.namespaceUri=void 0,this.localName=void 0};var jl=Wl;function Wl(){}Object.defineProperty(Ul.prototype,"includeBom",{get:function(){return this.emitBOM},enumerable:!0,configurable:!0}),Object.defineProperty(Ul.prototype,"type",{get:function(){return this.encodingType},set:function(e){this.encodingType=e},enumerable:!0,configurable:!0}),Ul.prototype.initBOM=function(e){this.emitBOM=null==e||e},Ul.prototype.getByteCount=function(e){return ql(e,"string"),""===e?this.utf8Len(e.charCodeAt(0)):(null!==this.type&&void 0!==this.type||(this.type="Ansi"),this.getByteCountInternal(e,0,e.length))},Ul.prototype.utf8Len=function(e){return e<=127?1:e<=2047?2:e<=65535?3:e<=2097151?4:0},Ul.prototype.isHighSurrogate=function(e){return 55296<=e&&e<=56319},Ul.prototype.toCodepoint=function(e,t){return 65536+((e=(1023&e)<<10)|1023&t)},Ul.prototype.getByteCountInternal=function(e,t,i){var n=0;if("Utf8"!==this.encodingType&&"Unicode"!==this.encodingType)return n=i;for(var o="Utf8"===this.encodingType,r=0;r<i;r++){var s,a,l=e.charCodeAt(o?t:t++);this.isHighSurrogate(l)?o?(s=l,a=e.charCodeAt(++t),n+=this.utf8Len(this.toCodepoint(s,a))):(n+=4,++r):n+=o?this.utf8Len(l):2,o&&t++}return n},Ul.prototype.getBytes=function(e,t,i){if(ql(e,"string"),ql(t,"charIndex"),ql(i,"charCount"),t<0||i<0)throw new RangeError("Argument Out Of Range Exception: charIndex or charCount is less than zero");if(e.length-t<i)throw new RangeError("Argument Out Of Range Exception: charIndex and charCount do not denote a valid range in string");if(""===e)return new ArrayBuffer(0);null!==this.type&&void 0!==this.type||(this.type="Ansi");var n=this.getByteCountInternal(e,t,i);switch(this.type){case"Utf8":return this.getBytesOfUtf8Encoding(n,e,t,i);case"Unicode":return this.getBytesOfUnicodeEncoding(n,e,t,i);default:return this.getBytesOfAnsiEncoding(n,e,t,i)}},Ul.prototype.getString=function(e,t,i){if(ql(e,"bytes"),ql(t,"index"),ql(i,"count"),t<0||i<0)throw new RangeError("Argument Out Of Range Exception: index or count is less than zero");if(e.byteLength-t<i)throw new RangeError("Argument Out Of Range Exception: index and count do not denote a valid range in bytes");if(0===e.byteLength||0===i)return"";null!==this.type&&void 0!==this.type||(this.type="Ansi");var n="",o=new Uint8Array(e);switch(this.type){case"Utf8":return this.getStringOfUtf8Encoding(o,t,i);case"Unicode":var r=new Uint16Array(e);return n=this.getStringofUnicodeEncoding(r,t,i);default:for(var s=t,a=0;a<i;a++){var l=o[s];n+=String.fromCharCode(l),s++}return n}},Ul.prototype.getBytesOfAnsiEncoding=function(e,t,i,n){for(var e=new ArrayBuffer(e),o=new Uint8Array(e),r=0,s=0;s<n;s++){var a=t.charCodeAt(i++);o[r]=a<2048?a:63,r++}return e},Ul.prototype.getBytesOfUtf8Encoding=function(e,t,i,n){for(var e=new ArrayBuffer(e),o=new Uint8Array(e),r=i,s=0,a=0;a<n;a++){var l=t.charCodeAt(r);l<=127?o[s]=l:l<2048?(o[s]=192|l>>6,o[++s]=128|63&l):l<55296||57344<=l?(o[s]=224|l>>12,o[++s]=128|l>>6&63,o[++s]=128|63&l):(o[s]=239,o[++s]=191,o[++s]=189),++s,++r}return e},Ul.prototype.getBytesOfUnicodeEncoding=function(e,t,i,n){for(var e=new ArrayBuffer(e),o=new Uint16Array(e),r=0;r<n;r++){var s=t.charCodeAt(r);o[r]=s}return e},Ul.prototype.getStringOfUtf8Encoding=function(e,t,i){for(var n=0,o=t,r="";n<i;n++){var s=e[o++];if(o>e.length)return r;127<s&&(191<s&&s<224&&o<i?s=(31&s)<<6|63&e[o]:223<s&&s<240&&o<e.byteLength?s=(15&s)<<12|(63&e[o])<<6|63&e[++o]:239<s&&s<248&&o<e.byteLength&&(s=(7&s)<<18|(63&e[o])<<12|(63&e[++o])<<6|63&e[++o]),++o),r+=String.fromCharCode(s)}return r},Ul.prototype.getStringofUnicodeEncoding=function(e,t,i){if(i>e.length)throw new RangeError("ArgumentOutOfRange_Count");for(var n=new Uint16Array(i),o=0;o<i&&o<e.length;o++)n[o]=e[t++];return String.fromCharCode.apply(null,n)},Ul.prototype.destroy=function(){this.emitBOM=void 0,this.encodingType=void 0};var Ql=Ul;function Ul(e){this.emitBOM=!0,this.encodingType="Ansi",this.initBOM(e)}function ql(e,t){if(null==e)throw new Error("ArgumentException: "+t+" cannot be null or undefined")}Object.defineProperty(Yl.prototype,"buffer",{get:function(){return this.flush(),this.bufferBlob},enumerable:!0,configurable:!0}),Object.defineProperty(Yl.prototype,"encoding",{get:function(){return this.enc},enumerable:!0,configurable:!0}),Yl.prototype.init=function(e){null==e?(this.enc=new Ql(!1),this.enc.type="Utf8"):(this.enc=e,this.setBomByte())},Yl.prototype.setBomByte=function(){if(this.encoding.includeBom)switch(this.encoding.type){case"Unicode":var e=new ArrayBuffer(2),t=new Uint8Array(e);t[0]=255,t[1]=254,this.bufferBlob=new Blob([e]);break;case"Utf8":t=new ArrayBuffer(3),e=new Uint8Array(t);e[0]=239,e[1]=187,e[2]=191,this.bufferBlob=new Blob([t]);break;default:this.bufferBlob=new Blob([""])}},Yl.prototype.save=function(e){""!==this.bufferText&&this.flush(),Ll.save(e,this.buffer)},Yl.prototype.write=function(e){if(void 0===this.encoding)throw new Error("Object Disposed Exception: current writer is disposed");ql(e,"string"),this.bufferText+=e,10240<=this.bufferText.length&&this.flush()},Yl.prototype.flush=function(){var e;void 0!==this.bufferText&&null!==this.bufferText&&0!==this.bufferText.length&&(e=this.encoding.getBytes(this.bufferText,0,this.bufferText.length),this.bufferText="",this.bufferBlob=new Blob([this.bufferBlob,e]))},Yl.prototype.writeLine=function(e){if(void 0===this.encoding)throw new Error("Object Disposed Exception: current writer is disposed");ql(e,"string"),this.bufferText=this.bufferText+e+"\r\n",10240<=this.bufferText.length&&this.flush()},Yl.prototype.destroy=function(){this.bufferBlob=void 0,this.bufferText=void 0,this.enc instanceof Ql&&this.enc.destroy(),this.enc=void 0};var Gl=Yl;function Yl(e){this.bufferBlob=new Blob([""]),this.bufferText="",this.init(e),Ll.isMicrosoftBrowser=!!navigator.msSaveBlob}Kl.bitReverse=function(e){return Kl.reverseBits[15&e]<<12|Kl.reverseBits[e>>4&15]<<8|Kl.reverseBits[e>>8&15]<<4|Kl.reverseBits[e>>12]},Kl.bitConverterToInt32=function(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},Kl.bitConverterToInt16=function(e,t){return e[t]|e[t+1]<<8},Kl.bitConverterToUInt32=function(e){var t=new Uint32Array(1);return t[0]=e,t[0]},Kl.bitConverterToUInt16=function(e,t){var i=new Uint16Array(1);return i[0]=e[t]|e[t+1]<<8,i[0]},Kl.bitConverterUintToInt32=function(e){var t=new Int32Array(1);return t[0]=e,t[0]},Kl.bitConverterInt32ToUint=function(e){var t=new Uint32Array(1);return t[0]=e,t[0]},Kl.bitConverterInt32ToInt16=function(e){var t=new Int16Array(1);return t[0]=e,t[0]},Kl.byteToString=function(e){for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return t},Kl.byteIntToString=function(e){for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return t},Kl.arrayCopy=function(e,t,i,n,o){e=new Uint8Array(e.buffer,t).subarray(0,o);i.set(e,n)},Kl.mergeArray=function(e,t){var i=new Uint8Array(e.length+t.length);return i.set(e),i.set(t,e.length),i},Kl.encodedString=function(e){var t,i,n,o,r,s,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=0,h=0,d=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===a.charAt(64)&&d--,e.charAt(e.length-2)===a.charAt(64)&&d--,d%1!=0)throw new Error("Invalid base64 input, bad content length.");for(var p=new Uint8Array(0|d);l<e.length;)n=a.indexOf(e.charAt(l++)),t=(15&(o=a.indexOf(e.charAt(l++))))<<4|(r=a.indexOf(e.charAt(l++)))>>2,i=(3&r)<<6|(s=a.indexOf(e.charAt(l++))),p[h++]=n<<2|o>>4,64!==r&&(p[h++]=t),64!==s&&(p[h++]=i);return p},Kl.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],Kl.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var Xl=Kl;function Kl(){}var Jl=[],Zl=(Object.defineProperty($l.prototype,"items",{get:function(){return this.files},enumerable:!0,configurable:!0}),Object.defineProperty($l.prototype,"compressionLevel",{get:function(){return this.level},set:function(e){this.level=e},enumerable:!0,configurable:!0}),Object.defineProperty($l.prototype,"length",{get:function(){return void 0===this.files?0:this.files.length},enumerable:!0,configurable:!0}),$l.prototype.addItem=function(e){if(null==e)throw new Error("ArgumentException: item cannot be null or undefined");for(var t=0;t<this.files.length;t++){var i=this.files[t];if(i instanceof ih&&i.name===e.name)throw new Error("item with same name already exist")}this.files.push(e)},$l.prototype.addDirectory=function(e){if(null==e)throw new Error("ArgumentException: string cannot be null or undefined");if(0===e.length)throw new Error("ArgumentException: string cannot be empty");if("/"!==e.slice(-1)&&(e+="/"),-1!==this.files.indexOf(e))throw new Error("item with same name already exist");this.files.push(e)},$l.prototype.getItem=function(e){if(0<=e&&e<this.files.length)return this.files[e]},$l.prototype.contains=function(e){return-1!==this.files.indexOf(e)},$l.prototype.open=function(e){e=Xl.encodedString(e);if(0==e.length)throw new DOMException("stream");var e=new wh(e),t=$l.findValueFromEnd(e,101010256,65557);if(t<0)throw new DOMException("Can't locate end of central directory record. Possible wrong file format or archive is corrupt.");e.position=t+12;var i=$l.ReadInt32(e);e.position=t-i,this.readCentralDirectoryDataAndExtractItems(e)},$l.prototype.readCentralDirectoryDataAndExtractItems=function(e){if(null==e)throw new DOMException("stream");for(var t;33639248==$l.ReadInt32(e);)(t=new eh).readCentralDirectoryData(e);t.readData(e,t.checkCrc),t.decompressData(),this.files.push(new ih(t.unCompressedStream.buffer,t.name))},$l.prototype.save=function(i){if(null==i||0===i.length)throw new Error("ArgumentException: fileName cannot be null or undefined");if(0===this.files.length)throw new Error("InvalidOperation");var n=this;return new Promise(function(e,t){n.saveInternal(i,!1).then(function(){e(n)})})},$l.prototype.saveAsBlob=function(){var i=this;return new Promise(function(t,e){i.saveInternal("",!0).then(function(e){t(e)})})},$l.prototype.saveInternal=function(r,s){var a=this,l=this;return new Promise(function(t,e){for(var i=[],n=0,o=0;o<l.files.length;o++)a.getCompressedData(a.files[o]).then(function(e){n=l.constructZippedObject(i,e,n,e.isDirectory),i.length===l.files.length&&(e=l.writeZippedContent(r,i,n,s),t(e))})})},$l.prototype.destroy=function(){if(void 0!==this.files&&0<this.files.length){for(var e=0;e<this.files.length;e++){var t=this.files[e];t instanceof ih&&t.destroy(),t=void 0}this.files=[]}this.files=void 0,this.level=void 0},$l.prototype.getCompressedData=function(s){var a=this;return new Promise(function(o,e){var r;s instanceof ih?((r=new FileReader).onload=function(){var e=new Uint8Array(r.result),t={fileName:s.name,crc32Value:0,compressedData:[],compressedSize:void 0,uncompressedDataSize:e.length,compressionType:void 0,isDirectory:!1};if("Normal"===a.level){a.compressData(e,t,Jl);for(var i=0,n=0;n<t.compressedData.length;n++)i+=t.compressedData[n].length;t.compressedSize=i,t.compressionType="\b\0"}else t.compressedSize=e.length,t.crc32Value=a.calculateCrc32Value(0,e,Jl),t.compressionType="\0\0",t.compressedData.push(e);o(t)},r.readAsArrayBuffer(s.data)):o({fileName:s,crc32Value:0,compressedData:"",compressedSize:0,uncompressedDataSize:0,compressionType:"\0\0",isDirectory:!0})})},$l.prototype.compressData=function(e,t,i){var n=new lh(!0),o=0;do{if(o>=e.length){n.close();break}var r=Math.min(e.length,o+16384),s=e.subarray(o,r)}while(t.crc32Value=this.calculateCrc32Value(t.crc32Value,s,i),n.write(s,0,r-o),(o=r)<=e.length);t.compressedData=n.compressedData,n.destroy()},$l.prototype.constructZippedObject=function(e,t,i,n){var o=0,r=new Date,n=(n&&(o|=16),o|=0,this.writeHeader(t,r)),r="PK"+n+t.fileName,n=this.writeCentralDirectory(t,n,i,o);return e.push({localHeader:r,centralDir:n,compressedData:t}),i+r.length+t.compressedSize},$l.prototype.writeHeader=function(e,t){var i="";return i+"\n\0\0\0"+e.compressionType+this.getBytes(this.getModifiedTime(t),2)+this.getBytes(this.getModifiedDate(t),2)+this.getBytes(e.crc32Value,4)+this.getBytes(e.compressedSize,4)+this.getBytes(e.uncompressedDataSize,4)+this.getBytes(e.fileName.length,2)+this.getBytes(0,2)},$l.prototype.writeZippedContent=function(e,t,i,n){for(var o=0,r=[],s=0;s<t.length;s++){var a=t[s];for(o+=a.centralDir.length,r.push(this.getArrayBuffer(a.localHeader));a.compressedData.compressedData.length;)r.push(a.compressedData.compressedData.shift().buffer)}for(s=0;s<t.length;s++)r.push(this.getArrayBuffer(t[s].centralDir));r.push(this.getArrayBuffer(this.writeFooter(t,o,i)));i=new Blob(r,{type:"application/zip"});return n||Ll.save(e,i),i},$l.prototype.writeCentralDirectory=function(e,t,i,n){return"PK"+this.getBytes(20,2)+t+this.getBytes(0,2)+"\0\0\0\0"+this.getBytes(n,4)+this.getBytes(i,4)+e.fileName},$l.prototype.writeFooter=function(e,t,i){return"PK\0\0\0\0"+this.getBytes(e.length,2)+this.getBytes(e.length,2)+this.getBytes(t,4)+this.getBytes(i,4)+this.getBytes(0,2)},$l.prototype.getArrayBuffer=function(e){for(var t=new Uint8Array(e.length),i=0;i<e.length;++i)t[i]=255&e.charCodeAt(i);return t.buffer},$l.prototype.getBytes=function(e,t){for(var i="",n=0;n<t;n++)i+=String.fromCharCode(255&e),e>>>=8;return i},$l.prototype.getModifiedTime=function(e){var t=e.getHours();return(t=((t<<=6)|e.getMinutes())<<5)|e.getSeconds()/2},$l.prototype.getModifiedDate=function(e){var t=e.getFullYear()-1980;return(t=((t<<=4)|e.getMonth()+1)<<5)|e.getDate()},$l.prototype.calculateCrc32Value=function(e,t,i){e^=-1;for(var n=0;n<t.length;n++)e=e>>>8^i[255&(e^t[n])];return-1^e},$l.initCrc32Table=function(){for(var e=0;e<256;e++){for(var t=e,i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;Jl[e]=t}},$l.findValueFromEnd=function(e,t,i){if(null==e)throw new DOMException("stream");var n=e.inputStream.buffer.byteLength;if(n<4)return-1;var o=new Uint8Array(4),r=Math.max(0,n-i),s=n-1-4,a=(e.position=s,e.read(o,0,4),o[0]),l=a==t;if(!l)for(;r<s;)if(a<<=8,e.position=--s,(a+=e.readByte())==t){l=!0;break}return l?s:-1},$l.ReadInt32=function(e){var t=new Uint8Array(4);if(4!=e.read(t,0,4))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return Xl.bitConverterToInt32(t,0)},$l.ReadInt16=function(e){var t=new Uint8Array(2);if(2!=e.read(t,0,2))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return Xl.bitConverterToInt16(t,0)},$l.ReadUInt16=function(e){var t=new Uint8Array(2);if(2!=e.read(t,0,2))throw new DOMException("Unable to read value at the specified position - end of stream was reached.");return Xl.bitConverterToInt16(t,0)},$l);function $l(){0===Jl.length&&$l.initCrc32Table(),this.files=[],this.level="Normal",Ll.isMicrosoftBrowser=!!navigator.msSaveBlob}th.prototype.readCentralDirectoryData=function(e){e.position+=4,this.options=Zl.ReadInt16(e),this.compressionMethod=Zl.ReadInt16(e),this.checkCrc=99!=this.compressionMethod;Zl.ReadInt32(e);this.crc32=Xl.bitConverterToUInt32(Zl.ReadInt32(e)),this.compressedSize=Zl.ReadInt32(e),this.originalSize=Zl.ReadInt32(e);var t=Zl.ReadInt16(e),i=Zl.ReadInt16(e),n=Zl.ReadInt16(e),o=(e.position+=4,this.externalAttributes=Zl.ReadInt32(e),this.localHeaderOffset=Zl.ReadInt32(e),new Uint8Array(t));e.read(o,0,t);t=(t=Xl.byteToString(o)).replace("\\","/");this.name=t,e.position+=i+n,0!=this.options&&(this.options=0)},th.prototype.readData=function(e,t){if(0==e.length)throw new DOMException("stream");e.position=this.localHeaderOffset,this.checkCrc=t,this.readLocalHeader(e),this.readCompressedData(e)},th.prototype.decompressData=function(){8==this.compressionMethod&&0<this.originalSize&&this.decompressDataOld()},th.prototype.decompressDataOld=function(){for(var e,t,i=new vh(this.compressedStream,!0),n=(0<this.originalSize&&(e=new wh(new Uint8Array(this.originalSize))),new Uint8Array(4096));0<(t=i.read(n,0,4096));)e.write(n.subarray(0,t),0,t);this.unCompressedStream=e.toByteArray(),this.checkCrc},th.prototype.readLocalHeader=function(e){if(0==e.length)throw new DOMException("stream");if(Zl.ReadInt32(e)!=this.headerSignature)throw new DOMException("Can't find local header signature - wrong file format or file is corrupt.");e.position+=22;var t=Zl.ReadInt16(e),i=Zl.ReadUInt16(e);if(99!=this.compressionMethod)if(2<i){if(e.position+=t,23==Zl.ReadInt16(e))throw new DOMException("UnSupported");e.position+=i-2}else e.position+=t+i},th.prototype.readCompressedData=function(e){if(0<this.compressedSize){for(var t=this.compressedSize,i=new wh(new Uint8Array(t)),n=new Uint8Array(4096);0<t;){var o=Math.min(t,4096);if(e.read(n,0,o)!=o)throw new DOMException("End of file reached - wrong file format or file is corrupt.");i.write(n.subarray(0,o),0,o),t-=o}this.compressedStream=new Uint8Array(i.inputStream)}else this.compressedSize<0||this.compressedSize};var eh=th;function th(){this.headerSignature=67324752,this.checkCrc=!0,this.crc32=0}Object.defineProperty(nh.prototype,"dataStream",{get:function(){return this.decompressedStream},enumerable:!0,configurable:!0}),Object.defineProperty(nh.prototype,"name",{get:function(){return this.fileName},set:function(e){this.fileName=e},enumerable:!0,configurable:!0}),nh.prototype.destroy=function(){this.fileName=void 0,this.data=void 0};var ih=nh;function nh(e,t){if(null==e)throw new Error("ArgumentException: data cannot be null or undefined");if(null==t)throw new Error("ArgumentException: string cannot be null or undefined");if(0===t.length)throw new Error("string cannot be empty");this.data=e,this.name=t}var oh=new Int16Array(286),rh=new Uint8Array(286),sh=new Int16Array(30),ah=new Uint8Array(30),lh=(Object.defineProperty(hh.prototype,"compressedData",{get:function(){return this.stream},enumerable:!0,configurable:!0}),Object.defineProperty(hh.prototype,"getCompressedString",{get:function(){var e="";if(void 0!==this.stream)for(var t=0;t<this.stream.length;t++)e+=String.fromCharCode.apply(null,this.stream[t]);return e},enumerable:!0,configurable:!0}),hh.prototype.write=function(e,t,i){if(null==e)throw new Error("ArgumentException: data cannot null or undefined");var n,i=t+i;if(t<0||i<t||i>e.length)throw new Error("ArgumentOutOfRangeException: Offset or length is incorrect");for("string"==typeof e&&((n=new Ql(!1)).type="Utf8",i=t+(e=new Uint8Array(n.getBytes(e,0,e.length))).length),this.inputBuffer=e,this.inputOffset=t,this.inputEnd=i,this.noWrap||(this.checkSum=ch.checksumUpdate(this.checkSum,this.inputBuffer,this.inputOffset,i));this.inputEnd!==this.inputOffset||0!==this.pendingBufLength;)this.pendingBufferFlush(),this.compressData(!1)},hh.prototype.writeZLibHeader=function(){this.pendingBufferWriteShortBytes(30814)},hh.prototype.pendingBufferWriteShortBytes=function(e){this.pendingBuffer[this.pendingBufLength++]=e>>8,this.pendingBuffer[this.pendingBufLength++]=e},hh.prototype.compressData=function(e){do{this.fillWindow();var t=e&&this.inputEnd===this.inputOffset,i=this.compressSlow(t,e)}while(0===this.pendingBufLength&&i);return i},hh.prototype.compressSlow=function(e,t){if(this.lookAhead<262&&!e)return!1;for(;262<=this.lookAhead||e;){if(0===this.lookAhead)return this.lookAheadCompleted(t);this.stringStart>=2*this.windowSize-262&&this.slideWindow();var i=this.matchStart,n=this.matchLength;if(3<=this.lookAhead&&this.discardMatch(),3<=n&&this.matchLength<=n?this.matchPreviousBest(i,n):this.matchPreviousAvailable(),16384<=this.bufferPosition)return this.huffmanIsFull(t)}return!0},hh.prototype.discardMatch=function(){var e=this.insertString();0!==e&&this.stringStart-e<=this.maxDist&&this.findLongestMatch(e)&&this.matchLength<=5&&3===this.matchLength&&4096<this.stringStart-this.matchStart&&(this.matchLength=2)},hh.prototype.matchPreviousAvailable=function(){this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!0,this.stringStart++,this.lookAhead--},hh.prototype.matchPreviousBest=function(e,t){for(this.huffmanTallyDist(this.stringStart-1-e,t),t-=2;this.stringStart++,this.lookAhead--,3<=this.lookAhead&&this.insertString(),0<--t;);return this.stringStart++,this.lookAhead--,this.matchPrevAvail=!1,this.matchLength=2,t},hh.prototype.lookAheadCompleted=function(e){return this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!1,this.huffmanFlushBlock(this.dataWindow,this.blockStart,this.stringStart-this.blockStart,e),this.blockStart=this.stringStart,!1},hh.prototype.huffmanIsFull=function(e){var t=this.stringStart-this.blockStart,e=(this.matchPrevAvail&&t--,e&&0===this.lookAhead&&!this.matchPrevAvail);return this.huffmanFlushBlock(this.dataWindow,this.blockStart,t,e),this.blockStart+=t,!e},hh.prototype.fillWindow=function(){for(this.stringStart>=this.windowSize+this.maxDist&&this.slideWindow();this.lookAhead<262&&this.inputOffset<this.inputEnd;){var e=2*this.windowSize-this.lookAhead-this.stringStart;e>this.inputEnd-this.inputOffset&&(e=this.inputEnd-this.inputOffset),this.dataWindow.set(this.inputBuffer.subarray(this.inputOffset,this.inputOffset+e),this.stringStart+this.lookAhead),this.inputOffset+=e,this.totalBytesIn+=e,this.lookAhead+=e}3<=this.lookAhead&&this.updateHash()},hh.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(var e=0;e<this.hashSize;++e){var t=65535&this.hashHead[e];this.hashHead[e]=t>=this.windowSize?t-this.windowSize:0}for(e=0;e<this.windowSize;e++){t=65535&this.hashPrevious[e];this.hashPrevious[e]=t>=this.windowSize?t-this.windowSize:0}},hh.prototype.insertString=function(){var e,t=(this.currentHash<<this.hashShift^this.dataWindow[this.stringStart+2])&this.hashMask;return this.hashPrevious[this.stringStart&this.windowMask]=e=this.hashHead[t],this.hashHead[t]=this.stringStart,this.currentHash=t,65535&e},hh.prototype.findLongestMatch=function(e){var t,i=4096,n=258,o=this.stringStart,r=this.stringStart+this.matchLength,s=Math.max(this.matchLength,2),a=Math.max(this.stringStart-this.maxDist,0),l=this.stringStart+258-1,h=this.dataWindow[r-1],d=this.dataWindow[r],p=this.dataWindow;32<=s&&(i>>=2),n>this.lookAhead&&(n=this.lookAhead);do{if(p[e+s]===d&&p[e+s-1]===h&&p[e]===p[o]&&p[e+1]===p[o+1]){for(t=e+2,o+=2;p[++o]===p[++t]&&p[++o]===p[++t]&&p[++o]===p[++t]&&p[++o]===p[++t]&&p[++o]===p[++t]&&p[++o]===p[++t]&&p[++o]===p[++t]&&p[++o]===p[++t]&&o<l;);if(r<o){if(this.matchStart=e,n<=(s=(r=o)-this.stringStart))break;h=p[r-1],d=p[r]}o=this.stringStart}}while((e=65535&this.hashPrevious[e&this.windowMask])>a&&0!=--i);return this.matchLength=Math.min(s,this.lookAhead),3<=this.matchLength},hh.prototype.updateHash=function(){this.currentHash=this.dataWindow[this.stringStart]<<this.hashShift^this.dataWindow[this.stringStart+1]},hh.prototype.huffmanTallyLit=function(e){return this.arrDistances[this.bufferPosition]=0,this.arrLiterals[this.bufferPosition++]=e,this.treeLiteral.codeFrequencies[e]++,16384<=this.bufferPosition},hh.prototype.huffmanTallyDist=function(e,t){this.arrDistances[this.bufferPosition]=e,this.arrLiterals[this.bufferPosition++]=t-3;t=this.huffmanLengthCode(t-3),this.treeLiteral.codeFrequencies[t]++,265<=t&&t<285&&(this.extraBits+=Math.floor((t-261)/4)),t=this.huffmanDistanceCode(e-1);return this.treeDistances.codeFrequencies[t]++,4<=t&&(this.extraBits+=Math.floor(t/2-1)),16384<=this.bufferPosition},hh.prototype.huffmanFlushBlock=function(e,t,i,n){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 o=4,r=18;o<r;r--)0<this.treeCodeLengths.codeLengths[dh.huffCodeLengthOrders[r]]&&(o=r+1);for(var s=14+3*o+this.treeCodeLengths.getEncodedLength()+this.treeLiteral.getEncodedLength()+this.treeDistances.getEncodedLength()+this.extraBits,a=this.extraBits,r=0;r<286;r++)a+=this.treeLiteral.codeFrequencies[r]*rh[r];for(r=0;r<30;r++)a+=this.treeDistances.codeFrequencies[r]*ah[r];a<=s&&(s=a),0<=t&&i+4<s>>3?this.huffmanFlushStoredBlock(e,t,i,n):(s==a?(this.pendingBufferWriteBits(2+(n?1:0),3),this.treeLiteral.setStaticCodes(oh,rh),this.treeDistances.setStaticCodes(sh,ah)):(this.pendingBufferWriteBits(4+(n?1:0),3),this.huffmanSendAllTrees(o)),this.huffmanCompressBlock(),this.huffmanReset())},hh.prototype.huffmanFlushStoredBlock=function(e,t,i,n){this.pendingBufferWriteBits(0+(n?1:0),3),this.pendingBufferAlignToByte(),this.pendingBufferWriteShort(i),this.pendingBufferWriteShort(~i),this.pendingBufferWriteByteBlock(e,t,i),this.huffmanReset()},hh.prototype.huffmanLengthCode=function(e){if(255===e)return 285;for(var t=257;8<=e;)t+=4,e>>=1;return t+e},hh.prototype.huffmanDistanceCode=function(e){for(var t=0;4<=e;)t+=2,e>>=1;return t+e},hh.prototype.huffmanSendAllTrees=function(e){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(e-4,4);for(var t=0;t<e;t++)this.pendingBufferWriteBits(this.treeCodeLengths.codeLengths[dh.huffCodeLengthOrders[t]],3);this.treeLiteral.writeTree(this.treeCodeLengths),this.treeDistances.writeTree(this.treeCodeLengths)},hh.prototype.huffmanReset=function(){this.bufferPosition=0,this.extraBits=0,this.treeLiteral.reset(),this.treeDistances.reset(),this.treeCodeLengths.reset()},hh.prototype.huffmanCompressBlock=function(){for(var e=0;e<this.bufferPosition;e++){var t,i,n=255&this.arrLiterals[e],o=this.arrDistances[e];0!=o--?(t=this.huffmanLengthCode(n),this.treeLiteral.writeCodeToStream(t),0<(t=Math.floor((t-261)/4))&&t<=5&&this.pendingBufferWriteBits(n&(1<<t)-1,t),i=this.huffmanDistanceCode(o),this.treeDistances.writeCodeToStream(i),0<(t=Math.floor(i/2-1))&&this.pendingBufferWriteBits(o&(1<<t)-1,t)):this.treeLiteral.writeCodeToStream(n)}this.treeLiteral.writeCodeToStream(256)},hh.prototype.pendingBufferWriteBits=function(e,t){var i=new Uint32Array(1);i[0]=this.pendingBufCache|e<<this.pendingBufBitsInCache,this.pendingBufCache=i[0],this.pendingBufBitsInCache+=t,this.pendingBufferFlushBits()},hh.prototype.pendingBufferFlush=function(e){var t;this.pendingBufferFlushBits(),0<this.pendingBufLength&&((t=new Uint8Array(this.pendingBufLength)).set(this.pendingBuffer.subarray(0,this.pendingBufLength),0),this.stream.push(t)),this.pendingBufLength=0},hh.prototype.pendingBufferFlushBits=function(){for(var e=0;8<=this.pendingBufBitsInCache&&this.pendingBufLength<65536;)this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache,this.pendingBufCache>>=8,this.pendingBufBitsInCache-=8,e++;return e},hh.prototype.pendingBufferWriteByteBlock=function(e,t,i){e=e.subarray(t,t+i);this.pendingBuffer.set(e,this.pendingBufLength),this.pendingBufLength+=i},hh.prototype.pendingBufferWriteShort=function(e){this.pendingBuffer[this.pendingBufLength++]=e,this.pendingBuffer[this.pendingBufLength++]=e>>8},hh.prototype.pendingBufferAlignToByte=function(){0<this.pendingBufBitsInCache&&(this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache),this.pendingBufCache=0,this.pendingBufBitsInCache=0},hh.initHuffmanTree=function(){for(var e=0;e<144;)oh[e]=dh.bitReverse(48+e<<8),rh[e++]=8;for(;e<256;)oh[e]=dh.bitReverse(256+e<<7),rh[e++]=9;for(;e<280;)oh[e]=dh.bitReverse(-256+e<<9),rh[e++]=7;for(;e<286;)oh[e]=dh.bitReverse(-88+e<<8),rh[e++]=8;for(e=0;e<30;e++)sh[e]=dh.bitReverse(e<<11),ah[e]=5},hh.prototype.close=function(){for(;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)),this.inputEnd!==this.inputOffset||0!==this.pendingBufLength;);},hh.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},hh.isHuffmanTreeInitiated=!1,hh);function hh(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,hh.isHuffmanTreeInitiated||(hh.initHuffmanTree(),hh.isHuffmanTreeInitiated=!0),this.treeLiteral=new dh(this,286,257,15),this.treeDistances=new dh(this,30,1,15),this.treeCodeLengths=new dh(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)||this.writeZLibHeader()}Object.defineProperty(ph.prototype,"treeLength",{get:function(){return this.codeCount},enumerable:!0,configurable:!0}),Object.defineProperty(ph.prototype,"codeLengths",{get:function(){return this.codeLength},enumerable:!0,configurable:!0}),Object.defineProperty(ph.prototype,"codeFrequencies",{get:function(){return this.codeFrequency},enumerable:!0,configurable:!0}),ph.prototype.setStaticCodes=function(e,t){var i=new Int16Array(e.length),e=(i.set(e,0),this.codes=i,new Uint8Array(t.length));e.set(t,0),this.codeLength=e},ph.prototype.reset=function(){for(var e=0;e<this.codeFrequency.length;e++)this.codeFrequency[e]=0;this.codes=void 0,this.codeLength=void 0},ph.prototype.writeCodeToStream=function(e){this.writer.pendingBufferWriteBits(65535&this.codes[e],this.codeLength[e])},ph.prototype.buildCodes=function(){for(var e=new Int32Array(this.maxLength),t=(this.codes=new Int16Array(this.codeCount),0),i=0;i<this.maxLength;i++)e[i]=t,t+=this.lengthCount[i]<<15-i;for(var n=0;n<this.codeCount;n++){var o=this.codeLength[n];0<o&&(this.codes[n]=ph.bitReverse(e[o-1]),e[o-1]+=1<<16-o)}},ph.bitReverse=function(e){return ph.reverseBits[15&e]<<12|ph.reverseBits[e>>4&15]<<8|ph.reverseBits[e>>8&15]<<4|ph.reverseBits[e>>12]},ph.prototype.getEncodedLength=function(){for(var e=0,t=0;t<this.codeFrequency.length;t++)e+=this.codeFrequency[t]*this.codeLength[t];return e},ph.prototype.calculateBLFreq=function(e){for(var t,i,n=-1,o=0;o<this.codeCount;){var r=1,s=this.codeLength[o];for(0===s?(t=138,i=3):(t=6,i=3,n!==s&&(e.codeFrequency[s]++,r=0)),n=s,o++;o<this.codeCount&&n===this.codeLength[o]&&(o++,!(++r>=t)););r<i?e.codeFrequency[n]+=r:0!==n?e.codeFrequency[16]++:r<=10?e.codeFrequency[17]++:e.codeFrequency[18]++}},ph.prototype.writeTree=function(e){for(var t,i,n=-1,o=0;o<this.codeCount;){var r=1,s=this.codeLength[o];for(0===s?(t=138,i=3):(t=6,i=3,n!==s&&(e.writeCodeToStream(s),r=0)),n=s,o++;o<this.codeCount&&n===this.codeLength[o]&&(o++,!(++r>=t)););if(r<i)for(;0<r--;)e.writeCodeToStream(n);else 0!==n?(e.writeCodeToStream(16),this.writer.pendingBufferWriteBits(r-3,2)):r<=10?(e.writeCodeToStream(17),this.writer.pendingBufferWriteBits(r-3,3)):(e.writeCodeToStream(18),this.writer.pendingBufferWriteBits(r-11,7))}},ph.prototype.buildTree=function(){for(var e=this.codeFrequency.length,t=new Int32Array(e),i=0,n=0,o=0;o<e;o++){var r=this.codeFrequency[o];if(0!==r){for(var s=i++,a=0;0<s&&this.codeFrequency[t[a=Math.floor((s-1)/2)]]>r;)t[s]=t[a],s=a;n=t[s]=o}}for(;i<2;)t[i++]=n<2?++n:0;this.codeCount=Math.max(n+1,this.codeMinCount);for(var l=i,h=new Int32Array(4*i-2),d=new Int32Array(2*i-1),p=0;p<i;p++){var c=t[p],u=2*p;h[u]=c,h[1+u]=-1,d[p]=this.codeFrequency[c]<<8,t[p]=p}this.constructHuffmanTree(t,i,d,l,h),this.buildLength(h)},ph.prototype.constructHuffmanTree=function(e,t,i,n,o){do{for(var r=e[0],s=e[--t],a=i[s],l=0,h=1;h<t;)h+1<t&&i[e[h]]>i[e[h+1]]&&h++,e[l]=e[h],h=2*(l=h)+1;for(;0<(h=l)&&i[e[l=Math.floor((h-1)/2)]]>a;)e[h]=e[l];e[h]=s;var d=e[0],p=(o[2*(s=n++)]=r,o[2*s+1]=d,Math.min(255&i[r],255&i[d]));for(i[s]=a=i[r]+i[d]-p+1,l=0,h=1;h<t;)h+1<t&&i[e[h]]>i[e[h+1]]&&h++,e[l]=e[h],h=2*(l=h)+1;for(;0<(h=l)&&i[e[l=Math.floor((h-1)/2)]]>a;)e[h]=e[l]}while(e[h]=s,1<t)},ph.prototype.buildLength=function(e){this.codeLength=new Uint8Array(this.codeFrequency.length);for(var t=Math.floor(e.length/2),i=Math.floor((t+1)/2),n=0,o=0;o<this.maxLength;o++)this.lengthCount[o]=0;if(0!==(n=this.calculateOptimalCodeLength(e,n,t))){var r=this.maxLength-1;do{for(;0===this.lengthCount[--r];);for(;this.lengthCount[r]--,this.lengthCount[++r]++,0<(n-=1<<this.maxLength-1-r)&&r<this.maxLength-1;);}while(0<n);this.recreateTree(e,n,i)}},ph.prototype.recreateTree=function(e,t,i){this.lengthCount[this.maxLength-1]+=t,this.lengthCount[this.maxLength-2]-=t;for(var n=2*i,o=this.maxLength;0!==o;o--)for(var r=this.lengthCount[o-1];0<r;){var s=2*e[n++];-1===e[1+s]&&(this.codeLength[e[s]]=o,r--)}},ph.prototype.calculateOptimalCodeLength=function(e,t,i){var n=new Int32Array(i);n[i-1]=0;for(var o=i-1;0<=o;o--){var r,s=2*o+1;-1!==e[s]?((r=n[o]+1)>this.maxLength&&(r=this.maxLength,t++),n[e[s-1]]=n[e[s]]=r):(r=n[o],this.lengthCount[r-1]++,this.codeLength[e[s-1]]=n[o])}return t},ph.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],ph.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var dh=ph;function ph(e,t,i,n){this.writer=e,this.codeMinCount=i,this.maxLength=n,this.codeFrequency=new Uint16Array(t),this.lengthCount=new Int32Array(n)}uh.checksumUpdate=function(e,t,i,n){for(var o=new Uint32Array(1),e=(o[0]=e,o[0]),r=o[0]=65535&e,s=o[0]=e>>uh.checkSumBitOffset;0<n;){var a=Math.min(n,uh.checksumIterationCount);for(n-=a;0<=--a;)s+=r+=o[0]=255&t[i++];r%=uh.checksumBase,s%=uh.checksumBase}return s<<uh.checkSumBitOffset|r},uh.checkSumBitOffset=16,uh.checksumBase=65521,uh.checksumIterationCount=3800;var ch=uh;function uh(){}mh.init=function(){for(var e=new Uint8Array(288),t=0;t<144;)e[t++]=8;for(;t<256;)e[t++]=9;for(;t<280;)e[t++]=7;for(;t<288;)e[t++]=8;for(mh.m_LengthTree=new mh(e),e=new Uint8Array(32),t=0;t<32;)e[t++]=5;mh.m_DistanceTree=new mh(e)},mh.prototype.prepareData=function(e,t,i){for(var n=0,o=512,r=0;r<i.length;r++){var s=i[r];0<s&&e[s]++}for(var a=1;a<=mh.MAX_BITLEN;a++)t[a]=n,n+=e[a]<<16-a,10<=a&&(o+=(130944&n)-(130944&t[a])>>16-a);return{code:n,treeSize:o}},mh.prototype.treeFromData=function(e,t,i,n,o){for(var r=new Int16Array(o),s=512,a=mh.MAX_BITLEN;10<=a;a--)for(var l=130944&n,h=130944&(n-=e[a]<<16-a);h<l;h+=128)r[Xl.bitReverse(h)]=Xl.bitConverterInt32ToInt16(-s<<4|a),s+=1<<a-9;for(h=0;h<i.length;h++){a=i[h];if(0!=a){n=t[a];var d=Xl.bitReverse(n);if(a<=9)for(;r[d]=Xl.bitConverterInt32ToInt16(h<<4|a),(d+=1<<a)<512;);else for(var p=1<<(15&(c=r[511&d])),c=-(c>>4);r[c|d>>9]=Xl.bitConverterInt32ToInt16(h<<4|a),(d+=1<<a)<p;);t[a]=n+(1<<16-a)}}return r},mh.prototype.buildTree=function(e){var t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=this.prepareData(t,i,e);this.m_Tree=this.treeFromData(t,i,e,n.code,n.treeSize)},mh.prototype.unpackSymbol=function(e){var t,i,n,o;return 0<=(i=e.peekBits(9))?0<=(n=this.m_Tree[i])?(e.skipBits(15&n),n>>4):(t=-(n>>4),0<=(i=e.peekBits(15&n))?(n=this.m_Tree[t|i>>9],e.skipBits(15&n),n>>4):(o=e.availableBits,i=e.peekBits(o),(15&(n=this.m_Tree[t|i>>9]))<=o?(e.skipBits(15&n),n>>4):-1)):(o=e.availableBits,i=e.peekBits(o),0<=(n=this.m_Tree[i])&&(15&n)<=o?(e.skipBits(15&n),n>>4):-1)},Object.defineProperty(mh,"lengthTree",{get:function(){return this.m_LengthTree},enumerable:!0,configurable:!0}),Object.defineProperty(mh,"distanceTree",{get:function(){return this.m_DistanceTree},enumerable:!0,configurable:!0}),mh.MAX_BITLEN=15;var gh=mh;function mh(e){this.buildTree(e)}yh.ChecksumUpdate=function(e,t,i,n){for(var o=65535&e,r=e>>this.DEF_CHECKSUM_BIT_OFFSET;0<n;){var s=Math.min(n,this.DEF_CHECKSUM_ITERATIONSCOUNT);for(n-=s;0<=--s;)r+=o+=255&t[i++];o%=this.DEF_CHECKSUM_BASE,r%=this.DEF_CHECKSUM_BASE}this.DEF_CHECKSUM_BIT_OFFSET},yh.ChecksumGenerate=function(e,t,i){return yh.ChecksumUpdate(1,e,t,i),1},yh.DEF_CHECKSUM_BIT_OFFSET=16,yh.DEF_CHECKSUM_BASE=65521,yh.DEF_CHECKSUM_ITERATIONSCOUNT=3800;var fh=yh;function yh(){}Object.defineProperty(bh.prototype,"mBuffer",{get:function(){return this.tBuffer},set:function(e){this.tBuffer=e},enumerable:!0,configurable:!0}),bh.prototype.peekBits=function(e){if(e<0)throw new DOMException("count","Bits count can not be less than zero.");if(32<e)throw new DOMException("count","Count of bits is too large.");return this.mBufferedBits<e&&this.fillBuffer(),this.mBufferedBits<e?-1:Xl.bitConverterUintToInt32(this.mBuffer&~(4294967295<<e))},bh.prototype.fillBuffer=function(){var e=4-(this.mBufferedBits>>3)-(0!=(7&this.mBufferedBits)?1:0);if(0!=e)for(var t=this.mInputStream.read(this.mTempBuffer,0,e),i=0;i<t;i++)this.mBuffer=Xl.bitConverterInt32ToUint(this.mBuffer|Xl.bitConverterInt32ToUint(this.mTempBuffer[i]<<this.mBufferedBits)),this.mBufferedBits+=8},bh.prototype.skipBits=function(e){if(e<0)throw new DOMException("count","Bits count can not be less than zero.");0!==e&&(e>=this.mBufferedBits?(e-=this.mBufferedBits,this.mBufferedBits=0,(this.mBuffer=0)<e&&(this.mInputStream.position+=e>>3,0<(e&=7))&&(this.fillBuffer(),this.mBufferedBits-=e,this.mBuffer=Xl.bitConverterInt32ToUint(this.mBuffer>>>e))):(this.mBufferedBits-=e,this.mBuffer=Xl.bitConverterInt32ToUint(this.mBuffer>>>e)))},Object.defineProperty(bh.prototype,"availableBits",{get:function(){return this.mBufferedBits},enumerable:!0,configurable:!0}),bh.prototype.readZLibHeader=function(){var e=this.readInt16();if(-1===e)throw new DOMException("Header of the stream can not be read.");if(e%31!=0)throw new DOMException("Header checksum illegal");if(2048!=(e&this.DEF_HEADER_METHOD_MASK))throw new DOMException("Unsupported compression method.");if(this.mWindowSize=Math.pow(2,8+((e&this.DEF_HEADER_INFO_MASK)>>12)),65535<this.mWindowSize)throw new DOMException("Unsupported window size for deflate compression method.");if((e&this.DEF_HEADER_FLAGS_FDICT)>>5==1)throw new DOMException("Custom dictionary is not supported at the moment.")},bh.prototype.readInt16=function(){var e=this.readBits(8)<<8;return e|=this.readBits(8)},bh.prototype.readBits=function(e){var t=this.peekBits(e);return-1===t?-1:(this.mBufferedBits-=e,this.mBuffer=Xl.bitConverterInt32ToUint(this.mBuffer>>>e),t)},bh.prototype.decodeBlockHeader=function(){if(!this.mbCanReadNextBlock)return!1;var e=this.readBits(1);if(-1===e)return!1;var t=this.readBits(2);if(-1===t)return!1;switch(this.mbCanReadNextBlock=0===e,t){case 0:this.mbReadingUncompressed=!0,this.skipToBoundary();var i=this.readInt16Inverted();if(i!==(65535^this.readInt16Inverted()))throw new DOMException("Wrong block length.");if(65535<i)throw new DOMException("Uncompressed block length can not be more than 65535.");this.mUncompressedDataLength=i,this.mCurrentLengthTree=null,this.mCurrentDistanceTree=null;break;case 1:this.mbReadingUncompressed=!1,this.mUncompressedDataLength=-1,this.mCurrentLengthTree=gh.lengthTree,this.mCurrentDistanceTree=gh.distanceTree;break;case 2:this.mbReadingUncompressed=!1,this.mUncompressedDataLength=-1;i=this.decodeDynamicHeader(this.mCurrentLengthTree,this.mCurrentDistanceTree);this.mCurrentLengthTree=i.lengthTree,this.mCurrentDistanceTree=i.distanceTree;break;default:throw new DOMException("Wrong block type.")}return!0},bh.prototype.skipToBoundary=function(){this.mBuffer=Xl.bitConverterInt32ToUint(this.mBuffer>>>(7&this.mBufferedBits)),this.mBufferedBits&=-8},bh.prototype.readInt16Inverted=function(){var e=this.readBits(8);return e|=this.readBits(8)<<8},bh.prototype.decodeDynamicHeader=function(e,t){var i=0,n=this.readBits(5),o=this.readBits(5),r=this.readBits(4);if(n<0||o<0||r<0)throw new DOMException("Wrong dynamic huffman codes.");for(var s=(n+=257)+(o+=1),a=new Uint8Array(s),l=new Uint8Array(19),h=(r+=4,0);h<r;){var d=this.readBits(3);if(d<0)throw new DOMException("Wrong dynamic huffman codes.");l[this.defaultHuffmanDynamicTree[h++]]=d}for(var p=new gh(l),h=0;;){for(var c=void 0,u=!1,c=p.unpackSymbol(this);0==(-16&c);){if(a[h++]=i=c,h===s){u=!0;break}c=p.unpackSymbol(this)}if(u)break;if(c<0)throw new DOMException("Wrong dynamic huffman codes.");if(17<=c)i=0;else if(0===h)throw new DOMException("Wrong dynamic huffman codes.");var g=c-16,m=bh.DEF_HUFFMAN_DYNTREE_REPEAT_BITS[g],f=this.readBits(m);if(f<0)throw new DOMException("Wrong dynamic huffman codes.");if(s<h+(f+=bh.DEF_HUFFMAN_DYNTREE_REPEAT_MINIMUMS[g]))throw new DOMException("Wrong dynamic huffman codes.");for(;0<f--;)a[h++]=i;if(h===s)break}var y=new Uint8Array(n);return y.set(a.subarray(0,n),0),e=new gh(y),y=a.slice(n,n+o),{lengthTree:e,distanceTree:new gh(y)}},bh.prototype.readHuffman=function(){for(var e=this.DEF_MAX_WINDOW_SIZE-(this.mDataLength-this.mCurrentPosition),t=!1;e>=this.DEF_HUFFMAN_REPEATE_MAX;){for(var i=void 0,i=this.mCurrentLengthTree.unpackSymbol(this);0==(-256&i);){if((this.mDataLength+1)%this.DEF_MAX_WINDOW_SIZE,this.mBlockBuffer[this.mDataLength++%this.DEF_MAX_WINDOW_SIZE]=i,t=!0,--e<this.DEF_HUFFMAN_REPEATE_MAX)return!0;i=this.mCurrentLengthTree.unpackSymbol(this)}if(i<this.DEF_HUFFMAN_LENGTH_MINIMUMCODE){if(i<this.DEF_HUFFMAN_END_BLOCK)throw new DOMException("Illegal code.");var n=t?1:0;return this.mbCanReadMoreData=this.decodeBlockHeader(),!!(n|(this.mbCanReadMoreData?1:0))}if(i>this.DEF_HUFFMAN_LENGTH_MAXIMUMCODE)throw new DOMException("Illegal repeat code length.");var o=bh.DEF_HUFFMAN_REPEAT_LENGTH_BASE[i-this.DEF_HUFFMAN_LENGTH_MINIMUMCODE],n=bh.DEF_HUFFMAN_REPEAT_LENGTH_EXTENSION[i-this.DEF_HUFFMAN_LENGTH_MINIMUMCODE];if(0<n){if((r=this.readBits(n))<0)throw new DOMException("Wrong data.");o+=r}if((i=this.mCurrentDistanceTree.unpackSymbol(this))<0||i>bh.DEF_HUFFMAN_REPEAT_DISTANCE_BASE.length)throw new DOMException("Wrong distance code.");var r,s=bh.DEF_HUFFMAN_REPEAT_DISTANCE_BASE[i];if(0<(n=bh.DEF_HUFFMAN_REPEAT_DISTANCE_EXTENSION[i])){if((r=this.readBits(n))<0)throw new DOMException("Wrong data.");s+=r}for(var a=0;a<o;a++)this.mBlockBuffer[this.mDataLength%this.DEF_MAX_WINDOW_SIZE]=this.mBlockBuffer[(this.mDataLength-s)%this.DEF_MAX_WINDOW_SIZE],this.mDataLength++,e--;t=!0}return t},bh.prototype.read=function(e,t,i){if(null==e)throw new DOMException("buffer");if(t<0||t>e.length-1)throw new DOMException("offset","Offset does not belong to specified buffer.");if(i<0||i>e.length-t)throw new DOMException("length","Length is illegal.");for(var n=i;0<i;)if(this.mCurrentPosition<this.mDataLength){var o=this.mCurrentPosition%this.DEF_MAX_WINDOW_SIZE,r=Math.min(this.DEF_MAX_WINDOW_SIZE-o,this.mDataLength-this.mCurrentPosition),r=Math.min(r,i);Xl.arrayCopy(this.mBlockBuffer,o,e,t,r),this.mCurrentPosition+=r,t+=r,i-=r}else{if(!this.mbCanReadMoreData)break;r=this.mDataLength;if(this.mbReadingUncompressed)if(0===this.mUncompressedDataLength){if(this.mbCanReadMoreData=this.decodeBlockHeader(),!this.mbCanReadMoreData)break}else{var o=this.mDataLength%this.DEF_MAX_WINDOW_SIZE,s=Math.min(this.mUncompressedDataLength,this.DEF_MAX_WINDOW_SIZE-o),a=this.readPackedBytes(this.mBlockBuffer,o,s);if(s!==a)throw new DOMException("Not enough data in stream.");this.mUncompressedDataLength-=a,this.mDataLength+=a}else if(!this.readHuffman())break;r<this.mDataLength&&((s=r%this.DEF_MAX_WINDOW_SIZE)<(a=this.mDataLength%this.DEF_MAX_WINDOW_SIZE)?this.checksumUpdate(this.mBlockBuffer,s,a-s):(this.checksumUpdate(this.mBlockBuffer,s,this.DEF_MAX_WINDOW_SIZE-s),0<a&&this.checksumUpdate(this.mBlockBuffer,0,a)))}if(!this.mbCanReadMoreData&&!this.mbCheckSumRead&&!this.mbNoWrap){if(this.skipToBoundary(),this.readInt32()!==this.mCheckSum)throw new DOMException("Checksum check failed.");this.mbCheckSumRead=!0}return n-i},bh.prototype.readPackedBytes=function(e,t,i){if(null==e)throw new DOMException("buffer");if(t<0||t>e.length-1)throw new DOMException('offset", "Offset can not be less than zero or greater than buffer length - 1.');if(i<0)throw new DOMException('length", "Length can not be less than zero.');if(i>e.length-t)throw new DOMException('length", "Length is too large.');if(0!=(7&this.mBufferedBits))throw new DOMException("Reading of unalligned data is not supported.");if(0===i)return 0;for(var n=0;0<this.mBufferedBits&&0<i;)e[t++]=this.mBuffer,this.mBufferedBits-=8,this.mBuffer=Xl.bitConverterInt32ToUint(this.mBuffer>>>8),i--,n++;return 0<i&&(n+=this.mInputStream.read(e,t,i)),n},bh.prototype.readInt32=function(){var e=this.readBits(8)<<24;return(e|=this.readBits(8)<<16)|this.readBits(8)<<8|this.readBits(8)},bh.prototype.checksumUpdate=function(e,t,i){fh.ChecksumUpdate(this.mCheckSum,e,t,i)},bh.DEF_REVERSE_BITS=new Uint8Array([0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15]),bh.DEF_HUFFMAN_DYNTREE_REPEAT_MINIMUMS=[3,3,11],bh.DEF_HUFFMAN_DYNTREE_REPEAT_BITS=[2,3,7],bh.DEF_HUFFMAN_REPEAT_LENGTH_BASE=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],bh.DEF_HUFFMAN_REPEAT_LENGTH_EXTENSION=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],bh.DEF_HUFFMAN_REPEAT_DISTANCE_BASE=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],bh.DEF_HUFFMAN_REPEAT_DISTANCE_EXTENSION=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var vh=bh;function bh(e,t){if(this.defaultHuffmanDynamicTree=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],this.DEF_HEADER_METHOD_MASK=3840,this.DEF_HEADER_INFO_MASK=61440,this.DEF_HEADER_FLAGS_FCHECK=31,this.DEF_HEADER_FLAGS_FDICT=32,this.DEF_HEADER_FLAGS_FLEVEL=192,this.DEF_MAX_WINDOW_SIZE=65535,this.DEF_HUFFMAN_REPEATE_MAX=258,this.DEF_HUFFMAN_END_BLOCK=256,this.DEF_HUFFMAN_LENGTH_MINIMUMCODE=257,this.DEF_HUFFMAN_LENGTH_MAXIMUMCODE=285,this.DEF_HUFFMAN_DISTANCE_MAXIMUMCODE=29,this.mCheckSum=1,this.tBuffer=0,this.mBufferedBits=0,this.mTempBuffer=new Uint8Array(4),this.mBlockBuffer=new Uint8Array(this.DEF_MAX_WINDOW_SIZE),this.mbNoWrap=!1,this.mWindowSize=0,this.mCurrentPosition=0,this.mDataLength=0,this.mbCanReadNextBlock=!0,this.mbCanReadMoreData=!0,this.mbCheckSumRead=!1,null==e)throw new DOMException("stream");if(0===e.length)throw new DOMException("stream - string can not be empty");gh.init(),this.mInputStream=new wh(e),this.mbNoWrap=t,this.mbNoWrap||this.readZLibHeader(),this.decodeBlockHeader()}Object.defineProperty(Ch.prototype,"length",{get:function(){return this.inputStream.buffer.byteLength},enumerable:!0,configurable:!0}),Ch.prototype.read=function(e,t,i){t=new Uint8Array(this.inputStream.buffer,this.position+t).subarray(0,i);return e.set(t,0),this.position+=t.byteLength,t.byteLength},Ch.prototype.readByte=function(){return this.inputStream[this.position++]},Ch.prototype.write=function(e,t,i){Xl.arrayCopy(e,0,this.inputStream,this.position+t,i),this.position+=i},Ch.prototype.toByteArray=function(){return new Uint8Array(this.inputStream.buffer)};var wh=Ch;function Ch(e){this.position=0,this.inputStream=new Uint8Array(e.buffer)}Sh=function(e,t){return(Sh=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Sh(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ih,Ah=Sl),Object.defineProperty(Ih.prototype,"internalStream",{get:function(){return this.dataStream2},set:function(e){this.dataStream2=[],this.dataStream2=e,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(Ih.prototype,"compress",{get:function(){return this.bCompress},set:function(e){this.bCompress=e,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(Ih.prototype,"data",{get:function(){return this.dataStream2},set:function(e){this.dataStream2=[],this.dataStream2=e,this.modify()},enumerable:!0,configurable:!0}),Ih.prototype.clearStream=function(){this.internalStream=[],this.items.containsKey(this.dictionaryProperties.filter)&&this.remove(this.dictionaryProperties.filter),this.bCompress=!0,this.modify()},Ih.prototype.write=function(e){if(null==e)throw new Error("ArgumentNullException:text");if(e.length<=0)throw new Error("ArgumentException: Can not write an empty string, text");this.dataStream2.push(e),this.modify()},Ih.prototype.writeBytes=function(e){if(null===e)throw new Error("ArgumentNullException:data");if(e.length<=0)throw new Error("ArgumentException: Can not write an empty bytes, data");for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);this.dataStream2.push(t),this.modify()},Ih.prototype.onCmapBeginSave=function(){this.cmapBeginSave.sender.cmapBeginSave()},Ih.prototype.onFontProgramBeginSave=function(){this.fontProgramBeginSave.sender.fontProgramBeginSave()},Ih.prototype.compressContent=function(e,t){if(this.bCompress){for(var i=[],n=0;n<e.length;n++)i.push(e.charCodeAt(n));var o=new Uint8Array(i),r=new lh;r.write(o,0,o.length),r.close(),e=r.getCompressedString,this.addFilter(this.dictionaryProperties.flatedecode)}return e},Ih.prototype.addFilter=function(e){var t=this.items.getValue(this.dictionaryProperties.filter),i=t=t instanceof Fh?t.object:t;null!=t&&((i=new Bl).insert(0,t),this.items.setValue(this.dictionaryProperties.filter,i)),t=new yl(e),null==i?this.items.setValue(this.dictionaryProperties.filter,t):i.insert(0,t)},Ih.prototype.save=function(e){void 0!==this.cmapBeginSave&&this.onCmapBeginSave(),void 0!==this.fontProgramBeginSave&&this.onFontProgramBeginSave();for(var t="",i=0;i<this.data.length;i++)t+=this.data[i];1<t.length&&!this.isResource&&(t="q\r\n"+t+"Q\r\n");var n=(t=this.compressContent(t,e)).length;this.items.setValue(this.dictionaryProperties.length,new kl(n)),Ah.prototype.save.call(this,e,!1),e.write(this.dicPrefix),e.write(bl.newLine),0<t.length&&e.write(t),e.write(bl.newLine),e.write(this.dicSuffix),e.write(bl.newLine)},Ih.bytesToString=function(e){for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return t};var Sh,Ah,xh=Ih;function Ih(e,t){var i=Ah.call(this,e)||this;return i.dicPrefix="stream",i.dicSuffix="endstream",i.clonedObject2=null,i.bCompress=!0,void 0!==e||void 0!==t?(i.dataStream2=[],i.dataStream2=t,i.bCompress2=!1):(i.dataStream2=[],i.bCompress2=!0),i}var Th,Eh=function(e){this.sender=e},Dh=function(e){this.sender=e},Mh=((W=(W=Th=Th||{}).ForceEncoding||(W.ForceEncoding={}))[W.None=0]="None",W[W.Ascii=1]="Ascii",W[W.Unicode=2]="Unicode",Object.defineProperty(kh.prototype,"hex",{get:function(){return this.bHex},enumerable:!0,configurable:!0}),Object.defineProperty(kh.prototype,"value",{get:function(){return this.stringValue},set:function(e){this.stringValue=e,this.data=null},enumerable:!0,configurable:!0}),Object.defineProperty(kh.prototype,"status",{get:function(){return this.status1},set:function(e){this.status1=e},enumerable:!0,configurable:!0}),Object.defineProperty(kh.prototype,"isSaving",{get:function(){return this.isSaving1},set:function(e){this.isSaving1=e},enumerable:!0,configurable:!0}),Object.defineProperty(kh.prototype,"objectCollectionIndex",{get:function(){return this.index1},set:function(e){this.index1=e},enumerable:!0,configurable:!0}),Object.defineProperty(kh.prototype,"clonedObject",{get:function(){return this.clonedObject1},enumerable:!0,configurable:!0}),Object.defineProperty(kh.prototype,"position",{get:function(){return this.position1},set:function(e){this.position1=e},enumerable:!0,configurable:!0}),Object.defineProperty(kh.prototype,"CrossTable",{get:function(){return this.crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(kh.prototype,"converted",{get:function(){return this.bConverted},set:function(e){this.bConverted=e},enumerable:!0,configurable:!0}),Object.defineProperty(kh.prototype,"encode",{get:function(){return this.bForceEncoding},set:function(e){this.bForceEncoding=e},enumerable:!0,configurable:!0}),kh.bytesToHex=function(e){return null!=e&&0,""},kh.prototype.save=function(e){if(null===e)throw new Error("ArgumentNullException : writer");void 0!==this.encode&&this.encode===Th.ForceEncoding.Ascii?e.write(this.pdfEncode()):e.write(kh.stringMark[0]+this.value+kh.stringMark[1])},kh.prototype.pdfEncode=function(){var e="";if(void 0!==this.encode&&this.encode===Th.ForceEncoding.Ascii){for(var t=this.escapeSymbols(this.value),i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);e=kh.stringMark[0]+e+kh.stringMark[1]}else e=this.value;return e},kh.prototype.escapeSymbols=function(e){for(var t=[],i=0;i<e.length;i++){var n=e.charCodeAt(i);switch(n){case 40:case 41:t.push(92),t.push(n);break;case 13:t.push(92),t.push(114);break;case 92:t.push(92),t.push(n);break;default:t.push(n)}}return t},kh.prototype.clone=function(e){if(null!==this.clonedObject1&&this.clonedObject1.CrossTable===e)return this.clonedObject1;this.clonedObject1=null;var t=new kh(this.stringValue);return t.bHex=this.bHex,t.crossTable=e,t.isColorSpace=this.isColorSpace,this.clonedObject1=t},kh.toUnicodeArray=function(e,t){if(null==e)throw new Error("Argument Null Exception : value");for(var i=[],n=0;n<e.length;n++){var o=e.charCodeAt(n);i.push(o/256>>>0),i.push(255&o)}return i},kh.byteToString=function(e){if(null==e)throw new Error("Argument Null Exception : stream");for(var t="",i=0;i<e.length;++i)t+=String.fromCharCode(e[i]);return t},kh.stringMark="()",kh.hexStringMark="<>",kh.hexFormatPattern="{0:X2}",kh);function kh(e){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===e)this.bHex=!1;else if(!(0<e.length&&"0xfeff"===e[0])){this.stringValue=e,this.data=[];for(var t=0;t<e.length;++t)this.data.push(e.charCodeAt(t))}}Object.defineProperty(Bh.prototype,"status",{get:function(){return this.status3},set:function(e){this.status3=e},enumerable:!0,configurable:!0}),Object.defineProperty(Bh.prototype,"isSaving",{get:function(){return this.isSaving3},set:function(e){this.isSaving3=e},enumerable:!0,configurable:!0}),Object.defineProperty(Bh.prototype,"objectCollectionIndex",{get:function(){return this.index3},set:function(e){this.index3=e},enumerable:!0,configurable:!0}),Object.defineProperty(Bh.prototype,"position",{get:function(){return this.position3},set:function(e){this.position3=e},enumerable:!0,configurable:!0}),Object.defineProperty(Bh.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Bh.prototype.save=function(e){e.write(this.toString())},Bh.prototype.toString=function(){return this.objNumber.toString()+" "+this.genNumber.toString()+" R"},Bh.prototype.clone=function(e){return null};var Ph=Bh;function Bh(e,t){this.index3=-1,this.position3=-1,this.objNumber=0,this.genNumber=0,"number"==typeof e&&"number"==typeof t?(this.objNumber=e,this.genNumber=t):(this.objNumber=Number(e),this.genNumber=Number(t))}Object.defineProperty(Lh.prototype,"status",{get:function(){return this.status4},set:function(e){this.status4=e},enumerable:!0,configurable:!0}),Object.defineProperty(Lh.prototype,"isSaving",{get:function(){return this.isSaving4},set:function(e){this.isSaving4=e},enumerable:!0,configurable:!0}),Object.defineProperty(Lh.prototype,"objectCollectionIndex",{get:function(){return this.index4},set:function(e){this.index4=e},enumerable:!0,configurable:!0}),Object.defineProperty(Lh.prototype,"position",{get:function(){return this.position4},set:function(e){this.position4=e},enumerable:!0,configurable:!0}),Object.defineProperty(Lh.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(Lh.prototype,"object",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),Object.defineProperty(Lh.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),Object.defineProperty(Lh.prototype,"index",{get:function(){return this.objectIndex},enumerable:!0,configurable:!0}),Object.defineProperty(Lh.prototype,"element",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),Lh.prototype.initialize=function(e){e instanceof Bl||e instanceof Sl||e instanceof yl||e instanceof kl||e instanceof xh||e instanceof Ph||e instanceof Mh?this.primitiveObject=e:this.initialize(e.element)},Lh.prototype.save=function(e){e.position;var t=e.document.crossTable;this.object.isSaving=!0;t.getReference(this.object).save(e)},Lh.prototype.clone=function(e){return null};var Fh=Lh;function Lh(e,t){this.index4=-1,this.position4=-1,this.objectIndex=-1,this.dictionaryProperties=new Cl,this.initialize(e)}Object.defineProperty(Rh.prototype,"next",{get:function(){return this.action},set:function(e){this.action=e,this.dictionary.items.setValue(this.dictionaryProperties.next,new Fh(this.action))},enumerable:!0,configurable:!0}),Object.defineProperty(Rh.prototype,"dictionary",{get:function(){return void 0===this.pdfDictionary&&(this.pdfDictionary=new Sl),this.pdfDictionary},enumerable:!0,configurable:!0}),Rh.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new yl(this.dictionaryProperties.action))},Object.defineProperty(Rh.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0});W=Rh;function Rh(){this.action=null,this.dictionaryProperties=new Cl,this.initialize()}Oh=function(e,t){return(Oh=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Oh(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Zh,Nh=W),Object.defineProperty(Zh.prototype,"uri",{get:function(){return this.uniformResourceIdentifier},set:function(e){this.uniformResourceIdentifier=e,this.dictionary.items.setValue(this.dictionaryProperties.uri,new Mh(this.uniformResourceIdentifier))},enumerable:!0,configurable:!0}),Zh.prototype.initialize=function(){Nh.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.s,new yl(this.dictionaryProperties.uri))};var Oh,Nh,Vh,_h,Hh,zh,jh,Wh,Qh,Uh,qh,Gh,Yh,Xh,Kh,Jh=Zh;function Zh(e){var t=Nh.call(this)||this;return t.uniformResourceIdentifier="",t}(Xd=Vh=Vh||{})[Xd.Left=0]="Left",Xd[Xd.Center=1]="Center",Xd[Xd.Right=2]="Right",(Xd=_h=_h||{})[Xd.Top=0]="Top",Xd[Xd.Middle=1]="Middle",Xd[Xd.Bottom=2]="Bottom",(Xd=Hh=Hh||{})[Xd.Left=0]="Left",Xd[Xd.Center=1]="Center",Xd[Xd.Right=2]="Right",Xd[Xd.Justify=3]="Justify",(Xd=zh=zh||{})[Xd.Fill=0]="Fill",Xd[Xd.Stroke=1]="Stroke",Xd[Xd.FillStroke=2]="FillStroke",Xd[Xd.None=3]="None",Xd[Xd.ClipFlag=4]="ClipFlag",Xd[Xd.ClipFill=4]="ClipFill",Xd[Xd.ClipStroke=5]="ClipStroke",Xd[Xd.ClipFillStroke=6]="ClipFillStroke",Xd[Xd.Clip=7]="Clip",(Xd=jh=jh||{})[Xd.Miter=0]="Miter",Xd[Xd.Round=1]="Round",Xd[Xd.Bevel=2]="Bevel",(Xd=Wh=Wh||{})[Xd.Flat=0]="Flat",Xd[Xd.Round=1]="Round",Xd[Xd.Square=2]="Square",(Xd=Qh=Qh||{})[Xd.Solid=0]="Solid",Xd[Xd.Dash=1]="Dash",Xd[Xd.Dot=2]="Dot",Xd[Xd.DashDot=3]="DashDot",Xd[Xd.DashDotDot=4]="DashDotDot",Xd[Xd.Custom=5]="Custom",(Xd=Uh=Uh||{})[Xd.Winding=0]="Winding",Xd[Xd.Alternate=1]="Alternate",(Xd=qh=qh||{})[Xd.Rgb=0]="Rgb",Xd[Xd.Cmyk=1]="Cmyk",Xd[Xd.GrayScale=2]="GrayScale",Xd[Xd.Indexed=3]="Indexed",(Xd=Gh=Gh||{})[Xd.Normal=0]="Normal",Xd[Xd.Multiply=1]="Multiply",Xd[Xd.Screen=2]="Screen",Xd[Xd.Overlay=3]="Overlay",Xd[Xd.Darken=4]="Darken",Xd[Xd.Lighten=5]="Lighten",Xd[Xd.ColorDodge=6]="ColorDodge",Xd[Xd.ColorBurn=7]="ColorBurn",Xd[Xd.HardLight=8]="HardLight",Xd[Xd.SoftLight=9]="SoftLight",Xd[Xd.Difference=10]="Difference",Xd[Xd.Exclusion=11]="Exclusion",Xd[Xd.Hue=12]="Hue",Xd[Xd.Saturation=13]="Saturation",Xd[Xd.Color=14]="Color",Xd[Xd.Luminosity=15]="Luminosity",(Xd=Yh=Yh||{})[Xd.Centimeter=0]="Centimeter",Xd[Xd.Pica=1]="Pica",Xd[Xd.Pixel=2]="Pixel",Xd[Xd.Point=3]="Point",Xd[Xd.Inch=4]="Inch",Xd[Xd.Document=5]="Document",Xd[Xd.Millimeter=6]="Millimeter",(Xd=Xh=Xh||{})[Xd.Fit=0]="Fit",Xd[Xd.Center=1]="Center",Xd[Xd.Stretch=2]="Stretch",Xd[Xd.Tile=3]="Tile",(Xd=Kh=Kh||{})[Xd.None=0]="None",Xd[Xd.LeftToRight=1]="LeftToRight",Xd[Xd.RightToLeft=2]="RightToLeft";$h.prototype.assignRGB=function(e,t,i,n){void 0===e||void 0===t||void 0===i?this.filled=!1:(this.cyanColor=0,this.magentaColor=0,this.yellowColor=0,this.blackColor=0,this.grayColor=0,this.redColor=e,this.greenColor=t,this.blueColor=i,this.alpha=void 0===n?$h.maxColourChannelValue:n,this.filled=!0,this.assignCMYK(e,t,i))},$h.prototype.assignCMYK=function(e,t,i){var e=e/$h.maxColourChannelValue,t=t/$h.maxColourChannelValue,i=i/$h.maxColourChannelValue,n=kl.min(1-e,1-t,1-i),e=1===n?0:(1-e-n)/(1-n),t=1===n?0:(1-t-n)/(1-n),i=1===n?0:(1-i-n)/(1-n);this.blackColor=n,this.cyanColor=e,this.magentaColor=t,this.yellowColor=i},Object.defineProperty($h.prototype,"r",{get:function(){return this.redColor},set:function(e){this.redColor=e,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty($h.prototype,"red",{get:function(){return this.r/$h.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty($h.prototype,"b",{get:function(){return this.blueColor},set:function(e){this.blueColor=e,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty($h.prototype,"blue",{get:function(){return this.b/$h.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty($h.prototype,"c",{get:function(){return this.cyanColor},set:function(e){this.cyanColor=e<0?0:1<e?1:e,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty($h.prototype,"k",{get:function(){return this.blackColor},set:function(e){this.blackColor=e<0?0:1<e?1:e,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty($h.prototype,"m",{get:function(){return this.magentaColor},set:function(e){this.magentaColor=e<0?0:1<e?1:e,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty($h.prototype,"y",{get:function(){return this.yellowColor},set:function(e){this.yellowColor=e<0?0:1<e?1:e,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty($h.prototype,"g",{get:function(){return this.greenColor},set:function(e){this.greenColor=e,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty($h.prototype,"green",{get:function(){return this.g/$h.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty($h.prototype,"gray",{get:function(){return(this.redColor+this.greenColor+this.blueColor)/(3*$h.maxColourChannelValue)},set:function(e){this.grayColor=e<0?0:1<e?1:e,this.r=this.grayColor*$h.maxColourChannelValue,this.g=this.grayColor*$h.maxColourChannelValue,this.b=this.grayColor*$h.maxColourChannelValue,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty($h.prototype,"isEmpty",{get:function(){return!this.filled},enumerable:!0,configurable:!0}),Object.defineProperty($h.prototype,"a",{get:function(){return this.alpha},set:function(e){this.alpha=e<0?0:e,this.filled=!0},enumerable:!0,configurable:!0}),$h.prototype.toString=function(e,t){if(this.isEmpty)return"";var i="";switch(e){case qh.Rgb:i=this.rgbToString(t);break;case qh.GrayScale:i=this.grayScaleToString(t);break;case qh.Cmyk:i=this.cmykToString(t)}return i},$h.prototype.grayScaleToString=function(e){var t=this.gray,i="",n=null;return null==(n=e?$h.grayStringsSroke.containsKey(t)?$h.grayStringsSroke.getValue(t):null:$h.grayStringsFill.containsKey(t)?$h.grayStringsFill.getValue(t):null)?e&&(i=t.toString()+" G",$h.grayStringsSroke.setValue(t,i)):i=n.toString(),i+bl.newLine},$h.prototype.rgbToString=function(e){var t=this.r,i=this.g,n=this.b,o=(t<<16)+(i<<8)+n,r=(e&&(o+=1<<24),""),s=null;return null==(s=$h.rgbStrings.containsKey(o)?$h.rgbStrings.getValue(o):s)?(t=t/$h.maxColourChannelValue,i=i/$h.maxColourChannelValue,n=n/$h.maxColourChannelValue,r=e?t.toString()+" "+i.toString()+" "+n.toString()+" RG":t.toString()+" "+i.toString()+" "+n.toString()+" rg",$h.rgbStrings.setValue(o,r)):r=s.toString(),r+bl.newLine},$h.prototype.cmykToString=function(e){var t=this.c,i=this.m,n=this.y,o=this.b;return t.toString()+" "+i.toString()+" "+n.toString()+" "+o.toString()+" K"+bl.newLine},$h.prototype.toArray=function(e){var t=new Bl;return e===qh.Rgb&&(t.add(new kl(this.red)),t.add(new kl(this.green)),t.add(new kl(this.blue))),t},$h.rgbStrings=new ml,$h.grayStringsSroke=new ml,$h.grayStringsFill=new ml,$h.maxColourChannelValue=255;var se=$h;function $h(e,t,i,n){void 0===e?void 0!==t&&void 0!==i&&void 0!==n?this.assignRGB(t,i,n):this.filled=!1:e instanceof $h?(this.redColor=e.r,this.greenColor=e.g,this.blueColor=e.b,this.grayColor=e.gray,this.alpha=e.alpha,this.filled=0!==this.alpha):"number"==typeof e&&void 0===t&&void 0===i&&void 0===n?(this.redColor=(e=1<(e=e<0?0:e)?1:e)*$h.maxColourChannelValue,this.greenColor=e*$h.maxColourChannelValue,this.blueColor=e*$h.maxColourChannelValue,this.cyanColor=e,this.magentaColor=e,this.yellowColor=e,this.blackColor=e,this.grayColor=e,this.alpha=$h.maxColourChannelValue,this.filled=!0):void 0===n?this.assignRGB(e,t,i):this.assignRGB(t,i,n,e)}var ed=function(e,t){void 0===e?(this.x=0,this.y=0):(this.x=null!==e?e:0,this.y=null!==t?t:0)},td=function(e,t){void 0===t?(this.height=0,this.width=0):(this.height=null!==t?t:0,this.width=null!==e?e:0)},id=function(e,t,i,n){var o;typeof e==typeof e&&void 0===e?(this.x=0,this.y=0,this.height=0,this.width=0):e instanceof ed&&t instanceof td&&void 0===i?(this.x=(o=e).x,this.y=o.y,this.height=(o=t).height,this.width=o.width):(o=t,t=i,i=n,this.x=e,this.y=o,this.height=i,this.width=t)},nd=(Object.defineProperty(od.prototype,"width",{get:function(){return this.right-this.left},enumerable:!0,configurable:!0}),Object.defineProperty(od.prototype,"height",{get:function(){return this.bottom-this.top},enumerable:!0,configurable:!0}),Object.defineProperty(od.prototype,"topLeft",{get:function(){return new ed(this.left,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(od.prototype,"size",{get:function(){return new td(this.width,this.height)},enumerable:!0,configurable:!0}),od.prototype.toString=function(){return this.topLeft+"x"+this.size},od);function od(e,t,i,n){this.left=e,this.top=t,this.right=i,this.bottom=n}sd.prototype.clone=function(){return this};var rd=sd;function sd(){}ad=function(e,t){return(ad=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}ad(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ad,ld=rd),Object.defineProperty(Ad.prototype,"color",{get:function(){return this.pdfColor},set:function(e){this.pdfColor=e},enumerable:!0,configurable:!0}),Ad.prototype.monitorChanges=function(e,t,i,n,o){if(null==t)throw new Error("ArgumentNullException:streamWriter");var r=!1;return t.setColorAndSpace(this.pdfColor,o,!(r=!0)),r},Ad.prototype.resetChanges=function(e){e.setColorAndSpace(new se(0,0,0),qh.Rgb,!1)};var ad,ld,hd,dd,pd,cd,ud,gd,md,fd,yd,vd,bd,wd,Cd,Sd=Ad;function Ad(e){var t=ld.call(this)||this;return t.pdfColor=e,t}(Xd=hd=hd||{})[Xd.Regular=0]="Regular",Xd[Xd.Bold=1]="Bold",Xd[Xd.Italic=2]="Italic",Xd[Xd.Underline=4]="Underline",Xd[Xd.Strikeout=8]="Strikeout",(Xd=dd=dd||{})[Xd.Helvetica=0]="Helvetica",Xd[Xd.Courier=1]="Courier",Xd[Xd.TimesRoman=2]="TimesRoman",Xd[Xd.Symbol=3]="Symbol",Xd[Xd.ZapfDingbats=4]="ZapfDingbats",(Xd=pd=pd||{})[Xd.Standard=0]="Standard",Xd[Xd.TrueType=1]="TrueType",Xd[Xd.TrueTypeEmbedded=2]="TrueTypeEmbedded",(Xd=cd=cd||{})[Xd.None=0]="None",Xd[Xd.Word=1]="Word",Xd[Xd.WordOnly=2]="WordOnly",Xd[Xd.Character=3]="Character",(Xd=ud=ud||{})[Xd.None=0]="None",Xd[Xd.SuperScript=1]="SuperScript",Xd[Xd.SubScript=2]="SubScript",(Xd=gd=gd||{})[Xd.Unknown=0]="Unknown",Xd[Xd.StandardEncoding=1]="StandardEncoding",Xd[Xd.MacRomanEncoding=2]="MacRomanEncoding",Xd[Xd.MacExpertEncoding=3]="MacExpertEncoding",Xd[Xd.WinAnsiEncoding=4]="WinAnsiEncoding",Xd[Xd.PdfDocEncoding=5]="PdfDocEncoding",Xd[Xd.IdentityH=6]="IdentityH",(Xd=md=md||{})[Xd.Apple=0]="Apple",Xd[Xd.Microsoft=4]="Microsoft",Xd[Xd.Trimmed=6]="Trimmed",(Xd=fd=fd||{})[Xd.Unknown=0]="Unknown",Xd[Xd.Symbol=1]="Symbol",Xd[Xd.Unicode=2]="Unicode",Xd[Xd.Macintosh=3]="Macintosh",(Xd=yd=yd||{})[Xd.AppleUnicode=0]="AppleUnicode",Xd[Xd.Macintosh=1]="Macintosh",Xd[Xd.Iso=2]="Iso",Xd[Xd.Microsoft=3]="Microsoft",(Xd=vd=vd||{})[Xd.Undefined=0]="Undefined",Xd[Xd.Unicode=1]="Unicode",(Xd=bd=bd||{})[Xd.Roman=0]="Roman",Xd[Xd.Japanese=1]="Japanese",Xd[Xd.Chinese=2]="Chinese",(Xd=wd=wd||{})[Xd.FixedPitch=1]="FixedPitch",Xd[Xd.Serif=2]="Serif",Xd[Xd.Symbolic=4]="Symbolic",Xd[Xd.Script=8]="Script",Xd[Xd.Nonsymbolic=32]="Nonsymbolic",Xd[Xd.Italic=64]="Italic",Xd[Xd.ForceBold=262144]="ForceBold",(Xd=Cd=Cd||{})[Xd.Arg1And2AreWords=1]="Arg1And2AreWords",Xd[Xd.ArgsAreXyValues=2]="ArgsAreXyValues",Xd[Xd.RoundXyToGrid=4]="RoundXyToGrid",Xd[Xd.WeHaveScale=8]="WeHaveScale",Xd[Xd.Reserved=16]="Reserved",Xd[Xd.MoreComponents=32]="MoreComponents",Xd[Xd.WeHaveAnXyScale=64]="WeHaveAnXyScale",Xd[Xd.WeHaveTwoByTwo=128]="WeHaveTwoByTwo",Xd[Xd.WeHaveInstructions=256]="WeHaveInstructions",Xd[Xd.UseMyMetrics=512]="UseMyMetrics";Object.defineProperty(Id.prototype,"alignment",{get:function(){return this.textAlignment},set:function(e){this.textAlignment=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"textDirection",{get:function(){return this.direction},set:function(e){this.direction=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"lineAlignment",{get:function(){return void 0===this.verticalAlignment||null==this.verticalAlignment?_h.Top:this.verticalAlignment},set:function(e){this.verticalAlignment=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"rightToLeft",{get:function(){return void 0!==this.isRightToLeft&&null!=this.isRightToLeft&&this.isRightToLeft},set:function(e){this.isRightToLeft=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"characterSpacing",{get:function(){return void 0===this.internalCharacterSpacing||null==this.internalCharacterSpacing?0:this.internalCharacterSpacing},set:function(e){this.internalCharacterSpacing=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"wordSpacing",{get:function(){return void 0===this.internalWordSpacing||null==this.internalWordSpacing?0:this.internalWordSpacing},set:function(e){this.internalWordSpacing=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"lineSpacing",{get:function(){return void 0===this.leading||null==this.leading?0:this.leading},set:function(e){this.leading=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"clipPath",{get:function(){return void 0!==this.clip&&null!=this.clip&&this.clip},set:function(e){this.clip=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"subSuperScript",{get:function(){return void 0===this.pdfSubSuperScript||null==this.pdfSubSuperScript?ud.None:this.pdfSubSuperScript},set:function(e){this.pdfSubSuperScript=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"paragraphIndent",{get:function(){return void 0===this.internalParagraphIndent||null==this.internalParagraphIndent?0:this.internalParagraphIndent},set:function(e){this.internalParagraphIndent=e,this.firstLineIndent=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"lineLimit",{get:function(){return this.internalLineLimit},set:function(e){this.internalLineLimit=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"measureTrailingSpaces",{get:function(){return void 0!==this.trailingSpaces&&null!=this.trailingSpaces&&this.trailingSpaces},set:function(e){this.trailingSpaces=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"noClip",{get:function(){return void 0!==this.isNoClip&&null!=this.isNoClip&&this.isNoClip},set:function(e){this.isNoClip=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"wordWrap",{get:function(){return this.wordWrapType},set:function(e){this.wordWrapType=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"horizontalScalingFactor",{get:function(){return this.scalingFactor},set:function(e){if(e<=0)throw new Error("ArgumentOutOfRangeException:The scaling factor cant be less of equal to zero, ScalingFactor");this.scalingFactor=e},enumerable:!0,configurable:!0}),Object.defineProperty(Id.prototype,"firstLineIndent",{get:function(){return void 0===this.initialLineIndent||null==this.initialLineIndent?0:this.initialLineIndent},set:function(e){this.initialLineIndent=e},enumerable:!0,configurable:!0}),Id.prototype.clone=function(){return this};var xd=Id;function Id(e,t){this.scalingFactor=100,this.wordWrapType=cd.Word,this.internalLineLimit=!0,this.wordWrapType=cd.Word,void 0!==e&&"string"!=typeof e&&(this.textAlignment=e),void 0!==t&&(this.verticalAlignment=t)}Object.defineProperty(Ed.prototype,"length",{get:function(){return this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(Ed.prototype,"end",{get:function(){return this.currentPosition===this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(Ed.prototype,"position",{get:function(){return this.currentPosition},set:function(e){this.currentPosition=e},enumerable:!0,configurable:!0}),Ed.getCharsCount=function(e,t){if("string"==typeof t){if(null==e)throw new Error("ArgumentNullException:wholeText");for(var i=0,n=0;-1!==(n=e.indexOf(t,n));)i++,n++;return i}if(null==e)throw new Error("ArgumentNullException:text");if(null==t)throw new Error("ArgumentNullException:symbols");for(var o=0,r=0,s=e.length;r<s;r++){var a=e[r];this.contains(t,a)&&o++}return o},Ed.prototype.readLine=function(){for(var e,t=this.currentPosition;t<this.length;){var i=this.text[t];switch(i){case"\r":case"\n":var n=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t+1,"\r"===i&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,n}t++}return t>this.currentPosition?(e=this.text.substr(this.currentPosition,t-this.currentPosition),this.currentPosition=t,e):null},Ed.prototype.peekLine=function(){var e=this.currentPosition,t=this.readLine();return this.currentPosition=e,t},Ed.prototype.readWord=function(){for(var e,t=this.currentPosition;t<this.length;){var i=this.text[t];switch(i){case"\r":case"\n":var n=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t+1,"\r"===i&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,n;case" ":case"\t":t===this.currentPosition&&t++;n=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,n}t++}return t>this.currentPosition?(e=this.text.substr(this.currentPosition,t-this.currentPosition),this.currentPosition=t,e):null},Ed.prototype.peekWord=function(){var e=this.currentPosition,t=this.readWord();return this.currentPosition=e,t},Ed.prototype.read=function(e){if(void 0===e)return t="0",this.end||(t=this.text[this.currentPosition],this.currentPosition++),t;for(var t,i=0,n="";!this.end&&i<e;)n+=t=this.read(),i++;return n},Ed.prototype.peek=function(){var e="0";return e=this.end?e:this.text[this.currentPosition]},Ed.prototype.close=function(){this.text=null},Ed.prototype.readToEnd=function(){var e=0===this.currentPosition?this.text:this.text.substr(this.currentPosition,this.length-this.currentPosition);return this.currentPosition=this.length,e},Ed.contains=function(e,t){for(var i=!1,n=0;n<e.length;n++)if(e[n]===t){i=!0;break}return i},Ed.spaces=[Ed.whiteSpace=" ",Ed.tab="\t"],Ed.whiteSpacePattern="^[ \t]+$";var Td=Ed;function Ed(e){if(this.currentPosition=0,null==e)throw new Error("ArgumentNullException:text");this.text=e}Md.prototype.layout=function(e,t,i,n,o,r,s){return s=(n instanceof id?(this.initialize(e,t,i,n,o),this.isOverloadWithPosition=r,this.clientSize=s):(this.initialize(e,t,i,n),this.isOverloadWithPosition=o,this.clientSize=r),this.doLayout()),this.clear(),s},Md.prototype.initialize=function(e,t,i,n,o){if("number"==typeof o){if(null==e)throw new Error("ArgumentNullException:text");if(null==t)throw new Error("ArgumentNullException:font");this.text=e,this.font=t,this.format=i,this.size=new td(n.width,n.height),this.rectangle=n,this.pageHeight=o,this.reader=new Td(e)}else this.initialize(e,t,i,new id(new ed(0,0),n),0)},Md.prototype.clear=function(){this.font=null,this.format=null,this.reader.close(),this.reader=null,this.text=null},Md.prototype.doLayout=function(){for(var e=new kd,t=(new kd,[]),i=this.reader.peekLine(),n=this.getLineIndent(!0);null!=i;){if(null!==(o=this.layoutLine(i,n))||void 0!==o){var o=this.copyToResult(e,o,t,0),r=o.success,o=o.numInserted;if(!r){this.reader.read(o);break}}this.reader.readLine(),i=this.reader.peekLine(),n=this.getLineIndent(!1)}return this.finalizeResult(e,t),e},Md.prototype.getLineIndent=function(e){var t=0;return null!=this.format&&(t=e?this.format.firstLineIndent:this.format.paragraphIndent,t=0<this.size.width?Math.min(this.size.width,t):t),t},Md.prototype.getLineHeight=function(){var e=this.font.height;return e=null!=this.format&&0!==this.format.lineSpacing?this.format.lineSpacing+this.font.height:e},Md.prototype.getLineWidth=function(e){return this.font.getLineWidth(e,this.format)},Md.prototype.layoutLine=function(e,t){var i=new kd,n=(i.layoutLineHeight=this.getLineHeight(),[]),o=this.size.width,r=this.getLineWidth(e)+t,s=Bd.FirstParagraphLine,a=!0;if(o<=0||Math.round(r)<=Math.round(o))this.addToLineResult(i,n,e,r,Bd.NewLineBreak|s);else{var l="",h="",r=t,d=t,p=new Td(e),c=p.peekWord();for(c.length!==p.length&&" "===c&&(h+=c,l+=c,p.position+=1,c=p.peekWord());null!=c;){h+=c;var u,g=this.getLineWidth(h.toString())+d;if(" "===h.toString()&&(h="",g=0),o<g){if(this.getWrapType()===cd.None)break;if(h.length===c.length){if(this.getWrapType()===cd.WordOnly){i.textRemainder=e.substring(p.position);break}if(1===h.length){l+=c;break}a=!1,h="",c=p.peek().toString()}else this.getLineWidth(c.toString())>o?this.format.wordWrap=cd.Character:void 0!==this.format&&null!==this.format&&(this.format.wordWrap=cd.Word),this.getWrapType()===cd.Character&&a?(a=!1,h="",h+=l.toString(),c=p.peek().toString()):(" "!==(u=l.toString())&&this.addToLineResult(i,n,u,r,Bd.LayoutBreak|s),this.isOverloadWithPosition&&(o=this.clientSize.width),l=h="",g=d=r=0,s=Bd.None,c=a?c:p.peekWord(),a=!0)}else l+=c,r=g,c=a?(p.readWord(),p.peekWord()):(p.read(),p.peek().toString())}0<l.length&&(u=l.toString(),this.addToLineResult(i,n,u,r,Bd.NewLineBreak|Bd.LastParagraphLine)),p.close()}i.layoutLines=[];for(var m=0;m<n.length;m++)i.layoutLines.push(n[m]);return n=[],i},Md.prototype.addToLineResult=function(e,t,i,n,o){var r=new Fd,i=(r.text=i,r.width=n,r.lineType=o,t.push(r),e.actualSize);i.height+=this.getLineHeight(),i.width=Math.max(i.width,n),e.size=i},Md.prototype.copyToResult=function(e,t,i,n){var o,r=!0,s=null!=this.format&&!this.format.lineLimit,a=e.actualSize.height,l=this.size.height;if(0<this.pageHeight&&l+this.rectangle.y>this.pageHeight&&(l=this.rectangle.y-this.pageHeight,l=Math.max(l,-l)),n=0,null!=t.lines)for(var h=0,d=t.lines.length;h<d;h++){var p=a+t.lineHeight;if(!(p<=l||l<=0||s)){r=!1;break}var c=t.lines[h],u=(n+=c.text.length,c=this.trimLine(c,0===i.length),i.push(c),e.actualSize);u.width=Math.max(u.width,c.width),e.size=u,a=p}return a!=e.size.height&&((o=e.actualSize).height=a,e.size=o),{success:r,numInserted:n}},Md.prototype.finalizeResult=function(e,t){e.layoutLines=[];for(var i=0;i<t.length;i++)e.layoutLines.push(t[i]);e.layoutLineHeight=this.getLineHeight(),this.reader.end||(e.textRemainder=this.reader.readToEnd())},Md.prototype.trimLine=function(e,t){var i=e.text,n=e.width;e.lineType,Bd.FirstParagraphLine,null!=this.format&&this.format.rightToLeft;return(i=i.trim()).length!==e.text.length&&(n=this.getLineWidth(i),0<(e.lineType&Bd.FirstParagraphLine))&&(n+=this.getLineIndent(t)),e.text=i,e.width=n,e},Md.prototype.getWrapType=function(){return null!=this.format?this.format.wordWrap:cd.Word};var Dd=Md;function Md(){this.isOverloadWithPosition=!1}Object.defineProperty(Pd.prototype,"remainder",{get:function(){return this.textRemainder},enumerable:!0,configurable:!0}),Object.defineProperty(Pd.prototype,"actualSize",{get:function(){return void 0===this.size&&(this.size=new td(0,0)),this.size},enumerable:!0,configurable:!0}),Object.defineProperty(Pd.prototype,"lines",{get:function(){return this.layoutLines},enumerable:!0,configurable:!0}),Object.defineProperty(Pd.prototype,"lineHeight",{get:function(){return this.layoutLineHeight},enumerable:!0,configurable:!0}),Object.defineProperty(Pd.prototype,"empty",{get:function(){return null==this.layoutLines||0===this.layoutLines.length},enumerable:!0,configurable:!0}),Object.defineProperty(Pd.prototype,"lineCount",{get:function(){return this.empty?0:this.layoutLines.length},enumerable:!0,configurable:!0});var kd=Pd;function Pd(){}Object.defineProperty(Ld.prototype,"lineType",{get:function(){return this.type},set:function(e){this.type=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ld.prototype,"text",{get:function(){return this.content},set:function(e){this.content=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ld.prototype,"width",{get:function(){return this.lineWidth},set:function(e){this.lineWidth=e},enumerable:!0,configurable:!0});var Bd,Fd=Ld;function Ld(){}(Xd=Bd=Bd||{})[Xd.None=0]="None",Xd[Xd.NewLineBreak=1]="NewLineBreak",Xd[Xd.LayoutBreak=2]="LayoutBreak",Xd[Xd.FirstParagraphLine=4]="FirstParagraphLine",Xd[Xd.LastParagraphLine=8]="LastParagraphLine";Object.defineProperty(Od.prototype,"name",{get:function(){return this.metrics.name},enumerable:!0,configurable:!0}),Object.defineProperty(Od.prototype,"size",{get:function(){return this.fontSize},enumerable:!0,configurable:!0}),Object.defineProperty(Od.prototype,"height",{get:function(){return this.metrics.getHeight(null)},enumerable:!0,configurable:!0}),Object.defineProperty(Od.prototype,"style",{get:function(){return this.fontStyle},set:function(e){this.fontStyle=e},enumerable:!0,configurable:!0}),Object.defineProperty(Od.prototype,"bold",{get:function(){return 0<(this.style&hd.Bold)},enumerable:!0,configurable:!0}),Object.defineProperty(Od.prototype,"italic",{get:function(){return 0<(this.style&hd.Italic)},enumerable:!0,configurable:!0}),Object.defineProperty(Od.prototype,"strikeout",{get:function(){return 0<(this.style&hd.Strikeout)},enumerable:!0,configurable:!0}),Object.defineProperty(Od.prototype,"underline",{get:function(){return 0<(this.style&hd.Underline)},enumerable:!0,configurable:!0}),Object.defineProperty(Od.prototype,"metrics",{get:function(){return this.fontMetrics},set:function(e){this.fontMetrics=e},enumerable:!0,configurable:!0}),Object.defineProperty(Od.prototype,"element",{get:function(){return this.pdfFontInternals},enumerable:!0,configurable:!0}),Od.prototype.measureString=function(e,t,i,n,o){if("string"==typeof e&&void 0===t)return this.measureString(e,null);if("string"==typeof e&&(t instanceof xd||null==t)&&void 0===i&&void 0===n)return this.measureString(e,r=t,0,0);if("string"==typeof e&&(t instanceof xd||null==t)&&"number"==typeof i&&"number"==typeof n)return this.measureString(e,0,r=t,i,n);if("string"==typeof e&&"number"==typeof t&&(i instanceof xd||null==i)&&"number"==typeof n&&"number"==typeof o)return s=new td(t,0),this.measureString(e,s,s=i,n,o);if(null==e)throw Error('ArgumentNullException("text")');var r=t,s=i,t=(new Dd).layout(e,this,s,r,!1,new td(0,0));return n=e.length,o=t.empty?0:t.lines.length,t.actualSize},Od.prototype.equalsTo=function(e){return this.equalsToFont(e)},Od.prototype.getInternals=function(){return this.pdfFontInternals},Od.prototype.setInternals=function(e){if(null==e)throw new Error("ArgumentNullException:internals");this.pdfFontInternals=e},Od.prototype.setStyle=function(e){this.fontStyle=e},Od.prototype.applyFormatSettings=function(e,t,i){var n=i;return null!=t&&0<i&&(0!==t.characterSpacing&&(n+=(e.length-1)*t.characterSpacing),0!==t.wordSpacing)&&(i=Td.spaces,n+=Td.getCharsCount(e,i)*t.wordSpacing),n},Od.charSizeMultiplier=.001,Od.syncObject=new Object;var Rd=Od;function Od(e,t){this.fontStyle=hd.Regular,"number"==typeof e&&void 0===t?this.fontSize=e:(this.fontSize=e,this.setStyle(t))}Object.defineProperty(Vd.prototype,"document",{get:function(){return this.pdfDocument},set:function(e){this.pdfDocument=e},enumerable:!0,configurable:!0}),Object.defineProperty(Vd.prototype,"position",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(Vd.prototype,"length",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(Vd.prototype,"stream",{get:function(){return this.streamWriter},enumerable:!0,configurable:!0}),Vd.prototype.write=function(e){this.streamWriter.write(e)};var Nd=Vd;function Vd(e){this.streamWriter=e}Hd.prototype.write=function(e){this.buffer.write(e)},Hd.prototype.destroy=function(){this.buffer&&(this.buffer.destroy(),this.buffer=void 0)};var _d=Hd;function Hd(){this.buffer=new jd}Object.defineProperty(Wd.prototype,"size",{get:function(){return this.buffer.length},enumerable:!0,configurable:!0}),Wd.prototype.write=function(e){for(var t=0;t<e.length;t++)this.buffer.push(255&e.charCodeAt(t))},Wd.prototype.destroy=function(){this.buffer&&(this.buffer=[],this.buffer=void 0)};var zd,jd=Wd;function Wd(){this.buffer=[]}(Xd=zd=zd||{})[Xd.None=0]="None",Xd[Xd.Registered=1]="Registered";Object.defineProperty(Ud.prototype,"count",{get:function(){return this.objectCollections.length},enumerable:!0,configurable:!0}),Ud.prototype.items=function(e){return this.objectCollections[e]},Object.defineProperty(Ud.prototype,"outIsNew",{get:function(){return this.isNew},enumerable:!0,configurable:!0}),Ud.prototype.add=function(e){var t=new qd(e);this.objectCollections.push(t),this.primitiveObjectCollection.containsKey(e)||this.primitiveObjectCollection.setValue(e,this.objectCollections.length-1),e.position=this.index=this.objectCollections.length-1,e.status=zd.Registered},Ud.prototype.lookFor=function(e){var t=-1;if(-1!==e.position)return e.position;if(this.primitiveObjectCollection.containsKey(e)&&this.count===this.primitiveObjectCollection.size())t=this.primitiveObjectCollection.getValue(e);else for(var i=this.count-1;0<=i;i--)if(this.objectCollections[i].object===e){t=i;break}return t},Ud.prototype.getReference=function(e,t){return this.index=this.lookFor(e),this.isNew=!1,{reference:this.objectCollections[this.index].reference,wasNew:t}},Ud.prototype.trySetReference=function(e,t,i){return this.index=this.lookFor(e),this.objectCollections[this.index].setReference(t),!0},Ud.prototype.destroy=function(){for(var e=0,t=this.objectCollections;e<t.length;e++){var i=t[e];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 ml,this.primitiveObjectCollection=new ml};var Qd=Ud;function Ud(){this.objectCollections=[],this.mainObjectCollection=new ml,this.primitiveObjectCollection=new ml}Object.defineProperty(Gd.prototype,"object",{get:function(){return this.pdfObject},set:function(e){this.pdfObject=e},enumerable:!0,configurable:!0}),Object.defineProperty(Gd.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),Gd.prototype.setReference=function(e){this.pdfReference=e};var qd=Gd;function Gd(e,t){this.pdfObject=e,this.pdfReference=t}Object.defineProperty(Kd.prototype,"pdfObjects",{get:function(){return this.objects},enumerable:!0,configurable:!0}),Object.defineProperty(Kd.prototype,"crossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(Kd.prototype,"currentSavingObj",{get:function(){return this.currentSavingObject},set:function(e){this.currentSavingObject=e},enumerable:!0,configurable:!0}),Object.defineProperty(Kd.prototype,"catalog",{get:function(){return this.pdfCatalog},set:function(e){this.pdfCatalog=e},enumerable:!0,configurable:!0}),Object.defineProperty(Kd.prototype,"viewerPreferences",{get:function(){return this.pdfCatalog.viewerPreferences},enumerable:!0,configurable:!0}),Kd.prototype.setMainObjectCollection=function(e){this.objects=e},Kd.prototype.setCrossTable=function(e){this.pdfCrossTable=e},Kd.prototype.setCatalog=function(e){this.pdfCatalog=e},Kd.prototype.save=function(e){var t,n,o=this,i=new Ql(!0),i=new Gl(i);if(void 0===e)return t=new Ql(!0),n=new Gl(t),new Promise(function(e,t){var i={};i.blobData=new Blob([o.document.docSave(n,!0)],{type:"application/pdf"}),e(i)});this.document.docSave(i,e,!0)},Kd.prototype.clone=function(){return this.document},Kd.prototype._save=function(){return this.document._docSave()};var Yd,Xd=Kd;function Kd(e){this.isStreamCopied=!1,e instanceof sg&&(this.document=e)}(Pc=Yd=Yd||{})[Pc.Free=0]="Free",Pc[Pc.Normal=1]="Normal",Pc[Pc.Packed=2]="Packed";Object.defineProperty(Zd.prototype,"status",{get:function(){return this.objectStatus},set:function(e){this.objectStatus=e},enumerable:!0,configurable:!0}),Object.defineProperty(Zd.prototype,"isSaving",{get:function(){return this.saving},set:function(e){this.saving=e},enumerable:!0,configurable:!0}),Object.defineProperty(Zd.prototype,"objectCollectionIndex",{get:function(){return this.index},set:function(e){this.index=e},enumerable:!0,configurable:!0}),Object.defineProperty(Zd.prototype,"position",{get:function(){return this.currentPosition},set:function(e){this.currentPosition=e},enumerable:!0,configurable:!0}),Object.defineProperty(Zd.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Zd.prototype.save=function(e){e.write(this.boolToStr(this.value))},Zd.prototype.clone=function(e){return new Zd(this.value)},Zd.prototype.boolToStr=function(e){return e?"true":"false"};var Jd=Zd;function Zd(e){this.currentPosition=-1,this.value=e}Object.defineProperty(op.prototype,"centerWindow",{get:function(){return this._centerWindow},set:function(e){this._centerWindow=e,this._dictionary.items.setValue(this._dictionaryProperties.centerWindow,new Jd(this._centerWindow))},enumerable:!0,configurable:!0}),Object.defineProperty(op.prototype,"displayTitle",{get:function(){return this._displayTitle},set:function(e){this._displayTitle=e,this._dictionary.items.setValue(this._dictionaryProperties.displayTitle,new Jd(this._displayTitle))},enumerable:!0,configurable:!0}),Object.defineProperty(op.prototype,"fitWindow",{get:function(){return this._fitWindow},set:function(e){this._fitWindow=e,this._dictionary.items.setValue(this._dictionaryProperties.fitWindow,new Jd(this._fitWindow))},enumerable:!0,configurable:!0}),Object.defineProperty(op.prototype,"hideMenuBar",{get:function(){return this._hideMenuBar},set:function(e){this._hideMenuBar=e,this._dictionary.items.setValue(this._dictionaryProperties.hideMenuBar,new Jd(this._hideMenuBar))},enumerable:!0,configurable:!0}),Object.defineProperty(op.prototype,"hideToolBar",{get:function(){return this._hideToolBar},set:function(e){this._hideToolBar=e,this._dictionary.items.setValue(this._dictionaryProperties.hideToolBar,new Jd(this._hideToolBar))},enumerable:!0,configurable:!0}),Object.defineProperty(op.prototype,"hideWindowUI",{get:function(){return this._hideWindowUI},set:function(e){this._hideWindowUI=e,this._dictionary.items.setValue(this._dictionaryProperties.hideWindowUI,new Jd(this._hideWindowUI))},enumerable:!0,configurable:!0}),Object.defineProperty(op.prototype,"pageMode",{get:function(){return this._pageMode},set:function(e){this._pageMode=e,this._catalog.items.setValue(this._dictionaryProperties.pageMode,new yl(this._mapPageMode(this._pageMode)))},enumerable:!0,configurable:!0}),Object.defineProperty(op.prototype,"duplex",{get:function(){return this._duplex},set:function(e){this._duplex=e,this._catalog.items.setValue(this._dictionaryProperties.duplex,new yl(this._mapDuplexMode(this._duplex)))},enumerable:!0,configurable:!0}),Object.defineProperty(op.prototype,"pageLayout",{get:function(){return this._pageLayout},set:function(e){this._pageLayout=e,this._catalog.items.setValue(this._dictionaryProperties.pageLayout,new yl(this._mapPageLayout(this._pageLayout)))},enumerable:!0,configurable:!0}),Object.defineProperty(op.prototype,"pageScaling",{get:function(){return this._pageScaling},set:function(e){this._pageScaling=e,this._pageScaling===ip.AppDefault&&this._dictionary.items.containsKey(this._dictionaryProperties.printScaling)?this._dictionary.items.remove(this._dictionaryProperties.printScaling):this._pageScaling===ip.None&&this._dictionary.items.setValue(this._dictionaryProperties.printScaling,new yl("None"))},enumerable:!0,configurable:!0}),Object.defineProperty(op.prototype,"element",{get:function(){return this._dictionary},enumerable:!0,configurable:!0}),op.prototype._mapDuplexMode=function(e){switch(e){case tp.Simplex:return"Simplex";case tp.DuplexFlipShortEdge:return"DuplexFlipShortEdge";case tp.DuplexFlipLongEdge:return"DuplexFlipLongEdge";case tp.None:return"None"}},op.prototype._mapPageMode=function(e){switch(e){case $d.UseNone:return"UseNone";case $d.UseOutlines:return"UseOutlines";case $d.UseThumbs:return"UseThumbs";case $d.FullScreen:return"FullScreen";case $d.UseOC:return"UseOC";case $d.UseAttachments:return"UseAttachments"}},op.prototype._mapPageLayout=function(e){switch(e){case ep.SinglePage:return"SinglePage";case ep.OneColumn:return"OneColumn";case ep.TwoColumnLeft:return"TwoColumnLeft";case ep.TwoColumnRight:return"TwoColumnRight";case ep.TwoPageLeft:return"TwoPageLeft";case ep.TwoPageRight:return"TwoPageRight"}};var $d,ep,tp,ip,np=op;function op(e){this._dictionaryProperties=new Cl,this._centerWindow=!1,this._fitWindow=!1,this._displayTitle=!1,this._splitWindow=!1,this._hideMenuBar=!1,this._hideToolBar=!1,this._hideWindowUI=!1,this._pageMode=$d.UseNone,this._pageLayout=ep.SinglePage,this._dictionary=new Sl,this._duplex=tp.None,this._catalog=e}(Pc=$d=$d||{})[Pc.UseNone=0]="UseNone",Pc[Pc.UseOutlines=1]="UseOutlines",Pc[Pc.UseThumbs=2]="UseThumbs",Pc[Pc.FullScreen=3]="FullScreen",Pc[Pc.UseOC=4]="UseOC",Pc[Pc.UseAttachments=5]="UseAttachments",(Pc=ep=ep||{})[Pc.SinglePage=0]="SinglePage",Pc[Pc.OneColumn=1]="OneColumn",Pc[Pc.TwoColumnLeft=2]="TwoColumnLeft",Pc[Pc.TwoColumnRight=3]="TwoColumnRight",Pc[Pc.TwoPageLeft=4]="TwoPageLeft",Pc[Pc.TwoPageRight=5]="TwoPageRight",(Pc=tp=tp||{})[Pc.Simplex=0]="Simplex",Pc[Pc.DuplexFlipShortEdge=1]="DuplexFlipShortEdge",Pc[Pc.DuplexFlipLongEdge=2]="DuplexFlipLongEdge",Pc[Pc.None=3]="None",(Pc=ip=ip||{})[Pc.AppDefault=0]="AppDefault",Pc[Pc.None=1]="None",rp=function(e,t){return(rp=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}rp(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(lp,sp=Sl),Object.defineProperty(lp.prototype,"pages",{get:function(){return this.sections},set:function(e){e.element;this.sections=e,this.items.setValue(this.tempDictionaryProperties.pages,new Fh(e))},enumerable:!0,configurable:!0}),Object.defineProperty(lp.prototype,"viewerPreferences",{get:function(){return null!==this._viewerPreferences&&void 0!==this._viewerPreferences||(this._viewerPreferences=new np(this),this.items.setValue(this.tempDictionaryProperties.viewerPreferences,new Fh(this._viewerPreferences.element))),this._viewerPreferences},enumerable:!0,configurable:!0});var rp,sp,ap=lp;function lp(){var e=sp.call(this)||this;return e.sections=null,e.tempDictionaryProperties=new Cl,e.items.setValue((new Cl).type,new yl("Catalog")),e}Object.defineProperty(dp.prototype,"isMerging",{get:function(){return this.merging},set:function(e){this.merging=e},enumerable:!0,configurable:!0}),Object.defineProperty(dp.prototype,"trailer",{get:function(){return null==this.internalTrailer&&(this.internalTrailer=new xh),this.internalTrailer},enumerable:!0,configurable:!0}),Object.defineProperty(dp.prototype,"document",{get:function(){return this.pdfDocument},set:function(e){this.pdfDocument=e,this.items=this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(dp.prototype,"pdfObjects",{get:function(){return this.items},enumerable:!0,configurable:!0}),Object.defineProperty(dp.prototype,"objectCollection",{get:function(){return this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(dp.prototype,"count",{get:function(){return this.objectCount},set:function(e){this.objectCount=e},enumerable:!0,configurable:!0}),Object.defineProperty(dp.prototype,"nextObjNumber",{get:function(){return this.count=this.count+1,this.count},enumerable:!0,configurable:!0}),dp.prototype.save=function(e,t){if(this._saveProcess(e),void 0===t)return e.stream.buffer;e.stream.save(t)},dp.prototype._saveProcess=function(e){this.saveHead(e),this.mappedReferences=null,this.objects.clear(),this.markTrailerReferences(),this.saveObjects(e);var t=this.count,i=e.position;this.registerObject(0,new Ph(0,-1),!0);e.write(bl.xref),e.write(bl.newLine),this.saveSections(e),this.saveTrailer(e,this.count,0),this.saveTheEndess(e,i),this.count=t;for(var n=0;n<this.objectCollection.count;++n)this.objectCollection.items(n).object.isSaving=!1},dp.prototype._save=function(e){return this._saveProcess(e),new Uint8Array(e.stream.buffer.buffer)},dp.prototype.saveTheEndess=function(e,t){e.write(bl.newLine+bl.startxref+bl.newLine),e.write(t.toString()+bl.newLine),e.write(bl.eof+bl.newLine)},dp.prototype.saveTrailer=function(e,t,i){e.write(bl.trailer+bl.newLine);var n=this.trailer;n.items.setValue(this.dictionaryProperties.size,new kl(this.objectCount+1)),(n=new Sl(n)).setEncrypt(!1),n.save(e)},dp.prototype.saveSections=function(e){for(var t,i=0;t=this.prepareSubsection(i),this.saveSubsection(e,i,t),i+=t,0!==t;);},dp.prototype.saveSubsection=function(e,t,i){if(!(i<=0||t>=this.count)){e.write(t+" "+(i+1)+bl.newLine);for(var n=t;n<=t+i;++n){var o=this.objects.getValue(n),r="",r=o.type===Yd.Free?this.getItem(o.offset,65535,!0):this.getItem(o.offset,o.generation,!1);e.write(r)}}},dp.prototype.getItem=function(e,t,i){for(var n="",o=10-e.toString().length,r=5-(t=t<=0?0:t).toString().length<=0?0:5-t.toString().length,s=0;s<o;s++)n+="0";for(n=n+e.toString()+" ",s=0;s<r;s++)n+="0";return n=(n=n+t.toString()+" ")+(i?bl.f:bl.n)+bl.newLine},dp.prototype.prepareSubsection=function(e){for(var t,i=0,n=this.count,o=0;o<this.document.pdfObjects.count;o++)this.document.pdfObjects.items(o).reference.toString().split(" ");if(!(n<=e))for(e=t=e;t<n;++t)++i;return i},dp.prototype.markTrailerReferences=function(){this.trailer.items.keys(),this.trailer.items.values()},dp.prototype.saveHead=function(e){var t=this.generateFileVersion(e.document);e.write("%PDF-"+t),e.write(bl.newLine)},dp.prototype.generateFileVersion=function(e){return"1."+4..toString()},dp.prototype.getReference=function(e,t){return void 0===t?this.getReference(e,!1):this.getSubReference(e,t)},dp.prototype.getSubReference=function(e,t){var i,n,o=!1,r=null;return 0<this.items.count&&0<e.objectCollectionIndex&&this.items.count>e.objectCollectionIndex-1&&(r=(n=this.document.pdfObjects.getReference(e,i)).reference,i=n.wasNew),i=null==r&&e.status!==zd.Registered,null==r&&(n=this.nextObjNumber,r=new Ph(n,0),i?(this.document.pdfObjects.add(e),this.document.pdfObjects.trySetReference(e,r,void 0),n=this.document.pdfObjects.count-1,i=this.document.pdfObjects.objectCollections[n].reference.objNumber,n=this.document.pdfObjects.objectCollections[this.document.pdfObjects.count-1],this.document.pdfObjects.mainObjectCollection.setValue(i,n),e.position=-1):this.document.pdfObjects.trySetReference(e,r,void 0),e.objectCollectionIndex=r.objNumber,e.status=zd.None,o=!0),o||this.bForceNew,r},dp.prototype.saveObjects=function(e){for(var t=this.objectCollection,i=0;i<t.count;++i){var n=t.items(i).object;n.isSaving=!0,this.saveIndirectObject(n,e)}},dp.prototype.saveIndirectObject=function(e,t){var i=this.getReference(e);e instanceof ap&&this.trailer.items.setValue(this.dictionaryProperties.root,i),this.pdfDocument.currentSavingObj=i,e.getArchive();this.registerObject(t.position,i),this.doSaveObject(e,i,t)},dp.prototype.doSaveObject=function(e,t,i){i.write(t.objNumber.toString()),i.write(bl.whiteSpace),i.write(t.genNumber.toString()),i.write(bl.whiteSpace),i.write(bl.obj),i.write(bl.newLine),e.save(i),i.write(bl.endObj),i.write(bl.newLine)},dp.prototype.registerObject=function(e,t,i){"boolean"==typeof i?(this.objects.setValue(t.objNumber,new pp(e,t,i)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,t.genNumber)):void 0===i&&(this.objects.setValue(t.objNumber,new pp(e,t)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,t.genNumber))},dp.dereference=function(e){return e=null!=e?e.object:e};var hp=dp;function dp(){this.objects=new ml,this.maxGenNumIndex=0,this.objectCount=0,this.dictionaryProperties=new Cl}Object.defineProperty(cp.prototype,"objectNumber",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(cp.prototype,"offset",{get:function(){return this.offsetNumber},enumerable:!0,configurable:!0});var pp=cp;function cp(e,t,i){this.offsetNumber=e;e=t;this.generation=e.genNumber,this.object=e.objNumber,this.type=void 0===i?Yd.Normal:Yd.Free}wp.letter=new td(612,792),wp.note=new td(540,720),wp.legal=new td(612,1008),wp.a0=new td(2380,3368),wp.a1=new td(1684,2380),wp.a2=new td(1190,1684),wp.a3=new td(842,1190),wp.a4=new td(595,842),wp.a5=new td(421,595),wp.a6=new td(297,421),wp.a7=new td(210,297),wp.a8=new td(148,210),wp.a9=new td(105,148),wp.a10=new td(74,105),wp.b0=new td(2836,4008),wp.b1=new td(2004,2836),wp.b2=new td(1418,2004),wp.b3=new td(1002,1418),wp.b4=new td(709,1002),wp.b5=new td(501,709),wp.archE=new td(2592,3456),wp.archD=new td(1728,2592),wp.archC=new td(1296,1728),wp.archB=new td(864,1296),wp.archA=new td(648,864),wp.flsa=new td(612,936),wp.halfLetter=new td(396,612),wp.letter11x17=new td(792,1224),wp.ledger=new td(1224,792);var up,gp,mp,fp,yp,vp,bp=wp;function wp(){}(Pc=up=up||{})[Pc.Portrait=0]="Portrait",Pc[Pc.Landscape=1]="Landscape",(Pc=gp=gp||{})[Pc.RotateAngle0=0]="RotateAngle0",Pc[Pc.RotateAngle90=1]="RotateAngle90",Pc[Pc.RotateAngle180=2]="RotateAngle180",Pc[Pc.RotateAngle270=3]="RotateAngle270",(Pc=mp=mp||{})[Pc.None=0]="None",Pc[Pc.Numeric=1]="Numeric",Pc[Pc.LowerLatin=2]="LowerLatin",Pc[Pc.LowerRoman=3]="LowerRoman",Pc[Pc.UpperLatin=4]="UpperLatin",Pc[Pc.UpperRoman=5]="UpperRoman",(Pc=fp=fp||{})[Pc.None=0]="None",Pc[Pc.Bottom=1]="Bottom",Pc[Pc.Top=2]="Top",Pc[Pc.Left=3]="Left",Pc[Pc.Right=4]="Right",Pc[Pc.Fill=5]="Fill",(Pc=yp=yp||{})[Pc.None=0]="None",Pc[Pc.TopLeft=1]="TopLeft",Pc[Pc.TopCenter=2]="TopCenter",Pc[Pc.TopRight=3]="TopRight",Pc[Pc.MiddleLeft=4]="MiddleLeft",Pc[Pc.MiddleCenter=5]="MiddleCenter",Pc[Pc.MiddleRight=6]="MiddleRight",Pc[Pc.BottomLeft=7]="BottomLeft",Pc[Pc.BottomCenter=8]="BottomCenter",Pc[Pc.BottomRight=9]="BottomRight",(Pc=vp=vp||{})[Pc.None=0]="None",Pc[Pc.Top=1]="Top",Pc[Pc.Bottom=2]="Bottom",Pc[Pc.Left=3]="Left",Pc[Pc.Right=4]="Right";Object.defineProperty(Sp.prototype,"left",{get:function(){return this.leftMargin},set:function(e){this.leftMargin=e},enumerable:!0,configurable:!0}),Object.defineProperty(Sp.prototype,"top",{get:function(){return this.topMargin},set:function(e){this.topMargin=e},enumerable:!0,configurable:!0}),Object.defineProperty(Sp.prototype,"right",{get:function(){return this.rightMargin},set:function(e){this.rightMargin=e},enumerable:!0,configurable:!0}),Object.defineProperty(Sp.prototype,"bottom",{get:function(){return this.bottomMargin},set:function(e){this.bottomMargin=e},enumerable:!0,configurable:!0}),Object.defineProperty(Sp.prototype,"all",{set:function(e){this.setMargins(e)},enumerable:!0,configurable:!0}),Sp.prototype.setMargins=function(e,t,i,n){void 0===t?this.leftMargin=this.topMargin=this.rightMargin=this.bottomMargin=e:void 0===i?(this.leftMargin=this.rightMargin=e,this.bottomMargin=this.topMargin=t):(this.leftMargin=e,this.topMargin=t,this.rightMargin=i,this.bottomMargin=n)},Sp.prototype.clone=function(){return this};var Cp=Sp;function Sp(){this.pdfMargin=40,this.setMargins(this.pdfMargin)}Object.defineProperty(xp.prototype,"size",{get:function(){return this.pageSize},set:function(e){this.setSize(e)},enumerable:!0,configurable:!0}),Object.defineProperty(xp.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(e){this.pageOrientation!==e&&(this.pageOrientation=e,this.updateSize(e))},enumerable:!0,configurable:!0}),Object.defineProperty(xp.prototype,"margins",{get:function(){return this.pageMargins},set:function(e){this.pageMargins=e},enumerable:!0,configurable:!0}),Object.defineProperty(xp.prototype,"width",{get:function(){return this.pageSize.width},set:function(e){this.pageSize.width=e},enumerable:!0,configurable:!0}),Object.defineProperty(xp.prototype,"height",{get:function(){return this.pageSize.height},set:function(e){this.pageSize.height=e},enumerable:!0,configurable:!0}),Object.defineProperty(xp.prototype,"origin",{get:function(){return this.pageOrigin},set:function(e){this.pageOrigin=e},enumerable:!0,configurable:!0}),Object.defineProperty(xp.prototype,"rotate",{get:function(){return this.rotateAngle},set:function(e){this.rotateAngle=e,this.isRotation=!0},enumerable:!0,configurable:!0}),xp.prototype.updateSize=function(e){var t=Math.min(this.pageSize.width,this.pageSize.height),i=Math.max(this.pageSize.width,this.pageSize.height);switch(e){case up.Portrait:this.pageSize=new td(t,i);break;case up.Landscape:this.pageSize=new td(i,t)}},xp.prototype.clone=function(){return this.pageMargins=this.pageMargins.clone(),this},xp.prototype.getActualSize=function(){var e=this.width-(this.margins.left+this.margins.right),t=this.height-(this.margins.top+this.margins.bottom);return new td(e,t)},xp.prototype.setSize=function(e){var t=Math.min(e.width,e.height),e=Math.max(e.width,e.height);this.orientation===up.Portrait?this.pageSize=new td(t,e):this.pageSize=new td(e,t)};var Ap=xp;function xp(e){this.pageMargins=new Cp,this.pageSize=bp.a4,this.rotateAngle=gp.RotateAngle0,this.pageOrientation=up.Portrait,this.pageOrigin=new ed(0,0),this.isRotation=!1,"number"==typeof e&&this.pageMargins.setMargins(e)}Tp.prototype.clear=function(){this.stream.clearStream()},Tp.prototype.setGraphicsState=function(e){e instanceof yl?this.stream.write(e.toString()):(this.stream.write(bl.slash),this.stream.write(e)),this.stream.write(bl.whiteSpace),this.writeOperator(bl.setGraphicsState)},Tp.prototype.executeObject=function(e){this.stream.write(e.toString()),this.stream.write(bl.whiteSpace),this.writeOperator(bl.paintXObject),this.stream.write(bl.newLine)},Tp.prototype.closePath=function(){this.writeOperator(bl.closePath)},Tp.prototype.clipPath=function(e){this.stream.write(bl.clipPath),e&&this.stream.write(bl.evenOdd),this.stream.write(bl.whiteSpace),this.stream.write(bl.endPath),this.stream.write(bl.newLine)},Tp.prototype.closeFillStrokePath=function(e){this.stream.write(bl.closeFillStrokePath),e&&this.stream.write(bl.evenOdd),this.stream.write(bl.newLine)},Tp.prototype.fillStrokePath=function(e){this.stream.write(bl.fillStroke),e&&this.stream.write(bl.evenOdd),this.stream.write(bl.newLine)},Tp.prototype.fillPath=function(e){this.stream.write(bl.fill),e&&this.stream.write(bl.evenOdd),this.stream.write(bl.newLine)},Tp.prototype.endPath=function(){this.writeOperator(bl.n)},Tp.prototype.closeFillPath=function(e){this.writeOperator(bl.closePath),this.stream.write(bl.fill),e&&this.stream.write(bl.evenOdd),this.stream.write(bl.newLine)},Tp.prototype.closeStrokePath=function(){this.writeOperator(bl.closeStrokePath)},Tp.prototype.setTextScaling=function(e){this.stream.write(kl.floatToString(e)),this.stream.write(bl.whiteSpace),this.writeOperator(bl.setTextScaling)},Tp.prototype.strokePath=function(){this.writeOperator(bl.stroke)},Tp.prototype.restoreGraphicsState=function(){this.writeOperator(bl.restoreState)},Tp.prototype.saveGraphicsState=function(){this.writeOperator(bl.saveState)},Tp.prototype.startNextLine=function(e,t){void 0===e?this.writeOperator(bl.goToNextLine):(e instanceof ed?this.writePoint(e):this.writePoint(e,t),this.writeOperator(bl.setCoords))},Tp.prototype.showText=function(e){this.checkTextParam(e),this.writeText(e),this.writeOperator(bl.setText)},Tp.prototype.setLeading=function(e){this.stream.write(kl.floatToString(e)),this.stream.write(bl.whiteSpace),this.writeOperator(bl.setTextLeading)},Tp.prototype.beginPath=function(e,t){this.writePoint(e,t),this.writeOperator(bl.beginPath)},Tp.prototype.beginText=function(){this.writeOperator(bl.beginText)},Tp.prototype.endText=function(){this.writeOperator(bl.endText)},Tp.prototype.appendRectangle=function(e,t,i,n){e instanceof id?this.appendRectangle(e.x,e.y,e.width,e.height):(this.writePoint(e,t),this.writePoint(i,n),this.writeOperator(bl.appendRectangle))},Tp.prototype.appendLineSegment=function(e,t){e instanceof ed?this.appendLineSegment(e.x,e.y):(this.writePoint(e,t),this.writeOperator(bl.appendLineSegment))},Tp.prototype.setTextRenderingMode=function(e){this.stream.write(e.toString()),this.stream.write(bl.whiteSpace),this.writeOperator(bl.setRenderingMode)},Tp.prototype.setCharacterSpacing=function(e){this.stream.write(kl.floatToString(e)),this.stream.write(bl.whiteSpace),this.stream.write(bl.setCharacterSpace),this.stream.write(bl.newLine)},Tp.prototype.setWordSpacing=function(e){this.stream.write(kl.floatToString(e)),this.stream.write(bl.whiteSpace),this.writeOperator(bl.setWordSpace)},Tp.prototype.showNextLineText=function(e,t){e instanceof Mh?(this.checkTextParam(e),this.writeText(e)):(this.checkTextParam(e),this.writeText(e,t)),this.writeOperator(bl.setTextOnNewLine)},Tp.prototype.setColorSpace=function(e,t){var i,n;e instanceof yl&&"boolean"==typeof t?(i=(n=t)?bl.selectcolorspaceforstroking:bl.selectcolorspacefornonstroking,this.stream.write(e.toString()),this.stream.write(bl.whiteSpace),this.stream.write(i),this.stream.write(bl.newLine)):(n=t,this.setColorSpace(new yl(e),n))},Tp.prototype.modifyCtm=function(e){if(null==e)throw new Error("ArgumentNullException:matrix");this.stream.write(e.toString()),this.stream.write(bl.whiteSpace),this.writeOperator(bl.modifyCtm)},Tp.prototype.setFont=function(e,t,i){if("string"==typeof t)this.setFont(e,new yl(t),i);else{if(null==e)throw new Error("ArgumentNullException:font");this.stream.write(t.toString()),this.stream.write(bl.whiteSpace),this.stream.write(kl.floatToString(i)),this.stream.write(bl.whiteSpace),this.writeOperator(bl.setFont)}},Tp.prototype.writeOperator=function(e){this.stream.write(e),this.stream.write(bl.newLine)},Tp.prototype.checkTextParam=function(e){if(null==e)throw new Error("ArgumentNullException:text");if("string"==typeof e&&""===e)throw new Error("ArgumentException:The text can not be an empty string, text")},Tp.prototype.writeText=function(e,t){var i,n;e instanceof Mh&&void 0===t?this.stream.write(e.pdfEncode()):(n=i=void 0,n=(t?(i=Mh.hexStringMark[0],Mh.hexStringMark):(i=Mh.stringMark[0],Mh.stringMark))[1],this.stream.write(i),this.stream.write(e),this.stream.write(n))},Tp.prototype.writePoint=function(e,t){e instanceof ed&&void 0===t?this.writePoint(e.x,e.y):(this.stream.write(kl.floatToString(e)),this.stream.write(bl.whiteSpace),t=this.updateY(t),this.stream.write(kl.floatToString(t)),this.stream.write(bl.whiteSpace))},Tp.prototype.updateY=function(e){return-e},Tp.prototype.write=function(e){var t="";this.writeOperator(t+e+bl.newLine)},Tp.prototype.writeComment=function(e){if(!(null!=e&&0<e.length))throw new Error("Invalid comment");var t="";this.writeOperator((t+=bl.comment)+bl.whiteSpace+e)},Tp.prototype.setColorAndSpace=function(e,t,i){e.isEmpty||(this.stream.write(e.toString(t,i)),this.stream.write(bl.newLine))},Tp.prototype.setLineDashPattern=function(e,t){this.setLineDashPatternHelper(e,t)},Tp.prototype.setLineDashPatternHelper=function(e,t){var i="[";if(1<e.length)for(var n=0;n<e.length;n++)n===e.length-1?i+=e[n].toString():i+=e[n].toString()+" ";i=(i+="] ")+t.toString(),this.stream.write(i+=" "+bl.setDashPattern),this.stream.write(bl.newLine)},Tp.prototype.setMiterLimit=function(e){this.stream.write(kl.floatToString(e)),this.stream.write(bl.whiteSpace),this.writeOperator(bl.setMiterLimit)},Tp.prototype.setLineWidth=function(e){this.stream.write(kl.floatToString(e)),this.stream.write(bl.whiteSpace),this.writeOperator(bl.setLineWidth)},Tp.prototype.setLineCap=function(e){this.stream.write(e.toString()),this.stream.write(bl.whiteSpace),this.writeOperator(bl.setLineCapStyle)},Tp.prototype.setLineJoin=function(e){this.stream.write(e.toString()),this.stream.write(bl.whiteSpace),this.writeOperator(bl.setLineJoinStyle)},Object.defineProperty(Tp.prototype,"position",{get:function(){return this.stream.position},enumerable:!0,configurable:!0}),Object.defineProperty(Tp.prototype,"length",{get:function(){var e=0;if(0!==this.stream.data.length&&-1!==this.stream.data.length)for(var t=0;t<this.stream.data.length;t++)e+=this.stream.data[t].length;return e},enumerable:!0,configurable:!0}),Object.defineProperty(Tp.prototype,"document",{get:function(){return null},enumerable:!0,configurable:!0}),Tp.prototype.appendBezierSegment=function(e,t,i,n,o,r){e instanceof ed&&t instanceof ed&&i instanceof ed?(this.writePoint(e.x,e.y),this.writePoint(t.x,t.y),this.writePoint(i.x,i.y)):(this.writePoint(e,t),this.writePoint(i,n),this.writePoint(o,r)),this.writeOperator(bl.appendbeziercurve)},Tp.prototype.setColourWithPattern=function(e,t,i){if(null!=e)for(var n=e.length,o=0,o=0;o<n;++o)this.stream.write(e[o].toString()),this.stream.write(bl.whiteSpace);null!=t&&(this.stream.write(t.toString()),this.stream.write(bl.whiteSpace)),i?this.writeOperator(bl.setColorAndPatternStroking):this.writeOperator(bl.setColorAndPattern)};var Ip=Tp;function Tp(e){if(null==e)throw new Error("ArgumentNullException:stream");this.stream=e}Object.defineProperty(Dp.prototype,"color",{get:function(){return this.pdfColor},set:function(e){this.pdfColor=e},enumerable:!0,configurable:!0}),Object.defineProperty(Dp.prototype,"dashOffset",{get:function(){return void 0===this.dashOffsetValue||null==this.dashOffsetValue?0:this.dashOffsetValue},set:function(e){this.dashOffsetValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(Dp.prototype,"dashPattern",{get:function(){return this.penDashPattern},set:function(e){this.penDashPattern=e},enumerable:!0,configurable:!0}),Object.defineProperty(Dp.prototype,"dashStyle",{get:function(){return this.pdfDashStyle},set:function(e){if(this.pdfDashStyle!==e)switch(this.pdfDashStyle=e,this.pdfDashStyle){case Qh.Custom:break;case Qh.Dash:this.penDashPattern=[3,1];break;case Qh.Dot:this.penDashPattern=[1,1];break;case Qh.DashDot:this.penDashPattern=[3,1,1,1];break;case Qh.DashDotDot:this.penDashPattern=[3,1,1,1,1,1];break;case Qh.Solid:break;default:this.pdfDashStyle=Qh.Solid,this.penDashPattern=[0]}},enumerable:!0,configurable:!0}),Object.defineProperty(Dp.prototype,"lineCap",{get:function(){return this.pdfLineCap},set:function(e){this.pdfLineCap=e},enumerable:!0,configurable:!0}),Object.defineProperty(Dp.prototype,"lineJoin",{get:function(){return this.pdfLineJoin},set:function(e){this.pdfLineJoin=e},enumerable:!0,configurable:!0}),Object.defineProperty(Dp.prototype,"miterLimit",{get:function(){return this.internalMiterLimit},set:function(e){this.internalMiterLimit=e},enumerable:!0,configurable:!0}),Object.defineProperty(Dp.prototype,"width",{get:function(){return this.penWidth},set:function(e){this.penWidth=e},enumerable:!0,configurable:!0}),Dp.prototype.clone=function(){return this},Dp.prototype.setBrush=function(e){null!=e&&e instanceof Sd&&(this.color=e.color,this.pdfBrush=e),this.color=e.color,this.pdfBrush=e},Dp.prototype.monitorChanges=function(e,t,i,n,o,r){this.dashControl(e,!0,t),t.setLineWidth(this.width),t.setLineJoin(this.lineJoin),t.setLineCap(this.lineCap);e=this.miterLimit;0<e&&t.setMiterLimit(e),this.pdfBrush;return t.setColorAndSpace(this.color,o,!0),!0},Dp.prototype.dashControl=function(e,t,i){var n=this.width,o=this.getPattern();return i.setLineDashPattern(o,this.dashOffset*n),!0},Dp.prototype.getPattern=function(){for(var e=this.dashPattern,t=0;t<e.length;++t)e[t]*=this.width;return e};var Ep=Dp;function Dp(e,t){this.pdfColor=new se(0,0,0),this.dashOffsetValue=0,this.penDashPattern=[0],this.pdfDashStyle=Qh.Solid,this.pdfLineCap=0,this.pdfLineJoin=0,this.penWidth=1,this.internalMiterLimit=0,this.colorSpace=qh.Rgb,e instanceof rd?this.setBrush(e):e instanceof se&&(this.color=e),"number"==typeof t&&(this.width=t)}Object.defineProperty(kp.prototype,"matrix",{get:function(){return this.transformationMatrix},set:function(e){this.transformationMatrix=e},enumerable:!0,configurable:!0}),kp.prototype.translate=function(e,t){this.transformationMatrix.translate(e,t)},kp.prototype.scale=function(e,t){this.transformationMatrix.elements[0]=e,this.transformationMatrix.elements[3]=t},kp.prototype.rotate=function(e){e=e*Math.PI/180,this.transformationMatrix.elements[0]=Math.cos(e),this.transformationMatrix.elements[1]=Math.sin(e),this.transformationMatrix.elements[2]=-Math.sin(e),this.transformationMatrix.elements[3]=Math.cos(e)},kp.prototype.toString=function(){for(var e="",t=0,i=this.transformationMatrix.elements.length;t<i;t++)this.matrix.elements[t],e=e+kl.floatToString(this.transformationMatrix.elements[t])+" ";return e},kp.prototype.multiply=function(e){this.transformationMatrix.multiply(e.matrix)},kp.degreesToRadians=function(e){return this.degRadFactor*e},kp.prototype.radiansToDegrees=function(e){return this.radDegFactor*e},kp.prototype.clone=function(){return this},kp.degRadFactor=Math.PI/180;var Mp=kp;function kp(e){this.radDegFactor=180/Math.PI,this.transformationMatrix=new Pp(1,0,0,void 0===e?1:-1,0,0)}Object.defineProperty(Bp.prototype,"elements",{get:function(){return this.metrixElements},enumerable:!0,configurable:!0}),Object.defineProperty(Bp.prototype,"offsetX",{get:function(){return this.metrixElements[4]},enumerable:!0,configurable:!0}),Object.defineProperty(Bp.prototype,"offsetY",{get:function(){return this.metrixElements[5]},enumerable:!0,configurable:!0}),Bp.prototype.translate=function(e,t){this.metrixElements[4]=e,this.metrixElements[5]=t},Bp.prototype.transform=function(e){var t=e.x,e=e.y,i=t*this.elements[0]+e*this.elements[2]+this.offsetX,t=t*this.elements[1]+e*this.elements[3]+this.offsetY;return new ed(i,t)},Bp.prototype.multiply=function(e){var t=[];t.push(this.elements[0]*e.elements[0]+this.elements[1]*e.elements[2]),t[1]=this.elements[0]*e.elements[1]+this.elements[1]*e.elements[3],t[2]=this.elements[2]*e.elements[0]+this.elements[3]*e.elements[2],t[3]=this.elements[2]*e.elements[1]+this.elements[3]*e.elements[3],t[4]=this.offsetX*e.elements[0]+this.offsetY*e.elements[2]+e.offsetX,t[5]=this.offsetX*e.elements[1]+this.offsetY*e.elements[3]+e.offsetY;for(var i=0;i<t.length;i++)this.elements[i]=t[i]},Bp.prototype.dispose=function(){this.metrixElements=null},Bp.prototype.clone=function(){return new Bp(this.metrixElements)};var Pp=Bp;function Bp(e,t,i,n,o,r){void 0===e?this.metrixElements=[]:"number"==typeof e?(this.metrixElements=[],this.metrixElements.push(e),this.metrixElements.push(t),this.metrixElements.push(i),this.metrixElements.push(n),this.metrixElements.push(o),this.metrixElements.push(r)):this.metrixElements=e}var Fp=function(){this.pdf="PDF",this.text="Text",this.imageB="ImageB",this.imageC="ImageC",this.imageI="ImageI"},Lp=(Rp.prototype.size=function(){return this.mKeys.length},Rp.prototype.add=function(e,t){if(null==e||null==t)throw new ReferenceError("Provided key or value is not valid.");if(this.mKeys.indexOf(e)<0)return this.mKeys.push(e),this.mValues.push(t),1;throw new RangeError("An item with the same key has already been added.")},Rp.prototype.keys=function(){return this.mKeys},Rp.prototype.values=function(){return this.mValues},Rp.prototype.getValue=function(e){if(null==e)throw new ReferenceError("Provided key is not valid.");e=this.mKeys.indexOf(e);if(e<0)throw new RangeError("No item with the specified key has been added.");return this.mValues[e]},Rp.prototype.setValue=function(e,t){if(null==e)throw new ReferenceError("Provided key is not valid.");var i=this.mKeys.indexOf(e);i<0?(this.mKeys.push(e),this.mValues.push(t)):this.mValues[i]=t},Rp.prototype.remove=function(e){if(null==e)throw new ReferenceError("Provided key is not valid.");e=this.mKeys.indexOf(e);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},Rp.prototype.containsKey=function(e){if(null==e)throw new ReferenceError("Provided key is not valid.");return!(this.mKeys.indexOf(e)<0)},Rp.prototype.clear=function(){this.mKeys=[],this.mValues=[]},Rp);function Rp(){this.mKeys=[],this.mValues=[]}Object.defineProperty(Np.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0});var Op=Np;function Np(e,t,i){this.dictionary=new Sl,this.dictionaryProperties=new Cl,this.dictionary.items.setValue(this.dictionaryProperties.CA,new kl(e)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new kl(t)),this.dictionary.items.setValue(this.dictionaryProperties.BM,new yl(i.toString()))}Object.defineProperty(_p.prototype,"automaticFields",{get:function(){return this.automaticFieldsInformation},enumerable:!0,configurable:!0}),_p.prototype.add=function(e){return this.automaticFields.push(e)};var Vp=_p;function _p(){this.automaticFieldsInformation=[]}function Hp(){}Hp.prototype.drawHelper=function(e,t,i){var n=0!==t||0!==i,o=null;n&&(o=e.save(),e.translateTransform(t,i)),this.drawInternal(e),n&&e.restore(o)},zp=function(e,t){return(zp=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}zp(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Qp,jp=Hp),Object.defineProperty(Qp.prototype,"bounds",{get:function(){return this.internalBounds},set:function(e){this.internalBounds=e},enumerable:!0,configurable:!0}),Object.defineProperty(Qp.prototype,"size",{get:function(){return new td(this.bounds.width,this.bounds.height)},set:function(e){this.bounds.width=e.width,this.bounds.height=e.height},enumerable:!0,configurable:!0}),Object.defineProperty(Qp.prototype,"location",{get:function(){return new ed(this.bounds.x,this.bounds.y)},set:function(e){this.bounds.x=e.x,this.bounds.y=e.y},enumerable:!0,configurable:!0}),Object.defineProperty(Qp.prototype,"font",{get:function(){return this.internalFont},set:function(e){this.internalFont=e},enumerable:!0,configurable:!0}),Object.defineProperty(Qp.prototype,"brush",{get:function(){return this.internalBrush},set:function(e){this.internalBrush=e},enumerable:!0,configurable:!0}),Object.defineProperty(Qp.prototype,"pen",{get:function(){return this.internalPen},set:function(e){this.internalPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(Qp.prototype,"stringFormat",{get:function(){return this.internalStringFormat},set:function(e){this.internalStringFormat=e},enumerable:!0,configurable:!0}),Qp.prototype.performDrawHelper=function(e,t,i,n){0!==this.bounds.height&&0!==this.bounds.width||(e=this.getValue(e),this.internalTemplateSize=this.getFont().measureString(e,this.size,this.stringFormat))},Qp.prototype.draw=function(e,t,i){var n;void 0===t?(n=new ed(0,0),this.draw(e,n)):t instanceof ed?this.draw(e,t.x,t.y):(this.drawHelper(e,t,i),n=new Up(this,new ed(t,i)),e.automaticFields.add(n))},Qp.prototype.getSize=function(){return 0===this.bounds.height||0===this.bounds.width?this.internalTemplateSize:this.size},Qp.prototype.drawInternal=function(e){},Qp.prototype.getBrush=function(){return void 0===this.internalBrush||null==this.internalBrush?new Sd(new se(0,0,0)):this.internalBrush},Qp.prototype.getFont=function(){return void 0===this.internalFont||null==this.internalFont?sg.defaultFont:this.internalFont},Qp.prototype.getPageFromGraphics=function(e){return void 0!==e.page&&null!==e.page?e.page:e.currentPage};var zp,jp,Wp=Qp;function Qp(){var e=jp.call(this)||this;return e.internalBounds=new id(0,0,0,0),e.internalTemplateSize=new td(0,0),e}Object.defineProperty(qp.prototype,"location",{get:function(){return this.pageNumberFieldLocation},set:function(e){this.pageNumberFieldLocation=e},enumerable:!0,configurable:!0}),Object.defineProperty(qp.prototype,"field",{get:function(){return this.pageNumberField},set:function(e){this.pageNumberField=e},enumerable:!0,configurable:!0}),Object.defineProperty(qp.prototype,"scalingX",{get:function(){return this.scaleX},set:function(e){this.scaleX=e},enumerable:!0,configurable:!0}),Object.defineProperty(qp.prototype,"scalingY",{get:function(){return this.scaleY},set:function(e){this.scaleY=e},enumerable:!0,configurable:!0});var Up=qp;function qp(e,t,i,n){this.pageNumberFieldLocation=new ed,this.pageNumberField=null,this.scaleX=1,this.scaleY=1,void 0===t&&e instanceof qp?(this.pageNumberField=e.field,this.pageNumberFieldLocation=e.location,this.scaleX=e.scalingX,this.scaleY=e.scalingY):void 0===i&&t instanceof ed&&e instanceof Wp?(this.pageNumberField=e,this.pageNumberFieldLocation=t):(this.pageNumberField=e,this.pageNumberFieldLocation=t,this.scaleX=i,this.scaleY=n)}Object.defineProperty(Xp.prototype,"position",{get:function(){return this.mPosition},set:function(e){this.mPosition=e},enumerable:!0,configurable:!0}),Xp.prototype.read=function(e,t,i){for(var n=t;n<i;n++){var o=this.position;e.buffer[n]=this.readByte(o),this.position++}},Xp.prototype.getBuffer=function(e){return this.buffer[e]},Xp.prototype.writeFromBase64String=function(e){e=this.encodedString(e);this.buffer=e},Xp.prototype.encodedString=function(e){for(var t,i,n,o,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,a=0,l=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4,h=(e.charAt(e.length-1)===r.charAt(64)&&l--,new Uint8Array(0|l));s<e.length;)i=r.indexOf(e.charAt(s++)),t=(15&(n=r.indexOf(e.charAt(s++))))<<4|(o=r.indexOf(e.charAt(s++)))>>2,o=(3&o)<<6|r.indexOf(e.charAt(s++)),h[a++]=i<<2|n>>4,h[a++]=t,h[a++]=o;return h},Xp.prototype.readByte=function(e){return this.buffer[e]},Object.defineProperty(Xp.prototype,"internalBuffer",{get:function(){return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(Xp.prototype,"count",{get:function(){return this.buffer.byteLength},enumerable:!0,configurable:!0}),Xp.prototype.readNextTwoBytes=function(e){var t=e.readByte(this.position);return this.position++,t=(t<<=8)|e.readByte(this.position),this.position++,t};var Gp,Yp=Xp;function Xp(e){this.mPosition=0,this.buffer=new Uint8Array(e),this.dataView=new DataView(this.buffer.buffer)}(Pc=Gp=Gp||{})[Pc.Unknown=0]="Unknown",Pc[Pc.Bmp=1]="Bmp",Pc[Pc.Emf=2]="Emf",Pc[Pc.Gif=3]="Gif",Pc[Pc.Jpeg=4]="Jpeg",Pc[Pc.Png=5]="Png",Pc[Pc.Wmf=6]="Wmf",Pc[Pc.Icon=7]="Icon";Object.defineProperty(Jp.prototype,"height",{get:function(){return this.mHeight},enumerable:!0,configurable:!0}),Object.defineProperty(Jp.prototype,"width",{get:function(){return this.mWidth},enumerable:!0,configurable:!0}),Object.defineProperty(Jp.prototype,"bitsPerComponent",{get:function(){return this.mbitsPerComponent},enumerable:!0,configurable:!0}),Object.defineProperty(Jp.prototype,"size",{get:function(){return this.mImageData.count},enumerable:!0,configurable:!0}),Object.defineProperty(Jp.prototype,"imageData",{get:function(){return this.mImageData},enumerable:!0,configurable:!0}),Object.defineProperty(Jp.prototype,"imageDataAsNumberArray",{get:function(){return this.mImageData.internalBuffer.buffer},enumerable:!0,configurable:!0}),Jp.prototype.initialize=function(){if(this.mFormat!==Gp.Unknown||!this.checkIfJpeg())throw new TypeError("Only the JPEG format is supported");this.mFormat=Gp.Jpeg,this.parseJpegImage(),this.reset(),this.mImageData=new Yp(this.mStream.count),this.mStream.read(this.mImageData,0,this.mImageData.count)},Jp.prototype.reset=function(){this.mStream.position=0},Jp.prototype.parseJpegImage=function(){this.reset();for(var e=new Yp(this.mStream.count),t=(this.mStream.read(e,0,e.count),4),i=!1,n=256*e.getBuffer(t)+e.getBuffer(t+1);t<e.count;){if(!((t+=n)<e.count)){i=!0;break}if(192===e.getBuffer(t+1))return this.mHeight=256*e.getBuffer(t+5)+e.getBuffer(t+6),void(this.mWidth=256*e.getBuffer(t+7)+e.getBuffer(t+8));t+=2,n=256*e.getBuffer(t)+e.getBuffer(t+1)}i&&(this.mStream.position=0,this.skip(this.mStream,2),this.readExceededJPGImage(this.mStream))},Object.defineProperty(Jp.prototype,"format",{get:function(){return this.mFormat},enumerable:!0,configurable:!0}),Jp.prototype.checkIfJpeg=function(){this.reset();for(var e=0;e<Jp.mJpegHeader.length;e++){if(Jp.mJpegHeader[e]!==this.mStream.readByte(e))return!1;this.mStream.position++}return!0},Jp.prototype.getImageDictionary=function(){if(this.mFormat===Gp.Jpeg){this.imageData.internalBuffer.length;this.imageStream=new xh,this.imageStream.isResource=!0;for(var e="",t="",i=0;i<this.imageDataAsNumberArray.byteLength;i++)e+=String.fromCharCode(null,this.mStream.readByte(i));for(i=0;i<e.length;i++)i%2!=0&&(t+=e[i]);this.imageStream.data=[t],this.imageStream.compress=!1,this.imageStream.items.setValue(this.dictionaryProperties.type,new yl(this.dictionaryProperties.xObject)),this.imageStream.items.setValue(this.dictionaryProperties.subtype,new yl(this.dictionaryProperties.image)),this.imageStream.items.setValue(this.dictionaryProperties.width,new kl(this.width)),this.imageStream.items.setValue(this.dictionaryProperties.height,new kl(this.height)),this.imageStream.items.setValue(this.dictionaryProperties.bitsPerComponent,new kl(this.bitsPerComponent)),this.imageStream.items.setValue(this.dictionaryProperties.filter,new yl(this.dictionaryProperties.dctdecode)),this.imageStream.items.setValue(this.dictionaryProperties.colorSpace,new yl(this.getColorSpace())),this.imageStream.items.setValue(this.dictionaryProperties.decodeParms,this.getDecodeParams())}return this.imageStream},Jp.prototype.getColorSpace=function(){return this.dictionaryProperties.deviceRgb},Jp.prototype.getDecodeParams=function(){var e=new Sl;return e.items.setValue(this.dictionaryProperties.columns,new kl(this.width)),e.items.setValue(this.dictionaryProperties.blackIs1,new Jd(!0)),e.items.setValue(this.dictionaryProperties.k,new kl(-1)),e.items.setValue(this.dictionaryProperties.predictor,new kl(15)),e.items.setValue(this.dictionaryProperties.bitsPerComponent,new kl(this.bitsPerComponent)),e},Jp.prototype.readExceededJPGImage=function(e){this.mStream=e;for(var t=!0;t;)switch(this.getMarker(e)){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:e.position+=3,this.mHeight=this.mStream.readNextTwoBytes(e),this.mWidth=this.mStream.readNextTwoBytes(e),t=!1;break;default:this.skipStream(e)}},Jp.prototype.skip=function(e,t){this.mStream=e;e=new Yp(t);this.mStream.read(e,0,e.count)},Jp.prototype.getMarker=function(e){var t=32,t=e.readByte(this.mStream.position);for(e.position++;255!==t;)t=e.readByte(this.mStream.position),e.position++;for(;t=e.readByte(this.mStream.position),e.position++,255===t;);return t},Jp.prototype.skipStream=function(e){var t=this.mStream.readNextTwoBytes(e)-2;0<t&&(e.position+=t)},Jp.mPngHeader=[137,80,78,71,13,10,26,10],Jp.mJpegHeader=[255,216],Jp.GIF_HEADER="G,I,F,8",Jp.BMP_HEADER="B,M";var Kp=Jp;function Jp(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=Gp.Unknown,this.mbitsPerComponent=8,this.dictionaryProperties=new Cl,this.mStream=e,this.initialize()}$p.prototype.convertUnits=function(e,t,i){return this.convertFromPixels(this.convertToPixels(e,t),i)},$p.prototype.convertToPixels=function(e,t){return e*this.proportions[t]},$p.prototype.convertFromPixels=function(e,t){return e/this.proportions[t]},$p.prototype.updateProportionsHelper=function(e){this.proportions=[e/2.54,e/6,1,e/72,e,e/300,e/25.4]},$p.horizontalResolution=96,$p.verticalResolution=96;var Zp=$p;function $p(e){this.updateProportionsHelper(e)}Object.defineProperty(tc.prototype,"width",{get:function(){return this.imageWidth},set:function(e){this.imageWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(tc.prototype,"height",{get:function(){return this.imageHeight},set:function(e){this.imageHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(tc.prototype,"size",{set:function(e){this.width=e.width,this.height=e.height},enumerable:!0,configurable:!0}),Object.defineProperty(tc.prototype,"physicalDimension",{get:function(){return this.imagePhysicalDimension=this.getPointSize(this.width,this.height,this.horizontalResolution,this.verticalResolution),new td(this.width,this.height)},enumerable:!0,configurable:!0}),Object.defineProperty(tc.prototype,"element",{get:function(){return this.imageStream},enumerable:!0,configurable:!0}),tc.prototype.getPointSize=function(e,t,i,n){var o,r;return void 0===i?(o=Zp.horizontalResolution,r=Zp.verticalResolution,this.getPointSize(e,t,o,r)):(o=new Zp(i),r=new Zp(n),i=o.convertUnits(e,Yh.Pixel,Yh.Point),n=r.convertUnits(t,Yh.Pixel,Yh.Point),new td(i,n))};var ec=tc;function tc(){}ic=function(e,t){return(ic=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}ic(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(rc,nc=ec),rc.prototype.loadImage=function(e){this.initializeAsync(e)},rc.prototype.initializeAsync=function(e){var t=new Yp(e.length);t.writeFromBase64String(e),this.decoder=new Kp(t),this.height=this.decoder.height,this.width=this.decoder.width,this.bitsPerComponent=this.decoder.bitsPerComponent},rc.prototype.save=function(){this.imageStatus=!0,this.imageStream=this.decoder.getImageDictionary()};var ic,nc,oc=rc;function rc(e){var t=nc.call(this)||this;return t.imageStatus=!0,t.dictionaryProperties=new Cl,t.loadImage(e),t}Object.defineProperty(ac.prototype,"empty",{get:function(){return this.offset===this.length&&this.length===this.checksum&&0===this.checksum},enumerable:!0,configurable:!0});var sc=ac;function ac(){}var lc=function(){},hc=function(){},dc=function(){},pc=(Object.defineProperty(cc.prototype,"isItalic",{get:function(){return 0!=(2&this.macStyle)},enumerable:!0,configurable:!0}),Object.defineProperty(cc.prototype,"isBold",{get:function(){return 0!=(1&this.macStyle)},enumerable:!0,configurable:!0}),cc);function cc(){}var uc=function(){},gc=function(){},mc=function(){},fc=function(){},yc=function(){},vc=function(){},bc=(Object.defineProperty(wc.prototype,"empty",{get:function(){return this.index===this.width&&this.width===this.charCode&&0===this.charCode},enumerable:!0,configurable:!0}),wc.prototype.compareTo=function(e){return this.index-e.index},wc);function wc(){}var Cc=function(){},Sc=function(){},Ac=function(){},xc=function(){},Ic=function(){},Tc=(Object.defineProperty(Ec.prototype,"data",{get:function(){if(this.buffer.length<this.bufferLength)for(var e=this.bufferLength-this.buffer.length,t=0;t<e;t++)this.buffer.push(0);return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(Ec.prototype,"position",{get:function(){return void 0!==this.internalPosition&&null!==this.internalPosition||(this.internalPosition=0),this.internalPosition},enumerable:!0,configurable:!0}),Ec.prototype.writeShort=function(e){this.flush([(65280&e)>>8,255&e])},Ec.prototype.writeInt=function(e){this.flush([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])},Ec.prototype.writeUInt=function(e){this.flush([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])},Ec.prototype.writeString=function(e){if(null==e)throw new Error("Argument Null Exception : value");for(var t=[],i=0;i<e.length;i++)t.push(e.charCodeAt(i));this.flush(t)},Ec.prototype.writeBytes=function(e){this.flush(e)},Ec.prototype.flush=function(e){if(null===e)throw new Error("Argument Null Exception : buff");for(var t=this.position,i=0;i<e.length;i++)this.buffer[t]=e[i],t++;this.internalPosition+=e.length},Ec);function Ec(e){this.int32Size=4,this.int16Size=2,this.int64Size=8,this.bufferLength=e,this.buffer=[]}Object.defineProperty(Mc.prototype,"macintosh",{get:function(){return null!==this.macintoshDictionary&&void 0!==this.macintoshDictionary||(this.macintoshDictionary=new ml),this.macintoshDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(Mc.prototype,"microsoft",{get:function(){return null!==this.microsoftDictionary&&void 0!==this.microsoftDictionary||(this.microsoftDictionary=new ml),this.microsoftDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(Mc.prototype,"macintoshGlyphs",{get:function(){return null!==this.internalMacintoshGlyphs&&void 0!==this.internalMacintoshGlyphs||(this.internalMacintoshGlyphs=new ml),this.internalMacintoshGlyphs},enumerable:!0,configurable:!0}),Object.defineProperty(Mc.prototype,"microsoftGlyphs",{get:function(){return null!==this.internalMicrosoftGlyphs&&void 0!==this.internalMicrosoftGlyphs||(this.internalMicrosoftGlyphs=new ml),this.internalMicrosoftGlyphs},enumerable:!0,configurable:!0}),Mc.prototype.initialize=function(){void 0===this.metrics&&(this.metrics=new pc),this.readFontDictionary();var e=this.readNameTable(),t=this.readHeadTable();this.initializeFontName(e),this.metrics.macStyle=t.macStyle},Mc.prototype.readFontDictionary=function(){this.offset=0;this.checkPreambula();var e=this.readInt16(this.offset);this.readInt16(this.offset),this.readInt16(this.offset),this.readInt16(this.offset);void 0===this.tableDirectory&&(this.tableDirectory=new ml);for(var t=0;t<e;++t){var i=new sc,n=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(n,i)}this.lowestPosition=this.offset,this.isTtcFont||this.fixOffsets()},Mc.prototype.fixOffsets=function(){for(var e=Number.MAX_VALUE,t=this.tableDirectory.keys(),i=0;i<t.length;i++){var n=(r=this.tableDirectory.getValue(t[i])).offset;if(n<e&&(e=n)<=this.lowestPosition)break}var o=e-this.lowestPosition;if(0!=o){for(var r,s=new ml,i=0;i<t.length;i++)(r=this.tableDirectory.getValue(t[i])).offset-=o,s.setValue(t[i],r);this.tableDirectory=s}},Mc.prototype.checkPreambula=function(){var e=this.readInt32(this.offset);if(this.isMacTtf=1953658213===e,65536!==e&&1953658213!==e&&1330926671!==e){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),e=this.readInt32(this.offset)}return e},Mc.prototype.readNameTable=function(){for(var e=this.getTable("name"),t=(this.offset=e.offset,new lc),i=(t.formatSelector=this.readUInt16(this.offset),t.recordsCount=this.readUInt16(this.offset),t.offset=this.readUInt16(this.offset),t.nameRecords=[],this.offset),n=0;n<t.recordsCount;n++){this.offset=i;var o=new hc,r=(o.platformID=this.readUInt16(this.offset),o.encodingID=this.readUInt16(this.offset),o.languageID=this.readUInt16(this.offset),o.nameID=this.readUInt16(this.offset),o.length=this.readUInt16(this.offset),o.offset=this.readUInt16(this.offset),this.offset=e.offset+t.offset+o.offset,0===o.platformID||3===o.platformID);o.name=this.readString(o.length,r),t.nameRecords[n]=o,i+=12}return t},Mc.prototype.readHeadTable=function(){var e=this.getTable("head"),e=(this.offset=e.offset,new dc);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},Mc.prototype.readHorizontalHeaderTable=function(){var e=this.getTable("hhea"),e=(this.offset=e.offset,new uc);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},Mc.prototype.readOS2Table=function(){var e=this.getTable("OS/2"),e=(this.offset=e.offset,new gc);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),1<e.version?(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},Mc.prototype.readPostTable=function(){var e=this.getTable("post"),e=(this.offset=e.offset,new mc);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},Mc.prototype.readWidthTable=function(e,t){for(var i=this.getTable("hmtx"),n=(this.offset=i.offset,[]),o=0;o<e;o++){var r=new fc,r=(r.advanceWidth=this.readUInt16(this.offset),r.lsb=this.readInt16(this.offset),1e3*r.advanceWidth/t);n.push(Math.floor(r))}return n},Mc.prototype.readCmapTable=function(){for(var e=this.getTable("cmap"),t=(this.offset=e.offset,new vc),i=(t.version=this.readUInt16(this.offset),t.tablesCount=this.readUInt16(this.offset),this.offset),n=[],o=0;o<t.tablesCount;o++){this.offset=i;var r=new yc;r.platformID=this.readUInt16(this.offset),r.encodingID=this.readUInt16(this.offset),r.offset=this.readUInt32(this.offset),i=this.offset,this.readCmapSubTable(r),n[o]=r}return n},Mc.prototype.readCmapSubTable=function(e){var t=this.getTable("cmap"),t=(this.offset=t.offset+e.offset,this.readUInt16(this.offset)),i=this.getCmapEncoding(e.platformID,e.encodingID);i===fd.Macintosh?yd.Macintosh:yd.Microsoft;if(i!==fd.Unknown)switch(t){case md.Apple:this.readAppleCmapTable(e,i);break;case md.Microsoft:this.readMicrosoftCmapTable(e,i);break;case md.Trimmed:this.readTrimmedCmapTable(e,i)}},Mc.prototype.readAppleCmapTable=function(e,t){var i=this.getTable("cmap"),i=(this.offset=i.offset+e.offset,new Sc);i.format=this.readUInt16(this.offset),i.length=this.readUInt16(this.offset),i.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 bc;o.index=this.readByte(this.offset),o.width=this.getWidth(o.index),o.charCode=n,this.macintosh.setValue(n,o),this.addGlyph(o,t),this.maxMacIndex=Math.max(n,this.maxMacIndex)}},Mc.prototype.readMicrosoftCmapTable=function(e,t){for(var i=this.getTable("cmap"),n=(this.offset=i.offset+e.offset,t===fd.Unicode?this.microsoft:this.macintosh),o=new Ac,r=(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),o.segCountX2/2),i=(o.endCount=this.readUshortArray(r),o.reservedPad=this.readUInt16(this.offset),o.startCount=this.readUshortArray(r),o.idDelta=this.readUshortArray(r),o.idRangeOffset=this.readUshortArray(r),o.length/2-8-4*r),s=(o.glyphID=this.readUshortArray(i),0),a=0;a<r;a++)for(var l=o.startCount[a];l<=o.endCount[a]&&65535!==l;l++){if(0===o.idRangeOffset[a])s=l+o.idDelta[a]&65535;else{if((h=a+o.idRangeOffset[a]/2-r+l-o.startCount[a])>=o.glyphID.length)continue;s=o.glyphID[h]+o.idDelta[a]&65535}var h=new bc,d=(h.index=s,h.width=this.getWidth(h.index),t===fd.Symbol&&61440==(65280&l)?255&l:l);h.charCode=d,n.setValue(d,h),this.addGlyph(h,t)}},Mc.prototype.readTrimmedCmapTable=function(e,t){var i=this.getTable("cmap"),n=(this.offset=i.offset+e.offset,new xc);n.format=this.readUInt16(this.offset),n.length=this.readUInt16(this.offset),n.version=this.readUInt16(this.offset),n.firstCode=this.readUInt16(this.offset),n.entryCount=this.readUInt16(this.offset);for(var o=0;o<n.entryCount;++o){var r=new bc;r.index=this.readUInt16(this.offset),r.width=this.getWidth(r.index),r.charCode=o+n.firstCode,this.macintosh.setValue(o,r),this.addGlyph(r,t),this.maxMacIndex=Math.max(o,this.maxMacIndex)}},Mc.prototype.initializeFontName=function(e){for(var t=0;t<e.recordsCount;t++){var i=e.nameRecords[t];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}},Mc.prototype.getTable=function(e){var t,i=new sc;return i=null!=(t=this.tableDirectory.containsKey(e)?this.tableDirectory.getValue(e):t)?t:i},Mc.prototype.getWidth=function(e){return e=e<this.width.length?e:this.width.length-1,this.width[e]},Mc.prototype.getCmapEncoding=function(e,t){var i=fd.Unknown;return e==yd.Microsoft&&t==vd.Undefined?i=fd.Symbol:e==yd.Microsoft&&t==vd.Unicode?i=fd.Unicode:e==yd.Macintosh&&t==bd.Roman&&(i=fd.Macintosh),i},Mc.prototype.addGlyph=function(e,t){var i=null;switch(t){case fd.Unicode:i=this.microsoftGlyphs;break;case fd.Macintosh:case fd.Symbol:i=this.macintoshGlyphs}i.setValue(e.index,e)},Mc.prototype.initializeMetrics=function(e,t,i,n,o,r){this.initializeFontName(e);for(var s=!1,a=0;a<r.length;a++){var l=r[a];if(this.getCmapEncoding(l.platformID,l.encodingID)===fd.Symbol){s=!0;break}}this.metrics.isSymbol=s,this.metrics.macStyle=t.macStyle,this.metrics.isFixedPitch=0!==o.isFixedPitch,this.metrics.italicAngle=o.italicAngle;var e=1e3/t.unitsPerEm,o=(this.metrics.winAscent=n.sTypoAscender*e,this.metrics.macAscent=i.ascender*e,this.metrics.capHeight=0!==n.sCapHeight?n.sCapHeight:.7*t.unitsPerEm*e,this.metrics.winDescent=n.sTypoDescender*e,this.metrics.macDescent=i.descender*e,this.metrics.leading=(n.sTypoAscender-n.sTypoDescender+n.sTypoLineGap)*e,this.metrics.lineGap=Math.ceil(i.lineGap*e),t.xMin*e),i=Math.ceil(this.metrics.macAscent+this.metrics.lineGap),e=t.xMax*e,h=this.metrics.macDescent;this.metrics.fontBox=new nd(o,i,e,h),this.metrics.stemV=80,this.metrics.widthTable=this.updateWidth(),this.metrics.contains=this.tableDirectory.containsKey("CFF"),this.metrics.subScriptSizeFactor=t.unitsPerEm/n.ySubscriptYSize,this.metrics.superscriptSizeFactor=t.unitsPerEm/n.ySuperscriptYSize},Mc.prototype.updateWidth=function(){var e=[];if(this.metrics.isSymbol)for(var t=0;t<256;t++){var i=this.getGlyph(String.fromCharCode(t));e[t]=i.empty?0:i.width}else for(var n=[],o=String.fromCharCode(32),t=0;t<256;t++){n[0]=t;var r=this.getString(n,0,n.length),r=0<r.length?r[0]:"?";(i=this.getGlyph(r)).empty?(i=this.getGlyph(o),e[t]=i.empty?0:i.width):e[t]=i.width}return e},Mc.prototype.getDefaultGlyph=function(){return this.getGlyph(Td.whiteSpace)},Mc.prototype.getString=function(e,t,i){for(var n="",o=0;o<i;o++)n+=String.fromCharCode(e[o+t]);return n},Mc.prototype.readLocaTable=function(e){var t=this.getTable("loca"),i=(this.offset=t.offset,new Cc),n=null;if(e)for(var o=t.length/2,n=[],r=0;r<o;r++)n[r]=2*this.readUInt16(this.offset);else{o=t.length/4;n=[];for(r=0;r<o;r++)n[r]=this.readUInt32(this.offset)}return i.offsets=n,i},Mc.prototype.updateGlyphChars=function(e,t){e.containsKey(0)||e.setValue(0,0);for(var i=new ml,n=e.keys(),o=0;o<n.length;o++)i.setValue(n[o],e.getValue(n[o]));for(o=0;o<n.length;o++){var r=n[o];this.processCompositeGlyph(e,r,t)}},Mc.prototype.processCompositeGlyph=function(e,t,i){if(t<i.offsets.length-1){var n=i.offsets[t];if(n!==i.offsets[t+1]){i=this.getTable("glyf"),t=(this.offset=i.offset+n,new Ic);if(t.numberOfContours=this.readInt16(this.offset),t.xMin=this.readInt16(this.offset),t.yMin=this.readInt16(this.offset),t.xMax=this.readInt16(this.offset),t.yMax=this.readInt16(this.offset),t.numberOfContours<0)for(var o=0;;){var r=this.readUInt16(this.offset),s=this.readUInt16(this.offset);if(e.containsKey(s)||e.setValue(s,0),0==(r&Cd.MoreComponents))break;o=0!=(r&Cd.Arg1And2AreWords)?4:2,0!=(r&Cd.WeHaveScale)?o+=2:0!=(r&Cd.WeHaveAnXyScale)?o+=4:0!=(r&Cd.WeHaveTwoByTwo)&&(o+=8),this.offset+=o}}}},Mc.prototype.generateGlyphTable=function(e,t,i,n){i=[];for(var o=e.keys(),r=(o.sort(function(e,t){return e-t}),0),s=0;s<o.length;s++){var a=o[s];0<t.offsets.length&&(r+=t.offsets[a+1]-t.offsets[a])}var l=this.align(r);n=[];for(s=0;s<l;s++)n.push(0);for(var h,d,p=0,c=0,u=this.getTable("glyf"),s=0;s<t.offsets.length;s++)i.push(p),c<o.length&&o[c]===s&&(++c,i[s]=p,h=t.offsets[s],0<(d=t.offsets[s+1]-h))&&(this.offset=u.offset+h,n=this.read(n,p,d).buffer,p+=d);return{glyphTableSize:r,newLocaTable:i,newGlyphTable:n}},Mc.prototype.updateLocaTable=function(e,t,i){if(null===e)throw new Error("Argument Null Exception : newLocaTable");for(var n=t?2*e.length:4*e.length,o=this.align(n),r=new Tc(o),s=0;s<e.length;s++){var a=e[s];t?(a/=2,r.writeShort(a)):r.writeInt(a)}return{newLocaUpdated:r.data,newLocaSize:n}},Mc.prototype.align=function(e){return e+3&-4},Mc.prototype.getFontProgram=function(e,t,i,n){if(null===e)throw new Error("Argument Null Exception : newLocaTableOut");if(null===t)throw new Error("Argument Null Exception : newGlyphTable");this.tableNames;var o=this.getFontProgramLength(e,t,0),r=o.fontProgramLength,o=o.numTables,r=new Tc(r),s=(r.writeInt(65536),r.writeShort(o),this.entrySelectors[o]);return r.writeShort(16*(1<<(31&s))),r.writeShort(s),r.writeShort(16*(o-(1<<(31&s)))),this.writeCheckSums(r,o,e,t,i,n),this.writeGlyphs(r,e,t),r.data},Mc.prototype.getFontProgramLength=function(e,t,i){if(null===e)throw new Error("Argument Null Exception : newLocaTableOut");if(null===t)throw new Error("Argument Null Exception : newGlyphTable");i=2;for(var n=this.tableNames,o=0,r=0;r<n.length;r++){var s=n[r];"glyf"===s||"loca"===s||(s=this.getTable(s)).empty||(++i,o+=this.align(s.length))}return{fontProgramLength:o=(o+=e.length)+t.length+(16*i+12),numTables:i}},Mc.prototype.writeCheckSums=function(e,t,i,n,o,r){if(null===e)throw new Error("Argument Null Exception : writer");if(null===i)throw new Error("Argument Null Exception : newLocaTableOut");if(null===n)throw new Error("Argument Null Exception : newGlyphTable");for(var s=this.tableNames,a=16*t+12,l=0,h=0;h<s.length;h++){var d,p=s[h],c=this.getTable(p);c.empty||(e.writeString(p),l="glyf"===p?(d=this.calculateCheckSum(n),e.writeInt(d),o):"loca"===p?(d=this.calculateCheckSum(i),e.writeInt(d),r):(e.writeInt(c.checksum),c.length),e.writeUInt(a),e.writeUInt(l),a+=this.align(l))}},Mc.prototype.calculateCheckSum=function(e){if(null===e)throw new Error("Argument Null Exception : bytes");for(var t=0,i=0,n=0,o=0,r=0,s=0;s<(e.length+1)/4;s++)r+=255&e[t++],o+=255&e[t++],n+=255&e[t++],i+=255&e[t++];var a=i;return(a+=n<<8)+(o<<16)+(r<<24)},Mc.prototype.writeGlyphs=function(e,t,i){if(null===e)throw new Error("Argument Null Exception : writer");if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===i)throw new Error("Argument Null Exception : newGlyphTable");for(var n=this.tableNames,o=0;o<n.length;o++){var r=n[o],s=this.getTable(r);if(!s.empty)if("glyf"===r)e.writeBytes(i);else if("loca"===r)e.writeBytes(t);else{for(var a=this.align(s.length),l=[],h=0;h<a;h++)l.push(0);this.offset=s.offset;r=this.read(l,0,s.length);e.writeBytes(r.buffer)}}},Mc.prototype.setOffset=function(e){this.offset=e},Mc.prototype.createInternals=function(){this.metrics=new pc;var e=this.readNameTable(),t=this.readHeadTable(),i=(this.bIsLocaShort=0===t.indexToLocalFormat,this.readHorizontalHeaderTable()),n=this.readOS2Table(),o=this.readPostTable(),r=(this.width=this.readWidthTable(i.numberOfHMetrics,t.unitsPerEm),this.readCmapTable());this.initializeMetrics(e,t,i,n,o,r)},Mc.prototype.getGlyph=function(e){var t,i;return"number"==typeof e?(t=null,this.metrics.isSymbol||null==this.microsoftGlyphs?this.metrics.isSymbol&&null!=this.macintoshGlyphs&&this.macintoshGlyphs.containsKey(e)&&(t=this.macintoshGlyphs.getValue(e)):this.microsoftGlyphs.containsKey(e)&&(t=this.microsoftGlyphs.getValue(e)),null!=t?t:this.getDefaultGlyph()):(t=null,i=e.charCodeAt(0),this.metrics.isSymbol||null===this.microsoft?(this.metrics.isSymbol&&null!==this.macintosh||this.isMacTTF)&&(0!==this.maxMacIndex?i%=this.maxMacIndex+1:i=61440==(65280&i)?255&i:i,this.macintosh.containsKey(i))&&(t=this.macintosh.getValue(i),this.isFontPresent=!0):this.microsoft.containsKey(i)?(t=this.microsoft.getValue(i),i!==Td.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!0)):i!==Td.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!1),null!==(t=e===Td.whiteSpace&&null===t?new bc:t)?t:this.getDefaultGlyph())},Mc.prototype.getGlyphChars=function(e){if(null==e)throw new Error("Argument Null Exception : chars");for(var t=new ml,i=e.keys(),n=0;n<i.length;n++){var o=i[n],r=this.getGlyph(o);r.empty||t.setValue(r.index,o.charCodeAt(0))}return t},Mc.prototype.getAllGlyphs=function(){for(var e=[],t=new bc,i=0,n=0;n<this.width.length;n++){var o=this.width[n];t.index=i,t.width=o,e.push(t),i++}return e},Mc.prototype.readFontProgram=function(e){var t=this.getGlyphChars(e),i=this.readLocaTable(this.bIsLocaShort),e=(t.size()<e.size()&&(this.missedGlyphs=e.size()-t.size()),this.updateGlyphChars(t,i),this.generateGlyphTable(t,i,null,null)),t=e.glyphTableSize,i=e.newLocaTable,e=e.newGlyphTable,i=this.updateLocaTable(i,this.bIsLocaShort,null),n=i.newLocaSize,i=i.newLocaUpdated;return this.getFontProgram(i,e,t,n)},Mc.prototype.convertString=function(e){if(null===e)throw new Error("Argument Null Exception : text");for(var t="",i=0;i<e.length;i++){var n=e[i],n=this.getGlyph(n);n.empty||(t+=String.fromCharCode(n.index))}return t},Mc.prototype.getCharWidth=function(e){e=this.getGlyph(e);return(e=e.empty?this.getDefaultGlyph():e).empty?0:e.width},Mc.prototype.readString=function(e,t){if(void 0===t)return this.readString(e,!1);var i="";if(t)for(var n=0;n<e;n++)n%2!=0&&(i+=String.fromCharCode(this.fontData[this.offset])),this.offset+=1;else for(n=0;n<e;n++)i+=String.fromCharCode(this.fontData[this.offset]),this.offset+=1;return i},Mc.prototype.readFixed=function(e){return this.readInt16(e)+this.readInt16(e+2)/16384},Mc.prototype.readInt32=function(e){var t=this.fontData[e+3],i=this.fontData[e+2],n=this.fontData[e+1],e=this.fontData[e];return this.offset+=4,t+(i<<8)+(n<<16)+(e<<24)},Mc.prototype.readUInt32=function(e){var t=this.fontData[e+3],i=this.fontData[e+2],n=this.fontData[e+1],e=this.fontData[e];return this.offset+=4,t|i<<8|n<<16|e<<24},Mc.prototype.readInt16=function(e){e=32768&(e=(this.fontData[e]<<8)+this.fontData[e+1])?e-65536:e;return this.offset+=2,e},Mc.prototype.readInt64=function(e){var t=this.readInt32(e+4),e=4294967296*this.readInt32(e)+t;return t<0&&(e+=4294967296),e},Mc.prototype.readUInt16=function(e){e=this.fontData[e]<<8|this.fontData[e+1];return this.offset+=2,e},Mc.prototype.readUshortArray=function(e){for(var t=[],i=0;i<e;i++)t[i]=this.readUInt16(this.offset);return t},Mc.prototype.readBytes=function(e){for(var t=[],i=0;i<e;i++)t.push(this.fontData[this.offset]),this.offset+=1;return t},Mc.prototype.readByte=function(e){e=this.fontData[e];return this.offset+=1,e},Mc.prototype.read=function(e,t,i){if(null===e)throw new Error("Argument Null Exception : buffer");var n,o=0;do{for(var r=0;r<i-o&&this.offset+r<this.fontData.length;r++)e[t+r]=this.fontData[this.offset+r]}while(this.offset+=n=i-o,(o+=n)<i);return{buffer:e,written:o}};var Dc=Mc;function Mc(e){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=e,this.initialize()}kc=function(e,t){return(kc=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])}))(e,t)};var kc,Pc=function(e,t){function i(){this.constructor=e}kc(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Bc=(Fc.prototype.getAscent=function(e){return this.ascent*Rd.charSizeMultiplier*this.getSize(e)},Fc.prototype.getDescent=function(e){return this.descent*Rd.charSizeMultiplier*this.getSize(e)},Fc.prototype.getLineGap=function(e){return this.lineGap*Rd.charSizeMultiplier*this.getSize(e)},Fc.prototype.getHeight=function(e){e=this.getDescent(e)<0?this.getAscent(e)-this.getDescent(e)+this.getLineGap(e):this.getAscent(e)+this.getDescent(e)+this.getLineGap(e);return e},Fc.prototype.getSize=function(e){var t=this.size;if(null!=e)switch(e.subSuperScript){case ud.SubScript:t/=this.subScriptSizeFactor;break;case ud.SuperScript:t/=this.superscriptSizeFactor}return t},Fc.prototype.clone=function(){return this.widthTable=Lc.clone(),this},Object.defineProperty(Fc.prototype,"widthTable",{get:function(){return this.internalWidthTable},set:function(e){this.internalWidthTable=e},enumerable:!0,configurable:!0}),Fc);function Fc(){this.lineGap=0}Rc.clone=function(){return null};var Lc=Rc;function Rc(){}Pc(Vc,Oc=Lc),Vc.prototype.items=function(e){if(e<0||e>=this.widths.length)throw new Error("ArgumentOutOfRangeException:index, The character is not supported by the font.");return this.widths[e]},Object.defineProperty(Vc.prototype,"length",{get:function(){return this.widths.length},enumerable:!0,configurable:!0}),Vc.prototype.clone=function(){return this.widths=this.widths,this},Vc.prototype.toArray=function(){return new Bl(this.widths)};var Oc,Nc=Vc;function Vc(e){var t=Oc.call(this)||this;if(null==e)throw new Error("ArgumentNullException:widths");return t.widths=e,t}Hc.prototype.getCharWidth=function(e){return this.ttfReader.getCharWidth(e)},Hc.prototype.getLineWidth=function(e){for(var t=0,i=0,n=e.length;i<n;i++){var o=e[i];t+=this.getCharWidth(o)}return t},Hc.prototype.Initialize=function(){var e=new Yp(this.fontString.length);e.writeFromBase64String(this.fontString),this.fontData=e.internalBuffer,this.ttfReader=new Dc(this.fontData),this.ttfMetrics=this.ttfReader.metrics},Hc.prototype.createInternals=function(){this.fontDictionary=new Sl,this.fontProgram=new xh,this.cmap=new xh,this.descendantFont=new Sl,this.metrics=new Bc,this.ttfReader.createInternals(),this.ttfMetrics=this.ttfReader.metrics,this.initializeMetrics(),this.subsetName=this.getFontName(),this.createDescendantFont(),this.createCmap(),this.createFontDictionary(),this.createFontProgram()},Hc.prototype.getInternals=function(){return this.fontDictionary},Hc.prototype.initializeMetrics=function(){var e=this.ttfReader.metrics;this.metrics.ascent=e.macAscent,this.metrics.descent=e.macDescent,this.metrics.height=e.macAscent-e.macDescent+e.lineGap,this.metrics.name=e.fontFamily,this.metrics.postScriptName=e.postScriptName,this.metrics.size=this.fontSize,this.metrics.widthTable=new Nc(e.widthTable),this.metrics.lineGap=e.lineGap,this.metrics.subScriptSizeFactor=e.subScriptSizeFactor,this.metrics.superscriptSizeFactor=e.superscriptSizeFactor,this.metrics.isBold=e.isBold},Hc.prototype.getFontName=function(){for(var e,t="",i=0;i<6;i++){var n=Math.floor(26*Math.random())+0;t+=this.nameString[n]}return e=(t=t+"+"+this.ttfReader.metrics.postScriptName).toString(),this.formatName(e)},Hc.prototype.formatName=function(e){e=e.replace("(","#28");return(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(")","#29")).replace("[","#5B")).replace("]","#5D")).replace("<","#3C")).replace(">","#3E")).replace("{","#7B")).replace("}","#7D")).replace("/","#2F")).replace("%","#25")).replace(" ","#20")},Hc.prototype.createDescendantFont=function(){this.descendantFont.isResource=!0,this.descendantFont.descendantFontBeginSave=new Il(this),this.descendantFont.items.setValue(this.dictionaryProperties.type,new yl(this.dictionaryProperties.font)),this.descendantFont.items.setValue(this.dictionaryProperties.subtype,new yl(this.dictionaryProperties.cIDFontType2)),this.descendantFont.items.setValue(this.dictionaryProperties.baseFont,new yl(this.subsetName)),this.descendantFont.items.setValue(this.dictionaryProperties.cIDToGIDMap,new yl(this.dictionaryProperties.identity)),this.descendantFont.items.setValue(this.dictionaryProperties.dw,new kl(1e3)),this.fontDescriptor=this.createFontDescriptor(),this.descendantFont.items.setValue(this.dictionaryProperties.fontDescriptor,new Fh(this.fontDescriptor));var e=this.createSystemInfo();this.descendantFont.items.setValue(this.dictionaryProperties.cIDSystemInfo,e)},Hc.prototype.createFontDescriptor=function(){var e=new Sl,t=this.ttfReader.metrics;return e.isResource=!0,e.items.setValue(this.dictionaryProperties.type,new yl(this.dictionaryProperties.fontDescriptor)),e.items.setValue(this.dictionaryProperties.fontName,new yl(this.subsetName)),e.items.setValue(this.dictionaryProperties.flags,new kl(this.getDescriptorFlags())),e.items.setValue(this.dictionaryProperties.fontBBox,Bl.fromRectangle(this.getBoundBox())),e.items.setValue(this.dictionaryProperties.missingWidth,new kl(t.widthTable[32])),e.items.setValue(this.dictionaryProperties.stemV,new kl(t.stemV)),e.items.setValue(this.dictionaryProperties.italicAngle,new kl(t.italicAngle)),e.items.setValue(this.dictionaryProperties.capHeight,new kl(t.capHeight)),e.items.setValue(this.dictionaryProperties.ascent,new kl(t.winAscent)),e.items.setValue(this.dictionaryProperties.descent,new kl(t.winDescent)),e.items.setValue(this.dictionaryProperties.leading,new kl(t.leading)),e.items.setValue(this.dictionaryProperties.avgWidth,new kl(t.widthTable[32])),e.items.setValue(this.dictionaryProperties.fontFile2,new Fh(this.fontProgram)),e.items.setValue(this.dictionaryProperties.maxWidth,new kl(t.widthTable[32])),e.items.setValue(this.dictionaryProperties.xHeight,new kl(0)),e.items.setValue(this.dictionaryProperties.stemH,new kl(0)),e},Hc.prototype.createCmap=function(){this.cmap.cmapBeginSave=new Eh(this)},Hc.prototype.createFontDictionary=function(){this.fontDictionary.isResource=!0,this.fontDictionary.fontDictionaryBeginSave=new Tl(this),this.fontDictionary.items.setValue(this.dictionaryProperties.type,new yl(this.dictionaryProperties.font)),this.fontDictionary.items.setValue(this.dictionaryProperties.baseFont,new yl(this.subsetName)),this.fontDictionary.items.setValue(this.dictionaryProperties.subtype,new yl(this.dictionaryProperties.type0)),this.fontDictionary.items.setValue(this.dictionaryProperties.encoding,new yl(this.dictionaryProperties.identityH));var e=new Bl,t=new Fh(this.descendantFont);e.isFont=!0,e.add(t),this.fontDictionary.items.setValue(this.dictionaryProperties.descendantFonts,e)},Hc.prototype.createFontProgram=function(){this.fontProgram.fontProgramBeginSave=new Dh(this)},Hc.prototype.createSystemInfo=function(){var e=new Sl;return e.items.setValue(this.dictionaryProperties.registry,new Mh("Adobe")),e.items.setValue(this.dictionaryProperties.ordering,new Mh(this.dictionaryProperties.identity)),e.items.setValue(this.dictionaryProperties.supplement,new kl(0)),e},Hc.prototype.descendantFontBeginSave=function(){var e;null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()&&null!==(e=this.getDescendantWidth())&&this.descendantFont.items.setValue(this.dictionaryProperties.w,e)},Hc.prototype.cmapBeginSave=function(){this.generateCmap()},Hc.prototype.fontDictionaryBeginSave=function(){null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()&&!this.fontDictionary.containsKey(this.dictionaryProperties.toUnicode)&&this.fontDictionary.items.setValue(this.dictionaryProperties.toUnicode,new Fh(this.cmap))},Hc.prototype.fontProgramBeginSave=function(){this.isCompress=!0,this.generateFontProgram()},Hc.prototype.getDescendantWidth=function(){var e=new Bl;if(null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()){for(var t=[],i=this.usedChars.keys(),n=0;n<i.length;n++){var o=i[n];(h=this.ttfReader.getGlyph(o)).empty||t.push(h)}t.sort(function(e,t){return e.index-t.index});for(var r=0,s=0,a=!1,l=new Bl,n=0;n<t.length;n++){var h=t[n];a||(a=!0,r=h.index,s=h.index-1),(s+1!==h.index||n+1===t.length)&&1<t.length&&(e.add(new kl(r)),0!==n&&e.add(l),r=h.index,l=new Bl),l.add(new kl(h.width)),n+1===t.length&&(e.add(new kl(r)),e.add(l)),s=h.index}}return e},Hc.prototype.generateCmap=function(){if(null!==this.usedChars&&void 0!==this.usedChars&&0<this.usedChars.size()){var e=this.ttfReader.getGlyphChars(this.usedChars);if(0<e.size()){for(var t=e.keys().sort(),i=t[0],n=t[t.length-1],i=this.toHexString(i,!1)+this.toHexString(n,!1)+bl.newLine,o="",r=(o=(o+=this.cmapPrefix)+i+this.cmapEndCodespaceRange,0),s=0;s<t.length;s++){0===r&&(0!==s&&(o+=this.cmapEndRange),o=(o=o+(r=Math.min(100,t.length-s))+bl.whiteSpace)+this.cmapBeginRange),--r;var a=t[s];o+=this.toHexString(a,!0)+this.toHexString(a,!0)+this.toHexString(e.getValue(a),!0)+"\n"}o+=this.cmapSuffix,this.cmap.clearStream(),this.cmap.isResource=!0,this.cmap.write(o)}}},Hc.prototype.generateFontProgram=function(){var e;this.usedChars=null===this.usedChars||void 0===this.usedChars?new ml:this.usedChars,this.ttfReader.setOffset(0),e=this.ttfReader.readFontProgram(this.usedChars),this.fontProgram.clearStream(),this.fontProgram.isResource=!0,this.fontProgram.writeBytes(e)},Hc.prototype.getDescriptorFlags=function(){var e=0,t=this.ttfReader.metrics;return t.isFixedPitch&&(e|=wd.FixedPitch),t.isSymbol?e|=wd.Symbolic:e|=wd.Nonsymbolic,t.isItalic&&(e|=wd.Italic),t.isBold&&(e|=wd.ForceBold),e},Hc.prototype.getBoundBox=function(){var e=this.ttfReader.metrics.fontBox,t=Math.abs(e.right-e.left),i=Math.abs(e.top-e.bottom);return new id(e.left,e.bottom,t,i)},Hc.prototype.toHexString=function(e,t){e=e.toString(16);return t&&(e=e.toUpperCase()),"<0000".substring(0,5-e.length)+e+">"},Hc.prototype.setSymbols=function(e){if(null===e)throw new Error("Argument Null Exception : text");null!==this.usedChars&&void 0!==this.usedChars||(this.usedChars=new ml);for(var t=0;t<e.length;t++){var i=e[t];this.usedChars.setValue(i,String.fromCharCode(0))}!1===this.isEmbedFont&&this.getDescendantWidth()};var _c=Hc;function Hc(e,t){if(this.nameString="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.dictionaryProperties=new Cl,this.isCompress=!1,this.isEmbedFont=!1,this.cmapPrefix="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap"+bl.newLine+"/CIDSystemInfo << /Registry (Adobe)/Ordering (UCS)/Supplement 0>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange"+bl.newLine,this.cmapEndCodespaceRange="endcodespacerange"+bl.newLine,this.cmapBeginRange="beginbfrange"+bl.newLine,this.cmapEndRange="endbfrange"+bl.newLine,this.cmapSuffix="endbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend end"+bl.newLine,null==e)throw new Error("ArgumentNullException:base64String");this.fontSize=t,this.fontString=e,this.Initialize()}jc.prototype.getCharacterShape=function(e,t){if(e>=this.hamza&&e<=this.bwhb){if(this.arabicMapTable.getValue(e))return this.arabicMapTable.getValue(e)[t+1]}else if(e>=this.lwawm&&e<=this.lwa);return e},jc.prototype.shape=function(e,t){for(var i="",n="",o=0;o<e.length;o++){var r=e[o];"؀"<=r&&r<="ۿ"?n+=r:(0<n.length&&(i+=this.doShape(n.toString(),0),n=""),i+=r)}return 0<n.length&&(i+=this.doShape(n.toString(),0)),i.toString()},jc.prototype.doShape=function(e,t){for(var i="",n=0,o=0,r=new Wc,s=new Wc;o<e.length;){var a,l=e[o++];0===this.ligature(l,s)&&(n=1===(a=this.getShapeCount(l))?0:2,2<r.Shapes&&(n+=1),n%=s.Shapes,s.Value=this.getCharacterShape(s.Value,n),i=this.append(i,r,t),r=s,(s=new Wc).Value=l,s.Shapes=a,s.Ligature++)}return n=2<r.Shapes?1:0,n%=s.Shapes,s.Value=this.getCharacterShape(s.Value,n),i=this.append(i,r,t),(i=this.append(i,s,t)).toString()},jc.prototype.append=function(e,t,i){return""!==t.Value&&(e+=t.Value,--t.Ligature,""!==t.Type&&(0==(i&this.vowel)&&(e+=t.Type),--t.Ligature),""!==t.vowel)&&(0==(i&this.vowel)&&(e+=t.vowel),--t.Ligature),e},jc.prototype.ligature=function(e,t){if(""===t.Value)return 0;var i=0;if(e>=this.fathatan&&e<=this.hamzaBelow||e===this.superScriptalef){if(i=1,""!==t.vowel&&e!==this.shadda&&(i=2),e===this.shadda){if(null!=t.Type)return 0;t.Type=this.shadda}else e===this.hamzaBelow?t.Value===this.alef?(t.Value=this.alefHamzaBelow,i=2):e===this.lwa?(t.Value=this.lwawhb,i=2):t.Type=this.hamzaBelow:e===this.hamzaAbove?t.Value===this.alef?(t.Value=this.alefHamza,i=2):t.Value===this.lwa?(t.Value=this.lwawh,i=2):t.Value===this.waw?(t.Value=this.wawHamza,i=2):t.Value===this.yeh||t.Value===this.alefMaksura||t.Value===this.farsiYeh?(t.Value=this.yehHamza,i=2):t.Type=this.hamzaAbove:e===this.madda?t.Value===this.alef&&(t.Value=this.alefMadda,i=2):t.vowel=e;1===i&&t.Ligature++}else{if(""!==t.vowel)return 0;t.Value===this.lam&&(e===this.alef?(t.Value=this.lwa,t.Shapes=2,i=3):e===this.alefHamza?(t.Value=this.lwawh,t.Shapes=2,i=3):e===this.alefHamzaBelow?(t.Value=this.lwawhb,t.Shapes=2,i=3):e===this.alefMadda&&(t.Value=this.lwawm,t.Shapes=2,i=3))}return i},jc.prototype.getShapeCount=function(e){if(e>=this.hamza&&e<=this.bwhb&&!(e>=this.fathatan&&e<=this.hamzaBelow||e===this.superScriptalef)){if(this.arabicMapTable.getValue(e))return this.arabicMapTable.getValue(e).length-1}else if(e===this.zeroWidthJoiner)return 4;return 1};var zc=jc;function jc(){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 ml;for(var e=0;e<this.arabicCharTable.length;e++)this.arabicMapTable.setValue(this.arabicCharTable[e][0],this.arabicCharTable[e])}Object.defineProperty(Qc.prototype,"Value",{get:function(){return this.shapeValue},set:function(e){this.shapeValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(Qc.prototype,"Type",{get:function(){return this.shapeType},set:function(e){this.shapeType=e},enumerable:!0,configurable:!0}),Object.defineProperty(Qc.prototype,"vowel",{get:function(){return this.shapeVowel},set:function(e){this.shapeVowel=e},enumerable:!0,configurable:!0}),Object.defineProperty(Qc.prototype,"Ligature",{get:function(){return this.shapeLigature},set:function(e){this.shapeLigature=e},enumerable:!0,configurable:!0}),Object.defineProperty(Qc.prototype,"Shapes",{get:function(){return this.shapeShapes},set:function(e){this.shapeShapes=e},enumerable:!0,configurable:!0});var Wc=Qc;function Qc(){this.shapeValue="",this.shapeType="",this.shapeVowel="",this.shapeLigature=0,this.shapeShapes=1}qc.prototype.doMirrorShaping=function(e){for(var t=[],i=0;i<e.length;i++)1==(1&this.indexLevels[i])&&this.mirroringShapeCharacters.containsKey(e[i].charCodeAt(0))?t[i]=String.fromCharCode(this.mirroringShapeCharacters.getValue(e[i].charCodeAt(0))):t[i]=e[i].toString();for(var n="",o=0;o<t.length;o++)n+=t[o];return n},qc.prototype.getLogicalToVisualString=function(e,t){for(var i=new Gc,n=(this.indexLevels=i.getVisualOrder(e,t),this.setDefaultIndexLevel(),this.doOrder(0,this.indexLevels.length-1),this.doMirrorShaping(e)),o="",r=0;r<this.indexes.length;r++)o+=n[this.indexes[r]];return o.toString()},qc.prototype.setDefaultIndexLevel=function(){for(var e=0;e<this.indexLevels.length;e++)this.indexes[e]=e},qc.prototype.doOrder=function(e,t){for(var i=this.indexLevels[e],n=i,o=i,r=i,s=e+1;s<=t;++s){var a=this.indexLevels[s];i<a?i=a:a<n&&(n=a),o&=a,r|=a}if(0!=(1&r))if(1==(1&o))this.reArrange(e,t+1);else for(n|=1;n<=i;){for(var l=e;;){for(;l<=t&&!(this.indexLevels[l]>=i);)l+=1;if(t<l)break;for(var h=l+1;h<=t&&!(this.indexLevels[h]<i);)h+=1;this.reArrange(l,h),l=h+1}--i}},qc.prototype.reArrange=function(e,t){var i=(e+t)/2;for(--t;e<i;++e,--t){var n=this.indexes[e];this.indexes[e]=this.indexes[t],this.indexes[t]=n}},qc.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)};var Uc=qc;function qc(){this.indexes=[],this.indexLevels=[],this.mirroringShapeCharacters=new ml,this.update()}Yc.prototype.getVisualOrder=function(e,t){this.types=this.getCharacterCode(e),this.textOrder=t?this.LRE:this.L,this.doVisualOrder();for(var i=[],n=0;n<this.levels.length;n++)i[n]=this.levels[n];return i},Yc.prototype.getCharacterCode=function(e){for(var t=[],i=0;i<e.length;i++)t[i]=this.rtlCharacterTypes[e[i].charCodeAt(0)];return t},Yc.prototype.setDefaultLevels=function(){for(var e=0;e<this.length;e++)this.levels[e]=this.textOrder},Yc.prototype.setLevels=function(){this.setDefaultLevels();for(var e=0;e<this.length;++e){var t=this.levels[e];0!=(128&t)&&(t&=127,this.result[e]=0==(1&t)?this.L:this.R),this.levels[e]=t}},Yc.prototype.updateLevels=function(e,t,i){if(0==(1&t))for(var n=e;n<i;++n)this.result[n]===this.R?this.levels[n]+=1:this.result[n]!==this.L&&(this.levels[n]+=2);else for(n=e;n<i;++n)this.result[n]!==this.R&&(this.levels[n]+=1)},Yc.prototype.doVisualOrder=function(){this.length=this.types.length,this.result=this.types,this.levels=[],this.setLevels(),this.length=this.getEmbeddedCharactersLength();for(var e=this.textOrder,t=0;t<this.length;){for(var i=this.levels[t],n=0==(1&Math.max(e,i))?this.L:this.R,o=t+1;o<this.length&&this.levels[o]===i;)++o;var r=o<this.length?this.levels[o]:this.textOrder,r=0==(1&Math.max(r,i))?this.L:this.R;this.checkNSM(t,o,i,n,r),this.updateLevels(t,i,o),e=i,t=o}this.checkEmbeddedCharacters(this.length)},Yc.prototype.getEmbeddedCharactersLength=function(){for(var e=0,t=0;t<this.length;++t)this.types[t]!==this.LRE&&this.types[t]!==this.RLE&&this.types[t]!==this.LRO&&this.types[t]!==this.RLO&&this.types[t]!==this.PDF&&this.types[t]!==this.BN&&(this.result[e]=this.result[t],this.levels[e]=this.levels[t],e++);return e},Yc.prototype.checkEmbeddedCharacters=function(e){for(var t=this.types.length-1;0<=t;--t)this.types[t]===this.LRE||this.types[t]===this.RLE||this.types[t]===this.LRO||this.types[t]===this.RLO||this.types[t]===this.PDF||this.types[t]===this.BN?(this.result[t]=this.types[t],this.levels[t]=-1):(this.result[t]=this.result[--e],this.levels[t]=this.levels[e]);for(t=0;t<this.types.length;t++)-1===this.levels[t]&&(this.levels[t]=0===t?this.textOrder:this.levels[t-1])},Yc.prototype.checkNSM=function(e,t,i,n,o){for(var r=n,s=e;s<t;++s)this.result[s]===this.NSM?this.result[s]=r:r=this.result[s];this.checkEuropeanDigits(e,t,i,n,o)},Yc.prototype.checkEuropeanDigits=function(e,t,i,n,o){for(var r=e;r<t;++r)if(this.result[r]===this.EN)for(var s=r-1;e<=s;--s)if(this.result[s]===this.L||this.result[s]===this.R||this.result[s]===this.AL){this.result[s]===this.AL&&(this.result[r]=this.AN);break}this.checkArabicCharacters(e,t,i,n,o)},Yc.prototype.checkArabicCharacters=function(e,t,i,n,o){for(var r=e;r<t;++r)this.result[r]===this.AL&&(this.result[r]=this.R);this.checkEuropeanNumberSeparator(e,t,i,n,o)},Yc.prototype.checkEuropeanNumberSeparator=function(e,t,i,n,o){for(var r,s,a=e+1;a<t-1;++a)this.result[a]!==this.ES&&this.result[a]!==this.CS||(r=this.result[a-1],s=this.result[a+1],r===this.EN&&s===this.EN?this.result[a]=this.EN:this.result[a]===this.CS&&r===this.AN&&s===this.AN&&(this.result[a]=this.AN));this.checkEuropeanNumberTerminator(e,t,i,n,o)},Yc.prototype.checkEuropeanNumberTerminator=function(e,t,i,n,o){for(var r=e;r<t;++r)if(this.result[r]===this.ET){var s=r,a=[],l=(a.push(this.ET),this.getLength(s,t,a)),a=s===e?n:this.result[s-1];if((a=a!==this.EN?l===t?o:this.result[l]:a)===this.EN)for(var h=s;h<l;++h)this.result[h]=this.EN;r=l}this.checkOtherNeutrals(e,t,i,n,o)},Yc.prototype.checkOtherNeutrals=function(e,t,i,n,o){for(var r=e;r<t;++r)this.result[r]!==this.ES&&this.result[r]!==this.ET&&this.result[r]!==this.CS||(this.result[r]=this.ON);this.checkOtherCharacters(e,t,i,n,o)},Yc.prototype.checkOtherCharacters=function(e,t,i,n,o){for(var r=e;r<t;++r)if(this.result[r]===this.EN){for(var s=n,a=r-1;e<=a;--a)if(this.result[a]===this.L||this.result[a]===this.R){s=this.result[a];break}s===this.L&&(this.result[r]=this.L)}this.checkCommanCharacters(e,t,i,n,o)},Yc.prototype.getLength=function(e,t,i){for(--e;++e<t;){for(var n=this.result[e],o=0;o<i.length;++o)n===i[o]&&(e=this.getLength(++e,t,i));return e}return t},Yc.prototype.checkCommanCharacters=function(e,t,i,n,o){for(var r=e;r<t;++r)if(this.result[r]===this.WS||this.result[r]===this.ON||this.result[r]===this.B||this.result[r]===this.S){var s=r,a=[this.B,this.S,this.WS,this.ON],l=this.getLength(s,t,a),a=0,h=0,d=0;s===e?a=n:(a=this.result[s-1])!==this.AN&&a!==this.EN||(a=this.R),l===t?h=o:(h=this.result[l])!==this.AN&&h!==this.EN||(h=this.R);for(var d=a===h?a:0==(1&i)?this.L:this.R,p=s;p<l;++p)this.result[p]=d;r=l}};var Gc=Yc;function Yc(){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 e=0;e<this.charTypes.length;++e)for(var t=this.charTypes[e],i=this.charTypes[++e],n=this.charTypes[++e];t<=i;)this.rtlCharacterTypes[t++]=n}$c.prototype.layout=function(e,t,i,n,o){if(null==e)throw new Error("ArgumentNullException : line");if(null==t)throw new Error("ArgumentNullException : font");var r=[];return t.Unicode?r=this.customLayout(e,i,o,t,n):(r=[])[0]=e,r},$c.prototype.splitLayout=function(e,t,i,n,o){if(null==e)throw new Error("ArgumentNullException : line");if(null==t)throw new Error("ArgumentNullException : font");return this.customSplitLayout(e,t,i,n,o)},$c.prototype.getGlyphIndex=function(e,t,i,n,o){if(null==e)throw new Error("ArgumentNullException : line");if(null==t)throw new Error("ArgumentNullException : font");if(n=null,0===e.length)return{success:!1,glyphs:null};for(var r=(new zc).shape(e,0),s=t.fontInternal.ttfReader,a=(n=new Uint16Array(r.length),0),l=0,h=r.length;l<h;l++){var d=r[l],d=s.getGlyph(d);null!=d&&(n[a++]=d.index)}return{success:!0,glyphs:n}},$c.prototype.customLayout=function(e,t,i,n,o){if(null==o){if(null==e)throw new Error("ArgumentNullException : line");var r=null;return r=null!=i&&i.textDirection!==Kh.None?(new Uc).getLogicalToVisualString(e,t):r}if(null==e)throw new Error("ArgumentNullException : line");if(null==n)throw new Error("ArgumentNullException : font");var s=null,r=(null!=i&&i.textDirection!==Kh.None&&(e=(new zc).shape(e,0),s=this.customLayout(e,t,i)),[]);if(o){for(var a=s.split(""),l=a.length,h=0;h<l;h++)a[h]=this.addChars(n,a[h]);r=a}else(r=[])[0]=this.addChars(n,s);return r},$c.prototype.addChars=function(e,t){if(null==e)throw new Error("ArgumentNullException : font");if(null==t)throw new Error("ArgumentNullException : line");var i=e.fontInternal.ttfReader,e=(e.setSymbols(t),t=i.convertString(t),Mh.toUnicodeArray(t,!1));return Mh.byteToString(e)},$c.prototype.customSplitLayout=function(e,t,i,n,o){if(null==e)throw new Error("ArgumentNullException : line");if(null==t)throw new Error("ArgumentNullException : font");return this.customLayout(e,i,o).split("")};var Xc,Kc,Jc,Zc=$c;function $c(){this.openBracket="(",this.closeBracket=")"}(Pc=Xc=Xc||{})[Pc.Paginate=0]="Paginate",Pc[Pc.OnePage=1]="OnePage",(Pc=Kc=Kc||{})[Pc.FitPage=0]="FitPage",Pc[Pc.FitElement=1]="FitElement",Pc[Pc.FitColumnsToPage=2]="FitColumnsToPage",(Pc=Jc=Jc||{})[Pc.Start=0]="Start",Pc[Pc.Line=1]="Line",Pc[Pc.Bezier3=3]="Bezier3",Pc[Pc.Bezier=3]="Bezier",Pc[Pc.PathTypeMask=7]="PathTypeMask",Pc[Pc.DashMode=16]="DashMode",Pc[Pc.PathMarker=32]="PathMarker",Pc[Pc.CloseSubpath=128]="CloseSubpath",eu=function(e,t){return(eu=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}eu(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(nu,tu=rd),Object.defineProperty(nu.prototype,"background",{get:function(){return this.mbackground},set:function(e){this.mbackground=e;var t=this.shading;e.isEmpty?t.remove(this.dictionaryProperties.background):t.items.setValue(this.dictionaryProperties.background,e.toArray(this.colorSpace))},enumerable:!0,configurable:!0}),Object.defineProperty(nu.prototype,"antiAlias",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.antiAlias).value},set:function(e){var t=this.shading,i=t.items.getValue(this.dictionaryProperties.antiAlias);null==i&&void 0===i?(i=new Jd(e),t.items.setValue(this.dictionaryProperties.antiAlias,i)):i.value=e},enumerable:!0,configurable:!0}),Object.defineProperty(nu.prototype,"function",{get:function(){return this.mfunction},set:function(e){null!=(this.mfunction=e)&&void 0!==e?this.shading.items.setValue(this.dictionaryProperties.function,new Fh(this.mfunction)):this.shading.remove(this.dictionaryProperties.function)},enumerable:!0,configurable:!0}),Object.defineProperty(nu.prototype,"bBox",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.bBox)},set:function(e){var t=this.shading;null==e&&void 0===e?t.remove(this.dictionaryProperties.bBox):t.items.setValue(this.dictionaryProperties.bBox,e)},enumerable:!0,configurable:!0}),Object.defineProperty(nu.prototype,"colorSpace",{get:function(){return this.mcolorSpace},set:function(e){var t=this.shading.items.getValue(this.dictionaryProperties.colorSpace);e===this.mcolorSpace&&null!=t||(this.mcolorSpace=e,t=this.colorSpaceToDeviceName(e),this.shading.items.setValue(this.dictionaryProperties.colorSpace,new yl(t)))},enumerable:!0,configurable:!0}),Object.defineProperty(nu.prototype,"stroking",{get:function(){return this.mbStroking},set:function(e){this.mbStroking=e},enumerable:!0,configurable:!0}),Object.defineProperty(nu.prototype,"patternDictionary",{get:function(){return null==this.mpatternDictionary&&(this.mpatternDictionary=new Sl),this.mpatternDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(nu.prototype,"shading",{get:function(){return this.mshading},set:function(e){if(null==e)throw new Error("ArgumentNullException : Shading");e!==this.mshading&&(this.mshading=e,this.patternDictionary.items.setValue(this.dictionaryProperties.shading,new Fh(this.mshading)))},enumerable:!0,configurable:!0}),Object.defineProperty(nu.prototype,"matrix",{get:function(){return this.mmatrix},set:function(e){if(null==e)throw new Error("ArgumentNullException : Matrix");e!==this.mmatrix&&(this.mmatrix=e.clone(),e=new Bl(this.mmatrix.matrix.elements),this.mpatternDictionary.items.setValue(this.dictionaryProperties.matrix,e))},enumerable:!0,configurable:!0}),nu.prototype.monitorChanges=function(e,t,i,n,o){var r=!1;return e instanceof nu&&(this.colorSpace!==o&&(this.colorSpace=o,this.resetFunction()),t.setColorSpace("Pattern",this.mbStroking),e=i.getResources().getName(this),t.setColourWithPattern(null,e,this.mbStroking),r=!0),r},nu.prototype.resetChanges=function(e){},nu.prototype.colorSpaceToDeviceName=function(e){var t;return t=e===qh.Rgb?"DeviceRGB":t},nu.prototype.resetPatternDictionary=function(e){this.mpatternDictionary=e},nu.prototype.cloneAntiAliasingValue=function(e){if(null==e)throw new Error("ArgumentNullException : brush");var t=this.shading.items.getValue(this.dictionaryProperties.antiAlias);null!=t&&e.shading.items.setValue(this.dictionaryProperties.antiAlias,new Jd(t.value))},nu.prototype.cloneBackgroundValue=function(e){var t=this.background;t.isEmpty||(e.background=t)},Object.defineProperty(nu.prototype,"element",{get:function(){return this.patternDictionary},enumerable:!0,configurable:!0});var eu,tu,iu=nu;function nu(e){var t=tu.call(this)||this;return t.mbackground=new se(255,255,255),t.mbStroking=!1,t.mfunction=null,t.dictionaryProperties=new Cl,t.mpatternDictionary=new Sl,t.mpatternDictionary.items.setValue(t.dictionaryProperties.type,new yl(t.dictionaryProperties.pattern)),t.mpatternDictionary.items.setValue(t.dictionaryProperties.patternType,new kl(2)),t.shading=e,t.colorSpace=qh.Rgb,t}Object.defineProperty(ru.prototype,"size",{get:function(){return this.templateSize},enumerable:!0,configurable:!0}),Object.defineProperty(ru.prototype,"width",{get:function(){return this.size.width},enumerable:!0,configurable:!0}),Object.defineProperty(ru.prototype,"height",{get:function(){return this.size.height},enumerable:!0,configurable:!0}),Object.defineProperty(ru.prototype,"graphics",{get:function(){var e;return null!=this.pdfGraphics&&void 0!==this.pdfGraphics||(e=new vu(this),e=new fu(this.size,e,this.content),this.pdfGraphics=e,this.pdfGraphics.initializeCoordinates()),this.pdfGraphics},enumerable:!0,configurable:!0}),ru.prototype.getResources=function(){return null==this.resources&&(this.resources=new lu,this.content.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},ru.prototype.initialize=function(){this.addType(),this.addSubType()},ru.prototype.addType=function(){var e=new yl(this.dictionaryProperties.xObject);this.content.items.setValue(this.dictionaryProperties.type,e)},ru.prototype.addSubType=function(){var e=new yl(this.dictionaryProperties.form);this.content.items.setValue(this.dictionaryProperties.subtype,e)},ru.prototype.reset=function(e){void 0===e?(null!=this.resources&&(this.resources=null,this.content.remove(this.dictionaryProperties.resources)),null!=this.graphics&&this.graphics.reset(this.size)):(this.setSize(e),this.reset())},ru.prototype.setSize=function(e){var t=new id(new ed(0,0),e),t=Bl.fromRectangle(t);this.content.items.setValue(this.dictionaryProperties.bBox,t),this.templateSize=e},Object.defineProperty(ru.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0});var ou=ru;function ru(e,t){var i;this.dictionaryProperties=new Cl,this.writeTransformation=!0,void 0!==e&&(e instanceof td&&void 0===t?(this.content=new xh,i=new td(e.width,e.height),this.setSize(i)):(this.content=new xh,this.setSize(new td(e,t))),this.initialize())}su=function(e,t){return(su=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}su(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(hu,au=Sl),Object.defineProperty(hu.prototype,"names",{get:function(){return this.getNames()},enumerable:!0,configurable:!0}),Object.defineProperty(hu.prototype,"document",{get:function(){return this.pdfDocument},set:function(e){this.pdfDocument=e},enumerable:!0,configurable:!0}),hu.prototype.getName=function(e){var t,i=e.element,n=null;return null==(n=this.names.containsKey(i)?this.names.getValue(i):n)&&(t=this.generateName(),n=new yl(t),this.names.setValue(i,n),e instanceof Rd||e instanceof ou||e instanceof iu||e instanceof gu||e instanceof Op||e instanceof ec||e instanceof oc)&&this.add(e,n),n},hu.prototype.getNames=function(){null==this.pdfNames&&(this.pdfNames=new Lp);var e=this.items.getValue(this.dictionaryProperties.font);return null!=e&&hp.dereference(e),this.pdfNames},hu.prototype.requireProcedureSet=function(e){if(null==e)throw new Error("ArgumentNullException:procedureSetName");var t=this.items.getValue(this.dictionaryProperties.procset),e=(null==t&&(t=new Bl,this.items.setValue(this.dictionaryProperties.procset,t)),new yl(e));t.contains(e)||t.add(e)},hu.prototype.removeFont=function(e){for(var t=null,i=this.pdfNames.keys(),n=0;n<this.pdfNames.size();n++)if(this.pdfNames.getValue(i[n])===new yl(e)){t=i[n];break}null!=t&&this.pdfNames.remove(t)},hu.prototype.generateName=function(){return du.getNewGuidString()},hu.prototype.add=function(e,t){if(e instanceof Rd){var i=null,n=this.items.getValue(this.dictionaryProperties.font);null!=n?i=i=s=n:(i=new Sl,this.items.setValue(this.dictionaryProperties.font,i)),i.items.setValue(t.value,new Fh(e.element))}else if(e instanceof ou){var o=void 0;null==(o=this.items.getValue(this.dictionaryProperties.xObject))&&(o=new Sl,this.items.setValue(this.dictionaryProperties.xObject,o)),o.items.setValue(t.value,new Fh(e.element))}else if(e instanceof rd)(e instanceof iu||e instanceof gu)&&null!=(r=e.element)&&(null==(n=this.items.getValue(this.dictionaryProperties.pattern))&&(n=new Sl,this.items.setValue(this.dictionaryProperties.pattern,n)),n.items.setValue(t.value,new Fh(r)));else if(e instanceof Op){var r=e.element,i=null;null==(i=this.items.getValue(this.dictionaryProperties.extGState))&&(i=new Sl,this.items.setValue(this.dictionaryProperties.extGState,i)),i.items.setValue(t.value,new Fh(r))}else{var s,o=this.Dictionary.items.getValue(this.dictionaryProperties.xObject),n=void 0,a=(void 0!==this.pdfDocument&&(n=this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.getValue(this.dictionaryProperties.xObject)),this.Dictionary.items.values(),!1),l=void 0;if(void 0!==this.pdfDocument&&null==n)n=new Sl,this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.setValue(this.dictionaryProperties.xObject,n);else if(void 0!==this.pdfDocument)for(var h=n.items.values(),d=0;d<h.length;d++)void 0!==h[d]&&void 0!==h[d].element&&h[d].element.data[0]===e.element.data[0]&&(l=h[d],a=!0);null==o&&(o=new Sl,this.Dictionary.items.setValue(this.dictionaryProperties.xObject,o)),a&&void 0!==l?o.items.setValue(t.value,l):(s=new Fh(e.element),o.items.setValue(t.value,s),void 0!==this.pdfDocument&&n.items.setValue(t.value,s))}};var su,au,lu=hu;function hu(e){e=au.call(this,e)||this;return e.properties=new Sl,e}pu.getNewGuidString=function(){return"aaaaaaaa-aaaa-4aaa-baaa-aaaaaaaaaaaa".replace(/[ab]/g,function(e){var t=16*Math.random()|0;return("a"===e?t:3&t|8).toString(16)})};var du=pu;function pu(){}cu=function(e,t){return(cu=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}cu(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(mu,uu=rd),mu.prototype.initialize=function(e,t,i,n){this.mPage=t,this.mLocation=i,this.mTransformationMatrix=n,this.tempBrushStream=this.brushStream,this.brushStream=new xh;t=new lu;return this.brushStream.items.setValue(this.mDictionaryProperties.resources,t),this.setBox(e),this.setObligatoryFields(),this},Object.defineProperty(mu.prototype,"location",{get:function(){return this.mLocation},set:function(e){this.mLocation=e},enumerable:!0,configurable:!0}),mu.prototype.setObligatoryFields=function(){var e,t;this.brushStream.items.setValue(this.mDictionaryProperties.patternType,new kl(1)),this.brushStream.items.setValue(this.mDictionaryProperties.paintType,new kl(1)),this.brushStream.items.setValue(this.mDictionaryProperties.tilingType,new kl(1)),this.brushStream.items.setValue(this.mDictionaryProperties.xStep,new kl(this.mBox.right-this.mBox.left)),this.brushStream.items.setValue(this.mDictionaryProperties.yStep,new kl(this.mBox.bottom-this.mBox.top)),null!=this.mPage&&null!=this.mLocation&&(null==this.mTransformationMatrix&&void 0===this.mTransformationMatrix?(e=this.mPage.size.height%this.rectangle.size.height-this.mLocation.y,this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new Bl([1,0,0,1,this.mLocation.x,e]))):(e=0,t=this.mTransformationMatrix.matrix.elements,e=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 Bl([t[0],t[1],t[2],t[3],t[4],e]))))},mu.prototype.setBox=function(e){this.mBox=e;e=new id(this.mBox.left,this.mBox.top,this.mBox.right,this.mBox.bottom);this.brushStream.items.setValue(this.mDictionaryProperties.bBox,Bl.fromRectangle(e))},Object.defineProperty(mu.prototype,"rectangle",{get:function(){return this.mBox},enumerable:!0,configurable:!0}),Object.defineProperty(mu.prototype,"size",{get:function(){return this.mBox.size},enumerable:!0,configurable:!0}),Object.defineProperty(mu.prototype,"graphics",{get:function(){var e;return null==this.mGraphics&&void 0===this.mGraphics&&(e=new vu(this),e=new fu(this.size,e,this.brushStream),this.mGraphics=e,this.mResources=this.getResources(),this.mGraphics.initializeCoordinates()),this.mGraphics},enumerable:!0,configurable:!0}),mu.prototype.getResources=function(){return this.mResources},Object.defineProperty(mu.prototype,"stroking",{get:function(){return this.mStroking},set:function(e){this.mStroking=e},enumerable:!0,configurable:!0}),mu.prototype.clone=function(){var e=this.initialize(this.rectangle,this.mPage,this.location,this.mTransformationMatrix);return null!=this.mTransformationMatrix&&null!=this.mTransformationMatrix.matrix&&e.brushStream.items.setValue(this.mDictionaryProperties.matrix,new Bl(this.mTransformationMatrix.matrix.elements)),e.brushStream.data=this.tempBrushStream.data,e.mResources=new lu(this.mResources),e.brushStream.items.setValue(this.mDictionaryProperties.resources,e.mResources),e},mu.prototype.monitorChanges=function(e,t,i,n,o){var r,s=!1;return e!==this?(t.setColorSpace("Pattern",this.mStroking),r=i.getResources().getName(this),t.setColourWithPattern(null,r,this.mStroking),s=!0):e instanceof mu&&(t.setColorSpace("Pattern",this.mStroking),r=i.getResources().getName(this),t.setColourWithPattern(null,r,this.mStroking),s=!0),s},mu.prototype.resetChanges=function(e){},Object.defineProperty(mu.prototype,"element",{get:function(){return this.brushStream},enumerable:!0,configurable:!0});var cu,uu,gu=mu;function mu(e,t){var i=uu.call(this)||this,n=(i.mStroking=!1,i.mLocation=new ed(0,0),i.mDictionaryProperties=new Cl,null);return e instanceof nd?n=e:e instanceof td&&(n=new nd(0,0,e.width,e.height)),null!==t&&t instanceof Ou&&(i.mPage=t),i.brushStream=new xh,i.mResources=new lu,i.brushStream.items.setValue(i.mDictionaryProperties.resources,i.mResources),i.setBox(n),i.setObligatoryFields(),null!==t&&t instanceof Ou&&(i.mPage=t,i.graphics.colorSpace=t.document.colorSpace),i}Object.defineProperty(yu.prototype,"stringLayoutResult",{get:function(){return this.pdfStringLayoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(yu.prototype,"size",{get:function(){return this.canvasSize},enumerable:!0,configurable:!0}),Object.defineProperty(yu.prototype,"mediaBoxUpperRightBound",{get:function(){return void 0===this.internalMediaBoxUpperRightBound&&(this.internalMediaBoxUpperRightBound=0),this.internalMediaBoxUpperRightBound},set:function(e){this.internalMediaBoxUpperRightBound=e},enumerable:!0,configurable:!0}),Object.defineProperty(yu.prototype,"clientSize",{get:function(){return new td(this.clipBounds.width,this.clipBounds.height)},enumerable:!0,configurable:!0}),Object.defineProperty(yu.prototype,"colorSpace",{get:function(){return this.currentColorSpace},set:function(e){this.currentColorSpace=e},enumerable:!0,configurable:!0}),Object.defineProperty(yu.prototype,"streamWriter",{get:function(){return this.pdfStreamWriter},enumerable:!0,configurable:!0}),Object.defineProperty(yu.prototype,"matrix",{get:function(){return null==this.transformationMatrix&&(this.transformationMatrix=new Mp),this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(yu.prototype,"layer",{get:function(){return this.pageLayer},enumerable:!0,configurable:!0}),Object.defineProperty(yu.prototype,"page",{get:function(){return this.pageLayer.page},enumerable:!0,configurable:!0}),Object.defineProperty(yu.prototype,"automaticFields",{get:function(){return null!=this.internalAutomaticFields&&void 0!==this.internalAutomaticFields||(this.internalAutomaticFields=new Vp),this.internalAutomaticFields},enumerable:!0,configurable:!0}),yu.prototype.initialize=function(){this.bStateSaved=!1,this.currentPen=null,this.currentBrush=null,this.currentFont=null,this.currentColorSpace=qh.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 id(new ed(0,0),this.size),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf)},yu.prototype.drawPdfTemplate=function(e,t,i){if(void 0===i){if(null==e)throw Error("ArgumentNullException-template");this.drawPdfTemplate(e,t,e.size)}else{if(null==e)throw Error("ArgumentNullException-template");var n=0<e.width?i.width/e.width:1,o=0<e.height?i.height/e.height:1,r=!(1==n&&1==o),s=this.save(),a=new Mp;null!=this.pageLayer&&this.getTranslateTransform(t.x,t.y+i.height,a),r&&this.getScaleTransform(n,o,a),this.pdfStreamWriter.modifyCtm(a);var r=this.getResources.getResources().getName(e),l=(this.pdfStreamWriter.executeObject(r),this.restore(s),e.graphics);if(null!=l)for(var h=0;h<l.automaticFields.automaticFields.length;h++){var d=l.automaticFields.automaticFields[h],p=new ed(d.location.x+t.x,d.location.y+t.y),c=0==e.size.width?0:i.width/e.size.width,u=0==e.size.height?0:i.height/e.size.height;this.automaticFields.add(new Up(d.field,p,c,u)),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)}},yu.prototype.drawString=function(e,t,i,n,o,r,s,a,l){var h;"string"==typeof e&&t instanceof Rd&&(i instanceof Ep||null===i)&&(n instanceof rd||null===n)&&"number"==typeof o&&"number"==typeof r&&(s instanceof xd||null===s)&&void 0===a?(this.isOverloadWithPosition=!0,this.drawString(e,t,i,n,o,r,this.clientSize.width-o,0,s)):(i=i,n=n,o=o,r=r,s=s,a=a,l=l,(e=(new Dd).layout(e,t,l,new td(s,a),this.isOverloadWithPosition,this.clientSize)).empty||(h=this.checkCorrectLayoutRectangle(e.actualSize,o,r,l),s<=0&&(o=h.x,s=h.width),a<=0&&(r=h.y,a=h.height),this.drawStringLayoutResult(e,t,i,n,new id(o,r,s,a),l),this.isEmfTextScaled=!1,this.emfScalingFactor=new td(0,0)),this.getResources.getResources().requireProcedureSet(this.procedureSets.text),this.isNormalRender=!0,this.pdfStringLayoutResult=e,this.isUseFontSize=!1)},yu.prototype.drawLine=function(e,t,i,n,o){var r,s;t instanceof ed?this.drawLine(e,(r=t).x,r.y,(s=i).x,s.y):(r=t,s=i,t=n,i=o,this.stateControl(e,null,null),(n=this.streamWriter).beginPath(r,s),n.appendLineSegment(t,i),n.strokePath(),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf))},yu.prototype.drawRectangle=function(e,t,i,n,o,r){var s,a;e instanceof Ep&&"number"==typeof t?this.drawRectangle(e,null,t,s=i,n,o):e instanceof rd&&"number"==typeof t?this.drawRectangle(null,e,t,s=i,n,o):(s=i,i=n,n=o,o=r,t instanceof gu?(this.bCSInitialized=!1,r=this.matrix.matrix.offsetX+s,a=void 0,a=null!=this.layer&&null!=this.layer.page?this.layer.page.size.height-this.matrix.matrix.offsetY+i:this.clientSize.height-this.matrix.matrix.offsetY+i,t.location=new ed(r,a),t.graphics.colorSpace=this.colorSpace):t instanceof iu&&(t.colorSpace=this.colorSpace),r=e,a=t=t instanceof Sd&&t.color.isEmpty?null:t,this.stateControl(r,a,null),this.streamWriter.appendRectangle(s,i,n,o),this.drawPathHelper(r,a,!1))},yu.prototype.drawRoundedRectangle=function(e,t,i,n,o,r,s){if(null===e)throw new Error("pen");if(null===t)throw new Error("brush");0===s?this.drawRectangle(e,t,i,n,o,r):(r=[(i=[i,n,o,r])[0],i[1],(o=[n=2*s,n])[0],o[1]],this._pathPoints=[],this._pathTypes=[],s=this._addArc(r[0],r[1],r[2],r[3],180,90,s=!0),r[0]=i[0]+i[2]-n,s=this._addArc(r[0],r[1],r[2],r[3],270,90,s),r[1]=i[1]+i[3]-n,s=this._addArc(r[0],r[1],r[2],r[3],0,90,s),r[0]=i[0],s=this._addArc(r[0],r[1],r[2],r[3],90,90,s),o=this._pathPoints.length-1,n=this._pathTypes[o],n|=Jc.CloseSubpath,this._pathTypes[o]=n,this._drawPath(e,t,this._pathPoints,this._pathTypes,Uh.Alternate),this._pathPoints=[],this._pathTypes=[])},yu.prototype._addArc=function(e,t,i,n,o,r,s){for(var a=this._getBezierArcPoints(e,t,e+i,t+n,o,r),l=0;l<a.length;l+=8){var h=[a[l],a[l+1],a[l+2],a[l+3],a[l+4],a[l+5],a[l+6],a[l+7]];s=this._addArcPoints(h,Jc.Bezier3,s)}return s},yu.prototype._addArcPoints=function(e,t,i){for(var n=0;n<e.length;n++){var o=new ed(e[n],e[n+1]);0===n?0===this._pathPoints.length||i?(this._addPoint(o,Jc.Start),i=!1):o.x===this._getLastPoint().x&&o.y===this._getLastPoint().y||this._addPoint(o,Jc.Line):this._addPoint(o,t),n++}return i},yu.prototype._getLastPoint=function(){var e=new ed(0,0),t=this._pathPoints.length;return 0<t&&(e.x=this._pathPoints[t-1].x,e.y=this._pathPoints[t-1].y),e},yu.prototype._addPoint=function(e,t){this._pathPoints.push(e),this._pathTypes.push(t)},yu.prototype._getBezierArcPoints=function(e,t,i,n,o,r){i<e&&(c=void 0,c=e,e=i,i=c),t<n&&(c=void 0,c=t,t=n,n=c),Math.abs(r)<=90?(s=r,a=1):s=r/(a=Math.ceil(Math.abs(r)/90));for(var s,a,l=(e+i)/2,h=(t+n)/2,d=(i-e)/2,p=(n-t)/2,c=s*(Math.PI/360),u=Math.abs(4/3*(1-Math.cos(c))/Math.sin(c)),g=[],m=0;m<a;m++){var f=(o+m*s)*(Math.PI/180),y=(o+(m+1)*s)*(Math.PI/180),v=Math.cos(f),b=Math.cos(y),f=Math.sin(f),y=Math.sin(y);0<s?g.push(l+d*v,h-p*f,l+d*(v-u*f),h-p*(f+u*v),l+d*(b+u*y),h-p*(y-u*b),l+d*b,h-p*y):g.push(l+d*v,h-p*f,l+d*(v+u*f),h-p*(f-u*v),l+d*(b-u*y),h-p*(y+u*b),l+d*b,h-p*y)}return g},yu.prototype.drawPathHelper=function(e,t,i,n){"boolean"==typeof i?this.drawPathHelper(e,t,Uh.Winding,i):(t=null!=t,i=i===Uh.Alternate,(e=null!=e)&&t?this.streamWriter.fillStrokePath(i):e||t?e?this.streamWriter.strokePath():this.streamWriter.fillPath(i):this.streamWriter.endPath())},yu.prototype.drawImage=function(e,t,i,n,o){var r,s;"number"==typeof t&&"number"==typeof i&&void 0===n?(s=e.physicalDimension,this.drawImage(e,t,i,s.width,s.height)):(s=t,t=i,i=o,e.save(),r=new Mp,this.getTranslateTransform(s,t+i,r),this.getScaleTransform(n,o,r),this.pdfStreamWriter.write("q"),this.pdfStreamWriter.modifyCtm(r),s=this.getResources.getResources(),void 0!==this.pageLayer&&null!=this.page&&(s.document=this.page.document),t=s.getName(e),void 0!==this.pageLayer&&this.page.setResources(s),this.pdfStreamWriter.executeObject(t),this.pdfStreamWriter.write(bl.restoreState),this.pdfStreamWriter.write(bl.newLine),(i=this.getResources.getResources()).requireProcedureSet(this.procedureSets.imageB),i.requireProcedureSet(this.procedureSets.imageC),i.requireProcedureSet(this.procedureSets.imageI),i.requireProcedureSet(this.procedureSets.text))},yu.prototype.getLineBounds=function(e,t,i,n,o){var r,s,a,l;return!t.empty&&e<t.lineCount&&0<=e?(l=t.lines[e],r=this.getTextVerticalAlignShift(t.actualSize.height,n.height,o)+n.y+t.lineHeight*e,s=l.width,a=this.getHorizontalAlignShift(s,n.width,o),e=this.getLineIndent(l,o,n,0===e),a+=this.rightToLeft(o)?0:e,a=n.x+a,l=this.shouldJustify(l,n.width,o)?n.width-e:s-e,o=t.lineHeight,new id(a,r,l,o)):new id(0,0,0,0)},yu.prototype.checkCorrectLayoutRectangle=function(e,t,i,n){var o=new id(t,i,e.width,e.width);if(null!=n){switch(n.alignment){case Hh.Center:o.x-=o.width/2;break;case Hh.Right:o.x-=o.width}switch(n.lineAlignment){case _h.Middle:o.y-=o.height/2;break;case _h.Bottom:o.y-=o.height}}return o},yu.prototype.setLayer=function(e){e=(this.pageLayer=e).page;null!=e&&void 0!==e&&(e.beginSave=this.pageSave)},yu.prototype.pageSave=function(e){if(null!=e.graphics.automaticFields)for(var t=0;t<e.graphics.automaticFields.automaticFields.length;t++){var i=e.graphics.automaticFields.automaticFields[t];i.field.performDraw(e.graphics,i.location,i.scalingX,i.scalingY)}},yu.prototype.drawStringLayoutResult=function(e,t,i,n,o,r){if(e.empty)throw new Error("ArgumentNullException:result");this.applyStringSettings(t,i,n,r,o);var s=null!=r?r.horizontalScalingFactor:100,s=(s===this.previousTextScaling||this.isEmfTextScaled||(this.pdfStreamWriter.setTextScaling(s),this.previousTextScaling=s),null==r||0===r.lineSpacing?t.height:r.lineSpacing+t.height),a=null!=r&&r.subSuperScript===ud.SubScript?s-(t.height+t.metrics.getDescent(r)):s-t.metrics.getAscent(r);this.shift=a,this.pdfStreamWriter.startNextLine(o.x,o.y-a),this.pdfStreamWriter.setLeading(+s);for(var l=0,h="",d=0;d<e.lines.length;d++)if(l+=e.lineHeight,o.y+l>this.clientSize.height){this.startCutIndex=d;break}for(var p=this.startCutIndex;p<e.lines.length&&0<=p;p++)h+=e.lines[p].text;a=new id(o.x,o.y,o.width,o.height);this.drawLayoutResult(e,t,r,o),this.underlineStrikeoutText(i,n,e,t,a,r),this.isEmfPlus=!1,this.isUseFontSize=!1,-1!==this.startCutIndex&&this.getNextPage().graphics.drawString(h,t,i,n,o.x,0,o.width,0,r)},yu.prototype.getNextPage=function(){var e=this.currentPage.section,t=e.indexOf(this.currentPage);return t===e.count-1?e.add():e.getPages()[t+1]},yu.prototype.setClip=function(e,t){void 0===t?this.setClip(e,Uh.Winding):(this.pdfStreamWriter.appendRectangle(e),this.pdfStreamWriter.clipPath(t===Uh.Alternate))},yu.prototype.applyStringSettings=function(e,t,i,n,o){i instanceof gu?(this.bCSInitialized=!1,i.graphics.colorSpace=this.colorSpace):i instanceof iu&&(this.bCSInitialized=!1,i.colorSpace=this.colorSpace);var r=this.getTextRenderingMode(t,i,n),t=(this.stateControl(t,i,e,n),this.pdfStreamWriter.beginText(),r!==this.previousTextRenderingMode&&(this.pdfStreamWriter.setTextRenderingMode(r),this.previousTextRenderingMode=r),null!=n?n.characterSpacing:0),i=(t===this.previousCharacterSpacing||this.isEmfTextScaled||(this.pdfStreamWriter.setCharacterSpacing(t),this.previousCharacterSpacing=t),null!=n?n.wordSpacing:0);i!==this.previousWordSpacing&&(this.pdfStreamWriter.setWordSpacing(i),this.previousWordSpacing=i)},yu.prototype.getTextVerticalAlignShift=function(e,t,i){var n=0;if(0<=t&&null!=i&&i.lineAlignment!==_h.Top)switch(i.lineAlignment){case _h.Middle:n=(t-e)/2;break;case _h.Bottom:n=t-e}return n},yu.prototype.drawLayoutResult=function(e,t,i,n){var o=this.getTextVerticalAlignShift(e.actualSize.height,n.height,i);0!==o&&this.pdfStreamWriter.startNextLine(0,o);for(var r=null!=t&&t.isUnicode,s=(null!=t&&t.isEmbedFont,e.lines),a=0,l=s.length;a<l&&a!==this.startCutIndex;a++){var h=s[a],d=(h.text,h.width),d=this.getHorizontalAlignShift(d,n.width,i),p=this.getLineIndent(h,i,n,0===a);0===(d+=this.rightToLeft(i)?0:p)||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(d,0),r?this.drawUnicodeLine(h,n,t,i):this.drawAsciiLine(h,n,t,i),0===d||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(-d,0),this.isOverloadWithPosition&&1<s.length&&(this.pdfStreamWriter.startNextLine(-n.x,0),n.x=0,n.width=this.clientSize.width,this.isOverloadWithPosition=!1,this.isPointOverload=!0)}this.getResources.getResources().requireProcedureSet(this.procedureSets.text),0!==o&&this.pdfStreamWriter.startNextLine(0,-(o-e.lineHeight)),this.pdfStreamWriter.endText()},yu.prototype.drawAsciiLine=function(e,t,i,n){this.justifyLine(e,t.width,n);var o="";if(-1!==e.text.indexOf("(")||-1!==e.text.indexOf(")"))for(var r=0;r<e.text.length;r++)"("===e.text[r]?o+="\\(":")"===e.text[r]?o+="\\)":o+=e.text[r];""===o&&(o=e.text),this.pdfStreamWriter.showNextLineText(new Mh("("+o+")"))},yu.prototype.drawUnicodeLine=function(e,t,i,n){var o,r,s=e.text,a=(e.width,null!=n&&n.rightToLeft),l=null!=n&&(0!==n.wordSpacing||n.alignment===Hh.Justify),e=this.justifyLine(e,t.width,n),t=new Zc;a||null!=n&&n.textDirection!==Kh.None?(a=(o=null)!=n&&n.alignment===Hh.Right,r=1<(o=(r=null)!=n&&n.textDirection!==Kh.None?t.layout(s,i,n.textDirection===Kh.RightToLeft,l,n):t.layout(s,i,a,l,n)).length?null!=n&&n.textDirection!==Kh.None?t.splitLayout(s,i,n.textDirection===Kh.RightToLeft,l,n):t.splitLayout(s,i,a,l,n):[s],this.drawUnicodeBlocks(o,r,i,n,e)):l?(o=(t=this.breakUnicodeLine(s,i,null)).tokens,r=t.words,this.drawUnicodeBlocks(o,r,i,n,e)):(a=this.convertToUnicode(s,i),l=this.getUnicodeString(a),this.streamWriter.showNextLineText(l))},yu.prototype.drawUnicodeBlocks=function(e,t,i,n,o){if(null==e)throw new Error("Argument Null Exception : blocks");if(null==t)throw new Error("Argument Null Exception : words");if(null==i)throw new Error("Argument Null Exception : font");this.streamWriter.startNextLine();var r=0,s=0,a=0,l=0;try{null!=n&&(a=n.firstLineIndent,l=n.paragraphIndent,n.firstLineIndent=0,n.paragraphIndent=0);var h=i.getCharWidth(Td.whiteSpace,n)+o,d=null!=n?n.characterSpacing:0;h+=d+(null!=n&&0===o?n.wordSpacing:0);for(var p=0;p<e.length;p++){var c,u=e[p],g=t[p],m=0;0!==r&&this.streamWriter.startNextLine(r,0),0<g.length&&(m=m+i.measureString(g,n).width+d,c=this.getUnicodeString(u),this.streamWriter.showText(c)),p!==e.length-1&&(s+=r=m+h)}0<s&&this.streamWriter.startNextLine(-s,0)}finally{null!=n&&(n.firstLineIndent=a,n.paragraphIndent=l)}},yu.prototype.breakUnicodeLine=function(e,t,i){if(null===e)throw new Error("Argument Null Exception : line");i=e.split(null);for(var n=[],o=0;o<i.length;o++){var r=i[o],r=this.convertToUnicode(r,t);n[o]=r}return{tokens:n,words:i}},yu.prototype.getUnicodeString=function(e){if(null===e)throw new Error("Argument Null Exception : token");e=new Mh(e);return e.converted=!0,e.encode=Th.ForceEncoding.Ascii,e},yu.prototype.convertToUnicode=function(e,t){var i,n=null;if(null==e)throw new Error("Argument Null Exception : text");if(null==t)throw new Error("Argument Null Exception : ttfFont");return t.fontInternal instanceof _c&&(i=t.fontInternal.ttfReader,t.setSymbols(e),n=i.convertString(e),t=Mh.toUnicodeArray(n,!1),n=Mh.byteToString(t)),n},yu.prototype.justifyLine=function(e,t,i){var n=e.text,o=e.width,e=this.shouldJustify(e,t,i),r=null!=i&&0!==i.wordSpacing,s=Td.spaces,n=Td.getCharsCount(n,s),s=0;return e?(r&&(o-=n*i.wordSpacing),this.pdfStreamWriter.setWordSpacing(s=(t-o)/n)):r?this.pdfStreamWriter.setWordSpacing(i.wordSpacing):this.pdfStreamWriter.setWordSpacing(0),s},yu.prototype.reset=function(e){this.canvasSize=e,this.streamWriter.clear(),this.initialize(),this.initializeCoordinates()},yu.prototype.shouldJustify=function(e,t,i){var n=e.text,o=e.width,r=null!=i&&i.alignment===Hh.Justify,o=0<=t&&o<t,t=Td.spaces,t=0<Td.getCharsCount(n,t)&&n[0]!==Td.whiteSpace,n=0<(e.lineType&Bd.LayoutBreak)||i&&i.wordWrap===cd.None;return r&&o&&t&&n},yu.prototype.underlineStrikeoutText=function(e,t,i,n,o,r){if(n.underline||n.strikeout){var s=this.createUnderlineStikeoutPen(e,t,n,r);if(null!=s){for(var e=this.getTextVerticalAlignShift(i.actualSize.height,o.height,r),a=0,a=o.y+e+n.metrics.getAscent(r)+1.5*s.width,l=o.y+e+n.metrics.getHeight(r)/2+1.5*s.width,h=i.lines,d=0,p=i.lineCount;d<p;d++){var c,u=h[d],g=(u.text,u.width),m=this.getHorizontalAlignShift(g,o.width,r),f=this.getLineIndent(u,r,o,0===d),m=(m+=this.rightToLeft(r)?0:f,o.x+m),u=this.shouldJustify(u,o.width,r)?m+o.width-f:m+g-f;n.underline&&(c=a,this.drawLine(s,m,c,u,c),a+=i.lineHeight),n.strikeout&&(c=l,this.drawLine(s,m,c,u,c),l+=i.lineHeight),this.isPointOverload&&1<h.length&&(o.x=0,o.width=this.clientSize.width)}this.isPointOverload=!1}}},yu.prototype.createUnderlineStikeoutPen=function(e,t,i,n){i=i.metrics.getSize(n)/20,n=null;return null!=e?n=new Ep(e.color,i):null!=t&&(n=new Ep(t,i)),n},yu.prototype.getTextRenderingMode=function(e,t,i){var n=zh.None,n=null!=e&&null!=t?zh.FillStroke:null!=e?zh.Stroke:zh.Fill;return null!=i&&i.clipPath&&(n|=zh.ClipFlag),n},yu.prototype.getLineIndent=function(e,t,i,n){var o=0,e=0<(e.lineType&Bd.FirstParagraphLine);return null!=t&&e&&(o=n?t.firstLineIndent:t.paragraphIndent,o=0<i.width?Math.min(i.width,o):o),o},yu.prototype.getHorizontalAlignShift=function(e,t,i){var n=0;if(0<=t&&null!=i&&i.alignment!==Hh.Left)switch(i.alignment){case Hh.Center:n=(t-e)/2;break;case Hh.Right:n=t-e}return n},yu.prototype.rightToLeft=function(e){var t=null!=e&&e.rightToLeft;return t=null!=e&&e.textDirection!==Kh.None&&void 0!==e.textDirection?!0:t},yu.prototype.stateControl=function(e,t,i,n){void 0===n?this.stateControl(e,t,i,null):(t instanceof iu&&(this.bCSInitialized=!1,t.colorSpace=this.colorSpace),t instanceof gu&&(this.bCSInitialized=!1,t.graphics.colorSpace=this.colorSpace),null!==t?(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!=e&&(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(e,!1),this.brushControl(t,!1),this.fontControl(i,n,!1))},yu.prototype.initCurrentColorSpace=function(e){this.getResources.getResources();this.bCSInitialized||(this.currentColorSpace!=qh.GrayScale?(this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!0),this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!1)):(this.pdfStreamWriter.setColorSpace("DeviceGray",!0),this.pdfStreamWriter.setColorSpace("DeviceGray",!1)),this.bCSInitialized=!0)},yu.prototype.penControl=function(e,t){null!=e&&((this.currentPen=e).monitorChanges(this.currentPen,this.pdfStreamWriter,this.getResources,t,this.colorSpace,this.matrix.clone()),this.currentPen=e.clone())},yu.prototype.brushControl=function(e,t){var i,n,o,r;null!=e&&void 0!==e&&(null==(n=i=e.clone())||e instanceof Sd||e instanceof gu||(o=n.matrix,r=this.matrix.clone(),null!=o&&(o.multiply(r),r=o),n.matrix=r),this.currentBrush=n,i.monitorChanges(this.currentBrush,this.pdfStreamWriter,this.getResources,t,this.colorSpace),this.currentBrush=e)},yu.prototype.fontControl=function(e,t,i){var n,o;null!=e&&(n=null!=t?t.subSuperScript:ud.None,o=null!=this.currentStringFormat?this.currentStringFormat.subSuperScript:ud.None,!i&&e===this.currentFont&&n===o||(i=this.getResources.getResources(),this.currentFont=e,this.currentStringFormat=t,n=e.metrics.getSize(t),this.isEmfTextScaled=!1,o=i.getName(e),this.pdfStreamWriter.setFont(e,o,n)))},yu.prototype.setTransparency=function(e,t,i){var n,o;void 0===t?(this.istransparencySet=!0,this.setTransparency(e,e,Gh.Normal)):"number"==typeof t&&void 0===i?this.setTransparency(e,t,Gh.Normal):(null==this.trasparencies&&(this.trasparencies=new Lp),n=null,o=new Su(e,t,i),null==(n=this.trasparencies.containsKey(o)?this.trasparencies.getValue(o):n)&&(n=new Op(e,t,i),this.trasparencies.setValue(o,n)),e=this.getResources.getResources().getName(n),this.streamWriter.setGraphicsState(e))},yu.prototype.clipTranslateMargins=function(e,t,i,n,o,r){e instanceof id&&void 0===t?(this.clipBounds=e,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(e),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(e.x,e.y)):"number"==typeof e&&(i=new id(i,n,this.size.width-i-o,this.size.height-n-r),this.clipBounds=i,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(i),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(e,t))},yu.prototype.updateY=function(e){return-e},yu.prototype.translateTransform=function(e,t){var i=new Mp;this.getTranslateTransform(e,t,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},yu.prototype.getTranslateTransform=function(e,t,i){return i.translate(e,this.updateY(t)),i},yu.prototype.scaleTransform=function(e,t){var i=new Mp;this.getScaleTransform(e,t,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},yu.prototype.getScaleTransform=function(e,t,i){return(i=null==i?new Mp:i).scale(e,t),i},yu.prototype.rotateTransform=function(e){var t=new Mp;this.getRotateTransform(e,t),this.pdfStreamWriter.modifyCtm(t),this.matrix.multiply(t)},yu.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)))},yu.prototype.getRotateTransform=function(e,t){return(t=null!=t&&void 0!==t?t:new Mp).rotate(this.updateY(e)),t},yu.prototype.save=function(){var e=new wu(this,this.matrix.clone());return e.brush=this.currentBrush,e.pen=this.currentPen,e.font=this.currentFont,e.colorSpace=this.currentColorSpace,e.characterSpacing=this.previousCharacterSpacing,e.wordSpacing=this.previousWordSpacing,e.textScaling=this.previousTextScaling,e.textRenderingMode=this.previousTextRenderingMode,this.graphicsState.push(e),this.pdfStreamWriter.saveGraphicsState(),e},yu.prototype.restore=function(e){if(void 0===e)0<this.graphicsState.length&&this.doRestoreState();else if(-1!==this.graphicsState.indexOf(e))for(;0!==this.graphicsState.length;)if(this.doRestoreState()===e)break},yu.prototype.doRestoreState=function(){var e=this.graphicsState.pop();return this.transformationMatrix=e.matrix,this.currentBrush=e.brush,this.currentPen=e.pen,this.currentFont=e.font,this.currentColorSpace=e.colorSpace,this.previousCharacterSpacing=e.characterSpacing,this.previousWordSpacing=e.wordSpacing,this.previousTextScaling=e.textScaling,this.previousTextRenderingMode=e.textRenderingMode,this.pdfStreamWriter.restoreGraphicsState(),e},yu.prototype.drawPath=function(e,t,i){this._drawPath(e,t,i.pathPoints,i.pathTypes,i.fillMode)},yu.prototype._drawPath=function(e,t,i,n,o){t instanceof gu?(this.bCSInitialized=!1,t.graphics.colorSpace=this.colorSpace):t instanceof iu&&(this.bCSInitialized=!1,t.colorSpace=this.colorSpace),this.stateControl(e,t,null),this.buildUpPath(i,n),this.drawPathHelper(e,t,o,!1)},yu.prototype.drawArc=function(e,t,i,n,o,r,s){t instanceof id?this.drawArc(e,t.x,t.y,t.width,t.height,i,n):0!==s&&(this.stateControl(e,null,null),this.constructArcPath(t,i,t+n,i+o,r,s),this.drawPathHelper(e,null,!1))},yu.prototype.buildUpPath=function(e,t){for(var i=e.length,n=0;n<i;++n){var o,r=e[n];switch(t[n]&yu.pathTypesValuesMask){case Jc.Start:this.pdfStreamWriter.beginPath(r.x,r.y);break;case Jc.Bezier3:var s=new ed(0,0),a=new ed(0,0),s=this.getBezierPoints(e,t,n,s,a);this.pdfStreamWriter.appendBezierSegment(r,s.p2,s.p3),n=s.i;break;case Jc.Line:this.pdfStreamWriter.appendLineSegment(r);break;default:throw new Error("ArithmeticException - Incorrect path formation.")}o=t[n],this.checkFlags(o)}},yu.prototype.getBezierPoints=function(e,t,i,n,o){if((t[++i]&yu.pathTypesValuesMask)!==Jc.Bezier3)throw new Error("ArgumentException : errorMsg");if(n=e[i],(t[++i]&yu.pathTypesValuesMask)!==Jc.Bezier3)throw new Error("ArgumentException : errorMsg");return{i:i,p2:n,p3:e[i]}},yu.prototype.checkFlags=function(e){(e&Jc.CloseSubpath)===Jc.CloseSubpath&&this.pdfStreamWriter.closePath()},yu.prototype.constructArcPath=function(e,t,i,n,o,r){var s=this.getBezierArc(e,t,i,n,o,r);if(0!==s.length)for(var a=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]],l=(this.pdfStreamWriter.beginPath(a[0],a[1]),0),l=0;l<s.length;l+=8)a=[s[l],s[l+1],s[l+2],s[l+3],s[l+4],s[l+5],s[l+6],s[l+7]],this.pdfStreamWriter.appendBezierSegment(a[2],a[3],a[4],a[5],a[6],a[7])},yu.prototype.getBezierArc=function(e,t,i,n,o,r){i<e&&(c=void 0,c=e,e=i,i=c),t<n&&(c=void 0,c=t,t=n,n=c),Math.abs(r)<=90?(s=r,a=1):s=r/(a=Math.ceil(Math.abs(r)/90));for(var s,a,l=(e+i)/2,h=(t+n)/2,d=(i-e)/2,p=(n-t)/2,c=s*(Math.PI/360),u=Math.abs(4/3*(1-Math.cos(c))/Math.sin(c)),g=[],m=0;m<a;m++){var f=(o+m*s)*(Math.PI/180),y=(o+(m+1)*s)*(Math.PI/180),v=Math.cos(f),b=Math.cos(y),f=Math.sin(f),y=Math.sin(y);0<s?g.push(l+d*v,h-p*f,l+d*(v-u*f),h-p*(f+u*v),l+d*(b+u*y),h-p*(y-u*b),l+d*b,h-p*y):g.push(l+d*v,h-p*f,l+d*(v+u*f),h-p*(f-u*v),l+d*(b-u*y),h-p*(y+u*b),l+d*b,h-p*y)}return g},yu.pathTypesValuesMask=15,yu.transparencyObject=!1;var fu=yu;function yu(e,t,i){this.currentColorSpace=qh.Rgb,this.previousTextRenderingMode=zh.Fill,this.previousCharacterSpacing=0,this.previousWordSpacing=0,this.previousTextScaling=100,this.procedureSets=new Fp,this.isNormalRender=!0,this.isUseFontSize=!1,this.isItalic=!1,this.isEmfTextScaled=!1,this.isEmf=!1,this.isEmfPlus=!1,this.isBaselineFormat=!0,this.emfScalingFactor=new td(0,0),this.colorSpaceChanged=!1,this.dictionaryProperties=new Cl,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=t,this.canvasSize=e,i instanceof Ip?this.pdfStreamWriter=i:this.pdfStreamWriter=new Ip(i),this.initialize()}bu.prototype.getResources=function(){return this.sender.getResources()};var vu=bu;function bu(e){this.sender=e}Object.defineProperty(Cu.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(Cu.prototype,"matrix",{get:function(){return this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(Cu.prototype,"characterSpacing",{get:function(){return this.internalCharacterSpacing},set:function(e){this.internalCharacterSpacing=e},enumerable:!0,configurable:!0}),Object.defineProperty(Cu.prototype,"wordSpacing",{get:function(){return this.internalWordSpacing},set:function(e){this.internalWordSpacing=e},enumerable:!0,configurable:!0}),Object.defineProperty(Cu.prototype,"textScaling",{get:function(){return this.internalTextScaling},set:function(e){this.internalTextScaling=e},enumerable:!0,configurable:!0}),Object.defineProperty(Cu.prototype,"pen",{get:function(){return this.pdfPen},set:function(e){this.pdfPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(Cu.prototype,"brush",{get:function(){return this.pdfBrush},set:function(e){this.pdfBrush=e},enumerable:!0,configurable:!0}),Object.defineProperty(Cu.prototype,"font",{get:function(){return this.pdfFont},set:function(e){this.pdfFont=e},enumerable:!0,configurable:!0}),Object.defineProperty(Cu.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(e){this.pdfColorSpace=e},enumerable:!0,configurable:!0}),Object.defineProperty(Cu.prototype,"textRenderingMode",{get:function(){return this.internalTextRenderingMode},set:function(e){this.internalTextRenderingMode=e},enumerable:!0,configurable:!0});var wu=Cu;function Cu(e,t){var i;this.internalTextRenderingMode=zh.Fill,this.internalCharacterSpacing=0,this.internalWordSpacing=0,this.internalTextScaling=100,this.pdfColorSpace=qh.Rgb,void 0!==e&&(this.pdfGraphics=e,i=[],e.matrix.matrix.elements.forEach(function(e){i.push(e)}),this.transformationMatrix=new Mp,this.transformationMatrix.matrix=new Pp(i))}var Su=function(e,t,i){this.alphaPen=e,this.alphaBrush=t,this.blendMode=i},Au=(Object.defineProperty(xu.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(e){this.pdfColorSpace=e},enumerable:!0,configurable:!0}),Object.defineProperty(xu.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(xu.prototype,"layerId",{get:function(){return this.layerid},set:function(e){this.layerid=e},enumerable:!0,configurable:!0}),Object.defineProperty(xu.prototype,"name",{get:function(){return this.layerName},set:function(e){this.layerName=e},enumerable:!0,configurable:!0}),Object.defineProperty(xu.prototype,"visible",{get:function(){return this.isVisible},set:function(e){this.isVisible=e},enumerable:!0,configurable:!0}),Object.defineProperty(xu.prototype,"graphics",{get:function(){return null==this.pdfGraphics&&this.initializeGraphics(this.page),this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(xu.prototype,"layers",{get:function(){return null==this.layer&&(this.layer=new Du(this.page),this.layer.sublayer=!0),this.layer},enumerable:!0,configurable:!0}),xu.prototype.add=function(){var e=new xu(this.pdfPage);return e.name="",e},xu.prototype.sign=function(e){return 0===e?0:0<e?1:-1},xu.prototype.initializeGraphics=function(e){var t=e,i=new vu(this.page),i=(this.pdfGraphics=new fu(e.size,i,this.content),this.pdfGraphics.mediaBoxUpperRightBound=0,null!=t&&null!=(i=t.section.parent)&&(this.pdfGraphics.colorSpace=i.document.colorSpace,this.colorSpace=i.document.colorSpace),this.sign(e.origin.y)===this.sign(e.origin.x)),i=((0<=e.origin.x&&0<=e.origin.y||!i)&&this.pdfGraphics.initializeCoordinates(),t.section.getActualBounds(t,!0)),t=t.section.pageSettings.margins;this.clipPageTemplates?0<=e.origin.x&&0<=e.origin.y&&this.pdfGraphics.clipTranslateMargins(i):this.graphics.clipTranslateMargins(i.x,i.y,t.left,t.top,t.right,t.bottom),this.pdfGraphics.setLayer(this)},Object.defineProperty(xu.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0}),xu);function xu(e,t){if(this.pdfColorSpace=qh.Rgb,this.isVisible=!0,this.sublayer=!1,this.contentLength=0,this.dictionaryProperties=new Cl,null===e)throw new Error("ArgumentNullException:page");if(this.pdfPage=e,this.clipPageTemplates=!0,void 0===t)this.content=new xh;else if(t instanceof xh||null===t){if(null===t)throw new Error("ArgumentNullException:stream");this.content=t}else this.content=new xh,this.clipPageTemplates=t}Object.defineProperty(Iu.prototype,"count",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection.length},enumerable:!0,configurable:!0}),Object.defineProperty(Iu.prototype,"list",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection},enumerable:!0,configurable:!0});Pc=Iu;function Iu(){}Tu=function(e,t){return(Tu=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Tu(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Mu,Eu=Pc),Mu.prototype.items=function(e,t){if("number"==typeof e&&void 0===t)return this.list[e];if(null==t)throw new Error("ArgumentNullException: layer");if(t.page!==this.page)throw new Error("ArgumentException: The layer belongs to another page")},Mu.prototype.add=function(e,t){var i;return void 0===e?((i=new Au(this.page)).name="",this.add(i),i):e instanceof Au?(i=this.list.push(e),this.addLayer(i,e),i):0},Mu.prototype.addLayer=function(e,t){t=new Fh(t);this.page.contents.add(t)},Mu.prototype.insert=function(e,t){for(var i=[],n=this.list.length,o=e;o<n;o++)i.push(this.list.pop());this.list.push(t);for(o=0;o<i.length;o++)this.list.push(i[o]);this.insertLayer(e,t)},Mu.prototype.insertLayer=function(e,t){if(null==t)throw new Error("ArgumentNullException:layer");t=new Fh(t);this.page.contents.insert(e,t)},Mu.prototype.parseLayers=function(e){var t=this.page.contents,e=(this.page.getResources(),e.crossTable,new xh),i=new xh,n=[];n.push("q"),e.data=n,t.insert(0,new Fh(e)),(n=[]).push("Q"),i.data=n,t.insert(t.count,new Fh(i))},Mu.prototype.indexOf=function(e){if(null==e)throw new Error("ArgumentNullException: layer");return this.list.indexOf(e)};var Tu,Eu,Du=Mu;function Mu(e){var t=Eu.call(this)||this;return t.parentLayerCount=0,t.sublayer=!1,t.optionalContent=new Sl,e instanceof ku&&(t.page=e,t.parseLayers(e)),t}Object.defineProperty(Pu.prototype,"section",{get:function(){return this.pdfSection},set:function(e){this.pdfSection=e},enumerable:!0,configurable:!0}),Object.defineProperty(Pu.prototype,"dictionary",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(Pu.prototype,"element",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(Pu.prototype,"defaultLayer",{get:function(){var e=this.layers,t=this.defaultLayerIndex;return e.items(t)},enumerable:!0,configurable:!0}),Object.defineProperty(Pu.prototype,"defaultLayerIndex",{get:function(){var e;return 0!==this.layerCollection.count&&-1!==this.defLayerIndex||(e=this.layerCollection.add(),this.defLayerIndex=this.layerCollection.indexOf(e)),this.defLayerIndex},set:function(e){if(e<0||e>this.layers.count-1)throw new Error("ArgumentOutOfRangeException : value, Index can not be less 0 and greater Layers.Count - 1");this.defLayerIndex=e,this.modified=!0},enumerable:!0,configurable:!0}),Object.defineProperty(Pu.prototype,"layers",{get:function(){return null!=this.layerCollection&&void 0!==this.layerCollection||(this.layerCollection=new Du(this)),this.layerCollection},enumerable:!0,configurable:!0}),Pu.prototype.getResources=function(){return null==this.resources&&(this.resources=new lu,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},Object.defineProperty(Pu.prototype,"contents",{get:function(){var e=this.pageDictionary.items.getValue(this.dictionaryProperties.contents);return null==e&&(e=new Bl,this.pageDictionary.items.setValue(this.dictionaryProperties.contents,e)),e},enumerable:!0,configurable:!0}),Pu.prototype.setResources=function(e){this.resources=e,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources),this.modified=!0};var ku=Pu;function Pu(e){this.defLayerIndex=-1,this.modified=!1,this.dictionaryProperties=new Cl,this.pageDictionary=e}Object.defineProperty(Fu.prototype,"annotations",{get:function(){return this.internalAnnotations},set:function(e){this.internalAnnotations=e},enumerable:!0,configurable:!0}),Fu.prototype.add=function(e){this.doAdd(e)},Fu.prototype.doAdd=function(e){if(void 0===e.destination)return e.setPage(this.page),this.internalAnnotations.add(new Fh(e)),this.lists.push(e);var t=(new Dd).layout(e.text,e.font,e.stringFormat,new td(e.bounds.width,0),!1,new td(0,0)),i=e.bounds.y;if(1===t.lines.length){var n=e.font.measureString(t.lines[0].text);e.bounds=new id(new ed(e.bounds.x,i),n),e.text=t.lines[0].text,this.page.graphics.drawString(e.text,e.font,null,e.brush,e.bounds.x,e.bounds.y,e.bounds.width,e.bounds.height,null),e.setPage(this.page),this.setColor(e),this.internalAnnotations.add(new Fh(e)),this.lists.push(e)}else for(var o=0;o<t.lines.length;o++){var r,n=e.font.measureString(t.lines[o].text);0===o?(e.bounds=new id(e.bounds.x,i,n.width,n.height),e.text=t.lines[o].text,this.page.graphics.drawString(e.text,e.font,null,e.brush,e.bounds.x,i,n.width,n.height,null),e.setPage(this.page),this.setColor(e),this.internalAnnotations.add(new Fh(e)),this.lists.push(e),i+=e.bounds.height):((r=e.clone()).bounds=new id(new ed(e.bounds.x,i),n),r.text=t.lines[o].text,this.page.graphics.drawString(r.text,r.font,null,r.brush,r.bounds.x,r.bounds.y,r.bounds.width,r.bounds.height,null),r.setPage(this.page),this.setColor(r),this.internalAnnotations.add(new Fh(r)),this.lists.push(r),i+=r.bounds.height)}},Fu.prototype.setColor=function(e){var t=qh.Rgb,t=e.color.toArray(t);e.dictionary.items.setValue(this.dictionaryProperties.c,t)},Object.defineProperty(Fu.prototype,"element",{get:function(){return this.internalAnnotations},enumerable:!0,configurable:!0});var Bu=Fu;function Fu(e){this.alreadyExistsAnnotationError="This annotatation had been already added to page",this.missingAnnotationException="Annotation is not contained in collection.",this.dictionaryProperties=new Cl,this.internalAnnotations=new Bl,this.lists=[],void 0!==e&&(this.page=e)}Lu=function(e,t){return(Lu=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Lu(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Nu,Ru=ku),Object.defineProperty(Nu.prototype,"document",{get:function(){return null!==this.section&&null!==this.section.parent?this.section.parent.document:null},enumerable:!0,configurable:!0}),Object.defineProperty(Nu.prototype,"graphics",{get:function(){var e=this.defaultLayer.graphics;return e.currentPage=this,e},enumerable:!0,configurable:!0}),Object.defineProperty(Nu.prototype,"crossTable",{get:function(){if(null===this.section)throw new Error("PdfDocumentException : Page is not created");return(null===this.section.parent?this.section.parentDocument:this.section.parent.document).crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(Nu.prototype,"size",{get:function(){return this.section.pageSettings.size},enumerable:!0,configurable:!0}),Object.defineProperty(Nu.prototype,"origin",{get:function(){return this.section.pageSettings.origin},enumerable:!0,configurable:!0}),Object.defineProperty(Nu.prototype,"annotations",{get:function(){return null==this.annotationCollection&&(this.annotationCollection=new Bu(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}),Nu.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new yl("Page")),this.dictionary.pageBeginDrawTemplate=new Ml(this)},Nu.prototype.setSection=function(e){this.section=e,this.dictionary.items.setValue(this.dictionaryProperties.parent,new Fh(e))},Nu.prototype.resetProgress=function(){this.isProgressOn=!1},Nu.prototype.getClientSize=function(){var e=this.section.getActualBounds(this,!0);return new td(e.width,e.height)},Nu.prototype.pageBeginSave=function(){var e=this.document;null!=e&&this.drawPageTemplates(e),null!=this.beginSave&&void 0!==this.beginSave&&this.beginSave(this)},Nu.prototype.drawPageTemplates=function(e){var t;if(this.section.containsTemplates(e,this,!1)){var i=new Au(this,!1);if(this.layers.insert(0,i),this.section.drawTemplates(this,i,e,!1),null!==i.graphics&&void 0!==i.graphics)for(var n=0;n<i.graphics.automaticFields.automaticFields.length;n++){var o=i.graphics.automaticFields.automaticFields[n];o.field.performDraw(i.graphics,o.location,o.scalingX,o.scalingY)}}this.section.containsTemplates(e,this,!0)&&(t=new Au(this,!1),this.layers.add(t),this.section.drawTemplates(this,t,e,!0))};var Lu,Ru,Ou=Nu;function Nu(){var e=Ru.call(this,new Sl)||this;return e.annotationCollection=null,e.beginSave=null,e.initialize(),e}Object.defineProperty(_u.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0});var Vu=_u;function _u(e){this.pdfPage=void 0!==e?e:null}Object.defineProperty(zu.prototype,"section",{get:function(){return this.pdfSection},set:function(e){this.pdfSection=e},enumerable:!0,configurable:!0}),zu.prototype.contains=function(e){return this.section.contains(e)},zu.prototype.remove=function(e){this.section.remove(e)},zu.prototype.add=function(){return this.section.add()};var Hu=zu;function zu(e){if((this.pdfSection=null)==e)throw Error('ArgumentNullException("section")');this.section=e}Object.defineProperty(Wu.prototype,"left",{get:function(){return this.leftTemplate},set:function(e){this.leftTemplate=this.checkElement(e,vp.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(Wu.prototype,"top",{get:function(){return this.topTemplate},set:function(e){this.topTemplate=this.checkElement(e,vp.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(Wu.prototype,"right",{get:function(){return this.rightTemplate},set:function(e){this.rightTemplate=this.checkElement(e,vp.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(Wu.prototype,"bottom",{get:function(){return this.bottomTemplate},set:function(e){this.bottomTemplate=this.checkElement(e,vp.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(Wu.prototype,"EvenLeft",{get:function(){return this.evenLeft},set:function(e){this.evenLeft=this.checkElement(e,vp.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(Wu.prototype,"EvenTop",{get:function(){return this.evenTop},set:function(e){this.evenTop=this.checkElement(e,vp.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(Wu.prototype,"EvenRight",{get:function(){return this.evenRight},set:function(e){this.evenRight=this.checkElement(e,vp.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(Wu.prototype,"EvenBottom",{get:function(){return this.evenBottom},set:function(e){this.evenBottom=this.checkElement(e,vp.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(Wu.prototype,"OddLeft",{get:function(){return this.oddLeft},set:function(e){this.oddLeft=this.checkElement(e,vp.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(Wu.prototype,"OddTop",{get:function(){return this.oddTop},set:function(e){this.oddTop=this.checkElement(e,vp.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(Wu.prototype,"OddRight",{get:function(){return this.oddRight},set:function(e){this.oddRight=this.checkElement(e,vp.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(Wu.prototype,"OddBottom",{get:function(){return this.oddBottom},set:function(e){this.oddBottom=this.checkElement(e,vp.Bottom)},enumerable:!0,configurable:!0}),Wu.prototype.getLeft=function(e){if(null==e)throw new Error("ArgumentNullException:page");return this.isEven(e)?null!=this.EvenLeft?this.EvenLeft:this.left:null!=this.OddLeft?this.OddLeft:this.left},Wu.prototype.getTop=function(e){if(null==e)throw new Error("ArgumentNullException:page");return this.isEven(e)?null!=this.EvenTop?this.EvenTop:this.top:null!=this.OddTop?this.OddTop:this.top},Wu.prototype.getRight=function(e){if(null==e)throw new Error("ArgumentNullException:page");return this.isEven(e)?null!=this.EvenRight?this.EvenRight:this.right:null!=this.OddRight?this.OddRight:this.right},Wu.prototype.getBottom=function(e){if(null==e)throw new Error("ArgumentNullException:page");return this.isEven(e)?null!=this.EvenBottom?this.EvenBottom:this.bottom:null!=this.OddBottom?this.OddBottom:this.bottom},Wu.prototype.isEven=function(e){var t=e.section.document.pages;return(t.pageCollectionIndex.containsKey(e)?t.pageCollectionIndex.getValue(e)+1:t.indexOf(e)+1)%2==0},Wu.prototype.checkElement=function(e,t){if(null!=e){if(void 0!==e.type&&e.type!==vp.None)throw new Error("NotSupportedException:Can not reassign the template element. Please, create new one.");e.type=t}return e};var ju=Wu;function Wu(){}Qu=function(e,t){return(Qu=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Qu(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Gu,Uu=ju),Object.defineProperty(Gu.prototype,"applyDocumentLeftTemplate",{get:function(){return this.leftValue},set:function(e){this.leftValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(Gu.prototype,"applyDocumentTopTemplate",{get:function(){return this.topValue},set:function(e){this.topValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(Gu.prototype,"applyDocumentRightTemplate",{get:function(){return this.rightValue},set:function(e){this.rightValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(Gu.prototype,"applyDocumentBottomTemplate",{get:function(){return this.bottomValue},set:function(e){this.bottomValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(Gu.prototype,"applyDocumentStamps",{get:function(){return this.stampValue},set:function(e){this.stampValue=e},enumerable:!0,configurable:!0});var Qu,Uu,qu=Gu;function Gu(){var e=Uu.call(this)||this;return e.leftValue=e.topValue=e.rightValue=e.bottomValue=e.stampValue=!0,e}Object.defineProperty(Xu.prototype,"parent",{get:function(){return this.sectionCollection},set:function(e){this.sectionCollection=e,this.section.items.setValue(this.dictionaryProperties.parent,new Fh(e))},enumerable:!0,configurable:!0}),Object.defineProperty(Xu.prototype,"parentDocument",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(Xu.prototype,"pageSettings",{get:function(){return this.settings},set:function(e){if(null==e)throw Error("Value can not be null.");this.settings=e},enumerable:!0,configurable:!0}),Object.defineProperty(Xu.prototype,"element",{get:function(){return this.section},enumerable:!0,configurable:!0}),Object.defineProperty(Xu.prototype,"count",{get:function(){return this.pagesReferences.count},enumerable:!0,configurable:!0}),Object.defineProperty(Xu.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new qu),this.pageTemplate},set:function(e){this.pageTemplate=e},enumerable:!0,configurable:!0}),Object.defineProperty(Xu.prototype,"document",{get:function(){return this.sectionCollection.document},enumerable:!0,configurable:!0}),Object.defineProperty(Xu.prototype,"pages",{get:function(){return null!=this.pagesCollection&&void 0!==this.pagesCollection||(this.pagesCollection=new Hu(this)),this.pagesCollection},enumerable:!0,configurable:!0}),Xu.prototype.getPages=function(){return this.pdfPages},Xu.prototype.pointToNativePdf=function(e,t){e=this.getActualBounds(e,!0);return t.x+=e.x,t.y=this.pageSettings.height-t.y,t},Xu.prototype.setPageSettings=function(e){this.settings=e,this.state.orientation=e.orientation,this.state.rotate=e.rotate,this.state.size=e.size,this.state.origin=e.origin},Xu.prototype.initialize=function(){this.pagesReferences=new Bl,this.section=new Sl,this.state=new Ku(this.pdfDocument),this.section.sectionBeginSave=new Dl(this,this.state),this.pageCount=new kl(0),this.section.items.setValue(this.dictionaryProperties.count,this.pageCount),this.section.items.setValue(this.dictionaryProperties.type,new yl(this.dictionaryProperties.pages)),this.section.items.setValue(this.dictionaryProperties.kids,this.pagesReferences)},Xu.prototype.containsTemplates=function(e,t,i){e=this.getDocumentTemplates(e,t,i),t=this.getSectionTemplates(t,i);return 0<e.length||0<t.length},Xu.prototype.getDocumentTemplates=function(e,t,i){var n=[];return this.template.applyDocumentTopTemplate&&null!=e.template.getTop(t)&&(!e.template.getTop(t).foreground&&!i||e.template.getTop(t).foreground&&i)&&n.push(e.template.getTop(t)),this.template.applyDocumentBottomTemplate&&null!=e.template.getBottom(t)&&(!e.template.getBottom(t).foreground&&!i||e.template.getBottom(t).foreground&&i)&&n.push(e.template.getBottom(t)),this.template.applyDocumentLeftTemplate&&null!=e.template.getLeft(t)&&(!e.template.getLeft(t).foreground&&!i||e.template.getLeft(t).foreground&&i)&&n.push(e.template.getLeft(t)),this.template.applyDocumentRightTemplate&&null!=e.template.getRight(t)&&(!e.template.getRight(t).foreground&&!i||e.template.getRight(t).foreground&&i)&&n.push(e.template.getRight(t)),n},Xu.prototype.getSectionTemplates=function(e,t){var i,n=[];return null!=this.template.getTop(e)&&(!(i=this.template.getTop(e)).foreground&&!t||i.foreground&&t)&&n.push(i),null!=this.template.getBottom(e)&&(!(i=this.template.getBottom(e)).foreground&&!t||i.foreground&&t)&&n.push(i),null!=this.template.getLeft(e)&&(!(i=this.template.getLeft(e)).foreground&&!t||i.foreground&&t)&&n.push(i),null!=this.template.getRight(e)&&(!(i=this.template.getRight(e)).foreground&&!t||i.foreground&&t)&&n.push(i),n},Xu.prototype.add=function(e){var t;if(void 0===e)return t=new Ou,this.add(t),t;t=this.checkPresence(e),this.pdfPages.push(e),this.pagesReferences.add(t),e.setSection(this),e.resetProgress(),this.pageAddedMethod(e)},Xu.prototype.checkPresence=function(e){for(var t=new Fh(e),i=!1,n=this.parent,o=0;o<n.section.length;o++)var r=n.section[o],i=i||r.contains(e);return t},Xu.prototype.contains=function(e){return 0<=this.indexOf(e)},Xu.prototype.indexOf=function(e){for(var t=0;t<this.pdfPages.length;t++)if(this.pdfPages[t]===e)return this.pdfPages.indexOf(e);var i=new Fh(e);return this.pagesReferences.indexOf(i)},Xu.prototype.pageAddedMethod=function(e){e=new Vu(e);this.onPageAdded(e),this.parent.document.pages.onPageAdded(e),this.pageCount.intValue=this.count},Xu.prototype.onPageAdded=function(e){},Xu.prototype.getActualBounds=function(e,t,i){var n,o,r,s;return e instanceof Ou&&"boolean"==typeof t?(n=this.parent.document,this.getActualBounds(n,e,t)):((n=new id(0,0,0,0)).height=(i?this.pageSettings.size:this.pageSettings.getActualSize()).height,n.width=(i?this.pageSettings.size:this.pageSettings.getActualSize()).width,o=this.getLeftIndentWidth(e,t,i),r=this.getTopIndentHeight(e,t,i),s=this.getRightIndentWidth(e,t,i),e=this.getBottomIndentHeight(e,t,i),n.x+=o,n.y+=r,n.width-=o+s,n.height-=r+e,n)},Xu.prototype.getLeftIndentWidth=function(e,t,i){if(null==e)throw new Error("ArgumentNullException:document");if(null==t)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.left:0,n=null!=this.template.getLeft(t)?this.template.getLeft(t).width:0,e=null!=e.template.getLeft(t)?e.template.getLeft(t).width:0;return i+=this.template.applyDocumentLeftTemplate?Math.max(n,e):n},Xu.prototype.getTopIndentHeight=function(e,t,i){if(null==e)throw new Error("ArgumentNullException:document");if(null==t)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.top:0,n=null!=this.template.getTop(t)?this.template.getTop(t).height:0,e=null!=e.template.getTop(t)?e.template.getTop(t).height:0;return i+=this.template.applyDocumentTopTemplate?Math.max(n,e):n},Xu.prototype.getRightIndentWidth=function(e,t,i){if(null==e)throw new Error("ArgumentNullException:document");if(null==t)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.right:0,n=null!=this.template.getRight(t)?this.template.getRight(t).width:0,e=null!=e.template.getRight(t)?e.template.getRight(t).width:0;return i+=this.template.applyDocumentRightTemplate?Math.max(n,e):n},Xu.prototype.getBottomIndentHeight=function(e,t,i){if(null==e)throw new Error("ArgumentNullException:document");if(null==t)throw new Error("ArgumentNullException:page");var i=i?this.pageSettings.margins.bottom:0,n=null!=this.template.getBottom(t)?this.template.getBottom(t).height:0,e=null!=e.template.getBottom(t)?e.template.getBottom(t).height:0;return i+=this.template.applyDocumentBottomTemplate?Math.max(n,e):n},Xu.prototype.remove=function(e){if(null==e)throw Error('ArgumentNullException("page")');for(var t=this.pdfPages.indexOf(e),i=(this.pagesReferences.removeAt(t),[]),n=0;n<t;n++)i.push(this.pdfPages[n]);for(n=t+1;n<this.pdfPages.length;n++)i.push(this.pdfPages[n]);this.pdfPages=i},Xu.prototype.applyPageSettings=function(e,t,i){var n=new id(i.origin,i.size),n=(e.items.setValue(this.dictionaryProperties.mediaBox,Bl.fromRectangle(n)),Zu.rotateFactor*i.rotate),i=new kl(n);e.items.setValue(this.dictionaryProperties.rotate,i)},Xu.prototype.beginSave=function(e,t){t=t.document;this.applyPageSettings(this.section,t.pageSettings,e)},Xu.prototype.drawTemplates=function(e,t,i,n){var o=this.getDocumentTemplates(i,e,n),e=this.getSectionTemplates(e,n);this.drawTemplatesHelper(t,i,o),this.drawTemplatesHelper(t,i,e)},Xu.prototype.drawTemplatesHelper=function(e,t,i){if(null!=i&&0<i.length)for(var n=i.length,o=0;o<n;o++)i[o].draw(e,t)};var Yu=Xu;function Xu(e,t){this.pageAdded=new Vu,this.pdfPages=[],this.dictionaryProperties=new Cl,this.pdfDocument=e,this.settings=(void 0===t?e.pageSettings:t).clone(),this.initialSettings=this.settings.clone(),this.initialize()}Object.defineProperty(Ju.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(e){this.pageOrientation=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ju.prototype,"rotate",{get:function(){return this.pageRotate},set:function(e){this.pageRotate=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ju.prototype,"size",{get:function(){return this.pageSize},set:function(e){this.pageSize=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ju.prototype,"origin",{get:function(){return this.pageOrigin},set:function(e){this.pageOrigin=e},enumerable:!0,configurable:!0});var Ku=Ju;function Ju(e){this.pageOrientation=e.pageSettings.orientation,this.pageRotate=e.pageSettings.rotate,this.pageSize=e.pageSettings.size,this.pageOrigin=e.pageSettings.origin}Object.defineProperty($u.prototype,"section",{get:function(){return this.sections},enumerable:!0,configurable:!0}),Object.defineProperty($u.prototype,"document",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty($u.prototype,"count",{get:function(){return this.sections.length},enumerable:!0,configurable:!0}),Object.defineProperty($u.prototype,"element",{get:function(){return this.pages},enumerable:!0,configurable:!0}),$u.prototype.initialize=function(){this.sectionCount=new kl(0),this.sectionCollection=new Bl,this.pages=new Sl,this.pages.beginSave=new xl(this),this.pages.items.setValue(this.dictionaryProperties.type,new yl("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 Sl),this.setPageSettings(this.pages,this.pdfDocument.pageSettings)},$u.prototype.pdfSectionCollection=function(e){if(e<0||e>=this.count)throw new Error("IndexOutOfRangeException()");return this.sections[e]},$u.prototype.setPageSettings=function(e,t){t=new id(new ed,t.size);e.items.setValue(this.dictionaryProperties.mediaBox,Bl.fromRectangle(t))},$u.prototype.add=function(e){var t;return void 0===e?(t=new Yu(this.pdfDocument),this.add(t),t):(t=this.checkSection(e),this.sections.push(e),(e.parent=this).sectionCollection.add(t),this.sections.indexOf(e))},$u.prototype.checkSection=function(e){e=new Fh(e);this.sectionCollection.contains(e);return e},$u.prototype.countPages=function(){var t=0;return this.sections.forEach(function(e){return t+=e.count}),t},$u.prototype.beginSave=function(){this.sectionCount.intValue=this.countPages()},$u.rotateFactor=90;var Zu=$u;function $u(e){this.sections=[],this.dictionaryProperties=new Cl,this.pdfDocument=e.clone(),this.initialize()}Object.defineProperty(tg.prototype,"count",{get:function(){return this.countPages()},enumerable:!0,configurable:!0}),Object.defineProperty(tg.prototype,"pageCollectionIndex",{get:function(){return this.pdfPageCollectionIndex},enumerable:!0,configurable:!0}),tg.prototype.add=function(e){var t;if(void 0===e)return t=new Ou,this.add(t),t;this.getLastSection().add(e)},tg.prototype.getLastSection=function(){var e=this.document.sections;return 0===e.section.length&&e.add(),e.section[e.section.length-1]},tg.prototype.onPageAdded=function(e){},tg.prototype.countPages=function(){for(var e=this.document.sections,t=0,i=0;i<e.section.length;i++)t+=e.section[i].count;return t},tg.prototype.getPageByIndex=function(e){return this.getPage(e)},tg.prototype.getPage=function(e){if(e<0||e>=this.count)throw Error('ArgumentOutOfRangeException("index", "Value can not be less 0")');for(var t=null,i=0,n=this.document.sections.count,o=0;o<n;o++){var r=this.document.sections.section[o],s=r.count,a=e-i;if(i<=e&&a<s){t=r.getPages()[a];break}i+=s}return t},tg.prototype.indexOf=function(e){var t=-1;if(null==e)throw new Error("ArgumentNullException: page");for(var i=0,n=0,o=this.document.sections.count;n<o;n++){var r=this.document.sections.pdfSectionCollection(n);if(0<=(t=r.indexOf(e))){t+=i;break}t=-1,i+=r.count}return t},tg.prototype.remove=function(e){if(null==e)throw Error('ArgumentNullException("page")');for(var t=null,i=0,n=this.document.sections.count;i<n;i++)if((t=this.document.sections.pdfSectionCollection(i)).pages.contains(e)){t.pages.remove(e);break}return t};var eg=tg;function tg(e){this.pdfPageCollectionIndex=new ml,this.document=e}ng.prototype.search=function(e){var t=null,i=this.getGroup(e);return null==i?i=this.createNewGroup():0<i.length&&(t=i[0]),i.push(e),t},ng.prototype.createNewGroup=function(){var e=[];return this.referenceObjects.push(e),e},ng.prototype.getGroup=function(e){var t=null;if(null!==e)for(var i=this.referenceObjects.length,n=0;n<i;n++){if(0<this.referenceObjects.length){var o=this.referenceObjects[n];if(0<o.length){var r=o[0];if(e.equalsTo(r)){t=o;break}}else this.removeGroup(o)}i=this.referenceObjects.length}return t},ng.prototype.removeGroup=function(e){null!==e&&(e=this.referenceObjects.indexOf(e),this.referenceObjects.slice(e,e+1))},ng.prototype.destroy=function(){this.pdfFontCollection=void 0,this.referenceObjects=void 0};var ig=ng;function ng(){this.referenceObjects=[],this.pdfFontCollection=new ml}og=function(e,t){return(og=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}og(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ag,rg=Xd),Object.defineProperty(ag,"defaultFont",{get:function(){return null==this.defaultStandardFont&&(this.defaultStandardFont=new cg(dd.Helvetica,8)),this.defaultStandardFont},enumerable:!0,configurable:!0}),Object.defineProperty(ag.prototype,"sections",{get:function(){return this.sectionCollection},enumerable:!0,configurable:!0}),Object.defineProperty(ag.prototype,"pageSettings",{get:function(){return null==this.settings&&(this.settings=new Ap(this.defaultMargin)),this.settings},set:function(e){this.settings=e},enumerable:!0,configurable:!0}),Object.defineProperty(ag.prototype,"pages",{get:function(){return this.documentPageCollection},enumerable:!0,configurable:!0}),Object.defineProperty(ag,"cache",{get:function(){return void 0===ag.cacheCollection||null==ag.cacheCollection?new ig:ag.cacheCollection},set:function(e){this.cacheCollection=e},enumerable:!0,configurable:!0}),Object.defineProperty(ag,"enableCache",{get:function(){return this.isCacheEnabled},set:function(e){this.isCacheEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(ag.prototype,"colorSpace",{get:function(){return this.pdfColorSpace===qh.Rgb||this.pdfColorSpace===qh.Cmyk||this.pdfColorSpace===qh.GrayScale?this.pdfColorSpace:qh.Rgb},set:function(e){e===qh.Rgb||e===qh.Cmyk||e===qh.GrayScale?this.pdfColorSpace=e:this.pdfColorSpace=qh.Rgb},enumerable:!0,configurable:!0}),Object.defineProperty(ag.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new ju),this.pageTemplate},set:function(e){this.pageTemplate=e},enumerable:!0,configurable:!0}),ag.prototype.docSave=function(e,t,i){if(this.checkPagesPresence(),null===e)throw new Error("ArgumentNullException : stream");this.streamWriter=e;e=new Nd(e);if(e.document=this,"boolean"==typeof t&&void 0===i)return this.crossTable.save(e);this.crossTable.save(e,t)},ag.prototype._docSave=function(){var e=new _d;if(this.checkPagesPresence(),null===e)throw new Error("ArgumentNullException : stream");this.streamWriter=e;e=new Nd(e);return(e.document=this).crossTable._save(e)},ag.prototype.checkPagesPresence=function(){0===this.pages.count&&this.pages.add()},ag.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,ag.cache.destroy(),this.crossTable.pdfObjects.destroy(),ag.cache=void 0,this.streamWriter&&this.streamWriter.destroy()},ag.defaultStandardFont=null,ag.isCacheEnabled=!0;var og,rg,sg=ag;function ag(e){var t=rg.call(this)||this,i=(t.defaultMargin=40,t.streamWriter=null,t.document=t,!1),i=void 0===e?(ag.cacheCollection=new ig,!1):e,e=new Qd,n=(t.setMainObjectCollection(e),new hp),i=(n.isMerging=i,(n.document=t).setCrossTable(n),new ap);return t.setCatalog(i),e.add(i),i.position=-1,t.sectionCollection=new Zu(t),t.documentPageCollection=new eg(t),i.pages=t.sectionCollection,t}hg.getMetrics=function(e,t,i){var n=null;switch(e){case dd.Helvetica:n=this.getHelveticaMetrics(e,t,i);break;case dd.Courier:n=this.getCourierMetrics(e,t,i);break;case dd.TimesRoman:n=this.getTimesMetrics(e,t,i);break;case dd.Symbol:n=this.getSymbolMetrics(e,t,i);break;case dd.ZapfDingbats:n=this.getZapfDingbatsMetrics(e,t,i);break;default:n=this.getHelveticaMetrics(dd.Helvetica,t,i)}return n.name=e.toString(),n.subScriptSizeFactor=this.subSuperScriptFactor,n.superscriptSizeFactor=this.subSuperScriptFactor,n},hg.getHelveticaMetrics=function(e,t,i){var n=new Bc;return 0<(t&hd.Bold)&&0<(t&hd.Italic)?(n.ascent=this.helveticaBoldItalicAscent,n.descent=this.helveticaBoldItalicDescent,n.postScriptName=this.helveticaBoldItalicName,n.size=i,n.widthTable=new Nc(this.arialBoldWidth)):0<(t&hd.Bold)?(n.ascent=this.helveticaBoldAscent,n.descent=this.helveticaBoldDescent,n.postScriptName=this.helveticaBoldName,n.size=i,n.widthTable=new Nc(this.arialBoldWidth)):(0<(t&hd.Italic)?(n.ascent=this.helveticaItalicAscent,n.descent=this.helveticaItalicDescent,n.postScriptName=this.helveticaItalicName):(n.ascent=this.helveticaAscent,n.descent=this.helveticaDescent,n.postScriptName=this.helveticaName),n.size=i,n.widthTable=new Nc(this.arialWidth)),n.height=n.ascent-n.descent,n},hg.getCourierMetrics=function(e,t,i){var n=new Bc;return 0<(t&hd.Bold)&&0<(t&hd.Italic)?(n.ascent=this.courierBoldItalicAscent,n.descent=this.courierBoldItalicDescent,n.postScriptName=this.courierBoldItalicName):0<(t&hd.Bold)?(n.ascent=this.courierBoldAscent,n.descent=this.courierBoldDescent,n.postScriptName=this.courierBoldName):0<(t&hd.Italic)?(n.ascent=this.courierItalicAscent,n.descent=this.courierItalicDescent,n.postScriptName=this.courierItalicName):(n.ascent=this.courierAscent,n.descent=this.courierDescent,n.postScriptName=this.courierName),n.size=i,n.widthTable=new Nc(this.fixedWidth),n.height=n.ascent-n.descent,n},hg.getTimesMetrics=function(e,t,i){var n=new Bc;return 0<(t&hd.Bold)&&0<(t&hd.Italic)?(n.ascent=this.timesBoldItalicAscent,n.descent=this.timesBoldItalicDescent,n.postScriptName=this.timesBoldItalicName,n.size=i,n.widthTable=new Nc(this.timesRomanBoldItalicWidths)):0<(t&hd.Bold)?(n.ascent=this.timesBoldAscent,n.descent=this.timesBoldDescent,n.postScriptName=this.timesBoldName,n.size=i,n.widthTable=new Nc(this.timesRomanBoldWidth)):0<(t&hd.Italic)?(n.ascent=this.timesItalicAscent,n.descent=this.timesItalicDescent,n.postScriptName=this.timesItalicName,n.size=i,n.widthTable=new Nc(this.timesRomanItalicWidth)):(n.ascent=this.timesAscent,n.descent=this.timesDescent,n.postScriptName=this.timesName,n.size=i,n.widthTable=new Nc(this.timesRomanWidth)),n.height=n.ascent-n.descent,n},hg.getSymbolMetrics=function(e,t,i){var n=new Bc;return n.ascent=this.symbolAscent,n.descent=this.symbolDescent,n.postScriptName=this.symbolName,n.size=i,n.widthTable=new Nc(this.symbolWidth),n.height=n.ascent-n.descent,n},hg.getZapfDingbatsMetrics=function(e,t,i){var n=new Bc;return n.ascent=this.zapfDingbatsAscent,n.descent=this.zapfDingbatsDescent,n.postScriptName=this.zapfDingbatsName,n.size=i,n.widthTable=new Nc(this.zapfDingbatsWidth),n.height=n.ascent-n.descent,n},hg.subSuperScriptFactor=1.52,hg.helveticaAscent=931,hg.helveticaDescent=-225,hg.helveticaName="Helvetica",hg.helveticaBoldAscent=962,hg.helveticaBoldDescent=-228,hg.helveticaBoldName="Helvetica-Bold",hg.helveticaItalicAscent=931,hg.helveticaItalicDescent=-225,hg.helveticaItalicName="Helvetica-Oblique",hg.helveticaBoldItalicAscent=962,hg.helveticaBoldItalicDescent=-228,hg.helveticaBoldItalicName="Helvetica-BoldOblique",hg.courierAscent=805,hg.courierDescent=-250,hg.courierName="Courier",hg.courierBoldAscent=801,hg.courierBoldDescent=-250,hg.courierBoldName="Courier-Bold",hg.courierItalicAscent=805,hg.courierItalicDescent=-250,hg.courierItalicName="Courier-Oblique",hg.courierBoldItalicAscent=801,hg.courierBoldItalicDescent=-250,hg.courierBoldItalicName="Courier-BoldOblique",hg.timesAscent=898,hg.timesDescent=-218,hg.timesName="Times-Roman",hg.timesBoldAscent=935,hg.timesBoldDescent=-218,hg.timesBoldName="Times-Bold",hg.timesItalicAscent=883,hg.timesItalicDescent=-217,hg.timesItalicName="Times-Italic",hg.timesBoldItalicAscent=921,hg.timesBoldItalicDescent=-218,hg.timesBoldItalicName="Times-BoldItalic",hg.symbolAscent=1010,hg.symbolDescent=-293,hg.symbolName="Symbol",hg.zapfDingbatsAscent=820,hg.zapfDingbatsDescent=-143,hg.zapfDingbatsName="ZapfDingbats",hg.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],hg.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],hg.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],hg.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],hg.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],hg.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],hg.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],hg.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],hg.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];var lg=hg;function hg(){}dg=function(e,t){return(dg=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}dg(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ug,pg=Rd),Object.defineProperty(ug.prototype,"fontFamily",{get:function(){return this.pdfFontFamily},enumerable:!0,configurable:!0}),ug.prototype.checkStyle=function(){var e;this.fontFamily!==dd.Symbol&&this.fontFamily!==dd.ZapfDingbats||(e=this.style,e&=~(hd.Bold|hd.Italic),this.setStyle(e))},ug.prototype.getLineWidth=function(e,t){if(null==e)throw new Error("ArgumentNullException:line");for(var i=0,n=(this.name,0),o=(e=ug.convert(e)).length;n<o;n++){var r=e[n];i+=this.getCharWidthInternal(r,t)}var s=this.metrics.getSize(t);return i=this.applyFormatSettings(e,t,i*=Rd.charSizeMultiplier*s)},ug.prototype.equalsToFont=function(e){var t,i,n=!1;return null!=e&&(t=this.fontFamily===e.fontFamily,i=~(hd.Underline|hd.Strikeout),e=(this.style&i)==(e.style&i),n=t&&e),n},ug.prototype.initializeInternals=function(){sg.cache.search(this);var e=lg.getMetrics(this.pdfFontFamily,this.style,this.size);this.metrics=e,e=this.createInternals(),this.setInternals(e)},ug.prototype.createInternals=function(){var e,t=new Sl;return t.items.setValue(this.dictionaryProperties.type,new yl(this.dictionaryProperties.font)),t.items.setValue(this.dictionaryProperties.subtype,new yl(this.dictionaryProperties.type1)),t.items.setValue(this.dictionaryProperties.baseFont,new yl(this.metrics.postScriptName)),this.fontFamily!==dd.Symbol&&this.fontFamily!==dd.ZapfDingbats&&(e=this.encodings[gd.WinAnsiEncoding],t.items.setValue(this.dictionaryProperties.encoding,new yl(e))),t},ug.prototype.getCharWidthInternal=function(e,t){var i=0,i=e.charCodeAt(0);return"0"!==this.name&&"1"!==this.name&&"2"!==this.name&&"3"!==this.name&&"4"!==this.name||(i-=ug.charOffset),this.metrics.widthTable.items(i=0<=i&&128!==i?i:0)},ug.convert=function(e){return e},ug.charOffset=32;var dg,pg,cg=ug;function ug(e,t,i){t=pg.call(this,t,void 0===i?e instanceof ug?e.style:hd.Regular:i)||this;return t.dictionaryProperties=new Cl,t.encodings=["Unknown","StandardEncoding","MacRomanEncoding","MacExpertEncoding","WinAnsiEncoding","PDFDocEncoding","IdentityH"],t.pdfFontFamily=void 0===e?dd.Helvetica:e instanceof ug?e.fontFamily:e,t.checkStyle(),t.initializeInternals(),t}Object.defineProperty(mg.prototype,"color",{get:function(){return this.pdfColor},set:function(e){this.pdfColor=e},enumerable:!0,configurable:!0}),Object.defineProperty(mg.prototype,"innerColor",{get:function(){return this.internalColor},set:function(e){this.internalColor=e},enumerable:!0,configurable:!0}),Object.defineProperty(mg.prototype,"bounds",{get:function(){return this.rectangle},set:function(e){this.rectangle=e},enumerable:!0,configurable:!0}),Object.defineProperty(mg.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(mg.prototype,"font",{get:function(){return this.textFont},set:function(e){this.textFont=e},enumerable:!0,configurable:!0}),Object.defineProperty(mg.prototype,"stringFormat",{get:function(){return this.format},set:function(e){this.format=e},enumerable:!0,configurable:!0}),Object.defineProperty(mg.prototype,"brush",{get:function(){return this.textBrush},set:function(e){this.textBrush=e},enumerable:!0,configurable:!0}),Object.defineProperty(mg.prototype,"text",{get:function(){return this.content},set:function(e){this.content=e,this.dictionary.items.setValue(this.dictionaryProperties.contents,new Mh(this.content))},enumerable:!0,configurable:!0}),Object.defineProperty(mg.prototype,"dictionary",{get:function(){return this.pdfDictionary},set:function(e){this.pdfDictionary=e},enumerable:!0,configurable:!0}),mg.prototype.initialize=function(){this.pdfDictionary.annotationBeginSave=new El(this),this.pdfDictionary.items.setValue(this.dictionaryProperties.type,new yl(this.dictionaryProperties.annot))},mg.prototype.setPage=function(e){this.pdfPage=e,this.pdfDictionary.items.setValue(this.dictionaryProperties.p,new Fh(this.pdfPage))},mg.prototype.beginSave=function(){this.save()},mg.prototype.save=function(){var e=new id(this.rectangle.x,this.rectangle.y,this.rectangle.width,this.rectangle.height),t=this.pdfPage.section,i=e.height,t=t.pointToNativePdf(this.page,new ed(e.x,e.y));e.x=t.x,e.width=t.x+e.width,e.y=t.y-this.page.document.pageSettings.margins.top,e.height=e.y-i,this.pdfDictionary.items.setValue(this.dictionaryProperties.rect,Bl.fromRectangle(e)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new kl(this.darkness))},Object.defineProperty(mg.prototype,"element",{get:function(){return this.pdfDictionary},enumerable:!0,configurable:!0});var gg=mg;function mg(e){this.dictionaryProperties=new Cl,this.pdfColor=new se(255,255,255),this.rectangle=new id(0,0,0,0),this.pdfPage=null,this.textBrush=new Sd(new se(0,0,0)),this.textFont=new cg(dd.TimesRoman,10),this.format=new xd(Hh.Left),this.content="",this.pdfDictionary=new Sl,this.internalColor=new se,this.darkness=1,void 0===e?this.initialize():(this.initialize(),this.bounds=e)}fg=function(e,t){return(fg=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}fg(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(bg,yg=gg),bg.prototype.initialize=function(){yg.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new yl(this.dictionaryProperties.link))};var fg,yg,vg=bg;function bg(e){return yg.call(this,e)||this}wg=function(e,t){return(wg=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}wg(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ag,Cg=vg),Ag.prototype.getSetAction=function(e){if(void 0===e)return this.pdfAction;this.pdfAction=e};var wg,Cg,Sg=Ag;function Ag(e){e=Cg.call(this,e)||this;return e.pdfAction=null,e}xg=function(e,t){return(xg=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}xg(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Eg,Ig=vg),Object.defineProperty(Eg.prototype,"destination",{get:function(){return this.pdfDestination},set:function(e){this.pdfDestination=e},enumerable:!0,configurable:!0}),Eg.prototype.save=function(){Ig.prototype.save.call(this),null!=this.pdfDestination&&this.dictionary.items.setValue(this.dictionaryProperties.dest,this.pdfDestination.element)},Eg.prototype.clone=function(){var e=new Eg(this.bounds,this.destination);return e.color=this.color,e.brush=this.brush,e.destination=this.destination,e.font=this.font,e};var xg,Ig,Tg=Eg;function Eg(e,t){e=Ig.call(this,e)||this;return e.pdfDestination=null,void 0!==t&&(e.destination=t),e}Object.defineProperty(Mg.prototype,"elements",{get:function(){return this.layoutElement},enumerable:!0,configurable:!0}),Mg.prototype.getElement=function(){return this.layoutElement},Mg.prototype.layout=function(e){return this.layoutInternal(e)},Mg.prototype.Layouter=function(e){return this.layoutInternal(e)},Mg.prototype.getNextPage=function(e){return e.section.add()},Mg.prototype.getPaginateBounds=function(e){if(null==e)throw new Error("ArgumentNullException : param");return e.format.usePaginateBounds?e.format.paginateBounds:new id(e.bounds.x,0,e.bounds.width,e.bounds.height)};var Dg=Mg;function Mg(e){this.layoutElement=e}Object.defineProperty(Pg.prototype,"layout",{get:function(){return this.layoutType},set:function(e){this.layoutType=e},enumerable:!0,configurable:!0}),Object.defineProperty(Pg.prototype,"break",{get:function(){return this.breakType},set:function(e){this.breakType=e},enumerable:!0,configurable:!0}),Object.defineProperty(Pg.prototype,"paginateBounds",{get:function(){return void 0===this.layoutPaginateBounds&&null==this.layoutPaginateBounds&&(this.layoutPaginateBounds=new id(0,0,0,0)),this.layoutPaginateBounds},set:function(e){this.layoutPaginateBounds=e,this.boundsSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(Pg.prototype,"usePaginateBounds",{get:function(){return this.boundsSet},enumerable:!0,configurable:!0});var kg=Pg;function Pg(e){void 0!==e&&(this.break=e.break,this.layout=e.layout,this.paginateBounds=e.paginateBounds,this.boundsSet=e.usePaginateBounds)}Object.defineProperty(Fg.prototype,"page",{get:function(){return this.pdfPage},set:function(e){this.pdfPage=e},enumerable:!0,configurable:!0}),Object.defineProperty(Fg.prototype,"bounds",{get:function(){return new id(this.layoutBounds.x,this.layoutBounds.y,this.layoutBounds.width,this.layoutBounds.height)},set:function(e){this.layoutBounds=e},enumerable:!0,configurable:!0}),Object.defineProperty(Fg.prototype,"format",{get:function(){return this.layoutFormat},set:function(e){this.layoutFormat=e},enumerable:!0,configurable:!0});var Bg=Fg;function Fg(){}Object.defineProperty(Rg.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(Rg.prototype,"bounds",{get:function(){return this.layoutBounds},enumerable:!0,configurable:!0});var Lg=Rg;function Rg(e,t){this.pdfPage=e,this.layoutBounds=t}Object.defineProperty(Ng.prototype,"left",{get:function(){return this.leftPen},set:function(e){this.leftPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ng.prototype,"right",{get:function(){return this.rightPen},set:function(e){this.rightPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ng.prototype,"top",{get:function(){return this.topPen},set:function(e){this.topPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ng.prototype,"bottom",{get:function(){return this.bottomPen},set:function(e){this.bottomPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ng.prototype,"all",{set:function(e){this.leftPen=this.rightPen=this.topPen=this.bottomPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ng.prototype,"isAll",{get:function(){return this.leftPen===this.rightPen&&this.leftPen===this.topPen&&this.leftPen===this.bottomPen},enumerable:!0,configurable:!0}),Object.defineProperty(Ng,"default",{get:function(){return new Ng},enumerable:!0,configurable:!0});var Og=Ng;function Ng(){var e=new Ep(new se(0,0,0)),t=(e.dashStyle=Qh.Solid,new Ep(new se(0,0,0))),i=(t.dashStyle=Qh.Solid,new Ep(new se(0,0,0))),n=(i.dashStyle=Qh.Solid,new Ep(new se(0,0,0)));n.dashStyle=Qh.Solid,this.leftPen=e,this.rightPen=t,this.topPen=i,this.bottomPen=n}Object.defineProperty(_g.prototype,"left",{get:function(){return this.leftPad},set:function(e){this.leftPad=e,this.hasLeftPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(_g.prototype,"right",{get:function(){return this.rightPad},set:function(e){this.rightPad=e,this.hasRightPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(_g.prototype,"top",{get:function(){return this.topPad},set:function(e){this.topPad=e,this.hasTopPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(_g.prototype,"bottom",{get:function(){return this.bottomPad},set:function(e){this.bottomPad=e,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(_g.prototype,"all",{set:function(e){this.leftPad=this.rightPad=this.topPad=this.bottomPad=e,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0},enumerable:!0,configurable:!0});var Vg=_g;function _g(e,t,i,n){this.hasLeftPad=!1,this.hasRightPad=!1,this.hasTopPad=!1,this.hasBottomPad=!1,void 0===e?this.bottomPad=this.topPad=this.leftPad=this.rightPad=.5:(this.leftPad=e,this.rightPad=t,this.topPad=i,this.bottomPad=n,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0)}Object.defineProperty(zg.prototype,"raiseBeginPageLayout",{get:function(){return void 0!==this.beginPageLayout},enumerable:!0,configurable:!0}),Object.defineProperty(zg.prototype,"raiseEndPageLayout",{get:function(){return void 0!==this.endPageLayout},enumerable:!0,configurable:!0}),zg.prototype.onBeginPageLayout=function(e){this.beginPageLayout&&this.beginPageLayout(this,e)},zg.prototype.onEndPageLayout=function(e){this.endPageLayout&&this.endPageLayout(this,e)},zg.prototype.drawHelper=function(e,t,i,n){var o;return t instanceof ed&&void 0===t.width&&void 0===i?this.drawHelper(e,t.x,t.y):"number"==typeof t&&"number"==typeof i&&void 0===n?this.drawHelper(e,t,i,null):t instanceof id&&void 0!==t.width&&void 0===i?this.drawHelper(e,t,null):t instanceof ed&&void 0===t.width&&i instanceof kg?this.drawHelper(e,t.x,t.y,i):"number"==typeof t&&"number"==typeof i&&(n instanceof kg||null==n)?(o=e.graphics.clientSize.width-t,o=new id(t,i,o,0),this.drawHelper(e,o,n)):t instanceof id&&void 0!==t.width&&"boolean"==typeof i?(this.bEmbedFonts=i,this.drawHelper(e,t,null)):(o=t,n=i,(t=new Bg).page=e,t.bounds=o,null!=t&&(i=t.bounds.x,e=t.bounds.y,0===t.bounds.x&&(i=Og.default.right.width/2),0===t.bounds.y&&(e=Og.default.top.width/2),o=new id(i,e,t.bounds.width,t.bounds.height),t.bounds=o),t.format=null!=n?n:new kg,this.layout(t))};var Hg=zg;function zg(){}jg=function(e,t){return(jg=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])}))(e,t)};var jg,Wg,Qg=function(e,t){function i(){this.constructor=e}jg(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ug=(Qg(qg,Wg=Dg),Object.defineProperty(qg.prototype,"element",{get:function(){return Wg.prototype.getElement.call(this)},enumerable:!0,configurable:!0}),qg.prototype.layoutInternal=function(e){this.format=null!==this.element.stringFormat&&void 0!==this.element.stringFormat?this.element.stringFormat:null;var t=e.page,i=e.bounds,n=this.element.value,o=null,r=new Yg;for(r.page=t,r.remainder=n;;){r=this.layoutOnPage(n,t,i,e),o=this.getLayoutResult(r);break}return o},qg.prototype.getLayoutResult=function(e){return new Xg(e.page,e.bounds,e.remainder,e.lastLineBounds)},qg.prototype.layoutOnPage=function(e,t,i,n){var o=new Yg;o.remainder=e,o.page=t,i=this.checkCorrectBounds(t,i);var e=(new Dd).layout(e,this.element.font,this.format,i,t.getClientSize().height,!1,new td(0,0)),r=null==e.remainder,n=(n.format.break!==Kc.FitElement&&e.empty,t.graphics),s=this.element.getBrush();this.element instanceof am&&(s.color=new se(0,0,255),!this.element._isLastElement)&&this.element.stringFormat&&this.element.stringFormat.alignment===Hh.Justify&&(e.layoutLines[0].type=Bd.LayoutBreak|Bd.FirstParagraphLine),this.element&&this.element instanceof $g&&!this.element._isLastElement&&this.element.stringFormat&&this.element.stringFormat.alignment===Hh.Justify&&(e.layoutLines[0].type=Bd.LayoutBreak|Bd.FirstParagraphLine),n.drawStringLayoutResult(e,this.element.font,this.element.pen,s,i,this.format),e.lines[e.lineCount-1];return o.lastLineBounds=n.getLineBounds(e.lineCount-1,e,this.element.font,i,this.format),o.bounds=this.getTextPageBounds(t,i,e),o.remainder=e.remainder,o.end=r,o},qg.prototype.checkCorrectBounds=function(e,t){e=e.graphics.clientSize;return t.height=0<t.height?t.height:e.height-t.y,t},qg.prototype.getTextPageBounds=function(e,t,i){var i=i.actualSize,n=(t.x,t.y),o=(0<t.width?t:i).width,r=i.height,s=e.graphics.checkCorrectLayoutRectangle(i,t.x,t.y,this.format).x,e=e.graphics.getTextVerticalAlignShift(i.height,t.height,this.format);return new id(s,n+=e,o,r)},qg);function qg(e){return Wg.call(this,e)||this}var Gg,Yg=function(){},Xg=(Qg(Kg,Gg=Lg),Object.defineProperty(Kg.prototype,"remainder",{get:function(){return this.remainderText},enumerable:!0,configurable:!0}),Object.defineProperty(Kg.prototype,"lastLineBounds",{get:function(){return this.lastLineTextBounds},enumerable:!0,configurable:!0}),Kg);function Kg(e,t,i,n){e=Gg.call(this,e,t)||this;return e.remainderText=i,e.lastLineTextBounds=n,e}Jg=function(e,t){return(Jg=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Jg(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(em,Zg=Hg),Object.defineProperty(em.prototype,"text",{get:function(){return this.content},set:function(e){this.elementValue=e,this.content=e},enumerable:!0,configurable:!0}),Object.defineProperty(em.prototype,"value",{get:function(){return this.elementValue},enumerable:!0,configurable:!0}),Object.defineProperty(em.prototype,"pen",{get:function(){return this.pdfPen},set:function(e){this.pdfPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(em.prototype,"brush",{get:function(){return this.pdfBrush},set:function(e){this.pdfBrush=e},enumerable:!0,configurable:!0}),Object.defineProperty(em.prototype,"font",{get:function(){return this.pdfFont},set:function(e){this.pdfFont=e,this.pdfFont instanceof cg&&null!=this.content?this.elementValue=cg.convert(this.content):this.elementValue=this.content},enumerable:!0,configurable:!0}),Object.defineProperty(em.prototype,"stringFormat",{get:function(){return this.format},set:function(e){this.format=e},enumerable:!0,configurable:!0}),em.prototype.getBrush=function(){return null==this.pdfBrush||void 0===this.pdfBrush?new Sd(new se(0,0,0)):this.pdfBrush},em.prototype.layout=function(e){return new Ug(this).layout(e)},em.prototype.drawText=function(e,t,i,n){if(t instanceof ed&&void 0===t.width&&void 0===i)return this.hasPointOverload=!0,this.drawText(e,t.x,t.y);if("number"==typeof t&&"number"==typeof i&&void 0===n)return this.hasPointOverload=!0,this.drawText(e,t,i,null);if(t instanceof id&&void 0!==t.width&&void 0===i)return this.drawText(e,t,null);if(t instanceof ed&&void 0===t.width&&i instanceof kg)return this.hasPointOverload=!0,this.drawText(e,t.x,t.y,i);if("number"==typeof t&&"number"==typeof i&&(n instanceof kg||null==n))return this.hasPointOverload=!0,o=e.graphics.clientSize.width-t,o=new id(t,i,o,0),this.drawText(e,o,n);if(t instanceof id&&void 0!==t.width&&"boolean"==typeof i)return this.drawText(e,t,null);var o=new Dd;if(this.hasPointOverload){var r=o.layout(this.value,this.font,this.stringFormat,new td(e.graphics.clientSize.width-t.x,0),!0,e.graphics.clientSize),s=void 0,a=t,l=i;if((c=new Bg).page=e,c.bounds=a,c.format=null!=l?l:new kg,1<r.lines.length){if(this.text=r.layoutLines[0].text,c.bounds.y<=c.page.graphics.clientSize.height)for(var h=new ed(c.bounds.x,c.bounds.y),d=(s=this.layout(c),new id(0,s.bounds.y+r.lineHeight,e.graphics.clientSize.width,r.lineHeight)),p=1;p<r.lines.length;p++)c.page=s.page,c.bounds=new id(new ed(d.x,d.y),new td(d.width,d.height)),this.text=r.layoutLines[p].text,d.y+r.lineHeight>s.page.graphics.clientSize.height&&(c.page=c.page.graphics.getNextPage(),d=h.y>s.page.graphics.clientSize.height-s.bounds.height?new id(0,s.bounds.height,s.page.graphics.clientSize.width,r.lineHeight):new id(0,0,s.page.graphics.clientSize.width,r.lineHeight),c.bounds=d),p===r.lines.length-1&&(this._isLastElement=!0),s=this.layout(c),p!==r.lines.length-1?d=new id(0,s.bounds.y+r.lineHeight,s.page.graphics.clientSize.width,r.lineHeight):(m=this.font.measureString(this.text,this.format).width,s=this.calculateResultBounds(s,m,s.page.graphics.clientSize.width,0))}else u=this.font.measureString(this.text,this.format),c.bounds.y<=c.page.graphics.clientSize.height&&(s=this.layout(c),s=this.calculateResultBounds(s,u.width,s.page.graphics.clientSize.width,0));return s}var c,u,s=o.layout(this.value,this.font,this.stringFormat,new td(t.width,0),!1,e.graphics.clientSize),g=void 0,a=t,l=i;if((c=new Bg).page=e,c.bounds=a,c.format=null!=l?l:new kg,1<s.lines.length){if(this.text=s.layoutLines[0].text,c.bounds.y<=c.page.graphics.clientSize.height)for(var m,h=new ed(c.bounds.x,c.bounds.y),d=(g=this.layout(c),new id(a.x,g.bounds.y+s.lineHeight,a.width,s.lineHeight)),p=1;p<s.lines.length;p++)c.page=g.page,c.bounds=new id(d.x,d.y,d.width,d.height),this.text=s.layoutLines[p].text,d.y+s.lineHeight>g.page.graphics.clientSize.height&&(c.page=c.page.graphics.getNextPage(),d=h.y>g.page.graphics.clientSize.height-g.bounds.height?new id(a.x,s.lineHeight,a.width,s.lineHeight):new id(a.x,0,a.width,s.lineHeight),c.bounds=d),g=this.layout(c),p!==s.lines.length-1?d=new id(a.x,g.bounds.y+s.lineHeight,a.width,s.lineHeight):(m=this.font.measureString(this.text,this.format).width,g=this.calculateResultBounds(g,m,a.width,a.x))}else u=this.font.measureString(this.text,this.format),c.bounds.y<=c.page.graphics.clientSize.height&&(g=this.layout(c),g=this.calculateResultBounds(g,u.width,a.width,a.x));return g},em.prototype.calculateResultBounds=function(e,t,i,n){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Hh.Center?(e.bounds.x=n+(i-t)/2,e.bounds.width=t):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Hh.Right?(e.bounds.x=n+(i-t),e.bounds.width=t):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Hh.Justify?(e.bounds.x=n,e.bounds.width=i):(e.bounds.width=n,e.bounds.width=t),e};var Jg,Zg,$g=em;function em(e,t,i,n,o){var r=Zg.call(this)||this;return r.content="",r.elementValue="",r.hasPointOverload=!1,r._isLastElement=!1,r.isPdfTextElement=!1,void 0!==e&&("string"==typeof e&&void 0===t?(r.content=e,r.elementValue=e):"string"==typeof e&&t instanceof Rd&&void 0===i?(r.content=e,r.elementValue=e,r.pdfFont=t):"string"==typeof e&&t instanceof Rd&&i instanceof Ep&&void 0===n?(r.content=e,r.elementValue=e,r.pdfFont=t,r.pdfPen=i):"string"==typeof e&&t instanceof Rd&&i instanceof rd&&void 0===n?(r.content=e,r.elementValue=e,r.pdfFont=t,r.pdfBrush=i):(r.content=e,r.elementValue=e,r.pdfFont=t,r.pdfPen=i,r.pdfBrush=n,r.format=o)),r}tm=function(e,t){return(tm=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}tm(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(om,im=Sg),Object.defineProperty(om.prototype,"uriAction",{get:function(){return void 0===this.pdfUriAction&&(this.pdfUriAction=new Jh),this.pdfUriAction},enumerable:!0,configurable:!0}),Object.defineProperty(om.prototype,"uri",{get:function(){return this.uriAction.uri},set:function(e){this.uriAction.uri!==e&&(this.uriAction.uri=e)},enumerable:!0,configurable:!0}),Object.defineProperty(om.prototype,"action",{get:function(){return this.getSetAction()},set:function(e){this.getSetAction(e),this.uriAction.next=e},enumerable:!0,configurable:!0}),om.prototype.initialize=function(){im.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new yl(this.dictionaryProperties.link));this.uriAction.element;this.dictionary.items.setValue(this.dictionaryProperties.a,this.uriAction.element)};var tm,im,nm=om;function om(e,t){e=im.call(this,e)||this;return void 0!==t&&(e.uri=t),e}rm=function(e,t){return(rm=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}rm(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(lm,sm=$g),Object.defineProperty(lm.prototype,"url",{get:function(){return this.uniformResourceLocator},set:function(e){if(0===e.length)throw new Error("ArgumentException : Url - string can not be empty");this.uniformResourceLocator=e},enumerable:!0,configurable:!0}),lm.prototype.draw=function(e,t){var i,n,o,r,s,a;return e instanceof Ou?(a=new Dd,i=this.font.style,t instanceof ed?(this.recalculateBounds=!0,this.font.style=hd.Underline,s=1===(n=a.layout(this.value,this.font,this.stringFormat,new td(e.graphics.clientSize.width-t.x,0),!0,e.graphics.clientSize)).lines.length?(o=this.font.measureString(this.value),r=new id(t,o),r=this.calculateBounds(r,o.width,e.graphics.clientSize.width,t.x),this.uriAnnotation=new nm(r,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),this.drawText(e,t)):this.drawMultipleLineWithPoint(n,e,t),this.font.style=i,s):(n=a.layout(this.value,this.font,this.stringFormat,new td(t.width,0),!1,new td(0,0)),this.font.style=hd.Underline,s=1===n.lines.length?(o=this.font.measureString(this.value),r=new id(new ed(t.x,t.y),o),r=this.calculateBounds(r,o.width,t.width,t.x),this.uriAnnotation=new nm(r,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),this.drawText(e,t)):this.drawMultipleLineWithBounds(n,e,t),this.font.style=i,s)):(a=new Ou,a=e.page,this.draw(a,t))},lm.prototype.drawMultipleLineWithPoint=function(e,t,i){for(var n,o=0;o<e.layoutLines.length;o++){var r=this.font.measureString(e.lines[o].text),s=(o===e.layoutLines.length-1&&this.stringFormat&&this.stringFormat.alignment===Hh.Justify&&(this._isLastElement=!0),new id(i,r));if(0!==o&&(s.x=0),this.text=e.lines[o].text,s.y+r.height>t.graphics.clientSize.height){if(0===o)break;t=t.graphics.getNextPage(),s=new id(0,0,t.graphics.clientSize.width,r.height),i.y=0}s=this.calculateBounds(s,r.width,t.graphics.clientSize.width,s.x),this.uriAnnotation=new nm(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),t.annotations.add(this.uriAnnotation),n=0!==o?this.drawText(t,new ed(0,s.y)):this.drawText(t,s.x,s.y),i.y+=r.height}return n},lm.prototype.drawMultipleLineWithBounds=function(e,t,i){for(var n,o=0;o<e.layoutLines.length;o++){var r=this.font.measureString(e.lines[o].text),s=new id(new ed(i.x,i.y),r),s=this.calculateBounds(s,r.width,i.width,i.x);if(this.text=e.lines[o].text,i.y+r.height>t.graphics.clientSize.height){if(0===o)break;t=t.graphics.getNextPage(),i=new id(i.x,0,i.width,r.height),s.y=0}this.uriAnnotation=new nm(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),t.annotations.add(this.uriAnnotation),n=this.drawText(t,i),i.y+=r.height}return n},lm.prototype.calculateBounds=function(e,t,i,n){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Hh.Center?(e.x=n+(i-t)/2,e.width=t):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Hh.Right?(e.x=n+(i-t),e.width=t):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===Hh.Justify?(e.x=n,e.width=i):(e.width=n,e.width=t),e};var rm,sm,am=lm;function lm(){var e=sm.call(this)||this;e.uniformResourceLocator="",e.uriAnnotation=null,e.recalculateBounds=!1,e.defaultBorder=new Bl;for(var t=0;t<3;t++)e.defaultBorder.add(new kl(0));return e}dm.convert=function(e,t){var i="";switch(t){case mp.None:i="";break;case mp.Numeric:i=e.toString();break;case mp.LowerLatin:i=this.arabicToLetter(e).toLowerCase();break;case mp.LowerRoman:i=this.arabicToRoman(e).toLowerCase();break;case mp.UpperLatin:i=this.arabicToLetter(e);break;case mp.UpperRoman:i=this.arabicToRoman(e)}return i},dm.arabicToRoman=function(e){var t="",i=this.generateNumber(e,1e3,"M"),i=(t+=i.returnValue,e=i.intArabic,this.generateNumber(e,900,"CM")),i=(t+=i.returnValue,e=i.intArabic,this.generateNumber(e,500,"D")),i=(t+=i.returnValue,e=i.intArabic,this.generateNumber(e,400,"CD")),i=(t+=i.returnValue,e=i.intArabic,this.generateNumber(e,100,"C")),i=(t+=i.returnValue,e=i.intArabic,this.generateNumber(e,90,"XC")),i=(t+=i.returnValue,e=i.intArabic,this.generateNumber(e,50,"L")),i=(t+=i.returnValue,e=i.intArabic,this.generateNumber(e,40,"XL")),i=(t+=i.returnValue,e=i.intArabic,this.generateNumber(e,10,"X")),i=(t+=i.returnValue,e=i.intArabic,this.generateNumber(e,9,"IX")),i=(t+=i.returnValue,e=i.intArabic,this.generateNumber(e,5,"V")),i=(t+=i.returnValue,e=i.intArabic,this.generateNumber(e,4,"IV")),i=(t+=i.returnValue,e=i.intArabic,this.generateNumber(e,1,"I"));return t+=i.returnValue,e=i.intArabic,t.toString()},dm.arabicToLetter=function(e){for(var t=this.convertToLetter(e),i="";0<t.length;)var n=t.pop(),i=this.appendChar(i,n);return i.toString()},dm.generateNumber=function(e,t,i){for(var n="";t<=e;)e-=t,n+=i;return{returnValue:n.toString(),intArabic:e}},dm.convertToLetter=function(e){if(e<=0)throw Error("ArgumentOutOfRangeException-arabic, Value can not be less 0");for(var t=[];e>this.letterLimit;){var i=e%this.letterLimit;0===i?(e=e/this.letterLimit-1,i=this.letterLimit):e/=this.letterLimit,t.push(i)}return t.push(e),t},dm.appendChar=function(e,t){return e+=String.fromCharCode(dm.acsiiStartIndex+t)},dm.letterLimit=26,dm.acsiiStartIndex=64;var hm=dm;function dm(){}Object.defineProperty(cm.prototype,"template",{get:function(){return this.pdfTemplate},set:function(e){this.pdfTemplate=e},enumerable:!0,configurable:!0}),Object.defineProperty(cm.prototype,"value",{get:function(){return this.content},set:function(e){this.content=e},enumerable:!0,configurable:!0});var pm=cm;function cm(e,t){this.pdfTemplate=null,this.content="",void 0!==e&&(this.template=e,this.value=t)}um=function(e,t){return(um=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}um(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(mm,gm=Wp),mm.prototype.performDraw=function(e,t,i,n){gm.prototype.performDrawHelper.call(this,e,t,i,n);var o=this.getValue(e),r=new ou(this.getSize()),s=(this.list.setValue(e,new pm(r,o)),this.getSize()),o=(r.graphics.drawString(o,this.getFont(),this.pen,this.getBrush(),0,0,s.width,s.height,this.stringFormat),new ed(t.x+this.location.x,t.y+this.location.y));e.drawPdfTemplate(r,o,new td(r.width*i,r.height*n))};var um,gm,Qg=mm;function mm(){var e=gm.call(this)||this;return e.list=new Lp,e}fm=function(e,t){return(fm=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}fm(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(bm,ym=Qg),Object.defineProperty(bm.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(e){this.internalNumberStyle=e},enumerable:!0,configurable:!0}),bm.prototype.getValue=function(e){e=this.getPageFromGraphics(e);return this.internalGetValue(e)},bm.prototype.internalGetValue=function(e){e=e.document.pages.indexOf(e)+1;return hm.convert(e,this.numberStyle)};var fm,ym,vm=bm;function bm(e,t){var i=ym.call(this)||this;return i.internalNumberStyle=mp.Numeric,void 0===t?i.font=e:t instanceof rd?(i.font=e,i.brush=t):(i.font=e,i.bounds=t),i}wm=function(e,t){return(wm=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}wm(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Am,Cm=Qg),Object.defineProperty(Am.prototype,"text",{get:function(){return this.internalText},set:function(e){this.internalText=e},enumerable:!0,configurable:!0}),Object.defineProperty(Am.prototype,"automaticFields",{get:function(){return this.internalAutomaticFields},set:function(e){this.internalAutomaticFields=e},enumerable:!0,configurable:!0}),Am.prototype.getValue=function(e){var t=this.text.toString();if(void 0!==this.automaticFields&&null!=this.automaticFields&&0<this.automaticFields.length)for(var i=0;i<this.automaticFields.length;i++)var n=this.automaticFields[i],t=t.replace("{"+i+"}",n.getValue(e));return t};var wm,Cm,Sm=Am;function Am(e,t,i){for(var n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];var r=Cm.call(this)||this;return r.internalAutomaticFields=null,r.internalText="",r.font=e,r.brush=t,r.text=i,r.automaticFields=n,r}xm=function(e,t){return(xm=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}xm(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Tm,Im=Wp),Tm.prototype.performDraw=function(e,t,i,n){Im.prototype.performDrawHelper.call(this,e,t,i,n);var o,r,s,a=this.getPageFromGraphics(e).document,l=this.getValue(e);this.list.containsKey(a)?(o=this.list.getValue(a),s=new ed(t.x+this.location.x,t.y+this.location.y),e.drawPdfTemplate(o.template,s,new td(o.template.width*i,o.template.height*n))):(o=this.getSize(),r=new ou(o),this.list.setValue(a,new pm(r,l)),r.graphics.drawString(l,this.getFont(),this.pen,this.getBrush(),0,0,o.width,o.height,this.stringFormat),s=new ed(t.x+this.location.x,t.y+this.location.y),e.drawPdfTemplate(r,s,new td(r.width*i,r.height*n))),this.painterGraphics.push(e)};var xm,Im,Qg=Tm;function Tm(){var e=Im.call(this)||this;return e.list=new Lp,e.painterGraphics=[],e}Em=function(e,t){return(Em=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Em(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Pm,Dm=Qg),Object.defineProperty(Pm.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(e){this.internalNumberStyle=e},enumerable:!0,configurable:!0}),Pm.prototype.getValue=function(e){e=this.getPageFromGraphics(e).section.parent.document.pages.count;return hm.convert(e,this.numberStyle)};var Em,Dm,Mm,km=Pm;function Pm(e,t){var i=Dm.call(this)||this;return i.internalNumberStyle=mp.Numeric,void 0===t?i.font=e:t instanceof rd?(i.font=e,i.brush=t):(i.font=e,i.bounds=t),i}(Qg=Mm=Mm||{})[Qg.Location=0]="Location",Qg[Qg.FitToPage=1]="FitToPage",Qg[Qg.FitR=2]="FitR";Object.defineProperty(Bm.prototype,"zoom",{get:function(){return this.zoomFactor},set:function(e){this.zoomFactor=e,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(Bm.prototype,"page",{get:function(){return this.pdfPage},set:function(e){this.pdfPage=e,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(Bm.prototype,"mode",{get:function(){return this.destinationMode},set:function(e){this.destinationMode=e,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(Bm.prototype,"location",{get:function(){return this.destinationLocation},set:function(e){this.destinationLocation=e,this.initializePrimitive()},enumerable:!0,configurable:!0}),Bm.prototype.pointToNativePdf=function(e,t){return e.section.pointToNativePdf(e,t)},Bm.prototype.initializePrimitive=function(){switch(this.array.clear(),this.array.add(new Fh(this.pdfPage)),this.destinationMode){case Mm.Location:var e=this.pdfPage,e=(new ed,this.pointToNativePdf(e,this.destinationLocation));this.array.add(new yl(this.dictionaryProperties.xyz)),this.array.add(new kl(e.x)),this.array.add(new kl(e.y)),this.array.add(new kl(this.zoomFactor));break;case Mm.FitToPage:this.array.add(new yl(this.dictionaryProperties.fit))}},Object.defineProperty(Bm.prototype,"element",{get:function(){return this.initializePrimitive(),this.array},enumerable:!0,configurable:!0});Qg=Bm;function Bm(e,t){this.dictionaryProperties=new Cl,this.destinationMode=Mm.Location,this.zoomFactor=0,this.destinationLocation=new ed(0,0),this.bounds=new id,this.array=new Bl;gp.RotateAngle0;this.destinationLocation=new ed(0,this.destinationLocation.y),this.pdfPage=e,t instanceof ed?this.destinationLocation=t:this.bounds=t}Object.defineProperty(Lm.prototype,"domain",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.domain)},set:function(e){this.mDictionary.items.setValue(this.mDictionaryProperties.domain,e)},enumerable:!0,configurable:!0}),Object.defineProperty(Lm.prototype,"range",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.range)},set:function(e){this.mDictionary.items.setValue(this.mDictionaryProperties.range,e)},enumerable:!0,configurable:!0}),Object.defineProperty(Lm.prototype,"dictionary",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(Lm.prototype,"element",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0});var Fm=Lm;function Lm(e){this.mDictionary=null,this.mDictionaryProperties=new Cl,this.mDictionary=e}Rm=function(e,t){return(Rm=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Rm(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(zm,Om=Fm),zm.prototype.checkParams=function(e,t,i,n){t.length,e.length,n.length},zm.prototype.setDomainAndRange=function(e,t){this.domain=new Bl(e),this.range=new Bl(t)},zm.prototype.setSizeAndValues=function(e,t){var i=this.dictionary;i.isResource=!0,this.dictionary.items.setValue(this.mDictionaryProperties.size,new Bl(e)),this.dictionary.items.setValue(this.mDictionaryProperties.bitsPerSample,new kl(8)),i.writeBytes(t)};var Rm,Om,Nm,Vm,_m,r,Hm=zm;function zm(e,t,i,n){var o=Om.call(this,new xh)||this;return void 0===e?o.dictionary.items.setValue(o.mDictionaryProperties.functionType,new kl(0)):(o.dictionary.items.setValue(o.mDictionaryProperties.functionType,new kl(0)),o.checkParams(e,t,i,n),o.setDomainAndRange(e,t),o.setSizeAndValues(i,n)),o}(s=Nm=Nm||{})[s.None=0]="None",s[s.Start=1]="Start",s[s.End=2]="End",s[s.Both=3]="Both",(s=Vm=Vm||{})[s.BackwardDiagonal=0]="BackwardDiagonal",s[s.ForwardDiagonal=1]="ForwardDiagonal",s[s.Horizontal=2]="Horizontal",s[s.Vertical=3]="Vertical",(s=_m=_m||{})[s.Function=1]="Function",s[s.Axial=2]="Axial",s[s.Radial=3]="Radial",(s=r=r||{})[s.ActiveBorder=1]="ActiveBorder",s[s.ActiveCaption=2]="ActiveCaption",s[s.ActiveCaptionText=3]="ActiveCaptionText",s[s.AppWorkspace=4]="AppWorkspace",s[s.Control=5]="Control",s[s.ControlDark=6]="ControlDark",s[s.ControlDarkDark=7]="ControlDarkDark",s[s.ControlLight=8]="ControlLight",s[s.ControlLightLight=9]="ControlLightLight",s[s.ControlText=10]="ControlText",s[s.Desktop=11]="Desktop",s[s.GrayText=12]="GrayText",s[s.Highlight=13]="Highlight",s[s.HighlightText=14]="HighlightText",s[s.HotTrack=15]="HotTrack",s[s.InactiveBorder=16]="InactiveBorder",s[s.InactiveCaption=17]="InactiveCaption",s[s.InactiveCaptionText=18]="InactiveCaptionText",s[s.Info=19]="Info",s[s.InfoText=20]="InfoText",s[s.Menu=21]="Menu",s[s.MenuText=22]="MenuText",s[s.ScrollBar=23]="ScrollBar",s[s.Window=24]="Window",s[s.WindowFrame=25]="WindowFrame",s[s.WindowText=26]="WindowText",s[s.Transparent=27]="Transparent",s[s.AliceBlue=28]="AliceBlue",s[s.AntiqueWhite=29]="AntiqueWhite",s[s.Aqua=30]="Aqua",s[s.Aquamarine=31]="Aquamarine",s[s.Azure=32]="Azure",s[s.Beige=33]="Beige",s[s.Bisque=34]="Bisque",s[s.Black=35]="Black",s[s.BlanchedAlmond=36]="BlanchedAlmond",s[s.Blue=37]="Blue",s[s.BlueViolet=38]="BlueViolet",s[s.Brown=39]="Brown",s[s.BurlyWood=40]="BurlyWood",s[s.CadetBlue=41]="CadetBlue",s[s.Chartreuse=42]="Chartreuse",s[s.Chocolate=43]="Chocolate",s[s.Coral=44]="Coral",s[s.CornflowerBlue=45]="CornflowerBlue",s[s.Cornsilk=46]="Cornsilk",s[s.Crimson=47]="Crimson",s[s.Cyan=48]="Cyan",s[s.DarkBlue=49]="DarkBlue",s[s.DarkCyan=50]="DarkCyan",s[s.DarkGoldenrod=51]="DarkGoldenrod",s[s.DarkGray=52]="DarkGray",s[s.DarkGreen=53]="DarkGreen",s[s.DarkKhaki=54]="DarkKhaki",s[s.DarkMagenta=55]="DarkMagenta",s[s.DarkOliveGreen=56]="DarkOliveGreen",s[s.DarkOrange=57]="DarkOrange",s[s.DarkOrchid=58]="DarkOrchid",s[s.DarkRed=59]="DarkRed",s[s.DarkSalmon=60]="DarkSalmon",s[s.DarkSeaGreen=61]="DarkSeaGreen",s[s.DarkSlateBlue=62]="DarkSlateBlue",s[s.DarkSlateGray=63]="DarkSlateGray",s[s.DarkTurquoise=64]="DarkTurquoise",s[s.DarkViolet=65]="DarkViolet",s[s.DeepPink=66]="DeepPink",s[s.DeepSkyBlue=67]="DeepSkyBlue",s[s.DimGray=68]="DimGray",s[s.DodgerBlue=69]="DodgerBlue",s[s.Firebrick=70]="Firebrick",s[s.FloralWhite=71]="FloralWhite",s[s.ForestGreen=72]="ForestGreen",s[s.Fuchsia=73]="Fuchsia",s[s.Gainsboro=74]="Gainsboro",s[s.GhostWhite=75]="GhostWhite",s[s.Gold=76]="Gold",s[s.Goldenrod=77]="Goldenrod",s[s.Gray=78]="Gray",s[s.Green=79]="Green",s[s.GreenYellow=80]="GreenYellow",s[s.Honeydew=81]="Honeydew",s[s.HotPink=82]="HotPink",s[s.IndianRed=83]="IndianRed",s[s.Indigo=84]="Indigo",s[s.Ivory=85]="Ivory",s[s.Khaki=86]="Khaki",s[s.Lavender=87]="Lavender",s[s.LavenderBlush=88]="LavenderBlush",s[s.LawnGreen=89]="LawnGreen",s[s.LemonChiffon=90]="LemonChiffon",s[s.LightBlue=91]="LightBlue",s[s.LightCoral=92]="LightCoral",s[s.LightCyan=93]="LightCyan",s[s.LightGoldenrodYellow=94]="LightGoldenrodYellow",s[s.LightGray=95]="LightGray",s[s.LightGreen=96]="LightGreen",s[s.LightPink=97]="LightPink",s[s.LightSalmon=98]="LightSalmon",s[s.LightSeaGreen=99]="LightSeaGreen",s[s.LightSkyBlue=100]="LightSkyBlue",s[s.LightSlateGray=101]="LightSlateGray",s[s.LightSteelBlue=102]="LightSteelBlue",s[s.LightYellow=103]="LightYellow",s[s.Lime=104]="Lime",s[s.LimeGreen=105]="LimeGreen",s[s.Linen=106]="Linen",s[s.Magenta=107]="Magenta",s[s.Maroon=108]="Maroon",s[s.MediumAquamarine=109]="MediumAquamarine",s[s.MediumBlue=110]="MediumBlue",s[s.MediumOrchid=111]="MediumOrchid",s[s.MediumPurple=112]="MediumPurple",s[s.MediumSeaGreen=113]="MediumSeaGreen",s[s.MediumSlateBlue=114]="MediumSlateBlue",s[s.MediumSpringGreen=115]="MediumSpringGreen",s[s.MediumTurquoise=116]="MediumTurquoise",s[s.MediumVioletRed=117]="MediumVioletRed",s[s.MidnightBlue=118]="MidnightBlue",s[s.MintCream=119]="MintCream",s[s.MistyRose=120]="MistyRose",s[s.Moccasin=121]="Moccasin",s[s.NavajoWhite=122]="NavajoWhite",s[s.Navy=123]="Navy",s[s.OldLace=124]="OldLace",s[s.Olive=125]="Olive",s[s.OliveDrab=126]="OliveDrab",s[s.Orange=127]="Orange",s[s.OrangeRed=128]="OrangeRed",s[s.Orchid=129]="Orchid",s[s.PaleGoldenrod=130]="PaleGoldenrod",s[s.PaleGreen=131]="PaleGreen",s[s.PaleTurquoise=132]="PaleTurquoise",s[s.PaleVioletRed=133]="PaleVioletRed",s[s.PapayaWhip=134]="PapayaWhip",s[s.PeachPuff=135]="PeachPuff",s[s.Peru=136]="Peru",s[s.Pink=137]="Pink",s[s.Plum=138]="Plum",s[s.PowderBlue=139]="PowderBlue",s[s.Purple=140]="Purple",s[s.Red=141]="Red",s[s.RosyBrown=142]="RosyBrown",s[s.RoyalBlue=143]="RoyalBlue",s[s.SaddleBrown=144]="SaddleBrown",s[s.Salmon=145]="Salmon",s[s.SandyBrown=146]="SandyBrown",s[s.SeaGreen=147]="SeaGreen",s[s.SeaShell=148]="SeaShell",s[s.Sienna=149]="Sienna",s[s.Silver=150]="Silver",s[s.SkyBlue=151]="SkyBlue",s[s.SlateBlue=152]="SlateBlue",s[s.SlateGray=153]="SlateGray",s[s.Snow=154]="Snow",s[s.SpringGreen=155]="SpringGreen",s[s.SteelBlue=156]="SteelBlue",s[s.Tan=157]="Tan",s[s.Teal=158]="Teal",s[s.Thistle=159]="Thistle",s[s.Tomato=160]="Tomato",s[s.Turquoise=161]="Turquoise",s[s.Violet=162]="Violet",s[s.Wheat=163]="Wheat",s[s.White=164]="White",s[s.WhiteSmoke=165]="WhiteSmoke",s[s.Yellow=166]="Yellow",s[s.YellowGreen=167]="YellowGreen",s[s.ButtonFace=168]="ButtonFace",s[s.ButtonHighlight=169]="ButtonHighlight",s[s.ButtonShadow=170]="ButtonShadow",s[s.GradientActiveCaption=171]="GradientActiveCaption",s[s.GradientInactiveCaption=172]="GradientInactiveCaption",s[s.MenuBar=173]="MenuBar",s[s.MenuHighlight=174]="MenuHighlight";Object.defineProperty(Wm,"AliceBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.AliceBlue)?this.sBrushes.getValue(r.AliceBlue):e)?this.getBrush(r.AliceBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"AntiqueWhite",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.AntiqueWhite)?this.sBrushes.getValue(r.AntiqueWhite):e)?this.getBrush(r.AntiqueWhite):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Aqua",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Aqua)?this.sBrushes.getValue(r.Aqua):e)?this.getBrush(r.Aqua):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Aquamarine",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Aquamarine)?this.sBrushes.getValue(r.Aquamarine):e)?this.getBrush(r.Aquamarine):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Azure",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Azure)?this.sBrushes.getValue(r.Azure):e)?this.getBrush(r.Azure):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Beige",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Beige)?this.sBrushes.getValue(r.Beige):e)?this.getBrush(r.Beige):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Bisque",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Bisque)?this.sBrushes.getValue(r.Bisque):e)?this.getBrush(r.Bisque):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Black",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Black)?this.sBrushes.getValue(r.Black):e)?this.getBrush(r.Black):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"BlanchedAlmond",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.BlanchedAlmond)?this.sBrushes.getValue(r.BlanchedAlmond):e)?this.getBrush(r.BlanchedAlmond):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Blue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Blue)?this.sBrushes.getValue(r.Blue):e)?this.getBrush(r.Blue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"BlueViolet",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.BlueViolet)?this.sBrushes.getValue(r.BlueViolet):e)?this.getBrush(r.BlueViolet):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Brown",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Brown)?this.sBrushes.getValue(r.Brown):e)?this.getBrush(r.Brown):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"BurlyWood",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.BurlyWood)?this.sBrushes.getValue(r.BurlyWood):e)?this.getBrush(r.BurlyWood):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"CadetBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.CadetBlue)?this.sBrushes.getValue(r.CadetBlue):e)?this.getBrush(r.CadetBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Chartreuse",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Chartreuse)?this.sBrushes.getValue(r.Chartreuse):e)?this.getBrush(r.Chartreuse):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Chocolate",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Chocolate)?this.sBrushes.getValue(r.Chocolate):e)?this.getBrush(r.Chocolate):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Coral",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Coral)?this.sBrushes.getValue(r.Coral):e)?this.getBrush(r.Coral):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"CornflowerBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.CornflowerBlue)?this.sBrushes.getValue(r.CornflowerBlue):e)?this.getBrush(r.CornflowerBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Cornsilk",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Cornsilk)?this.sBrushes.getValue(r.Cornsilk):e)?this.getBrush(r.Cornsilk):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Crimson",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Crimson)?this.sBrushes.getValue(r.Crimson):e)?this.getBrush(r.Crimson):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Cyan",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Cyan)?this.sBrushes.getValue(r.Cyan):e)?this.getBrush(r.Cyan):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkBlue)?this.sBrushes.getValue(r.DarkBlue):e)?this.getBrush(r.DarkBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkCyan",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkCyan)?this.sBrushes.getValue(r.DarkCyan):e)?this.getBrush(r.DarkCyan):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkGoldenrod",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkGoldenrod)?this.sBrushes.getValue(r.DarkGoldenrod):e)?this.getBrush(r.DarkGoldenrod):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkGray",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkGray)?this.sBrushes.getValue(r.DarkGray):e)?this.getBrush(r.DarkGray):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkGreen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkGreen)?this.sBrushes.getValue(r.DarkGreen):e)?this.getBrush(r.DarkGreen):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkKhaki",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkKhaki)?this.sBrushes.getValue(r.DarkKhaki):e)?this.getBrush(r.DarkKhaki):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkMagenta",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkMagenta)?this.sBrushes.getValue(r.DarkMagenta):e)?this.getBrush(r.DarkMagenta):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkOliveGreen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkOliveGreen)?this.sBrushes.getValue(r.DarkOliveGreen):e)?this.getBrush(r.DarkOliveGreen):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkOrange",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkOrange)?this.sBrushes.getValue(r.DarkOrange):e)?this.getBrush(r.DarkOrange):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkOrchid",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkOrchid)?this.sBrushes.getValue(r.DarkOrchid):e)?this.getBrush(r.DarkOrchid):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkRed",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkRed)?this.sBrushes.getValue(r.DarkRed):e)?this.getBrush(r.DarkRed):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkSalmon",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkSalmon)?this.sBrushes.getValue(r.DarkSalmon):e)?this.getBrush(r.DarkSalmon):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkSeaGreen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkSeaGreen)?this.sBrushes.getValue(r.DarkSeaGreen):e)?this.getBrush(r.DarkSeaGreen):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkSlateBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkSlateBlue)?this.sBrushes.getValue(r.DarkSlateBlue):e)?this.getBrush(r.DarkSlateBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkSlateGray",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkSlateGray)?this.sBrushes.getValue(r.DarkSlateGray):e)?this.getBrush(r.DarkSlateGray):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkTurquoise",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkTurquoise)?this.sBrushes.getValue(r.DarkTurquoise):e)?this.getBrush(r.DarkTurquoise):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DarkViolet",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DarkViolet)?this.sBrushes.getValue(r.DarkViolet):e)?this.getBrush(r.DarkViolet):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DeepPink",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DeepPink)?this.sBrushes.getValue(r.DeepPink):e)?this.getBrush(r.DeepPink):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DeepSkyBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DeepSkyBlue)?this.sBrushes.getValue(r.DeepSkyBlue):e)?this.getBrush(r.DeepSkyBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DimGray",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DimGray)?this.sBrushes.getValue(r.DimGray):e)?this.getBrush(r.DimGray):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"DodgerBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.DodgerBlue)?this.sBrushes.getValue(r.DodgerBlue):e)?this.getBrush(r.DodgerBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Firebrick",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Firebrick)?this.sBrushes.getValue(r.Firebrick):e)?this.getBrush(r.Firebrick):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"FloralWhite",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.FloralWhite)?this.sBrushes.getValue(r.FloralWhite):e)?this.getBrush(r.FloralWhite):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"ForestGreen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.ForestGreen)?this.sBrushes.getValue(r.ForestGreen):e)?this.getBrush(r.ForestGreen):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Fuchsia",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Fuchsia)?this.sBrushes.getValue(r.Fuchsia):e)?this.getBrush(r.Fuchsia):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Gainsboro",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Gainsboro)?this.sBrushes.getValue(r.Gainsboro):e)?this.getBrush(r.Gainsboro):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"GhostWhite",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.GhostWhite)?this.sBrushes.getValue(r.GhostWhite):e)?this.getBrush(r.GhostWhite):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Gold",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Gold)?this.sBrushes.getValue(r.Gold):e)?this.getBrush(r.Gold):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Goldenrod",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Goldenrod)?this.sBrushes.getValue(r.Goldenrod):e)?this.getBrush(r.Goldenrod):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Gray",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Gray)?this.sBrushes.getValue(r.Gray):e)?this.getBrush(r.Gray):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Green",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Green)?this.sBrushes.getValue(r.Green):e)?this.getBrush(r.Green):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"GreenYellow",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.GreenYellow)?this.sBrushes.getValue(r.GreenYellow):e)?this.getBrush(r.GreenYellow):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Honeydew",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Honeydew)?this.sBrushes.getValue(r.Honeydew):e)?this.getBrush(r.Honeydew):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"HotPink",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.HotPink)?this.sBrushes.getValue(r.HotPink):e)?this.getBrush(r.HotPink):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"IndianRed",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.IndianRed)?this.sBrushes.getValue(r.IndianRed):e)?this.getBrush(r.IndianRed):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Indigo",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Indigo)?this.sBrushes.getValue(r.Indigo):e)?this.getBrush(r.Indigo):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Ivory",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Ivory)?this.sBrushes.getValue(r.Ivory):e)?this.getBrush(r.Ivory):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Khaki",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Khaki)?this.sBrushes.getValue(r.Khaki):e)?this.getBrush(r.Khaki):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Lavender",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Lavender)?this.sBrushes.getValue(r.Lavender):e)?this.getBrush(r.Lavender):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LavenderBlush",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LavenderBlush)?this.sBrushes.getValue(r.LavenderBlush):e)?this.getBrush(r.LavenderBlush):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LawnGreen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LawnGreen)?this.sBrushes.getValue(r.LawnGreen):e)?this.getBrush(r.LawnGreen):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LemonChiffon",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LemonChiffon)?this.sBrushes.getValue(r.LemonChiffon):e)?this.getBrush(r.LemonChiffon):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LightBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LightBlue)?this.sBrushes.getValue(r.LightBlue):e)?this.getBrush(r.LightBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LightCoral",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LightCoral)?this.sBrushes.getValue(r.LightCoral):e)?this.getBrush(r.LightCoral):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LightCyan",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LightCyan)?this.sBrushes.getValue(r.LightCyan):e)?this.getBrush(r.LightCyan):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LightGoldenrodYellow",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LightGoldenrodYellow)?this.sBrushes.getValue(r.LightGoldenrodYellow):e)?this.getBrush(r.LightGoldenrodYellow):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LightGray",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LightGray)?this.sBrushes.getValue(r.LightGray):e)?this.getBrush(r.LightGray):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LightGreen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LightGreen)?this.sBrushes.getValue(r.LightGreen):e)?this.getBrush(r.LightGreen):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LightPink",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LightPink)?this.sBrushes.getValue(r.LightPink):e)?this.getBrush(r.LightPink):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LightSalmon",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LightSalmon)?this.sBrushes.getValue(r.LightSalmon):e)?this.getBrush(r.LightSalmon):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LightSeaGreen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LightSeaGreen)?this.sBrushes.getValue(r.LightSeaGreen):e)?this.getBrush(r.LightSeaGreen):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LightSkyBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LightSkyBlue)?this.sBrushes.getValue(r.LightSkyBlue):e)?this.getBrush(r.LightSkyBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LightSlateGray",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LightSlateGray)?this.sBrushes.getValue(r.LightSlateGray):e)?this.getBrush(r.LightSlateGray):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LightSteelBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LightSteelBlue)?this.sBrushes.getValue(r.LightSteelBlue):e)?this.getBrush(r.LightSteelBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LightYellow",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LightYellow)?this.sBrushes.getValue(r.LightYellow):e)?this.getBrush(r.LightYellow):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Lime",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Lime)?this.sBrushes.getValue(r.Lime):e)?this.getBrush(r.Lime):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"LimeGreen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.LimeGreen)?this.sBrushes.getValue(r.LimeGreen):e)?this.getBrush(r.LimeGreen):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Linen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Linen)?this.sBrushes.getValue(r.Linen):e)?this.getBrush(r.Linen):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Magenta",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Magenta)?this.sBrushes.getValue(r.Magenta):e)?this.getBrush(r.Magenta):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Maroon",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Maroon)?this.sBrushes.getValue(r.Maroon):e)?this.getBrush(r.Maroon):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"MediumAquamarine",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.MediumAquamarine)?this.sBrushes.getValue(r.MediumAquamarine):e)?this.getBrush(r.MediumAquamarine):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"MediumBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.MediumBlue)?this.sBrushes.getValue(r.MediumBlue):e)?this.getBrush(r.MediumBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"MediumOrchid",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.MediumOrchid)?this.sBrushes.getValue(r.MediumOrchid):e)?this.getBrush(r.MediumOrchid):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"MediumPurple",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.MediumPurple)?this.sBrushes.getValue(r.MediumPurple):e)?this.getBrush(r.MediumPurple):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"MediumSeaGreen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.MediumSeaGreen)?this.sBrushes.getValue(r.MediumSeaGreen):e)?this.getBrush(r.MediumSeaGreen):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"MediumSlateBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.MediumSlateBlue)?this.sBrushes.getValue(r.MediumSlateBlue):e)?this.getBrush(r.MediumSlateBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"MediumSpringGreen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.MediumSpringGreen)?this.sBrushes.getValue(r.MediumSpringGreen):e)?this.getBrush(r.MediumSpringGreen):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"MediumTurquoise",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.MediumTurquoise)?this.sBrushes.getValue(r.MediumTurquoise):e)?this.getBrush(r.MediumTurquoise):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"MediumVioletRed",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.MediumVioletRed)?this.sBrushes.getValue(r.MediumVioletRed):e)?this.getBrush(r.MediumVioletRed):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"MidnightBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.MidnightBlue)?this.sBrushes.getValue(r.MidnightBlue):e)?this.getBrush(r.MidnightBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"MintCream",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.MintCream)?this.sBrushes.getValue(r.MintCream):e)?this.getBrush(r.MintCream):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"MistyRose",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.MistyRose)?this.sBrushes.getValue(r.MistyRose):e)?this.getBrush(r.MistyRose):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Moccasin",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Moccasin)?this.sBrushes.getValue(r.Moccasin):e)?this.getBrush(r.Moccasin):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"NavajoWhite",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.NavajoWhite)?this.sBrushes.getValue(r.NavajoWhite):e)?this.getBrush(r.NavajoWhite):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Navy",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Navy)?this.sBrushes.getValue(r.Navy):e)?this.getBrush(r.Navy):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"OldLace",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.OldLace)?this.sBrushes.getValue(r.OldLace):e)?this.getBrush(r.OldLace):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Olive",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Olive)?this.sBrushes.getValue(r.Olive):e)?this.getBrush(r.Olive):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"OliveDrab",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.OliveDrab)?this.sBrushes.getValue(r.OliveDrab):e)?this.getBrush(r.OliveDrab):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Orange",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Orange)?this.sBrushes.getValue(r.Orange):e)?this.getBrush(r.Orange):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"OrangeRed",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.OrangeRed)?this.sBrushes.getValue(r.OrangeRed):e)?this.getBrush(r.OrangeRed):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Orchid",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Orchid)?this.sBrushes.getValue(r.Orchid):e)?this.getBrush(r.Orchid):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"PaleGoldenrod",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.PaleGoldenrod)?this.sBrushes.getValue(r.PaleGoldenrod):e)?this.getBrush(r.PaleGoldenrod):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"PaleGreen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.PaleGreen)?this.sBrushes.getValue(r.PaleGreen):e)?this.getBrush(r.PaleGreen):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"PaleTurquoise",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.PaleTurquoise)?this.sBrushes.getValue(r.PaleTurquoise):e)?this.getBrush(r.PaleTurquoise):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"PaleVioletRed",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.PaleVioletRed)?this.sBrushes.getValue(r.PaleVioletRed):e)?this.getBrush(r.PaleVioletRed):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"PapayaWhip",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.PapayaWhip)?this.sBrushes.getValue(r.PapayaWhip):e)?this.getBrush(r.PapayaWhip):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"PeachPuff",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.PeachPuff)?this.sBrushes.getValue(r.PeachPuff):e)?this.getBrush(r.PeachPuff):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Peru",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Peru)?this.sBrushes.getValue(r.Peru):e)?this.getBrush(r.Peru):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Pink",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Pink)?this.sBrushes.getValue(r.Pink):e)?this.getBrush(r.Pink):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Plum",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Plum)?this.sBrushes.getValue(r.Plum):e)?this.getBrush(r.Plum):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"PowderBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.PowderBlue)?this.sBrushes.getValue(r.PowderBlue):e)?this.getBrush(r.PowderBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Purple",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Purple)?this.sBrushes.getValue(r.Purple):e)?this.getBrush(r.Purple):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Red",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Red)?this.sBrushes.getValue(r.Red):e)?this.getBrush(r.Red):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"RosyBrown",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.RosyBrown)?this.sBrushes.getValue(r.RosyBrown):e)?this.getBrush(r.RosyBrown):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"RoyalBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.RoyalBlue)?this.sBrushes.getValue(r.RoyalBlue):e)?this.getBrush(r.RoyalBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"SaddleBrown",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.SaddleBrown)?this.sBrushes.getValue(r.SaddleBrown):e)?this.getBrush(r.SaddleBrown):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Salmon",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Salmon)?this.sBrushes.getValue(r.Salmon):e)?this.getBrush(r.Salmon):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"SandyBrown",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.SandyBrown)?this.sBrushes.getValue(r.SandyBrown):e)?this.getBrush(r.SandyBrown):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"SeaGreen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.SeaGreen)?this.sBrushes.getValue(r.SeaGreen):e)?this.getBrush(r.SeaGreen):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"SeaShell",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.SeaShell)?this.sBrushes.getValue(r.SeaShell):e)?this.getBrush(r.SeaShell):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Sienna",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Sienna)?this.sBrushes.getValue(r.Sienna):e)?this.getBrush(r.Sienna):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Silver",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Silver)?this.sBrushes.getValue(r.Silver):e)?this.getBrush(r.Silver):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"SkyBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.SkyBlue)?this.sBrushes.getValue(r.SkyBlue):e)?this.getBrush(r.SkyBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"SlateBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.SlateBlue)?this.sBrushes.getValue(r.SlateBlue):e)?this.getBrush(r.SlateBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"SlateGray",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.SlateGray)?this.sBrushes.getValue(r.SlateGray):e)?this.getBrush(r.SlateGray):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Snow",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Snow)?this.sBrushes.getValue(r.Snow):e)?this.getBrush(r.Snow):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"SpringGreen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.SpringGreen)?this.sBrushes.getValue(r.SpringGreen):e)?this.getBrush(r.SpringGreen):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"SteelBlue",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.SteelBlue)?this.sBrushes.getValue(r.SteelBlue):e)?this.getBrush(r.SteelBlue):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Tan",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Tan)?this.sBrushes.getValue(r.Tan):e)?this.getBrush(r.Tan):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Teal",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Teal)?this.sBrushes.getValue(r.Teal):e)?this.getBrush(r.Teal):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Thistle",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Thistle)?this.sBrushes.getValue(r.Thistle):e)?this.getBrush(r.Thistle):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Tomato",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Tomato)?this.sBrushes.getValue(r.Tomato):e)?this.getBrush(r.Tomato):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Transparent",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Transparent)?this.sBrushes.getValue(r.Transparent):e)?this.getBrush(r.Transparent):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Turquoise",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Turquoise)?this.sBrushes.getValue(r.Turquoise):e)?this.getBrush(r.Turquoise):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Violet",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Violet)?this.sBrushes.getValue(r.Violet):e)?this.getBrush(r.Violet):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Wheat",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Wheat)?this.sBrushes.getValue(r.Wheat):e)?this.getBrush(r.Wheat):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"White",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.White)?this.sBrushes.getValue(r.White):e)?this.getBrush(r.White):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"WhiteSmoke",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.WhiteSmoke)?this.sBrushes.getValue(r.WhiteSmoke):e)?this.getBrush(r.WhiteSmoke):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"Yellow",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.Yellow)?this.sBrushes.getValue(r.Yellow):e)?this.getBrush(r.Yellow):e},enumerable:!0,configurable:!0}),Object.defineProperty(Wm,"YellowGreen",{get:function(){var e=null;return e=null==(e=this.sBrushes.containsKey(r.YellowGreen)?this.sBrushes.getValue(r.YellowGreen):e)?this.getBrush(r.YellowGreen):e},enumerable:!0,configurable:!0}),Wm.getBrush=function(e){var t=this.getColorValue(e),t=new Sd(t);return this.sBrushes.setValue(e,t),t},Wm.getColorValue=function(e){var t=new se;switch(e){case r.Transparent:t=new se(0,255,255,255);break;case r.AliceBlue:t=new se(255,240,248,255);break;case r.AntiqueWhite:t=new se(255,250,235,215);break;case r.Aqua:t=new se(255,0,255,255);break;case r.Aquamarine:t=new se(255,127,255,212);break;case r.Azure:t=new se(255,240,255,255);break;case r.Beige:t=new se(255,245,245,220);break;case r.Bisque:t=new se(255,255,228,196);break;case r.Black:t=new se(255,0,0,0);break;case r.BlanchedAlmond:t=new se(255,255,235,205);break;case r.Blue:t=new se(255,0,0,255);break;case r.BlueViolet:t=new se(255,138,43,226);break;case r.Brown:t=new se(255,165,42,42);break;case r.BurlyWood:t=new se(255,222,184,135);break;case r.CadetBlue:t=new se(255,95,158,160);break;case r.Chartreuse:t=new se(255,127,255,0);break;case r.Chocolate:t=new se(255,210,105,30);break;case r.Coral:t=new se(255,255,127,80);break;case r.CornflowerBlue:t=new se(255,100,149,237);break;case r.Cornsilk:t=new se(255,255,248,220);break;case r.Crimson:t=new se(255,220,20,60);break;case r.Cyan:t=new se(255,0,255,255);break;case r.DarkBlue:t=new se(255,0,0,139);break;case r.DarkCyan:t=new se(255,0,139,139);break;case r.DarkGoldenrod:t=new se(255,184,134,11);break;case r.DarkGray:t=new se(255,169,169,169);break;case r.DarkGreen:t=new se(255,0,100,0);break;case r.DarkKhaki:t=new se(255,189,183,107);break;case r.DarkMagenta:t=new se(255,139,0,139);break;case r.DarkOliveGreen:t=new se(255,85,107,47);break;case r.DarkOrange:t=new se(255,255,140,0);break;case r.DarkOrchid:t=new se(255,153,50,204);break;case r.DarkRed:t=new se(255,139,0,0);break;case r.DarkSalmon:t=new se(255,233,150,122);break;case r.DarkSeaGreen:t=new se(255,143,188,139);break;case r.DarkSlateBlue:t=new se(255,72,61,139);break;case r.DarkSlateGray:t=new se(255,47,79,79);break;case r.DarkTurquoise:t=new se(255,0,206,209);break;case r.DarkViolet:t=new se(255,148,0,211);break;case r.DeepPink:t=new se(255,255,20,147);break;case r.DeepSkyBlue:t=new se(255,0,191,255);break;case r.DimGray:t=new se(255,105,105,105);break;case r.DodgerBlue:t=new se(255,30,144,255);break;case r.Firebrick:t=new se(255,178,34,34);break;case r.FloralWhite:t=new se(255,255,250,240);break;case r.ForestGreen:t=new se(255,34,139,34);break;case r.Fuchsia:t=new se(255,255,0,255);break;case r.Gainsboro:t=new se(255,220,220,220);break;case r.GhostWhite:t=new se(255,248,248,255);break;case r.Gold:t=new se(255,255,215,0);break;case r.Goldenrod:t=new se(255,218,165,32);break;case r.Gray:t=new se(255,128,128,128);break;case r.Green:t=new se(255,0,128,0);break;case r.GreenYellow:t=new se(255,173,255,47);break;case r.Honeydew:t=new se(255,240,255,240);break;case r.HotPink:t=new se(255,255,105,180);break;case r.IndianRed:t=new se(255,205,92,92);break;case r.Indigo:t=new se(255,75,0,130);break;case r.Ivory:t=new se(255,255,255,240);break;case r.Khaki:t=new se(255,240,230,140);break;case r.Lavender:t=new se(255,230,230,250);break;case r.LavenderBlush:t=new se(255,255,240,245);break;case r.LawnGreen:t=new se(255,124,252,0);break;case r.LemonChiffon:t=new se(255,255,250,205);break;case r.LightBlue:t=new se(255,173,216,230);break;case r.LightCoral:t=new se(255,240,128,128);break;case r.LightCyan:t=new se(255,224,255,255);break;case r.LightGoldenrodYellow:t=new se(255,250,250,210);break;case r.LightGreen:t=new se(255,144,238,144);break;case r.LightGray:t=new se(255,211,211,211);break;case r.LightPink:t=new se(255,255,182,193);break;case r.LightSalmon:t=new se(255,255,160,122);break;case r.LightSeaGreen:t=new se(255,32,178,170);break;case r.LightSkyBlue:t=new se(255,135,206,250);break;case r.LightSlateGray:t=new se(255,119,136,153);break;case r.LightSteelBlue:t=new se(255,176,196,222);break;case r.LightYellow:t=new se(255,255,255,224);break;case r.Lime:t=new se(255,0,255,0);break;case r.LimeGreen:t=new se(255,50,205,50);break;case r.Linen:t=new se(255,250,240,230);break;case r.Magenta:t=new se(255,255,0,255);break;case r.Maroon:t=new se(255,128,0,0);break;case r.MediumAquamarine:t=new se(255,102,205,170);break;case r.MediumBlue:t=new se(255,0,0,205);break;case r.MediumOrchid:t=new se(255,186,85,211);break;case r.MediumPurple:t=new se(255,147,112,219);break;case r.MediumSeaGreen:t=new se(255,60,179,113);break;case r.MediumSlateBlue:t=new se(255,123,104,238);break;case r.MediumSpringGreen:t=new se(255,0,250,154);break;case r.MediumTurquoise:t=new se(255,72,209,204);break;case r.MediumVioletRed:t=new se(255,199,21,133);break;case r.MidnightBlue:t=new se(255,25,25,112);break;case r.MintCream:t=new se(255,245,255,250);break;case r.MistyRose:t=new se(255,255,228,225);break;case r.Moccasin:t=new se(255,255,228,181);break;case r.NavajoWhite:t=new se(255,255,222,173);break;case r.Navy:t=new se(255,0,0,128);break;case r.OldLace:t=new se(255,253,245,230);break;case r.Olive:t=new se(255,128,128,0);break;case r.OliveDrab:t=new se(255,107,142,35);break;case r.Orange:t=new se(255,255,165,0);break;case r.OrangeRed:t=new se(255,255,69,0);break;case r.Orchid:t=new se(255,218,112,214);break;case r.PaleGoldenrod:t=new se(255,238,232,170);break;case r.PaleGreen:t=new se(255,152,251,152);break;case r.PaleTurquoise:t=new se(255,175,238,238);break;case r.PaleVioletRed:t=new se(255,219,112,147);break;case r.PapayaWhip:t=new se(255,255,239,213);break;case r.PeachPuff:t=new se(255,255,218,185);break;case r.Peru:t=new se(255,205,133,63);break;case r.Pink:t=new se(255,255,192,203);break;case r.Plum:t=new se(255,221,160,221);break;case r.PowderBlue:t=new se(255,176,224,230);break;case r.Purple:t=new se(255,128,0,128);break;case r.Red:t=new se(255,255,0,0);break;case r.RosyBrown:t=new se(255,188,143,143);break;case r.RoyalBlue:t=new se(255,65,105,225);break;case r.SaddleBrown:t=new se(255,139,69,19);break;case r.Salmon:t=new se(255,250,128,114);break;case r.SandyBrown:t=new se(255,244,164,96);break;case r.SeaGreen:t=new se(255,46,139,87);break;case r.SeaShell:t=new se(255,255,245,238);break;case r.Sienna:t=new se(255,160,82,45);break;case r.Silver:t=new se(255,192,192,192);break;case r.SkyBlue:t=new se(255,135,206,235);break;case r.SlateBlue:t=new se(255,106,90,205);break;case r.SlateGray:t=new se(255,112,128,144);break;case r.Snow:t=new se(255,255,250,250);break;case r.SpringGreen:t=new se(255,0,255,127);break;case r.SteelBlue:t=new se(255,70,130,180);break;case r.Tan:t=new se(255,210,180,140);break;case r.Teal:t=new se(255,0,128,128);break;case r.Thistle:t=new se(255,216,191,216);break;case r.Tomato:t=new se(255,255,99,71);break;case r.Turquoise:t=new se(255,64,224,208);break;case r.Violet:t=new se(255,238,130,238);break;case r.Wheat:t=new se(255,245,222,179);break;case r.White:t=new se(255,255,255,255);break;case r.WhiteSmoke:t=new se(255,245,245,245);break;case r.Yellow:t=new se(255,255,255,0);break;case r.YellowGreen:t=new se(255,154,205,50)}return t},Wm.sBrushes=new ml;var jm=Wm;function Wm(){}Object.defineProperty(Qm.prototype,"factors",{get:function(){return this.mFactors},set:function(e){if(null==e)throw new Error("ArgumentNullException : Factors");this.mFactors=e},enumerable:!0,configurable:!0}),Object.defineProperty(Qm.prototype,"positions",{get:function(){return this.mPositions},set:function(e){for(var t=e,i=0;i<t.length;i++)(t[i]<0||1<t[i])&&(t[i]=0);this.mPositions=t,this.mPositions=e},enumerable:!0,configurable:!0}),Object.defineProperty(Qm.prototype,"count",{get:function(){return this.mCount},enumerable:!0,configurable:!0}),Qm.prototype.generateColorBlend=function(e,t){if(null==e)throw new Error("ArgumentNullException : colours");null==this.positions&&(this.positions=[0]);var i=new Gm(this.count),n=this.positions,o=null;if(1===n.length)(n=[3])[0]=0,n[1]=this.positions[0],n[2]=1,(o=new Array(3))[0]=e[0],o[1]=e[0],o[2]=e[1];else for(var r=e[0],s=e[1],o=new Array(this.count),a=0,l=this.count,a=0;a<l;++a)o[a]=this.interpolate(this.mFactors[a],r,s,t);return i.positions=n,i.colors=o,i},Qm.prototype.clonePdfBlend=function(){return null!=this.mFactors&&(this.factors=this.mFactors),null!=this.positions&&(this.positions=this.positions),this},Qm.prototype.gcd=function(e,t){if("number"==typeof e&&"number"==typeof t&&void 0!==t){if(e<0||1<e)throw new Error("ArgumentOutOfRangeException : u");if(t<0||1<t)throw new Error("ArgumentOutOfRangeException : v");var i=Math.max(1,e*this.precision),t=Math.max(1,t*this.precision);return this.gcdInt(i,t)/this.precision}var n=e;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(1<n.length)for(var r=n.length,s=1;s<r&&(o=this.gcd(n[s],o))!==1/this.precision;++s);return o},Qm.prototype.gcdInt=function(e,t){if(e<=0)throw new Error("ArgumentOutOfRangeException"+e+"The arguments cannot be less or equal to zero.");if(t<=0)throw new Error("ArgumentOutOfRangeException"+t+"The arguments cannot be less or equal to zero.");if(1===e||1===t)return 1;for(var i,n=0;this.isEven(e,t);)++n,e>>=1,t>>=1;for(;(1&e)<=0;)e>>=1;do{for(;(1&t)<=0;)t>>=1}while(t<e&&(i=t,t=e,e=i),0!==(t-=e));return e<<n},Qm.prototype.isEven=function(e,t){return"number"==typeof t&&void 0!==t?(1&e)<=0&&(1&t)<=0:(1&e)<=0},Qm.prototype.interpolate=function(e,t,i,n){if(t instanceof se){var o=new se;switch(n){case qh.Rgb:var r=this.interpolate(e,t.red,i.red),s=this.interpolate(e,t.green,i.green),a=this.interpolate(e,t.blue,i.blue),o=new se(r,s,a);break;case qh.GrayScale:r=this.interpolate(e,t.gray,i.gray);o=new se(r);break;case qh.Cmyk:var s=this.interpolate(e,t.c,i.c),a=this.interpolate(e,t.m,i.m),r=this.interpolate(e,t.y,i.y),l=this.interpolate(e,t.k,i.k);o=new se(s,a,r,l)}return o}return 0===e?t:1===e?i:t+ +e*(i-t)};var s=Qm;function Qm(e){this.precision=1e3}Um=function(e,t){return(Um=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Um(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ym,qm=s),Object.defineProperty(Ym.prototype,"colors",{get:function(){return this.mcolors},set:function(e){if(null==e)throw new Error("ArgumentNullException : Colors");this.mcolors=e},enumerable:!0,configurable:!0}),Ym.prototype.getFunction=function(e){var t,i,n,o,r=this.getColorComponentsCount(e),s=this.getMaxComponentValue(e),r=this.setRange(r,s),a=null;return null==this.mbrush&&void 0===this.mbrush?(t=[1],n=void 0,i=1,n=2===this.positions.length?2:(o=this.positions,o=this.getIntervals(o),1/(i=this.gcd(o))+1),t[0]=n,o=this.getSamplesValues(e,n,s,i),new Hm([0,1],r,t,o)):a},Ym.prototype.cloneColorBlend=function(){return null!=this.mcolors&&void 0!==this.mcolors&&(this.colors=this.mcolors),null!=this.positions&&void 0!==this.positions&&(this.positions=this.positions),this},Ym.prototype.setRange=function(e,t){for(var i=[2*e],n=0;n<e;++n)i[2*n]=0,i[2*n+1]=1;return i},Ym.prototype.getColorComponentsCount=function(e){var t=0;switch(e){case qh.Rgb:t=3;break;case qh.Cmyk:t=4;break;case qh.GrayScale:t=1;break;default:throw new Error("ArgumentException - Unsupported color space: "+e+" colorSpace")}return t},Ym.prototype.getSamplesValues=function(e,t,i,n){var o;switch(e){case qh.GrayScale:o=this.getGrayscaleSamples(t,i,n);break;case qh.Cmyk:o=this.getCmykSamples(t,i,n);break;case qh.Rgb:o=this.getRgbSamples(t,i,n);break;default:throw new Error("ArgumentException - Unsupported color space: "+e+" colorSpace")}return o},Ym.prototype.getGrayscaleSamples=function(e,t,i){for(var n=[2*e],o=0;o<e;++o)this.getNextColor(o,i,qh.GrayScale);return n},Ym.prototype.getRgbSamples=function(e,t,i){for(var n=[3*e],o=0;o<e;++o){var r=this.getNextColor(o,i,qh.Rgb),s=3*o;n[s]=r.r,n[1+s]=r.g,n[2+s]=r.b}return n},Ym.prototype.getCmykSamples=function(e,t,i){for(var n=[4*e],o=0;o<e;o++){var r=this.getNextColor(o,i,qh.Cmyk),s=4*o;n[s]=r.c*t,n[1+s]=r.m*t,n[2+s]=r.y*t,n[3+s]=r.k*t}return n},Ym.prototype.getNextColor=function(e,t,i){var n,o,t=t*e,e=this.getIndices(t,void 0,void 0),r=e.indexLow,e=e.indexHi;return r===e?this.mcolors[r]:(n=this.positions[r],o=this.positions[e],r=this.mcolors[r],e=this.mcolors[e],this.interpolate((t-n)/(o-n),r,e,i))},Ym.prototype.getIndices=function(e,t,i){for(var n=this.positions,o=i=t=0;o<this.mcolors.length;++o){var r=n[o];if(r===e){t=i=o;break}if(e<r){i=o;break}i=t=o}return{indexLow:t,indexHi:i}},Ym.prototype.getMaxComponentValue=function(e){var t=0;switch(e){case qh.Cmyk:case qh.Rgb:t=255;break;case qh.GrayScale:t=65535;break;default:throw new Error("ArgumentException - Unsupported color space: "+e+"colorSpace")}return t},Ym.prototype.getIntervals=function(e){for(var t=e.length,i=[t-1],n=e[0],o=1;o<t;++o){var r=e[o];i[o-1]=r-n,n=r}return i};var Um,qm,Gm=Ym;function Ym(e){var t=qm.call(this)||this;return t="number"==typeof e?qm.call(this,e)||this:t}Xm=function(e,t){return(Xm=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Xm(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Zm,Km=iu),Zm.prototype.initialize=function(e,t){this.mColours=[e,t],this.mColourBlend=new Gm(2),this.mColourBlend.positions=[0,1],this.mColourBlend.colors=this.mColours,this.initShading()},Object.defineProperty(Zm.prototype,"blend",{get:function(){return this.mBlend},set:function(e){if(null==e)throw new Error("ArgumentNullException : Blend");if(null==this.mColours)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=e,this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(Zm.prototype,"interpolationColors",{get:function(){return this.mColourBlend},set:function(e){if(null==e)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColours=null,this.mColourBlend=e,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(Zm.prototype,"linearColors",{get:function(){return this.mColours},set:function(e){if(null==e)throw new Error("ArgumentNullException : LinearColors");if(e.length<2)throw new Error("ArgumentException : The array is too small - LinearColors");null==this.mColours&&void 0===this.mColours?this.mColours=[e[0],e[1]]:(this.mColours[0]=e[0],this.mColours[1]=e[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlend=new Gm(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(Zm.prototype,"rectangle",{get:function(){return this.mBoundaries},enumerable:!0,configurable:!0}),Object.defineProperty(Zm.prototype,"extend",{get:function(){var e,t=Nm.None,i=this.shading.items.getValue(this.mDictionaryProperties.extend);return null!=i&&(e=i.items(0),i=i.items(1),e.value&&(t|=Nm.Start),i.value)&&(t|=Nm.End),t},set:function(e){var t,i,n=this.shading.items.getValue(this.mDictionaryProperties.extend);null==n?(t=new Jd(!1),i=new Jd(!1),(n=new Bl).add(t),n.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,n)):(t=n.items(0),n.items(1))},enumerable:!0,configurable:!0}),Zm.prototype.addPoints=function(e,t){var i=e.x+t.x,e=e.y+t.y;return new ed(i,e)},Zm.prototype.subPoints=function(e,t){var i=e.x-t.x,e=e.y-t.y;return new ed(i,e)},Zm.prototype.mulPoints=function(e,t){return e.x*t.x+e.y*t.y},Zm.prototype.mulPoint=function(e,t){return e.x=e.x*t,e.y=e.y*t,e},Zm.prototype.choosePoint=function(e){var t=new ed(0,0);if(e<90&&0<e)t=new ed(this.mBoundaries.right,this.mBoundaries.bottom);else if(e<180&&90<e)t=new ed(this.mBoundaries.left,this.mBoundaries.bottom);else if(e<270&&180<e)t=new ed(this.mBoundaries.left,this.mBoundaries.top);else{if(!(270<e))throw new Error("PdfException - Internal error.");t=new ed(this.mBoundaries.right,this.mBoundaries.top)}return t},Zm.prototype.setPoints=function(e,t){var i=new Bl;i.add(new kl(e.x)),i.add(new kl(this.updateY(e.y))),i.add(new kl(t.x)),i.add(new kl(this.updateY(t.y))),this.shading.items.setValue(this.mDictionaryProperties.coords,i)},Zm.prototype.updateY=function(e){return 0!==e?-e:e},Zm.prototype.initShading=function(){this.colorSpace=qh.Rgb,this.function=this.mColourBlend.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new kl(_m.Axial))},Zm.prototype.clone=function(){var e=this;return e.resetPatternDictionary(new Sl(this.patternDictionary)),e.shading=new Sl,e.initShading(),e.setPoints(e.mPointStart,e.mPointEnd),null!==e&&e instanceof Zm&&null!=this.matrix&&void 0!==this.matrix&&(e.matrix=this.matrix.clone()),null!=this.mColours&&void 0!==this.mColours&&(e.mColours=this.mColours),null!=this.blend&&void 0!==this.blend?e.blend=this.blend.clonePdfBlend():null!=this.interpolationColors&&void 0!==this.interpolationColors&&(e.interpolationColors=this.interpolationColors.cloneColorBlend()),e.extend=this.extend,this.cloneBackgroundValue(e),this.cloneAntiAliasingValue(e),e},Zm.prototype.resetFunction=function(){this.function=this.mColourBlend.getFunction(this.colorSpace)};var Xm,Km,Jm=Zm;function Zm(e,t,i,n){var o,r,s,a=Km.call(this,new Sl)||this;if(a.mDictionaryProperties=new Cl,e instanceof ed&&t instanceof ed&&i instanceof se&&n instanceof se)a.initialize(i,n),a.mPointStart=e,a.mPointEnd=t,a.setPoints(a.mPointStart,a.mPointEnd);else if(e instanceof nd)if(a.initialize(t,i),n===Vm.BackwardDiagonal||n===Vm.ForwardDiagonal||n===Vm.Horizontal||n===Vm.Vertical){switch(a.mBoundaries=e,n){case Vm.BackwardDiagonal:a.mPointStart=new ed(e.right,e.top),a.mPointEnd=new ed(e.left,e.bottom);break;case Vm.ForwardDiagonal:a.mPointStart=new ed(e.left,e.top),a.mPointEnd=new ed(e.right,e.bottom);break;case Vm.Horizontal:a.mPointStart=new ed(e.left,e.top),a.mPointEnd=new ed(e.right,e.top);break;case Vm.Vertical:a.mPointStart=new ed(e.left,e.top),a.mPointEnd=new ed(e.left,e.bottom);break;default:throw new Error("ArgumentException -- Unsupported linear gradient mode: "+n+" mode")}a.setPoints(a.mPointStart,a.mPointEnd)}else"number"==typeof n&&void 0!==n&&(a.mBoundaries=e,0===(n%=360)?(a.mPointStart=new ed(e.left,e.top),a.mPointEnd=new ed(e.right,e.top)):90===n?(a.mPointStart=new ed(e.left,e.top),a.mPointEnd=new ed(e.left,e.bottom)):180===n?(a.mPointEnd=new ed(e.left,e.top),a.mPointStart=new ed(e.right,e.top)):270===n?(a.mPointEnd=new ed(e.left,e.top),a.mPointStart=new ed(e.left,e.bottom)):(t=n*(Math.PI/180),i=Math.tan(t),r=a.mBoundaries.left+(a.mBoundaries.right-a.mBoundaries.left)/2,s=a.mBoundaries.top+(a.mBoundaries.bottom-a.mBoundaries.top)/2,o=new ed(r,s),s=i*(r=a.mBoundaries.width/(2*Math.cos(t))),r+=o.x,s+=o.y,i=new ed(r,s),t=a.subPoints(i,o),r=a.choosePoint(n),s=a.mulPoints(a.subPoints(r,o),t)/a.mulPoints(t,t),a.mPointEnd=a.addPoints(o,a.mulPoint(t,s)),a.mPointStart=a.addPoints(o,a.mulPoint(t,-1*s))),a.setPoints(a.mPointEnd,a.mPointStart));return a}$m=function(e,t){return($m=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}$m(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(of,ef=iu),of.prototype.initialize=function(e,t){this.mColour=[e,t],this.mColourBlends=new Gm(2),this.mColourBlends.positions=[0,1],this.mColourBlends.colors=this.mColour,this.initShading()},Object.defineProperty(of.prototype,"blend",{get:function(){return this.mBlend},set:function(e){if(null==e)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=e,this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(of.prototype,"interpolationColors",{get:function(){return this.mColourBlends},set:function(e){if(null==e)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColour=null,this.mColourBlends=e,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(of.prototype,"linearColors",{get:function(){return this.mColour},set:function(e){if(null==e)throw new Error("ArgumentNullException : radial LinearColors");if(e.length<2)throw new Error("ArgumentException : The array is too small LinearColors");null==this.mColour&&void 0===this.mColour?this.mColour=[e[0],e[1]]:(this.mColour[0]=e[0],this.mColour[1]=e[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlends=new Gm(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(of.prototype,"rectangle",{get:function(){return this.mBoundaries},set:function(e){this.mBoundaries=e,this.bBox=Bl.fromRectangle(e)},enumerable:!0,configurable:!0}),Object.defineProperty(of.prototype,"extend",{get:function(){var e,t=Nm.None,i=this.shading.items.getValue(this.mDictionaryProperties.extend);return null!=i&&(e=i.items(0),i=i.items(1),e.value&&(t|=Nm.Start),i.value)&&(t|=Nm.End),t},set:function(e){var t,i,n=this.shading.items.getValue(this.mDictionaryProperties.extend);null==n&&void 0===n?(t=new Jd(!1),i=new Jd(!1),(n=new Bl).add(t),n.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,n)):(t=n.items(0),n.items(1))},enumerable:!0,configurable:!0}),of.prototype.setPoints=function(e,t,i,n){var o=new Bl;o.add(new kl(e.x)),o.add(new kl(this.updateY(e.y))),o.add(new kl(i)),o.add(new kl(t.x)),o.add(new kl(this.updateY(t.y))),i!==n?o.add(new kl(n)):o.add(new kl(0)),this.shading.items.setValue(this.mDictionaryProperties.coords,o)},of.prototype.updateY=function(e){return 0!==e?-e:e},of.prototype.initShading=function(){this.colorSpace=qh.Rgb,this.function=this.mColourBlends.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new kl(_m.Radial))},of.prototype.clone=function(){var e=this;return e.resetPatternDictionary(new Sl(this.patternDictionary)),e.shading=new Sl,e.initShading(),e.setPoints(this.mPointStart,this.mPointEnd,this.mRadiusStart,this.mRadiusEnd),e instanceof of&&null!==this.matrix&&void 0!==this.matrix&&(e.matrix=this.matrix.clone()),null!==this.mColour&&void 0!==this.mColour&&(e.mColour=this.mColour),null!==this.blend&&void 0!==this.blend?e.blend=this.blend.clonePdfBlend():null!==this.interpolationColors&&void 0!==this.interpolationColors&&(e.interpolationColors=this.interpolationColors.cloneColorBlend()),e.extend=this.extend,this.cloneBackgroundValue(e),this.cloneAntiAliasingValue(e),e},of.prototype.resetFunction=function(){this.function=this.mColourBlends.getFunction(this.colorSpace)};var $m,ef,tf,nf=of;function of(e,t,i,n,o,r){var s=ef.call(this,new Sl)||this;if(s.mDictionaryProperties=new Cl,s.initialize(o,r),t<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 s.mPointEnd=i,s.mPointStart=e,s.mRadiusStart=t,s.mRadiusEnd=n,s.setPoints(s.mPointStart,s.mPointEnd,s.mRadiusStart,s.mRadiusEnd),s}(sf=tf=tf||{})[sf.Overlap=0]="Overlap",sf[sf.Inside=1]="Inside";rf=function(e,t){return(rf=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])}))(e,t)};var rf,sf=function(e,t){function i(){this.constructor=e}rf(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},af=(Object.defineProperty(lf.prototype,"backgroundBrush",{get:function(){return this.gridBackgroundBrush},set:function(e){this.gridBackgroundBrush=e},enumerable:!0,configurable:!0}),Object.defineProperty(lf.prototype,"textBrush",{get:function(){return this.gridTextBrush},set:function(e){this.gridTextBrush=e},enumerable:!0,configurable:!0}),Object.defineProperty(lf.prototype,"textPen",{get:function(){return this.gridTextPen},set:function(e){this.gridTextPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(lf.prototype,"font",{get:function(){return this.gridFont},set:function(e){this.gridFont=e},enumerable:!0,configurable:!0}),Object.defineProperty(lf.prototype,"backgroundImage",{get:function(){return this.gridBackgroundImage},set:function(e){this.gridBackgroundImage=e},enumerable:!0,configurable:!0}),lf);function lf(){}sf(pf,hf=af),Object.defineProperty(pf.prototype,"cellSpacing",{get:function(){return void 0===this.gridCellSpacing&&(this.gridCellSpacing=0),this.gridCellSpacing},set:function(e){this.gridCellSpacing=e},enumerable:!0,configurable:!0}),Object.defineProperty(pf.prototype,"horizontalOverflowType",{get:function(){return this.gridHorizontalOverflowType},set:function(e){this.gridHorizontalOverflowType=e},enumerable:!0,configurable:!0}),Object.defineProperty(pf.prototype,"allowHorizontalOverflow",{get:function(){return this.bAllowHorizontalOverflow},set:function(e){this.bAllowHorizontalOverflow=e},enumerable:!0,configurable:!0}),Object.defineProperty(pf.prototype,"cellPadding",{get:function(){return void 0===this.gridCellPadding&&(this.gridCellPadding=new Vg),this.gridCellPadding},set:function(e){void 0===this.gridCellPadding&&(this.gridCellPadding=new Vg),this.gridCellPadding=e},enumerable:!0,configurable:!0}),Object.defineProperty(pf.prototype,"borderOverlapStyle",{get:function(){return this.gridBorderOverlapStyle},set:function(e){this.gridBorderOverlapStyle=e},enumerable:!0,configurable:!0});var hf,df=pf;function pf(){var e=hf.call(this)||this;return e.gridBorderOverlapStyle=tf.Overlap,e.bAllowHorizontalOverflow=!1,e.gridHorizontalOverflowType=mf.LastPage,e}sf(gf,cf=af),Object.defineProperty(gf.prototype,"stringFormat",{get:function(){return this.format},set:function(e){this.format=e},enumerable:!0,configurable:!0}),Object.defineProperty(gf.prototype,"borders",{get:function(){return this.gridCellBorders},set:function(e){this.gridCellBorders=e},enumerable:!0,configurable:!0}),Object.defineProperty(gf.prototype,"cellPadding",{get:function(){return this.gridCellPadding},set:function(e){null!=this.gridCellPadding&&void 0!==this.gridCellPadding||(this.gridCellPadding=new Vg),this.gridCellPadding=e},enumerable:!0,configurable:!0});var cf,uf=gf;function gf(){var e=cf.call(this)||this;return e.gridCellBorders=Og.default,e}Object.defineProperty(yf.prototype,"backgroundBrush",{get:function(){return this.gridRowBackgroundBrush},enumerable:!0,configurable:!0}),yf.prototype.setBackgroundBrush=function(e){if(this.gridRowBackgroundBrush=e,void 0!==this.parent)for(var t=0;t<this.parent.cells.count;t++)this.parent.cells.getCell(t).style.backgroundBrush=e},Object.defineProperty(yf.prototype,"textBrush",{get:function(){return this.gridRowTextBrush},enumerable:!0,configurable:!0}),yf.prototype.setTextBrush=function(e){if(this.gridRowTextBrush=e,void 0!==this.parent)for(var t=0;t<this.parent.cells.count;t++)this.parent.cells.getCell(t).style.textBrush=e},Object.defineProperty(yf.prototype,"textPen",{get:function(){return this.gridRowTextPen},enumerable:!0,configurable:!0}),yf.prototype.setTextPen=function(e){if(this.gridRowTextPen=e,void 0!==this.parent)for(var t=0;t<this.parent.cells.count;t++)this.parent.cells.getCell(t).style.textPen=e},Object.defineProperty(yf.prototype,"font",{get:function(){return this.gridRowFont},enumerable:!0,configurable:!0}),yf.prototype.setFont=function(e){if(this.gridRowFont=e,void 0!==this.parent)for(var t=0;t<this.parent.cells.count;t++)this.parent.cells.getCell(t).style.font=e},Object.defineProperty(yf.prototype,"border",{get:function(){return void 0===this.gridRowBorder&&this.setBorder(new Og),this.gridRowBorder},enumerable:!0,configurable:!0}),yf.prototype.setBorder=function(e){if(this.gridRowBorder=e,void 0!==this.parent)for(var t=0;t<this.parent.cells.count;t++)this.parent.cells.getCell(t).style.borders=e},yf.prototype.setParent=function(e){this.parent=e},Object.defineProperty(yf.prototype,"backgroundImage",{get:function(){return this.gridRowBackgroundImage},enumerable:!0,configurable:!0}),yf.prototype.setBackgroundImage=function(e){this.gridRowBackgroundImage=e};var mf,ff=yf;function yf(){}(sf=mf=mf||{})[sf.NextPage=0]="NextPage",sf[sf.LastPage=1]="LastPage";Object.defineProperty(bf.prototype,"isCellMergeContinue",{get:function(){return this.internalIsCellMergeContinue},set:function(e){this.internalIsCellMergeContinue=e},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"isRowMergeContinue",{get:function(){return this.internalIsRowMergeContinue},set:function(e){this.internalIsRowMergeContinue=e},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"isCellMergeStart",{get:function(){return this.internalIsCellMergeStart},set:function(e){this.internalIsCellMergeStart=e},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"isRowMergeStart",{get:function(){return this.internalIsRowMergeStart},set:function(e){this.internalIsRowMergeStart=e},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"remainingString",{get:function(){return this.remaining},set:function(e){this.remaining=e},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"FinishedDrawingCell",{get:function(){return this.isFinish},set:function(e){this.isFinish=e},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"stringFormat",{get:function(){return null==this.format&&(this.format=new xd),this.format},set:function(e){this.format=e},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"row",{get:function(){return this.gridRow},set:function(e){this.gridRow=e},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"value",{get:function(){return this.objectValue},set:function(e){if(this.objectValue=e,this.objectValue instanceof Lf){this.row.grid.isSingleGrid=!1;(this.objectValue.ParentCell=this).objectValue.isChildGrid=!0;for(var t=this.row.grid.rows.count,i=0;i<t;i++)for(var n=this.row.grid.rows.getRow(i),o=n.cells.count,r=0;r<o;r++)n.cells.getCell(r).parent=this}},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"rowSpan",{get:function(){return this.gridRowSpan},set:function(e){if(e<1)throw new Error("ArgumentException : Invalid span specified, must be greater than or equal to 1");this.gridRowSpan=e,this.row.rowSpanExists=!0,this.row.grid.hasRowSpanSpan=!0},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"style",{get:function(){return null==this.cellStyle&&(this.cellStyle=new uf),this.cellStyle},set:function(e){this.cellStyle=e},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"height",{get:function(){return 0===this.cellHeight&&(this.cellHeight=this.measureHeight()),this.cellHeight},set:function(e){this.cellHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"columnSpan",{get:function(){return this.colSpan},set:function(e){if(e<1)throw Error("Invalid span specified, must be greater than or equal to 1");this.colSpan=e,this.row.columnSpanExists=!0},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"width",{get:function(){return 0!==this.cellWidth&&!this.row.grid.isComplete||(this.cellWidth=this.measureWidth()),Math.round(this.cellWidth)},set:function(e){this.cellWidth=e},enumerable:!0,configurable:!0}),bf.prototype.measureWidth=function(){var e,t=0,i=new Dd;return"string"==typeof this.objectValue?t=(t+=i.layout(this.objectValue,this.getTextFont(),this.stringFormat,new td(Number.MAX_VALUE,Number.MAX_VALUE),!1,new td(0,0)).actualSize.width)+2*(this.style.borders.left.width+this.style.borders.right.width):this.objectValue instanceof Lf?t=this.objectValue.size.width:this.objectValue instanceof ec||this.objectValue instanceof oc?t+=this.objectValue.width:this.objectValue instanceof am&&(e=this.objectValue,t=(t+=i.layout(e.text,e.font,e.stringFormat,new td(0,0),!1,new td(0,0)).actualSize.width)+2*(this.style.borders.left.width+this.style.borders.right.width)),this.objectValue instanceof Lf?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},bf.prototype.drawCellBackground=function(e,t){var i=this.getBackgroundBrush();null!=i&&(e.save(),e.drawRectangle(i,t.x,t.y,t.width,t.height),e.restore()),null!=this.style.backgroundImage&&(this.getBackgroundImage(),e.drawImage(this.style.backgroundImage,t.x,t.y,t.width,t.height))},bf.prototype.adjustContentLayoutArea=function(e){var t,i,n,o,e=new id(e.x,e.y,e.width,e.height);return this.objectValue instanceof Lf?(null==this.style.cellPadding||void 0===this.style.cellPadding?null!==this.gridRow.grid.style.cellPadding&&void 0!==this.gridRow.grid.style.cellPadding&&(o=this.gridRow.grid.style.cellPadding.hasLeftPad,t=this.gridRow.grid.style.cellPadding.hasTopPad,i=this.gridRow.grid.style.cellPadding.hasRightPad,n=this.gridRow.grid.style.cellPadding.hasBottomPad,o||t||i||n)?(void 0!==this.gridRow.grid.style.cellPadding.left&&o&&(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&&t&&(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&&i&&(e.width-=this.gridRow.grid.style.cellPadding.right),void 0!==this.gridRow.grid.style.cellPadding.bottom&&n&&(e.height-=this.gridRow.grid.style.cellPadding.bottom)):null!==(o=this.getStringFormat()).alignment&&void 0!==o.alignment||(e.x+=this.row.grid.style.cellPadding.left,e.y+=this.row.grid.style.cellPadding.top):(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,e.y+=this.gridRow.grid.style.cellPadding.top,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.x+=this.style.cellPadding.left,e.y+=this.style.cellPadding.top,e.width-=this.style.cellPadding.right+this.style.cellPadding.left,e.height-=this.style.cellPadding.bottom+this.style.cellPadding.top,1===this.rowSpan&&(e.width-=this.style.borders.left.width)),void 0===this.style.borders||null==this.style.borders?(e.x+=this.gridRow.style.border.left.width,e.y+=this.gridRow.style.border.top.width,e.width-=this.gridRow.style.border.left.width+this.gridRow.style.border.right.width,e.height-=this.gridRow.style.border.top.width+this.gridRow.style.border.bottom.width):(e.x+=this.style.borders.left.width,e.y+=this.style.borders.top.width,e.width-=this.style.borders.left.width+this.style.borders.right.width,e.height-=this.style.borders.top.width+this.style.borders.bottom.width,1===this.rowSpan&&(e.width-=this.style.borders.left.width))),e},bf.prototype.draw=function(e,t,i){var n=null;if(this.internalIsCellMergeContinue||this.internalIsRowMergeContinue){if(!this.internalIsCellMergeContinue||!this.row.grid.style.allowHorizontalOverflow)return n;if(0<this.row.rowOverflowIndex&&this.row.cells.indexOf(this)!=this.row.rowOverflowIndex+1||0==this.row.rowOverflowIndex&&this.internalIsCellMergeContinue)return n}t=this.adjustOuterLayoutArea(t,e),this.drawCellBackground(e,t);var o,r,s,a,l,h=this.getTextPen(),d=this.getTextBrush(),p=(void 0===h&&void 0===d&&(d=new Sd(new se(0,0,0))),this.getTextFont()),c=this.getStringFormat(),u=t;return u.height>=e.clientSize.height&&this.row.grid.allowRowBreakAcrossPages&&(u.height-=u.y,void 0!==this._rowHeight)&&null!==this._rowHeight&&u.height>this._rowHeight&&(u.height=this._rowHeight),u=this.adjustContentLayoutArea(u),"string"==typeof this.objectValue||"string"==typeof this.remaining?(l=s=void 0,l=u.height<p.height?new id(u.x,u.y,u.width,p.height):u,u.height<p.height&&this.row.grid.isChildGrid&&null!=this.row.grid.ParentCell&&(o=l.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),0<o)&&o<p.height&&(l.height=o),0!=this.gridRow.grid.style.cellSpacing&&(l.width-=this.gridRow.grid.style.cellSpacing,t.width-=this.gridRow.grid.style.cellSpacing),this.isFinish?(s=""===this.remaining?this.remaining:this.objectValue,e.drawString(s,p,h,d,l.x,l.y,l.width,l.height,c),-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,p,h,d,l.x,l.y,l.width,l.height,c),this.isFinish=!0),n=e.stringLayoutResult):this.objectValue instanceof Lf?(s=void((o=this.objectValue).isChildGrid=!0),s=u,0!=(o.ParentCell=this).gridRow.grid.style.cellSpacing&&(t.width-=this.gridRow.grid.style.cellSpacing),l=new Vf(o),a=new Qf,null!=this.row.grid.LayoutFormat?a=this.row.grid.LayoutFormat:a.layout=Xc.Paginate,r=new Bg,null!=e.layer&&(r.page=e.page,r.bounds=s,r.format=a,o.setSpan(),o.checkSpan(),s=l.Layouter(r),this.value=o,-1!==this.row.grid.splitChildRowIndex&&(this.height=this.row.rowBreakHeightValue),r.page!=s.page)&&(null!==this.row.rowBreakHeightValue&&void 0!==this.row.rowBreakHeightValue&&(s.bounds.height=this.row.rowBreakHeightValue),0==this.row.rowBreakHeight?this.row.NestedGridLayoutResult=s:this.row.rowBreakHeight=this.row.rowBreakHeightValue)):this.objectValue instanceof ec||this.objectValue instanceof oc?(a=new id(u.x,u.y,u.width,u.height),(l=this.objectValue).width<=u.width&&(a.width=l.width),l.height<=u.height&&(a.height=l.height),e.drawImage(this.objectValue,a.x,a.y,a.width,a.height)):this.objectValue instanceof am?this.objectValue.draw(e.currentPage,u):void 0===this.objectValue&&(this.objectValue="",e.drawString(this.objectValue,p,h,d,u.x,u.y,u.width,u.height,c),null!=this.style.cellPadding&&0==this.style.cellPadding.bottom&&0==this.style.cellPadding.left&&0==this.style.cellPadding.right&&0==this.style.cellPadding.top&&(t.width-=this.style.borders.left.width+this.style.borders.right.width),0!=this.gridRow.grid.style.cellSpacing)&&(t.width-=this.gridRow.grid.style.cellSpacing),null!=this.style.borders&&(this.fontSpilt?-1!=this.row.grid.ParentCell.row.grid.splitChildRowIndex&&(this.row.rowFontSplit=!1,this.drawCellBorders(e,t)):this.drawCellBorders(e,t)),n},bf.prototype.drawCellBorders=function(e,t){this.row.grid.style.borderOverlapStyle===tf.Inside&&(t.x+=this.style.borders.left.width,t.y+=this.style.borders.top.width,t.width-=this.style.borders.right.width,t.height-=this.style.borders.bottom.width);var i=new ed(t.x,t.y+t.height),n=new ed(t.x,t.y),o=this.cellStyle.borders.left;this.cellStyle.borders.left.dashStyle===Qh.Solid&&(o.lineCap=Wh.Square),0!==o.width&&e.drawLine(o,i,n),i=new ed(t.x+t.width,t.y),n=new ed(t.x+t.width,t.y+t.height),o=this.cellStyle.borders.right,t.x+t.width>e.clientSize.width-o.width/2&&(i=new ed(e.clientSize.width-o.width/2,t.y),n=new ed(e.clientSize.width-o.width/2,t.y+t.height)),this.cellStyle.borders.right.dashStyle===Qh.Solid&&(o.lineCap=Wh.Square),0!==o.width&&e.drawLine(o,i,n),i=new ed(t.x,t.y),n=new ed(t.x+t.width,t.y),o=this.cellStyle.borders.top,this.cellStyle.borders.top.dashStyle===Qh.Solid&&(o.lineCap=Wh.Square),0!==o.width&&e.drawLine(o,i,n),i=new ed(t.x+t.width,t.y+t.height),n=new ed(t.x,t.y+t.height),o=this.cellStyle.borders.bottom,t.y+t.height>e.clientSize.height-o.width/2&&(i=new ed(t.x+t.width,e.clientSize.height-o.width/2),n=new ed(t.x,e.clientSize.height-o.width/2)),this.cellStyle.borders.bottom.dashStyle===Qh.Solid&&(o.lineCap=Wh.Square),0!==o.width&&e.drawLine(o,i,n)},bf.prototype.adjustOuterLayoutArea=function(e,t){var i=!1,n=this.row.grid.style.cellSpacing,o=(0<n&&(e=new id(e.x+n,e.y+n,e.width-n,e.height-n)),this.row.cells.indexOf(this));if(1<this.columnSpan||0<this.row.rowOverflowIndex&&o==this.row.rowOverflowIndex+1&&this.isCellMergeContinue){if(1==(l=this.columnSpan)&&this.isCellMergeContinue)for(var r=o+1;r<this.row.grid.columns.count&&this.row.cells.getCell(r).isCellMergeContinue;r++)l++;for(var s=0,a=o;a<o+l;a++){if(this.row.grid.style.allowHorizontalOverflow)if((this.row.grid.size.width<t.clientSize.width?this.row.grid.size:t.clientSize).width<(this.row.grid.size.width>t.clientSize.width?e.x+s+this.row.grid.columns.getColumn(a).width:s+this.row.grid.columns.getColumn(a).width))break;s+=this.row.grid.columns.getColumn(a).width}s-=this.row.grid.style.cellSpacing,e.width=s}if(1<this.rowSpan||this.row.rowSpanExists){for(var l=this.rowSpan,h=this.row.grid.rows.rowCollection.indexOf(this.row),d=(-1==h&&-1!=(h=this.row.grid.headers.indexOf(this.row))&&(i=!0),0),a=h;a<h+l;a++){d+=(i?this.row.grid.headers.getHeader(a):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);d-=this.row.grid.style.cellSpacing,e.height=d,this.row.rowMergeComplete||(e.height=d)}return e},bf.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:sg.defaultFont},bf.prototype.getTextBrush=function(){return(void 0!==this.style.textBrush&&null!=this.style.textBrush?this:void 0!==this.row.style.textBrush&&null!=this.row.style.textBrush?this.row:this.row.grid).style.textBrush},bf.prototype.getTextPen=function(){return(void 0!==this.style.textPen&&null!=this.style.textPen?this:void 0!==this.row.style.textPen&&null!=this.row.style.textPen?this.row:this.row.grid).style.textPen},bf.prototype.getBackgroundBrush=function(){return(void 0!==this.style.backgroundBrush&&null!=this.style.backgroundBrush?this:void 0!==this.row.style.backgroundBrush&&null!=this.row.style.backgroundBrush?this.row:this.row.grid).style.backgroundBrush},bf.prototype.getBackgroundImage=function(){return(void 0!==this.style.backgroundImage&&null!=this.style.backgroundImage?this:void 0!==this.row.style.backgroundImage&&null!=this.row.style.backgroundImage?this.row:this.row.grid).style.backgroundImage},bf.prototype.getStringFormat=function(){return(void 0!==this.style.stringFormat&&null!=this.style.stringFormat?this.style:this).stringFormat},bf.prototype.measureHeight=function(){var e,t,i=this.calculateWidth(),n=(null==this.style.cellPadding||void 0===this.style.cellPadding?i-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:i=(i-=this.style.cellPadding.right+this.style.cellPadding.left)-(this.style.borders.left.width+this.style.borders.right.width),0),o=new Dd;return"string"==typeof this.objectValue||"string"==typeof this.remaining?(t=this.objectValue,this.isFinish||(t=null!==this.remaining&&""!==this.remaining&&void 0!==this.remaining?this.remaining:this.objectValue),e=this.row.cells.indexOf(this),0!=this.gridRow.grid.style.cellSpacing&&(i-=2*this.gridRow.grid.style.cellSpacing),this.row.cells.getCell(e).hasColSpan||this.row.cells.getCell(e).hasRowSpan||(this.gridRow.grid.isChildGrid?(i<0?(this.tempval=i,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=i,n+=o.layout(t,this.getTextFont(),this.stringFormat,new td(this.tempval,0),!1,new td(0,0)).actualSize.height):n+=o.layout(t,this.getTextFont(),this.stringFormat,new td(i,0),!1,new td(0,0)).actualSize.height),n+=2*(this.style.borders.top.width+this.style.borders.bottom.width)):this.objectValue instanceof Lf?(e=this.row.cells.indexOf(this),t=0,null!=this.style.cellPadding||void 0!==this.style.cellPadding?(t=this.calculateWidth(),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)):null!=this.row.grid.style.cellPadding||void 0!==this.row.grid.style.cellPadding?(t=this.calculateWidth(),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)):t=this.calculateWidth(),this.objectValue.tempWidth=t,this.row.cells.getCell(e).hasColSpan||this.row.cells.getCell(e).hasRowSpan?n+=2*(this.style.borders.top.width+this.style.borders.bottom.width):n=this.objectValue.size.height,0!==this.gridRow.grid.style.cellSpacing&&(i-=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&&(n+=this.row.grid.style.cellPadding.top),this.row.grid.style.cellPadding.hasBottomPad&&void 0!==this.row.grid.style.cellPadding.bottom&&(n+=this.row.grid.style.cellPadding.bottom)),n+=this.objectValue.style.cellSpacing):this.objectValue instanceof ec||this.objectValue instanceof oc?n+=this.objectValue.height:this.objectValue instanceof am?(t=this.objectValue,n=(n+=o.layout(t.text,t.font,t.stringFormat,new td(i,0),!1,new td(0,0)).actualSize.height)+2*(this.style.borders.top.width+this.style.borders.bottom.width)):void 0===this.objectValue&&(null==this.style.cellPadding||void 0===this.style.cellPadding?i-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:i=(i-=this.style.cellPadding.right+this.style.cellPadding.left)-(this.style.borders.left.width+this.style.borders.right.width),n+=2*(this.style.borders.top.width+this.style.borders.bottom.width)),this.objectValue instanceof Lf?null==this.style.cellPadding||void 0===this.style.cellPadding?(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(n+=this.row.grid.style.cellPadding.top),void 0!==this.row.grid.style.cellPadding.bottom&&this.row.grid.style.cellPadding.hasBottomPad&&(n+=this.row.grid.style.cellPadding.bottom)):(void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(n+=this.style.cellPadding.top),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(n+=this.style.cellPadding.bottom)):null==this.style.cellPadding||void 0===this.style.cellPadding?n+=this.row.grid.style.cellPadding.top+this.row.grid.style.cellPadding.bottom:n+=this.style.cellPadding.top+this.style.cellPadding.bottom,n+=this.row.grid.style.cellSpacing},bf.prototype.calculateWidth=function(){var e=this.row.cells.indexOf(this),t=(this.row.grid.rows.rowCollection.indexOf(this.row),this.columnSpan),i=0;if(1===t)for(var n=0;n<t;n++)i+=this.row.grid.columns.getColumn(e+n).width;else if(1<t)for(n=0;n<t;n++)i+=this.row.grid.columns.getColumn(e+n).width,n+1<t&&(this.row.cells.getCell(e+n+1).hasColSpan=!0);if(null!=this.parent&&0<this.parent.row.width&&this.row.grid.isChildGrid&&null!=this.parent&&this.row.width>this.parent.row.width){for(var i=0,o=0;o<this.parent.columnSpan;o++)i+=this.parent.row.grid.columns.getColumn(o).width;i/=this.row.cells.count}return i};var vf=bf;function bf(e){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!==e&&(this.gridRow=e)}Cf.prototype.getCell=function(e){if(e<0||e>=this.count)throw new Error("IndexOutOfRangeException");return this.cells[e]},Object.defineProperty(Cf.prototype,"count",{get:function(){return this.cells.length},enumerable:!0,configurable:!0}),Cf.prototype.add=function(e){var t;if(void 0===e)return t=new vf,this.add(t),e;e.row=this.gridRow,this.cells.push(e)},Cf.prototype.indexOf=function(e){return this.cells.indexOf(e)};var wf=Cf;function Cf(e){this.cells=[],this.gridRow=e}Object.defineProperty(Af.prototype,"width",{get:function(){return this.columnWidth},set:function(e){this.isCustomWidth=!0,this.columnWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(Af.prototype,"format",{get:function(){return null==this.stringFormat&&(this.stringFormat=new xd),this.stringFormat},set:function(e){this.stringFormat=e},enumerable:!0,configurable:!0});var Sf=Af;function Af(e){this.columnWidth=0,this.grid=e}If.prototype.add=function(e){for(var t=0;t<e;t++){this.internalColumns.push(new Sf(this.grid));for(var i=0;i<this.grid.rows.count;i++){var n=this.grid.rows.getRow(i),o=new vf;o.value="",n.cells.add(o)}}},Object.defineProperty(If.prototype,"count",{get:function(){return this.internalColumns.length},enumerable:!0,configurable:!0}),Object.defineProperty(If.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(If.prototype,"columns",{get:function(){return this.internalColumns},enumerable:!0,configurable:!0}),If.prototype.getColumn=function(e){if(0<=e&&e<=this.columns.length)return this.columns[e];throw Error("can not get the column from the index: "+e)},If.prototype.measureColumnsWidth=function(){var e=0;this.grid.measureColumnsWidth();for(var t=0,i=this.internalColumns.length;t<i;t++)e+=this.internalColumns[t].width;return e},If.prototype.getDefaultWidths=function(e){for(var t=[],i=this.count,n=0;n<this.count;n++)this.grid.isPageWidth&&0<=e&&!this.internalColumns[n].isCustomWidth?this.internalColumns[n].width=0:(t[n]=this.internalColumns[n].width,0<this.internalColumns[n].width&&this.internalColumns[n].isCustomWidth?(e-=this.internalColumns[n].width,i--):t[n]=0);for(n=0;n<this.count;n++)t[n]<=0&&(t[n]=e/i);return t};var xf=If;function If(e){this.internalColumns=[],this.columnWidth=0,this.grid=e,this.internalColumns=[]}Object.defineProperty(Ef.prototype,"rowSpanExists",{get:function(){return this.bRowSpanExists},set:function(e){this.bRowSpanExists=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ef.prototype,"cells",{get:function(){return null==this.gridCells&&(this.gridCells=new wf(this)),this.gridCells},enumerable:!0,configurable:!0}),Object.defineProperty(Ef.prototype,"grid",{get:function(){return this.pdfGrid},set:function(e){this.pdfGrid=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ef.prototype,"style",{get:function(){return void 0===this.rowStyle&&(this.rowStyle=new ff,this.rowStyle.setParent(this)),this.rowStyle},set:function(e){this.rowStyle=e;for(var t=0;t<this.cells.count;t++)this.cells.getCell(t).style.borders=e.border,void 0!==e.font&&(this.cells.getCell(t).style.font=e.font),void 0!==e.backgroundBrush&&(this.cells.getCell(t).style.backgroundBrush=e.backgroundBrush),void 0!==e.backgroundImage&&(this.cells.getCell(t).style.backgroundImage=e.backgroundImage),void 0!==e.textBrush&&(this.cells.getCell(t).style.textBrush=e.textBrush),void 0!==e.textPen&&(this.cells.getCell(t).style.textPen=e.textPen)},enumerable:!0,configurable:!0}),Object.defineProperty(Ef.prototype,"rowBreakHeight",{get:function(){return void 0===this.gridRowBreakHeight&&(this.gridRowBreakHeight=0),this.gridRowBreakHeight},set:function(e){this.gridRowBreakHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ef.prototype,"rowOverflowIndex",{get:function(){return this.gridRowOverflowIndex},set:function(e){this.gridRowOverflowIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ef.prototype,"height",{get:function(){return this.isRowHeightSet||(this.rowHeight=this.measureHeight()),this.rowHeight},set:function(e){this.rowHeight=e,this.isRowHeightSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(Ef.prototype,"width",{get:function(){return 0!==this.rowWidth&&void 0!==this.rowWidth||(this.rowWidth=this.measureWidth()),this.rowWidth},enumerable:!0,configurable:!0}),Object.defineProperty(Ef.prototype,"NestedGridLayoutResult",{get:function(){return this.gridResult},set:function(e){this.gridResult=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ef.prototype,"columnSpanExists",{get:function(){return this.bColumnSpanExists},set:function(e){this.bColumnSpanExists=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ef.prototype,"rowMergeComplete",{get:function(){return this.isRowMergeComplete},set:function(e){this.isRowMergeComplete=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ef.prototype,"rowIndex",{get:function(){return this.grid.rows.rowCollection.indexOf(this)},enumerable:!0,configurable:!0}),Ef.prototype.measureHeight=function(){for(var e=0,t=0,i=1<this.cells.getCell(0).rowSpan?0:this.cells.getCell(0).height,n=0;n<this.cells.count;n++){var o=this.cells.getCell(n);if(o.rowSpanRemainingHeight>e&&(e=o.rowSpanRemainingHeight),this.rowMergeComplete=!1,1<o.rowSpan){for(var r=n,s=(this.isHeaderRow?this.grid.headers:this.grid.rows.rowCollection).indexOf(this),a=0;a<o.rowSpan;a++)a+1<o.rowSpan&&((this.isHeaderRow?this.grid.headers.getHeader(s+a+1):this.grid.rows.getRow(s+a+1)).cells.getCell(r).hasRowSpan=!0);t<o.height&&(t=o.height)}else i=Math.max(i,o.height)}return 0===(i=i<t?t:i)?i=t:0<e&&(i+=e),i},Ef.prototype.measureWidth=function(){for(var e=0,t=0;t<this.grid.columns.count;t++)e+=this.grid.columns.getColumn(t).width;return e};var Tf=Ef;function Ef(e){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.isHeaderRow=!1,this.pdfGrid=e}Object.defineProperty(Mf.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),Object.defineProperty(Mf.prototype,"rowCollection",{get:function(){return this.rows},enumerable:!0,configurable:!0}),Mf.prototype.addRow=function(e){var t;if(void 0===e)return t=new Tf(this.grid),this.addRow(t),t;if(e.style.setBackgroundBrush(this.grid.style.backgroundBrush),e.style.setFont(this.grid.style.font),e.style.setTextBrush(this.grid.style.textBrush),e.style.setTextPen(this.grid.style.textPen),0===e.cells.count)for(var i=0;i<this.grid.columns.count;i++)e.cells.add(new vf);this.rows.push(e)},Mf.prototype.getRow=function(e){return this.rows[e]};var Df=Mf;function Mf(e){this.rows=[],this.grid=e}Pf.prototype.getHeader=function(e){return this.rows[e]},Object.defineProperty(Pf.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),Pf.prototype.add=function(e){if("number"==typeof e){for(var t=void 0,i=0;i<e;i++){(t=new Tf(this.grid)).isHeaderRow=!0;for(var n=0;n<this.grid.columns.count;n++)t.cells.add(new vf);this.rows.push(t)}return this.rows}this.rows.push(e)},Pf.prototype.indexOf=function(e){return this.rows.indexOf(e)};var kf=Pf;function Pf(e){this.rows=[],this.grid=e,this.rows=[]}Bf=function(e,t){return(Bf=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Bf(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Rf,Ff=Hg),Object.defineProperty(Rf.prototype,"raiseBeginCellDraw",{get:function(){return void 0!==this.beginCellDraw&&null!==typeof this.beginCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(Rf.prototype,"raiseEndCellDraw",{get:function(){return void 0!==this.endCellDraw&&null!==typeof this.endCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(Rf.prototype,"repeatHeader",{get:function(){return null!=this.bRepeatHeader&&void 0!==this.bRepeatHeader||(this.bRepeatHeader=!1),this.bRepeatHeader},set:function(e){this.bRepeatHeader=e},enumerable:!0,configurable:!0}),Object.defineProperty(Rf.prototype,"allowRowBreakAcrossPages",{get:function(){return this.breakRow},set:function(e){this.breakRow=e},enumerable:!0,configurable:!0}),Object.defineProperty(Rf.prototype,"columns",{get:function(){return null!=this.gridColumns&&void 0!==this.gridColumns||(this.gridColumns=new xf(this)),this.gridColumns},enumerable:!0,configurable:!0}),Object.defineProperty(Rf.prototype,"rows",{get:function(){return null==this.gridRows&&(this.gridRows=new Df(this)),this.gridRows},enumerable:!0,configurable:!0}),Object.defineProperty(Rf.prototype,"headers",{get:function(){return null!=this.gridHeaders&&void 0!==this.gridHeaders||(this.gridHeaders=new kf(this)),this.gridHeaders},enumerable:!0,configurable:!0}),Object.defineProperty(Rf.prototype,"initialWidth",{get:function(){return this.gridInitialWidth},set:function(e){this.gridInitialWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(Rf.prototype,"style",{get:function(){return null==this.gridStyle&&(this.gridStyle=new df),this.gridStyle},set:function(e){null==this.gridStyle&&(this.gridStyle=e)},enumerable:!0,configurable:!0}),Object.defineProperty(Rf.prototype,"isPageWidth",{get:function(){return this.ispageWidth},set:function(e){this.ispageWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(Rf.prototype,"isChildGrid",{get:function(){return this.ischildGrid},set:function(e){this.ischildGrid=e},enumerable:!0,configurable:!0}),Object.defineProperty(Rf.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(e){this.gridSize=e},enumerable:!0,configurable:!0}),Object.defineProperty(Rf.prototype,"ParentCell",{get:function(){return this.parentCell},set:function(e){this.parentCell=e},enumerable:!0,configurable:!0}),Object.defineProperty(Rf.prototype,"LayoutFormat",{get:function(){return this.layoutFormat},enumerable:!0,configurable:!0}),Rf.prototype.draw=function(e,t,i,n){var o;return t instanceof ed&&void 0===t.width&&void 0===i?this.drawHelper(e,t.x,t.y):"number"==typeof t&&"number"==typeof i&&void 0===n?this.drawHelper(e,t,i,null):t instanceof id&&void 0!==t.width&&void 0===i?this.drawHelper(e,t,null):t instanceof ed&&void 0===t.width&&i instanceof kg?this.drawHelper(e,t.x,t.y,i):"number"==typeof t&&"number"==typeof i&&(n instanceof kg||null==n)?(o=e.graphics.clientSize.width-t,o=new id(t,i,o,0),this.drawHelper(e,o,n)):t instanceof id&&void 0!==t.width&&"boolean"==typeof i?this.drawHelper(e,t,null):this.drawHelper(e,t,i)},Rf.prototype.measure=function(){for(var e=0,t=this.columns.width,i=0;i<this.headers.count;i++)e+=this.headers.getHeader(i).height;for(i=0;i<this.rows.count;i++)e+=this.rows.getRow(i).height;return new td(t,e)},Rf.prototype.onBeginCellDraw=function(e){this.raiseBeginCellDraw&&this.beginCellDraw(this,e)},Rf.prototype.onEndCellDraw=function(e){this.raiseEndCellDraw&&this.endCellDraw(this,e)},Rf.prototype.layout=function(e){var t=e.bounds.width,i=e.bounds.height,n=!1;return void 0!==e.bounds.width&&0!==e.bounds.width||(t=e.page.getClientSize().width-e.bounds.x,n=!0),void 0!==e.bounds.height&&0!==e.bounds.height||(i=e.page.getClientSize().height-e.bounds.y,n=!0),n&&(e.bounds=new id(e.bounds.x,e.bounds.y,t,i)),0!==this.rows.count&&null!=(n=this.rows.getRow(0).cells.getCell(0).style).borders&&(null!=n.borders.left&&1!==n.borders.left.width||null!=n.borders.top&&1!==n.borders.top.width)&&(t=n.borders.left.width/2,i=n.borders.top.width/2,e.bounds.x===Og.default.right.width/2)&&e.bounds.y===Og.default.right.width/2&&(n=new id(t,i,this.gridSize.width,this.gridSize.height),e.bounds=n),this.setSpan(),this.checkSpan(),this.layoutFormat=e.format,this.gridLocation=e.bounds,new Vf(this).Layouter(e)},Rf.prototype.setSpan=function(){for(var e=1,t=1,i=0,n=0,o=0,r=this.headers.count,s=0;s<r;s++){for(var a=this.headers.getHeader(s),l=a.cells.count,h=o=0;h<l;h++){var d=a.cells.getCell(h),o=Math.max(o,d.rowSpan);if(!d.isCellMergeContinue&&!d.isRowMergeContinue&&(1<d.columnSpan||1<d.rowSpan)){if(d.columnSpan+h>a.cells.count)throw new Error("Invalid span specified at row "+h.toString()+" column "+s.toString());if(d.rowSpan+s>this.headers.count)throw new Error("Invalid span specified at Header "+h.toString()+" column "+s.toString());if(1<d.columnSpan&&1<d.rowSpan){for(e=d.columnSpan,t=d.rowSpan,i=h,n=s,d.isCellMergeStart=!0,d.isRowMergeStart=!0;1<e;)i++,a.cells.getCell(i).isCellMergeContinue=!0,a.cells.getCell(i).isRowMergeContinue=!0,a.cells.getCell(i).rowSpan=t,e--;for(i=h,e=d.columnSpan;1<t;){for(n++,this.headers.getHeader(n).cells.getCell(h).isRowMergeContinue=!0,this.headers.getHeader(n).cells.getCell(i).isRowMergeContinue=!0,t--;1<e;)i++,this.headers.getHeader(n).cells.getCell(i).isCellMergeContinue=!0,this.headers.getHeader(n).cells.getCell(i).isRowMergeContinue=!0,e--;e=d.columnSpan,i=h}}else if(1<d.columnSpan&&1===d.rowSpan)for(e=d.columnSpan,i=h,d.isCellMergeStart=!0;1<e;)i++,a.cells.getCell(i).isCellMergeContinue=!0,e--;else if(1===d.columnSpan&&1<d.rowSpan)for(t=d.rowSpan,n=s;1<t;)n++,this.headers.getHeader(n).cells.getCell(h).isRowMergeContinue=!0,t--}}a.maximumRowSpan=o}},Rf.prototype.checkSpan=function(){var e=1,t=0,i=0,n=e=1,o=i=0;if(this.hasRowSpanSpan||this.hasColumnSpan)for(var r=this.rows.count,s=0;s<r;s++){for(var a=this.rows.getRow(s),l=a.cells.count,h=t=0;h<l;h++){var d=a.cells.getCell(h),t=Math.max(t,d.rowSpan);if(!d.isCellMergeContinue&&!d.isRowMergeContinue&&(1<d.columnSpan||1<d.rowSpan)){if(d.columnSpan+h>a.cells.count)throw new Error("Invalid span specified at row  "+h.toString()+" column "+s.toString());if(d.rowSpan+s>this.rows.count)throw new Error("Invalid span specified at row  "+h.toString()+" column "+s.toString());if(1<d.columnSpan&&1<d.rowSpan){for(n=d.columnSpan,e=d.rowSpan,o=h,i=s,d.isCellMergeStart=!0,d.isRowMergeStart=!0;1<n;)o++,a.cells.getCell(o).isCellMergeContinue=!0,a.cells.getCell(o).isRowMergeContinue=!0,n--;for(o=h,n=d.columnSpan;1<e;){for(i++,this.rows.getRow(i).cells.getCell(h).isRowMergeContinue=!0,this.rows.getRow(i).cells.getCell(o).isRowMergeContinue=!0,e--;1<n;)o++,this.rows.getRow(i).cells.getCell(o).isCellMergeContinue=!0,this.rows.getRow(i).cells.getCell(o).isRowMergeContinue=!0,n--;n=d.columnSpan,o=h}}else if(1<d.columnSpan&&1===d.rowSpan)for(n=d.columnSpan,o=h,d.isCellMergeStart=!0;1<n;)o++,a.cells.getCell(o).isCellMergeContinue=!0,n--;else if(1===d.columnSpan&&1<d.rowSpan)for(e=d.rowSpan,i=s;1<e;)i++,this.rows.getRow(i).cells.getCell(h).isRowMergeContinue=!0,e--}}a.maximumRowSpan=t}},Rf.prototype.measureColumnsWidth=function(e){if(void 0!==e){this.isPageWidth=!1;for(var t=this.columns.getDefaultWidths(e.width-e.x),i=0,n=this.columns.count;i<n;i++)this.columns.getColumn(i).columnWidth=t[i],this.tempWidth=t[i];if(null!=this.ParentCell&&0==this.style.allowHorizontalOverflow&&0==this.ParentCell.row.grid.style.allowHorizontalOverflow){var o,r=0,s=0,a=this.columns.count;null==this.ParentCell.style.cellPadding&&void 0===this.ParentCell.style.cellPadding||(void 0!==this.ParentCell.style.cellPadding.left&&this.ParentCell.style.cellPadding.hasLeftPad&&(r+=this.ParentCell.style.cellPadding.left),void 0!==this.ParentCell.style.cellPadding.right&&this.ParentCell.style.cellPadding.hasRightPad&&(r+=this.ParentCell.style.cellPadding.right));for(i=0;i<this.ParentCell.columnSpan;i++)s+=this.ParentCell.row.grid.columns.getColumn(this.parentCellIndex+i).width;for(var l=0;l<this.columns.count;l++)0<this.gridColumns.getColumn(l).width&&this.gridColumns.getColumn(l).isCustomWidth&&(s-=this.gridColumns.getColumn(l).width,a--);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&&(r+=this.ParentCell.row.grid.style.cellPadding.top),void 0!==this.ParentCell.row.grid.style.cellPadding.bottom&&this.ParentCell.row.grid.style.cellPadding.hasBottomPad&&(r+=this.ParentCell.row.grid.style.cellPadding.bottom)),0!=this.ParentCell.row.grid.style.cellSpacing&&(s-=2*this.ParentCell.row.grid.style.cellSpacing),r<s&&(this.tempWidth=o=(s-r)/a,null!=this.ParentCell))for(l=0;l<this.columns.count;l++)this.columns.getColumn(l).isCustomWidth||(this.columns.getColumn(l).columnWidth=o)}}else{for(var t=[this.columns.count],h=0;h<this.columns.count;h++)t[h]=0;var d=0;if((void 0===this.isChildGrid&&void 0!==this.gridLocation||null===this.isChildGrid&&void 0!==this.gridLocation)&&(this.initialWidth=this.gridLocation.width),0<this.headers.count)for(var p=this.headers.getHeader(0).cells.count,c=this.headers.count,i=0;i<p;i++){for(l=d=0;l<c;l++)var u=Math.min(this.initialWidth,this.headers.getHeader(l).cells.getCell(i).width),d=Math.max(d,u);t[i]=d}for(var i=d=0,g=this.columns.count;i<g;i++){for(l=0,c=this.rows.count;l<c;l++)(1!=this.rows.getRow(l).cells.getCell(i).columnSpan||this.rows.getRow(l).cells.getCell(i).isCellMergeContinue)&&null==this.rows.getRow(l).cells.getCell(i).value||(null==this.rows.getRow(l).cells.getCell(i).value||this.rows.getRow(l).grid.style.allowHorizontalOverflow||(this.rows.getRow(l).grid.style.cellPadding.right,this.rows.getRow(l).grid.style.cellPadding.left,this.rows.getRow(l).cells.getCell(i).style.borders.left.width),u=(u=0)<this.initialWidth?Math.min(this.initialWidth,this.rows.getRow(l).cells.getCell(i).width):this.rows.getRow(l).cells.getCell(i).width,d=Math.max(t[i],Math.max(d,u)),d=Math.max(this.columns.getColumn(i).width,d));0!=this.rows.count&&(t[i]=d),d=0}for(var i=0,m=this.rows.count;i<m;i++)for(var l=0,f=this.columns.count;l<f;l++)if(1<this.rows.getRow(i).cells.getCell(l).columnSpan){t[l];for(var y=1;y<this.rows.getRow(i).cells.getCell(l).columnSpan;y++)t[l+y]}for(i=0,n=this.columns.count;i<n;i++)(this.columns.getColumn(i).width<=0||0<this.columns.getColumn(i).width&&!this.columns.getColumn(i).isCustomWidth)&&(this.columns.getColumn(i).columnWidth=t[i]);for(var v,r=0,b=0,w=this.columns.count,b=this.tempWidth,l=0;l<this.columns.count;l++)0<this.gridColumns.getColumn(l).width&&this.gridColumns.getColumn(l).isCustomWidth&&(b-=this.gridColumns.getColumn(l).width,w--);if(0<b&&0!=this.ParentCell.row.grid.style.cellSpacing&&(b-=2*this.ParentCell.row.grid.style.cellSpacing),r<b&&(v=b/w,null!=this.ParentCell))for(l=0;l<this.columns.count;l++)this.columns.getColumn(l).isCustomWidth||(this.columns.getColumn(l).columnWidth=v)}};var Bf,Ff,Lf=Rf;function Rf(){var e=Ff.call(this)||this;return e.gridSize=new td(0,0),e.isGridSplit=!1,e.isRearranged=!1,e.pageBounds=new id,e.listOfNavigatePages=[],e.parentCellIndex=0,e.tempWidth=0,e.breakRow=!0,e.splitChildRowIndex=-1,e.hasRowSpanSpan=!1,e.hasColumnSpan=!1,e.isSingleGrid=!0,e}Of=function(e,t){return(Of=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])}))(e,t)};var Of,Nf,sf=function(e,t){function i(){this.constructor=e}Of(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Vf=(sf(_f,Nf=Dg),Object.defineProperty(_f.prototype,"Grid",{get:function(){return this.elements},enumerable:!0,configurable:!0}),_f.prototype.getFormat=function(e){return e},_f.prototype.layoutInternal=function(e){var t=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 i=this.currentGraphics.page.section.indexOf(this.currentGraphics.page);if(this.listOfNavigatePages.push(i),null!=t&&t.break===Kc.FitColumnsToPage?this.currentBounds=new id(new ed(e.bounds.x,e.bounds.y),new td(this.Grid.columns.width,this.currentGraphics.clientSize.height)):this.currentBounds=new id(new ed(e.bounds.x,e.bounds.y),this.currentGraphics.clientSize),0!==this.Grid.rows.count)this.currentBounds.width=0<e.bounds.width?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 ed(e.bounds.x,e.bounds.y),0<e.bounds.height&&!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=[],void 0!==this.Grid.isChildGrid&&(this.Grid.isChildGrid,1)?this.Grid.measureColumnsWidth(this.currentBounds):this.Grid.measureColumnsWidth(new id(this.currentBounds.x,this.currentBounds.y,this.currentBounds.x+this.currentBounds.width,this.currentBounds.height)),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)},_f.prototype.determineColumnDrawRanges=function(){for(var e=0,t=0,i=0,n=this.currentGraphics.clientSize.width-this.currentBounds.x,o=0;o<this.Grid.columns.count;o++)if(n<=(i+=this.Grid.columns.getColumn(o).width)){for(var r=0,s=e;s<=o&&!(n<(r+=this.Grid.columns.getColumn(s).width));s++)t=s;this.columnRanges.push([e,t]),i=(t=e=t+1)<=o?this.Grid.columns.getColumn(o).width:0}this.columnRanges.push([e,this.Grid.columns.count-1])},_f.prototype.layoutOnPage=function(e){this.pageBounds.x=e.bounds.x,this.pageBounds.y=e.bounds.y,this.pageBounds.height=e.bounds.height;for(var t,i=this.getFormat(e.format),n=new Lp,o=e.page,r=[],s=0;s<this.columnRanges.length;s++){for(var a=this.columnRanges[s],l=(this.cellStartIndex=a[0],this.cellEndIndex=a[1],this.raiseBeforePageLayout(this.currentPage,this.currentBounds,this.currentRowIndex)),h=(this.currentBounds=l.currentBounds,this.currentRowIndex=l.currentRowIndex,void 0),d=0;d<this.Grid.headers.count;d++){var p=this.Grid.headers.getHeader(d),O=this.currentBounds.y;if(this.isHeader=!0,o!=this.currentPage)for(var c=this.cellStartIndex;c<=this.cellEndIndex;c++)p.cells.getCell(c).isCellMergeContinue&&(p.cells.getCell(c).isCellMergeContinue=!1,p.cells.getCell(c).value="");var N=this.drawRow(p);O===this.currentBounds.y?(h=!0,-1===_f.repeatRowIndex&&(_f.repeatRowIndex=d)):h=!1,!N.isFinish&&null!==o&&i.layout!==Xc.OnePage&&h&&(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageformat(i),this.startLocation.y=this.currentBounds.y,void 0!==i.paginateBounds&&0===i.paginateBounds.x&&0===i.paginateBounds.y&&0===i.paginateBounds.width&&0===i.paginateBounds.height&&(this.currentBounds.x+=this.startLocation.x),this.drawRow(p)),this.isHeader=!1}for(var u=0,g=(this.Grid.rows.count,void 0),V=!0,r=[],m=0;m<this.Grid.rows.count;m++){var p=this.Grid.rows.getRow(m),f=(u++,this.currentRowIndex=u-1,this.currentBounds.y),o=this.currentPage,y=(_f.repeatRowIndex=-1,V&&p.grid.isChildGrid&&(V=!1),null);if(-1!=this.Grid.splitChildRowIndex&&!(p.grid.ParentCell.row.grid.isGridSplit&&this.Grid.splitChildRowIndex<=p.rowIndex)){if(p.isrowFinish)continue;break}for(y=this.drawRow(p),p.isrowFinish=!0,r.push(y.bounds.width),f===this.currentBounds.y?(g=!0,_f.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(p)):(g=!1,_f.repeatRowIndex=-1);!y.isFinish&&null!=o;){var v=this.getLayoutResult();if(this.raisePageLayouted(v).cancel||g)break;if(this.Grid.allowRowBreakAcrossPages){this.currentPage=this.getNextPageformat(i);this.currentBounds.y;var _,v=new ed(Og.default.right.width/2,Og.default.top.width/2);if(0===i.paginateBounds.x&&0===i.paginateBounds.y&&0===i.paginateBounds.width&&0===i.paginateBounds.height&&this.startLocation.x===v.x&&this.startLocation.y===v.y&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y),this.isPaginate&&(this.startLocation.y=this.currentBounds.y,this.isPaginate=!1),this.Grid.isChildGrid&&null!=p.grid.ParentCell&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&p.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top<this.currentBounds.height&&(this.currentBounds.y=this.Grid.ParentCell.row.grid.style.cellPadding.top),null!=p.grid.ParentCell){p.grid.ParentCell.row.isRowBreaksNextPage=!0,p.grid.ParentCell.row.rowBreakHeightValue=p.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top+this.Grid.ParentCell.row.grid.style.cellPadding.bottom;for(var b=p.rowIndex+1;b<p.grid.rows.count;b++)p.grid.ParentCell.row.rowBreakHeightValue+=p.grid.rows.getRow(b).height}if(p.grid.isChildGrid){p.isrowFinish=!1,p.grid.splitChildRowIndex=p.rowIndex,p.grid.ParentCell.row.grid.splitChildRowIndex=p.grid.ParentCell.row.rowIndex,p.grid.ParentCell.row.grid.isGridSplit&&(p.grid.ParentCell.row.noOfPageCount+=1,p.grid.ParentCell.row.grid.isGridSplit=!1);break}if(p.noOfPageCount<1){if(-1!=p.grid.splitChildRowIndex&&(p.grid.isGridSplit=!0),null!=p.style.border&&(null!=p.style.border.left&&1!==p.style.border.left.width||null!=p.style.border.top&&1!==p.style.border.top.width)&&(v=p.style.border.left.width/2,_=p.style.border.top.width/2,this.currentBounds.x===Og.default.right.width/2)&&this.currentBounds.y===Og.default.right.width/2&&(v=new id(v,_,this.currentBounds.width,this.currentBounds.height),this.currentBounds=v),this.Grid.repeatHeader)for(var w=0;w<this.Grid.headers.count;w++){var H=this.Grid.headers.getHeader(w);this.drawRow(H)}if(y=this.drawRow(p),1<=p.noOfPageCount){p.rowBreakHeightValue;for(var z=0;z<p.noOfPageCount;z++){var j=this.getLayoutResult();this.raisePageLayouted(j);if(this.currentPage=this.getNextPageformat(i),this.currentBounds.y,-1!=p.grid.splitChildRowIndex&&(p.grid.isGridSplit=!0),this.currentBounds.y=.5,this.Grid.repeatHeader)for(var C=0;C<this.Grid.headers.count;C++){var S=this.Grid.headers.getHeader(C);this.drawRow(S)}this.drawRow(p)}}p.grid.splitChildRowIndex=-1,p.grid.isGridSplit=!1,y.isFinish=this.checkIsFisished(p);for(var A=0;A<p.cells.count;A++)p.cells.getCell(A).value instanceof Lf&&(p.cells.getCell(A).value.splitChildRowIndex=-1)}}}if(!y.isFinish&&null!==o&&i.layout!==Xc.OnePage&&g){if(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageformat(i),this.raiseBeforePageLayout(this.currentPage,this.currentBounds,this.currentRowIndex).returnValue)break;if(null!==e.format&&!e.format.usePaginateBounds&&null!==e.bounds&&0<e.bounds.height&&!this.Grid.isChildGrid&&(this.currentBounds.height=e.bounds.height),void 0===e.format||null==e.format||void 0===e.format.usePaginateBounds||e.format.usePaginateBounds||0===e.format.paginateBounds.x&&0===e.format.paginateBounds.y&&0===e.format.paginateBounds.width&&0===e.format.paginateBounds.height||0!==e.format.paginateBounds.y?(this.currentBounds.y=null==i?0:i.paginateBounds.y,null==i||0===i.paginateBounds.x&&0===i.paginateBounds.y&&0===i.paginateBounds.height&&0===i.paginateBounds.width||(this.currentBounds.x=i.paginateBounds.x,this.currentBounds.width=i.paginateBounds.width,this.currentBounds.height=i.paginateBounds.height)):this.currentBounds.y=Og.default.top.width/2,void 0!==e.format&&null!==e.format&&void 0!==e.format.usePaginateBounds&&!e.format.usePaginateBounds&&null!==e.bounds&&0<e.bounds.y&&!this.Grid.isChildGrid&&(this.currentBounds.y=e.bounds.y),this.startLocation.y=this.currentBounds.y,i.paginateBounds.x===i.paginateBounds.y&&i.paginateBounds.y===i.paginateBounds.height&&i.paginateBounds.height===i.paginateBounds.width&&0===i.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x),this.currentBounds.x===Og.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.Grid.repeatHeader)for(var x=0;x<this.Grid.headers.count;x++){S=this.Grid.headers.getHeader(x);this.drawRow(S)}this.drawRow(p),null===this.currentPage||n.containsKey(this.currentPage)||n.add(this.currentPage,a)}if(null!=p.NestedGridLayoutResult){this.currentPage=p.NestedGridLayoutResult.page,this.currentGraphics=this.currentPage.graphics,this.startLocation=new ed(p.NestedGridLayoutResult.bounds.x,p.NestedGridLayoutResult.bounds.y);f=this.ReCalculateHeight(p,p.NestedGridLayoutResult.bounds.height);if(this.currentBounds.y=f,o!=this.currentPage){for(var f=(L=this.currentPage.section).indexOf(o)+1,W=L.indexOf(this.currentPage),I=f;I<W+1;I++){var T=L.getPages()[I].graphics,E=new ed(i.paginateBounds.x,i.paginateBounds.y),D=I==W?p.NestedGridLayoutResult.bounds.height-e.bounds.y:this.currentBounds.height-E.y;D<=T.clientSize.height&&(D+=e.bounds.y),E.y=null==i?.5:i.paginateBounds.y;for(var M=0;M<p.cells.count;M++){var k=p.cells.getCell(M),P=0,Q=0,B=void 0;if(k.value instanceof Lf)for(var B=B||k,U=0;U<k.value.columns.count;U++)Q+=k.value.columns.getColumn(U).columnWidth;else Q=k.width;if(1<k.columnSpan)for(;M<k.columnSpan;M++)P+=p.grid.columns.getColumn(M).width;else P=Math.max(Q,p.grid.columns.getColumn(M).width);var F=void 0,B=("number"==typeof(F=(B&&B.style&&B.style.cellPadding?B:this.Grid).style.cellPadding.bottom)&&D+F<T.clientSize.height&&(D+=F,this.currentBounds.y+=F),k.drawCellBorders(T,new id(E,new td(P,D))),this.Grid.rows.getRow(this.Grid.rows.count-1).width);P!==B&&k.drawCellBorders(T,new id(E,new td(B,D))),E.x+=P,M+=k.columnSpan-1}}o=this.currentPage}}}for(var q,L,G=!1,R=0,l=(0<r.length&&(R=r[0]),[[1,2]]),M=0;M<this.Grid.rows.count;M++)-1!=this.cellEndIndex&&this.Grid.rows.getRow(M).cells.getCell(this.cellEndIndex).value instanceof Lf&&(q=this.Grid.rows.getRow(M).cells.getCell(this.cellEndIndex).value,this.rowLayoutBoundsWidth=q.rowLayoutBoundsWidth,G=!0);if(!G&&0<r.length){for(M=0;M<u-1;M++)R<r[M]&&(R=r[M]);this.rowLayoutBoundsWidth=R}else this.rowLayoutBoundsWidth=l[0][1];this.columnRanges.indexOf(a)<this.columnRanges.length-1&&null!=o&&i.layout!=Xc.OnePage&&(this.Grid.isChildGrid,0!=l[0][0]?((L=this.currentPage.section).indexOf(this.currentPage),this.currentGraphics=this.currentPage.graphics,this.currentBounds=new id(new ed(0,0),this.currentPage.getClientSize()),this.currentGraphics.page.section.indexOf(this.currentGraphics.page)):this.currentPage=this.getNextPageformat(i)),this.columnRanges.length-1!==s&&1<this.columnRanges.length&&i.layout!==Xc.OnePage&&(this.currentPage=this.getNextPageformat(i),i.paginateBounds.x===i.paginateBounds.y)&&i.paginateBounds.y===i.paginateBounds.height&&i.paginateBounds.height===i.paginateBounds.width&&0===i.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y)}return t=this.getLayoutResult(),this.Grid.style.allowHorizontalOverflow&&this.Grid.style.horizontalOverflowType==mf.NextPage&&this.reArrangePages(n),this.raisePageLayouted(t),t},_f.prototype.checkIsFisished=function(e){for(var t=!0,i=0;i<e.cells.count;i++)e.cells.getCell(i).FinishedDrawingCell||(t=!1);return t},_f.prototype.getNextPageformat=function(e){var t=this.currentPage.section,i=null,n=t.indexOf(this.currentPage),t=(this.flag=!1,i=n===t.count-1?t.add():t.getPages()[n+1],this.currentGraphics=i.graphics,this.currentGraphics.page.section.indexOf(this.currentGraphics.page));return-1===this.listOfNavigatePages.indexOf(t)&&this.listOfNavigatePages.push(t),this.currentBounds=new id(new ed(0,0),i.getClientSize()),void 0!==e&&null!=e&&e.usePaginateBounds&&void 0!==e.paginateBounds&&null!=e.paginateBounds&&e.paginateBounds.x!==e.paginateBounds.y&&e.paginateBounds.y!==e.paginateBounds.height&&e.paginateBounds.height!==e.paginateBounds.width&&0!==e.paginateBounds.width&&(this.currentBounds.x=e.paginateBounds.x,this.currentBounds.y=e.paginateBounds.y,this.currentBounds.height=e.paginateBounds.height),i},_f.prototype.CheckIfDefaultFormat=function(e){var t=new xd;return e.alignment===t.alignment&&e.characterSpacing===t.characterSpacing&&e.clipPath===t.clipPath&&e.firstLineIndent===t.firstLineIndent&&e.horizontalScalingFactor===t.horizontalScalingFactor&&e.lineAlignment===t.lineAlignment&&e.lineLimit===t.lineLimit&&e.lineSpacing===t.lineSpacing&&e.measureTrailingSpaces===t.measureTrailingSpaces&&e.noClip===t.noClip&&e.paragraphIndent===t.paragraphIndent&&e.rightToLeft===t.rightToLeft&&e.subSuperScript===t.subSuperScript&&e.wordSpacing===t.wordSpacing&&e.wordWrap===t.wordWrap},_f.prototype.RaiseBeforeCellDraw=function(e,t,i,n,o,r){return this.Grid.raiseBeginCellDraw&&(e=new Xf(e,t,i,n,o,r),this.Grid.onBeginCellDraw(e),r=e.style),r},_f.prototype.raiseAfterCellDraw=function(e,t,i,n,o,r){this.Grid.raiseEndCellDraw&&(e=new Zf(e,t,i,n,o,r),this.Grid.onEndCellDraw(e))},_f.prototype.reArrangePages=function(e){for(var t=this.currentPage.document,i=[],n=e.keys(),o=(e.values(),0);o<n.length;o++)(r=n[o]).section=null,i.push(r),t.pages.remove(r);for(o=0;o<e.size();o++)for(var r,s=o,a=e.size()/this.columnRanges.length;s<e.size();s+=a)void 0!==(r=i[s])&&-1===t.pages.indexOf(r)&&t.pages.add(r)},_f.prototype.getLayoutResult=function(){if(this.Grid.isChildGrid&&this.Grid.allowRowBreakAcrossPages)for(var e=0;e<this.Grid.rows.count;e++){var t=this.Grid.rows.getRow(e);0<t.rowBreakHeight&&t.repeatFlag&&(this.startLocation.y=this.currentPage.origin.y)}var i;return this.isChanged||(i=new id(this.startLocation,new td(this.currentBounds.width,this.currentBounds.y-this.startLocation.y))),new zf(this.currentPage,i)},_f.prototype.ReCalculateHeight=function(e,t){for(var i=0,n=this.cellStartIndex;n<=this.cellEndIndex;n++)null!==e.cells.getCell(n).remainingString&&""!==e.cells.getCell(n).remainingString&&void 0!==e.cells.getCell(n).remainingString&&(i=Math.max(i,e.cells.getCell(n).measureHeight()));return Math.max(t,i)},_f.prototype.raiseBeforePageLayout=function(e,t,i){var n=!1;return this.Grid.raiseBeginPageLayout&&(e=new hy(t,e,i),this.Grid.onBeginPageLayout(e),n=void 0!==e.cancel&&e.cancel,t=e.bounds,i=e.startRowIndex),{returnValue:n,currentBounds:t,currentRowIndex:i}},_f.prototype.raisePageLayouted=function(e){e=new cy(e);return this.Grid.raiseEndPageLayout&&this.Grid.onEndPageLayout(e),e},_f.prototype.drawRow=function(e,t,i){if(void 0===t){var n=new gy,o=0,r=new td(0,0),s=!1;if(e.rowSpanExists){var a=0,l=this.Grid.rows.rowCollection.indexOf(e);-1===l&&-1!==(l=this.Grid.headers.indexOf(e))&&(s=!0);for(var h=0;h<e.cells.count;h++)var d=e.cells.getCell(h),a=Math.max(a,d.rowSpan);for(h=l;h<l+a;h++)o+=(s?this.Grid.headers.getHeader(h):this.Grid.rows.getRow(h)).height}var p,c=0<e.rowBreakHeight?e.rowBreakHeight:e.height;return void 0!==this.Grid.isChildGrid&&this.Grid.isChildGrid&&void 0!==this.Grid.ParentCell&&null!=this.Grid.ParentCell?this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+c>this.currentPageBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+c>this.currentBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+o>this.currentPageBounds.height?(void 0!==this.Grid.ParentCell.row.grid.LayoutFormat&&this.Grid.ParentCell.row.grid.LayoutFormat.break===Kc.FitPage&&(_f.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(e),this.Grid.splitChildRowIndex=this.Grid.rows.rowCollection.indexOf(e)),-1<_f.repeatRowIndex&&_f.repeatRowIndex===e.rowIndex&&this.Grid.allowRowBreakAcrossPages&&(n.isFinish=!0,n.bounds=this.currentBounds,this.drawRowWithBreak(n,e,c),e.repeatFlag=!0,e.repeatRowNumber=_f.repeatRowIndex)):(n.isFinish=!0,0<e.grid.ParentCell.row.rowBreakHeightValue?e.repeatFlag=!0:(e.repeatFlag=!1,c=e.height),this.Grid.isChildGrid&&0<e.rowBreakHeight&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&(c+=this.Grid.ParentCell.row.grid.style.cellPadding.bottom),this.drawRow(e,n,c)):c>this.currentPageBounds.height?this.Grid.allowRowBreakAcrossPages&&(n.isFinish=!0,this.drawRowWithBreak(n,e,c),e.isrowFinish=!0,e.repeatFlag=!0,-1!==e.grid.splitChildRowIndex)&&(n.isFinish=!1):this.currentBounds.y+c>this.currentPageBounds.height||this.currentBounds.y+c>this.currentBounds.height+this.startLocation.y||this.currentBounds.y+o>this.currentPageBounds.height?(p=!1,!this.Grid.allowRowBreakAcrossPages||this.Grid.repeatHeader||e.isRowHeightSet||e.rowMergeComplete?this.Grid.allowRowBreakAcrossPages&&null!=this.Grid.LayoutFormat&&this.Grid.LayoutFormat.layout==Xc.Paginate&&this.Grid.LayoutFormat.break!=Kc.FitElement&&e.isRowHeightSet&&this.currentBounds.y+i>this.currentPageBounds.height&&((p=(p=this.isFitToCell(this.currentPageBounds.height-this.currentBounds.y,this.Grid,e))||!(null!==this.slr&&0==this.slr.actualSize.height&&null!=this.slr.remainder&&0<this.slr.remainder.length&&this.remainderText==this.slr.remainder))&&null!=this.slr&&1<this.slr.lineCount&&(p=!1),this.remainderText=null):(p=null!==this.Grid.LayoutFormat&&0<this.Grid.LayoutFormat.paginateBounds.height?this.isFitToCell(this.currentBounds.height+this.startLocation.y-this.currentBounds.y,this.Grid,e):this.isFitToCell(this.currentPageBounds.height-this.currentBounds.y,this.Grid,e))&&(this.isPaginate=!0),-1<_f.repeatRowIndex&&_f.repeatRowIndex===e.rowIndex||p?this.Grid.allowRowBreakAcrossPages?(n.isFinish=!0,this.drawRowWithBreak(n,e,c),e.repeatFlag=!0,e.repeatRowNumber=_f.repeatRowIndex,-1!==e.grid.splitChildRowIndex&&(n.isFinish=!1)):(n.isFinish=!1,this.drawRow(e,n,c)):n.isFinish=!1):(n.isFinish=!0,this.drawRow(e,n,c),e.repeatFlag=!1),n}var u=new ed(this.currentBounds.x,this.currentBounds.y);t.bounds=new id(u,new td(0,0)),i=this.ReCalculateHeight(e,i);for(h=this.cellStartIndex;h<=this.cellEndIndex;h++){var g=h>this.cellEndIndex+1&&1<e.cells.getCell(h).columnSpan;if(!g)for(var m=1;m<e.cells.getCell(h).columnSpan;m++)e.cells.getCell(h+m).isCellMergeContinue=!0;var r=new td(this.Grid.columns.getColumn(h).width,i),f=(!this.CheckIfDefaultFormat(this.Grid.columns.getColumn(h).format)&&this.CheckIfDefaultFormat(e.cells.getCell(h).stringFormat)&&(e.cells.getCell(h).stringFormat=this.Grid.columns.getColumn(h).format),e.cells.getCell(h).style),y="string"==typeof e.cells.getCell(h).value&&null!==e.cells.getCell(h).value?e.cells.getCell(h).value:"";e.cells.getCell(h).style=this.RaiseBeforeCellDraw(this.currentGraphics,this.currentRowIndex,h,new id(u,r),y,f);e.cells.getCell(h).value instanceof Lf&&((v=e.cells.getCell(h).value).parentCellIndex=h);var v,f=e.cells.getCell(h).draw(this.currentGraphics,new id(u,r),g);e.grid.style.allowHorizontalOverflow&&(e.cells.getCell(h).columnSpan>this.cellEndIndex||h+e.cells.getCell(h).columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<e.cells.count-1&&(e.rowOverflowIndex=this.cellEndIndex),e.grid.style.allowHorizontalOverflow&&0<e.rowOverflowIndex&&(e.cells.getCell(h).columnSpan>this.cellEndIndex||h+e.cells.getCell(h).columnSpan>this.cellEndIndex+1)&&0<e.cells.getCell(h).columnSpan-this.cellEndIndex+h-1&&(e.cells.getCell(e.rowOverflowIndex+1).value=null!==f&&void 0!==f.remainder?f.remainder:"",e.cells.getCell(e.rowOverflowIndex+1).stringFormat=e.cells.getCell(h).stringFormat,e.cells.getCell(e.rowOverflowIndex+1).style=e.cells.getCell(h).style,e.cells.getCell(e.rowOverflowIndex+1).columnSpan=e.cells.getCell(h).columnSpan-this.cellEndIndex+h-1),y="string"==typeof e.cells.getCell(h).value&&null!==e.cells.getCell(h).value?e.cells.getCell(h).value:"",g||this.raiseAfterCellDraw(this.currentGraphics,this.currentRowIndex,h,new id(u,r),y,e.cells.getCell(h).style),e.cells.getCell(h).value instanceof Lf&&(v=e.cells.getCell(h).value,this.Grid.columns.getColumn(h).width>=this.currentGraphics.clientSize.width)?(u.x=v.rowLayoutBoundsWidth,u.x+=v.style.cellSpacing):u.x+=this.Grid.columns.getColumn(h).width}e.rowMergeComplete&&!e.isRowHeightSet||(this.currentBounds.y+=i),t.bounds=new id(new ed(t.bounds.x,t.bounds.y),new td(u.x,u.y))},_f.prototype.isFitToCell=function(e,t,i){for(var n=!1,o=new Dd,r=0;r<i.cells.count;r++){var s=i.cells.getCell(r);if(void 0!==s.value&&null!==s.value&&"string"==typeof s.value){var a=null,a=void 0!==s.style.font&&null!=s.style.font?s.style.font:void 0!==s.row.style.font&&null!=s.row.style.font?s.row.style.font:void 0!==s.row.grid.style.font&&null!=s.row.grid.style.font?s.row.grid.style.font:sg.defaultFont,l=(this.remainderText=s.value,s.width),h=t.columns.getColumn(r),h=(h.isCustomWidth&&s.width>h.width&&(l=h.width),this.slr=o.layout(s.value,a,s.stringFormat,new td(l,e),!1,this.currentPageBounds),this.slr.actualSize.height);if(""!==s.value&&0===h){n=!1;break}if(null!==s.style&&null!==s.style.borders&&null!==s.style.borders.top&&null!==s.style.borders.bottom&&(h+=2*(s.style.borders.top.width+s.style.borders.bottom.width)),1<this.slr.lineCount&&null!=s.stringFormat&&0!=s.stringFormat.lineSpacing&&(h+=(this.slr.lineCount-1)*s.style.stringFormat.lineSpacing),s.style.cellPadding,(h=(h+=t.style.cellPadding.top+t.style.cellPadding.bottom)+t.style.cellSpacing)<e||void 0!==this.slr.remainder&&null!==this.slr.remainder){n=!0;break}}}return n},_f.prototype.drawRowWithBreak=function(e,t,i){var n=new ed(this.currentBounds.x,this.currentBounds.y);t.grid.isChildGrid&&t.grid.allowRowBreakAcrossPages&&this.startLocation.x!==this.currentBounds.x&&(n.x=this.startLocation.x),e.bounds=new id(n,new td(0,0)),this.gridHeight=0<t.rowBreakHeight?this.currentPageBounds.height:0,t.grid.style.cellPadding.top+this.currentBounds.y+t.grid.style.cellPadding.bottom<this.currentPageBounds.height&&(t.rowBreakHeight=this.currentBounds.y+i-this.currentPageBounds.height);for(var o=0;o<t.cells.count;o++){var r=t.cells.getCell(o);r.measureHeight()===i&&r.value instanceof Lf&&(t.rowBreakHeight=0)}for(o=this.cellStartIndex;o<=this.cellEndIndex;o++){var s=this.Grid.columns.getColumn(o).width,a=t.cells.getCell(o).columnSpan+o>this.cellEndIndex+1&&1<t.cells.getCell(o).columnSpan;if(!a)for(var l=1;l<t.cells.getCell(o).columnSpan;l++)t.cells.getCell(o+l).isCellMergeContinue=!0,s+=this.Grid.columns.getColumn(o+l).width;var h=new td(s,0<this.gridHeight?this.gridHeight:this.currentPageBounds.height),d=t.cells.getCell(o).style,d=(t.cells.getCell(o).style=d,null);t.cells.getCell(o)._rowHeight=t.height,d=t.cells.getCell(o).draw(this.currentGraphics,new id(n,h),a),0<t.rowBreakHeight&&null!=d&&void 0!==d.remainder&&(t.cells.getCell(o).FinishedDrawingCell=!1,t.cells.getCell(o).remainingString=null==d.remainder?" ":d.remainder,t.rowBreakHeight=i-d.actualSize.height),e.isFinish=e.isFinish&&t.cells.getCell(o).FinishedDrawingCell,t.cells.getCell(o).value instanceof Lf&&(h=t.cells.getCell(o).value,this.rowBreakPageHeightCellIndex=o,this.Grid.columns.getColumn(o).width>=this.currentGraphics.clientSize.width)?(n.x=this.rowLayoutBoundsWidth,n.x+=h.style.cellSpacing):n.x+=this.Grid.columns.getColumn(o).width}this.currentBounds.y+=0<this.gridHeight?this.gridHeight:i,e.bounds=new id(new ed(e.bounds.x,e.bounds.y),new td(n.x,n.y))},_f.repeatRowIndex=-1,_f);function _f(e){e=Nf.call(this,e)||this;return e.gridInitialWidth=0,e.gridSize=new td(0,0),e.parentCellIndex=0,e.tempWidth=0,e.childheight=0,e.isChildGrid=!1,e.hasRowSpanSpan=!1,e.isRearranged=!1,e.pageBounds=new id,e.listOfNavigatePages=[],e.flag=!0,e.columnRanges=[],e.currentLocation=new ed(0,0),e.breakRow=!0,e.slr=null,e.remainderText=null,e.isPaginate=!1,e.isOverloadWithPosition=!1,e}sf(jf,Hf=Lg);var Hf,zf=jf;function jf(e,t){return Hf.call(this,e,t)||this}sf(Uf,Wf=kg);var Wf,Qf=Uf;function Uf(e){return Wf.call(this,e)||this}Object.defineProperty(Gf.prototype,"rowIndex",{get:function(){return this.gridRowIndex},enumerable:!0,configurable:!0}),Object.defineProperty(Gf.prototype,"cellIndex",{get:function(){return this.gridCellIndex},enumerable:!0,configurable:!0}),Object.defineProperty(Gf.prototype,"value",{get:function(){return this.internalValue},enumerable:!0,configurable:!0}),Object.defineProperty(Gf.prototype,"bounds",{get:function(){return this.gridBounds},enumerable:!0,configurable:!0}),Object.defineProperty(Gf.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0});var qf=Gf;function Gf(e,t,i,n,o){this.gridRowIndex=t,this.gridCellIndex=i,this.internalValue=o,this.gridBounds=n,this.pdfGraphics=e}sf(Kf,Yf=qf),Object.defineProperty(Kf.prototype,"skip",{get:function(){return this.bSkip},set:function(e){this.bSkip=e},enumerable:!0,configurable:!0}),Object.defineProperty(Kf.prototype,"style",{get:function(){return this.cellStyle},set:function(e){this.cellStyle=e},enumerable:!0,configurable:!0});var Yf,Xf=Kf;function Kf(e,t,i,n,o,r){e=Yf.call(this,e,t,i,n,o)||this;return e.style=r,e}sf($f,Jf=qf),Object.defineProperty($f.prototype,"style",{get:function(){return this.cellStyle},enumerable:!0,configurable:!0});var Jf,Zf=$f;function $f(e,t,i,n,o,r){e=Jf.call(this,e,t,i,n,o)||this;return e.cellStyle=r,e}Object.defineProperty(ty.prototype,"cancel",{get:function(){return this.isCancel},set:function(e){this.isCancel=e},enumerable:!0,configurable:!0});var ey=ty;function ty(){}sf(oy,iy=ey),Object.defineProperty(oy.prototype,"bounds",{get:function(){return this.cellBounds},set:function(e){this.cellBounds=e},enumerable:!0,configurable:!0}),Object.defineProperty(oy.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0});var iy,ny=oy;function oy(e,t){var i=iy.call(this)||this;return i.bounds=e,i.pdfPage=t,i}sf(ay,ry=ey),Object.defineProperty(ay.prototype,"result",{get:function(){return this.layoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(ay.prototype,"nextPage",{get:function(){return this.nextPdfPage},set:function(e){this.nextPdfPage=e},enumerable:!0,configurable:!0});var ry,sy=ay;function ay(e){var t=ry.call(this)||this;return t.layoutResult=e,t}sf(dy,ly=ny),Object.defineProperty(dy.prototype,"startRowIndex",{get:function(){return this.startRow},enumerable:!0,configurable:!0});var ly,hy=dy;function dy(e,t,i){e=ly.call(this,e,t)||this;return e.startRow=i,e}sf(uy,py=sy);var py,cy=uy;function uy(e){return py.call(this,e)||this}Object.defineProperty(my.prototype,"isFinish",{get:function(){return this.bIsFinished},set:function(e){this.bIsFinished=e},enumerable:!0,configurable:!0}),Object.defineProperty(my.prototype,"bounds",{get:function(){return this.layoutedBounds},set:function(e){this.layoutedBounds=e},enumerable:!0,configurable:!0});var gy=my;function my(){this.layoutedBounds=new id(0,0,0,0)}fy=function(e,t){return(fy=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}fy(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(by,yy=Dg),Object.defineProperty(by.prototype,"element",{get:function(){return this.elements},enumerable:!0,configurable:!0}),by.prototype.layoutInternal=function(e){var t=e.page,i=e.bounds,n=this.element.getBounds(),o=(n.x=0,n.y=0,this.shapeBounds.x===this.shapeBounds.y&&this.shapeBounds.y===this.shapeBounds.width&&this.shapeBounds.width===this.shapeBounds.height&&0===this.shapeBounds.height),r=(this.isPdfGrid&&!o&&(n=this.shapeBounds),null),s=new wy;for(s.page=t;;){var a=this.raiseBeforePageLayout(t,i),i=a.currentBounds,l=null;if(a.cancel||(s=this.layoutOnPage(t,i,n,e),l=this.raiseEndPageLayout(s),a.cancel=null!==l&&l.cancel),s.end||a.cancel){r=this.getLayoutResult(s);break}if(i=this.getPaginateBounds(e),n=this.getNextShapeBounds(n,s),t=null===l||null===l.nextPage?this.getNextPage(t):l.nextPage,this.isPdfGrid){r=this.getLayoutResult(s);break}}return r},by.prototype.raiseBeforePageLayout=function(e,t){var i=!1;return this.element.raiseBeginPageLayout&&(e=new ny(t,e),this.element.onBeginPageLayout(e),i=e.cancel,t=e.bounds),{currentBounds:t,cancel:i}},by.prototype.raiseEndPageLayout=function(e){var t=null;return this.element.raiseEndPageLayout&&(e=this.getLayoutResult(e),t=new sy(e),this.element.onEndPageLayout(t)),t},by.prototype.getLayoutResult=function(e){return new Lg(e.page,e.bounds)},by.prototype.getNextShapeBounds=function(e,t){t=t.bounds;return e.y=e.y+t.height,e.height=e.height-t.height,e},by.prototype.layoutOnPage=function(e,t,i,n){var o=new wy,r=(t=this.checkCorrectCurrentBounds(e,t,n),this.fitsToBounds(t,i)),s=!1;return!(n.format.break===Kc.FitElement&&!r&&e===n.page)&&(r=this.getDrawBounds(t,i),this.drawShape(e.graphics,t,r),o.bounds=this.getPageResultBounds(t,i),s=t.height>=i.height),o.end=s||n.format.layout===Xc.OnePage,o.page=e,o},by.prototype.getDrawBounds=function(e,t){return e.y=e.y-t.y,e.height=e.height+t.y,e},by.prototype.drawShape=function(e,t,i){var n=e.save();try{e.setClip(t),this.element.drawGraphicsHelper(e,new ed(i.x,i.y))}finally{e.restore(n)}},by.prototype.checkCorrectCurrentBounds=function(e,t,i){e=e.graphics.clientSize;return t.width=0<t.width?t.width:e.width-t.x,t.height=0<t.height?t.height:e.height-t.y,this.isPdfGrid&&(t.height=t.height-this.bottomCellPadding),t},by.prototype.getPageResultBounds=function(e,t){return e.height=Math.min(e.height,t.height),e},by.prototype.fitsToBounds=function(e,t){return t.height<=e.height},by.index=0,by.splitDiff=0,by.last=!1,by.borderWidth=0;var fy,yy,vy=by;function by(e){e=yy.call(this,e)||this;return e.olderPdfForm=0,e.shapeBounds=new id,e.totalPageSize=0,e}var wy=function(){};Cy=function(e,t){return(Cy=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Cy(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ay,Sy=Hg),Ay.prototype.getBounds=function(){return this.getBoundsInternal()},Ay.prototype.drawGraphicsHelper=function(e,t){if(null==e)throw new Error("ArgumentNullException :graphics");this.drawShapeHelper(e,t.x,t.y)},Ay.prototype.drawShapeHelper=function(e,t,i){var n=.5!==t||.5!==i,o=null;n&&(o=e.save(),e.translateTransform(t,i)),this.drawInternal(e),n&&e.restore(o)},Ay.prototype.layout=function(e){return new vy(this).layout(e)};var Cy,Sy,sf=Ay;function Ay(){return null!==Sy&&Sy.apply(this,arguments)||this}xy=function(e,t){return(xy=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}xy(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ty,Iy=sf),Object.defineProperty(Ty.prototype,"pen",{get:function(){return this.mpen},set:function(e){this.mpen=e},enumerable:!0,configurable:!0});var xy,Iy,sf=Ty;function Ty(e){var t=Iy.call(this)||this;return void 0!==e&&(t.mpen=e),t}Ey=function(e,t){return(Ey=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Ey(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(My,Dy=sf),Object.defineProperty(My.prototype,"brush",{get:function(){return this.mbrush},set:function(e){this.mbrush=e},enumerable:!0,configurable:!0}),My.prototype.obtainPen=function(){return null==this.mbrush&&null==this.pen?new Ep(new se(0,0,0)):this.pen};var Ey,Dy,sf=My;function My(e,t){var i=Dy.call(this)||this;return i.mbrush=null,void 0!==e&&(e instanceof Ep?i=Dy.call(this,e)||this:i.mbrush=t),i}ky=function(e,t){return(ky=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}ky(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Fy,Py=sf),Object.defineProperty(Fy.prototype,"fillMode",{get:function(){return this.mfillMode},set:function(e){this.mfillMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(Fy.prototype,"pathPoints",{get:function(){return this.points},enumerable:!0,configurable:!0}),Object.defineProperty(Fy.prototype,"pathTypes",{get:function(){return this.types},enumerable:!0,configurable:!0}),Object.defineProperty(Fy.prototype,"pointCount",{get:function(){var e=0;return e=null!=this.mpoints?this.mpoints.length:e},enumerable:!0,configurable:!0}),Object.defineProperty(Fy.prototype,"lastPoint",{get:function(){return this.getLastPoint()},enumerable:!0,configurable:!0}),Object.defineProperty(Fy.prototype,"points",{get:function(){return null==this.mpoints&&(this.mpoints=[]),this.mpoints},enumerable:!0,configurable:!0}),Object.defineProperty(Fy.prototype,"types",{get:function(){return null==this.mpathTypes&&(this.mpathTypes=[]),this.mpathTypes},enumerable:!0,configurable:!0}),Fy.prototype.draw=function(e,t,i,n){var o;return t instanceof ed&&void 0===t.width&&void 0===i?this.drawHelper(e,t.x,t.y):t instanceof id&&void 0!==t.width&&void 0===i?this.drawHelper(e,t,null):"number"==typeof t&&"number"==typeof i&&void 0===n?this.drawHelper(e,t,i,null):t instanceof ed&&i instanceof kg?this.drawHelper(e,t.x,t.y,i):"number"==typeof t&&(n instanceof kg||null==n)&&"number"==typeof i?(o=e.graphics.clientSize.width-t,o=new id(t,i,o,0),this.drawHelper(e,o,n)):(t instanceof id&&0 instanceof kg,this.drawHelper(e,t,i))},Fy.prototype.addArc=function(e,t,i,n,o,r){if(e instanceof id)this.addArc(e.x,e.y,e.width,e.height,t,i);else for(var s=this.getBezierArcPoints(e,t,t+i,t+n,o,r),a=0;a<s.length;a+=8){var l=[s[a],s[a+1],s[a+2],s[a+3],s[a+4],s[a+5],s[a+6],s[a+7]];this.addPoints(l,Jc.Bezier3)}},Fy.prototype.addBezier=function(e,t,i,n,o,r,s,a){var l;e instanceof ed&&t instanceof ed&&i instanceof ed&&n instanceof ed?this.addBezier(e.x,e.y,t.x,t.y,i.x,i.y,n.x,n.y):((l=[]).push(e),l.push(t),l.push(i),l.push(n),l.push(o),l.push(r),l.push(s),l.push(a),this.addPoints(l,Jc.Bezier3))},Fy.prototype.addEllipse=function(e,t,i,n){e instanceof id?this.addEllipse(e.x,e.y,e.width,e.height):(this.startFigure(),this.addArc(e,t,i,n,0,360),this.closeFigure())},Fy.prototype.addLine=function(e,t,i,n){var o;e instanceof ed&&t instanceof ed?this.addLine(e.x,e.y,t.x,t.y):((o=[]).push(e),o.push(t),o.push(i),o.push(n),this.addPoints(o,Jc.Line))},Fy.prototype.addPath=function(e,t){if(e instanceof Fy)this.addPath(e.pathPoints,e.pathTypes);else{if(null==e)throw new Error("ArgumentNullException:pathPoints");if(null==t)throw new Error("ArgumentNullException:pathTypes");if(e.length!==t.length)throw new Error("The argument arrays should be of equal length.")}},Fy.prototype.addPie=function(e,t,i,n,o,r){e instanceof id?this.addPie(e.x,e.y,e.width,e.height,t,i):(this.startFigure(),this.addArc(e,t,i,n,o,r),this.addPoint(new ed(e+i/2,t+n/2),Jc.Line),this.closeFigure())},Fy.prototype.addPolygon=function(e){e.length;var t=[];this.startFigure();for(var i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y);this.addPoints(t,Jc.Line),this.closeFigure()},Fy.prototype.addRectangle=function(e,t,i,n){var o;e instanceof id?this.addRectangle(e.x,e.y,e.width,e.height):(o=[],this.startFigure(),o.push(e),o.push(t),o.push(e+i),o.push(t),o.push(e+i),o.push(t+n),o.push(e),o.push(t+n),this.addPoints(o,Jc.Line),this.closeFigure())},Fy.prototype.startFigure=function(){this.mStartFigure=!0},Fy.prototype.closeAllFigures=function(){for(var e=this.pathPoints[0],t=0;t<this.mpathTypes.length;t++){var i=this.types[t],n=!1;0!==t&&i===Jc.Start?(this.closeFigure(t-1),n=!0):t===this.mpathTypes.length-1&&!n&&this.isXps&&e.x===this.pathPoints[t].y&&this.closeFigure(t)}},Fy.prototype.getLastPoint=function(){var e=new ed(0,0),t=this.pointCount;return 0<t&&null!=this.mpoints&&(e.x=this.mpoints[t-1].x,e.y=this.mpoints[t-1].y),e},Fy.prototype.getBezierArcPoints=function(e,t,i,n,o,r){i<e&&(c=void 0,c=e,e=i,i=c),t<n&&(c=void 0,c=t,t=n,n=c),Math.abs(r)<=90?(s=r,a=1):s=r/(a=Math.ceil(Math.abs(r)/90));for(var s,a,l=(e+i)/2,h=(t+n)/2,d=(i-e)/2,p=(n-t)/2,c=s*(Math.PI/360),u=Math.abs(4/3*(1-Math.cos(c))/Math.sin(c)),g=[],m=0;m<a;m++){var f=(o+m*s)*(Math.PI/180),y=(o+(m+1)*s)*(Math.PI/180),v=Math.cos(f),b=Math.cos(y),f=Math.sin(f),y=Math.sin(y);0<s?g.push(l+d*v,h-p*f,l+d*(v-u*f),h-p*(f+u*v),l+d*(b+u*y),h-p*(y-u*b),l+d*b,h-p*y):g.push(l+d*v,h-p*f,l+d*(v+u*f),h-p*(f-u*v),l+d*(b-u*y),h-p*(y+u*b),l+d*b,h-p*y)}return g},Fy.prototype.getBoundsInternal=function(){var e=this.pathPoints,t=new id(0,0,0,0);if(0<e.length){for(var i=e[0].x,n=e[0].x,o=e[0].y,r=e[0].y,s=1;s<e.length;s++)var a=e[s],i=Math.min(a.x,i),n=Math.max(a.x,n),o=Math.min(a.y,o),r=Math.max(a.y,r);t=new id(i,o,n-i,r-o)}return t},Fy.prototype.drawInternal=function(e){if(null==e)throw new Error("ArgumentNullException :graphics");e.drawPath(this.obtainPen(),this.brush,this)},Fy.prototype.addPoints=function(e,t,i,n){if(void 0===i&&void 0===n)this.addPoints(e,t,0,e.length);else for(var o=i;o<n;o++){var r=new ed(e[o],e[o+1]);o===i?this.pointCount<=0||this.mStartFigure?(this.addPoint(r,Jc.Start),this.mStartFigure=!1):r.x===this.lastPoint.x||r.y===this.lastPoint.y||this.isBeziers3?r.x!==this.lastPoint.x&&r.y!==this.lastPoint.y&&this.addPoint(r,Jc.Bezier3):this.addPoint(r,Jc.Line):this.addPoint(r,t),o++}},Fy.prototype.addPoint=function(e,t){this.points.push(e),this.types.push(t)},Fy.prototype.closeFigure=function(e){if(void 0===e)0<this.pointCount&&this.closeFigure(this.pointCount-1),this.startFigure();else{if(e<0)throw new Error("IndexOutOfRangeException()");var t=this.types[e];t|=Jc.CloseSubpath,this.types[e]=t}};var ky,Py,By=Fy;function Fy(e,t,i,n){var o=Py.call(this)||this;return o.mpoints=null,o.mpathTypes=null,o.mStartFigure=!0,o.mfillMode=Uh.Alternate,o.isBeziers3=!1,o.isXps=!1,void 0!==e&&(e instanceof Ep?(o=Py.call(this,e)||this,t instanceof rd?(o=Py.call(this,e,t)||this).fillMode=i:null!=t&&null!=i&&o.addPath(t,i)):e instanceof rd?(o=Py.call(this,e)||this,null!=t&&(o.fillMode=t),null!=i&&null!=n&&o.addPath(i,n)):o.addPath(e,t)),o}Ly=function(e,t){return(Ly=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Ly(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Oy,Ry=sf),Object.defineProperty(Oy.prototype,"x",{get:function(){return this.bounds.x},set:function(e){this.bounds.x=e},enumerable:!0,configurable:!0}),Object.defineProperty(Oy.prototype,"y",{get:function(){return this.bounds.y},set:function(e){this.bounds.y=e},enumerable:!0,configurable:!0}),Object.defineProperty(Oy.prototype,"width",{get:function(){return this.bounds.width},set:function(e){this.bounds.width=e},enumerable:!0,configurable:!0}),Object.defineProperty(Oy.prototype,"height",{get:function(){return this.bounds.height},set:function(e){this.bounds.height=e},enumerable:!0,configurable:!0}),Oy.prototype.getBoundsInternal=function(){return this.bounds};var Ly,Ry,sf=Oy;function Oy(e,t,i,n,o,r){var s=Ry.call(this)||this;return s.bounds=new id(0,0,0,0),void 0!==e&&(e instanceof Ep?(s=Ry.call(this,e,t)||this,i instanceof id?s.bounds=i:s.bounds=new id(i,n,o,r)):e instanceof id?s.bounds=e:s.bounds=new id(e,t,i,n)),s}Ny=function(e,t){return(Ny=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Ny(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(_y,Vy=sf);var Ny,Vy,sf=_y;function _y(e,t,i,n,o,r,s,a){var l=Vy.call(this)||this;return l.startAngle=0,void(l.sweepAngle=0)!==e&&(e instanceof id&&void 0!==t&&void 0!==i?((l=Vy.call(this,e)||this).startAngle=t,l.sweepAngle=i):e instanceof Ep?i instanceof id?((l=Vy.call(this,e,t,i)||this).startAngle=n,l.sweepAngle=o):((l=Vy.call(this,e,t,i,n,o,r)||this).startAngle=s,l.sweepAngle=a):((l=Vy.call(this,e,t,i,n)||this).startAngle=o,l.sweepAngle=r)),l}Hy=function(e,t){return(Hy=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Hy(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(jy,zy=sf),jy.prototype.draw=function(e,t,i,n){var o;return t instanceof ed&&void 0===t.width&&void 0===i?this.drawHelper(e,t.x,t.y):t instanceof id&&void 0!==t.width&&void 0===i?this.drawHelper(e,t,null):"number"==typeof t&&"number"==typeof i&&void 0===n?this.drawHelper(e,t,i,null):t instanceof ed&&i instanceof kg?this.drawHelper(e,t.x,t.y,i):"number"==typeof t&&(n instanceof kg||null==n)&&"number"==typeof i?(o=e.graphics.clientSize.width-t,o=new id(t,i,o,0),this.drawHelper(e,o,n)):this.drawHelper(e,t,i)},jy.prototype.drawInternal=function(e){if(null==e)throw new Error("ArgumentNullException : graphics");e.drawArc(this.obtainPen(),this.bounds,this.startAngle,this.sweepAngle)};var Hy,zy,sf=jy;function jy(e,t,i,n,o,r,s){var a=this;return void 0===e?a=zy.call(this)||this:e instanceof id?a=zy.call(this,e,t,i)||this:e instanceof Ep?t instanceof id?a=zy.call(this,e,null,t,i,n)||this:void 0===r&&void 0===s?a=zy.call(this,e,null,0,0,t,i,n,o)||this:void 0!==r&&void 0!==s&&(a=zy.call(this,e,null,t,i,n,o,r,s)||this):void 0!==e&&void 0===o&&void 0===r?a=zy.call(this,0,0,e,t,i,n)||this:void 0!==e&&void 0!==o&&void 0!==r&&(a=zy.call(this,e,t,i,n,o,r)||this),a}Wy=function(e,t){return(Wy=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Wy(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(qy,Qy=Rd),qy.prototype.equalsToFont=function(e){return!1},qy.prototype.getLineWidth=function(e,t){var i=0,n=(i=null!=t&&t.textDirection!==Kh.None?this.getUnicodeLineWidth(e,i,t).width:this.fontInternal.getLineWidth(e),this.metrics.getSize(t));return i=this.applyFormatSettings(e,t,i*=Rd.charSizeMultiplier*n)},qy.prototype.getCharWidth=function(e,t){e=this.fontInternal.getCharWidth(e);return e*=.001*this.metrics.getSize(t)},qy.prototype.createFontInternal=function(e,t){this.fontInternal=new _c(e,this.size),this.calculateStyle(t),this.initializeInternals()},qy.prototype.calculateStyle=function(e){var t=this.fontInternal.ttfMetrics.macStyle;0!=(e&hd.Underline)&&(t|=hd.Underline),0!=(e&hd.Strikeout)&&(t|=hd.Strikeout),this.setStyle(t)},qy.prototype.initializeInternals=function(){var e,t=null,i=null;null!=(t=sg.enableCache?sg.cache.search(this):t)?(i=t.getInternals(),(e=(e=t.metrics).clone()).size=this.size,this.metrics=e,this.fontInternal=t.fontInternal):null==t&&(this.fontInternal instanceof _c&&(this.fontInternal.isEmbed=this.isEmbedFont),this.fontInternal.createInternals(),i=this.fontInternal.getInternals(),this.metrics=this.fontInternal.metrics),this.metrics.isUnicodeFont=!0,this.setInternals(i)},qy.prototype.setSymbols=function(e){var t=this.fontInternal;null!=t&&t.setSymbols(e)},Object.defineProperty(qy.prototype,"Unicode",{get:function(){return this.isUnicode},enumerable:!0,configurable:!0}),qy.prototype.getUnicodeLineWidth=function(e,t,i){t=0;var e=(new Zc).getGlyphIndex(e,this,i.textDirection===Kh.RightToLeft,null,!0),i=e.success,n=e.glyphs;if(i&&null!==n)for(var o=this.fontInternal.ttfReader,r=0,s=n.length;r<s;r++){var a=n[r],a=o.getGlyph(a);null!=a&&(t+=a.width)}return{success:i,width:t}};var Wy,Qy,Uy=qy;function qy(e,t,i){t=Qy.call(this,t)||this;return t.isEmbedFont=!1,t.isUnicode=!0,void 0!==i?t.createFontInternal(e,i):t.createFontInternal(e,hd.Regular),t}Object.defineProperty(Yy.prototype,"dock",{get:function(){return this.dockStyle},set:function(e){this.dockStyle=e,this.resetAlignment()},enumerable:!0,configurable:!0}),Object.defineProperty(Yy.prototype,"alignment",{get:function(){return this.alignmentStyle},set:function(e){this.setAlignment(e)},enumerable:!0,configurable:!0}),Object.defineProperty(Yy.prototype,"foreground",{get:function(){return this.isForeground},set:function(e){this.isForeground=e},enumerable:!0,configurable:!0}),Object.defineProperty(Yy.prototype,"background",{get:function(){return!this.isForeground},set:function(e){this.isForeground=!e},enumerable:!0,configurable:!0}),Object.defineProperty(Yy.prototype,"location",{get:function(){return this.currentLocation},set:function(e){this.type===vp.None&&(this.currentLocation=e)},enumerable:!0,configurable:!0}),Object.defineProperty(Yy.prototype,"x",{get:function(){return void 0!==this.currentLocation?this.currentLocation.x:0},set:function(e){this.type===vp.None&&(this.currentLocation.x=e)},enumerable:!0,configurable:!0}),Object.defineProperty(Yy.prototype,"y",{get:function(){return void 0!==this.currentLocation?this.currentLocation.y:0},set:function(e){this.type===vp.None&&(this.currentLocation.y=e)},enumerable:!0,configurable:!0}),Object.defineProperty(Yy.prototype,"size",{get:function(){return this.template.size},set:function(e){this.type===vp.None&&this.template.reset(e)},enumerable:!0,configurable:!0}),Object.defineProperty(Yy.prototype,"width",{get:function(){return this.template.width},set:function(e){var t;this.template.width!==e&&this.type===vp.None&&((t=this.template.size).width=e,this.template.reset(t))},enumerable:!0,configurable:!0}),Object.defineProperty(Yy.prototype,"height",{get:function(){return this.template.height},set:function(e){var t;this.template.height!==e&&this.type===vp.None&&((t=this.template.size).height=e,this.template.reset(t))},enumerable:!0,configurable:!0}),Object.defineProperty(Yy.prototype,"graphics",{get:function(){return this.template.graphics},enumerable:!0,configurable:!0}),Object.defineProperty(Yy.prototype,"template",{get:function(){return this.pdfTemplate},enumerable:!0,configurable:!0}),Object.defineProperty(Yy.prototype,"type",{get:function(){return this.templateType},set:function(e){this.updateDocking(e),this.templateType=e},enumerable:!0,configurable:!0}),Object.defineProperty(Yy.prototype,"bounds",{get:function(){return new id(new ed(this.x,this.y),this.size)},set:function(e){this.type===vp.None&&(this.location=new ed(e.x,e.y),this.size=new td(e.width,e.height))},enumerable:!0,configurable:!0}),Yy.prototype.InitiateBounds=function(e,t,i,n,o){this.x=e,this.y=t,this.pdfTemplate=new ou(i,n)},Yy.prototype.updateDocking=function(e){if(e!==vp.None){switch(e){case vp.Top:this.dock=fp.Top;break;case vp.Bottom:this.dock=fp.Bottom;break;case vp.Left:this.dock=fp.Left;break;case vp.Right:this.dock=fp.Right}this.resetAlignment()}},Yy.prototype.resetAlignment=function(){this.alignment=yp.None},Yy.prototype.setAlignment=function(e){if(this.dock===fp.None)this.alignmentStyle=e;else{var t=!1;switch(this.dock){case fp.Left:t=e===yp.TopLeft||e===yp.MiddleLeft||e===yp.BottomLeft||e===yp.None;break;case fp.Top:t=e===yp.TopLeft||e===yp.TopCenter||e===yp.TopRight||e===yp.None;break;case fp.Right:t=e===yp.TopRight||e===yp.MiddleRight||e===yp.BottomRight||e===yp.None;break;case fp.Bottom:t=e===yp.BottomLeft||e===yp.BottomCenter||e===yp.BottomRight||e===yp.None;break;case fp.Fill:t=e===yp.MiddleCenter||e===yp.None}t&&(this.alignmentStyle=e)}},Yy.prototype.draw=function(e,t){var i=e.page,i=this.calculateBounds(i,t);e.graphics.drawPdfTemplate(this.template,new ed(i.x,i.y),new td(i.width,i.height))},Yy.prototype.calculateBounds=function(e,t){var i=this.bounds;return this.alignmentStyle!==yp.None?i=this.getAlignmentBounds(e,t):this.dockStyle!==fp.None&&(i=this.getDockBounds(e,t)),i},Yy.prototype.getAlignmentBounds=function(e,t){this.bounds;return this.type===vp.None?this.getSimpleAlignmentBounds(e,t):this.getTemplateAlignmentBounds(e,t)},Yy.prototype.getSimpleAlignmentBounds=function(e,t){var i=this.bounds,n=e.section.getActualBounds(t,e,!1),o=this.x,r=this.y;switch(this.alignmentStyle){case yp.TopLeft:r=o=0;break;case yp.TopCenter:o=(n.width-this.width)/2,r=0;break;case yp.TopRight:o=n.width-this.width,r=0;break;case yp.MiddleLeft:o=0,r=(n.height-this.height)/2;break;case yp.MiddleCenter:o=(n.width-this.width)/2,r=(n.height-this.height)/2;break;case yp.MiddleRight:o=n.width-this.width,r=(n.height-this.height)/2;break;case yp.BottomLeft:o=0,r=n.height-this.height;break;case yp.BottomCenter:o=(n.width-this.width)/2,r=n.height-this.height;break;case yp.BottomRight:o=n.width-this.width,r=n.height-this.height}return i.x=o,i.y=r,i},Yy.prototype.getTemplateAlignmentBounds=function(e,t){var i=this.bounds,n=e.section,o=n.getActualBounds(t,e,!1),r=this.x,s=this.y;switch(this.alignmentStyle){case yp.TopLeft:this.type===vp.Left?(r=this.convertSign(o.x),s=0):this.type===vp.Top&&(r=this.convertSign(o.x),s=this.convertSign(o.y));break;case yp.TopCenter:r=(o.width-this.width)/2,s=this.convertSign(o.y);break;case yp.TopRight:this.type===vp.Right?(r=o.width+n.getRightIndentWidth(t,e,!1)-this.width,s=0):this.type===vp.Top&&(r=o.width+n.getRightIndentWidth(t,e,!1)-this.width,s=this.convertSign(o.y));break;case yp.MiddleLeft:r=this.convertSign(o.x),s=(o.height-this.height)/2;break;case yp.MiddleCenter:r=(o.width-this.width)/2,s=(o.height-this.height)/2;break;case yp.MiddleRight:r=o.width+n.getRightIndentWidth(t,e,!1)-this.width,s=(o.height-this.height)/2;break;case yp.BottomLeft:this.type===vp.Left?(r=this.convertSign(o.x),s=o.height-this.height):this.type===vp.Bottom&&(r=this.convertSign(o.x),s=o.height+n.getBottomIndentHeight(t,e,!1)-this.height);break;case yp.BottomCenter:r=(o.width-this.width)/2,s=o.height+n.getBottomIndentHeight(t,e,!1)-this.height;break;case yp.BottomRight:this.type===vp.Right?(r=o.width+n.getRightIndentWidth(t,e,!1)-this.width,s=o.height-this.height):this.type===vp.Bottom&&(r=o.width+n.getRightIndentWidth(t,e,!1)-this.width,s=o.height+n.getBottomIndentHeight(t,e,!1)-this.height)}return i.x=r,i.y=s,i},Yy.prototype.getDockBounds=function(e,t){this.bounds;return this.type===vp.None?this.getSimpleDockBounds(e,t):this.getTemplateDockBounds(e,t)},Yy.prototype.getSimpleDockBounds=function(e,t){this.bounds;var i=e.section.getActualBounds(t,e,!1),n=this.x,o=this.y,r=this.width,s=this.height;switch(this.dockStyle){case fp.Left:o=n=0,r=this.width,s=i.height;break;case fp.Top:o=n=0,r=i.width,s=this.height;break;case fp.Right:n=i.width-this.width,o=0,r=this.width,s=i.height;break;case fp.Bottom:n=0,o=i.height-this.height,r=i.width,s=this.height;break;case fp.Fill:n=n=0,r=i.width,s=i.height}return new id(n,o,r,s)},Yy.prototype.getTemplateDockBounds=function(e,t){this.bounds;var i=e.section,n=i.getActualBounds(t,e,!1),o=i.pageSettings.getActualSize(),r=this.x,s=this.y,a=this.width,l=this.height;switch(this.dockStyle){case fp.Left:r=this.convertSign(n.x),s=0,a=this.width,l=n.height;break;case fp.Top:r=this.convertSign(n.x),s=this.convertSign(n.y),a=o.width,l=this.height,n.height<0&&(s=o.height-n.y);break;case fp.Right:r=n.width+i.getRightIndentWidth(t,e,!1)-this.width,s=0,a=this.width,l=n.height;break;case fp.Bottom:r=this.convertSign(n.x),s=n.height+i.getBottomIndentHeight(t,e,!1)-this.height,a=o.width,l=this.height,n.height<0&&(s-=o.height);break;case fp.Fill:r=r=0,a=n.width,l=n.height}return new id(r,s,a,l)},Yy.prototype.convertSign=function(e){return 0!==e||0===e&&1/e==-1/0?-e:e};var Gy=Yy;function Yy(e,t,i,n,o){e instanceof id&&void 0===t?this.InitiateBounds(e.x,e.y,e.width,e.height,null):e instanceof id&&t instanceof Ou&&void 0===i?this.InitiateBounds(e.x,e.y,e.width,e.height,t):e instanceof ed&&t instanceof td&&void 0===i?this.InitiateBounds(e.x,e.y,t.width,t.height,null):e instanceof ed&&t instanceof td&&i instanceof Ou&&void 0===n?this.InitiateBounds(e.x,e.y,t.width,t.height,i):e instanceof td&&void 0===t?this.InitiateBounds(0,0,e.width,e.height,null):"number"==typeof e&&"number"==typeof t&&void 0===i?this.InitiateBounds(0,0,e,t,null):"number"==typeof e&&"number"==typeof t&&i instanceof Ou&&void 0===n?this.InitiateBounds(0,0,e,t,i):this.InitiateBounds(e,t,i,n,null)}Ky.prototype.export=function(l,e,h,d,p){return new Promise(function(i,e){var n=Q("canvas",{id:"ej2-canvas",attrs:{width:l.availableSize.width.toString(),height:l.availableSize.height.toString()}}),t=(d=je(d)?up.Landscape:d,l.svgObject.cloneNode(!0)),o=t.childNodes[0],r=(je(o)||(o=o.getAttribute("fill"),"Tailwind"!==l.theme&&"Tailwind3"!==l.theme&&"Bootstrap5"!==l.theme&&"Fluent"!==l.theme&&"Material3"!==l.theme&&"Fluent2"!==l.theme||"rgba(255,255,255, 0.0)"!==o&&"transparent"!==o?"TailwindDark"!==l.theme&&"Tailwind3Dark"!==l.theme&&"Bootstrap5Dark"!==l.theme&&"FluentDark"!==l.theme&&"Material3Dark"!==l.theme&&"Fluent2Dark"!==l.theme&&"Fluent2HighContrast"!==l.theme||"rgba(255,255,255, 0.0)"!==o&&"transparent"!==o||t.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):t.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")),window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(t)],{type:"image/svg+xml"}))),s=new Image,a=n.getContext("2d");s.onload=function(){a.drawImage(s,0,0),window.URL.revokeObjectURL(r);var e=new sg,t=n.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");e.pageSettings.orientation=d,t=t.slice(t.indexOf(",")+1),e.pages.add().graphics.drawImage(new oc(t),0,0,l.availableSize.width-60,l.availableSize.height),p?(e.save(h+".pdf"),e.destroy()):i(null)},s.src=r})},Ky.prototype.getModuleName=function(){return"PdfExport"},Ky.prototype.destroy=function(){};var Xy=Ky;function Ky(e){}Jy=function(e,t){return(Jy=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])}))(e,t)};var Jy,Zy,$y=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},$y=(function(e,t){function i(){this.constructor=e}Jy(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(e0,Zy=Ji),e0.prototype.preRender=function(){var e=this;this.trigger("load",{treemap:this},function(){e.initPrivateVariable(),e.unWireEVents(),e.createSvg(),e.wireEVents(),e.setCulture()})},e0.prototype.render=function(){this.renderElements()},e0.prototype.renderElements=function(){this.treemapLevelData=new t0,this.treemapLevelData.levelsData=null,this.treemapLevelData.defaultLevelsData=null,this.treemapLevelData.hierarchyData=null,this.createSecondaryElement(),this.addTabIndex(),this.themeStyle=hl(this.theme),this.renderBorder(),this.renderTitle(this.titleSettings,"title",null,null),je(this.treemapLevelData.levelsData)||(this.treemapLevelData.defaultLevelsData=this.treemapLevelData.levelsData),this.processDataManager()},e0.prototype.processDataManager=function(){var e,t,n=this;this.dataSource instanceof me?(e=this.dataSource,t=this.query instanceof ya?this.query:new ya,e.executeQuery(t).then(function(e){n.dataSource=e.result,n.renderTreeMapElements()})):this.dataSource instanceof sa?(e=this.dataSource,(t=new Qe(e.dataOptions,e.type,e.contentType)).onSuccess=function(e){var t,i;je(e.type)||"application/octet-stream"!==e.type?(n.dataSource=e,n.renderTreeMapElements()):(t=new FileReader,i=n,t.onload=function(){e=JSON.parse(t.result.toString()),i.dataSource=e,i.renderTreeMapElements()},t.readAsText(e))},t.send(e.sendData)):this.renderTreeMapElements()},e0.prototype.renderTreeMapElements=function(){this.processingData(),this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.renderLegend(),this.layout.processLayoutPanel(),this.element.appendChild(this.svgObject),!je(this.treeMapLegendModule)&&this.legendSettings.visible&&Gs(this,this.treeMapLegendModule.legendGroup),this.elementChange(),this.trigger("loaded",{treemap:this,isResized:this.isResize}),this.isResize=!1,this.renderComplete()},e0.prototype.createSvg=function(){if(this.svgObject){for(;0<this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&ue(this.svgObject)}je(this.renderer)&&(this.renderer=new fo(this.element.id)),je(this.layout)&&(this.layout=new ma(this)),this.clearTemplate();var e=this.element.clientWidth,t=this.element.clientHeight;this.availableSize=new as(ls(this.width,e)||e||600,ls(this.height,t)||t||450),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},e0.prototype.initPrivateVariable=function(){var e;""===this.element.id&&(e=document.getElementsByClassName("e-treemap").length,this.element.id="treemap_control_"+e),this.renderer=new fo(this.element.id),this.layout=new ma(this)},e0.prototype.createSecondaryElement=function(){var e=document.getElementById(this.element.id+"_Secondary_Element");e&&0<e.childElementCount&&e.parentNode.removeChild(e),je(document.getElementById(this.element.id+"_Secondary_Element"))&&((e=Q("div",{id:this.element.id+"_Secondary_Element"})).style.cssText="position: absolute;z-index:1;",this.element.appendChild(e))},e0.prototype.elementChange=function(){this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.legendGroup&&this.layout.layoutGroup&&!je(this.svgObject)&&!je(document.getElementById(this.layout.layoutGroup.id))&&!je(document.getElementById(this.treeMapLegendModule.legendGroup.id))&&this.svgObject.insertBefore(this.layout.layoutGroup,this.treeMapLegendModule.legendGroup)},e0.prototype.renderBorder=function(){var e=this.border.width,t=this.svgObject.querySelector("#"+this.element.id+"_TreeMap_Border");(0<this.border.width||this.background||this.themeStyle.backgroundColor)&&je(t)?(e=new ds(this.element.id+"_TreeMap_Border",this.background||this.themeStyle.backgroundColor,this.border,1,new hs(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e)),this.svgObject.appendChild(this.renderer.drawRectangle(e))):t&&t.setAttribute("fill",this.background||this.themeStyle.backgroundColor)},e0.prototype.renderTitle=function(e,t,i,n){var o,r,s,a,l={color:e.textStyle.color,size:e.textStyle.size,fontFamily:e.textStyle.fontFamily,fontStyle:e.textStyle.fontStyle,fontWeight:e.textStyle.fontWeight,opacity:e.textStyle.opacity},h=this.availableSize.width-this.margin.right-this.margin.left;l.fontFamily=l.fontFamily||this.themeStyle.fontFamily,l.fontWeight=l.fontWeight||this.themeStyle.titleFontWeight,l.size=l.size||("title"===t?this.themeStyle.fontSize:this.themeStyle.subtitleFontSize),e.text?(je(n)&&(n=this.renderer.createGroup({id:this.element.id+"_Title_Group"})),a=cs(s=gs(h,r=this.enableHtmlSanitizer?go.sanitize(e.text):e.text,l),l),i=fs(je(i)?new hs(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height):i,e.alignment,a,t),s=new us(this.element.id+"_TreeMap_"+t,i.x,i.y,"start",s),i=new hs(i.x,i.y,a.width,a.height),(a=vs(s,l,l.color||("title"===t?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),n)).setAttribute("aria-label",e.description||r),a.setAttribute("role","region"),a.setAttribute("tabindex",this.tabIndex.toString()),("title"!==t||e.subtitleSettings.text)&&"subtitle"!==t||(o=this.availableSize.height-i.y-10-this.margin.bottom,this.areaRect=new hs(this.margin.left,i.y+10,h,o)),"subtitle"!==t&&e.subtitleSettings.text?this.renderTitle(e.subtitleSettings,"subtitle",i,n):this.svgObject.appendChild(n)):(o=this.availableSize.height-this.margin.top-this.margin.bottom,this.areaRect=new hs(this.margin.left,this.margin.top,h,o))},e0.prototype.processingData=function(){var t=this;if(this.dataSource=this.dataSource,!je(this.dataSource)&&0<this.dataSource.length&&this.weightValuePath){if(this.treemapLevelData.levelsData=[],this.dataSource.map(function(e){e[t.weightValuePath]=e[t.weightValuePath]&&e[t.weightValuePath].toString()}),this.leafItemSettings.labelPath=this.leafItemSettings.labelPath||this.weightValuePath,this.checkIsHierarchicalData(),0===this.levels.length){var i={level:0},n=this.leafItemSettings.labelPath;i[n]=[];for(var e=0;e<this.dataSource.length;e++){var o=As(this.dataSource[e]).values;this.isHierarchicalData&&o&&0<o.length?o.forEach(function(e){e[n]&&i[n].push({groupIndex:0,name:e[n],levelOrderName:e[n].toString(),data:e,weight:e[t.weightValuePath]})}):this.dataSource[e][n]&&i[n].push({groupIndex:0,name:this.dataSource[e][n],levelOrderName:this.dataSource[e][n].toString(),data:this.dataSource[e],weight:this.dataSource[e][this.weightValuePath]})}this.treemapLevelData.levelsData.push(i)}else{if(this.isHierarchicalData){this.treemapLevelData.hierarchyData=[],this.treemapLevelData.hierarchyData=Pe([],this.dataSource,this.treemapLevelData.hierarchyData,!0);for(e=0;e<this.treemapLevelData.hierarchyData.length;e++)this.processHierarchicalData(this.treemapLevelData.hierarchyData[e],e);this.treemapLevelData.levelsData=this.treemapLevelData.hierarchyData}else this.processFlatJsonData(),1<this.treemapLevelData.levelsData.length&&this.reOrderLevelData(this.treemapLevelData.levelsData.length-1);n=this.levels[0].groupPath}this.isHierarchicalData||this.findTotalWeight(this.treemapLevelData.levelsData[0][n],"Parent")}},e0.prototype.checkIsHierarchicalData=function(){var e;this.dataSource=this.dataSource;for(var t=0;t<this.dataSource.length;t++){if((e=As(this.dataSource[t]).values)&&e.length){this.isHierarchicalData=!0;break}t===this.dataSource.length-1&&(this.isHierarchicalData=!1)}},e0.prototype.processHierarchicalData=function(e,t){var i,n=this,o={},r=this.leafItemSettings.labelPath||this.weightValuePath,s=(o=As(e))?o.values:null;if(s&&0<s.length){for(var a=o.key,l=0;l<this.levels.length;l++)a===this.levels[l].groupPath&&(i=l);for(var h=0;h<s.length;h++){s[h].name=s[h][r],s[h].levelOrderName=(0===i?s[h].name:e.levelOrderName+"#"+s[h].name)+"";var d=s[h].levelOrderName,p=void 0;0<d.search("#")&&(p=d.split("#").length-1),s[h].groupIndex=je(i)?p===this.levels.length?this.levels.length:p:i,0!==i&&(s[h].parent=e),s[h].groupName=a,s[h].data=s[h],s[h].isDrilled=!1,s[h].weight=s[h][this.weightValuePath]}s.forEach(function(e){n.processHierarchicalData(e,t)})}if(t===this.treemapLevelData.hierarchyData.length-1&&!je(u=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath])){for(var c=0;c<this.treemapLevelData.hierarchyData.length;c++)s=As(this.treemapLevelData.hierarchyData[c]).values,0!==c&&s&&(s.forEach(function(e){u.push(e)}),this.treemapLevelData.hierarchyData.splice(c,1),--c);for(var u=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath],g=0;g<u.length;g++)(o[this.levels[0].groupPath]=u)[g].parent=o}},e0.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},e0.prototype.export=function(i,n,o,r){var s=this;return je(r)&&(r=!0),"PDF"===i&&this.allowPdfExport&&this.pdfExportModule?new Promise(function(e,t){e(s.pdfExportModule.export(s,i,n,o,r))}):this.allowImageExport&&"PDF"!==i&&this.imageExportModule?new Promise(function(e,t){e(s.imageExportModule.export(s,i,n,r))}):null},e0.prototype.processFlatJsonData=function(){this.dataSource=this.dataSource;for(var e=[],t=0;t<this.levels.length+1;t++){var i=this.levels[t]?this.levels[t].groupPath:this.leafItemSettings.labelPath,n={};n.level=t,n[i]=[],this.treemapLevelData.levelsData.push(n);for(var o=0;o<this.dataSource.length;o++){var r={},s="";if(!je(i)){var a=this.dataSource[o][i];if(0!==t)for(var l=0;l<=t;l++){var h=this.levels[l]?this.levels[l].groupPath:i;s+=this.dataSource[o][h]+(l===t?"":"#")}0<e.length&&-1!==e.indexOf(s||a)||(r.name=a,r.levelOrderName=(s||a)+"",r.groupIndex=t,r.isDrilled=!1,r.groupName=i,r.data=this.dataSource[o],this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][i].push(r),e.push(s||a))}}}},e0.prototype.reOrderLevelData=function(e){for(var t=this.levels[e]?this.levels[e].groupPath:this.leafItemSettings.labelPath,i=this.levels[e-1].groupPath,n=this.treemapLevelData.levelsData[e][t],o=this.treemapLevelData.levelsData[e-1][i],r=0;r<n.length;r++)for(var s=n[r].levelOrderName,a=0;a<o.length;a++)if(o[a][t]=je(o[a][t])?[]:o[a][t],this.IsChildHierarchy(s.split("#"),o[a].levelOrderName.split("#"))){je(n[r].parent)&&(n[r].parent=o[a]),o[a][t].push(n[r]);break}this.findTotalWeight(this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][t],"Child"),this.treemapLevelData.levelsData.splice(e,1),0<e-1&&this.reOrderLevelData(e-1)},e0.prototype.IsChildHierarchy=function(e,t){for(var i=!1,n=0;n<t.length;n++){if(e.length<n||t[n]!==e[n])return!1;i=!0}return i},e0.prototype.findTotalWeight=function(i,e){for(var n,o,r,s=this,a={},l=this,t=0;t<i.length;t++)!function(t){n=0,r=i[t].groupName,o=i[t].levelOrderName.split("#"),l.dataSource.forEach(function(e){Ss(o,i[t].levelOrderName,e,s)&&(n+=parseFloat(e[s.weightValuePath]))}),"Parent"===e&&((a[r]=i)[t].parent=a),i[t].weight=n}(t)},e0.prototype.unWireEVents=function(){E.remove(this.element,"click",this.clickOnTreeMap),E.remove(this.element,"dblclick",this.doubleClickOnTreeMap),E.remove(this.element,"contextmenu",this.rightClickOnTreeMap),E.remove(this.element,F.touchStartEvent,this.mouseDownOnTreeMap),E.remove(this.element,F.touchMoveEvent,this.mouseMoveOnTreeMap),E.remove(this.element,F.touchEndEvent,this.mouseEndOnTreeMap),E.remove(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap),E.remove(this.element,"keydown",this.keyDownHandler),E.remove(this.element,"keyup",this.keyUpHandler),E.remove(this.element,"focusout",this.focusHandler),window.removeEventListener("resize",this.resizeEvent)},e0.prototype.wireEVents=function(){E.add(this.element,"click",this.clickOnTreeMap,this),E.add(this.element,"dblclick",this.doubleClickOnTreeMap,this),E.add(this.element,"contextmenu",this.rightClickOnTreeMap,this),E.add(this.element,F.touchStartEvent,this.mouseDownOnTreeMap,this),E.add(this.element,F.touchMoveEvent,this.mouseMoveOnTreeMap,this),E.add(this.element,F.touchEndEvent,this.mouseEndOnTreeMap,this),E.add(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap,this),E.add(this.element,"keydown",this.keyDownHandler,this),E.add(this.element,"keyup",this.keyUpHandler,this),E.add(this.element,"focusout",this.focusHandler,this),this.resizeEvent=this.resizeOnTreeMap.bind(this),window.addEventListener("resize",this.resizeEvent)},e0.prototype.setCulture=function(){this.intl=new Ti},e0.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"TreeMap Element"),this.element.setAttribute("role","region"),this.element.setAttribute("tabindex",this.tabIndex.toString())},e0.prototype.resizeOnTreeMap=function(e){var t,i=this;this.isDestroyed||(this.isResize=!0,t={name:wr,cancel:!1,previousSize:this.availableSize,currentSize:new as(0,0),treemap:this},this.resizeTo&&clearTimeout(this.resizeTo),!je(this.element)&&this.element.classList.contains("e-treemap")&&(this.resizeTo=setTimeout(function(){i.unWireEVents(),i.createSvg(),i.refreshing=!0,i.wireEVents(),t.currentSize=i.availableSize,i.trigger(wr,t,function(e){i.render(),i.refreshing=!1})},500)))},e0.prototype.clickOnTreeMap=function(e){var t,i=this,n=e.target,o=n.id,r=n.innerHTML,s=(this.trigger(gr,{cancel:!1,name:gr,treemap:this,mouseEvent:e}),-1<o.indexOf("_Item_Index")&&(e.preventDefault(),s=parseFloat(o.split("_Item_Index_")[1]),s={cancel:!1,name:cr,treemap:this,item:this.layout.renderItems[s],mouseEvent:e,groupIndex:this.layout.renderItems[s].groupIndex,groupName:this.layout.renderItems[s].name,text:r,contentItemTemplate:r},this.trigger(cr,s,function(e){e.text===r&&e.contentItemTemplate===r||(je(i.leafItemSettings.labelTemplate)?(e.text=Ks(e.text,e.item.data,e.treemap),n.textContent=e.text):bs(o,n,e.contentItemTemplate))})),(new Date).getMilliseconds());je(this.doubleClick)||!je(t)&&s-t<500&&this.doubleClickOnTreeMap(e)},e0.prototype.doubleClickOnTreeMap=function(e){this.trigger(mr,{cancel:!1,name:mr,treemap:this,mouseEvent:e})},e0.prototype.rightClickOnTreeMap=function(e){this.trigger(fr,{cancel:!1,name:fr,treemap:this,mouseEvent:e})},e0.prototype.mouseDownOnTreeMap=function(e){-1<e.target.id.indexOf("_Item_Index")&&(this.mouseDown=!0),"touchstart"!==e.type&&"mousedown"!==e.type||(this.removeFocus("none"),e.preventDefault()),this.notify(F.touchStartEvent,e)},e0.prototype.mouseMoveOnTreeMap=function(e){var t,i=e.target.id;this.trigger(yr,{cancel:!1,name:yr,treemap:this,mouseEvent:e}),this.removeFocus("none"),-1<i.indexOf("_Item_Index")?(t=As(i=this.layout.renderItems[parseFloat(i.split("_Item_Index_")[1])]).values,this.element.style.cursor=!i.isLeafItem&&t&&0<t.length&&this.enableDrillDown?"pointer":"auto",this.trigger(ur,{cancel:!1,name:ur,treemap:this,item:i,mouseEvent:e})):this.element.style.cursor="default",this.notify(F.touchMoveEvent,e)},e0.prototype.calculateSelectedTextLevels=function(e,t){for(var i,n,o,r=t.levelOrderName.split("#"),s=0,a=Object.keys(r);s<a.length;s++)r[n=a[s]]===e&&(i=parseInt(n,10),o=e);return{drillLevel:i,currentLevelLabel:o,levelText:r}},e0.prototype.calculatePreviousLevelChildItems=function(e,t,i){for(var n,o,r=0,s=this.layout.renderItems[0].levelOrderName.split("#").length,a=0;a<s;a++)o=0===a?e.levelText[a]:o+"#"+e.levelText[a];for(var l,r=1<s?s:r,h=0,d=Object.values(this.layout.renderItems);h<d.length;h++)(l=d[h]).levelOrderName.split("#")[0]===e.levelText[0]&&(n=0===r?je(o)?o:e.levelText[r]:i?o:o+"#"+e.levelText[r])===l.levelOrderName&&(this.drilledItems.push({name:l.levelOrderName,data:l}),i=!0,++r<=t.groupIndex)&&(o=n+"#"+e.levelText[r]);return i},e0.prototype.compareSelectedLabelWithDrillDownItems=function(e,t,i){var n,o={};return e.drillLevel+1===this.drilledItems[i].data.groupIndex?((n=this.drilledItems[i].data.parent).isDrilled=!0,o[n[this.drilledItems[i].data.groupName]]=[n],this.drilledItems.splice(i,this.drilledItems.length)):e.drillLevel!==this.drilledItems.length-1&&e.drillLevel!==t.groupIndex||(o[t.groupName]=[t]),o},e0.prototype.mouseEndOnTreeMap=function(e){var i,n,t,o=this,r=e.target,s=r.id,a=!1,l={},h=this.element.id+"_TreeMap_"+this.layoutType+"_Layout",d=this.element.id+"_Label_Template_Group";if(-1<s.indexOf("_Item_Index")&&this.enableDrillDown&&!this.drillMouseMove){e.cancelable&&e.preventDefault(),s=parseFloat(s.split("_Item_Index_")[1]),p=this.layout.renderItems[s];var s=r.textContent;if(this.enableBreadcrumb&&(t=this.calculateSelectedTextLevels(s,p),n=t.drillLevel,this.drillDownView||-1===s.search("[+]")||(a=this.calculatePreviousLevelChildItems(t,p,a))),0!==this.levels.length&&!p.isLeafItem&&As(p).values&&0<As(p).values.length){if(0<this.drilledItems.length)for(var p=a?this.drilledItems[this.drilledItems.length-1].data:p,c=0;c<this.drilledItems.length;c++){if(!je(n)){var u=this.drilledItems.length,l=this.compareSelectedLabelWithDrillDownItems(t,p,c);if(u!==this.drilledItems.length){--c;break}}if(p.levelOrderName===this.drilledItems[c].name&&!a&&je(n)){0===p.groupIndex&&p.parent[p.groupName]instanceof Array?(p.isDrilled=!p.isDrilled,p.isDrilled?l[p.groupName]=[p]:l=p.parent):(p.isDrilled=!1,p.parent.isDrilled=!0,p=p.parent,l[p.groupName]=[p]),this.drilledItems.splice(c,1),--c;break}c===this.drilledItems.length-1&&je(n)&&(p.isDrilled=!0,l[p.groupName]=[p])}else p.isDrilled=!0,l[p.groupName]=[p];s={cancel:!1,name:ar,treemap:this,element:r,groupIndex:(this.enableBreadcrumb&&0!==this.drilledItems.length&&!je(n)?this.drilledItems[this.drilledItems.length-1].data:p).groupIndex,groupName:(this.enableBreadcrumb&&0!==this.drilledItems.length&&!je(n)?this.drilledItems[this.drilledItems.length-1].data:p).name,rightClick:3===e.which,childItems:null,item:l},this.trigger(ar,s,function(e){var t;o.currentLevel=p.isDrilled&&je(n)?p.groupIndex:!je(n)&&o.enableBreadcrumb&&p.isDrilled?n:null,e.cancel||(document.getElementById(h)&&(t=document.getElementById(h)).parentNode.removeChild(t),i=Pe({},o.areaRect,i,!0),o.legendSettings.visible&&!je(o.treeMapLegendModule)&&(je(l)||(o.treeMapLegendModule.legendGroup.textContent="",o.treeMapLegendModule.legendGroup=null,o.treeMapLegendModule.widthIncrement=0,o.treeMapLegendModule.heightIncrement=0,o.enableBreadcrumb&&!je(n)?o.drilledLegendItems={name:o.drilledItems[o.drilledItems.length-1].data.levelOrderName,data:o.drilledItems[o.drilledItems.length-1].data}:o.drilledLegendItems={name:p.levelOrderName,data:p},o.treeMapLegendModule.renderLegend()),i=je(o.totalRect)?i:o.totalRect),document.getElementById(d)&&(t=document.getElementById(d)).parentNode.removeChild(t),je(e.childItems)||e.cancel?(o.layout.calculateLayoutItems(l,i),o.layout.renderLayoutItems()):o.layout.onDemandProcess(e.childItems))}),r={cancel:!1,name:lr,treemap:this,renderItems:this.layout.renderItems},this.trigger(lr,r),!a&&je(n)&&this.drilledItems.push({name:p.levelOrderName,data:p})}}this.mouseDown=!1,this.notify(F.touchEndEvent,e)},e0.prototype.mouseLeaveOnTreeMap=function(e){this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapLegendModule&&this.treeMapLegendModule.removeInteractivePointer(),Ys(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&(la(this.treeMapHighlightModule.shapeHighlightCollection,this),this.treeMapHighlightModule.highLightId=""),this.removeFocus("")},e0.prototype.keyUpHandler=function(e){var t;"Tab"===e.code&&(e=e.target.id,t=document.getElementById(e),-1<e.indexOf("Item_Index")||-1<e.indexOf("Legend")?(this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapHighlightModule&&this.highlightSettings.enable?(t.style.setProperty("outline","none"),t.classList.add("keyboard-focused"),e=-1<e.indexOf("_Legend_")&&"Default"===this.legendSettings.mode?t.children[0]:t,this.treeMapHighlightModule.highlightOnMouseMove(e)):(this.removeFocus(""),t.style.outline="2px solid black",t.classList.add("keyboard-focused"))):(Ys(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&la(this.treeMapHighlightModule.shapeHighlightCollection,this),this.removeFocus("none")))},e0.prototype.keyDownHandler=function(e){var t=e.target.id,i=document.getElementById(t);"Enter"===e.code&&(this.selectionSettings.enable&&(-1<t.indexOf("Item_Index")||-1<t.indexOf("Legend"))&&(t=-1<t.indexOf("_Legend_")&&"Default"===this.legendSettings.mode?i.children[0]:i,this.treeMapSelectionModule.selectionOnMouseDown(t)),this.enableDrillDown)&&0<i.childElementCount&&this.mouseEndOnTreeMap(e)},e0.prototype.focusHandler=function(e){var t=e.target.id;(!this.element.contains(e.relatedTarget)||-1<t.indexOf("Item_Index")&&-1<e.relatedTarget.id.indexOf("Legend")||-1<t.indexOf("Legend")&&-1<e.relatedTarget.id.indexOf("Item_Index"))&&(this.treeMapHighlightModule&&this.highlightSettings.enable?(Ys(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),la(this.treeMapHighlightModule.legendHighlightCollection,this),this.treeMapHighlightModule.highLightId=""):this.removeFocus("none"))},e0.prototype.removeFocus=function(e){var t=document.querySelector(".keyboard-focused");t&&(t.style.outline=e,t.classList.remove("keyboard-focused"))},e0.prototype.selectItem=function(e,t){je(t)&&(t=!0);for(var i="",n=0;n<e.length;n++)n!==e.length-1?i+=e[n]+"#":i+=e[n];this.treeMapSelectionModule&&this.selectionSettings.enable&&this.treeMapSelectionModule.selectTreemapItem(i,t)},e0.prototype.requiredModules=function(){var e=[];return this.tooltipSettings.visible&&e.push({member:"treeMapTooltip",args:[this],name:"TreeMapTooltip"}),this.highlightSettings.enable&&e.push({member:"treeMapHighlight",args:[this],name:"TreeMapHighlight"}),this.selectionSettings.enable&&e.push({member:"treeMapSelection",args:[this],name:"TreeMapSelection"}),this.legendSettings.visible&&e.push({member:"treeMapLegend",args:[this],name:"TreeMapLegend"}),this.allowPrint&&e.push({member:"Print",args:[this,dl],name:"Print"}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,cl],name:"ImageExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,Xy],name:"PdfExport"}),e},e0.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){for(var i=!1,n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"background":this.renderBorder();break;case"height":case"width":case"layoutType":case"levels":case"drillDownView":case"renderDirection":case"leafItemSettings":case"legendSettings":case"dataSource":i=!0}i&&(this.createSvg(),this.renderElements())}},e0.prototype.getModuleName=function(){return"treemap"},e0.prototype.destroy=function(){this.unWireEVents(),ga("treeMapMeasureText"),this.drilledItems=[],this.levelSelection=[],this.legendId=[],this.removeSvg(),Zy.prototype.destroy.call(this),this.areaRect=null,this.themeStyle=null,this.totalRect=null,this.drilledLegendItems=null,this.doubleTapTimer=null,this.treemapLevelData=null,this.resizeEvent=null,this.availableSize=null,this.intl=null,je(this.layout)||this.layout.destroy(),this.layout=null,this.renderer=null},e0.prototype.removeSvg=function(){if(ga(this.element.id+"_Secondary_Element"),this.svgObject){for(;0<this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&ue(this.svgObject)}},$y([e(!(e0.prototype.getPersistData=function(){return""}))],e0.prototype,"allowPrint",void 0),$y([e(!1)],e0.prototype,"allowImageExport",void 0),$y([e(!1)],e0.prototype,"allowPdfExport",void 0),$y([e(null)],e0.prototype,"width",void 0),$y([e(null)],e0.prototype,"height",void 0),$y([t({},Sr)],e0.prototype,"border",void 0),$y([t({},Ir)],e0.prototype,"margin",void 0),$y([e(null)],e0.prototype,"background",void 0),$y([e("Material")],e0.prototype,"theme",void 0),$y([t({},Nr)],e0.prototype,"titleSettings",void 0),$y([e("Squarified")],e0.prototype,"layoutType",void 0),$y([e(null)],e0.prototype,"dataSource",void 0),$y([e(null)],e0.prototype,"query",void 0),$y([e(null)],e0.prototype,"weightValuePath",void 0),$y([e("")],e0.prototype,"rangeColorValuePath",void 0),$y([e("")],e0.prototype,"equalColorValuePath",void 0),$y([e(null)],e0.prototype,"colorValuePath",void 0),$y([e([])],e0.prototype,"palette",void 0),$y([e("TopLeftBottomRight")],e0.prototype,"renderDirection",void 0),$y([e(!1)],e0.prototype,"enableDrillDown",void 0),$y([e(!1)],e0.prototype,"enableBreadcrumb",void 0),$y([e(" - ")],e0.prototype,"breadcrumbConnector",void 0),$y([e(!1)],e0.prototype,"drillDownView",void 0),$y([e(!1)],e0.prototype,"enableHtmlSanitizer",void 0),$y([t({},qr)],e0.prototype,"initialDrillDown",void 0),$y([t({},Xr)],e0.prototype,"leafItemSettings",void 0),$y([kt([],tn)],e0.prototype,"levels",void 0),$y([t({},o)],e0.prototype,"highlightSettings",void 0),$y([t({},ts)],e0.prototype,"selectionSettings",void 0),$y([t({},Zr)],e0.prototype,"tooltipSettings",void 0),$y([t({},Wr)],e0.prototype,"legendSettings",void 0),$y([e(!1)],e0.prototype,"useGroupingSeparator",void 0),$y([e(null)],e0.prototype,"description",void 0),$y([e(0)],e0.prototype,"tabIndex",void 0),$y([e(null)],e0.prototype,"format",void 0),$y([i()],e0.prototype,"load",void 0),$y([i()],e0.prototype,"beforePrint",void 0),$y([i()],e0.prototype,"loaded",void 0),$y([i()],e0.prototype,"itemRendering",void 0),$y([i()],e0.prototype,"drillStart",void 0),$y([i()],e0.prototype,"drillEnd",void 0),$y([i()],e0.prototype,"itemSelected",void 0),$y([i()],e0.prototype,"itemHighlight",void 0),$y([i()],e0.prototype,"tooltipRendering",void 0),$y([i()],e0.prototype,"itemClick",void 0),$y([i()],e0.prototype,"itemMove",void 0),$y([i()],e0.prototype,"click",void 0),$y([i()],e0.prototype,"doubleClick",void 0),$y([i()],e0.prototype,"rightClick",void 0),$y([i()],e0.prototype,"mouseMove",void 0),$y([i()],e0.prototype,"resize",void 0),$y([i()],e0.prototype,"legendItemRendering",void 0),$y([i()],e0.prototype,"legendRendering",void 0),$y([Bt],e0));function e0(e,t){e=Zy.call(this,e,t)||this;return e.isResize=!1,e.orientation="Horizontal",e.drilledItems=[],e.isHierarchicalData=!1,e.levelSelection=[],e.legendId=[],e}var t0=function(){},i0=(n0.prototype.renderLegend=function(){var t=this,e=(this.page=0,this.legendRenderingCollections=[],this.legendCollections=[],this.legendNames=[],this.totalPages=[],this.gradientCount=1,this.widthIncrement=0,this.heightIncrement=0,this.defsElement=this.treemap.renderer.createDefs(),this.treemap.svgObject.appendChild(this.defsElement),{cancel:!1,name:br,treemap:this.treemap,_changePosition:this.treemap.legendSettings.position,position:this.treemap.legendSettings.position});this.treemap.trigger(br,e,function(e){e.cancel||e._changePosition===t.treemap.legendSettings.position||(t.treemap.legendSettings.position=e._changePosition),t.calculateLegendBounds(),0<t.legendCollections.length&&t.drawLegend()})},n0.prototype.calculateLegendBounds=function(){var i=this,e=this.treemap,t=e.legendSettings;if(this.findColorMappingLegendItems(e.treemapLevelData.levelsData[0]),(!je(this.treemap.palette)&&0<this.treemap.palette.length||!je(e.colorValuePath))&&0===this.legendCollections.length&&this.findPaletteLegendItems(e.treemapLevelData.levelsData[0]),0<this.legendCollections.length){this.legendCollections.sort(function(e,t){return e.levelIndex>t.levelIndex?1:e.levelIndex<t.levelIndex?-1:0}),this.legendCollections.sort(function(e,t){return e.groupIndex>t.groupIndex?1:e.groupIndex<t.groupIndex?-1:0}),this.legendCollections.sort(function(e,t){return e.leafIndex>t.leafIndex?1:e.leafIndex<t.leafIndex?-1:0});var n=t.position,O=e.enableHtmlSanitizer?go.sanitize(t.title.text):t.title.text,o=t.titleStyle,N=t.mode,r=0,s=0,a=0,l=0,h=t.shapeHeight,d=t.shapeWidth,p=[],c=[],u="None"===t.orientation?"Top"===n||"Bottom"===n||"Auto"===n&&e.availableSize.width<=e.availableSize.height?"Horizontal":"Vertical":t.orientation,g=1<t.width.length?-1<t.width.indexOf("%")?e.availableSize.width/100*parseFloat(t.width):parseFloat(t.width):null,m=1<t.height.length?-1<t.height.indexOf("%")?e.availableSize.height/100*parseFloat(t.height):parseFloat(t.height):null,V=(o.fontFamily=o.fontFamily||e.themeStyle.fontFamily,o.fontWeight=o.fontWeight||e.themeStyle.titleFontWeight,o.size=o.size||e.themeStyle.subtitleFontSize,cs(O,o)),f=0,y=0,v=t.shapePadding,b=t.textStyle;if(b.size=b.size||e.themeStyle.legendFontSize,b.fontFamily=b.fontFamily||e.themeStyle.fontFamily,b.fontWeight=b.fontWeight||e.themeStyle.fontWeight,"Default"===N){for(var g=je(g)?e.areaRect.width:g,m=je(m)?e.areaRect.height:m,w=0,C=0;C<this.legendCollections.length;C++){var S,A,x,I=this.legendCollections[C],T=(je(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]}),cs(e.enableHtmlSanitizer?go.sanitize(I.legendName):I.legendName,b));this.textMaxWidth=Math.max(this.textMaxWidth,T.width),0===C?(f=r=10+d/2,y=s=10+V.height+(h>T.height?h/2:T.height/4)):(S=T.height>h?T.height:h,"Horizontal"===u?s=(x=c[w-1].x+c[w-1].width+10+d)+v+T.width>g?m<(A=(c[w-1].y>p[w-1].y+h/2?c[w-1].y:p[w-1].y+h/2)+10)+S?(this.getPageChanged(),w=0,p=[],c=[],r=f,y):(r=p[0].x,A+S/2):(r=x-d/2,p[w-1].y):m<(A=c[w-1].y>p[w-1].y+h/2?c[w-1].y:p[w-1].y+h/2)+10+S?(x=c[w-1].x+this.textMaxWidth+10)+v+T.width>g?(r=f,s=y,c=[],p=[],this.getPageChanged(),w=0):(r=x+d/2,s=p[0].y):(r=p[w-1].x,s=A+10+h/2)),a=r+d/2+v,l=s+T.height/4,p.push({x:r,y:s}),c.push({x:a,y:l,width:T.width,height:T.height/2}),this.totalPages[this.page].Collection.push({DisplayText:I.legendName,element:I.gradientElement,Shape:{x:r,y:s},Text:{x:a,y:l},Fill:I.legendFill,Data:I.legendData,Rect:{x:p[w].x-d/2,y:p[w].y-h/2<l-T.height?p[w].y-h/2:l-T.height,width:Math.abs(p[w].x-d/2-(a+T.width)),height:h>T.height?h:T.height}}),w++}n=this.totalPages[0].Collection;n.forEach(function(e,t){e=new hs(e.Rect.x,e.Rect.y,e.Rect.width,e.Rect.height);0===t&&(f=e.x,y=e.y),i.widthIncrement=Math.max(i.widthIncrement,Math.abs(f-(e.x+e.width))),i.heightIncrement=Math.max(i.heightIncrement,Math.abs(y-(e.y+e.height)))}),g=this.widthIncrement<g?this.widthIncrement:g,m=this.heightIncrement<m?this.heightIncrement:m,this.legendItemRect={x:n[0].Rect.x,y:n[0].Rect.y,width:g,height:m}}else{for(var E=this.legendCollections.length,D="Horizontal"===u?je(g)?e.areaRect.width/E:g/E:je(g)?25:g,M="Horizontal"===u?je(m)?25:m:je(m)?e.areaRect.height/E:m/E,k=(f=0,y=V.height+10,t.labelPosition),P=0,B=0,_=t.labelDisplayMode,F=0,H=0,C=0;C<this.legendCollections.length;C++){var f="Horizontal"===u?f+D:f,y="Horizontal"===u?y:y+M,L=this.legendCollections[C].legendName,R=new as(0,0);"None"===_?R=cs(L,b):"Trim"===_?R=cs(L=gs("Horizontal"===u?D:M,L,b),b):L="",F=Math.max(F,R.height),H=Math.max(H,R.width),0<R.width&&0<R.height&&(l="Horizontal"===u?(a=f+D/2,"After"===k?y+M+R.height/2+10:y-10):(a="After"===k?f-R.width/2-10:f+D+R.width/2+10,y+M/2+R.height/4)),0===C&&(P="Horizontal"!==u&&"After"===k?a-R.width/2:f,B="Horizontal"!==u||"After"===k?y:l-R.height/2),C===E-1&&(g="Horizontal"===u?Math.abs(f+D-P):D+H+10,m="Horizontal"===u?M+F/2+10:Math.abs(y+M-B)),this.legendRenderingCollections.push({fill:this.legendCollections[C].legendFill,x:f,y:y,width:D,height:M,element:this.legendCollections[C].gradientElement,text:L,textX:a,textY:l,textWidth:R.width,textHeight:R.height,data:this.legendCollections[C].legendData})}this.legendItemRect={x:P,y:B,width:g,height:m}}}},n0.prototype.getPageChanged=function(){this.page++,je(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]})},n0.prototype.findColorMappingLegendItems=function(e){var t=As(e).values;if(t&&0<t.length&&(this.calculateLegendItems(t),0<this.treemap.levels.length))for(var i=0;i<t.length;i++)this.findColorMappingLegendItems(t[i])},n0.prototype.findPaletteLegendItems=function(e){var t,i;if(!je(this.treemap.drilledItems)&&0===this.treemap.drilledItems.length&&!je(this.treemap.initialDrillDown.groupName)&&je(this.treemap.drilledLegendItems))for(var n=As(e).values,o=0;o<n.length;o++)if(n[o].Name===this.treemap.initialDrillDown.groupName){n[o].isDrilled=!n[o].isDrilled,e=n[o],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,t=0<this.treemap.palette.length?this.treemap.palette[o%this.treemap.palette.length]:n[o].data[this.treemap.colorValuePath];break}if(this.treemap.enableDrillDown&&!je(this.treemap.drilledLegendItems)){var r,s=this.treemap.drilledLegendItems;if(je(s.data.options))for(o=0;o<s.length;o++){t=0<this.treemap.palette.length?this.treemap.palette[o%this.treemap.palette.length]:s[o].data[this.treemap.colorValuePath];break}else t=s.data.options.fill;r=(s.data.isDrilled?As(s.data):As(s.data.parent)).values}else r=As(e).values;if(r&&0<r.length){for(var a=0;a<r.length;a++)!je(r[a].data[this.treemap.legendSettings.showLegendPath])&&!r[a].data[this.treemap.legendSettings.showLegendPath]||(i=r[a].data[this.treemap.legendSettings.valuePath]||r[a].name,!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,i))||this.legendCollections.push({legendName:i,legendFill:0<this.treemap.palette.length?je(this.treemap.currentLevel)?this.treemap.palette[a%this.treemap.palette.length]:t:r[a].data[this.treemap.colorValuePath],legendData:[],itemArea:r[a].weight,levelOrderName:r[a].levelOrderName});if(this.legendCollections.sort(Us),0<this.treemap.palette.length)for(var l=0;l<this.legendCollections.length;l++)this.legendCollections[l].legendFill=je(this.treemap.currentLevel)?this.treemap.palette[l%this.treemap.palette.length]:t}},n0.prototype.calculateLegendItems=function(e){var t,i,n,o,r,s,a=!1,l=this.treemap.leafItemSettings,h=this.treemap.levels,d=this.treemap.legendSettings.position,p=!1,c=0;this.outOfRangeLegend=null;for(var u=0;u<e.length;u++){i="",p=s=r=!1;for(var g,m=e[u].data,f=e[u].groupIndex,y=((g=0===this.treemap.levels.length||f===this.treemap.levels.length)?l:h[f]).colorMapping,v=0;v<y.length;v++){var b=y[v];if(I=null,A=Number(m[this.treemap.rangeColorValuePath]),x=m[this.treemap.equalColorValuePath],b.value=je(b.value)?b.value:b.value.toString(),!je(b.from)&&!je(b.to)&&A>=b.from&&A<=b.to&&b.showLegend?(s=a=!0,o=b.from+" - "+b.to,n=je(b.label)?b.from+" - "+b.to:b.label,i=je(b.color)?i:b.color,t=this.isAddNewLegendData(o)):!je(b.value)&&x===b.value&&b.showLegend&&(r=a=!0,o=b.value.toString(),n=je(b.label)?b.value.toString():b.label,i=je(b.color)?i:"[object Array]"===Object.prototype.toString.call(b.color)?b.color[0]:b.color,t=this.isAddNewLegendData(o)),a&&je(b.value)&&b.maxOpacity&&b.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var w=[],p=!0;if("[object Array]"===Object.prototype.toString.call(b.color))for(var C=0;C<b.color.length;C++){var S={colorStop:(C*(100/(b.color.length-1))+"%").toString(),color:b.color[C]};w.push(S)}else{var S={colorStop:"0%",color:i},A={colorStop:"100%",color:i};w.push(S),w.push(A)}var x={id:"groupIndex_"+f+"_colorIndex_"+this.gradientCount,x1:"0%",y1:"0%",x2:"Top"===d||"Bottom"===d?"100%":"0%",y2:"Top"===d||"Bottom"===d?"0%":"100%"},I=this.treemap.renderer.drawGradient("linearGradient",x,w).childNodes[0];"[object Array]"!==Object.prototype.toString.call(b.color)&&(I.childNodes[0].setAttribute("stop-opacity",b.minOpacity.toString()),I.childNodes[1].setAttribute("stop-opacity",b.maxOpacity.toString())),this.defsElement.appendChild(I),this.gradientCount++}if(A=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,n),t&&t.process&&a&&!A?(a=!1,i="[object Array]"===Object.prototype.toString.call(b.color)&&je(I)&&je(b.value)?this.legendGradientColor(b,c):i,this.legendCollections.push({actualValue:o,levelIndex:g?-1:v,leafIndex:g?v:-1,legendName:n,legendFill:i,legendData:[],groupIndex:g?-1:f,gradientElement:je(I)?je(b.value)?this.legendLinearGradient:null:I,name:e[u].name,opacity:this.treemap.legendSettings.opacity,borderColor:this.treemap.legendSettings.border.color,borderWidth:this.treemap.legendSettings.border.width}),this.legendCollections[this.legendCollections.length-1].legendData.push(e[u]),c++):a&&(a=!1,this.legendCollections[t.value].legendData.push(e[u])),!s&&!p&&!r&&je(b.from)&&je(b.to)&&je(b.minOpacity)&&je(b.maxOpacity)&&je(b.value)&&!je(b.color)){x="[object Array]"===Object.prototype.toString.call(b.color)?b.color[0]:b.color,I=je(b.label)?"Others":b.label,A=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,I),je(this.outOfRangeLegend)&&!A&&(this.legendCollections.push({actualValue:I,legendData:[],legendName:I,legendFill:x,groupIndex:!g||-1<f?f:-1}),A=this.legendCollections.length,this.outOfRangeLegend=this.legendCollections[A-1],c++);for(var T=this.legendCollections.length-1;0<=T;T--)if(this.legendCollections[T].actualValue===(b.label||"Others")){this.legendCollections[T].legendData.push(e[u]);break}}}}},n0.prototype.removeDuplicates=function(e,t){for(var i=!1,n=0;n<e.length;n++)if(e[n].legendName===t){i=!0;break}return i},n0.prototype.isAddNewLegendData=function(e){var t,i;if(0===this.legendCollections.length)t=!0;else for(var n=0;n<this.legendCollections.length;n++){if(e===this.legendCollections[n].actualValue){t=!1,i=n;break}n===this.legendCollections.length-1&&(t=!0)}return{process:t,value:i}},n0.prototype.drawLegend=function(){var e=this.treemap.legendSettings,t=this.treemap.renderer,i=e.textStyle;if(this.legendGroup=t.createGroup({id:this.treemap.element.id+"_Legend_Group"}),this.renderLegendBorder(),this.renderLegendTitle(),"Default"===e.mode)this.drawLegendItem(this.currentPage);else for(var n=0;n<this.legendRenderingCollections.length;n++){var o=this.treemap.element.id+"_Legend_Index_"+n,r=this.treemap.element.id+"_Legend_Index_"+n+"_Text",s=this.legendRenderingCollections[n],a=(a=s.element)?"url(#"+a.id+")":s.fill,l=new hs(s.x,s.y,s.width,s.height),h=new ms(s.textX,s.textY),o=new ds(o,a,e.shapeBorder,e.opacity,l),a=(this.treemap.enableRtl&&("Left"===this.treemap.legendSettings.position||"Right"===this.treemap.legendSettings.position||"Auto"===this.treemap.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height?(o.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-(this.translate.y+o.height)-Math.abs(this.legendBorderRect.y-o.y),h.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y+s.textHeight/2-Math.abs(this.legendBorderRect.y-h.y)):(o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+o.width)-Math.abs(this.legendBorderRect.x-o.x),h.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-this.translate.x-Math.abs(this.legendBorderRect.x-h.x))),this.treemap.enableHtmlSanitizer?go.sanitize(s.text):s.text),l=(vs(new us(r,h.x,h.y,"middle",a,"",""),i,i.color||this.treemap.themeStyle.legendTextColor,this.legendGroup),t.drawRectangle(o));l.setAttribute("tabindex",this.treemap.tabIndex.toString()),l.style.outline="",this.legendGroup.appendChild(l)}Gs(this.treemap,this.legendGroup)},n0.prototype.defaultLegendRtlLocation=function(e,t,i,n){var o=e.Shape,r=e.Text,e=cs(e.DisplayText,n.textStyle);return o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+t)-Math.abs(this.legendBorderRect.x-o.x),r.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+e.width+t)-Math.abs(this.legendBorderRect.x-r.x),("Left"===i.legendSettings.position||"Right"===i.legendSettings.position||"Auto"===i.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height)&&(o.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-o.y)-n.shapeHeight/2,r.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-r.y)),{shapeLocation:o,textLocation:r}},n0.prototype.drawLegendItem=function(t){var h,d=this,p=this.treemap,c=10,u=p.legendSettings,g=new as(u.shapeWidth,u.shapeHeight),m=p.renderer,e=u.shapeBorder;if(0<=t&&t<this.totalPages.length){document.getElementById(this.legendGroup.id)&&document.getElementById(this.legendGroup.id).remove();for(var f="HorizontalLine"===u.shape||"VerticalLine"===u.shape||"Cross"===u.shape,y=f?je(u.fill)?"#000000":u.fill:e.color,v=f&&0===e.width?1:e.width,b=this,i=0;i<this.totalPages[t].Collection.length;i++)!function(e){var i=b.totalPages[t].Collection[e],n=b.treemap.enableHtmlSanitizer?go.sanitize(i.DisplayText):i.DisplayText,o=m.createGroup({id:p.element.id+"_Legend_Index_"+e}),r=(o.setAttribute("aria-label",n+" Legend"),o.setAttribute("role","region"),o.setAttribute("tabindex",b.treemap.tabIndex.toString()),o.style.outline="none",p.element.id+"_Legend_Shape_Index_"+e),s=p.element.id+"_Legend_Text_Index_"+e,a=i.Shape,l=i.Text;p.enableRtl&&(h=b.defaultLegendRtlLocation(i,c,p,u),a=h.shapeLocation,l=h.textLocation),h={cancel:!1,name:vr,treemap:p,fill:i.Fill,shape:u.shape,imageUrl:u.imageUrl},p.trigger(vr,h,function(e){var t=new ps(r,e.fill,v,f?i.Fill:y,u.opacity,"");o.appendChild(na(a,e.shape,g,e.imageUrl,t)),vs(new us(s,l.x,l.y,"start",n,"",""),u.textStyle,u.textStyle.color||p.themeStyle.legendTextColor,o),d.legendGroup.appendChild(o)})}(i);var n,o,r,s,a,l,w,C,S,A,x,e=void 0,I=c,T=c/2;0!==this.page&&(r=cs(n=t+1+"/"+this.totalPages.length,o=u.textStyle),S=this.legendItemRect.x+this.legendItemRect.width-r.width-2*I-c,s=this.legendItemRect.x+this.legendItemRect.width,a=this.legendItemRect.y+this.legendItemRect.height+T/2+c,l=s-I-r.width/2-c/2,e=m.createGroup({id:p.element.id+"_Legend_Paging_Group"}),w=m.createGroup({id:p.element.id+"_Legend_Left_Paging_Group"}),C=m.createGroup({id:p.element.id+"_Legend_Right_Paging_Group"}),x=" M "+s+" "+a+" L "+(s-I)+" "+(a-T)+" L "+(s-I)+" "+(a+T)+" z ",A=new ps(p.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,""," M "+S+" "+a+" L "+(S+I)+" "+(a-T)+" L "+(S+I)+" "+(a+T)+" z "),w.appendChild(m.drawPath(A)),A=new ds(p.element.id+"_Left_Page_Rect","transparent",{},1,new hs(S-I/2,a-2*T,2*I,2*c),""),w.appendChild(m.drawRectangle(A)),this.wireEvents(w),S=new ps(p.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",x),C.appendChild(m.drawPath(S)),A=new ds(p.element.id+"_Right_Page_Rect","transparent",{},1,new hs(s-I,a-T,I,c),""),C.appendChild(m.drawRectangle(A)),this.wireEvents(C),e.appendChild(w),e.appendChild(C),x={id:p.element.id+"_Paging_Text",x:l,y:a+r.height/4,fill:"#a6a6a6","font-size":"14px","font-style":o.fontStyle,"font-family":o.fontFamily,"font-weight":o.fontWeight,"text-anchor":"middle",transform:"",opacity:1,"dominant-baseline":"",role:"region","aria-label":n},e.appendChild(m.createText(x,n)),this.legendGroup.appendChild(e))}},n0.prototype.renderLegendBorder=function(){var e=this.treemap,t=e.legendSettings,i=t.title.text,n=t.titleStyle,i=cs(gs(this.legendItemRect.width+20,i,n),n),n=(this.legendBorderRect=new hs(this.legendItemRect.x-10,this.legendItemRect.y-10-i.height,this.legendItemRect.width+20,this.legendItemRect.height+20+i.height+("Interactive"!==t.mode&&0!==this.page?10:0)),{color:t.border.color||this.treemap.themeStyle.legendBorderColor,width:t.border.width||this.treemap.themeStyle.legendBorderWidth}),i=new ds(e.element.id+"_Legend_Border",t.background,n,1,this.legendBorderRect,""),n=e.renderer.drawRectangle(i);n.style.pointerEvents="none",this.legendGroup.appendChild(n),this.getLegendAlignment(e,this.legendBorderRect.width,this.legendBorderRect.height,t),this.legendGroup.setAttribute("transform","translate( "+(this.translate.x+-this.legendBorderRect.x)+" "+(this.translate.y+-this.legendBorderRect.y)+" )"),e.svgObject.appendChild(this.legendGroup)},n0.prototype.renderLegendTitle=function(){var e=this.treemap.legendSettings,t=e.titleStyle,e=this.treemap.enableHtmlSanitizer?go.sanitize(e.title.text):e.title.text,i=gs(this.legendItemRect.width+20,e,t),n=cs(i,t);e&&((n=vs(new us(this.treemap.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-n.height/2-5,"middle",i,""),t,t.color||this.treemap.themeStyle.legendTitleColor,this.legendGroup)).setAttribute("role","region"),n.setAttribute("aria-label",e))},n0.prototype.renderInteractivePointer=function(e){var t=this.treemap,i=e.target,n=t.element.id+"_Interactive_Legend",o=!1,i=-1<e.type.indexOf("touch")?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):i,r=t.legendSettings;if(-1<i.id.indexOf("_Item_Index")&&r.visible&&0<this.legendRenderingCollections.length)for(var s=void 0,a=void 0,l=t.layout.renderItems[parseFloat(i.id.split("_Item_Index_")[1])],h=t.svgObject.getBoundingClientRect(),d=0;d<this.legendCollections.length&&!o;d++){var p=this.legendCollections[d],c=(a=document.getElementById(t.element.id+"_Legend_Index_"+d)).getBoundingClientRect(),u=new hs(Math.abs(c.left-h.left),Math.abs(c.top-h.top),c.width,c.height),g=a.getAttribute("fill"),m=r.shapeBorder.color,f=r.shapeBorder.width;if(!je(p.legendData)&&0<p.legendData.length){var s=p.legendData,y=t.rangeColorValuePath;if(-1<l.levelOrderName.indexOf(this.legendCollections[d].legendName))this.drawInteractivePointer(r,g,m,n,f,u),o=!0;else for(var v=0;v<s.length;v++)if(t.rangeColorValuePath&&0<t.leafItemSettings.colorMapping.length?s[v].data[y]===l.data[y]:s[v].levelOrderName===l.levelOrderName||-1<s[v].levelOrderName.indexOf(l.levelOrderName)){this.drawInteractivePointer(r,g,m,n,f,u),o=!0;break}}else 0===this.treemap.leafItemSettings.colorMapping.length&&this.treemap.palette&&-1<l.levelOrderName.indexOf(p.levelOrderName)&&(this.drawInteractivePointer(r,g,m,n,f,u),o=!0)}else this.removeInteractivePointer()},n0.prototype.drawInteractivePointer=function(e,t,i,n,o,r){var s,a,e="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(s=r.x+r.width/2)+" "+(a=r.y+r.height)+" L "+(s-10)+" "+(a+10)+" L "+(s+10)+" "+(a+10)+" Z ":" M "+(s=r.x+r.width/2)+" "+(a=r.y)+" L "+(s-10)+" "+(a-10)+" L "+(s+10)+" "+(a-10)+" Z ":e.invertedPointer?" M "+(s=r.x)+" "+(a=r.y+r.height/2)+" L "+(s-10)+" "+(a-10)+" L "+(s-10)+" "+(a+10)+" z ":" M "+(s=r.x+r.width)+" "+(a=r.y+r.height/2)+" L "+(s+10)+" "+(a-10)+" L "+(s+10)+" "+(a+10)+" z ",r=new ps(n,t,o,i,1,"",e);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(r))},n0.prototype.getLegendAlignment=function(e,t,i,n){var o,r,s=Pe({},e.areaRect,void 0,!0),a=s.x,l=s.y,h=s.height,d=s.width,p=e.availableSize.width,c=e.availableSize.height,u="Auto"===n.position?c<p?"Right":"Bottom":n.position;if("Float"===n.position)this.translate=n.location;else{switch(u){case"Top":case"Bottom":s.height=h-i,o=p/2-t/2,r="Top"===u?l:l+s.height+10,s.y="Top"===u?l+i+10:l;break;case"Left":case"Right":s.width=d-t,o="Left"===u?a:a+s.width,r=c/2-i/2,s.x="Left"===u?a+t:a}switch(n.alignment){case"Near":"Top"===u||"Bottom"===u?o=s.x:r=s.y;break;case"Far":"Top"===u||"Bottom"===u?o=p-t:r=c-i}this.treemap.totalRect=s,this.translate=new ms(o,r)}},n0.prototype.mouseUpHandler=function(e){this.renderInteractivePointer(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeInteractivePointer.bind(this),3e3)},n0.prototype.removeInteractivePointer=function(){var e;document.getElementById(this.treemap.element.id+"_Interactive_Legend")&&(e=document.getElementById(this.treemap.element.id+"_Interactive_Legend")).parentNode.removeChild(e)},n0.prototype.changeNextPage=function(e){this.currentPage=-1<e.target.id.indexOf("_Left_Page_")?this.currentPage-1:this.currentPage+1,0<=this.currentPage&&this.currentPage<this.totalPages.length?this.drawLegend():this.currentPage=-1<e.target.id.indexOf("_Left_Page_")?0:this.totalPages.length-1},n0.prototype.wireEvents=function(e){E.add(e,F.touchStartEvent,this.changeNextPage,this)},n0.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(F.touchMoveEvent,this.renderInteractivePointer,this),this.treemap.on(F.touchEndEvent,this.mouseUpHandler,this))},n0.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(F.touchMoveEvent,this.renderInteractivePointer),this.treemap.off(F.touchEndEvent,this.mouseUpHandler))},n0.prototype.getModuleName=function(){return"treeMapLegend"},n0.prototype.destroy=function(){clearTimeout(this.clearTimeout),this.clearTimeout=null,this.legendRenderingCollections=[],this.legendCollections=[],this.outOfRangeLegend=null,this.totalPages=[],this.translate=null,this.legendBorderRect=null,this.legendGroup=null,this.legendNames=[],this.defsElement=null,this.legendLinearGradient=null,this.legendInteractiveGradient=[],this.legendItemRect=null,this.removeEventListener(),this.treemap=null},n0.prototype.legendGradientColor=function(e,t){var i="http://www.w3.org/2000/svg";if(!je(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var n=this.treemap.renderer.createDefs(),o=document.createElementNS(i,"linearGradient"),r=this.treemap.legendSettings.position,s="Top"===r||"Bottom"===r?"100":"0",r="Top"===r||"Bottom"===r?"0":"100";o.setAttribute("id","linear_"+t),o.setAttribute("x1","0%"),o.setAttribute("y1","0%"),o.setAttribute("x2",s+"%"),o.setAttribute("y2",r+"%");for(var a=0;a<e.color.length;a++){var l=100/(e.color.length-1),h=document.createElementNS(i,"stop");h.setAttribute("offset",a*l+"%"),h.setAttribute("stop-color",e.color[a]),h.setAttribute("stop-opacity",1..toString()),o.appendChild(h)}n.appendChild(o),this.legendLinearGradient=o;s="url(#linear_"+t+")";this.defsElement.appendChild(o),r=s}return r},n0);function n0(e){this.page=0,this.legendBorderRect=new hs(0,0,0,0),this.currentPage=0,this.heightIncrement=0,this.widthIncrement=0,this.textMaxWidth=0,this.legendInteractiveGradient=[],this.legendItemRect=new hs(0,0,0,0),this.treemap=e,this.addEventListener()}r0.prototype.mouseMove=function(e){e=e.target;return this.highlightOnMouseMove(e)},r0.prototype.highlightOnMouseMove=function(e){var t,i=this.treemap,n=e.id,o=[],r=this.treemap.highlightSettings,s=[],a=this.treemap.treeMapSelectionModule,l=!1;if(a&&0<a.legendSelectionCollection.length)for(var h=0;h<a.legendSelectionCollection.length;h++)for(var d=0;d<a.legendSelectionCollection[h].ShapeCollection.Elements.length;d++){var p=parseFloat(a.legendSelectionCollection[h].ShapeCollection.Elements[d].id.split("Item_Index_")[1].split("_")[0]),c=-1<n.indexOf("_Item_Index_")?parseFloat(n.split("Item_Index_")[1].split("_")[0]):null;if(a.legendSelectionCollection[h].ShapeCollection.Elements[d].id===n||p===c){l=!0;break}}if(-1<n.indexOf("_Item_Index")&&!l){if(this.highLightId!==n||this.legendHighlightCollection[0]&&1<this.legendHighlightCollection[0].ShapeCollection.Elements.length){var u=document.getElementById(i.element.id+"_TreeMap_"+i.layoutType+"_Layout"),g=document.getElementsByClassName("treeMapSelection");w=this.treemap.layout.renderItems[parseFloat(n.split("_Item_Index_")[1])];this.treemap.legendSettings.visible&&(D=this.treemap.treeMapLegendModule.legendCollections,e=this.treemap.treeMapLegendModule.legendCollections.length,je(e=!i.legendSettings.removeDuplicateLegend&&i.palette&&0<i.palette.length&&0===i.leafItemSettings.colorMapping.length&&0===i.levels.length?parseFloat(n.split("_Item_Index_")[1]):pa(e,w,i))&&(la(this.legendHighlightCollection,i),la(this.shapeHighlightCollection,i),this.legendHighlightCollection=[],i.treeMapLegendModule.removeInteractivePointer()),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+e):document.getElementById(this.treemap.element.id+"_Legend_Index_"+e),null!==this.shapeElement)&&(a&&this.shapeElement.id===(a&&a.shapeElement?a.shapeElement.id:null)?0<this.currentElement.length&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(da(this.shapeHighlightCollection,this.currentElement,i),this.highLightId=""):(this.currentElement.push({currentElement:this.shapeElement}),la(this.shapeHighlightCollection,i),this.shapeHighlightCollection.push({legendEle:this.shapeElement,oldFill:D[e].legendFill,oldOpacity:D[e].opacity,oldBorderColor:D[e].borderColor,oldBorderWidth:D[e].borderWidth}),ha("Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+e):document.getElementById(this.treemap.element.id+"_Legend_Index_"+e+"_Text"),r.fill,r.opacity,null,null),ha(this.shapeElement,r.fill,r.opacity,r.border.color,r.border.width.toString()),this.target="highlight"));for(var m=xs(w,[],r.mode,i),h=0;h<u.childElementCount;h++){for(var f=u.childNodes[h],y=!0,v=""!==i.rangeColorValuePath?i.rangeColorValuePath:null,b=i.layout.renderItems[parseFloat(n.split("_Item_Index_")[1])],w=i.layout.renderItems[parseFloat(f.id.split("_Item_Index_")[1])],d=0;d<g.length;d++)if(f.id===g[d].id||f.id===g[d].parentElement.id){y=!1;break}-1<m.indexOf(w.levelOrderName)&&y&&(je(v)||w.data[v]===b.data[v]||"Item"!==r.mode&&0<i.levels.length)&&(s.push(f),o.push(w))}Ys(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i);for(var C=0;C<s.length;C++)Xs((f=s[C]).childNodes[0],{border:r.border,fill:r.fill,opacity:r.opacity}),f.classList.add("treeMapHighLight"),this.highLightId=n;i.trigger(dr,{cancel:!1,name:dr,treemap:i,items:o,elements:s})}}else if(-1<n.indexOf("_Legend_Shape")||-1<n.indexOf("_Legend_Index")||-1<n.indexOf("_Legend_Text_Index")){je(a)||(a.legendSelectId=je(i.legendId[0])?null:i.legendId[0]);var e=a&&a.legendSelectId?parseFloat(a.legendSelectId.split("Index_")[1]):a&&a.shapeSelectId?parseFloat(a.shapeSelectId.split("Index_")[1]):null,S="Default"===this.treemap.legendSettings.mode?-1===n.indexOf("Text")?parseFloat(n.split("_Legend_Shape_Index_")[1]):parseFloat(n.split("_Legend_Text_Index_")[1]):parseFloat(n.split("_Legend_Index_")[1]);if(this.treemap.legendSettings.visible&&S!==e){for(var A,x=void 0,I=void 0,v=""!==i.rangeColorValuePath?i.rangeColorValuePath:null,T=document.getElementById(n),E=("highlight"===this.shapeTarget&&(la(this.legendHighlightCollection,this.treemap),this.legendHighlightCollection=[]),this.shapeTarget="highlight",this.treemap.treeMapLegendModule.legendCollections[S].legendData.length),D=this.treemap.treeMapLegendModule.legendCollections,h=0;h<E;h++)for(var M,d=0;d<this.treemap.layout.renderItems.length;d++)(!je(v)&&0<i.leafItemSettings.colorMapping.length&&0===i.levels.length?i.treeMapLegendModule.legendCollections[S].legendData[h].data[v]===i.layout.renderItems[d].data[v]:i.treeMapLegendModule.legendCollections[S].legendData[h].levelOrderName===i.layout.renderItems[d].levelOrderName)&&(x=d,I=this.treemap.layout.renderItems[d].groupIndex,k=document.getElementById(this.treemap.element.id+"_Level_Index_"+I+"_Item_Index_"+x+"_RectPath"),M=void(0!==h&&0!==this.legendHighlightCollection.length||(this.legendHighlightCollection=[],ca(this.legendHighlightCollection,S,d,T,k,this.treemap.layout.renderItems,D),A=this.legendHighlightCollection.length,this.legendHighlightCollection[A-1].ShapeCollection={Elements:[]})),-1<T.id.indexOf("Text")?(M="Interactive"===this.treemap.legendSettings.mode?document.getElementById(T.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+S),ha(T,r.fill,r.opacity,null,null),ha(M,r.fill,r.opacity,r.border.color,r.border.width.toString())):(ha("Interactive"===this.treemap.legendSettings.mode?document.getElementById(T.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+S),r.fill,r.opacity,null,null),ha(T,r.fill,r.opacity,r.border.color,r.border.width.toString())),ha(k,r.fill,r.opacity,r.border.color,r.border.width.toString()),A=this.legendHighlightCollection.length,this.legendHighlightCollection[A-1].ShapeCollection.Elements.push(k));if(0===E&&this.treemap.palette&&0<this.treemap.palette.length)for(var k,P,d=0;d<this.treemap.layout.renderItems.length;d++)!(this.treemap.treeMapLegendModule.legendCollections[S].levelOrderName===this.treemap.layout.renderItems[d].levelOrderName||-1<this.treemap.layout.renderItems[d].levelOrderName.indexOf(this.treemap.treeMapLegendModule.legendCollections[S].levelOrderName))||!this.treemap.legendSettings.removeDuplicateLegend&&i.palette&&0<i.palette.length&&!this.treemap.layout.renderItems[d].parent.isDrilled&&S!==d||(x=d,I=this.treemap.layout.renderItems[d].groupIndex,k=document.getElementById(this.treemap.element.id+"_Level_Index_"+I+"_Item_Index_"+x+"_RectPath"),ca(this.legendHighlightCollection,S,d,T,k,this.treemap.layout.renderItems,D),A=this.legendHighlightCollection.length,P=void(this.legendHighlightCollection[A-1].ShapeCollection={Elements:[]}),-1<T.id.indexOf("Text")?(P="Interactive"===this.treemap.legendSettings.mode?document.getElementById(T.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+S),ha(T,r.fill,r.opacity,null,null),ha(P,r.fill,r.opacity,r.border.color,r.border.width.toString())):(ha(P="Interactive"===this.treemap.legendSettings.mode?document.getElementById(T.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+S),r.fill,r.opacity,null,null),ha(T,r.fill,r.opacity,r.border.color,r.border.width.toString())),ha(k,r.fill,r.opacity,r.border.color,r.border.width.toString()),A=this.legendHighlightCollection.length,this.legendHighlightCollection[A-1].ShapeCollection.Elements.push(k))}else Ys(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i),la(this.legendHighlightCollection,i),this.legendHighlightCollection=[]}else a&&this.shapeElement&&this.shapeElement.getAttribute("id")===a.legendSelectId||(a?this.shapeElement!==a.shapeElement:this.treemap.legendSettings.visible)&&Ys(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i),"highlight"!==this.shapeTarget&&"highlight"!==this.target||!this.treemap.legendSettings.visible||a&&this.shapeElement&&this.shapeElement.getAttribute("id")===a.legendSelectId||a&&this.shapeElement===a.shapeElement||(la(this.shapeHighlightCollection,i),this.shapeHighlightCollection=[]),"highlight"===this.shapeTarget&&this.treemap.legendSettings.visible&&la(this.legendHighlightCollection,this.treemap),this.highLightId="",t=!1;return t},r0.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(F.touchMoveEvent,this.mouseMove,this)},r0.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(F.touchMoveEvent,this.mouseMove)},r0.prototype.getModuleName=function(){return"treeMapHighlight"},r0.prototype.destroy=function(){this.shapeElement=null,this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.removeEventListener(),this.treemap=null};var o0=r0;function r0(e){this.target="highlight",this.shapeTarget="highlight",this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.treemap=e,this.addEventListener()}a0.prototype.mouseDown=function(e){var t=e.target;e.preventDefault(),this.selectionOnMouseDown(t)},a0.prototype.selectionOnMouseDown=function(t){var e=this.treemap,i=(t.setAttribute("tabindex","-1"),t.style.outline="none",t.id.includes("Legend_Shape_Index")||t.focus(),[]),n=t.id,o=t.innerHTML,r=[],s=e.selectionSettings,a=this.treemap.treeMapHighlightModule,l=e.element.id+"_TreeMap_"+e.layoutType+"_Layout",h=(f=e.layout.renderItems[parseFloat(n.split("_Item_Index_")[1])])&&!f.isLeafItem&&e.enableDrillDown&&(-1<t.textContent.indexOf("[+]")||-1<t.textContent.indexOf("[-]")||!je(t.nextElementSibling)&&(-1<t.nextSibling.textContent.indexOf("[+]")||-1<t.nextSibling.textContent.indexOf("[-]")));if(-1<n.indexOf("_Item_Index")&&!h)if(this.treemap.selectionId!==n&&(!e.selectionId||parseFloat(e.selectionId.split("_Item_Index_")[1])!==parseFloat(n.split("_Item_Index_")[1]))||this.legendSelectionCollection[0]&&1<this.legendSelectionCollection[0].ShapeCollection.Elements.length){e.levelSelection=[],e.legendId=[],this.shapeSelectId="",la(this.legendSelectionCollection,e),this.legendSelectionCollection=[];var d=document.getElementById(l),p=void 0;this.treemap.legendSettings.visible&&(this.shapeSelect=!1,l=this.treemap.treeMapLegendModule.legendCollections.length,C=this.treemap.treeMapLegendModule.legendCollections,this.shapeElement=void 0,la(this.shapeSelectionCollection,e),a&&(a.shapeTarget="selection",a.shapeHighlightCollection=[]),p=!e.legendSettings.removeDuplicateLegend&&e.palette&&0<e.palette.length&&0===e.leafItemSettings.colorMapping.length&&0===e.levels.length?parseFloat(n.split("_Item_Index_")[1]):pa(l,f,e),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+p):document.getElementById(this.treemap.element.id+"_Legend_Index_"+p),null!==this.shapeElement)&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:C[p].legendFill,oldOpacity:C[p].opacity,oldBorderColor:C[p].borderColor,oldBorderWidth:C[p].borderWidth}),ha(M="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+p):document.getElementById(this.treemap.element.id+"_Legend_Index_"+p+"_Text"),s.fill,s.opacity,null,null),ha(this.shapeElement,s.fill,s.opacity,s.border.color,s.border.width.toString()),e.legendId.push(this.shapeElement.id),e.legendId.push(M.id));for(var c=xs(f,[],s.mode,e),u=0;u<d.childElementCount;u++){var g=d.childNodes[u],m=e.layout.renderItems[parseFloat(n.split("_Item_Index_")[1])],f=e.layout.renderItems[parseFloat(g.id.split("_Item_Index_")[1])],y=""!==e.rangeColorValuePath?e.rangeColorValuePath:null;-1<c.indexOf(f.levelOrderName)&&(je(y)||f.data[y]===m.data[y]||"Item"!==s.mode&&0<e.levels.length)&&(r.push(g),-1<n.indexOf("_RectPath")&&e.levelSelection.push(g.id),i.push(f))}Ys(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",e),this.treemap.selectionId=n;for(var v=document.getElementsByClassName("treeMapHighLight"),b=0;b<r.length;b++){if(g=r[b],0<v.length)for(var w=0;w<v.length;w++)v[w].id===g.id&&v[w].classList.remove("treeMapHighLight"),Xs(g.childNodes[0],{border:s.border,fill:s.fill,opacity:s.opacity}),g.classList.add("treeMapSelection");else Xs(g.childNodes[0],{border:s.border,fill:s.fill,opacity:s.opacity}),g.classList.add("treeMapSelection");e.trigger(hr,{cancel:!1,name:hr,treemap:e,items:i,elements:r,text:o,contentItemTemplate:o},function(e){e.contentItemTemplate!==o&&bs(n,t,e.contentItemTemplate)})}}else la(this.legendSelectionCollection,e),la(this.shapeSelectionCollection,e),this.treemap.legendId=[],this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.shapeElement=void 0,this.shapeSelect=!0,this.shapeSelectId="",this.treemap.levelSelection=[],this.legendSelectId="",(this.legendSelect||this.shapeSelect)&&(Ys(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",e),this.treemap.selectionId="");else if(-1<n.indexOf("_Legend_Shape")||-1<n.indexOf("_Legend_Index")||-1<n.indexOf("_Legend_Text_")){var C=this.treemap.treeMapLegendModule.legendCollections,l=je(this.legendSelectId)?null:parseFloat(this.legendSelectId.split("_Index_")[1]);if(this.treemap.legendSettings.visible&&l!==parseFloat(n.split("_Index_")[1])){for(var S,A=void 0,x=void 0,I=(e.legendId=[],e.levelSelection=[],this.legendSelectId=n,this.legendSelect=!1,isNaN(parseInt(n[n.length-1],10))?parseInt(n[n.length-6],10):parseInt(n[n.length-1],10)),T=document.getElementById(n),y=(la(this.legendSelectionCollection,e),Ys(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",e),la(this.shapeSelectionCollection,e),this.legendSelectionCollection=[],a&&(a.shapeTarget="selection",a.legendHighlightCollection=[]),""!==e.rangeColorValuePath?e.rangeColorValuePath:null),p="Default"===this.treemap.legendSettings.mode?-1===n.indexOf("Text")?parseFloat(n.split("_Legend_Shape_Index_")[1]):parseFloat(n.split("_Legend_Text_Index_")[1]):parseFloat(n.split("_Legend_Index_")[1]),E=this.treemap.treeMapLegendModule.legendCollections[p].legendData.length,b=0;b<E;b++)for(var D,M,k=0;k<this.treemap.layout.renderItems.length;k++)(!je(y)&&0<e.leafItemSettings.colorMapping.length&&0===e.levels.length?e.treeMapLegendModule.legendCollections[p].legendData[b].data[y]===e.layout.renderItems[k].data[y]:this.treemap.treeMapLegendModule.legendCollections[p].legendData[b].levelOrderName===this.treemap.layout.renderItems[k].levelOrderName)&&(A=k,x=this.treemap.layout.renderItems[k].groupIndex,P=document.getElementById(this.treemap.element.id+"_Level_Index_"+x+"_Item_Index_"+A+"_RectPath"),this.treemap.selectionId=P.id,0!==b&&0!==this.legendSelectionCollection.length||(ca(this.legendSelectionCollection,I,k,T,P,this.treemap.layout.renderItems,C),S=this.legendSelectionCollection.length,this.legendSelectionCollection[S-1].ShapeCollection={Elements:[]}),D=void(this.treemap.selectionId=P.id),M=void 0,-1<T.id.indexOf("Text")?(ha(D="Interactive"===this.treemap.legendSettings.mode?document.getElementById(T.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+p),s.fill,s.opacity,s.border.color,s.border.width.toString()),ha(T,s.fill,s.opacity,null,null),this.legendSelectId=D.id,this.shapeElement=D,e.legendId.push(T.id),e.legendId.push(D.id)):(ha(M="Interactive"===this.treemap.legendSettings.mode?document.getElementById(T.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+p),s.fill,s.opacity,null,null),ha(T,s.fill,s.opacity,s.border.color,s.border.width.toString()),this.shapeElement=T,e.legendId.push(T.id),e.legendId.push(M.id)),ha(P,s.fill,s.opacity,s.border.color,s.border.width.toString()),S=this.legendSelectionCollection.length,e.levelSelection.push(P.id),this.legendSelectionCollection[S-1].ShapeCollection.Elements.push(P));if(0===E&&this.treemap.palette&&0<this.treemap.palette.length)for(var P,B,w=0;w<this.treemap.layout.renderItems.length;w++)!(this.treemap.treeMapLegendModule.legendCollections[p].levelOrderName===this.treemap.layout.renderItems[w].levelOrderName||-1<this.treemap.layout.renderItems[w].levelOrderName.indexOf(this.treemap.treeMapLegendModule.legendCollections[p].levelOrderName))||!this.treemap.legendSettings.removeDuplicateLegend&&e.palette&&0<e.palette.length&&!this.treemap.layout.renderItems[w].parent.isDrilled&&p!==w||(A=w,x=this.treemap.layout.renderItems[w].groupIndex,P=document.getElementById(this.treemap.element.id+"_Level_Index_"+x+"_Item_Index_"+A+"_RectPath"),ca(this.legendSelectionCollection,p,w,T,P,this.treemap.layout.renderItems,C),this.treemap.selectionId=P.id,S=this.legendSelectionCollection.length,B=void(this.legendSelectionCollection[S-1].ShapeCollection={Elements:[]}),-1<T.id.indexOf("Text")?(B="Interactive"===this.treemap.legendSettings.mode?document.getElementById(T.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+p),ha(T,s.fill,s.opacity,null,null),ha(B,s.fill,s.opacity,s.border.color,s.border.width.toString()),this.legendSelectId=B.id,this.shapeElement=B):(ha(B="Interactive"===this.treemap.legendSettings.mode?document.getElementById(T.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+p),s.fill,s.opacity,null,null),ha(T,s.fill,s.opacity,s.border.color,s.border.width.toString()),this.legendSelectId=n,this.shapeElement=T),ha(P,s.fill,s.opacity,s.border.color,s.border.width.toString()),e.levelSelection.push(P.id),-1===e.legendId.indexOf(B.id)&&e.legendId.push(B.id),-1===e.legendId.indexOf(T.id)&&e.legendId.push(T.id),S=this.legendSelectionCollection.length,this.legendSelectionCollection[S-1].ShapeCollection.Elements.push(P))}else la(this.legendSelectionCollection,this.treemap),la(this.shapeSelectionCollection,this.treemap),this.legendSelectionCollection=[],a&&(a.shapeTarget="highlight"),this.legendSelect=!0,this.legendSelectId="",this.treemap.legendId=[],this.treemap.levelSelection=[],this.shapeElement=null,this.shapeSelectId="",(this.legendSelect||this.shapeSelect)&&(Ys(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",e),this.treemap.selectionId="")}else h&&(la(this.legendSelectionCollection,this.treemap),this.legendSelectionCollection=[],this.legendSelect=!0,this.legendSelectId="",this.treemap.legendId=[],this.treemap.levelSelection=[],this.treemap.selectionId="",this.shapeElement=null)},a0.prototype.selectTreemapItem=function(e,t){if(t){for(var i=void 0,n=0;n<this.treemap.layout.renderItems.length;n++)if(e===this.treemap.layout.renderItems[n].levelOrderName){i=this.treemap.layout.renderItems[n];break}for(var o=this.treemap.selectionSettings,r=[],s=void 0,a=[],t=(this.treemap.levelSelection=[],this.treemap.element.id+"_TreeMap_"+this.treemap.layoutType+"_Layout"),l=document.getElementById(t),h=xs(i,[],o.mode,this.treemap),d=0;d<l.childElementCount;d++)s=l.childNodes[d],i=this.treemap.layout.renderItems[parseFloat(s.id.split("_Item_Index_")[1])],-1<h.indexOf(i.levelOrderName)&&(r.push(s),this.treemap.levelSelection.push(s.id),a.push(i));if(this.treemap.legendSettings.visible)for(var p=0;p<a.length;p++){this.shapeSelect=!1;var c=this.treemap.treeMapLegendModule.legendCollections.length,u=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,aa(this.shapeSelectionCollection),c=pa(c,a[p],this.treemap),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+c):document.getElementById(this.treemap.element.id+"_Legend_Index_"+c),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.treemap.legendId.push(this.shapeSelectId),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:u[c].legendFill,oldOpacity:u[c].opacity,oldBorderColor:u[c].borderColor,oldBorderWidth:u[c].borderWidth}),ha(this.shapeElement,o.fill,o.opacity,o.border.color,o.border.width.toString()))}Ys(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap);for(var t=document.getElementById(this.treemap.levelSelection[0]),g=(this.treemap.selectionId=t.childNodes[0].id,document.getElementsByClassName("treeMapHighLight")),m=0;m<r.length;m++)if(s=r[m],0<g.length)for(var f=0;f<g.length;f++)g[f].id===s.id&&g[f].classList.remove("treeMapHighLight"),Xs(s.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),s.classList.add("treeMapSelection");else o.fill=("null"===o.fill?this.treemap.layout.renderItems[parseInt(s.id.split("Item_Index_")[1],10)].options:o).fill,Xs(s.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),s.classList.add("treeMapSelection")}else aa(this.shapeSelectionCollection),this.shapeElement=void 0,this.treemap.levelSelection=[],this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],Ys(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap),this.treemap.selectionId=""},a0.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(F.touchStartEvent,this.mouseDown,this)},a0.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(F.touchStartEvent,this.mouseDown)},a0.prototype.getModuleName=function(){return"treeMapSelection"},a0.prototype.destroy=function(){this.shapeElement=null,this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.removeEventListener(),this.treemap=null};var s0=a0;function a0(e){this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.shapeSelect=!0,this.legendSelect=!0,this.treemap=e,this.addEventListener()}var l0=function(e,t){var i={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(i[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&(i[o[n]]=e[o[n]]);return i},h0=(d0.prototype.renderTooltip=function(e){var t,i,n,o,r,s,a=this,l=(t=(-1!==e.type.indexOf("touch")?(this.isTouch=!0,p=e.changedTouches[0].pageX,e.changedTouches[0]):(this.isTouch="touch"===e.pointerType,p=e.pageX,e)).pageY,e.target),h=l.id,d=[];if(-1<h.indexOf("_Item_Index")&&-1===e.type.indexOf("key")){if(!je(h=this.treemap.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])])){o=h.weight,r=h.data,je(h.options)||(s=h.options.fill),d=this.treemap.enableRtl?[(je(this.tooltipSettings.format)?null:Ks(this.tooltipSettings.format,r,this.treemap))||Js(o,this.treemap)+" : "+this.treemap.weightValuePath.toString()]:[(je(this.tooltipSettings.format)?null:Ks(this.tooltipSettings.format,r,this.treemap))||this.treemap.weightValuePath.toString()+" : "+Js(o,this.treemap)],document.getElementById(this.tooltipId)?n=document.getElementById(this.tooltipId):((n=Q("div",{id:this.treemap.element.id+"_TreeMapTooltip",className:"EJ2-TreeMap-Tooltip"})).style.cssText="position: absolute;pointer-events:none;",document.getElementById(this.treemap.element.id+"_Secondary_Element").appendChild(n)),(o=Fs(p,t,this.treemap.svgObject)).y=this.tooltipSettings.template?o.y+10:o.y,this.tooltipSettings.textStyle.size=this.tooltipSettings.textStyle.size||this.treemap.themeStyle.tooltipFontSize,this.tooltipSettings.textStyle.fontFamily=this.tooltipSettings.textStyle.fontFamily||this.treemap.themeStyle.fontFamily,this.tooltipSettings.textStyle.fontStyle=je(this.tooltipSettings.textStyle.fontStyle)?"Normal":this.tooltipSettings.textStyle.fontStyle,this.tooltipSettings.textStyle.fontWeight=this.tooltipSettings.textStyle.fontWeight||this.treemap.themeStyle.fontWeight,this.tooltipSettings.textStyle.color=this.tooltipSettings.textStyle.color||this.treemap.themeStyle.tooltipFontColor,this.tooltipSettings.textStyle.opacity=this.tooltipSettings.textStyle.opacity||this.treemap.themeStyle.tooltipTextOpacity;var p={width:this.tooltipSettings.border.width||this.treemap.themeStyle.tooltipBorderWidth||0,color:this.tooltipSettings.border.color||this.treemap.themeStyle.tooltipBorderColor||"transparent"};if(this.treemap.enableHtmlSanitizer)for(var c=0;c<d.length;c++)d[c]=go.sanitize(d[c]);i={cancel:!1,name:pr,item:h,options:{location:o,text:d,data:r,border:p,textStyle:this.tooltipSettings.textStyle,template:this.tooltipSettings.template},treemap:this.treemap,element:l,eventArgs:e},this.treemap.trigger(pr,i,function(e){a.addTooltip(i,s,n)})}}else this.removeTooltip(),this.treemap.clearTemplate()},d0.prototype.addTooltip=function(e,t,i,n){var o;n=je(e)?(o=n.cancel,n):(o=e.cancel,l0(e,["cancel"]).options),o?(this.removeTooltip(),this.treemap.clearTemplate()):(this.svgTooltip=new tr({theme:this.treemap.theme,enable:!0,header:"",data:n.data,template:n.template,content:n.text,shapes:[],location:n.location,palette:[t],areaBounds:this.treemap.areaRect,textStyle:n.textStyle,fill:this.treemap.tooltipSettings.fill||this.treemap.themeStyle.tooltipFillColor,border:n.border,enableShadow:!0}),(this.treemap.isVue||this.treemap.isVue3)&&(this.svgTooltip.controlInstance=this.treemap),this.svgTooltip.opacity=this.treemap.themeStyle.tooltipFillOpacity||this.svgTooltip.opacity,this.svgTooltip.appendTo(i),this.treemap.renderReactTemplates())},d0.prototype.mouseUpHandler=function(e){this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},d0.prototype.removeTooltip=function(){var e;0<document.getElementsByClassName("EJ2-TreeMap-Tooltip").length&&(e=document.getElementsByClassName("EJ2-TreeMap-Tooltip")[0]).parentNode.removeChild(e)},d0.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(F.touchMoveEvent,this.renderTooltip,this),this.treemap.on(F.touchEndEvent,this.mouseUpHandler,this))},d0.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(F.touchMoveEvent,this.renderTooltip),this.treemap.off(F.touchEndEvent,this.mouseUpHandler))},d0.prototype.getModuleName=function(){return"treeMapTooltip"},d0.prototype.destroy=function(){je(this.svgTooltip)||(this.svgTooltip.destroy(),this.svgTooltip.controlInstance=null,ga(this.treemap.element.id+"_TreeMapTooltip")),this.svgTooltip=null,this.tooltipSettings=null,this.removeEventListener(),this.treemap=null},d0);function d0(e){this.treemap=e,this.tooltipSettings=this.treemap.tooltipSettings,this.tooltipId=this.treemap.element.id+"_TreeMapTooltip",this.addEventListener()}$y.Inject(h0,i0,o0,s0,dl,Xy,cl);var p0,$y=Object.freeze({__proto__:null,TreeMap:$y,LevelsData:t0,Border:Sr,Margin:Ir,Font:Dr,CommonTitleSettings:Pr,SubTitleSettings:Lr,TitleSettings:Nr,ColorMapping:Hr,LegendSettings:Wr,InitialDrillSettings:qr,LeafItemSettings:Xr,TooltipSettings:Zr,SelectionSettings:ts,HighlightSettings:o,LevelSettings:tn,load:"load",loaded:"loaded",beforePrint:rr,itemRendering:sr,drillStart:ar,drillEnd:lr,itemSelected:hr,itemHighlight:dr,tooltipRendering:pr,itemClick:cr,itemMove:ur,click:gr,doubleClick:mr,rightClick:fr,mouseMove:yr,legendItemRendering:vr,legendRendering:br,resize:wr,defaultFont:Cr,get Theme(){return al},getThemeStyle:hl,Size:as,stringToNumber:ls,Rect:hs,RectOption:ds,PathOption:ps,measureText:cs,TextOption:us,textTrim:gs,Location:ms,findPosition:fs,createTextStyle:ys,renderTextElement:vs,setItemTemplateContent:bs,getElement:ws,itemsToOrder:Cs,isContainsData:Ss,findChildren:As,findHightLightItems:xs,getTemplateFunction:Is,convertElement:Ts,findLabelLocation:Es,measureElement:Ds,getArea:Ms,getShortestEdge:ks,convertToContainer:Ps,convertToRect:Bs,getMousePosition:Fs,colorMap:Ls,deSaturationColor:Rs,colorCollections:Os,rgbToHex:Ns,getColorByValue:Vs,getGradientColor:_s,getPercentageColor:Hs,getPercentage:zs,wordWrap:js,textWrap:Ws,hide:Qs,orderByArea:Us,maintainSelection:qs,legendMaintain:Gs,removeClassNames:Ys,applyOptions:Xs,textFormatter:Ks,formatValue:Js,ColorValue:Zs,convertToHexCode:$s,componentToHex:ea,convertHexToColor:ta,colorNameToHex:ia,drawSymbol:na,renderLegendShape:oa,isParentItem:ra,TreeMapAjax:sa,removeShape:aa,removeLegend:la,setColor:ha,removeSelectionWithHighlight:da,getLegendIndex:pa,pushCollection:ca,triggerDownload:ua,removeElement:ga,TreeMapLegend:i0,LayoutPanel:ma,TreeMapHighlight:o0,TreeMapSelection:s0,TreeMapTooltip:h0,ImageExport:cl,PdfExport:Xy,Print:dl}),Sr=(p0=function(e,t){return(p0=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])}))(e,t)},function(e,t){function i(){this.constructor=e}p0(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Ir=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},c0=(u0.prototype.setProperties=function(e){for(var t=Object.keys(e),i=0;i<t.length;i++)this[t[parseInt(i.toString(),10)]]=e[t[parseInt(i.toString(),10)]],this.parent&&this.parent.isReact&&"template"===t[parseInt(i.toString(),10)]&&this.parent.clipboardModule.treeGridParent.renderModule.refreshReactColumnTemplateByUid(this.uid)},u0);function u0(e){this.allowEditing=!0,this.edit={},this.disableHtmlEncode=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.allowFiltering=!0,this.allowSorting=!0,this.allowResizing=!0,this.filter={},I(this,e)}Sr(m0,g0=c0),Ir([e(null)],m0.prototype,"columns",void 0);var g0,Dr=m0;function m0(){return null!==g0&&g0.apply(this,arguments)||this}Sr(y0,f0=Dr);var f0,Pr=y0;function y0(){return null!==f0&&f0.apply(this,arguments)||this}b0.prototype.getFormatFunction=function(e){return je(e)||"dateTime"!==e.type&&"datetime"!==e.type&&"date"!==e.type&&"time"!==e.type?this.intl.getNumberFormat(e):this.intl.getDateFormat(e)},b0.prototype.getParserFunction=function(e){return e.type?this.intl.getDateParser(e):this.intl.getNumberParser(e)},b0.prototype.fromView=function(e,t,i){return"date"!==i&&"datetime"!==i&&"number"!==i||je(t)?e:t(e)},b0.prototype.toView=function(e,t){return je(t)||je(e)?e:t(e)},b0.prototype.setCulture=function(e){je(e)||Di(e)};var v0=b0;function b0(e){this.intl=new Ti,je(e)||(this.intl.culture=e)}w0=function(e,t){return(w0=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])}))(e,t)};var w0,Lr=function(e,t){function i(){this.constructor=e}w0(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Nr=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},C0=(S0.prototype.getSortDirection=function(){return this.sortDirection},S0.prototype.setSortDirection=function(e){this.sortDirection=e},S0.prototype.getFreezeTableName=function(){return this.freezeTable},S0.prototype.setProperties=function(n){for(var o=Object.keys(n),e=function(e){if("columns"===o[parseInt(e.toString(),10)])for(var i=n[o[parseInt(e.toString(),10)]],t=0;t<i.length;t++)!function(t){r.columns.find(function(e){return e.field===i[parseInt(t.toString(),10)].field}).setProperties(i[parseInt(t.toString(),10)])}(t);else r[o[parseInt(e.toString(),10)]]=n[o[parseInt(e.toString(),10)]];r.parent&&r.parent.isReact&&("template"===o[parseInt(e.toString(),10)]?(r.templateFn=HP(n[o[parseInt(e.toString(),10)]]),r.parent.refreshReactColumnTemplateByUid(r.uid,!0)):"headerTemplate"===o[parseInt(e.toString(),10)]?(r.headerTemplateFn=HP(n[o[parseInt(e.toString(),10)]]),r.parent.refreshReactHeaderTemplateByUid(r.uid)):"editTemplate"===o[parseInt(e.toString(),10)]?r.editTemplateFn=HP(n[o[parseInt(e.toString(),10)]]):"filterTemplate"===o[parseInt(e.toString(),10)]?r.filterTemplateFn=HP(n[o[parseInt(e.toString(),10)]]):"commandsTemplate"===o[parseInt(e.toString(),10)]&&(r.templateFn=HP(n[o[parseInt(e.toString(),10)]])))},r=this,t=0;t<o.length;t++)e(t)},S0.prototype.isForeignColumn=function(){return!(!this.dataSource||!this.foreignKeyValue)},S0.prototype.getFormatter=function(){return this.formatFn},S0.prototype.setFormatter=function(e){this.formatFn=e},S0.prototype.getParser=function(){return this.parserFn},S0.prototype.setParser=function(e){this.parserFn=e},S0.prototype.getColumnTemplate=function(){return this.templateFn},S0.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},S0.prototype.getFilterItemTemplate=function(){return this.fltrTemplateFn},S0.prototype.getDomSetter=function(){return this.disableHtmlEncode?"textContent":"innerHTML"},S0);function S0(e,t){var r,s=this,t=(this.disableHtmlEncode=!0,this.allowSorting=!0,this.allowResizing=!0,this.allowFiltering=!0,this.allowGrouping=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.enableGroupByFormat=!1,this.allowEditing=!0,this.filter={},this.showInColumnChooser=!0,this.edit={},this.allowSearching=!0,this.autoFit=!1,this.sortDirection="Descending",this.getEditTemplate=function(){return s.editTemplateFn},this.getFilterTemplate=function(){return s.filterTemplateFn},this.templateOptions={enableAriaLabel:!0},I(this,e),this.parent=t,"none"===this.type?this.type=null:this.type&&(this.type="string"==typeof this.type?this.type.toLowerCase():void 0),this.editType&&(this.editType=this.editType.toLowerCase()),je(this.uid)&&(this.uid=$P("grid-column")),new v0);e.format&&(e.format.skeleton||e.format.format&&"string"==typeof e.format.format)&&(this.setFormatter(t.getFormatFunction(Pe({},e.format))),this.setParser(t.getParserFunction(e.format))),this.toJSON=function(){for(var e={},t=["filter","dataSource","headerText","template","headerTemplate","edit","editTemplate","filterTemplate","commandsTemplate","parent"],i=Object.keys(s),n=0;n<i.length;n++)if("columns"===i[parseInt(n.toString(),10)]){e[i[parseInt(n.toString(),10)]]=[];for(var o=0;o<s[i[parseInt(n.toString(),10)]].length;o++)e[i[parseInt(n.toString(),10)]].push(s[i[parseInt(n.toString(),10)]][parseInt(o.toString(),10)].toJSON())}else t.indexOf(i[parseInt(n.toString(),10)])<0&&(e[i[parseInt(n.toString(),10)]]=s[i[parseInt(n.toString(),10)]]);return e},this.field||(this.allowFiltering=!1,this.allowGrouping=!1,this.allowSorting=!1,this.columns&&(this.allowResizing=this.columns.some(function(e){return e.allowResizing}))),this.commands&&!this.textAlign&&(this.textAlign="Right"),(this.template||this.commandsTemplate)&&(this.templateFn=HP(this.template||this.commandsTemplate)),this.headerTemplate&&(this.headerTemplateFn=HP(this.headerTemplate)),!je(this.filter)&&this.filter.itemTemplate&&(this.fltrTemplateFn=HP(this.filter.itemTemplate)),this.editTemplate&&(this.editTemplateFn=HP(this.editTemplate)),this.filterTemplate&&(this.filterTemplateFn=HP(this.filterTemplate)),this.isForeignColumn()&&(je(this.editType)||"dropdownedit"===this.editType||"defaultedit"===this.editType)&&(this.editType="dropdownedit",this.edit.params&&this.edit.params.dataSource&&(this.edit.params.ddEditedData=!0),this.edit.params=Pe({dataSource:this.dataSource,query:new ya,fields:{value:this.foreignKeyField||this.field,text:this.foreignKeyValue}},this.edit.params)),this.sortComparer&&(r=this.sortComparer,this.sortComparer=function(e,t,i,n){var o;return"string"==typeof r&&(r=FB(r,window)),"Descending"===s.sortDirection&&(o=e,e=t,t=o,o=i,i=n,n=o),r(e,t,i,n)}),!this.sortComparer&&this.isForeignColumn()&&(this.sortComparer=function(e,t){return e=FB(s.foreignKeyValue,DB(s,{},e)[0]),t=FB(s.foreignKeyValue,DB(s,{},t)[0]),"Descending"===s.sortDirection?Sa.fnDescending(e,t):Sa.fnAscending(e,t)})}Nr([e()],A0.prototype,"title",void 0),Nr([e()],A0.prototype,"type",void 0),Nr([e()],A0.prototype,"buttonOption",void 0);Hr=A0;function A0(){}Lr(I0,x0=C0),Nr([e(null)],I0.prototype,"columns",void 0);var x0,Wr=I0;function I0(){return null!==x0&&x0.apply(this,arguments)||this}Lr(P0,T0=Wr);var T0,E0,D0,M0,k0,qr=P0;function P0(){return null!==T0&&T0.apply(this,arguments)||this}var B0,F0,L0=!1;function R0(e,t){var i=!1,n={left:0,top:0},o=e;if(e&&t){for(je(t.offsetParent)&&"fixed"===t.style.position&&(i=!0);(t.offsetParent||i)&&e&&t.offsetParent!==e;)n.left+=e.offsetLeft,n.top+=e.offsetTop,e=e.offsetParent;for(e=o;(t.offsetParent||i)&&e&&t.offsetParent!==e;)n.left-=e.scrollLeft,n.top-=e.scrollTop,e=e.parentElement}return n}function O0(e,t,i,n,o){if(D0=void 0,D0=o,L0=!!n,!e)return{left:0,top:0};i=i||"top",k0=e.ownerDocument,M0=e;var o=(t=t||"left").toLowerCase(),n=i.toLowerCase(),r={left:0,top:0};switch(E0=M0.getBoundingClientRect(),n+o){case"topcenter":N0(q0(),r),V0(W0(),r);break;case"topright":N0(U0(),r),V0(W0(),r);break;case"centercenter":N0(q0(),r),V0(j0(),r);break;case"centerright":N0(U0(),r),V0(j0(),r);break;case"centerleft":N0(Q0(),r),V0(j0(),r);break;case"bottomcenter":N0(q0(),r),V0(z0(),r);break;case"bottomright":N0(U0(),r),V0(z0(),r);break;case"bottomleft":N0(Q0(),r),V0(z0(),r);break;default:N0(Q0(),r),V0(W0(),r)}return M0=null,r}function N0(e,t){t.left=e}function V0(e,t){t.top=e}function _0(){return k0.documentElement.scrollTop||k0.body.scrollTop}function H0(){return k0.documentElement.scrollLeft||k0.body.scrollLeft}function z0(){return L0?E0.bottom:E0.bottom+_0()}function j0(){return W0()+E0.height/2}function W0(){return L0?E0.top:E0.top+_0()}function Q0(){return E0.left+H0()}function U0(){var e=M0&&((M0.classList.contains("e-date-wrapper")||M0.classList.contains("e-datetime-wrapper"))&&M0.classList.contains("e-rtl")||M0.classList.contains("e-ddl")&&M0.classList.contains("e-rtl")||M0.classList.contains("e-date-range-wrapper"))?D0?D0.width:0:D0&&E0.width>=D0.width?D0.width:0;return M0&&M0.classList.contains("e-rtl")&&M0.classList.contains("e-multiselect")&&(e=D0.width),E0.right+H0()-e}function q0(){return Q0()+E0.width/2}function G0(e,t,i,n){var o,r,s,a;return void 0===t&&(t=null),(i=void 0===i?{X:!1,Y:!1}:i).Y||i.X?(o=e.getBoundingClientRect(),F0=t,B0=e.ownerDocument,n=n||O0(e,"left","top"),i.X&&(t=(F0?tv:cv)(),e=sv(),r=av(),s=e-n.left,a=n.left+o.width-r,o.width>t?n.left=0<s&&a<=0||!(0<a&&s<=0)&&a<s?r-o.width:e:0<s?n.left+=s:0<a&&(n.left-=a)),i.Y&&(t=(F0?iv:pv)(),r=rv(),e=lv(),s=r-n.top,a=n.top+o.height-e,o.height>t?n.top=0<s&&a<=0||!(0<a&&s<=0)&&a<s?e-o.height:r:0<s?n.top+=s:0<a&&(n.top-=a)),n):{left:0,top:0}}function Y0(e,t,i,n){void 0===t&&(t=null);var o=O0(e,"left","top"),i=(i&&(o.left=i),n&&(o.top=n),[]),n=(F0=t,B0=e.ownerDocument,e.getBoundingClientRect()),t=o.top,e=o.left,r=o.left+n.width,t=ev(t,o.top+n.height),o=$0(e,r);return t.topSide&&i.push("top"),o.rightSide&&i.push("right"),o.leftSide&&i.push("left"),t.bottomSide&&i.push("bottom"),i}function X0(e,t,i,n,o,r,s,a,l){var h,d,p,c;void 0===s&&(s=null),void 0===a&&(a={X:!0,Y:!0}),t&&e&&o&&r&&(a.X||a.Y)&&(h={TL:null,TR:null,BL:null,BR:null},c={TL:null,TR:null,BL:null,BR:null},"none"===window.getComputedStyle(e).display?(p=e.style.visibility,e.style.visibility="hidden",e.style.display="block",d=e.getBoundingClientRect(),e.style.removeProperty("display"),e.style.visibility=p):d=e.getBoundingClientRect(),F0=s,B0=t.ownerDocument,p=h,s=d,(o={posX:o,posY:r,offsetX:i,offsetY:n,position:{left:0,top:0}}).position=O0(r=t,o.posX,o.posY,i=l,s),p.TL=O0(r,"left","top",i,s),p.TR=O0(r,"right","top",i,s),p.BR=O0(r,"left","bottom",i,s),p.BL=O0(r,"right","bottom",i,s),Z0(c,o,d),a.X&&function e(t,i,n,o,r,s){var a=$0(i.TL.left,i.TR.left);n.TL.left-dv()<=sv()&&(a.leftSide=!1);n.TR.left>av()&&(a.rightSide=!1);(a.leftSide&&!a.rightSide||!a.leftSide&&a.rightSide)&&("right"===o.posX?o.posX="left":o.posX="right",o.offsetX=o.offsetX+r.width,o.offsetX=-1*o.offsetX,o.position=O0(t,o.posX,o.posY,!1),Z0(i,o,r),s)&&e(t,i,n,o,r,!1)}(t,c,h,o,d,!0),a.Y&&-1<h.TL.top&&function e(t,i,n,o,r,s){var a=ev(i.TL.top,i.BL.top);n.TL.top-hv()<=rv()&&(a.topSide=!1);n.BL.top>=lv()&&t.getBoundingClientRect().bottom<window.innerHeight&&(a.bottomSide=!1);(a.topSide&&!a.bottomSide||!a.topSide&&a.bottomSide)&&("top"===o.posY?o.posY="bottom":o.posY="top",o.offsetY=o.offsetY+r.height,o.offsetY=-1*o.offsetY,o.position=O0(t,o.posX,o.posY,!1,r),Z0(i,o,r),s)&&e(t,i,n,o,r,!1)}(t,c,h,o,d,!0),n=o,l=d,i=r=0,null==(s=e).offsetParent||"absolute"!==getComputedStyle(s.offsetParent).position&&"relative"!==getComputedStyle(s.offsetParent).position||(l=O0(s.offsetParent,"left","top",!1,l),r=l.left,i=l.top),a=l=1,(t=J0(s))&&("none"!==(c=getComputedStyle(t).transform)&&(c=new DOMMatrix(c),l=c.a,a=c.d),"none"!==getComputedStyle(t).zoom)&&(c=K0(document.body),l*=c,a*=c),s.style.top=n.position.top/a+n.offsetY-i/a+"px",s.style.left=n.position.left/l+n.offsetX-r/l+"px")}function K0(e){e=getComputedStyle(e).zoom;return parseFloat(e)||1}function J0(e){for(;e;){var t=window.getComputedStyle(e).transform,i=K0(document.body);if(t&&"none"!==t||i&&1!==i)return e;if(e===document.body)return null;e=e.offsetParent||e.parentElement}return null}function Z0(e,t,i){e.TL={top:t.position.top+t.offsetY,left:t.position.left+t.offsetX},e.TR={top:e.TL.top,left:e.TL.left+i.width},e.BL={top:e.TL.top+i.height,left:e.TL.left},e.BR={top:e.TL.top+i.height,left:e.TL.left+i.width}}function $0(e,t){var i=!1,n=!1;return{leftSide:i=e-dv()<sv()?!0:i,rightSide:n=t>av()?!0:n}}function ev(e,t){var i=!1,n=!1;return{topSide:i=e-hv()<rv()?!0:i,bottomSide:n=t>lv()?!0:n}}function tv(){return F0.getBoundingClientRect().width}function iv(){return F0.getBoundingClientRect().height}function nv(){return F0.getBoundingClientRect().left}function ov(){return F0.getBoundingClientRect().top}function rv(){return F0?ov():0}function sv(){return F0?nv():0}function av(){return F0?dv()+nv()+tv():dv()+cv()}function lv(){return F0?hv()+ov()+iv():hv()+pv()}function hv(){return B0.documentElement.scrollTop||B0.body.scrollTop}function dv(){return B0.documentElement.scrollLeft||B0.body.scrollLeft}function pv(){return window.innerHeight}function cv(){var e=window.innerWidth,t=document.documentElement.getBoundingClientRect();return e-(e-(je(document.documentElement)?0:t.width))}function uv(){B0=F0=null}gv=function(e,t){return(gv=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])}))(e,t)};var gv,mv,Xr=function(e,t){function i(){this.constructor=e}gv(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Zr=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},ts=(Xr(fv,mv=n),Zr([e("left")],fv.prototype,"X",void 0),Zr([e("top")],fv.prototype,"Y",void 0),fv);function fv(){return null!==mv&&mv.apply(this,arguments)||this}var yv,vv="e-popup",bv="e-rtl",wv="e-popup-open",Cv="e-popup-close",Sv=(Xr(Av,yv=Ji),Av.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"width":gt(this.element,{width:T(e.width)});break;case"height":gt(this.element,{height:T(e.height)});break;case"zIndex":gt(this.element,{zIndex:e.zIndex});break;case"enableRtl":this.setEnableRtl();break;case"position":case"relateTo":this.refreshPosition();break;case"offsetX":var o=e.offsetX-t.offsetX;this.element.style.left=(parseInt(this.element.style.left,10)+o).toString()+"px";break;case"offsetY":o=e.offsetY-t.offsetY;this.element.style.top=(parseInt(this.element.style.top,10)+o).toString()+"px";break;case"content":this.setContent();break;case"actionOnScroll":"none"!==e.actionOnScroll?this.wireScrollEvents():this.unwireScrollEvents()}},Av.prototype.getModuleName=function(){return"popup"},Av.prototype.resolveCollision=function(){this.checkCollision()},Av.prototype.getPersistData=function(){return this.addOnPersist([])},Av.prototype.destroy=function(){this.element.classList.contains("e-popup-open")&&this.unwireEvents(),this.element.classList.remove(vv,bv,wv,Cv),this.content=null,this.relateTo=null,uv(),yv.prototype.destroy.call(this)},Av.prototype.render=function(){this.element.classList.add(vv);var e={};1e3!==this.zIndex&&(e.zIndex=this.zIndex),"auto"!==this.width&&(e.width=T(this.width)),"auto"!==this.height&&(e.height=T(this.height)),gt(this.element,e),this.fixedParent=!1,this.setEnableRtl(),this.setContent()},Av.prototype.wireEvents=function(){F.isDevice&&E.add(window,"orientationchange",this.orientationOnChange,this),"none"!==this.actionOnScroll&&this.wireScrollEvents()},Av.prototype.wireScrollEvents=function(){if(this.getRelateToElement())for(var e=0,t=this.getScrollableParent(this.getRelateToElement());e<t.length;e++){var i=t[e];E.add(i,"scroll",this.scrollRefresh,this)}},Av.prototype.unwireEvents=function(){F.isDevice&&E.remove(window,"orientationchange",this.orientationOnChange),"none"!==this.actionOnScroll&&this.unwireScrollEvents()},Av.prototype.unwireScrollEvents=function(){if(this.getRelateToElement())for(var e=0,t=this.getScrollableParent(this.getRelateToElement());e<t.length;e++){var i=t[e];E.remove(i,"scroll",this.scrollRefresh)}},Av.prototype.getRelateToElement=function(){var e=""===this.relateTo||je(this.relateTo)?document.body:this.relateTo;return this.setProperties({relateTo:e},!0),"string"==typeof this.relateTo?document.querySelector(this.relateTo):this.relateTo},Av.prototype.scrollRefresh=function(e){"reposition"===this.actionOnScroll?je(this.element)||this.element.offsetParent===e.target||this.element.offsetParent&&"BODY"===this.element.offsetParent.tagName&&null==e.target.parentElement||this.refreshPosition():"hide"===this.actionOnScroll&&this.hide(),"none"!==this.actionOnScroll&&this.getRelateToElement()&&((e=this.isElementOnViewport(this.getRelateToElement(),e.target))||this.targetInvisibleStatus?e&&(this.targetInvisibleStatus=!1):(this.trigger("targetExitViewport"),this.targetInvisibleStatus=!0))},Av.prototype.isElementOnViewport=function(e,t){for(var i=this.getScrollableParent(e),n=0;n<i.length;n++)if(!this.isElementVisible(e,i[n]))return!1;return!0},Av.prototype.isElementVisible=function(e,t){var i,n,o,r,s,a,l,h=this.checkGetBoundingClientRect(e);return!(!h.height||!h.width)&&(je(this.checkGetBoundingClientRect(t))?(i=(l=window).scrollY,n=l.scrollX,o=l.scrollX+l.outerWidth,l=l.scrollY+l.outerHeight,r=(e=O0(e)).top,s=e.left,a=e.left+h.width,e=e.top+h.height,0<l-r&&0<o-s&&0<a-n&&0<e-i):(l=t.getBoundingClientRect(),!(h.bottom<l.top||h.bottom>l.bottom||h.right>l.right||h.left<l.left)))},Av.prototype.preRender=function(){},Av.prototype.setEnableRtl=function(){this.reposition(),this.enableRtl?this.element.classList.add(bv):this.element.classList.remove(bv)},Av.prototype.setContent=function(){var e,t;je(this.content)||(this.element.innerHTML="","string"==typeof this.content?this.element.textContent=this.content:(e=this.getRelateToElement(),t=this.content.props,e.classList.contains("e-dropdown-btn")&&!je(t)||this.element.appendChild(this.content)))},Av.prototype.orientationOnChange=function(){var e=this;setTimeout(function(){e.refreshPosition()},200)},Av.prototype.refreshPosition=function(e,t){je(e)||this.checkFixedParent(e),this.reposition(),t||this.checkCollision()},Av.prototype.reposition=function(){var e,t,i,n,o=this.getRelateToElement();"number"==typeof this.position.X&&"number"==typeof this.position.Y?e={left:this.position.X,top:this.position.Y}:"string"==typeof this.position.X&&"number"==typeof this.position.Y||"number"==typeof this.position.X&&"string"==typeof this.position.Y?(t=void 0,n=this.element.style.display,this.element.style.display="block",this.element.classList.contains("e-dlg-modal")&&(t=this.element.parentElement.style.display,this.element.parentElement.style.display="block"),i=this.getAnchorPosition(o,this.element,this.position,this.offsetX,this.offsetY),e="string"==typeof this.position.X?{left:i.left,top:this.position.Y}:{left:this.position.X,top:i.top},this.element.style.display=n,this.element.classList.contains("e-dlg-modal")&&(this.element.parentElement.style.display=t)):o?(i=this.element.clientHeight,n=this.element.style.display,this.element.style.display="block",e=this.getAnchorPosition(o,this.element,this.position,this.offsetX,this.offsetY,i),this.element.style.display=n):e={left:0,top:0},je(e)||(this.element.style.left=e.left+"px",this.element.style.top=e.top+"px")},Av.prototype.checkGetBoundingClientRect=function(e){try{return e.getBoundingClientRect()}catch(e){return null}},Av.prototype.getAnchorPosition=function(e,t,i,n,o,r){void 0===r&&(r=0);var s=this.checkGetBoundingClientRect(t),a=this.checkGetBoundingClientRect(e);if(je(s)||je(a))return null;var l,h,d,p=e,c={left:0,top:0},c=t.offsetParent&&"BODY"===t.offsetParent.tagName&&"BODY"===e.tagName?O0(e):R0(p,t=t.classList.contains("e-dlg-modal")&&"BODY"!==p.tagName?t.parentElement:t);switch(i.X){default:case"left":break;case"center":t.classList.contains("e-dlg-modal")&&"BODY"===p.tagName&&"container"===this.targetType?c.left+=window.innerWidth/2-s.width/2:"container"===this.targetType?c.left+=a.width/2-s.width/2:c.left+=a.width/2;break;case"right":t.classList.contains("e-dlg-modal")&&"BODY"===p.tagName&&"container"===this.targetType?c.left+=window.innerWidth-s.width:"container"===this.targetType?(d=1,(l=J0(t))&&("none"!==(h=getComputedStyle(l).transform)&&(d=new DOMMatrix(h).a),"none"!==getComputedStyle(l).zoom)&&(d*=K0(document.body)),c.left+=(a.width-s.width)/d):c.left+=a.width}switch(i.Y){default:case"top":break;case"center":t.classList.contains("e-dlg-modal")&&"BODY"===p.tagName&&"container"===this.targetType?c.top+=window.innerHeight/2-s.height/2:"container"===this.targetType?c.top+=a.height/2-s.height/2:c.top+=a.height/2;break;case"bottom":t.classList.contains("e-dlg-modal")&&"BODY"===p.tagName&&"container"===this.targetType?c.top+=window.innerHeight-s.height:"container"!==this.targetType||t.classList.contains("e-dialog")?"container"===this.targetType&&t.classList.contains("e-dialog")?c.top+=a.height-r:c.top+=a.height:c.top+=a.height-s.height}return c.left+=n,c.top+=o,c},Av.prototype.callFlip=function(e){var t=this.getRelateToElement();X0(this.element,t,this.offsetX,this.offsetY,this.position.X,this.position.Y,this.viewPortElement,e,this.fixedParent)},Av.prototype.callFit=function(e){if(0!==Y0(this.element,this.viewPortElement).length)if(je(this.viewPortElement)){var t=G0(this.element,this.viewPortElement,e);e.X&&(this.element.style.left=t.left+"px"),e.Y&&(this.element.style.top=t.top+"px")}else{var t=this.checkGetBoundingClientRect(this.element),i=this.checkGetBoundingClientRect(this.viewPortElement);if(je(t)||je(i))return null;e&&!0===e.Y&&(i.top>t.top?this.element.style.top="0px":i.bottom<t.bottom&&(this.element.style.top=parseInt(this.element.style.top,10)-(t.bottom-i.bottom)+"px")),e&&!0===e.X&&(i.right<t.right?this.element.style.left=parseInt(this.element.style.left,10)-(t.right-i.right)+"px":i.left>t.left&&(this.element.style.left=parseInt(this.element.style.left,10)+(i.left-t.left)+"px"))}},Av.prototype.checkCollision=function(){var e=this.collision.X,t=this.collision.Y;"none"===e&&"none"===t||("flip"===e&&"flip"===t?this.callFlip({X:!0,Y:!0}):"fit"===e&&"fit"===t?this.callFit({X:!0,Y:!0}):("flip"===e?this.callFlip({X:!0,Y:!1}):"flip"===t&&this.callFlip({Y:!0,X:!1}),"fit"===e?this.callFit({X:!0,Y:!1}):"fit"===t&&this.callFit({X:!1,Y:!0})))},Av.prototype.show=function(e,t){var i=this;this.wireEvents(),1e3!==this.zIndex&&je(t)||(t=je(t)?this.element:t,this.zIndex=Iv(t),gt(this.element,{zIndex:this.zIndex})),e=je(e)||"object"!=typeof e?this.showAnimation:e,"none"===this.collision.X&&"none"===this.collision.Y||(q([this.element],Cv),U([this.element],wv),this.checkCollision(),q([this.element],wv),U([this.element],Cv)),je(e)?(q([this.element],Cv),U([this.element],wv),this.trigger("open")):(e.begin=function(){i.isDestroyed||(q([i.element],Cv),U([i.element],wv))},e.end=function(){i.isDestroyed||i.trigger("open")},new Vt(e).animate(this.element))},Av.prototype.hide=function(e){var t=this;e=je(e)||"object"!=typeof e?this.hideAnimation:e,je(e)?(q([this.element],wv),U([this.element],Cv),this.trigger("close")):(e.end=function(){t.isDestroyed||(q([t.element],wv),U([t.element],Cv),t.trigger("close"))},new Vt(e).animate(this.element)),this.unwireEvents()},Av.prototype.getScrollableParent=function(e){return this.checkFixedParent(e),xv(e,this.fixedParent)},Av.prototype.checkFixedParent=function(e){for(var t=e.parentElement;t&&"HTML"!==t.tagName;){var i=getComputedStyle(t);"fixed"!==i.position&&"sticky"!==i.position||je(this.element)||!this.element.offsetParent||"BODY"!==this.element.offsetParent.tagName||"hidden"===getComputedStyle(this.element.offsetParent).overflow||(this.element.style.top=window.scrollY>parseInt(this.element.style.top,10)?T(window.scrollY-parseInt(this.element.style.top,10)):T(parseInt(this.element.style.top,10)-window.scrollY),this.element.style.position="fixed",this.fixedParent=!0),t=t.parentElement,!je(this.element)&&je(this.element.offsetParent)&&"fixed"===i.position&&"fixed"===this.element.style.position&&(this.fixedParent=!0)}},Zr([e("auto")],Av.prototype,"height",void 0),Zr([e("auto")],Av.prototype,"width",void 0),Zr([e(null)],Av.prototype,"content",void 0),Zr([e("container")],Av.prototype,"targetType",void 0),Zr([e(null)],Av.prototype,"viewPortElement",void 0),Zr([e({X:"none",Y:"none"})],Av.prototype,"collision",void 0),Zr([e("")],Av.prototype,"relateTo",void 0),Zr([t({},ts)],Av.prototype,"position",void 0),Zr([e(0)],Av.prototype,"offsetX",void 0),Zr([e(0)],Av.prototype,"offsetY",void 0),Zr([e(1e3)],Av.prototype,"zIndex",void 0),Zr([e(!1)],Av.prototype,"enableRtl",void 0),Zr([e("reposition")],Av.prototype,"actionOnScroll",void 0),Zr([e(null)],Av.prototype,"showAnimation",void 0),Zr([e(null)],Av.prototype,"hideAnimation",void 0),Zr([i()],Av.prototype,"open",void 0),Zr([i()],Av.prototype,"close",void 0),Zr([i()],Av.prototype,"targetExitViewport",void 0),Zr([Bt],Av));function Av(e,t){return yv.call(this,t,e)||this}function xv(e,t){for(var i=getComputedStyle(e),n=[],o=/(auto|scroll)/,r=e.parentElement;r&&"HTML"!==r.tagName;){var s=getComputedStyle(r);"absolute"===i.position&&"static"===s.position||!o.test(s.overflow+s.overflowY+s.overflowX)||n.push(r),r=r.parentElement}return t||n.push(document),n}function Iv(e){for(var t=e.parentElement,i=[];t&&"BODY"!==t.tagName;){var n=document.defaultView.getComputedStyle(t,null).getPropertyValue("z-index"),o=document.defaultView.getComputedStyle(t,null).getPropertyValue("position");"auto"!==n&&"static"!==o&&i.push(n),t=t.parentElement}for(var r=[],s=0;s<document.body.children.length;s++)e.isEqualNode(document.body.children[s])||(n=document.defaultView.getComputedStyle(document.body.children[s],null).getPropertyValue("z-index"),o=document.defaultView.getComputedStyle(document.body.children[s],null).getPropertyValue("position"),"auto"!==n&&"static"!==o&&r.push(n));r.push("999");var a=[];if(!je(e.parentElement)&&"BODY"!==e.parentElement.tagName)for(var l=[].slice.call(e.parentElement.children),s=0;s<l.length;s++)e.isEqualNode(l[s])||(n=document.defaultView.getComputedStyle(l[s],null).getPropertyValue("z-index"),o=document.defaultView.getComputedStyle(l[s],null).getPropertyValue("position"),"auto"!==n&&"static"!==o&&a.push(n));var h=i.concat(r,a),h=Math.max.apply(Math,h)+1;return 2147483647<h?2147483647:h}function Tv(e,t,i,n,o,r){var s=n;if(n.tagName===t){for(var t=R("ej2_instances",n),s=e("input",{attrs:{type:i}}),a=["change","cssClass","label","labelPosition","id"],l=0,h=n.attributes.length;l<h;l++)-1===a.indexOf(n.attributes[l].nodeName)&&s.setAttribute(n.attributes[l].nodeName,n.attributes[l].nodeValue);pt(n,{class:o}),n.appendChild(s),n.classList.add(r),n.classList.remove(r),x("ej2_instances",t,s),b(n,"ej2_instances")}return s}function Ev(e){for(var t,i=e.childNodes,n=0;n<i.length;n++)if(3===(t=i[n]).nodeType)return t;return null}function Dv(t,i,e){"INPUT"===e?(i.parentNode.insertBefore(t.element,i),G(i),t.element.checked=!1,["name","value","disabled"].forEach(function(e){t.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="",t.element=i)}function Mv(e,t,i,n,o){n=Tv(e.createElement,t,"checkbox",n,i,o),e.element=n,"checkbox"!==e.element.getAttribute("type")&&e.element.setAttribute("type","checkbox"),e.element.id||(e.element.id=D("e-"+o))}function kv(e,t,i){void 0===t&&(t=!1),void 0===i&&(i={});var n=e("div",{className:"e-checkbox-wrapper e-css"}),t=(i.cssClass&&U([n],i.cssClass.split(" ")),i.enableRtl&&n.classList.add("e-rtl"),t&&(Ht(t=e("span",{className:"e-ripple-container"}),{isCenterRipple:!0,duration:400}),n.appendChild(t)),e("span",{className:"e-frame e-icons"}));return i.checked&&t.classList.add("e-check"),n.appendChild(t),i.label&&(t=e("span",{className:"e-label"}),i.disableHtmlEncode?t.textContent=i.label:t.innerHTML=i.label,n.appendChild(t)),n}function Pv(e,t){var i;t&&((i=document.createEvent("MouseEvents")).initEvent(e.type,!1,!0),t.dispatchEvent(i))}function Bv(e,t){e.element.getAttribute("ejs-for")&&t.appendChild(e.createElement("input",{attrs:{name:e.name||e.element.name,value:"false",type:"hidden"}}))}function Fv(){}Lv=function(e,t){return(Lv=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])}))(e,t)};var Lv,Rv,Ov,o=function(e,t){function i(){this.constructor=e}Lv(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},tn=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},o0=((i0=Rv=Rv||{}).Left="Left",i0.Right="Right",i0.Top="Top",i0.Bottom="Bottom",new yt),Nv="e-rtl",Vv="e-btn",_v="e-primary",Hv="e-icon-btn",zv=(o(jv,Ov=Ji),jv.prototype.preRender=function(){},jv.prototype.render=function(){this.initialize(),this.removeRippleEffect=Ht(this.element,{selector:"."+Vv}),this.renderComplete()},jv.prototype.initialize=function(){var e;this.cssClass&&U([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.isPrimary&&this.element.classList.add(_v),N&&"progress-btn"===this.getModuleName()||(this.content&&(e=this.enableHtmlSanitizer?go.sanitize(this.content):this.content,this.element.innerHTML=e),this.setIconCss()),this.enableRtl&&this.element.classList.add(Nv),this.disabled?this.controlStatus(this.disabled):this.wireEvents()},jv.prototype.controlStatus=function(e){this.element.disabled=e},jv.prototype.setIconCss=function(){var e,t;this.iconCss&&(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(Hv),!(t=this.element.childNodes[0])||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?this.element.appendChild(e):this.element.insertBefore(e,t))},jv.prototype.wireEvents=function(){this.isToggle&&E.add(this.element,"click",this.btnClickHandler,this)},jv.prototype.unWireEvents=function(){this.isToggle&&E.remove(this.element,"click",this.btnClickHandler)},jv.prototype.btnClickHandler=function(){this.element.classList.contains("e-active")?this.element.classList.remove("e-active"):this.element.classList.add("e-active")},jv.prototype.destroy=function(){var e=[_v,Nv,Hv,"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"],e=(this.cssClass&&(e=e.concat(this.cssClass.split(/\s+/).filter(function(e){return 0<e.length}))),Ov.prototype.destroy.call(this),q([this.element],e),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,"")),this.element.querySelector("span.e-btn-icon"));e&&G(e),this.unWireEvents(),Gt&&this.removeRippleEffect()},jv.prototype.getModuleName=function(){return"btn"},jv.prototype.getPersistData=function(){return this.addOnPersist([])},jv.Inject=function(){},jv.prototype.onPropertyChanged=function(e,t){for(var i=this.element.querySelector("span.e-btn-icon"),n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"isPrimary":e.isPrimary?this.element.classList.add(_v):this.element.classList.remove(_v);break;case"disabled":this.controlStatus(e.disabled);break;case"iconCss":(i=this.element.querySelector("span.e-btn-icon"))?e.iconCss?(i.className="e-btn-icon "+e.iconCss,this.element.textContent.trim()&&("Left"===this.iconPosition?i.classList.add("e-icon-left"):i.classList.add("e-icon-right"))):G(i):this.setIconCss();break;case"iconPosition":q([this.element],["e-top-icon-btn","e-bottom-icon-btn"]),(i=this.element.querySelector("span.e-btn-icon"))&&G(i),this.setIconCss();break;case"cssClass":t.cssClass&&q([this.element],t.cssClass.split(/\s+/).filter(function(e){return 0<e.length})),e.cssClass&&U([this.element],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":e.enableRtl?this.element.classList.add(Nv):this.element.classList.remove(Nv);break;case"content":Ev(this.element)||this.element.classList.remove(Hv),N&&(this.isServerRendered||"progress-btn"===this.getModuleName())||(this.enableHtmlSanitizer&&(e.content=go.sanitize(e.content)),this.element.innerHTML=e.content,this.setIconCss());break;case"isToggle":e.isToggle?E.add(this.element,"click",this.btnClickHandler,this):(E.remove(this.element,"click",this.btnClickHandler),q([this.element],["e-active"]))}},jv.prototype.click=function(){this.element.click()},jv.prototype.focusIn=function(){this.element.focus()},tn([e("Left")],jv.prototype,"iconPosition",void 0),tn([e("")],jv.prototype,"iconCss",void 0),tn([e(!1)],jv.prototype,"disabled",void 0),tn([e(!1)],jv.prototype,"isPrimary",void 0),tn([e("")],jv.prototype,"cssClass",void 0),tn([e("")],jv.prototype,"content",void 0),tn([e(!1)],jv.prototype,"isToggle",void 0),tn([e()],jv.prototype,"locale",void 0),tn([e(!0)],jv.prototype,"enableHtmlSanitizer",void 0),tn([i()],jv.prototype,"created",void 0),tn([Bt],jv));function jv(e,t){return Ov.call(this,e,t)||this}Wv=function(e,t){return(Wv=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])}))(e,t)};var Wv,Qv,s0=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Uv="e-check",qv="e-checkbox-disabled",Gv="e-frame",Yv="e-stop",Xv="e-label",Kv="e-ripple-container",Jv="e-ripple-check",Zv="e-ripple-stop",$v="e-rtl",eb="e-checkbox-wrapper",tb=["title","class","style","disabled","readonly","name","value","id","tabindex","aria-label","required"],ib=(function(e,t){function i(){this.constructor=e}Wv(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(nb,Qv=Ji),nb.prototype.changeState=function(e,t,i){var n=this.getWrapper(),o=null,r=null;n&&(r=n.getElementsByClassName(Gv)[0],Gt)&&(o=n.getElementsByClassName(Kv)[0]),"check"===e?(r&&(r.classList.remove(Yv),r.classList.add(Uv)),o&&(o.classList.remove(Zv),o.classList.add(Jv)),this.element.checked=!0,(this.element.required||z(this.element,"form")&&z(this.element,"form").classList.contains("e-formvalidator"))&&this.validCheck&&!t&&i?(this.element.checked=!1,this.validCheck=!1):(this.element.required||z(this.element,"form")&&z(this.element,"form").classList.contains("e-formvalidator"))&&(this.validCheck=!0)):"uncheck"===e?(r&&q([r],[Uv,Yv]),o&&q([o],[Jv,Zv]),this.element.checked=!1,(this.element.required||z(this.element,"form")&&z(this.element,"form").classList.contains("e-formvalidator"))&&this.validCheck&&!t&&i?(this.element.checked=!0,this.validCheck=!1):(this.element.required||z(this.element,"form")&&z(this.element,"form").classList.contains("e-formvalidator"))&&(this.validCheck=!0)):(r&&(r.classList.remove(Uv),r.classList.add(Yv)),o&&(o.classList.remove(Jv),o.classList.add(Zv)),this.element.indeterminate=!0,this.indeterminate=!0)},nb.prototype.clickHandler=function(e){var t;"INPUT"===e.target.tagName&&this.clickTriggered?(this.changeState(this.checked?"check":"uncheck"),this.clickTriggered=!1):("SPAN"!==e.target.tagName&&"LABEL"!==e.target.tagName&&!z(e.target,".e-label")||(this.clickTriggered=!0),this.isMouseClick&&(this.focusOutHandler(),this.isMouseClick=!1),this.indeterminate?(this.changeState(this.checked?"check":"uncheck",!1,!0),this.indeterminate=!1,this.element.indeterminate=!1):this.checked?(this.changeState("uncheck",!1,!0),this.checked=!1):(this.changeState("check",!1,!0),this.checked=!0),t={checked:this.updateVueArrayModel(!1),event:e},this.trigger("change",t),e.stopPropagation())},nb.prototype.destroy=function(){var t=this,i=this.getWrapper();Qv.prototype.destroy.call(this),this.wrapper&&(i=this.wrapper,this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(this.getWrapper()&&i.parentNode&&i.parentNode.insertBefore(this.element,i),G(i),this.element.checked=!1,this.indeterminate&&(this.element.indeterminate=!1),["name","value","disabled"].forEach(function(e){t.element.removeAttribute(e)})):(["class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="",this.element=i,this.refreshing&&(["e-control","e-checkbox","e-lib"].forEach(function(e){t.element.classList.add(e)}),x("ej2_instances",[this],this.element))))},nb.prototype.focusHandler=function(){this.isFocused=!0},nb.prototype.focusOutHandler=function(){var e=this.getWrapper();e&&e.classList.remove("e-focus"),this.isFocused=!1},nb.prototype.getModuleName=function(){return"checkbox"},nb.prototype.getPersistData=function(){return this.addOnPersist(["checked","indeterminate"])},nb.prototype.getWrapper=function(){return this.element&&this.element.parentElement?this.element.parentElement.parentElement:null},nb.prototype.getLabel=function(){return this.element?this.element.parentElement:null},nb.prototype.initialize=function(){je(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.element.setAttribute("tabindex","0"),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",!0),this.indeterminate&&this.changeState(),this.disabled&&this.setDisabled()},nb.prototype.initWrapper=function(){var e=this.element.parentElement,t=(e.classList.contains(eb)||(e=this.createElement("div",{className:eb}),this.element.parentNode&&this.element.parentNode.insertBefore(e,this.element)),this.createElement("label",{attrs:{for:this.htmlAttributes.id||this.element.id}})),i=this.createElement("span",{className:"e-icons "+Gv});e.classList.add("e-wrapper"),this.enableRtl&&e.classList.add($v),this.cssClass&&U([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),e.appendChild(t),t.appendChild(this.element),Bv(this,t),t.appendChild(i),Gt&&(e=this.createElement("span",{className:Kv}),"Before"===this.labelPosition?t.appendChild(e):t.insertBefore(e,i),Ht(e,{duration:400,isCenterRipple:!0})),this.label&&this.setText(this.label)},nb.prototype.keyUpHandler=function(){this.isFocused&&this.getWrapper().classList.add("e-focus")},nb.prototype.labelMouseDownHandler=function(e){this.isMouseClick=!0,Pv(e,this.getWrapper().getElementsByClassName(Kv)[0])},nb.prototype.labelMouseLeaveHandler=function(e){var t=this.getLabel().getElementsByClassName(Kv)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;0<i;i--)t.removeChild(t.childNodes[i]);Pv(e,t)}},nb.prototype.labelMouseUpHandler=function(e){this.isMouseClick=!0;var t=this.getWrapper().getElementsByClassName(Kv)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element"),n=0;n<i.length-1;n++)t.removeChild(t.childNodes[n]);Pv(e,t)}},nb.prototype.onPropertyChanged=function(e,t){for(var i=this.getWrapper(),n=0,o=Object.keys(e);n<o.length;n++)switch(o[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,i.classList.remove(qv),i.setAttribute("aria-disabled","false"),this.wireEvents());break;case"cssClass":t.cssClass&&q([i],t.cssClass.split(/\s+/).filter(function(e){return 0<e.length})),e.cssClass&&U([i],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":e.enableRtl?i.classList.add($v):i.classList.remove($v);break;case"label":this.setText(e.label);break;case"labelPosition":var r=i.getElementsByClassName(Xv)[0],s=i.getElementsByTagName("label")[0];G(r),"After"===e.labelPosition?s.appendChild(r):s.insertBefore(r,i.getElementsByClassName(Gv)[0]);break;case"name":this.element.setAttribute("name",e.name);break;case"value":this.isVue&&"object"==typeof e.value||this.element.setAttribute("value",e.value);break;case"htmlAttributes":this.updateHtmlAttributeToWrapper()}},nb.prototype.preRender=function(){var e=this.element;this.tagName=this.element.tagName,e=Tv(this.createElement,"EJS-CHECKBOX","checkbox",e,eb,"checkbox"),this.element=e,"checkbox"!==this.element.getAttribute("type")&&this.element.setAttribute("type","checkbox"),this.element.id||(this.element.id=D("e-"+this.getModuleName()))},nb.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents(),this.updateHtmlAttributeToWrapper(),this.updateVueArrayModel(!0),this.renderComplete(),this.wrapper=this.getWrapper()},nb.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add(qv),e.setAttribute("aria-disabled","true")},nb.prototype.setText=function(e){var t,i=this.getWrapper();i&&((t=i.getElementsByClassName(Xv)[0])?t.innerHTML=this.enableHtmlSanitizer?go.sanitize(e):e:(e=this.enableHtmlSanitizer?go.sanitize(e):e,t=this.createElement("span",{className:Xv,innerHTML:e}),e=i.getElementsByTagName("label")[0],"Before"===this.labelPosition?e.insertBefore(t,i.getElementsByClassName(Gv)[0]):e.appendChild(t)))},nb.prototype.changeHandler=function(e){e.stopPropagation()},nb.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.element.checked=this.initialCheckedValue},nb.prototype.unWireEvents=function(){var e=this.wrapper,e=(E.remove(e,"click",this.clickHandler),E.remove(this.element,"keyup",this.keyUpHandler),E.remove(this.element,"focus",this.focusHandler),E.remove(this.element,"focusout",this.focusOutHandler),e.getElementsByTagName("label")[0]),e=(e&&(E.remove(e,"mousedown",this.labelMouseDownHandler),E.remove(e,"mouseup",this.labelMouseUpHandler),E.remove(e,"mouseleave",this.labelMouseLeaveHandler)),z(this.element,"form"));e&&E.remove(e,"reset",this.formResetHandler),"EJS-CHECKBOX"===this.tagName&&E.remove(this.element,"change",this.changeHandler)},nb.prototype.wireEvents=function(){var e=this.getWrapper(),e=(E.add(e,"click",this.clickHandler,this),E.add(this.element,"keyup",this.keyUpHandler,this),E.add(this.element,"focus",this.focusHandler,this),E.add(this.element,"focusout",this.focusOutHandler,this),e.getElementsByTagName("label")[0]),e=(E.add(e,"mousedown",this.labelMouseDownHandler,this),E.add(e,"mouseup",this.labelMouseUpHandler,this),E.add(e,"mouseleave",this.labelMouseLeaveHandler,this),z(this.element,"form"));e&&E.add(e,"reset",this.formResetHandler,this),"EJS-CHECKBOX"===this.tagName&&E.add(this.element,"change",this.changeHandler,this)},nb.prototype.updateVueArrayModel=function(e){if(this.isVue&&"object"==typeof this.value){var t=this.element.value;if(t&&this.value){if(!e)return e=this.value.indexOf(t),this.checked?e<0&&this.value.push(t):-1<e&&this.value.splice(e,1),this.value;for(var i=0;i<this.value.length;i++)t===this.value[i]&&(this.changeState("check"),this.setProperties({checked:!0},!0))}}return this.validCheck?this.element.checked:!this.element.checked},nb.prototype.updateHtmlAttributeToWrapper=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e],n=this.getWrapper();-1<tb.indexOf(i)?"class"===i?U([n],this.htmlAttributes[""+i].split(" ")):("title"===i?n:"style"===i?this.getWrapper().getElementsByClassName(Gv)[0]:("disabled"===i&&"true"===this.htmlAttributes[""+i]&&this.setDisabled(),this.element)).setAttribute(i,this.htmlAttributes[""+i]):n.setAttribute(i,this.htmlAttributes[""+i])}},nb.prototype.click=function(){this.element.click()},nb.prototype.focusIn=function(){this.element.focus()},s0([i()],nb.prototype,"change",void 0),s0([i()],nb.prototype,"created",void 0),s0([e(!1)],nb.prototype,"checked",void 0),s0([e("")],nb.prototype,"cssClass",void 0),s0([e(!1)],nb.prototype,"disabled",void 0),s0([e(!1)],nb.prototype,"indeterminate",void 0),s0([e("")],nb.prototype,"label",void 0),s0([e("After")],nb.prototype,"labelPosition",void 0),s0([e("")],nb.prototype,"name",void 0),s0([e("")],nb.prototype,"value",void 0),s0([e(!0)],nb.prototype,"enableHtmlSanitizer",void 0),s0([e({})],nb.prototype,"htmlAttributes",void 0),s0([Bt],nb));function nb(e,t){e=Qv.call(this,e,t)||this;return e.isFocused=!1,e.isMouseClick=!1,e.clickTriggered=!1,e.validCheck=!0,e.type="checkbox",e}ob=function(e,t){return(ob=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])}))(e,t)};var ob,rb,sb,h0=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},ab="e-label",lb="e-ripple-container",hb="e-rtl",db="e-radio-wrapper",pb=["title","class","style","disabled","readonly","name","value","id"],cb=(function(e,t){function i(){this.constructor=e}ob(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(ub,rb=Ji),(sb=ub).prototype.changeHandler=function(e){this.checked=!0,this.dataBind();var t=this.element.getAttribute("value"),t=(this.isVue&&t?this.element:this).value,i=typeof this.value;this.isVue&&"boolean"==i&&(t="true"===t),this.trigger("change",{value:t,event:e}),this.isAngular&&e.stopPropagation()},ub.prototype.updateChange=function(){for(var e,t=this.getRadioGroup(),i=0;i<t.length;i++)(e=t[i])!==this.element&&((e=K(e,sb)).checked=!1,"EJS-RADIOBUTTON"===this.tagName)&&(e.angularValue=this.value)},ub.prototype.destroy=function(){var t=this,i=this.wrapper;rb.prototype.destroy.call(this),i&&(this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(i.parentNode&&i.parentNode.insertBefore(this.element,i),G(i),this.element.checked=!1,["name","value","disabled"].forEach(function(e){t.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="",this.element=this.wrapper,this.refreshing&&(["e-control","e-radio","e-lib"].forEach(function(e){t.element.classList.add(e)}),x("ej2_instances",[this],this.element))))},ub.prototype.focusHandler=function(){this.isFocused=!0},ub.prototype.focusOutHandler=function(){var e=this.getLabel();e&&e.classList.remove("e-focus")},ub.prototype.getModuleName=function(){return"radio"},ub.prototype.getSelectedValue=function(){for(var e,t=this.getRadioGroup(),i=0,n=t.length;i<n;i++)if((e=t[i]).checked)return e.value;return""},ub.prototype.getRadioGroup=function(){return document.querySelectorAll('input.e-radio[name="'+this.element.getAttribute("name")+'"]')},ub.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},ub.prototype.getWrapper=function(){return this.element.parentElement||null},ub.prototype.getLabel=function(){return this.element.nextElementSibling||null},ub.prototype.initialize=function(){je(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.initWrapper(),this.updateHtmlAttribute(),this.name&&this.element.setAttribute("name",this.name);var e=this.element.getAttribute("value"),t=typeof this.value;this.isVue&&"boolean"==t&&(e="true"===e),(this.isVue?this.value&&"boolean"!=t&&!e:this.value)&&this.element.setAttribute("value",this.value),this.checked&&(this.element.checked=!0),this.disabled&&this.setDisabled()},ub.prototype.initWrapper=function(){var e,t=this.element.parentElement,i=(t.classList.contains(db)||(t=this.createElement("div",{className:db}),this.element.parentNode&&this.element.parentNode.insertBefore(t,this.element)),this.createElement("label",{attrs:{for:this.element.id}}));t.appendChild(this.element),t.appendChild(i),Gt&&(e=this.createElement("span",{className:lb}),i.appendChild(e),Ht(e,{duration:400,isCenterRipple:!0})),t.classList.add("e-wrapper"),this.enableRtl&&i.classList.add(hb),this.cssClass&&U([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.label&&this.setText(this.label)},ub.prototype.keyUpHandler=function(){this.isFocused&&this.getLabel().classList.add("e-focus")},ub.prototype.labelMouseDownHandler=function(e){Pv(e,this.getLabel().getElementsByClassName(lb)[0])},ub.prototype.labelMouseLeaveHandler=function(e){var t=this.getLabel().getElementsByClassName(lb)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;0<i;i--)t.removeChild(t.childNodes[i]);Pv(e,t)}},ub.prototype.labelMouseUpHandler=function(e){var t=this.getLabel().getElementsByClassName(lb)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;0<i;i--)t.removeChild(t.childNodes[i]);Pv(e,t)}},ub.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.initialCheckedValue&&pt(this.element,{checked:"true"})},ub.prototype.onPropertyChanged=function(e,t){for(var i=this.getWrapper(),n=this.getLabel(),o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){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":t.cssClass&&q([i],t.cssClass.split(/\s+/).filter(function(e){return 0<e.length})),e.cssClass&&U([i],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":e.enableRtl?n.classList.add(hb):n.classList.remove(hb);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":var s=typeof this.htmlAttributes.value;!je(this.htmlAttributes)&&(this.htmlAttributes.value||"boolean"==s&&!this.htmlAttributes.value)||this.element.setAttribute("value",e.value);break;case"htmlAttributes":this.updateHtmlAttribute()}},ub.prototype.preRender=function(){var e=this.element;this.formElement=z(this.element,"form"),this.tagName=this.element.tagName,e=Tv(this.createElement,"EJS-RADIOBUTTON","radio",e,db,"radio"),this.element=e,"radio"!==this.element.getAttribute("type")&&this.element.setAttribute("type","radio"),this.element.id||(this.element.id=D("e-"+this.getModuleName())),"EJS-RADIOBUTTON"===this.tagName&&(e=this.element.getAttribute("formcontrolname"))&&(this.setProperties({name:e},!0),this.element.setAttribute("name",e))},ub.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete(),this.wrapper=this.getWrapper()},ub.prototype.setDisabled=function(){this.element.disabled=!0},ub.prototype.setText=function(e){var t=this.getLabel(),i=t.getElementsByClassName(ab)[0];i?i.textContent=e:(e=this.enableHtmlSanitizer?go.sanitize(e):e,i=this.createElement("span",{className:ab,innerHTML:e}),t.appendChild(i)),"Before"===this.labelPosition?this.getLabel().classList.add("e-right"):this.getLabel().classList.remove("e-right")},ub.prototype.updateHtmlAttribute=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e],n=this.element.parentElement;-1<pb.indexOf(i)?"class"===i?U([n],this.htmlAttributes[""+i].replace(/\s+/g," ").trim().split(" ")):("title"===i||"style"===i?n:this.element).setAttribute(i,this.htmlAttributes[""+i]):n.setAttribute(i,this.htmlAttributes[""+i])}},ub.prototype.unWireEvents=function(){var e=this.wrapper,e=(E.remove(this.element,"change",this.changeHandler),E.remove(this.element,"focus",this.focusHandler),E.remove(this.element,"focusout",this.focusOutHandler),E.remove(this.element,"keyup",this.keyUpHandler),e.getElementsByTagName("label")[0]);e&&(E.remove(e,"mousedown",this.labelMouseDownHandler),E.remove(e,"mouseup",this.labelMouseUpHandler),E.remove(e,"mouseleave",this.labelMouseLeaveHandler)),this.formElement&&E.remove(this.formElement,"reset",this.formResetHandler)},ub.prototype.wireEvents=function(){var e=this.getLabel(),e=(E.add(this.element,"change",this.changeHandler,this),E.add(this.element,"keyup",this.keyUpHandler,this),E.add(this.element,"focus",this.focusHandler,this),E.add(this.element,"focusout",this.focusOutHandler,this),e.getElementsByClassName(ab)[0]);e&&(E.add(e,"mousedown",this.labelMouseDownHandler,this),E.add(e,"mouseup",this.labelMouseUpHandler,this),E.add(e,"mouseleave",this.labelMouseLeaveHandler,this)),this.formElement&&E.add(this.formElement,"reset",this.formResetHandler,this)},ub.prototype.click=function(){this.element.click()},ub.prototype.focusIn=function(){this.element.focus()},h0([i()],ub.prototype,"change",void 0),h0([i()],ub.prototype,"created",void 0),h0([e(!1)],ub.prototype,"checked",void 0),h0([e("")],ub.prototype,"cssClass",void 0),h0([e(!1)],ub.prototype,"disabled",void 0),h0([e("")],ub.prototype,"label",void 0),h0([e("After")],ub.prototype,"labelPosition",void 0),h0([e("")],ub.prototype,"name",void 0),h0([e("")],ub.prototype,"value",void 0),h0([e(!0)],ub.prototype,"enableHtmlSanitizer",void 0),h0([e({})],ub.prototype,"htmlAttributes",void 0),sb=h0([Bt],ub));function ub(e,t){e=rb.call(this,e,t)||this;return e.isFocused=!1,e.type="radio",e}gb=function(e,t){return(gb=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])}))(e,t)};var gb,mb,Ir=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},fb="e-switch-disabled",yb="e-ripple-container",vb="e-ripple-check",bb="e-rtl",wb="e-switch-wrapper",Cb="e-switch-active",Sb=["title","class","style","disabled","readonly","name","value","aria-label","id","role","tabindex"],Ab=(function(e,t){function i(){this.constructor=e}gb(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(xb,mb=Ji),xb.prototype.changeState=function(e){var t=null,i=this.getWrapper(),n=i.querySelector(".e-switch-inner"),o=i.querySelector(".e-switch-handle");Gt&&(t=i.getElementsByClassName(yb)[0]),e?(U([n,o],Cb),this.element.checked=!0,this.checked=!0,t&&U([t],[vb])):(q([n,o],Cb),this.element.checked=!1,this.checked=!1,t&&q([t],[vb]))},xb.prototype.clickHandler=function(e){this.isDrag=!1,this.focusOutHandler();var t={event:e,cancel:!1,checked:this.checked};this.trigger("beforeChange",t),t.cancel||(this.changeState(!t.checked),this.element.focus(),t={checked:this.element.checked,event:e},this.trigger("change",t))},xb.prototype.destroy=function(){var t=this;mb.prototype.destroy.call(this),this.disabled||this.unWireEvents(),this.formElement&&E.remove(this.formElement,"reset",this.formResetHandler),Dv(this,this.getWrapper(),this.tagName),this.refreshing&&(["e-control","e-switch","e-lib"].forEach(function(e){t.element.classList.add(e)}),x("ej2_instances",[this],this.element))},xb.prototype.focusHandler=function(){this.isFocused=!0},xb.prototype.focusOutHandler=function(){this.getWrapper().classList.remove("e-focus")},xb.prototype.getModuleName=function(){return"switch"},xb.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},xb.prototype.getWrapper=function(){return this.element.parentElement||null},xb.prototype.initialize=function(){this.element.setAttribute("role","switch"),je(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)},xb.prototype.initWrapper=function(){var e=this.element.parentElement,t=(e.classList.contains(wb)||(e=this.createElement("div",{className:wb}),this.element.parentNode.insertBefore(e,this.element)),this.createElement("span",{className:"e-switch-inner"})),i=this.createElement("span",{className:"e-switch-on"}),n=this.createElement("span",{className:"e-switch-off"}),o=this.createElement("span",{className:"e-switch-handle"});e.appendChild(this.element),Bv(this,e),t.appendChild(i),t.appendChild(n),e.appendChild(t),e.appendChild(o),Gt&&(i=this.createElement("span",{className:yb}),o.appendChild(i),Ht(i,{duration:400,isCenterRipple:!0})),e.classList.add("e-wrapper"),this.enableRtl&&e.classList.add(bb),this.cssClass&&U([e],this.cssClass.replace(/\s+/g," ").trim().split(" "))},xb.prototype.onPropertyChanged=function(e,t){for(var i=this.getWrapper(),n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"checked":this.changeState(e.checked);break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents(),this.isWireEvents=!1):(this.element.disabled=!1,i.classList.remove(fb),i.setAttribute("aria-disabled","false"),this.isWireEvents||(this.wireEvents(),this.isWireEvents=!0));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?i.classList.add(bb):i.classList.remove(bb);break;case"cssClass":t.cssClass&&q([i],t.cssClass.split(/\s+/).filter(function(e){return 0<e.length})),e.cssClass&&U([i],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"htmlAttributes":this.updateHtmlAttribute()}},xb.prototype.preRender=function(){var e=this.element;this.formElement=z(this.element,"form"),this.tagName=this.element.tagName,Mv(this,"EJS-SWITCH",wb,e,this.getModuleName())},xb.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents(),this.formElement&&E.add(this.formElement,"reset",this.formResetHandler,this),this.renderComplete(),this.updateHtmlAttribute()},xb.prototype.rippleHandler=function(e){Pv(e,this.getWrapper().getElementsByClassName(yb)[0]),"mousedown"===e.type&&e.currentTarget.classList.contains("e-switch-wrapper")&&1===e.which&&(this.isDrag=!0,this.isFocused=!1)},xb.prototype.mouseLeaveHandler=function(e){var t=this.element.parentElement.getElementsByClassName(yb)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element").length-1;0<i;i--)t.removeChild(t.childNodes[i]);Pv(e,t)}},xb.prototype.rippleTouchHandler=function(e){var t,i=this.getWrapper().getElementsByClassName(yb)[0];i&&((t=document.createEvent("MouseEvents")).initEvent(e,!1,!0),i.dispatchEvent(t))},xb.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add(fb),e.setAttribute("aria-disabled","true")},xb.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)},xb.prototype.updateHtmlAttribute=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e],n=this.getWrapper();-1<Sb.indexOf(i)?"class"===i?U([n],this.htmlAttributes[""+i].split(" ")):("title"===i||"style"===i?n:("disabled"===i&&"true"===this.htmlAttributes[""+i]&&this.setDisabled(),this.element)).setAttribute(i,this.htmlAttributes[""+i]):n.setAttribute(i,this.htmlAttributes[""+i])}},xb.prototype.switchFocusHandler=function(e){this.isFocused&&this.getWrapper().classList.add("e-focus"),e&&"keyup"===e.type&&"Space"===e.code&&this.isAngular&&(this.clickHandler(e),e.stopPropagation(),e.preventDefault())},xb.prototype.switchMouseUp=function(e){var t,i,n=0,o=0,r=e.target;"touchmove"===e.type&&(e.preventDefault(),i=e.changedTouches[0].clientX,t=e.changedTouches[0].clientY,o=this.bTouchX-i,n=this.bTouchY-t,Math.abs(o)<Math.abs(n)?(this.isDrag=!1,this.rippleTouchHandler("mouseup")):this.isDrag=!0),"touchstart"===e.type&&(this.bTouchX=e.changedTouches[0].clientX,this.bTouchY=e.changedTouches[0].clientY,this.isDrag=!0,this.rippleTouchHandler("mousedown")),this.isDrag&&("mouseup"===e.type&&r.className.indexOf("e-switch")<0||"touchend"===e.type)&&(o=this.bTouchX-e.changedTouches[0].clientX,n=this.bTouchY-e.changedTouches[0].clientY,Math.abs(o)>=Math.abs(n))&&(this.clickHandler(e),this.rippleTouchHandler("mouseup"),e.preventDefault())},xb.prototype.formResetHandler=function(){this.checked=this.initialSwitchCheckedValue,this.element.checked=this.initialSwitchCheckedValue},xb.prototype.toggle=function(){this.clickHandler()},xb.prototype.wireEvents=function(){var e=this.getWrapper();this.delegateMouseUpHandler=this.switchMouseUp.bind(this),this.delegateKeyUpHandler=this.switchFocusHandler.bind(this),E.add(e,"click",this.clickHandler,this),E.add(this.element,"focus",this.focusHandler,this),E.add(this.element,"focusout",this.focusOutHandler,this),E.add(this.element,"mouseup",this.delegateMouseUpHandler,this),E.add(this.element,"keyup",this.delegateKeyUpHandler,this),E.add(e,"mousedown mouseup",this.rippleHandler,this),E.add(e,"mouseleave",this.mouseLeaveHandler,this),E.add(e,"touchstart touchmove touchend",this.switchMouseUp,this)},xb.prototype.unWireEvents=function(){var e=this.getWrapper();E.remove(e,"click",this.clickHandler),E.remove(this.element,"focus",this.focusHandler),E.remove(this.element,"focusout",this.focusOutHandler),E.remove(this.element,"mouseup",this.delegateMouseUpHandler),E.remove(this.element,"keyup",this.delegateKeyUpHandler),E.remove(e,"mousedown mouseup",this.rippleHandler),E.remove(e,"mouseleave",this.mouseLeaveHandler),E.remove(e,"touchstart touchmove touchend",this.switchMouseUp)},xb.prototype.click=function(){this.element.click()},xb.prototype.focusIn=function(){this.element.focus()},Ir([i()],xb.prototype,"beforeChange",void 0),Ir([i()],xb.prototype,"change",void 0),Ir([i()],xb.prototype,"created",void 0),Ir([e(!1)],xb.prototype,"checked",void 0),Ir([e("")],xb.prototype,"cssClass",void 0),Ir([e(!1)],xb.prototype,"disabled",void 0),Ir([e("")],xb.prototype,"name",void 0),Ir([e("")],xb.prototype,"onLabel",void 0),Ir([e("")],xb.prototype,"offLabel",void 0),Ir([e("")],xb.prototype,"value",void 0),Ir([e({})],xb.prototype,"htmlAttributes",void 0),Ir([Bt],xb));function xb(e,t){e=mb.call(this,e,t)||this;return e.isFocused=!1,e.isDrag=!1,e.isWireEvents=!1,e}Ib=function(e,t){return(Ib=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])}))(e,t)};var Ib,Tb,Eb,Sr=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Db={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",template:"e-chip-template",chipList:"e-chip-list",customIcon:"e-icons",chipDrag:"e-chip-drag",dragAndDrop:"e-drag-and-drop",dropRestricted:"e-error-treeview",cloneChip:"e-clone-chip",dragIndicator:"e-drag-indicator"},Nr=(function(e,t){function i(){this.constructor=e}Ib(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Mb,Tb=Ji),(Eb=Mb).prototype.preRender=function(){},Mb.prototype.chipType=function(){return this.chips&&this.chips.length&&0<this.chips.length},Mb.prototype.render=function(){this.type=(je(this.chips)||!this.chips.length)&&(this.text||this.element.innerText)?"chip":"chipset",this.setAttributes(),this.createChip(),this.setRtl(),this.select(this.selectedChips),this.wireEvent(!1),this.rippleFunction=Ht(this.element,{selector:"."+Db.chip}),this.renderComplete(),this.dragCollection=[],this.allowDragAndDrop&&this.enableDraggingChips()},Mb.prototype.enableDraggingChips=function(){var o,r=this;this.element.querySelectorAll("."+Db.chip).forEach(function(e,n){r.dragObj=new hn(e,{preventDefault:!1,clone:!0,dragArea:r.dragArea,helper:function(){return(o=e.cloneNode(!0)).classList.add(Db.cloneChip),r.element.appendChild(o),o},dragStart:function(e){r.dragIndicator=r.createElement("div",{className:Db.dragIndicator}),document.body.appendChild(r.dragIndicator);var t=r.find(e.element),i={cancel:!1,event:e.event,draggedItem:e.element,draggedItemData:t,dropTarget:null};r.trigger("dragStart",i,function(){je(i.cancel)&&(i.cancel=!1)}),i.cancel?r.dragObj.intDestroy(e.event):o.setAttribute("drag-indicator-index",n.toString())},drag:function(e){var t=r.find(e.element),t={event:e.event,draggedItem:e.element,draggedItemData:t,dropTarget:null},t=(r.trigger("dragging",t),o.querySelector("."+Db.chipDrag));je(t)&&(t=r.createElement("span",{className:Db.customIcon+" "+Db.dragAndDrop+" "+Db.chipDrag}),o.prepend(t)),r.allowExternalDragging(e,o,t)},dragStop:function(e){var t=r.find(e.element),i={cancel:!1,event:e.event,draggedItem:e.element,draggedItemData:t,dropTarget:e.target};r.trigger("dragStop",i,function(){je(i.cancel)&&(i.cancel=!1)}),i.cancel||r.allowExternalDrop(e,o),je(r.dragIndicator)||ue(r.dragIndicator),je(o)||o.remove()}}),-1===r.dragCollection.indexOf(r.dragObj)&&r.dragCollection.push(r.dragObj)})},Mb.prototype.checkInstance=function(e,t){t=!je(e.target.closest("."+Db.chipList))&&e.target.closest("."+Db.chipList).id!==t.element.id;return t&&(this.updatedInstance=e.target.closest("."+Db.chipList)),t},Mb.prototype.setIcons=function(e,t,i,n,o){e=e.element.contains(i),i=i.closest(".e-droppable");!e&&!i||o?(t.classList.remove(Db.dragAndDrop),t.classList.add(Db.dropRestricted),n.style.display="none"):(t.classList.add(Db.dragAndDrop),t.classList.remove(Db.dropRestricted),i&&(n.style.display="none"))},Mb.prototype.allowExternalDragging=function(e,n,t){var i,o=null,r=1/0,s=-1;if(this.checkInstance(e,this)){if(this.dragIndicator.style.display="none",(i=this.getCurrentInstance(e)).dragIndicator=this.dragIndicator,!i.allowDragAndDrop)return}else i=this;var a,l=i.dragIndicator,h=(l.style.display="inline",d=this.dragAreaCheck(this.dragArea,e.target,!1,t,l),this.setIcons(i,t,e.target,l,d),i.element.appendChild(n),n.getBoundingClientRect()),t=Array.from(i.element.querySelectorAll("."+Db.chip)),e=(t.forEach(function(e,t){var i;e!==n&&(i=e.getBoundingClientRect(),(i=Math.sqrt(Math.pow(h.left-i.left,2)+Math.pow(h.top-i.top,2)))<r)&&(r=i,o=e,s=t)}),-1===s&&(s=t.length),this.getChipsDistance(i)),d=n.getBoundingClientRect();(o||0<t.length)&&(a=(o||t[t.length-1]).getBoundingClientRect(),l.style.top=a.top+window.scrollY+"px",l.style.left=i.enableRtl?a.right+e+"px":a.left-e+window.scrollX+"px"),i.enableRtl?d.left<a.left-a.width/2&&d.top>a.top&&(l.style.left=a.left-e+window.scrollX+"px"):d.left>a.left+a.width/2&&d.top>a.top&&(l.style.left=a.left+a.width+e+window.scrollX+"px")},Mb.prototype.dragAreaCheck=function(e,t,i,n,o){var r,s;return!je(e)&&(r="string"==typeof e,s=e instanceof HTMLElement,je(e=r?document.querySelector(e):e)||!r&&!s||e.contains(t)||(i=!0,o.style.display="none",n.classList.add(Db.dropRestricted),n.classList.remove(Db.dragAndDrop)),i)},Mb.prototype.getChipsDistance=function(e){var t,i,n;return e.chips.length<=1?4:(n=e.find(0).element.getBoundingClientRect(),t=e.find(1).element.getBoundingClientRect(),i=n.left,e.enableRtl?i<(e=t.right)?4:(i-e)/2:(e=n.width,(n=t.left)<i+e?4:(n-(i+e))/2))},Mb.prototype.getCurrentInstance=function(e){var t=e.target.closest("."+Db.chipList);if(!je(t)&&!je(t.ej2_instances))for(var i=0;i<t.ej2_instances.length;i++)if(t.ej2_instances[parseInt(i.toString(),10)]instanceof Eb)return t.ej2_instances[i];return null},Mb.prototype.allowExternalDrop=function(e,t){var i,n=parseInt(t.getAttribute("drag-indicator-index"),10),o=!1;if(this.checkInstance(e,this)){if(o=!0,!(i=this.getCurrentInstance(e)).allowDragAndDrop)return}else i=this;var r=i.dragIndicator;if(r.style.display="inline",i.element.contains(e.target)&&!this.dragAreaCheck(this.dragArea,e.target,!1,t.querySelector("."+Db.chipDrag),r)){for(var s=r.getBoundingClientRect(),a=Array.from(i.element.querySelectorAll("."+Db.chip)),l=-1,h=0;h<a.length;h++)if(a[h]!==t){var d=a[h].getBoundingClientRect(),p=s.top<d.top+d.height/2,c=s.left<d.left+d.width/2,u=s.left>d.left+d.width/2;if(!i.enableRtl&&p&&c||i.enableRtl&&p&&u){n<(l=h)&&!o&&(l=h-1);break}}if(-1===l){for(var g=void 0,h=0;h<a.length;h++)if((d=a[h].getBoundingClientRect()).top>s.top||d.top===s.top&&d.left>s.left){g=h;break}l=g!==a.length?g:a.length}e=Array.from(this.chips);o?this.dropChip(e,n,i,l,!0):l!==n&&this.dropChip(e,n,i,l,!1)}},Mb.prototype.dropChip=function(e,t,i,n,o){t=e.splice(t,1)[0];o?((o=Array.from(i.chips)).splice(n,0,t),i.chips=o):(e.splice(n,0,t),i.chips=e),this.chips=e,i.dataBind(),this.dataBind(),i.enableDraggingChips()},Mb.prototype.createChip=function(){this.innerText=this.element.innerText&&0!==this.element.innerText.length?this.element.innerText.trim():this.element.innerText,this.element.innerHTML="",this.chipCreation("chip"===this.type?[this.innerText||this.text]:this.chips)},Mb.prototype.setAttributes=function(){"chip"===this.type?(this.enabled&&(this.element.tabIndex=0),this.element.setAttribute("role","button")):(this.element.classList.add(Db.chipSet),this.element.setAttribute("role","listbox"),"Multiple"===this.selection?(this.element.classList.add(Db.multiSelection),this.element.setAttribute("aria-multiselectable","true")):("Single"===this.selection&&this.element.classList.add(Db.singleSelection),this.element.setAttribute("aria-multiselectable","false")))},Mb.prototype.setRtl=function(){this.element.classList[this.enableRtl?"add":"remove"](Db.rtl)},Mb.prototype.renderTemplates=function(){this.isReact&&this.renderReactTemplates()},Mb.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){return oo(t)}},Mb.prototype.chipCreation=function(e){if(!je(e)){for(var t=[],i=[],n=0;n<e.length;n++){var o=this.getFieldValues(e[n]),r=o.htmlAttributes,r=(i.push(r),this.elementCreation(o)),s=(Db.chip+" "+(o.enabled?" ":Db.disabled)+" "+(o.avatarIconCss||o.avatarText?Db.chipWrapper:o.leadingIconCss?Db.iconWrapper:" ")+" "+o.cssClass).split(" ").filter(function(e){return e});if(this.chipType()&&"chip"!==this.type){var a=this.createElement("DIV",{className:s.join(" "),attrs:{tabIndex:"0",role:"option","aria-label":o.text,"aria-selected":"false"}});if(this.enableDelete&&a.setAttribute("aria-keyshortcuts","Press delete or backspace key to delete"),o.value&&a.setAttribute("data-value",o.value.toString()),o.enabled?a.setAttribute("aria-disabled","false"):(a.removeAttribute("tabindex"),a.setAttribute("aria-disabled","true")),!je(i[n])&&n<i.length&&Object.keys(i[n]).length)for(var l=Object.keys(i[n]),h=0;h<l.length;h++)a.setAttribute(l[h],i[n][l[h]]);ht(r,a),t.push(a)}else t=r,U([this.element],s),this.element.setAttribute("aria-label",o.text),o.value&&this.element.setAttribute("data-value",o.value.toString())}ht(t,this.element)}},Mb.prototype.getFieldValues=function(e){var t=!("false"===this.enabled.toString());return{text:"object"==typeof e?(e.text?e:this).text.toString():this.chipType()?e.toString():this.innerText||this.text.toString(),cssClass:("object"==typeof e&&e.cssClass?e:this).cssClass.toString(),leadingIconCss:("object"==typeof e&&e.leadingIconCss?e:this).leadingIconCss.toString(),avatarIconCss:("object"==typeof e&&e.avatarIconCss?e:this).avatarIconCss.toString(),avatarText:("object"==typeof e&&e.avatarText?e:this).avatarText.toString(),trailingIconCss:("object"==typeof e&&e.trailingIconCss?e:this).trailingIconCss.toString(),enabled:"object"==typeof e&&void 0!==e.enabled?"false"!==e.enabled.toString():t,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,htmlAttributes:"object"==typeof e&&e.htmlAttributes||this.htmlAttributes,template:"object"==typeof e&&e.template||null}},Mb.prototype.elementCreation=function(e){var t,i,n=[],o=(e.avatarText||e.avatarIconCss?(t=(Db.avatar+" "+e.avatarIconCss).trim(),(o=this.createElement("span",{className:t})).innerText=e.avatarText,n.push(o)):e.leadingIconCss?(t=(Db.icon+" "+e.leadingIconCss).trim(),i=this.createElement("span",{className:t}),n.push(i)):e.leadingIconUrl&&(t=(Db.avatar+" image-url").trim(),(i=this.createElement("span",{className:t})).style.backgroundImage="url("+e.leadingIconUrl+")",n.push(i)),this.createElement("span",{className:Db.text}));return o.innerText=e.text,n.push(o),e.template&&(i=this.createElement("div",{className:Db.template}),ht(this.templateParser(e.template)(e,this,"template",this.element.id+"_template",!1),i),n.push(i),this.renderTemplates()),e.trailingIconCss||this.chipType()&&this.enableDelete?(t=(Db.delete+" "+(e.trailingIconCss||Db.deleteIcon)).trim(),o=this.createElement("span",{className:t}),n.push(o)):e.trailingIconUrl&&(t="trailing-icon-url".trim(),(i=this.createElement("span",{className:t})).style.backgroundImage="url("+e.trailingIconUrl+")",n.push(i)),n},Mb.prototype.find=function(e){var t,i={text:"",index:-1,element:this.element,data:""},e=e instanceof HTMLElement?e:this.element.querySelectorAll("."+Db.chip)[e];return e&&this.chipType()&&(i.index=Array.prototype.slice.call(this.element.querySelectorAll("."+Db.chip)).indexOf(e),"object"==typeof(t=this.chips[i.index])&&null!==t?void 0!==t.text&&(i.text=t.text.toString()):void 0!==t&&(i.text=t.toString()),i.data=t,i.element=e),i},Mb.prototype.add=function(e){var t;"chip"!==this.type&&(e=e instanceof Array?e:[e],this.chips=(t=[].slice.call(this.chips)).concat.apply(t,e),this.chipCreation(e))},Mb.prototype.select=function(e,t){this.onSelect(e,!1,t)},Mb.prototype.multiSelection=function(e){for(var t=this.element.querySelectorAll("."+Db.chip),i=0;i<e.length;i++)if("string"==typeof e[i]){for(var n=0;n<t.length;n++)if(e[i]!==n&&e[i]===t[n].attributes[5].value){this.multiSelectedChip.push(n);break}}else this.multiSelectedChip.push(e[i])},Mb.prototype.onSelect=function(e,t,i){var n=null;if(this.chipType()&&"None"!==this.selection){if(t)for(var o=this.element.querySelectorAll("."+Db.chip),r=0;r<o.length;r++)o[r].setAttribute("aria-selected","false"),o[r].classList.remove(Db.active);for(var s=e instanceof Array?e:[e],r=0;r<s.length;r++){var a=s[r]instanceof HTMLElement?s[r]:this.element.querySelectorAll("."+Db.chip)[s[r]];if("index"!==i)for(var l=0;l<this.chips.length;l++){var h=this.element.querySelectorAll("."+Db.chip)[l],d=this.getFieldValues(this.chips[l]);"value"===i?null!==d.value&&(n=h.dataset.value):"text"===i&&(n=h.innerText),n===s[r].toString()&&(d=l,a=this.element.querySelectorAll("."+Db.chip)[d])}a instanceof HTMLElement&&this.selectionHandler(a)}}},Mb.prototype.remove=function(e){var t,i,n=this;this.chipType()&&(e=e instanceof Array?e:[e],t=[],i=this.element.querySelectorAll("."+Db.chip),e.forEach(function(e){e=e instanceof HTMLElement?e:i[e];e instanceof HTMLElement&&t.push(e)}),t.forEach(function(e){var t=n.element.querySelectorAll("."+Db.chip),t=Array.prototype.slice.call(t).indexOf(e);n.deleteHandler(e,t)}))},Mb.prototype.getSelectedChips=function(){if(this.chipType()&&"None"!==this.selection){for(var e={texts:[],Indexes:[],data:[],elements:[]},t=this.element.querySelectorAll("."+Db.active),i=0;i<t.length;i++){var n=t[i],n=(e.elements.push(n),Array.prototype.slice.call(this.element.querySelectorAll("."+Db.chip)).indexOf(n)),n=(e.Indexes.push(n),e.data.push(this.chips[n]),"object"==typeof this.chips[n]?this.chips[n].text||null:this.chips[n].toString());e.texts.push(n)}var o={text:e.texts[0],index:e.Indexes[0],data:e.data[0],element:e.elements[0]},o=je(o.index)?void 0:"Multiple"===this.selection?e:o}return o},Mb.prototype.wireEvent=function(e){e?(E.remove(this.element,"click",this.clickHandler),E.remove(this.element,"focusout",this.focusOutHandler),E.remove(this.element,"keydown",this.keyHandler),E.remove(this.element,"keyup",this.keyHandler)):(E.add(this.element,"click",this.clickHandler,this),E.add(this.element,"focusout",this.focusOutHandler,this),E.add(this.element,"keydown",this.keyHandler,this),E.add(this.element,"keyup",this.keyHandler,this))},Mb.prototype.keyHandler=function(e){e.target.classList.contains(Db.chip)&&("keydown"===e.type?13===e.keyCode||32===e.keyCode?this.clickHandler(e):46!==e.keyCode&&8!==e.keyCode||!this.enableDelete||this.clickHandler(e,!0):9===e.keyCode&&this.focusInHandler(e.target))},Mb.prototype.focusInHandler=function(e){e.classList.contains(Db.focused)||e.classList.add(Db.focused)},Mb.prototype.focusOutHandler=function(e){var e=z(e.target,"."+Db.chip),t=this.chipType()?this.element.querySelector("."+Db.focused):this.element.classList.contains(Db.focused)?this.element:null;e&&t&&t.classList.remove(Db.focused)},Mb.prototype.clickHandler=function(t,i){var e,n,o=this,r=(void 0===i&&(i=!1),z(t.target,"."+Db.chip));r&&(n=void 0,(n=this.chipType()?this.find(r):(e=Array.prototype.slice.call(this.element.querySelectorAll("."+Db.chip)).indexOf(r),{text:this.innerText||this.text,element:r,data:this.text,index:e})).event=t,n.cancel=!1,this.trigger("beforeClick",n,function(e){e.cancel||o.clickEventHandler(e.element,t,i)}))},Mb.prototype.clickEventHandler=function(t,e,i){var n,o,r=this;this.chipType()?(((n=this.find(t)).event=e).target.classList.contains(Db.deleteIcon)?e.target:i?t.querySelector("."+Db.deleteIcon):void 0)&&this.enableDelete?(n.cancel=!1,this.trigger("delete",n,function(e){!e.cancel&&(r.deleteHandler(e.element,e.index),r.selectionHandler(t),n.selected=e.element.classList.contains(Db.active),r.trigger("click",n),e=r.element.querySelectorAll("."+Db.chip)[e.index])&&(e.focus(),r.focusInHandler(e))})):"None"!==this.selection?(this.selectionHandler(t),n.selected=t.classList.contains(Db.active),this.trigger("click",n)):(this.focusInHandler(t),this.trigger("click",o=n)):(this.focusInHandler(t),o={text:this.innerText||this.text,element:t,data:this.text,event:e},this.trigger("click",o))},Mb.prototype.selectionHandler=function(e){var t;"Single"===this.selection?((t=this.element.querySelector("."+Db.active))&&t!==e&&(t.classList.remove(Db.active),t.setAttribute("aria-selected","false")),this.setProperties({selectedChips:null},!0)):this.setProperties({selectedChips:[]},!0),e.classList.contains(Db.active)?(e.classList.remove(Db.active),e.setAttribute("aria-selected","false")):(e.classList.add(Db.active),e.setAttribute("aria-selected","true")),this.updateSelectedChips()},Mb.prototype.updateSelectedChips=function(){for(var e=this.element.querySelectorAll("."+Db.chip),t=[],i=[],n=null,o=null,r=0;r<e.length;r++){var s=this.element.querySelectorAll("."+Db.chip)[r];if("true"===s.getAttribute("aria-selected")){if(o=s.getAttribute("data-value"),"Single"===this.selection&&s.classList.contains("e-active")){n=o||r;break}n=o?i.push(o):t.push(r)}}this.setProperties({selectedChips:"Single"===this.selection?n:o?i:t},!0)},Mb.prototype.deleteHandler=function(e,t){var i=this.find(e);this.chips.splice(t,1),this.setProperties({chips:this.chips},!0),G(e),this.trigger("deleted",i)},Mb.prototype.destroy=function(){for(var e=0;e<this.dragCollection.length;e++)this.dragCollection[e].destroy();this.dragCollection=[],this.clearTemplate(),q([this.element],[Db.chipSet,Db.chip,Db.rtl,Db.multiSelection,Db.singleSelection,Db.disabled,Db.chipWrapper,Db.iconWrapper,Db.active,Db.focused].concat(this.cssClass?this.cssClass.toString().split(" ").filter(function(e){return e}):[])),this.removeMultipleAttributes(["tabindex","role","aria-label","aria-multiselectable"],this.element),this.wireEvent(!0),this.rippleFunction(),Tb.prototype.destroy.call(this),this.element.innerHTML="",this.element.innerText=this.innerText},Mb.prototype.removeMultipleAttributes=function(e,t){e.forEach(function(e){t.removeAttribute(e)})},Mb.prototype.getPersistData=function(){return this.addOnPersist([])},Mb.prototype.getModuleName=function(){return"chip-list"},Mb.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"chips":case"text":case"avatarText":case"avatarIconCss":case"leadingIconCss":case"trailingIconCss":case"selection":case"enableDelete":case"enabled":this.refresh();break;case"cssClass":this.chipType()?this.refresh():(q([this.element],t.cssClass.toString().split(" ").filter(function(e){return e})),U([this.element],e.cssClass.toString().split(" ").filter(function(e){return e})));break;case"selectedChips":q(this.element.querySelectorAll(".e-active"),"e-active"),"Multiple"===this.selection?(this.multiSelectedChip=[],this.multiSelection(e.selectedChips),this.onSelect(this.multiSelectedChip,!0),this.updateSelectedChips()):this.onSelect(e.selectedChips,!0);break;case"enableRtl":this.setRtl();break;case"allowDragAndDrop":for(var o=0;o<this.dragCollection.length;o++)this.dragCollection[o].destroy();this.dragCollection=[],this.allowDragAndDrop&&this.enableDraggingChips();break;case"dragArea":if(this.allowDragAndDrop)for(o=0;o<this.dragCollection.length;o++)this.dragCollection[o].dragArea=this.dragArea}},Sr([e([])],Mb.prototype,"chips",void 0),Sr([e("")],Mb.prototype,"text",void 0),Sr([e("")],Mb.prototype,"avatarText",void 0),Sr([e("")],Mb.prototype,"avatarIconCss",void 0),Sr([e("")],Mb.prototype,"htmlAttributes",void 0),Sr([e("")],Mb.prototype,"leadingIconCss",void 0),Sr([e("")],Mb.prototype,"trailingIconCss",void 0),Sr([e("")],Mb.prototype,"leadingIconUrl",void 0),Sr([e("")],Mb.prototype,"trailingIconUrl",void 0),Sr([e("")],Mb.prototype,"cssClass",void 0),Sr([e(!0)],Mb.prototype,"enabled",void 0),Sr([e([])],Mb.prototype,"selectedChips",void 0),Sr([e("None")],Mb.prototype,"selection",void 0),Sr([e(!1)],Mb.prototype,"enableDelete",void 0),Sr([e(!1)],Mb.prototype,"allowDragAndDrop",void 0),Sr([e(null)],Mb.prototype,"dragArea",void 0),Sr([i()],Mb.prototype,"created",void 0),Sr([i()],Mb.prototype,"click",void 0),Sr([i()],Mb.prototype,"beforeClick",void 0),Sr([i()],Mb.prototype,"delete",void 0),Sr([i()],Mb.prototype,"deleted",void 0),Sr([i()],Mb.prototype,"dragStart",void 0),Sr([i()],Mb.prototype,"dragging",void 0),Sr([i()],Mb.prototype,"dragStop",void 0),Eb=Sr([Bt],Mb));function Mb(e,t){e=Tb.call(this,e,t)||this;return e.multiSelectedChip=[],e}function kb(){}Pb=function(e,t){return(Pb=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])}))(e,t)};var Pb,Bb,Fb,Lr=function(e,t){function i(){this.constructor=e}Pb(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Xr=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Lb="e-fab-fixed",Rb="e-fab-top",Ob="e-fab-bottom",Nb="e-fab-right",Vb="e-fab-left",_b="e-fab-middle",Hb="e-fab-center",zb=((Zr=Bb=Bb||{}).TopLeft="TopLeft",Zr.TopCenter="TopCenter",Zr.TopRight="TopRight",Zr.MiddleLeft="MiddleLeft",Zr.MiddleCenter="MiddleCenter",Zr.MiddleRight="MiddleRight",Zr.BottomLeft="BottomLeft",Zr.BottomCenter="BottomCenter",Zr.BottomRight="BottomRight",Lr(jb,Fb=zv),jb.prototype.render=function(){Fb.prototype.render.call(this),this.initializeFab()},jb.prototype.preRender=function(){Fb.prototype.preRender.call(this),this.element.id||(this.element.id=D("e-"+this.getModuleName()))},jb.prototype.getPersistData=function(){return Fb.prototype.getPersistData.call(this),this.addOnPersist([])},jb.prototype.getModuleName=function(){return"fab"},jb.prototype.initializeFab=function(){this.element.classList.add("e-"+Fb.prototype.getModuleName.call(this)),this.checkTarget(),this.setPosition(),this.setVisibility()},jb.prototype.checkTarget=function(){this.isFixed=!0,this.target&&(this.targetEle="string"==typeof this.target?ge(this.target):this.target,this.targetEle)&&(this.isFixed=!1,this.targetEle.appendChild(this.element)),this.element.classList[this.isFixed?"add":"remove"](Lb)},jb.prototype.setVisibility=function(){this.element.classList[this.visible?"remove":"add"]("e-fab-hidden")},jb.prototype.setPosition=function(){this.element.classList.add(-1!==["BottomLeft","BottomCenter","BottomRight"].indexOf(this.position)?Ob:Rb);var e=-1!==["TopRight","MiddleRight","BottomRight"].indexOf(this.position);this.element.classList.add(!this.enableRtl&&!e||this.enableRtl&&e?Vb:Nb),-1!==["MiddleLeft","MiddleRight","MiddleCenter"].indexOf(this.position)&&this.element.classList.add(_b),-1!==["TopCenter","BottomCenter","MiddleCenter"].indexOf(this.position)&&this.element.classList.add(Hb)},jb.prototype.clearPosition=function(){this.element.classList.remove(Rb,Ob,_b),this.element.classList.remove(Nb,Vb,Hb)},jb.prototype.refreshPosition=function(){},jb.prototype.destroy=function(){Fb.prototype.destroy.call(this),this.element.classList.remove("e-"+Fb.prototype.getModuleName.call(this),Lb),this.clearPosition()},jb.prototype.onPropertyChanged=function(e,t){Fb.prototype.onPropertyChanged.call(this,e,t);for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"enableRtl":case"position":this.clearPosition(),this.setPosition();break;case"visible":this.setVisibility();break;case"target":this.checkTarget(),this.setPosition();break;case"currencyCode":this.refresh()}},Xr([e("BottomRight")],jb.prototype,"position",void 0),Xr([e("")],jb.prototype,"target",void 0),Xr([e(!0)],jb.prototype,"visible",void 0),Xr([e(!0)],jb.prototype,"isPrimary",void 0),Xr([Bt],jb));function jb(e,t){return Fb.call(this,e,t)||this}Wb=function(e,t){return(Wb=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])}))(e,t)};var Wb,Qb,Ub,qb,Gb,Yb,i0=function(e,t){function i(){this.constructor=e}Wb(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},o=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Xb=["TopLeft","TopCenter","TopRight"],Kb=["BottomLeft","BottomCenter","BottomRight"],Jb=["TopLeft","MiddleLeft","BottomLeft"],Zb=["TopRight","MiddleRight","BottomRight"],$b="e-speeddial-hidden",ew="e-speeddial-fixed",tw="e-speeddial",iw="e-speeddial-hover-open",nw="e-speeddial-radial",ow="e-speeddial-linear",rw="e-speeddial-template",sw="e-speeddial-popup",aw="e-speeddial-ul",lw="e-speeddial-li",hw="e-speeddial-li-active",dw="e-speeddial-li-icon",pw="e-disabled",cw="e-speeddial-vert-bottom",uw="e-speeddial-vert-right",gw="e-speeddial-horz-top",mw="e-speeddial-horz-left",fw="e-speeddial-horz-right",yw="e-speeddial-overflow",vw="e-speeddial-vert-overflow",bw="e-speeddial-horz-overflow",ww="e-speeddial-top",Cw="e-speeddial-bottom",Sw="e-speeddial-right",Aw="e-speeddial-left",xw="e-speeddial-middle",Iw="e-speeddial-center",Tw="e-speeddial-top-left",Ew="e-speeddial-bottom-right",Dw="e-speeddial-top-right",Mw="e-speeddial-bottom-left",kw="--speeddialVertDist",Pw="--speeddialHorzDist",Bw="--speeddialRadialOffset",Fw="--speeddialRadialMinHeight",Lw="--speeddialRadialMinWidth",Rw="--speeddialOverflowLimit",Ow="--speeddialRadialHorzDist",Sr=((tn=Qb=Qb||{}).Linear="Linear",tn.Radial="Radial",(s0=Ub=Ub||{}).Up="Up",s0.Down="Down",s0.Right="Right",s0.Left="Left",s0.Auto="Auto",(h0=qb=qb||{}).Clockwise="Clockwise",h0.AntiClockwise="AntiClockwise",h0.Auto="Auto",(Ir=Gb=Gb||{}).Fade="Fade",Ir.FadeZoom="FadeZoom",Ir.FlipLeftDown="FlipLeftDown",Ir.FlipLeftUp="FlipLeftUp",Ir.FlipRightDown="FlipRightDown",Ir.FlipRightUp="FlipRightUp",Ir.FlipXDown="FlipXDown",Ir.FlipXUp="FlipXUp",Ir.FlipYLeft="FlipYLeft",Ir.FlipYRight="FlipYRight",Ir.SlideBottom="SlideBottom",Ir.SlideLeft="SlideLeft",Ir.SlideRight="SlideRight",Ir.SlideTop="SlideTop",Ir.Zoom="Zoom",Ir.None="None",i0(Nw,Yb=n),o([e("Fade")],Nw.prototype,"effect",void 0),o([e(400)],Nw.prototype,"duration",void 0),o([e(0)],Nw.prototype,"delay",void 0),Nw);function Nw(){return null!==Yb&&Yb.apply(this,arguments)||this}i0(_w,Vw=n),o([e("Auto")],_w.prototype,"direction",void 0),o([e(-1)],_w.prototype,"endAngle",void 0),o([e("100px")],_w.prototype,"offset",void 0),o([e(-1)],_w.prototype,"startAngle",void 0);var Vw,Zr=_w;function _w(){return null!==Vw&&Vw.apply(this,arguments)||this}i0(zw,Hw=n),o([e("")],zw.prototype,"iconCss",void 0),o([e("")],zw.prototype,"id",void 0),o([e("")],zw.prototype,"text",void 0),o([e("")],zw.prototype,"title",void 0),o([e(!1)],zw.prototype,"disabled",void 0);var Hw,Lr=zw;function zw(){return null!==Hw&&Hw.apply(this,arguments)||this}i0(Ww,jw=Ji),Ww.prototype.render=function(){this.initialize()},Ww.prototype.preRender=function(){this.keyConfigs={space:"space",enter:"enter",end:"end",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",esc:"escape"},this.validateDirection()},Ww.prototype.getPersistData=function(){return this.addOnPersist([])},Ww.prototype.getModuleName=function(){return"speed-dial"},Ww.prototype.initialize=function(){this.element.id||(this.element.id=D("e-"+this.getModuleName())),this.fab=new zb({content:this.content,cssClass:this.cssClass?tw+" "+this.cssClass:tw,disabled:this.disabled,enablePersistence:this.enablePersistence,enableRtl:this.enableRtl,iconCss:this.openIconCss,iconPosition:this.iconPosition,position:this.position,target:this.target,visible:this.visible,isPrimary:this.isPrimary}),this.fab.appendTo(this.element),(0<this.items.length||this.popupTemplate)&&this.createPopup(),this.wireEvents()},Ww.prototype.wireEvents=function(){E.add(window,"resize",this.resizeHandler,this),E.add(document.body,"click",this.bodyClickHandler,this),this.opensOnHover?this.wireFabHover():this.wireFabClick()},Ww.prototype.wirePopupEvents=function(){this.removeRippleEffect=Ht(this.popupEle,{selector:"."+dw}),this.keyboardModule=new bn(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.popupKeyboardModule=new bn(this.popupEle,{keyAction:this.popupKeyActionHandler.bind(this),keyConfigs:{esc:"escape"},eventName:"keydown"}),this.documentKeyboardModule=new bn(document.body,{keyAction:this.popupKeyActionHandler.bind(this),keyConfigs:{enter:"enter",space:"space"},eventName:"keydown"}),E.add(this.popupEle,"click",this.popupClick,this),E.add(this.popupEle,"mouseleave",this.popupMouseLeaveHandle,this)},Ww.prototype.wireFabClick=function(){E.add(this.fab.element,"click",this.fabClick,this)},Ww.prototype.wireFabHover=function(){this.popupEle.classList.add(iw),E.add(this.fab.element,"mouseover",this.mouseOverHandle,this),E.add(this.element,"mouseleave",this.mouseLeaveHandle,this)},Ww.prototype.createPopup=function(){var e=sw+" "+$b,e=this.enableRtl?e+" e-rtl":e;e=this.cssClass?e+" "+this.cssClass:e,this.popupEle=this.createElement("div",{className:e,id:this.element.id+"_popup"}),this.element.insertAdjacentElement("afterend",this.popupEle),pt(this.element,{"aria-expanded":"false","aria-haspopup":"true","aria-controls":this.popupEle.id}),this.setPopupContent(),this.modal&&this.createOverlay(),this.checkTarget(),this.setPositionProps(),this.wirePopupEvents()},Ww.prototype.createOverlay=function(){this.overlayEle=this.createElement("div",{id:this.element.id+"_overlay",className:("e-speeddial-overlay"+(this.isMenuOpen?"":" "+$b)+" "+this.cssClass).trim()}),this.element.insertAdjacentElement("beforebegin",this.overlayEle)},Ww.prototype.popupClick=function(){this.isControl=!0},Ww.prototype.bodyClickHandler=function(e){this.isControl?this.isControl=!1:this.isMenuOpen&&this.hidePopupEle(e)},Ww.prototype.fabClick=function(e){this.isControl=!0,this.isMenuOpen?this.hidePopupEle(e):this.showPopupEle(e)},Ww.prototype.setPopupContent=function(){this.popupEle.classList.remove(nw,ow,rw),this.popupTemplate?(this.popupEle.classList.add(rw),this.appendTemplate()):(this.popupEle.classList.add("Radial"===this.mode?nw:ow),this.createUl(),this.createItems()),this.renderReactTemplates()},Ww.prototype.appendTemplate=function(){var e=this.createElement("div",{className:"e-speeddial-template-container"}),t=(ht([e],this.popupEle),this.getTemplateString(this.popupTemplate));ht(t({},this,"fabPopupTemplate",this.element.id+"popupTemplate",this.isStringTemplate),e)},Ww.prototype.getTemplateString=function(t){var i="";try{var e=ge(t),i="function"!=typeof t&&e?"SCRIPT"===e.tagName?e.innerHTML:e.outerHTML:t}catch(e){i=t}return oo(i)},Ww.prototype.updatePopupTemplate=function(){if(this.popupEle){for(this.popupEle.querySelector("."+lw)&&(this.clearItems(),this.popupEle.classList.remove(nw,ow),this.popupEle.classList.add(rw));this.popupEle.firstElementChild;)ue(this.popupEle.firstElementChild);this.setPopupContent(),this.updatePositionProperties()}else this.createPopup()},Ww.prototype.createUl=function(){var e=this.createElement("ul",{className:aw,id:this.element.id+"_ul",attrs:{role:"menu"}});this.popupEle.appendChild(e)},Ww.prototype.createItems=function(){for(var n=this,o=(this.focusedIndex=-1,this.popupEle.querySelector("."+aw)),r=this,e=0;e<this.items.length;e++)!function(e){var t=r.items[parseInt(e.toString(),10)],e=r.createElement("li",{className:lw+" "+$b,id:t.id||r.element.id+"_li_"+e,attrs:{role:"menuitem"}}),i=(t.text&&e.setAttribute("aria-label",t.text),r.itemTemplate?ht(r.getTemplateString(r.itemTemplate)(t,r,"fabItemTemplate",r.element.id+"itemTemplate",r.isStringTemplate),e):(t.iconCss&&(i=r.createElement("span",{className:dw+" "+t.iconCss}),e.appendChild(i)),t.text&&((i=r.createElement("span",{className:"e-speeddial-li-text"})).innerText=t.text,e.appendChild(i),t.iconCss||e.classList.add("e-speeddial-text-li"))),t.disabled?(e.classList.add(pw),e.setAttribute("aria-disabled","true")):E.add(e,"click",function(e){return n.triggerItemClick(e,t)},r),t.title&&e.setAttribute("title",t.title),{element:e,item:t});r.trigger("beforeItemRender",i,function(e){o.appendChild(e.element)})}(e)},Ww.prototype.setRTL=function(){this.popupEle.classList[this.enableRtl?"add":"remove"]("e-rtl"),this.clearHorizontalPosition(),this.popupTemplate||"Radial"===this.mode?(this.popupTemplate||"Radial"!==this.mode||this.setRadialPosition(),this.setHorizontalPosition()):this.setLinearHorizontalPosition()},Ww.prototype.checkTarget=function(){this.isFixed=!0,this.target&&(this.targetEle="string"==typeof this.target?ge(this.target):this.target,this.targetEle)&&(this.targetEle.appendChild(this.element),this.isFixed=!1),this.isFixed?(this.popupEle&&this.popupEle.classList.add(ew),this.overlayEle&&this.overlayEle.classList.add(ew)):(this.popupEle&&this.popupEle.classList.remove(ew),this.overlayEle&&this.overlayEle.classList.remove(ew))},Ww.prototype.setVisibility=function(e){this.setProperties({visible:e},!0),this.fab.setProperties({visible:e})},Ww.prototype.popupMouseLeaveHandle=function(e){var t=e.relatedTarget;!this.opensOnHover||t.classList.contains(tw)||z(t,"."+tw)||this.hidePopupEle(e)},Ww.prototype.mouseOverHandle=function(e){this.showPopupEle(e)},Ww.prototype.mouseLeaveHandle=function(e){var t=e.relatedTarget;t.classList.contains(sw)||z(t,"."+sw)||this.hidePopupEle(e)},Ww.prototype.popupKeyActionHandler=function(e){switch(e.action){case"esc":this.hidePopupEle(e);break;case"enter":case"space":this.isMenuOpen&&e.target!==this.element&&this.hidePopupEle(e)}},Ww.prototype.keyActionHandler=function(e){switch(e.preventDefault(),e.action){case"enter":case"space":this.isMenuOpen?-1!==this.focusedIndex?this.triggerItemClick(e,this.items[this.focusedIndex]):this.hidePopupEle(e):this.showPopupEle(e);break;case"esc":this.hidePopupEle(e);break;default:if(!this.popupTemplate&&this.isMenuOpen)switch(e.action){case"end":this.focusLastElement();break;case"home":this.focusFirstElement();break;case"moveRight":"Radial"===this.mode?this.focusLeftRightElement(!1):this.focusLinearElement(!1);break;case"moveDown":"Radial"===this.mode?this.focusUpDownElement(!1):this.focusLinearElement(!1);break;case"moveLeft":"Radial"===this.mode?this.focusLeftRightElement(!0):this.focusLinearElement(!0);break;case"moveUp":"Radial"===this.mode?this.focusUpDownElement(!0):this.focusLinearElement(!0)}}},Ww.prototype.focusFirstElement=function(){for(var e=ct("."+lw,this.popupEle),t=0;e[parseInt(t.toString(),10)].classList.contains(pw);)if(++t>e.length-1)return;this.setFocus(t,e[parseInt(t.toString(),10)])},Ww.prototype.focusLastElement=function(){for(var e=ct("."+lw,this.popupEle),t=e.length-1;e[parseInt(t.toString(),10)].classList.contains(pw);)if(--t<0)return;this.setFocus(t,e[parseInt(t.toString(),10)])},Ww.prototype.focusLinearElement=function(e){(this.popupEle.classList.contains(cw)||this.popupEle.classList.contains(fw))!==e?this.focusPrevElement():this.focusNextElement()},Ww.prototype.focusLeftRightElement=function(e){var t=-1!==["TopLeft","TopCenter","TopRight","MiddleLeft"].indexOf(this.position);t&&e!==this.isClock||!t&&e===this.isClock?this.focusPrevElement():this.focusNextElement()},Ww.prototype.focusUpDownElement=function(e){var t=-1!==["TopRight","MiddleRight","BottomRight","BottomCenter"].indexOf(this.position);t&&e!==this.isClock||!t&&e===this.isClock?this.focusPrevElement():this.focusNextElement()},Ww.prototype.focusPrevElement=function(){var e=ct("."+lw,this.popupEle),t=this.focusedIndex;do{if(--t<0)return void this.setFocus(-1)}while(e[parseInt(t.toString(),10)].classList.contains(pw));this.setFocus(t,e[parseInt(t.toString(),10)])},Ww.prototype.focusNextElement=function(){var e=ct("."+lw,this.popupEle),t=this.focusedIndex;do{if(++t>e.length-1)return}while(e[parseInt(t.toString(),10)].classList.contains(pw));this.setFocus(t,e[parseInt(t.toString(),10)])},Ww.prototype.setFocus=function(e,t){this.removeFocus(),t&&t.classList.add(hw),this.focusedIndex=e},Ww.prototype.removeFocus=function(){var e=ge("."+hw,this.popupEle);e&&e.classList.remove(hw)},Ww.prototype.updatePositionProperties=function(){this.hidePopupEle(),this.clearPosition(),this.validateDirection(),this.setPositionProps()},Ww.prototype.setPositionProps=function(){this.popupTemplate?this.setPosition():"Radial"===this.mode?(this.setRadialPosition(),this.setPosition()):(this.setLinearPosition(),this.setMaxSize())},Ww.prototype.validateDirection=function(){switch(this.direction){case"Up":this.actualLinDirection=-1!==Xb.indexOf(this.position)?"Auto":"Up";break;case"Down":this.actualLinDirection=-1!==Kb.indexOf(this.position)?"Auto":"Down";break;case"Right":this.actualLinDirection=-1!==Zb.indexOf(this.position)?"Auto":"Right";break;case"Left":this.actualLinDirection=-1!==Jb.indexOf(this.position)?"Auto":"Left";break;default:this.actualLinDirection="Auto"}this.isVertical=!("Left"===this.actualLinDirection||"Right"===this.actualLinDirection)},Ww.prototype.setMaxSize=function(){var e=this.element.offsetTop,t=this.element.offsetLeft,i=(this.isFixed?window.innerHeight:this.targetEle.clientHeight)-this.element.offsetTop-this.element.offsetHeight,n=(this.isFixed?window.innerWidth:this.targetEle.clientWidth)-this.element.offsetLeft-this.element.offsetWidth,o=0,r=this.popupEle.querySelector("."+aw);this.isVertical?(o="Up"===this.actualLinDirection||"Auto"===this.actualLinDirection&&-1===Xb.indexOf(this.position)?e:i)<r.offsetHeight&&(this.popupEle.classList.add(yw,vw),r.style.setProperty(Rw,o+"px")):(o=this.enableRtl?"Right"===this.direction?t:n:"Right"===this.direction?n:t)<r.offsetWidth&&(this.popupEle.classList.add(yw,bw),r.style.setProperty(Rw,o+"px"))},Ww.prototype.setLinearPosition=function(){var e=0,t="Down"===this.actualLinDirection||"Auto"===this.actualLinDirection&&-1!==Xb.indexOf(this.position)||!this.isVertical&&-1===Kb.indexOf(this.position),i=this.element.offsetHeight/2,n=-1!==["MiddleRight","MiddleCenter","MiddleLeft"].indexOf(this.position);t?(e=this.element.offsetTop+(this.isVertical?this.element.offsetHeight:0),n&&("Right"!==this.actualLinDirection&&"Left"!==this.actualLinDirection||(e=this.element.offsetTop-i),"Down"===this.actualLinDirection)&&(e-=i),this.isVertical||this.popupEle.classList.add(gw)):(e=(e=(this.isFixed?window.document.documentElement:this.targetEle).clientHeight)-this.element.offsetTop-(this.isVertical?0:this.element.offsetHeight),!n||"Auto"!==this.actualLinDirection&&"Up"!==this.actualLinDirection||(e+=i),this.isVertical&&this.popupEle.classList.add(cw)),this.popupEle.classList.add(t?ww:Cw),this.popupEle.style.setProperty(kw,e+"px"),this.setLinearHorizontalPosition()},Ww.prototype.setLinearHorizontalPosition=function(){"Right"===this.actualLinDirection||this.isVertical&&-1===Zb.indexOf(this.position)?(this.enableRtl?this.setRight():this.setLeft(),this.isVertical||this.popupEle.classList.add(mw)):(this.enableRtl?this.setLeft():this.setRight(),this.popupEle.classList.add(this.isVertical?uw:fw))},Ww.prototype.setLeft=function(){var e=this.element.offsetWidth/2,t=-1!==["TopCenter","MiddleCenter","BottomCenter"].indexOf(this.position),i=this.element.offsetLeft+(this.isVertical?0:this.element.offsetWidth);t&&(i="Auto"===this.actualLinDirection||"Down"===this.actualLinDirection||"Up"===this.actualLinDirection?this.element.offsetLeft-e:"Right"===this.actualLinDirection?this.element.offsetLeft+e:i+e),this.popupEle.style.setProperty(Pw,i+"px"),this.popupEle.classList.add(Aw)},Ww.prototype.setRight=function(){var e=this.element.offsetWidth/2,t=-1!==["TopCenter","MiddleCenter","BottomCenter"].indexOf(this.position),i=(i=(this.isFixed?window.document.documentElement:this.targetEle).clientWidth)-this.element.offsetLeft-(this.isVertical?this.element.offsetWidth:0);t&&"Left"===this.actualLinDirection&&(i+=e),this.popupEle.classList.contains("e-rtl")&&t&&(i-=e),this.popupEle.style.setProperty(Pw,i+"px"),this.popupEle.classList.add(Sw)},Ww.prototype.setPosition=function(){var e;-1!==["MiddleLeft","MiddleRight","MiddleCenter"].indexOf(this.position)&&(this.popupEle.classList.add(xw),e=((this.isFixed?window.innerHeight:this.targetEle.clientHeight)-this.popupEle.offsetHeight)/2,this.popupEle.style.setProperty(kw,e+"px")),this.popupEle.classList.add(-1===Kb.indexOf(this.position)?ww:Cw),this.setHorizontalPosition()},Ww.prototype.setHorizontalPosition=function(){-1!==["TopCenter","BottomCenter","MiddleCenter"].indexOf(this.position)&&(this.popupEle.classList.add(Iw),e=((this.isFixed?window.innerWidth:this.targetEle.clientWidth)-this.popupEle.offsetWidth)/2,this.popupEle.style.setProperty(Pw,e+"px"));var e=-1!==Zb.indexOf(this.position);this.popupEle.classList.add(!this.enableRtl&&!e||this.enableRtl&&e?Aw:Sw)},Ww.prototype.setCustomRadialPosition=function(){var e,t=document.documentElement.clientWidth,i=document.documentElement.clientHeight;-1!==["TopLeft","BottomLeft","MiddleLeft"].indexOf(this.position)&&(e=void 0,e=this.enableRtl?this.isFixed?t-(this.element.offsetLeft+this.element.offsetWidth):this.targetEle.clientWidth-(this.element.offsetLeft+this.element.offsetWidth):this.element.offsetLeft,this.popupEle.style.setProperty(Ow,e+"px")),-1!==["TopLeft","TopCenter","TopRight"].indexOf(this.position)&&(this.popupEle.style.top=this.element.offsetTop+"px"),-1!==["TopRight","BottomRight","MiddleRight"].indexOf(this.position)&&(e=void 0,e=this.enableRtl?this.element.offsetLeft:this.isFixed?t-(this.element.offsetLeft+this.element.offsetWidth):this.targetEle.clientWidth-(this.element.offsetLeft+this.element.offsetWidth),this.popupEle.style.setProperty(Ow,e+"px")),-1!==["BottomLeft","BottomCenter","BottomRight"].indexOf(this.position)&&(this.isFixed?this.popupEle.style.bottom=i-(this.element.offsetTop+this.element.offsetHeight)+"px":this.popupEle.style.bottom=this.targetEle.clientHeight-(this.element.offsetTop+this.element.offsetHeight)+"px"),-1!==["TopCenter","MiddleCenter","BottomCenter"].indexOf(this.position)&&(e=void 0,e=this.enableRtl?this.isFixed?t-(this.element.offsetLeft+this.element.offsetWidth)-this.popupEle.offsetWidth/2:(i=this.targetEle.clientWidth,t=this.popupEle.offsetWidth,i-(this.element.offsetLeft+this.element.offsetWidth)-t/2):this.element.offsetLeft-this.popupEle.offsetWidth/2,this.popupEle.style.setProperty(Ow,e+"px")),-1!==["MiddleLeft","MiddleCenter","MiddleRight"].indexOf(this.position)&&(this.popupEle.style.top=this.element.offsetTop-this.popupEle.offsetHeight/2+"px")},Ww.prototype.setRadialPosition=function(){this.setRadialCorner();for(var e=this.getActualRange(),t=(this.isClock="Clockwise"===e.direction,T(e.offset)),i=ct("."+lw,this.popupEle),t=(this.popupEle.style.setProperty(Bw,t),this.popupEle.style.setProperty(Fw,i[0].offsetHeight+"px"),this.popupEle.style.setProperty(Lw,i[0].offsetWidth+"px"),Math.abs(e.endAngle-e.startAngle)),n=t/(360===t||0===t?i.length:i.length-1),o=0;o<i.length;o++){var r=i[parseInt(o.toString(),10)],s=e.startAngle,s=this.isClock?s+n*o:s-n*o;s%=360,r.style.setProperty("--speeddialRadialAngle",s+"deg")}},Ww.prototype.setRadialCorner=function(){-1!==["TopLeft","TopCenter","MiddleLeft","MiddleCenter"].indexOf(this.position)&&this.popupEle.classList.add(this.enableRtl?Dw:Tw),-1!==["TopRight","TopCenter","MiddleRight","MiddleCenter"].indexOf(this.position)&&this.popupEle.classList.add(this.enableRtl?Tw:Dw),-1!==["BottomLeft","BottomCenter","MiddleLeft","MiddleCenter"].indexOf(this.position)&&this.popupEle.classList.add(this.enableRtl?Ew:Mw),-1!==["BottomRight","BottomCenter","MiddleRight","MiddleCenter"].indexOf(this.position)&&this.popupEle.classList.add(this.enableRtl?Mw:Ew)},Ww.prototype.getActualRange=function(){var e,t={offset:this.radialSettings.offset},i=this.radialSettings.startAngle,n=this.radialSettings.endAngle,o=!1;switch(this.position){case"TopLeft":case"TopRight":"TopLeft"===this.position!==this.enableRtl?(o="Clockwise"===this.radialSettings.direction,this.checkAngleRange(i,n,t,o,0,90,!1)):(o="AntiClockwise"!==this.radialSettings.direction,this.checkAngleRange(i,n,t,o,90,180,!1));break;case"TopCenter":o="Clockwise"===this.radialSettings.direction,this.checkAngleRange(i,n,t,o,0,180,!1);break;case"MiddleLeft":case"MiddleRight":"MiddleLeft"===this.position!==this.enableRtl?(o="Clockwise"===this.radialSettings.direction,i=(i=je(i)||i<0||360<i||90<i&&i<270?o?270:90:i)<91?i+360:i,n=(n=je(n)||n<0||360<n||90<n&&n<270?o?90:270:n)<91?n+360:n,t.startAngle=(e=o&&n<i||!o&&i<n)?n:i,t.endAngle=e?i:n):(o="AntiClockwise"!==this.radialSettings.direction,this.checkAngleRange(i,n,t,o,90,270,!1));break;case"MiddleCenter":o="AntiClockwise"!==this.radialSettings.direction,i=je(i)||i<0||360<i?o?0:360:i,n=je(n)||n<0||360<n?o?360:0:n,t.startAngle=!o&&i<=n?i+360:i,t.endAngle=o&&n<=i?n+360:n;break;case"BottomLeft":case"BottomRight":"BottomLeft"===this.position!==this.enableRtl?(o="Clockwise"===this.radialSettings.direction,this.checkAngleRange(i,n,t,o,270,360,!0)):(o="AntiClockwise"!==this.radialSettings.direction,this.checkAngleRange(i,n,t,o,180,270,!0));break;case"BottomCenter":o="AntiClockwise"!==this.radialSettings.direction,this.checkAngleRange(i,n,t,o,180,360,!0)}return t.direction=o?"Clockwise":"AntiClockwise",t},Ww.prototype.checkAngleRange=function(e,t,i,n,o,r,s){e=this.checkAngle(e,n,o,r,s),t=this.checkAngle(t,!n,o,r,s);o=n&&t<e||!n&&e<t;i.startAngle=o?t:e,i.endAngle=o?e:t},Ww.prototype.checkAngle=function(e,t,i,n,o){return!(je(e)||e<0||360<e)&&i<=(e=o?0===e?360:e:360===e?0:e)&&e<=n?e:t?i:n},Ww.prototype.clearPosition=function(){this.popupEle.style.removeProperty(Bw),this.popupEle.style.removeProperty(Fw),this.popupEle.style.removeProperty(Lw),this.popupEle.classList.remove(Tw,Dw,Mw,Ew),this.popupEle.classList.remove(ww,Cw,xw),this.popupEle.classList.remove(gw,cw),this.popupEle.style.removeProperty(kw),this.clearHorizontalPosition(),this.clearOverflow()},Ww.prototype.clearHorizontalPosition=function(){this.popupEle.style.removeProperty(Pw),this.popupEle.style.removeProperty(Ow),this.popupEle.style.removeProperty("top"),this.popupEle.style.removeProperty("bottom"),this.popupEle.classList.remove(Sw,Aw,Iw),this.popupEle.classList.remove(uw,mw,fw)},Ww.prototype.clearOverflow=function(){this.popupEle.classList.remove(yw,vw,bw),this.popupEle.style.removeProperty(Rw)},Ww.prototype.hidePopupEle=function(e){var a=this;this.popupEle&&this.isMenuOpen&&(e={element:this.popupEle,event:e,cancel:!1},this.trigger("beforeClose",e,function(e){var n,o,r,s;e.cancel||("None"!==a.animation.effect?(n={name:a.animation.effect+"Out",timingFunction:"easeOut"},o=a.popupTemplate?[a.popupEle.firstElementChild]:ct("."+lw,a.popupEle),r=a.animation.duration/(o.length+1),n.duration=2*r,(s=function(e){var t,i=o[parseInt(e.toString(),10)];n.delay=e===o.length-1?a.animation.delay:0,n.begin=function(){e===o.length-1&&a.startHide()},n.end=function(){i.classList.add($b),0===e&&a.endHide()},new Vt(n).animate(i),0!==e&&(t=e-1,setTimeout(function(){s(t)},r))})(o.length-1)):(a.startHide(),a.popupTemplate||ct("."+lw,a.popupEle).forEach(function(e){e.classList.add($b)}),a.endHide()))}))},Ww.prototype.startHide=function(){this.element.setAttribute("aria-expanded","false"),this.removeFocus(),this.isMenuOpen=!1},Ww.prototype.endHide=function(){this.fab.setProperties({iconCss:this.openIconCss}),this.popupEle.classList.add($b),this.popupTemplate&&this.setVisibility(!0),this.toggleOverlay(),this.popupTemplate&&this.popupEle.removeAttribute("tabindex"),this.trigger("onClose",{element:this.popupEle})},Ww.prototype.showPopupEle=function(e){var a=this;this.popupEle&&!this.isMenuOpen&&(this.popupTemplate||"Radial"===this.mode?this.setCustomRadialPosition():this.setLinearPosition(),e={element:this.popupEle,event:e,cancel:!1},this.trigger("beforeOpen",e,function(e){var n,o,r,s;e.cancel||("None"!==a.animation.effect||"Enable"===Ut&&"None"===a.animation.effect?("Enable"===Ut&&"None"===a.animation.effect&&(a.animation.effect="Fade"),"Enable"===Ut&&0===a.animation.duration&&(a.animation.duration=400),n={name:a.animation.effect+"In",timingFunction:"easeIn"},o=a.popupTemplate?[a.popupEle.firstElementChild]:ct("."+lw,a.popupEle),r=a.animation.duration/(o.length+1),n.duration=2*r,(s=function(e){var t,i=o[parseInt(e.toString(),10)];n.delay=0===e?a.animation.delay:0,n.begin=function(){0===e&&a.startShow(),i.classList.remove($b)},n.end=function(){e===o.length-1&&a.endShow()},new Vt(n).animate(i),e!==o.length-1&&(t=e+1,setTimeout(function(){s(t)},r))})(0)):(a.startShow(),a.popupTemplate||ct("."+lw,a.popupEle).forEach(function(e){e.classList.remove($b)}),a.endShow()))}))},Ww.prototype.startShow=function(){this.element.setAttribute("aria-expanded","true"),this.isMenuOpen=!0,this.toggleOverlay(),this.popupEle.classList.remove($b),this.popupTemplate&&this.setVisibility(!1)},Ww.prototype.endShow=function(){this.closeIconCss&&this.fab.setProperties({iconCss:this.closeIconCss}),this.popupTemplate&&(this.popupEle.setAttribute("tabindex","1"),this.popupEle.focus()),this.trigger("onOpen",{element:this.popupEle})},Ww.prototype.toggleOverlay=function(){this.overlayEle&&this.overlayEle.classList[this.isMenuOpen?"remove":"add"]($b)},Ww.prototype.removeOverlayEle=function(){this.overlayEle&&(ue(this.overlayEle),this.overlayEle=void 0)},Ww.prototype.updatePopupItems=function(){this.popupEle?(this.hidePopupEle(),this.clearItems(),this.createItems(),this.updatePositionProperties()):this.createPopup()},Ww.prototype.handleResize=function(e){this.popupEle&&(this.hidePopupEle(e),this.clearOverflow(),this.setPositionProps())},Ww.prototype.triggerItemClick=function(e,t){var i=(i=e.target).classList.contains(lw)?i:z(i,"."+lw);this.trigger("clicked",{element:i,item:t,event:e}),this.hidePopupEle(e)},Ww.prototype.show=function(){this.showPopupEle()},Ww.prototype.hide=function(){this.hidePopupEle()},Ww.prototype.refreshPosition=function(){this.resizeHandler()},Ww.prototype.resizeHandler=function(e){this.handleResize(e)},Ww.prototype.clearItems=function(){ct("."+lw,this.popupEle).forEach(function(e){ue(e)})},Ww.prototype.unwireEvents=function(){E.remove(window,"resize",this.resizeHandler),E.remove(document.body,"click",this.bodyClickHandler),this.opensOnHover?this.unwireFabHover():this.unwireFabClick()},Ww.prototype.unwireFabClick=function(){E.remove(this.fab.element,"click",this.fabClick)},Ww.prototype.unwireFabHover=function(){this.popupEle.classList.remove(iw),E.remove(this.fab.element,"mouseover",this.mouseOverHandle),E.remove(this.element,"mouseleave",this.mouseLeaveHandle)},Ww.prototype.unwirePopupEvents=function(){Gt&&this.removeRippleEffect(),this.removeRippleEffect=null,this.keyboardModule.destroy(),this.popupKeyboardModule.destroy(),this.documentKeyboardModule.destroy(),this.keyboardModule=null,this.popupKeyboardModule=null,this.documentKeyboardModule=null,E.remove(this.popupEle,"click",this.popupClick),E.remove(this.popupEle,"mouseleave",this.popupMouseLeaveHandle)},Ww.prototype.destroy=function(){var t=this;jw.prototype.destroy.call(this),this.unwireEvents(),["aria-expanded","aria-haspopup","aria-controls"].forEach(function(e){t.element.removeAttribute(e)}),this.popupEle&&(this.unwirePopupEvents(),ue(this.popupEle),this.popupEle=void 0),this.removeOverlayEle(),this.fab.destroy(),this.fab=void 0},Ww.prototype.onPropertyChanged=function(e,t){for(var i=["content","cssClass","disabled","enablePersistence","enableRtl","iconPosition","position","target","template","title","visible","isPrimary"],n=Pe({},e),o=0,r=Object.keys(n);o<r.length;o++){var s=r[o];i.indexOf(s)<0&&b(n,s)}this.fab.setProperties(n);for(var a=0,l=Object.keys(e);a<l.length;a++)switch(s=l[a]){case"cssClass":this.popupEle&&(t.cssClass&&q(this.overlayEle?[this.popupEle,this.overlayEle]:[this.popupEle],t.cssClass.split(/\s+/).filter(function(e){return 0<e.length})),e.cssClass)&&U(this.overlayEle?[this.popupEle,this.overlayEle]:[this.popupEle],e.cssClass.split(/\s+/).filter(function(e){return 0<e.length}));break;case"visible":case"disabled":this.hide();break;case"enableRtl":this.popupEle&&this.setRTL();break;case"openIconCss":this.isMenuOpen||this.fab.setProperties({iconCss:this.openIconCss});break;case"closeIconCss":this.isMenuOpen&&this.fab.setProperties({iconCss:this.closeIconCss});break;case"position":this.popupEle&&this.updatePositionProperties();break;case"direction":this.popupEle&&!this.popupTemplate&&this.updatePositionProperties();break;case"popupTemplate":this.updatePopupTemplate();break;case"target":this.hidePopupEle(),this.checkTarget(),this.overlayEle&&this.element.insertAdjacentElement("beforebegin",this.overlayEle),this.popupEle&&(this.element.insertAdjacentElement("afterend",this.popupEle),this.updatePositionProperties());break;case"items":case"itemTemplate":this.popupTemplate||this.updatePopupItems();break;case"modal":e.modal?this.createOverlay():this.removeOverlayEle();break;case"mode":this.popupEle&&!this.popupTemplate&&(this.popupEle.classList.remove(nw,ow),this.popupEle.classList.add("Radial"===this.mode?nw:ow),this.updatePositionProperties());break;case"radialSettings":this.popupEle&&"Radial"===this.mode&&!this.popupTemplate&&this.setRadialPosition();break;case"opensOnHover":this.opensOnHover?(this.unwireFabClick(),this.wireFabHover()):(this.unwireFabHover(),this.wireFabClick())}},o([t({},Sr)],Ww.prototype,"animation",void 0),o([e("")],Ww.prototype,"content",void 0),o([e("")],Ww.prototype,"closeIconCss",void 0),o([e("")],Ww.prototype,"cssClass",void 0),o([e("Auto")],Ww.prototype,"direction",void 0),o([e(!1)],Ww.prototype,"disabled",void 0),o([e("Left")],Ww.prototype,"iconPosition",void 0),o([kt([],Lr)],Ww.prototype,"items",void 0),o([e("")],Ww.prototype,"itemTemplate",void 0),o([e("Linear")],Ww.prototype,"mode",void 0),o([e("")],Ww.prototype,"openIconCss",void 0),o([e(!1)],Ww.prototype,"opensOnHover",void 0),o([e("BottomRight")],Ww.prototype,"position",void 0),o([e(!1)],Ww.prototype,"modal",void 0),o([e("")],Ww.prototype,"popupTemplate",void 0),o([t({},Zr)],Ww.prototype,"radialSettings",void 0),o([e("")],Ww.prototype,"target",void 0),o([e(!0)],Ww.prototype,"visible",void 0),o([e(!0)],Ww.prototype,"isPrimary",void 0),o([i()],Ww.prototype,"beforeClose",void 0),o([i()],Ww.prototype,"beforeItemRender",void 0),o([i()],Ww.prototype,"beforeOpen",void 0),o([i()],Ww.prototype,"created",void 0),o([i()],Ww.prototype,"clicked",void 0),o([i()],Ww.prototype,"onClose",void 0),o([i()],Ww.prototype,"onOpen",void 0);var jw,Xr=o([Bt],Ww);function Ww(e,t){e=jw.call(this,e,t)||this;return e.isMenuOpen=!1,e.isClock=!0,e.isVertical=!0,e.isControl=!1,e.focusedIndex=-1,e}Qw=function(e,t){return(Qw=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])}))(e,t)};var Qw,Uw,tn=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},qw=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},Gw=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},s0=(function(e,t){function i(){this.constructor=e}Qw(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Yw,Uw=zv),Yw.prototype.wireEvents=function(){E.add(this.element,"click",this.smartPasteBtnClickHandler,this)},Yw.prototype.unWireEvents=function(){E.remove(this.element,"click",this.smartPasteBtnClickHandler)},Yw.prototype.smartPasteBtnClickHandler=function(r){return qw(this,void 0,void 0,function(){var t,i,n,o;return Gw(this,function(e){switch(e.label){case 0:return(t=r.target,t=t.closest("form"))?0===(i=this.getFormFields(t)).length?[2]:[4,this.getClipboardContent().then(function(e){return e})]:[2];case 1:if("Clipboard API not supported"===(n=e.sent())||"Clipboard access failed"===n)return[3,6];e.label=2;case 2:return e.trys.push([2,,5,6]),this.disabled=!0,o=i.map(function(e){return{fieldName:e.fieldName,description:e.description,allowedValues:e.allowedValues,type:e.type}}),o="\nCurrent date: "+(new Date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})+"\n\nEach response line matches the following format:\nFIELD identifier^^^value\n\nGive a response with the following lines only, with values inferred from USER_DATA:\n"+this.formatFields(o)+"\nEND_RESPONSE\n\nDo not explain how the values were determined.\nFor fields without any corresponding information in USER_DATA, use value NO_DATA.",o={messages:[{role:"system",content:o},{role:"user",content:"\nUSER_DATA: "+n+"\n                    "}],temperature:0,topP:1,maxTokens:2e3,frequencyPenalty:.1,presencePenalty:0,stop:["END_RESPONSE"]},"function"!=typeof this.aiAssistHandler?[3,4]:[4,this.aiAssistHandler(o)];case 3:"string"==typeof(o=e.sent())&&""!==o&&this.setFormFields(t,i,o),e.label=4;case 4:return[3,6];case 5:return this.disabled=!1,[7];case 6:return[2]}})})},Yw.prototype.formatFields=function(e){var i=[];return e.forEach(function(e){var t=[];t.push("\nFIELD "+e.fieldName+"^^^"),e.description&&t.push("The "+e.description),e.allowedValues&&0<e.allowedValues.length?(t.push(" (multiple choice, with allowed values: "),t.push(e.allowedValues.map(function(e){return""+e}).join(",")),t.push(")")):t.push(" of type "+e.type),i.push(t.join(""))}),i.join("")},Yw.prototype.setFormFields=function(n,e,t){var o=this,r={},i=null;t.split("\n").forEach(function(e){var t;e.startsWith("FIELD ")?2===(t=e.substring("FIELD ".length).split("^^^")).length&&(r[""+t[0]]=t[1],i=t[0]):i&&(r[""+i]+="\n"+e)}),e.forEach(function(e){var t,i=r[e.fieldName];void 0!==i&&"NO_DATA"!==(i=i.trim())&&(e.element instanceof HTMLInputElement&&"radio"===e.element.type?(t=o.findRadioButton(n,e.element.name,i))&&o.updateElementValue(t,"true"):o.updateElementValue(e.element,i))})},Yw.prototype.findRadioButton=function(t,i,n){var o=this,e=Array.from(t.querySelectorAll("input[type=radio]")).filter(function(e){return e instanceof HTMLInputElement&&e.name===i}).map(function(e){return{elem:e,text:o.getElementDescription(t,e)}}),r=e.find(function(e){return e.text===n});return r?r.elem:1===(r=e.filter(function(e){return e.text&&e.text.includes(n)})).length?r[0].elem:null},Yw.prototype.triggerBeforeChange=function(e){e.dispatchEvent(new CustomEvent("beforeinput",{bubbles:!0,detail:{fromSmartComponents:!0}}))},Yw.prototype.triggerAfterChange=function(e){e.dispatchEvent(new CustomEvent("input",{bubbles:!0,detail:{fromSmartComponents:!0}})),e.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{fromSmartComponents:!0}}))},Yw.prototype.updateElementValue=function(e,t){var i,n,o,r,s=e.classList.contains("e-control");e instanceof HTMLInputElement&&("radio"===e.type||"checkbox"===e.type)?(n=null==t?void 0:t.toString().toLowerCase(),e.checked!==(n="true"===n||"yes"===n||"on"===n)&&(this.triggerBeforeChange(e),s?e.ej2_instances[0].checked=n:e.checked=n,this.triggerAfterChange(e))):e instanceof HTMLSelectElement?(i=t.toString(),n=null,0<(r=(o=Array.from(e.querySelectorAll("option"))).filter(function(e){return e.textContent===i})).length?n=o.indexOf(r[0]):1===(r=o.filter(function(e){return e.textContent&&0<=e.textContent.indexOf(i)})).length&&(n=o.indexOf(r[0])),null!==n&&e.selectedIndex!==n&&(this.triggerBeforeChange(e),s?e.ej2_instances[0].index=n:e.selectedIndex=n,this.triggerAfterChange(e))):(this.triggerBeforeChange(e),e.classList.contains("e-rating")||e.classList.contains("e-colorpicker")?e.ej2_instances[0].value=t:e.value=t,this.triggerAfterChange(e)),e.focus()},Yw.prototype.getFormFields=function(r){var s=this,a=[],l=0;return r.querySelectorAll("input, select, textarea").forEach(function(e){var t,i,n,o;(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement)&&"hidden"!==e.type&&!s.isFieldIgnore(e)&&(t="radio"===e.type,i=t?e.name:e.id||e.name||"unidentified_"+ ++l,!t||!a.find(function(e){return e.fieldName===i}))&&(o=null,t||(o=s.getElementDescription(r,e)))&&(n={fieldName:e.name,description:o,element:e,type:"checkbox"===e.type?"boolean":"number"===e.type?"number":"string"},e instanceof HTMLSelectElement?(o=Array.from(e.querySelectorAll("option")).filter(function(e){return e.value}),n.allowedValues=o.map(function(e){return e.textContent}),n.type="fixed-choices"):t&&(n.allowedValues=[],n.type="fixed-choices",Array.from(r.querySelectorAll("input[type=radio]")).forEach(function(e){e.name===i&&(e=s.getElementDescription(r,e))&&n.allowedValues.push(e)})),a.push(n))}),a},Yw.prototype.isFieldIgnore=function(e){return e.hasAttribute("data-smartpaste-ignore")||e.hasAttribute("aria-disabled")&&"true"===e.getAttribute("aria-disabled")||e.hasAttribute("disabled")||e.hasAttribute("readonly")||e.hasAttribute("aria-readonly")&&"true"===e.getAttribute("aria-readonly")||e.hasAttribute("aria-hidden")&&"true"===e.getAttribute("aria-hidden")},Yw.prototype.getElementDescription=function(e,t){return t.hasAttribute("data-smartpaste-description")?t.getAttribute("data-smartpaste-description"):(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.placeholder?t.placeholder:(e=e.querySelector('label[for="'+t.id+'"]'))?e.textContent.trim():t.name||t.id},Yw.prototype.getClipboardContent=function(){return qw(this,void 0,void 0,function(){var t,i;return Gw(this,function(e){switch(e.label){case 0:return(t=navigator,(i=document.getElementById("custom-clipboard"))&&i.value)?[2,i.value]:[3,1];case 1:if("undefined"==typeof window||!t.clipboard||!t.clipboard.readText)return[3,6];e.label=2;case 2:return e.trys.push([2,4,,5]),[4,t.clipboard.readText()];case 3:return[2,e.sent()];case 4:return e.sent(),[2,"Clipboard access failed"];case 5:return[3,7];case 6:return[2,"Clipboard API not supported"];case 7:return[2]}})})},tn([e()],Yw.prototype,"aiAssistHandler",void 0),Yw);function Yw(e,t){return Uw.call(this,e,t)||this}var Xw,Kw,Jw,Zw,$w,eC,tC,iC,nC=["north-west","north","north-east","west","east","south-west","south","south-east"],oC="e-resize-handle",rC="e-focused-handle",sC="e-dlg-resizable",aC=["e-restrict-left"],lC="e-resize-viewport",hC=["north","west","east","south"],dC=0,pC=0,cC=0,uC=0,gC=0,mC=0,fC=null,yC=null,vC=null,bC=!0,wC=0,CC=!0;function SC(e){fC=e.resizeBegin,yC=e.resizing,vC=e.resizeComplete,Xw=AC(e.element),tC=AC(e.boundary);for(var t,i,n=e.direction.split(" "),o=0;o<n.length;o++)0<=hC.indexOf(n[o])&&n[o]?(t=i=void 0,i=n[o],DC(),(t=Q("span",{attrs:{unselectable:"on",contenteditable:"false"}})).setAttribute("class","e-dialog-border-resize e-"+i),"south"===i&&(t.style.height="2px",t.style.width="100%",t.style.bottom="0px",t.style.left="0px"),"north"===i&&(t.style.height="2px",t.style.width="100%",t.style.top="0px",t.style.left="0px"),"east"===i&&(t.style.height="100%",t.style.width="2px",t.style.right="0px",t.style.top="0px"),"west"===i&&(t.style.height="100%",t.style.width="2px",t.style.left="0px",t.style.top="0px"),Xw.appendChild(t)):""!==n[o].trim()&&(i=Q("div",{className:"e-icons "+oC+" e-"+n[o]}),Xw.appendChild(i));Jw=e.minHeight,$w=e.minWidth,eC=e.maxWidth,Zw=e.maxHeight,e.proxy&&e.proxy.element&&e.proxy.element.classList.contains("e-dialog")?xC(e.proxy):xC()}function AC(e){var t;return t=je(e)?t:"string"==typeof e?document.querySelector(e):e}function xC(e){for(var t=e||this,i=Xw.querySelectorAll("."+oC),n=0;n<i.length;n++){Kw=i[n],E.add(Kw,"mousedown",TC,t);var o="msie"===F.info.name?"pointerdown":"touchstart";E.add(Kw,o,MC,t)}var r=Xw.querySelectorAll(".e-dialog-border-resize");if(!je(r))for(n=0;n<r.length;n++){Kw=r[n],E.add(Kw,"mousedown",TC,t);o="msie"===F.info.name?"pointerdown":"touchstart";E.add(Kw,o,MC,t)}}function IC(e){return-1<e.indexOf("mouse")?"mouse":"touch"}function TC(e){if(e.preventDefault(),Xw=e.target.parentElement,DC(),gC=e.pageX,mC=e.pageY,e.target.classList.add(rC),!je(fC))if(!0===fC(e,this))return;this.targetEle&&Xw&&Xw.querySelector("."+sC)&&(tC="body"===this.target?null:this.targetEle,eC=this.targetEle.clientWidth,Zw=this.targetEle.clientHeight);e=je(tC)?document:tC;E.add(e,"mousemove",kC,this),E.add(document,"mouseup",EC,this);for(var t=0;t<aC.length;t++)bC=!Xw.classList.contains(aC[t])}function EC(e){var t="msie"===F.info.name?"pointermove":"touchmove",i="msie"===F.info.name?"pointerup":"touchend",n=je(tC)?document:tC,o="msie"===F.info.name?"pointerdown":"touchstart";E.remove(n,"mousemove",kC),E.remove(n,t,kC),E.remove(n,o,kC),je(document.body.querySelector("."+rC))||document.body.querySelector("."+rC).classList.remove(rC),je(vC)||vC(e,this),E.remove(document,"mouseup",EC),E.remove(document,i,EC)}function DC(){dC=parseFloat(getComputedStyle(Xw,null).getPropertyValue("width").replace("px","")),pC=parseFloat(getComputedStyle(Xw,null).getPropertyValue("height").replace("px","")),cC=Xw.getBoundingClientRect().left,uC=Xw.getBoundingClientRect().top}function MC(e){Xw=e.target.parentElement,DC();var t=Xw.classList.contains("e-dialog"),t=((e.target.classList.contains(oC)||e.target.classList.contains("e-dialog-border-resize"))&&t&&e.target.classList.add(rC),e.touches?e.changedTouches[0]:e);if(gC=t.pageX,mC=t.pageY,!je(fC))if(!0===fC(e,this))return;var t="msie"===F.info.name?"pointermove":"touchmove",e="msie"===F.info.name?"pointerup":"touchend",i=je(tC)?document:tC;E.add(i,t,kC,this),E.add(document,e,EC,this)}function kC(e){if(e.target.classList.contains(oC)&&e.target.classList.contains(rC)?Kw=e.target:je(document.body.querySelector("."+rC))||(Kw=document.body.querySelector("."+rC)),!je(Kw)){for(var t="",i=0;i<nC.length;i++)Kw.classList.contains("e-"+nC[i])&&(t=nC[i]);switch(je(yC)||yC(e,this),t){case"south":BC(e);break;case"north":FC(e);break;case"west":LC(e);break;case"east":RC(e);break;case"south-east":BC(e),RC(e);break;case"south-west":BC(e),LC(e);break;case"north-east":FC(e),RC(e);break;case"north-west":FC(e),LC(e)}}}function PC(e){return e.getBoundingClientRect()}function BC(e){var t=document.documentElement.clientHeight,i=!1,e=(e.touches?e.changedTouches[0]:e).pageY,n=PC(Xw);je(tC)||(r=PC(tC)),(!je(tC)||je(tC)&&(0<=t-e||n.top<0))&&(i=!0);var e=Jw<(e=pC+(e-mC))?e:Jw,o=0,r=(je(tC)||(o=r.top),je(tC)?0:tC.offsetHeight-tC.clientHeight),o=(o=n.top-o-r/2)<0?0:o;if(0<n.top&&Zw<o+e)return i=!1,Xw.classList.contains(lC)?void 0:void(Xw.style.height=Zw-parseInt(o.toString(),10)+"px");r=0;i&&((e=n.top<0&&0<t+(n.height+n.top)&&e+(r=n.top)<=30?n.height-(n.height+n.top)+30:e)+n.top>=Zw&&(Xw.style.height=n.height+(t-(n.height+n.top))+"px"),i=je(tC)?r:o,Jw<=e)&&e+i<=Zw&&(Xw.style.height=e+"px")}function FC(e){var t,i=!1,e=("mouse"===IC(e.type)?e:e.touches[0]).pageY,n=PC(Xw),o=je(tC)?0:tC.offsetHeight-tC.clientHeight,n=(je(tC)||(t=PC(tC)),(!je(tC)&&0<n.top-t.top||je(tC)&&0<e||!je(tC)&&Math.floor(n.top-t.top+n.height+(t.bottom-n.bottom))-o<=Zw)&&(i=!0),pC-(e-mC));i&&Jw<=n&&n<=Zw&&(o=0,je(tC)||(o=t.top),i=0<(i=uC-o+(e-mC))?i:1,Xw.style.height=n+"px",Xw.style.top=i+"px")}function LC(e){var t,i=document.documentElement.clientWidth,n=!1,e=(je(tC)||(t=PC(tC)),("mouse"===IC(e.type)?e:e.touches[0]).pageX),o=PC(Xw),r=je(tC)?0:tC.offsetWidth-tC.clientWidth,s=je(tC)?0:t.left,a=je(tC)?0:t.width,i=(je(iC)&&(je(tC)?iC=i:(iC=o.left-s-r/2+o.width,iC+=a-r-iC)),(!je(tC)&&Math.floor(o.left-t.left+o.width+(t.right-o.right))-r<=eC||je(tC)&&0<=e)&&(n=!0),dC-(e-gC));bC&&(i=iC<i?iC:i),n&&$w<=i&&i<=eC&&(s=0,je(tC)||(s=t.left),a=0<(a=cC-s+(e-gC))?a:1,i!==wC&&CC&&(Xw.style.width=i+"px"),bC)&&(Xw.style.left=a+"px",CC=1!=a),wC=i}function RC(e){var t,i=document.documentElement.clientWidth,n=!1;je(tC)||(t=PC(tC));var e=(e.touches?e.changedTouches[0]:e).pageX,o=PC(Xw),i=((!je(tC)&&(o.left-t.left+o.width<=eC||o.right-t.left>=o.width)||je(tC)&&0<i-e)&&(n=!0),dC+(e-gC)),e=0;if(je(tC)||(e=t.left),o.left-e+i>eC){if(n=!1,Xw.classList.contains(lC))return;Xw.style.width=eC-(o.left-e)+"px"}n&&$w<=i&&i<=eC&&(Xw.style.width=i+"px")}function OC(){for(var e=Xw.querySelectorAll("."+oC),t=0;t<e.length;t++)G(e[t]);var i=Xw.querySelectorAll(".e-dialog-border-resize");if(!je(i))for(t=0;t<i.length;t++)G(i[t])}NC=function(e,t){return(NC=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])}))(e,t)};var NC,VC,h0=function(e,t){function i(){this.constructor=e}NC(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ir=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},i0=(h0(_C,VC=n),Ir([e(!0)],_C.prototype,"isFlat",void 0),Ir([e()],_C.prototype,"buttonModel",void 0),Ir([e("Button")],_C.prototype,"type",void 0),Ir([i()],_C.prototype,"click",void 0),_C);function _C(){return null!==VC&&VC.apply(this,arguments)||this}h0(zC,HC=n),Ir([e("Fade")],zC.prototype,"effect",void 0),Ir([e(400)],zC.prototype,"duration",void 0),Ir([e(0)],zC.prototype,"delay",void 0);var HC,o=zC;function zC(){return null!==HC&&HC.apply(this,arguments)||this}var jC,WC,QC="e-dialog",UC="e-rtl",qC="e-dlg-header-content",GC="e-dlg-header",YC="e-footer-content",XC="e-dlg-modal",KC="e-icon-dlg-close",JC="e-dlg-target",ZC="e-scroll-disabled",$C="e-device",eS="e-dlg-fullscreen",tS="e-dlg-closeicon-btn",iS="e-popup-open",nS="Information",oS="e-scroll-disabled",rS="e-alert-dialog",sS="e-confirm-dialog",aS="e-dlg-resizable",lS="e-restrict-left",hS="e-resize-viewport",dS="user action",pS=(h0(cS,jC=Ji),cS.prototype.render=function(){this.initialize(),this.initRender(),this.wireEvents(),"100%"===this.width&&(this.element.style.width=""),""!==this.minHeight&&(this.element.style.minHeight=T(this.minHeight)),this.enableResize&&(this.setResize(),this.isModal&&(this.isModelResize=!0),"None"===this.animationSettings.effect)&&this.getMinHeight(),this.renderComplete()},cS.prototype.initializeValue=function(){this.dlgClosedBy=dS},cS.prototype.preRender=function(){var e,t=this;this.initializeValue(),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=dS})};this.l10n=new Cn("dialog",{close:"Close"},this.locale),this.checkPositionData(),je(this.target)&&(e=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.target=document.body,this.isProtectedOnChange=e)},cS.prototype.updatePersistData=function(){this.enablePersistence&&this.setProperties({width:parseFloat(this.element.style.width),height:parseFloat(this.element.style.height),position:{X:parseFloat(this.dragObj.element.style.left),Y:parseFloat(this.dragObj.element.style.top)}},!0)},cS.prototype.isNumberValue=function(e){return/^[-+]?\d*\.?\d+$/.test(e)},cS.prototype.checkPositionData=function(){var e;je(this.position)||(je(this.position.X)||"number"==typeof this.position.X||this.isNumberValue(this.position.X)&&(e=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.position.X=parseFloat(this.position.X),this.isProtectedOnChange=e),je(this.position.Y))||"number"==typeof this.position.Y||this.isNumberValue(this.position.Y)&&(e=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.position.Y=parseFloat(this.position.Y),this.isProtectedOnChange=e)},cS.prototype.getEle=function(e,t){for(var i=void 0,n=0;n<e.length;n++)if(e[n].classList.contains(t)){i=e[n];break}return i},cS.prototype.getMinHeight=function(){var e="0px",t="0px",i=(je(this.element.querySelector("."+qC))||(e=getComputedStyle(this.headerContent).height),this.getEle(this.element.children,YC)),i=(je(i)||(t=getComputedStyle(i).height),parseInt(e.slice(0,e.indexOf("p")),10)),e=parseInt(t.slice(0,t.indexOf("p")),10);return t=i+30+(isNaN(e)?0:e),Jw=t,i+30+e},cS.prototype.onResizeStart=function(e,t){return t.trigger("resizeStart",e),!e.cancel&&this.isModelResize&&!je(this.dlgContainer)&&this.dlgContainer.classList.contains("e-dlg-"+this.position.X+"-"+this.position.Y)&&(this.setPopupPosition(),this.dlgContainer.classList.remove("e-dlg-"+this.position.X+"-"+this.position.Y),(t=this.getTargetContainer(this.target))instanceof Element&&"rtl"===window.getComputedStyle(t).getPropertyValue("direction")?this.element.style.position="absolute":this.element.style.position="relative",this.element.classList.contains(lS)&&this.element.classList.remove(lS),this.isModelResize=!1),e.cancel},cS.prototype.onResizing=function(e,t){t.trigger("resizing",e)},cS.prototype.onResizeComplete=function(e,t){t.trigger("resizeStop",e),this.updatePersistData()},cS.prototype.setResize=function(){if(this.enableResize){this.element.classList.add(aS);for(var e=getComputedStyle(this.element).minHeight,t=getComputedStyle(this.element).minWidth,i="",n=0;n<this.resizeHandles.length;n++){if("All"===this.resizeHandles[n]){i="south north east west north-east north-west south-east south-west";break}var o="";switch(this.resizeHandles[n].toString()){case"SouthEast":o="south-east";break;case"SouthWest":o="south-west";break;case"NorthEast":o="north-east";break;case"NorthWest":o="north-west";break;default:o=this.resizeHandles[n].toString()}i+=o.toLocaleLowerCase()+" "}this.enableRtl&&"south-east"===i.trim()?i="south-west":this.enableRtl&&"south-west"===i.trim()&&(i="south-east"),this.isModal&&this.enableRtl?this.element.classList.add(lS):this.isModal&&this.target===document.body&&this.element.classList.add(hS),SC({element:this.element,direction:i,minHeight:parseInt(e.slice(0,t.indexOf("p")),10),maxHeight:this.targetEle.clientHeight,minWidth:parseInt(t.slice(0,t.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 OC(),this.unWireWindowResizeEvent(),this.isModal?this.element.classList.remove(lS):this.element.classList.remove(hS),this.element.classList.remove(aS)},cS.prototype.getFocusElement=function(e){e=e.querySelectorAll('input,select,textarea,button:enabled,a,[contenteditable="true"],[tabindex]');return{element:e[e.length-1]}},cS.prototype.keyDown=function(e){var t,i,n=this,o=(9===e.keyCode&&this.isModal&&(o=void 0,je(this.btnObj)||(o=this.btnObj[this.btnObj.length-1]),je(this.btnObj)&&!je(this.ftrTemplateContent)&&(o=this.getFocusElement(this.ftrTemplateContent)),je(this.btnObj)&&je(this.ftrTemplateContent)&&!je(this.contentEle)&&(o=this.getFocusElement(this.contentEle)),je(o)||document.activeElement!==o.element||e.shiftKey||(e.preventDefault(),this.focusableElements(this.element).focus()),document.activeElement===this.focusableElements(this.element))&&e.shiftKey&&(e.preventDefault(),je(o)||o.element.focus()),document.activeElement),r=-1<["input","textarea"].indexOf(o.tagName.toLowerCase()),s=!1;r||(s=o.hasAttribute("contenteditable")&&"true"===o.getAttribute("contenteditable")),27===e.keyCode&&this.closeOnEscape&&(this.dlgClosedBy="escape",je(t=document.querySelector(".e-popup-open:not(.e-dialog)"))||t.classList.contains("e-toolbar-pop")||t.classList.contains("e-slider-tooltip"))&&this.hide(e),(13===e.keyCode&&!e.ctrlKey&&"textarea"!==o.tagName.toLowerCase()&&r&&!je(this.primaryButtonEle)||13===e.keyCode&&e.ctrlKey&&("textarea"===o.tagName.toLowerCase()||s)&&!je(this.primaryButtonEle))&&this.buttons.some(function(e,t){i=t;t=e.buttonModel;return!je(t)&&!0===t.isPrimary})&&"function"==typeof this.buttons[i].click&&!this.primaryButtonEle.disabled&&setTimeout(function(){n.buttons[i].click.call(n,e)})},cS.prototype.initialize=function(){je(this.target)||(this.targetEle="string"==typeof this.target?document.querySelector(this.target):this.target),this.isBlazorServerRender()||U([this.element],QC),F.isDevice&&U([this.element],$C),this.isBlazorServerRender()||this.setCSSClass(),this.setMaxHeight()},cS.prototype.initRender=function(){var e,i=this;this.initialRender=!0,this.isBlazorServerRender()||pt(this.element,{role:"dialog"}),1e3===this.zIndex?(this.setzIndex(this.element,!1),this.calculatezIndex=!0):this.calculatezIndex=!1,this.setTargetContent(),""===this.header||je(this.header)||this.setHeader(),this.renderCloseIcon(),this.setContent(),""===this.footerTemplate||je(this.footerTemplate)?je(this.buttons[0])||je(this.buttons[0].buttonModel)||this.setButton():this.setFooterTemplate(),this.allowDragging&&!je(this.headerContent)&&this.setAllowDragging(),pt(this.element,{"aria-modal":this.isModal?"true":"false"}),this.isModal&&this.setIsModal(),!0===this.element.classList.contains(rS)||!0===this.element.classList.contains(sS)||je(this.element.parentElement)||(e=(this.isModal?this.dlgContainer:this.element).parentElement,this.refElement=this.createElement("div",{className:"e-dlg-ref-element"}),e.insertBefore(this.refElement,this.isModal?this.dlgContainer:this.element)),je(this.targetEle)||(this.isModal?this.targetEle.appendChild(this.dlgContainer):this.targetEle.appendChild(this.element)),this.popupObj=new Sv(this.element,{height:this.height,width:this.width,zIndex:this.zIndex,relateTo:this.target,actionOnScroll:"none",enableRtl:this.enableRtl,open:function(e){var t={container:i.isModal?i.dlgContainer:i.element,element:i.element,target:i.target,preventFocus:!1};i.enableResize&&i.resetResizeIcon(),i.trigger("open",t,function(e){e.preventFocus||i.focusContent()})},close:function(e){i.isModal&&U([i.dlgOverlay],"e-fade"),i.unBindEvent(i.element),i.isModal&&(i.dlgContainer.style.display="none"),i.trigger("close",i.closeArgs);var t=document.activeElement;je(t)||je(t.blur)||t.blur(),je(i.storeActiveElement)||je(i.storeActiveElement.focus)||i.storeActiveElement.focus()}}),this.positionChange(),this.setEnableRTL(),this.isBlazorServerRender()||(U([this.element],"e-popup-close"),this.isModal&&this.setOverlayZindex()),this.visible?(this.show(),this.isModal&&(e=this.getTargetContainer(this.target))instanceof Element&&"rtl"===window.getComputedStyle(e).getPropertyValue("direction")&&this.setPopupPosition()):this.isModal&&(this.dlgOverlay.style.display="none"),this.initialRender=!1},cS.prototype.getTargetContainer=function(e){var t,i=null;return"string"==typeof e?e.startsWith("#")?i=document.getElementById(e.substring(1)):e.startsWith(".")?i=0<(t=document.getElementsByClassName(e.substring(1))).length?t[0]:null:e instanceof HTMLElement||e===document.body||(i=document.querySelector(e)):e instanceof HTMLElement&&(i=e),i},cS.prototype.resetResizeIcon=function(){var e,t=this.getMinHeight();this.targetEle.offsetHeight<t&&(e=this.enableRtl?"e-south-west":"e-south-east",je(e=this.element.querySelector("."+e))||(e.style.bottom="-"+t.toString()+"px"))},cS.prototype.setOverlayZindex=function(e){e=je(e)?parseInt(this.element.style.zIndex,10)?parseInt(this.element.style.zIndex,10):this.zIndex:e;this.dlgOverlay.style.zIndex=(e-1).toString(),this.dlgContainer.style.zIndex=e.toString()},cS.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))},cS.prototype.setPopupPosition=function(){this.popupObj.setProperties({position:{X:this.position.X,Y:this.position.Y}})},cS.prototype.setAllowDragging=function(){var i=this;this.element.classList.contains("e-draggable")||(this.dragObj=new hn(this.element,{clone:!1,isDragScroll:!0,abort:".e-dlg-closeicon-btn",handle:".e-dlg-header-content",dragStart:function(t){i.trigger("dragStart",t,function(e){N&&e.bindEvents(t.dragElement)})},dragStop:function(e){var t;i.isModal&&(i.IsDragStop=!0,je(i.position)||i.dlgContainer.classList.remove("e-dlg-"+i.position.X+"-"+i.position.Y),(t=i.getTargetContainer(i.target))instanceof Element&&"rtl"===window.getComputedStyle(t).getPropertyValue("direction")?i.element.style.position="absolute":i.element.style.position="relative"),i.trigger("dragStop",e),i.isModelResize=!1,i.element.classList.remove(lS),i.updatePersistData()},drag:function(e){i.trigger("drag",e)}}),je(this.targetEle))||(this.dragObj.dragArea=this.targetEle)},cS.prototype.setButton=function(){if(!this.isBlazorServerRender()){this.buttonContent=[],this.btnObj=[];for(var e,t=0;t<this.buttons.length;t++)je(this.buttons[t].buttonModel)||(e=je(this.buttons[t].type)?"button":this.buttons[t].type.toLowerCase(),e=this.createElement("button",{className:this.cssClass,attrs:{type:e,tabindex:"0"}}),this.buttonContent.push(e.outerHTML));this.setFooterTemplate()}for(var i,t=0,n=this.element.children;t<n.length;t++)n[t].classList.contains(YC)&&(i=n[t].querySelectorAll("button"));for(t=0;t<this.buttons.length;t++)je(this.buttons[t].buttonModel)||(this.isBlazorServerRender()||(this.btnObj[t]=new zv(this.buttons[t].buttonModel)),!je(this.ftrTemplateContent)&&0<i.length&&("function"==typeof this.buttons[t].click&&E.add(i[t],"click",this.buttons[t].click,this),"object"==typeof this.buttons[t].click)&&E.add(i[t],"click",this.buttonClickHandler.bind(this,t),this),this.isBlazorServerRender())||je(this.ftrTemplateContent)||(this.btnObj[t].appendTo(this.ftrTemplateContent.children[t]),this.buttons[t].isFlat&&this.btnObj[t].element.classList.add("e-flat"),this.primaryButtonEle=this.element.getElementsByClassName("e-primary")[0])},cS.prototype.buttonClickHandler=function(e){this.trigger("buttons["+e+"].click",{})},cS.prototype.setContent=function(){this.contentEle=this.createElement("div",{className:"e-dlg-content",id:this.element.id+"_dialog-content"}),this.headerEle?pt(this.element,{"aria-describedby":this.element.id+"_title "+this.element.id+"_dialog-content"}):pt(this.element,{"aria-describedby":this.element.id+"_dialog-content"}),this.innerContentElement?this.contentEle.appendChild(this.innerContentElement):(je(this.content)||""===this.content)&&this.initialRender||(("string"!=typeof this.content||N)&&this.content instanceof HTMLElement?this.contentEle.appendChild(this.content):this.setTemplate(this.content,this.contentEle,"content")),je(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()||!F.isIE||""!==this.element.style.width||je(this.width)||(this.element.style.width=T(this.width)),this.setMaxHeight())},cS.prototype.setTemplate=function(e,t,i){var n,o,r=t.classList.contains(GC)?this.element.id+"header":t.classList.contains(YC)?this.element.id+"footerTemplate":this.element.id+"content",s=(je(e.outerHTML)?("string"==typeof e||"string"!=typeof e||N&&!this.isStringTemplate)&&("string"==typeof e&&(e=this.sanitizeHelper(e)),this.isVue||"string"!=typeof e?(n=oo(e),o=e):t.innerHTML=e):t.appendChild(e),[]);if(!je(n)){for(var a=0,l=n({},this,i,r,!(N&&!this.isStringTemplate&&0===o.indexOf("<div>Blazor"))||this.isStringTemplate);a<l.length;a++){var h=l[a];s.push(h)}ht([].slice.call(s),t)}},cS.prototype.sanitizeHelper=function(e){var t;return this.enableHtmlSanitizer&&(Pe(t=go.beforeSanitize(),t,{cancel:!1,helper:null}),this.trigger("beforeSanitizeHtml",t),t.cancel&&!je(t.helper)?e=t.helper(e):t.cancel||(e=go.serializeValue(t,e))),e},cS.prototype.setMaxHeight=function(){var e;this.allowMaxHeight&&(e=this.element.style.display,this.element.style.display="none",this.element.style.maxHeight=!je(this.target)&&this.targetEle.offsetHeight<window.innerHeight?this.targetEle.offsetHeight-20+"px":window.innerHeight-20+"px",this.element.style.display=e,F.isIE)&&"auto"===this.height&&!je(this.contentEle)&&this.element.offsetHeight<this.contentEle.offsetHeight&&(this.element.style.height="inherit")},cS.prototype.setEnableRTL=function(){this.isBlazorServerRender()||(this.enableRtl?U:q)([this.element],UC),je(this.element.querySelector(".e-resize-handle"))||(OC(),this.setResize())},cS.prototype.setTargetContent=function(){var e,t=this;(je(this.content)||""===this.content)&&(e=""!==this.element.innerHTML.replace(/\s|<(\/?|\/?)(!--!--)>/g,""),0<this.element.children.length||e)&&(this.innerContentElement=document.createDocumentFragment(),[].slice.call(this.element.childNodes).forEach(function(e){8!==e.nodeType&&t.innerContentElement.appendChild(e)}))},cS.prototype.setHeader=function(){this.headerEle?this.headerEle.innerHTML="":this.headerEle=this.createElement("div",{id:this.element.id+"_title",className:GC}),this.createHeaderContent(),this.headerContent.appendChild(this.headerEle),this.setTemplate(this.header,this.headerEle,"header"),pt(this.element,{"aria-describedby":this.element.id+"_title"}),pt(this.element,{"aria-labelledby":this.element.id+"_dialog-header"}),this.element.insertBefore(this.headerContent,this.element.children[0]),this.allowDragging&&!je(this.headerContent)&&this.setAllowDragging()},cS.prototype.setFooterTemplate=function(){this.ftrTemplateContent?this.ftrTemplateContent.innerHTML="":this.ftrTemplateContent=this.createElement("div",{className:YC}),""===this.footerTemplate||je(this.footerTemplate)?this.ftrTemplateContent.innerHTML=this.buttonContent.join(""):this.setTemplate(this.footerTemplate,this.ftrTemplateContent,"footerTemplate"),this.element.appendChild(this.ftrTemplateContent)},cS.prototype.createHeaderContent=function(){je(this.headerContent)&&(this.headerContent=this.createElement("div",{id:this.element.id+"_dialog-header",className:qC}))},cS.prototype.renderCloseIcon=function(){this.showCloseIcon&&(this.closeIcon=this.createElement("button",{className:tS,attrs:{type:"button"}}),this.closeIconBtnObj=new zv({cssClass:"e-flat",iconCss:KC+" e-icons"}),this.closeIconTitle(),je(this.headerContent)?(this.createHeaderContent(),lt([this.closeIcon],this.headerContent),this.element.insertBefore(this.headerContent,this.element.children[0])):lt([this.closeIcon],this.headerContent),this.closeIconBtnObj.appendTo(this.closeIcon))},cS.prototype.closeIconTitle=function(){this.l10n.setLocale(this.locale);var e=this.l10n.getConstant("close");this.closeIcon.setAttribute("title",e),this.closeIcon.setAttribute("aria-label",e)},cS.prototype.setCSSClass=function(e){e&&(q([this.element],e.split(" ")),this.isModal)&&!je(this.dlgContainer)&&q([this.dlgContainer],e.split(" ")),this.cssClass&&(U([this.element],this.cssClass.split(" ")),this.isModal)&&!je(this.dlgContainer)&&U([this.dlgContainer],this.cssClass.split(" "))},cS.prototype.setIsModal=function(){this.dlgContainer=this.createElement("div",{className:"e-dlg-container"}),this.setCSSClass(),this.element.classList.remove(iS),this.element.parentNode.insertBefore(this.dlgContainer,this.element),this.dlgContainer.appendChild(this.element),U([this.element],XC),this.dlgOverlay=this.createElement("div",{className:"e-dlg-overlay"}),this.dlgOverlay.style.zIndex=(this.zIndex-1).toString(),this.dlgContainer.appendChild(this.dlgOverlay)},cS.prototype.getValidFocusNode=function(e){for(var t,i=0;i<e.length;i++){if((0<(t=e[i]).clientHeight||"a"===t.tagName.toLowerCase()&&t.hasAttribute("href"))&&-1<t.tabIndex&&!t.disabled&&!this.disableElement(t,'[disabled],[aria-disabled="true"],[type="hidden"]'))return t;t=null}return t},cS.prototype.focusableElements=function(e){return je(e)?null:(e=e.querySelectorAll('input,select,textarea,button,a,[contenteditable="true"],[tabindex]'),this.getValidFocusNode(e))},cS.prototype.getAutoFocusNode=function(e){var t=e.querySelector("."+tS),e=e.querySelectorAll("[autofocus]"),e=this.getValidFocusNode(e);if(N&&(this.primaryButtonEle=this.element.getElementsByClassName("e-primary")[0]),je(e)){if(!je(e=this.focusableElements(this.contentEle)))return e;if(!je(this.primaryButtonEle))return this.element.querySelector(".e-primary")}else t=e;return t},cS.prototype.disableElement=function(e,t){var i=e?e.matches||e.webkitMatchesSelector||e.msGetRegionContent:null;if(i)for(;e;e=e.parentNode)if(e instanceof Element&&i.call(e,t))return e;return null},cS.prototype.focusContent=function(){var e=this.getAutoFocusNode(this.element),e=je(e)?this.element:e,t=F.userAgent;(0<t.indexOf("MSIE ")||0<t.indexOf("Trident/"))&&this.element.focus(),e.focus(),this.unBindEvent(this.element),this.bindEvent(this.element)},cS.prototype.bindEvent=function(e){E.add(e,"keydown",this.keyDown,this)},cS.prototype.unBindEvent=function(e){E.remove(e,"keydown",this.keyDown)},cS.prototype.updateSanitizeContent=function(){this.isBlazorServerRender()||(this.contentEle.innerHTML=this.sanitizeHelper(this.content))},cS.prototype.isBlazorServerRender=function(){return N&&this.isServerRendered},cS.prototype.getModuleName=function(){return"dialog"},cS.prototype.onPropertyChanged=function(e,t){if(this.element.classList.contains(QC))for(var i,n,o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"content":je(this.content)||""===this.content?je(this.contentEle)||(G(this.contentEle),this.contentEle=null):(this.isBlazorServerRender()&&(this.contentEle=this.element.querySelector(".e-dlg-content")),je(this.contentEle)||"dialog"===this.contentEle.getAttribute("role")?this.setContent():(this.isBlazorServerRender()||(this.contentEle.innerHTML=""),"function"==typeof this.content?(this.clearTemplate(["content"]),G(this.contentEle),this.contentEle=null,this.setContent()):"string"==typeof this.content?this.updateSanitizeContent():this.contentEle.appendChild(this.content),this.setMaxHeight()));break;case"header":""===this.header||je(this.header)?this.headerEle&&(G(this.headerEle),this.headerEle=null):this.setHeader();break;case"footerTemplate":if(""===this.footerTemplate||je(this.footerTemplate)){if(!this.ftrTemplateContent)return;G(this.ftrTemplateContent),this.ftrTemplateContent=null}else this.setFooterTemplate();this.buttons=[{}];break;case"showCloseIcon":0<this.element.getElementsByClassName(KC).length?this.showCloseIcon||""!==this.header&&!je(this.header)?this.showCloseIcon||G(this.closeIcon):(G(this.headerContent),this.headerContent=null):(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":gt(this.element,{height:T(e.height)}),this.updatePersistData();break;case"width":gt(this.element,{width:T(e.width)}),this.updatePersistData();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(t.cssClass);break;case"buttons":this.unWireButtonEvents(),this.destroyButtons(),je(this.ftrTemplateContent)||(G(this.ftrTemplateContent),this.ftrTemplateContent=null),this.footerTemplate="",this.setButton();break;case"allowDragging":this.allowDragging&&!je(this.headerContent)?this.setAllowDragging():this.dragObj.destroy();break;case"target":this.setTarget(e.target);break;case"position":this.checkPositionData(),this.isModal&&(i=this.position.X,n=this.position.Y,je(t.position)||(je(t.position.X)||(i=t.position.X),je(t.position.Y))||(n=t.position.Y),this.dlgContainer.classList.contains("e-dlg-"+i+"-"+n))&&this.dlgContainer.classList.remove("e-dlg-"+i+"-"+n),this.positionChange(),this.updatePersistData();break;case"enableRtl":this.setEnableRTL();break;case"enableResize":this.setResize(),this.isModelResize=this.enableResize&&this.isModal,this.enableResize&&this.dialogOpen&&this.resetResizeIcon();break;case"minHeight":""!==this.minHeight&&(this.element.style.minHeight=T(this.minHeight))}},cS.prototype.setTarget=function(e){this.popupObj.relateTo=e,this.target=e,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(),je(this.targetEle)||(this.isModal&&!je(this.dlgContainer)?this.targetEle.appendChild(this.dlgContainer):je(this.element)||this.targetEle.appendChild(this.element))},cS.prototype.updateIsModal=function(){if(this.element.setAttribute("aria-modal",this.isModal?"true":"false"),this.isModal)je(this.dlgOverlay)&&(this.setIsModal(),this.element.style.top="0px",this.element.style.left="0px",je(this.targetEle)||this.targetEle.appendChild(this.dlgContainer));else{for(q([this.element],XC),q([document.body],[JC,ZC]),G(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.add(this.dlgOverlay,"click",this.dlgOverlayClickEventHandler,this)},cS.prototype.setzIndex=function(e,t){var i=this.isProtectedOnChange,e=(this.isProtectedOnChange=!0,Iv(e));this.zIndex=e>this.zIndex?e:this.zIndex,this.isProtectedOnChange=i,t&&(this.popupObj.zIndex=this.zIndex)},cS.prototype.windowResizeHandler=function(){var e;e=this.targetEle.clientWidth,eC=e,e=this.targetEle.clientHeight,Zw=e,this.setMaxHeight()},cS.prototype.getPersistData=function(){return this.addOnPersist(["width","height","position"])},cS.prototype.removeAllChildren=function(e){for(;e.children[0];)this.removeAllChildren(e.children[0]),e.removeChild(e.children[0])},cS.prototype.destroy=function(){if(!this.isDestroyed){var e=[UC,XC,aS,lS,eS,$C],t=["role","aria-modal","aria-labelledby","aria-describedby","aria-grabbed","tabindex","style"];q([this.targetEle],[JC,ZC]),!je(this.element)&&this.element.classList.contains(eS)&&q([document.body],[JC,ZC]),this.isModal&&q([je(this.targetEle)?document.body:this.targetEle],ZC),this.unWireEvents(),this.unWireButtonEvents(),this.destroyButtons(),je(this.closeIconBtnObj)||this.closeIconBtnObj.destroy(),je(this.dragObj)||this.dragObj.destroy(),!je(this.popupObj.element)&&this.popupObj.element.classList.contains("e-popup")&&this.popupObj.destroy(),q([this.element],e),je(this.cssClass)||""===this.cssClass||q([this.element],this.cssClass.split(" ")),je(this.refElement)||je(this.refElement.parentElement)||(this.refElement.parentElement.insertBefore(this.isModal?this.dlgContainer:this.element,this.refElement),G(this.refElement),this.refElement=void 0),this.isModal&&(G(this.dlgOverlay),this.dlgContainer.parentNode.insertBefore(this.element,this.dlgContainer),G(this.dlgContainer)),this.element.innerHTML=this.clonedEle.innerHTML;for(var i=0;i<t.length;i++)this.element.removeAttribute(t[i]);this.ftrTemplateContent=null,this.headerContent=null,this.isReact||this.isVue||je(this.contentEle)||this.removeAllChildren(this.contentEle),this.contentEle=null,vC=yC=fC=iC=tC=Kw=Xw=null,jC.prototype.destroy.call(this),this.isReact&&this.clearTemplate()}},cS.prototype.wireWindowResizeEvent=function(){this.boundWindowResizeHandler=this.windowResizeHandler.bind(this),window.addEventListener("resize",this.boundWindowResizeHandler)},cS.prototype.unWireWindowResizeEvent=function(){window.removeEventListener("resize",this.boundWindowResizeHandler),this.boundWindowResizeHandler=null},cS.prototype.wireEvents=function(){this.showCloseIcon&&E.add(this.closeIcon,"click",this.closeIconClickEventHandler,this),this.isModal&&this.dlgOverlay&&E.add(this.dlgOverlay,"click",this.dlgOverlayClickEventHandler,this)},cS.prototype.unWireEvents=function(){this.showCloseIcon&&E.remove(this.closeIcon,"click",this.closeIconClickEventHandler),this.isModal&&E.remove(this.dlgOverlay,"click",this.dlgOverlayClickEventHandler)},cS.prototype.refreshPosition=function(){this.popupObj.refreshPosition(),this.element.classList.contains(XC)&&this.positionChange()},cS.prototype.getDimension=function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},cS.prototype.show=function(e){var n,o=this;this.element.classList.contains(QC)&&(this.element.classList.contains(iS)&&je(e)||(je(e)||this.fullScreen(e),n=N?{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",n,function(e){var t,i;e.cancel||(o.element.style.maxHeight!==n.maxHeight&&(o.allowMaxHeight=!1,o.element.style.maxHeight=n.maxHeight),o.enableResize&&null==o.boundWindowResizeHandler&&!o.initialRender&&o.wireWindowResizeEvent(),o.storeActiveElement=document.activeElement,o.element.tabIndex=-1,o.isModal&&!je(o.dlgOverlay)&&(o.dlgOverlay.style.display="block",o.dlgContainer.style.display="flex",q([o.dlgOverlay],"e-fade"),je(o.targetEle)?U([document.body],[JC,ZC]):(o.targetEle===document.body?o.dlgContainer.style.position="fixed":o.dlgContainer.style.position="absolute",o.dlgOverlay.style.position="absolute",(t=o.getTargetContainer(o.target))instanceof Element&&"rtl"===window.getComputedStyle(t).getPropertyValue("direction")?o.element.style.position="absolute":o.element.style.position="relative",U([o.targetEle],[JC,ZC]))),e={name:"None"===o.animationSettings.effect&&"Enable"===Ut?"ZoomIn":o.animationSettings.effect+"In",duration:o.animationSettings.duration,delay:o.animationSettings.delay},i=o.isModal?o.element.parentElement:o.element,o.calculatezIndex&&(o.setzIndex(i,!0),gt(o.element,{zIndex:o.zIndex}),o.isModal)&&o.setOverlayZindex(o.zIndex),("None"!==o.animationSettings.effect||"Enable"!==Ut)&&"None"===o.animationSettings.effect?o.popupObj.show():o.popupObj.show(e),o.isModal&&(t=o.getTargetContainer(o.target))instanceof Element&&("rtl"!==window.getComputedStyle(t).getPropertyValue("direction")||o.IsDragStop||o.setPopupPosition()),o.dialogOpen=!0,i=o.isProtectedOnChange,o.isProtectedOnChange=!0,o.visible=!0,o.preventVisibility=!0,o.isProtectedOnChange=i)})),this.isReact)&&this.renderReactTemplates()},cS.prototype.hide=function(e){var t=this;this.element.classList.contains(QC)&&this.preventVisibility&&(e=N?{cancel:!1,isInteracted:!!e,element:this.element,container:this.isModal?this.dlgContainer:this.element,event:e}:{cancel:!1,isInteracted:!!e,element:this.element,target:this.target,container:this.isModal?this.dlgContainer:this.element,event:e,closedBy:this.dlgClosedBy},this.closeArgs=e,this.trigger("beforeClose",e,function(e){e.cancel||(t.enableResize&&t.unWireWindowResizeEvent(),e={name:"None"===t.animationSettings.effect&&"Enable"===Ut?"ZoomOut":t.animationSettings.effect+"Out",duration:t.animationSettings.duration,delay:t.animationSettings.delay},("None"!==t.animationSettings.effect||"Enable"!==Ut)&&"None"===t.animationSettings.effect?t.popupObj.hide():t.popupObj.hide(e),setTimeout(function(){t.isModal&&!je(t.targetEle)&&t.targetEle.classList.contains(JC)&&t.targetEle.classList.contains(ZC)&&q([t.targetEle],[JC,ZC]),document.body.classList.contains(JC)&&document.body.classList.contains(ZC)&&q([document.body],[JC,ZC])},t.animationSettings.duration+t.animationSettings.delay),t.dialogOpen=!1,e=t.isProtectedOnChange,t.isProtectedOnChange=!0,t.visible=!1,t.preventVisibility=!1,t.isProtectedOnChange=e),t.dlgClosedBy=dS}))},cS.prototype.fullScreen=function(e){var t;this.element.offsetTop,this.element.offsetLeft;return e?(this.isModal||(this.element.style.top=document.scrollingElement.scrollTop+"px"),U([this.element],eS),t=this.element.style.display,this.element.style.display="none",this.element.style.maxHeight=je(this.target)?window.innerHeight+"px":this.targetEle.offsetHeight+"px",this.element.style.display=t,U([document.body],[JC,ZC]),this.allowDragging&&!je(this.dragObj)&&this.dragObj.destroy()):(q([this.element],eS),q([document.body],[JC,ZC]),this.allowDragging&&!je(this.headerContent)&&this.setAllowDragging()),e},cS.prototype.getButtons=function(e){return je(e)?this.btnObj:this.btnObj[e]},cS.prototype.unWireButtonEvents=function(){if(0<this.buttons.length&&""===this.footerTemplate&&this.ftrTemplateContent)for(var e=0;e<this.buttons.length;e++)this.buttons[e].click&&"function"==typeof this.buttons[e].click&&this.ftrTemplateContent.children[e]&&E.remove(this.ftrTemplateContent.children[e],"click",this.buttons[e].click)},cS.prototype.destroyButtons=function(){if(!je(this.btnObj))for(var e=0;e<this.btnObj.length;e++)this.btnObj[e]&&!this.btnObj[e].isDestroyed&&this.btnObj[e].destroy()},Ir([e("")],cS.prototype,"content",void 0),Ir([e(!0)],cS.prototype,"enableHtmlSanitizer",void 0),Ir([e(!1)],cS.prototype,"enablePersistence",void 0),Ir([e(!1)],cS.prototype,"showCloseIcon",void 0),Ir([e(!1)],cS.prototype,"isModal",void 0),Ir([e("")],cS.prototype,"header",void 0),Ir([e(!0)],cS.prototype,"visible",void 0),Ir([e(!1)],cS.prototype,"enableResize",void 0),Ir([e(["South-East"])],cS.prototype,"resizeHandles",void 0),Ir([e("auto")],cS.prototype,"height",void 0),Ir([e("")],cS.prototype,"minHeight",void 0),Ir([e("100%")],cS.prototype,"width",void 0),Ir([e("")],cS.prototype,"cssClass",void 0),Ir([e(1e3)],cS.prototype,"zIndex",void 0),Ir([e(null)],cS.prototype,"target",void 0),Ir([e("")],cS.prototype,"footerTemplate",void 0),Ir([e(!1)],cS.prototype,"allowDragging",void 0),Ir([kt([{}],i0)],cS.prototype,"buttons",void 0),Ir([e(!0)],cS.prototype,"closeOnEscape",void 0),Ir([t({},o)],cS.prototype,"animationSettings",void 0),Ir([t({X:"center",Y:"center"},ts)],cS.prototype,"position",void 0),Ir([i()],cS.prototype,"created",void 0),Ir([i()],cS.prototype,"open",void 0),Ir([i()],cS.prototype,"beforeSanitizeHtml",void 0),Ir([i()],cS.prototype,"beforeOpen",void 0),Ir([i()],cS.prototype,"close",void 0),Ir([i()],cS.prototype,"beforeClose",void 0),Ir([i()],cS.prototype,"dragStart",void 0),Ir([i()],cS.prototype,"dragStop",void 0),Ir([i()],cS.prototype,"drag",void 0),Ir([i()],cS.prototype,"overlayClick",void 0),Ir([i()],cS.prototype,"resizeStart",void 0),Ir([i()],cS.prototype,"resizing",void 0),Ir([i()],cS.prototype,"resizeStop",void 0),Ir([i()],cS.prototype,"destroyed",void 0),Ir([Bt],cS));function cS(e,t){e=jC.call(this,e,t)||this;return e.needsID=!0,e}function uS(e,t){e=new pS(e);return e.appendTo(t),e}function gS(e,t){return e.header=je(t.title)?null:t.title,e.content=je(t.content)?"":t.content,e.isModal=!!je(t.isModal)||t.isModal,e.showCloseIcon=!je(t.showCloseIcon)&&t.showCloseIcon,e.allowDragging=!je(t.isDraggable)&&t.isDraggable,e.closeOnEscape=!je(t.closeOnEscape)&&t.closeOnEscape,e.position=je(t.position)?{X:"center",Y:"top"}:t.position,e.animationSettings=je(t.animationSettings)?{effect:"Fade",duration:400,delay:0}:t.animationSettings,e.cssClass=je(t.cssClass)?"":t.cssClass,e.zIndex=je(t.zIndex)?1e3:t.zIndex,e.open=je(t.open)?null:t.open,e.width=je(t.width)?"auto":t.width,e.height=je(t.height)?"auto":t.height,e}function mS(e,t,i){return je(t.text)||(i.buttonModel.content=t.text),je(t.icon)||(i.buttonModel.iconCss=t.icon),je(t.cssClass)||(i.buttonModel.cssClass=t.cssClass),je(t.click)||(i.click=t.click),je(t.isFlat)||(i.isFlat=t.isFlat),i}(tn=WC=WC||{}).alert=function(e){var t,i=Q("div",{className:rS}),n=(document.body.appendChild(i),uS("string"==typeof e?{content:e,position:{X:"center",Y:"top"},isModal:!0,header:nS,buttons:[{buttonModel:{isPrimary:!0,content:"OK"},click:function(){this.hide()}}]}:function(e,t){var i=[{buttonModel:{isPrimary:!0,content:"OK"},click:function(){this.hide()}}];je(t.okButton)?e.buttons=i:e.buttons[0]=mS(e.buttons[0],t.okButton,i[0]);return e}(gS({buttons:[]},t=e),t),i));return n.close=function(){e&&e.close&&e.close.apply(n),n.destroy(),n.element.classList.contains("e-dlg-modal")?(n.element.parentElement.remove(),n.target.classList.remove(oS)):n.element.remove()},n},tn.confirm=function(e){var t,i=Q("div",{className:sS}),n=(document.body.appendChild(i),uS("string"==typeof e?{position:{X:"center",Y:"top"},content:e,isModal:!0,header:nS,buttons:[{buttonModel:{isPrimary:!0,content:"OK"},click:function(){this.hide()}},{buttonModel:{content:"Cancel"},click:function(){this.hide()}}]}:function(e,t){var i={buttonModel:{isPrimary:!0,content:"OK"},click:function(){this.hide()}},n={buttonModel:{content:"Cancel"},click:function(){this.hide()}};je(t.okButton)?e.buttons[0]=i:e.buttons[0]=mS(e.buttons[0],t.okButton,i);je(t.cancelButton)?e.buttons[1]=n:e.buttons[1]=mS(e.buttons[1],t.cancelButton,n);return e}(gS({buttons:[]},t=e),t),i));return n.close=function(){e&&e.close&&e.close.apply(n),n.destroy(),n.element.classList.contains("e-dlg-modal")?(n.element.parentElement.remove(),n.target.classList.remove(oS)):n.element.remove()},n};fS=function(e,t){return(fS=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])}))(e,t)};var fS,yS,h0=function(e,t){function i(){this.constructor=e}fS(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ir=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},vS="e-tooltip",bS="e-icons",wS="e-tooltip-close",CS="e-tooltip-wrap",SS="e-tip-content",AS="e-arrow-tip",xS="e-arrow-tip-outer",IS="e-arrow-tip-inner",TS="e-tip-bottom",ES="e-tip-top",DS="e-tip-left",MS="e-tip-right",kS="e-popup",PS="e-popup-open",BS="e-popup-close",FS="e-lib",LS="e-tooltip-popup-container",tn=(h0(RS,yS=n),Ir([e({effect:"FadeIn",duration:150,delay:0})],RS.prototype,"open",void 0),Ir([e({effect:"FadeOut",duration:150,delay:0})],RS.prototype,"close",void 0),RS);function RS(){return null!==yS&&yS.apply(this,arguments)||this}h0(VS,OS=Ji),VS.prototype.initialize=function(){this.formatPosition(),U([this.element],vS)},VS.prototype.formatPosition=function(){var e;this.position&&(0===this.position.indexOf("Top")||0===this.position.indexOf("Bottom")?(e=this.position.split(/(?=[A-Z])/),this.tooltipPositionY=e[0],this.tooltipPositionX=e[1]):(e=this.position.split(/(?=[A-Z])/),this.tooltipPositionX=e[0],this.tooltipPositionY=e[1]))},VS.prototype.renderArrow=function(){this.setTipClass(this.position);var e=this.createElement("div",{className:AS+" "+this.tipClass});e.appendChild(this.createElement("div",{className:xS+" "+this.tipClass})),e.appendChild(this.createElement("div",{className:IS+" "+this.tipClass})),this.tooltipEle.appendChild(e)},VS.prototype.setTipClass=function(e){0===e.indexOf("Right")?this.tipClass=DS:0===e.indexOf("Bottom")?this.tipClass=ES:0===e.indexOf("Left")?this.tipClass=MS:this.tipClass=TS},VS.prototype.renderPopup=function(e){e=this.mouseTrail?{top:0,left:0}:this.getTooltipPosition(e);this.tooltipEle.classList.remove(FS),this.popupObj=new Sv(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)})},VS.prototype.getScalingFactor=function(e){var t;return e?(t={x:1,y:1},(e=e.closest('[style*="transform: scale"]'))&&e!==this.tooltipEle&&e.contains(this.tooltipEle)&&(e=window.getComputedStyle(e).getPropertyValue("transform").match(/matrix\(([^)]+)\)/)[1].split(",").map(parseFloat),t.x=e[0],t.y=e[3]),t):{x:1,y:1}},VS.prototype.getTooltipPosition=function(e){this.tooltipEle.style.display="block";var t=this.element.closest('[style*="zoom"]'),t=(!t||t.contains(this.tooltipEle)||(this.tooltipEle.style.zoom=getComputedStyle(t).zoom),O0(e,this.tooltipPositionX,this.tooltipPositionY,!this.isBodyContainer,this.isBodyContainer?null:this.containerElement.getBoundingClientRect())),i=this.getScalingFactor(e),n=this.calculateTooltipOffset(this.position,i.x,i.y),t=this.calculateElementPosition(t,n),n=t[0],t=t[1],e=this.collisionFlipFit(e,n,t);return e.left=e.left/i.x,e.top=e.top/i.y,this.tooltipEle.style.display="",e},VS.prototype.windowResize=function(){this.reposition(this.findTarget())},VS.prototype.reposition=function(e){this.popupObj&&e&&(e=this.getTooltipPosition(e),this.popupObj.position={X:e.left,Y:e.top},this.popupObj.dataBind())},VS.prototype.openPopupHandler=function(){!this.mouseTrail&&this.needTemplateReposition()&&this.reposition(this.findTarget()),this.trigger("afterOpen",this.tooltipEventArgs),this.tooltipEventArgs=null},VS.prototype.closePopupHandler=function(){this.isReact&&"Click"!==this.opensOn&&"function"!=typeof this.content&&this.clearTemplate(["content"]),this.clear();var e={type:this.tooltipEventArgs.event?this.tooltipEventArgs.event.type:null,cancel:!1,target:this.tooltipEventArgs.target,event:this.tooltipEventArgs.event||null,element:this.tooltipEle,isInteracted:!je(this.tooltipEventArgs.event)};this.trigger("afterClose",e)},VS.prototype.calculateTooltipOffset=function(e,t,i){void 0===i&&(i=1);var n,o,r,s,a,l,h,d,p={top:0,left:0},c=1!==(t=void 0===t?1:t)||1!==i?(d=this.tooltipEle.getBoundingClientRect(),a=void 0,l=Math.round(d.width),h=Math.round(d.height),(d=ge("."+AS,this.tooltipEle))&&(a=d.getBoundingClientRect()),n=d?Math.round(a.width):0,o=d?Math.round(a.height):0,r=this.showTipPointer?0:8,s=o/2+2+(h-this.tooltipEle.clientHeight*i),n/2+2+(l-this.tooltipEle.clientWidth*t)):(l=this.tooltipEle.offsetWidth,h=this.tooltipEle.offsetHeight,n=(d=ge("."+AS,this.tooltipEle))?d.offsetWidth:0,o=d?d.offsetHeight:0,r=this.showTipPointer?0:8,s=o/2+2+(this.tooltipEle.offsetHeight-this.tooltipEle.clientHeight),n/2+2+(this.tooltipEle.offsetWidth-this.tooltipEle.clientWidth));switch(this.mouseTrail&&(r+=2),e){case"RightTop":p.left+=n+r,p.top-=h-s;break;case"RightCenter":p.left+=n+r,p.top-=h/2;break;case"RightBottom":p.left+=n+r,p.top-=s;break;case"BottomRight":p.top+=o+r,p.left-=c;break;case"BottomCenter":p.top+=o+r,p.left-=l/2;break;case"BottomLeft":p.top+=o+r,p.left-=l-c;break;case"LeftBottom":p.left-=n+l+r,p.top-=s;break;case"LeftCenter":p.left-=n+l+r,p.top-=h/2;break;case"LeftTop":p.left-=n+l+r,p.top-=h-s;break;case"TopLeft":p.top-=h+o+r,p.left-=l-c;break;case"TopRight":p.top-=h+o+r,p.left-=c;break;default:p.top-=h+o+r,p.left-=l/2}return p.left+=this.offsetX,p.top+=this.offsetY,p},VS.prototype.updateTipPosition=function(e){var t=ct("."+AS+",."+xS+",."+IS,this.tooltipEle);q(t,[TS,ES,DS,MS]),this.setTipClass(e),U(t,this.tipClass)},VS.prototype.adjustArrow=function(e,t,i,n){var o,r,s,a,l,h,d,p=ge("."+AS,this.tooltipEle);!1!==this.showTipPointer&&null!==p&&(this.updateTipPosition(t),this.tooltipEle.style.display="block",t=this.tooltipEle.clientWidth,o=this.tooltipEle.clientHeight,r=ge("."+IS,this.tooltipEle),s=p.offsetWidth,a=p.offsetHeight,this.tooltipEle.style.display="",this.tipClass===TS||this.tipClass===ES?(this.tipClass===TS?(d="99.9%",r.style.top="-"+(a-2)+"px"):(d=-(a-1)+"px",r.style.top="-"+(a-6)+"px"),e&&(l=(h="Center"!==i||t>e.offsetWidth||this.mouseTrail)&&"Left"===i||!h&&"End"===this.tipPointerPosition?t-s-2+"px":h&&"Right"===i||!h&&"Start"===this.tipPointerPosition?"2px":!h||"End"!==this.tipPointerPosition&&"Start"!==this.tipPointerPosition?t/2-s/2+"px":"End"===this.tipPointerPosition?e.offsetWidth+(this.tooltipEle.offsetWidth-e.offsetWidth)/2-s/2-2+"px":(this.tooltipEle.offsetWidth-e.offsetWidth)/2-s/2+2+"px")):(this.tipClass===MS?(l="99.9%",r.style.left="-"+(s-2)+"px"):(l=-(s-1)+"px",r.style.left=s-2-s+"px"),d=(h="Center"!==n||o>e.offsetHeight||this.mouseTrail)&&"Top"===n||!h&&"End"===this.tipPointerPosition?o-a-2+"px":h&&"Bottom"===n||!h&&"Start"===this.tipPointerPosition?"2px":o/2-a/2+"px"),p.style.top=d,p.style.left=l)},VS.prototype.renderContent=function(e){var t,i=this,n=ge("."+SS,this.tooltipEle);this.cssClass&&U([this.tooltipEle],this.cssClass.split(" ")),e&&!je(e.getAttribute("title"))&&(e.setAttribute("data-content",e.getAttribute("title")),e.removeAttribute("title")),je(this.content)?e&&!je(e.getAttribute("data-content"))&&(n.innerHTML=e.getAttribute("data-content")):(n.innerHTML="",this.content instanceof HTMLElement?n.appendChild(this.content):"string"==typeof this.content?(this.isAngular?this.setProperties({content:go.sanitize(this.content)},!0):this.content=this.enableHtmlSanitizer?go.sanitize(this.content):this.content,this.enableHtmlParse?(t=oo(this.content)({},this,"content",this.element.id+"content",void 0,void 0,n,this.root))&&ht(t,n):n.textContent=this.content):((t=oo(this.content)({},this,"content",this.element.id+"content",void 0,void 0,n))&&(this.isAngular&&setTimeout(function(){i.reposition(e)},1),ht(t,n)),this.renderReactTemplates()))},VS.prototype.renderCloseIcon=function(){var e;this.isSticky?(e=this.createElement("div",{className:bS+" "+wS,attrs:{role:"button","aria-label":"Press escape to close the Tooltip"}}),this.tooltipEle.appendChild(e),E.add(e,F.touchStartEvent,this.onStickyClose,this)):(e=this.tooltipEle.querySelector("."+bS+"."+wS))&&ue(e)},VS.prototype.addDescribedBy=function(e,t){var i=(e.getAttribute("aria-describedby")||"").split(/\s+/);i.indexOf(t)<0&&i.push(t),pt(e,{"aria-describedby":i.join(" ").trim(),"data-tooltip-id":t})},VS.prototype.removeDescribedBy=function(e){var t=e.getAttribute("data-tooltip-id"),i=(e.getAttribute("aria-describedby")||"").split(/\s+/),t=i.indexOf(t),t=(-1!==t&&i.splice(t,1),e.removeAttribute("data-tooltip-id"),i.join(" ").trim());t?e.setAttribute("aria-describedby",t):e.removeAttribute("aria-describedby")},VS.prototype.tapHoldHandler=function(e){clearTimeout(this.autoCloseTimer),this.targetHover(e.originalEvent)},VS.prototype.touchEndHandler=function(){var e=this;this.isSticky||(this.autoCloseTimer=setTimeout(function(){e.close()},1500))},VS.prototype.targetClick=function(e){var t,i=this.target?z(e.target,this.target):this.element;je(i)||(t=e,null===i.getAttribute("data-tooltip-id")?"mousedown"===t.type&&2===t.button||this.targetHover(e):this.isSticky||this.hideTooltip(this.animation.close,e,i))},VS.prototype.targetHover=function(e){var t=this.target?z(e.target,this.target):this.element;if(!(je(t)||null!==t.getAttribute("data-tooltip-id")&&0===this.closeDelay)){for(var i=0,n=[].slice.call(ct('[data-tooltip-id= "'+this.ctrlId+'_content"]',document));i<n.length;i++){var o=n[i];this.restoreElement(o)}this.showTooltip(t,this.animation.open,e)}},VS.prototype.mouseMoveBeforeOpen=function(e){this.mouseMoveEvent=e},VS.prototype.mouseMoveBeforeRemove=function(){this.mouseMoveTarget&&E.remove(this.mouseMoveTarget,"mousemove touchstart",this.mouseMoveBeforeOpen)},VS.prototype.showTooltip=function(t,i,n){var o=this;clearTimeout(this.showTimer),clearTimeout(this.hideTimer),this.openDelay&&this.mouseTrail&&(this.mouseMoveBeforeRemove(),this.mouseMoveTarget=t,E.add(this.mouseMoveTarget,"mousemove touchstart",this.mouseMoveBeforeOpen,this)),this.tooltipEventArgs={type:n?n.type:null,cancel:!1,target:t,event:n||null,element:this.tooltipEle,isInteracted:!je(n)};this.trigger("beforeRender",this.tooltipEventArgs,function(e){o.beforeRenderCallback(e,t,n,i)}.bind(this))},VS.prototype.beforeRenderCallback=function(e,t,i,n){e.cancel?(this.isHidden=!0,this.clear(),this.mouseMoveBeforeRemove()):(this.isHidden=!1,je(this.tooltipEle)?(this.ctrlId=this.element.getAttribute("id")?D(this.element.getAttribute("id")):D("tooltip"),this.tooltipEle=this.createElement("div",{className:CS+" "+kS+" "+FS,attrs:{role:"tooltip","aria-hidden":"false",id:this.ctrlId+"_content"}}),this.tooltipEle.style.width=T(this.width),this.tooltipEle.style.height=T(this.height),this.tooltipEle.style.position="absolute",this.tooltipBeforeRender(t,this),this.tooltipAfterRender(t,i,n,this)):t&&(this.adjustArrow(t,this.position,this.tooltipPositionX,this.tooltipPositionY),this.addDescribedBy(t,this.ctrlId+"_content"),this.renderContent(t),Vt.stop(this.tooltipEle),this.reposition(t),this.tooltipAfterRender(t,i,n,this)))},VS.prototype.appendContainer=function(e){"string"==typeof this.container?"body"===this.container?this.containerElement=document.body:(this.isBodyContainer=!1,this.containerElement=ge(this.container,document)):this.container instanceof HTMLElement&&(this.containerElement=this.container,this.isBodyContainer="BODY"===this.containerElement.tagName),this.isBodyContainer||U([this.containerElement],LS),this.containerElement.appendChild(e.tooltipEle)},VS.prototype.tooltipBeforeRender=function(e,t){e&&(F.isDevice&&U([t.tooltipEle],"e-bigger"),"auto"!==t.width&&(t.tooltipEle.style.maxWidth=T(t.width)),t.tooltipEle.appendChild(t.createElement("div",{className:SS})),this.appendContainer(t),q([t.tooltipEle],"e-hidden"),t.addDescribedBy(e,t.ctrlId+"_content"),t.renderContent(e),U([t.tooltipEle],PS),t.showTipPointer&&t.renderArrow(),t.renderCloseIcon(),t.renderPopup(e),t.adjustArrow(e,t.position,t.tooltipPositionX,t.tooltipPositionY),Vt.stop(t.tooltipEle),t.reposition(e))},VS.prototype.tooltipAfterRender=function(t,i,n,o){t&&(q([o.tooltipEle],PS),U([o.tooltipEle],BS),o.tooltipEventArgs={type:i?i.type:null,cancel:!1,target:t,event:i||null,element:o.tooltipEle,isInteracted:!je(i)},o.needTemplateReposition()&&!o.mouseTrail&&("None"===n.effect||"FadeIn"===n.effect||this.isReact&&"string"!=typeof o.content)&&(o.tooltipEle.style.display="none"),o.trigger("beforeOpen",o.tooltipEventArgs,function(e){o.beforeOpenCallback(e,t,n,i)}.bind(o)))},VS.prototype.beforeOpenCallback=function(e,t,i,n){var o,r=this;e.cancel?(this.isHidden=!0,this.clear(),this.mouseMoveBeforeRemove(),this.restoreElement(t)):(o={name:"None"===i.effect&&"Enable"===Ut?"FadeIn":this.animation.open.effect,duration:i.duration,delay:i.delay,timingFunction:"easeOut"},"None"===i.effect&&(o=void 0),0<this.openDelay?this.showTimer=setTimeout(function(){r.mouseTrail&&E.add(t,"mousemove touchstart mouseenter",r.onMouseMove,r),r.popupObj&&(r.popupObj.show(o,t),r.mouseMoveEvent)&&r.mouseTrail&&r.onMouseMove(r.mouseMoveEvent)},this.openDelay):this.popupObj&&this.popupObj.show(o,t)),n&&this.wireMouseEvents(n,t)},VS.prototype.needTemplateReposition=function(){return!je(this.viewContainerRef)&&"string"!=typeof this.viewContainerRef||this.isReact},VS.prototype.checkCollision=function(e,t,i){var n={left:t,top:i,position:this.position,horizontal:this.tooltipPositionX,vertical:this.tooltipPositionY},t=Y0(this.tooltipEle,this.checkCollideTarget(),t,i);return 0<t.length&&(n.horizontal=0<=t.indexOf("left")?"Right":0<=t.indexOf("right")?"Left":this.tooltipPositionX,n.vertical=0<=t.indexOf("top")?"Bottom":0<=t.indexOf("bottom")?"Top":this.tooltipPositionY),n},VS.prototype.calculateElementPosition=function(e,t){return[this.isBodyContainer?e.left+t.left:e.left-this.containerElement.getBoundingClientRect().left+t.left+window.pageXOffset+this.containerElement.scrollLeft,this.isBodyContainer?e.top+t.top:e.top-this.containerElement.getBoundingClientRect().top+t.top+window.pageYOffset+this.containerElement.scrollTop]},VS.prototype.collisionFlipFit=function(e,t,i){var n,o,t=this.checkCollision(e,t,i),i=t.position,r=(this.tooltipPositionY!==t.vertical&&(i=0===this.position.indexOf("Bottom")||0===this.position.indexOf("Top")?t.vertical+this.tooltipPositionX:this.tooltipPositionX+t.vertical),this.tooltipPositionX!==t.horizontal&&(0===i.indexOf("Left")&&(t.vertical="LeftTop"===i||"LeftCenter"===i?"Top":"Bottom",i=t.vertical+"Left"),0===i.indexOf("Right")&&(t.vertical="RightTop"===i||"RightCenter"===i?"Top":"Bottom",i=t.vertical+"Right"),t.horizontal=this.tooltipPositionX),this.tooltipEventArgs={type:null,cancel:!1,target:e,event:null,element:this.tooltipEle,collidedPosition:i},this.trigger("beforeCollision",this.tooltipEventArgs),this.tooltipEventArgs.cancel?i=this.position:(n=t.vertical,o=t.horizontal,t.position!==i?(s=O0(e,o,n,!this.isBodyContainer,this.isBodyContainer?null:this.containerElement.getBoundingClientRect()),this.adjustArrow(e,i,o,n),r=this.getScalingFactor(e),(r=this.calculateTooltipOffset(i,r.x,r.y)).top-=this.getOffSetPosition("TopBottom",i,this.offsetY),r.left-=this.getOffSetPosition("RightLeft",i,this.offsetX),t.position=i,s=this.calculateElementPosition(s,r),t.left=s[0],t.top=s[1]):this.adjustArrow(e,i,o,n)),{left:t.left,top:t.top}),s=this.isBodyContainer?G0(this.tooltipEle,this.checkCollideTarget(),{X:!0,Y:this.windowCollision},r):r,e=(this.tooltipEle.style.display="block",ge("."+AS,this.tooltipEle));return!this.showTipPointer||null==e||0!==i.indexOf("Bottom")&&0!==i.indexOf("Top")||((o=parseInt(e.style.left,10)-(s.left-t.left))<0?o=0:o+e.offsetWidth>this.tooltipEle.clientWidth&&(o=this.tooltipEle.clientWidth-e.offsetWidth),e.style.left=o.toString()+"px"),this.tooltipEle.style.display="",r.left=s.left,r.top=s.top,r},VS.prototype.getOffSetPosition=function(e,t,i){return-1!==e.indexOf(this.position.split(/(?=[A-Z])/)[0])&&-1!==e.indexOf(t.split(/(?=[A-Z])/)[0])?2*i:0},VS.prototype.checkCollideTarget=function(){return!this.windowCollision&&this.target?this.element:null},VS.prototype.hideTooltip=function(e,t,i){var n=this;0<this.closeDelay?(clearTimeout(this.hideTimer),clearTimeout(this.showTimer),this.hideTimer=setTimeout(function(){n.closeDelay&&n.tooltipEle&&n.isTooltipOpen||n.tooltipHide(e,t,i)},this.closeDelay)):this.tooltipHide(e,t,i)},VS.prototype.tooltipHide=function(t,i,e){var n=this,o=i?this.target?e||i.target:this.element:ge('[data-tooltip-id= "'+this.ctrlId+'_content"]',document);this.tooltipEventArgs={type:i?i.type:null,cancel:!1,target:o,event:i||null,element:this.tooltipEle,isInteracted:!je(i)},this.trigger("beforeClose",this.tooltipEventArgs,function(e){e.cancel?n.isHidden=!1:(n.mouseMoveBeforeRemove(),n.popupHide(t,o,i))})},VS.prototype.popupHide=function(e,t,i){t&&i&&this.restoreElement(t),this.isHidden=!0;i={name:"None"===e.effect&&"Enable"===Ut?"FadeOut":this.animation.close.effect,duration:e.duration,delay:e.delay,timingFunction:"easeIn"};"None"===e.effect&&(i=void 0),this.popupObj&&this.popupObj.hide(i)},VS.prototype.restoreElement=function(e){this.unwireMouseEvents(e),je(e.getAttribute("data-content"))||(e.setAttribute("title",e.getAttribute("data-content")),e.removeAttribute("data-content")),this.removeDescribedBy(e)},VS.prototype.clear=function(){var e=this.findTarget();e&&this.restoreElement(e),this.tooltipEle&&(q([this.tooltipEle],BS),U([this.tooltipEle],PS)),this.isHidden&&(this.popupObj&&this.popupObj.destroy(),this.tooltipEle&&ue(this.tooltipEle),this.tooltipEle=null,this.popupObj=null)},VS.prototype.tooltipHover=function(){this.tooltipEle&&(this.isTooltipOpen=!0)},VS.prototype.tooltipMouseOut=function(e){this.isTooltipOpen=!1,this.hideTooltip(this.animation.close,e,this.findTarget())},VS.prototype.onMouseOut=function(e){var t=e.relatedTarget;t&&!this.mouseTrail?(t=z(t,"."+CS+"."+FS+"."+kS))?E.add(t,"mouseleave",this.tooltipElementMouseOut,this):(this.hideTooltip(this.animation.close,e,this.findTarget()),0===this.closeDelay&&("None"===this.animation.close.effect||this.isReact&&"string"!=typeof this.content)&&this.clear()):(this.hideTooltip(this.animation.close,e,this.findTarget()),this.clear()),this.popupObj&&!this.popupObj.element.classList.contains(PS)&&this.clear()},VS.prototype.tooltipElementMouseOut=function(e){this.hideTooltip(this.animation.close,e,this.findTarget()),E.remove(this.element,"mouseleave",this.tooltipElementMouseOut),this.clear()},VS.prototype.onStickyClose=function(){this.close()},VS.prototype.onMouseMove=function(e){var t,i,n,o=0,r=0,r=(-1<e.type.indexOf("touch")?(e.preventDefault(),o=e.touches[0].pageX,e.touches[0]):(o=e.pageX,e)).pageY;je(this.tooltipEle)||(Vt.stop(this.tooltipEle),q([this.tooltipEle],BS),U([this.tooltipEle],PS),this.adjustArrow(e.target,this.position,this.tooltipPositionX,this.tooltipPositionY),t=this.getScalingFactor(e.target),i=o+(n=this.calculateTooltipOffset(this.position,t.x,t.y)).left+this.offsetX,n=r+n.top+this.offsetY,i=this.checkCollision(e.target,i,n),this.tooltipPositionX===i.horizontal&&this.tooltipPositionY===i.vertical||(n=0===this.position.indexOf("Bottom")||0===this.position.indexOf("Top")?i.vertical+i.horizontal:i.horizontal+i.vertical,i.position=n,this.adjustArrow(e.target,i.position,i.horizontal,i.vertical),n=this.calculateTooltipOffset(i.position,t.x,t.y),i.left=o+n.left-this.offsetX,i.top=r+n.top-this.offsetY),this.tooltipEle.style.left=i.left+"px",this.tooltipEle.style.top=i.top+"px")},VS.prototype.keyDown=function(e){this.tooltipEle&&27===e.keyCode&&this.close()},VS.prototype.touchEnd=function(e){this.tooltipEle&&null===z(e.target,"."+vS)&&!this.isSticky&&this.close()},VS.prototype.scrollHandler=function(e){!this.tooltipEle||this.isSticky||z(e.target,"."+CS+"."+FS+"."+kS)||this.isSticky||this.close()},VS.prototype.render=function(){this.initialize(),this.wireEvents(this.opensOn),this.renderComplete()},VS.prototype.preRender=function(){this.tipClass=TS,this.tooltipPositionX="Center",this.tooltipPositionY="Top",this.isHidden=!0},VS.prototype.wireEvents=function(e){for(var t=0,i=this.getTriggerList(e);t<i.length;t++){var n=i[t];if("Custom"===n)return;"Focus"===n&&this.wireFocusEvents(),"Click"===n&&E.add(this.element,F.touchStartEvent,this.targetClick,this),"Hover"===n&&(F.isDevice?(this.touchModule=new Mn(this.element,{tapHoldThreshold:500,tapHold:this.tapHoldHandler.bind(this)}),E.add(this.element,F.touchEndEvent,this.touchEndHandler,this)):E.add(this.element,"mouseover",this.targetHover,this))}this.windowResizeBound=this.windowResize.bind(this),this.keyDownBound=this.keyDown.bind(this),this.touchEndBound=this.touchEnd.bind(this),this.scrollWheelBound=this.scrollHandler.bind(this),document.addEventListener("wheel",this.scrollWheelBound),document.addEventListener("scroll",this.scrollWheelBound),document.addEventListener("touchend",this.touchEndBound),document.addEventListener("keydown",this.keyDownBound),window.addEventListener("resize",this.windowResizeBound)},VS.prototype.getTriggerList=function(e){return e?(e="Auto"===e?F.isDevice?"Hover":"Hover Focus":e).split(" "):[]},VS.prototype.wireFocusEvents=function(){if(je(this.target))E.add(this.element,"focusin",this.targetHover,this);else{var e=[].slice.call(ct(this.target,this.element));if(this.targetsList=e,!je(this.targetsList)&&0<this.targetsList.length)for(var t=0,i=e;t<i.length;t++){var n=i[t];E.add(n,"focus",this.targetHover,this)}else E.add(this.element,"focusin",this.targetHover,this)}},VS.prototype.wireMouseEvents=function(e,t){this.tooltipEle&&(this.isSticky||("focus"===e.type&&E.add(t,"blur",this.onMouseOut,this),"focusin"===e.type&&E.add(t,"focusout",this.onMouseOut,this),"mouseover"===e.type&&E.add(t,"mouseleave",this.onMouseOut,this),this.closeDelay&&(E.add(this.tooltipEle,"mouseenter",this.tooltipHover,this),E.add(this.tooltipEle,"mouseleave",this.tooltipMouseOut,this))),this.mouseTrail)&&0===this.openDelay&&E.add(t,"mousemove touchstart mouseenter",this.onMouseMove,this)},VS.prototype.unwireEvents=function(e){for(var t=0,i=this.getTriggerList(e);t<i.length;t++){var n=i[t];if("Custom"===n)return;"Focus"===n&&this.unwireFocusEvents(),"Click"===n&&E.remove(this.element,F.touchStartEvent,this.targetClick),"Hover"===n&&(F.isDevice?(this.touchModule&&this.touchModule.destroy(),E.remove(this.element,F.touchEndEvent,this.touchEndHandler)):E.remove(this.element,"mouseover",this.targetHover))}document.removeEventListener("touchend",this.touchEndBound),this.touchEndBound=null,document.removeEventListener("wheel",this.scrollWheelBound),document.removeEventListener("scroll",this.scrollWheelBound),this.scrollWheelBound=null,window.removeEventListener("resize",this.windowResizeBound),this.windowResizeBound=null,document.removeEventListener("keydown",this.keyDownBound),this.keyDownBound=null},VS.prototype.unwireFocusEvents=function(){if(je(this.target))E.remove(this.element,"focusin",this.targetHover);else{var e=[].slice.call(ct(this.target,this.element));if(!je(this.targetsList)&&0<this.targetsList.length)for(var t=0,i=e;t<i.length;t++){var n=i[t];E.remove(n,"focus",this.targetHover)}else E.remove(this.element,"focusin",this.targetHover)}},VS.prototype.unwireMouseEvents=function(e){if(!this.isSticky){for(var t=0,i=this.getTriggerList(this.opensOn);t<i.length;t++){var n=i[t];"Focus"===n&&(E.remove(e,"blur",this.onMouseOut),E.remove(e,"focusout",this.onMouseOut)),"Hover"!==n||F.isDevice||E.remove(e,"mouseleave",this.onMouseOut)}this.closeDelay&&(E.remove(e,"mouseenter",this.tooltipHover),E.remove(e,"mouseleave",this.tooltipMouseOut))}this.mouseTrail&&E.remove(e,"mousemove touchstart mouseenter",this.onMouseMove)},VS.prototype.findTarget=function(){return ge('[data-tooltip-id= "'+this.ctrlId+'_content"]',document)},VS.prototype.getModuleName=function(){return"tooltip"},VS.prototype.getPersistData=function(){return this.addOnPersist([])},VS.prototype.onPropertyChanged=function(e,t){for(var i,n,o=this.findTarget(),r=0,s=Object.keys(e);r<s.length;r++)switch(s[r]){case"width":this.tooltipEle&&o&&(this.tooltipEle.style.width=this.tooltipEle.style.maxWidth=T(e.width),this.reposition(o));break;case"height":this.tooltipEle&&o&&(this.tooltipEle.style.height=T(e.height),this.reposition(o));break;case"content":this.tooltipEle&&this.renderContent();break;case"opensOn":this.unwireEvents(t.opensOn),this.wireEvents(e.opensOn);break;case"position":this.formatPosition(),this.tooltipEle&&o&&((i=ge("."+IS,this.tooltipEle))&&(i.style.top=i.style.left=null),this.reposition(o));break;case"tipPointerPosition":this.tooltipEle&&o&&this.reposition(o);break;case"offsetX":this.tooltipEle&&(i=e.offsetX-t.offsetX,this.tooltipEle.style.left=(parseInt(this.tooltipEle.style.left,10)+i).toString()+"px");break;case"offsetY":this.tooltipEle&&(n=e.offsetY-t.offsetY,this.tooltipEle.style.top=(parseInt(this.tooltipEle.style.top,10)+n).toString()+"px");break;case"cssClass":this.tooltipEle&&(t.cssClass&&q([this.tooltipEle],t.cssClass.split(" ")),e.cssClass)&&U([this.tooltipEle],e.cssClass.split(" "));break;case"enableRtl":this.tooltipEle&&(this.enableRtl?U:q)([this.tooltipEle],"e-rtl");break;case"isSticky":this.tooltipEle&&o&&(this.renderCloseIcon(),this.reposition(o));break;case"container":je(this.containerElement)||q([this.containerElement],LS),this.container=e.container,this.tooltipEle&&o&&(this.appendContainer(this),this.reposition(o))}},VS.prototype.open=function(e,t){je(t)&&(t=this.animation.open),"none"!==(e=je(e)?this.element:e).style.display&&this.showTooltip(e,t)},VS.prototype.close=function(e){e=e||this.animation.close,this.hideTooltip(e)},VS.prototype.refresh=function(e){this.tooltipEle&&this.renderContent(e),this.popupObj&&e&&this.reposition(e),je(this.targetsList)||je(this.target)||ct(this.target,this.element).length!==this.targetsList.length&&(this.unwireEvents(this.opensOn),this.wireEvents(this.opensOn))},VS.prototype.destroy=function(){OS.prototype.destroy.call(this),this.tooltipEle&&ue(this.tooltipEle),this.popupObj&&this.popupObj.destroy(),uv(),q([this.element],vS),this.unwireEvents(this.opensOn),this.unwireMouseEvents(this.element),this.tooltipEle=null,this.popupObj=null;for(var e=0,t=ct('[data-tooltip-id= "'+this.ctrlId+'_content"]',this.element);e<t.length;e++){var i=t[e];this.restoreElement(i)}this.containerElement=null,this.tipClass=null,this.tooltipPositionX=null,this.tooltipPositionY=null,this.ctrlId=null,this.tooltipEventArgs=null,this.touchModule=null,this.mouseMoveEvent=null,this.mouseMoveTarget=null,this.containerElement=null,this.targetsList=null},Ir([e("auto")],VS.prototype,"width",void 0),Ir([e("auto")],VS.prototype,"height",void 0),Ir([e()],VS.prototype,"content",void 0),Ir([e("body")],VS.prototype,"container",void 0),Ir([e()],VS.prototype,"target",void 0),Ir([e("TopCenter")],VS.prototype,"position",void 0),Ir([e(0)],VS.prototype,"offsetX",void 0),Ir([e(0)],VS.prototype,"offsetY",void 0),Ir([e(!0)],VS.prototype,"showTipPointer",void 0),Ir([e(!0)],VS.prototype,"enableHtmlParse",void 0),Ir([e(!1)],VS.prototype,"windowCollision",void 0),Ir([e("Auto")],VS.prototype,"tipPointerPosition",void 0),Ir([e("Auto")],VS.prototype,"opensOn",void 0),Ir([e(!1)],VS.prototype,"mouseTrail",void 0),Ir([e(!1)],VS.prototype,"isSticky",void 0),Ir([t({},tn)],VS.prototype,"animation",void 0),Ir([e(0)],VS.prototype,"openDelay",void 0),Ir([e(0)],VS.prototype,"closeDelay",void 0),Ir([e()],VS.prototype,"cssClass",void 0),Ir([e(!0)],VS.prototype,"enableHtmlSanitizer",void 0),Ir([e("")],VS.prototype,"htmlAttributes",void 0),Ir([i()],VS.prototype,"beforeRender",void 0),Ir([i()],VS.prototype,"beforeOpen",void 0),Ir([i()],VS.prototype,"afterOpen",void 0),Ir([i()],VS.prototype,"beforeClose",void 0),Ir([i()],VS.prototype,"afterClose",void 0),Ir([i()],VS.prototype,"beforeCollision",void 0),Ir([i()],VS.prototype,"created",void 0),Ir([i()],VS.prototype,"destroyed",void 0);var OS,NS=Ir([Bt],VS);function VS(e,t){e=OS.call(this,e,t)||this;return e.mouseMoveEvent=null,e.mouseMoveTarget=null,e.containerElement=null,e.isBodyContainer=!0,e}var _S={},HS=30,zS=30,jS=30,WS=30,QS=30,US=30,qS=36,GS=36,YS="e-spin-show",XS="e-spin-hide",KS="e-spin-material",JS="e-spin-material3",ZS="e-spin-tailwind3",$S="e-spin-fabric",eA="e-spin-fluent",tA="e-spin-fluent2",iA="e-spin-tailwind",nA="e-spin-bootstrap",oA="e-spin-bootstrap4",rA="e-spin-bootstrap5",sA="e-spin-high-contrast",aA="e-spinner-pane",lA="e-spinner-inner",hA="e-path-circle",dA="e-path-arc",pA="e-spin-label",cA="e-spin-template",uA=null,gA=null;function mA(e,t){var i,n,o;e.target&&(t=je(t)?Q:t,i=e.target,n=(o=t)("div",{}),o=o("div",{}),n.classList.add(aA),o.classList.add(lA),o.setAttribute("aria-disabled","true"),i.appendChild(n),n.appendChild(o),i={wrap:n,inner_wrap:o},je(e.cssClass)||(n=e.cssClass.split(" ").filter(function(e){return""!==e.trim()}),(o=i.wrap.classList).add.apply(o,n)),je(e.template)&&je(uA)?(n=je(e.type)?(o=i.wrap,window.getComputedStyle(o,":after").getPropertyValue("content").replace(/['"]+/g,"")):e.type,o=function(e,t){var i;switch(t){case"Material":i=HS;break;case"Material3":i=zS;break;case"Fabric":i=jS;break;case"Tailwind":case"Tailwind-dark":case"Tailwind3":i=jS;break;case"Fluent":i=WS;break;case"Fluent2":i=QS;break;case"Bootstrap4":i=qS;break;case"Bootstrap5":i=GS;break;default:i=US}return e=e?parseFloat(e+""):i,"Bootstrap"===t?e:e/2}(je(e.width)?void 0:e.width,n),fA(n,i.wrap,o,t),je(e.label)||(n=i.inner_wrap,o=e.label,(t=(t=t)("div",{})).classList.add(pA),t.innerHTML=o,n.appendChild(t))):(o=je(e.template)?uA:e.template,i.wrap.classList.add(cA),bA(i.wrap,o,gA)),i.wrap.classList.add(XS))}function fA(e,t,i,n){var o,r,s,a,l,h,d,p,c,u,g,m,f,y,v,b,w,C,S,A=t.querySelector("."+lA),t=A.querySelector("svg");switch(je(t)||A.removeChild(t),e){case"Material":b=A,w=i,C=n,S=wA(),_S[""+S]={timeOut:0,type:"Material",radius:w},SA(b,S,0,KS),xA(w,b,"Material",KS);break;case"Material3":S=A,C=i,w=n,b=wA(),_S[""+b]={timeOut:0,type:"Material3",radius:C},SA(S,b,0,JS),xA(C,S,"Material3",JS);break;case"Fabric":f=A,y=i,v=wA(),_S[""+v]={timeOut:0,type:"Fabric",radius:y},CA(f,v,$S),DA(y,f,$S);break;case"Fluent":v=A,y=i,f=wA(),_S[""+f]={timeOut:0,type:"Fluent",radius:y},CA(v,f,eA),DA(y,v,eA);break;case"Fluent2":u=A,g=i,m=wA(),_S[""+m]={timeOut:0,type:"Fluent2",radius:g},CA(u,m,tA),DA(g,u,tA);break;case"Bootstrap":m=A,g=i,u=wA(),_S[""+u]={timeOut:0,type:"Bootstrap",radius:g};var x=m,I=u,T=document.createElementNS("http://www.w3.org/2000/svg","svg");T.setAttribute("id",I),T.setAttribute("class",nA),T.setAttribute("viewBox","0 0 64 64"),x.insertBefore(T,x.firstChild);for(var E=0;E<=7;E++){var D=document.createElementNS("http://www.w3.org/2000/svg","circle");D.setAttribute("class",hA+"_"+E),D.setAttribute("r","2"),D.setAttribute("transform","translate(32,32)"),T.appendChild(D)}for(var I=g,M=m.querySelector("svg.e-spin-bootstrap"),k=(M.style.width=M.style.height=I+"px",90),P=0;P<=7;P++){var B=MA(0,0,24,k),F=M.querySelector("."+hA+"_"+P);F.setAttribute("cx",B.x+""),F.setAttribute("cy",B.y+""),k=360<=k?0:k,k+=45}break;case"HighContrast":x=A,I=i,c=wA(),_S[""+c]={timeOut:0,type:"HighContrast",radius:I},CA(x,c,sA),DA(I,x,sA);break;case"Bootstrap4":c=A,h=i,d=n,p=wA(),_S[""+p]={timeOut:0,type:"Bootstrap4",radius:h},SA(c,p,0,oA),xA(h,c,"Bootstrap4",oA);break;case"Bootstrap5":p=A,d=i,h=n,l=wA(),_S[""+l]={timeOut:0,type:"Bootstrap5",radius:d},SA(p,l,0,rA),xA(d,p,"Bootstrap5",rA);break;case"Tailwind":case"Tailwind-dark":l=A,s=i,a=wA(),_S[""+a]={timeOut:0,type:"Tailwind",radius:s},CA(l,a,iA),DA(s,l,iA);break;case"Tailwind3":a=A,s=i,o=n,r=wA(),_S[""+r]={timeOut:0,type:"Tailwind3",radius:s},SA(a,r,0,ZS),xA(s,a,"Tailwind3",ZS)}}function yA(e,t){var i=[],n=e,o=t,r=!1,s=1;return function e(t){i.push(t);t===o&&1!==s||(t<=n&&1<t&&!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))),++s,e(t))}(n),i}function vA(e){for(var t=e.querySelector("svg.e-spin-bootstrap").getAttribute("id"),i=1;i<=8;i++)!function(t,e,i,n){var o=0;function r(e){_S[""+n].isAnimate&&(++o,t.setAttribute("r",e+""),o>=i.length&&(o=0),_S[n].timeOut=setTimeout(r.bind(null,i[o]),18))}r(e)}(e.getElementsByClassName("e-path-circle_"+(8===i?0:i))[0],i,yA(i,i),t)}function bA(e,t,i){je(i)||e.classList.add(i),e.querySelector(".e-spinner-inner").innerHTML=t}function wA(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<5;i++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}function CA(e,t,i){var n=document.createElementNS("http://www.w3.org/2000/svg","svg"),t=(n.setAttribute("id",t),n.setAttribute("class",i),document.createElementNS("http://www.w3.org/2000/svg","path")),i=(t.setAttribute("class",hA),document.createElementNS("http://www.w3.org/2000/svg","path"));i.setAttribute("class",dA),e.insertBefore(n,e.firstChild),n.appendChild(t),n.appendChild(i)}function SA(e,t,i,n){var o=document.createElementNS("http://www.w3.org/2000/svg","svg"),r=document.createElementNS("http://www.w3.org/2000/svg","path");o.setAttribute("class",n),o.setAttribute("id",t),r.setAttribute("class",hA),e.insertBefore(o,e.firstChild),o.appendChild(r)}function AA(e){var r,t,s,a,l,i,h,d,p,c,u,g;function m(e){var t,i=Math.max(0,Math.min((new Date).getTime()-d,a)),n=s(i,r,p,a),o=e.container;je(o.querySelector("svg.e-spin-material"))&&je(o.querySelector("svg.e-spin-material3"))&&je(o.querySelector("svg.e-spin-tailwind3"))||(t=void 0,je(o.querySelector("svg.e-spin-material"))||je(o.querySelector("svg.e-spin-material").querySelector("path.e-path-circle"))?je(o.querySelector("svg.e-spin-material3"))||je(o.querySelector("svg.e-spin-material3").querySelector("path.e-path-circle"))?je(o.querySelector("svg.e-spin-tailwind3"))||je(o.querySelector("svg.e-spin-tailwind3").querySelector("path.e-path-circle"))||(t=o.querySelector("svg.e-spin-tailwind3")):t=o.querySelector("svg.e-spin-material3"):t=o.querySelector("svg.e-spin-material"),je(t))||((o=t.querySelector("path.e-path-circle")).setAttribute("stroke-dashoffset",TA(c,u,n,l)+""),o.setAttribute("transform","rotate("+g+" "+c/2+" "+c/2+")")),h===e.globalInfo[e.uniqueID].previousId&&i<a?_S[e.uniqueID].timeOut=setTimeout(m.bind(null,e),1):AA(e)}r=1,t=149,s=EA,a=1333,e.globalInfo[e.uniqueID].count,l=75,h=++(i=e).globalInfo[i.uniqueID].previousId,d=(new Date).getTime(),p=t-r,c=function(e){return parseFloat(e)}(2*i.globalInfo[i.uniqueID].radius+""),u=IA(c),g=-90*(i.globalInfo[i.uniqueID].count||0),m(i),e.globalInfo[e.uniqueID].count=++e.globalInfo[e.uniqueID].count%4}function xA(e,t,i,n){var e=2*e,t=t.querySelector("svg."+n),n=t.querySelector("path.e-path-circle"),o=IA(e),r=e/2+"px";t.setAttribute("viewBox","0 0 "+e+" "+e),t.style.width=t.style.height=e+"px",t.style.transformOrigin=r+" "+r+" "+r,n.setAttribute("d",function(e,t){e/=2,t/=2;return"M"+e+","+t+"A"+(e-t)+","+(e-t)+" 0 1 1 "+t+","+e}(e,o)),"Material"!==i&&"Material3"!==i&&"Fluent2"!==i&&"Tailwind3"!==i||(n.setAttribute("stroke-width",o+""),n.setAttribute("stroke-dasharray",(e-o)*Math.PI*.75+""),n.setAttribute("stroke-dashoffset",TA(e,o,1,75)+""))}function IA(e){return.1*e}function TA(e,t,i,n){return(e-t)*Math.PI*(3*n/100-i/100)}function EA(e,t,i,n){n=(e/=n)*e,e*=n;return t+i*(6*e*n+-15*n*n+10*e)}function DA(e,t,i){var n=e,o=e,r=2*e,t=t.querySelector("."+i),i=t.querySelector(".e-path-circle"),s=t.querySelector(".e-path-arc"),a=r/2+"px";i.setAttribute("d",["M",n,o,"m",-e,0,"a",e,e,0,1,0,2*e,0,"a",e,e,0,1,0,2*-e,0].join(" ")),s.setAttribute("d",function(e,t,i,n,o){o=MA(e,t,i,o),e=MA(e,t,i,n);return["M",o.x,o.y,"A",i,i,0,0,0,e.x,e.y].join(" ")}(n,o,e,315,45)),t.setAttribute("viewBox","0 0 "+r+" "+r),t.style.transformOrigin=a+" "+a+" "+a,t.style.width=t.style.height=r+"px"}function MA(e,t,i,n){n=(n-90)*Math.PI/180;return{x:e+i*Math.cos(n),y:t+i*Math.sin(n)}}function kA(e){PA(e,!1)}function PA(t,e){var i,n,o,r,s;if(t)if(t.classList.contains(aA))i=t;else{var a=t.querySelectorAll("."+aA);if(F.isIE){for(var l=0;l<a.length;l++)if(a[l].parentElement&&a[l].parentElement===t){i=a[l];break}}else i=Array.from(a).find(function(e){return e.parentElement===t})||null}if(t&&i){var h=i.querySelector("."+lA);if(e?!i.classList.contains(cA)&&!i.classList.contains(XS):!i.classList.contains(cA)&&!i.classList.contains(YS)){var d=i.querySelector("svg");if(je(d))return;var p=d.getAttribute("id");switch(_S[""+p].isAnimate=!e,_S[""+p].type){case"Material":case"Material3":case"Tailwind3":e?clearTimeout(_S[p].timeOut):(n=h,r=_S[o=p].radius,s={},_S[""+o].timeOut=0,s[""+o]={radius:r,count:0,previousId:0},AA({uniqueID:o,container:n,globalInfo:s,timeOutVar:0}));break;case"Bootstrap":e?clearTimeout(_S[p].timeOut):vA(h)}}e?mt(i,[XS],[YS]):mt(i,[YS],[XS]),t=null}}function BA(e){PA(e,!0)}function FA(e,t){for(var i,n,o,r,s,a=je(t)?Q:t,l=(void 0!==e.template&&(uA=e.template,void 0!==e.template)&&(gA=e.cssClass),document.querySelectorAll("."+aA)),h=0;h<l.length;h++)if(i=e.template,n=l[h],o=e.type,r=e.cssClass,s=a,je(i)&&!n.classList.contains(cA)){d=g=u=c=p=void 0;var d,p=n,c=o,u=r,g=s;je(u)||p.classList.add(u),je(u=p.querySelector("svg"))||(d="Bootstrap"===c?parseFloat(u.style.height):parseFloat(u.style.height)/2,0<=u.getAttribute("class").split(/\s/).indexOf("e-spin-material")&&(u=u.getAttribute("id"),clearTimeout(_S[""+u].timeOut)),fA(c,p,d,g)),(n.classList.contains(YS)?(n.classList.remove(YS),kA):(n.classList.remove(XS),BA))(n)}else je(r)||(gA=r),je(uA=i)||bA(n,uA,gA)}var LA,RA,OA,NA,VA,_A="load",HA="rowDataBound",zA="queryCellInfo",jA="headerCellInfo",WA="actionBegin",QA="actionComplete",UA="actionFailure",qA="dataBound",GA="rowSelecting",YA="rowSelected",XA="rowDeselecting",KA="rowDeselected",JA="cellSelecting",ZA="cellSelected",$A="cellDeselecting",e1="cellDeselected",t1="columnSelecting",i1="columnSelected",n1="columnDeselecting",o1="columnDeselected",r1="columnDragStart",s1="columnDrag",a1="columnDrop",l1="rowDragStartHelper",h1="rowDragStart",d1="rowDrag",p1="rowDrop",c1="beforePrint",u1="printComplete",g1="detailDataBound",m1="toolbarClick",f1="batchAdd",y1="batchCancel",v1="batchDelete",b1="beforeBatchAdd",w1="beforeBatchDelete",C1="beforeBatchSave",S1="beginEdit",A1="cellEdit",x1="cellSave",I1="cellSaved",T1="recordDoubleClick",E1="recordClick",D1="beforeDataBound",M1="beforeOpenColumnChooser",k1="beforeOpenAdaptiveDialog",P1="resizeStart",B1="resizing",F1="resizeStop",L1="checkBoxChange",R1="beforeCopy",O1="beforePaste",N1="beforeAutoFill",V1="filterchoicerequest",_1="filterAfterOpen",H1="filterBeforeOpen",z1="filterSearchBegin",j1="commandClick",W1="exportGroupCaption",Q1="lazyLoadGroupExpand",U1="lazyLoadGroupCollapse",q1="initial-load",G1="initial-end",Y1="data-ready",X1="content-ready",K1="ui-update",J1="on-empty",Z1="inbound-model-changed",$1="model-changed",ex="colgroup-refresh",tx="header-refreshed",ix="paging-complete",nx="sorting-complete",ox="filtering-complete",rx="searching-complete",sx="reorder-complete",ax="rowdraganddrop-complete",lx="grouping-complete",hx="ungrouping-complete",dx="group-aggregates",px="refresh-footer-rendered",cx="refresh-aggregate-cell",ux="refresh-aggregates",gx="rowselected",mx="cellselected",fx="destroy-autofill-elements",yx="beforecellfocused",vx="cellfocused",bx="key-pressed",wx="click",Cx="destroy",Sx="column-visible-changed",Ax="scroll",xx="column-width-changed",Ix="column-position-changed",Tx="rows-added",Ex="rows-removed",Dx="column-drag-stop",Mx="header-drop",kx="datasource-modified",Px="refresh-complete",Bx="refresh-virtual-block",Fx="dblclick",Lx="toolbar-refresh",Rx="bulk-save",Ox="auto-col",Nx="tooltip-destroy",Vx="update-data",_x="save-complete",Hx="delete-complete",zx="prevent-batch",jx="dialog-destroy",Wx="crud-Action",Qx="add-delete-Action",Ux="destroy-form",qx="double-tap",Gx="beforeExcelExport",Yx="excelExportComplete",Xx="excelQueryCellInfo",Kx="excelHeaderQueryCellInfo",Jx="exportDetailDataBound",Zx="exportDetailTemplate",$x="beforePdfExport",eI="pdfExportComplete",tI="pdfQueryCellInfo",iI="pdfHeaderQueryCellInfo",nI="contextMenuClick",oI="freezerender",rI="contextMenuOpen",sI="columnMenuClick",aI="columnMenuOpen",lI="filterOpen",hI="filterDialogCreated",dI="filter-menu-close",pI="initForeignKeyColumn",cI="getForeignKeyData",uI="generateQuery",gI="showEmptyGrid",mI="foreignKeyData",fI="columnDataStateChange",yI="dataStateChange",vI="dataSourceChanged",bI="rtl-updated",wI="beforeFragAppend",CI="textWrapRefresh",SI="recordAdded",AI="cancel-Begin",xI="editNextValCell",II="hierarchyprint",TI="expandchildgrid",EI="printGrid-Init",DI="export-RowDataBound",MI="export-DataBound",kI="row-position-changed",PI="columnChooserOpened",BI="batchedit-form",FI="edit-form",LI="before-batch-cancel",RI="batcheditform-rendered",OI="partial-refresh",NI="beforeCustomFilterOpen",VI="select-virtual-Row",_I="columns-prepared",HI="cbox-filter-begin",zI="cbox-filter-complete",jI="filter-Prevent",WI="before-filter-cmenu-open",QI="validation-custom-placement",UI="filter-cbox-value",qI="restore-Focus",GI="detail-state-change",YI="detail-indentcell-info",XI="virtaul-cell-focus",KI="virtual-scroll-edit-action-begin",JI="virtual-scroll-edit-success",ZI="virtual-scroll-edit-cancel",$I="virtual-scroll-edit",eT="refresh-virtual-cache",tT="edit-reset",iT="virtual-scroll-add-action-begin",nT="get-virtual-data",oT="refresh-infinite-mode-blocks",rT="reset-infinite-blocks",sT="infinite-scroll-handler",aT="infinite-page-query",lT="infinite-show-hide",hT="append-infinite-content",dT="remove-infinite-rows",pT="set-infinite-cache",cT="infinite-edit-handler",uT="initial-collapse",gT="close-filter-dialog",mT="columnChooserCancelBtnClick",fT="get-filterbar-operator",yT="reset-columns",vT="pdfAggregateQueryCellInfo",bT="excelAggregateQueryCellInfo",wT="group-cache",CT="lazy-load-scroll-handler",ST="group-collapse",AT="beforeCheckboxRenderer",xT="refreshResizeHandlers",IT="refresh-frozen-columns",TT="set-reorder-destination-element",ET="refresh-virtual-frozen-height",DT="set-freeze-selection",MT="before-refresh-on-data-change",kT="immutable-batch-cancel",PT="refresh-virtual-frozenrows",BT="check-scroll-reset",FT="prevent-frozen-scroll-refresh",LT="next-cell-index",RT="refresh-infinite-current-view-data",OT="infinite-crud-cancel",NT="filter-dialog-close",VT="refresh-cutsom-filter-ok-button",_T="refresh-cutsom-filter-clear-button",HT="render-responsive-cmenu",zT="filter-cmenu-select",jT="custom-filter-close",WT="set-fullscreen-dialog",QT="refresh-Expand-and-Collapse",UT="row-mode-change",qT="enter-key-handler",GT="refresh-virtual-max-page",YT="set-virtual-page-query",XT="select-row-on-context-open",KT="pager-refresh",JT="closeinline",ZT="close-edit",$T="reset-virtual-focus",eE="refresh-virtual-editform-cells",tE="scroll-to-edit",iE="before-checkbox-renderer-query",nE="create-virtual-validation-form",oE="validate-virtual-form",rE="destroy-child-grid",sE="sticky-scroll-complete",aE="infinite-group-collapse",lE="refresh-infinite-persist-selection",hE="refresh-infinite-editrowindex",dE="after-filter-column-menu-close",pE="beforeCheckboxfilterRenderer",cE="commandColumnDestroy",uE="cancelcnfrmDlg",gE="refresh-Virtual-LazyLoad-Cache",mE="refresh-Frozen-Position",fE="refresh-Resize-Position",yE="refresh-Split-Frozen-Column",vE="render-Responsive-Change-Action",bE="render-Responsive-Column-Chooser-Div",wE="show-Add-New-Row-Focus",CE="infinitescroll-complete",SE="last-rowcell-border-updated",AE="destroy-edit-form",xE="beforeDetailTemplateDetach",IE="detach-detail-template",TE=((h0=LA=LA||{})[h0.Data=0]="Data",h0[h0.Header=1]="Header",h0[h0.Summary=2]="Summary",h0[h0.GroupSummary=3]="GroupSummary",h0[h0.CaptionSummary=4]="CaptionSummary",h0[h0.Filter=5]="Filter",h0[h0.Indent=6]="Indent",h0[h0.GroupCaption=7]="GroupCaption",h0[h0.GroupCaptionEmpty=8]="GroupCaptionEmpty",h0[h0.Expand=9]="Expand",h0[h0.HeaderIndent=10]="HeaderIndent",h0[h0.StackedHeader=11]="StackedHeader",h0[h0.DetailHeader=12]="DetailHeader",h0[h0.DetailExpand=13]="DetailExpand",h0[h0.CommandColumn=14]="CommandColumn",h0[h0.DetailFooterIntent=15]="DetailFooterIntent",h0[h0.RowDragIcon=16]="RowDragIcon",h0[h0.RowDragHIcon=17]="RowDragHIcon",(Ir=RA=RA||{})[Ir.Header=0]="Header",Ir[Ir.Content=1]="Content",Ir[Ir.Summary=2]="Summary",(h0=OA=OA||{})[h0.Add=0]="Add",h0[h0.Edit=1]="Edit",h0[h0.Update=2]="Update",h0[h0.Delete=3]="Delete",h0[h0.Cancel=4]="Cancel",h0[h0.Print=5]="Print",h0[h0.Search=6]="Search",h0[h0.ColumnChooser=7]="ColumnChooser",h0[h0.PdfExport=8]="PdfExport",h0[h0.ExcelExport=9]="ExcelExport",h0[h0.CsvExport=10]="CsvExport",h0[h0.WordExport=11]="WordExport",(Ir=NA=NA||{})[Ir.isEdit=0]="isEdit",Ir[Ir.isAdd=1]="isAdd",Ir[Ir.isSort=2]="isSort",Ir[Ir.isFilter=3]="isFilter",Ir[Ir.isColMenu=4]="isColMenu",Ir[Ir.isColumnChooser=5]="isColumnChooser",(h0=VA=VA||{})[h0.isInitial=0]="isInitial",h0[h0.isSearch=1]="isSearch",EE.prototype.reorderRows=function(e){this.parent.getDataModule().isRemote()?this.parent.getCurrentViewRecords().splice(e.toIndex,0,this.parent.getCurrentViewRecords().splice(e.fromIndex,1)[0]):this.dataManager.dataSource.json.splice(e.toIndex,0,this.dataManager.dataSource.json.splice(e.fromIndex,1)[0])},EE.prototype.getModuleName=function(){return"data"},EE.prototype.initDataManager=function(){var e=this.parent;this.dataManager=e.dataSource instanceof me?e.dataSource:je(e.dataSource)?new me:new me(e.dataSource),!e.isAngular||e.query instanceof ya?(this.isQueryInvokedFromData=!0,e.query instanceof ya||(e.query=new ya)):e.setProperties({query:new ya},!0)},EE.prototype.generateQuery=function(e,t){var i=this.parent,i=je(i.getQuery())?new ya:i.getQuery().clone();if("ExcludeHidden"===this.parent.columnQueryMode)i.select(this.parent.getColumns().filter(function(e){return!(!0!==e.isPrimaryKey&&!1===e.visible||void 0===e.field)}).map(function(e){return e.field}));else if("Schema"===this.parent.columnQueryMode){for(var n=[],o=this.parent.columns,r=0;r<o.length;r++)n.push(o[parseInt(r.toString(),10)].field);i.select(n)}return this.filterQuery(i),this.searchQuery(i),this.aggregateQuery(i),this.sortQuery(i),BB(this.parent)?this.virtualGroupPageQuery(i):this.pageQuery(i,e),!je(t)&&t||this.groupQuery(i),i},EE.prototype.aggregateQuery=function(e){for(var t=this.parent.aggregates,i=0;i<t.length;i++)for(var n=t[parseInt(i.toString(),10)],o=0;o<n.columns.length;o++)for(var r=n.columns[parseInt(o.toString(),10)],s=r.type instanceof Array?r.type:[r.type],a=0;a<s.length;a++)e.aggregate(s[parseInt(a.toString(),10)].toLowerCase(),r.field);return e},EE.prototype.virtualGroupPageQuery=function(e){if(e.queries.length)for(var t=0;t<e.queries.length;t++)"onPage"===e.queries[parseInt(t.toString(),10)].fn&&e.queries.splice(t,1);return e},EE.prototype.pageQuery=function(e,t){var i=this.parent,n={query:e,skipPage:!1};if(i.notify(YT,n),!n.skipPage&&(i.allowPaging||i.enableVirtualization||i.enableInfiniteScrolling)&&!0!==t){if(i.pageSettings.currentPage=Math.max(1,i.pageSettings.currentPage),i.pageSettings.pageCount<=0&&(i.pageSettings.pageCount=8),i.pageSettings.pageSize<=0&&(i.pageSettings.pageSize=12),e.queries.length)for(var o=0;o<e.queries.length;o++)"onPage"===e.queries[parseInt(o.toString(),10)].fn&&e.queries.splice(o,1);!je(i.infiniteScrollModule)&&i.enableInfiniteScrolling?this.parent.notify(aT,e):e.page(i.pageSettings.currentPage,!(i.allowPaging&&i.pagerModule&&i.pagerModule.pagerObj.isAllPage)||i.isManualRefresh||this.dataManager.dataSource.offline||this.dataManager.adaptor instanceof Ga?i.pageSettings.pageSize:null)}return e},EE.prototype.groupQuery=function(e){var t=this.parent;if(t.allowGrouping&&t.groupSettings.columns.length){this.parent.groupSettings.enableLazyLoading&&e.lazyLoad.push({key:"isLazyLoad",value:this.parent.groupSettings.enableLazyLoading});for(var i=t.groupSettings.columns,n=0,o=i.length;n<o;n++){var r=this.getColumnByField(i[parseInt(n.toString(),10)]),s=(r||this.parent.log("initial_action",{moduleName:"group",columnName:i[parseInt(n.toString(),10)]}),r.enableGroupByFormat),r=r.format;s?e.group(i[parseInt(n.toString(),10)],this.formatGroupColumn.bind(this),r):e.group(i[parseInt(n.toString(),10)],null)}}return e},EE.prototype.sortQuery=function(e){var t=this.parent;if((t.allowSorting||t.allowGrouping)&&t.sortSettings.columns.length){for(var i=t.sortSettings.columns,n=[],o=i.length-1;-1<o;o--){if(!(s=this.getColumnByField(i[parseInt(o.toString(),10)].field)))return this.parent.log("initial_action",{moduleName:"sort",columnName:i[parseInt(o.toString(),10)].field}),e;s.setSortDirection(i[parseInt(o.toString(),10)].direction);var r=i[parseInt(o.toString(),10)].direction;s.sortComparer&&(this.parent.log("grid_sort_comparer"),r=this.isRemote()?i[parseInt(o.toString(),10)].direction:s.sortComparer.bind(s)),-1===t.groupSettings.columns.indexOf(i[parseInt(o.toString(),10)].field)?s.isForeignColumn()||s.sortComparer?e.sortByForeignKey(s.field,r,void 0,i[parseInt(o.toString(),10)].direction.toLowerCase()):e.sortBy(s.field,r):n.push({direction:r,field:s.field})}for(var s,o=0,a=n.length;o<a;o++)"string"==typeof n[parseInt(o.toString(),10)].direction?e.sortBy(n[parseInt(o.toString(),10)].field,n[parseInt(o.toString(),10)].direction):(s=this.getColumnByField(n[parseInt(o.toString(),10)].field),e.sortByForeignKey(n[parseInt(o.toString(),10)].field,n[parseInt(o.toString(),10)].direction,void 0,s.getSortDirection().toLowerCase()))}return e},EE.prototype.searchQuery=function(e,t,i){var n=this.parent.searchSettings,o=!je(n.fields)&&n.fields.length?n.fields:this.getSearchColumnFieldNames(),r=[];if(!je(this.parent.searchSettings.key)&&this.parent.searchSettings.key.length){var s=this.parent.getForeignKeyColumns().some(function(e){return-1<o.indexOf(e.field)}),a=(i?t.dataSource:this.dataManager).adaptor;if(s||a.getModuleName&&"ODataV4Adaptor"===a.getModuleName()){for(var o=i?[t.foreignKeyValue]:o,l=0;l<o.length;l++){var h=i?t:this.getColumnByField(o[parseInt(l.toString(),10)]);h.isForeignColumn()&&!i?r=this.fGeneratePredicate(h,r):r.push(new ba(o[parseInt(l.toString(),10)],n.operator,n.key,n.ignoreCase,n.ignoreAccent))}s=ba.or(r);s.key=n.key,e.where(s)}else e.search(n.key,o,n.operator,n.ignoreCase,n.ignoreAccent)}return e},EE.prototype.filterQuery=function(e,t,i){var n,o=this.parent,r=[],s=this.parent.getForeignKeyColumns();if(o.allowFiltering&&o.filterSettings.columns.length){for(var a=t||o.filterSettings.columns,l=0,h=o.getColumns();l<h.length;l++)(A=h[l]).field,A.filter.type||o.filterSettings.type;for(var d=[],p=[],c=0,u=a;c<u.length;c++){var g=(A=u[c]).isForeignKey?o.getColumnByUid(A.uid):o.getColumnByField(A.field);je(A.type)&&g&&("date"===g.type||"datetime"===g.type||"dateonly"===g.type)&&(A.type=(A.isForeignKey?o.getColumnByUid(A.uid):o.getColumnByField(A.field)).type),(A.isForeignKey?d:p).push(A)}if(p.length){for(var m=0,f=p.length;m<f;m++)p[parseInt(m.toString(),10)].uid=p[parseInt(m.toString(),10)].uid||this.parent.grabColumnByFieldFromAllCols(p[parseInt(m.toString(),10)].field,p[parseInt(m.toString(),10)].isForeignKey).uid;for(var y=B_.getPredicate(p),v=0,b=Object.keys(y);v<b.length;v++){var w=b[v];r.push(y[""+w])}}if(d.length)for(var C=0,S=d;C<S.length;C++){(A=S[C]).uid=A.uid||this.parent.grabColumnByFieldFromAllCols(A.field,A.isForeignKey).uid;var A,x=this.parent.grabColumnByUidFromAllCols(A.uid);if(x||this.parent.log("initial_action",{moduleName:"filter",columnName:A.field}),x.isForeignColumn()&&MB(A.field,s)&&!i)x.columnData.length||(n=!0),r=this.fGeneratePredicate(x,r);else for(var y=B_.getPredicate(a),I=0,T=Object.keys(y);I<T.length;I++){w=T[I];r.push(y[""+w])}}r.length&&!n?e.where(ba.and(r)):this.parent.notify(gI,{})}return e},EE.prototype.fGeneratePredicate=function(e,t){var i={};return e&&(this.parent.notify(uI,{predicate:i,column:e}),i.predicate.predicates.length)&&t.push(i.predicate),t},EE.prototype.getData=function(e,t){var i=this,n=(void 0===e&&(e={requestType:""}),this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames()));if(this.parent.log("datasource_syntax_mismatch",{dataState:this.parent}),this.parent.dataSource&&"result"in this.parent.dataSource)return this.eventPromise(e,t,n).promise;var o=void 0;switch(e.requestType){case"delete":t=t||this.generateQuery();var r,o=1===Object.keys(e.data).length?this.dataManager.remove(n,e.data[0],t.fromTable,t):((r={addedRecords:[],deletedRecords:[],changedRecords:[]}).deletedRecords=e.data,this.dataManager.saveChanges(r,n,t.fromTable,t.requiresCount()));break;case"save":t=t||this.generateQuery(),e.index=je(e.index)?0:e.index,o=this.dataManager.insert(e.data,t.fromTable,t,e.index)}return!(e.promise=o)||Array.isArray(o)||o.hasOwnProperty("deletedRecords")?this.insert(t,e):o.then(function(){return i.insert(t,e)})},EE.prototype.insert=function(e,t){return"save"===t.requestType&&(t.query=e,this.parent.notify(SI,t)),this.executeQuery(e)},EE.prototype.executeQuery=function(e){var t,i=this;return this.dataManager.ready?(t=new ll,this.dataManager.ready.then(function(){i.dataManager.executeQuery(e).then(function(e){t.resolve(e)})}).catch(function(e){t.reject(e)}),t.promise):this.dataManager.executeQuery(e)},EE.prototype.formatGroupColumn=function(e,t){var i=this.serviceLocator,t=this.getColumnByField(t),n=e;return t.type||(t.type=n.getDay?0<n.getHours()||0<n.getMinutes()||0<n.getSeconds()||0<n.getMilliseconds()?"datetime":"date":typeof e),je(t.getFormatter())&&yB(i,t),v0.prototype.toView(e,t.getFormatter())},EE.prototype.crudActions=function(e){var t=this.generateQuery(),i=null,n=this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames());this.parent.dataSource&&"result"in this.parent.dataSource&&this.eventPromise(e,t,n),"save"===e.requestType&&(i=this.dataManager.update(n,e.data,t.fromTable,t,e.previousData)),e.promise=i||e.promise,this.parent.notify(Wx,e)},EE.prototype.saveChanges=function(e,t,i,n){var o,r;return(n=void 0===n?this.generateQuery():n).requiresCount(),"result"in this.parent.dataSource?(r={requestType:"batchsave",changes:e,key:t,query:n,endEdit:(o=new ll).resolve},this.setState({isPending:!0,resolver:o.resolve}),this.parent.trigger(vI,r),o.promise):this.dataManager.saveChanges(e,t,n.fromTable,n,i)},EE.prototype.getKey=function(e){if(e&&e.length)return e[0]},EE.prototype.isRemote=function(){return!0!==this.dataManager.dataSource.offline&&void 0!==this.dataManager.dataSource.url&&""!==this.dataManager.dataSource.url},EE.prototype.addRows=function(e){for(var t=e.records.length;0<t;t--)this.parent.dataSource instanceof me&&this.dataManager.dataSource.offline?this.dataManager.dataSource.json.splice(e.toIndex,0,e.records[t-1]):this.parent.getDataModule().isRemote()||je(this.parent.dataSource)||this.parent.dataSource.result||this.parent.dataSource.splice(e.toIndex,0,e.records[t-1])},EE.prototype.removeRows=function(t){var e=this.dataManager.dataSource.json;this.parent.dataSource instanceof me&&this.dataManager.dataSource.offline?this.dataManager.dataSource.json=e.filter(function(e){return-1===t.records.indexOf(e)}):this.parent.getDataModule().isRemote()||je(this.parent.dataSource)||this.parent.dataSource.result||(this.parent.dataSource=e.filter(function(e){return-1===t.records.indexOf(e)}))},EE.prototype.getColumnByField=function(t){var i;return this.parent.columnModel.some(function(e){return(i=e).field===t})&&i},EE.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(Tx,this.addRows),this.parent.off(Ex,this.removeRows),this.parent.off(kx,this.initDataManager),this.parent.off(Cx,this.destroy),this.parent.off(Vx,this.crudActions),this.parent.off(Qx,this.getData),this.parent.off(Ox,this.refreshFilteredCols),this.parent.off(_I,this.refreshFilteredCols))},EE.prototype.getState=function(){return this.dataState},EE.prototype.setState=function(e){return this.dataState=e},EE.prototype.getForeignKeyDataState=function(){return this.foreignKeyDataState},EE.prototype.setForeignKeyDataState=function(e){this.foreignKeyDataState=e},EE.prototype.getStateEventArgument=function(e){var t=new Ba,i=new me({url:"",adaptor:new Ba}),t=t.processQuery(i,e);return Pe(JSON.parse(t.data),t.pvtData)},EE.prototype.eventPromise=function(e,t,i){var n,o=this,r=e,s=this.getStateEventArgument(t),a=new ll,l=new ll;return(void 0!==e.requestType||this.parent.groupSettings.disablePageWiseAggregates&&t.queries.some(function(e){return"onGroup"===e.fn}))&&!1!==this.dataState.isDataChanged?"save"===(s.action=e).requestType||"delete"===e.requestType||"batchsave"===e.requestType?((n=e).key=i,n.promise=l.promise,n.state=s,this.setState({isPending:!0,resolver:l.resolve}),r.endEdit=l.resolve,r.cancelEdit=l.reject,this.parent.trigger(vI,n),l.promise.then(function(){o.setState({isPending:!0,resolver:a.resolve,group:s.group,aggregates:s.aggregates}),"save"===n.requestType&&o.parent.notify(SI,n),o.parent.trigger(yI,s)}).catch(function(){})):(this.setState({isPending:!0,resolver:a.resolve,group:s.group,aggregates:s.aggregates}),this.parent.trigger(yI,s)):(this.setState({}),a.resolve(this.parent.dataSource)),a},EE.prototype.getSearchColumnFieldNames=function(){for(var e=[],t=0,i=this.parent.getColumns();t<i.length;t++){var n=i[t];n.allowSearching&&!je(n.field)&&e.push(n.field)}return e},EE.prototype.refreshFilteredCols=function(){this.parent.allowFiltering&&this.parent.filterSettings.columns.length&&zB(this.parent,this.parent.filterSettings.columns)},EE);function EE(e,t){this.dataState={isPending:!1,resolver:null,group:[]},this.foreignKeyDataState={isPending:!1,resolver:null},this.parent=e,this.serviceLocator=t,this.initDataManager(),this.parent.isDestroyed||"foreignKey"===this.getModuleName()||(this.parent.on(Tx,this.addRows,this),this.parent.on(kI,this.reorderRows,this),this.parent.on(Ex,this.removeRows,this),this.parent.on(kx,this.initDataManager,this),this.parent.on(Cx,this.destroy,this),this.parent.on(Vx,this.crudActions,this),this.parent.on(Qx,this.getData,this),this.parent.on(Ox,this.refreshFilteredCols,this),this.parent.on(_I,this.refreshFilteredCols,this))}ME.prototype.clone=function(){var e=new ME({});return I(e,this),e.cells=this.cells.map(function(e){return e.clone()}),e},ME.prototype.setRowValue=function(e){var t;this.parent&&(t=this.data[this.parent.getPrimaryKeyFieldNames()[0]],this.parent.setRowData(t,e))},ME.prototype.setCellValue=function(e,t){var i,n;this.parent&&this.data[""+e].toString()!==t.toString()&&(i=this.parent.getPrimaryKeyFieldNames()[0],n=this.data[""+i],this.parent.setCellValue(n,e,t),this.makechanges(i,this.data))},ME.prototype.makechanges=function(e,t){this.parent&&this.parent.getDataModule().dataManager.update(e,t)};var DE=ME;function ME(e,t){I(this,e),this.parent=t}PE.prototype.clone=function(){var e=new PE({});return I(e,this),e};var kE=PE;function PE(e){this.isSpanned=!1,this.isRowSpanned=!1,I(this,e)}FE.prototype.render=function(e,t,i,n){for(var o,r,s=this.serviceLocator.getService("cellRendererFactory").getCellRenderer(t.cells[parseInt(i.toString(),10)].cellType||LA.Data),a=t.cells[parseInt(i.toString(),10)].cellSpan?t.cells[parseInt(i.toString(),10)].cellSpan:e.colSpan?e.colSpan+i<=t.cells.length?e.colSpan:t.cells.length-i:1,l=e.rowSpan,h=0,d=(0<t.index&&(r=this.parent.getRowsObject(),r=(0<this.parent.groupSettings.columns.length&&!r[t.index-1].isDataRow?r[t.index]:r[t.index-1]).cells,o=t.cells[parseInt(i.toString(),10)],r=r.filter(function(e){return e.column.uid===o.column.uid})[0]),r&&1<r.colSpanRange&&1<r.rowSpanRange?r.colSpanRange:a),p=i+1;p<i+d&&p<t.cells.length;p++)!1===t.cells[parseInt(p.toString(),10)].visible?h++:t.cells[parseInt(p.toString(),10)].isSpanned=!0;if(0<h){for(p=i+a;p<i+a+h&&p<t.cells.length;p++)t.cells[parseInt(p.toString(),10)].isSpanned=!0;i+a+h>=t.cells.length&&(a-=i+a+h-t.cells.length)}return t.cells[parseInt(i.toString(),10)].cellSpan&&(t.data[e.column.field]=t.cells[parseInt(i.toString(),10)].spanText,n=s.render(t.cells[parseInt(i.toString(),10)],t.data,{index:je(t.index)?"":t.index.toString()})),1<a&&pt(n,{colSpan:a.toString(),"aria-colSpan":a.toString()}),1<l&&(pt(n,{rowspan:l.toString(),"aria-rowspan":l.toString()}),t.cells[parseInt(i.toString(),10)].isRowSpanned=!0,t.cells[parseInt(i.toString(),10)].rowSpanRange=Number(l),1<a)&&(t.cells[parseInt(i.toString(),10)].colSpanRange=Number(a)),0<t.index&&1<r.rowSpanRange&&(t.cells[parseInt(i.toString(),10)].isSpanned=!0,t.cells[parseInt(i.toString(),10)].rowSpanRange=Number(r.rowSpanRange-1),t.cells[parseInt(i.toString(),10)].colSpanRange=0<r.rowSpanRange?r.colSpanRange:1),!this.parent.enableColumnVirtualization||t.cells[parseInt(i.toString(),10)].cellSpan||this.containsKey(e.column.field,e.data[e.column.field])||this.backupMergeCells(e.column.field,e.data[e.column.field],e.colSpan),n},FE.prototype.backupMergeCells=function(e,t,i){this.setMergeCells(this.generteKey(e,t),i)},FE.prototype.generteKey=function(e,t){return e+"__"+t.toString()},FE.prototype.splitKey=function(e){return e.split("__")},FE.prototype.containsKey=function(e,t){return this.getMergeCells().hasOwnProperty(this.generteKey(e,t))},FE.prototype.getMergeCells=function(){return this.parent.mergeCells},FE.prototype.setMergeCells=function(e,t){this.parent.mergeCells[""+e]=t},FE.prototype.updateVirtualCells=function(e){for(var t=this.getMergeCells(),i=0,n=Object.keys(t);i<n.length;i++){var o=n[i],r=t[""+o],s=this.splitKey(o),o=this.getIndexFromAllColumns(s[0]),a=this.parent.getColumnIndexesInView(),l=r-(a[0]-o);if(o<a[0]&&1<l)for(var h=0,d=e;h<d.length;h++){var p=d[h];if(p.data[s[0]].toString()===s[1].toString()){p.cells[0].cellSpan=l,p.cells[0].spanText=s[1];break}}}return e},FE.prototype.getIndexFromAllColumns=function(i){return VP(this.parent.getVisibleColumns(),function(e,t){if(e.field===i)return t})[0]};var BE=FE;function FE(e,t){this.serviceLocator=e,this.parent=t}var LE="e-rowcell",RE="e-gridheader",OE="e-gridcontent",NE="e-gridfooter",VE="e-headercontent",_E="e-movablecontent",HE="e-movableheader",zE="e-frozencontent",jE="e-frozenheader",WE="e-content",QE="e-table",UE="e-row",qE="e-gridchkbox",GE="e-editedrow",YE="e-addedrow",XE="e-groupcaptionrow",KE="changedRecords",JE="addedRecords",ZE="deletedRecords",$E="Left-Right",eD="frozen-right",tD="frozen-left",iD="aria-colindex",nD="aria-rowindex",oD="tbody",rD="colgroup",sD="open",aD="change",lD="focus",hD="created",dD="beforeOpen",pD="downArrow",cD="upArrow",uD="PageDown",gD="enter",mD="shiftEnter",fD="initialFrozenColumnIndex",yD=(vD.prototype.render=function(e,t,i,n,o){return this.refreshRow(e,t,i,n,o)},vD.prototype.refresh=function(e,t,i,n,o){var r=this,s=(i&&(e.data=NB({},e.changes),this.refreshMergeCells(e)),this.parent.element.querySelector("[data-uid="+e.uid+"]")),e=this.refreshRow(e,t,n,o,null,i),n=[].slice.call(e.cells),o=[].slice.call(s.querySelectorAll(".e-templatecell"));if(this.parent.isReact&&o.length)for(var a=0,l=t;a<l.length;a++)if("break"===function(e){if(e.template)return setTimeout(function(){r.parent.refreshReactColumnTemplateByUid(e.uid,!0)},0),"break"}(l[a]))break;[].slice.call(e.attributes).map(function(e){s.setAttribute(e.name,e.value)}),s.innerHTML="";for(var h=0,d=n;h<d.length;h++){var p=d[h];s.appendChild(p)}},vD.prototype.refreshRow=function(y,e,t,i,n,v){for(var b=je(n)?this.element.cloneNode():n,n={data:y.data},w={data:y.data},o=this.parent.getColumns().filter(function(e){return"checkbox"===e.type&&e.field})[0],r=!1,C=this.parent.isFrozenGrid(),S=!0,o=(o&&(r=FB(o.field,n.data)),this.parent.getSelectedRowIndexes()),A=(y.isDataRow&&(y.isSelected=-1<o.indexOf(y.index)||r),y.isDataRow&&this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&(y.isSelected=!0,-1===o.indexOf(y.index))&&o.push(y.index),this.buildAttributeFromRow(b,y),pt(b,Pe({},t,{})),zP(b,y.attributes),this.serviceLocator.getService("cellRendererFactory")),x=this,s=0,a=y.cells.length;s<a;s++)!function(t){var i=y.cells[parseInt(t.toString(),10)],e=(i.isSelected=y.isSelected,i.isColumnSelected=i.column.isSelected,A.getCellRenderer(y.cells[parseInt(t.toString(),10)].cellType||LA.Data)),n={index:je(y.index)?"":y.index.toString()},o=(y.isExpand&&y.cells[parseInt(t.toString(),10)].cellType===LA.DetailExpand&&(n.class=x.parent.isPrinting?"e-detailrowcollapse":"e-detailrowexpand"),!x.parent.enableRtl&&x.parent.groupSettings&&S&&x.parent.groupSettings.columns.length&&("Vertical"===x.parent.gridLines||"Both"===x.parent.gridLines)),r=e.render(y.cells[parseInt(t.toString(),10)],y.data,n,y.isExpand,v);if(y.cells[parseInt(t.toString(),10)].cellType!==LA.Filter){if(y.cells[parseInt(t.toString(),10)].cellType===LA.Data||y.cells[parseInt(t.toString(),10)].cellType===LA.CommandColumn){i.visible&&o&&(r.classList.add("e-grid-group-first-cell"),S=!1);var s,a,l,h,d,e=x.parent.parentDetails&&x.parent.parentDetails.parentInstObj&&x.parent.parentDetails.parentInstObj.isReact,n=x.parent.printGridParent&&x.parent.printGridParent.isReact,e=((x.parent.isReact&&x.parent.requireTemplateRef||e&&x.parent.parentDetails.parentInstObj.requireTemplateRef||n&&x.parent.printGridParent.requireTemplateRef)&&i.isTemplate?(s=x).parent.renderTemplates(function(){var e;"string"!=typeof i.column.template&&(e=r.getAttribute("aria-label"),r.setAttribute("aria-label",r.innerText+e)),s.parent.trigger(zA,Pe(w,{cell:r,column:i.column,colSpan:1,rowSpan:1,foreignKeyData:y.cells[parseInt(t.toString(),10)].foreignKeyData,requestType:s.parent.requestTypeAction}))}):x.parent.trigger(zA,Pe(w,{cell:r,column:i.column,colSpan:1,rowSpan:1,foreignKeyData:y.cells[parseInt(t.toString(),10)].foreignKeyData,requestType:x.parent.requestTypeAction})),!1);if(0<y.index&&(x.isSpan||x.parent.isSpan&&v)&&(a=x.parent.getRowsObject(),l=(0<x.parent.groupSettings.columns.length&&!a[y.index-1].isDataRow?a[y.index]:a[y.index-1]).cells,e=(h=l.filter(function(e){return e.column.uid===y.cells[parseInt(t.toString(),10)].column.uid})[0]).isRowSpanned||1<h.rowSpanRange),1<w.rowSpan||1<w.colSpan)if(x.resetrowSpanvalue(x.parent.frozenRows>y.index?x.parent.frozenRows:x.parent.currentViewData.length,w,y.index),!1===w.column.visible)w.colSpan=1;else if(C){var p=x.parent.getColumns(),n=x.parent.getFrozenRightColumnsCount(),c=x.parent.getFrozenLeftCount(),n=p.length-n,u=w.column.index;if(u<c&&c<u+w.colSpan){var g=u+w.colSpan-c;w.colSpan=w.colSpan-g}else if(n<=u&&p.length<u+w.colSpan){var g=u+w.colSpan-p.length;w.colSpan=w.colSpan-g}else if("Fixed"===w.column.freeze){for(var g=1,m=u,f=m+1;f<m+w.colSpan&&"Fixed"===p[parseInt(f.toString(),10)].freeze;f++)g++;w.colSpan=g}else u<n&&n<u+w.colSpan&&(g=u+w.colSpan-n,w.colSpan=w.colSpan-g)}(1<w.colSpan||1<y.cells[parseInt(t.toString(),10)].cellSpan||1<w.rowSpan||e)&&(x.parent.isSpan=!0,x.isSpan=!0,r=(d=new BE(x.serviceLocator,x.parent)).render(w,y,t,r),C)&&pF(x.parent,w.column,r,w.colSpan)}(i.cellType===LA.Header||i.cellType===LA.StackedHeader)&&o&&(i.visible||i.cellType===LA.StackedHeader)&&(c=x.parent.getVisibleColumns(),i.column.type&&"checkbox"===i.column.type||i.cellType===LA.Header&&i.column.field&&c.length&&c[0].field===i.column.field||i.cellType===LA.StackedHeader)&&(r.classList.add("e-grid-group-first-cell"),S=!1),i.cellType===LA.Header&&(1<y.cells[parseInt(t.toString(),10)].colSpan||1<y.cells[parseInt(t.toString(),10)].rowSpan)&&(d=new BE(x.serviceLocator,x.parent),r=d.render(y.cells[parseInt(t.toString(),10)],y,t,r)),x.isSpan&&(a=x.parent.getRowsObject(),u=x.parent.enableRtl,a[y.index-1])&&(h=(l=a[y.index-1].cells)[t-1],n=l[parseInt(t.toString(),10)],e=l[t+1],o=l[parseInt(t.toString(),10)].column.freeze,h&&(h.isRowSpanned||1<h.rowSpanRange)&&h.visible&&(u||n.isRowSpanned&&!(h.rowSpanRange>n.rowSpanRange)||r.classList.add("e-rowcell-firstchild"),C)&&("Fixed"===h.column.freeze&&"Fixed"===o?r.classList.add(u?"e-removefreezerightborder":"e-removefreezeleftborder"):u||1!==t||"Left"!==o||r.classList.add("e-addfreezefirstchildborder")),e)&&(e.isRowSpanned||1<e.rowSpanRange)&&e.visible&&(u&&(!n.isRowSpanned||e.rowSpanRange>n.rowSpanRange)&&r.classList.add("e-rowcell-lastchild"),C)&&"Fixed"===e.column.freeze&&"Fixed"===o&&w.colSpan<2&&r.classList.add(u?"e-removefreezeleftborder":"e-removefreezerightborder"),1<w.rowSpan&&x.parent.currentViewData.length-y.index===w.rowSpan&&r.classList.add("e-row-span-lastrowcell"),y.cells[parseInt(t.toString(),10)].isSpanned||b.appendChild(r)}}(s);var l=0;if(this.parent.groupSettings.columns.length&&this.parent.getFrozenLeftColumnsCount()){if(b.classList.contains("e-groupcaptionrow")){r=[].slice.call(b.querySelectorAll(".e-leftfreeze,.e-unfreeze,.e-rightfreeze,.e-fixedfreeze,.e-freezerightborder,.e-freezeleftborder"));if(r.length&&q(r,["e-leftfreeze","e-unfreeze","e-rightfreeze","e-fixedfreeze","e-freezerightborder","e-freezeleftborder"]),b.querySelector(".e-summarycell"))qB(b,this.parent);else{for(var h,d,p=0;p<b.childNodes.length;p++)(c=b.childNodes[parseInt(p.toString(),10)]).classList.add("e-leftfreeze"),dF(c,30*p,this.parent.enableRtl,"Left"),c.classList.contains("e-groupcaption")&&(h=parseInt(c.getAttribute("colspan"),10),d=UB(this.parent,p),c.setAttribute("colspan",d.toString()),l=h-d);l&&(c=this.parent.createElement("TD",{className:"e-groupcaption",attrs:{colspan:l.toString(),id:this.parent.element.id+"captioncell",tabindex:"-1"}}),b.appendChild(c))}}if((b.querySelectorAll(".e-leftfreeze").length||b.classList.contains("e-columnheader"))&&(b.querySelectorAll(".e-indentcell").length||b.querySelectorAll(".e-grouptopleftcell").length))for(var c=b.querySelectorAll(".e-indentcell, .e-grouptopleftcell"),s=0;s<c.length;s++)c[parseInt(s.toString(),10)].classList.add("e-leftfreeze"),dF(c[parseInt(s.toString(),10)],30*s,this.parent.enableRtl,"Left")}var u,g,m,f,I={row:b,rowHeight:this.parent.rowHeight};if(y.isDataRow&&((u=Pe(n,I)).isSelectable=!0,o=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,t=u.row.querySelectorAll(".e-templatecell"),(this.parent.isReact&&this.parent.requireTemplateRef||o&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&t.length?(g=this).parent.renderTemplates(function(){g.parent.trigger(HA,u),u.isSelectable||(y.isSelectable=u.isSelectable,g.disableRowSelection(g,y,I,u))}):this.parent.trigger(HA,u),y.isSelectable=u.isSelectable,r=this.parent.isRowDragable(),this.parent.allowPaging&&this.parent.selectionSettings.persistSelection&&(m=this.parent.getPrimaryKeyFieldNames()[0],f=y.data?y.data[""+m]:null,(o=u.isSelectable?this.parent.partialSelectedRecords:this.parent.disableSelectedRecords).some(function(e){return e[""+m]===f})||o.push(y.data)),u.isSelectable||this.disableRowSelection(this,y,I,u),this.parent.childGrid||r||this.parent.detailTemplate)&&(c=b.querySelectorAll(".e-rowcell:not(.e-hide)")[0])&&c.classList.add("e-detailrowvisible"),this.parent.enableVirtualization&&(n.rowHeight=this.parent.rowHeight),n.rowHeight?b.style.height=n.rowHeight+"px":this.parent.rowHeight&&(b.querySelector(".e-headercell")||b.querySelector(".e-groupcaption"))&&(b.style.height=this.parent.rowHeight+"px"),y.cssClass&&b.classList.add(y.cssClass),y.lazyLoadCssClass&&b.classList.add(y.lazyLoadCssClass),"Vertical"!==this.parent.rowRenderingMode||!this.parent.allowTextWrap||"Header"!==this.parent.textWrapSettings.wrapMode&&"Both"!==this.parent.textWrapSettings.wrapMode||b.classList.add("e-verticalwrap"),!this.parent.enableColumnVirtualization&&this.parent.aggregates.length&&this.parent.element.scrollHeight>this.parent.height)for(s=0;s<this.parent.aggregates.length;s++){var T;this.parent.aggregates[parseInt(s.toString(),10)].properties.columns[0].footerTemplate&&(T=[].slice.call(b.getElementsByClassName("e-summarycell"))).length&&(U([T[T.length-1]],["e-lastsummarycell"]),U([T[0]],["e-firstsummarycell"]))}return b},vD.prototype.resetrowSpanvalue=function(e,t,i){i<e&&e<i+t.rowSpan&&(i=i+t.rowSpan-e,t.rowSpan=t.rowSpan-i)},vD.prototype.disableRowSelection=function(e,t,i,n){for(var o=this.parent.getSelectedRowIndexes(),r=(this.parent.selectionModule.isPartialSelection=!0,t.isSelected=!1,o.indexOf(t.index)),s=(-1<r&&o.splice(r,1),i.row.querySelectorAll(".e-rowcell.e-gridchkbox")),o=n.row.querySelector(".e-rowdragdrop"),r=e.parent.groupSettings.columns.length+(o||e.parent.isDetail()?1:0),a=0;a<s.length;a++)s[parseInt(a.toString(),10)].firstElementChild.classList.add("e-checkbox-disabled"),s[parseInt(a.toString(),10)].querySelector(".e-frame").classList.remove("e-check");if(t.cells.length)for(a=r;a<t.cells.length;a++){var l=n.row.querySelector('.e-rowcell[aria-colindex="'+(t.cells[parseInt(a.toString(),10)].index+1)+'"]');l&&q([l],["e-selectionbackground","e-active"])}o&&q([o],["e-selectionbackground","e-active"])},vD.prototype.refreshMergeCells=function(e){for(var t=0,i=e.cells;t<i.length;t++)i[t].isSpanned=!1;return e},vD.prototype.buildAttributeFromRow=function(e,t){var i={},n="data-uid",o="aria-selected",r=[];t.isDataRow&&r.push(UE),t.isAltRow&&r.push("e-altrow"),t.isCaptionRow&&r.push("e-groupcaptionrow"),t.isAggregateRow&&t.parentUid&&r.push("e-groupfooterrow"),je(t.index)||(i[nD]=t.index+1),t.rowSpan&&(i.rowSpan=t.rowSpan),t.uid&&(i[n]=t.uid),t.isSelected&&(i[o]=!0),!1===t.visible&&r.push("e-hide"),i.class=r,zP(e,i)},vD);function vD(e,t,i){this.isSpan=!1,this.cellType=t,this.serviceLocator=e,this.parent=i,this.element=this.parent.createElement("tr",{attrs:{role:"row"}})}wD.prototype.generateRows=function(e,t){var i=[],n=this.parent.enableVirtualization&&t?t.startIndex:0,n=this.parent.enableInfiniteScrolling&&t?this.getInfiniteIndex(t):n;this.parent.enableImmutableMode&&t&&t.startIndex&&(n=t.startIndex);for(var o=0,r=Object.keys(e).length;o<r;o++,n++)i[parseInt(o.toString(),10)]=this.generateRow(e[parseInt(o.toString(),10)],n);return i},wD.prototype.ensureColumns=function(){var e,t=[];return(this.parent.detailTemplate||this.parent.childGrid)&&(this.parent.notify(YI,e={}),t.push(this.generateCell(e,null,LA.DetailExpand))),this.parent.isRowDragable()&&t.push(this.generateCell({},null,LA.RowDragIcon)),t},wD.prototype.generateRow=function(e,t,i,n,o,r,s){var a={foreignKeyData:{}},e=(a.uid=$P("grid-row"),a.data=e,a.index=t,a.indent=n,a.tIndex=r,a.isDataRow=!0,a.parentGid=o,a.parentUid=s,this.parent.isPrinting&&("All"===this.parent.hierarchyPrintMode?a.isExpand=!0:"Expanded"===this.parent.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[parseInt(t.toString(),10)]&&(a.isExpand=this.parent.expandedRows[parseInt(t.toString(),10)].isExpand)),a.cssClass=i,a.isAltRow=!!this.parent.enableAltRow&&t%2!=0,a.isAltRow=!!this.parent.enableAltRow&&t%2!=0,a.isSelected=-1<this.parent.getSelectedRowIndexes().indexOf(t),this.refreshForeignKeyRow(a),this.ensureColumns()),n=new DE(a,this.parent);return n.cells="Right"===this.parent.getFrozenMode()?this.generateCells(a).concat(e):e.concat(this.generateCells(a)),n},wD.prototype.refreshForeignKeyRow=function(e){for(var t=this.parent.getForeignKeyColumns(),i=0;i<t.length;i++)x(t[parseInt(i.toString(),10)].field,DB(t[parseInt(i.toString(),10)],e.data),e.foreignKeyData)},wD.prototype.generateCells=function(e){for(var t=this.parent.getColumns(),i=[],n=0;n<t.length;n++)i.push(this.generateCell(t[parseInt(n.toString(),10)],e.uid,je(t[parseInt(n.toString(),10)].commands)?void 0:LA.CommandColumn,null,n,e.foreignKeyData));return i},wD.prototype.generateCell=function(e,t,i,n,o,r){t={visible:e.visible,isDataCell:!je(e.field||e.template),isTemplate:!je(e.template),rowID:t,column:e,cellType:je(i)?LA.Data:i,colSpan:n,commands:e.commands,isForeignKey:e.isForeignColumn&&e.isForeignColumn(),foreignKeyData:e.isForeignColumn&&e.isForeignColumn()&&R(e.field,r)};return(t.isDataCell||"checkbox"===t.column.type||t.commands)&&(t.index=o),new kE(t)},wD.prototype.refreshRows=function(e){for(var t=0;t<e.length;t++)this.refreshForeignKeyRow(e[parseInt(t.toString(),10)]),e[parseInt(t.toString(),10)].cells=this.generateCells(e[parseInt(t.toString(),10)]);return e},wD.prototype.getInfiniteIndex=function(e){return"infiniteScroll"===e.requestType||"delete"===e.requestType||"add"===e.action?je(e.startIndex)?e.index:e.startIndex:0};var bD=wD;function wD(e){this.parent=e}CD=function(e,t){return(CD=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])}))(e,t)};var CD,Ir=function(e,t){function i(){this.constructor=e}CD(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},SD=(AD.prototype.getData=function(){for(var t=this,e=[],i=this.parent.aggregates.slice(),n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)].columns.filter(function(e){return!(e.footerTemplate||e.groupFooterTemplate||e.groupCaptionTemplate)||t.columnSelector(e)});o.length&&e.push({columns:o})}return e},AD.prototype.columnSelector=function(e){return void 0!==e.footerTemplate},AD.prototype.getColumns=function(e){var t=[];if(!this.parent.detailTemplate&&je(this.parent.childGrid)||t.push(new C0({})),this.parent.allowGrouping)for(var i=0;i<this.parent.groupSettings.columns.length;i++)t.push(new C0({}));return this.parent.isRowDragable()&&!e&&t.push(new C0({})),t.push.apply(t,this.parent.getColumns()),t},AD.prototype.generateRows=function(e,t,i,n,o){if(0===e.length&&(void 0===t||!t.count&&!t.loadSummaryOnEmpty))return[];for(var r=this.buildSummaryData(e,t),s=[],a=this.getData(),l=0;l<a.length;l++)s.push(this.getGeneratedRow(a[parseInt(l.toString(),10)],r[parseInt(l.toString(),10)],t?t.level:void 0,i,n,t?t.parentUid:void 0,o));return s},AD.prototype.getGeneratedRow=function(e,t,i,n,o,r,s){for(var a=[],l=this.getIndentByLevel(),h=!je(this.parent.childGrid),d=this.parent.getIndentCount(),p=(this.parent.groupSettings.columns.length&&this.parent.allowRowDragAndDrop?l.push("e-indentcelltop"):this.parent.isRowDragable()&&!n&&(l=["e-indentcelltop"]),s||this.getColumns(n)),c=0;c<p.length;c++)a.push(this.getGeneratedCell(p[parseInt(c.toString(),10)],e,d<=c?this.getCellType():0===c&&this.parent.childGrid?LA.DetailFooterIntent:LA.Indent,l[parseInt(c.toString(),10)],h));s=new DE({data:t,attributes:{class:"e-summaryrow"}});return s.cells=a,s.uid=$P("grid-row"),s.parentUid=r,s.isAggregateRow=!0,s.visible=a.some(function(e){return e.isDataCell&&e.visible}),s},AD.prototype.getGeneratedCell=function(t,e,i,n,o){var e=e.columns.filter(function(e){return e.columnName===t.field})[0],r={"e-mappinguid":t.uid,index:t.index},s=(t.textAlign&&(s={right:"e-rightalign",left:"e-leftalign",center:"e-centeralign",justify:"e-justifyalign"})[t.textAlign.toLowerCase()]&&(r.class=s[t.textAlign.toLowerCase()]),n&&(r.class=n),je(n)&&o&&(r.class="e-detailindentcelltop"),{visible:t.visible,isDataCell:!je(e),isTemplate:e&&!je(e.footerTemplate||e.groupFooterTemplate||e.groupCaptionTemplate),column:e||{},attributes:r,cellType:i});return s.column.headerText=t.headerText,new kE(s)},AD.prototype.buildSummaryData=function(e,t){for(var i=[],n=this.getData(),o={},r=0;r<n.length;r++){for(var o={},s=n[parseInt(r.toString(),10)].columns,a=0;a<s.length;a++)o=this.setTemplate(s[parseInt(a.toString(),10)],t&&t.aggregates?t:e,o);i.push(o)}return i},AD.prototype.getIndentByLevel=function(){return this.parent.groupSettings.columns.map(function(){return"e-indentcelltop"})},AD.prototype.setTemplate=function(e,t,i){var n=e.type,o={},r=e.getFormatter()||function(e){return e},s=t;n instanceof Array||(n=[e.type]);for(var a=0;a<n.length;a++){var l=e.field+" - "+n[parseInt(a.toString(),10)].toLowerCase(),h=e.columnName,d=!!(this.parent.groupSettings.disablePageWiseAggregates&&this.parent.groupSettings.columns.length&&s.items),d=("Custom"!==n[parseInt(a.toString(),10)]||d)&&s.aggregates&&l in s.aggregates?s.aggregates[l]:iB(n[parseInt(a.toString(),10)],s.aggregates?s:t,e,this.parent);i[""+h]=i[""+h]||{},i[""+h][l]=d,i[""+h][n[parseInt(a.toString(),10)]]=je(d)?" ":r(d),s.field&&(i[""+h].field=s.field,i[""+h].key=s.key)}return o.format=e.getFormatter(),e.setTemplate(o),i},AD.prototype.getCellType=function(){return LA.Summary},AD);function AD(e){this.parent=e}Ir(TD,xD=SD),TD.prototype.columnSelector=function(e){return void 0!==e.groupFooterTemplate},TD.prototype.getIndentByLevel=function(i){return void 0===i&&(i=this.parent.groupSettings.columns.length),this.parent.allowRowDragAndDrop&&this.parent.groupSettings.columns.length&&--i,this.parent.groupSettings.columns.map(function(e,t){return t<=i-1?"":"e-indentcelltop"})},TD.prototype.getCellType=function(){return LA.GroupSummary};var xD,ID=TD;function TD(){return null!==xD&&xD.apply(this,arguments)||this}Ir(MD,ED=SD),MD.prototype.columnSelector=function(e){return void 0!==e.groupCaptionTemplate},MD.prototype.getData=function(){return[ED.prototype.getData.call(this).reduce(function(e,t){return e.columns=e.columns.concat(t.columns),e},{columns:[]})]},MD.prototype.isEmpty=function(){return 0===(this.getData()[0].columns||[]).length},MD.prototype.getCellType=function(){return LA.CaptionSummary};var ED,DD=MD;function MD(){return null!==ED&&ED.apply(this,arguments)||this}kD=function(e,t){return(kD=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}kD(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(FD,PD=bD),FD.prototype.generateRows=function(e,t){if(0===this.parent.groupSettings.columns.length)return PD.prototype.generateRows.call(this,e,t);this.isInfiniteScroll="infiniteScroll"===t.requestType,this.rows=[],this.index=this.parent.enableVirtualization||this.isInfiniteScroll?t.startIndex:0;for(var i=0,n=e.length;i<n;i++)this.infiniteChildCount=0,this.renderInfiniteAgg=!0,this.getGroupedRecords(0,e[parseInt(i.toString(),10)],e.level,i,void 0,this.rows.length);return this.index=0,this.parent.isCollapseStateEnabled()&&this.ensureRowVisibility(),this.rows},FD.prototype.getGroupedRecords=function(e,t,i,n,o,r,s){if(je(t.items))if(je(t.GroupGuid))this.rows=this.rows.concat(this.generateDataRows(t,e,n,this.rows.length,s));else for(var a=0,l=t.length;a<l;a++)this.getGroupedRecords(e,t[parseInt(a.toString(),10)],t.level,n,e,this.rows.length,s);else{var h=void 0,o=this.generateCaptionRow(t,e,n,o,r,s);if((h=this.isInfiniteScroll?this.getPreCaption(e,o.data.key):h)?o.uid=h.uid:this.rows=this.rows.concat(o),t.items&&t.items.length&&this.getGroupedRecords(e+1,t.items,t.items.level,n,e+1,this.rows.length,o.uid),this.parent.aggregates.length&&this.isRenderAggregate(o)){var d=this.rows.length;(r=this.rows).push.apply(r,this.summaryModelGen.generateRows(t,{level:i,parentUid:o.uid}));for(var p=d-1;0<=p;p--)if(this.rows[parseInt(p.toString(),10)].isCaptionRow)this.rows[parseInt(p.toString(),10)].aggregatesCount=this.rows.length-d;else if(!this.rows[parseInt(p.toString(),10)].isCaptionRow&&!this.rows[parseInt(p.toString(),10)].isDataRow)break}h&&this.setInfiniteRowVisibility(h)}},FD.prototype.isRenderAggregate=function(e){return this.parent.enableInfiniteScrolling?!!this.renderInfiniteAgg&&(this.getPreCaption(e.indent,e.data.key),this.renderInfiniteAgg=e.data.count===this.infiniteChildCount,this.renderInfiniteAgg):!this.parent.enableInfiniteScrolling},FD.prototype.getPreCaption=function(e,t){for(var i,n,o=this.parent.getRowsObject().concat(this.rows),r=(this.infiniteChildCount=0,o.length);r--&&(o[parseInt(r.toString(),10)].isCaptionRow&&o[parseInt(r.toString(),10)].indent===e&&((n=o[parseInt(r.toString(),10)].data.key)&&n.toString()===t.toString()&&n instanceof Date||n===t)&&(i=o[parseInt(r.toString(),10)]),!(o[parseInt(r.toString(),10)].indent===e||o[parseInt(r.toString(),10)].indent<e));)o[parseInt(r.toString(),10)].indent===e+1&&this.infiniteChildCount++;return i},FD.prototype.getCaptionRowCells=function(t,e,i){var n,o=[],r=[],s=this.parent.getColumnByField(t),a=this.parent.getColumnIndexesInView(),l=(this.parent.enableColumnVirtualization&&(s=this.parent.columns.filter(function(e){return e.field===t})[0]),this.parent.groupSettings.columns.length),h=this.parent;if(!this.parent.enableColumnVirtualization||-1!==a.indexOf(e)){for(var d=0;d<e;d++)o.push(this.generateIndentCell());o.push(this.generateCell({},null,LA.Expand))}e=this.parent.enableColumnVirtualization?1:this.parent.getVisibleColumns().length+l+(h.detailTemplate||h.childGrid?1:0)-e+(this.parent.getVisibleColumns().length?-1:0),this.parent.aggregates.length&&!this.captionModelGen.isEmpty()&&(Pe(i,(i=this.captionModelGen.generateRows(i)[0]).data),n=0,i.cells.some(function(e,t){return n=t,e.visible&&e.isDataCell}),r=i.cells.slice(n).filter(function(e){return e.visible}),i.visible&&r[0].column.field===this.parent.getVisibleColumns()[0].field&&(r=r.slice(1)),e-=(r=1===this.parent.getVisibleColumns().length?[]:r).length);for(var p=this.parent.enableColumnVirtualization?this.parent.getColumns():[s],c=!0,u=0;u<p.length;u++){var g=c&&-1!==a.indexOf(e),g=(g&&(c=!1),!this.parent.enableColumnVirtualization||g?LA.GroupCaption:LA.GroupCaptionEmpty);e=this.parent.enableColumnVirtualization&&g===LA.GroupCaption?e+l:e,h.isRowDragable()&&e++,o.push(this.generateCell(s,null,g,e))}return o.push.apply(o,r),o},FD.prototype.generateCaptionRow=function(e,t,i,n,o,r){var s={},a=this.parent.getColumnByField(e.field),a=(s.data=Pe({},e),a&&(s.data.field=e.field),s.isDataRow=!1,s.isExpand=!this.parent.groupSettings.enableLazyLoading&&!this.parent.isCollapseStateEnabled(),s.parentGid=i,s.childGid=n,s.tIndex=o,s.isCaptionRow=!0,s.parentUid=r,s.gSummary=(je(e.items.records)?e.items:e.items.records).length,s.uid=$P("grid-row"),new DE(s));return a.indent=t,this.getForeignKeyData(a),a.cells=this.getCaptionRowCells(e.field,t,a.data),a},FD.prototype.getForeignKeyData=function(e){var t=e.data,i=this.parent.getColumnByField(t.field);i&&i.isForeignColumn&&i.isForeignColumn()&&x("foreignKey",je(t.key)?"":i.valueAccessor(i.foreignKeyValue,DB(i,{},t.key)[0],i),e.data)},FD.prototype.generateDataRows=function(e,t,i,n,o){for(var r=[],s=this.parent.getColumnIndexesInView(),a=0,l=e.length;a<l;a++,n++){r[parseInt(a.toString(),10)]=this.generateRow(e[parseInt(a.toString(),10)],this.index,a?void 0:"e-firstchildrow",t,i,n,o);for(var h=0;h<t;h++)this.parent.enableColumnVirtualization&&-1===s.indexOf(t)||r[parseInt(a.toString(),10)].cells.unshift(this.generateIndentCell());this.index++}return r},FD.prototype.generateIndentCell=function(){return this.generateCell({},null,LA.Indent)},FD.prototype.refreshRows=function(e){for(var t=this.parent.getColumnIndexesInView(),i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].isDataRow){e[parseInt(i.toString(),10)].cells=this.generateCells(e[parseInt(i.toString(),10)]);for(var n=0;n<e[parseInt(i.toString(),10)].indent;n++)this.parent.enableColumnVirtualization&&-1===t.indexOf(e[parseInt(i.toString(),10)].indent)||e[parseInt(i.toString(),10)].cells.unshift(this.generateIndentCell())}else{var o=this.generateCaptionRow(e[parseInt(i.toString(),10)].data,e[parseInt(i.toString(),10)].indent);e[parseInt(i.toString(),10)].cells=o.cells}return e},FD.prototype.setInfiniteRowVisibility=function(e){if(!e.isExpand||!1===e.visible)for(var t=0,i=this.rows;t<i.length;t++){var n=i[t];n.parentUid===e.uid&&(n.visible=!1,n.isCaptionRow)&&this.setInfiniteRowVisibility(n)}},FD.prototype.ensureRowVisibility=function(){for(var e=0;e<this.rows.length;e++){var t=this.rows[parseInt(e.toString(),10)];if(t.isCaptionRow)for(var i=e+1;i<this.rows.length;i++){var n=this.rows[parseInt(i.toString(),10)];t.uid===n.parentUid&&(this.rows[parseInt(i.toString(),10)].visible=t.isExpand)}}};var kD,PD,BD=FD;function FD(e){var t=PD.call(this,e)||this;return t.rows=[],t.index=0,t.infiniteChildCount=0,t.renderInfiniteAgg=!0,t.parent=e,t.summaryModelGen=new ID(e),t.captionModelGen=new DD(e),t}RD.prototype.beforeCellFocused=function(e){!e.byKey||"upArrow"!==e.keyArgs.action&&"downArrow"!==e.keyArgs.action?this.pressedKey=void 0:this.pressedKey=e.keyArgs.action},RD.prototype.renderPanel=function(){var e,t=this.parent,i=this.parent.element.querySelector("."+OE);i?(this.ariaService.setOptions(this.parent.element.querySelector("."+WE),{busy:!1}),this.setPanel(i)):(i=this.parent.createElement("div",{className:OE}),e=this.parent.createElement("div",{className:WE}),this.ariaService.setOptions(e,{busy:!1}),this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&(this.renderHorizontalScrollbar(i),e.classList.add("e-virtual-content")),i.appendChild(e),this.setPanel(i),t.element.appendChild(i))},RD.prototype.renderHorizontalScrollbar=function(e){var t=this.parent.createElement("div",{className:"e-movablescrollbar"}),i=this.parent.createElement("div",{className:"e-movablechild"}),n=aB().toString();this.setScrollbarHeight(i,n),this.setScrollbarHeight(t,n),t.appendChild(i),e.appendChild(t)},RD.prototype.setScrollbarHeight=function(e,t){e.style.minHeight=t+"px",e.style.maxHeight=t+"px"},RD.prototype.renderTable=function(){var e=this.getPanel(),t=e.querySelector(".e-virtualtable"),i=e.querySelector(".e-virtualtrack");!this.parent.enableVirtualization||je(t)||je(i)||(ue(t),ue(i)),e.appendChild(this.createContentTable("_content_table")),this.setTable(e.querySelector("."+QE)),"Multiple"===this.parent.selectionSettings.type&&this.ariaService.setOptions(this.parent.element,{multiselectable:!0}),this.initializeContentDrop(),this.parent.frozenRows&&this.parent.getHeaderContent().classList.add("e-frozenhdr")},RD.prototype.createContentTable=function(e){var t=this.getPanel().firstElementChild,e=(this.getTable()&&ue(this.getTable()),t.querySelector("."+QE)?t.querySelector("."+QE):this.parent.createElement("table",{className:QE,attrs:{role:"presentation",id:this.parent.element.id+e}}));return e.style.cssText="border-collapse: separate; border-spacing: .25px;",this.setColGroup(this.parent.getHeaderTable().querySelector(rD).cloneNode(!0)),e.appendChild(this.getColGroup()),e.appendChild(this.parent.createElement(oD,{attrs:{role:"rowgroup"}})),t.appendChild(e),t},RD.prototype.refreshContentRows=function(l){var t=this,h=(void 0===l&&(l={}),this.parent);if(0!==h.currentViewData.length){h.editSettings&&h.editModule&&"Batch"===h.editSettings.mode&&h.editModule.formObj&&!1===h.editSettings.showConfirmDialog&&h.editModule.destroyForm();var d,p,c,u,g,m=this.currentMovableRows||h.currentViewData,e=h.isReact&&!je(h.rowTemplate),f=this.parent.printGridParent&&this.parent.printGridParent.isReact,y=e||f?h.createElement(oD,{attrs:{role:"rowgroup"}}):document.createDocumentFragment(),v=(this.initialPageRecords||(this.initialPageRecords=Pe([],m)),e?h.createElement(oD,{attrs:{role:"rowgroup"}}):document.createDocumentFragment()),b=((h.isReact||f)&&h.rowTemplate&&(d=y,p=v),h.getColumns()),w=new yD(this.serviceLocator,null,this.parent),C=this.parent.enableInfiniteScrolling&&"infiniteScroll"===l.requestType,i=this.isInfiniteColumnvirtualization()&&"virtualscroll"!==l.requestType,n=!(!h.enableInfiniteScrolling||!h.childGrid&&!h.detailTemplate),o=n&&("add"===l.action&&"save"===l.requestType||"delete"===l.requestType),S=(o&&(l.startIndex=0,h.notify(IE,{})),C&&(h.childGrid||h.detailTemplate)&&!h.infiniteScrollSettings.enableCache||(n&&(this.parent.infiniteScrollModule.infiniteDetailDestroy=!0),h.notify(rE,C&&(h.childGrid||h.detailTemplate)&&h.infiniteScrollSettings.enableCache?l:{})),this.rowElements=[],this.rows=[],this.tempFreezeRows=[],!(!this.parent.frozenRows||!this.parent.groupSettings.columns.length)),r=(BB(h)&&["sorting","filtering","searching","grouping","ungrouping","reorder","save","delete"].some(function(e){return l.requestType===e})&&this.emptyVcRows(),g=this.checkCache(g,l),this.isAddRows||this.useGroupCache||(g=this.generator.generateRows(m,l)),this.setGroupCache(g,l),this.parent.notify(pT,{isInfiniteScroll:C,modelData:g,args:l}),this.parent.registeredTemplate);if(("infiniteScroll"!==l.requestType||this.parent.infiniteScrollSettings.enableCache)&&r&&r.template&&!l.isFrozen){for(var s=[],a=0;a<r.template.length;a++)for(var A=0;A<r.template[parseInt(a.toString(),10)].rootNodes.length;A++)je(r.template[parseInt(a.toString(),10)].rootNodes[parseInt(A.toString(),10)].parentNode)&&s.push(r.template[parseInt(a.toString(),10)]);this.parent.destroyTemplate(["template"],s)}!this.parent.isReact&&!this.parent.isVue||"infiniteScroll"===l.requestType&&!this.parent.infiniteScrollSettings.enableCache||l.isFrozen||(n=[this.parent.isVue?"template":"columnTemplate","rowTemplate","detailTemplate","captionTemplate","commandsTemplate","groupFooterTemplate","groupCaptionTemplate"],"infiniteScroll"===l.requestType&&this.parent.infiniteScrollSettings.enableCache&&(n=[this.parent.isVue?"template":"columnTemplate","commandsTemplate"]),EF(this.parent,n)),this.parent.enableColumnVirtualization&&new BE(this.serviceLocator,this.parent).updateVirtualCells(g),this.tbody=this.getTable().querySelector(oD);var x=0,I=!0;if(BB(h)&&h.vcRows.length){var T=je(l.virtualInfo.offsets)?je(l.scrollTop)?0:l.scrollTop.top:l.virtualInfo.offsets.top;if(0!==T){for(var E=h.vGroupOffsets,D=h.pageSettings.pageSize/2,M=Object.keys(E).map(function(e){return E[""+e]}),k=0;k<M.length;k++)if(T<M[parseInt(k.toString(),10)]){if(je(l.virtualInfo)||"up"!==l.virtualInfo.direction){x=k*D,(this.parent.contentModule.isEndBlock(k)||this.parent.contentModule.isEndBlock(k+1))&&(l.virtualInfo.blockIndexes=[k,k+1]);break}x=0<k?(k-1)*D:k*D;break}Math.round(T+this.contentPanel.firstElementChild.offsetHeight)>=this.contentPanel.firstElementChild.scrollHeight&&!l.rowObject&&(I=!1)}}n=h.frozenRows&&this.parent.enableVirtualization&&"reorder"===l.requestType;if(h.frozenRows&&"virtualscroll"===l.requestType&&"X"===l.virtualInfo.sentinelInfo.axis||n){var P=l.virtualInfo.blockIndexes,B=l.virtualInfo.page,F=(l.virtualInfo.blockIndexes=[1,2],n&&(l.virtualInfo.page=1),n?this.initialPageRecords:m),L=this.vgenerator.generateRows(F,l);L.splice(this.parent.frozenRows);for(a=0;a<this.parent.frozenRows;a++)hF(c=w.render(L[parseInt(a.toString(),10)],b)),v.appendChild(c);l.virtualInfo.blockIndexes=P,l.virtualInfo.page=B,n&&1===l.virtualInfo.page&&g.splice(0,this.parent.frozenRows)}this.virtualFrozenHdrRefresh(v,g,w,l,m,b),this.parent.groupSettings.enableLazyLoading&&!this.useGroupCache&&this.parent.groupSettings.columns.length&&((this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).refRowsObj[this.parent.pageSettings.currentPage]=[]),(this.parent.enableInfiniteScrolling&&this.parent.groupSettings.enableLazyLoading&&"delete"===l.requestType||o)&&(this.visibleRows=[]);for(var R=this,a=x,O=g.length;a<O;a++)if("break"===function(t){if(R.rows.push(g[parseInt(t.toString(),10)]),R.parent.groupSettings.enableLazyLoading&&!R.useGroupCache&&R.parent.groupSettings.columns.length&&((R.parent.enableVirtualization?R.parent.lazyLoadRender:R.parent.contentModule).refRowsObj[R.parent.pageSettings.currentPage].push(g[parseInt(t.toString(),10)]),R.setRowsInLazyGroup(g[parseInt(t.toString(),10)],t),je(g[parseInt(t.toString(),10)].indent)))return"continue";if(R.setInfiniteVisibleRows(l,g[parseInt(t.toString(),10)]),BB(h)&&l.virtualInfo&&l.virtualInfo.blockIndexes&&R.rowElements.length>=l.virtualInfo.blockIndexes.length*R.parent.contentModule.getBlockSize()&&I)return R.parent.currentViewData.records=R.rows.map(function(e){return e.data}),"break";if(h.rowTemplate){var e=h.element.id+"rowTemplate",i=void 0;if(h.isReact||f){var n,o=h.frozenRows&&t<h.frozenRows,r=Pe({index:t},m[parseInt(t.toString(),10)]);if(h.getRowTemplate()(r,h,"rowTemplate",e,null,null,o?v:y),h.requireTemplateRef)return(n=R).parent.renderTemplates(function(){h.frozenRows&&t<h.frozenRows?c=p.childNodes[parseInt(t.toString(),10)]:u=d.childNodes[parseInt(t.toString(),10)];var e={data:g[parseInt(t.toString(),10)].data,row:u||c};n.parent.trigger(HA,e),(g[parseInt(t.toString(),10)].isDataRow||n.parent.enableVirtualization&&n.parent.groupSettings.enableLazyLoading)&&n.rowElements.push(e.row),n.ariaService.setOptions(n.parent.element,{colcount:h.getColumns().length.toString()}),t===g.length-1&&(p=d=null)}),"continue"}else i=h.getRowTemplate()(Pe({index:t},m[parseInt(t.toString(),10)]),h,"rowTemplate",e,void 0,void 0,void 0,R.parent.root);if(h.isReact||"TBODY"!==i[0].tagName)h.frozenRows&&t<h.frozenRows?c=h.isReact?v.lastElementChild:eB(v,i):(h.isReact||(c=eB(y,i)),u=(h.isReact?y:c).lastElementChild);else{for(var s=0;s<i.length;s++){var a="tr"===i[parseInt(s.toString(),10)].nodeName.toLowerCase();(a||i[parseInt(s.toString(),10)].querySelectorAll&&i[parseInt(s.toString(),10)].querySelectorAll("tr").length)&&(c=a?i[parseInt(s.toString(),10)]:i[parseInt(s.toString(),10)].querySelector("tr"))}(h.frozenRows&&t<h.frozenRows?v:y).appendChild(c)}r={data:g[parseInt(t.toString(),10)].data,row:u||c};R.parent.trigger(HA,r)}else{hF(c=w.render(g[parseInt(t.toString(),10)],b));o=R.ensureFrozenHeaderRender(l);(h.frozenRows&&(t<h.frozenRows||S)&&!C&&"virtualscroll"!==l.requestType&&o&&R.ensureVirtualFrozenHeaderRender(l)?v:y).appendChild(c),1+(parseInt(c.getAttribute("aria-rowindex"),10)-1)===h.frozenRows&&(S=!1),g[parseInt(t.toString(),10)].isExpand&&h.notify(TI,c.cells[h.groupSettings.columns.length])}(g[parseInt(t.toString(),10)].isDataRow||R.parent.enableVirtualization&&R.parent.groupSettings.enableLazyLoading)&&(!je(h.rowTemplate)&&(h.isAngular||h.isVue3||h.isVue)?R.rowElements.push(u||c):R.rowElements.push(c)),R.ariaService.setOptions(R.parent.element,{colcount:h.getColumns().length.toString()})}(a))break;F=h.parentDetails&&h.parentDetails.parentInstObj&&h.parentDetails.parentInstObj.isReact;!h.isReact&&!F||h.requireTemplateRef||h.renderTemplates(),this.parent.enableInfiniteScrolling&&this.parent.groupSettings.enableLazyLoading&&(this.parent.contentModule.refRowsObj[this.parent.pageSettings.currentPage]=this.parent.contentModule.groupCache[this.parent.pageSettings.currentPage]),this.parent.groupSettings.enableLazyLoading&&!this.useGroupCache&&this.parent.groupSettings.columns.length&&this.parent.notify(QT,{rows:(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).refRowsObj[this.parent.pageSettings.currentPage]}),h.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}),(h.frozenRows&&"virtualscroll"!==l.requestType&&!C&&this.ensureVirtualFrozenHeaderRender(l)||"virtualscroll"===l.requestType&&l.virtualInfo.sentinelInfo&&"X"===l.virtualInfo.sentinelInfo.axis)&&(P=h.getHeaderTable().querySelector(oD),(e?(B=P.parentElement,ue(P),B):(P.innerHTML="",P)).appendChild(v),h.isInitialLoad||h.scrollModule.setHeight()),l.rows=this.rows.slice(0),PP(function(){t.parent.notify(wI,l),t.parent.enableVirtualization||t.parent.enableColumnVirtualization&&!i||C||(h.isReact||(t.tbody.innerHTML=""),je(t.tbody.parentElement)?ue(h.getContentTable().querySelector(oD)):ue(t.tbody),t.tbody=t.parent.createElement(oD,{attrs:{role:"rowgroup"}})),h.rowTemplate&&ro(h.element.id+"rowTemplate","RowTemplate",h),!je(t.parent.infiniteScrollModule)&&(t.parent.enableInfiniteScrolling&&!t.isInfiniteColumnvirtualization()||i)?(t.isAddRows=!1,t.parent.notify(dT,{args:l}),t.parent.notify(hT,{tbody:t.tbody,frag:y,args:l,rows:t.rows,rowElements:t.rowElements,visibleRows:t.visibleRows,tableName:void 0}),t.isInfiniteColumnvirtualization()&&t.parent.isFrozenGrid()&&(e=jB(t.parent.getContent().querySelector(".e-virtualtable")),t.parent.contentModule.resetStickyLeftPos(e.width),t.widthService.refreshFrozenScrollbar())):(t.useGroupCache=!1,t.appendContent(t.tbody,y,l)),t.parent.editSettings.showAddNewRow&&(t.parent.enableVirtualization||t.parent.enableInfiniteScrolling)&&(e=t.parent.element.querySelector(".e-addrow-removed"))&&ue(e);var e=!t.parent.element.querySelector("."+YE);t.parent.editSettings.showAddNewRow&&"Normal"===t.parent.editSettings.mode&&(e&&((t.parent.enableVirtualization||t.parent.enableInfiniteScrolling)&&(t.parent.isAddNewRow=!0),t.parent.isEdit=!1,t.parent.addRecord()),e||(t.parent.enableVirtualization||t.parent.enableInfiniteScrolling)&&["sorting","filtering","searching","grouping","ungrouping","reorder"].some(function(e){return l.requestType===e}))&&t.parent.notify(wE,{}),t.parent.getVisibleFrozenRightCount()&&t.parent.getContent()&&0<QB(t.parent)&&t.parent.element.classList.add("e-right-shadow"),y=null},this.rafCallback(Pe({},l)))}},RD.prototype.isInfiniteColumnvirtualization=function(){return this.parent.enableColumnVirtualization&&this.parent.enableInfiniteScrolling},RD.prototype.enableCacheOnInfiniteColumnVirtual=function(){return this.isInfiniteColumnvirtualization()&&this.parent.infiniteScrollSettings.enableCache},RD.prototype.emptyVcRows=function(){this.parent.vcRows=[],this.parent.vRows=[]},RD.prototype.appendContent=function(e,t,i,n){if(this.parent.isReact&&!je(this.parent.rowTemplate)?this.getTable().appendChild(t):(e.appendChild(t),this.getTable().appendChild(e)),"Vertical"===this.parent.rowRenderingMode&&this.parent.allowTextWrap&&("Header"===this.parent.textWrapSettings.wrapMode||"Both"===this.parent.textWrapSettings.wrapMode))for(var o=e.querySelectorAll("td"),r=0;r<o.length;r++){var s=parseFloat(document.defaultView.getComputedStyle(o[parseInt(r.toString(),10)],"::before").getPropertyValue("height"));o[parseInt(r.toString(),10)].offsetHeight<s&&(o[parseInt(r.toString(),10)].style.height=s+"px",o[parseInt(r.toString(),10)].style.boxSizing="content-box")}this.parent.getVisibleFrozenLeftCount()&&this.parent.enableColumnVirtualization&&this.widthService.refreshFrozenScrollbar()},RD.prototype.setRowsInLazyGroup=function(e,t){this.parent.groupSettings.enableLazyLoading&&!this.useGroupCache&&this.parent.groupSettings.columns.length&&(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).maintainRows(e,t)},RD.prototype.setGroupCache=function(e,t){!this.useGroupCache&&this.parent.groupSettings.enableLazyLoading&&this.parent.notify(wT,{args:t,data:e})},RD.prototype.ensureFrozenHeaderRender=function(e){return!(this.parent.enableVirtualization&&("reorder"===e.requestType||"refresh"===e.requestType)||this.parent.infiniteScrollSettings.enableCache&&this.parent.frozenRows&&"delete"===this.parent.infiniteScrollModule.requestType&&1!==this.parent.pageSettings.currentPage)},RD.prototype.ensureVirtualFrozenHeaderRender=function(e){return!(this.parent.enableVirtualization&&"delete"===e.requestType)},RD.prototype.checkCache=function(e,t){var i;return this.parent.infiniteScrollSettings.enableCache&&"infiniteScroll"===t.requestType?(this.isAddRows=!je(this.infiniteCache[this.parent.pageSettings.currentPage]),this.isAddRows&&(i=this.infiniteCache[this.parent.pageSettings.currentPage],e=1===this.parent.pageSettings.currentPage?i.slice(this.parent.frozenRows):i),e):this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&("paging"===t.requestType||"columnstate"===t.requestType||"reorder"===t.requestType||"virtualscroll"===t.requestType)&&(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).getGroupCache()[this.parent.pageSettings.currentPage]?(this.parent.enableVirtualization||(this.useGroupCache=!0),this.parent.enableVirtualization?this.parent.getRowsObject():this.parent.contentModule.initialGroupRows("reorder"===t.requestType)):null},RD.prototype.setInfiniteVisibleRows=function(e,t){!this.parent.enableInfiniteScrolling||this.parent.infiniteScrollSettings.enableCache||this.isInfiniteColumnvirtualization()&&"virtualscroll"===e.requestType||this.visibleRows.push(t)},RD.prototype.getCurrentBlockInfiniteRecords=function(){var e=[];if(this.parent.infiniteScrollSettings.enableCache){if(!Object.keys(this.infiniteCache).length)return[];for(var t=this.parent.getRows(),i=parseInt(t[this.parent.frozenRows].getAttribute(nD),10)-1,n=Math.ceil((1+i)/this.parent.pageSettings.pageSize),i=parseInt(t[t.length-1].getAttribute(nD),10)-1,o=Math.ceil((i+(t.length?1:0))/this.parent.pageSettings.pageSize),r=n;r<=o;r++)e=e.length?e.concat(this.infiniteCache[parseInt(r.toString(),10)]):this.infiniteCache[parseInt(r.toString(),10)];this.parent.frozenRows&&1<this.parent.pageSettings.currentPage&&(e=this.infiniteCache[1].slice(0,this.parent.frozenRows).concat(e))}return e},RD.prototype.getReorderedRows=function(e){return this.parent.contentModule.getReorderedFrozenRows(e)},RD.prototype.virtualFrozenHdrRefresh=function(e,t,i,n,o,r){if(this.parent.frozenRows&&this.parent.enableVirtualization&&("reorder"===n.requestType||"refresh"===n.requestType)){for(var s,a=this.getReorderedRows(n),l=0;l<a.length;l++)s=i.render(a[parseInt(l.toString(),10)],r),e.appendChild(s);1===n.virtualInfo.page&&t.splice(0,this.parent.frozenRows)}},RD.prototype.getInfiniteRows=function(){var e=[];if(this.parent.enableInfiniteScrolling)if(this.parent.infiniteScrollSettings.enableCache)for(var t=Object.keys(this.infiniteCache),i=0;i<t.length;i++)e=e.concat(this.infiniteCache[t[parseInt(i.toString(),10)]]);else e=this.visibleRows;return e},RD.prototype.getInfiniteMovableRows=function(){var e=this.getCurrentBlockInfiniteRecords();return this.parent.enableInfiniteScrolling?e.length?e:this.visibleRows:[]},RD.prototype.getPanel=function(){return this.contentPanel},RD.prototype.setPanel=function(e){this.contentPanel=e},RD.prototype.getTable=function(){return this.contentTable},RD.prototype.setTable=function(e){this.contentTable=e},RD.prototype.getRows=function(){var e=this.getInfiniteRows();return e.length?e:this.rows},RD.prototype.getRowElements=function(){return this.rowElements},RD.prototype.setRowElements=function(e){this.rowElements=e},RD.prototype.getColGroup=function(){return this.colgroup},RD.prototype.setColGroup=function(e){return je(e)||(e.id="content-"+e.id),this.colgroup=e},RD.prototype.setVisible=function(e){for(var t,i=this.parent,n=(this.getRows().some(function(e){return e.isDataRow&&(t=e),e.isDataRow}),!0),o=(!i.groupSettings.columns.length&&t&&(n=!1),i.getDataRows()),i=this.infiniteRowVisibility(),r=i||this.rows.filter(function(e){return!e.isDetailRow}),s=0,a=e.length;s<a;s++){var l=e[parseInt(s.toString(),10)],h=this.parent.getNormalizedColumnIndex(l.uid),d=this.parent.getColumnIndexByUid(l.uid),p=!0===l.visible?"":"none";-1!==h&&t&&h<t.cells.length&&gt(this.getColGroup().childNodes[parseInt(h.toString(),10)],{display:p}),n||this.setDisplayNone(o,d,p,r),!this.parent.invokedFromMedia&&l.hideAtMedia&&this.parent.updateMediaColumns(l),this.parent.invokedFromMedia=!1}n?this.refreshContentRows({requestType:"refresh"}):(this.parent.notify(OI,{rows:r,args:{}}),this.parent.editSettings.showAddNewRow&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.notify(wE,{}))},RD.prototype.setDisplayNone=function(e,t,i,n){wF(e,t,i,n,this.parent,this.parent.isRowDragable()),this.parent.notify(lT,{visible:i,index:t,isFreeze:this.isInfiniteFreeze})},RD.prototype.infiniteRowVisibility=function(e){var t;return this.parent.enableInfiniteScrolling&&(this.isInfiniteFreeze=e,t=this.parent.infiniteScrollSettings.enableCache?this.getCurrentBlockInfiniteRecords():e?this.visibleFrozenRows:this.visibleRows),t},RD.prototype.colGroupRefresh=function(){var e;this.getColGroup()&&(e=this.getHeaderColGroup(),this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e))},RD.prototype.getHeaderColGroup=function(){return this.parent.element.querySelector("."+RE).querySelector(rD+":not(.e-masked-colgroup)").cloneNode(!0)},RD.prototype.initializeContentDrop=function(){var e=this.parent;this.droppable=new un(e.element,{accept:".e-dragclone",drop:this.drop})},RD.prototype.droppableDestroy=function(){this.droppable&&!this.droppable.isDestroyed&&this.droppable.destroy()},RD.prototype.canSkip=function(e,t,i){return je(t)||je(e.visible)||t.cells[parseInt(i.toString(),10)].visible===e.visible},RD.prototype.getModelGenerator=function(){return this.generator=new(this.parent.allowGrouping?BD:bD)(this.parent)},RD.prototype.renderEmpty=function(e){this.getTable().appendChild(e),this.parent.frozenRows&&(this.parent.getHeaderContent().querySelector(oD).innerHTML="")},RD.prototype.setSelection=function(t,e,i){this.parent.notify(DT,{uid:t,set:e,clearAll:i});for(var n=this.getRows().filter(function(e){return i||t===e.uid}),o=0;o<n.length;o++){n[parseInt(o.toString(),10)].isSelected=e;for(var r=n[parseInt(o.toString(),10)].cells,s=0;s<r.length;s++)r[parseInt(s.toString(),10)].isSelected=e}},RD.prototype.getRowByIndex=function(e){return je(e=this.getInfiniteRowIndex(e))?void 0:this.parent.getDataRows()[parseInt(e.toString(),10)]},RD.prototype.getInfiniteRowIndex=function(e){var t,i;return this.parent.infiniteScrollSettings.enableCache&&!je(e)&&(i=e<(t=this.parent.frozenRows)?0:t,i=parseInt(this.parent.getRows()[parseInt(i.toString(),10)].getAttribute(nD),10)-1,e=e<t?e:e-i+t),e},RD.prototype.getVirtualRowIndex=function(e){return e},RD.prototype.enableAfterRender=function(e){"group"===e.module&&e.enable&&(this.generator=this.getModelGenerator())},RD.prototype.setRowObjects=function(e){this.rows=e},RD.prototype.immutableModeRendering=function(e){var t=this,i=(void 0===e&&(e={}),this.parent),n=(i.hideSpinner(),i.getPrimaryKeyFieldNames()[0]),o={},r=[],s=i.getRowsObject().slice(),a=this.getBatchEditedRecords(n,s),l={},h=0!==Object.keys(a).length;if(i.getContent().querySelector(".e-emptyrow")||"reorder"===e.requestType||this.parent.groupSettings.columns.length)this.refreshContentRows(e);else if(0!==i.currentViewData.length){var d={},p=i.createElement(oD,{attrs:{role:"rowgroup"}}),c=i.currentViewData,u=[].slice.call(this.getTable().querySelector(oD).children);if(this.prevCurrentView.length){var g=this.prevCurrentView.length,m=c.length;if(g===m)for(var f=0;f<m;f++)"Batch"===this.parent.editSettings.mode&&u[parseInt(f.toString(),10)].classList.contains("e-insertedrow")?(u.splice(f,1),--f):(c[parseInt(f.toString(),10)][""+n],o[this.prevCurrentView[parseInt(f.toString(),10)][""+n]]=f,l[parseInt(f.toString(),10)]=c[parseInt(f.toString(),10)][""+n],d[s[parseInt(f.toString(),10)].uid]=u[parseInt(f.toString(),10)],parseInt(f.toString(),10),this.prevCurrentView[parseInt(f.toString(),10)][""+n]);else{for(f=0;f<m;f++)c[parseInt(f.toString(),10)][""+n],l[parseInt(f.toString(),10)]=c[parseInt(f.toString(),10)][""+n];for(f=0;f<g;f++)"Batch"===this.parent.editSettings.mode&&u[parseInt(f.toString(),10)].classList.contains("e-insertedrow")?(u.splice(f,1),--f):(d[s[parseInt(f.toString(),10)].uid]=u[parseInt(f.toString(),10)],o[this.prevCurrentView[parseInt(f.toString(),10)][""+n]]=f,parseInt(f.toString(),10),this.prevCurrentView[parseInt(f.toString(),10)][""+n])}}for(var y,f=0;f<c.length;f++){var v,b,w=o[c[parseInt(f.toString(),10)][""+n]];je(w)?(b=new yD(this.serviceLocator,null,i),v={startIndex:f},v=this.generator.generateRows([c[parseInt(f.toString(),10)]],v),r.push(v[0]),b=b.render(v[0],i.getColumns()),p.appendChild(b),this.refreshImmutableContent(f,b,r[parseInt(f.toString(),10)])):(v=!1,this.parent.enableDeepCompare&&(v=this.objectEqualityChecker(this.prevCurrentView[parseInt(w.toString(),10)],c[parseInt(f.toString(),10)])),b=d[s[parseInt(w.toString(),10)].uid],r.push(s[parseInt(w.toString(),10)]),this.rowElements[parseInt(w.toString(),10)]&&this.rowElements[parseInt(w.toString(),10)].getAttribute("data-uid")===r[parseInt(f.toString(),10)].uid&&(h&&je(a[l[parseInt(f.toString(),10)]])||!h&&(v||this.prevCurrentView[parseInt(w.toString(),10)]===c[parseInt(f.toString(),10)]))?(w!==f&&this.refreshImmutableContent(f,b,r[parseInt(f.toString(),10)]),p.appendChild(b)):((h&&!je(a[l[parseInt(f.toString(),10)]])||!this.parent.enableDeepCompare&&c[parseInt(f.toString(),10)]!==this.prevCurrentView[parseInt(w.toString(),10)]||this.parent.enableDeepCompare&&!v)&&s[parseInt(w.toString(),10)].setRowValue(c[parseInt(f.toString(),10)]),p.appendChild(b),this.refreshImmutableContent(f,b,r[parseInt(f.toString(),10)])))}this.rows=r,this.rowElements=[].slice.call(p.children),ue(this.getTable().querySelector(oD)),this.getTable().appendChild(p),this.parent.trigger(qA,{},function(){t.parent.allowTextWrap&&t.parent.notify(oI,{case:"textwrap"})}),e&&(y=(e.requestType||"").toLowerCase()+"-complete",this.parent.notify(y,e))}},RD.prototype.objectEqualityChecker=function(e,t){for(var i=Object.keys(e),n=!0,o=0;o<i.length;o++)if(!(e[i[parseInt(o.toString(),10)]]===t[i[parseInt(o.toString(),10)]]||e[i[parseInt(o.toString(),10)]]instanceof Date&&t[i[parseInt(o.toString(),10)]]instanceof Date&&e[i[parseInt(o.toString(),10)]].getTime()===t[i[parseInt(o.toString(),10)]].getTime())){n=!1;break}return n},RD.prototype.getBatchEditedRecords=function(e,t){var i={},n=this.parent.getBatchChanges(),o=[],r=[],n=(Object.keys(n).length&&(o=n.changedRecords,r=n.addedRecords),{cancel:!1});this.parent.notify(kT,{rows:t,args:n}),r.length&&("Bottom"===this.parent.editSettings.newRowPosition?t.splice(t.length-1,r.length):n.cancel||t.splice(0,r.length));for(var s=0;s<o.length;s++)i[o[parseInt(s.toString(),10)][""+e]]=s;return i},RD.prototype.refreshImmutableContent=function(e,t,i){i.isAltRow=!!this.parent.enableAltRow&&e%2!=0,i.isAltRow?t.classList.add("e-altrow"):t.classList.remove("e-altrow"),i.index=e,i.edit=void 0,i.isDirty=!1,t.setAttribute(nD,(e+1).toString()),this.updateCellIndex(t,e)},RD.prototype.updateCellIndex=function(e,t){for(var i=0;i<e.cells.length;i++)e.cells[parseInt(i.toString(),10)].setAttribute("index",t.toString())};var LD=RD;function RD(e,t){var l=this;this.rows=[],this.freezeRows=[],this.movableRows=[],this.freezeRowElements=[],this.currentInfo={},this.prevCurrentView=[],this.isLoaded=!0,this.drop=function(e){l.parent.notify(a1,{target:e.target,droppedElement:e.droppedElement}),ue(e.droppedElement)},this.infiniteCache={},this.visibleRows=[],this.visibleFrozenRows=[],this.rightFreezeRows=[],this.isAddRows=!1,this.isInfiniteFreeze=!1,this.useGroupCache=!1,this.tempFreezeRows=[],this.rafCallback=function(s){var a=s;return function(){if(l.ariaService.setBusy(l.getPanel().querySelector("."+WE),!1),!l.parent.isDestroyed){var e,t=l.rows.slice(0);if(l.parent.enableInfiniteScrolling){if(l.parent.groupSettings.enableLazyLoading)for(var i=0;i<l.visibleRows.length;i++)l.setRowsInLazyGroup(l.visibleRows[parseInt(i.toString(),10)],i);t=l.parent.getRowsObject();var n=a.prevPage;if(l.parent.infiniteScrollSettings.enableCache&&n)for(var o=l.parent.infiniteScrollSettings.maxBlocks,t=[],n=parseInt(l.rowElements[0].getAttribute("aria-rowindex"),10),i=0,r=Math.ceil(n/l.parent.pageSettings.pageSize);i<o;i++,r++)l.infiniteCache[parseInt(r.toString(),10)]&&(t=t.concat(l.infiniteCache[parseInt(r.toString(),10)]))}l.parent.notify(X1,{rows:t,args:a}),l.parent.editSettings.showAddNewRow&&l.parent.addNewRowFocus&&(l.parent.notify(wE,{}),l.parent.addNewRowFocus=!1),l.parent.autoFit&&l.parent.preventAdjustColumns(),l.parent.isInitialLoad||l.parent.focusModule.setFirstFocusableTabIndex(),l.isLoaded&&(l.parent.isManualRefresh=!1,l.parent.enableInfiniteScrolling&&l.parent.groupSettings.enableLazyLoading&&"sorting"===s.requestType&&(l.parent.infiniteScrollModule.groupCaptionAction=void 0),n=l.parent.parentDetails&&l.parent.parentDetails.parentInstObj&&l.parent.parentDetails.parentInstObj.isReact,(l.parent.isReact||n)&&l.parent.element.querySelectorAll(".e-templatecell").length?(e=l).parent.renderTemplates(function(){e.parent.trigger(qA,{},function(){e.parent.allowTextWrap&&e.parent.notify(oI,{case:"textwrap"})})}):l.parent.trigger(qA,{},function(){l.parent.allowTextWrap&&l.parent.notify(oI,{case:"textwrap"})}),l.parent.allowTextWrap)&&"auto"===l.parent.height&&(l.parent.getContentTable().scrollHeight>l.parent.getContent().clientHeight?l.parent.scrollModule.setPadding():l.parent.scrollModule.removePadding()),a&&(n=(a.requestType||"").toLowerCase()+"-complete",l.parent.notify(n,a),"batchsave"===s.requestType)&&(s.cancel=!1,l.parent.trigger(QA,s)),l.isLoaded&&l.parent.hideSpinner()}}},this.parent=e,this.serviceLocator=t,this.widthService=t.getService("widthService"),this.ariaService=this.serviceLocator.getService("ariaService"),this.parent.enableDeepCompare=this.parent.getDataModule().isRemote(),this.generator=this.getModelGenerator(),this.parent.isDestroyed||(this.parent.enableColumnVirtualization||this.parent.enableVirtualization||this.parent.groupSettings.enableLazyLoading||this.parent.on(Sx,this.setVisible,this),this.parent.on(ex,this.colGroupRefresh,this),this.parent.on(K1,this.enableAfterRender,this),this.parent.on(oT,this.refreshContentRows,this),this.parent.on(yx,this.beforeCellFocused,this),this.parent.on(Cx,this.droppableDestroy,this))}ND.prototype.renderPanel=function(){var e=null!=(t=this.parent.element.querySelector("."+RE)),t=e?t:this.parent.createElement("div",{className:"e-gridheader"}),i=e?t.querySelector("."+VE):this.parent.createElement("div",{className:VE});this.toggleStackClass(t),t.appendChild(i),this.setPanel(t),e||this.parent.element.appendChild(t)},ND.prototype.renderTable=function(){var e=this.getPanel();e.appendChild(this.createHeaderTable()),this.setTable(e.querySelector("."+QE)),this.initializeHeaderDrag(),this.initializeHeaderDrop(),this.parent.notify(tx,{rows:this.rows})},ND.prototype.getPanel=function(){return this.headerPanel},ND.prototype.setPanel=function(e){this.headerPanel=e},ND.prototype.getTable=function(){return this.headerTable},ND.prototype.setTable=function(e){this.headerTable=e},ND.prototype.getColGroup=function(){return this.colgroup},ND.prototype.setColGroup=function(e){return this.colgroup=e},ND.prototype.getRows=function(){return this.getTable().tHead.rows},ND.prototype.createHeaderTable=function(){var e=this.createTable(),t=this.getPanel().querySelector("."+VE);return t.appendChild(e),t},ND.prototype.createHeader=function(e,t){for(var i,n=this.parent,o=(this.getTable()&&ue(this.getTable()),this.parent.createElement("table",{className:QE,attrs:{role:"presentation"}})),t=(o.style.cssText="border-collapse: separate; border-spacing: .25px;",this.createHeaderContent(t)),r=t.thead,s=this.parent.createElement(oD,{className:this.parent.frozenRows||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow?"":"e-hide",attrs:{role:"rowgroup"}}),a=(this.caption=this.parent.createElement("caption",{innerHTML:this.parent.element.id+"_header_table",className:"e-hide"}),this.parent.createElement(rD)),l=this.parent.createElement("tr",{attrs:{role:"row"},className:(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow?"e-hide":""}),h=this.rows=t.rows,d=0,p=h.length;d<p;d++)for(var c=0,u=h[parseInt(d.toString(),10)].cells.length;c<u;c++)i=this.parent.createElement("td"),l.appendChild(i);return(n.allowFiltering||n.allowSorting||n.allowGrouping)&&o.classList.add("e-sortfilter"),this.updateColGroup(a),s.appendChild(l),o.appendChild(this.setColGroup(a)),o.appendChild(r),o.appendChild(s),o.appendChild(this.caption),o},ND.prototype.createTable=function(e){return this.createHeader(e=void 0===e?null:e)},ND.prototype.createHeaderContent=function(e){var t,i=this.parent,n=i.getColumns(),o=this.parent.createElement("thead",{attrs:{role:"rowgroup"}}),r=this.parent.createElement("tr",{className:"e-columnheader",attrs:{role:"row"}}),s=new yD(this.serviceLocator,LA.Header,i),a=(s.element=r,[]);this.colDepth=_B(i.columns);for(var l=0,h=this.colDepth;l<h;l++)a[parseInt(l.toString(),10)]=this.generateRow(l),a[parseInt(l.toString(),10)].cells=[];if(a=this.ensureColumns(a),a=this.getHeaderCells(a,e),i.isRowDragable()&&"Right"===this.parent.getFrozenMode())for(l=0,h=a.length;l<h;l++)a[parseInt(l.toString(),10)].cells.push(this.generateCell({},LA.RowDragHIcon));n.filter(function(e){return e.headerTemplate}).length&&(this.parent.isReact||this.parent.isVue)&&EF(this.parent,["headerTemplate"]);for(l=0,h=this.colDepth;l<h;l++)t=s.render(a[parseInt(l.toString(),10)],n),this.parent.rowHeight&&t.querySelector(".e-headercell")&&(t.style.height=this.parent.rowHeight+"px"),hF(t),o.appendChild(t);return{thead:o,rows:a}},ND.prototype.updateColGroup=function(e){var t,i=this.parent.getColumns(),n=this.parent.getColumnIndexesInView();if(e.id=this.parent.element.id+rD,this.parent.allowGrouping)for(var o=0,r=this.parent.groupSettings.columns.length;o<r;o++)this.parent.enableColumnVirtualization&&-1===n.indexOf(o)||(t=this.parent.createElement("col",{className:"e-group-intent"}),e.appendChild(t));(this.parent.detailTemplate||this.parent.childGrid)&&(t=this.parent.createElement("col",{className:"e-detail-intent"}),e.appendChild(t)),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&(t=this.parent.createElement("col",{className:"e-drag-intent"}),e.appendChild(t));for(o=0,r=i.length;o<r;o++)t=this.parent.createElement("col"),!1===i[parseInt(o.toString(),10)].visible&&gt(t,{display:"none"}),e.appendChild(t);return this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&(t=this.parent.createElement("col",{className:"e-drag-intent"}),e.appendChild(t)),e},ND.prototype.ensureColumns=function(e){for(var t,i=this.parent,n=this.parent.getColumnIndexesInView(),o=0,r=e.length;o<r;o++){if(i.allowGrouping)for(var s=0,a=i.groupSettings.columns.length;s<a;s++)this.parent.enableColumnVirtualization&&-1===n.indexOf(s)||e[parseInt(o.toString(),10)].cells.push(this.generateCell({},LA.HeaderIndent));(i.detailTemplate||i.childGrid)&&(this.parent.notify(YI,t={}),e[parseInt(o.toString(),10)].cells.push(this.generateCell(t,LA.DetailHeader))),i.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&e[parseInt(o.toString(),10)].cells.push(this.generateCell({},LA.RowDragHIcon))}return e},ND.prototype.getHeaderCells=function(e,t){var i=this.parent.getHeaderTable()&&this.parent.getHeaderTable().querySelector("thead"),n=this.parent.enableColumnVirtualization?this.parent.getColumns(this.parent.enablePersistence):this.parent.columns;if(this.frzIdx=0,this.notfrzIdx=0,this.parent.lockcolPositionCount)for(var o=0;o<(je(n)?0:n.length);o++)this.lockColsRendered=!1,e=this.appendCells(n[parseInt(o.toString(),10)],e,0,0===o,!1,o===n.length-1,i,t,!1);for(var o=0,r=je(n)?0:n.length;o<r;o++)this.notfrzIdx=0,this.lockColsRendered=!0,e=this.appendCells(n[parseInt(o.toString(),10)],e,0,0===o,!1,o===r-1,i,t,!1);return e},ND.prototype.appendCells=function(e,t,i,n,o,r,s,a,l){var l=r?l?"e-laststackcell":"e-lastcell":"",h=!this.parent.lockcolPositionCount||e.lockColumn&&!this.lockColsRendered||!e.lockColumn&&this.lockColsRendered;if(e.columns){this.isFirstCol=!1;var d,p=this.getCellCnt(e,0);if(p&&(d=this.getStackedLockColsCount(e,0),0===this.parent.lockcolPositionCount||!this.lockColsRendered&&0!==d||this.lockColsRendered&&p-d!=0)&&t[parseInt(i.toString(),10)].cells.push(new kE({cellType:LA.StackedHeader,column:e,colSpan:this.getColSpan(p,d),className:!n&&o?"e-firstcell":""})),this.parent.lockcolPositionCount&&!this.lockColsRendered)for(var c=0;c<e.columns.length;c++)t=this.appendCells(e.columns[parseInt(c.toString(),10)],t,i+1,n,0===c,c===e.columns.length-1&&r,s,a,!1);if(this.lockColsRendered)for(var c=0,u=e.columns.length;c<u;c++){n=n&&0===c;var g=this.isFirstCol=e.columns[parseInt(c.toString(),10)].visible&&!n,m=c===u-1&&r;t=this.appendCells(e.columns[parseInt(c.toString(),10)],t,i+1,n,g&&!m,m,s,a,!0)}}else h&&t[parseInt(i.toString(),10)].cells.push(this.generateCell(e,LA.Header,this.colDepth-i,(!n&&o?"e-firstcell":"")+l,i,this.parent.getColumnIndexByUid(e.uid))),!this.parent.lockcolPositionCount||this.frzIdx+this.notfrzIdx<this.parent.frozenColumns&&(e.lockColumn&&!this.lockColsRendered||!e.lockColumn&&this.lockColsRendered)?this.frzIdx++:this.notfrzIdx++;return t},ND.prototype.getStackedLockColsCount=function(e,t){if(e.columns)for(var i=0;i<e.columns.length;i++)t=this.getStackedLockColsCount(e.columns[parseInt(i.toString(),10)],t);else e.lockColumn&&t++;return t},ND.prototype.getColSpan=function(e,t){return e=this.lockColsRendered?e-t:t},ND.prototype.generateRow=function(e){return new DE({})},ND.prototype.generateCell=function(e,t,i,n,o,r){e={visible:e.visible,isDataCell:!1,isTemplate:!je(e.headerTemplate),rowID:"",column:e,cellType:t,rowSpan:i,className:n,index:o,colIndex:r};return(!e.rowSpan||e.rowSpan<2)&&delete e.rowSpan,new kE(e)},ND.prototype.setVisible=function(e){for(var t=this.parent,i=0,n=e.length;i<n;i++){var o=e[parseInt(i.toString(),10)],r=t.getNormalizedColumnIndex(o.uid),o=o.visible?"":"none";gt(this.getColGroup().children[parseInt(r.toString(),10)],{display:o}),t.editSettings.showAddNewRow&&t.element.querySelector(".e-addedrow")&&gt(t.element.querySelector(".e-addedrow").querySelector("colgroup").childNodes[parseInt(r.toString(),10)],{display:o})}this.refreshUI(),this.parent.editSettings.showAddNewRow&&(this.parent.isAddNewRow=!0)},ND.prototype.colPosRefresh=function(){this.refreshUI()},ND.prototype.refreshUI=function(){var e=this.getPanel(),t=(this.toggleStackClass(e),this.getTable());if(t){ue(t),this.parent.editSettings.showAddNewRow&&!this.parent.isAddNewRow&&t.querySelector(".e-addedrow")&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&(t.querySelector(".e-addedrow").classList.add("e-addrow-removed"),this.parent.isAddNewRow=!0),t.removeChild(t.firstChild),t.removeChild(t.childNodes[0]);for(var i=this.parent.createElement(rD),n=this.createHeaderContent(void 0),n=(this.rows=n.rows,t.insertBefore(n.thead,t.firstChild),this.updateColGroup(i),t.insertBefore(this.setColGroup(i),t.firstChild),this.appendContent(t),this.parent.notify(ex,{}),this.widthService.setWidthToColumns(),this.parent.updateDefaultCursor(),this.initializeHeaderDrag(),[].slice.call(e.querySelectorAll("tr.e-columnheader"))),o=0,r=n;o<r.length;o++){var s=r[o],s=[].slice.call(s.getElementsByClassName("e-grouptopleftcell"));s.length&&s[s.length-1].classList.add("e-lastgrouptopleftcell")}this.parent.notify(tx,{rows:this.rows}),this.parent.enableColumnVirtualization&&A(t,HE)&&this.parent.notify(tx,{rows:this.rows,args:{isFrozen:!1,isXaxis:!0}}),this.parent.allowTextWrap&&"Header"===this.parent.textWrapSettings.wrapMode&&fB(n,!0)}i=this.parent.getHeaderContent().querySelector(".e-headercell:not(.e-hide)");je(i)||(i.tabIndex=0)},ND.prototype.toggleStackClass=function(e){var t=this.parent.columns;!je(t)&&t.some(function(e){return!je(e.columns)})?e.classList.add("e-stackedheader"):e.classList.remove("e-stackedheader")},ND.prototype.appendContent=function(e){this.getPanel().querySelector("."+VE).appendChild(e)},ND.prototype.getCellCnt=function(e,t){if(e.columns)for(var i=0,n=e.columns.length;i<n;i++)t=this.getCellCnt(e.columns[parseInt(i.toString(),10)],t);else e.visible&&t++;return t},ND.prototype.initializeHeaderDrag=function(){var e=this.parent;(this.parent.allowReordering||this.parent.allowGrouping&&this.parent.groupSettings.showDropArea)&&(this.draggable=new hn(e.getHeaderContent(),{dragTarget:".e-headercell",distance:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop,abort:".e-rhandler",isReplaceDragEle:this.isReplaceDragEle}),this.parent.on(Cx,this.droppableDestroy,this))},ND.prototype.initializeHeaderDrop=function(){var e=this.parent;this.droppable=new un(e.getHeaderContent(),{accept:".e-dragclone",drop:this.drop}),this.parent.on(Cx,this.droppableDestroy,this)},ND.prototype.droppableDestroy=function(){this.droppable&&!this.droppable.isDestroyed&&this.droppable.destroy(),this.draggable&&!this.draggable.isDestroyed&&this.draggable.destroy()},ND.prototype.renderCustomToolbar=function(){var t=this,e=this.parent;if("Vertical"===e.rowRenderingMode&&!e.toolbar&&(e.allowSorting||e.allowFiltering&&"FilterBar"!==e.filterSettings.type)){for(var i=e.createElement("div",{className:"e-res-toolbar e-toolbar"}),n=e.createElement("div",{className:"e-toolbar-items"}),o=e.createElement("div",{className:"e-toolbar-left"}),r=this.parent.allowFiltering&&this.parent.allowSorting?2:1,s=0;s<r;s++){var a=e.createElement("div",{className:"e-toolbar-item e-gridresponsiveicons e-icons e-tbtn-align"}),l=1==r?this.parent.allowSorting?"sort":"filter":1===s?"sort":"filter",h=e.createElement("button",{className:"e-tbar-btn e-control e-btn e-lib e-icon-btn"}),l=e.createElement("span",{className:"e-btn-icon e-res"+l+"-icon e-icons"});h.appendChild(l),new zv({cssClass:this.parent.cssClass||""}).appendTo(h),h.onclick=function(e){e.target.classList.contains("e-ressort-btn")||e.target.classList.contains("e-ressort-icon")||e.target.querySelector(".e-ressort-icon")?t.parent.showResponsiveCustomSort():t.parent.showResponsiveCustomFilter()},a.appendChild(h),o.appendChild(a)}n.appendChild(o),i.appendChild(n),e.element.insertBefore(i,this.parent.element.querySelector("."+RE))}else e.enableAdaptiveUI&&!e.toolbar&&e.getContent().classList.add("e-responsive-header")},ND.prototype.updateCustomResponsiveToolbar=function(e){var t=this.parent.element.querySelector(".e-responsive-toolbar");"toolbar"===e.module&&(t?ue(t):this.renderCustomToolbar())};var OD=ND;function ND(e,t){var d=this;this.frzIdx=0,this.notfrzIdx=0,this.isFirstCol=!1,this.isReplaceDragEle=!0,this.helper=function(e){var t=d.parent,i=d.draggable.currentStateTarget,n=A(i,"e-headercell");if(!t.allowReordering&&!t.allowGrouping||!je(n)&&0<n.getElementsByClassName("e-checkselectall").length)return!1;var o=d.parent.createElement("div",{className:"e-cloneproperties e-dragclone e-headerclone"}),i=i.classList.contains("e-headercell")?i:n;if(!i||!t.allowReordering&&i.classList.contains("e-stackedheadercell"))return!1;var r,s,a,l,n=i.offsetHeight,h=i.querySelector(".e-headercelldiv")||i.querySelector(".e-stackedheadercelldiv");if(h){if(r=i.querySelector(".e-stackedheadercelldiv")?t.getStackedHeaderColumnByHeaderText(h.innerText.trim(),t.columns):t.getColumnByUid(h.getAttribute("e-mappinguid")),d.column=r,d.column.lockColumn)return!1;o.setAttribute("e-mappinguid",d.column.uid)}return r&&!je(r.headerTemplate)?(je(r.headerTemplate)?o.innerHTML=r.headerTemplate:(s=t.getColumnIndexByField(r.field),s=r.getHeaderTemplate()(Pe({index:s},r),t,"headerTemplate",null,null,null,null,t.root),a=t.isReact&&"string"!=typeof r.headerTemplate,l=t.parentDetails&&t.parentDetails.parentInstObj&&t.parentDetails.parentInstObj.isReact,(a||l)&&t.renderTemplates(),eB(o,s)),je(o.firstChild)||1!==o.firstChild.nodeType||(o.firstChild.style.pointerEvents="none")):o.innerHTML=h?r.headerText:i.firstElementChild.innerHTML,o.style.width=i.offsetWidth+"px",o.style.height=i.offsetHeight+"px",o.style.lineHeight=(n-6).toString()+"px",t.element.appendChild(o),o},this.dragStart=function(e){var t=d.parent;t.element.querySelector(".e-gridpopup").style.display="none",t.notify(r1,{target:d.draggable.currentStateTarget,column:d.column,event:e.event})},this.drag=function(e){var t,i=d.parent,n=e.target;n&&(n=z(n,".e-grid"),t=d.parent.element.querySelector(".e-cloneproperties"),n&&n.getAttribute("id")===i.element.getAttribute("id")||(mt(t,["e-notallowedcur"],["e-defaultcur"]),i.allowReordering&&(i.element.querySelector(".e-reorderuparrow").style.display="none",i.element.querySelector(".e-reorderdownarrow").style.display="none"),i.groupSettings.allowReordering))&&i.notify(s1,{target:e.target,column:d.column,event:e.event})},this.dragStop=function(e){var t,i=d.parent;i.element.querySelector(".e-gridpopup").style.display="none",(!A(e.target,"e-headercell")&&!A(e.target,"e-groupdroparea")||!i.allowReordering&&A(e.target,"e-headercell")||!e.helper.getAttribute("e-mappinguid")&&A(e.target,"e-groupdroparea"))&&(ue(e.helper),t=!0),i.notify(Dx,{target:e.target,event:e.event,column:d.column,cancel:t})},this.drop=function(e){var t=d.parent,i=e.droppedElement.getAttribute("e-mappinguid"),n=z(e.target,".e-grid");ue(e.droppedElement),n&&n.getAttribute("id")!==t.element.getAttribute("id")||!t.allowReordering&&!t.allowGrouping||t.notify(Mx,{target:e.target,uid:i,droppedElement:e.droppedElement})},this.parent=e,this.serviceLocator=t,this.ariaService=this.serviceLocator.getService("ariaService"),this.widthService=this.serviceLocator.getService("widthService"),this.parent.isDestroyed||(this.parent.enableColumnVirtualization||this.parent.on(Sx,this.setVisible,this),this.parent.on(Ix,this.colPosRefresh,this),this.parent.on(G1,this.renderCustomToolbar,this),"Vertical"===this.parent.rowRenderingMode&&this.parent.on(K1,this.updateCustomResponsiveToolbar,this))}_D.prototype.getGui=function(){return""},_D.prototype.format=function(e,t,i){var n;return je(e.format)||("number"===e.type&&isNaN(parseInt(t,10))&&(t=null),"dateonly"===e.type&&"string"==typeof t&&t&&(n=t.split(/[^0-9.]/),t=new Date(parseInt(n[0],10),parseInt(n[1],10)-1,parseInt(n[2],10))),t=this.formatter.toView(t,e.getFormatter())),je(t)?"":t.toString()},_D.prototype.evaluate=function(e,t,i,n,o,r){var s,a,l,h,d,p,c;return!t.column.template||(a=this.parent.isReact&&"string"!=typeof t.column.template&&!(t.column.template.prototype&&t.column.template.prototype.CSPTemplate),l=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,h=this.parent.printGridParent&&this.parent.printGridParent.isReact,d=["index"],o=NB({},i,((i={})[mI]=o,i.column=t.column,i)),i=this.parent.element.id+t.column.uid,p="isStringTemplate",a||l||h?(c={index:n[d[0]]},t.column.getColumnTemplate()(Pe(c,o),this.parent,"columnTemplate",i,this.parent[p],null,e)):s=t.column.getColumnTemplate()(Pe({index:n[d[0]]},o),this.parent,"template",i,this.parent[p],void 0,void 0,this.parent.root),a||l||h||eB(e,s),this.parent.notify("template-result",{template:s}),s=null,t.column.templateOptions.enableAriaLabel&&e.setAttribute("aria-label",e.innerText+this.localizer.getConstant("TemplateCell")+this.localizer.getConstant("ColumnHeader")+t.column.headerText),!1)},_D.prototype.invokeFormatter=function(e,t,i){return t=je(e.formatter)?t:MP(e.formatter,"getValue")?(new e.formatter).getValue(e,i):"function"==typeof e.formatter?e.formatter(e,i):e.formatter.getValue(e,i)},_D.prototype.render=function(e,t,i,n,o){return this.refreshCell(e,t,i,o)},_D.prototype.refreshTD=function(e,t,i,n){var o="Batch"===this.parent.editSettings.mode&&e.classList.contains("e-editedbatchcell");if(this.parent.isReact){var r=e.cellIndex,s=e.parentElement,a=(ue(e),this.refreshCell(t,i,n,o));this.cloneAttributes(a,e),s.cells.length!==r-1?s.insertBefore(a,s.cells[parseInt(r.toString(),10)]):s.appendChild(a)}else{r=this.refreshCell(t,i,n,o),s=(e.innerHTML="",r.getAttribute("aria-label"));s&&e.setAttribute("aria-label",s);for(var l=0,h=[].slice.call(r.childNodes);l<h.length;l++){var d=h[l];e.appendChild(d)}}},_D.prototype.cloneAttributes=function(e,t){for(var i,n=t.attributes,o=n.length;o--;)i=n[parseInt(o.toString(),10)],e.setAttribute(i.name,i.value)},_D.prototype.refreshCell=function(e,t,i,n){var o,r,s=this.element.cloneNode(),a=e.column,l=(e.isForeignKey&&(r=e.foreignKeyData[0]||((r={})[a.foreignKeyValue]=a.format?null:"",r)),this.getGui()),h=e.isForeignKey?this.getValue(a.foreignKeyValue,r,a):this.getValue(a.field,t,a),d=("date"!==a.type&&"datetime"!==a.type||je(h)||(h=new Date(h)),"dateonly"!==a.type||je(h)||"string"!=typeof h||(d=h.split(/[^0-9.]/),h=new Date(parseInt(d[0],10),parseInt(d[1],10)-1,parseInt(d[2],10))),l=(h=this.format(a,h,t)).toString(),"boolean"!==a.type||a.displayAsCheckBox||(l=(d="true"!==h&&"false"!==h?null:"true"===h?"True":"False")?this.localizer.getConstant(d):l),this.invokeFormatter(a,h,t));return l=je(a.formatter)?l:je(d)?"":d.toString(),this.evaluate(s,e,t,i,r,n)&&"checkbox"!==a.type?this.appendHtml(s,this.parent.sanitize(l),a.getDomSetter?a.getDomSetter():"innerHTML"):"checkbox"===a.type&&(s.classList.add(qE),h=!!this.parent.selectionSettings.persistSelection&&"true"===h,o=kv(this.parent.createElement,!1,{checked:h,label:" "}),this.parent.cssClass&&U([o],[this.parent.cssClass]),this.rowChkBox.id="checkbox-"+e.rowID,o.insertBefore(this.rowChkBox.cloneNode(),o.firstChild),s.appendChild(o)),"Check"===this.parent.checkAllRows&&this.parent.enableVirtualization&&(e.isSelected=!0),this.setAttributes(s,e,i),"boolean"===a.type&&a.displayAsCheckBox&&(d=isNaN(parseInt(h.toString(),10))?"true"===h:0<parseInt(h.toString(),10),o=kv(this.parent.createElement,!1,{checked:d,label:" "}),s.innerHTML="",s.classList.add("e-gridchkbox-cell"),o.classList.add("e-checkbox-disabled"),this.parent.cssClass&&U([o],[this.parent.cssClass]),s.appendChild(o)),s.classList.contains("e-summarycell")&&!t.key&&(r=s.getAttribute("e-mappinguid"),a=this.parent.getColumnByUid(r),s.setAttribute("aria-label",l+this.localizer.getConstant("ColumnHeader")+e.column.headerText)),!this.parent.isFrozenGrid()||t&&t.key||uF(this.parent,a,s),s},_D.prototype.appendHtml=function(e,t,i){return e[""+(i=void 0===i?"innerHTML":i)]=t,e},_D.prototype.setAttributes=function(e,t,i){var n=t.column;this.buildAttributeFromCell(e,t,"checkbox"===n.type),zP(e,i),zP(e,t.attributes),n.customAttributes&&zP(e,n.customAttributes),"Vertical"===this.parent.rowRenderingMode&&zP(e,{"data-cell":n.headerText}),n.textAlign&&(i={right:"e-rightalign",left:"e-leftalign",center:"e-centeralign",justify:"e-justifyalign"})[n.textAlign.toLowerCase()]&&e.classList.add(i[n.textAlign.toLowerCase()]),"Clip"===n.clipMode||!n.clipMode&&"Clip"===this.parent.clipMode?e.classList.add("e-gridclip"):"EllipsisWithTooltip"!==n.clipMode&&(n.clipMode||"EllipsisWithTooltip"!==this.parent.clipMode||this.parent.allowTextWrap&&("Content"===this.parent.textWrapSettings.wrapMode||"Both"===this.parent.textWrapSettings.wrapMode))||"checkbox"!==n.type&&e.classList.add("e-ellipsistooltip")},_D.prototype.buildAttributeFromCell=function(e,t,i){var n={},o=[];t.colSpan&&(n.colSpan=t.colSpan),t.rowSpan&&(n.rowSpan=t.rowSpan),t.isTemplate&&o.push("e-templatecell"),t.isSelected&&(o.push.apply(o,["e-selectionbackground","e-active"]),i)&&e.querySelector(".e-frame").classList.add("e-check"),t.isColumnSelected&&o.push.apply(o,["e-columnselection"]),t.cellType===LA.Header?n[iD]=t.colIndex+1:je(t.index)||(n[iD]=t.index+1),t.visible||o.push("e-hide"),n.class=o,zP(e,n)},_D.prototype.getValue=function(e,t,i){return i.valueAccessor(e,t,i)};var VD=_D;function _D(e,t){this.localizer=t.getService("localization"),this.formatter=t.getService("valueFormatter"),this.parent=e,this.element=this.parent.createElement("TD",{className:LE,attrs:{role:"gridcell",tabindex:"-1"}}),this.rowChkBox=this.parent.createElement("input",{className:"e-checkselect",attrs:{type:"checkbox","aria-label":this.localizer.getConstant("SelectRow")}})}zD.prototype.setOptions=function(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++)jD(e,WD[i[parseInt(n.toString(),10)]],t[i[parseInt(n.toString(),10)]])},zD.prototype.setExpand=function(e,t){jD(e,WD.expand,t)},zD.prototype.setSort=function(e,t){jD(e,WD.sort,t,"boolean"==typeof t)},zD.prototype.setBusy=function(e,t){jD(e,WD.busy,t),jD(e,WD.invalid,null,!0)},zD.prototype.setGrabbed=function(e,t,i){jD(e,WD.grabbed,t,i)},zD.prototype.setDropTarget=function(e,t){jD(e,WD.dropeffect,"copy",!t)};var HD=zD;function zD(){}function jD(e,t,i,n){n&&e?e.removeAttribute(t):e&&e.setAttribute(t,i)}var WD={expand:"aria-expanded",role:"role",datarole:"data-role",selected:"aria-selected",multiselectable:"aria-multiselectable",sort:"aria-sort",busy:"aria-busy",invalid:"aria-invalid",grabbed:"aria-grabbed",dropeffect:"aria-dropeffect",haspopup:"aria-haspopup",level:"aria-level",colcount:"aria-colcount",rowcount:"aria-rowcount"};QD=function(e,t){return(QD=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}QD(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(GD,UD=VD),GD.prototype.getGui=function(){return this.gui.cloneNode()},GD.prototype.render=function(e,t,i){var n=this.element.cloneNode(),o=this.parent.createElement("div",{className:"e-filtermenudiv e-icons e-icon-filter",attrs:{"aria-hidden":"true"}});return this.prepareHeader(e,n,o)},GD.prototype.refresh=function(e,t){this.clean(t);var i=this.parent.createElement("div",{className:"e-filtermenudiv e-icons e-icon-filter",attrs:{"aria-hidden":"true"}});return this.prepareHeader(e,t,i)},GD.prototype.clean=function(e){e.innerHTML=""},GD.prototype.prepareHeader=function(e,t,i){var n=e.column,o={},r="",s=this.getGui();if(pt(s,{"e-mappinguid":n.uid,class:"e-headercelldiv"}),je(n.headerValueAccessor)||(y=this.getValue(n.headerText,n)),this.parent.rowHeight&&this.parent.allowSorting&&n.allowSorting&&!je(n.field)&&t.classList.add("e-sort-icon"),"checkbox"!==n.type?(v=n.headerText,je(y)||(v=y),(y=this.hTxtEle.cloneNode())[n.getDomSetter()]=this.parent.sanitize(v),s.appendChild(y)):(n.editType="booleanedit",v=kv(this.parent.createElement,!1,{checked:!1,label:" "}),this.chkAllBox.id="checkbox-"+n.uid,v.insertBefore(this.chkAllBox.cloneNode(),v.firstChild),this.parent.cssClass&&U([v],[this.parent.cssClass]),s.appendChild(v),s.classList.add("e-headerchkcelldiv")),this.buildAttributeFromCell(t,e),this.appendHtml(t,s),t.appendChild(this.sortEle.cloneNode()),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&n.allowFiltering&&!je(n.field)&&(!this.parent.showColumnMenu||!n.showColumnMenu)){pt(i,{"e-mappinguid":"e-flmenu-"+n.uid}),r=r.length?r+". "+this.localizer.getConstant("FilterDescription"):this.localizer.getConstant("FilterDescription"),t.classList.add("e-fltr-icon");var a=[];if(this.parent.filterSettings.columns.length&&this.parent.filterSettings.columns.length!==a.length)for(var l=this.parent.getForeignKeyColumns(),h=0;h<this.parent.columns.length;h++)for(var d=0;d<this.parent.filterSettings.columns.length;d++)if(this.parent.filterSettings.columns[parseInt(d.toString(),10)].field===n.field||l.length&&n.foreignKeyValue===this.parent.filterSettings.columns[parseInt(d.toString(),10)].field){i.classList.add("e-filtered"),a.push(n.field);break}t.appendChild(i.cloneNode())}e.className&&t.classList.add(e.className),n.customAttributes&&zP(t,n.customAttributes),this.parent.allowSorting&&n.allowSorting&&(o.sort="none",r=r.length?r+". "+this.localizer.getConstant("SortDescription"):this.localizer.getConstant("SortDescription")),(this.parent.allowGrouping&&n.allowGrouping||this.parent.allowReordering&&n.allowReordering)&&(o.grabbed=!1,r=r.length?r+". "+this.localizer.getConstant("GroupDescription"):this.localizer.getConstant("GroupDescription")),this.parent.showColumnMenu&&"checkbox"!==n.type&&!n.template&&(r=r.length?r+". "+this.localizer.getConstant("ColumnMenuDescription"):this.localizer.getConstant("ColumnMenuDescription")),t=this.extendPrepareHeader(n,t);var p,c,u,g,m,f,y=this.parent,v=y.getColumnIndexByField(n.field),v=(je(n.headerTemplate)||(s=y.element.id+n.uid+"headerTemplate",p="isStringTemplate",c=n,m=this.parent.isReact&&"string"!=typeof n.headerTemplate&&!(n.headerTemplate.prototype&&n.headerTemplate.prototype.CSPTemplate),u=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,g=this.parent.printGridParent&&this.parent.printGridParent.isReact,m||u||g?(m={index:v},t.firstElementChild.innerHTML="",n.getHeaderTemplate()(Pe(m,c),y,"headerTemplate",s,this.parent[p],null,t.firstElementChild),this.parent.renderTemplates()):(u=n.getHeaderTemplate()(Pe({index:v},c),y,"headerTemplate",s,this.parent[p],void 0,void 0,this.parent.root),t.firstElementChild.innerHTML="",eB(t.firstElementChild,u))),this.ariaService.setOptions(t,o),je(n.headerTextAlign)&&je(n.textAlign)||("right"===(g=n.headerTextAlign||n.textAlign).toLowerCase()||"left"===g.toLowerCase()?t.classList.add("right"===g.toLowerCase()?"e-rightalign":"e-leftalign"):"center"===g.toLowerCase()?t.classList.add("e-centeralign"):"justify"===g.toLowerCase()&&t.classList.add("e-justifyalign")),"Clip"===n.clipMode||!n.clipMode&&"Clip"===this.parent.clipMode?t.classList.add("e-gridclip"):"EllipsisWithTooltip"!==n.clipMode&&(n.clipMode||"EllipsisWithTooltip"!==this.parent.clipMode)||y.allowTextWrap&&("Header"===y.textWrapSettings.wrapMode||"Both"===y.textWrapSettings.wrapMode)||"checkbox"!==n.type&&t.classList.add("e-ellipsistooltip"),r&&((m=this.parent.createElement("span",{id:"headerTitle-"+n.uid,innerHTML:r})).style.display="none",t.appendChild(m),t.setAttribute("aria-describedby",m.id)),t.setAttribute("aria-rowspan",(je(e.rowSpan)?1:e.rowSpan).toString()),t.setAttribute("aria-colspan","1"),this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact);return(this.parent.isReact&&this.parent.requireTemplateRef||v&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&!je(n.headerTemplate)?(f=this).parent.renderTemplates(function(){f.parent.trigger(jA,{cell:e,node:t})}):this.parent.trigger(jA,{cell:e,node:t}),this.parent.isFrozenGrid()&&uF(this.parent,n,t),t},GD.prototype.getValue=function(e,t){return t.headerValueAccessor(e,t)},GD.prototype.extendPrepareHeader=function(e,t){if(this.parent.showColumnMenu&&e.showColumnMenu&&!je(e.field)){var i=this.parent.createElement("div",{className:"e-icons e-columnmenu",attrs:{"aria-hidden":"true"}}),n=[];if(this.parent.filterSettings.columns.length&&this.parent.filterSettings.columns.length!==n.length)for(var o=0;o<this.parent.columns.length;o++)for(var r=0;r<this.parent.filterSettings.columns.length;r++)if(this.parent.filterSettings.columns[parseInt(r.toString(),10)].field===e.field){i.classList.add("e-filtered"),n.push(e.field);break}t.classList.add("e-fltr-icon"),t.appendChild(i)}var s;return this.parent.allowResizing&&((s=this.parent.createElement("div")).className=e.allowResizing?"e-rhandler e-rcursor":"e-rsuppress",t.appendChild(s)),t},GD.prototype.appendHtml=function(e,t){return e.appendChild(t),e};var QD,UD,qD=GD;function GD(){var e=null!==UD&&UD.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-headercell",attrs:{tabindex:"-1",role:"columnheader"}}),e.ariaService=new HD,e.hTxtEle=e.parent.createElement("span",{className:"e-headertext"}),e.sortEle=e.parent.createElement("div",{className:"e-sortfilterdiv e-icons",attrs:{"aria-hidden":"true"}}),e.gui=e.parent.createElement("div"),e.chkAllBox=e.parent.createElement("input",{className:"e-checkselectall",attrs:{type:"checkbox","aria-label":e.localizer.getConstant("SelectAllCheckbox")}}),e}YD=function(e,t){return(YD=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}YD(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(JD,XD=VD),JD.prototype.render=function(e,t,i){var n=this.element.cloneNode(),o=this.parent.createElement("div",{className:"e-stackedheadercelldiv",attrs:{"e-mappinguid":e.column.uid}}),r=e.column;if(n.appendChild(o),je(r.headerTemplate)?this.appendHtml(o,this.parent.sanitize(r.headerText),r.getDomSetter()):eB(o,r.getHeaderTemplate()(r,this.parent,"headerTemplate",null,null,null,null,this.parent.root)),e.column.toolTip&&n.setAttribute("title",e.column.toolTip),"Clip"===r.clipMode||!r.clipMode&&"Clip"===this.parent.clipMode?n.classList.add("e-gridclip"):"EllipsisWithTooltip"!==r.clipMode&&(r.clipMode||"EllipsisWithTooltip"!==this.parent.clipMode)||n.classList.add("e-ellipsistooltip"),je(e.column.textAlign)||(o={right:"e-rightalign",left:"e-leftalign",center:"e-centeralign",justify:"e-justifyalign"})[e.column.textAlign.toLowerCase()]&&n.classList.add(o[e.column.textAlign.toLowerCase()]),e.column.customAttributes&&zP(n,e.column.customAttributes),n.setAttribute("colspan",e.colSpan.toString()),n.setAttribute("aria-colspan",e.colSpan.toString()),n.setAttribute("aria-rowspan","1"),this.parent.allowResizing&&((o=this.parent.createElement("div")).className=e.column.allowResizing?"e-rhandler e-rcursor":"e-rsuppress",n.appendChild(o)),e.className&&n.classList.add(e.className),this.parent.trigger(jA,{cell:e,node:n}),"Left"===lF(r))if(n.classList.add("e-leftfreeze"),"Left"===r.border&&n.classList.add("e-freezeleftborder"),0===r.index)dF(n,30*this.parent.getIndentCount(),this.parent.enableRtl,"Left");else{for(var s=this.parent.getColumns(),a=30*this.parent.getIndentCount(),l=0;l<s.length&&!(r.index<s[parseInt(l.toString(),10)].index);l++)s[parseInt(l.toString(),10)].visible&&(a+=parseFloat(s[parseInt(l.toString(),10)].width.toString()));dF(n,a,this.parent.enableRtl,"Left")}else if("Right"===lF(r)){n.classList.add("e-rightfreeze");for(s=this.parent.getColumns(),a="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0,l=s.length-1;0<=l&&!(sF(r,s[parseInt(l.toString(),10)].uid)||r.index>s[parseInt(l.toString(),10)].index);l--)s[parseInt(l.toString(),10)].visible&&(a+=parseFloat(s[parseInt(l.toString(),10)].width.toString()));dF(n,a,this.parent.enableRtl,"Right"),"Right"===r.border&&n.classList.add("e-freezerightborder")}else if("Fixed"===lF(r)){n.classList.add("e-fixedfreeze");s=this.parent.getColumns(),a=0;this.parent.getVisibleFrozenLeftCount()?a=30*this.parent.getIndentCount():"Right"===this.parent.getFrozenMode()&&(a=30*this.parent.groupSettings.columns.length);for(l=0;l<s.length;l++)r.index>s[parseInt(l.toString(),10)].index&&("Left"===s[parseInt(l.toString(),10)].freeze||s[parseInt(l.toString(),10)].isFrozen||"Fixed"===s[parseInt(l.toString(),10)].freeze)&&s[parseInt(l.toString(),10)].visible&&(a+=parseFloat(s[parseInt(l.toString(),10)].width.toString()));dF(n,a-1,this.parent.enableRtl,"Left"),a="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0;for(l=s.length-1;0<=l;l--)if(r.index<s[parseInt(l.toString(),10)].index){if(sF(r,s[parseInt(l.toString(),10)].uid)||r.index>s[parseInt(l.toString(),10)].index)break;"Right"!==s[parseInt(l.toString(),10)].freeze&&"Fixed"!==s[parseInt(l.toString(),10)].freeze||s[parseInt(l.toString(),10)].visible&&(a+=parseFloat(s[parseInt(l.toString(),10)].width.toString()))}dF(n,a-1,this.parent.enableRtl,"Right")}else n.classList.add("e-unfreeze");return n};var YD,XD,KD=JD;function JD(){var e=null!==XD&&XD.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-headercell e-stackedheadercell",attrs:{tabindex:"-1",role:"columnheader"}}),e}ZD=function(e,t){return(ZD=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}ZD(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(tM,$D=VD),tM.prototype.render=function(e,t){var i=this.element.cloneNode();return zP(i,e.attributes),i};var ZD,$D,eM=tM;function tM(){var e=null!==$D&&$D.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-indentcell"}),e}iM=function(e,t){return(iM=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])}))(e,t)};var iM,nM,h0=function(e,t){function i(){this.constructor=e}iM(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},oM=(h0(rM,nM=VD),rM.prototype.render=function(e,n){this.element.id=this.parent.element.id+"captioncell"+this.cellUid++;for(var t,o,i,r,s=this.element.cloneNode(),a=this.parent,l=e.column,l=l.getDomSetter?l.getDomSetter():"innerHTML",h=(n.headerText=e.column.headerText,e.isForeignKey&&(h=this.format(e.column,e.column.valueAccessor("foreignKey",n,e.column))),e.isForeignKey?h:e.column.enableGroupByFormat?n.key:this.format(e.column,e.column.valueAccessor("key",n,e.column))),d=0;d<a.aggregates.length;d++)for(var p=this,c=0;c<a.aggregates[parseInt(d.toString(),10)].columns.length;c++)if("break"===function(e){var t,i;if(a.getVisibleColumns()[0].field===a.aggregates[parseInt(d.toString(),10)].columns[parseInt(e.toString(),10)].field&&a.aggregates[parseInt(d.toString(),10)].columns[parseInt(e.toString(),10)].groupCaptionTemplate)return"string"==typeof(t=a.aggregates[parseInt(d.toString(),10)].columns[parseInt(e.toString(),10)].groupCaptionTemplate)&&t.includes("$")?o=a.aggregates[parseInt(d.toString(),10)].columns[parseInt(e.toString(),10)].groupCaptionTemplate.split("$")[0]+n[a.getVisibleColumns()[0].field][a.aggregates[parseInt(d.toString(),10)].columns[parseInt(e.toString(),10)].type]+a.aggregates[parseInt(d.toString(),10)].columns[parseInt(e.toString(),10)].groupCaptionTemplate.split("}")[1]:je(e=(t=a.aggregates[parseInt(d.toString(),10)].columns[parseInt(e.toString(),10)]).getTemplate(LA.CaptionSummary))||(i=e.fn(n[t.columnName],p.parent,e.property,""),e=p.parent.printGridParent&&p.parent.printGridParent.isReact,(p.parent.isReact||e)&&"string"!=typeof t.groupCaptionTemplate?p.parent.renderTemplates(function(){i&&i.length&&(je(a.groupSettings.captionTemplate)?s.innerText+=" "+i[0].textContent:s.appendChild(i[0]))}):i&&i.length&&(o=je(a.groupSettings.captionTemplate)?i[0].textContent:i)),"break"}(c))break;return je(a.groupSettings.captionTemplate)?a.groupSettings.enableLazyLoading?s[""+l]=this.parent.sanitize(e.column.headerText)+": "+this.parent.sanitize(h)+(o?"   "+o:""):s[""+l]=this.parent.sanitize(e.column.headerText)+": "+this.parent.sanitize(h)+" - "+n.count+" "+(n.count<2?this.localizer.getConstant("Item"):this.localizer.getConstant("Items"))+(o?"   "+o:""):(l=this.parent.isReact&&"string"!=typeof a.groupSettings.captionTemplate&&!(a.groupSettings.captionTemplate.prototype&&a.groupSettings.captionTemplate.prototype.CSPTemplate),h=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,i=this.parent.printGridParent&&this.parent.printGridParent.isReact,l||h||i?(r=a.element.id+"captionTemplate",n.groupKey=n.key,HP(a.groupSettings.captionTemplate)(n,this.parent,"captionTemplate",r,null,null,s),this.parent.renderTemplates()):t=this.parent.isVue||a.parentDetails&&a.parentDetails.parentInstObj&&a.parentDetails.parentInstObj.isVue?HP(a.groupSettings.captionTemplate)(n,this.parent,"captionTemplate",null,null,null,null,a.root):HP(a.groupSettings.captionTemplate)(n),l||h||i||(eB(s,t),o&&o.length&&o[0].textContent&&s.appendChild(o[0]))),s.setAttribute("colspan",e.colSpan.toString()),s.setAttribute("aria-label",s.innerHTML+this.localizer.getConstant("GroupCaption")),s.setAttribute("title",s.textContent),s},rM);function rM(){var e=null!==nM&&nM.apply(this,arguments)||this;return e.cellUid=0,e.element=e.parent.createElement("TD",{className:"e-groupcaption",attrs:{id:e.parent.element.id+"captioncell",tabindex:"-1"}}),e}h0(lM,sM=VD),lM.prototype.render=function(e,t){var i=this.element.cloneNode();return i.innerHTML="&nbsp;",i.setAttribute("colspan",e.colSpan.toString()),i};var sM,aM=lM;function lM(){var e=null!==sM&&sM.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-groupcaption"}),e}hM=function(e,t){return(hM=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}hM(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(cM,dM=eM),cM.prototype.render=function(e,t,i,n){var o=this.element.cloneNode();return o.setAttribute("ej-mappingname",t.field),o.setAttribute("ej-mappingvalue",t.key),o.setAttribute("aria-expanded",n?"true":"false"),o.setAttribute("tabindex","-1"),this.parent.infiniteScrollSettings&&this.parent.infiniteScrollSettings.enableCache&&!this.parent.groupSettings.enableLazyLoading?(e.cellType=LA.Indent,o.className=n?"e-recordplusexpand e-disablepointer":"e-recordpluscollapse e-disablepointer"):(o.className=n?"e-recordplusexpand":"e-recordpluscollapse",o.appendChild(this.parent.createElement("a",{className:n?"e-icons e-gdiagonaldown e-icon-gdownarrow":"e-icons e-gnextforward e-icon-grightarrow",attrs:{href:"#",title:n?this.localizer.getConstant("Expanded"):this.localizer.getConstant("Collapsed")}}))),o};var hM,dM,pM=cM;function cM(){return null!==dM&&dM.apply(this,arguments)||this}uM=function(e,t){return(uM=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}uM(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(fM,gM=VD),fM.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-headercelldiv e-emptycell",innerHTML:""})),i};var uM,gM,mM=fM;function fM(){var e=null!==gM&&gM.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-grouptopleftcell"}),e}yM=function(e,t){return(yM=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}yM(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(wM,vM=VD),wM.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-emptycell"})),i};var yM,vM,bM=wM;function wM(){var e=null!==vM&&vM.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-detailheadercell"}),e}CM=function(e,t){return(CM=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}CM(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(xM,SM=VD),xM.prototype.render=function(e,t,i){var n=this.element.cloneNode();return i&&!je(i.class)?(n.className="",n.className=i.class,n.appendChild(this.parent.createElement("a",{className:"e-icons e-dtdiagonaldown e-icon-gdownarrow",attrs:{href:"#",title:this.localizer.getConstant("Expanded")}}))):n.appendChild(this.parent.createElement("a",{className:"e-icons e-dtdiagonalright e-icon-grightarrow",attrs:{href:"#",title:this.localizer.getConstant("Collapsed")}})),e.isSelected&&n.classList.add("e-selectionbackground","e-active"),n};var CM,SM,AM=xM;function xM(){var e=null!==SM&&SM.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-detailrowcollapse",attrs:{"aria-expanded":"false",tabindex:"-1"}}),e}IM=function(e,t){return(IM=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}IM(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(DM,TM=VD),DM.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-icons e-rowcelldrag e-dtdiagonalright e-icon-rowdragicon",attrs:{"aria-hidden":"true"}})),e.isSelected&&(i.classList.add("e-selectionbackground"),i.classList.add("e-active")),(this.parent.getVisibleFrozenRightCount()||this.parent.getVisibleFrozenLeftCount())&&(i.classList.add("e-leftfreeze"),dF(i,"Right"===this.parent.getFrozenMode()?0:30*this.parent.groupSettings.columns.length,this.parent.enableRtl,"Right"===this.parent.getFrozenMode()?"Right":"Left")),i};var IM,TM,EM=DM;function DM(){var e=null!==TM&&TM.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-rowdragdrop e-rowdragdropcell",attrs:{tabindex:"-1",role:"gridcell"}}),e}MM=function(e,t){return(MM=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}MM(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(BM,kM=VD),BM.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(Q("div",{className:"e-emptycell"})),(this.parent.getVisibleFrozenRightCount()||this.parent.getVisibleFrozenLeftCount())&&(i.classList.add("e-leftfreeze"),dF(i,"Right"===this.parent.getFrozenMode()?0:30*this.parent.groupSettings.columns.length,this.parent.enableRtl,"Right"===this.parent.getFrozenMode()?"Right":"Left")),i};var MM,kM,PM=BM;function BM(){var e=null!==kM&&kM.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-rowdragheader"}),e}LM.prototype.render=function(){var e=this.parent;this.headerRenderer=this.renderer.getRenderer(RA.Header),this.contentRenderer=this.renderer.getRenderer(RA.Content),this.headerRenderer.renderPanel(),this.contentRenderer.renderPanel(),e.getColumns().length&&(this.isLayoutRendered=!0,this.headerRenderer.renderTable(),this.contentRenderer.renderTable(),this.emptyRow(!1)),this.parent.scrollModule.setWidth(),this.parent.scrollModule.setHeight(),"auto"!==this.parent.height&&this.parent.scrollModule.setPadding(),this.refreshDataManager()},LM.prototype.refresh=function(e){var n=this,o=this.parent;o.notify((e=void 0===e?{requestType:"refresh"}:e).requestType+"-begin",e),o.trigger(WA,e,function(e){var t,i;(e=void 0===e?{requestType:"refresh"}:e).cancel?(o.notify(AI,e),"clearFilter"===e.action&&"Menu"===n.parent.filterSettings.type&&(n.parent.filterSettings.columns[n.parent.filterModule.filterObjIndex]=n.parent.filterModule.prevFilterObject,t=n.parent.showColumnMenu&&n.parent.filterModule.column.showColumnMenu?".e-columnmenu":".e-icon-filter",t=n.parent.element.querySelector('[e-mappinguid="'+n.parent.filterModule.column.uid+'"]').parentElement.querySelector(t),je(n.parent.filterModule.prevFilterObject)||t.classList.add("e-filtered")),"clear-filter"!==e.action||"CheckBox"!==n.parent.filterSettings.type&&"Excel"!==n.parent.filterSettings.type||(n.parent.filterSettings.columns=n.parent.filterModule.checkboxPrevFilterObject),"grouping"===e.requestType&&-1!==(t=o.groupSettings.columns.indexOf(e.columnName))&&(o.setProperties({groupSettings:{Columns:o.groupSettings.columns.splice(t,1)}},!0),o.setProperties({sortSettings:{Columns:o.sortSettings.columns.splice(t,1)}},!0),t=o.getColumnByField(e.columnName),i=o.getColumnHeaderByField(t.field),t.visible=!je(i)&&!i.classList.contains("e-hide"))):(n.parent.notify(AE,e),"virtualscroll"===e.requestType&&(n.parent.getDataModule().isRemote()||"result"in n.parent.dataSource)&&e.virtualInfo&&"down"===e.virtualInfo.direction&&(n.parent.contentModule.prevInfo=e.virtualInfo),n.parent.groupModule&&e.preventFocusOnGroup&&(n.parent.groupModule.preventFocusOnGroup=e.preventFocusOnGroup),o.allowSelection&&("clearFilter"===e.action||"clear-filter"===e.action||"searching"===e.requestType&&""===e.searchString||"add"===e.action)&&(o.selectionModule.rmtHdrChkbxClicked=!1),o.allowPaging&&o.pageSettings.pageSizes&&o.pagerModule.pagerObj.isAllPage&&"add"===e.action&&"save"===e.requestType&&o.pagerModule.pagerObj.checkAll&&o.setProperties({pageSettings:{pageSize:o.pageSettings.pageSize+1}},!0),"delete"===e.requestType&&o.allowPaging&&(t=e.data.length,i=o.pageSettings.totalRecordsCount-t,!(o.getCurrentViewRecords().length-t)&&i&&(o.pageSettings.currentPage-1)*o.pageSettings.pageSize==i||i&&i<=t)&&(o.prevPageMoving=!0,o.setProperties({pageSettings:{totalRecordsCount:i,currentPage:Math.ceil(i/o.pageSettings.pageSize)}},!0),o.pagerModule.pagerObj.totalRecordsCount=i),"reorder"===e.requestType&&n.parent.dataSource&&"result"in n.parent.dataSource||("paging"===e.requestType||"columnstate"===e.requestType||"reorder"===e.requestType)&&n.parent.groupSettings.enableLazyLoading&&n.parent.groupSettings.columns.length&&(n.parent.enableVirtualization?n.parent.lazyLoadRender:n.parent.contentModule).getGroupCache()[n.parent.pageSettings.currentPage]?n.contentRenderer.refreshContentRows(e):n.refreshDataManager(e))})},LM.prototype.resetTemplates=function(){var e,t=this.parent,i=t.getColumns();t.detailTemplate&&(e=t.element.id+"detailTemplate",io[e]=[],so(e)),t.groupSettings.captionTemplate&&so(t.element.id+"captionTemplate"),t.rowTemplate&&so(t.element.id+"rowTemplate"),t.toolbarTemplate&&so(t.element.id+"toolbarTemplate"),t.pageSettings.template&&so(t.element.id+"_template");for(var n=0;n<i.length;n++)i[parseInt(n.toString(),10)].template&&(io[t.element.id+i[parseInt(n.toString(),10)].uid]=[],so(t.element.id+i[parseInt(n.toString(),10)].uid)),i[parseInt(n.toString(),10)].headerTemplate&&so(t.element.id+i[parseInt(n.toString(),10)].uid+"headerTemplate"),i[parseInt(n.toString(),10)].filterTemplate&&so(t.element.id+i[parseInt(n.toString(),10)].uid+"filterTemplate");for(var o=0;o<t.aggregates.length;o++)for(var r=0;r<t.aggregates[parseInt(o.toString(),10)].columns.length;r++)t.aggregates[parseInt(o.toString(),10)].columns[parseInt(r.toString(),10)].footerTemplate&&so(t.element.id+t.aggregates[parseInt(o.toString(),10)].columns[parseInt(r.toString(),10)].guid+"footerTemplate"),t.aggregates[parseInt(o.toString(),10)].columns[parseInt(r.toString(),10)].groupFooterTemplate&&so(t.element.id+t.aggregates[parseInt(o.toString(),10)].columns[parseInt(r.toString(),10)].guid+"groupFooterTemplate"),t.aggregates[parseInt(o.toString(),10)].columns[parseInt(r.toString(),10)].groupCaptionTemplate&&so(t.element.id+t.aggregates[parseInt(o.toString(),10)].columns[parseInt(r.toString(),10)].guid+"groupCaptionTemplate")},LM.prototype.refreshComplete=function(e){this.parent.trigger(QA,e)},LM.prototype.refreshDataManager=function(n){var t,i,o=this,e=(void 0===n&&(n={}),this.parent),r="Shimmer"===e.loadingIndicator.indicatorType&&"virtualscroll"!==n.requestType&&"infiniteScroll"!==n.requestType||("virtualscroll"===n.requestType||"infiniteScroll"===n.requestType)&&e.enableVirtualMaskRow,r=("virtualscroll"===n.requestType||n.isCaptionCollapse||r||this.parent.showSpinner(),r&&e.showMaskRow("virtualscroll"===n.requestType?n.virtualInfo.sentinelInfo.axis:"infiniteScroll"===n.requestType?n.direction:void 0),this.parent.notify(rT,n),this.emptyGrid=!1,this.isNeedForeignAction()),s=(this.ariaService.setBusy(this.parent.getContent().querySelector("."+WE),!0),r&&(s=new ll,t=this.getFData(s,n)),t=t?t.then(function(e){var t,i=o.data.generateQuery().requiresCount();return o.emptyGrid?((t=new ll).resolve({result:[],count:0}),t.promise):o.data.getData(n,i)}):(e.allowPaging&&!e.getDataModule().dataManager.dataSource.offline&&e.pageSettings&&e.pageSettings.pageSizes&&e.pagerModule&&e.pagerModule.pagerObj&&e.pagerModule.pagerObj.isAllPage&&(e.pagerModule.pagerObj.isAllPage=void 0),this.data.getData(n,this.data.generateQuery().requiresCount())),this.parent.getForeignKeyColumns()),e=s.length;!(e="ExcludeHidden"===this.parent.columnQueryMode?e&&s.filter(function(e){return!1!==e.visible}).length:e)||r&&!this.parent.searchSettings.key.length||(i=new ll,t=t.then(function(e){return o.parent.notify(cI,{dataManager:t,result:e,promise:i,action:n}),i.promise})),(t=this.parent.groupSettings.disablePageWiseAggregates&&this.parent.groupSettings.columns.length?t.then(function(e){return o.validateGroupRecords(e)}):t).then(function(e){return o.dataManagerSuccess(e,n)}).catch(function(e){return o.dataManagerFailure(e,n)})},LM.prototype.getFData=function(e,t){return this.parent.notify(cI,{isComplex:!0,promise:e,action:t}),e.promise},LM.prototype.isNeedForeignAction=function(){var e=this.parent;return!!(e.allowFiltering&&e.filterSettings.columns.length||!je(e.searchSettings.key)&&e.searchSettings.key.length)&&this.foreignKey(this.parent.getForeignKeyColumns())},LM.prototype.foreignKey=function(e){var i=this;return e.some(function(t){return!(!i.parent.filterSettings.columns.some(function(e){return t.uid===e.uid})&&!i.parent.searchSettings.key.length)})},LM.prototype.sendBulkRequest=function(t){var i=this,e=(t.requestType="batchsave",this.parent),n=(e.allowPaging&&e.pageSettings.pageSizes&&e.pagerModule.pagerObj.isAllPage&&e.pagerModule.pagerObj.checkAll&&(n=t.changes.addedRecords.length)&&e.setProperties({pageSettings:{pageSize:e.pageSettings.pageSize+n}},!0),e.allowPaging&&(t.changes.addedRecords.length||t.changes.deletedRecords.length||t.changes.changedRecords.length)&&e.pageSettings&&e.pageSettings.pageSizes&&e.pagerModule&&e.pagerModule.pagerObj&&!e.getDataModule().dataManager.dataSource.offline&&e.pagerModule.pagerObj.isAllPage&&(e.pagerModule.pagerObj.isAllPage=void 0),this.data.saveChanges(t.changes,this.parent.getPrimaryKeyFieldNames()[0],t.original)),o=this.data.generateQuery().requiresCount();this.data.dataManager.dataSource.offline?this.refreshDataManager({requestType:"batchsave"}):n.then(function(e){i.data.getData(t,o).then(function(e){return i.dmSuccess(e,t)}).catch(function(e){return i.dmFailure(e,t)})}).catch(function(e){return i.dmFailure(e,t)})},LM.prototype.dmSuccess=function(e,t){this.dataManagerSuccess(e,t)},LM.prototype.dmFailure=function(e,t){this.dataManagerFailure(e,t)},LM.prototype.renderEmptyRow=function(){this.emptyRow(!0)},LM.prototype.emptyRow=function(e){var t,i,n=this.parent,o=this.contentRenderer.getTable().querySelector(oD),r=(je(o)||ue(o),o=this.parent.createElement(oD,{attrs:{role:"rowgroup"}}),n.allowRowDragAndDrop&&je(n.rowDropSettings.targetID)?1:0),s=((n.detailTemplate||n.childGrid)&&++r,n.editSettings.showAddNewRow&&"Bottom"===n.editSettings.newRowPosition?"e-emptyrow e-show-added-row":"e-emptyrow"),s=this.parent.createElement("tr",{className:s,attrs:{role:"row"}});n.emptyRecordTemplate?(t=n.element.id+"emptyRecordTemplate",i=this.parent.createElement("td",{attrs:{colspan:(n.getVisibleColumns().length+r+n.groupSettings.columns.length).toString()}}),n.isVue||n.parentDetails&&n.parentDetails.parentInstObj&&n.parentDetails.parentInstObj.isVue?i.appendChild(n.getEmptyRecordTemplate()(n.dataSource,n,"emptyRecordTemplate",t,void 0,void 0,void 0,this.parent.root)[1]):i.appendChild(n.getEmptyRecordTemplate()(n.dataSource,n,"emptyRecordTemplate",t,void 0,void 0,void 0,this.parent.root)[0]),n.isReact&&this.parent.renderTemplates()):i=this.parent.createElement("td",{innerHTML:this.l10n.getConstant("EmptyRecord"),attrs:{colspan:(n.getVisibleColumns().length+r+(je(n.groupSettings.columns)?0:n.groupSettings.columns.length)).toString()}}),n.isFrozenGrid()&&(i.classList.add("e-leftfreeze"),i.style.left="0px"),n.frozenRows&&n.element.querySelector(".e-frozenrow-border")&&this.parent.element.querySelector(".e-frozenrow-border").classList.add("e-frozenrow-empty"),s.appendChild(i),o.appendChild(s),this.contentRenderer.renderEmpty(o),e&&(this.parent.isInitialLoad||this.parent.focusModule.setFirstFocusableTabIndex(),this.parent.trigger(qA,{}),this.parent.notify(J1,{rows:[new DE({isDataRow:!0,cells:[new kE({isDataCell:!0,visible:!0})]})]}),n.editSettings.showAddNewRow)&&(n.addRecord(),this.parent.notify(wE,{}))},LM.prototype.dynamicColumnChange=function(){this.parent.getCurrentViewRecords().length&&this.updateColumnType(this.parent.getCurrentViewRecords()[0])},LM.prototype.updateColumnType=function(e){for(var t=this.parent.getColumns(),i="customFormat",n="equalTo",o=e&&e.items?e.items[0]:e,r=this.locator.getService("valueFormatter"),s=0,a=t.length;s<a;s++){l=FB(t[parseInt(s.toString(),10)].field||"",o),je(t[parseInt(s.toString(),10)][i])||(t[parseInt(s.toString(),10)].format=t[parseInt(s.toString(),10)][i]),je(t[parseInt(s.toString(),10)].validationRules)||je(t[parseInt(s.toString(),10)].validationRules[n])||(t[parseInt(s.toString(),10)].validationRules[n][0]=this.parent.element.id+t[parseInt(s.toString(),10)].validationRules[n][0]),je(l=t[parseInt(s.toString(),10)].isForeignColumn()&&t[parseInt(s.toString(),10)].columnData?FB(t[parseInt(s.toString(),10)].foreignKeyValue||"",t[parseInt(s.toString(),10)].columnData[0]):l)?t[parseInt(s.toString(),10)].type=t[parseInt(s.toString(),10)].type||null:(this.isColTypeDef=!0,t[parseInt(s.toString(),10)].type||(t[parseInt(s.toString(),10)].type=l.getDay?0<l.getHours()||0<l.getMinutes()||0<l.getSeconds()||0<l.getMilliseconds()?"datetime":"date":typeof l));var l=new v0;t[parseInt(s.toString(),10)].format&&(t[parseInt(s.toString(),10)].format.skeleton||t[parseInt(s.toString(),10)].format.format&&"string"==typeof t[parseInt(s.toString(),10)].format.format)&&(t[parseInt(s.toString(),10)].setFormatter(l.getFormatFunction(Pe({},t[parseInt(s.toString(),10)].format))),t[parseInt(s.toString(),10)].setParser(l.getParserFunction(t[parseInt(s.toString(),10)].format))),"string"==typeof t[parseInt(s.toString(),10)].format?yB(this.locator,t[parseInt(s.toString(),10)]):t[parseInt(s.toString(),10)].format||"number"!==t[parseInt(s.toString(),10)].type||t[parseInt(s.toString(),10)].setParser(r.getParserFunction({format:"n2"})),"dateonly"!==t[parseInt(s.toString(),10)].type||t[parseInt(s.toString(),10)].format||(t[parseInt(s.toString(),10)].format="yMd",yB(this.locator,t[parseInt(s.toString(),10)]))}},LM.prototype.dataManagerSuccess=function(i,n){var o=this,r=this.parent,e=(this.contentRenderer=this.renderer.getRenderer(RA.Content),this.headerRenderer=this.renderer.getRenderer(RA.Header),i.actionArgs=n,!(!r.childGrid&&!r.detailTemplate)),s=this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&!r.groupSettings.enableLazyLoading&&("delete"===n.requestType&&!e||"save"===n.requestType&&"add"===this.parent.infiniteScrollModule.requestType&&!(r.sortSettings.columns.length||r.filterSettings.columns.length||this.parent.groupSettings.columns.length||r.searchSettings.key||e));r.trigger(D1,i,function(e){if(!e.cancel){e.result=je(e.result)?[]:e.result;var t=Object.keys(e.result).length;if(!o.parent.isDestroyed)if(r.getColumns().length||t||r.columns.length&&r.columns[0]instanceof C0)if(o.isInfiniteEnd(n)&&!t)o.parent.notify(cT,{e:n,result:i.result,count:i.count,agg:i.aggregates});else if(o.parent.isEdit=!1,o.parent.notify(tT,{}),o.parent.notify(Nx,{}),n&&("infiniteScroll"!==n.requestType&&"delete"!==n.requestType&&"add"!==n.action||!r.enableInfiniteScrolling)&&o.parent.notify(cE,{type:"refreshCommandColumn"}),o.contentRenderer.prevCurrentView=!je(o.parent.currentViewData)&&o.parent.currentViewData.slice(),r.currentViewData=e.result,r.notify(RT,{args:n,data:e.result}),e.count&&!r.allowPaging&&(r.enableVirtualization||r.enableInfiniteScrolling)&&(r.totalDataRecordsCount=e.count),!t&&e.count&&r.allowPaging&&n&&"delete"!==n.requestType)!o.parent.groupSettings.enableLazyLoading||"grouping"!==n.requestType&&"ungrouping"!==n.requestType||o.parent.notify(lx,n),r.prevPageMoving=!0,r.pageSettings.totalRecordsCount=e.count,"paging"!==n.requestType&&(r.pageSettings.currentPage=Math.ceil(e.count/r.pageSettings.pageSize)),r.dataBind();else{if((r.getColumns().length||!t)&&o.isLayoutRendered||BB(r)||(r.removeMaskRow(),o.updatesOnInitialRender(e)),!o.isColTypeDef&&r.getCurrentViewRecords()&&(o.data.dataManager.dataSource.offline&&r.dataSource&&r.dataSource.length?o.updateColumnType(r.dataSource[0]):o.updateColumnType(r.getCurrentViewRecords()[0])),o.parent.isInitialLoad||!o.parent.groupSettings.disablePageWiseAggregates||o.parent.groupSettings.columns.length||(e.result=o.parent.dataSource instanceof Array?o.parent.dataSource:o.parent.currentViewData),!o.parent.isReact&&!o.parent.isVue||je(n)||"infiniteScroll"===n.requestType||n.isFrozen||EF(o.parent,["footerTemplate"]),o.parent.isAngular&&o.parent.allowGrouping&&o.parent.groupSettings.captionTemplate&&(je(n)||"infiniteScroll"!==n.requestType)&&o.parent.destroyTemplate(["groupSettings_captionTemplate"]),o.parent.notify(Y1,Pe({count:e.count,result:e.result,aggregates:e.aggregates,loadSummaryOnEmpty:!1},n)),(r.groupSettings.columns.length||n&&"ungrouping"===n.requestType)&&n&&"filtering"!==n.requestType&&o.headerRenderer.refreshUI(),t)BB(r)&&(n.scrollTop={top:o.contentRenderer.content.scrollTop}),s?o.parent.notify(cT,{e:n,result:i.result,count:i.count,agg:i.aggregates}):o.parent.enableImmutableMode?o.contentRenderer.immutableModeRendering(n):o.contentRenderer.refreshContentRows(n);else{if(n&&n.isCaptionCollapse)return;if(!r.getColumns().length)return r.element.innerHTML="",void alert(o.l10n.getConstant("EmptyDataSourceError"));o.contentRenderer.setRowElements([]),o.contentRenderer.setRowObjects([]),o.ariaService.setBusy(o.parent.getContent().querySelector("."+WE),!1),r.removeMaskRow(),o.renderEmptyRow(),r.enableColumnVirtualization&&!t&&o.parent.notify(X1,{rows:r.getRowsObject(),args:{}}),n&&(e=(n.requestType||"").toLowerCase()+"-complete",o.parent.notify(e,n),"batchsave"===n.requestType)&&(n.cancel=!1,n.rows=[],n.isFrozen=!n.isFrozen,o.parent.trigger(QA,n)),o.parent.autoFit&&o.parent.preventAdjustColumns(),o.parent.hideSpinner()}o.parent.notify(Lx,{}),o.setRowCount(o.parent.getCurrentViewRecords().length),"query"in i&&(o.parent.getDataModule().isQueryInvokedFromData=!1)}else r.hideSpinner()}})},LM.prototype.dataManagerFailure=function(e,t){je(this.parent.contentModule)||(this.ariaService.setOptions(this.parent.getContent().querySelector("."+WE),{busy:!1,invalid:!0}),this.setRowCount(1)),this.parent.trigger(UA,e&&e.error?e:{error:e}),this.parent.hideSpinner(),this.parent.removeMaskRow(),"save"!==t.requestType&&"delete"!==t.requestType&&"bulk-save"!==t.name&&(this.parent.currentViewData=[],this.renderEmptyRow(),this.parent.isInitialLoad||this.parent.focusModule.setFirstFocusableTabIndex(),this.parent.log("actionfailure",{error:e}))},LM.prototype.setRowCount=function(e){this.ariaService.setOptions(this.parent.element,{rowcount:e?e.toString():"1"})},LM.prototype.isInfiniteEnd=function(e){return this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&"delete"===e.requestType},LM.prototype.updatesOnInitialRender=function(e){var t=!(this.isLayoutRendered=!0);this.parent.columns.length<1&&(this.buildColumns(e.result[0]),t=!0),QP(this.parent.columns,null,this.parent),t&&this.parent.notify(yE,{}),this.headerRenderer.renderTable(),this.contentRenderer.renderTable(),this.parent.isAutoGen=!0,this.parent.notify(Ox,{})},LM.prototype.iterateComplexColumns=function(e,t,i){for(var n=Object.keys(e),o=0;o<n.length;o++)("object"!=typeof e[n[parseInt(o.toString(),10)]]||!e[n[parseInt(o.toString(),10)]]||e[n[parseInt(o.toString(),10)]]instanceof Date?[]:Object.keys(e[n[parseInt(o.toString(),10)]])).length?this.iterateComplexColumns(e[n[parseInt(o.toString(),10)]],t+(n[parseInt(o.toString(),10)]+"."),i):(i[this.counter]=t+n[parseInt(o.toString(),10)],this.counter++)},LM.prototype.buildColumns=function(e){for(var t=[],i={},n=(this.iterateComplexColumns(e,"",i),Object.keys(i).filter(function(e){return"BlazId"!==i[""+e]}).map(function(e){return i[""+e]})),o=0,r=n.length;o<r;o++)t[parseInt(o.toString(),10)]={field:n[parseInt(o.toString(),10)]},this.parent.enableColumnVirtualization&&(t[parseInt(o.toString(),10)].width=je(t[parseInt(o.toString(),10)].width)?200:t[parseInt(o.toString(),10)].width);this.parent.setProperties({columns:t},!0)},LM.prototype.instantiateRenderer=function(){this.renderer.addRenderer(RA.Header,new OD(this.parent,this.locator)),this.renderer.addRenderer(RA.Content,new LD(this.parent,this.locator));var e=this.locator.getService("cellRendererFactory");e.addCellRenderer(LA.Header,new qD(this.parent,this.locator)),e.addCellRenderer(LA.Data,new VD(this.parent,this.locator)),e.addCellRenderer(LA.StackedHeader,new KD(this.parent,this.locator)),e.addCellRenderer(LA.Indent,new eM(this.parent,this.locator)),e.addCellRenderer(LA.GroupCaption,new oM(this.parent,this.locator)),e.addCellRenderer(LA.GroupCaptionEmpty,new aM(this.parent,this.locator)),e.addCellRenderer(LA.Expand,new pM(this.parent,this.locator)),e.addCellRenderer(LA.HeaderIndent,new mM(this.parent,this.locator)),e.addCellRenderer(LA.StackedHeader,new KD(this.parent,this.locator)),e.addCellRenderer(LA.DetailHeader,new bM(this.parent,this.locator)),e.addCellRenderer(LA.RowDragHIcon,new PM(this.parent,this.locator)),e.addCellRenderer(LA.DetailExpand,new AM(this.parent,this.locator)),e.addCellRenderer(LA.DetailFooterIntent,new eM(this.parent,this.locator)),e.addCellRenderer(LA.RowDragIcon,new EM(this.parent,this.locator))},LM.prototype.addEventListener=function(){var e=this;this.parent.isDestroyed||(this.parent.on(q1,this.instantiateRenderer,this),this.parent.on("refreshdataSource",this.dataManagerSuccess,this),this.parent.on($1,this.refresh,this),this.parent.on(Px,this.refreshComplete,this),this.parent.on(Rx,this.sendBulkRequest,this),this.parent.on(gI,function(){e.emptyGrid=!0},this),this.parent.on(Ox,this.dynamicColumnChange,this))},LM.prototype.validateGroupRecords=function(t){var n=this,e=t.result.length-1;if(e<0)return Promise.resolve(t);function i(e){for(var t=[o,r],i=0;i<t.length;i++)s.push(new ba("field","==",t[parseInt(i.toString(),10)].field).and(n.getPredicate("key","equal",t[parseInt(i.toString(),10)].key)));e.where(ba.or(s))}var o=t.result[0],r=t.result[parseInt(e.toString(),10)],s=[],e=new ya;i(e);var a=new me(t.result).executeLocal(e),e=this.data.generateQuery(!0),l=[];if(this.data.isRemote()){for(var h=[o,r],d=0;d<h.length;d++)l.push(this.getPredicate(h[parseInt(d.toString(),10)].field,"equal",h[parseInt(d.toString(),10)].key));e.where(ba.or(l))}else i(e);var p=new ll;return this.data.getData({},e).then(function(e){n.updateGroupInfo(a,e.result),p.resolve(t)}).catch(function(e){return p.reject(e)}),p.promise},LM.prototype.getPredicate=function(e,t,i){return i instanceof Date?PB({field:e,operator:t,value:i}):new ba(e,t,i)},LM.prototype.updateGroupInfo=function(e,t){for(var i=new me(t),n=e,o=0;o<n.length;o++){var r=i.executeLocal((new ya).where(new ba("field","==",n[parseInt(o.toString(),10)].field).and(this.getPredicate("key","equal",n[parseInt(o.toString(),10)].key))))[0];if(!je(r)){n[parseInt(o.toString(),10)].count=r.count;for(var s=n[parseInt(o.toString(),10)].items,a=r.items,l=(s.GroupGuid&&(n[parseInt(o.toString(),10)].items=this.updateGroupInfo(n[parseInt(o.toString(),10)].items,r.items)),this.parent.aggregates),h=0;h<l.length;h++)for(var d=l[parseInt(h.toString(),10)],p=0;p<d.columns.length;p++)for(var c=d.columns[parseInt(p.toString(),10)],u=c.type instanceof Array?c.type:[c.type],g=0;g<u.length;g++){var m,f,y=c.field+" - "+u[parseInt(g.toString(),10)].toLowerCase(),v=s.level?a.records:r.items,b=this.parent;"Custom"===u[parseInt(g.toString(),10)]?(m=s.level?a:r,"string"==typeof(f=c.customAggregate)&&(f=R(f,window)),n[parseInt(o.toString(),10)].aggregates[y]=f?f.call(b,m,d.columns[parseInt(p.toString(),10)]):""):n[parseInt(o.toString(),10)].aggregates[y]=Sa.aggregates[u[parseInt(g.toString(),10)].toLowerCase()](v,d.columns[parseInt(p.toString(),10)].field)}}}return e};var FM=LM;function LM(e,t){this.emptyGrid=!1,this.counter=0,this.parent=e,this.locator=t,this.data=new TE(e,t),this.l10n=t.getService("localization"),this.ariaService=this.locator.getService("ariaService"),this.renderer=this.locator.getService("rendererFactory"),this.addEventListener()}OM.prototype.addCellRenderer=function(e,t){e="string"==typeof e?e:M(LA,e),je(this.cellRenderMap[""+e])&&(this.cellRenderMap[""+e]=t)},OM.prototype.getCellRenderer=function(e){if(e="string"==typeof e?e:M(LA,e),je(this.cellRenderMap[""+e]))throw"The cellRenderer "+e+" is not found";return this.cellRenderMap[""+e]};var RM=OM;function OM(){this.cellRenderMap={}}VM.prototype.addEventListener=function(){this.evtHandlers=[{event:NT,handler:this.closeCustomDialog},{event:VT,handler:this.refreshCustomFilterOkBtn},{event:HT,handler:this.renderResponsiveContextMenu},{event:zT,handler:this.renderCustomFilterDiv},{event:jT,handler:this.customExFilterClose},{event:_T,handler:this.refreshCustomFilterClearBtn}],CF(this.parent,this.evtHandlers,!0,this),this.onActionCompleteFn=this.editComplate.bind(this),this.parent.addEventListener(QA,this.onActionCompleteFn)},VM.prototype.customExFilterClose=function(){this.isCustomDlgRender=!1},VM.prototype.renderCustomFilterDiv=function(){var e=this.customResponsiveDlg.element.querySelector(".e-dlg-header-content"),t=e.querySelector(".e-dlg-custom-header"),e=e.querySelector(".e-dlg-closeicon-btn"),e=(this.isCustomDlgRender=!0,this.parent.filterModule.filterModule.closeDialog(),this.saveBtn.element.style.display="",this.refreshCustomFilterOkBtn({disabled:!1}),this.backBtn.element.style.display="none",e.style.display="",t.innerHTML=this.parent.localeObj.getConstant("CustomFilter"),this.customResponsiveDlg.element.querySelector(".e-dlg-content"));this.customExcelFilterParent=this.parent.createElement("div",{className:"e-xl-customfilterdiv e-default-filter"}),e.appendChild(this.customExcelFilterParent)},VM.prototype.renderResponsiveContextMenu=function(e){var t,i,n,o,r;this.action===NA.isFilter&&(t=this.customResponsiveDlg.element.querySelector(".e-dlg-content"),i=(n=this.customResponsiveDlg.element.querySelector(".e-dlg-header-content")).querySelector(".e-dlg-closeicon-btn"),n=n.querySelector(".e-dlg-custom-header"),e.isOpen?(t.firstChild.style.display="none",t.appendChild(e.target),i.style.display="none",this.saveBtn.element.style.display="none",this.filterClearBtn.element.style.display="none",n.innerHTML=e.header,o=this.parent.createElement("button"),r=this.parent.createElement("span",{className:"e-btn-icon e-resfilterback e-icons"}),o.appendChild(r),this.backBtn=new zv({cssClass:this.parent.cssClass?"e-res-back-btn "+this.parent.cssClass:"e-res-back-btn"}),this.backBtn.appendTo(o),n.parentElement.insertBefore(o,n)):this.backBtn&&!this.isCustomDlgRender&&(t.firstChild.style.display="",ue(this.backBtn.element),i.style.display="",this.saveBtn.element.style.display="",this.isFiltered&&(this.filterClearBtn.element.style.display=""),n.innerHTML=this.getHeaderTitle({action:NA.isFilter},e.col)))},VM.prototype.refreshCustomFilterClearBtn=function(e){this.filterClearBtn&&(this.isFiltered=e.isFiltered,this.filterClearBtn.element.style.display=e.isFiltered?"":"none")},VM.prototype.refreshCustomFilterOkBtn=function(e){this.saveBtn&&(this.saveBtn.disabled=e.disabled),this.parent.columnChooserModule&&this.parent.columnChooserModule.responsiveDialogRenderer.saveBtn&&(this.parent.columnChooserModule.responsiveDialogRenderer.saveBtn.disabled=e.disabled)},VM.prototype.columnMenuResponsiveContent=function(e,t,i){i=this.parent.createElement("div",{className:"e-responsivecoldiv e-responsive"+e.toLowerCase()+"div"+(i?" e-disabled":"")}),e=this.parent.createElement("span",{className:"e-icons e-res"+e.toLowerCase()+"-icon e-btn-icon"}),t=this.parent.createElement("span",{innerHTML:t,className:"e-rescolumn-menu e-res-header-text"});i.appendChild(e),i.appendChild(t),this.customColumnDiv.appendChild(i)},VM.prototype.renderResponsiveContent=function(e,t){var i=this,n=this.parent,o=this.action===NA.isColumnChooser;if(e||o)return this.filterParent=this.parent.createElement("div",{className:(o?"e-maincolumnchooserdiv ":"")+"e-mainfilterdiv e-default-filter",id:(o?"columchooser":e.uid)+"-main-filter"}),this.filterParent;if(this.customColumnDiv=n.createElement("div",{className:"columndiv columnmenudiv"}),this.customColumnDiv.style.width="100%",this.parent.showColumnMenu&&"Horizontal"===this.parent.rowRenderingMode&&this.action===NA.isColMenu){if(this.columnMenuResponsiveContent("AutoFitAll",n.localeObj.getConstant("AutoFitAll")),this.columnMenuResponsiveContent("AutoFit",n.localeObj.getConstant("AutoFit")),t.allowGrouping&&n.allowGrouping&&(this.columnMenuResponsiveContent("Group",n.localeObj.getConstant("Group"),0<=n.groupSettings.columns.indexOf(t.field)),this.columnMenuResponsiveContent("UnGroup",n.localeObj.getConstant("Ungroup"),n.groupSettings.columns.indexOf(t.field)<0)),t.allowSorting&&n.allowSorting){for(var r="None",s=this.parent.sortSettings.columns,a=0;a<s.length;a++)if(s[parseInt(a.toString(),10)].field===t.field){r=s[parseInt(a.toString(),10)].direction;break}this.columnMenuResponsiveContent("ascending",n.localeObj.getConstant("SortAscending"),"Ascending"===r),this.columnMenuResponsiveContent("descending",n.localeObj.getConstant("SortDescending"),"Descending"===r)}n.showColumnChooser&&this.columnMenuResponsiveContent("Column",n.localeObj.getConstant("Columnchooser")),t.allowFiltering&&n.allowFiltering&&this.columnMenuResponsiveContent("Filter",n.localeObj.getConstant("FilterMenu"))}else{var l=n.getColumns(),h=n.createElement("div",{className:"e-ressortbutton-parent"}),d=[],p=this.action===NA.isSort,c=this.action===NA.isFilter;if(c)for(a=0;a<n.filterSettings.columns.length;a++)d.push(n.filterSettings.columns[parseInt(a.toString(),10)].field);for(var u,g,m,f,a=0;a<l.length;a++)!l[parseInt(a.toString(),10)].visible||!l[parseInt(a.toString(),10)].allowSorting&&p||!l[parseInt(a.toString(),10)].allowFiltering&&c||((u=n.createElement("div",{className:"e-responsivecoldiv"})).setAttribute("data-e-mappingname",l[parseInt(a.toString(),10)].field),u.setAttribute("data-e-mappinguid",l[parseInt(a.toString(),10)].uid),m=n.createElement("span",{innerHTML:l[parseInt(a.toString(),10)].headerText,className:"e-res-header-text"}),u.appendChild(m),this.customColumnDiv.appendChild(u),p&&(m=this.getSortedFieldsAndDirections("field").indexOf(l[parseInt(a.toString(),10)].field),g=n.createElement("button",{id:n.element.id+l[parseInt(a.toString(),10)].field+"sortbutton"}),(f=h.cloneNode()).appendChild(g),u.appendChild(f),f=void new zv({cssClass:this.parent.cssClass?"e-ressortbutton "+this.parent.cssClass:"e-ressortbutton"}).appendTo(g),je(this.parent.sortSettings.columns[parseInt(m.toString(),10)])||(f="Ascending"===this.parent.sortSettings.columns[parseInt(m.toString(),10)].direction?this.parent.localeObj.getConstant("AscendingText"):this.parent.localeObj.getConstant("DescendingText")),g.innerHTML=-1<m?f:this.parent.localeObj.getConstant("NoneText"),g.onclick=function(e){i.sortButtonClickHandler(e.target)}),c&&-1<d.indexOf(l[parseInt(a.toString(),10)].field)&&(m=n.createElement("div",{className:"e-icons e-res-icon e-filtersetdiv"}),(f=n.createElement("span",{className:"e-icons e-res-icon e-filterset"})).setAttribute("colType",l[parseInt(a.toString(),10)].type),m.appendChild(f),u.appendChild(m)))}return E.add(this.customColumnDiv,F.isDevice?"touchend":"click",this.customFilterColumnClickHandler,this),this.customColumnDiv},VM.prototype.getSortedFieldsAndDirections=function(e){for(var t=[],i=0;i<this.parent.sortSettings.columns.length;i++)t.push(this.parent.sortSettings.columns[parseInt(i.toString(),10)][""+e]);return t},VM.prototype.sortButtonClickHandler=function(e){var t,i,n;e&&(t=A(e,"e-responsivecoldiv").getAttribute("data-e-mappingname"),this.parent.allowMultiSorting||(this.sortPredicate=[],this.sortedCols=[],this.isSortApplied=!1,this.resetSortButtons(e)),n=(i=(i=e.textContent)===this.parent.localeObj.getConstant("NoneText")?this.parent.localeObj.getConstant("AscendingText"):i===this.parent.localeObj.getConstant("AscendingText")?this.parent.localeObj.getConstant("DescendingText"):this.parent.localeObj.getConstant("NoneText"))===this.parent.localeObj.getConstant("AscendingText")?"Ascending":i===this.parent.localeObj.getConstant("DescendingText")?"Descending":"None",e.innerHTML=i,this.setSortedCols(t,n))},VM.prototype.resetSortButtons=function(e){for(var t=[].slice.call(this.customColumnDiv.getElementsByClassName("e-ressortbutton")),i=0;i<t.length;i++)t[parseInt(i.toString(),10)]!==e&&(t[parseInt(i.toString(),10)].innerHTML=this.parent.localeObj.getConstant("NoneText"))},VM.prototype.setSortedCols=function(e,t){var i=this.getCurrentSortedFields().indexOf(e);this.parent.allowMultiSorting&&-1<i&&(this.sortedCols.splice(i,1),this.sortPredicate.splice(i,1)),this.isSortApplied=!0,"None"!==t&&(this.sortedCols.push(e),this.sortPredicate.push({field:e,direction:t}))},VM.prototype.getCurrentSortedFields=function(){for(var e=[],t=0;t<this.sortedCols.length;t++)e.push(this.sortedCols[parseInt(t.toString(),10)]);return e},VM.prototype.customFilterColumnClickHandler=function(e){var t,i,n,o=this.parent,r=e.target;A(r,"columnmenudiv")&&this.action===NA.isColMenu&&!A(r,"e-disabled")&&(t=this.menuCol||this.filteredCol,A(r,"e-responsiveautofitalldiv")?(o.autoFitColumns([]),this.closeCustomFilter()):A(r,"e-responsiveautofitdiv")?(o.autoFitColumns(t.field),this.closeCustomFilter()):A(r,"e-responsivegroupdiv")?(o.groupColumn(t.field),this.closeCustomFilter()):A(r,"e-responsiveungroupdiv")?(o.ungroupColumn(t.field),this.closeCustomFilter()):A(r,"e-responsiveascendingdiv")?(o.sortColumn(t.field,"Ascending"),this.closeCustomFilter()):A(r,"e-responsivedescendingdiv")?(o.sortColumn(t.field,"Descending"),this.closeCustomFilter()):A(r,"e-responsivecolumndiv")?(o.notify(vE,{action:5}),o.showResponsiveCustomColumnChooser()):A(r,"e-responsivefilterdiv")&&(o.notify(vE,{action:3}),this.isRowResponsive=!0,this.isCustomDialog=!1,o.filterModule)&&o.filterModule.responsiveDialogRenderer.showResponsiveDialog(t),e.preventDefault()),this.action===NA.isFilter&&"FilterBar"!==o.filterSettings.type&&(r.classList.contains("e-responsivecoldiv")||r.parentElement.classList.contains("e-responsivecoldiv")?(i=(i=r.getAttribute("data-e-mappingname"))||r.parentElement.getAttribute("data-e-mappingname"))&&(n=o.getColumnByField(i),this.isRowResponsive=!0,this.showResponsiveDialog(n)):(r.classList.contains("e-filterset")||r.parentElement.classList.contains("e-filtersetdiv"))&&(t=A(r,"e-responsivecoldiv"))&&(i=t.getAttribute("data-e-mappingname"),"Menu"!==(n=o.getColumnByField(i)).filter.type&&(n.filter.type||"Menu"!==o.filterSettings.type)||(this.isDialogClose=!0),this.parent.filterModule.filterModule.clearCustomFilter(n),this.removeCustomDlgFilterEle(r)))},VM.prototype.showResponsiveDialog=function(e,t){if(this.isCustomDialog&&this.action===NA.isFilter&&!this.isRowResponsive||t&&this.action===NA.isColMenu)this.menuCol=t,this.renderCustomFilterDialog(null,t);else{if(this.filteredCol=e,this.renderResponsiveDialog(e),this.parent.enableAdaptiveUI&&e&&(this.parent.filterModule.setFilterModel(e),this.parent.filterModule.filterModule.openDialog(this.parent.filterModule.createOptions(e,void 0))),this.action===NA.isColumnChooser&&this.parent.notify(bE,{action:"open"}),this.action===NA.isSort){t={cancel:!1,dialogObj:this.customResponsiveDlg,requestType:"beforeOpenAptiveSortDialog"};if(this.parent.trigger(k1,t),t.cancel)return}this.customResponsiveDlg.show(!0),this.customResponsiveDlg.element.style.maxHeight="100%",this.setTopToChildDialog(this.customResponsiveDlg.element),this.parent.enableAdaptiveUI&&this.parent.filterSettings&&("CheckBox"===this.parent.filterSettings.type||"Excel"===this.parent.filterSettings.type)&&this.parent.filterSettings.enableInfiniteScrolling&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&("CheckBox"===this.parent.filterSettings.type?this.parent.filterModule.filterModule.checkBoxBase:this.parent.filterModule.filterModule.excelFilterBase).showMask()}},VM.prototype.setTopToChildDialog=function(e){var t=e.querySelector(".e-dialog");t&&(e=e.querySelector(".e-dlg-header-content").getBoundingClientRect().height,t.style.top=e+"px")},VM.prototype.renderCustomFilterDialog=function(e,t){var i,n=this.parent,o=this.action===NA.isColMenu;this.action===NA.isFilter&&"FilterBar"===n.filterSettings.type||(i=o?"e-customcolumnmenudiv ":"",n=this.parent.createElement("div",{id:n.element.id+(o?"customcolumnmenu":"customfilter"),className:this.parent.cssClass?i+"e-customfilterdiv e-responsive-dialog "+this.parent.cssClass:i+"e-customfilterdiv e-responsive-dialog"}),this.parent.element.appendChild(n),this.customFilterDlg=this.getDialogOptions(e,!0,null,t),o={cancel:!1,dialogObj:this.customFilterDlg,requestType:"beforeOpenAptiveFilterDialog"},this.parent.trigger(k1,o),o.cancel)||(this.customFilterDlg.appendTo(n),this.customFilterDlg.show(!0),this.customFilterDlg.element.style.maxHeight="100%")},VM.prototype.getDialogOptions=function(e,t,i,n){n=new pS({isModal:!0,showCloseIcon:!("columnchooser"===i&&this.parent.columnChooserSettings.headerTemplate&&!this.parent.enableColumnVirtualization),closeOnEscape:!1,locale:this.parent.locale,target:this.parent.adaptiveDlgTarget||document.body,visible:!1,enableRtl:this.parent.enableRtl,content:this.renderResponsiveContent(e,n),open:this.dialogOpen.bind(this),created:this.dialogCreated.bind(this),close:this.beforeDialogClose.bind(this),width:"100%",height:"100%",animationSettings:{effect:"None"},cssClass:this.parent.cssClass||""});return n.isStringTemplate=!0,t?(n.header=this.renderResponsiveHeader(e,void 0,!0),t=this.action===NA.isColMenu?"e-customcolumnmenu ":"",n.cssClass=t+"e-customfilter"):(n.header=this.renderResponsiveHeader(e),n.cssClass="Vertical"===this.parent.rowRenderingMode&&this.action===NA.isFilter?"e-res"+i+" e-row-responsive-filter":"e-res"+i),n},VM.prototype.renderResponsiveDialog=function(e){var t,i=this.parent;this.action===NA.isFilter&&"FilterBar"===i.filterSettings.type||(t=this.action===NA.isFilter?"filter":"sort",t=this.action===NA.isColumnChooser?"columnchooser":t,i=this.parent.createElement("div",{id:i.element.id+"responsive"+t,className:this.parent.cssClass?"e-res"+t+"div e-responsive-dialog "+this.parent.cssClass:"e-res"+t+"div e-responsive-dialog"}),this.parent.element.appendChild(i),this.customResponsiveDlg=this.getDialogOptions(e,!1,t),this.customResponsiveDlg.appendTo(i))},VM.prototype.dialogCreated=function(){vF(this.parent)},VM.prototype.dialogOpen=function(){if(this.action===NA.isSort&&this.parent.allowMultiSorting)for(var e=0;e<this.parent.sortSettings.columns.length;e++){this.sortedCols.push(this.parent.sortSettings.columns[parseInt(e.toString(),10)].field);var t=this.parent.sortSettings.columns[parseInt(e.toString(),10)].field,i=this.parent.sortSettings.columns[parseInt(e.toString(),10)].direction;this.sortPredicate.push({field:t,direction:i})}},VM.prototype.beforeDialogClose=function(e){var t;this.isDialogClose=e.element&&!e.element.querySelector(".e-xl-customfilterdiv")&&e.element.classList.contains("e-resfilterdiv"),this.action===NA.isFilter?(e.element.classList.contains("e-resfilterdiv")?this.parent.filterModule.filterModule.closeResponsiveDialog(this.isCustomDlgRender):e.element.classList.contains("e-customfilterdiv")&&this.closeCustomFilter(),"Horizontal"===this.parent.rowRenderingMode&&this.parent.showColumnMenu&&(this.parent.notify(vE,{action:4}),t=document.querySelector(".e-resfilter"))&&ue(t)):this.action===NA.isSort?this.closeCustomDialog():this.action===NA.isColMenu?(this.closeCustomFilter(),(t=document.querySelector(".e-rescolummenu"))&&ue(t)):this.action===NA.isColumnChooser&&(this.parent.notify(bE,{action:"clear"}),(t=document.querySelector(".e-rescolumnchooser"))&&ue(t),"Horizontal"===this.parent.rowRenderingMode&&this.parent.showColumnMenu&&this.parent.notify(vE,{action:4}),this.isCustomDialog=!1,this.isDialogClose=!1),this.parent.off(qT,this.keyHandler)},VM.prototype.sortColumn=function(){if(this.isSortApplied){this.sortPredicate.length&&this.parent.setProperties({sortSettings:{columns:[]}},!0);for(var e=0;e<this.sortPredicate.length;e++)this.parent.sortColumn(this.sortPredicate[parseInt(e.toString(),10)].field,this.sortPredicate[parseInt(e.toString(),10)].direction,this.parent.allowMultiSorting);this.sortPredicate.length||this.parent.clearSorting()}this.closeCustomDialog()},VM.prototype.getHeaderTitle=function(e,t){var i,n=this.parent;return this.action===NA.isEdit?i=n.localeObj.getConstant("EditFormTitle")+e.primaryKeyValue[0]:this.action===NA.isAdd?i=n.localeObj.getConstant("AddFormTitle"):this.action===NA.isFilter?i=t?t.headerText||t.field:n.localeObj.getConstant("FilterTitle"):this.action===NA.isSort?i=n.localeObj.getConstant("Sort"):this.action===NA.isColMenu?i=n.localeObj.getConstant("ColumnMenu"):this.action===NA.isColumnChooser&&(i=n.localeObj.getConstant("ChooseColumns")),i},VM.prototype.getDialogName=function(e){var t;return e===NA.isAdd||e===NA.isEdit?t="dialogEdit_wrapper_title":e===NA.isFilter?t="responsive_filter_dialog_wrapper":e===NA.isColumnChooser&&(t="responsive_column_chooser_dialog_wrapper"),t},VM.prototype.getButtonText=function(e){var t;return e===NA.isAdd||e===NA.isEdit?t="Save":e!==NA.isFilter&&this.action!==NA.isSort&&e!==NA.isColumnChooser&&this.action!==NA.isColumnChooser||(t="OKButton"),t},VM.prototype.renderResponsiveHeader=function(e,t,i){var n,o,r=this,s=this.parent,a=(s.on(qT,this.keyHandler,this),s.element.id+this.getDialogName(this.action));return this.parent.columnChooserSettings.headerTemplate&&!this.parent.enableColumnVirtualization&&this.getHeaderTitle(t,e)===s.localeObj.getConstant("ChooseColumns")?this.parent.columnChooserModule.renderHeader():(n=s.createElement("div",{className:"e-res-custom-element"}),(a=s.createElement("div",{className:"e-dlg-custom-header",id:a})).innerHTML=this.getHeaderTitle(t,e),n.appendChild(a),t=s.createElement("button"),i||(this.saveBtn=new zv({cssClass:this.parent.cssClass?"e-primary e-flat e-res-apply-btn "+this.parent.cssClass:"e-primary e-flat e-res-apply-btn"}),t.innerHTML=s.localeObj.getConstant(this.getButtonText(this.action)),this.saveBtn.appendTo(t),t.onclick=function(e){r.dialogHdrBtnClickHandler()}),e=this.action===NA.isSort,((o=this.action===NA.isFilter)||e)&&(a=e?"sort":"filter",e=s.createElement("button"),this.filterClearBtn=new zv({cssClass:this.parent.cssClass?"e-primary e-flat e-res-"+a+"-clear-btn "+this.parent.cssClass:"e-primary e-flat e-res-"+a+"-clear-btn"}),o?(a=s.createElement("span",{className:"e-btn-icon e-icon-filter-clear e-icons"}),e.appendChild(a)):e.innerHTML=s.localeObj.getConstant("Clear"),n.appendChild(e),this.filterClearBtn.appendTo(e),e.onclick=function(e){A(e.target,"e-customfilter")?(r.parent.filterModule.clearFiltering(),r.removeCustomDlgFilterEle()):o?r.filterClear():(r.resetSortButtons(),r.sortedCols=[],r.sortPredicate=[],r.isSortApplied=!0)},n.appendChild(e)),i||n.appendChild(t),n)},VM.prototype.filterClear=function(){this.parent.filterModule.filterModule.clearCustomFilter(this.filteredCol),this.parent.filterModule.filterModule.closeResponsiveDialog()},VM.prototype.removeCustomFilterElement=function(){var e=document.getElementById(this.parent.element.id+"customcolumnmenu"),e=(e&&(ue(e),e=document.querySelector(".e-customfilter"))&&ue(e),document.querySelector(".e-rescolumnchooser"));e&&ue(e)},VM.prototype.hideResponsiveColumnChooser=function(){var e=document.querySelector(".e-rescolumnchooser");e&&(ue(e),this.isCustomDialog=!1,this.isDialogClose=!1)},VM.prototype.dialogHdrBtnClickHandler=function(){this.action===NA.isEdit||this.action===NA.isAdd?this.parent.endEdit():this.action===NA.isFilter?(this.parent.filterModule.filterModule.applyCustomFilter({col:this.filteredCol,isCustomFilter:this.isCustomDlgRender}),this.removeCustomFilterElement()):this.action===NA.isSort?(this.sortColumn(),this.removeCustomFilterElement()):this.action===NA.isColumnChooser&&(this.parent.notify(bE,{action:"confirm"}),this.removeCustomFilterElement(),this.isCustomDialog=!1,this.isDialogClose=!1)},VM.prototype.closeCustomDialog=function(){this.isCustomDlgRender?ue(this.customResponsiveDlg.element.querySelector(".e-mainfilterdiv")):(this.isRowResponsive=!1,this.isCustomDlgRender=!1,this.destroyCustomFilterDialog())},VM.prototype.destroyCustomFilterDialog=function(){var e;this.customResponsiveDlg&&(e=document.getElementById(this.customResponsiveDlg.element.id),this.customResponsiveDlg&&!this.customResponsiveDlg.isDestroyed&&e&&(this.customResponsiveDlg.destroy(),ue(e)),this.closeCustomFilter(),this.action===NA.isSort)&&(this.sortPredicate=[],this.sortedCols=[],this.isSortApplied=!1)},VM.prototype.closeCustomFilter=function(){var e;!this.isDialogClose&&this.customFilterDlg&&(e=document.getElementById(this.customFilterDlg.element.id),this.customFilterDlg)&&!this.customFilterDlg.isDestroyed&&e&&(this.customFilterDlg.destroy(),ue(e)),this.isCustomDialog=!1,this.isDialogClose=!1},VM.prototype.removeCustomDlgFilterEle=function(e){if(e)e.parentElement.classList.contains("e-filtersetdiv")?ue(e.parentElement):ue(e);else for(var t=this.customColumnDiv.children,i=0;i<t.length;i++)(e=t[parseInt(i.toString(),10)].querySelector(".e-filtersetdiv"))&&(ue(e),i--)},VM.prototype.keyHandler=function(e){13===e.keyCode&&(this.action===NA.isFilter&&e.target.classList.contains("e-searchinput")||this.action===NA.isEdit||this.action===NA.isAdd)&&this.dialogHdrBtnClickHandler()},VM.prototype.editComplate=function(e){"save"!==e.requestType&&"cancel"!==e.requestType||this.parent.off(qT,this.keyHandler)},VM.prototype.removeEventListener=function(){this.customColumnDiv&&E.remove(this.customColumnDiv,F.isDevice?"touchend":"click",this.customFilterColumnClickHandler),CF(this.parent,this.evtHandlers,!0,this),this.parent.removeEventListener(QA,this.onActionCompleteFn)};var NM=VM;function VM(e,t){this.sortedCols=[],this.sortPredicate=[],this.isCustomDialog=!1,this.parent=e,this.serviceLocator=t,this.addEventListener()}HM.prototype.register=function(e,t){je(this.services[""+e])&&(this.services[""+e]=t)},HM.prototype.getService=function(e){if(je(this.services[""+e]))throw"The service "+e+" is not registered";return this.services[""+e]},HM.prototype.registerAdaptiveService=function(e,t,i){t?(e.responsiveDialogRenderer=new NM(e.parent,e.serviceLocator),e.responsiveDialogRenderer.action=i):e.responsiveDialogRenderer&&(e.responsiveDialogRenderer.removeEventListener(),e.responsiveDialogRenderer=void 0)};var _M=HM;function HM(){this.services={}}jM.prototype.addRenderer=function(e,t){e=M(RA,e);je(this.rendererMap[""+e])&&(this.rendererMap[""+e]=t)},jM.prototype.getRenderer=function(e){e=M(RA,e);if(je(this.rendererMap[""+e]))throw"The renderer "+e+" is not found";return this.rendererMap[""+e]};var zM=jM;function jM(){this.rendererMap={}}QM.prototype.setWidthToColumns=function(){var e,t=0,i=this.parent.getColumnIndexesInView(),n=!0;if(this.parent.allowGrouping)for(var o=this.parent.groupSettings.columns.length;t<o;t++)this.parent.enableColumnVirtualization&&-1===i.indexOf(t)?n=!1:this.setColumnWidth(new C0({width:"30px"}),t);(this.parent.detailTemplate||this.parent.childGrid)&&(this.setColumnWidth(new C0({width:"30px"}),t),t++),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&(this.setColumnWidth(new C0({width:"30px"}),t),t++);for(var r,s,a,l=this.parent.getColumns(),h=0;h<l.length;h++)this.setColumnWidth(l[parseInt(h.toString(),10)],n&&this.parent.enableColumnVirtualization?void 0:h+t);this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&this.setColumnWidth(new C0({width:"30px"}),this.parent.groupSettings.columns.length+l.length),"auto"!==(e=this.getTableWidth(this.parent.getColumns()))&&("auto"!==this.parent.width&&-1===this.parent.width.toString().indexOf("%")&&this.setMinwidthBycalculation(e),r=l.filter(function(e){return!je(e.maxWidth)}),s=this.parent.getHeaderTable(),a=this.parent.getContentTable(),this.parent.allowResizing)&&this.parent.element.getBoundingClientRect().width>e&&r.length===l.length&&s&&a&&U([s,a],["e-tableborder"])},QM.prototype.setMinwidthBycalculation=function(e){var t=this,i=0,n=this.parent.getColumns().filter(function(e){return t.parent.allowResizing?(je(e.width)||"auto"===e.width)&&je(e.maxWidth):je(e.width)||"auto"===e.width});if(n.length){for(var i=je(this.parent.width)||"auto"===this.parent.width||"string"!=typeof this.parent.width||-1!==this.parent.width.indexOf("%")?this.parent.element.getBoundingClientRect().width-e:parseInt(this.parent.width,10)-e,o=0,r=0,s=n;r<s.length;r++){var a=s[r];o+=je(a.minWidth)?0:"string"==typeof a.minWidth?parseInt(a.minWidth,10):a.minWidth}for(var l=0;l<n.length;l++){0===e&&this.parent.allowResizing&&this.isWidthUndefined()&&l!==n.length-1&&this.setUndefinedColumnWidth(n);var h=this.parent.getColumnIndexByField(n[parseInt(l.toString(),10)].field)+this.parent.getIndentCount();0!==e&&i<o?this.setWidth(n[parseInt(l.toString(),10)].minWidth,h):0!==e&&o<i&&this.setWidth("",h,!0)}}},QM.prototype.setUndefinedColumnWidth=function(e){for(var t=0;t<e.length;t++)t!==e.length-1&&(e[parseInt(t.toString(),10)].width=200,this.setWidth(200,this.parent.getColumnIndexByField(e[parseInt(t.toString(),10)].field)))},QM.prototype.setColumnWidth=function(e,t,i){var n,o,r;this.parent.getColumns().length<1||(t=je(t)?this.parent.getNormalizedColumnIndex(e.uid):t,n=this.getWidth(e),o=this.getTableWidth(this.parent.getColumns()),null!==n&&(this.setWidth(n,t),"auto"!==this.parent.width&&-1===this.parent.width.toString().indexOf("%")&&"auto"!==o&&this.setMinwidthBycalculation(o),this.parent.allowResizing&&("resize"===i||this.parent.getFrozenColumns())&&(r=this.parent.getContentTable(),this.setWidthToTable(this.parent.getFrozenColumns()&&-1===r.style.width.indexOf("px")&&o<r.clientWidth)),this.parent.notify(xx,{index:t,width:n,column:e,module:i})))},QM.prototype.setWidth=function(e,t,i){this.parent.groupSettings.columns.length>t&&$B(this.parent)&&(e=(30/this.parent.element.offsetWidth*100).toFixed(1)+"%");var n=this.parent.getHeaderTable(),o=this.parent.getContentTable(),e=T(e),n=n.querySelector(rD).children[parseInt(t.toString(),10)],n=(n&&!i?n.style.width=e:n&&i&&(n.style.width=""),o.querySelector(rD).children[parseInt(t.toString(),10)]);if(n&&!i?n.style.width=e:n&&i&&(n.style.width=""),!this.parent.enableColumnVirtualization&&this.parent.isEdit){for(var r=this.parent.element.querySelectorAll(".e-table.e-inline-edit"),s=[],a=0;a<r.length;a++)if(A(r[parseInt(a.toString(),10)],"e-grid").id===this.parent.element.id)for(var l=0;l<r[parseInt(a.toString(),10)].querySelector("colgroup").children.length;l++)s.push(r[parseInt(a.toString(),10)].querySelector("colgroup").children[parseInt(l.toString(),10)]);r.length&&s.length&&s[parseInt(t.toString(),10)]&&(s[parseInt(t.toString(),10)].style.width=e)}this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.refreshFrozenScrollbar()},QM.prototype.refreshFrozenScrollbar=function(){var e,t,i,n={cancel:!1};this.parent.notify(FT,n),n.cancel||(n=aB(),e=this.parent.element.querySelector(".e-movablescrollbar"),t=this.parent.getContent().firstElementChild.getBoundingClientRect().width,this.parent.enableColumnVirtualization&&(i=this.parent.getContent().querySelector(".e-virtualtrack"))&&(t=i.scrollWidth),"auto"!==this.parent.height&&(t+=n),e.firstElementChild.style.width=t+"px")},QM.prototype.getSiblingsHeight=function(e){return this.getHeightFromDirection(e,"previous")+this.getHeightFromDirection(e,"next")},QM.prototype.getHeightFromDirection=function(e,t){for(var i=e[t+"ElementSibling"],n=0,o=[RE,NE,"e-groupdroparea","e-gridpager","e-toolbar","e-temp-toolbar"];i;)o.some(function(e){return i.classList.contains(e)})&&(n+=i.offsetHeight),i=i[t+"ElementSibling"];return n},QM.prototype.isWidthUndefined=function(){var e=this.parent.getColumns().filter(function(e){return je(e.width)&&je(e.minWidth)}).length;return this.parent.getColumns().length===e},QM.prototype.getWidth=function(e){var t;return this.parent.allowResizing&&je(e.width)&&(je(e.minWidth)&&je(e.maxWidth)&&!this.isWidthUndefined()?e.width=200:e.maxWidth&&(e.width=e.maxWidth)),e.width?(t=parseInt(e.width.toString(),10),e.minWidth&&t<parseInt(e.minWidth.toString(),10)?e.minWidth:e.maxWidth&&t>parseInt(e.maxWidth.toString(),10)?e.maxWidth:e.width):null},QM.prototype.getTableWidth=function(e,t){for(var i=0,n=!1,o=0,r=e;o<r.length;o++){var s,a=r[o];!1!==a.visible&&(s=this.getWidth(a),"auto"!==a.width&&a.width||(this.parent.allowResizing&&!t?a.maxWidth||(n=!0):s=0),null!==s)&&(i+=parseInt(s.toString(),10))}return i=n?"auto":i},QM.prototype.setWidthToTable=function(e){var t=T(this.getTableWidth(this.parent.getColumns())),e=((this.parent.detailTemplate||this.parent.childGrid)&&this.setColumnWidth(new C0({width:"30px"})),t=this.isAutoResize()||"auto"===t||e?"100%":t,this.parent.getHeaderTable().style.width=t,this.parent.getContentTable().style.width=t,this.parent.element.querySelector(".e-table.e-inline-edit"));e&&(e.style.width=t)},QM.prototype.isAutoResize=function(){return this.parent.allowResizing&&"Auto"===this.parent.resizeSettings.mode};var WM=QM;function QM(e){this.parent=e}UM=function(e,t){return(UM=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])}))(e,t)};var UM,Ir=function(e,t){function i(){this.constructor=e}UM(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},qM=(GM.prototype.focusCheck=function(e){e=e.target;this.focusByClick=!0,this.firstHeaderCellClick=!0,this.skipFocus=e.classList.contains("e-grid")},GM.prototype.onFocus=function(e){var t;this.parent.isDestroyed||F.isDevice||this.parent.enableVirtualization||this.parent.element.querySelector(".e-masked-table")||!this.parent.isInitialLoad&&e&&e.target===this.parent.element&&this.parent.element.querySelector(".e-spin-show")||(this.setActive(!this.parent.enableHeaderFocus&&0===this.parent.frozenRows),this.parent.enableHeaderFocus||this.parent.getCurrentViewRecords().length||"Batch"===this.parent.editSettings.mode&&("Batch"!==this.parent.editSettings.mode||!this.parent.editModule||this.parent.editModule.getBatchChanges()[JE].length)||this.getContent().matrix.generate(this.rowModelGen.generateRows({rows:[new DE({isDataRow:!0})]}),this.getContent().selector,!1),t=this.getContent().matrix.get(0,-1,[0,1],null,this.getContent().validator(),this.active),this.getContent().matrix.select(t[0],t[1]),!this.skipFocus)||e&&e.target===this.parent.element||(this.focus(e),this.skipFocus=!1)},GM.prototype.passiveFocus=function(e){var t;this.parent.isDestroyed||(t=this.parent.getHeaderContent().querySelector(".e-headercell:not(.e-hide)"),e.target!==t||!e.relatedTarget||A(e.relatedTarget,"e-grid")||this.firstHeaderCellClick||(0===this.active.matrix.matrix[(t=[0,0])[0]][t[1]]&&(t=OF(this.active.matrix.matrix,t,!0)),this.active.matrix.current=t,this.currentInfo.element=e.target,this.currentInfo.elementToFocus=e.target,this.currentInfo.element.querySelector(".e-checkselectall")?(this.removeFocus(),this.addFocus(this.getContent().getFocusInfo(),e)):U([this.currentInfo.element],["e-focused","e-focus"])),this.firstHeaderCellClick=!1,e.target&&e.target.classList.contains("e-detailcell")&&(this.currentInfo.skipAction=!1,U([this.currentInfo.element],["e-focused","e-focus"])))},GM.prototype.onBlur=function(e){this.parent.allowPaging&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer")&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer").removeAttribute("aria-hidden");var t=!(!A(e.target,"e-gantt")||!e.target.classList.contains("e-rowcell")||je(e.target.nextElementSibling)||!e.target.nextElementSibling.classList.contains("e-rowcell"));(!this.parent.isEdit&&(!e||e.relatedTarget&&!z(e.relatedTarget,".e-grid")&&!z(e.relatedTarget,".e-grid-popup")||this.parent.element.classList.contains("e-childgrid")&&!this.parent.element.matches(":focus-within"))||!t&&je(e.relatedTarget)&&parseInt(e.target.getAttribute("aria-colindex"),10)-1==0&&0===parseInt(e.target.getAttribute("index"),10)||!t&&je(e.relatedTarget)&&!z(document.activeElement,".e-grid")&&!je(e.sourceCapabilities))&&(this.removeFocus(),this.skipFocus=!0,this.currentInfo.skipAction=!1,this.setLastContentCellTabIndex(),this.setFirstFocusableTabIndex(),this.firstHeaderCellClick=!1)},GM.prototype.setFirstFocusableTabIndex=function(){var e,t,i=this.parent;i.element.tabIndex=-1,i.allowGrouping&&i.groupSettings.showDropArea?0<(e=(t=i.groupModule).getFocusableGroupedItems()).length?(t.element.tabIndex=-1,e[0].tabIndex=0):t.element.tabIndex=0:i.toolbar||i.toolbarTemplate?(e=i.toolbarModule.element,0<(t=this.parent.toolbarModule.getFocusableToolbarItems()).length&&t[0].querySelector(".e-toolbar-item-focus,.e-btn,.e-input")?(e.tabIndex=-1,t[0].querySelector(".e-toolbar-item-focus,.e-btn,.e-input").tabIndex=0):e.tabIndex=0):i.getColumns().length&&(i.getHeaderContent().querySelector(".e-headercell:not(.e-hide)").tabIndex=0,this.setActive(!1),je(this.active)||!je(this.active.target)&&this.active.target.classList.contains("e-columnmenu")||(0===this.active.matrix.matrix[(t=[0,0])[0]][t[1]]&&(t=OF(this.active.matrix.matrix,t,!0)),this.active.matrix.current=t))},GM.prototype.setLastContentCellTabIndex=function(){var e=this.parent.getContentTable();e.rows[e.rows.length-1]&&(e.rows[e.rows.length-1].lastElementChild.tabIndex=0)},GM.prototype.onClick=function(e,t,i){var n,o;A(e.target,"e-filterbarcell")&&(A(e.target,"e-multiselect")||e.target.classList.contains("e-input-group-icon"))||(o=!je(z(e.target,"."+OE)),n=!je(z(e.target,"."+RE)),!(o=o&&n?!o:o)&&je(z(e.target,"."+RE)))||e.target.classList.contains(WE)||e.target.classList.contains(VE)||!je(z(e.target,".e-unboundcell"))&&!t||(this.setActive(o),n={cancel:!1,byKey:!1,byClick:!je(e.target),clickArgs:e},this.parent.notify(yx,n),n.cancel)||z(e.target,".e-inline-edit")&&!this.parent.editSettings.showAddNewRow&&this.parent.editSettings.showAddNewRow&&!this.parent.element.querySelector(".e-editedrow")||(this.setActive(o),this.getContent()&&!1!==this.getContent().onClick(e,t)&&(this.focus(),this.currentInfo.element.classList.contains("e-rowcell")&&e.type&&"click"===e.type&&!i&&U([this.currentInfo.element],["e-focused","e-focus"]),i)&&e&&e.target&&U([e.target],["e-focused","e-focus"]))},GM.prototype.handleFilterNavigation=function(e,t,i){e.target===document.querySelector(t)&&"Tab"===e.key&&e.shiftKey?(e.preventDefault(),document.querySelector(i).focus()):e.target!==document.querySelector(i)||"Tab"!==e.key||e.shiftKey||document.activeElement!==document.querySelector(i)||(e.preventDefault(),document.querySelector(t).focus())},GM.prototype.onKeyPress=function(e){if(this.content&&this.content.target&&(this.content.target=null),this.parent.allowPaging){var t=this.parent.pagerModule.pagerObj.element,t=this.parent.pagerModule.pagerObj.getFocusablePagerElements(t,[]);if(this.parent.childGrid&&!A(e.target,"e-gridpager")&&this.allowToPaging(e)&&t.length&&(t[0].tabIndex=0),this.parent.pagerModule.pagerObj.checkPagerHasFocus()){if("shiftTab"===e.action&&t.length&&t[0]===e.target)return this.setActive(!0),s=[this.active.matrix.matrix.length-1,this.active.matrix.matrix[this.active.matrix.matrix.length-1].length-1],0===this.active.matrix.matrix[s[0]][s[1]]&&(s=OF(this.active.matrix.matrix,s,!1)),this.active.matrix.current="Batch"!==this.parent.editSettings.mode||this.isValidBatchEditCell(s)?s:this.findBatchEditCell(s,!1),e.preventDefault(),void this.focus(e);if("tab"!==e.action||!this.parent.element.classList.contains("e-childgrid")||(this.parent.pageSettings.pageSizes||!t.length||t[t.length-1]!==e.target)&&this.parent.pagerModule.pagerObj.getDropDownPage()!==e.target)return void this.parent.pagerModule.pagerObj.changePagerFocus(e);t=A(this.parent.element,"e-detailcell");q([this.parent.element],["e-focus"]),q([t],["e-focused"]),t.tabIndex=-1}if(0===this.parent.pagerModule.pagerObj.element.tabIndex&&(38===e.keyCode||e.shiftKey&&9===e.keyCode))return e.preventDefault(),void this.focus(e);if(0===this.parent.pagerModule.pagerObj.element.tabIndex&&9===e.keyCode)return e.preventDefault(),void this.parent.pagerModule.pagerObj.setPagerFocus();this.parent.pagerModule.pagerObj.checkFirstPagerFocus()&&(t=this.getContent().matrix.rows,i=this.getContent().matrix.columns,this.getContent().matrix.current=[t,i])}if("Excel"===this.parent.filterSettings.type&&this.handleFilterNavigation(e,".e-excelfilter .e-menu-item:not(.e-disabled)",".e-excelfilter .e-footer-content button:nth-child(2)"),"CheckBox"===this.parent.filterSettings.type&&(i=(t=this.parent.getColumnByUid(this.focusedColumnUid))&&t.filter&&t.filter.hideSearchbox?".e-chk-hidden":".e-searchinput.e-input",this.handleFilterNavigation(e,i,".e-checkboxfilter .e-footer-content button:nth-child(2)")),"Menu"===this.parent.filterSettings.type&&this.handleFilterNavigation(e,".e-flmenu .e-input-group.e-popup-flmenu",".e-flmenu .e-footer-content button:nth-child(2)"),this.parent.showColumnChooser&&this.handleFilterNavigation(e,".e-ccdlg .e-ccsearch.e-cc.e-input",".e-ccdlg .e-footer-content button:nth-child(2)"),!this.skipOn(e)){if(e.target&&A(e.target,"e-gridcontent")&&(i=(t=[].slice.call(this.parent.getContentTable().rows))[t.length-1].lastElementChild,e.target===i)&&(this.setActive(!0),this.setLastContentCellActive()),"shiftTab"===e.action&&e.target&&(e.target===this.parent.element||A(e.target,"e-toolbar")||A(e.target,"e-groupdroparea"))){if(e.target===this.parent.element)return void(this.parent.element.classList.contains("e-childgrid")&&this.focusOutFromChildGrid(e));if(A(e.target,"e-groupdroparea"))return void(this.parent.element.classList.contains("e-childgrid")&&(e.preventDefault(),this.parent.element.focus()));if(A(e.target,"e-toolbar"))return void(this.parent.allowGrouping&&this.parent.groupSettings.showDropArea?(n=(o=this.parent.groupModule).getFocusableGroupedItems(),e.preventDefault(),(0<n.length?n[n.length-1]:o.element).focus()):this.parent.element.classList.contains("e-childgrid")&&(e.preventDefault(),this.parent.element.focus()))}t=!1;if("tab"===e.action&&e.target&&(e.target===this.parent.element||A(e.target,"e-toolbar")||A(e.target,"e-groupdroparea"))){if(this.parent.allowGrouping&&this.parent.groupSettings.showDropArea&&(e.target===this.parent.element||e.target.classList.contains("e-groupdroparea"))){if(0<(n=(o=this.parent.groupModule).getFocusableGroupedItems()).length)return e.preventDefault(),void n[0].focus();if(!e.target.classList.contains("e-groupdroparea"))return e.preventDefault(),void o.element.focus()}if((this.parent.toolbar||this.parent.toolbarTemplate)&&(e.target===this.parent.element||A(e.target,"e-groupdroparea")||e.target.classList.contains("e-toolbar"))){var i=this.parent.toolbarModule.element,n=this.parent.toolbarModule.getFocusableToolbarItems();if(0<n.length)return e.preventDefault(),void n[0].querySelector(".e-toolbar-item-focus,.e-btn,.e-input").focus();if(!e.target.classList.contains("e-toolbar"))return e.preventDefault(),void i.focus()}(e.target===this.parent.element||A(e.target,"e-toolbar")||A(e.target,"e-groupdroparea"))&&(t=!0)}t&&(this.parent.allowGrouping&&!je(this.parent.groupSettings.columns)&&this.parent.groupSettings.columns.length===this.parent.columns.length?this.setActive(!0):this.setActive(!1),this.active.matrix.current=[0,-1]),this.activeKey=e.action;var o={cancel:!1,byKey:!0,byClick:!1,keyArgs:e};if(this.parent.notify(yx,o),!o.cancel){n=this.getContent().matrix.current,i=this.active&&this.active.matrix.current?[this.active.matrix.current[0],this.active.matrix.current[1]]:void 0,o=(this.currentInfo.outline=!0,this.getContent().jump(e.action,n)),o=((this.swap=o).swap&&("Batch"!==this.parent.editSettings.mode||"tab"!==e.action&&"shiftTab"!==e.action)&&(this.setActive(!o.toHeader),this.getContent().matrix.current=this.getContent().getNextCurrent(n,o,this.active,e.action),this.prevIndexes={}),this.setActiveByKey(e.action,this.getContent()),!this.content.lastIdxCell&&this.getContent().onKeyPress(e));if(e.target&&A(e.target,"e-gridheader")){if("tab"===e.action&&n.toString()===this.active.matrix.current.toString()){var r=OF(this.active.matrix.matrix,this.active.matrix.current,!0),s=[this.active.matrix.matrix.length-1,this.active.matrix.matrix[this.active.matrix.matrix.length-1].length-1],a=(0===this.active.matrix.matrix[s[0]][s[1]]&&(s=OF(this.active.matrix.matrix,s,!1)),R(r[0]+".cells."+r[1],this.active.matrix.getRowsFromIndex(r[0],this.active)));if(a&&0===a.getBoundingClientRect().width&&this.active.matrix.matrix.length-1===r[0]&&(s=this.active.matrix.nextVisibleCellFocus(r[0],r[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),this.active.matrix.current.toString()===s.toString()&&this.content.matrix.matrix.length){this.setActive(o=!0);var l=[0,0];if(this.parent.allowPaging&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer")&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer").setAttribute("aria-hidden","true"),(h=R((l=0===this.active.matrix.matrix[l[0]][l[1]]?OF(this.active.matrix.matrix,[0,0],!0):l)[0]+".cells."+l[1],this.active.matrix.getRowsFromIndex(l[0],this.active)))&&0===h.getBoundingClientRect().width&&(l=this.active.matrix.nextVisibleCellFocus(l[0],l[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),this.active.matrix.current="Batch"!==this.parent.editSettings.mode||this.isValidBatchEditCell(l)?l:this.findBatchEditCell(l,!0),this.parent.enableVirtualization&&!this.parent.enableColumnVirtualization&&1!==this.parent.contentModule.prevInfo.blockIndexes[0])return e.preventDefault(),this.removeFocus(),(a=this.parent.contentModule).firstCellFocus=!0,void(a.content.scrollTop=0)}else this.active.matrix.current.toString()!==r.toString()&&(this.active.matrix.current=r)}if("shiftTab"===e.action&&n.toString()===this.active.matrix.current.toString()){var s=OF(this.active.matrix.matrix,this.active.matrix.current,!1),a=R(s[0]+".cells."+s[1],this.active.matrix.getRowsFromIndex(s[0],this.active));if((s=a&&0===a.getBoundingClientRect().width&&0===s[0]?this.active.matrix.nextVisibleCellFocus(s[0],s[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1]):s).toString()===this.active.matrix.current.toString())return void this.focusOutFromHeader(e);this.active.matrix.current.toString()===s.toString()||o||(o=!0,(r=R(s[0]+".cells."+s[1],this.active.matrix.getRowsFromIndex(s[0],this.active)))&&0===r.getBoundingClientRect().width&&0===s[0]&&(s=this.active.matrix.nextVisibleCellFocus(s[0],s[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),this.active.matrix.current=s)}}if(e.target&&A(e.target,"e-gridcontent")&&(this.parent.allowPaging&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer")&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer").removeAttribute("aria-hidden"),"Batch"!==this.parent.editSettings.mode||"tab"!==e.action&&"shiftTab"!==e.action||(this.active.matrix.current=this.findBatchEditCell(i,"tab"===e.action),"tab"===e.action&&i.toString()===this.active.matrix.current.toString()&&(this.parent.editModule.editModule.addBatchRow=!0)),"shiftTab"===e.action)&&n.toString()===this.active.matrix.current.toString()){if(this.parent.allowGrouping&&!je(this.parent.groupSettings.columns)&&this.parent.groupSettings.columns.length===this.parent.columns.length)return void this.focusOutFromHeader(e);var h,l=[0,0];(h=R((l=0===this.active.matrix.matrix[l[0]][l[1]]?OF(this.active.matrix.matrix,[0,0],!0):l)[0]+".cells."+l[1],this.active.matrix.getRowsFromIndex(l[0],this.active)))&&0===h.getBoundingClientRect().width&&(l=this.active.matrix.nextVisibleCellFocus(l[0],l[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),o||l.toString()!==this.active.matrix.current.toString()&&("Batch"!==this.parent.editSettings.mode||i.toString()!==this.active.matrix.current.toString())||(this.setActive(!(o=!0)),this.setLastContentCellActive())}if(!1===o){if(this.clearIndicator(),"shiftTab"===e.action&&n.toString()===[0,0].toString()&&(this.parent.element.tabIndex=-1),this.parent.allowPaging&&!this.parent.pagerModule.pagerObj.checkPagerHasFocus()&&this.allowToPaging(e)&&n.toString()!==[0,0].toString()){if(e.preventDefault(),40===e.keyCode)return void this.parent.pagerModule.pagerObj.setPagerContainerFocus();if(9===e.keyCode)return void this.parent.pagerModule.pagerObj.setPagerFocus()}this.parent.element.classList.contains("e-childgrid")&&this.focusOutFromChildGrid(e)}else this.header.action=e.action,this.header.currentTarget=null,this.header.focusType="key",e.target&&A(e.target,"e-fltrtemp")&&("tab"===e.action||"shiftTab"===e.action)&&(a=e.target,(r=[].slice.call(z(a,"th").querySelectorAll(".e-fltrtemp-focus"))).length)&&(s=r.indexOf(a),"tab"===e.action&&s<r.length-1||"shiftTab"===e.action&&0<s)&&(this.setActive(!1),this.active.matrix.current=n,this.active.currentTarget=a),t&&A(this.active.getTable(),"e-gridheader")&&e.target&&e.target.id===this.parent.element.id+"_searchbar"&&(this.parent.searchModule.headerFocus=!0),e.preventDefault(),this.focus(e)}}},GM.prototype.isValidBatchEditCell=function(e){var t=this.active.getTable().rows[e[0]].cells[e[1]],i=z(t,"tr"),t=parseInt(t.getAttribute("aria-colindex"),10)-1,t=this.parent.getColumns()[parseInt(t.toString(),10)];return!(1!==this.active.matrix.matrix[e[0]][e[1]]||i.classList.contains("e-row")&&(!i.classList.contains("e-insertedrow")&&t.isPrimaryKey||!t.allowEditing))},GM.prototype.findBatchEditCell=function(e,t,i){for(var n=e,o=e,r=!1;!r;){var s=o,a=R((o=OF(this.active.matrix.matrix,o,t))[0]+".cells."+o[1],this.active.getTable().rows);a&&0===a.getBoundingClientRect().width&&(o=this.active.matrix.nextVisibleCellFocus(o[0],o[1],this.activeKey,this.active.keyActions[this.activeKey],this.active,this.active.matrix.current[1])),s.toString()===o.toString()||i&&s[0]!==o[0]?r=!0:this.isValidBatchEditCell(o)&&(n=o,r=!0)}return n},GM.prototype.setLastContentCellActive=function(){var e=[this.active.matrix.matrix.length-1,this.active.matrix.matrix[this.active.matrix.matrix.length-1].length-1],t=R((e=0===this.active.matrix.matrix[e[0]][e[1]]?OF(this.active.matrix.matrix,e,!1):e)[0]+".cells."+e[1],this.active.matrix.getRowsFromIndex(e[0],this.active));t&&0===t.getBoundingClientRect().width&&(e=this.active.matrix.nextVisibleCellFocus(e[0],e[1],this.activeKey,this.active.keyActions[this.activeKey],this.active,this.active.matrix.current[1])),this.active.matrix.current=e},GM.prototype.focusOutFromChildGrid=function(e){var t,i=A(this.parent.element,"e-table"),n=A(i,"e-grid").ej2_instances[0],i=A(this.parent.element,"e-detailcell"),o=A(this.parent.element,"e-detailrow").getAttribute("data-uid"),r=[].slice.call(n.getContentTable().rows),s=r.map(function(e){return e.getAttribute("data-uid")}).indexOf(o);if(!("tab"===e.action&&s>=r.length-1)){if(q([this.parent.element],["e-focus"]),q([i],["e-focused"]),i.tabIndex=-1,e.preventDefault(),n.focusModule.removeFocus(),"shiftTab"===e.action){for(var a=r[s-1].cells,l=a.length-1;0<=l;l--)if(!(t=a[parseInt(l.toString(),10)]).classList.contains("e-hide")){n.focusModule.active.matrix.current=[s-1,l];break}}else t=r[s+1].cells[0],n.focusModule.active.matrix.current=[s+1,0];n.focusModule.currentInfo.element=t,U([n.focusModule.currentInfo.elementToFocus=t],["e-focused","e-focus"]),t.tabIndex=0,t.focus()}},GM.prototype.focusOutFromHeader=function(e){var t,i;this.removeFocus(),this.parent.toolbar||this.parent.toolbarTemplate?(i=this.parent.toolbarModule.element,t=this.parent.toolbarModule.getFocusableToolbarItems(),e.preventDefault(),(0<t.length?t[t.length-1].querySelector(".e-toolbar-item-focus,.e-btn,.e-input"):i).focus()):this.parent.allowGrouping&&this.parent.groupSettings.showDropArea?(i=(t=this.parent.groupModule).getFocusableGroupedItems(),e.preventDefault(),(0<i.length?i[i.length-1]:t.element).focus()):this.parent.element.classList.contains("e-childgrid")&&(e.preventDefault(),this.parent.element.focus())},GM.prototype.allowToPaging=function(e){return"Batch"!==this.parent.editSettings.mode||!this.parent.editSettings.allowAdding||40===e.keyCode},GM.prototype.skipOn=function(e){var t=e.target;if(!t)return!1;if(!this.parent.isEdit&&t&&t.closest(".e-unboundcell")&&this.currentInfo.skipAction&&("shiftTab"===e.action&&this.commandColumnFocusElement(t.closest(".e-unboundcell"),!1)===t||"tab"===e.action&&this.commandColumnFocusElement(t.closest(".e-unboundcell"),!0)===t))return this.currentInfo.skipAction=!1;if(this.currentInfo.skipAction)return this.clearIndicator(),!0;if(-1<["pageUp","pageDown","altDownArrow"].indexOf(e.action))return this.clearIndicator(),!0;if(this.parent.allowGrouping){var i=this.parent.groupModule.getFocusableGroupedItems();if(A(e.target,"e-groupheadercell")&&!(e.target===i[0]&&"shiftTab"===e.action||e.target===i[i.length-1]&&"tab"===e.action))return!0}if(this.parent.toolbar||this.parent.toolbarTemplate){i=this.parent.toolbarModule.element.querySelectorAll(".e-toolbar-item:not(.e-overlay):not(.e-hidden)");if(A(e.target,"e-toolbar-item")&&!(0<i.length&&(A(e.target,"e-toolbar-item")===i[0]&&"shiftTab"===e.action||A(e.target,"e-toolbar-item")===i[i.length-1]&&"tab"===e.action)))return!0}var n,o,r,i=z(t,"th")&&!z(t,"th").tabIndex,s=(!e.target.classList.contains("e-filterbaroperator")||13!==e.keyCode&&27!==e.keyCode||(r=z(e.target,".e-filterbarcell")).querySelector("input").focus(),this.parent.editSettings.showAddNewRow&&null!==z(document.activeElement,".e-addedrow")),i=((i&&null!==z(document.activeElement,".e-filterbarcell")||s)&&this.removeFocus(),null!==z(document.activeElement,".e-filterbarcell"));return this.parent.enableHeaderFocus&&i&&(o=(n=this.active.matrix).current,i=n.matrix[o[0]].lastIndexOf(1)!==o[1]),!this.parent.isEdit||"tab"!==e.action&&"shiftTab"!==e.action||"Normal"!==this.parent.editSettings.mode||this.parent.editSettings.showAddNewRow||je(A(t,"e-addedrow"))||(n=this.parent.editModule.formObj.element.querySelectorAll('input:not([type="hidden"],.e-numeric-hidden,.e-disabled), select:not([aria-hidden="true"]), button:not(.e-hide), textarea:not(.e-hide,.e-disabled,[disabled])'),r=t.classList.contains("e-ddl")?t.querySelector("input"):t,o="tab"===e.action&&r===n[n.length-1],r="shiftTab"===e.action&&r===n[0],(o||r)&&(e.preventDefault(),(r=(r=n[o?0:n.length-1]).parentElement.classList.contains("e-ddl")?r.parentElement:r).focus())),"delete"===e.action||"Batch"!==this.parent.editSettings.mode&&(this.parent.isEdit&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&(!je(this.parent.element.querySelector(".e-editedrow"))||!je(A(t,"e-addedrow"))&&!je(z(e.target,"input"))&&!je(document.querySelector(".e-popup-open"))||!je(A(t,"e-addedrow"))&&t&&!t.querySelector(".e-cancel-icon")&&!je(A(t,"e-unboundcell"))))||-1<["insert","f2"].indexOf(e.action))||i&&this.parent.enableHeaderFocus||(i||s)&&"tab"!==e.action&&"shiftTab"!==e.action||null!==z(document.activeElement,"#"+this.parent.element.id+"_searchbar")&&-1<["enter","leftArrow","rightArrow","shiftLeft","shiftRight","ctrlPlusA"].indexOf(e.action)||null===z(t,"."+OE)&&null===z(t,"."+RE)&&!(e.target===this.parent.element||A(e.target,"e-toolbar")||A(e.target,"e-groupdroparea"))||"space"===e.action&&!t.classList.contains(qE)&&null===z(t,"."+qE)&&null===z(t,".e-headerchkcelldiv")||null!==z(t,".e-filter-popup")},GM.prototype.focusVirtualElement=function(e){var t,i,n,o=this;(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&(this.parent.notify(nT,t={virtualData:{},isAdd:!1,isCancel:!1}),i=this.actions.some(function(e){return e===o.activeKey}),n=!!this.parent.contentModule&&-1<this.parent.contentModule.selectedRowIndex,t.isAdd||Object.keys(t.virtualData).length||i||t.isCancel||n?(this.parent.notify($T,{isCancel:!1}),t.isCancel=!1,(!this.parent.enableVirtualization||e&&("ctrlHome"===e.action||"ctrlEnd"===e.action))&&this.parent.enableVirtualization||(this.parent.contentModule.selectedRowIndex=-1),i&&(this.activeKey=this.empty,this.parent.notify("virtaul-key-handler",e)),this.currentInfo.elementToFocus.focus({preventScroll:!0})):this.isVirtualScroll||this.isInfiniteScroll?this.currentInfo.elementToFocus.focus({preventScroll:!0}):this.currentInfo.elementToFocus.focus()),this.isVirtualScroll=this.isInfiniteScroll=!1},GM.prototype.getFocusedElement=function(){return this.currentInfo.elementToFocus},GM.prototype.getContent=function(){return this.active||this.content},GM.prototype.setActive=function(e){this.active=e?this.content:this.header},GM.prototype.setFocusedElement=function(e,t){var i=this;this.currentInfo.elementToFocus=e,setTimeout(function(){var e;je(i.currentInfo.elementToFocus)||(e=je(i.parent.element.querySelector(".e-flmenu"))?document.querySelector(".e-grid-popup .e-flmenu"):i.parent.element.querySelector(".e-flmenu"),(i.parent.enableVirtualization||i.parent.enableInfiniteScrolling)&&je(e)?i.focusVirtualElement(t):!je(e)&&A(document.activeElement,"e-flmenu-valuediv")===e.querySelector(".e-flmenu-valuediv")||i.currentInfo.elementToFocus.focus())},0)},GM.prototype.focus=function(e){this.parent.notify(XI,e),this.removeFocus(),this.addFocus(this.getContent().getFocusInfo(),e)},GM.prototype.removeFocus=function(e){var t;this.currentInfo.element&&(!this.parent.isReact||this.parent.isEdit||!this.currentInfo.element.classList.contains("e-rowcell")||this.currentInfo.element.parentElement||this.parent.allowGrouping&&!je(this.parent.groupSettings.columns)&&this.parent.groupSettings.columns.length||!this.parent.getRowByIndex(this.prevIndexes.rowIndex)||(t=this.parent.getCellFromIndex(this.prevIndexes.rowIndex,this.prevIndexes.cellIndex),this.currentInfo.element=t||this.currentInfo.element),q([this.currentInfo.element,this.currentInfo.elementToFocus],["e-focused","e-focus"]),this.currentInfo.element.tabIndex=-1)},GM.prototype.addOutline=function(){var e=this.getContent().getFocusInfo();e.element&&(U([e.element],["e-focused"]),U([e.elementToFocus],["e-focus"]))},GM.prototype.focusHeader=function(){this.setActive(!1),this.resetFocus()},GM.prototype.focusContent=function(){this.setActive(!0),this.resetFocus()},GM.prototype.resetFocus=function(){var e=this.getContent().matrix.get(0,-1,[0,1],null,this.getContent().validator());this.getContent().matrix.select(e[0],e[1]),this.focus()},GM.prototype.addFocus=function(e,t){var i;this.currentInfo=e,this.currentInfo.outline=e.outline&&(!je(t)||this.isVirtualScroll),this.isInfiniteScroll&&(this.currentInfo.outline=!0),!e.element||(i=e.elementToFocus.classList.contains("e-focus"))||(this.currentInfo.outline&&U([e.element],["e-focused"]),U([e.elementToFocus],["e-focus"]),e.element.tabIndex=0,i||this.setFocusedElement(e.elementToFocus,t),this.parent.notify(vx,{element:e.elementToFocus,parent:e.element,indexes:this.getContent().matrix.current,byKey:!je(t),byClick:je(t),keyArgs:t,isJump:this.swap.swap,container:this.getContent().getInfo(t),outline:!je(t),swapInfo:this.swap}),e=(i=this.getContent().matrix.current)[0],t=i[1],this.prevIndexes={rowIndex:e,cellIndex:t},this.focusedColumnUid=this.parent.getColumnByIndex(t).uid,this.focusByClick=!1)},GM.prototype.refreshMatrix=function(c){var u=this;return function(e){c&&!u.content&&(u.content=new KM(u.parent)),c||u.header||(u.header=new $M(u.parent));var t=c?u.content:u.header,i=0;if((n=u.parent.frozenRows)&&"Batch"===u.parent.editSettings.mode&&(i=u.parent.getHeaderContent().querySelectorAll(".e-insertedrow").length+u.parent.getHeaderContent().querySelectorAll(".e-hiddenrow").length),!je(u.parent.groupSettings.columns)&&u.parent.groupSettings.columns.length&&n&&c){for(var n=0,o=0;o<e.rows.length&&(n++,e.rows[parseInt(o.toString(),10)].index+1!==u.parent.frozenRows);o++);u.groupedFrozenRow=n}var r,s,a,l=c?e.rows.slice(n+i):e.rows,i=c?e.rows.slice(0,n+i):e.rows,h=(u.parent.isCollapseStateEnabled()&&c&&(l=l.filter(function(e){return!1!==e.visible})),!je(u.parent.rowTemplate)),d=(n&&("Batch"===u.parent.editSettings.mode&&c&&("batchDelete"===e.name||"batchAdd"===e.name||"batchCancel"===e.name||e.args&&"batchsave"===e.args.requestType)||e.args&&("delete"===e.args.requestType||"save"===e.args.requestType))&&(d=u.header.matrix.matrix,p=u.parent.headerModule.rows.length,d.splice(p,d.length-p)),t.matrix.generate(i,t.selector,h)),p=(t.matrix.generate(l,t.selector,h),u.parent.enableVirtualization||u.parent.enableInfiniteScrolling);u.parent.editSettings.showAddNewRow&&c&&u.header&&u.header.matrix&&(!p||u.parent.isAddNewRow)&&(l=u.header.matrix.matrix,h=u.parent.allowFiltering&&"FilterBar"===u.parent.filterSettings.type?2:1,t.matrix.rows=u.parent.frozenRows&&"Top"===u.parent.editSettings.newRowPosition?t.matrix.rows:++t.matrix.rows,"Top"===u.parent.editSettings.newRowPosition?(u.parent.frozenRows||p?d:t.matrix.matrix).unshift(u.refreshAddNewRowMatrix(l[l.length-h])):t.matrix.matrix.push(u.refreshAddNewRowMatrix(l[l.length-h])),u.parent.isAddNewRow=!1),(!u.parent.isFrozenGrid()||!e.args||"sorting"!==e.args.requestType&&"batchsave"!==e.args.requestType&&"paging"!==e.args.requestType||n&&"Batch"===u.parent.editSettings.mode&&c&&("batchDelete"===e.name||"batchAdd"===e.name||"batchCancel"===e.name||"batchsave"===e.args.requestType))&&t.generateRows(i,{matrix:d,handlerInstance:u.header}),!F.isDevice&&e&&e.args&&(u.focusByClick||"paging"!==e.args.requestType||u.parent.pagerModule.pagerObj.checkPagerHasFocus()||(u.skipFocus=!1,u.parent.element.focus()),"grouping"===e.args.requestType)&&(u.skipFocus=!0),e&&e.args&&"virtualscroll"===e.args.requestType&&(u.currentInfo.uid?e.rows.some(function(e,t){return r=t,e.uid===u.currentInfo.uid})&&(u.content.matrix.current[0]=r,u.content.matrix.current[1]=u.parent.getColumnIndexByUid(u.focusedColumnUid)||0,p=u.parent.getVisibleFrozenLeftCount(),l=u.parent.getVisibleFrozenRightCount(),!u.parent.enableColumnVirtualization||p&&l||!u.parent.isFrozenGrid()||"right"!==e.args.virtualInfo.direction||(u.content.matrix.current[1]=u.content.matrix.current[1]-(p+(l?l+1:0))),(h=!(!u.parent.allowGrouping||!u.parent.groupSettings.columns.length))&&(u.content.matrix.current[1]=u.prevIndexes.cellIndex,u.virtualSelectionInfo.isPending)&&(u.content.matrix.current[0]="downArrow"===u.virtualSelectionInfo.direction?u.content.matrix.current[0]+1:u.content.matrix.current[0]-1),a=u.getContent().getFocusInfo().elementToFocus)&&(t=a.getBoundingClientRect(),i=u.parent.element.getBoundingClientRect(),s=d=0,!u.parent.enableColumnVirtualization||p&&l||!u.parent.isFrozenGrid()||"right"!==e.args.virtualInfo.direction||(p?d=u.parent.leftrightColumnWidth("left"):s=u.parent.leftrightColumnWidth("right")),0<=t.top&&0<=t.left&&t.right-d-s<=Math.min(i.right,window.innerWidth||document.documentElement.clientWidth)+s&&t.bottom<=Math.min(i.bottom,window.innerHeight||document.documentElement.clientHeight)||h)&&(u.isVirtualScroll=!0,u.focus(h&&u.virtualSelectionInfo.isPending?u.virtualSelectionInfo.event:void 0)):e.args.focusElement&&e.args.focusElement.classList.contains("e-filtertext")&&(a=u.parent.element.querySelector("#"+e.args.focusElement.id))&&a.focus(),u.virtualSelectionInfo={}),e&&e.args&&"infiniteScroll"===e.args.requestType&&(u.isInfiniteScroll=!0)}},GM.prototype.refreshAddNewRowMatrix=function(e){for(var t=this.parent.getColumns(),i=this.parent.getIndentCount(),n=i;n<e.length-1;n++)t[n-i]&&t[n-i].visible&&t[n-i].allowEditing?e[parseInt(n.toString(),10)]=1:e[parseInt(n.toString(),10)]=0;return e},GM.prototype.addEventListener=function(){var t=this;this.parent.isDestroyed||(E.add(this.parent.element,"mousedown",this.focusCheck,this),E.add(this.parent.element,"touchstart",this.focusCheck,this),E.add(this.parent.element,"focus",this.onFocus,this),this.parent.element.addEventListener("focus",this.passiveHandler=function(e){return t.passiveFocus(e)},!0),E.add(this.parent.element,"focusout",this.onBlur,this),this.evtHandlers=[{event:bx,handler:this.onKeyPress},{event:wx,handler:this.onClick},{event:X1,handler:this.refMatrix},{event:OI,handler:this.refMatrix},{event:QT,handler:this.refMatrix},{event:wE,handler:this.showAddNewRowFocus},{event:tx,handler:this.refreshMatrix()},{event:ZT,handler:this.restoreFocus},{event:qI,handler:this.restoreFocus},{event:"start-edit",handler:this.clearIndicator},{event:"start-add",handler:this.clearIndicator},{event:"sorting-complete",handler:this.restoreFocus},{event:"filtering-complete",handler:this.filterfocus},{event:"custom-filter-close",handler:this.filterfocus},{event:"grouping-complete",handler:this.restoreFocusWithAction},{event:"ungrouping-complete",handler:this.restoreFocusWithAction},{event:f1,handler:this.refMatrix},{event:y1,handler:this.refMatrix},{event:v1,handler:this.refMatrix},{event:g1,handler:this.refMatrix},{event:J1,handler:this.refMatrix},{event:vx,handler:this.internalCellFocus}],CF(this.parent,this.evtHandlers,!0,this))},GM.prototype.showAddNewRowFocus=function(){var e,t,i;this.parent.editSettings.showAddNewRow&&(e="Top"===this.parent.editSettings.newRowPosition?0:this.content.matrix.matrix.length-1,t=this.parent.getIndentCount(),"Top"===this.parent.editSettings.newRowPosition&&(this.parent.frozenRows||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?(i=this.header.matrix.matrix.length-(this.groupedFrozenRow||this.parent.frozenRows),t=this.findNextCellFocus(this.header.matrix.matrix[i-1],t),this.header.matrix.current=[i-1,t],this.active=this.header):(t=this.findNextCellFocus(this.content.matrix.matrix[parseInt(e.toString(),10)],t),this.content.matrix.current=[e,t],this.active=this.content),i=this.parent.element.querySelector(".e-addedrow"))&&i.querySelectorAll("tr")&&i.querySelector("tr").cells[parseInt(t.toString(),10)].querySelector("input")&&i.querySelector("tr").cells[parseInt(t.toString(),10)].querySelector("input").select()},GM.prototype.findNextCellFocus=function(e,t){for(var i=t;i<e.length;i++)if(1===e[parseInt(i.toString(),10)])return i;return t},GM.prototype.filterfocus=function(){"FilterBar"!==this.parent.filterSettings.type&&(this.removeFocus(),this.restoreFocus())},GM.prototype.removeEventListener=function(){this.parent.isDestroyed||(E.remove(this.parent.element,"mousedown",this.focusCheck),E.remove(this.parent.element,"touchstart",this.focusCheck),E.remove(this.parent.element,"focus",this.onFocus),E.remove(this.parent.element,"focusout",this.onBlur),this.parent.element.removeEventListener("focus",this.passiveHandler,!0),CF(this.parent,this.evtHandlers,!1))},GM.prototype.destroy=function(){this.removeEventListener()},GM.prototype.restoreFocus=function(e){var t;e&&"sorting"===e.requestType&&je(e.target)||(t=this.parent.groupModule,this.parent.allowGrouping&&t&&(t.groupSortFocus||t.groupTextFocus)?(t.groupSortFocus=!1,t.groupTextFocus=!1):(this.firstHeaderCellClick=!0,this.addFocus(this.getContent().getFocusInfo()),t=this.getContent().getFocusInfo(),e&&-1<["add","save","delete","cancel","batchsave","batchDelete","batchCancel"].indexOf(e.requestType)&&t&&t.elementToFocus&&t.elementToFocus.matches(".e-rowcell.e-focus")&&U([t.elementToFocus],["e-focused","e-focus"])))},GM.prototype.restoreFocusWithAction=function(e){if(!(this.parent.enableInfiniteScrolling||this.parent.groupModule&&this.parent.groupModule.preventFocusOnGroup)){var t=this.getContent().matrix,i=t.current;switch(e.requestType){case"grouping":case"ungrouping":i[1]=!i.length||this.parent.groupSettings.showGroupedColumn||je(t.matrix[i[0]])?"grouping"===e.requestType?i[1]+1:i[1]-1:t.matrix[i[0]].indexOf(1)}this.getContent().matrix.current=i,this.prevIndexes={rowIndex:i[0],cellIndex:i[1]};var n,o=this.parent.groupModule;this.parent.allowGrouping&&o&&o.groupCancelFocus?(((n=o.getFocusableGroupedItems()).length?n[0].parentElement.getAttribute("ej-mappingname")===e.columnName?n[3]:n[0]:o.element).focus(),o.groupCancelFocus=!1):this.addFocus(this.getContent().getFocusInfo())}},GM.prototype.clearIndicator=function(){this.currentInfo.element&&this.currentInfo.elementToFocus&&q([this.currentInfo.element,this.currentInfo.elementToFocus],["e-focus","e-focused"])},GM.prototype.getPrevIndexes=function(){var e=this.forget;return this.forget=!1,e||!Object.keys(this.prevIndexes).length?{rowIndex:null,cellIndex:null}:this.prevIndexes},GM.prototype.forgetPrevious=function(){this.forget=!0},GM.prototype.setActiveByKey=function(e,t){var i,n;0!==this.parent.frozenRows&&e in(n={home:function(){return{toHeader:!i.isContent,toFrozen:!0}},end:function(){return{toHeader:!i.isContent,toFrozen:!1}},ctrlHome:function(){return{toHeader:!0,toFrozen:!1}},ctrlEnd:function(){return{toHeader:!1,toFrozen:!1}}})&&(i=t.getInfo(),n=n[""+e](),this.setActive(!n.toHeader),this.getContent().matrix.current=t.matrix.current)},GM.prototype.internalCellFocus=function(e){e.byKey&&e.container.isContent&&("enter"===e.keyArgs.action&&e.parent.classList.contains("e-detailcell")||("tab"===e.keyArgs.action||"shiftTab"===e.keyArgs.action)&&e.parent.classList.contains("e-unboundcell"))&&(this.clearIndicator(),e=e.parent&&e.parent.closest(".e-unboundcell")&&"shiftTab"===e.keyArgs.action?this.commandColumnFocusElement(e.parent,!0):this.getContent().getFocusable(this.getFocusedElement()),this.setFocusedElement(e),this.currentInfo.skipAction=!0)},GM.prototype.commandColumnFocusElement=function(e,t){e=e.querySelectorAll("button:not(.e-hide)");return t?e[e.length-1]:e[0]},GM);function GM(e){this.currentInfo={},this.oneTime=!0,this.swap={},this.isInfiniteScroll=!1,this.virtualSelectionInfo={},this.forget=!1,this.skipFocus=!0,this.focusByClick=!1,this.firstHeaderCellClick=!1,this.prevIndexes={},this.refMatrix=this.refreshMatrix(!0),this.actions=["downArrow","upArrow"],this.isVirtualScroll=!1,this.groupedFrozenRow=0,this.parent=e,this.rowModelGen=new bD(this.parent),this.addEventListener()}XM.prototype.set=function(e,t,i){e=Math.max(0,Math.min(e,this.rows)),t=Math.max(0,Math.min(t,this.columns)),this.matrix[parseInt(e.toString(),10)]=this.matrix[parseInt(e.toString(),10)]||[],this.matrix[parseInt(e.toString(),10)][parseInt(t.toString(),10)]=i?1:0},XM.prototype.get=function(e,t,i,n,o,r){var s=t;if(e+i[0]<0)return[e,t];e=Math.max(0,Math.min(e+i[0],this.rows));var a=!0;if(je(this.matrix[parseInt(e.toString(),10)]))return null;if(t=Math.max(0,Math.min(t+i[1],this.matrix[parseInt(e.toString(),10)].length-1)),s+i[1]>this.matrix[parseInt(e.toString(),10)].length-1&&o(e,t,n))return[e,s];var l,h=this.first(this.matrix[parseInt(e.toString(),10)],t,i,!0,n),d=R(e+"."+(t=null===h?s:h),this.matrix);if(e!==this.rows||"downArrow"!==n&&"enter"!==n||(i[0]=-1),(l=r?R(e+".cells."+t,this.getRowsFromIndex(e,r)):l)&&0===l.getBoundingClientRect().width&&(e=(l=this.nextVisibleCellFocus(e,t,n,i,r,s))[0],t=l[1]),null===h){for(var p=0;p<this.rows;p++)if(this.matrix[parseInt(p.toString(),10)].some(function(e){return 1===e})){a=!1;break}if(a)return[e=this.current.length?this.current[0]:0,t]}return this.inValid(d)||!o(e,t,n)?this.get(e,s,i,n,o):[e,t]},XM.prototype.getRowsFromIndex=function(e,t){return(t.getTable().rows[parseInt(e.toString(),10)].classList.contains("e-addedrow")?t.getTable().rows[parseInt(e.toString(),10)].querySelector("table"):t.getTable()).rows},XM.prototype.nextVisibleCellFocus=function(e,t,i,n,o,r){var s=this.getRowsFromIndex(e,o),a=R(e+".cells."+t,s),l=o.matrix.matrix,h=l.length-1,d="tab"===i,p="shiftTab"===i,c="enter"===i||"shiftEnter"===i||"downArrow"===i||"upArrow"===i;if(!c)for(;a&&0===a.getBoundingClientRect().width;){if(d&&e===h&&t===l[parseInt(e.toString(),10)].lastIndexOf(1)||p&&0===e&&t===l[parseInt(e.toString(),10)].indexOf(1))return[e,t=r];d?t===l[parseInt(e.toString(),10)].lastIndexOf(1)?(e++,t=l[parseInt(e.toString(),10)].indexOf(1),t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i),s=this.getRowsFromIndex(e,o)):(t++,t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)):p?t===l[parseInt(e.toString(),10)].indexOf(1)?(e--,t=l[parseInt(e.toString(),10)].lastIndexOf(1),t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i),s=this.getRowsFromIndex(e,o)):(t--,t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)):"rightArrow"===i||"shiftRight"===i?t=t===l[parseInt(e.toString(),10)].lastIndexOf(1)?r:(t++,this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)):"leftArrow"===i||"shiftLeft"===i?t=t===l[parseInt(e.toString(),10)].indexOf(1)?r:(t--,this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)):null===i&&(t++,t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)),a=R(e+".cells."+t,s)}return[e,t]},XM.prototype.first=function(e,t,i,n,o){return(t<0||t===e.length)&&this.inValid(e[parseInt(t.toString(),10)])&&"upArrow"!==o&&"downArrow"!==o||!e.some(function(e){return 1===e})?null:this.inValid(e[parseInt(t.toString(),10)])?this.first(e,-1!==["upArrow","downArrow","shiftUp","shiftDown","enter","shiftEnter"].indexOf(o)?n?0:++t:t+i[1],i,!1,o):t},XM.prototype.select=function(e,t){e=Math.max(0,Math.min(e,this.rows)),t=Math.max(0,Math.min(t,this.matrix[parseInt(e.toString(),10)].length-1)),this.current=[e,t]},XM.prototype.generate=function(e,t,i){this.rows=e.length-1,this.matrix=[];for(var n=0;n<e.length;n++){for(var o=e[parseInt(n.toString(),10)].cells.filter(function(e){return!0!==e.isSpanned}),r=(this.columns=Math.max(o.length-1,0|this.columns),0),s=0;s<o.length;s++)o[parseInt(s.toString(),10)].column&&o[parseInt(s.toString(),10)].column.columns?r=this.columnsCount(o[parseInt(s.toString(),10)].column.columns,r):r++,this.set(n,s,!1!==e[parseInt(n.toString(),10)].visible&&t(e[parseInt(n.toString(),10)],o[parseInt(s.toString(),10)],i));this.columns=Math.max(r-1,0|this.columns)}return this.matrix},XM.prototype.columnsCount=function(e,t){for(var i=e,n=t,o=0;o<i.length;o++)i[parseInt(o.toString(),10)].columns?n=this.columnsCount(i[parseInt(o.toString(),10)].columns,n):n++;return n},XM.prototype.inValid=function(e){return 0===e||void 0===e};var YM=XM;function XM(){this.matrix=[],this.current=[]}JM.prototype.getTable=function(){return this.parent.getContentTable()},JM.prototype.onKeyPress=function(e){if(/(Mac)/i.test(navigator.platform)&&e.metaKey)if("home"===e.action)e.action="ctrlHome";else if("end"===e.action)e.action="ctrlEnd";else if(-1!==["downArrow","upArrow","leftArrow","rightArrow"].indexOf(e.action))return;var t=this.keyActions[e.action],t=this.getCurrentFromAction(e.action,t,e.action in this.keyActions,e);if(t){if((-1<["tab","shiftTab"].indexOf(e.action)&&this.matrix.current||[]).toString()===t.toString()||this.parent.allowPaging&&!this.parent.pagerModule.pagerObj.checkPagerHasFocus()&&this.matrix.current[0]===this.matrix.rows&&("Batch"===this.parent.editSettings.mode&&this.parent.editSettings.allowAdding&&40===e.keyCode||40===e.keyCode)){if(t.toString()===[this.matrix.rows,this.matrix.columns].toString()||t.toString()===[0,0].toString()||this.matrix.current[0]===this.matrix.rows&&this.matrix.current.toString()===t.toString()||this.parent.allowGrouping&&this.parent.infiniteScrollSettings.enableCache&&t.toString()===[0,1].toString())return!1;t=this.editNextRow(t[0],t[1],e.action)}this.matrix.select(t[0],t[1])}},JM.prototype.editNextRow=function(e,t,i){var n=this.parent,o=n.editSettings.allowNextRowEdit&&(n.isEdit||n.isLastCellPrimaryKey),r=n.getColumnIndexByField(n.getVisibleColumns()[0].field),s=this.getTable().rows[parseInt(e.toString(),10)],s=(n.editSettings.showAddNewRow&&s.classList.contains("e-addedrow")?s.querySelectorAll("td:not(.e-editcell)"):s.cells)[parseInt(t.toString(),10)];return"tab"===i&&o&&(e++,t=r+(this.getTable().rows[parseInt(e.toString(),10)].getElementsByClassName("e-indentcell").length+this.getTable().rows[parseInt(e.toString(),10)].getElementsByClassName("e-detailrowcollapse").length)),"shiftTab"===i&&o&&(e--,t=n.getColumnIndexByField(n.getVisibleColumns()[n.getVisibleColumns().length-1].field)),s.classList.contains(LE)||s.classList.contains("e-headercell")||s.classList.contains("e-groupcaption")||s.classList.contains("e-filterbarcell")?[e,t]:this.editNextRow(e,t,i)},JM.prototype.getCurrentFromAction=function(e,t,i,n){if(void 0===t&&(t=[0,0]),!i&&!this.indexesByKey(e)||0===this.matrix.current.length)return null;if(!this.shouldFocusChange(n))return this.matrix.current;var i=this.indexesByKey(e)||this.matrix.current.concat(t),o=i[0],r=i[1],n=i[2],t=i[3];if(this.parent.allowGrouping&&!je(this.parent.groupSettings.columns)&&this.parent.groupSettings.columns.length&&this.parent.aggregates.length&&"enter"===e)for(var s=o;s<this.matrix.matrix.length;s++){var a=this.getTable().rows[s+1];if(a&&a.cells[parseInt(r.toString(),10)]&&a.cells[parseInt(r.toString(),10)].classList.contains("e-rowcell"))return[s+1,r];if(s===this.matrix.matrix.length-1)return[o,r]}return"ctrlEnd"!==e&&"end"!==e||(i=[this.matrix.matrix.length-1,this.matrix.matrix[this.matrix.matrix.length-1].length-1],"end"===e&&(i=[o,this.matrix.matrix[parseInt(o.toString(),10)].length-1]),o=(i=0===this.matrix.matrix[i[0]][i[1]]?OF(this.matrix.matrix,i,!1):i)[0],r=i[1]+1),this.matrix.get(o,r,[n,t],e,this.validator(),this)},JM.prototype.onClick=function(e,t){var i,n,o,r,s=e.target,s=(s=(this.target=s).classList.contains(LE)?s:z(s,"td"))||z(e.target,"td.e-detailrowcollapse")||z(e.target,"td.e-detailrowexpand");return!(!(s=(s=z(e.target,"td.e-detailcell")&&je(z(z(e.target,".e-grid"),"td.e-detailcell"))?null:s)&&z(s,"table").classList.contains(QE)?s:null)||(n=s.parentElement.rowIndex,n=[n=this.parent.editSettings.showAddNewRow&&A(s,"e-addedrow")?A(s,"e-addedrow").rowIndex:n,s.cellIndex],o=(s=this.matrix.current)[0],s=s[1],r=R((i=n[0])+"."+(n=n[1]),this.matrix.matrix),this.matrix.inValid(r))||!t&&o===i&&s===n||!(A(e.target,LE)||A(e.target,"e-groupcaption")||A(e.target,"e-recordpluscollapse")||A(e.target,"e-recordplusexpand")||A(e.target,"e-detailrowcollapse")||A(e.target,"e-detailrowexpand")||A(e.target,"e-templatecell")))&&void this.matrix.select(i,n)},JM.prototype.getFocusInfo=function(){var e={},t=this.matrix.current,i=t[0],i=void 0===i?0:i,t=t[1],t=void 0===t?0:t,i=(this.matrix.current=[i,t],this.getTable().rows[parseInt(i.toString(),10)]);return e.element=je(i)?null:(this.parent.editSettings.showAddNewRow&&i.classList.contains("e-addedrow")?i.querySelectorAll("td:not(.e-editcell)"):i.cells)[parseInt(t.toString(),10)],e.element&&(e.elementToFocus=e.element.classList.contains("e-unboundcell")&&!(this.parent.editSettings.showAddNewRow&&e.element.classList.contains("e-unboundcell")&&A(e.element,"e-addedrow"))||e.element.classList.contains("e-detailcell")?e.element:this.getFocusable(e.element),e.elementToFocus=e.element.classList.contains("e-detailcell")&&e.element.querySelector(".e-childgrid")?e.element.querySelector(".e-childgrid"):e.elementToFocus,"Batch"===this.parent.editSettings.mode&&this.parent.isEdit&&"input"===e.elementToFocus.tagName.toLowerCase()&&e.elementToFocus.classList.contains("e-dropdownlist")&&(e.elementToFocus=e.elementToFocus.parentElement),e.outline=!0,e.uid=e.element.parentElement.getAttribute("data-uid")),e},JM.prototype.getFocusable=function(e){var t='button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])',i=!je(z(e,".e-templatecell")),t=(this.parent.isEdit&&(t='input:not([type="hidden"]), select:not([aria-hidden="true"]), textarea'+(this.parent.editSettings.showAddNewRow&&A(e,"e-addedrow")?", button:not(.e-hide)":"")),[].slice.call(e.querySelectorAll(t)));if(e.classList.contains("e-fltrtemp")){var n,o=[].slice.call(e.querySelectorAll(".e-fltrtemp-focus"));if("click"===this.focusType&&this.target&&this.target.classList.contains("e-fltrtemp-focus"))return this.target;if("key"===this.focusType&&o.length&&("tab"===this.action||"shiftTab"===this.action))return-1===(n=o.indexOf(this.currentTarget))?o["tab"===this.action?0:o.length-1]:o["tab"===this.action?n+1:n-1]}return t.length?!(i&&1<t.length)||"Batch"===this.parent.editSettings.mode&&this.parent.isEdit&&this.target?t[0]:this.target||e:e},JM.prototype.selector=function(e,t,i){var n=[LA.Expand,LA.GroupCaption,LA.CaptionSummary,LA.GroupSummary];return(e.isDataRow&&t.visible&&(t.isDataCell||t.isTemplate)||e.isDataRow&&t.cellType===LA.DetailExpand&&je(t.visible)||!e.isDataRow&&-1<n.indexOf(t.cellType)&&!!(t.cellType!==LA.GroupSummary&&t.cellType!==LA.CaptionSummary||t.isDataCell&&t.visible)||t.column&&t.visible&&"checkbox"===t.column.type||t.cellType===LA.CommandColumn||e.isDataRow&&i)&&!("delete"===e.edit&&e.isDirty)},JM.prototype.nextRowFocusValidate=function(e){for(var t=e,i=e,n=this.matrix.rows;i<=n;i++){if(-1!==this.matrix.matrix[parseInt(e.toString(),10)].indexOf(1))return e;e+=1}return this.lastIdxCell=!0,t},JM.prototype.previousRowFocusValidate=function(e){for(var t=e,i=e;0<=i;i--){if(-1!==this.matrix.matrix[parseInt(e.toString(),10)].indexOf(1))return e;if((e-=1)<0)return this.lastIdxCell=!0,t}return t},JM.prototype.jump=function(e,t){this.lastIdxCell=!1;var i=0!==this.parent.frozenRows&&"shiftEnter"===e,n=("upArrow"===e||i)&&0===t[0],o=(this.matrix.matrix[t[0]]&&"tab"===e&&this.matrix.matrix.length&&t[1]===this.matrix.matrix[t[0]].lastIndexOf(1)&&this.matrix.matrix.length-1!==t[0]&&(this.matrix.current[0]=this.nextRowFocusValidate(this.matrix.current[0]+1),this.matrix.current[1]=-1),"shiftTab"===e&&0!==t[0]&&this.matrix.matrix[t[0]].indexOf(1)===t[1]&&(this.matrix.current[0]=this.previousRowFocusValidate(this.matrix.current[0]-1),this.matrix.current[1]=this.matrix.matrix[t[0]].length),!1),r=A(document.activeElement,"e-addedrow")&&this.parent.editSettings.showAddNewRow?A(document.activeElement,"e-addedrow"):document.activeElement.parentElement;return{swap:!(o=(this.parent.enableVirtualization||this.parent.infiniteScrollSettings.enableCache)&&!je(r)&&r.classList.contains(UE)?0<parseInt(r.getAttribute(nD),10)-1:o)&&("upArrow"===e||i)&&0===t[0],toHeader:n}},JM.prototype.getNextCurrent=function(e,t,i,n){void 0===e&&(e=[]);var o=[];return"rightArrow"!==n&&"tab"!==n||(o[0]=e[0],o[1]=-1),"downArrow"!==n&&"enter"!==n||(o[0]=-1,o[1]=e[1]),o},JM.prototype.generateRows=function(e,t){var i=t.matrix,t=t.handlerInstance,n=t.matrix.matrix.length,n=this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type?n+1:n;t.matrix.matrix=t.matrix.matrix.slice(0,n),t.matrix.rows=n,(n=t.matrix.matrix).push.apply(n,i),t.matrix.rows+=i.length},JM.prototype.getInfo=function(e){var t=this.getFocusInfo(),i=this.matrix.current,n=i[0],i=i[1],o=t.element.classList.contains(LE),r=o||e&&"enter"!==e.action&&(t.element.classList.contains("e-detailrowcollapse")||t.element.classList.contains("e-detailrowexpand")),s=[Math.min(parseInt(t.element.parentElement.getAttribute(nD),10)-1,n),Math.min(parseInt(t.element.getAttribute(iD),10)-1,i)],a=s[0],s=s[1];return this.parent.allowGrouping&&this.parent.groupSettings.enableLazyLoading&&o&&(a=this.parent.getDataRows().indexOf(t.element.parentElement)),this.parent.enableVirtualization&&this.parent.groupSettings.columns.length&&(a=n,s=i),this.parent.editSettings.showAddNewRow&&"Top"===this.parent.editSettings.newRowPosition&&!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling&&e&&"downArrow"===e.action&&a++,{isContent:!0,isDataCell:o,indexes:[a,s],isSelectable:r}},JM.prototype.validator=function(){var o=this.getTable();return function(e,t,i){if(!je(o.rows[parseInt(e.toString(),10)])){var n=void 0,e=(t=o.querySelector(".e-emptyrow")?0:t,0!==(n=(o.rows[parseInt(e.toString(),10)].cells[0].classList.contains("e-editcell")?o.rows[parseInt(e.toString(),10)].cells[0].querySelectorAll("td"):o.rows[parseInt(e.toString(),10)].cells)[parseInt(t.toString(),10)]).getBoundingClientRect().width);if("enter"===i||"shiftEnter"===i)return e&&n.classList.contains(LE);if(("shiftUp"===i||"shiftDown"===i)&&n.classList.contains(LE))return e;if("shiftUp"!==i&&"shiftDown"!==i)return e}return!1}},JM.prototype.shouldFocusChange=function(e){var t=this.matrix.current,i=t[0],i=void 0===i?-1:i,t=t[1],t=void 0===t?-1:t;return i<0||t<0||!(i=R(i+".cells."+t,this.getTable().rows))||"enter"!==e.action&&"shiftEnter"!==e.action||i.classList.contains(LE)&&!i.classList.contains("e-unboundcell")||i.classList.contains("e-editedbatchcell")&&!i.classList.contains("e-detailcell")},JM.prototype.getGridSeletion=function(){return this.parent.allowSelection&&this.parent.selectionSettings.allowColumnSelection};var KM=JM;function JM(e){var t=this;this.matrix=new YM,this.lastIdxCell=!1,this.parent=e,this.keyActions={rightArrow:[0,1],tab:[0,1],leftArrow:[0,-1],shiftTab:[0,-1],upArrow:[-1,0],downArrow:[1,0],shiftUp:[-1,0],shiftDown:[1,0],shiftRight:[0,1],shiftLeft:[0,-1],enter:[1,0],shiftEnter:[-1,0]},this.indexesByKey=function(e){return{home:[t.matrix.current[0],-1,0,1],end:[t.matrix.current[0],t.matrix.columns+1,0,-1],ctrlHome:[0,-1,0,1],ctrlEnd:[t.matrix.rows,t.matrix.columns+1,0,-1]}[""+e]||null}}Ir(ek,ZM=KM),ek.prototype.getTable=function(){return this.parent.getHeaderTable()},ek.prototype.onClick=function(e){this.focusType="click";var t=e.target;if(!(t=(this.target=t).classList.contains("e-headercell")?t:z(t,"th"))&&(0!==this.parent.frozenRows||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow)&&(t=e.target.classList.contains(LE)?e.target:z(e.target,"td")),e.target.classList.contains("e-columnheader")||e.target.querySelector(".e-stackedheadercell"))return!1;if(t){var e=t.parentElement.rowIndex,i=[e=this.parent.editSettings.showAddNewRow&&A(t,"e-addedrow")?A(t,"e-addedrow").rowIndex:e,t.cellIndex],i=R(i[0]+"."+i[1],this.matrix.matrix);if(this.matrix.inValid(i))return!1;this.matrix.select(e,t.cellIndex)}},ek.prototype.getFocusInfo=function(){var e={},t=this.matrix.current,i=t[0],i=void 0===i?0:i,t=t[1],t=void 0===t?0:t,i=this.getTable().rows[parseInt(i.toString(),10)];return e.element=je(i)?null:(this.parent.editSettings.showAddNewRow&&i.classList.contains("e-addedrow")?i.querySelectorAll("td:not(.e-editcell)"):i.cells)[parseInt(t.toString(),10)],je(e.element)||(e.elementToFocus=this.getFocusable(e.element),e.outline=!e.element.classList.contains("e-filterbarcell")),e},ek.prototype.selector=function(e,t){return t.visible&&(void 0!==t.column.field||t.isTemplate||!je(t.column.template)||!je(t.column.commands)||"checkbox"===t.column.type)||t.cellType===LA.StackedHeader},ek.prototype.jump=function(e,t){var i,n,o=0!==this.parent.frozenRows&&"enter"===e;return this.parent.enableHeaderFocus&&"tab"===e&&(n=this.matrix.matrix.length-1===t[0],i=t[1]===this.matrix.matrix[t[0]].lastIndexOf(1))&&(this.matrix.current[0]=n?0:this.matrix.current[0]+1,this.matrix.current[1]=-1),{swap:("downArrow"===e||o)&&t[0]===this.matrix.matrix.length-1||"tab"===e&&n&&i}},ek.prototype.getNextCurrent=function(e,t,i,n){void 0===e&&(e=[]);var o=[];return("rightArrow"===n||"shiftRight"===n&&this.getGridSeletion()||"tab"===n)&&(o[0]=e[0],o[1]=-1),"upArrow"!==n&&"shiftEnter"!==n||(o[0]=this.matrix.matrix.length,o[1]=e[1]),o},ek.prototype.generateRows=function(e){var t=this.matrix.matrix.length;if(this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type){this.matrix.rows=++this.matrix.rows;for(var i=e[0].cells,n=0,o=0;o<i.length;o++)i[parseInt(o.toString(),10)].column&&i[parseInt(o.toString(),10)].column.columns?n=this.checkFilterColumn(i[parseInt(o.toString(),10)].column.columns,t,n):(this.matrix.set(t,n,i[parseInt(o.toString(),10)].visible&&!1!==i[parseInt(o.toString(),10)].column.allowFiltering),n++)}},ek.prototype.checkFilterColumn=function(e,t,i){for(var n=e,o=i,r=0;r<n.length;r++)n[parseInt(r.toString(),10)].columns?o=this.checkFilterColumn(n[parseInt(r.toString(),10)].columns,t,o):(this.matrix.set(t,o,n[parseInt(r.toString(),10)].visible&&!1!==n[parseInt(r.toString(),10)].allowFiltering),o++);return o},ek.prototype.getInfo=function(e){return Pe(ZM.prototype.getInfo.call(this,e),{isContent:!1,isHeader:!0})},ek.prototype.validator=function(){return function(){return!0}},ek.prototype.shouldFocusChange=function(e){var t=this.matrix.current,i=t[0],t=t[1];return i<0||t<0||!(i=R(i+".cells."+t,this.getTable().rows))||"enter"!==e.action&&"altDownArrow"!==e.action||!i.classList.contains("e-headercell")},ek.prototype.getHeaderType=function(){return"HeaderFocus"};var ZM,$M=ek;function ek(e){return ZM.call(this,e)||this}ik.prototype.searchFocus=function(e){e.target.parentElement.classList.add("e-input-focus"),e.target.classList.contains("e-input")&&e.target.classList.contains("e-search")&&e.target.value&&((e=e.target.parentElement.querySelector(".e-sicon")).classList.add("e-clear-icon"),e.setAttribute("title",this.l10n.getConstant("Clear")),e.style.cursor="pointer")},ik.prototype.searchBlur=function(e){var t=e.relatedTarget||null;t&&t.classList.contains("e-sicon")&&!t.classList.contains("e-clear-icon")||e.target.parentElement.classList.remove("e-input-focus"),e.target.classList.contains("e-search")&&(t&&!t.classList.contains("e-sicon e-clear-icon")&&!t.classList.contains("e-sicon")||je(t))&&((t=e.target.parentElement.querySelector(".e-sicon")).classList.remove("e-clear-icon"),t.removeAttribute("title"),t.style.cursor="default")},ik.prototype.wireEvent=function(){this.searchBox&&(E.add(this.searchBox,"focus",this.searchFocus,this),E.add(this.searchBox,"blur",this.searchBlur,this))},ik.prototype.unWireEvent=function(){this.searchBox&&(E.remove(this.searchBox,"focus",this.searchFocus),E.remove(this.searchBox,"blur",this.searchBlur))};var tk=ik;function ik(e,t){this.searchBox=e,this.serviceLocator=t,this.l10n=this.serviceLocator.getService("localization")}nk=function(e,t){return(nk=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])}))(e,t)};var nk,ok,h0=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Ir=(function(e,t){function i(){this.constructor=e}nk(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(rk,ok=n),h0([e(12)],rk.prototype,"pageSize",void 0),h0([e(8)],rk.prototype,"pageCount",void 0),h0([e(1)],rk.prototype,"currentPage",void 0),h0([e()],rk.prototype,"totalRecordsCount",void 0),h0([e(!1)],rk.prototype,"enableQueryString",void 0),h0([e(!1)],rk.prototype,"pageSizes",void 0),h0([e(null)],rk.prototype,"template",void 0),rk);function rk(){return null!==ok&&ok.apply(this,arguments)||this}sk=function(e,t){return(sk=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])}))(e,t)};var sk,ak,h0=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},h0=(function(e,t){function i(){this.constructor=e}sk(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(lk,ak=n),h0([e("startsWith")],lk.prototype,"operator",void 0),h0([e(!1)],lk.prototype,"ignoreAccent",void 0),h0([e(null)],lk.prototype,"headerTemplate",void 0),h0([e(null)],lk.prototype,"template",void 0),h0([e(null)],lk.prototype,"footerTemplate",void 0),h0([e(!0)],lk.prototype,"enableSearching",void 0),h0([e(null)],lk.prototype,"renderCustomColumnChooser",void 0),lk);function lk(){return null!==ak&&ak.apply(this,arguments)||this}dk.prototype.initializeSelection=function(){this.parent.log("selection_key_missing"),this.render()},dk.prototype.onActionBegin=function(e,t){this.parent.trigger(t,this.fDataUpdate(e))},dk.prototype.fDataUpdate=function(e){var t;return this.isMultiSelection||je(e.cellIndex)&&je(e.rowIndex)||(t=this.getRowObj(je(e.rowIndex)?je(e.cellIndex)?this.currentIndex:e.cellIndex.rowIndex:e.rowIndex),e.foreignKeyData=t.foreignKeyData),e},dk.prototype.onActionComplete=function(e,t){this.parent.trigger(t,this.fDataUpdate(e)),this.isMultiSelection=!1},dk.prototype.getModuleName=function(){return"selection"},dk.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+RE)||e.querySelector("."+OE))&&(this.hidePopUp(),this.clearSelection(),this.destroyAutoFillElements(),this.removeEventListener(),this.unWireEvents(),E.remove(this.parent.getContent(),"mousedown",this.mouseDownHandler),E.remove(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler))},dk.prototype.isEditing=function(){return("Normal"===this.parent.editSettings.mode||"Batch"===this.parent.editSettings.mode&&this.parent.editModule&&this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate())&&this.parent.isEdit&&!this.parent.editSettings.showAddNewRow&&!this.parent.isPersistSelection},dk.prototype.getCurrentBatchRecordChanges=function(){var e=this.parent;if("Batch"===e.editSettings.mode&&e.editModule){for(var t=_P(this.parent.getCurrentViewRecords()),t="Bottom"===e.editSettings.newRowPosition?t.concat(this.parent.editModule.getBatchChanges()[JE]):this.parent.editModule.getBatchChanges()[JE].concat(t),i=this.parent.editModule.getBatchChanges()[ZE],n=this.parent.getPrimaryKeyFieldNames()[0],o=0;o<i.length;o++)for(var r=0;r<t.length;r++)if(i[parseInt(o.toString(),10)][""+n]===t[parseInt(r.toString(),10)][""+n]){t.splice(r,1);break}return t}return this.parent.enableVirtualization&&this.parent.groupSettings.columns.length&&!this.parent.isPersistSelection?e.getCurrentViewRecords().filter(function(e){return void 0===e.key}):e.getCurrentViewRecords()},dk.prototype.selectRow=function(e,t){if(this.selectedRowIndexes.length&&this.selectionSettings.enableSimpleMultiRowSelection)this.addRowsToSelection([e]);else{var i=this.parent,n=i.getRowByIndex(e),o=n&&i.getRowObjectFromUID(n.getAttribute("data-uid"));if(!(this.isPartialSelection&&o&&o.isDataRow)||o.isSelectable){if(i.enableVirtualization&&-1<e){var r={selectedIndex:e,isAvailable:!0};if(this.parent.notify(VI,r),!n||!i.getRowObjectFromUID(n.getAttribute("data-uid")))return void(r.isAvailable&&!i.selectionSettings.persistSelection&&0<this.parent.getSelectedRecords().length&&this.clearRowSelection());r=i.getRowObjectFromUID(n.getAttribute("data-uid")).data}else r=this.getRowObj(e).data;if(this.isRowType()&&n&&!this.isEditing()){var s,a,l,h=n.hasAttribute("aria-selected");this.activeTarget(),t=!(!t||!this.selectedRowIndexes.length||(s="ResetOnRowClick"===this.selectionSettings.checkboxMode,a=!this.parent.isCheckBoxSelection&&"Multiple"===this.selectionSettings.type,(s||a)&&(1!==this.selectedRowIndexes.length||!s&&!a))||this.isKeyAction&&this.parent.isCheckBoxSelection||-1===this.selectedRowIndexes.indexOf(e)),this.isKeyAction=!1;if(t){if("ResetOnRowClick"!==this.selectionSettings.checkboxMode&&this.selectionSettings.persistSelection){if(this.rowDeselect(XA,[o.index],[o.data],[n],[o.foreignKeyData],this.actualTarget),this.isCancelDeSelect)return;this.parent.isCheckBoxSelection||(this.selectedRowIndexes=[],this.selectedRecords=[],this.isRowSelected=!1,this.selectRowIndex(-1)),this.rowDeselect(KA,[o.index],[o.data],[n],[o.foreignKeyData],this.actualTarget,void 0,void 0,void 0)}this.rowSelectingCallBack(l,t,e,r,!1,h,"cancel")(l)}else l={data:r,rowIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,row:n,previousRow:i.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,cancel:!1,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked},this.parent.trigger(GA,this.fDataUpdate(l),this.rowSelectingCallBack(l,t,e,r,!1,h,"cancel"))}}}},dk.prototype.rowSelectingCallBack=function(e,t,i,n,o,r,s){var a=this;return function(e){je(e)||!0!==e[""+s]?(a.index=i,a.toggle=t,a.data=n,a.removed=o,r&&a.selectionSettings.persistSelection&&"ResetOnRowClick"!==a.selectionSettings.checkboxMode?(a.clearSelectedRow(i),a.selectRowCallBack()):!r&&a.selectionSettings.persistSelection&&a.parent.isCheckBoxSelection&&"ResetOnRowClick"!==a.selectionSettings.checkboxMode&&a.selectRowCallBack(),"ResetOnRowClick"===a.selectionSettings.checkboxMode&&(a.isCheckboxReset=!0,a.clearSelection()),a.selectionSettings.persistSelection&&"ResetOnRowClick"!==a.selectionSettings.checkboxMode&&(a.parent.isCheckBoxSelection||!a.selectionSettings.persistSelection)||(a.selectRowCheck=!0,a.clearRow())):a.disableInteracted()}},dk.prototype.selectRowCallBack=function(){var e=this.parent,t=this.index,i=this.toggle,n=this.data,o=this.removed,r=e.getRowByIndex(t);i||o||(this.selectedRowIndexes.indexOf(t)<=-1&&this.updateRowSelection(r,t),this.selectRowIndex(t)),i||(o={data:n,rowIndex:t,row:r,previousRow:e.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,isInteracted:this.isInteracted,isHeaderCheckBoxClicked:this.isHeaderCheckboxClicked,rowIndexes:t},this.onActionComplete(o,YA)),this.isInteracted=!1,this.updateRowProps(t)},dk.prototype.selectRowsByRange=function(e,t){this.selectRows(this.getCollectionFromIndexes(e,t)),this.selectRowIndex(t)},dk.prototype.selectedDataUpdate=function(e,t,i,n,o){for(var r=0,s=n.length;r<s;r++){var a=this.parent.getDataRows()[n[parseInt(r.toString(),10)]],l=(this.parent.enableVirtualization&&(a=this.parent.getRowByIndex(n[parseInt(r.toString(),10)])),this.getRowObj(a));l&&l.isDataRow&&l.isSelectable?(e.push(l.data),i.push(a),t.push(l.foreignKeyData)):this.isPartialSelection&&o&&o.splice(o.indexOf(n[parseInt(r.toString(),10)]),1)}},dk.prototype.selectRows=function(e){var l=this,h=this.parent,d=e.slice(),p=this.isSingleSel()?e[e.length-1]:e[0],c=(this.isMultiSelection=!0,[]),u=[],t=[];this.isRowType()&&!this.isEditing()&&(this.selectedDataUpdate(t,u,c,e,d),this.activeTarget(),e={cancel:!1,rowIndexes:d,row:c,rowIndex:p,target:this.actualTarget,prevRow:h.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isInteracted:this.isInteracted,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,data:t,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,foreignKeyData:u},this.parent.trigger(GA,this.fDataUpdate(e),function(e){if(je(e)||!0!==e.cancel){l.selectionSettings.persistSelection&&h.allowRowDragAndDrop&&l.isDragged||l.clearRow(),l.selectRowIndex(d.slice(-1)[0]);var t=function(e,t){l.updateRowSelection(h.getRowByIndex(e),e,t),l.updateRowProps(p)};if(l.isSingleSel())t(p);else for(var i=0,n=d;i<n.length;i++)t(n[i],!!h.enableVirtualization);if(l.checkVirtualCheckBox()&&!l.parent.isPersistSelection)if(d.length===l.totalRecordsCount)l.virtualSelectedData=l.virtualCheckBoxData().slice(),l.selectedRowIndexes=Object.keys(l.virtualSelectedData).map(function(e){return parseInt(e,10)}),l.setCheckAllState();else{var o=d.filter(function(e){return-1===l.selectedRowIndexes.indexOf(e)});if(0<o.length){for(var r=l.virtualCheckBoxData().slice(),s=0;s<o.length;s++){var a=r[o[s]];je(a)||(l.virtualSelectedData.push(a),l.selectedRowIndexes.push(o[s]))}l.setCheckAllState()}}e={rowIndexes:d,row:c,rowIndex:p,target:l.actualTarget,prevRow:h.getRows()[l.prevRowIndex],previousRowIndex:l.prevRowIndex,data:l.getSelectedRecords(),isInteracted:l.isInteracted,isHeaderCheckboxClicked:l.isHeaderCheckboxClicked,foreignKeyData:u},l.isRowSelected&&l.onActionComplete(e,YA),l.isInteracted=!1}else l.disableInteracted()}))},dk.prototype.addRowsToSelection=function(e){var t=this.parent,i=this.target,n=(this.isMultiSelection=!0,[]),o=[],r=[],s=t.getSelectedRowIndexes().concat(e),a=this.isSingleSel()?t.getRowByIndex(e[e.length-1]):t.getRowByIndex(e[0]);if(this.isRowType()&&!this.isEditing()||this.selectionSettings.checkboxOnly){var l,h=this.parent.getColumns().filter(function(e){return"checkbox"===e.type});this.isMultiCtrlRequest&&!h.length&&this.selectedDataUpdate(r,o,n,s);for(var d=0,p=e;d<p.length;d++){var c=p[d],u=this.getRowObj(c),g=-1<this.selectedRowIndexes.indexOf(c);if(!(this.isPartialSelection&&u&&u.isDataRow)||u.isSelectable){if(this.selectRowIndex(c),g&&(h.length||this.selectionSettings.enableToggle||this.isMultiCtrlRequest)){if(this.isAddRowsToSelection=!0,this.rowDeselect(XA,[c],[u.data],[a],[u.foreignKeyData],i),this.isCancelDeSelect)return;this.checkVirtualCheckBox()&&!this.parent.isPersistSelection&&this.virtualSelectedData.splice(this.virtualSelectedData.indexOf(u.data),1),this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(c),1),this.selectedRecords.splice(this.selectedRecords.indexOf(a),1),this.selectRowIndex(this.selectedRowIndexes.length?this.selectedRowIndexes[this.selectedRowIndexes.length-1]:-1),a.removeAttribute("aria-selected"),this.addRemoveClassesForRow(a,!1,null,"e-selectionbackground","e-active"),this.rowDeselect(KA,[c],[u.data],[a],[u.foreignKeyData],i,void 0,void 0,void 0),this.isInteracted=!1,this.isMultiSelection=!1,this.isAddRowsToSelection=!1,this.isHdrSelectAllClicked=!1}else{if(this.activeTarget(),l={cancel:!1,data:r.length?r:u.data,rowIndex:c,row:n.length?n:a,target:this.actualTarget,prevRow:t.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,foreignKeyData:o.length?o:u.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:s},this.parent.trigger(GA,this.fDataUpdate(l)),!je(l)&&!0===l.cancel)return void this.disableInteracted();this.isSingleSel()&&this.clearRow(),this.updateRowSelection(a,c)}if(g||(l={data:r.length?r:u.data,rowIndex:c,row:n.length?n:a,target:this.actualTarget,prevRow:t.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,foreignKeyData:o.length?o:u.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:s},this.onActionComplete(l,YA)),this.isInteracted=!1,this.updateRowProps(c),this.isSingleSel())break}}}},dk.prototype.getCollectionFromIndexes=function(e,t){for(var i=[],n=e<=t?{i:e,max:t}:{i:t,max:e},o=n.i,r=n.max;o<=r;o++)i.push(o);return t<e&&i.reverse(),i},dk.prototype.clearRow=function(){this.clearRowCheck=!0,this.clearRowSelection()},dk.prototype.clearRowCallBack=function(){this.isCancelDeSelect&&"Check"!==this.parent.checkAllRows||(this.selectedRowIndexes=[],this.selectedRecords=[],this.selectRowIndex(-1),this.isSingleSel()&&this.parent.isPersistSelection&&(this.selectedRowState={}))},dk.prototype.clearSelectedRow=function(e){var t;this.toggle&&(t=this.parent.getRowByIndex(e),this.disableUI||(t.removeAttribute("aria-selected"),this.addRemoveClassesForRow(t,!1,!0,"e-selectionbackground","e-active")),this.removed=!0,this.updatePersistCollection(t,!1),this.updateCheckBoxes(t),this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(e),1),this.selectedRecords.splice(this.selectedRecords.indexOf(this.parent.getRowByIndex(e)),1))},dk.prototype.updateRowProps=function(e){this.prevRowIndex=e,this.isRowSelected=this.selectedRowIndexes.length&&!0},dk.prototype.getPkValue=function(e,t){return e&&hB(e)?FB(e,t):t[""+e]},dk.prototype.updatePersistCollection=function(e,t){var i,n=this;(this.parent.isPersistSelection||this.parent.selectionSettings.persistSelection&&0<this.parent.getPrimaryKeyFieldNames().length)&&!je(e)&&(this.parent.isPersistSelection||this.ensureCheckboxFieldSelection(),e=this.getRowObj(e),null!==(i=e.data?this.getPkValue(this.primaryKey,e.data):null))&&((e.isSelected=t)&&!this.isPartialSelection||this.isPartialSelection&&e.isSelectable&&e.isSelected?(this.selectedRowState[""+i]=t,delete this.unSelectedRowState[""+i],this.persistSelectedData.some(function(e){return n.getPkValue(n.primaryKey,e)===i})||this.persistSelectedData.push(e.data)):this.updatePersistDelete(i))},dk.prototype.updatePersistDelete=function(i,e){var n,o=this;delete this.selectedRowState[""+i],this.rmtHdrChkbxClicked&&(this.unSelectedRowState[""+i]=!0),this.persistSelectedData.some(function(e,t){return n=t,o.getPkValue(o.primaryKey,e)===i})&&(this.persistSelectedData.splice(n,1),e)&&this.parent.partialSelectedRecords.splice(n,1)},dk.prototype.updateCheckBoxes=function(e,t,i){je(e)||!je(e=e.querySelector(".e-checkselect"))&&(TB(e.nextElementSibling,t),xB(e,t),je(this.checkedTarget)||!je(this.checkedTarget)&&!this.checkedTarget.classList.contains("e-checkselectall"))&&this.setCheckAllState(i)},dk.prototype.updateRowSelection=function(e,t,i){var n;e&&(-1===this.selectedRowIndexes.indexOf(t)&&(this.checkVirtualCheckBox()&&!this.parent.isPersistSelection&&this.virtualSelectedData.push(this.parent.getRowObjectFromUID(e.getAttribute("data-uid")).data),this.selectedRowIndexes.push(t),this.selectedRecords.push(e)),e.setAttribute("aria-selected","true"),this.updatePersistCollection(e,!0),this.updateCheckBoxes(e,!0),this.addRemoveClassesForRow(e,!0,null,"e-selectionbackground","e-active"),this.preventFocus||this.parent.isFocusFirstCell||this.isFocusLastCell?(this.parent.isFocusFirstCell||this.isFocusLastCell)&&(this.parent.isFocusFirstCell=!1,t=this.isFocusLastCell?"last-child":"first-child",n=e.querySelector(".e-selectionbackground.e-rowcell:not(.e-hide, .e-detailrowcollapse, .e-detailrowexpand, .e-rowdragdrop, .e-gridchkbox):"+t),this.isFocusLastCell=!1,n)&&this.focus.onClick({target:n},!0,!0):(n=this.focus.getPrevIndexes().cellIndex?e.cells[this.focus.getPrevIndexes().cellIndex]:e.querySelector(".e-selectionbackground:not(.e-hide):not(.e-detailrowcollapse):not(.e-detailrowexpand)"),(n=this.parent.contextMenuModule&&2===this.mouseButton?this.parent.contextMenuModule.cell:n)&&!i&&this.focus.onClick({target:n},!0)))},dk.prototype.clearSelection=function(){var e;this.checkSelectAllClicked=!0,this.selectionSettings.persistSelection&&this.persistSelectedData.length&&(this.deSelectedData=_P(this.persistSelectedData)),(!this.parent.isPersistSelection||this.parent.isPersistSelection&&!this.parent.isEdit||!je(this.checkedTarget)&&this.checkedTarget.classList.contains("e-checkselectall"))&&((e=this.parent.element.querySelector(".e-gridpopup").querySelector("span")).classList.contains("e-rowselect")&&e.classList.remove("e-spanclicked"),this.parent.isPersistSelection&&(this.persistSelectedData=[],this.selectedRowState={}),this.clearRowSelection(),this.clearCellSelection(),this.clearColumnSelection(),this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevECIdxs=void 0,this.enableSelectMultiTouch=!1,this.isInteracted=!1,this.checkSelectAllClicked=!1,this.isHdrSelectAllClicked=!1)},dk.prototype.clearRowSelection=function(){var n=this;if(this.isRowSelected){var o=this.parent.getDataRows(),r=[],s=[],a=[],l=[],h=this.target;this.isRowDeselect=!0;for(var e=0,t=this.selectedRowIndexes.length;e<t;e++){var i=void 0,i=this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache?this.parent.getRowByIndex(this.selectedRowIndexes[parseInt(e.toString(),10)]):("Batch"===this.parent.editSettings.mode?this.parent.getRows():this.parent.getDataRows())[this.selectedRowIndexes[parseInt(e.toString(),10)]],d=this.getRowObj(i);d&&(r.push(d.data),s.push(i),a.push(this.selectedRowIndexes[parseInt(e.toString(),10)]),l.push(d.foreignKeyData))}this.selectionSettings.persistSelection&&"ResetOnRowClick"!==this.selectionSettings.checkboxMode&&(this.isRowClicked=!!this.checkSelectAllClicked),this.rowDeselect(XA,a,r,s,l,h,null,function(){if(n.isCancelDeSelect&&(n.isRowClicked||n.checkSelectAllClicked||n.isInteracted&&!n.parent.isPersistSelection)){if(n.parent.isPersistSelection)if("Intermediate"===n.getCheckAllStatus(n.parent.element.querySelector(".e-checkselectall"))||n.parent.isPersistSelection)for(var e=0;e<n.selectedRecords.length;e++)n.updatePersistCollection(n.selectedRecords[parseInt(e.toString(),10)],!0);else n.parent.checkAllRows="Check",n.updatePersistSelectedData(!0)}else{for(var t=[].slice.call(o.filter(function(e){return e.hasAttribute("aria-selected")})),i=0;i<t.length;i++)n.disableUI||(t[parseInt(i.toString(),10)].removeAttribute("aria-selected"),n.addRemoveClassesForRow(t[parseInt(i.toString(),10)],!1,!0,"e-selectionbackground","e-active")),n.isPrevRowSelection||n.updatePersistCollection(t[parseInt(i.toString(),10)],!1),n.updateCheckBoxes(t[parseInt(i.toString(),10)]);!(n.parent.enableVirtualization||n.parent.enableInfiniteScrolling&&n.parent.infiniteScrollSettings.enableCache)||!n.selectedRecords.length||t.length||n.parent.selectionSettings.persistSelection||n.disableUI||n.parent.isCheckBoxSelection||n.addRemoveClassesForRow(null,!1,!0),n.virtualSelectedData=[],n.selectedRowIndexes=[],n.selectedRecords=[],n.isRowSelected=!1,n.selectRowIndex(-1),n.isPrevRowSelection=!1,n.rowDeselect(KA,a,r,s,l,h,null,void 0,null)}n.clearRowCheck&&(n.clearRowCallBack(),n.clearRowCheck=!1,n.selectRowCheck)&&(n.selectRowCallBack(),n.selectRowCheck=!1)},null),this.isRowDeselect=!1}else this.clearRowCheck&&(this.clearRowCallBack(),this.clearRowCheck=!1,this.selectRowCheck)&&(this.selectRowCallBack(),this.selectRowCheck=!1)},dk.prototype.rowDeselect=function(e,t,i,n,o,r,s,a,l){var h,d=this;this.selectionSettings.persistSelection&&(this.isRowClicked||!this.isRowDeselect||this.checkSelectAllClicked||this.focus.activeKey&&this.focus.currentInfo.element.classList.contains("e-gridchkbox")&&"space"===this.focus.activeKey)||!this.selectionSettings.persistSelection?(h=1===t.length&&1===this.deSelectedData.length,h={rowIndex:t[0],data:this.selectionSettings.persistSelection&&"Uncheck"===this.parent.checkAllRows&&!h&&"ResetOnRowClick"!==this.selectionSettings.checkboxMode?this.deSelectedData:i,foreignKeyData:o,cancel:!"cancel",isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked},"rowDeselected"===e&&delete h.cancel,i="rowIndexes",o="foreignKeyData",h.row=n,h.target=this.actualTarget,this.actualTarget&&!je(z(this.actualTarget,"thead"))||1<t.length?(h.rowIndex=t[0],h[i]=t):1===t.length&&(h.data=h.data[0],h.row=h.row[0],h[o]=h[o][0],this.isAddRowsToSelection)&&(h[i]=t),this.parent.trigger(e,h,function(e){d.isCancelDeSelect=e.cancel,d.isCancelDeSelect&&(d.isRowClicked||d.isInteracted||d.checkSelectAllClicked)||(d.updatePersistCollection(n[0],!1),d.updateCheckBoxes(n[0],void 0,t[0])),void 0!==a&&a()})):this.selectionSettings.persistSelection&&!this.isInteracted&&void 0!==a&&a()},dk.prototype.getRowObj=function(e){return!je(e=void 0===e?this.currentIndex:e)&&(e="number"==typeof e?this.parent.getRowByIndex(e):e)&&this.parent.getRowObjectFromUID(e.getAttribute("data-uid"))||{}},dk.prototype.selectCell=function(e,t){var i,n,o,r;!this.isCellType()||this.isCellType()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache)||(i=this.parent.getCellFromIndex(e.rowIndex,this.getColIndex(e.rowIndex,e.cellIndex)),this.currentIndex=e.rowIndex,n=this.getCurrentBatchRecordChanges()[this.currentIndex],this.isCellType()&&i&&!this.isEditing()&&(o=i.classList.contains("e-cellselectionbackground"),(t=t&&!ee(this.prevCIdxs)&&e.rowIndex===this.prevCIdxs.rowIndex&&e.cellIndex===this.prevCIdxs.cellIndex&&o)?this.successCallBack(r,t,e,i,n)(r):((r={data:n,cellIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,cancel:!1}).currentCell=i,r.previousRowCellIndex=this.prevECIdxs,this.parent.trigger(JA,this.fDataUpdate(r),this.successCallBack(r,t,e,i,n)),this.cellselected=!0)))},dk.prototype.successCallBack=function(e,i,n,o,r){var s=this;return function(e){var t="currentCell";!je(e)&&!0===e.cancel||(i||(e[t]=e[t]||o),s.clearCell(),i||s.updateCellSelection(o,n.rowIndex,n.cellIndex),i)||((e={data:r,cellIndex:n,currentCell:o,selectedRowCellIndex:s.selectedRowCellIndexes,previousRowCell:s.prevECIdxs?s.getCellIndex(s.prevECIdxs.rowIndex,s.prevECIdxs.cellIndex):void 0}).previousRowCellIndex=s.prevECIdxs,s.updateCellProps(n,n),s.onActionComplete(e,ZA))}},dk.prototype.getCellIndex=function(e,t){return this.parent.getCellFromIndex(e,t)},dk.prototype.selectCellsByRange=function(o,r){var s,a,l,h,d,p,c,u,e,g=this;this.isCellType()&&(s=this.parent,a=this.parent.isSpan?cF(this.parent,o.rowIndex,o.cellIndex):s.getCellFromIndex(o.rowIndex,o.cellIndex),d=o,p=r=r||o,this.currentIndex=o.rowIndex,u=this.getCurrentBatchRecordChanges()[this.currentIndex],this.isSingleSel()||!this.isCellType()||this.isEditing()||((e={data:u,cellIndex:o,currentCell:a,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0}).previousRowCellIndex=this.prevECIdxs,this.parent.trigger(JA,this.fDataUpdate(e),function(e){if(je(e)||!0!==e.cancel){g.clearCell(),o.rowIndex>r.rowIndex&&(e=o,o=r,r=e);for(var t=o.rowIndex;t<=r.rowIndex;t++){h=g.selectionSettings.cellSelectionMode.indexOf("Box")<0?(l=t===o.rowIndex?o.cellIndex:0,t===r.rowIndex?r.cellIndex:g.getLastColIndex(t)):(l=o.cellIndex,r.cellIndex),c=[];for(var i=l<h?l:h,n=h<l?l:h;i<=n;i++)(a=g.parent.isSpan?cF(s,t,i):s.getCellFromIndex(t,i))&&(c.push(i),g.updateCellSelection(a),g.addAttribute(a));g.selectedRowCellIndexes.push({rowIndex:t,cellIndexes:c})}e={data:u,cellIndex:p,currentCell:s.getCellFromIndex(p.rowIndex,p.cellIndex),selectedRowCellIndex:g.selectedRowCellIndexes,previousRowCell:g.prevECIdxs?g.getCellIndex(g.prevECIdxs.rowIndex,g.prevECIdxs.cellIndex):void 0};e.previousRowCellIndex=g.prevECIdxs,g.isDragged||(g.onActionComplete(e,ZA),g.cellselected=!0),g.updateCellProps(d,p)}})))},dk.prototype.selectCells=function(e){if(this.isCellType()){var t=this.parent,i=t.getCellFromIndex(e[0].rowIndex,e[0].cellIndexes[0]),n=(this.currentIndex=e[0].rowIndex,this.getCurrentBatchRecordChanges()[this.currentIndex]);if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){var o={data:n,cellIndex:e[0].cellIndexes[0],currentCell:i,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};o.previousRowCellIndex=this.prevECIdxs,this.onActionBegin(o,JA);for(var r=0,s=e.length;r<s;r++)for(var a=0,l=e[parseInt(r.toString(),10)].cellIndexes.length;a<l;a++)(i=t.getCellFromIndex(e[parseInt(r.toString(),10)].rowIndex,e[parseInt(r.toString(),10)].cellIndexes[parseInt(a.toString(),10)]))&&(this.updateCellSelection(i),this.addAttribute(i),this.addRowCellIndex({rowIndex:e[parseInt(r.toString(),10)].rowIndex,cellIndex:e[parseInt(r.toString(),10)].cellIndexes[parseInt(a.toString(),10)]}));this.updateCellProps({rowIndex:e[0].rowIndex,cellIndex:e[0].cellIndexes[0]},{rowIndex:e[0].rowIndex,cellIndex:e[0].cellIndexes[0]});o={data:n,cellIndex:e[0].cellIndexes[0],currentCell:i,selectedRowCellIndex:this.selectedRowCellIndexes,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};o.previousRowCellIndex=this.prevECIdxs,this.onActionComplete(o,ZA)}}},dk.prototype.addCellsToSelection=function(e){if(!(!this.isCellType()||this.isCellType()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache))){var t,i=this.parent,n=(this.currentIndex=e[0].rowIndex,this.getCurrentBatchRecordChanges()[this.currentIndex]);if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){this.hideAutoFill(),o=i.getRowsObject()[e[0].rowIndex],0<i.groupSettings.columns.length&&(o=i.getRowObjectFromUID(this.target.parentElement.getAttribute("data-uid")));for(var o,r=[],s=0,a=e;s<a.length;s++){for(var l=a[s],h=0,d=this.selectedRowCellIndexes.length;h<d;h++)if(this.selectedRowCellIndexes[parseInt(h.toString(),10)].rowIndex===l.rowIndex){t=h;break}var p=i.getCellFromIndex(l.rowIndex,this.getColIndex(l.rowIndex,l.cellIndex)),c=l.cellIndex,c=(0<i.groupSettings.columns.length?r.push(o.cells[c+i.groupSettings.columns.length].foreignKeyData):r.push(o.cells[parseInt(c.toString(),10)].foreignKeyData),{cancel:!1,data:n,cellIndex:e[0],isShiftPressed:this.isMultiShiftRequest,currentCell:p,isCtrlPressed:this.isMultiCtrlRequest,previousRowCell:this.prevECIdxs?i.getCellFromIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0}),u="previousRowCellIndex",g=(c[u]=this.prevECIdxs,-1<t);if(g){var m=this.selectedRowCellIndexes[parseInt(t.toString(),10)].cellIndexes;-1<m.indexOf(l.cellIndex)||"Both"===this.selectionSettings.mode&&p.classList.contains("e-gridchkbox")&&!p.getAttribute("aria-selected")?(this.cellDeselect($A,[{rowIndex:l.rowIndex,cellIndexes:[l.cellIndex]}],n,[p],r),m.splice(m.indexOf(l.cellIndex),1),0===m.length&&this.selectedRowCellIndexes.splice(t,1),p.classList.remove("e-cellselectionbackground"),p.removeAttribute("aria-selected"),this.cellDeselect(e1,[{rowIndex:l.rowIndex,cellIndexes:[l.cellIndex]}],n,[p],r)):(g=!1,this.onActionBegin(c,JA),this.addRowCellIndex({rowIndex:l.rowIndex,cellIndex:l.cellIndex}),this.updateCellSelection(p),this.addAttribute(p))}else{if(this.onActionBegin(c,JA),!je(c)&&!0===c.cancel)return;this.updateCellSelection(p,l.rowIndex,l.cellIndex)}g||((m={data:n,cellIndex:e[0],currentCell:p,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,selectedRowCellIndex:this.selectedRowCellIndexes})[u]=this.prevECIdxs,this.onActionComplete(m,ZA),this.cellselected=!0),this.updateCellProps(l,l)}}}},dk.prototype.getColIndex=function(e,t){var i=this.parent.getColumnByIndex(t),n=gF(this.parent,0,e);if(n)for(var o=0;o<n.length;o++)if(parseInt(n[parseInt(o.toString(),10)].getAttribute(iD),10)-1===t)return o;return-1},dk.prototype.getLastColIndex=function(e){e=this.parent.getDataRows()[parseInt(e.toString(),10)].querySelectorAll("td.e-rowcell");return parseInt(e[e.length-1].getAttribute(iD),10)-1},dk.prototype.clearCell=function(){this.clearCellSelection()},dk.prototype.cellDeselect=function(e,t,i,n,o){if(n&&0<n.length)for(var r=0,s=n;r<s.length;r++){var a=s[r];a&&a.classList.contains(qE)&&this.updateCheckBoxes(z(a,"tr"))}n={cells:n,data:i,cellIndexes:t,foreignKeyData:o,cancel:!1};this.parent.trigger(e,n),this.isPreventCellSelect=n.cancel},dk.prototype.updateCellSelection=function(e,t,i){je(t)||this.addRowCellIndex({rowIndex:t,cellIndex:i}),e.classList.add("e-cellselectionbackground"),e.classList.contains(qE)&&this.updateCheckBoxes(z(e,"tr"),!0),this.addAttribute(e)},dk.prototype.addAttribute=function(e){je(this.target=e)||(e.setAttribute("aria-selected","true"),this.preventFocus)||this.focus.onClick({target:e},!0)},dk.prototype.updateCellProps=function(e,t){this.prevCIdxs=e,this.prevECIdxs=t,this.isCellSelected=this.selectedRowCellIndexes.length&&!0},dk.prototype.addRowCellIndex=function(e){for(var t,i,n=0,o=this.selectedRowCellIndexes.length;n<o;n++)if(this.selectedRowCellIndexes[parseInt(n.toString(),10)].rowIndex===e.rowIndex){t=!0,i=n;break}t?this.selectedRowCellIndexes[parseInt(i.toString(),10)].cellIndexes.indexOf(e.cellIndex)<0&&this.selectedRowCellIndexes[parseInt(i.toString(),10)].cellIndexes.push(e.cellIndex):this.selectedRowCellIndexes.push({rowIndex:e.rowIndex,cellIndexes:[e.cellIndex]})},dk.prototype.clearCellSelection=function(){if(this.isCellSelected){var e=this.parent,t=this.getSelectedCellsElement(),i=this.selectedRowCellIndexes,n=[],o=[],r=[],s=this.getCurrentBatchRecordChanges();this.hideAutoFill();for(var a=0,l=i.length;a<l;a++){n.push(s[i[parseInt(a.toString(),10)].rowIndex]);for(var h=this.getRowObj(i[parseInt(a.toString(),10)].rowIndex),d=0,p=i[parseInt(a.toString(),10)].cellIndexes.length;d<p;d++)h.cells&&r.push(h.cells[i[parseInt(a.toString(),10)].cellIndexes[parseInt(d.toString(),10)]].foreignKeyData),o.push(e.getCellFromIndex(i[parseInt(a.toString(),10)].rowIndex,i[parseInt(a.toString(),10)].cellIndexes[parseInt(d.toString(),10)]))}if(this.cellDeselect($A,i,n,o,r),!0!==this.isPreventCellSelect){for(a=0,l=t.length;a<l;a++)t[parseInt(a.toString(),10)].classList.remove("e-cellselectionbackground"),t[parseInt(a.toString(),10)].removeAttribute("aria-selected");this.bdrElement&&this.showHideBorders("none"),this.selectedRowCellIndexes=[],this.isCellSelected=!1,!this.isDragged&&this.cellselected&&this.cellDeselect(e1,i,n,o,r)}}},dk.prototype.getSelectedCellsElement=function(){for(var e=this.parent.getDataRows(),t=[],i=0,n=e.length;i<n;i++)t=t.concat([].slice.call(e[parseInt(i.toString(),10)].getElementsByClassName("e-cellselectionbackground")));return t},dk.prototype.mouseMoveHandler=function(e){e.preventDefault(),this.stopTimer();var t,i=this.parent.element.getBoundingClientRect(),n=this.x,o=this.y,r=JP(e),s=r.x-i.left,i=r.y-i.top,a=z(e.target,"tr");this.isDragged=!0,this.isCellDrag||(a=a||z(document.elementFromPoint(this.parent.element.offsetLeft+2,e.clientY),"tr"),s<n&&(t=s,s=n,n=t),i<o&&(t=i,i=o,o=t),this.element.style.left=n+"px",this.element.style.top=o+"px",this.element.style.width=s-n+"px",this.element.style.height=i-o+"px"),!a||e.ctrlKey||e.shiftKey||(t=parseInt(a.getAttribute(nD),10)-1,this.isCellDrag?(s=A(e.target,LE))&&(this.startAFCell=this.startCell,this.endAFCell=A(e.target,LE),-1<t)&&this.selectLikeExcel(e,t,parseInt(s.getAttribute(iD),10)-1):(this.hideAutoFill(),this.selectRowsByRange(this.startDIndex,t),this.isRowDragSelected=!0)),e.ctrlKey||e.shiftKey||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||this.parent.enableColumnVirtualization||this.parent.groupSettings.columns.length||!this.isCellDrag||this.updateScrollPosition(e,r,this.parent.getContent())},dk.prototype.updateScrollPosition=function(e,t,i){var n=this,o=i.getBoundingClientRect();o.left>=t.x-20-(this.parent.enableRtl&&"auto"!==this.parent.height?aB():0)?this.timer1=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,n.parent.enableRtl?"right":"left",e)},200):o.left+i.clientWidth-20-(this.parent.enableRtl||"auto"===this.parent.height?0:aB())<t.x&&(this.timer1=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,n.parent.enableRtl?"left":"right",e)},200)),o.top>=t.y-.5*this.parent.getRowHeight()?this.timer2=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,"up",e)},200):o.top+i.clientHeight-.5*this.parent.getRowHeight()-(i.firstElementChild.scrollWidth>i.firstElementChild.offsetWidth?aB():0)<=t.y&&(this.timer2=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,"down",e)},200))},dk.prototype.stopTimer=function(){this.timer1&&(window.clearInterval(this.timer1),this.timer1=null),this.timer2&&(window.clearInterval(this.timer2),this.timer2=null),this.preventFocus=!1},dk.prototype.setScrollPosition=function(e,t,i){var n,o=-1,r=-1;switch((this.endAFCell||this.prevECIdxs)&&(o=this.endAFCell?parseInt(this.endAFCell.getAttribute("index"),10):this.prevECIdxs.rowIndex,r=this.endAFCell?parseInt(this.endAFCell.getAttribute("aria-colindex"),10)-1:this.prevECIdxs.cellIndex),t){case"up":if(i&&z(i.target,".e-headercontent"))return;this.isAutoFillSel&&this.startAFCell&&this.selectedRowCellIndexes.length&&(1===this.selectedRowCellIndexes.length&&this.startAFCell!==this.startCell||1<this.selectedRowCellIndexes.length&&0<this.startAFCell.getBoundingClientRect().top)&&(o=parseInt(this.startAFCell.getAttribute("index"),10)),--o,this.parent.frozenRows&&(o+=this.parent.frozenRows+1),o<1?e.scrollTop=0:e.scrollTop-=this.parent.getRowByIndex(o).offsetHeight;break;case"down":(o=this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell?parseInt(this.startAFCell.getAttribute("index"),10):o)<this.parent.getRows().length-1?(o+=1,this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell&&(this.startAFCell=this.parent.getCellFromIndex(o,this.selectedRowCellIndexes[0].cellIndexes[0])),e.scrollTop+=this.parent.getRowByIndex(o).offsetHeight):e.scrollTop=e.scrollHeight;break;case"left":0<r&&-1<o&&(this.isAutoFillSel&&this.startAFCell&&this.selectedRowCellIndexes.length&&(0<this.selectedRowCellIndexes[0].cellIndexes.length&&this.startAFCell!==this.startCell||1<this.selectedRowCellIndexes[0].cellIndexes.length&&(!this.parent.enableRtl&&0<this.startAFCell.getBoundingClientRect().left||this.parent.enableRtl&&this.startAFCell.getBoundingClientRect().left<this.parent.element.offsetWidth))&&(r=parseInt(this.startAFCell.getAttribute("aria-colindex"),10)-1),r=(s=this.findNextCell(e,t,r,o))?parseInt(s.getAttribute("aria-colindex"),10)-1:-1,this.parent.enableRtl&&s?r<1?e.scrollLeft=e.scrollWidth:e.scrollLeft+=s.offsetWidth:s&&(r<1?e.scrollLeft=0:e.scrollLeft-=s.offsetWidth));break;case"right":this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell&&(r=parseInt(this.startAFCell.getAttribute("aria-colindex"),10)-1);var s=this.parent.getCellFromIndex(o,r),a=this.findNextCell(e,t,r,o);a&&this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell&&(this.startAFCell=this.parent.getCellFromIndex(this.selectedRowCellIndexes[0].rowIndex,parseInt(a.getAttribute("aria-colindex"),10)-1)),r=a?parseInt(a.getAttribute("aria-colindex"),10)-1:-1,this.parent.enableRtl&&a?r<this.parent.columns.length-1?e.scrollLeft-=s.offsetWidth:e.scrollLeft=-e.scrollWidth:a&&(r<this.parent.columns.length-1?e.scrollLeft+=s.offsetWidth:e.scrollLeft=e.scrollWidth),this.isAutoFillSel&&(r===this.parent.columns.length-1||-1===r)&&this.startAFCell&&this.endAFCell&&(this.positionAFBorders(),e.scrollLeft=this.parent.enableRtl?-e.scrollWidth:e.scrollWidth)}-1<o&&o<this.parent.getRows().length&&-1<r&&(n={target:this.parent.getCellFromIndex(o,r)},this.isAutoFillSel&&n.target.classList.contains("e-cellselectionbackground")&&("down"===t&&parseInt(n.target.getAttribute("index"),10)===this.parent.getRows().length-1||"right"===t&&parseInt(n.target.getAttribute("aria-colindex"),10)-1==this.parent.columns.length-1)||(this.endAFCell=n.target,this.preventFocus=!0,this.selectLikeExcel(n,o,r)))},dk.prototype.findNextCell=function(e,t,i,n){var o,n=this.parent.getCellFromIndex(n,"left"===t?i-1:i+1);return n&&n.classList.contains("e-hide")?(i=n.closest("tr").querySelectorAll(".e-rowcell:not(.e-hide)"),0<(o=Array.from(i).indexOf(n.nextElementSibling))&&o<i.length-1?i[o+("left"===t?-1:1)]:(e.scrollLeft=0,null)):n},dk.prototype.selectLikeExcel=function(e,t,i){this.isAutoFillSel?(this.showAFBorders(),this.selectLikeAutoFill(e)):(this.clearCellSelection(),this.selectCellsByRange({rowIndex:this.startDIndex,cellIndex:this.startDCellIndex},{rowIndex:t,cellIndex:i}),this.drawBorders())},dk.prototype.setFrozenBorders=function(e,t,i){var n=t.style.borderWidth.toString().split(" "),o=[].slice.call(e.querySelectorAll(".e-cellselectionbackground."+["","e-leftfreeze","e-unfreeze","e-leftfreeze","e-unfreeze","e-rightfreeze","e-rightfreeze"][""+i])).filter(function(e){return""===e.style.display}),r=[].slice.call(e.querySelectorAll(".e-cellselectionbackground.e-fixedfreeze")).filter(function(e){return""===e.style.display}),s=this.parent.enableRtl;if(o.length)for(var a=o[0].getAttribute("index"),l=o[0].getAttribute("aria-colindex"),h=o[o.length-1].getAttribute("index"),d=o[o.length-1].getAttribute("aria-colindex"),p=0;p<o.length;p++)o[parseInt(p.toString(),10)].getAttribute("index")===a&&(1===n.length||3===n.length&&2===parseInt(n[0],10)||4===n.length&&2===parseInt(n[0],10))&&o[parseInt(p.toString(),10)].classList.add("e-xlsel-top-border"),o[parseInt(p.toString(),10)].getAttribute("aria-colindex")===l&&(1===n.length||3===n.length&&2===parseInt(n[1],10)||4===n.length&&(!s&&2===parseInt(n[3],10)||s&&2===parseInt(n[1],10)))&&o[parseInt(p.toString(),10)].classList.add(s?"e-xlsel-right-border":"e-xlsel-left-border"),o[parseInt(p.toString(),10)].getAttribute("index")===h&&(1===n.length||3===n.length&&2===parseInt(n[2],10)||4===n.length&&2===parseInt(n[2],10))&&o[parseInt(p.toString(),10)].classList.add("e-xlsel-bottom-border"),o[parseInt(p.toString(),10)].getAttribute("aria-colindex")===d&&(1===n.length||3===n.length&&2===parseInt(n[1],10)||4===n.length&&!s&&2===parseInt(n[1],10)||s&&2===parseInt(n[3],10))&&o[parseInt(p.toString(),10)].classList.add(s?"e-xlsel-left-border":"e-xlsel-right-border");if(r.length)for(a=r[0].getAttribute("index"),l=(parseInt(r[0].getAttribute("aria-colindex"),10)-1).toString(),h=r[r.length-1].getAttribute("index"),d=(parseInt(r[r.length-1].getAttribute("aria-colindex"),10)-1).toString(),p=0;p<r.length;p++){var c=r[parseInt(p.toString(),10)].getAttribute("index"),u=(parseInt(r[parseInt(p.toString(),10)].getAttribute("aria-colindex"),10)-1).toString(),c=(c!==a||(this.parent.getHeaderContent().querySelector(".e-cellselectionbackground.e-fixedfreeze")||!A(e,"e-content"))&&A(e,"e-content")||r[parseInt(p.toString(),10)].classList.add("e-xlsel-top-border"),c!==h||(this.parent.getContent().querySelector(".e-cellselectionbackground.e-fixedfreeze")||!A(e,"e-headercontent"))&&A(e,"e-headercontent")||r[parseInt(p.toString(),10)].classList.add("e-xlsel-bottom-border"),r[parseInt(p.toString(),10)].parentElement.children[parseInt(u,10)-1]),c=(u!==l||c&&c.classList.contains("e-cellselectionbackground")||r[parseInt(p.toString(),10)].classList.add(s?"e-xlsel-right-border":"e-xlsel-left-border"),r[parseInt(p.toString(),10)].parentElement.children[parseInt(u,10)+1]);u!==d||c&&c.classList.contains("e-cellselectionbackground")||r[parseInt(p.toString(),10)].classList.add(s?"e-xlsel-left-border":"e-xlsel-right-border")}},dk.prototype.refreshFrozenBorders=function(){this.bdrElement&&(this.setFrozenBorders(this.parent.getContentTable(),this.bdrElement,"1"),this.parent.isFrozenGrid()&&this.parent.getFrozenMode()===$E&&this.setFrozenBorders(this.parent.getContentTable(),this.frcBdrElement,"5"),this.parent.frozenRows)&&(this.setFrozenBorders(this.parent.getHeaderTable(),this.fhBdrElement,"3"),this.parent.isFrozenGrid())&&this.parent.getFrozenMode()===$E&&this.setFrozenBorders(this.parent.getHeaderTable(),this.frhBdrElement,"6")},dk.prototype.drawBorders=function(){"BoxWithBorder"===this.selectionSettings.cellSelectionMode&&this.selectedRowCellIndexes.length&&!this.parent.isEdit?(this.parent.element.classList.add("e-enabledboxbdr"),this.bdrElement||this.createBorders(),this.positionBorders(),this.parent.isFrozenGrid()&&(this.showHideBorders("none",!0),this.refreshFrozenBorders())):this.showHideBorders("none")},dk.prototype.isLastCell=function(e){var t=[].slice.call(e.parentElement.querySelectorAll(".e-rowcell:not(.e-hide)"));return t[t.length-1]===e},dk.prototype.isLastRow=function(e){var t=[].slice.call(z(e,oD).querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===t[t.length-1]},dk.prototype.isFirstRow=function(e){var t=[].slice.call(z(e,oD).querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===t[0]},dk.prototype.isFirstCell=function(e){return[].slice.call(e.parentElement.querySelectorAll(".e-rowcell:not(.e-hide)"))[0]===e},dk.prototype.setBorders=function(e,t,i){var n,o,r,s,a,l=[].slice.call(e.getElementsByClassName("e-cellselectionbackground")).filter(function(e){return""===e.style.display});l.length&&this.parent.isFrozenGrid()&&(l=[].slice.call(e.querySelectorAll(".e-cellselectionbackground."+["","e-leftfreeze","e-unfreeze","e-leftfreeze","e-unfreeze","e-rightfreeze","e-rightfreeze"][""+i]+":not(.e-hide)")).filter(function(e){return""===e.style.display})),l.length?(e=this.parent.isFrozenGrid(),a=l[0],l=l[l.length-1],n=a.getBoundingClientRect(),o=l.getBoundingClientRect(),r=a.offsetParent.getBoundingClientRect(),(a.offsetParent.classList.contains("e-content")||a.offsetParent.classList.contains("e-headercontent"))&&(r=a.offsetParent.querySelector("table").getBoundingClientRect()),l=e||!this.isLastRow(l)||"1"!==i&&"2"!==i&&"5"!==i?0:2,s=e&&("2"===i||"4"===i)&&this.isFirstCell(a)?1:0,a=("Right"!==this.parent.getFrozenMode()||"1"!==i&&"3"!==i)&&(this.parent.getFrozenMode()!==$E||"5"!==i&&"6"!==i)||!this.isFirstCell(a)?0:1,this.parent.enableRtl?(t.style.right=r.right-n.right-s+"px",t.style.width=n.right-o.left+s+1+"px"):(t.style.left=n.left-r.left-s-a+"px",t.style.width=o.right-n.left+s-a+1+"px"),t.style.top=n.top-r.top+"px",t.style.height=0<o.top-n.top?o.top-r.top+o.height+(e?0:1)-(n.top-r.top)-l+"px":o.height+0-l+(e?0:1)+"px",this.selectDirection+=i):t.style.display="none"},dk.prototype.positionBorders=function(){this.updateStartEndCells(),this.startCell&&this.bdrElement&&this.selectedRowCellIndexes.length&&(this.selectDirection="",this.showHideBorders(""),this.setBorders(this.parent.getContentTable(),this.bdrElement,"1"),this.parent.isFrozenGrid()&&(this.setBorders(this.parent.getContentTable(),this.mcBdrElement,"2"),this.parent.getFrozenMode()===$E)&&this.setBorders(this.parent.getContentTable(),this.frcBdrElement,"5"),this.parent.frozenRows&&(this.setBorders(this.parent.getHeaderTable(),this.fhBdrElement,"3"),this.parent.isFrozenGrid())&&(this.setBorders(this.parent.getHeaderTable(),this.mhBdrElement,"4"),this.parent.getFrozenMode()===$E)&&this.setBorders(this.parent.getHeaderTable(),this.frhBdrElement,"6"),this.applyBorders(this.selectDirection))},dk.prototype.applyBothFrozenBorders=function(e){var t=this.parent.enableRtl;switch(e.length){case 6:this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=this.bottom,this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=this.top,this.frcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.frhBdrElement.style.borderWidth=t?this.top_left:this.top_right;break;case 4:e.includes("1")&&e.includes("2")&&e.includes("3")&&e.includes("4")&&(this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=t?this.top_left:this.top_right,this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom),e.includes("2")&&e.includes("4")&&e.includes("5")&&e.includes("6")&&(this.mcBdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.frcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.frhBdrElement.style.borderWidth=t?this.top_left:this.top_right);break;case 3:this.bdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.mcBdrElement.style.borderWidth=this.top_bottom,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.mhBdrElement.style.borderWidth=this.top_bottom,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom);break;case 2:e.includes("1")&&(this.mcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.parent.frozenRows)&&(this.fhBdrElement.style.borderWidth=this.top_right_left),e.includes("2")&&(this.bdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.parent.frozenRows)&&(this.mhBdrElement.style.borderWidth=this.top_right_left),e.includes("3")&&(this.mhBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.bdrElement.style.borderWidth=this.right_bottom_left),e.includes("4")&&(this.fhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frhBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.mcBdrElement.style.borderWidth=this.right_bottom_left),e.includes("5")&&(this.mcBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.parent.frozenRows)&&(this.frhBdrElement.style.borderWidth=this.top_right_left),e.includes("6")&&(this.mhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frcBdrElement.style.borderWidth=this.right_bottom_left);break;default:this.bdrElement.style.borderWidth=this.all_border,this.mcBdrElement.style.borderWidth=this.all_border,this.frcBdrElement.style.borderWidth=this.all_border,this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=this.all_border,this.mhBdrElement.style.borderWidth=this.all_border,this.frhBdrElement.style.borderWidth=this.all_border)}},dk.prototype.applyBorders=function(e){var t=this.parent.enableRtl;if(this.parent.getFrozenMode()===$E)this.applyBothFrozenBorders(e);else switch(e.length){case 4:"Right"===this.parent.getFrozenMode()?(this.bdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.mcBdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.fhBdrElement.style.borderWidth=t?this.top_left:this.top_right,this.mhBdrElement.style.borderWidth=t?this.top_right:this.top_left):(this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=t?this.top_left:this.top_right);break;case 2:"Right"===this.parent.getFrozenMode()?(this.bdrElement.style.borderWidth=e.includes("2")?t?this.top_bottom_left:this.top_right_bottom:this.right_bottom_left,this.mcBdrElement.style.borderWidth=e.includes("1")?t?this.top_right_bottom:this.top_bottom_left:this.right_bottom_left,this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=e.includes("1")?this.top_right_left:t?this.top_bottom_left:this.top_right_bottom,this.mhBdrElement.style.borderWidth=e.includes("2")?this.top_right_left:t?this.top_right_bottom:this.top_bottom_left)):(this.bdrElement.style.borderWidth=e.includes("2")?t?this.top_right_bottom:this.top_bottom_left:this.right_bottom_left,this.parent.isFrozenGrid()&&(this.mcBdrElement.style.borderWidth=e.includes("1")?t?this.top_bottom_left:this.top_right_bottom:this.right_bottom_left),this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=e.includes("1")?this.top_right_left:t?this.top_right_bottom:this.top_bottom_left,this.parent.isFrozenGrid())&&(this.mhBdrElement.style.borderWidth=e.includes("2")?this.top_right_left:t?this.top_bottom_left:this.top_right_bottom));break;default:this.bdrElement.style.borderWidth=this.all_border,this.parent.isFrozenGrid()&&(this.mcBdrElement.style.borderWidth=this.all_border),this.parent.frozenRows&&(this.fhBdrElement.style.borderWidth=this.all_border,this.parent.isFrozenGrid())&&(this.mhBdrElement.style.borderWidth=this.all_border)}},dk.prototype.createBorders=function(){var e;this.bdrElement||((e=Q("div",{className:"e-xlsel",id:this.parent.element.id+"_bdr"})).style.cssText="width: 2px; border-width: 0;",this.bdrElement=this.parent.getContentTable().parentElement.appendChild(e),this.parent.isFrozenGrid()&&((e=Q("div",{className:"e-xlsel",id:this.parent.element.id+"_mcbdr"})).style.cssText="height: 2px; border-width: 0;",this.mcBdrElement=this.parent.getContentTable().parentElement.appendChild(e),this.parent.getFrozenMode()===$E)&&((e=Q("div",{className:"e-xlsel",id:this.parent.element.id+"_frcbdr"})).style.cssText="height: 2px; border-width: 0;",this.frcBdrElement=this.parent.getContentTable().parentElement.appendChild(e)),this.parent.frozenRows&&((e=Q("div",{className:"e-xlsel",id:this.parent.element.id+"_fhbdr"})).style.height="2px",this.fhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(e)),this.parent.frozenRows&&this.parent.isFrozenGrid()&&((e=Q("div",{className:"e-xlsel",id:this.parent.element.id+"_mhbdr"})).style.height="2px",this.mhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(e),this.parent.getFrozenMode()===$E)&&((e=Q("div",{className:"e-xlsel",id:this.parent.element.id+"_frhbdr"})).style.height="2px",this.frhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(e)))},dk.prototype.showHideBorders=function(e,t){var i;this.bdrElement&&(this.bdrElement.style.display=e,this.parent.isFrozenGrid()&&(q((i=this.parent.getContentTable()).querySelectorAll(".e-xlsel-top-border"),"e-xlsel-top-border"),q(i.querySelectorAll(".e-xlsel-left-border"),"e-xlsel-left-border"),q(i.querySelectorAll(".e-xlsel-right-border"),"e-xlsel-right-border"),q(i.querySelectorAll(".e-xlsel-bottom-border"),"e-xlsel-bottom-border"),t||(this.mcBdrElement.style.display=e),this.parent.getFrozenMode()===$E)&&(this.frcBdrElement.style.display=e),this.parent.frozenRows&&(q((i=this.parent.getHeaderTable()).querySelectorAll(".e-xlsel-top-border"),"e-xlsel-top-border"),q(i.querySelectorAll(".e-xlsel-left-border"),"e-xlsel-left-border"),q(i.querySelectorAll(".e-xlsel-right-border"),"e-xlsel-right-border"),q(i.querySelectorAll(".e-xlsel-bottom-border"),"e-xlsel-bottom-border"),this.fhBdrElement.style.display=e),this.parent.frozenRows)&&this.parent.isFrozenGrid()&&(t||(this.mhBdrElement.style.display=e),this.parent.getFrozenMode()===$E)&&(this.frhBdrElement.style.display=e)},dk.prototype.drawAFBorders=function(){this.bdrAFBottom||this.createAFBorders(),this.positionAFBorders()},dk.prototype.positionAFBorders=function(){var e,t,i,n,o,r,s,a,l,h,d,p,c,u;this.startCell&&this.bdrAFLeft&&(e=this.startAFCell.getBoundingClientRect(),i=0<(t=this.endAFCell.getBoundingClientRect()).top-e.top?1:0,n=0<=t.top-e.top&&(A(this.startAFCell,_E)||A(this.startAFCell,"e-frozencontent"))&&this.isFirstRow(this.startAFCell)?1.5:0,o=(A(this.startAFCell,_E)||A(this.startAFCell,HE))&&this.isFirstCell(this.startAFCell)?1:0,r=this.isLastRow(this.endAFCell)&&(A(this.endAFCell,_E)||A(this.endAFCell,"e-frozencontent"))?2:0,s=this.startAFCell.offsetParent.getBoundingClientRect(),a=this.parent.element.getBoundingClientRect(),d=this.startAFCell.offsetParent.parentElement.scrollTop,p=this.startAFCell.offsetParent.parentElement.scrollLeft,d=d-this.startAFCell.offsetTop,p=p-this.startAFCell.offsetLeft,l=this.parent.element.clientHeight-aB(),this.parent.allowPaging&&(l-=this.parent.element.querySelector(".e-pager").offsetHeight),this.parent.aggregates.length&&(l-=this.parent.getFooterContent().offsetHeight),h=this.parent.element.clientWidth-("auto"!==this.parent.height?aB():0),d=0<d?Math.floor(d)-1:0,p=0<p?p:0,u=e.left-a.left,this.parent.enableRtl?(c=A(this.startAFCell,_E)||A(this.startAFCell,HE)?e.right-this.startAFCell.offsetParent.parentElement.getBoundingClientRect().width-a.left:0,this.bdrAFLeft.style.right=a.right-t.right-2+t.width+"px",this.bdrAFLeft.style.width=h<=parseInt(this.bdrAFLeft.style.right,10)?"0px":"2px",c=a.right-e.right-o+c-1,this.bdrAFRight.style.right=0<c?c+"px":"0px",this.bdrAFTop.style.left=t.left-a.left-.5+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFLeft.style.right,10)-parseInt(this.bdrAFRight.style.right,10)-o+1+"px",parseInt(this.bdrAFTop.style.left,10)<0&&(this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)+"px","auto"!==this.parent.height&&aB()?(this.bdrAFTop.style.left=aB()+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)-aB()+"px"):this.bdrAFTop.style.left="0px")):(this.bdrAFLeft.style.left=u-o+p-1+"px",this.bdrAFRight.style.left=t.left-a.left-2+t.width+"px",this.bdrAFRight.style.width=h<=parseInt(this.bdrAFRight.style.left,10)?"0px":"2px",this.bdrAFTop.style.left=u+p-.5+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFRight.style.left,10)-parseInt(this.bdrAFLeft.style.left,10)-o+1+"px",h<=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)&&(c=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)-h,this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)-c+"px")),this.bdrAFLeft.style.top=e.top-a.top-n+d+"px",this.bdrAFLeft.style.height=0<t.top-e.top?t.top-s.top+t.height+1-(e.top-s.top)+n-r-d+"px":t.height+n-r-d+"px",this.bdrAFRight.style.top=this.bdrAFLeft.style.top,this.bdrAFRight.style.height=parseInt(this.bdrAFLeft.style.height,10)+"px",this.bdrAFTop.style.top=this.bdrAFRight.style.top,this.bdrAFBottom.style.left=this.bdrAFTop.style.left,this.bdrAFBottom.style.top=parseFloat(this.bdrAFLeft.style.top)+parseFloat(this.bdrAFLeft.style.height)-i-1+"px",this.bdrAFBottom.style.width=l<=parseFloat(this.bdrAFBottom.style.top)?"0px":this.bdrAFTop.style.width,l<=parseInt(this.bdrAFLeft.style.height,10)+parseInt(this.bdrAFLeft.style.top,10))&&(u=parseInt(this.bdrAFLeft.style.height,10)+parseInt(this.bdrAFLeft.style.top,10)-l,this.bdrAFLeft.style.height=parseInt(this.bdrAFLeft.style.height,10)-u+"px",this.bdrAFRight.style.height=parseInt(this.bdrAFLeft.style.height,10)+"px")},dk.prototype.createAFBorders=function(){var e;this.bdrAFLeft||((e=Q("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafleft"})).style.width="2px",this.bdrAFLeft=this.parent.element.appendChild(e),(e=Q("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafright"})).style.width="2px",this.bdrAFRight=this.parent.element.appendChild(e),(e=Q("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafbottom"})).style.height="2px",this.bdrAFBottom=this.parent.element.appendChild(e),(e=Q("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdraftop"})).style.height="2px",this.bdrAFTop=this.parent.element.appendChild(e))},dk.prototype.destroyAutoFillElements=function(){this.bdrAFLeft&&(this.bdrAFLeft.remove(),this.bdrAFRight.remove(),this.bdrAFBottom.remove(),this.bdrAFTop.remove(),this.bdrAFLeft=this.bdrAFRight=this.bdrAFBottom=this.bdrAFTop=null),this.autofill&&(this.autofill.remove(),this.autofill=null)},dk.prototype.showAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="",this.bdrAFRight.style.display="",this.bdrAFBottom.style.display="",this.bdrAFTop.style.display="")},dk.prototype.hideAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="none",this.bdrAFRight.style.display="none",this.bdrAFBottom.style.display="none",this.bdrAFTop.style.display="none")},dk.prototype.updateValue=function(e,t,i){var n=this.createBeforeAutoFill(e,t,i);n.cancel||(t=this.parent.getColumnByIndex(t),this.parent.editModule&&i&&("number"===t.type?this.parent.editModule.updateCell(e,t.field,parseFloat(n.value)):this.parent.editModule.updateCell(e,t.field,n.value)))},dk.prototype.createBeforeAutoFill=function(e,t,i){t={column:this.parent.getColumnByIndex(t),value:i.innerText};return this.parent.trigger(N1,t),t},dk.prototype.getAutoFillCells=function(e,t){return[].slice.call(this.parent.getDataRows()[parseInt(e.toString(),10)].querySelectorAll(".e-cellselectionbackground"))},dk.prototype.selectLikeAutoFill=function(e,t){var i=parseInt(A(this.startAFCell,UE).getAttribute(nD),10)-1,n=parseInt(this.startAFCell.getAttribute(iD),10)-1,o=parseInt(A(this.endAFCell,UE).getAttribute(nD),10)-1,r=parseInt(this.endAFCell.getAttribute(iD),10)-1,s=this.selectedRowCellIndexes.length-1,a=this.selectedRowCellIndexes[0].cellIndexes.length-1;switch(!0){case!t&&this.endAFCell.classList.contains("e-cellselectionbackground")&&!!A(e.target,LE):this.startAFCell=this.parent.getCellFromIndex(i,n),this.endAFCell=this.parent.getCellFromIndex(i+s,n+a),this.drawAFBorders();break;case this.autoFillRLselection&&n+a<r&&o-i-s<r-n-a+1&&i-o<r-n-a+1:if(this.endAFCell=this.parent.getCellFromIndex(i+s,r),o=parseInt(A(this.endAFCell,UE).getAttribute(nD),10)-1,r=parseInt(this.endAFCell.getAttribute(iD),10)-1,t){for(var l=parseInt(this.endCell.getAttribute(iD),10)-1,h=i;h<=o;h++)for(var d=this.getAutoFillCells(h,n),p=0,c=1+l;c<=r;c++)a<p&&(p=0),this.updateValue(h,c,d[parseInt(p.toString(),10)]),p++;this.selectCellsByRange({rowIndex:i,cellIndex:this.startCellIndex},{rowIndex:o,cellIndex:r})}else this.drawAFBorders();break;case this.autoFillRLselection&&r<n&&o-i-s<n-r+1&&i-o<n-r+1:if(this.startAFCell=this.parent.getCellFromIndex(i,r),this.endAFCell=this.endCell,t){for(h=i;h<=i+s;h++)for(p=((d=this.getAutoFillCells(h,n)).reverse(),0),c=this.startCellIndex-1;r<=c;c--)a<p&&(p=0),this.updateValue(h,c,d[parseInt(p.toString(),10)]),p++;this.selectCellsByRange({rowIndex:i,cellIndex:r},{rowIndex:i+s,cellIndex:this.startCellIndex+a})}else this.drawAFBorders();break;case o<i:if(this.startAFCell=this.parent.getCellFromIndex(o,n),this.endAFCell=this.endCell,t){for(var u=g=parseInt(this.endCell.parentElement.getAttribute(nD),10)-1,h=i-1;o<=h;h--){u===this.startIndex-1&&(u=g);d=this.getAutoFillCells(u,n),p=0;u--;for(c=this.startCellIndex;c<=this.startCellIndex+a;c++)this.updateValue(h,c,d[parseInt(p.toString(),10)]),p++}this.selectCellsByRange({rowIndex:o,cellIndex:n+a},{rowIndex:i+s,cellIndex:n})}else this.drawAFBorders();break;default:if(this.endAFCell=this.parent.getCellFromIndex(o,n+a),t){for(var g=parseInt(this.endCell.parentElement.getAttribute(nD),10)-1,u=this.startIndex,h=g+1;h<=o;h++){u===g+1&&(u=this.startIndex);for(var d=this.getAutoFillCells(u,n),p=(u++,0),m=this.startCellIndex;m<=this.startCellIndex+a;m++)this.updateValue(h,m,d[parseInt(p.toString(),10)]),p++}this.selectCellsByRange({rowIndex:g-s,cellIndex:n},{rowIndex:o,cellIndex:n+a})}else this.drawAFBorders()}},dk.prototype.mouseUpHandler=function(e){this.stopTimer(),document.body.classList.remove("e-disableuserselect"),this.element&&!je(this.element.parentElement)&&ue(this.element),this.isDragged&&1===this.selectedRowCellIndexes.length&&1===this.selectedRowCellIndexes[0].cellIndexes.length?this.mUPTarget=A(e.target,LE):this.mUPTarget=null;var t,i=z(e.target,".e-rowcell");this.isDragged&&!this.isAutoFillSel&&"Cell"===this.selectionSettings.mode&&i&&i.classList.contains(LE)&&(t=parseInt(i.parentElement.getAttribute(nD),10)-1,i=parseInt(i.getAttribute(iD),10)-1,this.isDragged=!1,this.clearCellSelection(),this.selectCellsByRange({rowIndex:this.startDIndex,cellIndex:this.startDCellIndex},{rowIndex:t,cellIndex:i})),this.isDragged=!1,this.updateAutoFillPosition(),this.isAutoFillSel&&(this.preventFocus=!0,t=A(e.target,LE),this.endAFCell=t||(this.endCell===this.endAFCell?this.startAFCell:this.endAFCell),this.startAFCell=this.startCell,je(this.endAFCell)||je(this.startAFCell)||(this.updateStartCellsIndex(),this.selectLikeAutoFill(e,!0),this.updateAutoFillPosition(),this.hideAFBorders(),this.positionBorders(),this.parent.isFrozenGrid()&&(this.showHideBorders("none",!0),this.refreshFrozenBorders()),0<this.parent.aggregates.length&&this.parent.notify(px,{})),this.isAutoFillSel=!1,this.preventFocus=!1),E.remove(this.parent.getContent(),"mousemove",this.mouseMoveHandler),this.parent.frozenRows&&E.remove(this.parent.getHeaderContent(),"mousemove",this.mouseMoveHandler),E.remove(document,"mouseup",this.mouseUpHandler)},dk.prototype.hideAutoFill=function(){this.autofill&&(this.autofill.style.display="none")},dk.prototype.updateAutoFillPosition=function(){var e,t,i,n;this.parent.enableAutoFill&&!this.parent.isEdit&&-1<this.selectionSettings.cellSelectionMode.indexOf("Box")&&!this.isRowType()&&!this.isSingleSel()&&this.selectedRowCellIndexes.length?(n=parseInt(this.target.getAttribute(iD),10)-1,e=parseInt(this.target.getAttribute("index"),10),t=this.selectedRowCellIndexes[this.selectedRowCellIndexes.length-1].rowIndex,t=this.getAutoFillCells(t,n).filter(function(e){return""===e.style.display}),(n=this.parent.getColumnByIndex(n)).getFreezeTableName(),e=e<this.parent.frozenRows,n=this.parent.getFrozenMode()===$E&&n.getFreezeTableName()===eD,ge("#"+this.parent.element.id+"_autofill",A(this.target,QE))||(ge("#"+this.parent.element.id+"_autofill",this.parent.element)&&ge("#"+this.parent.element.id+"_autofill",this.parent.element).remove(),this.autofill=Q("div",{className:"e-autofill",id:this.parent.element.id+"_autofill"}),this.autofill.style.display="none",(this.target.classList.contains("e-leftfreeze")||this.target.classList.contains("e-rightfreeze")||this.target.classList.contains("e-fixedfreeze"))&&this.autofill.classList.add("e-freeze-autofill"),(e?this.parent.getHeaderTable():this.parent.getContentTable()).parentElement.appendChild(this.autofill),n&&(e?this.parent.getHeaderTable():this.parent.getContentTable()).parentElement.appendChild(this.autofill)),(n=t[t.length-1])&&n.offsetParent&&(e=n.getBoundingClientRect(),t=n.offsetParent.getBoundingClientRect(),(n.offsetParent.classList.contains("e-content")||n.offsetParent.classList.contains("e-headercontent"))&&(t=n.offsetParent.querySelector("table").getBoundingClientRect()),i=this.isLastCell(n)?4:0,n=this.isLastRow(n)?3:0,this.parent.enableRtl?this.autofill.style.right=t.right-e.right+e.width-4-i+"px":this.autofill.style.left=e.left-t.left+e.width-4-i+"px",this.autofill.style.top=e.top-t.top+e.height-5-n+"px"),this.autofill.style.display=""):this.hideAutoFill()},dk.prototype.mouseDownHandler=function(e){this.mouseButton=e.button;var t,i=e.target,n=this.parent,o=A(i,"e-grid");if(!(o&&o.id!==n.element.id||A(i,VE)&&!this.parent.frozenRows||A(i,"e-editedbatchcell")||A(i,GE))){if((e.shiftKey||e.ctrlKey)&&e.preventDefault(),A(i,LE)&&!e.shiftKey&&!e.ctrlKey){if(-1<n.selectionSettings.cellSelectionMode.indexOf("Box")&&!this.isRowType()&&!this.isSingleSel())t=this.isCellDrag=!0;else if(n.allowRowDragAndDrop&&!n.isEdit&&!this.parent.selectionSettings.checkboxOnly){if(this.isRowDragSelected=!1,!this.isRowType()||this.isSingleSel()||z(i,"td").classList.contains("e-selectionbackground"))return void(this.isDragged=!1);t=!0,this.element=this.parent.createElement("div",{className:"e-griddragarea"}),n.getContent().appendChild(this.element)}t&&this.enableDrag(e,!0)}this.updateStartEndCells(),(i.classList.contains("e-autofill")||i.classList.contains("e-xlsel"))&&(this.isCellDrag=!0,this.isAutoFillSel=!0,this.enableDrag(e))}},dk.prototype.updateStartEndCells=function(){var e=[].slice.call(this.parent.element.getElementsByClassName("e-cellselectionbackground"));this.startCell=e[0],this.endCell=e[e.length-1],this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute(nD),10)-1,this.startCellIndex=parseInt(A(this.startCell,LE).getAttribute(iD),10)-1)},dk.prototype.updateStartCellsIndex=function(){this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute(nD),10)-1,this.startCellIndex=parseInt(A(this.startCell,LE).getAttribute(iD),10)-1)},dk.prototype.enableDrag=function(e,t){var i=this.parent,t=(t&&(t=z(e.target,"tr"),this.startDIndex=parseInt(t.getAttribute(nD),10)-1,this.startDCellIndex=parseInt(A(e.target,LE).getAttribute(iD),10)-1),document.body.classList.add("e-disableuserselect"),i.element.getBoundingClientRect()),e=JP(e);this.x=e.x-t.left,this.y=e.y-t.top,E.add(i.getContent(),"mousemove",this.mouseMoveHandler,this),this.parent.frozenRows&&E.add(i.getHeaderContent(),"mousemove",this.mouseMoveHandler,this),E.add(document,"mouseup",this.mouseUpHandler,this)},dk.prototype.clearSelAfterRefresh=function(e){var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;if("virtualscroll"===e.requestType||this.parent.isPersistSelection||t||this.clearSelection(),("virtualscroll"===e.requestType||t)&&this.parent.isPersistSelection&&this.isPartialSelection&&this.isHdrSelectAllClicked){var i=this.parent.getRowsObject().filter(function(e){return e.isSelectable}),n=[];this.selectedRowState={},this.persistSelectedData=[];for(var o=0;o<i.length;o++){n.push(i[parseInt(o.toString(),10)].index);var r=this.getPkValue(this.primaryKey,i[parseInt(o.toString(),10)].data);this.selectedRowState[""+r]=!0,this.persistSelectedData.push(i[parseInt(o.toString(),10)].data)}this.selectedRowIndexes=n}},dk.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:K1,handler:this.enableAfterRender},{event:G1,handler:this.initializeSelection},{event:gx,handler:this.onActionComplete},{event:mx,handler:this.onActionComplete},{event:Z1,handler:this.onPropertyChanged},{event:vx,handler:this.onCellFocused},{event:wI,handler:this.clearSelAfterRefresh},{event:Ix,handler:this.columnPositionChanged},{event:X1,handler:this.initialEnd},{event:Ex,handler:this.rowsRemoved},{event:tx,handler:this.refreshHeader},{event:fx,handler:this.destroyAutoFillElements},{event:Cx,handler:this.destroy}],CF(this.parent,this.evtHandlers,!0,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.addEventListener(WA,this.actionBeginFunction),this.parent.addEventListener(QA,this.actionCompleteFunction),this.addEventListener_checkbox())},dk.prototype.removeEventListener=function(){this.parent.isDestroyed||(E.remove(document,"mouseup",this.mouseUpHandler),E.remove(this.parent.getContent(),"mousedown",this.mouseDownHandler),E.remove(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler),CF(this.parent,this.evtHandlers,!1),this.parent.removeEventListener(WA,this.actionBeginFunction),this.parent.removeEventListener(QA,this.actionCompleteFunction),this.removeEventListener_checkbox(),this.parent.off(fx,this.destroyAutoFillElements))},dk.prototype.wireEvents=function(){this.isMacOS=-1!==navigator.userAgent.indexOf("Mac OS"),this.isMacOS?(E.add(this.parent.element,"keydown",this.keyDownHandler,this),E.add(this.parent.element,"keyup",this.keyUpHandler,this)):this.parent.allowKeyboard||E.add(this.parent.element,"keydown",this.keyDownHandler,this)},dk.prototype.unWireEvents=function(){this.isMacOS?(E.remove(this.parent.element,"keydown",this.keyDownHandler),E.remove(this.parent.element,"keyup",this.keyUpHandler)):this.parent.allowKeyboard||E.remove(this.parent.element,"keydown",this.keyDownHandler)},dk.prototype.columnPositionChanged=function(){this.parent.isPersistSelection||this.clearSelection()},dk.prototype.refreshHeader=function(){this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&!this.parent.getDataModule().isRemote()&&(this.gridCurrentRecord=this.getData()),this.setCheckAllState()},dk.prototype.rowsRemoved=function(e){for(var t=0;t<e.records.length;t++){var i=this.getPkValue(this.primaryKey,e.records[parseInt(t.toString(),10)]);delete this.selectedRowState[""+i],--this.totalRecordsCount}this.setCheckAllState()},dk.prototype.beforeFragAppend=function(e){"virtualscroll"===e.requestType||this.parent.isPersistSelection||this.clearSelection()},dk.prototype.getCheckAllBox=function(){return this.parent.getHeaderContent().querySelector(".e-checkselectall")},dk.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.render(),this.initPerisistSelection())},dk.prototype.render=function(e){E.add(this.parent.getContent(),"mousedown",this.mouseDownHandler,this),E.add(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler,this)},dk.prototype.onPropertyChanged=function(e){var t;e.module===this.getModuleName()&&(t=this.parent,je(e.properties.type)||("Single"===this.selectionSettings.type?(t.element.removeAttribute("aria-multiselectable"),1<this.selectedRowCellIndexes.length&&(this.clearCellSelection(),this.prevCIdxs=void 0),1<this.selectedRowIndexes.length&&(this.clearRowSelection(),this.prevRowIndex=void 0),1<this.selectedColumnsIndexes.length&&(this.clearColumnSelection(),this.prevColIndex=void 0),this.enableSelectMultiTouch=!1,this.hidePopUp()):"Multiple"===this.selectionSettings.type&&t.element.setAttribute("aria-multiselectable","true")),je(e.properties.mode)&&je(e.properties.cellSelectionMode)||(this.clearSelection(),this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevColIndex=void 0),this.isPersisted=!0,this.checkBoxSelectionChanged(),this.isPersisted=!1,this.parent.isCheckBoxSelection||this.initPerisistSelection(),this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&(t.isCheckBoxSelection=!("ResetOnRowClick"===this.selectionSettings.checkboxMode)),this.drawBorders())},dk.prototype.hidePopUp=function(){this.parent.element.querySelector(".e-gridpopup").getElementsByClassName("e-rowselect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none")},dk.prototype.initialEnd=function(){this.selectedRowIndexes.length||(this.parent.off(X1,this.initialEnd),this.selectRow(this.parent.selectedRowIndex))},dk.prototype.checkBoxSelectionChanged=function(){var e=this.parent,t=(e.off(X1,this.checkBoxSelectionChanged),e.getColumns().filter(function(e){return"checkbox"===e.type}));0<t.length&&(e.isCheckBoxSelection=!0,this.chkField=t[0].field,this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount,je(this.totalRecordsCount)&&(this.totalRecordsCount=this.getCurrentBatchRecordChanges().length),this.isSingleSel()?(e.selectionSettings.type="Multiple",e.dataBind()):this.initPerisistSelection()),e.isCheckBoxSelection||this.isPersisted||(this.chkField=null,this.initPerisistSelection())},dk.prototype.initPerisistSelection=function(){var e=this.parent;this.parent.selectionSettings.persistSelection&&0<this.parent.getPrimaryKeyFieldNames().length?(e.isPersistSelection=!0,this.ensureCheckboxFieldSelection()):0<this.parent.getPrimaryKeyFieldNames().length?(e.isPersistSelection=!1,this.ensureCheckboxFieldSelection()):(e.isPersistSelection=!1,this.selectedRowState={})},dk.prototype.ensureCheckboxFieldSelection=function(){var e=this.parent;this.primaryKey=this.parent.getPrimaryKeyFieldNames()[0],!e.enableVirtualization&&this.chkField&&(e.isPersistSelection&&0===Object.keys(this.selectedRowState).length||!e.isPersistSelection)&&this.dataSuccess(!je(this.parent.dataSource)&&this.parent.dataSource.result||this.parent.getDataModule().isRemote()?this.parent.getCurrentViewRecords():this.parent.renderModule.data.dataManager.dataSource.json)},dk.prototype.dataSuccess=function(e){for(var t=0;t<e.length;t++){var i=this.getPkValue(this.primaryKey,e[parseInt(t.toString(),10)]),n=e[parseInt(t.toString(),10)][this.chkField];je(this.selectedRowState[""+i])&&n&&"boolean"==typeof n&&(this.selectedRowState[""+i]=n,this.parent.isPersistSelection)&&this.persistSelectedData.push(e[parseInt(t.toString(),10)])}},dk.prototype.setRowSelection=function(e){if(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)if(e){var t=Object.keys(this.selectedRowState),i=Object.keys(this.unSelectedRowState);if(!this.isCheckboxReset)for(var n,o=0,r=this.parent.groupSettings.columns.length&&this.parent.isPersistSelection?this.parent.currentViewData.records:this.parent.currentViewData;o<r.length;o++)je((p=r[o])[this.primaryKey])||(n=p[this.primaryKey].toString(),-1===t.indexOf(n)&&-1===i.indexOf(n)&&(this.selectedRowState[p[this.primaryKey]]=!0))}else this.selectedRowState={},this.unSelectedRowState={},this.rmtHdrChkbxClicked=!1;else if(e)if(this.isPartialSelection&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))for(var s=0,a=this.parent.getRowsObject().filter(function(e){return e.isSelectable});s<a.length;s++){var l=a[s];this.selectedRowState[this.getPkValue(this.primaryKey,l.data)]=!0}else{e=this.isPartialSelection?this.parent.partialSelectedRecords:this.getData();if(this.parent.groupSettings.columns.length)for(var h=0,d=this.isPartialSelection?e:e.records;h<d.length;h++){var p=d[h];this.selectedRowState[this.getPkValue(this.primaryKey,p)]=!0}else for(var c=0,u=e;c<u.length;c++){var p=u[c];this.selectedRowState[this.getPkValue(this.primaryKey,p)]=!0}}else this.selectedRowState={}},dk.prototype.getData=function(){return this.parent.getDataModule().dataManager.executeLocal(this.parent.getDataModule().generateQuery(!0))},dk.prototype.getAvailableSelectedData=function(){var e=new me(this.persistSelectedData).executeLocal(this.parent.getDataModule().generateQuery(!0));return e=this.parent.groupSettings.columns.length&&e&&e.records?e.records.slice():e},dk.prototype.refreshPersistSelection=function(){var e=this.parent.getRows();if(this.totalRecordsCount=this.parent.getCurrentViewRecords().length,this.parent.allowPaging&&(this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount),!je(e)&&0<e.length&&(this.parent.isPersistSelection||this.chkField)){for(var t=[],i=0;i<e.length;i++){var n,o,r=this.getRowObj(e[parseInt(i.toString(),10)]),s=r&&r.data?this.getPkValue(this.primaryKey,r.data):null;if(null===s)return;this.isPartialSelection&&!r.isSelectable||(n=void 0,o=e[parseInt(i.toString(),10)].querySelector(".e-checkselect"),this.selectedRowState[""+s]||"Check"===this.parent.checkAllRows&&this.selectedRowState[""+s]&&this.totalRecordsCount===Object.keys(this.selectedRowState).length&&this.chkAllCollec.indexOf(s)<0||"Uncheck"===this.parent.checkAllRows&&0<this.chkAllCollec.indexOf(s)&&!this.parent.selectedRowIndex||"Intermediate"===this.parent.checkAllRows&&!je(this.chkField)&&r.data[this.chkField]?(t.push(parseInt(e[parseInt(i.toString(),10)].getAttribute(nD),10)-1),n=!0):(n=!1,this.checkedTarget!==o&&this.parent.isCheckBoxSelection&&o&&TB(o.nextElementSibling,n)),this.updatePersistCollection(e[parseInt(i.toString(),10)],n))}this.isSingleSel()&&0<t.length?this.selectRow(t[0],!0):this.selectRows(t)}(this.parent.isCheckBoxSelection||"ResetOnRowClick"===this.parent.selectionSettings.checkboxMode)&&0<this.getCurrentBatchRecordChanges().length&&this.setCheckAllState()},dk.prototype.actionBegin=function(e){if("save"===e.requestType&&this.parent.isPersistSelection){var t=this.parent.element.querySelector(".e-edit-checkselect");if(!je(t)){var i=z(t,"."+GE);if(i){"Dialog"===this.parent.editSettings.mode&&(i=this.parent.element.querySelector(".e-dlgeditrow"));i=this.getRowObj(i);if(!i)return;this.selectedRowState[this.getPkValue(this.primaryKey,i.data)]=i.isSelected=t.checked}else this.isCheckedOnAdd=t.checked}}this.parent.isPersistSelection&&this.isPartialSelection&&("paging"===e.requestType&&(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.selectedRowIndexes=[]),"filtering"!==e.requestType&&"searching"!==e.requestType||(this.parent.partialSelectedRecords=[],this.parent.disableSelectedRecords=[]))},dk.prototype.actionComplete=function(e){var t;if("save"===e.requestType&&this.parent.isPersistSelection&&("add"===e.action&&(this.isCheckedOnAdd&&(t=this.parent.getRowObjectFromUID(this.parent.getRows()[e.selectedRow].getAttribute("data-uid")),this.selectedRowState[this.getPkValue(this.primaryKey,t.data)]=t.isSelected=this.isCheckedOnAdd),this.isHdrSelectAllClicked=!1,this.setCheckAllState()),this.refreshPersistSelection()),"delete"===e.requestType&&this.parent.isPersistSelection){for(var i=e.data.slice(),n=0;n<i.length;n++){var o=this.getPkValue(this.primaryKey,i[parseInt(n.toString(),10)]);je(o)||this.updatePersistDelete(o,this.isPartialSelection)}this.isHdrSelectAllClicked=!1,this.setCheckAllState(),this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount}if("paging"===e.requestType){if(this.parent.isPersistSelection&&this.isPartialSelection&&this.isHdrSelectAllClicked){for(var r=this.parent.getRowsObject(),s=[],n=0;n<r.length;n++)r[parseInt(n.toString(),10)].isSelectable&&s.push(r[parseInt(n.toString(),10)].index);s.length&&this.selectRows(s)}this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevECIdxs=void 0}},dk.prototype.onDataBound=function(){if(this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&!this.parent.getDataModule().isRemote()&&(this.gridCurrentRecord=this.getData()),!this.parent.enableVirtualization&&this.parent.isPersistSelection&&this.selectedRecords.length&&(this.isPrevRowSelection=!0),(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)&&this.rmtHdrChkbxClicked&&("Intermediate"===this.parent.checkAllRows?this.setRowSelection(!0):"Uncheck"===this.parent.checkAllRows&&this.setRowSelection(!1)),this.parent.enableVirtualization&&this.setCheckAllState(),this.parent.isPersistSelection&&this.refreshPersistSelection(),this.initialRowSelection=!!(this.isRowType()&&this.parent.element.querySelectorAll(".e-selectionbackground")&&this.parent.getSelectedRows().length),this.parent.isCheckBoxSelection&&!this.initialRowSelection){for(var e=this.parent.getRowsObject(),t=[],i=0;i<e.length;i++)e[parseInt(i.toString(),10)].isSelected&&t.push(i);t.length&&this.selectRows(t),this.initialRowSelection=!0}},dk.prototype.updatePersistSelectedData=function(e){if(this.parent.isPersistSelection){for(var t=this.parent.getRows(),i=0;i<t.length;i++)this.updatePersistCollection(t[parseInt(i.toString(),10)],e);"Uncheck"===this.parent.checkAllRows?(this.setRowSelection(!1),this.persistSelectedData=this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result?this.persistSelectedData:[]):"Check"===this.parent.checkAllRows&&(this.setRowSelection(!0),this.persistSelectedData=this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result||this.isPartialSelection?this.persistSelectedData:(this.parent.groupSettings.columns.length?this.getData().records:this.getData()).slice())}},dk.prototype.checkSelectAllAction=function(e){var t=this.getRenderer(),i=this.parent.element.querySelector(".e-gridform");this.checkedTarget=this.getCheckAllBox(),e&&this.getCurrentBatchRecordChanges().length?(this.parent.checkAllRows="Check",this.updatePersistSelectedData(e),this.selectRowsByRange(t.getVirtualRowIndex(0),t.getVirtualRowIndex(this.getCurrentBatchRecordChanges().length-1)),this.checkVirtualCheckBox()&&!this.parent.isPersistSelection&&(this.virtualSelectedData=this.virtualCheckBoxData().slice(),this.selectedRowIndexes=Object.keys(this.virtualSelectedData).map(function(e){return parseInt(e,10)}))):(this.parent.checkAllRows="Uncheck",this.updatePersistSelectedData(e),this.clearSelection()),this.chkAllCollec=[],je(i)||je(t=i.querySelector(".e-edit-checkselect"))||TB(t.nextElementSibling,e)},dk.prototype.checkSelectAll=function(e){var t=this,i=this.getCheckAllStatus(e),n="Check"===i;if(this.isHeaderCheckboxClicked=!0,(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)&&("Uncheck"===i||this.isCheckboxReset||"Intermediate"===i&&this.parent.isPersistSelection)?this.rmtHdrChkbxClicked=!0:this.rmtHdrChkbxClicked=!1,this.rmtHdrChkbxClicked&&this.isCheckboxReset&&(this.unSelectedRowState={}),this.isCheckboxReset=!1,"Intermediate"===i&&(this.chkField||this.parent.isPersistSelection||(n=this.getCurrentBatchRecordChanges().some(function(e){return t.getPkValue(t.primaryKey,e)in t.selectedRowState})),this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.isPersistSelection)for(var o=0;o<this.getCurrentBatchRecordChanges().length;o++)if(!je(this.getPkValue(this.primaryKey,this.getCurrentBatchRecordChanges()[""+o]))){if(!Object.keys(this.selectedRowState).includes(this.getPkValue(this.primaryKey,this.getCurrentBatchRecordChanges()[""+o]).toString())){n=!1;break}n=!0}this.parent.isPersistSelection&&this.parent.allowPaging&&(this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount),this.checkSelectAllAction(!n),this.target=null,0<this.getCurrentBatchRecordChanges().length&&(this.setCheckAllState(),this.updateSelectedRowIndexes()),this.triggerChkChangeEvent(e,!n)},dk.prototype.getCheckAllStatus=function(e){je(e)?je(this.getCheckAllBox())||(t=this.getCheckAllBox().nextElementSibling.classList):t=e.nextElementSibling.classList;var t,e="None";return t instanceof DOMTokenList&&(t.contains("e-check")?e="Check":t.contains("e-uncheck")?e="Uncheck":t.contains("e-stop")&&(e="Intermediate")),e},dk.prototype.checkSelect=function(e){var t,i=z(this.checkedTarget,"."+LE),n=this.parent,o=(this.isMultiCtrlRequest=!0,0);this.isHeaderCheckboxClicked=!1,o=!BB(n)||(t=i.parentElement.getAttribute("data-uid"),this.parent.enableVirtualization&&this.parent.groupSettings.columns.length)?parseInt(i.parentElement.getAttribute(nD),10)-1:n.getRows().map(function(e){return e.getAttribute("data-uid")}).indexOf(t),this.parent.isPersistSelection&&0<this.parent.element.getElementsByClassName(YE).length&&"Top"===this.parent.editSettings.newRowPosition&&!this.parent.editSettings.showAddNewRow&&++o,this.rowCellSelectionHandler(o,parseInt(i.getAttribute(iD),10)-1),this.moveIntoUncheckCollection(z(i,"."+UE)),this.setCheckAllState(),this.isMultiCtrlRequest=!1,this.triggerChkChangeEvent(e,e.nextElementSibling.classList.contains("e-check"))},dk.prototype.moveIntoUncheckCollection=function(e){"Check"!==this.parent.checkAllRows&&"Uncheck"!==this.parent.checkAllRows||(e=(e=this.getRowObj(e))&&e.data?this.getPkValue(this.primaryKey,e.data):null)&&(this.chkAllCollec.indexOf(e)<0?this.chkAllCollec.push(e):this.chkAllCollec.splice(this.chkAllCollec.indexOf(e),1))},dk.prototype.triggerChkChangeEvent=function(e,t){this.parent.trigger(L1,{checked:t,selectedRowIndexes:this.parent.getSelectedRowIndexes(),target:e}),this.parent.isEdit||(this.checkedTarget=null)},dk.prototype.updateSelectedRowIndexes=function(){if(this.parent.isCheckBoxSelection&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.isPartialSelection&&!(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.selectionSettings.persistSelection&&"Uncheck"!==this.parent.checkAllRows)for(var e=0,t=n=this.parent.getRowsObject().filter(function(e){return e.isSelectable});e<t.length;e++){var i=t[e];this.selectedRowIndexes.push(i.index)}var n;if(this.parent.isCheckBoxSelection&&this.parent.enableVirtualization&&!this.isPartialSelection&&(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)&&!this.parent.isPersistSelection&&"Check"===this.parent.checkAllRows&&(n=this.parent.getRowsObject().filter(function(e){return e.isSelectable})).length!==this.selectedRowIndexes.length)for(var o=0,r=n;o<r.length;o++){i=r[o];this.selectedRowIndexes.indexOf(i.index)<=-1&&this.selectedRowIndexes.push(i.index)}},dk.prototype.updateSelectedRowIndex=function(e){if(this.parent.isCheckBoxSelection&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)&&!this.isPartialSelection)if("Check"===this.parent.checkAllRows){this.selectedRowIndexes=[];for(var t=(this.parent.groupSettings.columns.length?this.getData().records:this.getData()).length,i=0;i<t;i++)this.selectedRowIndexes.push(i)}else{var n;"Uncheck"===this.parent.checkAllRows?this.selectedRowIndexes=[]:(n=this.parent.getRowByIndex(e),e&&n&&"false"===n.getAttribute("aria-selected")&&(n=this.selectedRowIndexes.indexOf(e),this.selectedRowIndexes.splice(n,1)))}},dk.prototype.isAllSelected=function(e){if(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)return this.getAvailableSelectedData().length===(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling?this.parent.totalDataRecordsCount:this.totalRecordsCount);if(this.isPartialSelection){if(this.parent.allowPaging&&this.parent.pageSettings.pageSize<this.parent.pageSettings.totalRecordsCount){for(var t=this.parent.partialSelectedRecords,i=0;i<t.length;i++){var n=this.getPkValue(this.primaryKey,t[parseInt(i.toString(),10)]);if(!this.selectedRowState[""+n])return!1}return!0}return this.isSelectAllRowCount(e)}t=this.getData();this.parent.groupSettings.columns.length&&t.records&&(t=t.records);for(i=0;i<t.length;i++){n=this.getPkValue(this.primaryKey,t[parseInt(i.toString(),10)]);if(!this.selectedRowState[""+n])return!1}return!0},dk.prototype.someDataSelected=function(){if((this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.parent.searchSettings.key.length||this.parent.filterSettings.columns.length))for(var e=this.getAvailableSelectedData(),t=0;t<e.length;t++){var i=this.getPkValue(this.primaryKey,e[parseInt(t.toString(),10)]);if(this.selectedRowState[""+i])return!1}for(var n=this.isPartialSelection?this.parent.partialSelectedRecords:this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result?[]:this.getData(),t=0;t<n.length;t++){i=this.getPkValue(this.primaryKey,n[parseInt(t.toString(),10)]);if(this.selectedRowState[""+i])return!1}return!0},dk.prototype.setCheckAllState=function(e,t){var i,n,o,r,s,a;(this.parent.isCheckBoxSelection||"ResetOnRowClick"===this.parent.selectionSettings.checkboxMode)&&(n=i=!1,o=Object.keys(this.selectedRowState).length,this.parent.element.classList.contains("e-treelistgrid")&&this.parent.isPersistSelection&&!this.parent.enableVirtualization&&!this.parent.getDataModule().isRemote()&&Array.isArray(this.parent.dataSource)&&o===this.parent.dataSource.length&&o>this.totalRecordsCount&&(o=this.totalRecordsCount),this.parent.isPersistSelection||(o=this.selectedRowIndexes.length,this.totalRecordsCount=this.getCurrentBatchRecordChanges().length),!this.parent.isPersistSelection||(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)&&this.isPartialSelection||!this.parent.searchSettings.key.length&&!this.parent.filterSettings.columns.length||(n=!0,i=this.isAllSelected(o)),r=this.getCheckAllBox())&&(q([s=r.nextElementSibling],["e-check","e-stop","e-uncheck"]),xB(r,!1),r.indeterminate=!1,a=this.parent.getDataModule().isRemote()?[]:this.gridCurrentRecord,this.parent.groupSettings.columns.length&&a.records&&(a=a.records),this.totalRecordsCount=this.checkVirtualCheckBox()?a.length:this.totalRecordsCount,i&&n&&(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result||a.length)||!n&&(o===this.totalRecordsCount&&this.totalRecordsCount&&!this.isPartialSelection&&(!(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)||this.parent.allowPaging)||!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling&&this.isPartialSelection&&(this.isSelectAllRowCount(o)||this.isHdrSelectAllClicked)||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!this.parent.allowPaging&&(!(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)&&a.length&&o===a.length||(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)&&!this.isPartialSelection&&(o===this.parent.totalDataRecordsCount||(this.isSelectAllRowCount(o)||o===this.totalRecordsCount)&&!this.parent.isPersistSelection)||this.isPartialSelection&&(this.isHdrSelectAllClicked||this.isSelectAllRowCount(o)))||o===this.totalRecordsCount&&this.totalRecordsCount&&!this.isPartialSelection&&!this.parent.allowPaging&&!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling)?(U([s],["e-check"]),xB(r,!0),t&&this.getRenderer().setSelection(null,!0,!0),this.parent.checkAllRows="Check"):(!this.selectedRowIndexes.length&&(!this.parent.enableVirtualization||!this.persistSelectedData.length&&!n||n&&this.someDataSelected())||0===o&&0===this.getCurrentBatchRecordChanges().length)&&!this.parent.allowPaging||this.parent.allowPaging&&(0===o||o&&n&&this.someDataSelected())?(U([s],["e-uncheck"]),t&&this.getRenderer().setSelection(null,!1,!0),this.parent.checkAllRows="Uncheck"):(U([s],["e-stop"]),this.parent.checkAllRows="Intermediate",r.indeterminate=!0),(0===o&&0===this.getCurrentBatchRecordChanges().length?U:q)([s.parentElement],["e-checkbox-disabled"]),this.isPartialSelection&&(0===this.parent.getRowsObject().filter(function(e){return e.isSelectable}).length&&s.parentElement.querySelector(".e-frame").classList.contains("e-uncheck")?U:q)([s.parentElement],["e-checkbox-disabled"]),!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||this.parent.allowPaging||this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result||this.updateSelectedRowIndex(e))},dk.prototype.checkVirtualCheckBox=function(){return this.parent.enableVirtualization&&!(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.isCheckBoxSelection&&!this.isPartialSelection},dk.prototype.virtualCheckBoxData=function(){var e=this.getData();return e=this.parent.groupSettings.columns.length&&e.records?e.records:e},dk.prototype.isSelectAllRowCount=function(e){var t=0,i=this.parent.getRowsObject();return this.parent.selectionSettings.persistSelection&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?(this.parent.getDataModule().isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result?this.parent.totalDataRecordsCount:this.getData()&&this.getData().length)===i.length&&(t=i.filter(function(e){return e.isSelectable}).length)&&e===t:this.parent.allowPaging&&this.parent.selectionSettings.persistSelection?(t=this.parent.partialSelectedRecords.length+this.parent.disableSelectedRecords.length)===this.totalRecordsCount&&this.parent.partialSelectedRecords.length&&e===this.parent.partialSelectedRecords.length:(t=i.filter(function(e){return e.isSelectable}).length)&&e===t},dk.prototype.keyDownHandler=function(e){("opera"===F.info.name&&17===e.keyCode||"mozilla"===F.info.name&&224===e.keyCode||!("safari"!==F.info.name&&"chrome"!==F.info.name||91!==e.keyCode&&93!==e.keyCode))&&(this.cmdKeyPressed=!0);var t=A(e.target,"e-headercell"),i=A(e.target,LE);(t?t.children[0].classList.contains("e-headerchkcelldiv"):!!i&&i.classList.contains("e-gridchkbox"))&&!this.parent.allowKeyboard&&32===e.keyCode&&e.preventDefault()},dk.prototype.keyUpHandler=function(e){!("opera"===F.info.name&&17===e.keyCode||"mozilla"===F.info.name&&224===e.keyCode)&&("safari"!==F.info.name&&"chrome"!==F.info.name||91!==e.keyCode&&93!==e.keyCode)||(this.cmdKeyPressed=!1)},dk.prototype.clickHandler=function(e){var t,i=e.target,n=(this.actualTarget=i,this.isAutoFillSel||e.ctrlKey||e.shiftKey||(this.startAFCell=this.endAFCell=null),this.selectionSettings.persistSelection&&(this.deSelectedData=_P(this.persistSelectedData)),(A(i,UE)||A(i,"e-headerchkcelldiv")||this.selectionSettings.allowColumnSelection&&i.classList.contains("e-headercell"))&&(this.isInteracted=!0),this.cmdKeyPressed=e.metaKey,this.isMultiCtrlRequest=e.ctrlKey||this.enableSelectMultiTouch||this.isMacOS&&this.cmdKeyPressed,this.parent.allowKeyboard?this.isMultiShiftRequest=e.shiftKey:(this.isMultiShiftRequest=!1,this.isMultiCtrlRequest=!1),this.isMultiCtrlRequestCell=this.isMultiCtrlRequest,this.popUpClickHandler(e),!1),o=(this.preventFocus=!0,A(i,"e-checkbox-wrapper"));this.checkSelectAllClicked=!!(o&&o.getElementsByClassName("e-checkselectall")||this.selectionSettings.persistSelection&&A(i,UE)),this.selectionSettings.persistSelection&&this.isPartialSelection&&A(i,"e-headerchkcelldiv")&&!i.querySelector(".e-checkbox-disabled")&&(this.isHdrSelectAllClicked=!0),o&&0<o.querySelectorAll(".e-checkselect,.e-checkselectall").length&&(t=o.querySelector('input[type="checkbox"]'),n=!0),this.drawBorders(),this.updateAutoFillPosition(),i=A(i,LE),this.parent.isReact&&i&&!i.parentElement&&i.classList.contains("e-rowcell")&&(i=this.parent.getCellFromIndex(parseInt(i.getAttribute("index"),10),parseInt(i.getAttribute("aria-colindex"),10)-1)),this.isRowDragSelected&&je(i)&&this.parent.allowRowDragAndDrop&&this.selectionSettings.persistSelection&&this.checkSelectAllClicked&&(this.isRowDragSelected=!1),(i&&i.parentElement.classList.contains(UE)&&!this.parent.selectionSettings.checkboxOnly||n)&&!this.isRowDragSelected?(this.parent.isCheckBoxSelection&&(this.isMultiCtrlRequest=!0),this.target=i,je(t)?(o=0,o=parseInt(i.parentElement.getAttribute(nD),10)-1,this.parent.isPersistSelection&&!this.parent.editSettings.showAddNewRow&&0<this.parent.element.getElementsByClassName(YE).length&&++o,this.mUPTarget&&this.mUPTarget.isEqualNode(i)||this.rowCellSelectionHandler(o,parseInt(i.getAttribute(iD),10)-1),this.parent.isCheckBoxSelection&&(this.moveIntoUncheckCollection(z(i,"."+UE)),this.setCheckAllState())):(this.checkedTarget=t).classList.contains("e-checkselectall")?this.checkSelectAll(t):this.checkSelect(t),this.parent.isCheckBoxSelection||!F.isDevice||this.isSingleSel()||this.showPopup(e)):e.target.classList.contains("e-headercell")&&!e.target.classList.contains("e-stackedheadercell")&&(n=e.target.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"),this.headerSelectionHandler(this.parent.getColumnIndexByUid(n))),this.isMultiCtrlRequest=!1,this.isMultiCtrlRequestCell=this.isMultiCtrlRequest,this.isMultiShiftRequest=!1,je(z(e.target,".e-unboundcell"))&&(this.preventFocus=!1)},dk.prototype.popUpClickHandler=function(e){var t=e.target;z(t,".e-headercell")||e.target.classList.contains(LE)||z(t,".e-gridpopup")?t.classList.contains("e-rowselect")&&(t.classList.contains("e-spanclicked")?(t.classList.remove("e-spanclicked"),this.enableSelectMultiTouch=!1,this.parent.element.querySelector(".e-gridpopup").style.display="none"):(t.classList.add("e-spanclicked"),this.enableSelectMultiTouch=!0)):this.parent.element.querySelector(".e-gridpopup").style.display="none"},dk.prototype.showPopup=function(e){this.selectionSettings.enableSimpleMultiRowSelection||UP(this.parent.element.querySelector(".e-gridpopup"),e,"e-rowselect e-icons e-icon-rowselect"+(!this.isSingleSel()&&(1<this.selectedRecords.length||1<this.selectedRowCellIndexes.length)?" e-spanclicked":""))},dk.prototype.rowCellSelectionHandler=function(e,t){var i,n;!this.isMultiCtrlRequest&&!this.isMultiShiftRequest||this.isSingleSel()?(this.isDragged||this.selectRow(e,this.selectionSettings.enableToggle),this.selectCell({rowIndex:e,cellIndex:t},this.selectionSettings.enableToggle),this.selectedRowCellIndexes.length&&this.updateAutoFillPosition(),this.drawBorders()):this.isMultiShiftRequest?(this.parent.isCheckBoxSelection||!this.parent.isCheckBoxSelection&&!z(this.target,"."+LE).classList.contains(qE)?this.selectRowsByRange(ee(this.prevRowIndex)?e:this.prevRowIndex,e):this.addRowsToSelection([e]),this.selectCellsByRange(ee(this.prevCIdxs)?{rowIndex:e,cellIndex:t}:this.prevCIdxs,{rowIndex:e,cellIndex:t}),this.updateAutoFillPosition(),this.drawBorders()):(this.addRowsToSelection([e]),"Both"===this.selectionSettings.mode?(n=(i=this.parent.getColumns().find(function(e){return"checkbox"===e.type}))&&i.index!==t)&&!this.isMultiCtrlRequestCell?this.selectCell({rowIndex:e,cellIndex:t},this.selectionSettings.enableToggle):i&&!n||this.addCellsToSelection([{rowIndex:e,cellIndex:t}]):this.addCellsToSelection([{rowIndex:e,cellIndex:t}]),this.showHideBorders("none")),this.isDragged=!1},dk.prototype.onCellFocused=function(e){this.parent.frozenRows&&e.container.isHeader&&e.byKey&&("upArrow"===e.keyArgs.action?this.parent.allowFiltering?e.isJump="INPUT"===e.element.tagName:e.isJump="TH"===e.element.tagName:"downArrow"===e.keyArgs.action?(t=Number(e.element.parentElement.getAttribute(nD))-1,e.isJump=0==t):"ctrlHome"===e.keyArgs.action&&(e.isJump=!0));var t=(e.container.isHeader&&e.isJump||e.container.isContent&&!e.container.isSelectable)&&!(e.byKey&&"space"===e.keyArgs.action)&&!(e.element.classList.contains("e-detailrowexpand")||e.element.classList.contains("e-detailrowcollapse")),i=e.container.isHeader&&"TD"!==e.element.tagName&&!z(e.element,"."+LE)&&!(e.byKey&&"space"===e.keyArgs.action);if(!e.byKey||t)t&&!(this.parent.isCheckBoxSelection||this.selectionSettings.persistSelection&&(e.parent.classList.contains("e-recordplusexpand")||e.parent.classList.contains("e-groupcaption")))&&this.clearSelection();else{var t=(e.container.isContent?e.container:e).indexes,n=t[0],o=t[1],t=this.focus.getPrevIndexes();if((e.element.parentElement.querySelector(".e-rowcelldrag")||e.element.parentElement.querySelector(".e-dtdiagonalright")||e.element.parentElement.querySelector(".e-dtdiagonaldown"))&&(t.cellIndex=t.cellIndex-1),this.parent.frozenRows&&(e.container.isHeader&&("TD"===e.element.tagName||z(e.element,"."+LE))?(r=this.parent.getHeaderTable().querySelector("thead").childElementCount,this.parent.editSettings.showAddNewRow&&"Top"===this.parent.editSettings.newRowPosition&&"upArrow"===e.keyArgs.action&&r++,n-=r,t.rowIndex=je(t.rowIndex)?null:t.rowIndex-r):(n+=this.parent.frozenRows,t.rowIndex=0!==t.rowIndex&&je(t.rowIndex)?null:t.rowIndex+this.parent.frozenRows)),this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&(n=parseInt(e.element.parentElement.getAttribute("aria-rowindex"),10)-1),!(i||-1===["ctrlPlusA","escape"].indexOf(e.keyArgs.action)&&"space"!==e.keyArgs.action&&n===t.rowIndex&&o===t.cellIndex)||this.selectionSettings.allowColumnSelection){this.parent.enableVirtualization&&(n=parseInt(e.element.parentElement.getAttribute("aria-rowindex"),10)-1,!this.parent.enableColumnVirtualization)&&!this.parent.groupSettings.columns.length&&1<=this.parent.totalDataRecordsCount&&("ctrlHome"===e.keyArgs.action?this.parent.isFocusFirstCell=!(n=0):"ctrlEnd"===e.keyArgs.action&&(n=this.parent.totalDataRecordsCount-1,this.isFocusLastCell=!0)),!this.parent.editSettings.showAddNewRow||"Top"!==this.parent.editSettings.newRowPosition||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||"downArrow"!==e.keyArgs.action||n--,this.preventFocus=!0;var r=this.getKeyColIndex(e);switch(this.needColumnSelection&&(o=r),!this.parent.element.classList.contains("e-gridcell-read")||"tab"!==e.keyArgs.action&&"shiftTab"!==e.keyArgs.action&&"rightArrow"!==e.keyArgs.action&&"leftArrow"!==e.keyArgs.action||(i=this.target.getAttribute("aria-label"),i=this.target.innerHTML+" column header "+this.parent.getColumnByIndex(o).field,this.target.setAttribute("aria-label",i)),e.keyArgs.action){case"downArrow":case"upArrow":case"enter":case"shiftEnter":this.target=e.element,this.isKeyAction=!0,this.applyDownUpKey(n,o);break;case"rightArrow":case"leftArrow":this.applyRightLeftKey(n,o);break;case"shiftDown":case"shiftUp":this.shiftDownKey(n,o);break;case"shiftLeft":case"shiftRight":this.applyShiftLeftRightKey(n,o);break;case"home":case"end":o="end"===e.keyArgs.action?this.getLastColIndex(n):0,this.applyHomeEndKey(n,o);break;case"ctrlHome":case"ctrlEnd":this.applyCtrlHomeEndKey(n,o);break;case"escape":this.clearSelection(),this.parent.clipboardModule&&window.navigator.clipboard.writeText("");break;case"ctrlPlusA":this.ctrlPlusA();break;case"space":this.applySpaceSelection(e.element);break;case"tab":this.parent.editSettings.allowNextRowEdit&&this.selectRow(n)}this.needColumnSelection=!1,this.preventFocus=!1,this.positionBorders(),this.parent.isFrozenGrid()&&(this.showHideBorders("none",!0),this.refreshFrozenBorders()),this.updateAutoFillPosition()}}},dk.prototype.getKeyColIndex=function(e){var t=null,i=e.element.querySelector(".e-stackedheadercelldiv");if(this.selectionSettings.allowColumnSelection&&A(e.element,"e-columnheader"))if(this.needColumnSelection=!!e.container.isHeader,i){if("rightArrow"===e.keyArgs.action||"leftArrow"===e.keyArgs.action)return t;var i=i.getAttribute("e-mappinguid"),i=this.getstackedColumns(this.parent.getColumnByUid(i).columns),n=this.parent.getColumnIndexByUid(i[i.length-1].uid),i=this.parent.getColumnIndexByUid(i[0].uid),t=this.prevColIndex>=n?i:n}else t=this.parent.getColumnIndexByUid(e.element.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"));return t},dk.prototype.ctrlPlusA=function(){var e;this.isRowType()&&!this.isSingleSel()&&(e=this.parent.getRowsObject(),this.selectRowsByRange(e[0].index,e[e.length-1].index)),this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange({rowIndex:0,cellIndex:0},{rowIndex:this.parent.getRows().length-1,cellIndex:this.parent.getColumns().length-1})},dk.prototype.applySpaceSelection=function(e){e.classList.contains("e-checkselectall")?(this.checkedTarget=e,this.checkSelectAll(this.checkedTarget)):e.classList.contains("e-checkselect")&&(this.checkedTarget=e,this.checkSelect(this.checkedTarget))},dk.prototype.applyDownUpKey=function(e,t){var i=this.parent;!this.parent.isCheckBoxSelection||"Check"!==this.parent.checkAllRows||this.selectionSettings.persistSelection||this.selectionSettings.checkboxOnly||(this.checkSelectAllAction(!1),this.checkedTarget=null),this.isRowType()&&!this.selectionSettings.checkboxOnly&&(this.parent.frozenRows,this.selectRow(e,!0),this.applyUpDown(i.selectedRowIndex)),this.isCellType()&&this.selectCell({rowIndex:e,cellIndex:t},!0),this.selectionSettings.allowColumnSelection&&this.needColumnSelection&&this.selectColumn(t)},dk.prototype.applyUpDown=function(e){var t;e<0||(this.target||(this.target=this.parent.getRows()[0].children[this.parent.groupSettings.columns.length||0]),t=parseInt(this.target.getAttribute(iD),10)-1,(e=this.contentRenderer.getRowByIndex(e))&&(this.target=e.getElementsByClassName(LE)[parseInt(t.toString(),10)]),this.addAttribute(this.target),this.parent.element.classList.contains("e-gridcell-read")&&(e=this.target.getAttribute("aria-label"),e=this.target.innerHTML,this.target.setAttribute("aria-label",e)))},dk.prototype.applyRightLeftKey=function(e,t){this.selectionSettings.allowColumnSelection&&this.needColumnSelection?this.selectColumn(t):this.isCellType()&&(this.selectCell({rowIndex:e,cellIndex:t},!0),this.addAttribute(this.target))},dk.prototype.applyHomeEndKey=function(e,t){this.isCellType()?this.selectCell({rowIndex:e,cellIndex:t},!0):this.addAttribute(this.parent.getCellFromIndex(e,t))},dk.prototype.shiftDownKey=function(e,t){this.isMultiShiftRequest=!0,this.isRowType()&&!this.isSingleSel()&&(ee(this.prevRowIndex)?this.isPartialSelection?this.selectRow(e,!0):this.selectRow(0,!0):(this.selectRowsByRange(this.prevRowIndex,e),this.applyUpDown(e))),this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange(this.prevCIdxs||{rowIndex:0,cellIndex:0},{rowIndex:e,cellIndex:t}),this.isMultiShiftRequest=!1},dk.prototype.applyShiftLeftRightKey=function(e,t){this.isMultiShiftRequest=!0,this.selectionSettings.allowColumnSelection&&this.needColumnSelection?this.selectColumnsByRange(this.prevColIndex,t):this.selectCellsByRange(this.prevCIdxs,{rowIndex:e,cellIndex:t}),this.isMultiShiftRequest=!1},dk.prototype.getstackedColumns=function(e){for(var t=[],i=0,n=e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?this.getstackedColumns(e[parseInt(i.toString(),10)].columns):t.push(e[parseInt(i.toString(),10)]);return t},dk.prototype.applyCtrlHomeEndKey=function(e,t){this.isRowType()&&(this.selectRow(e,!0),this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.addAttribute(this.parent.getCellFromIndex(e,t))),this.isCellType()&&this.selectCell({rowIndex:e,cellIndex:t},!0)},dk.prototype.addRemoveClassesForRow=function(e,t,i){for(var n,o,r,s=[],a=3;a<arguments.length;a++)s[a-3]=arguments[a];e&&(n=[].slice.call(e.getElementsByClassName(LE)),o=e.querySelector(".e-detailrowcollapse")||e.querySelector(".e-detailrowexpand"),r=e.querySelector(".e-rowdragdrop"),o&&n.push(o),r&&n.push(r),vB.apply(void 0,[n,t].concat(s))),this.getRenderer().setSelection(e?e.getAttribute("data-uid"):null,t,i)},dk.prototype.isRowType=function(){return"Row"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode},dk.prototype.isCellType=function(){return"Cell"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode},dk.prototype.isSingleSel=function(){return"Single"===this.selectionSettings.type},dk.prototype.getRenderer=function(){return je(this.contentRenderer)&&(this.contentRenderer=this.factory.getRenderer(RA.Content)),this.contentRenderer},dk.prototype.getSelectedRecords=function(){var e=[],e=!this.selectionSettings.persistSelection&&this.selectedRecords.length?this.parent.getRowsObject().filter(function(e){return e.isSelected}).map(function(e){return e.data}):this.persistSelectedData;return e=this.checkVirtualCheckBox()&&!this.parent.isPersistSelection?this.virtualSelectedData:e},dk.prototype.selectColumn=function(e){var t=this.parent;if(!je(t.getColumns()[parseInt(e.toString(),10)])){var i=t.getColumnByIndex(e),n=t.getColumnHeaderByUid(i.uid),o=n.classList.contains("e-columnselection");if(t.selectionSettings.allowColumnSelection){var r=1<this.selectedColumnsIndexes.length&&-1<this.selectedColumnsIndexes.indexOf(e);if(this.clearColDependency(),!this.selectionSettings.enableToggle||r||!o){var s={columnIndex:e,headerCell:n,column:i,cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(s,t1),s.cancel)return void this.disableInteracted();!r&&o&&t.selectionSettings.enableToggle&&e===this.prevColIndex||this.updateColSelection(n,e);s={columnIndex:e,headerCell:n,column:i,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(s,i1)}this.updateColProps(e)}}},dk.prototype.selectColumnsByRange=function(e,t){var i=this.parent;if(!je(i.getColumns()[parseInt(e.toString(),10)])){var n=[];if("Single"===i.selectionSettings.type||je(t))n[0]=e;else for(var o=e<t,r=e;o?r<=t:t<=r;o?r++:r--)n.push(r);this.selectColumns(n)}},dk.prototype.selectColumns=function(e){var t=this.parent,i=this.getselectedCols();if("Single"===t.selectionSettings.type&&(e=[e[0]]),t.selectionSettings.allowColumnSelection){this.clearColDependency();var n={columnIndex:e[0],headerCell:i,columnIndexes:e,column:t.getColumnByIndex(e[0]),cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(n,t1),n.cancel)this.disableInteracted();else{for(var o=0,r=e.length;o<r;o++)this.updateColSelection(t.getColumnHeaderByUid(t.getColumnByIndex(e[parseInt(o.toString(),10)]).uid),e[parseInt(o.toString(),10)]);i=this.getselectedCols(),n={columnIndex:e[0],headerCell:i,columnIndexes:e,column:t.getColumnByIndex(e[0]),target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(n,i1),this.updateColProps(e[0])}}},dk.prototype.selectColumnWithExisting=function(e){var t=this.parent;if(!je(t.getColumns()[parseInt(e.toString(),10)])){var i=t.getColumnHeaderByUid(t.getColumnByIndex(e).uid),n=this.getselectedCols();if("Single"===t.selectionSettings.type&&this.clearColDependency(),t.selectionSettings.allowColumnSelection){if(-1<this.selectedColumnsIndexes.indexOf(e))this.clearColumnSelection(e);else{n={columnIndex:e,headerCell:n,columnIndexes:this.selectedColumnsIndexes,column:t.getColumnByIndex(e),cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(n,t1),n.cancel)return void this.disableInteracted();this.updateColSelection(i,e);n={columnIndex:e,headerCell:this.getselectedCols(),column:t.getColumnByIndex(e),columnIndexes:this.selectedColumnsIndexes,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(n,i1)}this.updateColProps(e)}}},dk.prototype.clearColumnSelection=function(e){if(this.isColumnSelected){var t=this.parent;if(je(e)||-1!==this.selectedColumnsIndexes.indexOf(e)){var i=je(e)?this.selectedColumnsIndexes[this.selectedColumnsIndexes.length-1]:e,n=t.getColumnByIndex(i),o=t.getColumnHeaderByUid(n.uid),i={columnIndex:i,headerCell:o,columnIndexes:this.selectedColumnsIndexes,column:n,cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted};if(this.columnDeselect(i,n1))this.disableInteracted();else{for(var r=je(e)?[].slice.call(t.getHeaderContent().getElementsByClassName("e-columnselection")):[o],s=this.getSelectedColumnCells(e),a=0,l=r.length;a<l;a++)vB([r[parseInt(a.toString(),10)]],!1,"e-columnselection");for(a=0,l=s.length;a<l;a++)vB([s[parseInt(a.toString(),10)]],!1,"e-columnselection");je(e)?(this.columnDeselect(i,o1),this.selectedColumnsIndexes=[],this.isColumnSelected=!1,this.parent.getColumns().filter(function(e){return e.isSelected=!1})):(this.selectedColumnsIndexes.splice(this.selectedColumnsIndexes.indexOf(e),1),this.parent.getColumns()[parseInt(e.toString(),10)].isSelected=!1)}}}},dk.prototype.getselectedCols=function(){var e=this.parent;if(1<this.selectedColumnsIndexes.length)for(var t=[],i=0;i<this.selectedColumnsIndexes.length;i++)t.push(e.getColumnHeaderByUid(e.getColumnByIndex(this.selectedColumnsIndexes[parseInt(i.toString(),10)]).uid));else t=e.getColumnHeaderByUid(e.getColumnByIndex(this.selectedColumnsIndexes[0]).uid);return t},dk.prototype.getSelectedColumnCells=function(e){for(var t=this.parent,i=!je(this.parent.rowTemplate)?t.getRows():t.getDataRows(),n=[],o=je(e)?".e-columnselection":'[aria-colindex="'+(e+1)+'"]',r=0,s=i.length;r<s;r++)n=n.concat([].slice.call(i[parseInt(r.toString(),10)].querySelectorAll(o)));return n},dk.prototype.columnDeselect=function(e,t){return"columnDeselected"===t&&delete e.cancel,this.onActionComplete(e,t),e.cancel},dk.prototype.updateColProps=function(e){this.prevColIndex=e,this.isColumnSelected=this.selectedColumnsIndexes.length&&!0},dk.prototype.clearColDependency=function(){this.clearColumnSelection(),this.selectedColumnsIndexes=[]},dk.prototype.updateColSelection=function(e,t){if(!je(this.parent.getColumns()[parseInt(t.toString(),10)])){var i=!je(this.parent.rowTemplate)?this.parent.getRows():this.parent.getDataRows();this.selectedColumnsIndexes.push(t),this.parent.getColumns()[parseInt(t.toString(),10)].isSelected=!0,t+=this.parent.getIndentCount(),vB([e],!0,"e-columnselection");for(var n=0,o=i.length;n<o;n++)if(i[parseInt(n.toString(),10)].classList.contains(UE))if(!i[parseInt(n.toString(),10)].classList.contains(GE)&&!i[parseInt(n.toString(),10)].classList.contains(YE)||"Normal"!==this.parent.editSettings.mode||je(i[parseInt(n.toString(),10)].querySelector("tr").childNodes[parseInt(t.toString(),10)]))if(this.parent.isSpan&&this.parent.isFrozenGrid())for(var r=i[parseInt(n.toString(),10)].querySelectorAll(".e-rowcell"),s=0;s<r.length;s++)r[parseInt(s.toString(),10)].getAttribute("aria-colindex")===e.getAttribute("aria-colindex")&&vB([r[parseInt(s.toString(),10)]],!0,"e-columnselection");else je(i[parseInt(n.toString(),10)].childNodes[parseInt(t.toString(),10)])||vB([i[parseInt(n.toString(),10)].childNodes[parseInt(t.toString(),10)]],!0,"e-columnselection");else vB([i[parseInt(n.toString(),10)].querySelector("tr").childNodes[parseInt(t.toString(),10)]],!0,"e-columnselection")}},dk.prototype.headerSelectionHandler=function(e){!this.isMultiCtrlRequest&&!this.isMultiShiftRequest||this.isSingleSel()?this.selectColumn(e):this.isMultiShiftRequest?this.selectColumnsByRange(ee(this.prevColIndex)?e:this.prevColIndex,e):this.selectColumnWithExisting(e)},dk.prototype.addEventListener_checkbox=function(){var e=this;this.parent.on(Y1,this.dataReady,this),this.onDataBoundFunction=this.onDataBound.bind(this),this.parent.addEventListener(qA,this.onDataBoundFunction),this.parent.on(lE,this.onDataBoundFunction),this.parent.on(X1,this.checkBoxSelectionChanged,this),this.parent.on(MT,this.initPerisistSelection,this),this.parent.on(J1,this.setCheckAllForEmptyGrid,this),this.actionCompleteFunc=this.actionCompleteHandler.bind(this),this.parent.addEventListener(QA,this.actionCompleteFunc),this.parent.on(wx,this.clickHandler,this),this.resizeEndFn=function(){e.updateAutoFillPosition(),e.drawBorders()},this.resizeEndFn.bind(this),this.parent.addEventListener(F1,this.resizeEndFn)},dk.prototype.removeEventListener_checkbox=function(){this.parent.off(Y1,this.dataReady),this.parent.removeEventListener(qA,this.onDataBoundFunction),this.parent.removeEventListener(QA,this.actionCompleteFunc),this.parent.off(lE,this.onDataBoundFunction),this.parent.off(J1,this.setCheckAllForEmptyGrid),this.parent.off(wx,this.clickHandler),this.parent.removeEventListener(F1,this.resizeEndFn),this.parent.off(MT,this.initPerisistSelection)},dk.prototype.setCheckAllForEmptyGrid=function(){var e=this.getCheckAllBox();e&&(this.parent.isCheckBoxSelection=!0,q([e=e.nextElementSibling],["e-check","e-stop","e-uncheck"]),U([e.parentElement],["e-checkbox-disabled"]))},dk.prototype.dataReady=function(e){this.isHeaderCheckboxClicked=!1;var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;"virtualscroll"===e.requestType||this.parent.isPersistSelection||t||(this.disableUI=!(this.parent.enableImmutableMode||"save"===e.requestType&&"add"===e.action),this.clearSelection(),this.setCheckAllState(),this.disableUI=!1)},dk.prototype.actionCompleteHandler=function(e){"save"===e.requestType&&this.parent.isPersistSelection&&this.refreshPersistSelection()},dk.prototype.selectRowIndex=function(e){this.parent.isSelectedRowIndexUpdating=!0,je(this.parent.selectedRowIndex)||-1===this.parent.selectedRowIndex||!this.parent.enablePersistence?this.parent.selectedRowIndex=e:this.parent.selectedRowIndex=-1},dk.prototype.disableInteracted=function(){this.isInteracted=!1},dk.prototype.activeTarget=function(){this.actualTarget=this.isInteracted?this.actualTarget:null};var hk=dk;function dk(e,t,i){this.selectedRowIndexes=[],this.selectedRowCellIndexes=[],this.selectedRecords=[],this.preventFocus=!1,this.selectedColumnsIndexes=[],this.checkBoxState=!1,this.isMultiShiftRequest=!1,this.isMultiCtrlRequest=!1,this.isMultiCtrlRequestCell=!1,this.enableSelectMultiTouch=!1,this.clearRowCheck=!1,this.selectRowCheck=!1,this.selectedRowState={},this.unSelectedRowState={},this.totalRecordsCount=0,this.chkAllCollec=[],this.isCheckedOnAdd=!1,this.persistSelectedData=[],this.virtualSelectedData=[],this.deSelectedData=[],this.isHdrSelectAllClicked=!1,this.needColumnSelection=!1,this.isCancelDeSelect=!1,this.isPreventCellSelect=!1,this.disableUI=!1,this.isPersisted=!1,this.cmdKeyPressed=!1,this.cellselected=!1,this.isMultiSelection=!1,this.isAddRowsToSelection=!1,this.initialRowSelection=!1,this.isPrevRowSelection=!1,this.isKeyAction=!1,this.isRowDragSelected=!1,this.isPartialSelection=!1,this.rmtHdrChkbxClicked=!1,this.isCheckboxReset=!1,this.isRowDeselect=!1,this.autoFillRLselection=!0,this.isFocusLastCell=!1,this.bottom="0 0 2px 0",this.top="2px 0 0 0",this.right_bottom="0 2px 2px 0",this.bottom_left="0 0 2px 2px",this.top_right="2px 2px 0 0",this.top_left="2px 0 0 2px",this.top_bottom="2px 0 2px 0",this.top_right_bottom="2px 2px 2px 0",this.top_bottom_left="2px 0 2px 2px",this.top_right_left="2px 2px 0 2px",this.right_bottom_left="0 2px 2px 2px",this.all_border="2px",this.parent=e,this.selectionSettings=t,this.factory=i.getService("rendererFactory"),this.focus=i.getService("focus"),this.addEventListener(),this.wireEvents()}ck.prototype.hasNonNumericCharacters=function(e){for(var t=!1,i=0,n=e;i<n.length;i++){var o=n[i];if((o<"0"||"9"<o)&&"."!==o)return!0;if("."===o){if(t)return!0;t=!0}}return!1},ck.prototype.search=function(e){var t,i=this.parent;e=je(e)?"":e,mB(i)?i.notify(zx,{instance:this,handler:this.search,arg1:e}):e!==i.searchSettings.key?(this.headerFocus=!1,""===e||this.hasNonNumericCharacters(e)||(t=e.split("."),"."===e)||-1===e.indexOf(".")||t[0].startsWith("0")&&1<t[0].length?i.searchSettings.key=e.toString():i.searchSettings.key=parseFloat(e).toString(),i.dataBind()):this.refreshSearch?i.refresh():this.headerFocus=!1},ck.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Z1,this.onPropertyChanged,this),this.parent.on(rx,this.onSearchComplete,this),this.parent.on(Cx,this.destroy,this),this.actionCompleteFunc=this.onActionComplete.bind(this),this.parent.addEventListener(QA,this.actionCompleteFunc),this.parent.on(AI,this.cancelBeginEvent,this))},ck.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Z1,this.onPropertyChanged),this.parent.off(rx,this.onSearchComplete),this.parent.off(Cx,this.destroy),this.parent.removeEventListener(QA,this.actionCompleteFunc),this.parent.off(AI,this.cancelBeginEvent))},ck.prototype.destroy=function(){this.removeEventListener()},ck.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&(je(e.properties.key)?this.parent.notify($1,{requestType:"searching",type:WA}):this.parent.notify($1,{requestType:"searching",type:WA,searchString:this.parent.searchSettings.key}))},ck.prototype.onSearchComplete=function(e){this.parent.trigger(QA,Pe(e,{searchString:this.parent.searchSettings.key,requestType:"searching",type:QA}))},ck.prototype.onActionComplete=function(e){this.refreshSearch&&"refresh"===e.requestType&&this.headerFocus&&(this.headerFocus=!1,this.parent.focusModule.focus(),U([this.parent.focusModule.currentInfo.element],["e-focused"])),this.refreshSearch="searching"!==e.requestType},ck.prototype.cancelBeginEvent=function(e){"searching"===e.requestType&&this.parent.setProperties({searchSettings:{key:""}},!0)},ck.prototype.getModuleName=function(){return"search"};var pk=ck;function ck(e){this.headerFocus=!1,this.parent=e,this.addEventListener()}gk.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:y1,handler:this.batchChanges},{event:uE,handler:this.resetColumnState}],CF(this.parent,this.evtHandlers,!0,this))},gk.prototype.removeEventListener=function(){this.parent.isDestroyed||CF(this.parent,this.evtHandlers,!1)},gk.prototype.batchChanges=function(){this.isShowHide&&(this.isShowHide=!1,this.setVisible(this.colName,this.changedCol),this.changedCol=this.colName=[])},gk.prototype.show=function(e,t){var e=this.getToggleFields(e),i=this.getColumns(e,t);this.parent.notify(Nx,{module:"edit"});for(var n=0;n<i.length;n++)i[parseInt(n.toString(),10)].visible=!0;this.setVisible(i)},gk.prototype.hide=function(e,t){var e=this.getToggleFields(e),i=this.getColumns(e,t);this.parent.notify(Nx,{module:"edit"});for(var n=0;n<i.length;n++)i[parseInt(n.toString(),10)].visible=!1;this.setVisible(i)},gk.prototype.getToggleFields=function(e){return"string"==typeof e?[e]:e},gk.prototype.getColumns=function(e,i){var n=this;return VP(e,function(t){return VP(n.parent.columnModel,function(e){if(e[""+i]===t)return e})[0]})},gk.prototype.batchActionPrevent=function(e,t){return void 0===t&&(t=[]),!mB(this.parent)||(this.colName=e,this.changedCol=t,this.parent.closeEdit(),!1)},gk.prototype.resetColumnState=function(){if(this.isShowHide)for(var e=0;e<this.colName.length;e++)this.colName[parseInt(e.toString(),10)].visible=!this.colName[parseInt(e.toString(),10)].visible},gk.prototype.setVisible=function(i,n){var o,e,r=this;void 0===n&&(n=[]),this.isShowHide=!0,this.batchActionPrevent(i,n)&&(o={requestType:"columnstate",cancel:!1,columns:n=0<n.length?n:i},this.parent.enableInfiniteScrolling&&this.parent.allowGrouping&&0<this.parent.groupModule.groupSettings.columns.length&&(this.parent.contentModule.visibleRows=[]),this.parent.trigger(WA,o,function(e){var t=r.parent.getColumns();i=je(i)?t:i,e.cancel?(r.parent.notify(yT,{showHideArgs:e}),0<i.length&&(i[0].visible=!0)):(r.parent.notify(AE,o),BB(r.parent)&&r.parent.contentModule.emptyVcRows(),t=r.parent.element.querySelector(".e-addedrow"),r.parent.editSettings.showAddNewRow&&t&&(ue(t),(r.parent.enableVirtualization||r.parent.enableInfiniteScrolling)&&(r.parent.isAddNewRow=!0),r.parent.addNewRowFocus=!0,r.parent.isEdit=!1),r.parent.allowSelection&&r.parent.getSelectedRecords().length&&!r.parent.selectionSettings.persistSelection&&r.parent.clearSelection(),r.parent.enableColumnVirtualization||r.parent.isFrozenGrid()&&i.length?r.parent.notify(mE,{isModeChg:!0}):r.parent.notify(Sx,i),e={requestType:"columnstate",columns:n},r.parent.trigger(QA,e),t=!r.parent.element.querySelector(".e-addedrow"),r.parent.editSettings.showAddNewRow&&t&&(r.parent.isEdit=!1,r.parent.addRecord(),r.parent.enableVirtualization||r.parent.enableInfiniteScrolling||r.parent.notify(wE,{})),"All"!==r.parent.columnQueryMode&&r.parent.refresh())}),this.parent.groupSettings.columns.length||(this.parent.autoFit?this.parent.preventAdjustColumns():this.parent.allowResizing&&"Normal"===this.parent.resizeSettings.mode&&(e=-1===this.parent.getHeaderTable().style.width.indexOf("px"),this.widthService.setWidthToTable(e))))};var uk=gk;function gk(e){this.colName=[],this.isShowHide=!1,this.parent=e,this.addEventListener(),this.widthService=new WM(e)}fk.prototype.getModuleName=function(){return"scroll"},fk.prototype.setWidth=function(e){var t,i,n,o;this.parent.element.style.width=T(this.parent.width),e&&this.widthService.setWidthToColumns(),this.parent.toolbarModule&&this.parent.toolbarModule.toolbar&&this.parent.toolbarModule.toolbar.element&&(t=(e=this.parent.toolbarModule.toolbar.element).querySelector(".e-toolbar-left"),i=e.querySelector(".e-toolbar-center"),n=e.querySelector(".e-toolbar-right"),o=e.querySelector(".e-toolbar-items"),t=t?t.clientWidth:0,i=i?i.clientWidth:0,n=n?n.clientWidth:0,o=o?o.clientWidth:0,e=e?e.clientWidth:0,!this.parent.enableAdaptiveUI||e<t||e<i||e<n||e<o)&&this.parent.toolbarModule.toolbar.refreshOverflow()},fk.prototype.setHeight=function(){var e,t=0,i=this.parent.getContent().querySelector("."+WE),n=this.parent.height;this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&"auto"!==this.parent.height&&this.parent.height.toString().indexOf("%")<0&&(n=parseInt(n,10)-fk.getScrollBarWidth()),!this.parent.enableVirtualization&&this.parent.frozenRows&&"auto"!==this.parent.height&&"100%"!==this.parent.height?(t=(e=this.parent.getHeaderContent().querySelector(oD+":not(.e-masked-tbody)"))?e.offsetHeight:0,e&&t?t-=e.getElementsByClassName(YE).length*this.parent.getRowHeight():!this.parent.isInitialLoad&&"Shimmer"===this.parent.loadingIndicator.indicatorType&&this.parent.getHeaderContent().querySelector(".e-masked-table")&&(n=parseInt(n,10)-this.parent.frozenRows*this.parent.getRowHeight()),i.style.height=T(parseInt(n,10)-t)):i.style.height=T(n),this.ensureOverflow(i),this.parent.isFrozenGrid()&&this.refresh()},fk.prototype.setPadding=function(){var e=this.parent.getHeaderContent(),t=fk.getScrollBarWidth()-this.getThreshold(),i=this.getCssProperties();e.querySelector("."+VE).style[i.border]=0<t?"1px":"0px",e.style[i.padding]=0<t?t+"px":"0px"},fk.prototype.removePadding=function(e){var e=this.getCssProperties(e),t=this.parent.getHeaderContent().querySelector("."+VE),t=(t.style[e.border]="",t.parentElement.style[e.padding]="",this.parent.getFooterContent());t&&t.classList.contains("e-footerpadding")&&t.classList.remove("e-footerpadding")},fk.prototype.refresh=function(){var e,t;"100%"===this.parent.height&&(e=this.parent.getContent(),this.parent.element.style.height="100%",t=this.widthService.getSiblingsHeight(e),e.style.height="calc(100% - "+t+"px)")},fk.prototype.getThreshold=function(){return"mozilla"===F.info.name?.5:1},fk.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(J1,this.wireEvents,this),this.parent.on(X1,this.wireEvents,this),this.parent.on(K1,this.onPropertyChanged,this),this.parent.on(CI,this.wireEvents,this),this.parent.on(tx,this.setScrollLeft,this))},fk.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(J1,this.wireEvents),this.parent.off(X1,this.wireEvents),this.parent.off(K1,this.onPropertyChanged),this.parent.off(CI,this.wireEvents),this.parent.off(tx,this.setScrollLeft),this.unwireEvents())},fk.prototype.unwireEvents=function(){this.parent.frozenRows&&this.header&&(E.remove(this.header,"touchstart pointerdown",this.setPageXY),E.remove(this.header,"touchmove pointermove",this.onTouchScroll));var e=this.parent.getContent()?this.parent.getContent().querySelector(".e-movablescrollbar"):null;this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&(e&&E.remove(e,"scroll",this.onCustomScrollbarScroll),this.content&&(E.remove(this.content,"scroll",this.onCustomScrollbarScroll),E.remove(this.content,"touchstart pointerdown",this.setPageXY),/macintosh|ipad/.test(F.userAgent.toLowerCase())&&F.isDevice||E.remove(this.content,"touchmove pointermove",this.onTouchScroll)),this.header)&&(E.remove(this.header,"scroll",this.onCustomScrollbarScroll),E.remove(this.header,"touchstart pointerdown",this.setPageXY),E.remove(this.header,"touchmove pointermove",this.onTouchScroll)),this.content&&E.remove(this.content,"scroll",this.contentScrollHandler),this.header&&E.remove(this.header,"scroll",this.headerScrollHandler),this.contentScrollHandler=null,this.headerScrollHandler=null,this.parent.aggregates.length&&this.parent.getFooterContent()&&E.remove(this.parent.getFooterContent().firstChild,"scroll",this.onContentScroll)},fk.prototype.setScrollLeft=function(){this.parent.getHeaderContent().querySelector("."+VE).scrollLeft=this.previousValues.left},fk.prototype.onContentScroll=function(e){var r=this,s=e,a=s.classList.contains(VE);return function(e){if(null!==r.content.querySelector(oD)&&!r.parent.isPreventScrollEvent){var t=e.target;if(r.parent.frozenRows&&(0<r.content.scrollTop&&r.parent.frozenRows?U:q)([r.parent.element],"e-top-shadow"),r.parent.element.querySelectorAll(".e-leftfreeze,.e-fixedfreeze,.e-rightfreeze").length){var i=r.parent.getContent().querySelectorAll('.e-freezeerror:not([style*="display: none"])'),n=r.parent.getContent().querySelectorAll('.e-fixederror:not([style*="display: none"])'),o=((!((r.parent.enableRtl?Math.abs(t.scrollLeft):t.scrollLeft)<=1)&&r.parent.getVisibleFrozenLeftCount()?U:q)([r.parent.element],"e-left-shadow"),r.parent.enableRtl?Math.abs(t.scrollLeft):t.scrollLeft),o=((Math.round(o+t.clientWidth)>=t.scrollWidth-1&&r.parent.getVisibleFrozenRightCount()?q:U)([r.parent.element],"e-right-shadow"),[].slice.call(r.parent.getContent().querySelectorAll(".e-row:not(.e-hiddenrow)")));if((1===o.length&&i.length||r.parent.element.querySelector('.e-freeze-autofill:not([style*="display: none"])')||n.length)&&t.scrollLeft!==r.previousValues.left)return void(t.scrollLeft=r.previousValues.left);if(1!==o.length&&(i.length||n.length)&&t.scrollTop!==r.previousValues.top)return void(t.scrollTop=r.previousValues.top)}o=t.scrollLeft,n=(je(r.parent.infiniteScrollModule)||!r.parent.enableInfiniteScrolling||r.parent.isEdit&&(!r.parent.editSettings.showAddNewRow||r.parent.element.querySelector(".e-editedrow"))||r.parent.notify(sT,{target:e.target,isLeft:r.previousValues.left!==o}),r.parent.groupSettings.columns.length&&r.parent.groupSettings.enableLazyLoading&&(i=r.previousValues.top<r.parent.getContent().firstElementChild.scrollTop,r.parent.notify(CT,{scrollDown:i})),r.parent.notify($I,{}),t.classList.contains("e-summarycontent"));r.previousValues.left===o?r.previousValues.top=a?t.scrollTop:r.previousValues.top:(r.parent.notify(gT,e),s.scrollLeft=o,n&&(r.header.scrollLeft=o),r.previousValues.left=o,r.parent.notify(Ax,{left:o}))}}},fk.prototype.onCustomScrollbarScroll=function(e,t){var i=this,n=e,o=t;return function(e){null!==i.content.querySelector(oD)&&(e=e.target.scrollLeft,i.previousValues.left!==e)&&(n.scrollLeft=e,o.scrollLeft=e,i.previousValues.left=e,i.parent.notify(Ax,{left:e}),i.parent.isDestroyed)}},fk.prototype.onTouchScroll=function(e){var s=this,a=e;return function(e){var t,i,n,o,r;"mouse"===e.pointerType||(t=s.parent.isFrozenGrid(),i=s.getPointXY(e),n=a.scrollLeft+(s.pageXY.x-i.x),o=s.parent.getHeaderContent().querySelector("."+VE),r=s.parent.getContent().querySelector("."+WE),s.previousValues.left===n)||n<0||o.scrollWidth-o.clientWidth<n||(e.preventDefault(),o.scrollLeft=n,r.scrollLeft=n,t&&s.parent.enableColumnVirtualization&&(s.parent.getContent().querySelector(".e-movablescrollbar").scrollLeft=n),s.pageXY.x=i.x,s.previousValues.left=n)}},fk.prototype.setPageXY=function(){var t=this;return function(e){"mouse"!==e.pointerType&&(t.pageXY=t.getPointXY(e))}},fk.prototype.getPointXY=function(e){var t={x:0,y:0};return e.touches&&e.touches.length?(t.x=e.touches[0].pageX,t.y=e.touches[0].pageY):(t.x=e.pageX,t.y=e.pageY),t},fk.prototype.getScrollbleParent=function(e){var t,i;return null===e?null:(t=je(e.tagName)?e.scrollingElement:e,i=document.defaultView.getComputedStyle(t,null).overflowY,t.scrollHeight>t.clientHeight&&"hidden"!==i&&"visible"!==i||"HTML"===e.tagName||"BODY"===e.tagName?e:this.getScrollbleParent(e.parentNode))},fk.prototype.addStickyListener=function(e){this.parentElement=this.getScrollbleParent(this.parent.element.parentElement),e&&this.parentElement?(this.eventElement="HTML"===this.parentElement.tagName||"BODY"===this.parentElement.tagName?document:this.parentElement,E.add(this.eventElement,"scroll",this.makeStickyHeader,this)):this.eventElement&&(E.remove(this.eventElement,"scroll",this.makeStickyHeader),this.eventElement=null)},fk.prototype.resizeFrozenRowBorder=function(){this.parent.element.querySelector(".e-frozenrow-border")?e=this.parent.element.querySelector(".e-frozenrow-border"):(e=this.parent.createElement("div",{className:"e-frozenrow-border"}),this.parent.element.insertBefore(e,this.parent.element.querySelector(".e-gridcontent")));var e,t="auto"!==this.parent.height?fk.getScrollBarWidth():0;e.style.width=this.parent.element.offsetWidth-t-.5+"px"},fk.prototype.wireEvents=function(){var e,t,i,n,o,r=this,s=(this.oneTimeReady&&(e=this.parent.isFrozenGrid(),this.content=this.parent.getContent().querySelector("."+WE),this.header=this.parent.getHeaderContent().querySelector("."+VE),t=this.parent.getContent().querySelector(".e-movablescrollbar"),this.parent.frozenRows&&this.header&&this.content&&(E.add(this.header,"touchstart pointerdown",this.setPageXY(),this),E.add(this.header,"touchmove pointermove",this.onTouchScroll(this.content),this)),e&&t&&this.parent.enableColumnVirtualization&&(E.add(t,"scroll",this.onCustomScrollbarScroll(this.content,this.header),this),E.add(this.content,"scroll",this.onCustomScrollbarScroll(t,this.header),this),E.add(this.header,"scroll",this.onCustomScrollbarScroll(t,this.content),this),E.add(this.header,"touchstart pointerdown",this.setPageXY(),this),E.add(this.header,"touchmove pointermove",this.onTouchScroll(this.content),this),E.add(this.content,"touchstart pointerdown",this.setPageXY(),this),/macintosh|ipad/.test(F.userAgent.toLowerCase())&&F.isDevice||E.add(this.content,"touchmove pointermove",this.onTouchScroll(this.header),this)),this.contentScrollHandler=this.onContentScroll(this.header),this.headerScrollHandler=this.onContentScroll(this.content),E.add(this.content,"scroll",this.contentScrollHandler,this),E.add(this.header,"scroll",this.headerScrollHandler,this),this.parent.aggregates.length&&E.add(this.parent.getFooterContent().firstChild,"scroll",this.onContentScroll(this.content),this),this.parent.enableStickyHeader&&this.addStickyListener(!0),this.refresh(),this.oneTimeReady=!1),this.parent.getContentTable());PP(function(){i=r.header.scrollLeft,n=s.scrollHeight,o=r.parent.getContent().clientHeight},function(){var e={cancel:!1};r.parent.notify(BT,e),n<o&&"auto"!==r.parent.height&&(r.setLastRowCell(),r.parent.notify(SE,e)),r.parent.frozenRows&&r.resizeFrozenRowBorder(),r.parent.enableVirtualization||r.parent.enableInfiniteScrolling||e.cancel||(r.header.scrollLeft=r.previousValues.left,r.content.scrollLeft=r.previousValues.left,r.content.scrollTop=r.previousValues.top),r.parent.enableColumnVirtualization||(r.content.scrollLeft=i,r.parent.isFrozenGrid()&&(r.previousValues.left=i))}),this.parent.isPreventScrollEvent=!1},fk.prototype.setLastRowCell=function(){var e=this.parent.getContentTable();q(e.querySelectorAll("td"),"e-lastrowcell"),e.querySelector("tr:nth-last-child(2)")&&this.parent.editSettings.showAddNewRow&&"Bottom"===this.parent.editSettings.newRowPosition&&U(e.querySelector("tr:nth-last-child(2)").querySelectorAll("td"),"e-lastrowcell"),U(e.querySelectorAll("tr:last-child td"),"e-lastrowcell"),this.parent.isSpan&&U(e.querySelectorAll(".e-row-span-lastrowcell"),"e-lastrowcell")},fk.prototype.getCssProperties=function(e){var t={},e=je(e)?this.parent.enableRtl:e;return t.border=e?"borderLeftWidth":"borderRightWidth",t.padding=e?"paddingLeft":"paddingRight",t},fk.prototype.ensureOverflow=function(e){e.style.overflowY="auto"===this.parent.height?"auto":"scroll"},fk.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&(this.setPadding(),this.oneTimeReady=!0,"auto"===this.parent.height&&this.removePadding(),this.wireEvents(),this.setHeight(),this.setWidth(!je(e.properties.width)))},fk.prototype.makeStickyHeader=function(){var e,t,i,n,o,r,s,a,l,h;this.parent.enableStickyHeader&&this.parent.element&&this.parent.getContent()&&(e=this.parent.getContent().getClientRects()[0])&&(h=window.devicePixelRatio,t=this.parent.getHeaderContent(),i=this.parent.element.querySelector(".e-toolbar"),n=this.parent.element.querySelector(".e-groupdroparea"),o=t.offsetHeight+(i?i.offsetHeight:0)+(n?n.offsetHeight:0),r=this.parentElement.getClientRects()[0].top,l=e.top-(r<0?0:r),s=e.left,a=document.body.querySelector("#"+this.parent.element.id+"_columnmenu"),(l=1!==h?Math.ceil(l):l)<o&&0<e.bottom?(t.classList.add("e-sticky"),h=0,n&&this.parent.groupSettings.showDropArea&&(this.setSticky(n,h,e.width,s,!0),h+=n.getClientRects()[0].height),i&&(this.setSticky(i,h,e.width,s,!0),h+=i.getClientRects()[0].height),this.setSticky(t,h,e.width,s,!0),je(a)||(a.style.position="fixed",a.style.top=o+"px")):t.classList.contains("e-sticky")&&(this.setSticky(t,null,null,null,!1),i&&this.setSticky(i,null,null,null,!1),n&&this.setSticky(n,null,null,null,!1),(l=this.parent.element.querySelector(".e-ccdlg"))&&l.classList.remove("e-sticky"),je(a)||(a.style.position="absolute",h=e.top-r,a.style.top=h+"px")),this.parent.notify(sE,{}))},fk.prototype.setSticky=function(e,t,i,n,o){o?e.classList.add("e-sticky"):e.classList.remove("e-sticky"),e.style.width=null!=i?i+"px":"",e.style.top=null!=t?t+"px":"",e.style.left=null!==n?parseInt(e.style.left,10)!==n?n+"px":e.style.left:""},fk.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+RE)||e.querySelector("."+OE))&&(this.removeEventListener(),e=this.parent.getContent().querySelector("."+WE),E.remove(e,"scroll",this.onContentScroll),this.parent.enableStickyHeader&&this.addStickyListener(!1),this.removePadding(),q([this.parent.getHeaderContent().querySelector("."+VE)],VE),q([e],WE),e.style.height="",this.parent.element.style.width="")},fk.getScrollBarWidth=aB;var mk=fk;function fk(e){this.previousValues={top:0,left:0},this.oneTimeReady=!0,this.parent=e,this.widthService=new WM(e),this.addEventListener()}yk=function(e,t){return(yk=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])}))(e,t)};var yk,vk,bk=function(e,t){function i(){this.constructor=e}yk(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},wk=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Ck=(bk(Sk,vk=n),Sk.prototype.setFormatter=function(e){this.formatFn=e},Sk.prototype.getFormatter=function(){return this.formatFn},Sk.prototype.setTemplate=function(e){void 0===e&&(e={}),void 0!==this.footerTemplate&&(this.templateFn[M(LA,LA.Summary)]={fn:oo(this.footerTemplate,e),property:"footerTemplate"}),void 0!==this.groupFooterTemplate&&(this.templateFn[M(LA,LA.GroupSummary)]={fn:oo(this.groupFooterTemplate,e),property:"groupFooterTemplate"}),void 0!==this.groupCaptionTemplate&&(this.templateFn[M(LA,LA.CaptionSummary)]={fn:oo(this.groupCaptionTemplate,e),property:"groupCaptionTemplate"})},Sk.prototype.getTemplate=function(e){return this.templateFn[M(LA,e)]},Sk.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},wk([e()],Sk.prototype,"type",void 0),wk([e()],Sk.prototype,"field",void 0),wk([e()],Sk.prototype,"columnName",void 0),wk([e()],Sk.prototype,"format",void 0),wk([e()],Sk.prototype,"footerTemplate",void 0),wk([e()],Sk.prototype,"groupFooterTemplate",void 0),wk([e()],Sk.prototype,"groupCaptionTemplate",void 0),wk([e()],Sk.prototype,"customAggregate",void 0),Sk);function Sk(){var e=null!==vk&&vk.apply(this,arguments)||this;return e.templateFn={},e}bk(xk,Ak=n),wk([kt([],Ck)],xk.prototype,"columns",void 0);var Ak,bk=xk;function xk(){return null!==Ak&&Ak.apply(this,arguments)||this}Tk.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(X1,this.initialEnd,this),this.parent.on(bx,this.keyDownHandler,this),this.parent.on(wx,this.clickHandler,this),this.parent.on(J1,this.initialEnd,this),E.add(this.parent.element,"keydown",this.pasteHandler,this))},Tk.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(bx,this.keyDownHandler),this.parent.off(X1,this.initialEnd),this.parent.off(wx,this.clickHandler),this.parent.off(J1,this.initialEnd),E.remove(this.parent.element,"keydown",this.pasteHandler))},Tk.prototype.clickHandler=function(e){e=e.target;A(e,"e-rowcell")},Tk.prototype.pasteHandler=function(e){var t,i,n=this,o=this.parent,r=/(Mac)/i.test(navigator.platform),s=this.parent.getSelectedRowCellIndexes();!o.isEdit&&67===e.keyCode&&r&&e.metaKey&&this.copy(),s.length&&86===e.keyCode&&(!r&&e.ctrlKey||r&&e.metaKey)&&!o.isEdit&&(e=z(document.activeElement,"."+LE),this.clipBoardTextArea)&&e&&o.editSettings.allowEditing&&"Batch"===o.editSettings.mode&&"Cell"===o.selectionSettings.mode&&"Flow"!==o.selectionSettings.cellSelectionMode&&(this.activeElement=document.activeElement,t=window.scrollX,i=window.scrollY,this.clipBoardTextArea.focus(),setTimeout(function(){n.activeElement.focus(),window.scrollTo(t,i),n.paste(n.clipBoardTextArea.value,s[0].rowIndex,s[0].cellIndexes[0])},r?100:10))},Tk.prototype.paste=function(e,t,i){for(var n,o=this.parent,r=i,s=t,a=e.split("\n"),l=0;l<a.length;l++){if(n=a[parseInt(l.toString(),10)].split("\t"),r=i,l===a.length-1&&""===a[parseInt(l.toString(),10)]||ee(o.getRowByIndex(s))){r++;break}for(var h=0;h<n.length;h++){if(!o.getCellFromIndex(s,r)){r++;break}var d,p=(d=o.getColumnByIndex(r)).getParser()?d.getParser()(n[parseInt(h.toString(),10)]):n[parseInt(h.toString(),10)];d.allowEditing&&!d.isPrimaryKey&&(this.parent.trigger(O1,p={column:d,data:p,rowIndex:s}),s=p.rowIndex,p.cancel||o.editModule&&("number"===d.type?this.parent.editModule.updateCell(s,d.field,parseFloat(p.data)):o.editModule.updateCell(s,d.field,p.data))),r++}s++}o.selectionModule.selectCellsByRange({rowIndex:t,cellIndex:i},{rowIndex:s-1,cellIndex:r-1});e=this.parent.getCellFromIndex(s-1,r-1);e&&mt(e,["e-focus","e-focused"],[]),this.clipBoardTextArea.value=""},Tk.prototype.initialEnd=function(){this.l10n=this.serviceLocator.getService("localization"),this.parent.off(X1,this.initialEnd),this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",attrs:{tabindex:"-1","aria-label":this.l10n.getConstant("ClipBoard")}}),this.clipBoardTextArea.style.opacity="0",this.parent.element.appendChild(this.clipBoardTextArea)},Tk.prototype.keyDownHandler=function(e){"ctrlPlusC"===e.action?this.copy():"ctrlShiftPlusH"===e.action&&this.copy(!0)},Tk.prototype.setCopyData=function(e){if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this.copyContent="";var t=this.parent.getDataRows();if(this.parent.selectionSettings&&this.parent.selectionSettings.allowColumnSelection&&this.parent.selectionModule&&this.parent.selectionModule.selectedColumnsIndexes.length){if(e){for(var i=this.parent.selectionModule.selectedColumnsIndexes,n=[],o=0;o<i.length;o++){var r=i[parseInt(o.toString(),10)],r=this.parent.getColumnHeaderByIndex(r);r&&!r.classList.contains("e-hide")&&n.push(r)}this.getCopyData(n,!1,"\t",e),this.copyContent+="\n"}for(var s=0;s<t.length;s++){var a=[];0<s&&(this.copyContent+="\n"),a.push.apply(a,[].slice.call(t[parseInt(s.toString(),10)].querySelectorAll(".e-columnselection:not(.e-hide)"))),this.getCopyData(a,!1,"\t",e)}}else if("Cell"!==this.parent.selectionSettings.mode){var l=this.parent.getSelectedRowIndexes().sort(function(e,t){return e-t});if(e){for(var h=[],o=0;o<this.parent.getVisibleColumns().length;o++)h[parseInt(o.toString(),10)]=this.parent.getVisibleColumns()[parseInt(o.toString(),10)].headerText;this.getCopyData(h,!1,"\t",e),this.copyContent+="\n"}if((this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&l.length>t.length)for(l=[],o=0;o<t.length;o++){var d=t[parseInt(o.toString(),10)];"true"===d.getAttribute("aria-selected")&&l.push(parseInt(d.getAttribute("data-rowindex"),10))}for(o=0;o<l.length;o++){0<o&&(this.copyContent+="\n");var p=[],c=l[parseInt(o.toString(),10)],c=(!BB(this.parent)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache||this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading)&&(c=t.map(function(e){return e.getAttribute("data-rowindex")}).indexOf(l[parseInt(o.toString(),10)].toString())),t[parseInt(c.toString(),10)]);je(c)||(p.push.apply(p,[].slice.call(c.querySelectorAll(".e-rowcell:not(.e-hide)"))),this.getCopyData(p,!1,"\t",e))}}else if(this.parent.selectionModule&&this.parent.selectionModule.selectedRowCellIndexes.length){var u=this.checkBoxSelection();if(u.status){if(e){for(var g=[],o=0;o<u.colIndexes.length;o++){var m=this.parent.getColumnHeaderByIndex(u.colIndexes[parseInt(o.toString(),10)]);m.classList.contains("e-hide")||g.push(m)}this.getCopyData(g,!1,"\t",e),this.copyContent+="\n"}for(o=0;o<u.rowIndexes.length;o++){0<o&&(this.copyContent+="\n");var f=[].slice.call(t[u.rowIndexes[parseInt(o.toString(),10)]].querySelectorAll(".e-cellselectionbackground:not(.e-hide)"));this.getCopyData(f,!1,"\t",e)}}else this.getCopyData([].slice.call(this.parent.element.getElementsByClassName("e-cellselectionbackground")),!0,"\n",e)}var y={data:this.copyContent,cancel:!1};this.parent.trigger(R1,y),y.cancel||(this.clipBoardTextArea.value=this.copyContent=y.data,F.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0)}},Tk.prototype.getCopyData=function(e,t,i,n){for(var o,r="string"!=typeof e[0],s=0;s<e.length;s++)n&&t&&(o=parseInt(e[parseInt(s.toString(),10)].getAttribute(iD),10)-1,this.copyContent+=this.parent.getColumns()[parseInt(o.toString(),10)].headerText+"\n"),r?e[parseInt(s.toString(),10)].classList.contains("e-hide")||(this.copyContent+=e[parseInt(s.toString(),10)].innerText):this.copyContent+=e[parseInt(s.toString(),10)],s<e.length-1&&(this.copyContent+=i)},Tk.prototype.copy=function(e){document.queryCommandSupported("copy")&&this.clipBoardTextArea&&(this.setCopyData(e),document.execCommand("copy"),this.clipBoardTextArea.blur()),this.isSelect&&(window.getSelection().removeAllRanges(),this.isSelect=!1)},Tk.prototype.getModuleName=function(){return"clipboard"},Tk.prototype.destroy=function(){this.removeEventListener(),this.clipBoardTextArea&&(ue(this.clipBoardTextArea),this.clipBoardTextArea=null)},Tk.prototype.checkBoxSelection=function(){var e=this.parent,t={status:!1};if("Cell"===e.selectionSettings.mode){for(var i=e.getSelectedRowCellIndexes(),n=void 0,o=[],r=void 0,r=0;r<i.length&&(i[parseInt(r.toString(),10)].cellIndexes.length&&o.push(i[parseInt(r.toString(),10)].rowIndex),!i[parseInt(r.toString(),10)].cellIndexes.length||(n=n||JSON.stringify(i[parseInt(r.toString(),10)].cellIndexes.sort()))===JSON.stringify(i[parseInt(r.toString(),10)].cellIndexes.sort()));r++);o.sort(function(e,t){return e-t}),r===i.length&&(t={status:!0,rowIndexes:o,colIndexes:i[0].cellIndexes})}return t};var Ik=Tk;function Tk(e,t){this.copyContent="",this.isSelect=!1,this.parent=e,this.serviceLocator=t,this.addEventListener()}var Ek="https://ej2.syncfusion.com/documentation/grid",Dk="https://ej2.syncfusion.com/documentation/",Mk="[EJ2Grid.Warning]",kk="[EJ2Grid.Error]",Pk="[EJ2Grid.Info]",Bk=(Fk.prototype.getModuleName=function(){return"logger"},Fk.prototype.log=function(e,t){for(var i=e=e instanceof Array?e:[e],n=0;n<i.length;n++){var o=Ok[i[parseInt(n.toString(),10)]],r=o.check(t,this.parent);r.success&&console[o.logType](o.generateMessage(t,this.parent,r.options))}},Fk.prototype.patchadaptor=function(){var n=this.parent.getDataModule().dataManager.adaptor,o=n.beforeSend;o&&(n.beforeSend=function(e,t,i){o.call(n,e,t,i)})},Fk.prototype.destroy=function(){this.parent.isDestroyed||this.parent.off("initial-end",this.patchadaptor)},Fk);function Fk(e){this.parent=e,this.parent.on("initial-end",this.patchadaptor,this)}var Lk,Rk,Ok={module_missing:{type:"module_missing",logType:"warn",check:function(e,t){var i=t.getInjectedModules().map(function(e){return e.prototype.getModuleName()}),t=t.requiredModules().map(function(e){return e.member}).filter(function(e){return-1===i.indexOf(e)});return{success:0<t.filter(function(e){return"resize"!==e}).length,options:t}},generateMessage:function(e,t,i){return i=i.filter(function(e){return"resize"!==e}).reduce(function(e,t){return e+"* "+t+"\n"},""),Mk+": MODULES MISSING\nThe following modules are not injected:.\n"+i+"Refer to "+Ek+"/module.html for documentation on importing feature modules."}},promise_enabled:{type:"promise_enabled",logType:"error",check:function(){return{success:"undefined"==typeof Promise}},generateMessage:function(){return kk+": PROMISE UNDEFINED\nPromise object is not present in the global environment,please use polyfil to support Promise object in your environment.\nRefer to "+Dk+"/base/browser.html?#required-polyfills for more information."}},primary_column_missing:{type:"primary_column_missing",logType:"warn",check:function(e,t){return{success:t.enableColumnVirtualization?0===t.getPrimaryKeyFieldNames().length:0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(){return Mk+": PRIMARY KEY MISSING\nEditing is enabled but primary key column is not specified.\nRefer to "+Ek+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},selection_key_missing:{type:"selection_key_missing",logType:"warn",check:function(e,t){return{success:t.selectionSettings.persistSelection&&0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(){return Mk+": PRIMARY KEY MISSING\nselectionSettings.persistSelection property is enabled. It requires one primary key column to persist selection.\nRefer to "+Ek+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},actionfailure:{type:"actionfailure",logType:"error",check:function(){return{success:!0}},generateMessage:function(e,t){var i="",n=Nk(e),o=Vk(e),i=""!==o?o:""!==n?n:e.error;return Mk+": "+i}},locale_missing:{type:"locale_missing",logType:"warn",check:function(e,t){var i=Sa.getObject("locale."+t.locale+".grid",Cn);return{success:"en-US"!==t.locale&&je(i)}},generateMessage:function(e,t){return Mk+": LOCALE CONFIG MISSING\nLocale configuration for '"+t.locale+"' is not provided.\nRefer to "+Ek+"/globalization-and-localization.html?#localization \n             for documentation on setting locale configuration."}},limitation:{type:"limitation",logType:"warn",check:function(e,t){var i;switch(e){case"freeze":i={success:!ee(t.detailTemplate)||!ee(t.childGrid),options:{name:"freeze"}};break;case"virtualization":i={success:!ee(t.detailTemplate)||!ee(t.childGrid),options:{name:"virtualization"}};break;default:i={success:!1}}return i},generateMessage:function(e,t,i){var n,i=i.name;switch(i){case"freeze":n="Frozen rows and columns do not support the following features:\n* Details Template\n* Hierarchy Grid\n";break;case"virtualization":n="Virtualization does not support the following features.\n* Details Template.\n* Hierarchy Grid.\n";break;default:n=""}return Mk+": "+i.toUpperCase()+" LIMITATIONS\n"+n}},check_datasource_columns:{type:"check_datasource_columns",logType:"warn",check:function(e,t){return{success:!(t.columns.length||t.dataSource instanceof me||!je(t.dataSource)&&t.dataSource.length)}},generateMessage:function(){return Mk+": GRID CONFIG MISSING\ndataSource and columns are not provided in the grid. At least one of either must be provided for grid configuration.\nRefer to "+Ek+"/columns.html for documentation on configuring the grid data and columns."}},virtual_height:{type:"virtual_height",logType:"error",check:function(e,t){return{success:je(t.height)||"auto"===t.height}},generateMessage:function(){return kk+": GRID HEIGHT MISSING \nheight property is required to use virtualization.\nRefer to "+Ek+"/virtual.html for documentation on configuring the virtual grid."}},grid_remote_edit:{type:"grid_remote_edit",logType:"error",check:function(e){return{success:Array.isArray(e)||Array.isArray(e.result)}},generateMessage:function(){return kk+": RETRUN VALUE MISSING  \nRemote service returns invalid data. \nRefer to "+Ek+"/edit.html for documentation on configuring editing with remote data."}},grid_sort_comparer:{type:"grid_sort_comparer",logType:"warn",check:function(e,t){return{success:t.getDataModule().isRemote()}},generateMessage:function(){return Mk+": SORT COMPARER NOT WORKING  \nSort comparer will not work with remote data.Refer to "+Ek+"/sorting/#custom-sort-comparer for documentation on using the sort comparer."}},resize_min_max:{type:"resize_min_max",logType:"info",check:function(e){return{success:e.column.minWidth&&e.column.minWidth>=e.width||e.column.maxWidth&&e.column.maxWidth<=e.width}},generateMessage:function(){return Pk+": RESIZING COLUMN REACHED MIN OR MAX  \nThe column resizing width is at its min or max."}},action_disabled_column:{type:"action_disabled_column",logType:"info",check:function(e){var t;switch(e.moduleName){case"reorder":t=je(e.destColumn)?"reordering action is disabled for the "+e.column.headerText+" column":"reordering action is disabled for the "+(e.column.allowReordering?e.destColumn:e.column).headerText+" column";break;case"group":t="grouping action is disabled for the "+e.columnName+" column.";break;case"filter":t="filtering action is disabled for the "+e.columnName+" column.";break;case"sort":t="sorting action is disabled for the "+e.columnName+" column."}return{success:!0,options:{fn:t}}},generateMessage:function(e,t,i){return Pk+": ACTION DISABLED \n "+i.fn}},exporting_begin:{type:"exporting_begin",logType:"info",check:function(e){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return Pk+": EXPORTING INPROGRESS \n Grid "+i.args+"ing is in progress"}},exporting_complete:{type:"exporting_complete",logType:"info",check:function(e){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return Pk+": EXPORTING COMPLETED \n Grid "+i.args+"ing is complete"}},foreign_key_failure:{type:"foreign_key_failure",logType:"error",check:function(){return{success:!0}},generateMessage:function(){return kk+": FOREIGNKEY CONFIG \n  Grid foreign key column needs a valid data source/service.Refer to "+Ek+"/columns/#foreign-key-column for documentation on configuring foreign key columns."}},initial_action:{type:"initial_action",logType:"error",check:function(e){var t;switch(e.moduleName){case"group":t="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to group the column";break;case"filter":t="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to filter the column.";break;case"sort":t="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to sort the column."}return{success:!0,options:{fn:t}}},generateMessage:function(e,t,i){return kk+": INITIAL ACTION FAILURE \n "+i.fn}},frozen_rows_columns:{type:"frozen_rows_columns",logType:"error",check:function(e,t){return{success:t.getColumns().length<=t.frozenColumns||t.currentViewData.length&&t.frozenRows>=t.currentViewData.length}},generateMessage:function(e,t){return kk+": OUT OF RANGE ERROR-\n "+(t.getColumns().length<=t.frozenColumns?"FROZEN COLUMNS,":"")+(t.frozenRows>=t.currentViewData.length?"FROZEN ROWS":"")+" invalid"}},column_type_missing:{type:"column_type_missing",logType:"error",check:function(e){return{success:je(e.column.type),options:e.column.headerText}},generateMessage:function(e,t,i){return kk+": COLUMN TYPE MISSING-\n  "+i+" column type was invalid or not defined.Please go through below help link: "+Dk+"/grid/columns/#column-type"}},datasource_syntax_mismatch:{type:"datasource_syntax_mismatch",logType:"warn",check:function(e){return{success:e.dataState.dataSource&&!(e.dataState.dataSource instanceof me||"result"in e.dataState.dataSource||e.dataState.dataSource instanceof Array)&&!je(e.dataState.dataStateChange)}},generateMessage:function(){return Mk+": DATASOURCE SYNTAX WARNING\nDataSource should be in the form of {result: Object[], count: number}when dataStateChangeEvent used"}}},Nk=function(e){e=e.error;return e.indexOf&&0!==e.indexOf("Format options")?"":"INVALID FORMAT\nFor more information, refer to the following documentation links:\nNumber format: "+Dk+"/common/internationalization#supported-format-string\nDate format: "+Dk+"/common/internationalization#manipulating-datetime\nMessage: "+e},Vk=function(e){e=Sa.getObject("error.error",e);if(je(e))return"";var t="";try{t=JSON.parse(e.responseText)}catch(e){t=""}return"XMLHTTPREQUEST FAILED\nUrl: "+e.responseURL+"\nStatus: "+e.status+" - "+e.statusText+"\n"+(""!==t?"Message: "+t:"")},wk=(Lk=function(e,t){return(Lk=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])}))(e,t)},function(e,t){function i(){this.constructor=e}Lk(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Ck=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},_k=(wk(Hk,Rk=n),Ck([e()],Hk.prototype,"field",void 0),Ck([e()],Hk.prototype,"direction",void 0),Ck([e(!1)],Hk.prototype,"isFromGroup",void 0),Hk);function Hk(){return null!==Rk&&Rk.apply(this,arguments)||this}wk(Wk,zk=n),Ck([kt([],_k)],Wk.prototype,"columns",void 0),Ck([e(!0)],Wk.prototype,"allowUnsort",void 0);var zk,jk=Wk;function Wk(){return null!==zk&&zk.apply(this,arguments)||this}wk(qk,Qk=n),Ck([e()],qk.prototype,"field",void 0),Ck([e()],qk.prototype,"operator",void 0),Ck([e()],qk.prototype,"value",void 0),Ck([e()],qk.prototype,"matchCase",void 0),Ck([e(!1)],qk.prototype,"ignoreAccent",void 0),Ck([e()],qk.prototype,"predicate",void 0),Ck([e({})],qk.prototype,"actualFilterValue",void 0),Ck([e({})],qk.prototype,"actualOperator",void 0),Ck([e()],qk.prototype,"type",void 0),Ck([e()],qk.prototype,"ejpredicate",void 0),Ck([e()],qk.prototype,"uid",void 0),Ck([e()],qk.prototype,"isForeignKey",void 0),Ck([e()],qk.prototype,"condition",void 0);var Qk,Uk=qk;function qk(){return null!==Qk&&Qk.apply(this,arguments)||this}wk(Xk,Gk=n),Ck([e(!1)],Xk.prototype,"enableCache",void 0),Ck([e(3)],Xk.prototype,"maxBlocks",void 0),Ck([e(3)],Xk.prototype,"initialBlocks",void 0);var Gk,Yk=Xk;function Xk(){return null!==Gk&&Gk.apply(this,arguments)||this}wk(Zk,Kk=n),Ck([kt([],Uk)],Zk.prototype,"columns",void 0),Ck([e("FilterBar")],Zk.prototype,"type",void 0),Ck([e("OnEnter")],Zk.prototype,"mode",void 0),Ck([e(!0)],Zk.prototype,"showFilterBarStatus",void 0),Ck([e(1500)],Zk.prototype,"immediateModeDelay",void 0),Ck([e()],Zk.prototype,"operators",void 0),Ck([e(!1)],Zk.prototype,"ignoreAccent",void 0),Ck([e(!1)],Zk.prototype,"enableInfiniteScrolling",void 0),Ck([e(50)],Zk.prototype,"itemsCount",void 0),Ck([e("Shimmer")],Zk.prototype,"loadingIndicator",void 0),Ck([e(!1)],Zk.prototype,"enableCaseSensitivity",void 0),Ck([e(!1)],Zk.prototype,"showFilterBarOperator",void 0);var Kk,Jk=Zk;function Zk(){return null!==Kk&&Kk.apply(this,arguments)||this}wk(tP,$k=n),Ck([e("Row")],tP.prototype,"mode",void 0),Ck([e("Flow")],tP.prototype,"cellSelectionMode",void 0),Ck([e("Single")],tP.prototype,"type",void 0),Ck([e(!1)],tP.prototype,"checkboxOnly",void 0),Ck([e(!1)],tP.prototype,"persistSelection",void 0),Ck([e("Default")],tP.prototype,"checkboxMode",void 0),Ck([e(!1)],tP.prototype,"enableSimpleMultiRowSelection",void 0),Ck([e(!0)],tP.prototype,"enableToggle",void 0),Ck([e(!1)],tP.prototype,"allowColumnSelection",void 0);var $k,eP=tP;function tP(){return null!==$k&&$k.apply(this,arguments)||this}wk(oP,iP=n),Ck([e([])],oP.prototype,"fields",void 0),Ck([e("")],oP.prototype,"key",void 0),Ck([e("contains")],oP.prototype,"operator",void 0),Ck([e(!0)],oP.prototype,"ignoreCase",void 0),Ck([e(!1)],oP.prototype,"ignoreAccent",void 0);var iP,nP=oP;function oP(){return null!==iP&&iP.apply(this,arguments)||this}wk(aP,rP=n),Ck([e()],aP.prototype,"targetID",void 0);var rP,sP=aP;function aP(){return null!==rP&&rP.apply(this,arguments)||this}wk(dP,lP=n),Ck([e("Both")],dP.prototype,"wrapMode",void 0);var lP,hP=dP;function dP(){return null!==lP&&lP.apply(this,arguments)||this}wk(uP,pP=n),Ck([e("Normal")],uP.prototype,"mode",void 0);var pP,cP=uP;function uP(){return null!==pP&&pP.apply(this,arguments)||this}wk(fP,gP=n),Ck([e(!0)],fP.prototype,"showDropArea",void 0),Ck([e(!1)],fP.prototype,"allowReordering",void 0),Ck([e(!1)],fP.prototype,"showToggleButton",void 0),Ck([e(!1)],fP.prototype,"showGroupedColumn",void 0),Ck([e(!0)],fP.prototype,"showUngroupButton",void 0),Ck([e(!1)],fP.prototype,"disablePageWiseAggregates",void 0),Ck([e([])],fP.prototype,"columns",void 0),Ck([e()],fP.prototype,"captionTemplate",void 0),Ck([e(!1)],fP.prototype,"enableLazyLoading",void 0);var gP,mP=fP;function fP(){return null!==gP&&gP.apply(this,arguments)||this}wk(bP,yP=n),Ck([e(!1)],bP.prototype,"allowAdding",void 0),Ck([e(!1)],bP.prototype,"allowEditing",void 0),Ck([e(!1)],bP.prototype,"allowDeleting",void 0),Ck([e("Normal")],bP.prototype,"mode",void 0),Ck([e(!0)],bP.prototype,"allowEditOnDblClick",void 0),Ck([e(!0)],bP.prototype,"showConfirmDialog",void 0),Ck([e(!1)],bP.prototype,"showDeleteConfirmDialog",void 0),Ck([e()],bP.prototype,"template",void 0),Ck([e()],bP.prototype,"headerTemplate",void 0),Ck([e()],bP.prototype,"footerTemplate",void 0),Ck([e("Top")],bP.prototype,"newRowPosition",void 0),Ck([e({})],bP.prototype,"dialog",void 0),Ck([e(!1)],bP.prototype,"allowNextRowEdit",void 0),Ck([e(!1)],bP.prototype,"showAddNewRow",void 0);var yP,vP=bP;function bP(){return null!==yP&&yP.apply(this,arguments)||this}wk(SP,wP=n),Ck([e("Spinner")],SP.prototype,"indicatorType",void 0);var wP,CP=SP;function SP(){return null!==wP&&wP.apply(this,arguments)||this}wk(a,AP=Ji),(xP=a).prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","groupSettings","columns","searchSettings","selectedRowIndex","scrollPosition"],t={pageSettings:["template","pageSizes","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent"],groupSettings:["showDropArea","showToggleButton","showGroupedColumn","showUngroupButton","disablePageWiseAggregates","hideCaptionCount"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[],scrollPosition:[]},i=0;i<e.length;i++)for(var n=this[e[parseInt(i.toString(),10)]],o=0,r=t[e[parseInt(i.toString(),10)]];o<r.length;o++)delete n[""+r[o]];var s=this.pageSettings.template,a=Object.assign({template:void 0},this.pageSettings),l=(this.enableVirtualization&&this.enablePersistence&&this.contentModule&&this.contentModule.getPageFromTop&&!je(this.scrollPosition)&&!je(this.scrollPosition.top)&&(a.properties.currentPage=this.contentModule.getPageFromTop(this.scrollPosition.top,{block:1})),this.setProperties({pageSettings:a},!0),this.groupSettings.captionTemplate),h=l&&this.isAngular,d=(h&&delete this.groupSettings.properties.captionTemplate,this.pageTemplateChange=!je(this.pagerTemplate),this.addOnPersist(e));return a.template=s,this.setProperties({pageSettings:a},!0),h&&(this.groupSettings.captionTemplate=l),d},a.prototype.requiredModules=function(){this.setFrozenCount(),this.enableInfiniteAggrgate();var e=[];return this.isDestroyed||(this.allowFiltering&&e.push({member:"filter",args:[this,this.filterSettings,this.serviceLocator],name:"Filter"}),this.allowExcelExport&&e.push({member:"ExcelExport",args:[this,this.serviceLocator],name:"ExcelExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this],name:"PdfExport"}),this.allowSorting&&e.push({member:"sort",args:[this,this.sortSettings,this.sortedColumns,this.serviceLocator],name:"Sort"}),this.allowPaging&&e.push({member:"pager",args:[this,this.pageSettings],name:"Page"}),this.allowSelection&&e.push({member:"selection",args:[this,this.selectionSettings,this.serviceLocator],name:"Selection"}),this.resizeCheck()&&e.push({member:"resize",args:[this],name:"Resize"}),this.allowReordering&&e.push({member:"reorder",args:[this],name:"Reorder"}),this.allowRowDragAndDrop&&e.push({member:"rowDragAndDrop",args:[this],name:"RowDD"}),this.allowGrouping&&e.push({member:"group",args:[this,this.groupSettings,this.sortedColumns,this.serviceLocator],name:"Group"}),this.aggregates.length&&e.push({member:"aggregate",args:[this,this.serviceLocator],name:"Aggregate"}),this.isDetail()&&e.push({member:"detailRow",args:[this,this.serviceLocator],name:"DetailRow"}),(this.toolbar||this.toolbarTemplate)&&e.push({member:"toolbar",args:[this,this.serviceLocator],name:"Toolbar"}),(this.enableVirtualization||this.enableColumnVirtualization)&&e.push({member:"virtualscroll",args:[this,this.serviceLocator],name:"VirtualScroll"}),(this.getFrozenColumns()||this.frozenRows||this.frozenRightCount||this.frozenLeftCount)&&e.push({member:"freeze",args:[this,this.serviceLocator],name:"Freeze"}),!je(this.columns)&&this.isCommandColumn(this.columns)&&e.push({member:"commandColumn",args:[this,this.serviceLocator],name:"CommandColumn"}),(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&e.push({member:"edit",args:[this,this.serviceLocator],name:"Edit"}),this.extendRequiredModules(e)),e},a.prototype.extendRequiredModules=function(e){this.enableInfiniteScrolling&&e.push({member:"infiniteScroll",args:[this,this.serviceLocator],name:"InfiniteScroll"}),this.groupSettings.enableLazyLoading&&e.push({member:"lazyLoadGroup",args:[this,this.serviceLocator],name:"LazyLoadGroup"}),this.contextMenuItems&&e.push({member:"contextMenu",args:[this,this.serviceLocator],name:"ContextMenu"}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this,this.serviceLocator],name:"ColumnMenu"}),this.showColumnChooser&&e.push({member:"columnChooser",args:[this,this.serviceLocator],name:"ColumnChooser"}),!je(this.columns)&&this.isForeignKeyEnabled(this.columns)&&e.push({member:"foreignKey",args:[this,this.serviceLocator],name:"ForeignKey"}),this.enableLogger&&e.push({member:"logger",args:[this],name:"Logger"})},a.prototype.resizeCheck=function(){var e=!!this.getColumns().filter(function(e){return!0===e.autoFit}).length,t=(je(this.columnModel)||!this.columnModel.length||this.columnModel[0]instanceof C0||(this.columnModel=[]),!(!this.showColumnMenu||this.columnMenuItems&&!this.columnMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length)),i=!(!this.contextMenuItems||!this.contextMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length);return this.allowResizing||this.autoFitColumnsResize||e||t||i},a.prototype.preRender=function(){this.serviceLocator=new _M,this.initProperties(),this.initializeServices()},a.prototype.initProperties=function(){this.isInitial=!0,this.sortedColumns=[],this.inViewIndexes=[],this.mediaCol=[],this.isInitialLoad=!1,this.allowServerDataBinding=!1,this.ignoreCollectionWatch=!0,this.mergeCells={},this.isEdit=!1,this.checkAllRows="None",this.isCheckBoxSelection=!1,this.isPersistSelection=!1,this.componentRefresh=Ji.prototype.refresh,this.freezeColumnRefresh=!0,this.filterOperators={contains:"contains",endsWith:"endswith",equal:"equal",greaterThan:"greaterthan",greaterThanOrEqual:"greaterthanorequal",lessThan:"lessthan",lessThanOrEqual:"lessthanorequal",notEqual:"notequal",startsWith:"startswith",wildCard:"wildcard",isNull:"isnull",notNull:"notnull",like:"like"},this.defaultLocale={EmptyRecord:"No records to display",True:"true",False:"false",InvalidFilterMessage:"Invalid Filter Data",GroupDropArea:"Drag a column header here to group its column",UnGroup:"Click here to ungroup",UnGroupButton:"Click here to ungroup",GroupDisable:"Grouping is disabled for this column",FilterbarTitle:"'s filter bar cell",EmptyDataSourceError:"DataSource must not be empty at initial load since columns are generated from dataSource in AutoGenerate Column Grid",Add:"Add",Edit:"Edit",Cancel:"Cancel",Update:"Update",Delete:"Delete",Print:"Print",Pdfexport:"PDF Export",Excelexport:"Excel Export",Wordexport:"Word Export",Csvexport:"CSV Export",Search:"Search",Columnchooser:"Columns",Save:"Save",Item:"item",Items:"items",EditOperationAlert:"No records selected for edit operation",DeleteOperationAlert:"No records selected for delete operation",SaveButton:"Save",OKButton:"OK",CancelButton:"Cancel",EditFormTitle:"Details of ",AddFormTitle:"Add New Record",BatchSaveConfirm:"Are you sure you want to save changes?",BatchSaveLostChanges:"Unsaved changes will be lost. Are you sure you want to continue?",ConfirmDelete:"Are you sure you want to Delete Record?",CancelEdit:"Are you sure you want to Cancel the changes?",ChooseColumns:"Choose Column",ColumnMenu:"Column Menu",SearchColumns:"search columns",Matchs:"No matches found",FilterButton:"Filter",FilterTitle:"Filter",FilterIcon:"Filter",ClearButton:"Clear",StartsWith:"Starts With",NotStartsWith:"Does Not Start With",Like:"Like",EndsWith:"Ends With",NotEndsWith:"Does Not End With",Contains:"Contains",NotContains:"Does Not Contain",IsNull:"Null",NotNull:"Not Null",IsEmpty:"Empty",IsNotEmpty:"Not Empty",Equal:"Equal",NotEqual:"Not Equal",LessThan:"Less Than",LessThanOrEqual:"Less Than Or Equal",GreaterThan:"Greater Than",GreaterThanOrEqual:"Greater Than Or Equal",In:"In",NotIn:"Not In",ChooseDate:"Choose a Date",EnterValue:"Enter the value",Copy:"Copy",Group:"Group by this column",Ungroup:"Ungroup by this column",GroupButton:"Group button",UnGroupAria:"ungroup button",GroupSeperator:"Separator for the grouped columns",UnGroupIcon:"ungroup the grouped column ",GroupedSortIcon:"sort the grouped column ",GroupedDrag:"Drag the grouped column",GroupCaption:" is groupcaption cell",CheckBoxLabel:"checkbox",SelectAllCheckbox:"Select all checkbox",SelectRow:"Select row",autoFitAll:"Autofit all columns",autoFit:"Autofit this column",AutoFitAll:"Autofit all columns",AutoFit:"Autofit this column",Export:"Export",FirstPage:"First Page",LastPage:"Last Page",PreviousPage:"Previous Page",NextPage:"Next Page",SortAscending:"Sort Ascending",SortDescending:"Sort Descending",EditRecord:"Edit Record",DeleteRecord:"Delete Record",FilterMenu:"Filter",SelectAll:"Select All",AddCurrentSelection:"Add current selection to filter",Blanks:"Blanks",FilterTrue:"True",FilterFalse:"False",NoResult:"No matches found",ClearFilter:"Clear Filter",Clear:"Clear",NumberFilter:"Number Filters",TextFilter:"Text Filters",DateFilter:"Date Filters",DateTimeFilter:"DateTime Filters",MatchCase:"Match Case",Between:"Between",CustomFilter:"Custom Filter",CustomFilterPlaceHolder:"Enter the value",CustomFilterDatePlaceHolder:"Choose a date",AND:"AND",OR:"OR",ShowRowsWhere:"Show rows where:",ToolbarMenuDialogARIA:"Toolbar menu dialog",FilterMenuDialogARIA:"Filter menu",ExcelFilterDialogARIA:"Excel filter",CheckBoxFilterDialogARIA:"Checkbox filter",DialogEditARIA:"Edit dialog",ColumnMenuDialogARIA:"Column menu dialog",CustomFilterDialogARIA:"Customer filter dialog",SortAtoZ:"Sort A to Z",SortZtoA:"Sort Z to A",SortByOldest:"Sort by Oldest",SortByNewest:"Sort by Newest",SortSmallestToLargest:"Sort Smallest to Largest",SortLargestToSmallest:"Sort Largest to Smallest",Sort:"Sort",SortIcon:"Sort",FilterDescription:"Press Alt Down to open filter Menu",SortDescription:"Press Enter to sort",ColumnMenuDescription:"Press Alt Down to open Column Menu",GroupDescription:"Press Ctrl space to group",ColumnHeader:" column header ",TemplateCell:" is template cell",CommandColumnAria:"is Command column column header ",DialogEdit:"Dialog edit",ClipBoard:"clipboard",AscendingText:"Ascending",DescendingText:"Descending",NoneText:"None",Expanded:"Expanded",Collapsed:"Collapsed"},this.keyConfigs={downArrow:"downarrow",upArrow:"uparrow",rightArrow:"rightarrow",leftArrow:"leftarrow",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftRight:"shift+rightarrow",shiftLeft:"shift+leftarrow",home:"home",end:"end",escape:"escape",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",pageUp:"pageup",pageDown:"pagedown",ctrlAltPageUp:"ctrl+alt+pageup",ctrlAltPageDown:"ctrl+alt+pagedown",altPageUp:"alt+pageup",altPageDown:"alt+pagedown",altDownArrow:"alt+downarrow",altUpArrow:"alt+uparrow",ctrlDownArrow:"ctrl+downarrow",ctrlUpArrow:"ctrl+uparrow",ctrlPlusA:"ctrl+A",ctrlPlusP:"ctrl+P",insert:"insert",delete:"delete",f2:"f2",enter:"enter",ctrlEnter:"ctrl+enter",shiftEnter:"shift+enter",tab:"tab",shiftTab:"shift+tab",space:"space",ctrlPlusC:"ctrl+C",ctrlShiftPlusH:"ctrl+shift+H",ctrlSpace:"ctrl+space",ctrlLeftArrow:"ctrl+leftarrow",ctrlRightArrow:"ctrl+rightarrow"}},a.prototype.render=function(){var e;if(this.log(["module_missing","promise_enabled","locale_missing","check_datasource_columns"]),this.ariaService.setOptions(this.element,{role:"grid"}),mA({target:this.element,cssClass:this.cssClass||null},this.createElement),this.renderModule=new FM(this,this.serviceLocator),this.searchModule=new pk(this),this.scrollModule=new mk(this),this.notify(q1,{}),this.pageSettings.enableQueryString&&!je(e=new URL(window.location.href).searchParams.get("page"))&&0<window.location.href.indexOf("?page=")&&(e=parseInt(e,10),this.setProperties({pageSettings:{currentPage:e}},!0),this.pageSettings.currentPage=e),!0!==this.getDataModule().dataManager.dataSource.offline&&void 0!==this.getDataModule().dataManager.dataSource.url||!je(this.dataSource)&&this.dataSource.result||(this.isVirtualAdaptive=!0),this.aggregateModule&&this.aggregates.length)for(var t=0;t<this.aggregates.length;t++)for(var i=0;i<this.aggregates[parseInt(t.toString(),10)].columns.length;i++){var n=this.aggregates[parseInt(t.toString(),10)].columns[parseInt(i.toString(),10)];n.types&&(n.type=n.types)}this.isReact?(e={requireTemplateRef:this.requireTemplateRef},this.trigger(_A,e),e.requireTemplateRef||(this.requireTemplateRef=e.requireTemplateRef)):this.trigger(_A),QP(this.columns,this.enableColumnVirtualization,this),this.enableColumnVirtualization&&this.isChangeDataSourceCall&&this.columnModel&&(this.columnModel=[],this.updateColumnModel(this.columns)),this.isPreparedFrozenColumns=!0,this.enablePersistence&&this.notify(_I,{}),this.getMediaColumns(),WP(this.columns),this.isFrozenGrid()&&!this.mergedColumns&&this.setInitialFrozenColumnIndex(this.columns),this.checkLockColumns(this.columns),this.getColumns(),this.processModel(),this.gridRender(),this.wireEvents(),this.addListener(),this.updateDefaultCursor(),this.updateStackedFilter(),"Spinner"===this.loadingIndicator.indicatorType&&this.showSpinner(),this.notify(G1,{}),"Shimmer"===this.loadingIndicator.indicatorType&&this.refreshMaskRow(),this.refreshing&&this.trigger("created")},a.prototype.setInitialFrozenColumnIndex=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i[fD]=i.index,i.columns&&this.setInitialFrozenColumnIndex(i.columns)}},a.prototype.showSpinner=function(){this.isExportGrid||kA(this.element)},a.prototype.hideSpinner=function(){this.isExportGrid||BA(this.element)},a.prototype.showMaskRow=function(e,t){if(!je(this.headerModule)&&!je(this.contentModule)){var i,n=this.getHeaderContent().firstChild,o=this.getContent().firstChild,r=this.getFooterContent();if(t){var s=t.querySelector(".e-checkboxlist"),a=Math.floor(s.getBoundingClientRect().height/this.getRowHeight()),l='<div class="e-ftrchk e-mask-ftrchk"><div class="e-checkbox-wrapper"><input class="e-chk-hidden">'+this.getShimmerTemplate()+this.getShimmerTemplate()+"</div></div>";s.innerHTML="";for(var h=0;h<a;h++){s.innerHTML+=l,s.querySelector(".e-ftrchk.e-mask-ftrchk").style.width="100%",s.querySelector(".e-checkbox-wrapper").style.width="100%";var d=[].slice.call(s.querySelectorAll(".e-mask:not(.e-mask-checkbox-filter-intent):not(.e-mask-checkbox-filter-span-intent)"));d[0].classList.add("e-mask-checkbox-filter-intent"),d[1].classList.add("e-mask-checkbox-filter-span-intent")}}else(!this.enableRtl&&!this.getHeaderContent().style.paddingRight||this.enableRtl&&!this.getHeaderContent().style.paddingLeft)&&(o.style.overflowY="hidden"),this.isInitialLoad||this.getColumns().length?(this.maskRowContentScroll=!(!this.enableVirtualization&&!this.enableColumnVirtualization||!e),this.contentMaskTable||(i=o,je((i=this.enableVirtualization||this.enableColumnVirtualization?i.querySelector(".e-virtualtable"):i).querySelector("tbody")))||(this.contentMaskTable=this.createMaskTable(i,this.getContentMaskColumns(),e)),!this.headerMaskTable&&(this.isFrozenGrid()||this.enableColumnVirtualization&&"X"===e)&&(i=n,this.enableColumnVirtualization&&"X"===e&&(i=i.querySelector(".e-virtualtable")),this.headerMaskTable=this.createMaskTable(i,this.getContentMaskColumns(),e)),r&&r.querySelector(".e-summaryrow")&&(t=r.firstChild,this.footerContentMaskTable||(this.footerContentMaskTable=this.createMaskTable(t))),this.enableVirtualization&&e||E.add(o,"scroll",this.translateMaskRow,this)):(r=0===(i=o.getBoundingClientRect().height)?this.allowPaging?this.pageSettings.pageSize*this.getRowHeight():window.innerHeight:i,t=Math.ceil(r/this.getRowHeight()),"Vertical"!==this.rowRenderingMode&&(this.headerMaskTable=this.createEmptyMaskTable(n,1)),this.contentMaskTable=this.createEmptyMaskTable(o,t))}},a.prototype.getContentMaskColumns=function(){return this.getColumns()},a.prototype.createEmptyMaskTable=function(e,t){var i=this.createElement("table",{className:"e-table e-masked-table"}),n=this.createElement("tbody",{className:"e-masked-tbody"}),o=this.createElement("tr",{className:"e-masked-row e-row"}),r=(o.style.height=this.getRowHeight()+"px",this.createElement("td",{className:"e-masked-cell e-rowcell"}));r.innerHTML=this.getShimmerTemplate(),o.appendChild(r);for(var s=0;s<t;s++)n.appendChild(o.cloneNode(!0));return i.appendChild(n),e.appendChild(i),i},a.prototype.createMaskTable=function(e,t,i){var n=!!z(e,".e-gridheader"),o=!!z(e,".e-gridcontent"),r=!!z(e,".e-gridfooter"),s=this.getContent().firstChild,a=s.scrollHeight,l=e.querySelector("table"),h=l.cloneNode(),d=(h.removeAttribute("role"),h.removeAttribute("id"),rt(h,"position: absolute; z-index: 5; width: "+l.getBoundingClientRect().width+"px;"),!n||this.enableColumnVirtualization&&"X"===i||(h.style.transform="translate(0px,"+l.querySelector("thead").getBoundingClientRect().height+"px)"),h.setAttribute("class","e-table e-masked-table"),l.querySelector("colgroup").cloneNode(!0));if(d.removeAttribute("id"),d.setAttribute("class","e-masked-colgroup"),h.appendChild(d),n&&this.enableColumnVirtualization&&"X"===i){var p=this.createMaskRow(d,t);if(this.isFrozenGrid())for(var c=[].slice.call(p.querySelectorAll(".e-rowcell")),u=0;u<c.length;u++)u<this.frozenLeftCount?(this.frozenLeftCount-1===u&&c[parseInt(u.toString(),10)].classList.add("e-freezeleftborder"),c[parseInt(u.toString(),10)].classList.add("e-leftfreeze"),c[parseInt(u.toString(),10)].setAttribute("aria-colindex",(u+1).toString()),c[parseInt(u.toString(),10)].style.left=t[parseInt(u.toString(),10)].valueX-this.translateX+"px"):c.length-this.frozenRightCount<=u&&t[parseInt(u.toString(),10)]&&(c.length-this.frozenRightCount===u&&c[parseInt(u.toString(),10)].classList.add("e-freezerightborder"),c[parseInt(u.toString(),10)].classList.add("e-rightfreeze"),c[parseInt(u.toString(),10)].setAttribute("aria-colindex",(u+1).toString()),c[parseInt(u.toString(),10)].style.right=this.translateX+t[parseInt(u.toString(),10)].valueX+"px");for(var g=l.querySelector("thead"),m=[].slice.call(g.querySelectorAll("tr")),f=g.cloneNode(),y=(f.removeAttribute("role"),f.setAttribute("class","e-masked-thead"),m.length),u=0;u<y;u++)f.appendChild(p.cloneNode(!0)),f.childNodes[parseInt(u.toString(),10)].style.height=m[parseInt(u.toString(),10)].getBoundingClientRect().height+"px";h.appendChild(f)}var v=l.querySelector("tbody").cloneNode(),g=(v.removeAttribute("role"),v.setAttribute("class","e-masked-tbody"),l.querySelector("tbody"));if(o||n){var b,w=s,y=Math.ceil(w.getBoundingClientRect().height/this.getRowHeight());if(this.allowPaging&&this.pageSettings.pageSize!==this.currentViewData.length&&this.pagerModule.pagerObj.totalPages!==this.pageSettings.currentPage){(b=(p=this.createMaskRow(d,t)).cloneNode(!0)).classList.add("e-altrow");for(u=0;u<this.pageSettings.pageSize-this.currentViewData.length;u++)v.appendChild((u%2==1?b:p).cloneNode(!0))}if(g.querySelector(".e-emptyrow")||!g.childNodes.length||o&&this.childGrid){(b=(p=this.createMaskRow(d,t)).cloneNode(!0)).classList.add("e-altrow");for(u=0;u<y;u++)v.appendChild(((u+1)%2==0?b:p).cloneNode(!0))}else{var m=[].slice.call(g.querySelectorAll('tr:not(.e-hide):not([style*="display:none"]):not([style*="display: none"])')),w=g.querySelector(".e-addedrow, .e-editedrow"),d=void 0;if(w){if(d=m.indexOf(w),this.isFrozenGrid()&&this.enableColumnVirtualization)for(c=[].slice.call(m[d+1].querySelectorAll(".e-rowcell")),u=0;u<c.length;u++)u<this.frozenLeftCount?(c[parseInt(u.toString(),10)].classList.add("e-leftfreeze"),c[parseInt(u.toString(),10)].setAttribute("aria-colindex",(u+1).toString()),c[parseInt(u.toString(),10)].style.left=t[parseInt(u.toString(),10)].valueX-this.translateX+"px"):c.length-this.frozenRightCount<=u&&t[parseInt(u.toString(),10)]&&(c[parseInt(u.toString(),10)].classList.add("e-rightfreeze"),c[parseInt(u.toString(),10)].setAttribute("aria-colindex",(u+1).toString()),c[parseInt(u.toString(),10)].style.right=this.translateX+t[parseInt(u.toString(),10)].valueX+"px");w.classList.contains("e-addedrow")?m.splice(d,2):m.splice(d,1)}y=(!this.enableVirtualization&&!this.enableColumnVirtualization||!i)&&y<=m.length?y:m.length;for(u=0;u<y;u++)v.appendChild(this.applyMaskRow(m[parseInt(u.toString(),10)].cloneNode(!0),m[parseInt(u.toString(),10)].getBoundingClientRect().height));w&&w.classList.contains("e-editedrow")&&d<y&&((g=v.childNodes[parseInt(d.toString(),10)]).style.height=this.getRowHeight()+"px",g.classList.add("e-row"),w.classList.contains("e-altrow"))&&g.classList.add("e-altrow")}}if(h.appendChild(v),r){for(var d=l.querySelector("tfoot"),C=d.cloneNode(),m=(C.setAttribute("class","e-masked-tfoot"),[].slice.call(d.querySelectorAll("tr"))),u=0;u<m.length;u++)C.appendChild(this.applyMaskRow(m[parseInt(u.toString(),10)].cloneNode(!0),m[parseInt(u.toString(),10)].getBoundingClientRect().height));h.appendChild(C)}return n&&this.isFrozenGrid()&&!this.enableColumnVirtualization&&(this.getHeaderContent().querySelector("."+VE).style.position="relative"),e.insertBefore(h,e.firstChild),!o||this.enableVirtualization&&i||(w=a-h.getBoundingClientRect().height,g=s.scrollTop<=(w=w<0?0:w)?s.scrollTop:w,this.enableVirtualization&&(g-=jB(z(e,".e-virtualtable")).height),h.style.transform="translate(0px,"+g+"px)"),h},a.prototype.applyMaskRow=function(e,t){e.removeAttribute("role"),e.removeAttribute("aria-rowindex"),e.removeAttribute("data-uid"),e.classList.add("e-masked-row"),e.style.height=t+"px";for(var i=[].slice.call(e.childNodes),n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)],r=o.firstChild&&o.firstChild.classList&&o.firstChild.classList.contains("e-checkbox-wrapper");o.removeAttribute("role"),o.removeAttribute("tabindex"),o.removeAttribute("aria-label"),this.enableColumnVirtualization&&o.classList.contains("e-fixedfreeze")&&(q([o],["e-fixedfreeze","e-freezeleftborder","e-freezerightborder"]),U([o],["e-unfreeze"])),o.removeAttribute("aria-colindex"),o.removeAttribute("index"),o.removeAttribute("ej-mappingname"),o.removeAttribute("ej-mappingvalue"),o.removeAttribute("e-mappinguid"),o.removeAttribute("aria-expanded"),o.classList.add("e-masked-cell"),o.innerHTML=this.getShimmerTemplate(),o.classList.contains("e-recordplusexpand")||o.classList.contains("e-recordpluscollapse")?o.firstChild.classList.add("e-mask-group-intent"):o.classList.contains("e-gridchkbox")||r?o.firstChild.classList.add("e-mask-checkbox-intent"):o.classList.contains("e-rowdragdrop")?o.firstChild.classList.add("e-mask-drag-intent"):o.classList.contains("e-indentcell")&&(o.innerHTML="")}return e},a.prototype.createMaskRow=function(e,t){for(var i=e,n=t,o=this.createElement("tr",{className:"e-masked-row e-row"}),r=("Vertical"!==this.rowRenderingMode&&(o.style.height=this.getRowHeight()+"px"),this.createElement("td",{className:"e-masked-cell e-rowcell"})),s=0,a=0;s<i.childNodes.length;s++){var l=i.childNodes[parseInt(s.toString(),10)],h=r.cloneNode();h.innerHTML=this.getShimmerTemplate(),l.classList.contains("e-group-intent")||l.classList.contains("e-detail-intent")||l.classList.contains("e-drag-intent")?l.classList.contains("e-group-intent")?h.firstChild.classList.add("e-mask-group-intent"):l.classList.contains("e-detail-intent")?h.firstChild.classList.add("e-mask-detail-intent"):l.classList.contains("e-drag-intent")&&h.firstChild.classList.add("e-mask-drag-intent"):("Vertical"===this.rowRenderingMode&&n[parseInt(a.toString(),10)]&&h.setAttribute("data-cell",n[parseInt(a.toString(),10)].headerText?n[parseInt(a.toString(),10)].headerText:n[parseInt(a.toString(),10)].field),"none"===l.style.display?h.classList.add("e-hide"):(h.style.textAlign=n[parseInt(a.toString(),10)]&&n[parseInt(a.toString(),10)].textAlign?n[parseInt(a.toString(),10)].textAlign.toLowerCase():this.enableRtl?"right":"left",n[parseInt(a.toString(),10)]&&("checkbox"===n[parseInt(a.toString(),10)].type||n[parseInt(a.toString(),10)].displayAsCheckBox)&&h.firstChild.classList.add("e-mask-checkbox-intent")),a++),o.appendChild(h)}return o},a.prototype.getShimmerTemplate=function(){return this.maskRowContentScroll?'<span class="e-mask e-skeleton e-skeleton-text"></span>':'<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave"></span>'},a.prototype.addShimmerEffect=function(){this.maskRowContentScroll=!1;for(var e=[].slice.call(this.element.querySelectorAll(".e-mask:not(.e-shimmer-wave)")),t=0;t<e.length;t++)e[parseInt(t.toString(),10)]&&e[parseInt(t.toString(),10)].classList.add("e-shimmer-wave")},a.prototype.translateMaskRow=function(e){for(var t=e.target,i=t.querySelectorAll(".e-masked-table"),n=0;n<i.length;n++){var o,r=i[parseInt(n.toString(),10)];r&&(o=t.scrollHeight-r.getBoundingClientRect().height,o=t.scrollTop<=(o=o<0?0:o)?t.scrollTop:o,this.enableVirtualization&&(o-=jB(z(r,".e-virtualtable")).height),r.style.transform="translate(0px,"+o+"px)")}},a.prototype.removeMaskRow=function(){je(this.contentModule)||(e=this.getContent().firstChild,E.remove(e,"scroll",this.translateMaskRow)),this.headerMaskTable&&this.isFrozenGrid()&&!this.enableColumnVirtualization&&(this.getHeaderContent().querySelector("."+VE).style.position="");for(var e,t=[this.headerMaskTable,this.contentMaskTable,this.footerContentMaskTable],i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];n&&ue(n)}this.headerMaskTable=null,this.contentMaskTable=null,this.footerContentMaskTable=null},a.prototype.refreshMaskRow=function(){var e,t=this.getContent().firstChild;(this.isInitialLoad||this.getColumns().length)&&this.contentMaskTable&&t.querySelector(".e-masked-table")&&(e=t,this.enableVirtualization&&(e=t.querySelector(".e-virtualtable")),this.refreshMaskRowColgroupWidth(e))},a.prototype.refreshMaskRowColgroupWidth=function(e){var t=e.querySelector("table:not(.e-masked-table)"),i=t.querySelector(rD).cloneNode(!0),e=e.querySelector(".e-masked-table");i.removeAttribute("id"),i.setAttribute("class","e-masked-colgroup");for(var n=0;n<i.childNodes.length;n++)i.childNodes[parseInt(n.toString(),10)].removeAttribute("class");ue(e.querySelector(".e-masked-colgroup")),e.insertBefore(i,e.firstChild),e.style.width=t.getBoundingClientRect().width+"px"},a.prototype.updateStackedFilter=function(){this.allowFiltering&&"FilterBar"===this.filterSettings.type&&this.getHeaderContent().getElementsByClassName("e-stackedheadercell").length?this.getHeaderContent().classList.add("e-stackedfilter"):this.getHeaderContent().classList.remove("e-stackedfilter")},a.prototype.getMediaColumns=function(){if(!this.enableColumnVirtualization){var e=this.getColumns();if(this.getShowHideService=this.serviceLocator.getService("showHideService"),!je(e))for(var t=0;t<e.length;t++)je(e[parseInt(t.toString(),10)].hideAtMedia)||!je(e[parseInt(t.toString(),10)].visible)&&!e[parseInt(t.toString(),10)].visible||this.pushMediaColumn(e[parseInt(t.toString(),10)],t)}this.updateFrozenColumnsWidth()},a.prototype.pushMediaColumn=function(e,t){this.mediaCol.push(e),this.media[e.uid]=window.matchMedia(e.hideAtMedia),this.mediaQueryUpdate(t,this.media[e.uid]),this.mediaBindInstance[parseInt(t.toString(),10)]=this.mediaQueryUpdate.bind(this,t),this.media[e.uid].addListener(this.mediaBindInstance[parseInt(t.toString(),10)])},a.prototype.updateMediaColumns=function(e){if(!this.enableColumnVirtualization){for(var t=this.getColumnIndexByUid(e.uid),i=0;i<this.mediaCol.length;i++)if(e.uid===this.mediaCol[parseInt(i.toString(),10)].uid)return void this.mediaCol.splice(i,1);this.pushMediaColumn(e,t)}},a.prototype.mediaQueryUpdate=function(e,t){var i=this.getColumns()[parseInt(e.toString(),10)];this.mediaCol.some(function(e){return e.uid===i.uid})&&(i.visible=t.matches,this.isInitialLoad)&&(this.invokedFromMedia=!0,i.visible?this.showHider.show(i.headerText,"headerText"):this.showHider.hide(i.headerText,"headerText"))},a.prototype.refreshMediaCol=function(){this.isInitialLoad=!0;var e=this.element.querySelector("."+NE),e=(this.aggregates.length&&this.element.scrollHeight>parseInt(this.height.toString(),10)&&e&&U([e],["e-footerpadding"]),this.getColumns().filter(function(e){return"checkbox"===e.type}));(0===e.length||e.length&&"ResetOnRowClick"===this.selectionSettings.checkboxMode)&&(this.isCheckBoxSelection=!1),"Vertical"===this.rowRenderingMode&&this.enableHover&&(this.setProperties({enableAdaptiveUI:!0,enableHover:!1},!0),q([this.element],"e-gridhover")),this.enableAdaptiveUI&&this.scrollModule&&this.scrollModule.refresh(),this.isFrozenGrid()&&this.isAutoGenerateColumns&&(this.widthService.setWidthToColumns(),this.isAutoGenerateColumns=!1)},a.prototype.removeMediaListener=function(){for(var e=0;e<this.mediaCol.length;e++)this.media[this.mediaCol[parseInt(e.toString(),10)].uid].removeListener(this.mediaBindInstance[this.mediaCol[parseInt(e.toString(),10)].index])},a.prototype.eventInitializer=function(){},a.prototype.destroy=function(){var e=this.element;if(e){for(var e=!(!e.querySelector("."+RE)||!e.querySelector("."+OE)),t=(e&&this.unwireEvents(),this.removeListener(),this.removeMediaListener(),this.notify(Cx,{}),this.destroyDependentModules(),this.isReact&&this.destroyTemplate(["template"]),this.isVue&&this.destroyTemplate(),e&&AP.prototype.destroy.call(this),this.toolTipObj.destroy(),this.isReact&&!F.isIE&&(this.element.innerHTML=""),["renderModule","headerModule","contentModule","valueFormatterService","serviceLocator","ariaService","keyboardModule","widthService","searchModule","showHider","scrollModule","printModule","clipboardModule","focusModule"]),i=0;i<t.length;i++)this[t[parseInt(i.toString(),10)]]&&(this[t[parseInt(i.toString(),10)]]=null);this.element.innerHTML="",mt(this.element,[],["e-rtl","e-gridhover","e-responsive","e-default","e-device","e-grid-min-height"])}},a.prototype.destroyDependentModules=function(){var e=this.element;e&&(e.querySelector("."+RE)||e.querySelector("."+OE))&&(this.scrollModule.destroy(),this.keyboardModule.destroy(),this.focusModule.destroy(),this.clipboardModule.destroy(),this.printModule.destroy())},a.prototype.getModuleName=function(){return"grid"},a.prototype.enableBoxSelection=function(){this.enableAutoFill?(this.selectionSettings.cellSelectionMode="BoxWithBorder",this.element.classList.add("e-afenabled")):(this.element.classList.remove("e-afenabled"),this.notify(fx,{}))},a.prototype.setCSSClass=function(e){this.cssClass&&U([this.element],this.cssClass.split(" ")),e&&q([this.element],e.split(" "))},a.prototype.onPropertyChanged=function(e,t){var i,n=!1,o=!1,r=!1,s=null;if(!this.isDestroyed){this.log("module_missing"),this.isEllipsisTooltip()&&this.toolTipObj.close();var a=Object.keys(e);-1<a.indexOf("columns")&&(this.enableColumnVirtualization&&(this.columnModel=[]),this.updateColumnObject(),o=!0);for(var l=0,h=a;l<h.length;l++){var d=h[l];switch(d){case"allowPaging":this.notify(K1,{module:"pager",enable:this.allowPaging}),n=!0,"100%"===this.height&&this.scrollModule.refresh();break;case"pageSettings":if(this.pageTemplateChange)this.pageTemplateChange=!1,this.notify(Z1,{module:"pager",properties:e.pageSettings});else{if(this.pagerModule&&this.pagerModule.isCancel)return void(this.pagerModule.isCancel=!1);this.notify(Z1,{module:"pager",properties:e.pageSettings}),(je(e.pageSettings.currentPage)&&je(e.pageSettings.pageSize)&&je(e.pageSettings.totalRecordsCount)||!je(t.pageSettings)&&e.pageSettings.currentPage!==t.pageSettings.currentPage&&!this.enableColumnVirtualization&&!this.enableVirtualization&&this.pageRequireRefresh&&this.pageSettings.totalRecordsCount<=this.pageSettings.pageSize)&&(n=!0),this.pageRequireRefresh||(this.pageRequireRefresh=!0),this.pagerModule&&this.pagerModule.isCancel&&(this.pagerModule.isCancel=!1)}break;case"allowSorting":this.notify(K1,{module:"sort",enable:this.allowSorting}),i=n=!0;break;case"allowFiltering":this.updateStackedFilter(),this.notify(K1,{module:"filter",enable:this.allowFiltering}),n=!0,"FilterBar"!==this.filterSettings.type||this.editSettings.showAddNewRow&&"FilterBar"===this.filterSettings.type?this.refreshHeader():"100%"===this.height&&this.scrollModule.refresh();break;case"height":case"width":this.notify(K1,{module:"scroll",properties:{width:e.width,height:e.height}}),this.allowPaging&&this.pagerModule.refresh();break;case"allowReordering":this.headerModule.refreshUI(),i=!0;break;case"allowRowDragAndDrop":this.notify(K1,{module:"rowDragAndDrop",enable:this.allowRowDragAndDrop}),this.renderModule.refresh(),this.headerModule.refreshUI();break;case"allowSelection":this.notify(K1,{module:"selection",enable:this.allowSelection}),this.renderModule.refresh();break;case"cssClass":this.setCSSClass(t.cssClass);break;case"enableAutoFill":this.selectionModule&&(this.enableBoxSelection(),this.selectionModule.updateAutoFillPosition());break;case"rowTemplate":this.rowTemplateFn=HP(this.rowTemplate),n=!0;break;case"emptyRecordTemplate":this.emptyRecordTemplateFn=HP(this.emptyRecordTemplate),n=!0;break;case"detailTemplate":this.detailTemplateFn=HP(this.detailTemplate),n=!0;break;case"allowGrouping":this.notify(K1,{module:"group",enable:this.allowGrouping}),this.headerModule.refreshUI(),i=n=!0,"100%"===this.height&&this.scrollModule.refresh();break;case"enableInfiniteScrolling":case"childGrid":if(n=!0,s=(p=this.parentDetails?document.querySelector("#"+this.parentDetails.parentID):null)?p.ej2_instances[0]:null,this.childGrid&&s&&je(s.childGrid.childGrid)){var p=Object.assign({},s.childGrid,{childGrid:e.childGrid});for(s.setProperties({childGrid:p},!0);!je(s.parentDetails);){var c,u=document.querySelector("#"+s.parentDetails.parentID),u=u?u.ej2_instances[0]:null;u&&((c=Object.assign({},u.childGrid)).childGrid=s.childGrid,u.setProperties({childGrid:c},!0)),s=u}}this.headerModule.refreshUI();break;case"toolbar":this.notify(K1,{module:"toolbar"}),"100%"===this.height&&this.scrollModule.refresh();break;case"groupSettings":this.notify(Z1,{module:"group",properties:e.groupSettings,oldProperties:t.groupSettings});break;case"aggregates":!this.aggregates.length&&this.allowGrouping&&this.groupSettings.columns.length&&(n=!0),this.notify(K1,{module:"aggregate",properties:e}),"100%"===this.height&&this.scrollModule.refresh();break;case"frozenColumns":case"frozenRows":case"enableVirtualization":case"enableColumnVirtualization":case"currencyCode":case"locale":this.isFrozenGrid()&&this.log("frozen_rows_columns"),this.addNewRowFocus=o=r=!0;break;case"query":this.getDataModule().isQueryInvokedFromData||(n=!0),this.getDataModule().isQueryInvokedFromData=!1;break;case"autoFit":this.autoFit?this.preventAdjustColumns():this.restoreAdjustColumns();break;default:this.extendedPropertyChange(d,e,o)}}i&&this.updateDefaultCursor(),o?r||this.getFrozenColumns()||this.frozenRows||this.frozenLeftColumns.length||this.frozenRightColumns.length?this.freezeRefresh():this.refresh():n&&(this.notify($1,{requestType:"refresh"}),n=!1,this.maintainSelection(e.selectedRowIndex))}},a.prototype.extendedPropertyChange=function(e,t,i){switch(e){case"enableRtl":this.updateRTL(),this.allowPaging&&(this.element.querySelector(".e-gridpager").ej2_instances[0].enableRtl=t.enableRtl,this.element.querySelector(".e-gridpager").ej2_instances[0].dataBind()),"auto"!==this.height&&(this.scrollModule.removePadding(!t.enableRtl),this.scrollModule.setPadding()),this.toolbar&&this.toolbarModule&&(this.toolbarModule.getToolbar().ej2_instances[0].enableRtl=t.enableRtl,this.toolbarModule.getToolbar().ej2_instances[0].dataBind()),this.contextMenuItems&&this.contextMenuModule&&(this.contextMenuModule.getContextMenu().ej2_instances[0].enableRtl=t.enableRtl,this.contextMenuModule.getContextMenu().ej2_instances[0].dataBind()),this.showColumnMenu&&this.columnMenuModule&&!this.enableAdaptiveUI&&(this.columnMenuModule.getColumnMenu().ej2_instances[0].enableRtl=t.enableRtl,this.columnMenuModule.getColumnMenu().ej2_instances[0].dataBind()),"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&this.refreshHeader(),this.notify(bI,{});break;case"enableAltRow":this.renderModule.refresh();break;case"allowResizing":this.resizeModule&&this.resizeModule.render(),this.headerModule.refreshUI(),this.updateResizeLines();break;case"rowHeight":(this.rowHeight?U:q)([this.element],"e-grid-min-height"),this.renderModule.refresh(),this.headerModule.refreshUI();break;case"gridLines":this.updateGridLines();break;case"showColumnMenu":this.headerModule.refreshUI(),this.notify(K1,{module:"columnMenu",enable:!0});break;case"columnMenuItems":this.notify(K1,{module:"columnMenu",enable:this.columnMenuItems});break;case"contextMenuItems":this.notify(K1,{module:"contextMenu",enable:this.contextMenuItems});break;case"showColumnChooser":this.toolbarModule&&this.toolbarModule.refreshToolbarItems(),this.notify(K1,{module:"columnChooser",enable:this.showColumnChooser});break;case"filterSettings":this.updateStackedFilter(),this.notify(Z1,{module:"filter",properties:t.filterSettings});break;case"searchSettings":this.notify(Z1,{module:"search",properties:t.searchSettings});break;case"sortSettings":this.notify(Z1,{module:"sort"});break;case"selectionSettings":this.notify(Z1,{module:"selection",properties:t.selectionSettings});break;case"editSettings":this.notify(Z1,{module:"edit",properties:t.editSettings});break;case"allowTextWrap":case"textWrapSettings":this.allowTextWrap?this.applyTextWrap():this.removeTextWrap(),this.notify(oI,{case:"textwrap",isModeChg:"textWrapSettings"===e}),this.refreshHeader(),"100%"===this.height&&this.scrollModule.refresh();break;case"dataSource":var n,o=this.getDataModule().getState();if(!this.allowPaging||!this.pageSettings.pageSizes||this.getDataModule().isRemote()||o&&o.isPending||this.pagerModule.pagerObj.isAllPage&&(n=this.dataSource instanceof me?this.dataSource.dataSource.json.length:"result"in this.dataSource?this.dataSource.count:this.dataSource.length,!!(Array.isArray(this.pageSettings.pageSizes)&&-1<this.pageSettings.pageSizes.indexOf("All"))||this.pageSettings.pageSizes||this.pageSettings.pageSize===n?(this.setProperties({pageSettings:{pageSize:n}},!0),this.pagerModule.pagerObj.setProperties({pageSize:n},!0)):this.pagerModule.pagerObj.isAllPage=!1),!this.allowSelection||!this.isPersistSelection||o&&o.isPending||this.clearSelection(),!je(this.dataSource)&&this.dataSource.result&&(this.isVirtualAdaptive=!1),Object.getPrototypeOf(t).deepWatch)for(var r=this.getPrimaryKeyFieldNames()[0],s=0,a=Object.keys(t.dataSource);s<a.length;s++)this.setRowData(R(r,this.dataSource[a[parseInt(s.toString(),10)]]),this.dataSource[a[parseInt(s.toString(),10)]]);else if(o.isPending){var l=je(this.dataSource)?[]:this.dataSource.result;if((h=o.group||[]).length&&!this.groupSettings.enableLazyLoading&&(!l.length||!l[0].field))for(s=0;s<h.length;s++)l=Sa.group(l,h[parseInt(s.toString(),10)],o.aggregates||[]);this.dataSource={result:l,count:this.dataSource.count,aggregates:this.dataSource.aggregates},this.getDataModule().setState({}),o.resolver(this.dataSource)}else{if(!je(this.dataSource)&&this.dataSource.result&&this.dataSource.count&&this.groupSettings.columns.length){var h,l=this.dataSource.result;if((h=this.groupSettings.columns).length&&(!l.length||!l[0].field))for(s=0;s<h.length;s++)l=Sa.group(l,h[parseInt(s.toString(),10)]);this.dataSource={result:l,count:this.dataSource.count}}this.getDataModule().setState({isDataChanged:!1}),this.notify(kx,{}),i||(this.renderModule.refresh(),this.isCheckBoxSelection&&this.notify(MT,{}))}this.scrollRefresh();break;case"enableHover":(t.enableHover?U:q)([this.element],"e-gridhover");break;case"selectedRowIndex":this.isSelectedRowIndexUpdating||this.selectRow(t.selectedRowIndex),this.isSelectedRowIndexUpdating=!1;break;case"resizeSettings":this.widthService.setWidthToTable();break;case"enableAdaptiveUI":this.notify(WT,{});break;case"rowRenderingMode":this.enableVerticalRendering(),this.notify(UT,{}),this.refresh();break;case"enableStickyHeader":this.scrollModule.addStickyListener(t.enableStickyHeader);break;case"allowPdfExport":case"allowExcelExport":this.toolbarModule&&this.toolbarModule.refreshToolbarItems()}},a.prototype.maintainSelection=function(e){var t,i=this;-1!==e&&this.on(X1,t=function(){i.selectRow(e),i.off(X1,t)},this)},a.prototype.setProperties=function(e,t){AP.prototype.setProperties.call(this,e,t);e.filterSettings&&this.filterModule&&t&&this.filterModule.refreshFilter()},a.prototype.getTablesCount=function(){return this.tablesCount},a.prototype.updateDefaultCursor=function(){for(var e=[].slice.call(this.getHeaderContent().querySelectorAll(".e-headercell:not(.e-stackedheadercell)")),t=[].slice.call(this.getHeaderContent().getElementsByClassName("e-stackedheadercell")),i=this.getColumns(),n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)];(this.allowGrouping||this.allowReordering||this.allowSorting)&&(i[parseInt(n.toString(),10)].allowReordering&&i[parseInt(n.toString(),10)].allowSorting&&i[parseInt(n.toString(),10)].allowGrouping?o.classList.add("e-mousepointer"):o.classList.add("e-defaultcursor"))}for(var r=0;r<t.length;r++)this.allowReordering&&t[parseInt(r.toString(),10)].classList.add("e-mousepointer")},a.prototype.updateColumnModel=function(e,t){for(var i=0,n=je(e)?0:e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?this.updateColumnModel(e[parseInt(i.toString(),10)].columns,!0):this.columnModel.push(e[parseInt(i.toString(),10)]);!je(t)&&t||this.updateLockableColumns()},a.prototype.getFrozenLeftCount=function(){return this.getFrozenColumns()||this.getFrozenLeftColumnsCount()},a.prototype.isFrozenGrid=function(){return 0!==this.getFrozenColumns()||0!==this.frozenLeftColumns.length||0!==this.frozenRightColumns.length||0!==this.fixedColumns.length},a.prototype.getFrozenMode=function(){return this.frozenName},a.prototype.updateLockableColumns=function(){for(var e=this.columnModel,t=0,i=0,n=this.getFrozenColumns(),o=0;o<e.length;o++)e[parseInt(o.toString(),10)].lockColumn&&(o<n?(e.splice(t,0,e.splice(o,1)[0]),t++):(e.splice(n+i,0,e.splice(o,1)[0]),i++))},a.prototype.checkLockColumns=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].columns?this.checkLockColumns(e[parseInt(t.toString(),10)].columns):e[parseInt(t.toString(),10)].lockColumn&&this.lockcolPositionCount++},a.prototype.leftrightColumnWidth=function(e){var e="left"===e?this.getFrozenLeftColumns():"right"===e?this.getFrozenRightColumns():[],t=0;return e.filter(function(e){e.visible&&(t+=parseInt(e.width.toString(),10))}),t},a.prototype.getColumns=function(e){var t=this,i=this.inViewIndexes.map(function(e){return e-t.groupSettings.columns.length}).filter(function(e){return-1<e}),n=i.length,o=(this.enableColumnVirtualization&&!je(this.columnModel)&&0!==this.columnModel.length&&!e||(this.columnModel=[],this.updateColumnModel(this.columns)),0===n?this.columnModel:this.getVisibleColumns().slice(i[0],i[n-1]+1)),r=[],s=[],a=[],l=this.enableColumnVirtualization&&this.isPreparedFrozenColumns&&0===n;l&&(this.frozenRightColumns=[],this.frozenLeftColumns=[]);for(var h=0;h<o.length;h++)"Left"===o[parseInt(h.toString(),10)].freeze||o[parseInt(h.toString(),10)].isFrozen?(r.push(o[parseInt(h.toString(),10)]),l&&this.frozenLeftColumns.push(o[parseInt(h.toString(),10)])):"Right"===o[parseInt(h.toString(),10)].freeze?(s.push(o[parseInt(h.toString(),10)]),l&&this.frozenRightColumns.push(o[parseInt(h.toString(),10)])):a.push(o[parseInt(h.toString(),10)]);return this.enableColumnVirtualization&&this.isFrozenGrid()&&(this.frozenLeftColumns.length&&(r=this.frozenLeftColumns),this.frozenRightColumns.length)&&(s=this.frozenRightColumns),r.concat(a).concat(s)},a.prototype.getStackedHeaderColumnByHeaderText=function(e,t){for(var i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];if(n.field===e||n.headerText===e){this.stackedColumn=n;break}n.columns&&this.getStackedHeaderColumnByHeaderText(e,n.columns)}return this.stackedColumn},a.prototype.getColumnIndexesInView=function(){return this.inViewIndexes},a.prototype.getQuery=function(){return this.query},a.prototype.getLocaleConstants=function(){return this.defaultLocale},a.prototype.setColumnIndexesInView=function(e){this.inViewIndexes=e},a.prototype.getVisibleColumns=function(){return this.getCurrentVisibleColumns()},a.prototype.getHeaderContent=function(){return this.headerModule.getPanel()},a.prototype.setGridHeaderContent=function(e){this.headerModule.setPanel(e)},a.prototype.getContentTable=function(){return this.contentModule.getTable()},a.prototype.setGridContentTable=function(e){this.contentModule.setTable(e)},a.prototype.getContent=function(){return this.contentModule.getPanel()},a.prototype.setGridContent=function(e){this.contentModule.setPanel(e)},a.prototype.getHeaderTable=function(){return this.headerModule.getTable()},a.prototype.setGridHeaderTable=function(e){this.headerModule.setTable(e)},a.prototype.getFooterContent=function(){return this.footerElement=this.element.getElementsByClassName(NE)[0],this.footerElement},a.prototype.getFooterContentTable=function(){return this.footerElement=this.element.getElementsByClassName(NE)[0],this.footerElement.firstChild.firstChild},a.prototype.getPager=function(){return this.gridPager},a.prototype.setGridPager=function(e){this.gridPager=e},a.prototype.getRowByIndex=function(e){return(this.enableVirtualization&&this.groupSettings.enableLazyLoading?this.lazyLoadRender:this.contentModule).getRowByIndex(e)},a.prototype.getMovableRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},a.prototype.getFrozenRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},a.prototype.getRows=function(){return this.contentModule.getRowElements()},a.prototype.getFrozenRightRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},a.prototype.getRowInfo=function(e){var t=e,i={target:e};if(!je(e)&&je(A(t,"e-detailrowcollapse")&&je(A(t,"e-recordplusexpand")))){var n=z(t,"."+LE);if(!n)return je(t=z(t,"."+UE))||t.classList.contains("e-addedrow")||(s=this.getRowObjectFromUID(t.getAttribute("data-uid")),o=parseInt(t.getAttribute(nD),10)-1,i={row:t,rowData:s.data,rowIndex:o}),i;var o,r,s,a,l,t=parseInt(n.getAttribute(iD),10)-1,h=z(n,"."+UE);je(n)||isNaN(t)||je(h)||(o=parseInt(h.getAttribute(nD),10)-1,s=this.contentModule.getRows(),r=t+this.getIndentCount(),s=s.filter(function(e){return e.uid===h.getAttribute("data-uid")}),a={},l=void 0,Object.keys(s).length&&(a=s[0].data,l=s[0].cells[parseInt(r.toString(),10)].column),i={cell:n,cellIndex:t,row:h,rowIndex:o,rowData:a,column:l,target:e})}return i},a.prototype.getMovableRows=function(){return this.contentModule.getRowElements()},a.prototype.getFrozenRightRows=function(){return this.contentModule.getRowElements()},a.prototype.getDataRows=function(){return this.getAllDataRows()},a.prototype.getAllDataRows=function(e){var t,i;return je(this.getContentTable().querySelector(oD))?[]:(i=this.getContentTable().querySelector(oD),i=[].slice.call(i.children),this.editSettings.showAddNewRow&&(i[0].classList.contains("e-addedrow")?i.shift():i[i.length-1].classList.contains("e-addedrow")&&i.pop()),this.frozenRows&&(t=this.getHeaderTable().querySelector(oD),t=[].slice.call(t.children),i=this.addMovableRows(t,i),this.editSettings.showAddNewRow)&&t[0].classList.contains("e-addedrow")&&t.shift(),this.generateDataRows(i,e))},a.prototype.addMovableRows=function(e,t){for(var i=0,n=t.length;i<n;i++)e.push(t[parseInt(i.toString(),10)]);return e},a.prototype.generateDataRows=function(e,t){for(var i=[],n=0,o=e.length;n<o;n++)!e[parseInt(n.toString(),10)].classList.contains(UE)||e[parseInt(n.toString(),10)].classList.contains("e-hiddenrow")&&!t||(this.isCollapseStateEnabled()?i[parseInt(e[parseInt(n.toString(),10)].getAttribute("aria-rowindex"),10)-1]=e[parseInt(n.toString(),10)]:i.push(e[parseInt(n.toString(),10)]));return i},a.prototype.getMovableDataRows=function(){return this.getAllMovableDataRows()},a.prototype.getAllMovableDataRows=function(e){return this.getAllDataRows(e)},a.prototype.getFrozenDataRows=function(){return this.getAllFrozenDataRows()},a.prototype.getAllFrozenDataRows=function(e){return this.getAllDataRows(e)},a.prototype.getFrozenRightDataRows=function(){return this.getAllFrozenRightDataRows()},a.prototype.getAllFrozenRightDataRows=function(e){return this.getAllDataRows(e)},a.prototype.setCellValue=function(t,e,i){var n,o,r=this.getPrimaryKeyFieldNames()[0],s=new VD(this,this.serviceLocator),a=this.getColumnIndexByField(e),l=this.getColumnByField(e),h=this.contentModule.getRows().filter(function(e){return R(r,e.data)===t})[0],d=h?this.element.querySelector("[data-uid="+h.uid+"]"):null;je(d)||(x(e,i="string"==typeof i?this.sanitize(i):i,h.data),je(n=this.enableVirtualization?d.children[parseInt(a.toString(),10)]:this.getCellFromIndex(h.index,a)))||(this.groupSettings.columns.length&&(a+=this.groupSettings.columns.length),(this.childGrid||this.detailTemplate)&&a++,this.isRowDragable()&&a++,o=h.cells[+a],s.refreshTD(n,o,h.data,{index:h.index}),this.isReact&&(n=this.enableVirtualization?d.children[parseInt(a.toString(),10)]:this.getCellFromIndex(h.index,a)),0<this.aggregates.length&&(this.notify(px,{}),0<this.groupSettings.columns.length)&&this.notify(dx,{}),je(h)||je(h.changes)||(h.changes[""+e]=i),this.trigger(zA,{cell:n,column:l,data:h.data}),this.isReact&&"0"===n.getAttribute("tabindex")&&n.classList.contains("e-focused")&&n.focus())},a.prototype.refreshReactColumnTemplateByUid=function(e,i){var n=this;this.isReact&&this.clearTemplate(["columnTemplate"],void 0,function(){var e=!(!n.childGrid||!n.element.querySelectorAll(".e-childgrid").length),t=e?n.getContentTable().querySelectorAll(".e-row"):n.getDataRows();n.refreshReactTemplateTD(t,e),i&&n.renderTemplates()})},a.prototype.refreshReactTemplateTD=function(e,t,i){for(var n=this.getIndentCount(),o=0,r=!1,s=0;s<e.length;s++){var a,l=this.getRowObjectFromUID(e[parseInt(s.toString(),10)].getAttribute("data-uid"));if(t&&!l&&A(e[parseInt(s.toString(),10)],"e-childgrid")&&(l=(a=A(e[parseInt(s.toString(),10)],"e-childgrid").ej2_instances[0]).getRowObjectFromUID(e[parseInt(s.toString(),10)].getAttribute("data-uid")),o=a.getIndentCount(),r=!0),l&&l.isDataRow&&!je(l.index)&&!e[parseInt(s.toString(),10)].classList.contains("e-editedrow"))for(var h=0;h<l.cells.length;h++){var d,p,c=l.cells[parseInt(h.toString(),10)];c.isTemplate&&(d=new VD(this,this.serviceLocator),p=t?e[parseInt(s.toString(),10)].children[c.index+(r?o:n)]:this.getCellFromIndex(s,i?c.index:h-n),d.refreshTD(p,c,l.data,{index:l.index}))}r=!1}},a.prototype.refreshGroupCaptionFooterTemplate=function(){for(var e=!(!this.childGrid||!this.element.querySelectorAll(".e-childgrid").length),t=this.getContentTable().querySelectorAll(".e-groupcaptionrow, .e-groupfooterrow"),i=0;i<t.length;i++){var n=this,o=this.getRowObjectFromUID(t[parseInt(i.toString(),10)].getAttribute("data-uid"));(o=e&&!o&&A(t[parseInt(i.toString(),10)],"e-childgrid")?(n=A(t[parseInt(i.toString(),10)],"e-childgrid").ej2_instances[0]).getRowObjectFromUID(t[parseInt(i.toString(),10)].getAttribute("data-uid")):o)&&(o={cells:o.cells.filter(function(e){return e.isDataCell}),data:o.data,dataUid:o.uid},n.notify(cx,o))}},a.prototype.refreshReactHeaderTemplateByUid=function(o){if(this.isReact)for(var r="cells",s=this.headerModule.rows,a=this.getNormalizedColumnIndex(o),l=this,e=0;e<s.length;e++)!function(e){var t,i,n=s[parseInt(e.toString(),10)][""+r][parseInt(a.toString(),10)];n&&n.column.uid===o&&(e=new qD(l,l.serviceLocator),t=A(l.element.querySelectorAll("[e-mappinguid="+o+"]")[0],"e-templatecell"),e.refresh(n,t),-1!==(t=(e=l.sortSettings.columns).findIndex(function(e){return e.field===n.column.field})))&&(i=l.getColumnHeaderByField(n.column.field),l.ariaService.setSort(i,e[parseInt(t.toString(),10)].direction.toLowerCase()),1<e.length&&i.querySelector(".e-headercelldiv").insertBefore(l.createElement("span",{className:"e-sortnumber",innerHTML:(t+1).toString()}),i.querySelector(".e-headertext")),i=i.querySelector(".e-sortfilterdiv"),"Ascending"===e[parseInt(t.toString(),10)].direction?mt(i,["e-ascending","e-icon-ascending"],[]):mt(i,["e-descending","e-icon-descending"],[]))}(e)},a.prototype.setRowData=function(t,e){var i=this.contentModule.getRows(),n=this.getPrimaryKeyFieldNames()[0],i=(i=0<this.groupSettings.columns.length&&0<this.aggregates.length?i.filter(function(e){return e.isDataRow}):i).filter(function(e){return R(n,e.data)===t})[0],o=i?[].slice.call(this.element.querySelectorAll("[data-uid="+i.uid+"]")):void 0;!je(i)&&o.length&&(i.changes=e,this.frozenRows?(o=this.getRowsObject()[i.index],this.setFrozenRowData(o,e)):this.setFrozenRowData(i,e),0<this.aggregates.length)&&(this.notify(px,{}),0<this.groupSettings.columns.length)&&this.notify(dx,{})},a.prototype.setFrozenRowData=function(e,t){var i=new yD(this.serviceLocator,null,this);e.changes=t,EB(e,this.getForeignKeyColumns(),e.changes),i.refresh(e,this.getColumns(),!0)},a.prototype.getCellFromIndex=function(e,t){var i=this.getColumnByIndex(t);return mF(this,0,e,t)},a.prototype.getMovableCellFromIndex=function(e,t){return this.getCellFromIndex(e,t)},a.prototype.getFrozenRightCellFromIndex=function(e,t){return this.getCellFromIndex(e,t)},a.prototype.getColumnHeaderByIndex=function(e){return this.getHeaderTable().getElementsByClassName("e-headercell")[parseInt(e.toString(),10)]},a.prototype.getMovableColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},a.prototype.getFrozenRightColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},a.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},a.prototype.getRowObjectFromUID=function(e){var t=this.contentModule.getRows(),t=this.rowObject(t,e);return je(t)&&this.enableVirtualization&&0<this.groupSettings.columns.length?this.rowObject(this.vRows,e):t},a.prototype.rowObject=function(e,t){if(e)for(var i=0,n=e;i<n.length;i++){var o=n[i];if(o.uid===t)return o}return null},a.prototype.getRowsObject=function(){return this.contentModule.getRows()},a.prototype.getMovableRowsObject=function(){return this.contentModule.getRows()},a.prototype.getFrozenRightRowsObject=function(){return this.contentModule.getRows()},a.prototype.getColumnHeaderByField=function(e){e=this.getColumnByField(e);return e?this.getColumnHeaderByUid(e.uid):void 0},a.prototype.getColumnHeaderByUid=function(e){e=this.getHeaderContent().querySelector("[e-mappinguid="+e+"]");return e?e.parentElement:void 0},a.prototype.getColumnByIndex=function(i){var n;return this.getColumns().some(function(e,t){return n=e,t===i}),n},a.prototype.getColumnByField=function(t){return VP(this.getColumns(),function(e){if(e.field===t)return e})[0]},a.prototype.getColumnIndexByField=function(e){for(var t=this.getColumns(),i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].field===e)return i;return-1},a.prototype.getColumnByUid=function(t,e){return VP((e?this.columns:this.getColumns()).concat(this.getStackedColumns(this.columns)),function(e){if(e.uid===t)return e})[0]},a.prototype.getStackedColumns=function(e,t){void 0===t&&(t=[]);for(var i=0,n=e;i<n.length;i++){var o=n[i];o.columns&&(t.push(o),this.getStackedColumns(o.columns,t))}return t},a.prototype.getColumnIndexByUid=function(i){var e=VP(this.getColumns(),function(e,t){if(e.uid===i)return t})[0];return je(e)?-1:e},a.prototype.getUidByColumnField=function(t){return VP(this.getColumns(),function(e){if(e.field===t)return e.uid})[0]},a.prototype.getNormalizedColumnIndex=function(e){return this.getColumnIndexByUid(e)+this.getIndentCount()},a.prototype.getIndentCount=function(){var e=0;return this.allowGrouping&&(e+=this.groupSettings.columns.length),this.isDetail()&&e++,this.isRowDragable()&&je(this.rowDropSettings.targetID)&&e++,e},a.prototype.getColumnFieldNames=function(){for(var e,t=[],i=0,n=this.getColumns().length;i<n;i++)(e=this.getColumns()[parseInt(i.toString(),10)]).visible&&t.push(e.field);return t},a.prototype.getRowTemplate=function(){return this.rowTemplateFn},a.prototype.getEmptyRecordTemplate=function(){return this.emptyRecordTemplateFn},a.prototype.getDetailTemplate=function(){return this.detailTemplateFn},a.prototype.getEditTemplate=function(){return this.editTemplateFn},a.prototype.getEditHeaderTemplate=function(){return this.editHeaderTemplateFn},a.prototype.getEditFooterTemplate=function(){return this.editFooterTemplateFn},a.prototype.getColumnChooserTemplate=function(){return this.columnChooserTemplateFn},a.prototype.getColumnChooserHeaderTemplate=function(){return this.columnChooserHeaderTemplateFn},a.prototype.getColumnChooserFooterTemplate=function(){return this.columnChooserFooterTemplateFn},a.prototype.getPrimaryKeyFieldNames=function(){for(var e=[],t=0;t<this.columnModel.length;t++)this.columnModel[parseInt(t.toString(),10)].isPrimaryKey&&e.push(this.columnModel[parseInt(t.toString(),10)].field);return e},a.prototype.refresh=function(){this.isDestroyed||(this.isManualRefresh=!0,this.headerModule.refreshUI(),this.updateStackedFilter(),this.renderModule.refresh())},a.prototype.refreshHeader=function(){this.headerModule.refreshUI()},a.prototype.getSelectedRows=function(){return this.selectionModule?this.selectionModule.selectedRecords:[]},a.prototype.getSelectedRowIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowIndexes:[]},a.prototype.getSelectedRowCellIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowCellIndexes:[]},a.prototype.getSelectedRecords=function(){return this.selectionModule?this.selectionModule.getSelectedRecords():[]},a.prototype.getSelectedColumnsUid=function(){var t=this,i=[];return this.selectionModule&&this.selectionModule.selectedColumnsIndexes.filter(function(e){return i.push(t.getColumns()[parseInt(e.toString(),10)].uid)}),i},a.prototype.getDataModule=function(){return this.renderModule.data},a.prototype.showColumns=function(e,t){this.showHider.show(e,t=t||"headerText")},a.prototype.hideColumns=function(e,t){this.showHider.hide(e,t=t||"headerText")},a.prototype.getFrozenColumns=function(){return this.frozenColumns+this.getFrozenCount(this.columns,0,0)},a.prototype.getFrozenRightColumnsCount=function(){return this.frozenRightCount||this.rightcount},a.prototype.getFrozenLeftColumnsCount=function(){return this.frozenLeftCount||this.leftcount},a.prototype.getMovableColumnsCount=function(){return this.movableCount||this.movablecount},a.prototype.updateFrozenColumnsWidth=function(){if(this.isFrozenGrid()&&!this.enableColumnVirtualization)for(var n=this.getColumns(),o=!0,r=0,s=0,a=0,l=n.some(function(e){return("Left"===e.freeze||"Right"===e.freeze||"Fixed"===e.freeze||e.isFrozen)&&"auto"===e.width}),h=this,e=0;e<n.length;e++)!function(e){var t,i,e=n[parseInt(e.toString(),10)];je(e.width)&&("Left"===e.freeze||"Right"===e.freeze||"Fixed"===e.freeze||e.isFrozen)&&(e.width=Math.max(200,e.minWidth?parseFloat(e.minWidth.toString()):0),!je(e.maxWidth))&&parseFloat(e.maxWidth.toString())<e.width&&(e.width=e.maxWidth),"auto"===e.width&&l&&(t=0,o&&(n.filter(function(e){e.visible&&("auto"===e.width&&r++,"auto"!==e.width)&&(e=je(e.width)?Math.max(200,e.minWidth?parseFloat(e.minWidth.toString()):0):parseFloat(e.width.toString()),t+=e)}),i=h.isPercentageWidthGrid()||"auto"===h.width?h.element.getBoundingClientRect().width:parseFloat(h.width.toString()),(s="auto"===h.height?i-t:i-t-aB())<0&&(s=0),a=parseFloat((s/r).toString()),n.filter(function(e){e.visible&&e.minWidth&&parseFloat(e.minWidth.toString())>a&&(s-=parseFloat(e.minWidth.toString()),r--)}),o=!1),e.minWidth&&parseFloat(e.minWidth.toString())>a?e.width=parseFloat(e.minWidth.toString()):e.width=s/r)}(e)},a.prototype.refreshSplitFrozenColumn=function(){this.splitFrozenCount(this.columns),this.updateFrozenColumnsWidth(),this.isAutoGenerateColumns=!0},a.prototype.setFrozenCount=function(){this.frozenLeftCount=this.frozenRightCount=this.movableCount=0,this.visibleFrozenLeft=this.visibleFrozenRight=this.visibleMovable=0,this.frozenLeftColumns=[],this.frozenRightColumns=[],this.movableColumns=[],this.fixedColumns=[],this.splitFrozenCount(this.columns),this.leftcount=this.frozenLeftCount,this.rightcount=this.frozenRightCount,this.movablecount=this.movableCount,this.frozenLeftCount&&!this.frozenRightCount?this.frozenName="Left":this.frozenRightCount&&!this.frozenLeftCount?this.frozenName="Right":this.frozenLeftCount&&this.frozenRightCount?this.frozenName="Left-Right":this.frozenColumns||this.frozenRows?this.frozenName="Left":this.frozenName=void 0},a.prototype.getVisibleFrozenLeftCount=function(){return this.visibleFrozenLeft},a.prototype.getVisibleFrozenRightCount=function(){return this.visibleFrozenRight},a.prototype.getVisibleMovableCount=function(){return this.visibleMovable},a.prototype.getFrozenRightColumns=function(){return this.frozenRightColumns},a.prototype.getFrozenLeftColumns=function(){return this.frozenLeftColumns},a.prototype.getMovableColumns=function(){return this.movableColumns},a.prototype.splitStackedColumns=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].columns?this.splitStackedColumns(e[parseInt(t.toString(),10)].columns):"Left"===e[parseInt(t.toString(),10)].freeze||e[parseInt(t.toString(),10)].isFrozen?(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleFrozenLeft++,this.leftcount++):"Right"===e[parseInt(t.toString(),10)].freeze?(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleFrozenRight++,this.rightcount++):"Fixed"===e[parseInt(t.toString(),10)].freeze?(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleFrozenFixed++,this.fixedcount++):(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleMovable++,this.movablecount++)},a.prototype.pushStackedColumns=function(e,t,i,n,o){i[parseInt(t.toString(),10)]={headerText:n.headerText},n.textAlign&&(i[parseInt(t.toString(),10)].textAlign=n.textAlign),n.customAttributes&&(i[parseInt(t.toString(),10)].customAttributes=n.customAttributes);for(var r,s=0;s<e.length;s++)e[parseInt(s.toString(),10)].columns?(t+=1,this.pushStackedColumns(e[parseInt(s.toString(),10)].columns,t,i,e[parseInt(s.toString(),10)],o),t-=1):(r=[],r=i.slice().slice(0,t+1),("Left"===e[parseInt(s.toString(),10)].freeze||e[parseInt(s.toString(),10)].isFrozen?(this.stackedLeft.push(r),this.stackedarrayLeft):"Right"===e[parseInt(s.toString(),10)].freeze?(this.stackedRight.push(r),this.stackedarrayRight):"Fixed"===e[parseInt(s.toString(),10)].freeze?(this.stackedFixed.push(r),this.stackedarrayFixed):(this.stackedMovable.push(r),this.stackedarrayMovable)).push(e[parseInt(s.toString(),10)]))},a.prototype.pushallcol=function(e,t,i,n,o){var r;if(i.headerText===t.headerText)o?i.columns.push(n):(r={headerText:e.headerText,columns:[]},e.textAlign&&(r.textAlign=e.textAlign),e.customAttributes&&(r.customAttributes=e.customAttributes),i.columns.push(r));else if(i.columns&&i.columns.length)for(var s=0;s<i.columns.length;s++)this.pushallcol(e,t,i.columns[parseInt(s.toString(),10)],n,o)},a.prototype.resetStackedColumns=function(e,t,i){for(var n={},o=[],r=1;r<=e.length;r++)for(var s=e[r-1],a=0;a<s.length;a++)if(n.columns||1!==r?-1===o.indexOf(s[parseInt(a.toString(),10)])&&(this.pushallcol(s[parseInt(a.toString(),10)],s[a-1],n),o.push(s[parseInt(a.toString(),10)])):(n={headerText:s[parseInt(a.toString(),10)].headerText,textAlign:s[parseInt(a.toString(),10)].textAlign,customAttributes:s[parseInt(a.toString(),10)].customAttributes,columns:[]},o.push(s[parseInt(a.toString(),10)])),a===s.length-1){this.pushallcol(null,s[parseInt(a.toString(),10)],n,t[r-1],!0);for(var l=0;l!==e.length-1&&r!==e.length;)s.map(function(e){return e.headerText}).join(", ")===e[parseInt(r.toString(),10)].map(function(e){return e.headerText}).join(", ")&&(r++,this.pushallcol(null,s[parseInt(a.toString(),10)],n,t[r-1],!0)),l++}("Left"===i?this.frozenLeftColumns:"Right"===i?this.frozenRightColumns:this.movableColumns).push(n)},a.prototype.splitFrozenCount=function(e){if(this.frozenColumns||this.changedProperties&&0===this.changedProperties.frozenColumns){var t=!this.enableColumnVirtualization||this.enableColumnVirtualization&&this.isPreparedFrozenColumns?this.enableColumnVirtualization&&this.columnModel&&this.columnModel.length?this.columnModel:this.getColumns():this.columns;if(!this.changedProperties||this.changedProperties&&!this.changedProperties.frozenColumns)for(var i=0;i<t.length;i++)this.frozenColumns>i?t[parseInt(i.toString(),10)].freeze="Left":"Right"===t[parseInt(i.toString(),10)].freeze||"Fixed"===t[parseInt(i.toString(),10)].freeze?t[parseInt(i.toString(),10)].freeze=t[parseInt(i.toString(),10)].freeze:t[parseInt(i.toString(),10)].freeze=void 0}for(i=0;i<(je(e)?0:e.length);i++)e[parseInt(i.toString(),10)].columns?(this.leftcount=0,this.rightcount=0,this.movablecount=0,this.fixedcount=0,this.splitStackedColumns(e[parseInt(i.toString(),10)].columns),!this.leftcount||this.rightcount||this.movablecount||this.fixedcount?!this.rightcount||this.leftcount||this.movablecount||this.fixedcount?!this.movablecount||this.leftcount||this.rightcount||this.fixedcount?!this.fixedcount||this.leftcount||this.rightcount||this.movablecount?(this.frozenLeftCount+=this.leftcount,this.frozenRightCount+=this.rightcount,this.movableCount+=this.movablecount,this.fixedCount+=this.fixedcount,this.leftcount=0,this.rightcount=0,this.movablecount=0,this.fixedcount=0,this.stackedLeft=[],this.stackedRight=[],this.stackedFixed=[],this.stackedMovable=[],this.stackedarrayLeft=[],this.stackedarrayRight=[],this.stackedarrayFixed=[],this.stackedarrayMovable=[],this.pushStackedColumns(e[parseInt(i.toString(),10)].columns,0,[],e[parseInt(i.toString(),10)],{headerText:e[parseInt(i.toString(),10)].headerText,textAlign:e[parseInt(i.toString(),10)].textAlign,customAttributes:e[parseInt(i.toString(),10)].customAttributes,columns:[]}),this.stackedarrayLeft.length&&this.resetStackedColumns(this.stackedLeft,this.stackedarrayLeft,"Left"),this.stackedarrayRight.length&&this.resetStackedColumns(this.stackedRight,this.stackedarrayRight,"Right"),this.stackedarrayFixed.length&&this.resetStackedColumns(this.stackedFixed,this.stackedarrayFixed,"Fixed"),this.stackedarrayMovable.length&&this.resetStackedColumns(this.stackedMovable,this.stackedarrayMovable,"Movable"),this.stackedLeft=[],this.stackedRight=[],this.stackedMovable=[],this.stackedFixed=[],this.stackedarrayLeft=[],this.stackedarrayRight=[],this.stackedarrayMovable=[],this.stackedarrayFixed=[]):(this.fixedCount+=this.fixedcount,this.fixedColumns.push(e[parseInt(i.toString(),10)]),this.movableCount+=this.movablecount,this.movableColumns.push(e[parseInt(i.toString(),10)])):(this.movableCount+=this.movablecount,this.movableColumns.push(e[parseInt(i.toString(),10)])):(this.frozenRightCount+=this.rightcount,this.frozenRightColumns.push(e[parseInt(i.toString(),10)])):(this.frozenLeftCount+=this.leftcount,this.frozenLeftColumns.push(e[parseInt(i.toString(),10)]))):"Right"===e[parseInt(i.toString(),10)].freeze?(!1!==e[parseInt(i.toString(),10)].visible&&this.visibleFrozenRight++,this.frozenRightColumns.push(e[parseInt(i.toString(),10)]),this.frozenRightCount++):"Left"===e[parseInt(i.toString(),10)].freeze||e[parseInt(i.toString(),10)].isFrozen?(!1!==e[parseInt(i.toString(),10)].visible&&this.visibleFrozenLeft++,this.frozenLeftColumns.push(e[parseInt(i.toString(),10)]),this.frozenLeftCount++):("Fixed"===e[parseInt(i.toString(),10)].freeze?(this.fixedColumns.push(e[parseInt(i.toString(),10)]),this.fixedCount++):!1!==e[parseInt(i.toString(),10)].visible&&this.visibleMovable++,this.movableColumns.push(e[parseInt(i.toString(),10)]),this.movableCount++);this.frozenLeftColumns.length&&(t=this.frozenLeftColumns[this.frozenLeftColumns.length-1],this.removeBorder(this.frozenLeftColumns),this.frozenLeftBorderColumns(t instanceof C0?this.lastVisibleLeftCol(this.frozenLeftColumns):t)),this.frozenRightColumns.length&&(t=this.frozenRightColumns[0],this.removeBorder(this.frozenRightColumns),this.frozenRightBorderColumns(t instanceof C0?this.firstVisibleRightCol(this.frozenRightColumns):t)),(this.frozenLeftColumns.length||this.frozenRightColumns.length)&&this.freezeColumnRefresh&&(t=this.frozenLeftColumns.concat(this.movableColumns).concat(this.frozenRightColumns),this.setProperties({columns:t},!0),this.freezeColumnRefresh=!1)},a.prototype.removeBorder=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].columns&&e[parseInt(t.toString(),10)].columns.length?("Right"!==e[parseInt(t.toString(),10)].border&&"Left"!==e[parseInt(t.toString(),10)].border||(e[parseInt(t.toString(),10)].border=void 0),this.removeBorder(e[parseInt(t.toString(),10)].columns)):"Right"!==e[parseInt(t.toString(),10)].border&&"Left"!==e[parseInt(t.toString(),10)].border||(e[parseInt(t.toString(),10)].border=void 0)},a.prototype.isVisibleColumns=function(e,t){if(e.columns&&e.columns.length)for(var i=0;i<e.columns.length;i++)this.isVisibleColumns(e.columns[parseInt(i.toString(),10)],t),e.columns[parseInt(i.toString(),10)].visible&&je(e.columns[parseInt(i.toString(),10)].columns)&&(!je(e.columns[parseInt(i.toString(),10)].freeze)||e.columns[parseInt(i.toString(),10)].isFrozen)&&t.push("true");else!e.visible||je(e.freeze)&&!e.isFrozen||t.push("true")},a.prototype.lastVisibleLeftCol=function(e){for(var t,i=e.length-1;0<=i;i--){var n=[];if(this.isVisibleColumns(e[parseInt(i.toString(),10)],n),e[parseInt(i.toString(),10)].visible&&-1!==n.indexOf("true")){t=e[parseInt(i.toString(),10)];break}}return t},a.prototype.firstVisibleRightCol=function(e){for(var t,i=0;i<e.length;i++){var n=[];if(this.isVisibleColumns(e[parseInt(i.toString(),10)],n),e[parseInt(i.toString(),10)].visible&&-1!==n.indexOf("true")){t=e[parseInt(i.toString(),10)];break}}return t},a.prototype.frozenLeftBorderColumns=function(e){var t;je(e)||(e.columns&&e.columns.length?(e.border="Left",t=e.columns[e.columns.length-1],this.frozenLeftBorderColumns(t instanceof C0&&t.columns?this.lastVisibleLeftCol(e.columns):t)):e.border="Left")},a.prototype.frozenRightBorderColumns=function(e){var t;je(e)||(e.columns&&e.columns.length?(e.border="Right",t=e.columns[0],this.frozenRightBorderColumns(t instanceof C0&&t.columns?this.firstVisibleRightCol(e.columns):t)):e.border="Right")},a.prototype.getVisibleFrozenColumns=function(){return this.getVisibleFrozenColumnsCount()+this.getVisibleFrozenCount(this.columns,0)},a.prototype.getFilterUIInfo=function(){return this.filterModule?this.filterModule.getFilterUIInfo():{}},a.prototype.getVisibleFrozenColumnsCount=function(){for(var e=0,t=this.columnModel,i=0;i<this.frozenColumns;i++)t[parseInt(i.toString(),10)].visible&&e++;if(this.frozenLeftCount||this.leftcount||this.frozenRightCount||this.rightcount)for(i=0;i<t.length;i++)!t[parseInt(i.toString(),10)].visible||"Left"!==t[parseInt(i.toString(),10)].freeze&&"Right"!==t[parseInt(i.toString(),10)].freeze||e++;return e},a.prototype.getVisibleFrozenCount=function(e,t){if(!(this.frozenLeftCount||this.leftcount||this.frozenRightCount&&this.rightcount))for(var i=0,n=e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?t=this.getVisibleFrozenCount(e[parseInt(i.toString(),10)].columns,t):e[parseInt(i.toString(),10)].isFrozen&&e[parseInt(i.toString(),10)].visible&&t++;return t},a.prototype.getFrozenCount=function(e,t,i){for(var n=0,o=je(e)?0:e.length;n<o;n++)e[parseInt(n.toString(),10)].columns?t=this.getFrozenCount(e[parseInt(n.toString(),10)].columns,t,i):(e[parseInt(n.toString(),10)].isFrozen&&i>this.frozenColumns-1&&t++,i++);return t},a.prototype.goToPage=function(e){this.pagerModule&&this.pagerModule.goToPage(e)},a.prototype.updateExternalMessage=function(e){this.pagerModule&&!this.pagerTemplate&&this.pagerModule.updateExternalMessage(e)},a.prototype.sortColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},a.prototype.changeDataSource=function(e,t){this.isChangeDataSourceCall=!0,this.setProperties({sortSettings:{columns:[]}},!0),this.setProperties({filterSettings:{columns:[]}},!0),this.setProperties({searchSettings:{key:""}},!0),this.allowGrouping&&this.setProperties({groupSettings:{columns:[]}},!0),t&&t.length&&this.setProperties({columns:t},!0),e&&(je(t)&&this.setProperties({columns:[]},!0),this.setProperties({dataSource:e},!0)),this.freezeRefresh(),this.isChangeDataSourceCall=!1},a.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},a.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},a.prototype.clearGridActions=function(){this.setProperties({sortSettings:{columns:[]}},!0),this.setProperties({filterSettings:{columns:[]}},!0),this.setProperties({searchSettings:{key:""}},!0),this.allowGrouping?this.setProperties({groupSettings:{columns:[]}},!1):this.freezeRefresh()},a.prototype.filterByColumn=function(e,t,i,n,o,r,s,a){this.filterModule&&this.filterModule.filterByColumn(e,t,i,n,o,r,s,a)},a.prototype.clearFiltering=function(e){this.filterModule&&this.filterModule.clearFiltering(e)},a.prototype.removeFilteredColsByField=function(e,t){this.filterModule&&this.filterModule.removeFilteredColsByField(e,t)},a.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},a.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},a.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},a.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},a.prototype.selectCellsByRange=function(e,t){this.selectionModule.selectCellsByRange(e,t)},a.prototype.search=function(e){this.searchModule&&this.searchModule.search(e)},a.prototype.print=function(){this.printModule&&this.printModule.print()},a.prototype.deleteRecord=function(e,t){this.editModule&&this.editModule.deleteRecord(e,t)},a.prototype.startEdit=function(){this.editModule&&this.editModule.startEdit()},a.prototype.endEdit=function(){this.editModule&&this.editModule.endEdit()},a.prototype.closeEdit=function(){this.editModule&&this.editModule.closeEdit()},a.prototype.addRecord=function(e,t){this.editModule&&this.editModule.addRecord(e,t)},a.prototype.deleteRow=function(e){this.editModule&&this.editModule.deleteRow(e)},a.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},a.prototype.saveCell=function(){this.editModule&&this.editModule.saveCell()},a.prototype.updateCell=function(e,t,i){this.editModule&&this.editModule.updateCell(e,t,i)},a.prototype.updateRow=function(e,t){this.editModule&&this.editModule.updateRow(e,t)},a.prototype.getBatchChanges=function(){return this.editModule?this.editModule.getBatchChanges():{}},a.prototype.enableToolbarItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},a.prototype.copy=function(e){this.clipboardModule&&this.clipboardModule.copy(e)},a.prototype.recalcIndentWidth=function(){var n=this;if(this.getHeaderTable().querySelector(".e-emptycell")&&(this.groupSettings.columns.length||this.isDetail()||this.isRowDragable())&&!this.getHeaderTable().querySelector(".e-emptycell.e-indentRefreshed")&&this.getContentTable()){var e=this.getHeaderTable().querySelector(".e-emptycell").parentElement.offsetWidth,o=[].slice.call(this.getHeaderTable().querySelector(rD).childNodes),r=[].slice.call(this.getContentTable().querySelector(rD).childNodes),t=e/30,i="Right"===this.getFrozenMode()?this.groupSettings.columns.length+this.getColumns().length:0,s=this.element.offsetWidth,a=function(e,t){var i;$B(n)?(i=(t/s*100).toFixed(1)+"%",o[parseInt(e.toString(),10)].style.width=i,r[parseInt(e.toString(),10)].style.width=i):(o[parseInt(e.toString(),10)].style.width=t+"px",r[parseInt(e.toString(),10)].style.width=t+"px"),n.notify(xx,{index:e,width:t})};for((e=1<=t?30/t:e)<1&&(e=1),(this.enableColumnVirtualization||this.isAutoGen||this.columns.length===this.groupSettings.columns.length)&&(e=30);i<this.groupSettings.columns.length;)a(i,e),i++;this.isDetail()&&(a(i,e),i++),this.isRowDragable()&&a(i,e),this.isAutoGen=!1,this.getHeaderTable().querySelector(".e-emptycell").classList.add("e-indentRefreshed")}},a.prototype.resetIndentWidth=function(){var e;this.isDestroyed||($B(this)&&(this.getHeaderTable().querySelector(".e-emptycell").classList.remove("e-indentRefreshed"),this.widthService.setWidthToColumns(),this.recalcIndentWidth(),this.autoFit)&&this.preventAdjustColumns(),("auto"===this.width||"string"==typeof this.width&&-1!==this.width.indexOf("%"))&&0<this.getColumns().filter(function(e){return(!e.width||"auto"===e.width)&&e.minWidth}).length&&(e=this.widthService.getTableWidth(this.getColumns(),!0),this.widthService.setMinwidthBycalculation(e)),this.isFrozenGrid()&&this.enableColumnVirtualization&&this.widthService&&this.widthService.refreshFrozenScrollbar(),this.allowTextWrap&&"Content"!==this.textWrapSettings.wrapMode&&this.notify(xT,{}),this.frozenRows&&this.scrollModule&&this.scrollModule.resizeFrozenRowBorder(),this.enableStickyHeader&&this.scrollModule.makeStickyHeader(),this.enableAutoFill&&"Multiple"===this.selectionSettings.type&&"Cell"===this.selectionSettings.mode&&this.selectionModule.selectedRowCellIndexes.length&&(this.selectionModule.updateAutoFillPosition(),this.selectionModule.drawBorders()))},a.prototype.isRowDragable=function(){return this.allowRowDragAndDrop&&!this.rowDropSettings.targetID},a.prototype.reorderColumns=function(e,t){this.reorderModule&&this.reorderModule.reorderColumns(e,t)},a.prototype.reorderColumnByIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByIndex(e,t)},a.prototype.reorderColumnByTargetIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByTargetIndex(e,t)},a.prototype.reorderRows=function(e,t){this.rowDragAndDropModule&&this.rowDragAndDropModule.reorderRows(e,t)},a.prototype.refreshDataSource=function(e){this.notify("refreshdataSource",e)},a.prototype.disableRowDD=function(e){var t=this.getHeaderTable(),i=this.getContentTable(),n=t.querySelectorAll("th.e-rowdragheader, th.e-mastercell"),o=this.getRows(),r=e?"none":"";gt(t.querySelector(rD).childNodes[0],{display:r}),gt(i.querySelector(rD).childNodes[0],{display:r});for(var s=0;s<this.getRows().length;s++){var a=o[parseInt(s.toString(),10)].firstElementChild;e?U([a],"e-hide"):q([a],["e-hide"])}for(var l=0;l<t.querySelectorAll("th.e-rowdragheader, th.e-mastercell").length;l++){a=n[parseInt(l.toString(),10)];e?U([a],"e-hide"):q([a],["e-hide"])}},a.prototype.autoFitColumns=function(e,t,i){var n=this.getInjectedModules().find(function(e){return"function"!=typeof e||je(e.prototype)?"Resize"===e.name:"resize"===e.prototype.getModuleName()});!this.resizeModule&&n&&(this.autoFitColumnsResize=!0,this.injectModules()),this.resizeModule&&this.resizeModule.autoFitColumns(e,t,i)},a.prototype.preventAdjustColumns=function(){if(!(this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode||this.allowResizing&&"Auto"===this.resizeSettings.mode)){for(var e=this.getColumns(),t=this.getHeaderTable(),i=0,n=0;n<e.length;n++)if(e[parseInt(n.toString(),10)].visible){if(this.groupSettings.columns.length&&-1<this.groupSettings.columns.indexOf(e[parseInt(n.toString(),10)].field))if("none"===[].slice.call(t.querySelector("colgroup").querySelectorAll(":not(.e-group-intent):not(.e-detail-intent):not(.e-drag-intent)"))[parseInt(n.toString(),10)].style.display)continue;if(!e[parseInt(n.toString(),10)].width){i=0;break}i+=parseFloat(e[parseInt(n.toString(),10)].width.toString())}if(i){var o=this.isPercentageWidthGrid(),r=this.widthUnit(o),s=this.getContentTable();if(this.groupSettings.columns.length||this.isDetail()||this.isRowDragable())for(var a=this.defaultIndentWidth(o),l=a.toString()+r,h=[].slice.call(t.querySelector("colgroup").querySelectorAll(".e-group-intent, .e-detail-intent, .e-drag-intent")),d=[].slice.call(s.querySelector("colgroup").querySelectorAll(".e-group-intent, .e-detail-intent, .e-drag-intent")),n=0;n<h.length;n++)h[parseInt(n.toString(),10)].style.setProperty("width",l),d[parseInt(n.toString(),10)].style.setProperty("width",l),i+=a;(o&&i<100||!o&&i<s.parentElement.clientWidth)&&(je(s.querySelector(".e-emptyrow"))?U([t,s],["e-tableborder"]):(U([t],["e-tableborder"]),q([s],["e-tableborder"])));o=i.toString()+r;t.style.setProperty("width",o),s.style.setProperty("width",o)}else this.restoreAdjustColumns()}},a.prototype.restoreAdjustColumns=function(){var e,t,i;this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode||this.allowResizing&&"Auto"===this.resizeSettings.mode||(q([e=this.getHeaderTable(),t=this.getContentTable()],["e-tableborder"]),e.style.removeProperty("width"),t.style.removeProperty("width"),(this.groupSettings.columns.length||this.isDetail()||this.isRowDragable())&&(t=this.isPercentageWidthGrid(),i=this.defaultIndentWidth(t).toString()+this.widthUnit(t),[].slice.call(e.querySelector("colgroup").querySelectorAll(".e-group-intent, .e-detail-intent, .e-drag-intent")).forEach(function(e){e.style.setProperty("width",i)}),e.querySelector(".e-emptycell").classList.remove("e-indentRefreshed"),this.recalcIndentWidth()))},a.prototype.widthUnit=function(e){return e?"%":"px"},a.prototype.defaultIndentWidth=function(e){return e?parseFloat((30/this.element.offsetWidth*100).toFixed(1)):30},a.prototype.isPercentageWidthGrid=function(){var e=this.getColumns().find(function(e){return!je(e.width)});return!!e&&-1<e.width.toString().indexOf("%")},a.prototype.createColumnchooser=function(e,t,i){this.columnChooserModule&&this.columnChooserModule.renderColumnChooser(e,t,i)},a.prototype.initializeServices=function(){this.serviceLocator.register("widthService",this.widthService=new WM(this)),this.serviceLocator.register("cellRendererFactory",new RM),this.serviceLocator.register("rendererFactory",new zM),this.serviceLocator.register("localization",this.localeObj=new Cn(this.getModuleName(),this.defaultLocale,this.locale)),this.serviceLocator.register("valueFormatter",this.valueFormatterService=new v0(this.locale)),this.serviceLocator.register("showHideService",this.showHider=new uk(this)),this.serviceLocator.register("ariaService",this.ariaService=new HD),this.serviceLocator.register("focus",this.focusModule=new qM(this))},a.prototype.processModel=function(){var n,o,e,r=this.groupSettings.columns,s=this.sortSettings.columns;if(this.allowGrouping)for(var a=this,t=0,i=r.length;t<i;t++)!function(t){n=!1,o=0;for(var e,i=s.length;o<i;o++)if(s[parseInt(o.toString(),10)].field===r[parseInt(t.toString(),10)]){n=!0;break}n?a.allowSorting?a.sortedColumns.push(s[parseInt(o.toString(),10)].field):s[parseInt(o.toString(),10)].direction="Ascending":s.push({field:r[parseInt(t.toString(),10)],direction:"Ascending",isFromGroup:!0}),a.groupSettings.showGroupedColumn||((e=a.enableColumnVirtualization?a.columns.filter(function(e){return e.field===r[parseInt(t.toString(),10)]})[0]:a.getColumnByField(r[parseInt(t.toString(),10)]))?e.visible=!1:a.log("initial_action",{moduleName:"group",columnName:r[parseInt(t.toString(),10)]}))}(t);if(!r.length)for(t=0;t<s.length;t++)this.sortedColumns.push(s[parseInt(t.toString(),10)].field);this.rowTemplateFn=HP(this.rowTemplate),this.emptyRecordTemplateFn=HP(this.emptyRecordTemplate),this.detailTemplateFn=HP(this.detailTemplate),this.editTemplateFn=HP(this.editSettings.template),this.editHeaderTemplateFn=HP(this.editSettings.headerTemplate),this.editFooterTemplateFn=HP(this.editSettings.footerTemplate),this.columnChooserTemplateFn=HP(this.columnChooserSettings.template),this.columnChooserHeaderTemplateFn=HP(this.columnChooserSettings.headerTemplate),this.columnChooserFooterTemplateFn=HP(this.columnChooserSettings.footerTemplate),je(this.parentDetails)||(e=je(this.parentDetails.parentKeyFieldValue)?"undefined":this.parentDetails.parentKeyFieldValue,this.query.where(this.queryString,"equal",e,!0)),this.initForeignColumn()},a.prototype.initForeignColumn=function(){this.isForeignKeyEnabled(this.getColumns())&&this.notify(pI,this.getForeignKeyColumns())},a.prototype.enableVerticalRendering=function(){"Vertical"===this.rowRenderingMode?this.element.classList.add("e-row-responsive"):this.element.classList.remove("e-row-responsive")},a.prototype.gridRender=function(){this.updateRTL(),"Vertical"===this.rowRenderingMode&&this.element.classList.add("e-row-responsive"),this.enableHover&&this.element.classList.add("e-gridhover"),(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||F.isSafari())&&this.element.classList.add("e-mac-safari"),F.isDevice&&(this.element.classList.add("e-device"),"Desktop"===this.adaptiveUIMode)&&(this.enableAdaptiveUI=!1),"Mobile"!==this.adaptiveUIMode||F.isDevice||"Vertical"===this.rowRenderingMode||(this.enableAdaptiveUI=!1),this.rowHeight&&this.element.classList.add("e-grid-min-height"),this.cssClass&&(-1!==this.cssClass.indexOf(" ")?(e=this.element.classList).add.apply(e,this.cssClass.split(" ")):this.element.classList.add(this.cssClass)),this.allowRowDragAndDrop&&this.rowDropSettings.targetID&&"mozilla"===F.info.name&&this.element.classList.add("e-disableuserselect"),this.editSettings.showAddNewRow&&(this.enableVirtualization||this.enableInfiniteScrolling)&&(this.editSettings.newRowPosition="Top"),mt(this.element,["e-responsive","e-default"],[]);var e=this.serviceLocator.getService("rendererFactory");this.headerModule=e.getRenderer(RA.Header),this.contentModule=e.getRenderer(RA.Content),this.printModule=new EP(this,this.scrollModule),this.clipboardModule=new Ik(this,this.serviceLocator),this.renderModule.render(),this.eventInitializer(),this.createGridPopUpElement(),this.widthService.setWidthToColumns(),this.updateGridLines(),this.applyTextWrap(),this.createTooltip(),this.enableBoxSelection()},a.prototype.dataReady=function(){this.scrollModule.setWidth(),this.scrollModule.setHeight(),"auto"!==this.height&&this.scrollModule.setPadding()},a.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},a.prototype.createGridPopUpElement=function(){var e=this.createElement("div",{className:"e-gridpopup"}),t=(e.style.display="none",this.createElement("div",{className:WE,attrs:{tabIndex:"-1"}}));ht([t,this.createElement("div",{className:"e-uptail e-tail"})],e),t.appendChild(this.createElement("span")),ht([t,this.createElement("div",{className:"e-downtail e-tail"})],e),this.element.appendChild(e)},a.prototype.updateGridLines=function(){switch(mt(this.element,[],["e-verticallines","e-horizontallines","e-hidelines","e-bothlines"]),this.gridLines){case"Horizontal":this.element.classList.add("e-horizontallines");break;case"Vertical":this.element.classList.add("e-verticallines");break;case"None":this.element.classList.add("e-hidelines");break;case"Both":this.element.classList.add("e-bothlines")}this.updateResizeLines()},a.prototype.updateResizeLines=function(){this.allowResizing&&"Vertical"!==this.gridLines&&"Both"!==this.gridLines?this.element.classList.add("e-resize-lines"):this.element.classList.remove("e-resize-lines")},a.prototype.applyTextWrap=function(){if(this.allowTextWrap){var e=[].slice.call(this.element.getElementsByClassName("e-columnheader"));switch(this.textWrapSettings.wrapMode){case"Header":fB(this.element,!1),fB(this.getContent(),!1),fB(e,!0);break;case"Content":fB(this.getContent(),!0),fB(this.element,!1),fB(e,!1);break;default:fB(this.element,!0),fB(this.getContent(),!1),fB(e,!1)}"Content"!==this.textWrapSettings.wrapMode&&this.notify(xT,{})}},a.prototype.removeTextWrap=function(){fB(this.element,!1),fB([].slice.call(this.element.getElementsByClassName("e-columnheader")),!1),fB(this.getContent(),!1),"Content"!==this.textWrapSettings.wrapMode&&this.notify(xT,{})},a.prototype.createTooltip=function(){this.toolTipObj=new NS({opensOn:"custom",content:"",cssClass:this.cssClass||null},this.element)},a.prototype.freezeRefresh=function(){(this.enableVirtualization||this.enableInfiniteScrolling)&&(this.pageSettings.currentPage=1),this.componentRefresh()},a.prototype.getTooltipStatus=function(e){var t=this.getHeaderTable(),i=this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode?"e-gridcontent":"e-gridheader",n=this.createTable(t,i,"header"),t=this.createTable(t,i,"content"),i=e.classList.contains("e-headercell")?n:t,o=e.classList.contains("e-headercell")?"th":"tr",r=(i.querySelector(o).className=e.className,i.querySelector(o)),i=(r.innerHTML="",Array.from(e.childNodes).forEach(function(e){r.appendChild(e.cloneNode(!0))}),i.querySelector(o).getBoundingClientRect().width);return document.body.removeChild(n),document.body.removeChild(t),!!(i>e.getBoundingClientRect().width&&!e.classList.contains("e-editedbatchcell")||this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode&&i>.55*e.getBoundingClientRect().width-("auto"!==this.height?16:0))},a.prototype.mouseMoveHandler=function(e){var t,i,n,o;this.isEllipsisTooltip()&&(t=A(e.target,"e-ellipsistooltip"),"mouseout"!==e.type||this.prevElement===t&&t===A(e.relatedTarget,"e-ellipsistooltip")||(this.toolTipObj.close(),this.prevElement=null),i=e.target.tagName,!t||"mouseout"===e.type||F.isDevice&&-1!==["A","BUTTON","INPUT"].indexOf(i)||this.getTooltipStatus(t)&&(i=(e=this.getColumns()[parseInt(t.getAttribute(iD),10)-1])&&e.disableHtmlEncode?"innerText":"innerHTML",n=this.createElement("div"),t.getElementsByClassName("e-headertext").length?(o=t.getElementsByClassName("e-headertext")[0],n[i]=this.sanitize(o.innerText)):n[i]=this.sanitize(t.innerText),this.toolTipObj.content=n,this.enableHtmlSanitizer&&(this.toolTipObj.enableHtmlSanitizer=!0),e&&e.disableHtmlEncode&&(this.toolTipObj.enableHtmlParse=!1),t!==this.prevElement&&this.toolTipObj.open(t),this.prevElement=t))},a.prototype.isEllipsisTooltip=function(){var e=this.getColumns();if("EllipsisWithTooltip"===this.clipMode)return!0;for(var t=0;t<e.length;t++)if("EllipsisWithTooltip"===e[parseInt(t.toString(),10)].clipMode)return!0;return!1},a.prototype.scrollHandler=function(){this.isEllipsisTooltip()&&this.toolTipObj.close()},a.prototype.createTable=function(e,t,i){var n=this.createElement("div"),o=(n.className=this.element.className,n.style.cssText="display: inline-block;visibility:hidden;position:absolute",this.createElement("div")),t=(o.className=t,this.createElement("table")),e=(t.className=e.className,t.style.cssText="table-layout: auto;width: auto","header"===i?"th":"td"),i=this.createElement("tr",{attrs:{role:"row"}}),e=this.createElement(e);return i.appendChild(e),t.appendChild(i),o.appendChild(t),n.appendChild(o),document.body.appendChild(n),n},a.prototype.onKeyPressed=function(e){"tab"!==e.action&&"shiftTab"!==e.action||this.toolTipObj.close()},a.prototype.wireEvents=function(){E.add(this.element,"click",this.mouseClickHandler,this),E.add(this.element,"touchend",this.mouseClickHandler,this),E.add(this.element,"focusout",this.focusOutHandler,this),E.add(this.element,"dblclick",this.dblClickHandler,this),E.add(this.element,"keydown",this.keyPressHandler,this),E.add(window,"resize",this.resetIndentWidth,this),this.allowKeyboard&&(this.element.tabIndex=-1===this.element.tabIndex?0:this.element.tabIndex),this.keyboardModule=new bn(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),E.add(this.getContent().firstElementChild,"scroll",this.scrollHandler,this),E.add(this.element,"mouseover",this.mouseMoveHandler,this),E.add(this.element,"mouseout",this.mouseMoveHandler,this),E.add(this.getContent(),"touchstart",this.tapEvent,this),E.add(document.body,"keydown",this.keyDownHandler,this)},a.prototype.unwireEvents=function(){E.remove(this.element,"click",this.mouseClickHandler),E.remove(this.element,"touchend",this.mouseClickHandler),E.remove(this.element,"focusout",this.focusOutHandler),E.remove(this.element,"dblclick",this.dblClickHandler),E.remove(this.getContent().firstElementChild,"scroll",this.scrollHandler),E.remove(this.element,"mouseover",this.mouseMoveHandler),E.remove(this.element,"mouseout",this.mouseMoveHandler),E.remove(this.element,"keydown",this.keyPressHandler),E.remove(this.getContent(),"touchstart",this.tapEvent),E.remove(document.body,"keydown",this.keyDownHandler),E.remove(window,"resize",this.resetIndentWidth)},a.prototype.addListener=function(){this.isDestroyed||(this.on(Y1,this.dataReady,this),this.on(X1,this.recalcIndentWidth,this),this.on(tx,this.recalcIndentWidth,this),this.on(mE,this.refreshFrozenPosition,this),this.on(yE,this.refreshSplitFrozenColumn,this),this.dataBoundFunction=this.refreshMediaCol.bind(this),this.addEventListener(qA,this.dataBoundFunction),this.on(bx,this.onKeyPressed,this))},a.prototype.removeListener=function(){this.isDestroyed||(this.off(Y1,this.dataReady),this.off(X1,this.recalcIndentWidth),this.off(tx,this.recalcIndentWidth),this.on(mE,this.refreshFrozenPosition,this),this.on(yE,this.refreshSplitFrozenColumn,this),this.removeEventListener(qA,this.dataBoundFunction),this.off(bx,this.onKeyPressed))},a.prototype.getCurrentViewRecords=function(){return BB(this)?je(this.currentViewData.records)?this.currentViewData:this.currentViewData.records:!this.groupSettings.enableLazyLoading&&this.allowGrouping&&this.groupSettings.columns.length&&this.currentViewData.length&&this.currentViewData.records?this.currentViewData.records:this.currentViewData},a.prototype.mouseClickHandler=function(e){var t,i,n;this.isChildGrid(e)||A(e.target,"e-gridpopup")&&e.touches||this.element.getElementsByClassName("e-cloneproperties").length||this.checkEdit(e)||(!this.allowRowDragAndDrop&&(A(e.target,OE)||"TD"===e.target.tagName)||A(e.target,"e-headercell")&&A(e.target,"e-headercell").querySelector(".e-checkselectall")||!this.allowGrouping&&!this.allowReordering&&A(e.target,"e-gridheader"))&&e.touches||(A(e.target,"e-gridheader")&&this.allowRowDragAndDrop&&!A(e.target,"e-filterbarcell")&&e.target&&-1===["A","BUTTON","INPUT"].indexOf(e.target.tagName)&&e.preventDefault(),n=(t=this.getRowInfo(e.target)).cancel=!1,(n=(i=z(e.target,"tr"))&&i.getAttribute("data-uid")?!!(i=this.getRowObjectFromUID(i.getAttribute("data-uid")))&&i.isDataRow:n)&&this.trigger(E1,t),this.notify(wx,e))},a.prototype.checkEdit=function(e){var t=A(e.target,UE),t="Batch"!==this.editSettings.mode&&this.isEdit&&t&&(t.classList.contains(GE)||t.classList.contains(YE)&&!this.editSettings.showAddNewRow);return!A(e.target,"e-unboundcelldiv")&&(t||A(e.target,LE)&&A(e.target,LE).classList.contains("e-editedbatchcell"))},a.prototype.dblClickHandler=function(e){var t,i=A(e.target,"e-grid");je(i)||i.id!==this.element.id||z(e.target,".e-unboundcelldiv")||(i=!1,(t=z(e.target,"tr"))&&t.getAttribute("data-uid")&&(i=!!(t=this.getRowObjectFromUID(t.getAttribute("data-uid")))&&t.isDataRow),(t=this.getRowInfo(e.target)).target=e.target,i&&this.trigger(T1,t),this.notify(Fx,e))},a.prototype.focusOutHandler=function(e){var t,i;this.isChildGrid(e)||(A(e.target,"e-grid")||(this.element.querySelector(".e-gridpopup").style.display="None"),(t=this.element.querySelector(".e-cancel:not(.e-hide)"))&&!t.parentElement.classList.contains("e-tbar-btn")&&t.classList.add("e-hide"),i=(t=e.relatedTarget)?t.getAttribute("aria-owns"):null,t&&(A(t,"e-grid")||(!je(i)&&i)===e.target.getAttribute("aria-owns"))||this.keyPress||!this.isEdit||F.isDevice||("Batch"!==this.editSettings.mode||(A(t,"e-ddl")||A(t,"e-ddt"))&&(A(t,"e-multi-select-list-wrapper")||A(t,"e-input-filter"))&&A(t,"e-input-group")||!A(t,"e-uploader")&&(t&&je(A(t,"e-input-group"))||A(e.target,"edit-custom-template"))||(this.editModule.saveCell(),this.notify(xI,{})),"Normal"!==this.editSettings.mode)||this.isWidgetsDestroyed||this.editModule.editFormValidate(),this.editSettings.showAddNewRow&&(this.editModule.isShowAddedRowValidate=!1),this.keyPress=!1)},a.prototype.isChildGrid=function(e){var t=A(e.target,"e-grid");return!!(t&&t.id!==this.element.id||A(e.target,"e-unboundcelldiv")&&je(t))},a.prototype.mergePersistGridData=function(e){var t=this.getLocalData();if(!je(t)&&""!==t||!je(e)){var i=je(e)?JSON.parse(t):e,t=Object.keys(i);this.isProtectedOnChange=!0;for(var n=0,o=t;n<o.length;n++){var r=o[n];"object"!=typeof this[""+r]||je(this[""+r])?this[""+r]=i[""+r]:Array.isArray(this[""+r])&&"columns"===r?(this.setFrozenCount(),WP(this[""+r]),this.mergeColumns(i[""+r],this[""+r]),this.mergedColumns=!0,this[""+r]=i[""+r]):Pe(this[""+r],i[""+r])}this.isProtectedOnChange=!1}},a.prototype.mergeColumns=function(e,i){for(var n=e,o=this.isFrozenGrid(),r=this,t=0;t<n.length;t++)!function(t){var e=i.filter(function(e){return o?e.index===n[parseInt(t.toString(),10)][fD]:e.index===n[parseInt(t.toString(),10)].index})[0];je(e)||(o&&((e=Pe({},e,{},!0)).freeze=n[parseInt(t.toString(),10)].freeze),e.columns&&e.columns.length&&r.mergeColumns(n[parseInt(t.toString(),10)].columns,e.columns),n[parseInt(t.toString(),10)]=Pe(e,n[parseInt(t.toString(),10)],{},!0))}(t)},a.prototype.isDetail=function(){return!je(this.detailTemplate)||!je(this.childGrid)},a.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},a.prototype.isForeignKeyEnabled=function(e){var t=this;return e.some(function(e){return e.columns?t.isForeignKeyEnabled(e.columns):!(!e.dataSource||!e.foreignKeyValue)})},a.prototype.keyPressHandler=function(e){var t=Pe(e,{cancel:!1});this.trigger("keyPressed",t),(!0===t.cancel||this.isEdit&&e&&A(e.target,"e-gridform")&&A(e.target,"e-ddl")&&"open"===e.action&&!0===e.altKey&&"ArrowDown"===e.code)&&e.stopImmediatePropagation()},a.prototype.keyDownHandler=function(e){if(e.altKey){if(74===e.keyCode&&(this.keyA?(this.notify(ST,{target:e.target,collapse:!1}),this.keyA=!1):(this.focusModule&&this.focusModule.currentInfo&&this.focusModule.currentInfo.element&&(q([this.focusModule.currentInfo.element,this.focusModule.currentInfo.elementToFocus],["e-focused","e-focus"]),this.focusModule.currentInfo.element.tabIndex=-1),this.element.classList.contains("e-childgrid")||this.element.focus())),87===e.keyCode){var t=this.focusModule;if(t){if(!this.currentViewData.length)return;t.focusContent(),t.addOutline()}}65===e.keyCode&&(this.keyA=!0),72===e.keyCode&&this.keyA&&(this.notify(ST,{target:e.target,collapse:!0}),this.keyA=!1)}13===e.keyCode&&this.notify(qT,e)},a.prototype.keyActionHandler=function(e){this.isChildGrid(e)||this.editModule&&(this.editModule.alertDObj&&this.editModule.alertDObj.visible||this.editModule.dialogObj&&this.editModule.dialogObj.visible)||this.isEdit&&(!this.editSettings.showAddNewRow||this.editSettings.showAddNewRow&&this.element.querySelector(GE))&&"escape"!==e.action&&"enter"!==e.action&&"shiftEnter"!==e.action&&"tab"!==e.action&&"shiftTab"!==e.action||(this.keyPress=!0,this.allowKeyboard&&("ctrlPlusP"===e.action&&(e.preventDefault(),this.print()),this.notify(bx,e)))},a.prototype.setInjectedModules=function(e){this.injectedModules=e},a.prototype.updateColumnObject=function(){QP(this.columns,this.enableColumnVirtualization,this),WP(this.columns),this.initForeignColumn(),this.notify(Ox,{})},a.prototype.refreshFrozenPosition=function(e){e&&e.isModeChg?(this.refreshColumns(),this.notify(fE,{})):this.refreshColumns()},a.prototype.getForeignKeyColumns=function(){return this.getColumns().filter(function(e){return e.isForeignColumn()})},a.prototype.getRowHeight=function(e){return this.rowHeight||lB(this.element,e)},a.prototype.refreshColumns=function(){var e;this.freezeColumnRefresh=!0,this.setFrozenCount(),this.updateFrozenColumnsWidth(),this.isFrozenGrid()&&(this.isPreventScrollEvent=!0),this.updateColumnObject(),this.checkLockColumns(this.getColumns()),this.refresh(),this.isFrozenGrid()&&this.enableColumnVirtualization&&(e=this.getContent().querySelector(".e-movablescrollbar").scrollLeft,this.getHeaderContent().querySelector("."+VE).scrollLeft=e,this.getContent().querySelector("."+WE).scrollLeft=e)},a.prototype.excelExport=function(e,t,i,n){var o;return this.exportGrids&&this.exportGrids.length?(o=this.exportGrids.slice(),this.exportMultipleExcelGrids(o,e,t,i,n)):this.excelExportModule?this.excelExportModule.Map(this,e,t,i,!1,n):null},a.prototype.csvExport=function(e,t,i,n){return this.excelExportModule?this.excelExportModule.Map(this,e,t,i,!0,n):null},a.prototype.pdfExport=function(e,t,i,n){var o;return this.exportGrids&&this.exportGrids.length?(o=this.exportGrids.slice(),this.exportMultiplePdfGrids(o,e,t,i,n)):this.pdfExportModule?this.pdfExportModule.Map(this,e,t,i,n):null},a.prototype.exportMultiplePdfGrids=function(t,i,n,e,o){var r,s=this;return 0!==t.length?(r=t.shift(),((r=document.getElementById(r).ej2_instances[0]).pdfExportModule?r.pdfExportModule.Map(r,i,n,e,o):Promise.resolve()).then(function(e){return n=1!==t.length,s.exportMultiplePdfGrids(t,i,n,e,o)})):null},a.prototype.exportMultipleExcelGrids=function(t,i,n,e,o){var r,s=this;return 0!==t.length?(r=t.shift(),((r=document.getElementById(r).ej2_instances[0]).excelExportModule?r.excelExportModule.Map(r,i,n,e,!1,o):null).then(function(e){return n=1!==t.length,s.exportMultipleExcelGrids(t,i,n,e,o)})):null},a.prototype.groupColumn=function(e){this.groupModule&&this.groupModule.groupColumn(e)},a.prototype.groupExpandAll=function(){this.groupModule&&this.groupModule.expandAll()},a.prototype.groupCollapseAll=function(){this.groupModule&&this.groupModule.collapseAll()},a.prototype.clearGrouping=function(){this.groupModule&&this.groupModule.clearGrouping()},a.prototype.ungroupColumn=function(e){this.groupModule&&this.groupModule.ungroupColumn(e)},a.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},a.prototype.scrollRefresh=function(){function e(){t.scrollModule.refresh(),t.off(X1,e)}var t=this;this.on(X1,e,this)},a.prototype.detailCollapseAll=function(){this.detailRowModule&&this.detailRowModule.collapseAll()},a.prototype.detailExpandAll=function(){this.detailRowModule&&this.detailRowModule.expandAll()},a.prototype.clearCellSelection=function(){this.selectionModule&&this.selectionModule.clearCellSelection()},a.prototype.clearRowSelection=function(){this.selectionModule&&this.selectionModule.clearRowSelection()},a.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},a.prototype.selectRowsByRange=function(e,t){this.selectionModule&&this.selectionModule.selectRowsByRange(e,t)},a.prototype.isContextMenuOpen=function(){return this.contextMenuModule&&this.contextMenuModule.isOpen},a.prototype.ensureModuleInjected=function(e){return 0<=this.getInjectedModules().indexOf(e)},a.prototype.destroyTemplate=function(e,t){this.clearTemplate(e,t)},a.prototype.log=function(e,t){this.getInjectedModules().find(function(e){return"Logger"===e.name})||(xP.Inject(Bk),this.enableLogger=!0,this.injectModules()),this.loggerModule&&this.loggerModule.log(e,t)},a.prototype.applyBiggerTheme=function(e){this.element.classList.contains("e-bigger")&&e.classList.add("e-bigger")},a.prototype.getPreviousRowData=function(){return this.getRowsObject()[this.getRows().length-1].data},a.prototype.hideScroll=function(){var e=this.getContent().querySelector("."+WE);e.scrollHeight<=e.clientHeight&&(this.scrollModule.removePadding(),e.style.overflowY="auto")},a.prototype.getRowIndexByPrimaryKey=function(e){for(var t=this.getPrimaryKeyFieldNames()[0],i=(e="object"==typeof e?e[""+t]:e,this.getRowsObject()),n=0;n<i.length;n++)if(!i[parseInt(n.toString(),10)].isDetailRow&&!i[parseInt(n.toString(),10)].isCaptionRow){var o=i[parseInt(n.toString(),10)].data[""+t];if((o=1<t.split(".").length?bF(t,i[parseInt(n.toString(),10)].data):o)===e)return i[parseInt(n.toString(),10)].index}return-1},a.prototype.grabColumnByFieldFromAllCols=function(e,t){this.columnModel=[],this.updateColumnModel(this.columns);for(var i,n=this.columnModel,o=0;o<n.length;o++)if(!t&&e===n[parseInt(o.toString(),10)].field||t&&n[parseInt(o.toString(),10)].isForeignColumn()&&e===n[parseInt(o.toString(),10)].foreignKeyValue){i=n[parseInt(o.toString(),10)];break}return i},a.prototype.grabColumnByUidFromAllCols=function(e){this.columnModel=[],this.updateColumnModel(this.columns);for(var t,i=this.columnModel,n=0;n<i.length;n++)e===i[parseInt(n.toString(),10)].uid&&(t=i[parseInt(n.toString(),10)]);return t},a.prototype.getFilteredRecords=function(){var e;return this.allowFiltering&&this.filterSettings.columns.length||this.searchSettings.key.length?(e=this.renderModule.data.generateQuery(!0),this.dataSource&&this.renderModule.data.isRemote()&&this.dataSource instanceof me?this.renderModule.data.getData(this.dataSource,e):(this.dataSource instanceof me?this.dataSource:new me(this.dataSource,e)).executeLocal(e)):[]},a.prototype.getUserAgent=function(){var e=F.userAgent.toLowerCase();return/iphone|ipod|ipad|macintosh/.test(e)},a.prototype.tapEvent=function(e){this.getUserAgent()&&(rB.timer?(clearTimeout(rB.timer),rB.timer=null,this.dblClickHandler(e),this.notify(qx,e)):rB.timer=setTimeout(function(){rB.timer=null},300))},a.prototype.getRowUid=function(e){return""+e+this.rowUid++},a.prototype.getRowElementByUID=function(e){for(var t,i=[].slice.call(this.getContent().querySelector(oD).children),n=0,o=this.frozenRows?[].slice.call(this.getHeaderContent().querySelector(oD).children).concat(i):i;n<o.length;n++){var r=o[n];if(r.getAttribute("data-uid")===e){t=r;break}}return t},a.prototype.getHiddenColumns=function(){for(var e=[],t=0,i=this.columnModel;t<i.length;t++){var n=i[t];!1===n.visible&&e.push(n)}return e},a.prototype.calculatePageSizeByParentHeight=function(e){if(this.allowPaging&&(this.allowTextWrap&&"Header"===this.textWrapSettings.wrapMode||!this.allowTextWrap)){var t=0;if(-1!==e.indexOf("%")&&(e=parseInt(e,10)/100*this.element.clientHeight),this.getNoncontentHeight()+this.getRowHeight()<e&&(t=(e-this.getNoncontentHeight())/this.getRowHeight()),0<t)return Math.floor(t)}return 0},a.prototype.getNoncontentHeight=function(){var e=0;if(this.getHeaderContent()&&!je(this.getHeaderContent().clientHeight)&&(e+=this.getHeaderContent().clientHeight),this.toolbar&&!je(this.element.querySelector(".e-toolbar").clientHeight)&&(e+=this.element.querySelector(".e-toolbar").clientHeight),this.allowPaging&&!je(this.element.querySelector(".e-gridpager").clientHeight)&&(e+=this.element.querySelector(".e-gridpager").clientHeight),this.showColumnChooser&&!je(this.element.querySelector(".e-columnheader").clientHeight)&&(e+=this.element.querySelector(".e-columnheader").clientHeight),this.allowGrouping&&this.groupSettings.showDropArea&&!je(this.element.querySelector(".e-groupdroparea").clientHeight)&&(e+=this.element.querySelector(".e-groupdroparea").clientHeight),0<this.aggregates.length&&!je(this.element.querySelector(".e-summaryrow").clientHeight))for(var t=0;t<this.element.getElementsByClassName("e-summaryrow").length;t++)e+=this.element.getElementsByClassName("e-summaryrow")[parseInt(t.toString(),10)].clientHeight;return e},a.prototype.getSummaryValues=function(e,t){return Sa.aggregates[e.type.toLowerCase()](t,e.field)},a.prototype.serverExcelExport=function(e,t){this.isExcel=!0,this.exportGrid(e,t)},a.prototype.serverPdfExport=function(e,t){this.isExcel=!1,this.exportGrid(e,t)},a.prototype.serverCsvExport=function(e,t){this.isExcel=!0,this.exportGrid(e,t)},a.prototype.exportGrid=function(e,t){var n=this,i=this.getDataModule().generateQuery(!0),i=(new Ba).processQuery(new me({url:""}),i),i=JSON.parse(i.data),o=JSON.parse(this.addOnPersist(["allowGrouping","allowPaging","pageSettings","sortSettings","allowPdfExport","allowExcelExport","aggregates","filterSettings","groupSettings","columns","locale","searchSettings"])),r=(o.filterSettings.columns=i.where,o.searchSettings.fields=i.search&&i.search[0].fields||[],o.sortSettings.columns=i.sorted,o.columns=this.setHeaderText(o.columns,["field","headerText","type","format","visible","foreignKeyValue","foreignKeyField","template","index","width","textAlign","headerTextAlign","columns"]),this.createElement("form",{id:"ExportForm"})),i=(r.style.display="none",this.createElement("input",{id:"gridInput",attrs:{name:"gridModel"}}));i.value=JSON.stringify(o),r.method="POST",r.action=e,r.appendChild(i),t&&t.headers&&Array.isArray(t.headers)&&t.headers.forEach(function(i){Object.keys(i).forEach(function(e){var t="string"==typeof i[""+e]?i[""+e]:JSON.stringify(i[""+e]),e=n.createElement("input",{attrs:{name:e,value:t,type:"hidden"}});r.appendChild(e)})}),document.body.appendChild(r),r.submit(),r.remove()},a.prototype.setHeaderText=function(e,t){for(var i=0;i<e.length;i++)for(var n=this.getColumnByUid(e[parseInt(i.toString(),10)].uid),o=(e[parseInt(i.toString(),10)].headerText=n.headerText,je(n.template)||(e[parseInt(i.toString(),10)].template="true"),e[parseInt(i.toString(),10)].format&&(e[parseInt(i.toString(),10)].format=yF(this.getFormat(e[parseInt(i.toString(),10)].format),e[parseInt(i.toString(),10)].type,this.isExcel,oe)),e[parseInt(i.toString(),10)].columns&&this.setHeaderText(e[parseInt(i.toString(),10)].columns,t),Object.keys(e[parseInt(i.toString(),10)])),r=0;r<o.length;r++)t.indexOf(o[parseInt(r.toString(),10)])<0&&delete e[parseInt(i.toString(),10)][o[parseInt(r.toString(),10)]];return e},a.prototype.getFormat=function(e){return"object"==typeof e?je(e.format)?e.skeleton:e.format:e},a.prototype.isCollapseStateEnabled=function(){return!1===this.isExpanded},a.prototype.updateRowValue=function(e,t){t={requestType:"save",data:t};this.showSpinner(),this.notify(Vx,t),this.refresh()},a.prototype.setForeignKeyData=function(){this.dataBind();var e=this.getDataModule().getForeignKeyDataState();e.isPending?(this.getDataModule().setForeignKeyDataState({}),e.resolver()):(this.getDataModule().setForeignKeyDataState({isDataChanged:!1}),(this.contentModule||this.headerModule)&&this.renderModule.render())},a.prototype.resetFilterDlgPosition=function(e){var t,i,e=this.getColumnHeaderByField(e);e&&(e=e.querySelector(".e-filtermenudiv"),t=this.element.querySelector(".e-filter-popup"),e)&&(i=this.element.getBoundingClientRect(),e=e.getBoundingClientRect(),t)&&(t.offsetWidth+e.right>i.right?t.style.left=(e.right-t.offsetWidth-i.left).toString()+"px":t.style.left=(e.right-i.left).toString()+"px")},a.prototype.renderTemplates=function(e){var t=this.parentDetails&&this.parentDetails.parentInstObj&&this.parentDetails.parentInstObj.isReact,i=this.printGridParent&&this.printGridParent.isReact;(t||i)&&this.portals?((t=i?this.printGridParent:this.parentDetails.parentInstObj).portals=t.portals.concat(this.portals),t.renderTemplates(e),this.portals=void 0):(this.notify("reactTemplateRender",this.portals),this.renderReactTemplates(e))},a.prototype.batchUpdate=function(e){this.processRowChanges(e)},a.prototype.batchAsyncUpdate=function(e){this.processBulkRowChanges(e)},a.prototype.processBulkRowChanges=function(e){var t=this;if(this.dataToBeUpdated)for(var i=[JE,KE,ZE],n=this.getPrimaryKeyFieldNames()[0],o=0;o<i.length;o++)e[i[parseInt(o.toString(),10)]]&&nF(this,e,i[parseInt(o.toString(),10)],n);else this.dataToBeUpdated=Object.assign({addedRecords:[],changedRecords:[],deletedRecords:[]},e),setTimeout(function(){t.processRowChanges(t.dataToBeUpdated),t.dataToBeUpdated=null},this.asyncTimeOut)},a.prototype.processRowChanges=function(e){var t=this,i=this.getPrimaryKeyFieldNames()[0],e=(e=Object.assign({addedRecords:[],changedRecords:[],deletedRecords:[]},e),this.getDataModule().saveChanges(e,i,{},this.getDataModule().generateQuery().requiresCount()));this.getDataModule().isRemote()?e.then(function(){t.setNewData()}):this.setNewData()},a.prototype.setNewData=function(){var t=this,i=JSON.parse(JSON.stringify(this.getCurrentViewRecords()));this.getDataModule().getData({},this.getDataModule().generateQuery().requiresCount()).then(function(e){t.bulkRefresh(e.result,i,e.count)})},a.prototype.deleteRowElement=function(e){ue(this.getRowElementByUID(e.uid))},a.prototype.bulkRefresh=function(n,e,t){for(var i,o=this,r=this.getRowsObject(),s=this.getPrimaryKeyFieldNames()[0],a=this,l=0;l<r.length;l++)!function(t){n.filter(function(e){return e[""+s]===r[parseInt(t.toString(),10)].data[""+s]}).length||(a.deleteRowElement(r[parseInt(t.toString(),10)]),r.splice(t,1),t--),i=t}(l),l=i;for(var h=this,l=0;l<n.length;l++)!function(t){var i;e.filter(function(e){e[""+s]===n[parseInt(t.toString(),10)][""+s]&&(e!==n[parseInt(t.toString(),10)]&&o.setRowData(n[parseInt(t.toString(),10)][""+s],n[parseInt(t.toString(),10)]),i=!0)}),i||h.renderRowElement(n[parseInt(t.toString(),10)],t)}(l);this.currentViewData=n;var d=[].slice.call(this.getContentTable().getElementsByClassName(UE));eF(this,this.getRowsObject(),d),oF(this),this.allowPaging&&this.notify(Z1,{module:"pager",properties:{totalRecordsCount:t}})},a.prototype.renderRowElement=function(e,t){var i,n=new yD(this.serviceLocator,null,this),e=new bD(this).generateRows([e]),n=n.render(e[0],this.getColumns()),e=(this.addRowObject(e[0],t),this.getContentTable().querySelector(oD));e.querySelector(".e-emptyrow")&&((i=e.querySelector(".e-emptyrow")).parentNode.removeChild(i),this.frozenRows)&&this.element.querySelector(".e-frozenrow-empty")&&this.element.querySelector(".e-frozenrow-empty").classList.remove("e-frozenrow-empty"),e=(this.frozenRows&&t<this.frozenRows?this.getHeaderContent():this.getContent()).querySelector(oD),(e=this.getContent().querySelector(oD)).appendChild(n)},a.prototype.addRowObject=function(e,t){this.getRowsObject().splice(t,1,e)},a.prototype.updateVisibleExpandCollapseRows=function(){for(var e=this.getRowsObject(),t=0,i=e.length;t<i;t++)(e[parseInt(t.toString(),10)].isDataRow||e[parseInt(t.toString(),10)].isAggregateRow)&&this.getRowElementByUID(e[parseInt(t.toString(),10)].uid)&&"none"===this.getRowElementByUID(e[parseInt(t.toString(),10)].uid).style.display?e[parseInt(t.toString(),10)].visible=!1:e[parseInt(t.toString(),10)].visible=!0},a.prototype.sanitize=function(e){return this.enableHtmlSanitizer?go.sanitize(e):e},a.prototype.getHeight=function(e){return e=Number.isInteger(e)||-1===e.indexOf("%")?Number.isInteger(e)||"auto"===this.height?this.height:parseInt(e,10):parseInt(e,10)/100*this.element.clientHeight},a.prototype.getFrozenRightContent=function(){return this.contentModule.getPanel()},a.prototype.getFrozenRightHeader=function(){return this.headerModule.getPanel()},a.prototype.getMovableHeaderTbody=function(){return this.getHeaderContent().querySelector(oD)},a.prototype.getMovableContentTbody=function(){return this.getContent().querySelector(oD)},a.prototype.getFrozenHeaderTbody=function(){return this.getHeaderContent().querySelector(oD)},a.prototype.getFrozenLeftContentTbody=function(){return this.getContent().querySelector(oD)},a.prototype.getFrozenRightHeaderTbody=function(){return this.getHeaderContent().querySelector(oD)},a.prototype.getFrozenRightContentTbody=function(){return this.getContent().querySelector(oD)},a.prototype.showResponsiveCustomFilter=function(e){this.filterModule&&this.filterModule.showCustomFilter(e||"Vertical"===this.rowRenderingMode)},a.prototype.showResponsiveCustomSort=function(e){this.sortModule&&this.sortModule.showCustomSort(e||"Vertical"===this.rowRenderingMode)},a.prototype.showResponsiveCustomColumnChooser=function(e){this.columnChooserModule&&this.columnChooserModule.showCustomColumnChooser(e||"Vertical"===this.rowRenderingMode)},a.prototype.showAdaptiveFilterDialog=function(){this.enableAdaptiveUI&&this.showResponsiveCustomFilter(!0)},a.prototype.showAdaptiveSortDialog=function(){this.enableAdaptiveUI&&this.showResponsiveCustomSort(!0)},a.prototype.getCurrentVisibleColumns=function(e){for(var t=[],i=0,n=e?this.getColumns():this.columnModel;i<n.length;i++){var o=n[i];o.visible&&t.push(o)}return t},a.prototype.enableInfiniteAggrgate=function(){this.enableInfiniteScrolling&&this.groupSettings.columns.length&&!this.groupSettings.disablePageWiseAggregates&&!this.groupSettings.enableLazyLoading&&this.setProperties({groupSettings:{disablePageWiseAggregates:!0}},!0)},Ck([e([])],a.prototype,"currentViewData",void 0),Ck([e()],a.prototype,"parentDetails",void 0),Ck([e()],a.prototype,"showHider",void 0),Ck([e([])],a.prototype,"columns",void 0),Ck([e(!0)],a.prototype,"enableAltRow",void 0),Ck([e(!0)],a.prototype,"enableHover",void 0),Ck([e(!1)],a.prototype,"enableAutoFill",void 0),Ck([e(!0)],a.prototype,"allowKeyboard",void 0),Ck([e(!1)],a.prototype,"enableStickyHeader",void 0),Ck([e(!1)],a.prototype,"enableHtmlSanitizer",void 0),Ck([e(!1)],a.prototype,"allowTextWrap",void 0),Ck([t({},hP)],a.prototype,"textWrapSettings",void 0),Ck([t({},cP)],a.prototype,"resizeSettings",void 0),Ck([e(!1)],a.prototype,"allowPaging",void 0),Ck([t({},Ir)],a.prototype,"pageSettings",void 0),Ck([t({},CP)],a.prototype,"loadingIndicator",void 0),Ck([e(!0)],a.prototype,"enableVirtualMaskRow",void 0),Ck([e(!1)],a.prototype,"enableVirtualization",void 0),Ck([e(!1)],a.prototype,"enableColumnVirtualization",void 0),Ck([e(!1)],a.prototype,"enableInfiniteScrolling",void 0),Ck([t({},nP)],a.prototype,"searchSettings",void 0),Ck([e(!1)],a.prototype,"allowSorting",void 0),Ck([e("Ellipsis")],a.prototype,"clipMode",void 0),Ck([e(!0)],a.prototype,"allowMultiSorting",void 0),Ck([e(!1)],a.prototype,"allowExcelExport",void 0),Ck([e(!1)],a.prototype,"allowPdfExport",void 0),Ck([t({},jk)],a.prototype,"sortSettings",void 0),Ck([t({},Yk)],a.prototype,"infiniteScrollSettings",void 0),Ck([e(!0)],a.prototype,"allowSelection",void 0),Ck([e(-1)],a.prototype,"selectedRowIndex",void 0),Ck([t({},eP)],a.prototype,"selectionSettings",void 0),Ck([e(!1)],a.prototype,"allowFiltering",void 0),Ck([e("Horizontal")],a.prototype,"rowRenderingMode",void 0),Ck([e(!1)],a.prototype,"enableAdaptiveUI",void 0),Ck([e("Both")],a.prototype,"adaptiveUIMode",void 0),Ck([e(!1)],a.prototype,"allowReordering",void 0),Ck([e(!1)],a.prototype,"allowResizing",void 0),Ck([e(!1)],a.prototype,"allowRowDragAndDrop",void 0),Ck([t({},sP)],a.prototype,"rowDropSettings",void 0),Ck([t({},Jk)],a.prototype,"filterSettings",void 0),Ck([e(!1)],a.prototype,"allowGrouping",void 0),Ck([e(!1)],a.prototype,"enableImmutableMode",void 0),Ck([e(!1)],a.prototype,"showColumnMenu",void 0),Ck([e(!1)],a.prototype,"autoFit",void 0),Ck([t({},mP)],a.prototype,"groupSettings",void 0),Ck([t({},vP)],a.prototype,"editSettings",void 0),Ck([kt([],bk)],a.prototype,"aggregates",void 0),Ck([e(!1)],a.prototype,"showColumnChooser",void 0),Ck([t({},h0)],a.prototype,"columnChooserSettings",void 0),Ck([e(!1)],a.prototype,"enableHeaderFocus",void 0),Ck([e("auto")],a.prototype,"height",void 0),Ck([e("auto")],a.prototype,"width",void 0),Ck([e("Default")],a.prototype,"gridLines",void 0),Ck([e()],a.prototype,"rowTemplate",void 0),Ck([e()],a.prototype,"emptyRecordTemplate",void 0),Ck([e()],a.prototype,"detailTemplate",void 0),Ck([e()],a.prototype,"childGrid",void 0),Ck([e()],a.prototype,"queryString",void 0),Ck([e("AllPages")],a.prototype,"printMode",void 0),Ck([e("Expanded")],a.prototype,"hierarchyPrintMode",void 0),Ck([e([])],a.prototype,"dataSource",void 0),Ck([e(null)],a.prototype,"rowHeight",void 0),Ck([e()],a.prototype,"query",void 0),Ck([e("USD")],a.prototype,"currencyCode",void 0),Ck([e()],a.prototype,"exportGrids",void 0),Ck([e()],a.prototype,"toolbar",void 0),Ck([e()],a.prototype,"contextMenuItems",void 0),Ck([e()],a.prototype,"columnMenuItems",void 0),Ck([e()],a.prototype,"toolbarTemplate",void 0),Ck([e()],a.prototype,"pagerTemplate",void 0),Ck([e(0)],a.prototype,"frozenRows",void 0),Ck([e(0)],a.prototype,"frozenColumns",void 0),Ck([e("")],a.prototype,"cssClass",void 0),Ck([e("All")],a.prototype,"columnQueryMode",void 0),Ck([e({})],a.prototype,"currentAction",void 0),Ck([e("")],a.prototype,"ej2StatePersistenceVersion",void 0),Ck([i()],a.prototype,"created",void 0),Ck([i()],a.prototype,"destroyed",void 0),Ck([i()],a.prototype,"load",void 0),Ck([i()],a.prototype,"rowDataBound",void 0),Ck([i()],a.prototype,"queryCellInfo",void 0),Ck([i()],a.prototype,"headerCellInfo",void 0),Ck([i()],a.prototype,"actionBegin",void 0),Ck([i()],a.prototype,"actionComplete",void 0),Ck([i()],a.prototype,"actionFailure",void 0),Ck([i()],a.prototype,"dataBound",void 0),Ck([i()],a.prototype,"recordDoubleClick",void 0),Ck([i()],a.prototype,"recordClick",void 0),Ck([i()],a.prototype,"rowSelecting",void 0),Ck([i()],a.prototype,"rowSelected",void 0),Ck([i()],a.prototype,"rowDeselecting",void 0),Ck([i()],a.prototype,"rowDeselected",void 0),Ck([i()],a.prototype,"cellSelecting",void 0),Ck([i()],a.prototype,"cellSelected",void 0),Ck([i()],a.prototype,"cellDeselecting",void 0),Ck([i()],a.prototype,"cellDeselected",void 0),Ck([i()],a.prototype,"columnSelecting",void 0),Ck([i()],a.prototype,"columnSelected",void 0),Ck([i()],a.prototype,"columnDeselecting",void 0),Ck([i()],a.prototype,"columnDeselected",void 0),Ck([i()],a.prototype,"columnDragStart",void 0),Ck([i()],a.prototype,"columnDrag",void 0),Ck([i()],a.prototype,"columnDrop",void 0),Ck([i()],a.prototype,"printComplete",void 0),Ck([i()],a.prototype,"beforePrint",void 0),Ck([i()],a.prototype,"pdfQueryCellInfo",void 0),Ck([i()],a.prototype,"pdfHeaderQueryCellInfo",void 0),Ck([i()],a.prototype,"pdfAggregateQueryCellInfo",void 0),Ck([i()],a.prototype,"excelAggregateQueryCellInfo",void 0),Ck([i()],a.prototype,"exportDetailDataBound",void 0),Ck([i()],a.prototype,"exportDetailTemplate",void 0),Ck([i()],a.prototype,"excelQueryCellInfo",void 0),Ck([i()],a.prototype,"excelHeaderQueryCellInfo",void 0),Ck([i()],a.prototype,"beforeExcelExport",void 0),Ck([i()],a.prototype,"excelExportComplete",void 0),Ck([i()],a.prototype,"beforePdfExport",void 0),Ck([i()],a.prototype,"pdfExportComplete",void 0),Ck([i()],a.prototype,"rowDragStartHelper",void 0),Ck([i()],a.prototype,"detailDataBound",void 0),Ck([i()],a.prototype,"rowDragStart",void 0),Ck([i()],a.prototype,"rowDrag",void 0),Ck([i()],a.prototype,"rowDrop",void 0),Ck([i()],a.prototype,"toolbarClick",void 0),Ck([i()],a.prototype,"beforeOpenColumnChooser",void 0),Ck([i()],a.prototype,"beforeOpenAdaptiveDialog",void 0),Ck([i()],a.prototype,"batchAdd",void 0),Ck([i()],a.prototype,"batchDelete",void 0),Ck([i()],a.prototype,"batchCancel",void 0),Ck([i()],a.prototype,"beforeBatchAdd",void 0),Ck([i()],a.prototype,"beforeBatchDelete",void 0),Ck([i()],a.prototype,"beforeBatchSave",void 0),Ck([i()],a.prototype,"beginEdit",void 0),Ck([i()],a.prototype,"commandClick",void 0),Ck([i()],a.prototype,"cellEdit",void 0),Ck([i()],a.prototype,"cellSave",void 0),Ck([i()],a.prototype,"cellSaved",void 0),Ck([i()],a.prototype,"resizeStart",void 0),Ck([i()],a.prototype,"resizing",void 0),Ck([i()],a.prototype,"resizeStop",void 0),Ck([i()],a.prototype,"keyPressed",void 0),Ck([i()],a.prototype,"beforeDataBound",void 0),Ck([i()],a.prototype,"contextMenuOpen",void 0),Ck([i()],a.prototype,"contextMenuClick",void 0),Ck([i()],a.prototype,"columnMenuOpen",void 0),Ck([i()],a.prototype,"columnMenuClick",void 0),Ck([i()],a.prototype,"checkBoxChange",void 0),Ck([i()],a.prototype,"beforeCopy",void 0),Ck([i()],a.prototype,"beforePaste",void 0),Ck([i()],a.prototype,"beforeAutoFill",void 0),Ck([i()],a.prototype,"columnDataStateChange",void 0),Ck([i()],a.prototype,"dataStateChange",void 0),Ck([i()],a.prototype,"dataSourceChanged",void 0),Ck([i()],a.prototype,"exportGroupCaption",void 0),Ck([i()],a.prototype,"lazyLoadGroupExpand",void 0),Ck([i()],a.prototype,"lazyLoadGroupCollapse",void 0),Ck([i()],a.prototype,"beforeDetailTemplateDetach",void 0);var AP,xP,IP=xP=Ck([Bt],a);function a(e,t){e=AP.call(this,e,t)||this;return e.isPreventScrollEvent=!1,e.inViewIndexes=[],e.keyA=!1,e.frozenRightCount=0,e.freezeColumnRefresh=!0,e.rightcount=0,e.frozenLeftCount=0,e.leftcount=0,e.tablesCount=1,e.movableCount=0,e.movablecount=0,e.fixedcount=0,e.fixedCount=0,e.visibleFrozenLeft=0,e.visibleFrozenFixed=0,e.isPreparedFrozenColumns=!1,e.visibleFrozenRight=0,e.visibleMovable=0,e.frozenLeftColumns=[],e.frozenRightColumns=[],e.movableColumns=[],e.fixedColumns=[],e.stackedLeft=[],e.stackedRight=[],e.stackedFixed=[],e.stackedMovable=[],e.stackedarrayLeft=[],e.stackedarrayRight=[],e.stackedarrayFixed=[],e.stackedarrayMovable=[],e.media={},e.autoFitColumnsResize=!1,e.tableIndex=0,e.componentRefresh=Ji.prototype.refresh,e.isChangeDataSourceCall=!1,e.mergedColumns=!1,e.isVirtualAdaptive=!1,e.requireTemplateRef=!0,e.vRows=[],e.vcRows=[],e.vGroupOffsets={},e.rowUid=0,e.translateX=0,e.isManualRefresh=!1,e.isAutoFitColumns=!1,e.enableDeepCompare=!1,e.totalDataRecordsCount=0,e.disableSelectedRecords=[],e.partialSelectedRecords=[],e.isSpan=!1,e.islazyloadRequest=!1,e.isAddNewRow=!1,e.addNewRowFocus=!0,e.lockcolPositionCount=0,e.prevPageMoving=!1,e.pageTemplateChange=!1,e.isAutoGen=!1,e.isAutoGenerateColumns=!1,e.pageRequireRefresh=!0,e.mediaBindInstance={},e.commandDelIndex=void 0,e.preventAutoFit=!1,e.asyncTimeOut=50,e.isExportGrid=!1,e.isWidgetsDestroyed=!1,e.enableLogger=!1,e.needsID=!0,xP.Inject(hk),x("mergePersistData",e.mergePersistGridData,e),e}function TP(){return["aggregates","allowGrouping","allowFiltering","allowMultiSorting","allowReordering","allowSorting","allowTextWrap","childGrid","columns","currentViewData","dataSource","detailTemplate","enableAltRow","enableColumnVirtualization","filterSettings","gridLines","groupSettings","height","locale","pageSettings","printMode","query","queryString","enableRtl","rowHeight","rowTemplate","sortSettings","textWrapSettings","allowPaging","hierarchyPrintMode","searchSettings","queryCellInfo","beforeDataBound","enableHtmlSanitizer"]}DP.prototype.isContentReady=function(){var e=this;return!this.isPrintGrid()||"None"!==this.parent.hierarchyPrintMode&&this.parent.childGrid?function(){e.defered.promise.then(function(){e.contentReady()}),e.isPrintGrid()&&e.hierarchyPrint()}:this.contentReady},DP.prototype.hierarchyPrint=function(){this.removeColGroup(this.parent);var e=window.printGridObj;e&&!e.element.querySelector("[aria-busy=true")&&e.printModule.defered.resolve()},DP.prototype.print=function(){this.renderPrintGrid()},DP.prototype.onEmpty=function(){this.isPrintGrid()&&this.contentReady()},DP.prototype.actionBegin=function(){this.isPrintGrid()&&(this.isAsyncPrint=!0)},DP.prototype.renderPrintGrid=function(){for(var e=this.parent,t=Q("div",{id:this.parent.element.id+"_print",className:e.element.className+" e-print-grid"}),i=(t.classList.remove("e-gridhover"),document.body.appendChild(t),new IP(OB(e,e.hierarchyPrintMode))),n=0;n<i.columns.length;n++)i.columns[parseInt(n.toString(),10)]=Pe({},i.columns[parseInt(n.toString(),10)]),!e.getFrozenColumns()&&e.isFrozenGrid()&&(i.columns[parseInt(n.toString(),10)].freeze=void 0);this.parent.isAngular&&(i.viewContainerRef=this.parent.viewContainerRef),i.load=function(){},i.query=e.getQuery().clone(),(window.printGridObj=i).isPrinting=!0;var o=i.getInjectedModules(),r=e.getInjectedModules();o&&o.length===r.length||i.setInjectedModules(r),e.notify(EI,{element:t,printgrid:i}),this.parent.log("exporting_begin",this.getModuleName()),i.registeredTemplate=this.parent.registeredTemplate,i.isVue=this.parent.isVue,this.parent.isVue&&(i.vueInstance=this.parent.vueInstance),i.printGridParent=e,i.appendTo(t),e.isVue3||(i.trigger=e.trigger)},DP.prototype.contentReady=function(){var e,t,i=this;this.isPrintGrid()&&(e=this.parent,this.isAsyncPrint?this.printGrid():(t={requestType:"print",element:e.element,selectedRows:e.getContentTable().querySelectorAll('tr[aria-selected="true"]'),cancel:!1,hierarchyPrintMode:e.hierarchyPrintMode},this.isAsyncPrint||e.trigger(c1,t),t.cancel?G(e.element):this.isAsyncPrint||(this.parent.printGridParent&&this.parent.printGridParent.isReact?this.parent.printGridParent.renderTemplates(function(){i.printGrid()}):this.printGrid())))},DP.prototype.printGrid=function(){var e,t=this.parent;"auto"!==t.height&&(e=this.scrollModule.getCssProperties(),o=t.element.querySelector("."+WE),a=t.element.querySelector("."+RE),o.style.height="auto",o.style.overflowY="auto",a.style[e.padding]="",a.firstElementChild.style[e.border]=""),t.allowGrouping&&(t.groupSettings.columns.length?this.removeColGroup(t):t.element.querySelector(".e-groupdroparea").style.display="none");for(var i=0,n=[].slice.call(t.element.getElementsByClassName(WE));i<n.length;i++)n[i].style.overflowX="hidden";for(var o=[].slice.call(t.element.getElementsByClassName("e-spin-show")),r=0,s=[].slice.call(o);r<s.length;r++)mt(s[r],["e-spin-hide"],["e-spin-show"]);this.printGridElement(t),t.isPrinting=!1,delete window.printGridObj;var a={element:t.element};t.trigger(u1,a),t.destroy(),this.parent.log("exporting_complete",this.getModuleName())},DP.prototype.printGridElement=function(e){mt(e.element,["e-print-grid-layout"],["e-print-grid"]),e.isPrinting&&G(e.element),this.printWind=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),je(this.printWind)||(this.printWind.moveTo(0,0),this.printWind.resizeTo(screen.availWidth,screen.availHeight),this.printWind=V(e.element,this.printWind))},DP.prototype.removeColGroup=function(e){var t=e.groupSettings.columns.length,i=e.element,n="#"+e.element.id;if(t){for(var o=ct(".e-groupcaption",i),r=e.groupSettings.enableLazyLoading?(parseInt(o[0].getAttribute("colspan"),10)-(e.groupSettings.columns.length-1)).toString():o[t-1].getAttribute("colspan"),s=0;s<o.length;s++)o[parseInt(s.toString(),10)].setAttribute("colspan",r);e=ct("colgroup"+n+"colgroup",i),n=ct(".e-content colgroup",i),i=ct(".e-summarycontent colgroup",i);this.hideColGroup(e,t),this.hideColGroup(n,t),this.hideColGroup(i,t)}},DP.prototype.hideColGroup=function(e,t){for(var i=0;i<e.length;i++)for(var n=0;n<t;n++)e[parseInt(i.toString(),10)].children[parseInt(n.toString(),10)].style.display="none"},DP.prototype.isPrintGrid=function(){return 0<this.parent.element.id.indexOf("_print")&&this.parent.isPrinting},DP.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(X1,this.contentReady.bind(this)),this.parent.removeEventListener(WA,this.actionBeginFunction),this.parent.off(J1,this.onEmpty.bind(this)),this.parent.off(II,this.hierarchyPrint))},DP.prototype.getModuleName=function(){return"print"},DP.printGridProp=TP().concat([c1,u1,_A]);var EP=DP;function DP(e,t){this.isAsyncPrint=!1,this.defered=new ll,this.parent=e,this.parent.isDestroyed||(this.parent.on(X1,this.isContentReady(),this),this.actionBeginFunction=this.actionBegin.bind(this),this.parent.addEventListener(WA,this.actionBeginFunction),this.parent.on(J1,this.onEmpty.bind(this)),this.parent.on(II,this.hierarchyPrint,this),this.scrollModule=t)}function MP(e,t){return e.prototype&&t in e.prototype}function kP(e,t,i){return je(e)||""===e?"":Sa.getObject(e,t)}function PP(e,t){requestAnimationFrame(function(){try{t(null,e())}catch(e){t(e)}})}function BP(e){return!je(e)&&!je(e.columns)&&0<e.columns.length}function FP(e,t){for(var i=e.columns,n=t.columns,o=0;o<i.length;o++)if(n.length-1>=o)if(n[parseInt(o.toString(),10)].columns)for(var r=0;r<n[parseInt(o.toString(),10)].columns.length;r++)i[parseInt(o.toString(),10)].columns[parseInt(r.toString(),10)].type=n[parseInt(o.toString(),10)].columns[parseInt(r.toString(),10)].type;else i[parseInt(o.toString(),10)].type=n[parseInt(o.toString(),10)].type}function LP(e){for(var t=[],i=e.vRows,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].isDataRow?t.push(i[parseInt(n.toString(),10)]):i[parseInt(n.toString(),10)].isDataRow||(t.push(i[parseInt(n.toString(),10)]),!i[parseInt(n.toString(),10)].isExpand&&i[parseInt(n.toString(),10)].isCaptionRow&&(n+=OP(i[parseInt(n.toString(),10)],e)));e.vcRows=t}var RP=0;function OP(e,t){RP=0;var i="gSummary",n=t.groupSettings.columns.length,o="records",r="items",s=e[i],a=0,l="aggregatesCount";if(s===e.data.count)t.groupSettings.columns.length&&!je(e[l])&&e[l]?1!==t.groupSettings.columns.length?RP+=0!==e.indent&&s<2?e[i]*(n-e.indent+(n-e.indent)*e[l]):e[i]*(n-e.indent+(n-e.indent-1)*e[l])+e[l]:1===t.groupSettings.columns.length&&(RP+=e[i]*(n-e.indent)+e[l]):t.groupSettings.columns.length&&(1!==t.groupSettings.columns.length?RP+=e[i]*(t.groupSettings.columns.length-e.indent):RP+=e[i]);else{for(var h=0,d=e.data[r].length;h<d;h++){var p=e.data[r][parseInt(h.toString(),10)];RP+=p[r].length+(n===t.columns.length||je(p[r][o])?0:p[r][o].length),a+=(je(p[r][o])||je(e[l])?p[r]:p[r][o]).length,p[r].GroupGuid&&0!==p[r].childLevels&&NP(p)}RP+=e.data[r].length,je(e[l])||e[l]&&RP&&0!==a&&(RP+=(RP-a)*e[l]+e[l])}return RP}function NP(e){for(var t=0,i=e.items.length;t<i;t++){var n=e.items[parseInt(t.toString(),10)];RP+=n.count,0!==n.items.childLevels&&NP(n)}}function VP(e,t){for(var i=[],n=0,o=e.length;n<o;n++){var r=t(e[parseInt(n.toString(),10)],n);je(r)||i.push(r)}return i}function _P(e){for(var t=[],i=0;i<e.length;i++)t.push(Pe({},qP(e[parseInt(i.toString(),10)]),{},!0));return t}function HP(t){if(t)try{var e="<"!==t[0];return"function"!=typeof t&&e&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){return oo(t)}}function zP(e,t){var i={},n=["style","class"];Pe(i,t,{}),"style"in i&&(gt(e,i[n[0]]),delete i[n[0]]),"class"in i&&(U([e],i[n[1]]),delete i[n[1]]),pt(e,i)}function jP(e,t,i,n){for(var o=Pe(e,t,i),r=Object.keys(o),s=0;s<r.length;s++)n&&-1!==n.indexOf(r[parseInt(s.toString(),10)])&&delete o[r[parseInt(s.toString(),10)]];return o}function WP(e,t){void 0===t&&(t=0);for(var i=0,n=je(e)?0:e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?(e[parseInt(i.toString(),10)].index=je(e[parseInt(i.toString(),10)].index)?t:e[parseInt(i.toString(),10)].index,t++,t=WP(e[parseInt(i.toString(),10)].columns,t)):(e[parseInt(i.toString(),10)].index=je(e[parseInt(i.toString(),10)].index)?t:e[parseInt(i.toString(),10)].index,t++);return t}function QP(e,t,i){for(var n=0,o=je(e)?0:e.length;n<o;n++){var r=void 0;(r="string"==typeof e[parseInt(n.toString(),10)]?new C0({field:e[parseInt(n.toString(),10)]},i):e[parseInt(n.toString(),10)]instanceof C0&&!e[parseInt(n.toString(),10)].columns?e[parseInt(n.toString(),10)]:(e[parseInt(n.toString(),10)].columns&&(e[parseInt(n.toString(),10)].columns=QP(e[parseInt(n.toString(),10)].columns,null,i)),new C0(e[parseInt(n.toString(),10)],i))).type&&"checkbox"===r.type.toLowerCase()&&(r.allowReordering=!1),r.headerText=je(r.headerText)?r.foreignKeyValue||r.field||"":r.headerText,r.foreignKeyField=r.foreignKeyField||r.field,r.valueAccessor=("string"==typeof r.valueAccessor?R(r.valueAccessor,window):r.valueAccessor)||kP,r.headerValueAccessor="string"==typeof r.headerValueAccessor?R(r.headerValueAccessor,window):r.headerValueAccessor,r.width=t&&je(r.width)?200:r.width,je(r.visible)&&(r.visible=!0),e[parseInt(n.toString(),10)]=r}return e}function UP(e,t,i){var n=e.querySelector("span"),o=e.parentElement.getBoundingClientRect(),r=t.target.getBoundingClientRect(),n=(n.className=i,e.style.display="",(je(t.clientY)?t.changedTouches[0]:t).clientY>e.offsetHeight+10);e.style.top=r.top-o.top+(n?-(e.offsetHeight+10):e.offsetHeight+10)+"px",e.style.left=function(e,t,i,n){e=e.offsetWidth/2,t=JP(t).x;return t-i.left<e?i.left-n:i.right-t<e?i.right-n-2*e:t-n-e}(e,t,r,o.left)+"px",n?(e.querySelector(".e-downtail").style.display="",e.querySelector(".e-uptail").style.display="none"):(e.querySelector(".e-downtail").style.display="none",e.querySelector(".e-uptail").style.display="")}function qP(e){return e instanceof n?R("properties",e):e}function A(e,t,i){for(var n=e;n&&(i?n.id!==t:!n.classList.contains(t));)n=n.parentElement;return n}function GP(e,t){for(var i=-1,n=0,o=t.length;n<o;n++)if(t[parseInt(n.toString(),10)].isEqualNode(e)){i=n;break}return i}function YP(e,t){for(var i=0,n=t.length;i<n;i++)if(t[parseInt(i.toString(),10)]===e)return i;return-1}function XP(e){for(var t=[],i=0,n=e.length;i<n;i++)e[parseInt(i.toString(),10)].hasOwnProperty("properties")?t.push(e[parseInt(i.toString(),10)].properties):t.push(e[parseInt(i.toString(),10)]);return t}function KP(e,t){for(var i=[].slice.call(e.querySelectorAll(t)),n=0;n<i.length;n++)ue(i[parseInt(n.toString(),10)])}function JP(e){var t={};return t.x=(je(e.clientX)?e.changedTouches[0]:e).clientX,t.y=(je(e.clientY)?e.changedTouches[0]:e).clientY,t}var ZP=0;function $P(e){return e+ZP++}function eB(e,t){for(var i=0,n=t.length;i<n;i++)n===t.length?e.appendChild(t[parseInt(i.toString(),10)]):e.appendChild(t[0]);return e}function tB(e,t,i){for(var n=e,o=[];n;)(i?n.id===t:n.classList.contains(t))&&o.push(n),n=n.parentElement;return o}function iB(e,t,i,n){var o;return"Custom"===e?(o="string"==typeof(o=i.customAggregate)?R(o,window):o)?o.call(n,t,i):"":i.field in t||t instanceof Array?Sa.aggregates[e.toLowerCase()](t,i.field):null}var nB,oB,rB,sB=null;function aB(){var e,t;return null!==sB?sB:(t=0,(e=document.createElement("div")).style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth|0,document.body.removeChild(e),sB=t)}function lB(e,t){var i,n;return t&&void 0!==oB||void 0===nB&&((i=Q("table",{className:QE,attrs:{role:"grid"}})).style.visibility="hidden",i.innerHTML='<tr><td class="e-rowcell">A<td></tr>',e.appendChild(i),n=i.querySelector("td").getBoundingClientRect(),e.removeChild(i),oB=n.height,nB=Math.ceil(n.height),t)?oB:nB}function hB(e){return 1<e.split(".").length}function dB(e){return(e=void 0===e?"":e).replace(/\./g,"___")}function pB(e){return(e=void 0===e?"":e).replace(/[^a-zA-Z0-9_.]/g,"\\$&")}function cB(e){return(e=void 0===e?"":e).replace(/___/g,".")}function uB(e,t,i){i=A(i,UE),i=!i||!i.classList.contains("e-insertedrow");return"beginEdit"===t&&i?!(e.isIdentity||e.isPrimaryKey||!e.allowEditing):!("add"===t&&e.isIdentity||i&&!e.allowEditing&&!e.isIdentity&&!e.isPrimaryKey)}function gB(e){return 0!==e.getBoundingClientRect().width}function mB(e){var t=ge("#"+e.element.id+"EditConfirm",e.element);return"Batch"===e.editSettings.mode&&(ct(".e-updatedtd",e.element).length||ct(".e-gridform.e-formvalidator",e.element).length)&&e.editSettings.showConfirmDialog&&(!t||t.classList.contains("e-popup-close"))}function fB(e,t){e=e instanceof Array?e:[e];for(var i=0;i<e.length;i++)t?e[parseInt(i.toString(),10)].classList.add("e-wrap"):e[parseInt(i.toString(),10)].classList.remove("e-wrap")}function yB(e,t){var i,n=e.getService("valueFormatter");switch("date"!==t.type&&"datetime"!==t.type&&"dateonly"!==t.type||(i={type:"dateonly"===t.type?"date":t.type,skeleton:t.format},"string"==typeof t.format&&"yMd"!==t.format&&(i.format=t.format)),t.type){case"date":case"dateonly":case"datetime":t.setFormatter(n.getFormatFunction(i)),t.setParser(n.getParserFunction(i));break;case"number":t.setFormatter(n.getFormatFunction({format:t.format})),t.setParser(n.getParserFunction({format:t.format}))}}function vB(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];for(var o=0,r=e.length;o<r;o++)t?(mt(e[parseInt(o.toString(),10)],i.slice(),[]),e[parseInt(o.toString(),10)].setAttribute("aria-selected","true")):(mt(e[parseInt(o.toString(),10)],[],i.slice()),e[parseInt(o.toString(),10)].removeAttribute("aria-selected"))}function bB(e){for(var t={},i=[],n=0;n<e.length;n++)e[parseInt(n.toString(),10)]in t||(i.push(e[parseInt(n.toString(),10)].toString()),t[e[parseInt(n.toString(),10)]]=1);return i}function wB(e,t){var i=t.element.style.display,n=(t.element.style.display="block",t.width),o=R0(e,t.element),i=(t.element.style.display=i,t.element.style.top=o.top+e.getBoundingClientRect().height-5+"px",o.left-n+e.clientWidth);t.element.style.left=i<1?n+i-16+"px":i+-4+"px"}function CB(e,t){e.popup.element.style.zIndex=(t.zIndex+1).toString()}function SB(e,t,i,n,o,r){je(i.filterTemplate)&&(i="","string"===n?i="strui-"+t:"number"===n?i="numberui-"+t:"boolean"===n?i="bool-ui-"+t:"date"===n&&(i="dateui-"+t),n="in"===e||"notin"===e,t=A(o.element.querySelector("#multiselect"+i),"e-control-wrapper"),e=A(o.element.querySelector("#"+i),"e-popup-flmenu"),t&&(t.style.display=n?"inline-flex":"none"),e)&&(e.style.display=n?"none":"inline-flex")}function AB(e){var e=e.querySelector(".e-frame"),t=e.previousSibling;e.classList.contains("e-check")?(t.checked=!1,mt(e,["e-uncheck"],["e-check"])):(t.checked=!0,mt(e,["e-check"],["e-uncheck"]))}function xB(e,t){e.checked=t}function IB(e,t,i){i=Q("div",{className:i});return i.appendChild(t),i.setAttribute("uid",e),i}function TB(e,t){q([e],["e-check","e-stop","e-uncheck"]),t?e.classList.add("e-check"):e.classList.add("e-uncheck")}function EB(e,t,i){for(var n=0;n<(je(t)?0:t.length);n++)x(t[parseInt(n.toString(),10)].field,DB(t[parseInt(n.toString(),10)],i),e.foreignKeyData);for(var o=e.cells,n=0;n<o.length;n++)o[parseInt(n.toString(),10)].isForeignKey&&x("foreignKeyData",R(o[parseInt(n.toString(),10)].column.field,e.foreignKeyData),o[parseInt(n.toString(),10)])}function DB(e,t,i,n){var o=e.foreignKeyField,t=je(i)?kP(e.field,t):i,t=je(t)?"":t,i=new ya,n=n||(e.dataSource instanceof me&&e.dataSource.dataSource.json.length?e.dataSource.dataSource.json:e.columnData);return t.getDay?i.where(PB({field:o,operator:"equal",value:t,matchCase:!1})):i.where(o,"==",t,!1),new me(n).executeLocal(i)}function MB(t,e){var i;return e.some(function(e){return(i=e).foreignKeyValue===t})&&i}function kB(e){return e<10?"0"+e:String(e)}function PB(e,t,i){var n,o,r,s,a=Pe({},qP(e)),l=Pe({},qP(e));return je(e.value)||""===e.value?new ba(a.field,a.operator,a.value,!1):(n=new Date(e.value),s="dateonly"!==t||i?(e.operator=e.operator.toLowerCase(),"equal"===e.operator||"notequal"===e.operator?("datetime"===t?(o=new Date(n.setSeconds(n.getSeconds()-1)),r=new Date(n.setSeconds(n.getSeconds()+2)),e.value=new Date(n.setSeconds(r.getSeconds()-1))):(o=new Date(n.setHours(0)-1),r=new Date(n.setHours(24))),a.value=o,l.value=r,"equal"===e.operator?(a.operator="greaterthan",l.operator="lessthan"):"notequal"===e.operator&&(a.operator="lessthanorequal",l.operator="greaterthanorequal"),i=new ba(a.field,a.operator,a.value,!1),o=new ba(l.field,l.operator,l.value,!1),"equal"===e.operator?i.and(o):i.or(o)):("date"!==t||"lessthanorequal"!==e.operator&&"greaterthan"!==e.operator||(a.value=new Date(n.setHours(24)-1)),"string"==typeof a.value&&(a.value=new Date(a.value)),new ba(a.field,a.operator,a.value,!1))):("string"==typeof a.value&&(a.value=new Date(a.value)),r=a.value.getFullYear()+"-"+kB(a.value.getMonth()+1)+"-"+kB(a.value.getDate()),new ba(a.field,a.operator,r,!1)),e.setProperties?e.setProperties({ejpredicate:s},!0):e.ejpredicate=s,s)}function BB(e){return e.enableVirtualization&&0<e.groupSettings.columns.length&&e.isVirtualAdaptive&&!e.groupSettings.enableLazyLoading}function FB(e,t){if(e=void 0===e?"":e){for(var i,n=t,o=e.split("."),r=0;r<o.length&&!je(n);r++)ee(n=n[o[parseInt(r.toString(),10)]])&&(n=t[""+(i=o[parseInt(r.toString(),10)].charAt(0).toUpperCase()+o[parseInt(r.toString(),10)].slice(1))]||t[(""+i).charAt(0).toLowerCase()+(""+i).slice(1)]);return n}}function LB(e,t){var i=new Ti,t="date"===t?"object"==typeof e?i.getDatePattern({type:e.type||"date",format:e.format},!1):i.getDatePattern({type:"dateTime",skeleton:e},!1):"object"==typeof e?i.getDatePattern({type:e.type||"dateTime",format:e.format},!1):i.getDatePattern({type:"dateTime",skeleton:e},!1);return t}function RB(e,t){for(var i={},n=0,o=e.getRowsObject();n<o.length;n++){var r,s=o[n];!s.isExpand||s.isDetailRow||je(r=e.allowPaging&&"AllPages"===e.printMode?s.index+e.pageSettings.currentPage*e.pageSettings.pageSize-e.pageSettings.pageSize:s.index)||(i[parseInt(r.toString(),10)]={},i[parseInt(r.toString(),10)].isExpand=!0,e.childGrid&&(i[parseInt(r.toString(),10)].gridModel=OB(s.childGrid,t),i[parseInt(r.toString(),10)].gridModel.query=e.childGrid.query))}return i}function OB(e,t){void 0===t&&(t="Expanded");var i={};if(e){for(var n=0,o=EP.printGridProp;n<o.length;n++){var r=o[n];i[""+r]="columns"===r?XP(e[""+r]):"allowPaging"===r?"CurrentPage"===e.printMode:qP(e[""+r])}i.enableHover=!1,(e.childGrid||e.detailTemplate)&&"None"!==t&&(i.expandedRows=RB(e,t))}return i}function NB(e,t,i,n){var o=e||{},r=arguments.length;n&&(r-=1);for(var s=1;s<r;s++)if(arguments[parseInt(s.toString(),10)])for(var a=arguments[parseInt(s.toString(),10)],l=Object.keys(Object.getPrototypeOf(a)).length?Object.keys(a).concat(VB(a)):Object.keys(a),h=0;h<l.length;h++){var d=o[l[parseInt(h.toString(),10)]],p=a[l[parseInt(h.toString(),10)]],c=void 0;n&&(S(p)||Array.isArray(p))?S(p)?(c=d||{},o[l[parseInt(h.toString(),10)]]=Pe({},c,p,n)):(c=d||[],o[l[parseInt(h.toString(),10)]]=Pe([],c,p,n)):o[l[parseInt(h.toString(),10)]]=p}return o}function VB(e){for(var t=[];Object.getPrototypeOf(e)&&Object.keys(Object.getPrototypeOf(e)).length;)t=t.concat(Object.keys(Object.getPrototypeOf(e))),e=Object.getPrototypeOf(e);return t}function _B(e){for(var t=0,i=0;i<(je(e)?0:e.length);i++){var n=HB(e[parseInt(i.toString(),10)],0);t<n&&(t=n)}return t+1}function HB(e,t){var i=t,n=[];if(e.columns){t++;for(var o=0;o<e.columns.length;o++)n[parseInt(o.toString(),10)]=HB(e.columns[parseInt(o.toString(),10)],t);for(var r=0;r<n.length;r++)i<n[parseInt(r.toString(),10)]&&(i=n[parseInt(r.toString(),10)]);t=i}return t}function zB(e,t){for(var i=0;i<t.length;i++)t[parseInt(i.toString(),10)].uid=(t[parseInt(i.toString(),10)].isForeignKey?MB(t[parseInt(i.toString(),10)].field,e.getForeignKeyColumns()):e.enableColumnVirtualization?xF(e,t[parseInt(i.toString(),10)].field):e.getColumnByField(t[parseInt(i.toString(),10)].field)).uid}function jB(e){e=document.defaultView.getComputedStyle(e,null).getPropertyValue("transform").replace(/,/g,"");return{width:parseFloat(e.split(" ")[4]),height:parseFloat(e.split(" ")[5])}}function WB(e,t){e.classList.contains("e-bigger")&&t.classList.add("e-bigger")}function QB(e){e=e.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?aB():0}function UB(e,t){for(var i=0,n=e.getColumns(),o=30*t,r=(e.isRowDragable()&&(i++,o+=30),i+=e.groupSettings.columns.length-t,o+=30*(e.groupSettings.columns.length-t),("auto"===e.width?e.element.offsetWidth:-1!==e.width.toString().indexOf("%")?e.element.getBoundingClientRect().width:parseInt(e.width.toString(),10))-QB(e)),s=0;s<n.length;s++)if(n[parseInt(s.toString(),10)].visible&&(o+=parseInt(n[parseInt(s.toString(),10)].width.toString(),10),i++),r<o){i--;break}return i}function qB(e,t){for(var i=0,n=0,o=t.getVisibleFrozenLeftCount(),r=0;r<e.childNodes.length;r++){var s,a=e.childNodes[parseInt(r.toString(),10)];if(o===n)break;if((a.classList.contains("e-groupcaption")||a.classList.contains("e-summarycell"))&&(n+=parseInt(a.getAttribute("colspan"),10)),a.classList.add("e-leftfreeze"),a.classList.contains("e-groupcaption")&&1===parseInt(a.getAttribute("colspan"),10)&&a.classList.add("e-freezeleftborder"),dF(a,i,t.enableRtl,"Left"),(a.classList.contains("e-indentcell")||a.classList.contains("e-recordplusexpand")||a.classList.contains("e-recordpluscollapse"))&&(i+=30),a.classList.contains("e-groupcaption"))for(var l=parseInt(a.getAttribute("colspan"),10),h=(t.isRowDragable()&&(l--,i+=30),l-=t.groupSettings.columns.length-r,i+=30*(t.groupSettings.columns.length-r),t.getColumns()),d=0;d<h.length;d++){if(1<parseInt(a.getAttribute("colspan"),10)&&parseInt(h[parseInt(d.toString(),10)].width.toString(),10)+i>parseInt(t.width.toString(),10)-QB(t)){var p=UB(t,r);a.setAttribute("colspan",p.toString());break}if(h[parseInt(d.toString(),10)].visible&&(i+=parseInt(h[parseInt(d.toString(),10)].width.toString(),10),l--),0===l)break}a.classList.contains("e-summarycell")&&(s=a.getAttribute("e-mappinguid"),s=t.getColumnByUid(s),i+=parseInt(s.width.toString(),10))}}function GB(e,t){var i=t.getContent().firstElementChild;return e&&e.getBoundingClientRect().top-i.getBoundingClientRect().top+t.getRowHeight()>i.offsetHeight}function YB(e,t){return e&&e.getBoundingClientRect().top<t}function XB(e,t){var i=t.getRowHeight(),n=t.getContent().firstElementChild.scrollTop/i;return e<n+t.getContent().firstElementChild.offsetHeight/i&&n<e}function KB(e,i){var n,o=e.getPrimaryKeyFieldNames()[0];return e.getCurrentViewRecords().filter(function(e,t){o.includes(".")?FB(o,e)===FB(o,i)&&(n=t):e[""+o]===i[""+o]&&(n=t)}),n}function JB(e,t){var t=ZB(t),i=new ll;return t.dataSource=i.resolve,t.action=e,{state:t,deffered:i}}function ZB(e){var t=new Ba,i=new me({url:"",adaptor:new Ba}),t=t.processQuery(i,e);return JSON.parse(t.data)}function $B(e){for(var t=e.getVisibleColumns(),i=0,n=0,o=0;o<t.length;o++)ee(t[parseInt(o.toString(),10)].width)?n++:-1!==t[parseInt(o.toString(),10)].width.toString().indexOf("%")&&i++;return("auto"===e.width||"string"==typeof e.width&&-1!==e.width.indexOf("%"))&&!e.groupSettings.showGroupedColumn&&e.groupSettings.columns.length&&i&&!n}function eF(e,t,i,n,o){for(var r=n||0,s=o||0;s<t.length;s++)if(t[parseInt(s.toString(),10)]&&t[parseInt(s.toString(),10)].isDataRow){t[parseInt(s.toString(),10)].index=r,t[parseInt(s.toString(),10)].isAltRow=!!e.enableAltRow&&r%2!=0,i[parseInt(s.toString(),10)].setAttribute(nD,(r+1).toString()),t[parseInt(s.toString(),10)].isAltRow?i[parseInt(s.toString(),10)].classList.add("e-altrow"):i[parseInt(s.toString(),10)].classList.remove("e-altrow");for(var a=0;a<i[parseInt(s.toString(),10)].cells.length;a++)i[parseInt(s.toString(),10)].cells[parseInt(a.toString(),10)].setAttribute("index",r.toString());r++}t.length||e.renderModule.emptyRow(!0)}function tF(e){for(var t=e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache?e.getRowsObject():e.vRows,i=e.getRows(),n=0,o=0,r=0;n<t.length;n++){var s=t[parseInt(n.toString(),10)];if(s.isDataRow){s.index=o,s.isAltRow=!!e.enableAltRow&&o%2!=0;var a=e.getRowElementByUID(s.uid);if(!je(a)){(i[parseInt(r.toString(),10)]=a).setAttribute(nD,(o+1).toString()),s.isAltRow?a.classList.add("e-altrow"):a.classList.remove("e-altrow");for(var l=0;l<a.cells.length;l++)a.cells[parseInt(l.toString(),10)].setAttribute("index",o.toString());r++}o++}}e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache&&e.infiniteScrollModule.resetInfiniteCache(t)}function iF(e,t,i,n){for(var o,r=e.enableVirtualization?e.vRows:e.getRowsObject(),s=[],a=n||e.getRowObjectFromUID(t.target.closest("tr").getAttribute("data-uid")),l=0;l<t.rows.length;l++){var h=e.getRowObjectFromUID(t.rows[parseInt(l.toString(),10)].getAttribute("data-uid"));a===h&&(o=r.indexOf(a)),s.push(r.splice(r.indexOf(h),1)[0])}if(!je(o)||(o=r.indexOf(a),t.fromIndex>t.dropIndex)?r.splice.apply(r,[o,0].concat(s)):r.splice.apply(r,[o+1,0].concat(s)),!e.enableVirtualization&&!e.infiniteScrollSettings.enableCache){for(var d={},p=e.getCurrentViewRecords(),l=0,c=i.length;l<c;l++){var u=parseInt(i[parseInt(l.toString(),10)].getAttribute(nD),10)-1;d[parseInt(l.toString(),10)]=p[parseInt(u.toString(),10)]}for(var g=e.getRows(),l=0,c=i.length;l<c;l++)g[parseInt(l.toString(),10)]=i[parseInt(l.toString(),10)],p[parseInt(l.toString(),10)]=d[parseInt(l.toString(),10)]}e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache&&e.infiniteScrollModule.resetInfiniteCache(r)}function nF(e,t,i,n){var o=e.dataToBeUpdated[""+i].concat(t[""+i]).reduce(function(e,t){return e[t[""+n]]=void 0===e[t[""+n]]?t:Object.assign(e[t[""+n]],t),e},{});e.dataToBeUpdated[""+i]=Object.keys(o).map(function(e){return o[""+e]})}function oF(e){e.enableInfiniteScrolling&&(e.childGrid||e.detailTemplate)?e.contentModule.rowElements=[].slice.call(e.getContentTable().rows).filter(function(e){return(e.classList.contains("e-row")||e.classList.contains("e-detailrow"))&&!e.classList.contains("e-addedrow")}):e.contentModule.rowElements=[].slice.call(e.element.querySelectorAll(".e-row:not(.e-addedrow):not(.e-cloneproperties .e-row)"))}function rF(e,t){var i=e.createElement("div",{className:"e-grid-popup",id:e.element.id+"_e-popup"}),n=O0(e.element,"left","Top"),n=((i=document.getElementById(e.element.id+"_e-popup")?document.getElementById(e.element.id+"_e-popup"):i).style.top=n.top+"px",i.style.left=n.left+"px",i.style.zIndex=t.zIndex.toString(),i.style.width=t.element.offsetWidth+"px",i.appendChild(t.element),A(e.element,"sb-demo-section")||A(e.element,"e-grid-dialog-fixed"));n?(t=R0(e.element,n),i.style.top=t.top+"px",i.style.left=t.left+"px",n.insertBefore(i,n.firstChild)):document.body.insertBefore(i,document.body.firstChild)}function sF(e,t){var i=[];return i.push(e.uid),aF(e,i),-1<i.indexOf(t)}function aF(e,t){for(var i=0;i<e.columns.length;i++)e.columns[parseInt(i.toString(),10)].uid&&t.push(e.columns[parseInt(i.toString(),10)].uid),e.columns[parseInt(i.toString(),10)].columns&&e.columns[parseInt(i.toString(),10)].columns.length&&aF(e.columns[parseInt(i.toString(),10)],t)}function lF(e){return e.columns[0].freeze||e.columns[0].isFrozen?"Left"===e.columns[0].freeze||e.columns[0].isFrozen?"Left":"Right"===e.columns[0].freeze?"Right":"Fixed"===e.columns[0].freeze?"Fixed":"None":e.columns[0].columns&&e.columns[0].columns.length?lF(e.columns[0]):"None"}function hF(e){if(e.querySelector(".e-fixedfreeze"))for(var t=[].slice.call(e.querySelectorAll(".e-filterbarcell:not(.e-hide),.e-summarycell:not(.e-hide),.e-headercell:not(.e-hide),.e-rowcell:not(.e-hide)")),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].classList.contains("e-fixedfreeze")&&(!t[i-1]||t[i-1]&&!t[i-1].classList.contains("e-fixedfreeze"))&&t[parseInt(i.toString(),10)].classList.add("e-freezeleftborder"),t[parseInt(i.toString(),10)].classList.contains("e-fixedfreeze")&&(!t[i+1]||t[i+1]&&!t[i+1].classList.contains("e-fixedfreeze"))&&t[parseInt(i.toString(),10)].classList.add("e-freezerightborder")}function dF(e,t,i,n){"Left"===n&&(i?e.style.right=t+"px":e.style.left=t+"px"),"Right"===n&&(i?e.style.left=t+"px":e.style.right=t+"px")}function pF(e,t,i,n){var o=e.getColumns(),r=t.index;if("Left"===t.freeze&&"Left"!==t.border){for(var s=r+(n-1);!1===o[parseInt(s.toString(),10)].visible;)s++;"Left"===o[parseInt(s.toString(),10)].border&&i.classList.add("e-freezeleftborder")}else if("Right"===t.freeze||"Fixed"===t.freeze){for(var a=0,l=r+1;l<r+n&&l!==o.length;l++)o[parseInt(l.toString(),10)].visible?a+=parseInt(o[parseInt(l.toString(),10)].width.toString(),10):n++;e.enableRtl?i.style.left=parseInt(i.style.left,10)-a+"px":i.style.right=parseInt(i.style.right,10)-a+"px"}}function cF(e,t,i){for(var n=e.getRowByIndex(t),o=0;o<n.cells.length;o++)if(parseInt(n.cells[parseInt(o.toString(),10)].getAttribute("aria-colindex").toString(),10)-1===i)return n.cells[parseInt(o.toString(),10)];return null}function uF(e,t,i){if("Left"===t.freeze||t.isFrozen)if(i.classList.add("e-leftfreeze"),"Left"===t.border&&i.classList.add("e-freezeleftborder"),0===t.index)dF(i,30*e.getIndentCount(),e.enableRtl,"Left"),e.enableColumnVirtualization&&(t.valueX=30*e.getIndentCount());else{for(var n=e.getColumns(),o=30*e.getIndentCount(),r=0;r<n.length&&t.uid!==n[parseInt(r.toString(),10)].uid;r++)n[parseInt(r.toString(),10)].visible&&(o+=parseFloat(n[parseInt(r.toString(),10)].width.toString()));dF(i,o,e.enableRtl,"Left"),e.enableColumnVirtualization&&(t.valueX=o)}else if("Right"===t.freeze){i.classList.add("e-rightfreeze");n=e.getColumns();if("Right"===t.border&&i.classList.add("e-freezerightborder"),t.index===n[n.length-1].index)dF(i,o="Right"===e.getFrozenMode()&&e.isRowDragable()?30:0,e.enableRtl,"Right");else{for(o="Right"===e.getFrozenMode()&&e.isRowDragable()?30:0,r=n.length-1;0<=r&&t.uid!==n[parseInt(r.toString(),10)].uid;r--)n[parseInt(r.toString(),10)].visible&&(o+=parseFloat(n[parseInt(r.toString(),10)].width.toString()));dF(i,o,e.enableRtl,"Right")}e.enableColumnVirtualization&&(t.valueX=o)}else if("Fixed"===t.freeze){i.classList.add("e-fixedfreeze");n=e.getColumns(),o=0;e.getVisibleFrozenLeftCount()?o=30*e.getIndentCount():"Right"===e.getFrozenMode()&&(o=30*e.groupSettings.columns.length);for(r=0;r<n.length&&t.uid!==n[parseInt(r.toString(),10)].uid;r++)("Left"===n[parseInt(r.toString(),10)].freeze||n[parseInt(r.toString(),10)].isFrozen||"Fixed"===n[parseInt(r.toString(),10)].freeze)&&n[parseInt(r.toString(),10)].visible&&(o+=parseFloat(n[parseInt(r.toString(),10)].width.toString()));dF(i,o-1,e.enableRtl,"Left"),o="Right"===e.getFrozenMode()&&e.isRowDragable()?30:0;for(r=n.length-1;0<=r&&t.uid!==n[parseInt(r.toString(),10)].uid;r--)"Right"!==n[parseInt(r.toString(),10)].freeze&&"Fixed"!==n[parseInt(r.toString(),10)].freeze||n[parseInt(r.toString(),10)].visible&&(o+=parseFloat(n[parseInt(r.toString(),10)].width.toString()));dF(i,o-1,e.enableRtl,"Right")}else i.classList.add("e-unfreeze")}function gF(e,t,i){return[].slice.call(e.getDataRows()[parseInt(i.toString(),10)].getElementsByClassName(LE))}function mF(e,t,i,n){return gF(e,0,i)[parseInt(n.toString(),10)]}function fF(e,t,i,n,o,r,s){s||e.getFreezeTableName()===tD||!t&&e.getFreezeTableName()===eD||1===r?i[dB(e.field)]=e.validationRules:"movable"!==e.getFreezeTableName()&&e.getFreezeTableName()?e.getFreezeTableName()===eD&&(o[dB(e.field)]=e.validationRules):n[dB(e.field)]=e.validationRules}function yF(t,i,n,e){var o,r,s=new Ti;if("number"===i)try{r=s.getNumberPattern({format:t,currency:e,useGrouping:!0},!0)}catch(e){r=t}else if("date"===i||"time"===i||"datetime"===i)try{if(je(r=s.getDatePattern({skeleton:t,type:i},n)))throw"error"}catch(e){try{r=s.getDatePattern({format:t,type:i},n)}catch(e){r=t}}else r=t;return"number"!==i&&(o={G:"",H:"h",c:"d","'":'"'," a":" AM/PM",yy:"yy",y:"yyyy",EEEE:"dddd",E:"ddd"},r=r.replace(/G|H|c|'| a|yy|y|EEEE|E/g,function(e){return o[""+e]})),r}function vF(e){if(e.enableAdaptiveUI)for(var t=document.getElementsByClassName("e-responsive-dialog"),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].classList.add("e-bigger")}function bF(e,t){for(var i,n=e.split(".").length,o=e.split("."),r=t,s=0;s<n;s++)r=i=r[o[parseInt(s.toString(),10)]];return i}function wF(e,t,i,n,o,r){for(var s=Object.keys(e),a=t,l=0;l<s.length;l++){var h=e[s[parseInt(l.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)];if(o&&!o.isFrozenGrid()&&!o.isRowDragable()){if(h=!je(h)&&(parseInt(h.getAttribute("aria-colindex"),10)-1===t||A(h,"e-addedrow")&&h.parentElement.childNodes[parseInt(t.toString(),10)]===h)?h:e[parseInt(l.toString(),10)].querySelector('td[aria-colindex="'+(t+1)+'"]'),je(h))continue;t=o.getContentTable().querySelector(".e-detailrowcollapse, .e-detailrowexpand")?h.cellIndex-1:h.cellIndex}e[s[parseInt(l.toString(),10)]].querySelectorAll("td.e-rowcell").length&&h&&(gt(e[s[parseInt(l.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)],{display:i}),e[s[parseInt(l.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)].classList.contains("e-hide")&&q([e[s[parseInt(l.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)]],["e-hide"]),r&&o.isRowDragable()||o&&o.isDetail()?(h=t+1,n[s[parseInt(l.toString(),10)]].cells[parseInt(h.toString(),10)].visible=""===i):je(n[s[parseInt(l.toString(),10)]])||(n[s[parseInt(l.toString(),10)]].cells[parseInt(t.toString(),10)].visible=""===i,!1===n[s[parseInt(l.toString(),10)]].cells[parseInt(t.toString(),10)].visible&&e[s[parseInt(l.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)].classList.add("e-hide")),t=a)}}function CF(e,t,i,n){for(var o=0,r=t;o<r.length;o++){var s=r[o];i?e.on(s.event,s.handler,n):e.off(s.event,s.handler)}}function SF(e,t,i,n){var o=dB(t.field);return n=Object.assign(n,{id:e.element.id+o,name:o,"e-mappinguid":t.uid}),e.createElement("input",{className:i,attrs:n})}function AF(e,t){for(var i,n=0,o=e.columnModel;n<o.length;n++){var r=o[n];if(r.uid===t){i=r;break}}return i}function xF(e,t){var i;e.columnModel||e.getColumns();for(var n=0,o=e.columnModel;n<o.length;n++){var r=o[n];if(r.field===t){i=r;break}}return i}function IF(e,t,i,n){n.eventHandlers[""+e]={};for(var o=0;o<t.length;o++)n.eventHandlers[""+e][t[parseInt(o.toString(),10)]]=i[t[parseInt(o.toString(),10)]]}function TF(e,t,i){for(var n=0;n<t.length&&!e.isDestroyed;n++)e.removeEventListener(t[parseInt(n.toString(),10)],i.eventHandlers[e.element.id][t[parseInt(n.toString(),10)]])}function EF(e,t){e.destroyTemplate(t),e.isReact&&e.renderTemplates()}function DF(e){for(var t=0;t<e.length;t++)ue(e[t])}function MF(e,t){for(var i=0;i<e.length;i++)t.insertBefore(e[i],t.children[i])}function kF(e,t){var i=t?Q("li",{className:"e-cclist"}):Q("div",{className:"e-ftrchk"}),t=(i.style.visibility="hidden",t&&(i.style.listStyle="none"),i.innerHTML=t?'<div class="e-ccheck"><div class="e-checkbox-wrapper"><span class="e-frame e-icons e-check"></span><span class="e-label">A</span></div></div>':'<div class="e-checkbox-wrapper"><span class="e-frame e-icons e-check"></span><span class="e-label e-checkboxfiltertext">A</div></span>',e.appendChild(i),i.getBoundingClientRect());return e.removeChild(i),Math.round(t.height)}function PF(e){return parseInt(e.getAttribute(nD),10)-1}function BF(e){return e.parentDetails&&e.parentDetails.parentInstObj?BF(e.parentDetails.parentInstObj):e}function FF(e,t,i){for(var n=[],o=0;o<e.length;o++){var r=i.parent.getColumnByField(e[parseInt(o.toString(),10)]),s="null"===t[parseInt(o.toString(),10)]?null:t[parseInt(o.toString(),10)],r={field:e[parseInt(o.toString(),10)],predicate:"or",uid:r.uid,operator:"equal",type:r.type,matchCase:i.allowCaseSensitive,ignoreAccent:i.parent.filterSettings.ignoreAccent};""===s||je(s)?n=n.concat(B_.generateNullValuePredicates(r)):n.push(jP({},{value:s},r))}return B_.getPredicate(n)}function LF(e){for(var t=[],i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];t.push(e[""+o])}return t}function RF(e,t){for(var i=[],n=[],o=e;0<=o&&(!t[parseInt(o.toString(),10)].isCaptionRow||-1!==i.indexOf(t[parseInt(o.toString(),10)].data.field)||!(t[parseInt(o.toString(),10)].indent<t[parseInt(e.toString(),10)].indent||o===e)||(i.push(t[parseInt(o.toString(),10)].data.field),n.push(t[parseInt(o.toString(),10)].data.key),0!==t[parseInt(o.toString(),10)].indent));o--);return{fields:i,keys:n}}function OF(e,t,i){var n=e,o=t,r=!1;if(i)for(var s=o[0];s<n.length;s++)for(var a=n[parseInt(s.toString(),10)],l=0;l<a.length;l++){if(r&&1===n[parseInt(s.toString(),10)][parseInt(l.toString(),10)])return o=[s,l];r||o.toString()!==[s,l].toString()||(r=!0)}else for(s=o[0];0<=s;s--)for(l=(a=n[parseInt(s.toString(),10)]).length-1;0<=l;l--){if(r&&1===n[parseInt(s.toString(),10)][parseInt(l.toString(),10)])return o=[s,l];r||o.toString()!==[s,l].toString()||(r=!0)}return o}function NF(e){return e.charAt(0).toUpperCase()+e.slice(1)}function VF(e){return!(BB(e)||e.groupSettings.enableLazyLoading||!e.enableVirtualization&&e.enableColumnVirtualization)}function _F(e){for(var t=[],i=0;i<e.length;i++){var n=Math.ceil(e[parseInt(i.toString(),10)]/2);-1===t.indexOf(n)&&t.push(n)}return t}(rB=rB||{}).timer=null;var HF,zF,jF,WF={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",FLOATTEXTCONTENT:"e-float-text-content",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"},QF=["title","style","class"],UF="e-input-focus";function qF(i){GF(i.floatLabelType,i.element);function e(){var e,t;((t=nL((e=i).element)).classList.contains("e-input-group")||t.classList.contains("e-outline")||t.classList.contains("e-filled"))&&t.classList.add("e-input-focus"),"Never"!==e.floatLabelType&&setTimeout(function(){zF.calculateWidth(e.element,t)},80)}function t(){var e,t;((t=nL((e=i).element)).classList.contains("e-input-group")||t.classList.contains("e-outline")||t.classList.contains("e-filled"))&&t.classList.remove("e-input-focus"),"Never"!==e.floatLabelType&&setTimeout(function(){zF.calculateWidth(e.element,t)},80)}function n(){GF(i.floatLabelType,i.element)}i.element.addEventListener("focus",e),i.element.addEventListener("blur",t),i.element.addEventListener("input",n),i.element.__eventHandlers.inputFocusHandler={focusHandler:e},i.element.__eventHandlers.inputBlurHandler={blurHandler:t},i.element.__eventHandlers.inputHandler={inputHandler:n}}function GF(e,t){var i=t.value,t=t.parentElement,n=t&&t.parentElement;""===i||je(i)?"Always"!==e&&(t&&t.classList.contains("e-input-group")?t.classList.remove("e-valid-input"):n&&n.classList.contains("e-input-group")&&n.classList.remove("e-valid-input")):t&&t.classList.contains("e-input-group")?t.classList.add("e-valid-input"):n&&n.classList.contains("e-input-group")&&n.classList.add("e-valid-input")}function YF(){var e=nL(this).getElementsByClassName("e-float-text")[0];je(e)||(U([e],WF.LABELTOP),e.classList.contains(WF.LABELBOTTOM)&&q([e],WF.LABELBOTTOM))}function XF(){var e=nL(this);(e.getElementsByTagName("textarea")[0]?""!==e.getElementsByTagName("textarea")[0].value:""!==e.getElementsByTagName("input")[0].value)||je(e=e.getElementsByClassName("e-float-text")[0])||(e.classList.contains(WF.LABELTOP)&&q([e],WF.LABELTOP),U([e],WF.LABELBOTTOM))}function KF(e){e.addEventListener("focus",YF),e.addEventListener("blur",XF)}function JF(e){je(e)||(e.removeEventListener("focus",YF),e.removeEventListener("blur",XF))}function ZF(e,t,i){var n,i=je(i)?Q:i,o=("Auto"===e.floatLabelType&&KF(e.element),je(t.container)?(t.container=sL(e,WF.FLOATINPUT,WF.FLOATCUSTOMTAG,"div",i),t.container.classList.add(WF.INPUTGROUP),e.element.parentNode&&e.element.parentNode.insertBefore(t.container,e.element)):(je(e.customTag)||t.container.classList.add(WF.FLOATCUSTOMTAG),t.container.classList.add(WF.FLOATINPUT)),i("span",{className:WF.FLOATLINE})),i=i("label",{className:WF.FLOATTEXT});je(e.element.id)||""===e.element.id||(i.id="label_"+e.element.id.replace(/ /g,"_"),pt(e.element,{"aria-labelledby":i.id})),je(e.element.placeholder)||""===e.element.placeholder||(i.innerText=aL(e.element.placeholder),e.element.removeAttribute("placeholder")),je(e.properties)||je(e.properties.placeholder)||""===e.properties.placeholder||(i.innerText=aL(e.properties.placeholder)),i.innerText||t.container.classList.add(WF.NOFLOATLABEL),(t.container.classList.contains("e-float-icon-left")?((n=t.container.querySelector(".e-input-in-wrap")).appendChild(e.element),n.appendChild(o),n):(t.container.appendChild(e.element),t.container.appendChild(o),t.container)).appendChild(i),iL(e.element.value,i),"Always"===e.floatLabelType&&(i.classList.contains(WF.LABELBOTTOM)&&q([i],WF.LABELBOTTOM),U([i],WF.LABELTOP)),"Auto"===e.floatLabelType?(n=function(){rL(e.element,e.floatLabelType)},e.element.addEventListener("input",o=function(){rL(e.element,e.floatLabelType)}),e.element.addEventListener("blur",n),e.element.__eventHandlers.floatInputHandler={inputFloatHandler:o},e.element.__eventHandlers.floatBlurHandler={blurFloatHandler:n}):$F(e),je(e.element.getAttribute("id"))||i.setAttribute("for",e.element.getAttribute("id"))}function $F(e){var t,i;je(e.element)||je(e.element.__eventHandlers)||je(e.element.__eventHandlers.floatInputHandler)||je(e.element.__eventHandlers.floatBlurHandler)||(t=e.element.__eventHandlers.floatInputHandler.inputFloatHandler,i=e.element.__eventHandlers.floatBlurHandler.blurFloatHandler,e.element.removeEventListener("input",t),e.element.removeEventListener("blur",i),delete e.element.__eventHandlers.floatInputHandler,delete e.element.__eventHandlers.floatBlurHandler)}function eL(e,t){"Always"===e&&t.classList.contains("e-outline")&&t.classList.add("e-valid-input")}function tL(e,t,i){je(t)||(e&&!i?q:U)([t],WF.CLEARICONHIDE)}function iL(e,t,i){void 0===i&&(i=null),e?(U([t],WF.LABELTOP),t.classList.contains(WF.LABELBOTTOM)&&q([t],WF.LABELBOTTOM)):null!=i&&i===document.activeElement||(t.classList.contains(WF.LABELTOP)&&q([t],WF.LABELTOP),U([t],WF.LABELBOTTOM))}function nL(e){e=je(e.parentNode)?e:e.parentNode;return e=e&&e.classList.contains("e-input-in-wrap")?e.parentNode:e}function oL(n,o,e){function t(){tL(n.value,o)}function i(){tL(n.value,o,n.readOnly)}function r(){var e,t;e=n,t=o,setTimeout(function(){je(t)||(U([t],WF.CLEARICONHIDE),t=!je(e)&&e.classList.contains("e-combobox")?null:t)},200)}var s;void 0!==jF&&!jF||(o.addEventListener("click",s=function(e){var t,i;e=e,i=o,(t=n).classList.contains(WF.DISABLE)||t.readOnly||(e.preventDefault(),t!==document.activeElement&&t.focus(),t.value="",U([i],WF.CLEARICONHIDE))}),n.__eventHandlers.clearClickHandler={clickHandlerEvent:s});n.addEventListener("input",t),n.addEventListener("focus",i),n.addEventListener("blur",r),n.__eventHandlers.clearInputHandler={inputHandlerEvent:t},n.__eventHandlers.clearFocusHandler={focusHandlerEvent:i},n.__eventHandlers.clearBlurHandler={blurHandlerEvent:r}}function rL(e,t){nL(e).classList.contains(WF.FLOATINPUT)&&"Auto"===t&&(t=nL(e).getElementsByClassName("e-float-text")[0],iL(e.value,t,e))}function sL(e,t,i,n,o){var r,o=je(o)?Q:o;return je(e.customTag)?r=o(n,{className:t}):(r=o(e.customTag,{className:t})).classList.add(i),r.classList.add("e-control-wrapper"),r}function aL(e){var t,i="";return je(e)||""===e||((t=document.createElement("span")).innerHTML='<input  placeholder="'+e+'"/>',i=t.children[0].placeholder),i}function lL(e,t,i){je(i)||""===i||q(t,i.split(" ")),je(e)||""===e||U(t,e.split(" "))}function hL(e,t,i){("multiselect"===i||function(e){if(!e)return;var t=e;for(;t&&t!==document.body;){if("none"===window.getComputedStyle(t).display)return;t=t.parentElement}return 1}(e))&&(i="multiselect"===i?e:e.clientWidth-parseInt(getComputedStyle(e,null).getPropertyValue("padding-left"),10),!je(t))&&!je(t.getElementsByClassName("e-float-text-content")[0])&&(t.getElementsByClassName("e-float-text-content")[0].classList.contains("e-float-text-overflow")&&t.getElementsByClassName("e-float-text-content")[0].classList.remove("e-float-text-overflow"),i<t.getElementsByClassName("e-float-text-content")[0].clientWidth||i===t.getElementsByClassName("e-float-text-content")[0].clientWidth)&&t.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow")}function dL(e,t){e=aL(e);var i,n=nL(t);n.classList.contains(WF.FLOATINPUT)?je(e)||""===e?(n.classList.add(WF.NOFLOATLABEL),(i=n.getElementsByClassName("e-float-text-content")[0])?i.children[0].textContent="":n.getElementsByClassName(WF.FLOATTEXT)[0].textContent=""):((i=n.getElementsByClassName("e-float-text-content")[0])&&i.children[0]?i.children[0].textContent=e:n.getElementsByClassName(WF.FLOATTEXT)[0].textContent=e,n.classList.remove(WF.NOFLOATLABEL),t.removeAttribute("placeholder")):je(e)||""===e?t.removeAttribute("placeholder"):pt(t,{placeholder:e})}function pL(e,t,i){e?pt(t,{readonly:""}):t.removeAttribute("readonly"),je(i)||rL(t,i)}function cL(e,t){(e?U:q)(t,WF.RTL)}function uL(e,t,i,n){var o={disabled:"","aria-disabled":"true"},r=!je(n);e?(t.classList.remove(WF.DISABLE),mL(o,t),r&&q([n],WF.DISABLE)):(t.classList.add(WF.DISABLE),fL(o,t),r&&U([n],WF.DISABLE)),je(i)||rL(t,i)}function gL(e,t,i,n,o){var r,o=je(o)?Q:o;e?i.clearButton=(e=t,t=i,n=n,o=(je(o=o)?Q:o)("span",{className:WF.CLEARICON}),r=t.container,je(n)?(t.container.classList.contains(WF.FLOATINPUT)?t.container.querySelector("."+WF.FLOATTEXT):e).insertAdjacentElement("afterend",o):r.appendChild(o),U([o],WF.CLEARICONHIDE),oL(e,o),o.setAttribute("aria-label","close"),o):(ue(i.clearButton),i.clearButton=null)}function mL(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i],r=nL(t);"disabled"===o&&t.classList.remove(WF.DISABLE),"disabled"===o&&r.classList.contains(WF.INPUTGROUP)&&r.classList.remove(WF.DISABLE),"placeholder"===o&&r.classList.contains(WF.FLOATINPUT)?r.getElementsByClassName(WF.FLOATTEXT)[0].textContent="":t.removeAttribute(o)}}function fL(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i],r=nL(t);"disabled"===o&&t.classList.add(WF.DISABLE),"disabled"===o&&r.classList.contains(WF.INPUTGROUP)&&r.classList.add(WF.DISABLE),"placeholder"===o&&r.classList.contains(WF.FLOATINPUT)?r.getElementsByClassName(WF.FLOATTEXT)[0].textContent=e[""+o]:t.setAttribute(o,e[""+o])}}function yL(e,t){e.classList.contains("e-outline")&&e.getElementsByClassName("e-float-text")[0]&&((t=t("span",{className:WF.FLOATTEXTCONTENT})).innerHTML=e.getElementsByClassName("e-float-text")[0].innerHTML,e.getElementsByClassName("e-float-text")[0].innerHTML="",e.getElementsByClassName("e-float-text")[0].appendChild(t))}function vL(e,t,i){var n=[],o=(n.push(i),je(i)?t.querySelectorAll(".e-input-group-icon"):n);if(e&&0<o.length)for(var r=0;r<o.length;r++)o[parseInt(r.toString(),10)].addEventListener("mousedown",bL,!1),o[parseInt(r.toString(),10)].addEventListener("mouseup",wL,!1);else if(0<o.length)for(r=0;r<o.length;r++)o[parseInt(r.toString(),10)].removeEventListener("mousedown",bL,this),o[parseInt(r.toString(),10)].removeEventListener("mouseup",wL,this)}function bL(){for(var e,t,i=this.parentElement;!i.classList.contains("e-input-group");)i=i.parentElement;t=this,(e=i).classList.contains("e-disabled")||e.querySelector("input").readOnly||t.classList.add("e-input-btn-ripple")}function wL(){var e=this;setTimeout(function(){e.classList.remove("e-input-btn-ripple")},500)}function CL(e,t){t=t("span",{className:e});return t.classList.add("e-input-group-icon"),t}function SL(e,t,i,n){var n=je(n)?Q:n,e=CL(e,n),o=(t.classList.add("e-float-icon-left"),t.querySelector(".e-input-in-wrap"));if(je(o)){o=n("span",{className:"e-input-in-wrap"}),i.parentNode.insertBefore(o,i);var r=t.querySelectorAll(i.tagName+" ~ *");o.appendChild(i);for(var s=0;s<r.length;s++){var a=r[parseInt(s.toString(),10)],l=o.parentElement;a.classList.contains("e-float-line")&&(l&&l.classList.contains("e-filled")||!l)||o.appendChild(a)}}return o.parentNode.insertBefore(e,o),vL(!0,t,e),e}function AL(e,t,i){e=CL(e,je(i)?Q:i);return(t.classList.contains("e-float-icon-left")?t.querySelector(".e-input-in-wrap"):t).appendChild(e),vL(!0,t,e),e}function xL(e,t){"hidden"===t.type?e.classList.add("e-hidden"):e.classList.contains("e-hidden")&&e.classList.remove("e-hidden")}function IL(e){return je(e)||""===e?e:e.replace(/\s+/g," ").trim()}zF=HF=HF||{},jF=!0,zF.createInput=function(e,t){e.element.__eventHandlers={};var i=je(t)?Q:t,n={container:null,buttons:[],clearButton:null};if(e.floatLabelType,jF=e.bindClearAction,je(e.floatLabelType)||"Never"===e.floatLabelType?(n.container=sL(e,WF.INPUTGROUP,WF.INPUTCUSTOMTAG,"span",i),e.element.parentNode.insertBefore(n.container,e.element),U([e.element],WF.INPUT),n.container.appendChild(e.element)):ZF(e,n,i),qF(e),je(e.properties)||je(e.properties.showClearButton)||!e.properties.showClearButton||(gL(e.properties.showClearButton,e.element,n,!0,i),n.clearButton.setAttribute("role","button"),n.container.classList.contains(WF.FLOATINPUT)&&U([n.container],WF.INPUTGROUP)),!je(e.buttons))for(var o=0;o<e.buttons.length;o++)n.buttons.push(AL(e.buttons[o],n.container,i));return je(e.element)||"TEXTAREA"!==e.element.tagName||U([n.container],WF.TEXTAREA),xL(n.container,e.element),yL((n=function(e,t){if(!je(e.properties))for(var i=0,n=Object.keys(e.properties);i<n.length;i++)switch(n[i]){case"cssClass":lL(e.properties.cssClass,[t.container]),eL(e.floatLabelType,t.container);break;case"enabled":uL(e.properties.enabled,e.element,e.floatLabelType,t.container);break;case"enableRtl":cL(e.properties.enableRtl,[t.container]);break;case"placeholder":dL(e.properties.placeholder,e.element);break;case"readonly":pL(e.properties.readonly,e.element)}return t}(e,n)).container,i),n},zF.bindInitialEvent=qF,zF.wireFloatingEvents=KF,zF.wireClearBtnEvents=oL,zF.destroy=function(e,t){var i,n,o,r,s;void 0===t&&(t=null),je((i=e).element)||je(i.element.__eventHandlers)||je(i.element.__eventHandlers.inputFocusHandler)||je(i.element.__eventHandlers.inputBlurHandler)||je(i.element.__eventHandlers.inputHandler)||(n=i.element.__eventHandlers.inputFocusHandler.focusHandler,o=i.element.__eventHandlers.inputBlurHandler.blurHandler,s=i.element.__eventHandlers.inputHandler.inputHandler,i.element.removeEventListener("focus",n),i.element.removeEventListener("blur",o),i.element.removeEventListener("input",s),delete i.element.__eventHandlers.inputFocusHandler,delete i.element.__eventHandlers.inputBlurHandler,delete i.element.__eventHandlers.inputHandler),"Auto"===e.floatLabelType&&$F(e),e.properties.showClearButton&&(n=e.element,o=t,je(n)||je(n.__eventHandlers)||(je(n.__eventHandlers.clearClickHandler)||(r=n.__eventHandlers.clearClickHandler.clickHandlerEvent,void 0!==jF&&!jF||je(o)||o.removeEventListener("click",r),delete n.__eventHandlers.clearClickHandler),je(n.__eventHandlers.clearInputHandler))||je(n.__eventHandlers.clearFocusHandler)||je(n.__eventHandlers.clearBlurHandler)||(o=n.__eventHandlers.clearInputHandler.inputHandlerEvent,r=n.__eventHandlers.clearFocusHandler.focusHandlerEvent,s=n.__eventHandlers.clearBlurHandler.blurHandlerEvent,n.removeEventListener("input",o),n.removeEventListener("focus",r),n.removeEventListener("blur",s),delete n.__eventHandlers.clearInputHandler,delete n.__eventHandlers.clearFocusHandler,delete n.__eventHandlers.clearBlurHandler)),je(e.buttons)||vL(!1,null,e.buttons),JF(e.element),je(e.element)||(delete e.element.__eventHandlers,e.element.classList.contains(WF.INPUT)&&e.element.classList.remove(WF.INPUT))},zF.setValue=function(e,t,i,n){t.value=e,"Never"!==i&&hL(t,t.parentElement),je(i)||"Auto"!==i||rL(t,i),je(n)||!n||je(e=nL(t))||je(n=e.getElementsByClassName(WF.CLEARICON)[0])||(t.value&&!je(e)&&e.classList.contains("e-input-focus")?q:U)([n],WF.CLEARICONHIDE),GF(i,t)},zF.setCssClass=lL,zF.calculateWidth=hL,zF.setWidth=function(e,t){"number"==typeof e?t.style.width=T(e):"string"==typeof e&&(t.style.width=e.match(/px|%|em/)?e:T(e)),hL(t.firstChild,t)},zF.setPlaceholder=dL,zF.setReadonly=pL,zF.setEnableRtl=cL,zF.setEnabled=uL,zF.setClearButton=gL,zF.removeAttributes=mL,zF.addAttributes=fL,zF.removeFloating=function(e){var t,i,n;!je(e=e.container)&&e.classList.contains(WF.FLOATINPUT)&&(t=e.querySelector("textarea")?e.querySelector("textarea"):e.querySelector("input"),i=e.querySelector("."+WF.FLOATTEXT).textContent,n=null!==e.querySelector(".e-clear-icon"),G(e.querySelector("."+WF.FLOATLINE)),G(e.querySelector("."+WF.FLOATTEXT)),mt(e,[WF.INPUTGROUP],[WF.FLOATINPUT]),JF(t),pt(t,{placeholder:i}),t.classList.add(WF.INPUT),n||"INPUT"!==t.tagName||t.removeAttribute("required"))},zF.addFloating=function(e,t,i,n){var o,r,n=je(n)?Q:n,s=z(e,"."+WF.INPUTGROUP),a=s.tagName,a={element:e,floatLabelType:t,customTag:"DIV"!==a&&"SPAN"!==a?a:null,properties:{placeholder:i}};"Never"!==t?(i=s.querySelector(".e-clear-icon"),o={container:s},e.classList.remove(WF.INPUT),ZF(a,o,n),yL(o.container,n),hL(a.element,o.container),n=s.classList.contains("e-float-icon-left"),je(i)&&(i=(n?s.querySelector(".e-input-in-wrap"):s).querySelector(".e-input-group-icon")),je(i)?n&&(i=s.querySelector(".e-input-group-icon")):(o=s.querySelector("."+WF.FLOATLINE),r=s.querySelector("."+WF.FLOATTEXT),(n=n?s.querySelector(".e-input-in-wrap"):s).insertBefore(e,i),n.insertBefore(o,i),n.insertBefore(r,i))):$F(a),eL(t,e.parentElement)},zF.createSpanElement=yL,zF.setRipple=function(e,t){for(var i=0;i<t.length;i++)vL(e,t[parseInt(i.toString(),10)].container)},zF.addIcon=function(e,t,i,n,o){if(t="string"==typeof t?t.split(","):t,"append"===e.toLowerCase())for(var r=0,s=t;r<s.length;r++)AL(s[r],i,o);else for(var a=0,l=t;a<l.length;a++)SL(l[a],i,n,o);i.getElementsByClassName("e-input-group-icon")[0]&&i.getElementsByClassName("e-float-text-overflow")[0]&&i.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon")},zF.prependSpan=SL,zF.appendSpan=AL,zF.validateInputType=xL,zF.updateHTMLAttributesToElement=function(e,t){if(!je(e))for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];QF.indexOf(o)<0&&t.setAttribute(o,e[""+o])}},zF.updateCssClass=function(e,t,i){lL(IL(e),[i],IL(t))},zF.getInputValidClassList=IL,zF.updateHTMLAttributesToWrapper=function(e,t){if(!je(e))for(var i=0,n=Object.keys(e);i<n.length;i++){var o,r=n[i];-1<QF.indexOf(r)&&("class"===r?""!==(o=this.getInputValidClassList(e[""+r]))&&U([t],o.split(" ")):"style"===r?(o=je(o=t.getAttribute(r))?e[""+r]:o+e[""+r],t.setAttribute(r,o)):t.setAttribute(r,e[""+r]))}},zF.isBlank=function(e){return!e||/^\s*$/.test(e)};TL=function(e,t){return(TL=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])}))(e,t)};var TL,EL,wk=function(e,t){function i(){this.constructor=e}TL(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ir=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},DL="e-input-group-icon",ML="e-spin-up",kL="e-error",PL="increment",BL="decrement",FL=new RegExp("^(-)?(\\d*)$"),LL="e-input-focus",RL=["title","style","class"],OL=0,NL=(wk(VL,EL=Ji),VL.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var e=R("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),q([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=z(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var t=this.createElement("input"),i=0;i<this.element.attributes.length;i++){var n=this.element.attributes[i].nodeName;"id"!==n&&"class"!==n?(t.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue),t.innerHTML=this.element.innerHTML):"class"===n&&t.setAttribute(n,this.element.className.split(" ").filter(function(e){return 0!==e.indexOf("ng-")}).join(" "))}this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-numerictextbox"),this.element.appendChild(t),this.element=t,x("ej2_instances",e,this.element)}pt(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off"});e={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new Cn("numerictextbox",e,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",D("numerictextbox")),this.isValidState=!0,this.inputStyle=null,this.inputName=null,this.cultureInfo={},this.initCultureInfo(),this.initCultureFunc(),this.prevValue=this.value,this.updateHTMLAttrToElement(),this.checkAttributes(!1),this.formEle&&(this.inputEleValue=this.value),this.validateMinMax(),this.validateStep(),null===this.placeholder&&this.updatePlaceholder()},VL.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&(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(),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.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","numerictextbox"),!je(z(this.element,"fieldset"))&&z(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete())},VL.prototype.checkAttributes=function(e){for(var t=0,i=e?je(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","step","disabled","readonly","style","name","placeholder"];t<i.length;t++){var n,o,r,s=i[t];if(!je(this.element.getAttribute(s)))switch(s){case"disabled":(je(this.numericOptions)||void 0===this.numericOptions.enabled||e)&&(n="disabled"!==this.element.getAttribute(s)&&""!==this.element.getAttribute(s)&&"true"!==this.element.getAttribute(s),this.setProperties({enabled:n},!e));break;case"readonly":(je(this.numericOptions)||void 0===this.numericOptions.readonly||e)&&(n="readonly"===this.element.getAttribute(s)||""===this.element.getAttribute(s)||"true"===this.element.getAttribute(s),this.setProperties({readonly:n},!e));break;case"placeholder":(je(this.numericOptions)||void 0===this.numericOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"value":(je(this.numericOptions)||void 0===this.numericOptions.value||e)&&(o=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(s)),this.setProperties(x(s,o,{}),!e));break;case"min":!je(this.numericOptions)&&void 0!==this.numericOptions.min&&!e||null===(o=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(s)))||isNaN(o)||this.setProperties(x(s,o,{}),!e);break;case"max":!je(this.numericOptions)&&void 0!==this.numericOptions.max&&!e||null===(r=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(s)))||isNaN(r)||this.setProperties(x(s,r,{}),!e);break;case"step":!je(this.numericOptions)&&void 0!==this.numericOptions.step&&!e||null===(r=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(s)))||isNaN(r)||this.setProperties(x(s,r,{}),!e);break;case"style":this.inputStyle=this.element.getAttribute(s);break;case"name":this.inputName=this.element.getAttribute(s);break;default:var a=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(s));(null===a||isNaN(a))&&"value"!==s||this.setProperties(x(s,a,{}),!0)}}},VL.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},VL.prototype.initCultureFunc=function(){this.instance=new Ti(this.locale)},VL.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==R("currency",this)&&(x("currency",this.currency,this.cultureInfo),this.setProperties({currencyCode:this.currency},!0))},VL.prototype.createWrapper=function(){var e=this.cssClass,e=(je(this.cssClass)||""===this.cssClass||(e=this.getNumericValidClassList(this.cssClass)),HF.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:e,enableRtl:this.enableRtl,showClearButton:this.showClearButton,enabled:this.enabled}},this.createElement));this.inputWrapper=e,this.container=e.container,this.container.setAttribute("class","e-control-wrapper e-numeric "+this.container.getAttribute("class")),this.updateHTMLAttrToWrapper(),this.readonly&&pt(this.element,{"aria-readonly":"true"}),this.hiddenInput=this.createElement("input",{attrs:{type:"text",validateHidden:"true","aria-label":"hidden",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),this.isAngular&&"EJS-NUMERICTEXTBOX"===this.angularTagName&&0<this.cloneElement.id.length?pt(this.hiddenInput,{name:this.cloneElement.id}):pt(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.container.childNodes[1]),this.updateDataAttribute(!1),null!==this.inputStyle&&pt(this.container,{style:this.inputStyle})},VL.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 n=0,o=Object.keys(t);n<o.length;n++){var r=o[n];0===r.indexOf("data")&&this.hiddenInput.setAttribute(r,t[""+r])}},VL.prototype.updateHTMLAttrToElement=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];RL.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},VL.prototype.updateCssClass=function(e,t){HF.setCssClass(this.getNumericValidClassList(e),[this.container],this.getNumericValidClassList(t))},VL.prototype.getNumericValidClassList=function(e){return je(e)||""===e?e:e.replace(/\s+/g," ").trim()},VL.prototype.updateHTMLAttrToWrapper=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i,n=t[e];-1<RL.indexOf(n)&&("class"===n?""!==(i=this.getNumericValidClassList(this.htmlAttributes[""+n]))&&U([this.container],i.split(" ")):"style"===n?(i=je(i=this.container.getAttribute(n))?this.htmlAttributes[""+n]:i+this.htmlAttributes[""+n],this.container.setAttribute(n,i)):this.container.setAttribute(n,this.htmlAttributes[""+n]))}},VL.prototype.setElementWidth=function(e){je(e)||("number"==typeof e?this.container.style.width=T(e):"string"==typeof e&&(this.container.style.width=e.match(/px|%|em/)?e:T(e)))},VL.prototype.spinBtnCreation=function(){this.spinDown=HF.appendSpan(DL+" e-spin-down",this.container,this.createElement),pt(this.spinDown,{title:this.l10n.getConstant("decrementTitle")}),this.spinUp=HF.appendSpan(DL+" "+ML,this.container,this.createElement),pt(this.spinUp,{title:this.l10n.getConstant("incrementTitle")}),this.wireSpinBtnEvents()},VL.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),this.min!==-Number.MAX_VALUE&&pt(this.element,{"aria-valuemin":this.min.toString()}),this.max!==Number.MAX_VALUE&&pt(this.element,{"aria-valuemax":this.max.toString()})},VL.prototype.formattedValue=function(e,t){return this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},VL.prototype.validateStep=function(){null!==this.decimals&&this.setProperties({step:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.step))},!0)},VL.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)},VL.prototype.checkErrorClass=function(){(this.isValidState?q:U)([this.container],kL),pt(this.element,{"aria-invalid":this.isValidState?"false":"true"})},VL.prototype.bindClearEvent=function(){this.showClearButton&&E.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},VL.prototype.resetHandler=function(e){e.preventDefault(),this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputWrapper.container.classList.contains("e-static-clear")||this.clear(e),this.isInteract=!0,this.raiseChangeEvent(e)},VL.prototype.clear=function(e){var t,i;this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="",z(this.element,"form")&&(t=this.element.nextElementSibling,(i=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),t.dispatchEvent(i))},VL.prototype.resetFormHandler=function(){"EJS-NUMERICTEXTBOX"===this.element.tagName?this.updateValue(null):this.updateValue(this.inputEleValue)},VL.prototype.setSpinButton=function(){je(this.spinDown)||pt(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),je(this.spinUp)||pt(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},VL.prototype.wireEvents=function(){E.add(this.element,"focus",this.focusHandler,this),E.add(this.element,"blur",this.focusOutHandler,this),E.add(this.element,"keydown",this.keyDownHandler,this),E.add(this.element,"keyup",this.keyUpHandler,this),E.add(this.element,"input",this.inputHandler,this),E.add(this.element,"keypress",this.keyPressHandler,this),E.add(this.element,"change",this.changeHandler,this),E.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle)&&E.add(this.formEle,"reset",this.resetFormHandler,this)},VL.prototype.wireSpinBtnEvents=function(){E.add(this.spinUp,F.touchStartEvent,this.mouseDownOnSpinner,this),E.add(this.spinDown,F.touchStartEvent,this.mouseDownOnSpinner,this),E.add(this.spinUp,F.touchEndEvent,this.mouseUpOnSpinner,this),E.add(this.spinDown,F.touchEndEvent,this.mouseUpOnSpinner,this),E.add(this.spinUp,F.touchMoveEvent,this.touchMoveOnSpinner,this),E.add(this.spinDown,F.touchMoveEvent,this.touchMoveOnSpinner,this)},VL.prototype.unwireEvents=function(){E.remove(this.element,"focus",this.focusHandler),E.remove(this.element,"blur",this.focusOutHandler),E.remove(this.element,"keyup",this.keyUpHandler),E.remove(this.element,"input",this.inputHandler),E.remove(this.element,"keydown",this.keyDownHandler),E.remove(this.element,"keypress",this.keyPressHandler),E.remove(this.element,"change",this.changeHandler),E.remove(this.element,"paste",this.pasteHandler),this.formEle&&E.remove(this.formEle,"reset",this.resetFormHandler)},VL.prototype.unwireSpinBtnEvents=function(){E.remove(this.spinUp,F.touchStartEvent,this.mouseDownOnSpinner),E.remove(this.spinDown,F.touchStartEvent,this.mouseDownOnSpinner),E.remove(this.spinUp,F.touchEndEvent,this.mouseUpOnSpinner),E.remove(this.spinDown,F.touchEndEvent,this.mouseUpOnSpinner),E.remove(this.spinUp,F.touchMoveEvent,this.touchMoveOnSpinner),E.remove(this.spinDown,F.touchMoveEvent,this.touchMoveOnSpinner)},VL.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)},VL.prototype.raiseChangeEvent=function(e){var t;this.inputValue=je(this.inputValue)||isNaN(this.inputValue)?null:this.inputValue,this.prevValue===this.value&&this.prevValue===this.inputValue||(t={},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),I(t,this.changeEventArgs),this.prevValue=this.value,this.isInteract=!1,this.elementPrevValue=this.element.value,this.preventChange=!1,this.trigger("change",t))},VL.prototype.pasteHandler=function(){var e,t=this;this.enabled&&!this.readonly&&(e=this.element.value,setTimeout(function(){t.numericRegex().test(t.element.value)||t.setElementValue(e)}))},VL.prototype.preventHandler=function(){var r=this,s=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){var e,t,i,n,o;0<r.element.selectionStart&&(e=r.element.selectionStart,t=r.element.selectionStart-1,i=r.element.value.split(""),o=(n=R("decimal",Mi(r.locale))).charCodeAt(0)," "===r.element.value[t]&&0<r.element.selectionStart&&!s?(je(r.prevVal)?r.element.value=r.element.value.trim():0!=t?r.element.value=r.prevVal:0==t&&(r.element.value=r.element.value.trim()),r.element.setSelectionRange(t,t)):isNaN(parseFloat(r.element.value[r.element.selectionStart-1]))&&45!==r.element.value[r.element.selectionStart-1].charCodeAt(0)?(i.indexOf(r.element.value[r.element.selectionStart-1])!==i.lastIndexOf(r.element.value[r.element.selectionStart-1])&&r.element.value[r.element.selectionStart-1].charCodeAt(0)===o||r.element.value[r.element.selectionStart-1].charCodeAt(0)!==o)&&(r.element.value=r.element.value.substring(0,t)+r.element.value.substring(e,r.element.value.length),r.element.setSelectionRange(t,t),isNaN(parseFloat(r.element.value[r.element.selectionStart-1])))&&0<r.element.selectionStart&&r.element.value.length&&r.preventHandler():isNaN(parseFloat(r.element.value[r.element.selectionStart-2]))&&1<r.element.selectionStart&&45!==r.element.value[r.element.selectionStart-2].charCodeAt(0)&&(i.indexOf(r.element.value[r.element.selectionStart-2])!==i.lastIndexOf(r.element.value[r.element.selectionStart-2])&&r.element.value[r.element.selectionStart-2].charCodeAt(0)===o||r.element.value[r.element.selectionStart-2].charCodeAt(0)!==o)&&(r.element.setSelectionRange(t,t),r.nextEle=r.element.value[r.element.selectionStart],r.cursorPosChanged=!0,r.preventHandler()),!0===r.cursorPosChanged&&r.element.value[r.element.selectionStart]===r.nextEle&&isNaN(parseFloat(r.element.value[r.element.selectionStart-1]))&&(r.element.setSelectionRange(r.element.selectionStart+1,r.element.selectionStart+1),r.cursorPosChanged=!1,r.nextEle=null),""===r.element.value.trim()&&r.element.setSelectionRange(0,0),0<r.element.selectionStart&&(45===r.element.value[r.element.selectionStart-1].charCodeAt(0)&&1<r.element.selectionStart&&(je(r.prevVal)||(r.element.value=r.prevVal),r.element.setSelectionRange(r.element.selectionStart,r.element.selectionStart)),r.element.value[r.element.selectionStart-1]===n)&&0===r.decimals&&r.validateDecimalOnType&&(r.element.value=r.element.value.substring(0,t)+r.element.value.substring(e,r.element.value.length)),r.prevVal=r.element.value)})},VL.prototype.keyUpHandler=function(){var e,t;this.enabled&&!this.readonly&&(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)||!F.isDevice||this.preventHandler(),e=null===(e=this.instance.getNumberParser({format:"n"})(this.element.value))||isNaN(e)?null:e,this.hiddenInput.value=e||0===e?e.toString():null,z(this.element,"form"))&&(e=this.element.nextElementSibling,(t=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(t))},VL.prototype.inputHandler=function(e){var t,i;this.enabled&&!this.readonly&&(t=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),(-1<navigator.userAgent.toLowerCase().indexOf("firefox")||t)&&F.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==R("decimal",Mi(this.locale))&&this.element.value!==R("minusSign",Mi(this.locale))&&(t=this.instance.getNumberParser({format:"n"})(this.element.value),t=isNaN(t)?null:t,this.localChange({value:t}),this.preventChange=!0),this.isVue)&&(t=this.instance.getNumberParser({format:"n"})(this.element.value),i=this.instance.getNumberParser({format:"n"})(this.elementPrevValue),e={event:e,value:null===(t=!new RegExp("[^0-9]+$").test(this.element.value)&&(-1===this.elementPrevValue.indexOf(".")&&-1===this.elementPrevValue.indexOf("-")||"0"!==this.element.value[this.element.value.length-1])?t:this.value)||isNaN(t)?null:t,previousValue:null===i||isNaN(i)?null:i},this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",e))},VL.prototype.keyDownHandler=function(e){if(!this.readonly)switch(e.keyCode){case 38:e.preventDefault(),this.action(PL,e);break;case 40:e.preventDefault(),this.action(BL,e)}},VL.prototype.performAction=function(e,t,i){null!==e&&!isNaN(e)||(e=0);i=this.correctRounding(e,t,i===PL?e+t:e-t);return this.strictMode?this.trimValue(i):i},VL.prototype.correctRounding=function(e,t,i){var n=new RegExp("[,.](.*)"),o=n.test(e.toString()),r=n.test(t.toString());return o||r?(o=o?n.exec(e.toString())[0].length:0,e=r?n.exec(t.toString())[0].length:0,r=Math.max(o,e),this.roundValue(i,r)):i},VL.prototype.roundValue=function(e,t){t=t||0;t=Math.pow(10,t);return e*=t,Math.round(e)/t},VL.prototype.updateValue=function(e,t){t&&(this.isInteract=!0),null===e||isNaN(e)||this.decimals&&(e=this.roundNumber(e,this.decimals)),this.inputValue=e,this.changeValue(null===e||isNaN(e)?null:this.strictMode?this.trimValue(e):e),this.isDynamicChange||this.raiseChangeEvent(t)},VL.prototype.updateCurrency=function(e,t){x(e,t,this.cultureInfo),this.updateValue(this.value)},VL.prototype.changeValue=function(e){var t;e||0===e?(t=this.getNumberOfDecimals(e),this.setProperties({value:this.roundNumber(e,t)},!0)):this.setProperties({value:e=null},!0),this.modifyText(),this.strictMode||this.validateState()},VL.prototype.modifyText=function(){var e,t;this.value||0===this.value?(e=this.formatNumber(),t=this.isFocused?e:this.instance.getNumberFormat(this.cultureInfo)(this.value),this.setElementValue(t),pt(this.element,{"aria-valuenow":e}),je(this.hiddenInput)||(this.hiddenInput.value=this.value.toString(),null!==this.value&&this.serverDecimalSeparator&&(this.hiddenInput.value=this.hiddenInput.value.replace(".",this.serverDecimalSeparator)))):(this.setElementValue(""),this.element.removeAttribute("aria-valuenow"),this.hiddenInput.value=null)},VL.prototype.setElementValue=function(e,t){HF.setValue(e,t||this.element,this.floatLabelType,this.showClearButton)},VL.prototype.validateState=function(){this.isValidState=!0,!this.value&&0!==this.value||(this.isValidState=!(this.value>this.max||this.value<this.min)),this.checkErrorClass()},VL.prototype.getNumberOfDecimals=function(e){var t=new RegExp("[eE][-+]?([0-9]+)"),i=e.toString(),e=(i=!t.test(i)||je(t=t.exec(i))?i:e.toFixed(Math.min(parseInt(t[1],10),20))).split(".")[1],t=e&&e.length?e.length:0;return t=null!==this.decimals?t<this.decimals?t:this.decimals:t},VL.prototype.formatNumber=function(){var e=this.getNumberOfDecimals(this.value);return this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(this.value)},VL.prototype.trimValue=function(e){return e>this.max?this.max:e<this.min?this.min:e},VL.prototype.roundNumber=function(e,t){var t=t||0,i=e.toString().split("e"),i=(e=Math.round(Number(i[0]+"e"+(i[1]?Number(i[1])+t:t)))).toString().split("e");return e=Number(i[0]+"e"+(i[1]?Number(i[1])-t:-t)),Number(e.toFixed(t))},VL.prototype.cancelEvent=function(e){return e.preventDefault(),!1},VL.prototype.keyPressHandler=function(e){if(!this.enabled||this.readonly)return!0;if(!F.isDevice&&"11.0"===F.info.version&&13===e.keyCode)return t=this.instance.getNumberParser({format:"n"})(this.element.value),this.updateValue(t,e),!0;if(0===e.which||e.metaKey||e.ctrlKey||8===e.keyCode||13===e.keyCode)return!0;var t=String.fromCharCode(e.which),i=R("decimal",Mi(this.locale)),n="NumpadDecimal"===e.code&&t!==i;n&&(t=i);i=(i=this.element.value).substring(0,this.element.selectionStart)+t+i.substring(this.element.selectionEnd);return this.numericRegex().test(i)?(n&&(t=this.element.selectionStart+1,this.element.value=i,this.element.setSelectionRange(t,t),e.preventDefault(),e.stopPropagation()),!0):(e.preventDefault(),e.stopPropagation(),!1)},VL.prototype.numericRegex=function(){var e=R("decimal",Mi(this.locale)),t="*";return"."===e&&(e="\\"+e),0===this.decimals&&this.validateDecimalOnType?FL:(this.decimals&&this.validateDecimalOnType&&(t="{0,"+this.decimals+"}"),new RegExp("^\\s*(-)?(((\\d+("+e+"\\d"+t+")?)|("+e+"\\d"+t+")))?$"))},VL.prototype.mouseWheel=function(e){var t;e.preventDefault(),e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),0<t?this.action(PL,e):t<0&&this.action(BL,e),this.cancelEvent(e)},VL.prototype.focusHandler=function(e){var t,i=this;clearTimeout(OL),this.focusEventArgs={event:e,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),!this.enabled||this.readonly||(this.isFocused=!0,this.prevValue=this.value,!this.value&&0!==this.value||(t=this.formatNumber(),this.setElementValue(t),this.isPrevFocused)||(F.isDevice||"11.0"!==F.info.version?(e=F.isDevice&&F.isIos?600:0,OL=setTimeout(function(){i.element.setSelectionRange(0,t.length)},e)):this.element.setSelectionRange(0,t.length)),F.isDevice)||E.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)},VL.prototype.focusOutHandler=function(e){var t,i,n,o=this;this.blurEventArgs={event:e,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly&&(this.isPrevFocused?(e.preventDefault(),F.isDevice&&(t=this.element.value,this.element.focus(),this.isPrevFocused=!1,i=this.element,setTimeout(function(){o.setElementValue(t,i)},200))):(this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0),e=this.instance.getNumberParser({format:"n"})(this.element.value),this.updateValue(e),F.isDevice||E.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)),z(this.element,"form"))&&(e=this.element.nextElementSibling,(n=document.createEvent("FocusEvent")).initEvent("focusout",!1,!0),e.dispatchEvent(n))},VL.prototype.mouseDownOnSpinner=function(e){var t,i,n=this;this.isFocused&&(this.isPrevFocused=!0,e.preventDefault()),this.getElementData(e)&&(this.getElementData(e),t=e.currentTarget,i=t.classList.contains(ML)?PL:BL,E.add(t,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){n.isCalled=!0,n.action(i,e)},150),E.add(document,"mouseup",this.mouseUpClick,this))},VL.prototype.touchMoveOnSpinner=function(e){var t;("touchmove"===e.type?(t=e.touches).length&&document.elementFromPoint(t[0].pageX,t[0].pageY):document.elementFromPoint(e.clientX,e.clientY)).classList.contains(DL)||clearInterval(this.timeOut)},VL.prototype.mouseUpOnSpinner=function(e){var t,i;this.prevValue=this.value,this.isPrevFocused&&(this.element.focus(),F.isDevice||(this.isPrevFocused=!1)),F.isDevice||e.preventDefault(),this.getElementData(e)&&(i=(t=e.currentTarget).classList.contains(ML)?PL:BL,E.remove(t,"mouseleave",this.mouseUpClick),this.isCalled||this.action(i,e),this.isCalled=!1,E.remove(document,"mouseup",this.mouseUpClick),z(this.element,"form"))&&(t=this.element.nextElementSibling,(i=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),t.dispatchEvent(i))},VL.prototype.getElementData=function(e){return!(e.which&&3===e.which||e.button&&2===e.button||!this.enabled||this.readonly||(clearInterval(this.timeOut),0))},VL.prototype.floatLabelTypeUpdate=function(){HF.removeFloating(this.inputWrapper);var e=this.hiddenInput;this.hiddenInput.remove(),HF.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement),this.container.insertBefore(e,this.container.childNodes[1])},VL.prototype.mouseUpClick=function(e){e.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,this.spinUp&&E.remove(this.spinUp,"mouseleave",this.mouseUpClick),this.spinDown&&E.remove(this.spinDown,"mouseleave",this.mouseUpClick)},VL.prototype.increment=function(e){void 0===e&&(e=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,e,PL)),this.raiseChangeEvent()},VL.prototype.decrement=function(e){void 0===e&&(e=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,e,BL)),this.raiseChangeEvent()},VL.prototype.destroy=function(){this.unwireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),G(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),G(this.spinUp),G(this.spinDown));for(var e=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-valuenow","aria-invalid"],t=0;t<e.length;t++)this.element.removeAttribute(e[t]);this.element.classList.remove("e-input"),this.container.insertAdjacentElement("afterend",this.element),G(this.container),this.spinUp=null,this.spinDown=null,this.container=null,this.hiddenInput=null,this.changeEventArgs=null,this.blurEventArgs=null,this.focusEventArgs=null,this.inputWrapper=null,HF.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),EL.prototype.destroy.call(this)},VL.prototype.getText=function(){return this.element.value},VL.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),U([this.container],[LL]))},VL.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),q([this.container],[LL]))},VL.prototype.getPersistData=function(){return this.addOnPersist(["value"])},VL.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];switch(o){case"width":this.setElementWidth(e.width),HF.calculateWidth(this.element,this.container);break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass);break;case"enabled":HF.setEnabled(e.enabled,this.element),this.bindClearEvent();break;case"enableRtl":HF.setEnableRtl(e.enableRtl,[this.container]);break;case"readonly":HF.setReadonly(e.readonly,this.element),this.readonly?pt(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.updateDataAttribute(!0),this.checkAttributes(!0),HF.validateInputType(this.container,this.element);break;case"placeholder":HF.setPlaceholder(e.placeholder,this.element),HF.calculateWidth(this.element,this.container);break;case"step":this.step=e.step,this.validateStep();break;case"showSpinButton":this.updateSpinButton(e);break;case"showClearButton":this.updateClearButton(e);break;case"floatLabelType":this.floatLabelType=e.floatLabelType,this.floatLabelTypeUpdate();break;case"value":this.isDynamicChange=(this.isAngular||this.isVue)&&this.preventChange,this.updateValue(e.value),this.isDynamicChange&&(this.preventChange=!1,this.isDynamicChange=!1);break;case"min":case"max":x(o,R(o,e),this),this.validateMinMax(),this.updateValue(this.value);break;case"strictMode":this.strictMode=e.strictMode,this.updateValue(this.value),this.validateState();break;case"locale":this.initCultureFunc(),this.l10n.setLocale(this.locale),this.setSpinButton(),this.updatePlaceholder(),HF.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":var r=R(o,e);this.setProperties({currencyCode:r},!0),this.updateCurrency(o,r);break;case"currencyCode":r=R(o,e);this.setProperties({currency:r},!0),this.updateCurrency("currency",r);break;case"format":x(o,R(o,e),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=e.decimals,this.updateValue(this.value)}}},VL.prototype.updateClearButton=function(e){HF.setClearButton(e.showClearButton,this.element,this.inputWrapper,void 0,this.createElement),this.bindClearEvent()},VL.prototype.updateSpinButton=function(e){e.showSpinButton?this.spinBtnCreation():(G(this.spinUp),G(this.spinDown))},VL.prototype.getModuleName=function(){return"numerictextbox"},Ir([e("")],VL.prototype,"cssClass",void 0),Ir([e(null)],VL.prototype,"value",void 0),Ir([e(-Number.MAX_VALUE)],VL.prototype,"min",void 0),Ir([e(Number.MAX_VALUE)],VL.prototype,"max",void 0),Ir([e(1)],VL.prototype,"step",void 0),Ir([e(null)],VL.prototype,"width",void 0),Ir([e(null)],VL.prototype,"placeholder",void 0),Ir([e({})],VL.prototype,"htmlAttributes",void 0),Ir([e(!0)],VL.prototype,"showSpinButton",void 0),Ir([e(!1)],VL.prototype,"readonly",void 0),Ir([e(!0)],VL.prototype,"enabled",void 0),Ir([e(!1)],VL.prototype,"showClearButton",void 0),Ir([e(!1)],VL.prototype,"enablePersistence",void 0),Ir([e("n2")],VL.prototype,"format",void 0),Ir([e(null)],VL.prototype,"decimals",void 0),Ir([e(null)],VL.prototype,"currency",void 0),Ir([e(null)],VL.prototype,"currencyCode",void 0),Ir([e(!0)],VL.prototype,"strictMode",void 0),Ir([e(!1)],VL.prototype,"validateDecimalOnType",void 0),Ir([e("Never")],VL.prototype,"floatLabelType",void 0),Ir([i()],VL.prototype,"created",void 0),Ir([i()],VL.prototype,"destroyed",void 0),Ir([i()],VL.prototype,"change",void 0),Ir([i()],VL.prototype,"focus",void 0),Ir([i()],VL.prototype,"blur",void 0),Ir([Bt],VL));function VL(e,t){t=EL.call(this,e,t)||this;return t.preventChange=!1,t.isDynamicChange=!1,t.numericOptions=e,t}var _L="e-error",HL="e-input-group",zL="e-float-input",jL="e-utility-mask",WL="e-label-top",QL="e-label-bottom",UL={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 ]"};function qL(){if(pt(this.element,{role:"textbox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-live":"assertive"}),this.mask){for(var e=this.mask.split("]"),t=0;t<e.length;t++)if("\\"===e[t][e[t].length-1]){e[t]=e[t]+"]";for(var i=e[t].split("["),n=0;n<i.length;n++)"\\"===i[n][i[n].length-1]&&(i[n]=i[n]+"["),tR.call(this,i[n])}else if(1<(i=e[t].split("[")).length)for(var o=!1,n=0;n<i.length;n++)"\\"===i[n]?(this.customRegExpCollec.push("["),this.hiddenMask+=i[n]+"["):""===i[n]?o=!0:""!==i[n]&&o||n===i.length-1?(this.customRegExpCollec.push("["+i[n]+"]"),this.hiddenMask+=this.promptChar,o=!1):tR.call(this,i[n]);else tR.call(this,i[0]);if(this.escapeMaskValue=this.hiddenMask,this.promptMask=this.hiddenMask.replace(/[09?LCAa#&]/g,this.promptChar),!je(this.customCharacters))for(t=0;t<this.promptMask.length;t++)je(this.customCharacters[this.promptMask[t]])||(this.promptMask=this.promptMask.replace(new RegExp(this.promptMask[t],"g"),this.promptChar));if(this.hiddenMask.match(new RegExp(/\\/)))for(t=0;t<this.hiddenMask.length;t++){var r,n=1<=t?t:0;n-=r=this.hiddenMask.length-this.promptMask.length,0<t&&"\\"!==this.hiddenMask[t-1]&&(">"===this.hiddenMask[t]||"<"===this.hiddenMask[t]||"|"===this.hiddenMask[t])&&(this.promptMask=this.promptMask.substring(0,n)+this.promptMask.substring(t+1-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue.substring(t+1-r,this.escapeMaskValue.length)),"\\"===this.hiddenMask[t]&&(this.promptMask=this.promptMask.substring(0,n)+this.hiddenMask[t+1]+this.promptMask.substring(t+2-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue[t+1]+this.escapeMaskValue.substring(t+2-r,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");pt(this.element,{"aria-invalid":"false"})}}function GL(){TR.call(this,this.promptMask),IR.call(this,this.value)}function YL(){E.add(this.element,"keydown",cR,this),E.add(this.element,"keypress",fR,this),E.add(this.element,"keyup",vR,this),E.add(this.element,"input",pR,this),E.add(this.element,"focus",oR,this),E.add(this.element,"blur",aR,this),E.add(this.element,"paste",lR,this),E.add(this.element,"cut",hR,this),E.add(this.element,"drop",dR,this),E.add(this.element,"mousedown",iR,this),E.add(this.element,"mouseup",nR,this),this.enabled&&(KL.call(this),this.formElement)&&E.add(this.formElement,"reset",ZL,this)}function XL(){E.remove(this.element,"keydown",cR),E.remove(this.element,"keypress",fR),E.remove(this.element,"keyup",vR),E.remove(this.element,"input",pR),E.remove(this.element,"focus",oR),E.remove(this.element,"blur",aR),E.remove(this.element,"paste",lR),E.remove(this.element,"cut",hR),E.remove(this.element,"drop",dR),E.remove(this.element,"mousedown",iR),E.remove(this.element,"mouseup",nR),this.formElement&&E.remove(this.formElement,"reset",ZL)}function KL(){this.showClearButton&&E.add(this.inputObj.clearButton,"mousedown touchstart",JL,this)}function JL(e){e.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputObj.container.classList.contains("e-static-clear")||(function(e){var t=this.element.value;TR.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),yR.call(this,e,t),this.element.setSelectionRange(0,0)}.call(this,e),this.value="")}function ZL(){"EJS-MASKEDTEXTBOX"===this.element.tagName?TR.call(this,this.promptMask):this.value=this.initInputValue}function $L(e){return e.value}function eR(e,t){var i="",n=0,o=!1,r=!je(t)||je(e)||je(this)?t:e.value;if(r!==this.promptMask)for(var s=0;s<this.customRegExpCollec.length;s++)o=o&&!1,">"!==this.customRegExpCollec[n]&&"<"!==this.customRegExpCollec[n]&&"|"!==this.customRegExpCollec[n]&&"\\"!==this.customRegExpCollec[n]||(--s,o=!0),o||r[s]!==this.promptChar&&!je(this.customRegExpCollec[n])&&(this._callPasteHandler||!je(this.regExpCollec[this.customRegExpCollec[n]])&&!this.maskedRegExp.includes(this.customRegExpCollec[n])||2<this.customRegExpCollec[n].length&&"["===this.customRegExpCollec[n][0]&&"]"===this.customRegExpCollec[n][this.customRegExpCollec[n].length-1]||!je(this.customCharacters)&&!je(this.customCharacters[this.customRegExpCollec[n]]))&&""!==r&&(i+=r[s]),++n;return i=null===this.mask||""===this.mask&&void 0!==this.value?r:i}function tR(e){for(var t=0;t<e.length;t++)this.hiddenMask+=e[t],"\\"!==e[t]?this.customRegExpCollec.push(e[t]):"\\"!==e[t]||je(this.regExpCollec[e[t+1]])||this.maskedRegExp.push(e[t+1])}function iR(){this.isClicked=!0}function nR(){this.isClicked=!1}function oR(e){var i=this,n=this.element,t=0,o=eR.call(this,n),r=!1,s=!1,a={selectionStart:n.selectionStart,event:e,value:this.value,maskedValue:n.value,container:je(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:n.selectionEnd};if(this.isClicked||rR.call(this,a,n),this.mask&&(null!==o&&""!==o||"Always"===this.floatLabelType||null===this.placeholder||""===this.placeholder||(n.value=this.promptMask),setTimeout(function(){if(n.selectionStart===i.promptMask.length||n.value[n.selectionStart]===i.promptChar)r=!0;else for(var e=n.selectionStart;e<i.promptMask.length;e++){if(n.value[e]===i.promptChar){r=!0;break}if(n.value[e]!==i.promptMask[e]){r=!1;break}}}),setTimeout(function(){var e=n.selectionStart-1;if(e==i.promptMask.length-1||n.value[e]===i.promptChar)s=!0;else for(var t=e;0<=t;t--){if(n.value[t]===i.promptChar){s=!0;break}if(n.value[t]!==i.promptMask[t]){s=!1;break}}}),this.isClicked||"Always"!==this.floatLabelType&&(null===o||""===o)&&null!==this.placeholder&&""!==this.placeholder)){for(t=0;t<this.promptMask.length;t++)if(n.value[t]===this.promptChar){setTimeout(function(){(r||s)&&(n.selectionEnd=t,n.selectionStart=t),a={selectionStart:n.selectionStart,event:e,value:i.value,maskedValue:n.value,container:je(i.inputObj)?i.inputObj:i.inputObj.container,selectionEnd:n.selectionEnd},rR.call(i,a,n)},110);break}je(n.value.match(sR(this.promptChar)))&&(a={selectionStart:n.selectionStart,event:e,value:this.value,maskedValue:n.value,container:je(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:n.selectionEnd},rR.call(this,a,n)),this.isClicked=!1}}function rR(e,t){this.trigger("focus",e,function(e){t.selectionStart=e.selectionStart,t.selectionEnd=e.selectionEnd})}function sR(e){return je(e)?e:e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function aR(e){this.blurEventArgs={event:e,value:this.value,maskedValue:this.element.value,container:je(this.inputObj)?this.inputObj:this.inputObj.container},this.trigger("blur",this.blurEventArgs),this.mask&&(this.isFocus=!1,this.placeholder)&&this.element.value===this.promptMask&&"Always"!==this.floatLabelType&&(TR.call(this,""),e=this.element.parentNode.querySelector(".e-float-text"),"Auto"===this.floatLabelType)&&!je(e)&&e.classList.contains(WL)&&q([e],WL)}function lR(n){var o,r,s,a=this;this.mask&&!this.readonly&&(o=this.element.selectionStart,r=this.element.selectionEnd,s=this.element.value,TR.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var e=a.element.value.replace(/ /g,""),t=(0<a.redoCollec.length&&a.redoCollec[0].value===a.element.value&&(e=eR.call(a,a.element)),TR.call(a,s),a.element.selectionStart=o,a.element.selectionEnd=r,0);for(a.maskKeyPress=!0;wR.call(a,e[t],!1,null),++t<e.length;);if(a.maskKeyPress=!1,a._callPasteHandler=!1,a.element.value===s){var i=0;for(a.maskKeyPress=!0;wR.call(a,e[i],!1,null),++i<e.length;);a.maskKeyPress=!1}else yR.call(a,n,s)},1))}function hR(e){var t,i,n,o,r=this;this.mask&&!this.readonly&&(t=this.element.value,i=this.element.selectionStart,n=this.element.selectionEnd,this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),o=this.element.value.substring(0,i)+this.promptMask.substring(i,n)+this.element.value.substring(n),setTimeout(function(){TR.call(r,o),r.element.selectionStart=r.element.selectionEnd=i,r.element.value!==t&&yR.call(r,e,null)},0))}function dR(e){e.preventDefault()}function pR(e){if(!0!==F.isIE||""!==this.element.value||"Never"!==this.floatLabelType)if(Pe(e,{ctrlKey:!1,keyCode:229}),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||mR.call(this,e),this.element.value.length>this.promptMask.length){for(var t=this.element.selectionStart,i=this.element.value.length-this.promptMask.length,n=this.element.value.substring(t-i,t),o=(this.maskKeyPress=!1,0);wR.call(this,n[o],e.ctrlKey,e),++o<n.length;);this.element.value!==this.preEleVal&&yR.call(this,e,null)}i=eR.call(this,this.element);this.prevValue=i,""===(this.value=i)&&(TR.call(this,this.promptMask),this.element.setSelectionRange(0,0))}}function cR(e){var t,i;this.mask&&!this.readonly&&(229!==e.keyCode&&(!e.ctrlKey||89!==e.keyCode&&90!==e.keyCode||e.preventDefault(),mR.call(this,e)),t=this.element.value,!e.ctrlKey||89!==e.keyCode&&90!==e.keyCode||(i=void 0,90===e.keyCode&&0<this.undoCollec.length&&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}),TR.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&&0<this.redoCollec.length&&t!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),TR.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))))}function uR(){var e,t=this.element.selectionStart,i=this.element.selectionEnd;0<this.redoCollec.length?(e=this.redoCollec[0],TR.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)):(TR.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=t)}function gR(e,t,i){return"input"===i.type&&(e=!1,t=this.element.value,TR.call(this,this.promptMask),IR.call(this,t)),e}function mR(e){var t,i=!1,n=!1,o=(this.element.value.length<this.promptMask.length&&(t=this.element.value,i=gR.call(this,i=!0,t,e),uR.call(this)),this.element.value.length>=this.promptMask.length&&"input"===e.type&&(i=gR.call(this,i,t,e)),this.element.selectionStart),r=this.element.selectionEnd,s=this.element.selectionStart,a=this.element.selectionEnd,l=this.hiddenMask.replace(/[>|\\<]/g,""),h=l[s-1],d=this.element.selectionEnd;if(i||8===e.keyCode||46===e.keyCode){this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:a});var p=!1,c=this.element.value;if(0<s||(8===e.keyCode||46===e.keyCode)&&s<this.element.value.length&&this.element.selectionEnd-s!==this.element.value.length){var u=s;s!==a?(s=a,46===e.keyCode&&(p=!0)):46===e.keyCode?++u:--u;for(var g=s;8===e.keyCode||i||p?u<g:g<u;8===e.keyCode||i||p?g--:g++)for(var m=s;8===e.keyCode||i||p?0<m:m<this.element.value.length;8===e.keyCode||i||p?m--:m++){var f,y,v=void 0;(8===e.keyCode||p)&&(o!==r&&o!==s||o===r)||i?(h=l[m-1],v=s-1):(h=l[m],v=s,++s),this.element.value[v];if(je(this.regExpCollec[""+h])&&!je(this.customCharacters)&&je(this.customCharacters[""+h])&&this.hiddenMask[v]!==this.promptChar&&"["!==this.customRegExpCollec[v][0]&&"]"!==this.customRegExpCollec[v][this.customRegExpCollec[v].length-1]||this.promptMask[v]!==this.promptChar&&je(this.customCharacters)?(this.element.selectionStart=this.element.selectionEnd=v,e.preventDefault(),46!==e.keyCode||p||++this.element.selectionStart):(f=this.element.value,y=this.promptChar,y=f.substring(0,v)+y+f.substring(s,f.length),TR.call(this,y),e.preventDefault(),46!==e.keyCode||p||v++,this.element.selectionStart=this.element.selectionEnd=v,n=!0),s=this.element.selectionStart,!n&&8===e.keyCode||p||!n&&46!==e.keyCode?v=s-1:(v=s,n=!1),f=this.element.value[v],o!==r&&this.element.selectionStart===o||this.promptMask[v]===this.promptChar||f!==this.promptMask[v]&&this.promptMask[v]!==this.promptChar&&!je(this.customCharacters))break}}46===e.keyCode&&p&&n&&(this.element.selectionStart=this.element.selectionEnd=d),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(TR.call(this,this.promptMask),e.preventDefault(),this.element.selectionStart=this.element.selectionEnd=s),this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),this.element.value!==c&&yR.call(this,e,t)}}function fR(e){var t,i;this.mask&&!this.readonly&&(t=this.element.value,(!e.ctrlKey&&!e.metaKey||(e.ctrlKey||e.metaKey)&&"KeyA"!==e.code&&"KeyY"!==e.code&&"KeyZ"!==e.code&&"KeyX"!==e.code&&"KeyC"!==e.code&&"KeyV"!==e.code)&&(this.maskKeyPress=!0,(i="Spacebar"===(i=e.key)?String.fromCharCode(e.keyCode):i)?1===i.length&&(wR.call(this,i,e.ctrlKey,e),e.preventDefault()):(this.isIosInvalid=!0,wR.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)&&yR.call(this,e,t)}function yR(e,t){var i,n=this.isProtectedOnChange;je(this.changeEventArgs)||this.isInitial||(this.changeEventArgs={value:this.element.value,maskedValue:this.element.value,isInteraction:!(i={}),isInteracted:!1},this.mask&&(this.changeEventArgs.value=eR.call(this,this.element)),je(e)||(this.changeEventArgs.isInteracted=!0,this.changeEventArgs.isInteraction=!0,this.changeEventArgs.event=e),this.isProtectedOnChange=!0,this.value=this.changeEventArgs.value,this.isProtectedOnChange=n,I(i,this.changeEventArgs),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",i)),this.preEleVal=this.element.value,this.prevValue=eR.call(this,this.element)}function vR(e){var t,i,n,o,r,s,a,l;this.mask&&!this.readonly?(n=void 0,this.maskKeyPress||229!==e.keyCode?xR.call(this):(r=void 0,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&&(i=this.element.selectionStart,t=this.element.value.length-this.promptMask.length,i=this.element.value.substring(i-t,i),0<this.undoCollec.length?(n=this.undoCollec[this.undoCollec.length-1],o=this.element.selectionStart,r=n.value,a=n.value.substring(o-t,o),n=this.redoCollec[0],i=i.trim(),(s=F.isAndroid&&""===i)||a===i||n.value.substring(o-t,o)===i?s&&SR.call(this,e,o-1,this.element.selectionEnd-1,i,e.ctrlKey,!1):wR.call(this,i,e.ctrlKey,e)):(r=this.promptMask,wR.call(this,i,e.ctrlKey,e)),this.maskKeyPress=!1,yR.call(this,e,r))),a=eR.call(this,this.element),(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==a||""===a&&this.value!==a)&&(this.prevValue=a,this.value=a)):yR.call(this,e),0===this.element.selectionStart&&0===this.element.selectionEnd&&(l=this.element,setTimeout(function(){l.setSelectionRange(0,0)},0))}function bR(e){this.maskKeyPress||!function(e){var t;1<e.length&&this.promptMask.length+e.length<this.element.value.length&&(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),TR.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}.call(this,e)}function wR(e,t,i){if(bR.call(this,e),!je(this)&&!je(e))for(var n,o=p=this.element.selectionStart,r=!1,s=this.element.value,a=!1,l=!1,h=0;h<e.length;h++){var d=e[h],p=this.element.selectionStart;if(this.maskKeyPress||o!==p||(p+=h),!this.maskKeyPress||p<this.promptMask.length){for(var c,u,g=p;g<this.promptMask.length;g++){var m=this.escapeMaskValue[p];"\\"===this.hiddenMask[p]&&this.hiddenMask[p+1]===e&&(l=!0),(je(this.regExpCollec[""+m])&&(je(this.customCharacters)||!je(this.customCharacters)&&je(this.customCharacters[""+m]))&&this.hiddenMask[p]!==this.promptChar&&"["!==this.customRegExpCollec[p][0]&&"]"!==this.customRegExpCollec[p][this.customRegExpCollec[p].length-1]||this.promptMask[p]!==this.promptChar&&je(this.customCharacters)||this.promptChar===m&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=p+1,p=this.element.selectionStart,m=this.hiddenMask[p])}if(je(this.customCharacters)||je(this.customCharacters[""+m]))(!je(this.regExpCollec[""+m])&&d.match(new RegExp(this.regExpCollec[""+m]))&&this.promptMask[p]===this.promptChar||this.promptMask[p]===this.promptChar&&"["===this.customRegExpCollec[p][0]&&"]"===this.customRegExpCollec[p][this.customRegExpCollec[p].length-1]&&d.match(new RegExp(this.customRegExpCollec[p])))&&(r=!0);else for(var f=this.customCharacters[""+m].split(","),g=0;g<f.length;g++)if(d.match(new RegExp("["+f[g]+"]"))){r=!0;break}(!this.maskKeyPress||p<this.hiddenMask.length)&&r?(0===h&&(this.maskKeyPress?this.undoCollec.push({value:s,startIndex:p,endIndex:p}):(c=this.element.selectionStart,u=this.element.selectionEnd,0<this.redoCollec.length?(n=this.redoCollec[0].value,TR.call(this,n),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:p,endIndex:p}),n=this.promptMask,TR.call(this,n)),this.element.selectionStart=c,this.element.selectionEnd=u)),p=this.element.selectionStart,CR.call(this,i,p,d,n,l),a=!0,h===e.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),r=!1):(p=this.element.selectionStart,SR.call(this,i,p,o,e,t,a)),h!==e.length-1||r||(!F.isAndroid||F.isAndroid&&p<this.promptMask.length)&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd})}else 1!==e.length||t||je(i)||AR.call(this)}}function CR(e,t,i,n,o){this.hiddenMask.length>this.promptMask.length&&(i=function(e,t){var i,n,o=t,r=0;for(n=0;n<this.hiddenMask.length;n++)if("\\"===this.hiddenMask[n]&&(i=o.substring(0,n)+"\\"+o.substring(n,o.length)),">"!==this.hiddenMask[n]&&"<"!==this.hiddenMask[n]&&"|"!==this.hiddenMask[n]||(this.hiddenMask[n]!==o[n]&&(i=o.substring(0,n)+this.hiddenMask[n]+o.substring(n,o.length)),++r),i){if(i[n]===this.promptChar&&n>this.element.selectionStart||this.element.value.indexOf(this.promptChar)<0&&this.element.selectionStart+r===n){r=0;break}o=i}for(;0<=n&&i;){if(0===n||"\\"!==i[n-1]){if(">"===i[n]){e=e.toUpperCase();break}if("<"===i[n]){e=e.toLowerCase();break}if("|"===i[n])break}--n}return e}.call(this,i,this.element.value)),o||(i=(o=this.element.value).substring(0,t)+i+o.substring(t+1,o.length),TR.call(this,i),this.element.selectionStart=this.element.selectionEnd=t+1)}function SR(e,t,i,n,o,r){var s;this.maskKeyPress||(s=this.element.value,t>=this.promptMask.length?TR.call(this,s.substring(0,t)):(i===t?TR.call(this,s.substring(0,t)+s.substring(t+1,s.length)):this.promptMask.length===this.element.value.length?TR.call(this,s.substring(0,t)+s.substring(t,s.length)):TR.call(this,s.substring(0,i)+s.substring(i+1,s.length)),this.element.selectionStart=this.element.selectionEnd=r||this.element.value[i]!==this.promptChar?t:i),AR.call(this)),1!==n.length||o||je(e)||AR.call(this)}function AR(){var e=this,t=this.element.parentNode,i=200;t.classList.contains(HL)||t.classList.contains(zL)?U([t],_L):U([this.element],_L),!0===this.isIosInvalid&&(i=400),pt(this.element,{"aria-invalid":"true"}),setTimeout(function(){e.maskKeyPress||xR.call(e)},i)}function xR(){var e=this.element.parentNode;je(e)||q([e],_L),q([this.element],_L),pt(this.element,{"aria-invalid":"false"})}function IR(e){if(this.mask&&void 0!==e&&(void 0===this.prevValue||this.prevValue!==e)){if(this.maskKeyPress=!0,TR.call(this,this.promptMask),""===e||null===e&&"Never"===this.floatLabelType&&this.placeholder||(this.element.selectionStart=0,this.element.selectionEnd=0),null!==e)for(var t=0;t<e.length;t++)wR.call(this,e[t],!1,null);var i=eR.call(this,this.element),i=(this.prevValue=i,this.value=i,yR.call(this,null,null),this.maskKeyPress=!1,this.element.parentNode.querySelector(".e-float-text"));this.element.value===this.promptMask&&"Auto"===this.floatLabelType&&this.placeholder&&!je(i)&&i.classList.contains(WL)&&!this.isFocus&&(q([i],WL),U([i],QL),TR.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&TR.call(this,this.value)}function TR(e,t){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&je(this.value)&&(e="");var i=eR.call(this,t||this.element,e);null===i||""===i?(HF.setValue(e,t||this.element,this.floatLabelType,!1),this.showClearButton&&this.inputObj.clearButton.classList.add("e-clear-icon-hide")):HF.setValue(e,t||this.element,this.floatLabelType,this.showClearButton)}function ER(e){U([e.element],jL);e={element:e.element,mask:e.mask,promptMask:"",hiddenMask:"",escapeMaskValue:"",promptChar:e.promptChar?1<e.promptChar.length?e.promptChar=e.promptChar[0]:e.promptChar:"_",value:e.value||null,regExpCollec:UL,customRegExpCollec:[],customCharacters:e.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return qL.call(e),e}function DR(e){var t;return t=!je(e)&&e.element.classList.contains(jL)?ER(e):t}function MR(){}kR=function(e,t){return(kR=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])}))(e,t)};var kR,PR,bk=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},BR="e-input-focus",FR=["title","style","class"],LR=(function(e,t){function i(){this.constructor=e}kR(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(RR,PR=Ji),RR.prototype.getModuleName=function(){return"maskedtextbox"},RR.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=UL,this.customRegExpCollec=[],this.maskedRegExp=[],this.undoCollec=[],this.redoCollec=[],this.changeEventArgs={},this.focusEventArgs={},this.blurEventArgs={},this.maskKeyPress=!1,this.isFocus=!1,this.isInitial=!1,this.isIosInvalid=!1;var e=R("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),q([this.cloneElement],["e-control","e-maskedtextbox","e-lib"]),this.angularTagName=null,this.formElement=z(this.element,"form"),"EJS-MASKEDTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var t=this.createElement("input"),i=0;i<this.element.attributes.length;i++)t.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue),t.innerHTML=this.element.innerHTML;this.element.hasAttribute("id")&&this.element.removeAttribute("id"),this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-maskedtextbox"),this.element.classList.add("e-mask-container"),this.element.appendChild(t),this.element=t,x("ej2_instances",e,this.element)}this.updateHTMLAttrToElement(),this.checkHtmlAttributes(!1),this.formElement&&(this.initInputValue=this.value)},RR.prototype.getPersistData=function(){return this.addOnPersist(["value"])},RR.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&("Never"===this.floatLabelType&&U([this.element],"e-input"),this.createWrapper(),this.updateHTMLAttrToWrapper(),""===this.element.name&&this.element.setAttribute("name",this.element.id),this.isInitial=!0,this.resetMaskedTextBox(),this.isInitial=!1,this.setMaskPlaceholder(!0,!1),this.setWidth(this.width),this.preEleVal=this.element.value,F.isDevice||"11.0"!==F.info.version&&"edge"!==F.info.name||this.element.blur(),F.isDevice&&F.isIos&&this.element.blur(),(this.element.getAttribute("value")||this.value)&&this.element.setAttribute("value",this.element.value),!je(z(this.element,"fieldset"))&&z(this.element,"fieldset").disabled&&(this.enabled=!1),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","maskedtextbox"),this.renderComplete())},RR.prototype.updateHTMLAttrToElement=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];FR.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},RR.prototype.updateCssClass=function(e,t){HF.setCssClass(this.getValidClassList(e),[this.inputObj.container],this.getValidClassList(t))},RR.prototype.getValidClassList=function(e){return je(e)||""===e?e:e.replace(/\s+/g," ").trim()},RR.prototype.updateHTMLAttrToWrapper=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i,n=t[e];-1<FR.indexOf(n)&&("class"===n?""!==(i=this.htmlAttributes[""+n].replace(/\s+/g," ").trim())&&U([this.inputObj.container],i.split(" ")):"style"===n?(i=je(i=this.inputObj.container.getAttribute(n))?this.htmlAttributes[""+n]:i+this.htmlAttributes[""+n],this.inputObj.container.setAttribute(n,i)):this.inputObj.container.setAttribute(n,this.htmlAttributes[""+n]))}},RR.prototype.resetMaskedTextBox=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.promptChar&&1<this.promptChar.length&&(this.promptChar=this.promptChar[0]),qL.call(this),GL.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&TR.call(this,this.value);var e=eR.call(this,this.element);this.prevValue=e,this.value=e,this.isInitial||XL.call(this),YL.call(this)},RR.prototype.setMaskPlaceholder=function(e,t){(t||this.placeholder)&&(HF.setPlaceholder(this.placeholder,this.element),this.element.value===this.promptMask&&e&&"Always"!==this.floatLabelType||this.element.value===this.promptMask&&"Never"===this.floatLabelType)&&TR.call(this,"")},RR.prototype.setWidth=function(e){je(e)||("number"==typeof e?(this.inputObj.container.style.width=T(e),this.element.style.width=T(e)):"string"==typeof e&&(e=e.match(/px|%|em/)?e:T(e),this.inputObj.container.style.width=e,this.element.style.width=e))},RR.prototype.checkHtmlAttributes=function(e){for(var t=0,i=e?je(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];t<i.length;t++){var n,o=i[t];if(!je(this.element.getAttribute(o)))switch(o){case"placeholder":(je(this.maskOptions)||void 0===this.maskOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"disabled":(je(this.maskOptions)||void 0===this.maskOptions.enabled||e)&&(n="disabled"!==this.element.getAttribute(o)&&""!==this.element.getAttribute(o)&&"true"!==this.element.getAttribute(o),this.setProperties({enabled:n},!e));break;case"value":(je(this.maskOptions)||void 0===this.maskOptions.value||e)&&this.setProperties({value:this.element.value},!e);break;case"readonly":(je(this.maskOptions)||void 0===this.maskOptions.readonly||e)&&(n="readonly"===this.element.getAttribute(o)||""===this.element.getAttribute(o)||"true"===this.element.getAttribute(o),this.setProperties({readonly:n},!e))}}},RR.prototype.createWrapper=function(){var e=this.cssClass;je(this.cssClass)||""===this.cssClass||(e=this.getValidClassList(this.cssClass)),this.inputObj=HF.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enableRtl:this.enableRtl,cssClass:e,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"))},RR.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"value":IR.call(this,this.value),this.placeholder&&!this.isFocus&&this.setMaskPlaceholder(!1,!1),""===this.value&&null!=t.value&&(this.element.selectionStart=0,this.element.selectionEnd=0);break;case"placeholder":this.setMaskPlaceholder(!0,!0);break;case"width":this.setWidth(e.width),HF.calculateWidth(this.element,this.inputObj.container);break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass);break;case"enabled":HF.setEnabled(e.enabled,this.element,this.floatLabelType,this.inputObj.container);break;case"readonly":HF.setReadonly(e.readonly,this.element);break;case"enableRtl":HF.setEnableRtl(e.enableRtl,[this.inputObj.container]);break;case"customCharacters":this.customCharacters=e.customCharacters,this.resetMaskedTextBox();break;case"showClearButton":HF.setClearButton(e.showClearButton,this.element,this.inputObj,void 0,this.createElement),KL.call(this);break;case"floatLabelType":this.floatLabelType=e.floatLabelType,HF.removeFloating(this.inputObj),HF.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement);break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHtmlAttributes(!0);break;case"mask":var o=this.value;this.mask=e.mask,this.maskedRegExp=[],this.updateValue(o);break;case"promptChar":1<e.promptChar.length&&(e.promptChar=e.promptChar[0]),e.promptChar?this.promptChar=e.promptChar:this.promptChar="_";o=this.element.value.replace(new RegExp("["+t.promptChar+"]","g"),this.promptChar);this.promptMask===this.element.value&&(o=this.promptMask.replace(new RegExp("["+t.promptChar+"]","g"),this.promptChar)),this.promptMask=this.promptMask.replace(new RegExp("["+t.promptChar+"]","g"),this.promptChar),this.undoCollec=this.redoCollec=[],TR.call(this,o)}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},RR.prototype.updateValue=function(e){this.resetMaskedTextBox(),IR.call(this,e)},RR.prototype.getMaskedValue=function(){return $L.call(this,this.element)},RR.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.isFocus=!0,this.element.focus(),U([this.inputObj.container],[BR]))},RR.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.isFocus=!1,this.element.blur(),q([this.inputObj.container],[BR]))},RR.prototype.destroy=function(){XL.call(this),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]);for(var e=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-invalid"],t=0;t<e.length;t++)this.element.removeAttribute(e[t]);this.element.classList.remove("e-input"),this.inputObj&&(this.inputObj.container.insertAdjacentElement("afterend",this.element),G(this.inputObj.container)),this.blurEventArgs=null,HF.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),this.changeEventArgs=null,this.inputObj=null,PR.prototype.destroy.call(this)},bk([e(null)],RR.prototype,"cssClass",void 0),bk([e(null)],RR.prototype,"width",void 0),bk([e(null)],RR.prototype,"placeholder",void 0),bk([e("Never")],RR.prototype,"floatLabelType",void 0),bk([e({})],RR.prototype,"htmlAttributes",void 0),bk([e(!0)],RR.prototype,"enabled",void 0),bk([e(!1)],RR.prototype,"readonly",void 0),bk([e(!1)],RR.prototype,"showClearButton",void 0),bk([e(!1)],RR.prototype,"enablePersistence",void 0),bk([e(null)],RR.prototype,"mask",void 0),bk([e("_")],RR.prototype,"promptChar",void 0),bk([e(null)],RR.prototype,"value",void 0),bk([e(null)],RR.prototype,"customCharacters",void 0),bk([i()],RR.prototype,"created",void 0),bk([i()],RR.prototype,"destroyed",void 0),bk([i()],RR.prototype,"change",void 0),bk([i()],RR.prototype,"focus",void 0),bk([i()],RR.prototype,"blur",void 0),bk([Bt],RR));function RR(e,t){t=PR.call(this,e,t)||this;return t.initInputValue="",t.preventChange=!1,t.isClicked=!1,t.maskOptions=e,t}OR=function(e,t){return(OR=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])}))(e,t)};var OR,NR,h0=function(e,t){function i(){this.constructor=e}OR(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ck=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},wk=(h0(VR,NR=n),Ck([e("None")],VR.prototype,"placement",void 0),Ck([e(10)],VR.prototype,"largeStep",void 0),Ck([e(1)],VR.prototype,"smallStep",void 0),Ck([e(!1)],VR.prototype,"showSmallTicks",void 0),Ck([e(null)],VR.prototype,"format",void 0),VR);function VR(){return null!==NR&&NR.apply(this,arguments)||this}h0(HR,_R=n),Ck([e(null)],HR.prototype,"color",void 0),Ck([e(null)],HR.prototype,"start",void 0),Ck([e(null)],HR.prototype,"end",void 0);var _R,Ir=HR;function HR(){return null!==_R&&_R.apply(this,arguments)||this}h0(jR,zR=n),Ck([e(!1)],jR.prototype,"enabled",void 0),Ck([e(null)],jR.prototype,"minStart",void 0),Ck([e(null)],jR.prototype,"minEnd",void 0),Ck([e(null)],jR.prototype,"maxStart",void 0),Ck([e(null)],jR.prototype,"maxEnd",void 0),Ck([e(!1)],jR.prototype,"startHandleFixed",void 0),Ck([e(!1)],jR.prototype,"endHandleFixed",void 0);var zR,bk=jR;function jR(){return null!==zR&&zR.apply(this,arguments)||this}h0(UR,WR=n),Ck([e("")],UR.prototype,"cssClass",void 0),Ck([e("Before")],UR.prototype,"placement",void 0),Ck([e("Focus")],UR.prototype,"showOn",void 0),Ck([e(!1)],UR.prototype,"isVisible",void 0),Ck([e(null)],UR.prototype,"format",void 0);var WR,QR=UR;function UR(){return null!==WR&&WR.apply(this,arguments)||this}var qR,GR=1e-10,YR="e-slider",XR="e-rtl",KR="e-slider-input",JR="e-control-wrapper",ZR="e-handle",$R="e-range",eO="e-slider-button",tO="e-first-button",iO="e-second-button",nO="e-scale",oO="e-tick",rO="e-large",sO="e-tick-value",aO="e-slider-tooltip",lO="e-slider-hover",hO="e-handle-first",dO="e-handle-second",pO="e-disabled",cO="e-slider-container",uO="e-slider-horizontal-before",gO="e-slider-horizontal-after",mO="e-slider-vertical-before",fO="e-slider-vertical-after",yO="e-material-tooltip-open",vO="e-tooltip-active",bO="e-material-slider",wO="e-slider-track",CO="e-slider-horizantal-color",SO="e-slider-vertical-color",AO="e-handle-focused",xO="e-vertical",IO="e-horizontal",TO="e-handle-start",EO="e-material-tooltip-start",DO="e-tab-handle",MO="e-button-icon",kO="e-small-size",PO="e-tick-pos",BO="e-first-tick",FO="e-last-tick",LO="e-slider-btn",RO="e-tab-track",OO="e-tab-range",NO="e-handle-active",VO="e-material-handle",_O="e-material-range",HO="e-material-default",zO="e-material-tooltip-show",jO="e-material-tooltip-hide",WO="e-read-only",QO="e-limits",UO="e-limit-bar",qO="e-limit-first",GO="e-limit-second",YO="e-drag-horizontal",XO="e-drag-vertical",KO=(h0(JO,qR=Ji),JO.prototype.preRender=function(){this.l10n=new Cn("slider",{incrementTitle:"Increase",decrementTitle:"Decrease"},this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},JO.prototype.formChecker=function(){var e=z(this.element,"form");e?(this.isForm=!0,je(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!je(this.formResetValue)&&"object"==typeof this.formResetValue?je(this.formResetValue)&&(this.formResetValue=parseFloat(T(this.min))):this.formResetValue=[parseFloat(T(this.min)),parseFloat(T(this.max))],this.formElement=e):this.isForm=!1},JO.prototype.initCultureFunc=function(){this.internationalization=new Ti(this.locale)},JO.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=je(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=je(this.ticks.format)?null:this.ticks.format},JO.prototype.formatString=function(e,t){var i,n=null,o=null;return!e&&0!==e||(n=this.formatNumber(e),i=this.numberOfDecimals(e),o=this.internationalization.getNumberFormat(t)(this.makeRoundNumber(e,i))),{elementVal:n,formatString:o}},JO.prototype.formatNumber=function(e){var t=this.numberOfDecimals(e);return this.internationalization.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(e)},JO.prototype.numberOfDecimals=function(e){e=e.toString().split(".")[1];return e&&e.length?e.length:0},JO.prototype.makeRoundNumber=function(e,t){return Number(e.toFixed(t||0))},JO.prototype.render=function(){var e=this;this.initialize(),this.initRender(),this.wireEvents(),this.setZindex(),this.renderComplete(),"EJS-SLIDER"===this.element.tagName&&"none"===this.getTheme(this.sliderContainer)&&setTimeout(function(){e.refresh()},0)},JO.prototype.initialize=function(){U([this.element],YR),this.setCSSClass()},JO.prototype.setElementWidth=function(e){je(e)||je(this.sliderContainer)||("number"==typeof e?this.sliderContainer.style.width=T(e):"string"==typeof e&&(this.sliderContainer.style.width=e.match(/px|%|em/)?e:T(e)))},JO.prototype.setCSSClass=function(e){e&&q([this.element],e.split(" ")),this.cssClass&&U([this.element],this.cssClass.split(" "))},JO.prototype.setEnabled=function(){this.enabled?(q([this.sliderContainer],[pO]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(pO),this.wireEvents()):(U([this.sliderContainer],[pO]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(pO),this.unwireEvents())},JO.prototype.getTheme=function(e){return window.getComputedStyle(e,":after").getPropertyValue("content").replace(/['"]+/g,"")},JO.prototype.initRender=function(){this.sliderContainer=this.createElement("div",{className:cO+" "+JR}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:wO}),this.element.appendChild(this.sliderTrack),this.setElementWidth(this.width),this.element.tabIndex=-1,this.getThemeInitialization(),this.setHandler(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setOrientClass(),this.hiddenInput=this.createElement("input",{attrs:{type:"hidden",value:je(this.value)?je(this.min)?"0":this.min.toString():this.value.toString(),name:this.element.getAttribute("name")||this.element.getAttribute("id")||"_"+(1e3*Math.random()).toFixed(0)+"slider",class:KR}}),this.hiddenInput.tabIndex=-1,this.sliderContainer.appendChild(this.hiddenInput),this.showButtons&&this.setButtons(),this.setEnableRTL(),"Range"===this.type?this.rangeValueUpdate():this.value=je(this.value)?je(this.min)?0:parseFloat(T(this.min.toString())):this.value,this.previousVal="Range"!==this.type?this.checkHandleValue(parseFloat(T(this.value.toString()))):[this.checkHandleValue(parseFloat(T(this.value[0].toString()))),this.checkHandleValue(parseFloat(T(this.value[1].toString())))],this.previousChanged=this.previousVal,je(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(),(this.enabled?q:U)([this.sliderContainer],[pO]),(this.readonly?U:q)([this.sliderContainer],[WO])},JO.prototype.getThemeInitialization=function(){this.isMaterial="material"===this.getTheme(this.sliderContainer)||"material-dark"===this.getTheme(this.sliderContainer),this.isMaterial3="Material3"===this.getTheme(this.sliderContainer)||"Material3-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.isTailwind3="tailwind3"===this.getTheme(this.sliderContainer)||"tailwind3-dark"===this.getTheme(this.sliderContainer),this.isBootstrap5="bootstrap5"===this.getTheme(this.sliderContainer),this.isFluent="FluentUI"===this.getTheme(this.sliderContainer),this.isFluent2="fluent2"===this.getTheme(this.sliderContainer),this.isBootstrap5Dot3="bootstrap5.3"===this.getTheme(this.sliderContainer),this.isMaterialTooltip=(this.isMaterial||this.isMaterial3)&&"Range"!==this.type&&this.tooltip.isVisible},JO.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:$R}}),this.element.appendChild(this.rangeBar),this.drag)&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(YO):this.rangeBar.classList.add(XO))},JO.prototype.createLimitBar=function(){var e="Range"!==this.type?UO:qO;e+=" "+QO,this.limitBarFirst=this.createElement("div",{attrs:{class:e}}),this.element.appendChild(this.limitBarFirst),"Range"===this.type&&(this.limitBarSecond=this.createElement("div",{attrs:{class:GO+" "+QO}}),this.element.appendChild(this.limitBarSecond))},JO.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(xO),this.sliderContainer.classList.add(IO),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(IO),this.sliderContainer.classList.add(xO),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},JO.prototype.setAriaAttributes=function(e){var i=this,t=this.min,n=this.max;!je(this.customValues)&&0<this.customValues.length&&(t=this.customValues[0],n=this.customValues[this.customValues.length-1]),"Range"!==this.type?pt(e,{"aria-valuemin":je(t)?"0":t.toString(),"aria-valuemax":je(n)?"100":n.toString()}):(!je(this.customValues)&&0<this.customValues.length?[[t.toString(),this.customValues[this.value[1]].toString()],[this.customValues[this.value[0]].toString(),n.toString()]]:[[t.toString(),this.value[1].toString()],[this.value[0].toString(),n.toString()]]).forEach(function(e,t){t=0===t?i.firstHandle:i.secondHandle;t&&pt(t,{"aria-valuemin":e[0],"aria-valuemax":e[1]})})},JO.prototype.createSecondHandle=function(){this.secondHandle=this.createElement("div",{attrs:{class:ZR,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.secondHandle.classList.add(dO),this.element.appendChild(this.secondHandle)},JO.prototype.createFirstHandle=function(){this.firstHandle=this.createElement("div",{attrs:{class:ZR,role:"slider",tabIndex:"0","aria-label":"slider"}}),this.firstHandle.classList.add(hO),this.element.appendChild(this.firstHandle),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:ZR+" "+VO}}),this.element.appendChild(this.materialHandle))},JO.prototype.wireFirstHandleEvt=function(e){e?(E.remove(this.firstHandle,"mousedown touchstart",this.handleFocus),E.remove(this.firstHandle,"transitionend",this.transitionEnd),E.remove(this.firstHandle,"mouseenter touchenter",this.handleOver),E.remove(this.firstHandle,"mouseleave touchend",this.handleLeave)):(E.add(this.firstHandle,"mousedown touchstart",this.handleFocus,this),E.add(this.firstHandle,"transitionend",this.transitionEnd,this),E.add(this.firstHandle,"mouseenter touchenter",this.handleOver,this),E.add(this.firstHandle,"mouseleave touchend",this.handleLeave,this))},JO.prototype.wireSecondHandleEvt=function(e){e?(E.remove(this.secondHandle,"mousedown touchstart",this.handleFocus),E.remove(this.secondHandle,"transitionend",this.transitionEnd),E.remove(this.secondHandle,"mouseenter touchenter",this.handleOver),E.remove(this.secondHandle,"mouseleave touchend",this.handleLeave)):(E.add(this.secondHandle,"mousedown touchstart",this.handleFocus,this),E.add(this.secondHandle,"transitionend",this.transitionEnd,this),E.add(this.secondHandle,"mouseenter touchenter",this.handleOver,this),E.add(this.secondHandle,"mouseleave touchend",this.handleLeave,this))},JO.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](TO),this.isMaterialTooltip)&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](TO),this.tooltipElement)&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](EO)},JO.prototype.transitionEnd=function(e){"transform"!==e.propertyName&&(this.handleStart(),this.enableAnimation||(this.getHandle().style.transition="none"),"Default"!==this.type&&(this.rangeBar.style.transition="none"),(this.isMaterial||this.isMaterial3)&&this.tooltip.isVisible&&"Default"===this.type&&(this.tooltipElement.style.transition=this.transition.handle),this.tooltipToggle(this.getHandle()),this.closeTooltip())},JO.prototype.handleFocusOut=function(){this.firstHandle.classList.contains(AO)&&this.firstHandle.classList.remove(AO),"Range"===this.type&&this.secondHandle.classList.contains(AO)&&this.secondHandle.classList.remove(AO)},JO.prototype.handleFocus=function(e){this.focusSliderElement(),this.sliderBarClick(e),(e.currentTarget===this.firstHandle?(this.firstHandle.classList.add(AO),this.firstHandle):(this.secondHandle.classList.add(AO),this.secondHandle)).classList.add(DO),E.add(document,"mousemove touchmove",this.sliderBarMove,this),E.add(document,"mouseup touchend",this.sliderBarUp,this)},JO.prototype.handleOver=function(e){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(e.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},JO.prototype.handleLeave=function(e){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||e.currentTarget.classList.contains(AO)||e.currentTarget.classList.contains(DO)||this.closeTooltip()},JO.prototype.setHandler=function(){this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},JO.prototype.setEnableRTL=function(){(this.enableRtl&&"Vertical"!==this.orientation?U:q)([this.sliderContainer],XR);var e="Vertical"!==this.orientation?this.horDir:this.verDir;this.enableRtl?this.horDir="right":this.horDir="left",this.verDir="bottom",e!==("Vertical"!==this.orientation?this.horDir:this.verDir)&&"Horizontal"===this.orientation&&(gt(this.firstHandle,{right:"",left:"auto"}),"Range"===this.type)&&gt(this.secondHandle,{top:"",left:"auto"}),this.setBarColor()},JO.prototype.tooltipValue=function(){var t,i=this,e={value:this.value,text:""};this.initialTooltip&&(this.initialTooltip=!1,this.setTooltipContent(),e.text=t="function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,this.trigger("tooltipChange",e,function(e){i.addTooltipClass(e.text),t!==e.text&&(i.customAriaText=e.text,i.enableHtmlSanitizer?e.text=go.sanitize(e.text.toString()):e.text=e.text.toString(),i.tooltipObj.content=ao(function(){return e.text}),i.setAriaAttrValue(i.firstHandle),"Range"===i.type)&&i.setAriaAttrValue(i.secondHandle)}),this.isMaterialTooltip)&&this.setPreviousVal("change",this.value)},JO.prototype.setTooltipContent=function(){var e=this.formatContent(this.tooltipFormatInfo,!1);this.tooltipObj.content=ao(function(){return e})},JO.prototype.formatContent=function(e,t){var i="",n=this.handleVal1,o=this.handleVal2;return!je(this.customValues)&&0<this.customValues.length&&(n=this.customValues[this.handleVal1],o=this.customValues[this.handleVal2]),t?"Range"===this.type?i=this.enableRtl&&"Vertical"!==this.orientation?je(this.tooltip)||je(this.tooltip.format)?o.toString()+" - "+n.toString():this.formatString(o,e).elementVal+" - "+this.formatString(n,e).elementVal:je(this.tooltip)||je(this.tooltip.format)?n.toString()+" - "+o.toString():this.formatString(n,e).elementVal+" - "+this.formatString(o,e).elementVal:je(n)||(i=je(this.tooltip)||je(this.tooltip.format)?n.toString():this.formatString(n,e).elementVal):"Range"===this.type?i=this.enableRtl&&"Vertical"!==this.orientation?je(e.format)?o.toString()+" - "+n.toString():this.formatString(o,e).formatString+" - "+this.formatString(n,e).formatString:je(e.format)?n.toString()+" - "+o.toString():this.formatString(n,e).formatString+" - "+this.formatString(o,e).formatString:je(n)||(i=je(e.format)?n.toString():this.formatString(n,e).formatString),i},JO.prototype.addTooltipClass=function(e){var t;this.isMaterialTooltip&&(e=e.toString().length,this.tooltipElement?(t=4<e?{oldCss:HO,newCss:_O}:{oldCss:_O,newCss:HO},this.tooltipElement.classList.remove(t.oldCss),this.tooltipElement.classList.contains(t.newCss)||(this.tooltipElement.classList.add(t.newCss),this.tooltipElement.style.transform=4<e?"scale(1)":this.getTooltipTransformProperties(this.previousTooltipClass).rotate)):(t=4<e?_O:HO,this.tooltipObj.cssClass=aO+" "+t))},JO.prototype.tooltipPlacement=function(){return"Horizontal"===this.orientation?"Before"===this.tooltip.placement?"TopCenter":"BottomCenter":"Before"===this.tooltip.placement?"LeftCenter":"RightCenter"},JO.prototype.tooltipBeforeOpen=function(e){this.tooltipElement=e.element,this.tooltip.cssClass&&U([this.tooltipElement],this.tooltip.cssClass.split(" ").filter(function(e){return e})),e.target.removeAttribute("aria-describedby"),this.isMaterialTooltip&&(this.tooltipElement.firstElementChild.classList.add(jO),this.handleStart(),this.setTooltipTransform())},JO.prototype.tooltipCollision=function(e){if(this.isBootstrap||this.isBootstrap4||(this.isMaterial||this.isMaterial3)&&!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)}}},JO.prototype.materialTooltipEventCallBack=function(e){this.sliderBarClick(e),E.add(document,"mousemove touchmove",this.sliderBarMove,this),E.add(document,"mouseup touchend",this.sliderBarUp,this)},JO.prototype.wireMaterialTooltipEvent=function(e){this.isMaterialTooltip&&(e?E.remove(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack):E.add(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack,this))},JO.prototype.tooltipPositionCalculation=function(e){var t;switch(e){case"TopCenter":t=uO;break;case"BottomCenter":t=gO;break;case"LeftCenter":t=mO;break;case"RightCenter":t=fO}return t},JO.prototype.getTooltipTransformProperties=function(e){var t;return this.tooltipElement&&(t="Horizontal"===this.orientation?this.tooltipElement.clientHeight+14-this.tooltipElement.clientHeight/2:this.tooltipElement.clientWidth+14-this.tooltipElement.clientWidth/2,t="Horizontal"===this.orientation?e===uO?{rotate:"rotate(45deg)",translate:"translateY("+t+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-t+"px)"}:e===mO?{rotate:"rotate(-45deg)",translate:"translateX("+t+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-t+"px)"}),t},JO.prototype.openMaterialTooltip=function(){var e,t=this;this.isMaterialTooltip&&(this.refreshTooltip(this.firstHandle),(e=this.tooltipElement.firstElementChild).classList.remove(jO),e.classList.add(zO),this.firstHandle.style.cursor="default",this.tooltipElement.style.transition=this.scaleTransform,this.tooltipElement.classList.add(yO),this.materialHandle.style.transform="scale(0)",4<e.innerText.length?this.tooltipElement.style.transform="scale(1)":this.tooltipElement.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate,"Default"===this.type?setTimeout(function(){t.tooltipElement&&(t.tooltipElement.style.transition=t.transition.handle)},2500):setTimeout(function(){t.tooltipElement&&(t.tooltipElement.style.transition="none")},2500))},JO.prototype.closeMaterialTooltip=function(){var e,t=this;this.isMaterialTooltip&&(e=this.tooltipElement.firstElementChild,this.tooltipElement.style.transition=this.scaleTransform,e.classList.remove(zO),e.classList.add(jO),this.firstHandle.style.cursor="-webkit-grab",this.firstHandle.style.cursor="grab",this.materialHandle&&(this.materialHandle.style.transform="scale(1)"),this.tooltipElement.classList.remove(yO),this.setTooltipTransform(),this.tooltipTarget=void 0,setTimeout(function(){t.tooltipElement&&(t.tooltipElement.style.transition="none")},2500))},JO.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(yO)&&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()},JO.prototype.setTooltipTransform=function(){var e=this.getTooltipTransformProperties(this.previousTooltipClass);je(this.tooltipElement)||(4<this.tooltipElement.firstElementChild.innerText.length?this.tooltipElement.style.transform=e.translate+" scale(0.01)":this.tooltipElement.style.transform=e.translate+" "+e.rotate+" scale(0.01)")},JO.prototype.renderTooltip=function(){this.tooltipObj=new NS({showTipPointer:this.isBootstrap||this.isMaterial||this.isMaterial3||this.isBootstrap4||this.isTailwind||this.isTailwind3||this.isBootstrap5||this.isFluent||this.isFluent2||this.isBootstrap5Dot3,cssClass:aO,height:this.isMaterial||this.isMaterial3?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()},JO.prototype.initializeTooltipProps=function(){var e="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){je(e)||(e.style.transition="none")}),this.isMaterialTooltip&&(this.sliderContainer.classList.add(bO),this.tooltipValue(),this.tooltipObj.animation.close.effect="None",this.tooltipObj.open(this.firstHandle))},JO.prototype.tooltipBeforeClose=function(){this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0},JO.prototype.setButtons=function(){this.firstBtn=this.createElement("div",{className:eO+" "+tO}),this.firstBtn.appendChild(this.createElement("span",{className:MO})),(this.isTailwind||this.isTailwind3)&&this.firstBtn.querySelector("span").classList.add("e-icons"),this.firstBtn.tabIndex=-1,this.secondBtn=this.createElement("div",{className:eO+" "+iO}),this.secondBtn.appendChild(this.createElement("span",{className:MO})),(this.isTailwind||this.isTailwind3)&&this.secondBtn.querySelector("span").classList.add("e-icons"),this.secondBtn.tabIndex=-1,this.sliderContainer.classList.add(LO),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle()},JO.prototype.buttonTitle=function(){var e=this.enableRtl&&"Vertical"!==this.orientation,t=(this.l10n.setLocale(this.locale),this.l10n.getConstant("decrementTitle")),i=this.l10n.getConstant("incrementTitle");pt(e?this.secondBtn:this.firstBtn,{"aria-label":t,title:t}),pt(e?this.firstBtn:this.secondBtn,{"aria-label":i,title:i})},JO.prototype.buttonFocusOut=function(){(this.isMaterial||this.isMaterial3)&&this.getHandle().classList.remove("e-large-thumb-size")},JO.prototype.repeatButton=function(e){var t,i=this.handleValueUpdate(),n=this.enableRtl&&"Vertical"!==this.orientation;e.target.parentElement.classList.contains(tO)||e.target.classList.contains(tO)?t=n?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(e.target.parentElement.classList.contains(iO)||e.target.classList.contains(iO))&&(t=n?this.add(i,parseFloat(this.step.toString()),!1):this.add(i,parseFloat(this.step.toString()),!0)),(t=this.limits.enabled?this.getLimitCorrectedValues(t):t)>=this.min&&t<=this.max&&(this.changeHandleValue(t),this.tooltipToggle(this.getHandle()))},JO.prototype.repeatHandlerMouse=function(e){e.preventDefault(),"mousedown"!==e.type&&"touchstart"!==e.type||(this.buttonClick(e),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,e))},JO.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},JO.prototype.focusHandle=function(){this.getHandle().classList.contains(DO)||this.getHandle().classList.add(DO)},JO.prototype.repeatHandlerUp=function(e){this.changeEvent("changed",e),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},JO.prototype.customTickCounter=function(e){var t=4;return t=!je(this.customValues)&&0<this.customValues.length&&(4<e&&(t=3),7<e&&(t=2),14<e&&(t=1),28<e)?0:t},JO.prototype.renderScale=function(){var e="Vertical"===this.orientation?"v":"h",t=(this.ul=this.createElement("ul",{className:nO+" e-"+e+"-scale "+oO+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation","aria-hidden":"true"}}),this.ul.style.zIndex="-1",F.isAndroid&&"h"==e&&this.ul.classList.add(PO),this.ticks.smallStep),i=(this.ticks.showSmallTicks?t<=0&&(t=parseFloat(T(this.step))):t=0<this.ticks.largeStep?this.ticks.largeStep:parseFloat(T(this.max))-parseFloat(T(this.min)),parseFloat(T(this.min))),n=parseFloat(T(this.max)),o=parseFloat(T(t)),r=!je(this.customValues)&&0<this.customValues.length&&this.customValues.length-1,s=this.customTickCounter(r),a=!je(this.customValues)&&0<this.customValues.length?r*s+r:Math.abs((n-i)/o),l=(this.element.appendChild(this.ul),parseFloat(this.min.toString())),h=("v"==e&&(l=parseFloat(this.max.toString())),0),d=100/a;d===1/0&&(d=5);for(var p=0,c=!je(this.customValues)&&0<this.customValues.length?this.customValues.length-1:0,u=0;p<=a;p++){var g,m,f,y=this.createElement("li",{attrs:{class:oO,role:"presentation","aria-hidden":"true"}}),v=(!je(this.customValues)&&0<this.customValues.length?(g=p%(s+1)==0)&&("h"==e?(l=this.customValues[u],u++):(l=this.customValues[c],c--),y.setAttribute("title",l.toString())):(y.setAttribute("title",l.toString()),g=0===this.numberOfDecimals(this.max)&&0===this.numberOfDecimals(this.min)&&0===this.numberOfDecimals(this.step)?(f="h"==e?(l-parseFloat(this.min.toString()))%this.ticks.largeStep:Math.abs(l-parseFloat(this.max.toString()))%this.ticks.largeStep,Math.abs(f)<GR||Math.abs(this.ticks.largeStep-f)<GR):(m=this.ticks.largeStep,w=l,f="h"==e?(w-i)%m:Math.abs(w-parseFloat(n.toString()))%m,Math.abs(f)<GR||Math.abs(m-f)<GR)),g&&y.classList.add(rO),"h"==e?y.style.width=d+"%":y.style.height=d+"%",g?"Both"===this.ticks.placement?2:1:0);if(g)for(var b=0;b<v;b++)this.createTick(y,l);else je(this.customValues)&&this.formatTicksValue(y,l);this.ul.appendChild(y),this.tickElementCollection.push(y);var w=void 0;je(this.customValues)&&(w=this.numberOfDecimals(t)>this.numberOfDecimals(l)?this.numberOfDecimals(t):this.numberOfDecimals(l),l="h"==e||this.min>this.max?this.makeRoundNumber(l+t,w):this.makeRoundNumber(l-t,w),h=this.makeRoundNumber(h+t,w))}this.ticksAlignment(e,d)},JO.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(BO),this.lastChild.classList.add(FO),this.sliderContainer.classList.add(nO+"-"+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+"%");e={ticksWrapper:this.ul,tickElements:this.tickElementCollection};i&&this.trigger("renderedTicks",e),this.scaleAlignment()},JO.prototype.createTick=function(e,t){var i=this.createElement("span",{className:sO+" "+oO+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation","aria-hidden":"true"}});e.appendChild(i),je(this.customValues)?this.formatTicksValue(e,t,i):this.enableHtmlSanitizer?i.innerHTML=go.sanitize(t.toString()):i.innerHTML=t.toString()},JO.prototype.formatTicksValue=function(t,e,i){var n=this,o=this.formatNumber(e),o=je(this.ticks)||je(this.ticks.format)?o:this.formatString(e,this.ticksFormatInfo).formatString;this.trigger("renderingTicks",{value:e,text:o,tickElement:t},function(e){t.setAttribute("title",e.text.toString()),i&&(n.enableHtmlSanitizer?i.innerHTML=go.sanitize(e.text.toString()):i.innerHTML=e.text.toString())})},JO.prototype.scaleAlignment=function(){this.tickValuePosition(),"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(kO):this.sliderContainer.classList.remove(kO):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(kO):this.sliderContainer.classList.remove(kO)},JO.prototype.tickValuePosition=function(){this.firstChild=this.element.querySelector("ul").children[0];for(var e,t,i=this.firstChild.getBoundingClientRect(),n=this.ticks.smallStep,n=Math.abs(parseFloat(T(this.max))-parseFloat(T(this.min)))/n,o=(0<this.firstChild.children.length&&(e=this.firstChild.children[0].getBoundingClientRect()),[this.sliderContainer.querySelectorAll("."+oO+"."+rO+" ."+sO)]),r="Both"===this.ticks.placement?[].slice.call(o[0],2):[].slice.call(o[0],1),s="Vertical"===this.orientation?2*i.height:2*i.width,a=0;a<this.firstChild.children.length;a++)"Vertical"===this.orientation?this.firstChild.children[a].style.top=-e.height/2+"px":this.enableRtl?this.firstChild.children[a].style.left=(s-this.firstChild.children[a].getBoundingClientRect().width)/2+"px":this.firstChild.children[a].style.left=-e.width/2+"px";for(a=0;a<r.length;a++)t=r[a].getBoundingClientRect(),"Vertical"===this.orientation?gt(r[a],{top:(s-t.height)/2+"px"}):gt(r[a],{left:(s-t.width)/2+"px"});this.enableRtl&&this.lastChild.children.length&&0!=n&&(this.lastChild.children[0].style.left=-this.lastChild.getBoundingClientRect().width/2+"px","Both"===this.ticks.placement)&&(this.lastChild.children[1].style.left=-this.lastChild.getBoundingClientRect().width/2+"px"),0==n&&("Horizontal"===this.orientation&&(this.enableRtl?(this.firstChild.classList.remove(FO),this.firstChild.style.right=this.firstHandle.style.right,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(FO),this.firstChild.style.left=this.firstHandle.style.left)),"Vertical"===this.orientation)&&this.firstChild.classList.remove(FO)},JO.prototype.setAriaAttrValue=function(e){var t=!je(this.ticks)&&!je(this.ticks.format),i=t?this.formatContent(this.tooltipFormatInfo,!1):this.formatContent(this.ticksFormatInfo,!1),t=t?this.formatContent(this.ticksFormatInfo,!0):this.formatContent(this.tooltipFormatInfo,!0),n=2===(i=this.customAriaText||i).split(" - ").length?i.split(" - "):[i,i];this.setAriaAttributes(e),"Range"!==this.type?pt(e,{"aria-valuenow":t,"aria-valuetext":i}):this.enableRtl?e===this.firstHandle?pt(e,{"aria-valuenow":t.split(" - ")[1],"aria-valuetext":n[1]}):pt(e,{"aria-valuenow":t.split(" - ")[0],"aria-valuetext":n[0]}):e===this.firstHandle?pt(e,{"aria-valuenow":t.split(" - ")[0],"aria-valuetext":n[0]}):pt(e,{"aria-valuenow":t.split(" - ")[1],"aria-valuetext":n[1]})},JO.prototype.handleValueUpdate=function(){var e="Range"!==this.type||1===this.activeHandle?this.handleVal1:this.handleVal2;return e},JO.prototype.getLimitCorrectedValues=function(e){return e=("MinRange"===this.type||"Default"===this.type||1===this.activeHandle?this.getLimitValueAndPosition(e,this.limits.minStart,this.limits.minEnd):this.getLimitValueAndPosition(e,this.limits.maxStart,this.limits.maxEnd))[0]},JO.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},JO.prototype.buttonClick=function(e){this.focusSliderElement();var t,i=this.enableRtl&&"Vertical"!==this.orientation,n=this.handleValueUpdate();40===e.keyCode||37===e.keyCode||e.currentTarget.classList.contains(tO)?t=i?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(iO)?t=i?this.add(n,parseFloat(this.step.toString()),!1):this.add(n,parseFloat(this.step.toString()),!0):33===e.keyCode||e.currentTarget.classList.contains(tO)?t=i?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(iO)?t=i?this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):36===e.keyCode?t=parseFloat((this.min<this.max?this.min:this.max).toString()):35===e.keyCode&&(t=parseFloat((this.min<this.max?this.max:this.min).toString())),this.limits.enabled&&(t=this.getLimitCorrectedValues(t)),this.changeHandleValue(t),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(DO)||this.materialChange(),this.tooltipToggle(this.getHandle()),this.getHandle().focus(),this.focusHandle(),e.currentTarget.classList.contains(tO)&&E.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),e.currentTarget.classList.contains(iO)&&E.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},JO.prototype.tooltipToggle=function(e){this.isMaterialTooltip?this.tooltipElement.classList.contains(yO)?this.refreshTooltip(this.firstHandle):this.openMaterialTooltip():this.tooltipElement?this.refreshTooltip(e):this.openTooltip(e)},JO.prototype.buttonUp=function(e){e.currentTarget.classList.contains(tO)&&E.remove(this.firstBtn,"mouseup touchend",this.buttonUp),e.currentTarget.classList.contains(iO)&&E.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},JO.prototype.setRangeBar=function(){"Horizontal"!==this.orientation||je(this.rangeBar)?je(this.rangeBar)||("MinRange"===this.type?(this.rangeBar.style.bottom=this.min>this.max?this.handlePos1+"px":"0px",gt(this.rangeBar,{height:je(this.handlePos1)?0:this.min>this.max?this.element.clientHeight-this.handlePos1+"px":this.handlePos1+"px"})):(this.rangeBar.style.bottom=this.min>this.max?this.handlePos2+"px":this.handlePos1+"px",gt(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":this.handlePos2-this.handlePos1+"px"}))):"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",gt(this.rangeBar,{width:je(this.handlePos1)?0:this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",gt(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"}))},JO.prototype.checkValidValueAndPos=function(e){return e=this.checkHandleValue(e),e=this.checkHandlePosition(e)},JO.prototype.setLimitBarPositions=function(e,t,i,n){"Horizontal"===this.orientation?(this.enableRtl?this.limitBarFirst.style.right=e+"px":this.limitBarFirst.style.left=e+"px",this.limitBarFirst.style.width=t-e+"px"):(this.limitBarFirst.style.bottom=(this.min<this.max?e:t)+"px",this.limitBarFirst.style.height=(this.min<this.max?t-e:e-t)+"px"),"Range"===this.type&&("Horizontal"===this.orientation?(this.enableRtl?this.limitBarSecond.style.right=i+"px":this.limitBarSecond.style.left=i+"px",this.limitBarSecond.style.width=n-i+"px"):(this.limitBarSecond.style.bottom=(this.min<this.max?i:n)+"px",this.limitBarSecond.style.height=(this.min<this.max?n-i:i-n)+"px"))},JO.prototype.setLimitBar=function(){var e,t,i,n;"Default"===this.type||"MinRange"===this.type?(e=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0],e=this.checkValidValueAndPos(e),t=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0],t=this.checkValidValueAndPos(t),this.setLimitBarPositions(e,t)):"Range"===this.type&&(e=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0],e=this.checkValidValueAndPos(e),t=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0],t=this.checkValidValueAndPos(t),i=this.getLimitValueAndPosition(this.limits.maxStart,this.limits.maxStart,this.limits.maxEnd,!0)[0],i=this.checkValidValueAndPos(i),n=this.getLimitValueAndPosition(this.limits.maxEnd,this.limits.maxStart,this.limits.maxEnd,!0)[0],n=this.checkValidValueAndPos(n),this.setLimitBarPositions(e,t,i,n))},JO.prototype.getLimitValueAndPosition=function(e,t,i,n){return je(t)&&(t=this.min<this.max?this.min:this.max,je(e))&&n&&(e=t),je(i)&&(i=this.min<this.max?this.max:this.min,je(e))&&n&&(e=i),[e=i<(e=e<t?t:e)?i:e,this.checkHandlePosition(e)]},JO.prototype.setValue=function(){var e;!je(this.customValues)&&0<this.customValues.length&&(this.min=0,this.max=this.customValues.length-1,this.setBarColor()),this.setAriaAttributes(this.firstHandle),this.handleVal1=je(this.value)?this.checkHandleValue(parseFloat(this.min.toString())):this.checkHandleValue(parseFloat(this.value.toString())),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.preHandlePos1=this.handlePos1,je(this.activeHandle)&&(this.activeHandle="Range"===this.type?2:1),"Default"===this.type||"MinRange"===this.type?(this.limits.enabled&&(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)):this.validateRangeValue(),"Default"!==this.type&&this.setRangeBar(),this.limits.enabled&&this.setLimitBar()},JO.prototype.rangeValueUpdate=function(){null!==this.value&&"object"==typeof this.value||(this.value=[parseFloat(T(this.min)),parseFloat(T(this.max))])},JO.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},JO.prototype.modifyZindex=function(){"Range"!==this.type||je(this.firstHandle)||je(this.secondHandle)?this.isMaterialTooltip&&this.tooltipElement&&(this.tooltipElement.style.zIndex=Iv(this.element)+""):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+"")},JO.prototype.setHandlePosition=function(e){var t=this,i=1===this.activeHandle?this.handlePos1:this.handlePos2,n=this.isMaterialTooltip?[this.firstHandle,this.materialHandle]:[this.getHandle()];this.handleStart(),n.forEach(function(e){je(e)||("Horizontal"===t.orientation?t.enableRtl?e.style.right=i+"px":e.style.left=i+"px":e.style.bottom=i+"px")}),this.changeEvent("change",e)},JO.prototype.getHandle=function(){return 1===this.activeHandle?this.firstHandle:this.secondHandle},JO.prototype.setRangeValue=function(){this.updateRangeValue(),this.activeHandle=1,this.setHandlePosition(null),this.activeHandle=2,this.setHandlePosition(null),this.activeHandle=1},JO.prototype.changeEvent=function(e,t){var i,n="change"===e?this.previousVal:this.previousChanged;"Range"!==this.type?(this.setProperties({value:this.handleVal1},!0),n===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)):(i=this.value=[this.handleVal1,this.handleVal2],this.setProperties({value:i},!0),(n.length===this.value.length&&this.value[0]!==n[0]||this.value[1]!==n[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()},JO.prototype.changeEventArgs=function(e,t){e=this.tooltip.isVisible&&this.tooltipObj&&this.initialTooltip?(this.tooltipValue(),{value:this.value,previousValue:"change"===e?this.previousVal:this.previousChanged,action:e,text:"function"==typeof this.tooltipObj.content?this.tooltipObj.content():this.tooltipObj.content,isInteracted:!je(t)}):{value:this.value,previousValue:"change"===e?this.previousVal:this.previousChanged,action:e,text:je(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:!je(t)};return e},JO.prototype.setPreviousVal=function(e,t){"change"===e?this.previousVal=t:this.previousChanged=t},JO.prototype.updateRangeValue=function(){var e=this.value.toString().split(",").map(Number);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.min<this.max&&this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.min>this.max&&this.handlePos1<this.handlePos2&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.preHandlePos1=this.handlePos1,this.preHandlePos2=this.handlePos2,this.limits.enabled&&(this.activeHandle=1,e=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd),this.handleVal1=e[0],this.handlePos1=e[1],this.preHandlePos1=this.handlePos1,this.activeHandle=2,e=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=e[0],this.handlePos2=e[1],this.preHandlePos2=this.handlePos2)},JO.prototype.checkHandlePosition=function(e){return e=100*(e-parseFloat(T(this.min)))/(parseFloat(T(this.max))-parseFloat(T(this.min))),e="Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(e/100):this.element.getBoundingClientRect().height*(e/100),e=parseFloat(T(this.max))===parseFloat(T(this.min))?"Horizontal"===this.orientation?this.element.getBoundingClientRect().width:this.element.getBoundingClientRect().height:e},JO.prototype.checkHandleValue=function(e){var t;return this.min===this.max?parseFloat(T(this.max)):(e<(t=this.tempStartEnd()).start?e=t.start:e>t.end&&(e=t.end),e)},JO.prototype.reposition=function(){var e=this;je(this.firstHandle)||(this.firstHandle.style.transition="none"),"Default"===this.type||je(this.rangeBar)||(this.rangeBar.style.transition="none"),"Range"!==this.type||je(this.secondHandle)||(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&&!je(this.materialHandle)&&(this.enableRtl?this.materialHandle.style.right=this.handlePos1+"px":this.materialHandle.style.left=this.handlePos1+"px"),"MinRange"!==this.type||je(this.rangeBar)?"Range"!==this.type||je(this.secondHandle)||je(this.rangeBar)||(this.enableRtl?(this.secondHandle.style.right=this.handlePos2+"px",this.rangeBar.style.right=this.handlePos1+"px"):(this.secondHandle.style.left=this.handlePos2+"px",this.rangeBar.style.left=this.handlePos1+"px"),gt(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",gt(this.rangeBar,{width:je(this.handlePos1)?0: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=this.min>this.max?this.handlePos1+"px":"0px",gt(this.rangeBar,{height:je(this.handlePos1)?0:this.min>this.max?this.element.clientHeight-this.handlePos1+"px":this.handlePos1+"px"})):"Range"===this.type&&(this.secondHandle.style.bottom=this.handlePos2+"px",this.rangeBar.style.bottom=this.min>this.max?this.handlePos2+"px":this.handlePos1+"px",gt(this.rangeBar,{height:this.min>this.max?this.handlePos1-this.handlePos2+"px":this.handlePos2-this.handlePos1+"px"}))),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.handleStart(),this.tooltip.isVisible||setTimeout(function(){je(e.firstHandle)||(e.firstHandle.style.transition=e.scaleTransform),"Range"!==e.type||je(e.secondHandle)||(e.secondHandle.style.transition=e.scaleTransform)}),this.refreshTooltip(this.tooltipTarget),this.setBarColor()},JO.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.min<this.max||this.handlePos1<this.handlePos2&&this.min>this.max)&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.handlePos1!==this.preHandlePos1&&(t=this.preHandlePos1=this.handlePos1)):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.min<this.max||this.handlePos2>this.handlePos1&&this.min>this.max)&&(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))},JO.prototype.tempStartEnd=function(){return this.min>this.max?{start:this.max,end:this.min}:{start:this.min,end:this.max}},JO.prototype.xyToPosition=function(e){var t,i;if(this.min===this.max)return 100;"Horizontal"===this.orientation?(t=e.x-this.element.getBoundingClientRect().left,i=this.element.offsetWidth/100,this.val=t/i):(t=e.y-this.element.getBoundingClientRect().top,i=this.element.offsetHeight/100,this.val=100-t/i);e=this.stepValueCalculation(this.val);return e<0?e=0:100<e&&(e=100),this.enableRtl&&"Vertical"!==this.orientation&&(e=100-e),"Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(e/100):this.element.getBoundingClientRect().height*(e/100)},JO.prototype.stepValueCalculation=function(e){0===this.step&&(this.step=1);var t=parseFloat(T(this.step))/((parseFloat(T(this.max))-parseFloat(T(this.min)))/100),i=e%Math.abs(t);return 0!=i&&(i<t/2?e-=i:e+=Math.abs(t)-i),e},JO.prototype.add=function(e,t,i){var n=Math.pow(10,3),i=i?(Math.round(e*n)+Math.round(t*n))/n:(Math.round(e*n)-Math.round(t*n))/n;return i},JO.prototype.positionToValue=function(e){var t=parseFloat(T(this.max))-parseFloat(T(this.min)),e="Horizontal"===this.orientation?e/this.element.getBoundingClientRect().width*t:e/this.element.getBoundingClientRect().height*t;return this.add(e,parseFloat(this.min.toString()),!0)},JO.prototype.sliderBarClick=function(e){e.preventDefault(),"mousedown"===e.type||"mouseup"===e.type||"click"===e.type?i={x:e.clientX,y:e.clientY}:"touchend"!==e.type&&"touchstart"!==e.type||(i={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY});var t,i=this.xyToPosition(i),n=this.positionToValue(i),o=(("Range"===this.type&&(this.min<this.max&&this.handlePos2-i<i-this.handlePos1||this.min>this.max&&this.handlePos1-i>i-this.handlePos2)?(this.activeHandle=2,this.limits.enabled&&this.limits.endHandleFixed||(this.limits.enabled&&(n=(o=this.getLimitValueAndPosition(n,this.limits.maxStart,this.limits.maxEnd))[0],i=o[1]),this.secondHandle.classList.add(NO),this.handlePos2=this.preHandlePos2=i,this.handleVal2=n),this.modifyZindex(),this.secondHandle):(this.activeHandle=1,this.limits.enabled&&this.limits.startHandleFixed||(this.limits.enabled&&(n=(o=this.getLimitValueAndPosition(n,this.limits.minStart,this.limits.minEnd))[0],i=o[1]),this.firstHandle.classList.add(NO),this.handlePos1=this.preHandlePos1=i,this.handleVal1=n),this.modifyZindex(),this.firstHandle)).focus(),this.isMaterialTooltip&&this.tooltipElement.classList.add(vO),this.element.querySelector("."+DO)),i=(o&&this.getHandle()!==o&&o.classList.remove(DO),1===this.activeHandle?this.firstHandle:this.secondHandle);"click"!==e.type&&"mousedown"!==e.type||e.target!==i||(o=e.clientX,t=e.clientY,document.elementFromPoint(o,t)),this.checkRepeatedValue(n)&&(o=(this.isMaterial||this.isMaterial3)&&this.tooltip.isVisible?this.transitionOnMaterialTooltip:this.transition,this.getHandle().style.transition=o.handle,"Default"!==this.type&&(this.rangeBar.style.transition=o.rangeBar),this.setHandlePosition(e),this.isMaterialTooltip&&(this.initialTooltip=!1),e.target!==i&&this.changeEvent("changed",e),"Default"!==this.type)&&this.setRangeBar()},JO.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)},JO.prototype.dragRangeBarMove=function(e){var t,i,n;"touchmove"!==e.type&&e.preventDefault(),this.rangeBarDragged=!0,this.rangeBar.style.transition="none",this.firstHandle.style.transition="none",this.secondHandle.style.transition="none",t=("mousemove"===e.type?(i=(t=[e.clientX,e.clientY])[0],t):(i=(t=[e.changedTouches[0].clientX,e.changedTouches[0].clientY])[0],t))[1],this.limits.enabled&&this.limits.startHandleFixed||this.limits.enabled&&this.limits.endHandleFixed||(n=this.enableRtl?{x:i+this.secondPartRemain,y:t+this.secondPartRemain}:{x:i-this.firstPartRemain,y:t+this.secondPartRemain},this.min>this.max?(this.handlePos2=this.xyToPosition(n),this.handleVal2=this.positionToValue(this.handlePos2)):(this.handlePos1=this.xyToPosition(n),this.handleVal1=this.positionToValue(this.handlePos1)),n=this.enableRtl?{x:i-this.firstPartRemain,y:t-this.firstPartRemain}:{x:i+this.secondPartRemain,y:t-this.firstPartRemain},this.min>this.max?(this.handlePos1=this.xyToPosition(n),this.handleVal1=this.positionToValue(this.handlePos1)):(this.handlePos2=this.xyToPosition(n),this.handleVal2=this.positionToValue(this.handlePos2)),this.limits.enabled&&(i=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd),this.handleVal1=i[0],this.handlePos1=i[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),i=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=i[0],this.handlePos2=i[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.min>this.max?this.min:this.max)&&this.handleValueAdjust(this.handleVal2,this.min>this.max?this.min:this.max,2),this.handleVal1===(this.min>this.max?this.max:this.min)&&this.handleValueAdjust(this.handleVal1,this.min>this.max?this.max:this.min,1)),this.activeHandle=1,this.setHandlePosition(e),this.activeHandle=2,this.setHandlePosition(e),this.tooltipToggle(this.rangeBar),this.setRangeBar()},JO.prototype.sliderBarUp=function(e){this.changeEvent("changed",e),this.handleFocusOut(),this.firstHandle.classList.remove(NO),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(NO)),this.closeTooltip(),(this.isMaterial||this.isMaterial3)&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip)&&this.tooltipElement.classList.remove(vO),E.remove(document,"mousemove touchmove",this.sliderBarMove),E.remove(document,"mouseup touchend",this.sliderBarUp)},JO.prototype.sliderBarMove=function(e){"touchmove"!==e.type&&e.preventDefault(),n="mousemove"===e.type?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};var t,i,n=this.xyToPosition(n),o=this.positionToValue(n);n=Math.round(n),"Range"!==this.type&&1===this.activeHandle&&(this.limits.enabled&&this.limits.startHandleFixed||(this.limits.enabled&&(n=(t=this.getLimitValueAndPosition(o,this.limits.minStart,this.limits.minEnd))[1],o=t[0]),this.handlePos1=n,this.handleVal1=o),this.firstHandle.classList.add(NO)),"Range"===this.type&&(1===this.activeHandle?(this.firstHandle.classList.add(NO),this.limits.enabled&&this.limits.startHandleFixed||((this.min<this.max&&n>this.handlePos2||this.min>this.max&&n<this.handlePos2)&&(n=this.handlePos2,o=this.handleVal2),n!==this.preHandlePos1&&(this.limits.enabled&&(o=(i=this.getLimitValueAndPosition(o,this.limits.minStart,this.limits.minEnd))[0],n=i[1]),this.handlePos1=this.preHandlePos1=n,this.handleVal1=o,this.activeHandle=1))):2===this.activeHandle&&(this.secondHandle.classList.add(NO),this.limits.enabled&&this.limits.endHandleFixed||((this.min<this.max&&n<this.handlePos1||this.min>this.max&&n>this.handlePos1)&&(n=this.handlePos1,o=this.handleVal1),n!==this.preHandlePos2&&(this.limits.enabled&&(o=(i=this.getLimitValueAndPosition(o,this.limits.maxStart,this.limits.maxEnd))[0],n=i[1]),this.handlePos2=this.preHandlePos2=n,this.handleVal2=o,this.activeHandle=2)))),this.checkRepeatedValue(o)&&(this.getHandle().style.transition=this.scaleTransform,"Default"!==this.type&&(this.rangeBar.style.transition="none"),this.setHandlePosition(e),!this.isMaterial&&!this.isMaterial3||this.tooltip.isVisible||this.getHandle().classList.contains(DO)||this.materialChange(),this.tooltipToggle(this.getHandle()),"Default"!==this.type)&&this.setRangeBar()},JO.prototype.dragRangeBarUp=function(e){this.rangeBarDragged?this.isDragComplete=!0:(this.focusSliderElement(),this.sliderBarClick(e)),this.changeEvent("changed",e),this.closeTooltip(),E.remove(document,"mousemove touchmove",this.dragRangeBarMove),E.remove(document,"mouseup touchend",this.dragRangeBarUp),this.rangeBarDragged=!1},JO.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},JO.prototype.refreshTooltip=function(e){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),e)&&(this.tooltipObj.refresh(e),this.tooltipTarget=e)},JO.prototype.openTooltip=function(e){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(e),this.tooltipTarget=e)},JO.prototype.closeTooltip=function(){this.tooltip.isVisible&&this.tooltipObj&&"Always"!==this.tooltip.showOn&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.close(),this.tooltipTarget=void 0)},JO.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)}},JO.prototype.wireButtonEvt=function(e){e?(E.remove(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut),E.remove(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut),E.remove(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse),E.remove(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),E.remove(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse),E.remove(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),E.remove(this.firstBtn,"focusout",this.sliderFocusOut),E.remove(this.secondBtn,"focusout",this.sliderFocusOut)):(E.add(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut,this),E.add(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut,this),E.add(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse,this),E.add(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),E.add(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse,this),E.add(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),E.add(this.firstBtn,"focusout",this.sliderFocusOut,this),E.add(this.secondBtn,"focusout",this.sliderFocusOut,this))},JO.prototype.rangeBarMousedown=function(e){var t,i,n;e.preventDefault(),this.focusSliderElement(),"Range"===this.type&&this.drag&&e.target===this.rangeBar&&(n=i=void 0,"mousedown"===e.type?(i=(t=[e.clientX,e.clientY])[0],n=t[1]):"touchstart"===e.type&&(i=(t=[e.changedTouches[0].clientX,e.changedTouches[0].clientY])[0],n=t[1]),"Horizontal"===this.orientation?(this.firstPartRemain=i-this.rangeBar.getBoundingClientRect().left,this.secondPartRemain=this.rangeBar.getBoundingClientRect().right-i):(this.firstPartRemain=n-this.rangeBar.getBoundingClientRect().top,this.secondPartRemain=this.rangeBar.getBoundingClientRect().bottom-n),this.minDiff=this.handleVal2-this.handleVal1,this.tooltipToggle(this.rangeBar),(e=this.element.querySelector("."+DO))&&e.classList.remove(DO),E.add(document,"mousemove touchmove",this.dragRangeBarMove,this),E.add(document,"mouseup touchend",this.dragRangeBarUp,this))},JO.prototype.elementClick=function(e){this.isDragComplete?this.isDragComplete=!1:(e.preventDefault(),this.focusSliderElement(),this.sliderBarClick(e),this.focusHandle())},JO.prototype.wireEvents=function(){this.onresize=this.reposition.bind(this),window.addEventListener("resize",this.onresize),this.enabled&&!this.readonly&&(E.add(this.element,"click",this.elementClick,this),"Range"===this.type&&this.drag&&E.add(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown,this),E.add(this.sliderContainer,"keydown",this.keyDown,this),E.add(this.sliderContainer,"keyup",this.keyUp,this),E.add(this.element,"focusout",this.sliderFocusOut,this),E.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)&&E.add(this.formElement,"reset",this.formResetHandler,this)},JO.prototype.unwireEvents=function(){E.remove(this.element,"click",this.elementClick),"Range"===this.type&&this.drag&&E.remove(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown),E.remove(this.sliderContainer,"keydown",this.keyDown),E.remove(this.sliderContainer,"keyup",this.keyUp),E.remove(this.element,"focusout",this.sliderFocusOut),E.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),E.remove(this.element,"reset",this.formResetHandler)},JO.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},JO.prototype.keyUp=function(e){var t;9===e.keyCode&&e.target.classList.contains(ZR)&&(this.focusSliderElement(),e.target.classList.contains(DO)||(this.element.querySelector("."+DO)&&this.element.querySelector("."+DO).classList.remove(DO),e.target.classList.add(DO),(t=e.target.parentElement)===this.element&&(t.querySelector("."+wO).classList.add(RO),"Range"!==this.type&&"MinRange"!==this.type||t.querySelector("."+$R).classList.add(OO)),"Range"===this.type&&((t=e.target.previousSibling)&&t.classList.contains(ZR)?this.activeHandle=2:this.activeHandle=1),this.getHandle().focus(),this.tooltipToggle(this.getHandle()))),this.closeTooltip(),this.changeEvent("changed",e)},JO.prototype.hover=function(e){je(e)||("mouseover"===e.type||"touchmove"===e.type||"mousemove"===e.type||"pointermove"===e.type||"touchstart"===e.type?this.sliderContainer.classList.add(lO):(this.sliderContainer.classList.remove(lO),e=e.currentTarget,this.tooltip.isVisible&&"Always"!==this.tooltip.showOn&&this.tooltipObj&&this.isMaterialTooltip&&!e.classList.contains(AO)&&!e.classList.contains(DO)&&this.closeMaterialTooltip()))},JO.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.closeTooltip(),this.element.querySelector("."+DO)&&this.element.querySelector("."+DO).classList.remove(DO),this.element.querySelector("."+RO)&&(this.element.querySelector("."+RO).classList.remove(RO),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+OO)||this.element.querySelector("."+OO).classList.remove(OO)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},JO.prototype.removeElement=function(e){e.parentNode&&e.parentNode.removeChild(e)},JO.prototype.changeSliderType=function(e,t){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(bO),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&&!je(this.tooltipObj)&&(this.tooltipObj.destroy(),this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0),this.limits.enabled&&("MinRange"===e||"Default"===e?je(this.limitBarFirst)||(this.removeElement(this.limitBarFirst),this.limitBarFirst=void 0):je(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(!this.enabled),"Range"===this.type&&this.wireSecondHandleEvt(!this.enabled),this.setValue(),this.tooltip.isVisible&&(this.renderTooltip(),this.wireMaterialTooltipEvent(!1)),this.setBarColor(),"tooltip"!==t&&this.updateConfig(),this.readonly&&(this.sliderContainer.classList.remove(WO),this.setReadOnly())},JO.prototype.changeRtl=function(){var e;this.enableRtl||"Range"!==this.type||(this.value=[this.handleVal2,this.handleVal1]),this.updateConfig(),this.tooltip.isVisible&&this.tooltipObj.refresh(this.firstHandle),this.showButtons&&(pt((e=this.enableRtl&&"Vertical"!==this.orientation)?this.secondBtn:this.firstBtn,{"aria-label":"Decrease",title:"Decrease"}),pt(e?this.firstBtn:this.secondBtn,{"aria-label":"Increase",title:"Increase"}))},JO.prototype.changeOrientation=function(){this.changeSliderType(this.type,"null")},JO.prototype.updateConfig=function(){this.setEnableRTL(),this.setValue(),this.tooltip.isVisible&&this.refreshTooltip(this.tooltipTarget),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.limitsPropertyChange()},JO.prototype.limitsPropertyChange=function(){this.limits.enabled?(je(this.limitBarFirst)&&"Range"!==this.type&&this.createLimitBar(),je(this.limitBarFirst)&&je(this.limitBarSecond)&&"Range"===this.type&&this.createLimitBar(),this.setLimitBar(),this.setValue()):(je(this.limitBarFirst)||G(this.limitBarFirst),je(this.limitBarSecond)||G(this.limitBarSecond))},JO.prototype.getPersistData=function(){return this.addOnPersist(["value"])},JO.prototype.destroy=function(){qR.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),q([this.sliderContainer],[pO]),this.firstHandle.removeAttribute("aria-orientation"),"Range"===this.type&&this.secondHandle.removeAttribute("aria-orientation"),this.sliderContainer.parentNode&&this.sliderContainer.parentNode.insertBefore(this.element,this.sliderContainer),G(this.sliderContainer),this.tooltip.isVisible&&this.tooltipObj.destroy(),this.element.innerHTML="",this.hiddenInput=null,this.sliderContainer=null,this.sliderTrack=null,this.rangeBar=null,this.firstHandle=null,this.secondHandle=null,this.tickElementCollection=null,this.ul=null,this.firstBtn=null,this.secondBtn=null,this.materialHandle=null,this.tooltipObj=null,this.tooltipTarget=null,this.limitBarFirst=null,this.limitBarSecond=null,this.firstChild=null,this.lastChild=null,this.tooltipElement=null},JO.prototype.onPropertyChanged=function(e,t){for(var i=this,n=0,o=Object.keys(e);n<o.length;n++){var r,s=o[n];switch(s){case"cssClass":this.setCSSClass(t.cssClass);break;case"value":e&&t&&(r=je(e.value)?"Range"===this.type?[this.min,this.max]:this.min:e.value,this.setProperties({value:r},!0),je(t.value)||t.value.toString()===r.toString()||(this.setValue(),this.refreshTooltip(this.tooltipTarget),"Range"===this.type&&(je(e.value)||t.value[1]===r[1]?this.activeHandle=1:this.activeHandle=2)));break;case"min":case"step":case"max":this.setMinMaxValue();break;case"tooltip":je(e.tooltip)||je(t.tooltip)||(this.initialTooltip=!0,this.setTooltip(s),this.showButtons)||this.wireEvents();break;case"type":je(t)||!Object.keys(t).length||je(t.type)||(this.changeSliderType(t.type,s),this.setZindex());break;case"enableRtl":t.enableRtl!==e.enableRtl&&"Vertical"!==this.orientation&&(this.rtl=t.enableRtl,this.changeRtl());break;case"limits":this.limitsPropertyChange();break;case"orientation":this.changeOrientation();break;case"ticks":je(this.sliderContainer.querySelector("."+nO))||(G(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(e){e.match(/e-scale-/)&&i.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)):this.firstBtn&&this.secondBtn&&(this.sliderContainer.removeChild(this.firstBtn),this.sliderContainer.removeChild(this.secondBtn),this.sliderContainer.classList.remove(LO),this.firstBtn=void 0,this.secondBtn=void 0,this.reposition());break;case"enabled":this.setEnabled();break;case"readonly":this.setReadOnly();break;case"customValues":this.setValue(),this.reposition();break;case"colorRange":this.reposition();break;case"width":this.setElementWidth(e.width),this.setMinMaxValue(),this.limits&&this.limitsPropertyChange()}}},JO.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(WO)):(this.wireEvents(),this.sliderContainer.classList.remove(WO))},JO.prototype.setMinMaxValue=function(){var t=this;this.setValue(),this.refreshTooltip(this.tooltipTarget),je(this.sliderContainer.querySelector("."+nO))||this.ul&&(G(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(e){e.match(/e-scale-/)&&t.sliderContainer.classList.remove(e)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex())},JO.prototype.setZindex=function(){this.zIndex=6,je(this.ticks)||"None"===this.ticks.placement||je(this.ul)||je(this.element)||(this.ul.style.zIndex=this.zIndex+-7+"",this.element.style.zIndex=this.zIndex+2+""),this.isMaterial||this.isMaterial3||je(this.ticks)||"Both"!==this.ticks.placement||(this.element.style.zIndex=this.zIndex+2+""),je(this.firstHandle)||(this.firstHandle.style.zIndex=this.zIndex+3+""),"Range"!==this.type||je(this.secondHandle)||(this.secondHandle.style.zIndex=this.zIndex+4+"")},JO.prototype.setTooltip=function(e){this.changeSliderType(this.type,e)},JO.prototype.setBarColor=function(){for(var e,t,i=this.sliderTrack.lastElementChild;i;)this.sliderTrack.removeChild(i),i=this.sliderTrack.lastElementChild;for(var n,o,r,s=0;s<this.colorRange.length;s++)je(this.colorRange[s].start)||je(this.colorRange[s].end)||this.colorRange[s].end>this.colorRange[s].start&&(this.colorRange[s].start<this.min&&(this.colorRange[s].start=this.min),this.colorRange[s].end>this.max&&(this.colorRange[s].end=this.max),n=this.checkHandlePosition(this.colorRange[s].start),o=this.checkHandlePosition(this.colorRange[s].end),(r=this.createElement("div")).style.backgroundColor=this.colorRange[s].color,r.style.border="1px solid "+this.colorRange[s].color,"Horizontal"===this.orientation?(t=CO,e=this.enableRtl?je(this.customValues)?this.checkHandlePosition(this.max)-this.checkHandlePosition(this.colorRange[s].end):this.checkHandlePosition(this.customValues.length-this.colorRange[s].end-1):this.checkHandlePosition(this.colorRange[s].start),r.style.width=o-n+"px",r.style.left=e+"px"):(t=SO,e=this.checkHandlePosition(this.colorRange[s].start),r.style.height=o-n+"px",r.style.bottom=e+"px"),r.classList.add(t),this.sliderTrack.appendChild(r))},JO.prototype.getModuleName=function(){return"slider"},Ck([e(null)],JO.prototype,"value",void 0),Ck([e(null)],JO.prototype,"customValues",void 0),Ck([e(1)],JO.prototype,"step",void 0),Ck([e(null)],JO.prototype,"width",void 0),Ck([e(0)],JO.prototype,"min",void 0),Ck([e(100)],JO.prototype,"max",void 0),Ck([e(!1)],JO.prototype,"readonly",void 0),Ck([e("Default")],JO.prototype,"type",void 0),Ck([kt([{}],Ir)],JO.prototype,"colorRange",void 0),Ck([t({},wk)],JO.prototype,"ticks",void 0),Ck([t({},bk)],JO.prototype,"limits",void 0),Ck([e(!0)],JO.prototype,"enabled",void 0),Ck([t({},QR)],JO.prototype,"tooltip",void 0),Ck([e(!1)],JO.prototype,"showButtons",void 0),Ck([e(!0)],JO.prototype,"enableAnimation",void 0),Ck([e("Horizontal")],JO.prototype,"orientation",void 0),Ck([e("")],JO.prototype,"cssClass",void 0),Ck([e(!0)],JO.prototype,"enableHtmlSanitizer",void 0),Ck([i()],JO.prototype,"created",void 0),Ck([i()],JO.prototype,"change",void 0),Ck([i()],JO.prototype,"changed",void 0),Ck([i()],JO.prototype,"renderingTicks",void 0),Ck([i()],JO.prototype,"renderedTicks",void 0),Ck([i()],JO.prototype,"tooltipChange",void 0),Ck([Bt],JO));function JO(e,t){e=qR.call(this,e,t)||this;return e.horDir="left",e.verDir="bottom",e.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)"},e.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"},e.scaleTransform="transform .4s cubic-bezier(.25, .8, .25, 1)",e.customAriaText=null,e.drag=!0,e.isDragComplete=!1,e.initialTooltip=!0,e}ZO=function(e,t){return(ZO=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])}))(e,t)};var ZO,$O,eN,tN,h0=function(e,t){function i(){this.constructor=e}ZO(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ck=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},iN={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}$")},nN=((aN=$O=$O||{})[aN.Message=0]="Message",aN[aN.Label=1]="Label",h0(oN,eN=Ct),(tN=oN).prototype.addRules=function(e,t){e&&(this.rules.hasOwnProperty(e)?Pe(this.rules[""+e],t,{}):this.rules[""+e]=t)},oN.prototype.removeRules=function(e,t){if(e||t){if(this.rules[""+e]&&!t)delete this.rules[""+e];else if(!je(this.rules[""+e]&&t))for(var i=0;i<t.length;i++)delete this.rules[""+e][t[parseInt(i.toString(),10)]]}else this.rules={}},oN.prototype.validate=function(t){var e=Object.keys(this.rules);if(t&&e.length)return this.validateRules(t),-1!==e.indexOf(t)&&0===this.errorRules.filter(function(e){return e.name===t}).length;this.errorRules=[];for(var i=0,n=e;i<n.length;i++){var o=n[i];this.validateRules(o)}return 0===this.errorRules.length},oN.prototype.reset=function(){this.element.reset(),this.clearForm()},oN.prototype.getInputElement=function(e){return this.inputElement=ge('[name="'+e+'"]',this.element),this.inputElement},oN.prototype.destroy=function(){this.reset(),this.unwireEvents(),this.rules={};for(var e=0,t=ct("."+this.errorClass+", ."+this.validClass,this.element);e<t.length;e++)G(t[e]);eN.prototype.destroy.call(this),this.infoElement=null,Ci.off("notifyExternalChange",this.afterLocalization)},oN.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)"locale"===n[i]&&this.localeFunc()},oN.prototype.localeFunc=function(){for(var e=0,t=Object.keys(this.defaultMessages);e<t.length;e++){var i=t[e],n=(this.l10n.setLocale(this.locale),this.l10n.getConstant(i));this.localyMessage[""+i]=n}},oN.prototype.getModuleName=function(){return"formvalidator"},oN.prototype.afterLocalization=function(e){this.locale=e.locale,this.localeFunc()},oN.prototype.refresh=function(){this.unwireEvents(),this.inputElements=ct(this.selectQuery,this.element),this.wireEvents()},oN.prototype.clearForm=function(){this.errorRules=[],this.validated=[];for(var e=0,t=ct(this.selectQuery,this.element);e<t.length;e++){var i=t[e],n=(i.removeAttribute("aria-invalid"),i.parentElement),o=n.parentElement;(n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper")||i.classList.contains("e-input")&&n.classList.contains("e-input-group")?n:null!=o&&(o.classList.contains("e-control-wrapper")||o.classList.contains("e-wrapper"))?o:i).classList.remove(this.errorClass),0<i.name.length&&(this.getInputElement(i.name),this.getErrorElement(i.name),this.hideMessage(i.name)),(n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper")||i.classList.contains("e-input")&&n.classList.contains("e-input-group")?n:null!=o&&(o.classList.contains("e-control-wrapper")||o.classList.contains("e-wrapper"))?o:i).classList.remove(this.validClass)}},oN.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,n=this.inputElements;i<n.length;i++){for(var o=n[i],r={},s=0,a=e;s<a.length;s++){var l=a[s];if(null!==o.getAttribute(l))switch(l){case"required":this.defRule(o,r,l,o.required);break;case"data-validation":l=o.getAttribute(l),this.defRule(o,r,l,!0);break;case"type":-1!==t.indexOf(o.type)&&this.defRule(o,r,o.type,!0);break;case"rangeLength":case"range":this.defRule(o,r,l,JSON.parse(o.getAttribute(l)));break;case"equalTo":var h=o.getAttribute(l);this.defRule(o,r,l,h);break;default:"true"===o.getAttribute("data-val")?this.annotationRule(o,r,l,o.getAttribute(l)):this.defRule(o,r,l,o.getAttribute(l))}}0!==Object.keys(r).length&&this.addRules(o.name,r)}},oN.prototype.annotationRule=function(e,t,i,n){var o=i.split("-"),r=["required","creditcard","phone","maxlength","minlength","range","regex","equalto"],s=o[o.length-1],o=o[o.length-2];if(-1!==r.indexOf(s))switch(s){case"required":this.defRule(e,t,"required",n);break;case"creditcard":this.defRule(e,t,"creditcard",n);break;case"phone":this.defRule(e,t,"tel",n)}else if(-1!==r.indexOf(o))switch(o){case"maxlength":this.defRule(e,t,"maxLength",n);break;case"minlength":this.defRule(e,t,"minLength",n);break;case"range":var a=e.getAttribute("data-val-range-min"),l=e.getAttribute("data-val-range-max");this.defRule(e,t,"range",[a,l]);break;case"equalto":a=e.getAttribute(i).split(".");this.defRule(e,t,"equalTo",a[a.length-1]);break;case"regex":this.defRule(e,t,"regex",n)}},oN.prototype.defRule=function(e,t,i,n){var o,r=e.getAttribute("data-"+i+"-message"),s=e.getAttribute("data-val-"+i);this.rules[e.name]&&"validateHidden"!==i&&"hidden"!==i&&(this.getInputElement(e.name),o=this.getErrorMessage(this.rules[e.name][""+i],i)),r?n=[n,r]:s?n=[n,s]:o&&(n=[n,o]),t[""+i]=n},oN.prototype.wireEvents=function(){for(var e=0,t=this.inputElements;e<t.length;e++){var i=t[e];tN.isCheckable(i)?E.add(i,"click",this.clickHandler,this):"SELECT"===i.tagName?E.add(i,"change",this.changeHandler,this):(E.add(i,"focusout",this.focusOutHandler,this),E.add(i,"keyup",this.keyUpHandler,this))}E.add(this.element,"submit",this.submitHandler,this),E.add(this.element,"reset",this.resetHandler,this)},oN.prototype.unwireEvents=function(){for(var e=0,t=this.inputElements;e<t.length;e++){var i=t[e];E.clearEvents(i)}E.remove(this.element,"submit",this.submitHandler),E.remove(this.element,"reset",this.resetHandler)},oN.prototype.focusOutHandler=function(e){this.trigger("focusout",e);e=e.target;this.rules[e.name]&&(this.rules[e.name][this.required]||0<e.value.length?this.validate(e.name):-1===this.validated.indexOf(e.name)&&this.validated.push(e.name))},oN.prototype.keyUpHandler=function(e){this.trigger("keyup",e);var t=e.target;(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===[16,17,18,20,35,36,37,38,39,40,45,144,225].indexOf(e.which)&&this.validate(t.name)},oN.prototype.clickHandler=function(e){this.trigger("click",e);e=e.target;"submit"!==e.type?this.validate(e.name):null!==e.getAttribute("formnovalidate")&&(this.allowSubmit=!0)},oN.prototype.changeHandler=function(e){this.trigger("change",e);e=e.target;this.validate(e.name)},oN.prototype.submitHandler=function(e){this.trigger("submit",e),this.allowSubmit||this.validate()?this.allowSubmit=!1:e.preventDefault()},oN.prototype.resetHandler=function(){this.clearForm()},oN.prototype.validateRules=function(e){if(this.rules[""+e]){var t=Object.keys(this.rules[""+e]),i=!1,n=!1,o=t.indexOf("validateHidden"),r=t.indexOf("hidden");if(this.getInputElement(e),-1!==o&&(n=!0),!(i=-1!==r?!0:i)||n){-1!==o&&t.splice(o,1),-1!==r&&t.splice(r-1,1),this.getErrorElement(e);for(var s=0,a=t;s<a.length;s++){var l=a[s],h=this.getErrorMessage(this.rules[""+e][""+l],l),d={name:e,message:h},h={inputName:e,element:this.inputElement,message:h};if(!this.isValid(e,l)&&!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");var p=this.inputElement.parentElement,c=p.parentElement;(p.classList.contains("e-control-wrapper")||p.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&p.classList.contains("e-input-group")?(p.classList.add(this.errorClass),p):null!=c&&(c.classList.contains("e-control-wrapper")||c.classList.contains("e-wrapper"))?(c.classList.add(this.errorClass),c):(this.inputElement.classList.add(this.errorClass),this.inputElement)).classList.remove(this.validClass),this.infoElement?this.showMessage(d):this.createErrorElement(e,d.message,this.inputElement),h.errorElement=this.infoElement,h.status="failure",(p.classList.contains("e-control-wrapper")||p.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&p.classList.contains("e-input-group")?(p.classList.add(this.errorClass),p):null!=c&&(c.classList.contains("e-control-wrapper")||c.classList.contains("e-wrapper"))?(c.classList.add(this.errorClass),c):(this.inputElement.classList.add(this.errorClass),this.inputElement)).classList.remove(this.validClass),this.optionalValidationStatus(e,h),this.trigger("validationComplete",h),"required"===l&&this.inputElement.setAttribute("aria-required","true");break}this.hideMessage(e),h.status="success",this.trigger("validationComplete",h)}}}},oN.prototype.optionalValidationStatus=function(e,t){this.rules[""+e][this.required]||this.inputElement.value.length||je(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),t.status="",this.hideMessage(e))},oN.prototype.isValid=function(e,t){var i=this.rules[""+e][""+t],i=i instanceof Array&&"string"==typeof i[1]?i[0]:i,n=this.rules[""+e][""+t],o="min"!==t&&"max"!==t||!this.rules[""+e].date||"string"!=typeof this.rules[""+e].date?null:this.rules[""+e].date,i={value:this.inputElement.value,param:i,element:this.inputElement,formElement:this.element,format:o,culture:this.locale};return this.trigger("validationBegin",i),!i.param&&"required"===t||(n&&"function"==typeof n[0]?n[0].call(this,{element:this.inputElement,value:this.inputElement.value}):tN.isCheckable(this.inputElement)?"required"!==t||0<ct('input[name="'+e+'"]:checked',this.element).length:tN.checkValidator[""+t](i))},oN.prototype.getErrorMessage=function(e,t){var i=(r=this.inputElement.getAttribute("data-"+t+"-message")?this.inputElement.getAttribute("data-"+t+"-message"):e instanceof Array&&"string"==typeof e[1]?e[1]:(0!==Object.keys(this.localyMessage).length?this.localyMessage:this.defaultMessages)[""+t]).match(/{(\d)}/g);if(!je(i))for(var n=0;n<i.length;n++)var o=e instanceof Array?e[parseInt(n.toString(),10)]:e,r=r.replace(i[parseInt(n.toString(),10)],o);return r},oN.prototype.createErrorElement=function(e,t,i){var n,t=Q(this.errorElement,{className:this.errorClass,innerHTML:t,attrs:{for:e}});this.errorOption===$O.Message&&(t.classList.remove(this.errorClass),t.classList.add("e-message"),t=Q(this.errorContainer,{className:this.errorClass,innerHTML:t.outerHTML})),t.id=this.inputElement.name+"-info",this.element.querySelector('[data-valmsg-for="'+i.id+'"]')?this.element.querySelector('[data-valmsg-for="'+i.id+'"]').appendChild(t):!0===i.hasAttribute("data-msg-containerid")?ge("#"+i.getAttribute("data-msg-containerid"),this.element).appendChild(t):null!=this.customPlacement?this.customPlacement.call(this,this.inputElement,t):(n=(i=this.inputElement.parentElement).parentElement,i.classList.contains("e-control-wrapper")||i.classList.contains("e-wrapper")?n.insertBefore(t,i.nextSibling):n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper")?n.parentElement.insertBefore(t,n.nextSibling):i.insertBefore(t,this.inputElement.nextSibling)),t.style.display="block",this.getErrorElement(e),this.validated.push(e),this.checkRequired(e)},oN.prototype.getErrorElement=function(e){return this.infoElement=ge(this.errorElement+"."+this.errorClass,this.inputElement.parentElement),this.infoElement||(this.infoElement=ge(this.errorElement+"."+this.errorClass+'[for="'+e+'"]',this.element)),this.infoElement},oN.prototype.removeErrorRules=function(e){for(var t=0;t<this.errorRules.length;t++)this.errorRules[parseInt(t.toString(),10)].name===e&&this.errorRules.splice(t,1)},oN.prototype.showMessage=function(e){this.infoElement.style.display="block",this.infoElement.innerHTML=e.message,this.checkRequired(e.name)},oN.prototype.hideMessage=function(e){var t;this.infoElement&&(this.infoElement.style.display="none",this.removeErrorRules(e),t=(e=this.inputElement.parentElement).parentElement,(e.classList.contains("e-control-wrapper")||e.classList.contains("e-wrapper")||this.inputElement.classList.contains("e-input")&&e.classList.contains("e-input-group")?(e.classList.add(this.validClass),e):null!=t&&(t.classList.contains("e-control-wrapper")||t.classList.contains("e-wrapper"))?(t.classList.add(this.validClass),t):(this.inputElement.classList.add(this.validClass),this.inputElement)).classList.remove(this.errorClass),this.inputElement.setAttribute("aria-invalid","false"))},oN.prototype.checkRequired=function(e){this.rules[""+e][this.required]||this.inputElement.value.length||je(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),this.hideMessage(e))},oN.isCheckable=function(e){e=e.getAttribute("type");return e&&("checkbox"===e||"radio"===e||"submit"===e)},oN.checkValidator={required:function(e){return isNaN(Date.parse(e.value))?0<e.value.toString().length:!isNaN(new Date(e.value).getTime())},email:function(e){return iN.EMAIL.test(e.value)},url:function(e){return iN.URL.test(e.value)},dateIso:function(e){return iN.DATE_ISO.test(e.value)},tel:function(e){return iN.PHONE.test(e.value)},creditcard:function(e){return iN.CREDITCARD.test(e.value)},number:function(e){return!isNaN(Number(e.value))&&-1===String(e.value).indexOf(" ")},digits:function(e){return iN.DIGITS.test(e.value)},maxLength:function(e){return e.value.length<=Number(e.param)},minLength:function(e){return e.value.length>=Number(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){var t,i;return je(e.param)||"string"!=typeof e.param||""===e.param?!isNaN(new Date(e.value).getTime()):(i=e.culture&&""!==e.culture?new Ti(e.culture):new Ti,t={format:e.param.toString(),type:"dateTime",skeleton:"yMd"},!je(i=i.parseDate(e.value,t))&&i instanceof Date&&!isNaN(+i))},max:function(e){var t,i,n;return isNaN(Number(e.value))?e.format&&""!==e.format?(n=e.culture&&""!==e.culture?new Ti(e.culture):new Ti,t={format:e.format.toString(),type:"dateTime",skeleton:"yMd"},i=n.parseDate(e.value,t),n="string"==typeof e.param?n.parseDate(JSON.parse(JSON.stringify(e.param)),t):e.param,new Date(i).getTime()<=new Date(n).getTime()):new Date(e.value).getTime()<=new Date(JSON.parse(JSON.stringify(e.param))).getTime():+e.value<=+e.param},min:function(e){var t,i,n;return isNaN(Number(e.value))?-1!==e.value.indexOf(",")?(n=e.value.replace(/,/g,""),parseFloat(n)>=Number(e.param)):e.format&&""!==e.format?(n=e.culture&&""!==e.culture?new Ti(e.culture):new Ti,t={format:e.format.toString(),type:"dateTime",skeleton:"yMd"},i=n.parseDate(e.value,t),n="string"==typeof e.param?n.parseDate(JSON.parse(JSON.stringify(e.param)),t):e.param,new Date(i).getTime()>=new Date(n).getTime()):new Date(e.value).getTime()>=new Date(JSON.parse(JSON.stringify(e.param))).getTime():+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}},Ck([e("")],oN.prototype,"locale",void 0),Ck([e("e-hidden")],oN.prototype,"ignore",void 0),Ck([e()],oN.prototype,"rules",void 0),Ck([e("e-error")],oN.prototype,"errorClass",void 0),Ck([e("e-valid")],oN.prototype,"validClass",void 0),Ck([e("label")],oN.prototype,"errorElement",void 0),Ck([e("div")],oN.prototype,"errorContainer",void 0),Ck([e($O.Label)],oN.prototype,"errorOption",void 0),Ck([i()],oN.prototype,"focusout",void 0),Ck([i()],oN.prototype,"keyup",void 0),Ck([i()],oN.prototype,"click",void 0),Ck([i()],oN.prototype,"change",void 0),Ck([i()],oN.prototype,"submit",void 0),Ck([i()],oN.prototype,"validationBegin",void 0),Ck([i()],oN.prototype,"validationComplete",void 0),Ck([i()],oN.prototype,"customPlacement",void 0),tN=Ck([Bt],oN));function oN(e,t){t=eN.call(this,t,e)||this;if(t.validated=[],t.errorRules=[],t.allowSubmit=!1,t.required="required",t.infoElement=null,t.inputElement=null,t.selectQuery="input:not([type=reset]):not([type=button]), select, textarea",t.localyMessage={},t.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===t.rules&&(t.rules={}),t.l10n=new Cn("formValidator",t.defaultMessages,t.locale),t.locale&&t.localeFunc(),Ci.on("notifyExternalChange",t.afterLocalization,t),e="string"==typeof e?ge(e,document):e,null!=t.element)return t.element.setAttribute("novalidate",""),t.inputElements=ct(t.selectQuery,t.element),t.createHTML5Rules(),t.wireEvents(),t}rN=function(e,t){return(rN=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])}))(e,t)};var rN,sN,aN=function(e,t){function i(){this.constructor=e}rN(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},h0=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},lN="e-file-select",hN="e-file-drop",dN="e-upload-files",pN="e-upload-file-list",cN="e-file-status",uN="e-file-name",gN="e-file-type",mN="e-file-size",fN="e-file-remove-btn",yN="e-file-delete-btn",vN="e-spinner-pane",bN="e-file-abort-btn",wN="e-file-reload-btn",CN="e-upload-drag-hover",SN="e-upload-progress-wrap",AN="e-upload-progress-bar",xN="e-progress-bar-text",IN="e-upload-progress",TN="e-upload-success",EN="e-upload-fails",DN="e-file-container",MN="e-validation-fails",kN="e-disabled",PN="e-rtl-container",BN="e-clear-icon-focus",FN="e-file-pause-btn",LN="e-file-play-btn",RN="e-restrict-retry",ON=["title","style","class"],NN="e-form-upload",VN="e-file-invalid",Ck=(aN(_N,sN=n),h0([e("")],_N.prototype,"name",void 0),h0([e(null)],_N.prototype,"size",void 0),h0([e("")],_N.prototype,"type",void 0),_N);function _N(){return null!==sN&&sN.apply(this,arguments)||this}aN(jN,HN=n),h0([e("Browse...")],jN.prototype,"browse",void 0),h0([e("Upload")],jN.prototype,"upload",void 0),h0([e("Clear")],jN.prototype,"clear",void 0);var HN,zN=jN;function jN(){return null!==HN&&HN.apply(this,arguments)||this}aN(UN,WN=n),h0([e("")],UN.prototype,"saveUrl",void 0),h0([e("")],UN.prototype,"removeUrl",void 0),h0([e(0)],UN.prototype,"chunkSize",void 0),h0([e(3)],UN.prototype,"retryCount",void 0),h0([e(500)],UN.prototype,"retryAfterDelay",void 0);var WN,QN=UN;function UN(){return null!==WN&&WN.apply(this,arguments)||this}aN(YN,qN=Ji),YN.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){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=je(this.buttons.browse)?"":this.buttons.browse,this.buttons.clear=je(this.buttons.clear)?"":this.buttons.clear,this.buttons.upload=je(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.isReact?this.reRenderFileList():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=R("currentLocale",this.l10n);break;case"cssClass":this.setCSSClass(t.cssClass)}},YN.prototype.setLocalizedTexts=function(){je(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)&&!je(this.uploadWrapper.querySelector("."+hN))&&(this.uploadWrapper.querySelector("."+hN).innerHTML=this.localizedTexts("dropFilesHint")),this.updateFileList())},YN.prototype.getKeyValue=function(e){for(var t,i=0,n=Object.keys(this.preLocaleObj);i<n.length;i++){var o=n[i];this.preLocaleObj[""+o]===e&&(t=o)}return t},YN.prototype.updateFileList=function(){if(0<this.fileList.length&&!je(this.uploadWrapper.querySelector("."+dN)))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(TN)&&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")))},YN.prototype.reRenderFileList=function(){this.listParent&&(G(this.listParent),this.listParent=null,this.fileList=[],this.internalCreateFileList(this.filesData),this.actionButtons)&&(this.removeActionButtons(),this.renderActionButtons(),this.checkActionButtonStatus())},YN.prototype.preRender=function(){this.localeText={Browse:"Browse...",Clear:"Clear",Upload:"Upload",invalidFileName:"File Name is not allowed",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 Cn("uploader",this.localeText,this.locale),this.preLocaleObj=R("currentLocale",this.l10n),this.formRendered(),this.updateHTMLAttrToElement(),this.checkHTMLAttributes(!1);var e=R("ej2_instances",this.element);if("EJS-UPLOADER"===this.element.tagName){for(var t=this.createElement("input",{attrs:{type:"file"}}),i=0;i<this.element.attributes.length;i++)"id"!==this.element.attributes[i].nodeName?t.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue):"id"===this.element.attributes[i].nodeName&&t.setAttribute(this.element.attributes[i].nodeName,D("uploader")),t.innerHTML=this.element.innerHTML;t.hasAttribute("name")||t.setAttribute("name","UploadFiles"),this.element.appendChild(t),this.element=t,x("ej2_instances",e,this.element)}e[0].isPureReactComponent&&(je(e[0].props.name)?!je(e[0].props.id)&&je(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)),je(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=F.info.name,this.uploaderName=this.element.getAttribute("name")},YN.prototype.formRendered=function(){var e=z(this.element,"form");if(!je(e))for(;e&&e!==document.documentElement;e=e.parentElement)"FORM"===e.tagName&&(this.isForm=!0,(this.formElement=e).setAttribute("enctype","multipart/form-data"),e.setAttribute("encoding","multipart/form-data"))},YN.prototype.getPersistData=function(){return this.addOnPersist(["filesData"])},YN.prototype.getModuleName=function(){return"uploader"},YN.prototype.updateDirectoryAttributes=function(){this.directoryUpload?(this.element.setAttribute("directory","true"),this.element.setAttribute("webkitdirectory","true")):(this.element.removeAttribute("directory"),this.element.removeAttribute("webkitdirectory"))},YN.prototype.render=function(){this.renderBrowseButton(),this.initializeUpload(),this.updateHTMLAttrToWrapper(),this.wireEvents(),this.setMultipleSelection(),this.setExtensions(this.allowedExtensions),this.setRTL(),this.renderPreLoadFiles(),this.setControlStatus(),this.setCSSClass()},YN.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")},YN.prototype.renderActionButtons=function(){this.element.setAttribute("tabindex","-1"),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,"aria-label":this.localizedTexts("Upload")}}),this.clearButton=this.createElement("button",{className:"e-file-clear-btn e-css e-btn e-flat",attrs:{type:"button",tabindex:this.btnTabIndex,"aria-label":this.localizedTexts("Clear")}}),this.actionButtons.appendChild(this.clearButton),this.actionButtons.appendChild(this.uploadButton),this.renderButtonTemplates(),this.uploadWrapper.appendChild(this.actionButtons),this.browseButton.blur(),this.isPreloadFiles||this.uploadButton.focus(),this.wireActionButtonEvents()},YN.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())},YN.prototype.wireActionButtonEvents=function(){E.add(this.uploadButton,"click",this.uploadButtonClick,this),E.add(this.clearButton,"click",this.clearButtonClick,this)},YN.prototype.unwireActionButtonEvents=function(){E.remove(this.uploadButton,"click",this.uploadButtonClick),E.remove(this.clearButton,"click",this.clearButtonClick)},YN.prototype.removeActionButtons=function(){this.actionButtons&&(this.unwireActionButtonEvents(),G(this.actionButtons),this.actionButtons=null)},YN.prototype.renderButtonTemplates=function(){var e;"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&&(e=je(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))),this.clearButton&&(e=je(this.buttons.clear)?"Clear":this.buttons.clear,this.buttons.clear=e,"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)))},YN.prototype.initializeUpload=function(){this.element.setAttribute("tabindex","-1");var e=this.createElement("span",{className:lN});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()},YN.prototype.renderPreLoadFiles=function(){if(this.files.length)if(this.enablePersistence&&this.filesData.length)this.internalCreateFileList(this.filesData);else if(!je(this.files[0].size)){this.isPreloadFiles=!0;var e=[].slice.call(this.files),t=[];this.multiple||(this.clearData(),e=[e[0]]);for(var i=0,n=e;i<n.length;i++){var o=n[i],o={name:o.name+"."+o.type.split(".")[o.type.split(".").length-1],rawFile:"",size:o.size,status:this.localizedTexts("uploadSuccessMessage"),type:o.type,validationMessages:{minSize:"",maxSize:""},statusCode:"2"};t.push(o),this.filesData.push(o)}this.internalCreateFileList(t),this.autoUpload||!this.listParent||this.actionButtons||this.isForm&&!this.allowUpload()||!this.showFileList||this.renderActionButtons(),this.checkActionButtonStatus(),this.sequentialUpload&&(this.count=this.filesData.length-1),this.isPreloadFiles=!1}},YN.prototype.checkActionButtonStatus=function(){var e;this.actionButtons&&(0<(e=this.uploadWrapper.querySelectorAll("."+MN).length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+TN).length+this.uploadWrapper.querySelectorAll("span."+IN).length)&&e===this.uploadWrapper.querySelectorAll("li").length?this.uploadButton.setAttribute("disabled","disabled"):this.uploadButton.removeAttribute("disabled"))},YN.prototype.setDropArea=function(){var e=this.dropAreaWrapper.querySelector(".e-file-drop");if(this.dropArea){this.dropZoneElement="string"!=typeof this.dropArea?this.dropArea:ge(this.dropArea,document);for(var t=this.element,i=!1;t.parentNode;)(t=t.parentNode)===this.dropZoneElement&&(i=!0,e?e.innerHTML=this.localizedTexts("dropFilesHint"):this.createDropTextHint());!i&&e&&ue(e)}else je(this.uploaderOptions)||void 0!==this.uploaderOptions.dropArea||(this.createDropTextHint(),this.dropZoneElement=this.uploadWrapper,this.setProperties({dropArea:this.uploadWrapper},!0));this.bindDropEvents()},YN.prototype.updateDropArea=function(){var e;this.dropArea?this.setDropArea():(this.dropZoneElement=null,(e=this.dropAreaWrapper.querySelector(".e-file-drop"))&&ue(e))},YN.prototype.createDropTextHint=function(){var e=this.createElement("span",{className:hN});e.innerHTML=this.localizedTexts("dropFilesHint"),this.dropAreaWrapper.appendChild(e)},YN.prototype.updateHTMLAttrToElement=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];ON.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},YN.prototype.updateHTMLAttrToWrapper=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i,n=t[e];-1<ON.indexOf(n)&&("class"===n?""!==(i=this.htmlAttributes[""+n].replace(/\s+/g," ").trim())&&U([this.uploadWrapper],i.split(" ")):"style"===n?(i=je(i=this.uploadWrapper.getAttribute(n))?this.htmlAttributes[""+n]:i+this.htmlAttributes[""+n],this.uploadWrapper.setAttribute(n,i)):this.uploadWrapper.setAttribute(n,this.htmlAttributes[""+n]))}},YN.prototype.setMultipleSelection=function(){var e;this.multiple&&!this.element.hasAttribute("multiple")?((e=document.createAttribute("multiple")).value="multiple",this.element.setAttributeNode(e)):this.multiple||this.element.removeAttribute("multiple")},YN.prototype.checkAutoUpload=function(e){this.autoUpload?(this.sequentialUpload?this.sequenceUpload(e):this.upload(e),this.removeActionButtons()):this.actionButtons||this.renderActionButtons(),this.checkActionButtonStatus()},YN.prototype.sequenceUpload=function(e){var t;this.filesData.length-e.length!=0&&"1"===this.filesData[this.filesData.length-e.length-1].statusCode||((this.multiple||this.count<0)&&++this.count,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)},YN.prototype.setCSSClass=function(e){var t=e,e=(je(e)||(t=e.replace(/\s+/g," ").trim()),je(e)||""===t||q([this.uploadWrapper],t.split(" ")),this.cssClass);je(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),je(this.cssClass)||""===e||U([this.uploadWrapper],e.split(-1<e.indexOf(",")?",":" "))},YN.prototype.wireEvents=function(){E.add(this.browseButton,"click",this.browseButtonClick,this),E.add(this.element,"change",this.onSelectFiles,this),E.add(document,"click",this.removeFocus,this),this.keyboardModule=new bn(this.uploadWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.isForm&&E.add(this.formElement,"reset",this.resetForm,this)},YN.prototype.unWireEvents=function(){E.remove(this.browseButton,"click",this.browseButtonClick),E.remove(this.element,"change",this.onSelectFiles),E.remove(document,"click",this.removeFocus),this.isForm&&E.remove(this.formElement,"reset",this.resetForm),this.keyboardModule&&this.keyboardModule.destroy()},YN.prototype.resetForm=function(){this.clearAll()},YN.prototype.keyActionHandler=function(e){var t,i,n=e.target;"enter"===e.action&&(e.target===this.clearButton?this.clearButtonClick():e.target===this.uploadButton?this.uploadButtonClick():e.target===this.browseButton?this.browseButtonClick():n.classList.contains(FN)?((t=this.getCurrentMetaData(null,e)).file.statusCode="4",t.file.status=this.localizedTexts("pauseUpload"),this.abortUpload(t,!1)):n.classList.contains(LN)?this.resumeUpload(this.getCurrentMetaData(null,e),e):n.classList.contains(wN)?je(t=this.getCurrentMetaData(null,e))?(i=e.target.parentElement,i=this.filesData[this.fileList.indexOf(i)],this.retry(i)):(t.file.statusCode="1",t.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(t.file)):(this.removeFiles(e),n.classList.contains(bN)||this.browseButton.focus()),e.preventDefault(),e.stopPropagation())},YN.prototype.getCurrentMetaData=function(e,t){var i,n;n=je(e)?(t=t.target.parentElement,this.filesData[this.fileList.indexOf(t)]):e;for(var o=0;o<this.uploadMetaData.length;o++)this.uploadMetaData[o].file.name===n.name&&(i=this.uploadMetaData[o]);return i},YN.prototype.removeFocus=function(){this.uploadWrapper&&this.listParent&&this.listParent.querySelector("."+BN)&&(document.activeElement.blur(),this.listParent.querySelector("."+BN).classList.remove(BN))},YN.prototype.browseButtonClick=function(){this.element.click()},YN.prototype.uploadButtonClick=function(){this.sequentialUpload?this.sequenceUpload(this.filesData):this.upload(this.filesData)},YN.prototype.clearButtonClick=function(){this.clearAll(),this.sequentialUpload&&(this.count=-1),this.actionCompleteCount=0},YN.prototype.bindDropEvents=function(){this.dropZoneElement&&(E.add(this.dropZoneElement,"drop",this.dropElement,this),E.add(this.dropZoneElement,"dragover",this.dragHover,this),E.add(this.dropZoneElement,"dragleave",this.onDragLeave,this),E.add(this.dropZoneElement,"paste",this.onPasteFile,this),E.add(this.dropZoneElement,"dragenter",this.onDragEnter,this))},YN.prototype.unBindDropEvents=function(){this.dropZoneElement&&(E.remove(this.dropZoneElement,"drop",this.dropElement),E.remove(this.dropZoneElement,"dragover",this.dragHover),E.remove(this.dropZoneElement,"dragleave",this.onDragLeave),E.remove(this.dropZoneElement,"dragenter",this.onDragEnter))},YN.prototype.onDragEnter=function(e){this.enabled&&(this.dropZoneElement.classList.add(CN),this.dragCounter=this.dragCounter+1,e.preventDefault(),e.stopPropagation())},YN.prototype.onDragLeave=function(){this.enabled&&(this.dragCounter=this.dragCounter-1,this.dragCounter||this.dropZoneElement.classList.remove(CN))},YN.prototype.dragHover=function(e){this.enabled&&("Default"!==this.dropEffect&&(e.dataTransfer.dropEffect=this.dropEffect.toLowerCase()),e.preventDefault(),e.stopPropagation())},YN.prototype.dropElement=function(e){this.dragCounter=0,this.dropZoneElement.classList.remove(CN),this.onSelectFiles(e),e.preventDefault(),e.stopPropagation()},YN.prototype.onPasteFile=function(e){var t=e.clipboardData.items;if("paste"===e.type&&"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=e.clipboardData.files),1===t.length||this.multiple)for(var i=0;i<t.length;i++){var n=[].slice.call(t)[i];je(n.getAsFile())||"file"!==n.kind&&!n.type.match("^image/")||this.renderSelectedFiles(e,[n.getAsFile()],!1,!0)}},YN.prototype.getSelectedFiles=function(e){for(var t=[],i=this.fileList[e],n=this.getFilesData(),o=+i.getAttribute("data-files-count"),r=0,s=0;s<e;s++)r+=+this.fileList[s].getAttribute("data-files-count");for(var a=r;a<r+o;a++)t.push(n[a]);return t},YN.prototype.removeFiles=function(e){var t,i,n,o;this.enabled&&(t=e.target.parentElement,n=this.fileList.indexOf(t),i=this.fileList[n],je(n=(o=this.isFormUpload())?this.getSelectedFiles(n):this.getFilesInArray(this.filesData[n]))||(e.target.classList.contains(bN)&&!o?(n[0].statusCode="5",je(i)||(mA({target:o=i.querySelector("."+bN),width:"20px"}),kA(o)),this.sequentialUpload&&this.uploadSequential(),i.classList.contains(RN)||this.checkActionComplete(!0)):z(e.target,"."+vN)||this.remove(n,!1,!1,!0,e),this.isForm&&i&&i.classList.contains(VN)&&(this.element.value=""),this.checkActionButtonStatus(),this.actionButtons&&this.clearButton&&this.uploadWrapper&&1===(o=this.uploadWrapper.querySelectorAll(".e-upload-progress-bar.e-upload-progress:not(.e-upload-success):not(.e-upload-fails)")).length&&t.contains(o[0])&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled")))},YN.prototype.removeFilesData=function(e,t){var i;t?this.showFileList||(i=this.filesData.indexOf(e),this.filesData.splice(i,1)):je(t=this.getLiElement(e))||(this.element.value="",G(t),i=this.fileList.indexOf(t),this.fileList.splice(i,1),this.filesData.splice(i,1),0!==this.fileList.length||je(this.listParent)||(G(this.listParent),this.listParent=null,this.removeActionButtons()),this.sequentialUpload&&i<=this.count&&--this.count)},YN.prototype.removeUploadedFile=function(i,e,n,t){var o=this,r=i,s=new ze(this.asyncSettings.removeUrl,"POST",!0,null),a=(s.emitError=!1,new FormData);s.beforeSend=function(t){e.currentRequest=s.httpRequest,n?o.removingEventCallback(e,a,r,i):o.trigger("removing",e,function(e){e.cancel?t.cancel=!0:o.removingEventCallback(e,a,r,i)})},s.onLoad=function(e){return o.removeCompleted(e,r,t),{}},s.onError=function(e){return o.removeFailed(e,r,t),{}},s.send(a)},YN.prototype.removingEventCallback=function(e,t,i,n){var o=this.element.getAttribute("name"),n=this.getLiElement(n);je(n)||je(n.querySelector("."+yN))&&je(n.querySelector("."+fN))||(mA({target:n=n.querySelector("."+yN)?n.querySelector("."+yN):n.querySelector("."+fN),width:"20px"}),kA(n)),e.postRawFile&&!je(i.rawFile)&&""!==i.rawFile?t.append(o,i.rawFile,i.name):t.append(o,i.name),this.updateFormData(t,e.customFormData)},YN.prototype.updateFormData=function(i,n){if(0<n.length&&n[0])for(var e=0;e<n.length;e++)!function(e){var t=n[e],e=Object.keys(t).map(function(e){return t[""+e]});i.append(Object.keys(t)[0],e)}(e)},YN.prototype.updateCustomheader=function(i,n){if(0<n.length&&n[0])for(var e=0;e<n.length;e++)!function(e){var t=n[e],e=Object.keys(t).map(function(e){return t[""+e]});i.setRequestHeader(Object.keys(t)[0],e)}(e)},YN.prototype.removeCompleted=function(e,t,i){var n=e&&e.currentTarget?this.getResponse(e):null,o=e.target;4===o.readyState&&200<=o.status&&o.status<=299?(o={e:e,response:n,operation:"remove",file:this.updateStatus(t,this.localizedTexts("removedSuccessMessage"),"2")},this.trigger("success",o),this.removeFilesData(t,i),n=this.uploadedFilesData.indexOf(t),this.uploadedFilesData.splice(n,1),this.trigger("change",{files:this.uploadedFilesData})):this.removeFailed(e,t,i)},YN.prototype.removeFailed=function(e,t,i){e={e:e,response:e&&e.currentTarget?this.getResponse(e):null,operation:"remove",file:this.updateStatus(t,this.localizedTexts("removedFailedMessage"),"0")},i||(i=this.filesData.indexOf(t),(i=this.fileList[i])&&(i.classList.remove(TN),i.classList.add(EN),i=i.querySelector("."+cN))&&(i.classList.remove(TN),i.classList.add(EN)),this.checkActionButtonStatus()),this.trigger("failure",e),i=this.getLiElement(t);je(i)||je(i.querySelector("."+yN))||(BA(i.querySelector("."+yN)),G(i.querySelector(".e-spinner-pane")))},YN.prototype.getFilesFromFolder=function(t){this.filesEntries=[];var o=this.multiple?t.dataTransfer.items:[t.dataTransfer.items[0]];if(this.checkDirectoryUpload(o))for(var r=this,e=0;e<o.length;e++)!function(e){var i,n=o[e].webkitGetAsEntry();n.isFile?(i=[],n.file(function(e){var t=n.fullPath;i.push({path:t,file:e})}),r.renderSelectedFiles(t,i,!0)):n.isDirectory&&r.traverseFileTree(n,t)}(e)},YN.prototype.checkDirectoryUpload=function(e){for(var t=0;e&&t<e.length;t++)if(e[t].webkitGetAsEntry().isDirectory)return!0;return!1},YN.prototype.traverseFileTree=function(e,t){e.isFile?this.filesEntries.push(e):e.isDirectory&&(e=e.createReader(),this.readFileFromDirectory(e,t))},YN.prototype.readFileFromDirectory=function(i,n){var o=this;i.readEntries(function(e){for(var t=0;t<e.length;t++)o.traverseFileTree(e[t],n);o.pushFilesEntries(n),e.length&&o.readFileFromDirectory(i)})},YN.prototype.pushFilesEntries=function(n){for(var o=this,r=[],e=this,t=0;t<this.filesEntries.length;t++)!function(i){e.filesEntries[i].file(function(e){var t;o.filesEntries.length&&(t=o.filesEntries[i].fullPath,r.push({path:t,file:e}),i===o.filesEntries.length-1)&&(o.filesEntries=[],o.renderSelectedFiles(n,r,!0))})}(t)},YN.prototype.onSelectFiles=function(e){var t,i;this.enabled&&("drop"===e.type?this.directoryUpload?this.getFilesFromFolder(e):(i=this.sortFilesList=e.dataTransfer.files,"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=i),0<i.length&&(t=this.multiple?this.sortFileList(i):[i[0]],this.renderSelectedFiles(e,t))):(t=[].slice.call(e.target.files),this.renderSelectedFiles(e,t)),this.isAngular||this.isReact)&&e.stopPropagation()},YN.prototype.getBase64=function(n){return new Promise(function(e,t){var i=new FileReader;i.readAsDataURL(n),i.onload=function(){return e(i.result)},i.onerror=function(e){return t(e)}})},YN.prototype.renderSelectedFiles=function(e,t,i,n){var o=this,r={event:e,cancel:!(this.base64String=[]),filesData:[],isModified:!1,modifiedFilesData:[],progressInterval:"",isCanceled:!1,currentRequest:null,customFormData:null};if(t.length<1)r.isCanceled=!0,this.trigger("selected",r);else{this.flag=!0;var s=[];this.multiple||(this.clearData(!0),t=[t[this.actionCompleteCount=0]]);for(var a=0;a<t.length;a++){var l=i?t[a].file:t[a];this.updateInitialFileDetails(e,t,l,a,s,i,n)}if(r.filesData=s,!je(this.allowedExtensions)&&-1<this.allowedExtensions.indexOf("*")&&(this.allTypes=!0),this.enableHtmlSanitizer)for(a=0;a<s.length;a++){for(var h=go.beforeSanitize(),h=go.serializeValue(h,s[parseInt(a.toString(),10)].name),d=s[parseInt(a.toString(),10)].name,p=!1,c=0;c<d.length;c++)if(127<d.charCodeAt(c)){p=!0;break}var u=/<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>/i.test(d);h===s[parseInt(a.toString(),10)].name||p&&!u||(h=t[parseInt(a.toString(),10)].name.replace(/[\u00A0-\u9999<>\\&]/g,function(e){return"&#"+e.charCodeAt(0)+";"}),s[parseInt(a.toString(),10)].name=h,s[parseInt(a.toString(),10)].status=this.localizedTexts("invalidFileName"),s[parseInt(a.toString(),10)].statusCode="0")}this.allTypes||(s=this.checkExtension(s)),this.trigger("selected",r,function(e){o._internalRenderSelect(e,s)})}},YN.prototype.updateInitialFileDetails=function(e,t,i,n,o,r,s){r={name:r?t[n].path.substring(1,t[n].path.length):s?D(i.name.substring(0,i.name.lastIndexOf(".")))+"."+this.getFileType(i.name):this.directoryUpload?t[n].webkitRelativePath:i.name,rawFile:i,size:i.size,status:this.localizedTexts("readyToUploadMessage"),type:this.getFileType(i.name),validationMessages:this.validatedFileSize(i.size),statusCode:"1",id:D(i.name.substring(0,i.name.lastIndexOf(".")))+"."+this.getFileType(i.name)};s&&(r.fileSource="paste"),r.status=""!==r.validationMessages.minSize?this.localizedTexts("invalidMinFileSize"):""!==r.validationMessages.maxSize?this.localizedTexts("invalidMaxFileSize"):r.status,""===r.validationMessages.minSize&&""===r.validationMessages.maxSize||(r.statusCode="0",this.checkActionComplete(!0)),o.push(r)},YN.prototype._internalRenderSelect=function(e,t){if(!e.cancel){if(this.selectedFiles=this.selectedFiles.concat(t),this.btnTabIndex=this.disableKeyboardNavigation?"-1":"0",this.showFileList){if(e.isModified&&0<e.modifiedFilesData.length){for(var i=0;i<e.modifiedFilesData.length;i++)for(var n=0;n<t.length;n++)e.modifiedFilesData[i].id===t[n].id&&(e.modifiedFilesData[i].rawFile=t[n].rawFile);var o=this.allTypes?e.modifiedFilesData:this.checkExtension(e.modifiedFilesData);this.updateSortedFileList(o),this.filesData=this.filesData.concat(o),this.isForm&&!this.allowUpload()||this.checkAutoUpload(o)}else{if(this.internalCreateFileList(t),this.autoUpload&&this.sequenceUpload&&this.sequentialUpload&&0<this.filesData.length&&"2"!==this.filesData[this.filesData.length-1].statusCode&&"0"!==this.filesData[this.filesData.length-1].statusCode)return void(this.filesData=this.filesData.concat(t));this.filesData=this.filesData.concat(t),this.isForm&&!this.allowUpload()||this.checkAutoUpload(t)}je(e.progressInterval)||""===e.progressInterval||(this.progressInterval=e.progressInterval)}else this.filesData=this.filesData.concat(t),this.autoUpload&&this.upload(this.filesData,!0);this.raiseActionComplete(),this.isFirstFileOnSelection=!0}},YN.prototype.allowUpload=function(){var e=!1;return e=this.isForm&&!je(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl?!0:e},YN.prototype.isFormUpload=function(){var e=!1;return e=!this.isForm||!je(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl||!je(this.asyncSettings.removeUrl)&&""!==this.asyncSettings.removeUrl?e:!0},YN.prototype.clearData=function(e){je(this.listParent)||(G(this.listParent),this.listParent=null),"msie"===this.browserName||e||(this.element.value=""),this.fileList=[],this.filesData=[],this.removeActionButtons()},YN.prototype.updateSortedFileList=function(e){var t=this.createElement("div",{id:"clonewrapper"}),i=-1;if(this.listParent){for(var n=0;n<this.listParent.querySelectorAll("li").length;n++){var o=this.listParent.querySelectorAll("li")[n];t.appendChild(o.cloneNode(!0))}this.removeActionButtons();var r=[].slice.call(t.childNodes);this.createParentUL();for(var s=0;s<e.length;s++){for(var a=0;a<this.filesData.length;a++)this.filesData[a].name===e[s].name&&(this.listParent.appendChild(r[a]),E.add(r[a].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(r[a]),i=s);i!==s&&this.internalCreateFileList([e[s]])}}else this.internalCreateFileList(e)},YN.prototype.isBlank=function(e){return!e||/^\s*$/.test(e)},YN.prototype.checkGenericExtension=function(e,t){var i=[];switch(e.toLowerCase()){case"image/*":i.push("jpg","jpeg","png","gif","bmp","tiff","svg","webp","heic");break;case"audio/*":i.push("mp3","wav","aac","flac","ogg","m4a");break;case"video/*":i.push("mp4","mov","avi","mkv","flv","wmv","webm","mpeg");break;case"application/*":i.push("doc","docx","xls","xlsx","ppt","pptx","zip","rar","7z","tar","pdf");break;case"text/*":i.push("txt","csv","html","css","js","json","xml","md")}return i.includes(t.toLowerCase())},YN.prototype.checkExtension=function(e){var t=e;if(!this.isBlank(this.allowedExtensions)){for(var i=[],n=0,o=je(i)?[""]:this.allowedExtensions.split(",");n<o.length;n++){var r=o[n];i.push(r.trim().toLocaleLowerCase())}for(var s=0;s<e.length;s++){var a=-1!==e[s].type.indexOf(".")?e[s].type.replace(".",""):e[s].type;-1!==i[0].indexOf("/*")?this.checkGenericExtension(i[0],a)||(e[s].status=this.localizedTexts("invalidFileType"),e[s].statusCode="0"):-1===i.indexOf(("."+a).toLocaleLowerCase())&&(e[s].status=this.localizedTexts("invalidFileType"),e[s].statusCode="0")}}return t},YN.prototype.validatedFileSize=function(e){var t="",i="";return e<this.minFileSize?t=this.localizedTexts("invalidMinFileSize"):i=e>this.maxFileSize?this.localizedTexts("invalidMaxFileSize"):t="",{minSize:t,maxSize:i}},YN.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},YN.prototype.createCustomfileList=function(e){this.createParentUL();for(var t=0,i=e;t<i.length;t++){var n=i[t],o=this.createElement("li",{className:pN,attrs:{"data-file-name":n.name}}),r=(this.uploadTemplateFn=this.templateComplier(this.template),this.uploadTemplateFn(n,this,"template",this.element.id+"Template",this.isStringTemplate,null,o)),r=(r&&ht([].slice.call(r),o),e.indexOf(n)),s={element:o,fileInfo:n,index:r,isPreload:this.isPreLoadFile(n)},r={element:o,fileInfo:n,index:r,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",s),this.trigger("fileListRendering",r),this.listParent.appendChild(o),this.fileList.push(o)}this.renderReactTemplates()},YN.prototype.createParentUL=function(){je(this.listParent)&&(this.listParent=this.createElement("ul",{className:dN}),this.uploadWrapper.appendChild(this.listParent))},YN.prototype.formFileList=function(e,t){for(var i,n=this.createElement("li",{className:pN}),o=(n.setAttribute("data-files-count",e.length+""),this.createElement("span",{className:DN})),r=0,s=e;r<s.length;r++){var a=s[r],l=this.createElement("span",{className:uN}),h=(l.innerHTML=this.getFileNameOnly(a.name),this.createElement("span",{className:gN})),d=this.getFileType(a.name);h.innerHTML="."+d,d||h.classList.add("e-hidden"),this.enableRtl?((d=this.createElement("span",{className:PN})).appendChild(h),d.appendChild(l),o.appendChild(d)):(o.appendChild(l),o.appendChild(h)),this.truncateName(l),i=this.formValidateFileInfo(a,n)}n.appendChild(o),this.setListToFileInfo(e,n);var p=this.listParent.querySelectorAll("li").length,c=this.createElement("span"),c=(n.classList.contains(VN)?(c.classList.add(cN),c.classList.add(VN),c.innerText=1<e.length?this.localizedTexts("invalidFileSelection"):i):(c.classList.add(1<e.length?"e-file-information":mN),c.innerText=1<e.length?this.localizedTexts("totalFiles")+": "+e.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(e)):this.bytesToSize(e[0].size),this.createFormInput(e)),o.appendChild(c),je(n.querySelector(".e-icons"))&&(c=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&c.classList.add("e-msie"),c.setAttribute("title",this.localizedTexts("remove")),n.appendChild(o),n.appendChild(c),E.add(c,"click",this.removeFiles,this),c.classList.add(fN)),{element:n,fileInfo:this.mergeFileInfo(e,n),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(e,n))}),p={element:n,fileInfo:this.mergeFileInfo(e,n),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(e,n))};this.trigger("rendering",c),this.trigger("fileListRendering",p),this.listParent.appendChild(n),this.fileList.push(n)},YN.prototype.formValidateFileInfo=function(e,t){var i=e.status,n=this.validatedFileSize(e.size),n=(""===n.minSize&&""===n.maxSize||(this.addInvalidClass(t),i=""!==n.minSize?this.localizedTexts("invalidMinFileSize"):""!==n.maxSize?this.localizedTexts("invalidMaxFileSize"):i),this.checkExtension(this.getFilesInArray(e))[0].status);return n===this.localizedTexts("invalidFileType")&&(this.addInvalidClass(t),i=n),i},YN.prototype.addInvalidClass=function(e){e.classList.add(VN)},YN.prototype.createFormInput=function(e){if("safari"!==this.browserName){var t=this.element.cloneNode(!0);t.classList.add("e-hidden-file-input");for(var i=0,n=e;i<n.length;i++)n[i].input=t;t.setAttribute("id",D("hiddenUploader")),t.setAttribute("name",this.uploaderName),this.uploadWrapper.querySelector("."+lN).appendChild(t),"msie"!==this.browserName&&"edge"!==this.browserName&&(this.element.value="")}},YN.prototype.getFileSize=function(e){for(var t=0,i=0,n=e;i<n.length;i++)t+=n[i].size;return t},YN.prototype.mergeFileInfo=function(e,t){for(var i={name:"",rawFile:"",size:0,status:"",type:"",validationMessages:{minSize:"",maxSize:""},statusCode:"1",list:t},n=[],o="",r=0,s=e;r<s.length;r++){var a=s[r];n.push(a.name),o=a.type}return i.name=n.join(", "),i.size=this.getFileSize(e),i.type=o,i.status=this.statusForFormUpload(e,t),i},YN.prototype.statusForFormUpload=function(e,t){for(var i=!0,n=0,o=e;n<o.length;n++){var r=o[n],s=r.status,a=this.validatedFileSize(r.size),a=(""===a.minSize&&""===a.maxSize||(i=!1,s=""!==a.minSize?this.localizedTexts("invalidMinFileSize"):""!==a.maxSize?this.localizedTexts("invalidMaxFileSize"):s),this.checkExtension(this.getFilesInArray(r))[0].status);a===this.localizedTexts("invalidFileType")&&(i=!1,s=a)}return s=i?this.localizedTexts("totalFiles")+": "+e.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(e)):(t.classList.add(VN),1<e.length?this.localizedTexts("invalidFileSelection"):s)},YN.prototype.formCustomFileList=function(e,t){this.createParentUL();var i=this.createElement("li",{className:pN}),n=(i.setAttribute("data-files-count",e.length+""),this.setListToFileInfo(e,i),this.mergeFileInfo(e,i)),o=(i.setAttribute("data-file-name",n.name),this.uploadTemplateFn=this.templateComplier(this.template),this.uploadTemplateFn(n,this,"template",this.element.id+"Template",this.isStringTemplate,null,i)),o=(o&&ht([].slice.call(o),i),this.listParent.querySelectorAll("li").length),e=(i.classList.contains(VN)||this.createFormInput(e),{element:i,fileInfo:n,index:o,isPreload:this.isPreLoadFile(n)}),o={element:i,fileInfo:n,index:o,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",e),this.trigger("fileListRendering",o),this.listParent.appendChild(i),this.fileList.push(i),this.renderReactTemplates()},YN.prototype.createFileList=function(e){this.filesData=this.filesData&&0<this.filesData.length?this.filesData.concat(e):e,this.internalCreateFileList(e)},YN.prototype.internalCreateFileList=function(e){if(this.createParentUL(),""===this.template||je(this.template))if(this.isFormUpload())this.uploadWrapper.classList.add(NN),this.formFileList(e,this.element.files);else for(var t=0,i=e;t<i.length;t++){var n=i[t],o=this.createElement("li",{className:pN,attrs:{"data-file-name":n.name,"data-files-count":"1"}}),r=this.createElement("span",{className:DN}),s=this.createElement("span",{className:uN,attrs:{title:n.name}}),a=(s.innerHTML=this.getFileNameOnly(n.name),this.createElement("span",{className:gN})),l=this.getFileType(n.name),l=(a.innerHTML="."+l,l||a.classList.add("e-hidden"),this.enableRtl?((l=this.createElement("span",{className:PN})).appendChild(a),l.appendChild(s),r.appendChild(l)):(r.appendChild(s),r.appendChild(a)),this.createElement("span",{className:mN})),a=(l.innerHTML=this.bytesToSize(n.size),r.appendChild(l),this.createElement("span",{className:cN})),l=(r.appendChild(a),a.innerHTML=n.status,o.appendChild(r),this.createElement("span",{className:" e-icons",attrs:{tabindex:this.btnTabIndex}})),r=("msie"===this.browserName&&l.classList.add("e-msie"),l.setAttribute("title",this.localizedTexts("remove")),o.appendChild(l),E.add(l,"click",this.removeFiles,this),"2"===n.statusCode?(a.classList.add(TN),l.classList.add(yN),l.setAttribute("title",this.localizedTexts("delete")),l.setAttribute("aria-label",this.localizedTexts("delete"))):"1"!==n.statusCode&&(a.classList.remove(TN),a.classList.add(MN)),this.autoUpload&&"1"===n.statusCode&&""!==this.asyncSettings.saveUrl&&(a.innerHTML=""),l.classList.contains(yN)||(l.classList.add(fN),l.setAttribute("aria-label",this.localizedTexts("remove"))),e.indexOf(n)),a={element:o,fileInfo:n,index:r,isPreload:this.isPreLoadFile(n)},l={element:o,fileInfo:n,index:r,isPreload:this.isPreLoadFile(n)},r=(this.trigger("rendering",a),this.trigger("fileListRendering",l),this.listParent.appendChild(o),this.fileList.push(o),this.truncateName(s),this.flag);this.isPreLoadFile(n)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=r)}else this.isFormUpload()?(this.uploadWrapper.classList.add(NN),this.formCustomFileList(e,this.element.files)):this.createCustomfileList(e)},YN.prototype.getSlicedName=function(e){var t=e.textContent;e.dataset.tail=t.slice(t.length-10)},YN.prototype.setListToFileInfo=function(e,t){for(var i=0,n=e;i<n.length;i++)n[i].list=t},YN.prototype.truncateName=function(e){("edge"!==this.browserName&&e.offsetWidth<e.scrollWidth||e.offsetWidth+1<e.scrollWidth)&&this.getSlicedName(e)},YN.prototype.getFileType=function(e){var t,i=e.lastIndexOf(".");return(t=0<=i?e.substring(i+1):t)||""},YN.prototype.getFileNameOnly=function(e){var t=this.getFileType(e);return e.split("."+t)[0]},YN.prototype.setInitialAttributes=function(){var e;this.initialAttr.accept&&this.element.setAttribute("accept",this.initialAttr.accept),this.initialAttr.disabled&&this.element.setAttribute("disabled","disabled"),this.initialAttr.multiple&&(e=document.createAttribute("multiple"),this.element.setAttributeNode(e))},YN.prototype.filterfileList=function(e){for(var t,i=[],n=0;n<e.length;n++)(je(t=this.getLiElement(e[n]))||t.classList.contains(TN))&&(this.showFileList||"File uploaded successfully"===e[n].status)||i.push(e[n]);return i},YN.prototype.updateStatus=function(e,t,i,n){return void 0===n&&(n=!0),""===t||je(t)||""===i||je(i)||(e.status=t,e.statusCode=i),!n||je(i=this.getLiElement(e))||je(i.querySelector("."+cN))||""===t||je(t)||(i.querySelector("."+cN).textContent=t),e},YN.prototype.getLiElement=function(e){for(var t,i=0;i<this.filesData.length;i++)je(e)||(je(this.filesData[i].id)||je(e.id)?this.filesData[i].name!==e.name:this.filesData[i].name!==e.name||this.filesData[i].id!==e.id)||(t=i);return this.fileList[t]},YN.prototype.createProgressBar=function(e){var t=this.createElement("span",{className:SN}),i=this.createElement("progressbar",{className:AN,attrs:{value:"0",max:"100"}}),n=this.createElement("span",{className:"e-progress-inner-wrap"}),o=(i.setAttribute("style","width: 0%"),this.createElement("span",{className:xN}));o.textContent="0%",n.appendChild(i),t.appendChild(n),t.appendChild(o),e.querySelector("."+DN).appendChild(t)},YN.prototype.updateProgressbar=function(e,t){var i;isNaN(Math.round(e.loaded/e.total*100))||je(t.querySelector("."+AN))||!je(this.progressInterval)&&""!==this.progressInterval&&0!=(i=Math.round(e.loaded/e.total*100)%parseInt(this.progressInterval,10))&&100!=i||this.changeProgressValue(t,Math.round(e.loaded/e.total*100).toString()+"%")},YN.prototype.changeProgressValue=function(e,t){e.querySelector("."+AN).setAttribute("style","width:"+t),e.querySelector("."+xN).textContent=t},YN.prototype.uploadInProgress=function(e,t,i,n){var o=this.getLiElement(t);je(o)&&!i||(je(o)?this.cancelUploadingFile(t,e,n):("5"===t.statusCode&&this.cancelUploadingFile(t,e,n,o),0<o.querySelectorAll("."+SN).length||!o.querySelector("."+cN)||(o.querySelector("."+cN).classList.add(IN),this.createProgressBar(o),this.updateProgressBarClasses(o,IN),o.querySelector("."+cN).classList.remove(EN)),this.updateProgressbar(e,o),je(i=o.querySelector("."+fN))||(i.classList.add(bN,IN),i.setAttribute("title",this.localizedTexts("abort")),i.classList.remove(fN))),n={e:e,operation:"upload",file:this.updateStatus(t,this.localizedTexts("inProgress"),"3")},this.trigger("progress",n))},YN.prototype.cancelUploadingFile=function(o,e,r,s){var a=this;"5"===o.statusCode&&this.trigger("canceling",{event:e,fileData:o,cancel:!1,customFormData:[],currentRequest:null},function(t){var e,i,n;t.cancel?(o.statusCode="3",je(s)||je(e=s.querySelector("."+bN))||(BA(e),G(s.querySelector(".e-spinner-pane")))):(r.emitError=!1,r.httpRequest.abort(),e=new FormData,"5"===o.statusCode&&(i=a.element.getAttribute("name"),e.append(i,o.name),e.append("cancel-uploading",o.name),a.updateFormData(e,t.customFormData),(n=new ze(a.asyncSettings.removeUrl,"POST",!0,null)).emitError=!1,n.beforeSend=function(e){t.currentRequest&&a.updateCustomheader(n.httpRequest,t.currentRequest)},n.onLoad=function(e){return a.removecanceledFile(e,o),{}},n.send(e)))})},YN.prototype.removecanceledFile=function(e,t){var i,n=this.getLiElement(t);je(n)||n.querySelector("."+wN)||je(n.querySelector("."+bN))||(this.updateStatus(t,this.localizedTexts("fileUploadCancel"),"5"),this.renderFailureState(e,t,n),i=n.querySelector("."+fN),je(n)||(BA(i),je(n.querySelector(".e-spinner-pane")))||G(n.querySelector(".e-spinner-pane")),i=e&&e.currentTarget?this.getResponse(e):null,this.trigger("success",{event:e,response:i,operation:"cancel",file:t}))},YN.prototype.renderFailureState=function(e,t,i){var n=this,o=(this.updateProgressBarClasses(i,EN),this.removeProgressbar(i,"failure"),je(i.querySelector(".e-file-status"))||i.querySelector(".e-file-status").classList.add(EN),i.querySelector("."+bN));je(o)||(o.classList.remove(bN,IN),o.classList.add(fN),o.setAttribute("title",this.localizedTexts("remove")),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),o.parentElement.insertBefore(this.pauseButton,o),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.setAttribute("aria-label",this.localizedTexts("retry")),i.querySelector("."+wN).addEventListener("click",function(e){n.reloadcanceledFile(e,t,i,!1)},!1))},YN.prototype.reloadcanceledFile=function(e,t,i,n){t.statusCode="1",t.status=this.localizedTexts("readyToUploadMessage"),n||(je(i.querySelector("."+cN))||i.querySelector("."+cN).classList.remove(EN),je(i.querySelector("."+wN))||G(i.querySelector("."+wN)),this.pauseButton=null),je(i)||i.classList.add(RN),this.upload([t])},YN.prototype.uploadComplete=function(e,t,i){var n=e.target;4===n.readyState&&200<=n.status&&n.status<=299?je(n=this.getLiElement(t))&&(!i||je(i))&&this.showFileList||(je(n)||(this.updateProgressBarClasses(n,TN),this.removeProgressbar(n,"success"),je(i=n.querySelector("."+bN)))||(i.classList.add(yN),i.setAttribute("title",this.localizedTexts("delete")),i.setAttribute("aria-label",this.localizedTexts("delete")),i.classList.remove(bN),i.classList.remove(IN)),this.raiseSuccessEvent(e,t)):this.uploadFailed(e,t)},YN.prototype.getResponse=function(e){e=e.currentTarget;return{readyState:e.readyState,statusCode:e.status,statusText:e.statusText,headers:e.getAllResponseHeaders(),withCredentials:e.withCredentials}},YN.prototype.raiseSuccessEvent=function(e,t){var i=this,n=e&&e.currentTarget?this.getResponse(e):null,o=this.localizedTexts("uploadSuccessMessage"),e={e:e,response:n,operation:"upload",file:this.updateStatus(t,o,"2",!1),statusText:o},n=this.getLiElement(t);je(n)||je(o=n.querySelector("."+vN))||(BA(n),G(o)),this.trigger("success",e,function(e){i.updateStatus(t,e.statusText,"2"),i.multiple?i.uploadedFilesData.push(t):i.uploadedFilesData=[t],i.trigger("change",{file:i.uploadedFilesData}),i.checkActionButtonStatus(),0<i.fileList.length?i.getLiElement(t).classList.contains(RN)?i.getLiElement(t).classList.remove(RN):(i.uploadSequential(),i.checkActionComplete(!0)):i.showFileList||i.checkActionComplete(!0)})},YN.prototype.uploadFailed=function(e,t){var i=this,n=this.getLiElement(t),o=e&&e.currentTarget?this.getResponse(e):null,r=this.localizedTexts("uploadFailedMessage"),o={e:e,response:o,operation:"upload",file:this.updateStatus(t,r,"0",!1),statusText:r};je(n)||this.renderFailureState(e,t,n),this.trigger("failure",o,function(e){i.updateStatus(t,e.statusText,"0"),i.checkActionButtonStatus(),i.uploadSequential(),i.checkActionComplete(!0)})},YN.prototype.uploadSequential=function(){this.sequentialUpload&&(this.autoUpload?this.checkAutoUpload(this.filesData):this.uploadButtonClick())},YN.prototype.checkActionComplete=function(e){e?++this.actionCompleteCount:--this.actionCompleteCount,this.raiseActionComplete()},YN.prototype.raiseActionComplete=function(){var e;this.filesData.length===this.actionCompleteCount&&this.flag&&(this.flag=!1,(e={fileData:[]}).fileData=this.getSelectedFileStatus(this.selectedFiles),this.trigger("actionComplete",e))},YN.prototype.getSelectedFileStatus=function(e){for(var t=[],i=0,n=0;n<e.length;n++)for(var o=e[n],r=0;r<this.filesData.length;r++)if(this.filesData[r].name===o.name&&this.filesData[r].status===o.status){t[i]=this.filesData[r],++i;break}return t},YN.prototype.updateProgressBarClasses=function(e,t){e=e.querySelector("."+AN);je(e)||(e.classList.add(t),this.actionButtons&&this.clearButton&&this.uploadWrapper&&("e-upload-progress"!==t||this.clearButton.hasAttribute("disabled")?"e-upload-success"!==t&&"e-upload-fails"!==t||0!==this.uploadWrapper.querySelectorAll(".e-upload-progress-bar.e-upload-progress:not(.e-upload-success):not(.e-upload-fails)").length||!this.clearButton.hasAttribute("disabled")||this.clearButton.removeAttribute("disabled"):this.clearButton.setAttribute("disabled","disabled")))},YN.prototype.removeProgressbar=function(e,t){var i=this;je(e.querySelector("."+SN))||(this.progressAnimation=new Vt({duration:1250}),this.progressAnimation.animate(e.querySelector("."+SN),{name:"FadeOut"}),this.progressAnimation.animate(e.querySelector("."+xN),{name:"FadeOut"}),setTimeout(function(){i.animateProgressBar(e,t)},750))},YN.prototype.animateProgressBar=function(e,t){"success"===t?(e.classList.add(TN),je(e.querySelector("."+cN))||(e.querySelector("."+cN).classList.remove(IN),this.progressAnimation.animate(e.querySelector("."+cN),{name:"FadeIn"}),e.querySelector("."+cN).classList.add(TN))):je(e.querySelector("."+cN))||(e.querySelector("."+cN).classList.remove(IN),this.progressAnimation.animate(e.querySelector("."+cN),{name:"FadeIn"}),e.querySelector("."+cN).classList.add(EN)),e.querySelector("."+SN)&&G(e.querySelector("."+SN))},YN.prototype.setExtensions=function(e){""===e||je(e)?this.element.removeAttribute("accept"):this.element.setAttribute("accept",e)},YN.prototype.templateComplier=function(t){if(t)try{return"function"!=typeof t&&ct(t,document).length?oo(ge(t,document).innerHTML.trim()):oo(t)}catch(e){return oo(t)}},YN.prototype.setRTL=function(){(this.enableRtl?U:q)([this.uploadWrapper],"e-rtl")},YN.prototype.localizedTexts=function(e){return this.l10n.setLocale(this.locale),this.l10n.getConstant(e)},YN.prototype.setControlStatus=function(){this.enabled?(this.uploadWrapper.classList.contains(kN)&&this.uploadWrapper.classList.remove(kN),!je(this.browseButton)&&this.element.hasAttribute("disabled")&&(this.element.removeAttribute("disabled"),this.browseButton.removeAttribute("disabled")),!je(this.clearButton)&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),!je(this.uploadButton)&&this.uploadButton.hasAttribute("disabled")&&this.uploadButton.hasAttribute("disabled")):(this.uploadWrapper.classList.add(kN),this.element.setAttribute("disabled","disabled"),this.browseButton.setAttribute("disabled","disabled"),je(this.clearButton)||this.clearButton.setAttribute("disabled","disabled"),je(this.uploadButton)||this.uploadButton.setAttribute("disabled","disabled"))},YN.prototype.checkHTMLAttributes=function(e){for(var t=0,i=e?je(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["accept","multiple","disabled"];t<i.length;t++){var n,o=i[t];if(!je(this.element.getAttribute(o)))switch(o){case"accept":(je(this.uploaderOptions)||void 0===this.uploaderOptions.allowedExtensions||e)&&(this.setProperties({allowedExtensions:this.element.getAttribute("accept")},!e),this.initialAttr.accept=this.allowedExtensions);break;case"multiple":(je(this.uploaderOptions)||void 0===this.uploaderOptions.multiple||e)&&(n="multiple"===this.element.getAttribute(o)||""===this.element.getAttribute(o)||"true"===this.element.getAttribute(o),this.setProperties({multiple:n},!e),this.initialAttr.multiple=!0);break;case"disabled":(je(this.uploaderOptions)||void 0===this.uploaderOptions.enabled||e)&&(n="disabled"!==this.element.getAttribute(o)&&""!==this.element.getAttribute(o)&&"true"!==this.element.getAttribute(o),this.setProperties({enabled:n},!e),this.initialAttr.disabled=!0)}}},YN.prototype.chunkUpload=function(e,t,i){var n=Math.min(this.asyncSettings.chunkSize,e.size),o=e.rawFile.slice(0,n);this.sendRequest(e,{chunkIndex:0,blob:o,file:e,start:0,end:n,retryCount:0,request:null},t,i)},YN.prototype.sendRequest=function(i,n,t,e){var o=this,r=new FormData,s=i.rawFile.slice(n.start,n.end),s=(r.append(this.uploaderName,s,i.name),r.append("chunk-index",n.chunkIndex.toString()),r.append("chunkIndex",n.chunkIndex.toString()),Math.max(Math.ceil(i.size/this.asyncSettings.chunkSize),1)),a=(r.append("total-chunk",s.toString()),r.append("totalChunk",s.toString()),new ze({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null})),l=(a.emitError=!1,a.onLoad=function(e){return o.chunkUploadComplete(e,n,t),{}},a.onUploadProgress=function(e){return o.chunkUploadInProgress(e,n,t),{}},{fileData:i,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize});a.beforeSend=function(t){l.currentRequest=a.httpRequest,l.currentChunkIndex=n.chunkIndex,0===l.currentChunkIndex?o.trigger("uploading",l,function(e){o.uploadingEventCallback(r,e,t,i)}):o.trigger("chunkUploading",l,function(e){o.uploadingEventCallback(r,e,t,i)})},a.onError=function(e){return o.chunkUploadFailed(e,n,t),{}},a.send(r),n.request=a},YN.prototype.uploadingEventCallback=function(e,t,i,n){t.cancel?this.eventCancelByArgs(i,t,n):this.updateFormData(e,t.customFormData)},YN.prototype.eventCancelByArgs=function(e,t,i){var n,o=this;e.cancel=!0,"5"!==t.fileData.statusCode&&(t.fileData.statusCode="5",t.fileData.status=this.localizedTexts("fileUploadCancel"),n=this.getLiElement(t.fileData))&&(je(n.querySelector("."+cN))||(n.querySelector("."+cN).innerHTML=this.localizedTexts("fileUploadCancel"),n.querySelector("."+cN).classList.add(EN)),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),(e=n.querySelector("."+fN))&&e.parentElement.insertBefore(this.pauseButton,e),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.addEventListener("click",function(e){o.reloadcanceledFile(e,i,n)},!1),this.checkActionButtonStatus())},YN.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||je(this.asyncSettings.chunkSize))},YN.prototype.chunkUploadComplete=function(e,n,o){var r,t,i,s=this,a=e.target;4===a.readyState&&200<=a.status&&a.status<300?(i=e&&e.currentTarget?this.getResponse(e):null,t=Math.max(Math.ceil(n.file.size/this.asyncSettings.chunkSize),1),i={event:e,file:n.file,chunkIndex:n.chunkIndex,totalChunk:t,chunkSize:this.asyncSettings.chunkSize,response:i},this.trigger("chunkSuccess",i),!je(o)&&o||(r=this.getLiElement(n.file)),this.updateMetaData(n),n.end===n.file.size&&(n.file.statusCode="3"),"5"===n.file.statusCode?(i={event:e,fileData:n.file,cancel:!1,customFormData:[]},this.trigger("canceling",i,function(e){var t,i;e.cancel?(n.file.statusCode="3",t=r.querySelector("."+bN),je(r)||je(t)||(BA(t),G(r.querySelector(".e-spinner-pane"))),s.sendNextRequest(n)):(n.request.emitError=!1,a.abort(),t=new FormData,i=s.element.getAttribute("name"),t.append(i,n.file.name),t.append("cancel-uploading",n.file.name),t.append("cancelUploading",n.file.name),s.updateFormData(t,e.customFormData),(i=new ze(s.asyncSettings.removeUrl,"POST",!0,null)).emitError=!1,i.onLoad=function(e){return s.removeChunkFile(e,n,o),{}},i.send(t))})):t-1===n.chunkIndex&&t>n.chunkIndex?(0<=(i=this.pausedData.indexOf(n))&&this.pausedData.splice(i,1),je(this.template)&&(je(o)||!o)&&r&&(r&&!je(r.querySelector("."+FN))&&G(r.querySelector("."+FN)),this.removeChunkProgressBar(n)),this.raiseSuccessEvent(e,n.file)):"4"!==n.file.statusCode&&this.sendNextRequest(n)):this.chunkUploadFailed(e,n)},YN.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)},YN.prototype.removeChunkFile=function(e,t,i){var n,o;je(this.template)&&je(i)&&!i&&(o=n=(i=this.getLiElement(t.file)).querySelector("."+bN),this.updateStatus(t.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(i,EN),this.removeProgressbar(i,"failure"),n&&(n.classList.remove(bN),n.classList.add(fN),n.setAttribute("title",this.localizedTexts("remove"))),(t=i.querySelector("."+FN))&&(t.classList.add(wN),t.classList.remove(FN),t.setAttribute("title",this.localizedTexts("retry"))),je(i)||je(n)||je(i.querySelector(".e-spinner-pane"))||(BA(o),G(i.querySelector(".e-spinner-pane"))))},YN.prototype.pauseUpload=function(e,t,i){e.file.statusCode="4",e.file.status=this.localizedTexts("pause"),this.updateMetaData(e);t={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,t),this.sequentialUpload&&this.uploadSequential()},YN.prototype.abortUpload=function(e,t,i){"4"!==e.file.statusCode&&(e.request.emitError=!1,e.request.httpRequest.abort());var n=this.getLiElement(e.file);!je(this.template)||!je(t)&&t||((t=n.querySelector("."+FN)).classList.remove(FN),t.classList.add(LN),t.setAttribute("title",this.localizedTexts("resume")),t.nextElementSibling.classList.add(fN),t.nextElementSibling.classList.remove(bN),t.nextElementSibling.setAttribute("title",this.localizedTexts("remove")));for(var o=0;o<this.pausedData.length;o++)this.pausedData[o].file.name===e.file.name&&this.pausedData.splice(o,1);this.pausedData.push(e),this.trigger("pausing",i)},YN.prototype.resumeUpload=function(e,t,i){var n,o=this.getLiElement(e.file),o=(je(o)||(n=o.querySelector("."+LN)),je(n)||!je(i)&&i||(n.classList.remove(LN),n.classList.add(FN),n.setAttribute("title",this.localizedTexts("pause")),n.nextElementSibling.classList.remove(fN),n.nextElementSibling.classList.add(bN),n.nextElementSibling.setAttribute("title",this.localizedTexts("abort"))),e.file.status=this.localizedTexts("inProgress"),e.file.statusCode="3",this.updateMetaData(e),{event:t||null,file:e.file,chunkIndex:e.chunkIndex,chunkCount:Math.round(e.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize});this.trigger("resuming",o);for(var r=0;r<this.pausedData.length;r++)this.pausedData[r].end===this.pausedData[r].file.size?this.chunkUploadComplete(t,e,i):this.pausedData[r].file.name===e.file.name&&(this.pausedData[r].start=this.pausedData[r].end,this.pausedData[r].end=this.pausedData[r].end+this.asyncSettings.chunkSize,this.pausedData[r].end=Math.min(this.pausedData[r].end,this.pausedData[r].file.size),this.pausedData[r].chunkIndex=this.pausedData[r].chunkIndex+1,this.sendRequest(this.pausedData[r].file,this.pausedData[r],i))},YN.prototype.updateMetaData=function(e){-1===this.uploadMetaData.indexOf(e)||this.uploadMetaData.splice(this.uploadMetaData.indexOf(e),1),this.uploadMetaData.push(e)},YN.prototype.removeChunkProgressBar=function(e){var e=this.getLiElement(e.file);je(e)||(this.updateProgressBarClasses(e,TN),this.removeProgressbar(e,"success"),je(e=e.querySelector("."+bN)))||(e.classList.add(yN),e.setAttribute("title",this.localizedTexts("delete")),e.classList.remove(bN,IN))},YN.prototype.chunkUploadFailed=function(i,n,o){var r,s=this,e=Math.max(Math.ceil(n.file.size/this.asyncSettings.chunkSize),1),a=(!je(this.template)||!je(o)&&o||(r=this.getLiElement(n.file)),i&&i.currentTarget?this.getResponse(i):null),e={event:i,file:n.file,chunkIndex:n.chunkIndex,totalChunk:e,chunkSize:this.asyncSettings.chunkSize,cancel:!1,response:a};this.trigger("chunkFailure",e,function(e){var t;e.cancel||(n.retryCount<s.asyncSettings.retryCount?setTimeout(function(){s.retryRequest(r,n,o)},s.asyncSettings.retryAfterDelay):(je(r)||(je(e=r.querySelector("."+FN)?r.querySelector("."+FN):r.querySelector("."+LN))||(e.classList.add(wN),e.classList.remove(FN,LN)),s.updateProgressBarClasses(r,EN),s.removeProgressbar(r,"failure"),r.querySelector(".e-icons").classList.remove(IN),(e=r.querySelector("."+bN)?r.querySelector("."+bN):r.querySelector("."+fN)).classList.remove(bN),je(r.querySelector("."+FN))||G(r.querySelector("."+FN)),0<n.start?(e.classList.add(yN),e.setAttribute("title",s.localizedTexts("delete"))):(e.classList.add(fN),e.setAttribute("title",s.localizedTexts("remove")))),n.retryCount=0,t=n.file,e=s.localizedTexts("uploadFailedMessage"),e={e:i,response:a,operation:"upload",file:s.updateStatus(t,e,"0",!1),statusText:e},s.trigger("failure",e,function(e){s.updateStatus(t,e.statusText,"0"),s.uploadSequential(),s.checkActionComplete(!0)})))})},YN.prototype.retryRequest=function(e,t,i){je(this.template)&&(je(i)||!i)&&e&&this.updateProgressBarClasses(e,EN),t.retryCount+=1,this.sendRequest(t.file,t)},YN.prototype.checkPausePlayAction=function(e){var t=e.target,i=e.target.parentElement,i=this.fileList.indexOf(i),i=this.filesData[i],i=this.getCurrentMetaData(i);t.classList.contains(FN)?this.pauseUpload(i,e):t.classList.contains(LN)?this.resumeUpload(i,e):t.classList.contains(wN)&&(i.file.status===this.localizedTexts("fileUploadCancel")?this.retryUpload(i,!1):this.retryUpload(i,!0))},YN.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(RN)},YN.prototype.chunkUploadInProgress=function(e,t,i){var n,o,r=this;"4"===t.file.statusCode||("4"!==t.file.statusCode&&"5"!==t.file.statusCode&&(t.file.statusCode="3",t.file.status=this.localizedTexts("inProgress")),this.updateMetaData(t),je(n=this.getLiElement(t.file)))||(je(o=n.querySelector("."+wN))||(o.classList.add(FN),o.setAttribute("title",this.localizedTexts("pause")),o.classList.remove(wN)),je(n)||(0<n.querySelectorAll("."+SN).length||(o=n.querySelector("."+cN),je(this.template)&&(o.classList.add(IN),o.classList.remove(EN),this.createProgressBar(n),this.updateProgressBarClasses(n,IN)),je(o=n.querySelector("."+fN)?n.querySelector("."+fN):n.querySelector("."+yN)))||(o.classList.add(bN),o.setAttribute("title",this.localizedTexts("abort")),o.classList.remove(fN)),!isNaN(Math.round(e.loaded/e.total*100))&&je(this.template)&&"4"!==t.file.statusCode&&(o=void 0,e=Math.ceil(t.file.size/this.asyncSettings.chunkSize)-1,this.asyncSettings.chunkSize)&&e&&(o=Math.round(t.chunkIndex/e*100),this.changeProgressValue(n,o.toString()+"%")),0===t.chunkIndex&&this.checkActionButtonStatus()),je(n.querySelector("."+FN))&&je(this.template)&&je(n.querySelector("."+yN))&&(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"),(e=n.querySelector("."+bN)).parentElement.insertBefore(this.pauseButton,e),this.pauseButton.setAttribute("title",this.localizedTexts("pause")),this.pauseButton.addEventListener("click",function(e){r.checkPausePlayAction(e)},!1)))},YN.prototype.bytesToSize=function(e){var t=-1;if(!e)return"0.0 KB";for(;t++,99<(e/=1024););return 2<=t&&(e*=1024,t=1),Math.max(e,0).toFixed(1)+" "+["KB","MB"][t]},YN.prototype.sortFileList=function(e){for(var t=e=e||this.sortFilesList,i=[],n=0;n<t.length;n++)i.push(t[n].name);for(var o=[],r=0,s=i.sort();r<s.length;r++)for(var a=s[r],n=0;n<t.length;n++)a===t[n].name&&o.push(t[n]);return o},YN.prototype.destroy=function(){this.element.value=null,this.clearTemplate(),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 e=0,t=["aria-label","directory","webkitdirectory","tabindex"];e<t.length;e++)this.element.removeAttribute(t[e]);je(this.uploadWrapper)||(this.uploadWrapper.parentElement.appendChild(this.element),G(this.uploadWrapper)),this.uploadWrapper=null,this.uploadWrapper=null,this.browseButton=null,this.dropAreaWrapper=null,this.dropZoneElement=null,this.dropArea=null,this.keyboardModule=null,this.clearButton=null,this.uploadButton=null,qN.prototype.destroy.call(this)},YN.prototype.upload=function(e,t){var i,n=this;e=e||this.filesData,this.sequentialUpload&&(this.isFirstFileOnSelection||t)?this.sequenceUpload(e):(i=this.getFilesInArray(e),this.trigger("beforeUpload",{customFormData:[],currentRequest:null,cancel:!1},function(e){e.cancel||(n.customFormDatas=e.customFormData&&0<e.customFormData.length?e.customFormData:n.customFormDatas,n.uploadFiles(i,t))}))},YN.prototype.getFilesInArray=function(e){var t=[];return e&&(e instanceof Array?t=e:t.push(e)),t},YN.prototype.serverReadFileBase64=function(r,s,a){var l=this;return new Promise(function(i,n){var o,e=l.fileStreams[r].rawFile;try{var t=new FileReader;t.onload=(o=t,function(){try{var e=o.result,t=e?e.split(";base64,")[1]:null;i(t)}catch(e){n(e)}}),t.readAsDataURL(e.slice(s,s+a))}catch(e){n(e)}})},YN.prototype.uploadFileCount=function(e){var t=this.filesData;return t&&0!==t.length?t.length:-1},YN.prototype.getFileRead=function(e,t){var i=this.filesData;return i&&0!==i.length?(i=i[e],e=this.newFileRef++,this.fileStreams[e]=i,e):-1},YN.prototype.uploadFiles=function(e,t){var i,n=[];if(""!==this.asyncSettings.saveUrl&&!je(this.asyncSettings.saveUrl)){n=!t||je(t)?this.multiple?this.filterfileList(e):((i=[]).push(e[0]),this.filterfileList(i)):e;for(var o=0;o<n.length;o++)this.uploadFilesRequest(n,o,t)}},YN.prototype.uploadFilesRequest=function(i,n,t){var e,o=this,r=this.checkChunkUpload(),s=new ze(this.asyncSettings.saveUrl,"POST",!0,null),a=(s.emitError=!1,{fileData:i[n],customFormData:[],cancel:!1}),l=new FormData;s.beforeSend=function(t){a.currentRequest=s.httpRequest,o.trigger("uploading",a,function(e){e.cancel&&o.eventCancelByArgs(t,e,i[n]),o.customFormDatas&&0<o.customFormDatas.length&&o.updateFormData(l,o.customFormDatas),o.updateFormData(l,e.customFormData)})},"1"===i[n].statusCode&&(e=this.element.getAttribute("name"),l.append(e,i[n].rawFile,i[n].name),r&&i[n].size>this.asyncSettings.chunkSize?this.chunkUpload(i[n],t,n):(s.onLoad=function(e){return a.cancel||o.uploadComplete(e,i[n],t),{}},s.onUploadProgress=function(e){return a.cancel||o.uploadInProgress(e,i[n],t,s),{}},s.onError=function(e){return o.uploadFailed(e,i[n]),{}},s.send(l)))},YN.prototype.spliceFiles=function(e){for(var t=this.fileList[e],i=this.getFilesData(),t=+t.getAttribute("data-files-count"),n=0,o=0;o<e;o++)n+=+this.fileList[o].getAttribute("data-files-count");for(var r=n+t-1;n<=r;r--)i.splice(r,1)},YN.prototype.remove=function(s,r,a,e,l){var h=this,d=(je(e)&&(e=!0),{event:l,cancel:!1,filesData:[],customFormData:[],postRawFile:e,currentRequest:null});this.trigger("beforeRemove",{cancel:!1,customFormData:[],currentRequest:null},function(e){if(!e.cancel)if(h.isFormUpload())d.filesData=s,h.trigger("removing",d,function(e){if(!e.cancel)for(var t=!1,i=void 0,n=0,o=h.getFilesInArray(s);n<o.length;n++){var r=o[n];-1<(i=t?i:h.fileList.indexOf(r.list))&&((r=je(r.input)?null:r.input)&&G(r),h.spliceFiles(i),G(h.fileList[i]),h.fileList.splice(i,1),t=!0,i=-1)}});else if(h.isForm&&(je(h.asyncSettings.removeUrl)||""===h.asyncSettings.removeUrl))d.filesData=h.getFilesData(),h.trigger("removing",d,function(e){e.cancel||h.clearAll()});else for(var e=[],t=((s=je(s)?h.filesData:s)instanceof Array?e=s:e.push(s),d.filesData=e,h.asyncSettings.removeUrl),i=""!==t&&!je(t),n=0,o=e;n<o.length;n++)!function(t){var e=h.uploadedFilesData.indexOf(t);("2"===t.statusCode||"4"===t.statusCode||"0"===t.statusCode&&-1!==e)&&i?h.removeUploadedFile(t,d,a,r):a?h.removeFilesData(t,r):h.trigger("removing",d,function(e){e.cancel||h.removeFilesData(t,r)}),l&&!l.target.classList.contains(fN)&&h.checkActionComplete(!1)}(o[n])})},YN.prototype.clearAll=function(){var e,t=this;je(this.listParent)?("msie"!==this.browserName&&(this.element.value=""),this.filesData=[]):(e={cancel:!1,filesData:this.filesData},this.trigger("clearing",e,function(e){e.cancel||(t.clearData(),t.actionCompleteCount=0,t.count=-1)}))},YN.prototype.getFilesData=function(e){return je(e)?this.filesData:this.getSelectedFiles(e)},YN.prototype.pause=function(e,t){e=e||this.filesData;e=this.getFilesInArray(e);this.pauseUploading(e,t)},YN.prototype.pauseUploading=function(e,t){for(var i=this.getFiles(e),n=0;n<i.length;n++)"3"===i[n].statusCode&&this.pauseUpload(this.getCurrentMetaData(i[n],null),null,t)},YN.prototype.getFiles=function(e){var t=[];return je(e)||e instanceof Array?t=e:t.push(e),t},YN.prototype.resume=function(e,t){e=e||this.filesData;e=this.getFilesInArray(e);this.resumeFiles(e,t)},YN.prototype.resumeFiles=function(e,t){for(var i=this.getFiles(e),n=0;n<i.length;n++)"4"===i[n].statusCode&&this.resumeUpload(this.getCurrentMetaData(i[n],null),null,t)},YN.prototype.retry=function(e,t,i){e=e||this.filesData;e=this.getFilesInArray(e);this.sequentialUpload&&this.isFirstFileOnSelection&&(this.isFirstFileOnSelection=!1),this.retryFailedFiles(e,t,i)},YN.prototype.retryFailedFiles=function(e,t,i){for(var n,o=this.getFiles(e),r=0;r<o.length;r++)"5"!==o[r].statusCode&&"0"!==o[r].statusCode||(0<this.asyncSettings.chunkSize&&this.getCurrentMetaData(o[r],null)?this.retryUpload(this.getCurrentMetaData(o[r],null),t):(n=void 0,i||(n=this.fileList[this.filesData.indexOf(o[r])]),this.reloadcanceledFile(null,o[r],n,i)))},YN.prototype.cancel=function(e){e=e||this.filesData;e=this.getFilesInArray(e);this.cancelUpload(e)},YN.prototype.cancelUpload=function(e){var t=this.getFiles(e);if(0<this.asyncSettings.chunkSize)for(var i,n=0;n<t.length;n++)"3"===t[n].statusCode&&((i=this.getCurrentMetaData(t[n],null)).file.statusCode="5",i.file.status=this.localizedTexts("fileUploadCancel"),this.updateMetaData(i),this.showHideUploadSpinner(t[n]));else for(n=0;n<t.length;n++)"3"===t[n].statusCode&&(t[n].statusCode="5",t[n].status=this.localizedTexts("fileUploadCancel"),this.showHideUploadSpinner(t[n]))},YN.prototype.showHideUploadSpinner=function(e){var e=this.getLiElement(e);!je(e)&&je(this.template)&&(mA({target:e=e.querySelector("."+bN),width:"20px"}),kA(e))},h0([t({saveUrl:"",removeUrl:""},QN)],YN.prototype,"asyncSettings",void 0),h0([e(!1)],YN.prototype,"sequentialUpload",void 0),h0([e({})],YN.prototype,"htmlAttributes",void 0),h0([e("")],YN.prototype,"cssClass",void 0),h0([e(!0)],YN.prototype,"enabled",void 0),h0([e(null)],YN.prototype,"template",void 0),h0([e(!0)],YN.prototype,"multiple",void 0),h0([e(!0)],YN.prototype,"autoUpload",void 0),h0([e(!0)],YN.prototype,"enableHtmlSanitizer",void 0),h0([t({},zN)],YN.prototype,"buttons",void 0),h0([e("")],YN.prototype,"allowedExtensions",void 0),h0([e(0)],YN.prototype,"minFileSize",void 0),h0([e(3e7)],YN.prototype,"maxFileSize",void 0),h0([e(null)],YN.prototype,"dropArea",void 0),h0([kt([{}],Ck)],YN.prototype,"files",void 0),h0([e(!0)],YN.prototype,"showFileList",void 0),h0([e(!1)],YN.prototype,"directoryUpload",void 0),h0([e("Default")],YN.prototype,"dropEffect",void 0),h0([i()],YN.prototype,"created",void 0),h0([i()],YN.prototype,"actionComplete",void 0),h0([i()],YN.prototype,"rendering",void 0),h0([i()],YN.prototype,"beforeUpload",void 0),h0([i()],YN.prototype,"fileListRendering",void 0),h0([i()],YN.prototype,"selected",void 0),h0([i()],YN.prototype,"uploading",void 0),h0([i()],YN.prototype,"success",void 0),h0([i()],YN.prototype,"failure",void 0),h0([i()],YN.prototype,"removing",void 0),h0([i()],YN.prototype,"beforeRemove",void 0),h0([i()],YN.prototype,"clearing",void 0),h0([i()],YN.prototype,"progress",void 0),h0([i()],YN.prototype,"change",void 0),h0([i()],YN.prototype,"chunkSuccess",void 0),h0([i()],YN.prototype,"chunkFailure",void 0),h0([i()],YN.prototype,"chunkUploading",void 0),h0([i()],YN.prototype,"canceling",void 0),h0([i()],YN.prototype,"pausing",void 0),h0([i()],YN.prototype,"resuming",void 0);var qN,GN=h0([Bt],YN);function YN(e,t){t=qN.call(this,e,t)||this;return t.initialAttr={accept:null,multiple:!1,disabled:!1},t.uploadedFilesData=[],t.base64String=[],t.isForm=!1,t.allTypes=!1,t.pausedData=[],t.uploadMetaData=[],t.tabIndex="0",t.btnTabIndex="0",t.disableKeyboardNavigation=!1,t.count=-1,t.actionCompleteCount=0,t.flag=!0,t.selectedFiles=[],t.uploaderName="UploadFiles",t.fileStreams=[],t.newFileRef=0,t.isFirstFileOnSelection=!1,t.dragCounter=0,t.fileList=[],t.filesData=[],t.uploaderOptions=e,t}XN=function(e,t){return(XN=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])}))(e,t)};var XN,aN=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s};function KN(e,t){for(var i=Pe({},e),n=0,o=Object.keys(i);n<o.length;n++){var r=o[n];t.indexOf(r)<0&&b(i,r)}return i}function JN(e,t){var i=40===t?0:e.childElementCount-1,n=i,o=e.querySelector(".e-selected");o&&o.classList.remove("e-selected");for(var r=0,s=e.children.length;r<s;r++)e.children[r].classList.contains("e-focused")&&(n=r,e.children[r].classList.remove("e-focused"),40===t?n++:n--,n===(40===t?e.childElementCount:-1))&&(n=i);-1!==(n=function e(t,i,n,o,r){void 0===r&&(r=0);(i.classList.contains("e-separator")||i.classList.contains("e-disabled"))&&(n===(40===o?t.childElementCount-1:0)?n=40===o?0:t.childElementCount-1:40===o?n++:n--);i=t.children[n];if(i.classList.contains("e-separator")||i.classList.contains("e-disabled")){if(++r===t.childElementCount)return n=-1;n=e(t,i,n,o,r)}return n}(e,e.children[n],n,t))&&(U([e.children[n]],"e-focused"),e.children[n].focus())}function ZN(e,t){var i,n,o,r=[].slice.call(e.getElementsByClassName("e-blank-icon"));t&&[].slice.call(e.getElementsByClassName("e-item")).forEach(function(e){(e.style.paddingLeft||e.style.paddingRight)&&e.removeAttribute("style")}),!r.length||je(t=e.querySelector(".e-item:not(.e-blank-icon):not(.e-separator)"))||(i=(t=t.classList.contains("e-url")?t.querySelector(".e-menu-url"):t).querySelector(".e-menu-icon"),e=e.classList.contains("e-rtl"),n=e?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"},o=parseInt(getComputedStyle(i).fontSize,10)+parseInt(getComputedStyle(i)[n.margin],10)+parseInt(getComputedStyle(t).paddingLeft,10)+"px",r.forEach(function(e){e.classList.contains("e-url")&&e.querySelector(".e-menu-url")?e.querySelector(".e-menu-url").style[n.padding]=o:e.style[n.padding]=o}))}(function(e,t){function i(){this.constructor=e}XN(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(t2,$N=n),aN([e("")],t2.prototype,"iconCss",void 0),aN([e("")],t2.prototype,"id",void 0),aN([e(!1)],t2.prototype,"separator",void 0),aN([e("")],t2.prototype,"text",void 0),aN([e("")],t2.prototype,"url",void 0),aN([e(!1)],t2.prototype,"disabled",void 0);var $N,e2=t2;function t2(){return null!==$N&&$N.apply(this,arguments)||this}i2=function(e,t){return(i2=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])}))(e,t)};var i2,n2,h0=function(e,t){function i(){this.constructor=e}i2(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},aN=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},o2="e-menu-icon",r2="e-item",s2="e-dropdown-popup",a2="e-separator",l2="e-vertical",h2="e-dropdown-popup-width",d2=(h0(p2,n2=n),aN([e("SlideDown")],p2.prototype,"effect",void 0),aN([e(400)],p2.prototype,"duration",void 0),aN([e("ease")],p2.prototype,"easing",void 0),p2);function p2(){return null!==n2&&n2.apply(this,arguments)||this}h0(g2,c2=Ji),g2.prototype.preRender=function(){},g2.prototype.getPersistData=function(){return this.addOnPersist([])},g2.prototype.toggle=function(){this.canOpen()?this.openPopUp():this.createPopupOnClick&&!this.isPopupCreated?(this.createPopup(),this.openPopUp()):this.closePopup()},g2.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete()},g2.prototype.addItems=function(e,t){for(var i,n=this.items.length,o=0,r=this.items.length;o<r;o++)if(t===this.items[o].text){n=o;break}for(var s=e.length-1;0<=s;s--)i=new e2(this,"items",e[s],!0),this.items.splice(n,0,i);this.canOpen()||this.createItems()},g2.prototype.removeItems=function(e,t){for(var i=!1,n=0,o=e.length;n<o;n++)for(var r=0,s=this.items.length;r<s;r++)if(e[n]===(t?this.items[r].id:this.items[r].text)){this.items.splice(r,1),i=!0;break}i&&this.getULElement()&&this.createItems()},g2.prototype.createPopup=function(){var e,t=this.createElement("div",{className:"auto"!==this.popupWidth?s2+" "+h2:s2,id:this.element.id+"-popup"});document.body.appendChild(t),this.dropDown=new Sv(t,{width:this.popupWidth,relateTo:this.element,collision:{X:"fit",Y:"flip"},position:{X:"left",Y:"bottom"},targetType:"relative",content:this.target?this.getTargetElement():"",enableRtl:this.enableRtl}),this.dropDown.element.setAttribute("role","dialog"),this.dropDown.element.setAttribute("aria-label","dropdown menu"),je(this.popupContent)||(this.popupContent.style.display=""),"fixed"===this.dropDown.element.style.position&&this.dropDown.refreshPosition(this.element),this.dropDown.hide(),pt(this.element,((e={})["aria-haspopup"]=this.items.length||this.target?"true":"false",e["aria-expanded"]="false",e.type="button",e)),this.cssClass&&U([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.isPopupCreated=!0,this.createPopupOnClick&&(e=At(this.activeElem[0],"split-btn"))&&(e.isPopupCreated=!0)},g2.prototype.getTargetElement=function(){return!this.createPopupOnClick||this.isColorPicker()||je(this.popupContent)?"string"==typeof this.target?ge(this.target):this.target:this.popupContent},g2.prototype.createItems=function(e){var t,n=this,i=this.items,o=this.hasIcon(this.items,"iconCss"),r=this.getULElement();if(r?r.innerHTML="":r=this.createElement("ul",{attrs:{role:"menu",tabindex:"0"}}),this.itemTemplate){var s=this.compiletemplate(this.itemTemplate);i.forEach(function(e){var t=n.createElement("li",{className:e.separator?r2+" "+a2:r2,attrs:e.separator?{role:"separator",tabindex:"-1","aria-label":"separator","aria-hidden":"true"}:{role:"menuitem",tabindex:"-1","aria-label":e.text},id:e.id||D("e-"+n.getModuleName()+"-item")}),i=s(e,n,"template",null,!1,null,t),i=(i&&ht(i,t),e.disabled&&t.classList.add("e-disabled"),{item:e,element:t});n.trigger("beforeItemRender",i),i.item.disabled!==e.disabled&&t.classList[i.item.disabled?"add":"remove"]("e-disabled"),r.appendChild(t)}),this.isReact&&this.renderReactTemplates()}else for(var a=0;a<i.length;a++){t=i[a],this.enableHtmlSanitizer&&(t.text=go.sanitize(t.text));var l=t.text,h=this.createElement("li",{innerHTML:t.url?"":l,className:t.separator?r2+" "+a2:r2,attrs:t.separator?{role:"separator",tabindex:"-1","aria-label":"separator","aria-hidden":"true"}:{role:"menuitem",tabindex:"-1","aria-label":l},id:t.id||D("e-"+this.getModuleName()+"-item")}),l=(this.enableHtmlSanitizer?h.textContent=t.url?"":l:h.innerHTML=t.url?"":l,t.url&&(h.appendChild(this.createAnchor(t)),h.classList.add("e-url")),t.iconCss?(l=this.createElement("span",{className:o2+" "+t.iconCss}),t.url?h.childNodes[0].appendChild(l):h.insertBefore(l,h.childNodes[0])):o&&!t.separator&&h.classList.add("e-blank-icon"),t.disabled);t.disabled&&h.classList.add("e-disabled"),this.trigger("beforeItemRender",t={item:t,element:h}),l!==t.item.disabled&&(t.item.disabled?h.classList.add("e-disabled"):h.classList.remove("e-disabled")),r.appendChild(h)}e&&this.getPopUpElement().appendChild(r),o&&ZN(this.getPopUpElement())},g2.prototype.compiletemplate=function(t){if(this.itemTemplate)try{if("function"!=typeof this.itemTemplate){var e=document.querySelector(this.itemTemplate);if(e)return oo(e.innerHTML.trim())}return oo(t)}catch(e){return oo(t)}},g2.prototype.hasIcon=function(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i][""+t])return!0;return!1},g2.prototype.createAnchor=function(e){var t=e.text,e=this.createElement("a",{className:"e-menu-text e-menu-url",attrs:{href:e.url}});return this.enableHtmlSanitizer?e.textContent=t:e.innerHTML=t,e},g2.prototype.initialize=function(){this.button=new zv({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=D("e-"+this.getModuleName())),this.appendArrowSpan(),this.setActiveElem([this.element]),this.element.setAttribute("tabindex","0"),this.element.setAttribute("aria-label",this.element.textContent||"dropdownbutton"),this.target&&!this.isColorPicker()&&!this.createPopupOnClick||!this.createPopupOnClick?this.createPopup():(this.isPopupCreated=!1,this.target&&!this.isColorPicker()&&this.createPopupOnClick&&(this.popupContent=this.getTargetElement(),this.popupContent.style.display="none"))},g2.prototype.isColorPicker=function(){var e;return!!this.element&&!!((e=this.element.previousSibling)&&e.classList&&e.classList.contains("e-split-colorpicker"))},g2.prototype.appendArrowSpan=function(){this.cssClass=je(this.cssClass)?"":this.cssClass,this.element.appendChild(this.createElement("span",{className:"e-btn-icon e-icons e-icon-"+(-1<this.cssClass.indexOf(l2)?"bottom":"right")+" e-caret"}))},g2.prototype.setActiveElem=function(e){this.activeElem=e},g2.prototype.getModuleName=function(){return"dropdown-btn"},g2.prototype.canOpen=function(){var e=!1;return e=this.isPopupCreated?this.getPopUpElement().classList.contains("e-popup-close"):e},g2.prototype.destroy=function(){var e,t=this;c2.prototype.destroy.call(this),"dropdown-btn"===this.getModuleName()&&(this.element.querySelector("span.e-caret")&&G(this.element.querySelector("span.e-caret")),this.cssClass&&(e=this.cssClass.split(" ")),this.button.destroy(),e&&q([this.element],e),q(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){t.element.removeAttribute(e)}),this.popupUnWireEvents(),this.destroyPopup(),this.isPopupCreated=!1,this.disabled||this.unWireEvents())},g2.prototype.destroyPopup=function(){this.isPopupCreated&&(this.dropDown.destroy(),this.getPopUpElement()&&(e=document.getElementById(this.getPopUpElement().id))&&(q([e],["e-popup-open","e-popup-close"]),G(e)),E.remove(this.getPopUpElement(),"click",this.clickHandler),E.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler),this.isPopupCreated)&&this.dropDown&&(this.dropDown.element=null,this.dropDown=void 0),this.isPopupCreated=!1;var e=At(this.activeElem[0],"split-btn");this.createPopupOnClick&&e&&(e=At(this.activeElem[1],"dropdown-btn"))&&(e.isPopupCreated=!1)},g2.prototype.getPopUpElement=function(){var e,t=null;return!this.dropDown&&this.activeElem[0].classList.contains("e-split-btn")&&(e=At(this.activeElem[1],"dropdown-btn"))&&(this.dropDown=e.dropDown),t=this.dropDown?this.dropDown.element:t},g2.prototype.getULElement=function(){var e=null;return e=this.getPopUpElement()?this.getPopUpElement().children[0]:e},g2.prototype.wireEvents=function(){this.delegateMousedownHandler=this.mousedownHandler.bind(this),this.createPopupOnClick||E.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),E.add(this.element,"click",this.clickHandler,this),E.add(this.element,"keydown",this.keyBoardHandler,this),E.add(window,"resize",this.windowResize,this)},g2.prototype.windowResize=function(){!this.canOpen()&&this.dropDown&&this.dropDown.refreshPosition(this.element)},g2.prototype.popupWireEvents=function(){this.delegateMousedownHandler||(this.delegateMousedownHandler=this.mousedownHandler.bind(this));var e=this.getPopUpElement();this.createPopupOnClick&&E.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),e&&(E.add(e,"click",this.clickHandler,this),E.add(e,"keydown",this.keyBoardHandler,this),this.closeActionEvents)&&E.add(e,this.closeActionEvents,this.focusoutHandler,this),this.rippleFn=Ht(e,{selector:"."+r2})},g2.prototype.popupUnWireEvents=function(){var e=this.getPopUpElement();this.createPopupOnClick&&E.remove(document,"mousedown touchstart",this.delegateMousedownHandler),e&&e.parentElement&&(E.remove(e,"click",this.clickHandler),E.remove(e,"keydown",this.keyBoardHandler),this.closeActionEvents)&&E.remove(e,this.closeActionEvents,this.focusoutHandler),Gt&&this.rippleFn&&this.rippleFn()},g2.prototype.keyBoardHandler=function(e){if(e.target!==this.element||9!==e.keyCode&&(e.altKey||40!==e.keyCode)&&38!==e.keyCode)switch(e.target&&(e.target.classList.contains("e-item")||e.target.parentElement&&e.target.parentElement.classList.contains("e-split-btn-wrapper"))&&13===e.keyCode&&e.preventDefault(),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)}},g2.prototype.isSafari=function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},g2.prototype.upDownKeyHandler=function(e){this.target&&(38===e.keyCode||40===e.keyCode)||(e.preventDefault(),JN(this.getULElement(),e.keyCode))},g2.prototype.keyEventHandler=function(e){this.target&&(13===e.keyCode||9===e.keyCode)||(13===e.keyCode&&this.activeElem[0].classList.contains("e-split-btn")?(this.triggerSelect(e),this.activeElem[0].focus()):e.target&&-1<e.target.className.indexOf("e-edit-template")&&32===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)))},g2.prototype.getLI=function(e){return"LI"===e.tagName?e:z(e,"li")},g2.prototype.mousedownHandler=function(e){var t=e.target;!this.dropDown||this.canOpen()||!this.getPopUpElement()||z(t,'[id="'+this.getPopUpElement().id+'"]')||z(t,'[id="'+this.element.id+'"]')||this.closePopup(e)},g2.prototype.focusoutHandler=function(e){var t,i;this.isPopupCreated&&!this.canOpen()&&((t=e.relatedTarget||e.target)&&-1<t.className.indexOf("e-item")&&(t=this.getLI(t))&&(i=Array.prototype.indexOf.call(this.getULElement().children,t),i=this.items[i])&&this.trigger("select",{element:t,item:i,event:e}),this.closePopup(e))},g2.prototype.clickHandler=function(e){var t=e.target;z(t,'[id="'+this.element.id+'"]')?!this.createPopupOnClick||this.target&&""!==this.target&&!this.isColorPicker()&&!this.createPopupOnClick?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)):z(t,'[id="'+this.getPopUpElement().id+'"]')&&this.getLI(e.target)&&(this.triggerSelect(e),this.closePopup(e,this.activeElem[0]))},g2.prototype.triggerSelect=function(e){var t,i=this.getLI(e.target);i&&(t=Array.prototype.indexOf.call(this.getULElement().children,i),t=this.items[t])&&this.trigger("select",{element:i,item:t,event:e})},g2.prototype.openPopUp=function(e){var i=this,t=(void 0===e&&(e=null),this.getPopUpElement()),n=(this.activeElem[0]&&this.activeElem[0].classList.contains("e-dropdown-btn")&&t.style.width&&"auto"!==t.style.width&&this.setWidth(t),this.target?1<this.activeElem.length?(n=At(this.activeElem[0],"split-btn")).isReact&&t.childNodes.length<1&&(n.appendReactElement&&n.appendReactElement(this.getTargetElement(),this.getPopUpElement()),this.renderReactTemplates()):this.isReact&&t.childNodes.length<1&&(this.appendReactElement&&this.appendReactElement(this.getTargetElement(),this.getPopUpElement()),this.renderReactTemplates()):this.createItems(!0),this.getULElement()),t=(this.popupWireEvents(),{element:n,items:this.items,event:e,cancel:!1});this.trigger("beforeOpen",t,function(e){var t;e.cancel||(e=i.getULElement(),(t="None"!==i.animationSettings.effect?{name:i.animationSettings.effect,duration:i.animationSettings.duration,timingFunction:i.animationSettings.easing}:null)&&i.animatePopup(t,e),i.dropDown.show(null,i.element),U([i.element],"e-active"),i.element.setAttribute("aria-expanded","true"),i.element.setAttribute("aria-owns",i.getPopUpElement().id),e&&!i.isSafari()&&e.focus(),i.enableRtl&&"0px"!==e.parentElement.style.left&&(t=void 0,t=(i.element.parentElement&&i.element.parentElement.classList.contains("e-split-btn-wrapper")?i.element.parentElement:i.element).offsetWidth,t=e.parentElement.offsetWidth-t,t=parseFloat(e.parentElement.style.left)-t,e.parentElement.style.left=(t=t<0?0:t)+"px"),t={element:e,items:i.items},i.trigger("open",t),e&&i.isSafari()&&e.focus())})},g2.prototype.animatePopup=function(e,t){new Vt(e).animate(t,{begin:function(e){e.element.parentElement.style.height=e.element.parentElement.offsetHeight+"px"}})},g2.prototype.setWidth=function(e){var t=T(e.style.width);-1<t.indexOf("%")&&(t=this.element.offsetWidth*parseFloat(t)/100,e.style.width=t+"px")},g2.prototype.closePopup=function(e,i){var n=this,o=(void 0===e&&(e=null),this.getULElement()),e={element:o,items:this.items,event:e,cancel:!1};this.trigger("beforeClose",e,function(e){var t;e.cancel?o&&o.focus():((e=n.getPopUpElement())&&E.remove(e,"keydown",n.keyBoardHandler),n.popupUnWireEvents(),e=void 0,(e=(t=n.getULElement())?t.querySelector(".e-selected"):e)&&e.classList.remove("e-selected"),n.dropDown&&n.dropDown.hide(),q(n.activeElem,"e-active"),n.element.setAttribute("aria-expanded","false"),n.element.removeAttribute("aria-owns"),i&&(n.isSafari()?i.focus({preventScroll:!0}):i.focus()),e={element:t,items:n.items},n.trigger("close",e),!n.target&&t&&G(t),(!n.target||n.isColorPicker()||n.target&&!n.isColorPicker())&&n.createPopupOnClick&&n.destroyPopup())})},g2.prototype.unWireEvents=function(){this.createPopupOnClick||E.remove(document,"mousedown touchstart",this.delegateMousedownHandler),E.remove(this.element,"click",this.clickHandler),E.remove(this.element,"keydown",this.keyBoardHandler),this.isPopupCreated&&(E.remove(this.getPopUpElement(),"click",this.clickHandler),E.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler)),E.remove(window,"resize",this.windowResize)},g2.prototype.onPropertyChanged=function(e,t){var i;this.button.setProperties(KN(e,["content","cssClass","iconCss","iconPosition","disabled","enableRtl"])),this.isPopupCreated&&(i=this.getPopUpElement(),this.dropDown.setProperties(KN(e,["enableRtl"])));for(var n,o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){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":t.cssClass=je(t.cssClass)?"":t.cssClass,(-1<e.cssClass.indexOf(l2)||-1<t.cssClass.indexOf(l2))&&(this.element.querySelector("span.e-caret")||this.appendArrowSpan(),n=this.element.querySelector("span.e-caret"),-1<e.cssClass.indexOf(l2)?mt(n,["e-icon-bottom"],["e-icon-right"]):mt(n,["e-icon-right"],["e-icon-bottom"])),this.isPopupCreated&&(t.cssClass&&q([i],t.cssClass.split(" ")),e.cssClass)&&U([i],e.cssClass.replace(/\s+/g," ").trim().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()}},g2.prototype.focusIn=function(){this.element.focus()},aN([e("")],g2.prototype,"content",void 0),aN([e("")],g2.prototype,"cssClass",void 0),aN([e(!1)],g2.prototype,"disabled",void 0),aN([e("")],g2.prototype,"iconCss",void 0),aN([e("Left")],g2.prototype,"iconPosition",void 0),aN([e(!0)],g2.prototype,"enableHtmlSanitizer",void 0),aN([kt([],e2)],g2.prototype,"items",void 0),aN([e(!1)],g2.prototype,"createPopupOnClick",void 0),aN([e("")],g2.prototype,"target",void 0),aN([e("")],g2.prototype,"closeActionEvents",void 0),aN([e(null)],g2.prototype,"itemTemplate",void 0),aN([e("auto")],g2.prototype,"popupWidth",void 0),aN([t({effect:"None"},d2)],g2.prototype,"animationSettings",void 0),aN([i()],g2.prototype,"beforeItemRender",void 0),aN([i()],g2.prototype,"beforeOpen",void 0),aN([i()],g2.prototype,"beforeClose",void 0),aN([i()],g2.prototype,"close",void 0),aN([i()],g2.prototype,"open",void 0),aN([i()],g2.prototype,"select",void 0),aN([i()],g2.prototype,"created",void 0);var c2,u2=aN([Bt],g2);function g2(e,t){e=c2.call(this,e,t)||this;return e.isPopupCreated=!0,e}m2=function(e,t){return(m2=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])}))(e,t)};var m2,f2,h0=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},y2="e-rtl",v2="EJS-SPLITBUTTON",b2=(function(e,t){function i(){this.constructor=e}m2(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(w2,f2=u2),w2.prototype.preRender=function(){var e=this.element;if(e.tagName===v2){for(var t=R("ej2_instances",e),i=this.createElement("button",{attrs:{type:"button"}}),n=this.createElement(v2,{className:"e-"+this.getModuleName()+"-wrapper"}),o=0,r=e.attributes.length;o<r;o++)i.setAttribute(e.attributes[o].nodeName,e.attributes[o].nodeValue);e.parentNode.insertBefore(n,e),G(e),n.appendChild(e=i),x("ej2_instances",t,e),this.wrapper=n,this.element=e}this.element.id||(this.element.id=D("e-"+this.getModuleName()))},w2.prototype.render=function(){this.initWrapper(),this.createPrimaryButton(),this.renderControl()},w2.prototype.renderControl=function(){this.createSecondaryButton(),this.setActiveElem([this.element,this.secondaryBtnObj.element]),this.setAria(),this.wireEvents(),this.renderComplete()},w2.prototype.addItems=function(e,t){f2.prototype.addItems.call(this,e,t),this.secondaryBtnObj.items=this.items},w2.prototype.removeItems=function(e,t){f2.prototype.removeItems.call(this,e,t),this.secondaryBtnObj.items=this.items},w2.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(y2),this.cssClass&&U([this.wrapper],this.cssClass.replace(/\s+/g," ").trim().split(" "))},w2.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 zv(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)},w2.prototype.createSecondaryButton=function(){var i=this,e=this.createElement("button",{className:"e-icon-btn",attrs:{tabindex:"-1"},id:this.element.id+"_dropdownbtn"}),t=(this.wrapper.appendChild(e),{cssClass:this.cssClass,disabled:this.disabled,enableRtl:this.enableRtl,items:this.items,target:this.target,createPopupOnClick:this.createPopupOnClick});t.beforeItemRender=function(e){i.createPopupOnClick&&(i.secondaryBtnObj.dropDown.relateTo=i.wrapper,i.dropDown=i.secondaryBtnObj.dropDown),i.trigger("beforeItemRender",e)},t.open=function(e){i.trigger("open",e)},t.close=function(e){i.trigger("close",e)},t.select=function(e){i.trigger("select",e)},t.beforeOpen=function(e){i.createPopupOnClick&&0===i.items.length&&(i.secondaryBtnObj.dropDown.relateTo=i.wrapper,i.dropDown=i.secondaryBtnObj.dropDown);var t=new C2;return i.trigger("beforeOpen",e,function(e){t.resolve(e)}),t},t.beforeClose=function(e){var t=new C2;return i.trigger("beforeClose",e,function(e){t.resolve(e)}),t},this.secondaryBtnObj=new u2(t),this.secondaryBtnObj.createElement=this.createElement,this.secondaryBtnObj.appendTo(e),this.createPopupOnClick||(this.secondaryBtnObj.dropDown.relateTo=this.wrapper,this.dropDown=this.secondaryBtnObj.dropDown),this.isPopupCreated=this.secondaryBtnObj.isPopupCreated,this.secondaryBtnObj.activeElem=[this.element,this.secondaryBtnObj.element],this.secondaryBtnObj.element.querySelector(".e-btn-icon").classList.remove("e-icon-right"),this.disabled&&this.wrapper.classList.add("e-splitbtn-disabled")},w2.prototype.setAria=function(){pt(this.element,{"aria-expanded":"false","aria-haspopup":"true","aria-label":this.element.textContent?this.element.textContent+" splitbutton":"splitbutton","aria-owns":this.element.id+"_dropdownbtn-popup"})},w2.prototype.getModuleName=function(){return"split-btn"},w2.prototype.toggle=function(){this.secondaryBtnObj.toggle()},w2.prototype.destroy=function(){var e,t=this,i=[y2];this.cssClass&&(i=i.concat(this.cssClass.split(" "))),this.element&&(e=document.getElementById(this.element.id))&&e.parentElement===this.wrapper&&(this.wrapper.tagName===v2?(this.wrapper.innerHTML="",q([this.wrapper],["e-rtl","e-"+this.getModuleName()+"-wrapper"]),q([this.wrapper],this.cssClass.split(" "))):(q([this.element],i),["aria-label","aria-haspopup","aria-expanded","aria-owns","type"].forEach(function(e){t.element.removeAttribute(e)}),this.wrapper.parentNode.insertBefore(this.element,this.wrapper),ue(this.wrapper)),this.unWireEvents()),this.primaryBtnObj.destroy(),this.secondaryBtnObj.destroy(),f2.prototype.destroy.call(this),this.element&&!this.element.getAttribute("class")&&this.element.removeAttribute("class"),this.refreshing&&this.isAngular&&(this.element=this.wrapper,["e-control","e-split-btn","e-lib"].forEach(function(e){t.element.classList.add(e)}),x("ej2_instances",[this],this.element)),this.wrapper=null},w2.prototype.wireEvents=function(){E.add(this.element,"click",this.primaryBtnClickHandler,this),new bn(this.element,{keyAction:this.btnKeyBoardHandler.bind(this),keyConfigs:{altdownarrow:"alt+downarrow",enter:"enter"}})},w2.prototype.unWireEvents=function(){E.remove(this.element,"click",this.primaryBtnClickHandler),K(this.element,bn).destroy()},w2.prototype.primaryBtnClickHandler=function(){this.trigger("click",{element:this.element})},w2.prototype.btnKeyBoardHandler=function(e){switch(e.action){case"altdownarrow":this.clickHandler(e);break;case"enter":this.clickHandler(e),this.getPopUpElement()&&!this.getPopUpElement().classList.contains("e-popup-close")?(this.element.classList.remove("e-active"),this.secondaryBtnObj.element.classList.add("e-active")):this.secondaryBtnObj.element.classList.remove("e-active")}},w2.prototype.onPropertyChanged=function(e,t){var i;this.primaryBtnObj.setProperties(KN(e,["content","iconCss","iconPosition","cssClass","disabled","enableRtl"])),i=["beforeOpen","beforeItemRender","select","open","close","cssClass","disabled","enableRtl","createPopupOnClick"],-1<Object.keys(e).indexOf("items")&&(this.secondaryBtnObj.items=e.items,this.secondaryBtnObj.dataBind()),this.secondaryBtnObj.setProperties(KN(e,i));for(var n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"cssClass":t.cssClass&&q([this.wrapper],t.cssClass.split(" ")),U([this.wrapper],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":(e.enableRtl?U:q)([this.wrapper],y2);break;case"disabled":(e.disabled?U:q)([this.wrapper],"e-splitbtn-disabled")}},w2.prototype.focusIn=function(){this.element.focus()},h0([e("")],w2.prototype,"content",void 0),h0([e("")],w2.prototype,"cssClass",void 0),h0([e(!1)],w2.prototype,"disabled",void 0),h0([e("")],w2.prototype,"iconCss",void 0),h0([e("Left")],w2.prototype,"iconPosition",void 0),h0([e(!1)],w2.prototype,"createPopupOnClick",void 0),h0([kt([],e2)],w2.prototype,"items",void 0),h0([e("")],w2.prototype,"target",void 0),h0([i()],w2.prototype,"beforeItemRender",void 0),h0([i()],w2.prototype,"beforeOpen",void 0),h0([i()],w2.prototype,"beforeClose",void 0),h0([i()],w2.prototype,"click",void 0),h0([i()],w2.prototype,"close",void 0),h0([i()],w2.prototype,"open",void 0),h0([i()],w2.prototype,"select",void 0),h0([i()],w2.prototype,"created",void 0),h0([Bt],w2));function w2(e,t){return f2.call(this,e,t)||this}var C2=function(){var i=this;this.promise=new Promise(function(e,t){i.resolve=e,i.reject=t}),this.catch=this.promise.catch.bind(this.promise),this.then=this.promise.then.bind(this.promise)};S2=function(e,t){return(S2=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])}))(e,t)};var S2,A2,aN=function(e,t){function i(){this.constructor=e}S2(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},h0=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},x2="e-hide-spinner",I2="e-progress",T2="e-progress-active",E2="e-btn-content",D2=(aN(M2,A2=n),h0([e(null)],M2.prototype,"template",void 0),h0([e(16)],M2.prototype,"width",void 0),h0([e("Left")],M2.prototype,"position",void 0),M2);function M2(){return null!==A2&&A2.apply(this,arguments)||this}aN(B2,k2=n),h0([e(400)],B2.prototype,"duration",void 0),h0([e("None")],B2.prototype,"effect",void 0),h0([e("ease")],B2.prototype,"easing",void 0);var k2,P2=B2;function B2(){return null!==k2&&k2.apply(this,arguments)||this}aN(L2,F2=zv),L2.prototype.preRender=function(){F2.prototype.preRender.call(this)},L2.prototype.render=function(){F2.prototype.render.call(this),this.init(),this.wireEvents(),this.setAria(),this.renderComplete()},L2.prototype.start=function(e){this.isPaused=!1,this.startProgress(e||this.percent,this.progressTime)},L2.prototype.stop=function(){this.isPaused=!0,cancelAnimationFrame(this.timerId)},L2.prototype.progressComplete=function(){this.isPaused=!1,this.finishProgress()},L2.prototype.getModuleName=function(){return"progress-btn"},L2.prototype.destroy=function(){var t=this,e=[x2,T2,"e-round-corner","e-"+F2.prototype.getModuleName.call(this)];this.spinSettings.position&&e.push("e-spin-"+this.spinSettings.position.toLowerCase()),F2.prototype.destroy.call(this),this.unWireEvents(),this.element.innerHTML="",this.cssClass&&(e=e.concat(this.cssClass.split(" "))),q([this.element],e),(this.element.getAttribute("class")?["aria-label","aria-valuemin","aria-valuemax","aria-valuenow"]:["aria-label","aria-valuemin","aria-valuemax","aria-valuenow","class"]).forEach(function(e){t.element.removeAttribute(e)}),this.disabled&&this.element.removeAttribute("disabled")},L2.prototype.init=function(){this.element.classList.add("e-"+F2.prototype.getModuleName.call(this)),this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress()},L2.prototype.createSpinner=function(){var e=this.createElement("span",{className:"e-spinner"});this.setSpinPosition(e),mA({target:e,width:this.spinSettings.width||16,template:this.spinSettings.template},this.createElement)},L2.prototype.getSpinner=function(){return this.element.getElementsByClassName("e-spinner")[0]},L2.prototype.getProgress=function(){return this.element.getElementsByClassName(I2)[0]},L2.prototype.setSpinPosition=function(e){var t=this.spinSettings.position||"Left";"Left"===t||"Top"===t?this.element.insertBefore(e,this.element.getElementsByClassName(E2)[0]):this.element.appendChild(e),this.element.classList.add("e-spin-"+t.toLowerCase())},L2.prototype.createProgress=function(){this.element.appendChild(this.createElement("span",{className:I2}))},L2.prototype.setContent=function(){var e=this.element.innerHTML;this.enableHtmlSanitizer&&(e=go.sanitize(this.element.innerHTML)),this.element.innerHTML="",this.element.appendChild(this.createElement("span",{className:E2,innerHTML:e}))},L2.prototype.clickHandler=function(){this.element.classList.contains(T2)||this.startProgress()},L2.prototype.startProgress=function(e,t){var i=this.element.classList,n=i.contains("e-vertical");i.add(T2),i.contains(x2)||kA(this.element.querySelector(".e-spinner")),this.startAnimate(Date.now(),t||0,t?Date.now()-+this.duration/100:Date.now(),e||0,0,this.step,0,n),this.startContAnimate()},L2.prototype.startAnimate=function(e,t,i,n,o,r,s,a){var l=this;try{var h=e-i,d=this.duration*r/100,p=h?h<d?h-d:h%d:0,c=(this.progressTime=t=t+h-p,i=e-p,n+=(h-p)/this.duration*100,{percent:o=(t-s)%d==0||100===n?n:o,currentDuration:t,step:r});this.eIsVertical=a,0===n?this.trigger("begin",c,function(e){l.successCallback(e,n,o,t,s,p,i)}):100===n||t===this.duration?this.trigger("end",c,function(e){l.successCallback(e,n,o,t,s,p,i)}):this.trigger("progress",c,function(e){l.successCallback(e,n,o,t,s,p,i)})}catch(e){cancelAnimationFrame(this.timerId),this.trigger("fail",e)}},L2.prototype.successCallback=function(e,t,i,n,o,r,s){var a=this,l=t,h=i,t=r,d=n,p=o,c=s,u=this.eIsVertical;l!==e.percent&&e.percent!==h&&(l=e.percent),this.percent=l,this.step=e.step,(d-p)%(this.duration*e.step/100)!=0&&100!==l||(this.timerId=requestAnimationFrame(function(){a.enableProgress&&a.getProgress()&&(a.getProgress().style[u?"height":"width"]=l+"%"),a.element.setAttribute("aria-valuenow",l.toString())}),h=l,p=d),this.isPaused||(d<this.duration&&l<100?this.interval=window.setTimeout(function(){a.startAnimate(Date.now(),d,c,l,h,e.step,p,u)},this.duration/100-t):this.interval=window.setTimeout(function(){a.progressTime=a.percent=0,a.enableProgress&&a.getProgress()&&(a.getProgress().style[u?"height":"width"]="0%"),a.element.setAttribute("aria-valuenow","0"),a.hideSpin()},100))},L2.prototype.startContAnimate=function(){var e=this,t=this.element.getElementsByClassName(E2)[0];"None"!==this.animationSettings.effect?new Vt({}).animate(t,{duration:0===this.animationSettings.duration&&"Enable"===Ut?400:this.animationSettings.duration,name:"Progress"+this.animationSettings.effect,timingFunction:this.animationSettings.easing,begin:function(){"Center"===e.spinSettings.position&&e.setSpinnerSize()},end:function(){t.classList.add("e-animate-end")}}):"Center"===this.spinSettings.position&&this.setSpinnerSize()},L2.prototype.finishProgress=function(){for(var e=this.element.classList,t=e.contains("e-vertical"),i=(e.add(T2),this.percent);i<100;i++)100<(i+=10)&&(i=100),this.enableProgress&&this.getProgress()&&(this.getProgress().style[t?"height":"width"]=this.percent<100?i+"%":"100%");this.element.setAttribute("aria-valuenow","0"),this.hideSpin();e={step:this.step,currentDuration:this.progressTime,percent:100};clearTimeout(this.interval),this.trigger("end",e),this.progressTime=this.percent=0},L2.prototype.setSpinnerSize=function(){var e=this.element.getElementsByClassName(E2)[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")},L2.prototype.hideSpin=function(){var e,t=this.element.getElementsByClassName(E2)[0];this.element.classList.contains(x2)||BA(this.element.querySelector(".e-spinner")),this.element.classList.remove(T2),"None"!==this.animationSettings.effect&&t.classList.remove("e-animate-end"),"Center"===this.spinSettings.position&&(e=this.getSpinner(),t.classList.remove("e-cont-animate"),e.style.width="auto",e.style.height="auto")},L2.prototype.setIconSpan=function(){var e=this.element.getElementsByClassName(E2)[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])},L2.prototype.setAria=function(){pt(this.element,{"aria-label":this.element.textContent+" progress"})},L2.prototype.wireEvents=function(){E.add(this.element,"click",this.clickHandler,this)},L2.prototype.unWireEvents=function(){E.remove(this.element,"click",this.clickHandler)},L2.prototype.onPropertyChanged=function(e,t){var i=this.element,n=!1;this.element.querySelector(".e-spinner-pane").classList.contains("e-spin-show")&&(n=!0),F2.prototype.onPropertyChanged.call(this,e,t);for(var o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"content":this.setContent(),this.createSpinner(),n&&(kA(this.element.querySelector(".e-spinner")),n=!1),this.enableProgress&&this.createProgress(),i.setAttribute("aria-label",i.textContent+" progress");break;case"iconCss":t.iconCss||this.setIconSpan();break;case"iconPosition":this.setIconSpan();break;case"enableProgress":e.enableProgress?this.createProgress():ue(this.getProgress());break;case"spinSettings":e.spinSettings.position&&(i.classList.remove("e-spin-"+t.spinSettings.position.toLowerCase()),this.setSpinPosition(this.getSpinner())),(e.spinSettings.template||e.spinSettings.width)&&(i.removeChild(this.getSpinner()),this.createSpinner())}},h0([e(!(L2.prototype.focusIn=function(){this.element.focus()}))],L2.prototype,"enableProgress",void 0),h0([e(2e3)],L2.prototype,"duration",void 0),h0([e("Left")],L2.prototype,"iconPosition",void 0),h0([e("")],L2.prototype,"iconCss",void 0),h0([e(!1)],L2.prototype,"disabled",void 0),h0([e(!1)],L2.prototype,"isPrimary",void 0),h0([e("")],L2.prototype,"cssClass",void 0),h0([e("")],L2.prototype,"content",void 0),h0([e(!1)],L2.prototype,"isToggle",void 0),h0([e(!0)],L2.prototype,"enableHtmlSanitizer",void 0),h0([t({},D2)],L2.prototype,"spinSettings",void 0),h0([t({},P2)],L2.prototype,"animationSettings",void 0),h0([i()],L2.prototype,"created",void 0),h0([i()],L2.prototype,"begin",void 0),h0([i()],L2.prototype,"progress",void 0),h0([i()],L2.prototype,"end",void 0),h0([i()],L2.prototype,"fail",void 0);var F2,aN=h0([Bt],L2);function L2(e,t){e=F2.call(this,e,t)||this;return e.step=1,e}R2=function(e,t){return(R2=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])}))(e,t)};var R2,O2,h0=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},N2="e-apply",V2="e-cancel",_2="e-current",H2="e-ctrl-btn",z2="e-switch-ctrl-btn",j2="e-disabled",W2="e-value-switch-btn",Q2="e-handler",U2="e-hide-hex-value",q2="e-hide-opacity",G2="e-hide-switchable-value",Y2="e-hide-value",X2="e-hide-valueswitcher",K2="e-hsv-color",J2="e-hsv-container",Z2="e-selected-value",$2="e-mode-switch-btn",eV="e-nocolor-item",tV="e-opacity-value",iV="e-palette",nV="e-color-palette",oV="e-color-picker",rV="e-preview-container",sV="e-previous",aV="e-show-value",lV="e-selected",hV="e-split-preview",dV="e-tile",pV=["#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"],cV=(function(e,t){function i(){this.constructor=e}R2(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(uV,O2=Ji),uV.prototype.preRender=function(){var e=this.element;this.formElement=z(this.element,"form"),this.formElement&&E.add(this.formElement,"reset",this.formResetHandler,this);this.l10n=new Cn("colorpicker",{Apply:"Apply",Cancel:"Cancel",ModeSwitcher:"Switch Mode",RecentColors:"Recent colors"},this.locale),e.getAttribute("ejs-for")&&!e.getAttribute("name")&&e.setAttribute("name",e.id)},uV.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||U([this.container.parentElement],q2),this.renderComplete()},uV.prototype.initWrapper=function(){var e=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),t=(this.element.parentNode.insertBefore(e,this.element),e.appendChild(this.element),pt(this.element,{tabindex:"-1",spellcheck:"false","aria-label":"colorpicker"}),this.container=this.createElement("div",{className:"e-container"}),this.getWrapper().appendChild(this.container),this.value?this.roundValue(this.value).toLowerCase():"#008000ff"),i=(t=this.noColor&&"Palette"===this.mode&&""===this.value?"":t).slice(0,7);je(this.initialInputValue)&&(this.initialInputValue=i),this.element.value=i,this.enableOpacity?this.setProperties({value:t},!0):this.setProperties({value:i},!0),this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&U([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.tileRipple=Ht(this.container,{selector:"."+dV}),this.ctrlBtnRipple=Ht(this.container,{selector:".e-btn"})},uV.prototype.getWrapper=function(){return this.element.parentElement},uV.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),F.isDevice&&this.refreshPopupPos()},uV.prototype.createSplitBtn=function(){var t=this,e=this.createElement("button",{className:"e-split-colorpicker"}),i=(this.getWrapper().appendChild(e),this.splitBtn=new b2({iconCss:"e-selected-color",target:this.container,disabled:this.disabled,enableRtl:this.enableRtl,createPopupOnClick:this.createPopupOnClick,open:this.onOpen.bind(this),click:function(){var e=new MouseEvent("click",{bubbles:!0,cancelable:!1});t.trigger("change",{currentValue:{hex:t.value.slice(0,7),rgba:t.convertToRgbString(t.hexToRgb(t.value))},previousValue:{hex:null,rgba:null},value:t.value,event:e})}}),this.splitBtn.createElement=this.createElement,this.splitBtn.appendTo(e),this.splitBtn.element.setAttribute("aria-label","colorpicker"),this.createElement("span",{className:hV})),e=(ge(".e-selected-color",e).appendChild(i),i.style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.getPopupEle());U([e],"e-colorpicker-popup"),this.cssClass&&U([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),F.isDevice&&!this.createPopupOnClick&&((i=this.getPopupInst()).relateTo=document.body,i.position={X:"center",Y:"center"},i.targetType="container",i.collision={X:"fit",Y:"fit"},i.offsetY=4,e.style.zIndex=Iv(this.splitBtn.element).toString()),this.bindCallBackEvent()},uV.prototype.onOpen=function(){var e;this.trigger("open",{element:this.container}),F.isDevice||0<Y0((e=this.getPopupInst()).element).length&&(e.collision={X:"flip",Y:"fit"},e.position={X:"right",Y:"bottom"},e.targetType="container")},uV.prototype.getPopupInst=function(){return K(this.getPopupEle(),Sv)},uV.prototype.bindCallBackEvent=function(){var r=this;this.splitBtn.beforeOpen=function(n){var o=new C2;return r.trigger("beforeOpen",n,function(e){var t,i;e.cancel||((t=r.getPopupEle()).style.top=T(0+pageYOffset),t.style.left=T(0+pageXOffset),t.style.display="block",r.createWidget(),t.style.display="",F.isDevice&&(r.createPopupOnClick&&((i=r.getPopupInst()).relateTo=document.body,i.position={X:"center",Y:"center"},i.targetType="container",i.collision={X:"fit",Y:"fit"},i.offsetY=4,t.style.zIndex=Iv(r.splitBtn.element).toString()),r.modal=r.createElement("div"),r.modal.className="e-"+r.getModuleName()+" e-modal",r.modal.style.display="none",document.body.insertBefore(r.modal,t),document.body.className+=" e-colorpicker-overflow",r.modal.style.display="block",r.modal.style.zIndex=(Number(t.style.zIndex)-1).toString())),n.cancel=e.cancel,o.resolve(e)}),o},this.splitBtn.beforeClose=function(t){var e,i=new C2;return je(t.event)?i.resolve(t):(e={element:r.container,event:t.event,cancel:!1},r.trigger("beforeClose",e,function(e){F.isDevice&&t.event.target===r.modal&&(e.cancel=!0),e.cancel||r.onPopupClose(),t.cancel=e.cancel,i.resolve(e)})),i}},uV.prototype.onPopupClose=function(){this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",ge("."+hV,this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",q([this.container],[oV,nV]),F.isDevice&&this.modal&&(q([document.body],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},uV.prototype.createPalette=function(){if(mt(this.container,[nV],[oV]),this.presetColors){var e=this.createElement("div",{className:"e-custom-palette"}),t=(this.appendElement(e),Object.keys(this.presetColors));if(1===t.length)this.appendPalette(this.presetColors[t[0]],t[0],e);else for(var i=0,n=t.length;i<n;i++)this.appendPalette(this.presetColors[t[i]],t[i],e);10<ct(".e-row",e).length&&U([e],"e-palette-group")}else this.appendPalette(pV,"default");"Palette"===this.mode&&!this.modeSwitcher&&this.noColor&&this.setNoColor(),this.showRecentColors&&this.recentColors&&0<this.recentColors.length&&this.renderRecentColor();var o=parseInt(getComputedStyle(this.container).borderBottomWidth,10);this.container.style.width=T(this.container.children[0].offsetWidth+o+o),this.rgb=this.hexToRgb(this.roundValue(this.value)),this.hsv=this.rgbToHsv.apply(this,this.rgb)},uV.prototype.renderRecentColor=function(){var i=this,e=this.container.querySelector(".e-clr-pal-rec-wpr"),e=(e&&G(e),this.createElement("div",{className:"e-clr-pal-rec-wpr"})),t=this.container.querySelector(".e-switch-ctrl-btn"),t=(t?this.container.insertBefore(e,t):this.container.appendChild(e),this.createElement("label",{className:"e-recent-clr-span"}));if(t.textContent=this.l10n.getConstant("RecentColors"),e.appendChild(t),0<this.recentColors.length){for(this.recentColors=this.recentColors.filter(function(e,t){return i.recentColors.indexOf(e)===t});10<this.recentColors.length;)this.recentColors.pop();this.appendPalette(this.recentColors,"recent-color",e)}},uV.prototype.firstPaletteFocus=function(){ge("."+lV,this.container.children[0])||ct("."+iV,this.container)[0].focus()},uV.prototype.appendPalette=function(e,t,i){var n,o,r,s=this.createElement("div",{className:iV,attrs:{tabindex:"0",role:"grid"}});"recent-color"===t&&s.classList.add("e-recent-palette"),i?i.appendChild(s):this.appendElement(s);for(var a=0,l=e.length;a<l;a++)0!==a&&a%this.columns!=0||(n=this.createElement("div",{className:"e-row",attrs:{role:"row"}}),s.appendChild(n)),r=this.roundValue(e[a]).toLowerCase(),o=this.createElement("span",{className:dV,attrs:{role:"gridcell","aria-label":r,"aria-selected":"false"}}),this.trigger("beforeTileRender",{element:o,presetName:t,value:e[a]}),n.appendChild(o),this.value===r&&"recent-color"!==t&&(this.addTileSelection(o),s.focus()),o.style.backgroundColor=this.convertToRgbString(this.hexToRgb(r))},uV.prototype.setNoColor=function(){var t=this.container.querySelector(".e-row").children[0];t.classList.add(eV),this.value||(t.classList.add(lV),z(t,"."+iV).focus()),["aria-selected","aria-label"].forEach(function(e){t.removeAttribute(e)}),t.style.backgroundColor=""},uV.prototype.appendElement=function(e,t){t=this.container.children[t=void 0===t?0:t];t?this.container.insertBefore(e,t):this.container.appendChild(e)},uV.prototype.addTileSelection=function(e){e&&(e.classList.add(lV),e.setAttribute("aria-selected","true"))},uV.prototype.createPicker=function(){mt(this.container,[oV],[nV]);var e=this.createElement("div",{className:J2}),t=(this.appendElement(e),e.appendChild(this.createElement("div",{className:K2})),this.createElement("span",{className:Q2,attrs:{tabindex:"0"}}));e.appendChild(t),null!==this.value&&""!==this.value||(this.value="#008000ff"),this.rgb=this.hexToRgb(this.value),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHsvContainerBg(),this.setHandlerPosition(),this.createSlider(),this.createDragTooltip()},uV.prototype.setHsvContainerBg=function(e){void 0===e&&(e=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(e,100,100,1))},uV.prototype.getHsvContainer=function(){return ge("."+J2,this.container)},uV.prototype.setHandlerPosition=function(){var e=this.getDragHandler(),t=ge("."+K2,this.container);this.enableRtl?e.style.left=T((t.offsetWidth-e.offsetWidth/2.5)*Math.abs(100-this.hsv[1])/100):e.style.left=T((t.offsetWidth-e.offsetWidth/2.5)*this.hsv[1]/100),e.style.top=T((t.offsetHeight-e.offsetHeight/2.5)*(100-this.hsv[2])/100)},uV.prototype.createSlider=function(){var e=this.createElement("div",{className:"e-slider-preview"}),t=(this.appendElement(e,1),this.createPreview(e),this.createElement("div",{className:"e-colorpicker-slider"})),e=(e.insertBefore(t,e.children[0]),this.createElement("div",{className:"e-hue-slider"}));t.appendChild(e),this.hueSlider=new KO({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(e),this.enableOpacity&&(e=this.createElement("div",{className:"e-opacity-slider"}),t.appendChild(e),this.createOpacitySlider(e))},uV.prototype.createOpacitySlider=function(e){this.opacitySlider=new KO({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()},uV.prototype.updateOpacitySliderBg=function(){var e=this.enableRtl?"to left":"to right",t=ge(".e-opacity-empty-track",this.opacitySlider.element);t&&(t.style.background="linear-gradient("+e+", rgba("+this.rgb.slice(0,3)+", 0) 0%, "+this.convertToRgbString(this.rgb.slice(0,3))+" 100%)")},uV.prototype.hueChange=function(e){this.hsv[0]=e.value,this.setHsvContainerBg(),this.convertToOtherFormat()},uV.prototype.opacityChange=function(e){var e=e.value,t=this.rgbToHex(this.rgb),i=(this.hsv[3]=e/100,this.rgb[3]=e/100,this.rgbToHex(this.rgb)),e=(this.updateOpacityInput(e),this.convertToRgbString(this.rgb));this.updatePreview(e),this.triggerEvent(i,t,e)},uV.prototype.updateOpacityInput=function(e){var t;this.enableOpacity&&!this.getWrapper().classList.contains(Y2)&&((t=K(ge("."+tV,this.container),NL)).value=e,t.dataBind())},uV.prototype.createPreview=function(e){var t=this.createElement("div",{className:rV}),e=(e.appendChild(t),this.createElement("span",{className:"e-preview "+_2})),i=(t.appendChild(e),this.convertToRgbString(this.rgb));e.style.backgroundColor=i,e=this.createElement("span",{className:"e-preview "+sV}),t.appendChild(e),e.style.backgroundColor=i},uV.prototype.isPicker=function(){return!this.container.classList.contains(nV)},uV.prototype.getPopupEle=function(){return this.container.parentElement},uV.prototype.createNumericInput=function(e,t,i,n){var o=this,t=new NL({value:t,placeholder:i,min:0,max:n,format:"###.##",showSpinButton:!1,floatLabelType:"Always",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker(),change:function(e){e.event&&o.inputHandler(e.event)}});t.createElement=this.createElement,t.appendTo(e)},uV.prototype.createInput=function(){var e=this.isPicker(),t=this.getWrapper();if(e&&!t.classList.contains(Y2)||!e&&t.classList.contains(aV)){var i=this.createElement("div",{className:Z2}),n=(e?this.appendElement(i,2):this.appendElement(i,1),this.createElement("div",{className:"e-input-container"}));if(i.appendChild(n),t.classList.contains(X2)||this.appendValueSwitchBtn(i),t.classList.contains(U2)||(e=this.createElement("input",{className:"e-hex",attrs:{maxlength:"7",spellcheck:"false","aria-label":"HEX"}}),n.appendChild(e),HF.createInput({element:e,floatLabelType:"Always",properties:{placeholder:"HEX",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker()}},this.createElement),HF.setValue(this.value.slice(0,7),e),e.addEventListener("input",this.inputHandler.bind(this))),!t.classList.contains(G2)){for(var o=void 0,r=void 0,r=this.isRgb?(o="RGB",this.rgb):(o="HSV",this.hsv),s=["rh","gs","bv"],a=0;a<3;a++)this.createNumericInput(n.appendChild(this.createElement("input",{className:"e-"+s[a]+"-value"})),r[a],o[a],255);this.enableOpacity&&this.appendOpacityValue(n)}}},uV.prototype.appendOpacityValue=function(e){this.createNumericInput(e.appendChild(this.createElement("input",{className:tV})),100*this.rgb[3],"A",100)},uV.prototype.appendValueSwitchBtn=function(e){var t=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn "+W2,attrs:{title:"Toggle format"}});e.appendChild(t),this.isPicker()&&!this.getWrapper().classList.contains(G2)&&t.addEventListener("click",this.formatSwitchHandler.bind(this))},uV.prototype.createCtrlBtn=function(){var e,t;(this.modeSwitcher||this.showButtons)&&(this.l10n.setLocale(this.locale),t=this.createElement("div",{className:z2}),this.container.appendChild(t),this.showButtons&&(e=this.createElement("div",{className:H2}),t.appendChild(e),t=this.l10n.getConstant("Apply"),e.appendChild(this.createElement("button",{innerHTML:t,className:"e-btn e-css e-flat e-primary e-small "+N2,attrs:{title:t}})),t=this.l10n.getConstant("Cancel"),e.appendChild(this.createElement("button",{innerHTML:t,className:"e-btn e-css e-flat e-small "+V2,attrs:{title:t}}))),this.modeSwitcher)&&this.appendModeSwitchBtn()},uV.prototype.appendModeSwitchBtn=function(){var e=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+$2,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});ge("."+z2,this.container).insertBefore(e,ge("."+H2,this.container))},uV.prototype.createDragTooltip=function(){var t=this,e=new NS({opensOn:"Custom",showTipPointer:!1,cssClass:"e-color-picker-tooltip",htmlAttributes:{title:"tooltip"},beforeOpen:function(e){t.tooltipEle=e.element},animation:{open:{effect:"None"},close:{effect:"None"}}});e.createElement=this.createElement,e.appendTo(this.container),e.open(this.container),this.tooltipEle.style.zIndex=Iv(this.tooltipEle).toString(),this.tooltipEle.setAttribute("aria-label","colorpicker-tooltip"),ge(".e-tip-content",this.tooltipEle).appendChild(this.createElement("div",{className:"e-tip-transparent"}))},uV.prototype.getTooltipInst=function(){return K(this.container,NS)},uV.prototype.setTooltipOffset=function(e){this.getTooltipInst().offsetY=e},uV.prototype.toggleDisabled=function(t){t?this.getWrapper().classList.add(j2):this.getWrapper().classList.remove(j2),this.showButtons&&[].slice.call(ct(".e-btn",this.container)).forEach(function(e){t?pt(e,{disabled:""}):e.removeAttribute("disabled")})},uV.prototype.convertToRgbString=function(e){return e.length?4===e.length?"rgba("+e.join()+")":"rgb("+e.join()+")":""},uV.prototype.convertToHsvString=function(e){return 4===e.length?"hsva("+e.join()+")":"hsv("+e.join()+")"},uV.prototype.updateHsv=function(){this.hsv[1]=100<this.hsv[1]?100:this.hsv[1],this.hsv[2]=100<this.hsv[2]?100:this.hsv[2],this.setHandlerPosition()},uV.prototype.convertToOtherFormat=function(e,t){void 0===e&&(e=!1);var i=this.rgbToHex(this.rgb),n=(this.rgb=this.hsvToRgb.apply(this,this.hsv),this.rgbToHex(this.rgb)),o=this.convertToRgbString(this.rgb);this.updatePreview(o),this.updateInput(n),this.triggerEvent(n,i,o,e,t)},uV.prototype.updateInput=function(e){var t=this.getWrapper();t.classList.contains(Y2)||(t.classList.contains(U2)||HF.setValue(e.substr(0,7),ge(".e-hex",this.container)),t.classList.contains(G2))||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1))},uV.prototype.updatePreview=function(e){this.enableOpacity&&this.updateOpacitySliderBg(),ge(".e-tip-transparent",this.tooltipEle).style.backgroundColor=e,ge("."+rV+" ."+_2,this.container).style.backgroundColor=e,ge("."+rV+" ."+sV,this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},uV.prototype.getDragHandler=function(){return ge("."+Q2,this.container)},uV.prototype.removeTileSelection=function(){[].slice.call(ct("."+lV,this.container)).forEach(function(e){e.classList.remove(lV),e.setAttribute("aria-selected","false")})},uV.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)})},uV.prototype.getValue=function(e,t){var i,n;return e=e||this.value,t=t?t.toLowerCase():"hex","r"===e[0]?(i=this.convertRgbToNumberArray(e),"hex"===t||"hexa"===t?(n=this.rgbToHex(i),"hex"===t?n.slice(0,7):n):"hsv"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"):"h"===e[0]?(i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(e)),"rgba"===t?this.convertToRgbString(i):"hex"===t||"hexa"===t?(n=this.rgbToHex(i),"hex"===t?n.slice(0,7):n):"rgb"===t?this.convertToRgbString(i.slice(0,3)):"null"):(e=this.roundValue(e),n=this.hexToRgb(e),"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")},uV.prototype.toggle=function(){this.container.parentElement.classList.contains("e-popup-close")?this.splitBtn.toggle():this.closePopup(null)},uV.prototype.getModuleName=function(){return"colorpicker"},uV.prototype.getPersistData=function(){return this.addOnPersist(["value"])},uV.prototype.wireEvents=function(){var e;this.isPicker()?(e=this.getDragHandler(),E.add(e,"keydown",this.pickerKeyDown,this),(e=ge("."+H2,this.container))&&E.add(e,"keydown",this.ctrlBtnKeyDown,this),E.add(this.getHsvContainer(),"mousedown touchstart",this.handlerDown,this),(this.modeSwitcher||this.showButtons)&&this.addCtrlSwitchEvent(),E.add(ge("."+sV,this.container),"click",this.previewHandler,this)):(E.add(this.container,"click",this.paletteClickHandler,this),E.add(this.container,"keydown",this.paletteKeyDown,this))},uV.prototype.formResetHandler=function(){this.value=this.initialInputValue,pt(this.element,{value:this.initialInputValue})},uV.prototype.addCtrlSwitchEvent=function(){var e=ge("."+z2,this.container);e&&E.add(e,"click",this.btnClickHandler,this)},uV.prototype.ctrlBtnKeyDown=function(e){13===e.keyCode&&(ge("."+N2,this.container)&&(e=this.rgbToHex(this.rgb),this.triggerChangeEvent(e)),this.splitBtn.element.focus())},uV.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)}},uV.prototype.enterKeyHandler=function(e){this.triggerChangeEvent(e),this.inline||this.splitBtn.element.focus()},uV.prototype.closePopup=function(e){var t=this,e={element:this.container,event:e,cancel:!1};this.trigger("beforeClose",e,function(e){e.cancel||(t.splitBtn.toggle(),t.onPopupClose())})},uV.prototype.triggerChangeEvent=function(e,t){var i=e.slice(0,7);this.trigger("change",{currentValue:{hex:i,rgba:this.convertToRgbString(this.rgb)},event:t,previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:this.enableOpacity?e:i}),this.showRecentColors&&(this.recentColors.unshift(i),this.inline)&&this.renderRecentColor(),this.enableOpacity?this.setProperties({value:e},!0):this.setProperties({value:i},!0),this.element.value=i||"#000000"},uV.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,i)},uV.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(!1,e),this.getDragHandler().focus(),E.add(document,"mousemove touchmove",this.handlerMove,this),E.add(document,"mouseup touchend",this.handlerEnd,this)},uV.prototype.handlerMove=function(e){"touchmove"!==e.type&&e.preventDefault(),i="mousemove"===e.type?(t=Math.abs(e.pageX-pageXOffset),Math.abs(e.pageY-pageYOffset)):(t=Math.abs(e.changedTouches[0].pageX-pageXOffset),Math.abs(e.changedTouches[0].pageY-pageYOffset)),this.setHsv(t,i);var t,i,n=this.getDragHandler();this.updateHsv(),this.convertToOtherFormat(!1,e),this.getTooltipInst().refresh(n),this.tooltipEle.style.transform||(8<Math.abs(this.clientX-t)||8<Math.abs(this.clientY-i))&&(ge("."+K2,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"))},uV.prototype.setHsv=function(e,t){var i=ge("."+K2,this.container),n=i.getBoundingClientRect();e=this.enableRtl?e>n.right?0:Math.abs(e-n.right):e>n.left?Math.abs(e-n.left):0,t=t>n.top?Math.abs(t-n.top):0,this.hsv[2]=Math.round(10*Number(100*(i.offsetHeight-Math.max(0,Math.min(i.offsetHeight,t-i.offsetTop)))/i.offsetHeight))/10,this.hsv[1]=Math.round(10*Number(100*Math.max(0,Math.min(i.offsetWidth,e-i.offsetLeft))/i.offsetWidth))/10},uV.prototype.handlerEnd=function(e){"touchend"!==e.type&&e.preventDefault(),E.remove(document,"mousemove touchmove",this.handlerMove),E.remove(document,"mouseup touchend",this.handlerEnd);var t=this.getDragHandler();ge("."+K2,this.container).style.cursor="",this.tooltipEle.style.transform&&(this.tooltipEle.style.transform="",t.classList.remove("e-hide-handler")),this.inline||this.showButtons||this.closePopup(e)},uV.prototype.btnClickHandler=function(e){var t=e.target;z(t,"."+$2)?(e.stopPropagation(),this.switchToPalette()):(t.classList.contains(N2)||t.classList.contains(V2))&&this.ctrlBtnClick(t,e)},uV.prototype.switchToPalette=function(){this.trigger("beforeModeSwitch",{element:this.container,mode:"Palette"}),this.unWireEvents(),this.destroyOtherComp(),G(ge(".e-slider-preview",this.container)),this.getWrapper().classList.contains(Y2)||ue(ge("."+Z2,this.container)),G(this.getHsvContainer()),this.createPalette(),this.firstPaletteFocus(),this.createInput(),this.refreshPopupPos(),this.element.parentElement&&this.element.parentElement.parentElement&&this.element.parentElement.parentElement.classList.contains("e-ie-ddb-popup")&&this.refreshImageEditorPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Palette"})},uV.prototype.refreshImageEditorPopupPos=function(){var e,t;F.isDevice&&((e=this.getPopupEle()).style.left=T(0+pageXOffset),e.style.top=T(0+pageYOffset),t=document.querySelector("#"+this.element.parentElement.parentElement.id.split("-popup")[0]))&&e.parentElement.ej2_instances[0].refreshPosition(t)},uV.prototype.refreshPopupPos=function(){var e;this.inline||((e=this.getPopupEle()).style.left=T(0+pageXOffset),e.style.top=T(0+pageYOffset),this.getPopupInst().refreshPosition(this.splitBtn.element.parentElement))},uV.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)},uV.prototype.updateValue=function(e,t,i,n){for(var o,r=["e-rh-value","e-gs-value","e-bv-value"],s=0,a=r.length;s<a;s++)(o=K(ge("."+r[s],this.container),NL)).value=Math.round(e[s]),t&&(o.placeholder=r[s].substr(i,1).toUpperCase(),o.max=n?n[s]:255),o.dataBind()},uV.prototype.previewHandler=function(e){var t=e.target,i=this.rgbToHex(this.rgb),t=(this.rgb=this.convertRgbToNumberArray(t.style.backgroundColor),this.rgb[3]||(this.rgb[3]=1),this.rgbToHex(this.rgb)),n=this.rgbToHsv.apply(this,this.rgb);n[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:n[0]},!0),this.hueSlider.refresh()),this.setHsvContainerBg(n[0]),this.enableOpacity&&n[3]!==this.hsv[3]&&(this.opacitySlider.setProperties({value:100*n[3]},!0),this.opacitySlider.refresh(),this.updateOpacitySliderBg()),this.hsv=n,this.setHandlerPosition(),this.updateInput(t),ge("."+rV+" ."+_2,this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(t,i,this.convertToRgbString(this.rgb),!1,e)},uV.prototype.paletteClickHandler=function(e){e.preventDefault();var t,i,n=e.target;n.classList.contains(dV)?(this.removeTileSelection(),this.addTileSelection(n),n.classList.contains(eV)?this.noColorTile():(t=n.getAttribute("aria-label"),i=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(this.roundValue(t)),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(aV)&&this.updateInput(t),this.triggerEvent(t,i,this.convertToRgbString(this.rgb),!1,e)),this.inline||this.showButtons||this.closePopup(e)):z(n,"."+$2)?this.switchToPicker():n.classList.contains(N2)||n.classList.contains(V2)?this.ctrlBtnClick(n,e):this.getWrapper().classList.contains(aV)&&z(n,"."+W2)&&this.formatSwitchHandler()},uV.prototype.noColorTile=function(e){void 0===e&&(e=!1);var t=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",t,"",e)},uV.prototype.switchToPicker=function(){var e=this.getWrapper(),e=(this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(ct("."+iV,this.container)).forEach(function(e){G(e)}),this.container.querySelector(".e-clr-pal-rec-wpr")&&G(this.container.querySelector(".e-clr-pal-rec-wpr")),e.classList.contains(aV)&&G(ge("."+Z2,this.container)),this.container.style.width="",ge(".e-custom-palette",this.container));this.presetColors&&ue(e),this.createPicker(),this.getDragHandler().focus(),this.createInput(),this.refreshPopupPos(),this.element.parentElement&&this.element.parentElement.parentElement&&this.element.parentElement.parentElement.classList.contains("e-ie-ddb-popup")&&this.refreshImageEditorPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Picker"})},uV.prototype.ctrlBtnClick=function(e,t){var i;e.classList.contains(N2)&&(i=this.rgbToHex(this.rgb),this.triggerChangeEvent(i,t)),this.inline?e.classList.contains(V2)&&(i={element:this.container,event:t,cancel:!1},this.trigger("beforeClose",i)):(this.closePopup(t),this.splitBtn.element.focus())},uV.prototype.paletteKeyDown=function(e){var t=e.target;if(t.classList.contains(iV)){var i,n,o=[].slice.call(ct("."+dV,t)),r=o.filter(function(e){return e.classList.contains("e-selected")}).pop();switch(!e.altKey&&e.keyCode){case 39:e.preventDefault(),i=r?o[this.tilePosition(o,r,this.enableRtl?-1:1)]:o[this.enableRtl?o.length-1:0],this.keySelectionChanges(i);break;case 37:e.preventDefault(),i=r?o[this.tilePosition(o,r,this.enableRtl?1:-1)]:o[this.enableRtl?0:o.length-1],this.keySelectionChanges(i);break;case 38:e.preventDefault(),i=o[n=r?this.tilePosition(o,r,-this.columns):0]||o[n-this.columns],this.keySelectionChanges(i);break;case 40:e.preventDefault(),i=o[n=r?this.tilePosition(o,r,this.columns):o.length-1]||o[n=(n%=o.length)+o[o.length-1].parentElement.childElementCount],this.keySelectionChanges(i);break;case 13:e.preventDefault(),r&&(n=r.getAttribute("aria-label"),this.enterKeyHandler(n||""))}}},uV.prototype.keySelectionChanges=function(e){var t;this.removeTileSelection(),this.addTileSelection(e),e.classList.contains(eV)?this.noColorTile(!0):(e=e.getAttribute("aria-label"),t=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(e),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(aV)&&this.updateInput(e),this.triggerEvent(e,t,this.convertToRgbString(this.rgb),!0))},uV.prototype.tilePosition=function(e,t,i){var n=(e=Array.prototype.slice.call(e)).length,o=this.columns-e[n-1].parentElement.childElementCount,e=e.indexOf(t);return(e+=i)<0?e+=n+o:e%=n+o,e},uV.prototype.inputHandler=function(e){var t,i,n=e.target;if(n.value.length)switch(ge(".e-float-text",n.parentElement).textContent){case"HEX":var o="";if(9!==(o="#"===n.value[0]&&5!==n.value.length||"#"!==n.value[0]&&4!==n.value.length?this.roundValue(n.value):o).length)return;i=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(o+o.substr(-2)),this.inputValueChange(this.rgbToHsv.apply(this,this.rgb),i,n.value,e);break;case"R":this.rgb[0]!==Number(n.value)&&(i=this.rgbToHex(this.rgb),this.rgb[0]=Number(n.value),t=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(t,i,null,e));break;case"G":this.rgb[1]!==Number(n.value)&&(i=this.rgbToHex(this.rgb),this.rgb[1]=Number(n.value),t=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(t,i,null,e));break;case"B":this.rgb[2]!==Number(n.value)&&(i=this.rgbToHex(this.rgb),this.rgb[2]=Number(n.value),t=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(t,i,null,e));break;case"H":this.hueSlider.value=Number(n.value);break;case"S":this.hsv[1]!==Number(n.value)&&(this.hsv[1]=Number(n.value),this.updateHsv(),this.convertToOtherFormat(!1,e));break;case"V":this.hsv[2]!==Number(n.value)&&(this.hsv[2]=Number(n.value),this.updateHsv(),this.convertToOtherFormat(!1,e));break;case"A":this.opacitySlider.value=Number(n.value)}},uV.prototype.inputValueChange=function(e,t,i,n){e[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:e[0]},!0),this.hueSlider.refresh(),this.setHsvContainerBg(e[0])),this.hsv=e;e=this.rgbToHex(this.rgb),this.setHandlerPosition(),this.updateInput(i||e),i=this.convertToRgbString(this.rgb);this.updatePreview(i),this.triggerEvent(e,t,i,!1,n)},uV.prototype.triggerEvent=function(e,t,i,n,o){void 0===n&&(n=!1);var r=e.slice(0,7);je(o)&&(o=new MouseEvent("click",{bubbles:!0,cancelable:!1})),this.showButtons||n?this.trigger("select",{currentValue:{hex:r,rgba:i},event:o,previousValue:{hex:t.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(t))}}):(this.trigger("change",{currentValue:{hex:r,rgba:i},event:o,previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:e}),this.showRecentColors&&(this.recentColors.unshift(r),this.inline)&&this.renderRecentColor(),this.enableOpacity?this.setProperties({value:e},!0):this.setProperties({value:r},!0),this.element.value=r||"#000000")},uV.prototype.destroy=function(){var t=this,e=this.getWrapper();O2.prototype.destroy.call(this),["tabindex","spellcheck"].forEach(function(e){t.element.removeAttribute(e)}),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&&G(this.element.nextElementSibling),e&&(e.parentElement.insertBefore(this.element,e),G(e)),this.container=null,this.formElement&&E.remove(this.formElement,"reset",this.formResetHandler)},uV.prototype.destroyOtherComp=function(){if(this.isPicker()){for(var e=z(this.hueSlider.element,".e-color-picker").querySelectorAll(".e-numerictextbox"),t=0;t<e.length;t++)K(e[t],NL).destroy();this.hueSlider.destroy(),this.enableOpacity&&(this.opacitySlider.destroy(),this.opacitySlider=null),this.hueSlider=null;var i=this.getTooltipInst();i.close(),i.destroy(),this.tooltipEle=null}},uV.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},uV.prototype.unWireEvents=function(){var e;this.isPicker()?(e=this.getDragHandler(),E.remove(e,"keydown",this.pickerKeyDown),(e=ge("."+H2,this.container))&&E.remove(e,"keydown",this.ctrlBtnKeyDown),E.remove(this.getHsvContainer(),"mousedown touchstart",this.handlerDown),(this.modeSwitcher||this.showButtons)&&E.remove(ge("."+z2,this.container),"click",this.btnClickHandler),E.remove(ge("."+sV,this.container),"click",this.previewHandler)):(E.remove(this.container,"click",this.paletteClickHandler),E.remove(this.container,"keydown",this.paletteKeyDown))},uV.prototype.roundValue=function(e){if(!e)return"";var t=(e="#"!==e[0]?"#"+e:e).length;if(4===t&&(e+="f",t=5),5===t){for(var i="",n=1,o=e.length;n<o;n++)i+=e.charAt(n)+e.charAt(n);e="#"+i,t=9}return 7===t&&(e+="ff"),e},uV.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=e.slice(1,7),parseInt(e,16)),i=[];return i.push(e>>16&255),i.push(e>>8&255),i.push(255&e),i.push(t),i},uV.prototype.rgbToHsv=function(e,t,i,n){if(this.rgb&&!this.rgb.length)return[];e/=255,t/=255,i/=255;var o,r=Math.max(e,t,i),s=Math.min(e,t,i),a=r,l=r-s,h=0===r?0:l/r;if(r===s)o=0;else{switch(r){case e:o=(t-i)/l+(t<i?6:0);break;case t:o=(i-e)/l+2;break;case i:o=(e-t)/l+4}o/=6}s=[Math.round(360*o),Math.round(1e3*h)/10,Math.round(1e3*a)/10];return je(n)||s.push(n),s},uV.prototype.hsvToRgb=function(e,t,i,n){var o,r,s;if(i/=100,0===(t/=100))return o=r=s=i,[Math.round(255*o),Math.round(255*r),Math.round(255*s),n];e/=60;var a=Math.floor(e),e=e-a,l=i*(1-t),h=i*(1-t*e),d=i*(1-t*(1-e));switch(a){case 0:o=i,r=d,s=l;break;case 1:o=h,r=i,s=l;break;case 2:o=l,r=i,s=d;break;case 3:o=l,r=h,s=i;break;case 4:o=d,r=l,s=i;break;default:o=i,r=l,s=h}t=[Math.round(255*o),Math.round(255*r),Math.round(255*s)];return je(n)||t.push(n),t},uV.prototype.rgbToHex=function(e){return e.length?"#"+this.hex(e[0])+this.hex(e[1])+this.hex(e[2])+(je(e[3])?"":0!==e[3]?(Math.round(255*e[3])+65536).toString(16).substr(-2):"00"):""},uV.prototype.hex=function(e){return("0"+e.toString(16)).slice(-2)},uV.prototype.changeModeSwitcherProp=function(e){var t=ge("."+z2,this.container);e?t?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):t&&(this.showButtons?G(ge("."+$2,t)):ue(t))},uV.prototype.changeShowBtnProps=function(e){var t=ge("."+z2,this.container);e?(t&&ue(t),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?G(ge("."+H2,t)):ue(t)},uV.prototype.changeValueProp=function(e){this.isPicker()?(this.rgb=this.hexToRgb(e),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHandlerPosition(),G(z(this.hueSlider.element,".e-slider-preview")),this.createSlider(),this.setHsvContainerBg(),this.updateInput(e),4===this.rgb.length&&this.updateOpacityInput(100*this.rgb[3])):(this.removeTileSelection(),(e=this.container.querySelector('span[aria-label="'+this.roundValue(e)+'"]'))&&this.addTileSelection(e))},uV.prototype.setInputEleProps=function(){ue(ge("."+Z2,this.container)),this.createInput()},uV.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())},uV.prototype.changeCssClassProps=function(e,t){var i=this.getWrapper(),n=this.getPopupEle();t&&q([i,n],t.split(" ")),e&&U([i,n],e.replace(/\s+/g," ").trim().split(" "))},uV.prototype.changeRtlProps=function(e){(e?U:q)([this.getWrapper()],"e-rtl")},uV.prototype.changePaletteProps=function(){G(this.container.children[0]),this.container.style.width="",this.createPalette()},uV.prototype.changeOpacityProps=function(e){var t=this.getWrapper();e?(q([this.container.parentElement],q2),this.createOpacitySlider(ge(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),t.classList.contains(Y2)||t.classList.contains(G2)||this.appendOpacityValue(ge(".e-input-container",this.container))):(U([this.container.parentElement],q2),this.opacitySlider.destroy(),ue(this.opacitySlider.element),this.opacitySlider=null,t.classList.contains(Y2)||t.classList.contains(G2)||ue(ge("."+tV,this.container).parentElement))},uV.prototype.onPropertyChanged=function(n,o){var e,t,r=this;if(je(n.value)||(9===(e=this.roundValue(n.value)).length?(this.element.value=this.roundValue(e).slice(0,7),(t=this.splitBtn&&ge("."+hV,this.splitBtn.element))&&(t.style.backgroundColor=this.convertToRgbString(this.hexToRgb(n.value)))):this.noColor&&"Palette"===this.mode&&""===this.value?(t=this.splitBtn&&ge("."+hV,this.splitBtn.element)).style.backgroundColor="":this.value=o.value),!this.inline&&je(n.inline))if(this.splitBtn.setProperties(KN(n,["disabled","enableRtl"])),!this.isPopupOpen())return this.changeCssClassProps(n.cssClass,o.cssClass),void this.changeRtlProps(n.enableRtl);for(var s=this,i=0,a=Object.keys(n);i<a.length;i++)!function(e){switch(e){case"inline":n.inline?(s.getWrapper().appendChild(s.container),s.splitBtn.destroy(),G(s.element.nextElementSibling),s.container.children.length||s.createWidget()):(s.destroyOtherComp(),s.unWireEvents(),s.container.innerHTML="",s.createSplitBtn());break;case"cssClass":s.changeCssClassProps(n.cssClass,o.cssClass);var t=(t=n.cssClass.split(" ").concat(o.cssClass.split(" "))).reduce(function(e,t){return e.indexOf(t)<0&&e.push(t),e},[]),i=0;t.forEach(function(e){0!==i||e!==Y2&&e!==X2&&e!==aV&&e!==U2&&e!==G2||(ge("."+Z2,r.container)&&ue(ge("."+Z2,r.container)),r.createInput(),i++)});break;case"enableRtl":s.isPicker()&&(s.hueSlider.enableRtl=n.enableRtl,s.enableOpacity&&(s.opacitySlider.enableRtl=n.enableRtl),s.setInputEleProps()),s.changeRtlProps(n.enableRtl);break;case"disabled":s.changeDisabledProp(n.disabled);break;case"value":s.value!==o.value&&s.changeValueProp(n.value);break;case"showButtons":s.changeShowBtnProps(n.showButtons);break;case"mode":"Picker"===n.mode?s.switchToPicker():s.switchToPalette();break;case"modeSwitcher":s.changeModeSwitcherProp(n.modeSwitcher);break;case"columns":case"presetColors":s.isPicker()||s.changePaletteProps();break;case"noColor":n.noColor?"Palette"!==s.mode||s.modeSwitcher||s.setNoColor():s.changePaletteProps();break;case"enableOpacity":s.changeOpacityProps(n.enableOpacity);break;case"showRecentColors":n.showRecentColors||(t=s.container.querySelector(".e-clr-pal-rec-wpr"))&&G(t),s.recentColors=[]}}(a[i])},uV.prototype.focusIn=function(){this.element.parentElement.focus()},h0([e("#008000ff")],uV.prototype,"value",void 0),h0([e("")],uV.prototype,"cssClass",void 0),h0([e(!1)],uV.prototype,"disabled",void 0),h0([e("Picker")],uV.prototype,"mode",void 0),h0([e(!0)],uV.prototype,"modeSwitcher",void 0),h0([e(null)],uV.prototype,"presetColors",void 0),h0([e(!0)],uV.prototype,"showButtons",void 0),h0([e(10)],uV.prototype,"columns",void 0),h0([e(!1)],uV.prototype,"inline",void 0),h0([e(!1)],uV.prototype,"noColor",void 0),h0([e(!1)],uV.prototype,"enablePersistence",void 0),h0([e(!0)],uV.prototype,"enableOpacity",void 0),h0([e(!1)],uV.prototype,"createPopupOnClick",void 0),h0([e(!1)],uV.prototype,"showRecentColors",void 0),h0([i()],uV.prototype,"select",void 0),h0([i()],uV.prototype,"change",void 0),h0([i()],uV.prototype,"beforeTileRender",void 0),h0([i()],uV.prototype,"beforeOpen",void 0),h0([i()],uV.prototype,"open",void 0),h0([i()],uV.prototype,"beforeClose",void 0),h0([i()],uV.prototype,"beforeModeSwitch",void 0),h0([i()],uV.prototype,"onModeSwitch",void 0),h0([i()],uV.prototype,"created",void 0),h0([Bt],uV));function uV(e,t){e=O2.call(this,e,t)||this;return e.recentColors=[],e}gV=function(e,t){return(gV=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])}))(e,t)};var gV,mV,h0=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},fV=(function(e,t){function i(){this.constructor=e}gV(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(yV,mV=Ji),yV.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"floatLabelType":HF.removeFloating(this.textboxWrapper),HF.addFloating(this.respectiveElement,this.floatLabelType,this.placeholder);break;case"enabled":HF.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container),this.bindClearEvent();break;case"width":HF.setWidth(e.width,this.textboxWrapper.container);break;case"value":var o=this.isProtectedOnChange;this.isProtectedOnChange=!0,HF.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=o,HF.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):(je(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&je(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttributesToElement(),this.updateHTMLAttributesToWrapper(),this.checkAttributes(!0),this.multiline&&!je(this.textarea)?HF.validateInputType(this.textboxWrapper.container,this.textarea):HF.validateInputType(this.textboxWrapper.container,this.element);break;case"readonly":HF.setReadonly(this.readonly,this.respectiveElement);break;case"type":"TEXTAREA"!==this.respectiveElement.tagName&&(this.respectiveElement.setAttribute("type",this.type),HF.validateInputType(this.textboxWrapper.container,this.element),this.raiseChangeEvent());break;case"showClearButton":HF.setClearButton(this.showClearButton,this.respectiveElement,this.textboxWrapper),this.bindClearEvent();break;case"enableRtl":HF.setEnableRtl(this.enableRtl,[this.textboxWrapper.container]);break;case"placeholder":HF.setPlaceholder(this.placeholder,this.respectiveElement),HF.calculateWidth(this.respectiveElement,this.textboxWrapper.container);break;case"autocomplete":"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:this.removeAttributes(["autocomplete"]);break;case"cssClass":HF.updateCssClass(e.cssClass,t.cssClass,this.textboxWrapper.container);break;case"locale":this.globalize=new Ti(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),HF.setPlaceholder(this.placeholder,this.respectiveElement)}},yV.prototype.getModuleName=function(){return"textbox"},yV.prototype.preRender=function(){if(this.cloneElement=this.element.cloneNode(!0),this.formElement=z(this.element,"form"),je(this.formElement)||(this.isForm=!0),"EJS-TEXTBOX"===this.element.tagName){for(var e=R("ej2_instances",this.element),t=this.multiline?this.createElement("textarea"):this.createElement("input"),i=0;i<this.element.attributes.length;i++)"id"!==(o=this.element.attributes[i].nodeName)&&"class"!==o?(t.setAttribute(o,this.element.attributes[i].nodeValue),t.innerHTML=this.element.innerHTML,"name"===o&&this.element.removeAttribute("name")):"class"===o&&t.setAttribute(o,this.element.className.split(" ").filter(function(e){return 0!==e.indexOf("ng-")}).join(" "));this.element.appendChild(t),this.element=t,x("ej2_instances",e,this.element)}this.updateHTMLAttributesToElement(),this.checkAttributes(!1),!je(this.textboxOptions)&&void 0!==this.textboxOptions.value||""===this.element.value||this.setProperties({value:this.element.value},!0),"TEXTAREA"!==this.element.tagName&&this.element.setAttribute("type",this.type),("text"===this.type||"INPUT"===this.element.tagName&&this.multiline&&this.isReact)&&this.element.setAttribute("role","textbox"),this.globalize=new Ti(this.locale);e={placeholder:this.placeholder};if(this.l10n=new Cn("textbox",e,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",D("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",D("textarea"));for(var n=["placeholder","disabled","value","readonly","type","autocomplete"],i=0;i<this.element.attributes.length;i++){var o=this.element.attributes[i].nodeName;this.element.hasAttribute(o)&&QF.indexOf(o)<0&&"id"!==o&&"type"!==o&&"e-mappinguid"!==o&&(this.textarea.setAttribute(o,this.element.attributes[i].nodeValue),n.indexOf(o)<0)&&(this.element.removeAttribute(o),i--)}}},yV.prototype.checkAttributes=function(e){for(var t=0,i=e?je(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly","type","autocomplete"];t<i.length;t++){var n,o,r=i[t];if(!je(this.element.getAttribute(r)))switch(r){case"disabled":(je(this.textboxOptions)||void 0===this.textboxOptions.enabled||e)&&(n="disabled"!==this.element.getAttribute(r)&&""!==this.element.getAttribute(r)&&"true"!==this.element.getAttribute(r),this.setProperties({enabled:n},!e));break;case"readonly":(je(this.textboxOptions)||void 0===this.textboxOptions.readonly||e)&&(n="readonly"===this.element.getAttribute(r)||""===this.element.getAttribute(r)||"true"===this.element.getAttribute(r),this.setProperties({readonly:n},!e));break;case"placeholder":(je(this.textboxOptions)||void 0===this.textboxOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"autocomplete":(je(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||e)&&(o="off"===this.element.autocomplete?"off":"on",this.setProperties({autocomplete:o},!e));break;case"value":(je(this.textboxOptions)||void 0===this.textboxOptions.value||e)&&""!==this.element.value&&this.setProperties({value:this.element.value},!e);break;case"type":(je(this.textboxOptions)||void 0===this.textboxOptions.type||e)&&this.setProperties({type:this.element.type},!e)}}},yV.prototype.render=function(){var e=this.cssClass;je(this.cssClass)||""===this.cssClass||(e=HF.getInputValidClassList(this.cssClass)),this.respectiveElement=this.isHiddenInput?this.textarea:this.element,this.textboxWrapper=HF.createInput({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:e,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttributesToWrapper(),this.isHiddenInput&&this.respectiveElement.parentNode.insertBefore(this.element,this.respectiveElement),this.wireEvents(),je(this.value)||(HF.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value)),je(this.value)||(this.initialValue=this.value,this.setInitialValue()),"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:je(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||this.removeAttributes(["autocomplete"]),this.previousValue=this.value,this.inputPreviousValue=this.value,this.respectiveElement.defaultValue=this.respectiveElement.value,HF.setWidth(this.width,this.textboxWrapper.container),!je(z(this.element,"fieldset"))&&z(this.element,"fieldset").disabled&&(this.enabled=!1),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","textbox"),this.renderComplete()},yV.prototype.updateHTMLAttributesToWrapper=function(){HF.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textboxWrapper.container)},yV.prototype.updateHTMLAttributesToElement=function(){HF.updateHTMLAttributesToElement(this.htmlAttributes,this.respectiveElement||(this.multiline&&!je(this.textarea)?this.textarea:this.element))},yV.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},yV.prototype.wireEvents=function(){E.add(this.respectiveElement,"focus",this.focusHandler,this),E.add(this.respectiveElement,"blur",this.focusOutHandler,this),E.add(this.respectiveElement,"keydown",this.keydownHandler,this),E.add(this.respectiveElement,"input",this.inputHandler,this),E.add(this.respectiveElement,"change",this.changeHandler,this),this.isForm&&E.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),!je(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-autofill")&&this.textboxWrapper.container.classList.contains("e-outline")&&E.add(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler,this)},yV.prototype.animationHandler=function(){this.textboxWrapper.container.classList.add("e-valid-input");var e=this.textboxWrapper.container.querySelector(".e-float-text");je(e)||(e.classList.add("e-label-top"),e.classList.contains("e-label-bottom")&&e.classList.remove("e-label-bottom"))},yV.prototype.resetValue=function(e){var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,null!=(this.value=e)||!this.textboxWrapper.container.classList.contains("e-valid-input")||"Always"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.remove("e-valid-input"),this.isProtectedOnChange=t},yV.prototype.resetForm=function(){var e;this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),je(this.textboxWrapper)||je(e=this.textboxWrapper.container.querySelector(".e-float-text"))||"Always"===this.floatLabelType||(je(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")))},yV.prototype.focusHandler=function(e){e={container:this.textboxWrapper.container,event:e,value:this.value};this.trigger("focus",e)},yV.prototype.focusOutHandler=function(e){null===this.previousValue&&null===this.value&&""===this.respectiveElement.value||this.previousValue===this.value||this.raiseChangeEvent(e,!0);e={container:this.textboxWrapper.container,event:e,value:this.value};this.trigger("blur",e)},yV.prototype.keydownHandler=function(e){13!==e.keyCode&&9!==e.keyCode||!(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.respectiveElement.value)||this.setProperties({value:this.respectiveElement.value},!0)},yV.prototype.inputHandler=function(e){var t={event:e,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.inputPreviousValue=this.respectiveElement.value,this.isAngular&&(this.localChange({value:this.respectiveElement.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",t),e.stopPropagation()},yV.prototype.changeHandler=function(e){this.setProperties({value:this.respectiveElement.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(e,!0),e.stopPropagation()},yV.prototype.raiseChangeEvent=function(e,t){e={event:e,value:this.value,previousValue:this.previousValue,container:this.textboxWrapper.container,isInteraction:t||!1,isInteracted:t||!1};this.preventChange=!1,this.trigger("change",e),this.previousValue=this.value,"INPUT"===this.element.tagName&&this.multiline&&"mozilla"===F.info.name&&(this.element.value=this.respectiveElement.value)},yV.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?E.add(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):E.remove(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},yV.prototype.resetInputHandler=function(e){var t;e.preventDefault(),this.textboxWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.textboxWrapper.container.classList.contains("e-static-clear")||(HF.setValue("",this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.setProperties({value:this.respectiveElement.value},!0),t={event:e,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container},this.trigger("input",t),this.inputPreviousValue=this.respectiveElement.value,this.raiseChangeEvent(e,!0),z(this.element,"form")&&(t=this.element,(e=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),t.dispatchEvent(e)))},yV.prototype.unWireEvents=function(){E.remove(this.respectiveElement,"focus",this.focusHandler),E.remove(this.respectiveElement,"blur",this.focusOutHandler),E.remove(this.respectiveElement,"keydown",this.keydownHandler),E.remove(this.respectiveElement,"input",this.inputHandler),E.remove(this.respectiveElement,"change",this.changeHandler),this.isForm&&E.remove(this.formElement,"reset",this.resetForm),!je(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")&&this.textboxWrapper.container.classList.contains("e-autofill")&&E.remove(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler)},yV.prototype.destroy=function(){this.unWireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),"INPUT"===this.element.tagName&&this.multiline&&(G(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-disabled","aria-readonly","aria-labelledby"]),je(this.textboxWrapper)||(this.textboxWrapper.container.insertAdjacentElement("afterend",this.respectiveElement),G(this.textboxWrapper.container)),this.textboxWrapper=null,HF.destroy({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),mV.prototype.destroy.call(this)},yV.prototype.addIcon=function(e,t){HF.addIcon(e,t,this.textboxWrapper.container,this.respectiveElement,this.createElement)},yV.prototype.getPersistData=function(){return this.addOnPersist(["value"])},yV.prototype.addAttributes=function(e){for(var t=0,i=Object.keys(e);t<i.length;t++){var n=i[t];"disabled"===n?(this.setProperties({enabled:!1},!0),HF.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===n?(this.setProperties({readonly:!0},!0),HF.setReadonly(this.readonly,this.respectiveElement)):"class"===n?this.respectiveElement.classList.add(e[""+n]):"placeholder"===n?(this.setProperties({placeholder:e[""+n]},!0),HF.setPlaceholder(this.placeholder,this.respectiveElement)):("rows"===n&&this.respectiveElement.tagName,this.respectiveElement.setAttribute(n,e[""+n]))}},yV.prototype.removeAttributes=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];"disabled"===n?(this.setProperties({enabled:!0},!0),HF.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===n?(this.setProperties({readonly:!1},!0),HF.setReadonly(this.readonly,this.respectiveElement)):"placeholder"===n?(this.setProperties({placeholder:null},!0),HF.setPlaceholder(this.placeholder,this.respectiveElement)):this.respectiveElement.removeAttribute(n)}},yV.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"))&&U([this.textboxWrapper.container],[UF])},yV.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"))&&q([this.textboxWrapper.container],[UF])},h0([e("text")],yV.prototype,"type",void 0),h0([e(!1)],yV.prototype,"readonly",void 0),h0([e(null)],yV.prototype,"value",void 0),h0([e("Never")],yV.prototype,"floatLabelType",void 0),h0([e("")],yV.prototype,"cssClass",void 0),h0([e(null)],yV.prototype,"placeholder",void 0),h0([e("on")],yV.prototype,"autocomplete",void 0),h0([e({})],yV.prototype,"htmlAttributes",void 0),h0([e(!1)],yV.prototype,"multiline",void 0),h0([e(!0)],yV.prototype,"enabled",void 0),h0([e(!1)],yV.prototype,"showClearButton",void 0),h0([e(!1)],yV.prototype,"enablePersistence",void 0),h0([e(null)],yV.prototype,"width",void 0),h0([i()],yV.prototype,"created",void 0),h0([i()],yV.prototype,"destroyed",void 0),h0([i()],yV.prototype,"change",void 0),h0([i()],yV.prototype,"blur",void 0),h0([i()],yV.prototype,"focus",void 0),h0([i()],yV.prototype,"input",void 0),h0([Bt],yV));function yV(e,t){t=mV.call(this,e,t)||this;return t.previousValue=null,t.isHiddenInput=!1,t.isForm=!1,t.inputPreviousValue=null,t.textboxOptions=e,t}vV=function(e,t){return(vV=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])}))(e,t)};var vV,bV,h0=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},wV="e-auto-width",CV="e-resize-x",SV="e-resize-y",AV="e-resize-xy",xV="e-resize-none",IV=(function(e,t){function i(){this.constructor=e}vV(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(TV,bV=Ji),TV.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"floatLabelType":HF.removeFloating(this.textareaWrapper),HF.addFloating(this.element,this.floatLabelType,this.placeholder),"Never"===this.floatLabelType&&this.element.removeAttribute("aria-labelledby");break;case"enabled":HF.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container),this.bindClearEvent(),this.enabled||"None"===this.resizeMode?this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)):(this.element.classList.remove(this.getCurrentResizeClass(this.resizeMode)),this.element.classList.add(xV));break;case"width":"None"!==this.resizeMode&&"Vertical"!==this.resizeMode?(this.setElementWidth(e.width),this.textareaWrapper.container.classList.add(wV)):(this.textareaWrapper.container.classList.contains(wV)&&this.textareaWrapper.container.classList.remove(wV),HF.setWidth(e.width,this.textareaWrapper.container));break;case"value":var o=this.isProtectedOnChange;this.isProtectedOnChange=!0,HF.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=o,HF.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),this.inputPreviousValue=this.element.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(je(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&je(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttributesToElement(),this.updateHTMLAttributesToWrapper(),this.checkAttributes(!0),HF.validateInputType(this.textareaWrapper.container,this.element);break;case"readonly":HF.setReadonly(this.readonly,this.element),this.readonly?this.element.setAttribute("aria-readonly","true"):this.element.removeAttribute("aria-readonly");break;case"showClearButton":HF.setClearButton(this.showClearButton,this.element,this.textareaWrapper),this.bindClearEvent();break;case"enableRtl":HF.setEnableRtl(this.enableRtl,[this.textareaWrapper.container]);break;case"placeholder":HF.setPlaceholder(this.placeholder,this.element),HF.calculateWidth(this.element,this.textareaWrapper.container);break;case"cssClass":HF.updateCssClass(e.cssClass,t.cssClass,this.textareaWrapper.container);break;case"locale":this.globalize=new Ti(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),HF.setPlaceholder(this.placeholder,this.element);break;case"rows":this.rows&&this.element.setAttribute("rows",this.rows.toString());break;case"cols":this.cols&&(this.element.setAttribute("cols",this.cols.toString()),null==this.width)&&this.textareaWrapper.container.classList.add(wV);break;case"maxLength":this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString());break;case"resizeMode":this.enabled&&(this.element.classList.contains(this.getCurrentResizeClass(t.resizeMode))&&this.element.classList.remove(this.getCurrentResizeClass(t.resizeMode)),this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)),!this.element.style.width||"None"!==this.resizeMode&&"Vertical"!==this.resizeMode?(o=this.element.offsetWidth,this.element.style.width=o+"px",this.textareaWrapper.container.style.width&&(this.textareaWrapper.container.style.width="")):HF.setWidth(this.element.style.width,this.textareaWrapper.container),this.setWrapperWidth())}},TV.prototype.preRender=function(){if(this.formElement=z(this.element,"form"),je(this.formElement)||(this.isForm=!0),"EJS-TEXTAREA"===this.element.tagName||"EJS-SMARTTEXTAREA"===this.element.tagName){for(var e=R("ej2_instances",this.element),t=this.createElement("textarea"),i=0;i<this.element.attributes.length;i++){var n=this.element.attributes[i].nodeName;"id"!==n&&"class"!==n?(t.setAttribute(n,this.element.attributes[i].nodeValue),t.innerHTML=this.element.innerHTML,"name"===n&&this.element.removeAttribute("name")):"class"===n&&t.setAttribute(n,this.element.className.split(" ").filter(function(e){return 0!==e.indexOf("ng-")}).join(" "))}this.element.appendChild(t),this.element=t,x("ej2_instances",e,this.element)}this.updateHTMLAttributesToElement(),this.checkAttributes(!1),!je(this.textareaOptions)&&void 0!==this.textareaOptions.value||""===this.element.value||this.setProperties({value:this.element.value},!0),this.globalize=new Ti(this.locale);e={placeholder:this.placeholder};this.l10n=new Cn("textarea",e,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",D("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),this.rows&&this.element.setAttribute("rows",this.rows.toString()),this.cols&&this.element.setAttribute("cols",this.cols.toString()),this.maxLength&&this.element.setAttribute("maxlength",this.maxLength.toString()),!this.element.style.resize&&this.enabled&&this.element.classList.add(this.getCurrentResizeClass(this.resizeMode)),this.enabled&&this.element.setAttribute("aria-multiline","true")},TV.prototype.render=function(){var e=this.cssClass;je(this.cssClass)||""===this.cssClass||(e=HF.getInputValidClassList(this.cssClass)),this.textareaWrapper=HF.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:e,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttributesToWrapper(),this.wireEvents(),je(this.value)||HF.setValue(this.value,this.element,this.floatLabelType,this.showClearButton),je(this.value)||(this.initialValue=this.value,this.isAngular)||this.element.setAttribute("value",this.initialValue),this.previousValue=this.value,this.inputPreviousValue=this.value,this.element.defaultValue=this.element.value,HF.setWidth(this.width,this.textareaWrapper.container),this.setWrapperWidth(),this.renderComplete()},TV.prototype.getModuleName=function(){return"textarea"},TV.prototype.getPersistData=function(){return this.addOnPersist(["value"])},TV.prototype.checkAttributes=function(e){for(var t=0,i=e?je(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];t<i.length;t++){var n,o=i[t];if(!je(this.element.getAttribute(o)))switch(o){case"disabled":(je(this.textareaOptions)||void 0===this.textareaOptions.enabled||e)&&(n="disabled"!==this.element.getAttribute(o)&&""!==this.element.getAttribute(o)&&"true"!==this.element.getAttribute(o),this.setProperties({enabled:n},!e));break;case"readonly":(je(this.textareaOptions)||void 0===this.textareaOptions.readonly||e)&&(n="readonly"===this.element.getAttribute(o)||""===this.element.getAttribute(o)||"true"===this.element.getAttribute(o),this.setProperties({readonly:n},!e));break;case"placeholder":(je(this.textareaOptions)||void 0===this.textareaOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"value":(je(this.textareaOptions)||void 0===this.textareaOptions.value||e)&&""!==this.element.value&&this.setProperties({value:this.element.value},!e)}}},TV.prototype.wireEvents=function(){E.add(this.element,"focus",this.focusHandler,this),E.add(this.element,"blur",this.focusOutHandler,this),E.add(this.element,"keydown",this.keydownHandler,this),E.add(this.element,"input",this.inputHandler,this),E.add(this.element,"change",this.changeHandler,this),this.isForm&&E.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent()},TV.prototype.unWireEvents=function(){E.remove(this.element,"focus",this.focusHandler),E.remove(this.element,"blur",this.focusOutHandler),E.remove(this.element,"keydown",this.keydownHandler),E.remove(this.element,"input",this.inputHandler),E.remove(this.element,"change",this.changeHandler),this.isForm&&E.remove(this.formElement,"reset",this.resetForm)},TV.prototype.destroy=function(){this.unWireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.element.value=this.element.defaultValue,this.element.classList.remove("e-input",CV,SV,AV,xV),this.removeAttributes(["aria-disabled","aria-readonly","aria-labelledby","aria-multiline"]),je(this.textareaWrapper)||(this.textareaWrapper.container.insertAdjacentElement("afterend",this.element),G(this.textareaWrapper.container)),this.textareaWrapper=null,HF.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),this.formElement=null,bV.prototype.destroy.call(this)},TV.prototype.focusHandler=function(e){e={container:this.textareaWrapper.container,event:e,value:this.value};this.trigger("focus",e)},TV.prototype.focusOutHandler=function(e){null===this.previousValue&&null===this.value||this.previousValue===this.value||this.raiseChangeEvent(e,!0);e={container:this.textareaWrapper.container,event:e,value:this.value};this.trigger("blur",e)},TV.prototype.keydownHandler=function(e){13!==e.keyCode&&9!==e.keyCode||!(null!==this.previousValue&&""!==this.previousValue||null!==this.value&&""!==this.value||""!==this.element.value)||this.setProperties({value:this.element.value},!0)},TV.prototype.inputHandler=function(e){var t={event:e,value:this.element.value,previousValue:this.inputPreviousValue,container:this.textareaWrapper.container};this.inputPreviousValue=this.element.value,this.isAngular&&(this.localChange({value:this.element.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",t),e.stopPropagation()},TV.prototype.changeHandler=function(e){this.setProperties({value:this.element.value},!0),this.previousValue!==this.value&&this.raiseChangeEvent(e,!0),e.stopPropagation()},TV.prototype.raiseChangeEvent=function(e,t){e={event:e,value:this.value,previousValue:this.previousValue,container:this.textareaWrapper.container,isInteraction:t||!1,isInteracted:t||!1};this.preventChange=!1,this.trigger("change",e),this.previousValue=this.value},TV.prototype.updateHTMLAttributesToWrapper=function(){HF.updateHTMLAttributesToWrapper(this.htmlAttributes,this.textareaWrapper.container)},TV.prototype.updateHTMLAttributesToElement=function(){HF.updateHTMLAttributesToElement(this.htmlAttributes,this.element)},TV.prototype.bindClearEvent=function(){this.showClearButton&&(this.enabled?E.add(this.textareaWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):E.remove(this.textareaWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},TV.prototype.resetInputHandler=function(e){e.preventDefault(),this.textareaWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.textareaWrapper.container.classList.contains("e-static-clear")||(HF.setValue("",this.element,this.floatLabelType,this.showClearButton),this.setProperties({value:this.element.value},!0));var t={event:e,value:this.element.value,previousValue:this.inputPreviousValue,container:this.textareaWrapper.container};this.trigger("input",t),this.inputPreviousValue=this.element.value,this.raiseChangeEvent(e,!0),z(this.element,"form")&&(t=this.element,(e=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),t.dispatchEvent(e))},TV.prototype.addAttributes=function(e){for(var t=0,i=Object.keys(e);t<i.length;t++){var n=i[t];"disabled"===n?(this.setProperties({enabled:!1},!0),HF.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container)):"readonly"===n?(this.setProperties({readonly:!0},!0),HF.setReadonly(this.readonly,this.element)):"class"===n?this.element.classList.add(e[""+n]):"placeholder"===n?(this.setProperties({placeholder:e[""+n]},!0),HF.setPlaceholder(this.placeholder,this.element)):this.element.setAttribute(n,e[""+n])}},TV.prototype.removeAttributes=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];"disabled"===n?(this.setProperties({enabled:!0},!0),HF.setEnabled(this.enabled,this.element,this.floatLabelType,this.textareaWrapper.container)):"readonly"===n?(this.setProperties({readonly:!1},!0),HF.setReadonly(this.readonly,this.element)):"placeholder"===n?(this.setProperties({placeholder:null},!0),HF.setPlaceholder(this.placeholder,this.element)):this.element.removeAttribute(n)}},TV.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),this.textareaWrapper.container.classList.contains("e-input-group")||this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.contains("e-filled"))&&U([this.textareaWrapper.container],[UF])},TV.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),this.textareaWrapper.container.classList.contains("e-input-group")||this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.contains("e-filled"))&&q([this.textareaWrapper.container],[UF])},TV.prototype.setWrapperWidth=function(){this.enabled&&("None"!==this.resizeMode&&"Vertical"!==this.resizeMode||this.cols||this.element.getAttribute("cols"))?("None"!==this.resizeMode&&"Vertical"!==this.resizeMode&&this.textareaWrapper.container.style.width&&(this.setElementWidth(this.textareaWrapper.container.style.width),this.textareaWrapper.container.style.width="",this.textareaWrapper.container.classList.add(wV)),this.textareaWrapper.container.classList.add(wV)):this.textareaWrapper.container.classList.contains(wV)&&this.textareaWrapper.container.classList.remove(wV)},TV.prototype.resetForm=function(){var e;this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),je(this.textareaWrapper)||je(e=this.textareaWrapper.container.querySelector(".e-float-text"))||"Always"===this.floatLabelType||(je(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")))},TV.prototype.resetValue=function(e){var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,null!=(this.value=e)||!this.textareaWrapper.container.classList.contains("e-valid-input")||"Always"===this.floatLabelType&&this.textareaWrapper.container.classList.contains("e-outline")||this.textareaWrapper.container.classList.remove("e-valid-input"),this.isProtectedOnChange=t},TV.prototype.setElementWidth=function(e){"number"==typeof e?this.element.style.width=T(e):"string"==typeof e&&(this.element.style.width=e.match(/px|%|em/)?e:T(e))},h0([e(!(TV.prototype.getCurrentResizeClass=function(e){return"None"===e?xV:"Both"===e?AV:"Horizontal"===e?CV:SV}))],TV.prototype,"readonly",void 0),h0([e(null)],TV.prototype,"value",void 0),h0([e("Never")],TV.prototype,"floatLabelType",void 0),h0([e("")],TV.prototype,"cssClass",void 0),h0([e(null)],TV.prototype,"placeholder",void 0),h0([e({})],TV.prototype,"htmlAttributes",void 0),h0([e(!0)],TV.prototype,"enabled",void 0),h0([e(!1)],TV.prototype,"showClearButton",void 0),h0([e(!1)],TV.prototype,"enablePersistence",void 0),h0([e(null)],TV.prototype,"width",void 0),h0([e("Both")],TV.prototype,"resizeMode",void 0),h0([e(null)],TV.prototype,"maxLength",void 0),h0([e(null)],TV.prototype,"cols",void 0),h0([e(null)],TV.prototype,"rows",void 0),h0([i()],TV.prototype,"created",void 0),h0([i()],TV.prototype,"destroyed",void 0),h0([i()],TV.prototype,"change",void 0),h0([i()],TV.prototype,"blur",void 0),h0([i()],TV.prototype,"focus",void 0),h0([i()],TV.prototype,"input",void 0),h0([Bt],TV));function TV(e,t){t=bV.call(this,e,t)||this;return t.previousValue=null,t.isForm=!1,t.inputPreviousValue=null,t.textareaOptions=e,t}DV.createStyledDiv=function(t,e){var i=document.createElement("div"),n={position:"absolute",left:-9999,top:0,zIndex:-2e3},o=(this.properties.forEach(function(e){n[""+e]=getComputedStyle(t)[e]}),Object.keys(n).forEach(function(e){i.style[""+e]=n[""+e]}),t.offsetWidth-t.clientWidth);return i.style.width=t.clientWidth+o+"px",i.innerHTML=e,t&&t.parentNode&&t.parentNode.insertBefore(i,t.nextSibling),i},DV.createCaretMarker=function(e,t){e=this.createStyledDiv(e,t),t=e.ownerDocument.getElementById("caret-position-marker"),t={left:t.offsetLeft,top:t.offsetTop,height:t.offsetHeight};return e&&e.parentNode&&e.parentNode.removeChild(e),t},DV.escapeHtml=function(e){return e.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>")},DV.getCaretPosition=function(e){var t=e.selectionStart||0,i=e.value.slice(0,t),n=e.value.slice(t),i='<span style="position: relative; display: inline;">'+this.escapeHtml(i)+"</span>",n=(i=(i+='<span id="caret-position-marker" style="position: relative; display: inline;">|</span>')+('<span style="position: relative; display: inline;">'+this.escapeHtml(n)+"</span>"),this.createCaretMarker(e,i));return n.pos=t,n},DV.adjustScrollToCaretPosition=function(e){var t=this.getCaretPosition(e),i=parseFloat(window.getComputedStyle(e).lineHeight);t.top>e.clientHeight+e.scrollTop-i&&(e.scrollTop=t.top-e.clientHeight+i)},DV.getTextAreaPosition=function(e){var t=window.getComputedStyle(e),i=this.getCaretPosition(e);return{top:i.top+parseFloat(t.borderTopWidth)+e.offsetTop-e.scrollTop,left:i.left+parseFloat(t.borderLeftWidth)+e.offsetLeft-e.scrollLeft-.25,height:i.height,elemStyle:t}},DV.insertCharacter=function(e,t){var i=e.selectionStart,n=e.selectionEnd;e.value=e.value.substring(0,i)+t+e.value.substring(n),i+=t.length,e.setSelectionRange(i,i)},DV.properties=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap","width"];var EV=DV;function DV(){}MV=function(e,t){return(MV=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])}))(e,t)};var MV,kV,PV,h0=function(e,t){function i(){this.constructor=e}MV(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},BV=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},FV=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},LV=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},RV=((RV=kV=kV||{}).System="system",RV.User="user",RV.Assistant="assistant",h0(OV,PV=IV),OV.prototype.render=function(){var e,t;PV.prototype.render.call(this),this.element instanceof HTMLTextAreaElement&&(this.textArea=this.element,(e=Q("smart-textarea")).classList.add("e-smart-textarea"),this.textArea.after(e),"None"!==this.showSuggestionOnPopup&&(t="Enable"===this.showSuggestionOnPopup?"false":"true",this.textArea.setAttribute("data-inline-suggestions",t)),this.suggestionDisplay=new(this.shouldShowInlineSuggestions(this.textArea)?NV:_V)(e,this.textArea))},OV.prototype.wireEvents=function(){var e=this;PV.prototype.wireEvents.call(this),E.add(this.element,"keyup",this.handleKeyUp,this),E.add(this.element,"keydown",this.handleKeyDown,this),E.add(this.element,"mousedown",this.removeExistingOrPendingSuggestion,this),E.add(this.element,"focusout",this.removeExistingOrPendingSuggestion,this),this.element.addEventListener("scroll",function(){return e.suggestionDisplay.reject()},{passive:!0})},OV.prototype.unWireEvents=function(){var e=this;PV.prototype.unWireEvents.call(this),E.remove(this.element,"keyup",this.handleKeyUp),E.remove(this.element,"keydown",this.handleKeyDown),E.remove(this.element,"mousedown",this.removeExistingOrPendingSuggestion),E.remove(this.element,"focusout",this.removeExistingOrPendingSuggestion),this.element.removeEventListener("scroll",function(){return e.suggestionDisplay.reject()})},OV.prototype.keydownHandler=function(){},OV.prototype.shouldShowInlineSuggestions=function(e){e=e.getAttribute("data-inline-suggestions");return e?"true"===e.toLowerCase():!("ontouchstart"in window)},OV.prototype.handleKeyDown=function(e){switch(e.key){case"Tab":this.suggestionDisplay.isShowing()&&(this.suggestionDisplay.accept(),e.preventDefault());break;case"Alt":case"Control":case"Shift":case"Command":break;default:this.suggestionDisplay.isShowing()&&this.suggestionDisplay.currentSuggestion.startsWith(e.key)?(EV.insertCharacter(this.textArea,e.key),e.preventDefault(),this.suggestionDisplay.show(this.suggestionDisplay.currentSuggestion.substring(e.key.length)),EV.adjustScrollToCaretPosition(this.textArea)):this.removeExistingOrPendingSuggestion()}},OV.prototype.handleKeyUp=function(){var e=this;this.suggestionDisplay.isShowing()||(clearTimeout(this.typingDebounceTimeout),this.typingDebounceTimeout=setTimeout(function(){return e.handleTypingPaused()},350))},OV.prototype.handleTypingPaused=function(){return FV(this,void 0,void 0,function(){return LV(this,function(e){switch(e.label){case 0:return document.activeElement!==this.textArea?[2]:this.textArea.selectionStart!==this.textArea.selectionEnd||this.textArea.selectionStart!==this.textArea.value.length&&"\n"!==this.textArea.value[this.textArea.selectionStart]?[3,2]:[4,this.requestSuggestionAsync()];case 1:e.sent(),e.label=2;case 2:return[2]}})})},OV.prototype.removeExistingOrPendingSuggestion=function(){clearTimeout(this.typingDebounceTimeout),this.pendingSuggestionAbort&&(this.pendingSuggestionAbort.abort(),this.pendingSuggestionAbort=null),this.suggestionDisplay.reject()},OV.prototype.createSuggestionPrompt=function(e,t){var i="Predict what text the user in the given ROLE would insert at the cursor position indicated by ^^^.\nOnly give predictions for which you have an EXTREMELY high confidence that the user would insert that EXACT text.\nDo not make up new information. If you are not sure, just reply with NO_PREDICTION.\n\nRULES:\n1. Reply with OK:, then in square brackets the predicted text, then END_INSERTION, and no other output.\n2. When a specific value or quantity cannot be inferred and would need to be provided, use the word NEED_INFO.\n3. If there is not enough information to predict any words that the user would type next, just reply with the word NO_PREDICTION.\n4. NEVER invent new information. If you can not be sure what the user is about to type, ALWAYS stop the prediction with END_INSERTION.",n=this.UserPhrases;if(n&&0<n.length){i+="\nAlways try to use variations on the following phrases as part of the predictions:\n";for(var o=0,r=n;o<r.length;o++)i+="- "+r[o]+"\n"}return{messages:[{role:kV.System,content:i},{role:kV.User,content:"ROLE: Family member sending a text\nUSER_TEXT: Hey, it is a nice day - the weather is ^^^"},{role:kV.Assistant,content:"OK:[great!]END_INSERTION"},{role:kV.User,content:"ROLE: Customer service assistant\nUSER_TEXT: You can find more information on^^^\n\nAlternatively, phone us."},{role:kV.Assistant,content:"OK:[ our website at NEED_INFO]END_INSERTION"},{role:kV.User,content:"ROLE: Casual\nUSER_TEXT: Oh I see!\n\nWell sure thing, we can"},{role:kV.Assistant,content:"OK:[ help you out with that!]END_INSERTION"},{role:kV.User,content:"ROLE: Storyteller\nUSER_TEXT: Sir Digby Chicken Caesar, also know^^^"},{role:kV.Assistant,content:"OK:[n as NEED_INFO]END_INSERTION"},{role:kV.User,content:"ROLE: Customer support agent\nUSER_TEXT: Goodbye for now.^^^"},{role:kV.Assistant,content:"NO_PREDICTION END_INSERTION"},{role:kV.User,content:"ROLE: Pirate\nUSER_TEXT: Have you found^^^"},{role:kV.Assistant,content:"OK:[ the treasure, me hearties?]END_INSERTION"},{role:kV.User,content:"ROLE: "+this.userRole+"\nUSER_TEXT: "+e+"^^^"+t}],temperature:0,maxTokens:400,stopSequences:["END_INSERTION","NEED_INFO"],frequencyPenalty:0,presencePenalty:0}},OV.prototype.requestSuggestionAsync=function(){return FV(this,void 0,void 0,function(){var t,i,n,o;return LV(this,function(e){switch(e.label){case 0:return this.pendingSuggestionAbort?(this.pendingSuggestionAbort.abort(),[2]):(this.pendingSuggestionAbort=new AbortController,t={textAreaValue:this.textArea.value,cursorPosition:this.textArea.selectionStart},i={textBefore:t.textAreaValue.substring(0,t.cursorPosition),textAfter:t.textAreaValue.substring(t.cursorPosition)},o=this.createSuggestionPrompt(i.textBefore,i.textAfter),"function"!=typeof this.aiSuggestionHandler?[3,2]:[4,this.aiSuggestionHandler(o)]);case 1:o=e.sent(),n=this.validateSuggestion(o,i.textBefore),e.label=2;case 2:return n&&t.textAreaValue===this.textArea.value&&t.cursorPosition===this.textArea.selectionStart&&(n.endsWith(" ")||(n+=" "),this.suggestionDisplay.show(n)),[2]}})})},OV.prototype.validateSuggestion=function(e,t){var i;return"string"!=typeof e||e.length<=5||0!==e.indexOf("OK:[")?"":(i=(e=0<(i=this.indexOfAny(e,[".","?","!"]))&&e.length>i+1&&" "===e[i+1]?e.substring(0,i+1):e).substring(4).replace(/[\]\s]+$/,""),0<t.length&&" "===t[t.length-1]?i.replace(/^\s+/,""):i)},OV.prototype.indexOfAny=function(e,t){for(var i=0;i<e.length;i++)if(-1!==t.indexOf(e[""+i]))return i;return-1},OV.prototype.getModuleName=function(){return"smarttextarea"},OV.prototype.destroy=function(){PV.prototype.destroy.call(this),this.textArea=null,this.suggestionDisplay=null,this.typingDebounceTimeout=null},BV([e("")],OV.prototype,"userRole",void 0),BV([e([])],OV.prototype,"UserPhrases",void 0),BV([e()],OV.prototype,"aiSuggestionHandler",void 0),BV([e("None")],OV.prototype,"showSuggestionOnPopup",void 0),OV);function OV(e,t){return PV.call(this,e,t)||this}Object.defineProperty(VV.prototype,"value",{get:function(){var e=this.originalValueProperty.get.call(this.textArea);return this.isShowing()?e.substring(0,this.suggestionStartPos)+e.substring(this.suggestionEndPos):e},set:function(e){this.originalValueProperty.set.call(this.textArea,e)},enumerable:!0,configurable:!0}),VV.prototype.getOriginalValueProperty=function(e,t){for(;e;){var i=Object.getOwnPropertyDescriptor(e,t);if(i)return i;e=Object.getPrototypeOf(e)}throw new Error("Property "+t+" not found on object or its prototype chain")},Object.defineProperty(VV.prototype,"valueIncludingSuggestion",{get:function(){return this.originalValueProperty.get.call(this.textArea)},set:function(e){this.originalValueProperty.set.call(this.textArea,e)},enumerable:!0,configurable:!0}),VV.prototype.isShowing=function(){return null!==this.suggestionStartPos},VV.prototype.show=function(e){this.latestSuggestionText=e,this.suggestionStartPos=this.textArea.selectionStart,this.suggestionEndPos=this.suggestionStartPos+e.length,this.textArea.setAttribute("data-suggestion-visible",""),this.valueIncludingSuggestion=this.valueIncludingSuggestion.substring(0,this.suggestionStartPos)+e+this.valueIncludingSuggestion.substring(this.suggestionStartPos),this.textArea.setSelectionRange(this.suggestionStartPos,this.suggestionEndPos),this.virtualCaret||(this.virtualCaret=new zV(this.owner,this.textArea)),this.virtualCaret.show()},Object.defineProperty(VV.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),VV.prototype.accept=function(){this.textArea.setSelectionRange(this.suggestionEndPos,this.suggestionEndPos),this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret&&this.virtualCaret.hide(),this.textArea.removeAttribute("data-suggestion-visible"),EV.adjustScrollToCaretPosition(this.textArea)},VV.prototype.reject=function(){var e,t;this.isShowing()&&(e=this.textArea.selectionStart,t=this.textArea.selectionEnd,this.valueIncludingSuggestion=this.valueIncludingSuggestion.substring(0,this.suggestionStartPos)+this.valueIncludingSuggestion.substring(this.suggestionEndPos),this.suggestionStartPos===e&&this.suggestionEndPos===t&&this.textArea.setSelectionRange(e,e),this.suggestionStartPos=null,this.suggestionEndPos=null,this.textArea.removeAttribute("data-suggestion-visible"),this.virtualCaret)&&this.virtualCaret.hide()};var NV=VV;function VV(e,t){this.owner=e,this.textArea=t,this.latestSuggestionText="",this.suggestionStartPos=null,this.suggestionEndPos=null,this.virtualCaret=null,this.originalValueProperty=this.getOriginalValueProperty(t,"value")}Object.defineProperty(HV.prototype,"currentSuggestion",{get:function(){return this.latestSuggestionText},enumerable:!0,configurable:!0}),HV.prototype.show=function(e){this.latestSuggestionText=e,this.suggestionPrefixElement.textContent=" "!==e[0]?this.getPrefixText(this.textArea,20):"",this.suggestionTextElement.textContent=e;var e=EV.getTextAreaPosition(this.textArea),t=this.suggestionElement.style,e=(t.minWidth=null,this.suggestionElement.classList.add("smart-textarea-suggestion-overlay-visible"),t.zIndex=this.textArea.style.zIndex+1,t.top=e.top+"px",e.left-this.suggestionPrefixElement.offsetWidth),e=((!t.left||10<Math.abs(parseFloat(t.left)-e))&&(t.left=e+"px"),this.showing=!0,window.getComputedStyle(this.suggestionElement)),i=parseFloat(e.lineHeight),n=parseFloat(e.paddingTop),e=parseFloat(e.paddingBottom),n=Math.round((this.suggestionElement.offsetHeight-n-e)/i),i=(2<n&&(e=this.suggestionElement.offsetWidth,t.minWidth="calc(min(70vw, "+n*e/2+"px))"),this.suggestionElement.getBoundingClientRect());i.right>document.body.clientWidth-20&&(t.left="calc("+(parseFloat(t.left)-(i.right-document.body.clientWidth))+"px - 2rem)")},HV.prototype.accept=function(){this.showing&&(EV.insertCharacter(this.textArea,this.currentSuggestion),EV.adjustScrollToCaretPosition(this.textArea),this.hide())},HV.prototype.reject=function(){this.hide()},HV.prototype.hide=function(){this.showing&&(this.showing=!1,this.suggestionElement.classList.remove("smart-textarea-suggestion-overlay-visible"))},HV.prototype.isShowing=function(){return this.showing},HV.prototype.handleSuggestionClicked=function(e){e.preventDefault(),e.stopImmediatePropagation(),this.accept()},HV.prototype.getPrefixText=function(e,t){for(var i=e.value,n=e.selectionStart,o=n-1;n-t<o;o--)if(o<0||/\s/.test(i[""+o]))return i.substring(o+1,n);return""};var _V=HV;function HV(e,t){var i=this,t=(this.latestSuggestionText="",this.showing=!1,this.textArea=t,this.suggestionElement=document.createElement("div"),this.suggestionElement.classList.add("smart-textarea-suggestion-overlay"),this.suggestionElement.addEventListener("mousedown",function(e){return i.handleSuggestionClicked(e)}),this.suggestionElement.addEventListener("touchend",function(e){return i.handleSuggestionClicked(e)}),this.suggestionPrefixElement=document.createElement("span"),this.suggestionTextElement=document.createElement("span"),this.suggestionElement.appendChild(this.suggestionPrefixElement),this.suggestionElement.appendChild(this.suggestionTextElement),this.suggestionPrefixElement.style.opacity="0.3",window.getComputedStyle(this.textArea));this.suggestionElement.style.font=t.font,this.suggestionElement.style.marginTop=1.4*parseFloat(t.fontSize)+"px",e.appendChild(this.suggestionElement)}jV.prototype.show=function(){var e=EV.getTextAreaPosition(this.textArea),t=this.caretDiv.style;t.display="block",t.top=e.top+"px",t.left=e.left+"px",t.height=e.height+"px",t.zIndex=this.textArea.style.zIndex,t.backgroundColor=e.elemStyle.caretColor},jV.prototype.hide=function(){this.caretDiv.style.display="none"};var zV=jV;function jV(e,t){this.textArea=t,this.caretDiv=document.createElement("div"),this.caretDiv.classList.add("smart-textarea-caret"),e.appendChild(this.caretDiv)}WV=function(e,t){return(WV=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}WV(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(UV,QV=Ji),UV.prototype.initialize=function(e,t){this.clearArray=[],this.element=e,this.canvasContext=this.element.getContext("2d"),this.canvasContext.canvas.tabIndex=-1,t&&(this.dotnetRef=t,this.isBlazor=!0,this.signatureValue)&&this.loadPersistedSignature(),this.setHTMLProperties(),je(this.signatureValue)&&this.updateSnapCollection(!0),this.wireEvents(),this.isBlazor||this.trigger("created",null)},UV.prototype.wireEvents=function(){!je(this.pointColl)||this.isReadOnly||this.disabled?this.pointColl&&(E.add(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler,this),E.add(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler,this),E.add(document,"mouseup",this.mouseUpHandler,this)):(E.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this),E.add(this.canvasContext.canvas,"keydown",this.keyboardHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this)))},UV.prototype.unwireEvents=function(e){"mouseup"===e||"touchend"===e?(this.canvasContext&&(E.remove(this.canvasContext.canvas,"mousemove touchmove",this.mouseMoveHandler),E.remove(this.canvasContext.canvas,"mouseup touchend",this.mouseUpHandler)),E.remove(document,"mouseup",this.mouseUpHandler)):(this.canvasContext&&(E.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler),E.remove(this.canvasContext.canvas,"keydown",this.keyboardHandler)),window.removeEventListener("resize",this.resizeHandler))},UV.prototype.setHTMLProperties=function(){150===this.element.height&&300===this.element.width&&0!==this.element.offsetHeight&&0!==this.element.offsetWidth?(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth,this.isResponsive=!0):this.element.height===this.element.offsetHeight-1&&this.element.width===this.element.offsetWidth-1||0===this.element.offsetHeight||0===this.element.offsetWidth||(this.element.height=this.element.offsetHeight,this.element.width=this.element.offsetWidth),this.canvasContext.fillStyle=this.strokeColor,this.tempCanvas=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-temp"}),this.tempContext=this.tempCanvas.getContext("2d"),this.tempCanvas.width=this.element.width,this.tempCanvas.height=this.element.height,this.backgroundImage?(this.canvasContext.canvas.style.backgroundImage="url("+this.backgroundImage+")",this.canvasContext.canvas.style.backgroundRepeat="no-repeat",this.saveWithBackground&&this.setBackgroundImage(this.backgroundImage,"temp")):this.backgroundColor&&(this.canvasContext.canvas.style.backgroundColor=this.backgroundColor)},UV.prototype.mouseDownHandler=function(e){1!==e.buttons&&2!==e.buttons&&"touchstart"!==e.type||("touchstart"===e.type&&(e.preventDefault(),e.stopPropagation()),this.beginStroke(e),this.wireEvents())},UV.prototype.mouseMoveHandler=function(e){1!==e.buttons&&2!==e.buttons&&"touchmove"!==e.type||("touchmove"===e.type&&(e.preventDefault(),e.stopPropagation()),this.interval?this.updateStrokeWithThrottle(e):this.updateStroke(e))},UV.prototype.mouseUpHandler=function(e){"touchstart"===e.type&&(e.preventDefault(),e.stopPropagation()),this.endDraw(),this.updateSnapCollection(),this.unwireEvents(e.type),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","mouseUp"):this.trigger("change",{actionName:"strokeUpdate"}),this.signatureValue=this.snapColl[this.incStep];for(var t=0;t<this.signPointsColl.length;t++)this.signRatioPointsColl.push({x:this.signPointsColl[t].x/this.canvasContext.canvas.width,y:this.signPointsColl[t].y/this.canvasContext.canvas.height});this.signPointsColl=[]},UV.prototype.keyboardHandler=function(e){var t=this,i={fileName:"Signature",type:"Png",cancel:!1};switch(e.key){case"Delete":this.clear();break;case e.ctrlKey&&"s":this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","beforeSave"):this.trigger("beforeSave",i,function(e){i.cancel||t.save(e.type,e.fileName)}),e.preventDefault(),e.stopImmediatePropagation();break;case e.ctrlKey&&"z":this.undo();break;case e.ctrlKey&&"y":this.redo()}},UV.prototype.resizeHandler=function(){var e,t=this;if(this.isResponsive&&this.canRedraw&&this.canvasContext&&this.element){this.canvasContext.canvas.width=this.element.offsetWidth,this.canvasContext.canvas.height=this.element.offsetHeight,this.canvasContext.scale(1,1),this.canvasContext.fillStyle=this.strokeColor;for(var i=(this.minStrokeWidth+this.maxStrokeWidth)/2,n=0;n<this.signRatioPointsColl.length;n++)this.arcDraw(this.signRatioPointsColl[n].x*this.canvasContext.canvas.width,this.signRatioPointsColl[n].y*this.canvasContext.canvas.height,i);this.signPointsColl=[],this.canvasContext.closePath(),this.canvasContext.fill()}else this.canvasContext&&this.element&&((e=new Image).src=this.snapColl[this.incStep],e.onload=function(){t.canvasContext.clearRect(0,0,t.element.width,t.element.height),t.canvasContext.drawImage(e,0,0,t.element.width,t.element.height)})},UV.prototype.beginStroke=function(e){this.internalRefresh(),this.updateStroke(e)},UV.prototype.updateStroke=function(e){e=this.createPoint(e);this.addPoint(e)},UV.prototype.updateStrokeWithThrottle=function(e){var t=Date.now(),i=this.interval-(t-this.previous);this.storedArgs=e,i<=0||i>this.interval?(this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.previous=t,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)):this.timeout||(this.timeout=window.setTimeout(this.delay.bind(this),i))},UV.prototype.delay=function(){this.previous=Date.now(),this.timeout=null,this.updateStroke(this.storedArgs),this.timeout||(this.storedArgs=null)},UV.prototype.createPoint=function(e){var t=this.canvasContext.canvas.getBoundingClientRect();return"mousedown"===e.type||"mousemove"===e.type?this.point(e.clientX-t.left,e.clientY-t.top,(new Date).getTime()):this.point(e.touches[0].clientX-t.left,e.touches[0].clientY-t.top,(new Date).getTime())},UV.prototype.point=function(e,t,i){return this.pointX=e,this.pointY=t,this.time=i||(new Date).getTime(),{x:this.pointX,y:this.pointY,time:this.time}},UV.prototype.addPoint=function(e){var t=this.pointColl,i=0<t.length&&t[t.length-1],n=!!i&&this.distanceTo(i)<=this.minDistance;i&&n||(t.push(e),2<t.length&&(3===t.length&&t.unshift(t[0]),i=this.calculateCurveControlPoints(t[0],t[1],t[2]).controlPoint2,n=this.calculateCurveControlPoints(t[1],t[2],t[3]).controlPoint1,this.startPoint=t[1],this.controlPoint1=i,this.controlPoint2=n,this.endPoint=t[2],this.startDraw(),t.shift()))},UV.prototype.startDraw=function(){var e=this.pointVelocityCalc(this.startPoint),t=(e=this.velocity*e+(1-this.velocity)*this.lastVelocity,Math.max(this.maxStrokeWidth/(1+e),this.minStrokeWidth));this.curveDraw(this.lastWidth,t),this.lastVelocity=e,this.lastWidth=t},UV.prototype.endDraw=function(){var e,t;je(this.pointColl)||(e=2<this.pointColl.length,t=this.pointColl[0],!e&&t&&this.strokeDraw(t))},UV.prototype.curveDraw=function(e,t){var i,n,o,r,s,a,l,h,d=this.canvasContext,p=t-e,t=this.bezierLengthCalc(),c=2*Math.ceil(t);for(d.beginPath(),i=0;i<c;i++)l=(h=(a=(s=1-(n=i/c))*s)*s)*this.startPoint.x,l=(l=(l+=3*a*n*this.controlPoint1.x)+3*s*(o=n*n)*this.controlPoint2.x)+(r=o*n)*this.endPoint.x,h=h*this.startPoint.y,h=(h=(h+=3*a*n*this.controlPoint1.y)+3*s*o*this.controlPoint2.y)+r*this.endPoint.y,a=Math.min(e+r*p,this.maxStrokeWidth),this.arcDraw(l,h,a);d.closePath(),d.fill(),this.isSignatureEmpty=!1},UV.prototype.strokeDraw=function(e){var t=this.canvasContext,i=(this.minStrokeWidth+this.maxStrokeWidth)/2;t.beginPath(),this.arcDraw(e.x,e.y,i),t.closePath(),t.fill(),this.isSignatureEmpty=!1},UV.prototype.arcDraw=function(e,t,i){this.signPointsColl.push({x:e,y:t});var n=this.canvasContext;n.moveTo(e,t),n.arc(e,t,i,0,2*Math.PI,!1)},UV.prototype.calculateCurveControlPoints=function(e,t,i){var n=e.x-t.x,o=e.y-t.y,r=t.x-i.x,s=t.y-i.y,a=(e.x+t.x)/2,e=(e.y+t.y)/2,l=(t.x+i.x)/2,i=(t.y+i.y)/2,n=Math.sqrt(n*n+o*o),o=Math.sqrt(r*r+s*s),r=o/(n+o),s=l+(a-l)*r,n=i+(e-i)*r,o=t.x-s,r=t.y-n;return{controlPoint1:this.point(a+o,e+r,0),controlPoint2:this.point(l+o,i+r,0)}},UV.prototype.bezierLengthCalc=function(){for(var e,t,i,n,o,r,s=0,a=0;a<=10;a++)e=this.bezierPointCalc(t=a/10,this.startPoint.x,this.controlPoint1.x,this.controlPoint2.x,this.endPoint.x),t=this.bezierPointCalc(t,this.startPoint.y,this.controlPoint1.y,this.controlPoint2.y,this.endPoint.y),0<a&&(o=e-i,r=t-n,s+=Math.sqrt(o*o+r*r)),i=e,n=t;return s},UV.prototype.bezierPointCalc=function(e,t,i,n,o){return t*(1-e)*(1-e)*(1-e)+3*i*(1-e)*(1-e)*e+3*n*(1-e)*e*e+o*e*e*e},UV.prototype.pointVelocityCalc=function(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0},UV.prototype.distanceTo=function(e){return Math.sqrt(Math.pow(this.pointX-e.x,2)+Math.pow(this.pointY-e.y,2))},UV.prototype.isRead=function(e){e?E.remove(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler):this.disabled||E.add(this.canvasContext.canvas,"mousedown touchstart",this.mouseDownHandler,this)},UV.prototype.enableOrDisable=function(e){(this.disabled=e)?(this.canvasContext.canvas.style.filter="opacity(0.5)",this.isRead(!0)):(this.canvasContext.canvas.style.filter="",this.isRead(!1))},UV.prototype.updateSnapCollection=function(e){var t,i;je(this.incStep)?(this.incStep=-1,this.incStep++,this.snapColl=[],this.clearArray=[]):this.incStep++,this.incStep<this.snapColl.length&&(this.snapColl.length=this.incStep),0<this.incStep?(i=(t=this.createElement("canvas",{className:"e-"+this.getModuleName()+"-wrapper"})).getContext("2d"),this.canvasContext&&(t.width=this.canvasContext.canvas.width,t.height=this.canvasContext.canvas.height,i.drawImage(this.canvasContext.canvas,0,0,t.width,t.height),this.snapColl.push(t.toDataURL()))):this.snapColl.push(this.canvasContext.canvas.toDataURL()),e&&this.clearArray.push(this.incStep)},UV.prototype.setBackgroundImage=function(e,t){var i=this,n=new Image;n.crossOrigin="anonymous",n.src=e,"temp"===t?n.onload=function(){i.tempContext.globalCompositeOperation="source-over",i.tempContext.drawImage(n,0,0,i.element.width,i.element.height)}:(n.onload=function(){i.canvasContext.globalCompositeOperation="source-over",i.canvasContext.drawImage(n,0,0,i.element.width,i.element.height),i.updateSnapCollection(),i.saveBackground(!0)},this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height))},UV.prototype.setBackgroundColor=function(e){var t,i,n=this.canvasContext;for(n.strokeStyle=e,t=1;t<=n.canvas.width;t++)for(i=1;i<=n.canvas.height;i++)n.strokeRect(0,0,t,i);this.updateSnapCollection()},UV.prototype.loadPersistedSignature=function(){var e,t;je(this.signatureValue)||(e=this,(t=new Image).src=this.signatureValue,t.onload=function(){e.canvasContext.clearRect(0,0,e.element.width,e.element.height),e.canvasContext.drawImage(t,0,0),e.updateSnapCollection()},this.isSignatureEmpty=!1)},UV.prototype.getBlob=function(e){for(var e=e.split(","),t=e[0].match(/:(.*?);/)[1],i=atob(e[1]),n=i.length,o=new Uint8Array(n);n--;)o[n]=i.charCodeAt(n);return new Blob([o],{type:t})},UV.prototype.download=function(e,t){var e=URL.createObjectURL(e),i=document.createElement("a");i.href=e,i.target="_parent",i.download=t,(document.body||document.documentElement).appendChild(i),i.click(),i.parentNode.removeChild(i)},UV.prototype.internalRefresh=function(){this.pointColl=[],this.lastVelocity=0,this.lastWidth=(this.minStrokeWidth+this.maxStrokeWidth)/2},UV.prototype.refresh=function(){this.isResponsive=!1,this.setHTMLProperties(),this.resizeHandler(),this.internalRefresh()},UV.prototype.clear=function(){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.tempContext.clearRect(0,0,this.tempContext.canvas.width,this.tempContext.canvas.height),this.saveWithBackground&&this.backgroundImage&&this.setBackgroundImage(this.backgroundImage,"temp"),this.internalRefresh(),this.signRatioPointsColl=[],this.updateSnapCollection(!0),this.isSignatureEmpty=this.canRedraw=!0,this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Clear"):this.trigger("change",{actionName:"clear"})},UV.prototype.undo=function(){var e,t=this;0<this.incStep&&(this.incStep--,(e=new Image).src=this.snapColl[this.incStep],e.onload=function(){t.canvasContext.clearRect(0,0,t.element.width,t.element.height),t.canvasContext.drawImage(e,0,0,t.element.width,t.element.height)}),this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Undo"):this.trigger("change",{actionName:"undo"})},UV.prototype.redo=function(){var e,t=this;this.incStep<this.snapColl.length-1&&(this.incStep++,(e=new Image).src=this.snapColl[this.incStep],e.onload=function(){t.canvasContext.clearRect(0,0,t.element.width,t.element.height),t.canvasContext.drawImage(e,0,0,t.element.width,t.element.height)}),this.isClear(),this.isBlazor?this.dotnetRef.invokeMethodAsync("TriggerEventAsync","Redo"):this.trigger("change",{actionName:"redo"})},UV.prototype.isClear=function(){if(this.clearArray){for(var e=!1,t=0;t<this.clearArray.length;t++)this.clearArray[t]===this.incStep&&(e=this.isSignatureEmpty=!0);e||(this.isSignatureEmpty=!1)}},UV.prototype.isEmpty=function(){return this.isSignatureEmpty},UV.prototype.canUndo=function(){return 0<this.incStep},UV.prototype.canRedo=function(){return this.incStep<this.snapColl.length-1},UV.prototype.draw=function(e,t,i,n,o){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.canvasContext.font=(i=i||30)+"px "+(t=t||"Arial");var t=this.element.width/2,r=this.element.height/2;je(n)&&je(o)?(this.canvasContext.textAlign="center",this.canvasContext.textBaseline="middle"):(t=je(n)?t:n,r=je(o)?r+i/2:o+i/2),this.canvasContext.fillText(e,t,r),this.updateSnapCollection(),this.isSignatureEmpty=!1,this.trigger("change",{actionName:"draw-text"})},UV.prototype.load=function(i,n,o){o=o||this.element.height,n=n||this.element.width,this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var r=this,e=new Image;"data"!==(e.src=i).slice(0,4)&&(e.crossOrigin="anonymous"),e.onload=function(){Promise.all([createImageBitmap(e,0,0,n,o)]).then(function(e){var t=document.createElement("canvas");t.width=n,t.height=o,t.getContext("2d").drawImage(e[0],0,0),"data"!==i.slice(0,4)&&(r.canvasContext.globalCompositeOperation="source-over"),r.canvasContext.drawImage(t,0,0,n,o,0,0,r.element.width,r.element.height),r.updateSnapCollection()})},this.isSignatureEmpty=this.canRedraw=!1},UV.prototype.saveBackground=function(e){var t,i,n=e&&this.backgroundImage?this.snapColl[this.incStep-1]:this.snapColl[this.incStep];e||(this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height),this.backgroundImage?this.setBackgroundImage(this.backgroundImage):this.backgroundColor&&(this.setBackgroundColor(this.backgroundColor),e=!0)),e&&(t=this,(i=new Image).crossOrigin="anonymous",i.src=n,i.onload=function(){t.backgroundLoaded=!0,t.canvasContext.globalCompositeOperation="source-over",t.canvasContext.drawImage(i,0,0,t.element.width,t.element.height),t.save(t.fileType,t.fileName)})},UV.prototype.save=function(e,t){var i;this.saveWithBackground&&null==this.backgroundLoaded&&(this.backgroundImage||this.backgroundColor)?(this.backgroundLoaded=!1,this.fileType=e,this.fileName=t,this.saveBackground(!1)):"Svg"===e?this.toSVG(t=t||"Signature"):"Jpeg"===e?(t=t||"Signature",!this.saveWithBackground||this.saveWithBackground&&!this.backgroundImage&&!this.backgroundColor?this.toJPEG(t):(i=this.canvasContext.canvas.toDataURL("image/jpeg"),this.download(this.getBlob(i),t+".jpeg"))):(t=t||"Signature",i=this.canvasContext.canvas.toDataURL("image/png"),this.download(this.getBlob(i),t+".png")),this.saveWithBackground&&this.backgroundLoaded&&this.resetSnap()},UV.prototype.resetSnap=function(){this.canvasContext.clearRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height);var e=this,t=new Image;t.src=this.snapColl[this.incStep-1],t.onload=function(){e.canvasContext.drawImage(t,0,0,e.element.width,e.element.height),e.updateSnapCollection()},this.backgroundLoaded=null,this.snapColl.pop(),this.incStep--,this.snapColl.pop(),this.incStep--},UV.prototype.toJPEG=function(t){var i=this,e=this.snapColl[this.incStep],n=(this.setBackgroundColor("#ffffff"),this),o=new Image;o.crossOrigin="anonymous",o.src=e,o.onload=function(){n.canvasContext.globalCompositeOperation="source-over",n.canvasContext.drawImage(o,0,0,n.element.width,n.element.height);var e=n.canvasContext.canvas.toDataURL("image/jpeg");n.download(n.getBlob(e),t+".jpeg"),n.canvasContext.clearRect(0,0,n.canvasContext.canvas.width,n.canvasContext.canvas.height),i.resizeHandler()},this.snapColl.pop(),this.incStep--},UV.prototype.toSVG=function(e,t){var i=document.createElementNS("http://www.w3.org/2000/svg","svg"),n=(i.setAttribute("width",this.canvasContext.canvas.width.toString()),i.setAttribute("height",this.canvasContext.canvas.height.toString()),document.createElementNS("http://www.w3.org/2000/svg","image")),t=(n.setAttributeNS(null,"height",this.canvasContext.canvas.height.toString()),n.setAttributeNS(null,"width",this.canvasContext.canvas.width.toString()),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t),i.appendChild(n),'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+this.canvasContext.canvas.width+'" height="'+this.canvasContext.canvas.height+'">'),n=i.innerHTML,i="data:image/svg+xml;base64,"+btoa(t+n+"</svg>");return null==e?i:(this.download(this.getBlob(i),e+".svg"),null)},UV.prototype.saveAsBlob=function(){return this.getBlob(this.canvasContext.canvas.toDataURL("image/png"))},UV.prototype.getSignature=function(e){return this.saveWithBackground&&this.backgroundColor&&!this.backgroundImage?(this.tempContext.fillStyle=this.backgroundColor,this.tempContext.fillRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)):this.backgroundColor||this.backgroundImage||"Jpeg"!==e||(this.tempContext.fillStyle="#fff",this.tempContext.fillRect(0,0,this.canvasContext.canvas.width,this.canvasContext.canvas.height)),this.tempContext.drawImage(this.element,0,0),"Jpeg"===e?this.tempCanvas.toDataURL("image/jpeg"):"Svg"===e?this.toSVG(null,this.tempCanvas.toDataURL("image/png")):this.tempCanvas.toDataURL("image/png")},UV.prototype.getModuleName=function(){return"signature"},UV.prototype.getPersistData=function(){return this.signatureValue=this.snapColl[this.incStep],this.addOnPersist(["signatureValue"])},UV.prototype.destroy=function(){"image-editor"!==this.getModuleName()&&(this.unwireEvents(null),q([this.element],"e-"+this.getModuleName()),this.element.removeAttribute("tabindex"),this.pointColl=null,this.tempContext=null,this.tempCanvas=null,this.canvasContext=null),QV.prototype.destroy.call(this),this.element=null},UV.prototype.propertyChanged=function(e,t){var i=this.canvasContext;switch(e){case"backgroundColor":i.canvas.style.backgroundColor=t,this.backgroundColor=t;break;case"backgroundImage":i.canvas.style.backgroundImage="url("+t+")",this.backgroundImage=t,this.saveWithBackground&&this.setBackgroundImage(this.backgroundImage,"temp");break;case"strokeColor":i.fillStyle=t,this.strokeColor=t;break;case"saveWithBackground":this.saveWithBackground=t;break;case"maxStrokeWidth":this.maxStrokeWidth=t;break;case"minStrokeWidth":this.minStrokeWidth=t;break;case"velocity":this.velocity=t;break;case"isReadOnly":this.isRead(t);break;case"disabled":this.enableOrDisable(t)}};var WV,QV,h0=UV;function UV(){var e=null!==QV&&QV.apply(this,arguments)||this;return e.minDistance=5,e.previous=0,e.interval=30,e.timeout=null,e.isSignatureEmpty=!0,e.backgroundLoaded=null,e.isBlazor=!1,e.isResponsive=!1,e.signPointsColl=[],e.signRatioPointsColl=[],e.canRedraw=!0,e}qV=function(e,t){return(qV=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])}))(e,t)};var qV,GV,BV=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},BV=(function(e,t){function i(){this.constructor=e}qV(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(YV,GV=h0),YV.prototype.preRender=function(){},YV.prototype.render=function(){this.initialize()},YV.prototype.initialize=function(){this.element.setAttribute("role","img"),this.element.setAttribute("aria-label","signature"),U([this.element],"e-"+this.getModuleName()),GV.prototype.initialize.call(this,this.element),this.enablePersistence&&this.loadPersistedSignature()},YV.prototype.getModuleName=function(){return GV.prototype.getModuleName.call(this)},YV.prototype.getPersistData=function(){return GV.prototype.getPersistData.call(this)},YV.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];switch(o){case"backgroundColor":GV.prototype.propertyChanged.call(this,o,e.backgroundColor);break;case"backgroundImage":GV.prototype.propertyChanged.call(this,o,e.backgroundImage);break;case"strokeColor":e.strokeColor!==t.strokeColor&&GV.prototype.propertyChanged.call(this,o,e.strokeColor);break;case"maxStrokeWidth":e.maxStrokeWidth!==t.maxStrokeWidth&&GV.prototype.propertyChanged.call(this,o,e.maxStrokeWidth);break;case"minStrokeWidth":e.minStrokeWidth!==t.minStrokeWidth&&GV.prototype.propertyChanged.call(this,o,e.minStrokeWidth);break;case"velocity":e.velocity!==t.velocity&&GV.prototype.propertyChanged.call(this,o,e.velocity);break;case"saveWithBackground":GV.prototype.propertyChanged.call(this,o,e.saveWithBackground);break;case"isReadOnly":GV.prototype.propertyChanged.call(this,o,e.isReadOnly);break;case"disabled":GV.prototype.propertyChanged.call(this,o,e.disabled)}}},BV([e("")],YV.prototype,"backgroundColor",void 0),BV([e("")],YV.prototype,"backgroundImage",void 0),BV([e(!1)],YV.prototype,"disabled",void 0),BV([e(!1)],YV.prototype,"isReadOnly",void 0),BV([e(!0)],YV.prototype,"saveWithBackground",void 0),BV([e("#000000")],YV.prototype,"strokeColor",void 0),BV([e(.5)],YV.prototype,"minStrokeWidth",void 0),BV([e(2)],YV.prototype,"maxStrokeWidth",void 0),BV([e(.7)],YV.prototype,"velocity",void 0),BV([e("en-US")],YV.prototype,"locale",void 0),BV([e(!1)],YV.prototype,"enableRtl",void 0),BV([e(!1)],YV.prototype,"enablePersistence",void 0),BV([i()],YV.prototype,"beforeSave",void 0),BV([i()],YV.prototype,"change",void 0),BV([i()],YV.prototype,"created",void 0),BV([Bt],YV));function YV(e,t){return GV.call(this,e,t)||this}XV=function(e,t){return(XV=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])}))(e,t)};var XV,KV,JV,ZV,$V=function(e,t){function i(){this.constructor=e}XV(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e_=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},t_="e-rating-icon e-icons e-star-filled",i_="e-rating-item-list",n_="e-rating-item-container",o_="e-rating-selected",r_="e-rating-intermediate",s_="e-rating-hidden",a_="e-disabled",l_="e-rating-readonly",h_="e-rating-animation",d_="e-rating-full",p_="e-rating-empty",c_="e-selected-value",u_=((u_=KV=KV||{}).Top="Top",u_.Bottom="Bottom",u_.Left="Left",u_.Right="Right",(u_=JV=JV||{}).Full="Full",u_.Half="Half",u_.Quarter="Quarter",u_.Exact="Exact",$V(g_,ZV=Ji),g_.prototype.preRender=function(){this.element.id||(this.element.id=D("e-"+this.getModuleName())),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space"},this.tooltipOpen=!1,this.isTouchSelected=!1,z(this.element,"form")&&this.element.getAttribute("value")&&this.setProperties({value:this.element.getAttribute("value")},!0)},g_.prototype.render=function(){this.initialize(),this.updateMinValue(),this.updateTemplateFunction(),this.triggerChange(null,this.value,!1,!0),this.renderItems(),this.displayLabel()},g_.prototype.initialize=function(){this.wrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-container "}),this.element.parentNode.insertBefore(this.wrapper,this.element),this.wrapper.appendChild(this.element),null==this.element.getAttribute("name")&&this.element.setAttribute("name",this.element.id),pt(this.element,{"aria-label":"rating"}),this.renderItemList(),this.updateReset(),this.readOnly&&this.wrapper.classList.add(l_),this.visible||this.wrapper.classList.add(s_),this.enableRtl&&this.wrapper.classList.add("e-rtl"),this.enableAnimation&&this.wrapper.classList.add(h_),this.cssClass&&U([this.wrapper],this.cssClass.split(" ")),this.updateTooltip(),this.wireKeyboardEvent(),this.updateDisabled()},g_.prototype.updateDisabled=function(){this.wrapper.classList[this.disabled?"add":"remove"](a_),pt(this.ratingItemList,{tabindex:this.disabled?"-1":"0"}),this.updateResetButton()},g_.prototype.updateResetButton=function(){var e;this.allowReset&&(this.resetElement&&this.resetElement.blur(),e=this.value<=this.min||this.disabled,this.resetElement.classList[e?"add":"remove"](a_),pt(this.resetElement,{tabindex:e?"-1":"0","aria-hidden":e.toString()}))},g_.prototype.renderItemList=function(){var t=this;this.ratingItemList=this.createElement("div",{className:i_,id:this.element.id+"_item-list"}),pt(this.ratingItemList,{"aria-label":"rating",role:"slider"}),this.wrapper.appendChild(this.ratingItemList),E.add(this.ratingItemList,"touchmove",function(e){return t.touchMoveHandler(e)},this),E.add(this.ratingItemList,F.touchEndEvent,this.touchEndHandler,this)},g_.prototype.touchMoveHandler=function(e){this.isTouchSelected||(this.wrapper.classList.add("e-rating-touch"),this.isTouchSelected=!0),this.wrapper.classList.add("e-touch-select");var t,i=this.ratingItemList.getBoundingClientRect(),i=(e.touches[0].clientX-i.x)/i.width*this.itemsCount,n=(i=(i=this.enableRtl?this.itemsCount-i:i)<this.min?this.min:i>this.itemsCount?this.itemsCount:i,0===(i=this.validateValue(i))?null:this.itemElements[parseInt((Math.ceil(i)-1).toString(),10)]);i===this.currentValue?this.showTooltip&&n&&this.openRatingTooltip(n,!1):(t=this.currentValue,this.triggerChange(e,i),this.updateCurrentValue(i),this.showTooltip&&(n?(Math.ceil(i)!==Math.ceil(t)&&this.closeRatingTooltip(),this.openRatingTooltip(n,!0)):this.closeRatingTooltip()))},g_.prototype.touchEndHandler=function(){this.closeRatingTooltip(),this.wrapper.classList.remove("e-touch-select")},g_.prototype.updateTemplateFunction=function(){this.emptyTemplateFunction=this.emptyTemplate?this.getTemplateString(this.emptyTemplate):null,this.fullTemplateFunction=this.fullTemplate?this.getTemplateString(this.fullTemplate):null},g_.prototype.renderItems=function(){for(var t=this,e=0;e<this.itemsCount;e++){var i=this.createElement("span",{className:n_}),n=this.createElement("span",{className:"e-rating-item"}),o=this.getRatingValue(this.value,e),o=(this.renderItemContent(n,o,e,!1),i.appendChild(n),this.wireItemsEvents(i,e+1),this.itemElements.push(i),{element:i,value:e+1});this.trigger("beforeItemRender",o,function(e){t.ratingItemList.appendChild(e.element)})}pt(this.ratingItemList,{"aria-valuemax":this.itemsCount.toString()}),this.updateItemValue(!1)},g_.prototype.renderItemContent=function(e,t,i,n){n&&this.removeItemContent(e),this.fullTemplate&&1===t?(e.classList.add(d_),ht(this.fullTemplateFunction({index:i,ratingValue:t},this,"ratingFullTemplate",this.element.id+"fullTemplate",this.isStringTemplate),e)):this.emptyTemplate?(e.classList.add(p_),ht(this.emptyTemplateFunction({index:i,ratingValue:t},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate",this.isStringTemplate),e)):U([e],t_.split(" "))},g_.prototype.removeItemContent=function(e){e.classList.remove(d_,p_),q([e],t_.split(" ")),e.firstChild&&(e.innerHTML="")},g_.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new NS({target:".e-rating-item-container",windowCollision:!0,opensOn:"Custom",cssClass:this.cssClass?"e-rating-tooltip "+this.cssClass:"e-rating-tooltip"}),this.tooltipObj.appendTo(this.ratingItemList)):je(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},g_.prototype.updateMinValue=function(){this.setProperties({min:this.validateValue(this.min)},!0),0<this.min&&this.value<this.min&&this.triggerChange(null,this.min,!1),pt(this.ratingItemList,{"aria-valuemin":this.min.toString()})},g_.prototype.validateValue=function(e){return e=e>this.itemsCount?this.itemsCount:e<0?0:this.precision===JV.Full||this.enableSingleSelection?Math.round(e):this.precision===JV.Half?Math.round(2*e)/2:this.precision===JV.Quarter?Math.round(4*e)/4:Math.round(10*e)/10},g_.prototype.getRatingValue=function(e,t){return this.enableSingleSelection?t<e&&e<=t+1?1:0:t+1<=e?1:e<t?0:e-t},g_.prototype.updateItemValue=function(e){(e=void 0===e?!0:e)&&this.isReact&&this.clearTemplate(["ratingEmptyTemplate","ratingFullTemplate"]);for(var t=0;t<this.itemsCount;t++){var i=this.itemElements[parseInt(t.toString(),10)],n=(i.classList.remove(o_,r_,c_),this.getRatingValue(this.currentValue,t));1===n?i.classList.add(o_):0<n?i.classList.add(r_):this.precision===JV.Full&&t+1<=this.value&&!this.enableSingleSelection&&i.classList.add(c_),e&&this.updateItemContent(n,t),i.style.setProperty("--rating-value",100*n+"%"),i.classList[0===this.value&&0===t||this.value===t+1||0<n&&n<1?"add":"remove"]("e-rating-focus")}e&&this.renderReactTemplates(),this.updateResetButton(),pt(this.ratingItemList,{"aria-valuenow":this.currentValue.toString()}),pt(this.element,{value:this.value.toString()})},g_.prototype.updateItemContent=function(e,t){var i;(this.fullTemplate||this.emptyTemplate)&&(i=this.itemElements[parseInt(t.toString(),10)].querySelector(".e-rating-item"),this.fullTemplate&&1===e?!this.isReact&&i.classList.contains(d_)||(this.removeItemContent(i),i.classList.add(d_),ht(this.fullTemplateFunction({ratingValue:e,index:t},this,"ratingFullTemplate",this.element.id+"fullTemplate"+t,this.isStringTemplate),i)):this.emptyTemplate?!this.isReact&&i.classList.contains(p_)||(this.removeItemContent(i),i.classList.add(p_),ht(this.emptyTemplateFunction({ratingValue:e,index:t},this,"ratingEmptyTemplate",this.element.id+"emptyTemplate"+t,this.isStringTemplate),i)):(this.removeItemContent(i),U([i],t_.split(" "))))},g_.prototype.updateTooltipContent=function(e){var t,i=this;this.showTooltip&&(this.isReact&&this.clearTemplate(["ratingTooltipTemplate"]),this.tooltipTemplate?(t=this.createElement("span",{className:"e-rating-tooltip-content"}),ht(this.getTemplateString(this.tooltipTemplate)({value:this.currentValue},this,"ratingTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),t),this.tooltipObj.setProperties({content:t},e),this.isAngular&&setTimeout(function(){var e=i.ratingItemList.querySelectorAll("."+n_+"."+o_);i.tooltipObj.refresh(e[e.length-1])})):(t=this.currentValue.toString(),this.tooltipObj.setProperties({content:ao(function(){return t})},e)),this.renderReactTemplates())},g_.prototype.getTemplateString=function(t){var e,i="";try{i="function"!=typeof t&&(e=ge(t))?"SCRIPT"===e.tagName?e.innerHTML:e.outerHTML:t}catch(e){i=t}return oo(i)},g_.prototype.displayLabel=function(){this.showLabel?(this.spanLabel=this.createElement("span",{className:"e-rating-label"}),this.updateLabel(),this.updateLabelPosition()):this.wrapper.contains(this.spanLabel)&&(ue(this.spanLabel),this.spanLabel=null)},g_.prototype.updateLabel=function(){this.showLabel&&(this.labelTemplate?(this.isReact&&this.clearTemplate(["ratingLabelTemplate"]),this.spanLabel.firstChild&&(this.spanLabel.innerHTML=""),ht(this.getTemplateString(this.labelTemplate)({value:this.currentValue},this,"ratingLabelTemplate",this.element.id+"labelTemplate",this.isStringTemplate),this.spanLabel),this.renderReactTemplates()):this.spanLabel.textContent=this.currentValue+" / "+this.itemsCount)},g_.prototype.updateReset=function(){this.allowReset?(this.resetElement=this.createElement("span",{className:"e-icons e-reset",attrs:{"aria-label":"resetbutton",role:"button"}}),this.updateResetButton(),E.add(this.resetElement,"click",this.resetClicked,this),this.wrapper.insertBefore(this.resetElement,this.ratingItemList)):this.wrapper.contains(this.resetElement)&&(ue(this.resetElement),this.resetElement=null)},g_.prototype.updateLabelPosition=function(){this.clearLabelPosition(),this.spanLabel.classList.add("e-label-"+this.labelPosition.toLowerCase()),"Left"===this.labelPosition||"Top"===this.labelPosition?this.wrapper.firstChild.after(this.spanLabel):this.wrapper.appendChild(this.spanLabel)},g_.prototype.clearLabelPosition=function(){var e=this.spanLabel.classList.value.match(/(e-label-[top|bottom|right|left]+)/g);e&&q([this.spanLabel],e)},g_.prototype.wireItemsEvents=function(e,t){var i=this;E.add(e,"click",function(e){return i.clickHandler(e)},this),E.add(e,"mousemove",function(e){return i.mouseMoveHandler(t,e)},this),E.add(e,"mouseleave",this.mouseLeaveHandler,this)},g_.prototype.clickHandler=function(e){this.currentValue=0<this.min&&this.currentValue<this.min?this.min:this.currentValue,this.triggerChange(e,this.currentValue),this.updateItemValue(),this.updateLabel(),this.updateResetButton()},g_.prototype.updateValueChange=function(e,t,i){this.triggerChange(e,t,i=void 0===i?!0:i),this.updateItemValue(),this.updateLabel()},g_.prototype.triggerChange=function(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!1);t=this.validateValue(t),this.currentValue=t,this.currentValue===this.value||(e={event:e,isInteracted:i,value:t,previousValue:this.value},this.setProperties({value:t},!0),this.isAngular&&!n&&this.localChange({value:t}),n)||this.trigger("valueChanged",e)},g_.prototype.mouseMoveHandler=function(e,t){this.isTouchSelected&&(this.wrapper.classList.remove("e-rating-touch"),this.isTouchSelected=!1);var i=this.calculateCurrentValue(e,t),i=this.validateValue(i),e=this.itemElements[parseInt((e-1).toString(),10)];i===this.currentValue?this.openRatingTooltip(e,!1):(this.updateCurrentValue(i),this.openRatingTooltip(e,!0),this.trigger("onItemHover",{element:e,event:t,value:i}))},g_.prototype.openRatingTooltip=function(e,t){this.showTooltip&&(this.tooltipOpen?t&&(this.updateTooltipContent(!0),this.tooltipObj.refresh(e)):(this.updateTooltipContent(!1),this.tooltipObj.open(e),this.tooltipOpen=!0))},g_.prototype.closeRatingTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},g_.prototype.updateCurrentValue=function(e){this.currentValue=e,this.updateItemValue(),this.updateLabel()},g_.prototype.mouseLeaveHandler=function(){this.closeRatingTooltip(),this.updateCurrentValue(this.value)},g_.prototype.calculateCurrentValue=function(e,t){var i=e;return this.enableSingleSelection||this.precision===JV.Full||(i=t.offsetX/this.itemElements[e-1].clientWidth,i=this.enableRtl?1-i:i,this.precision===JV.Quarter?i=i<=.25?.25:i<=.5?.5:i<.75?.75:1:this.precision===JV.Half&&(i=i<=.5?.5:1),i=i+e-1),i},g_.prototype.reset=function(){this.resetClicked(null,!1)},g_.prototype.resetClicked=function(e,t){this.updateValueChange(e,this.min,t=void 0===t?!0:t),this.updateResetButton()},g_.prototype.wireKeyboardEvent=function(){this.keyboardModuleRating=new bn(this.wrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},g_.prototype.keyActionHandler=function(e){if(e.preventDefault(),!this.disabled&&!this.readOnly){if(e.target.classList.contains(i_))switch(e.action){case"uparrow":this.handleNavigation(e,!0);break;case"downarrow":this.handleNavigation(e,!1);break;case"leftarrow":this.handleNavigation(e,this.enableRtl);break;case"rightarrow":this.handleNavigation(e,!this.enableRtl)}this.allowReset&&e.target.classList.contains("e-reset")&&"space"===e.action&&this.resetClicked(e)}},g_.prototype.handleNavigation=function(e,t){var i;(!t&&this.value>this.min||t&&this.value<this.itemsCount)&&(i=this.precision===JV.Full||this.enableSingleSelection?1:this.precision===JV.Half?.5:this.precision===JV.Quarter?.25:Math.round(1)/10,i=t?this.value+i:this.value-i,this.updateValueChange(e,i),this.updateResetButton())},g_.prototype.updateContent=function(){this.isReact&&this.clearTemplate(["ratingEmptyTemplate","ratingFullTemplate"]);for(var e=0;e<this.itemsCount;e++){var t=this.itemElements[parseInt(e.toString(),10)].firstElementChild;this.renderItemContent(t,this.getRatingValue(this.value,e),e,!0)}},g_.prototype.getModuleName=function(){return"rating"},g_.prototype.getPersistData=function(){return this.addOnPersist([])},g_.prototype.removeItemElements=function(){for(var e=0;e<this.itemElements.length;e++)ue(this.itemElements[parseInt(e.toString(),10)]);this.itemElements=[]},g_.prototype.destroy=function(){var t=this;ZV.prototype.destroy.call(this),this.removeItemElements(),this.clearTemplate(),this.spanLabel&&(ue(this.spanLabel),this.spanLabel=null),this.resetElement&&(ue(this.resetElement),this.resetElement=null),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),ue(this.ratingItemList),this.ratingItemList=null,this.wrapper.parentNode.insertBefore(this.element,this.wrapper),ue(this.wrapper),this.wrapper=null,this.keyboardModuleRating.destroy(),this.keyboardModuleRating=null,["value","aria-label","name"].forEach(function(e){t.element.removeAttribute(e)})},e_([e(!(g_.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"value":this.updateValueChange(null,this.value>this.min?this.value:this.min,!1);break;case"min":this.updateMinValue(),this.updateItemValue(),this.updateLabel();break;case"showLabel":this.displayLabel();break;case"visible":this.wrapper.classList[this.visible?"remove":"add"](s_);break;case"disabled":this.updateDisabled();break;case"readOnly":this.wrapper.classList[this.readOnly?"add":"remove"](l_);break;case"allowReset":this.updateReset();break;case"enableRtl":this.wrapper.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"cssClass":t.cssClass&&q([this.wrapper],t.cssClass.split(" ")),e.cssClass&&U([this.wrapper],e.cssClass.split(" ")),this.tooltipObj&&this.tooltipObj.setProperties({cssClass:this.cssClass?"e-rating-tooltip "+this.cssClass:"e-rating-tooltip"});break;case"labelPosition":this.updateLabelPosition();break;case"showTooltip":this.updateTooltip();break;case"precision":this.updateMinValue(),this.triggerChange(null,this.value,!1),this.updateItemValue(),this.updateLabel();break;case"enableSingleSelection":this.updateValueChange(null,this.currentValue,!1);break;case"enableAnimation":this.wrapper.classList[this.enableAnimation?"add":"remove"](h_);break;case"emptyTemplate":case"fullTemplate":this.updateTemplateFunction(),this.updateContent();break;case"labelTemplate":this.updateLabel();break;case"itemsCount":this.removeItemElements(),this.renderItems(),this.updateLabel()}}))],g_.prototype,"allowReset",void 0),e_([e("")],g_.prototype,"cssClass",void 0),e_([e(!1)],g_.prototype,"disabled",void 0),e_([e("")],g_.prototype,"emptyTemplate",void 0),e_([e(!0)],g_.prototype,"enableAnimation",void 0),e_([e(!1)],g_.prototype,"enableSingleSelection",void 0),e_([e("")],g_.prototype,"fullTemplate",void 0),e_([e(5)],g_.prototype,"itemsCount",void 0),e_([e(KV.Right)],g_.prototype,"labelPosition",void 0),e_([e("")],g_.prototype,"labelTemplate",void 0),e_([e(0)],g_.prototype,"min",void 0),e_([e(JV.Full)],g_.prototype,"precision",void 0),e_([e(!1)],g_.prototype,"readOnly",void 0),e_([e(!1)],g_.prototype,"showLabel",void 0),e_([e(!0)],g_.prototype,"showTooltip",void 0),e_([e("")],g_.prototype,"tooltipTemplate",void 0),e_([e(0)],g_.prototype,"value",void 0),e_([e(!0)],g_.prototype,"visible",void 0),e_([i()],g_.prototype,"beforeItemRender",void 0),e_([i()],g_.prototype,"created",void 0),e_([i()],g_.prototype,"onItemHover",void 0),e_([i()],g_.prototype,"valueChanged",void 0),e_([Bt],g_));function g_(e,t){e=ZV.call(this,e,t)||this;return e.itemElements=[],e}m_=function(e,t){return(m_=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])}))(e,t)};var m_,f_,y_,v_,b_,$V=function(e,t){function i(){this.constructor=e}m_(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e_=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},w_=((w_=f_=f_||{}).Number="number",w_.Text="text",w_.Password="password",(w_=y_=y_||{}).Outlined="outlined",w_.Underlined="underlined",w_.Filled="filled",(w_=v_=v_||{}).None="none",w_.Uppercase="uppercase",w_.Lowercase="lowercase",$V(C_,b_=Ji),C_.prototype.preRender=function(){this.element.id||(this.element.id=D("e-"+this.getModuleName()))},C_.prototype.render=function(){this.initialize()},C_.prototype.initialize=function(){pt(this.element,{role:"group"}),this.renderInputs(),this.renderSeparator(1,this.inputs.length),this.addPlaceHolder(),this.updateCssClass(this.cssClass),this.updateVariantClass(),this.updateAriaLabel(this.ariaLabels),this.setElementAttributes(this.htmlAttributes,this.element),this.enableRtl&&this.element.classList.add("e-rtl"),this.previousValue=this.value.toString(),this.autoFocus&&this.focusIn()},C_.prototype.renderInputs=function(){this.hiddenInputEle=this.createElement("input",{id:"otpInput_hidden",attrs:{name:this.element.id,type:"hidden",value:"number"===this.type?this.value.toString().replace(/\D/g,""):this.value.toString(),autoComplete:"off"}}),this.element.appendChild(this.hiddenInputEle);for(var e=0;e<this.length;e++)this.createOtpInput(e)},C_.prototype.createOtpInput=function(e){var t=this.getDefaultValue(),i="",t=(t&&(t=t[parseInt(e.toString(),10)],"number"===this.type?isNaN(Number(t))||(i=t):i=t||""),this.createElement("input",{id:this.element.id+"-"+(e+1),className:"e-otp-input-field e-input",attrs:{maxlength:"1",type:this.type,inputmode:this.htmlAttributes.inputmode||("number"===this.type?"numeric":"text")}}));this.disabled&&t.setAttribute("disabled","disabled"),this.element.appendChild(t),this.inputs.push(t),i&&(t.value=i),this.wireEvents(t,e)},C_.prototype.renderSeparator=function(e,t){if(0<this.separator.length)for(var i=e;i<t;i++){var n=this.createElement("span",{className:"e-otp-separator"});n.textContent=this.separator,this.separatorElements.push(n),this.element.insertBefore(n,this.inputs[parseInt(i.toString(),10)])}},C_.prototype.updateSeparatorValue=function(){var t=this;""===this.separator?(this.separatorElements.forEach(ue),this.separatorElements=[]):this.separatorElements.forEach(function(e){e.textContent=t.separator})},C_.prototype.addPlaceHolder=function(){for(var e=0;e<this.inputs.length;e++){var t=this.placeholder.length<=1?this.placeholder:this.placeholder.charAt(e);this.setElementAttributes({placeholder:t},this.inputs[parseInt(e.toString(),10)])}},C_.prototype.updateInputType=function(t){var i=this.htmlAttributes.inputmode||("number"===t?"numeric":"text");this.inputs.forEach(function(e){e.type=t,e.setAttribute("inputmode",i)})},C_.prototype.getDefaultValue=function(){var e="number"==typeof this.value?this.value.toString():this.value,e=(e=this.textTransform?this.getTransformedText(e):e).replace(/\s/g,"");return 0<e.length?e.split(""):void 0},C_.prototype.getTransformedText=function(e){return this.textTransform.toLowerCase()===v_.Lowercase?e.toLowerCase():this.textTransform.toLowerCase()===v_.Uppercase?e.toUpperCase():e},C_.prototype.handleInputChange=function(e,t){var i=this.inputs[parseInt(e.toString(),10)],i=(i&&e<this.length-1&&0<i.value.length&&(i=this.inputs[parseInt(e.toString(),10)+1],this.shouldFireFocus=this.shouldFireBlur=!1,i.focus(),i)&&0<i.value.length&&i.select(),t.target);1<i.value.length&&(i.value=i.value.slice(0,1)),this.textTransform&&(i.value=this.getTransformedText(i.value)),this.triggerInputEvent(e,t),this.triggerValuechanged(t,!0)},C_.prototype.handleKeyAction=function(e,t){1<t.key.length&&!(0===e&&"Backspace"===t.key||e===this.length-1&&"Delete"===t.key)&&(this.shouldFireFocus=this.shouldFireBlur=!1);var i,n=this.inputs[parseInt(e.toString(),10)],o=this.inputs[parseInt(e.toString(),10)-1],r=this.inputs[parseInt(e.toString(),10)+1];"Delete"===t.key?(i="",0<n.value.length?(i=n.value,n.value=""):e!==this.inputs.length-1&&(i=r.value,r.value="",r.focus()),0<i.length&&this.triggerInputEvent(e,t)):"Backspace"===t.key?0!==e&&0===n.value.length&&(i=o.value,o.value="",o.focus(),0<i.length)&&this.triggerInputEvent(e,t):"ArrowLeft"===t.key||"ArrowRight"===t.key?("ArrowLeft"===t.key&&0<e?(o.focus(),o.select()):"ArrowRight"===t.key&&e<this.inputs.length-1&&(r.focus(),r.select()),t.preventDefault()):"ArrowUp"===t.key||"ArrowDown"===t.key?t.preventDefault():"Tab"===t.key||t.shiftKey||t.ctrlKey||"number"===this.type&&/\D/.test(t.key.toLocaleLowerCase())&&t.preventDefault()},C_.prototype.handleSelection=function(e){e=this.inputs[parseInt(e.toString(),10)];e.value&&e.select()},C_.prototype.handleFocus=function(e,t){U([this.inputs[parseInt(e.toString(),10)]],"e-otp-input-focus"),this.shouldFireFocus&&(t={element:this.element,event:t,index:e,isInteracted:!this.isFocusInCalled,value:this.value},this.trigger("focus",t)),this.shouldFireFocus=!0},C_.prototype.handleBlur=function(e,t){q([this.inputs[parseInt(e.toString(),10)]],"e-otp-input-focus"),this.shouldFireBlur&&(t={element:this.element,event:t,value:this.value,index:e,isInteracted:!this.isFocusOutCalled},this.trigger("blur",t)),this.shouldFireBlur=!0},C_.prototype.handlePaste=function(e,t){var i=t.clipboardData;if(i){for(var n=i.getData("text").split(""),o=0,r=e;r<this.inputs.length;r++)0<n.length&&n[parseInt(o.toString(),10)]&&(this.inputs[parseInt(r.toString(),10)].value=n[parseInt(o.toString(),10)],o++,this.updateValueProperty());this.focusIn(),this.triggerValuechanged(t,!0)}},C_.prototype.triggerInputEvent=function(e,t){var i=this.value.toString(),t=(this.updateValueProperty(),{element:this.element,event:t,previousValue:i,value:this.value.toString(),index:e});this.trigger("input",t)},C_.prototype.triggerValuechanged=function(e,t){this.length===this.value.toString().length&&this.previousValue!==this.value&&(e={element:this.element,event:e,isInteracted:t||!1,previousValue:this.previousValue,value:this.value},this.trigger("valueChanged",e),this.previousValue=this.value.toString())},C_.prototype.wireEvents=function(e,t){E.add(e,"focus",this.handleFocus.bind(this,t),this),E.add(e,"blur",this.handleBlur.bind(this,t),this),E.add(e,"input",this.handleInputChange.bind(this,t),this),E.add(e,"keydown",this.handleKeyAction.bind(this,t),this),E.add(e,"click",this.handleSelection.bind(this,t),this),E.add(e,"paste",this.handlePaste.bind(this,t),this),E.add(e,"wheel",this.handleWheelEvent,this)},C_.prototype.unWireEvents=function(){for(var e=0;e<this.inputs.length;e++){var t=this.inputs[parseInt(e.toString(),10)];E.remove(t,"focus",this.handleFocus.bind(this,e)),E.remove(t,"blur",this.handleBlur.bind(this,e)),E.remove(t,"input",this.handleInputChange.bind(this,e)),E.remove(t,"keydown",this.handleKeyAction.bind(this,e)),E.remove(t,"click",this.handleSelection.bind(this,e)),E.remove(t,"paste",this.handlePaste.bind(this,e)),E.remove(t,"wheel",this.handleWheelEvent)}},C_.prototype.updateValueProperty=function(){var t="",e=(this.inputs.forEach(function(e){t+=e.value}),this.isProtectedOnChange);this.isProtectedOnChange=!0,this.value="number"==typeof this.value?parseInt(t,10):t,this.isProtectedOnChange=e,this.hiddenInputEle.value=this.value.toString()},C_.prototype.updateInputValue=function(e){for(var t=this.value.toString(),i=(this.textTransform&&(t=this.getTransformedText(t)),e.toString()),n=0;n<this.inputs.length;n++)i.charAt(n)!==t.charAt(n)&&(this.inputs[parseInt(n.toString(),10)].value=t.charAt(n),this.hiddenInputEle.value=t);this.focusIn()},C_.prototype.updateCssClass=function(e,t){var i;(t=void 0===t?"":t)&&(i=t.trim().split(" "),(t=this.element.classList).remove.apply(t,i)),e&&(i=e.trim().split(" "),(t=this.element.classList).add.apply(t,i))},C_.prototype.updateVariantClass=function(){var e="outlined"===this.stylingMode.toLocaleLowerCase()?"outline":this.stylingMode.toLocaleLowerCase(),t=["underlined","filled","outline"];-1!==t.indexOf(e)&&(q([this.element],t.map(function(e){return"e-"+e})),U([this.element],"e-"+e))},C_.prototype.updateAriaLabel=function(n){this.inputs.forEach(function(e,t){var i="Enter Otp Character "+(t+1),t=n&&0<n.length&&n[parseInt(t.toString(),10)]||i;e.setAttribute("aria-label",t)})},C_.prototype.updateDisabledState=function(){var t=this;this.inputs.forEach(function(e){t.disabled?e.setAttribute("disabled","disabled"):e.removeAttribute("disabled")})},C_.prototype.setElementAttributes=function(e,t){if(!je(e))for(var i in e){var n;"class"===i?(n=e.class.replace(/\s+/g," ").trim())&&U([t],n.split(" ")):"inputmode"===i?this.setInputMode(e[""+i]):("name"===i&&this.element.id===t.id?this.hiddenInputEle:t).setAttribute(i,e[""+i])}},C_.prototype.setInputMode=function(e){for(var t=0;t<this.inputs.length;t++)this.inputs[parseInt(t.toString(),10)].setAttribute("inputmode",e)},C_.prototype.handleLengthChange=function(e,t){if(0<e-t){for(var i=t;i<e;i++)this.createOtpInput(i);this.renderSeparator(t,e),this.addPlaceHolder(),this.updateAriaLabel(this.ariaLabels)}else if(0<=e&&0<this.inputs.length){for(i=e;i<this.inputs.length;i++)ue(this.inputs[parseInt(i.toString(),10)]);if(this.inputs.splice(e),0<this.separatorElements.length){for(t=0===e?0:e-1,i=t;i<this.separatorElements.length;i++)ue(this.separatorElements[parseInt(i.toString(),10)]);this.separatorElements.splice(t)}}},C_.prototype.getModuleName=function(){return"otpinput"},C_.prototype.getPersistData=function(){return this.addOnPersist([])},C_.prototype.destroy=function(){b_.prototype.destroy.call(this),this.unWireEvents(),this.inputs.forEach(function(e){ue(e)}),this.separatorElements.forEach(function(e){ue(e)}),ue(this.hiddenInputEle),q([this.element],["e-underlined","e-filled","e-outline","e-rtl"]),this.cssClass&&q([this.element],this.cssClass.trim().split(" ")),this.element.removeAttribute("role"),this.inputs=[],this.separatorElements=[],this.hiddenInputEle=null},C_.prototype.focusIn=function(){this.isFocusInCalled=!0;for(var e=this.inputs.length-1,t=0;t<this.inputs.length;t++)if(!(0<this.inputs[parseInt(t.toString(),10)].value.length)){e=t;break}this.inputs[parseInt(e.toString(),10)].focus(),this.isFocusInCalled=!1},C_.prototype.focusOut=function(){this.isFocusOutCalled=!0,this.inputs.forEach(function(e){e.blur()}),this.isFocusOutCalled=!1},C_.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"textTransform":this.updateInputValue(this.value);break;case"value":this.updateInputValue(t.value),this.triggerValuechanged();break;case"placeholder":this.addPlaceHolder();break;case"disabled":this.updateDisabledState();break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass);break;case"separator":""===t.separator?this.renderSeparator(1,this.inputs.length):this.updateSeparatorValue();break;case"htmlAttributes":this.setElementAttributes(e.htmlAttributes,this.element);break;case"type":this.updateInputType(e.type);break;case"stylingMode":this.updateVariantClass();break;case"ariaLabels":this.updateAriaLabel(e.ariaLabels);break;case"length":this.handleLengthChange(e.length,t.length);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"]("e-rtl");break;case"autoFocus":this.autoFocus&&this.focusIn()}},e_([e(4)],C_.prototype,"length",void 0),e_([e("")],C_.prototype,"value",void 0),e_([e(f_.Number)],C_.prototype,"type",void 0),e_([e("")],C_.prototype,"separator",void 0),e_([e("")],C_.prototype,"placeholder",void 0),e_([e(y_.Outlined)],C_.prototype,"stylingMode",void 0),e_([e(!1)],C_.prototype,"disabled",void 0),e_([e("")],C_.prototype,"cssClass",void 0),e_([e(!1)],C_.prototype,"autoFocus",void 0),e_([e(v_.None)],C_.prototype,"textTransform",void 0),e_([e({})],C_.prototype,"htmlAttributes",void 0),e_([e([])],C_.prototype,"ariaLabels",void 0),e_([i()],C_.prototype,"created",void 0),e_([i()],C_.prototype,"valueChanged",void 0),e_([i()],C_.prototype,"focus",void 0),e_([i()],C_.prototype,"blur",void 0),e_([i()],C_.prototype,"input",void 0),e_([Bt],C_));function C_(e,t){e=b_.call(this,e,t)||this;return e.inputs=[],e.previousValue="",e.separatorElements=[],e.shouldFireFocus=!0,e.shouldFireBlur=!0,e.isFocusInCalled=!1,e.isFocusOutCalled=!1,e.handleWheelEvent=function(e){e.preventDefault()},e}S_=function(e,t){return(S_=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])}))(e,t)};var S_,A_,$V=function(e,t){function i(){this.constructor=e}S_(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e_=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},x_=($V(I_,A_=n),e_([e("")],I_.prototype,"content",void 0),e_([e("")],I_.prototype,"stopContent",void 0),e_([e("")],I_.prototype,"iconCss",void 0),e_([e("")],I_.prototype,"stopIconCss",void 0),e_([e("Left")],I_.prototype,"iconPosition",void 0),e_([e(!1)],I_.prototype,"isPrimary",void 0),I_);function I_(){return null!==A_&&A_.apply(this,arguments)||this}$V(D_,T_=n),e_([e("Start listening")],D_.prototype,"content",void 0),e_([e("Stop listening")],D_.prototype,"stopContent",void 0),e_([e("TopCenter")],D_.prototype,"position",void 0);var T_,E_,l=D_;function D_(){return null!==T_&&T_.apply(this,arguments)||this}(k_=E_=E_||{}).Inactive="Inactive",k_.Listening="Listening",k_.Stopped="Stopped";$V(P_,M_=Ji),P_.prototype.preRender=function(){this.element.id||(this.element.id=D("e-"+this.getModuleName()))},P_.prototype.getDirective=function(){return"EJS-SPEECHTOTEXT"},P_.prototype.getModuleName=function(){return"speech-to-text"},P_.prototype.getPersistData=function(){return this.addOnPersist([])},P_.prototype.render=function(){this.renderSpeechToText(),this.initializeSpeechRecognition(),je(this.listeningState)||this.handleStateChange(),this.wireEvents()},P_.prototype.initializeLocale=function(){this.l10n=new Cn(this.getModuleName(),{abortedError:"Speech recognition was aborted.",audioCaptureError:"No microphone detected. Ensure your microphone is connected.",defaultError:"An unknown error occurred.",networkError:"Network error occurred. Check your internet connection.",noSpeechError:"No speech detected. Please speak into the microphone.",notAllowedError:"Microphone access denied. Allow microphone permissions.",serviceNotAllowedError:"Speech recognition service is not allowed in this context.",unsupportedBrowserError:"The browser does not support the SpeechRecognition API.",startAriaLabel:"Press to start speaking and transcribe your words",stopAriaLabel:"Press to stop speaking and end transcription",startTooltipText:"Start listening",stopTooltipText:"Stop listening"},this.locale)},P_.prototype.renderSpeechToText=function(){this.initializeLocale();var e=je(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss;this.buttonInst=new zv({iconCss:e,isPrimary:this.buttonSettings.isPrimary,cssClass:this.updateButtonCssClass(),disabled:this.disabled,content:this.buttonSettings.content,iconPosition:this.buttonSettings.iconPosition,enableRtl:this.enableRtl}),this.buttonInst.appendTo(this.element),this.updateTooltip(),this.updateCssClass(this.cssClass,""),this.updateAriaLabel(),je(this.htmlAttributes)||this.addHtmlAttributes(this.htmlAttributes)},P_.prototype.updateAriaLabel=function(){var e=this.htmlAttributes&&this.htmlAttributes["aria-label"]?this.htmlAttributes["aria-label"]:this.micOn?this.l10n.getConstant("stopAriaLabel"):this.l10n.getConstant("startAriaLabel");this.element.setAttribute("aria-label",e)},P_.prototype.updateCssClass=function(e,t){t&&q([this.element],t.trim().split(" ")),e&&U([this.element],e.trim().split(" "))},P_.prototype.updateButtonCssClass=function(){var e;return""===(this.isClicked?this.buttonSettings.stopContent:this.buttonSettings.content)&&(e="e-round"),this.micOn&&(e+=" e-listening-state"),e},P_.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipSettings&&("Start listening"===this.tooltipSettings.content&&(this.tooltipSettings.content=this.l10n.getConstant("startTooltipText")),"Stop listening"===this.tooltipSettings.stopContent)&&(this.tooltipSettings.stopContent=this.l10n.getConstant("stopTooltipText")),this.tooltipInst=new NS({content:this.hasStarted?this.tooltipSettings.stopContent:this.tooltipSettings.content,position:this.tooltipSettings.position,windowCollision:!0,cssClass:this.cssClass?"e-speech-to-text-tooltip "+this.cssClass:"e-speech-to-text-tooltip",opensOn:"Hover",enableRtl:this.enableRtl}),this.tooltipInst.appendTo(this.element)):je(this.tooltipInst)||(this.tooltipInst.destroy(),this.tooltipInst=null)},P_.prototype.handleStateChange=function(){var e;this.disabled||(this.listeningState===E_.Listening?(this.micOn=!0,this.startSpeechRecognition()):this.listeningState!==E_.Inactive&&this.listeningState!==E_.Stopped||(this.micOn?(this.micOn=!1,this.stopSpeechRecognition()):(e=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.listeningState=E_.Inactive,this.isProtectedOnChange=e)))},P_.prototype.addHtmlAttributes=function(e){if(e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.element.setAttribute(t,e[t])},P_.prototype.removeHtmlAttributes=function(e){if(e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.element.removeAttribute(t)},P_.prototype.wireEvents=function(){E.add(this.element,"click",this.handleButtonClick,this)},P_.prototype.unWireEvents=function(){E.remove(this.element,"click",this.handleButtonClick)},P_.prototype.handleButtonClick=function(e){this.isUserInteracted=!0,this.micOn=!this.micOn,this.micOn?this.startSpeechRecognition(e):this.stopSpeechRecognition(e)},P_.prototype.triggerUnSupportedError=function(){var e={error:"unsupported-browser",errorMessage:this.l10n.getConstant("unsupportedBrowserError")};this.trigger("onError",e)},P_.prototype.initializeSpeechRecognition=function(){var r=this,e=window,e=e.SpeechRecognition||e.webkitSpeechRecognition;e?(this.recognition=new e,this.recognition.continuous=!0,this.recognition.lang=this.lang,this.recognition.interimResults=this.allowInterimResults,this.recognition.onstart=function(e){var t=r.isProtectedOnChange,i=(r.isProtectedOnChange=!0,r.transcript=r.fullTranscript="",r.isProtectedOnChange=t,{cancel:!1,listeningState:E_.Listening,event:e,isInteracted:r.isUserInteracted});r.trigger("onStart",i,function(){i.cancel?(r.recognition.abort(),r.micOn=!1):r.handleStartRecognition()})},this.recognition.onend=function(e){r.hasStarted&&(r.micOn=!1,r.handleStopRecognition(e))},this.recognition.onerror=function(e){var t="";switch(e.error){case"not-allowed":t=r.l10n.getConstant("notAllowedError");break;case"audio-capture":t=r.l10n.getConstant("audioCaptureError");break;case"network":t=r.l10n.getConstant("networkError");break;case"no-speech":t=r.l10n.getConstant("noSpeechError");break;case"aborted":t=r.l10n.getConstant("abortedError");break;case"service-not-allowed":t=r.l10n.getConstant("serviceNotAllowedError");break;default:t=r.l10n.getConstant("defaultError")}e={event:e,error:e.error,errorMessage:t};r.trigger("onError",e),r.isUserInteracted=!1},this.recognition.onresult=function(e){var t=e.results[e.resultIndex],i="",n=r.isProtectedOnChange,o=(r.isProtectedOnChange=!0,t.isFinal?(r.fullTranscript+=t[0].transcript,r.transcript=r.fullTranscript):(i+=t[0].transcript,r.transcript=r.fullTranscript+i),{event:e,transcript:r.transcript,isInterimResult:!t.isFinal});r.trigger("transcriptChanged",o,function(){var e;o.transcript!==r.transcript&&(e=r.isProtectedOnChange,r.isProtectedOnChange=!0,r.transcript=r.fullTranscript=o.transcript,r.isProtectedOnChange=e)}),r.isProtectedOnChange=n}):this.triggerUnSupportedError()},P_.prototype.handleStartRecognition=function(){var e=this.isProtectedOnChange,t=(this.isProtectedOnChange=!0,this.hasStarted=!0,this.listeningState=E_.Listening,je(this.tooltipInst)||(this.tooltipInst.content=this.tooltipSettings.stopContent),this.updateAriaLabel(),this.isClicked=!0,this.buttonInst.cssClass=this.updateButtonCssClass(),this.buttonInst.content=this.buttonSettings.stopContent,je(this.buttonSettings.stopIconCss)||""===this.buttonSettings.stopIconCss?"e-icons e-listen-stop":this.buttonSettings.stopIconCss);this.buttonInst.iconCss=t,this.isProtectedOnChange=e},P_.prototype.triggerUnSupportedStart=function(e){var t=this,i=this.isProtectedOnChange,n=(this.isProtectedOnChange=!0,this.transcript="",this.isProtectedOnChange=i,{cancel:!1,listeningState:E_.Listening,event:e,isInteracted:this.isUserInteracted});this.trigger("onStart",n,function(){n.cancel||t.handleStartRecognition()})},P_.prototype.startSpeechRecognition=function(e){this.hasStarted||(this.recognition?this.recognition.start():this.triggerUnSupportedStart(e))},P_.prototype.stopSpeechRecognition=function(e){this.recognition?this.recognition.stop():this.handleStopRecognition(e)},P_.prototype.handleStopRecognition=function(e){var t;this.hasStarted&&(t=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.listeningState=E_.Stopped,je(this.tooltipInst)||(this.tooltipInst.content=this.tooltipSettings.content),this.updateAriaLabel(),this.isClicked=!1,this.buttonInst.cssClass=this.updateButtonCssClass(),this.buttonInst.content=this.buttonSettings.content,e={listeningState:E_.Stopped,event:e,isInteracted:this.isUserInteracted},this.trigger("onStop",e),this.listeningState=E_.Inactive,e=je(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss,this.buttonInst.iconCss=e,this.hasStarted=!1,this.isProtectedOnChange=t)},P_.prototype.buttonSettingsChanges=function(e,t){var i,n;e.content===t.content&&e.stopContent===t.stopContent||(this.buttonInst.content=this.hasStarted?this.buttonSettings.stopContent:this.buttonSettings.content,this.buttonInst.cssClass=this.updateButtonCssClass()),e.iconCss===t.iconCss&&e.stopIconCss===t.stopIconCss||(i=je(this.buttonSettings.iconCss)||""===this.buttonSettings.iconCss?"e-icons e-listen-icon":this.buttonSettings.iconCss,n=je(this.buttonSettings.stopIconCss)||""===this.buttonSettings.stopIconCss?"e-icons e-listen-stop":this.buttonSettings.stopIconCss,this.buttonInst.iconCss=this.hasStarted?n:i),e.iconPosition!==t.iconPosition&&(this.buttonInst.iconPosition=this.buttonSettings.iconPosition),e.isPrimary!==t.isPrimary&&(this.buttonInst.isPrimary=this.buttonSettings.isPrimary)},P_.prototype.destroyAndNullify=function(e){e&&e.destroy()},P_.prototype.destroy=function(){M_.prototype.destroy.call(this),this.unWireEvents(),this.destroyAndNullify(this.buttonInst),this.destroyAndNullify(this.tooltipInst),this.recognition=null,this.micOn=null,this.htmlAttributes=this.tooltipSettings=this.buttonSettings=null,this.element.classList.remove("e-rtl")},P_.prototype.startListening=function(){this.disabled||this.isClicked||(this.isUserInteracted=!1,this.micOn=!0,this.startSpeechRecognition())},P_.prototype.stopListening=function(){!this.disabled&&this.isClicked&&(this.isUserInteracted=!1,this.micOn=!1,this.stopSpeechRecognition())},P_.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"lang":this.recognition&&(this.recognition.lang=this.lang);break;case"allowInterimResults":this.recognition&&(this.recognition.interimResults=this.allowInterimResults);break;case"buttonSettings":this.buttonSettingsChanges(t.buttonSettings,e.buttonSettings);break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass);break;case"disabled":this.buttonInst.disabled=this.disabled,this.handleStateChange();break;case"htmlAttributes":this.removeHtmlAttributes(t.htmlAttributes),this.addHtmlAttributes(e.htmlAttributes);break;case"listeningState":this.handleStateChange();break;case"tooltipSettings":case"showTooltip":this.updateTooltip();break;case"transcript":this.transcript=this.fullTranscript=e.transcript;break;case"enableRtl":this.buttonInst.enableRtl=this.tooltipInst.enableRtl=this.enableRtl;break;case"locale":this.l10n.setLocale(this.locale),this.updateAriaLabel(),this.updateTooltip()}},e_([e("")],P_.prototype,"transcript",void 0),e_([e("")],P_.prototype,"lang",void 0),e_([e(!0)],P_.prototype,"allowInterimResults",void 0),e_([e(!0)],P_.prototype,"showTooltip",void 0),e_([e("Inactive")],P_.prototype,"listeningState",void 0),e_([t({},x_)],P_.prototype,"buttonSettings",void 0),e_([t({},l)],P_.prototype,"tooltipSettings",void 0),e_([e(!1)],P_.prototype,"disabled",void 0),e_([e("")],P_.prototype,"cssClass",void 0),e_([e({})],P_.prototype,"htmlAttributes",void 0),e_([i()],P_.prototype,"created",void 0),e_([i()],P_.prototype,"onStart",void 0),e_([i()],P_.prototype,"onStop",void 0),e_([i()],P_.prototype,"onError",void 0),e_([i()],P_.prototype,"transcriptChanged",void 0);var M_,k_=e_([Bt],P_);function P_(e,t){e=M_.call(this,e,t)||this;return e.fullTranscript="",e.isClicked=!1,e.isUserInteracted=!1,e.hasStarted=!1,e}F_.prototype.destroy=function(){this.closeDialog()},F_.prototype.wireEvents=function(){E.add(this.dlg,"click",this.clickHandler,this),E.add(this.dlg,"keyup",this.keyupHandler,this),this.searchHandler=P(this.searchBoxKeyUp,200);var e=this.dialogObj.element.querySelector(".e-searchinput");e&&(E.add(e,"keyup",this.searchHandler,this),E.add(e,"input",this.searchHandler,this))},F_.prototype.unWireEvents=function(){E.remove(this.dlg,"click",this.clickHandler),E.remove(this.dlg,"keyup",this.keyupHandler);var e=this.dialogObj.element.querySelector(".e-searchinput");e&&(E.remove(e,"keyup",this.searchHandler),E.remove(e,"input",this.searchHandler))},F_.prototype.foreignKeyFilter=function(n,o,e){var r=this,s={},a=[],t=this.foreignKeyQuery.clone();this.options.column.dataSource.executeQuery(t.where(e)).then(function(e){r.options.column.columnData=e.result,r.parent.notify(uI,{predicate:s,column:r.options.column}),n.ejpredicate=s.predicate.predicates;for(var t=s.predicate.predicates,i=0;i<t.length;i++)a.push({field:t[parseInt(i.toString(),10)].field,predicate:"or",matchCase:t[parseInt(i.toString(),10)].ignoreCase,ignoreAccent:t[parseInt(i.toString(),10)].ignoreAccent,operator:t[parseInt(i.toString(),10)].operator,value:t[parseInt(i.toString(),10)].value,type:r.options.type});n.filterCollection=a.length?a:o.filter(function(e){return e.field=r.options.field}),r.options.handler(n)})},F_.prototype.searchBoxClick=function(e){var t=e.target;t.classList.contains("e-searchclear")&&(this.sInput.value=t.classList.contains("e-chkcancel-icon")?"":this.sInput.value,this.isCheckboxFilterTemplate?this.parent.notify("refreshCheckbox",{event:e}):this.refreshCheckboxes(),this.updateSearchIcon(),this.sInput.focus())},F_.prototype.searchBoxKeyUp=function(e){je(this.sInput)||!je(e)&&("ArrowUp"===e.key||"ArrowDown"===e.key||"Tab"===e.key||"Tab"===e.key&&e.shiftKey)||(je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||this.parent.showMaskRow(void 0,this.dialogObj.element),this.isCheckboxFilterTemplate?this.parent.notify("refreshCheckbox",{event:e}):this.refreshCheckboxes(),this.updateSearchIcon())},F_.prototype.updateSearchIcon=function(){this.sInput.value.length?(mt(this.sIcon,["e-chkcancel-icon"],["e-search-icon"]),je(document.body.querySelector(".e-chkcancel-icon"))||document.body.querySelector(".e-chkcancel-icon").setAttribute("title",this.localeObj.getConstant("Clear"))):(mt(this.sIcon,["e-search-icon"],["e-chkcancel-icon"]),je(document.body.querySelector(".e-searchclear.e-search-icon"))||document.body.querySelector(".e-searchclear.e-search-icon").setAttribute("title",this.localeObj.getConstant("Search")))},F_.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},F_.prototype.updateDataSource=function(){var e=this.options.dataSource;if(!(e instanceof me))for(var t,i=0;i<e.length;i++)"object"!=typeof e&&((t={})[this.options.field]=e[parseInt(i.toString(),10)],e[parseInt(i.toString(),10)]=t)},F_.prototype.updateModel=function(e){this.options=e,this.existingPredicate=e.actualPredicate||{},this.options.dataSource=e.dataSource,this.options.dataManager=e.dataManager||e.dataSource,this.updateDataSource(),this.options.type=e.type,this.options.format=e.format||"",this.options.ignoreAccent=e.ignoreAccent||!1,this.options.filteredColumns=e.filteredColumns||this.parent.filterSettings.columns,this.options.query=e.query||new ya,this.options.allowCaseSensitive=e.allowCaseSensitive||!1,this.options.uid=e.column.uid,this.options.disableHtmlEncode=e.column.disableHtmlEncode||!1,this.values={},this.localeObj=e.localeObj,this.isFiltered=e.filteredColumns.length,this.infiniteRenderMod=!(!this.parent.filterSettings||!this.parent.filterSettings.enableInfiniteScrolling),this.infiniteUnloadParentExistPred=this.infiniteRenderMod&&this.existingPredicate[this.options.column.field]?this.existingPredicate[this.options.column.field].slice():[]},F_.prototype.getAndSetChkElem=function(e){return this.dlg=this.parent.createElement("div",{id:this.id+this.options.type+"_excelDlg",attrs:{uid:this.options.column.uid},className:"e-checkboxfilter e-filter-popup"}),this.sBox=this.parent.createElement("div",{className:"e-searchcontainer"}),e.hideSearchbox||(this.sInput=this.parent.createElement("input",{id:this.id+"_SearchBox",className:"e-searchinput"}),this.sIcon=this.parent.createElement("span",{className:"e-searchclear e-search-icon e-icons e-input-group-icon",attrs:{type:"text",title:this.getLocalizedLabel("Search")}}),this.searchBox=this.parent.createElement("span",{className:"e-searchbox e-fields"}),this.searchBox.appendChild(this.sInput),this.sBox.appendChild(this.searchBox),this.searchInputArgs={element:this.sInput,floatLabelType:"Never",properties:{placeholder:this.getLocalizedLabel("Search"),cssClass:this.parent.cssClass}},HF.createInput(this.searchInputArgs,this.parent.createElement),this.searchBox.querySelector(".e-input-group").appendChild(this.sIcon)),this.spinner=this.parent.createElement("div",{className:"e-spinner"}),this.cBox=this.parent.createElement("div",{id:this.id+this.options.type+"_CheckBoxList",className:"e-checkboxlist e-fields"}),this.spinner.appendChild(this.cBox),this.sBox.appendChild(this.spinner),this.sBox},F_.prototype.showDialog=function(e){var t={requestType:H1,columnName:this.options.field,columnType:this.options.type,cancel:!1};if((t.filterModel=this).parent.notify(HI,t),t.cancel)e.cancel=t.cancel;else{this.dialogObj=new pS({visible:!1,content:this.sBox,close:this.closeDialog.bind(this),enableRtl:this.parent.enableRtl,width:!je(A(e.target,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:255,target:this.parent.element,animationSettings:{effect:"None"},buttons:[{click:this.btnClick.bind(this),buttonModel:{content:this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton"),cssClass:this.parent.cssClass?"e-primary "+this.parent.cssClass:"e-primary",isPrimary:!0}},{click:this.btnClick.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",content:this.getLocalizedLabel(this.isExcel?"CancelButton":"ClearButton")}}],created:this.dialogCreated.bind(this),open:this.dialogOpen.bind(this),cssClass:this.parent.cssClass||""});this.dialogObj.isStringTemplate=!0,this.renderResponsiveFilter(e);t=this.parent.filterSettings&&"CheckBox"===this.parent.filterSettings.type?this.getLocalizedLabel("CheckBoxFilterDialogARIA"):this.getLocalizedLabel("ExcelFilterDialogARIA");if(this.dlg.setAttribute("aria-label",t),(e.isResponsiveFilter?document.querySelector(".e-responsive-dialog > .e-dlg-content > .e-mainfilterdiv"):this.parent.element).appendChild(this.dlg),this.dialogObj.appendTo(this.dlg),this.dialogObj.element.style.maxHeight=e.isResponsiveFilter?"none":this.options.height+"px",this.dialogObj.show(),this.parent&&this.parent.filterSettings&&("CheckBox"===this.parent.filterSettings.type||this.options.column&&this.options.column.filter&&"CheckBox"===this.options.column.filter.type)&&this.parent.getContent().firstElementChild.offsetHeight<this.dialogObj.element.offsetHeight&&!A(this.parent.element,"e-gantt-dialog")&&rF(this.parent,this.dialogObj),this.dialogObj.element.querySelector(".e-dlg-content").appendChild(this.sBox),this.wireEvents(),this.parent.enableAdaptiveUI){if(this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator)return void this.getAllData();this.infiniteRenderMod&&(this.cBox.style.marginTop=kF(this.cBox)+"px")}else je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||this.infiniteRenderMod||this.parent.showMaskRow(void 0,this.dialogObj.element),this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&this.showMask();this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator||(mA({target:this.spinner,cssClass:this.parent.cssClass||null},this.parent.createElement),kA(this.spinner)),this.getAllData()}},F_.prototype.renderResponsiveFilter=function(e){e.isResponsiveFilter&&(this.dialogObj.buttons=[{}],this.dialogObj.position={X:"",Y:""},this.dialogObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv"),this.dialogObj.width="100%")},F_.prototype.dialogCreated=function(e){this.options.isResponsiveFilter?this.dialogObj.element.style.left="0px":F.isDevice?this.dialogObj.position={X:"center",Y:"center"}:wB(this.options.target,this.dialogObj),this.options.column.showColumnMenu&&this.parent.notify(hI,e)},F_.prototype.openDialog=function(e){this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e)},F_.prototype.closeDialog=function(){var e,t;this.infiniteRenderMod&&this.infinitePermenantLocalData.length&&!this.options.isRemote&&(this.options.dataSource.dataSource.json=this.infinitePermenantLocalData),this.dialogObj&&!this.dialogObj.isDestroyed&&(this.isBlanks=!1,t=this.options.columns.filter(function(e){return e.getFilterItemTemplate()}),e=this.parent.registeredTemplate,t.length&&!je(e)&&e.filterItemTemplate&&this.parent.destroyTemplate(["filterItemTemplate"]),(this.parent.isReact||this.parent.isVue)&&void 0!==this.parent.destroyTemplate&&EF(this.parent,["filterItemTemplate"]),this.parent.notify(dI,{field:this.options.field}),this.unWireEvents(),this.searchInputArgs&&this.searchInputArgs.element&&this.searchInputArgs.element.parentElement&&(HF.destroy(this.searchInputArgs),ue(this.searchInputArgs.element)),this.searchInputArgs=null,this.sInput=null,this.parent.isReact&&this.options.column.filter&&"string"!=typeof this.options.column.filter.itemTemplate&&("CheckBox"===this.options.column.filter.type||"Excel"===this.options.column.filter.type)&&(this.dialogObj.element.querySelector(".e-dlg-content").innerHTML=""),this.dialogObj.destroy(),"escape"===this.dialogObj.dlgClosedBy&&(this.parent.isColumnMenuFilterClosing=!0),this.dlg&&this.dlg.parentElement&&(ue(this.dlg),je(t=document.getElementById(this.parent.element.id+"_e-popup"))||(ue(t),t=null)),this.dlg=null,this.parent.notify(NT,{}))},F_.prototype.clearFilter=function(e){var t={instance:this,handler:this.clearFilter,cancel:!1};this.parent.notify(jI,t),t.cancel||this.options.handler({action:"clear-filter",field:(e||this.options).field})},F_.prototype.btnClick=function(e){var t;this.filterState?("input"===e.target.tagName.toLowerCase()&&e.target.classList.contains("e-searchinput")||13===e.keyCode||(t=e.target.firstChild.textContent.toLowerCase(),this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton").toLowerCase()===t)?this.isCheckboxFilterTemplate||this.fltrBtnHandler():this.getLocalizedLabel("ClearButton").toLowerCase()===t&&this.clearFilter(),this.closeDialog()):e.target&&e.target.firstChild&&e.target.firstChild.textContent.toLowerCase()===this.getLocalizedLabel("CancelButton").toLowerCase()?this.closeDialog():"input"!==e.target.tagName.toLowerCase()&&(this.clearFilter(),this.closeDialog()),this.options.column.showColumnMenu&&this.parent.notify(dE,{}),je(this.parent.focusModule)||this.parent.focusModule.filterfocus()},F_.prototype.fltrBtnHandler=function(){var t=this,e=(this.infiniteRenderMod&&(this.cBox.innerHTML="",eB(this.cBox,this.infiniteLoadedElem.slice())),[].slice.call(this.cBox.querySelectorAll(".e-check:not(.e-selectall):not(.e-add-current)"))),i=e,n="equal",o=this.dialogObj.element.querySelector(".e-dropdownlist"),o=(o&&(this.options.operator=n=o.ej2_instances[0].value),this.isMenuNotEqual="notequal"===this.options.operator,this.options.hideSearchbox||(a=this.searchBox.querySelector(".e-searchinput")),this.options.allowCaseSensitive),o={field:this.options.field,predicate:this.isMenuNotEqual?"and":"or",uid:this.options.uid,operator:n,type:this.options.type,matchCase:o,ignoreAccent:this.options.ignoreAccent},r=this.itemsCnt!==e.length&&this.itemsCnt-e.length<e.length,s=(r&&a&&""===a.value&&(n=this.isMenuNotEqual?"equal":"notequal",e=[].slice.call(this.cBox.querySelectorAll(".e-uncheck:not(.e-selectall)")),o.predicate=this.isMenuNotEqual?"or":"and",o.operator=n),[]);if(e.length!==this.itemsCnt||a&&a.value&&""!==a.value||this.infiniteRenderMod){this.infiniteRenderMod?this.infiniteRenderMod&&(!this.infiniteSearchPred||this.infiniteSearchPred&&!this.infiniteSearchPred.isComplex)?this.infiniteFltrBtnHandler(s):this.infiniteSearchPred.isComplex&&(s=this.complexQueryPredicate(e,o,r)):s=this.complexQueryPredicate(e,o,r),"date"!==this.options.type&&"datetime"!==this.options.type||!i.length||(n=i.length-1,je(this.values[A(i[parseInt(n.toString(),10)],"e-ftrchk").getAttribute("uid")])&&r&&s.push({field:o.field,matchCase:o.matchCase,operator:"equal",predicate:"or",value:null}));var a=(this.infiniteRenderMod?this.sBox:this.cBox).querySelector(".e-add-current");if(a&&a.classList.contains("e-check")){var l=this.existingPredicate[this.options.field];if(!l)return;for(var h=0;h<l.length;h++)!function(t){s.some(function(e){return e.value===l[parseInt(t.toString(),10)].value})||s.push(l[parseInt(t.toString(),10)])}(h)}!this.infiniteRenderMod||s.length?this.initiateFilter(s):this.sBox.querySelector(".e-selectall").classList.contains("e-check")&&!s.length&&this.options.filteredColumns.some(function(e){return t.options.field===e.field})&&this.clearFilter()}else this.options.filteredColumns.some(function(e){return t.options.field===e.field})&&this.clearFilter()},F_.prototype.complexQueryPredicate=function(e,t,i){for(var n,o,r=[],s=0;s<e.length;s++)o=Pe({},{value:n=this.values[A(e[parseInt(s.toString(),10)],"e-ftrchk").getAttribute("uid")]},t),n&&!n.toString().length&&(o.operator=i?"notequal":"equal"),""===n||je(n)?r=r.concat(F_.generateNullValuePredicates(t)):r.push(o),this.notifyFilterPrevEvent(o);return r},F_.prototype.infiniteFltrBtnHandler=function(e){if(this.infiniteManualSelectMaintainPred.length)for(var t=0;t<this.infiniteManualSelectMaintainPred.length;t++){var i,n=this.infiniteManualSelectMaintainPred[t];!(i=n.value+"")||je(i)?(i={predicate:n.predicate,field:n.field,type:n.type,uid:n.uid,operator:n.operator,matchCase:n.matchCase,ignoreAccent:n.ignoreAccent},e.push.apply(e,F_.generateNullValuePredicates(i))):e.push(this.infiniteManualSelectMaintainPred[t]),this.notifyFilterPrevEvent(this.infiniteManualSelectMaintainPred[t])}if(!this.localInfiniteSelectAllClicked&&""===this.sInput.value&&(this.options.parentCurrentViewDataCount||!e.length))for(t=0;t<this.infiniteUnloadParentExistPred.length;t++)e.unshift(this.infiniteUnloadParentExistPred[t]),this.notifyFilterPrevEvent(this.existingPredicate[this.options.field][t]);""===this.sInput.value||this.localInfiniteSelectAllClicked&&!this.infiniteLocalSelectAll||(this.infiniteSearchPred.predicate="or",e.unshift(this.infiniteSearchPred),this.notifyFilterPrevEvent(this.infiniteSearchPred))},F_.prototype.notifyFilterPrevEvent=function(e){e={instance:this,handler:this.fltrBtnHandler,arg1:e.field,arg2:e.predicate,arg3:e.operator,arg4:e.matchCase,arg5:e.ignoreAccent,arg6:e.value,cancel:!1};this.parent.notify(jI,e)},F_.generateNullValuePredicates=function(e){var t=[];return"string"===e.type&&t.push({field:e.field,ignoreAccent:e.ignoreAccent,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:""}),t.push({field:e.field,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:null}),t.push({field:e.field,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:void 0}),t},F_.prototype.initiateFilter=function(e){var t=e[0];if(!je(t)){for(var i=t.ejpredicate||new ba(t.field,t.operator,t.value,!t.matchCase,t.ignoreAccent),n=1;n<e.length;n++)i=void 0!==e[parseInt(n.toString(),10)].ejpredicate?i[e[parseInt(n.toString(),10)].predicate](e[parseInt(n.toString(),10)].ejpredicate):i[e[parseInt(n.toString(),10)].predicate](e[parseInt(n.toString(),10)].field,e[parseInt(n.toString(),10)].operator,e[parseInt(n.toString(),10)].value,!e[parseInt(n.toString(),10)].matchCase,e[parseInt(n.toString(),10)].ignoreAccent);t={action:"filtering",filterCollection:e,field:this.options.field,ejpredicate:ba.or(i)};this.options.handler(t)}},F_.prototype.isForeignColumn=function(e){return!!e.isForeignColumn&&e.isForeignColumn()},F_.prototype.refreshCheckboxes=function(){var t,e,o=this,r=this.sInput.value,s=this.options.column,a=(this.isForeignColumn(s)?this.foreignKeyQuery:this.options.query).clone(),l=this.options.query.clone(),h=a.queries.filter(function(e){return e&&"onWhere"===e.fn})[0],d=(a.queries=[],l.queries=[],"string"!==this.options.type&&parseFloat(r)?parseFloat(r):r),p=this.options.isRemote?"string"===this.options.type?"contains":"equal":this.options.type?"contains":"equal",c=this.options.ignoreAccent,u=this.isForeignColumn(s)?s.foreignKeyValue:s.field,g=(d=""===d||void 0===d?void 0:d,[]),m={field:u,predicate:"or",uid:this.options.uid,operator:"equal",type:this.options.type,matchCase:!0,ignoreAccent:c},i=this.options.dataManager.adaptor.getModuleName,f=("boolean"===this.options.type&&(void 0!==d&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(d.toLowerCase())?d="true":void 0!==d&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(d.toLowerCase())&&(d="false"),void 0!==d&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(d.toLowerCase())&&i?(i(),d=!0):void 0!==d&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(d.toLowerCase())&&i&&(i(),d=!1),p="equal"),"date"!==this.options.type&&"datetime"!==this.options.type&&"dateonly"!==this.options.type||!this.options.format||(i=new Ti,e=("string"==typeof this.options.format?this.options:this.options.format).format,d=e&&i.parseDate(r,{format:e})||new Date(r),"dateonly"===this.options.type&&(d=d.getFullYear()+"-"+kB(d.getMonth()+1)+"-"+kB(d.getDate()))),this.infiniteSearchValChange=!0,this.infiniteLoadedElem=[],this.infiniteLocalSelectAll=!0,this.localInfiniteSelectAllClicked=!1,this.localInfiniteSelectionInteracted=!1,this.infiniteSkipCnt=0,this.infiniteDataCount=0,this.infiniteManualSelectMaintainPred=[],""===this.sInput.value?this.infiniteUnloadParentExistPred=this.infiniteRenderMod&&this.existingPredicate[this.options.column.field]?this.existingPredicate[this.options.column.field].slice():[]:this.infiniteUnloadParentExistPred=[],this.addDistinct(a),{requestType:z1,filterModel:this,columnName:u,column:s,operator:p,matchCase:!0,ignoreAccent:c,filterChoiceCount:null,query:a,value:d});this.infiniteRenderMod&&this.parent.filterSettings.itemsCount&&(f.filterChoiceCount=this.parent.filterSettings.itemsCount),this.parent.trigger(WA,f,function(i){i.operator=i.operator,t=new ba(u,i.operator,f.value,i.matchCase,i.ignoreAccent),"date"!==o.options.type&&"datetime"!==o.options.type&&"dateonly"!==o.options.type||(p="equal",je(d))||(t=PB({field:u,operator:p,value:d,matchCase:!0,ignoreAccent:c},o.options.type)),r&&"string"==typeof r&&o.isBlanks&&0<=o.getLocalizedLabel("Blanks").toLowerCase().indexOf(r.toLowerCase())?(g=g.concat(F_.generateNullValuePredicates(m)),(e=F_.generatePredicate(g)).predicates.push(t),t=e,a.where(e)):r.length?(t=je(h)?t:t.and(h.e),a.where(t)):je(h)||(t=h.e,a.where(h.e)),o.infiniteSearchPred=t,i.filterChoiceCount=je(i.filterChoiceCount)?1e3:i.filterChoiceCount,o.infiniteRenderMod&&o.parent.filterSettings.itemsCount!==i.filterChoiceCount&&(o.parent.filterSettings.itemsCount=f.filterChoiceCount);var e,n={};kA(o.spinner),o.renderEmpty=!1,o.isForeignColumn(s)&&r.length?("result"in s.dataSource?new me(s.dataSource.result):s.dataSource).executeQuery(a).then(function(e){var t=o.options.column.columnData;o.options.column.columnData=e.result,o.parent.notify(uI,{predicate:n,column:s}),n.predicate.predicates.length?l.where(n.predicate):o.renderEmpty=!0,o.options.column.columnData=t,o.infiniteRenderMod?(o.infiniteInitialLoad=!!je(o.fullData),o.makeInfiniteScrollRequest(l),l.requiresCount()):l.take(i.filterChoiceCount),o.search(i,l)}):(o.infiniteRenderMod&&o.parent.filterSettings.itemsCount?(o.infiniteInitialLoad=!!je(o.fullData),o.makeInfiniteScrollRequest(a),a.requiresCount()):a.take(i.filterChoiceCount),o.search(i,a))})},F_.prototype.search=function(e,t){this.parent.dataSource&&"result"in this.parent.dataSource?this.filterEvent(e,t):this.processSearch(t)},F_.prototype.getPredicateFromCols=function(e,t){for(var i=F_.getPredicate(e,t),n=[],o={},r=void 0!==this.parent.getForeignKeyColumns,s=r?this.parent.getForeignKeyColumns():[],a=0,l=Object.keys(i);a<l.length;a++){var h=l[a],d=void 0;(d=r&&!this.parent.getColumnByField(h)?MB(h,s):d)?(this.parent.notify(uI,{predicate:o,column:d}),o.predicate.predicates.length&&n.push(ba.or(o.predicate.predicates))):n.push(i[""+h])}return n.length&&ba.and(n)},F_.prototype.getQuery=function(){return this.parent.getQuery?this.parent.getQuery().clone():new ya},F_.prototype.getAllData=function(){var t=this,i=(this.customQuery=!1,this.getQuery()),e=this.options.dataManager.adaptor.getModuleName,e=(!je(this.parent.getDataModule)&&e&&"ODataV4Adaptor"===e()||i.requiresCount(),this.addDistinct(i),{requestType:V1,query:i,filterChoiceCount:null});(e.filterModel=this).infiniteRenderMod&&this.parent.filterSettings.itemsCount&&(e.filterChoiceCount=this.parent.filterSettings.itemsCount),this.parent.trigger(WA,e,function(e){e.filterChoiceCount=je(e.filterChoiceCount)?1e3:e.filterChoiceCount,t.infiniteRenderMod&&t.parent.filterSettings.itemsCount!==e.filterChoiceCount&&(t.parent.filterSettings.itemsCount=e.filterChoiceCount),t.infiniteRenderMod||i.take(e.filterChoiceCount),e.query.distincts.length&&!t.infiniteRenderMod||(t.customQuery=!0,t.queryGenerate(i)),t.infiniteRenderMod&&(t.infiniteInitialLoad=!!je(t.fullData),t.makeInfiniteScrollRequest(i)),t.parent.dataSource&&"result"in t.parent.dataSource?t.filterEvent(e,i):t.processDataOperation(i,!0)})},F_.prototype.addDistinct=function(e){var i=this,t=Sa.distinct(this.options.filteredColumns,"field"),n=(t.indexOf(this.options.column.field)<=-1&&(t=t.concat(this.options.column.field)),this.options.dataManager.adaptor.getModuleName);if(n&&"ODataV4Adaptor"===n()&&this.parent&&this.parent.query instanceof ya)for(var o=this.parent.query,r=0;r<o.queries.length;r++){var s=o.queries[parseInt(r.toString(),10)];"onWhere"===s.fn&&(this.getPredicateFields(s.e),this.queryFilteredColumn.map(function(e){-1===t.indexOf(e)&&t.push(e)}),this.queryFilteredColumn=[])}return this.infiniteRenderMod||e.distinct(t),this.infiniteRenderMod&&!this.options.isRemote&&""===this.sInput.value?(this.options.dataSource=this.options.dataSource instanceof me?this.options.dataSource:new me(this.options.dataSource),this.infinitePermenantLocalData=this.options.dataSource.dataSource.json.slice(),n=new ya,this.queryGenerate(n),n=new me(this.options.dataSource.dataSource).executeLocal(n),this.options.dataSource.dataSource.json=Sa.distinct(n,this.options.column.field,!0),this.isForeignColumn(this.options.column)&&(this.options.column.dataSource=this.options.column.dataSource instanceof me?this.options.column.dataSource:new me(this.options.column.dataSource),this.options.dataSource.dataSource.json=this.options.dataSource.dataSource.json.map(function(e,t){return Object.assign({},e,i.options.column.dataSource.dataSource.json[t])}))):this.infiniteRenderMod&&this.options.isRemote&&(e.select(this.options.column.field),e.sortBy(this.options.column.field,"ascending"),n=this.options.dataManager.adaptor.getModuleName)&&n()&&("ODataV4Adaptor"===n()||"WebApiAdaptor"===n()||"CustomDataAdaptor"===n()||"GraphQLAdaptor"===n()||"ODataAdaptor"===n())&&e.distinct(t),e},F_.prototype.getPredicateFields=function(e){var t=this;e.isComplex&&e.predicates?e.predicates.forEach(function(e){Array.isArray(e)?e.forEach(function(e){return t.getPredicateFields(e)}):t.getPredicateFields(e)}):e.field&&!e.isComplex&&this.queryFilteredColumn.indexOf(e.field)<=-1&&(this.queryFilteredColumn=this.queryFilteredColumn.concat(Sa.distinct([e.field],"field")))},F_.prototype.filterEvent=function(e,t){var i=this,e=JB(e,t);this.parent.trigger(yI,e.state),this.addInfiniteScrollEvent(t),e.deffered.promise.then(function(e){i.infiniteDataCount=i.infiniteRenderMod&&!i.infiniteDataCount?e.count:i.infiniteDataCount;e=i.infiniteRenderMod?e.result:e;i.dataSuccess(e)})},F_.prototype.addInfiniteScrollEvent=function(e){this.infiniteRenderMod&&(this.infiniteQuery=e.clone(),this.infiniteInitialLoad?(this.cBox.classList.add("e-checkbox-infinitescroll"),E.add(this.cBox,"scroll",this.infiniteScrollHandler,this),E.add(this.cBox,"mouseup",this.infiniteScrollMouseKeyUpHandler,this),E.add(this.cBox,"mousedown",this.infiniteScrollMouseKeyDownHandler,this)):this.infiniteSearchValChange&&(this.cBox.innerHTML=""))},F_.prototype.infiniteScrollMouseKeyDownHandler=function(){E.remove(this.cBox,"scroll",this.infiniteScrollHandler)},F_.prototype.infiniteScrollMouseKeyUpHandler=function(e){var t=this,i=(E.add(this.cBox,"scroll",this.infiniteScrollHandler,this),this.cBox);1<i.children.length&&(i.scrollTop>=i.scrollHeight-i.offsetHeight||i.scrollTop<=0)&&this.infiniteScrollHandler(),rB.timer=setTimeout(function(){t.clickHandler(e),rB.timer=null},0)},F_.prototype.getShimmerTemplate=function(){return'<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave"></span>'},F_.prototype.showMask=function(){var e,t,i,n,o,r=5,s=this.parent.createElement("div",{id:this.id+this.options.type+"_CheckBoxMaskList",className:"e-checkboxlist e-fields e-infinite-list e-masklist"}),a=(s.style.zIndex="10",this.cBox),l=(this.removeMask(),a&&(t=getComputedStyle(a),i=kF(a),n=a.children.length?parseInt(t.height,10):Math.floor(parseInt(t.height.split("px")[0],10))-5,this.parent.enableAdaptiveUI&&this.infiniteRenderMod&&(s.style.height=n-i+"px",this.dlg.querySelector(".e-dlg-content").style.overflow="hidden"),o=!this.isExcel||a.children.length||this.dlg.classList.contains("e-excelfilter")?getComputedStyle(this.dlg.querySelector(".e-dlg-content")).backgroundColor:"",s.style.cssText="width: "+t.width+"; min-height: "+t.minHeight+"; height: "+n+"px; margin: "+t.margin+"; border-style: "+t.borderStyle+"; border-width: "+t.borderWidth+"; border-color: "+t.borderColor+"; position: absolute; background-color: "+o+";",r=Math.floor(n/i),r=a.children.length>r?a.children.length:r,e=i+"px"),'<div class="e-ftrchk e-mask-ftrchk"><div class="e-checkbox-wrapper"><input class="e-chk-hidden">'+this.getShimmerTemplate()+this.getShimmerTemplate()+"</div></div>");s.innerHTML="",a.children.length||(this.spinner.insertAdjacentHTML("beforebegin",l),this.spinner.parentElement.querySelector(".e-ftrchk.e-mask-ftrchk").style.cssText="width: 100%; height: "+e+";",this.spinner.parentElement.querySelector(".e-checkbox-wrapper").style.width="100%",(h=[].slice.call(this.spinner.parentElement.querySelectorAll(".e-mask:not(.e-mask-checkbox-filter-intent):not(.e-mask-checkbox-filter-span-intent)")))[0].classList.add("e-mask-checkbox-filter-intent"),h[1].classList.add("e-mask-checkbox-filter-span-intent")),this.spinner.insertBefore(s,this.cBox);for(var h,d=0;r&&d<r;d++)s.innerHTML+=l,s.lastElementChild.style.cssText="width: 100%; height: "+e+";",s.lastElementChild.querySelector(".e-checkbox-wrapper").style.width="100%",(h=[].slice.call(s.querySelectorAll(".e-mask:not(.e-mask-checkbox-filter-intent):not(.e-mask-checkbox-filter-span-intent)")))[0].classList.add("e-mask-checkbox-filter-intent"),h[1].classList.add("e-mask-checkbox-filter-span-intent");this.cBox&&(s.scrollTop=this.cBox.scrollTop)},F_.prototype.removeMask=function(){var e=this.dialogObj.element.querySelectorAll(".e-mask-ftrchk");if(e.length)for(var t=0;t<e.length;t++)ue(e[t]);this.dialogObj.element.querySelector(".e-checkboxlist.e-masklist")&&ue(this.dialogObj.element.querySelector(".e-checkboxlist.e-masklist"))},F_.prototype.infiniteScrollHandler=function(){var e=this.cBox;e.scrollTop>=e.scrollHeight-e.offsetHeight&&!this.infiniteQueryExecutionPending&&this.infiniteLoadedElem.length<=this.infiniteSkipCnt+this.parent.filterSettings.itemsCount&&this.cBox.children.length===3*this.parent.filterSettings.itemsCount&&(!this.infiniteDataCount||this.infiniteDataCount>this.infiniteSkipCnt+this.parent.filterSettings.itemsCount)?(this.makeInfiniteScrollRequest(),this.prevInfiniteScrollDirection="down"):e.scrollTop>=e.scrollHeight-e.offsetHeight&&!this.infiniteQueryExecutionPending&&this.infiniteLoadedElem.length>this.infiniteSkipCnt+this.parent.filterSettings.itemsCount&&this.cBox.children.length===3*this.parent.filterSettings.itemsCount?(DF([].slice.call(this.cBox.children).splice(0,this.parent.filterSettings.itemsCount)),this.infiniteSkipCnt+="down"===this.prevInfiniteScrollDirection?this.parent.filterSettings.itemsCount:3*this.parent.filterSettings.itemsCount,eB(this.cBox,this.infiniteLoadedElem.slice(this.infiniteSkipCnt,this.parent.filterSettings.itemsCount+this.infiniteSkipCnt)),this.prevInfiniteScrollDirection="down"):0===e.scrollTop&&!this.infiniteInitialLoad&&!this.infiniteSearchValChange&&this.infiniteSkipCnt&&this.infiniteLoadedElem.length&&this.infiniteLoadedElem.length>3*this.parent.filterSettings.itemsCount&&this.cBox.children.length===3*this.parent.filterSettings.itemsCount?(DF([].slice.call(this.cBox.children).splice(2*this.parent.filterSettings.itemsCount,this.parent.filterSettings.itemsCount)),this.infiniteSkipCnt-="up"===this.prevInfiniteScrollDirection?this.parent.filterSettings.itemsCount:3*this.parent.filterSettings.itemsCount,MF([].slice.call(this.infiniteLoadedElem.slice(this.infiniteSkipCnt,this.infiniteSkipCnt+this.parent.filterSettings.itemsCount)),this.cBox),this.cBox.scrollTop=this.infiniteScrollAppendDiff,this.prevInfiniteScrollDirection="up"):0===e.scrollTop&&!this.infiniteInitialLoad&&!this.infiniteSearchValChange&&this.infiniteSkipCnt&&this.infiniteLoadedElem.length&&this.cBox.children.length<3*this.parent.filterSettings.itemsCount&&(DF([].slice.call(this.cBox.children).splice(2*this.parent.filterSettings.itemsCount,this.infiniteDataCount%this.parent.filterSettings.itemsCount)),this.infiniteSkipCnt=(Math.floor(this.infiniteDataCount/this.parent.filterSettings.itemsCount)-3)*this.parent.filterSettings.itemsCount,MF([].slice.call(this.infiniteLoadedElem.slice(this.infiniteSkipCnt,this.infiniteSkipCnt+this.parent.filterSettings.itemsCount)),this.cBox),this.cBox.scrollTop=this.infiniteScrollAppendDiff,this.prevInfiniteScrollDirection="up")},F_.prototype.makeInfiniteScrollRequest=function(e){var t=this;!this.infiniteInitialLoad&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator?setTimeout(function(){t.infiniteQueryExecutionPending&&t.showMask()},500):this.infiniteInitialLoad||(mA({target:this.spinner,cssClass:this.parent.cssClass||null},this.parent.createElement),kA(this.spinner));if(this.infiniteQuery&&this.infiniteQuery.queries&&this.infiniteQuery.queries.length)for(var i=0;i<this.infiniteQuery.queries.length;i++)"onTake"!==this.infiniteQuery.queries[i].fn&&"onSkip"!==this.infiniteQuery.queries[i].fn||(this.infiniteQuery.queries.splice(i,1),i--);var n=!!e;e=e||this.infiniteQuery,this.infiniteInitialLoad||this.infiniteSearchValChange?this.infiniteSkipCnt=0:this.infiniteSkipCnt+=this.parent.filterSettings.itemsCount,e.skip(this.infiniteSkipCnt),this.infiniteInitialLoad||this.infiniteSearchValChange?(e.take(3*this.parent.filterSettings.itemsCount),this.infiniteSkipCnt+=2*this.parent.filterSettings.itemsCount):e.take(this.parent.filterSettings.itemsCount),n||(this.parent.dataSource&&"result"in this.parent.dataSource?(n={requestType:V1,query:e,filterChoiceCount:null,filterModel:this},this.infiniteRenderMod&&this.parent.filterSettings.itemsCount&&(n.filterChoiceCount=this.parent.filterSettings.itemsCount),this.filterEvent(n,e)):(this.processDataOperation(e),this.infiniteQueryExecutionPending=!0))},F_.prototype.processDataOperation=function(t,e){var i=this,n=(this.options.dataSource=this.options.dataSource instanceof me?this.options.dataSource:new me(this.options.dataSource),[]),o=[];this.isForeignColumn(this.options.column)&&e&&(e="result"in this.options.column.dataSource?new me(this.options.column.dataSource.result):this.options.column.dataSource,this.foreignKeyQuery.params=t.params,n.push(e.executeQuery(this.foreignKeyQuery)),o.push(function(e){return i.foreignKeyData=e})),this.addInfiniteScrollEvent(t),this.infiniteRenderMod&&this.infiniteInitialLoad&&!this.options.isRemote?(e=this.isForeignColumn(this.options.column)?this.options.foreignKeyValue:this.options.column.field,this.options.dataSource.executeQuery((new ya).sortBy(e,Sa.fnAscending)).then(function(e){i.options.dataSource.dataSource.json=e.result,i.executeQueryOperations(t,n,o)})):this.executeQueryOperations(t,n,o)},F_.prototype.executeQueryOperations=function(e,t,i){var n=this,o=(t.push(this.options.dataSource.executeQuery(e)),i.push(this.dataSuccess.bind(this)),0);Promise.all(t).then(function(e){n.infiniteQueryExecutionPending=!n.infiniteRenderMod&&n.infiniteQueryExecutionPending;for(var t=0;t<e.length;t++)n.infiniteDataCount=n.infiniteRenderMod&&!n.infiniteDataCount?e[t].count:n.infiniteDataCount,i[o++](e[parseInt(t.toString(),10)].result)}).catch(function(){n.infiniteRenderMod&&n.parent.filterSettings&&"Shimmer"===n.parent.filterSettings.loadingIndicator&&n.parent.showMaskRow(void 0,n.dialogObj.element)})},F_.prototype.dataSuccess=function(e){var t,i;!this.infiniteInitialLoad&&this.infiniteDataCount&&(this.infiniteSkipCnt>=this.infiniteDataCount&&!this.infiniteSearchValChange||0===e.length)||(this.fullData=e,e={dataSource:this.fullData,executeQuery:!0,field:this.options.field},this.parent.notify(AT,e),e.executeQuery&&(t=new ya,this.customQuery||(this.isExecuteLocal=!0,this.queryGenerate(t),this.isExecuteLocal=!1),t=new me(e.dataSource).executeLocal(t),i=this.options.column,this.filteredData=F_.getDistinct(t,this.options.field,i,this.foreignKeyData,this).records||[]),t=e.executeQuery?this.filteredData:e.dataSource,this.processDataSource(null,!0,t,e),(this.infiniteRenderMod&&this.infiniteInitialLoad||!this.infiniteRenderMod)&&(this.sInput?this.sInput.focus():this.dlg.querySelector(".e-chk-hidden")&&this.dlg.querySelector(".e-ftrchk")&&(this.dlg.querySelector(".e-chk-hidden").focus(),this.dlg.querySelector(".e-ftrchk").classList.add("e-chkfocus"))),(this.infiniteInitialLoad||this.infiniteSearchValChange)&&(this.infiniteInitialLoad=!1,this.infiniteSearchValChange=!1),((i={requestType:_1,columnName:this.options.field,columnType:this.options.type}).filterModel=this).parent.notify(zI,i),this.isCheckboxFilterTemplate&&BA(this.spinner))},F_.prototype.queryGenerate=function(e){var t;if(this.parent.searchSettings&&this.parent.searchSettings.key.length&&(t=this.options.dataManager.adaptor.getModuleName,!je(this.parent.getDataModule)&&t&&"ODataV4Adaptor"===t()?this.parent.getDataModule().searchQuery(e):(r=(t=this.parent.searchSettings).fields.length?t.fields:this.options.columns.map(function(e){return e.field}),e.search(t.key,r,t.operator,t.ignoreCase,t.ignoreAccent))),this.options.filteredColumns.length){for(var i=[],n=0;n<this.options.filteredColumns.length;n++){var o=this.options.filteredColumns[parseInt(n.toString(),10)];this.options.uid?(o.uid=o.uid||this.parent.getColumnByField(o.field).uid,o.uid!==this.options.uid&&i.push(this.options.filteredColumns[parseInt(n.toString(),10)])):o.field!==this.options.field&&i.push(this.options.filteredColumns[parseInt(n.toString(),10)])}var r=this.getPredicateFromCols(i,this.isExecuteLocal);r&&e.where(r)}},F_.prototype.processDataSource=function(e,t,i,n){kA(this.spinner),this.isExecuteLocal=!0,this.updateResult(),this.isExecuteLocal=!1;var o={dataSource:this.fullData,isCheckboxFilterTemplate:!1,column:this.options.column,element:this.cBox,type:this.options.type,format:this.options.type,btnObj:this.options.isResponsiveFilter?null:this.dialogObj.btnObj[0],searchBox:this.searchBox};this.parent.notify(pE,o),this.isCheckboxFilterTemplate=o.isCheckboxFilterTemplate,this.isCheckboxFilterTemplate?this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&this.removeMask():this.createFilterItems(i,t,n)},F_.prototype.processSearch=function(e){this.processDataOperation(e)},F_.prototype.updateResult=function(){this.result={};var e=this.infiniteRenderMod&&this.existingPredicate[this.options.field]?this.getPredicateFromCols(this.existingPredicate[this.options.field],this.isExecuteLocal):this.getPredicateFromCols(this.options.filteredColumns,this.isExecuteLocal),t=new ya;e&&t.where(e),this.parent.notify(iE,{query:t});for(var i=0,n=new me(this.fullData).executeLocal(t);i<n.length;i++){var o=n[i];this.result[FB(this.options.field,o)]=!0}},F_.prototype.clickHandler=function(e){je(rB.timer)||clearTimeout(rB.timer);var t,i,n,o=e.target;!je(this.parent.loadingIndicator)&&"Shimmer"===this.parent.loadingIndicator.indicatorType&&A(o,"e-mask-ftrchk")||(t=A(o,"e-checkbox-wrapper"),A(o,"e-searchbox")&&this.searchBoxClick(e),t&&!this.isCheckboxFilterTemplate&&((o=t.querySelector(".e-selectall"))?this.updateAllCBoxes(!o.classList.contains("e-check")):(AB(t.parentElement),this.infiniteRenderMod&&!t.parentElement.querySelector(".e-add-current")&&(this.localInfiniteSelectionInteracted=!0,e=this.options.allowCaseSensitive,n=(o=t.parentElement.querySelector(".e-frame").previousSibling).checked?"equal":"notequal",i=o.checked?"or":"and",i={field:this.options.field,predicate:i,uid:this.options.uid,operator:n,type:this.options.type,matchCase:e,ignoreAccent:this.options.ignoreAccent},n=this.values[A(o,"e-ftrchk").getAttribute("uid")],this.updateInfiniteManualSelectPred(i,n),this.infiniteRenderMod&&!this.options.isRemote&&this.options.parentTotalDataCount&&this.infiniteUnloadParentExistPred.length&&(o=this.getPredicateFromCols((e=this.options.filteredColumns).concat.apply(e,this.infiniteManualSelectMaintainPred),!0),i=new ya,o&&i.where(o),n=new me(this.infinitePermenantLocalData).executeLocal(i),this.options.parentTotalDataCount!==n.length&&(this.options.parentTotalDataCount=n.length),!this.options.parentTotalDataCount)&&this.infiniteUnloadParentExistPred.length&&(this.infiniteUnloadParentExistPred=[]),!this.infiniteUnloadParentExistPred.length||this.options.parentTotalDataCount!==this.infiniteDataCount&&this.options.parentTotalDataCount||(this.infiniteUnloadParentExistPred=[]))),this.updateIndeterminatenBtn(),t.querySelector(".e-chk-hidden").focus()),this.setFocus(A(t,"e-ftrchk")))},F_.prototype.updateInfiniteManualSelectPred=function(e,t){for(var i=0;i<this.infiniteManualSelectMaintainPred.length;i++){var n=this.infiniteManualSelectMaintainPred[i];if(n.value+""==t+""&&("equal"===n.operator||"notequal"===n.operator)){this.infiniteManualSelectMaintainPred.splice(i,1);break}}("or"!==e.predicate||this.localInfiniteSelectAllClicked&&this.infiniteLocalSelectAll)&&("and"!==e.predicate||this.localInfiniteSelectAllClicked&&!this.infiniteLocalSelectAll)||(this.infiniteManualSelectMaintainPred.push(Pe({},{value:t},e)),"or"===e.predicate?this.options.parentTotalDataCount++:this.options.parentTotalDataCount--)},F_.prototype.focusNextOrPrev=function(e,t){e="ArrowUp"===e.key?t.indexOf(document.activeElement)-1:t.indexOf(document.activeElement)+1,e=t[(e+t.length)%t.length];e&&(e.focus(),t=e.classList.contains("e-chk-hidden")?A(e,"e-ftrchk"):e,this.setFocus(t))},F_.prototype.keyupHandler=function(e){var t;"Tab"!==e.key&&("ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.altKey)||this.setFocus(A(e.target,"e-ftrchk")),"ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.altKey||!this.parent.filterSettings||"CheckBox"!==this.parent.filterSettings.type||(e.preventDefault(),t=Array.from(this.dlg.querySelectorAll('input, button, [tabindex]:not([tabindex="-1"])')),this.focusNextOrPrev(e,t))},F_.prototype.setFocus=function(e){var t=this.dlg.querySelector(".e-chkfocus");t&&t.classList.remove("e-chkfocus"),e&&e!==t&&e.classList.add("e-chkfocus")},F_.prototype.updateAllCBoxes=function(e){this.infiniteRenderMod&&(this.localInfiniteSelectAllClicked=!0,this.infiniteLocalSelectAll=e,this.infiniteUnloadParentExistPred=[],this.infiniteManualSelectMaintainPred=[]);for(var t=0,i=this.infiniteRenderMod?this.infiniteLoadedElem.map(function(e){return e.querySelector(".e-frame")}):[].slice.call(this.cBox.querySelectorAll(".e-frame:not(.e-add-current)"));t<i.length;t++){var n=i[t];TB(n,e),xB(n.previousSibling,e)}},F_.prototype.dialogOpen=function(){this.parent.element.classList.contains("e-device")&&(this.dialogObj.element.querySelector(".e-input-group").classList.remove("e-input-focus"),this.options.isResponsiveFilter||this.dialogObj.element.querySelector(".e-btn").focus())},F_.prototype.createCheckbox=function(e,t,i){var n=(t?this.cBoxTrue:this.cBoxFalse).cloneNode(!0),t=(xB(n.querySelector("input"),t),n.querySelector(".e-label")),o=NB({},i,{column:this.options.column,parent:this.parent}),r=(t[this.options.disableHtmlEncode?"textContent":"innerHTML"]=!je(e)&&e.toString().length?this.parent.enableHtmlSanitizer?go.sanitize(e):e:this.getLocalizedLabel("Blanks"),$P("cbox"));return t.setAttribute("id",r+"cboxLabel"),n.querySelector("input").setAttribute("aria-labelledby",t.id),t.innerHTML===this.getLocalizedLabel("Blanks")&&(this.isBlanks=!0),"boolean"==typeof e&&(t.innerHTML=!0===e?this.getLocalizedLabel("FilterTrue"):this.getLocalizedLabel("FilterFalse")),U([t],["e-checkboxfiltertext"]),this.options.template&&i[this.options.column.field]!==this.getLocalizedLabel("SelectAll")&&i[this.options.column.field]!==this.getLocalizedLabel("AddCurrentSelection")&&(t.innerHTML="",r=this.parent.isReact&&this.options.column.filter&&"string"!=typeof this.options.column.filter.itemTemplate&&!(this.options.column.filter.itemTemplate.prototype&&this.options.column.filter.itemTemplate.prototype.CSPTemplate),e=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,r||e?(this.options.template(o,this.parent,"filterItemTemplate",null,null,null,t),this.parent.renderTemplates()):eB(t,this.options.template(o,this.parent,"filterItemTemplate",null,null,null,null,this.parent.root))),n},F_.prototype.updateIndeterminatenBtn=function(){var e,t=this.infiniteRenderMod?this.infiniteLoadedElem.length:this.cBox.children.length-1,i=[],n=!1,o=(this.infiniteRenderMod?this.sBox:this.cBox).querySelector(".e-selectall"),r=(this.infiniteRenderMod?this.infiniteLoadedElem.filter(function(e){return e.querySelector(".e-check")}):this.cBox.querySelectorAll(".e-check:not(.e-selectall):not(.e-add-current)")).length,s=(this.cBox.querySelector(".e-add-current")&&--t,this.options.isResponsiveFilter||((e=this.dialogObj.btnObj[0]).disabled=!1),o.previousSibling);xB(s,!1),s.indeterminate=!1,!this.infiniteRenderMod||""!==this.sInput.value||this.options.parentCurrentViewDataCount||this.localInfiniteSelectionInteracted||this.localInfiniteSelectAllClicked&&(this.infiniteLocalSelectAll||r)||t===r&&t!==r?this.infiniteRenderMod&&this.infiniteLoadedElem.length<this.infiniteDataCount&&this.infiniteUnloadParentExistPred.length&&(!r||t===r)&&this.infiniteLocalSelectAll&&(r?t+=this.infiniteUnloadParentExistPred.length:r+=this.infiniteUnloadParentExistPred.length):r=0,t===r?(this.infiniteRenderMod&&(this.infiniteLocalSelectAll=!0,this.localInfiniteSelectAllClicked=!0,this.infiniteManualSelectMaintainPred=[]),i=["e-check"],xB(s,!0)):r?(i=["e-stop"],s.indeterminate=!0):(this.infiniteRenderMod&&(this.infiniteLocalSelectAll=!1,this.localInfiniteSelectAllClicked=!0,this.infiniteManualSelectMaintainPred=[]),i=["e-uncheck"],n=!0,e&&(e.disabled=!0)),e&&(this.filterState=!e.disabled,e.dataBind()),q([o],["e-check","e-stop","e-uncheck"]),U([o],i),this.parent.notify(VT,{disabled:n})},F_.prototype.createFilterItems=function(e,t,i){var n,o=this.parent.createElement("div"),r=!1,s=(this.options.isResponsiveFilter||(n=this.dialogObj.btnObj[0]),-1),a="ejValue";i.executeQuery||(a=i.field);for(var l=0;l<e.length;l++){var h=R(a,e[parseInt(l.toString(),10)]);""!==h&&!je(h)||(s+=1)}if(this.infiniteRenderMod||(this.itemsCnt=-1!==s?e.length-s:e.length),this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&this.removeMask(),e.length&&!this.renderEmpty){for(var d,i=this.getLocalizedLabel("SelectAll"),p=this.cBox.querySelector(".e-checkfltrnmdiv"),i=(p&&p.classList.remove("e-checkfltrnmdiv"),this.createCheckbox(i,!1,((p={})[this.options.field]=i,p))),p=(this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?U([i],this.parent.cssClass.split(" ")):U([i],[this.parent.cssClass])),this.infiniteInitialLoad||!this.infiniteRenderMod?((d=IB($P("cbox"),i,"e-ftrchk")).querySelector(".e-frame").classList.add("e-selectall"),this.infiniteRenderMod?(d.classList.add("e-infinitescroll"),this.parent.enableAdaptiveUI&&(this.spinner.style.height=this.spinner.offsetHeight-kF(this.cBox)+"px"),this.sBox.insertBefore(d,this.spinner)):o.appendChild(d)):this.sBox.querySelector(".e-ftrchk .e-selectall")&&(this.sBox.querySelector(".e-ftrchk .e-selectall").previousSibling.disabled=!1,this.sBox.querySelector(".e-ftrchk .e-selectall").parentElement.classList.remove("e-checkbox-disabled")),new ba("field","equal",this.options.field)),c=(this.options.foreignKeyValue&&(p=p.or("field","equal",this.options.foreignKeyValue)),new me(this.options.filteredColumns).executeLocal((new ya).where(p)).length),u=(this.sInput&&this.sInput.value?(p=this.createCheckbox(this.getLocalizedLabel("AddCurrentSelection"),!1,((i={})[this.options.field]=this.getLocalizedLabel("AddCurrentSelection"),i)),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?U([p],this.parent.cssClass.split(" ")):U([p],[this.parent.cssClass])),this.infiniteRenderMod&&!je(this.sBox.children[2])&&this.sBox.children[2].innerText!==this.getLocalizedLabel("AddCurrentSelection")||!this.infiniteRenderMod?((i=IB($P("cbox"),p,"e-ftrchk")).querySelector(".e-frame").classList.add("e-add-current"),this.infiniteRenderMod?(i.classList.add("e-infinitescroll"),this.sBox.insertBefore(i,this.spinner),y=this.spinner.querySelector(".e-checkboxlist"),p=Math.ceil(i.getBoundingClientRect().height),y.style.height=parseInt(getComputedStyle(y).height.split("px")[0],10)-p+"px",y.style.minHeight=y.style.height):o.appendChild(i)):this.sBox.querySelector(".e-ftrchk .e-add-current")&&(this.sBox.querySelector(".e-ftrchk .e-add-current").previousSibling.disabled=!1,this.sBox.querySelector(".e-ftrchk .e-add-current").parentElement.classList.remove("e-checkbox-disabled"))):this.infiniteRenderMod&&!je(this.sBox.children[2])&&this.sBox.children[2].innerText===this.getLocalizedLabel("AddCurrentSelection")&&(y=this.spinner.querySelector(".e-checkboxlist"),p=Math.ceil(this.sBox.children[2].getBoundingClientRect().height),y.style.height=parseInt(getComputedStyle(y).height.split("px")[0],10)+p+"px",y.style.minHeight=y.style.height,ue(this.sBox.children[2])),void 0),l=0;l<e.length;l++){var g=$P("cbox"),m=(this.values[""+g]=R(a,e[parseInt(l.toString(),10)]),R(this.options.field,e[parseInt(l.toString(),10)])),f={value:m=this.options.formatFn?this.valueFormatter.toView(m,this.options.formatFn):m,column:this.options.column,data:e[parseInt(l.toString(),10)]};if(this.parent.notify(UI,f),""===(m=f.value)||je(m)){if(u)continue;u=!0}this.infiniteRenderMod&&this.updateInfiniteUnLoadedCheckboxExistPred(m,this.infiniteUnloadParentExistPred);f=this.localInfiniteSelectAllClicked?this.createCheckbox(m,this.infiniteLocalSelectAll,R("dataObj",e[l])):this.createCheckbox(m,this.getCheckedState(c,this.values[""+g]),R("dataObj",e[l]));o.appendChild(IB(g,f,"e-ftrchk")),this.infiniteRenderMod&&(o.lastChild.style.height=kF(this.cBox)+"px")}i=this.cBox.scrollTop;!this.infiniteRenderMod||this.infiniteSearchValChange?this.cBox.innerHTML="":this.infiniteRenderMod&&this.cBox.children.length&&DF([].slice.call(this.cBox.children).splice(0,this.parent.filterSettings.itemsCount)),this.infiniteRenderMod&&((p=this.infiniteLoadedElem).push.apply(p,[].slice.call(o.children)),this.itemsCnt=-1!==s?this.infiniteLoadedElem.length-s:this.infiniteLoadedElem.length),this.infiniteUnloadParentExistPred.length&&(this.infiniteLoadedElem.length>=this.infiniteDataCount||!this.options.parentCurrentViewDataCount||this.options.parentTotalDataCount===this.infiniteDataCount&&this.options.parentCurrentViewDataCount)&&(this.infiniteUnloadParentExistPred=[]),eB(this.cBox,[].slice.call(o.children)),this.infiniteRenderMod&&!this.infiniteScrollAppendDiff&&(this.infiniteScrollAppendDiff=Math.round(i-this.cBox.scrollTop)),this.updateIndeterminatenBtn(),r=this.infiniteRenderMod?!(!n||!n.disabled):(n&&(n.disabled=!1),!1)}else o.appendChild(this.parent.createElement("span",{innerHTML:this.getLocalizedLabel("NoResult")})),this.cBox.innerHTML="",this.infiniteRenderMod&&((d=this.sBox.querySelector(".e-ftrchk .e-selectall"))&&(y=d.parentElement.parentElement,d.classList.contains("e-check")?AB(y):d.classList.contains("e-stop")&&(AB(y),d.classList.remove("e-stop"),AB(y)),d.previousSibling.disabled=!0,d.parentElement.classList.add("e-checkbox-disabled")),p=this.sBox.querySelector(".e-ftrchk .e-add-current"))&&(i=p.parentElement.parentElement,p.classList.contains("e-check")&&AB(i),p.previousSibling.disabled=!0,p.parentElement.classList.add("e-checkbox-disabled")),this.cBox.appendChild(this.parent.createElement("div",{className:"e-checkfltrnmdiv"})),eB(this.cBox.children[0],[].slice.call(o.children)),n&&(n.disabled=!0),this.filterState=!(r=!0);n&&e.length&&(this.filterState=!n.disabled,n.dataBind());var y={requestType:V1,dataSource:this.renderEmpty?[]:e};(y.filterModel=this).parent.notify(zI,y),this.parent.notify(VT,{disabled:r}),this.infiniteRenderMod&&this.infiniteInitialLoad&&(this.cBox.style.marginTop="0px"),BA(this.spinner)},F_.prototype.updateInfiniteUnLoadedCheckboxExistPred=function(e,t){for(var i=0;i<t.length;i++){var n,o=t[i],r=o.value instanceof Date?this.valueFormatter.toView(o.value,this.options.formatFn):o.value,s=this.options.column;s.isForeignColumn()&&(n=DB(s,{},r,this.foreignKeyData)[0],e=R(s.foreignKeyField,n)),e!==r||"equal"!==o.operator&&"notequal"!==o.operator||(this.infiniteManualSelectMaintainPred.push(t[i]),t.splice(i,1),i--)}},F_.prototype.getCheckedState=function(e,t){return!this.isFiltered||!e||(e=!(!this.sInput||!this.sInput.value)||this.result[""+t],!this.infiniteRenderMod&&"notequal"===this.options.operator?!e:e)},F_.getDistinct=function(e,t,i,n,o){for(var r=e.length,s=[],a={},l=!(!i||!i.isForeignColumn)&&i.isForeignColumn();r--;){var h,d,p=e[parseInt(r.toString(),10)],c=(i&&"dateonly"===i.type&&"string"==typeof p[""+t]&&p[""+t]&&(c=p[""+t].split(/[^0-9.]/),p[""+t]=new Date(parseInt(c[0],10),parseInt(c[1],10)-1,parseInt(c[2],10))),"string"!=typeof(p=FB(t,p))||je(o)||je(o.parent)||je(o.parent.filterSettings)||je(o.parent.filterSettings.enableCaseSensitivity)?p:p.toLowerCase());c in a||((h={}).ejValue=p,a[""+c]=!0,l&&(d=DB(i,{},p,n)[0],x(mI,d,e[parseInt(r.toString(),10)]),p=R(i.foreignKeyValue,d)),x(t,je(p)?null:p,h),x("dataObj",e[parseInt(r.toString(),10)],h),s.push(h))}return Sa.group(Sa.sort(s,t,Sa.fnAscending),"ejValue")},F_.getPredicate=function(e,t){for(var i,n=Sa.distinct(e,"field",!0)||[],o={},r=0;r<n.length;r++)0!==(i=new me(e).executeLocal((new ya).where("field","equal",n[parseInt(r.toString(),10)].field))).length&&(o[n[parseInt(r.toString(),10)].field]=F_.generatePredicate(i,t));return o},F_.generatePredicate=function(e,t){var i=e?e.length:0,n=F_.updateDateFilter(e[0]);n.ignoreAccent=!je(n.ignoreAccent)&&n.ignoreAccent;for(var o="date"===n.type||"datetime"===n.type||"dateonly"===n.type?PB(n,n.type,t):n.ejpredicate||new ba(n.field,n.operator,n.value,!F_.getCaseValue(n),n.ignoreAccent),r=1;r<i;r++)e[parseInt(r.toString(),10)]=F_.updateDateFilter(e[parseInt(r.toString(),10)]),2<i&&1<r&&("or"===e[r].predicate&&"or"===e[r-1].predicate||"and"===e[r].predicate&&"and"===e[r-1].predicate)?"date"===e[r].type||"datetime"===e[r].type||"dateonly"===e[r].type?o.predicates.push(PB(e[parseInt(r.toString(),10)],e[r].type,t)):o.predicates.push(new ba(e[r].field,e[parseInt(r.toString(),10)].operator,e[parseInt(r.toString(),10)].value,!F_.getCaseValue(e[parseInt(r.toString(),10)]),e[parseInt(r.toString(),10)].ignoreAccent)):o="date"===e[r].type||"datetime"===e[r].type||"dateonly"===e[r].type?"and"===e[parseInt(r.toString(),10)].predicate&&"equal"===e[parseInt(r.toString(),10)].operator?o.or(PB(e[parseInt(r.toString(),10)],e[parseInt(r.toString(),10)].type,t),e[parseInt(r.toString(),10)].type,e[parseInt(r.toString(),10)].ignoreAccent):o[e[parseInt(r.toString(),10)].predicate](PB(e[parseInt(r.toString(),10)],e[parseInt(r.toString(),10)].type,t),e[parseInt(r.toString(),10)].type,e[parseInt(r.toString(),10)].ignoreAccent):e[parseInt(r.toString(),10)].ejpredicate?o[e[parseInt(r.toString(),10)].predicate](e[parseInt(r.toString(),10)].ejpredicate):o[e[parseInt(r.toString(),10)].predicate](e[parseInt(r.toString(),10)].field,e[parseInt(r.toString(),10)].operator,e[parseInt(r.toString(),10)].value,!F_.getCaseValue(e[parseInt(r.toString(),10)]),e[parseInt(r.toString(),10)].ignoreAccent);return o||null},F_.getCaseValue=function(e){return je(e.matchCase)?!("string"===e.type||je(e.type)&&"string"==typeof e.value):e.matchCase},F_.updateDateFilter=function(e){return("date"===e.type||"datetime"===e.type||"dateonly"===e.type||e.value instanceof Date)&&(e.type=e.type||"date"),e};var B_=F_;function F_(e){this.searchInputArgs=null,this.isExecuteLocal=!1,this.queryFilteredColumn=[],this.existingPredicate={},this.foreignKeyQuery=new ya,this.filterState=!0,this.values={},this.renderEmpty=!1,this.isCheckboxFilterTemplate=!1,this.infiniteRenderMod=!1,this.infiniteInitialLoad=!1,this.infiniteSearchValChange=!1,this.infinitePermenantLocalData=[],this.infiniteQueryExecutionPending=!1,this.infiniteSkipCnt=0,this.infiniteScrollAppendDiff=0,this.prevInfiniteScrollDirection="",this.infiniteLoadedElem=[],this.infiniteDataCount=0,this.infiniteLocalSelectAll=!0,this.localInfiniteSelectAllClicked=!1,this.localInfiniteSelectionInteracted=!1,this.infiniteManualSelectMaintainPred=[],this.parent=e,this.id=this.parent.element.id,this.valueFormatter=new v0(this.parent.locale),this.cBoxTrue=kv(this.parent.createElement,!1,{checked:!0,label:" "}),this.cBoxFalse=kv(this.parent.createElement,!1,{checked:!1,label:" "}),this.cBoxTrue.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden",attrs:{type:"checkbox"}}),this.cBoxTrue.firstChild),this.cBoxFalse.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden",attrs:{type:"checkbox"}}),this.cBoxFalse.firstChild),this.cBoxFalse.querySelector(".e-frame").classList.add("e-uncheck"),this.parent.enableRtl&&U([this.cBoxTrue,this.cBoxFalse],["e-rtl"]),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?U([this.cBoxTrue,this.cBoxFalse],this.parent.cssClass.split(" ")):U([this.cBoxTrue,this.cBoxFalse],[this.parent.cssClass]))}var L_="",R_="",O_="",N_=[],V_="";function __(e,t,i,n,o,r,s,a,l){var h;if(r&&""!==L_?L_===R_&&(O_=String.fromCharCode(e)):""!==O_?(L_=O_+String.fromCharCode(e),O_=""):L_+=String.fromCharCode(e),a?(setTimeout(function(){O_=""},700),setTimeout(function(){L_=""},3e3)):setTimeout(function(){L_=""},1e3),L_=n?L_.toLowerCase():L_,V_!==o||R_!==L_||l){var d=t,p=L_.length,c=void 0,u=i=i?i+1:0;for(N_=[];c=d[h=-1===(u=u===d.length?-1:u)?0:u],(n?c.innerText.toLowerCase():c.innerText).substr(0,p)===L_&&N_.push(d[h]),++u!==i;);if(R_=L_,V_=o,a){for(var g=!1,m=0;m<N_.length;m++)if(s&&N_[m].textContent.toLowerCase()===s.toLowerCase()){h=m,g=!0;break}return s&&g&&(h+=1),N_[h]||N_[0]}return N_[0]}for(var u=0;u<N_.length;u++){if(N_[u].classList.contains("e-active")){h=u;break}if(s&&N_[u].textContent.toLowerCase()===s.toLowerCase()){h=u;break}}return h+=1,a?N_[h]&&N_.length-1!==h?N_[h]:N_[N_.length]:N_[h]||N_[0]}function H_(e,s,a,l,h,d,p,c){var t=s,u=(l=null==l||l,{item:null,index:null});if(e&&e.length)for(var g=e.length,m=z_(m=l?e.toLocaleLowerCase():e),i=0,n=t;i<n.length;i++){var o=function(e,t){var i,n,o,t=t[e],r=(s&&h&&(n=t,o=d.text.split("."),h.filter(function(t){Array.prototype.slice.call(o).forEach(function(e){("object"===p&&!t.isHeader&&-1!==n.textContent.toString().indexOf(t[e])&&n.getAttribute("data-value")===t[d.value].toString()||"string"===p&&-1!==n.textContent.toString().indexOf(t))&&(i="object"===p?t[e]:t)})})),(h&&i?l?i.toString().toLocaleLowerCase():i:l?t.textContent.toLocaleLowerCase():t.textContent).replace(/^\s+|\s+$/g,""));if(c&&r&&m&&(r=r.normalize("NFD").replace(/[\u0300-\u036f]/g,""),m=m.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),"Equal"===a&&r===m||"StartsWith"===a&&r.substr(0,g)===m||"EndsWith"===a&&r.substr(r.length-m.length)===m||"Contains"===a&&new RegExp(m,"g").test(r))return{value:{item:u.item=t,index:u.index=e}}}(i,n);if("object"==typeof o)return o.value}return u}function z_(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function j_(e){V_===e&&(L_=R_=V_="",N_=[])}function W_(e,t,i,n){/<[^>]*>/g.test(e.innerText)&&(e.innerText=e.innerText.replace(/[\u00A0-\u9999<>&]/g,function(e){return"&#"+e.charCodeAt(0)+";"})),""!==t&&(i=i?"gim":"gm",t=/^[a-zA-Z0-9- ]*$/.test(t)?t:t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),function e(t,i){for(var n=0;t.childNodes&&n<t.childNodes.length;n++){if(3===t.childNodes[n].nodeType&&""!==t.childNodes[n].textContent.trim()){var o=t.childNodes[n].nodeValue.trim().replace(i,'<span class="e-highlight">$1</span>');t.childNodes[n].nodeValue="",t.innerHTML=t.innerHTML.trim()+o;break}e(t.childNodes[n],i)}}(e,new RegExp("StartsWith"===n?"^("+t+")":"EndsWith"===n?"("+t+")$":"("+t+")",i)))}function Q_(e){for(var t=e.querySelectorAll(".e-highlight"),i=t.length-1;0<=i;i--){var n=t[i].parentNode,o=document.createTextNode(t[i].textContent);n.replaceChild(o,t[i])}}var U_=function(){return(U_=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},q_=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},G_=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},$V=(Y_.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("observe",this.observe,this),this.parent.on("setGeneratedData",this.setGeneratedData,this),this.parent.on("dataProcessAsync",this.dataProcessAsync,this),this.parent.on("setCurrentViewDataAsync",this.setCurrentViewDataAsync,this),this.parent.on("bindScrollEvent",this.bindScrollEvent,this))},Y_.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("observe",this.observe),this.parent.off("setGeneratedData",this.setGeneratedData),this.parent.off("dataProcessAsync",this.dataProcessAsync),this.parent.off("setCurrentViewDataAsync",this.setCurrentViewDataAsync),this.parent.off("bindScrollEvent",this.bindScrollEvent))},Y_.prototype.bindScrollEvent=function(e){var t=this;this.component=e.component,this.observe(function(e){return t.scrollListener(e)})},Y_.prototype.observe=function(e){this.containerElementRect=this.parent.popupContentElement.getBoundingClientRect(),E.add(this.parent.popupContentElement,"wheel mousedown",this.popupScrollHandler,this),this.touchModule=new Mn(this.parent.popupContentElement,{scroll:this.popupScrollHandler.bind(this)}),E.add(this.parent.popupContentElement,"scroll",this.virtualScrollHandler(e),this)},Y_.prototype.getModuleName=function(){return"VirtualScroll"},Y_.prototype.popupScrollHandler=function(){this.parent.isMouseScrollAction=!0,this.parent.isPreventScrollAction=!1},Y_.prototype.getPageQuery=function(e,t,i){return e=0===i||this.parent.allowFiltering||"autocomplete"===this.component?e:e.skip(t)},Y_.prototype.setGeneratedData=function(e,t){for(var i,n=0,o=this.parent.listData.length+this.parent.virtualItemStartIndex,r=this.parent.virtualItemStartIndex;r<o;r++)this.parent.generatedDataObject[r]||null!==t&&0<this.parent.listData.slice(n,n+1).length&&0<(i=this.parent.listData.slice(n,n+1)).length&&(this.parent.generatedDataObject[r]=i),n++},Y_.prototype.generateAndExecuteQueryAsync=function(e,t,i,n){void 0===t&&(t=0),void 0===i&&(i=0);var o=this.parent.dataSource,n=((n=void 0===n?!1:n)||(e=je(this.parent.query)?this.getPageQuery(e,t,i):(n=this.removeSkipAndTakeEvents(this.parent.query.clone()),this.getPageQuery(n,t,i))),this.parent.isCustomFilter);"combobox"===this.component&&(t=0,this.parent.dataSource instanceof me?t=this.parent.dataSource.dataSource.json.length:this.parent.dataSource&&0<this.parent.dataSource.length&&(t=this.parent.dataSource.length),0<t)&&(this.parent.isCustomFilter=t===this.parent.totalItemCount&&this.parent.queryString!==this.parent.typedString||this.parent.isCustomFilter),this.parent.resetList(o,this.parent.fields,e),this.parent.isCustomFilter=n},Y_.prototype.removeSkipAndTakeEvents=function(e){return e.queries=e.queries.filter(function(e){return"onSkip"!==e.fn&&"onTake"!==e.fn}),e},Y_.prototype.setCurrentViewDataAsync=function(e){var t=[],i=!1,n=!0,o=(je(this.component)&&(this.component=e.component),this.parent.viewPortInfo.endIndex);if("multiselect"===this.component&&"CheckBox"===this.parent.mode&&this.parent.value&&Array.isArray(this.parent.value)&&0<this.parent.value.length&&this.parent.enableSelectionOrder&&""===this.parent.targetElement().trim()&&(this.parent.viewPortInfo.startIndex<this.parent.value.length?(o=this.parent.viewPortInfo.endIndex-this.parent.value.length,0===this.parent.viewPortInfo.startIndex?(this.parent.updateVirtualReOrderList(!0),this.parent.value.length<this.parent.itemCount&&this.parent.value.length!==this.parent.totalItemCount?((s=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(s),d=(d=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,d),n=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof me&&this.parent.appendUncheckList,n=!1):(s=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(s),n=!1):0!==this.parent.viewPortInfo.startIndex&&(this.parent.updateVirtualReOrderList(!0),(s=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(s),n=!1),0!==this.parent.viewPortInfo.startIndex&&this.parent.viewPortInfo.startIndex-this.parent.value.length!==this.parent.itemCount&&this.parent.viewPortInfo.startIndex+this.parent.itemCount>this.parent.value.length&&(d=(d=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,d),n=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof me&&this.parent.appendUncheckList)):(e=this.parent.list.querySelectorAll(".e-reorder")[0],this.parent.list.querySelector(".e-virtual-ddl-content")&&e&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(e),d=this.parent.getForQuery(this.parent.value).clone(),e=0<=this.parent.viewPortInfo.startIndex-this.parent.value.length?this.parent.viewPortInfo.startIndex-this.parent.value.length:0,d=d.skip(e),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,d),n=!1),this.parent.totalItemsCount()),n)for(var r=this.parent.viewPortInfo.startIndex;r<o;r++){var s,a=r,l=("multiselect"===this.component&&"CheckBox"===this.parent.mode&&(s=this.parent.list.querySelector(".e-list-parent.e-reorder"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(s),this.parent.generatedDataObject[a]);if("multiselect"===this.component&&this.parent.hideSelectedItem){if(l){var h=R(this.parent.fields.value,l[0]);if(this.parent.value&&null!==h&&Array.isArray(this.parent.value)&&0<this.parent.value.length&&this.parent.value.indexOf(h)<0){var d=this.parent.getForQuery(this.parent.value).clone();d=this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?d.skip(this.parent.totalItemCount-this.parent.itemCount):d.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,d),i=!0;break}(null===this.parent.value||this.parent.value&&0===this.parent.value.length)&&t.push(l[0])}a===o-1&&t.length!==this.parent.itemCount&&this.parent.hideSelectedItem&&(d=this.parent.value&&0<this.parent.value.length?this.parent.getForQuery(this.parent.value).clone():new ya,d=this.parent.value&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?d.skip(this.parent.totalItemCount-this.parent.itemCount):d.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,d),i=!0)}else l&&t.push(l[0]);this.parent.setCurrentView=!1}!i&&n&&("multiselect"===this.component&&this.parent.allowCustomValue&&0===this.parent.viewPortInfo.startIndex&&this.parent.virtualCustomData&&t.splice(0,0,this.parent.virtualCustomData),"multiselect"===this.component&&this.parent.allowCustomValue&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount&&this.parent.virtualCustomSelectData&&0<this.parent.virtualCustomSelectData.length&&(t=t.concat(this.parent.virtualCustomSelectData)),this.parent.renderItems(t,this.parent.fields,"multiselect"===this.component&&"CheckBox"===this.parent.mode)),"multiselect"===this.component&&(this.parent.updatevirtualizationList(),this.parent.checkMaxSelection()),this.parent.getSkeletonCount(),this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof me)||this.parent.dataSource instanceof me&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount;e=this.parent.list.getElementsByClassName("e-virtual-ddl")[0],e?e.style=this.parent.GetVirtualTrackHeight():!e&&0<this.parent.skeletonCount&&this.parent.popupWrapper&&(n=this.parent.createElement("div",{id:this.parent.element.id+"_popup",className:"e-virtual-ddl",styles:this.parent.GetVirtualTrackHeight()}),this.parent.popupWrapper.querySelector(".e-dropdownbase").appendChild(n)),this.parent.UpdateSkeleton(),this.parent.liCollections=this.parent.list.querySelectorAll(".e-list-item"),e=this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0];e&&(e.style=this.parent.getTransformValues()),this.parent.fields.groupBy&&this.parent.scrollStop(),40===this.parent.keyCode&&this.parent.isScrollChanged&&this.parent.hideSelectedItem&&!je(this.parent.currentFocuedListElement)&&(n=this.parent.getElementByValue(this.parent.currentFocuedListElement.getAttribute("data-value")),this.parent.addListFocus(n),this.parent.isScrollChanged=!1)},Y_.prototype.generateQueryAndSetQueryIndexAsync=function(e,t){var i=!1,n=0,o=0,r=this.parent.viewPortInfo.endIndex;if(!t&&0!==r)for(var s=this.parent.viewPortInfo.startIndex;s<=r;s++)s in this.parent.generatedDataObject||(i?o=s===r?s:s+1:(i=!0,n=o=s));!i||this.parent.totalItemCount===n&&this.parent.totalItemCount===o||(this.parent.virtualItemStartIndex=n,this.parent.virtualItemEndIndex=o,this.parent.setCurrentView=!0,this.generateAndExecuteQueryAsync(e,n,o),"multiselect"===this.component&&this.parent.hideSelectedItem&&this.parent.value&&Array.isArray(this.parent.value)&&0<this.parent.value.length&&this.parent.totalItemsCount(),"multiselect"===this.component&&this.parent.virtualItemStartIndex===this.parent.virtualItemEndIndex&&(this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex)),this.parent.dataSource instanceof me&&(!(this.parent.dataSource instanceof me)||this.parent.isRequesting)||this.setCurrentViewDataAsync()},Y_.prototype.dataProcessAsync=function(e){this.parent.selectedValueInfo=null,this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex,this.generateQueryAndSetQueryIndexAsync(new ya,e)},Y_.prototype.virtualScrollRefreshAsync=function(){return q_(this,void 0,void 0,function(){return G_(this,function(e){switch(e.label){case 0:return this.parent.isCustomFilter=!(this.parent.isTyped||"combobox"===this.component&&this.parent.allowFiltering&&this.parent.queryString!==this.parent.typedString||!je(this.parent.filterInput)&&!je(this.parent.filterInput.value)&&""!==this.parent.filterInput.value&&"combobox"!==this.component)&&!("autocomplete"===this.component&&null!=this.parent.value)||this.parent.isCustomFilter,!this.parent.allowFiltering&&"autocomplete"!==this.component||(je(this.parent.typedString)||"combobox"===this.component&&!je(this.parent.typedString)&&this.parent.allowFiltering?(this.parent.getSkeletonCount(!0),"combobox"===this.component&&(this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof me)||this.parent.dataSource instanceof me&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount)):(this.parent.viewPortInfo.endIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.endIndex=this.parent.dataCount),this.parent.viewPortInfo.startIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.startIndex=this.parent.dataCount-this.parent.itemCount))),[4,this.dataProcessAsync()];case 1:return e.sent(),null==this.parent.keyboardEvent||this.parent.dataSource instanceof me&&(!(this.parent.dataSource instanceof me)||this.parent.isRequesting)||this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent,this.parent.pageCount),this.parent.customFilterQuery||(this.parent.isCustomFilter=!1),[2]}})})},Y_.prototype.scrollListener=function(e){var t,i,n=this;this.parent.isPreventScrollAction||this.parent.isVirtualTrackHeight||(this.parent.preventSetCurrentData=!1,t=e.sentinel,i=this.parent.previousStartIndex,this.parent.viewPortInfo=this.getInfoFromView(e.direction,t,e.offset,!1),this.parent.isUpwardScrolling=!1,this.parent.previousStartIndex===i||this.parent.isKeyBoardAction?this.parent.isScrollActionTriggered&&(this.parent.isPreventKeyAction=!1,this.parent.isScrollActionTriggered=!1,this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.parent.getTransformValues()):(this.parent.isScrollActionTriggered=!1,this.parent.currentPageNumber=this.parent.viewPortInfo.currentPageNumber,this.parent.virtualListInfo=U_({},this.parent.viewPortInfo),this.parent.isPreventKeyAction=!0,this.parent.isVirtualScrolling=!0,setTimeout(function(){n.parent.pageCount=n.parent.getPageCount(),n.virtualScrollRefreshAsync().then(function(){n.parent.popupObj&&(n.parent.list=n.parent.popupObj.element.querySelector(".e-content")||ge(".e-content"),n.parent.updateSelectionList(),n.parent.liCollections=n.parent.getItems()),n.parent.isKeyBoardAction=!1,n.parent.isVirtualScrolling=!1,n.parent.isPreventKeyAction=!1})},5)),this.parent.previousInfo=this.parent.viewPortInfo)},Y_.prototype.getInfoFromView=function(e,t,i,n){var o,r,e={direction:e,sentinelInfo:t,offsets:i,startIndex:this.parent.previousStartIndex,endIndex:this.parent.previousEndIndex},t=this.parent.popupContentElement?this.parent.popupContentElement.getBoundingClientRect().height:0,s=this.parent.listItemHeight,i=i.top/s,t=t/s,a=i+t,l=this.parent.virtualItemCount/4,h=this.parent.totalItemCount;return"down"===e.direction?(r=Math.round(a)-Math.round(l),(je(e.startIndex)||a>e.startIndex+Math.round(this.parent.virtualItemCount/2+l)&&e.endIndex!==h)&&(e.startIndex=0<=r?Math.round(r):0,e.startIndex=e.startIndex>i?Math.floor(i):e.startIndex,o=e.startIndex+this.parent.virtualItemCount,e.startIndex=o<a?Math.ceil(a)-this.parent.virtualItemCount:e.startIndex,e.endIndex=o<h?o:h,e.startIndex=h<=o?0<e.endIndex-this.parent.virtualItemCount?e.endIndex-this.parent.virtualItemCount:0:e.startIndex,e.currentPageNumber=Math.ceil(e.endIndex/this.parent.virtualItemCount))):"up"===e.direction&&(e.startIndex&&e.endIndex||Math.ceil(i)>this.parent.previousStartIndex)&&(i<Math.round((e.startIndex*s+l*s)/s)||Math.ceil(i)>this.parent.previousStartIndex)&&(o=Math.round(i+(t<l?l:t+t/4)),e.endIndex=o<h?o:h,r=e.endIndex-this.parent.virtualItemCount,e.startIndex=0<r?r:0,e.endIndex=r<0?this.parent.virtualItemCount:e.endIndex,e.currentPageNumber=Math.ceil(e.startIndex/this.parent.virtualItemCount)),n?this.parent.scrollPreStartIndex=e.startIndex:(this.parent.previousStartIndex=e.startIndex,this.parent.startIndex=e.startIndex,this.parent.previousEndIndex=e.endIndex),e},Y_.prototype.virtualScrollHandler=function(e){var s=this,t="chrome"===F.info.name?200:100,a=0,l=P(e,t),h=P(e,50);return function(e){var t=e.target.scrollTop,e=e.target.scrollLeft,i=a<t&&!s.parent.isUpwardScrolling?"down":"up",n=(a=t,s.sentinelInfo[i]),o=s.parent.scrollPreStartIndex,r={top:t,left:e},r=(s.parent.list&&0<s.parent.list.querySelectorAll(".e-virtual-list").length&&(s.getInfoFromView(i,n,r,!0),s.parent.scrollPreStartIndex===o||s.parent.isPreventScrollAction||(s.parent.isScrollActionTriggered=!0,s.parent.list.querySelector(".e-virtual-ddl-content").style.transform="translate(0px,"+t+"px)")),l);(r="X"===n.axis?h:r)({direction:i,sentinel:n,offset:{top:t,left:e},focusElement:document.activeElement})}},Y_.prototype.destroy=function(){this.removeEventListener()},Y_);function Y_(e){var n=this;this.sentinelInfo={up:{check:function(e,t){e=e.top-n.containerElementRect.top;return t.entered=0<=e,0<=e+n.parent.listItemHeight*n.parent.virtualItemCount/2},axis:"Y"},down:{check:function(e,t){var i=e.bottom;return t.entered=e.bottom<=n.containerElementRect.bottom,i-n.parent.listItemHeight*n.parent.virtualItemCount/2<=n.parent.listItemHeight*n.parent.virtualItemCount/2},axis:"Y"}},this.parent=e,this.removeEventListener(),this.addEventListener()}var X_,K_,J_,Z_,$_={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 eH(e,t,i,n,o){return mH(e,tH(e,t,i,n,o),null,n)}function tH(e,t,i,n,o){for(var r,s,a=[],l=Pe({},Z_,n),h=($_=cH(l.moduleName),dH()),d=0;d<t.length;d++)je(t[d])||(r=void 0,l.itemCreating&&"function"==typeof l.itemCreating&&(s={dataSource:t,curData:t[d],text:t[d],options:l},l.itemCreating(s)),r=i?pH(e,t[d],void 0,null,null,[],null,h,d,n):gH(e,t[d],void 0,null,null,n,o),l.itemCreated&&"function"==typeof l.itemCreated&&(s={dataSource:t,curData:t[d],text:t[d],item:r,options:l},l.itemCreated(s)),a.push(r));return a}function iH(e,t,i,n,o,r){var s,a,l=Pe({},Z_,i),h=($_=cH(l.moduleName),!r||"listview"!==r.getModuleName()&&"multiselect"!==r.getModuleName()?Pe({},K_.defaultMappedFields,l.fields):l.fields),d=Pe({},J_,l.ariaAttributes),p=[],c=(n&&(d.level=n),[]);t&&t.length&&!je(aH(t).item)&&!Object.prototype.hasOwnProperty.call(aH(t).item,h.id)&&(s=dH());for(var u=0;u<t.length;u++){var g,m,f,y,v,b,w,C,S,A,x=fH(t[u],h);je(t[u])||(l.itemCreating&&"function"==typeof l.itemCreating&&(A={dataSource:t,curData:t[u],text:x[h.text],options:l,fields:h},l.itemCreating(A)),f=t[u],l.itemCreating&&"function"==typeof l.itemCreating&&(x=fH(t[u],h)),Object.prototype.hasOwnProperty.call(x,h.id)&&!je(x[h.id])&&(s=x[h.id]),S=[],l.showCheckBox&&(l.itemNavigable&&(x[h.url]||x[h.urlAttributes])?p:S).push(e("input",{className:$_.check,attrs:{type:"checkbox"}})),!0===o?(l.showIcon&&Object.prototype.hasOwnProperty.call(x,h.iconCss)&&!je(x[h.iconCss])&&S.push(e("span",{className:$_.icon+" "+x[h.iconCss]})),a=(m=pH(e,f,x,h,l.itemClass,S,!(!Object.prototype.hasOwnProperty.call(f,"isHeader")||!f.isHeader),s,u,i)).querySelector("."+$_.anchorWrap),Object.prototype.hasOwnProperty.call(x,h.tooltip)&&(g=x[h.tooltip],i&&i.enableHtmlSanitizer?g=go.sanitize(g):(g=e("span",{innerHTML:g}).innerText,0),m.setAttribute("title",g)),l.itemNavigable&&p.length&&lt(p,m.firstElementChild)):((m=gH(e,f,x,h,l.itemClass,i,r)).classList.add($_.level+"-"+d.level),m.setAttribute("aria-level",d.level.toString()),"presentation"!==d.groupItemRole&&"presentation"!==d.itemRole||m.removeAttribute("aria-level"),a=m.querySelector("."+$_.anchorWrap),Object.prototype.hasOwnProperty.call(x,h.tooltip)&&(g=x[h.tooltip],i&&i.enableHtmlSanitizer?g=go.sanitize(g):(g=e("span",{innerHTML:g}).innerText,0),m.setAttribute("title",g)),Object.prototype.hasOwnProperty.call(x,h.htmlAttributes)&&x[h.htmlAttributes]&&("class"in(f=x[h.htmlAttributes])&&"string"==typeof f.class&&""===f.class.trim()&&delete f.class,lH(m,f)),Object.prototype.hasOwnProperty.call(x,h.enabled)&&!1===x[h.enabled]&&m.classList.add($_.disabled),Object.prototype.hasOwnProperty.call(x,h.isVisible)&&!1===x[h.isVisible]&&(m.style.display="none"),!Object.prototype.hasOwnProperty.call(x,h.imageUrl)||je(x[h.imageUrl])||l.template||(I(f={src:x[h.imageUrl],alt:je(x.name)?"Displaying Image":"Displaying "+x.name+" Image"},x[h.imageAttributes]),f=e("img",{className:$_.image,attrs:f}),a?a.insertAdjacentElement("afterbegin",f):lt([f],m.firstElementChild)),l.showIcon&&Object.prototype.hasOwnProperty.call(x,h.iconCss)&&!je(x[h.iconCss])&&!l.template&&(f=e("div",{className:$_.icon+" "+x[h.iconCss]}),a?a.insertAdjacentElement("afterbegin",f):lt([f],m.firstElementChild)),S.length&&lt(S,m.firstElementChild),l.itemNavigable&&p.length&&lt(p,m.firstElementChild),C=w=b=v=y=S=f=void 0,f=e,S=x,y=h,v=l,b=m,w=d.level,C=S[y.child]||[],S=S[y.hasChildren],C.length&&(S=!0,b.classList.add($_.hasChild),v.processSubChild)&&(y=nH(f,C,v,++w),b.appendChild(y)),v.expandCollapse&&S&&!v.template&&(b.firstElementChild.classList.add($_.iconWrapper),("Left"===v.expandIconPosition?lt:ht)([f("div",{className:"e-icons "+v.expandIconClass})],b.querySelector("."+$_.textContent)))),a&&U([m],[$_.navigable]),l.itemCreated&&"function"==typeof l.itemCreated&&(A={dataSource:t,curData:t[u],text:x[h.text],item:m,options:l,fields:h},l.itemCreated(A)),p=[],c.push(m))}return c}function nH(e,t,i,n,o,r){var s=Pe({},Z_,i);return mH(e,iH(e,t,i,n,o,r),s.listClass,i)}function oH(e,t){if(t&&e)return Array.prototype.slice.call(t).indexOf(e)}function rH(e,t,i){if(void 0===i&&(i=new ya),"Ascending"===e)i.sortBy(t,"ascending",!0);else if("Descending"===e)i.sortBy(t,"descending",!0);else for(var n=0;n<i.queries.length;n++)"onSortBy"===i.queries[n].fn&&i.queries.splice(n,1);return i}function sH(e,t){return new me(e).executeLocal(t)}function aH(e){for(var t={typeof:null,item:null},i=0;i<e.length;i++)if(!je(e[i]))return{typeof:typeof e[i],item:e[i]};return t}function lH(e,t){var i={};I(i,t),i.class&&(U([e],i.class.split(" ")),delete i.class),pt(e,i)}function hH(e){for(var t={},i=e.attributes,n=0;n<i.length;n++)t[i[n].nodeName]=i[n].nodeValue;return t}function dH(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function pH(e,t,i,n,o,r,s,a,l,h){var d,p=Pe({},Z_,h),c=Pe({},J_,p.ariaAttributes),u=t,g=t,l=("string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t&&(d=t,u="boolean"==typeof i[n.text]||"number"==typeof i[n.text]?i[n.text]:i[n.text]||"",g=i[n.value]),t=je(d)||je(i[n.id])||""===i[n.id]?a+"-"+l:a,e("li",{className:(!0===s?$_.group:$_.li)+" "+(je(o)?"":o),id:t,attrs:""!==c.groupItemRole&&""!==c.itemRole?{role:!0===s?c.groupItemRole:c.itemRole}:{}}));return d&&Object.prototype.hasOwnProperty.call(i,n.enabled)&&"false"===i[n.enabled].toString()&&l.classList.add($_.disabled),h&&h.enableHtmlSanitizer&&(u=go.sanitize(u)),s?l.innerText=u:(l.setAttribute("data-value",je(g)?"null":g),l.setAttribute("role","option"),d&&Object.prototype.hasOwnProperty.call(i,n.htmlAttributes)&&i[n.htmlAttributes]&&lH(l,i[n.htmlAttributes]),r.length&&!p.itemNavigable&&ht(r,l),d&&(i[n.url]||i[n.urlAttributes]&&i[n.urlAttributes].href)?l.appendChild(uH(e,d,n,u,r,p.itemNavigable)):(r.length&&p.itemNavigable&&ht(r,l),l.appendChild(document.createTextNode(u)))),l}function cH(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 uH(e,t,i,n,o,r){var s,t=fH(t,i),a={href:t[i.url]};return Object.prototype.hasOwnProperty.call(t,i.urlAttributes)&&t[i.urlAttributes]&&(I(a,t[i.urlAttributes]),a.href=t[i.url]||t[i.urlAttributes].href),r?(s=e("a",{className:$_.text+" "+$_.url}),t=e("div",{className:$_.anchorWrap}),o&&o.length&&ht(o,t),t.appendChild(document.createTextNode(n)),ht([t],s)):s=e("a",{className:$_.text+" "+$_.url,innerHTML:n}),lH(s,a),s}function gH(e,t,i,n,o,r,s){var a,l,h,d,p,c=Pe({},Z_,r),u=Pe({},J_,c.ariaAttributes),g=t,o=("string"!=typeof t&&"number"!=typeof t&&(a=t,g=i[n.text]||"",d=je(i._id)?i[n.id]:i._id,p=!(!Object.prototype.hasOwnProperty.call(t,"isHeader")||!t.isHeader)),r&&r.enableHtmlSanitizer&&(g=go.sanitize(g)),e("li",{className:(!0===p?$_.group:$_.li)+" "+(je(o)?"":o),attrs:""!==u.groupItemRole&&""!==u.itemRole?{role:!0===p?u.groupItemRole:u.itemRole}:{}}));return!0==!je(d)?o.setAttribute("data-uid",d):o.setAttribute("data-uid",dH()),p&&r&&r.groupTemplate?(l=yH(r.groupTemplate),s&&"listview"!==s.getModuleName()?(h=l(t,s,"groupTemplate",c.groupTemplateID,!!c.isStringTemplate,null,o))&&ht(h,o):ht(l(t,s,"groupTemplate",c.groupTemplateID,!!c.isStringTemplate),o)):!p&&r&&r.template?(l=yH(r.template),s&&"listview"!==s.getModuleName()?(h=l(t,s,"template",c.templateID,!!c.isStringTemplate,null,o))&&ht(h,o):ht(l(t,s,"template",c.templateID,!!c.isStringTemplate),o)):(d=e("div",{className:$_.textContent,attrs:""!==u.wrapperRole?{role:u.wrapperRole}:{}}),a&&(i[n.url]||i[n.urlAttributes]&&i[n.urlAttributes].href)?d.appendChild(uH(e,a,n,g,null,c.itemNavigable)):(p=e("span",{className:$_.text,attrs:""!==u.itemText?{role:u.itemText}:{}}),r&&r.enableHtmlSanitizer?p.innerText=g:p.innerHTML=g,d.appendChild(p)),o.appendChild(d)),o}function mH(e,t,i,n){var n=Pe({},Z_,n),o=Pe({},J_,n.ariaAttributes),e=e("ul",{className:($_=cH(n.moduleName)).ul+" "+(je(i)?"":i),attrs:""!==o.listRole?{role:o.listRole}:{}});return ht(t,e),e}function fH(e,t){var i={};if(je(e)||"string"==typeof e||"number"==typeof e||!je(e.isHeader))return e;for(var n=0,o=Object.keys(t);n<o.length;n++){var r=t[""+o[n]],s=je(r)||"string"!=typeof r?void 0:R(r,e);je(s)||(i[""+r]=s)}return i}function yH(t){if(t)try{return"function"!=typeof t&&document.querySelector(t)?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){return oo(t)}}(K_=X_=X_||{}).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,sortBy:null},Z_={showCheckBox:!(J_={level:1,listRole:"presentation",itemRole:"presentation",groupItemRole:"group",itemText:"list-item",wrapperRole:"presentation"}),showIcon:!1,enableHtmlSanitizer:!1,expandCollapse:!1,fields:K_.defaultMappedFields,ariaAttributes:J_,listClass:"",itemClass:"",processSubChild:!1,sortOrder:"None",template:null,groupTemplate:null,headerTemplate:null,expandIconClass:"e-icon-collapsible",moduleName:"list",expandIconPosition:"Right",itemNavigable:!1},K_.createList=function(e,t,i,n,o){var r=Pe({},Z_,i),r=Pe({},J_,r.ariaAttributes),s=aH(t).typeof;return"string"===s||"number"===s?eH(e,t,n,i,o):nH(e,t,i,r.level,n,o)},K_.createListFromArray=eH,K_.createListItemFromArray=tH,K_.createListItemFromJson=iH,K_.createListFromJson=nH,K_.getSiblingLI=function(e,t,i){if($_=cH(Z_.moduleName),e&&e.length){for(var n=Array.prototype.slice.call(e),o=t?oH(t,n):!0===i?n.length:-1,r=n[o+(!0===i?-1:1)];r&&(!at(r)||r.classList.contains($_.disabled));)r=n[o+=!0===i?-1:1];return r}},K_.indexOf=oH,K_.groupDataSource=function(e,t,i){void 0===i&&(i="None");var n=Pe({},K_.defaultMappedFields,t),o=sH(e,rH(i,"key",(new ya).group(n.groupBy)));e=[];for(var r=0;r<o.length;r++){var s=o[r].items,a={};a[n.text]=o[r].key,a.isHeader=!0,"id"===n.text&&(a.text=o[r].key),a._id="group-list-item-"+(o[r].key?o[r].key.toString().trim():"undefined"),a.items=s,e.push(a);for(var l=0;l<s.length;l++)e.push(s[l])}return e},K_.addSorting=rH,K_.getDataSource=sH,K_.createJsonFromElement=function e(t,i){var n=Pe({},Z_,i),o=Pe({},K_.defaultMappedFields,n.fields),n=t.cloneNode(!0),r=[],s=(n.classList.add("json-parent"),n.querySelectorAll(".json-parent>li"));n.classList.remove("json-parent");for(var a=0;a<s.length;a++){for(var l=s[a],h=l.querySelector("a"),d=l.querySelector("ul"),p={},c=(h||l).childNodes,u=Object.keys(c),g=0;g<c.length;g++)c[Number(u[g])].hasChildNodes()||(p[o.text]=c[Number(u[g])].textContent);(l=hH(l)).id?(p[o.id]=l.id,delete l.id):p[o.id]=dH(),Object.keys(l).length&&(p[o.htmlAttributes]=l),h&&(l=hH(h),Object.keys(l).length)&&(p[o.urlAttributes]=l),d&&(p[o.child]=e(d,i)),r.push(p)}return r},K_.renderContentTemplate=function(e,t,i,n,o,r){for(var s=e("ul",{className:($_=cH(Z_.moduleName)).ul,attrs:{role:"presentation"}}),a=Pe({},Z_,o),l=Pe({},K_.defaultMappedFields,n),h=yH(t),d=[],p=dH(),c=0;c<i.length;c++){var u,g=fH(i[c],l),m=i[c],f=m.isHeader,y="string"==typeof i[c]||"number"==typeof i[c]?m:g[l.value],v=(a.itemCreating&&"function"==typeof a.itemCreating&&a.itemCreating({dataSource:i,curData:m,text:y,options:a,fields:l}),a.itemCreating&&"function"==typeof a.itemCreating&&(g=fH(i[c],l),y="string"==typeof i[c]||"number"==typeof i[c]?m:g[l.value]),e("li",{id:p+"-"+c,className:f?$_.group:$_.li,attrs:{role:"presentation"}}));f?"string"==typeof i[c]||"number"==typeof i[c]?v.innerText=m:v.innerText=g[l.text]:(g=f?a.groupTemplateID:a.templateID,f?r&&"listview"!==r.getModuleName()?(u=h(m,r,"headerTemplate",g,!!a.isStringTemplate,null,v))&&ht(u,v):ht(h(m,r,"headerTemplate",g,!!a.isStringTemplate),v):r&&"listview"!==r.getModuleName()?(u=h(m,r,"template",g,!!a.isStringTemplate,null,v))&&ht(u,v):ht(h(m,r,"template",g,!!a.isStringTemplate),v),v.setAttribute("data-value",je(y)?"null":y),v.setAttribute("role","option")),a.itemCreated&&"function"==typeof a.itemCreated&&a.itemCreated({dataSource:i,curData:m,text:y,item:v,options:a,fields:l}),d.push(v)}return ht(d,s),s},K_.renderGroupTemplate=function(e,t,i,n,o,r){for(var s=yH(e),e=Pe({},K_.defaultMappedFields,i),a=Pe({},Z_,o),l=e.groupBy,h=0,d=n;h<d.length;h++){var p,c=d[h],u={};u[""+l]=c.textContent,c.innerHTML="",r&&"listview"!==r.getModuleName()?(p=s(u,r,"groupTemplate",a.groupTemplateID,!!a.isStringTemplate,null,c))&&ht(p,c):ht(s(u,r,"groupTemplate",a.groupTemplateID,!!a.isStringTemplate),c)}return n},K_.generateId=dH,K_.generateUL=mH,K_.generateIcon=function(e,t,i,n){return n=Pe({},Z_,n),$_=cH(n.moduleName),("Left"===n.expandIconPosition?lt:ht)([e("div",{className:"e-icons "+n.expandIconClass+" "+(je(i)?"":i)})],t.querySelector("."+$_.textContent)),t};vH=function(e,t){return(vH=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])}))(e,t)};var vH,bH,e_=function(e,t){function i(){this.constructor=e}vH(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},wH=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},CH={None:[],SlideLeft:["SlideRightOut","SlideLeftOut","SlideLeftIn","SlideRightIn"],SlideDown:["SlideTopOut","SlideBottomOut","SlideBottomIn","SlideTopIn"],Zoom:["FadeOut","FadeZoomOut","FadeZoomIn","FadeIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},SH={None:[],SlideLeft:["SlideLeftOut","SlideRightOut","SlideRightIn","SlideLeftIn"],SlideDown:["SlideBottomOut","SlideTopOut","SlideTopIn","SlideBottomIn"],Zoom:["FadeZoomOut","FadeOut","FadeIn","FadeZoomIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},AH={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",container:"e-list-container",icon:"e-icons",backIcon:"e-icon-back",backButton:"e-back-button",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"},xH="Template",IH="GroupTemplate",TH=(e_(EH,bH=n),wH([e("id")],EH.prototype,"id",void 0),wH([e("text")],EH.prototype,"text",void 0),wH([e("isChecked")],EH.prototype,"isChecked",void 0),wH([e("isVisible")],EH.prototype,"isVisible",void 0),wH([e("enabled")],EH.prototype,"enabled",void 0),wH([e("iconCss")],EH.prototype,"iconCss",void 0),wH([e("child")],EH.prototype,"child",void 0),wH([e("tooltip")],EH.prototype,"tooltip",void 0),wH([e("groupBy")],EH.prototype,"groupBy",void 0),wH([e("text")],EH.prototype,"sortBy",void 0),wH([e("htmlAttributes")],EH.prototype,"htmlAttributes",void 0),wH([e("tableName")],EH.prototype,"tableName",void 0),EH);function EH(){return null!==bH&&bH.apply(this,arguments)||this}e_(kH,DH=Ji),kH.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"htmlAttributes":this.setHTMLAttribute();break;case"cssClass":this.setCSSClass(t.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.virtualizationModule.reRenderUiVirtualization():this.reRender();break;case"headerTitle":this.curDSLevel.length||this.header(this.headerTitle,!1,"header");break;case"query":this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.reRender();break;case"showHeader":this.header(this.headerTitle,!1,"header");break;case"enableVirtualization":je(this.contentContainer)||G(this.contentContainer),this.refresh();break;case"showCheckBox":case"checkBoxPosition":this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.setCheckbox();break;case"dataSource":this.previousScrollTop=this.element.scrollTop,this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.reRender();break;case"sortOrder":case"template":this.enableVirtualization||this.refresh();break;case"showIcon":this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():(this.listBaseOption.showIcon=this.showIcon,this.curViewDS=this.getSubDS(),this.resetCurrentList())}},kH.prototype.setHTMLAttribute=function(){!je(this.htmlAttributes)&&Object.keys(this.htmlAttributes).length&&pt(this.element,this.htmlAttributes)},kH.prototype.setCSSClass=function(e){this.cssClass&&U([this.element],this.cssClass.split(" ").filter(function(e){return e})),e&&q([this.element],e.split(" ").filter(function(e){return e}))},kH.prototype.setSize=function(){this.element.style.height=T(this.height),this.element.style.width=T(this.width),this.isWindow=!this.element.clientHeight},kH.prototype.setEnable=function(){this.enableElement(this.element,this.enable)},kH.prototype.setEnableRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},kH.prototype.enableElement=function(e,t){t?e.classList.remove(AH.disable):e.classList.add(AH.disable)},kH.prototype.header=function(e,t,i){var n,o,r,s;void 0===this.headerEle&&this.showHeader?(this.headerEle=this.createElement("div",{className:AH.header}),r=this.createElement("span",{className:AH.headerText}),this.enableHtmlSanitizer?(this.setProperties({headerTitle:go.sanitize(this.headerTitle)},!0),r.innerText=this.headerTitle):r.innerHTML=this.headerTitle,r=this.createElement("div",{className:AH.text,innerHTML:r.outerHTML}),s=this.createElement("div",{className:AH.icon+" "+AH.backIcon+" "+AH.backButton,attrs:{style:"display:none;"}}),this.headerEle.appendChild(s),this.headerEle.appendChild(r),this.headerTemplate&&(o=oo(this.headerTemplate),n=this.createElement("div",{className:AH.headerTemplateText}),(o=o({},this,i,this.LISTVIEW_HEADERTEMPLATE_ID,null,null,this.headerEle))&&ht(o,n),ht([n],this.headerEle),this.isReact)&&this.renderReactTemplates(),this.headerTemplate&&this.headerTitle&&r.classList.add("header"),this.element.classList.add("e-has-header"),lt([this.headerEle],this.element)):this.headerEle&&(this.showHeader?(this.headerEle.style.display="",r=this.headerEle.querySelector("."+AH.headerText),s=this.headerEle.querySelector("."+AH.backIcon),this.enableHtmlSanitizer&&(e=go.sanitize(e)),r.innerHTML=e,this.headerTemplate&&t&&(r.parentElement.classList.remove("header"),this.headerEle.querySelector("."+AH.headerTemplateText).classList.add("nested-header")),this.headerTemplate&&!t&&(r.parentElement.classList.add("header"),this.headerEle.querySelector("."+AH.headerTemplateText).classList.remove("nested-header"),this.headerEle.querySelector("."+AH.headerTemplateText).classList.add("header")),s.style.display=!0===t?"":"none"):this.headerEle.style.display="none")},kH.prototype.switchView=function(e,t,i){var n,o,r,s,a=this;e&&t&&(n=e.style.position,o="hidden"!==this.element.style.overflow?this.element.style.overflow:"",e.style.position="absolute",s=void e.classList.add("e-view"),r=this.animation.duration,this.animation.effect?s=(this.enableRtl?SH:CH)[this.animation.effect]:(s=CH.SlideLeft,i=this.enableRtl,r=0),this.element.style.overflow="hidden",this.aniObj.animate(e,{name:!0===i?s[0]:s[1],duration:0===r&&"Enable"===Ut?400:r,timingFunction:this.animation.easing,end:function(){e.style.display="none",a.element.style.overflow=o,e.style.position=n,e.classList.remove("e-view")}}),t.style.display="",this.aniObj.animate(t,{name:!0===i?s[2]:s[3],duration:0===r&&"Enable"===Ut?400:r,timingFunction:this.animation.easing,end:function(){a.trigger("actionComplete")}}),this.curUL=t)},kH.prototype.preRender=function(){if(this.template)try{"function"!=typeof this.template&&document.querySelectorAll(this.template).length&&this.setProperties({template:document.querySelector(this.template).innerHTML.trim()},!0)}catch(e){oo(this.template)}this.listBaseOption={template:this.template,headerTemplate:this.headerTemplate,groupTemplate:this.groupTemplate,expandCollapse:!0,listClass:"",ariaAttributes:{itemRole:"listitem",listRole:"list",itemText:"",groupItemRole:"presentation",wrapperRole:"presentation"},fields:this.fields.properties,sortOrder:this.sortOrder,showIcon:this.showIcon,itemCreated:this.renderCheckbox.bind(this),templateID:this.element.id+xH,groupTemplateID:this.element.id+IH,enableHtmlSanitizer:this.enableHtmlSanitizer},this.initialization()},kH.prototype.initialization=function(){this.curDSLevel=[],this.animateOptions={},this.curViewDS=[],this.currentLiElements=[],this.isNestedList=!1,this.selectedData=[],this.selectedId=this.enablePersistence?this.selectedId:[],this.LISTVIEW_TEMPLATE_ID=this.element.id+xH,this.LISTVIEW_GROUPTEMPLATE_ID=this.element.id+IH,this.LISTVIEW_HEADERTEMPLATE_ID=this.element.id+"HeaderTemplate",this.aniObj=new Vt(this.animateOptions),this.removeElement(this.curUL),this.removeElement(this.ulElement),this.removeElement(this.headerEle),this.removeElement(this.contentContainer),this.curUL=this.ulElement=this.liCollection=this.headerEle=this.contentContainer=void 0},kH.prototype.renderCheckbox=function(e){var t,i,n,o=this;e.item.classList.contains(AH.hasChild)&&(this.isNestedList=!0),this.showCheckBox&&e.item.classList.contains(AH.listItem)&&((t=kv(this.createElement,!1,{checked:!1,enableRtl:this.enableRtl,cssClass:AH.listviewCheckbox})).setAttribute("role","checkbox"),i=t.querySelector("."+AH.checkboxIcon),e.item.classList.add(AH.itemCheckList),e.item.firstElementChild.classList.add(AH.checkbox),"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0]?(n=fH(e.curData,this.listBaseOption.fields),this.enablePersistence&&!je(this.selectedId)?-1!==this.selectedId.findIndex(function(e){return e===n[o.listBaseOption.fields.id].toString()})&&this.checkInternally(e,t):n[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(AH.checked)?"true":"false"),t.setAttribute("aria-label",e.text),"Left"===this.checkBoxPosition?(t.classList.add(AH.checkboxLeft),e.item.firstElementChild.classList.add(AH.checkboxLeft),e.item.firstElementChild.insertBefore(t,e.item.firstElementChild.childNodes[0])):(t.classList.add(AH.checkboxRight),e.item.firstElementChild.classList.add(AH.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)},kH.prototype.checkInternally=function(e,t){e.item.classList.add(AH.selected),t.querySelector("."+AH.checkboxIcon).classList.add(AH.checked),t.setAttribute("aria-checked","true")},kH.prototype.checkItem=function(e){this.toggleCheckBase(e,!0)},kH.prototype.toggleCheckBase=function(e,t){var i;this.showCheckBox&&(je(i=(i=e)instanceof Object&&e.constructor!==HTMLLIElement?this.getLiFromObjOrElement(e):i)||(e=i.querySelector("."+AH.checkboxIcon),!0===t?i.classList.add(AH.selected):i.classList.remove(AH.selected),!0===t?e.classList.add(AH.checked):e.classList.remove(AH.checked),e.parentElement.setAttribute("aria-checked",t?"true":"false")),this.setSelectedItemData(i),this.updateSelectedId())},kH.prototype.uncheckItem=function(e){this.toggleCheckBase(e,!1)},kH.prototype.checkAllItems=function(){this.toggleAllCheckBase(!0)},kH.prototype.uncheckAllItems=function(){this.toggleAllCheckBase(!1)},kH.prototype.toggleAllCheckBase=function(e){if(this.showCheckBox){for(var t=0;t<this.liCollection.length;t++){var i=this.liCollection[t].querySelector("."+AH.checkboxIcon);i&&(e?i.classList.contains(AH.checked)||this.checkItem(this.liCollection[t]):i.classList.contains(AH.checked)&&this.uncheckItem(this.liCollection[t]))}this.enableVirtualization&&this.virtualizationModule.checkedItem(e),this.updateSelectedId()}},kH.prototype.setCheckbox=function(){if(this.showCheckBox)for(var e=Array.prototype.slice.call(this.element.querySelectorAll("."+AH.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 n=e[i];t.item=n,t.curData=this.getItemData(n),n.querySelector("."+AH.checkboxWrapper)&&this.removeElement(n.querySelector("."+AH.checkboxWrapper)),this.renderCheckbox(t),t.item.classList.contains(AH.selected)&&this.checkInternally(t,t.item.querySelector("."+AH.checkboxWrapper))}else{for(e=Array.prototype.slice.call(this.element.querySelectorAll("."+AH.itemCheckList)),i=0;i<e.length;i++)(n=e[i]).classList.remove(AH.selected),n.firstElementChild.classList.remove(AH.checkbox),this.removeElement(n.querySelector("."+AH.checkboxWrapper));this.selectedItems&&this.selectedItems.item.classList.add(AH.selected)}},kH.prototype.refreshItemHeight=function(){this.virtualizationModule&&this.virtualizationModule.refreshItemHeight()},kH.prototype.handleCheckboxState=function(t,i,n,o,r,s,a,l){this.trigger("select",s,function(e){e.cancel&&((a?o:!o)?(i.classList.add(AH.checked),t.classList.add(AH.selected)):(i.classList.remove(AH.checked),t.classList.remove(AH.selected)),n.setAttribute("aria-checked",a?o?"true":"false":o?"false":"true"),I(s,{isChecked:i.classList.contains(AH.checked)}),r)&&(t.classList.remove(AH.focused),l)&&l.classList.remove("e-focused")})},kH.prototype.clickHandler=function(e){var t,i,n,o,r,s,a;Array.isArray(this.dataSource)&&0===this.dataSource.length||(t=e.target,(i=(this.targetElement=t).classList).contains(AH.backIcon)||i.contains(AH.headerText)?(this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back()):(null===(i=z(t.parentNode,"."+AH.listItem))&&(i=t),this.removeFocus(),this.enable&&this.showCheckBox&&this.isValidLI(i)?e.target.classList.contains(AH.checkboxIcon)?(i.classList.add(AH.focused),je(i.querySelector("."+AH.checked))?this.checkInternally(n={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:i},n.item.querySelector("."+AH.checkboxWrapper)):(this.uncheckItem(i),i.classList.add(AH.focused)),this.enableVirtualization&&this.virtualizationModule.setCheckboxLI(i,e),e&&(I(n=this.selectEventData(i,e),{isChecked:(o=i.querySelector("."+AH.checkboxIcon)).classList.contains(AH.checked)}),r=i.querySelector("."+AH.checkboxWrapper),s=o.classList.contains(AH.checked),a=i.classList.contains(AH.focused),this.handleCheckboxState(i,o,r,s,a,n,!1))):i.classList.contains(AH.hasChild)?(this.removeHover(),this.removeSelect(),this.removeSelect(i),this.setSelectLI(i,e),i.classList.remove(AH.selected)):(this.setCheckboxLI(i,e),"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||(t.classList.add("e-focused"),this.targetElement=t)):(this.setSelectLI(i,e),"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||(t.classList.add("e-focused"),this.targetElement=t)),je(o=z(e.target,"li"))||o.classList.contains("e-has-child")&&!e.target.parentElement.classList.contains("e-listview-checkbox")&&o.classList.add(AH.disable)),this.updateSelectedId())},kH.prototype.removeElement=function(e){return e&&e.parentNode&&e.parentNode.removeChild(e)},kH.prototype.hoverHandler=function(e){e=z(e.target.parentNode,"."+AH.listItem);this.setHoverLI(e)},kH.prototype.leaveHandler=function(){this.removeHover()},kH.prototype.homeKeyHandler=function(e,t){var i,n;e.preventDefault(),Object.keys(this.dataSource).length&&this.curUL&&(i=this.curUL.querySelectorAll("."+AH.listItem),(n=this.curUL.querySelector("."+AH.focused)||this.curUL.querySelector("."+AH.selected))&&(n.classList.remove(AH.focused),this.showCheckBox||n.classList.remove(AH.selected)),i[n=t?i.length-1:0].classList.contains(AH.hasChild)||this.showCheckBox?i[n].classList.add(AH.focused):this.setSelectLI(i[n],e),i[n]?this.element.setAttribute("aria-activedescendant",i[n].id.toString()):this.element.removeAttribute("aria-activedescendant"))},kH.prototype.onArrowKeyDown=function(e,t){var i,n;return!je(this.curUL.querySelector("."+AH.hasChild))||this.showCheckBox?(n=this.curUL.querySelector("."+AH.focused)||this.curUL.querySelector("."+AH.selected),je(i=X_.getSiblingLI(this.curUL.querySelectorAll("."+AH.listItem),n,t))||(n&&(n.classList.remove(AH.focused),this.showCheckBox||n.classList.remove(AH.selected)),i.classList.contains(AH.hasChild)||this.showCheckBox?i.classList.add(AH.focused):this.setSelectLI(i,e))):(n=this.curUL.querySelector("."+AH.selected),i=X_.getSiblingLI(this.curUL.querySelectorAll("."+AH.listItem),n,t),this.setSelectLI(i,e)),i?this.element.setAttribute("aria-activedescendant",i.id.toString()):this.element.removeAttribute("aria-activedescendant"),i},kH.prototype.arrowKeyHandler=function(e,t){var i,n,o,r,s,a,l,h=this;e.preventDefault(),Object.keys(this.dataSource).length&&this.curUL&&(l=this.onArrowKeyDown(e,t),i=this.element.getBoundingClientRect().top,r=this.element.getBoundingClientRect().height,n=this.curUL.querySelector("."+AH.listItem).getBoundingClientRect(),o=s=void 0,this.fields.groupBy&&(o=this.curUL.querySelector("."+AH.groupListItem).getBoundingClientRect()),l?(a=l.getBoundingClientRect().top,l=l.getBoundingClientRect().height,t?(s=this.isWindow?a:a-i)<0&&(!0===this.isWindow?window.scroll(0,pageYOffset+s):this.element.scrollTop=this.element.scrollTop+s):(r=this.isWindow?window.innerHeight:r)<(s=this.isWindow?a+l:a-i+l)&&(!0===this.isWindow?window.scroll(0,pageYOffset+(s-r)):this.element.scrollTop=this.element.scrollTop+(s-r))):this.enableVirtualization&&t&&this.virtualizationModule.uiFirstIndex?(this.onUIScrolled=function(){h.onArrowKeyDown(e,t),h.onUIScrolled=void 0},s=this.virtualizationModule.listItemHeight,!0===this.isWindow?window.scroll(0,pageYOffset-s):this.element.scrollTop=this.element.scrollTop-s):t&&(this.showHeader&&this.headerEle?(a=(o||n).top,s=(l=this.headerEle.getBoundingClientRect()).top<0?l.height-a:0,!0===this.isWindow?window.scroll(0,pageYOffset-s):this.element.scrollTop=0):this.fields.groupBy&&(s=this.isWindow?o.top<0?o.top:0:i-n.top+o.height,!0===this.isWindow?window.scroll(0,pageYOffset+s):this.element.scrollTop=this.element.scrollTop-s)))},kH.prototype.enterKeyHandler=function(e){var t,i;Object.keys(this.dataSource).length&&this.curUL&&(t=!je(this.curUL.querySelector("."+AH.hasChild)),i=this.curUL.querySelector("."+AH.focused),t)&&i&&(i.classList.remove(AH.focused),this.showCheckBox&&(this.removeSelect(),this.removeSelect(i),this.removeHover()),this.setSelectLI(i,e))},kH.prototype.spaceKeyHandler=function(e){var t,i,n,o,r;this.enable&&this.showCheckBox&&Object.keys(this.dataSource).length&&this.curUL&&(e.preventDefault(),o=n=void 0,!je(t=this.curUL.querySelector("."+AH.focused))&&je(t.querySelector("."+AH.checked))?(n=(i={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:t}).item.querySelector("."+AH.checkboxWrapper),this.checkInternally(i,n),o=n.querySelector("."+AH.checkboxIcon+"."+AH.icon)):this.uncheckItem(t),I(i=this.selectEventData(t,e),{isChecked:!!o&&o.classList.contains(AH.checked)}),je(t)||(n=t.querySelector("."+AH.checkboxWrapper),o=(e=t.querySelector("."+AH.checkboxIcon)).classList.contains(AH.checked),r=t.classList.contains(AH.focused),this.handleCheckboxState(t,e,n,o,r,i,!1)),this.updateSelectedId())},kH.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:!je(this.targetElement)&&this.targetElement.classList.contains("e-focused")||this.spaceKeyHandler(e)}},kH.prototype.swipeActionHandler=function(e){"Right"===e.swipeDirection&&.5<e.velocity&&"touchend"===e.originalEvent.type&&(this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back())},kH.prototype.focusout=function(){var e;Object.keys(this.dataSource).length&&this.curUL&&(e=this.curUL.querySelector("."+AH.focused))&&(e.classList.remove(AH.focused),this.showCheckBox||je(this.selectedLI)||this.selectedLI.classList.add(AH.selected))},kH.prototype.wireEvents=function(){E.add(this.element,"keydown",this.keyActionHandler,this),E.add(this.element,"click",this.clickHandler,this),E.add(this.element,"mouseover",this.hoverHandler,this),E.add(this.element,"mouseout",this.leaveHandler,this),E.add(this.element,"focusout",this.focusout,this),this.touchModule=new Mn(this.element,{swipe:this.swipeActionHandler.bind(this)}),je(this.scroll)||E.add(this.element,"scroll",this.onListScroll,this)},kH.prototype.unWireEvents=function(){E.remove(this.element,"keydown",this.keyActionHandler),E.remove(this.element,"click",this.clickHandler),E.remove(this.element,"mouseover",this.hoverHandler),E.remove(this.element,"mouseout",this.leaveHandler),E.remove(this.element,"mouseover",this.hoverHandler),E.remove(this.element,"mouseout",this.leaveHandler),E.remove(this.element,"focusout",this.focusout),je(this.scroll)||E.remove(this.element,"scroll",this.onListScroll),this.touchModule&&this.touchModule.destroy(),this.touchModule=null},kH.prototype.removeFocus=function(){for(var e=0,t=this.element.querySelectorAll("."+AH.focused);e<t.length;e++)t[e].classList.remove(AH.focused)},kH.prototype.removeHover=function(){var e=this.element.querySelector("."+AH.hover);e&&e.classList.remove(AH.hover)},kH.prototype.removeSelect=function(e){if(je(e))for(var t=0,i=this.element.querySelectorAll("."+AH.selected);t<i.length;t++){var n=i[t];this.showCheckBox&&n.querySelector("."+AH.checked)||n.classList.remove(AH.selected)}else e.classList.remove(AH.selected)},kH.prototype.isValidLI=function(e){return e&&e.classList.contains(AH.listItem)&&!e.classList.contains(AH.groupListItem)&&!e.classList.contains(AH.disable)},kH.prototype.setCheckboxLI=function(e,t){var i,n,o,r,s,a;this.isValidLI(e)&&this.enable&&this.showCheckBox&&(this.curUL.querySelector("."+AH.focused)&&this.curUL.querySelector("."+AH.focused).classList.remove(AH.focused),i=e.querySelector("textarea")||e.querySelector("input"),e.classList.add(AH.focused),je(t)||t.target===i&&i.classList.add("e-focused"),o=(n=e.querySelector("."+AH.checkboxWrapper)).querySelector("."+AH.checkboxIcon+"."+AH.icon),this.removeHover(),r=o.classList.contains(AH.checked),s=e.classList.contains(AH.focused),r?(o.classList.remove(AH.checked),e.classList.remove(AH.selected)):(o.classList.add(AH.checked),e.classList.add(AH.selected)),n.setAttribute("aria-checked",o.classList.contains(AH.checked)?"true":"false"),I(a=this.selectEventData(e,t),{isChecked:o.classList.contains(AH.checked)}),this.enableVirtualization&&this.virtualizationModule.setCheckboxLI(e,t),this.handleCheckboxState(e,o,n,r,s,a,!0,i),this.setSelectedItemData(e),this.renderSubList(e))},kH.prototype.selectEventData=function(e,t){var i=this.getItemData(e),n=fH(i,this.listBaseOption.fields),n=!je(i)&&"string"==typeof this.dataSource[0]||"number"==typeof this.dataSource[0]?{item:e,text:e&&e.innerText.trim(),data:this.dataSource}:{item:e,text:n&&n[this.listBaseOption.fields.text],data:i},i={};return I(i,n),t&&I(i,{isInteracted:!0,event:t,cancel:!1,index:this.curUL&&Array.prototype.indexOf.call(this.curUL.children,e)}),i},kH.prototype.setSelectedItemData=function(e){var t=this.getItemData(e),i=fH(t,this.listBaseOption.fields);je(t)||"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0]?this.selectedItems={item:e,text:i&&i[this.listBaseOption.fields.text],data:t}:this.selectedItems={item:e,text:e&&e.innerText.trim(),data:this.dataSource}},kH.prototype.setSelectLI=function(t,e){var i=this;this.isValidLI(t)&&!t.classList.contains(AH.selected)&&this.enable&&(this.showCheckBox||this.removeSelect(),t.classList.add(AH.selected),this.removeHover(),this.setSelectedItemData(t),this.enableVirtualization&&this.virtualizationModule.setSelectLI(t,e),e=this.selectEventData(t,e),this.trigger("select",e,function(e){e.cancel?(t.classList.remove(AH.selected),i.selectedLI=t):(i.selectedLI=t,i.renderSubList(t))}))},kH.prototype.setHoverLI=function(e){var t;this.isValidLI(e)&&!e.classList.contains(AH.hover)&&this.enable&&((t=this.element.querySelectorAll("."+AH.hover))&&t.length&&q(t,AH.hover),e.classList.contains(AH.selected)&&!this.showCheckBox||e.classList.add(AH.hover))},kH.prototype.getSubDS=function(){var e=this.curDSLevel;if(e.length){for(var t=this.localData,i=0,n=e;i<n.length;i++)var o=n[i],r={},o=(r[this.fields.id]=o,this.curDSJSON=this.findItemFromDS(t,r),fH(this.curDSJSON,this.listBaseOption.fields)),t=this.curDSJSON?o[this.fields.child]:t;return t}return this.localData},kH.prototype.getItemData=function(e){var t=this.dataSource instanceof me?this.localData:this.dataSource,e=this.getElementUID(e),t=je(this.element.querySelector("."+AH.hasChild))&&this.fields.groupBy?this.curViewDS:t;return this.findItemFromDS(t,e)},kH.prototype.findItemFromDS=function(n,o,r){var s,a=this;return n&&n.length&&o?n.some(function(e){var t,i=fH(e,a.listBaseOption.fields);return!(!o[a.fields.id]&&!o[a.fields.text]||o[a.fields.id]&&(!je(i[a.fields.id])&&i[a.fields.id].toString())!==o[a.fields.id].toString()||o[a.fields.text]&&i[a.fields.text]!==o[a.fields.text])||"object"!=typeof e&&-1!==n.indexOf(e)?s=r?n:e:!je(o[a.fields.id])&&je(i[a.fields.id])?(t=a.element.querySelector('[data-uid="'+o[a.fields.id]+'"]'))&&t.innerText.trim()===i[a.fields.text]&&(s=e):Object.prototype.hasOwnProperty.call(i,a.fields.child)&&i[a.fields.child].length&&(s=a.findItemFromDS(i[a.fields.child],o,r)),!!s}):s=n,s},kH.prototype.getQuery=function(){var e=[],t=this.query||new ya;if(!this.query){for(var i=0,n=Object.keys(this.fields.properties);i<n.length;i++){var o=n[i];"tableName"!==o&&this.fields[""+o]&&this.fields[""+o]!==X_.defaultMappedFields[""+o]&&-1===e.indexOf(this.fields[""+o])&&e.push(this.fields[""+o])}t.select(e),Object.prototype.hasOwnProperty.call(this.fields.properties,"tableName")&&t.from(this.fields.tableName)}return t},kH.prototype.setViewDataSource=function(e){void 0===e&&(e=this.localData);var t=je(this.fields.sortBy)?this.fields.text:this.fields.sortBy,t=X_.addSorting(this.sortOrder,t);e&&this.fields.groupBy?"None"!==this.sortOrder?this.curViewDS=X_.groupDataSource(X_.getDataSource(e,t),this.listBaseOption.fields,this.sortOrder):this.curViewDS=X_.groupDataSource(e,this.listBaseOption.fields,this.sortOrder):e&&"None"!==this.sortOrder?this.curViewDS=X_.getDataSource(e,t):this.curViewDS=e},kH.prototype.isInAnimation=function(){return this.curUL.classList.contains(".e-animate")},kH.prototype.renderRemoteLists=function(e,t){this.isDestroyed||(this.localData=e.result,t.removeElement(t.contentContainer),this.renderList(),this.trigger("actionComplete",e))},kH.prototype.triggerActionFailure=function(e){this.isDestroyed||this.trigger("actionFailure",e)},kH.prototype.setLocalData=function(){var e,t=this;this.trigger("actionBegin"),this.dataSource instanceof me?this.dataSource.ready?this.dataSource.ready.then(function(e){t.isOffline=t.dataSource.dataSource.offline,t.dataSource instanceof me&&t.isOffline&&t.renderRemoteLists(e,t)}).catch(function(e){t.triggerActionFailure(e)}):this.dataSource.executeQuery(this.getQuery()).then(function(e){t.renderRemoteLists(e,t)}).catch(function(e){t.triggerActionFailure(e)}):this.dataSource&&this.dataSource.length?(this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData})):(e=this.element.querySelector("ul"))&&(ue(e),this.setProperties({dataSource:X_.createJsonFromElement(e)},!0),this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData}))},kH.prototype.reRender=function(){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()},kH.prototype.resetCurrentList=function(){this.setViewDataSource(this.curViewDS),this.contentContainer.innerHTML="",this.createList(),this.renderIntoDom(this.curUL)},kH.prototype.setAttributes=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i.classList.contains("e-list-item")&&(i.setAttribute("id",this.element.id+"_"+i.getAttribute("data-uid")),i.setAttribute("tabindex","-1"))}},kH.prototype.createList=function(){this.currentLiElements=[],this.isNestedList=!1,this.ulElement=this.curUL=X_.createList(this.createElement,this.curViewDS,this.listBaseOption,null,this),this.liCollection=this.curUL.querySelectorAll("."+AH.listItem),this.setAttributes(this.liCollection)},kH.prototype.renderSubList=function(e){var t,i,n=(this.liElement=e).getAttribute("data-uid");e.classList.contains(AH.hasChild)&&n&&(e=z(e.parentNode,"."+AH.parentItem),t=this.element.querySelector("[pid='"+n+"']"),this.curDSLevel.push(n),this.setViewDataSource(this.getSubDS()),this.enableVirtualization&&this.virtualizationModule.updateDOMItemCount(),t||(i=this.curViewDS,t=X_.createListFromJson(this.createElement,i,this.listBaseOption,this.curDSLevel.length,null,this),this.isReact&&this.renderReactTemplates(),i=t.querySelectorAll("."+AH.listItem),this.setAttributes(i),t.setAttribute("pID",n),t.style.display="none",this.renderIntoDom(t)),this.switchView(e,t),this.liCollection=this.curUL.querySelectorAll("."+AH.listItem),this.selectedItems&&(i=fH(this.selectedItems.data,this.listBaseOption.fields),this.header(i[this.listBaseOption.fields.text],!0,"header")),this.selectedLI=void 0)},kH.prototype.renderIntoDom=function(e){this.contentContainer.appendChild(e)},kH.prototype.renderList=function(e){this.setViewDataSource(e),this.enableVirtualization?(Object.keys(this.dataSource).length&&(this.template||this.groupTemplate)&&!this.virtualizationModule.isNgTemplate()&&(this.listBaseOption.itemCreated=this.virtualizationModule.createUIItem.bind(this.virtualizationModule)),this.virtualizationModule.uiVirtualization()):(this.createList(),this.contentContainer=this.createElement("div",{className:AH.container}),this.element.appendChild(this.contentContainer),this.renderIntoDom(this.ulElement),this.isReact&&this.renderReactTemplates())},kH.prototype.getElementUID=function(e){var t={};return e instanceof Element?t[this.fields.id]=e.getAttribute("data-uid"):t=e,t},kH.prototype.render=function(){this.element.classList.add(AH.root),pt(this.element,{tabindex:"0"}),this.setCSSClass(),this.setEnableRTL(),this.setEnable(),this.setSize(),this.wireEvents(),this.header(),this.setLocalData(),this.setHTMLAttribute(),this.rippleFn=Ht(this.element,{selector:"."+AH.listItem}),this.renderComplete(),this.previousScrollTop=this.element.scrollTop},kH.prototype.destroy=function(){this.isReact&&this.clearTemplate(),this.unWireEvents();var e=[AH.root,AH.disable,"e-rtl","e-has-header","e-lib"].concat(this.cssClass?this.cssClass.split(" ").filter(function(e){return e}):[]);q([this.element],e),this.element.removeAttribute("role"),this.element.removeAttribute("tabindex"),this.curUL=this.ulElement=this.liCollection=this.headerEle=void 0,this.element.innerHTML="",this.contentContainer=null,this.selectedItems=null,this.selectedLI=null,this.liElement=null,this.targetElement=null,this.currentLiElements=null,this.virtualCheckBox=null,DH.prototype.destroy.call(this)},kH.prototype.back=function(){var e,t,i,n=this.curDSLevel[this.curDSLevel.length-1];void 0===n||this.isInAnimation()||(this.curDSLevel.pop(),this.setViewDataSource(this.getSubDS()),this.enableVirtualization&&this.virtualizationModule.updateDOMItemCount(),e=this.element.querySelector("[data-uid='"+n+"']"),i=this.curUL,e=e?e.parentElement:(this.createList(),this.renderIntoDom(this.ulElement),this.curUL),t=fH(this.curDSJSON,this.listBaseOption.fields)[this.fields.text],this.switchView(i,e,!0),this.removeFocus(),(i=this.element.querySelector("[data-uid='"+n+"']")).classList.remove(AH.disable),i.classList.add(AH.focused),this.showCheckBox&&i.querySelector("."+AH.checkboxIcon).classList.contains(AH.checked)||i.classList.remove(AH.selected),this.liCollection=this.curUL.querySelectorAll("."+AH.listItem),this.enableHtmlSanitizer&&this.setProperties({headerTitle:go.sanitize(this.headerTitle)},!0),this.header(this.curDSLevel.length?t:this.headerTitle,!!this.curDSLevel.length,"header"))},kH.prototype.selectItem=function(e){this.enableVirtualization?this.virtualizationModule.selectItem(e):this.showCheckBox?this.setCheckboxLI(this.getLiFromObjOrElement(e)):!0===je(e)?this.removeSelect():this.setSelectLI(this.getLiFromObjOrElement(e))},kH.prototype.unselectItem=function(e){je(e)?this.removeSelect():je(e=this.getLiFromObjOrElement(e))||this.removeSelect(e)},kH.prototype.getLiFromObjOrElement=function(t){var i,e=this.dataSource instanceof me?this.localData:this.dataSource;if(!je(t))if("string"==typeof e[0]||"number"==typeof e[0])if(t instanceof Element){for(var n=t.getAttribute("data-uid").toString(),o=0;o<this.liCollection.length;o++)if(this.liCollection[parseInt(o.toString(),10)].getAttribute("data-uid").toString()===n){i=this.liCollection[parseInt(o.toString(),10)];break}}else Array.prototype.some.call(this.curUL.querySelectorAll("."+AH.listItem),function(e){return e.innerText.trim()===t.toString()&&(i=e,!0)});else{var e=this.getItemData(t),r=fH(e,this.listBaseOption.fields);if(e&&(i=this.element.querySelector('[data-uid="'+r[this.fields.id]+'"]'),!this.enableVirtualization)&&je(i))for(var s=this.element.querySelectorAll("."+AH.listItem),o=0;o<s.length;o++)s[parseInt(o.toString(),10)].innerText.trim()===r[this.fields.text]&&(i=s[parseInt(o.toString(),10)])}return i},kH.prototype.selectMultipleItems=function(e){if(!je(e))for(var t=0;t<e.length;t++)je(e[parseInt(t.toString(),10)])||this.selectItem(e[parseInt(t.toString(),10)])},kH.prototype.getParentId=function(){var e=[];if(this.isNestedList)for(var t=this.curDSLevel.length-1;0<=t;t--)e.push(this.curDSLevel[parseInt(t.toString(),10)]);return e},kH.prototype.updateSelectedId=function(){this.selectedId=[];for(var e=this.curUL.getElementsByClassName(AH.selected),t=0;t<e.length;t++){var i=this.getItemData(e[parseInt(t.toString(),10)]);!je(i)&&i[this.listBaseOption.fields.id]&&this.selectedId.push(i[this.listBaseOption.fields.id])}},kH.prototype.getSelectedItems=function(){var e,t,i=!1,n=(this.selectedId=[],this.dataSource instanceof me?this.localData:this.dataSource);if(this.enableVirtualization&&!i)e=this.virtualizationModule.getSelectedItems(),i=!0;else if(this.showCheckBox&&!i){for(var o,r,s=this.curUL.getElementsByClassName(AH.selected),a=[],l=[],h=(this.selectedId=[],[]),d=0;d<s.length;d++)"string"==typeof n[0]||"number"==typeof n[0]?a.push(s[parseInt(d.toString(),10)].innerText.trim()):(r=fH(o=this.getItemData(s[parseInt(d.toString(),10)]),this.listBaseOption.fields),this.isNestedList?h.push({data:o,parentId:this.getParentId()}):l.push(o),r?(a.push(r[this.listBaseOption.fields.text]),this.selectedId.push(r[this.listBaseOption.fields.id])):(a.push(void 0),this.selectedId.push(void 0)));"string"!=typeof n[0]&&"number"!=typeof n[0]||i||(e={item:s,data:n,text:a},i=!0),this.isNestedList&&!i?(e={item:s,data:h,text:a},i=!0):i||(e={item:s,data:l,text:a},i=!0)}else i||(t=this.element.getElementsByClassName(AH.selected)[0],r=fH(this.getItemData(t),this.listBaseOption.fields),i="string"!=typeof n[0]&&"number"!=typeof n[0]||i?i||(je(r)||je(t)?!(e=void 0):(this.selectedId.push(r[this.listBaseOption.fields.id]),e={text:r[this.listBaseOption.fields.text],item:t,data:this.getItemData(t)},!0)):(e=je(t)?void 0:{item:t,data:n,text:t.innerText.trim()},!0));return e},kH.prototype.findItem=function(e){return this.getItemData(e)},kH.prototype.enableItem=function(e){this.setItemState(e,!0),this.enableVirtualization&&this.virtualizationModule.enableItem(e)},kH.prototype.disableItem=function(e){this.setItemState(e,!1),this.enableVirtualization&&this.virtualizationModule.disableItem(e)},kH.prototype.setItemState=function(e,t){var e=this.getItemData(e),i=fH(e,this.listBaseOption.fields);e&&(i=this.element.querySelector('[data-uid="'+i[this.fields.id]+'"]'),t?(i&&i.classList.remove(AH.disable),delete e[this.fields.enabled]):(i&&i.classList.add(AH.disable),e[this.fields.enabled]=!1))},kH.prototype.showItem=function(e){this.showHideItem(e,!1,""),this.enableVirtualization&&this.virtualizationModule.showItem(e)},kH.prototype.hideItem=function(e){this.showHideItem(e,!0,"none"),this.enableVirtualization&&this.virtualizationModule.hideItem(e)},kH.prototype.showHideItem=function(e,t,i){var e=this.getItemData(e),n=fH(e,this.listBaseOption.fields);e&&((n=this.element.querySelector('[data-uid="'+n[this.fields.id]+'"]'))&&(n.style.display=i),t?e[this.fields.isVisible]=!1:delete e[this.fields.isVisible])},kH.prototype.addItem=function(e,t,i){void 0===t&&(t=void 0);var n=this.dataSource instanceof me?this.localData:this.dataSource;this.addItemInternally(e,t,n,i)},kH.prototype.addItemInternally=function(e,t,i,n){if(e instanceof Array)if(this.enableVirtualization)this.virtualizationModule.addItem(e,t,i,n);else{var t=this.findItemFromDS(i,t),o=void 0;if(t&&(o=(o=(o=fH(t,this.listBaseOption.fields)[this.fields.child])||[]).concat(e)),t instanceof Array){for(var r=0;r<e.length;r++){i=this.addItemAtIndex(n,i,e[parseInt(r.toString(),10)]),this.setViewDataSource(i);var s=this.contentContainer?this.contentContainer.children[0]:null;this.contentContainer&&s?this.addItemIntoDom(e[parseInt(r.toString(),10)],s,this.curViewDS):this.reRender()}this.liCollection=this.curUL.querySelectorAll("."+AH.listItem)}else t&&(t[this.fields.child]=o,this.addItemInNestedList(t,e))}},kH.prototype.addItemAtIndex=function(e,t,i){return!je(e)&&0<=e&&e<t.length&&je(this.listBaseOption.fields.groupBy)?t.splice(e,0,i):t.push(i),t},kH.prototype.addItemInNestedList=function(e,t){var i=e[this.fields.id],n=e[this.fields.child],o=this.element.querySelector("[pid='"+i+"']"),i=this.element.querySelector("[data-uid='"+i+"']"),r=o||(i?z(i,"ul"):null),s=o?n:[e];if(!!i&&!i.classList.contains(AH.hasChild)&&(n=X_.createListItemFromJson(this.createElement,s,this.listBaseOption,null,null,this),this.setAttributes(n),r.insertBefore(n[0],i),G(i)),o&&t)for(var a=0;a<t.length;a++)s.push(t[parseInt(a.toString(),10)]),this.addItemIntoDom(t[parseInt(a.toString(),10)],r,s)},kH.prototype.addItemIntoDom=function(e,t,i){var n=i.indexOf(e),e=(this.addListItem(e,n,t,i),i[n-1]);e&&e.isHeader&&1===e.items.length&&this.addListItem(e,n-1,t,i)},kH.prototype.addListItem=function(e,t,i,n){var o=this.getLiFromObjOrElement(n[t+1])||this.getLiFromObjOrElement(n[t+2])||null,e=X_.createListItemFromJson(this.createElement,[e],this.listBaseOption,null,null,this);this.setAttributes(e),this.template&&this.isReact&&this.renderReactTemplates(),this.fields.groupBy&&n[t+1]&&n[t+1].isHeader&&(n=this.getLiFromObjOrElement(n[t-1]))&&(o=n.nextElementSibling),i.insertBefore(e[0],o)},kH.prototype.removeItem=function(e){var t=this.dataSource instanceof me?this.localData:this.dataSource;this.enableVirtualization?this.virtualizationModule.removeItem(e):this.removeItemFromList(e,t)},kH.prototype.removeItemFromList=function(e,t){var i,n,o=this,r=this.curViewDS,s=e instanceof Element?this.getElementUID(e):e,a=this.findItemFromDS(t,s,!0);a&&(i=this.findItemFromDS(a,s),s=r.indexOf(i),e=this.getLiFromObjOrElement(e),n=void 0,this.validateNestedView(e),this.fields.groupBy&&this.curViewDS[s-1]&&r[s-1].isHeader&&1===r[s-1].items.length&&e&&e.previousElementSibling.classList.contains(AH.groupListItem)&&(je(e.nextElementSibling)||e.nextElementSibling&&e.nextElementSibling.classList.contains(AH.groupListItem))&&(n=e.previousElementSibling),e&&G(e),n&&G(n),r=a.length-1<=0?this.findParent(this.localData,this.fields.id,function(e){return e===i[o.fields.id]},null):null,s=a.indexOf(i),a.splice(s,1),this.setViewDataSource(t),r&&r.parent&&Array.isArray(r.parent[this.fields.child])&&r.parent[this.fields.child].length<=0&&(e=this.getLiFromObjOrElement(r.parent))&&(n=X_.createListItemFromJson(this.createElement,[r.parent],this.listBaseOption,null,null,this),this.setAttributes(n),e.parentElement.insertBefore(n[0],e),e.parentElement.removeChild(e)),a.length<=0&&this.back(),this.liCollection=Array.prototype.slice.call(this.element.querySelectorAll("."+AH.listItem)))},kH.prototype.validateNestedView=function(e){var t=e?e.getAttribute("data-uid").toString().toLowerCase():null;if(t&&this.curDSLevel&&0<this.curDSLevel.length)for(;this.curDSLevel.some(function(e){return e.toString().toLowerCase()===t});)this.back()},kH.prototype.removeMultipleItems=function(e){if(e.length)for(var t=0;t<e.length;t++)this.removeItem(e[parseInt(t.toString(),10)])},kH.prototype.findParent=function(e,t,i,n){if(Object.prototype.hasOwnProperty.call(e,t)&&!0===i(e[t]))return Pe({},e);for(var o=0;o<Object.keys(e).length;o++)if(e[Object.keys(e)[parseInt(o.toString(),10)]]&&"object"==typeof e[Object.keys(e)[parseInt(o.toString(),10)]]){var r=this.findParent(e[Object.keys(e)[parseInt(o.toString(),10)]],t,i,e);if(null!=r)return r.parent||(r.parent=n),r}return null},kH.prototype.getModuleName=function(){return"listview"},kH.prototype.requiredModules=function(){var e=[];return this.enableVirtualization&&e.push({args:[this],member:"virtualization",name:"Virtualization"}),e},kH.prototype.onListScroll=function(e){var e={originalEvent:e,scrollDirection:"Bottom",distanceY:this.element.scrollHeight-this.element.scrollTop},t=this.element.scrollTop;t>this.previousScrollTop?(e.scrollDirection="Bottom",e.distanceY=this.element.scrollHeight-this.element.clientHeight-this.element.scrollTop,this.trigger("scroll",e)):this.previousScrollTop>t&&(e.scrollDirection="Top",e.distanceY=this.element.scrollTop,this.trigger("scroll",e)),this.previousScrollTop=t},kH.prototype.getPersistData=function(){return this.addOnPersist(["cssClass","enableRtl","htmlAttributes","enable","fields","animation","headerTitle","sortOrder","showIcon","height","width","showCheckBox","checkBoxPosition","selectedId"])},wH([e("")],kH.prototype,"cssClass",void 0),wH([e(!1)],kH.prototype,"enableVirtualization",void 0),wH([e({})],kH.prototype,"htmlAttributes",void 0),wH([e(!0)],kH.prototype,"enable",void 0),wH([e([])],kH.prototype,"dataSource",void 0),wH([e()],kH.prototype,"query",void 0),wH([t(X_.defaultMappedFields,TH)],kH.prototype,"fields",void 0),wH([e({effect:"SlideLeft",duration:400,easing:"ease"})],kH.prototype,"animation",void 0),wH([e("None")],kH.prototype,"sortOrder",void 0),wH([e(!1)],kH.prototype,"showIcon",void 0),wH([e(!1)],kH.prototype,"showCheckBox",void 0),wH([e("Left")],kH.prototype,"checkBoxPosition",void 0),wH([e("")],kH.prototype,"headerTitle",void 0),wH([e(!1)],kH.prototype,"showHeader",void 0),wH([e(!0)],kH.prototype,"enableHtmlSanitizer",void 0),wH([e("")],kH.prototype,"height",void 0),wH([e("")],kH.prototype,"width",void 0),wH([e(null)],kH.prototype,"template",void 0),wH([e(null)],kH.prototype,"headerTemplate",void 0),wH([e(null)],kH.prototype,"groupTemplate",void 0),wH([i()],kH.prototype,"select",void 0),wH([i()],kH.prototype,"actionBegin",void 0),wH([i()],kH.prototype,"actionComplete",void 0),wH([i()],kH.prototype,"actionFailure",void 0),wH([i()],kH.prototype,"scroll",void 0);var DH,MH=wH([Bt],kH);function kH(e,t){e=DH.call(this,e,t)||this;return e.previousSelectedItems=[],e.hiddenItems=[],e.enabledItems=[],e.disabledItems=[],e}PH.prototype.isNgTemplate=function(){return!je(this.listViewInstance.templateRef)&&"string"!=typeof this.listViewInstance.templateRef},PH.prototype.isVueFunctionTemplate=function(){return this.listViewInstance.isVue&&"function"==typeof this.listViewInstance.template},PH.prototype.uiVirtualization=function(){this.wireScrollEvent(!1);var e=this.listViewInstance.curViewDS,t=this.listViewInstance.isRendered,i=t&&!je(this.uiFirstIndex)&&this.uiLastIndex<=Object.keys(e).length?this.uiFirstIndex:0,n=e.slice(i,i+1),n=(this.listViewInstance.ulElement=this.listViewInstance.curUL=X_.createList(this.listViewInstance.createElement,n,this.listViewInstance.listBaseOption,null,this.listViewInstance),this.listViewInstance.contentContainer=this.listViewInstance.createElement("div",{className:AH.container}),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.updateDOMItemCount(),t&&!je(this.uiLastIndex)&&0!==this.listDiff?this.uiLastIndex:this.domItemCount-1),i=(this.uiFirstIndex=i,this.uiLastIndex=n,e.slice(i+1,n+1));ht(X_.createListItemFromJson(this.listViewInstance.createElement,i,this.listViewInstance.listBaseOption,null,null,this.listViewInstance),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(e).length*this.listItemHeight-this.domItemCount*this.listItemHeight,this.topElement.style.height=t?this.topElementHeight+"px":"0px",this.bottomElement.style.height=t?this.totalHeight-this.topElementHeight+"px":this.totalHeight+"px",this.topElementHeight=t?this.topElementHeight:0,this.bottomElementHeight=t?this.totalHeight-this.topElementHeight:this.totalHeight,this.listDiff=t&&Object.keys(e).length!==this.domItemCount?this.listDiff:0,t&&(this.listViewInstance.element.scrollTop=this.listViewInstance.previousScrollTop),this.uiIndicesInitialization()},PH.prototype.wireScrollEvent=function(e){e?!0===this.listViewInstance.isWindow?(window.removeEventListener("scroll",this.onVirtualScroll),window.removeEventListener("scroll",this.updateUl)):E.remove(this.listViewInstance.element,"scroll",this.onVirtualUiScroll):this.listViewInstance.isWindow?(this.onVirtualScroll=this.onVirtualUiScroll.bind(this),window.addEventListener("scroll",this.onVirtualScroll)):E.add(this.listViewInstance.element,"scroll",this.onVirtualUiScroll,this)},PH.prototype.ValidateItemCount=function(e){var t=parseFloat(T(this.listViewInstance.height)),t=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(t/this.listItemHeight*1.5);return t=e<t?e:t},PH.prototype.updateDOMItemCount=function(){this.domItemCount=this.ValidateItemCount(Object.keys(this.listViewInstance.curViewDS).length)},PH.prototype.uiIndicesInitialization=function(){this.uiIndices={activeIndices:[],disabledItemIndices:[],hiddenItemIndices:[]};for(var e=this.listViewInstance.curViewDS,t=0;t<e.length;t++)this.listViewInstance.showCheckBox&&e[t][this.listViewInstance.fields.isChecked]&&this.uiIndices.activeIndices.push(t),je(e[parseInt(t.toString(),10)][this.listViewInstance.fields.enabled])||e[t][this.listViewInstance.fields.enabled]||this.uiIndices.disabledItemIndices.push(t);if(this.isNgTemplate())for(var i=this.listViewInstance.element.querySelectorAll("."+AH.listItem),n=0;n<i.length;n++)i[n].context=this.listViewInstance.viewContainerRef.get(n).context},PH.prototype.refreshItemHeight=function(){var e;this.listViewInstance.curViewDS.length&&(e=this.listViewInstance.curViewDS,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")},PH.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},PH.prototype.onVirtualUiScroll=function(){var e,t,i=this.listViewInstance.curViewDS,i=(this.listItemHeight=ge(".e-list-item",this.listViewInstance.element).getBoundingClientRect().height,this.totalHeight=Object.keys(i).length*this.listItemHeight-this.domItemCount*this.listItemHeight,i=this.listViewInstance.isWindow?this.listViewInstance.ulElement.getBoundingClientRect().top-document.documentElement.getBoundingClientRect().top:this.listViewInstance.headerEle?this.listViewInstance.headerEle.getBoundingClientRect().height:0,this.scrollPosition=je(this.scrollPosition)?0:this.scrollPosition,this.getscrollerHeight(i));this.topElementHeight=this.listItemHeight*Math.floor(i/this.listItemHeight),this.bottomElementHeight=this.totalHeight-this.topElementHeight,e=i<=this.totalHeight?[this.topElementHeight,this.bottomElementHeight]:[this.totalHeight,0],this.topElementHeight=e[0],this.bottomElementHeight=e[1],this.topElementHeight!==parseFloat(this.topElement.style.height)&&(this.topElement.style.height=this.topElementHeight+"px",this.bottomElement.style.height=this.bottomElementHeight+"px",i>this.scrollPosition?(t=Math.round(this.topElementHeight/this.listItemHeight-this.listDiff))>this.expectedDomItemCount+5?this.onLongScroll(t,!0):this.onNormalScroll(t,!0):(t=Math.round(this.listDiff-this.topElementHeight/this.listItemHeight))>this.expectedDomItemCount+5?this.onLongScroll(t,!1):this.onNormalScroll(t,!1)),this.listDiff=Math.round(this.topElementHeight/this.listItemHeight),"function"==typeof this.listViewInstance.onUIScrolled&&this.listViewInstance.onUIScrolled(),this.scrollPosition=i},PH.prototype.onLongScroll=function(e,t){for(var i=t?this.uiFirstIndex+e:this.uiFirstIndex-e,n=this.listViewInstance.ulElement.querySelectorAll("li"),o=0;o<n.length;o++)this.updateUI(n[o],i),i++;this.uiLastIndex=t?this.uiLastIndex+e:this.uiLastIndex-e,this.uiFirstIndex=t?this.uiFirstIndex+e:this.uiFirstIndex-e},PH.prototype.onNormalScroll=function(e,t){if(t)for(var i=0;i<e;i++){var n=++this.uiLastIndex;this.updateUI(this.topElement.nextElementSibling,n,this.bottomElement),this.uiFirstIndex++}else for(i=0;i<e;i++){var n=--this.uiFirstIndex,o=this.topElement.nextSibling;this.updateUI(this.bottomElement.previousElementSibling,n,o),this.uiLastIndex--}},PH.prototype.updateUiContent=function(e,t){var i,n=this.listViewInstance.curViewDS;"string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0]?(e.dataset.uid=X_.generateId(),e.getElementsByClassName(AH.listItemText)[0].innerHTML=this.listViewInstance.curViewDS[t].toString()):(e.dataset.uid=n[parseInt(t.toString(),10)][this.listViewInstance.fields.id]?n[parseInt(t.toString(),10)][this.listViewInstance.fields.id]:X_.generateId(),e.getElementsByClassName(AH.listItemText)[0].innerHTML=n[parseInt(t.toString(),10)][this.listViewInstance.fields.text]),this.listViewInstance.showIcon&&(e.querySelector("."+AH.listIcon)&&G(e.querySelector("."+AH.listIcon)),this.listViewInstance.curViewDS[t][this.listViewInstance.fields.iconCss])&&(i=e.querySelector("."+AH.textContent),n=this.listViewInstance.curViewDS[t][this.listViewInstance.fields.iconCss].toString(),n=this.listViewInstance.createElement("div",{className:AH.listIcon+" "+n}),i.insertBefore(n,e.querySelector("."+AH.listItemText))),this.listViewInstance.showCheckBox&&this.listViewInstance.fields.groupBy&&(this.checkListWrapper||(this.checkListWrapper=this.listViewInstance.curUL.querySelector("."+AH.checkboxWrapper).cloneNode(!0)),i=e.querySelector("."+AH.textContent),this.listViewInstance.curViewDS[t].isHeader?e.querySelector("."+AH.checkboxWrapper)&&(e.classList.remove(AH.checklist),i.classList.remove(AH.checkbox),G(e.querySelector("."+AH.checkboxWrapper))):e.querySelector("."+AH.checkboxWrapper)||(e.classList.add(AH.checklist),i.classList.add(AH.checkbox),"Left"===this.listViewInstance.checkBoxPosition?i.classList.add("e-checkbox-left"):i.classList.add("e-checkbox-right"),i.append(this.checkListWrapper.cloneNode(!0))))},PH.prototype.changeElementAttributes=function(e,t){var i;e.classList.remove(AH.disable),this.uiIndices.disabledItemIndices.length&&-1!==this.uiIndices.disabledItemIndices.indexOf(t)&&e.classList.add(AH.disable),e.style.display="",this.uiIndices.hiddenItemIndices.length&&-1!==this.uiIndices.hiddenItemIndices.indexOf(t)&&(e.style.display="none"),this.listViewInstance.showCheckBox?(i=e.querySelector("."+AH.checkboxWrapper),e.classList.remove(AH.selected),e.classList.remove(AH.focused),i&&(i.removeAttribute("aria-checked"),i.firstElementChild.classList.remove(AH.checked)),this.uiIndices.activeIndices.length&&-1!==this.uiIndices.activeIndices.indexOf(t)&&!this.listViewInstance.curUL.querySelector(AH.selected)&&(e.classList.add(AH.selected),i.firstElementChild.classList.add(AH.checked),i.setAttribute("aria-checked","true"),this.activeIndex===t)&&e.classList.add(AH.focused)):(e.classList.remove(AH.selected),e.removeAttribute("aria-selected"),je(this.activeIndex)||this.activeIndex!==t||this.listViewInstance.curUL.querySelector(AH.selected)||(e.classList.add(AH.selected),e.setAttribute("aria-selected","true"))),this.listViewInstance.fields.groupBy&&(this.listViewInstance.curViewDS[t].isHeader?e.classList.contains(AH.listItem)&&(e.classList.remove(AH.listItem),e.setAttribute("role","group"),e.classList.add(AH.groupListItem)):e.classList.contains(AH.groupListItem)&&(e.classList.remove(AH.groupListItem),e.setAttribute("role","listitem"),e.classList.add(AH.listItem)))},PH.prototype.findDSAndIndexFromId=function(e,i){var n=this,o={};return je(i=this.listViewInstance.getElementUID(i))||e.some(function(e,t){return!!(i[n.listViewInstance.fields.id]&&i[n.listViewInstance.fields.id]===(e[n.listViewInstance.fields.id]&&e[n.listViewInstance.fields.id])||i===e)&&(o.index=t,o.data=e,!0)}),o},PH.prototype.getSelectedItems=function(){var t=this;if(!je(this.activeIndex)||this.listViewInstance.showCheckBox&&this.uiIndices.activeIndices.length){var e=[],i=[];if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0]){var n=this.listViewInstance.curViewDS;if(this.listViewInstance.showCheckBox){for(var o=this.uiIndices.activeIndices,r=0;r<o.length;r++)e.push(n[o[r]]);return{text:e,data:e,index:this.uiIndices.activeIndices.map(function(e){return t.listViewInstance.dataSource.indexOf(n[e])})}}return{text:n[this.activeIndex],data:n[this.activeIndex],index:this.listViewInstance.dataSource.indexOf(n[this.activeIndex])}}var s,a=this.listViewInstance.curViewDS,l=this.listViewInstance.fields.text;if(this.listViewInstance.showCheckBox){for(var h=this.uiIndices.activeIndices,r=0;r<h.length;r++)i.push(a[h[r]][""+l]),e.push(a[h[parseInt(r.toString(),10)]]);var d=this.listViewInstance.dataSource instanceof me?a:this.listViewInstance.dataSource;return{text:i,data:e,index:this.uiIndices.activeIndices.map(function(e){return d.indexOf(a[e])})}}return s=this.listViewInstance.dataSource instanceof me?a:this.listViewInstance.dataSource,{text:a[this.activeIndex][this.listViewInstance.fields.text],data:a[this.activeIndex],index:s.indexOf(a[this.activeIndex])}}},PH.prototype.selectItem=function(e){var t,i,n,o,r=this,s=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(s).length?(t=this.activeIndex===s.index,this.activeIndex=s.index,this.listViewInstance.showCheckBox&&(-1===this.uiIndices.activeIndices.indexOf(s.index)?(i=!0,this.uiIndices.activeIndices.push(s.index)):(i=!1,this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(s.index),1)),this.listViewInstance.curUL.querySelector("."+AH.focused))&&this.listViewInstance.curUL.querySelector("."+AH.focused).classList.remove(AH.focused),this.listViewInstance.getLiFromObjOrElement(e)?this.listViewInstance.showCheckBox?this.listViewInstance.setCheckboxLI(this.listViewInstance.getLiFromObjOrElement(e)):this.listViewInstance.setSelectLI(this.listViewInstance.getLiFromObjOrElement(e)):(o="string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0]?{text:this.listViewInstance.curViewDS[this.activeIndex],data:this.listViewInstance.curViewDS[this.activeIndex],index:this.activeIndex}:{text:(n=this.listViewInstance.curViewDS)[this.activeIndex][this.listViewInstance.fields.text],data:n[this.activeIndex],index:this.activeIndex},this.listViewInstance.showCheckBox?this.listViewInstance.trigger("select",o,function(e){e.cancel&&(i?(o.isChecked=!i,r.uiIndices.activeIndices.splice(r.uiIndices.activeIndices.indexOf(s.index),1)):(o.isChecked=i,r.uiIndices.activeIndices.push(s.index)))}):t||(this.listViewInstance.removeSelect(),this.listViewInstance.trigger("select",o,function(e){e.cancel&&(r.activeIndex=void 0)})))):je(e)&&!this.listViewInstance.showCheckBox&&(this.listViewInstance.removeSelect(),this.activeIndex=void 0)},PH.prototype.enableItem=function(e){e=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(e).length&&this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(e.index),1)},PH.prototype.disableItem=function(e){e=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(e).length&&-1===this.uiIndices.disabledItemIndices.indexOf(e.index)&&this.uiIndices.disabledItemIndices.push(e.index)},PH.prototype.showItem=function(e){e=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(e).length&&this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(e.index),1)},PH.prototype.hideItem=function(e){e=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(e).length&&-1===this.uiIndices.hiddenItemIndices.indexOf(e.index)&&this.uiIndices.hiddenItemIndices.push(e.index)},PH.prototype.removeItem=function(e){var t,i=this.listViewInstance.curViewDS,e=this.findDSAndIndexFromId(i,e),i=(Object.keys(e).length&&(t=e.data,i[e.index-1]&&i[e.index-1].isHeader&&1===i[e.index-1].items.length?(this.removeUiItem(e.index-1),this.removeUiItem(e.index-1)):this.removeUiItem(e.index)),this.listViewInstance.dataSource instanceof me?this.listViewInstance.localData:this.listViewInstance.dataSource),e=i.indexOf(t);-1!==e&&(i.splice(e,1),this.listViewInstance.setViewDataSource(i)),this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li")},PH.prototype.setCheckboxLI=function(e,t){var i=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(AH.selected)?-1===this.uiIndices.activeIndices.indexOf(i)&&this.uiIndices.activeIndices.push(i):this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(i),1)},PH.prototype.setSelectLI=function(e,t){this.activeIndex=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex},PH.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=[]},PH.prototype.addUiItem=function(e){var t,i,n=this.listViewInstance.curViewDS;this.changeUiIndices(e,!0),this.activeIndex&&this.activeIndex>=e&&this.activeIndex++,this.listViewInstance.showCheckBox&&n[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)?(t=this.listViewInstance.curUL.lastElementChild.previousSibling,(i=this.listViewInstance.getLiFromObjOrElement(n[e+1])||this.listViewInstance.getLiFromObjOrElement(n[e+2]))&&(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)+this.listItemHeight+"px",this.updateUI(t,e,i))):(t=this.listViewInstance.curUL.firstElementChild.nextSibling,i=void 0,i=Object.keys(this.listViewInstance.curViewDS).length-1===e?this.listViewInstance.curUL.lastElementChild:this.listViewInstance.getLiFromObjOrElement(n[e+1])||this.listViewInstance.getLiFromObjOrElement(n[e+2]),this.topElement.style.height=parseFloat(this.topElement.style.height)+this.listItemHeight+"px",this.uiFirstIndex++,this.uiLastIndex++,i&&(this.updateUI(t,e,i),!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)},PH.prototype.removeUiItem=function(e){this.totalHeight-=this.listItemHeight;var t,i=this.listViewInstance.curViewDS[e],i=this.listViewInstance.getLiFromObjOrElement(i);this.listViewInstance.curViewDS.splice(e,1),this.activeIndex&&this.activeIndex>=e&&this.activeIndex--,i&&(this.domItemCount>Object.keys(this.listViewInstance.curViewDS).length?(G(i),this.domItemCount--,this.uiLastIndex--,this.totalHeight=0):(i.classList.contains(AH.disable)&&(i.classList.remove(AH.disable),this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(e),1)),"none"===i.style.display&&(i.style.display="",this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(e),1)),this.listViewInstance.showCheckBox&&i.classList.contains(AH.selected)?(this.listViewInstance.removeSelect(),this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(e),1),(t=i.querySelector("."+AH.checkboxWrapper)).removeAttribute("aria-checked"),t.firstElementChild.classList.remove(AH.checked),i.classList.contains(AH.focused)&&(i.classList.remove(AH.focused),this.activeIndex=void 0)):i.classList.contains(AH.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(i,this.uiLastIndex,this.bottomElement)):(this.topElement.style.height=parseFloat(this.topElement.style.height)-this.listItemHeight+"px",this.updateUI(i,this.uiFirstIndex-1,this.topElement.nextSibling),this.uiLastIndex--,this.uiFirstIndex--):this.updateUI(i,this.uiLastIndex,this.bottomElement))),this.changeUiIndices(e,!1),this.listDiff=Math.round(parseFloat(this.topElement.style.height)/this.listItemHeight)},PH.prototype.changeUiIndices=function(t,i){for(var e=Object.keys(this.uiIndices),n=0;n<e.length;n++)this.uiIndices[e[n]]=this.uiIndices[e[n]].map(function(e){return t<=e?i?++e:--e:e})},PH.prototype.addItem=function(e,t,i,n){for(var o=0;o<e.length;o++){var r,s,a=e[o];i=this.listViewInstance.addItemAtIndex(n,i,a),this.listViewInstance.setViewDataSource(i),this.domItemCount?this.domItemCount<this.expectedDomItemCount?this.listViewInstance.findItemFromDS(i,t)instanceof Array&&(this.listViewInstance.ulElement&&(r=this.listViewInstance.curViewDS.indexOf(a),this.createAndInjectNewItem(a,r),s=this.listViewInstance.curViewDS[r-1])&&s.isHeader&&1===s.items.length&&(--r,this.createAndInjectNewItem(s,r)),this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li")):(r=this.listViewInstance.curViewDS.indexOf(a),this.addUiItem(r),(s=this.listViewInstance.curViewDS[r-1])&&s.isHeader&&1===s.items.length&&this.addUiItem(r-1)):(!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())}},PH.prototype.createAndInjectNewItem=function(e,t){var e=X_.createListItemFromJson(this.listViewInstance.createElement,[e],this.listViewInstance.listBaseOption,null,null,this.listViewInstance),i=Object.keys(this.listViewInstance.curViewDS).length-1===t?this.listViewInstance.curUL.lastElementChild:this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[t+1])||this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[t+2]);this.listViewInstance.fields.groupBy&&this.listViewInstance.curViewDS[t+1]&&this.listViewInstance.curViewDS[t+1].isHeader&&(t=this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[t-1]))&&(i=t.nextElementSibling),this.listViewInstance.ulElement.insertBefore(e[0],i),this.domItemCount++,this.bottomElementHeight<=0&&this.uiLastIndex++,this.refreshItemHeight()},PH.prototype.createUIItem=function(t){if(!t.item.classList.contains("e-list-group-item")&&(this.templateData=t.curData.isHeader?t.curData.items[0]:t.curData,this.listViewInstance.showCheckBox)&&(this.listViewInstance.renderCheckbox(t),!je(this.listViewInstance.virtualCheckBox))&&!je(this.listViewInstance.virtualCheckBox.outerHTML)){var i=document.createElement("div"),e='<div class="e-text-content" role="presentation"> <span class="e-list-text"> ${'+this.listViewInstance.fields.text+"} </span></div>",e=oo(this.listViewInstance.template||e,this.listViewInstance)(this.templateData,this.listViewInstance);if(this.listViewInstance.template&&this.listViewInstance.isReact&&this.listViewInstance.renderReactTemplates(),[].slice.call(e).forEach(function(e){i.appendChild(e)}),i.children&&i.children[0]){for(i.children[0].classList.add("e-checkbox"),"Left"===this.listViewInstance.checkBoxPosition?i.children[0].classList.add("e-checkbox-left"):i.children[0].classList.add("e-checkbox-right"),"Left"===this.listViewInstance.checkBoxPosition?i.children[0].insertBefore(this.listViewInstance.virtualCheckBox,i.childNodes[0].children[0]):i.children[0].appendChild(this.listViewInstance.virtualCheckBox);t.item.lastChild;)t.item.removeChild(t.item.lastChild);[].slice.call(i.children).forEach(function(e){t.item.appendChild(e)})}}},PH.prototype.reRenderUiVirtualization=function(){this.wireScrollEvent(!0),this.listViewInstance.contentContainer&&G(this.listViewInstance.contentContainer),this.listViewInstance.preRender(),this.domItemCount=0,this.listViewInstance.header(),this.listViewInstance.setLocalData()},PH.prototype.updateUI=function(e,t,i){var n,o=this.isNgTemplate()?this.onNgChange:this.onChange;this.listViewInstance.template||this.listViewInstance.groupTemplate?(n=this.listViewInstance.curViewDS[t],e.dataset.uid=n[this.listViewInstance.fields.id]||X_.generateId(),o(n,e,this)):this.updateUiContent(e,t),this.changeElementAttributes(e,t),i&&this.listViewInstance.ulElement.insertBefore(e,i)},PH.prototype.onChange=function(e,t,i){e=X_.createListItemFromJson(i.listViewInstance.createElement,[e],i.listViewInstance.listBaseOption,null,null,i.listViewInstance);for(i.listViewInstance.isReact&&i.listViewInstance.renderReactTemplates();t.lastChild;)t.removeChild(t.lastChild);[].slice.call(e[0].children).forEach(function(e){t.appendChild(e)})},PH.prototype.onNgChange=function(e,t,i){for(i=oo(i.listViewInstance.template)(e);t.lastChild;)t.removeChild(t.lastChild);t.appendChild(i[0])},PH.prototype.getModuleName=function(){return"virtualization"},PH.prototype.destroy=function(){this.wireScrollEvent(!0),this.topElement=null,this.bottomElement=null};e_=PH;function PH(e){this.elementDifference=0,this.listViewInstance=e}BH=function(e,t){return(BH=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])}))(e,t)};var BH,FH,LH,wH=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},RH=(function(e,t){function i(){this.constructor=e}BH(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(OH,FH=Ct),(LH=OH).prototype.bind=function(){this.element.id||(this.element.id=D("sortable")),this.itemClass||(this.itemClass="e-sort-item",this.dataBind()),this.initializeDraggable()},OH.prototype.initializeDraggable=function(){new hn(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:1}),this.wireEvents()},OH.prototype.wireEvents=function(){var e=this.element;E.add(e,"keydown",this.keyDownHandler,this)},OH.prototype.unwireEvents=function(){var e=this.element;E.remove(e,"keydown",this.keyDownHandler)},OH.prototype.keyDownHandler=function(e){27===e.keyCode&&((e=At(this.element,"draggable"))&&e.intDestroy(null),(e=document.getElementsByClassName("e-sortableclone")[0])&&e.remove(),e=document.getElementsByClassName("e-sortable-placeholder")[0])&&e.remove()},OH.prototype.getPlaceHolder=function(e,t){return t.placeHolder?((t=t.placeHolder({element:t.element,grabbedElement:this.target,target:e})).classList.add("e-sortable-placeholder"),t):null},OH.prototype.isValidTarget=function(e,t){return e&&L(e,t.element)&&e.classList.contains(t.itemClass)&&!e.classList.contains("e-disabled")},OH.prototype.removePlaceHolder=function(e){ue(e.placeHolderElement),e.placeHolderElement=null},OH.prototype.updateItemClass=function(e){this!==e&&(this.target.classList.remove(this.itemClass),this.target.classList.add(e.itemClass))},OH.prototype.getSortableInstance=function(e){return(e=z(e,".e-"+this.getModuleName()))&&(e=At(e,LH)).scope&&this.scope&&e.scope===this.scope?e:this},OH.prototype.getIndex=function(i,e,n){var o,r;return[].slice.call((e=void 0===e?this:e).element.children).forEach(function(e,t){e.classList.contains("e-sortable-placeholder")&&(r=!0),e===i&&(o=t,je(n)||(r&&--o,t=(e=i.getBoundingClientRect()).bottom-(e.bottom-e.top)/2,e=(n.changedTouches?n.changedTouches[0]:n).clientY,o=e<=t?o:o+1))}),o},OH.prototype.getSortableElement=function(e,t){return z(e,"."+(t=void 0===t?this:t).itemClass)},OH.prototype.queryPositionInfo=function(e){return e.left=scrollX?parseFloat(e.left)-scrollX+"px":e.left,e.top=scrollY?parseFloat(e.top)-scrollY+"px":e.top,e},OH.prototype.isPlaceHolderPresent=function(e){return e.placeHolderElement&&!!z(e.placeHolderElement,"#"+e.element.id)},OH.prototype.moveTo=function(e,t,i){NH(this.element,e,t,i)},OH.prototype.destroy=function(){this.unwireEvents(),"e-sort-item"===this.itemClass&&(this.itemClass=null,this.dataBind()),At(this.element,hn).destroy(),FH.prototype.destroy.call(this)},OH.prototype.getModuleName=function(){return"sortable"},wH([e(!(OH.prototype.onPropertyChanged=function(t,i){for(var e=0,n=Object.keys(t);e<n.length;e++)"itemClass"===n[e]&&[].slice.call(this.element.children).forEach(function(e){e.classList.contains(i.itemClass)&&e.classList.remove(i.itemClass),t.itemClass&&e.classList.add(t.itemClass)})}))],OH.prototype,"enableAnimation",void 0),wH([e(null)],OH.prototype,"itemClass",void 0),wH([e(null)],OH.prototype,"scope",void 0),wH([e()],OH.prototype,"helper",void 0),wH([e()],OH.prototype,"placeHolder",void 0),wH([i()],OH.prototype,"drag",void 0),wH([i()],OH.prototype,"beforeDragStart",void 0),wH([i()],OH.prototype,"dragStart",void 0),wH([i()],OH.prototype,"beforeDrop",void 0),wH([i()],OH.prototype,"drop",void 0),LH=wH([Bt],OH));function OH(e,t){var l=FH.call(this,t,e)||this;return l.getHelper=function(e){var t,i=l.getSortableElement(e.sender.target);return!!l.isValidTarget(i,l)&&(l.helper?t=l.helper({sender:i,element:e.element}):((t=i.cloneNode(!0)).style.width=i.offsetWidth+"px",t.style.height=i.offsetHeight+"px"),U([t],["e-sortableclone"]),document.body.appendChild(t),t)},l.onDrag=function(e){if(e.target){l.trigger("drag",{event:e.event,element:l.element,target:e.target});var t,i=l.getSortableInstance(e.target),n=l.getSortableElement(e.target,i);if(!(l.isValidTarget(n,i)||e.target&&"string"==typeof e.target.className&&-1<e.target.className.indexOf("e-list-group-item"))||l.curTarget===n&&je(i.placeHolder)||i.placeHolderElement&&i.placeHolderElement===e.target)l.curTarget!==l.target&&l.scope&&l.curTarget!==n&&!je(i.placeHolder)&&(l.removePlaceHolder(l.getSortableInstance(l.curTarget)),l.curTarget=l.target);else{if(e.target.classList.contains("e-list-group-item")&&(n=e.target),l.curTarget=n,l.target===n)return;var o=l.getIndex(i.placeHolderElement,i),r=l.getPlaceHolder(n,i),s=void 0;if(r){var o=je(o)?l.getIndex(l.target):o,s=l.getIndex(n,i,e.event),a=l.isPlaceHolderPresent(i);if(a&&o===s)return;a&&l.removePlaceHolder(i),i.placeHolderElement=r,!(e.target&&"string"==typeof e.target.className&&-1<e.target.className.indexOf("e-list-group-item"))&&i.element!==l.element&&s===i.element.childElementCount?i.element.appendChild(i.placeHolderElement):i.element.insertBefore(i.placeHolderElement,i.element.children[s])}else{o=je(o)?l.getIndex(l.target):l.getIndex(n,i)<o||!o?o:o-1,s=l.getIndex(n,i);a=i.element===l.element&&o<s?s+1:s;l.updateItemClass(i),i.element.insertBefore(l.target,i.element.children[a]),l.curTarget=l.target,l.trigger("drop",{droppedElement:l.target,element:i.element,previousIndex:o,currentIndex:s,target:e.target,helper:document.getElementsByClassName("e-sortableclone")[0],event:e.event,scope:l.scope})}}i=l.getSortableInstance(l.curTarget),je(n)&&e.target!==i.placeHolderElement?l.isPlaceHolderPresent(i)&&l.removePlaceHolder(i):[].slice.call(document.getElementsByClassName("e-sortable-placeholder")).forEach(function(e){(t=l.getSortableInstance(e)).element&&t!==i&&l.removePlaceHolder(t)})}},l.onDragStart=function(t){l.target=l.getSortableElement(t.target);var i=!1,e=(l.target.classList.add("e-grabbed"),l.curTarget=l.target,t.helper=document.getElementsByClassName("e-sortableclone")[0],{cancel:!1,element:l.element,target:l.target});l.trigger("beforeDragStart",e,function(e){e.cancel&&(i=e.cancel,l.onDragStop(t))}),i||l.trigger("dragStart",{event:t.event,element:l.element,target:l.target,bindEvents:t.bindEvents,dragElement:t.dragElement})},l.onDragStop=function(t){var i,n,o,e,r=l.getSortableInstance(l.curTarget),s=(o=l.getIndex(l.target),l.isPlaceHolderPresent(r));s&&(e=l.getIndex(r.placeHolderElement,r),e={previousIndex:o=l===r&&1<=o-e?o-1:o,currentIndex:e,target:t.target,droppedElement:l.target,helper:t.helper,cancel:!1,handled:!1},l.trigger("beforeDrop",e,function(e){e.cancel||(n=e.handled,l.updateItemClass(r),e.handled&&(e=l.target.cloneNode(!0),l.target.classList.remove("e-grabbed"),l.target=e),r.element.insertBefore(l.target,r.placeHolderElement),e=l.getIndex(l.target,r),o=l===r&&1<=o-e?o-1:o,l.trigger("drop",{event:t.event,element:r.element,previousIndex:o,currentIndex:e,target:t.target,helper:t.helper,droppedElement:l.target,scopeName:l.scope,handled:n})),l.removePlaceHolder(r)})),r=l.getSortableInstance(t.target),i=r.element.childElementCount,o=l.getIndex(l.target),r.element.querySelector(".e-list-nrt")&&(i-=1),l.curTarget===l.target&&t.target===l.curTarget&&(i=o),r.element!==t.target&&(s||l.curTarget!==l.target)||(e={previousIndex:o,currentIndex:i,target:t.target,droppedElement:l.target,helper:t.helper,cancel:!1},l.trigger("beforeDrop",e,function(e){(r.element===t.target||"string"==typeof t.target.className&&-1<t.target.className.indexOf("e-list-nrt")||"string"==typeof t.target.className&&-1<t.target.className.indexOf("e-list-nr-template")||t.target.closest(".e-list-nr-template"))&&!e.cancel&&(l.updateItemClass(r),r.element.appendChild(l.target),l.trigger("drop",{event:t.event,element:r.element,previousIndex:o,currentIndex:i,target:t.target,helper:t.helper,droppedElement:l.target,scopeName:l.scope}))})),l.target.classList.remove("e-grabbed"),l.target=null,l.curTarget=null,ue(t.helper),At(l.element,"draggable").intDestroy(t.event)},l.bind(),l}function NH(t,i,e,n){var o,r=[];i=i||t,e&&e.length?e.forEach(function(e){r.push(t.children[e])}):r=[].slice.call(t.children),je(n)?r.forEach(function(e){i.appendChild(e)}):(o=i.children[n],r.forEach(function(e){i.insertBefore(e,o)}))}VH=function(e,t){return(VH=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])}))(e,t)};var VH,_H,wH=function(e,t){function i(){this.constructor=e}VH(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},HH=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},zH="e-toast",jH="e-toast-container",WH="e-toast-title",QH="e-toast-full-width",UH="e-toast-content",qH="e-toast-message",GH="e-toast-progress",YH="e-toast-close-icon",XH="e-rtl",KH=(wH(JH,_H=n),HH([e("Left")],JH.prototype,"X",void 0),HH([e("Top")],JH.prototype,"Y",void 0),JH);function JH(){return null!==_H&&_H.apply(this,arguments)||this}wH(ez,ZH=n),HH([e(null)],ez.prototype,"model",void 0),HH([e(null)],ez.prototype,"click",void 0);var ZH,$H=ez;function ez(){return null!==ZH&&ZH.apply(this,arguments)||this}wH(nz,tz=n),HH([e("FadeIn")],nz.prototype,"effect",void 0),HH([e(600)],nz.prototype,"duration",void 0),HH([e("ease")],nz.prototype,"easing",void 0);var tz,iz=nz;function nz(){return null!==tz&&tz.apply(this,arguments)||this}wH(sz,oz=n),HH([t({effect:"FadeIn",duration:600,easing:"ease"},iz)],sz.prototype,"show",void 0),HH([t({effect:"FadeOut",duration:600,easing:"ease"},iz)],sz.prototype,"hide",void 0);var oz,rz=sz;function sz(){return null!==oz&&oz.apply(this,arguments)||this}wH(dz,az=Ji),dz.prototype.getModuleName=function(){return"toast"},dz.prototype.getPersistData=function(){return this.addOnPersist([])},dz.prototype.destroy=function(){this.hide("All"),this.element.classList.remove(jH),gt(this.element,{position:"","z-index":""}),je(this.refElement)||je(this.refElement.parentElement)||(this.refElement.parentElement.insertBefore(this.element,this.refElement),G(this.refElement),this.refElement=void 0),this.isBlazorServer()||az.prototype.destroy.call(this)},dz.prototype.preRender=function(){this.isDevice=F.isDevice,"300px"===this.width&&(this.width=this.isDevice&&screen.width<768?"100%":"300px"),je(this.target)&&(this.target=document.body),this.enableRtl&&!this.isBlazorServer()&&this.element.classList.add(XH)},dz.prototype.render=function(){this.progressObj=[],this.intervalId=[],this.contentTemplate=null,this.toastTemplate=null,this.renderComplete(),this.initRenderClass=this.element.className},dz.prototype.show=function(e){var t;if(je(e)||(this.templateChanges(e),t=JSON.parse(JSON.stringify(e)),Pe(this,this,e)),je(this.toastContainer)){this.toastContainer=this.getContainer();var i="string"==typeof this.target?document.querySelector(this.target):"object"==typeof this.target?this.target:document.body;if(je(i))return;"BODY"===i.tagName?this.toastContainer.style.position="fixed":(this.toastContainer.style.position="absolute",i.style.position="relative"),this.setPositioning(this.position),i.appendChild(this.toastContainer)}this.isBlazorServer()&&this.element.classList.contains("e-control")?this.isToastModel(e):(this.toastEle=this.createElement("div",{className:zH,id:D("toast")}),this.setWidthHeight(),this.setCSSClass(this.cssClass),je(this.template)||""===this.template?this.personalizeToast():this.templateRendering(),this.setProgress(),this.setCloseButton(),this.setAria(),this.appendToTarget(e),this.isDevice&&screen.width<768&&new Mn(this.toastEle,{swipe:this.swipeHandler.bind(this)}),je(t)||(Pe(t,{element:[this.toastEle]},!0),this.toastCollection.push(t)),this.isReact&&this.renderReactTemplates())},dz.prototype.showToast=function(e,t){this.toastEle=this.element.querySelector("#"+e),this.show(t)},dz.prototype.isToastModel=function(e){this.toastContainer=this.element,this.setPositioning(this.position);je(this.element.lastElementChild)||this.setProgress(),this.setAria(),this.appendToTarget(e)},dz.prototype.swipeHandler=function(e){var t=z(e.originalEvent.target,"."+zH+":not(."+jH+")"),i=this.animation.hide.effect;je(t)||("Right"===e.swipeDirection?(this.animation.hide.effect="SlideRightOut",this.hideToast("swipe",t)):"Left"===e.swipeDirection&&(this.animation.hide.effect="SlideLeftOut",this.hideToast("swipe",t)),this.animation.hide.effect=i)},dz.prototype.templateChanges=function(e){ee(e.content)||je(this.contentTemplate)||this.content===e.content||this.clearContentTemplate(),ee(e.template)||je(this.toastTemplate)||this.template===e.template||this.clearToastTemplate()},dz.prototype.setCSSClass=function(e){var t;e&&(t=-1!==e.indexOf(",")?",":" ",mt(this.toastEle,e.split(t),[]),this.toastContainer)&&mt(this.toastContainer,e.split(t),[])},dz.prototype.setWidthHeight=function(){"300px"===this.width?this.toastEle.style.width=T(this.width):"100%"===this.width?this.toastContainer.classList.add(QH):(this.toastEle.style.width=T(this.width),this.toastContainer.classList.remove(QH)),this.toastEle.style.height=T(this.height)},dz.prototype.templateRendering=function(){this.fetchEle(this.toastEle,this.template,"template")},dz.prototype.sanitizeHelper=function(e){var t;return this.enableHtmlSanitizer&&(Pe(t=go.beforeSanitize(),t,{cancel:!1,helper:null}),this.trigger("beforeSanitizeHtml",t),t.cancel&&!je(t.helper)?e=t.helper(e):t.cancel||(e=go.serializeValue(t,e))),e},dz.prototype.hide=function(e){this.hideToast("",e)},dz.prototype.hideToast=function(e,t){if(!je(this.toastContainer)&&0!==this.toastContainer.childElementCount)if("string"==typeof t&&"All"===t)for(var i=0;i<this.toastContainer.childElementCount;i++)this.destroyToast(this.toastContainer.children[i],e);else je(t)&&(t=this.newestOnTop?this.toastContainer.lastElementChild:this.toastContainer.firstElementChild),this.destroyToast(t,e)},dz.prototype.fetchEle=function(t,i,e){var n,o,r,s,a,l;if(i="string"==typeof i?this.sanitizeHelper(i):i,r=t.classList.contains(WH)?this.element.id+"title":t.classList.contains(UH)?this.element.id+"content":this.element.id+"template",je(o="content"===e?this.contentTemplate:this.toastTemplate)){try{"function"!=typeof i&&0<document.querySelectorAll(i).length?(s=null,"title"!==e&&(s=document.querySelector(i),t.appendChild(s),s.style.display=""),a=je(s)?o:s.cloneNode(!0),"content"===e?this.contentTemplate=a:this.toastTemplate=a):n=oo(i)}catch(e){n=oo("object"==typeof i?i:ao(function(){return i}))}je(n)||(l=this.isBlazorServer()?n({},this,e,r,!0):n({},this,e,null,!0)),je(l)||!(0<l.length)||je(l[0].tagName)&&1===l.length?"function"!=typeof i&&0===t.childElementCount&&(t.innerHTML=i):[].slice.call(l).forEach(function(e){je(e.tagName)||(e.style.display=""),t.appendChild(e)})}else t.appendChild(o.cloneNode(!0));return t},dz.prototype.clearProgress=function(e){je(this.intervalId[e])||(clearInterval(this.intervalId[e]),delete this.intervalId[e]),je(this.progressObj[e])||(clearInterval(this.progressObj[e].intervalId),delete this.progressObj[e])},dz.prototype.removeToastContainer=function(e){e&&this.toastContainer.classList.contains("e-toast-util")&&G(this.toastContainer)},dz.prototype.clearContainerPos=function(e){var t=this;this.isBlazorServer()?this.toastContainer=null:(this.customPosition?(gt(this.toastContainer,{left:"",top:""}),this.removeToastContainer(e),this.toastContainer=null,this.customPosition=!1):([zH+"-top-left",zH+"-top-right",zH+"-bottom-left",zH+"-bottom-right",zH+"-bottom-center",zH+"-top-center",zH+"-full-width"].forEach(function(e){!je(t.toastContainer)&&t.toastContainer.classList.contains(e)&&t.toastContainer.classList.remove(e)}),this.removeToastContainer(e),this.toastContainer=null),je(this.contentTemplate)||this.clearContentTemplate(),je(this.toastTemplate)||this.clearToastTemplate())},dz.prototype.clearContentTemplate=function(){this.contentTemplate.style.display="none",document.body.appendChild(this.contentTemplate),this.contentTemplate=null},dz.prototype.clearToastTemplate=function(){this.toastTemplate.style.display="none",document.body.appendChild(this.toastTemplate),this.toastTemplate=null},dz.prototype.isBlazorServer=function(){return N&&this.isServerRendered},dz.prototype.destroyToast=function(t,e){for(var i,n=this,o=0;o<this.toastCollection.length;o++)this.toastCollection[o].element[0]===t&&(i=this.toastCollection[o],this.toastCollection.splice(o,1));var e={options:this,cancel:!1,type:e,element:t,toastContainer:this.toastContainer},r=this.animation.hide,s={duration:r.duration,name:"None"===r.effect&&"Enable"===Ut?"FadeOut":r.effect,timingFunction:r.easing},a=parseInt(t.id.split("toast_")[1],10),l=this.isBlazorServer()?{options:i,toastContainer:this.toastContainer}:{options:i,toastContainer:this.toastContainer,toastObj:this};this.trigger("beforeClose",e,function(e){e.cancel||(je(n.progressObj[a])||je(t.querySelector("."+GH))||(n.progressObj[a].progressEle.style.width="0%"),s.end=function(){n.clearProgress(a),n.isBlazorServer()&&!je(i)||G(t),n.trigger("close",l),0===n.toastContainer.childElementCount&&n.clearContainerPos(!0),s=r=null},new Vt(s).animate(t))})},dz.prototype.personalizeToast=function(){this.setIcon(),this.setTitle(),this.setContent(),this.actionButtons()},dz.prototype.setAria=function(){pt(this.toastEle,{role:"alert"})},dz.prototype.setPositioning=function(e){this.isBlazorServer()||(isNaN(parseFloat(e.X))&&isNaN(parseFloat(e.Y))?this.toastContainer.classList.add(zH+"-"+e.Y.toString().toLowerCase()+"-"+e.X.toString().toLowerCase()):(this.customPosition=!0,gt(this.toastContainer,{left:T(e.X),top:T(e.Y)})))},dz.prototype.setCloseButton=function(){var e;this.showCloseButton&&(this.l10n=new Cn("toast",{close:"Close"},this.locale),this.l10n.setLocale(this.locale),e=this.l10n.getConstant("close"),e=this.createElement("div",{className:YH+" e-icons ",attrs:{tabindex:"0","aria-label":e,role:"button"}}),this.toastEle.classList.add("e-toast-header-close-icon"),this.toastEle.appendChild(e))},dz.prototype.setProgress=function(){var e;0<this.timeOut&&(e=parseInt(this.toastEle.id.split("toast_")[1],10),this.intervalId[e]=window.setTimeout(this.destroyToast.bind(this,this.toastEle),this.timeOut),this.progressObj[e]={hideEta:null,intervalId:null,maxHideTime:null,element:null,timeOutId:null,progressEle:null},this.progressObj[e].maxHideTime=parseFloat(this.timeOut+""),this.progressObj[e].hideEta=(new Date).getTime()+this.progressObj[e].maxHideTime,this.progressObj[e].element=this.toastEle,0<this.extendedTimeout&&(E.add(this.toastEle,"mouseover",this.toastHoverAction.bind(this,e)),E.add(this.toastEle,"mouseleave",this.delayedToastProgress.bind(this,e)),this.progressObj[e].timeOutId=this.intervalId[e]),this.showProgressBar)&&(this.progressBarEle=this.createElement("div",{className:GH}),this.toastEle.insertBefore(this.progressBarEle,this.toastEle.children[0]),this.progressObj[e].intervalId=setInterval(this.updateProgressBar.bind(this,this.progressObj[e]),10),this.progressObj[e].progressEle=this.progressBarEle)},dz.prototype.toastHoverAction=function(e){clearTimeout(this.progressObj[e].timeOutId),clearInterval(this.progressObj[e].intervalId),this.progressObj[e].hideEta=0,je(this.progressObj[e].element.querySelector("."+GH))||(this.progressObj[e].progressEle.style.width="0%")},dz.prototype.delayedToastProgress=function(e){var t,e=this.progressObj[e];je(e)||(t=e.element,e.timeOutId=window.setTimeout(this.destroyToast.bind(this,t),this.extendedTimeout),e.maxHideTime=parseFloat(this.extendedTimeout+""),e.hideEta=(new Date).getTime()+e.maxHideTime,je(t.querySelector("."+GH)))||(e.intervalId=setInterval(this.updateProgressBar.bind(this,e),10))},dz.prototype.updateProgressBar=function(e){var t=(e.hideEta-(new Date).getTime())/e.maxHideTime*100,t="Ltr"===this.progressDirection?100-t:t;e.progressEle.style.width=t+"%"},dz.prototype.setIcon=function(){var e;je(this.icon)||0===this.icon.length||(e=this.createElement("div",{className:"e-toast-icon e-icons "+this.icon}),this.toastEle.classList.add("e-toast-header-icon"),this.toastEle.appendChild(e))},dz.prototype.setTitle=function(){var e,t;je(this.title)||(e=this.createElement("div",{className:WH}),e=this.fetchEle(e,this.title,"title"),(t=this.createElement("div",{className:qH})).appendChild(e),this.toastEle.appendChild(t))},dz.prototype.setContent=function(){var e=this.createElement("div",{className:UH}),t=this.element;if(je(this.content)||""===this.content){var i=""!==this.element.innerHTML.replace(/\s/g,"");if((0<t.children.length||i)&&(!t.firstElementChild||!t.firstElementChild.classList.contains(zH))){this.innerEle=document.createDocumentFragment();for(var n=this.createElement("div");0!==t.childNodes.length;)this.innerEle.appendChild(this.element.childNodes[0]);e.appendChild(this.innerEle),[].slice.call(e.children).forEach(function(e){n.appendChild(e.cloneNode(!0))}),this.content=n,this.appendMessageContainer(e)}}else"object"!=typeof this.content||je(this.content.tagName)?e=this.fetchEle(e,this.content,"content"):(e.appendChild(this.content),this.content=this.content.cloneNode(!0)),this.appendMessageContainer(e)},dz.prototype.appendMessageContainer=function(e){var t;0<this.toastEle.querySelectorAll("."+qH).length?this.toastEle.querySelector("."+qH).appendChild(e):((t=this.createElement("div",{className:qH})).appendChild(e),this.toastEle.appendChild(t))},dz.prototype.actionButtons=function(){var i=this,n=this.createElement("div",{className:"e-toast-actions"});[].slice.call(this.buttons).forEach(function(e){var t;je(e.model)||((t=i.createElement("button")).setAttribute("type","button"),!je(e.model.cssClass)&&0!==e.model.cssClass.length||(e.model.cssClass="e-primary "+i.cssClass),t.classList.add("e-small"),new zv(e.model,t),je(e.click)||"function"!=typeof e.click||E.add(t,"click",e.click),n.appendChild(t))}),0<n.childElementCount&&this.appendMessageContainer(n)},dz.prototype.appendToTarget=function(t){var i=this,e=this.isBlazorServer()?{options:t,element:this.toastEle,cancel:!1}:{options:t,toastObj:this,element:this.toastEle,cancel:!1};this.trigger("beforeOpen",e,function(e){e.cancel?i.isBlazorServer()&&(e=parseInt(i.toastEle.id.split("toast_")[1],10),i.clearProgress(e),G(i.toastEle),0===i.toastContainer.childElementCount)&&i.clearContainerPos():(i.isBlazorServer()||(i.toastEle.style.display="none"),i.newestOnTop&&0!==i.toastContainer.childElementCount?i.toastContainer.insertBefore(i.toastEle,i.toastContainer.children[0]):i.isBlazorServer()||i.toastContainer.appendChild(i.toastEle),q([i.toastEle],"e-blazor-toast-hidden"),E.add(i.toastEle,"click",i.clickHandler,i),E.add(i.toastEle,"keydown",i.keyDownHandler,i),i.toastContainer.style.zIndex=Iv(i.toastContainer)+"",i.displayToast(i.toastEle,t))})},dz.prototype.clickHandler=function(e){var t=this,i=(this.isBlazorServer()||e.stopPropagation(),e.target),n=z(i,"."+zH),e=this.isBlazorServer()?{element:n,cancel:!1,clickToClose:!1,originalEvent:e}:{element:n,cancel:!1,clickToClose:!1,originalEvent:e,toastObj:this},o=i.classList.contains(YH);this.trigger("click",e,function(e){(o&&!e.cancel||e.clickToClose)&&t.destroyToast(n,"click")})},dz.prototype.keyDownHandler=function(e){!e.target.classList.contains(YH)||13!==e.keyCode&&32!==e.keyCode||(e=z(e.target,"."+zH),this.destroyToast(e,"key"))},dz.prototype.displayToast=function(e,t){var i=this,n=this.animation.show,n={duration:n.duration,name:"None"===n.effect&&"Enable"===Ut?"FadeIn":n.effect,timingFunction:n.easing},o=this.isBlazorServer()?{options:t,element:this.toastEle}:{options:t,toastObj:this,element:this.toastEle};n.begin=function(){e.style.display=""},n.end=function(){i.trigger("open",o)},new Vt(n).animate(e)},dz.prototype.getContainer=function(){return this.element.classList.add(jH),this.element},dz.prototype.onPropertyChanged=function(e,t){for(var i=this.element,n=0,o=Object.keys(e);n<o.length;n++)"enableRtl"===o[n]&&(e.enableRtl?i.classList.add(XH):i.classList.remove(XH))},HH([e("300px")],dz.prototype,"width",void 0),HH([e("auto")],dz.prototype,"height",void 0),HH([e(null)],dz.prototype,"title",void 0),HH([e(null)],dz.prototype,"content",void 0),HH([e(!0)],dz.prototype,"enableHtmlSanitizer",void 0),HH([e(null)],dz.prototype,"icon",void 0),HH([e(null)],dz.prototype,"cssClass",void 0),HH([e(null)],dz.prototype,"template",void 0),HH([e(!0)],dz.prototype,"newestOnTop",void 0),HH([e(!1)],dz.prototype,"showCloseButton",void 0),HH([e(!1)],dz.prototype,"showProgressBar",void 0),HH([e(5e3)],dz.prototype,"timeOut",void 0),HH([e("Rtl")],dz.prototype,"progressDirection",void 0),HH([e(1e3)],dz.prototype,"extendedTimeout",void 0),HH([t({},rz)],dz.prototype,"animation",void 0),HH([t({},KH)],dz.prototype,"position",void 0),HH([kt([{}],$H)],dz.prototype,"buttons",void 0),HH([e(null)],dz.prototype,"target",void 0),HH([i()],dz.prototype,"created",void 0),HH([i()],dz.prototype,"beforeSanitizeHtml",void 0),HH([i()],dz.prototype,"destroyed",void 0),HH([i()],dz.prototype,"open",void 0),HH([i()],dz.prototype,"beforeOpen",void 0),HH([i()],dz.prototype,"beforeClose",void 0),HH([i()],dz.prototype,"close",void 0),HH([i()],dz.prototype,"click",void 0);var az,lz,hz=HH([Bt],dz);function dz(e,t){e=az.call(this,e,t)||this;return e.toastCollection=[],e.needsID=!0,e}(lz||(lz={})).show=function(e,t,i){var n,o;if(document.querySelector("."+jH)?n=document.querySelector("."+jH):(n=Q("div",{className:zH+" "+jH+" e-toast-util"}),document.body.appendChild(n)),"string"==typeof e){var r=void 0,s=void 0;if(je(t))s=r="";else switch(t){case"Warning":r="e-toast-warning",s="e-toast-warning-icon";break;case"Success":r="e-toast-success",s="e-toast-success-icon";break;case"Error":r="e-toast-danger",s="e-toast-error-icon";break;case"Information":r="e-toast-info",s="e-toast-info-icon"}o={content:e,cssClass:r,icon:s,timeOut:je(i)?5e3:i}}else o=e;return(t=new hz(o)).appendTo(n),t.show(),t};pz=function(e,t){return(pz=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])}))(e,t)};var pz,cz,uz,gz,wH=function(e,t){function i(){this.constructor=e}pz(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},HH=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},mz=((Iz=cz=cz||{}).Normal="Normal",Iz.Success="Success",Iz.Info="Info",Iz.Warning="Warning",Iz.Error="Error",(Iz=uz=uz||{}).Text="Text",Iz.Outlined="Outlined",Iz.Filled="Filled","e-msg-icon"),fz="e-content-center",yz="e-rtl",vz="e-success",bz="e-warning",wz="e-info",Cz="e-error",Sz="e-outlined",Az="e-filled",xz="e-hidden",Iz=(wH(Tz,gz=Ji),Tz.prototype.getModuleName=function(){return"message"},Tz.prototype.getPersistData=function(){return this.addOnPersist([])},Tz.prototype.preRender=function(){this.l10n=new Cn("message",{close:"Close"},this.locale)},Tz.prototype.render=function(){this.innerContent=this.element.innerHTML,this.element.innerHTML="",this.msgElement=this.createElement("div",{className:"e-msg-content-wrap"}),this.initialize(),this.wireEvents(),this.renderComplete(),this.renderReactTemplates(),this.initialRender=!1},Tz.prototype.initialize=function(){this.element.setAttribute("role","alert"),this.setCssClass(),this.setIcon(),this.setContent(),this.setCloseIcon(),this.setSeverity(),this.setVariant(),this.setVisible(),this.enableRtl&&this.element.classList.add(yz)},Tz.prototype.setIcon=function(){this.showIcon&&(this.iconElement=this.createElement("span",{className:mz}),(this.element.classList.contains(fz)?this.msgElement:this.element).appendChild(this.iconElement))},Tz.prototype.setCloseIcon=function(){this.showCloseIcon&&(this.closeIcon=this.createElement("button",{attrs:{type:"button",class:"e-msg-close-icon"}}),this.element.appendChild(this.closeIcon),this.setTitle())},Tz.prototype.setTitle=function(){this.l10n.setLocale(this.locale);var e=this.l10n.getConstant("close");this.closeIcon.setAttribute("title",e),this.closeIcon.setAttribute("aria-label",e)},Tz.prototype.setContent=function(){this.txtElement=this.createElement("div",{className:"e-msg-content"}),this.element.classList.contains(fz)?(this.msgElement.appendChild(this.txtElement),this.element.appendChild(this.msgElement)):this.element.appendChild(this.txtElement),this.setTemplate()},Tz.prototype.setTemplate=function(){var e;je(this.content)||""===this.content?this.txtElement.innerHTML=this.innerContent:je(this.content)||""===this.content||"string"!=typeof this.content&&"string"==typeof this.content||(this.isVue||"string"!=typeof this.content?je(e=oo(this.content))||(e=e({},this,"content",this.element.id+"content",!0))&&(ht(e=Array.prototype.slice.call(e),this.txtElement),this.renderReactTemplates()):this.txtElement.innerHTML=this.content)},Tz.prototype.setSeverity=function(){q([this.element],[vz,bz,wz,Cz]),"Success"===this.severity?U([this.element],vz):"Warning"===this.severity?U([this.element],bz):"Error"===this.severity?U([this.element],Cz):"Info"===this.severity&&U([this.element],wz)},Tz.prototype.setVariant=function(){q([this.element],[Az,Sz]),"Outlined"===this.variant?U([this.element],Sz):"Filled"===this.variant&&U([this.element],Az)},Tz.prototype.setCssClass=function(e){e&&q([this.element],e.split(" ")),this.cssClass&&U([this.element],this.cssClass.split(" "))},Tz.prototype.setVisible=function(){this.visible?q([this.element],xz):(U([this.element],xz),this.initialRender||this.trigger("closed",{event:event,isInteracted:!1,element:this.element}))},Tz.prototype.clickHandler=function(e){this.closeMessage(e)},Tz.prototype.keyboardHandler=function(e){32!==e.keyCode&&13!==e.keyCode||this.closeMessage(e)},Tz.prototype.closeMessage=function(e){U([this.element],xz),this.setProperties({visible:!1},!0);e={event:e,isInteracted:!0,element:this.element};this.trigger("closed",e)},Tz.prototype.wireEvents=function(){this.showCloseIcon&&(E.add(this.closeIcon,"click",this.clickHandler,this),E.add(this.closeIcon,"keydown",this.keyboardHandler,this))},Tz.prototype.unWireEvents=function(){this.showCloseIcon&&(E.remove(this.closeIcon,"click",this.clickHandler),E.remove(this.closeIcon,"keydown",this.keyboardHandler))},Tz.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"cssClass":this.setCssClass(t.cssClass);break;case"content":this.txtElement.innerHTML="",this.setTemplate();break;case"enableRtl":this.enableRtl?this.element.classList.add(yz):this.element.classList.remove(yz);break;case"locale":this.showCloseIcon&&this.setTitle();break;case"showIcon":!this.showIcon&&0<this.element.getElementsByClassName(mz).length&&G(this.iconElement),this.showIcon&&(this.iconElement=this.createElement("span",{className:mz}),this.element.insertBefore(this.iconElement,this.txtElement));break;case"showCloseIcon":this.showCloseIcon||je(this.closeIcon)?(this.setCloseIcon(),this.wireEvents()):(this.unWireEvents(),G(this.closeIcon));break;case"severity":this.setSeverity();break;case"variant":this.setVariant();break;case"visible":this.setVisible()}},Tz.prototype.destroy=function(){var e=je(this.cssClass)?[""]:this.cssClass.split(" "),t=[vz,bz,wz,Cz,yz,xz,Sz,Az],t=1===e.length&&""===e[0]?t:t.concat(e);q([this.element],t),this.element.removeAttribute("role"),this.unWireEvents(),je(this.iconElement)||G(this.iconElement),G(this.txtElement),je(this.closeIcon)||G(this.closeIcon),gz.prototype.destroy.call(this)},HH([e(null)],Tz.prototype,"content",void 0),HH([e("")],Tz.prototype,"cssClass",void 0),HH([e(!0)],Tz.prototype,"showIcon",void 0),HH([e(!1)],Tz.prototype,"showCloseIcon",void 0),HH([e("Normal")],Tz.prototype,"severity",void 0),HH([e("Text")],Tz.prototype,"variant",void 0),HH([e(!0)],Tz.prototype,"visible",void 0),HH([i()],Tz.prototype,"created",void 0),HH([i()],Tz.prototype,"destroyed",void 0),HH([i()],Tz.prototype,"closed",void 0),HH([Bt],Tz));function Tz(e,t){e=gz.call(this,e,t)||this;return e.initialRender=!0,e}Ez=function(e,t){return(Ez=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])}))(e,t)};var Ez,Dz,Mz,kz,wH=function(e,t){function i(){this.constructor=e}Ez(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},HH=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Pz={TEXTSHAPE:"e-skeleton-text",CIRCLESHAPE:"e-skeleton-circle",SQUARESHAPE:"e-skeleton-square",RECTANGLESHAPE:"e-skeleton-rectangle",WAVEEFFECT:"e-shimmer-wave",PULSEEFFECT:"e-shimmer-pulse",FADEEFFECT:"e-shimmer-fade",VISIBLENONE:"e-visible-none"},Bz=((Oz=Dz=Dz||{}).Text="Text",Oz.Circle="Circle",Oz.Square="Square",Oz.Rectangle="Rectangle",(Oz=Mz=Mz||{}).Wave="Wave",Oz.Fade="Fade",Oz.Pulse="Pulse",Oz.None="None",wH(Fz,kz=Ji),Fz.prototype.getModuleName=function(){return"skeleton"},Fz.prototype.getPersistData=function(){return this.addOnPersist([])},Fz.prototype.preRender=function(){this.element.id||(this.element.id=D("e-"+this.getModuleName())),this.updateCssClass(),pt(this.element,{role:"alert","aria-busy":"true","aria-live":"polite","aria-label":this.label})},Fz.prototype.render=function(){this.initialize()},Fz.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"width":case"height":this.updateDimension();break;case"shape":this.updateShape();break;case"shimmerEffect":this.updateEffect();break;case"visible":this.updateVisibility();break;case"label":this.element.setAttribute("aria-label",this.label);break;case"cssClass":t.cssClass&&q([this.element],t.cssClass.split(" ")),this.updateCssClass()}},Fz.prototype.destroy=function(){kz.prototype.destroy.call(this);var e=["role","aria-live","aria-busy","aria-label"],t=[];this.cssClass&&(t=t.concat(this.cssClass.split(" ")));for(var i=0;i<e.length;i++)this.element.removeAttribute(e[parseInt(i.toString(),10)]);t=(t=t.concat(this.element.classList.value.match(/(e-skeleton-[^\s]+)/g)||[])).concat(this.element.classList.value.match(/(e-shimmer-[^\s]+)/g)||[]),q([this.element],t)},Fz.prototype.initialize=function(){this.updateShape(),this.updateEffect(),this.updateVisibility()},Fz.prototype.updateShape=function(){var e,t;je(this.shape)||(e=Pz[this.shape.toUpperCase()+"SHAPE"],t=this.element.classList.value.match(/(e-skeleton-[^\s]+)/g)||[],this.updateDimension(),t&&q([this.element],t),U([this.element],[e]))},Fz.prototype.updateDimension=function(){var e=!this.width&&-1<["Text","Rectangle"].indexOf(this.shape)?"100%":T(this.width),t=-1<["Circle","Square"].indexOf(this.shape)?e:T(this.height);this.element.style.width=e,this.element.style.height=t},Fz.prototype.updateEffect=function(){var e=this.element.classList.value.match(/(e-shimmer-[^\s]+)/g)||[];e&&q([this.element],e),je(this.shimmerEffect)||U([this.element],[Pz[this.shimmerEffect.toUpperCase()+"EFFECT"]])},Fz.prototype.updateVisibility=function(){this.element.classList[this.visible?"remove":"add"](Pz.VISIBLENONE)},Fz.prototype.updateCssClass=function(){this.cssClass&&U([this.element],this.cssClass.split(" "))},HH([e("")],Fz.prototype,"width",void 0),HH([e("")],Fz.prototype,"height",void 0),HH([e(!0)],Fz.prototype,"visible",void 0),HH([e("Text")],Fz.prototype,"shape",void 0),HH([e("Wave")],Fz.prototype,"shimmerEffect",void 0),HH([e("Loading...")],Fz.prototype,"label",void 0),HH([e("")],Fz.prototype,"cssClass",void 0),HH([Bt],Fz));function Fz(e,t){return kz.call(this,e,t)||this}Lz=function(e,t){return(Lz=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])}))(e,t)};var Lz,Rz,Oz=function(e,t){function i(){this.constructor=e}Lz(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},wH=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},HH=(Oz(Nz,Rz=n),wH([e()],Nz.prototype,"text",void 0),wH([e()],Nz.prototype,"value",void 0),wH([e()],Nz.prototype,"iconCss",void 0),wH([e()],Nz.prototype,"groupBy",void 0),wH([e()],Nz.prototype,"htmlAttributes",void 0),wH([e()],Nz.prototype,"disabled",void 0),Nz);function Nz(){return null!==Rz&&Rz.apply(this,arguments)||this}var Vz,_z={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",virtualList:"e-list-item e-virtual-list"},Oz=(Oz(Hz,Vz=Ji),Hz.prototype.getPropObject=function(e,t,i){var n=new Object,o=new Object,t=(n[e]=t[e],o[e]=i[e],new Object);return t.newProperty=n,t.oldProperty=o,t},Hz.prototype.getValueByText=function(e,t,i){var n=null;return n=je(this.listData)?n:t?this.checkValueCase(e,!0,i):this.checkValueCase(e,!1,i)},Hz.prototype.checkValueCase=function(t,e,i,n){var o=this,r=n?t:null;if(!je(this.listData)){var s,a=this.listData,l=this.fields,h=this.typeOfData(a).typeof;if("string"===h||"number"===h||"boolean"===h)for(var d=0,p=a;d<p.length;d++){var c=p[d];je(c)||(i?r=this.checkingAccent(String(c),t,e):e?this.checkIgnoreCase(String(c),t)&&(r=this.getItemValue(String(c),t,e)):this.checkNonIgnoreCase(String(c),t)&&(r=this.getItemValue(String(c),t,e,n)))}else e?a.filter(function(e){!je(R(l.value,e))&&o.checkIgnoreCase(R(l.text,e).toString(),t)&&(r=R(l.value,e))}):n?(s=null,s=r,a.filter(function(e){var t=R(l.value,e);je(t)||je(r)||t.toString()!==s.toString()||(r=R(l.text,e))})):a.filter(function(e){o.checkNonIgnoreCase(R(l.text,e),t)&&(r=R(l.value,e))})}return r},Hz.prototype.checkingAccent=function(e,t,i){var n=Sa.ignoreDiacritics(String(e)),o=Sa.ignoreDiacritics(t.toString()),r=null;return i?this.checkIgnoreCase(n,o)&&(r=this.getItemValue(String(e),t,i)):this.checkNonIgnoreCase(String(e),t)&&(r=this.getItemValue(String(e),t,i)),r},Hz.prototype.checkIgnoreCase=function(e,t){return String(e).toLowerCase()===t.toString().toLowerCase()},Hz.prototype.checkNonIgnoreCase=function(e,t){return String(e)===t.toString()},Hz.prototype.getItemValue=function(e,t,i,n){var o=this.listData,o=this.typeOfData(o).typeof;return n?e.toString():i?"string"===o?String(e):this.getFormattedValue(String(e)):"string"===o?t:this.getFormattedValue(t)},Hz.prototype.templateCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!ct(e,document).length}catch(e){t=!1}return t},Hz.prototype.l10nUpdate=function(e){var t="listbox"===this.getModuleName()?this.ulElement:this.list;if(!je(this.noRecordsTemplate)&&"No records found"!==this.noRecordsTemplate||"Request failed"!==this.actionFailureTemplate){var i=e?this.actionFailureTemplate:this.noRecordsTemplate,n=void 0,o=e?this.actionFailureTemplateId:this.noRecordsTemplateId,r=(t.innerHTML="",this.templateCompiler(i)),n=oo("function"!=typeof i&&r?ge(i,document).innerHTML.trim():i),s=e?"actionFailureTemplate":"noRecordsTemplate",a=void 0;if((a=this.isReact&&"function"==typeof i?n({},this,s,o,this.isStringTemplate,null):n({},this,s,o,this.isStringTemplate,null,t))&&0<a.length)for(var l=0;l<a.length;l++)"listbox"===this.getModuleName()&&"noRecordsTemplate"==s?"#text"===a[l].nodeName?((h=this.createElement("li")).textContent=a[l].textContent,h.classList.add("e-list-nrt"),h.setAttribute("role","option"),t.appendChild(h)):(a[l].classList.add("e-list-nr-template"),t.appendChild(a[l])):(a[l]instanceof HTMLElement||a[l]instanceof Text&&""!==a[l].textContent)&&t.appendChild(a[l]);this.renderReactTemplates()}else{var h,r=new Cn(this.getLocaleName(),{},this.locale),i=(""!==r.getConstant("actionFailureTemplate")||""!==r.getConstant("noRecordsTemplate")?this.l10n=r:this.l10n=new Cn("listbox"===this.getModuleName()?"listbox":"mention"===this.getModuleName()?"mention":"dropdowns",{noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed"},this.locale),e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate"));"listbox"===this.getModuleName()?((h=this.createElement("li")).textContent=i,t.appendChild(h),h.classList.add("e-list-nrt"),h.setAttribute("role","option")):je(t)||(t.innerHTML=i)}},Hz.prototype.checkAndResetCache=function(){this.isVirtualizationEnabled&&(this.generatedDataObject={},this.virtualItemStartIndex=this.virtualItemEndIndex=0,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.selectedValueInfo=null)},Hz.prototype.updateIncrementalInfo=function(e,t){this.viewPortInfo.startIndex=e,this.viewPortInfo.endIndex=t,this.updateVirtualItemIndex(),this.isIncrementalRequest=!0,this.resetList(this.dataSource,this.fields,this.query),this.isIncrementalRequest=!1},Hz.prototype.updateIncrementalView=function(e,t){this.viewPortInfo.startIndex=e,this.viewPortInfo.endIndex=t,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+_z.li),this.ulElement=this.list.querySelector("ul")},Hz.prototype.updateVirtualItemIndex=function(){this.virtualItemStartIndex=this.viewPortInfo.startIndex,this.virtualItemEndIndex=this.viewPortInfo.endIndex,this.virtualListInfo=this.viewPortInfo},Hz.prototype.getFilteringSkeletonCount=function(){var e=this.skeletonCount,t=(this.getSkeletonCount(!0),this.skeletonCount=this.dataCount<2*this.itemCount&&(!(this.dataSource instanceof me)||this.dataSource instanceof me&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,!0);"autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||!(this.totalItemCount<2*this.itemCount)||this.dataSource instanceof me&&!(this.dataSource instanceof me&&this.totalItemCount<=this.itemCount)||(this.skeletonCount=0,t=!1),this.list.classList.contains(_z.noData)||(e!==this.skeletonCount&&t?this.UpdateSkeleton(!0,Math.abs(e-this.skeletonCount)):this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),0<this.list.getElementsByClassName("e-virtual-ddl").length?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():!this.list.querySelector(".e-virtual-ddl")&&0<this.skeletonCount&&this.list.querySelector(".e-dropdownbase")&&(t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),this.list.querySelector(".e-dropdownbase").appendChild(t)),0<this.list.getElementsByClassName("e-virtual-ddl-content").length&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()))},Hz.prototype.getSkeletonCount=function(e){this.virtualListHeight=null!=this.listContainerHeight?parseInt(this.listContainerHeight,10):this.virtualListHeight;var t=0<this.virtualListHeight&&0<this.listItemHeight?Math.floor(this.virtualListHeight/this.listItemHeight):0;this.skeletonCount=4*t<this.itemCount?this.itemCount:4*t,this.itemCount=e?this.itemCount:this.skeletonCount,this.virtualItemCount=this.itemCount,this.skeletonCount=Math.floor(this.skeletonCount/2)},Hz.prototype.GetVirtualTrackHeight=function(){var e=this.totalItemCount===this.viewPortInfo.endIndex?this.totalItemCount*this.listItemHeight-this.itemCount*this.listItemHeight:this.totalItemCount*this.listItemHeight,e="height: "+((this.isVirtualTrackHeight?0:e)-this.itemCount*this.listItemHeight)+"px;";return"autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||0!==this.skeletonCount?e:"height: 0px;"},Hz.prototype.getTransformValues=function(){var e=this.viewPortInfo.startIndex*this.listItemHeight;return e-=this.skeletonCount*this.listItemHeight,"transform: translate(0px, "+(e=0===this.viewPortInfo.startIndex&&this.listData&&0===this.listData.length||0===this.skeletonCount?0:e)+"px);"},Hz.prototype.UpdateSkeleton=function(e,t){var i=this.list.querySelector(".e-virtual-ddl-content"),n=this.list.querySelector(".e-virtual-list");if(i&&(!n||e)&&this.isVirtualizationEnabled)for(var o=e?t:this.skeletonCount,r=0;r<o;r++){var s=this.createElement("li",{className:_z.virtualList,styles:"overflow: inherit"}),a=(this.isVirtualizationEnabled&&this.itemTemplate&&(s.style.height=this.listItemHeight-parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)+"px"),new Bz({shape:"Text",height:"10px",width:"95%",cssClass:"e-skeleton-text"}));a.appendTo(this.createElement("div")),s.appendChild(a.element),i.firstChild&&i.firstChild.insertBefore(s,i.firstChild.children[0])}},Hz.prototype.getLocaleName=function(){return"drop-down-base"},Hz.prototype.getTextByValue=function(e){return this.checkValueCase(e,!1,!1,!0)},Hz.prototype.getFormattedValue=function(e){if(this.listData&&this.listData.length){var t=void 0,t=this.properties.allowCustomValue&&this.properties.value&&this.properties.value instanceof Array&&0<this.properties.value.length?this.typeOfData(this.properties.value):this.typeOfData(this.listData);if("number"==typeof R(this.fields.value||"value",t.item)||"number"===t.typeof)return parseFloat(e);if("boolean"==typeof R(this.fields.value||"value",t.item)||"boolean"===t.typeof)return"true"===e||""+e=="true"}return e},Hz.prototype.setEnableRtl=function(){je(this.enableRtlElements)||(this.list&&this.enableRtlElements.push(this.list),(this.enableRtl?U:q)(this.enableRtlElements,_z.rtl))},Hz.prototype.initialize=function(e){var t;this.bindEvent=!0,this.preventPopupOpen=!0,this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate","UL"===this.element.tagName?(t=X_.createJsonFromElement(this.element),this.setProperties({fields:{text:"text",value:"text"}},!0),this.resetList(t,this.fields)):"SELECT"===this.element.tagName?(this.dataSource instanceof Array?0<this.dataSource.length:!je(this.dataSource))?this.isDynamicDataChange&&this.setListData(this.dataSource,this.fields,this.query):this.renderItemsBySelect():this.setListData(this.dataSource,this.fields,this.query,e)},Hz.prototype.getPersistData=function(){return this.addOnPersist([])},Hz.prototype.updateDataAttribute=function(e){for(var t=["class","style","id","type","aria-expanded","aria-autocomplete","aria-readonly"],i={},n=0;n<this.element.attributes.length;n++)-1!==t.indexOf(this.element.attributes[n].name)||"dropdownlist"===this.getModuleName()&&"readonly"===this.element.attributes[n].name||(i[this.element.attributes[n].name]=this.element.getAttribute(this.element.attributes[n].name));Pe(i,e,i),this.setProperties({htmlAttributes:i},!0)},Hz.prototype.renderItemsBySelect=function(){var e=this.element,t=e.querySelectorAll("select>optgroup"),i="multiselect"===this.getModuleName()&&this.isGroupChecking&&0<t.length,n=i?{value:"value",text:"text",groupBy:"categeory"}:{value:"value",text:"text"},o=[],r=e.querySelectorAll("select>option");if(this.getJSONfromOption(o,r,n),t.length){for(var s=0;s<t.length;s++){var a=t[s],l={},h=(l[n.text]=a.label,l.isHeader=!0,a.querySelectorAll("option"));i?this.getJSONfromOption(o,h,n,a.label):(o.push(l),this.getJSONfromOption(o,h,n))}e.querySelectorAll("select>option")}this.updateFields(n.text,n.value,(i?n:this.fields).groupBy,this.fields.htmlAttributes,this.fields.iconCss,this.fields.disabled),this.resetList(o,n)},Hz.prototype.updateFields=function(e,t,i,n,o,r){e={fields:{text:e,value:t,groupBy:je(i)?this.fields&&this.fields.groupBy:i,htmlAttributes:je(n)?this.fields&&this.fields.htmlAttributes:n,iconCss:je(o)?this.fields&&this.fields.iconCss:o,disabled:je(r)?this.fields&&this.fields.disabled:r}};this.setProperties(e,!0)},Hz.prototype.getJSONfromOption=function(e,t,i,n){void 0===n&&(n=null);for(var o=0,r=t;o<r.length;o++){var s=r[o],a={};a[i.text]=s.innerText,a[i.value]=je(s.getAttribute(i.value))?s.innerText:s.getAttribute(i.value),je(n)||(a[i.groupBy]=n),e.push(a)}},Hz.prototype.preRender=function(){this.scrollTimer=-1,this.enableRtlElements=[],this.isRequested=!1,this.isDataFetched=!1,this.itemTemplateId=this.element.id+"ItemTemplate",this.displayTemplateId=this.element.id+"DisplayTemplate",this.spinnerTemplateId=this.element.id+"SpinnerTemplate",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"},Hz.prototype.setListData=function(l,h,e,d){var p,c=this,e=(h=h||this.fields,{cancel:!(this.isActive=!0),data:l,query:e});this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.isRequesting||this.trigger("actionBegin",e,function(o){if(!o.cancel)if(c.isRequesting=!0,c.showSpinner(),l instanceof me){var r=!(c.isRequested=!0);c.isDataFetched?c.emptyDataRequest(h):o.data.executeQuery(c.getQuery(o.query)).then(function(e){c.isPreventChange=!(!c.isAngular||!c.preventChange)||c.isPreventChange;var t=!0;if(!c.virtualSelectAll){for(var i=c.getQuery(o.query),n=0;n<i.queries.length;n++)"onWhere"===i.queries[n].fn&&(r=!0);if(c.isVirtualizationEnabled&&0!==e.count&&e.count<2*c.itemCount){if(i)for(n=0;n<i.queries.length;n++)"onTake"===i.queries[n].fn&&(i.queries[n].e.nos=e.count),"multiselect"!==c.getModuleName()||"or"!==i.queries[n].e.condition&&"equal"!==i.queries[n].e.operator||c.isCustomFiltering||(t=!1)}else if(c.isVirtualTrackHeight=!1,i)for(n=0;n<i.queries.length;n++)"multiselect"===c.getModuleName()&&(i.queries[n].e&&"or"===i.queries[n].e.condition||i.queries[n].e&&"equal"===i.queries[n].e.operator)&&(t=!1)}t&&(c.dataCount=c.totalItemCount=e.count),c.trigger("actionComplete",e,function(e){var t;e.cancel||(c.isRequesting=!1,c.isCustomFiltering=!1,t=e.result,c.isIncrementalRequest?p=c.renderItems(t,h):((!c.isVirtualizationEnabled&&0===t.length||c.isVirtualizationEnabled&&0===t.length&&!r)&&(c.isDataFetched=!0),r||(c.remoteDataCount=e.count),c.dataCount=c.virtualSelectAll?c.dataCount:e.count,c.totalItemCount=c.virtualSelectAll?c.totalItemCount:e.count,p=c.renderItems(t,h),c.appendUncheckList=!1,c.onActionComplete(p,t,e),c.groupTemplate&&c.renderGroupTemplate(p),c.isRequested=!1,c.bindChildItems(t,p,h,e),c.getInitialData?(c.getInitialData=!1,c.preventPopupOpen=!1):(c.isVirtualizationEnabled&&c.setCurrentView&&c.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}),null!=c.keyboardEvent&&c.handleVirtualKeyboardActions(c.keyboardEvent,c.pageCount),c.isVirtualizationEnabled&&(c.getFilteringSkeletonCount(),c.updatePopupPosition()),c.virtualSelectAll&&c.virtualSelectAllData&&(c.virtualSelectionAll(c.virtualSelectAllState,c.liCollections,c.CurrentEvent),c.virtualSelectAllState=!1,c.CurrentEvent=null,c.virtualSelectAll=!1))))})}).catch(function(e){c.isRequested=!1,c.isRequesting=!1,c.onActionFailure(e),c.hideSpinner()})}else{var e=!(c.isRequesting=!1),t=void 0,i=(c.isVirtualizationEnabled&&!c.virtualGroupDataSource&&c.fields.groupBy&&(a=new me(c.dataSource).executeLocal((new ya).group(c.fields.groupBy)),c.virtualGroupDataSource=a.records),c.isVirtualizationEnabled&&c.virtualGroupDataSource&&!c.isCustomDataUpdated?new me(c.virtualGroupDataSource):new me(o.data)),t=c.getQuery(o.query).executeLocal(i);if(!c.virtualSelectAll){var n=c.getQuery(o.query);if(c.isVirtualizationEnabled&&0!==t.count&&t.count<2*c.itemCount){if(n){for(var s=0;s<n.queries.length;s++)"onTake"===n.queries[s].fn&&(n.queries[s].e.nos=t.count,t=n.executeLocal(i)),"multiselect"!==c.getModuleName()||"or"!==n.queries[s].e.condition&&"equal"!==n.queries[s].e.operator||c.isCustomFiltering||(e=!1);e&&(t=n.executeLocal(i),c.isVirtualTrackHeight=!(c.dataSource instanceof me||c.isCustomDataUpdated))}}else if(c.isVirtualTrackHeight=!1,n)for(s=0;s<n.queries.length;s++)"multiselect"===c.getModuleName()&&(n.queries[s].e&&"or"===n.queries[s].e.condition||n.queries[s].e&&"equal"===n.queries[s].e.operator)&&(e=!1)}!e||c.dataSource instanceof me||c.isCustomDataUpdated||c.virtualSelectAll||(c.dataCount=c.totalItemCount=c.virtualSelectAll?t.length:t.count);var a={cancel:!1,result:t=c.isVirtualizationEnabled?t.result:t};c.isPreventChange=!(!c.isAngular||!c.preventChange)||c.isPreventChange,c.trigger("actionComplete",a,function(e){c.isCustomFiltering=!1,c.isIncrementalRequest?p=c.renderItems(e.result,h):e.cancel||(p=c.renderItems(e.result,h),c.onActionComplete(p,e.result,d),c.groupTemplate&&c.renderGroupTemplate(p),c.bindChildItems(e.result,p,h),c.getInitialData?(c.getInitialData=!1,c.preventPopupOpen=!1):setTimeout(function(){"multiselect"===c.getModuleName()&&null!=c.itemTemplate&&0<p.childElementCount&&(0<p.children[0].childElementCount||c.fields.groupBy&&p.children[1]&&0<p.children[1].childElementCount)&&c.updateDataList()}))})}})},Hz.prototype.handleVirtualKeyboardActions=function(e,t){},Hz.prototype.updatePopupState=function(){},Hz.prototype.updatePopupPosition=function(){},Hz.prototype.virtualSelectionAll=function(e,t,i){},Hz.prototype.updateRemoteData=function(){this.setListData(this.dataSource,this.fields,this.query)},Hz.prototype.bindChildItems=function(e,t,i,n){var o=this;100<=e.length&&"autocomplete"===this.getModuleName()?setTimeout(function(){ht(o.remainingItems(o.sortedData,i),t),o.liCollections=o.list.querySelectorAll("."+_z.li),o.updateListValues(),o.raiseDataBound(e,n)},0):this.raiseDataBound(e,n)},Hz.prototype.isObjectInArray=function(i,e){return e.some(function(t){return Object.keys(i).every(function(e){return Object.prototype.hasOwnProperty.call(t,e)&&t[e]===i[e]})})},Hz.prototype.updateListValues=function(){},Hz.prototype.findListElement=function(e,t,i,n){var o=null;if(e)for(var r=[].slice.call(e.querySelectorAll(t)),s=0;s<r.length;s++)if(r[s].getAttribute(i)===n+""){o=r[s];break}return o},Hz.prototype.raiseDataBound=function(e,t){this.hideSpinner(),this.trigger("dataBound",{items:e,e:t})},Hz.prototype.remainingItems=function(e,t){var i,e=new me(e).executeLocal((new ya).skip(100));return this.itemTemplate?(i=this.templateListItem(e,t),[].slice.call(i.childNodes)):"string"===(i=this.typeOfData(e).typeof)||"number"===i||"boolean"===i?X_.createListItemFromArray(this.createElement,e,!0,this.listOption(e,t),this):X_.createListItemFromJson(this.createElement,e,this.listOption(e,t),1,!0,this)},Hz.prototype.emptyDataRequest=function(e){var t=[];this.onActionComplete(this.renderItems(t,e),t),this.isRequested=!1,this.isRequesting=!1,this.hideSpinner()},Hz.prototype.showSpinner=function(){},Hz.prototype.hideSpinner=function(){},Hz.prototype.onActionFailure=function(e){this.liCollections=[],this.trigger("actionFailure",e),this.l10nUpdate(!0),je(this.list)||U([this.list],_z.noData)},Hz.prototype.onActionComplete=function(e,t,i){if(this.listData=t,!this.isVirtualizationEnabled||this.isCustomDataUpdated||this.virtualSelectAll||this.notify("setGeneratedData",{module:"VirtualScroll"}),"listbox"!==this.getModuleName()&&e.setAttribute("tabindex","0"),this.isReact&&this.clearTemplate(["itemTemplate","groupTemplate","actionFailureTemplate","noRecordsTemplate"]),this.isVirtualizationEnabled||(this.fixedHeaderElement=je(this.fixedHeaderElement)?this.fixedHeaderElement:null),"multiselect"===this.getModuleName()&&this.properties.allowCustomValue&&this.fields.groupBy)for(var n=0;n<e.childElementCount;n++)e.children[n].classList.contains("e-list-group-item")&&(je(e.children[n].innerHTML)||""===e.children[n].innerHTML)&&U([e.children[n]],"e-hide-group-header"),e.children[0].classList.contains("e-hide-group-header")&&gt(e.children[1],{zIndex:11});je(this.list)||this.isVirtualizationEnabled||(this.list.innerHTML="",this.list.appendChild(e),this.liCollections=this.list.querySelectorAll("."+_z.li),this.ulElement=this.list.querySelector("ul"),this.postRender(this.list,t,this.bindEvent))},Hz.prototype.postRender=function(e,t,i){if(this.fields.disabled)for(var n,o=e.querySelectorAll("."+_z.li),r=0;r<o.length;r++)JSON.parse(JSON.stringify(this.listData[r]))[this.fields.disabled]&&(je(this.fields.groupBy)?this.disableListItem(o[r]):(n=this.listData[r],n=R(this.fields.value||"value",n),je(n=e.querySelector('li[data-value="'+n+'"]'))||this.disableListItem(n)));var s=this.fields.disabled?e.querySelector("."+_z.li+":not(.e-disabled"):e.querySelector("."+_z.li),a=e.querySelector("."+_z.selected);s&&!a&&(s=this.isVirtualizationEnabled&&0!==this.viewPortInfo.startIndex&&(a=this.ulElement.querySelectorAll("li."+_z.li+":not(.e-virtual-list):not(.e-hide-listitem)"))&&0<a.length?a[2]:s)&&s.classList.add(_z.focus),t.length<=0?(this.l10nUpdate(),U([e],_z.noData)):e.classList.remove(_z.noData)},Hz.prototype.getQuery=function(e){return e||this.query||new ya},Hz.prototype.updateVirtualizationProperties=function(e,t,i){this.isVirtualizationEnabled=!0,this.virtualizedItemsCount=e,this.isAllowFiltering=t,this.isCheckBoxSelection=i},Hz.prototype.renderGroupTemplate=function(e){if(null!==this.fields.groupBy&&this.dataSource||this.element.querySelector("."+_z.group)){var t,i=this.dataSource,n={groupTemplateID:this.groupTemplateId,isStringTemplate:this.isStringTemplate},e=e.querySelectorAll("."+_z.group),o=this.templateCompiler(this.groupTemplate);if(t="function"!=typeof this.groupTemplate&&o?(o=ge(this.groupTemplate,document).innerHTML.trim(),X_.renderGroupTemplate(o,i,this.fields.properties,e,n,this)):X_.renderGroupTemplate(this.groupTemplate,i,this.fields.properties,e,n,this),this.isGroupChecking)for(var r=0;r<t.length;r++)this.notify("addItem",{module:"CheckBoxSelection",item:t[r]});this.renderReactTemplates()}},Hz.prototype.createListItems=function(e,t){var i;return e?(t.groupBy||this.element.querySelector("optgroup")?(t.groupBy&&("None"!==this.sortOrder&&(e=this.getSortedDataSource(e)),e=this.element.querySelector("optgroup")&&this.isGroupChecking&&"multiselect"===this.getModuleName()?X_.groupDataSource(e,t,this.sortOrder):X_.groupDataSource(e,t.properties,this.sortOrder)),U([this.list],_z.grouping)):"listbox"===this.getModuleName()&&("listbox"!==this.getModuleName()||this.preventDefActionFilter)||(e=this.getSortedDataSource(e)),t=this.listOption(e,t),i=100<e.length?new me(e).executeLocal((new ya).take(100)):e,this.sortedData=e,X_.createList(this.createElement,"autocomplete"===this.getModuleName()?i:e,t,!0,this)):null},Hz.prototype.listOption=function(e,t){var i=!je(t.iconCss),n=je(t.properties)?t:t.properties;return Pe({},null!==t.text||null!==t.value?{fields:n,showIcon:i,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}},t,!0)},Hz.prototype.setFloatingHeader=function(e){je(this.list)||this.list.classList.contains(_z.noData)||(je(this.fixedHeaderElement)&&(this.fixedHeaderElement=this.createElement("div",{className:_z.fixedHead}),je(this.list)||this.list.querySelector("li").classList.contains(_z.group)||(this.fixedHeaderElement.style.display="none"),je(this.fixedHeaderElement)||je(this.list)||lt([this.fixedHeaderElement],this.list),this.setFixedHeader()),je(this.fixedHeaderElement)||"0"!==this.fixedHeaderElement.style.zIndex||this.setFixedHeader(),this.scrollStop(e))},Hz.prototype.scrollStop=function(e,t){for(var i=je(e)?this.list:e.target,e=getComputedStyle(this.getValidLi(),null).getPropertyValue("height"),n=getComputedStyle(this.getValidLi(),null).getPropertyValue("margin-bottom"),n=parseInt(n,10),e="multiselect"===this.getModuleName()?parseFloat(e):parseInt(e,10),e=Math.round(i.scrollTop/(e+n)),o=this.list.querySelectorAll("li:not(.e-hide-listitem)"),r=this.list.querySelectorAll(".e-virtual-list").length,s=e;-1<s;s--){var a=this.isVirtualizationEnabled?s+r:s;if(this.isVirtualizationEnabled){if(this.fixedHeaderElement&&this.updateGroupHeader(a,o,i))break;!t||!je(o[a])&&o[a].classList.contains(_z.selected)&&"autocomplete"!==this.getModuleName()||!je(o[a])&&o[a].classList.contains(_z.focus)&&this.getModuleName()}else if(this.updateGroupHeader(a,o,i))break}},Hz.prototype.getPageCount=function(e){var t;return this.list?(t=this.list.classList.contains(_z.noData)?null:getComputedStyle(this.getItems()[0],null).getPropertyValue("height"),t=Math.round(this.list.getBoundingClientRect().height/parseInt(t,10)),e?t:Math.round(t)):0},Hz.prototype.updateGroupHeader=function(e,t,i){return!je(t[e])&&t[e].classList.contains(_z.group)?(this.updateGroupFixedHeader(t[e],i),!0):(this.fixedHeaderElement.style.display="none",!(this.fixedHeaderElement.style.top="none"))},Hz.prototype.updateGroupFixedHeader=function(e,t){this.fixedHeaderElement&&(je(e.innerHTML)||(this.fixedHeaderElement.innerHTML=e.innerHTML),this.fixedHeaderElement.style.position="fixed",this.fixedHeaderElement.style.top=this.list.parentElement.offsetTop+this.list.offsetTop-window.scrollY+"px",this.fixedHeaderElement.style.display="block")},Hz.prototype.getValidLi=function(){return this.isVirtualizationEnabled&&this.liCollections[0].classList.contains("e-virtual-list")?this.liCollections[this.skeletonCount]:this.liCollections[0]},Hz.prototype.renderItems=function(e,t,i){if(this.itemTemplate&&e){var n,o,r=e="multiselect"===this.getModuleName()&&this.virtualSelectAll?(this.virtualSelectAllData=e).slice(this.virtualItemStartIndex,this.virtualItemEndIndex):e,s=(r&&t.groupBy?("None"!==this.sortOrder&&(r=this.getSortedDataSource(r)),r=X_.groupDataSource(r,t.properties,this.sortOrder)):"listbox"===this.getModuleName()&&("listbox"!==this.getModuleName()||this.preventDefActionFilter)||(r=this.getSortedDataSource(r)),100<(this.sortedData=r).length?new me(r).executeLocal((new ya).take(100)):r),s=this.templateListItem("autocomplete"===this.getModuleName()?s:r,t);if(this.isIncrementalRequest)return this.incrementalLiCollections=s.querySelectorAll("."+_z.li),this.incrementalUlElement=s,this.incrementalListData=e,s;this.isVirtualizationEnabled&&(n=this.list.querySelector(".e-list-parent"),o=this.list.querySelector(".e-virtual-ddl-content"),e.length>=this.virtualizedItemsCount&&n&&o||n&&o&&this.isAllowFiltering||n&&o&&"autocomplete"===this.getModuleName()?("multiselect"===this.getModuleName()&&this.isCheckBoxSelection&&this.appendUncheckList&&this.list&&this.list.querySelector(".e-active")?(o.appendChild(s),i=!0):o.replaceChild(s,n),r=this.list.querySelectorAll(".e-reorder"),this.list.querySelector(".e-virtual-ddl-content")&&r&&0<r.length&&!i&&this.list.querySelector(".e-virtual-ddl-content").removeChild(r[0]),this.updateListElements(e)):o||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(s),this.updateListElements(e)))}else{if("multiselect"===this.getModuleName()&&this.virtualSelectAll&&(e=(this.virtualSelectAllData=e).slice(this.virtualItemStartIndex,this.virtualItemEndIndex)),s=this.createListItems(e,t),this.isIncrementalRequest)return this.incrementalLiCollections=s.querySelectorAll("."+_z.li),this.incrementalUlElement=s,this.incrementalListData=e,s;this.isVirtualizationEnabled&&(n=this.list.querySelector(".e-list-parent:not(.e-reorder)"),o=this.list.querySelector(".e-virtual-ddl-content"),!n&&this.list.querySelector(".e-list-parent.e-reorder")&&(n=this.list.querySelector(".e-list-parent.e-reorder")),e.length>=this.virtualizedItemsCount&&n&&o||n&&o&&this.isAllowFiltering||n&&o&&("autocomplete"===this.getModuleName()||"multiselect"===this.getModuleName())?(this.appendUncheckList?o.appendChild(s):o.replaceChild(s,n),this.updateListElements(e)):o&&o.firstChild||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(s),this.updateListElements(e)))}return s},Hz.prototype.createVirtualContent=function(){this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content"}))},Hz.prototype.updateListElements=function(e){this.liCollections=this.list.querySelectorAll("."+_z.li),this.ulElement=this.list.querySelector("ul"),this.listData=e,this.postRender(this.list,e,this.bindEvent)},Hz.prototype.templateListItem=function(e,t){var i=this.listOption(e,t),n=(i.templateID=this.itemTemplateId,i.isStringTemplate=this.isStringTemplate,this.templateCompiler(this.itemTemplate));return n="function"!=typeof this.itemTemplate&&n?(n=ge(this.itemTemplate,document).innerHTML.trim(),X_.renderContentTemplate(this.createElement,n,e,t.properties,i,this)):X_.renderContentTemplate(this.createElement,this.itemTemplate,e,t.properties,i,this),this.isVirtualizationEnabled&&this.isReact&&this.renderReactTemplates(),n},Hz.prototype.typeOfData=function(e){for(var t={typeof:null,item:null},i=0;!je(e)&&i<e.length;i++)if(!je(e[i])&&!je("string"==typeof e[i]||"number"==typeof e[i]||"boolean"==typeof e[i]?e[i]:R(this.fields.value||"value",e[i])))return{typeof:typeof e[i],item:e[i]};return t},Hz.prototype.setFixedHeader=function(){je(this.list)||(this.list.parentElement.style.display="block");var e=0,e=(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)),je(this.liCollections)||(e=this.getValidLi().offsetWidth-e,this.fixedHeaderElement.style.width=e.toString()+"px"),gt(this.fixedHeaderElement,{zIndex:10}),this.ulElement.querySelector("."+_z.group+":not(.e-hide-listitem)"));this.fixedHeaderElement.innerHTML=e.innerHTML},Hz.prototype.getSortedDataSource=function(e){var t;return e&&"None"!==this.sortOrder&&(t=this.fields.text||"text","string"!==this.typeOfData(e).typeof&&"number"!==this.typeOfData(e).typeof&&"boolean"!==this.typeOfData(e).typeof||(t=""),e=X_.getDataSource(e,X_.addSorting(this.sortOrder,t))),e},Hz.prototype.getIndexByValue=function(e){for(var t,i=[],i=this.fields.disabled&&"multiselect"===this.getModuleName()&&this.liCollections?this.liCollections:this.getItems(),n=0;n<i.length;n++)if(!je(e)&&i[n].getAttribute("data-value")===e.toString()){t=n;break}return t},Hz.prototype.getIndexByValueFilter=function(e,t){var i;if(!t)return null;var n=t.querySelectorAll("li:not(.e-list-group-item)");if(n)for(var o=0;o<n.length;o++)if(!je(e)&&n[o].getAttribute("data-value")===e.toString()){i=o;break}return i},Hz.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e&&e.dispatchEvent(i)},Hz.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.isPrimitiveData=!0,this.updateFields("text","text"))},Hz.prototype.resetList=function(e,t,i,n){this.list&&(("SELECT"===this.element.tagName&&0<this.element.options.length||"UL"===this.element.tagName&&0<this.element.childNodes.length)&&!(e instanceof Array?0<e.length:!je(e))&&this.selectData&&0<this.selectData.length&&(e=this.selectData),e="combobox"===this.getModuleName()&&this.selectData&&e instanceof Array&&e.length<this.selectData.length&&this.addedNewItem?this.selectData:e,this.addedNewItem=!1,this.setListData(e,t,i,n))},Hz.prototype.updateSelectElementData=function(e){(e||this.isVirtualizationEnabled)&&je(this.selectData)&&this.listData&&0<this.listData.length&&(this.selectData=this.listData)},Hz.prototype.updateSelection=function(){},Hz.prototype.renderList=function(){this.render()},Hz.prototype.updateDataSource=function(e,t){this.resetList(this.dataSource),this.totalItemCount=this.dataSource instanceof me?this.dataSource.dataSource.json.length:0},Hz.prototype.setUpdateInitial=function(e,t,i){this.isDataFetched=!1,this.isPrimitiveData=!1;for(var n={},o=0;e.length>o;o++)t[e[o]]&&"fields"===e[o]?(this.setFields(),n[e[o]]=t[e[o]]):t[e[o]]&&(n[e[o]]=t[e[o]]);0<Object.keys(n).length&&(-1===Object.keys(n).indexOf("dataSource")&&(n.dataSource=this.dataSource),"listbox"===this.getModuleName()?this.isReact&&(!this.isReact||je(t.dataSource)&&je(t.sortOrder))||this.updateDataSource(n,i):(this.isDynamicData=!0,this.updateDataSource(n,i)))},Hz.prototype.onPropertyChanged=function(e,t){"dropdownbase"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],e),this.setUpdateInitial(["sortOrder","itemTemplate"],e);for(var i,n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"query":case"sortOrder":case"dataSource":case"itemTemplate":break;case"enableRtl":this.setEnableRtl();break;case"groupTemplate":this.renderGroupTemplate(this.list),this.ulElement&&this.fixedHeaderElement&&(i=this.ulElement.querySelector("."+_z.group),this.fixedHeaderElement.innerHTML=i.innerHTML);break;case"locale":this.list&&!je(this.liCollections)&&0===this.liCollections.length&&this.l10nUpdate();break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0),this.setZIndex()}},Hz.prototype.render=function(e,t){"listbox"===this.getModuleName()?this.list=this.createElement("div",{className:_z.content,attrs:{tabindex:"0"}}):this.list=this.createElement("div",{className:_z.content}),this.list.classList.add(_z.root),this.setFields();this.rippleFun=Ht(this.list,{duration:300,selector:"."+_z.li});var i=this.element.querySelector("select>optgroup");!this.fields.groupBy&&je(i)||this.isGroupChecking||(E.add(this.list,"scroll",this.setFloatingHeader,this),E.add(document,"scroll",this.updateGroupFixedHeader,this)),"dropdownbase"===this.getModuleName()&&(this.element.getAttribute("tabindex")&&this.list.setAttribute("tabindex",this.element.getAttribute("tabindex")),q([this.element],_z.root),this.element.style.display="none",i=this.createElement("div"),this.element.parentElement.insertBefore(i,this.element),i.appendChild(this.element),i.appendChild(this.list)),this.setEnableRtl(),t||this.initialize(e)},Hz.prototype.removeScrollEvent=function(){this.list&&E.remove(this.list,"scroll",this.setFloatingHeader)},Hz.prototype.getModuleName=function(){return"dropdownbase"},Hz.prototype.getItems=function(){return this.ulElement.querySelectorAll("."+_z.li)},Hz.prototype.addItem=function(e,t){this.list&&(this.list.textContent!==this.noRecordsTemplate||"listbox"===this.getModuleName())||this.renderList(),"None"!==this.sortOrder&&je(t)&&((n=[].slice.call(this.listData)).push(e),n=this.getSortedDataSource(n),t=(this.fields.groupBy?n=X_.groupDataSource(n,this.fields.properties,this.sortOrder):n).indexOf(e));for(var i,n=this.getItems().length,o=0===n,r=this.list.querySelector("."+_z.selected),s=(e=e instanceof Array?e:[e],i=je(t)||t<0||n-1<t?n:t,this.fields),a=(e&&s.groupBy&&(e=X_.groupDataSource(e,s.properties)),[]),l=0;l<e.length;l++){var h,d=e[l],p=d.isHeader,c=this.createElement("li",{className:p?_z.group:_z.li,id:"option-add-"+l}),u=d instanceof Object?R(s.text,d):d;p&&(c.innerText=u),this.itemTemplate&&!p?(h=this.templateCompiler(this.itemTemplate),(h=("function"!=typeof this.itemTemplate&&h?oo(ge(this.itemTemplate,document).innerHTML.trim()):oo(this.itemTemplate))(d,this,"itemTemplate",this.itemTemplateId,this.isStringTemplate,null,c))&&ht(h,c)):p||c.appendChild(document.createTextNode(u)),c.setAttribute("data-value",d instanceof Object?R(s.value,d):d),c.setAttribute("role","option"),this.notify("addItem",{module:"CheckBoxSelection",item:c}),a.push(c),"listbox"===this.getModuleName()?(this.listData.splice(o?this.listData.length:i,0,d),this.listData.length!==this.sortedData.length&&(this.sortedData=this.listData)):this.listData.push(d),"None"===this.sortOrder&&je(t)&&0===i&&(i=null),"listbox"===this.getModuleName()?this.updateActionCompleteData(c,d,o?null:i+l):this.updateActionCompleteData(c,d,i),this.trigger("beforeItemRender",{element:c,item:d})}if(0===n&&je(this.list.querySelector("ul")))je(this.list)||(this.list.innerHTML="",this.list.classList.remove(_z.noData),this.isAddNewItemTemplate=!0,je(this.ulElement))||this.list.appendChild(this.ulElement),je(this.liCollections=a)||je(this.ulElement)||ht(a,this.ulElement),this.updateAddItemList(this.list,n);else{"listbox"===this.getModuleName()&&0===n&&(this.ulElement.innerHTML="");for(var g=[],l=0;l<e.length;l++){for(var m=this.ulElement.querySelectorAll(".e-list-group-item"),f=0;f<m.length;f++)g[f]=m[f].innerText;if(-1<g.indexOf(a[l].innerText)&&s.groupBy){for(f=0;f<m.length;f++)if(g[f]===a[l].innerText){"None"===this.sortOrder?this.ulElement.insertBefore(a[l+1],m[f+1]):this.ulElement.insertBefore(a[l+1],this.ulElement.childNodes[t]),l+=1;break}}else this.liCollections[i]&&this.liCollections[i].parentNode?this.liCollections[i].parentNode.insertBefore(a[l],this.liCollections[i]):t&&"listbox"===this.getModuleName()?this.ulElement.insertBefore(a[l],this.ulElement.childNodes[t+l]):this.ulElement.appendChild(a[l]);var y=[].slice.call(this.liCollections);y.splice(i,0,a[l]),this.liCollections=y,i+=1,"multiselect"===this.getModuleName()&&this.updateDataList()}}"listbox"===this.getModuleName()&&this.isReact&&this.renderReactTemplates(),!r&&0!==t||this.updateSelection(),this.addedNewItem=!0},Hz.prototype.isDisabledElement=function(e){return!(!e||!e.classList.contains("e-disabled"))},Hz.prototype.isDisabledItemByIndex=function(e){return!(!this.fields.disabled||!this.liCollections)&&this.isDisabledElement(this.liCollections[e])},Hz.prototype.disableListItem=function(e){e.classList.add("e-disabled"),e.setAttribute("aria-disabled","true"),e.setAttribute("aria-selected","false")},Hz.prototype.validationAttribute=function(e,t){for(var i,n=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id"),o=(t.setAttribute("name",n),e.removeAttribute("name"),["required","aria-required","form"]),r=0;r<o.length;r++)e.getAttribute(o[r])&&(i=e.getAttribute(o[r]),t.setAttribute(o[r],i),e.removeAttribute(o[r]))},Hz.prototype.setZIndex=function(){},Hz.prototype.updateActionCompleteData=function(e,t,i){},Hz.prototype.updateAddItemList=function(e,t){},Hz.prototype.updateDataList=function(){},Hz.prototype.getDataByValue=function(e){if(!je(this.listData)){var t=this.typeOfData(this.listData).typeof;if("string"===t||"number"===t||"boolean"===t){for(var i=0,n=this.listData;i<n.length;i++)if(!je(o=n[i])&&o===e)return o}else for(var o,r=0,s=this.listData;r<s.length;r++)if(!je(o=s[r])&&R(this.fields.value||"value",o)===e)return o}return null},Hz.prototype.destroy=function(){document&&(E.remove(document,"scroll",this.updateGroupFixedHeader),document.body.contains(this.list))&&(E.remove(this.list,"scroll",this.setFloatingHeader),je(this.rippleFun)||this.rippleFun(),G(this.list)),this.liCollections=null,this.ulElement=null,this.list=null,this.enableRtlElements=null,this.rippleFun=null,Vz.prototype.destroy.call(this)},wH([t({text:null,value:null,iconCss:null,groupBy:null,disabled:null},HH)],Hz.prototype,"fields",void 0),wH([e(null)],Hz.prototype,"itemTemplate",void 0),wH([e(null)],Hz.prototype,"groupTemplate",void 0),wH([e("No records found")],Hz.prototype,"noRecordsTemplate",void 0),wH([e("Request failed")],Hz.prototype,"actionFailureTemplate",void 0),wH([e("None")],Hz.prototype,"sortOrder",void 0),wH([e([])],Hz.prototype,"dataSource",void 0),wH([e(null)],Hz.prototype,"query",void 0),wH([e("StartsWith")],Hz.prototype,"filterType",void 0),wH([e(!0)],Hz.prototype,"ignoreCase",void 0),wH([e(1e3)],Hz.prototype,"zIndex",void 0),wH([e(!1)],Hz.prototype,"ignoreAccent",void 0),wH([e()],Hz.prototype,"locale",void 0),wH([i()],Hz.prototype,"actionBegin",void 0),wH([i()],Hz.prototype,"actionComplete",void 0),wH([i()],Hz.prototype,"actionFailure",void 0),wH([i()],Hz.prototype,"select",void 0),wH([i()],Hz.prototype,"dataBound",void 0),wH([i()],Hz.prototype,"created",void 0),wH([i()],Hz.prototype,"destroyed",void 0),wH([Bt],Hz));function Hz(e,t){e=Vz.call(this,e,t)||this;return e.preventChange=!1,e.isPreventChange=!1,e.isDynamicDataChange=!1,e.addedNewItem=!1,e.isAddNewItemTemplate=!1,e.isRequesting=!1,e.isVirtualizationEnabled=!1,e.isCustomDataUpdated=!1,e.isAllowFiltering=!1,e.virtualizedItemsCount=0,e.isCheckBoxSelection=!1,e.totalItemCount=0,e.dataCount=0,e.remoteDataCount=-1,e.isRemoteDataUpdated=!1,e.isIncrementalRequest=!1,e.itemCount=30,e.virtualListHeight=0,e.isVirtualScrolling=!1,e.isPreventScrollAction=!1,e.scrollPreStartIndex=0,e.isScrollActionTriggered=!1,e.previousStartIndex=0,e.isMouseScrollAction=!1,e.isKeyBoardAction=!1,e.isScrollChanged=!1,e.isUpwardScrolling=!1,e.startIndex=0,e.currentPageNumber=0,e.pageCount=0,e.isPreventKeyAction=!1,e.generatedDataObject={},e.skeletonCount=32,e.isVirtualTrackHeight=!1,e.virtualSelectAll=!1,e.incrementalQueryString="",e.incrementalEndIndex=0,e.incrementalStartIndex=0,e.incrementalPreQueryString="",e.isObjectCustomValue=!1,e.appendUncheckList=!1,e.getInitialData=!1,e.preventPopupOpen=!0,e.virtualSelectAllState=!1,e.CurrentEvent=null,e.isDynamicData=!1,e.isPrimitiveData=!1,e.isCustomFiltering=!1,e.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},e.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},e.selectedValueInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},e}zz=function(e,t){return(zz=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])}))(e,t)};var zz,jz,wH=function(e,t){function i(){this.constructor=e}zz(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Wz=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Qz={root:"e-dropdownlist",hover:_z.hover,selected:_z.selected,rtl:_z.rtl,li:_z.li,disable:_z.disabled,base:_z.root,focus:_z.focus,content:_z.content,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",resizeIcon:"e-resizer-right e-icons",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",virtualList:"e-list-item e-virtual-list"},Uz={container:null,buttons:[]},qz=(wH(Gz,jz=Oz),Gz.prototype.preRender=function(){this.valueTempElement=null,this.element.style.opacity="0",this.initializeData(),jz.prototype.preRender.call(this),this.activeIndex=this.index,this.queryString=""},Gz.prototype.initializeData=function(){this.isPopupOpen=!1,this.isDocumentClick=!1,this.isInteracted=!1,this.isFilterFocus=!1,this.beforePopupOpen=!1,this.initial=!0,this.initialRemoteRender=!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"},this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount}},Gz.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},Gz.prototype.requiredModules=function(){var e=[];return this.enableVirtualization&&e.push({args:[this],member:"VirtualScroll"}),e},Gz.prototype.renderList=function(e,t){jz.prototype.render.call(this,e,t),this.dataSource instanceof me||(this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0),this.enableVirtualization&&this.isFiltering()&&"combobox"===this.getModuleName()&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+_z.li),this.ulElement=this.list.querySelector("ul")),this.unWireListEvents(),this.wireListEvents()},Gz.prototype.floatLabelChange=function(){var e;"dropdownlist"===this.getModuleName()&&"Auto"===this.floatLabelType&&(e=this.inputWrapper.container.querySelector(".e-float-text"),""!==this.inputElement.value||this.isInteracted?mt(e,["e-label-top"],["e-label-bottom"]):mt(e,["e-label-bottom"],["e-label-top"]))},Gz.prototype.resetHandler=function(e){e.preventDefault(),this.clearAll(e),this.enableVirtualization&&(this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=0)},Gz.prototype.resetFocusElement=function(){var e;this.removeHover(),this.removeSelection(),this.removeFocus(),this.list.scrollTop=0,"autocomplete"!==this.getModuleName()&&!je(this.ulElement)&&(e=this.fields.disabled?this.ulElement.querySelector("."+Qz.li+":not(.e-disabled)"):this.ulElement.querySelector("."+Qz.li),e=this.enableVirtualization?this.liCollections[this.skeletonCount]:e)&&e.classList.add(Qz.focus)},Gz.prototype.clearAll=function(e,t){this.previousItemData=je(this.itemData)?null:this.itemData,!je(t)&&(je(t)||!je(t.dataSource)&&(t.dataSource instanceof me||0!==t.dataSource.length))||(this.isActive=!0,this.resetSelection(t));t=this.getItemData();!this.allowObjectBinding&&this.previousValue===t.value||this.allowObjectBinding&&this.previousValue&&this.isObjectInArray(this.previousValue,[this.allowCustom?this.value||t:t.value?this.getDataByValue(t.value):t])?(this.checkAndResetCache(),this.enableVirtualization&&this.list&&this.updateInitialData()):(this.onChangeEvent(e),this.checkAndResetCache(),this.enableVirtualization&&this.updateInitialData())},Gz.prototype.resetSelection=function(e){this.list&&(je(e)||!je(e.dataSource)&&(e.dataSource instanceof me||0!==e.dataSource.length)?(this.allowFiltering&&"autocomplete"!==this.getModuleName()&&!je(this.actionCompleteData.ulElement)&&!je(this.actionCompleteData.list)&&0<this.actionCompleteData.list.length&&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))),je(this.hiddenElement)||(this.hiddenElement.innerHTML=""),je(this.inputElement)||(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&&(G(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null),this.setSelection(null,null),this.isSelectCustom=!1,this.updateIconState(),this.cloneElements()},Gz.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i,n=t[e];"class"===n?""!==(i=this.htmlAttributes[""+n].replace(/\s+/g," ").trim())&&U([this.inputWrapper.container],i.split(" ")):"disabled"===n&&"disabled"===this.htmlAttributes[""+n]?(this.enabled=!1,this.setEnable()):"readonly"!==n||je(this.htmlAttributes[""+n])?"style"===n?this.inputWrapper.container.setAttribute("style",this.htmlAttributes[""+n]):"aria-label"===n?"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.readonly?"dropdownlist"===this.getModuleName()&&this.inputWrapper.container.setAttribute("aria-label",this.htmlAttributes[""+n]):this.inputElement.setAttribute("aria-label",this.htmlAttributes[""+n]):(i=["title","id","placeholder","role","autocomplete","autocapitalize","spellcheck","minlength","maxlength"],"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||i.push("tabindex"),-1<["name","required"].indexOf(n)||0===n.indexOf("data")?this.hiddenElement.setAttribute(n,this.htmlAttributes[""+n]):-1<i.indexOf(n)?"placeholder"===n?HF.setPlaceholder(this.htmlAttributes[""+n],this.inputElement):this.inputElement.setAttribute(n,this.htmlAttributes[""+n]):this.inputWrapper.container.setAttribute(n,this.htmlAttributes[""+n])):(this.readonly=!0,this.dataBind())}"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.inputWrapper.container.removeAttribute("tabindex")},Gz.prototype.getAriaAttributes=function(){return{"aria-disabled":"false",role:"combobox","aria-expanded":"false","aria-live":"polite","aria-labelledby":this.hiddenElement.id}},Gz.prototype.setEnableRtl=function(){je(this.inputElement)||je(this.inputElement.parentElement)||HF.setEnableRtl(this.enableRtl,[this.inputElement.parentElement]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},Gz.prototype.setEnable=function(){HF.setEnabled(this.enabled,this.inputElement),this.enabled?(q([this.inputWrapper.container],Qz.disable),this.inputElement.setAttribute("aria-disabled","false"),this.targetElement().setAttribute("tabindex",this.tabIndex),this.inputWrapper&&this.inputWrapper.container&&(this.inputWrapper.container.setAttribute("aria-disabled","false"),this.inputWrapper.container.removeAttribute("disabled"))):(this.hidePopup(),U([this.inputWrapper.container],Qz.disable),this.inputElement.setAttribute("aria-disabled","true"),this.targetElement().tabIndex=-1,this.inputWrapper&&this.inputWrapper.container&&(this.inputWrapper.container.setAttribute("aria-disabled","true"),this.inputWrapper.container.setAttribute("disabled","")))},Gz.prototype.getPersistData=function(){return this.addOnPersist(["value"])},Gz.prototype.getLocaleName=function(){return"drop-down-list"},Gz.prototype.preventTabIndex=function(e){"dropdownlist"===this.getModuleName()&&(e.tabIndex=-1)},Gz.prototype.targetElement=function(){return je(this.inputWrapper)?null:this.inputWrapper.container},Gz.prototype.getNgDirective=function(){return"EJS-DROPDOWNLIST"},Gz.prototype.getElementByText=function(e){return this.getElementByValue(this.getValueByText(e))},Gz.prototype.getElementByValue=function(e){for(var t,i=0,n=this.getItems();i<n.length;i++){var o=n[i];if(this.getFormattedValue(o.getAttribute("data-value"))===e){t=o;break}}return t},Gz.prototype.initValue=function(){this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.renderList(),this.dataSource instanceof me?this.initialRemoteRender=!0:this.updateValues()},Gz.prototype.isDisableItemValue=function(e){var t;return"object"==typeof e?(t=JSON.parse(JSON.stringify(e))[this.fields.value],this.isDisabledItemByIndex(this.getIndexByValue(t))):this.isDisabledItemByIndex(this.getIndexByValue(e))},Gz.prototype.updateValues=function(){if(this.fields.disabled&&(null!=this.value&&(this.value=this.isDisableItemValue(this.value)?null:this.value),null!=this.text&&(this.text=this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?null:this.text),null!=this.index)&&(this.index=this.isDisabledItemByIndex(this.index)?null:this.index,this.activeIndex=this.index),this.selectedValueInfo=this.viewPortInfo,je(this.value))if(this.text&&je(this.value)){var e=this.getElementByText(this.text);if(je(e))return void this.setProperties({text:null});this.setSelection(e,null)}else this.setSelection(this.liCollections[this.activeIndex],null);else{e=this.allowObjectBinding&&!je(this.value)?R(this.fields.value||"",this.value):this.value;this.setSelection(this.getElementByValue(e),null)}this.setHiddenValue(),HF.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},Gz.prototype.onBlurHandler=function(e){var t,i,n;this.enabled&&(t=e.relatedTarget,i=e.target,n=this.isPreventBlur,this.isPreventBlur=!1,n&&!this.isDocumentClick&&this.isPopupOpen&&(!je(i)||!this.isFilterLayout()&&je(t))?("dropdownlist"===this.getModuleName()&&this.allowFiltering&&this.isPopupOpen?this.filterInput:this.targetElement()).focus():this.isDocumentClick||!je(this.popupObj)&&document.body.contains(this.popupObj.element)&&this.popupObj.element.classList.contains(Qz.mobileFilter)?this.beforePopupOpen||(this.isDocumentClick=!1):(("dropdownlist"===this.getModuleName()&&!this.isFilterFocus&&t!==this.inputElement&&(document.activeElement!==t||document.activeElement===t&&i.classList.contains(Qz.inputFocus))||je(t)&&"dropdownlist"===this.getModuleName()&&this.allowFiltering&&i!==this.inputWrapper.container||"dropdownlist"!==this.getModuleName()&&!this.inputWrapper.container.contains(t)||this.isTabKey)&&(this.isDocumentClick=!!this.isPopupOpen,this.focusOutAction(e),this.isTabKey=!1),!this.isRequested||this.isPopupOpen||this.isPreventBlur||(this.isActive=!1,this.beforePopupOpen=!1),this.isFocused=!1))},Gz.prototype.focusOutAction=function(e){this.isInteracted=!1,this.focusOut(e),this.onFocusOut(e)},Gz.prototype.onFocusOut=function(e){this.enabled&&(this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.floatLabelChange(),this.dispatchEvent(this.hiddenElement,"change"),"dropdownlist"===this.getModuleName()&&"INPUT"!==this.element.tagName&&this.dispatchEvent(this.inputElement,"blur"),this.inputWrapper.clearButton&&U([this.inputWrapper.clearButton],Qz.clearIconHide),this.trigger("blur"))},Gz.prototype.onFocus=function(e){this.isInteracted||(this.isInteracted=!0,this.trigger("focus",{isInteracted:!!e,event:e})),this.updateIconState(),this.isFocused=!0},Gz.prototype.resizingWireEvent=function(){E.add(document,"mousemove",this.resizePopup,this),E.add(document,"mouseup",this.stopResizing,this),E.add(document,"touchmove",this.resizePopup,this),E.add(document,"touchend",this.stopResizing,this)},Gz.prototype.resizingUnWireEvent=function(){E.remove(document,"mousemove",this.resizePopup),E.remove(document,"mouseup",this.stopResizing),E.remove(document,"touchmove",this.resizePopup),E.remove(document,"touchend",this.stopResizing)},Gz.prototype.resetValueHandler=function(e){var t=z(this.inputElement,"form");t&&e.target===t&&(e=this.element.tagName===this.getNgDirective()?null:this.inputElement.getAttribute("value"),this.text=e)},Gz.prototype.wireEvent=function(){E.add(this.inputWrapper.container,"mousedown",this.dropDownClick,this),E.add(this.inputWrapper.container,"focus",this.focusIn,this),E.add(this.inputWrapper.container,"keypress",this.onSearch,this),E.add(window,"resize",this.windowResize,this),this.bindCommonEvent()},Gz.prototype.bindCommonEvent=function(){E.add(this.targetElement(),"blur",this.onBlurHandler,this);var e=z(this.inputElement,"form");e&&E.add(e,"reset",this.resetValueHandler,this),F.isDevice?this.keyboardModule=new bn(this.targetElement(),{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.keyboardModule=new bn(this.targetElement(),{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.bindClearEvent()},Gz.prototype.windowResize=function(){this.isPopupOpen&&this.popupObj.refreshPosition(this.inputWrapper.container)},Gz.prototype.bindClearEvent=function(){this.showClearButton&&E.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},Gz.prototype.unBindCommonEvent=function(){!je(this.inputWrapper)&&this.targetElement()&&E.remove(this.targetElement(),"blur",this.onBlurHandler);var e=this.inputElement&&z(this.inputElement,"form");e&&E.remove(e,"reset",this.resetValueHandler),F.isDevice||this.keyboardModule.destroy(),this.showClearButton&&E.remove(this.inputWrapper.clearButton,"mousedown",this.resetHandler)},Gz.prototype.updateIconState=function(){this.showClearButton&&(""===this.inputElement.value||this.readonly?U:q)([this.inputWrapper.clearButton],Qz.clearIconHide)},Gz.prototype.wireListEvents=function(){je(this.list)||(E.add(this.list,"click",this.onMouseClick,this),E.add(this.list,"mouseover",this.onMouseOver,this),E.add(this.list,"mouseout",this.onMouseLeave,this))},Gz.prototype.onSearch=function(e){32!==e.charCode&&13!==e.charCode&&(void 0===this.list&&this.renderList(),this.searchKeyEvent=e,this.onServerIncrementalSearch(e))},Gz.prototype.onServerIncrementalSearch=function(e){this.isRequested||je(this.list)||je(this.list.querySelector("li"))||!this.enabled||this.readonly||this.incrementalSearch(e)},Gz.prototype.startResizing=function(e){this.isResizing=!0,this.trigger("resizeStart",e);var t=(e instanceof MouseEvent?e:e.touches[0]).clientX,i=(e instanceof MouseEvent?e:e.touches[0]).clientY;this.list&&this.list.parentElement&&(this.originalWidth=this.list.parentElement.offsetWidth,this.originalHeight=this.list.parentElement.offsetHeight,this.originalMouseX=t,this.originalMouseY=i),this.resizingWireEvent(),e&&e.preventDefault()},Gz.prototype.resizePopup=function(e){var t,i,n,o;this.isResizing&&(this.trigger("resizing",e),t=(e instanceof MouseEvent?e:e.touches[0]).clientX,i=(e instanceof MouseEvent?e:e.touches[0]).clientY,t=t-this.originalMouseX,i=i-this.originalMouseY,this.list&&this.list.parentElement&&(n=(n=parseInt(window.getComputedStyle(this.list.parentElement).minWidth,10))||100,o=(o=parseInt(window.getComputedStyle(this.list.parentElement).minHeight,10))||120,this.resizeWidth=Math.max(this.originalWidth+t,n),this.resizeHeight=Math.max(this.originalHeight+i,o),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.fixedHeaderElement)&&this.ulElement&&(this.fixedHeaderElement.style.width=this.ulElement.offsetWidth+"px"),e)&&e.preventDefault()},Gz.prototype.stopResizing=function(e){this.isResizing&&(this.isResizing=!1,this.trigger("resizeStop",e),this.resizingUnWireEvent()),e&&e.preventDefault()},Gz.prototype.onMouseClick=function(e){var t=e.target,t=(this.keyboardEvent=null,z(t,"."+_z.li));this.isValidLI(t)&&!this.isDisabledElement(t)&&(this.setSelection(t,e),F.isDevice&&this.isFilterLayout()?history.back():this.closePopup(100,e))},Gz.prototype.onMouseOver=function(e){e=z(e.target,"."+_z.li);this.setHover(e)},Gz.prototype.setHover=function(e){this.enabled&&this.isValidLI(e)&&!e.classList.contains(_z.hover)&&(this.removeHover(),U([e],_z.hover))},Gz.prototype.onMouseLeave=function(){this.removeHover()},Gz.prototype.removeHover=function(){var e;this.list&&(e=this.list.querySelectorAll("."+_z.hover))&&e.length&&q(e,_z.hover)},Gz.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},Gz.prototype.updateIncrementalItemIndex=function(e,t){this.incrementalStartIndex=e,this.incrementalEndIndex=t},Gz.prototype.incrementalSearch=function(e){if(0<this.liCollections.length)if(this.enableVirtualization){for(var t=!1,i=!1,n=this.ulElement.getElementsByClassName("e-active")[0],o=n?n.textContent:null,r=(""===this.incrementalQueryString?(this.incrementalQueryString=String.fromCharCode(e.charCode),this.incrementalPreQueryString=this.incrementalQueryString):String.fromCharCode(e.charCode).toLocaleLowerCase()===this.incrementalPreQueryString.toLocaleLowerCase()?i=!0:this.incrementalQueryString=String.fromCharCode(e.charCode),(this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount||0===this.incrementalEndIndex)&&(t=!0,this.incrementalStartIndex=this.incrementalEndIndex,0===this.incrementalEndIndex?this.incrementalEndIndex=this.totalItemCount<100?this.totalItemCount:100:this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),t=!0),0===this.viewPortInfo.startIndex&&!t||this.updateIncrementalView(0,this.itemCount),__(e.charCode,this.incrementalLiCollections,this.activeIndex,!0,this.element.id,i,o,!0));je(r)&&this.incrementalEndIndex<this.totalItemCount&&(this.updateIncrementalItemIndex(this.incrementalEndIndex,this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),t=!0,0===this.viewPortInfo.startIndex&&!t||this.updateIncrementalView(0,this.itemCount),je(r=__(e.charCode,this.incrementalLiCollections,0,!0,this.element.id,i,o,!0,!0)));)if(je(r)&&this.incrementalEndIndex>=this.totalItemCount){this.updateIncrementalItemIndex(0,this.totalItemCount<100?this.totalItemCount:100);break}je(r)&&this.incrementalEndIndex>=this.totalItemCount&&(this.updateIncrementalItemIndex(0,this.totalItemCount<100?this.totalItemCount:100),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),t=!0,0===this.viewPortInfo.startIndex&&!t||this.updateIncrementalView(0,this.itemCount),r=__(e.charCode,this.incrementalLiCollections,0,!0,this.element.id,i,o,!0,!0));var s,a=r&&this.getIndexByValue(r.getAttribute("data-value"));if(a)a-=this.skeletonCount;else for(var l=0;l<this.incrementalLiCollections.length;l++)if(!je(r)&&!je(r.getAttribute("data-value"))&&this.incrementalLiCollections[l].getAttribute("data-value")===r.getAttribute("data-value").toString()){a=l,a=this.incrementalStartIndex+a;break}!a||this.viewPortInfo.startIndex>=a&&a>=this.viewPortInfo.endIndex||(h=0<a-(this.itemCount/2-2)?a-(this.itemCount/2-2):0,s=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount,this.updateIncrementalView(h,s)),je(r)?(this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0):(this.getIndexByValue(r.getAttribute("data-value"))-this.skeletonCount>this.itemCount/2&&(h=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,s=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount,this.updateIncrementalView(h,s)),r=this.getElementByValue(r.getAttribute("data-value")),this.setSelection(r,e),this.setScrollPosition(),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.enableVirtualization&&!this.fields.groupBy&&(n=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop,this.list.scrollTop=n-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight),this.incrementalPreQueryString=this.incrementalQueryString)}else{var h,r=void 0;je(r=this.fields.disabled?(h=this.list.querySelectorAll("."+_z.li+":not(.e-disabled)"),__(e.charCode,h,this.activeIndex,!0,this.element.id)):__(e.charCode,this.liCollections,this.activeIndex,!0,this.element.id))||(this.setSelection(r,e),this.setScrollPosition())}},Gz.prototype.hideSpinner=function(){je(this.spinnerElement)||(BA(this.spinnerElement),q([this.spinnerElement],Qz.disableIcon),this.spinnerElement.innerHTML="",this.spinnerElement=null)},Gz.prototype.showSpinner=function(){je(this.spinnerElement)&&(this.spinnerElement=F.isDevice&&!je(this.filterInputObj)&&this.filterInputObj.buttons[1]||!je(this.filterInputObj)&&this.filterInputObj.buttons[0]||this.inputWrapper.buttons[0],U([this.spinnerElement],Qz.disableIcon),mA({target:this.spinnerElement,width:F.isDevice?"16px":"14px"},this.createElement),kA(this.spinnerElement))},Gz.prototype.keyActionHandler=function(e){if(this.enabled){this.keyboardEvent=e,this.isPreventKeyAction&&this.enableVirtualization&&e.preventDefault();var t="pageUp"===e.action||"pageDown"===e.action,i="dropdownlist"!==this.getModuleName()&&("home"===e.action||"end"===e.action),n=(this.isEscapeKey="escape"===e.action,this.isTabKey=!this.isPopupOpen&&"tab"===e.action,"down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action);if((!(this.isEditTextBox()||t||i)||this.isPopupOpen)&&!this.readonly){t="tab"===e.action||"close"===e.action;if(!je(this.list)||this.isRequested||t||"escape"===e.action||(this.searchKeyEvent=e,this.enableVirtualization&&(!this.enableVirtualization||"autocomplete"===this.getModuleName()||"mousedown"===e.type||40!==e.keyCode&&38!==e.keyCode))||(this.renderList(e),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+_z.li),this.ulElement=this.list.querySelector("ul")),!(je(this.list)||!je(this.liCollections)&&n&&0===this.liCollections.length||this.isRequested))switch((t&&"autocomplete"!==this.getModuleName()&&this.isPopupOpen||"escape"===e.action)&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,this.isTyped=!n&&"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.isMouseScrollAction=!0,this.updateHomeEndAction(e);break;case"space":"dropdownlist"!==this.getModuleName()||this.beforePopupOpen||(this.showPopup(),e.preventDefault());break;case"open":this.showPopup(e);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))}}}},Gz.prototype.updateUpDownAction=function(e,t){if(!this.fields.disabled||!this.list||0!==this.list.querySelectorAll(".e-list-item:not(.e-disabled)").length){this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()&&(je(r=this.getItemData().value)&&(r="null"),je(s=this.getIndexByValue(r))||(this.activeIndex=s));var i,n,o,r,s,a,l=this.list.querySelector("."+Qz.focus);this.isSelectFocusItem(l)&&!t?(this.setSelection(l,e),this.enableVirtualization&&(o=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop,this.fields.groupBy&&(o=this.virtualListInfo&&0===this.virtualListInfo.startIndex?this.selectedLI.offsetHeight-o:o-this.selectedLI.offsetHeight),this.list.scrollTop=o-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight)):je(this.liCollections)||(l=this.activeIndex,h="down"===e.action?this.activeIndex+1:this.activeIndex-1,h=t?l:h,l=0,i=void("autocomplete"===this.getModuleName()&&(l="down"===e.action&&je(this.activeIndex)?0:this.liCollections.length-1,h=h<0?this.liCollections.length-1:h===this.liCollections.length?0:h)),("autocomplete"!==this.getModuleName()||"autocomplete"===this.getModuleName()&&this.isPopupOpen)&&(i=this.enableVirtualization?t?"autocomplete"===this.getModuleName()?(r=this.getFormattedValue(this.selectedLI.getAttribute("data-value")),this.getElementByValue(r)):this.getElementByValue(this.getItemData().value):(i=je(this.activeIndex)?this.liCollections[this.skeletonCount]:this.liCollections[h],je(i)||i.classList.contains("e-virtual-list")?null:i):je(this.activeIndex)?this.liCollections[l]:this.liCollections[h]),je(i)?this.enableVirtualization&&!this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&(this.viewPortInfo.endIndex!==this.totalItemCount&&"down"===e.action||0!==this.viewPortInfo.startIndex&&"up"===e.action)&&("down"===e.action?(this.viewPortInfo.startIndex=this.viewPortInfo.startIndex+this.itemCount<this.totalItemCount-this.itemCount?this.viewPortInfo.startIndex+this.itemCount:this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.viewPortInfo.startIndex+this.itemCount,this.updateVirtualItemIndex(),this.isCustomFilter="combobox"===this.getModuleName()||this.isCustomFilter,this.resetList(this.dataSource,this.fields,this.query),this.isCustomFilter="combobox"!==this.getModuleName()&&this.isCustomFilter,r="null"!==this.liCollections[0].getAttribute("data-value")?this.getFormattedValue(this.liCollections[0].getAttribute("data-value")):null,(n=this.getDataByValue(r))&&(this.itemData=n)):"up"===e.action&&(this.viewPortInfo.startIndex=0<this.viewPortInfo.startIndex-this.itemCount?this.viewPortInfo.startIndex-this.itemCount:0,this.viewPortInfo.endIndex=this.viewPortInfo.startIndex+this.itemCount,this.updateVirtualItemIndex(),this.isCustomFilter="combobox"===this.getModuleName()||this.isCustomFilter,this.resetList(this.dataSource,this.fields,this.query),this.isCustomFilter="combobox"!==this.getModuleName()&&this.isCustomFilter,r="null"!==this.liCollections[this.liCollections.length-1].getAttribute("data-value")?this.getFormattedValue(this.liCollections[this.liCollections.length-1].getAttribute("data-value")):null,n=this.getDataByValue(r))&&(this.itemData=n),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+_z.li),this.ulElement=this.list.querySelector("ul"),this.handleVirtualKeyboardActions(e,this.pageCount)):(l=this.liCollections[this.skeletonCount]&&this.liCollections[this.skeletonCount].classList.contains("e-item-focus"),this.setSelection(i,e),l&&this.enableVirtualization&&"autocomplete"===this.getModuleName()&&!t&&(o=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop,o=this.virtualListInfo&&0===this.virtualListInfo.startIndex&&this.fields.groupBy?this.selectedLI.offsetHeight-o:o-this.selectedLI.offsetHeight,this.list.scrollTop=o-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight))),this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()&&(r=this.getItemData().value,je(s=this.getIndexByValueFilter(r,this.actionCompleteData.ulElement))||(this.activeIndex=s)),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&this.filterInput&&(je(this.ulElement)||je(this.ulElement.getElementsByClassName("e-item-focus")[0])?je(this.ulElement)||je(this.ulElement.getElementsByClassName("e-active")[0])||pt(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):pt(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}));for(var h=0;h<this.liCollections.length;h++)if(this.liCollections[h].classList.contains(Qz.focus)||this.liCollections[h].classList.contains(Qz.selected)){a=h;break}null!=a&&this.isDisabledElement(this.liCollections[a])&&("autocomplete"!==this.getModuleName()&&(this.liCollections.length-1===a&&"down"===e.action&&(e.action="up"),0===a)&&"up"===e.action&&(e.action="down"),this.updateUpDownAction(e)),e.preventDefault()}},Gz.prototype.updateHomeEndAction=function(e,t){var i;"dropdownlist"===this.getModuleName()&&(i=0,"home"===e.action?(i=0,this.enableVirtualization&&this.isPopupOpen?i=this.skeletonCount:this.enableVirtualization&&!this.isPopupOpen&&0!==this.viewPortInfo.startIndex&&(this.viewPortInfo.startIndex=0,this.viewPortInfo.endIndex=this.itemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query))):(this.enableVirtualization&&!this.isPopupOpen&&this.viewPortInfo.endIndex!==this.totalItemCount&&(this.viewPortInfo.startIndex=this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.totalItemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query)),i=this.getItems().length-1),e.preventDefault(),this.activeIndex===i?t&&this.setSelection(this.liCollections[i],e):!this.enableVirtualization&&this.liCollections[i]&&this.liCollections[i].classList.contains("e-disabled")||this.setSelection(this.liCollections[i],e))},Gz.prototype.selectCurrentValueOnTab=function(e){"autocomplete"===this.getModuleName()?this.selectCurrentItem(e):this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))},Gz.prototype.mobileKeyActionHandler=function(e){!this.enabled||this.isEditTextBox()&&!this.isPopupOpen||this.readonly||(void 0!==this.list||this.isRequested||(this.searchKeyEvent=e,this.renderList()),je(this.list))||!je(this.liCollections)&&0===this.liCollections.length||this.isRequested||"enter"===e.action&&this.selectCurrentItem(e)},Gz.prototype.handleVirtualKeyboardActions=function(e,t){switch(e.action){case"down":case"up":null==this.itemData&&"autocomplete"!==this.getModuleName()||this.updateUpDownAction(e,!0);break;case"pageUp":this.activeIndex="autocomplete"===this.getModuleName()?this.getIndexByValue(this.selectedLI.getAttribute("data-value"))+this.getPageCount()-1:this.getIndexByValue(this.previousValue),this.pageUpSelection(this.activeIndex-this.getPageCount(),e,!0),e.preventDefault();break;case"pageDown":this.activeIndex="autocomplete"===this.getModuleName()?this.getIndexByValue(this.selectedLI.getAttribute("data-value"))-this.getPageCount():this.getIndexByValue(this.previousValue),this.pageDownSelection(je(this.activeIndex)?2*this.getPageCount():this.activeIndex+this.getPageCount(),e,!0),e.preventDefault();break;case"home":case"end":this.isMouseScrollAction=!0,this.updateHomeEndAction(e,!0)}this.keyboardEvent=null},Gz.prototype.selectCurrentItem=function(e){var t;this.isPopupOpen?(t=this.list.querySelector("."+Qz.focus),this.isDisabledElement(t)||(t&&(this.setSelection(t,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.hidePopup(e),this.focusDropDown(e))):this.showPopup()},Gz.prototype.isSelectFocusItem=function(e){return!je(e)},Gz.prototype.pageUpSelection=function(e,t,i){var n=0<=e?this.liCollections[e+1]:this.liCollections[0];if(!this.enableVirtualization&&n&&n.classList.contains("e-disabled"))for(var o=0<=e?e+1:0;o<this.liCollections.length&&(!(n=this.liCollections[o])||n.classList.contains("e-disabled"));)if(--o<0)return;!je(n=this.enableVirtualization&&null==this.activeIndex?this.liCollections.length>=e&&0<=e?this.liCollections[e+this.skeletonCount+1]:this.liCollections[0]:n)&&n.classList.contains("e-virtual-list")&&(n=this.liCollections[this.skeletonCount]),this.PageUpDownSelection(n,t),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(je(this.ulElement)||je(this.ulElement.getElementsByClassName("e-item-focus")[0])?je(this.ulElement)||je(this.ulElement.getElementsByClassName("e-active")[0])||pt(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):pt(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},Gz.prototype.PageUpDownSelection=function(e,t){this.enableVirtualization&&(je(e)||("autocomplete"===this.getModuleName()||e.classList.contains("e-active"))&&("autocomplete"!==this.getModuleName()||e.classList.contains("e-item-focus")))||this.setSelection(e,t)},Gz.prototype.pageDownSelection=function(e,t,i){var n=this.getItems(),o=e<=n.length?this.liCollections[e-1]:this.liCollections[n.length-1];if(!this.enableVirtualization&&o&&o.classList.contains("e-disabled"))for(;0<=e&&e<this.liCollections.length&&(!(o=e<=n.length?this.liCollections[e-1]:this.liCollections[n.length-1])||o.classList.contains("e-disabled"));)e++;this.enableVirtualization&&0<this.skeletonCount&&(o=(e="dropdownlist"===this.getModuleName()&&this.allowFiltering?e+1:e)<n.length?this.liCollections[e]:this.liCollections[n.length-1]),this.enableVirtualization&&null==this.activeIndex&&(o=e<=n.length?this.liCollections[e+this.skeletonCount-1]:this.liCollections[n.length-1]),this.PageUpDownSelection(o,t),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(je(this.ulElement)||je(this.ulElement.getElementsByClassName("e-item-focus")[0])?je(this.ulElement)||je(this.ulElement.getElementsByClassName("e-active")[0])||pt(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):pt(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},Gz.prototype.unWireEvent=function(){je(this.inputWrapper)||(E.remove(this.inputWrapper.container,"mousedown",this.dropDownClick),E.remove(this.inputWrapper.container,"keypress",this.onSearch),E.remove(this.inputWrapper.container,"focus",this.focusIn),E.remove(window,"resize",this.windowResize)),this.unBindCommonEvent()},Gz.prototype.unWireListEvents=function(){this.list&&(E.remove(this.list,"click",this.onMouseClick),E.remove(this.list,"mouseover",this.onMouseOver),E.remove(this.list,"mouseout",this.onMouseLeave))},Gz.prototype.checkSelector=function(e){return'[id="'+e.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g,"\\$1")+'"]'},Gz.prototype.onDocumentClick=function(e){var t=e.target;!je(this.popupObj)&&z(t,this.checkSelector(this.popupObj.element.id))||je(this.inputWrapper)||this.inputWrapper.container.contains(e.target)?t===this.inputElement||this.allowFiltering&&t===this.filterInput||"combobox"===this.getModuleName()&&!this.allowFiltering&&F.isDevice&&t===this.inputWrapper.buttons[0]||(this.isPreventBlur=(F.isIE||"edge"===F.info.name)&&(document.activeElement===this.targetElement()||document.activeElement===this.filterInput),e.preventDefault()):(this.inputWrapper.container.classList.contains(Qz.inputFocus)||this.isPopupOpen)&&(this.isDocumentClick=!0,t=this.isRequested,"combobox"===this.getModuleName()&&this.isTyped&&(this.isInteracted=!1),this.hidePopup(e),this.isInteracted=!1,t||(this.onFocusOut(e),this.inputWrapper.container.classList.remove(Qz.inputFocus)))},Gz.prototype.activeStateChange=function(){this.isDocumentClick&&(this.hidePopup(),this.onFocusOut(),this.inputWrapper.container.classList.remove(Qz.inputFocus))},Gz.prototype.focusDropDown=function(e){!this.initial&&this.isFilterLayout()&&this.focusIn(e)},Gz.prototype.dropDownClick=function(e){var t,i;3===e.which||2===e.button||(this.keyboardEvent=null,this.targetElement().classList.contains(Qz.disable))||this.inputWrapper.clearButton===e.target||((i=e.target)===this.inputElement||this.allowFiltering&&i===this.filterInput||"combobox"===this.getModuleName()||e.preventDefault(),this.readonly?this.focusIn(e):(this.isPopupOpen?(this.hidePopup(e),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(e)),i=(t=this).element.tagName===this.getNgDirective()&&this.itemTemplate?500:100,this.isSecondClick||setTimeout(function(){t.cloneElements(),t.isSecondClick=!0,t.isSecondClick=!(t.isReact&&t.isFiltering()&&t.dataSource instanceof me&&!t.list.querySelector("ul"))},i)))},Gz.prototype.cloneElements=function(){var e;this.list&&(e=this.list.querySelector("ul"))&&(e=e.cloneNode?e.cloneNode(!0):e,this.actionCompleteData.ulElement=e)},Gz.prototype.updateSelectedItem=function(t,i,n,o){var e,r=this,s=(this.removeSelection(),t.classList.add(_z.selected),this.removeHover(),null!==t.getAttribute("data-value")?this.getFormattedValue(t.getAttribute("data-value")):null),a=this.getDataByValue(s);this.initial||n||je(i)?(this.selectEventCallback(t,i,n,a,s),o&&this.setSelectOptions(t,i)):(e=this.detachChanges(a),this.isSelected=!0,this.trigger("select",{e:i,item:t,itemData:e,isInteracted:!!i,cancel:!1},function(e){e.cancel?t.classList.remove(_z.selected):(r.selectEventCallback(t,i,n,a,s),o&&r.setSelectOptions(t,i))}))},Gz.prototype.selectEventCallback=function(e,t,i,n,o){this.previousItemData=je(this.itemData)?null:this.itemData,this.itemData!==n&&(this.previousValue=je(this.itemData)?null:"object"!=typeof this.itemData||this.allowObjectBinding?this.itemData:this.checkFieldValue(this.itemData,this.fields.value.split("."))),this.item=e,this.itemData=n;var n=this.list.querySelector("."+_z.focus);n&&q([n],_z.focus),e.setAttribute("aria-selected","true"),je(o)&&(o="null"),this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()?je(n=this.getIndexByValueFilter(o,this.actionCompleteData.ulElement))?this.activeIndex=this.getIndexByValue(o):this.activeIndex=n:(this.enableVirtualization&&null==this.activeIndex&&this.dataSource instanceof me&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+_z.li),this.ulElement=this.list.querySelector("ul")),this.activeIndex=this.getIndexByValue(o))},Gz.prototype.activeItem=function(e){this.isValidLI(e)&&!e.classList.contains(_z.selected)&&(this.removeSelection(),e.classList.add(_z.selected),this.removeHover(),e.setAttribute("aria-selected","true"))},Gz.prototype.setValue=function(e){var t=this.getItemData(),e=(this.isTouched=!je(e),null===t.value?HF.setValue(null,this.inputElement,this.floatLabelType,this.showClearButton):HF.setValue(t.text,this.inputElement,this.floatLabelType,this.showClearButton),this.valueTemplate&&null!==this.itemData?this.setValueTemplate():je(this.valueTempElement)||this.inputElement.previousSibling!==this.valueTempElement||(G(this.valueTempElement),this.inputElement.style.display="block"),je(t.value)||this.enableVirtualization||!this.allowFiltering||(this.activeIndex=this.getIndexByValueFilter(t.value,this.actionCompleteData.ulElement)),Qz.clearIcon),e=this.isFiltering()&&this.filterInput&&"combobox"===this.getModuleName()&&this.filterInput.parentElement.querySelector("."+e);return this.isFiltering()&&e&&e.style.removeProperty("visibility"),!this.allowObjectBinding&&this.previousValue===t.value||this.allowObjectBinding&&null!=this.previousValue&&this.isObjectInArray(this.previousValue,[this.allowCustom&&this.isObjectCustomValue?this.value||t:t.value?this.getDataByValue(t.value):t])?!(this.isSelected=!1):(this.isSelected=!this.initial,this.isSelectCustom=!1,"dropdownlist"===this.getModuleName()&&this.updateIconState(),!1)},Gz.prototype.setSelection=function(e,t){var i,n,o;this.isValidLI(e)&&(!e.classList.contains(_z.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(_z.selected))?this.updateSelectedItem(e,t,!1,!0):(this.setSelectOptions(e,t),this.enableVirtualization&&this.value&&(e=this.isPrimitiveData?"":this.fields.value,t=this.allowObjectBinding&&!je(this.value)?R(this.fields.value||"",this.value):this.value,this.dataSource instanceof me?(i=new me(this.virtualGroupDataSource).executeLocal((new ya).where(new ba(e,"equal",t))))&&0<i.length&&(this.itemData=i[0],n=this.getItemData(),o=this.allowObjectBinding?this.getDataByValue(n.value):n.value,this.value===n.value&&this.text!==n.text||this.value!==n.value&&this.text===n.text)&&this.setProperties({text:n.text&&n.text.toString(),value:o}):(i=new me(this.dataSource).executeLocal((new ya).where(new ba(e,"equal",t))))&&0<i.length&&(this.itemData=i[0],n=this.getItemData(),o=this.allowObjectBinding?this.getDataByValue(n.value):n.value,this.value===n.value&&this.text!==n.text||this.value!==n.value&&this.text===n.text)&&this.setProperties({text:n.text&&n.text.toString(),value:o})))},Gz.prototype.setSelectOptions=function(e,t){this.list&&this.removeHover(),this.previousSelectedLI=je(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.setValue(t)||((!this.isPopupOpen&&!je(e)||this.isPopupOpen&&!je(t)&&("keydown"!==t.type||"keydown"===t.type&&"enter"===t.action))&&(this.isSelectCustom=!1,this.onChangeEvent(t)),!this.isPopupOpen||je(this.selectedLI)||null===this.itemData||t&&"click"===t.type||this.setScrollPosition(t),"mozilla"!==F.info.name&&this.targetElement()&&(pt(this.targetElement(),{"aria-describedby":(""!==this.inputElement.id?this.inputElement:this.element).id}),this.targetElement().removeAttribute("aria-live")),!this.isPopupOpen||je(this.ulElement)||je(this.ulElement.getElementsByClassName("e-item-focus")[0])?!this.isPopupOpen||je(this.ulElement)||je(this.ulElement.getElementsByClassName("e-active")[0])||pt(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):pt(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},Gz.prototype.dropdownCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!document.querySelectorAll(e).length}catch(e){t=!1}return t},Gz.prototype.setValueTemplate=function(){this.isReact&&(this.clearTemplate(["valueTemplate"]),this.valueTempElement)&&(G(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null),this.valueTempElement||(this.valueTempElement=this.createElement("span",{className:Qz.value}),this.inputElement.parentElement.insertBefore(this.valueTempElement,this.inputElement),this.inputElement.style.display="none"),this.isReact||(this.valueTempElement.innerHTML="");var e=this.dropdownCompiler(this.valueTemplate),e="function"!=typeof this.valueTemplate&&e?oo(document.querySelector(this.valueTemplate).innerHTML.trim()):oo(this.valueTemplate),e=e(this.itemData,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,this.valueTempElement);e&&0<e.length&&ht(e,this.valueTempElement),this.renderReactTemplates()},Gz.prototype.removeSelection=function(){var e;this.list&&(e=this.list.querySelectorAll("."+_z.selected)).length&&(q(e,_z.selected),e[0].removeAttribute("aria-selected"))},Gz.prototype.getItemData=function(){var e,t,i,n=this.fields;return je(i=this.itemData)||(e=R(n.value,i),t=R(n.text,i)),{value:je(i)||ee(e)?i:e,text:je(i)||ee(e)?i:t}},Gz.prototype.onChangeEvent=function(e,t){var i=this,n=this.getItemData(),o=this.isSelectCustom?null:this.activeIndex,r=(this.enableVirtualization&&(r=this.dataSource instanceof me?this.virtualGroupDataSource:this.dataSource,n.value)&&r&&0<r.length&&-1!==(r=r.findIndex(function(e){return!je(n.value)&&R(i.fields.value,e)===n.value}))&&(o=r),this.allowObjectBinding?t?this.value:this.getDataByValue(n.value):n.value);this.setProperties({index:o,text:n.text&&n.text.toString(),value:r},!0),this.detachChangeEvent(e)},Gz.prototype.detachChanges=function(e){e="string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e;return e},Gz.prototype.detachChangeEvent=function(e){var t,i;this.isSelected=!1,this.previousValue=this.value,this.activeIndex=this.enableVirtualization?this.getIndexByValue(this.value):this.index,this.typedString=je(this.text)?"":this.text,this.initial||(i=this.detachChanges(this.itemData),t=void 0,t="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(),i={e:e,item:this.item,itemData:i,previousItem:this.previousSelectedLI,previousItemData:t,isInteracted:!!e,value:this.value,element:this.element,event:e},this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",i)),!je(this.value)&&""!==this.value||"Always"===this.floatLabelType||q([this.inputWrapper.container],"e-valid-input")},Gz.prototype.setHiddenValue=function(){var e,t,i;je(this.value)?this.hiddenElement.innerHTML="":(e=this.allowObjectBinding&&!je(this.value)?R(this.fields.value||"",this.value):this.value,this.hiddenElement.querySelector("option")?((i=this.hiddenElement.querySelector("option")).textContent=this.text,i.setAttribute("value",e.toString())):je(this.hiddenElement)||((t=document.createElement("option")).text=this.text,t.setAttribute("selected",""),this.hiddenElement.appendChild(t),(i=this.hiddenElement.querySelector("option")).setAttribute("value",e.toString())))},Gz.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,this.filterArgs=e,this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,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,"autocomplete"!==this.getModuleName()||je(this.ulElement)||je(this.ulElement.getElementsByClassName("e-item-focus")[0])||pt(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}),e.preventDefault();break;case 46:case 8:this.typedString=this.filterInput.value,!this.isPopupOpen&&""!==this.typedString||this.isPopupOpen&&0<this.queryString.length||""===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.isFiltering()&&"combobox"===this.getModuleName()&&je(this.list)&&(this.getInitialData=!0,this.renderList(),this.isSecondClick||this.isDropDownClick||this.executeCloneElements()),this.typedString=this.filterInput.value,this.preventAutoFill=!1,this.getInitialData||this.searchLists(e),(this.enableVirtualization&&"autocomplete"!==this.getModuleName()||"autocomplete"===this.getModuleName()&&!(this.dataSource instanceof me)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof me&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount()}},Gz.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}},Gz.prototype.removeFillSelection=function(){var e;this.isInteracted&&(e=this.getSelectionPoints(),this.inputElement.setSelectionRange(e.end,e.end))},Gz.prototype.getQuery=function(e){var t,i,n;if(!this.isCustomFilter&&this.allowFiltering&&this.filterInput?(t=e?e.clone():this.query?this.query.clone():new ya,i=""===this.typedString?"contains":this.filterType,n=this.typeOfData(this.dataSource).typeof,(this.dataSource instanceof me||"string"!==n)&&"number"!==n?("combobox"!==this.getModuleName()||this.isFiltering()&&"combobox"===this.getModuleName()&&""!==this.typedString)&&(n=this.fields.text||"",t.where(n,i,this.typedString,this.ignoreCase,this.ignoreAccent)):t.where("",i,this.typedString,this.ignoreCase,this.ignoreAccent)):t=this.enableVirtualization&&!je(this.customFilterQuery)?this.customFilterQuery.clone():e?e.clone():this.query?this.query.clone():new ya,this.enableVirtualization&&0!==this.viewPortInfo.endIndex){var o=this.getTakeValue(),r=!1;if(t)for(var s=0;s<t.queries.length;s++)if("onSkip"===t.queries[s].fn){r=!0;break}var a=0,l=0;if(t&&0<t.queries.length)for(s=0;s<t.queries.length;s++)"onSkip"===t.queries[s].fn&&(l=t.queries[s].e.nos),"onTake"===t.queries[s].fn&&(a=o<=t.queries[s].e.nos?t.queries[s].e.nos:o);if(a<=0&&this.query&&0<this.query.queries.length)for(s=0;s<this.query.queries.length;s++)"onTake"===this.query.queries[s].fn&&(a=o<=this.query.queries[s].e.nos?this.query.queries[s].e.nos:o);if(t&&0<t.queries.length)for(s=0;s<t.queries.length;s++)"onSkip"===t.queries[s].fn?(l=t.queries[s].e.nos,t.queries.splice(s,1),r=!1,--s):"onTake"===t.queries[s].fn&&(a=t.queries[s].e.nos<=a?a:t.queries[s].e.nos,t.queries.splice(s,1),--s);!this.allowFiltering&&this.isPopupOpen&&r||(0<l?t.skip(l):t.skip(this.virtualItemStartIndex)),this.isIncrementalRequest?t.take(this.incrementalEndIndex):0<a?t.take(a):t.take(o),t.requiresCount()}return t},Gz.prototype.getSelectionPoints=function(){var e=this.inputElement;return{start:Math.abs(e.selectionStart),end:Math.abs(e.selectionEnd)}},Gz.prototype.searchLists=function(e){var n,o=this;this.isTyped=!0,this.activeIndex=null,this.isListSearched=!0,this.filterInput.parentElement.querySelector("."+Qz.clearIcon)&&(this.filterInput.parentElement.querySelector("."+Qz.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible"),this.isDataFetched=!1,this.isFiltering()&&(this.checkAndResetCache(),n={preventDefaultAction:this.isRequesting=!1,text:this.filterInput.value,updateData:function(e,t,i){n.cancel||(o.isCustomFilter=!0,o.customFilterQuery=t&&t.clone(),o.filteringAction(e,t,i))},baseEventArgs:e,cancel:!1},this.trigger("filtering",n,function(e){e.cancel||o.isCustomFilter||e.preventDefaultAction||o.filteringAction(o.dataSource,null,o.fields)}))},Gz.prototype.filter=function(e,t,i){this.isCustomFilter=!0,this.filteringAction(e,t,i)},Gz.prototype.filteringAction=function(e,t,i){var n,o,r;je(this.filterInput)||(this.beforePopupOpen=!(!this.isPopupOpen&&"combobox"===this.getModuleName()&&""===this.filterInput.value||this.getInitialData),n=this.list.classList.contains(_z.noData),""!==this.filterInput.value.trim()||this.itemTemplate?(this.isNotSearchList=!1,t=""===this.filterInput.value.trim()?null:t,this.enableVirtualization&&this.isFiltering()&&this.isTyped&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.resetList(e,i,t),"dropdownlist"===this.getModuleName()&&this.list.classList.contains(_z.noData)&&(this.popupContentElement.setAttribute("role","status"),this.popupContentElement.setAttribute("id","no-record"),pt(this.filterInputObj.container,{"aria-activedescendant":"no-record"})),this.enableVirtualization&&n&&!this.list.classList.contains(_z.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||((o=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(o).appendChild(this.list.querySelector(".e-list-parent"))),this.list.querySelector(".e-virtual-ddl")||((r=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(r)))):(this.actionCompleteData.isUpdated=!1,this.isTyped=!1,je(this.actionCompleteData.ulElement)||je(this.actionCompleteData.list)||(this.enableVirtualization&&(this.isFiltering()&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.resetList(e,i,t),n)&&!this.list.classList.contains(_z.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||((o=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(o).appendChild(this.list.querySelector(".e-list-parent"))),this.list.querySelector(".e-virtual-ddl")||((r=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(r))),this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list)),this.isTyped=!0,je(this.itemData)||"dropdownlist"!==this.getModuleName()||(this.focusIndexItem(),this.setScrollPosition()),this.isNotSearchList=!0),this.enableVirtualization&&this.getFilteringSkeletonCount(),this.renderReactTemplates(),this.filterInput&&""===this.filterInput.value&&"combobox"===this.getModuleName()&&this.executeCloneElements())},Gz.prototype.setSearchBox=function(e){var t,i;return this.isFiltering()?(t=e.querySelector("."+Qz.filterParent)?e.querySelector("."+Qz.filterParent):this.createElement("span",{className:Qz.filterParent}),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:Qz.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element),i=!1,F.isDevice&&this.isDeviceFullScreen&&(i=!0),this.filterInputObj=HF.createInput({element:this.filterInput,buttons:i?[Qz.backIcon,Qz.filterBarClearIcon]:[Qz.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),je(this.cssClass)||(-1!==this.cssClass.split(" ").indexOf("e-outline")?U([this.filterInputObj.container],"e-outline"):-1!==this.cssClass.split(" ").indexOf("e-filled")&&U([this.filterInputObj.container],"e-filled")),ht([this.filterInputObj.container],t),lt([t],e),pt(this.filterInput,{"aria-disabled":"false",role:"combobox",autocomplete:"off",autocapitalize:"off",spellcheck:"false"}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+Qz.clearIcon),!F.isDevice&&this.clearIconElement&&(E.add(this.clearIconElement,"click",this.clearText,this),this.clearIconElement.style.visibility="hidden"),F.isDevice?this.searchKeyModule=new bn(this.filterInput,{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.searchKeyModule=new bn(this.filterInput,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),E.add(this.filterInput,"input",this.onInput,this),E.add(this.filterInput,"keyup",this.onFilterUp,this),E.add(this.filterInput,"keydown",this.onFilterDown,this),E.add(this.filterInput,"blur",this.onBlurHandler,this),E.add(this.filterInput,"paste",this.pasteHandler,this),this.filterInputObj):Uz},Gz.prototype.onInput=function(e){!je(e)&&!je(e.data)&&1<e.data.length&&this.autoFill&&("combobox"===this.getModuleName()||"autocomplete"===this.getModuleName())&&(this.inputElement.value=e.data),this.isValidKey=!0,"combobox"===this.getModuleName()&&this.updateIconState(),F.isDevice&&"mozilla"===F.info.name&&(this.typedString=this.filterInput.value,this.preventAutoFill=!0,this.searchLists(e))},Gz.prototype.pasteHandler=function(e){var t=this;setTimeout(function(){t.typedString=t.filterInput.value,"combobox"===t.getModuleName()&&t.isFiltering()&&je(t.list)&&t.renderList(),t.searchLists(e)})},Gz.prototype.onActionFailure=function(e){jz.prototype.onActionFailure.call(this,e),this.beforePopupOpen&&this.renderPopup()},Gz.prototype.getTakeValue=function(){return this.allowFiltering&&"dropdownlist"===this.getModuleName()&&F.isDevice?Math.round(window.outerHeight/this.listItemHeight):this.itemCount},Gz.prototype.onActionComplete=function(e,t,i,n){var o,r,s,a,l,h,d,p=this;this.dataSource instanceof me&&!je(i)&&!this.virtualGroupDataSource&&(this.totalItemCount=i.count),this.isNotSearchList&&!this.enableVirtualization?this.isNotSearchList=!1:this.getInitialData?(this.updateActionCompleteDataValues(e,t),this.getInitialData=!1,this.isReactTemplateUpdate=!0,this.searchLists(this.filterArgs)):(o=this.itemCount,!this.isActive&&je(e)||(r=this.selectedLI?this.selectedLI.cloneNode(!0):null,jz.prototype.onActionComplete.call(this,e,t,i),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof me)||this.dataSource instanceof me&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.updateSelectElementData(this.allowFiltering),this.isRequested&&!je(this.searchKeyEvent)&&"keydown"===this.searchKeyEvent.type&&(this.isRequested=!1,this.keyActionHandler(this.searchKeyEvent),this.searchKeyEvent=null),this.isRequested&&!je(this.searchKeyEvent)&&(this.incrementalSearch(this.searchKeyEvent),this.searchKeyEvent=null),this.enableVirtualization||(this.list.scrollTop=0),je(e)||pt(e,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false","aria-label":"listbox"}),this.initialRemoteRender?(this.initial=!0,this.activeIndex=this.index,this.initialRemoteRender=!1,!(this.value&&this.dataSource instanceof me)||(s=je(this.fields.value)?this.fields.text:this.fields.value,a=this.allowObjectBinding&&!je(this.value)?R(s,this.value):this.value,l=this.fields.value.split("."),d=t.some(function(e){return je(e[s])&&1<l.length?p.checkFieldValue(e,l)===a:e[s]===a}),d=this.enableVirtualization&&this.virtualGroupDataSource?this.virtualGroupDataSource.some(function(e){return je(e[s])&&1<l.length?p.checkFieldValue(e,l)===a:e[s]===a}):d)?this.updateValues():this.dataSource.executeQuery(this.getQuery(this.query).where(new ba(s,"equal",a))).then(function(e){0<e.result.length&&p.addItem(e.result,t.length),p.updateValues()}),this.initial=!1):"autocomplete"===this.getModuleName()&&this.value&&this.setInputValue(),"autocomplete"!==this.getModuleName()&&this.isFiltering()&&!this.isTyped?((!this.actionCompleteData.isUpdated||!this.isCustomFilter&&!this.isFilterFocus||je(this.itemData)&&this.allowFiltering&&(this.dataSource instanceof me||!je(this.dataSource)&&!je(this.dataSource.length)&&0!==this.dataSource.length))&&(this.itemTemplate&&("EJS-COMBOBOX"===this.element.tagName||this.isReact)&&this.allowFiltering?setTimeout(function(){p.updateActionCompleteDataValues(e,t)},0):this.updateActionCompleteDataValues(e,t)),this.isDynamicData&&(d=this.allowObjectBinding&&!je(this.value)?R(this.fields.value||"",this.value):this.value,this.itemData=this.getDataByValue(d),this.selectedLI=this.getElementByValue(d),this.isDynamicData=!1),((this.allowCustom||this.allowFiltering&&!this.isValueInList(t,this.value)&&this.dataSource instanceof me)&&!this.enableVirtualization||(this.allowCustom||this.allowFiltering&&this.isValueInList(t,this.value))&&!this.enableVirtualization&&(h=this.allowObjectBinding&&!je(this.value)?R(this.fields.value||"",this.value):this.value,!je(this.value))&&r&&r.getAttribute("data-value")===h.toString())&&this.addNewItem(t,r),(!je(this.itemData)||je(this.itemData)&&this.enableVirtualization)&&(this.getSkeletonCount(),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof me)||this.dataSource instanceof me&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.UpdateSkeleton(),this.focusIndexItem()),this.enableVirtualization&&this.updateActionCompleteDataValues(e,t)):this.enableVirtualization&&"autocomplete"!==this.getModuleName()&&!this.isFiltering()?(h=this.getItemData().value,this.activeIndex=this.getIndexByValue(h),d=this.findListElement(this.list,"li","data-value",h),this.selectedLI=d):this.enableVirtualization&&"autocomplete"===this.getModuleName()&&(this.activeIndex=this.skeletonCount),this.beforePopupOpen&&(this.renderPopup(i),this.enableVirtualization&&!this.list.querySelector(".e-virtual-list")&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item")),this.enableVirtualization)&&o!==this.itemCount&&this.resetList(this.dataSource,this.fields)))},Gz.prototype.isValueInList=function(e,t){if(Array.isArray(e)){for(var i=0;i<e.length;i++)if(e[i]===t)return!0}else if("object"==typeof e&&null!==e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&e[n]===t)return!0;return!1},Gz.prototype.checkFieldValue=function(e,t){var i=e;return t.forEach(function(e){i=i[e]}),i},Gz.prototype.updateActionCompleteDataValues=function(e,t){this.actionCompleteData={ulElement:e.cloneNode(!0),list:t,isUpdated:!0},this.actionData.list!==this.actionCompleteData.list&&this.actionCompleteData.ulElement&&this.actionCompleteData.list&&(this.actionData=this.actionCompleteData)},Gz.prototype.addNewItem=function(e,t){var i,n=this;je(this.itemData)||je(t)||(i=this.getItemData().value,e.some(function(e){return("string"==typeof e||"number"==typeof e||"boolean"==typeof e)&&e===i||R(n.fields.value,e)===i}))||this.addItem(this.itemData)},Gz.prototype.updateActionCompleteData=function(e,t,i){var n=this;"autocomplete"!==this.getModuleName()&&this.actionCompleteData.ulElement&&(this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout(function(){n.actionCompleteDataUpdate(e,t,i)},0):this.actionCompleteDataUpdate(e,t,i))},Gz.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&&this.actionCompleteData.list.indexOf(t)<0&&this.actionCompleteData.list.push(t)},Gz.prototype.focusIndexItem=function(){var e=this.getItemData().value,e=(this.activeIndex=this.enableVirtualization&&!je(e)||!this.enableVirtualization?this.getIndexByValue(e):this.activeIndex,this.findListElement(this.list,"li","data-value",e));this.selectedLI=e,this.activeItem(e),this.enableVirtualization&&je(e)||this.removeFocus()},Gz.prototype.updateSelection=function(){var e=this.list.querySelector("."+_z.selected);e?(this.setProperties({index:this.getIndexByValue(e.getAttribute("data-value"))}),this.activeIndex=this.index):(this.removeFocus(),this.list.querySelector("."+_z.li).classList.add(Qz.focus))},Gz.prototype.updateSelectionList=function(){var e;this.list&&this.list.querySelector(".e-active")||je(this.value)||"autocomplete"===this.getModuleName()||(e=this.allowObjectBinding?R(this.fields.value||"",this.value):this.value,!(e=this.findListElement(this.list,"li","data-value",e)))||e.classList.add("e-active")},Gz.prototype.removeFocus=function(){var e=this.list.querySelectorAll("."+Qz.focus);e&&e.length&&q(e,Qz.focus)},Gz.prototype.renderPopup=function(h){var d=this;this.popupObj&&document.body.contains(this.popupObj.element)?this.refreshPopup():this.trigger("beforeOpen",{cancel:!1},function(e){var t;if(e.cancel)d.beforePopupOpen=!1;else{var e=d.createElement("div",{id:d.element.id+"_popup",className:"e-ddl e-popup "+(null!==d.cssClass?d.cssClass:"")}),i=(e.setAttribute("aria-label",d.element.id),e.setAttribute("role","dialog"),d.setSearchBox(e)),n=(d.listContainerHeight=d.allowFiltering&&"dropdownlist"===d.getModuleName()&&F.isDevice?T(Math.round(window.outerHeight).toString()+"px"):T(d.popupHeight),d.headerTemplate&&(d.setHeaderTemplate(e),d.isUpdateHeaderHeight=0!==d.header.offsetHeight),ht([d.list],e),d.footerTemplate&&(d.setFooterTemplate(e),d.isUpdateFooterHeight=0!==d.footer.offsetHeight),document.body.appendChild(e),e.style.top="0px",t=e.clientHeight,d.enableVirtualization&&d.itemTemplate&&(n=e.querySelectorAll("li.e-list-item:not(.e-virtual-list)"),d.listItemHeight=0<n.length?Math.ceil(n[0].getBoundingClientRect().height)+parseInt(window.getComputedStyle(n[0]).marginBottom,10):0),d.enableVirtualization&&!d.list.classList.contains(_z.noData)&&(d.getSkeletonCount(),d.skeletonCount=d.totalItemCount<2*d.itemCount&&(!(d.dataSource instanceof me)||d.dataSource instanceof me&&d.totalItemCount<=d.itemCount)?0:d.skeletonCount,d.list.querySelector(".e-virtual-ddl-content")?d.list.getElementsByClassName("e-virtual-ddl-content")[0].style=d.getTransformValues():((n=d.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=d.getTransformValues(),d.list.appendChild(n).appendChild(d.list.querySelector(".e-list-parent"))),d.UpdateSkeleton(),d.liCollections=d.list.querySelectorAll("."+_z.li),d.virtualItemCount=d.itemCount,d.list.querySelector(".e-virtual-ddl")?d.list.getElementsByClassName("e-virtual-ddl")[0].style=d.GetVirtualTrackHeight():((n=d.createElement("div",{id:d.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=d.GetVirtualTrackHeight(),e.querySelector(".e-dropdownbase").appendChild(n))),e.style.visibility="hidden","auto"!==d.popupHeight?(d.searchBoxHeight=0,je(i.container)||"combobox"===d.getModuleName()||"autocomplete"===d.getModuleName()||(d.searchBoxHeight=i.container.parentElement.getBoundingClientRect().height,d.listContainerHeight=(parseInt(d.listContainerHeight,10)-d.searchBoxHeight).toString()+"px"),d.headerTemplate&&(d.header=d.header||e.querySelector(".e-ddl-header"),o=Math.round(d.header.getBoundingClientRect().height),d.listContainerHeight=(parseInt(d.listContainerHeight,10)-(o+d.searchBoxHeight)).toString()+"px"),d.footerTemplate&&(d.footer=d.footer||e.querySelector(".e-ddl-footer"),o=Math.round(d.footer.getBoundingClientRect().height),d.listContainerHeight=(parseInt(d.listContainerHeight,10)-(o+d.searchBoxHeight)).toString()+"px"),d.list.style.maxHeight=(parseInt(d.listContainerHeight,10)-2).toString()+"px",e.style.maxHeight=T(d.popupHeight)):e.style.height="auto",0),o=void 0;d.isPreventScrollAction=!0,!je(d.selectedLI)&&!je(d.activeIndex)&&0<=d.activeIndex||d.enableVirtualization?d.setScrollPosition():d.list.scrollTop=0,F.isDevice&&d.isDeviceFullScreen&&!d.allowFiltering&&("dropdownlist"===d.getModuleName()||d.isDropDownClick&&"combobox"===d.getModuleName())&&(n=d.getOffsetValue(e),l=d.isEmptyList()?d.list:d.liCollections[0],je(d.inputElement)||(o=-(parseInt(getComputedStyle(l).textIndent,10)-parseInt(getComputedStyle(d.inputElement).paddingLeft,10)+parseInt(getComputedStyle(d.inputElement.parentElement).borderLeftWidth,10)))),d.createPopup(e,n,o),d.popupContentElement=d.popupObj.element.querySelector(".e-content"),d.getFocusElement(),d.checkCollision(e),F.isDevice&&(parseInt(d.popupWidth.toString(),10)>window.outerWidth&&("dropdownlist"!==d.getModuleName()||!d.allowFiltering)&&d.popupObj.element.classList.add("e-wide-popup"),d.popupObj.element.classList.add(Qz.device),("dropdownlist"===d.getModuleName()||"combobox"===d.getModuleName()&&!d.allowFiltering&&d.isDropDownClick)&&(d.popupObj.collision={X:"fit",Y:"fit"}),d.isFilterLayout())&&d.isDeviceFullScreen&&(d.popupObj.element.classList.add(Qz.mobileFilter),d.popupObj.position={X:0,Y:0},d.popupObj.dataBind(),pt(d.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),U([document.body,d.popupObj.element],Qz.popupFullScreen),d.setSearchBoxPosition(),d.backIconElement=i.container.querySelector(".e-back-icon"),d.clearIconElement=i.container.querySelector("."+Qz.clearIcon),E.add(d.backIconElement,"click",d.clickOnBackIcon,d),E.add(d.clearIconElement,"click",d.clearText,d)),e.style.visibility="visible",U([e],"e-popup-close");for(var r=0,s=d.popupObj.getScrollableParent(d.inputWrapper.container);r<s.length;r++){var a=s[r];E.add(a,"scroll",d.scrollHandler,d)}je(d.list)||(d.unWireListEvents(),d.wireListEvents()),d.selectedElementID=d.selectedLI?d.selectedLI.id:null,d.enableVirtualization&&(d.notify("bindScrollEvent",{module:"VirtualScroll",component:d.getModuleName(),enable:d.enableVirtualization}),setTimeout(function(){(d.value||d.list.querySelector(".e-active"))&&(d.updateSelectionList(),d.selectedValueInfo&&d.viewPortInfo&&d.viewPortInfo.offsets.top?d.list.scrollTop=d.viewPortInfo.offsets.top:d.scrollBottom(!0,!0))},5)),pt(d.targetElement(),{"aria-expanded":"true","aria-owns":d.element.id+"_popup","aria-controls":d.element.id}),"dropdownlist"!==d.getModuleName()&&d.list.classList.contains("e-nodata")&&(pt(d.targetElement(),{"aria-activedescendant":"no-record"}),d.popupContentElement.setAttribute("role","status"),d.popupContentElement.setAttribute("id","no-record")),d.inputElement.setAttribute("aria-expanded","true"),d.inputElement.setAttribute("aria-controls",d.element.id+"_popup");U([d.isFiltering()?d.filterInput.parentElement:d.inputWrapper.container],[Qz.inputFocus]);d.beforePopupOpen=!0;var l=d.popupObj;d.trigger("open",{popup:l,event:h,cancel:!1,animation:{name:"FadeIn",duration:100}},function(e){e.cancel?(d.beforePopupOpen=!1,d.destroyPopup()):(je(d.inputWrapper)||U([d.inputWrapper.container],[Qz.iconAnimation]),d.renderReactTemplates(),d.isReact&&d.isFiltering()&&d.dataSource instanceof me&&d.list.querySelector("ul")&&!d.isSecondClick&&d.executeCloneElements(),je(d.popupObj)||d.popupObj.show(new Vt(e.animation),1e3===d.zIndex?d.element:null),d.isReact&&setTimeout(function(){var e,t;!d.popupHeight||!d.list||"auto"===d.popupHeight||"dropdownlist"===d.getModuleName()&&d.allowFiltering||(e="string"==typeof d.popupHeight?parseInt(d.popupHeight,10):d.popupHeight,!d.isUpdateHeaderHeight&&d.headerTemplate&&d.header&&(t=""===d.list.style.maxHeight?e:parseInt(d.list.style.maxHeight,10),d.list.style.maxHeight=(t-d.header.offsetHeight).toString()+"px",d.isUpdateHeaderHeight=!0),!d.isUpdateFooterHeight&&d.footerTemplate&&d.footer&&(t=""===d.list.style.maxHeight?e:parseInt(d.list.style.maxHeight,10),d.list.style.maxHeight=(t-d.footer.offsetHeight).toString()+"px",d.isUpdateFooterHeight=!0))},15))}),!d.allowResize||"dropdownlist"===d.getModuleName()&&F.isDevice&&d.isDeviceFullScreen&&d.allowFiltering||(d.resizer=d.createElement("div",{id:d.element.id+"_resize-popup",className:Qz.resizeIcon}),d.list&&d.list.parentElement&&(d.list.parentElement.classList.add("e-resize"),"auto"!==d.popupHeight.toString().toLowerCase()&&t>=parseInt(d.popupHeight.toString(),10)-2&&(d.list.parentElement.style.height="100%"),d.list.parentElement.style.paddingBottom="dropdownlist"===d.getModuleName()&&d.allowFiltering&&d.searchBoxHeight?(d.searchBoxHeight+16).toString()+"px":16..toString()+"px",(d.header||d.footer||d.itemTemplate)&&(d.list.parentElement.style.paddingBottom=(parseInt(d.list.parentElement.style.maxHeight,10)-parseInt(d.list.style.maxHeight,10)+16).toString()+"px"),d.list.parentElement.appendChild(d.resizer),d.list.parentElement.style.width=d.resizeWidth+"px",d.list.parentElement.style.height=d.resizeHeight+"px",d.list.parentElement.style.maxHeight=d.resizeHeight+"px",d.list.style.maxHeight=d.resizeHeight+"px"),E.add(d.resizer,"mousedown",d.startResizing,d),E.add(d.resizer,"touchstart",d.startResizing,d))}})},Gz.prototype.checkCollision=function(e){F.isDevice&&(!F.isDevice||"dropdownlist"===this.getModuleName()||this.isDropDownClick)||(0<Y0(e).length&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},Gz.prototype.getOffsetValue=function(e){var e=getComputedStyle(e),t=parseInt(e.borderTopWidth,10),e=parseInt(e.borderBottomWidth,10);return this.setPopupPosition(t+e)},Gz.prototype.createPopup=function(e,t,i){var n=this;this.popupObj=new Sv(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputWrapper.container,collision:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},offsetY:t,enableRtl:this.enableRtl,offsetX:i,position:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},zIndex:this.zIndex,close:function(){n.isDocumentClick||n.focusDropDown(),n.isReact&&n.clearTemplate(["headerTemplate","footerTemplate"]),n.isNotSearchList=!1,n.isDocumentClick=!1,n.destroyPopup(),n.isFiltering()&&n.actionCompleteData.list&&0<n.actionCompleteData.list.length?(n.isActive=!0,n.isReactTemplateUpdate&&n.isReact&&n.itemTemplate&&!n.enableVirtualization&&(n.actionCompleteData.ulElement=n.renderItems(n.actionCompleteData.list,n.fields),n.isReactTemplateUpdate=!1),n.enableVirtualization?n.onActionComplete(n.ulElement,n.listData,null,!0):n.onActionComplete(n.actionCompleteData.ulElement,n.actionCompleteData.list,null,!0)):n.enableVirtualization&&n.focusIndexItem()},open:function(){E.add(document,"mousedown",n.onDocumentClick,n),n.isPopupOpen=!0;var e=n.actionCompleteData&&n.actionCompleteData.ulElement&&n.actionCompleteData.ulElement.querySelector("li"),t=n.list.querySelector("ul li");je(n.ulElement)||je(n.ulElement.getElementsByClassName("e-item-focus")[0])?je(n.ulElement)||je(n.ulElement.getElementsByClassName("e-active")[0])||pt(n.targetElement(),{"aria-activedescendant":n.ulElement.getElementsByClassName("e-active")[0].id}):pt(n.targetElement(),{"aria-activedescendant":n.ulElement.getElementsByClassName("e-item-focus")[0].id}),n.isFiltering()&&n.itemTemplate&&n.element.tagName===n.getNgDirective()&&e&&t&&e.textContent!==t.textContent&&"EJS-COMBOBOX"!==n.element.tagName&&n.cloneElements(),n.isFilterLayout()&&(q([n.inputWrapper.container],[Qz.inputFocus]),n.isFilterFocus=!0,n.filterInput.focus(),n.inputWrapper.clearButton)&&U([n.inputWrapper.clearButton],Qz.clearIconHide),n.activeStateChange()},targetExitViewport:function(){F.isDevice||n.hidePopup()}})},Gz.prototype.isEmptyList=function(){return!je(this.liCollections)&&0===this.liCollections.length},Gz.prototype.getFocusElement=function(){},Gz.prototype.isFilterLayout=function(){return"dropdownlist"===this.getModuleName()&&this.allowFiltering},Gz.prototype.scrollHandler=function(){F.isDevice&&("dropdownlist"===this.getModuleName()&&!this.isFilterLayout()||"combobox"===this.getModuleName()&&!this.allowFiltering&&this.isDropDownClick)&&this.element&&!this.isElementInViewport(this.element)&&this.hidePopup()},Gz.prototype.isElementInViewport=function(e){e=e.getBoundingClientRect();return 0<=e.top&&0<=e.left&&e.bottom<=window.innerHeight&&e.right<=window.innerWidth},Gz.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height,e=(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",this.filterInput.parentElement.querySelector("."+Qz.clearIcon));G(this.filterInput),e.parentElement.insertBefore(this.filterInput,e)},Gz.prototype.setPopupPosition=function(e){var t,i=this.list.querySelector("."+Qz.focus)||this.selectedLI,n=this.isEmptyList()?this.list:this.liCollections[0],o=this.isEmptyList()?this.list:this.liCollections[this.getItems().length-1],r=n.getBoundingClientRect().height,s=(this.listItemHeight=r+parseInt(window.getComputedStyle(n).marginBottom,10),this.list.offsetHeight/2),n=(je(i)?n:i).offsetTop,o=(o.offsetTop-s<n&&!je(this.liCollections)&&0<this.liCollections.length&&!je(i)?(o=this.list.offsetHeight/r,t=parseInt(getComputedStyle(this.list).paddingBottom,10),t=(o-(this.liCollections.length-this.activeIndex))*r-e+t,this.list.scrollTop=i.offsetTop):s<n&&!this.enableVirtualization?(t=s-r/2,this.list.scrollTop=n-s+r/2):t=n,this.inputWrapper.container.offsetHeight);return-(t=t+r+e-(r-o)/2)},Gz.prototype.setWidth=function(){var e,t=T(this.popupWidth);return-1<t.indexOf("%")&&(t=(this.inputWrapper.container.offsetWidth*parseFloat(t)/100).toString()+"px"),F.isDevice&&-1<t.indexOf("px")&&!this.allowFiltering&&("dropdownlist"===this.getModuleName()||this.isDropDownClick&&"combobox"===this.getModuleName())&&(e=this.isEmptyList()?this.list:this.liCollections[0],t=parseInt(t,10)+2*(parseInt(getComputedStyle(e).textIndent,10)-parseInt(getComputedStyle(this.inputElement).paddingLeft,10)+parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth,10))+"px"),t},Gz.prototype.scrollBottom=function(e,t,i){var n,o,r,s,a,l,h,d,p=this;void 0===t&&(t=!1),void 0===i&&(i=null),je(this.selectedLI)&&this.enableVirtualization&&(this.selectedLI=this.list.querySelector("."+_z.li),!je(this.selectedLI))&&this.selectedLI.classList.contains("e-virtual-list")&&(this.selectedLI=this.liCollections[this.skeletonCount]),je(this.selectedLI)||(n=this.selectedLI&&!isNaN(parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10))?parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10):0,this.isUpwardScrolling=!1,l=this.list.querySelectorAll(".e-virtual-list").length,o=this.list.querySelector("li:last-of-type")?this.list.querySelector("li:last-of-type").getAttribute("data-value"):null,d=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*(this.selectedLI.offsetHeight+n):this.selectedLI.offsetTop,h=this.list.offsetHeight,r=d-l*(this.selectedLI.offsetHeight+n)+(this.selectedLI.offsetHeight+n)-this.list.scrollTop,a=this.list.scrollTop+r-h,s=!1,a=e?a+2*parseInt(getComputedStyle(this.list).paddingTop,10):a+parseInt(getComputedStyle(this.list).paddingTop,10),d=d-l*(this.selectedLI.offsetHeight+n)+(this.selectedLI.offsetHeight+n)-this.list.scrollTop,d=this.fields.groupBy&&!je(this.fixedHeaderElement)?d-this.fixedHeaderElement.offsetHeight:d,0!==this.activeIndex||this.enableVirtualization?(h<r||!(0<d&&this.list.offsetHeight>d))&&(l=this.selectedLI?this.selectedLI.getAttribute("data-value"):null,h="pageDown"===i?this.getPageCount()-2:1,!this.enableVirtualization||this.isKeyBoardAction||t?this.isKeyBoardAction&&this.enableVirtualization&&o&&l===o&&"end"!==i&&!this.isVirtualScrolling?(this.isPreventKeyAction=!0,this.enableVirtualization&&this.itemTemplate?this.list.scrollTop+=a:(this.enableVirtualization&&(h="pageDown"===i?this.getPageCount()+1:h),this.list.scrollTop+=(this.selectedLI.offsetHeight+n)*h),this.isPreventKeyAction=!this.IsScrollerAtEnd()&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&"end"===i?(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1,this.list.scrollTop=this.list.scrollHeight):("pageDown"===i&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=a):this.list.scrollTop=this.virtualListInfo&&this.virtualListInfo.startIndex?e&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex*this.listItemHeight+2*this.listItemHeight:this.virtualListInfo.startIndex*this.listItemHeight:0,s=this.isKeyBoardAction):(this.list.scrollTop=0,s=this.isKeyBoardAction),this.isKeyBoardAction=s,this.enableVirtualization&&this.fields.groupBy&&this.fixedHeaderElement&&"down"===i&&setTimeout(function(){p.scrollStop(null,!0)},100))},Gz.prototype.scrollTop=function(e){var t,i,n,o,r,s;void 0===e&&(e=null),je(this.selectedLI)||(t=this.selectedLI&&!isNaN(parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10))?parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10):0,r=this.list.querySelectorAll(".e-virtual-list").length,n=(o=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*(this.selectedLI.offsetHeight+t):this.selectedLI.offsetTop)-r*(this.selectedLI.offsetHeight+t)-this.list.scrollTop,i=this.list.querySelector("li.e-list-item:not(.e-virtual-list)")?this.list.querySelector("li.e-list-item:not(.e-virtual-list)").getAttribute("data-value"):null,n=this.fields.groupBy&&!je(this.fixedHeaderElement)?n-this.fixedHeaderElement.offsetHeight:n,o=o-r*(this.selectedLI.offsetHeight+t)+(this.selectedLI.offsetHeight+t)-this.list.scrollTop,r=this.enableVirtualization&&"autocomplete"===this.getModuleName()&&n<=0,0!==this.activeIndex||this.enableVirtualization?n<0||r?(r=this.selectedLI?this.selectedLI.getAttribute("data-value"):null,s="pageUp"===e?this.getPageCount()-2:1,this.enableVirtualization&&(s="pageUp"===e?this.getPageCount():s),this.enableVirtualization&&this.isKeyBoardAction&&i&&r===i&&"home"!==e&&!this.isVirtualScrolling?(this.isUpwardScrolling=!0,this.isPreventKeyAction=!0,this.list.scrollTop-=(this.selectedLI.offsetHeight+t)*s,this.isPreventKeyAction=0!==this.list.scrollTop&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&"home"===e?(this.isPreventScrollAction=!1,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTo(0,0)):("pageUp"===e&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=this.list.scrollTop+n)):0<o&&this.list.offsetHeight>o||(this.list.scrollTop=this.selectedLI.offsetTop-(this.fields.groupBy&&!je(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0)):this.list.scrollTop=0)},Gz.prototype.IsScrollerAtEnd=function(){return this.list&&this.list.scrollTop+this.list.clientHeight>=this.list.scrollHeight},Gz.prototype.isEditTextBox=function(){return!1},Gz.prototype.isFiltering=function(){return this.allowFiltering},Gz.prototype.isPopupButton=function(){return!0},Gz.prototype.setScrollPosition=function(e){if(this.isPreventScrollAction=!0,je(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.isKeyBoardAction=!0,this.scrollBottom(!1,!1,e.action);break;default:this.isKeyBoardAction="up"===e.action||"pageUp"===e.action||"open"===e.action,this.scrollTop(e.action)}this.isKeyBoardAction=!1},Gz.prototype.clearText=function(){this.filterInput.value=this.typedString="",this.searchLists(null),this.enableVirtualization&&(this.list.scrollTop=0,this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.list.getElementsByClassName("e-virtual-ddl")[0]&&(this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight()),this.getSkeletonCount(),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0])&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())},Gz.prototype.setEleWidth=function(e){je(e)||("number"==typeof e?this.inputWrapper.container.style.width=T(e):"string"==typeof e&&(this.inputWrapper.container.style.width=e.match(/px|%|em/)?e:T(e)))},Gz.prototype.closePopup=function(e,t){var i=this,n=!je(this.filterInput)&&!je(this.filterInput.value)&&""!==this.filterInput.value;"combobox"===this.getModuleName()&&this.typedString;if(this.isTyped=!1,this.isVirtualTrackHeight=!1,this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen){this.keyboardEvent=null,E.remove(document,"mousedown",this.onDocumentClick),this.isActive=!1,this.isDropDownClick=!1,this.preventAutoFill=!1;for(var o=0,r=this.popupObj.getScrollableParent(this.inputWrapper.container);o<r.length;o++){var s=r[o];E.remove(s,"scroll",this.scrollHandler)}F.isDevice&&this.isFilterLayout()&&this.isDeviceFullScreen&&q([document.body,this.popupObj.element],Qz.popupFullScreen),this.isFilterLayout()&&(F.isDevice||(this.searchKeyModule.destroy(),this.clearIconElement&&E.remove(this.clearIconElement,"click",this.clearText)),this.backIconElement&&(E.remove(this.backIconElement,"click",this.clickOnBackIcon),E.remove(this.clearIconElement,"click",this.clearText)),je(this.filterInput)||(E.remove(this.filterInput,"input",this.onInput),E.remove(this.filterInput,"keyup",this.onFilterUp),E.remove(this.filterInput,"keydown",this.onFilterDown),E.remove(this.filterInput,"blur",this.onBlurHandler),E.remove(this.filterInput,"paste",this.pasteHandler)),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(this.filterInput.removeAttribute("aria-activedescendant"),this.filterInput.removeAttribute("aria-disabled"),this.filterInput.removeAttribute("role"),this.filterInput.removeAttribute("autocomplete"),this.filterInput.removeAttribute("autocapitalize"),this.filterInput.removeAttribute("spellcheck")),this.filterInput=null),pt(this.targetElement(),{"aria-expanded":"false"}),this.inputElement.setAttribute("aria-expanded","false"),this.targetElement().removeAttribute("aria-owns"),this.targetElement().removeAttribute("aria-activedescendant"),this.inputWrapper.container.classList.remove(Qz.iconAnimation),this.isFiltering()&&(this.actionCompleteData.isUpdated=!1),this.enableVirtualization&&(null==this.value||this.isTyped?(this.viewPortInfo.endIndex=this.viewPortInfo&&0<this.viewPortInfo.endIndex?this.viewPortInfo.endIndex:this.itemCount,("autocomplete"===this.getModuleName()||"dropdownlist"===this.getModuleName()&&!je(this.typedString)&&""!==this.typedString||"combobox"===this.getModuleName()&&this.allowFiltering&&!je(this.typedString)&&""!==this.typedString)&&this.checkAndResetCache()):"autocomplete"===this.getModuleName()&&this.checkAndResetCache(),"dropdownlist"!==this.getModuleName()&&"combobox"!==this.getModuleName()||0===this.skeletonCount||this.getSkeletonCount(!0)),this.beforePopupOpen=!1;e={popup:this.popupObj,cancel:!1,animation:{name:"FadeOut",duration:100,delay:e||0},event:t||null};this.trigger("close",e,function(e){var t;"dropdownlist"===i.getModuleName()&&HF.destroy({element:i.filterInput,floatLabelType:i.floatLabelType,properties:{placeholder:i.filterBarPlaceholder},buttons:i.clearIconElement},i.clearIconElement),i.filterInputObj=null,je(i.popupObj)||je(i.popupObj.element.querySelector(".e-fixed-head"))||((t=i.popupObj.element.querySelector(".e-fixed-head")).parentNode.removeChild(t),i.fixedHeaderElement=null),e.cancel||("autocomplete"===i.getModuleName()&&i.rippleFun(),i.isPopupOpen?i.popupObj.hide(new Vt(e.animation)):i.destroyPopup())}),F.isDevice&&!e.cancel&&this.popupObj.element.classList.contains("e-wide-popup")&&this.popupObj.element.classList.remove("e-wide-popup"),t=this.dataSource instanceof me?this.virtualGroupDataSource&&this.virtualGroupDataSource.length?this.virtualGroupDataSource.length:0:this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.enableVirtualization&&this.isFiltering()&&n&&this.totalItemCount!==t&&(this.updateInitialData(),this.checkAndResetCache())}},Gz.prototype.updateInitialData=function(){var e,t,i=this.selectData;je(i)||(e=this.renderItems(i,this.fields),this.list.scrollTop=0,this.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},"combobox"===this.getModuleName()&&(this.typedString=""),this.previousStartIndex=0,this.previousEndIndex=0,this.dataSource instanceof me?0<=this.remoteDataCount?this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.list.getElementsByClassName("e-virtual-ddl")[0]?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():!this.list.querySelector(".e-virtual-ddl")&&this.list.parentElement&&((t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(t)),"autocomplete"!==this.getModuleName()&&0!==this.totalItemCount&&this.totalItemCount>2*this.itemCount&&this.getSkeletonCount(),this.UpdateSkeleton(),this.listData=i,this.updateActionCompleteDataValues(e,i),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()))},Gz.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.isFilterFocus=!1,this.inputElement.removeAttribute("aria-controls"),this.popupObj&&(this.resizer&&(E.remove(this.resizer,"mousedown",this.startResizing),E.remove(this.resizer,"touchstart",this.startResizing)),this.popupObj.destroy(),G(this.popupObj.element))},Gz.prototype.clickOnBackIcon=function(){this.hidePopup(),this.focusIn()},Gz.prototype.render=function(){this.preselectedIndex=je(this.index)?null:this.index,"INPUT"===this.element.tagName?(this.inputElement=this.element,je(this.inputElement.getAttribute("role"))&&this.inputElement.setAttribute("role","combobox"),je(this.inputElement.getAttribute("type"))&&this.inputElement.setAttribute("type","text"),this.inputElement.setAttribute("aria-expanded","false")):(this.inputElement=this.createElement("input",{attrs:{role:"combobox",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,e=(je(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),!je(z(this.element,"fieldset"))&&z(this.element,"fieldset").disabled&&(this.enabled=!1),this.inputWrapper=HF.createInput({element:this.inputElement,buttons:this.isPopupButton()?[Qz.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:Qz.hiddenElement}}),lt([this.hiddenElement],this.inputWrapper.container),this.hiddenElement.hasAttribute("aria-label")||this.hiddenElement.setAttribute("aria-label",this.getModuleName()),this.validationAttribute(this.element,this.hiddenElement),this.setReadOnly(),this.setFields(),this.inputWrapper.container.style.width=T(this.width),this.inputWrapper.container.classList.add("e-ddl"),"Never"!==this.floatLabelType&&HF.calculateWidth(this.inputElement,this.inputWrapper.container),!je(this.inputWrapper.buttons[0])&&this.inputWrapper.container.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType&&this.inputWrapper.container.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.wireEvent(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),this.element.getAttribute("id")?this.element.getAttribute("id"):D("ej2_dropdownlist")),e=(this.element.id=e,this.hiddenElement.id=e+"_hidden",this.targetElement().setAttribute("tabindex",this.tabIndex),"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.readonly?"dropdownlist"===this.getModuleName()&&(this.targetElement().hasAttribute("aria-label")||pt(this.targetElement(),{"aria-label":this.getModuleName()}),this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),this.inputElement.setAttribute("aria-expanded","false")):this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),pt(this.targetElement(),this.getAriaAttributes()),this.updateDataAttribute(this.htmlAttributes),this.setHTMLAttributes(),this.targetElement()===this.inputElement&&this.inputElement.removeAttribute("aria-labelledby"),null!==this.value||null!==this.activeIndex||null!==this.text?(this.enableVirtualization&&(this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.updateVirtualizationProperties(this.itemCount,this.allowFiltering),null!==this.index)&&(this.activeIndex=this.index+this.skeletonCount),this.initValue(),this.selectedValueInfo=this.viewPortInfo,this.enableVirtualization&&(this.activeIndex=this.activeIndex+this.skeletonCount)):"SELECT"===this.element.tagName&&this.element.options[0]&&(e=this.element,this.value=this.allowObjectBinding?this.getDataByValue(e.options[e.selectedIndex].value):e.options[e.selectedIndex].value,this.text=je(this.value)?null:e.options[e.selectedIndex].textContent,this.initValue()),this.setEnabled(),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(),je(this.text)||this.inputElement.setAttribute("value",this.text),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.inputWrapper.container.getElementsByClassName("e-float-text")[0]);je(this.element.id)||""===this.element.id||je(e)||(e.id="label_"+this.element.id.replace(/ /g,"_"),pt(this.inputElement,{"aria-labelledby":e.id})),this.renderComplete(),this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.enableVirtualization&&this.updateVirtualizationProperties(this.itemCount,this.allowFiltering),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=0<this.viewPortInfo.startIndex?this.viewPortInfo.endIndex:this.itemCount},Gz.prototype.getListHeight=function(){var e=this.createElement("div",{className:"e-dropdownbase"}),t=this.createElement("li",{className:"e-list-item"}),i=T(this.popupHeight),i=(e.style.height=parseInt(i,10).toString()+"px",e.appendChild(t),document.body.appendChild(e),this.virtualListHeight=e.getBoundingClientRect().height,Math.ceil(t.getBoundingClientRect().height)+parseInt(window.getComputedStyle(t).marginBottom,10));return e.remove(),i},Gz.prototype.setFooterTemplate=function(e){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),U([this.footer],Qz.footer));var t=this.dropdownCompiler(this.footerTemplate),t="function"!=typeof this.footerTemplate&&t?oo(ge(this.footerTemplate,document).innerHTML.trim()):oo(this.footerTemplate),t=t({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);t&&0<t.length&&ht(t,this.footer),ht([this.footer],e)},Gz.prototype.setHeaderTemplate=function(e){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),U([this.header],Qz.header));var t=this.dropdownCompiler(this.headerTemplate),t="function"!=typeof this.headerTemplate&&t?oo(ge(this.headerTemplate,document).innerHTML.trim()):oo(this.headerTemplate),t=t({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header),t=(t&&t.length&&ht(t,this.header),e.querySelector("div.e-content"));e.insertBefore(this.header,t)},Gz.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},Gz.prototype.setOldText=function(e){this.text=e},Gz.prototype.setOldValue=function(e){this.value=e},Gz.prototype.refreshPopup=function(){je(this.popupObj)||!document.body.contains(this.popupObj.element)||(!this.allowFiltering||F.isDevice&&this.isFilterLayout())&&"autocomplete"!==this.getModuleName()||(q([this.popupObj.element],"e-popup-close"),this.popupObj.refreshPosition(this.inputWrapper.container),this.popupObj.resolveCollision())},Gz.prototype.checkData=function(e){!e.dataSource||je(Object.keys(e.dataSource))||!this.itemTemplate||!this.allowFiltering||this.isListSearched&&e.dataSource instanceof me||(this.list&&!this.isReact?this.list.innerHTML="":this.list=null,this.actionCompleteData={ulElement:null,list:null,isUpdated:!1}),this.isListSearched=!1;var t=-1!==Object.keys(e).indexOf("value")&&je(e.value),i=-1!==Object.keys(e).indexOf("text")&&je(e.text);"autocomplete"!==this.getModuleName()&&this.allowFiltering&&(t||i)&&(this.itemData=null),this.allowFiltering&&e.dataSource&&!je(Object.keys(e.dataSource))?(this.actionCompleteData={ulElement:null,list:null,isUpdated:!1},this.actionData=this.actionCompleteData):this.allowFiltering&&e.query&&!je(Object.keys(e.query))&&(this.actionCompleteData="combobox"===this.getModuleName()?{ulElement:null,list:null,isUpdated:!1}:this.actionCompleteData,this.actionData=this.actionCompleteData)},Gz.prototype.updateDataSource=function(e,t){""===this.inputElement.value&&(je(e)||!je(e.dataSource)&&(e.dataSource instanceof me||0!==e.dataSource.length))||this.clearAll(null,e),this.fields.groupBy&&e.fields&&!this.isGroupChecking&&this.list&&(E.remove(this.list,"scroll",this.setFloatingHeader),E.add(this.list,"scroll",this.setFloatingHeader,this)),(je(e)||!je(e.dataSource)&&(e.dataSource instanceof me||0!==e.dataSource.length)||e.dataSource instanceof me||!je(e)&&Array.isArray(e.dataSource)&&!je(t)&&Array.isArray(t.dataSource)&&e.dataSource.length!==t.dataSource.length)&&(this.typedString="",this.resetList(this.dataSource)),this.isCustomFilter||this.isFilterFocus||document.activeElement===this.filterInput||this.checkCustomValue()},Gz.prototype.checkCustomValue=function(){var e=this.allowObjectBinding&&!je(this.value)?R(this.fields.value||"",this.value):this.value,t=(this.itemData=this.getDataByValue(e),this.getItemData()),i=this.allowObjectBinding?this.itemData:t.value,n=je(i)?null:this.index;je(n)&&e===i||this.isAngular?this.setProperties({text:t.text&&t.text.toString(),value:i}):this.setProperties({text:t.text&&t.text.toString(),index:n,value:i})},Gz.prototype.updateInputFields=function(){"dropdownlist"===this.getModuleName()&&HF.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},Gz.prototype.onPropertyChanged=function(r,s){for(var a=this,l=(je(r.dataSource)||this.isTouched||!je(r.value)||!je(r.index)||je(this.preselectedIndex)||je(this.index)||(r.index=this.index),je(r.value)&&je(r.index)||(this.isTouched=!0),"dropdownlist"===this.getModuleName()&&(this.checkData(r),this.setUpdateInitial(["fields","query","dataSource"],r)),this),e=0,t=Object.keys(r);e<t.length;e++){var i=function(e){switch(e){case"query":case"dataSource":l.getSkeletonCount(),l.checkAndResetCache();break;case"htmlAttributes":l.setHTMLAttributes();break;case"width":l.setEleWidth(r.width),HF.calculateWidth(l.inputElement,l.inputWrapper.container);break;case"placeholder":HF.setPlaceholder(r.placeholder,l.inputElement);break;case"filterBarPlaceholder":l.filterInput&&HF.setPlaceholder(r.filterBarPlaceholder,l.filterInput);break;case"readonly":"dropdownlist"!==l.getModuleName()&&HF.setReadonly(r.readonly,l.inputElement),l.setReadOnly();break;case"cssClass":l.setCssClass(r.cssClass,s.cssClass),HF.calculateWidth(l.inputElement,l.inputWrapper.container);break;case"enableRtl":l.setEnableRtl();break;case"enabled":l.setEnable();break;case"text":var t;l.fields.disabled&&(r.text=r.text&&!l.isDisabledItemByIndex(l.getIndexByValue(l.getValueByText(r.text)))?r.text:null),null===r.text?l.clearAll():l.enableVirtualization?(l.updateValues(),l.updateInputFields(),l.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})):(l.list||(l.dataSource instanceof me&&(l.initialRemoteRender=!0),l.renderList()),l.initialRemoteRender||(o=l.getElementByText(r.text),l.checkValidLi(o)||(l.liCollections&&100===l.liCollections.length&&"autocomplete"===l.getModuleName()&&100<l.listData.length?l.setSelectionData(r.text,s.text,"text"):r.text&&l.dataSource instanceof me?(t=l.getItems().length,n=je(l.fields.text)?l.fields.value:l.fields.text,l.typedString="",l.dataSource.executeQuery(l.getQuery(l.query).where(new ba(n,"equal",r.text))).then(function(e){0<e.result.length?(a.addItem(e.result,t),a.updateValues()):a.setOldText(s.text)})):"autocomplete"===l.getModuleName()?l.setInputValue(r,s):l.setOldText(s.text)),l.updateInputFields()));break;case"value":if(l.fields.disabled&&(r.value=null==r.value||l.isDisableItemValue(r.value)?null:r.value),null===r.value)l.clearAll();else{if(l.allowObjectBinding&&!je(r.value)&&!je(s.value)&&l.isObjectInArray(r.value,[s.value]))return{value:void 0};var i;l.enableVirtualization?(l.updateValues(),l.updateInputFields(),l.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}),l.preventChange=l.isAngular&&l.preventChange?!l.preventChange:l.preventChange):(l.notify("beforeValueChange",{newProp:r}),l.list||(l.dataSource instanceof me&&(l.initialRemoteRender=!0),l.renderList()),l.initialRemoteRender||(o=l.allowObjectBinding&&!je(r.value)?R(l.fields.value||"",r.value):r.value,o=l.getElementByValue(o),l.checkValidLi(o)||(l.liCollections&&100===l.liCollections.length&&"autocomplete"===l.getModuleName()&&100<l.listData.length?l.setSelectionData(r.value,s.value,"value"):r.value&&l.dataSource instanceof me?(i=l.getItems().length,n=je(l.fields.value)?l.fields.text:l.fields.value,l.typedString="",o=l.allowObjectBinding&&!je(r.value)?R(n,r.value):r.value,l.dataSource.executeQuery(l.getQuery(l.query).where(new ba(n,"equal",o))).then(function(e){0<e.result.length?(a.addItem(e.result,i),a.updateValues()):a.setOldValue(s.value)})):"autocomplete"===l.getModuleName()?l.setInputValue(r,s):l.setOldValue(s.value)),l.updateInputFields(),l.preventChange=l.isAngular&&l.preventChange?!l.preventChange:l.preventChange))}break;case"index":var n;l.fields.disabled&&(r.index=null==r.index||l.isDisabledItemByIndex(r.index)?null:r.index),null===r.index?l.clearAll():(l.list||(l.dataSource instanceof me&&(l.initialRemoteRender=!0),l.renderList()),!l.initialRemoteRender&&l.liCollections&&(n=l.liCollections[r.index],l.checkValidLi(n)||(l.liCollections&&100===l.liCollections.length&&"autocomplete"===l.getModuleName()&&100<l.listData.length?l.setSelectionData(r.index,s.index,"index"):l.index=s.index),l.updateInputFields()));break;case"footerTemplate":l.popupObj&&l.setFooterTemplate(l.popupObj.element);break;case"headerTemplate":l.popupObj&&l.setHeaderTemplate(l.popupObj.element);break;case"valueTemplate":je(l.itemData)||null===l.valueTemplate||l.setValueTemplate();break;case"allowFiltering":l.allowFiltering&&(l.actionCompleteData={ulElement:l.ulElement,list:l.listData,isUpdated:!0},l.actionData=l.actionCompleteData,l.updateSelectElementData(l.allowFiltering));break;case"floatLabelType":HF.removeFloating(l.inputWrapper),HF.addFloating(l.inputElement,r.floatLabelType,l.placeholder,l.createElement),!je(l.inputWrapper.buttons[0])&&l.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0]&&"Never"!==l.floatLabelType&&l.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"showClearButton":l.inputWrapper.clearButton||(HF.setClearButton(r.showClearButton,l.inputElement,l.inputWrapper,null,l.createElement),l.bindClearEvent());break;default:var o=l.getPropObject(e,r,s);jz.prototype.onPropertyChanged.call(l,o.newProperty,o.oldProperty)}}(t[e]);if("object"==typeof i)return i.value}},Gz.prototype.checkValidLi=function(e){return!!this.isValidLI(e)&&(this.setSelection(e,null),!0)},Gz.prototype.setSelectionData=function(t,i,n){var o,r=this;this.updateListValues=function(){var e;"text"===n?(o=r.getElementByText(t),r.checkValidLi(o)||r.setOldText(i)):"value"===n?(e=r.fields.value||"",r.allowObjectBinding&&!je(t)&&R(e,t),o=r.getElementByValue(t),r.checkValidLi(o)||r.setOldValue(i)):"index"===n&&(o=r.liCollections[t],r.checkValidLi(o)||(r.index=i))}},Gz.prototype.updatePopupState=function(){this.beforePopupOpen&&(this.beforePopupOpen=!1,this.showPopup())},Gz.prototype.setReadOnly=function(){(this.readonly?U:q)([this.inputWrapper.container],["e-readonly"])},Gz.prototype.setInputValue=function(e,t){},Gz.prototype.setCssClass=function(e,t){je(t)||(t=t.replace(/\s+/g," ").trim()),je(e)||(e=e.replace(/\s+/g," ").trim()),HF.setCssClass(e,[this.inputWrapper.container],t),this.popupObj&&HF.setCssClass(e,[this.popupObj.element],t)},Gz.prototype.getModuleName=function(){return"dropdownlist"},Gz.prototype.showPopup=function(e){this.enabled&&(this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,this.isReact&&"combobox"===this.getModuleName()&&this.itemTemplate&&this.isCustomFilter&&this.isAddNewItemTemplate&&(this.renderList(),this.isAddNewItemTemplate=!1),this.isFiltering()&&this.dataSource instanceof me&&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?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)):(je(this.list)||!ee(this.list)&&(this.list.classList.contains(_z.noData)||this.list.querySelectorAll("."+_z.li).length<=0))&&(this.isReact&&this.isFiltering()&&null!=this.itemTemplate&&(this.isSecondClick=!1),this.renderList(e)),this.enableVirtualization&&this.listData&&this.listData.length&&(je(this.value)||"dropdownlist"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.removeHover(),this.beforePopupOpen||this.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})),this.beforePopupOpen&&this.invokeRenderPopup(e),this.enableVirtualization&&!this.allowFiltering&&null!=this.selectedValueInfo&&0<this.selectedValueInfo.startIndex&&null!=this.value&&this.notify("dataProcessAsync",{module:"VirtualScroll",isOpen:!0}),this.isSecondClick||this.isDropDownClick||this.executeCloneElements()))},Gz.prototype.executeCloneElements=function(){var e=this,t=this.element.tagName===this.getNgDirective()&&this.itemTemplate?500:100;this.isReact&&this.isFiltering()&&null!=this.itemTemplate&&setTimeout(function(){e.cloneElements(),e.isSecondClick=!(e.isReact&&e.isFiltering()&&e.dataSource instanceof me&&!e.list.querySelector("ul"))},t)},Gz.prototype.invokeRenderPopup=function(e){var t;F.isDevice&&this.isFilterLayout()&&(t=this,window.onpopstate=function(){t.hidePopup()},history.pushState({},"")),je(this.list)||je(this.list.children[0])&&!this.list.classList.contains(_z.noData)||this.renderPopup(e)},Gz.prototype.renderHightSearch=function(){},Gz.prototype.hidePopup=function(e){this.isEscapeKey&&"dropdownlist"===this.getModuleName()&&(je(this.inputElement)||HF.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1,je(this.index)?this.resetSelection():(t=this.allowObjectBinding?R(this.fields.value||"",this.value):this.value,t=this.findListElement(this.ulElement,"li","data-value",t),this.selectedLI=this.liCollections[this.index]||t,this.selectedLI&&(this.updateSelectedItem(this.selectedLI,null,!0),this.valueTemplate)&&null!==this.itemData&&this.setValueTemplate())),this.isVirtualTrackHeight=!1,this.customFilterQuery=null,this.closePopup(0,e);var t=this.getItemData(),i=!je(this.selectedLI);i&&this.enableVirtualization&&this.selectedLI.classList&&(i=this.selectedLI.classList.contains("e-active")),this.inputElement&&""===this.inputElement.value&&!this.isInteracted&&(this.isSelectCustom||i&&this.inputElement.value!==t.text)&&(this.isSelectCustom=!1,this.clearAll(e))},Gz.prototype.focusIn=function(e){var t;this.enabled&&!this.targetElement().classList.contains(Qz.disable)&&(t=!1,this.preventFocus&&F.isDevice&&(this.inputWrapper.container.tabIndex=1,this.inputWrapper.container.focus(),t=!(this.preventFocus=!1)),t||this.targetElement().focus(),U([this.inputWrapper.container],[Qz.inputFocus]),this.onFocus(e),"Never"!==this.floatLabelType)&&HF.calculateWidth(this.inputElement,this.inputWrapper.container)},Gz.prototype.focusOut=function(e){this.enabled&&(this.enableVirtualization||"combobox"!==this.getModuleName()&&"autocomplete"!==this.getModuleName()||(this.isTyped=!0),this.hidePopup(e),this.targetElement()&&this.targetElement().blur(),q([this.inputWrapper.container],[Qz.inputFocus]),"Never"!==this.floatLabelType)&&HF.calculateWidth(this.inputElement,this.inputWrapper.container)},Gz.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t,i,n=-1;if(this.liCollections&&0<this.liCollections.length&&this.listData&&this.fields.disabled){if("string"==typeof e)n=this.getIndexByValue(e);else if("object"==typeof e){if(e instanceof HTMLLIElement){for(var o=0;o<this.liCollections.length;o++)if(this.liCollections[o]===e){n=this.getIndexByValue(e.getAttribute("data-value"));break}}else for(var r=JSON.parse(JSON.stringify(e))[this.fields.value],o=0;o<this.listData.length;o++)if(JSON.parse(JSON.stringify(this.listData[o]))[this.fields.value]===r){n=this.getIndexByValue(r);break}}else n=e;n<this.liCollections.length&&-1<n&&!JSON.parse(JSON.stringify(this.listData[n]))[this.fields.disabled]&&(t=this.liCollections[n])&&(this.disableListItem(t),(i=JSON.parse(JSON.stringify(this.listData[n])))[this.fields.disabled]=!0,this.listData[n]=i,this.dataSource=this.listData,t.classList.contains(Qz.focus)&&this.removeFocus(),t.classList.contains(Qz.selected))&&this.clear()}}},Gz.prototype.destroy=function(){if(this.isActive=!1,this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),j_(this.element.id),this.isReact&&this.clearTemplate(),this.hidePopup(),this.popupObj&&this.popupObj.hide(),this.unWireEvent(),this.list&&this.unWireListEvents(),!this.element||this.element.classList.contains("e-"+this.getModuleName())){if(this.inputElement){for(var e=["readonly","aria-disabled","placeholder","aria-labelledby","aria-expanded","autocomplete","aria-readonly","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-describedby","aria-label"],t=0;t<e.length;t++)this.inputElement.removeAttribute(e[t]);this.inputElement.setAttribute("tabindex",this.tabIndex),this.inputElement.classList.remove("e-input"),HF.setValue("",this.inputElement,this.floatLabelType,this.showClearButton)}this.element.style.display="block",this.inputWrapper.container&&this.inputWrapper.container.parentElement&&(this.inputWrapper.container.parentElement.tagName!==this.getNgDirective()&&this.inputWrapper.container.parentElement.insertBefore(this.element,this.inputWrapper.container),G(this.inputWrapper.container)),delete this.hiddenElement,this.filterInput=null,this.keyboardModule=null,this.ulElement=null,this.list=null,this.clearIconElement=null,this.popupObj=null,this.popupContentElement=null,this.rippleFun=null,this.selectedLI=null,this.liCollections=null,this.item=null,this.footer=null,this.header=null,this.previousSelectedLI=null,this.valueTempElement=null,this.actionData.ulElement=null,this.inputElement&&!je(this.inputElement.onchange)&&(this.inputElement.onchange=null),this.inputElement&&!je(this.inputElement.onselect)&&(this.inputElement.onselect=null),HF.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties,buttons:this.inputWrapper.container.querySelectorAll(".e-input-group-icon")[0]},this.clearButton),this.clearButton=null,this.inputElement=null,this.inputWrapper=null,jz.prototype.destroy.call(this)}},Gz.prototype.getItems=function(){return this.list||(this.dataSource instanceof me&&(this.initialRemoteRender=!0),this.renderList()),this.ulElement?jz.prototype.getItems.call(this):[]},Gz.prototype.getDataByValue=function(e){return jz.prototype.getDataByValue.call(this,e)},Gz.prototype.clear=function(){this.value=null},Wz([e(null)],Gz.prototype,"cssClass",void 0),Wz([e("100%")],Gz.prototype,"width",void 0),Wz([e(!0)],Gz.prototype,"enabled",void 0),Wz([e(!1)],Gz.prototype,"enablePersistence",void 0),Wz([e("300px")],Gz.prototype,"popupHeight",void 0),Wz([e("100%")],Gz.prototype,"popupWidth",void 0),Wz([e(null)],Gz.prototype,"placeholder",void 0),Wz([e(null)],Gz.prototype,"filterBarPlaceholder",void 0),Wz([e({})],Gz.prototype,"htmlAttributes",void 0),Wz([e(null)],Gz.prototype,"query",void 0),Wz([e(null)],Gz.prototype,"valueTemplate",void 0),Wz([e(null)],Gz.prototype,"headerTemplate",void 0),Wz([e(null)],Gz.prototype,"footerTemplate",void 0),Wz([e(!1)],Gz.prototype,"allowFiltering",void 0),Wz([e(!0)],Gz.prototype,"isDeviceFullScreen",void 0),Wz([e(!1)],Gz.prototype,"readonly",void 0),Wz([e(!1)],Gz.prototype,"enableVirtualization",void 0),Wz([e(!1)],Gz.prototype,"allowResize",void 0),Wz([e(null)],Gz.prototype,"text",void 0),Wz([e(null)],Gz.prototype,"value",void 0),Wz([e(!1)],Gz.prototype,"allowObjectBinding",void 0),Wz([e(null)],Gz.prototype,"index",void 0),Wz([e("Never")],Gz.prototype,"floatLabelType",void 0),Wz([e(!1)],Gz.prototype,"showClearButton",void 0),Wz([i()],Gz.prototype,"filtering",void 0),Wz([i()],Gz.prototype,"change",void 0),Wz([i()],Gz.prototype,"beforeOpen",void 0),Wz([i()],Gz.prototype,"open",void 0),Wz([i()],Gz.prototype,"close",void 0),Wz([i()],Gz.prototype,"blur",void 0),Wz([i()],Gz.prototype,"focus",void 0),Wz([i()],Gz.prototype,"resizeStop",void 0),Wz([i()],Gz.prototype,"resizing",void 0),Wz([i()],Gz.prototype,"resizeStart",void 0),Wz([Bt],Gz));function Gz(e,t){e=jz.call(this,e,t)||this;return e.isListSearched=!1,e.preventChange=!1,e.isTouched=!1,e.isFocused=!1,e.autoFill=!1,e.isUpdateHeaderHeight=!1,e.isUpdateFooterHeight=!1,e.isReactTemplateUpdate=!1,e}Yz=function(e,t){return(Yz=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])}))(e,t)};var Yz,Xz,wH=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Kz="e-rtl",Jz="e-overlay",Zz="e-nav-arrow",$z="e-nav-right-arrow",ej="e-nav-left-arrow",tj="e-scroll-nav",ij="e-scroll-right-nav",nj="e-scroll-left-nav",oj="e-scroll-device",rj="e-scroll-overlay",sj="e-scroll-right-overlay",aj="e-scroll-left-overlay",lj=(function(e,t){function i(){this.constructor=e}Yz(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(hj,Xz=Ji),hj.prototype.preRender=function(){this.browser=F.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=F.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=D("hscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(Kz)},hj.prototype.render=function(){this.touchModule=new Mn(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),E.add(this.scrollEle,"scroll",this.scrollHandler,this),this.isDevice?(this.element.classList.add(oj),this.createOverlay(this.element)):this.createNavIcon(this.element),this.setScrollState()},hj.prototype.setScrollState=function(){je(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetWidth,this.customStep=!1):this.customStep=!0},hj.prototype.initialize=function(){for(var e=this.createElement("div",{className:"e-hscroll-content"}),t=this.createElement("div",{className:"e-hscroll-bar"}),i=(t.setAttribute("tabindex","-1"),this.element),n=0,o=[].slice.call(i.children);n<o.length;n++){var r=o[n];e.appendChild(r)}t.appendChild(e),i.appendChild(t),t.style.overflowX="hidden",this.scrollEle=t,this.scrollItems=e},hj.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},hj.prototype.getModuleName=function(){return"hScroll"},hj.prototype.destroy=function(){var e=this.element,t=(e.style.display="",e.classList.remove("e-hscroll"),e.classList.remove(oj),e.classList.remove(Kz),ct(".e-"+e.id+"_nav."+tj,e)),i=ct("."+rj,e);[].slice.call(i).forEach(function(e){G(e)});for(var n=0,o=[].slice.call(this.scrollItems.children);n<o.length;n++){var r=o[n];e.appendChild(r)}this.uniqueId&&this.element.removeAttribute("id"),G(this.scrollEle),0<t.length&&(G(t[0]),je(t[1])||G(t[1])),E.remove(this.scrollEle,"scroll",this.scrollHandler),this.touchModule.destroy(),this.touchModule=null,Xz.prototype.destroy.call(this)},hj.prototype.disable=function(t){var e=ct(".e-scroll-nav:not(."+Jz+")",this.element);t?this.element.classList.add(Jz):this.element.classList.remove(Jz),[].slice.call(e).forEach(function(e){e.setAttribute("tabindex",t?"-1":"0")})},hj.prototype.createOverlay=function(e){var t=e.id.concat("_nav"),i=this.createElement("div",{className:rj+" "+sj}),n="e-"+e.id.concat("_nav "+tj+" "+ij),t=this.createElement("div",{id:t.concat("_right"),className:n}),n=this.createElement("div",{className:$z+" "+Zz+" e-icons"}),n=(t.appendChild(n),this.createElement("div",{className:rj+" "+aj}));this.ieCheck&&t.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(t),e.insertBefore(n,e.firstChild),this.eventBinding([t])},hj.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav "+tj+" "+ij),n={role:"button",id:t.concat("_right"),"aria-label":"Scroll right"},i=this.createElement("div",{className:i,attrs:n}),n=(i.setAttribute("aria-disabled","false"),this.createElement("div",{className:$z+" "+Zz+" e-icons"})),o="e-"+e.id.concat("_nav "+tj+" "+nj),t={role:"button",id:t.concat("_left"),"aria-label":"Scroll left"},o=this.createElement("div",{className:o+" "+Jz,attrs:t}),t=(o.setAttribute("aria-disabled","true"),this.createElement("div",{className:ej+" "+Zz+" e-icons"}));o.appendChild(t),i.appendChild(n),e.appendChild(i),e.insertBefore(o,e.firstChild),this.ieCheck&&(i.classList.add("e-ie-align"),o.classList.add("e-ie-align")),this.eventBinding([i,o])},hj.prototype.onKeyPress=function(e){var t=this;"Enter"===e.key&&(this.keyTimer=window.setTimeout(function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)},100))},hj.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},hj.prototype.eventBinding=function(e){var t=this;[].slice.call(e).forEach(function(e){new Mn(e,{tapHold:t.tabHoldHandler.bind(t),tapHoldThreshold:500}),e.addEventListener("keydown",t.onKeyPress.bind(t)),e.addEventListener("keyup",t.onKeyUp.bind(t)),e.addEventListener("mouseup",t.repeatScroll.bind(t)),e.addEventListener("touchend",t.repeatScroll.bind(t)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),E.add(e,"click",t.clickEventHandler,t)})},hj.prototype.repeatScroll=function(){clearInterval(this.timeout)},hj.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target,i=this.contains(i,tj)?i.firstElementChild:i,n=10;this.timeout=window.setInterval(function(){t.eleScrolling(n,i,!0)},50)},hj.prototype.contains=function(e,t){return e.classList.contains(t)},hj.prototype.eleScrolling=function(e,t,i){var n=this.element,o=t.classList;o.contains(tj)&&(o=t.querySelector("."+Zz).classList),this.contains(n,Kz)&&this.browserCheck&&(e=-e),!this.contains(n,Kz)||this.browserCheck||this.ieCheck?o.contains($z)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i):o.contains(ej)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i)},hj.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},hj.prototype.swipeHandler=function(t){function i(){var e=Math.sin(r);e<=0?window.cancelAnimationFrame(e):("Left"===t.swipeDirection?n.scrollLeft+=o*e:"Right"===t.swipeDirection&&(n.scrollLeft-=o*e),r-=.5,window.requestAnimationFrame(i))}var n=this.scrollEle,o=t.velocity<=1?t.distanceX/(10*t.velocity):t.distanceX/t.velocity,r=.5;i()},hj.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollLeft+=e:this.scrollEle.scrollLeft-=e,this.enableRtl&&0<this.scrollEle.scrollLeft&&(this.scrollEle.scrollLeft=0)},hj.prototype.frameScrollRequest=function(i,n,e){var o,r=this,s=10;e?this.scrollUpdating(i,n):(this.customStep||[].slice.call(ct("."+rj,this.element)).forEach(function(e){i-=e.offsetWidth}),(o=function(){var e,t=r.contains(r.element,Kz)&&r.browserCheck?(e=-i,-s):(e=i,s);e<s?window.cancelAnimationFrame(t):(r.scrollUpdating(t,n),i-=t,window.requestAnimationFrame(o))})())},hj.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceX;this.ieCheck&&this.contains(this.element,Kz)&&(i=-i),"Left"===e.scrollDirection?t.scrollLeft=t.scrollLeft+i:"Right"===e.scrollDirection&&(t.scrollLeft=t.scrollLeft-i)},hj.prototype.arrowDisabling=function(e,t){var i;this.isDevice?(i=(je(e)?t:e).querySelector("."+Zz),je(e)?mt(i,[$z],[ej]):mt(i,[ej],[$z])):e&&t&&(e.classList.add(Jz),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(Jz),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0")),this.repeatScroll()},hj.prototype.scrollHandler=function(e){var e=e.target,t=e.offsetWidth,i=(this.element,this.element.querySelector("."+nj)),n=this.element.querySelector("."+ij),o=this.element.querySelector("."+aj),r=this.element.querySelector("."+sj),s=e.scrollLeft;s<=0&&(s=-s),this.isDevice&&(!this.enableRtl||this.browserCheck||this.ieCheck||(o=this.element.querySelector("."+sj),r=this.element.querySelector("."+aj)),o.style.width=s<40?s+"px":"40px",e.scrollWidth-Math.ceil(t+s)<40?r.style.width=e.scrollWidth-Math.ceil(t+s)+"px":r.style.width="40px"),0===s?this.arrowDisabling(i,n):Math.ceil(t+s+.1)>=e.scrollWidth?this.arrowDisabling(n,i):(o=this.element.querySelector("."+tj+"."+Jz))&&(o.classList.remove(Jz),o.setAttribute("aria-disabled","false"),o.setAttribute("tabindex","0"))},hj.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add(Kz):this.element.classList.remove(Kz)}},wH([e(null)],hj.prototype,"scrollStep",void 0),wH([Bt],hj));function hj(e,t){return Xz.call(this,e,t)||this}dj=function(e,t){return(dj=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])}))(e,t)};var dj,pj,Wz=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},cj="e-rtl",uj="e-overlay",gj="e-nav-arrow",mj="e-nav-up-arrow",fj="e-nav-down-arrow",yj="e-scroll-nav",vj="e-scroll-up-nav",bj="e-scroll-down-nav",wj="e-scroll-device",Cj="e-scroll-overlay",Sj="e-scroll-up-overlay",Aj="e-scroll-down-overlay",xj=(function(e,t){function i(){this.constructor=e}dj(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Ij,pj=Ji),Ij.prototype.preRender=function(){this.browser=F.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=F.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=D("vscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(cj)},Ij.prototype.render=function(){this.touchModule=new Mn(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),E.add(this.scrollEle,"scroll",this.scrollEventHandler,this),this.isDevice?(this.element.classList.add(wj),this.createOverlayElement(this.element)):this.createNavIcon(this.element),this.setScrollState(),E.add(this.element,"wheel",this.wheelEventHandler,this)},Ij.prototype.setScrollState=function(){je(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetHeight,this.customStep=!1):this.customStep=!0},Ij.prototype.initialize=function(){for(var e=Q("div",{className:"e-vscroll-content"}),t=Q("div",{className:"e-vscroll-bar"}),i=(t.setAttribute("tabindex","-1"),this.element),n=0,o=[].slice.call(i.children);n<o.length;n++){var r=o[n];e.appendChild(r)}t.appendChild(e),i.appendChild(t),t.style.overflow="hidden",this.scrollEle=t,this.scrollItems=e},Ij.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},Ij.prototype.getModuleName=function(){return"vScroll"},Ij.prototype.destroy=function(){var e=this.element,t=(e.style.display="",q([this.element],["e-vscroll",wj,cj]),ct(".e-"+e.id+"_nav."+yj,e)),i=ct("."+Cj,e);[].slice.call(i).forEach(function(e){G(e)});for(var n=0,o=[].slice.call(this.scrollItems.children);n<o.length;n++){var r=o[n];e.appendChild(r)}this.uniqueId&&this.element.removeAttribute("id"),G(this.scrollEle),0<t.length&&(G(t[0]),je(t[1])||G(t[1])),E.remove(this.scrollEle,"scroll",this.scrollEventHandler),this.touchModule.destroy(),this.touchModule=null,pj.prototype.destroy.call(this)},Ij.prototype.disable=function(t){var e=ct(".e-scroll-nav:not(."+uj+")",this.element);t?this.element.classList.add(uj):this.element.classList.remove(uj),[].slice.call(e).forEach(function(e){e.setAttribute("tabindex",t?"-1":"0")})},Ij.prototype.createOverlayElement=function(e){var t=e.id.concat("_nav"),i=Q("div",{className:Cj+" "+Aj}),n="e-"+e.id.concat("_nav "+yj+" "+bj),t=Q("div",{id:t.concat("down"),className:n}),n=Q("div",{className:fj+" "+gj+" e-icons"}),n=(t.appendChild(n),Q("div",{className:Cj+" "+Sj}));this.ieCheck&&t.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(t),e.insertBefore(n,e.firstChild),this.eventBinding([t])},Ij.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav "+yj+" "+bj),i=Q("div",{id:t.concat("_down"),className:i}),n=(i.setAttribute("aria-disabled","false"),Q("div",{className:fj+" "+gj+" e-icons"})),o="e-"+e.id.concat("_nav "+yj+" "+vj),t=Q("div",{id:t.concat("_up"),className:o+" "+uj}),o=(t.setAttribute("aria-disabled","true"),Q("div",{className:mj+" "+gj+" e-icons"}));t.appendChild(o),i.appendChild(n),i.setAttribute("tabindex","0"),e.appendChild(i),e.insertBefore(t,e.firstChild),this.ieCheck&&(i.classList.add("e-ie-align"),t.classList.add("e-ie-align")),this.eventBinding([i,t])},Ij.prototype.onKeyPress=function(e){var t=this;"Enter"===e.key&&(this.keyTimer=window.setTimeout(function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)},100))},Ij.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},Ij.prototype.eventBinding=function(e){var t=this;[].slice.call(e).forEach(function(e){new Mn(e,{tapHold:t.tabHoldHandler.bind(t),tapHoldThreshold:500}),e.addEventListener("keydown",t.onKeyPress.bind(t)),e.addEventListener("keyup",t.onKeyUp.bind(t)),e.addEventListener("mouseup",t.repeatScroll.bind(t)),e.addEventListener("touchend",t.repeatScroll.bind(t)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),E.add(e,"click",t.clickEventHandler,t)})},Ij.prototype.repeatScroll=function(){clearInterval(this.timeout)},Ij.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target,i=this.contains(i,yj)?i.firstElementChild:i,n=10;this.timeout=window.setInterval(function(){t.eleScrolling(n,i,!0)},50)},Ij.prototype.contains=function(e,t){return e.classList.contains(t)},Ij.prototype.eleScrolling=function(e,t,i){var n=t.classList;(n=n.contains(yj)?t.querySelector("."+gj).classList:n).contains(fj)?this.frameScrollRequest(e,"add",i):n.contains(mj)&&this.frameScrollRequest(e,"",i)},Ij.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},Ij.prototype.wheelEventHandler=function(e){e.preventDefault(),this.frameScrollRequest(this.scrollStep,0<e.deltaY?"add":"",!1)},Ij.prototype.swipeHandler=function(t){function i(){var e=Math.sin(r);e<=0?window.cancelAnimationFrame(e):("Up"===t.swipeDirection?n.scrollTop+=o*e:"Down"===t.swipeDirection&&(n.scrollTop-=o*e),r-=.02,window.requestAnimationFrame(i))}var n=this.scrollEle,o=t.velocity<=1?t.distanceY/(10*t.velocity):t.distanceY/t.velocity,r=.5;i()},Ij.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollTop+=e:this.scrollEle.scrollTop-=e},Ij.prototype.frameScrollRequest=function(t,e,i){var n,o=this,r=10;i?this.scrollUpdating(t,e):(this.customStep||[].slice.call(ct("."+Cj,this.element)).forEach(function(e){t-=e.offsetHeight}),(n=function(){t<r?window.cancelAnimationFrame(r):(o.scrollUpdating(r,e),t-=r,window.requestAnimationFrame(n))})())},Ij.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)},Ij.prototype.arrowDisabling=function(e,t){var i;this.isDevice?(i=(je(e)?t:e).querySelector("."+gj),je(e)?mt(i,[fj],[mj]):mt(i,[mj],[fj])):(e.classList.add(uj),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(uj),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0")),this.repeatScroll()},Ij.prototype.scrollEventHandler=function(e){var e=e.target,t=e.offsetHeight,i=this.element.querySelector("."+vj),n=this.element.querySelector("."+bj),o=this.element.querySelector("."+Sj),r=this.element.querySelector("."+Aj),s=e.scrollTop;s<=0&&(s=-s),this.isDevice&&(o.style.height=s<40?s+"px":"40px",e.scrollHeight-Math.ceil(t+s)<40?r.style.height=e.scrollHeight-Math.ceil(t+s)+"px":r.style.height="40px"),0===s?this.arrowDisabling(i,n):Math.ceil(t+s+.1)>=e.scrollHeight?this.arrowDisabling(n,i):(o=this.element.querySelector("."+yj+"."+uj))&&(o.classList.remove(uj),o.setAttribute("aria-disabled","false"),o.setAttribute("tabindex","0"))},Ij.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add(cj):this.element.classList.remove(cj)}},Wz([e(null)],Ij.prototype,"scrollStep",void 0),Wz([Bt],Ij));function Ij(e,t){return pj.call(this,e,t)||this}function Tj(e,t,i,n,o,r){var s,a=t.parentElement,l="vscroll"===n?(s=r||t.getBoundingClientRect().height,i.getBoundingClientRect().height):(s=t.getBoundingClientRect().width,i.getBoundingClientRect().width);return s<l?Ej(e,t,i,n,o,r):a&&(a=a.getBoundingClientRect().width)<s&&"hscroll"===n?(t.style.maxWidth=(l=a)+"px",Ej(e,t,i,n,o,r)):i}function Ej(e,t,i,n,o,r){e=e("div",{className:"e-menu-"+n});return t.appendChild(e),e.appendChild(i),r?(e.style.overflow="hidden",e.style.height=r+"px"):(e.style.maxHeight=t.style.maxHeight,t.style.overflow="hidden"),"vscroll"===n?new xj({enableRtl:o},e).scrollStep=ge(".e-"+n+"-bar",t).offsetHeight/2:new lj({enableRtl:o},e).scrollStep=ge(".e-"+n+"-bar",t).offsetWidth,e}function Dj(e,t,i){var n;e&&((n=ge(".e-menu-parent",t))?i&&i!==n||(e.destroy(),t.parentElement.appendChild(n),G(t)):(e.destroy(),G(t)))}Mj=function(e,t){return(Mj=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])}))(e,t)};var Mj,kj,wH=function(e,t){function i(){this.constructor=e}Mj(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Wz=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Pj="enter",Bj="escape",Fj="e-focused",Lj="e-menu-header",Rj="e-selected",Oj="e-separator",Nj="uparrow",Vj="downarrow",_j="leftarrow",Hj="rightarrow",zj="home",jj="end",Wj="tab",Qj="e-caret",Uj="e-menu-item",qj="e-disabled",Gj="e-menu-hide",Yj="e-icons",Xj="e-rtl",Kj="e-menu-popup",Jj=(wH(Zj,kj=n),Wz([e("id")],Zj.prototype,"itemId",void 0),Wz([e("parentId")],Zj.prototype,"parentId",void 0),Wz([e("text")],Zj.prototype,"text",void 0),Wz([e("iconCss")],Zj.prototype,"iconCss",void 0),Wz([e("url")],Zj.prototype,"url",void 0),Wz([e("separator")],Zj.prototype,"separator",void 0),Wz([e("items")],Zj.prototype,"children",void 0),Zj);function Zj(){return null!==kj&&kj.apply(this,arguments)||this}wH(t3,$j=n),Wz([e(null)],t3.prototype,"iconCss",void 0),Wz([e("")],t3.prototype,"id",void 0),Wz([e(!1)],t3.prototype,"separator",void 0),Wz([kt([],t3)],t3.prototype,"items",void 0),Wz([e("")],t3.prototype,"text",void 0),Wz([e("")],t3.prototype,"url",void 0),Wz([e()],t3.prototype,"htmlAttributes",void 0);var $j,e3=t3;function t3(){return null!==$j&&$j.apply(this,arguments)||this}wH(o3,i3=n),Wz([e("SlideDown")],o3.prototype,"effect",void 0),Wz([e(400)],o3.prototype,"duration",void 0),Wz([e("ease")],o3.prototype,"easing",void 0);var i3,n3=o3;function o3(){return null!==i3&&i3.apply(this,arguments)||this}wH(s3,r3=Ji),s3.prototype.preRender=function(){if(this.isMenu||(i=void 0,"EJS-CONTEXTMENU"===this.element.tagName?(i=this.createElement("ul",{id:D(this.getModuleName()),className:"e-control e-lib e-"+this.getModuleName()}),t=R("ej2_instances",this.element),q([this.element],["e-control","e-lib","e-"+this.getModuleName()]),this.clonedElement=this.element,this.element=i,x("ej2_instances",t,this.element)):(i=this.createElement("ul",{id:D(this.getModuleName())}),ht([].slice.call(this.element.cloneNode(!0).children),i),(t=this.element.nextElementSibling)?this.element.parentElement.insertBefore(i,t):this.element.parentElement.appendChild(i),this.clonedElement=i),this.clonedElement.style.display="none"),"EJS-MENU"===this.element.tagName){for(var e=this.element,t=R("ej2_instances",e),i=this.createElement("ul"),n=this.createElement("EJS-MENU",{className:"e-"+this.getModuleName()+"-wrapper"}),o=0,r=e.attributes.length;o<r;o++)i.setAttribute(e.attributes[o].nodeName,e.attributes[o].nodeValue);e.parentNode.insertBefore(n,e),G(e),e=i,n.appendChild(e),x("ej2_instances",t,e),this.clonedElement=n,this.element=e,this.element.id||(this.element.id=D(this.getModuleName()))}},s3.prototype.render=function(){var e=this,t=(this.initialize(),this.renderItems(),this.wireEvents(),this.renderComplete(),this.getWrapper());this.template&&this.enableScrolling&&(this.isReact||this.isAngular)&&requestAnimationFrame(function(){Tj(e.createElement,t,e.element,"hscroll",e.enableRtl)})},s3.prototype.enableTouchScroll=function(r){var s=0;this.touchStartFn=function(e){s=e.touches[0].clientY},this.touchMoveFn=function(e){var t=e.touches[0].clientY,i=s-t,n=0===r.scrollTop,o=r.scrollTop+r.clientHeight===r.scrollHeight;(n&&i<0||o&&0<i)&&e.preventDefault(),s=t},r.addEventListener("touchstart",this.touchStartFn,{passive:!1}),r.addEventListener("touchmove",this.touchMoveFn,{passive:!1})},s3.prototype.touchOutsideHandler=function(e){z(e.target,".e-"+this.getModuleName()+"-wrapper")||this.closeMenu()},s3.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&&U([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&e.classList.add(Xj),e.appendChild(this.element),this.isMenu&&this.hamburgerMode&&(this.target||this.createHeaderContainer(e)),this.defaultOption=this.showItemOnClick},s3.prototype.renderItems=function(){this.items.length||(e=X_.createJsonFromElement(this.element,{fields:{child:"items"}}),this.setProperties({items:e},!0),N&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="");var e=this.createItems(this.items);ht(Array.prototype.slice.call(e.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&&(e=this.getWrapper(),this.element.classList.contains("e-vertical")?Tj(this.createElement,e,this.element,"vscroll",this.enableRtl):Tj(this.createElement,e,this.element,"hscroll",this.enableRtl))):(this.element.parentElement.setAttribute("role","dialog"),this.element.parentElement.setAttribute("aria-label","context menu"))},s3.prototype.wireEvents=function(){var e=this.getWrapper();if(this.target){for(var t=void 0,i=ct(this.target),n=0,o=i.length;n<o;n++)t=i[n],this.isMenu?E.add(t,"click",this.menuHeaderClickHandler,this):F.isIos?new Mn(t,{tapHold:this.touchHandler.bind(this)}):E.add(t,"contextmenu",this.cmenuHandler,this);if(this.targetElement=t,!this.isMenu){E.add(this.targetElement,"scroll",this.scrollHandler,this);for(var r=0,s=xv(this.targetElement);r<s.length;r++){var a=s[r];E.add(a,"scroll",this.scrollHandler,this)}}}F.isDevice||(this.delegateMoverHandler=this.moverHandler.bind(this),this.delegateMouseDownHandler=this.mouseDownHandler.bind(this),E.add(this.isMenu?document:e,"mouseover",this.delegateMoverHandler,this),E.add(document,"mousedown",this.delegateMouseDownHandler,this),E.add(document,"keydown",this.domKeyHandler,this),this.isMenu)||this.target||E.add(document,"scroll",this.scrollHandler,this),this.delegateClickHandler=this.clickHandler.bind(this),E.add(document,"click",this.delegateClickHandler,this),this.wireKeyboardEvent(e),this.rippleFn=Ht(e,{selector:"."+Uj}),!this.isMenu&&this.enableScrolling&&(this.enableTouchScroll(e),document.addEventListener("touchstart",this.touchOutsideHandler.bind(this),{passive:!0}))},s3.prototype.wireKeyboardEvent=function(e){var t={downarrow:Vj,uparrow:Nj,enter:Pj,leftarrow:_j,rightarrow:Hj,escape:Bj};this.isMenu&&(t.home=zj,t.end=jj,t.tab=Wj),new bn(e,{keyAction:this.keyBoardHandler.bind(this),keyConfigs:t})},s3.prototype.mouseDownHandler=function(e){z(e.target,".e-"+this.getModuleName()+"-wrapper")===this.getWrapper()||z(e.target,".e-"+this.getModuleName()+"-popup")||this.closeMenu(this.isMenu?null:this.navIdx.length,e)},s3.prototype.keyHandler=function(e){38!==e.keyCode&&40!==e.keyCode||e.target&&(e.target.classList.contains("e-contextmenu")||e.target.classList.contains("e-menu-item"))&&e.preventDefault()},s3.prototype.domKeyHandler=function(e){27===e.keyCode&&(this.isMenuVisible()&&e.stopImmediatePropagation(),e.action=Bj,this.leftEscKeyHandler(e))},s3.prototype.keyBoardHandler=function(e){var t="",i=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&&i.classList.contains("e-scroll-nav")&&this.removeLIStateByClass([Fj,Rj],[z(i,".e-"+this.getModuleName()+"-wrapper")]),this.isKBDAction=!0,n)switch(e.action){case Hj:t=Hj,e.action=Vj;break;case _j:t=_j,e.action=Nj;break;case Vj:t=Vj,e.action=Hj;break;case Nj:t=Nj,e.action=""}else if(this.enableRtl)switch(e.action){case _j:n=!0,t=_j,e.action=Hj;break;case Hj:n=!0,t=Hj,e.action=_j}switch(e.action){case Vj:case Nj:case jj:case zj:case Wj:this.upDownKeyHandler(e);break;case Hj:this.rightEnterKeyHandler(e);break;case _j:this.leftEscKeyHandler(e);break;case Pj:this.hamburgerMode&&"SPAN"===i.tagName&&i.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):this.rightEnterKeyHandler(e)}this.isAnimationNone&&(this.isKBDAction=!1),n&&(e.action=t)},s3.prototype.upDownKeyHandler=function(e){var t=this.getUlByNavIdx(),i=e.action===Vj||e.action===zj||e.action===Wj?0:t.childElementCount-1,n=i,o=this.getLIByClass(t,Fj),o=(o&&(e.action!==jj&&e.action!==zj&&(n=this.getIdx(t,o)),o.classList.remove(Fj),e.action!==jj)&&e.action!==zj&&(e.action===Vj?n++:n--,n===(e.action===Vj?t.childElementCount:-1))&&(n=i),t.children[n]),n=this.isValidLI(o,n,e.action);t.children[n].classList.add(Fj),t.children[n].focus()},s3.prototype.isValidLI=function(e,t,i){var n=this.getUlByNavIdx(),o=i===Vj||i===zj||i===Wj?0:n.childElementCount-1;return(e.classList.contains(Oj)||e.classList.contains(qj)||e.classList.contains(Gj))&&(i===Vj&&t===n.childElementCount-1||i===Nj&&0===t?t=o:i===Vj||i===Hj||"tab"===i&&e.classList.contains(Oj)?t++:t--),t=(e=n.children[t])&&(e.classList.contains(Oj)||e.classList.contains(qj)||e.classList.contains(Gj))?this.isValidLI(e,t,i):t},s3.prototype.getUlByNavIdx=function(e){var t,i,n=this;return void 0===e&&(e=this.navIdx.length),this.isMenu?(t=[this.getWrapper()].concat([].slice.call(ct("."+Kj)))[e],i=[],ct("."+Kj).forEach(function(e){(n.element.id===e.id.split("-")[2]||e.id.split("-")[2]+"-"+e.id.split("-")[3])&&i.push(e)}),je(t=[this.getWrapper()].concat([].slice.call(i))[e])?null:ge(".e-menu-parent",t)):document.body.contains(this.element)||0!==e?this.getWrapper().children[e]:null},s3.prototype.rightEnterKeyHandler=function(e){var t=this.getUlByNavIdx(),i=this.getLIByClass(t,Fj);if(i){var t=this.getIdx(t,i),n=this.navIdx.concat(t),o=this.getItem(n);if(o.items.length)this.navIdx.push(t),this.keyType="right",this.action=e.action,this.openMenu(i,o,-1,-1,e);else if(e.action===Pj){this.isMenu&&0===this.navIdx.length?this.removeLIStateByClass([Rj],[this.getWrapper()]):i.classList.remove(Fj),i.classList.add(Rj),this.trigger("select",{element:i,item:o,event:e});n=i.querySelector(".e-menu-url");if(o.url&&n)switch(n.getAttribute("target")){case"_blank":window.open(o.url,"_blank");break;case"_parent":window.parent.location.href=o.url;break;default:window.location.href=o.url}this.closeMenu(null,e);t=this.getLIByClass(this.getUlByNavIdx(),Rj);t&&(t.classList.add(Fj),t.focus())}}},s3.prototype.leftEscKeyHandler=function(e){this.navIdx.length?(this.keyType="left",this.closeMenu(this.navIdx.length,e)):e.action===Bj&&this.closeMenu(null,e)},s3.prototype.scrollHandler=function(e){this.closeMenu(null,e)},s3.prototype.touchHandler=function(e){this.isTapHold=!0,this.cmenuHandler(e.originalEvent)},s3.prototype.cmenuHandler=function(e){e.preventDefault(),this.currentTarget=e.target,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)},s3.prototype.closeMenu=function(a,l,h){var e,d,p,t,c,i,n,o,u,g,m=this;void 0===a&&(a=0),void 0===l&&(l=null),this.isMenuVisible()&&(e=void 0,p=this.getWrapper(),t=void 0,i=this.getPopups(),n=!1,o=this.isMenu?i.length+1:p.childElementCount,u=this.isMenu&&1!==o?ge(".e-ul",i[o-2]):ct(".e-menu-parent",p)[o-1],this.isMenu&&u.classList.contains("e-menu")&&((e=this.getLIByClass(u,Rj))&&e.classList.remove(Rj),n=!0),n||(g=l&&l.target&&this.getLI(l.target),this.cli=g||u.children[0],d=this.navIdx.length?this.getItem(this.navIdx):null,c=(d||this).items,t={element:u,parentItem:d,items:c,event:l,cancel:!1,isFocused:!0},this.trigger("beforeClose",t,function(e){var t,i,n,o="",r=!e.cancel,s=((r||m.isCMenu)&&(m.isMenu?(t=z(u,"."+Kj),m.hamburgerMode&&(t.parentElement.style.minHeight="",z(u,".e-menu-item").setAttribute("aria-expanded","false")),m.unWireKeyboardEvent(t),Dj(K(t.children[0],xj),t.children[0]),(s=K(t,Sv)).hide(),o=t.id,s.destroy(),G(t)):(m.isContextMenuClosed=!1,m.toggleAnimation(u,!1)),m.trigger("onClose",{element:u,parentItem:d,items:c}),m.navIdx.pop(),0===m.navIdx.length&&l&&"keyup"===l.type&&(m.showSubMenu=!1),m.isMenu||(E.remove(u,"keydown",m.keyHandler),"right"===m.keyType&&(m.keyType=""))),m.updateReactTemplate(),m.getWrapper()&&m.getUlByNavIdx()),o=(m.isCMenu&&(m.canOpen(l.target)&&m.openMenu(null,null,m.pageY,m.pageX,l),m.isCMenu=!1),m.isMenu&&s&&o.length?(t=new RegExp("(.*)-ej2menu-"+m.element.id+"-popup").exec(o)[1],i=s.querySelector('[id="'+t+'"]'),n=g&&s.querySelector('[id="'+g.id+'"]')):s&&(i=s.querySelector(".e-menu-item.e-selected"),n=g&&s.querySelector('[id="'+g.id+'"]')),g&&g.querySelectorAll(".e-menu-item"));r&&m.hamburgerMode&&a&&!o.length?m.afterCloseMenu(l):r&&!m.hamburgerMode&&i&&!n&&"left"!==m.keyType&&(m.navIdx.length||!m.isMenu&&0===m.navIdx.length)?(t=l&&l.target.classList&&(l.target.classList.contains("e-vscroll")||l.target.classList.contains("e-scroll-nav"))?z(l.target,".e-menu-wrapper"):null)?(t=t.querySelector(".e-menu-item"),(m.showItemOnClick||t&&m.getIndex(t.id,!0).length<=m.navIdx.length)&&m.closeMenu(m.navIdx[m.navIdx.length-1],l,!0)):l&&l.target.classList&&l.target.classList.contains("e-nav-arrow")||m.closeMenu(m.navIdx[m.navIdx.length-1],l):r&&!h&&!a&&(m.hamburgerMode&&m.navIdx.length||1===m.navIdx.length&&g&&s!==g.parentElement)||r&&je(a)&&m.navIdx.length?m.closeMenu(null,l):!r||m.isMenu||a||0!==m.navIdx.length||m.isMenusClosed||m.isCmenuHover?r&&m.isMenu&&l&&l.target&&0!==m.navIdx.length&&z(l.target,".e-menu-parent.e-control")?m.closeMenu(0,l):r&&!m.isMenu&&ct(".e-menu-parent",p)[a-1]&&3===l.which?m.closeMenu(null,l):(!r||"right"!==m.keyType&&"click"!==m.keyType?(o=m.getUlByNavIdx(),(i=m.getLIByClass(o,Rj))&&(i.setAttribute("aria-expanded","false"),i.classList.remove(Rj),e.isFocused&&g||"left"===m.keyType)&&(i.classList.add(Fj),l.target&&l.target.classList.contains("e-edit-template")||i.focus()),!r&&m.hamburgerMode&&g&&"false"===g.getAttribute("aria-expanded")&&"true"===g.getAttribute("aria-haspopup")&&(z(g,".e-menu-parent.e-control")?m.navIdx=[]:m.navIdx.pop(),m.navIdx.push(m.cliIdx),n=m.getItem(m.navIdx),g.setAttribute("aria-expanded","true"),m.openMenu(g,n,-1,-1,l))):m.afterCloseMenu(l),m.navIdx.length<1&&("Hover"!==m.showSubMenuOn&&"Click"!==m.showSubMenuOn||(m.showItemOnClick=m.defaultOption,m.showSubMenuOn="Auto"))):(m.isMenusClosed=!0,m.closeMenu(0,l)),m.removeStateWrapper()})))},s3.prototype.updateReactTemplate=function(){var e;this.isReact&&this.template&&0===this.navIdx.length&&(e=void 0,this.portals&&(e=this.portals.splice(0,this.items.length)),this.clearTemplate(["template"]),this.portals=e,this.renderReactTemplates())},s3.prototype.getMenuItemModel=function(e,t){if(je(e))return null;je(t)&&(t=0);t=this.getFields(t);return{text:e[t.text],id:e[t.id],items:e[t.child],separator:e[t.separator],iconCss:e[t.iconCss],url:e[t.url]}},s3.prototype.getPopups=function(){var t=this,i=[];return[].slice.call(document.querySelectorAll("."+Kj)).forEach(function(e){!je(e.querySelector("."+Uj))&&t.getIndex(e.querySelector("."+Uj).id,!0).length&&i.push(e)}),i},s3.prototype.isMenuVisible=function(){return 0<this.navIdx.length||this.element.classList.contains("e-contextmenu")&&at(this.element).valueOf()},s3.prototype.canOpen=function(e){var t=!0;if(this.filter)for(var t=!1,i=this.filter.split(" "),n=0,o=i.length;n<o;n++)if(z(e,"."+i[n])){t=!0;break}return t},s3.prototype.openMenu=function(e,t,i,n,o,r){var s,a=this,l=(void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=null),void 0===r&&(r=this.targetElement),this.getWrapper()),h=(this.lItem=e,""!==this.element.id?this.element.id:"menu");this.isMenusClosed=!1,je(i)&&(i=-1),je(n)&&(n=-1),e?(this.uList=this.createItems(t[this.getField("children",this.navIdx.length-1)]),!this.isMenu&&F.isDevice&&(l.lastChild.style.display="none",s={text:t[this.getField("text")].toString(),iconCss:Yj+" e-previous"},this.template&&(t.iconCss=(t.iconCss||"")+Yj+" e-previous"),s=new e3(this.items[0],"items",this.template?t:s,!0),(s=this.createItems([s]).children[0]).classList.add(Lj),this.uList.insertBefore(s,this.uList.children[0])),this.isMenu?(this.popupWrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper "+Kj,id:e.id+"-ej2menu-"+h+"-popup"}),this.popupWrapper.setAttribute("role","navigation"),this.popupWrapper.setAttribute("aria-label",t.text+"-menu-popup"),(this.hamburgerMode?(i=e.offsetHeight,e):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&&U([this.popupWrapper],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.popupObj.hide()),this.hamburgerMode||this.showItemOnClick||!this.hoverDelay?this.triggerBeforeOpen(e,this.uList,t,o,0,0,"menu"):(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){a.triggerBeforeOpen(e,a.uList,t,o,0,0,"menu")},this.hoverDelay))):(this.uList.style.zIndex=this.element.style.zIndex,l.appendChild(this.uList),!this.showItemOnClick&&this.hoverDelay?(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){a.triggerBeforeOpen(e,a.uList,t,o,i,n,"none")},this.hoverDelay)):this.triggerBeforeOpen(e,this.uList,t,o,i,n,"none"))):(this.uList=this.element,this.uList.style.zIndex=Iv(r||this.element).toString(),je(o)?((s=document.createEvent("MouseEvents")).initEvent("click",!0,!1),(h=this.copyObject(s,{})).target=h.srcElement=r,h.currentTarget=r,this.triggerBeforeOpen(e,this.uList,t,h,i,n,"none")):this.triggerBeforeOpen(e,this.uList,t,o,i,n,"none"))},s3.prototype.copyObject=function(e,t){for(var i in e)t[""+i]=e[""+i];return t},s3.prototype.calculateIndentSize=function(e,t){var i=getComputedStyle(t),i=parseInt(i.textIndent,10),n=(this.navIdx.length<2&&!t.classList.contains("e-blankicon")?i*=2:i+=i/4,e.style.textIndent=i+"px",e.querySelectorAll(".e-blankicon"));if(n&&n.length)for(var t=e.querySelector(".e-menu-icon"),e=getComputedStyle(t),o=parseInt(e.marginRight,10)+t.offsetWidth+i,r=0;r<n.length;r++)n[r].style.textIndent=o+"px"},s3.prototype.generatePopup=function(e,t,i,n){var o=this,r=new Sv(e,{actionOnScroll:this.hamburgerMode?"none":"reposition",relateTo:i,collision:this.hamburgerMode?{X:"none",Y:"none"}:{X:n||this.enableRtl?"none":"flip",Y:"fit"},position:n&&!this.hamburgerMode?{X:"right",Y:"top"}:{X:"left",Y:"bottom"},targetType:"relative",enableRtl:this.enableRtl,content:t,open:function(){var e=ge(".e-menu-vscroll",r.element),e=(e&&(e.style.height="inherit",e.style.maxHeight=""),ge(".e-ul",r.element));r.element.style.maxHeight="",e.focus(),o.triggerOpen(e)}});return r},s3.prototype.createHeaderContainer=function(e){e=e||this.getWrapper();var t=this.createElement("span",{className:"e-"+this.getModuleName()+"-header"}),i=this.enableHtmlSanitizer?go.sanitize(this.title):this.title,i=this.createElement("span",{className:"e-"+this.getModuleName()+"-title",innerHTML:i}),n=this.createElement("span",{className:"e-icons e-"+this.getModuleName()+"-icon",attrs:{tabindex:"0"}});t.appendChild(i),t.appendChild(n),e.insertBefore(t,this.element)},s3.prototype.openHamburgerMenu=function(e){this.hamburgerMode&&this.triggerBeforeOpen(null,this.element,null,e,0,0,"hamburger")},s3.prototype.closeHamburgerMenu=function(t){var i=this,e={element:this.element,parentItem:null,event:t,items:this.items,cancel:!1};this.trigger("beforeClose",e,function(e){e.cancel||(i.closeMenu(null,t),i.element.classList.add("e-hide-menu"),i.trigger("onClose",{element:i.element,parentItem:null,items:i.items}))})},s3.prototype.callFit=function(e,t,i,n,o){return G0(e,null,{X:t,Y:i},{top:n,left:o})},s3.prototype.triggerBeforeOpen=function(n,o,r,s,e,t,i){var a,l=this,h=n?r[this.getField("children",this.navIdx.length-1)]:this.items,d=i;this.trigger("beforeOpen",{element:o,items:h,parentItem:r,event:s,cancel:!1,top:e,left:t,showSubMenuOn:"Auto"},function(e){switch(d){case"menu":l.hamburgerMode||("Auto"!==e.showSubMenuOn&&(l.showItemOnClick=!l.defaultOption,l.showSubMenuOn=e.showSubMenuOn),l.top=e.top,l.left=e.left),l.popupWrapper.style.display="block",l.hamburgerMode||(l.popupWrapper.style.maxHeight=l.popupWrapper.getBoundingClientRect().height+"px",l.enableScrolling&&Tj(l.createElement,l.popupWrapper,l.uList,"vscroll",l.enableRtl),l.checkScrollOffset(s)),l.hamburgerMode||l.left||l.top?(l.popupObj.collision={X:"none",Y:"none"},l.popupWrapper.style.display=""):(l.popupObj.refreshPosition(l.lItem,!0),l.left=parseInt(l.popupWrapper.style.left,10),l.top=parseInt(l.popupWrapper.style.top,10),l.enableRtl&&(l.left=l.isNestedOrVertical?l.left-l.popupWrapper.offsetWidth-l.lItem.parentElement.offsetWidth+2:l.left-l.popupWrapper.offsetWidth+l.lItem.offsetWidth),l.template&&(l.isReact||l.isAngular)?requestAnimationFrame(function(){l.collision(),l.popupWrapper.style.display=""}):(l.collision(),l.popupWrapper.style.display=""));break;case"none":l.top=e.top,l.left=e.left,l.isContextMenuClosed=!0,a=e.element,l.enableScrolling&&l.isCMenu&&a&&a.parentElement&&(a.style.height=a.parentElement.style.height);break;case"hamburger":e.cancel||(l.element.classList.remove("e-hide-menu"),l.triggerOpen(l.element))}var t,i;"hamburger"!==d&&(e.cancel?(l.isMenu?(l.popupObj.destroy(),G(l.popupWrapper)):-1<o.className.indexOf("e-ul")&&G(o),l.navIdx.pop()):l.isMenu?l.hamburgerMode?(l.popupWrapper.style.top=l.top+"px",l.popupWrapper.style.left="0px",l.toggleAnimation(l.popupWrapper)):(l.setBlankIconStyle(l.popupWrapper),l.wireKeyboardEvent(l.popupWrapper),Ht(l.popupWrapper,{selector:"."+Uj}),l.popupWrapper.style.left=l.left+"px",l.popupWrapper.style.top=l.top+"px",t="None"!==l.animationSettings.effect?{name:l.animationSettings.effect,duration:l.animationSettings.duration,timingFunction:l.animationSettings.easing}:null,l.popupObj.show(t,l.lItem),F.isDevice&&(l.popupWrapper.style.left=l.left+"px")):(l.setBlankIconStyle(l.uList),l.setPosition(l.lItem,l.uList,l.top,l.left),l.toggleAnimation(l.uList))),"right"===l.keyType&&(t=l.getUlByNavIdx(),n.classList.remove(Fj),l.isMenu&&1===l.navIdx.length&&l.removeLIStateByClass([Rj],[l.getWrapper()]),n.classList.add(Rj),l.action===Pj&&l.trigger("select",{element:n,item:r,event:s}),n.focus(),t=l.getUlByNavIdx(),i=l.isValidLI(t.children[0],0,l.action),t.children[i].classList.add(Fj),t.children[i].focus())})},s3.prototype.collision=function(){var e,t=Y0(this.popupWrapper,null,this.left,this.top);(this.isNestedOrVertical||this.enableRtl)&&(-1<t.indexOf("right")||-1<t.indexOf("left"))&&(this.popupObj.collision.X="none",e=z(this.lItem,".e-"+this.getModuleName()+"-wrapper").offsetWidth,this.left=this.enableRtl?O0(this.lItem,this.isNestedOrVertical?"right":"left","top").left:this.left-this.popupWrapper.offsetWidth-e+2),(-1<(t=Y0(this.popupWrapper,null,this.left,this.top)).indexOf("left")||-1<t.indexOf("right"))&&(this.left=this.callFit(this.popupWrapper,!0,!1,this.top,this.left).left),this.popupWrapper.style.left=this.left+"px"},s3.prototype.setBlankIconStyle=function(e){var t,i,n,o,r=[].slice.call(e.getElementsByClassName("e-blankicon"));r.length&&(e=e.querySelector(".e-menu-item:not(.e-blankicon):not(.e-separator)"))&&(i=e.querySelector(".e-menu-icon"))&&(t=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"},i=getComputedStyle(i),n=parseInt(i.fontSize,10),o=(n=parseInt(i.width,10)&&parseInt(i.width,10)>n?parseInt(i.width,10):n)+parseInt(i[t.margin],10)+parseInt(getComputedStyle(e)[t.padding],10)+"px",r.forEach(function(e){e.style[t.padding]=o}))},s3.prototype.checkScrollOffset=function(e){var t,i=this.getWrapper();i.children[0].classList.contains("e-menu-hscroll")&&1===this.navIdx.length&&(e=je(e)?this.element:z(e.target,"."+Uj),(i=ge(".e-hscroll-bar",i)).scrollLeft>e.offsetLeft&&(i.scrollLeft-=i.scrollLeft-e.offsetLeft),(t=i.scrollLeft+i.offsetWidth)<(e=e.offsetLeft+e.offsetWidth))&&(i.scrollLeft+=e-t)},s3.prototype.setPosition=function(e,t,i,n){this.toggleVisiblity(t),t===this.element||-1<n&&-1<i?(-1<(r=Y0(t,null,n,i)).indexOf("right")&&(n-=t.offsetWidth),-1<r.indexOf("bottom")&&(i=(s=this.callFit(t,!1,!0,i,n)).top-20)<0&&-1<(o=pageYOffset+document.documentElement.clientHeight-t.getBoundingClientRect().height)&&(i=o),-1<(r=Y0(t,null,n,i)).indexOf("left")&&(n=(s=this.callFit(t,!0,!1,i,n)).left)):F.isDevice?n=!this.isMenu&&this.enableScrolling?(o=document.querySelector(".e-menu-vscroll"),i=Number(o.style.top.replace("px","")),Number(o.style.left.replace("px",""))):(i=Number(this.element.style.top.replace("px","")),Number(this.element.style.left.replace("px",""))):(i=(s=O0(e,this.enableRtl?"left":"right","top")).top,n=s.left,(o=-1<(r=Y0(t,null,this.enableRtl?n-t.offsetWidth:n,i)).indexOf("left")||-1<r.indexOf("right"))&&(n=(s=O0(e,this.enableRtl?"right":"left","top")).left),(this.enableRtl||o)&&(n=this.enableRtl&&o?n:n-t.offsetWidth),-1<r.indexOf("bottom")&&(this.isMenu||!this.enableScrolling)&&(i=(s=this.callFit(t,!1,!0,i,n)).top)),this.toggleVisiblity(t,!1),this.isCMenu&&this.enableScrolling&&t&&(t.style.height="");var o,r,s,e=z(this.element,".e-"+this.getModuleName()+"-wrapper");!this.isMenu&&this.enableScrolling&&t&&e&&0<e.offsetHeight?(o=z(t,".e-menu-vscroll"),t.style.display="block",o&&Dj(K(o,xj),o),r=Math.ceil(this.getMenuWidth(t,t.offsetWidth,this.enableRtl)),s=Tj(this.createElement,e,t,"vscroll",this.enableRtl,e.offsetHeight),Object.assign(s.style,{top:i+"px",left:n+"px",width:r+"px",position:"absolute",display:"none"})):(t.style.top=i+"px",t.style.left=n+"px")},s3.prototype.getMenuWidth=function(e,t,i){e=e.getElementsByClassName(Qj)[0];return e&&(t+=parseInt(getComputedStyle(e)[i?"marginRight":"marginLeft"],10)),t<120?120:t},s3.prototype.toggleVisiblity=function(e,t){e.style.visibility=(t=void 0===t?!0:t)?"hidden":"",e.style.display=t?"block":"none"},s3.prototype.createItems=function(e){var i=this,n=this.navIdx?this.navIdx.length:0,t=this.getFields(n),o=this.hasField(e,this.getField("iconCss",n)),r={showIcon:o,moduleName:"menu",fields:t,template:this.template,itemNavigable:!0,itemCreating:function(e){e.curData[e.fields[t.id]]||(e.curData[e.fields[t.id]]=D("menuitem")),je(e.curData.htmlAttributes)&&Object.defineProperty(e.curData,"htmlAttributes",{value:{},writable:!0,enumerable:!0,configurable:!0}),F.isIE?(e.curData.htmlAttributes.role||(e.curData.htmlAttributes.role="menuitem"),e.curData.htmlAttributes.tabindex||(e.curData.htmlAttributes.tabindex="-1")):Object.assign(e.curData.htmlAttributes,{role:e.curData.htmlAttributes.role||"menuitem",tabindex:e.curData.htmlAttributes.tabindex||"-1"}),!i.isMenu||e.curData[i.getField("separator",n)]||e.curData.htmlAttributes["aria-label"]||(e.curData.htmlAttributes["aria-label"]=e.curData[e.fields.text]||e.curData[e.fields.id]),""===e.curData[e.fields[t.iconCss]]&&(e.curData[e.fields[t.iconCss]]=null)},itemCreated:function(e){e.curData[i.getField("separator",n)]&&(e.item.classList.add(Oj),e.curData.htmlAttributes.role||e.item.setAttribute("role","separator"),e.curData.htmlAttributes.ariaLabel||e.item.setAttribute("aria-label","separator")),!o||e.curData[e.fields.iconCss]||e.curData[i.getField("separator",n)]||e.item.classList.add("e-blankicon"),e.curData[e.fields.child]&&e.curData[e.fields.child].length&&(t=i.createElement("span",{className:Yj+" "+Qj}),e.item.appendChild(t),e.item.setAttribute("aria-haspopup","true"),e.item.setAttribute("aria-expanded","false"),e.item.classList.add("e-menu-caret-icon")),i.isMenu&&i.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"),e.item.removeAttribute("aria-level"));var t={item:e.curData,element:e.item};i.trigger("beforeItemRender",t)}},e=(this.setProperties({items:this.items},!0),this.isMenu&&(r.templateID=this.element.id+"Template"),X_.createList(this.createElement,e,r,!this.template,this));return e.setAttribute("tabindex","0"),this.isMenu?e.setAttribute("role","menu"):e.setAttribute("role","menubar"),e},s3.prototype.moverHandler=function(e){var t=e.target,i=(this.liTrgt=t,this.isMenu||(this.isCmenuHover=!0),this.getLI(t)),n=i?z(i,".e-"+this.getModuleName()+"-wrapper"):this.getWrapper(),o=this.getWrapper(),r=new RegExp("-ej2menu-(.*)-popup"),s=!1;if(n){if((""!==n.id?r.exec(n.id)[1]:n.querySelector("ul").id)!==this.element.id){if(this.removeLIStateByClass([Fj,Rj],[this.getWrapper()]),!this.navIdx.length)return;s=!0}i&&z(i,".e-"+this.getModuleName()+"-wrapper")&&!s?(this.removeLIStateByClass([Fj],this.isMenu?[n].concat(this.getPopups()):[n]),this.removeLIStateByClass([Fj],this.isMenu?[o].concat(this.getPopups()):[o]),i.classList.add(Fj),this.showItemOnClick||this.clickHandler(e)):this.isMenu&&this.showItemOnClick&&!s&&this.removeLIStateByClass([Fj],[n].concat(this.getPopups())),this.isMenu&&(this.showItemOnClick||t.parentElement===n||z(t,".e-"+this.getModuleName()+"-popup")||i&&this.getIndex(i.id,!0).length||"Hover"===this.showSubMenuOn?s&&!this.showItemOnClick&&this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e)):(this.removeLIStateByClass([Fj],[n]),this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e))),this.isClosed||this.removeStateWrapper(),this.isClosed=!1),this.isMenu||(this.isCmenuHover=!1)}},s3.prototype.removeStateWrapper=function(){var e;this.liTrgt&&(e=z(this.liTrgt,".e-menu-vscroll"),"DIV"===this.liTrgt.tagName)&&e&&this.removeLIStateByClass([Fj,Rj],[e])},s3.prototype.removeLIStateByClass=function(e,i){for(var n,t=0;t<i.length;t++)!function(t){e.forEach(function(e){(n=ge("."+e,i[t]))&&n.classList.remove(e)})}(t)},s3.prototype.getField=function(e,t){void 0===t&&(t=0);e=this.fields[""+e];return"string"==typeof e?e:(e[t]||e[e.length-1]).toString()},s3.prototype.getFields=function(e){return{id:this.getField("itemId",e=void 0===e?0: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)}},s3.prototype.hasField=function(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i][""+t])return!0;return!1},s3.prototype.menuHeaderClickHandler=function(e){var t=z(e.target,".e-menu-wrapper");t&&t.querySelector("ul.e-menu-parent").id!==this.element.id||(-1<this.element.className.indexOf("e-hide-menu")?this.openHamburgerMenu(e):this.closeHamburgerMenu(e))},s3.prototype.clickHandler=function(e){this.isTapHold=this.isTapHold&&!1;var t,i=this.getWrapper(),n=e.target,o=this.cli=this.getLI(n),r=new RegExp("-ej2menu-(.*)-popup"),s=o?z(o,".e-"+this.getModuleName()+"-wrapper"):null,a=o&&s&&(this.isMenu?0<this.getIndex(o.id,!0).length:i.firstElementChild.id===s.firstElementChild.id);if(F.isDevice&&this.isMenu&&(this.removeLIStateByClass([Fj],[i].concat(this.getPopups())),this.mouseDownHandler(e)),o&&s&&this.isMenu){var r=s.id?r.exec(s.id)[1]:s.querySelector(".e-menu-parent").id;if(this.element.id!==r)return}a&&"click"===e.type&&!o.classList.contains(Lj)&&(this.setLISelected(o),s=this.getIndex(o.id,!0),r=this.getItem(s),this.trigger("select",{element:o,item:r,event:e})),a&&("mouseover"===e.type||F.isDevice||this.showItemOnClick)?(s=void 0,o.classList.contains(Lj)?(s=i.children[this.navIdx.length-1],this.toggleAnimation(s),(t=this.getLIByClass(s,Rj))&&t.classList.remove(Rj),(r=this.enableScrolling&&!this.isMenu?z(o.parentElement,".e-menu-vscroll"):null)&&Dj(K(r,xj),r),G(o.parentNode),this.navIdx.pop()):o.classList.contains(Oj)||(this.showSubMenu=!0,je(a=o.parentNode))||(this.cliIdx=this.getIdx(a,o),!this.isMenu&&F.isDevice||(s=this.isMenu?Array.prototype.indexOf.call([i].concat(this.getPopups()),z(a,".e-"+this.getModuleName()+"-wrapper")):this.getIdx(i,a),this.navIdx[s]===this.cliIdx&&(this.showSubMenu=!1),s===this.navIdx.length)||"mouseover"===e.type&&!this.showSubMenu||((t=this.getLIByClass(a,Rj))&&t.classList.remove(Rj),this.isClosed=!0,this.keyType="click",this.showItemOnClick&&(this.setLISelected(o),this.isMenu||(this.isCmenuHover=!0)),this.closeMenu(s+1,e),this.showItemOnClick&&(this.setLISelected(o),this.isMenu||(this.isCmenuHover=!1))),this.isClosed||this.afterCloseMenu(e),this.isClosed=!1)):"DIV"===n.tagName&&z(n,".e-menu-vscroll")&&(this.navIdx.length||!this.isMenu&&this.enableScrolling&&0===this.navIdx.length)?(r=this.isMenu?z(n,"."+Kj):z(n,".e-menu-vscroll"),(a=this.isMenu?Array.prototype.indexOf.call(this.getPopups(),r)+1:this.getIdx(i,ge("ul.e-menu-parent",r)))<this.navIdx.length&&(this.closeMenu(a+1,e),r)&&this.removeLIStateByClass([Fj,Rj],[r])):this.isMenu&&this.hamburgerMode&&"SPAN"===n.tagName&&n.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):"UL"===n.tagName&&(this.isMenu?!n.parentElement.classList.contains("e-menu-wrapper")||this.getIndex(n.querySelector("."+Uj).id,!0).length:n.parentElement===i)||(o||this.removeLIStateByClass([Rj],[i]),(!this.isAnimationNone&&!o||o&&!o.querySelector("."+Qj))&&(navigator.platform.toUpperCase().indexOf("MAC")<0||0<=navigator.platform.toUpperCase().indexOf("MAC")&&!e.ctrlKey)&&this.closeMenu(null,e))},s3.prototype.afterCloseMenu=function(e){var t,i,n;je(e)||(this.showSubMenu&&(t=this.showItemOnClick&&0===this.navIdx.length?z(e.target,".e-menu-parent.e-control"):z(this.element,".e-menu-parent.e-control"),i=this.navIdx.concat(this.cliIdx),(n=this.getItem(i))&&n[this.getField("children",i.length-1)]&&n[this.getField("children",i.length-1)].length?(("mouseover"===e.type||F.isDevice&&this.isMenu)&&this.setLISelected(this.cli),(!this.hamburgerMode&&t||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),!t)&&(i=this.getUlByNavIdx(),n=this.getLIByClass(i,Rj))&&(n.setAttribute("aria-expanded","false"),n.classList.remove(Rj)),this.keyType="")},s3.prototype.setLISelected=function(e){var t=this.getLIByClass(e.parentElement,Rj);t&&t.classList.remove(Rj),this.isMenu||e.classList.remove(Fj),e.classList.add(Rj)},s3.prototype.getLIByClass=function(e,t){if(e&&e.children)for(var i=0,n=e.children.length;i<n;i++)if(e.children[i].classList.contains(t))return e.children[i];return null},s3.prototype.getItemIndex=function(e,t){e="string"==typeof e?e:e.id;return this.getIndex(e,!1!==t)},s3.prototype.setItem=function(e,t,i){t=i?t||e.id:t||e.text,t=this.getIndex(t,i),i=this.getItem(t);Object.assign(i,e)},s3.prototype.getItem=function(e){var t=(e=e.slice()).pop();return this.getItems(e)[t]},s3.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},s3.prototype.setItems=function(e,t){var i=this.getItems(t);i.splice(0,i.length);for(var n=0;n<e.length;n++)i.splice(n,0,e[n])},s3.prototype.getIdx=function(e,t,i){void 0===i&&(i=!0);var n=!this.isMenu&&this.enableScrolling&&ge(".e-menu-vscroll",e)?ct(".e-menu-parent",e):Array.from(e.children),n=Array.prototype.indexOf.call(n,t);return i&&e.children[0].classList.contains(Lj)&&n--,n},s3.prototype.getLI=function(e){return"LI"===e.tagName&&e.classList.contains("e-menu-item")?e:z(e,"li.e-menu-item")},s3.prototype.updateItemsByNavIdx=function(){for(var e=this.items,t=0,i=0;i<this.navIdx.length&&(e=e[i].items);i++){t++;var n=this.getUlByNavIdx(t);if(!n)break;this.updateItem(n,e)}},s3.prototype.removeChildElement=function(e){for(;e.firstElementChild;)e.removeChild(e.firstElementChild);return e},s3.prototype.onPropertyChanged=function(h,d){for(var p=this,c=this.getWrapper(),u=this,e=0,t=Object.keys(h);e<t.length;e++)!function(e){switch(e){case"cssClass":d.cssClass&&q([c],d.cssClass.split(" ")),h.cssClass&&U([c],h.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":u.enableRtl?c.classList.add(Xj):c.classList.remove(Xj);break;case"showItemOnClick":u.unWireEvents(),u.showItemOnClick=h.showItemOnClick,u.wireEvents();break;case"enableScrolling":var t,i;h.enableScrolling?(u.element.classList.contains("e-vertical")?Tj(u.createElement,c,u.element,"vscroll",u.enableRtl):Tj(u.createElement,c,u.element,"hscroll",u.enableRtl),u.getPopups().forEach(function(e){t=ge(".e-ul",e),Tj(p.createElement,e,t,"vscroll",p.enableRtl)})):(i=c.children[0],u.element.classList.contains("e-vertical")||!u.isMenu?Dj(K(i,xj),i):Dj(K(i,lj),i),c.style.overflow="",c.appendChild(u.element),u.getPopups().forEach(function(e){Dj(K(i=e.children[0],xj),i),e.style.overflow=""}));break;case"items":var n,o,r=void 0;if(u.isReact&&u.template&&u.clearTemplate(["template"]),Object.keys(d.items).length)for(var s=Object.keys(h.items),a=0;a<s.length;a++)(r=u.getChangedItemIndex(h,[],Number(s[a]))).length<=u.getWrapper().children.length&&(n=r.pop(),o=u.getItems(r),u.insertAfter([o[n]],o[n].text),u.removeItem(o,r,n),u.setItems(o,r)),r.length=0;else{if(u.updateItem(u.element,u.items),u.enableScrolling&&u.element.parentElement.classList.contains("e-custom-scroll")&&(u.element.classList.contains("e-vertical")?Tj(u.createElement,c,u.element,"vscroll",u.enableRtl):Tj(u.createElement,c,u.element,"hscroll",u.enableRtl)),!u.hamburgerMode)for(var a=1,l=c.childElementCount;a<l;a++)G(c.lastElementChild);u.navIdx=[]}}}(t[e])},s3.prototype.updateItem=function(t,e){var i;N&&!this.isMenu?t=this.removeChildElement(t):(this.enableScrolling&&(i=this.getWrapper().children[0],this.element.classList.contains("e-vertical")?Dj(K(i,xj),i):Dj(K(i,lj),i)),t.innerHTML=""),[].slice.call(this.createItems(e).children).forEach(function(e){t.appendChild(e)})},s3.prototype.getChangedItemIndex=function(e,t,i){t.push(i);var n=Object.keys(e.items[i]).pop();return"items"===n?(e=e.items[i],(i=Object.keys(e.items).pop())&&this.getChangedItemIndex(e,t,Number(i))):"isParentArray"===n&&1<t.length&&t.pop(),t},s3.prototype.removeItem=function(e,t,i){e.splice(i,1);e=this.getWrapper().children;t.length<e.length&&(this.enableScrolling&&!e[t.length].classList.contains("e-menu-parent")?G(e[t.length].querySelector(".e-menu-parent").children[i]):G(e[t.length].children[i]))},s3.prototype.unWireEvents=function(e){void 0===e&&(e=this.target);var t=this.getWrapper();if(e){for(var i,n=void 0,o=ct(e),r=0,s=o.length;r<s;r++)i=o[r],this.isMenu?E.remove(i,"click",this.menuHeaderClickHandler):F.isIos?(n=K(i,Mn))&&n.destroy():E.remove(i,"contextmenu",this.cmenuHandler);if(!this.isMenu){E.remove(this.targetElement,"scroll",this.scrollHandler);for(var a=0,l=xv(this.targetElement);a<l.length;a++){var h=l[a];E.remove(h,"scroll",this.scrollHandler)}}}F.isDevice||(E.remove(this.isMenu?document:t,"mouseover",this.delegateMoverHandler),E.remove(document,"mousedown",this.delegateMouseDownHandler),E.remove(document,"keydown",this.domKeyHandler),this.isMenu)||this.target||E.remove(document,"scroll",this.scrollHandler),E.remove(document,"click",this.delegateClickHandler),this.unWireKeyboardEvent(t),this.rippleFn(),!this.isMenu&&this.enableScrolling&&(t.removeEventListener("touchstart",this.touchStartFn),t.removeEventListener("touchmove",this.touchMoveFn),document.removeEventListener("touchstart",this.touchOutsideHandler))},s3.prototype.unWireKeyboardEvent=function(e){e=K(e,bn);e&&e.destroy()},s3.prototype.toggleAnimation=function(e,t){var i,n,o=this,r=(void 0===t&&(t=!0),this.enableScrolling&&!this.isMenu&&z(e,".e-menu-vscroll")?z(e,".e-menu-vscroll"):e);"None"!==this.animationSettings.effect&&t?this.animation.animate(r,{name:this.animationSettings.effect,duration:this.animationSettings.duration,timingFunction:this.animationSettings.easing,begin:function(e){o.hamburgerMode?(n=e.element.parentElement,e.element.style.position="absolute",n&&(i=n.offsetHeight),e.element.style.maxHeight=e.element.offsetHeight+"px",n&&(n.style.maxHeight="")):(e.element.style.display="block",e.element.style.maxHeight=o.isMenu?e.element.getBoundingClientRect().height+"px":e.element.scrollHeight+"px")},progress:function(e){o.hamburgerMode&&n&&(n.style.minHeight=i+e.element.offsetHeight+"px")},end:function(e){o.hamburgerMode?(e.element.style.position="",e.element.style.maxHeight="",n&&(n.style.minHeight=""),e.element.style.top="0px",e.element.children[0].focus(),o.triggerOpen(e.element.children[0])):o.end(e.element,t),o.isKBDAction=!1}}):(this.hamburgerMode&&e&&(e.style.top="0px"),this.isAnimationNone="None"===this.animationSettings.effect,this.end(e,t))},s3.prototype.triggerOpen=function(e){var t=this.navIdx.length?this.getItem(this.navIdx):null,t={element:e,parentItem:t,items:(t||this).items};this.trigger("onOpen",t),this.isMenu||E.add(e,"keydown",this.keyHandler,this)},s3.prototype.end=function(e,t){var i;t&&this.isContextMenuClosed?((this.isMenu||!F.isDevice||!this.isMenu&&this.isAnimationNone&&F.isDevice)&&(e.style.display="block"),e.style.maxHeight="",(i=this.enableScrolling&&!this.isMenu?z(e,".e-menu-vscroll"):null)&&(i.style.display="block"),this.triggerOpen(e),e.querySelector("."+Fj)&&this.isKBDAction?e.querySelector("."+Fj).focus():(t=this.getWrapper().children[this.getIdx(this.getWrapper(),e)-1],this.currentTarget&&(this.currentTarget.classList.contains("e-numerictextbox")||this.currentTarget.classList.contains("e-textbox")||"INPUT"===this.currentTarget.tagName)||(t&&this.isKBDAction?t.querySelector("."+Rj):this.element).focus())):((i=this.enableScrolling&&!this.isMenu?z(e,".e-menu-vscroll"):null)&&Dj(K(i,xj),i),e===this.element?((t=this.getLIByClass(this.element,Fj))&&t.classList.remove(Fj),(i=this.getLIByClass(this.element,Rj))&&i.classList.remove(Rj),e.style.display="none",this.isAnimationNone=!1):G(e))},s3.prototype.getPersistData=function(){return""},s3.prototype.getWrapper=function(){return z(this.element,".e-"+this.getModuleName()+"-wrapper")},s3.prototype.getIndex=function(e,t,i,n,o,r){void 0===n&&(n=[]),void 0===r&&(r=0),r=(o=void 0===o?!1:o)?r+1:0;for(var s=0,a=(i=void 0===i?this.items:i).length;s<a;s++){var l=i[s],h=t?l[this.getField("itemId",r)]:l[this.getField("text",r)];if((l.htmlAttributes&&"id"in l.htmlAttributes?l.htmlAttributes.id:h)===e){n.push(s);break}if(l[this.getField("children",r)]&&l[this.getField("children",r)].length){if(-1!==(n=this.getIndex(e,t,l[this.getField("children",r)],n,!0,r))[n.length-1]){n.unshift(s);break}s!==a-1&&n.pop()}else s===a-1&&n.push(-1)}return o||-1!==n[0]?n:[]},s3.prototype.enableItems=function(e,t,i){void 0===t&&(t=!0);for(var n,o=qj,r=0;r<e.length;r++){if(n=this.getIndex(e[r],i),this.navIdx.length){if(1!==n.length){for(var s=!1,a=0,l=n.length-1;a<l;a++)if(n[a]!==this.navIdx[a]){s=!0;break}if(s)continue}}else if(1!==n.length)continue;var h,d=n.pop();(h=this.getUlByNavIdx(n.length))&&!je(d)&&(t?this.isMenu?(h.children[d].classList.remove(o),h.children[d].removeAttribute("aria-disabled")):(F.isDevice&&!h.classList.contains("e-contextmenu")?h.children[d+1]:(this.enableScrolling&&!h.classList.contains("e-menu-parent")?h.querySelector(".e-menu-parent"):h).children[d]).classList.remove(o):this.isMenu?(h.children[d].classList.add(o),h.children[d].setAttribute("aria-disabled","true")):(F.isDevice&&!h.classList.contains("e-contextmenu")?h.children[d+1]:(this.enableScrolling&&!h.classList.contains("e-menu-parent")?h.querySelector(".e-menu-parent"):h).children[d]).classList.add(o))}},s3.prototype.showItems=function(e,t){this.showHideItems(e,!1,t)},s3.prototype.hideItems=function(e,t){this.showHideItems(e,!0,t)},s3.prototype.showHideItems=function(e,t,i){for(var n=0;n<e.length;n++){var o=(s=this.getIndex(e[n],i)).pop(),r=this.getUlByNavIdx(s.length),s=this.getItems(s);r&&(this.enableScrolling&&!r.classList.contains("e-menu-parent")&&(r=r.querySelector(".e-menu-parent")),s=i?r.children[o].id:s[o].text.toString(),t&&s===e[n]?r.children[o].classList.add(Gj):t||s!==e[n]||r.children[o].classList.remove(Gj))}},s3.prototype.removeItems=function(e,t){for(var i,n,o,r=0;r<e.length;r++)i=(n=this.getIndex(e[r],t)).pop(),o=this.getItems(n),je(i)||this.removeItem(o,n,i)},s3.prototype.insertAfter=function(e,t,i){this.insertItems(e,t,i)},s3.prototype.insertBefore=function(e,t,i){this.insertItems(e,t,i,!1)},s3.prototype.insertItems=function(e,t,i,n){void 0===n&&(n=!0);for(var o=0;o<e.length;o++){r=(s=this.getIndex(t,i)).pop(),a=this.getItems(s),(l=new e3(a[0],"items",e[o],!0)).parentObj=a[0].parentObj,a.splice(n?r+1:r,0,l);var r,s,a,l=this.isMenu?[this.getWrapper()].concat(this.getPopups()):[].slice.call(this.getWrapper().children);!je(r)&&s.length<l.length&&(r=n?r+1:r,a=this.createItems(a).children[r],s=l=this.isMenu?ge(".e-menu-parent",l[s.length]):l[s.length],(s=this.enableScrolling&&!s.classList.contains("e-menu-parent")?s.querySelector(".e-menu-parent"):s).insertBefore(a,s.children[r]),o!==e.length-1||this.isMenu||"block"!==s.style.display||(this.enableScrolling?(this.setPosition(null,s,parseFloat(l.style.top),parseFloat(l.style.left)),(a=z(s,".e-vscroll"))&&(a.style.display="block")):(this.setPosition(null,s,parseFloat(s.style.top),parseFloat(s.style.left)),s.style.display="block")))}},s3.prototype.removeAttributes=function(){var t=this;["top","left","display","z-index"].forEach(function(e){t.element.style.removeProperty(e)}),["role","tabindex","class","style"].forEach(function(e){"class"===e&&t.element.classList.contains("e-menu-parent")&&t.element.classList.remove("e-menu-parent"),-1!==["class","style"].indexOf(e)&&t.element.getAttribute(e)||t.element.removeAttribute(e),t.isMenu&&"class"===e&&t.element.classList.contains("e-vertical")&&t.element.classList.remove("e-vertical")})},s3.prototype.destroy=function(){var e,t=this.getWrapper();t&&(this.unWireEvents(),this.isMenu?(this.closeMenu(),N&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",this.removeAttributes(),t.parentNode.insertBefore(this.element,t)):(this.clonedElement.style.display="","EJS-CONTEXTMENU"===this.clonedElement.tagName?(U([this.clonedElement],["e-control","e-lib","e-"+this.getModuleName()]),this.element=this.clonedElement):(this.refreshing&&this.clonedElement.childElementCount&&"LI"===this.clonedElement.children[0].tagName&&this.setProperties({items:[]},!0),document.getElementById(this.clonedElement.id)&&((e=this.clonedElement.nextElementSibling)&&e!==t?this.clonedElement.parentElement.insertBefore(this.element,e):this.clonedElement.parentElement.appendChild(this.element),N&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",ht([].slice.call(this.clonedElement.children),this.element),G(this.clonedElement),this.removeAttributes()))),this.clonedElement=null,G(t),r3.prototype.destroy.call(this),this.template)&&this.clearTemplate(["template"]),this.rippleFn=null},Wz([i()],s3.prototype,"beforeItemRender",void 0),Wz([i()],s3.prototype,"beforeOpen",void 0),Wz([i()],s3.prototype,"onOpen",void 0),Wz([i()],s3.prototype,"beforeClose",void 0),Wz([i()],s3.prototype,"onClose",void 0),Wz([i()],s3.prototype,"select",void 0),Wz([i()],s3.prototype,"created",void 0),Wz([e("")],s3.prototype,"cssClass",void 0),Wz([e(0)],s3.prototype,"hoverDelay",void 0),Wz([e(!1)],s3.prototype,"showItemOnClick",void 0),Wz([e("")],s3.prototype,"target",void 0),Wz([e("")],s3.prototype,"filter",void 0),Wz([e(null)],s3.prototype,"template",void 0),Wz([e(!1)],s3.prototype,"enableScrolling",void 0),Wz([e(!0)],s3.prototype,"enableHtmlSanitizer",void 0),Wz([t({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},Jj)],s3.prototype,"fields",void 0),Wz([kt([],e3)],s3.prototype,"items",void 0),Wz([t({duration:400,easing:"ease",effect:"SlideDown"},n3)],s3.prototype,"animationSettings",void 0);var r3,wH=Wz([Bt],s3);function s3(e,t){e=r3.call(this,e,t)||this;return e.navIdx=[],e.animation=new Vt({}),e.isTapHold=!1,e.tempItem=[],e.showSubMenuOn="Auto",e.isAnimationNone=!1,e.isKBDAction=!1,e}a3=function(e,t){return(a3=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])}))(e,t)};var a3,l3,Wz=function(e,t){function i(){this.constructor=e}a3(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},h3=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},d3="e-vertical",p3="e-toolbar-items",c3="e-toolbar-item",u3="e-rtl",g3="e-separator",m3="e-popup-up-icon",f3="e-popup-down-icon",y3="e-popup-open",v3="e-template",b3="e-overlay",w3="e-toolbar-text",C3="e-popup-text",S3="e-overflow-show",A3="e-overflow-hide",x3="e-hor-nav",I3="e-scroll-nav",T3="e-toolbar-center",E3="e-tbar-pos",D3="e-hscroll-bar",M3="e-toolbar-pop",k3="e-toolbar-popup",P3="e-nav-active",B3="e-ignore",F3="e-popup-alone",L3="e-hidden",R3="e-toolbar-multirow",O3="e-multirow-pos",N3="e-multirow-separator",V3="e-extended-separator",_3="e-extended-toolbar",H3="e-toolbar-extended",z3="e-tbar-extended",j3=(Wz(W3,l3=n),h3([e("")],W3.prototype,"id",void 0),h3([e("")],W3.prototype,"text",void 0),h3([e("auto")],W3.prototype,"width",void 0),h3([e("")],W3.prototype,"cssClass",void 0),h3([e(!1)],W3.prototype,"showAlwaysInPopup",void 0),h3([e(!1)],W3.prototype,"disabled",void 0),h3([e("")],W3.prototype,"prefixIcon",void 0),h3([e("")],W3.prototype,"suffixIcon",void 0),h3([e(!0)],W3.prototype,"visible",void 0),h3([e("None")],W3.prototype,"overflow",void 0),h3([e("")],W3.prototype,"template",void 0),h3([e("Button")],W3.prototype,"type",void 0),h3([e("Both")],W3.prototype,"showTextOn",void 0),h3([e(null)],W3.prototype,"htmlAttributes",void 0),h3([e("")],W3.prototype,"tooltipText",void 0),h3([e("Left")],W3.prototype,"align",void 0),h3([i()],W3.prototype,"click",void 0),h3([e(-1)],W3.prototype,"tabIndex",void 0),W3);function W3(){return null!==l3&&l3.apply(this,arguments)||this}Wz(q3,Q3=Ji),q3.prototype.destroy=function(){var t=this,e=((this.isReact||this.isAngular)&&this.clearTemplate(),this.element.querySelectorAll(".e-control.e-btn"));for([].slice.call(e).forEach(function(e){je(e)||je(e.ej2_instances)||je(e.ej2_instances[0])||e.ej2_instances[0].isDestroyed||e.ej2_instances[0].destroy()}),this.unwireEvents(),this.tempId.forEach(function(e){je(t.element.querySelector(e))||(document.body.appendChild(t.element.querySelector(e)).style.display="none")}),this.destroyItems();this.element.lastElementChild;)this.element.removeChild(this.element.lastElementChild);this.trgtEle&&(this.element.appendChild(this.ctrlTem),this.trgtEle=null,this.ctrlTem=null),this.popObj&&(this.popObj.destroy(),G(this.popObj.element)),this.activeEle&&(this.activeEle=null),this.popObj=null,this.tbarAlign=null,this.tbarItemsCol=[],this.remove(this.element,"e-toolpop"),this.cssClass&&q([this.element],this.cssClass.split(" ")),this.element.removeAttribute("style"),["aria-disabled","aria-orientation","role"].forEach(function(e){return t.element.removeAttribute(e)}),Q3.prototype.destroy.call(this)},q3.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(d3),this.isExtendedOpen=!1,this.popupPriCount=0,this.enableRtl&&this.add(this.element,u3)},q3.prototype.wireEvents=function(){E.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resizeContext),window.addEventListener("orientationchange",this.orientationChangeContext),this.allowKeyboard&&this.wireKeyboardEvent()},q3.prototype.wireKeyboardEvent=function(){this.keyModule=new bn(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),E.add(this.element,"keydown",this.docKeyDown,this),this.updateTabIndex("0")},q3.prototype.updateTabIndex=function(e){var t,i=this.element.querySelector("."+c3+":not(."+b3+" ):not(."+g3+" ):not(."+L3+" )");je(i)||je(i.firstElementChild)||(t=i.firstElementChild.getAttribute("data-tabindex"))&&"-1"===t&&"INPUT"!==i.firstElementChild.tagName&&i.firstElementChild.setAttribute("tabindex",e)},q3.prototype.unwireKeyboardEvent=function(){this.keyModule&&(E.remove(this.element,"keydown",this.docKeyDown),this.keyModule.destroy(),this.keyModule=null)},q3.prototype.docKeyDown=function(e){var t;"INPUT"!==e.target.tagName&&(t=!je(this.popObj)&&at(this.popObj.element)&&"Extended"!==this.overflowMode,9===e.keyCode&&!0===e.target.classList.contains("e-hor-nav")&&t&&this.popObj.hide({name:"FadeOut",duration:100}),40!==e.keyCode&&38!==e.keyCode&&35!==e.keyCode&&36!==e.keyCode||e.preventDefault())},q3.prototype.unwireEvents=function(){E.remove(this.element,"click",this.clickHandler),this.destroyScroll(),this.unwireKeyboardEvent(),window.removeEventListener("resize",this.resizeContext),window.removeEventListener("orientationchange",this.orientationChangeContext),document.removeEventListener("scroll",this.clickEvent),document.removeEventListener("click",this.scrollEvent),this.scrollEvent=null,this.clickEvent=null},q3.prototype.clearProperty=function(){this.tbarEle=[],this.tbarAlgEle={lefts:[],centers:[],rights:[]}},q3.prototype.docEvent=function(e){e=z(e.target,".e-popup");this.popObj&&at(this.popObj.element)&&!e&&"Popup"===this.overflowMode&&this.popObj.hide({name:"FadeOut",duration:100})},q3.prototype.destroyScroll=function(){this.scrollModule&&(this.tbarAlign&&this.add(this.scrollModule.element,E3),this.scrollModule.destroy(),this.scrollModule=null)},q3.prototype.destroyItems=function(){var e;this.element&&[].slice.call(this.element.querySelectorAll("."+c3)).forEach(function(e){G(e)}),this.tbarAlign&&(e=this.element.querySelector("."+p3),[].slice.call(e.children).forEach(function(e){G(e)}),this.tbarAlign=!1,this.remove(e,E3)),this.clearProperty()},q3.prototype.destroyMode=function(){this.scrollModule&&(this.remove(this.scrollModule.element,u3),this.destroyScroll()),this.remove(this.element,z3),this.remove(this.element,_3);var e=this.element.querySelector(".e-toolbar-multirow");e&&this.remove(e,R3),this.popObj&&this.popupRefresh(this.popObj.element,!0)},q3.prototype.add=function(e,t){e.classList.add(t)},q3.prototype.remove=function(e,t){e.classList.remove(t)},q3.prototype.elementFocus=function(e){var t=e.firstElementChild;t?(t.focus(),this.activeEleSwitch(e)):e.focus()},q3.prototype.clstElement=function(e,t){e=e&&this.popObj&&at(this.popObj.element)?this.popObj.element.querySelector("."+c3):this.element===t||e?this.element.querySelector("."+c3+":not(."+b3+" ):not(."+g3+" ):not(."+L3+" )"):z(t,"."+c3);return e},q3.prototype.keyHandling=function(e,t,i,n,o){var r,s,a,l,h=this.popObj,d=this.element,p={name:"FadeOut",duration:100},c="moveUp"===t.action?"previous":"next";switch(t.action){case"moveRight":this.isVertical||(d===i?this.elementFocus(e):n||this.eleFocus(e,"next"));break;case"moveLeft":this.isVertical||n||this.eleFocus(e,"previous");break;case"home":case"end":e&&(a=z(e,".e-popup"),s=this.element.querySelector("."+H3),(a="Extended"===this.overflowMode&&s&&s.classList.contains("e-popup-open")?"end"===t.action?s:null:a)?at(this.popObj.element)&&(l=[].slice.call(a.children),r="home"===t.action?this.focusFirstVisibleEle(l):this.focusLastVisibleEle(l)):(l=this.element.querySelectorAll("."+p3+" ."+c3+":not(."+g3+")"),r="home"===t.action?this.focusFirstVisibleEle(l):this.focusLastVisibleEle(l)),r)&&this.elementFocus(r);break;case"moveUp":case"moveDown":this.isVertical?"moveUp"===t.action?this.eleFocus(e,"previous"):this.eleFocus(e,"next"):h&&z(i,".e-popup")?(a=(s=h.element).firstElementChild,"previous"==c&&a===e?s.lastElementChild.firstChild.focus():"next"==c&&s.lastElementChild===e?a.firstChild.focus():this.eleFocus(e,c)):"moveDown"===t.action&&h&&at(h.element)&&this.elementFocus(e);break;case"tab":o||n||(l=e.firstElementChild,d===i&&(this.activeEle||(this.activeEleRemove(l),l)).focus());break;case"popupClose":h&&"Extended"!==this.overflowMode&&h.hide(p);break;case"popupOpen":n&&(h&&!at(h.element)?(h.element.style.top=d.offsetHeight+"px",h.show({name:"FadeIn",duration:100})):h.hide(p))}},q3.prototype.keyActionHandler=function(e){var t,i,n,o=e.target;"INPUT"!==o.tagName&&"TEXTAREA"!==o.tagName&&!this.element.classList.contains(b3)&&(e.preventDefault(),t=o.classList.contains(x3),i=o.classList.contains(I3),(n=this.clstElement(t,o))||i)&&this.keyHandling(n,e,o,t,i)},q3.prototype.disable=function(e){var t=this.element;e?t.classList.add(b3):t.classList.remove(b3),this.activeEle&&this.activeEle.setAttribute("tabindex",this.activeEle.getAttribute("data-tabindex")),this.scrollModule&&this.scrollModule.disable(e),this.popObj&&(at(this.popObj.element)&&"Extended"!==this.overflowMode&&this.popObj.hide(),t.querySelector("#"+t.id+"_nav").setAttribute("tabindex",e?"-1":"0"))},q3.prototype.eleContains=function(e){return e.classList.contains(g3)||e.classList.contains(b3)||e.getAttribute("disabled")||e.classList.contains(L3)||!at(e)||!e.classList.contains(c3)},q3.prototype.focusFirstVisibleEle=function(e){for(var t=0;t<e.length;){var i=e[parseInt(t.toString(),10)];if(!i.classList.contains(L3)&&!i.classList.contains(b3))return i;t++}},q3.prototype.focusLastVisibleEle=function(e){for(var t=e.length-1;0<=t;){var i=e[parseInt(t.toString(),10)];if(!i.classList.contains(L3)&&!i.classList.contains(b3))return i;t--}},q3.prototype.eleFocus=function(e,t){var i,n=Object(e)[t+"ElementSibling"];n?this.eleContains(n)?this.eleFocus(n,t):this.elementFocus(n):this.tbarAlign?(je(n=Object(e.parentElement)[t+"ElementSibling"])||0!==n.children.length||(n=Object(n)[t+"ElementSibling"]),!je(n)&&0<n.children.length&&("next"===t?(i=n.querySelector("."+c3),this.eleContains(i)?this.eleFocus(i,t):(i.firstElementChild.focus(),this.activeEleSwitch(i))):(i=n.lastElementChild,this.eleContains(i)?this.eleFocus(i,t):this.elementFocus(i)))):je(e)||(n=this.element.querySelectorAll("."+p3+" ."+c3+":not(."+g3+"):not(."+b3+"):not(."+L3+")"),"next"===t&&n?this.elementFocus(n[0]):"previous"===t&&n&&this.elementFocus(n[n.length-1]))},q3.prototype.clickHandler=function(e){var t,i=this,n=e.target,o=this.element,r=!je(z(n,"."+M3)),s=n.classList,a=(a=z(n,"."+x3))||n,n=(((s=o.children[0].classList.contains("e-hscroll")||o.children[0].classList.contains("e-vscroll")||!s.contains(x3)?s:n.querySelector(".e-icons").classList).contains(m3)||s.contains(f3))&&this.popupClickHandler(o,a,u3),z(e.target,"."+c3));(je(n)||n.classList.contains(b3))&&!a.classList.contains(x3)||(s={originalEvent:e,item:t=n?this.items[this.tbarEle.indexOf(n)]:t},(t&&!je(t.click)&&"object"==typeof t.click?!je(t.click.observers)&&0<t.click.observers.length:!je(t)&&!je(t.click))&&this.trigger("items["+this.tbarEle.indexOf(n)+"].click",s),s.cancel)||this.trigger("clicked",s,function(e){!je(i.popObj)&&r&&!e.cancel&&"Popup"===i.overflowMode&&e.item&&"Input"!==e.item.type&&i.popObj.hide({name:"FadeOut",duration:100})})},q3.prototype.popupClickHandler=function(e,t,i){var n=this.popObj;at(n.element)?(t.classList.remove(P3),n.hide({name:"FadeOut",duration:100})):(e.classList.contains(i)&&(n.enableRtl=!0,n.position={X:"left",Y:"top"}),0!==n.offsetX||e.classList.contains(i)||(n.enableRtl=!1,n.position={X:"right",Y:"top"}),"Extended"===this.overflowMode&&(n.element.style.minHeight="0px",n.width=this.getToolbarPopupWidth(this.element)),n.dataBind(),n.refreshPosition(),n.element.style.top=this.getElementOffsetY()+"px",t.classList.add(P3),n.show({name:"FadeIn",duration:100}))},q3.prototype.getToolbarPopupWidth=function(e){e=window.getComputedStyle(e);return parseFloat(e.width)+2*parseFloat(e.borderRightWidth)},q3.prototype.render=function(){var e=this;this.initialize(),this.renderControl(),this.wireEvents(),this.clickEvent=this.docEvent.bind(this),this.scrollEvent=this.docEvent.bind(this),this.renderComplete(),this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){e.refreshOverflow()})},q3.prototype.initialize=function(){var e=T(this.width),t=T(this.height),t=("msie"===F.info.name&&"auto"===this.height&&"MultiRow"!==this.overflowMode||gt(this.element,{height:t}),gt(this.element,{width:e}),{role:"toolbar","aria-disabled":"false","aria-orientation":this.isVertical?"vertical":"horizontal"});pt(this.element,t),this.cssClass&&U([this.element],this.cssClass.split(" "))},q3.prototype.renderControl=function(){var e=this.element;this.trgtEle=0<e.children.length?e.querySelector("div"):null,this.tbarAlgEle={lefts:[],centers:[],rights:[]},this.renderItems(),this.renderLayout()},q3.prototype.renderLayout=function(){this.renderOverflowMode(),this.tbarAlign&&this.itemPositioning(),this.popObj&&1<this.popObj.element.childElementCount&&this.checkPopupRefresh(this.element,this.popObj.element)&&this.popupRefresh(this.popObj.element,!1),this.separator()},q3.prototype.itemsAlign=function(e,t){var i,n;this.tbarEle||(this.tbarEle=[]);for(var o=0;o<e.length;o++)i=this.renderSubComponent(e[parseInt(o.toString(),10)],o),-1===this.tbarEle.indexOf(i)&&this.tbarEle.push(i),this.tbarAlign||this.tbarItemAlign(e[parseInt(o.toString(),10)],t,o),((n=t.querySelector(".e-toolbar-"+e[parseInt(o.toString(),10)].align.toLowerCase()))?(e[parseInt(o.toString(),10)].showAlwaysInPopup&&"Show"!==e[parseInt(o.toString(),10)].overflow||this.tbarAlgEle[(e[parseInt(o.toString(),10)].align+"s").toLowerCase()].push(i),n):t).appendChild(i);this.isReact&&(this.notify("render-react-toolbar-template",this.portals),this.renderReactTemplates())},q3.prototype.changeOrientation=function(){var e=this.element;this.isVertical?(e.classList.remove(d3),this.isVertical=!1,"auto"!==this.height&&"100%"!==this.height||(e.style.height=this.height),e.setAttribute("aria-orientation","horizontal")):(e.classList.add(d3),this.isVertical=!0,e.setAttribute("aria-orientation","vertical"),gt(this.element,{height:T(this.height),width:T(this.width)})),this.destroyMode(),this.refreshOverflow()},q3.prototype.initScroll=function(e,t){!this.scrollModule&&this.checkOverflow(e,t[0])&&(this.tbarAlign&&this.element.querySelector("."+p3+" ."+T3).removeAttribute("style"),this.isVertical?this.scrollModule=new xj({scrollStep:this.scrollStep,enableRtl:this.enableRtl},t[0]):this.scrollModule=new lj({scrollStep:this.scrollStep,enableRtl:this.enableRtl},t[0]),this.cssClass&&U([t[0]],this.cssClass.split(" ")),(e=this.scrollModule.element.querySelector("."+D3+", .e-vscroll-bar"))&&e.removeAttribute("tabindex"),this.remove(this.scrollModule.element,E3),gt(this.element,{overflow:"hidden"}))},q3.prototype.itemWidthCal=function(e){var t,i=this,n=0;return[].slice.call(ct("."+c3,e)).forEach(function(e){at(e)&&(t=window.getComputedStyle(e),n=(n=(n+=i.isVertical?e.offsetHeight:e.offsetWidth)+parseFloat(i.isVertical?t.marginTop:t.marginRight))+parseFloat(i.isVertical?t.marginBottom:t.marginLeft))}),n},q3.prototype.getScrollCntEle=function(e){var t=this.isVertical?".e-vscroll-content":".e-hscroll-content";return e.querySelector(t)},q3.prototype.checkOverflow=function(e,t){var i,n,o;return!(je(e)||je(t)||!at(e)||(i=this.isVertical?e.offsetHeight:e.offsetWidth,n=this.isVertical?t.offsetHeight:t.offsetWidth,(this.tbarAlign||this.scrollModule||i===n)&&(n=this.itemWidthCal(this.scrollModule?this.getScrollCntEle(t):t)),t=e.querySelector("."+x3),e=e.querySelector("."+I3),o=0,t?o=this.isVertical?t.offsetHeight:t.offsetWidth:e&&(o=this.isVertical?2*e.offsetHeight:2*e.offsetWidth),n<=i&&e))&&i-o<n},q3.prototype.refreshOverflow=function(){this.resize()},q3.prototype.toolbarAlign=function(e){this.tbarAlign&&(this.add(e,E3),this.itemPositioning())},q3.prototype.renderOverflowMode=function(){var e=this.element,t=e.querySelector("."+p3),i=0<this.popupPriCount;if(e&&0<e.children.length)switch(this.offsetWid=e.offsetWidth,this.remove(this.element,"e-toolpop"),"msie"===F.info.name&&"auto"===this.height&&(e.style.height=""),this.overflowMode){case"Scrollable":je(this.scrollModule)&&this.initScroll(e,[].slice.call(e.getElementsByClassName(p3)));break;case"Popup":this.add(this.element,"e-toolpop"),this.tbarAlign&&this.removePositioning(),(this.checkOverflow(e,t)||i)&&this.setOverflowAttributes(e),this.toolbarAlign(t);break;case"MultiRow":this.add(t,R3),this.checkOverflow(e,t)&&this.tbarAlign&&(this.removePositioning(),this.add(t,O3)),"hidden"===e.style.overflow&&(e.style.overflow=""),"msie"!==F.info.name&&"auto"===e.style.height||(e.style.height="auto");break;case"Extended":this.add(this.element,_3),(this.checkOverflow(e,t)||i)&&(this.tbarAlign&&this.removePositioning(),this.setOverflowAttributes(e)),this.toolbarAlign(t)}},q3.prototype.setOverflowAttributes=function(e){this.createPopupEle(e,[].slice.call(ct("."+p3+" ."+c3,e)));pt(this.element.querySelector("."+x3),{tabindex:"0",role:"button","aria-haspopup":"true","aria-label":"overflow"})},q3.prototype.separator=function(){var e=this.element,t=[].slice.call(e.querySelectorAll("."+g3)),i=e.querySelector("."+N3),e=e.querySelector("."+V3),i="MultiRow"===this.overflowMode?i:e;null!==i&&("MultiRow"===this.overflowMode?i.classList.remove(N3):"Extended"===this.overflowMode&&i.classList.remove(V3));for(var n=0;n<=t.length-1;n++)t[parseInt(n.toString(),10)].offsetLeft<30&&0!==t[parseInt(n.toString(),10)].offsetLeft&&("MultiRow"===this.overflowMode?t[parseInt(n.toString(),10)].classList.add(N3):"Extended"===this.overflowMode&&t[parseInt(n.toString(),10)].classList.add(V3))},q3.prototype.createPopupEle=function(e,t){var i=e.querySelector("."+x3),n=this.isVertical,i=(i||this.createPopupIcon(e),i=e.querySelector("."+x3),n?i.offsetHeight:i.offsetWidth),n=(n?e.offsetHeight:e.offsetWidth)-i;this.element.classList.remove("e-rtl"),gt(this.element,{direction:"initial"}),this.checkPriority(e,t,n,!0),this.enableRtl&&this.element.classList.add("e-rtl"),this.element.style.removeProperty("direction"),this.createPopup()},q3.prototype.pushingPoppedEle=function(i,n,o,r,s){for(var a,e=i.element,t=[].slice.call(ct("."+k3,e.querySelector("."+p3))),l=(ct("."+S3,o),0),h=0,d=(t.forEach(function(e,t){a=ct("."+S3,o),e.classList.contains(S3)&&0<a.length?(i.tbResize&&a.length>t?o.insertBefore(e,a[parseInt(t.toString(),10)]):o.insertBefore(e,o.children[a.length]),++h):e.classList.contains(S3)||i.tbResize&&e.classList.contains(A3)&&0<o.children.length&&0===a.length?(o.insertBefore(e,o.firstChild),++h):e.classList.contains(A3)?n.push(e):i.tbResize?(o.insertBefore(e,o.childNodes[l+h]),++l):o.appendChild(e),e.classList.contains(g3)?gt(e,{display:"",height:s+"px"}):gt(e,{display:"",height:r+"px"})}),n.forEach(function(e){o.appendChild(e)}),ct("."+c3,e.querySelector("."+p3))),p=d.length-1;0<=p;p--){var c=d[parseInt(p.toString(),10)];if(!c.classList.contains(g3)||"Extended"===this.overflowMode)break;gt(c,{display:"none"})}},q3.prototype.createPopup=function(){var e,t,i,n=this.element,o=("Extended"===this.overflowMode&&(e=n.querySelector("."+g3),e="auto"===n.style.height||""===n.style.height?null:e&&e.offsetHeight),n.querySelector("."+c3+":not(."+g3+"):not(."+k3+")")),o="auto"===n.style.height||""===n.style.height?null:o&&o.offsetHeight;i=ge("#"+n.id+"_popup."+M3,n)?ge("#"+n.id+"_popup."+M3,n):(i=this.createElement("div",{id:n.id+"_popup",className:M3+" "+H3}),t=this.createElement("div",{id:n.id+"_popup",className:M3}),"Extended"===this.overflowMode?i:t),this.pushingPoppedEle(this,[],i,o,e),this.popupInit(n,i)},q3.prototype.getElementOffsetY=function(){return"Extended"===this.overflowMode&&"border-box"===window.getComputedStyle(this.element).getPropertyValue("box-sizing")?this.element.clientHeight:this.element.offsetHeight},q3.prototype.popupInit=function(e,t){var i;this.popObj?"Extended"!==this.overflowMode&&(gt(i=this.popObj.element,{maxHeight:"",display:"block"}),gt(i,{maxHeight:i.offsetHeight+"px",display:""})):(e.appendChild(t),this.cssClass&&U([t],this.cssClass.split(" ")),gt(this.element,{overflow:""}),i=new Sv(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"}}),"Extended"===this.overflowMode&&(i.width=this.getToolbarPopupWidth(this.element),i.offsetX=0),i.appendTo(t),document.addEventListener("scroll",this.clickEvent),document.addEventListener("click",this.scrollEvent),"Extended"!==this.overflowMode&&(i.element.style.maxHeight=i.element.offsetHeight+"px"),this.isVertical&&(i.element.style.visibility="hidden"),this.isExtendedOpen?((e=this.element.querySelector("."+x3)).classList.add(P3),mt(e.firstElementChild,[m3],[f3]),this.element.querySelector("."+H3).classList.add(y3)):i.hide(),this.popObj=i)},q3.prototype.tbarPopupHandler=function(e){"Extended"===this.overflowMode&&(e?this.add(this.element,z3):this.remove(this.element,z3))},q3.prototype.popupOpen=function(e){var t=this.popObj,i=(this.isVertical||(t.offsetY=this.getElementOffsetY(),t.dataBind()),this.popObj.element),n=this.popObj.element.parentElement,o=n.querySelector("."+x3),r=(o.setAttribute("aria-expanded","true"),"Extended"===this.overflowMode?t.element.style.minHeight="":(gt(t.element,{height:"auto",maxHeight:""}),t.element.style.maxHeight=t.element.offsetHeight+"px"),i.offsetTop+i.offsetHeight+O0(n).top),s=o.firstElementChild,o=(o.classList.add(P3),mt(s,[m3],[f3]),this.tbarPopupHandler(!0),je(window.scrollY)?0:window.scrollY);if(!this.isVertical&&window.innerHeight+o<r&&this.element.offsetTop<i.offsetHeight){var a=i.offsetHeight-(r-window.innerHeight-o+5);t.height=a+"px";for(var l=0;l<=i.childElementCount;l++){var h=i.children[parseInt(l.toString(),10)];if(h.offsetTop+h.offsetHeight>a){a=h.offsetTop;break}}"Extended"!==this.overflowMode&&gt(t.element,{maxHeight:a+"px"})}else this.isVertical&&"Extended"!==this.overflowMode&&(s=this.element.getBoundingClientRect(),gt(t.element,{maxHeight:s.top+this.element.offsetHeight+"px",bottom:0,visibility:""}));t&&((r=i.getBoundingClientRect()).right>document.documentElement.clientWidth&&r.width>n.getBoundingClientRect().width&&(t.collision={Y:"none"},t.dataBind()),t.refreshPosition())},q3.prototype.popupClose=function(e){var t=this.element.querySelector("."+x3),i=(t.setAttribute("aria-expanded","false"),t.firstElementChild);t.classList.remove(P3),mt(i,[f3],[m3]),this.tbarPopupHandler(!1)},q3.prototype.checkPriority=function(e,t,i,n){for(var o,r,s=0<this.popupPriCount,a=i,l=0,h=0,d=0,p=function(t,e){var i=!1;return e.forEach(function(e){t.classList.contains(e)&&(i=!0)}),i},c=t.length-1;0<=c;c--){var u,g=void 0,m=window.getComputedStyle(t[parseInt(c.toString(),10)]),m=(this.isVertical?(g=parseFloat(m.marginTop),g+=parseFloat(m.marginBottom)):(g=parseFloat(m.marginRight),g+=parseFloat(m.marginLeft)),t[parseInt(c.toString(),10)]===this.tbarEle[0]),m=(m&&(this.tbarEleMrgn=g),o=this.isVertical?t[parseInt(c.toString(),10)].offsetHeight:t[parseInt(c.toString(),10)].offsetWidth,m?o+g:o);p(t[parseInt(c.toString(),10)],[F3])&&s&&(t[parseInt(c.toString(),10)].classList.add(k3),this.isVertical?gt(t[parseInt(c.toString(),10)],{display:"none",minHeight:m+"px"}):gt(t[parseInt(c.toString(),10)],{display:"none",minWidth:m+"px"}),d++),(this.isVertical?t[parseInt(c.toString(),10)].offsetTop+t[parseInt(c.toString(),10)].offsetHeight+g>i:t[parseInt(c.toString(),10)].offsetLeft+t[parseInt(c.toString(),10)].offsetWidth+g>i)&&(t[parseInt(c.toString(),10)].classList.contains(g3)?"Extended"===this.overflowMode?(p(u=t[parseInt(c.toString(),10)],[g3,B3])&&(t[parseInt(c.toString(),10)].classList.add(k3),d++),h++):"Popup"===this.overflowMode&&(0<l&&h===d&&p(u=t[c+h+(l-1)],[g3,B3])&&gt(u,{display:"none"}),l++,d=h=0):h++,t[parseInt(c.toString(),10)].classList.contains(S3)&&n||p(t[parseInt(c.toString(),10)],[g3,B3])?i-=(this.isVertical?t[parseInt(c.toString(),10)].offsetHeight:t[parseInt(c.toString(),10)].offsetWidth)+g:(t[parseInt(c.toString(),10)].classList.add(k3),this.isVertical?gt(t[parseInt(c.toString(),10)],{display:"none",minHeight:m+"px"}):gt(t[parseInt(c.toString(),10)],{display:"none",minWidth:m+"px"}),d++))}n&&(r=ct("."+c3+":not(."+k3+")",this.element),this.checkPriority(e,r,a,!1))},q3.prototype.createPopupIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav e-hor-nav"),i="Extended"===this.overflowMode?i+" e-expended-nav":i,t=this.createElement("div",{id:t,className:i}),i=("msie"!==F.info.name&&"edge"!==F.info.name||t.classList.add("e-ie-align"),this.createElement("div",{className:f3+" e-icons"}));t.appendChild(i),t.setAttribute("tabindex","0"),t.setAttribute("role","button"),e.appendChild(t)},q3.prototype.tbarPriRef=function(e,t,i,n,o,r,s,a,l){function h(e,t){return e.classList.contains(t)}var d,p,c,u=this.popObj.element,u=ct("."+k3+":not(."+S3+")",u).length;0===ct(".e-toolbar-item:not(.e-separator):not(.e-overflow-show)",e).length?(p=!je(d=e.children[t-(t-i)-1])&&h(d,B3),!je(d)&&h(d,g3)&&!at(d)||p?(d.style.display="unset",p=d.offsetWidth+2*parseFloat(window.getComputedStyle(d).marginRight),c=d.previousElementSibling,r+p<s||o?(e.insertBefore(n,e.children[t+a-(t-i)]),je(c)||(c.style.display="")):(gt(n,l),c.classList.contains(g3)&&(c.style.display="none")),d.style.display=""):e.insertBefore(n,e.children[t+a-(t-i)])):e.insertBefore(n,e.children[t+a-u])},q3.prototype.popupRefresh=function(e,t){var i,n=this,o=this.element,r=this.isVertical,s=o.querySelector("."+p3),a=o.querySelector("."+x3);je(a)||(s.removeAttribute("style"),e.style.display="block",o=r?o.offsetHeight-(a.offsetHeight+s.offsetHeight):o.offsetWidth-(a.offsetWidth+s.offsetWidth),i=0,[].slice.call(e.children).forEach(function(e){i+=n.popupEleWidth(e),gt(e,{position:""})}),o+(r?a.offsetHeight:a.offsetWidth)>i&&0===this.popupPriCount&&(t=!0),this.popupEleRefresh(o,e,t),e.style.display="",0===e.children.length&&a&&this.popObj&&(G(a),this.popObj.destroy(),G(this.popObj.element),this.popObj=null))},q3.prototype.ignoreEleFetch=function(t,i){var e=[].slice.call(i.querySelectorAll("."+B3)),n=[],o=0;return 0<e.length?(e.forEach(function(e){n.push([].slice.call(i.children).indexOf(e))}),n.forEach(function(e){e<=t&&o++}),o):0},q3.prototype.checkPopupRefresh=function(e,t){t.style.display="block";var i=this.popupEleWidth(t.firstElementChild),n=(t.firstElementChild.style.removeProperty("Position"),e.offsetWidth-e.querySelector("."+x3).offsetWidth),e=e.querySelector("."+p3).offsetWidth;return t.style.removeProperty("display"),i+e<n},q3.prototype.popupEleWidth=function(e){e.style.position="absolute";var t,i=this.isVertical?e.offsetHeight:e.offsetWidth,n=e.querySelector(".e-tbar-btn-text");return(e.classList.contains("e-tbtn-align")||e.classList.contains(C3))&&(t=e.children[0],!je(n)&&e.classList.contains(C3)?n.style.display="none":!je(n)&&e.classList.contains(w3)&&(n.style.display="block"),t.style.minWidth="0%",i=parseFloat(this.isVertical?e.style.minHeight:e.style.minWidth),t.style.minWidth="",t.style.minHeight="",je(n)||(n.style.display="")),i},q3.prototype.popupEleRefresh=function(r,e,s){for(var a,l,h=0<this.popupPriCount,d=this.tbarEle,p=this.element.querySelector("."+p3),c=0,u=this,t=0,i=[].slice.call(e.children);t<i.length&&"break"!==function(e){var t,i,n,o;return e.classList.contains(F3)&&h&&!s?"continue":(t=u.popupEleWidth(e),e===u.tbarEle[0]&&(t+=u.tbarEleMrgn),e.style.position="",t<r||s?(i={minWidth:e.style.minWidth,height:e.style.height,minHeight:e.style.minHeight},gt(e,{minWidth:"",height:"",minHeight:""}),e.classList.contains(A3)||e.classList.remove(k3),l=u.tbarEle.indexOf(e),u.tbarAlign&&(n=u.items[parseInt(l.toString(),10)].align,l=u.tbarAlgEle[(n+"s").toLowerCase()].indexOf(e),d=u.tbarAlgEle[(n+"s").toLowerCase()],p=u.element.querySelector("."+p3+" .e-toolbar-"+n.toLowerCase())),o=0,"Extended"!==u.overflowMode&&d.slice(0,l).forEach(function(e){(e.classList.contains(S3)||e.classList.contains(g3))&&(e.classList.contains(g3)&&(e.style.display="",r-=e.offsetWidth),o++)}),c=u.ignoreEleFetch(l,p),e.classList.contains(S3)?u.tbarPriRef(p,l,o,e,s,t,r,c,i):0===l?p.insertBefore(e,p.firstChild):(a=ct("."+S3,u.popObj.element).length,p.insertBefore(e,p.children[l+c-a])),r-=e.offsetWidth,void(e.style.height="")):"break")}(i[t]);t++);this.checkOverflow(this.element,this.element.getElementsByClassName(p3)[0])&&!s&&this.renderOverflowMode()},q3.prototype.removePositioning=function(){var e=this.element.querySelector("."+p3);!je(e)&&e.classList.contains(E3)&&(this.remove(e,E3),(e=[].slice.call(e.childNodes))[1].removeAttribute("style"),e[2].removeAttribute("style"))},q3.prototype.refreshPositioning=function(){var e=this.element.querySelector("."+p3);this.add(e,E3),this.itemPositioning()},q3.prototype.itemPositioning=function(){var e,t,i,n=this.element.querySelector("."+p3);je(n)||!n.classList.contains(E3)||(t=this.element.querySelector("."+x3),e=this.scrollModule?(e=this.isVertical?"e-vscroll-content":"e-hscroll-content",[].slice.call(n.querySelector("."+e).children)):[].slice.call(n.childNodes),n=this.isVertical?e[0].offsetHeight+e[2].offsetHeight:e[0].offsetWidth+e[2].offsetWidth,i=this.isVertical?this.element.offsetHeight:this.element.offsetWidth,t&&(i-=this.isVertical?t.offsetHeight:t.offsetWidth,t=(this.isVertical?t.offsetHeight:t.offsetWidth)+"px",e[2].removeAttribute("style"),this.isVertical?this.enableRtl?e[2].style.top=t:e[2].style.bottom=t:this.enableRtl?e[2].style.left=t:e[2].style.right=t),i<=n)||(t=(i-n-(this.isVertical?e[1].offsetHeight:e[1].offsetWidth))/2,e[1].removeAttribute("style"),i=(this.isVertical?e[0].offsetHeight:e[0].offsetWidth)+t+"px",this.isVertical?this.enableRtl?e[1].style.marginBottom=i:e[1].style.marginTop=i:this.enableRtl?e[1].style.marginRight=i:e[1].style.marginLeft=i)},q3.prototype.tbarItemAlign=function(e,t,i){var n,o,r=this;e.showAlwaysInPopup&&"Show"!==e.overflow||((n=[]).push(this.createElement("div",{className:"e-toolbar-left",attrs:{role:"group"}})),n.push(this.createElement("div",{className:T3,attrs:{role:"group"}})),n.push(this.createElement("div",{className:"e-toolbar-right",attrs:{role:"group"}})),0===i&&"Left"!==e.align?(n.forEach(function(e){t.appendChild(e)}),this.tbarAlign=!0,this.add(t,E3)):"Left"!==e.align&&(i=t.childNodes,o=n[0],[].slice.call(i).forEach(function(e){r.tbarAlgEle.lefts.push(e),o.appendChild(e)}),t.appendChild(o),t.appendChild(n[1]),t.appendChild(n[2]),this.tbarAlign=!0,this.add(t,E3)))},q3.prototype.ctrlTemplate=function(){var t=this;this.ctrlTem=this.trgtEle.cloneNode(!0),this.add(this.trgtEle,p3),this.tbarEle=[],[].slice.call(this.trgtEle.children).forEach(function(e){"DIV"===e.tagName&&(t.tbarEle.push(e),je(e.firstElementChild)||e.firstElementChild.setAttribute("aria-disabled","false"),t.add(e,c3))})},q3.prototype.renderItems=function(){var e,t=this.element,i=this.items;null!=this.trgtEle?this.ctrlTemplate():t&&0<i.length&&(e=void 0,e=(e=t&&0<t.children.length?t.querySelector("."+p3):e)||this.createElement("div",{className:p3}),this.itemsAlign(i,e),t.appendChild(e))},q3.prototype.setAttr=function(e,t){for(var i,n=Object.keys(e),o=0;o<n.length;o++)"class"===(i=n[parseInt(o.toString(),10)])?this.add(t,e[""+i]):t.setAttribute(i,e[""+i])},q3.prototype.enableItems=function(e,t){function i(e,t){e?(t.classList.remove(b3),je(t.firstElementChild)||t.firstElementChild.setAttribute("aria-disabled","false")):(t.classList.add(b3),je(t.firstElementChild)||t.firstElementChild.setAttribute("aria-disabled","true"))}var n,o=e,r=o.length;je(t)&&(t=!0);if(!je(r)&&1<=r){for(var s=0,a=[].slice.call(o);s<r;s++){var l=a[parseInt(s.toString(),10)];if("number"==typeof l){if(je(n=this.getElementByIndex(l)))return;o[parseInt(s.toString(),10)]=n}else n=l;i(t,n)}(t?q:U)(o,b3)}else{if("number"==typeof o){if(je(n=this.getElementByIndex(o)))return}else n=e;i(t,n)}},q3.prototype.getElementByIndex=function(e){return this.tbarEle[parseInt(e.toString(),10)]?this.tbarEle[parseInt(e.toString(),10)]:null},q3.prototype.addItems=function(e,t){this.extendedOpen();var i,n=this.element.querySelector("."+p3);if(je(n))this.itemsRerender(e);else{var o,r="Left";je(t)&&(t=0),e.forEach(function(e){je(e.align)||"Left"===e.align||"Left"!==r||(r=e.align)});for(var s=0,a=e;s<a.length;s++){var l,h,d=a[s];je(d.type)&&(d.type="Button"),i=ct("."+c3,this.element),d.align=r,o=this.renderSubComponent(d,t),this.tbarEle.length>=t&&0<=i.length&&(je(this.scrollModule)&&this.destroyMode(),l="L"===d.align[0]?0:"C"===d.align[0]?1:2,h=void 0,this.tbarAlign||"Left"===r?this.tbarAlign?((h=z(i[0],"."+p3).children[parseInt(l.toString(),10)]).insertBefore(o,h.children[parseInt(t.toString(),10)]),this.tbarAlgEle[(d.align+"s").toLowerCase()].splice(t,0,o),this.refreshPositioning()):0===i.length?(i=ct("."+p3,this.element))[0].appendChild(o):i[0].parentNode.insertBefore(o,i[parseInt(t.toString(),10)]):(this.tbarItemAlign(d,n,1),this.tbarAlign=!0,(h=z(i[0],"."+p3).children[parseInt(l.toString(),10)]).appendChild(o),this.tbarAlgEle[(d.align+"s").toLowerCase()].push(o),this.refreshPositioning()),this.items.splice(t,0,d),d.template&&this.tbarEle.splice(this.tbarEle.length-1,1),this.tbarEle.splice(t,0,o),t++,this.offsetWid=n.offsetWidth)}n.style.width="",this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()}},q3.prototype.removeItems=function(e){var t=e,i=[].slice.call(ct("."+c3,this.element));if("number"==typeof t)s=parseInt(e.toString(),10),this.removeItemByIndex(s,i);else if(t&&1<t.length)for(var n=0,o=[].slice.call(t);n<o.length;n++){var r=o[n],s=this.tbarEle.indexOf(r);this.removeItemByIndex(s,i),i=ct("."+c3,this.element)}else{r=t&&t.length&&1===t.length?t[0]:e;s=i.indexOf(r),this.removeItemByIndex(s,i)}this.resize()},q3.prototype.removeItemByIndex=function(e,t){var i,n;this.tbarEle[parseInt(e.toString(),10)]&&t[parseInt(e.toString(),10)]&&(i=this.tbarEle.indexOf(t[parseInt(e.toString(),10)]),this.tbarAlign&&(n=this.tbarAlgEle[(this.items[parseInt(i.toString(),10)].align+"s").toLowerCase()].indexOf(this.tbarEle[parseInt(i.toString(),10)]),this.tbarAlgEle[(this.items[parseInt(i.toString(),10)].align+"s").toLowerCase()].splice(parseInt(n.toString(),10),1)),this.isReact&&this.clearToolbarTemplate(t[parseInt(e.toString(),10)]),je(n=t[parseInt(e.toString(),10)].querySelector(".e-control.e-btn"))||je(n.ej2_instances[0])||n.ej2_instances[0].isDestroyed||n.ej2_instances[0].destroy(),G(t[parseInt(e.toString(),10)]),this.items.splice(i,1),this.tbarEle.splice(i,1))},q3.prototype.templateRender=function(e,t,i,n){var o=i.type,r=e;if("object"==typeof e&&(l="function"==typeof r.appendTo),"string"!=typeof e&&l)"Input"===o&&(s=this.createElement("input"),i.id?s.id=i.id:s.id=D("tbr-ipt"),t.appendChild(s),r.appendTo(s));else{var s,a,l=void 0,o=new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i),i="string"==typeof e?e.trim():e;try{"object"!=typeof e||je(e.tagName)?"string"==typeof e&&o.test(i)?t.innerHTML=i:document.querySelectorAll(i).length?(a=(s=document.querySelector(i)).outerHTML.trim(),t.appendChild(s),s.style.display="",je(a)||this.tempId.push(i)):l=oo(i):t.appendChild(e)}catch(e){l=oo(i)}r=void 0;je(l)||(r=l({},this,"template",this.element.id+n+"_template",this.isStringTemplate,void 0,void 0,this.root)),!je(r)&&0<r.length&&[].slice.call(r).forEach(function(e){je(e.tagName)||(e.style.display=""),t.appendChild(e)})}this.add(t,v3);o=t.firstElementChild;je(o)||(o.setAttribute("tabindex",je(o.getAttribute("tabIndex"))?"-1":this.getDataTabindex(o)),o.setAttribute("data-tabindex",je(o.getAttribute("tabIndex"))?"-1":this.getDataTabindex(o))),this.tbarEle.push(t)},q3.prototype.buttonRendering=function(e,t){var i,n,o=this.createElement("button",{className:"e-tbar-btn"}),r=(o.setAttribute("type","button"),e.text),s=(e.id?o.id=e.id:o.id=D("e-tbr-btn"),this.createElement("span",{className:"e-tbar-btn-text"})),r=(r?(s.innerHTML=this.enableHtmlSanitizer?go.sanitize(r):r,o.appendChild(s),o.classList.add("e-tbtn-txt")):this.add(t,"e-tbtn-align"),(e.prefixIcon||e.suffixIcon)&&(n=e.prefixIcon&&e.suffixIcon||e.prefixIcon?(i=e.prefixIcon+" e-icons","Left"):(i=e.suffixIcon+" e-icons","Right")),new zv({iconCss:i,iconPosition:n}));return r.createElement=this.createElement,r.appendTo(o),e.width&&gt(o,{width:T(e.width)}),o},q3.prototype.renderSubComponent=function(e,t){var i,n=this.createElement("div",{className:c3}),o=this.createElement("div",{innerHTML:this.enableHtmlSanitizer&&!je(e.tooltipText)?go.sanitize(e.tooltipText):e.tooltipText});if(this.tbarEle||(this.tbarEle=[]),e.htmlAttributes&&this.setAttr(e.htmlAttributes,n),e.tooltipText&&n.setAttribute("title",o.textContent),e.cssClass&&(n.className=n.className+" "+e.cssClass),e.template)this.templateRender(e.template,n,e,t);else switch(e.type){case"Button":(i=this.buttonRendering(e,n)).setAttribute("tabindex",je(e.tabIndex)?"-1":e.tabIndex.toString()),i.setAttribute("data-tabindex",je(e.tabIndex)?"-1":e.tabIndex.toString()),i.setAttribute("aria-label",e.text||e.tooltipText),i.setAttribute("aria-disabled","false"),n.appendChild(i),n.addEventListener("click",this.itemClick.bind(this));break;case"Separator":this.add(n,g3)}return e.showTextOn&&("Toolbar"===(o=e.showTextOn)?(this.add(n,w3),this.add(n,"e-tbtn-align")):"Overflow"===o&&this.add(n,C3)),e.overflow&&("Show"===(t=e.overflow)?this.add(n,S3):"Hide"!==t||n.classList.contains(g3)||this.add(n,A3)),"Show"!==e.overflow&&e.showAlwaysInPopup&&!n.classList.contains(g3)&&(this.add(n,F3),this.popupPriCount++),e.disabled&&this.add(n,b3),!1===e.visible&&this.add(n,L3),n},q3.prototype.getDataTabindex=function(e){return je(e.getAttribute("data-tabindex"))?"-1":e.getAttribute("data-tabindex")},q3.prototype.itemClick=function(e){this.activeEleSwitch(e.currentTarget)},q3.prototype.activeEleSwitch=function(e){this.activeEleRemove(e.firstElementChild),this.activeEle.focus()},q3.prototype.activeEleRemove=function(e){var t,i=this.element.querySelector("."+c3+":not(."+b3+" ):not(."+g3+" ):not(."+L3+" )");je(this.activeEle)||(this.activeEle.setAttribute("tabindex",this.getDataTabindex(this.activeEle)),i&&i.removeAttribute("tabindex"),i=this.activeEle),this.activeEle=e,"-1"===this.getDataTabindex(this.activeEle)&&(je(this.trgtEle)&&!e.parentElement.classList.contains(v3)?(!je(this.element.querySelector(".e-hor-nav"))&&this.element.querySelector(".e-hor-nav").classList.contains("e-nav-active")?(this.updateTabIndex("0"),t="-1"===this.getDataTabindex(i)?"0":this.getDataTabindex(i),i.setAttribute("tabindex",t)):this.updateTabIndex("-1"),e.removeAttribute("tabindex")):(i=parseInt(this.getDataTabindex(this.activeEle),10)+1,this.activeEle.setAttribute("tabindex",i.toString())))},q3.prototype.getPersistData=function(){return this.addOnPersist([])},q3.prototype.getModuleName=function(){return"toolbar"},q3.prototype.itemsRerender=function(e){this.items=this.tbarItemsCol,(this.isReact||this.isAngular)&&this.clearTemplate(),this.destroyMode(),this.destroyItems(),this.items=e,this.tbarItemsCol=this.items,this.renderItems(),this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},q3.prototype.resize=function(){var e,t=this.element,i=(this.tbResize=!0,this.tbarAlign&&this.itemPositioning(),this.popObj&&"Popup"===this.overflowMode&&this.popObj.hide(),this.checkOverflow(t,t.getElementsByClassName(p3)[0]));i||(this.destroyScroll(),je(e=t.querySelector("."+p3)))||(this.remove(e,O3),this.tbarAlign&&this.add(e,E3)),i&&this.scrollModule&&this.offsetWid===t.offsetWidth||((this.offsetWid>t.offsetWidth||i)&&this.renderOverflowMode(),this.popObj&&("Extended"===this.overflowMode&&(this.popObj.width=this.getToolbarPopupWidth(this.element)),this.tbarAlign&&this.removePositioning(),this.popupRefresh(this.popObj.element,!1),this.tbarAlign)&&this.refreshPositioning(),this.element.querySelector("."+D3)&&(this.scrollStep=this.element.querySelector("."+D3).offsetWidth),this.offsetWid=t.offsetWidth,this.tbResize=!1,this.separator())},q3.prototype.orientationChange=function(){var e=this;setTimeout(function(){e.resize()},500)},q3.prototype.extendedOpen=function(){var e=this.element.querySelector("."+H3);"Extended"===this.overflowMode&&e&&(this.isExtendedOpen=e.classList.contains(y3))},q3.prototype.updateHideEleTabIndex=function(e,t,i,n,o){i&&(n=o.indexOf(e));for(var r=o[++n];r;){if(!this.eleContains(r)){var s=r.firstElementChild.getAttribute("data-tabindex");t&&"-1"===s?r.firstElementChild.setAttribute("tabindex","0"):s!==r.firstElementChild.getAttribute("tabindex")&&r.firstElementChild.setAttribute("tabindex",s);break}r=o[++n]}},q3.prototype.clearToolbarTemplate=function(e){if(this.registeredTemplate&&this.registeredTemplate.template){for(var t=this.registeredTemplate,i=0;i<t.template.length;i++)if(!je(n=z(t.template[parseInt(i.toString(),10)].rootNodes[0],"."+c3))&&n===e){this.clearTemplate(["template"],[t.template[parseInt(i.toString(),10)]]);break}}else if(this.portals&&0<this.portals.length)for(var n,o=this.portals,i=0;i<o.length;i++)if(!je(n=z(o[parseInt(i.toString(),10)].containerInfo,"."+c3))&&n===e){this.clearTemplate(["template"],i);break}},q3.prototype.onPropertyChanged=function(e,t){var i=this.element;this.extendedOpen();for(var n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"items":if(e.items instanceof Array&&t.items instanceof Array)this.itemsRerender(e.items);else for(var r=Object.keys(e.items),s=0;s<r.length;s++){var a=parseInt(Object.keys(e.items)[parseInt(s.toString(),10)],10),l=Object.keys(e.items[parseInt(a.toString(),10)])[0],h=Object(e.items[parseInt(a.toString(),10)])[""+l];if(this.tbarAlign||"align"===l){this.refresh(),this.trigger("created");break}var d="overflow"===l&&0!==this.popupPriCount,l=(("showAlwaysInPopup"===l&&!h||this.items[parseInt(a.toString(),10)].showAlwaysInPopup&&d)&&--this.popupPriCount,je(this.scrollModule)&&this.destroyMode(),[].slice.call(ct("."+p3+" ."+c3,i)));this.isReact&&this.items[parseInt(a.toString(),10)].template&&this.clearToolbarTemplate(l[parseInt(a.toString(),10)]),G(l[parseInt(a.toString(),10)]),this.tbarEle.splice(a,1),this.addItems([this.items[parseInt(a.toString(),10)]],a),this.items.splice(a,1),this.items[parseInt(a.toString(),10)].template&&this.tbarEle.splice(this.items.length,1)}break;case"width":gt(i,{width:T(e.width)}),this.refreshOverflow();break;case"height":gt(this.element,{height:T(e.height)});break;case"overflowMode":this.destroyMode(),this.renderOverflowMode(),this.enableRtl&&this.add(i,u3),this.refreshOverflow();break;case"enableRtl":e.enableRtl?this.add(i,u3):this.remove(i,u3),je(this.scrollModule)||(e.enableRtl?this.add(this.scrollModule.element,u3):this.remove(this.scrollModule.element,u3)),je(this.popObj)||(e.enableRtl?this.add(this.popObj.element,u3):this.remove(this.popObj.element,u3)),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":t.cssClass&&q([this.element],t.cssClass.split(" ")),e.cssClass&&U([this.element],e.cssClass.split(" "));break;case"allowKeyboard":this.unwireKeyboardEvent(),e.allowKeyboard&&this.wireKeyboardEvent()}},q3.prototype.hideItem=function(e,t){var i,n,o="object"==typeof e,r=e;!o&&je(r)||(i=[].slice.call(ct("."+c3,this.element)),o?n=e:this.tbarEle[parseInt(r.toString(),10)]&&(n=[].slice.call(ct("."+c3,this.element))[parseInt(r.toString(),10)]),n&&(t?(n.classList.add(L3),n.classList.contains(g3)||!je(n.firstElementChild.getAttribute("tabindex"))&&"-1"===n.firstElementChild.getAttribute("tabindex")||this.updateHideEleTabIndex(n,t,o,r,i)):(n.classList.remove(L3),n.classList.contains(g3)||this.updateHideEleTabIndex(n,t,o,r,i)),this.refreshOverflow()))},h3([kt([],j3)],q3.prototype,"items",void 0),h3([e("auto")],q3.prototype,"width",void 0),h3([e("auto")],q3.prototype,"height",void 0),h3([e("")],q3.prototype,"cssClass",void 0),h3([e("Scrollable")],q3.prototype,"overflowMode",void 0),h3([e()],q3.prototype,"scrollStep",void 0),h3([e(!0)],q3.prototype,"enableCollision",void 0),h3([e(!0)],q3.prototype,"enableHtmlSanitizer",void 0),h3([e(!0)],q3.prototype,"allowKeyboard",void 0),h3([i()],q3.prototype,"clicked",void 0),h3([i()],q3.prototype,"created",void 0),h3([i()],q3.prototype,"destroyed",void 0),h3([i()],q3.prototype,"beforeCreate",void 0);var Q3,U3=h3([Bt],q3);function q3(e,t){e=Q3.call(this,e,t)||this;return e.resizeContext=e.resize.bind(e),e.orientationChangeContext=e.orientationChange.bind(e),e.keyConfigs={moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow",popupOpen:"enter",popupClose:"escape",tab:"tab",home:"home",end:"end"},e}G3=function(e,t){return(G3=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])}))(e,t)};var G3,Y3,Wz=function(e,t){function i(){this.constructor=e}G3(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},h3=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},X3="e-acrdn-root",K3="e-accordion",J3="e-acrdn-item",Z3="e-item-focus",$3="e-hide",e4="e-acrdn-header",t4="e-acrdn-header-content",i4="e-acrdn-panel",n4="e-acrdn-content",o4="e-toggle-icon",r4="e-expand-icon",s4="e-rtl",a4="e-content-hide",l4="e-select",h4="e-selected",d4="e-active",p4="e-overlay",c4="e-toggle-animation",u4="e-expand-state",g4="e-accordion-container",m4=(Wz(f4,Y3=n),h3([e("SlideDown")],f4.prototype,"effect",void 0),h3([e(400)],f4.prototype,"duration",void 0),h3([e("linear")],f4.prototype,"easing",void 0),f4);function f4(){return null!==Y3&&Y3.apply(this,arguments)||this}Wz(b4,y4=n),h3([t({effect:"SlideUp",duration:400,easing:"linear"},m4)],b4.prototype,"collapse",void 0),h3([t({effect:"SlideDown",duration:400,easing:"linear"},m4)],b4.prototype,"expand",void 0);var y4,v4=b4;function b4(){return null!==y4&&y4.apply(this,arguments)||this}Wz(S4,w4=n),h3([e(null)],S4.prototype,"content",void 0),h3([e(null)],S4.prototype,"header",void 0),h3([e(null)],S4.prototype,"cssClass",void 0),h3([e(null)],S4.prototype,"iconCss",void 0),h3([e(!1)],S4.prototype,"expanded",void 0),h3([e(!0)],S4.prototype,"visible",void 0),h3([e(!1)],S4.prototype,"disabled",void 0),h3([e()],S4.prototype,"id",void 0);var w4,C4=S4;function S4(){return null!==w4&&w4.apply(this,arguments)||this}Wz(I4,A4=Ji),I4.prototype.destroy=function(){(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate();var t=this.element;if(A4.prototype.destroy.call(this),this.unWireEvents(),this.isDestroy=!0,this.restoreContent(null),[].slice.call(t.children).forEach(function(e){t.removeChild(e)}),this.trgtEle){for(this.trgtEle=null;this.ctrlTem.firstElementChild;)t.appendChild(this.ctrlTem.firstElementChild);this.ctrlTem=null}t.classList.remove(X3),t.removeAttribute("style"),this.element.removeAttribute("data-ripple"),!this.isNested&&Gt&&this.removeRippleEffect()},I4.prototype.preRender=function(){var e=z(this.element,"."+i4);this.isNested=!1,this.templateEle=[],this.isDestroy||(this.isDestroy=!1),e&&e.firstElementChild&&e.firstElementChild.firstElementChild?e.firstElementChild.firstElementChild.classList.contains(K3)&&(e.classList.add("e-nested"),this.isNested=!0):this.element.classList.add(X3),this.enableRtl&&this.add(this.element,s4)},I4.prototype.add=function(e,t){e.classList.add(t)},I4.prototype.remove=function(e,t){e.classList.remove(t)},I4.prototype.render=function(){this.initializeHeaderTemplate(),this.initializeItemTemplate(),this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},I4.prototype.initialize=function(){var e=T(this.width),t=T(this.height);gt(this.element,{width:e,height:t}),je(this.initExpand)&&(this.initExpand=[]),!je(this.expandedIndices)&&0<this.expandedIndices.length&&(this.initExpand=this.expandedIndices)},I4.prototype.renderControl=function(){this.trgtEle=0<this.element.children.length?ge("div",this.element):null,this.renderItems(),this.initItemExpand()},I4.prototype.wireFocusEvents=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+J3));e<t.length;e++){var i=t[e],n=i.querySelector("."+e4);0<i.childElementCount&&n&&(E.clearEvents(n),E.add(n,"focus",this.focusIn,this),E.add(n,"blur",this.focusOut,this))}},I4.prototype.unWireEvents=function(){E.remove(this.element,"click",this.clickHandler),je(this.keyModule)||this.keyModule.destroy()},I4.prototype.wireEvents=function(){E.add(this.element,"click",this.clickHandler,this),this.isNested||this.isDestroy||(this.removeRippleEffect=Ht(this.element,{selector:"."+e4})),this.isNested||(this.keyModule=new bn(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}))},I4.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){return oo(t)}},I4.prototype.initializeHeaderTemplate=function(){this.headerTemplate&&(this.headerTemplateFn=this.templateParser(this.headerTemplate))},I4.prototype.initializeItemTemplate=function(){this.itemTemplate&&(this.itemTemplateFn=this.templateParser(this.itemTemplate))},I4.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},I4.prototype.getItemTemplate=function(){return this.itemTemplateFn},I4.prototype.focusIn=function(e){e.target.parentElement.classList.add(Z3)},I4.prototype.focusOut=function(e){e.target.parentElement.classList.remove(Z3)},I4.prototype.ctrlTemplate=function(){this.ctrlTem=this.element.cloneNode(!0);var e=ge("."+g4,this.element),t=(e||this.element).children,i=[];[].slice.call(t).forEach(function(e){i.push({header:0<e.childElementCount&&e.children[0]?e.children[0]:"",content:1<e.childElementCount&&e.children[1]?e.children[1]:""}),e.parentNode.removeChild(e)}),e&&this.element.removeChild(e),this.setProperties({items:i},!0)},I4.prototype.toggleIconGenerate=function(){var e=this.createElement("div",{className:o4}),t=this.createElement("span",{className:"e-tgl-collapse-icon e-icons"});return e.appendChild(t),e},I4.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[parseInt(t.toString(),10)]);this.isReact&&this.renderReactTemplates()}},I4.prototype.renderItems=function(){var i,n,e,o=this,r=this.element;je(this.trgtEle)||this.ctrlTemplate(),!je(this.dataSource)&&0<this.dataSource.length?this.dataSource.forEach(function(e,t){n=o.renderInnerItem(e,t),r.appendChild(n),0<n.childElementCount&&(E.add(n.querySelector("."+e4),"focus",o.focusIn,o),E.add(n.querySelector("."+e4),"blur",o.focusOut,o))}):(e=this.items,r&&0<e.length&&e.forEach(function(e,t){i=o.renderInnerItem(e,t),r.appendChild(i),0<i.childElementCount&&(E.add(i.querySelector("."+e4),"focus",o.focusIn,o),E.add(i.querySelector("."+e4),"blur",o.focusOut,o))})),this.isReact&&this.renderReactTemplates()},I4.prototype.clickHandler=function(e){var t,i,n,o,r,s,a=e.target,l=this.getItems(),h={};z(a,"."+K3)===this.element&&(a.classList.add("e-target"),i=z(a,"."+J3),n=z(a,"."+e4),o=z(a,"."+i4),i&&(je(n)||je(o))&&(n=i.children[0],o=i.children[1]),n&&(t=ge("."+o4,n)),n?r=z(n,"."+J3):o&&(r=z(o,"."+J3)),s=this.getIndexByItem(i),r&&(h.item=l[this.getIndexByItem(r)]),h.originalEvent=e,!je(t)&&i.childElementCount<=1&&(je(o)||!je(ge("."+e4+" ."+o4,r)))&&(i.appendChild(this.contentRendering(s)),this.ariaAttrUpdate(i)),this.afterContentRender(a,h,i,n,o,r),this.isReact)&&this.renderReactTemplates()},I4.prototype.afterContentRender=function(a,e,l,h,d,p){var c=this,u=[];this.trigger("clicked",e,function(e){if(!e.cancel){var e=d&&!je(ge(".e-target",d)),t=d&&!je(ge("."+K3,d))&&je(z(a,".e-acrdn-panel .e-accordion")),i=d&&je(ge("."+K3,d))||!(z(a,"."+K3)===c.element),e=e&&(t||i);if(a.classList.remove("e-target"),!(a.classList.contains(i4)||a.classList.contains(n4)||e)){t=c.element.querySelector("."+g4),i=(t||c.element).children,e=([].slice.call(i).forEach(function(e){e.classList.contains(d4)&&u.push(e)}),[].slice.call(c.element.querySelectorAll("."+J3+" [e-animate]")));if(0<e.length)for(var n=0,o=e;n<o.length;n++){var r=o[n];u.push(r.parentElement)}var s,t=-1!==u.indexOf(p)&&"true"===d.getAttribute("e-animate");je(l)||je(h)||(i=ge("."+i4,l),e=z(l,"."+X3).querySelector("."+u4),je(i))||(s=e===l,!at(i)||t&&!p.classList.contains(h4)?(0<u.length&&"Single"===c.expandMode&&!t&&u.forEach(function(e){c.collapse(ge("."+i4,e)),e.classList.remove(u4)}),c.expand(i)):c.collapse(i),je(e))||s||e.classList.remove(u4)}}})},I4.prototype.eleMoveFocus=function(e,t,i){var n,o=z(i,"."+J3);i===t?n=("moveUp"===e?i.lastElementChild:i).querySelector("."+e4):i.classList.contains(e4)&&(o="moveUp"===e?o.previousElementSibling:o.nextElementSibling)&&(n=ge("."+e4,o)),n&&n.focus()},I4.prototype.keyActionHandler=function(e){var t=e.target;if(!je(z(e.target,e4))||t.classList.contains(K3)||t.classList.contains(e4)){var i,n=this.element;switch(e.action){case"moveUp":case"moveDown":this.eleMoveFocus(e.action,n,t);break;case"space":case"enter":(je(i=t.nextElementSibling)||!i.classList.contains(i4)||"true"!==i.getAttribute("e-animate"))&&t.click(),e.preventDefault();break;case"home":case"end":("home"===e.action?n.firstElementChild:n.lastElementChild).children[0].focus(),e.preventDefault()}}},I4.prototype.headerEleGenerate=function(){var e=this.createElement("div",{className:e4,id:D("acrdn_header")});return pt(e,{tabindex:"0",role:"button","aria-disabled":"false","aria-expanded":"false"}),e},I4.prototype.renderInnerItem=function(e,t){var i,n,o,r=this.createElement("div",{className:J3,id:e.id||D("acrdn_item")});return this.headerTemplate?(o=this.headerEleGenerate(),i=this.createElement("div",{className:t4}),o.appendChild(i),ht(this.getHeaderTemplate()(e,this,"headerTemplate",this.element.id+"_headerTemplate",!1),i),r.appendChild(o),o.appendChild(this.toggleIconGenerate()),this.add(r,l4)):(i=(e.header&&this.angularnativeCondiCheck(e,"header")&&(n=e.header,this.enableHtmlSanitizer&&"string"==typeof e.header&&(n=go.sanitize(e.header)),o=this.headerEleGenerate(),i=this.createElement("div",{className:t4}),o.appendChild(i),o.appendChild(this.fetchElement(i,n,t)),r.appendChild(o)),ge("."+e4,r)),!e.expanded||je(t)||this.enablePersistence||-1===this.initExpand.indexOf(t)&&this.initExpand.push(t),e.cssClass&&U([r],e.cssClass.split(" ")),e.disabled&&U([r],p4),!1===e.visible&&U([r],$3),e.iconCss&&(n=this.createElement("div",{className:"e-acrdn-header-icon"}),o=this.createElement("span",{className:e.iconCss+" e-icons"}),n.appendChild(o),je(i)?((i=this.headerEleGenerate()).appendChild(n),r.appendChild(i)):i.insertBefore(n,i.childNodes[0])),e.content&&this.angularnativeCondiCheck(e,"content")&&(t=this.toggleIconGenerate(),je(i)&&(i=this.headerEleGenerate(),r.appendChild(i)),i.appendChild(t),this.add(r,l4))),r},I4.prototype.angularnativeCondiCheck=function(e,t){t="content"===t?e.content:e.header;return!(this.isAngular&&!je(t.elementRef)&&!je(e=t.elementRef.nativeElement.data)&&""!==e&&-1!==e.indexOf("bindings=")&&!je(e=JSON.parse(t.elementRef.nativeElement.data.replace("bindings=","")))&&"false"===e["ng-reflect-ng-if"])},I4.prototype.fetchElement=function(t,i,e){var n,o,r,s;try{document.querySelectorAll(i).length&&"Button"!==i?(o=(r=document.querySelector(i)).outerHTML.trim(),t.appendChild(r),r.style.display=""):n=oo(i)}catch(e){"string"==typeof i?t.innerHTML=this.enableHtmlSanitizer?go.sanitize(i):i:i instanceof HTMLElement?(t.appendChild(i),this.trgtEle&&(t.firstElementChild.style.display="")):n=oo(i)}return je(n)||(this.isReact&&this.renderReactTemplates(),s=r=void 0,t.classList.contains(t4)?(r=this.element.id+e+"_header",s="header"):t.classList.contains(n4)&&(r=this.element.id+e+"_content",s="content"),s=n({},this,s,r,this.isStringTemplate)),je(s)||!(0<s.length)||je(s[0].tagName)&&1===s.length?0===t.childElementCount&&(t.innerHTML=this.enableHtmlSanitizer?go.sanitize(i):i):[].slice.call(s).forEach(function(e){je(e.tagName)||(e.style.display=""),t.appendChild(e)}),je(o)||-1===this.templateEle.indexOf(i)&&this.templateEle.push(i),t},I4.prototype.ariaAttrUpdate=function(e){var t=ge("."+e4,e),e=ge("."+i4,e);t.setAttribute("aria-controls",e.id),e.setAttribute("aria-labelledby",t.id),e.setAttribute("role","region")},I4.prototype.contentRendering=function(e){var t,i=this.createElement("div",{className:i4+" "+a4,id:D("acrdn_panel")}),n=(pt(i,{"aria-hidden":"true"}),this.createElement("div",{className:n4}));return!je(this.dataSource)&&0<this.dataSource.length?(this.isReact&&this.renderReactTemplates(),ht(this.getItemTemplate()(this.dataSource[parseInt(e.toString(),10)],this,"itemTemplate",this.element.id+"_itemTemplate",!1),n),i.appendChild(n)):(t=this.items[parseInt(e.toString(),10)].content,this.enableHtmlSanitizer&&"string"==typeof t&&(t=go.sanitize(t)),i.appendChild(this.fetchElement(n,t,e))),i},I4.prototype.expand=function(t){var i,n,o,r=this,e=this.getItems(),s=z(t,"."+J3);je(t)||at(t)&&"true"!==t.getAttribute("e-animate")||s.classList.contains(p4)||(i=z(s,"."+X3).querySelector("."+u4),n={name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing},o=ge("."+o4,s).firstElementChild,e={element:s,item:e[this.getIndexByItem(s)],index:this.getIndexByItem(s),content:s.querySelector("."+i4),isExpanded:!0},this.trigger("expanding",e,function(e){e.cancel||(o.classList.add(c4),r.expandedItemsPush(s),je(i)||i.classList.remove(u4),s.classList.add(u4),"None"===n.name&&"Enable"!==Ut||"Disable"===Ut?(r.expandProgress("begin",o,t,s,e),r.expandProgress("end",o,t,s,e)):r.expandAnimation(n.name,o,t,s,n,e))}))},I4.prototype.expandAnimation=function(e,t,i,n,o,r){var s,a=this;"None"===e&&"Enable"===Ut&&(o.name=e="SlideDown"),this.lastActiveItemId=n.id,"SlideDown"===e?(o.begin=function(){a.expandProgress("begin",t,i,n,r),i.style.position="absolute",s=n.offsetHeight,i.style.maxHeight=i.offsetHeight+"px",n.style.maxHeight=""},o.progress=function(){n.style.minHeight=s+i.offsetHeight+"px"},o.end=function(){gt(i,{position:"",maxHeight:""}),n.style.minHeight="",a.expandProgress("end",t,i,n,r)}):(o.begin=function(){a.expandProgress("begin",t,i,n,r)},o.end=function(){a.expandProgress("end",t,i,n,r)}),new Vt(o).animate(i)},I4.prototype.expandProgress=function(e,t,i,n,o){this.remove(i,a4),this.add(n,h4),this.add(t,r4),"end"===e&&(this.add(n,d4),i.setAttribute("aria-hidden","false"),pt(i.previousElementSibling,{"aria-expanded":"true"}),t.classList.remove(c4),this.trigger("expanded",o))},I4.prototype.expandedItemsPush=function(e){var t,e=this.getIndexByItem(e);-1===this.expandedIndices.indexOf(e)&&((t=[].slice.call(this.expandedIndices)).push(e),this.setProperties({expandedIndices:t},!0))},I4.prototype.getIndexByItem=function(e){var t=this.getItemElements();return[].slice.call(t).indexOf(e)},I4.prototype.getItemElements=function(){var t=[],e=this.element.children;return[].slice.call(e).forEach(function(e){e.classList.contains(J3)&&t.push(e)}),t},I4.prototype.expandedItemsPop=function(e){var e=this.getIndexByItem(e),t=[].slice.call(this.expandedIndices);t.splice(t.indexOf(e),1),this.setProperties({expandedIndices:t},!0)},I4.prototype.collapse=function(t){var i,n,o,e,r=this;je(t)||(e=this.getItems(),i=z(t,"."+J3),at(t)&&!i.classList.contains(p4)&&(n={name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing},o=ge("."+o4,i).firstElementChild,e={element:i,item:e[this.getIndexByItem(i)],index:this.getIndexByItem(i),content:i.querySelector("."+i4),isExpanded:!1},this.trigger("expanding",e,function(e){e.cancel||(r.expandedItemsPop(i),i.classList.remove(u4),o.classList.add(c4),"None"===n.name&&"Enable"!==Ut||"Disable"===Ut?(r.collapseProgress("begin",o,t,i,e),r.collapseProgress("end",o,t,i,e)):r.collapseAnimation(n.name,t,i,o,n,e))})))},I4.prototype.collapseAnimation=function(e,t,i,n,o,r){var s,a,l,h,d=this;"None"===e&&"Enable"===Ut&&(o.name=e="SlideUp"),this.lastActiveItemId=i.id,"SlideUp"===e?(o.begin=function(){l=i.offsetHeight,i.style.minHeight=l+"px",t.style.position="absolute",s=i.offsetHeight,a=t.offsetHeight,t.style.maxHeight=a+"px",d.collapseProgress("begin",n,t,i,r)},o.progress=function(){(h=s-(a-t.offsetHeight))<l&&(i.style.minHeight=h+"px")},o.end=function(){t.style.display="none",d.collapseProgress("end",n,t,i,r),i.style.minHeight="",gt(t,{position:"",maxHeight:"",display:""})}):(o.begin=function(){d.collapseProgress("begin",n,t,i,r)},o.end=function(){d.collapseProgress("end",n,t,i,r)}),new Vt(o).animate(t)},I4.prototype.collapseProgress=function(e,t,i,n,o){this.remove(t,r4),this.remove(n,h4),"end"===e&&(this.add(i,a4),t.classList.remove(c4),this.remove(n,d4),i.setAttribute("aria-hidden","true"),pt(i.previousElementSibling,{"aria-expanded":"false"}),this.trigger("expanded",o))},I4.prototype.getModuleName=function(){return"accordion"},I4.prototype.getItems=function(){var e=this.itemTemplate&&this.headerTemplate?this.dataSource:this.items;return e},I4.prototype.addItem=function(e,n){var o=this,r=this.element,s=this.getItemElements(),a=this.getItems();je(n)&&(n=a.length),r.childElementCount>=n&&(e instanceof Array?e:[e]).forEach(function(e,t){var t=n+t,i=(a.splice(t,0,e),o.renderInnerItem(e,t));r.childElementCount===t?r.appendChild(i):r.insertBefore(i,s[parseInt(t.toString(),10)]),E.add(i.querySelector("."+e4),"focus",o.focusIn,o),E.add(i.querySelector("."+e4),"blur",o.focusOut,o),o.expandedIndices=[],o.expandedItemRefresh(),e&&e.expanded&&o.expandItem(!0,t)}),this.isReact&&this.renderReactTemplates()},I4.prototype.expandedItemRefresh=function(){var t=this,e=this.getItemElements();[].slice.call(e).forEach(function(e){e.classList.contains(h4)&&t.expandedItemsPush(e)})},I4.prototype.removeItem=function(e){(this.isReact||this.isAngular)&&(i=ct("."+J3,this.element)[parseInt(e.toString(),10)],t=ge("."+t4,i),i=ge("."+n4,i),this.clearAccordionTemplate(t,0<this.dataSource.length?"headerTemplate":"header",t4),this.clearAccordionTemplate(i,0<this.dataSource.length?"itemTemplate":"content",n4));var t=this.getItemElements()[parseInt(e.toString(),10)],i=this.getItems();je(t)||(this.restoreContent(e),G(t),i.splice(e,1),this.expandedIndices=[],this.expandedItemRefresh())},I4.prototype.select=function(e){e=this.getItemElements()[parseInt(e.toString(),10)];je(e)||je(ge("."+e4,e))||e.children[0].focus()},I4.prototype.hideItem=function(e,t){e=this.getItemElements()[parseInt(e.toString(),10)];je(e)||((t=je(t)?!0:t)?this.add(e,$3):this.remove(e,$3))},I4.prototype.enableItem=function(e,t){var i,n=this.getItemElements()[parseInt(e.toString(),10)];je(n)||(i=n.firstElementChild,t?(this.remove(n,p4),pt(i,{tabindex:"0","aria-disabled":"false"}),i.focus()):(n.classList.contains(d4)&&(this.expandItem(!1,e),this.eleMoveFocus("movedown",this.element,i)),this.add(n,p4),i.setAttribute("aria-disabled","true"),i.removeAttribute("tabindex")))},I4.prototype.expandItem=function(t,e){var i,n,o,r=this,s=this.getItemElements();je(e)?"Single"===this.expandMode&&t?(o=s[s.length-1],this.itemExpand(t,o,this.getIndexByItem(o))):(i=ge("#"+this.lastActiveItemId,this.element),[].slice.call(s).forEach(function(e){r.itemExpand(t,e,r.getIndexByItem(e)),e.classList.remove(u4)}),(n=ge("."+u4,this.element))&&n.classList.remove(u4),i&&i.classList.add(u4)):je(o=s[parseInt(e.toString(),10)])||!o.classList.contains(l4)||o.classList.contains(d4)&&t||("Single"===this.expandMode&&this.expandItem(!1),this.itemExpand(t,o,e))},I4.prototype.itemExpand=function(e,t,i){var n=t.children[1];t.classList.contains(p4)||(je(n)&&e?(n=this.contentRendering(i),t.appendChild(n),this.ariaAttrUpdate(t),this.expand(n)):je(n)||(e?this.expand(n):this.collapse(n)),this.isReact&&this.renderReactTemplates())},I4.prototype.destroyItems=function(){this.restoreContent(null),(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(),[].slice.call(this.element.querySelectorAll("."+J3)).forEach(function(e){G(e)})},I4.prototype.restoreContent=function(e){var t=je(e)?this.element:this.element.querySelectorAll("."+J3)[parseInt(e.toString(),10)];this.templateEle.forEach(function(e){je(t.querySelector(e))||(document.body.appendChild(t.querySelector(e)).style.display="none")})},I4.prototype.updateItem=function(e,t){var i,n,o;je(e)||(i=(n=this.getItems())[parseInt(t.toString(),10)],n.splice(t,1),this.restoreContent(t),n=ge("."+t4,e),o=ge("."+n4,e),(this.isReact||this.isAngular)&&(this.clearAccordionTemplate(n,"header",t4),this.clearAccordionTemplate(o,"content",n4)),G(e),this.addItem(i,t))},I4.prototype.setTemplate=function(e,t,i){this.fetchElement(t,e,i),this.isReact&&this.renderReactTemplates()},I4.prototype.clearAccordionTemplate=function(e,t,i){if(this.registeredTemplate&&this.registeredTemplate[""+t])for(var n=this.registeredTemplate,o=0;o<n[""+t].length;o++){var r=n[""+t][parseInt(o.toString(),10)].rootNodes[0];if(!je(s=z(r,"."+i))&&s===e||je(r.parentNode)){this.clearTemplate([t],[n[""+t][parseInt(o.toString(),10)]]);break}}else if(this.portals&&0<this.portals.length)for(var s,a=this.portals,o=0;o<a.length;o++)if(!je(s=z(a[parseInt(o.toString(),10)].containerInfo,"."+i))&&s===e){this.clearTemplate([t],o);break}},I4.prototype.getPersistData=function(){return this.addOnPersist(["expandedIndices"])},I4.prototype.onPropertyChanged=function(e,t){for(var i=this.element,n=!1,o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"items":if(e.items instanceof Array&&t.items instanceof Array)n=!0;else for(var s=Object.keys(e.items),a=0;a<s.length;a++)for(var l=parseInt(Object.keys(e.items)[parseInt(a.toString(),10)],10),h=Object.keys(e.items[parseInt(l.toString(),10)]),d=0;d<h.length;d++){var p=ct("."+J3,this.element)[parseInt(l.toString(),10)],c=Object(t.items[parseInt(l.toString(),10)])[""+h[parseInt(d.toString(),10)]],u=Object(e.items[parseInt(l.toString(),10)])[""+h[parseInt(d.toString(),10)]],g=h[parseInt(d.toString(),10)],m=ge("."+n4,p);("header"===g||"iconCss"===g||"expanded"===g||"content"===g&&""===c)&&this.updateItem(p,l),"cssClass"!==h[parseInt(d.toString(),10)]||je(p)||(c&&q([p],c.split(" ")),u&&U([p],u.split(" "))),"visible"!==h[parseInt(d.toString(),10)]||je(p)||(!1===Object(e.items[parseInt(l.toString(),10)])[""+h[parseInt(d.toString(),10)]]?p.classList.add($3):p.classList.remove($3)),"disabled"!==h[parseInt(d.toString(),10)]||je(p)||this.enableItem(l,!u),h.indexOf("header")<0&&"content"===h[parseInt(d.toString(),10)]&&!je(p)&&2===p.children.length&&("function"==typeof u?((this.isAngular||this.isReact)&&this.clearAccordionTemplate(m,h[parseInt(d.toString(),10)],n4),(g=p.querySelector("."+n4)).innerHTML="",this.setTemplate(u,g,l)):(p.classList.contains(h4)&&this.expandItem(!1,l),G(p.querySelector("."+i4))))}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(i,s4):this.remove(i,s4);break;case"height":gt(this.element,{height:T(e.height)});break;case"width":gt(this.element,{width:T(e.width)});break;case"expandMode":"Single"===e.expandMode&&!je(this.expandedIndices)&&1<this.expandedIndices.length&&this.expandItem(!1)}n&&(this.initExpand=[],!je(this.expandedIndices)&&0<this.expandedIndices.length&&(this.initExpand=this.expandedIndices),this.destroyItems(),this.renderItems(),this.initItemExpand())},h3([kt([],C4)],I4.prototype,"items",void 0),h3([e([])],I4.prototype,"dataSource",void 0),h3([e()],I4.prototype,"itemTemplate",void 0),h3([e()],I4.prototype,"headerTemplate",void 0),h3([e("100%")],I4.prototype,"width",void 0),h3([e("auto")],I4.prototype,"height",void 0),h3([e([])],I4.prototype,"expandedIndices",void 0),h3([e("Multiple")],I4.prototype,"expandMode",void 0),h3([e(!0)],I4.prototype,"enableHtmlSanitizer",void 0),h3([t({},v4)],I4.prototype,"animation",void 0),h3([i()],I4.prototype,"clicked",void 0),h3([i()],I4.prototype,"expanding",void 0),h3([i()],I4.prototype,"expanded",void 0),h3([i()],I4.prototype,"created",void 0),h3([i()],I4.prototype,"destroyed",void 0);var A4,x4=h3([Bt],I4);function I4(e,t){e=A4.call(this,e,t)||this;return e.keyConfigs={moveUp:"uparrow",moveDown:"downarrow",enter:"enter",space:"space",home:"home",end:"end"},e}T4=function(e,t){return(T4=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])}))(e,t)};var T4,E4,Wz=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},D4=(function(e,t){function i(){this.constructor=e}T4(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(M4,E4=wH),M4.prototype.preRender=function(){this.isMenu=!1,this.element.id=this.element.id||D("ej2-contextmenu"),E4.prototype.preRender.call(this)},M4.prototype.initialize=function(){this.template=this.itemTemplate||null,E4.prototype.initialize.call(this),pt(this.element,{role:"menubar",tabindex:"0"}),this.element.style.zIndex=Iv(this.element).toString()},M4.prototype.open=function(e,t,i){E4.prototype.openMenu.call(this,null,null,e,t,null,i)},M4.prototype.close=function(){E4.prototype.closeMenu.call(this)},M4.prototype.onPropertyChanged=function(e,t){E4.prototype.onPropertyChanged.call(this,e,t);for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"filter":this.close(),this.filter=e.filter;break;case"target":this.unWireEvents(t.target),this.wireEvents();break;case"itemTemplate":this.itemTemplate=e.itemTemplate,this.refresh()}},M4.prototype.getModuleName=function(){return"contextmenu"},Wz([e("")],M4.prototype,"target",void 0),Wz([e("")],M4.prototype,"filter",void 0),Wz([kt([],e3)],M4.prototype,"items",void 0),Wz([e(null)],M4.prototype,"itemTemplate",void 0),Wz([e(!1)],M4.prototype,"enableScrolling",void 0),Wz([Bt],M4));function M4(e,t){return E4.call(this,e,t)||this}k4=function(e,t){return(k4=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])}))(e,t)};var k4,P4,h3=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},B4="e-vertical",F4="e-hamburger",L4=(function(e,t){function i(){this.constructor=e}k4(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(R4,P4=wH),R4.prototype.getModuleName=function(){return"menu"},R4.prototype.preRender=function(){if(this.isMenu=!0,this.element.id=this.element.id||D("ej2-menu"),this.template)try{"function"!=typeof this.template&&document.querySelectorAll(this.template).length&&(this.template=document.querySelector(this.template).innerHTML.trim(),this.clearChanges())}catch(e){}this.updateMenuItems(this.items),P4.prototype.preRender.call(this)},R4.prototype.initialize=function(){P4.prototype.initialize.call(this),pt(this.element,{role:"menubar",tabindex:"0"}),"Vertical"===this.orientation?(this.element.classList.add(B4),this.hamburgerMode&&!this.target&&this.element.previousElementSibling.classList.add(B4),this.element.setAttribute("aria-orientation","vertical")):F.isDevice&&!this.enableScrolling&&this.element.parentElement.classList.add("e-scrollable"),this.hamburgerMode&&(this.element.parentElement.classList.add(F4),"Horizontal"===this.orientation)&&this.element.classList.add("e-hide-menu")},R4.prototype.updateMenuItems=function(e){this.tempItems=e,this.items=[],this.tempItems.map(this.createMenuItems,this),this.setProperties({items:this.items},!0),this.tempItems=[]},R4.prototype.onPropertyChanged=function(e,t){for(var i=this,n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"orientation":"Vertical"===e.orientation?(this.element.classList.add(B4),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.add(B4),this.element.classList.remove("e-hide-menu")),this.element.setAttribute("aria-orientation","vertical")):(this.element.classList.remove(B4),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.remove(B4),this.element.classList.add("e-hide-menu")),this.element.removeAttribute("aria-orientation"));break;case"items":Object.keys(t.items).length||this.updateMenuItems(e.items);break;case"hamburgerMode":this.element.previousElementSibling||P4.prototype.createHeaderContainer.call(this),e.hamburgerMode?(this.element.parentElement.classList.add(F4),[].slice.call(this.element.getElementsByClassName("e-blankicon")).forEach(function(e){e.style[i.enableRtl?"paddingRight":"paddingLeft"]=""})):(this.element.parentElement.classList.remove(F4),"Vertical"===this.orientation&&this.setBlankIconStyle(this.element)),"Vertical"===this.orientation?(this.target||this.element.previousElementSibling.classList.add(B4),this.element.classList.remove("e-hide-menu")):(this.target?this.element.previousElementSibling.classList.add(B4):this.element.previousElementSibling.classList.remove(B4),this.element.classList[e.hamburgerMode?"add":"remove"]("e-hide-menu"));break;case"title":this.hamburgerMode&&this.element.previousElementSibling&&(e.title=this.enableHtmlSanitizer?go.sanitize(e.title):e.title,this.element.previousElementSibling.querySelector(".e-menu-title").innerHTML=e.title);break;case"target":this.hamburgerMode&&(this.unWireEvents(t.target),this.wireEvents(),"Horizontal"===this.orientation)&&(e.target?this.element.previousElementSibling.classList.add(B4):(this.element.previousElementSibling||P4.prototype.createHeaderContainer.call(this),this.element.previousElementSibling.classList.remove(B4)),this.element.classList.add("e-hide-menu"));break;case"template":this.template=e.template,this.refresh()}P4.prototype.onPropertyChanged.call(this,e,t)},R4.prototype.createMenuItems=function(e){var t,i,n=this.items,o=this.getField("parentId");if(e[""+o]){for(t=this.getIndex(e[""+o].toString(),!0),i=0;i<t.length;i++)n[t[i]].items||(n[t[i]].items=[]),n=n[t[i]].items;n.push(e)}else this.items.push(e)},R4.prototype.open=function(){P4.prototype.openHamburgerMenu.call(this)},R4.prototype.close=function(){P4.prototype.closeHamburgerMenu.call(this)},h3([e("Horizontal")],R4.prototype,"orientation",void 0),h3([e("")],R4.prototype,"target",void 0),h3([e(null)],R4.prototype,"template",void 0),h3([e(!1)],R4.prototype,"enableScrolling",void 0),h3([e(!1)],R4.prototype,"hamburgerMode",void 0),h3([e("Menu")],R4.prototype,"title",void 0),h3([e(!0)],R4.prototype,"enableHtmlSanitizer",void 0),h3([t({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},Jj)],R4.prototype,"fields",void 0),h3([Bt],R4));function R4(e,t){e=P4.call(this,e,t)||this;return e.tempItems=[],e}O4=function(e,t){return(O4=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])}))(e,t)};var O4,N4,Wz=function(e,t){function i(){this.constructor=e}O4(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},wH=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},V4="e-tab",_4="e-tab-header",H4="e-content",z4="e-nested",j4="e-item",W4="e-template",Q4="e-rtl",U4="e-active",q4="e-disable",G4="e-hidden",Y4="e-focused",X4="e-icons",K4="e-icon",J4="e-icon-tab",Z4="e-close-icon",$4="e-close-show",e5="e-tab-text",t5="e-indicator",i5="e-tab-wrap",n5="e-text-wrap",o5="e-tab-icon",r5="e-toolbar-items",s5="e-toolbar-item",a5="e-toolbar-pop",l5="e-toolbar-popup",h5="e-progress",d5="e-overlay",p5="e-vertical-tab",c5="e-vertical",u5="e-vertical-left",g5="e-vertical-right",m5="e-horizontal-bottom",f5="e-fill-mode",y5="tabitem_",v5="e-reorder-active-item",h3=(Wz(b5,N4=n),wH([e("SlideLeftIn")],b5.prototype,"effect",void 0),wH([e(600)],b5.prototype,"duration",void 0),wH([e("ease")],b5.prototype,"easing",void 0),b5);function b5(){return null!==N4&&N4.apply(this,arguments)||this}Wz(S5,w5=n),wH([t({effect:"SlideLeftIn",duration:600,easing:"ease"},h3)],S5.prototype,"previous",void 0),wH([t({effect:"SlideRightIn",duration:600,easing:"ease"},h3)],S5.prototype,"next",void 0);var w5,C5=S5;function S5(){return null!==w5&&w5.apply(this,arguments)||this}Wz(I5,A5=n),wH([e("")],I5.prototype,"text",void 0),wH([e("")],I5.prototype,"iconCss",void 0),wH([e("left")],I5.prototype,"iconPosition",void 0);var A5,x5=I5;function I5(){return null!==A5&&A5.apply(this,arguments)||this}Wz(D5,T5=n),wH([t({},x5)],D5.prototype,"header",void 0),wH([e(null)],D5.prototype,"headerTemplate",void 0),wH([e("")],D5.prototype,"content",void 0),wH([e("")],D5.prototype,"cssClass",void 0),wH([e(!1)],D5.prototype,"disabled",void 0),wH([e(!0)],D5.prototype,"visible",void 0),wH([e()],D5.prototype,"id",void 0),wH([e(-1)],D5.prototype,"tabIndex",void 0);var T5,E5=D5;function D5(){return null!==T5&&T5.apply(this,arguments)||this}Wz(P5,M5=Ji),P5.prototype.destroy=function(){if((this.isReact||this.isAngular)&&this.clearTemplate(),je(this.tbObj)||(this.tbObj.destroy(),this.tbObj=null),this.unWireEvents(),this.element.removeAttribute("aria-disabled"),this.expTemplateContent(),this.isTemplate){var e=ge(".e-tab > ."+H4,this.element);this.element.classList.remove(W4),je(e)||(e.innerHTML=this.cnt)}else for(;this.element.firstElementChild;)ue(this.element.firstElementChild);if(this.btnCls&&(this.btnCls=null),this.hdrEle=null,this.cntEle=null,this.tbItems=null,this.tbItem=null,this.tbPop=null,this.prevItem=null,this.popEle=null,this.bdrLine=null,this.content=null,this.dragItem=null,this.cloneElement=null,this.draggingItems=[],this.draggableItems&&0<this.draggableItems.length){for(var t=0;t<this.draggableItems.length;t++)this.draggableItems[t].destroy(),this.draggableItems[t]=null;this.draggableItems=[]}M5.prototype.destroy.call(this),this.trigger("destroyed")},P5.prototype.refresh=function(){this.isReact&&this.clearTemplate(),M5.prototype.refresh.call(this),this.isReact&&this.renderReactTemplates()},P5.prototype.refreshOverflow=function(){je(this.tbObj)||this.tbObj.refreshOverflow()},P5.prototype.preRender=function(){var e=z(this.element,"."+H4),e=(this.prevIndex=0,this.isNested=!1,this.isPopup=!1,this.initRender=!0,this.isSwiped=!1,this.itemIndexArray=[],this.templateEle=[],this.allowDragAndDrop&&(this.dragArea=je(this.dragArea)?"#"+this.element.id+" ."+_4:this.dragArea),je(e)||(e.parentElement.classList.add(z4),this.isNested=!0),F.info.name),e="msie"===e?"e-ie":"edge"===e?"e-edge":"safari"===e?"e-safari":"";gt(this.element,{width:T(this.width),height:T(this.height)}),this.setCssClass(this.element,this.cssClass,!0),pt(this.element,{"aria-disabled":"false"}),this.setCssClass(this.element,e,!0),this.updatePopAnimationConfig()},P5.prototype.render=function(){var e=this;this.btnCls=this.createElement("span",{className:X4+" "+Z4,attrs:{title:this.title}}),this.tabId=0<this.element.id.length?"-"+this.element.id:no(),this.renderContainer(),this.wireEvents(),this.initRender=!1,this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){e.refreshOverflow(),e.refreshActiveBorder()})},P5.prototype.renderContainer=function(){var e=this.element;this.items.forEach(function(e,t){je(e.id)&&!je(e.setProperties)&&e.setProperties({id:y5+t.toString()},!0)}),0<this.items.length&&0===e.children.length?(e.appendChild(this.createElement("div",{className:H4})),this.setOrientation(this.headerPlacement,this.createElement("div",{className:_4})),this.isTemplate=!1):0<this.element.children.length&&(this.isTemplate=!0,e.classList.add(W4),e=e.querySelector("."+_4))&&"Bottom"===this.headerPlacement&&this.setOrientation(this.headerPlacement,e),je(ge("."+_4,this.element))||je(ge("."+H4,this.element))||(this.renderHeader(),this.tbItems=ge("."+_4+" ."+r5,this.element),je(this.tbItems)||Ht(this.tbItems,{selector:".e-tab-wrap"}),this.renderContent(),0<ct("."+s5,this.element).length&&(this.tbItems=ge("."+_4+" ."+r5,this.element),this.bdrLine=this.createElement("div",{className:t5+" "+G4+" e-ignore"}),je(e=ge("."+this.scrCntClass,this.tbItems))?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstChild):e.insertBefore(this.bdrLine,e.firstChild),this.setContentHeight(!0),this.select(this.selectedItem)),this.setRTL(this.enableRtl))},P5.prototype.renderHeader=function(){var o=this,e=this.headerPlacement,t=[];if(this.hdrEle=this.getTabHeader(),this.addVerticalClass(),this.isTemplate){1<this.element.children.length&&this.element.children[1].classList.contains(_4)&&this.setProperties({headerPlacement:"Bottom"},!0);for(var r,i=this.hdrEle.children.length,n=[],s=0;s<i;s++)n.push(this.hdrEle.children.item(s));0<i&&(r=this.createElement("div",{className:"e-items"}),this.hdrEle.appendChild(r),n.forEach(function(e,t){o.lastIndex=t;var i={className:j4,id:j4+o.tabId+"_"+t},n=o.createElement("span",{className:e5,attrs:{role:"presentation"}}).outerHTML,n=o.createElement("div",{className:n5,innerHTML:n+o.btnCls.outerHTML}).outerHTML,n=o.createElement("div",{className:i5,innerHTML:n,attrs:{role:"tab",tabIndex:"-1","aria-selected":"false","aria-controls":H4+o.tabId+"_"+t,"aria-disabled":"false"}});n.querySelector("."+e5).appendChild(e),r.appendChild(o.createElement("div",i)),ct("."+j4,r)[t].appendChild(n)}))}else t=this.parseObject(this.items,0);this.tbObj=new U3({width:"Left"===e||"Right"===e?"auto":"100%",height:"Left"===e||"Right"===e?"100%":"auto",overflowMode:this.overflowMode,items:0!==t.length?t:[],clicked:this.clickHandler.bind(this),scrollStep:this.scrollStep,enableHtmlSanitizer:this.enableHtmlSanitizer,cssClass:this.cssClass}),this.tbObj.isStringTemplate=!0,this.tbObj.createElement=this.createElement,this.tbObj.appendTo(this.hdrEle),pt(this.hdrEle,{role:"tablist"}),je(this.element.getAttribute("aria-label"))?je(this.element.getAttribute("aria-labelledby"))||(this.hdrEle.setAttribute("aria-labelledby",this.element.getAttribute("aria-labelledby")),this.element.removeAttribute("aria-labelledby")):(this.hdrEle.setAttribute("aria-label",this.element.getAttribute("aria-label")),this.element.removeAttribute("aria-label")),this.setCloseButton(this.showCloseButton);e=this.tbObj.element.querySelector("."+r5);je(e)||!je(e.id)&&""!==e.id||(e.id=this.element.id+"_tab_header_items")},P5.prototype.createContentElement=function(e){var t=this.createElement("div",{id:H4+this.tabId+"_"+e,className:j4,attrs:{role:"tabpanel","aria-labelledby":j4+this.tabId+"_"+e}});return(-1!==["Dynamic","Demand"].indexOf(this.loadOn)||"Init"===this.loadOn&&e===this.selectedItem)&&U([t],U4),t},P5.prototype.renderContent=function(){this.cntEle=ge("."+H4,this.element);var e=ct("."+s5,this.element);if(this.isTemplate){this.cnt=0<this.cntEle.children.length?this.cntEle.innerHTML:"";for(var t=this.cntEle.children,i=0;i<e.length;i++)t.length-1>=i&&(U([t.item(i)],j4),pt(t.item(i),{role:"tabpanel","aria-labelledby":j4+this.tabId+"_"+i}),t.item(i).id=H4+this.tabId+"_"+i)}else if(0<ct("."+s5,this.element).length)if("Init"===this.loadOn)for(i=0;i<this.itemIndexArray.length;i++)this.itemIndexArray[i]&&this.cntEle.appendChild(this.createContentElement(Number(this.extIndex(this.itemIndexArray[i]))));else"Dynamic"===this.loadOn&&this.cntEle.appendChild(this.createContentElement(0<this.selectedItem?this.selectedItem:Number(this.extIndex(this.itemIndexArray[0]))))},P5.prototype.reRenderItems=function(){this.renderContainer(),je(this.cntEle)||this.bindSwipeEvents()},P5.prototype.parseObject=function(e,d){var p,c=this,u=Array.prototype.slice.call(ct(".e-tab-header ."+s5,this.element)),g=this.lastIndex,m=(!this.isReplace&&0<u.length&&(g=this.getMaxIndicesFromItems(u)),[]),f=[];return e.forEach(function(e,t){var i,n,o,r,s,a,l=je(e.header)||je(e.header.iconPosition)?"":e.header.iconPosition,h=je(e.header)||je(e.header.iconCss)?"":e.header.iconCss;je(e.headerTemplate)&&(je(e.header)||je(e.header.text)||0===e.header.text.length&&""===h)?f.push(t):("string"==typeof(s=e.headerTemplate||e.header.text)&&c.enableHtmlSanitizer&&(s=go.sanitize(s)),c.isReplace&&!je(c.tbId)&&""!==c.tbId?(i=parseInt(c.tbId.substring(c.tbId.lastIndexOf("_")+1),10),c.tbId=""):i=d+t,c.lastIndex=0===u.length?t:c.isReplace?i:g+1+t,i=e.disabled?" "+q4+" "+d5:"",n=!1===e.visible?" "+G4:"",p=c.createElement("div",{className:e5,attrs:{role:"presentation"}}),o=!je(o=s instanceof Object?s.outerHTML:s)&&""!==o,je(s.tagName)?c.headerTextCompile(p,s,t):p.appendChild(s),a=c.createElement("span",{className:X4+" "+o5+" "+K4+"-"+l+" "+h}),(r=c.createElement("div",{className:n5})).appendChild(p),""!==s&&void 0!==s&&""!==h?("left"===l||"top"===l?r.insertBefore(a,r.firstElementChild):r.appendChild(a),c.isIconAlone=!1):(""===h?p:a)===a&&(G(p),r.appendChild(a),c.isIconAlone=!0),s=je(e.tabIndex)?"-1":e.tabIndex.toString(),a=e.disabled?{role:"tab","aria-disabled":"true"}:{tabIndex:s,"data-tabindex":s,role:"tab","aria-selected":"false","aria-disabled":"false"},r.appendChild(c.btnCls.cloneNode(!0)),(s=c.createElement("div",{className:i5,attrs:a})).appendChild(r),c.itemIndexArray instanceof Array&&c.itemIndexArray.splice(d+t,0,j4+c.tabId+"_"+c.lastIndex),(a={htmlAttributes:{id:j4+c.tabId+"_"+c.lastIndex,"data-id":e.id},template:s}).cssClass=(void 0!==e.cssClass?e.cssClass:" ")+" "+i+" "+n+" "+(""!==h?"e-i"+l:"")+" "+(o?"":K4),"top"!==l&&"bottom"!==l||c.element.classList.add("e-vertical-icon"),m.push(a),t++)}),this.isAdd||f.forEach(function(e){c.items.splice(e,1)}),this.isIconAlone?this.element.classList.add(J4):this.element.classList.remove(J4),m},P5.prototype.removeActiveClass=function(){var e=this.getTabHeader();e&&(e=ct("."+s5+"."+U4,e),[].slice.call(e).forEach(function(e){return e.classList.remove(U4)}),[].slice.call(e).forEach(function(e){return e.firstElementChild.setAttribute("aria-selected","false")}))},P5.prototype.checkPopupOverflow=function(e){this.tbPop=ge("."+a5,this.element);var t=ge(".e-hor-nav",this.element),i=ge("."+r5,this.element),n=i.lastChild,o=!1;return(o=!this.isVertical()&&(this.enableRtl&&t.offsetLeft+t.offsetWidth>i.offsetLeft||!this.enableRtl&&t.offsetLeft<i.offsetWidth)||this.isVertical()&&t.offsetTop<n.offsetTop+n.offsetHeight?!0:o)&&(e.classList.add(l5),this.tbPop.insertBefore(e,ct("."+l5,this.tbPop)[0])),!0},P5.prototype.popupHandler=function(e){var t=e.querySelector(".e-ripple-element"),t=(je(t)||(t.outerHTML="",e.querySelector("."+i5).classList.remove("e-ripple")),this.tbItem=ct("."+r5+" ."+s5,this.hdrEle),this.tbItem[this.tbItem.length-1]);return 0!==this.tbItem.length&&(e.classList.remove(l5),e.removeAttribute("style"),this.tbItems.appendChild(e),this.actEleId=e.id,this.checkPopupOverflow(t)&&(e=this.tbItems.lastChild.previousElementSibling,this.checkPopupOverflow(e)),this.isPopup=!0),ct("."+s5,this.tbItems).length-1},P5.prototype.setCloseButton=function(e){var t=ge("."+_4,this.element);!0===e?t.classList.add($4):t.classList.remove($4),this.refreshOverflow(),this.refreshActiveTabBorder()},P5.prototype.prevCtnAnimation=function(e,t){this.enableRtl||this.element.classList.contains(Q4);e=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;return e},P5.prototype.triggerPrevAnimation=function(e,t){var i=this,t=this.prevCtnAnimation(t,this.selectedItem);je(t)?e.classList.remove(U4):(t.begin=function(){gt(e,{position:"absolute"}),e.classList.add(h5),e.classList.add("e-view")},t.end=function(){e.style.display="none",e.classList.remove(U4),e.classList.remove(h5),e.classList.remove("e-view"),gt(e,{display:"",position:""}),0!==e.childNodes.length||i.isTemplate||G(e)},new Vt(t).animate(e))},P5.prototype.triggerAnimation=function(e,t){var i,n,o,r=this,s=this.prevIndex,a=([].slice.call(this.element.querySelector("."+H4).children).forEach(function(e){e.id===r.prevActiveEle&&(i=e)}),this.tbItem[s]),l=this.getTrgContent(this.cntEle,this.extIndex(e)),a=(je(i)&&!je(a)&&(e=this.extIndex(a.id),i=this.getTrgContent(this.cntEle,e)),je(l)||(this.prevActiveEle=l.id),je(this.animation)||je(this.animation.next.effect)||je(this.animation.previous.effect)||"None"===this.animation.previous.effect||"None"===this.animation.next.effect);this.initRender||!1===t||a?i&&i!==l&&i.classList.remove(U4):(n=ge("."+H4,this.element),this.prevIndex>this.selectedItem&&!this.isPopup?o={name:"None"===(e=this.animation.previous.effect)?"":"SlideLeftIn"!==e?e:"SlideLeftIn",duration:0===this.animation.previous.duration&&"Enable"===Ut?600:this.animation.previous.duration,timingFunction:this.animation.previous.easing}:(this.isPopup||this.prevIndex<this.selectedItem||this.prevIndex===this.selectedItem)&&(o={name:"None"===(t=this.animation.next.effect)?"":"SlideRightIn"!==t?t:"SlideRightIn",duration:0===this.animation.next.duration&&"Enable"===Ut?600:this.animation.next.duration,timingFunction:this.animation.next.easing}),o.progress=function(){n.classList.add(h5),r.setActiveBorder()},o.end=function(){n.classList.remove(h5),l.classList.add(U4)},this.initRender||je(i)||this.triggerPrevAnimation(i,s),this.isPopup=!1,""===o.name?l.classList.add(U4):new Vt(o).animate(l))},P5.prototype.keyPressed=function(e){var t=z(e,"."+_4+" ."+s5),i=this.getEleIndex(t);!je(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():je(t)||!1!==t.classList.contains(U4)||(this.selectTab(i,null,!0),je(this.popEle))||this.popObj.hide(this.hide)},P5.prototype.getTabHeader=function(){var e;if(!je(this.element))return 0<(e=[].slice.call(this.element.children).filter(function(e){return e.classList.contains(_4)})).length?e[0]:(e=[].slice.call(this.element.children).filter(function(e){return!e.classList.contains("blazor-template")})[0])?[].slice.call(e.children).filter(function(e){return e.classList.contains(_4)})[0]:void 0},P5.prototype.getEleIndex=function(e){return Array.prototype.indexOf.call(ct("."+s5,this.getTabHeader()),e)},P5.prototype.extIndex=function(e){return e.replace(j4+this.tabId+"_","")},P5.prototype.getMaxIndicesFromItems=function(e){var t=this,i=[];return e.forEach(function(e){i.push(t.getIndexFromEle(e.id))}),Math.max.apply(Math,i)},P5.prototype.expTemplateContent=function(){var t=this;this.templateEle.forEach(function(e){je(t.element.querySelector(e))||(document.body.appendChild(t.element.querySelector(e)).style.display="none")})},P5.prototype.templateCompile=function(e,t,i){var n=this.createElement("div");this.compileElement(n,t,"content",i),0!==n.childNodes.length&&e.appendChild(n),this.isReact&&this.renderReactTemplates()},P5.prototype.compileElement=function(t,e,i,n){var o,r;"string"==typeof e?(e=e.trim(),this.isVue?o=oo(this.enableHtmlSanitizer?go.sanitize(e):e):t.innerHTML=this.enableHtmlSanitizer?go.sanitize(e):e):o=oo(e),je(o)||(r=o({},this,i)),!je(o)&&0<r.length&&[].slice.call(r).forEach(function(e){t.appendChild(e)})},P5.prototype.headerTextCompile=function(e,t,i){this.compileElement(e,t,"headerTemplate",i)},P5.prototype.getContent=function(e,t,i,n){var o,r;"string"==typeof(t=je(t)?"":t)||je(t.innerHTML)?("."===(t="string"==typeof t&&this.enableHtmlSanitizer?go.sanitize(t):t)[0]||"#"===t[0])&&document.querySelectorAll(t).length?(r=(o=document.querySelector(t)).outerHTML.trim(),"clone"===i?e.appendChild(o.cloneNode(!0)):(e.appendChild(o),o.style.display="")):this.templateCompile(e,t,n):e.appendChild(t),je(r)||-1===this.templateEle.indexOf(t.toString())&&this.templateEle.push(t.toString())},P5.prototype.getTrgContent=function(e,t){e=this.element.classList.contains(z4)?ge("."+z4+"> ."+H4+" > #"+H4+this.tabId+"_"+t,this.element):this.findEle(e.children,H4+this.tabId+"_"+t);return e},P5.prototype.findEle=function(e,t){for(var i,n=0;n<e.length;n++)if(e[n].id===t){i=e[n];break}return i},P5.prototype.isVertical=function(){var e="Left"===this.headerPlacement||"Right"===this.headerPlacement;return this.scrCntClass=e?"e-vscroll-content":"e-hscroll-content",e},P5.prototype.addVerticalClass=function(){var e;this.isVertical()&&(e="Left"===this.headerPlacement?u5:g5,U([this.hdrEle],[c5,e]),this.element.classList.contains(z4)?U([this.hdrEle],[p5,e]):U([this.element],[p5,e])),"Bottom"===this.headerPlacement&&U([this.hdrEle],[m5])},P5.prototype.updatePopAnimationConfig=function(){this.show={name:this.isVertical()?"FadeIn":"SlideDown",duration:100},this.hide={name:this.isVertical()?"FadeOut":"SlideUp",duration:100}},P5.prototype.changeOrientation=function(e){this.setOrientation(e,this.hdrEle);var e=this.hdrEle.querySelector("."+U4),t=!!this.hdrEle.classList.contains(c5);q([this.element],[p5]),q([this.hdrEle],[c5,u5,g5]),t!==this.isVertical()&&(this.changeToolbarOrientation(),!je(e))&&e.classList.contains(l5)&&this.popupHandler(e),this.addVerticalClass(),this.setActiveBorder(),this.focusItem()},P5.prototype.focusItem=function(){var e=ge(" #"+j4+this.tabId+"_"+this.selectedItem,this.hdrEle);je(e)||e.firstElementChild.focus()},P5.prototype.changeToolbarOrientation=function(){this.tbObj.setProperties({height:this.isVertical()?"100%":"auto",width:this.isVertical()?"auto":"100%"},!0),this.tbObj.changeOrientation(),this.updatePopAnimationConfig()},P5.prototype.setOrientation=function(e,t){var i=Array.prototype.indexOf.call(this.element.children,t),n=Array.prototype.indexOf.call(this.element.children,this.element.querySelector("."+H4));"Bottom"===e&&i<n?this.element.appendChild(t):(q([t],[m5]),this.element.insertBefore(t,ge("."+H4,this.element)))},P5.prototype.setCssClass=function(e,t,i){if(""!==t&&!je(t))for(var n=t.split(" "),o=0;o<n.length;o++)i?e.classList.add(n[o]):e.classList.remove(n[o])},P5.prototype.loadContentInitMode=function(e){if(e&&"Init"===this.loadOn)for(var t=0;t<this.items.length;t++)this.cntEle.children.item(t)&&this.getContent(this.cntEle.children.item(t),this.items[t].content,"render",t)},P5.prototype.loadContentElement=function(){var e;this.isTemplate||(e=this.cntEle.children.item(0),this.loadContentInitMode(e))},P5.prototype.setContentHeight=function(e){if(this.element.classList.contains(f5)&&q([this.element],[f5]),!je(this.cntEle)){var t=this.getTabHeader();if("None"===this.heightAdjustMode)this.loadContentElement(),"auto"===this.height||this.isVertical()||gt(this.cntEle,{height:this.element.clientHeight-t.offsetHeight+"px"});else if("Fill"===this.heightAdjustMode)U([this.element],[f5]),gt(this.element,{height:"100%"}),this.loadContentElement(),this.cntEle.style.height="calc(100% - "+this.hdrEle.offsetHeight+"px)";else if("Auto"===this.heightAdjustMode){if(!0===this.isTemplate)for(var i=ct("."+H4+" > ."+j4,this.element),n=0;n<i.length;n++)i[n].style.display="block",i[n].style.visibility="visible",this.maxHeight=Math.max(this.maxHeight,this.getHeight(i[n])),i[n].style.removeProperty("display"),i[n].style.removeProperty("visibility");else{this.cntEle=ge("."+H4,this.element),!0===e&&"Demand"===this.loadOn&&this.cntEle.appendChild(this.createContentElement(Number(this.extIndex(this.itemIndexArray[0]))));for(var o=this.cntEle.children.item(0),n=0;n<this.items.length;n++)for(this.getContent(o,this.items[n].content,"clone",n),this.maxHeight=Math.max(this.maxHeight,this.getHeight(o));o.firstChild;)o.removeChild(o.firstChild);(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(["content"]),this.templateEle=[],"Demand"===this.loadOn&&this.getContent(o,this.items[0].content,"render",0),this.loadContentInitMode(o),this.prevIndex!==this.selectedItem&&o.classList.remove(U4)}gt(this.cntEle,{height:this.maxHeight+"px"})}else this.loadContentElement(),gt(this.cntEle,{height:"auto"})}},P5.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"))},P5.prototype.setActiveBorder=function(){var e,t=this.getTabHeader(),i=ge("."+s5+"."+U4,t);je(i)||(this.reorderActiveTab?t&&t.classList.remove(v5):(i.classList.contains(l5)&&!this.bdrLine.classList.contains(G4)&&this.bdrLine.classList.add(G4),t&&!t.classList.contains(v5)&&t.classList.add(v5)),e=z(i,"."+V4),this.element!==e)||(this.tbItems=ge("."+r5,t),e=ge("."+t5,t),t=ge("."+r5+" ."+this.scrCntClass,t),this.isVertical()?(gt(e,{left:"",right:""}),gt(e,0!==(je(t)?this.tbItems:t).offsetHeight?{top:i.offsetTop+"px",height:i.offsetHeight+"px"}:{top:0,height:0})):("MultiRow"===this.overflowMode?gt(e,{top:("Bottom"===this.headerPlacement?i.offsetTop:i.offsetHeight+i.offsetTop)+"px",height:""}):gt(e,{top:"",height:""}),gt(e,0!==(e=(je(t)?this.tbItems:t).offsetWidth)?{left:i.offsetLeft+"px",right:e-(i.offsetLeft+i.offsetWidth)+"px"}:{left:"auto",right:"auto"})),je(this.bdrLine))||i.classList.contains(l5)||this.bdrLine.classList.remove(G4)},P5.prototype.setActive=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1),this.tbItem=ct("."+s5,this.getTabHeader());var n=this.tbItem[e];if(!(e<0||isNaN(e)||0===this.tbItem.length||!je(n)&&n.classList.contains(q4)))if(0<=e&&!t&&(this.allowServerDataBinding=!1,this.setProperties({selectedItem:e},!0),this.allowServerDataBinding=!0,this.initRender||this.serverDataBind()),n.classList.contains(U4))this.setActiveBorder();else{this.isTemplate||pt(n.firstElementChild,{"aria-controls":H4+this.tabId+"_"+this.extIndex(n.id)});var o=n.id,r=(this.removeActiveClass(),n.classList.add(U4),n.firstElementChild.setAttribute("aria-selected","true"),Number(this.extIndex(o)));if(je(this.prevActiveEle)&&(this.prevActiveEle=H4+this.tabId+"_"+r),this.isTemplate)0<ge("."+H4,this.element).children.length&&(je(r=this.findEle(ge("."+H4,this.element).children,H4+this.tabId+"_"+r))||r.classList.add(U4),this.triggerAnimation(o,this.enableAnimation));else{for(this.cntEle=ge(".e-tab > ."+H4,this.element);"Dynamic"===this.loadOn&&this.cntEle.firstElementChild;)this.cntEle.removeChild(this.cntEle.firstElementChild);var s,a,r=this.getTrgContent(this.cntEle,this.extIndex(o));je(r)?(this.cntEle.appendChild(this.createElement("div",{id:H4+this.tabId+"_"+this.extIndex(o),className:j4+" "+U4,attrs:{role:"tabpanel","aria-labelledby":j4+this.tabId+"_"+this.extIndex(o)}})),s=this.getTrgContent(this.cntEle,this.extIndex(o)),a=Array.prototype.indexOf.call(this.itemIndexArray,o),this.getContent(s,this.items[a].content,"render",a)):r.classList.add(U4),this.triggerAnimation(o,this.enableAnimation)}this.setActiveBorder(),this.refreshItemVisibility(n),this.initRender||t||(s={previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:n,selectedIndex:e,selectedContent:ge("#"+H4+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwiped,isInteracted:i,preventFocus:!1},this.trigger("selected",s,function(e){e.preventFocus||n.firstElementChild.focus()}))}},P5.prototype.setItems=function(e){this.isReplace=!0,this.tbItems=ge("."+r5,this.getTabHeader()),this.tbObj.items=this.parseObject(e,0),this.tbObj.dataBind(),this.isReplace=!1},P5.prototype.setRTL=function(e){this.tbObj.enableRtl=e,this.tbObj.dataBind(),this.setCssClass(this.element,Q4,e),this.refreshActiveBorder()},P5.prototype.refreshActiveBorder=function(){je(this.bdrLine)||this.bdrLine.classList.add(G4),this.setActiveBorder()},P5.prototype.showPopup=function(e){var t=ge(".e-popup.e-toolbar-pop",this.hdrEle);t&&t.classList.contains("e-popup-close")&&((t=t&&t.ej2_instances[0]).position.X="Left"===this.headerPlacement||this.element.classList.contains(Q4)?"left":"right",t.dataBind(),t.show(e))},P5.prototype.bindDraggable=function(){var e,t=this;this.allowDragAndDrop&&(e=this.element.querySelector("."+_4))&&Array.prototype.slice.call(e.querySelectorAll("."+s5)).forEach(function(e){t.initializeDrag(e)})},P5.prototype.bindSwipeEvents=function(){"None"!==this.swipeMode&&(this.touchModule=new Mn(this.cntEle,{swipe:this.swipeHandler.bind(this)}))},P5.prototype.wireEvents=function(){this.bindDraggable(),window.addEventListener("resize",this.resizeContext),E.add(this.element,"mouseover",this.hoverHandler,this),E.add(this.element,"keydown",this.spaceKeyDown,this),je(this.cntEle)||this.bindSwipeEvents(),this.keyModule=new bn(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}),this.tabKeyModule=new bn(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:{openPopup:"shift+f10",tab:"tab",shiftTab:"shift+tab"},eventName:"keydown"})},P5.prototype.unWireEvents=function(){je(this.keyModule)||this.keyModule.destroy(),je(this.tabKeyModule)||this.tabKeyModule.destroy(),je(this.cntEle)||je(this.touchModule)||(this.touchModule.destroy(),this.touchModule=null),window.removeEventListener("resize",this.resizeContext),E.remove(this.element,"mouseover",this.hoverHandler),E.remove(this.element,"keydown",this.spaceKeyDown),this.element.classList.remove(Q4),this.element.classList.remove(Y4)},P5.prototype.clickHandler=function(e){this.element.classList.remove(Y4);var t=e.originalEvent.target,i=z(t,"."+s5),n=this.getEleIndex(i);t.classList.contains(Z4)?this.removeTab(n):this.isVertical()&&z(t,".e-hor-nav")?this.showPopup(this.show):(this.isPopup=!1,je(i)||n===this.selectedItem||this.selectTab(n,e.originalEvent,!0))},P5.prototype.swipeHandler=function(e){if(!(e.velocity<3&&je(e.originalEvent.changedTouches)||"Touch"===this.swipeMode&&("mouseup"===e.originalEvent.type||"mouseleave"===e.originalEvent.type)||"Mouse"===this.swipeMode&&"touchend"===e.originalEvent.type||"None"===this.swipeMode)){this.isNested&&this.element.setAttribute("data-swipe","true");var t=this.element.querySelector('[data-swipe="true"]');if(t)t.removeAttribute("data-swipe");else{if(this.isSwiped=!0,"Right"===e.swipeDirection&&0!==this.selectedItem){for(var i=this.selectedItem-1;0<=i;i--)if(!this.tbItem[i].classList.contains(G4)){this.selectTab(i,null,!0);break}}else if("Left"===e.swipeDirection&&this.selectedItem!==ct("."+s5,this.element).length-1)for(var n=this.selectedItem+1;n<this.tbItem.length;n++)if(!this.tbItem[n].classList.contains(G4)){this.selectTab(n,null,!0);break}this.isSwiped=!1}}},P5.prototype.spaceKeyDown=function(e){(32===e.keyCode&&32===e.which||35===e.keyCode&&35===e.which)&&!je(z(e.target,"."+_4))&&e.preventDefault()},P5.prototype.keyHandler=function(e){if(!this.element.classList.contains(q4)){this.element.classList.add(Y4);var t,i=e.target,n=this.getTabHeader(),o=ge("."+U4,n),r=(this.popEle=ge("."+a5,n),je(this.popEle)||(this.popObj=this.popEle.ej2_instances[0]),z(document.activeElement,"."+s5)),s=z(i,"."+s5);switch(e.action){case"space":case"enter":i.parentElement.classList.contains(q4)||("enter"===e.action&&i.classList.contains("e-hor-nav")?this.showPopup(this.show):this.keyPressed(i));break;case"tab":case"shiftTab":i.classList.contains(i5)&&!1===z(i,"."+s5).classList.contains(U4)&&i.setAttribute("tabindex",i.getAttribute("data-tabindex")),this.popObj&&at(this.popObj.element)&&this.popObj.hide(this.hide),je(o)||"-1"!==o.children.item(0).getAttribute("tabindex")||o.children.item(0).setAttribute("tabindex","0");break;case"moveLeft":case"moveRight":je(r)||this.refreshItemVisibility(r);break;case"openPopup":e.preventDefault(),!je(this.popEle)&&this.popEle.classList.contains("e-popup-close")&&this.popObj.show(this.show);break;case"delete":!0!==this.showCloseButton||je(s)||(!je(t=s.nextSibling)&&t.classList.contains(s5)&&t.firstElementChild.focus(),this.removeTab(this.getEleIndex(s))),this.setActiveBorder()}}},P5.prototype.refreshItemVisibility=function(e){var t,i,n,o,r=ge("."+this.scrCntClass,this.tbItems);this.isVertical()||je(r)||(i=(t=(r=ge(".e-hscroll-bar",this.tbItems)).scrollLeft)+r.offsetWidth,n=e.offsetLeft,o=e.offsetWidth,e=e.offsetLeft+e.offsetWidth,t<n&&i<e?r.scrollLeft=t+(o-(i-n)):n<t&&e<i&&(r.scrollLeft=t-(o-(e-t))))},P5.prototype.getIndexFromEle=function(e){return parseInt(e.substring(e.lastIndexOf("_")+1),10)},P5.prototype.hoverHandler=function(e){e=e.target;!je(e.classList)&&e.classList.contains(Z4)&&e.setAttribute("title",new Cn("tab",{closeButtonTitle:this.title},this.locale).getConstant("closeButtonTitle"))},P5.prototype.evalOnPropertyChangeItems=function(e,t){var i=this;if(e.items instanceof Array&&t.items instanceof Array)if(this.lastIndex=0,je(this.tbObj))this.reRenderItems();else{(this.isReact||this.isAngular)&&this.clearTemplate(),this.setItems(e.items),0<this.templateEle.length&&this.expTemplateContent(),this.templateEle=[];for(var n=ge(".e-tab > ."+H4,this.element);n.firstElementChild;)G(n.firstElementChild);this.select(this.selectedItem),this.draggableItems=[],this.bindDraggable()}else{for(var o=Object.keys(e.items),r=0;r<o.length;r++)for(var s=parseInt(Object.keys(e.items)[r],10),a=Object.keys(e.items[s]),l=0;l<a.length;l++){var h,d,p=Object(t.items[s])[a[l]],c=Object(e.items[s])[a[l]],u=this.element.querySelectorAll("."+s5)[s],g=void 0,g=u&&!je(u.id)&&""!==u.id?this.getIndexFromEle(u.id):s,m=ge("."+r5+" #"+j4+this.tabId+"_"+g,this.element),g=ge("."+H4+" #"+H4+this.tabId+"_"+g,this.element);"header"!==a[l]&&"headerTemplate"!==a[l]||(d=je(this.items[s].header)||je(this.items[s].header.iconCss)?"":this.items[s].header.iconCss,h=this.items[s].headerTemplate||this.items[s].header.text,"headerTemplate"===a[l]&&this.clearTabTemplate(m,a[l],s5),""===h&&""===d?this.removeTab(s):(this.tbId=u.id,(h=[]).push(this.items[s]),this.items.splice(s,1),this.itemIndexArray.splice(s,1),this.tbObj.items.splice(s,1),d=m.classList.contains(G4),G(m),this.isReplace=!0,this.addTab(h,s),d&&this.hideTab(s),this.isReplace=!1)),"content"!==a[l]||je(g)||(("string"==typeof c||je(c.innerHTML))&&("."===c[0]||"#"===c[0])&&c.length?(u=document.querySelector(c),g.appendChild(u),u.style.display=""):""===c&&"#"===p[0]?(document.body.appendChild(this.element.querySelector(p)).style.display="none",g.innerHTML=c):this.isAngular||this.isReact?(this.clearTabTemplate(g,a[l],j4),g.innerHTML="",this.templateCompile(g,c,s)):"function"!=typeof c&&(g.innerHTML=c)),"cssClass"===a[l]&&(je(m)||(m.classList.remove(p),m.classList.add(c)),je(g)||(g.classList.remove(p),g.classList.add(c))),"disabled"===a[l]&&this.enableTab(s,!0!==c),"visible"===a[l]&&this.hideTab(s,!0!==c)}this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){i.refreshActiveTabBorder()})}},P5.prototype.clearTabTemplate=function(e,t,i){if(this.clearTemplates)if(this.registeredTemplate&&this.registeredTemplate[t]){for(var n=this.registeredTemplate,o=0;o<n[t].length;o++)if(!je(r=z(n[t][o].rootNodes[0],"."+i))&&r===e){this.clearTemplate([t],[n[t][o]]);break}}else if(this.portals&&0<this.portals.length)for(var r,s=this.portals,o=0;o<s.length;o++)if(!je(r=z(s[o].containerInfo,"."+i))&&r===e){this.clearTemplate([t],o);break}},P5.prototype.initializeDrag=function(e){var s=this,e=new hn(e,{dragArea:this.dragArea,dragTarget:"."+s5,clone:!0,helper:this.helper.bind(this),dragStart:this.itemDragStart.bind(this),drag:function(e){var t,i,n,o=s.getEleIndex(s.dragItem),r={draggedItem:s.dragItem,event:e.event,target:e.target,droppedItem:e.target.closest("."+s5),clonedElement:s.cloneElement,index:o};(je(e.target.closest("."+V4))||e.target.closest("."+V4).isEqualNode(s.element)||s.dragArea==="."+_4)&&(e.target.closest(s.dragArea)||"Popup"===s.overflowMode?(document.body.style.cursor="",s.dragItem.querySelector("."+i5).style.visibility="hidden",s.cloneElement.classList.contains(G4)&&q([s.cloneElement],G4)):(document.body.style.cursor="not-allowed",U([s.cloneElement],G4),s.dragItem.classList.contains(G4)&&q([s.dragItem],G4),s.dragItem.querySelector("."+i5).style.visibility="visible"),"Scrollable"!==s.overflowMode||je(s.element.querySelector(".e-hscroll"))||(t=s.element.querySelector(".e-scroll-right-nav"),n=s.element.querySelector(".e-scroll-left-nav"),i=s.element.querySelector(".e-hscroll-bar"),!je(t)&&Math.abs(t.offsetWidth/2+t.offsetLeft)>s.cloneElement.offsetLeft+s.cloneElement.offsetWidth&&(i.scrollLeft-=10),!je(n)&&Math.abs(n.offsetLeft+n.offsetWidth-s.cloneElement.offsetLeft)>n.offsetWidth/2&&(i.scrollLeft+=10)),s.cloneElement.style.pointerEvents="none",t=z(e.target,"."+s5+".e-draggable"),n=0,"Scrollable"!==s.overflowMode||je(s.element.querySelector(".e-hscroll"))||(n=s.element.querySelector(".e-hscroll-content").offsetWidth),null!=t&&!t.isSameNode(s.dragItem)&&t.closest("."+V4).isSameNode(s.dragItem.closest("."+V4))&&((i=s.getEleIndex(t))<o&&Math.abs(t.offsetLeft+t.offsetWidth-s.cloneElement.offsetLeft)>t.offsetWidth/2&&s.dragAction(t,o,i),o<i)&&Math.abs(t.offsetWidth/2)+t.offsetLeft-n<s.cloneElement.offsetLeft+s.cloneElement.offsetWidth&&s.dragAction(t,o,i),s.droppedIndex=s.getEleIndex(s.dragItem)),s.trigger("dragging",r)},dragStop:this.itemDragStop.bind(this)});this.draggableItems.push(e)},P5.prototype.helper=function(e){return this.cloneElement=this.createElement("div"),e.element&&(this.cloneElement=e.element.cloneNode(!0),U([this.cloneElement],"e-tab-clone-element"),this.element.querySelector("."+_4).classList.contains($4)&&U([this.cloneElement],$4),q([this.cloneElement.querySelector("."+i5)],"e-ripple"),je(this.cloneElement.querySelector(".e-ripple-element"))||ue(this.cloneElement.querySelector(".e-ripple-element")),document.body.appendChild(this.cloneElement)),this.cloneElement},P5.prototype.itemDragStart=function(t){var i=this,e=(this.draggingItems=this.items.map(function(e){return e}),this.dragItem=t.element,{draggedItem:t.element,event:t.event,target:t.target,droppedItem:null,index:this.getEleIndex(this.dragItem),clonedElement:this.cloneElement,cancel:!1});this.trigger("onDragStart",e,function(e){e.cancel?(je(e=t.element.ej2_instances[0])||e.intDestroy(t.event),G(i.cloneElement)):(i.removeActiveClass(),U([i.tbItems.querySelector("."+t5)],G4),i.dragItem.querySelector("."+i5).style.visibility="hidden")})},P5.prototype.dragAction=function(e,t,i){var n,o;0<this.items.length&&(n=this.draggingItems[t],this.draggingItems.splice(t,1),this.draggingItems.splice(i,0,n)),"MultiRow"===this.overflowMode&&e.parentNode.insertBefore(this.dragItem,e.nextElementSibling),i<t&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(this.dragItem,e):"Extended"===this.overflowMode?e.isSameNode(e.parentElement.lastChild)?(o=this.dragItem.parentNode,e.parentNode.insertBefore(this.dragItem,e),o.insertBefore(e.parentElement.lastChild,o.childNodes[0])):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)):(n=e.parentElement.lastChild,e.isSameNode(n)?(o=this.dragItem.parentNode,e.parentNode.insertBefore(this.dragItem,e),o.insertBefore(n,o.childNodes[0])):(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(this.dragItem,e.nextElementSibling):"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)))},P5.prototype.itemDragStop=function(e){var t=this,e=(G(this.cloneElement),this.cloneElement=null,this.dragItem.querySelector("."+i5).style.visibility="visible",document.body.style.cursor="",{draggedItem:this.dragItem,event:e.event,target:e.target,droppedItem:this.tbItem[this.droppedIndex],clonedElement:null,index:this.droppedIndex,cancel:!1});this.trigger("dragged",e,function(e){e.cancel?t.refresh():0<t.items.length&&0<t.draggingItems.length?(t.items=t.draggingItems,t.selectedItem=je(t.droppedIndex)?t.getEleIndex(t.dragItem):t.droppedIndex,t.refresh()):(t.dragItem.querySelector("."+i5).style.visibility="",q([t.tbItems.querySelector("."+t5)],G4),t.droppedIndex=je(t.droppedIndex)?t.getEleIndex(t.dragItem):t.droppedIndex,t.selectTab(t.droppedIndex,null,!0))}),this.dragItem=null,this.droppedIndex=null},P5.prototype.enableTab=function(e,t){var i=ct("."+s5,this.element)[e];je(i)||(!0===t?(i.classList.remove(q4,d5),i.firstElementChild.setAttribute("tabindex",i.firstElementChild.getAttribute("data-tabindex"))):(i.classList.add(q4,d5),i.firstElementChild.removeAttribute("tabindex"),i.classList.contains(U4)&&this.select(e+1)),je(this.items[e])||(this.items[e].disabled=!t,this.dataBind()),i.firstElementChild.setAttribute("aria-disabled",!0===t?"false":"true"))},P5.prototype.addTab=function(t,i){var n=this,e={addedItems:t,cancel:!1};if(this.isReplace)this.addingTabContent(t,i);else{for(var o=0,r=t;o<r.length;o++){var s=r[o];s.disabled=s.disabled||!1,s.visible=s.visible||!0}t&&0!==t.length&&this.element&&this.element.classList.contains(G4)&&this.element.classList.remove(G4),this.trigger("adding",e,function(e){e.cancel||n.addingTabContent(t,i)})}this.isReact&&this.renderReactTemplates()},P5.prototype.addingTabContent=function(e,o){var t,i,r,s,a,l=this,h=0;this.hdrEle=ge("."+_4,this.element),je(this.hdrEle)?(this.items=e,this.reRenderItems(),this.bindDraggable()):(0!==(i=(t=Array.from(ct(".e-tab-header ."+s5,this.element))).length)&&(h=this.getMaxIndicesFromItems(t)+1),i<(o=je(o)?i-1:o)||o<0||isNaN(o)||(0!==i||je(this.hdrEle)||(this.hdrEle.style.display=""),je(this.bdrLine)||this.bdrLine.classList.add(G4),this.tbItems=ge("."+r5,this.getTabHeader()),this.isAdd=!0,r=this.parseObject(e,o),this.isAdd=!1,s=0,e.forEach(function(e,t){var i,n;a=e.headerTemplate||e.header.text,je(e.headerTemplate||e.header)||je(a)||0===a.length&&!je(e.header)&&je(e.header.iconCss)||(r[t]&&(je(e.id)&&(e.id=j4+l.tabId+"_"+y5+(h+t).toString()),r[t].htmlAttributes["data-id"]=e.id),l.items.splice(o+s,0,e),s++),je(e.header)||je(e.header.text)||!l.isTemplate&&"Init"!==l.loadOn||(i=h+t,n=l.createElement("div",{id:H4+l.tabId+"_"+i,className:j4,attrs:{role:"tabpanel","aria-labelledby":j4+"_"+i}}),l.cntEle.insertBefore(n,l.cntEle.children[o+t]),n=l.getTrgContent(l.cntEle,i.toString()),l.getContent(n,e.content,"render",o))}),this.tbObj.addItems(r,o),this.isReplace||this.trigger("added",{addedItems:e}),this.selectedItem===o?this.select(o):(this.setActiveBorder(),this.tbItem=ct("."+s5,this.getTabHeader())),this.bindDraggable()))},P5.prototype.removeTab=function(i){var e,n=this,o=ct("."+s5,this.element)[i];je(o)||(e={removedItem:o,removedIndex:i,cancel:!1},this.trigger("removing",e,function(e){var t;e.cancel||(je(t=ge("#"+j4+n.tabId+"_"+n.extIndex(o.id),ge("."+r5,n.element)))||n.clearTabTemplate(t,"headerTemplate",s5),n.tbObj.removeItems(i),n.allowDragAndDrop&&i!==Array.prototype.indexOf.call(n.itemIndexArray,o.id)&&(i=Array.prototype.indexOf.call(n.itemIndexArray,o.id)),t=n.itemIndexArray.indexOf(o.id),n.items.splice(t,1),n.itemIndexArray.splice(t,1),n.refreshActiveBorder(),je(t=ge("#"+H4+n.tabId+"_"+n.extIndex(o.id),ge("."+H4,n.element)))||(n.clearTabTemplate(t,"content",j4),G(t)),n.trigger("removed",e),n.draggableItems&&0<n.draggableItems.length&&(n.draggableItems[i].destroy(),n.draggableItems[i]=null,n.draggableItems.splice(i,1)),o.classList.contains(U4)?(i=i>ct("."+s5+":not(."+l5+")",n.element).length-1?i-1:i,n.enableAnimation=!1,n.tbItem=ct("."+s5,n.getTabHeader()),i=n.getSelectingTabIndex(i),i=!isNaN(i)&&0<=i&&n.tbItem.length>i?i:0,(t=n.tbItem[i])&&(t.classList.contains(G4)&&t.classList.remove(G4),e=t.firstElementChild)&&e.hasAttribute("aria-hidden")&&e.removeAttribute("aria-hidden"),n.selectedItem=i,n.select(i)):i!==n.selectedItem&&(i<n.selectedItem&&(i=n.itemIndexArray.indexOf(n.tbItem[n.selectedItem].id),n.setProperties({selectedItem:-1<i?i:n.selectedItem},!0),n.prevIndex=n.selectedItem),n.tbItem=ct("."+s5,n.getTabHeader())),0===ct("."+s5,n.element).length&&(t=ge("."+H4,n.element),G(n.hdrEle),G(t)),n.enableAnimation=!0)}))},P5.prototype.hideTab=function(e,t){var i,n=ct("."+s5,this.element)[e];if(!je(n)){if(je(t)&&(t=!0),this.bdrLine.classList.add(G4),!0===t)if(n.classList.add(G4),0!==(i=ct("."+s5+":not(."+G4+")",this.tbItems)).length&&n.classList.contains(U4)){if(0!==e)for(var o=e-1;0<=o;o--){if(!this.tbItem[o].classList.contains(G4)){this.select(o);break}if(0===o)for(var r=e+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(G4)){this.select(r);break}}else for(r=e+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(G4)){this.select(r);break}}else 0===i.length&&this.element.classList.add(G4);else this.element.classList.remove(G4),i=ct("."+s5+":not(."+G4+")",this.tbItems),n.classList.remove(G4),0===i.length&&this.select(e);this.setActiveBorder(),je(this.items[e])||(this.items[e].visible=!t,this.dataBind()),je(n.firstElementChild)||n.firstElementChild.setAttribute("aria-hidden",""+t),"Popup"===this.overflowMode&&this.refreshOverflow()}},P5.prototype.selectTab=function(e,t,i){void 0===t&&(t=null),this.isInteracted=i=void 0===i?!1:i,this.select(e,t)},P5.prototype.select=function(t,e){var i=this,n=this.getTabHeader(),n=(this.tbItems=ge("."+r5,n),this.tbItem=ct("."+s5,n),this.content=ge("."+H4,this.element),this.prevItem=this.tbItem[this.prevIndex],je(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),this.tbItem[t]),e=(je(n)?this.selectedID="0":this.selectingID=this.extIndex(n.id),je(this.prevItem)||this.prevItem.classList.contains(q4)||this.prevItem.children.item(0).setAttribute("tabindex",this.prevItem.firstElementChild.getAttribute("tabindex")),{event:e,previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:this.tbItem[this.selectedItem],selectedIndex:this.selectedItem,selectedContent:je(this.content)?null:ge("#"+H4+this.tabId+"_"+this.selectedID,this.content),selectingItem:n,selectingIndex:t,selectingContent:je(this.content)?null:ge("#"+H4+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwiped,isInteracted:this.isInteracted,cancel:!1});this.initRender?this.selectingContent(t,this.isInteracted):this.trigger("selecting",e,function(e){e.cancel||i.selectingContent(t,i.isInteracted)}),this.isInteracted=!1},P5.prototype.getSelectingTabIndex=function(e){if(!je(this.tbItem[e])&&(this.tbItem[e].classList.contains(q4)||this.tbItem[e].classList.contains(G4)))for(var t=e+1;t<this.items.length;t++){if(!1===this.items[t].disabled&&!0===this.items[t].visible){e=t;break}e=0}return e},P5.prototype.selectingContent=function(e,t){var i;"number"==typeof e?(e=this.getSelectingTabIndex(e),this.tbItem.length>e&&0<=e&&!isNaN(e)?(this.prevIndex=this.selectedItem,this.prevItem=this.tbItem[this.prevIndex],this.tbItem[e].classList.contains(l5)&&this.reorderActiveTab?(this.setActive(this.popupHandler(this.tbItem[e]),null,t),!je(this.items)&&0<this.items.length&&this.allowDragAndDrop&&(this.tbItem=ct("."+r5+" ."+s5,this.hdrEle),i=this.items[e],this.items.splice(e,1),this.items.splice(this.tbItem.length-1,0,i),i=this.itemIndexArray[e],this.itemIndexArray.splice(e,1),this.itemIndexArray.splice(this.tbItem.length-1,0,i))):this.setActive(e,null,t)):this.setActive(0,null,t)):e instanceof HTMLElement&&this.setActive(this.getEleIndex(e),null,t)},P5.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},P5.prototype.disable=function(e){this.setCssClass(this.element,q4,e),this.element.setAttribute("aria-disabled",""+e)},P5.prototype.getPersistData=function(){return this.addOnPersist(["selectedItem","actEleId"])},P5.prototype.getModuleName=function(){return"tab"},P5.prototype.onPropertyChanged=function(e,t){for(var i=this,n=0,o=Object.keys(e).sort(function(e,t){return"items"===e?-1:"items"===t?1:0});n<o.length;n++)switch(o[n]){case"width":gt(this.element,{width:T(e.width)});break;case"height":gt(this.element,{height:T(e.height)}),this.setContentHeight(!1);break;case"cssClass":var r=this.element.querySelector("."+_4);""===t.cssClass||je(t.cssClass)?(this.setCssClass(this.element,e.cssClass,!0),je(r)||this.setCssClass(r,e.cssClass,!0)):(this.setCssClass(this.element,t.cssClass,!1),this.setCssClass(this.element,e.cssClass,!0),je(r)||(this.setCssClass(r,t.cssClass,!1),this.setCssClass(r,e.cssClass,!0)));break;case"items":this.evalOnPropertyChangeItems(e,t);break;case"showCloseButton":this.setCloseButton(e.showCloseButton);break;case"reorderActiveTab":this.refreshActiveTabBorder();break;case"selectedItem":this.selectedItem=t.selectedItem,this.select(e.selectedItem);break;case"headerPlacement":this.changeOrientation(e.headerPlacement);break;case"enableRtl":this.setRTL(e.enableRtl);break;case"overflowMode":this.tbObj.overflowMode=e.overflowMode,this.tbObj.dataBind(),this.refreshActiveTabBorder();break;case"heightAdjustMode":this.setContentHeight(!1),this.select(this.selectedItem);break;case"scrollStep":this.tbObj&&(this.tbObj.scrollStep=this.scrollStep);break;case"allowDragAndDrop":this.bindDraggable();break;case"swipeMode":this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.bindSwipeEvents();break;case"dragArea":this.allowDragAndDrop&&(this.draggableItems.forEach(function(e){e.dragArea=i.dragArea}),this.refresh())}},P5.prototype.refreshActiveTab=function(){var e,t,i,n,o,r,s,a,l;this.isReact&&this.isTemplate&&this.clearTemplate(),this.isTemplate?(e=this.element.querySelector("."+r5),a=this.element.querySelector("."+s5+"."+U4),t=this.getIndexFromEle(a.id),o=a.innerText,n=(r=this.element.querySelector("."+H4).querySelector("."+U4).children[0]).innerHTML,G(a),G(r),r={className:s5+" "+W4+" "+U4,id:j4+this.tabId+"_"+t},o=this.createElement("span",{className:e5,innerHTML:o,attrs:{role:"presentation"}}).outerHTML,o=this.createElement("div",{className:n5,innerHTML:o+this.btnCls.outerHTML}).outerHTML,a=a.firstElementChild.getAttribute("data-tabindex"),o=this.createElement("div",{className:i5,innerHTML:o,attrs:{tabIndex:a,"data-tabindex":a,role:"tab","aria-controls":H4+this.tabId+"_"+t,"aria-selected":"true","aria-disabled":"false"}}),e.insertBefore(this.createElement("div",r),e.children[t+1]),this.element.querySelector("."+s5+"."+U4).appendChild(o),r=this.createElement("div",{innerHTML:n}),this.element.querySelector("."+H4).querySelector("."+U4).appendChild(r)):this.element.querySelector("."+s5+"."+U4)&&(G(this.element.querySelector("."+s5+"."+U4).children[0]),G(this.element.querySelector("."+H4).querySelector("."+U4).children[0]),t=je((e=this.items[this.selectedItem]).header)||je(e.header.iconPosition)?"":e.header.iconPosition,o=je(e.header)||je(e.header.iconCss)?"":e.header.iconCss,n=e.headerTemplate||e.header.text,l=this.createElement("div",{className:e5,attrs:{role:"presentation"}}),je(n.tagName)?this.headerTextCompile(l,n,this.selectedItem):l.appendChild(n),s=this.createElement("span",{className:X4+" "+o5+" "+K4+"-"+t+" "+o}),(i=this.createElement("div",{className:n5})).appendChild(l),""!==n&&void 0!==n&&""!==o?("left"===t||"top"===t?i.insertBefore(s,i.firstElementChild):i.appendChild(s),this.isIconAlone=!1):(""===o?l:s)===s&&(G(l),i.appendChild(s),this.isIconAlone=!0),a=je(e.tabIndex)?"-1":e.tabIndex.toString(),n=e.disabled?{}:{tabIndex:a,"data-tabindex":a,role:"tab","aria-selected":"true","aria-disabled":"false"},i.appendChild(this.btnCls.cloneNode(!0)),(o=this.createElement("div",{className:i5,attrs:n})).appendChild(i),"top"!==t&&"bottom"!==t||this.element.classList.add("e-vertical-icon"),this.element.querySelector("."+s5+"."+U4).appendChild(o),r=this.createElement("div"),l=void 0,"string"==typeof(s=e.content)||je(s.innerHTML)?("."===(s="string"==typeof s&&this.enableHtmlSanitizer?go.sanitize(s):s)[0]||"#"===s[0])&&document.querySelectorAll(s).length?(l=(a=document.querySelector(s)).outerHTML.trim(),r.appendChild(a),a.style.display=""):this.compileElement(r,s,"content",this.selectedItem):r.appendChild(s),je(l)||-1===this.templateEle.indexOf(s.toString())&&this.templateEle.push(s.toString()),this.element.querySelector(".e-item."+U4).appendChild(r)),this.isReact&&this.renderReactTemplates()},P5.prototype.refreshActiveTabBorder=function(){"None"===this.heightAdjustMode&&"auto"!==this.height&&this.cntEle&&!this.isVertical()&&(e=this.getTabHeader(),gt(this.cntEle,{height:this.element.clientHeight-e.offsetHeight+"px"}));var e=ge("."+s5+"."+l5+"."+U4,this.element);!je(e)&&this.reorderActiveTab&&this.select(this.getEleIndex(e)),this.refreshActiveBorder()},wH([kt([],E5)],P5.prototype,"items",void 0),wH([e("100%")],P5.prototype,"width",void 0),wH([e("Both")],P5.prototype,"swipeMode",void 0),wH([e("auto")],P5.prototype,"height",void 0),wH([e("")],P5.prototype,"cssClass",void 0),wH([e(0)],P5.prototype,"selectedItem",void 0),wH([e("Top")],P5.prototype,"headerPlacement",void 0),wH([e("Content")],P5.prototype,"heightAdjustMode",void 0),wH([e("Scrollable")],P5.prototype,"overflowMode",void 0),wH([e("Demand")],P5.prototype,"loadOn",void 0),wH([e(!1)],P5.prototype,"enablePersistence",void 0),wH([e(!0)],P5.prototype,"enableHtmlSanitizer",void 0),wH([e(!1)],P5.prototype,"showCloseButton",void 0),wH([e(!0)],P5.prototype,"reorderActiveTab",void 0),wH([e()],P5.prototype,"scrollStep",void 0),wH([e()],P5.prototype,"dragArea",void 0),wH([e(!1)],P5.prototype,"allowDragAndDrop",void 0),wH([e(!0)],P5.prototype,"clearTemplates",void 0),wH([t({},C5)],P5.prototype,"animation",void 0),wH([i()],P5.prototype,"created",void 0),wH([i()],P5.prototype,"adding",void 0),wH([i()],P5.prototype,"added",void 0),wH([i()],P5.prototype,"selecting",void 0),wH([i()],P5.prototype,"selected",void 0),wH([i()],P5.prototype,"removing",void 0),wH([i()],P5.prototype,"removed",void 0),wH([i()],P5.prototype,"onDragStart",void 0),wH([i()],P5.prototype,"dragging",void 0),wH([i()],P5.prototype,"dragged",void 0),wH([i()],P5.prototype,"destroyed",void 0);var M5,k5=wH([Bt],P5);function P5(e,t){e=M5.call(this,e,t)||this;return e.show={},e.hide={},e.maxHeight=0,e.title="Close",e.isInteracted=!1,e.lastIndex=0,e.isAdd=!1,e.isIconAlone=!1,e.draggableItems=[],e.resizeContext=e.refreshActiveTabBorder.bind(e),e.keyConfigs={tab:"tab",home:"home",end:"end",enter:"enter",space:"space",delete:"delete",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"},e}B5=function(e,t){return(B5=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])}))(e,t)};var B5,F5,Wz=function(e,t){function i(){this.constructor=e}B5(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},wH=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},L5="e-treeview",R5="e-control",O5="e-icon-collapsible",N5="e-icon-expandable",V5="e-list-item",_5="e-list-text",H5="e-list-parent",z5="e-hover",j5="e-active",W5="e-icons-spinner",Q5="e-process",U5="e-icons",q5="e-text-content",G5="e-input",Y5="e-input-group",X5="e-tree-input",K5="e-editing",J5="e-interaction",Z5="e-droppable",$5="e-dragging",eW="e-sibling",tW="e-drop-in",iW="e-drop-next",nW="e-drop-out",oW="e-no-drop",rW="e-fullrow",sW="e-selected",aW="e-expanded",lW="e-node-collapsed",hW="e-disable",dW="e-check",pW="e-stop",cW="e-treeview-checkbox",uW="e-frame",gW="e-ripple",mW="e-node-focus",fW="e-list-img",yW="e-animation-active",vW="e-disabled",bW="e-prevent",wW={treeRole:"group",itemRole:"treeitem",listRole:"group",itemText:"",wrapperRole:""},CW=(Wz(SW,F5=n),wH([e("child")],SW.prototype,"child",void 0),wH([e([])],SW.prototype,"dataSource",void 0),wH([e("expanded")],SW.prototype,"expanded",void 0),wH([e("hasChildren")],SW.prototype,"hasChildren",void 0),wH([e("htmlAttributes")],SW.prototype,"htmlAttributes",void 0),wH([e("iconCss")],SW.prototype,"iconCss",void 0),wH([e("id")],SW.prototype,"id",void 0),wH([e("imageUrl")],SW.prototype,"imageUrl",void 0),wH([e("isChecked")],SW.prototype,"isChecked",void 0),wH([e("parentID")],SW.prototype,"parentID",void 0),wH([e(null)],SW.prototype,"query",void 0),wH([e("selectable")],SW.prototype,"selectable",void 0),wH([e("selected")],SW.prototype,"selected",void 0),wH([e(null)],SW.prototype,"tableName",void 0),wH([e("text")],SW.prototype,"text",void 0),wH([e("tooltip")],SW.prototype,"tooltip",void 0),wH([e("navigateUrl")],SW.prototype,"navigateUrl",void 0),SW);function SW(){return null!==F5&&F5.apply(this,arguments)||this}Wz(IW,AW=n),wH([e("SlideDown")],IW.prototype,"effect",void 0),wH([e(400)],IW.prototype,"duration",void 0),wH([e("linear")],IW.prototype,"easing",void 0);var AW,xW=IW;function IW(){return null!==AW&&AW.apply(this,arguments)||this}Wz(DW,TW=n),wH([t({effect:"SlideUp",duration:400,easing:"linear"},xW)],DW.prototype,"collapse",void 0),wH([t({effect:"SlideDown",duration:400,easing:"linear"},xW)],DW.prototype,"expand",void 0);var TW,EW=DW;function DW(){return null!==TW&&TW.apply(this,arguments)||this}Wz(BW,MW=Ji),(kW=BW).prototype.getModuleName=function(){return"treeview"},BW.prototype.preRender=function(){var t=this;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",shiftSpace:"shift+space",ctrlSpace:"ctrl+space"},this.listBaseOption={expandCollapse:!0,showIcon:!0,expandIconClass:N5,ariaAttributes:wW,expandIconPosition:"Left",itemCreated:function(e){t.beforeNodeCreate(e)},enableHtmlSanitizer:this.enableHtmlSanitizer,itemNavigable:this.fullRowNavigable},this.updateListProp(this.fields),this.aniObj=new Vt({}),this.treeList=[],this.isLoaded=!1,this.isInitalExpand=!1,this.expandChildren=[],this.index=0,this.setTouchClass(),this.DDTTreeData=JSON.parse(JSON.stringify(this.fields.dataSource)),je(this.selectedNodes)&&this.setProperties({selectedNodes:[]},!0),je(this.checkedNodes)&&this.setProperties({checkedNodes:[]},!0),je(this.expandedNodes)?this.setProperties({expandedNodes:[]},!0):this.isInitalExpand=!0},BW.prototype.getPersistData=function(){return this.addOnPersist(["selectedNodes","checkedNodes","expandedNodes"])},BW.prototype.render=function(){this.initialRender=!0,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.initialRender=!1,this.renderComplete()},BW.prototype.initialize=function(){this.element.setAttribute("role","tree"),!je(this.fields.dataSource)&&Array.isArray(this.fields.dataSource)&&0!==this.fields.dataSource.length&&this.element.setAttribute("aria-activedescendant",this.element.id+"_active"),this.setCssClass(null,this.cssClass),this.setEnableRtl(),this.setFullRow(this.fullRowSelect),this.setTextWrap(),this.nodeTemplateFn=this.templateComplier(this.nodeTemplate)},BW.prototype.setDisabledMode=function(){this.disabled?(this.element.classList.add(vW),this.element.setAttribute("aria-disabled","true")):(this.element.classList.remove(vW),this.element.setAttribute("aria-disabled","false"))},BW.prototype.setEnableRtl=function(){(this.enableRtl?U:q)([this.element],"e-rtl")},BW.prototype.setRipple=function(){this.rippleFn=Ht(this.element,{selector:".e-fullrow,.e-text-content",ignore:"."+q5+" > ."+U5+",."+Y5+",."+G5+", ."+cW});var e={selector:"."+q5+" > ."+U5,isCenterRipple:!0};this.rippleIconFn=Ht(this.element,e)},BW.prototype.setFullRow=function(e){(e?U:q)([this.element],"e-fullrow-wrap")},BW.prototype.setMultiSelect=function(e){e?this.element.setAttribute("aria-multiselectable","true"):this.element.setAttribute("aria-multiselectable","false")},BW.prototype.templateComplier=function(t){if(t){this.hasTemplate=!0,this.element.classList.add(J5);try{return"function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){return oo(t)}}this.element.classList.remove(J5)},BW.prototype.setDataBinding=function(t){var i=this;this.treeList.push("false"),this.fields.dataSource instanceof me?(this.isOffline=this.fields.dataSource.dataSource.offline,this.fields.dataSource.ready?this.fields.dataSource.ready.then(function(e){i.isOffline=i.fields.dataSource.dataSource.offline,i.fields.dataSource instanceof me&&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(e){i.treeList.pop(),i.treeData=e.result,i.isNumberTypeId=i.getType(),i.setRootData(),t&&(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(),je(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()},BW.prototype.getQuery=function(e,t){void 0===t&&(t=null);var i=[];if(e.query)n=e.query.clone();else{for(var n=new ya,o=this.getActualProperties(e),r=0,s=Object.keys(o);r<s.length;r++){var a=s[r];"dataSource"!==a&&"tableName"!==a&&"child"!==a&&e[""+a]&&"url"!==a&&-1===i.indexOf(e[""+a])&&i.push(e[""+a])}n.select(i),Object.prototype.hasOwnProperty.call(o,"tableName")&&n.from(e.tableName)}return X_.addSorting(this.sortOrder,e.text,n),je(t)||je(e.parentID)||n.where(e.parentID,"equal",this.isNumberTypeId?parseFloat(t):t),n},BW.prototype.getType=function(){return!!this.treeData[0]&&"number"==typeof R(this.fields.id,this.treeData[0])},BW.prototype.setRootData=function(){var e;this.dataType=this.getDataType(this.treeData,this.fields),1===this.dataType?(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID),je(e=this.getChildNodes(this.treeData,void 0,!0))?this.rootData=[]:this.rootData=e):this.rootData=this.treeData},BW.prototype.isChildObject=function(){return"object"==typeof this.fields.child},BW.prototype.renderItems=function(e){this.listBaseOption.ariaAttributes.level=1;var t=this.getSortedData(this.rootData),i=(this.ulElement=X_.createList(this.createElement,e?this.rootData:t,this.listBaseOption),this.element.appendChild(this.ulElement),this.ulElement.querySelectorAll(".e-list-item"));if(!1===this.loadOnDemand)for(var n=0;n<i.length;)this.renderChildNodes(i[parseInt(n.toString(),10)],!0,null,!0),n++;(1===ct("."+H5,this.element).length&&i&&0!==i.length||this.loadOnDemand)&&this.finalizeNode(this.element),this.parentNodeCheck=[],this.parentCheckData=[],this.updateCheckedStateFromDS(),this.autoCheck&&this.showCheckBox&&!this.isLoaded&&this.updateParentCheckState()},BW.prototype.updateCheckedStateFromDS=function(){if(this.validNodes=[],this.treeData&&this.showCheckBox){if(1===this.dataType){for(var e=this.fields,t=new me(this.treeData).executeLocal((new ya).where(e.isChecked,"equal",!0,!1)),i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)][this.fields.id]?t[parseInt(i.toString(),10)][this.fields.id].toString():null;if(-1!==this.checkedNodes.indexOf(n)||this.isLoaded||this.checkDisabledState(n,t[i]),t[parseInt(i.toString(),10)][this.fields.hasChildren])for(var n=t[parseInt(i.toString(),10)][this.fields.id],o=new me(this.treeData).executeLocal((new ya).where(e.parentID,"equal",n,!1)),r=0;r<o.length;r++){var s=o[parseInt(r.toString(),10)][this.fields.id]?o[parseInt(r.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(s)&&this.autoCheck&&this.checkDisabledState(s,o[r])}}for(i=0;i<this.checkedNodes.length;i++)for(var a=this.fields,l=new me(this.treeData).executeLocal((new ya).where(a.id,"equal",this.checkedNodes[parseInt(i.toString(),10)],!0)),h=(l[0]&&this.autoCheck&&(this.getCheckedNodeDetails(a,l),this.checkIndeterminateState(l[0])),0<l.length&&(p=l[0][this.fields.id]?l[0][this.fields.id].toString():null,-1<this.checkedNodes.indexOf(p))&&-1===this.validNodes.indexOf(p)&&this.validNodes.push(p),new me(this.treeData).executeLocal((new ya).where(a.parentID,"equal",this.checkedNodes[parseInt(i.toString(),10)],!0))),d=0;d<h.length;d++){var p=h[parseInt(d.toString(),10)][this.fields.id]?h[parseInt(d.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(p)&&this.autoCheck&&this.checkDisabledState(p,h[d]),-1<this.checkedNodes.indexOf(p)&&-1===this.validNodes.indexOf(p)&&this.validNodes.push(p)}}else if(2===this.dataType||this.fields.dataSource instanceof me&&this.isOffline){for(d=0;d<this.treeData.length;d++){var c=this.treeData[parseInt(d.toString(),10)][this.fields.id]?this.treeData[parseInt(d.toString(),10)][this.fields.id].toString():"",c=(this.treeData[parseInt(d.toString(),10)][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(c)&&this.checkDisabledState(c,this.treeData[d]),-1<this.checkedNodes.indexOf(c)&&-1===this.validNodes.indexOf(c)&&this.validNodes.push(c),R(this.fields.child.toString(),this.treeData[parseInt(d.toString(),10)]));c&&this.updateChildCheckState(c,this.treeData[parseInt(d.toString(),10)])}this.validNodes=this.enablePersistence?this.checkedNodes:this.validNodes}this.setProperties({checkedNodes:this.validNodes},!0)}},BW.prototype.getCheckedNodeDetails=function(e,t){var i=t[0][this.fields.parentID]?t[0][this.fields.parentID].toString():null,n=0,o=this.element.querySelector('[data-uid="'+t[0][this.fields.id]+'"]'),t=this.element.querySelector('[data-uid="'+t[0][this.fields.parentID]+'"]');if(o||t)t&&!ge("."+dW,t)&&this.changeState(t,"indeterminate",null,!0,!0);else{-1===this.parentNodeCheck.indexOf(i)&&this.parentNodeCheck.push(i);for(var r=this.getChildNodes(this.treeData,i),s=0;s<r.length;s++){var a=r[parseInt(s.toString(),10)][this.fields.id]?r[parseInt(s.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(a)&&n++,n===r.length&&-1===this.checkedNodes.indexOf(i)&&this.checkDisabledState(i)}o=new me(this.treeData).executeLocal((new ya).where(e.id,"equal",i,!0));this.getCheckedNodeDetails(e,o)}},BW.prototype.updateParentCheckState=function(){var i,e=ct("."+pW,this.element),t=this.treeData;this.element.classList.contains("e-filtering")&&(t=this.DDTTreeData);for(var n=0;n<e.length;n++){var o=z(e[parseInt(n.toString(),10)],"."+V5),r=o.getAttribute("data-uid").toString(),s=void 0,a=(this.element.classList.contains("e-filtering")&&(s=new me(this.OldCheckedData).executeLocal((new ya).where("parentID","equal",r,!0))),i=1===this.dataType?new me(t).executeLocal((new ya).where(this.fields.parentID,"equal",r,!0)):this.getChildNodes(t,r),0);if(i){for(var l=this,h=0;h<i.length;h++)!function(e){var t=i[parseInt(e.toString(),10)][l.fields.id].toString();(-1!==l.checkedNodes.indexOf(t)||l.element.classList.contains("e-filtering")&&-1!==s.findIndex(function(e){return e.id===t}))&&a++}(h);a===i.length?(r=o.getAttribute("data-uid"),-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r),this.changeState(o,"check",null,!0,!0)):0===a&&0===this.checkedNodes.length&&this.changeState(o,"uncheck",null,!0,!0)}}},BW.prototype.checkIndeterminateState=function(e){var t=1===this.dataType?this.element.querySelector('[data-uid="'+e[this.fields.parentID]+'"]'):this.element.querySelector('[data-uid="'+e[this.fields.id]+'"]');t?"true"!==t.getAttribute("aria-checked")&&this.changeState(t,"indeterminate",null,!0,!0):2===this.dataType&&-1===this.parentNodeCheck.indexOf(e[this.fields.id].toString())&&this.parentNodeCheck.push(e[this.fields.id].toString())},BW.prototype.updateChildCheckState=function(e,t){for(var i=0,n=t[this.fields.id]?t[this.fields.id].toString():"",o=0;o<e.length;o++){var r=e[parseInt(o.toString(),10)][this.fields.id]?e[parseInt(o.toString(),10)][this.fields.id].toString():"",r=(e[parseInt(o.toString(),10)][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r,e[o]),-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(r)&&this.autoCheck&&this.checkDisabledState(r,e[o]),-1!==this.checkedNodes.indexOf(r)&&this.autoCheck&&i++,-1<this.checkedNodes.indexOf(r)&&-1===this.validNodes.indexOf(r)&&this.validNodes.push(r),R(this.fields.child.toString(),e[parseInt(o.toString(),10)]));r&&r.length&&(-1===this.parentCheckData.indexOf(t)&&this.parentCheckData.push(t),this.updateChildCheckState(r,e[parseInt(o.toString(),10)])),i===e.length&&this.autoCheck&&-1===this.checkedNodes.indexOf(n)&&this.checkDisabledState(n,t)}if(0!==i&&this.autoCheck){this.checkIndeterminateState(t);for(var s=0;s<this.parentCheckData.length;s++)t!==this.parentCheckData[parseInt(s.toString(),10)]&&this.parentCheckData[parseInt(s.toString(),10)]&&this.checkIndeterminateState(this.parentCheckData[parseInt(s.toString(),10)])}this.parentCheckData=[]},BW.prototype.beforeNodeCreate=function(e){this.showCheckBox&&((t=kv(this.createElement,!0,{cssClass:this.touchClass})).classList.add(cW),n=ge("div."+N5+", div."+O5,e.item),i=e.item.getAttribute("data-uid"),e.item.childNodes[0].insertBefore(t,e.item.childNodes[0].childNodes[je(n)?0:1]),n=R(e.fields.isChecked,e.curData),!(-1<this.checkedNodes.indexOf(i))&&(je(n)||"true"!==n.toString())?e.item.setAttribute("aria-checked","false"):(ge("."+uW,t).classList.add(dW),e.item.setAttribute("aria-checked","true"),this.addCheck(e.item)),i=ge("."+uW,t),E.add(i,"mousedown",this.frameMouseHandler,this),E.add(i,"mouseup",this.frameMouseHandler,this)),this.fullRowSelect&&this.createFullRow(e.item),this.allowMultiSelection&&!e.item.classList.contains(sW)&&e.item.setAttribute("aria-selected","false");var t,i,n=e.fields,n=(this.addActionClass(e,n.selected,sW),this.addActionClass(e,n.expanded,aW),e.item.setAttribute("tabindex","-1"),E.add(e.item,"focus",this.focusIn,this),je(this.nodeTemplateFn)||(t=e.item.querySelector("."+_5),i=e.item.getAttribute("data-uid"),t.innerHTML="",this.renderNodeTemplate(e.curData,t,i)),{node:e.item,nodeData:e.curData,text:e.text});this.isRefreshed||(this.trigger("drawNode",n),!1!==e.curData[this.fields.selectable])||this.showCheckBox||(e.item.classList.add(bW),e.item.firstElementChild.style.cursor="not-allowed")},BW.prototype.frameMouseHandler=function(e){Pv(e,ge(".e-ripple-container",e.target.parentElement))},BW.prototype.addActionClass=function(e,t,i){t=R(t,e.curData);je(t)||"false"===t.toString()||e.item.classList.add(i)},BW.prototype.getDataType=function(e,t){if(this.fields.dataSource instanceof me){for(var i=0;i<e.length;i++)if(this.isOffline){if("string"==typeof t.child&&je(R(t.child,e[parseInt(i.toString(),10)]))&&!je(R(t.parentID,e[parseInt(i.toString(),10)])))return 1}else if("string"==typeof t.child&&je(R(t.child,e[parseInt(i.toString(),10)])))return 1;return 2}for(var i=0,n=e.length;i<n;i++){if("string"==typeof t.child&&(!je(R(t.child,e[parseInt(i.toString(),10)]))||Object.prototype.hasOwnProperty.call(e[parseInt(i.toString(),10)],t.child)))return 2;if(this.isChildObject())return 2;if(!je(R(t.parentID,e[parseInt(i.toString(),10)]))||!je(R(t.hasChildren,e[parseInt(i.toString(),10)])))return 1}return 1},BW.prototype.getGroupedData=function(e,t){for(var t=(new ya).group(t),i=X_.getDataSource(e,t),n=[],o=0;o<i.length;o++){var r=i[parseInt(o.toString(),10)].items;n.push(r)}return n},BW.prototype.getSortedData=function(e){return e=e&&"None"!==this.sortOrder?X_.getDataSource(e,X_.addSorting(this.sortOrder,this.fields.text)):e},BW.prototype.finalizeNode=function(e,t,i){var n=this;if(t||this.updateAttributes(e),!i){var o=ct("."+aW,e);if(!this.loadOnDemand&&this.fields.dataSource instanceof me&&(this.isInitalExpand=0<this.treeData.filter(function(e){return!0===e[n.fields.expanded]}).length||this.isInitalExpand),!this.isInitalExpand)for(var r=0;r<o.length;r++)this.renderChildNodes(o[parseInt(r.toString(),10)]);q(o,aW)}t||this.updateList(),this.isLoaded&&this.updateCheckedProp()},BW.prototype.updateAttributes=function(e){for(var t=ct("."+fW,e),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].setAttribute("alt",fW);if(this.isLoaded){for(var n=ct("."+sW,e),o=0;o<n.length;o++){this.selectNode(n[parseInt(o.toString(),10)],null);break}q(n,sW)}for(var r=ct("."+V5+":not(."+aW+")",e),s=0;s<r.length;s++){var a=ge("div."+U5,r[parseInt(s.toString(),10)]);a&&a.classList.contains(N5)&&this.disableExpandAttr(r[parseInt(s.toString(),10)])}},BW.prototype.updateCheckedProp=function(){var e;this.showCheckBox&&(e=[].concat([],this.checkedNodes),this.setProperties({checkedNodes:e},!0))},BW.prototype.ensureIndeterminate=function(){if(this.autoCheck)for(var e=ct("li",this.element),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].classList.contains(V5)&&(ge("."+H5,e[parseInt(t.toString(),10)])?this.ensureParentCheckState(e[parseInt(t.toString(),10)]):this.ensureChildCheckState(e[parseInt(t.toString(),10)]));else for(var i=ct("."+pW,this.element),t=0;t<i.length;t++)i[parseInt(t.toString(),10)].classList.remove(pW)},BW.prototype.ensureParentCheckState=function(e){var t,i,n,o,r,s,a,l,h,d,p;je(e)||e.classList.contains(L5)||((s=e).classList.contains(V5)&&(s=ge("."+H5,e)),a=ct("."+cW+" ."+dW,s),t=ct("."+pW,s),s=ct(this.checkDisabledChildren?"."+V5:"."+V5+":not(."+hW+")",s),i=e.getElementsByClassName(cW)[0],p=s.length,a=a.length,l=[],h=[],n=e.getAttribute("data-uid"),r=!(o=!0),s.forEach(function(e){e instanceof HTMLElement&&("true"===e.getAttribute("aria-checked")?r=!0:o=!1)}),s=!1,this.element.classList.contains("e-filtering")&&(a=new me(this.OldCheckedData).executeLocal((new ya).where("parentID","equal",n,!0)).length,0<(d=new me(this.OldCheckedData).executeLocal((new ya).where("hasChildren","equal",!0,!0))).length&&r&&(this.OldCheckedData.some(function(e){return e.id===n})||-1!==this.parentNodeCheck.indexOf(n))&&(a=d.length,s=!0),p=(1===this.dataType?new me(this.DDTTreeData).executeLocal((new ya).where(this.fields.parentID,"equal",n,!0)):this.getChildNodes(this.DDTTreeData,n)).length),!this.autoCheck||!this.showCheckBox||this.fields.dataSource instanceof me||(l=this.getSelectedChildNodeDetails(n),h=new me(this.checkActionNodes).executeLocal((new ya).where("parentID","equal",n,!0))),0===p&&0===a)||(p===a||s&&0<p&&(h.length===l.length||h.length!==l.length)&&0!==h.length&&0!==l.length&&o&&this.autoCheck&&this.showCheckBox?this.changeState(i,"check",null,!0,!0):0<a&&!s&&this.autoCheck&&this.showCheckBox||0<a||0<t.length?this.changeState(i,"indeterminate",null,!0,!0):0===a&&this.changeState(i,"uncheck",null,!0,!0),je(d=z(e,"."+H5)))||(p=z(d,"."+V5),this.ensureParentCheckState(p))},BW.prototype.getSelectedChildNodeDetails=function(i){function t(e){if(!je(o)&&o in e&&Array.isArray(e[o])){var t=e[r];if(!je(t))return t.toString()===i}else{t=e[s];if(!je(t))return t.toString()===i}return!1}var n=this,o="string"==typeof this.fields.child?this.fields.child:null,r=this.fields.id,s=this.fields.parentID;return this.checkedNodes.map(function(e){return n.getNodeObject(e)}).filter(function(e){return(e&&"object"==typeof e&&o in e||2!==n.dataType&&"object"==typeof e&&(s in e||o in e))&&t(e)})},BW.prototype.ensureChildCheckState=function(e,t,i){var n=this;if(!je(e)){var o=ge("."+H5,e),r=void 0;if(!je(o)){var s=Array.from(o.querySelectorAll("li")),r=ct("."+cW,o);this.isFilter&&(r=Array.from(r).filter(function(e){e=e.closest("li").getAttribute("data-uid");return null!==e&&-1!==n.checkedNodes.indexOf(e)}),s=Array.from(s).filter(function(e){e=e.getAttribute("data-uid");return null!==e&&-1!==n.checkedNodes.indexOf(e)}),0===r.length)&&(r=ct("."+cW,o),s=Array.from(o.querySelectorAll("li")));for(var a=e.getElementsByClassName(uW)[0].classList.contains(dW),l=e.getElementsByClassName(uW)[0].classList.contains(pW),h=void 0,d=0;d<r.length;d++){var p,c=s[parseInt(d.toString(),10)].getAttribute("data-uid");je(this.currentLoadData)||je(R(this.fields.isChecked,this.currentLoadData[parseInt(d.toString(),10)]))?(p=r[parseInt(d.toString(),10)].getElementsByClassName(uW)[0].classList.contains(dW),a||p&&!this.isLoaded||-1!==this.checkedNodes.indexOf(c)&&this.isLoaded&&(l||a)?h="check":s[parseInt(d.toString(),10)].classList.contains("e-has-child")&&!ee(this.parentNodeCheck)&&this.autoCheck&&(a||l)&&-1!==this.parentNodeCheck.indexOf(c)||1===this.dataType&&!ee(this.parentNodeCheck)&&this.autoCheck&&(a||l)&&-1!==this.parentNodeCheck.indexOf(c)?(h="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(c),1)):h="uncheck"):(h=R(this.fields.isChecked,this.currentLoadData[parseInt(d.toString(),10)])?"check":"uncheck","uncheck"===(h=-1!==this.ele?a?"check":"uncheck":h)&&!ee(this.parentNodeCheck)&&this.autoCheck&&-1!==this.parentNodeCheck.indexOf(c)&&(this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(c),1),h="indeterminate")),this.changeState(r[parseInt(d.toString(),10)],h,t,!0,!0)}}this.autoCheck&&this.isLoaded&&!i&&this.updateParentCheckState()}},BW.prototype.doCheckBoxAction=function(e,t){if(je(e)){var i=ct("."+cW,this.element);if(this.loadOnDemand)for(var n=0;n<i.length;n++){o=z(i[parseInt(n.toString(),10)],"."+V5);this.updateFieldChecked(i[parseInt(n.toString(),10)],t),this.changeState(i[parseInt(n.toString(),10)],t?"check":"uncheck",null,null,null,t),this.updateOldCheckedData([this.getNodeData(o)])}else for(n=0;n<i.length;n++){o=z(i[parseInt(n.toString(),10)],"."+V5);this.updateFieldChecked(i[parseInt(n.toString(),10)],t),this.changeState(i[parseInt(n.toString(),10)],t?"check":"uncheck"),this.updateOldCheckedData([this.getNodeData(o)])}}else{e.reverse();for(var o,r=e.length-1;0<=r;r--)if(je(o=this.getElement(e[parseInt(r.toString(),10)]))){if(""!==(p=e[r-e.length]?e[r-e.length].toString():e[parseInt(r.toString(),10)]?e[parseInt(r.toString(),10)].toString():null)&&t&&p)this.setValidCheckedNode(p,e),this.dynamicCheckState(p,t);else if(-1!==this.checkedNodes.indexOf(p)&&""!==p&&!t){this.checkedNodes.splice(this.checkedNodes.indexOf(p),1);var s=this.getChildNodes(this.treeData,p);if(s){for(var a=0;a<s.length;a++){var l=s[parseInt(a.toString(),10)][this.fields.id]?s[parseInt(a.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(l)&&(this.checkedNodes.splice(this.checkedNodes.indexOf(l),1),l=this.element.querySelector('[data-uid="'+l+'"]'))&&this.changeState(l,"uncheck",null)}-1!==this.parentNodeCheck.indexOf(p)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1)}p&&this.dynamicCheckState(p,t),this.updateField(this.treeData,this.fields,p,"isChecked",null)}}else{var h=ge("."+H5+" ."+cW,o);this.validateCheckNode(h,!t,o,null)}}if(e)for(var d=0;d<e.length-1;d++){var p=e[parseInt(d.toString(),10)]?e[parseInt(d.toString(),10)].toString():"";t||this.updateField(this.treeData,this.fields,p,"isChecked",null)}this.autoCheck&&this.updateParentCheckState()},BW.prototype.updateFieldChecked=function(e,t){var e=z(e,"."+V5),i=e.getAttribute("data-uid");"true"!==this.getNodeData(e).isChecked||t||this.updateField(this.treeData,this.fields,i,"isChecked",null)},BW.prototype.dynamicCheckState=function(e,t){if(1===this.dataType){var i=0,n=new me(this.treeData).executeLocal((new ya).where(this.fields.id,"equal",e,!0));if(n[0]){var o=n[0][this.fields.id]?n[0][this.fields.id].toString():null,n=n[0][this.fields.parentID]?n[0][this.fields.parentID].toString():null,r=this.element.querySelector('[data-uid="'+n+'"]'),s=this.element.querySelector('[data-uid="'+o+'"]'),a=this.getChildNodes(this.treeData,n);if(a)for(var l=0;l<a.length;l++){var h=a[parseInt(l.toString(),10)][this.fields.id]?a[parseInt(l.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(h)&&i++}-1!==this.checkedNodes.indexOf(e)&&r&&o===e&&this.autoCheck?this.changeState(r,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&s&&o===e&&!t?this.changeState(s,"uncheck",null):-1!==this.checkedNodes.indexOf(e)&&s&&o===e&&t?this.changeState(s,"check",null):-1===this.checkedNodes.indexOf(e)&&!s&&r&&o===e&&this.autoCheck&&0!==i?this.changeState(r,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&!s&&r&&o===e&&this.autoCheck&&0===i?this.changeState(r,"uncheck",null):s||r||o!==e||!this.autoCheck||this.updateIndeterminate(e,t)}}else if(2===this.dataType||this.fields.dataSource instanceof me&&this.isOffline)for(o=void 0,r=void 0,l=0;l<this.treeData.length;l++){o=this.treeData[parseInt(l.toString(),10)][this.fields.id]?this.treeData[parseInt(l.toString(),10)][this.fields.id].toString():"",d=(r=this.element.querySelector('[data-uid="'+o+'"]'))?ge("."+dW,r):null,-1===this.checkedNodes.indexOf(o)&&r&&d&&!t&&this.changeState(r,"uncheck",null);var d=R(this.fields.child.toString(),this.treeData[parseInt(l.toString(),10)]);d&&this.updateChildIndeterminate(d,o,e,t,o)}},BW.prototype.updateIndeterminate=function(e,t){var i,e=this.getTreeData(e),n=0,o=(1===this.dataType&&(i=e[0][this.fields.parentID]?e[0][this.fields.parentID].toString():null),this.getChildNodes(this.treeData,i));if(o)for(var r=0;r<o.length;r++){var s=o[parseInt(r.toString(),10)][this.fields.id]?o[parseInt(r.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(s)&&n++}e=this.element.querySelector('[data-uid="'+i+'"]');e&&t||!t&&e&&-1===this.parentNodeCheck.indexOf(i)&&0!==n?this.changeState(e,"indeterminate",null):!t&&e&&-1===this.parentNodeCheck.indexOf(i)&&0===n?this.changeState(e,"uncheck",null):e||(t||-1!==this.checkedNodes.indexOf(i)||-1===this.parentNodeCheck.indexOf(i)?(t&&-1===this.checkedNodes.indexOf(i)&&-1===this.parentNodeCheck.indexOf(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)},BW.prototype.updateChildIndeterminate=function(e,t,i,n,o){for(var r=0,s=0;s<e.length;s++){var a=e[parseInt(s.toString(),10)][this.fields.id]?e[parseInt(s.toString(),10)][this.fields.id].toString():"",l=(-1!==this.checkedNodes.indexOf(a)&&r++,this.element.querySelector('[data-uid="'+t+'"]')),h=l?ge("."+pW,l):null,d=l?ge("."+dW,l):null,p=this.element.querySelector('[data-uid="'+a+'"]'),c=p?ge("."+dW,p):null,d=(-1!==this.checkedNodes.indexOf(i)&&l&&a===i&&this.autoCheck?this.changeState(l,"indeterminate",null):-1!==this.checkedNodes.indexOf(i)||!l||p||a!==i||n?-1===this.checkedNodes.indexOf(i)&&p&&a===i&&!n?this.changeState(p,"uncheck",null):-1===this.checkedNodes.indexOf(i)&&h&&a===i&&this.autoCheck&&0===r&&!n?h.classList.remove(pW):-1===this.checkedNodes.indexOf(i)&&!p&&d&&a===i&&0===r?this.changeState(l,"uncheck",null):-1===this.checkedNodes.indexOf(a)&&p&&c&&0===r?this.changeState(p,"uncheck",null):(!p&&!l&&a===i||-1!==this.parentNodeCheck.indexOf(t)&&this.autoCheck)&&(h=this.element.querySelector('[data-uid="'+o+'"]'),n&&0!==r?this.changeState(h,"indeterminate",null):n&&r===e.length&&-1===this.checkedNodes.indexOf(t)?this.checkDisabledState(t):n||0!==r||-1===this.parentNodeCheck.indexOf(t)||this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(t)),-1===this.parentNodeCheck.indexOf(t))&&this.parentNodeCheck.push(t):!this.autoCheck&&0!==r?this.changeState(l,"indeterminate",null):this.changeState(l,"uncheck",null),R(this.fields.child.toString(),e[parseInt(s.toString(),10)]));d&&this.updateChildIndeterminate(d,a,i,n,o)}},BW.prototype.changeState=function(t,i,n,o,r,s){var e,a=this,l=z(t,"."+V5);!this.checkDisabledChildren&&l&&(l.classList.contains(hW)||this.disableNode&&-1!==this.disableNode.indexOf(l.getAttribute("data-uid")))||(t===l&&(t=ge("."+cW,l)),o?this.nodeCheckAction(t,i,l,e,n,o,r,s):(this.checkActionNodes=[],e=this.getCheckEvent(l,i,n),this.trigger("nodeChecking",e,function(e){e.cancel||a.nodeCheckAction(t,i,l,e,n,o,r,s)})))},BW.prototype.nodeCheckAction=function(e,t,i,n,o,r,s,a){var l,e=e.getElementsByClassName(uW)[0];"check"!==t||e.classList.contains(dW)?"uncheck"===t&&(e.classList.contains(dW)||e.classList.contains(pW))?(q([e],[dW,pW]),this.removeCheck(i),l="false"):"indeterminate"===t&&this.autoCheck&&(e.classList.remove(dW),e.classList.add(pW),this.removeCheck(i),l="mixed"):(e.classList.remove(pW),e.classList.add(dW),this.addCheck(i),l="true"),je(l="check"===t?"true":"uncheck"===t?"false":l)||i.setAttribute("aria-checked",l),s&&(e=[].concat([],this.checkActionNodes),n=this.getCheckEvent(i,t,o),ee(r))&&(n.data=e),void 0!==a&&this.ensureStateChange(i,a),r||je(l)||(i.setAttribute("aria-checked",l),n.data[0].checked=l,this.trigger("nodeChecked",n),this.checkActionNodes=[])},BW.prototype.addCheck=function(e){e=e.getAttribute("data-uid");je(e)||-1!==this.checkedNodes.indexOf(e)||this.checkDisabledState(e)},BW.prototype.removeCheck=function(e){e=this.checkedNodes.indexOf(e.getAttribute("data-uid"));-1<e&&this.checkedNodes.splice(e,1)},BW.prototype.getCheckEvent=function(e,t,i){this.checkActionNodes.push(this.getNodeData(e));var n=this.checkActionNodes;return{action:t,cancel:!1,isInteracted:!je(i),node:e,data:n}},BW.prototype.finalize=function(){var e=ge("."+H5,this.element);je(e)||(e.setAttribute("role",wW.treeRole),this.setMultiSelect(this.allowMultiSelection),this.setNodeFocusable(),this.allowTextWrap&&this.updateWrap(),this.renderReactTemplates(),this.hasPid=!!this.rootData[0]&&Object.prototype.hasOwnProperty.call(this.rootData[0],this.fields.parentID),this.doExpandAction())},BW.prototype.setTextWrap=function(){(this.allowTextWrap?U:q)([this.element],"e-text-wrap"),F.isIE&&(this.allowTextWrap?U:q)([this.element],"e-ie-wrap")},BW.prototype.updateWrap=function(e){if(this.fullRowSelect)for(var t=e?ct("."+V5,e):this.liList,i=t.length,n=0;n<i;n++)this.calculateWrap(t[parseInt(n.toString(),10)])},BW.prototype.calculateWrap=function(e){e=ge("."+rW,e);e&&e.nextElementSibling&&(e.style.height=this.allowTextWrap?e.nextElementSibling.offsetHeight+"px":"")},BW.prototype.doExpandAction=function(){var t=this,e=this.expandedNodes;if(!this.loadOnDemand&&this.fields.dataSource instanceof me&&(this.isInitalExpand=0<this.treeData.filter(function(e){return!0===e[t.fields.expanded]}).length||this.isInitalExpand),this.isInitalExpand&&0<e.length)if(this.setProperties({expandedNodes:[]},!0),this.fields.dataSource instanceof me)this.expandGivenNodes(e);else{for(var i=0;i<e.length;i++){var n,o=ge('[data-uid="'+e[parseInt(i.toString(),10)]+'"]',this.element);je(o)?e[parseInt(i.toString(),10)]&&-1===this.expandChildren.indexOf(e[parseInt(i.toString(),10)])&&this.expandChildren.push(e[parseInt(i.toString(),10)].toString()):je(n=ge("."+N5,ge("."+q5,o)))||this.expandAction(o,n,null)}this.afterFinalized()}else this.afterFinalized()},BW.prototype.expandGivenNodes=function(e){var t=this;this.expandCallback(e[this.index],function(){t.index++,t.index<e.length?t.expandGivenNodes(e):t.afterFinalized()}),0<this.index&&(this.index=0)},BW.prototype.expandCallback=function(e,t){var i,e=ge('[data-uid="'+e+'"]',this.element);je(e)||je(i=ge("."+N5,ge("."+q5,e)))||this.expandAction(e,i,null,!1,t),t()},BW.prototype.afterFinalized=function(){var e;this.doSelectionAction(),this.updateCheckedProp(),this.isAnimate=!0,this.isInitalExpand=!1,this.isLoaded&&!this.isFieldChange||this.isNodeDropped||(e={data:this.treeData},this.trigger("dataBound",e)),this.isLoaded=!0,this.isNodeDropped=!1},BW.prototype.doSelectionAction=function(){var e=ct("."+sW,this.element),t=this.selectedNodes;if(0<t.length){this.setProperties({selectedNodes:[]},!0);for(var i=0;i<t.length;i++){var n=ge('[data-uid="'+t[parseInt(i.toString(),10)]+'"]',this.element);if(n&&!n.classList.contains("e-active")?this.selectNode(n,null,!0):this.selectedNodes.push(t[parseInt(i.toString(),10)]),!this.allowMultiSelection)break}}else this.selectGivenNodes(e);q(e,sW)},BW.prototype.selectGivenNodes=function(e){for(var t=0;t<e.length&&(e[parseInt(t.toString(),10)].classList.contains("e-disable")||this.selectNode(e[parseInt(t.toString(),10)],null,!0),this.allowMultiSelection);t++);},BW.prototype.clickHandler=function(e){var t=F.isDevice&&e.originalEvent.changedTouches&&!F.isIos?document.elementFromPoint(e.originalEvent.changedTouches[0].clientX,e.originalEvent.changedTouches[0].clientY):e.originalEvent.target;if(E.remove(this.element,"contextmenu",this.preventContextMenu),t&&!this.dragStartAction){var i=t.classList,n=z(t,"."+V5);if(n&&(!n.classList.contains(bW)||i.contains(N5)||i.contains(O5))){if(3!==e.originalEvent.which){var o=ge(".e-ripple-element",n),r=ge("."+U5,n);if(this.removeHover(),this.setFocusElement(n),this.showCheckBox&&!n.classList.contains("e-disable")){var s,a=z(t,"."+cW);if(!je(a))return s=ge("."+uW,a),this.validateCheckNode(a,s.classList.contains(dW),n,e.originalEvent),void this.triggerClickEvent(e.originalEvent,n)}i.contains(N5)?this.expandAction(n,t,e):i.contains(O5)?this.collapseNode(n,t,e):o&&r?r.classList.contains(gW)&&r.classList.contains(N5)?this.expandAction(n,r,e):r.classList.contains(gW)&&r.classList.contains(O5)?this.collapseNode(n,r,e):i.contains(H5)||i.contains(V5)||this.toggleSelect(n,e.originalEvent,!1):i.contains(H5)||i.contains(V5)||this.toggleSelect(n,e.originalEvent,!1)}3===e.originalEvent.which&&(this.isRightClick=!0),this.triggerClickEvent(e.originalEvent,n)}}},BW.prototype.nodeCheckedEvent=function(e,t,i){e=this.getCheckEvent(e,t?"uncheck":"check",i);e.data=e.data.splice(0,e.data.length-1),this.trigger("nodeChecked",e)},BW.prototype.updateOldCheckedData=function(e){var t,i=this,e=new me(e),n=e.executeLocal((new ya).where("isChecked","equal","true",!0)),o=e.executeLocal((new ya).where("isChecked","equal","false",!0));if(0<o.length&&-1!==(t=this.OldCheckedData.findIndex(function(e){return e.id===o[0].id})))return this.OldCheckedData.splice(t,1),void(0<(e=this.OldCheckedData.filter(function(e){return e.parentID===o[0].id})).length&&e.forEach(function(t){var e=i.OldCheckedData.findIndex(function(e){return e.id===t.id});-1!==e&&i.OldCheckedData.splice(e,1)}));0<n.length&&-1===(t=this.OldCheckedData.findIndex(function(e){return e.id===n[0].id}))&&this.OldCheckedData.push(n[0])},BW.prototype.triggerClickEvent=function(e,t){this.trigger("nodeClicked",{event:e,node:t})},BW.prototype.expandNode=function(e,t,i){var n,o,r,s,a,l=this;this.renderReactTemplates(),t.classList.contains(W5)&&this.hideSpinner(t),this.initialRender||t.classList.add("interaction"),!0!==i||!0===i&&e.classList.contains("e-expanded")?!0!==this.preventExpand&&(q([t],N5),U([t],O5),o=n=0,r=ge("."+H5,e),s=e,this.isAnimate&&!this.isRefreshed?(this.setHeight(s,r),a=ge("."+V5+"."+j5,e),this.aniObj.animate(r,{name:this.animation.expand.effect,duration:0===this.animation.expand.duration&&"Enable"===Ut?400:this.animation.expand.duration,timingFunction:this.animation.expand.easing,begin:function(){s.style.overflow="hidden",!je(a)&&a instanceof HTMLElement&&a.classList.add(yW),n=s.offsetHeight,o=ge("."+q5,e).offsetHeight},progress:function(e){e.element.style.display="block",l.animateHeight(e,n,o)},end:function(e){e.element.style.display="block",!je(a)&&a instanceof HTMLElement&&a.classList.remove(yW),l.expandedNode(s,r,t)}})):this.expandedNode(s,r,t)):(ge("."+H5,e).style.display="none",this.fields.dataSource instanceof me==!0&&(this.preventExpand=!1)),this.initialRender&&t.classList.add("interaction")},BW.prototype.expandedNode=function(e,t,i){t.style.display="block",e.style.display="block",e.style.overflow="",e.style.height="",q([i],Q5),this.addExpand(e),this.allowTextWrap&&this.isLoaded&&this.isFirstRender&&(this.updateWrap(e),this.isFirstRender=!1),this.isLoaded&&this.expandArgs&&!this.isRefreshed&&(this.expandArgs=this.getExpandEvent(e,null),this.expandArgs.isInteracted=this.isInteracted,this.trigger("nodeExpanded",this.expandArgs)),this.isHiddenItem&&this.collapseAll([this.getNodeData(e).id])},BW.prototype.addExpand=function(e){e.setAttribute("aria-expanded","true"),q([e],lW);e=e.getAttribute("data-uid");je(e)||-1!==this.expandedNodes.indexOf(e)||this.expandedNodes.push(e)},BW.prototype.collapseNode=function(t,i,e){var n,o=this;i.classList.contains(Q5)||(U([i],Q5),this.isLoaded?(n=this.getExpandEvent(t,e),this.isInteracted=n.isInteracted,this.trigger("nodeCollapsing",n,function(e){e.cancel?q([i],Q5):o.nodeCollapseAction(t,i,e)})):this.nodeCollapseAction(t,i,n))},BW.prototype.nodeCollapseAction=function(e,t,i){var n=this,o=(q([t],O5),U([t],N5),0),r=0,s=ge("."+H5,e),a=e,l=ge("."+V5+"."+j5,e);this.isAnimate?this.aniObj.animate(s,{name:this.animation.collapse.effect,duration:0===this.animation.collapse.duration&&"Enable"===Ut?400:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing,begin:function(){a.style.overflow="hidden",!je(l)&&l instanceof HTMLElement&&l.classList.add(yW),o=ge("."+q5,e).offsetHeight,r=a.offsetHeight},progress:function(e){n.animateHeight(e,o,r)},end:function(e){e.element.style.display="none",!je(l)&&l instanceof HTMLElement&&l.classList.remove(yW),n.collapsedNode(a,s,t,i)}}):this.collapsedNode(a,s,t,i)},BW.prototype.collapsedNode=function(e,t,i,n){t.style.display="none",e.style.overflow="",e.style.height="",q([i],Q5),this.removeExpand(e),this.isLoaded&&((n=this.getExpandEvent(e,null)).isInteracted=this.isInteracted,this.trigger("nodeCollapsed",n))},BW.prototype.removeExpand=function(e,t){t?e.removeAttribute("aria-expanded"):this.disableExpandAttr(e);t=this.expandedNodes.indexOf(e.getAttribute("data-uid"));-1<t&&this.expandedNodes.splice(t,1)},BW.prototype.disableExpandAttr=function(e){e.setAttribute("aria-expanded","false"),U([e],lW)},BW.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=""},BW.prototype.animateHeight=function(e,t,i){var n;je(e.element.parentElement)||(n=(e.duration-e.timeStamp)/e.duration,e.element.parentElement.style.height=(i-t)*n+t+"px")},BW.prototype.renderChildNodes=function(t,i,n,o,e){var r,s,a,l=this,h=ge("div."+U5,t);je(h)||(this.showSpinner(h),this.fields.dataSource instanceof me?(s=this.parents(t,"."+H5).length,je(a=this.getChildFields(this.fields,s,1))||je(a.dataSource)?(G(h),this.removeExpand(t,!0)):(this.treeList.push("false"),this.fields.dataSource instanceof me&&this.isOffline?(this.treeList.pop(),r=this.getChildNodes(this.treeData,t.getAttribute("data-uid")),this.loadChild(r,a,h,t,i,n,o)):a.dataSource.executeQuery(this.getQuery(a,t.getAttribute("data-uid"))).then(function(e){l.treeList.pop(),r=e.result,1===l.dataType&&(l.dataType=2),l.loadChild(r,a,h,t,i,n,o)}).catch(function(e){l.trigger("actionFailure",{error:e})}))):(r=this.getChildNodes(this.treeData,t.getAttribute("data-uid"),!1,parseFloat(t.getAttribute("aria-level"))+1),this.currentLoadData=this.getSortedData(r),je(r)||0===r.length?(G(h),h.classList.contains(W5)&&this.hideSpinner(h),this.removeExpand(t,!0)):(this.listBaseOption.ariaAttributes.level=parseFloat(t.getAttribute("aria-level"))+1,t.appendChild(X_.createList(this.createElement,this.currentLoadData,this.listBaseOption)),this.expandNode(t,h,o),this.setSelectionForChildNodes(r),this.ensureCheckNode(t,e),this.finalizeNode(t,e,i),this.disableTreeNodes(r),this.renderSubChild(t,i,o,e))))},BW.prototype.loadChild=function(e,t,i,n,o,r,s){je(this.currentLoadData=e)||0===e.length?(G(i),this.removeExpand(n,!0)):(this.updateListProp(t),this.fields.dataSource instanceof me&&!this.isOffline&&(t=n.getAttribute("data-uid"),x("child",e,this.getNodeObject(t))),this.listBaseOption.ariaAttributes.level=parseFloat(n.getAttribute("aria-level"))+1,n.appendChild(X_.createList(this.createElement,e,this.listBaseOption)),this.expandNode(n,i,s),this.setSelectionForChildNodes(e),this.ensureCheckNode(n),this.finalizeNode(n),this.disableTreeNodes(e),this.renderSubChild(n,o,s)),r&&r(),o&&this.expandedNodes.push(n.getAttribute("data-uid")),0!==this.treeList.length||this.isLoaded||this.finalize()},BW.prototype.disableTreeNodes=function(e){if(!je(this.disableNode)&&0!==this.disableNode.length)for(var t=0;t<e.length;){var i=e[parseInt(t.toString(),10)][this.fields.id]?e[parseInt(t.toString(),10)][this.fields.id].toString():null;void 0!==this.disableNode&&-1!==this.disableNode.indexOf(i)&&this.doDisableAction([i]),t++}},BW.prototype.setSelectionForChildNodes=function(e){if(!je(this.selectedNodes)&&0!==this.selectedNodes.length)for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)][this.fields.id]?e[parseInt(t.toString(),10)][this.fields.id].toString():null;void 0!==this.selectedNodes&&-1!==this.selectedNodes.indexOf(i)&&this.doSelectionAction()}},BW.prototype.ensureCheckNode=function(e,t){this.showCheckBox&&(this.ele=this.checkedElement?this.checkedElement.indexOf(e.getAttribute("data-uid")):null,this.autoCheck)&&(this.ensureChildCheckState(e,null,t),t&&!ge("."+dW,this.element)&&!ge("."+pW,this.element)||this.ensureParentCheckState(e)),this.currentLoadData=null},BW.prototype.getFields=function(e,t,i){return t===i?e:this.getFields(this.getChildMapper(e),t,i+1)},BW.prototype.getChildFields=function(e,t,i){return t===i?this.getChildMapper(e):this.getChildFields(this.getChildMapper(e),t,i+1)},BW.prototype.getChildMapper=function(e){return"string"==typeof e.child||je(e.child)?e:e.child},BW.prototype.getChildNodes=function(e,t,i,n){var o,r=this;if(void 0===i&&(i=!1),!je(e)){if(1===this.dataType)return this.getChildGroup(this.groupedData,t,i);if("string"==typeof this.fields.child)return this.findChildNodes(e,this.fields.id,t)||this.findNestedChildNodes(e,t,n)||[];if(this.isChildObject()){for(var s=je(n)?this.fields.child:this.fields,a=1;a<n&&!je(s.child);)s=s.child,a++;this.updateListProp(s);i=e.findIndex(function(e){return R(r.fields.id,e)&&R(r.fields.id,e).toString()===t});if(-1!==i)return R("child",e[parseInt(i.toString(),10)]);if(-1===i)for(var l=0,h=e.length;l<h;l++){var d=R("child",e[parseInt(l.toString(),10)]),p=je(d)?-1:d.findIndex(function(e){return R(r.fields.child.id,e)&&R(r.fields.child.id,e).toString()===t});if(-1!==p)return R("child",d[parseInt(p.toString(),10)]);if(!je(d)&&void 0!==(o=this.getChildNodes(d,t,!1,n)))break}}}return o},BW.prototype.findChildNodes=function(e,t,i){var n=e.findIndex(function(e){e=R(t,e);return e&&e.toString()===i});return-1!==n?R(this.fields.child,e[n]):null},BW.prototype.findNestedChildNodes=function(e,t,i){for(var n=0,o=e;n<o.length;n++){var r=o[n],r=R(this.fields.child,r);if(!je(r)){var s=this.findChildNodes(r,this.fields.id,t);if(s)return s;s=this.getChildNodes(r,t,!1,i);if(s&&0<s.length)return s}}},BW.prototype.getChildGroup=function(e,t,i){if(!je(e))for(var n=0,o=e.length;n<o;n++){if(je(e[parseInt(n.toString(),10)][0])||je(R(this.fields.parentID,e[parseInt(n.toString(),10)][0])))return i?e[parseInt(n.toString(),10)]:[];if(R(this.fields.parentID,e[parseInt(n.toString(),10)][0]).toString()===t)return e[parseInt(n.toString(),10)]}},BW.prototype.renderSubChild=function(e,t,i,n){if(t)for(var o=ct("."+N5,e),r=0,s=o.length;r<s;r++){var a=o[parseInt(r.toString(),10)];e.querySelector(".e-icons")!==o[parseInt(r.toString(),10)]&&(a=z(a,"."+V5),this.expandArgs=this.getExpandEvent(a,null),!0!==i&&this.trigger("nodeExpanding",this.expandArgs),this.renderChildNodes(a,t,null,i,n))}},BW.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))},BW.prototype.isActive=function(e){return!!e.classList.contains(j5)},BW.prototype.selectNode=function(t,i,n){var e,o=this;je(t)||!this.allowMultiSelection&&this.isActive(t)&&!je(i)?this.setFocusElement(t):this.isLoaded?(e=this.getSelectEvent(t,"select",i),this.trigger("nodeSelecting",e,function(e){e.cancel||e.node.classList.contains(bW)||o.nodeSelectAction(t,i,e,n)})):this.nodeSelectAction(t,i,e,n)},BW.prototype.nodeSelectAction=function(e,t,i,n){if(this.allowMultiSelection&&(n||t&&(t.ctrlKey||t.metaKey))||this.removeSelectAll(),this.allowMultiSelection&&t&&t.shiftKey){this.startNode||(this.startNode=e);var n=this.liList.indexOf(this.startNode),o=this.liList.indexOf(e);o<n&&(t=n,n=o,o=t);for(var r=n;r<=o;r++){var s=this.liList[parseInt(r.toString(),10)];at(s)&&!s.classList.contains("e-disable")&&this.addSelect(s)}}else this.startNode=e,this.addSelect(e);this.isLoaded&&(i.nodeData=this.getNodeData(e),this.trigger("nodeSelected",i),this.isRightClick=!1),this.isRightClick=!1},BW.prototype.unselectNode=function(t,e){var i,n=this;this.isLoaded?(i=this.getSelectEvent(t,"un-select",e),this.trigger("nodeSelecting",i,function(e){e.cancel||n.nodeUnselectAction(t,e)})):this.nodeUnselectAction(t,i)},BW.prototype.nodeUnselectAction=function(e,t){this.removeSelect(e),this.setFocusElement(e),this.isLoaded&&(t.nodeData=this.getNodeData(e),this.trigger("nodeSelected",t))},BW.prototype.setFocusElement=function(e){var t;je(e)||((t=this.getFocusedNode())&&(q([t],mW),t.setAttribute("tabindex","-1")),U([e],mW),e.setAttribute("tabindex","0"),E.add(e,"blur",this.focusOut,this),this.updateIdAttr(t,e))},BW.prototype.addSelect=function(e){e.setAttribute("aria-selected","true"),U([e],j5);e=e.getAttribute("data-uid");je(e)||-1!==this.selectedNodes.indexOf(e)||this.selectedNodes.push(e)},BW.prototype.removeSelect=function(e){this.allowMultiSelection?e.setAttribute("aria-selected","false"):e.removeAttribute("aria-selected"),q([e],j5);e=this.selectedNodes.indexOf(e.getAttribute("data-uid"));-1<e&&this.selectedNodes.splice(e,1)},BW.prototype.removeSelectAll=function(){for(var e=this.element.querySelectorAll("."+j5),t=0,i=e;t<i.length;t++){var n=i[t];this.allowMultiSelection?n.setAttribute("aria-selected","false"):n.removeAttribute("aria-selected")}q(e,j5),this.setProperties({selectedNodes:[]},!0)},BW.prototype.getSelectEvent=function(e,t,i){var n=this.getNodeData(e);return{action:t,cancel:!1,isInteracted:!je(i),node:e,nodeData:n}},BW.prototype.setExpandOnType=function(){this.expandOnType="Auto"===this.expandOn?F.isDevice?"Click":"DblClick":this.expandOn},BW.prototype.expandHandler=function(e){var t=F.isDevice&&e.originalEvent.changedTouches&&!F.isIos?document.elementFromPoint(e.originalEvent.changedTouches[0].clientX,e.originalEvent.changedTouches[0].clientY):e.originalEvent.target;!t||t.classList.contains(G5)||t.classList.contains(L5)||t.classList.contains(H5)||t.classList.contains(V5)||t.classList.contains(U5)||this.showCheckBox&&z(t,"."+cW)||this.expandCollapseAction(z(t,"."+V5),e)},BW.prototype.expandCollapseAction=function(e,t){var i,n=ge("div."+U5,e);n&&!n.classList.contains(Q5)&&((i=n.classList).contains(N5)?this.expandAction(e,n,t):i.contains(O5)&&this.collapseNode(e,n,t))},BW.prototype.expandAction=function(t,i,e,n,o,r){var s=this;i.classList.contains(Q5)||(U([i],Q5),this.isLoaded&&!this.isRefreshed?(this.expandArgs=this.getExpandEvent(t,e),this.isInteracted=this.expandArgs.isInteracted,this.trigger("nodeExpanding",this.expandArgs,function(e){e.cancel?q([i],Q5):s.nodeExpandAction(t,i,n,o,r)})):this.nodeExpandAction(t,i,n,o,r))},BW.prototype.nodeExpandAction=function(e,t,i,n,o){var r=ge("."+H5,e);if(r&&"UL"===r.nodeName)this.expandNode(e,t);else{this.isFirstRender=!0,this.renderChildNodes(e,i,n,null,o);for(var s=ct("."+V5,e),a=0;a<s.length;a++){var l,h=this.getId(s[parseInt(a.toString(),10)]);-1!==this.expandChildren.indexOf(h)&&void 0!==this.expandChildren&&(je(l=ge("."+N5,ge("."+q5,s[parseInt(a.toString(),10)])))||this.expandAction(s[parseInt(a.toString(),10)],l,null),this.expandChildren.splice(this.expandChildren.indexOf(h),1))}}},BW.prototype.keyActionHandler=function(i){var n=this,e=i.target,o=this.getFocusedNode();e&&e.classList.contains(G5)?(e=e,"enter"===i.action?e.blur():"escape"===i.action&&(e.value=this.oldText,e.blur())):(i.preventDefault(),e={cancel:!1,event:i,node:o},this.trigger("keyPress",e,function(e){if(!e.cancel)switch(i.action){case"space":n.showCheckBox?n.checkNode(i):n.toggleSelect(o,i);break;case"moveRight":n.openNode(!n.enableRtl,i);break;case"moveLeft":n.openNode(!!n.enableRtl,i);break;case"shiftDown":n.shiftKeySelect(!0,i);break;case"moveDown":case"ctrlDown":case"csDown":n.navigateNode(!0);break;case"shiftUp":n.shiftKeySelect(!1,i);break;case"moveUp":case"ctrlUp":case"csUp":n.navigateNode(!1);break;case"home":case"shiftHome":case"ctrlHome":case"csHome":n.navigateRootNode(!0);break;case"end":case"shiftEnd":case"ctrlEnd":case"csEnd":n.navigateRootNode(!1);break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":case"shiftSpace":case"ctrlSpace":n.toggleSelect(o,i);break;case"f2":n.allowEditing&&!o.classList.contains("e-disable")&&n.createTextbox(o);break;case"ctrlA":var t;n.allowMultiSelection&&(t=ct("."+V5+":not(."+j5+")",n.element),n.selectGivenNodes(t))}}))},BW.prototype.navigateToFocus=function(e){var t,i=this.getFocusedNode().querySelector("."+q5),n=i.getBoundingClientRect(),o=this.getScrollParent(this.element);je(o)||(t=o.getBoundingClientRect(),n.bottom>t.bottom?o.scrollTop+=n.bottom-t.bottom:n.top<t.top&&(o.scrollTop-=t.top-n.top)),this.isVisibleInViewport(i)||i.scrollIntoView(e)},BW.prototype.isVisibleInViewport=function(e){e=e.getBoundingClientRect();return 0<=e.top&&0<=e.left&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)},BW.prototype.getScrollParent=function(e){return je(e)?null:e.scrollHeight>e.clientHeight?e:this.getScrollParent(e.parentElement)},BW.prototype.shiftKeySelect=function(e,t){var i;this.allowMultiSelection?(i=this.getFocusedNode(),i=e?this.getNextNode(i):this.getPrevNode(i),this.removeHover(),this.setFocusElement(i),this.toggleSelect(i,t,!1),this.navigateToFocus(!e)):this.navigateNode(e)},BW.prototype.checkNode=function(e){var t=this.getFocusedNode(),i=ge("."+cW,t),n=ge(" ."+uW,i).classList.contains(dW);t.classList.contains("e-disable")||0===t.getElementsByClassName("e-checkbox-disabled").length&&this.validateCheckNode(i,n,t,e)},BW.prototype.validateCheckNode=function(t,i,n,o){var r=this,e=z(t,"."+V5),s=(this.checkActionNodes=[],i?"false":"true"),s=(je(s)||e.setAttribute("aria-checked",s),this.getCheckEvent(e,i?"uncheck":"check",o));this.trigger("nodeChecking",s,function(e){e.cancel||r.nodeCheckingAction(t,i,n,e,o)})},BW.prototype.nodeCheckingAction=function(e,t,i,n,o){var r;-1===this.checkedElement.indexOf(i.getAttribute("data-uid"))&&(this.checkedElement.push(i.getAttribute("data-uid")),this.autoCheck)&&(null!==(r=this.getChildNodes(this.treeData,i.getAttribute("data-uid")))?this.allCheckNode(r,this.checkedElement,null,null,!1):r=null),this.changeState(e,t?"uncheck":"check",o,!0),this.autoCheck&&(this.ensureChildCheckState(i),this.updateOldCheckedData([this.getNodeData(i)]),this.ensureParentCheckState(z(z(i,"."+H5),"."+V5)),r=void 0,"check"===n.action?r=!0:"uncheck"===n.action&&(r=!1),this.ensureStateChange(i,r)),this.nodeCheckedEvent(e,t,o)},BW.prototype.ensureStateChange=function(e,t){var i=this,n=ge("."+H5,e),o=e.getAttribute("data-uid"),r=this.fields;if(1===this.dataType&&this.autoCheck){var s=new me(this.treeData).executeLocal((new ya).where(r.parentID,"equal",o,!0)),e=s.filter(function(e){return-1!==i.checkedNodes.indexOf(e[r.id].toString())},this);-1!==this.checkedNodes.indexOf(o)&&e.length!==s.length&&this.isFilter&&0<e.length&&(s=e);for(var a=0;a<s.length;a++){var l,h=s[parseInt(a.toString(),10)][this.fields.id]?s[parseInt(a.toString(),10)][this.fields.id].toString():null,d=s[parseInt(a.toString(),10)][this.fields.isChecked]?s[parseInt(a.toString(),10)][this.fields.isChecked].toString():null;-1!==this.checkedNodes.indexOf(o)&&-1===this.checkedNodes.indexOf(h)?(this.checkDisabledState(h,s[a]),l=this.getChildNodes(this.treeData,h),this.getChildItems(l,t),-1!==this.parentNodeCheck.indexOf(h)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)):-1===this.checkedNodes.indexOf(o)&&null===n&&-1!==this.checkedNodes.indexOf(h)?(this.checkedNodes.splice(this.checkedNodes.indexOf(h),1),"true"===d&&this.updateField(this.treeData,this.fields,h,"isChecked",null),(-1===this.checkedNodes.indexOf(o)&&null===n||-1!==this.parentNodeCheck.indexOf(h))&&(d=this.getChildNodes(this.treeData,h),this.getChildItems(d,t),-1!==this.parentNodeCheck.indexOf(h))&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)):(l=this.getChildNodes(this.treeData,h),this.getChildItems(l,t))}}else if(1!==this.dataType||this.autoCheck)(l=this.getChildNodes(this.treeData,o))&&(0<(e=l.filter(function(e){e=String(e[Object.keys(e)[0]]);return-1!==i.checkedNodes.indexOf(e)})).length&&l.length&&this.isFilter&&(l=e),this.childStateChange(l,o,n,t));else if(t)for(a=0;a<this.treeData.length;a++){var p=this.treeData[parseInt(a.toString(),10)][this.fields.id]?this.treeData[parseInt(a.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(p)&&this.checkDisabledState(p,this.treeData[a])}else{for(var c=new me(this.treeData).executeLocal((new ya).where(r.isChecked,"equal",!0,!1)),a=0;a<c.length;a++){var u=c[parseInt(a.toString(),10)][this.fields.id]?c[parseInt(a.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(u)&&this.checkedNodes.splice(this.checkedNodes.indexOf(u),1),this.updateField(this.treeData,this.fields,u,"isChecked",null)}this.checkedNodes=[]}},BW.prototype.checkDisabledState=function(e,t){var i,n=this.checkDisabledChildren;n||(i=!0,this.loadOnDemand&&this.fields.htmlAttributes&&(t=je(t)?t:this.getNodeObject(e),je(t)||(t=t[this.fields.htmlAttributes])&&!je(t.class)&&-1!==t.class.indexOf(hW)&&(i=!1)),n=(t=ge('[data-uid="'+e+'"]',this.element))?!t.classList.contains(hW):-1===this.disableNode.indexOf(e)&&i),n&&this.checkedNodes.push(e)},BW.prototype.getChildItems=function(e,t){for(var i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null,o=e[parseInt(i.toString(),10)][this.fields.isChecked]?e[parseInt(i.toString(),10)][this.fields.isChecked].toString():null,o=(-1===this.checkedNodes.indexOf(n)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(n),1),-1===this.checkedNodes.indexOf(n)&&t&&this.checkDisabledState(n,e[i]),"true"!==o||t||this.updateField(this.treeData,this.fields,n,"isChecked",null),this.getChildNodes(this.treeData,n));0<o.length&&this.getChildItems(o,t)}},BW.prototype.childStateChange=function(e,t,i,n){for(var o=0;o<e.length;o++){var r=e[parseInt(o.toString(),10)][this.fields.id]?e[parseInt(o.toString(),10)][this.fields.id].toString():"",s=e[parseInt(o.toString(),10)][this.fields.isChecked]?e[parseInt(o.toString(),10)][this.fields.isChecked].toString():null,s=(this.autoCheck?-1!==this.checkedNodes.indexOf(t)&&-1===this.checkedNodes.indexOf(r)?(this.checkDisabledState(r,e[o]),-1!==this.parentNodeCheck.indexOf(r)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(r),1)):-1!==this.checkedNodes.indexOf(t)||-1===this.checkedNodes.indexOf(r)||n||(this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),"true"===s&&this.updateField(this.treeData,this.fields,r,"isChecked",null)):this.autoCheck||(n?-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r,e[o]):(-1!==this.checkedNodes.indexOf(r)&&this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),this.updateField(this.treeData,this.fields,r,"isChecked",null),this.checkedNodes=[])),this.getChildNodes([e[parseInt(o.toString(),10)]],r));s&&this.childStateChange(s,t,i,n)}},BW.prototype.allCheckNode=function(e,t,i,n,o){if(e)for(var r=0;r<e.length;r++){var s,a=R(this.fields.id,e[parseInt(r.toString(),10)]),l=this.element.querySelector('[data-uid="'+a+'"]'),l=(!1===o||-1!==this.checkedElement.indexOf(a.toString())||(null!==l||je(e[parseInt(r.toString(),10)][this.fields.isChecked])||-1!==t.indexOf(a.toString()))&&0!==n&&2!==i||(!1!==e[parseInt(r.toString(),10)][this.fields.isChecked]||2===i?t.push(a.toString()):n=null,n=!1!==e[parseInt(r.toString(),10)][this.fields.isChecked]||2===i?0:null),-1===t.indexOf(a.toString())&&je(i)&&t.push(a.toString()),R(this.fields.child.toString(),e[parseInt(r.toString(),10)]));(!0===R(this.fields.hasChildren,e[parseInt(r.toString(),10)])||l)&&(a=R(this.fields.id,e[parseInt(r.toString(),10)]),s=void 0,s=1===this.dataType?this.getChildNodes(this.treeData,a.toString()):l)&&(je(o)?this.allCheckNode(s,t,i,n):this.allCheckNode(s,t,i,n,o),n=null),n=null}},BW.prototype.openNode=function(e,t){var i=this.getFocusedNode(),n=ge("div."+U5,i);e?n&&(n.classList.contains(N5)?this.expandAction(i,n,t):this.focusNextNode(i,!0)):n&&n.classList.contains(O5)?this.collapseNode(i,n,t):(e=z(z(i,"."+H5),"."+V5))&&!e.classList.contains("e-disable")&&(this.setFocus(i,e),this.navigateToFocus(!0))},BW.prototype.navigateNode=function(e){var t=this.getFocusedNode();this.focusNextNode(t,e)},BW.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))},BW.prototype.getFocusedNode=function(){var e,t,i=ge("."+V5+'[tabindex="0"]',this.element);return je(i)||"mixed"!==(t=i.getAttribute("aria-checked"))&&"false"!==t||(this.isFilter=!1),je(i)&&(e=ge("."+V5,this.element)),je(i)?je(e)?this.element.firstElementChild:e:i},BW.prototype.focusNextNode=function(e,t){var i=t?this.getNextNode(e):this.getPrevNode(e);this.setFocus(e,i),this.navigateToFocus(!t),i.classList.contains("e-disable")&&(e=i.lastChild,null==i.previousSibling&&i.classList.contains("e-level-1")?this.focusNextNode(i,!0):null==i.nextSibling&&i.classList.contains("e-node-collapsed")||null==i.nextSibling&&e.classList.contains(q5)?this.focusNextNode(i,!1):this.focusNextNode(i,t))},BW.prototype.getNextNode=function(e){var t,i=this.liList.indexOf(e);do{if(i++,je(t=this.liList[parseInt(i.toString(),10)]))return e}while(!at(t));return t},BW.prototype.getPrevNode=function(e){var t,i=this.liList.indexOf(e);do{if(i--,je(t=this.liList[parseInt(i.toString(),10)]))return e}while(!at(t));return t},BW.prototype.getRootNode=function(){for(var e,t=0;e=this.liList[parseInt(t.toString(),10)],t++,!at(e););return e},BW.prototype.getEndNode=function(){for(var e,t=this.liList.length-1;e=this.liList[parseInt(t.toString(),10)],t--,!at(e););return e},BW.prototype.setFocus=function(e,t){q([e],mW),e.setAttribute("tabindex","-1"),t.classList.contains("e-disable")||(U([t],mW),t.setAttribute("tabindex","0"),t.focus(),E.add(t,"blur",this.focusOut,this),this.updateIdAttr(e,t))},BW.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")},BW.prototype.focusIn=function(){var e;this.mouseDownStatus||((e=this.getFocusedNode()).classList.contains("e-disable")?(e.setAttribute("tabindex","-1"),this.navigateNode(!0)):(e.setAttribute("tabindex","0"),U([e],mW),E.add(e,"blur",this.focusOut,this)),this.mouseDownStatus=!1)},BW.prototype.focusOut=function(e){var t=this.getFocusedNode();e.target===t&&(q([t],mW),E.remove(t,"blur",this.focusOut))},BW.prototype.onMouseOver=function(e){var t;F.isDevice||(t=(e=e.target).classList,!(e=z(e,"."+V5))||t.contains(H5)||t.contains(V5)?this.removeHover():e&&!e.classList.contains("e-disable")&&this.setHover(e))},BW.prototype.setHover=function(e){e.classList.contains(z5)||e.classList.contains(bW)||(this.removeHover(),U([e],z5))},BW.prototype.onMouseLeave=function(){this.removeHover()},BW.prototype.removeHover=function(){var e=ct("."+z5,this.element);e&&e.length&&q(e,z5)},BW.prototype.getNodeData=function(e,t){var i,n,o,r,s,a,l,h;return!je(e)&&e.classList.contains(V5)&&!je(z(e,"."+R5))&&z(e,"."+R5).classList.contains(L5)?(i=e.getAttribute("data-uid"),t=this.getText(e,t),n=(n=z(e.parentNode,"."+V5))?n.getAttribute("data-uid"):null,o=e.classList.contains(j5),r=!e.classList.contains(bW),s="true"===e.getAttribute("aria-expanded"),a=null!==e.getAttribute("aria-expanded")||null!=(ge("."+N5,e)||ge("."+O5,e)),l=null,h=ge("."+cW,e),{id:i,text:t,parentID:n,selected:o,selectable:r,expanded:s,isChecked:l=this.showCheckBox&&h?e.getAttribute("aria-checked"):l,hasChildren:a}):{id:"",text:"",parentID:"",selected:!1,expanded:!1,isChecked:"",hasChildren:!1}},BW.prototype.getText=function(e,t){var i;return t?(t=this.getNodeObject(e.getAttribute("data-uid")),i=parseFloat(e.getAttribute("aria-level")),R(this.getFields(this.fields,i,1).text,t)):ge("."+_5,e).textContent},BW.prototype.getExpandEvent=function(e,t){var i=this.getNodeData(e);return{cancel:!1,isInteracted:!je(t),node:e,nodeData:i,event:t}},BW.prototype.renderNodeTemplate=function(e,t,i){e=this.nodeTemplateFn(e,this,"nodeTemplate"+i,this.element.id+"nodeTemplate",this.isStringTemplate,void 0,t,this.root);e&&ht(Array.prototype.slice.call(e),t)},BW.prototype.destroyTemplate=function(e){this.clearTemplate(["nodeTemplate"+e.getAttribute("data-uid")])},BW.prototype.reRenderNodes=function(){this.updateListProp(this.fields),F.isIE?(this.ulElement=this.element.querySelector(".e-list-parent.e-ul"),this.ulElement.parentElement.removeChild(this.ulElement)):this.element.innerHTML="",je(this.nodeTemplateFn)||this.clearTemplate(),this.setTouchClass(),this.setProperties({selectedNodes:[],checkedNodes:[],expandedNodes:[]},!0),this.checkedElement=[],this.isLoaded=!1,this.setDataBinding(!0)},BW.prototype.setCssClass=function(e,t){je(e)||""===e||q([this.element],e.split(" ")),je(t)||""===t||U([this.element],t.split(" "))},BW.prototype.editingHandler=function(e){var e=e.target;!e||e.classList.contains(L5)||e.classList.contains(H5)||e.classList.contains(V5)||e.classList.contains(U5)||e.classList.contains(G5)||e.classList.contains(Y5)||(e=z(e,"."+V5),this.createTextbox(e))},BW.prototype.createTextbox=function(i){var n=this,e=ge("."+X5,this.element),o=(e&&e.blur(),ge("."+_5,i)),e=(this.updateOldText(i),this.createElement("input",{className:X5,attrs:{value:this.oldText}})),r=this.getEditEvent(i,null,e.outerHTML);this.trigger("nodeEditing",r,function(e){var t;e.cancel||(t=o.offsetWidth+5+"px",U([i],K5),je(n.nodeTemplateFn)||n.destroyTemplate(i),n.isReact?setTimeout(function(){n.renderTextBox(r,o,t)},5):n.renderTextBox(r,o,t))})},BW.prototype.renderTextBox=function(e,t,i){t.innerHTML=e.innerHtml;e=ge("."+X5,t),this.inputObj=HF.createInput({element:e,properties:{enableRtl:this.enableRtl}},this.createElement),this.inputObj.container.style.width=i,e.focus(),t=e;t.setSelectionRange(0,t.value.length),this.wireInputEvents(e)},BW.prototype.updateOldText=function(e){var t=e.getAttribute("data-uid"),t=(this.editData=this.getNodeObject(t),parseFloat(e.getAttribute("aria-level")));this.editFields=this.getFields(this.fields,t,1),this.oldText=R(this.editFields.text,this.editData)},BW.prototype.inputFocusOut=function(e){var t,i,n;ge("."+X5,this.element)&&(t=(e=e.target).value,i=z(e,"."+_5),n=z(e,"."+V5),G(this.inputObj.container),HF.destroy({element:e,properties:this.properties}),this.fields.dataSource instanceof me&&!this.isOffline?this.crudOperation("update",null,n,t,null,null,!0):this.appendNewText(n,i,t,!0),E.remove(e,"blur",this.inputFocusOut),this.inputObj=null,G(e))},BW.prototype.appendNewText=function(t,i,n,o){var r=this,e=this.getEditEvent(t,n,null);this.trigger("nodeEdited",e,function(e){n=e.cancel?e.oldText:e.newText,r.updateText(t,i,n,o),e.oldText!==n&&r.triggerEvent("nodeEdited",[r.getNode(t)])})},BW.prototype.updateText=function(e,t,i,n){var o=x(this.editFields.text,i,this.editData);je(this.nodeTemplateFn)?this.enableHtmlSanitizer?t.innerText=go.sanitize(i):t.innerHTML=i:(t.innerText="",i=e.getAttribute("data-uid"),this.renderNodeTemplate(o,t,i),this.renderReactTemplates()),n&&(q([e],K5),e.focus(),E.add(e,"blur",this.focusOut,this),U([e],mW)),this.allowTextWrap&&this.calculateWrap(e)},BW.prototype.getElement=function(e){return je(e)?null:"string"==typeof e?this.element.querySelector('[data-uid="'+e+'"]'):"object"==typeof e?H(e):null},BW.prototype.getId=function(e){return je(e)?null:"string"==typeof e?e:"object"==typeof e?H(e).getAttribute("data-uid"):null},BW.prototype.getEditEvent=function(e,t,i){return{cancel:!1,newText:t,node:e,nodeData:this.getNodeData(e),oldText:this.oldText,innerHtml:i}},BW.prototype.getNodeObject=function(e){if(!je(e)){if(1!==this.dataType)return this.getChildNodeObject(this.treeData,this.fields,e);for(var t=0,i=this.treeData.length;t<i;t++){var n=R(this.fields.id,this.treeData[parseInt(t.toString(),10)]);if(!je(this.treeData[parseInt(t.toString(),10)])&&!je(n)&&n.toString()===e)return this.treeData[parseInt(t.toString(),10)]}}},BW.prototype.getChildNodeObject=function(e,t,i){if(!je(e))for(var n=0,o=e.length;n<o;n++){var r=R(t.id,e[parseInt(n.toString(),10)]);if(e[parseInt(n.toString(),10)]&&r&&r.toString()===i)return e[parseInt(n.toString(),10)];if("string"!=typeof t.child||je(R(t.child,e[parseInt(n.toString(),10)]))){if(this.fields.dataSource instanceof me&&!je(R("child",e[parseInt(n.toString(),10)]))){if(void 0!==(s=this.getChildNodeObject(R("child",e[parseInt(n.toString(),10)]),this.getChildMapper(t),i)))break}else if(this.isChildObject()){a=R("child",e[parseInt(n.toString(),10)]);if(void 0!==(s=this.getChildNodeObject(a,this.getChildMapper(t),i)))break}}else{var s,a=R(t.child,e[parseInt(n.toString(),10)]);if(void 0!==(s=this.getChildNodeObject(a,this.getChildMapper(t),i)))break}}return s},BW.prototype.setDragAndDrop=function(e){e&&!this.disabled?this.initializeDrag():this.destroyDrag()},BW.prototype.initializeDrag=function(){var n,o=this;this.dragObj=new hn(this.element,{enableTailMode:!0,enableAutoScroll:!0,dragArea:this.dragArea,dragTarget:"."+q5,enableTapHold:!0,tapHoldThreshold:100,helper:function(e){o.dragTarget=e.sender.target;var t=z(o.dragTarget,"."+L5),i=z(o.dragTarget,"."+q5);return o.dragLi=z(o.dragTarget,"."+V5),o.fullRowSelect&&!i&&o.dragTarget.classList.contains(rW)&&(i=o.dragTarget.nextElementSibling),!(!(o.dragTarget&&e.element.isSameNode(t)&&i)||o.dragTarget.classList.contains(L5)||o.dragTarget.classList.contains(H5)||o.dragTarget.classList.contains(V5)||o.dragLi.classList.contains("e-disable"))&&(e=i.cloneNode(!0),je(ge("div."+U5,e))&&(t=o.createElement("div",{className:U5+" "+N5}),e.insertBefore(t,e.children[0])),i="e-drag-item "+L5+" "+o.cssClass+" "+(o.enableRtl?"e-rtl":""),(n=o.createElement("div",{className:i})).appendChild(e),1<(t=o.selectedNodes.length)&&o.allowMultiSelection&&o.dragLi.classList.contains(j5)&&(i=o.createElement("span",{className:"e-drop-count",innerHTML:""+t}),n.appendChild(i)),document.body.appendChild(n),document.body.style.cursor="",o.dragData=o.getNodeData(o.dragLi),n)},dragStart:function(t){U([o.element],$5);var e,i=z(t.target,".e-list-item"),i=(i&&(e=parseInt(i.getAttribute("aria-level"),10)),o.getDragEvent(t.event,o,null,t.target,null,n,e));i.draggedNode.classList.contains(K5)?(o.dragObj.intDestroy(t.event),o.dragCancelAction(n)):o.trigger("nodeDragStart",i,function(e){e.cancel?(o.dragObj.intDestroy(t.event),o.dragCancelAction(n)):o.dragStartAction=!0})},drag:function(e){o.dragObj.setProperties({cursorAt:{top:!je(e.event.targetTouches)||F.isDevice?60:-20}}),o.dragAction(e,n)},dragStop:function(t){q([o.element],$5),t.target.classList.contains("e-sibling")||o.removeVirtualEle();var e,i=t.target,n=z(i,"."+Z5),n=(i&&n||(G(t.helper),document.body.style.cursor=""),z(i,".e-list-item")),n=(n&&(e=parseInt(n.getAttribute("aria-level"),10)),o.getDragEvent(t.event,o,i,i,null,t.helper,e));n.preventTargetExpand=!1,o.trigger("nodeDragStop",n,function(e){o.dragParent=e.draggedParentNode,o.preventExpand=e.preventTargetExpand,e.cancel&&(t.helper.parentNode&&G(t.helper),document.body.style.cursor="",i.classList.contains("e-sibling"))&&o.removeVirtualEle(),o.dragStartAction=!1})}}),this.dropObj=new un(this.element,{out:function(e){!je(e)&&!e.target.classList.contains(eW)&&o.dropObj.dragData.default&&o.dropObj.dragData.default.helper.classList.contains(L5)&&(document.body.style.cursor="not-allowed")},over:function(){document.body.style.cursor=""},drop:function(e){o.dropAction(e),o.removeVirtualEle()}})},BW.prototype.dragCancelAction=function(e){G(e),q([this.element],$5),this.dragStartAction=!1},BW.prototype.getOffsetX=function(e,t){var i=e.changedTouches;return i&&0<i.length?i[0].clientX-t.getBoundingClientRect().left:e.offsetX},BW.prototype.getOffsetY=function(e,t){var i=e.changedTouches;return i&&0<i.length?i[0].clientY-t.getBoundingClientRect().top:e.offsetY},BW.prototype.dragAction=function(e,t){var i,n,o,r,s,a=z(e.target,"."+Z5),l=z(e.target,"."+q5),h=ge("div."+U5,t),d=(q([h],[tW,iW,nW,oW]),this.isDropIn=!1,this.removeVirtualEle(),document.body.style.cursor="",e.target.classList),p=e.event,c=this.getOffsetY(p,e.target),p=this.getOffsetX(p,e.target),l=(this.fullRowSelect&&!l&&!je(d)&&d.contains(rW)&&(l=e.target.nextElementSibling),a?(d=z(e.target,"."+V5),i=z(e.target,"."+cW),n=z(e.target,"."+O5),o=z(e.target,"."+N5),!a.classList.contains(L5)||l&&!d.isSameNode(this.dragLi)&&!this.isDescendant(this.dragLi,d)?this.hasTemplate&&d?(a=ge(this.fullRowSelect?"."+rW:"."+q5,d),e&&!o&&!n&&c<7&&!i||o&&c<5||n&&p<3?(r=this.fullRowSelect?1:0,this.appendIndicator(d,h,r)):e&&!o&&!n&&!i&&a&&c>a.offsetHeight-10||o&&19<c||n&&19<p?(r=this.fullRowSelect?2:1,this.appendIndicator(d,h,r)):(U([h],tW),this.isDropIn=!0)):d&&e&&!o&&!n&&c<7&&!i||o&&c<5||n&&p<3?(r=this.fullRowSelect?1:0,this.appendIndicator(d,h,r)):d&&e&&!o&&!n&&0<e.target.offsetHeight&&c>e.target.offsetHeight-10&&!i||o&&19<c||n&&19<p?(r=this.fullRowSelect?2:1,this.appendIndicator(d,h,r)):(U([h],tW),this.isDropIn=!0):"LI"!==e.target.nodeName||d.isSameNode(this.dragLi)||this.isDescendant(this.dragLi,d)?e.target.classList.contains(eW)?U([h],iW):U([h],nW):(U([h],iW),this.renderVirtualEle(e))):(U([h],oW),document.body.style.cursor="not-allowed"),z(e.target,".e-list-item")),a=(l&&(s=parseInt(l.getAttribute("aria-level"),10)),this.getDragEvent(e.event,this,e.target,e.target,null,t,s));a.dropIndicator&&q([h],a.dropIndicator),this.trigger("nodeDragging",a),a.dropIndicator&&U([h],a.dropIndicator)},BW.prototype.appendIndicator=function(e,t,i){U([t],iW);t=this.createElement("div",{className:eW});e.insertBefore(t,e.children[parseInt(i.toString(),10)])},BW.prototype.dropAction=function(e){for(var t,i=e.event,n=this.getOffsetY(i,e.target),o=e.target,i=!1,r=[],s=[],a=e.dragData.draggable,l=0;l<a.ej2_instances.length;l++)if(a.ej2_instances[parseInt(l.toString(),10)]instanceof kW){t=a.ej2_instances[parseInt(l.toString(),10)];break}if(t&&t.dragTarget){var h=z(t.dragTarget,"."+V5),d=z(o,"."+V5);if(s.push(h),null==d&&o.classList.contains(L5)&&(d=o.firstElementChild),G(e.droppedElement),document.body.style.cursor="",!d||d.isSameNode(h)||this.isDescendant(h,d))return void(this.fields.dataSource instanceof me==!1&&(this.preventExpand=!1));if(t.allowMultiSelection&&h.classList.contains(j5)){var p=ct("."+j5,t.element),s=p;if(e.target.offsetHeight<=33&&n>e.target.offsetHeight-10&&6<n)for(l=p.length-1;0<=l;l--)d.isSameNode(p[parseInt(l.toString(),10)])||this.isDescendant(p[parseInt(l.toString(),10)],d)||this.appendNode(o,p[parseInt(l.toString(),10)],d,e,t,n);else for(l=0;l<p.length;l++)d.isSameNode(p[parseInt(l.toString(),10)])||this.isDescendant(p[parseInt(l.toString(),10)],d)||this.appendNode(o,p[parseInt(l.toString(),10)],d,e,t,n)}else this.appendNode(o,h,d,e,t,n);h=parseInt(h.getAttribute("aria-level"),10),i=!0}this.fields.dataSource instanceof me==!1&&(this.preventExpand=!1);for(l=0;l<s.length;l++)r.push(this.getNode(s[parseInt(l.toString(),10)]));this.trigger("nodeDropped",this.getDragEvent(e.event,t,o,e.target,e.dragData.draggedElement,null,h,i)),t.element.id!==this.element.id&&(t.triggerEvent("nodeDropped",r),this.isNodeDropped=!0,this.fields.dataSource=this.treeData),this.triggerEvent("nodeDropped",r)},BW.prototype.appendNode=function(e,t,i,n,o,r){var s=z(e,"."+cW),a=z(n.target,"."+O5),l=z(n.target,"."+N5);t.classList.contains("e-disable")||s||!(l&&n.event.offsetY<5||a&&n.event.offsetX<3||l&&19<n.event.offsetY||a&&19<n.event.offsetX||!l&&!a)?this.dropAsChildNode(t,i,o,null,n,r,!0,e):"LI"===e.nodeName?this.dropAsSiblingNode(t,i,n,o):e.firstElementChild&&e.classList.contains(L5)?"UL"===e.firstElementChild.nodeName&&this.dropAsSiblingNode(t,i,n,o):e.classList.contains("e-icon-collapsible")||e.classList.contains("e-icon-expandable")?this.dropAsSiblingNode(t,i,n,o):this.dropAsChildNode(t,i,o,null,n,r,null,e),this.showCheckBox&&this.ensureIndeterminate()},BW.prototype.dropAsSiblingNode=function(e,t,i,n){var o,r,s=z(t,"."+H5),a=z(e,"."+H5),l=z(a,"."+V5);0<i.target.offsetHeight&&i.event.offsetY>i.target.offsetHeight-2?o=!1:i.event.offsetY<2?o=!0:(i.target.classList.contains("e-icon-expandable")||i.target.classList.contains("e-icon-collapsible"))&&(i.event.offsetY<5||i.event.offsetX<3?o=!0:(15<i.event.offsetY||17<i.event.offsetX)&&(o=!1)),i.target.classList.contains("e-icon-expandable")||i.target.classList.contains("e-icon-collapsible")?(r=i.target.closest("li"),s.insertBefore(e,o?r:r.nextElementSibling)):s.insertBefore(e,o?i.target:i.target.nextElementSibling),this.moveData(e,t,s,o,n),this.updateElement(a,l),this.updateAriaLevel(e),n.element.id===this.element.id?this.updateList():(n.updateInstance(),this.updateInstance())},BW.prototype.dropAsChildNode=function(e,t,i,n,o,r,s,a){var l,h=z(e,"."+H5),d=z(h,"."+V5),p=z(t,"."+H5);o&&o.target&&(l=ge(this.fullRowSelect?"."+rW:"."+q5,t)),o&&(r<7&&!a.classList.contains("e-sibling")||a.classList.contains("e-sibling")&&!t.lastChild.classList.contains("e-sibling"))&&!s?(p.insertBefore(e,t),this.moveData(e,t,p,!0,i)):o&&0<o.target.offsetHeight&&r>o.target.offsetHeight-10&&!s&&!this.hasTemplate||this.hasTemplate&&l&&r>l.offsetHeight-10&&!s?(p.insertBefore(e,t.nextElementSibling),this.moveData(e,t,p,!1,i)):(a=this.expandParent(t),o=je(n)?null:a.childNodes[parseInt(n.toString(),10)],a.insertBefore(e,o),this.moveData(e,o,a,!0,i)),this.updateElement(h,d),this.updateAriaLevel(e),i.element.id===this.element.id?this.updateList():(i.updateInstance(),this.updateInstance())},BW.prototype.moveData=function(e,t,i,n,o){var i=z(i,"."+V5),e=this.getId(e),r=o.updateChildField(o.treeData,o.fields,e,null,null,!0),t=this.getId(t),t=this.getDataPos(this.treeData,this.fields,t),i=this.getId(i);if(1===this.dataType){this.updateField(this.treeData,this.fields,i,"hasChildren",!0);var s,a=je(t)?this.treeData.length:n?t:t+1;if(je(i)&&!this.hasPid?delete r[0][this.fields.parentID]:(s=this.isNumberTypeId?parseFloat(i):i,x(this.fields.parentID,s,r[0])),this.treeData.splice(a,0,r[0]),o.element.id!==this.element.id){var l=o.removeChildNodes(e);a++;for(var h=0,d=l.length;h<d;h++)this.treeData.splice(a,0,l[parseInt(h.toString(),10)]),a++;o.groupedData=o.getGroupedData(o.treeData,o.fields.parentID)}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.addChildData(this.treeData,this.fields,i,r,n?t:t+1)},BW.prototype.expandParent=function(e){var t,i=ge("div."+N5+", div."+O5,e),n=(i&&i.classList.contains(N5)&&!0!==this.preventExpand&&this.expandAction(e,i,null),ge("."+H5,e)),o=(!0===this.preventExpand&&!n&&i&&this.renderChildNodes(e),!je(n=ge("."+H5,e))&&this.preventExpand&&"true"!==e.getAttribute("aria-expanded")&&(n.style.display="none"),je(n)||!1!==this.preventExpand||(n.style.display="block"),je(n)&&!0===this.preventExpand&&(je(i)&&X_.generateIcon(this.createElement,e,N5,this.listBaseOption),(t=ge("div."+N5+", div."+O5,e))&&t.classList.add("e-icon-expandable"),n=X_.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),t?q([t],O5):X_.generateIcon(this.createElement,e,N5,this.listBaseOption),e.setAttribute("aria-expanded","false"),n.style.display="none"),je(n)&&((je(o=this.expandArgs)||o&&"nodeExpanding"!==o.name)&&this.trigger("nodeExpanding",this.getExpandEvent(e,null)),je(i)&&X_.generateIcon(this.createElement,e,O5,this.listBaseOption),(t=ge("div."+N5+", div."+O5,e))?q([t],N5):(X_.generateIcon(this.createElement,e,O5,this.listBaseOption),q([t=ge("div."+U5,e)],N5)),n=X_.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),this.addExpand(e),this.trigger("nodeExpanded",this.getExpandEvent(e,null))),ge("div."+O5,e));return!je(n)&&o&&this.preventExpand&&"true"!==e.getAttribute("aria-expanded")&&(q([o],O5),e.setAttribute("aria-expanded","false"),U([o],N5)),n},BW.prototype.updateElement=function(e,t){var i;t&&0===e.childElementCount&&(i=ge("div."+U5,t),G(e),G(i),e=this.getId(t),this.updateField(this.treeData,this.fields,e,"hasChildren",!1),this.removeExpand(t,!0))},BW.prototype.updateAriaLevel=function(e){var t=this.parents(e,"."+H5).length;e.setAttribute("aria-level",""+t),this.updateChildAriaLevel(ge("."+H5,e),t+1)},BW.prototype.updateChildAriaLevel=function(e,t){if(!je(e))for(var i=e.childNodes,n=0,o=i.length;n<o;n++){var r=i[parseInt(n.toString(),10)];r.setAttribute("aria-level",""+t),this.updateChildAriaLevel(ge("."+H5,r),t+1)}},BW.prototype.renderVirtualEle=function(e){var t=e.event,t=this.getOffsetY(t,e.target),t=(t>e.target.offsetHeight-2?i=!1:t<2&&(i=!0),this.createElement("div",{className:eW})),i=this.fullRowSelect?i?1:2:i?0:1;e.target.insertBefore(t,e.target.children[parseInt(i.toString(),10)])},BW.prototype.removeVirtualEle=function(){var e=ge("."+eW);e&&G(e)},BW.prototype.destroyDrag=function(){this.dragObj&&this.dropObj&&(this.dragObj.destroy(),this.dropObj.destroy())},BW.prototype.getDragEvent=function(e,t,i,n,o,r,s,a){var l=i?z(i,"."+V5):null,h=l?this.getNodeData(l):null,d=t?t.dragLi:o,o=t?t.dragData:null,p=i?this.parents(i,"."+V5):null,c=t.dragLi.parentElement,u=t.dragLi?z(c,"."+V5):null,g=null,m=null,f=[iW,tW,nW,oW],y=null,v=!0===a?d:l,b=v?z(v,".e-list-parent"):null,w=0,C=null,u=t.dragLi&&null===u?z(c,"."+L5):u;if(u=!0===a?this.dragParent:u,r)for(;w<4;){if(ge("."+U5,r).classList.contains(f[parseInt(w.toString(),10)])){y=f[parseInt(w.toString(),10)];break}w++}if(b){for(var S=0,w=0;w<b.childElementCount;w++){if(S=!0!==a&&b.children[parseInt(w.toString(),10)]===d&&l!==d?++S:S,!0!==a&&b.children[parseInt(w.toString(),10)].classList.contains("e-hover")){m=23<=e.offsetY?w+1:w;break}if(b.children[parseInt(w.toString(),10)]===v){e.offsetY,m=w;break}}m=0!==S?--m:m,C=this.isDropIn?"Inside":e.offsetY<7?"Before":"After"}return i&&(g=0===p.length?null:i.classList.contains(V5)?p[0]:p[1]),l===d&&(g=l),i&&n.offsetHeight<=33&&e.offsetY<n.offsetHeight-10&&6<e.offsetY&&(g=l,!0!==a)&&(s=++s,m=(t=g?ge(".e-list-parent",g):null)?t.children.length:0,this.fields.dataSource instanceof me||null!==t||!g||(m=(c=g.hasAttribute("data-uid")?this.getChildNodes(this.fields.dataSource,g.getAttribute("data-uid").toString()):null)?c.length:0)),{cancel:!1,clonedNode:r,event:e,draggedNode:d,draggedNodeData:o,droppedNode:l,droppedNodeData:h,dropIndex:m,dropLevel:s,draggedParentNode:u,dropTarget:g,dropIndicator:y,target:n,position:C}},BW.prototype.addFullRow=function(e){var t=this.liList.length;if(e)for(var i=0;i<t;i++)this.createFullRow(this.liList[parseInt(i.toString(),10)]);else for(i=0;i<t;i++)G(ge("."+rW,this.liList[parseInt(i.toString(),10)]))},BW.prototype.createFullRow=function(e){var t=this.createElement("div",{className:rW});e.insertBefore(t,e.childNodes[0])},BW.prototype.addMultiSelect=function(e){if(e)for(var t=0,i=ct("."+V5+':not([aria-selected="true"])',this.element);t<i.length;t++)i[t].setAttribute("aria-selected","false");else for(var n=0,o=ct("."+V5+'[aria-selected="false"]',this.element);n<o.length;n++)o[n].removeAttribute("aria-selected")},BW.prototype.collapseByLevel=function(e,t,i,n){if(n=je(n)?1:n,0<t&&!je(e))for(var o=this.getVisibleNodes(i,e.childNodes),r=0,s=o.length;r<s;r++){var a=o[parseInt(r.toString(),10)],l=ge("."+O5,ge("."+q5,a));t<=n&&!je(l)&&this.collapseNode(a,l,null),this.collapseByLevel(ge("."+H5,a),t,i,n+1)}},BW.prototype.collapseAllNodes=function(e){for(var t=this.getVisibleNodes(e,ct("."+O5,this.element)),i=0,n=t.length;i<n;i++){var o=t[parseInt(i.toString(),10)],r=z(o,"."+V5);this.collapseNode(r,o,null)}},BW.prototype.expandByLevel=function(e,t,i){if(0<t&&!je(e))for(var n=this.getVisibleNodes(i,e.childNodes),o=0,r=n.length;o<r;o++){var s=n[parseInt(o.toString(),10)],a=ge("."+N5,ge("."+q5,s));je(a)||this.expandAction(s,a,null),this.expandByLevel(ge("."+H5,s),t-1,i)}},BW.prototype.expandAllNodes=function(e){for(var t=0,i=this.getVisibleNodes(e,ct("."+N5,this.element));t<i.length;t++){var n=i[t],o=z(n,"."+V5);this.expandAction(o,n,null,!0,null,!0)}},BW.prototype.getVisibleNodes=function(e,t){var i=Array.prototype.slice.call(t);if(e)for(var n=0;n<i.length;n++)at(i[parseInt(n.toString(),10)])||(i.splice(n,1),n--);return i},BW.prototype.removeNode=function(e){var t=z(e,"."+H5),i=z(t,"."+V5);je(this.nodeTemplateFn)||this.destroyTemplate(e),G(e),this.updateElement(t,i),this.removeData(e)},BW.prototype.updateInstance=function(){this.updateList(),this.updateSelectedNodes(),this.updateExpandedNodes()},BW.prototype.updateList=function(){this.liList=Array.prototype.slice.call(ct("."+V5,this.element))},BW.prototype.updateSelectedNodes=function(){this.setProperties({selectedNodes:[]},!0);var e=ct("."+j5,this.element);this.selectGivenNodes(e)},BW.prototype.updateExpandedNodes=function(){this.setProperties({expandedNodes:[]},!0);for(var e=ct('[aria-expanded="true"]',this.element),t=0,i=e.length;t<i;t++)this.addExpand(e[parseInt(t.toString(),10)])},BW.prototype.removeData=function(e){var t,i,n,o;1===this.dataType?(t=new me(this.treeData),o=this.getId(e),i={},n=this.isNumberTypeId?parseFloat(o):o,i[this.fields.id]=n,t.remove(this.fields.id,i),this.removeChildNodes(o)):(o=this.getId(e),this.updateChildField(this.treeData,this.fields,o,null,null,!0))},BW.prototype.removeChildNodes=function(e){var t=this.getChildGroup(this.groupedData,e,!1),i=[];if(t)for(var n=0,o=t.length;n<o;n++){var r=new me(this.treeData),s=R(this.fields.id,t[parseInt(n.toString(),10)]).toString(),a={},l=this.isNumberTypeId?parseFloat(s):s,l=(a[this.fields.id]=l,r.remove(this.fields.id,a));i.push(l[0]),this.removeChildNodes(s)}return i},BW.prototype.doGivenAction=function(e,t,i){for(var n=0,o=e.length;n<o;n++){var r,s=this.getElement(e[parseInt(n.toString(),10)]);je(s)||je(r=ge("."+t,ge("."+q5,s)))||(i?this.expandAction(s,r,null):this.collapseNode(s,r,null))}},BW.prototype.addGivenNodes=function(e,t,i,n,o){if(0!==e.length){var r,s,a=this.getSortedData(e),l=t?parseFloat(t.getAttribute("aria-level"))+1:1,h=(n&&this.updateMapper(l),X_.createListItemFromJson(this.createElement,a,this.listBaseOption,l)),d=this.getId(t),p=(je(t)||(r=ge("div."+U5,t)),1===this.dataType&&r&&r.classList.contains(N5)&&this.preventExpand&&!je(this.element.offsetParent)&&!this.element.offsetParent.parentElement.classList.contains("e-filemanager")&&(this.preventExpand=!0),1!==this.dataType&&(this.addChildData(this.treeData,this.fields,d,e,i),this.isFirstRender=!1),s=o||(t?this.expandParent(t):ge("."+H5,this.element)),je(i)?null:s.childNodes[parseInt(i.toString(),10)]);if(!this.isFirstRender||1===this.dataType){n=this.expandArgs;if(p||"None"===this.sortOrder){for(var c=0;c<h.length;c++)s.insertBefore(h[parseInt(c.toString(),10)],p);1!==this.dataType||je(t)||this.preventExpand||je(this.element.offsetParent)||this.element.offsetParent.parentElement.classList.contains("e-filemanager")||(this.preventExpand=!1,(u=ge("div."+U5,t))&&u.classList.contains(N5)&&(je(n)||"nodeExpanding"!==n.name)&&this.expandAction(t,u,null))}if(!p&&("Ascending"===this.sortOrder||"Descending"===this.sortOrder))if(0===s.childNodes.length){for(var u,c=0;c<h.length;c++)s.insertBefore(h[parseInt(c.toString(),10)],p);1!==this.dataType||je(t)||this.preventExpand||je(this.element.offsetParent)||this.element.offsetParent.parentElement.classList.contains("e-filemanager")||(this.preventExpand=!1,(u=ge("div."+U5,t))&&u.classList.contains(N5)&&(je(n)||"nodeExpanding"!==n.name)&&this.expandAction(t,u,null))}else for(var g=s.childNodes,c=0;c<h.length;c++)for(var m=0;m<g.length;m++){if("Ascending"===this.sortOrder?g[parseInt(m.toString(),10)].textContent.toUpperCase()>h[parseInt(c.toString(),10)].innerText.toUpperCase():g[parseInt(m.toString(),10)].textContent.toUpperCase()<h[parseInt(c.toString(),10)].innerText.toUpperCase()){s.insertBefore(h[parseInt(c.toString(),10)],g[parseInt(m.toString(),10)]);break}s.insertBefore(h[parseInt(c.toString(),10)],g[g.length])}}if(1===this.dataType){this.updateField(this.treeData,this.fields,d,"hasChildren",!0);for(var f,a=this.getId(p),y=je(a)?this.treeData.length:this.getDataPos(this.treeData,this.fields,a),m=0;m<e.length;m++)je(d)||(f=this.isNumberTypeId?parseFloat(d):d,x(this.fields.parentID,f,e[parseInt(m.toString(),10)])),this.treeData.splice(y,0,e[parseInt(m.toString(),10)]),y++}this.finalizeNode(s)}},BW.prototype.updateMapper=function(e){e=1===e?this.fields:this.getChildFields(this.fields,e-1,1);this.updateListProp(e)},BW.prototype.updateListProp=function(e){e=this.getActualProperties(e);this.listBaseOption.fields=e,this.listBaseOption.fields.url=Object.prototype.hasOwnProperty.call(e,"navigateUrl")?e.navigateUrl:"navigateUrl"},BW.prototype.getDataPos=function(e,t,i){for(var n=null,o=0,r=e.length;o<r;o++){var s=R(t.id,e[parseInt(o.toString(),10)]);if(e[parseInt(o.toString(),10)]&&s&&s.toString()===i)return o;if("string"!=typeof t.child||je(R(t.child,e[parseInt(o.toString(),10)]))){if(this.fields.dataSource instanceof me&&!je(R("child",e[parseInt(o.toString(),10)]))){s=R("child",e[parseInt(o.toString(),10)]);if(null!==(n=this.getDataPos(s,this.getChildMapper(t),i)))break}}else{s=R(t.child,e[parseInt(o.toString(),10)]);if(null!==(n=this.getDataPos(s,this.getChildMapper(t),i)))break}}return n},BW.prototype.addChildData=function(e,t,i,n,o){if(je(i)){o=je(o)?e.length:o;for(var r=0,s=n.length;r<s;r++)e.splice(o,0,n[parseInt(r.toString(),10)]),o++}else for(var a=0,l=e.length;a<l;a++){var h=R(t.id,e[parseInt(a.toString(),10)]);if(e[parseInt(a.toString(),10)]&&h&&h.toString()===i){if("string"==typeof t.child&&Object.prototype.hasOwnProperty.call(e[parseInt(a.toString(),10)],t.child)&&null!==e[parseInt(a.toString(),10)][t.child]||this.fields.dataSource instanceof me&&Object.prototype.hasOwnProperty.call(e[parseInt(a.toString(),10)],"child")){je(p=R(d="string"==typeof t.child?t.child:"child",e[parseInt(a.toString(),10)]))&&(p=[]),o=je(o)?p.length:o;for(r=0,s=n.length;r<s;r++)p.splice(o,0,n[parseInt(r.toString(),10)]),o++}else{var d="string"==typeof t.child?t.child:"child";e[parseInt(a.toString(),10)][""+d]=n}return!0}if("string"!=typeof t.child||je(R(t.child,e[parseInt(a.toString(),10)]))){if(this.fields.dataSource instanceof me&&!je(R("child",e[parseInt(a.toString(),10)]))){var p=R("child",e[parseInt(a.toString(),10)]);if(void 0!==(c=this.addChildData(p,this.getChildMapper(t),i,n,o)))break}}else{var c,h=R(t.child,e[parseInt(a.toString(),10)]);if(void 0!==(c=this.addChildData(h,this.getChildMapper(t),i,n,o)))break}}return c},BW.prototype.doDisableAction=function(e){var e=this.nodeType(e),t=this.checkValidId(e);this.validArr=[];for(var i=0,n=t.length;i<n;i++){var o=t[parseInt(i.toString(),10)][this.fields.id].toString(),o=(o&&-1===this.disableNode.indexOf(o)&&this.disableNode.push(o),this.getElement(o));o&&(o.setAttribute("aria-disabled","true"),U([o],hW))}},BW.prototype.doEnableAction=function(e){for(var t=this.nodeType(e),i=0,n=t.length;i<n;i++){var o=this.getElement(t[parseInt(i.toString(),10)]),r=t[parseInt(i.toString(),10)];r&&-1!==this.disableNode.indexOf(r)&&this.disableNode.splice(this.disableNode.indexOf(r),1),o&&(o.removeAttribute("aria-disabled"),q([o],hW))}},BW.prototype.nodeType=function(e){for(var t=[],i=0,n=e.length;i<n;i++){var o=void 0;"string"==typeof e[parseInt(i.toString(),10)]?o=e[parseInt(i.toString(),10)]?e[parseInt(i.toString(),10)].toString():null:"object"==typeof e[parseInt(i.toString(),10)]&&(o=e[parseInt(i.toString(),10)]?e[parseInt(i.toString(),10)].getAttribute("data-uid").toString():null),-1===t.indexOf(o)&&t.push(o)}return t},BW.prototype.checkValidId=function(t){var i=this;if(1===this.dataType)this.validArr=this.treeData.filter(function(e){return-1!==t.indexOf(e[i.fields.id]?e[i.fields.id].toString():null)});else if(2===this.dataType)for(var e=0;e<this.treeData.length;e++){var n=this.treeData[parseInt(e.toString(),10)][this.fields.id]?this.treeData[parseInt(e.toString(),10)][this.fields.id].toString():null,n=(-1!==t.indexOf(n)&&this.validArr.push(this.treeData[parseInt(e.toString(),10)]),R(this.fields.child.toString(),this.treeData[parseInt(e.toString(),10)]));n&&this.filterNestedChild(n,t)}return this.validArr},BW.prototype.filterNestedChild=function(e,t){for(var i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null,n=(-1!==t.indexOf(n)&&this.validArr.push(e[parseInt(i.toString(),10)]),R(this.fields.child.toString(),e[parseInt(i.toString(),10)]));n&&this.filterNestedChild(n,t)}},BW.prototype.setTouchClass=function(){var e=z(this.element,".e-bigger");this.touchClass=je(e)?"":"e-small"},BW.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[parseInt(t.toString(),10)],"selected",!0);for(var n=this.expandedNodes,o=0,r=n.length;o<r;o++)this.updateField(this.treeData,this.fields,n[parseInt(o.toString(),10)],"expanded",!0);if(this.showCheckBox){this.removeField(this.treeData,this.fields,["isChecked"]);for(var s=this.checkedNodes,a=0,r=s.length;a<r;a++)this.updateField(this.treeData,this.fields,s[parseInt(a.toString(),10)],"isChecked",!0)}},BW.prototype.removeField=function(e,t,i){if(!je(e)&&!je(t))for(var n=0,o=e.length;n<o;n++){for(var r=0;r<i.length;r++){var s=this.getMapperProp(t,i[parseInt(r.toString(),10)]);je(e[parseInt(n.toString(),10)][""+s])||delete e[parseInt(n.toString(),10)][""+s]}"string"!=typeof t.child||je(R(t.child,e[parseInt(n.toString(),10)]))?this.fields.dataSource instanceof me&&!je(R("child",e[parseInt(n.toString(),10)]))&&this.removeField(R("child",e[parseInt(n.toString(),10)]),this.getChildMapper(t),i):this.removeField(R(t.child,e[parseInt(n.toString(),10)]),this.getChildMapper(t),i)}},BW.prototype.getMapperProp=function(e,t){switch(t){case"selected":return je(e.selected)?"selected":e.selected;case"expanded":return je(e.expanded)?"expanded":e.expanded;case"isChecked":return je(e.isChecked)?"isChecked":e.isChecked;case"hasChildren":return je(e.hasChildren)?"hasChildren":e.hasChildren;default:return t}},BW.prototype.updateField=function(e,t,i,n,o){var r;je(i)||(1===this.dataType?(r=this.isNumberTypeId?parseFloat(i):i,r=new me(this.treeData).executeLocal((new ya).where(t.id,"equal",r,!1)),x(this.getMapperProp(t,n),o,r[0])):this.updateChildField(e,t,i,n,o))},BW.prototype.updateChildField=function(e,t,i,n,o,r){if(!je(e))for(var s=0,a=e.length;s<a;s++){var l=R(t.id,e[parseInt(s.toString(),10)]);if(e[parseInt(s.toString(),10)]&&!je(l)&&l.toString()===i)return h=r?e.splice(s,1):(x(this.getMapperProp(t,n),o,e[parseInt(s.toString(),10)]),[]);if("string"!=typeof t.child||je(R(t.child,e[parseInt(s.toString(),10)]))){if(this.fields.dataSource instanceof me&&!je(R("child",e[parseInt(s.toString(),10)]))){l=R("child",e[parseInt(s.toString(),10)]);if(void 0!==(h=this.updateChildField(l,this.getChildMapper(t),i,n,o,r)))break}}else{var h,l=R(t.child,e[parseInt(s.toString(),10)]);if(void 0!==(h=this.updateChildField(l,this.getChildMapper(t),i,n,o,r)))break}}return h},BW.prototype.triggerEvent=function(e,t){if(this.renderReactTemplates(),"addNodes"===e){for(var i=[],n=0;n<t.length;n++)i.push(this.getNode(this.getElement(je(t[parseInt(n.toString(),10)][this.fields.id])?R(this.fields.id,t[parseInt(n.toString(),10)]).toString():null)));t=i}e={data:this.treeData,action:e,nodeData:t};this.trigger("dataSourceChanged",e)},BW.prototype.wireInputEvents=function(e){E.add(e,"blur",this.inputFocusOut,this)},BW.prototype.wireEditingEvents=function(e){var t=this;e&&!this.disabled?this.touchEditObj=new Mn(this.element,{tap:function(e){t.isDoubleTapped(e)&&2===e.tapCount&&(e.originalEvent.preventDefault(),t.editingHandler(e.originalEvent))}}):this.touchEditObj&&this.touchEditObj.destroy()},BW.prototype.wireClickEvent=function(e){var t=this;e?this.touchClickObj=new Mn(this.element,{tap:function(e){t.clickHandler(e)}}):this.touchClickObj&&this.touchClickObj.destroy()},BW.prototype.wireExpandOnEvent=function(e){var t=this;e?this.touchExpandObj=new Mn(this.element,{tap:function(e){("Click"===t.expandOnType||"DblClick"===t.expandOnType&&t.isDoubleTapped(e)&&2===e.tapCount)&&3!==e.originalEvent.which&&t.expandHandler(e)}}):this.touchExpandObj&&this.touchExpandObj.destroy()},BW.prototype.mouseDownHandler=function(e){this.mouseDownStatus=!0,(e.shiftKey||e.ctrlKey)&&e.preventDefault(),e.ctrlKey&&this.allowMultiSelection&&E.add(this.element,"contextmenu",this.preventContextMenu,this)},BW.prototype.preventContextMenu=function(e){e.preventDefault()},BW.prototype.wireEvents=function(){E.add(this.element,"mousedown",this.mouseDownHandler,this),this.wireClickEvent(!0),"None"!==this.expandOnType&&this.wireExpandOnEvent(!0),E.add(this.element,"mouseover",this.onMouseOver,this),E.add(this.element,"mouseout",this.onMouseLeave,this),this.keyboardModule=new bn(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},BW.prototype.unWireEvents=function(){E.remove(this.element,"mousedown",this.mouseDownHandler),this.wireClickEvent(!1),this.wireExpandOnEvent(!1),E.remove(this.element,"mouseover",this.onMouseOver),E.remove(this.element,"mouseout",this.onMouseLeave),this.disabled||this.keyboardModule.destroy()},BW.prototype.parents=function(e,t){for(var i=[],n=e.parentNode;!je(n);)ft(n,t)&&i.push(n),n=n.parentNode;return i},BW.prototype.isDoubleTapped=function(e){var t,i=e.originalEvent.target;return i&&e.tapCount&&(1===e.tapCount?this.firstTap=z(i,"."+V5):2===e.tapCount&&(t=z(i,"."+V5))),this.firstTap===t},BW.prototype.isDescendant=function(e,t){for(var i=t.parentNode;!je(i);){if(i===e)return!0;i=i.parentNode}return!1},BW.prototype.showSpinner=function(e){U([e],W5),mA({target:e,width:F.isDevice?16:14},this.createElement),kA(e)},BW.prototype.hideSpinner=function(e){BA(e),e.innerHTML="",q([e],W5)},BW.prototype.setCheckedNodes=function(e){1<(e=JSON.parse(JSON.stringify(e))).length&&"function"==typeof this.nodeChecked&&0<this.nodeChecked.length&&(this.isFilter=!0),this.uncheckAll(this.checkedNodes),this.setIndeterminate(e),0<e.length&&this.checkAll(e)},BW.prototype.setValidCheckedNode=function(e,t){if(void 0===t&&(t=[]),1===this.dataType){var i=this.fields,i=new me(this.treeData).executeLocal((new ya).where(i.id,"equal",e,!0));if(i[0]&&(this.setChildCheckState(i,e,i[0],t),this.autoCheck)){for(var i=i[0][this.fields.parentID]?i[0][this.fields.parentID].toString():null,n=this.getChildNodes(this.treeData,i),o=0,r=0;r<n.length;r++){var s=n[parseInt(r.toString(),10)][this.fields.id].toString();-1!==this.checkedNodes.indexOf(s)&&o++}o===n.length&&-1===this.checkedNodes.indexOf(i)&&i&&this.checkDisabledState(i)}}else if(2===this.dataType)for(var a=0;a<this.treeData.length;a++){if((this.treeData[parseInt(a.toString(),10)][this.fields.id]?this.treeData[parseInt(a.toString(),10)][this.fields.id].toString():"")===e&&-1===this.checkedNodes.indexOf(e)){this.checkDisabledState(e);break}var l=R(this.fields.child.toString(),this.treeData[parseInt(a.toString(),10)]);l&&this.setChildCheckState(l,e,this.treeData[parseInt(a.toString(),10)],t)}},BW.prototype.setChildCheckState=function(e,t,i,n){void 0===n&&(n=[]);var o,r=0;if(1===this.dataType){i&&(o=i[this.fields.id]?i[this.fields.id].toString():null);for(var s=0;s<e.length;s++){var a=e[parseInt(s.toString(),10)][this.fields.id]?e[parseInt(s.toString(),10)][this.fields.id].toString():null,l=(i&&o&&this.autoCheck&&-1!==this.checkedNodes.indexOf(o)&&-1===this.checkedNodes.indexOf(a)&&this.checkDisabledState(a,e[s]),a===t&&-1===this.checkedNodes.indexOf(t)&&this.checkDisabledState(t),this.getChildNodes(this.treeData,a)),h=1===n.length&&n[0]===a;l.length!==t.length&&!h||this.setChildCheckState(l,t,i)}}else{i&&(o=i[this.fields.id]?i[this.fields.id].toString():"");for(s=0;s<e.length;s++){var d=e[parseInt(s.toString(),10)][this.fields.id]?e[parseInt(s.toString(),10)][this.fields.id].toString():"",h=1===[t].length&&0===n.length;i&&o&&this.autoCheck&&(-1===this.checkedNodes.indexOf(o)||-1!==this.checkedNodes.indexOf(d)||d!==t&&!h||this.checkDisabledState(d,e[s])),d===t&&-1===this.checkedNodes.indexOf(t)&&this.checkDisabledState(t),(l=R(this.fields.child.toString(),e[parseInt(s.toString(),10)]))&&this.setChildCheckState(l,t,e[parseInt(s.toString(),10)]),-1!==this.checkedNodes.indexOf(d)&&this.autoCheck&&r++,r===e.length&&-1===this.checkedNodes.indexOf(o)&&this.autoCheck&&this.checkDisabledState(o,i)}}},BW.prototype.setIndeterminate=function(e){for(var t=0;t<e.length;t++)this.setValidCheckedNode(e[parseInt(t.toString(),10)],e)},BW.prototype.updatePosition=function(e,t,i,n){if(1===this.dataType){var o=this.getDataPos(this.treeData,this.fields,e);if(this.treeData.splice(o,1,t),i){this.removeChildNodes(e);for(var r=0;r<n.length;r++)this.treeData.splice(o,0,n[parseInt(r.toString(),10)]),o++}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.updateChildPosition(this.treeData,this.fields,e,[t],void 0)},BW.prototype.updateChildPosition=function(e,t,i,n,o){for(var r=0,s=e.length;r<s;r++){var a=R(t.id,e[parseInt(r.toString(),10)]);if(e[parseInt(r.toString(),10)]&&a&&a.toString()===i)return e[parseInt(r.toString(),10)]=n[0],!0;if("string"!=typeof t.child||je(R(t.child,e[parseInt(r.toString(),10)]))){if(this.fields.dataSource instanceof me&&!je(R("child",e[parseInt(r.toString(),10)]))){a=R("child",e[parseInt(r.toString(),10)]);if(void 0!==(l=this.updateChildPosition(a,this.getChildMapper(t),i,n,o)))break}}else{var l,a=R(t.child,e[parseInt(r.toString(),10)]);if(void 0!==(l=this.updateChildPosition(a,this.getChildMapper(t),i,n,o)))break}}return l},BW.prototype.dynamicState=function(){this.setDragAndDrop(this.allowDragAndDrop),this.wireEditingEvents(this.allowEditing),this.disabled?(this.unWireEvents(),this.rippleFn(),this.rippleIconFn()):(this.wireEvents(),this.setRipple())},BW.prototype.crudOperation=function(e,t,i,n,o,r,s){var a,l=this,h=this.fields.dataSource,d=[],p=this.getQuery(this.fields),c=this.fields.id,u={addedRecords:[],deletedRecords:[],changedRecords:[]},g=[];t?g=this.nodeType(t):i&&("string"==typeof i?g[0]=i.toString():"object"==typeof i&&(g[0]=i.getAttribute("data-uid").toString()));for(var m,f=0,y=g.length;f<y;f++)je(this.getElement(g[parseInt(f.toString(),10)]))||(m=this.getNodeObject(g[parseInt(f.toString(),10)]),d.push(m));switch(e){case"delete":(a=1===t.length?h.remove(c,d[0],p.fromTable,p):(u.deletedRecords=d,h.saveChanges(u,c,p.fromTable,p))).then(function(){return l.deleteSuccess(g)}).catch(function(e){return l.dmFailure(e)});break;case"update":d[0][this.fields.text]=n,(a=h.update(c,d[0],p.fromTable,p)).then(function(){return l.editSucess(i,n,s)}).catch(function(e){return l.dmFailure(e,i,s)});break;case"insert":if(1===o.length)a=h.insert(o[0],p.fromTable,p);else{for(var v=[],f=0,y=o.length;f<y;f++)v.push(o[parseInt(f.toString(),10)]);u.addedRecords=v,a=h.saveChanges(u,c,p.fromTable,p)}a.then(function(){var e=l.getElement(i);l.addSuccess(o,e,r),l.preventExpand=!1}).catch(function(e){return l.dmFailure(e)})}},BW.prototype.deleteSuccess=function(e){for(var t=[],i=0,n=e.length;i<n;i++){var o=this.getElement(e[parseInt(i.toString(),10)]);t.push(this.getNode(o)),je(o)||this.removeNode(o)}this.updateInstance(),1===this.dataType&&(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)),this.triggerEvent("removeNode",t)},BW.prototype.editSucess=function(e,t,i){var e=this.getElement(e),n=ge("."+_5,e);this.appendNewText(e,n,t,i)},BW.prototype.addSuccess=function(e,t,i){var n,o=this,r=t?t.querySelector("."+U5):null;t&&r&&r.classList.contains(N5)&&null===t.querySelector("."+H5)?this.renderChildNodes(t,null,function(){n=t.querySelector("."+H5),o.addGivenNodes(e,t,i,!0,n),o.triggerEvent("addNodes",e)}):(this.addGivenNodes(e,t,i,!0),this.triggerEvent("addNodes",e))},BW.prototype.dmFailure=function(e,t,i){t&&this.updatePreviousText(t,i),this.trigger("actionFailure",{error:e})},BW.prototype.updatePreviousText=function(e,t){var e=this.getElement(e),i=ge("."+_5,e);this.updateText(e,i,this.oldText,t)},BW.prototype.getHierarchicalParentId=function(t,e,i){var n=this;if(-1===e.findIndex(function(e){return e[n.fields.id]&&e[n.fields.id].toString()===t}))for(var o=0;o<e.length;o++){var r=R(this.fields.child.toString(),e[parseInt(o.toString(),10)]);if(!je(r)){if(-1!==r.findIndex(function(e){return e[n.fields.id]&&e[n.fields.id].toString()===t})){i.push(e[parseInt(o.toString(),10)][this.fields.id].toString()),this.getHierarchicalParentId(e[parseInt(o.toString(),10)][this.fields.id].toString(),this.treeData,i);break}this.getHierarchicalParentId(t,r,i)}}return i},BW.prototype.onPropertyChanged=function(e,t){for(var i,n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){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":1<this.selectedNodes.length&&(i=this.getElement(this.selectedNodes[0]),this.isLoaded=!1,this.removeSelectAll(),this.selectNode(i,null),this.isLoaded=!0),this.setMultiSelect(this.allowMultiSelection),this.addMultiSelect(this.allowMultiSelection);break;case"allowTextWrap":this.setTextWrap(),this.updateWrap();break;case"checkedNodes":JSON.stringify(t.checkedNodes)!==JSON.stringify(e.checkedNodes)&&this.showCheckBox&&(this.checkedNodes=t.checkedNodes,this.setCheckedNodes(e.checkedNodes));break;case"autoCheck":this.showCheckBox&&(this.autoCheck=e.autoCheck,this.ensureIndeterminate());break;case"cssClass":this.setCssClass(t.cssClass,e.cssClass);break;case"enableRtl":this.setEnableRtl();break;case"expandedNodes":this.isAnimate=!1,this.setProperties({expandedNodes:[]},!0),this.collapseAll(),this.isInitalExpand=!0,this.setProperties({expandedNodes:je(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.isReact&&(!this.isReact||this.fields.dataSource instanceof me)||(this.element.classList.contains("e-filtering")||(this.DDTTreeData=JSON.parse(JSON.stringify(this.fields.dataSource))),this.reRenderNodes()),this.initialRender=!1,this.isAnimate=!0,this.isFieldChange=!1;break;case"fullRowSelect":this.setFullRow(this.fullRowSelect),this.addFullRow(this.fullRowSelect),this.allowTextWrap&&(this.setTextWrap(),this.updateWrap());break;case"loadOnDemand":if(!1===this.loadOnDemand&&!this.onLoaded){for(var r=this.element.querySelectorAll("li"),s=0;s<r.length;)"true"!==r[parseInt(s.toString(),10)].getAttribute("aria-expanded")&&this.renderChildNodes(r[parseInt(s.toString(),10)],!0,null,!0),s++;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"checkDisabledChildren":case"sortOrder":this.reRenderNodes();break;case"fullRowNavigable":this.setProperties({fullRowNavigable:e.fullRowNavigable},!0),this.listBaseOption.itemNavigable=e.fullRowNavigable,this.reRenderNodes()}},BW.prototype.destroy=function(){this.clearTemplate(),this.element.removeAttribute("aria-activedescendant"),this.unWireEvents(),this.wireEditingEvents(!1),this.disabled||(this.rippleFn(),this.rippleIconFn()),this.setCssClass(this.cssClass,null),this.setDragAndDrop(!1),this.setFullRow(!1),this.ulElement&&this.ulElement.parentElement&&this.ulElement.parentElement.removeChild(this.ulElement),this.ulElement=null,this.liList=null,this.startNode=null,this.firstTap=null,this.expandArgs=null,this.dragLi=null,this.dragTarget=null,this.dragParent=null,this.dragObj=null,this.dropObj=null,this.inputObj=null,this.touchEditObj=null,this.touchExpandObj=null,this.touchClickObj=null,MW.prototype.destroy.call(this)},BW.prototype.addNodes=function(e,t,i,n){if(!je(e)){e=JSON.parse(JSON.stringify(e));var o=this.getElement(t);if(this.preventExpand=n,this.fields.dataSource instanceof me)this.isOffline?this.addSuccess(e,o,i):this.crudOperation("insert",null,t,null,e,i,this.preventExpand);else if(2===this.dataType)this.addGivenNodes(e,o,i);else{if(o)this.addGivenNodes(e,o,i);else{e=this.getSortedData(e);for(var r=0;r<e.length;r++){var s=R(this.fields.parentID,e[parseInt(r.toString(),10)]),o=s&&this.getElement(s.toString());!je(s)&&je(o)&&(this.isHiddenItem=!0,this.preventExpand=!1,this.ensureVisible(s),this.preventExpand=n,this.isHiddenItem=!1,o=this.getElement(s.toString())),this.addGivenNodes([e[parseInt(r.toString(),10)]],o,i)}}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}this.setNodeFocusable(),this.updateCheckedStateFromDS(),this.showCheckBox&&o&&this.ensureParentCheckState(o),this.fields.dataSource instanceof me==!1&&(this.preventExpand=!1,this.triggerEvent("addNodes",e))}},BW.prototype.beginEdit=function(e){e=this.getElement(e);je(e)||this.disabled||this.createTextbox(e)},BW.prototype.checkAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!0)},BW.prototype.collapseAll=function(e,t,i){je(e)?0<t?this.collapseByLevel(ge("."+H5,this.element),t,i):this.collapseAllNodes(i):this.doGivenAction(e,O5,!1)},BW.prototype.disableNodes=function(e){je(e)||this.doDisableAction(e)},BW.prototype.enableNodes=function(e){je(e)||this.doEnableAction(e)},BW.prototype.ensureVisible=function(e){var t=[];if(1===this.dataType)for(var i=this.getTreeData(e);0!==i.length&&!je(i[0][this.fields.parentID]);)t.push(i[0][this.fields.parentID].toString()),i=this.getTreeData(i[0][this.fields.parentID].toString());else 2===this.dataType&&(t=this.getHierarchicalParentId(e,this.treeData,t));this.expandAll(t.reverse(),null,null,this.isHiddenItem);var n=this.getElement(e);je(n)||("object"==typeof e&&(e=this.parents(n,"."+V5),this.expandAll(e)),setTimeout(function(){n.scrollIntoView({behavior:"smooth"})},450))},BW.prototype.expandAll=function(e,t,i,n){this.isAnimate=!n,je(e)?0<t?this.expandByLevel(ge("."+H5,this.element),t,i):(this.expandAllNodes(i),this.loadOnDemand&&!this.element.classList.contains("e-filtering")||(this.updateAttributes(this.element),this.updateList())):this.doGivenAction(e,N5,!0),this.isAnimate=!0},BW.prototype.getAllCheckedNodes=function(){return this.checkedNodes},BW.prototype.getDisabledNodes=function(){return this.disableNode},BW.prototype.getNode=function(e){e=this.getElement(e);return this.getNodeData(e,!0)},BW.prototype.getTreeData=function(e){var e=this.getId(e);return this.updatePersistProp(),je(e)?this.treeData:je(e=this.getNodeObject(e))?[]:[e]},BW.prototype.moveNodes=function(e,t,i,n){if(!je(e)&&0!==e.length){var o=this.getElement(t),r=[];je(o)&&(this.isHiddenItem=!0,this.ensureVisible(t),this.isHiddenItem=!1,o=this.getElement(t));for(var s=0;s<e.length;s++){var a=this.getElement(e[parseInt(s.toString(),10)]);r.push(this.getNode(a)),je(a)||o.isSameNode(a)||this.isDescendant(a,o)||(this.preventExpand=n,this.dropAsChildNode(a,o,this,i,null,null,null,o))}this.fields.dataSource instanceof me==!1&&(this.preventExpand=!1),this.triggerEvent("moveNodes",r)}},BW.prototype.refreshNode=function(e,t){if(!je(e)&&!je(t)){var i,n,o,r,s,a,l=!1,h=((1===this.dataType&&1<t.length||2===this.dataType&&1===t.length&&!je(R(this.fields.child.toString(),t[0])))&&(l=!0),this.getElement(e)),d=h?h.getAttribute("data-uid"):e?e.toString():null;if(this.refreshData=this.getNodeObject(d),t=JSON.parse(JSON.stringify(t)),1===this.dataType&&l){for(var p=0;p<t.length;p++)if(je(t[parseInt(p.toString(),10)][this.fields.parentID])){n=t[parseInt(p.toString(),10)],t.splice(p,1);break}i=Pe({},this.refreshData,n)}else i=Pe({},this.refreshData,t[0]);je(h)?this.updatePosition(d,i,l,t):(this.isRefreshed=!0,a=parseFloat(h.getAttribute("aria-level")),a=X_.createListItemFromJson(this.createElement,[i],this.listBaseOption,a),s=ge("."+H5,h),o=R(this.fields.child.toString(),i),l&&s||l&&!je(o)?(o=h.parentElement,r=Array.prototype.indexOf.call(o.childNodes,h),ue(h),o.insertBefore(a[0],o.childNodes[parseInt(r.toString(),10)]),this.updatePosition(d,i,l,t),l&&s&&this.expandAll([d])):(o=ge("."+q5,h),r=ge("."+q5,a[0]),s=ge("div."+U5,o),a=ge("div."+U5,r),s&&a&&(a.classList.contains(N5)&&s.classList.contains(O5)?(q([a],N5),U([a],O5)):a.classList.contains(O5)&&s.classList.contains(N5)?(q([a],O5),U([a],N5)):s.classList.contains("interaction")&&U([a],"interaction")),ue(o),(s=ge("."+rW,h)).parentNode.insertBefore(r,s.nextSibling),this.updatePosition(d,i,l,t)),h=this.getElement(e),i[this.fields.tooltip]&&h.setAttribute("title",i[this.fields.tooltip]),Object.prototype.hasOwnProperty.call(i,this.fields.htmlAttributes)&&i[this.fields.htmlAttributes]&&(I(a={},i[this.fields.htmlAttributes]),a.class?(U([h],a.class.split(" ")),delete a.class):pt(h,a)),-1!==this.selectedNodes.indexOf(d)&&(h.setAttribute("aria-selected","true"),U([h],j5)),this.isRefreshed=!1,this.triggerEvent("refreshNode",[this.getNode(h)]))}},BW.prototype.removeNodes=function(e){je(e)||(this.fields.dataSource instanceof me&&!this.isOffline?this.crudOperation("delete",e):this.deleteSuccess(e))},BW.prototype.updateNode=function(t,i){var n,o,e,r=this;je(t)||je(i)||!this.allowEditing||je(n=this.getElement(t))||(o=ge("."+_5,n),this.updateOldText(n),e=this.getEditEvent(n,null,null),this.trigger("nodeEditing",e,function(e){e.cancel||(r.fields.dataSource instanceof me&&!r.isOffline?r.crudOperation("update",null,t,i,null,null,!1):r.appendNewText(n,o,i,!1))}))},BW.prototype.uncheckAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!1)},wH([e(!(BW.prototype.setNodeFocusable=function(){var e=ge("."+V5,this.element);e&&(e.setAttribute("tabindex","0"),this.updateIdAttr(null,e))}))],BW.prototype,"allowDragAndDrop",void 0),wH([e(!1)],BW.prototype,"allowEditing",void 0),wH([e(!1)],BW.prototype,"allowMultiSelection",void 0),wH([e(!1)],BW.prototype,"allowTextWrap",void 0),wH([t({},EW)],BW.prototype,"animation",void 0),wH([e()],BW.prototype,"checkedNodes",void 0),wH([e(!0)],BW.prototype,"checkDisabledChildren",void 0),wH([e("")],BW.prototype,"cssClass",void 0),wH([e(!1)],BW.prototype,"disabled",void 0),wH([e(null)],BW.prototype,"dragArea",void 0),wH([e(!0)],BW.prototype,"enableHtmlSanitizer",void 0),wH([e(!1)],BW.prototype,"enablePersistence",void 0),wH([e()],BW.prototype,"expandedNodes",void 0),wH([e("Auto")],BW.prototype,"expandOn",void 0),wH([t({},CW)],BW.prototype,"fields",void 0),wH([e(!0)],BW.prototype,"fullRowSelect",void 0),wH([e(!0)],BW.prototype,"loadOnDemand",void 0),wH([e()],BW.prototype,"locale",void 0),wH([e()],BW.prototype,"nodeTemplate",void 0),wH([e()],BW.prototype,"selectedNodes",void 0),wH([e("None")],BW.prototype,"sortOrder",void 0),wH([e(!1)],BW.prototype,"showCheckBox",void 0),wH([e(!0)],BW.prototype,"autoCheck",void 0),wH([e(!1)],BW.prototype,"fullRowNavigable",void 0),wH([i()],BW.prototype,"actionFailure",void 0),wH([i()],BW.prototype,"created",void 0),wH([i()],BW.prototype,"dataBound",void 0),wH([i()],BW.prototype,"dataSourceChanged",void 0),wH([i()],BW.prototype,"drawNode",void 0),wH([i()],BW.prototype,"destroyed",void 0),wH([i()],BW.prototype,"keyPress",void 0),wH([i()],BW.prototype,"nodeChecked",void 0),wH([i()],BW.prototype,"nodeChecking",void 0),wH([i()],BW.prototype,"nodeClicked",void 0),wH([i()],BW.prototype,"nodeCollapsed",void 0),wH([i()],BW.prototype,"nodeCollapsing",void 0),wH([i()],BW.prototype,"nodeDragging",void 0),wH([i()],BW.prototype,"nodeDragStart",void 0),wH([i()],BW.prototype,"nodeDragStop",void 0),wH([i()],BW.prototype,"nodeDropped",void 0),wH([i()],BW.prototype,"nodeEdited",void 0),wH([i()],BW.prototype,"nodeEditing",void 0),wH([i()],BW.prototype,"nodeExpanded",void 0),wH([i()],BW.prototype,"nodeExpanding",void 0),wH([i()],BW.prototype,"nodeSelected",void 0),wH([i()],BW.prototype,"nodeSelecting",void 0);var MW,kW,PW=kW=wH([Bt],BW);function BW(e,t){e=MW.call(this,e,t)||this;return e.isRefreshed=!1,e.preventExpand=!1,e.checkedElement=[],e.disableNode=[],e.validArr=[],e.validNodes=[],e.expandChildren=[],e.isFieldChange=!1,e.changeDataSource=!1,e.hasTemplate=!1,e.isFirstRender=!1,e.isNodeDropped=!1,e.isInteracted=!1,e.isRightClick=!1,e.mouseDownStatus=!1,e.isDropIn=!1,e.OldCheckedData=[],e.isHiddenItem=!1,e}FW=function(e,t){return(FW=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])}))(e,t)};var FW,LW,Wz=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},RW="e-sidebar",OW="e-close",NW="e-open",VW="e-transition",_W="e-sidebar-overlay",HW="e-right",zW="e-left",jW="e-over",WW="e-push",QW="e-slide",UW="e-visibility",qW="e-disable-animation",GW="e-sidebar-context",YW="e-sidebar-absolute",wH=(function(e,t){function i(){this.constructor=e}FW(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(XW,LW=Ji),XW.prototype.preRender=function(){this.setWidth()},XW.prototype.render=function(){this.initialize(),this.wireEvents(),this.renderComplete()},XW.prototype.initialize=function(){this.setTarget(),this.addClass(),this.setZindex(),this.enableDock&&this.setDock(),this.isOpen?(this.show(),this.firstRender=!0):this.setMediaQuery(),this.checkType(!0),this.setType(this.type),this.setCloseOnDocumentClick(),this.setEnableRTL(),F.isDevice&&(this.windowWidth=window.innerWidth)},XW.prototype.setEnableRTL=function(){(this.enableRtl?U:q)([this.element],"e-rtl")},XW.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]),U([this.element],YW),U([this.target],GW),this.targetEle=this.getTargetElement())},XW.prototype.getTargetElement=function(){for(var e=this.element.nextElementSibling;!je(e)&&e.classList.contains(RW);)e=e.nextElementSibling;return e},XW.prototype.setCloseOnDocumentClick=function(){this.closeOnDocumentClick?(document.addEventListener("mousedown",this.documentClickContext),document.addEventListener("touchstart",this.documentClickContext)):(document.removeEventListener("mousedown",this.documentClickContext),document.removeEventListener("touchstart",this.documentClickContext))},XW.prototype.setWidth=function(){this.enableDock&&"Left"===this.position||this.enableDock&&"Right"===this.position?gt(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock||gt(this.element,{width:this.setDimension(this.width)})},XW.prototype.setDimension=function(e){return e="number"==typeof e?T(e):"string"==typeof e?e.match(/px|%|em/)?e:T(e):"100%"},XW.prototype.setZindex=function(){gt(this.element,{"z-index":""+this.zIndex})},XW.prototype.addClass=function(){"EJS-SIDEBAR"===this.element.tagName&&U([this.element],"e-sidebar-display");var e=document.querySelector(".e-main-content");je(e||this.targetEle)||U([e||this.targetEle],["e-content-animation"]),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):null,this.enableDock||"Auto"===this.type||U([this.element],[UW]),q([this.element],[NW,OW,HW,zW,QW,WW,jW]),this.element.classList.add(RW),U([this.element],"Right"===this.position?HW:zW),this.enableDock&&U([this.element],"e-dock"),je(this.tabIndex)||this.element.setAttribute("tabindex",this.tabIndex),"Auto"===this.type&&!F.isDevice&&this.checkMediaQuery()?this.show():this.isOpen||U([this.element],[OW,qW])},XW.prototype.checkType=function(e){"Push"!==this.type&&"Over"!==this.type&&"Slide"!==this.type?this.type="Auto":this.element.classList.contains(OW)||e||this.hide()},XW.prototype.transitionEnd=function(e){this.setDock(),je(e)||this.firstRender||this.triggerChange(),this.firstRender=!1,E.remove(this.element,"transitionend",this.transitionEnd)},XW.prototype.destroyBackDrop=function(){var e=document.querySelector(".e-main-content")||this.targetEle;this.target&&this.showBackdrop&&e&&!je(this.defaultBackdropDiv)?q([this.defaultBackdropDiv],_W):this.showBackdrop&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},XW.prototype.hide=function(e){var t=this,e={model:this,element:this.element,cancel:!1,isInteracted:!je(e),event:e||null};this.trigger("close",e,function(e){e.cancel||t.element.classList.contains(OW)||(t.element.classList.contains(NW)&&!t.animate&&t.triggerChange(),U([t.element],OW),q([t.element],NW),gt(t.element,{width:T(t.enableDock?t.dockSize:t.width)}),t.setType(t.type),e=document.querySelector(".e-main-content")||t.targetEle,!t.enableDock&&e&&(e.style.transform="translateX(0px)",e.style["Left"===t.position?"marginLeft":"marginRight"]="0px"),t.destroyBackDrop(),t.setAnimation(),"Slide"===t.type&&document.body.classList.remove("e-sidebar-overflow"),t.setProperties({isOpen:!1},!0),t.enableDock&&setTimeout(function(){return t.setTimeOut()},50),E.add(t.element,"transitionend",t.transitionEnd,t))})},XW.prototype.setTimeOut=function(){var e=document.querySelector(".e-main-content")||this.targetEle,t=this.element.getBoundingClientRect().width;!this.element.classList.contains(NW)||!e||"Over"===this.type&&this.enableDock?this.element.classList.contains(OW)&&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)):"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)},XW.prototype.show=function(e){var t=this,e={model:this,element:this.element,cancel:!1,isInteracted:!je(e),event:e||null};this.trigger("open",e,function(e){e.cancel||(q([t.element],[UW,qW]),t.element.classList.contains(NW))||(t.element.classList.contains(OW)&&!t.animate&&t.triggerChange(),U([t.element],[NW,VW]),gt(t.element,{transform:""}),q([t.element],OW),gt(t.element,{width:T(t.width)}),t.setType(t.type),t.createBackDrop(),t.setAnimation(),"Slide"===t.type&&document.body.classList.add("e-sidebar-overflow"),t.setProperties({isOpen:!0},!0),E.add(t.element,"transitionend",t.transitionEnd,t))})},XW.prototype.setAnimation=function(){(this.animate?q:U)([this.element],qW)},XW.prototype.triggerChange=function(){var e={name:"change",element:this.element};this.trigger("change",e)},XW.prototype.setDock=function(){this.enableDock&&"Left"===this.position&&!this.getState()?gt(this.element,{transform:"translateX(-100%) translateX("+this.setDimension(this.dockSize)+")"}):this.enableDock&&"Right"===this.position&&!this.getState()&&gt(this.element,{transform:"translateX(100%) translateX(-"+this.setDimension(this.dockSize)+")"}),this.element.classList.contains(OW)&&this.enableDock&&gt(this.element,{width:this.setDimension(this.dockSize)})},XW.prototype.createBackDrop=function(){var e,t;this.target&&this.showBackdrop&&this.getState()?(e=this.target,t=document.querySelector(".e-main-content")||this.targetEle,this.defaultBackdropDiv=this.createElement("div"),U([this.defaultBackdropDiv],_W),gt(this.defaultBackdropDiv,{height:e.style.height}),t.appendChild(this.defaultBackdropDiv)):this.showBackdrop&&!this.modal&&this.getState()&&(this.modal=this.createElement("div"),this.modal.className=_W,this.modal.style.display="block",document.body.appendChild(this.modal))},XW.prototype.getPersistData=function(){return this.addOnPersist(["type","position","isOpen"])},XW.prototype.getModuleName=function(){return"sidebar"},XW.prototype.toggle=function(){this.element.classList.contains(NW)?this.hide():this.show()},XW.prototype.getState=function(){return!!this.element.classList.contains(NW)},XW.prototype.setMediaQuery=function(){this.mediaQuery&&(("string"==typeof this.mediaQuery?window.matchMedia(this.mediaQuery):this.mediaQuery).matches&&this.windowWidth!==window.innerWidth?this.show():this.getState()&&this.windowWidth!==window.innerWidth&&this.hide())},XW.prototype.checkMediaQuery=function(){return!!je(this.mediaQuery)||("string"==typeof this.mediaQuery?window.matchMedia(this.mediaQuery):this.mediaQuery).matches},XW.prototype.resize=function(){je(this.width)||"auto"===this.width||"string"!=typeof this.width||this.width.includes("px")||this.setType(this.type),"Auto"===this.type&&(F.isDevice?U([this.element],jW):U([this.element],WW)),this.setMediaQuery(),F.isDevice&&(this.windowWidth=window.innerWidth)},XW.prototype.documentclickHandler=function(e){z(e.target,".e-control."+RW)||this.hide(e)},XW.prototype.enableGestureHandler=function(e){!this.isOpen&&"Left"===this.position&&"Right"===e.swipeDirection&&e.startX<=20&&50<=e.distanceX&&.5<=e.velocity?this.show():this.isOpen&&"Left"===this.position&&"Left"===e.swipeDirection||this.isOpen&&"Right"===this.position&&"Right"===e.swipeDirection?this.hide(e.originalEvent):!this.isOpen&&"Right"===this.position&&"Left"===e.swipeDirection&&window.innerWidth-e.startX<=20&&50<=e.distanceX&&.5<=e.velocity&&this.show()},XW.prototype.setEnableGestures=function(){this.enableGestures?(this.mainContentEle=new Mn(document.body,{swipe:this.enableGestureHandler.bind(this)}),this.sidebarEle=new Mn(this.element,{swipe:this.enableGestureHandler.bind(this)})):this.mainContentEle&&this.sidebarEle&&(this.mainContentEle.destroy(),this.sidebarEle.destroy())},XW.prototype.wireEvents=function(){this.setEnableGestures(),E.add(window,"resize",this.resize,this)},XW.prototype.unWireEvents=function(){E.remove(window,"resize",this.resize),E.remove(document,"mousedown touchstart",this.documentclickHandler),this.mainContentEle&&this.mainContentEle.destroy(),this.sidebarEle&&this.sidebarEle.destroy()},XW.prototype.onPropertyChanged=function(e,t){for(var i=document.querySelector(".e-main-content")||this.targetEle,n=this.isServerRendered,o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){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),q([this.element],[UW]),this.addClass(),U([this.element],"Auto"===this.type?F.isDevice?["e-over"]:["e-push"]:["e-"+this.type.toLowerCase()]);break;case"position":this.element.style.transform="",this.setDock(),i&&(i.style["Left"===this.position?"marginRight":"marginLeft"]="0px"),"Right"===this.position?(q([this.element],zW),U([this.element],HW)):(q([this.element],HW),U([this.element],zW)),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),je(this.target)&&(q([this.element],YW),q([t.target],GW),gt(i,{"margin-left":0,"margin-right":0}),document.body.insertAdjacentElement("afterbegin",this.element)),this.isServerRendered=!1,LW.prototype.refresh.call(this),this.isServerRendered=n;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()}},XW.prototype.setType=function(e){var t=this.element.getBoundingClientRect().width,i=(this.setZindex(),document.querySelector(".e-main-content")||this.targetEle),n=(i&&(i.style.transform="translateX(0px)",F.isDevice||"Auto"===this.type||"Over"===this.type&&this.enableDock||(i.style["Left"===this.position?"marginLeft":"marginRight"]="0px")),this.position,t+"px"),o="Left"===this.position?t:-t;switch(q([this.element],[WW,jW,QW]),e){case"Push":U([this.element],[WW]),i&&(this.enableDock||this.element.classList.contains(NW))&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=n);break;case"Slide":U([this.element],[QW]),i&&(this.enableDock||this.element.classList.contains(NW))&&(i.style.transform="translateX("+o+"px)");break;case"Over":U([this.element],[jW]),this.enableDock&&(this.element.classList.contains(OW)||this.isOpen)&&i&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=this.setDimension(this.dockSize));break;case"Auto":U([this.element],[VW]),F.isDevice?i&&this.enableDock&&!this.getState()?(i.style["Left"===this.position?"marginLeft":"marginRight"]=n,U([this.element],WW)):U([this.element],jW):(U([this.element],WW),i&&(this.enableDock||this.element.classList.contains(NW))&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=n)),this.createBackDrop()}},XW.prototype.destroy=function(){LW.prototype.destroy.call(this),this.target&&q([this.target],GW),this.destroyBackDrop(),this.element&&(q([this.element],[NW,OW,WW,QW,jW,zW,HW,VW,qW]),q([this.element],YW),this.element.style.width="",this.element.style.zIndex="",this.element.style.transform="",je(this.sidebarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.windowWidth=null;var e=document.querySelector(".e-main-content")||this.targetEle;je(e)||(e.style.margin="",e.style.transform=""),this.unWireEvents()},Wz([e("auto")],XW.prototype,"dockSize",void 0),Wz([e(null)],XW.prototype,"mediaQuery",void 0),Wz([e(!1)],XW.prototype,"enableDock",void 0),Wz([e("en-US")],XW.prototype,"locale",void 0),Wz([e(!1)],XW.prototype,"enablePersistence",void 0),Wz([e(!0)],XW.prototype,"enableGestures",void 0),Wz([e(!1)],XW.prototype,"isOpen",void 0),Wz([e(!1)],XW.prototype,"enableRtl",void 0),Wz([e(!0)],XW.prototype,"animate",void 0),Wz([e("auto")],XW.prototype,"height",void 0),Wz([e(!1)],XW.prototype,"closeOnDocumentClick",void 0),Wz([e("Left")],XW.prototype,"position",void 0),Wz([e(null)],XW.prototype,"target",void 0),Wz([e(!1)],XW.prototype,"showBackdrop",void 0),Wz([e("Auto")],XW.prototype,"type",void 0),Wz([e("auto")],XW.prototype,"width",void 0),Wz([e(1e3)],XW.prototype,"zIndex",void 0),Wz([i()],XW.prototype,"created",void 0),Wz([i()],XW.prototype,"close",void 0),Wz([i()],XW.prototype,"open",void 0),Wz([i()],XW.prototype,"change",void 0),Wz([i()],XW.prototype,"destroyed",void 0),Wz([Bt],XW));function XW(e,t){e=LW.call(this,e,t)||this;return e.documentClickContext=e.documentclickHandler.bind(e),e}KW=function(e,t){return(KW=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])}))(e,t)};var KW,JW,ZW,Wz=function(e,t){function i(){this.constructor=e}KW(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},$W=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},e8="e-icon-right",t8="e-breadcrumb-text",i8="e-breadcrumb-icon",n8="e-breadcrumb-menu",o8="e-breadcrumb-item",r8="e-breadcrumb-popup",s8="e-breadcrumb-wrap-mode",a8="e-breadcrumb-scroll-mode",l8="tabindex",h8="e-disabled",d8="aria-disabled",p8=".",c8=((c8=JW=JW||{}).Hidden="Hidden",c8.Collapsed="Collapsed",c8.Menu="Menu",c8.Wrap="Wrap",c8.Scroll="Scroll",c8.None="None",Wz(u8,ZW=n),$W([e("")],u8.prototype,"text",void 0),$W([e("")],u8.prototype,"id",void 0),$W([e("")],u8.prototype,"url",void 0),$W([e(null)],u8.prototype,"iconCss",void 0),$W([e(!1)],u8.prototype,"disabled",void 0),u8);function u8(){return null!==ZW&&ZW.apply(this,arguments)||this}Wz(m8,g8=Ji),m8.prototype.preRender=function(){},m8.prototype.render=function(){this.initialize(),this.renderItems(this.items),this.wireEvents()},m8.prototype.initialize=function(){this._maxItems=this.maxItems,je(this.element.getAttribute("aria-label"))&&this.element.setAttribute("aria-label","breadcrumb"),this.cssClass&&U([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&this.element.classList.add("e-rtl"),this.disabled&&(this.element.classList.add(h8),this.element.setAttribute(d8,"true")),"Wrap"===this.overflowMode?this.element.classList.add(s8):"Scroll"===this.overflowMode&&this.element.classList.add(a8),this.initItems(),this.initPvtProps()},m8.prototype.initPvtProps=function(){"Hidden"===this.overflowMode&&0<this._maxItems&&(this.endIndex=this.getEndIndex(),this.startIndex=this.endIndex+1-(this._maxItems-1)),"Menu"===this.overflowMode&&(0<=this._maxItems?(this.startIndex=1<this._maxItems?1:0,this.endIndex=this.getEndIndex(),this.popupUl=this.createElement("ul",{attrs:{TABINDEX:"0",role:"menu"}})):this.startIndex=this.endIndex=null)},m8.prototype.getEndIndex=function(){var i,n=this;return this.activeItem?this.items.forEach(function(e,t){e.url!==n.activeItem&&e.text!==n.activeItem||(i=t)}):i=this.items.length-1,i},m8.prototype.initItems=function(){if(!this.items.length){var e,t=void 0,i=void 0,n=[];i=(this.url?(t=(e=new URL(this.url,window.location.origin)).origin+"/",e):(t=window.location.origin+"/",window.location)).href.split(t)[1].split("/"),n.push({iconCss:"e-icons e-home",url:t});for(var o=0;o<i.length;o++)i[o]&&(n.push({text:i[o],url:t+i[o]}),t+=i[o]+"/");this.setProperties({items:n},!0)}},m8.prototype.renderItems=function(e){var t,i,o=this,r=this.element.classList.contains(e8),n=e.length;if(n){for(var s,a,l=void 0,h=0,d=void 0,p=2*n-1,c=!1,u=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-wrapped-ol":""}),g=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-first-ol":""}),m=this.hasField(e,"iconCss"),f="Collapsed"===this.overflowMode&&0<this._maxItems&&n>this._maxItems&&!this.isExpanded,y="Hidden"===this.overflowMode&&0<this._maxItems,v=("Menu"===this.overflowMode&&this.popupUl&&(this.popupUl.innerHTML=""),{moduleName:this.getModuleName(),showIcon:m,itemNavigable:!0,itemCreated:function(e){var t=e.curData.isLastItem,i=(t&&e.item.children.length&&!o.itemTemplate&&(delete e.curData.isLastItem,a||o.enableActiveItemNavigation||(e.item.innerHTML=o.createElement("span",{className:t8,innerHTML:e.item.children[0].innerHTML}).outerHTML)),!e.curData.iconCss||e.curData.text||o.itemTemplate||e.item.classList.add("e-icon-item"),y&&e.item.setAttribute("item-index",h.toString()),{item:Pe({},e.curData.properties||e.curData),element:e.item,cancel:!1}),n=(o.trigger("beforeItemRender",i),c=i.cancel,r||i.element.classList.contains(e8));n&&e.curData.iconCss&&!o.itemTemplate&&e.item.querySelector(".e-anchor-wrap").appendChild(e.item.querySelector(p8+i8)),i.item.disabled&&(e.item.setAttribute(d8,"true"),e.item.classList.add(h8)),i.item.id&&e.item.setAttribute("id",i.item.id),(i.item.disabled||o.disabled)&&e.item.children.length&&!o.itemTemplate&&e.item.children[0].setAttribute(l8,"-1"),e.curData.isEmptyUrl&&(e.item.children[0].removeAttribute("href"),t&&!o.enableActiveItemNavigation||i.item.disabled||o.disabled||(e.item.children[0].setAttribute(l8,"0"),E.add(e.item.children[0],"keydown",o.keyDownHandler,o))),e.item.removeAttribute("role"),t&&e.item.setAttribute("data-active-item",""),o.itemTemplate||o.beforeItemRenderChanges(e.curData,i.item,e.item,n)}}),b=0;b<p;b%2&&h++,b++)if(s=this.activeItem&&(this.activeItem===e[h].url||this.activeItem===e[h].text),!(f&&1<b&&b<p-2)&&(!y||!(h<this.startIndex||h>this.endIndex)||b%2&&h===this.startIndex-1||0===h)){b%2?(d=this.createElement("div",{className:"e-breadcrumb-item-wrapper"}),this.separatorTemplate&&"/"===this.separatorTemplate||je(this.separatorTemplate)?v.template=ao(function(){return"/"}):v.template=this.separatorTemplate,i=!(v.itemClass="e-breadcrumb-separator"),t=[{previousItem:e[h],nextItem:e[h+1]}]):(v.itemClass="",i=!this.itemTemplate||(v.template=this.itemTemplate,!1),(t=[Pe({},e[h].properties||e[h])])[0].url||this.itemTemplate||(t=[Pe({},t[0],{isEmptyUrl:!0,url:"#"})]),l=(y||"Menu"===this.overflowMode)&&h===this.endIndex,(b!==p-1&&!l||this.itemTemplate)&&!s||(t[0].isLastItem=!0));var w=u,C=this.startIndex+this.endIndex-this._maxItems;if("Menu"===this.overflowMode&&(h>=this.startIndex&&h<=C&&(!(b%2)||h!==C)&&this.endIndex>=this._maxItems&&0<this._maxItems||0===this._maxItems)){if(b%2)continue;w=this.popupUl,l&&(a=!0)}else"Wrap"===this.overflowMode&&(w=0===b?g:d);var C=X_.createList(this.createElement,t,v,i,this).childNodes;if(c){if(y||f||"Menu"===this.overflowMode||"Wrap"===this.overflowMode)return e.splice(h,1),this.initPvtProps(),this.reRenderItems();b!==p-1&&!l||ue(w.lastElementChild)}else ht(C,w);if("Wrap"===this.overflowMode&&0!==b&&b%2==0&&u.appendChild(d),f&&1===b&&(C=this.createElement("li",{className:"e-icons e-breadcrumb-collapsed",attrs:{TABINDEX:"0"}}),E.add(C,"keyup",this.expandHandler,this),u.appendChild(C)),"Menu"===this.overflowMode&&this.startIndex===b&&this.endIndex>=this._maxItems&&0<=this._maxItems&&(w=this.getMenuElement(),E.add(w,"keyup",this.keyDownHandler,this),u.appendChild(w)),s||l)break;c&&b++}this.isReact&&(this.renderReactTemplates(),setTimeout(function(){o.calculateMaxItems()},5)),"Wrap"===this.overflowMode&&this.element.appendChild(g),this.element.appendChild(u),this.isReact||this.calculateMaxItems()}},m8.prototype.calculateMaxItems=function(){if("Hidden"===this.overflowMode||"Collapsed"===this.overflowMode||"Menu"===this.overflowMode){var e,t,i=this.element.offsetWidth,n=[].slice.call(this.element.children[0].children).reverse(),o="Menu"===this.overflowMode?0:n[n.length-1].offsetWidth+(n[n.length-2]?n[n.length-2].offsetWidth:0);"Menu"===this.overflowMode&&(t=this.getMenuElement(),this.element.appendChild(t),o+=t.offsetWidth,ue(t));for(var r=0;r<n.length-2;r++){if(i<o){if(e=Math.ceil((r-1)/2)+("Menu"===this.overflowMode&&r<=2?0:1),(this.maxItems>e&&!(-1<this.maxItems&&-1===e)||-1===this.maxItems)&&this._maxItems!==e)return this._maxItems=e,this.initPvtProps(),this.reRenderItems();break}if("Menu"===this.overflowMode&&2===r&&i<(o+=n[n.length-1].offsetWidth+n[n.length-2].offsetWidth))return this._maxItems=1,this.initPvtProps(),this.reRenderItems();"Menu"===this.overflowMode&&n[r].classList.contains(n8)||(o+=n[r].offsetWidth)}}else if(("Wrap"===this.overflowMode||"Scroll"===this.overflowMode)&&0<this._maxItems){i=0;if((n=this.element.querySelectorAll(p8+o8)).length>this._maxItems+this._maxItems-1){for(r="Wrap"===this.overflowMode?1:0;r<this._maxItems+this._maxItems-1;r++)i+=n[r].offsetWidth;i=i+5+2*parseInt(getComputedStyle(this.element.children[0]).paddingLeft,10),"Wrap"===this.overflowMode?this.element.querySelector(".e-breadcrumb-wrapped-ol").style.width=i+"px":this.element.style.width=i+"px"}}},m8.prototype.hasField=function(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i][""+t])return!0;return!1},m8.prototype.getMenuElement=function(){return this.createElement("li",{className:"e-icons e-breadcrumb-menu",attrs:{TABINDEX:"0"}})},m8.prototype.beforeItemRenderChanges=function(e,t,i,n){var o,r=i.querySelector(".e-anchor-wrap");r&&r.parentElement.setAttribute("aria-label","home"),t.text!==e.text&&r&&r.childNodes.forEach(function(e){e.nodeType===Node.TEXT_NODE&&(e.textContent=t.text)}),t.iconCss!==e.iconCss&&r&&((o=i.querySelector(p8+i8))?t.iconCss?(q([o],e.iconCss.split(" ")),U([o],t.iconCss.split(" "))):ue(o):t.iconCss&&(o=this.createElement("span",{className:i8+" "+t.iconCss}),n?ht([o],r):r.insertBefore(o,r.childNodes[0]))),t.url!==e.url&&this.enableNavigation&&(n=i.querySelector("a."+t8))&&(t.url?n.setAttribute("href",t.url):n.removeAttribute("href"))},m8.prototype.reRenderItems=function(){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&this.popupObj.element.querySelector(".e-edit-template")&&(this.popupObj.hide(),this.popupObj.destroy(),this.isPopupCreated=!1,G(this.popupObj.element)),this.element.innerHTML="",this.renderItems(this.items)},m8.prototype.clickHandler=function(e){var t=z(e.target,p8+o8+":not(.e-breadcrumb-separator)");if(this.enableNavigation||e.preventDefault(),t&&(z(e.target,p8+t8)||this.itemTemplate)){var i=void 0,i=("Wrap"===this.overflowMode?[].slice.call(this.element.querySelectorAll(p8+o8)):[].slice.call(t.parentElement.children)).indexOf(t),t=("Menu"===this.overflowMode?z(e.target,p8+r8)?(i+=this.startIndex,this.endIndex=i,"keydown"===e.type&&this.documentClickHandler(e)):this.element.querySelector(p8+n8)?i>[].slice.call(this.element.children[0].children).indexOf(this.element.querySelector(p8+n8))?(i+=2*this.popupUl.childElementCount-2,i=Math.floor(i/2),this.endIndex=i):this.startIndex=this.endIndex=i:(i=Math.floor(i/2),this.startIndex=this.endIndex=i):i=Math.floor(i/2),"Hidden"===this.overflowMode&&0<this._maxItems&&0!==this.endIndex&&(i=parseInt(t.getAttribute("item-index"),10),1<this.startIndex&&(this.startIndex-=this.endIndex-i),this.endIndex=i),{element:t,item:this.items[i],event:e,cancel:!1});if(this.trigger("itemClick",t),t.cancel)return;this.items[i]&&(this.activeItem=this.items[i].url||this.items[i].text),this.dataBind()}e.target.classList.contains("e-breadcrumb-collapsed")&&(this.isExpanded=!0,this.reRenderItems()),e.target.classList.contains(n8)&&!this.isPopupCreated&&this.renderPopup()},m8.prototype.renderPopup=function(){var e=this,t=this.createElement("div",{className:r8+" "+this.cssClass+(this.enableRtl?" e-rtl":"")});document.body.appendChild(t),this.isPopupCreated=!0,this.popupObj=new Sv(t,{content:this.popupUl,relateTo:this.element.querySelector(p8+n8),enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},collision:{X:"fit",Y:"flip"},open:function(){e.popupUl&&e.popupUl.focus()}}),this.popupWireEvents(),this.popupObj.show()},m8.prototype.documentClickHandler=function(e){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&!z(e.target,p8+n8)&&!z(e.target,".e-edit-template")&&(this.popupObj.hide(),this.popupObj.destroy(),this.isPopupCreated=!1,G(this.popupObj.element))},m8.prototype.resize=function(){this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems()},m8.prototype.expandHandler=function(e){"Enter"===e.key&&(this.isExpanded=!0,this.reRenderItems())},m8.prototype.keyDownHandler=function(e){"Enter"===e.key&&this.clickHandler(e)},m8.prototype.popupKeyDownHandler=function(e){"Escape"===e.key&&this.documentClickHandler(e)},m8.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"items":case"enableActiveItemNavigation":this.reRenderItems();break;case"activeItem":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems();break;case"overflowMode":case"maxItems":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems(),"Wrap"===t.overflowMode?this.element.classList.remove(s8):"Wrap"===e.overflowMode&&this.element.classList.add(s8),"Scroll"===t.overflowMode?this.element.classList.remove(a8):"Scroll"===e.overflowMode&&this.element.classList.add(a8);break;case"url":this.initItems(),this.reRenderItems();break;case"cssClass":t.cssClass&&q([this.element],t.cssClass.split(" ")),e.cssClass&&U([this.element],e.cssClass.replace(/\s+/g," ").trim().split(" ")),(t.cssClass&&-1<t.cssClass.indexOf(e8)&&!(e.cssClass&&-1<e.cssClass.indexOf(e8))||!(t.cssClass&&-1<t.cssClass.indexOf(e8))&&e.cssClass&&-1<e.cssClass.indexOf(e8))&&this.reRenderItems();break;case"enableRtl":this.element.classList.toggle("e-rtl");break;case"disabled":this.element.classList.toggle(h8),this.element.setAttribute(d8,e.disabled+"")}},m8.prototype.wireEvents=function(){this.delegateClickHanlder=this.documentClickHandler.bind(this),E.add(document,"click",this.delegateClickHanlder,this),E.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resize.bind(this))},m8.prototype.popupWireEvents=function(){E.add(this.popupObj.element,"click",this.clickHandler,this),E.add(this.popupObj.element,"keydown",this.popupKeyDownHandler,this)},m8.prototype.unWireEvents=function(){E.remove(document,"click",this.delegateClickHanlder),E.remove(this.element,"click",this.clickHandler),window.removeEventListener("resize",this.resize.bind(this)),this.popupObj&&(E.remove(this.popupObj.element,"click",this.clickHandler),E.remove(this.popupObj.element,"keydown",this.popupKeyDownHandler))},m8.prototype.getPersistData=function(){return this.addOnPersist(["activeItem"])},m8.prototype.getModuleName=function(){return"breadcrumb"},m8.prototype.destroy=function(){var t=this,e=(this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&(this.popupObj.destroy(),this.isPopupCreated=!1,G(this.popupObj.element)),[]),i=["aria-label"];this.cssClass&&e.concat(this.cssClass.split(" ")),this.enableRtl&&e.push("e-rtl"),this.disabled&&(e.push(h8),i.push(d8)),"Wrap"===this.overflowMode?e.push(s8):"Scroll"===this.overflowMode&&e.push(a8),this.unWireEvents(),this.element.innerHTML="",q([this.element],e),i.forEach(function(e){t.element.removeAttribute(e)}),g8.prototype.destroy.call(this)},$W([e("")],m8.prototype,"url",void 0),$W([kt([],c8)],m8.prototype,"items",void 0),$W([e("")],m8.prototype,"activeItem",void 0),$W([e(-1)],m8.prototype,"maxItems",void 0),$W([e("Menu")],m8.prototype,"overflowMode",void 0),$W([e("")],m8.prototype,"cssClass",void 0),$W([e(null)],m8.prototype,"itemTemplate",void 0),$W([e("/")],m8.prototype,"separatorTemplate",void 0),$W([e(!0)],m8.prototype,"enableNavigation",void 0),$W([e(!1)],m8.prototype,"enableActiveItemNavigation",void 0),$W([e(!1)],m8.prototype,"disabled",void 0),$W([e("")],m8.prototype,"locale",void 0),$W([i()],m8.prototype,"beforeItemRender",void 0),$W([i()],m8.prototype,"itemClick",void 0),$W([i()],m8.prototype,"created",void 0);var g8,Wz=$W([Bt],m8);function m8(e,t){e=g8.call(this,e,t)||this;return e.isPopupCreated=!1,e}f8=function(e,t){return(f8=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])}))(e,t)};var f8,y8,v8,$W=function(e,t){function i(){this.constructor=e}f8(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},b8=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},w8="e-carousel",C8="e-active",S8="e-rtl",A8="e-partial",x8="e-swipe",I8="e-carousel-slide-container",T8="e-carousel-items",E8="e-carousel-item",D8="e-previous",M8="e-carousel-navigators",k8="e-carousel-indicators",P8="e-indicator-bars",B8="e-indicator-bar",F8="e-indicator",L8="e-icons",R8="e-play-pause",O8="e-play-icon",N8="e-pause-icon",V8="e-previous-button",_8="e-next-button",H8="e-play-button",z8="e-round",j8="e-hover-arrows",W8="e-carousel-hover",Q8="e-template",U8="e-carousel-slide-animation",q8="e-carousel-fade-animation",G8="e-carousel-custom-animation",Y8="e-carousel-animation-none",X8="e-prev",K8="e-next",J8="e-transition-start",Z8="e-transition-end",$8=(($8=y8=y8||{})[$8.Touch=1]="Touch",$8[$8.Mouse=2]="Mouse",$W(eQ,v8=n),b8([e()],eQ.prototype,"cssClass",void 0),b8([e()],eQ.prototype,"interval",void 0),b8([e()],eQ.prototype,"template",void 0),b8([e()],eQ.prototype,"htmlAttributes",void 0),eQ);function eQ(){return null!==v8&&v8.apply(this,arguments)||this}$W(iQ,tQ=Ji),iQ.prototype.getModuleName=function(){return w8.replace("e-","")},iQ.prototype.getPersistData=function(){return this.addOnPersist(["selectedIndex"])},iQ.prototype.preRender=function(){this.keyConfigs={home:"home",end:"end",space:"space",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"};this.localeObj=new Cn(this.getModuleName(),{nextSlide:"Next slide",of:"of",pauseSlideTransition:"Pause slide transition",playSlideTransition:"Play slide transition",previousSlide:"Previous slide",slide:"Slide",slideShow:"Slide show"},this.locale)},iQ.prototype.render=function(){this.initialize(),this.renderSlides(),this.renderNavigators(),this.renderPlayButton(),this.renderIndicators(),this.applyAnimation(),this.wireEvents()},iQ.prototype.onPropertyChanged=function(e,t){for(var i,n=0,o=Object.keys(e);n<o.length;n++){var r,s=o[n];switch(s){case"animationEffect":this.applyAnimation();break;case"cssClass":mt(this.element,[e.cssClass],[t.cssClass]);break;case"selectedIndex":this.setActiveSlide(this.selectedIndex,t.selectedIndex>this.selectedIndex?"Previous":"Next"),this.autoSlide();break;case"htmlAttributes":je(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element);break;case"enableTouchSwipe":!this.enableTouchSwipe&&this.touchModule&&this.touchModule.destroy(),this.element.querySelector("."+T8)&&this.renderTouchActions();break;case"loop":this.loop&&je(this.autoSlideInterval)&&this.applySlideInterval(),this.handleNavigatorsActions(this.selectedIndex),!this.partialVisible&&this.swipeMode===(~y8.Touch&~y8.Mouse)||this.reRenderSlides();break;case"allowKeyboardInteraction":this.keyModule&&(this.keyModule.destroy(),this.keyModule=null),e.allowKeyboardInteraction&&this.renderKeyboardActions();break;case"enableRtl":(r=[].slice.call(this.element.querySelectorAll("."+V8+",\n                ."+_8+", ."+H8))).push(this.element),(this.enableRtl?U:q)(r,S8),!this.partialVisible&&this.swipeMode===(~y8.Touch&~y8.Mouse)||(r=this.loop?this.getNumOfItems():0,a=this.itemsContainer.firstElementChild.clientWidth,this.itemsContainer.style.transform=this.getTranslateX(a,this.selectedIndex+r));break;case"buttonsVisibility":if(i=this.element.querySelector("."+M8))switch(this.buttonsVisibility){case"Hidden":this.resetTemplates(["previousButtonTemplate","nextButtonTemplate"]),ue(i);break;case"VisibleOnHover":U([].slice.call(i.childNodes),j8);break;case"Visible":q([].slice.call(i.childNodes),j8)}else this.renderNavigators(),this.renderPlayButton();break;case"width":gt(this.element,{width:T(this.width)});break;case"height":gt(this.element,{height:T(this.height)});break;case"autoPlay":this.showPlayButton&&je(this.playButtonTemplate)&&this.playButtonClickHandler(null,!0),this.autoSlide();break;case"interval":this.autoSlide();break;case"showIndicators":case"indicatorsType":(i=this.element.querySelector("."+k8))&&(this.resetTemplates(["indicatorsTemplate"]),ue(i)),this.renderIndicators();break;case"showPlayButton":i=this.element.querySelector("."+R8),!this.showPlayButton&&i&&(ue(i),this.resetTemplates(["playButtonTemplate"])),this.renderPlayButton();break;case"items":case"dataSource":var a="dataSource"===s?this.dataSource:this.items;!je(a)&&0<a.length&&this.selectedIndex>=a.length&&(this.setActiveSlide(a.length-1,"Previous"),this.autoSlide()),this.reRenderSlides(),this.reRenderIndicators();break;case"partialVisible":(this.partialVisible?U:q)([this.element],A8),this.reRenderSlides();break;case"swipeMode":E.remove(this.element,"mousedown touchstart",this.swipeStart),E.remove(this.element,"mousemove touchmove",this.swiping),E.remove(this.element,"mouseup touchend",this.swipStop),this.swipeModehandlers(),this.reRenderSlides()}}},iQ.prototype.reRenderSlides=function(){var e=this.element.querySelector("."+T8);e&&(this.resetTemplates(["itemTemplate"]),ue(e)),this.renderSlides()},iQ.prototype.reRenderIndicators=function(){var e=this.element.querySelector("."+k8);e&&(this.resetTemplates(["indicatorsTemplate"]),ue(e)),this.renderIndicators()},iQ.prototype.initialize=function(){var e=[];e.push(w8),this.cssClass&&e.push(this.cssClass),this.enableRtl&&e.push(S8),this.partialVisible&&e.push(A8),this.swipeMode!==(~y8.Touch&~y8.Mouse)&&e.push(x8),U([this.element],e),gt(this.element,{width:T(this.width),height:T(this.height)}),pt(this.element,{role:"group","aria-roledescription":"carousel","aria-label":this.localeObj.getConstant("slideShow")}),je(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},iQ.prototype.renderSlides=function(){var i=this,e=this.element.querySelector("."+I8),e=(e||(e=this.createElement("div",{className:I8,attrs:{tabindex:"0",role:"tabpanel"}}),this.element.appendChild(e)),this.itemsContainer=this.createElement("div",{className:T8,attrs:{"aria-live":this.autoPlay?"off":"polite"}}),e.appendChild(this.itemsContainer),this.getNumOfItems()),t=(0<e&&this.loop&&(0<this.items.length?this.items.slice(-e).forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer,!0)}):!je(this.dataSource)&&0<this.dataSource.length&&this.dataSource.slice(-e).forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer,!0)})),0<this.items.length?(this.slideItems=this.items,this.items.forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer)})):!je(this.dataSource)&&0<this.dataSource.length&&(this.slideItems=this.dataSource,this.dataSource.forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer)})),0<e&&this.loop&&(0<this.items.length?this.items.slice(0,e).forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer,!0)}):!je(this.dataSource)&&0<this.dataSource.length&&this.dataSource.slice(0,e).forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer,!0)})),this.renderTemplates(),this.itemsContainer.style.setProperty("--carousel-items-count",""+this.itemsContainer.children.length),je(this.itemsContainer.firstElementChild)?0:this.itemsContainer.firstElementChild.clientWidth),e=(this.itemsContainer.style.transitionProperty="none",this.loop?e:0);this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex+e),this.autoSlide(),this.renderTouchActions(),this.renderKeyboardActions()},iQ.prototype.getTranslateX=function(e,t){return void 0===t&&(t=1),this.enableRtl?"translateX("+e*t+"px)":"translateX("+-e*t+"px)"},iQ.prototype.renderSlide=function(e,t,i,n,o){void 0===o&&(o=!1);var r=this.createElement("div",{id:D("carousel_item"),className:E8+" "+(e.cssClass||"")+" "+(this.selectedIndex!==i||o?"":C8),attrs:{"aria-hidden":this.selectedIndex!==i||o?"true":"false","data-index":i.toString(),role:"group","aria-roledescription":"slide"}}),i=(o&&r.classList.add("e-cloned"),this.selectedIndex===i&&!o||r.setAttribute("inert","true"),je(e.htmlAttributes)||this.setHtmlAttributes(e.htmlAttributes,r),this.element.id+"_template");ht(this.templateParser(t)(e,this,"itemTemplate",i,!1),r),n.appendChild(r)},iQ.prototype.renderNavigators=function(){var e;"Hidden"!==this.buttonsVisibility&&(e=this.createElement("div",{className:M8}),this.element.querySelector("."+I8).insertAdjacentElement("afterend",e),!je(this.slideItems)&&1<this.slideItems.length&&(this.renderNavigatorButton("Previous"),this.renderNavigatorButton("Next")),this.renderTemplates())},iQ.prototype.renderNavigatorButton=function(e){var t,i=this.createElement("div",{className:("Previous"===e?D8:"e-next")+" "+("VisibleOnHover"===this.buttonsVisibility?j8:"")});"Previous"===e&&this.previousButtonTemplate?(U([i],Q8),t=this.element.id+"_previousButtonTemplate",ht(this.templateParser(this.previousButtonTemplate)({type:"Previous"},this,"previousButtonTemplate",t,!1),i)):"Next"===e&&this.nextButtonTemplate?(U([i],Q8),t=this.element.id+"_nextButtonTemplate",ht(this.templateParser(this.nextButtonTemplate)({type:"Next"},this,"nextButtonTemplate",t,!1),i)):(t=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant("Previous"===e?"previousSlide":"nextSlide"),type:"button"}}),new zv({cssClass:"e-flat "+z8+" "+("Previous"===e?V8:_8),iconCss:L8+" "+("Previous"===e?"e-previous-icon":"e-next-icon"),enableRtl:this.enableRtl,disabled:!this.loop&&this.selectedIndex===("Previous"===e?0:this.slideItems.length-1)}).appendTo(t),i.appendChild(t)),this.element.querySelector("."+M8).appendChild(i),E.add(i,"click",this.navigatorClickHandler,this)},iQ.prototype.renderPlayButton=function(){var e,t,i,n;je(this.slideItems)||"Hidden"===this.buttonsVisibility||!this.showPlayButton||this.slideItems.length<=1||(e=this.createElement("div",{className:R8+" "+("VisibleOnHover"===this.buttonsVisibility?j8:"")}),this.playButtonTemplate?(U([e],Q8),t=this.element.id+"_playButtonTemplate",ht(this.templateParser(this.playButtonTemplate)({},this,"playButtonTemplate",t,!1),e)):(t=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition"),type:"button"}}),n=this.selectedIndex===this.slideItems.length-1&&!this.loop,i=new zv({cssClass:"e-flat "+z8+" "+H8,iconCss:L8+" "+(this.autoPlay&&!n?N8:O8),isToggle:!0,enableRtl:this.enableRtl}),n&&(this.setProperties({autoPlay:!1},!0),t.setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),this.itemsContainer.setAttribute("aria-live","polite")),i.appendTo(t),e.appendChild(t)),(n=this.element.querySelector("."+M8)).insertBefore(e,n.lastElementChild),this.renderTemplates(),E.add(e,"click",this.playButtonClickHandler,this))},iQ.prototype.renderIndicators=function(){var n=this;if(this.showIndicators&&!je(this.indicatorsType)){var e,t="e-default",t=(this.indicatorsTemplate||(t="e-"+this.indicatorsType.toLowerCase()),this.createElement("div",{className:k8+" "+t})),o=this.createElement("div",{className:P8});if(t.appendChild(o),this.slideItems)switch(this.indicatorsType){case"Fraction":this.indicatorsTemplate?this.renderIndicatorTemplate(o,this.selectedIndex+1):o.innerText=this.selectedIndex+1+" / "+this.slideItems.length;break;case"Progress":this.indicatorsTemplate?this.renderIndicatorTemplate(o,this.selectedIndex+1):((e=this.createElement("div",{className:B8})).style.setProperty("--carousel-items-current",""+(this.selectedIndex+1)),e.style.setProperty("--carousel-items-count",""+this.slideItems.length),o.appendChild(e));break;case"Default":case"Dynamic":this.slideItems.forEach(function(e,t){var i=n.createElement("div",{className:B8+" "+(n.selectedIndex===t?C8:n.selectedIndex-1===t?X8:n.selectedIndex+1===t?K8:""),attrs:{"data-index":t.toString(),"aria-current":n.selectedIndex===t?"true":"false"}});i.style.setProperty("--carousel-items-current",""+n.selectedIndex),n.indicatorsTemplate?n.renderIndicatorTemplate(i,t):"Default"===n.indicatorsType&&(t=n.createElement("button",{className:F8,attrs:{type:"button","aria-label":n.localeObj.getConstant("slide")+" "+(t+1)+" "+n.localeObj.getConstant("of")+" "+n.slideItems.length}}),i.appendChild(t),t.appendChild(n.createElement("div",{})),new zv({cssClass:"e-flat e-small"}).appendTo(t)),o.appendChild(i),"Default"===n.indicatorsType&&E.add(i,"click",n.indicatorClickHandler,n)})}this.element.appendChild(t)}},iQ.prototype.renderIndicatorTemplate=function(e,t){void 0===t&&(t=0),U([e],Q8);var i=this.element.id+"_indicatorsTemplate";ht(this.templateParser(this.indicatorsTemplate)({index:t,selectedIndex:this.selectedIndex},this,"indicatorsTemplate",i,!1),e)},iQ.prototype.renderKeyboardActions=function(){this.allowKeyboardInteraction&&(this.keyModule=new bn(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}))},iQ.prototype.renderTouchActions=function(){this.enableTouchSwipe&&(this.touchModule=new Mn(this.element,{swipe:this.swipeHandler.bind(this)}))},iQ.prototype.applyAnimation=function(){switch(q([this.element],[G8,q8,U8,Y8]),this.animationEffect){case"Slide":U([this.element],U8);break;case"Fade":U([this.element],q8);break;case"None":U([this.element],Y8);break;case"Custom":U([this.element],G8)}},iQ.prototype.autoSlide=function(){je(this.slideItems)||this.slideItems.length<=1||(this.resetSlideInterval(),this.applySlideInterval())},iQ.prototype.autoSlideChange=function(){var e=this.element.querySelector("."+E8+"."+C8)||this.element.querySelector("."+k8+" ."+C8);je(e)||(e=parseInt(e.dataset.index,10),this.loop||e!==this.slideItems.length-1?(e=(e+1)%this.slideItems.length,this.element.classList.contains(W8)||this.setActiveSlide(e,"Next"),this.autoSlide()):this.resetSlideInterval())},iQ.prototype.applySlideInterval=function(){var e,t=this;this.autoPlay&&!this.element.classList.contains(W8)&&(e=this.interval,0<this.items.length&&!je(this.items[this.selectedIndex||0].interval)&&(e=this.items[this.selectedIndex||0].interval),this.autoSlideInterval=setInterval(function(){return t.autoSlideChange()},e))},iQ.prototype.resetSlideInterval=function(){clearInterval(this.autoSlideInterval),this.autoSlideInterval=null},iQ.prototype.getSlideIndex=function(e){var t=this.selectedIndex||0;return"Previous"===e?--t<0&&(t=this.slideItems.length-1):++t===this.slideItems.length&&(t=0),t},iQ.prototype.setActiveSlide=function(n,o,r){var s,a,e,t,l=this;void 0===r&&(r=!1),0<this.element.querySelectorAll("."+E8+"."+X8+",."+E8+"."+K8).length||(n=je(n)?0:n,s=[].slice.call(this.element.querySelectorAll("."+E8+":not(.e-cloned)")),je(t=this.element.querySelector("."+E8+"."+C8))&&this.showIndicators?(e=this.element.querySelector("."+B8+"."+C8),e=parseInt(e.dataset.index,10),U([s[parseInt(e.toString(),10)]],C8)):je(t)?U([s[parseInt(n.toString(),10)]],C8):(a=parseInt(t.dataset.index,10),e=s[parseInt(n.toString(),10)],t={currentIndex:a,nextIndex:n,currentSlide:t,nextSlide:e,slideDirection:o,isSwiped:r,cancel:!1},this.trigger("slideChanging",t,function(e){var t,i;e.cancel||(l.setProperties({selectedIndex:n},!0),pt(e.currentSlide,{"aria-hidden":"true"}),e.currentSlide.setAttribute("inert","true"),pt(e.nextSlide,{"aria-hidden":"false"}),e.nextSlide.removeAttribute("inert"),l.refreshIndicators(a,n),l.slideChangedEventArgs={currentIndex:e.nextIndex,previousIndex:e.currentIndex,currentSlide:e.nextSlide,previousSlide:e.currentSlide,slideDirection:o,isSwiped:r},t=s[parseInt(n.toString(),10)].clientWidth,i=l.getNumOfItems(),l.isSwipe||(l.itemsContainer.style.transitionDuration="0.6s"),l.isSwipe=!1,"Fade"===l.animationEffect?l.itemsContainer.classList.add("e-fade-in-out"):l.itemsContainer.style.transitionProperty="transform",l.loop?0===l.slideChangedEventArgs.currentIndex&&"Next"===l.slideChangedEventArgs.slideDirection?l.itemsContainer.style.transform=l.getTranslateX(t,s.length+i):l.slideChangedEventArgs.currentIndex===l.slideItems.length-1&&"Previous"===l.slideChangedEventArgs.slideDirection?l.itemsContainer.style.transform=l.partialVisible?l.getTranslateX(t):"translateX(0px)":l.itemsContainer.style.transform=l.getTranslateX(t,n+i):l.itemsContainer.style.transform=l.getTranslateX(t,n),"Slide"===l.animationEffect?"Previous"===o?(U([e.nextSlide],X8),e.nextSlide.setAttribute("data-slide-height",e.nextSlide.offsetHeight.toString()),U([e.currentSlide,e.nextSlide],Z8)):(U([e.nextSlide],K8),e.nextSlide.setAttribute("data-slide-height",e.nextSlide.offsetHeight.toString()),U([e.currentSlide,e.nextSlide],J8)):"Fade"===l.animationEffect?(q([e.currentSlide],C8),U([e.nextSlide],C8)):"Custom"===l.animationEffect?"Previous"===o?(U([e.nextSlide],K8),U([e.currentSlide],X8)):(U([e.currentSlide],X8),U([e.nextSlide],K8)):l.onTransitionEnd(),l.handleNavigatorsActions(n))})))},iQ.prototype.onTransitionEnd=function(){var e,t=this,i=(q(this.element.querySelectorAll("."+T8),"e-fade-in-out"),this.getNumOfItems());this.slideChangedEventArgs&&(this.itemsContainer.style.transitionProperty="none",this.loop&&(0===this.slideChangedEventArgs.currentIndex&&"Next"===this.slideChangedEventArgs.slideDirection||this.slideChangedEventArgs.currentIndex===this.slideItems.length-1&&"Previous"===this.slideChangedEventArgs.slideDirection)&&(e=this.slideChangedEventArgs.currentSlide.clientWidth,this.itemsContainer.style.transform=this.getTranslateX(e,this.slideChangedEventArgs.currentIndex+i)),U([this.slideChangedEventArgs.currentSlide],C8),q([this.slideChangedEventArgs.previousSlide],C8),this.trigger("slideChanged",this.slideChangedEventArgs,function(){q(t.element.querySelectorAll("."+E8),[X8,K8,J8,Z8]),t.slideChangedEventArgs=null}))},iQ.prototype.refreshIndicators=function(e,t){var i=this,n=this.element.querySelector("."+P8);if(!je(n)){var o=[].slice.call(n.childNodes);switch(this.indicatorsType){case"Default":case"Dynamic":pt(o[parseInt(e.toString(),10)],{"aria-current":"false"}),pt(o[parseInt(t.toString(),10)],{"aria-current":"true"}),q(o,[C8,X8,K8]),U([o[parseInt(t.toString(),10)]],C8),o[t-1]&&U([o[t-1]],X8),o[t+1]&&U([o[t+1]],K8),o.forEach(function(e){return e.style.setProperty("--carousel-items-current",""+i.selectedIndex)});break;case"Fraction":this.indicatorsTemplate?(0<n.children.length&&n.removeChild(n.firstElementChild),this.renderIndicatorTemplate(n,t+1)):n.innerText=this.selectedIndex+1+" / "+this.slideItems.length;break;case"Progress":this.indicatorsTemplate?(0<n.children.length&&n.removeChild(n.firstElementChild),this.renderIndicatorTemplate(n,t+1)):n.firstElementChild.style.setProperty("--carousel-items-current",""+(this.selectedIndex+1))}}},iQ.prototype.setHtmlAttributes=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];"class"===o?U([t],e[""+o]):t.setAttribute(o,e[""+o])}},iQ.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){return oo(t)}},iQ.prototype.getNavigatorState=function(e,t){e=e.querySelector("."+(t?V8:_8));return!!e&&K(e,zv).disabled},iQ.prototype.navigatorClickHandler=function(e){var e=e.currentTarget;this.getNavigatorState(e,e.classList.contains(D8))||(e=e.classList.contains(D8)?"Previous":"Next",this.setActiveSlide(this.getSlideIndex(e),e),this.autoSlide())},iQ.prototype.indicatorClickHandler=function(e){e=z(e.target,"."+B8),e=parseInt(e.dataset.index,10);this.selectedIndex!==e&&(this.setActiveSlide(e,this.selectedIndex>e?"Previous":"Next"),this.autoSlide())},iQ.prototype.playButtonClickHandler=function(e,t){void 0===t&&(t=!1);var i,n=this.element.querySelector("."+H8);n&&(i=K(n,zv),t||this.setProperties({autoPlay:!this.autoPlay},!0),n.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),i.iconCss=L8+" "+(this.autoPlay?N8:O8),i.dataBind(),this.itemsContainer.setAttribute("aria-live",this.autoPlay?"off":"polite"),this.autoPlay&&!this.loop&&this.selectedIndex===this.slideItems.length-1&&this.setActiveSlide(0,"Next"),this.autoSlide())},iQ.prototype.keyHandler=function(e){if(this.allowKeyboardInteraction){var t,i,n=!1,o=e.target;switch(e.preventDefault(),e.action){case"space":this.showIndicators&&o.classList.contains(F8)?o.click():o.classList.contains(w8)||o.classList.contains(H8)?this.playButtonClickHandler(e):o.classList.contains(_8)?this.next():o.classList.contains(V8)&&this.prev();break;case"end":i=this.slideItems.length-1,t="Next",n=!0;break;case"home":t="Previous",n=!(i=0);break;case"moveUp":case"moveLeft":case"moveDown":case"moveRight":this.showIndicators&&je(this.indicatorsTemplate)&&this.element.focus(),t="moveUp"===e.action||"moveLeft"===e.action?"Previous":"Next",i=this.getSlideIndex(t),n=!this.isSuspendSlideTransition(i,t)}n&&(this.setActiveSlide(i,t),this.autoSlide())}},iQ.prototype.swipeHandler=function(e){var t;this.element.classList.contains(W8)||je(this.slideItems)||this.slideItems.length<=1||(e="Right"===e.swipeDirection?"Previous":"Next",t=this.getSlideIndex(e),this.isSuspendSlideTransition(t,e))||(this.setActiveSlide(t,e,!0),this.autoSlide())},iQ.prototype.isSuspendSlideTransition=function(e,t){return!this.loop&&("Next"===t&&0===e||"Previous"===t&&e===this.slideItems.length-1)},iQ.prototype.handleNavigatorsActions=function(e){var t,i,n,o;"Hidden"!==this.buttonsVisibility&&(this.showPlayButton&&(t=this.element.querySelector("."+H8),n=this.selectedIndex===this.slideItems.length-1&&!this.loop,i=je(this.playButtonTemplate)&&t&&n,i=je(this.playButtonTemplate)&&t&&!n?!t.classList.contains(C8):i)&&(this.setProperties({autoPlay:!n},!0),t.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),this.itemsContainer.setAttribute("aria-live",this.autoPlay?"off":"polite"),(o=K(t,zv)).iconCss=L8+" "+(this.autoPlay?N8:O8),o.dataBind()),(i=this.element.querySelector("."+V8))&&je(this.previousButtonTemplate)&&((o=K(i,zv)).disabled=!this.loop&&0===e,o.dataBind()),n=this.element.querySelector("."+_8))&&je(this.nextButtonTemplate)&&((o=K(n,zv)).disabled=!this.loop&&e===this.slideItems.length-1,o.dataBind())},iQ.prototype.onHoverActions=function(e){var t=this.element.querySelector("."+M8);switch(e.type){case"mouseenter":"VisibleOnHover"===this.buttonsVisibility&&t&&q([].slice.call(t.childNodes),j8),this.pauseOnHover&&U([this.element],W8);break;case"mouseleave":"VisibleOnHover"===this.buttonsVisibility&&t&&U([].slice.call(t.childNodes),j8),q([this.element],W8),this.isSwipe&&this.swipStop()}this.autoSlide()},iQ.prototype.onFocusActions=function(e){switch(e.type){case"focusin":U([this.element],W8);break;case"focusout":q([this.element],W8)}this.autoSlide()},iQ.prototype.destroyButtons=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-control.e-btn"));e<t.length;e++){var i=K(t[e],zv);i&&i.destroy()}},iQ.prototype.getNumOfItems=function(){return this.partialVisible?2:1},iQ.prototype.getTranslateValue=function(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m41:0},iQ.prototype.swipeStart=function(e){this.timeStampStart||(this.timeStampStart=Date.now()),e.preventDefault(),this.isSwipe=!1,this.itemsContainer.classList.add("e-swipe-start"),this.prevPageX=(e.touches?e.touches[0]:e).pageX,this.initialTranslate=this.getTranslateValue(this.itemsContainer)},iQ.prototype.swiping=function(e){this.itemsContainer.classList.contains("e-swipe-start")&&(this.isSwipe=!0,e.preventDefault(),e=(e.touches?e.touches[0]:e).pageX,e=this.prevPageX-e,!this.loop&&(this.enableRtl&&(0===this.selectedIndex&&0<e||this.selectedIndex===this.itemsContainer.childElementCount-1&&e<0)||!this.enableRtl&&(0===this.selectedIndex&&e<0||this.selectedIndex===this.itemsContainer.childElementCount-1&&0<e))||(this.itemsContainer.style.transform="translateX("+(this.initialTranslate+(this.enableRtl?e:-e))+"px)"))},iQ.prototype.swipStop=function(){var e=Date.now()-this.timeStampStart,t=(t=this.getTranslateValue(this.itemsContainer)-this.initialTranslate)<0?-1*t:t;this.isSwipe&&(i=t*(F.isDevice?6:1.66),this.itemsContainer.style.transitionDuration=(F.isDevice?t:i)/e/10+"s");var t=this.itemsContainer.firstElementChild.clientWidth/2,i=(this.itemsContainer.classList.remove("e-swipe-start"),this.getTranslateValue(this.itemsContainer));i-this.initialTranslate<-t?this.swipeNavigation(!this.enableRtl):i-this.initialTranslate>t?this.swipeNavigation(this.enableRtl):(this.itemsContainer.style.transform="translateX("+this.initialTranslate+"px)","Fade"===this.animationEffect&&this.itemsContainer.classList.add("e-fade-in-out"))},iQ.prototype.swipeNavigation=function(e){e?this.next():this.prev()},iQ.prototype.swipeModehandlers=function(){(this.swipeMode&y8.Touch)===y8.Touch&&(E.add(this.itemsContainer,"touchstart",this.swipeStart,this),E.add(this.itemsContainer,"touchmove",this.swiping,this),E.add(this.itemsContainer,"touchend",this.swipStop,this)),(this.swipeMode&y8.Mouse)===y8.Mouse&&(E.add(this.itemsContainer,"mousedown",this.swipeStart,this),E.add(this.itemsContainer,"mousemove",this.swiping,this),E.add(this.itemsContainer,"mouseup",this.swipStop,this)),0===this.swipeMode&&(this.swipeMode&y8.Mouse&y8.Touch)==(y8.Mouse&y8.Touch)&&(E.add(this.itemsContainer,"mousedown touchstart",this.swipeStart,this),E.add(this.itemsContainer,"mousemove touchmove",this.swiping,this),E.add(this.itemsContainer,"mouseup touchend",this.swipStop,this))},iQ.prototype.resizeHandler=function(){var e,t;this.itemsContainer&&this.itemsContainer.firstElementChild&&(e=this.getNumOfItems(),t=this.itemsContainer.firstElementChild.clientWidth,this.loop?this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex+e):this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex))},iQ.prototype.wireEvents=function(){"Custom"!==this.animationEffect&&this.enableTouchSwipe&&this.swipeModehandlers(),E.add(this.element,"focusin focusout",this.onFocusActions,this),E.add(this.element,"mouseenter mouseleave",this.onHoverActions,this),E.add(this.element.firstElementChild,"animationend",this.onTransitionEnd,this),E.add(this.element.firstElementChild,"transitionend",this.onTransitionEnd,this),E.add(window,"resize",this.resizeHandler,this)},iQ.prototype.unWireEvents=function(){var t=this;[].slice.call(this.element.querySelectorAll("."+B8)).forEach(function(e){E.remove(e,"click",t.indicatorClickHandler)});[].slice.call(this.element.querySelectorAll("."+D8+",.e-next")).forEach(function(e){E.remove(e,"click",t.navigatorClickHandler)});var e=this.element.querySelector("."+R8);e&&E.remove(e,"click",this.playButtonClickHandler),E.remove(this.element.firstElementChild,"animationend",this.onTransitionEnd),E.remove(this.element.firstElementChild,"transitionend",this.onTransitionEnd),E.clearEvents(this.element),E.clearEvents(this.itemsContainer),E.remove(window,"resize",this.resizeHandler)},iQ.prototype.prev=function(){var e;!this.loop&&0===this.selectedIndex||(e=0===this.selectedIndex?this.slideItems.length-1:this.selectedIndex-1,this.setActiveSlide(e,"Previous"),this.autoSlide())},iQ.prototype.next=function(){var e;!this.loop&&this.selectedIndex===this.slideItems.length-1||(e=this.selectedIndex===this.slideItems.length-1?0:this.selectedIndex+1,this.setActiveSlide(e,"Next"),this.autoSlide())},iQ.prototype.play=function(){var e=this.element.querySelector("."+O8);this.showPlayButton&&e&&(mt(e,[N8],[O8]),this.element.querySelector("."+H8).setAttribute("aria-label",this.localeObj.getConstant("pauseSlideTransition"))),this.setProperties({autoPlay:!0},!0),this.itemsContainer.setAttribute("aria-live","off"),this.applySlideInterval()},iQ.prototype.pause=function(){var e=this.element.querySelector("."+N8);this.showPlayButton&&e&&(this.element.querySelector("."+H8).setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),mt(e,[O8],[N8])),this.setProperties({autoPlay:!1},!0),this.itemsContainer.setAttribute("aria-live","off"),this.resetSlideInterval()},iQ.prototype.renderTemplates=function(){(this.isAngular||this.isReact)&&this.renderReactTemplates()},iQ.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},iQ.prototype.destroy=function(){var t=this;this.resetTemplates(),this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.keyModule&&(this.keyModule.destroy(),this.keyModule=null),this.resetSlideInterval(),this.destroyButtons(),this.unWireEvents(),[].slice.call(this.element.children).forEach(function(e){t.element.removeChild(e)}),q([this.element],[w8,this.cssClass,S8,x8]),["role","style"].forEach(function(e){t.element.removeAttribute(e)}),this.itemsContainer=null,tQ.prototype.destroy.call(this)},b8([kt([],$8)],iQ.prototype,"items",void 0),b8([e("Slide")],iQ.prototype,"animationEffect",void 0),b8([e()],iQ.prototype,"previousButtonTemplate",void 0),b8([e()],iQ.prototype,"nextButtonTemplate",void 0),b8([e()],iQ.prototype,"indicatorsTemplate",void 0),b8([e()],iQ.prototype,"playButtonTemplate",void 0),b8([e()],iQ.prototype,"cssClass",void 0),b8([e([])],iQ.prototype,"dataSource",void 0),b8([e()],iQ.prototype,"itemTemplate",void 0),b8([e(0)],iQ.prototype,"selectedIndex",void 0),b8([e("100%")],iQ.prototype,"width",void 0),b8([e("100%")],iQ.prototype,"height",void 0),b8([e(5e3)],iQ.prototype,"interval",void 0),b8([e(!0)],iQ.prototype,"autoPlay",void 0),b8([e(!0)],iQ.prototype,"pauseOnHover",void 0),b8([e(!0)],iQ.prototype,"loop",void 0),b8([e(!1)],iQ.prototype,"showPlayButton",void 0),b8([e(!0)],iQ.prototype,"enableTouchSwipe",void 0),b8([e(!0)],iQ.prototype,"allowKeyboardInteraction",void 0),b8([e(!0)],iQ.prototype,"showIndicators",void 0),b8([e("Default")],iQ.prototype,"indicatorsType",void 0),b8([e("Visible")],iQ.prototype,"buttonsVisibility",void 0),b8([e(!1)],iQ.prototype,"partialVisible",void 0),b8([e(y8.Touch)],iQ.prototype,"swipeMode",void 0),b8([e()],iQ.prototype,"htmlAttributes",void 0),b8([i()],iQ.prototype,"slideChanging",void 0),b8([i()],iQ.prototype,"slideChanged",void 0);var tQ,$W=b8([Bt],iQ);function iQ(e,t){e=tQ.call(this,e,t)||this;return e.isSwipe=!1,e}nQ=function(e,t){return(nQ=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])}))(e,t)};var nQ,oQ,b8=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},rQ="e-appbar",sQ="e-horizontal-bottom",aQ="e-sticky",lQ="e-prominent",hQ="e-dense",dQ="e-rtl",pQ="e-light",cQ="e-primary",uQ="e-inherit",b8=(function(e,t){function i(){this.constructor=e}nQ(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(gQ,oQ=Ji),gQ.prototype.destroy=function(){oQ.prototype.destroy.call(this),this.element.classList.remove(rQ),this.element.removeAttribute("style"),this.element.removeAttribute("role")},gQ.prototype.getModuleName=function(){return"appbar"},gQ.prototype.getPersistData=function(){return this.addOnPersist([])},gQ.prototype.preRender=function(){},gQ.prototype.render=function(){this.element.classList.add(rQ),"HEADER"!==this.element.tagName&&this.element.setAttribute("role","banner"),this.cssClass&&U([this.element],this.cssClass.split(" ")),"Bottom"===this.position&&this.element.classList.add(sQ),this.isSticky&&this.element.classList.add(aQ),this.enableRtl&&this.element.classList.add(dQ),this.setHeightMode(),this.setColorMode(),je(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},gQ.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"mode":q([this.element],[hQ,lQ]),this.setHeightMode();break;case"position":("Bottom"===this.position?U:q)([this.element],sQ);break;case"cssClass":t.cssClass&&q([this.element],t.cssClass.split(" ")),e.cssClass&&U([this.element],e.cssClass.split(" "));break;case"isSticky":(this.isSticky?U:q)([this.element],aQ);break;case"htmlAttributes":if(!je(this.htmlAttributes)){if(!je(t.htmlAttributes))for(var o=0,r=Object.keys(t.htmlAttributes);o<r.length;o++){var s=r[o];"class"===s?q([this.element],t.htmlAttributes[""+s]):this.element.removeAttribute(s)}this.setHtmlAttributes(e.htmlAttributes,this.element)}break;case"colorMode":q([this.element],["e-dark",cQ,uQ,pQ]),this.setColorMode();break;case"enableRtl":(this.enableRtl?U:q)([this.element],dQ)}},gQ.prototype.setHtmlAttributes=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];"class"===o?U([t],e[""+o]):t.setAttribute(o,e[""+o])}},gQ.prototype.setHeightMode=function(){"Prominent"===this.mode?this.element.classList.add(lQ):"Dense"===this.mode&&this.element.classList.add(hQ)},gQ.prototype.setColorMode=function(){switch(this.colorMode){case"Light":this.element.classList.add(pQ);break;case"Dark":this.element.classList.add("e-dark");break;case"Primary":this.element.classList.add(cQ);break;case"Inherit":this.element.classList.add(uQ)}},b8([e("Regular")],gQ.prototype,"mode",void 0),b8([e("Top")],gQ.prototype,"position",void 0),b8([e()],gQ.prototype,"cssClass",void 0),b8([e(!1)],gQ.prototype,"isSticky",void 0),b8([e()],gQ.prototype,"htmlAttributes",void 0),b8([e("Light")],gQ.prototype,"colorMode",void 0),b8([i()],gQ.prototype,"created",void 0),b8([i()],gQ.prototype,"destroyed",void 0),b8([Bt],gQ));function gQ(e,t){return oQ.call(this,e,t)||this}mQ=function(e,t){return(mQ=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])}))(e,t)};var mQ,fQ,yQ,vQ,bQ=function(e,t){function i(){this.constructor=e}mQ(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},wQ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},CQ="--progress-position",SQ="e-vertical",AQ="e-horizontal",xQ="e-stepper-steps",IQ=((IQ=fQ=fQ||{}).NotStarted="NotStarted",IQ.InProgress="InProgress",IQ.Completed="Completed",bQ(TQ,yQ=n),wQ([e("")],TQ.prototype,"cssClass",void 0),wQ([e(!1)],TQ.prototype,"disabled",void 0),wQ([e("")],TQ.prototype,"iconCss",void 0),wQ([e(null)],TQ.prototype,"isValid",void 0),wQ([e("")],TQ.prototype,"label",void 0),wQ([e(!1)],TQ.prototype,"optional",void 0),wQ([e(fQ.NotStarted)],TQ.prototype,"status",void 0),wQ([e("")],TQ.prototype,"text",void 0),TQ);function TQ(){return null!==yQ&&yQ.apply(this,arguments)||this}(DQ=vQ=vQ||{}).Horizontal="Horizontal",DQ.Vertical="Vertical";bQ(MQ,EQ=Ji),MQ.prototype.preRender=function(){},MQ.prototype.getModuleName=function(){return"stepperBase"},MQ.prototype.getPersistData=function(){return this.addOnPersist([])},MQ.prototype.render=function(){},MQ.prototype.updateOrientaion=function(e){(e.classList.contains(AQ)||e.classList.contains(SQ))&&e.classList.remove(AQ,SQ),je(this.orientation)||e.classList.add("e-"+this.orientation.toLocaleLowerCase())},MQ.prototype.renderProgressBar=function(e){this.progressStep=this.createElement("div",{className:"e-stepper-progressbar"}),this.progressbar=this.createElement("div",{className:"e-progressbar-value"});var t,i=e.querySelector("li").querySelector(".e-step-label-container");this.progressStep.appendChild(this.progressbar),e.prepend(this.progressStep),this.progressbar.style.setProperty("--progress-value","0%"),e.classList.contains(SQ)&&(e.classList.contains("e-label-bottom")||e.classList.contains("e-label-top")?(t=e.querySelector("."+xQ),this.progressStep.style.setProperty(CQ,t.offsetWidth/2+"px")):this.progressStep.style.setProperty(CQ,this.progressBarPosition/2-1+"px")),i&&i.classList.contains("e-label-before")&&this.progressStep.style.setProperty(CQ,this.progressBarPosition-1+5+"px"),e.classList.contains(AQ)&&this.setProgressPosition(e)},MQ.prototype.setProgressPosition=function(e,t){var i=e.querySelector(".e-step-container"),n=i.firstElementChild,i=(!0!==t&&(t=0,t=e.classList.contains("e-label-before")?i.offsetParent.offsetHeight-n.offsetHeight/2-1:n.offsetHeight/2,this.progressStep.style.setProperty("--progress-top-position",t+"px")),e.querySelector("."+xQ).lastChild.firstChild);e.classList.contains("e-rtl")?(t=n.offsetLeft+n.offsetWidth-e.querySelector("."+xQ).offsetWidth,this.progressStep.style.setProperty("--progress-left-position",Math.abs(t)+"px"),this.progressStep.style.setProperty("--progress-bar-width",Math.abs(i.offsetLeft-n.offsetLeft)+"px")):(this.progressStep.style.setProperty("--progress-left-position",n.offsetLeft+1+"px"),this.progressStep.style.setProperty("--progress-bar-width",i.offsetWidth+i.offsetLeft-2-(n.offsetLeft+2)+"px"))},MQ.prototype.onPropertyChanged=function(e,t){},wQ([kt([],IQ)],MQ.prototype,"steps",void 0),wQ([e("")],MQ.prototype,"cssClass",void 0),wQ([e(!1)],MQ.prototype,"readOnly",void 0),wQ([e(vQ.Horizontal)],MQ.prototype,"orientation",void 0),wQ([i()],MQ.prototype,"created",void 0);var EQ,DQ=wQ([Bt],MQ);function MQ(e,t){return EQ.call(this,e,t)||this}kQ=function(e,t){return(kQ=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])}))(e,t)};var kQ,PQ,BQ,FQ,bQ=function(e,t){function i(){this.constructor=e}kQ(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},wQ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},LQ="e-indicator",RQ="e-step-text-container",OQ="e-step-selected",NQ="e-step-inprogress",VQ="e-step-notstarted",_Q="e-step-focus",HQ="e-step-completed",zQ="e-step-disabled",jQ="e-stepper-readonly",WQ="--progress-value",QQ="e-rtl",UQ="e-step-template",qQ="e-label-after",GQ="e-label-before",YQ="e-vertical",XQ="e-horizontal",KQ="e-step-item",JQ="e-step-text",ZQ="e-text",$Q="e-step-label",e6="e-label",t6="e-step-type-indicator",i6="e-step-type-label",n6="e-step-indicator",o6="e-stepper-tooltip",r6="e-linear",s6=(bQ(a6,PQ=n),wQ([e(!0)],a6.prototype,"enable",void 0),wQ([e(2e3)],a6.prototype,"duration",void 0),wQ([e(0)],a6.prototype,"delay",void 0),a6);function a6(){return null!==PQ&&PQ.apply(this,arguments)||this}(h6=BQ=BQ||{}).Top="Top",h6.Bottom="Bottom",h6.Start="Start",h6.End="End",(h6=FQ=FQ||{}).Default="Default",h6.Label="Label",h6.Indicator="Indicator";bQ(d6,l6=DQ),d6.prototype.preRender=function(){this.element.id||(this.element.id=D("e-"+this.getModuleName()));this.l10n=new Cn("stepper",{optional:"Optional"},this.locale),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space",enter:"enter",home:"home",end:"end",tab:"tab",shiftTab:"shift+tab",escape:"escape"},this.tooltipOpen=!1},d6.prototype.getModuleName=function(){return"stepper"},d6.prototype.render=function(){this.initialize(),this.navigationHandler(this.activeStep,null,!1),this.updateStepperStatus(!0)},d6.prototype.initialize=function(){this.element.setAttribute("aria-label",this.element.id),this.updatePosition(),this.stepperItemList=this.createElement("ol",{className:"e-stepper-steps"}),this.updateOrientaion(this.element),this.updateStepType(),this.element.appendChild(this.stepperItemList),this.cssClass&&U([this.element],this.cssClass.trim().split(" ")),this.readOnly&&this.element.classList.add(jQ),this.enableRtl&&this.element.classList.add(QQ),this.wireEvents(),this.updateTemplateFunction(),this.renderItems(),0<this.steps.length&&(this.initiateProgressBar(),this.checkValidStep(),this.updateAnimation(),this.updateTooltip(),this.wireKeyboardEvent())},d6.prototype.initiateProgressBar=function(){var e=this;1<this.steps.length&&(this.isAngular&&this.template?setTimeout(function(){e.renderProgressBar(e.element)}):this.renderProgressBar(this.element))},d6.prototype.updatePosition=function(){this.progressBarPosition=this.beforeLabelWidth=this.textEleWidth=0},d6.prototype.renderDefault=function(e){e=this.steps[parseInt(e.toString(),10)];return!e.iconCss&&!e.text&&!e.label},d6.prototype.updateAnimation=function(){var e=this.element.querySelector(".e-progressbar-value");this.animation.enable?(0<=this.animation.duration&&e&&e.style.setProperty("--duration",this.animation.duration+"ms"),0<=this.animation.delay&&e&&e.style.setProperty("--delay",this.animation.delay+"ms")):e&&(e.style.setProperty("--delay","0ms"),e.style.setProperty("--duration","0ms"))},d6.prototype.updateStepType=function(){var e;je(this.stepType)||(e=this.stepType.toLowerCase(),-1!==["indicator","label","default"].indexOf(e)&&("default"!==e&&this.element.classList.add("e-step-type-"+e),"indicator"!==e&&"label"!==e||!this.labelContainer||this.clearLabelPosition()))},d6.prototype.wireEvents=function(){E.add(window,"resize",this.updateResize,this),E.add(window,"click",this.updateStepFocus,this)},d6.prototype.unWireEvents=function(){E.remove(window,"resize",this.updateResize),E.remove(window,"click",this.updateStepFocus)},d6.prototype.updateResize=function(){this.stepperItemList&&this.progressbar&&this.element.classList.contains(XQ)&&this.setProgressPosition(this.element,!0),this.navigateToStep(this.activeStep,null,null,!1,!1)},d6.prototype.updateStepFocus=function(){var e;this.isKeyNavFocus&&(this.isKeyNavFocus=!1,e=this.element.querySelector("."+_Q))&&(e.classList.remove(_Q),this.element.classList.remove("e-steps-focus"))},d6.prototype.updateStepperStatus=function(e){for(var t=0;t<this.steps.length;t++){var i=this.steps[parseInt(t.toString(),10)],n=i.status.toLowerCase();if(e&&0===this.activeStep&&0===t&&(s=this.isProtectedOnChange,this.isProtectedOnChange=!0,i.status=fQ.InProgress,this.isProtectedOnChange=s),i&&"notstarted"!==n&&t===this.activeStep)for(var o=0;o<this.steps.length;o++){var r=this.stepperItemElements[parseInt(o.toString(),10)],s=(r.classList.remove(OQ,NQ,HQ,VQ),this.isProtectedOnChange);this.isProtectedOnChange=!0,"completed"===n?this.updateStatusClass(o,t,r):this.updateStatusClass(o,t,r,!0),this.isProtectedOnChange=s}else i&&"notstarted"!==n&&t!==this.activeStep&&this.navigationHandler(this.activeStep,null,!0)}},d6.prototype.updateStatusClass=function(e,t,i,n){var o=this.steps[parseInt(e.toString(),10)];e<t?(i.classList.add(HQ),o.status=fQ.Completed):e===t?i.classList.add(n?NQ:HQ,OQ):i.classList.add(VQ)},d6.prototype.renderItems=function(){for(var t=this,e=this.element.classList.contains(XQ),i=this.element.classList.contains(YQ),n=je(this.labelPosition)?"":this.labelPosition.toLowerCase(),o=0;o<this.steps.length;o++){this.stepperItemContainer=this.createElement("li",{className:"e-step-container"});var r,s,a,l=this.createElement("span",{className:"e-step"}),h=this.steps[parseInt(o.toString(),10)],d=!!h.label,p=!!h.text,c=this.element.classList.contains(t6),p=(this.stepperItemContainer.classList[0===o?"add":"remove"](OQ,NQ),this.stepperItemContainer.classList[0!==o?"add":"remove"](VQ),e&&this.stepperItemContainer.style.setProperty("--max-width",100/this.steps.length+"%"),this.renderDefault(o)&&(je(this.template)||""===this.template)?((r=!this.element.classList.contains("e-step-type-default")&&"indicator"===this.stepType.toLowerCase())&&l.classList.add("e-icons",n6),r||null!=h.isValid||(l.classList.add("e-step-content"),l.innerHTML=(o+1).toString()),this.stepperItemContainer.appendChild(l)):!je(this.template)&&""!==this.template||(r=!0,!(h.iconCss||!h.iconCss&&p&&d)||(p||d)&&this.element.classList.contains(i6)||(h.iconCss?(a=h.iconCss.trim().split(" "),(s=l.classList).add.apply(s,[LQ].concat(a)),this.stepperItemContainer.classList.add(KQ)):!h.iconCss&&p&&d&&(l.classList.add(LQ),l.innerHTML=h.text,this.stepperItemContainer.classList.add(KQ)),this.stepperItemContainer.appendChild(l),(e&&("start"===n||"end"===n)&&d||i&&("top"===n||"bottom"===n)&&d)&&!c&&(this.element.classList.add("e-label-"+n),this.createTextLabelElement(h.label),r=!1)),!p||h.iconCss&&c||!r||h.iconCss&&d||(!h.iconCss&&c||(!h.iconCss||this.element.classList.contains(i6))&&!d?(h.iconCss||d||this.element.classList.add("e-step-type-indicator"),this.checkValidState(h,l),d=!1):(d||this.createTextLabelElement(h.text),d&&this.element.classList.contains(i6)&&(this.createElement("span",{className:ZQ}).innerText=h.label),p=!d)),!d)||h.iconCss&&c||!r||(h.iconCss||p||!c?(!this.element.classList.contains(i6)||!p||this.element.classList.contains(i6)&&d)&&(this.createTextLabelElement(h.label,!0),this.updateLabelPosition(),(h.iconCss||p||this.stepperItemContainer.classList.contains(KQ))&&!this.element.classList.contains(i6)||(this.stepperItemContainer.classList.add("e-step-label-only"),null!==h.isValid&&(s=this.createElement("span",{className:"e-step-validation-icon e-icons"}),this.labelContainer.appendChild(s)))):this.checkValidState(h,l,!0)),h.optional&&(a=this.createElement("span",{className:"e-step-label-optional"}),this.l10n.setLocale(this.locale),c=this.l10n.getConstant("optional"),a.innerText=c,(d&&this.labelContainer&&(this.element.classList.contains(qQ)&&!this.stepperItemContainer.classList.contains("e-step-label-only")||e&&this.element.classList.contains(GQ)&&!this.stepperItemContainer.classList.contains("e-step-label-only"))||i&&this.element.classList.contains(GQ)?this.labelContainer:this.stepperItemContainer).appendChild(a),null!==h.isValid)&&this.stepperItemContainer.classList.add(h.isValid?"e-step-valid":"e-step-error"),h.cssClass&&U([this.stepperItemContainer],h.cssClass.trim().split(" ")),h.disabled&&(this.stepperItemContainer.classList[h.disabled?"add":"remove"](zQ),pt(this.stepperItemContainer,{tabindex:"-1","aria-disabled":"true"})),null!==h.isValid&&(h.isValid?this.stepperItemContainer.classList.add("e-step-valid"):this.stepperItemContainer.classList.add("e-step-error")),this.renderItemContent(o,!1),this.stepperItemContainer.classList.contains(NQ)?pt(this.stepperItemContainer,{tabindex:"0","aria-current":"true"}):pt(this.stepperItemContainer,{tabindex:"-1"}),this.wireItemsEvents(this.stepperItemContainer,o),this.stepperItemElements.push(this.stepperItemContainer),{element:this.stepperItemContainer,index:o});this.trigger("beforeStepRender",p,function(e){t.stepperItemList.appendChild(e.element)}),i&&(this.isAngular&&this.template?setTimeout(function(){t.calculateProgressBarPosition()}):this.calculateProgressBarPosition())}if(i&&this.element.classList.contains(GQ))for(var u=this.stepperItemList.querySelectorAll("."+e6),g=0;g<u.length;g++)u[parseInt(g.toString(),10)].style.setProperty("--label-width",this.beforeLabelWidth+5+"px")},d6.prototype.createTextLabelElement=function(e,t){var i=this.createElement("span",{className:(t=void 0===t?!1:t)?e6:RQ+" "+ZQ});i.innerText=e,(t?(this.labelContainer=this.createElement("span",{className:"e-step-label-container"}),this.labelContainer):this.stepperItemContainer).appendChild(i),this.stepperItemContainer.classList.add(t?$Q:JQ)},d6.prototype.calculateProgressBarPosition=function(){var e=!!this.element.classList.contains(GQ),t=this.stepperItemContainer.classList.contains(KQ)&&!this.stepperItemContainer.classList.contains(JQ)&&!this.stepperItemContainer.classList.contains($Q),i=this.stepperItemContainer.querySelector("."+RQ);i&&(this.textEleWidth=this.textEleWidth<i.offsetWidth?i.offsetWidth:this.textEleWidth),e?(i=this.stepperItemContainer.querySelector("."+e6).offsetWidth+15,this.beforeLabelWidth=Math.max(this.beforeLabelWidth,i),e=this.element.querySelector("ol").lastChild.querySelector("."+LQ),i=this.stepperItemContainer.querySelector("."+RQ),e||i?(e=this.beforeLabelWidth+(this.stepperItemContainer.querySelector("."+LQ)||i).offsetWidth/2,this.progressBarPosition=Math.max(this.progressBarPosition,e)):this.progressBarPosition=Math.max(this.progressBarPosition,this.beforeLabelWidth/2)):(i=this.element.querySelector("ol").lastChild,e=(t?this.stepperItemContainer:i.firstChild).offsetWidth,this.progressBarPosition=Math.max(this.progressBarPosition,e))},d6.prototype.checkValidState=function(e,t,i){null==e.isValid?(t.classList.add("e-step-content"),t.innerHTML=i?e.label:e.label||e.text,this.stepperItemContainer.appendChild(t)):(t.classList.add(LQ),this.stepperItemContainer.appendChild(t),this.stepperItemContainer.classList.add(KQ))},d6.prototype.updateCurrentLabel=function(){var e=this.labelPosition.toLowerCase();return this.element.classList.contains(XQ)?"top"===e?"before":"bottom"===e?"after":e:"start"===e?"before":"end"===e?"after":e},d6.prototype.updateLabelPosition=function(){this.clearLabelPosition(),this.labelContainer.classList.add("e-label-"+this.updateCurrentLabel()),"start"===this.labelPosition.toLowerCase()&&"vertical"===this.orientation.toLowerCase()&&this.stepperItemContainer.firstChild?this.stepperItemContainer.firstChild.before(this.labelContainer):this.stepperItemContainer.appendChild(this.labelContainer),this.element.classList.add("e-label-"+this.updateCurrentLabel())},d6.prototype.clearLabelPosition=function(){var e=this.labelContainer.classList.value.match(/(e-label-[after|before]+)/g);e&&(q([this.labelContainer],e),q([this.element],e))},d6.prototype.checkValidStep=function(){for(var l=this.element.classList.contains(t6),h=this,e=0;e<this.steps.length;e++)!function(e){var t,i,n,o,r,s=h.steps[parseInt(e.toString(),10)],a=h.stepperItemElements[parseInt(e.toString(),10)];null!==s.isValid&&(r=void 0,l&&!s.iconCss?r=a.querySelector("."+LQ):t=a.querySelector("."+LQ),!r&&l&&h.renderDefault(e)&&(r=a.querySelector("."+n6)),i=a.querySelector(".e-step-validation-icon"),s=s.iconCss.trim().split(" "),o=(n=a.classList.contains("e-step-valid"))?"e-check":"e-circle-info",r&&(r.classList.remove(n6),""!==r.innerHTML&&(r.innerHTML=""),r.classList.add("e-icons",o,LQ)),h.renderDefault(e)&&!l&&a.querySelector(".e-step").classList.add("e-icons",o,LQ),t&&(""!==t.innerHTML?t.innerHTML="":0<s.length&&s.forEach(function(e){t.classList.remove(e)}),t.classList.add("e-icons",o)),i)&&(i.classList.add(n?"e-circle-check":"e-circle-info"),h.element.classList.contains(YQ))&&(r=a.querySelector("."+e6),s=(e=a.querySelector("."+ZQ))?e.offsetWidth+e.getBoundingClientRect().left:r.offsetWidth+r.getBoundingClientRect().left,a.querySelector(".e-step-validation-icon").style.setProperty("--icon-position",s+20+"px"))}(e)},d6.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new NS({target:".e-step-container",windowCollision:!0,opensOn:"Custom",cssClass:this.cssClass?o6+" "+this.cssClass:o6,position:"TopCenter"}),this.tooltipObj.appendTo(this.stepperItemList)):je(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},d6.prototype.wireItemsEvents=function(e,t){E.add(e,"click",this.linearModeHandler.bind(this,e,t),this),E.add(e,"mouseover",this.openStepperTooltip.bind(this,t),this),E.add(e,"mouseleave",this.closeStepperTooltip,this)},d6.prototype.unWireItemsEvents=function(){for(var e=0;e<this.steps.length;e++){var t=this.stepperItemElements[parseInt(e.toString(),10)];E.remove(t,"click",this.linearModeHandler.bind(this,t,e)),E.remove(t,"mouseover",this.openStepperTooltip.bind(this,e)),E.remove(t,"mouseleave",this.closeStepperTooltip)}},d6.prototype.linearModeHandler=function(e,t,i){var n;this.linear&&(n=t-this.activeStep,1!==Math.abs(n))||this.stepClickHandler(t,i,e)},d6.prototype.openStepperTooltip=function(e){var t=this.steps[parseInt(e.toString(),10)];this.showTooltip&&(t.label||t.text)&&!this.tooltipOpen&&(this.updateTooltipContent(e),this.tooltipObj.open(this.stepperItemElements[parseInt(e.toString(),10)]),"label"!==this.stepType.toLocaleLowerCase()&&("indicator"===this.stepType.toLocaleLowerCase()||""!==t.label&&""!==t.iconCss||null===t.label&&""===t.iconCss&&""!==t.text)&&(e="inprogress"===t.status.toLowerCase()?o6+" e-step-inprogress-tip "+(this.cssClass||""):o6+" "+(this.cssClass||""),this.tooltipObj.setProperties({cssClass:e.trim()})),this.tooltipOpen=!0)},d6.prototype.closeStepperTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},d6.prototype.updateTooltipContent=function(e){var t,i;this.showTooltip&&(this.isReact&&this.clearTemplate(["stepperTooltipTemplate"]),t=void 0,e=this.steps[parseInt(e.toString(),10)],this.tooltipTemplate?(t=this.createElement("span",{className:"e-stepper-tooltip-content"}),ht(this.getTemplateFunction(this.tooltipTemplate)({value:e},this,"stepperTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),t),this.tooltipObj.setProperties({content:t},!0)):(i=e.label||e.text,this.tooltipObj.setProperties({content:ao(function(){return i})},!0)),this.renderReactTemplates())},d6.prototype.stepClickHandler=function(e,t,i){var n={element:i,event:t,previousStep:this.activeStep,activeStep:e};this.trigger("stepClick",n),this.navigateToStep(e,t,i,!0)},d6.prototype.updateTemplateFunction=function(){this.templateFunction=this.template?this.getTemplateFunction(this.template):null},d6.prototype.renderItemContent=function(e,t){var i,n=this.stepperItemList.querySelectorAll("li");t&&this.removeItemContent(n[parseInt(e.toString(),10)]),this.template&&((t?n[parseInt(e.toString(),10)]:this.stepperItemContainer).classList.add(UQ),i=this.steps[parseInt(e.toString(),10)],ht(this.templateFunction({step:i,currentStep:e},this,"stepperTemplate",this.element.id+"_stepperTemplate",this.isStringTemplate),t?n[parseInt(e.toString(),10)]:this.stepperItemContainer)),this.renderReactTemplates()},d6.prototype.removeItemContent=function(e){e.classList.remove(UQ);for(var t=e.firstElementChild,i=0;i<e.childElementCount;i++)t.remove()},d6.prototype.updateContent=function(){this.isReact&&this.clearTemplate(["stepperTemplate"]);for(var e=0;e<this.steps.length;e++)this.renderItemContent(e,!0)},d6.prototype.getTemplateFunction=function(t){if("string"!=typeof t)return oo(t);var i="";try{var e=ge(t),i=e?"SCRIPT"===e.tagName?e.innerHTML:e.outerHTML:t}catch(e){i=t}return oo(i)},d6.prototype.navigateToStep=function(t,i,n,o,e){var r,s=this,a={element:n,event:i,isInteracted:o,previousStep:this.activeStep,activeStep:t,cancel:!1};!1!==e?(r=this.activeStep,this.trigger("stepChanging",a,function(e){e.cancel||(s.navigationHandler(t),e={element:n,event:i,isInteracted:o,previousStep:r,activeStep:s.activeStep},s.trigger("stepChanged",e))})):this.navigationHandler(t)},d6.prototype.navigationHandler=function(e,t,i){e=Math.min(e,this.steps.length-1);var n=this.stepperItemElements.length,n=(0<=e&&e<n-1&&(e=this.stepperItemElements[parseInt(e.toString(),10)].classList.contains(zQ)?this.activeStep:e),this.isProtectedOnChange);this.isProtectedOnChange=!0,this.activeStep=parseInt(e.toString(),10),this.isProtectedOnChange=n;for(var o=0;o<this.steps.length;o++){var r=this.stepperItemElements[parseInt(o.toString(),10)],s=this.steps[parseInt(o.toString(),10)],a=(r.classList.remove(OQ,NQ,HQ,VQ),o===this.activeStep&&r.classList.add(OQ),0<=this.activeStep&&this.progressbar?this.element.classList.contains(XQ)?this.calculateProgressbarPos():this.progressbar.style.setProperty(WQ,100/(this.steps.length-1)*e+"%"):this.activeStep<0&&this.progressbar&&this.progressbar.style.setProperty(WQ,"0%"),o===this.activeStep?r.classList.add(NQ):0<this.activeStep&&o<this.activeStep?r.classList.add(HQ):r.classList.add(VQ),r.classList.contains(NQ)?pt(r,{tabindex:"0","aria-current":"true"}):pt(r,{tabindex:"-1","aria-current":"false"}),this.isProtectedOnChange);!(this.isProtectedOnChange=!0)!==i&&(o<this.activeStep||this.steps.length-1===this.activeStep&&"completed"===s.status.toLowerCase()?s.status=fQ.Completed:o===this.activeStep?s.status=fQ.InProgress:o>this.activeStep&&(s.status=fQ.NotStarted),t&&this.activeStep===o&&(s.status=t),"completed"===s.status.toLowerCase()&&(r.classList.remove(OQ,NQ,VQ),r.classList.add(HQ)),"notstarted"===s.status.toLowerCase())&&(r.classList.remove(OQ,NQ,HQ),r.classList.add(VQ)),this.isProtectedOnChange=a,this.updateIndicatorStatus(o,r)}this.updateStepInteractions()},d6.prototype.calculateProgressbarPos=function(){var e,i,n,t,o,r=this;(this.element.classList.contains(GQ)||this.element.classList.contains(qQ))&&!this.element.classList.contains(t6)&&this.stepperItemElements[parseInt(this.activeStep.toString(),10)].classList.contains(KQ)?(o=this.element.querySelector(".e-stepper-progressbar"),t=this.stepperItemElements[parseInt(this.activeStep.toString(),10)].firstChild,e=0===this.activeStep?0:(t.offsetLeft-o.offsetLeft+t.offsetWidth/2)/o.offsetWidth*100,this.element.classList.contains(QQ)&&(e=(o.getBoundingClientRect().right-t.getBoundingClientRect().right+t.offsetWidth/2)/o.offsetWidth*100),this.progressbar.style.setProperty(WQ,e+"%")):(n=i=0,this.stepperItemElements.forEach(function(e,t){e=e.offsetWidth;i+=e,t<=r.activeStep&&(n+=t===r.activeStep&&0!==t?e/2:e)}),t=(this.stepperItemList.offsetWidth-i)/(this.stepperItemElements.length-1),o=(n+t*this.activeStep)/this.stepperItemList.offsetWidth*100,this.progressbar.style.setProperty(WQ,o+"%"))},d6.prototype.updateIndicatorStatus=function(e,t){this.renderDefault(e)&&this.element.classList.contains(t6)&&!t.classList.contains("e-step-valid")&&!t.classList.contains("e-step-error")&&(t.classList.contains(HQ)?(t.firstChild.classList.remove("e-icons","e-step-indicator"),t.firstChild.classList.add(LQ,"e-icons","e-check")):(t.classList.contains(NQ)||t.classList.contains(VQ))&&(t.firstChild.classList.remove(LQ,"e-icons","e-check"),t.firstChild.classList.add("e-icons","e-step-indicator")))},d6.prototype.updateStepInteractions=function(){var i=this;this.element.classList.toggle(r6,this.linear),this.stepperItemElements.forEach(function(e,t){e.classList.toggle("e-previous",t===i.activeStep-1),e.classList.toggle("e-next",t===i.activeStep+1)})},d6.prototype.removeItemElements=function(){for(var e=0;e<this.stepperItemElements.length;e++)ue(this.stepperItemElements[parseInt(e.toString(),10)]);this.stepperItemElements=[]},d6.prototype.nextStep=function(){this.activeStep!==this.steps.length-1&&this.navigateToStep(this.activeStep+1,null,null,!1)},d6.prototype.previousStep=function(){0<this.activeStep&&this.navigateToStep(this.activeStep-1,null,null,!1)},d6.prototype.reset=function(){var e;0===this.activeStep?this.updateStepInteractions():(e=!!this.stepperItemElements[0].classList.contains(zQ),this.navigateToStep(e?-1:0,null,null,!1))},d6.prototype.refreshProgressbar=function(){this.stepperItemList&&this.progressbar&&this.setProgressPosition(this.element),this.navigateToStep(this.activeStep,null,null,!1,!1)},d6.prototype.updateElementClassArray=function(){q([this.element],[QQ,jQ,"e-steps-focus",qQ,GQ,"e-label-top","e-label-bottom","e-label-start","e-label-end",t6,i6,YQ,XQ,r6])},d6.prototype.destroy=function(){l6.prototype.destroy.call(this),this.unWireEvents(),this.unWireItemsEvents(),this.removeItemElements(),this.clearTemplate(),this.stepperItemList&&ue(this.stepperItemList),this.stepperItemList=null,this.progressStep&&ue(this.progressStep),this.progressStep=null,this.progressbar=null,this.progressBarPosition=null,this.stepperItemContainer=null,this.textContainer=null,this.labelContainer=null,this.updateElementClassArray(),this.element.removeAttribute("aria-label"),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),this.keyboardModuleStepper&&this.keyboardModuleStepper.destroy(),this.keyboardModuleStepper=null},d6.prototype.wireKeyboardEvent=function(){this.keyboardModuleStepper=new bn(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},d6.prototype.keyActionHandler=function(e){if(!this.readOnly)switch(e.action){case"uparrow":case"downarrow":case"leftarrow":case"rightarrow":case"tab":case"shiftTab":this.handleNavigation(this.enableRtl&&this.element.classList.contains(XQ)?"leftarrow"===e.action||"tab"===e.action||"uparrow"===e.action:"rightarrow"===e.action||"tab"===e.action||"downarrow"===e.action,e);break;case"space":case"enter":case"escape":this.handleNavigation(null,e);break;case"home":case"end":this.handleNavigation(null,e,this.enableRtl)}},d6.prototype.handleNavigation=function(e,t,i){this.isKeyNavFocus=!0,this.element.classList.add("e-steps-focus");var n=(n=this.element.querySelector("."+_Q))||this.element.querySelector("."+OQ),o=Array.prototype.slice.call(this.stepperItemList.children),r=o.indexOf(n);if("tab"===t.action||"shiftTab"===t.action||"downarrow"===t.action||"uparrow"===t.action||"space"===t.action||"home"===t.action||"end"===t.action)if("tab"===t.action&&r===o.length-1||"shiftTab"===t.action&&0===r){if(n.classList.contains(_Q))return void this.updateStepFocus()}else t.preventDefault();if("escape"===t.action&&(o[parseInt(r.toString(),10)].classList.remove(_Q),this.element.classList.remove("e-steps-focus")),"space"!==t.action&&"enter"!==t.action){for(var n=r,r=e?r+1:r-1;0<=r&&r<o.length&&o[parseInt(r.toString(),10)].classList.contains(zQ);)r=e?r+1:r-1;r=r<0?0:r>o.length-1?o.length-1:r,o[parseInt(n.toString(),10)].classList.contains(_Q)&&o[parseInt(n.toString(),10)].classList.remove(_Q),0<=(r="home"!==t.action&&"end"!==t.action?r:"home"===t.action?i?o.length-1:0:i?0:o.length-1)&&r<o.length&&o[parseInt(r.toString(),10)].classList.add(_Q)}else"space"!==t.action&&"enter"!==t.action||(n=!1,this.linear&&(i=this.activeStep-r,1!==Math.abs(i))||(this.navigateToStep(r,null,null,!0),n=!0),n&&(this.updateStepFocus(),this.stepperItemElements[r].focus()))},d6.prototype.renderStepperItems=function(e,t){this.updateElementClassArray(),this.removeItemElements(),this.element.querySelector(".e-stepper-progressbar").remove(),e&&this.updatePosition(),t&&this.updateStepType(),this.readOnly&&!this.element.classList.contains(jQ)&&this.element.classList.add(jQ),this.enableRtl&&!this.element.classList.contains(QQ)&&this.element.classList.add(QQ),this.updateOrientaion(this.element),this.renderItems(),this.renderProgressBar(this.element),this.checkValidStep(),this.updateAnimation(),this.navigateToStep(this.activeStep,null,this.stepperItemElements[this.activeStep],!0)},d6.prototype.updateDynamicSteps=function(e,t){if(e instanceof Array&&t instanceof Array)this.renderStepperItems(!0,!0);else for(var i=Object.keys(e),n=0;n<i.length;n++)for(var o=parseInt(Object.keys(e)[n],10),r=Object.keys(e[o]).length,s=0;s<r;s++){var a=Object.keys(e[o])[s];"status"===a?this.activeStep===o?this.navigationHandler(o,e[o].status):this.steps[o].status=t[o].status:(this.removeItemElements(),this.renderItems(),this.updateStepperStatus()),"label"===a&&(this.steps[o].iconCss||this.steps[o].text)&&"default"===this.stepType.toLowerCase()&&this.refreshProgressbar(),this.updateStepInteractions(),this.checkValidStep()}},d6.prototype.updateDynamicActiveStep=function(e,t){this.activeStep=e>this.steps.length-1||e<-1?t:this.activeStep,0<=this.activeStep&&this.stepperItemElements[parseInt(this.activeStep.toString(),10)].classList.contains(zQ)&&(this.activeStep=t),this.linear?(e=t-this.activeStep,1===Math.abs(e)&&this.navigateToStep(this.activeStep,null,null,!0)):this.navigateToStep(this.activeStep,null,this.stepperItemElements[this.activeStep],!0)},d6.prototype.updateDynamicCssClass=function(e,t){t&&q([this.element],t.trim().split(" ")),e&&U([this.element],e.trim().split(" ")),this.tooltipObj&&this.tooltipObj.setProperties({cssClass:this.cssClass?o6+" "+this.cssClass:o6})},d6.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"steps":this.updateDynamicSteps(e.steps,t.steps);break;case"orientation":this.updateOrientaion(this.element),this.renderStepperItems(!0);break;case"activeStep":this.updateDynamicActiveStep(e.activeStep,t.activeStep);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"](QQ);break;case"readOnly":this.element.classList[this.readOnly?"add":"remove"](jQ);break;case"cssClass":this.updateDynamicCssClass(e.cssClass,t.cssClass);break;case"labelPosition":this.renderStepperItems(!0);break;case"showTooltip":this.updateTooltip();break;case"stepType":this.renderStepperItems(!0,!0);break;case"template":this.updateTemplateFunction(),this.updateContent();break;case"animation":this.updateAnimation();break;case"linear":this.updateStepInteractions()}},wQ([e(0)],d6.prototype,"activeStep",void 0),wQ([t({},s6)],d6.prototype,"animation",void 0),wQ([e(!1)],d6.prototype,"linear",void 0),wQ([e(!1)],d6.prototype,"showTooltip",void 0),wQ([e("")],d6.prototype,"template",void 0),wQ([e("")],d6.prototype,"tooltipTemplate",void 0),wQ([e(BQ.Bottom)],d6.prototype,"labelPosition",void 0),wQ([e(FQ.Default)],d6.prototype,"stepType",void 0),wQ([i()],d6.prototype,"stepChanged",void 0),wQ([i()],d6.prototype,"stepChanging",void 0),wQ([i()],d6.prototype,"stepClick",void 0),wQ([i()],d6.prototype,"beforeStepRender",void 0);var l6,h6=wQ([Bt],d6);function d6(e,t){e=l6.call(this,e,t)||this;return e.stepperItemElements=[],e}p6=function(e,t){return(p6=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])}))(e,t)};var p6,c6,bQ=function(e,t){function i(){this.constructor=e}p6(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},wQ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},u6="e-ddt-hidden",g6="e-input-group-icon e-ddt-icon e-icons",m6="e-show-chip",f6="e-show-clear",y6="e-show-dd-icon",v6="e-chip-input",b6="e-input-focus",w6="e-input-group",C6="e-icon-anim",S6="e-chips",A6="e-chipcontent",x6="e-chips-close",I6="e-icon-hide",T6="e-ddt-icon-hide",E6="e-list-parent",D6="e-dropdown",M6="e-disabled",k6="e-selectall-parent",P6="e-hide-selectall",B6="e-all-text",F6="e-frame",L6="e-check",R6="e-checkbox-wrapper",O6="e-filter-wrap",N6="e-ddt-icon",V6="e-ddt-footer",_6="e-ddt-header",H6="e-no-data",z6="e-remain",j6="e-overflow",W6="e-show-text",Q6="e-total-count",U6="e-wrap-count",q6=(bQ(G6,c6=n),wQ([e("child")],G6.prototype,"child",void 0),wQ([e([])],G6.prototype,"dataSource",void 0),wQ([e("expanded")],G6.prototype,"expanded",void 0),wQ([e("hasChildren")],G6.prototype,"hasChildren",void 0),wQ([e("htmlAttributes")],G6.prototype,"htmlAttributes",void 0),wQ([e("iconCss")],G6.prototype,"iconCss",void 0),wQ([e("imageUrl")],G6.prototype,"imageUrl",void 0),wQ([e("parentValue")],G6.prototype,"parentValue",void 0),wQ([e(null)],G6.prototype,"query",void 0),wQ([e("selectable")],G6.prototype,"selectable",void 0),wQ([e("selected")],G6.prototype,"selected",void 0),wQ([e(null)],G6.prototype,"tableName",void 0),wQ([e("text")],G6.prototype,"text",void 0),wQ([e("tooltip")],G6.prototype,"tooltip",void 0),wQ([e("value")],G6.prototype,"value",void 0),G6);function G6(){return null!==c6&&c6.apply(this,arguments)||this}bQ(K6,Y6=n),wQ([e(!1)],K6.prototype,"autoCheck",void 0),wQ([e(!0)],K6.prototype,"checkDisabledChildren",void 0),wQ([e("Auto")],K6.prototype,"expandOn",void 0),wQ([e(!1)],K6.prototype,"loadOnDemand",void 0);var Y6,X6=K6;function K6(){return null!==Y6&&Y6.apply(this,arguments)||this}bQ($6,J6=Ji),$6.prototype.getPersistData=function(){return this.addOnPersist(["value"])},$6.prototype.getLocaleName=function(){return"drop-down-tree"},$6.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.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate",this.customTemplateId=this.element.id+"CustomTemplate",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"}},$6.prototype.render=function(){var e=ge("#"+this.element.id+"_tree",document),e=(e&&G(ge("#"+this.element.id+"_options",document)||e.parentElement),"INPUT"===this.element.tagName?(this.inputEle=this.element,je(this.inputEle.getAttribute("role"))&&(this.inputEle.setAttribute("aria-expanded","false"),this.inputEle.setAttribute("role","combobox"),this.inputEle.setAttribute("aria-haspopup","tree"),this.inputEle.setAttribute("aria-controls",this.element.id+"_options")),je(this.inputEle.getAttribute("type"))&&this.inputEle.setAttribute("type","text")):(je(this.element.id)?this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text"}}):this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text",id:this.element.id+"_textbox"}}),this.element.parentElement.insertBefore(this.inputEle,this.element)),this.inputObj=HF.createInput({element:this.inputEle,floatLabelType:this.floatLabelType,buttons:this.showDropDownIcon?[g6]: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(w6)||this.inputWrapper.classList.add(w6),this.showDropDownIcon&&this.inputWrapper.classList.add(y6),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.updateDataAttribute(),this.setHTMLAttributes(),this.setAttributes(),this.popupDiv=this.createElement("div",{className:"e-popup-content"}),this.popupDiv.classList.add(D6),this.tree=this.createElement("div",{id:this.element.id+"_tree"}),this.popupDiv.appendChild(this.tree),this.destroyPopupOnHide||document.body.appendChild(this.popupDiv),this.wireTreeEvents(),U([this.popupDiv],T6),this.renderTree(),this.isRemoteData=this.fields.dataSource instanceof me,(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.createChip(),this.wrapText||"Custom"===this.mode||(this.overFlowWrapper=this.createElement("span",{className:j6+" "+I6}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement),"Box"!==this.mode&&U([this.overFlowWrapper],W6))),this.isRemoteData||(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText)||this.updateView(),this.wireEvents(),ge("."+E6,this.treeObj.element));e&&e.getAttribute("aria-multiselectable")&&e.removeAttribute("aria-multiselectable"),this.setOldValue(),this.isRemoteData||(this.isInitialized=!0),this.hasTemplate=this.itemTemplate||this.headerTemplate||this.footerTemplate||this.actionFailureTemplate||this.noRecordsTemplate||this.customTemplate||this.valueTemplate,this.renderComplete()},$6.prototype.hideCheckAll=function(e){var t=je(this.popupEle)?null:this.popupEle.querySelector("."+k6);je(t)||(e&&!t.classList.contains(P6)?U([t],P6):!e&&t.classList.contains(P6)&&q([t],P6))},$6.prototype.renderFilter=function(){this.filterContainer=this.createElement("div",{id:this.element.id+"_filter_wrap",className:O6});var e=this.createElement("input",{id:this.element.id+"_filter",attrs:{autocomplete:"off","aria-label":this.filterBarPlaceholder}});this.filterContainer.appendChild(e),lt([this.filterContainer],this.popupEle),this.filterObj=new fV({value:"",showClearButton:!0,placeholder:this.filterBarPlaceholder,input:this.filterChangeHandler.bind(this)}),this.filterObj.appendTo("#"+this.element.id+"_filter"),this.keyboardModule=new bn(this.filterObj.element,{keyAction:this.filterKeyAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},$6.prototype.filterKeyAction=function(t){var i,n=this;this.trigger("keyPress",{cancel:!1,event:t},function(e){if(!e.cancel)switch(t.action){case"altUp":n.isPopupOpen&&n.hidePopup();break;case"shiftTab":U([n.inputWrapper],[b6]);break;case"moveDown":t.preventDefault(),n.filterObj.element.blur(),(i=n.treeObj.element.querySelector("li"))&&i.focus()}})},$6.prototype.filterChangeHandler=function(e){var t=this;je(e.value)||(window.clearTimeout(this.filterTimer),this.filterTimer=window.setTimeout(function(){t.filterHandler(e.value,e.event)},this.filterDelayTime))},$6.prototype.isChildObject=function(){return"object"==typeof this.treeObj.fields.child},$6.prototype.filterHandler=function(e,t){var o=this,i=(this.isFromFilterChange=!0,this.isFilteredData||(this.isRemoteData&&(this.treeObj.expandedNodes=[]),this.treeData=this.treeObj.getTreeData()),this.cloneFields(this.fields)),t={cancel:!1,preventDefaultAction:!1,event:t,text:e.trim(),fields:i};this.trigger("filtering",t,function(e){if(!e.cancel){var t=!1,i=void 0;if(o.isFilteredData=!0,""===e.text?(o.isFilteredData=!1,o.isFilterRestore=!0,i=o.cloneFields(o.fields),o.treeObj.element.classList.remove("e-filtering")):(e.preventDefaultAction?i=e.fields:1===o.treeDataType?i=o.selfReferencefilter(e.text,e.fields):o.fields.dataSource instanceof me?((i=o.remoteDataFilter(e.text,e.fields)).child=o.fields.child,o.treeObj.fields=o.getTreeFields(e.fields),o.treeObj.dataBind(),t=!0):i=o.nestedFilter(e.text,e.fields),o.treeObj.element.classList.add("e-filtering")),o.hideCheckAll(o.isFilteredData),!t&&(o.isRemoteData&&(o.isChildObject()?i.child=o.fields.child:i=e.fields),o.treeObj.fields=o.getTreeFields(i),o.treeObj.dataBind(),o.popupObj&&o.popupObj.refreshPosition(),o.hasTemplate&&o.portals&&o.treeObj.portals)){for(var n=0;n<o.treeObj.portals.length;n++)-1===o.portals.indexOf(o.treeObj.portals[n])&&o.portals.push(o.treeObj.portals[n]);o.isReact&&o.renderReactTemplates()}}})},$6.prototype.remoteDataFilter=function(t,e){var i=this;return e.dataSource=this.treeData.map(function(e){return i.remoteChildFilter(t,e)}).filter(function(e){return!je(e)}),e},$6.prototype.remoteChildFilter=function(e,t,i,n){var o=this.isChildObject()?t.child:t[this.fields.child];if(je(o))return this.isMatchedNode(e,t,i,n)?t:null;for(var r=[],s=0;s<o.length;s++){var a=this.remoteChildFilter(e,o[s],!0,!0);je(a)||r.push(a)}i=Object.assign({},t);return n=!1,0!==r.length?i.child=r:(i.child=null,i=this.isMatchedNode(e,i)?i:null),i},$6.prototype.nestedFilter=function(e,t){for(var i=[],n=0;n<this.treeData.length;n++){var o=this.nestedChildFilter(e,this.treeData[parseInt(n.toString(),10)]);je(o)||i.push(o)}return t.dataSource=i,t},$6.prototype.nestedChildFilter=function(e,t){var i=t[this.fields.child];if(je(i))return this.isMatchedNode(e,t)?t:null;for(var n=[],o=0;o<i.length;o++){var r=this.nestedChildFilter(e,i[parseInt(o.toString(),10)]);je(r)||n.push(r)}t=Object.assign({},t);return 0!==n.length?(t[this.fields.child]=n,t):(t[this.fields.child]=null,this.isMatchedNode(e,t)?t:null)},$6.prototype.selfReferencefilter=function(e,t){for(var i=[],n=[],o=0;o<this.treeData.length;o++)this.isMatchedNode(e,this.treeData[o])&&i.push(this.treeData[o]);for(o=0;o<i.length;o++)if(-1===n.indexOf(i[o])){n.push(i[o]);for(var r=i[parseInt(o.toString(),10)][this.fields.parentValue];!je(r);){for(var s=null,a=0;a<this.treeData.length;a++){var l=this.treeData[parseInt(a.toString(),10)][this.fields.value];if(!je(l)&&l===r){s=this.treeData[a];break}}if(je(s)||-1!==n.indexOf(s))break;n.push(s),r=s[this.fields.parentValue]}}return t.dataSource=n,t},$6.prototype.isMatchedNode=function(e,t,i,n){i=i&&n&&this.isChildObject()?t[this.fields.child.text]:t[this.fields.text];if(!i&&!je(this.fields.child.text)){for(var o=this.fields.child;!t[o.text];)o=o.child;i=t[o.text]}return this.ignoreCase&&(i=i.toLowerCase(),e=e.toLowerCase()),this.ignoreAccent&&(i=Sa.ignoreDiacritics(i),e=Sa.ignoreDiacritics(e)),"StartsWith"===this.filterType?i.slice(0,e.length)===e:"EndsWith"===this.filterType?i.slice(-e.length)===e:-1!==i.indexOf(e)},$6.prototype.wireEvents=function(){E.add(this.inputWrapper,"mouseup",this.dropDownClick,this),E.add(this.inputWrapper,"focus",this.focusIn,this),E.add(this.inputWrapper,"blur",this.focusOut,this),E.add(this.inputWrapper,"mousemove",this.mouseIn,this),E.add(this.inputWrapper,"mouseout",this.onMouseLeave,this),E.add(this.overAllClear,"mousedown",this.clearAll,this),E.add(window,"resize",this.windowResize,this);var e=z(this.inputWrapper,"form");e&&E.add(e,"reset",this.resetValueHandler,this),this.keyboardModule=new bn(this.inputWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},$6.prototype.wireTreeEvents=function(){this.keyboardModule=new bn(this.tree,{keyAction:this.treeAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},$6.prototype.wireCheckAllWrapperEvents=function(){this.keyboardModule=new bn(this.checkAllParent,{keyAction:this.checkAllAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},$6.prototype.unWireEvents=function(){E.remove(this.inputWrapper,"mouseup",this.dropDownClick),E.remove(this.inputWrapper,"focus",this.focusIn),E.remove(this.inputWrapper,"blur",this.focusOut),E.remove(this.inputWrapper,"mousemove",this.mouseIn),E.remove(this.inputWrapper,"mouseout",this.onMouseLeave),E.remove(this.overAllClear,"mousedown",this.clearAll),E.remove(window,"resize",this.windowResize);var e=z(this.inputWrapper,"form");e&&E.remove(e,"reset",this.resetValueHandler),this.keyboardModule.destroy(),this.showSelectAll&&this.checkAllParent&&E.remove(this.checkAllParent,"mouseup",this.clickHandler),document.removeEventListener("mousedown",this.documentClickContext)},$6.prototype.dropDownClick=function(e){this.enabled&&!this.readonly&&(this.isClearButtonClick?this.isClearButtonClick=!1:(this.isPopupOpen?this.hidePopup():(this.focusIn(e),this.renderPopup()),this.showOverAllClear()))},$6.prototype.mouseIn=function(){!this.enabled&&this.readonly||this.showOverAllClear()},$6.prototype.onMouseLeave=function(){this.inputFocus||(U([this.overAllClear],I6),q([this.inputWrapper],f6))},$6.prototype.getDirective=function(){return"EJS-DROPDOWNTREE"},$6.prototype.focusOut=function(e){var t;!this.enabled||this.readonly||!this.inputFocus||(F.isIE||"edge"===F.info.name)&&e.target===this.inputWrapper||(t=e.relatedTarget)===this.inputEle||!je(t)||e.target===this.inputWrapper&&this.isPopupOpen||this.onFocusOut(e)},$6.prototype.onFocusOut=function(e){var t;this.inputFocus=!1,this.isPopupOpen&&this.hidePopup(),this.isClearButtonClick&&(this.isClearButtonClick=!1),this.showClearButton&&(this.clearIconWidth=ge(".e-clear-icon",this.inputWrapper).offsetWidth,U([this.overAllClear],I6),q([this.inputWrapper],f6)),q([this.inputWrapper],[b6]),(this.allowMultiSelection||this.showCheckBox)&&(t=!!this.value&&!!this.value.length,"Delimiter"!==this.mode&&"Custom"!==this.mode&&this.chipWrapper&&"Default"===this.mode&&(U([this.chipWrapper],I6),q([this.inputWrapper],m6),q([this.inputEle],v6)),t&&"Custom"!==this.mode&&this.showOrHideValueTemplate(!0),!this.wrapText)&&t&&this.updateView(),this.changeOnBlur&&this.triggerChangeEvent(e),this.removeValue=!1,this.setOldValue(),this.trigger("blur")},$6.prototype.updateView=function(){!this.showCheckBox&&!this.allowMultiSelection||"Custom"===this.mode||this.inputFocus||("Box"!==this.mode?U([this.inputWrapper,this.overFlowWrapper],W6):U([this.inputWrapper],m6),this.value&&0!==this.value.length&&(this.inputWrapper.contains(this.chipWrapper)&&U([this.chipWrapper],I6),U([this.inputEle],v6),this.updateOverFlowView()),this.ensurePlaceHolder())},$6.prototype.triggerChangeEvent=function(e){this.ddtCompareValues(this.oldValue,this.value)&&!this.isChipDelete||this.removeValue||(e={e:e,oldValue:this.oldValue,value:this.value,isInteracted:!!e,element:this.element},this.trigger("change",e),this.setOldValue())},$6.prototype.ddtCompareValues=function(e,t){if(null===e||null===t)return(null===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},$6.prototype.focusIn=function(e){!this.enabled||this.readonly||this.inputFocus||(this.showOverAllClear(),this.inputFocus=!0,U([this.inputWrapper],[b6]),(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.inputFocus&&(this.chipWrapper&&this.value&&0!==this.value.length&&(q([this.chipWrapper],I6),U([this.inputEle],v6),this.showOrHideValueTemplate(!1,!0)),U([this.inputWrapper],m6),this.popupObj)&&this.popupObj.refreshPosition(),this.wrapText||"Custom"===this.mode||(this.inputWrapper.contains(this.overFlowWrapper)&&U([this.overFlowWrapper],I6),"Delimiter"===this.mode?(q([this.inputWrapper],m6),q([this.inputEle],v6),this.showOrHideValueTemplate(!0)):U([this.inputWrapper],m6),q([this.inputWrapper],W6),this.ensurePlaceHolder())),this.trigger("focus",{isInteracted:!!e,event:e}))},$6.prototype.treeAction=function(t){var i=this;this.trigger("keyPress",{cancel:!1,event:t},function(e){if(e.cancel)t.stopImmediatePropagation();else switch(t.action){case"escape":case"altUp":i.inputWrapper.focus(),t.preventDefault(),i.isPopupOpen&&i.hidePopup();break;case"tab":i.isPopupOpen&&i.hidePopup();break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":i.showCheckBox||(i.isValueChange=!0,i.keyEventArgs=t);break;case"space":i.isValueChange=!0,i.keyEventArgs=t;break;case"ctrlA":i.allowMultiSelection&&i.selectAll(!0)}})},$6.prototype.keyActionHandler=function(t){var i=this;this.trigger("keyPress",{cancel:!1,event:t},function(e){if(!e.cancel)switch(t.action){case"escape":case"altUp":i.isPopupOpen&&i.hidePopup();break;case"shiftTab":i.isPopupOpen&&i.hidePopup(),i.inputFocus&&i.onFocusOut();break;case"altDown":i.isPopupOpen||(i.showPopup(),t.preventDefault());break;case"moveDown":i.showSelectAll&&i.showCheckBox&&i.checkAllParent.focus();break;case"tab":!i.isPopupOpen&&i.inputFocus&&i.onFocusOut()}})},$6.prototype.checkAllAction=function(t){var i,n=this;this.trigger("keyPress",{cancel:!1,event:t},function(e){if(!e.cancel)switch(t.action){case"space":n.clickHandler(t);break;case"moveDown":t.preventDefault(),(i=n.treeObj.element.querySelector('li[tabindex="0"]')||n.treeObj.element.querySelector("li")).focus(),U([i],["e-node-focus"])}})},$6.prototype.windowResize=function(){this.popupObj&&(this.popupObj.setProperties({width:this.setWidth()}),this.popupObj.refreshPosition())},$6.prototype.resetValueHandler=function(e){var t=z(this.inputWrapper,"form");t&&e.target===t&&(this.isDynamicChange=!0,this.setProperties({value:null},!0),this.resetValue(!0),this.isDynamicChange=!1)},$6.prototype.getAriaAttributes=function(){return{}},$6.prototype.updateOverFlowView=function(){if(this.overFlowWrapper.classList.remove(Q6),q([this.overFlowWrapper],I6),this.value&&this.value.length){var e,t="",i=void 0,n=void 0,o=1,r=void 0,s=void 0,a=0,l=(this.overFlowWrapper.innerHTML="",this.l10n=new Cn(this.getLocaleName(),{overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"},this.locale),this.l10n.getConstant("overflowCountTemplate")),h=this.l10n.getConstant("totalCountTemplate"),d=this.createElement("span",{className:z6}),p=(this.overFlowWrapper.appendChild(d),d.innerText=l.replace("${count}",this.value.length.toString()),d.offsetWidth);if(ue(d),this.showDropDownIcon&&(a=ge("."+N6,this.inputWrapper).offsetWidth),!je(this.value))if("Box"!==this.mode){if(this.valueTemplate)return s=this.updateChipAndValueTemplate(!1,a,p),this.checkRemainingTemplate(s,d,l,h),void this.updateDelimMode();for(var c=0;!je(this.value[c]);c++){if(t=(t+=0===c?"":this.delimiterChar+" ")+(i=this.getOverflowVal(c)),i=this.overFlowWrapper.innerHTML,this.enableHtmlSanitizer?this.overFlowWrapper.innerText=go.sanitize(t):this.overFlowWrapper.innerHTML=t,r=this.overFlowWrapper.offsetWidth,e=this.inputWrapper.offsetWidth,r+a+this.clearIconWidth>e){for(void 0!==n&&""!==n&&(i=n,c=o+1),this.overFlowWrapper.innerHTML=i,s=this.value.length-c,r=this.overFlowWrapper.offsetWidth;r+p+a+this.clearIconWidth>=e&&0!==r&&""!==this.overFlowWrapper.innerHTML;){var u=this.overFlowWrapper.innerHTML.split(this.delimiterChar);u.pop(),this.overFlowWrapper.innerHTML=u.join(this.delimiterChar),s++,r=this.overFlowWrapper.offsetWidth}break}r+p+a+this.clearIconWidth<=e?(n=t,o=c):0===c&&(n="",o=-1)}}else s=this.updateChipAndValueTemplate(!0,a,p);this.checkRemainingTemplate(s,d,l,h)}else this.overFlowWrapper.innerHTML="",U([this.overFlowWrapper],I6);this.updateDelimMode()},$6.prototype.checkRemainingTemplate=function(e,t,i,n){0<e&&this.overFlowWrapper.appendChild(this.updateRemainTemplate(t,e,i,n)),"Box"!==this.mode||this.overFlowWrapper.classList.contains(Q6)||U([t],U6)},$6.prototype.updateChipAndValueTemplate=function(e,t,i){void 0===t&&(t=0);for(var n,o,r,s,a,l,h=1,d=(U([e?this.chipWrapper:this.valueTemplateContainer],I6),(e?this.chipWrapper:this.valueTemplateContainer).cloneNode(!0)),p=e?ct("."+S6,d):Array.prototype.slice.call(d.children),c=0;c<p.length;c++){if(r=this.overFlowWrapper.innerHTML,this.overFlowWrapper.appendChild(p[c]),n=this.overFlowWrapper.innerHTML,a=this.overFlowWrapper.offsetWidth,o=this.inputWrapper.offsetWidth,a+t+this.clearIconWidth>o){for(void 0!==s&&""!==s&&(r=s,c=h+1),this.overFlowWrapper.innerHTML=r,l=this.value.length-c,a=this.overFlowWrapper.offsetWidth;a+i+t+this.clearIconWidth>=o&&0!==a&&""!==this.overFlowWrapper.innerHTML;)this.overFlowWrapper.removeChild(this.overFlowWrapper.lastChild),l++,a=this.overFlowWrapper.offsetWidth;break}a+i+t+this.clearIconWidth<=o?(s=n,h=c):0===c&&(s="",h=-1)}return l},$6.prototype.updateRemainTemplate=function(e,t,i,n){return this.overFlowWrapper.firstChild&&3===this.overFlowWrapper.firstChild.nodeType&&""===this.overFlowWrapper.firstChild.nodeValue&&this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild),e.innerHTML="",e.innerText=(this.overFlowWrapper.firstChild&&(3===this.overFlowWrapper.firstChild.nodeType||"Box"===this.mode||this.valueTemplateContainer)?i:n).replace("${count}",t.toString()),!this.overFlowWrapper.firstChild||3!==this.overFlowWrapper.firstChild.nodeType&&"Box"!==this.mode?(U([this.overFlowWrapper],Q6),q([this.overFlowWrapper],U6)):q([this.overFlowWrapper],Q6),e},$6.prototype.getOverflowVal=function(e){e=this.getSelectedData(this.value[parseInt(e.toString(),10)]);return R(this.treeSettings.loadOnDemand?this.fields.text:"text",e)},$6.prototype.updateDelimMode=function(){"Box"!==this.mode?ge("."+z6,this.overFlowWrapper)&&!this.overFlowWrapper.classList.contains(Q6)?(U([this.overFlowWrapper],U6),U([this.overFlowWrapper],W6)):(this.overFlowWrapper.classList.remove(U6),q([this.overFlowWrapper],U6)):ge("."+z6,this.overFlowWrapper)&&this.overFlowWrapper.classList.remove(U6)},$6.prototype.createHiddenElement=function(){this.allowMultiSelection||this.showCheckBox?this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:u6,tabindex:"-1",multiple:"","aria-label":this.getModuleName()}}):this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:u6,"aria-label":this.getModuleName()}}),lt([this.hiddenElement],this.inputWrapper),this.validationAttribute()},$6.prototype.createClearIcon=function(){this.overAllClear=this.createElement("span",{className:"e-clear-icon e-icons"}),U([this.overAllClear],I6),q([this.inputWrapper],f6),this.showClearButton&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},$6.prototype.validationAttribute=function(){for(var e=this.inputEle.getAttribute("name")?this.inputEle.getAttribute("name"):this.inputEle.getAttribute("id"),t=(this.hiddenElement.setAttribute("name",e),this.inputEle.removeAttribute("name"),["required","aria-required","form"]),i=0;i<t.length;i++){var n=this.inputEle.getAttribute(t[i]);n&&(this.hiddenElement.setAttribute(t[i],n),this.inputEle.removeAttribute(t[i]))}},$6.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),U([this.inputWrapper],m6),this.getValidMode()&&null!==this.value&&this.value&&0!==this.value.length?U([this.inputEle],v6):(null===this.value||this.value&&0===this.value.length||this.checkWrapper)&&U([this.chipWrapper],I6))},$6.prototype.getValidMode=function(){return!(!this.allowMultiSelection&&!this.showCheckBox||"Box"!==this.mode&&("Default"!==this.mode||!this.inputFocus))},$6.prototype.createSelectAllWrapper=function(){this.checkAllParent=this.createElement("div",{className:k6,attrs:{tabindex:"0"}}),this.selectAllSpan=this.createElement("span",{className:B6}),this.selectAllSpan.textContent="";var e=je(z(this.element,".e-bigger"))?"":"e-small";this.checkBoxElement=kv(this.createElement,!0,{cssClass:e}),this.checkBoxElement.setAttribute("role","checkbox"),this.checkAllParent.appendChild(this.checkBoxElement),this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),E.add(this.checkAllParent,"mouseup",this.clickHandler,this),this.wireCheckAllWrapperEvents()},$6.prototype.clickHandler=function(e){var t=e.currentTarget&&e.currentTarget.classList.contains(k6)?e.currentTarget.firstElementChild.lastElementChild:e.target;this.checkWrapper=z(t,"."+R6),je(this.checkWrapper)||(this.isClicked=!0,t=ge("."+F6,this.checkWrapper),this.changeState(this.checkWrapper,t.classList.contains(L6)?"uncheck":"check",e),this.isClicked=!1),e.preventDefault()},$6.prototype.changeState=function(e,t,i){var n,o=e.getElementsByClassName(F6)[0];"check"!==t||o.classList.contains(L6)?"uncheck"===t&&o.classList.contains(L6)&&(o.classList.remove(L6),n="false",this.isReverseUpdate||(this.treeObj.uncheckAll(),this.changeOnBlur)||this.triggerChangeEvent(i),this.setLocale(!1)):(o.classList.add(L6),n="true",this.isReverseUpdate||(this.setOldValue(),this.isCheckAllCalled=!0,this.treeObj.checkAll(),this.changeOnBlur)||this.triggerChangeEvent(i),this.setLocale(!0)),this.setMultiSelect(),this.ensurePlaceHolder(),je(n="check"===t?"true":"false")||e.parentElement.setAttribute("aria-checked",n)},$6.prototype.setLocale=function(e){if(this.selectAllSpan)if("Select All"!==this.selectAllText||"Unselect All"!==this.unSelectAllText){var t=e?this.unSelectAllText:this.selectAllText;this.selectAllSpan.textContent="";for(var i=0,n=oo(t)({},this,e?"unSelectAllText":"selectAllText",null,!this.isStringTemplate);i<n.length;i++){var o=n[i];this.selectAllSpan.textContent=o.textContent}}else this.selectAllSpan.textContent=e?this.unSelectAllText:this.selectAllText},$6.prototype.setAttributes=function(){this.inputEle.setAttribute("tabindex","-1"),this.inputEle.setAttribute("aria-label",this.getModuleName());var e=this.element.getAttribute("id");this.hiddenElement.id=e+"_hidden",this.inputWrapper.setAttribute("tabindex",this.inputWrapper.classList.contains("e-disabled")?"-1":"0"),this.inputWrapper.setAttribute("aria-label",this.getModuleName()),pt(this.inputWrapper,this.getAriaAttributes())},$6.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];"class"===i?this.inputWrapper.classList.add(this.htmlAttributes[""+i]):"disabled"===i?(this.setProperties({enabled:!1},!0),this.setEnable()):"readonly"===i?(this.setProperties({readonly:!0},!0),this.dataBind()):"style"===i?this.inputWrapper.style.cssText=this.htmlAttributes[""+i]:0===i.indexOf("data")||-1<["name","required"].indexOf(i)?this.hiddenElement.setAttribute(i,this.htmlAttributes[""+i]):-1<["title","id","placeholder","aria-placeholder","role","autocorrect","autocomplete","autocapitalize","spellcheck","minlength","maxlength"].indexOf(i)&&"placeholder"===i?HF.setPlaceholder(this.htmlAttributes[""+i],this.inputEle):this.inputEle.setAttribute(i,this.htmlAttributes[""+i])}},$6.prototype.updateDataAttribute=function(){for(var e=this.htmlAttributes,t=["class","style","id","type"],i={},n=0;n<this.element.attributes.length;n++)-1===t.indexOf(this.element.attributes[n].name)&&"readonly"!==this.element.attributes[n].name&&(i[this.element.attributes[n].name]=this.element.getAttribute(this.element.attributes[n].name));Pe(i,e,i),this.setProperties({htmlAttributes:i},!0)},$6.prototype.showOverAllClear=function(){this.enabled&&!this.readonly&&this.overAllClear&&(!!this.value&&!!this.value.length&&this.showClearButton?(q([this.overAllClear],I6),U):(U([this.overAllClear],I6),q))([this.inputWrapper],f6)},$6.prototype.setTreeValue=function(){if(null!==this.value&&0!==this.value.length){var e=void 0;if(this.showCheckBox||this.allowMultiSelection){for(var t=this.value.length-1;0<=t;t--)je(e=this.treeObj.getTreeData(this.value[t])[0])&&this.value.splice(t,1);0!==this.value.length&&this.setValidValue()}else je(e=this.treeObj.getTreeData(this.value[0])[0])?this.setProperties({value:this.currentValue},!0):(this.setProperties({text:e[this.fields.text]},!0),this.setValidValue())}},$6.prototype.setTreeText=function(){if((null===this.value||this.isInitialized)&&null!==this.text){var e=void 0,t=[];if(this.showCheckBox||this.allowMultiSelection){for(var i=this.text.split(this.delimiterChar),n=0;n<i.length;n++)je(e=this.getItems(i[n]))||t.push(e[this.fields.value].toString());0!==t.length?(this.setOldValue(),this.setProperties({value:t},!0),this.setValidValue()):this.setProperties({text:this.currentText},!0)}else je(e=this.getItems(this.text))?this.setProperties({text:this.currentText},!0):(this.setOldValue(),this.setProperties({value:[e[this.fields.value].toString()]},!0),this.setValidValue())}},$6.prototype.setSelectedValue=function(){null!==this.value&&0!==this.value.length||this.isInitialized||(this.setOldValue(),0<this.treeObj.selectedNodes.length&&!this.showCheckBox?(this.setProperties({value:this.treeObj.selectedNodes},!0),this.allowMultiSelection&&this.updateMode()):this.showCheckBox&&this.treeObj.checkedNodes&&0<this.treeObj.checkedNodes.length&&(this.setProperties({value:this.treeObj.checkedNodes},!0),x("selectedNodes",[],this.treeObj),this.treeObj.dataBind(),this.updateMode()),this.updateSelectedValues(),this.currentText=this.text,this.currentValue=this.value)},$6.prototype.setValueTemplate=function(){var e,t=this;this.valueTemplate&&(e=this.initializeValueTemplate(),this.getValueTemplateElement(this.value[0],e),this.hasTemplate&&this.portals&&(this.treeObj.portals&&(this.portals=this.portals.concat(this.treeObj.portals.filter(function(e){return!t.portals.includes(e)}))),this.isReact)&&this.renderReactTemplates(this.reactCallBack),this.showOrHideValueTemplate(!0))},$6.prototype.getValueTemplateElement=function(e,t){t=t(this.getNodeData(e,this.isFilteredData?this.treeData:this.treeItems),this,"valueTemplate",this.element.id+"valueTemplate",this.isStringTemplate,void 0,this.valueTemplateContainer);t&&ht(Array.prototype.slice.call(t),this.valueTemplateContainer)},$6.prototype.setValidValue=function(){var e,t=this;this.showCheckBox||this.allowMultiSelection?(this.showCheckBox?(this.value.length!==this.treeObj.checkedNodes.length||0<this.value.filter(function(e){return-1===t.treeObj.checkedNodes.indexOf(e)}).length||this.treeSettings.autoCheck)&&(this.treeObj.checkedNodes=this.value.slice(),this.treeObj.dataBind(),this.setMultiSelect()):(this.treeObj.selectedNodes=this.value.slice(),this.selectedText=[],this.updateSelectedValues()),this.treeObj.dataBind()):(HF.setValue(this.text,this.inputEle,this.floatLabelType),this.setValueTemplate(),e=this.value[0].toString(),this.treeObj.selectedNodes[0]!==e&&(x("selectedNodes",[e],this.treeObj),this.fields.dataSource instanceof me)&&this.updateSelectedValues()),this.currentText=this.text,this.currentValue=this.value,!je(this.value)&&0<this.value.length&&!je(this.currentText)&&this.inputWrapper.setAttribute("aria-label",this.currentText.replace(/,/g,", ")),this.isInitialized&&this.triggerChangeEvent()},$6.prototype.getItems=function(e){var t;if(1===this.treeDataType)for(var i=0;i<this.treeItems.length;i++){var n=R(this.fields.text,this.treeItems[parseInt(i.toString(),10)]);if(!je(this.treeItems[i])&&!je(n)&&n===e){t=this.treeItems[i];break}}else t=this.getNestedItems(this.treeItems,this.fields,e);return t},$6.prototype.getNestedItems=function(e,t,i){for(var n=0,o=e.length;n<o;n++){var r=R(this.fields.text,e[parseInt(n.toString(),10)]);if(e[n]&&r&&r.toString()===i)return e[n];if("string"!=typeof t.child||je(R(t.child,e[n]))){if(this.fields.dataSource instanceof me&&!je(R("child",e[n])))if(void 0!==(s=this.getNestedItems(R("child",e[parseInt(n.toString(),10)]),this.getChildType(t),i)))break}else{var s,r=R(t.child,e[parseInt(n.toString(),10)]);if(void 0!==(s=this.getNestedItems(r,this.getChildType(t),i)))break}}return s},$6.prototype.getChildType=function(e){return"string"==typeof e.child||je(e.child)?e:e.child},$6.prototype.renderTree=function(){this.treeObj=new PW({fields:this.getTreeFields(this.fields),enableRtl:this.enableRtl,nodeSelected:this.onNodeSelected.bind(this),nodeChecked:this.onNodeChecked.bind(this),nodeChecking:this.beforeCheck.bind(this),nodeExpanded:this.onNodeExpanded.bind(this),actionFailure:this.onActionFailure.bind(this),nodeClicked:this.onNodeClicked.bind(this),dataBound:this.OnDataBound.bind(this),allowMultiSelection:this.allowMultiSelection,enableHtmlSanitizer:this.enableHtmlSanitizer,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,checkDisabledChildren:this.treeSettings.checkDisabledChildren}),this.treeObj.root=this.root||this,this.treeObj.appendTo(this.tree)},$6.prototype.renderPopup=function(){var n=this,o=(this.isFilteredData&&(this.treeObj.element.classList.remove("e-filtering"),this.filterObj.value="",this.treeObj.fields=this.getTreeFields(this.fields),this.isFilterRestore=!0,this.isFilteredData=!1,this.hideCheckAll(!1)),!1);this.trigger("beforeOpen",{cancel:!1},function(e){var t,i;e.cancel?o=!0:(U([n.inputWrapper],[C6]),n.isFirstRender?(n.popupEle=n.createElement("div",{id:n.element.id+"_options",className:"e-ddt e-popup "+(null!=n.cssClass?n.cssClass:"")}),n.popupEle.setAttribute("role","region"),n.popupEle.setAttribute("aria-label",n.element.id),document.body.appendChild(n.popupEle),n.createPopup(n.popupEle)):(n.popupEle=n.popupObj.element,n.isReact&&n.isFilterRestore&&(n.treeObj.refresh(),n.isFilteredData=!0,n.popupEle.removeChild(n.filterContainer)))),(n.isFirstRender&&!o||n.isFilteredData)&&(n.isFilteredData=!1,lt([n.popupDiv],n.popupEle),q([n.popupDiv],T6),n.allowFiltering&&n.renderFilter(),n.showCheckBox&&n.showSelectAll&&!n.popupDiv.classList.contains(H6)&&(n.createSelectAllWrapper(),n.popupEle.insertBefore(n.checkAllParent,n.popupDiv)),n.headerTemplate&&n.setHeaderTemplate(),n.footerTemplate&&n.setFooterTemplate(),n.isFirstRender=!1,n.hasTemplate)&&n.portals&&(n.treeObj.portals&&(n.portals=n.portals.concat(n.treeObj.portals.filter(function(e){return!n.portals.includes(e)}))),n.isReact)&&n.renderReactTemplates(n.reactCallBack),o||(pt(n.inputEle,{"aria-expanded":"true"}),n.popupObj.show(null,1e3===n.zIndex?n.inputEle:null),q([n.popupEle],T6),n.updatePopupHeight(),n.popupObj.refreshPosition(),!n.showSelectAll&&!n.allowFiltering&&!n.popupDiv.classList.contains(H6)&&0<n.treeItems.length&&((i=null!=n.value&&null!=n.text?n.treeObj.element.querySelector('[data-uid="'+n.value[0]+'"]'):null)?(n.treeObj.element.querySelector("li").setAttribute("tabindex","-1"),i.setAttribute("tabindex","0")):(t=n.treeObj.element.querySelector(".e-node-focus"),i=n.treeObj.element.querySelector('li[tabindex="0"]:not(.e-disable)')||n.treeObj.element.querySelector("li:not(.e-disable)"),n.removeFocus(i,t)),n.updateFocus(i)),0<n.treeObj.checkedNodes.length&&!n.isFilterRestore&&(e=n.treeObj.element.querySelectorAll("li:not(.e-disable)"),n.treeObj.element.querySelectorAll("li[aria-checked=true]").length===e.length)&&n.checkBoxElement&&(e=z(n.checkBoxElement,"."+R6),n.changeState(e,"check"),n.checkSelectAll=!1),n.showSelectAll&&!n.allowFiltering&&(t=n.treeObj.element.querySelector(".e-node-focus"),i=n.popupEle.querySelector(".e-selectall-parent"),n.removeFocus(i,t),n.updateFocus(i)),n.allowFiltering&&(je(i=n.treeObj.element.querySelector("li.e-node-focus"))||q([i],"e-node-focus"),q([n.inputWrapper],[b6]),n.filterObj.element.focus()),e={popup:n.popupObj},n.trigger("open",e))})},$6.prototype.removeFocus=function(e,t){t&&t!==e&&(t.setAttribute("tabindex","-1"),q([t],"e-node-focus"))},$6.prototype.updateFocus=function(e){je(e)||(e.focus(),U([e],["e-node-focus"]))},$6.prototype.reactCallBack=function(){je(this.popupObj)||(this.updatePopupHeight(),this.popupObj.refreshPosition())},$6.prototype.updatePopupHeight=function(){var e,t;this.isFirstRender||(e=this.getHeight(),this.popupEle.style.maxHeight=e,this.allowFiltering&&(t=Math.round(this.filterContainer.getBoundingClientRect().height),e=T(parseInt(e,10)-t+"px")),this.headerTemplate&&(t=Math.round(this.header.getBoundingClientRect().height),e=T(parseInt(e,10)-t+"px")),this.showCheckBox&&this.showSelectAll&&!this.popupDiv.classList.contains(H6)&&(t=Math.round(this.checkAllParent.getBoundingClientRect().height),e=T(parseInt(e,10)-t+"px")),this.footerTemplate&&(t=Math.round(this.footer.getBoundingClientRect().height),e=T(parseInt(e,10)-t+"px")),t=parseInt(window.getComputedStyle(this.popupEle).borderTopWidth,10),t+=parseInt(window.getComputedStyle(this.popupEle).borderBottomWidth,10),e=T(parseInt(e,10)-t+"px"),this.popupDiv.style.maxHeight=e)},$6.prototype.createPopup=function(e){var t=this;this.isFirstRender&&(this.popupObj=new Sv(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(){t.isPopupOpen=!1},open:function(){document.addEventListener("mousedown",t.documentClickContext),t.isPopupOpen=!0},targetExitViewport:function(){F.isDevice||t.hidePopup()}}))},$6.prototype.setElementWidth=function(e){var t=this.inputWrapper;je(e)||("number"==typeof e?t.style.width=T(e):"string"==typeof e&&(t.style.width=e.match(/px|%|em/)?e:T(e)))},$6.prototype.setWidth=function(){var e=T(this.popupWidth);return-1<e.indexOf("%")?e=(this.inputWrapper.offsetWidth*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupWidth&&(e=this.popupWidth.match(/px|em/)?this.popupWidth:e),e},$6.prototype.getHeight=function(){var e=T(this.popupHeight);return-1<e.indexOf("%")?e=(document.documentElement.clientHeight*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupHeight&&(e=this.popupHeight.match(/px|em/)?this.popupHeight:e),e},$6.prototype.onDocumentClick=function(e){var t=e.target,i=z(t,"."+E6),n=z(t,"."+O6),o=z(t,"."+_6),r=z(t,"."+V6),s=!!t.classList.contains(D6)||ft(t,".e-ddt .e-popup")||ft(t,".e-ddt .e-treeview");this.isPopupOpen&&(!je(this.inputWrapper)&&this.inputWrapper.contains(t)||i||s||o||r)||(this.allowMultiSelection||this.showCheckBox)&&(this.isPopupOpen&&t.classList.contains(x6)||this.isPopupOpen&&(t.classList.contains(k6)||t.classList.contains(B6)||t.classList.contains(F6)))?(this.isDocumentClick=!1,e.preventDefault()):je(this.inputWrapper)||this.inputWrapper.contains(t)||!this.inputFocus||n||this.focusOut(e)},$6.prototype.onActionFailure=function(e){this.trigger("actionFailure",e),this.l10nUpdate(!0),U([this.popupDiv],H6)},$6.prototype.OnDataBound=function(e){this.treeItems=e.data,this.treeItems.length<=0?(this.l10nUpdate(),U([this.popupDiv],H6),this.hideCheckAll(!0)):this.popupDiv.classList.contains(H6)&&1<=this.treeItems.length&&(q([this.popupDiv],H6),this.hideCheckAll(!1)),this.isFilteredData||(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(),this.isInitialized=!0);e={data:e.data};this.trigger("dataBound",e),null===this.filterObj&&(this.isFilteredData=!1),this.isFilteredData&&this.treeObj.expandAll(),this.isFilterRestore&&(this.restoreFilterSelection(),this.showSelectAll||(this.isFilterRestore=!1))},$6.prototype.restoreFilterSelection=function(){this.showCheckBox?this.treeObj.checkedNodes=this.value||[]:this.treeObj.selectedNodes=this.value||[]},$6.prototype.setCssClass=function(e,t){var i=this.popupObj?[this.inputWrapper,this.popupObj.element]:[this.inputWrapper];je(t)||""===t||q(i,t.split(" ")),je(e)||""===e||U(i,e.split(" "))},$6.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())},$6.prototype.setEnable=function(){HF.setEnabled(this.enabled,this.inputEle),this.enabled?(q([this.inputWrapper],M6),this.inputEle.setAttribute("aria-disabled","false"),this.inputWrapper.setAttribute("aria-disabled","false")):(this.isPopupOpen&&this.hidePopup(),U([this.inputWrapper],M6),this.inputWrapper&&this.inputWrapper.classList.contains(b6)&&q([this.inputWrapper],[b6]),this.inputEle.setAttribute("aria-disabled","true"),this.inputWrapper.setAttribute("aria-disabled","true"))},$6.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,selectable:e.selectable,tableName:e.tableName,tooltip:e.tooltip}},$6.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,selectable:e.selectable,tableName:e.tableName,tooltip:e.tooltip}},$6.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,selectable:e.selectable,selected:e.selected,tableName:e.tableName,tooltip:e.tooltip}},$6.prototype.getTreeChildren=function(e){var t;return"string"==typeof e?e:je(e)?null:(t=e=this.getActualProperties(e),e.value&&(t.id=e.value),e.parentValue&&(t.parentID=e.parentValue),e.child&&(t.child=this.getTreeChildren(e.child)),e.selected&&this.showCheckBox&&(t.isChecked=e.selected),t)},$6.prototype.getTreeDataType=function(e,t){if(this.fields.dataSource instanceof me){for(var i=0;i<e.length;i++)if("string"==typeof t.child&&je(R(t.child,e[i])))return 1;return 2}je(this.fields.dataSource)&&(this.fields.dataSource=[]);for(var i=0,n=this.fields.dataSource.length;i<n;i++){if("string"==typeof t.child&&!je(R(t.child,this.fields.dataSource[i])))return 2;if(!je(R(t.parentValue,this.fields.dataSource[i]))||!je(R(t.hasChildren,this.fields.dataSource[i])))return 1}return 1},$6.prototype.setFields=function(){this.resetValue(),this.hasTemplate&&this.updateTemplate(),this.treeObj.fields=this.getTreeFields(this.fields),this.setProperties({value:this.oldValue},!0),this.treeObj.dataBind(),this.updateValue(this.value)},$6.prototype.getEventArgs=function(e){var t,i=e.data,n=e.nodeData;return this.showCheckBox&&("check"===e.action?t="select":"uncheck"===e.action&&(t="un-select")),{action:this.showCheckBox?t:e.action,isInteracted:!!this.isClicked||e.isInteracted,item:e.node,itemData:this.showCheckBox?i[0]:n}},$6.prototype.onBeforeSelect=function(e){e.isInteracted&&(this.setOldValue(),null===this.value)&&this.setProperties({value:[]},!0)},$6.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="")},$6.prototype.onNodeSelected=function(e){var t,i;this.showCheckBox||(i=this.getEventArgs(e),this.trigger("select",i),e.isInteracted&&(i=R("id",e.nodeData).toString(),this.allowMultiSelection?this.allowMultiSelection&&this.setMultiSelect():(this.hiddenElement.innerHTML="",this.setProperties({value:[i]},!0),t=this.itemTemplate?R("text",this.treeObj.getNode(i)):R("text",e.nodeData).toString(),HF.setValue(t,this.inputEle,this.floatLabelType),this.setProperties({text:t},!0),this.currentText=this.text,this.currentValue=this.value,this.setValueTemplate(),!je(this.value)&&0<this.value.length&&this.inputWrapper.setAttribute("aria-label",e.nodeData.text.toString()),pt(this.inputWrapper,{"aria-describedby":this.element.id}),pt(this.inputWrapper,{"aria-activedescendant":i.toString()}),this.updateHiddenValue(),this.showOverAllClear(),this.hidePopup(),this.isNodeSelected=!0)),this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1))},$6.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&&(this.isClicked=!0,"true"===this.treeObj.getNode(e.node).isChecked?this.treeObj.uncheckAll([e.node]):this.treeObj.checkAll([e.node]),this.isClicked=!1,this.setMultiSelect(),this.ensurePlaceHolder()),this.changeOnBlur||!this.allowMultiSelection&&!this.showCheckBox||this.triggerChangeEvent(e.event)},$6.prototype.onNodeChecked=function(e){var t,i,n=this.getEventArgs(e);this.trigger("select",n),this.isFilteredData&&"uncheck"===e.action&&(n=R("id",e.data[0]).toString(),this.removeSelectedData(n,!0)),(!this.isChipDelete&&e.isInteracted||!this.isFilteredData&&"check"===e.action&&this.isFromFilterChange)&&(this.setMultiSelect(),this.ensurePlaceHolder()),this.showSelectAll&&this.checkBoxElement&&(n=this.treeObj.element.querySelectorAll("li:not(.e-disable)"),t=this.treeObj.element.querySelectorAll("li[aria-checked=true]"),(i=z(this.checkBoxElement,"."+R6))&&"uncheck"===e.action&&(e.isInteracted||0===t.length||!je(e.data[0])&&"false"===e.data[0].isChecked)||!e.isInteracted&&this.isFilterRestore?(this.isFilterRestore=!1,this.isReverseUpdate=!0,this.changeState(i,"uncheck"),this.isReverseUpdate=!1):i&&"check"===e.action&&t.length===n.length&&(e.isInteracted||this.isCheckAllCalled||!je(e.data[0])&&"true"===e.data[0].isChecked)&&(this.isReverseUpdate=!0,this.isCheckAllCalled=!1,this.changeState(i,"check"),this.isReverseUpdate=!1)),this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1)},$6.prototype.beforeCheck=function(e){e.isInteracted&&this.setOldValue()},$6.prototype.onNodeExpanded=function(){if(this.hasTemplate&&this.portals&&this.treeObj.portals){for(var e=0;e<this.treeObj.portals.length;e++)-1===this.portals.indexOf(this.treeObj.portals[e])&&this.portals.push(this.treeObj.portals[e]);this.renderReactTemplates()}},$6.prototype.updateClearButton=function(e){if(e?this.inputWrapper.contains(this.overAllClear)?(q([this.overAllClear],I6),U([this.inputWrapper],f6)):this.inputEle.parentElement.insertBefore(this.overAllClear,this.inputEle.nextSibling):(U([this.overAllClear],I6),q([this.inputWrapper],f6)),(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper)for(var t=ct("."+x6,this.chipWrapper),i=0;i<t.length;i++)(e?q:U)([t[i]],I6)},$6.prototype.updateDropDownIconState=function(e){var t=ge("."+N6,this.inputWrapper);(e?(t?q([t],I6):HF.appendSpan(g6,this.inputWrapper,this.createElement),U):(U([t],I6),q))([this.inputWrapper],y6)},$6.prototype.updateMode=function(){var e,t;"Custom"!==this.mode&&("Delimiter"!==this.mode?(this.inputWrapper.contains(this.chipWrapper)||this.createChip(),e=this.getValidMode(),this.chipWrapper.classList.contains(I6)&&e?(q([this.chipWrapper],I6),this.showOrHideValueTemplate(!1,!0),U([this.inputWrapper],m6)):e||(U([this.chipWrapper],I6),q([this.inputWrapper],m6),this.showOrHideValueTemplate(!0)),t=null!==this.value&&0!==this.value.length,(e&&t?U:q)([this.inputEle],v6)):this.inputEle.classList.contains(v6)&&(q([this.inputEle],v6),this.chipWrapper)&&(U([this.chipWrapper],I6),q([this.inputWrapper],m6),this.showOrHideValueTemplate(!0)))},$6.prototype.ensurePlaceHolder=function(){(je(this.value)||null!==this.value&&0===this.value.length)&&(q([this.inputEle],v6),this.chipWrapper)&&(U([this.chipWrapper],I6),this.showOrHideValueTemplate(!0))},$6.prototype.ensureClearIconPosition=function(e){"Never"!==e&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},$6.prototype.setMultiSelectValue=function(e){var t=this;if(this.isFilteredData){for(var i=(i=je(this.value)?[]:this.value).filter(function(e){e=t.treeObj.getTreeData(e);return!Array.isArray(e)||e.every(function(e){return e.selected})}),n=0;n<e.length;n++)!je(this.value)&&-1!==this.value.indexOf(e[n])||i.push(e[n]);this.setProperties({value:i},!0)}else this.setProperties({value:this.isFromFilterChange&&e&&0===e.length?this.value:e},!0),this.isFromFilterChange=!1,!e||0===e.length||this.showCheckBox||this.ddtCompareValues(this.treeObj.selectedNodes,this.value.slice())||(this.treeObj.selectedNodes=this.value.slice(),this.treeObj.dataBind())},$6.prototype.setMultiSelect=function(){this.showCheckBox&&!this.isDynamicChange?this.setMultiSelectValue(this.treeObj.checkedNodes.slice()):(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 e=!!this.allowMultiSelection||!!this.showCheckBox;this.inputWrapper.contains(this.chipWrapper)&&!e&&(q([this.inputEle],v6),G(this.chipWrapper));this.getValidMode()&&null!==this.value&&(U([this.inputEle],v6),this.chipWrapper)&&(q([this.chipWrapper],I6),this.showOrHideValueTemplate(!1,!0));e=!!this.value&&!!this.value.length;this.chipWrapper&&"Box"===this.mode&&!e&&(U([this.chipWrapper],I6),q([this.inputEle],v6),this.showOrHideValueTemplate(!0)),this.updateSelectedValues()},$6.prototype.getSelectedData=function(e){var t=null;if(this.isFilteredData)for(var i=0;i<this.selectedData.length;i++)if(R(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[i]).toString()===e){t=this.selectedData[i];break}return je(t)&&!je(t=this.treeSettings.loadOnDemand?this.getNodeData(e,this.treeItems):this.treeObj.getNode(e))&&this.selectedData.push(t),t},$6.prototype.getNodeData=function(e,t){if(!je(e)){if(1!==this.treeDataType)return this.getChildNodeData(t,this.fields,e);for(var i=0,n=t.length;i<n;i++){var o=R(this.fields.value,t[i]);if(!je(t[i])&&!je(o)&&o.toString()===e)return t[i]}}},$6.prototype.getChildNodeData=function(e,t,i){if(!je(e))for(var n=0,o=e.length;n<o;n++){var r=R(t.value,e[n]);if(e[n]&&r&&r.toString()===i)return e[n];if("string"!=typeof t.child||je(R(t.child,e[n]))){if(this.fields.dataSource instanceof me&&!je(R("child",e[n])))if(void 0!==(s=this.getChildNodeData(R("child",e[n]),this.getChildMapperFields(t),i)))break}else{var s,r=R(t.child,e[n]);if(void 0!==(s=this.getChildNodeData(r,this.getChildMapperFields(t),i)))break}}return s},$6.prototype.getChildMapperFields=function(e){return"string"==typeof e.child||je(e.child)?e:e.child},$6.prototype.removeSelectedData=function(e,t){var i=je(this.value)?[]:this.value.slice();i.splice(i.indexOf(e),1),this.setProperties({value:i},t);for(var n=0;n<this.selectedData.length;n++)if(R(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[n]).toString()===e){this.selectedData.splice(n,1);break}},$6.prototype.initializeValueTemplate=function(){if(!this.valueTemplate)return null;if(this.valueTemplateContainer)for(;this.valueTemplateContainer.firstChild;)this.valueTemplateContainer.removeChild(this.valueTemplateContainer.firstChild);else this.valueTemplateContainer=this.createElement("span",{className:j6+" "+W6+" e-input-value "+I6});return this.inputWrapper.insertBefore(this.valueTemplateContainer,this.inputEle),this.templateComplier(this.valueTemplate)},$6.prototype.showOrHideValueTemplate=function(e,t){void 0===t&&(t=!1),this.valueTemplateContainer&&"Box"!==this.mode&&(e?(q([this.valueTemplateContainer],I6),U([this.inputWrapper],m6),U([this.inputEle],v6)):(U([this.valueTemplateContainer],I6),t||(q([this.inputWrapper],m6),q([this.inputEle],v6))))},$6.prototype.updateSelectedValues=function(){var e,t=this,i=this.dataValue="",n=this.hiddenElement.innerHTML="";if(this.isChipDelete&&!this.treeSettings.autoCheck||!this.inputWrapper.contains(this.chipWrapper)||(this.chipCollection.innerHTML=""),this.isFilteredData||(this.selectedData=[]),!je(this.value)){for(var o=this.initializeValueTemplate(),r=0,s=this.value.length;r<s;r++)e=this.getSelectedData(this.value[r]),e=R(this.treeSettings.loadOnDemand?this.fields.text:"text",e),this.selectedText.push(e),e=this.selectedText[this.selectedText.length-1],1<this.selectedText.length?(this.dataValue+=this.delimiterChar+" "+e,i+=","+e):(this.dataValue+=e,i+=e),"Custom"===this.mode||"Delimiter"===this.mode||this.isChipDelete&&!this.treeSettings.autoCheck||!this.allowMultiSelection&&!this.showCheckBox||this.setChipValues(e,this.value[r]),n+='<option selected value ="'+this.value[r]+'">'+this.selectedText[this.selectedText.length-1]+"</option>",this.valueTemplate&&this.getValueTemplateElement(this.value[r],o);this.hasTemplate&&this.portals&&(this.treeObj.portals&&(this.portals=this.portals.concat(this.treeObj.portals.filter(function(e){return!t.portals.includes(e)}))),this.isReact)&&this.renderReactTemplates(this.reactCallBack),1<=this.selectedText.length&&this.setProperties({text:i},!0),this.hiddenElement.innerHTML=n,"Custom"===this.mode&&(this.allowMultiSelection||this.showCheckBox)&&this.setTagValues()}var a=this.getValidMode();"Custom"===this.mode||"Box"===this.mode||!this.allowMultiSelection&&!this.showCheckBox||a||(this.chipWrapper&&(U([this.chipWrapper],I6),q([this.inputWrapper],m6)),this.showOrHideValueTemplate(!0)),HF.setValue(this.dataValue,this.inputEle,this.floatLabelType),""===i?this.setProperties({text:null},!0):this.setProperties({text:i},!0),this.showClearButton&&this.inputFocus&&this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&this.popupObj&&this.popupObj.refreshPosition(),this.currentText=this.text,this.currentValue=this.value,!je(this.value)&&0<this.value.length&&!je(this.currentText)?this.inputWrapper.setAttribute("aria-label",this.currentText.replace(/,/g,", ")):this.inputWrapper.setAttribute("aria-label",this.getModuleName())},$6.prototype.setChipValues=function(e,t){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var t=this.createElement("span",{className:S6,attrs:{"data-value":t}}),i=this.createElement("span",{className:A6}),n=this.createElement("span",{className:x6+" e-icons"});this.enableHtmlSanitizer?i.innerText=go.sanitize(e):i.innerHTML=e,t.appendChild(i),this.chipCollection.appendChild(t),this.showClearButton&&(t.appendChild(n),E.add(n,"mouseup",this.removeChip,this))},$6.prototype.setTagValues=function(){var e,t,i,n;null===this.value||null==this.text||0===this.value.length?this.inputWrapper.contains(this.chipWrapper)&&U([this.chipWrapper],I6):(this.inputWrapper.contains(this.chipWrapper)||this.createChip(),this.inputWrapper.classList.contains(m6)||U([this.inputWrapper],m6),e=this.createElement("span",{className:S6}),this.inputEle.classList.contains(v6)||U([this.inputEle],v6),this.chipWrapper.classList.contains(I6)&&(q([this.chipWrapper],I6),this.showOrHideValueTemplate(!1,!0)),t=this.createElement("span",{className:A6}),n=this.customTemplate,i=this.customTemplateId,(n=this.templateComplier(n)({value:this.value,text:this.text},this,"customTemplate",i,this.isStringTemplate,void 0,t))&&ht(n=Array.prototype.slice.call(n),t),e.appendChild(t),this.chipCollection.appendChild(e),this.isReact&&this.renderReactTemplates())},$6.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)&&(G(this.checkAllParent),this.checkAllParent=null))},$6.prototype.setHeaderTemplate=function(){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),U([this.header],_6));var e=this.templateComplier(this.headerTemplate)({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,void 0,this.header);e&&ht(Array.prototype.slice.call(e),this.header),this.popupEle.insertBefore(this.header,this.checkAllParent||this.popupDiv)},$6.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?oo(document.querySelector(e).innerHTML.trim()):oo(e)}catch(e){}return oo(e)},$6.prototype.setFooterTemplate=function(){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),U([this.footer],V6));var e=this.templateComplier(this.footerTemplate)({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,void 0,this.footer);e&&ht(Array.prototype.slice.call(e),this.footer),ht([this.footer],this.popupEle)},$6.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)},$6.prototype.removeChip=function(e){var t,i;this.enabled&&!this.readonly&&(e.target.classList.contains("e-chips-close")&&!this.isPopupOpen&&(e.stopPropagation(),e.preventDefault()),i=(t=e.target.parentElement).getAttribute("data-value"),this.chipCollection&&t&&ue(t),this.isChipDelete=!0,this.isClearButtonClick=!0,this.removeSelectedData(i,!0),this.selectedText=[],this.allowMultiSelection&&(this.treeObj.selectedNodes=this.value.slice(),this.updateSelectedValues()),this.showCheckBox&&(this.treeObj.uncheckAll([i]),this.clearCheckAll(),this.setMultiSelect()),this.triggerChangeEvent(e),this.isChipDelete=!1,this.ensurePlaceHolder())},$6.prototype.resetValue=function(e){Array.isArray(this.value)&&0===this.value.length&&null==this.text||(HF.setValue(null,this.inputEle,this.floatLabelType),e||(this.setOldValue(),this.setProperties({value:[]},!0),this.showOrHideValueTemplate(!1)),!je(this.value)&&0!==this.value.length||this.inputWrapper.setAttribute("aria-label",this.getModuleName()),this.dataValue=null,this.setProperties({text:null},!0),this.selectedData=[],x("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()))},$6.prototype.clearCheckAll=function(){this.showSelectAll&&this.value&&0===this.value.length&&this.setLocale(!1)},$6.prototype.setOldValue=function(){this.oldValue=Array.isArray(this.value)?this.value.slice():this.value},$6.prototype.selectAllItems=function(e){if(this.showCheckBox)e?(this.isCheckAllCalled=!0,this.treeObj.checkAll()):this.treeObj.uncheckAll(),this.checkSelectAll=e;else if(this.allowMultiSelection)if(e){for(var t,i=ct("li",this.treeObj.element),n=[],o=0;o<i.length;o++)t=i[o].getAttribute("data-uid").toString(),n.push(t);this.treeObj.selectedNodes=n}else this.treeObj.selectedNodes=[];this.updateMode(),this.setMultiSelect(),this.wrapText||(e?this.updateView():this.updateOverflowWrapper(!0))},$6.prototype.updateTreeSettings=function(e){if("autoCheck"===e)this.treeObj.autoCheck=this.treeSettings.autoCheck;else if("loadOnDemand"===e)this.treeObj.loadOnDemand=this.treeSettings.loadOnDemand;else{if("expandOn"===e)return this.treeObj.expandOn=this.treeSettings.expandOn,void this.treeObj.dataBind();"checkDisabledChildren"===e&&(this.treeObj.checkDisabledChildren=this.treeSettings.checkDisabledChildren)}this.treeObj.dataBind(),this.setMultiSelect(),this.updateValue(this.value)},$6.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},$6.prototype.updateTemplate=function(){this.popupObj&&(this.clearTemplate(),this.portals=[],this.popupObj.destroy(),this.isPopupOpen?(this.hidePopup(),this.isFirstRender=!0,this.renderPopup()):this.isFirstRender=!0)},$6.prototype.l10nUpdate=function(e){var t,i,n;this.noRecord?this.noRecord.innerHTML="":this.noRecord=this.createElement("div"),"No Records Found"!==this.noRecordsTemplate||"The Request Failed"!==this.actionFailureTemplate?(n=e?this.actionFailureTemplate:this.noRecordsTemplate,t=e?this.actionFailureTemplateId:this.noRecordsTemplateId,i=e?"actionFailureTemplate":"noRecordsTemplate",(n=this.templateComplier(n)({},this,i,t,this.isStringTemplate,void 0,this.noRecord))&&ht(n=Array.prototype.slice.call(n),this.noRecord)):(this.l10n=new Cn(this.getLocaleName(),{noRecordsTemplate:"No Records Found",actionFailureTemplate:"The Request Failed"},this.locale),this.noRecord.innerHTML=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate")),U([this.noRecord],"e-ddt-nodata"),lt([this.noRecord],this.popupDiv),this.treeObj&&this.treeObj.element.removeAttribute("aria-activedescendant")},$6.prototype.updateRecordTemplate=function(e){this.treeItems&&this.treeItems.length<=0&&(this.l10nUpdate(e),this.hasTemplate)&&this.updateTemplate()},$6.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:j6+" "+I6}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement))},$6.prototype.updateMultiSelection=function(e){this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.allowMultiSelection=e,this.treeObj.dataBind(),this.updateOption(),this.allowMultiSelection&&this.updateMode(),this.setMultiSelect()},$6.prototype.updateAllowFiltering=function(e){this.isFirstRender||(e?this.renderFilter():this.destroyFilter())},$6.prototype.updateFilterPlaceHolder=function(){this.filterObj&&(this.filterObj.placeholder=this.filterBarPlaceholder,this.filterObj.element.setAttribute("aria-label",this.filterBarPlaceholder))},$6.prototype.updateValue=function(e){this.isDynamicChange=!0,je(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},$6.prototype.updateText=function(e){je(e)?this.resetValue():(this.setTreeText(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue()},$6.prototype.updateModelMode=function(){var e;!this.allowMultiSelection&&!this.showCheckBox||(this.wrapText||(e=ge(".e-overflow:not(.e-input-value)",this.inputWrapper))&&(e.innerHTML=""),this.updateMode(),this.setMultiSelect(),this.wrapText)||!this.value||0===this.value.length||(this.updateOverFlowView(),U([this.inputEle],v6),("Box"===this.mode?q:U)([this.overFlowWrapper,this.inputWrapper],W6))},$6.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","")},$6.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"width":this.setElementWidth(e.width),this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"placeholder":HF.setPlaceholder(e.placeholder,this.inputEle);break;case"cssClass":this.setCssClass(e.cssClass,t.cssClass);break;case"enableRtl":this.setEnableRTL(this.enableRtl);break;case"fields":this.setFields();break;case"readonly":HF.setReadonly(e.readonly,this.inputEle);break;case"enabled":this.setEnable();break;case"floatLabelType":HF.removeFloating(this.inputObj),HF.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":JSON.stringify(t.value)!==JSON.stringify(e.value)&&(this.oldValue=t.value,this.updateValue(e.value));break;case"text":this.updateText(e.text);break;case"allowMultiSelection":this.updateMultiSelection(e.allowMultiSelection);break;case"mode":if(!this.showCheckBox&&!this.allowMultiSelection)return;"Custom"===this.mode?(this.overFlowWrapper&&G(this.overFlowWrapper),this.chipWrapper&&G(this.chipWrapper),this.setTagValues()):("Custom"===t.mode&&this.updateOverflowWrapper(this.wrapText),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":for(var o=0,r=Object.keys(e.treeSettings);o<r.length;o++){var s=r[o];this.updateTreeSettings(s)}break;case"customTemplate":if("Custom"!==this.mode)return;this.chipCollection.innerHTML="",this.setTagValues();break;case"sortOrder":this.hasTemplate&&this.updateTemplate(),this.treeObj.sortOrder=e.sortOrder,this.treeObj.dataBind(),this.updateValue(this.value);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?(U([this.overFlowWrapper],I6),this.chipWrapper&&"Box"===this.mode?q([this.chipWrapper],I6):(q([this.inputWrapper],m6),q([this.inputEle],v6)),this.ensurePlaceHolder()):this.updateView()}},$6.prototype.clear=function(){this.clearAll(),this.inputFocus?this.onFocusOut():(this.changeOnBlur&&this.triggerChangeEvent(),this.removeValue=!1)},$6.prototype.destroy=function(){for(this.clearTemplate(),this.unWireEvents(),this.setCssClass(null,this.cssClass),this.setProperties({text:null},!0),this.treeObj.destroy(),this.destroyFilter(),this.popupObj&&(this.popupObj.destroy(),G(this.popupObj.element)),this.element.tagName!==this.getDirective()&&this.inputWrapper.parentElement.insertBefore(this.element,this.inputWrapper),HF.setValue(null,this.inputEle,this.floatLabelType),G(this.inputWrapper),G(this.popupDiv),G(this.hiddenElement),HF.setRipple(!1,[this.inputObj]),this.element.classList.remove("e-input"),(this.showCheckBox||this.allowMultiSelection||this.value&&this.valueTemplateContainer)&&this.element.classList.remove(v6),G(this.inputObj.container),this.inputObj.buttons.length&&G(this.inputObj.buttons[0]),this.inputObj=null;0<this.hiddenElement.options.length;)this.hiddenElement.remove(0);if(this.hiddenElement.innerHTML="",this.hiddenElement=null,this.inputWrapper.innerHTML="",this.inputWrapper=null,this.popupDiv=null,this.tree=null,this.popupObj=null,this.treeObj=null,this.overAllClear=null,this.chipCollection)for(var e=0,t=ct(".e-chips-close",this.chipCollection);e<t.length;e++){var i=t[e];E.remove(i,"mouseup",this.removeChip)}this.chipWrapper=null,this.chipCollection=null,this.checkAllParent=null,this.selectAllSpan=null,this.checkBoxElement=null,this.checkWrapper=null,this.popupEle=null,this.header=null,this.footer=null,this.overFlowWrapper=null,this.keyboardModule=null,J6.prototype.destroy.call(this),this.setProperties({value:[]},!0)},$6.prototype.destroyFilter=function(){this.filterObj&&(this.filterObj.destroy(),G(this.filterObj.element),G(this.filterContainer),this.filterObj=null)},$6.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.isReact&&this.clearTemplate(["headerTemplate","footerTemplate","itemTemplate","actionFailureTemplate","noRecordsTemplate"]),this.popupObj&&(this.popupObj.destroy(),G(this.popupObj.element))},$6.prototype.ensureVisible=function(e){this.treeObj.ensureVisible(e)},$6.prototype.getData=function(e){return this.treeObj.getTreeData(e)},$6.prototype.hidePopup=function(){var e={popup:this.popupObj,cancel:!1};this.trigger("close",e),e.cancel||(this.inputWrapper.classList.remove(C6),this.popupEle&&U([this.popupEle],T6),pt(this.inputEle,{"aria-expanded":"false"}),this.popupObj&&this.isPopupOpen&&(this.popupObj.hide(),this.inputFocus&&(this.inputWrapper.focus(),this.allowFiltering)&&U([this.inputWrapper],[b6]),this.isFilteredData&&(this.treeObj.treeData=this.treeData),this.destroyPopupOnHide)&&(this.isFirstRender=!0,this.destroyPopup()))},$6.prototype.selectAll=function(e){this.selectAllItems(e)},$6.prototype.showPopup=function(){!this.enabled||this.readonly||this.isPopupOpen||(this.renderPopup(),this.focusIn())},$6.prototype.getModuleName=function(){return"dropdowntree"},wQ([e("The Request Failed")],$6.prototype,"actionFailureTemplate",void 0),wQ([e(!1)],$6.prototype,"allowFiltering",void 0),wQ([e(!1)],$6.prototype,"allowMultiSelection",void 0),wQ([e(!0)],$6.prototype,"changeOnBlur",void 0),wQ([e("")],$6.prototype,"cssClass",void 0),wQ([e("${value.length} item(s) selected")],$6.prototype,"customTemplate",void 0),wQ([e(",")],$6.prototype,"delimiterChar",void 0),wQ([e(!0)],$6.prototype,"enabled",void 0),wQ([t({},q6)],$6.prototype,"fields",void 0),wQ([e(null)],$6.prototype,"filterBarPlaceholder",void 0),wQ([e("StartsWith")],$6.prototype,"filterType",void 0),wQ([e("Never")],$6.prototype,"floatLabelType",void 0),wQ([e(null)],$6.prototype,"footerTemplate",void 0),wQ([e(!1)],$6.prototype,"ignoreAccent",void 0),wQ([e(!0)],$6.prototype,"ignoreCase",void 0),wQ([e(null)],$6.prototype,"headerTemplate",void 0),wQ([e({})],$6.prototype,"htmlAttributes",void 0),wQ([e(null)],$6.prototype,"itemTemplate",void 0),wQ([e("Default")],$6.prototype,"mode",void 0),wQ([e("No Records Found")],$6.prototype,"noRecordsTemplate",void 0),wQ([e(null)],$6.prototype,"placeholder",void 0),wQ([e("300px")],$6.prototype,"popupHeight",void 0),wQ([e("100%")],$6.prototype,"popupWidth",void 0),wQ([e(!1)],$6.prototype,"readonly",void 0),wQ([e(!1)],$6.prototype,"showSelectAll",void 0),wQ([e("Select All")],$6.prototype,"selectAllText",void 0),wQ([e(!1)],$6.prototype,"showCheckBox",void 0),wQ([e(!0)],$6.prototype,"destroyPopupOnHide",void 0),wQ([e(!0)],$6.prototype,"enableHtmlSanitizer",void 0),wQ([e(!0)],$6.prototype,"showClearButton",void 0),wQ([e(!0)],$6.prototype,"showDropDownIcon",void 0),wQ([e("None")],$6.prototype,"sortOrder",void 0),wQ([e(null)],$6.prototype,"text",void 0),wQ([t({},X6)],$6.prototype,"treeSettings",void 0),wQ([e("Unselect All")],$6.prototype,"unSelectAllText",void 0),wQ([e(null)],$6.prototype,"value",void 0),wQ([e(null)],$6.prototype,"valueTemplate",void 0),wQ([e("100%")],$6.prototype,"width",void 0),wQ([e(1e3)],$6.prototype,"zIndex",void 0),wQ([e(!1)],$6.prototype,"wrapText",void 0),wQ([i()],$6.prototype,"actionFailure",void 0),wQ([i()],$6.prototype,"beforeOpen",void 0),wQ([i()],$6.prototype,"change",void 0),wQ([i()],$6.prototype,"close",void 0),wQ([i()],$6.prototype,"blur",void 0),wQ([i()],$6.prototype,"created",void 0),wQ([i()],$6.prototype,"dataBound",void 0),wQ([i()],$6.prototype,"destroyed",void 0),wQ([i()],$6.prototype,"filtering",void 0),wQ([i()],$6.prototype,"focus",void 0),wQ([i()],$6.prototype,"keyPress",void 0),wQ([i()],$6.prototype,"open",void 0),wQ([i()],$6.prototype,"select",void 0);var J6,Z6=wQ([Bt],$6);function $6(e,t){e=J6.call(this,e,t)||this;return e.filterTimer=null,e.isFilteredData=!1,e.isFilterRestore=!1,e.selectedData=[],e.filterDelayTime=300,e.isClicked=!1,e.documentClickContext=e.onDocumentClick.bind(e),e.isCheckAllCalled=!1,e.isFromFilterChange=!1,e}eU=function(e,t){return(eU=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])}))(e,t)};var eU,tU,bQ=function(e,t){function i(){this.constructor=e}eU(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},wQ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},iU="e-atc-spinner-icon",nU=(Qz.root="e-combobox",{container:null,buttons:[]}),oU=(bQ(rU,tU=qz),rU.prototype.preRender=function(){tU.prototype.preRender.call(this)},rU.prototype.getLocaleName=function(){return"combo-box"},rU.prototype.wireEvent=function(){"combobox"===this.getModuleName()&&(E.add(this.inputWrapper.buttons[0],"mousedown",this.preventBlur,this),E.add(this.inputWrapper.container,"blur",this.onBlurHandler,this)),je(this.inputWrapper.buttons[0])||E.add(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick,this),E.add(this.inputElement,"focus",this.targetFocus,this),this.readonly||(E.add(this.inputElement,"input",this.onInput,this),E.add(this.inputElement,"keyup",this.onFilterUp,this),E.add(this.inputElement,"keydown",this.onFilterDown,this),E.add(this.inputElement,"paste",this.pasteHandler,this),E.add(window,"resize",this.windowResize,this)),this.bindCommonEvent()},rU.prototype.preventBlur=function(e){(this.allowFiltering||document.activeElement===this.inputElement||document.activeElement.classList.contains(Qz.input)||!F.isDevice)&&F.isDevice||e.preventDefault()},rU.prototype.onBlurHandler=function(e){var t=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;je(this.listData)||je(t)||t===this.text||this.customValue(e),tU.prototype.onBlurHandler.call(this,e)},rU.prototype.targetElement=function(){return this.inputElement},rU.prototype.setOldText=function(e){HF.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue(),this.removeSelection()},rU.prototype.setOldValue=function(e){this.allowCustom?(this.selectedLI=this.getElementByValue(this.value),this.valueMuteChange(this.value)):this.valueMuteChange(null),this.removeSelection(),this.setHiddenValue()},rU.prototype.valueMuteChange=function(e){e=this.allowObjectBinding&&!je(e)?R(this.fields.value||"",e):e;var t,i,n,o=je(e)?null:e.toString(),o=(HF.setValue(o,this.inputElement,this.floatLabelType,this.showClearButton),{}),r=(this.allowObjectBinding&&je(e=this.getDataByValue(e))&&(t=this.fields,n=i=!1,this.allowObjectBinding&&((r=Object.keys(this.value)).forEach(function(e){e===t.value&&(n=!0)}),r.forEach(function(e){e===t.text&&(i=!0)})),o={text:n?R(i?t.text:t.value,this.value):null,value:n?this.value:null,index:null}),this.allowObjectBinding?this.setProperties(o,!0):this.setProperties({value:e,text:e&&e.toString(),index:null},!0),this.activeIndex=this.index,this.fields),o={};o[r.text]=je(e)?null:e.toString(),o[r.value]=je(e)?null:e.toString(),this.itemData=o,this.item=null,(!this.allowObjectBinding&&this.previousValue!==this.value||this.allowObjectBinding&&this.previousValue&&this.value&&!this.isObjectInArray(this.previousValue,[this.value]))&&this.detachChangeEvent(null)},rU.prototype.updateValues=function(){var e,t,i,n,o,r,s;this.fields.disabled&&(null!=this.value&&(this.value=this.isDisableItemValue(this.value)?null:this.value),null!=this.text&&(this.text=this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?null:this.text),null!=this.index)&&(this.index=this.isDisabledItemByIndex(this.index)?null:this.index,this.activeIndex=this.index),je(this.value)?this.text&&je(this.value)?(e=this.getElementByText(this.text))?this.setSelection(e,null):(HF.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue()):this.setSelection(this.liCollections[this.activeIndex],null):(n=this.allowObjectBinding&&!je(this.value)?R(this.fields.value||"",this.value):this.value,n=!je(e=this.getElementByValue(n)),this.enableVirtualization&&this.value&&(t=this.fields.value||"",i=this.allowObjectBinding&&!je(this.value)?R(this.fields.value||"",this.value):this.value,this.dataSource instanceof me?(o=new me(this.virtualGroupDataSource).executeLocal((new ya).where(new ba(t,"equal",i))))&&0<o.length&&(this.itemData=o[0],n=!0,r=this.getItemData(),s=this.allowObjectBinding?this.getDataByValue(r.value):r.value,this.value===r.value&&this.text!==r.text||this.value!==r.value&&this.text===r.text)&&this.setProperties({text:r.text&&r.text.toString(),value:s}):(o=new me(this.dataSource).executeLocal((new ya).where(new ba(t,"equal",i))))&&0<o.length&&(this.itemData=o[0],n=!0,r=this.getItemData(),s=this.allowObjectBinding?this.getDataByValue(r.value):r.value,this.value===r.value&&this.text!==r.text||this.value!==r.value&&this.text===r.text)&&this.setProperties({text:r.text&&r.text.toString(),value:s})),e?this.setSelection(e,null):!this.enableVirtualization&&this.allowCustom||this.allowCustom&&this.enableVirtualization&&!n?this.valueMuteChange(this.value):this.enableVirtualization&&(!this.enableVirtualization||n)||this.valueMuteChange(null)),this.setHiddenValue(),HF.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},rU.prototype.updateIconState=function(){this.showClearButton&&(this.inputElement&&""!==this.inputElement.value&&!this.readonly?q:U)([this.inputWrapper.clearButton],Qz.clearIconHide)},rU.prototype.getAriaAttributes=function(){return{role:"combobox","aria-autocomplete":"both","aria-labelledby":this.hiddenElement.id,"aria-expanded":"false","aria-readonly":this.readonly?this.readonly.toString():"false",autocomplete:"off",autocapitalize:"off",spellcheck:"false"}},rU.prototype.searchLists=function(e){this.isTyped=!0,this.isFiltering()?(tU.prototype.searchLists.call(this,e),this.ulElement&&""===this.filterInput.value.trim()&&this.setHoverList(this.ulElement.querySelector("."+Qz.li))):(this.ulElement&&""===this.inputElement.value&&this.preventAutoFill&&this.setHoverList(this.ulElement.querySelector("."+Qz.li)),this.incrementalSearch(e))},rU.prototype.getNgDirective=function(){return"EJS-COMBOBOX"},rU.prototype.setSearchBox=function(){return this.filterInput=this.inputElement,this.isFiltering()||this.isReact&&"combobox"===this.getModuleName()?this.inputWrapper:nU},rU.prototype.onActionComplete=function(e,t,i,n){var o=this;tU.prototype.onActionComplete.call(this,e,t,i),this.isSelectCustom&&this.removeSelection(),this.preventAutoFill||"combobox"!==this.getModuleName()||!this.isTyped||this.enableVirtualization||setTimeout(function(){o.inlineSearch()})},rU.prototype.getFocusElement=function(){var e=this.isSelectCustom?{text:""}:this.getItemData(),t=je(this.list)?this.list:this.list.querySelector("."+Qz.selected);if(e.text&&e.text.toString()===this.inputElement.value&&!je(t))return t;if((F.isDevice&&!this.isDropDownClick||!F.isDevice)&&!je(this.liCollections)&&0<this.liCollections.length){var i=this.inputElement.value,n=this.sortedData,o=this.typeOfData(n).typeof,r=H_(i,this.liCollections,this.filterType,!0,n,this.fields,o,this.ignoreAccent);if(this.enableVirtualization&&""!==i&&"autocomplete"!==this.getModuleName()&&this.isTyped&&!this.allowFiltering){var s=!1,e=this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount,t=0===this.incrementalEndIndex;for((e||t)&&(s=!0,this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=t?Math.min(100,this.totalItemCount):Math.min(this.incrementalEndIndex+100,this.totalItemCount),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),s=!0),0===this.viewPortInfo.startIndex&&!s||this.updateIncrementalView(0,this.itemCount),r=H_(i,this.incrementalLiCollections,this.filterType,!0,n,this.fields,o);je(r.item)&&this.incrementalEndIndex<this.totalItemCount;){if(this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),s=!0,0===this.viewPortInfo.startIndex&&!s||this.updateIncrementalView(0,this.itemCount),!je(r=H_(i,this.incrementalLiCollections,this.filterType,!0,n,this.fields,o))){r.index=r.index+this.incrementalStartIndex;break}if(je(r)&&this.incrementalEndIndex>=this.totalItemCount){this.incrementalStartIndex=0,this.incrementalEndIndex=this.totalItemCount<100?this.totalItemCount:100;break}}e=0<r.index-(this.itemCount/2-2)?r.index-(this.itemCount/2-2):0,t=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;e!==this.viewPortInfo.startIndex&&this.updateIncrementalView(e,t),je(r.item)?(this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0):(e=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,t=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount,this.updateIncrementalView(e,t),r.item=this.getElementByValue(r.item.getAttribute("data-value"))),r&&r.item&&(r.item=this.getElementByValue(r.item.getAttribute("data-value")))}var a,l,h,d,p,e=r.item;return je(e)?this.isSelectCustom&&""!==this.inputElement.value.trim()&&(this.removeFocus(),this.enableVirtualization||(this.list.scrollTop=0)):(t=this.getIndexByValue(e.getAttribute("data-value"))-1,a=parseInt(getComputedStyle(this.liCollections[0],null).getPropertyValue("height"),10),isNaN(a)||"autocomplete"===this.getModuleName()||(this.removeFocus(),l=this.fields.groupBy?this.liCollections[0].offsetHeight:0,this.enableVirtualization?(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.enableVirtualization&&!this.fields.groupBy&&(d=e.offsetTop+(this.virtualListInfo&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex:0)*(h=e.offsetHeight),p=this.list.querySelectorAll(".e-virtual-list").length,this.list.scrollTop=d-p*h)):this.list.scrollTop=t*a+l,U([e],Qz.focus))),e}return null},rU.prototype.setValue=function(e){return(e&&"keydown"===e.type&&"enter"===e.action||e&&"click"===e.type)&&this.removeFillSelection(),this.autofill&&"combobox"===this.getModuleName()&&e&&"keydown"===e.type&&"enter"!==e.action?(this.preventAutoFill=!1,this.inlineSearch(e),!1):tU.prototype.setValue.call(this,e)},rU.prototype.checkCustomValue=function(){var e=this.allowObjectBinding&&!je(this.value)?R(this.fields.value||"",this.value):this.value,e=(this.itemData=this.getDataByValue(e),this.getItemData()),t=this.allowObjectBinding?this.itemData:e.value;this.allowCustom&&je(e.value)&&je(e.text)||this.setProperties({value:t},!this.allowCustom)},rU.prototype.showSpinner=function(){je(this.spinnerElement)&&(this.spinnerElement="autocomplete"===this.getModuleName()?this.inputWrapper.buttons[0]||this.inputWrapper.clearButton||HF.appendSpan("e-input-group-icon "+iU,this.inputWrapper.container,this.createElement):this.inputWrapper.buttons[0]||this.inputWrapper.clearButton,U([this.spinnerElement],Qz.disableIcon),mA({target:this.spinnerElement,width:F.isDevice?"16px":"14px"},this.createElement),kA(this.spinnerElement))},rU.prototype.hideSpinner=function(){je(this.spinnerElement)||(BA(this.spinnerElement),q([this.spinnerElement],Qz.disableIcon),this.spinnerElement.classList.contains(iU)?G(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},rU.prototype.setAutoFill=function(e,t){var i,n;t||this.setHoverList(e),this.autofill&&!this.preventAutoFill&&(i=this.getTextByValue(e.getAttribute("data-value")).toString(),n=this.getFormattedValue(e.getAttribute("data-value")),"combobox"===this.getModuleName()&&(!this.isSelected&&!this.allowObjectBinding&&this.previousValue!==n||this.allowObjectBinding&&this.previousValue&&n&&!this.isObjectInArray(this.previousValue,[this.getDataByValue(n)])?(this.updateSelectedItem(e,null),this.isSelected=!0,this.previousValue=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(e.getAttribute("data-value"))):this.getFormattedValue(e.getAttribute("data-value"))):this.updateSelectedItem(e,null,!0)),this.isAndroidAutoFill(i)||this.setAutoFillSelection(i,t))},rU.prototype.isAndroidAutoFill=function(e){var t,i,n,o;return!!F.isAndroid&&(o=this.getSelectionPoints(),t=this.prevSelectPoints.end,i=o.end,n=this.prevSelectPoints.start,o=o.start,0!==t)&&(t===e.length&&n===e.length||o<n&&i<t||t===i&&n===o)},rU.prototype.clearAll=function(e,t){(je(t)||!je(t)&&je(t.dataSource))&&tU.prototype.clearAll.call(this,e),this.isFiltering()&&!je(e)&&e.target===this.inputWrapper.clearButton&&(this.typedString=this.filterInput.value,this.searchLists(e))},rU.prototype.isSelectFocusItem=function(e){return!je(e)},rU.prototype.inlineSearch=function(e){var t,e=e&&("down"===e.action||"up"===e.action||"home"===e.action||"end"===e.action||"pageUp"===e.action||"pageDown"===e.action),i=e?this.liCollections[this.activeIndex]:this.getFocusElement();je(i)?je(this.inputElement)||""!==this.inputElement.value?(this.activeIndex=null,this.removeSelection(),this.liCollections&&0<this.liCollections.length&&!this.isCustomFilter&&this.removeFocus()):(this.activeIndex=null,je(this.list)||(this.enableVirtualization||(this.list.scrollTop=0),t=this.list.querySelector("."+Qz.li),this.setHoverList(t))):(e||(t=this.getFormattedValue(i.getAttribute("data-value")),this.activeIndex=this.getIndexByValue(t),this.activeIndex=je(this.activeIndex)?null:this.activeIndex),this.preventAutoFill=""!==this.inputElement.value&&this.preventAutoFill,this.setAutoFill(i,e))},rU.prototype.incrementalSearch=function(e){this.showPopup(e),je(this.listData)||(this.inlineSearch(e),e.preventDefault())},rU.prototype.setAutoFillSelection=function(e,t){void 0===t&&(t=!1);var i=this.getSelectionPoints(),n=this.inputElement.value.substr(0,i.start);n&&n.toLowerCase()===e.substr(0,i.start).toLowerCase()?(n=n+e.substr(n.length,e.length),HF.setValue(n,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(i.start,this.inputElement.value.length)):t&&(HF.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(0,this.inputElement.value.length))},rU.prototype.getValueByText=function(e){return tU.prototype.getValueByText.call(this,e,!0,this.ignoreAccent)},rU.prototype.unWireEvent=function(){"combobox"===this.getModuleName()&&(E.remove(this.inputWrapper.buttons[0],"mousedown",this.preventBlur),E.remove(this.inputWrapper.container,"blur",this.onBlurHandler)),je(this.inputWrapper.buttons[0])||E.remove(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick),this.inputElement&&(E.remove(this.inputElement,"focus",this.targetFocus),this.readonly||(E.remove(this.inputElement,"input",this.onInput),E.remove(this.inputElement,"keyup",this.onFilterUp),E.remove(this.inputElement,"keydown",this.onFilterDown),E.remove(this.inputElement,"paste",this.pasteHandler),E.remove(window,"resize",this.windowResize))),this.unBindCommonEvent()},rU.prototype.setSelection=function(e,t){tU.prototype.setSelection.call(this,e,t),je(e)||this.autofill||this.isDropDownClick||this.removeFocus()},rU.prototype.selectCurrentItem=function(e){var t;if(this.isPopupOpen){if(t=this.isSelected?this.list.querySelector("."+Qz.selected):this.list.querySelector("."+Qz.focus),this.isDisabledElement(t))return;t&&(this.setSelection(t,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e))}"enter"===e.action&&""===this.inputElement.value?this.clearAll(e):this.isTyped&&!this.isSelected&&je(t)&&this.customValue(e),this.hidePopup(e)},rU.prototype.setHoverList=function(e){this.removeSelection(),this.isValidLI(e)&&!e.classList.contains(Qz.selected)&&(this.removeFocus(),e.classList.add(Qz.focus))},rU.prototype.targetFocus=function(e){F.isDevice&&!this.allowFiltering&&(this.preventFocus=!1),this.onFocus(e),HF.calculateWidth(this.inputElement,this.inputWrapper.container)},rU.prototype.dropDownClick=function(e){e.preventDefault(),F.isDevice&&!this.isFiltering()&&(this.preventFocus=!0),tU.prototype.dropDownClick.call(this,e)},rU.prototype.customValue=function(t){var i,n,e,o,r=this,s=this.getValueByText(this.inputElement.value);this.allowCustom||""===this.inputElement.value?""!==this.inputElement.value?(i=this.value,je(s)?(e={text:n=""===this.inputElement.value?null:this.inputElement.value,item:{}},this.isObjectCustomValue=!0,this.initial?this.updateCustomValueCallback(n,e,i):this.trigger("customValueSpecifier",e,function(e){r.updateCustomValueCallback(n,e,i,t)})):(this.isSelectCustom=!1,s=this.allowObjectBinding?this.getDataByValue(s):s,this.setProperties({value:s}),(!this.allowObjectBinding&&i!==this.value||this.allowObjectBinding&&i&&this.value&&!this.isObjectInArray(i,[this.value]))&&this.onChangeEvent(t))):this.allowCustom&&this.isFocused&&(this.isSelectCustom=!0):(e=this.previousValue,o=this.value,s=this.allowObjectBinding?this.getDataByValue(s):s,this.setProperties({value:s}),je(this.value)&&HF.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.autofill&&(!this.allowObjectBinding&&e===this.value||this.allowObjectBinding&&e&&this.isObjectInArray(e,[this.value]))&&(!this.allowObjectBinding&&o!==this.value||this.allowObjectBinding&&o&&!this.isObjectInArray(o,[this.value]))&&this.onChangeEvent(null))},rU.prototype.updateCustomValueCallback=function(e,t,i,n){var o=this,r=this.fields,t=t.item,s={},a=(t&&R(r.text,t)&&R(r.value,t)?s=t:(x(r.text,e,s),x(r.value,e,s)),this.itemData=s,{}),e=(this.allowObjectBinding&&(t=this.listData&&0<this.listData.length?Object.keys(this.listData[0]):Object.keys(this.itemData),(t=this.listData&&0<this.listData.length||!("autocomplete"===this.getModuleName()||"combobox"===this.getModuleName()&&this.allowFiltering)?t:this.firstItem?Object.keys(this.firstItem):Object.keys(this.itemData)).forEach(function(e){a[e]=e===r.value||e===r.text?R(r.value,o.itemData):null})),{text:R(r.text,this.itemData),value:this.allowObjectBinding?a:R(r.value,this.itemData),index:null});this.setProperties(e,!0),this.setSelection(null,null),this.isSelectCustom=!0,this.isObjectCustomValue=!1,(!this.allowObjectBinding&&i!==this.value||this.allowObjectBinding&&(null==i&&null!==this.value||i&&!this.isObjectInArray(i,[this.value])))&&this.onChangeEvent(n,!0)},rU.prototype.onPropertyChanged=function(e,t){"combobox"===this.getModuleName()&&(this.checkData(e),this.setUpdateInitial(["fields","query","dataSource"],e,t));for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];switch(o){case"readonly":HF.setReadonly(this.readonly,this.inputElement),this.readonly?(E.remove(this.inputElement,"input",this.onInput),E.remove(this.inputElement,"keyup",this.onFilterUp),E.remove(this.inputElement,"keydown",this.onFilterDown)):(E.add(this.inputElement,"input",this.onInput,this),E.add(this.inputElement,"keyup",this.onFilterUp,this),E.add(this.inputElement,"keydown",this.onFilterDown,this)),this.setReadOnly();break;case"allowFiltering":this.setSearchBox(),this.isFiltering()&&"combobox"===this.getModuleName()&&je(this.list)&&tU.prototype.renderList.call(this);break;case"allowCustom":break;default:var r=this.getPropObject(o,e,t);tU.prototype.onPropertyChanged.call(this,r.newProperty,r.oldProperty),this.isFiltering()&&"dataSource"===o&&je(this.list)&&this.itemTemplate&&"combobox"===this.getModuleName()&&tU.prototype.renderList.call(this)}}},rU.prototype.render=function(){tU.prototype.render.call(this),this.setSearchBox(),this.renderComplete(),this.autoFill=this.autofill},rU.prototype.getModuleName=function(){return"combobox"},rU.prototype.addItem=function(e,t){tU.prototype.addItem.call(this,e,t)},rU.prototype.filter=function(e,t,i){tU.prototype.filter.call(this,e,t,i)},rU.prototype.showPopup=function(e){tU.prototype.showPopup.call(this,e)},rU.prototype.hidePopup=function(e){var t=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;if(!je(this.listData)){var i,n=this.isEscapeKey,o=(this.isEscapeKey&&(HF.setValue(this.typedString,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1),this.autofill&&this.removeFillSelection(),this.isSelectCustom?{text:""}:this.getItemData()),r=je(this.list)?null:this.list.querySelector("."+Qz.selected);if(this.inputElement&&o.text===this.inputElement.value&&!je(r))return this.isSelected&&(this.onChangeEvent(e),this.isSelectCustom=!1),void tU.prototype.hidePopup.call(this,e);"combobox"===this.getModuleName()&&""!==this.inputElement.value.trim()&&(o=this.sortedData,r=this.typeOfData(o).typeof,i=H_(this.inputElement.value,this.liCollections,"Equal",!0,o,this.fields,r),this.selectedLI=i.item,je(i.index)&&(i.index=H_(this.inputElement.value,this.liCollections,"StartsWith",!0,o,this.fields,r).index),this.activeIndex=i.index,je(this.selectedLI)?n&&(this.isSelectCustom=!0,this.removeSelection()):this.updateSelectedItem(this.selectedLI,null,!0)),this.isEscapeKey||!this.isTyped||this.isInteracted||this.customValue(e)}o=this.allowObjectBinding&&!je(this.value)?R(this.fields.value||"",this.value):this.value;je(this.listData)&&this.allowCustom&&!je(t)&&t!==o&&this.customValue(),tU.prototype.hidePopup.call(this,e)},rU.prototype.focusIn=function(){this.enabled&&(F.isDevice&&!this.isFiltering()&&(this.preventFocus=!0),tU.prototype.focusIn.call(this))},rU.prototype.clear=function(){this.value=null},rU.prototype.focusOut=function(e){tU.prototype.focusOut.call(this,e)},rU.prototype.getItems=function(){return tU.prototype.getItems.call(this)},rU.prototype.getDataByValue=function(e){return tU.prototype.getDataByValue.call(this,e)},wQ([e(!(rU.prototype.renderHightSearch=function(){}))],rU.prototype,"autofill",void 0),wQ([e(!0)],rU.prototype,"allowCustom",void 0),wQ([e({})],rU.prototype,"htmlAttributes",void 0),wQ([e(!1)],rU.prototype,"allowFiltering",void 0),wQ([e(!0)],rU.prototype,"isDeviceFullScreen",void 0),wQ([e(null)],rU.prototype,"query",void 0),wQ([e(null)],rU.prototype,"index",void 0),wQ([e(!0)],rU.prototype,"showClearButton",void 0),wQ([e(!1)],rU.prototype,"enableRtl",void 0),wQ([i()],rU.prototype,"customValueSpecifier",void 0),wQ([i()],rU.prototype,"filtering",void 0),wQ([e(null)],rU.prototype,"valueTemplate",void 0),wQ([e("Never")],rU.prototype,"floatLabelType",void 0),wQ([e(null)],rU.prototype,"filterBarPlaceholder",void 0),wQ([e(null)],rU.prototype,"cssClass",void 0),wQ([e(null)],rU.prototype,"headerTemplate",void 0),wQ([e(null)],rU.prototype,"footerTemplate",void 0),wQ([e(null)],rU.prototype,"placeholder",void 0),wQ([e("100%")],rU.prototype,"width",void 0),wQ([e("300px")],rU.prototype,"popupHeight",void 0),wQ([e("100%")],rU.prototype,"popupWidth",void 0),wQ([e(!1)],rU.prototype,"readonly",void 0),wQ([e(null)],rU.prototype,"text",void 0),wQ([e(null)],rU.prototype,"value",void 0),wQ([e(!1)],rU.prototype,"allowObjectBinding",void 0),wQ([Bt],rU));function rU(e,t){return tU.call(this,e,t)||this}sU=function(e,t){return(sU=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])}))(e,t)};var sU,aU,bQ=function(e,t){function i(){this.constructor=e}sU(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},wQ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},lU=(Qz.root="e-autocomplete",Qz.icon="e-input-group-icon e-ddl-icon e-search-icon",bQ(hU,aU=oU),hU.prototype.preRender=function(){aU.prototype.preRender.call(this)},hU.prototype.getLocaleName=function(){return"auto-complete"},hU.prototype.getNgDirective=function(){return"EJS-AUTOCOMPLETE"},hU.prototype.getQuery=function(e){var t,i=e?e.clone():this.query?this.query.clone():new ya,e=this.allowObjectBinding&&!je(this.value)?R(this.fields.value||"",this.value):this.value,n=""!==this.queryString||je(e)?this.filterType:"equal",e=""!==this.queryString||je(e)?this.queryString:e;if(this.isFiltered)if(this.enableVirtualization&&!je(this.customFilterQuery))i=this.customFilterQuery.clone();else if(!this.enableVirtualization)return i;if(null!==this.queryString&&""!==this.queryString&&(t=this.typeOfData(this.dataSource).typeof,(this.dataSource instanceof me||"string"!==t)&&"number"!==t?(t=je(this.fields.value)?"":this.fields.value,i.where(t,n,e,this.ignoreCase,this.ignoreAccent)):i.where("",n,e,this.ignoreCase,this.ignoreAccent)),!je(this.suggestionCount)&&!this.enableVirtualization){if(20!==this.suggestionCount)for(var o=0;o<i.queries.length;o++)"onTake"===i.queries[o].fn&&i.queries.splice(o,1);i.take(this.suggestionCount)}if(this.enableVirtualization){var r=0,s=0,a=this.getTakeValue();if(i&&0<i.queries.length)for(o=0;o<i.queries.length;o++)"onSkip"===i.queries[o].fn&&(s=i.queries[o].e.nos),"onTake"===i.queries[o].fn&&(r=a<=i.queries[o].e.nos?i.queries[o].e.nos:a);if(r<=0&&this.query&&0<this.query.queries.length)for(var l,o=0;o<this.query.queries.length;o++)"onTake"===this.query.queries[o].fn&&(r=a<=(l=this.query.queries[o].e.nos)?l:a);if(i&&0<i.queries.length)for(var h,o=0;o<i.queries.length;o++)"onSkip"===i.queries[o].fn?(s=i.queries[o].e.nos,i.queries.splice(o,1),--o):"onTake"===i.queries[o].fn&&(r=(h=i.queries[o].e.nos)<=r?r:h,i.queries.splice(o,1),--o);0<s&&this.virtualItemStartIndex<=s?i.skip(s):i.skip(this.virtualItemStartIndex),0<r&&a<=r?i.take(r):i.take(a),i.requiresCount()}return i},hU.prototype.searchLists=function(t){var n,o=this;this.isTyped=!0,this.isDataFetched=this.isSelectCustom=!1,this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,this.checkAndResetCache(),je(this.list)&&aU.prototype.renderList.call(this,t,!0),this.queryString=this.filterInput.value,"mousedown"===t.type||40!==t.keyCode&&38!==t.keyCode?(this.isSelected=!1,this.activeIndex=null,n={preventDefaultAction:this.isRequesting=!1,text:this.filterInput.value,updateData:function(e,t,i){n.cancel||(o.isFiltered=!0,o.customFilterQuery=t,o.filterAction(e,t,i))},cancel:!1},this.trigger("filtering",n,function(e){e.cancel||o.isFiltered||e.preventDefaultAction||(o.searchList=!0,o.filterAction(o.dataSource,null,o.fields,t))})):(this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,this.resetList(this.dataSource,this.fields,null,t))},hU.prototype.filter=function(e,t,i){this.isFiltered=!0,this.filterAction(e,t,i)},hU.prototype.filterAction=function(e,t,i,n){this.beforePopupOpen=!0;var o;this.list.classList.contains("e-nodata");""!==this.queryString&&this.queryString.length>=this.minLength?(this.enableVirtualization&&this.isFiltering()&&this.isTyped&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.resetList(e,i,t,n),e=this.list.classList.contains("e-nodata"),this.enableVirtualization&&!e&&(!this.list.querySelector(".e-virtual-ddl-content")&&this.list.querySelector(".e-list-parent")&&((o=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(o).appendChild(this.list.querySelector(".e-list-parent"))),!this.list.querySelector(".e-virtual-ddl"))&&this.list.parentElement&&((o=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(o)),("autocomplete"===this.getModuleName()&&!(this.dataSource instanceof me)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof me&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount()):(this.hidePopup(n),this.beforePopupOpen=!1),this.renderReactTemplates()},hU.prototype.clearAll=function(e,t){(je(t)||!je(t)&&je(t.dataSource))&&(aU.prototype.clearAll.call(this,e),this.checkAndResetCache()),this.beforePopupOpen&&this.hidePopup()},hU.prototype.onActionComplete=function(e,t,i,n){this.enableVirtualization||(this.fixedHeaderElement=null),("autocomplete"===this.getModuleName()&&!(this.dataSource instanceof me)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof me&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount(),aU.prototype.onActionComplete.call(this,e,t,i);e=this.list.querySelector("."+Qz.li);je(e)||q([e],Qz.focus),je(this.itemData)||this.enableVirtualization||this.focusIndexItem(),this.postBackAction()},hU.prototype.postBackAction=function(){var e,t,i;this.autofill&&!je(this.liCollections[0])&&this.searchList&&(i=[this.liCollections[0]],e=this.listData,t=this.typeOfData(e).typeof,i=H_(this.inputElement.value,i,"StartsWith",this.ignoreCase,e,this.fields,t),this.searchList=!1,je(i.item)||aU.prototype.setAutoFill.call(this,this.liCollections[0],!0))},hU.prototype.setSelection=function(e,t){var i;this.isValidLI(e)?!je(t)&&"keydown"===t.type&&"enter"!==t.action&&"tab"!==t.action&&this.isValidLI(e)?(i=this.getFormattedValue(e.getAttribute("data-value")),this.activeIndex=this.getIndexByValue(i),this.setHoverList(e),this.selectedLI=e,this.setScrollPosition(t),this.autofill&&this.isPopupOpen&&(this.preventAutoFill=!1,i=t&&"down"===t.action||"up"===t.action||"home"===t.action||"end"===t.action||"pageUp"===t.action||"pageDown"===t.action,aU.prototype.setAutoFill.call(this,e,i))):(aU.prototype.setSelection.call(this,e,t),this.isFiltered=!1):this.selectedLI=e},hU.prototype.listOption=function(e,t){var i,n=this,e=aU.prototype.listOption.call(this,e,t);return je(e.itemCreated)?e.itemCreated=function(e){n.highlight&&(n.element.tagName===n.getNgDirective()&&n.itemTemplate?setTimeout(function(){W_(e.item,n.queryString,n.ignoreCase,n.filterType)},0):W_(e.item,n.queryString,n.ignoreCase,n.filterType))}:(i=e.itemCreated,e.itemCreated=function(e){n.highlight&&W_(e.item,n.queryString,n.ignoreCase,n.filterType),i.apply(n,[e])}),e},hU.prototype.isFiltering=function(){return!0},hU.prototype.renderPopup=function(e){this.enableVirtualization||(this.list.scrollTop=0),aU.prototype.renderPopup.call(this,e)},hU.prototype.isEditTextBox=function(){return!1},hU.prototype.isPopupButton=function(){return this.showPopupButton},hU.prototype.isSelectFocusItem=function(e){return!1},hU.prototype.setInputValue=function(t,e){var i,n,o,r,s=e&&e.text?e.text:e&&e.value,e=t&&t.text?t.text:(t&&t.value?t:this).value;this.allowObjectBinding&&(s=je(s)?s:R(this.fields.value||"",s),e=je(e)?e:R(this.fields.value||"",e)),!e||""!==this.typedString||this.allowCustom||this.dataSource instanceof me?t&&(t.text?this.setOldText(s):this.setOldValue(s)):(i="string"===this.typeOfData(this.dataSource).typeof?"":this.fields.value,n=this.getItems().length,o=new ya,new me((r=this).dataSource).executeQuery(o.where(new ba(i,"equal",e))).then(function(e){0<e.result.length?(r.value=""!==i?r.allowObjectBinding?e.result[0]:e.result[0][r.fields.value].toString():e.result[0].toString(),r.addItem(e.result,n),r.updateValues()):t&&t.text?r.setOldText(s):t&&t.value?r.setOldValue(s):r.updateValues()}))},hU.prototype.showPopup=function(e){this.enabled&&(this.beforePopupOpen?this.refreshPopup():(this.beforePopupOpen=!0,this.preventAutoFill=!0,je(this.list)?this.renderList(e):this.resetList(this.dataSource,this.fields,null,e)))},hU.prototype.hidePopup=function(e){aU.prototype.hidePopup.call(this,e),this.activeIndex=null,this.virtualListInfo=this.viewPortInfo,this.previousStartIndex=this.viewPortInfo.startIndex,this.startIndex=this.viewPortInfo.startIndex,this.previousEndIndex=this.viewPortInfo.endIndex},hU.prototype.onPropertyChanged=function(e,t){"autocomplete"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],e);for(var i=0,n=Object.keys(e);i<n.length;i++){var o,r=n[i];"showPopupButton"===r?this.showPopupButton?(o=HF.appendSpan(Qz.icon,this.inputWrapper.container,this.createElement),this.inputWrapper.buttons[0]=o,HF.calculateWidth(this.inputElement,this.inputWrapper.container),je(this.inputWrapper.buttons[0])||je(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),this.inputWrapper&&this.inputWrapper.buttons&&this.inputWrapper.buttons[0]&&E.add(this.inputWrapper.buttons[0],"click",this.dropDownClick,this)):(G(this.inputWrapper.buttons[0]),this.inputWrapper.buttons[0]=null):(o=this.getPropObject(r,e,t),aU.prototype.onPropertyChanged.call(this,o.newProperty,o.oldProperty))}},hU.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++)this.ulElement.querySelector(".e-active")||(Q_(this.liCollections[e]),W_(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType)),0},hU.prototype.getModuleName=function(){return"autocomplete"},hU.prototype.render=function(){aU.prototype.render.call(this)},wQ([t({value:null,iconCss:null,groupBy:null,disabled:null},HH)],hU.prototype,"fields",void 0),wQ([e(!0)],hU.prototype,"ignoreCase",void 0),wQ([e(!1)],hU.prototype,"showPopupButton",void 0),wQ([e(!1)],hU.prototype,"highlight",void 0),wQ([e(20)],hU.prototype,"suggestionCount",void 0),wQ([e({})],hU.prototype,"htmlAttributes",void 0),wQ([e(null)],hU.prototype,"query",void 0),wQ([e(1)],hU.prototype,"minLength",void 0),wQ([e("Contains")],hU.prototype,"filterType",void 0),wQ([i()],hU.prototype,"filtering",void 0),wQ([e(null)],hU.prototype,"index",void 0),wQ([e("Never")],hU.prototype,"floatLabelType",void 0),wQ([e(null)],hU.prototype,"valueTemplate",void 0),wQ([e(null)],hU.prototype,"filterBarPlaceholder",void 0),wQ([e(!1)],hU.prototype,"allowFiltering",void 0),wQ([e(null)],hU.prototype,"text",void 0),wQ([Bt],hU));function hU(e,t){e=aU.call(this,e,t)||this;return e.isFiltered=!1,e.searchList=!1,e}var dU="e-float-line",pU="e-float-text",cU="e-label-top",uU="e-label-bottom";function gU(e,t,i,n,o,r,s){var a=Q("span",{className:dU}),l=Q("label",{className:pU}),h=i.getAttribute("id")?i.getAttribute("id"):D("ej2_multiselect");i.id=h,je(i.id)||""===i.id||(l.id="label_"+i.id.replace(/ /g,"_"),l.setAttribute("for",i.id),pt(n,{"aria-labelledby":l.id})),je(n.placeholder)||""===n.placeholder||(l.innerText=wU(n.placeholder),n.removeAttribute("placeholder")),l.innerText=wU(s),t.appendChild(a),t.appendChild(l),e.classList.add("e-float-input"),mU(o,l),"Always"===r&&(l.classList.contains(uU)&&q([l],uU),U([l],cU))}function mU(e,t){(e&&0<e.length?(U([t],cU),q):(q([t],cU),U))([t],uU)}function fU(e,t,i,n,o,r,s){var a,l=t.querySelector("."+pU),t=t.querySelector("."+dU);je(l)?yU(o,n,a=null!==s?s:""):(a=l.innerText,G(i.querySelector("."+pU)),yU(o,n,a),je(t)||G(i.querySelector("."+dU))),e.classList.remove("e-float-input")}function yU(e,t,i){e&&e.length?t.placeholder="":t.placeholder=i}function vU(e,t){e.classList.add("e-input-focus");e=t.querySelector("."+pU);je(e)||(U([e],cU),e.classList.contains(uU)&&q([e],uU))}function bU(e,t,i,n,o){e.classList.remove("e-input-focus");e=t.querySelector("."+pU);i&&i.length<=0&&"Auto"===n&&!je(e)&&(e.classList.contains(cU)&&q([e],cU),U([e],uU))}function wU(e){var t,i="";return je(e)||""===e||((t=document.createElement("span")).innerHTML='<input  placeholder="'+e+'"/>',i=t.children[0].placeholder),i}CU=function(e,t){return(CU=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])}))(e,t)};var CU,SU,bQ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},AU="e-input-focus",xU="e-disabled",IU="e-hide-listitem",TU="e-chips",EU="e-chips-close",DU="e-chip-selected",MU="e-delimiter",kU="e-zero-size",PU="e-chips-close e-close-hooker",BU="e-delim-values",FU="e-close-icon-hide",LU="e-ddl-disable-icon",RU="e-ms-spinner-icon",OU="e-input-group-icon e-ddl-icon",NU="e-icon-anim",VU="e-delim-total",_U="e-search-custom-width",HU="e-input-filter",zU=(function(e,t){function i(){this.constructor=e}CU(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(jU,SU=Oz),jU.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())},jU.prototype.requiredModules=function(){var e,t=[];return this.enableVirtualization&&t.push({args:[this],member:"VirtualScroll"}),"CheckBox"===this.mode&&(this.isGroupChecking=this.enableGroupCheckBox,this.enableGroupCheckBox&&(e=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.enableSelectionOrder=!1,this.isProtectedOnChange=e),this.allowCustomValue=!1,this.hideSelectedItem=!1,this.closePopupOnSelect=!1,t.push({member:"CheckBoxSelection",args:[this]})),t},jU.prototype.updateHTMLAttribute=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];switch(i){case"class":var n=this.htmlAttributes[""+i].replace(/\s+/g," ").trim();""!==n&&(U([this.overAllWrapper],n.split(" ")),U([this.popupWrapper],n.split(" ")));break;case"disabled":this.enable(!1);break;case"placeholder":this.placeholder||(this.inputElement.setAttribute(i,this.htmlAttributes[""+i]),this.setProperties({placeholder:this.inputElement.placeholder},!0),this.refreshPlaceHolder());break;default:-1<["id"].indexOf(i)?this.element.setAttribute(i,this.htmlAttributes[""+i]):0===i.indexOf("data")||-1<["name","required","aria-required","form"].indexOf(i)?this.hiddenElement.setAttribute(i,this.htmlAttributes[""+i]):-1<["title","role","style","class"].indexOf(i)?this.overAllWrapper.setAttribute(i,this.htmlAttributes[""+i]):"size"===i||je(this.inputElement)||this.inputElement.setAttribute(i,this.htmlAttributes[""+i])}}},jU.prototype.updateReadonly=function(e){je(this.inputElement)||(e||"CheckBox"===this.mode?this.inputElement.setAttribute("readonly","true"):this.inputElement.removeAttribute("readonly"))},jU.prototype.updateClearButton=function(e){e?(this.overAllClear.parentNode?this.overAllClear.style.display="":this.componentWrapper.appendChild(this.overAllClear),this.componentWrapper.classList.remove(FU)):(this.overAllClear.style.display="none",this.componentWrapper.classList.add(FU))},jU.prototype.updateCssClass=function(){var e;je(this.cssClass)||""===this.cssClass||(e=this.cssClass,""!==(e=this.cssClass.replace(/\s+/g," ").trim())&&(U([this.overAllWrapper],e.split(" ")),U([this.popupWrapper],e.split(" "))))},jU.prototype.updateOldPropCssClass=function(e){je(e)||""===e||""!==(e=e.replace(/\s+/g," ").trim())&&(q([this.overAllWrapper],e.split(" ")),q([this.popupWrapper],e.split(" ")))},jU.prototype.onPopupShown=function(e){var t,i=this,e=(F.isDevice&&"CheckBox"===this.mode&&this.allowFiltering&&(t=this,window.onpopstate=function(){t.hidePopup(),t.inputElement.focus()},history.pushState({},"")),{popup:this.popupObj,event:e,cancel:!1,animation:{name:"FadeIn",duration:100}});this.trigger("open",e,function(e){e.cancel||(i.focusAtFirstListItem(!0),i.popupObj&&document.body.appendChild(i.popupObj.element),"CheckBox"===i.mode&&i.enableGroupCheckBox&&!je(i.fields.groupBy)&&i.updateListItems(i.list.querySelectorAll("li.e-list-item"),i.mainList.querySelectorAll("li.e-list-item")),"CheckBox"!==i.mode&&!i.showDropDownIcon||U([i.overAllWrapper],[NU]),i.refreshPopup(),i.renderReactTemplates(),i.popupObj&&i.popupObj.show(e.animation,1e3===i.zIndex?i.element:null),i.isReact&&setTimeout(function(){var e,t;i.popupHeight&&i.list&&"auto"!==i.popupHeight&&(e="string"==typeof i.popupHeight?parseInt(i.popupHeight,10):i.popupHeight,!i.isUpdateHeaderHeight&&i.headerTemplate&&i.header&&(t=""===i.list.style.maxHeight?e:parseInt(i.list.style.maxHeight,10),i.list.style.maxHeight=(t-i.header.offsetHeight).toString()+"px",i.isUpdateHeaderHeight=!0),!i.isUpdateFooterHeight)&&i.footerTemplate&&i.footer&&(t=""===i.list.style.maxHeight?e:parseInt(i.list.style.maxHeight,10),i.list.style.maxHeight=(t-i.footer.offsetHeight).toString()+"px",i.isUpdateFooterHeight=!0)},15),pt(i.inputElement,{"aria-expanded":"true","aria-owns":i.element.id+"_popup","aria-controls":i.element.id}),i.updateAriaActiveDescendant(),i.isFirstClick&&!i.enableVirtualization&&i.loadTemplate(),"CheckBox"===i.mode&&i.showSelectAll&&E.add(i.popupObj.element,"click",i.clickHandler,i))})},jU.prototype.updateVirtualReOrderList=function(e){var t=this.getForQuery(this.value,!0).clone();this.isVirtualReorder=!0,this.enableVirtualization&&this.dataSource instanceof me?this.resetList(this.selectedListData,this.fields,t):this.resetList(this.dataSource,this.fields,t),this.isVirtualReorder=!1,this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+_z.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl")?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():((t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(t)),this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),e&&this.loadTemplate()},jU.prototype.updateListItems=function(e,t){for(var i=0;i<e.length;i++)this.findGroupStart(e[i]),this.findGroupStart(t[i]);this.deselectHeader()},jU.prototype.loadTemplate=function(){var e;this.refreshListItems(null),this.enableVirtualization&&this.list&&"CheckBox"===this.mode&&(e=this.list.querySelectorAll(".e-reorder")[0],this.list.querySelector(".e-virtual-ddl-content"))&&e&&this.list.querySelector(".e-virtual-ddl-content").removeChild(e),"CheckBox"===this.mode&&this.removeFocus(),this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}),this.isPreventScrollAction=!0},jU.prototype.setScrollPosition=function(){var e;(!this.hideSelectedItem&&"CheckBox"!==this.mode||"CheckBox"===this.mode&&!this.enableSelectionOrder)&&!je(this.value)&&0<this.value.length&&(e=this.allowObjectBinding?R(this.fields.value||"",this.value[this.value.length-1]):this.value[this.value.length-1],je(e=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",e))||this.scrollBottom(e,void 0,!1,null,!0)),this.enableVirtualization&&(e=this.list.querySelector("."+_z.focus),this.isKeyBoardAction=!1,this.scrollBottom(e,void 0,!1,null,!0))},jU.prototype.focusAtFirstListItem=function(e){var t;this.ulElement&&this.ulElement.querySelector("li."+_z.li)&&(t=void 0,"CheckBox"===this.mode?this.removeFocus():(this.enableVirtualization?(t=this.fields.disabled?this.ulElement.querySelector("li."+_z.li+":not(.e-virtual-list):not(.e-hide-listitem):not(."+xU+")"):this.ulElement.querySelector("li."+_z.li+":not(.e-virtual-list):not(.e-hide-listitem)"),e&&this.viewPortInfo&&0!==this.viewPortInfo.startIndex&&(t=(e=this.ulElement.querySelectorAll("li."+_z.li+":not(.e-virtual-list):not(.e-hide-listitem)"))&&0<e.length?e[2]:t)):t=this.fields.disabled?this.ulElement.querySelector("li."+_z.li+":not(."+IU+"):not(."+xU+")"):this.ulElement.querySelector("li."+_z.li+":not(."+IU+")"),null!==t&&(this.removeFocus(),this.addListFocus(t))))},jU.prototype.focusAtLastListItem=function(e){var t;e?t=H_(e,this.liCollections,"StartsWith",this.ignoreCase):this.value&&this.value.length?H_(this.allowObjectBinding?R(this.fields.value||"",this.value[this.value.length-1]):this.value[this.value.length-1],this.liCollections,"StartsWith",this.ignoreCase):t=null,t&&null!==t.item&&(this.addListFocus(t.item),(this.allowCustomValue||this.allowFiltering)&&this.isPopupOpen()&&this.closePopupOnSelect&&!this.enableVirtualization||this.closePopupOnSelect&&!this.enableVirtualization)&&this.scrollBottom(t.item,t.index)},jU.prototype.getAriaAttributes=function(){return{"aria-disabled":"false",role:"combobox","aria-expanded":"false"}},jU.prototype.updateListARIA=function(){je(this.ulElement)||pt(this.ulElement,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false","aria-label":"list"});var e=!(je(this.inputElement)||!this.inputElement.disabled);this.isPopupOpen()||je(this.inputElement)||pt(this.inputElement,this.getAriaAttributes()),e&&pt(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled(e?"true":"false")},jU.prototype.ensureAriaDisabled=function(e){var t;this.htmlAttributes&&this.htmlAttributes["aria-disabled"]&&(Pe(t=this.htmlAttributes,{"aria-disabled":e},t),this.setProperties({htmlAttributes:t},!0))},jU.prototype.removelastSelection=function(e){var t,i;null!==this.chipCollectionWrapper.querySelector("span."+DU)?this.removeSelectedChip(e):(t=(t=this.chipCollectionWrapper.querySelectorAll("span."+TU))[t.length-1].getAttribute("data-value"),je(this.value)||(this.tempValues=(this.allowObjectBinding,this.value.slice())),i=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(t)):this.getFormattedValue(t),this.allowCustomValue&&("false"!==t&&!1===i||!je(i)&&"NaN"===i.toString())&&(i=t),this.removeValue(i,e),this.removeChipSelection(),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty(),this.mainList&&this.listData&&this.refreshSelection(),this.checkPlaceholderSize())},jU.prototype.onActionFailure=function(e){SU.prototype.onActionFailure.call(this,e),this.renderPopup(),this.onPopupShown()},jU.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},jU.prototype.getForQuery=function(e,t){var i=this.isPrimitiveData?"":this.fields.value;if(this.enableVirtualization&&e){if(t)for(var n=this.viewPortInfo.startIndex,o=n+this.viewPortInfo.endIndex<=e.length&&e[n+this.viewPortInfo.endIndex]?n+this.viewPortInfo.endIndex:e.length,r=n;r<o;r++)var s=this.allowObjectBinding?R(this.fields.value||"",e[r]):e[r],a=r===n?new ba(i,"equal",s):a.or(i,"equal",s);else for(r=0;r<e.length;r++){s=this.allowObjectBinding?R(this.fields.value||"",e[r]):e[r];a=this.isaddNonPresentItems?0===r?new ba(i,"equal",e[r]):a.or(i,"equal",e[r]):0===r?new ba(i,"notequal",s):a.and(i,"notequal",s)}return(new ya).where(a)}for(r=0;r<e.length;r++)a=0===r?new ba(i,"equal",e[r]):a.or(i,"equal",e[r]);return(this.dataSource instanceof me&&this.dataSource.adaptor instanceof Ma?new ya:this.getQuery(this.query).clone()).where(a)},jU.prototype.onActionComplete=function(e,t,i,n){var o=this;this.dataSource instanceof me&&!je(i)&&!this.virtualGroupDataSource&&(this.totalItemCount=i.count),this.value&&t&&0<t.length&&this.allowFiltering&&"CheckBox"!==this.mode&&!this.enableVirtualization&&!this.isFilterPrevented&&!this.allowCustomValue&&this.isFilteringAction&&t.every(function(e){var t=R(o.fields.value||"",e);return o.value.some(function(e){e=o.allowObjectBinding?R(o.fields.value||"",e):e;return t===e})})&&(e.innerHTML="",t=[]),SU.prototype.onActionComplete.call(this,e,t,i),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof me)||this.dataSource instanceof me&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.updateSelectElementData(this.allowFiltering);if(!je(this.value)&&!this.allowCustomValue&&!this.enableVirtualization&&this.listData&&0<this.listData.length)for(var r=0;r<this.value.length;r++){var s=this.allowObjectBinding?R(this.fields.value||"",this.value[r]):this.value[r];this.findListElement(this.allowFiltering&&!je(this.mainList)?this.mainList:e,"li","data-value",s)||this.dataSource instanceof me||(this.value.splice(r,1),--r)}var a=[];0<(a=je(this.value)?a:this.presentItemValue(this.ulElement)).length&&this.dataSource instanceof me&&!je(this.value)&&null!=this.listData?(this.isaddNonPresentItems=!0,this.addNonPresentItems(a,this.ulElement,this.listData),this.isaddNonPresentItems=!1):this.updateActionList(e,t,i),this.dataSource instanceof me&&this.allowCustomValue&&!this.isCustomRendered&&this.inputElement.value&&""!==this.inputElement.value&&(a=new ya,a=this.allowFiltering?a.where(this.fields.text,"startswith",this.inputElement.value,this.ignoreCase,this.ignoreAccent):a,this.checkForCustomValue(a,this.fields),this.isCustomRendered=!0,this.remoteCustomValue=!this.enableVirtualization&&this.remoteCustomValue),"CheckBox"!==this.mode||!this.enableGroupCheckBox||je(this.fields.groupBy)||je(this.fields.disabled)||this.disableGroupHeader(),this.dataSource instanceof me&&"CheckBox"===this.mode&&this.allowFiltering&&this.removeFocus()},jU.prototype.updateActionList=function(e,t,i,n){"CheckBox"===this.mode&&this.showSelectAll&&this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.mainList||this.mainData?!je(this.mainData)&&0!==this.mainData.length||(this.mainData=t):(this.mainList=e.cloneNode?e.cloneNode(!0):e,this.mainData=t,this.mainListCollection=this.liCollections),(this.remoteCustomValue||t.length<=0)&&this.allowCustomValue&&this.inputFocus&&this.allowFiltering&&this.inputElement.value&&""!==this.inputElement.value&&(this.checkForCustomValue(this.tempQuery,this.fields),this.isCustomRendered)||(this.value&&this.value.length&&("CheckBox"!==this.mode&&!je(this.inputElement)&&""!==this.inputElement.value.trim()||"CheckBox"===this.mode||(8===this.keyCode||46===this.keyCode)&&this.allowFiltering&&this.allowCustomValue&&this.dataSource instanceof me&&""===this.inputElement.value)&&this.refreshSelection(),this.updateListARIA(),this.unwireListEvents(),this.wireListEvents(),je(this.setInitialValue)||this.setInitialValue(),je(this.selectAllAction)||this.selectAllAction(),this.setDynValue&&(je(this.text)||!je(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.enableVirtualization&&(!this.enableVirtualization||this.dataSource instanceof me)?this.initialValueUpdate(this.listData,!0):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(i)))},jU.prototype.refreshSelection=function(){var e=this.hideSelectedItem?IU:_z.selected;if(!je(this.value))for(var t=0;!je(this.value[t]);t++){var i,n=this.allowObjectBinding?R(this.fields.value||"",this.value[t]):this.value[t];(i=this.findListElement(this.list,"li","data-value",n))&&(U([i],e),this.hideSelectedItem&&i.previousSibling&&i.previousElementSibling.classList.contains(_z.group)&&(!i.nextElementSibling||i.nextElementSibling.classList.contains(_z.group))&&U([i.previousElementSibling],e),this.hideSelectedItem&&this.fields.groupBy&&!i.previousElementSibling.classList.contains(IU)&&this.hideGroupItem(n),this.hideSelectedItem&&i.classList.contains(_z.focus)&&(q([i],_z.focus),0<(n=i.parentElement.querySelectorAll("."+_z.li+":not(."+IU+"):not(."+xU+")")).length?(U([n[0]],_z.focus),this.updateAriaActiveDescendant()):this.list&&0<this.list.querySelectorAll("."+_z.li).length||(this.l10nUpdate(),U([this.list],_z.noData))),i.setAttribute("aria-selected","true"),"CheckBox"===this.mode)&&i.classList.contains("e-active")&&0===i.getElementsByClassName("e-check").length&&(n={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:i,e:null},this.notify("updatelist",n))}this.checkSelectAll(),this.checkMaxSelection()},jU.prototype.hideGroupItem=function(e){for(var t,i=this.hideSelectedItem?IU:_z.selected,n=t=this.findListElement(this.ulElement,"li","data-value",e),o=0,r=0,s=!0,a=!0;!(s=t&&t.previousElementSibling&&!t.previousElementSibling.classList.contains(IU)&&t.previousElementSibling.classList.contains(_z.li)?!1:s)||!t||t.previousElementSibling&&t.previousElementSibling.classList.contains(_z.group)?o=10:t=t.previousElementSibling,!(a=n&&n.nextElementSibling&&!n.nextElementSibling.classList.contains(IU)&&n.nextElementSibling.classList.contains(_z.li)?!1:a)||!n||n.nextElementSibling&&n.nextElementSibling.classList.contains(_z.group)?r=10:n=n.nextElementSibling,o<10||r<10;);s&&a&&!t.previousElementSibling.classList.contains(IU)?U([t.previousElementSibling],i):s&&a&&t.previousElementSibling.classList.contains(IU)&&q([t.previousElementSibling],i)},jU.prototype.getValidLi=function(){var e=this.ulElement.querySelector("li."+_z.li+":not(."+IU+")");return je(e)?this.liCollections[0]:e},jU.prototype.checkSelectAll=function(){var e=(je(this.fields.disabled)?this.list.querySelectorAll("li.e-list-group-item.e-active"):this.list.querySelectorAll("li.e-list-group-item.e-active:not(.e-disabled)")).length,t=this.list.querySelectorAll("li.e-list-item"),i=(this.enableVirtualization?this.list.querySelectorAll("li."+_z.li+":not(.e-virtual-list)"):je(this.fields.disabled)?this.list.querySelectorAll("li."+_z.li):this.list.querySelectorAll("li."+_z.li+":not(.e-disabled)")).length,n=this.list.querySelectorAll("li."+_z.selected).length;if(this.enableGroupCheckBox&&!je(this.fields.groupBy)&&(n-=e),!this.enableVirtualization&&(i===n||n===this.maximumSelectionLength)&&"CheckBox"===this.mode&&this.showSelectAll||this.enableVirtualization&&"CheckBox"===this.mode&&this.showSelectAll&&this.virtualSelectAll&&this.value&&this.value.length===this.totalItemCount?this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check"}):i!==n&&"CheckBox"===this.mode&&this.showSelectAll&&(!this.enableVirtualization||this.enableVirtualization&&!this.virtualSelectAll)&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),this.enableGroupCheckBox&&this.fields.groupBy&&!this.enableSelectionOrder){for(var o=0;o<t.length;o++)this.findGroupStart(t[o]);this.deselectHeader()}},jU.prototype.openClick=function(e){this.openOnClick||"CheckBox"===this.mode||this.isPopupOpen()?this.openOnClick||"CheckBox"!==this.mode||this.isPopupOpen()||this.showPopup():""!==this.targetElement()?this.showPopup():this.hidePopup(e)},jU.prototype.keyUp=function(e){"CheckBox"!==this.mode||this.openOnClick||je(String.fromCharCode(e.keyCode).match(/\w/))||(this.isValidKey=!0),this.isValidKey=this.isPopupOpen()&&8===e.keyCode||this.isValidKey,this.isValidKey=(!e.ctrlKey||86!==e.keyCode)&&this.isValidKey,this.isValidKey&&this.inputElement&&(this.isValidKey=!1,this.expandTextbox(),this.showOverAllClear(),e.keyCode,this.search(e))},jU.prototype.filter=function(e,t,i){this.isFiltered=!0,this.remoteFilterAction=!0,this.dataUpdater(e,t,i)},jU.prototype.getQuery=function(e){var t,i=e?e.clone():this.query?this.query.clone():new ya;if(this.isFiltered){if(this.enableVirtualization&&!je(this.customFilterQuery))return i=this.customFilterQuery.clone(),this.virtualFilterQuery(i);if(!this.enableVirtualization)return i}return this.filterAction?((null!==this.targetElement()&&!this.enableVirtualization||this.enableVirtualization&&null!==this.targetElement()&&""!==this.targetElement().trim())&&(t=this.typeOfData(this.dataSource).typeof,(this.dataSource instanceof me||"string"!==t)&&"number"!==t?(!this.enableVirtualization||""===this.targetElement()||this.isClearAllAction)&&this.enableVirtualization||(t=this.fields,i.where(je(t.text)?"":t.text,this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)):i.where("",this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)),this.enableVirtualization&&0!==this.viewPortInfo.endIndex&&!this.virtualSelectAll?this.virtualFilterQuery(i):this.virtualSelectAll?(e||this.query||new ya).take(this.maximumSelectionLength).requiresCount():i):this.enableVirtualization&&0!==this.viewPortInfo.endIndex&&!this.virtualSelectAll?this.virtualFilterQuery(i):this.virtualSelectAll?(e||this.query||new ya).take(this.maximumSelectionLength).requiresCount():e||this.query||new ya},jU.prototype.virtualFilterQuery=function(e){for(var t=this.getTakeValue(),i=!0,n=!0,o=0;o<e.queries.length;o++)"multiselect"===this.getModuleName()&&(e.queries[o].e&&"or"===e.queries[o].e.condition||e.queries[o].e&&"equal"===e.queries[o].e.operator)&&(i=!1),"onSkip"===e.queries[o].fn&&(n=!1),e.queries[o].fn;var r=0;if(e&&0<e.queries.length)for(o=0;o<e.queries.length;o++)"onTake"===e.queries[o].fn&&(r=t<=e.queries[o].e.nos?e.queries[o].e.nos:t);if(r<=0&&this.query&&0<this.query.queries.length)for(o=0;o<this.query.queries.length;o++)"onTake"===this.query.queries[o].fn&&(r=t<=this.query.queries[o].e.nos?this.query.queries[o].e.nos:t);if(e&&0<e.queries.length)for(o=0;o<e.queries.length;o++)"onTake"===e.queries[o].fn&&(r=e.queries[o].e.nos<=r?r:e.queries[o].e.nos,e.queries.splice(o,1),--o);return(this.allowFiltering&&n||!i||!this.allowFiltering&&n&&!this.isVirtualReorder)&&(i?e.skip(this.virtualItemStartIndex):e.skip(this.viewPortInfo.startIndex)),this.isIncrementalRequest?e.take(this.incrementalEndIndex):0<r?e.take(r):e.take(t),e.requiresCount(),this.customFilterQuery=null,e},jU.prototype.getTakeValue=function(){return this.allowFiltering&&F.isDevice?Math.round(window.outerHeight/this.listItemHeight):this.itemCount},jU.prototype.dataUpdater=function(e,t,i){this.isDataFetched=!1;var n,o,r,s,a=this.list.classList.contains(_z.noData);""===this.targetElement().trim()?(n=this.enableVirtualization?this.list.cloneNode(!0):this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,(this.backCommand||this.enableVirtualization&&"CheckBox"===this.mode&&this.value&&0<this.value.length)&&(o=this.remoteCustomValue=!1,this.allowCustomValue&&0===n.querySelectorAll("li").length&&0<this.mainData.length&&(this.mainData=[]),this.enableVirtualization&&(this.allowFiltering&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.value&&0<this.value.length&&"CheckBox"===this.mode?(this.notify("setCurrentViewDataAsync",{component:this.getModuleName(),module:"VirtualScroll"}),o=!0):(this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.resetList(e,i,t),"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.UpdateSkeleton(),!a&&!this.allowCustomValue||this.list.classList.contains(_z.noData)||(this.list.querySelector(".e-virtual-ddl-content")||((r=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(r).appendChild(this.list.querySelector(".e-list-parent"))),this.list.querySelector(".e-virtual-ddl"))||((s=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),document.getElementsByClassName("e-multi-select-list-wrapper")[0].querySelector(".e-dropdownbase").appendChild(s)))),this.onActionComplete(n,this.mainData),this.value&&this.value.length&&this.refreshSelection(),8!==this.keyCode&&this.focusAtFirstListItem(),o||this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}))):(this.enableVirtualization&&this.allowFiltering&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null,this.list.querySelector(".e-list-parent.e-reorder"))&&this.list.querySelector(".e-list-parent.e-reorder").remove(),this.resetList(e,i,t),this.enableVirtualization&&(a||this.allowCustomValue)&&!this.list.classList.contains(_z.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||((r=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(r).appendChild(this.list.querySelector(".e-list-parent"))),"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl")||((s=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),document.getElementsByClassName("e-multi-select-list-wrapper")[0].querySelector(".e-dropdownbase").appendChild(s))),this.allowCustomValue&&(e instanceof me?(this.remoteCustomValue=!0,this.tempQuery=t):this.checkForCustomValue(t,i))),this.enableVirtualization&&this.allowFiltering&&this.getFilteringSkeletonCount(),this.refreshPopup(),this.allowResize&&this.setResize(),"CheckBox"===this.mode&&this.removeFocus()},jU.prototype.checkForCustomValue=function(e,t){var i,n,o,r,s,a=!this.getValueByText(this.inputElement.value,this.ignoreCase),l=t||this.fields;this.allowCustomValue&&a?(r=this.inputElement.value,(s=!je(this.mainData)&&0<this.mainData.length?this.mainData[0]:this.mainData)&&"string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s?(i={},x(l.text,r,i),"number"==typeof R(this.fields.value||"value",s)&&this.fields.value!==this.fields.text?x(l.value,Math.random(),i):x(l.value,r,i),n={},this.allowObjectBinding&&(this.listData&&0<this.listData.length?Object.keys(this.listData[0]):this.firstItem?Object.keys(this.firstItem):Object.keys(i)).forEach(function(e){n[e]=e===t.value||e===t.text?R(t.value,i):null}),i=this.allowObjectBinding?n:i,this.enableVirtualization?(this.virtualCustomData=i,o=this.dataSource instanceof me?JSON.parse(JSON.stringify(this.listData)):JSON.parse(JSON.stringify(this.dataSource)),this.virtualCustomSelectData&&0<this.virtualCustomSelectData.length&&o.concat(this.virtualCustomSelectData),o.splice(0,0,i),this.isCustomDataUpdated=!0,r=this.totalItemCount,this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.resetList(o,l,e),this.isCustomDataUpdated=!1,this.totalItemCount=this.enableVirtualization&&this.dataSource instanceof me?r:this.totalItemCount):(this.dataSource instanceof me&&this.allowCustomValue&&this.allowFiltering&&(this.remoteCustomValue=!1),(o=JSON.parse(JSON.stringify(this.listData))).splice(0,0,i),this.resetList(o,l,e))):this.listData&&((o=JSON.parse(JSON.stringify(this.listData))).splice(0,0,this.inputElement.value),o[0]="number"!=typeof s||isNaN(parseFloat(o[0]))?o[0]:parseFloat(o[0]),o[0]="boolean"==typeof s?"true"===o[0]||"false"!==o[0]&&o[0]:o[0],this.resetList(o,l))):this.listData&&this.mainData&&!a&&this.allowCustomValue&&(this.allowFiltering&&this.isRemoteSelection&&this.remoteCustomValue?(this.isRemoteSelection=!1,this.enableVirtualization||this.resetList(this.listData,l,e)):!this.allowFiltering&&this.list&&(r=this.list.querySelectorAll("li."+_z.li+":not(.e-hide-listitem)"),s=H_(this.targetElement(),r,"StartsWith",this.ignoreCase))&&null!==s.item&&this.addListFocus(s.item)),this.value&&this.value.length&&this.refreshSelection()},jU.prototype.getNgDirective=function(){return"EJS-MULTISELECT"},jU.prototype.wrapperClick=function(e){if(this.setDynValue=!1,this.keyboardEvent=null,this.isKeyBoardAction=!1,this.enabled)if(e.target===this.overAllClear)e.preventDefault();else{if(this.inputFocus||this.inputElement.focus(),!this.readonly){if(e.target&&-1!==e.target.classList.toString().indexOf(EU))return void(this.isPopupOpen()&&this.refreshPopup());!this.isPopupOpen()&&(this.openOnClick||this.showDropDownIcon&&e.target&&e.target.className===OU)?this.showPopup(e):(this.hidePopup(e),"CheckBox"===this.mode&&(this.showOverAllClear(),this.inputFocus=!0,this.overAllWrapper.classList.contains(AU)||this.overAllWrapper.classList.add(AU)))}this.targetElement()&&""!==this.targetElement()||e.preventDefault()}},jU.prototype.enable=function(e){e?(this.overAllWrapper.classList.remove(xU),this.inputElement.removeAttribute("disabled"),pt(this.inputElement,{"aria-disabled":"false"}),this.ensureAriaDisabled("false")):(this.overAllWrapper.classList.add(xU),this.inputElement.setAttribute("disabled","true"),pt(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled("true")),this.enabled!==e&&(this.enabled=e),this.hidePopup()},jU.prototype.onBlurHandler=function(e,t){var i;this.isBlurDispatching&&this.isAngular?this.isBlurDispatching=!1:(je(e)||(i=e.relatedTarget),this.popupObj&&document.body.contains(this.popupObj.element)&&this.popupObj.element.contains(i)?"CheckBox"!==this.mode?this.inputElement.focus():"Auto"===this.floatLabelType&&(this.overAllWrapper.classList.contains("e-outline")||this.overAllWrapper.classList.contains("e-filled"))&&U([this.overAllWrapper],"e-valid-input"):("Auto"===this.floatLabelType&&this.overAllWrapper.classList.contains("e-outline")&&"CheckBox"===this.mode&&(je(this.value)||0===this.value.length)&&q([this.overAllWrapper],"e-valid-input"),"CheckBox"!==this.mode||!F.isIE||je(e)||t?this.scrollFocusStatus?(je(e)||e.preventDefault(),this.inputElement.focus(),this.scrollFocusStatus=!1):(this.inputFocus=!1,this.overAllWrapper.classList.remove(AU),this.addTagOnBlur&&(i=this.getValueByText(this.inputElement.value,this.ignoreCase,this.ignoreAccent),t=this.findListElement(this.list,"li","data-value",i),i=this.hideSelectedItem?IU:_z.selected,t)&&!t.classList.contains(i)&&(this.updateListSelection(t,e),"Delimiter"===this.mode)&&this.updateDelimeter(this.delimiterChar),this.updateDataList(),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.hidePopup(e),this.makeTextBoxEmpty(),this.trigger("blur"),this.focused=!0,F.isDevice&&"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.removeChipFocus(),this.removeChipSelection(),this.refreshInputHight(),bU(this.overAllWrapper,this.componentWrapper,this.value,this.floatLabelType,this.placeholder),this.refreshPlaceHolder(),(this.allowFiltering||!0===this.enableSelectionOrder&&"CheckBox"===this.mode)&&!je(this.mainList)&&(this.ulElement=this.mainList),this.checkPlaceholderSize(),HF.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),je(this.overAllWrapper)||je(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.isBlurDispatching=!0,this.isAngular&&this.dispatchEvent(this.inputElement,"blur")):(this.inputFocus=!1,this.overAllWrapper.classList.remove(AU))))},jU.prototype.calculateWidth=function(){var e;this.overAllWrapper&&(e=!this.showDropDownIcon||this.overAllWrapper.querySelector(".e-label-top")?this.overAllWrapper.clientWidth-2*parseInt(getComputedStyle(this.inputElement).paddingRight,10):(e=this.dropIcon.offsetWidth+parseInt(getComputedStyle(this.dropIcon).marginRight,10),this.overAllWrapper.clientWidth-(e+2*parseInt(getComputedStyle(this.inputElement).paddingRight,10))),"Never"!==this.floatLabelType)&&HF.calculateWidth(e,this.overAllWrapper,this.getModuleName())},jU.prototype.checkPlaceholderSize=function(){var e;this.showDropDownIcon?(e=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10),this.setPlaceholderSize(e)):je(this.dropIcon)||this.setPlaceholderSize(this.showDropDownIcon?this.dropIcon.offsetWidth:0)},jU.prototype.setPlaceholderSize=function(e){je(this.value)||0===this.value.length?0!==this.dropIcon.offsetWidth?this.searchWrapper.style.width="calc(100% - "+(e+10)+"px":U([this.searchWrapper],_U):je(this.value)||(this.searchWrapper.removeAttribute("style"),q([this.searchWrapper],_U))},jU.prototype.refreshInputHight=function(){je(this.searchWrapper)||(this.value&&this.value.length||!je(this.text)&&""!==this.text?this.searchWrapper.classList.add(kU):this.searchWrapper.classList.remove(kU))},jU.prototype.validateValues=function(e,t){return JSON.stringify(e.slice().sort())!==JSON.stringify(t.slice().sort())},jU.prototype.updateValueState=function(e,t,i){this.initStatus&&this.validateValues(t||[],i||[])&&(i={e:e,oldValue:(this.allowObjectBinding,i),value:(this.allowObjectBinding,t),isInteracted:!!e,element:this.element,event:e},this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",i),this.updateTempValue(),this.changeOnBlur||this.dispatchEvent(this.hiddenElement,"change")),this.selectedValueInfo=this.viewPortInfo},jU.prototype.updateTempValue=function(){this.value?this.tempValues=(this.allowObjectBinding,this.value.slice()):this.tempValues=this.value},jU.prototype.updateAriaActiveDescendant=function(){je(this.ulElement)||je(this.ulElement.getElementsByClassName("e-item-focus")[0])||pt(this.inputElement,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id})},jU.prototype.pageUpSelection=function(e,t){var i=this.list.querySelectorAll("li."+_z.li+":not(."+IU+"):not(.e-reorder-hide)"),n=0<=e?i[e+1]:i[0];if(this.fields.disabled&&n&&!this.enableVirtualization){for(;n&&(n.classList.contains("e-disabled")||n.classList.contains(IU)||n.classList.contains(".e-reorder-hide")||n.classList.contains("e-list-group-item"));)n=n.previousElementSibling;if(!n)return}!je(n=this.enableVirtualization&&t?this.liCollections.length>=e&&0<=e?this.liCollections[e]:this.liCollections[this.skeletonCount]:n)&&n.classList.contains("e-virtual-list")&&(n=this.liCollections[this.skeletonCount]),this.enableVirtualization?(je(n)||n.classList.contains("e-item-focus")?0===this.viewPortInfo.startIndex&&(this.isKeyBoardAction=!0,this.scrollTop(n,this.getIndexByValue(n.getAttribute("data-value")),this.keyboardEvent.keyCode)):(this.isKeyBoardAction=!0,this.addListFocus(n),this.scrollTop(n,this.getIndexByValue(n.getAttribute("data-value")),this.keyboardEvent.keyCode)),this.previousFocusItem=n):(this.isKeyBoardAction=!0,this.addListFocus(n),this.scrollTop(n,this.getIndexByValue(n.getAttribute("data-value")),this.keyboardEvent.keyCode))},jU.prototype.pageDownSelection=function(e,t){var i=this.getItems(),n=this.list.querySelectorAll("li."+_z.li+":not(."+IU+"):not(.e-reorder-hide)"),o=e<=n.length?n[e-1]:n[n.length-1];if(this.fields.disabled&&o&&!this.enableVirtualization){for(;o&&(o.classList.contains("e-disabled")||o.classList.contains(IU)||o.classList.contains(".e-reorder-hide")||o.classList.contains("e-list-group-item"));)o=o.nextElementSibling;if(!o)return}this.enableVirtualization&&0<this.skeletonCount&&(o=e<i.length?this.liCollections[e]:this.liCollections[i.length-1]),this.enableVirtualization&&t&&(o=e<=i.length?this.liCollections[e]:this.liCollections[i.length-1]),this.isKeyBoardAction=!0,this.addListFocus(o),this.previousFocusItem=o,this.scrollBottom(o,this.getIndexByValue(o.getAttribute("data-value")),!1,this.keyboardEvent.keyCode)},jU.prototype.getItems=function(){return this.list||SU.prototype.render.call(this),this.ulElement&&0<this.ulElement.querySelectorAll("."+_z.li).length?this.ulElement.querySelectorAll("."+_z.li+":not(."+IU+")"):[]},jU.prototype.focusInHandler=function(e){var t=this;return!!this.enabled&&(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(kU),this.checkPlaceholderSize(),this.focused&&(this.trigger("focus",{isInteracted:!!e,event:e}),this.focused=!1),this.overAllWrapper.classList.contains(AU)||this.overAllWrapper.classList.add(AU),vU(this.overAllWrapper,this.componentWrapper),this.isPopupOpen()&&this.refreshPopup(),this.allowResize&&this.setResize(),setTimeout(function(){t.calculateWidth()},150),!0)},jU.prototype.showDelimWrapper=function(){"CheckBox"===this.mode?this.viewWrapper.style.display="":this.delimiterWrapper.style.display="",this.componentWrapper.classList.add(MU)},jU.prototype.hideDelimWrapper=function(){this.delimiterWrapper.style.display="none",this.componentWrapper.classList.remove(MU)},jU.prototype.expandTextbox=function(){var e,t=5;this.placeholder&&(e=this.placeholder.charCodeAt(0),t=t>this.inputElement.placeholder.length?t:this.inputElement.placeholder.length*(44032<=e&&e<=55215?1.5:19968<=e&&e<=40959?2:1)),this.inputElement.value.length>t?this.inputElement.size=this.inputElement.value.length:this.inputElement.size=t},jU.prototype.isPopupOpen=function(){return null!==this.popupWrapper&&null!==this.popupWrapper.parentElement},jU.prototype.refreshPopup=function(){this.popupObj&&this.mobFilter&&(this.popupObj.setProperties({width:this.calcPopupWidth()}),this.popupObj.refreshPosition(this.overAllWrapper),this.popupObj.resolveCollision())},jU.prototype.checkTextLength=function(){return this.targetElement().length<1},jU.prototype.popupKeyActions=function(e){switch(e.keyCode){case 38:this.hidePopup(e),"CheckBox"===this.mode&&this.inputElement.focus(),e.preventDefault();break;case 40:this.isPopupOpen()||(this.showPopup(e),e.preventDefault())}},jU.prototype.updatePopupPosition=function(){this.refreshPopup()},jU.prototype.updateAriaAttribute=function(){var e,t=this.list.querySelector("."+_z.focus);je(t)||(this.inputElement.setAttribute("aria-activedescendant",t.id),this.allowFiltering?(e=this.popupWrapper.querySelector("."+HU))&&e.setAttribute("aria-activedescendant",t.id):"CheckBox"===this.mode&&this.overAllWrapper.setAttribute("aria-activedescendant",t.id))},jU.prototype.homeNavigation=function(e,t){this.removeFocus(),this.enableVirtualization&&(e?this.enableVirtualization&&0!==this.viewPortInfo.startIndex&&(this.viewPortInfo.startIndex=0,this.viewPortInfo.endIndex=this.itemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query)):this.enableVirtualization&&(!this.value&&this.viewPortInfo.endIndex!==this.totalItemCount||this.value&&0<this.value.length&&this.viewPortInfo.endIndex!==this.totalItemCount+this.value.length)&&(this.viewPortInfo.startIndex=this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.totalItemCount,this.updateVirtualItemIndex(),n=(new ya).clone(),this.value&&0<this.value.length&&(n=(n=this.getForQuery(this.value).clone()).skip(this.totalItemCount-this.itemCount)),this.resetList(this.dataSource,this.fields,n))),this.UpdateSkeleton();var i,n=this.ulElement.querySelectorAll("li."+_z.li+":not(."+IU+"):not(.e-reorder-hide)");0<n.length&&(i=n[e?0:n.length-1],this.enableVirtualization&&e&&(i=n[this.skeletonCount]),this.removeFocus(),i.classList.add(_z.focus),this.enableVirtualization&&e?this.scrollTop(i,void 0,this.keyboardEvent.keyCode):t||this.scrollBottom(i,void 0,!1,this.keyboardEvent.keyCode),this.updateAriaActiveDescendant())},jU.prototype.updateSelectionList=function(){if(!je(this.value)&&this.value.length)for(var e=0;e<this.value.length;e++){var t=this.allowObjectBinding?R(this.fields.value||"",this.value[e]):this.value[e],t=this.getElementByValue(t);t&&!t.classList.contains(_z.selected)&&t.classList.add("e-active")}},jU.prototype.handleVirtualKeyboardActions=function(e,t){var i,n=this.list.querySelector("."+_z.focus);switch(this.isKeyBoardAction=!0,e.keyCode){case 40:this.arrowDown(e,!0);break;case 38:this.arrowUp(e,!0);break;case 33:e.preventDefault(),n&&(i=this.getIndexByValue(this.previousFocusItem.getAttribute("data-value"))-1,this.pageUpSelection(i,!0),this.updateAriaAttribute());break;case 34:e.preventDefault(),n&&(i=this.getIndexByValue(this.previousFocusItem.getAttribute("data-value")),this.pageDownSelection(i,!0),this.updateAriaAttribute());break;case 35:case 36:this.isMouseScrollAction=!0,this.homeNavigation(36===e.keyCode,!0),this.isPreventScrollAction=!0}this.keyboardEvent=null,this.isScrollChanged=!0,this.isKeyBoardAction=!1},jU.prototype.onKeyDown=function(e){if(!this.readonly&&(this.enabled||"CheckBox"===this.mode)&&(this.preventSetCurrentData=!1,this.keyboardEvent=e,this.isPreventKeyAction&&this.enableVirtualization&&e.preventDefault(),this.keyCode=e.keyCode,this.keyDownStatus=!0,!(111<e.keyCode&&e.keyCode<124)))if(e.altKey)this.popupKeyActions(e);else{if(this.isPopupOpen()){var t=this.list.querySelector("."+_z.focus),i=void 0;switch(e.keyCode){case 36:case 35:this.isMouseScrollAction=!0,this.isKeyBoardAction=!0,this.homeNavigation(36===e.keyCode);break;case 33:return e.preventDefault(),void(t&&(i=this.getIndexByValue(t.getAttribute("data-value")),this.pageUpSelection(i-this.getPageCount()-1),this.updateAriaAttribute()));case 34:return e.preventDefault(),void(t&&(i=this.getIndexByValue(t.getAttribute("data-value")),this.pageDownSelection(i+this.getPageCount()),this.updateAriaAttribute()));case 38:this.isKeyBoardAction=!0,this.arrowUp(e);break;case 40:this.isKeyBoardAction=!0,this.arrowDown(e);break;case 27:return e.preventDefault(),this.isKeyBoardAction=!0,this.hidePopup(e),"CheckBox"===this.mode&&this.inputElement.focus(),void(this.isKeyBoardAction=!1);case 13:return e.preventDefault(),this.isKeyBoardAction=!0,"CheckBox"!==this.mode&&this.selectByKey(e),this.checkPlaceholderSize(),void(this.isKeyBoardAction=!1);case 32:return this.isKeyBoardAction=!0,this.spaceKeySelection(e),void(this.isKeyBoardAction=!1);case 9:e.preventDefault(),this.isKeyBoardAction=!0,this.hidePopup(e),this.inputElement.focus(),this.overAllWrapper.classList.add(AU)}}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.allowFiltering&&(this.previousFilterText=this.targetElement()),this.checkBackCommand(e)),this.expandTextbox(),"CheckBox"===this.mode&&this.showSelectAll||this.refreshPopup(),this.allowResize&&this.setResize(),this.isKeyBoardAction=!1}},jU.prototype.arrowDown=function(e,t){e.preventDefault(),this.moveByList(1,t),this.keyAction=!0,(document.activeElement.classList.contains(HU)||"CheckBox"===this.mode&&!this.allowFiltering&&document.activeElement!==this.list)&&E.add(this.list,"keydown",this.onKeyDown,this),this.updateAriaAttribute()},jU.prototype.arrowUp=function(e,t){e.preventDefault(),this.keyAction=!0;var e=this.list.querySelectorAll("li."+_z.li+":not(."+IU+"):not(.e-reorder-hide)"),i=(this.enableGroupCheckBox&&"CheckBox"===this.mode&&!je(this.fields.groupBy)&&(e=this.list.querySelectorAll("li."+_z.li+",li."+_z.group+":not(."+IU+"):not(.e-reorder-hide)")),this.list.querySelector("li."+_z.focus));this.focusFirstListItem=!je(this.liCollections[0])&&this.liCollections[0].classList.contains("e-item-focus"),Array.prototype.slice.call(e).indexOf(i)<=0&&"CheckBox"===this.mode&&this.allowFiltering&&(this.keyAction=!1,this.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"focus"})),this.moveByList(-1,t),this.updateAriaAttribute()},jU.prototype.spaceKeySelection=function(e){var t,i;"CheckBox"===this.mode&&(i=this.list.querySelector("li."+_z.focus),t=document.getElementsByClassName("e-selectall-parent")[0],(!je(i)||t&&t.classList.contains("e-item-focus"))&&(e.preventDefault(),this.keyAction=!0),this.selectByKey(e),this.keyAction)&&!je(i=this.list.querySelector("li."+_z.focus))&&t&&t.classList.contains("e-item-focus")&&i.classList.remove("e-item-focus"),this.checkPlaceholderSize()},jU.prototype.checkBackCommand=function(e){(8===e.keyCode&&this.allowFiltering?this.targetElement()!==this.previousFilterText:""===this.targetElement())?this.backCommand=!1:this.backCommand=!0},jU.prototype.keyNavigation=function(e){var t;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 8===e.keyCode&&"Delimiter"===this.mode&&this.value&&this.value.length&&(e.preventDefault(),t=this.allowObjectBinding?R(this.fields.value||"",this.value[this.value.length-1]):this.value[this.value.length-1],this.removeValue(this.value[this.value.length-1],e),this.updateDelimeter(this.delimiterChar,e),this.focusAtLastListItem(t))},jU.prototype.selectByKey=function(e){this.removeChipSelection(),this.selectListByKey(e),this.hideSelectedItem&&this.focusAtFirstListItem()},jU.prototype.escapeAction=function(){var e=this.tempValues?this.tempValues.slice():[];this.allowObjectBinding&&(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()},jU.prototype.scrollBottom=function(e,t,i,n,o){void 0===i&&(i=!1),void 0===n&&(n=null),void 0===o&&(o=!1);var r=(e=!je(e)&&e.classList.contains("e-virtual-list")||this.enableVirtualization&&je(e)?this.liCollections[this.skeletonCount]:e)&&!isNaN(parseInt(window.getComputedStyle(e).marginBottom,10))?parseInt(window.getComputedStyle(e).marginBottom,10):0,s=(this.isUpwardScrolling=!1,this.list.querySelectorAll(".e-virtual-list").length),a=this.list.querySelector("li:last-of-type")?this.list.querySelector("li:last-of-type").getAttribute("data-value"):null,l=this.virtualListInfo&&this.virtualListInfo.startIndex?e.offsetTop+this.virtualListInfo.startIndex*(e.offsetHeight+r):e.offsetTop,h=this.list.offsetHeight,d=l-s*(e.offsetHeight+r)+(e.offsetHeight+r)-this.list.scrollTop,p=this.list.scrollTop+d-h,c=!1,l=l-s*(e.offsetHeight+r)+(e.offsetHeight+r)-this.list.scrollTop,l=this.fields.groupBy&&!je(this.fixedHeaderElement)?l-this.fixedHeaderElement.offsetHeight:l;0!==t||this.enableVirtualization?(h<d||!(0<l&&this.list.offsetHeight>l))&&(s=e?e.getAttribute("data-value"):null,t=34===n?this.getPageCount()-1:1,!this.enableVirtualization||this.isKeyBoardAction||i?this.isKeyBoardAction&&this.enableVirtualization&&a&&s===a&&35!==n&&!this.isVirtualScrolling?(this.isPreventKeyAction=!0,this.list.scrollTop+=(e.offsetHeight+r)*t,this.isPreventKeyAction=!this.isScrollerAtEnd()&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&35===n?(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1,this.list.scrollTop=this.list.scrollHeight):(34===n&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=p):this.list.scrollTop=this.virtualListInfo&&this.virtualListInfo.startIndex?o&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex*this.listItemHeight+2*this.listItemHeight:this.virtualListInfo.startIndex*this.listItemHeight:0,c=this.isKeyBoardAction):this.list.scrollTop=0,this.isKeyBoardAction=c},jU.prototype.scrollTop=function(e,t,i){void 0===i&&(i=null);var n=this.list.querySelectorAll(".e-virtual-list").length,o=e&&!isNaN(parseInt(window.getComputedStyle(e).marginBottom,10))?parseInt(window.getComputedStyle(e).marginBottom,10):0,r=this.virtualListInfo&&this.virtualListInfo.startIndex?e.offsetTop+this.virtualListInfo.startIndex*(e.offsetHeight+o):e.offsetTop,s=r-n*(e.offsetHeight+o)-this.list.scrollTop,a=this.list.querySelector("li.e-list-item:not(.e-virtual-list)")?this.list.querySelector("li.e-list-item:not(.e-virtual-list)").getAttribute("data-value"):null,s=this.fields.groupBy&&!ee(this.fixedHeaderElement)?s-this.fixedHeaderElement.offsetHeight:s,r=r-n*(e.offsetHeight+o)+(e.offsetHeight+o)-this.list.scrollTop,n=this.enableVirtualization&&"autocomplete"===this.getModuleName()&&s<=0;0!==t||this.enableVirtualization?s<0||n?(t=e?e.getAttribute("data-value"):null,n=33===i?this.getPageCount()-2:1,this.enableVirtualization&&this.isKeyBoardAction&&a&&t===a&&36!==i&&!this.isVirtualScrolling?(this.isUpwardScrolling=!0,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTop-=(e.offsetHeight+o)*n,this.isPreventKeyAction=0!==this.list.scrollTop&&this.isPreventKeyAction,this.isPreventScrollAction=!1):this.enableVirtualization&&36===i?(this.isPreventScrollAction=!1,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTo(0,0)):(33===i&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=this.list.scrollTop+s)):0<r&&this.list.offsetHeight>r||(this.list.scrollTop=e.offsetTop-(this.fields.groupBy&&!je(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0)):this.list.scrollTop=0},jU.prototype.isScrollerAtEnd=function(){return this.list&&this.list.scrollTop+this.list.clientHeight>=this.list.scrollHeight},jU.prototype.selectListByKey=function(e){var t,i,n=this.list.querySelector("li."+_z.focus),o=this.value&&this.value.length?this.value.length:0,r=(null!==n&&(e.preventDefault(),n.classList.contains("e-active")&&(o-=1),this.isValidLI(n)&&o<this.maximumSelectionLength?(this.updateListSelection(n,e),this.addListFocus(n),"CheckBox"===this.mode?(this.updateDelimView(),this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight(),this.checkPlaceholderSize(),this.enableGroupCheckBox&&!je(this.fields.groupBy)&&(t=n.firstElementChild.lastElementChild,this.findGroupStart(t),this.deselectHeader())):this.updateDelimeter(this.delimiterChar,e),r=""!==this.targetElement().trim(),this.makeTextBoxEmpty(),"CheckBox"!==this.mode&&this.refreshListItems(n.textContent,r),this.changeOnBlur||this.updateValueState(e,this.value,this.tempValues),this.refreshPopup()):!this.isValidLI(n)&&o<this.maximumSelectionLength&&((t=n.firstElementChild.lastElementChild).classList.contains("e-check")?this.selectAllItem(!1,e,n):this.selectAllItem(!0,e,n)),this.refreshSelection(),this.closePopupOnSelect)&&this.hidePopup(e),document.getElementsByClassName("e-selectall-parent")[0]);r&&r.classList.contains("e-item-focus")&&((o=r.childNodes[0]).classList.contains("e-check")?(o.classList.remove("e-check"),i={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check",name:"checkSelectAll"},this.notify("checkSelectAll",i),this.selectAllItem(!1,e,n)):(o.classList.add("e-check"),i={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check",name:"checkSelectAll"},this.notify("checkSelectAll",i),this.selectAllItem(!0,e,n))),this.refreshPlaceHolder()},jU.prototype.refreshListItems=function(e,t){var i;(this.allowFiltering||"CheckBox"===this.mode&&!0===this.enableSelectionOrder||this.allowCustomValue)&&this.mainList&&this.listData?(i=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.enableVirtualization?this.allowCustomValue&&this.virtualCustomData&&null==e&&this.virtualCustomData&&this.viewPortInfo&&0===this.viewPortInfo.startIndex&&this.viewPortInfo.endIndex===this.itemCount?(this.virtualCustomData=null,this.renderItems(this.mainData,this.fields)):this.allowFiltering&&t?(this.updateInitialData(),this.onActionComplete(i,this.mainData),this.isVirtualTrackHeight=!1,this.list.getElementsByClassName("e-virtual-ddl")[0]?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():!this.list.querySelector(".e-virtual-ddl")&&0<this.skeletonCount&&((t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(t))):this.onActionComplete(this.list,this.listData):this.onActionComplete(i,this.mainData),this.focusAtLastListItem(e),this.value&&this.value.length&&this.refreshSelection()):!je(this.fields.groupBy)&&this.value&&this.value.length&&this.refreshSelection()},jU.prototype.removeSelectedChip=function(e){var t,i=this.chipCollectionWrapper.querySelector("span."+DU);null!==i&&(je(this.value)||(this.tempValues=(this.allowObjectBinding,this.value.slice())),null!==(t=i.nextElementSibling)&&(this.removeChipSelection(),this.addChipSelection(t,e)),t=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(i.getAttribute("data-value"))):i.getAttribute("data-value"),this.removeValue(t,e),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty()),this.closePopupOnSelect&&this.hidePopup(e),this.checkPlaceholderSize()},jU.prototype.moveByTop=function(e){var t=this.list.querySelectorAll("li."+_z.li);1<t.length&&(this.removeFocus(),e=e?0:t.length-1,this.addListFocus(t[e]),this.scrollBottom(t[e],e)),this.updateAriaAttribute()},jU.prototype.clickHandler=function(e){var e=e.target.className,t=document.getElementsByClassName("e-selectall-parent")[0];"e-input-filter e-input"!==e&&"e-input-group e-control-wrapper e-input-focus"!==e||!t.classList.contains("e-item-focus")||t.classList.remove("e-item-focus")},jU.prototype.moveByList=function(e,t){if(this.list){var i=this.list.querySelectorAll("li."+_z.li+":not(."+IU+"):not(.e-reorder-hide)"),n=("CheckBox"===this.mode&&this.enableGroupCheckBox&&!je(this.fields.groupBy)&&(i=this.list.querySelectorAll("li."+_z.li+",li."+_z.group+":not(."+IU+"):not(.e-reorder-hide)")),this.list.querySelector("li."+_z.focus)),o=(this.enableVirtualization&&t&&!je(this.currentFocuedListElement)&&(n=this.getElementByValue(this.getFormattedValue(this.currentFocuedListElement.getAttribute("data-value")))),-1),r=document.getElementsByClassName("e-selectall-parent")[0];if("CheckBox"===this.mode&&this.showSelectAll&&1===e&&!je(r)&&!r.classList.contains("e-item-focus")&&0===this.list.getElementsByClassName("e-item-focus").length&&1<this.liCollections.length)!this.focusFirstListItem&&r.classList.contains("e-item-focus")?r.classList.remove("e-item-focus"):r.classList.contains("e-item-focus")||r.classList.add("e-item-focus");else if(i.length){"CheckBox"===this.mode&&this.showSelectAll&&!je(r&&-1===e)&&(!this.focusFirstListItem&&r.classList.contains("e-item-focus")?r.classList.remove("e-item-focus"):this.focusFirstListItem&&!r.classList.contains("e-item-focus")&&r.classList.add("e-item-focus"));for(var s,a=0;a<i.length;a++)if(i[a]===n){o=a;break}0<e?o<i.length-1&&(this.removeFocus(),this.enableVirtualization&&t?this.addListFocus(i[o]):this.enableVirtualization&&i[o+1].classList.contains("e-virtual-list")?this.addListFocus(i[this.skeletonCount]):this.addListFocus(i[++o]),-1<o)&&(this.updateCheck(i[o]),this.scrollBottom(i[o],o),this.currentFocuedListElement=i[o]):0<o&&(this.enableVirtualization?(r=i[o-1].classList.contains("e-virtual-list"),s=t?o:o-1,!t&&r||this.removeFocus(),!t&&r||(this.addListFocus(i[s]),this.updateCheck(i[s]),this.scrollTop(i[s],o),this.currentFocuedListElement=i[s])):(this.removeFocus(),this.addListFocus(i[--o]),this.updateCheck(i[o]),this.scrollTop(i[o],o)))}}t=this.list?this.list.querySelector(".e-item-focus"):null;this.isDisabledElement(t)&&(0===this.list.querySelectorAll(".e-list-item:not(.e-hide-listitem):not(.e-disabled)").length||38===this.keyCode&&"CheckBox"===this.mode&&this.enableGroupCheckBox&&!je(this.fields.groupBy)&&t===this.list.querySelector("li.e-list-group-item")?this.removeFocus():(0===(a=this.getIndexByValue(t.getAttribute("data-value")))&&(e=1),a===this.list.querySelectorAll(".e-list-item:not(.e-hide-listitem)").length-1&&(e=-1),this.moveByList(e)))},jU.prototype.getElementByValue=function(e){for(var t,i=0,n=this.getItems();i<n.length;i++){var o=n[i];if(this.getFormattedValue(o.getAttribute("data-value"))===e){t=o;break}}return t},jU.prototype.updateCheck=function(e){"CheckBox"===this.mode&&this.enableGroupCheckBox&&!je(this.fields.groupBy)&&(e.firstElementChild.lastElementChild.classList.contains("e-check")?e.classList.add("e-active"):e.classList.remove("e-active"))},jU.prototype.moveBy=function(e,t){var i,n=this.chipCollectionWrapper.querySelectorAll("span."+TU),o=this.chipCollectionWrapper.querySelector("span."+DU);null===o?e<0&&this.addChipSelection(n[n.length-1],t):e<0?null!==(i=o.previousElementSibling)&&(this.removeChipSelection(),this.addChipSelection(i,t)):(i=o.nextElementSibling,this.removeChipSelection(),null!==i&&this.addChipSelection(i,t))},jU.prototype.chipClick=function(e){var t;this.enabled&&(t=z(e.target,"."+TU),this.removeChipSelection(),this.addChipSelection(t,e))},jU.prototype.removeChipSelection=function(){this.chipCollectionWrapper&&this.removeChipFocus()},jU.prototype.addChipSelection=function(e,t){U([e],DU),this.trigger("chipSelection",t)},jU.prototype.onChipRemove=function(e){var t,i;3!==e.which&&2!==e.button&&this.enabled&&!this.readonly&&(i=e.target.parentElement.getAttribute("data-value"),t=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(i)):this.getFormattedValue(i),this.allowCustomValue&&("false"!==i&&!1===t||!je(t)&&"NaN"===t.toString())&&(t=i),this.isPopupOpen()&&"CheckBox"!==this.mode&&this.hidePopup(e),this.inputFocus||this.inputElement.focus(),this.removeValue(t,e),t=this.allowObjectBinding?R(this.fields.value||"",t):t,je(this.findListElement(this.list,"li","data-value",t))&&this.mainList&&this.listData&&(i=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.onActionComplete(i,this.mainData)),this.updateDelimeter(this.delimiterChar,e),this.placeholder&&"Never"===this.floatLabelType?(this.makeTextBoxEmpty(),this.checkPlaceholderSize()):this.inputElement.value="",e.preventDefault())},jU.prototype.makeTextBoxEmpty=function(){this.inputElement.value="",this.refreshPlaceHolder()},jU.prototype.refreshPlaceHolder=function(){this.placeholder&&"Never"===this.floatLabelType?this.value&&this.value.length||!je(this.text)&&""!==this.text?this.inputElement.placeholder="":this.inputElement.placeholder=wU(this.placeholder):this.setFloatLabelType(),this.expandTextbox()},jU.prototype.removeAllItems=function(e,t,i,n,o){var r=this.allowObjectBinding?this.indexOfObjectInArray(e,this.value):this.value.indexOf(e),s=this.value.slice(0),s=(s.splice(r,1),this.setProperties({value:[].concat([],s)},!0),n.setAttribute("aria-selected","false"),this.hideSelectedItem?IU:_z.selected),s=(q([n],s),this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:n,e:this,index:r}),this.invokeCheckboxSelection(n,t,i),this.allowObjectBinding?R(this.fields.value||"",e):e);this.updateMainList(!0,s,o),this.updateChipStatus()},jU.prototype.invokeCheckboxSelection=function(e,t,i){this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:t}),this.updateAriaActiveDescendant(),this.value&&this.value.length!==this.mainData.length&&"CheckBox"===this.mode&&this.showSelectAll&&!this.isSelectAll&&!i&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"})},jU.prototype.removeValue=function(i,n,o,r){var s,a,l=this,h=this.allowObjectBinding?this.indexOfObjectInArray(i,this.value):this.value.indexOf(this.getFormattedValue(i)),e=(-1===h&&this.allowCustomValue&&!je(i)&&(h=this.allowObjectBinding?this.indexOfObjectInArray(i,this.value):this.value.indexOf(i.toString())),n&&n.target),d=(r=!!(r||e&&e.classList.contains("e-close-hooker"))||null,this.hideSelectedItem?IU:_z.selected);-1!==h&&(e=this.allowObjectBinding?R(this.fields.value||"",i):i,s=this.virtualSelectAll?null:this.findListElement(this.list,"li","data-value",e),a=this.allowObjectBinding?i:this.getDataByValue(i),this.trigger("removing",{e:n,item:s,itemData:a,isInteracted:!!n,cancel:!1},function(e){var t;e.cancel?l.removeIndex++:(l.isRemoveSelection=!!l.enableVirtualization||l.isRemoveSelection,l.currentRemoveValue=l.allowObjectBinding?R(l.fields.value||"",i):i,l.virtualSelectAll=!1,(t=l.value.slice(0)).splice(h,1),l.enableVirtualization&&"CheckBox"===l.mode&&l.selectedListData.splice(h,1),l.setProperties({value:[].concat([],t)},!0),l.enableVirtualization&&(t=0===h&&l.text.split(l.delimiterChar)&&1===l.text.split(l.delimiterChar).length?l.text.replace(l.text.split(l.delimiterChar)[h],""):0===h?l.text.replace(l.text.split(l.delimiterChar)[h]+l.delimiterChar,""):l.text.replace(l.delimiterChar+l.text.split(l.delimiterChar)[h],""),l.setProperties({text:t.toString()},!0)),null!==s&&(t=l.allowObjectBinding?R(l.fields.value||"",i):i,t=l.findListElement(l.mainList,"li","data-value",t),s.setAttribute("aria-selected","false"),q([s],d),t&&(t.setAttribute("aria-selected","false"),q([s,t],d)),l.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===l.mode,li:s,e:l,index:h}),l.invokeCheckboxSelection(s,n,r)),t=l.allowObjectBinding?R(l.fields.value||"",i):i,l.hideSelectedItem&&l.fields.groupBy&&s&&l.hideGroupItem(t),l.hideSelectedItem&&l.fixedHeaderElement&&l.fields.groupBy&&"CheckBox"!==l.mode&&l.isPopupOpen()&&SU.prototype.scrollStop.call(l),l.updateMainList(!0,t),l.removeChip(t,r),l.updateChipStatus(),(l.value&&l.value.length?l.value.length:0)<l.maximumSelectionLength&&q(l.list.querySelectorAll("li."+_z.li+":not(.e-active)"),"e-disable"),l.trigger("removed",e),e=!(!(t=n&&n.currentTarget)||!t.classList.contains("e-selectall-parent"))||null,!l.changeOnBlur&&!r&&n&&o&&!e&&l.isSelectAllTarget&&l.updateValueState(n,l.value,l.tempValues),o&&(l.selectAllEventData.push(a),l.selectAllEventEle.push(s)),1===o&&(l.changeOnBlur||l.updateValueState(n,l.value,l.tempValues),t={event:n,items:l.selectAllEventEle,itemData:l.selectAllEventData,isInteracted:!!n,isChecked:!1},l.trigger("selectedAll",t),l.selectAllEventData=[],l.selectAllEventEle=[]),!r||1!==o&&null!==o||l.clearAllCallback(n,r),l.isPopupOpen()&&s&&s.parentElement.classList.contains("e-reorder")&&(l.hideSelectedItem&&l.value&&Array.isArray(l.value)&&0<l.value.length&&l.totalItemsCount(),l.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})))}))},jU.prototype.updateMainList=function(e,t,i){(this.allowFiltering||"CheckBox"===this.mode)&&(i=i||this.findListElement(this.mainList,"li","data-value",t))&&(e?(i.setAttribute("aria-selected","false"),q([i],this.hideSelectedItem?IU:_z.selected),"CheckBox"===this.mode&&q([i.firstElementChild.lastElementChild],"e-check")):(i.setAttribute("aria-selected","true"),U([i],this.hideSelectedItem?IU:_z.selected),"CheckBox"===this.mode&&U([i.firstElementChild.lastElementChild],"e-check")))},jU.prototype.removeChip=function(e,t){!this.chipCollectionWrapper||this.enableVirtualization&&t||(t=this.findListElement(this.chipCollectionWrapper,"span","data-value",e))&&ue(t)},jU.prototype.setWidth=function(e){je(e)||("number"==typeof e?this.overAllWrapper.style.width=T(e):"string"==typeof e&&(this.overAllWrapper.style.width=e.match(/px|%|em/)?e:T(e)))},jU.prototype.updateChipStatus=function(){this.value&&this.value.length?(je(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display=""),"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper(),this.showOverAllClear()):(je(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display="none"),je(this.delimiterWrapper)||(this.delimiterWrapper.style.display="none"),this.hideOverAllClear())},jU.prototype.indexOfObjectInArray=function(i,n){for(var e=0;e<n.length;e++){var t=function(e){var t=n[e];if(Object.keys(i).every(function(e){return t.hasOwnProperty(e)&&t[e]===i[e]}))return{value:e}}(e);if("object"==typeof t)return t.value}return-1},jU.prototype.addValue=function(e,t,i){this.value||(this.value=[]);var n=this.allowObjectBinding?this.getDataByValue(e):e,o=((this.allowObjectBinding&&!this.isObjectInArray(this.getDataByValue(e),this.value)||!this.allowObjectBinding&&this.value.indexOf(n)<0)&&(this.setProperties({value:[].concat([],this.value,[n])},!0),this.enableVirtualization&&!this.isSelectAllLoop&&(n=this.viewWrapper.innerHTML,o=void 0,n=(n+=1===this.value.length?"":this.delimiterChar+" ")+(o=this.getOverflowVal(this.value.length-1)),o=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,n)),this.enableVirtualization)&&"CheckBox"===this.mode&&(n=[],this.allowObjectBinding?R(this.fields.value||"",this.value[this.value.length-1]):this.value[this.value.length-1],o=t,o=null!=this.text&&""!==this.text?this.text+this.delimiterChar+o:o,n.push(o),this.setProperties({text:n.toString()},!0)),this.findListElement(this.list,"li","data-value",e));this.removeFocus(),o&&(this.addListFocus(o),this.addListSelection(o)),"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.addChip(t,e,i),this.hideSelectedItem&&this.fields.groupBy&&this.hideGroupItem(e),this.updateChipStatus(),this.checkMaxSelection()},jU.prototype.checkMaxSelection=function(){var e=this.value&&this.value.length?this.value.length:0;e===this.maximumSelectionLength&&(q(this.list.querySelectorAll("li."+_z.li+".e-active"),"e-disable"),U(this.list.querySelectorAll("li."+_z.li+":not(.e-active)"),"e-disable")),e<this.maximumSelectionLength&&q(this.list.querySelectorAll("li."+_z.li),"e-disable")},jU.prototype.dispatchSelect=function(t,i,n,e,o,r,s){var a,l=this,h=this.listData;this.initStatus&&!e&&(t=this.allowObjectBinding?R(this.fields.value||"",t):t,a=r||this.getDataByValue(t),this.trigger("select",{e:i,item:n,itemData:a,isInteracted:!!i,cancel:!1},function(e){e.cancel||(o&&(l.selectAllEventData.push(a),l.selectAllEventEle.push(n)),1===o&&(e={event:i,items:l.selectAllEventEle,itemData:l.selectAllEventData,isInteracted:!!i,isChecked:!0},l.trigger("selectedAll",e),l.selectAllEventData=[]),l.allowCustomValue&&l.isServerRendered&&l.listData!==h&&(l.listData=h),t=l.allowObjectBinding?l.getDataByValue(t):t,l.enableVirtualization&&(je(l.selectedListData)?l.selectedListData=[l.getDataByValue(t)]:r?Array.isArray(l.selectedListData)?l.selectedListData.push(r):l.selectedListData=[l.selectedListData,r]:Array.isArray(l.selectedListData)?l.selectedListData.push(l.getDataByValue(t)):l.selectedListData=[l.selectedListData,l.getDataByValue(t)]),(l.enableVirtualization&&t||!l.enableVirtualization)&&l.updateListSelectEventCallback(t,n,i,s),l.hideSelectedItem&&l.fixedHeaderElement&&l.fields.groupBy&&"CheckBox"!==l.mode&&SU.prototype.scrollStop.call(l))}))},jU.prototype.addChip=function(e,t,i){this.chipCollectionWrapper&&this.getChip(e,t,i)},jU.prototype.removeChipFocus=function(){if(q(this.chipCollectionWrapper.querySelectorAll("span."+TU+"."+DU),DU),F.isDevice)for(var e=this.chipCollectionWrapper.querySelectorAll("span."+EU.split(" ")[0]),t=0;t<e.length;t++)e[t].style.display="none"},jU.prototype.onMobileChipInteraction=function(e){var t=z(e.target,"."+TU),i=t.querySelector("span."+EU.split(" ")[0]);this.enabled&&!this.readonly&&(t.classList.contains(DU)||(this.removeChipFocus(),i.style.display="",t.classList.add(DU)),this.refreshPopup(),e.preventDefault())},jU.prototype.multiCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!ct(e,document).length}catch(e){t=!1}return t},jU.prototype.encodeHtmlEntities=function(e){return e.replace(/[\u00A0-\u9999<>&]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},jU.prototype.getChip=function(e,t,i){var n=this,o={text:t,value:t},r=this.createElement("span",{className:TU,attrs:{"data-value":t,title:e}}),s=this.createElement("span",{className:"e-chipcontent"}),a=this.createElement("span",{className:EU}),t=(this.mainData&&(o=this.getDataByValue(t)),this.valueTemplate&&!je(o)?(t=this.multiCompiler(this.valueTemplate),(t=("function"!=typeof this.valueTemplate&&t?oo(ge(this.valueTemplate,document).innerHTML.trim()):oo(this.valueTemplate))(o,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,s))&&0<t.length&&ht(t,s),this.renderReactTemplates()):this.enableHtmlSanitizer?s.innerText=e:s.innerHTML=this.encodeHtmlEntities(e.toString()),r.appendChild(s),{isInteracted:!!i,itemData:o,e:i,setClass:function(e){U([r],e)},cancel:!1});this.isPreventChange=this.isAngular&&this.preventChange,this.trigger("tagging",t,function(e){e.cancel||(F.isDevice?(r.classList.add("e-mob-chip"),ht([a],r),a.style.display="none",E.add(r,"click",n.onMobileChipInteraction,n)):(E.add(r,"mousedown",n.chipClick,n),n.showClearButton&&r.appendChild(a)),E.add(a,"mousedown",n.onChipRemove,n),n.chipCollectionWrapper.appendChild(r),!n.changeOnBlur&&i&&n.updateValueState(i,n.value,n.tempValues))})},jU.prototype.calcPopupWidth=function(){var e=T(this.popupWidth);return e=-1<e.indexOf("%")?(this.componentWrapper.offsetWidth*parseFloat(e)/100).toString()+"px":e},jU.prototype.mouseIn=function(){this.enabled&&!this.readonly&&this.showOverAllClear()},jU.prototype.mouseOut=function(){this.inputFocus||(this.overAllClear.style.display="none")},jU.prototype.listOption=function(e,t){var i=!je(t.iconCss),n=je(t.properties)?t:t.properties;return this.listCurrentOptions=null!==t.text||null!==t.value?{fields:n,showIcon:i,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}},Pe(this.listCurrentOptions,this.listCurrentOptions,t,!0),"CheckBox"===this.mode&&this.notify("listoption",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,dataSource:e,fieldProperty:n}),this.listCurrentOptions},jU.prototype.renderPopup=function(){var e,t,i=this;this.list||SU.prototype.render.call(this),this.popupObj&&document.body.contains(this.popupObj.element)&&this.allowFiltering?this.refreshPopup():this.popupObj||je(this.popupWrapper)||(document.body.appendChild(this.popupWrapper),e=this.popupWrapper.querySelector(".e-filter-parent"),"CheckBox"===this.mode&&!this.allowFiltering&&e&&this.filterParent&&(e.remove(),this.filterParent=null),e=parseInt(this.popupHeight,10),this.popupWrapper.style.visibility="hidden",this.headerTemplate&&(this.setHeaderTemplate(),e-=this.header.offsetHeight,this.isUpdateHeaderHeight=0!==this.header.offsetHeight),ht([this.list],this.popupWrapper),!this.list.classList.contains(_z.noData)&&this.getItems()[1]&&(this.listItemHeight=this.getItems()[1].offsetHeight+parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)),this.enableVirtualization&&!this.list.classList.contains(_z.noData)&&(!this.list.querySelector(".e-virtual-ddl-content")&&this.list.querySelector(".e-list-parent")?((t=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(t).appendChild(this.list.querySelector(".e-list-parent"))):this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+_z.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&this.totalItemsCount(),this.list.querySelector(".e-virtual-ddl")?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():((t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(t))),this.footerTemplate&&(this.setFooterTemplate(),e-=this.footer.offsetHeight,this.isUpdateFooterHeight=0!==this.footer.offsetHeight),"CheckBox"===this.mode&&this.showSelectAll?(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),e-=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}),e=parseInt(this.popupHeight,10),this.headerTemplate&&this.header&&(e-=this.header.offsetHeight),this.footerTemplate&&this.footer&&(e-=this.footer.offsetHeight)):(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),e=parseInt(this.popupHeight,10)),"CheckBox"===this.mode&&(t={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,popupElement:this.popupWrapper},this.allowFiltering&&(this.notify("searchBox",t),e-=this.searchBoxHeight),U([this.popupWrapper],"e-checkbox")),"auto"!==this.popupHeight?(this.list.style.maxHeight=T(e),this.popupWrapper.style.maxHeight=T(this.popupHeight)):this.list.style.maxHeight=T(this.popupHeight),this.popupObj=new Sv(this.popupWrapper,{width:this.calcPopupWidth(),targetType:"relative",position:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},relateTo:this.overAllWrapper,collision:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},offsetY:1,enableRtl:this.enableRtl,zIndex:this.zIndex,close:function(){var e;i.popupObj.element.parentElement&&(i.popupObj.unwireScrollEvents(),e=i.popupWrapper.querySelector("."+HU),"CheckBox"===i.mode&&e&&document.activeElement===e&&e.blur(),G(i.popupObj.element))},open:function(){var e;i.popupObj.resolveCollision(),i.isFirstClick||(!(e=i.list.querySelector("ul"))||"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.enableVirtualization||(i.loadTemplate(),i.enableVirtualization&&"CheckBox"===i.mode&&i.UpdateSkeleton()),i.isPreventScrollAction=!0,i.setScrollPosition(),!i.list.classList.contains(_z.noData)&&i.getItems()[1]&&0!==i.getItems()[1].offsetHeight&&(i.listItemHeight=i.getItems()[1].offsetHeight+parseInt(window.getComputedStyle(i.getItems()[1]).marginBottom,10),i.list.getElementsByClassName("e-virtual-ddl-content")[0])&&(i.list.getElementsByClassName("e-virtual-ddl-content")[0].style=i.getTransformValues()),i.allowFiltering&&i.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode,value:"focus"}),i.enableVirtualization&&(i.notify("bindScrollEvent",{module:"VirtualScroll",component:i.getModuleName(),enable:i.enableVirtualization}),setTimeout(function(){i.value?i.updateSelectionList():i.viewPortInfo&&i.viewPortInfo.offsets.top&&(i.list.scrollTop=i.viewPortInfo.offsets.top)},5))},targetExitViewport:function(){F.isDevice||i.hidePopup()}}),this.checkCollision(this.popupWrapper),this.popupContentElement=this.popupObj.element.querySelector(".e-content"),"CheckBox"===this.mode&&F.isDevice&&this.allowFiltering&&this.isDeviceFullScreen&&this.notify("deviceSearchBox",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.allowResize&&this.setResize(),this.popupObj.close(),this.popupWrapper.style.visibility="")},jU.prototype.checkCollision=function(e){"CheckBox"===this.mode&&F.isDevice&&this.allowFiltering&&this.isDeviceFullScreen||(0<Y0(e).length&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},jU.prototype.setHeaderTemplate=function(){this.header&&this.header.remove(),this.header=this.createElement("div"),U([this.header],"e-ddl-header");var e=this.multiCompiler(this.headerTemplate),e="function"!=typeof this.headerTemplate&&e?oo(ge(this.headerTemplate,document).innerHTML.trim()):oo(this.headerTemplate),e=e({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);e&&0<e.length&&ht(e,this.header),("CheckBox"===this.mode&&this.showSelectAll?lt:ht)([this.header],this.popupWrapper),E.add(this.header,"mousedown",this.onListMouseDown,this)},jU.prototype.setFooterTemplate=function(){this.footer&&this.footer.remove(),this.footer=this.createElement("div"),U([this.footer],"e-ddl-footer");var e=this.multiCompiler(this.footerTemplate),e="function"!=typeof this.footerTemplate&&e?oo(ge(this.footerTemplate,document).innerHTML.trim()):oo(this.footerTemplate),e=e({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);e&&0<e.length&&ht(e,this.footer),ht([this.footer],this.popupWrapper),E.add(this.footer,"mousedown",this.onListMouseDown,this)},jU.prototype.updateInitialData=function(){var e,t=this.selectData;this.renderItems(t,this.fields);this.list.scrollTop=0,this.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.previousStartIndex=0,this.previousEndIndex=this.itemCount,this.dataSource instanceof me?0<=this.remoteDataCount?this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.getSkeletonCount(),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof me)||this.dataSource instanceof me&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.UpdateSkeleton(),this.list.getElementsByClassName("e-virtual-ddl")[0]?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():!this.list.querySelector(".e-virtual-ddl")&&0<this.skeletonCount&&((e=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(e)),this.listData=t,this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.enableVirtualization&&this.notify("setGeneratedData",{module:"VirtualScroll"})},jU.prototype.clearAll=function(e){if(this.enabled&&!this.readonly){var t=void 0;if(this.setDynValue=!1,this.isClearAllAction=!0,this.value&&0<this.value.length){this.allowFiltering&&(this.refreshListItems(null),"CheckBox"===this.mode)&&this.targetInputElement&&(this.targetInputElement.value="");var i=this.list&&this.list.querySelectorAll("li.e-list-item");if(i&&0<i.length)this.selectAllItems(!1,e);else for(this.removeIndex=0,t=this.value[this.removeIndex];this.removeIndex<this.value.length;t=this.value[this.removeIndex])this.removeValue(t,e,null,!0);this.selectedElementID=null,this.inputElement.removeAttribute("aria-activedescendant")}else this.clearAllCallback(e);this.checkAndResetCache(),HF.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),je(this.overAllWrapper)||je(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.enableVirtualization&&(this.updateInitialData(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.isCustomDataUpdated||this.notify("setGeneratedData",{module:"VirtualScroll"})),this.enableVirtualization&&(this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=this.itemCount),this.isClearAllAction=!1}this.isClearAllItem=!0,E.add(document,"mouseup",this.preventSelection,this)},jU.prototype.preventSelection=function(e){this.isClearAllItem&&e.stopPropagation(),this.isClearAllItem=!1,E.remove(document,"mouseup",this.preventSelection)},jU.prototype.clearAllCallback=function(e,t){var i,n=this.value?this.value.slice():[];this.mainList&&this.listData&&(this.allowFiltering&&"CheckBox"!==this.mode||this.allowCustomValue)&&(i=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.onActionComplete(i,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.allowResize&&this.setResize(),this.inputFocus||(this.changeOnBlur&&this.updateValueState(e,this.value,n),"CheckBox"!==this.mode&&this.inputElement.focus()),"CheckBox"===this.mode&&(this.refreshPlaceHolder(),this.refreshInputHight(),this.changeOnBlur)&&t&&(je(this.value)||0===this.value.length)&&this.updateValueState(e,this.value,this.tempValues),this.changeOnBlur||!t||!je(this.value)&&0!==this.value.length||this.updateValueState(e,this.value,this.tempValues),"CheckBox"===this.mode&&this.enableGroupCheckBox&&!je(this.fields.groupBy)&&this.updateListItems(this.list.querySelectorAll("li.e-list-item"),this.mainList.querySelectorAll("li.e-list-item")),e.preventDefault()},jU.prototype.windowResize=function(){this.refreshPopup(),this.inputFocus&&"CheckBox"!==this.mode||!this.viewWrapper||!this.viewWrapper.parentElement||this.updateDelimView()},jU.prototype.resetValueHandler=function(e){var t;je(this.inputElement)||(t=z(this.inputElement,"form"))&&e.target===t&&(e=this.element.tagName===this.getNgDirective()?null:this.element.getAttribute("data-initial-value"),this.text=e)},jU.prototype.wireEvent=function(){E.add(this.componentWrapper,"mousedown",this.wrapperClick,this),E.add(window,"resize",this.windowResize,this),E.add(this.inputElement,"focus",this.focusInHandler,this),E.add(this.inputElement,"keydown",this.onKeyDown,this),E.add(this.inputElement,"keyup",this.keyUp,this),"CheckBox"!==this.mode&&E.add(this.inputElement,"input",this.onInput,this),E.add(this.inputElement,"blur",this.onBlurHandler,this),E.add(this.componentWrapper,"mouseover",this.mouseIn,this);var e=z(this.inputElement,"form");e&&E.add(e,"reset",this.resetValueHandler,this),E.add(this.componentWrapper,"mouseout",this.mouseOut,this),E.add(this.overAllClear,"mousedown",this.clearAll,this),E.add(this.inputElement,"paste",this.pasteHandler,this)},jU.prototype.onInput=function(e){this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,F.isDevice&&"mozilla"===F.info.name&&this.search(e)},jU.prototype.pasteHandler=function(e){var t=this;setTimeout(function(){t.expandTextbox(),t.search(e)})},jU.prototype.search=function(e){var n=this;if(this.preventSetCurrentData=!1,this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,je(e)||(this.keyCode=e.keyCode),!this.isPopupOpen()&&this.openOnClick&&this.showPopup(e),this.openClick(e),!this.checkTextLength()||this.allowFiltering||je(e)||8===e.keyCode){var t=this.targetElement();if(this.allowFiltering){this.allowCustomValue&&(this.isRemoteSelection=!0),this.checkAndResetCache();var o={preventDefaultAction:this.isRequesting=!1,text:this.targetElement(),updateData:function(e,t,i){o.cancel||(n.isFiltered=!0,n.customFilterQuery=t,n.remoteFilterAction=!0,n.isCustomFiltering=!0,n.dataUpdater(e,t,i))},event:e,cancel:!1};this.trigger("filtering",o,function(e){n.isFilterPrevented=e.cancel,e.cancel||n.isFiltered||e.preventDefaultAction||(n.filterAction=!0,n.isFilteringAction=!0,n.dataSource instanceof me&&n.allowCustomValue&&(n.isCustomRendered=!1),n.dataUpdater(n.dataSource,null,n.fields),n.isFilteringAction=!1)})}else if(this.allowCustomValue){e=new ya,e=this.allowFiltering&&""!==t?e.where(this.fields.text,"startswith",t,this.ignoreCase,this.ignoreAccent):e;this.enableVirtualization?this.dataUpdater(this.dataSource,e,this.fields):this.dataUpdater(this.mainData,e,this.fields),this.UpdateSkeleton()}else{var t=this.list.querySelectorAll("li."+_z.li+":not(.e-hide-listitem)"),i=this.typeOfData(this.listData).typeof,r=H_(this.targetElement(),t,"StartsWith",this.ignoreCase);if(this.enableVirtualization&&""!==this.targetElement().trim()&&!this.allowFiltering){var s,a,l=!1;for((this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount||0===this.incrementalEndIndex)&&(l=!0,this.incrementalStartIndex=0,this.incrementalEndIndex=this.totalItemCount<100?this.totalItemCount:100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),l=!1),0===this.viewPortInfo.startIndex&&!l||this.updateIncrementalView(0,this.itemCount),r=H_(this.targetElement(),this.incrementalLiCollections,this.filterType,!0,this.listData,this.fields,i);je(r)&&this.incrementalEndIndex<this.totalItemCount&&(this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),l=!0,0===this.viewPortInfo.startIndex&&!l||this.updateIncrementalView(0,this.itemCount),je(r=H_(this.targetElement(),this.incrementalLiCollections,this.filterType,!0,this.listData,this.fields,i)));)if(je(r)&&this.incrementalEndIndex>=this.totalItemCount){this.incrementalStartIndex=0,this.incrementalEndIndex=this.totalItemCount<100?this.totalItemCount:100;break}!r.index||this.viewPortInfo.startIndex>=r.index&&r.index>=this.viewPortInfo.endIndex||(a=(s=0<r.index-(this.itemCount/2-2)?r.index-(this.itemCount/2-2):0)+this.itemCount>this.totalItemCount?this.totalItemCount:s+this.itemCount,s!==this.viewPortInfo.startIndex&&this.updateIncrementalView(s,a)),je(r.item)?(this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0):(this.getIndexByValue(r.item.getAttribute("data-value"))-this.skeletonCount>this.itemCount/2&&(s=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,a=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount,this.updateIncrementalView(s,a)),r.item=this.getElementByValue(r.item.getAttribute("data-value"))),r&&r.item&&(r.item=this.getElementByValue(r.item.getAttribute("data-value")))}r&&r.item?(this.addListFocus(r.item),this.list.scrollTop=r.item.offsetHeight*r.index):""!==this.targetElement()?this.removeFocus():this.focusAtFirstListItem()}}else this.focusAtFirstListItem();this.enableVirtualization&&this.allowFiltering&&this.getFilteringSkeletonCount()},jU.prototype.preRender=function(){null===this.allowFiltering&&(this.allowFiltering="CheckBox"===this.mode),this.preventSetCurrentData=!1,this.initializeData(),this.updateDataAttribute(this.htmlAttributes),SU.prototype.preRender.call(this)},jU.prototype.getLocaleName=function(){return"multi-select"},jU.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,this.isCustomRendered=!1,this.isRemoteSelection=!1,this.isSelectAllTarget=!0,this.isaddNonPresentItems=!1,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount}},jU.prototype.updateData=function(r,s,a){var l,h="",d="Delimiter"===this.mode||"CheckBox"===this.mode,p=[],e=this.listData;if(this.enableVirtualization||(this.listData=this.mainData),je(this.hiddenElement)||this.enableVirtualization||(this.hiddenElement.innerHTML=""),!je(this.value)){for(var c,u=this.value.length,g="",m=this,t=0;t<u;t++){var i=function(e){var t,i,n=m.allowObjectBinding?R(m.fields.value||"",m.value[e]):m.value[e],o=m.findListElement(je(m.mainList)?m.ulElement:m.mainList,"li","data-value",n);if(m.enableVirtualization&&(o=m.findListElement(je(m.list)?m.ulElement:m.list,"li","data-value",n)),je(o)&&!m.allowCustomValue&&!m.enableVirtualization&&m.listData&&0<m.listData.length)m.value.splice(e,1),--e,--u;else{if(m.listData){if(m.enableVirtualization)return d&&!m.isDynamicRemoteVirtualData&&(h=m.delimiterWrapper&&""===m.delimiterWrapper.innerHTML?h:m.delimiterWrapper.innerHTML),o=m.allowObjectBinding?R(m.fields.value||"",m.value[m.value.length-1]):m.value[m.value.length-1],m.isRemoveSelection?(h=m.text.replace(/,/g,r+" ")+r+" ",p=m.text.split(r)):(l=a&&d?m.text:m.getTextByValue(o),i=m.isDynamicRemoteVirtualData&&null!=o&&""!==o&&!a?m.getTextByValue(o):a?m.text:m.text&&""!==m.text?m.text+m.delimiterChar+l:l,h+=l+r+" ",p.push(i),g=m.hiddenElement.innerHTML),s&&s.currentTarget&&s.currentTarget.classList.contains("e-chips-close")||s&&"Backspace"===s.key?(t=s.target.parentElement.getAttribute("data-value"),"Backspace"===s.key?(i=m.hiddenElement.lastChild)&&m.hiddenElement.removeChild(i):m.hiddenElement.childNodes.forEach(function(e){e.value===t&&e.parentNode.removeChild(e)}),g=m.hiddenElement.innerHTML):g+="<option selected value='"+o+"'>"+e+"</option>",c=e,"break";l=m.getTextByValue(n)}else l=n;h+=l+r+" ",p.push(l)}g+='<option selected value="'+n+'">'+e+"</option>",c=e}(t),t=c;if("break"===i)break}je(this.hiddenElement)||(this.isRemoveSelection?(this.findListElement(this.hiddenElement,"option","value",this.currentRemoveValue)&&this.hiddenElement.removeChild(this.findListElement(this.hiddenElement,"option","value",this.currentRemoveValue)),this.isRemoveSelection=!1):this.hiddenElement.innerHTML=g)}var n=s&&s.target&&s.target.classList.contains("e-chips-close"),n=(this.enableVirtualization&&(!this.enableVirtualization||"CheckBox"===this.mode||n)||this.setProperties({text:p.toString()},!0),d&&(this.updateWrapperText(this.delimiterWrapper,h),this.delimiterWrapper.setAttribute("id",D("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id)),s&&s.target),n=!(!n||!n.classList.contains("e-close-hooker"))||null;(!this.changeOnBlur&&s&&!n||this.isSelectAll)&&(this.isSelectAll=!1,this.updateValueState(s,this.value,this.tempValues)),this.listData=e,this.addValidInputClass()},jU.prototype.initialTextUpdate=function(){if(je(this.text))this.setProperties({value:null},!0);else{for(var e,t=this.text.split(this.delimiterChar),i=[],n=0;t.length>n;n++){var o=this.getValueByText(t[n]);je(o)?this.allowCustomValue&&i.push(t[n]):i.push(o)}i&&i.length&&(e=this.allowObjectBinding?this.getDataByValue(i):i,this.setProperties({value:e},!0))}},jU.prototype.renderList=function(e){!e&&this.allowCustomValue&&this.list&&(this.list.textContent===this.noRecordsTemplate||this.list.querySelector(".e-ul")&&0===this.list.querySelector(".e-ul").childElementCount)&&(e=!0),SU.prototype.render.call(this,null,e),this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.unwireListEvents(),this.wireListEvents()},jU.prototype.initialValueUpdate=function(e,t){if(this.list){var i=void 0,n=void 0;if(this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.removeListSelection(),!je(this.value))for(var o=0;!je(this.value[o]);o++){var r,s,a,l,h=this.allowObjectBinding?R(this.fields.value||"",this.value[o]):this.value[o],n=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",h),d=!1;if(this.enableVirtualization){if((i=null)!=e&&0<e.length)for(var p=0;p<e.length;p++)if(this.isPrimitiveData&&e[p]===h||!this.isPrimitiveData&&R(this.fields.value||"value",e[p])===h){i=this.isPrimitiveData?e[p]:R(this.fields.text,e[p]),this.enableVirtualization&&(je(this.selectedListData)?this.selectedListData=[e[p]]:Array.isArray(this.selectedListData)?this.selectedListData.push(e[p]):this.selectedListData=[this.selectedListData,e[p]]);break}je(i)&&this.allowCustomValue&&(!(this.dataSource instanceof me)||this.dataSource instanceof me&&t)&&(i=this.getTextByValue(h),d=!0)}else i=this.getTextByValue(h);n&&"true"!==n.getAttribute("aria-selected")||n&&"true"===n.getAttribute("aria-selected")&&this.hideSelectedItem&&("Box"===this.mode||"Default"===this.mode)||this.enableVirtualization&&null!=h&&null!=i&&!d?(a=[],l=this.isDynamicRemoteVirtualData&&null!=i&&""!==i&&0===o||null==this.text||""===this.text||this.text.includes(i)?i:this.text+this.delimiterChar+i,a.push(l),this.setProperties({text:a.toString()},!0),this.addChip(i,h),this.addListSelection(n)):(!this.enableVirtualization&&h&&this.allowCustomValue||this.enableVirtualization&&h&&this.allowCustomValue&&(!(this.dataSource instanceof me)||this.dataSource instanceof me&&t))&&(d=this.listData.length,x(this.fields.text,h,r={}),x(this.fields.value,h,r),s=this.popupWrapper.querySelector("."+_z.noData),this.enableVirtualization||this.addItem(r,d),this.enableVirtualization&&(this.virtualCustomSelectData&&0<=this.virtualCustomSelectData.length?this.virtualCustomSelectData.push(r):this.virtualCustomSelectData=[r]),n=n||this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",h),this.popupWrapper.contains(s)&&(this.list.setAttribute("style",s.getAttribute("style")),this.popupWrapper.replaceChild(this.list,s),this.wireListEvents()),l=null!=this.text&&""!==this.text?this.text+this.delimiterChar+i:i,(a=[]).push(l),this.setProperties({text:a.toString()},!0),this.addChip(i,h),this.addListSelection(n))}"CheckBox"===this.mode?(this.updateDelimView(),this.changeOnBlur&&this.updateValueState(null,this.value,this.tempValues),this.updateDelimeter(this.delimiterChar),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,null,t),"CheckBox"!==this.mode||!this.showSelectAll||!je(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()}},jU.prototype.updateActionCompleteData=function(e,t){this.value&&(!this.allowObjectBinding&&-1<this.value.indexOf(e.getAttribute("data-value"))||this.allowObjectBinding&&this.isObjectInArray(this.getDataByValue(e.getAttribute("data-value")),this.value))&&(this.mainList=this.ulElement,this.hideSelectedItem)&&U([e],IU)},jU.prototype.updateAddItemList=function(e,t){this.popupObj&&this.popupObj.element&&this.popupObj.element.querySelector("."+_z.noData)&&e?(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"),ue(this.popupWrapper.querySelector(".e-content")),this.popupObj=null,this.renderPopup()):this.allowCustomValue&&(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"))},jU.prototype.updateDataList=function(){var e,t,i;this.mainList&&this.ulElement&&!(this.isFiltered||this.filterAction||this.targetElement().trim())&&(e=this.mainList.childElementCount<this.ulElement.childElementCount,t=0<this.ulElement.childElementCount&&0<this.ulElement.children[0].childElementCount&&this.mainList.children[0]&&this.mainList.children[0].childElementCount<this.ulElement.children[0].childElementCount,i=this.itemTemplate&&0<this.ulElement.childElementCount&&!(this.ulElement.childElementCount<this.mainList.childElementCount)&&(0<this.ulElement.children[0].childElementCount||this.fields.groupBy&&this.ulElement.children[1]&&0<this.ulElement.children[1].childElementCount),e||t||i)&&(this.mainList=this.ulElement)},jU.prototype.isValidLI=function(e){return e&&!e.classList.contains(_z.disabled)&&!e.classList.contains(_z.group)&&e.classList.contains(_z.li)},jU.prototype.updateListSelection=function(e,t,i){var n=e.getAttribute("data-value"),o=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(n)):this.getFormattedValue(n);this.allowCustomValue&&("false"!==n&&!1===o||!je(o)&&"NaN"===o.toString())&&(o=n),this.removeHover(),!this.value||!this.allowObjectBinding&&-1===this.value.indexOf(o)||this.allowObjectBinding&&-1===this.indexOfObjectInArray(o,this.value)?this.dispatchSelect(o,t,e,"true"===e.getAttribute("aria-selected"),i):this.removeValue(o,t,i)},jU.prototype.updateListSelectEventCallback=function(t,e,i,n){var o,r,s=this,a=(t=this.allowObjectBinding?R(this.fields.value||"",t):t,n||this.getTextByValue(t));(this.allowCustomValue||this.allowFiltering)&&!this.findListElement(this.mainList,"li","data-value",t)&&(!this.enableVirtualization||this.enableVirtualization&&this.virtualCustomData)?(o=e&&e.cloneNode(!0),n=this.fields.value||"value",this.allowCustomValue&&this.mainData.length&&"number"==typeof R(n,this.mainData[0])&&(t=isNaN(parseFloat(t.toString()))?t:parseFloat(t.toString())),r=this.getDataByValue(t),this.trigger("customValueSelection",{newData:r,cancel:!1},function(e){e.cancel||(s.enableVirtualization&&s.virtualCustomData?s.virtualCustomSelectData&&0<=s.virtualCustomSelectData.length?s.virtualCustomSelectData.push(r):s.virtualCustomSelectData=[r]:(ht([o],s.mainList),s.mainData.push(r)),s.remoteCustomValue=!1,s.addValue(t,a,i))})):(this.remoteCustomValue=!1,this.addValue(t,a,i))},jU.prototype.removeListSelection=function(){var e=this.hideSelectedItem?IU:_z.selected,t=this.list.querySelectorAll("."+e),i=t.length;if(t&&t.length)for(q(t,e);0<i;)t[i-1].setAttribute("aria-selected","false"),i--;if(!je(this.mainList)){var n=this.mainList.querySelectorAll("."+e),o=n.length;if(n&&n.length)for(q(n,e);0<o;)n[o-1].setAttribute("aria-selected","false"),"CheckBox"===this.mode&&(t&&t.length>o-1&&q([t[o-1].firstElementChild.lastElementChild],"e-check"),q([n[o-1].firstElementChild.lastElementChild],"e-check")),o--}},jU.prototype.removeHover=function(){var e=this.list.querySelectorAll("."+_z.hover);e&&e.length&&q(e,_z.hover)},jU.prototype.removeFocus=function(){var e,t;this.list&&this.mainList&&(e=this.list.querySelectorAll("."+_z.focus),t=this.mainList.querySelectorAll("."+_z.focus),e)&&e.length&&(q(e,_z.focus),q(t,_z.focus))},jU.prototype.addListHover=function(e){(this.enabled&&this.isValidLI(e)||null!==e&&e.classList.contains("e-list-group-item")&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&!je(this.fields.groupBy))&&(this.removeHover(),U([e],_z.hover))},jU.prototype.addListFocus=function(e){this.enabled&&(this.isValidLI(e)||this.fields.disabled&&this.isDisabledElement(e))?(this.removeFocus(),U([e],_z.focus),this.updateAriaActiveDescendant()):this.enableGroupCheckBox&&"CheckBox"===this.mode&&!je(this.fields.groupBy)&&(U([e],_z.focus),this.updateAriaActiveDescendant())},jU.prototype.addListSelection=function(e,t){var i=this.hideSelectedItem?IU:_z.selected;this.isValidLI(e)&&!e.classList.contains(_z.hover)&&(U([e],i),this.updateMainList(!1,e.getAttribute("data-value"),t),e.setAttribute("aria-selected","true"),"CheckBox"===this.mode&&e.classList.contains("e-active")&&0===e.getElementsByClassName("e-check").length&&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(),this.selectedElementID=e.id)},jU.prototype.updateDelimeter=function(e,t,i){this.updateData(e,t,i)},jU.prototype.onMouseClick=function(e){var t,i,n,o=this;this.isClearAllItem||(this.keyCode=null,this.scrollFocusStatus=!1,this.keyboardEvent=null,t=z(i=e.target,"."+_z.li),this.enableVirtualization&&t&&t.classList.contains("e-virtual-list"))||(z(i,"."+_z.group)&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&this.fields.groupBy?((i=i.classList.contains("e-list-group-item")?i.firstElementChild.lastElementChild:e.target).classList.contains("e-check")?(this.selectAllItem(!1,e),i.classList.remove("e-check"),i.classList.remove("e-stop"),z(i,".e-list-group-item").classList.remove("e-active"),i.setAttribute("aria-selected","false")):(this.selectAllItem(!0,e),i.classList.remove("e-stop"),i.classList.add("e-check"),z(i,".e-list-group-item").classList.add("e-active"),i.setAttribute("aria-selected","true")),this.refreshSelection(),this.checkSelectAll()):(this.isValidLI(t)?(n=this.value&&this.value.length?this.value.length:0,t.classList.contains("e-active")&&(n-=1),n<this.maximumSelectionLength&&(this.updateListSelection(t,e),this.checkPlaceholderSize(),this.addListFocus(t),(this.allowCustomValue||this.allowFiltering)&&this.mainList&&this.listData?"CheckBox"!==this.mode&&(this.focusAtLastListItem(t.getAttribute("data-value")),this.refreshSelection()):this.makeTextBoxEmpty()),"CheckBox"===this.mode?(this.updateDelimView(),this.value&&50<this.value.length?setTimeout(function(){o.updateDelimeter(o.delimiterChar,e)},0):this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.checkSelectAll(),this.refreshPopup(),this.allowResize&&this.setResize(),this.hideSelectedItem&&this.focusAtFirstListItem(),this.closePopupOnSelect?this.hidePopup(e):e.preventDefault(),n=""!==this.targetElement().trim(),this.makeTextBoxEmpty(),this.findGroupStart(i),"CheckBox"!==this.mode&&this.refreshListItems(je(t)?null:t.textContent,n)):e.preventDefault(),this.enableVirtualization&&this.hideSelectedItem&&(i=this.list.querySelectorAll("li."+_z.li+":not(."+IU+"):not(.e-reorder-hide):not(.e-virtual-list)")).length&&(t=0<this.virtualListHeight?Math.floor(this.virtualListHeight/this.listItemHeight):0,i.length<t+2)&&(n=(n=this.getForQuery(this.value).clone()).skip(this.virtualItemStartIndex),this.resetList(this.dataSource,this.fields,n),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+_z.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl")?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():((i=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(i)),this.list.querySelector(".e-virtual-ddl-content"))&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.refreshPlaceHolder(),this.deselectHeader()))},jU.prototype.findGroupStart=function(e){if(this.enableGroupCheckBox&&"CheckBox"===this.mode&&!je(this.fields.groupBy)){var t;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),t=this.findGroupAttrtibutes(e,0,0,0,0),t=this.findGroupAttrtibutes(e,t[0],t[1],t[2],1);!e.classList.contains("e-list-group-item")&&null!=(e=(e=e.classList.contains("e-list-icon")?e.parentElement:e).previousElementSibling););this.updateCheckBox(e,t[0],t[1],t[2])}},jU.prototype.findGroupAttrtibutes=function(e,t,i,n,o){for(;!e.classList.contains("e-list-group-item")&&(this.fields.disabled&&this.isDisabledElement(e)||((e=e.classList.contains("e-list-icon")?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++,n++),null!=(e=o?e.nextElementSibling:e.previousElementSibling)););return[t,i,n]},jU.prototype.updateCheckBox=function(e,t,i,n){var o;null===e||!je(this.fields.disabled)&&0===n||(o=e.getElementsByClassName("e-frame")[0],n===t?(o.classList.remove("e-stop"),o.classList.add("e-check"),z(o,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","true")):n===i?(o.classList.remove("e-check"),o.classList.remove("e-stop"),z(o,".e-list-group-item").classList.remove("e-active"),e.setAttribute("aria-selected","false")):this.maximumSelectionLength===t-1?(o.classList.remove("e-stop"),e.setAttribute("aria-selected","true"),z(o,".e-list-group-item").classList.add("e-active"),o.classList.add("e-check")):(o.classList.remove("e-check"),o.classList.add("e-stop"),z(o,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","false")))},jU.prototype.disableGroupHeader=function(){var e=this.list.querySelectorAll("li.e-list-group-item");if(e)for(var t=0;t<e.length;t++){for(var i=!0,n=e[t].nextElementSibling;!n.classList.contains("e-list-group-item");){if(!this.isDisabledElement(n)){i=!1;break}if(null==(n=n.nextElementSibling))break}i&&this.disableListItem(e[t])}},jU.prototype.deselectHeader=function(){var e=this.value&&this.value.length?this.value.length:0,t=this.list.querySelectorAll("li.e-list-group-item:not(.e-active)");e<this.maximumSelectionLength&&q(t,"e-disable"),e===this.maximumSelectionLength&&U(t,"e-disable")},jU.prototype.onMouseOver=function(e){var t=z(e.target,"."+_z.li);null===t&&"CheckBox"===this.mode&&!je(this.fields.groupBy)&&this.enableGroupCheckBox&&(t=z(e.target,"."+_z.group)),this.addListHover(t)},jU.prototype.onMouseLeave=function(){this.removeHover()},jU.prototype.onListMouseDown=function(e){e.preventDefault(),this.scrollFocusStatus=!0},jU.prototype.onDocumentClick=function(e){var t;"CheckBox"!==this.mode&&(t=e.target,!je(this.popupObj)&&z(t,'[id="'+this.popupObj.element.id+'"]')||this.overAllWrapper.contains(e.target)?this.scrollFocusStatus=(F.isIE||"edge"===F.info.name)&&document.activeElement===this.inputElement:this.scrollFocusStatus=!1)},jU.prototype.wireListEvents=function(){je(this.list)||(E.add(document,"mousedown",this.onDocumentClick,this),E.add(this.list,"mousedown",this.onListMouseDown,this),E.add(this.list,"mouseup",this.onMouseClick,this),E.add(this.list,"mouseover",this.onMouseOver,this),E.add(this.list,"mouseout",this.onMouseLeave,this))},jU.prototype.unwireListEvents=function(){E.remove(document,"mousedown",this.onDocumentClick),this.list&&(E.remove(this.list,"mousedown",this.onListMouseDown),E.remove(this.list,"mouseup",this.onMouseClick),E.remove(this.list,"mouseover",this.onMouseOver),E.remove(this.list,"mouseout",this.onMouseLeave))},jU.prototype.hideOverAllClear=function(){this.value&&this.value.length&&""!==this.inputElement.value||(this.overAllClear.style.display="none")},jU.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"},jU.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},jU.prototype.focusOut=function(){document.activeElement===this.inputElement&&this.enabled&&this.inputElement.blur()},jU.prototype.showSpinner=function(){var e;je(this.spinnerElement)&&(e=this.filterParent&&this.filterParent.querySelector(".e-clear-icon.e-icons"),"none"!==this.overAllClear.style.display||e?this.spinnerElement=e||this.overAllClear:(this.spinnerElement=this.createElement("span",{className:PU+" "+RU}),this.componentWrapper.appendChild(this.spinnerElement)),mA({target:this.spinnerElement,width:F.isDevice?"16px":"14px"},this.createElement),U([this.spinnerElement],LU),kA(this.spinnerElement))},jU.prototype.hideSpinner=function(){je(this.spinnerElement)||(BA(this.spinnerElement),q([this.spinnerElement],LU),this.spinnerElement.classList.contains(RU)?G(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},jU.prototype.updateWrapperText=function(e,t){this.valueTemplate||!this.enableHtmlSanitizer?e.innerHTML=this.encodeHtmlEntities(t):e.innerText=t},jU.prototype.updateDelimView=function(){if(this.delimiterWrapper&&this.hideDelimWrapper(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.style.display="none"),je(this.viewWrapper)||(this.viewWrapper.style.display="",this.viewWrapper.style.width="",this.viewWrapper.classList.remove(VU)),this.value&&this.value.length){var e="",t=void 0,i=void 0,n=1,o=void 0,r=void 0,s=0,a=void 0,l=(this.enableVirtualization||this.updateWrapperText(this.viewWrapper,e),{noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed",overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"}),h=new Cn(this.getLocaleName(),l,this.locale),l=(h=""===(h=""===h.getConstant("actionFailureTemplate")?new Cn("dropdowns",l,this.locale):h).getConstant("noRecordsTemplate")?new Cn("dropdowns",l,this.locale):h).getConstant("overflowCountTemplate"),h=h.getConstant("totalCountTemplate"),d=this.createElement("span",{className:"e-remain"}),p=l.replace("${count}",this.value.length.toString()),c=(d.innerText=p,this.viewWrapper.appendChild(d),this.renderReactTemplates(),d.offsetWidth);if(ue(d),this.showDropDownIcon&&(s=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10)),this.checkClearIconWidth(),!je(this.value)&&(this.allowCustomValue||this.listData&&0<this.listData.length))for(var u=0;!je(this.value[u]);u++){var g=this.text&&this.text.split(this.delimiterChar);if(this.enableVirtualization?g&&(e=(e+=0===u?"":this.delimiterChar+" ")+(t=g[u]),t=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,e)):(e=(e+=0===u?"":this.delimiterChar+" ")+(t=this.getOverflowVal(u)),t=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+s+this.clearIconWidth>a){for(void 0!==i&&""!==i&&(t=i,u=n+1),this.updateWrapperText(this.viewWrapper,t),r=this.value.length-u,o=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);o+c+s+this.clearIconWidth>a&&0!==o&&""!==this.viewWrapper.innerHTML;)this.viewWrapper.innerHTML=[].join(this.delimiterChar),r=this.value.length,o=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);break}o+c+s+this.clearIconWidth<=a?(i=e,n=u):0===u&&(i="",n=-1)}0<r&&(p=a-s-this.clearIconWidth,this.viewWrapper.appendChild(this.updateRemainTemplate(d,this.viewWrapper,r,l,h,p)),this.updateRemainWidth(this.viewWrapper,p),this.updateRemainingText(d,s,r,l,h))}else je(this.viewWrapper)||(this.viewWrapper.innerHTML="",this.viewWrapper.style.display="none")},jU.prototype.checkClearIconWidth=function(){this.showClearButton&&(this.clearIconWidth=this.overAllClear.offsetWidth)},jU.prototype.updateRemainWidth=function(e,t){e.classList.contains(VU)&&t<e.offsetWidth+parseInt(window.getComputedStyle(e).paddingLeft,10)+parseInt(window.getComputedStyle(e).paddingLeft,10)&&(e.style.width=t+"px")},jU.prototype.updateRemainTemplate=function(e,t,i,n,o,r){t.firstChild&&3===t.firstChild.nodeType&&""===t.firstChild.nodeValue&&t.removeChild(t.firstChild),e.innerHTML="";n=n.replace("${count}",i.toString()),o=o.replace("${count}",i.toString());return e.innerText=t.firstChild&&3===t.firstChild.nodeType?n:o,t.firstChild&&3===t.firstChild.nodeType?t.classList.remove(VU):(t.classList.add(VU),this.updateRemainWidth(t,r)),e},jU.prototype.updateRemainingText=function(e,t,i,n,o){var r=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),s=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);if(r<=s+t&&0!==s&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType){for(;r<s+t&&0!==s&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType;){var a=this.viewWrapper.firstChild.nodeValue.split(this.delimiterChar);a.pop(),this.viewWrapper.firstChild.nodeValue=a.join(this.delimiterChar),""===this.viewWrapper.firstChild.nodeValue&&this.viewWrapper.removeChild(this.viewWrapper.firstChild),i++,s=this.viewWrapper.offsetWidth}this.updateRemainTemplate(e,this.viewWrapper,i,n,o,r-t)}},jU.prototype.getOverflowVal=function(e){var t,i,n;return this.mainData&&this.mainData.length?(i=this.allowObjectBinding?R(this.fields.value||"",this.value[e]):this.value[e],"CheckBox"===this.mode?(n=this.listData,this.listData=this.mainData,t=this.getTextByValue(i),this.listData=n):t=this.getTextByValue(i)):t=this.allowObjectBinding?R(this.fields.value||"",this.value[e]):this.value[e],t},jU.prototype.unWireEvent=function(){var e;je(this.componentWrapper)||E.remove(this.componentWrapper,"mousedown",this.wrapperClick),E.remove(window,"resize",this.windowResize),je(this.inputElement)||(E.remove(this.inputElement,"focus",this.focusInHandler),E.remove(this.inputElement,"keydown",this.onKeyDown),"CheckBox"!==this.mode&&E.remove(this.inputElement,"input",this.onInput),E.remove(this.inputElement,"keyup",this.keyUp),(e=z(this.inputElement,"form"))&&E.remove(e,"reset",this.resetValueHandler),E.remove(this.inputElement,"blur",this.onBlurHandler)),je(this.componentWrapper)||(E.remove(this.componentWrapper,"mouseover",this.mouseIn),E.remove(this.componentWrapper,"mouseout",this.mouseOut)),je(this.overAllClear)||E.remove(this.overAllClear,"mousedown",this.clearAll),je(this.inputElement)||E.remove(this.inputElement,"paste",this.pasteHandler)},jU.prototype.resizingWireEvent=function(){E.add(document,"mousemove",this.resizePopup,this),E.add(document,"mouseup",this.stopResizing,this),E.add(document,"touchmove",this.resizePopup,this),E.add(document,"touchend",this.stopResizing,this)},jU.prototype.resizingUnWireEvent=function(){E.remove(document,"mousemove",this.resizePopup),E.remove(document,"mouseup",this.stopResizing),E.remove(document,"touchmove",this.resizePopup),E.remove(document,"touchend",this.stopResizing)},jU.prototype.selectAllItem=function(e,t,i){var n;if(je(this.list)||(n=this.list.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)')),this.value&&this.value.length&&t&&t.target&&z(t.target,".e-close-hooker")&&this.allowFiltering&&(n=this.mainList.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)')),this.enableGroupCheckBox&&"CheckBox"===this.mode&&!je(this.fields.groupBy)){var o=t?this.groupTemplate?z(t.target,".e-list-group-item"):t.target:null;if((o=(o=t&&32===t.keyCode?i:o)&&o.classList.contains("e-frame")?o.parentElement.parentElement:o)&&o.classList.contains("e-list-group-item")){var r,s=o.nextElementSibling;if(je(s))return;for(;s.classList.contains("e-list-item");)if(this.fields.disabled&&this.isDisabledElement(s)||(e?s.firstElementChild.lastElementChild.classList.contains("e-check")||(r=this.value&&this.value.length?this.value.length:0,s.classList.contains("e-active")&&--r,r<this.maximumSelectionLength&&this.updateListSelection(s,t)):s.firstElementChild.lastElementChild.classList.contains("e-check")&&this.updateListSelection(s,t)),null==(s=s.nextElementSibling))break;o.classList.contains("e-list-group-item")&&((i=this.list.getElementsByClassName("e-item-focus")[0])&&i.classList.remove("e-item-focus"),e?o.classList.add("e-active"):o.classList.remove("e-active"),o.classList.add("e-item-focus"),this.updateAriaActiveDescendant()),this.textboxValueUpdate(),this.checkPlaceholderSize(),!this.changeOnBlur&&t&&this.updateValueState(t,this.value,this.tempValues)}else this.updateValue(t,n,e)}else this.updateValue(t,n,e);this.addValidInputClass()},jU.prototype.virtualSelectionAll=function(e,t,n){var o=this,i=0,r=t.length,s=this.maximumSelectionLength;if(e){this.virtualSelectAll=!0,r=this.virtualSelectAllData&&0!==this.virtualSelectAllData.length?this.virtualSelectAllData.length:r,this.listData=this.virtualSelectAllData;var e=this.createListItems(this.virtualSelectAllData.slice(0,30),this.fields).querySelectorAll("li"),a=document.createDocumentFragment(),l=(e.forEach(function(e){a.appendChild(e.cloneNode(!0))}),t.forEach(function(e){a.appendChild(e.cloneNode(!0))}),a.childNodes);if(this.virtualSelectAllData instanceof Array){for(;i<r&&i<=50&&i<s;){if(this.isSelectAllTarget=r===i+1,l[i]){var h=this.allowObjectBinding?this.getDataByValue(l[i].getAttribute("data-value")):this.getFormattedValue(l[i].getAttribute("data-value"));if(!this.allowObjectBinding&&this.value&&0<=this.value.indexOf(h)||this.allowObjectBinding&&0<=this.indexOfObjectInArray(h,this.value)){i++;continue}this.updateListSelection(l[i],n,r-i)}else{h=R(this.fields.value||"",this.virtualSelectAllData[i]);if(h=this.allowObjectBinding?this.getDataByValue(h):h,!this.allowObjectBinding&&this.value&&0<=this.value.indexOf(h)||this.allowObjectBinding&&0<=this.indexOfObjectInArray(h,this.value)){i++;continue}this.value&&null!=h&&Array.isArray(this.value)&&(!this.allowObjectBinding&&this.value.indexOf(h)<0||this.allowObjectBinding&&!this.isObjectInArray(h,this.value))&&this.dispatchSelect(h,n,null,!1,r)}i++}50<r&&setTimeout(function(){var e;o.virtualSelectAllData&&0<o.virtualSelectAllData.length&&o.virtualSelectAllData.map(function(e){var t,i;o.value&&null!=e[o.fields.value]&&Array.isArray(o.value)&&(!o.allowObjectBinding&&o.value.indexOf(e[o.fields.value])<0||o.allowObjectBinding&&!o.isObjectInArray(e[o.fields.value],o.value))&&(t=e[o.fields.value],i=e[o.fields.text].toString(),o.dispatchSelect(t,n,null,!1,r,e,i))}),o.updatedataValueItems(n),o.isSelectAllLoop=!1,o.changeOnBlur||(o.updateValueState(n,o.value,o.tempValues),o.isSelectAll=o.isSelectAll&&!o.isSelectAll),o.updateHiddenElement(!0),o.popupWrapper&&t[i-1]&&t[i-1].classList.contains("e-item-focus")&&(e=document.getElementsByClassName("e-selectall-parent")[0])&&e.classList.contains("e-item-focus")&&t[i-1].classList.remove("e-item-focus")},0)}}else this.virtualSelectAllData&&0<this.virtualSelectAllData.length&&this.virtualSelectAllData.map(function(e){o.virtualSelectAll=!0,o.removeValue(o.value[i],n,o.value.length-i)}),this.updatedataValueItems(n),this.changeOnBlur||(this.updateValueState(n,this.value,this.tempValues),this.isSelectAll=this.isSelectAll&&!this.isSelectAll),this.updateHiddenElement(),this.setProperties({value:[]},!0),this.virtualSelectAll=!1,je(this.viewPortInfo.startIndex)||je(this.viewPortInfo.endIndex)||this.notify("setCurrentViewDataAsync",{component:this.getModuleName(),module:"VirtualScroll"});e=this.list.getElementsByClassName("e-virtual-ddl")[0],e&&(e.style=this.GetVirtualTrackHeight()),this.UpdateSkeleton(),e=this.list.getElementsByClassName("e-virtual-ddl-content")[0];e&&(e.style=this.getTransformValues())},jU.prototype.updateValue=function(t,i,e){var n=this,o=i.length,r={event:t,items:e?i:[],itemData:e?this.listData:[],isInteracted:!!t,isChecked:e,preventSelectEvent:!1};if(this.trigger("beforeSelectAll",r),i&&i.length||this.enableVirtualization&&!e){var s=0,a=0,a=this.enableGroupCheckBox?e?this.maximumSelectionLength-(this.value?this.value.length:0):i.length:e?this.maximumSelectionLength-(this.value?this.value.length:0):this.maximumSelectionLength;if(r.preventSelectEvent){for(var l=0;l<i.length&&l<a;l++){this.removeHover();var h=i[l].getAttribute("data-value"),h=this.getFormattedValue(h),h=this.allowObjectBinding?this.getDataByValue(h):h,d=this.mainList?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)')[l]:null;e?(this.value=this.value||[],(!this.allowObjectBinding&&this.value.indexOf(h)<0||this.allowObjectBinding&&!this.isObjectInArray(h,this.value))&&this.setProperties({value:[].concat([],this.value,[h])},!0),this.removeFocus(),this.addListSelection(i[l],d),this.updateChipStatus(),this.checkMaxSelection()):this.removeAllItems(h,t,!1,i[l],d),this.enableGroupCheckBox&&this.findGroupStart(i[l])}e||(this.value&&this.value.length?this.value.length:0)<this.maximumSelectionLength&&q(this.list.querySelectorAll("li."+_z.li+":not(.e-active)"),"e-disable");var p={event:t,items:e?i:[],itemData:e?this.listData:[],isInteracted:!!t,isChecked:e};this.trigger("selectedAll",p)}else if(this.enableVirtualization)this.virtualSelectAllState=e,this.virtualSelectAll=!0,this.CurrentEvent=t,this.virtualSelectAllData||this.resetList(this.dataSource,this.fields,new ya),this.virtualSelectAllData&&this.virtualSelectionAll(e,i,t);else{for(;s<o&&s<=50&&s<a;)this.isSelectAllTarget=o===s+1,this.updateListSelection(i[s],t,o-s),this.enableGroupCheckBox&&this.findGroupStart(i[s]),s++;50<o&&setTimeout(function(){for(;s<o&&s<a;)n.isSelectAllTarget=o===s+1,n.updateListSelection(i[s],t,o-s),n.enableGroupCheckBox&&n.findGroupStart(i[s]),s++;var e;n.updatedataValueItems(t),n.changeOnBlur||(n.updateValueState(t,n.value,n.tempValues),n.isSelectAll=n.isSelectAll&&!n.isSelectAll),n.updateHiddenElement(),n.popupWrapper&&i[s-1].classList.contains("e-item-focus")&&(e=document.getElementsByClassName("e-selectall-parent")[0])&&e.classList.contains("e-item-focus")&&i[s-1].classList.remove("e-item-focus")},0)}}this.updatedataValueItems(t),this.checkPlaceholderSize(),o<=50&&!r.preventSelectEvent&&(this.changeOnBlur||(this.updateValueState(t,this.value,this.tempValues),this.isSelectAll=this.isSelectAll&&!this.isSelectAll),this.enableVirtualization&&this.value&&0<this.value.length||!this.enableVirtualization)&&this.updateHiddenElement()},jU.prototype.updateHiddenElement=function(i){var n=this,o="",r="",s="",a=[];"CheckBox"===this.mode&&(this.value.map(function(e,t){o+='<option selected value ="'+e+'">'+t+"</option>",i||(s=n.listData?n.getTextByValue(e):e,r+=s+n.delimiterChar+" ",a.push(s))}),this.hiddenElement.innerHTML=o,i||(this.updateWrapperText(this.delimiterWrapper,r),this.setProperties({text:a.toString()},!0)),this.delimiterWrapper.setAttribute("id",D("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id),this.refreshInputHight(),this.refreshPlaceHolder())},jU.prototype.updatedataValueItems=function(e){this.deselectHeader(),this.textboxValueUpdate(e)},jU.prototype.textboxValueUpdate=function(e){var t=e&&e.target&&(z(e.target,".e-selectall-parent")||z(e.target,".e-close-hooker"));"Box"===this.mode||this.isPopupOpen()||"CheckBox"===this.mode&&(this.isSelectAll||t)?this.searchWrapper.classList.remove(kU):this.updateDelimView(),"CheckBox"===this.mode?(this.updateDelimView(),(!t&&!this.isSelectAll&&this.isSelectAllTarget||this.isSelectAll&&this.isSelectAllTarget)&&this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.refreshPlaceHolder()},jU.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},jU.prototype.updateDataSource=function(e){je(this.list)?this.renderPopup():this.resetList(this.dataSource),this.value&&this.value.length&&(this.setProperties({value:this.value}),this.refreshSelection())},jU.prototype.onLoadSelect=function(){this.setDynValue=!0,this.renderPopup()},jU.prototype.selectAllItems=function(t,i){var e,n=this;je(this.list)?(this.selectAllAction=function(){var e;"CheckBox"===n.mode&&n.showSelectAll&&(e={module:"CheckBoxSelection",enable:"CheckBox"===n.mode,value:t?"check":"uncheck"},n.notify("checkSelectAll",e)),n.selectAllItem(t,i),n.selectAllAction=null},SU.prototype.render.call(this)):(this.selectAllAction=null,"CheckBox"===this.mode&&this.showSelectAll&&(e={value:t?"check":"uncheck",enable:"CheckBox"===this.mode,module:"CheckBoxSelection"},this.notify("checkSelectAll",e)),this.selectAllItem(t,i)),this.dataSource instanceof me&&!(this.dataSource instanceof me&&this.virtualSelectAllData)||(this.virtualSelectAll=!1)},jU.prototype.getPersistData=function(){return this.addOnPersist(["value"])},jU.prototype.onPropertyChanged=function(e,t){(e.dataSource&&!je(Object.keys(e.dataSource))||e.query&&!je(Object.keys(e.query)))&&(this.mainList=null,this.mainData=null,this.isFirstClick=!1,this.isDynamicDataChange=!0),"multiselect"===this.getModuleName()&&(this.filterAction=!1,this.setUpdateInitial(["fields","query","dataSource"],e));for(var i=0,n=Object.keys(e);i<n.length;i++){var o,r=n[i];switch(r){case"query":case"dataSource":"CheckBox"===this.mode&&this.showSelectAll&&(je(this.popupObj)||(this.popupObj.destroy(),this.popupObj=null),this.renderPopup());break;case"htmlAttributes":this.updateHTMLAttribute();break;case"showClearButton":this.updateClearButton(e.showClearButton);break;case"text":this.fields.disabled&&(this.text=this.text&&!this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?this.text:null),this.updateVal(this.value,this.value,"text");break;case"value":this.fields.disabled&&this.removeDisabledItemsValue(this.value),this.updateVal(this.value,t.value,"value"),this.addValidInputClass(),!this.closePopupOnSelect&&this.isPopupOpen()&&this.refreshPopup(),this.isPopupOpen()&&"CheckBox"===this.mode&&this.list&&this.list.querySelector(".e-active.e-disable")&&q(this.list.querySelectorAll("li."+_z.li+".e-active.e-disable"),"e-disable"),this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"width":this.setWidth(e.width),this.popupObj.setProperties({width:this.calcPopupWidth()});break;case"placeholder":this.refreshPlaceHolder();break;case"filterBarPlaceholder":this.allowFiltering&&this.notify("filterBarPlaceholder",{filterBarPlaceholder:e.filterBarPlaceholder});break;case"delimiterChar":"Box"!==this.mode&&this.updateDelimView(),this.updateData(e.delimiterChar);break;case"cssClass":this.updateOldPropCssClass(t.cssClass),this.updateCssClass(),this.calculateWidth();break;case"enableRtl":this.enableRTL(e.enableRtl),SU.prototype.onPropertyChanged.call(this,e,t);break;case"allowResize":this.allowResize=e.allowResize,!this.allowResize&&this.popupObj&&(o=parseInt(this.popupHeight,10),"auto"!==this.popupHeight?(this.list.style.maxHeight=T(o),this.popupWrapper.style.height=T(this.popupHeight),this.popupWrapper.style.maxHeight=T(this.popupHeight)):this.list.style.maxHeight=T(this.popupHeight));break;case"readonly":this.updateReadonly(e.readonly),this.hidePopup();break;case"enabled":this.hidePopup(),this.enable(e.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(),HF.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),je(this.overAllWrapper)||je(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon");break;case"enableSelectionOrder":break;case"selectAllText":this.notify("selectAllText",!1);break;case"popupHeight":this.popupObj&&(o=parseInt(this.popupHeight,10),"auto"!==this.popupHeight?(this.list.style.maxHeight=T(o),this.popupWrapper.style.maxHeight=T(this.popupHeight)):this.list.style.maxHeight=T(this.popupHeight));break;case"headerTemplate":case"footerTemplate":this.reInitializePoup();break;case"allowFiltering":"CheckBox"===this.mode&&this.popupObj&&this.reInitializePoup(),this.updateSelectElementData(this.allowFiltering);break;case"fields":je(this.fields.groupBy)&&this.removeScrollEvent();break;default:var s=this.getPropObject(r,e,t);SU.prototype.onPropertyChanged.call(this,s.newProperty,s.oldProperty)}}},jU.prototype.reInitializePoup=function(){this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup()},jU.prototype.totalItemsCount=function(){var e;if(this.dataSource instanceof me?0<=this.remoteDataCount?e=this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):e=this.dataSource&&this.dataSource.length?this.dataSource.length:0,"CheckBox"===this.mode)this.totalItemCount=0!==e?e:this.totalItemCount;else if(this.hideSelectedItem){if(this.totalItemCount=0!==e&&this.value?e-this.value.length:this.totalItemCount,this.allowCustomValue&&this.virtualCustomSelectData&&0<this.virtualCustomSelectData.length)for(var t=0;t<this.virtualCustomSelectData.length;t++)for(var i=0;i<this.value.length;i++)(this.allowObjectBinding?R(this.fields.value||"",this.value[i]):this.value[i])===R(this.fields.value||"",this.virtualCustomSelectData[t])&&(this.totalItemCount+=1)}else this.totalItemCount=0!==e?e:this.totalItemCount,this.allowCustomValue&&this.virtualCustomSelectData&&0<this.virtualCustomSelectData.length&&(this.totalItemCount+=this.virtualCustomSelectData.length)},jU.prototype.presentItemValue=function(e){for(var t=[],i=0;i<this.value.length;i++){var n=this.allowObjectBinding?R(this.fields.value||"",this.value[i]):this.value[i];this.findListElement(this.allowFiltering&&!je(this.mainList)?this.mainList:e,"li","data-value",n)||(n=this.allowObjectBinding?this.getDataByValue(this.value[i]):this.value[i],t.push(n))}return t},jU.prototype.addNonPresentItems=function(e,t,i,n){var o=this;this.dataSource.executeQuery(this.getForQuery(e)).then(function(e){0<e.result.length&&o.addItem(e.result,i.length),o.updateActionList(t,i,n)})},jU.prototype.updateVal=function(e,t,i){var n;this.list&&(!(this.dataSource instanceof me)||this.listData&&this.mainList&&this.mainData)?(n=[],je(this.value)||this.allowCustomValue||(n=this.presentItemValue(this.ulElement)),"value"===i&&0<n.length&&this.dataSource instanceof me&&!je(this.value)&&null!=this.listData?(this.mainData=null,this.setDynValue=!0,this.isaddNonPresentItems=!0,this.addNonPresentItems(n,this.ulElement,this.listData),this.isaddNonPresentItems=!1):("text"===i&&(this.initialTextUpdate(),e=this.value),!je(this.value)&&0!==this.value.length||(this.tempValues=t),this.allowCustomValue&&("Default"===this.mode||"Box"===this.mode)&&this.isReact&&this.inputFocus&&this.isPopupOpen()&&this.mainData!==this.listData&&(n=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.onActionComplete(n,this.mainData)),this.enableVirtualization?!this.enableVirtualization||this.dataSource instanceof me?this.isInitRemoteVirtualData||(this.isDynamicRemoteVirtualData=!0,this.initialValueUpdate(this.listData,!0),this.isDynamicRemoteVirtualData=!1,this.initialUpdate()):this.initialValueUpdate(this.dataSource,!0):this.initialValueUpdate(),"Box"===this.mode||this.inputFocus||this.updateDelimView(),this.inputFocus||this.refreshInputHight(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,e,t),this.checkPlaceholderSize())):this.onLoadSelect(),this.changeOnBlur||this.updateValueState(null,e,t)},jU.prototype.addItem=function(e,t){SU.prototype.addItem.call(this,e,t)},jU.prototype.hidePopup=function(e){var t,i=this;this.isPopupOpen()&&(t={name:"FadeOut",duration:100,delay:100},this.customFilterQuery=null,t={popup:this.popupObj,cancel:!1,animation:t,event:e||null},this.trigger("close",t,function(e){var t;e.cancel||(i.fields.groupBy&&"CheckBox"!==i.mode&&i.fixedHeaderElement&&(ue(i.fixedHeaderElement),i.fixedHeaderElement=null),i.beforePopupOpen=!1,i.overAllWrapper.classList.remove(NU),t="CheckBox"===i.mode?i.targetElement():null,i.popupObj.hide(new Vt(e.animation)),pt(i.inputElement,{"aria-expanded":"false"}),i.inputElement.removeAttribute("aria-owns"),i.inputElement.removeAttribute("aria-activedescendant"),i.allowFiltering&&i.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode,value:"clear"}),i.popupObj.hide(),q([document.body,i.popupObj.element],"e-popup-full-page"),E.remove(i.list,"keydown",i.onKeyDown),"CheckBox"===i.mode&&i.showSelectAll&&E.remove(i.popupObj.element,"click",i.clickHandler),i.list&&i.list.parentElement&&i.allowResize&&(i.resizer&&i.list.parentElement.contains(i.resizer)&&i.list.parentElement.removeChild(i.resizer),i.list.parentElement.classList.contains("e-resize")&&i.list.parentElement.classList.remove("e-resize"),i.list.parentElement.style.boxSizing="",i.list.parentElement.style.paddingBottom="",e=parseInt(i.popupHeight,10),i.list.style.maxHeight=T(e),i.list.parentElement.style.height=T(i.popupHeight),i.list.parentElement.style.maxHeight=T(i.popupHeight)),i.resizer&&(E.remove(i.resizer,"mousedown",i.startResizing),i.resizer.remove()),e=void(i.enableVirtualization&&"CheckBox"===i.mode&&i.value&&0<i.value.length&&i.enableSelectionOrder&&(i.viewPortInfo.startIndex=i.virtualItemStartIndex=0,i.viewPortInfo.endIndex=i.virtualItemEndIndex=0<i.viewPortInfo.startIndex?i.viewPortInfo.endIndex:i.itemCount,i.virtualListInfo=i.viewPortInfo,i.previousStartIndex=0,i.previousEndIndex=i.itemCount)),i.dataSource instanceof me?0<=i.remoteDataCount?i.totalItemCount=i.dataCount=i.remoteDataCount:i.resetList(i.dataSource):e=i.dataSource&&i.dataSource.length?i.dataSource.length:0,i.enableVirtualization&&(i.allowFiltering||i.allowCustomValue)&&(i.targetElement()||t)&&i.totalItemCount!==e&&(i.checkAndResetCache(),i.updateInitialData()),i.virtualCustomData&&i.viewPortInfo&&0===i.viewPortInfo.startIndex&&i.viewPortInfo.endIndex===i.itemCount&&i.renderItems(i.mainData,i.fields),i.virtualCustomData=null,i.isVirtualTrackHeight=!1)}))},jU.prototype.showPopup=function(r){var s=this;this.enabled&&(this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,this.trigger("beforeOpen",{cancel:!1},function(e){if(!e.cancel)if(s.ulElement){"CheckBox"===s.mode&&F.isDevice&&s.allowFiltering&&s.isDeviceFullScreen&&s.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===s.mode});var e=s.ulElement.querySelectorAll("li.e-list-item").length,t=s.ulElement.querySelectorAll("li."+_z.li+"."+IU).length;if(0<e&&e===t&&t===s.mainData.length&&(""===s.targetElement()||!s.allowCustomValue))s.beforePopupOpen=!1;else{if(s.onPopupShown(r),s.enableVirtualization&&s.listData&&s.listData.length&&(je(s.value)||"dropdownlist"!==s.getModuleName()&&"combobox"!==s.getModuleName()||s.removeHover(),s.beforePopupOpen||(s.hideSelectedItem&&s.value&&Array.isArray(s.value)&&0<s.value.length&&s.totalItemsCount(),s.preventSetCurrentData)||je(s.viewPortInfo.startIndex)||je(s.viewPortInfo.endIndex)||s.notify("setCurrentViewDataAsync",{component:s.getModuleName(),module:"VirtualScroll"})),s.enableVirtualization&&!s.allowFiltering&&null!=s.selectedValueInfo&&0<s.selectedValueInfo.startIndex&&null!=s.value&&s.notify("dataProcessAsync",{module:"VirtualScroll",isOpen:!0}),s.enableVirtualization)s.updatevirtualizationList();else if(s.value&&s.value.length){s.getItems();for(var i=0,n=s.value;i<n.length;i++){var o=n[i],o=s.allowObjectBinding?R(s.fields.value||"",o):o;(o=s.getElementByValue(o))&&s.addListSelection(o)}}s.allowResize&&s.setResize(),s.preventSetCurrentData=!0}}else s.beforePopupOpen=!0,"CheckBox"===s.mode&&F.isDevice&&s.allowFiltering&&s.isDeviceFullScreen&&s.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===s.mode}),SU.prototype.render.call(s,r)}))},jU.prototype.selectAll=function(e){this.isSelectAll=!0,this.selectAllItems(e)},jU.prototype.getModuleName=function(){return"multiselect"},jU.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)},jU.prototype.render=function(){!je(this.value)&&0<this.value.length&&(this.value=this.value.slice()),this.setDynValue=this.initStatus=!1,this.isSelectAll=!1,this.selectAllEventEle=[],this.searchWrapper=this.createElement("span",{className:"e-searcher "+("Box"===this.mode?"e-multiselect-box":"")}),this.viewWrapper=this.createElement("span",{className:"e-delim-view "+BU}),this.viewWrapper.style.display="none",this.overAllClear=this.createElement("span",{className:PU}),this.overAllClear.style.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&&U([this.overAllWrapper],"e-checkbox"),F.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"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),"Delimiter"===this.mode||"CheckBox"===this.mode?(this.delimiterWrapper=this.createElement("span",{className:BU}),this.delimiterWrapper.style.display="none",this.componentWrapper.appendChild(this.delimiterWrapper)):(this.chipCollectionWrapper=this.createElement("span",{className:"e-chips-collection"}),this.chipCollectionWrapper.style.display="none","Default"===this.mode?this.chipCollectionWrapper.setAttribute("id",D("chip_default")):"Box"===this.mode&&this.chipCollectionWrapper.setAttribute("id",D("chip_box")),this.componentWrapper.appendChild(this.chipCollectionWrapper)),"Box"!==this.mode&&this.componentWrapper.appendChild(this.viewWrapper),this.componentWrapper.appendChild(this.searchWrapper),this.showClearButton&&!F.isDevice?this.componentWrapper.appendChild(this.overAllClear):this.componentWrapper.classList.add(FU),this.dropDownIcon(),this.inputElement=this.createElement("input",{className:"e-dropdownbase",attrs:{spellcheck:"false",type:"text",autocomplete:"off",tabindex:"0",role:"combobox"}}),"Default"!==this.mode&&"Box"!==this.mode||this.inputElement.setAttribute("aria-describedby",this.chipCollectionWrapper.id),je(this.inputElement)||(pt(this.inputElement,{"aria-expanded":"false"}),this.inputElement.hasAttribute("aria-label"))||this.inputElement.setAttribute("aria-label",this.getModuleName()),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?gU(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"):D("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(),!je(z(this.element,"fieldset"))&&z(this.element,"fieldset").disabled&&(this.enabled=!1),this.wireEvent(),this.enable(this.enabled),this.enableRTL(this.enableRtl),this.enableVirtualization&&this.updateVirtualizationProperties(this.itemCount,this.allowFiltering,"CheckBox"===this.mode),this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=0<this.viewPortInfo.startIndex?this.viewPortInfo.endIndex:this.itemCount,this.checkInitialValue(),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),HF.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),je(this.overAllWrapper)||je(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.renderComplete()},jU.prototype.setResize=function(){var e;this.list&&this.list.parentElement&&je(this.list.parentElement.querySelector(".e-resizer-right.e-icons"))&&(this.resizer=this.createElement("div",{id:this.element.id+"_resize-popup",className:"e-resizer-right e-icons"})),"CheckBox"===this.mode&&this.showSelectAll&&this.selectAllHeight&&0!==this.selectAllHeight&&(this.storedSelectAllHeight=this.selectAllHeight),this.list&&this.list.parentElement&&(this.list.parentElement.classList.add("e-resize"),"auto"!==this.popupHeight.toString().toLowerCase()&&(this.list.parentElement.style.height="100%"),this.list.parentElement.style.boxSizing="border-box",e="CheckBox"===this.mode&&this.searchBoxHeight?this.searchBoxHeight+16+(this.showSelectAll?this.storedSelectAllHeight:0):16,this.list.parentElement.style.paddingBottom=e+"px",this.list.parentElement.appendChild(this.resizer),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px"),this.resizer&&(E.add(this.resizer,"mousedown",this.startResizing,this),E.add(this.resizer,"touchstart",this.startResizing,this))},jU.prototype.startResizing=function(e){this.isResizing=!0,this.trigger("resizeStart",e);var t=(e instanceof MouseEvent?e:e.touches[0]).clientX,i=(e instanceof MouseEvent?e:e.touches[0]).clientY;this.list&&this.list.parentElement&&(this.originalWidth=this.list.parentElement.offsetWidth,this.originalHeight=this.list.parentElement.offsetHeight,this.originalMouseX=t,this.originalMouseY=i),this.resizingWireEvent(),e&&e.preventDefault()},jU.prototype.resizePopup=function(e){var t,i,n,o;this.isResizing&&(this.trigger("resizing",e),t=(e instanceof MouseEvent?e:e.touches[0]).clientX,i=(e instanceof MouseEvent?e:e.touches[0]).clientY,t=t-this.originalMouseX,i=i-this.originalMouseY,this.resizeWidth=Math.max(this.originalWidth+t,100),this.resizeHeight=Math.max(this.originalHeight+i,130),this.list&&this.list.parentElement&&(n=(n=parseInt(window.getComputedStyle(this.list.parentElement).minWidth,10))||100,o=(o=parseInt(window.getComputedStyle(this.list.parentElement).minHeight,10))||120,this.resizeWidth=Math.max(this.originalWidth+t,n),this.resizeHeight=Math.max(this.originalHeight+i,o),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.fixedHeaderElement)&&this.ulElement&&(this.fixedHeaderElement.style.width=this.ulElement.offsetWidth+"px"),e)&&e.preventDefault()},jU.prototype.stopResizing=function(e){this.isResizing&&(this.isResizing=!1,this.trigger("resizeStop",e),this.resizingUnWireEvent()),e&&e.preventDefault()},jU.prototype.getListHeight=function(){var e=this.createElement("div",{className:"e-dropdownbase"}),t=this.createElement("li",{className:"e-list-item"}),i=T(this.popupHeight),i=(e.style.height=parseInt(i,10).toString()+"px",e.appendChild(t),document.body.appendChild(e),this.virtualListHeight=e.getBoundingClientRect().height,Math.ceil(t.getBoundingClientRect().height)+parseInt(window.getComputedStyle(t).marginBottom,10));return e.remove(),i},jU.prototype.removeDisabledItemsValue=function(e){if(e){for(var t=[],i=0,n=0;n<e.length;n++){var o=e[n];null==(o="object"==typeof o?JSON.parse(JSON.stringify(o))[this.fields.value]:o)||this.isDisabledItemByIndex(this.getIndexByValue(o))||(t[i++]=e[n])}this.value=0<t.length?t:null}},jU.prototype.checkInitialValue=function(){var t,i=this,e=(this.fields.disabled&&this.removeDisabledItemsValue(this.value),this.dataSource instanceof Array?0<this.dataSource.length:!je(this.dataSource));if((!this.value||!this.value.length)&&je(this.text)&&!e&&"SELECT"===this.element.tagName&&0<this.element.options.length){for(var n=this.element.options,o=[],r="",s=0,a=n.length;s<a;s++){var l=n[s];je(l.getAttribute("selected"))||(l.getAttribute("value")?(c=this.allowObjectBinding?this.getDataByValue(l.getAttribute("value")):l.getAttribute("value"),o.push(c)):r+=l.text+this.delimiterChar)}0<o.length?this.setProperties({value:o},!0):""!==r&&this.setProperties({text:r},!0),(0<o.length||""!==r)&&(this.refreshInputHight(),this.refreshPlaceHolder())}if(!(this.value&&this.value.length||!je(this.text))||this.list||SU.prototype.render.call(this),this.fields.disabled&&(this.text=this.text&&!this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?this.text:null),je(this.text)||!je(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.value&&this.value.length){if(this.enableVirtualization){for(var h=this.isPrimitiveData?"":this.fields.value,d=void 0,p=0;p<this.value.length;p++)var c=this.allowObjectBinding?R(this.fields.value||"",this.value[p]):this.value[p],d=0===p?new ba(h,"equal",c):d.or(h,"equal",c);this.dataSource instanceof me?this.dataSource.executeQuery((new ya).where(d)).then(function(e){0<e.result.length&&(t=e.result,i.initStatus=!1,i.isInitRemoteVirtualData=!0,setTimeout(function(){i.initialValueUpdate(t,!0),i.initialUpdate(),i.isInitRemoteVirtualData=!1},100),i.initStatus=!0)}):t=new me(this.dataSource).executeLocal((new ya).where(d))}this.dataSource instanceof me?this.setInitialValue=function(){i.initStatus=!1,i.enableVirtualization&&(!i.enableVirtualization||i.dataSource instanceof me)||i.initialValueUpdate(t),i.initialUpdate(),i.setInitialValue=null,i.initStatus=!0}:(this.initialValueUpdate(t,!0),this.initialUpdate()),this.updateTempValue()}else this.initialUpdate();this.initStatus=!0,this.checkAutoFocus(),je(this.text)||this.element.setAttribute("data-initial-value",this.text)},jU.prototype.checkAutoFocus=function(){this.element.hasAttribute("autofocus")&&this.inputElement.focus()},jU.prototype.updatevirtualizationList=function(){if(this.value&&this.value.length){for(var e,t,i=0,n=this.value;i<n.length;i++){var o=n[i],o=this.allowObjectBinding?R(this.fields.value||"",o):o;(o=this.getElementByValue(o))&&this.addListSelection(o)}this.enableVirtualization&&this.hideSelectedItem&&(t=this.list.querySelectorAll("li."+_z.li+":not(."+IU+"):not(.e-reorder-hide):not(.e-virtual-list)")).length&&(e=0<this.virtualListHeight?Math.floor(this.virtualListHeight/this.listItemHeight):0,t.length<e+2)&&(t=(t=this.getForQuery(this.value).clone()).skip(this.viewPortInfo.startIndex),this.resetList(this.dataSource,this.fields,t))}},jU.prototype.setFloatLabelType=function(){fU(this.overAllWrapper,this.componentWrapper,this.searchWrapper,this.inputElement,this.value,this.floatLabelType,this.placeholder),"Never"!==this.floatLabelType&&gU(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder)},jU.prototype.addValidInputClass=function(){je(this.overAllWrapper)||(!je(this.value)&&this.value.length||"Always"===this.floatLabelType?U:q)([this.overAllWrapper],"e-valid-input")},jU.prototype.dropDownIcon=function(){this.showDropDownIcon?(this.dropIcon=this.createElement("span",{className:OU}),this.componentWrapper.appendChild(this.dropIcon),U([this.componentWrapper],["e-down-icon"])):je(this.dropIcon)||(this.dropIcon.parentElement.removeChild(this.dropIcon),q([this.componentWrapper],["e-down-icon"]))},jU.prototype.initialUpdate=function(){"Box"===this.mode||this.setDynValue&&"Default"===this.mode&&this.inputFocus||this.updateDelimView(),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.updateCssClass(),this.updateHTMLAttribute(),this.updateReadonly(this.readonly),this.refreshInputHight(),this.checkPlaceholderSize()},jU.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t,i,n=-1;if(this.liCollections&&0<this.liCollections.length&&this.listData&&this.fields.disabled){if("string"==typeof e)n=this.getIndexByValue(e);else if("object"==typeof e){if(e instanceof HTMLLIElement){for(var o=0;o<this.liCollections.length;o++)if(this.liCollections[o]===e){n=this.getIndexByValue(e.getAttribute("data-value"));break}}else for(var r=JSON.parse(JSON.stringify(e))[this.fields.value],o=0;o<this.listData.length;o++)if(JSON.parse(JSON.stringify(this.listData[o]))[this.fields.value]===r){n=this.getIndexByValue(r);break}}else n=e;n<this.liCollections.length&&-1<n&&!JSON.parse(JSON.stringify(this.listData[n]))[this.fields.disabled]&&(t=this.liCollections[n])&&(this.disableListItem(t),(i=JSON.parse(JSON.stringify(this.listData[n])))[this.fields.disabled]=!0,this.listData[n]=i,t.classList.contains(_z.focus)&&this.removeFocus(),(t.classList.contains(IU)||t.classList.contains(_z.selected))&&(i=this.value,this.removeDisabledItemsValue(this.value),this.updateVal(this.value,i,"value")),"CheckBox"===this.mode)&&this.enableGroupCheckBox&&!je(this.fields.groupBy)&&this.disableGroupHeader()}}},jU.prototype.destroy=function(){this.isReact&&this.clearTemplate(),je(this.popupObj)||(this.popupObj.hide(),this.popupObj.destroy()),this.notify("destroy",{}),this.unwireListEvents(),this.unWireEvent();var e=["readonly","aria-disabled","placeholder","aria-label","aria-expanded"],t=e.length;if(!je(this.inputElement))for(;0<t;)this.inputElement.removeAttribute(e[t-1]),t--;for(je(this.element)||(this.element.removeAttribute("data-initial-value"),this.element.style.display="block"),this.overAllWrapper&&this.overAllWrapper.parentElement&&(this.overAllWrapper.parentElement.tagName!==this.getNgDirective()&&this.overAllWrapper.parentElement.insertBefore(this.element,this.overAllWrapper),ue(this.overAllWrapper)),this.popupWrapper&&this.popupWrapper.parentElement&&this.popupWrapper.parentElement.remove();this.searchWrapper&&this.searchWrapper.firstChild;)this.searchWrapper.removeChild(this.searchWrapper.firstChild);this.searchWrapper&&this.searchWrapper.parentElement&&this.searchWrapper.parentElement.remove(),this.viewWrapper&&this.viewWrapper.parentElement&&this.viewWrapper.parentElement.remove(),this.overAllClear&&this.overAllClear.parentElement&&this.overAllClear.parentElement.remove(),this.delimiterWrapper&&this.delimiterWrapper.parentElement&&this.delimiterWrapper.parentElement.remove();var i=this.overAllWrapper.querySelector("select.e-multi-hidden");for(i&&i.parentElement&&i.parentElement.remove();this.componentWrapper&&this.componentWrapper.firstChild;)this.componentWrapper.removeChild(this.componentWrapper.firstChild);for(this.componentWrapper&&this.componentWrapper.parentElement&&(this.componentWrapper.removeAttribute("class"),this.componentWrapper.parentElement.remove());this.popupWrapper&&this.popupWrapper.firstChild;)this.popupWrapper.removeChild(this.popupWrapper.firstChild);if(this.inputElement)for(var n=["readonly","aria-disabled","placeholder","aria-labelledby","aria-expanded","autocomplete","aria-readonly","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-label","aria-hidden","tabindex","aria-controls","aria-describedby","size","role","type","class"],o=0;o<n.length;o++)this.inputElement.removeAttribute(n[o]);this.inputElement&&this.inputElement.remove(),this.list=null,this.popupObj=null,this.mainData=null,this.filterParent=null,this.ulElement=null,this.componentWrapper=null,this.overAllClear=null,this.overAllWrapper=null,this.hiddenElement=null,this.searchWrapper=null,this.viewWrapper=null,this.chipCollectionWrapper=null,this.targetInputElement=null,this.popupWrapper=null,this.inputElement=null,this.delimiterWrapper=null,this.liCollections=null,this.popupContentElement=null,this.header=null,this.mainList=null,this.mainListCollection=null,this.footer=null,this.selectAllEventEle=null,SU.prototype.destroy.call(this)},bQ([t({text:null,value:null,iconCss:null,groupBy:null,disabled:null},HH)],jU.prototype,"fields",void 0),bQ([e(!1)],jU.prototype,"enablePersistence",void 0),bQ([e(null)],jU.prototype,"groupTemplate",void 0),bQ([e("No records found")],jU.prototype,"noRecordsTemplate",void 0),bQ([e("Request failed")],jU.prototype,"actionFailureTemplate",void 0),bQ([e("None")],jU.prototype,"sortOrder",void 0),bQ([e(!0)],jU.prototype,"enabled",void 0),bQ([e(!0)],jU.prototype,"enableHtmlSanitizer",void 0),bQ([e(!1)],jU.prototype,"enableVirtualization",void 0),bQ([e([])],jU.prototype,"dataSource",void 0),bQ([e(null)],jU.prototype,"query",void 0),bQ([e("StartsWith")],jU.prototype,"filterType",void 0),bQ([e(1e3)],jU.prototype,"zIndex",void 0),bQ([e(!1)],jU.prototype,"ignoreAccent",void 0),bQ([e()],jU.prototype,"locale",void 0),bQ([e(!1)],jU.prototype,"enableGroupCheckBox",void 0),bQ([e(null)],jU.prototype,"cssClass",void 0),bQ([e("100%")],jU.prototype,"width",void 0),bQ([e("300px")],jU.prototype,"popupHeight",void 0),bQ([e("100%")],jU.prototype,"popupWidth",void 0),bQ([e(null)],jU.prototype,"placeholder",void 0),bQ([e(null)],jU.prototype,"filterBarPlaceholder",void 0),bQ([e({})],jU.prototype,"htmlAttributes",void 0),bQ([e(null)],jU.prototype,"valueTemplate",void 0),bQ([e(null)],jU.prototype,"headerTemplate",void 0),bQ([e(null)],jU.prototype,"footerTemplate",void 0),bQ([e(null)],jU.prototype,"itemTemplate",void 0),bQ([e(null)],jU.prototype,"allowFiltering",void 0),bQ([e(!0)],jU.prototype,"isDeviceFullScreen",void 0),bQ([e(!0)],jU.prototype,"changeOnBlur",void 0),bQ([e(!1)],jU.prototype,"allowCustomValue",void 0),bQ([e(!0)],jU.prototype,"showClearButton",void 0),bQ([e(1e3)],jU.prototype,"maximumSelectionLength",void 0),bQ([e(!1)],jU.prototype,"readonly",void 0),bQ([e(!1)],jU.prototype,"allowResize",void 0),bQ([e(null)],jU.prototype,"text",void 0),bQ([e(null)],jU.prototype,"value",void 0),bQ([e(!1)],jU.prototype,"allowObjectBinding",void 0),bQ([e(!0)],jU.prototype,"hideSelectedItem",void 0),bQ([e(!0)],jU.prototype,"closePopupOnSelect",void 0),bQ([e("Default")],jU.prototype,"mode",void 0),bQ([e(",")],jU.prototype,"delimiterChar",void 0),bQ([e(!0)],jU.prototype,"ignoreCase",void 0),bQ([e(!1)],jU.prototype,"showDropDownIcon",void 0),bQ([e("Never")],jU.prototype,"floatLabelType",void 0),bQ([e(!1)],jU.prototype,"showSelectAll",void 0),bQ([e("Select All")],jU.prototype,"selectAllText",void 0),bQ([e("Unselect All")],jU.prototype,"unSelectAllText",void 0),bQ([e(!0)],jU.prototype,"enableSelectionOrder",void 0),bQ([e(!0)],jU.prototype,"openOnClick",void 0),bQ([e(!1)],jU.prototype,"addTagOnBlur",void 0),bQ([i()],jU.prototype,"change",void 0),bQ([i()],jU.prototype,"removing",void 0),bQ([i()],jU.prototype,"removed",void 0),bQ([i()],jU.prototype,"beforeSelectAll",void 0),bQ([i()],jU.prototype,"selectedAll",void 0),bQ([i()],jU.prototype,"beforeOpen",void 0),bQ([i()],jU.prototype,"open",void 0),bQ([i()],jU.prototype,"close",void 0),bQ([i()],jU.prototype,"blur",void 0),bQ([i()],jU.prototype,"focus",void 0),bQ([i()],jU.prototype,"chipSelection",void 0),bQ([i()],jU.prototype,"resizeStop",void 0),bQ([i()],jU.prototype,"resizing",void 0),bQ([i()],jU.prototype,"resizeStart",void 0),bQ([i()],jU.prototype,"filtering",void 0),bQ([i()],jU.prototype,"tagging",void 0),bQ([i()],jU.prototype,"customValueSelection",void 0),bQ([Bt],jU));function jU(e,t){e=SU.call(this,e,t)||this;return e.clearIconWidth=0,e.previousFilterText="",e.storedSelectAllHeight=0,e.isUpdateHeaderHeight=!1,e.isUpdateFooterHeight=!1,e.isBlurDispatching=!1,e.isFilterPrevented=!1,e.isFilteringAction=!1,e.isVirtualReorder=!1,e.isValidKey=!1,e.selectAllEventData=[],e.selectAllEventEle=[],e.preventSetCurrentData=!1,e.isSelectAllLoop=!1,e.scrollFocusStatus=!1,e.keyDownStatus=!1,e}var WU="e-frame",QU="e-check",UU="e-checkbox-wrapper",qU="e-stop",GU="e-input-group-icon e-clear-icon e-icons",YU="e-clear-icon",XU="e-popup-full-page",KU="e-input-focus",JU=(ZU.prototype.getModuleName=function(){return"CheckBoxSelection"},ZU.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.onBlurHandler,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),E.add(document,"mousedown",this.onDocumentClick,this),this.parent.on("addItem",this.checboxCreate,this),this.parent.on("popupFullScreen",this.setPopupFullScreen,this))},ZU.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.onBlurHandler),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))},ZU.prototype.listOption=function(e){var t,i=this;je(this.parent.listCurrentOptions.itemCreated)?this.parent.listCurrentOptions.itemCreated=function(e){i.checboxCreate(e)}:(t=this.parent.listCurrentOptions.itemCreated,this.parent.listCurrentOptions.itemCreated=function(e){i.checboxCreate(e),t.apply(i,[e])})},ZU.prototype.setPlaceholder=function(e){HF.setPlaceholder(e.filterBarPlaceholder,this.filterInput)},ZU.prototype.checboxCreate=function(e){var t,i,e=je(e.item)?e:e.item;return(this.parent.enableGroupCheckBox||"e-list-group-item "!==e.className&&"e-list-group-item"!==e.className)&&(t=kv(this.parent.createElement,!0),i=ge("div.e-icons",e),e.insertBefore(t,e.childNodes[je(i)?0:1]),ge("."+WU,t),this.parent.enableGroupCheckBox)&&this.parent.popupWrapper.classList.add("e-multiselect-group"),e},ZU.prototype.setSelectAll=function(){this.parent.showSelectAll?(je(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&&(je(this.parent.filterParent)?ht([this.checkAllParent],this.parent.popupWrapper):ht([this.checkAllParent],this.parent.filterParent)),this.parent.headerTemplate||(je(this.parent.filterParent)?lt([this.checkAllParent],this.parent.popupWrapper):this.parent.filterParent.parentNode.insertBefore(this.checkAllParent,this.parent.filterParent.nextSibling)),E.add(this.checkAllParent,"mousedown",this.clickHandler,this)),this.parent.list.classList.contains("e-nodata")||this.parent.listData&&this.parent.listData.length<=1&&!this.parent.enableVirtualization&&!this.parent.isDynamicDataChange||this.parent.isDynamicDataChange&&this.parent.listData&&this.parent.listData.length<=1?this.checkAllParent.style.display="none":this.checkAllParent.style.display="block",this.parent.selectAllHeight=this.checkAllParent.getBoundingClientRect().height):je(this.checkAllParent)||(this.checkAllParent.parentElement.removeChild(this.checkAllParent),this.checkAllParent=null)},ZU.prototype.destroy=function(){this.removeEventListener(),E.remove(document,"mousedown",this.onDocumentClick),this.checkAllParent=null,this.clearIconElement=null,this.filterInput=null,this.filterInputObj=null,this.checkWrapper=null,this.selectAllSpan=null},ZU.prototype.listSelection=function(e){var t;t=je(e.e)?(e.li.querySelector(".e-checkbox-wrapper")||e.li.lastElementChild).childNodes[1]:(e.li.querySelector(".e-checkbox-wrapper .e-frame"),!je(e.e.target)&&e.e.target.classList.contains("e-frame")&&(!this.parent.showSelectAll||this.checkAllParent&&!this.checkAllParent.contains(e.e.target))?e.e.target:e.li.querySelector(".e-checkbox-wrapper").childNodes[1]),je(t=this.parent.itemTemplate||this.parent.enableGroupCheckBox?e.li.firstElementChild.childNodes[1]:t)||(this.checkWrapper=z(t,"."+UU)),je(this.checkWrapper)||(t=ge("."+WU,this.checkWrapper),this.validateCheckNode(this.checkWrapper,t.classList.contains(QU),e.li,e.e,!1))},ZU.prototype.validateCheckNode=function(e,t,i,n,o){this.changeState(e,t?"uncheck":"check",n,!0,o)},ZU.prototype.clickHandler=function(e){var t=e.currentTarget.classList.contains(this.checkAllParent.className)||e.currentTarget.classList.value===this.checkAllParent.className?e.currentTarget.firstElementChild.lastElementChild:e.currentTarget;this.checkWrapper=z(t,"."+UU);je(this.checkWrapper)||(t=ge("."+WU,this.checkWrapper),this.validateCheckNode(this.checkWrapper,t.classList.contains(QU),null,e,!0)),e.preventDefault()},ZU.prototype.changeState=function(e,t,i,n,o){e=e.getElementsByClassName(WU)[0];"check"!==t||e.classList.contains(QU)?"uncheck"===t&&(e.classList.contains(QU)||e.classList.contains(qU))?(q([e],[QU,qU]),o&&(this.parent.selectAllItems(!1,i),this.setLocale())):"indeterminate"!==t||e.classList.contains(qU)||(q([e],[QU]),e.classList.add(qU),o&&(this.parent.selectAllItems(!1,i),this.setLocale())):(e.classList.remove(qU),e.classList.add(QU),o&&(this.parent.selectAllItems(!0,i),this.setLocale(!0)))},ZU.prototype.setSearchBox=function(e){var t;if(je(this.parent.filterParent))return 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),t=!1,F.isDevice&&this.parent.isDeviceFullScreen&&(this.parent.mobFilter=!(t=!0)),this.filterInputObj=HF.createInput({element:this.filterInput,buttons:t?["e-input-group-icon e-back-icon e-icons",GU]:[GU],properties:{placeholder:this.parent.filterBarPlaceholder}},this.parent.createElement),je(this.parent.cssClass)||(-1!==this.parent.cssClass.split(" ").indexOf("e-outline")?U([this.filterInputObj.container],"e-outline"):-1!==this.parent.cssClass.split(" ").indexOf("e-filled")&&U([this.filterInputObj.container],"e-filled")),ht([this.filterInputObj.container],this.parent.filterParent),lt([this.parent.filterParent],e.popupElement),pt(this.filterInput,{"aria-disabled":"false",role:"combobox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-label":"multiselect","aria-expanded":"true","aria-controls":e.popupElement.id}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+YU),!F.isDevice&&this.clearIconElement&&(E.add(this.clearIconElement,"mousedown",this.clearText,this),this.clearIconElement.style.visibility="hidden"),E.add(this.filterInput,"input",this.parent.onInput,this.parent),E.add(this.filterInput,"keyup",this.parent.keyUp,this.parent),E.add(this.filterInput,"keydown",this.parent.onKeyDown,this.parent),E.add(this.filterInput,"blur",this.onBlurHandler,this),E.add(this.filterInput,"paste",this.parent.pasteHandler,this.parent),this.parent.searchBoxHeight=this.filterInputObj.container.parentElement.getBoundingClientRect().height,this.filterInputObj},ZU.prototype.clickOnBackIcon=function(e){this.parent.hidePopup(),q([document.body,this.parent.popupObj.element],XU),this.parent.inputElement.focus()},ZU.prototype.clearText=function(e){this.parent.targetInputElement.value="",this.parent.allowFiltering&&""===this.parent.targetInputElement.value&&this.parent.search(null),this.parent.refreshListItems(null),this.parent.refreshPopup(),this.clearIconElement.style.visibility="hidden",this.filterInput.focus(),(!this.parent.enableVirtualization||this.parent.enableVirtualization&&(je(this.parent.value)||this.parent.value&&0===this.parent.value.length))&&this.setReorder(e),this.boundPreventListSelection=this.preventListSelection.bind(this),this.parent.popupWrapper.addEventListener("mouseup",this.boundPreventListSelection,!0),e.preventDefault()},ZU.prototype.preventListSelection=function(e){e.stopPropagation(),this.parent.popupWrapper.removeEventListener("mouseup",this.boundPreventListSelection,!0),this.boundPreventListSelection=null},ZU.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("."+YU),this.clearIconElement.style.visibility="hidden",E.add(this.backIconElement,"click",this.clickOnBackIcon,this),E.add(this.clearIconElement,"click",this.clearText,this)},ZU.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height,t=0,i=0,n=0,e=(this.checkAllParent&&(t=this.checkAllParent.getBoundingClientRect().height),this.parent.header&&(n=this.parent.header.getBoundingClientRect().height),this.parent.footer&&(i=this.parent.footer.getBoundingClientRect().height),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%",this.parent.list.style.maxHeight=window.innerHeight-e-t-n-i+"px",this.parent.list.style.height=window.innerHeight-e-t-n-i+"px",this.filterInput.parentElement.querySelector("."+YU));G(this.filterInput),e.parentElement.insertBefore(this.filterInput,e)},ZU.prototype.setPopupFullScreen=function(){this.parent&&this.parent.popupObj&&(pt(this.parent.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),U([document.body,this.parent.popupObj.element],XU),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%")},ZU.prototype.targetElement=function(){return je(this.clearIconElement)||(this.parent.targetInputElement=this.filterInput,this.clearIconElement.style.visibility=""===this.parent.targetInputElement.value?"hidden":"visible"),this.parent.targetInputElement.value},ZU.prototype.onBlurHandler=function(e){var t;this.parent.element.classList.contains("e-listbox")||(t=void 0,this.parent.keyAction)||(F.isIE&&(t=!je(e)&&e.target),F.isIE||(t=!je(e)&&e.relatedTarget),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&this.parent.popupObj.element.contains(t)&&!F.isIE&&this.filterInput?this.filterInput.focus():this.parent.scrollFocusStatus&&this.filterInput?(e.preventDefault(),this.filterInput.focus(),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(KU),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")&&!F.isDevice&&this.parent.hidePopup()))},ZU.prototype.onDocumentClick=function(e){var t;"listbox"!==this.parent.getLocaleName()&&(t=e.target,je(this.parent.popupObj)||!z(t,'[id="'+this.parent.popupObj.element.id+'"]')||this.filterInput&&""!==this.filterInput.value||e.preventDefault(),!je(this.parent.popupObj)&&z(t,'[id="'+this.parent.popupObj.element.id+'"]')||je(this.parent.overAllWrapper)||this.parent.overAllWrapper.contains(e.target)?this.parent.scrollFocusStatus=(F.isIE||"edge"===F.info.name)&&document.activeElement===this.filterInput:(this.parent.overAllWrapper.classList.contains(_z.focus)||this.parent.isPopupOpen())&&(this.parent.inputFocus=!1,this.parent.scrollFocusStatus=!1,this.parent.hidePopup(),this.parent.onBlurHandler(e,!0),this.parent.focused=!0),je(this.parent.overAllWrapper)||this.parent.overAllWrapper.contains(e.target)||!this.parent.overAllWrapper.classList.contains("e-input-focus")||this.parent.isPopupOpen()||(F.isIE?this.parent.onBlurHandler():this.parent.onBlurHandler(e)),this.filterInput===t)&&this.filterInput.focus()},ZU.prototype.getFocus=function(e){this.parent.overAllWrapper.classList.remove(KU),this.parent.keyAction&&"clear"!==e.value&&"focus"!==e.value?this.parent.keyAction=!1:("focus"===e.value&&(this.filterInput.focus(),this.parent.removeFocus(),E.remove(this.parent.list,"keydown",this.parent.onKeyDown)),"clear"===e.value&&(this.filterInput.value="",this.clearIconElement.style.visibility="hidden"))},ZU.prototype.checkSelectAll=function(e){"check"===e.value&&(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())},ZU.prototype.setLocale=function(e){if("Select All"!==this.parent.selectAllText||"Unselect All"!==this.parent.unSelectAllText){var t=e?this.parent.unSelectAllText:this.parent.selectAllText;this.selectAllSpan.textContent="";for(var i=0,n=oo(t)({},this.parent,e?"unSelectAllText":"selectAllText",null,!this.parent.isStringTemplate);i<n.length;i++){var o=n[i];this.selectAllSpan.textContent=o.textContent}}else{t=new Cn(this.parent.getLocaleName(),{},this.parent.locale);""===t.getConstant("selectAllText")&&(t=new Cn("dropdowns",{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.parent.locale)),je(this.selectAllSpan)||(this.selectAllSpan.textContent=e?t.getConstant("unSelectAllText"):t.getConstant("selectAllText"))}},ZU.prototype.getActiveList=function(e){e.li.classList.contains("e-active")?this.activeLi.push(e.li.cloneNode(!0)):this.activeLi.splice(e.index,1)},ZU.prototype.setReorder=function(e){var t,i;this.parent.enableSelectionOrder&&!je(this.parent.value)&&(i=this.parent.ulElement.querySelectorAll("li.e-active").length,t=this.parent.createElement("ul",{className:"e-list-parent e-ul e-reorder"}),0<i&&(this.parent.ulElement.querySelectorAll("li.e-active").forEach(function(e){t.appendChild(e)}),U(this.parent.ulElement.querySelectorAll("li.e-active"),"e-reorder-hide"),this.parent.enableVirtualization?(i=this.parent.list.querySelector(".e-virtual-ddl-content"),lt([t],i)):lt([t],this.parent.list)),this.parent.focusAtFirstListItem())},ZU);function ZU(e){this.activeLi=[],this.activeEle=[],this.parent=e,this.removeEventListener(),this.addEventListener()}$U=function(e,t){return($U=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])}))(e,t)};var $U,e7,wQ=function(e,t){function i(){this.constructor=e}$U(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},bQ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},t7=(wQ(i7,e7=n),bQ([e("Multiple")],i7.prototype,"mode",void 0),bQ([e(!1)],i7.prototype,"showCheckbox",void 0),bQ([e(!1)],i7.prototype,"showSelectAll",void 0),bQ([e("Left")],i7.prototype,"checkboxPosition",void 0),i7);function i7(){return null!==e7&&e7.apply(this,arguments)||this}wQ(r7,n7=n),bQ([e([])],r7.prototype,"items",void 0),bQ([e("Right")],r7.prototype,"position",void 0);var n7,o7=r7;function r7(){return null!==n7&&n7.apply(this,arguments)||this}wQ(l7,s7=Oz),(a7=l7).prototype.addItem=function(e,t){s7.prototype.addItem.call(this,e,t),this.allowFiltering&&""!==this.filterInput.value&&this.filteringAction(this.jsonData,new ya,this.fields)},l7.prototype.render=function(){var e,t;this.isAngular&&this.allowFiltering&&(t=(e=this.element).cloneNode(!0),e.parentNode.replaceChild(t,e),this.element=t,x("ej2_instances",[this],this.element)),this.inputString="",this.initLoad=!0,this.isCustomFiltering=!1,this.initialSelectedOptions=this.value,this.inputFormName=this.element.getAttribute("name"),s7.prototype.render.call(this),this.setEnabled(),this.renderComplete()},l7.prototype.initWrapper=function(){for(var e=this.createElement("select",{className:"e-hidden-select",attrs:{multiple:""}}),t=(e.style.visibility="hidden",this.list.classList.add("e-listbox-wrapper"),this.list.querySelector(".e-list-parent").setAttribute("role","presentation"),this.list.querySelectorAll(".e-list-group-item")),i=0;i<t.length;i++)t[i].removeAttribute("tabindex"),t[i].setAttribute("role","option");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&&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(_z.focus),this.itemTemplate&&this.renderReactTemplates(),q([this.list],[_z.content,_z.root]),this.validationAttribute(this.element,e),this.list.setAttribute("role","listbox"),pt(this.list,{role:"listbox","aria-label":"listbox","aria-multiselectable":"Multiple"===this.selectionSettings.mode?"true":"false"}),this.updateSelectionSettings()},l7.prototype.updateSelectionSettings=function(){var e;this.selectionSettings.showCheckbox&&this.selectionSettings.showSelectAll&&this.liCollections.length&&(e=new Cn(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",{}))},l7.prototype.initDraggable=function(){var n=this;this.ulElement&&(this.ulElement.id=this.element.id+"_parent"),this.allowDragAndDrop&&new RH(this.ulElement,{scope:this.scope,itemClass:"e-list-item",beforeDragStart:this.triggerDragStart.bind(this),drag:this.triggerDrag.bind(this),beforeDrop:this.beforeDragEnd.bind(this),drop:this.dragEnd.bind(this),placeHolder:function(){return n.createElement("span",{className:"e-placeholder"})},helper:function(e){var t=n.list.cloneNode(),e=e.sender.cloneNode(!0),i=(t.appendChild(e),n.getItems()[0]);return t.style.width=i.offsetWidth+"px",t.style.height=i.offsetHeight+"px",1<(n.value&&n.value.length)&&n.isSelected(e)&&e.appendChild(n.createElement("span",{className:"e-list-badge",innerHTML:n.value.length+""})),t.style.zIndex=Iv(n.element)+"",t}})},l7.prototype.updateActionCompleteData=function(e,t,i){this.jsonData.splice(null===i?this.jsonData.length:i,0,t)},l7.prototype.initToolbar=function(){var e,t=this.toolbarSettings.position,i=this.element.getAttribute("data-value"),n=(this.toolbarSettings.items=je(this.toolbarSettings.items)?[]:this.toolbarSettings.items,this.toolbarSettings.items.length&&(e=this.createElement("div",{className:"e-listbox-tool",attrs:{role:"toolbar"}}),n=this.createElement("div",{className:"e-listboxtool-wrapper e-lib e-"+t.toLowerCase()}),this.list.parentElement.insertBefore(n,this.list),n.appendChild("Right"===t?this.list:e),n.appendChild("Right"===t?e:this.list),this.createButtons(e),this.element.id||(this.element.id=D("e-"+this.getModuleName())),this.scope?document.querySelector(this.scope).setAttribute("data-value",this.element.id):this.updateToolBarState()),this.element.getAttribute("data-value"));i&&n&&i!==n?(this.tBListBox=At(document.getElementById(i),this.getModuleName()),this.tBListBox.updateToolBarState()):n&&(this.tBListBox=At(document.getElementById(n),this.getModuleName()),this.tBListBox.updateToolBarState())},l7.prototype.createButtons=function(t){var i,n=this,o=new Cn(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(e){i=o.getConstant(e),i=n.createElement("button",{attrs:{type:"button","data-value":e,title:i,"aria-label":i}}),t.appendChild(i),new zv({iconCss:"e-icons e-"+e.toLowerCase()},i).createElement=n.createElement})},l7.prototype.validationAttribute=function(e,t){this.inputFormName&&e.setAttribute("name",this.inputFormName),s7.prototype.validationAttribute.call(this,e,t),t.required=e.required,e.required=!1},l7.prototype.setHeight=function(){(this.toolbarSettings.items.length?this.list.parentElement:this.list).style.height=T(this.height),(this.allowFiltering&&this.height.toString().indexOf("%")<0?U:q)([this.list],"e-filter-list")},l7.prototype.setCssClass=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.cssClass&&U([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&U([this.list],"e-rtl")},l7.prototype.setEnable=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;(this.enabled?q:U)([e],$_.disabled)},l7.prototype.showSpinner=function(){this.spinner||(this.spinner=this.createElement("div",{className:"e-listbox-wrapper"})),this.spinner.style.height=T(this.height),this.element.parentElement&&this.element.parentElement.insertBefore(this.spinner,this.element.nextSibling),mA({target:this.spinner},this.createElement),kA(this.spinner)},l7.prototype.hideSpinner=function(){this.spinner.querySelector(".e-spinner-pane")&&BA(this.spinner),this.spinner.parentElement&&G(this.spinner)},l7.prototype.onInput=function(){this.isDataSourceUpdate=!1,this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,this.refreshClearIcon()},l7.prototype.clearText=function(){this.filterInput.value="",this.refreshClearIcon();var e=document.createEvent("KeyboardEvent");this.isValidKey=!0,this.KeyUp(e)},l7.prototype.refreshClearIcon=function(){this.filterInput.parentElement.querySelector("."+h7.clearIcon)&&(this.filterInput.parentElement.querySelector("."+h7.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible")},l7.prototype.onActionComplete=function(e,t,i){var n,o,r,s,a=this;if(this.allowFiltering&&this.list.getElementsByClassName("e-filter-parent")[0]&&(n=this.list.getElementsByClassName("e-filter-parent")[0].cloneNode(!0)),0===t.length&&(s=e.childNodes[0])&&e.removeChild(s),this.allowFiltering&&(o=this.list.getElementsByClassName("e-input-filter")[0])&&(r=o.selectionStart),s7.prototype.onActionComplete.call(this,e,t,i),this.allowFiltering&&!je(n)&&(this.list.insertBefore(n,this.list.firstElementChild),this.filterParent=this.list.getElementsByClassName("e-filter-parent")[0],this.filterWireEvents(n),s=n.querySelector(".e-input-filter"))&&(s.addEventListener("focus",function(){n.childNodes[0].classList.contains("e-input-focus")||n.childNodes[0].classList.add("e-input-focus")}),s.addEventListener("blur",function(){n.childNodes[0].classList.contains("e-input-focus")&&n.childNodes[0].classList.remove("e-input-focus")})),this.initWrapper(),this.setSelection(this.value,!0,!1,!this.isRendered),this.initDraggable(),this.mainList=this.ulElement,this.initLoad)this.jsonData=[],Pe(this.jsonData,t,[]),this.initToolbarAndStyles(),this.wireEvents(),this.showCheckbox&&this.setCheckboxPosition(),this.allowFiltering&&this.setFiltering();else if(this.isDataSourceUpdate&&(this.jsonData=[],Pe(this.jsonData,t,[]),this.isDataSourceUpdate=!1),this.allowFiltering){if(je(o=this.list.getElementsByClassName("e-input-filter")[0]))return;o.selectionStart=r,o.selectionEnd=r,(""!==o.value||""===o.value&&this.isBackSpace)&&(o.focus(),setTimeout(function(){a.isBackSpace=!1}))}this.toolbarSettings.items.length&&this.scope&&-1<this.scope.indexOf("#")&&!je(i)&&(e=this.scope.replace("#",""),At(document.getElementById(e),this.getModuleName()).initToolbar()),this.initLoad=!1},l7.prototype.initToolbarAndStyles=function(){this.initToolbar(),this.setCssClass(),this.setEnable(),this.setHeight()},l7.prototype.triggerDragStart=function(t){var i,n=this,e=Pe(this.getDragArgs(t),{dragSelected:!0},{cancel:!1});F.isIos&&(this.list.style.overflow="hidden"),this.trigger("dragStart",e,function(e){n.allowDragAll=e.dragSelected,n.allowDragAll||(i=n.ulElement.getElementsByClassName("e-list-badge")[0])&&G(i),e.cancel&&(t.cancel=!0)})},l7.prototype.triggerDrag=function(e){var t,i,n=this,o=10,r=(this.itemTemplate&&e.target&&(e.target&&e.target.closest(".e-list-item")?o=e.target.closest(".e-list-item").scrollHeight:(r=e.element.querySelector(".e-list-item"))&&(o=r.scrollHeight)),e.event);this.stopTimer(),e.target&&(e.target.classList.contains("e-listbox-wrapper")||e.target.classList.contains("e-list-item")||e.target.classList.contains("e-filter-parent")||e.target.classList.contains("e-input-group")||e.target.closest(".e-list-item"))&&(i=e.target.classList.contains("e-list-item")||e.target.classList.contains("e-filter-parent")||e.target.classList.contains("e-input-group")||e.target.closest(".e-list-item")?e.target.closest(".e-listbox-wrapper"):e.target,t=this.allowFiltering?i.querySelector(".e-list-parent"):i)&&((i=t.getBoundingClientRect()).y+t.offsetHeight-(r.clientY+36)<1?this.timer=window.setInterval(function(){n.setScrollDown(t,o,!0)},70):r.clientY-36-i.y<1&&(this.timer=window.setInterval(function(){n.setScrollDown(t,o,!1)},70))),null!==e.target&&this.trigger("drag",this.getDragArgs(e))},l7.prototype.setScrollDown=function(e,t,i){e.scrollTop=i?e.scrollTop+t:e.scrollTop-t},l7.prototype.stopTimer=function(){window.clearInterval(this.timer)},l7.prototype.beforeDragEnd=function(e){this.stopTimer();var t=[];this.dragValue=this.getFormattedValue(e.droppedElement.getAttribute("data-value")),-1<this.value.indexOf(this.dragValue)?e.items=this.getDataByValues(this.value):e.items=this.getDataByValues([this.dragValue]),Pe(t,e.items),this.trigger("beforeDrop",e),JSON.stringify(e.items)!==JSON.stringify(t)&&(this.customDraggedItem=e.items)},l7.prototype.dragEnd=function(s){var a,t,o,l,h,d,p,r,c,u,g,m,f,y,v,e,i,n,b,w=this,C=this.getFormattedValue(s.droppedElement.getAttribute("data-value")),S=this.getComponent(s.droppedElement),A=this.getDragArgs({target:s.droppedElement},!0),x={previousData:this.dataSource},I={previousData:S.dataSource},A=Pe({},A,{target:s.target,source:{previousData:this.dataSource},previousIndex:s.previousIndex,currentIndex:s.currentIndex}),T=(S!==this&&(n=Pe(x,{currentData:this.listData}),A=Pe(A,{source:n,destination:I})),F.isIos&&(this.list.style.overflow=""),this.getComponent(s.target)),E=(T&&0===T.listData.length&&(b=T.ulElement.childNodes[0])&&T.ulElement.removeChild(b),S===this?(o=this.ulElement,l=[].slice.call(this.listData),h=[].slice.call(this.liCollections),d=[].slice.call(this.jsonData),p=[].slice.call(this.sortedData),r=s.currentIndex,c=s.currentIndex=this.getCurIdx(this,s.currentIndex),T=l.indexOf(this.getDataByValue(C)),b=d.indexOf(this.getDataByValue(C)),e=p.indexOf(this.getDataByValue(C)),l.splice(c,0,l.splice(T,1)[0]),p.splice(r,0,p.splice(e,1)[0]),d.splice(c,0,d.splice(b,1)[0]),h.splice(c,0,h.splice(T,1)[0]),this.allowDragAll&&(t=this.value&&-1<Array.prototype.indexOf.call(this.value,C)?this.value:[C],je(this.customDraggedItem)||(t=[],this.customDraggedItem.forEach(function(e){t.push(R(w.fields.value,e))})),t.forEach(function(e){var t,i,n;e!==C&&(t=l.indexOf(w.getDataByValue(e)),i=d.indexOf(w.getDataByValue(e)),n=p.indexOf(w.getDataByValue(e)),c<t&&c++,d.splice(c,0,d.splice(i,1)[0]),l.splice(c,0,l.splice(t,1)[0]),p.splice(r,0,p.splice(n,1)[0]),h.splice(c,0,h.splice(t,1)[0]),o.insertBefore(w.getItems()[w.getIndexByValue(e)],o.getElementsByClassName("e-placeholder")[0]))})),this.listData=l,this.jsonData=d,this.sortedData=p,this.liCollections=h):(g=[].slice.call(this.liCollections),m=s.currentIndex=this.getCurIdx(S,s.currentIndex),f=S.ulElement,l=[].slice.call(S.listData),h=[].slice.call(S.liCollections),d=[].slice.call(S.jsonData),p=[].slice.call(S.sortedData),t=this.value&&-1<Array.prototype.indexOf.call(this.value,C)&&this.allowDragAll?this.value:[C],je(this.customDraggedItem)||(t=[],this.customDraggedItem.forEach(function(e){t.push(R(w.fields.value,e))})),y=[].slice.call(this.listData),v=[].slice.call(this.sortedData),t.forEach(function(e){a=w.getDataByValue(e);var t=w.listData.indexOf(a),i=w.jsonData.indexOf(a),n=w.sortedData.indexOf(a),i=(y.splice(t,1),w.jsonData.splice(i,1),v.splice(n,1),w.listData=y,w.sortedData=v,e===C?s.currentIndex:m);if(l.splice(i,0,a),d.splice(i,0,a),p.splice(i,0,a),h.splice(i,0,g.splice(t,1)[0]),e)u=w.getItems()[w.getIndexByValue(e)];else for(var o=w.getItems(),r=0;r<o.length;r++)if(null===o[r].getAttribute("data-value")&&o[r].classList.contains("e-list-item")){u=o[r];break}u=u||s.helper,w.removeSelected(w,e===C?[s.droppedElement]:[u]),f.insertBefore(u,f.getElementsByClassName("e-placeholder")[0]),m++}),this.fields.groupBy&&(i=this.renderItems(this.listData,this.fields),this.updateListItems(i,this.ulElement),this.setSelection()),("None"!==S.sortOrder||this.selectionSettings.showCheckbox!==S.selectionSettings.showCheckbox||S.fields.groupBy||S.itemTemplate||this.itemTemplate)&&(e=At(f,"sortable"),i=S.renderItems(l,S.fields),S.updateListItems(i,f),this.setSelection(),e.placeHolderElement&&f.appendChild(e.placeHolderElement),f.appendChild(s.helper),S.setSelection()),this.liCollections=g,S.liCollections=h,S.jsonData=Pe([],[],d,!1),S.listData=Pe([],[],l,!1),"None"===S.sortOrder&&(S.sortedData=Pe([],[],p,!1)),0===this.listData.length&&this.l10nUpdate()),A=this===S?(n=Pe(x,{currentData:l}),Pe(A,{source:n})):(b=Pe(I,{currentData:l}),Pe(A,{destination:b})),je(this.customDraggedItem)||(A.items=this.customDraggedItem),this.trigger("drop",A),A.elements);if(E.length)for(var D=0;D<E.length;D++)E[D].classList.remove("e-grabbed");0<this.toolbarSettings.items.length?this.updateToolBarState():this.tBListBox&&0<this.tBListBox.toolbarSettings.items.length&&this.tBListBox.updateToolBarState()},l7.prototype.updateListItems=function(e,t){t.innerHTML="",t.append.apply(t,e.childNodes)},l7.prototype.removeSelected=function(e,t){e.selectionSettings.showCheckbox?t.forEach(function(e){e.getElementsByClassName("e-frame")[0].classList.remove("e-check")}):q(t,$_.selected)},l7.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($_.group)}).length),t},l7.prototype.getComponent=function(e){var t,e="EJS-LISTBOX"===this.element.tagName?z(e,".e-listbox"):z(e,".e-listbox-wrapper")&&z(e,".e-listbox-wrapper").querySelector(".e-listbox");return t=e?At(e,this.getModuleName()):t},l7.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},l7.prototype.listOption=function(e,t){return this.listCurrentOptions=s7.prototype.listOption.call(this,e,t),this.listCurrentOptions=Pe({},this.listCurrentOptions,{itemCreated:this.triggerBeforeItemRender.bind(this)},!0),this.notify("listoption",{module:"CheckBoxSelection"}),this.listCurrentOptions},l7.prototype.triggerBeforeItemRender=function(e){e.item.setAttribute("tabindex","-1"),this.trigger("beforeItemRender",{element:e.item,item:e.curData})},l7.prototype.requiredModules=function(){var e=[];return this.selectionSettings.showCheckbox&&e.push({member:"CheckBoxSelection",args:[this]}),e},l7.prototype.enableItems=function(e,t,i){var n,o,r=this;void 0===t&&(t=!0),e.forEach(function(e){(n=r.findListElement(r.list,"li","data-value",i?e:r.getValueByText(e)))&&(t?(q([n],$_.disabled),n.removeAttribute("aria-disabled")):(U([n],$_.disabled),n.setAttribute("aria-disabled","true")))}),this.allowFiltering&&this.filterInput&&""!==this.filterInput.value&&0<this.toolbarSettings.items.length&&(o=!1,this.ulElement.childNodes.forEach(function(e){e.classList.contains("e-disabled")||(o=!0)}),o||(this.list.parentElement.getElementsByClassName("e-listbox-tool")[0].querySelector('[data-value="moveAllTo"]').disabled=!0))},l7.prototype.selectItems=function(e,t,i){(t=void 0===t?!0:t)&&!this.selectionSettings.showCheckbox&&"Single"===this.selectionSettings.mode&&this.getSelectedItems().forEach(function(e){e.classList.remove("e-active"),e.removeAttribute("aria-selected"),q([e],$_.selected)}),this.setSelection(e,t,!i),this.updateSelectedOptions();for(var n=[],o=0;o<e.length;o++)for(var r=this.list.querySelectorAll('[aria-selected="true"]'),s=0;s<r.length;s++)e[o]===this.getFormattedValue(r[s].getAttribute("data-value"))&&n.push(r[s]);this.triggerChange(n,null)},l7.prototype.selectAll=function(e){this.selectAllItems(e=void 0===e?!0:e)},l7.prototype.addItems=function(e,t){s7.prototype.addItem.call(this,e,t),this.allowFiltering&&""!==this.filterInput.value&&this.filteringAction(this.jsonData,new ya,this.fields)},l7.prototype.removeItems=function(e,t){this.removeItem(e,t)},l7.prototype.removeItem=function(e,t){var i=this,n=[],o=this.list.querySelectorAll("."+_z.li);if(e){e=e instanceof Array?e:[e];for(var r=this.fields,s={},a=[],l=(Pe(a,[],this.jsonData),[]),h=[],d=0;d<a.length;d++)s[a[d]instanceof Object?a[d][r.value]:a[d].toString()]=d;for(var p=0;p<e.length;p++){var c=e[p]instanceof Object?e[p][r.value]:e[p].toString();Object.prototype.hasOwnProperty.call(s,c)&&(n.push(o[c=s[c]]),l.push(c),h.push(c))}l.sort(function(e,t){return t-e}).forEach(function(e){i.listData.splice(e,1),i.jsonData.splice(e,1)});for(var u=h.length-1;0<=u;u--)this.updateLiCollection(h[u])}else n.push(o[t=t||0]),this.listData.splice(t,1),this.jsonData.splice(t,1),this.updateLiCollection(t);for(d=0;d<n.length;d++)this.ulElement.removeChild(n[d]);0===this.listData.length&&this.l10nUpdate(),this.listData.length!==this.sortedData.length&&(this.sortedData=this.listData),this.value=[],this.updateToolBarState()},l7.prototype.getDataByValues=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getDataByValue(e[i]));return t},l7.prototype.moveUp=function(e){e=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,e)},l7.prototype.moveDown=function(e){e=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!1,!1,e)},l7.prototype.moveTop=function(e){e=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(null,!1,e,!0)},l7.prototype.moveBottom=function(e){e=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,e,!1,!0)},l7.prototype.moveTo=function(e,t,i){e=e?this.getElemByValue(e):this.getSelectedItems(),i=i?At(i,a7):this.getScopedListBox();this.moveData(this,i,!1,e,t)},l7.prototype.moveAllTo=function(e,t){this.toolbarAction="moveAllTo",0<this.listData.length&&(e=e?At(e,a7):this.getScopedListBox(),this.moveAllData(this,e,!1,t))},l7.prototype.getDataList=function(){return this.jsonData},l7.prototype.getSortedList=function(){var e;if(t=e=this.sortedData,this.fields.groupBy)for(var t=[],i=0;i<e.length;i++)e[i].isHeader||t.push(e[i]);return t},l7.prototype.getElemByValue=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.ulElement.querySelector('[data-value ="'+e[i]+'"]'));return t},l7.prototype.updateLiCollection=function(e){var t=[].slice.call(this.liCollections);t.splice(e,1),this.liCollections=t},l7.prototype.selectAllItems=function(i,e){var n=this;if([].slice.call(this.getItems()).forEach(function(e){var t;e.classList.contains($_.disabled)||(n.selectionSettings.showCheckbox?(!(t=e.getElementsByClassName("e-check")[0])&&i||t&&!i)&&(n.notify("updatelist",{li:e,module:"listbox"}),n.maximumSelectionLength>=n.list.querySelectorAll(".e-list-item span.e-check").length)&&n.checkMaxSelection():i?e.classList.add($_.selected):e.classList.remove($_.selected))}),this.updateSelectedOptions(),this.allowFiltering&&this.selectionSettings.showCheckbox){var o=this.list.getElementsByTagName("li"),r=0;if(i)for(var s=this,r=0;r<o.length;r++)!function(){var t=s.getFormattedValue(o[r].getAttribute("data-value"));s.value.some(function(e){return e===t})||s.value.push(s.getFormattedValue(o[r].getAttribute("data-value")))}();else{var a=this;for(r=0;r<o.length;r++)!function(){var t=a.getFormattedValue(o[r].getAttribute("data-value"));a.value=a.value.filter(function(e){return e!==t})}()}document.querySelectorAll("ul").length<2&&this.updateMainList()}this.triggerChange(this.getSelectedItems(),e)},l7.prototype.updateMainList=function(){var e=this.mainList.querySelectorAll(".e-list-item"),t=this.ulElement.querySelectorAll(".e-list-item"),i=e.length,n=t.length;if(this.selectionSettings.showCheckbox||1<document.querySelectorAll("ul").length||i!==n)for(var o=0,r=0,s=0;o<i;){if(this.value)for(;r<this.value.length;r++)e[o].getAttribute("data-value")===this.value[r]&&s++;!s&&this.selectionSettings.showCheckbox&&e[o].getElementsByClassName("e-frame")[0].classList.remove("e-check"),1<document.querySelectorAll("ul").length&&s&&i!==n?(this.mainList.removeChild(this.mainList.getElementsByTagName("li")[o]),o=0):o++,r=s=0}},l7.prototype.wireEvents=function(){var e=z(this.element,"form"),t="EJS-LISTBOX"===this.element.tagName?this.element:this.list;E.add(this.list,"click",this.clickHandler,this),E.add(t,"keydown",this.keyDownHandler,this),E.add(t,"focusout",this.focusOutHandler,this),this.wireToolbarEvent(),this.selectionSettings.showCheckbox&&E.remove(document,"mousedown",this.checkBoxSelectionModule.onDocumentClick),(this.fields.groupBy||this.element.querySelector("select>optgroup"))&&E.remove(this.list,"scroll",this.setFloatingHeader),e&&E.add(e,"reset",this.formResetHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this))},l7.prototype.wireToolbarEvent=function(){this.toolbarSettings.items.length&&E.add(this.getToolElem(),"click",this.toolbarClickHandler,this)},l7.prototype.unwireEvents=function(){var e=z(this.element,"form"),t="EJS-LISTBOX"===this.element.tagName?this.element:this.list;E.remove(this.list,"click",this.clickHandler),E.remove(t,"keydown",this.keyDownHandler),E.remove(t,"focusout",this.focusOutHandler),this.allowFiltering&&this.clearFilterIconElem&&E.remove(this.clearFilterIconElem,"click",this.clearText),this.toolbarSettings.items.length&&E.remove(this.getToolElem(),"click",this.toolbarClickHandler),e&&E.remove(e,"reset",this.formResetHandler),window.removeEventListener("resize",this.resizeHandler.bind(this))},l7.prototype.clickHandler=function(e){je(z(e.target,".e-list-item"))||this.selectHandler(e)},l7.prototype.checkSelectAll=function(){for(var e=0,t=this.list.querySelectorAll("li."+_z.li),i=0;i<t.length;i++)t[i].classList.contains("e-disabled")||e++;var n=this.getSelectedItems().length;this.showSelectAll&&e&&this.notify("checkSelectAll",{module:"CheckBoxSelection",value:e===n?"check":0===n?"uncheck":"indeterminate"})},l7.prototype.getQuery=function(e){var t,i,n=e?e.clone():this.query?this.query.clone():new ya;return this.allowFiltering?(t=""===this.inputString?"contains":this.filterType,null===(i=this.typeOfData(this.dataSource).typeof)&&(i=this.typeOfData(this.jsonData).typeof),(this.dataSource instanceof me||"string"!==i)&&"number"!==i?(i=this.fields.text||"",n.where(i,t,this.inputString,this.ignoreCase,this.ignoreAccent)):n.where("",t,this.inputString,this.ignoreCase,this.ignoreAccent)):n=e||this.query||new ya,n},l7.prototype.setFiltering=function(){var e;if(this.initLoad||je(this.filterParent))return this.filterParent=this.createElement("span",{className:h7.filterParent}),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:h7.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element),ht([(e=HF.createInput({element:this.filterInput,buttons:[h7.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement)).container],this.filterParent),lt([this.filterParent],this.list),pt(this.filterInput,{"aria-disabled":"false","aria-label":"search list item",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox"}),this.height.toString().indexOf("%")<0?U([this.list],"e-filter-list"):0<this.height.toString().indexOf("%")&&(this.ulElement.style.height=this.ulElement.offsetHeight-this.filterParent.offsetHeight+"px"),this.inputString=this.filterInput.value,this.filterWireEvents(),this.ulElement.style.setProperty("height","calc(100% - "+this.filterParent.offsetHeight+"px)","important"),e},l7.prototype.filterWireEvents=function(e){e&&(this.filterInput=e.querySelector(".e-input-filter")),this.clearFilterIconElem=this.filterInput.parentElement.querySelector("."+h7.clearIcon),this.clearFilterIconElem&&(E.add(this.clearFilterIconElem,"click",this.clearText,this),e||(this.clearFilterIconElem.style.visibility="hidden")),E.add(this.filterInput,"input",this.onInput,this),E.add(this.filterInput,"keyup",this.KeyUp,this),E.add(this.filterInput,"keydown",this.onKeyDown,this)},l7.prototype.selectHandler=function(e,t){var i,n,o=!0,r=z(e.target,".e-list-item"),s=[r];r&&r.parentElement&&(n=[].slice.call(r.parentElement.children).indexOf(r),this.selectionSettings.showCheckbox?o=!r.getElementsByClassName("e-frame")[0].classList.contains("e-check"):(e.ctrlKey||e.metaKey||F.isDevice)&&this.isSelected(r)?(r.classList.remove($_.selected),r.removeAttribute("aria-selected"),o=!1):"Multiple"===this.selectionSettings.mode&&(e.ctrlKey||e.metaKey||F.isDevice)||(this.getSelectedItems().forEach(function(e){e.removeAttribute("aria-selected")}),q(this.getSelectedItems(),$_.selected)),e.shiftKey&&!this.selectionSettings.showCheckbox&&"Single"!==this.selectionSettings.mode?s=[].slice.call(r.parentElement.children).slice(Math.min(n,this.prevSelIdx),Math.max(n,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||U(s,$_.selected),s.forEach(function(e){e.setAttribute("aria-selected","true")}),this.list.setAttribute("aria-activedescendant",r.id)):s.forEach(function(e){e.setAttribute("aria-selected","false")}),t||!(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&&!t&&(i=this.getFormattedValue(r.getAttribute("data-value")),o?(Pe(n=[],this.value),n.push(i),this.value=n):this.value=this.value.filter(function(e){return e!==i}),document.querySelectorAll("ul").length<2)&&this.updateMainList(),this.updateSelectedOptions(),this.triggerChange(this.getSelectedItems(),e),this.list)&&this.checkMaxSelection()},l7.prototype.triggerChange=function(e,t){this.trigger("change",{elements:e,items:this.getDataByElements(e),value:this.value,event:t})},l7.prototype.getDataByElems=function(e){for(var t=[],i=e.length,n=0;n<i;n++){var o=e[n].getAttribute("data-value"),o=this.getFormattedValue(o);t.push(this.getDataByValue(o))}return t},l7.prototype.getDataByElements=function(e){var t,i=[],n=0;if(je(this.listData))return null;var o=this.typeOfData(this.listData).typeof;if("string"===o||"number"===o||"boolean"===o)for(var r=0,s=this.listData;r<s.length;r++){for(var a=s[r],l=n,h=e.length;l<h;l++)if(t=this.getFormattedValue(e[l].getAttribute("data-value")),!je(a)&&a===t){n=l,i.push(a);break}if(e.length===i.length)break}else for(var d=0,p=this.listData;d<p.length;d++){for(a=p[d],l=n,h=e.length;l<h;l++)if(t=this.getFormattedValue(e[l].getAttribute("data-value")),!je(a)&&R(this.fields.value||"value",a)===t){n=l,i.push(a);break}if(e.length===i.length)break}return i},l7.prototype.checkMaxSelection=function(){var e=this.list.querySelectorAll(".e-list-item span.e-check").length;if(this.selectionSettings.showCheckbox)for(var t=0,i=this.list.getElementsByClassName("e-list-item");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"))},l7.prototype.toolbarClickHandler=function(e){e=z(e.target,"button");if(e&&(this.toolbarAction=e.getAttribute("data-value"),!e.disabled))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})}},l7.prototype.moveUpDown=function(n,e,t,o,r){var i,s=this,a=this.getSelectedItems();t&&(a=t),(n&&this.isSelected(this.ulElement.firstElementChild)||!n&&this.isSelected(this.ulElement.lastElementChild))&&!t||(i={cancel:!1,items:t=this.getDataByElems(a),eventName:this.toolbarAction},this.trigger("actionBegin",i),i.cancel)||((n?a:a.reverse()).forEach(function(e){var t=Array.prototype.indexOf.call(s.ulElement.querySelectorAll(".e-list-item"),e),i=Array.prototype.indexOf.call(s.ulElement.children,e);o?(NH(s.ulElement,s.ulElement,[i],0),s.changeData(i,0,t,e)):r?(NH(s.ulElement,s.ulElement,[i],s.ulElement.querySelectorAll(".e-list-item").length),s.changeData(i,s.ulElement.querySelectorAll(".e-list-item").length,t,e)):(NH(s.ulElement,s.ulElement,[i],n?i-1:i+2),s.changeData(i,n?i-1:i+1,n?t-1:t+1,e))}),this.trigger("actionComplete",{items:t,eventName:this.toolbarAction}),a[0].focus(),!e&&this.toolbarSettings.items.length&&this.getToolElem().querySelector("[data-value="+(n?"moveUp":"moveDown")+"]").focus(),this.updateToolBarState())},l7.prototype.moveItemTo=function(){this.moveData(this,this.getScopedListBox())},l7.prototype.moveItemFrom=function(){this.moveData(this.getScopedListBox(),this)},l7.prototype.moveData=function(i,e,t,n,o){var r=[],s=[],a=[],l=[],h=[].slice.call(i.listData),d=[].slice.call(e.listData),p=[].slice.call(i.sortedData),c=[].slice.call(e.sortedData),u=[].slice.call(i.liCollections),g=[],m=[].slice.call(e.liCollections),f=[],y=[],v=i.getSelectedItems(),n=(n&&(v=n),"None"!==e.sortOrder||e.selectionSettings.showCheckbox!==i.selectionSettings.showCheckbox||e.fields.groupBy||e.itemTemplate||i.itemTemplate);if(i.value=[],v.length){this.removeSelected(i,v);var b,w=Array.prototype.slice.call(i.ulElement.children),C=Array.prototype.slice.call(i.ulElement.querySelectorAll(".e-list-item")),S=i.listData,A=i.sortedData,x=i.jsonData,I={};if(199<v.length)for(var T=0,E=i.listData;T<E.length;T++){var D,M=E[T];je(M)||(D=i.getFormattedValue(R(i.fields.value||"value",M)),I[D]=M)}v.forEach(function(e){var t;b=v.length<200?i.getDataByElems([e])[0]:(t=e.getAttribute("data-value"),t=i.getFormattedValue(t),I[t]),r.push(w.indexOf(e)),g.push(C.indexOf(e)),s.push(S.indexOf(b)),l.push(A.indexOf(b)),a.push(x.indexOf(b))}),"None"!==this.sortOrder?l.forEach(function(e){f.push(i.sortedData[e])}):a.forEach(function(e){f.push(i.jsonData[e])});var k={cancel:!1,items:f,eventName:this.toolbarAction};if(i.trigger("actionBegin",k),k.cancel)return;var P=[],B=(g.sort(function(e,t){return e-t}).reverse().forEach(function(e){P.push(u.splice(e,1)[0])}),i.liCollections=u,o?(k=m.splice(0,o),e.liCollections=k.concat(P.reverse()).concat(m)):e.liCollections=m.concat(P.reverse()),0===e.listData.length&&(k=e.ulElement.childNodes[0])&&e.ulElement.removeChild(k),s.sort(function(e,t){return t-e}).forEach(function(e){h.splice(e,1)[0]}),l.sort(function(e,t){return t-e}).forEach(function(e){p.splice(e,1)[0]}),a.slice().reverse().forEach(function(e){y.push(i.jsonData.splice(e,1)[0])}),n?i.fields.groupBy?(F=i.renderItems(h,i.fields),i.updateListItems(F,i.ulElement)):v.forEach(function(e){G(e)}):(NH(i.ulElement,e.ulElement,r,o),i.trigger("actionComplete",{items:f,eventName:this.toolbarAction})),e.mainList.childElementCount!==e.jsonData.length&&(e.mainList=e.ulElement),[].slice.call(e.jsonData)),c=[].slice.call(e.sortedData);this.selectNextList(v,g,s,i),t&&this.list.focus(),i.listData=h,i.sortedData=p,o=o||d.length;for(var F,L=f.length-1;0<=L;L--)d.splice(o,0,f[L]),B.splice(o,0,f[L]),c.splice(o,0,f[L]);e.listData=d,e.jsonData=B,e.sortedData=c,n&&(F=e.renderItems(d,e.fields),e.updateListItems(F,e.ulElement),e.setSelection(),i.trigger("actionComplete",{items:f,eventName:this.toolbarAction})),i.updateSelectedOptions(),0===i.listData.length&&i.l10nUpdate()}1===i.value.length&&i.getSelectedItems().length&&(i.value[0]=i.getFormattedValue(i.getSelectedItems()[0].getAttribute("data-value"))),i.liCollections.length===i.ulElement.querySelectorAll(".e-disabled").length&&this.toolbarAction&&(m=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0],k="moveFrom"===this.toolbarAction?"moveAllFrom":"moveAllTo",m)&&(m.querySelector('[data-value="'+k+'"]').disabled=!0)},l7.prototype.selectNextList=function(e,t,i,n){var o=n.ulElement.querySelectorAll(".e-list-item").length;1===e.length&&o&&!n.selectionSettings.showCheckbox&&(e=o<=t[0]?o-1:t[0],t=n.ulElement.querySelectorAll(".e-list-item")[e],-1<(t=n.getValidIndex(t,e,o===i[0]?38:40)))&&n.ulElement.querySelectorAll(".e-list-item")[t].classList.add($_.selected)},l7.prototype.moveAllItemTo=function(){this.moveAllData(this,this.getScopedListBox())},l7.prototype.moveAllItemFrom=function(){this.moveAllData(this.getScopedListBox(),this)},l7.prototype.moveAllData=function(e,t,i,n){var o=[].slice.call(t.listData),r=[].slice.call(t.jsonData),s="None"!==t.sortOrder||t.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||t.fields.groupBy||t.itemTemplate||e.itemTemplate,a=[],l=[],h=[],d=(this.removeSelected(e,e.getSelectedItems()),[].slice.call(e.listData)),p={cancel:!1,items:d,eventName:this.toolbarAction};if(e.trigger("actionBegin",p),!p.cancel){0===t.listData.length&&(p=t.ulElement.childNodes[0])&&t.ulElement.removeChild(p),0<e.listData.length&&(h=Array.apply(null,{length:e.ulElement.childElementCount}).map(Number.call,Number));for(var c=e.ulElement.childNodes,u=e.ulElement.childElementCount,g=[],m=0;m<u;m++){var f=c[m];f.classList.contains("e-disabled")?(a.push(f),null!=this.sortOrder?l.push(e.sortedData[m]):l.push(e.listData[m])):g.push(m)}NH(e.ulElement,t.ulElement,h=g,n),e.trigger("actionComplete",{items:d,eventName:this.toolbarAction}),i&&this.list.focus(),n=n||o.length;for(m=0;m<h.length;m++)null!=this.sortOrder?o.splice(n+m,0,e.sortedData[h[m]]):o.splice(n+m,0,e.listData[h[m]]);for(m=0;m<h.length;m++)r.splice(n+m,0,e.jsonData[h[m]]);for(var p=[],d=(0<a.length?(e.liCollections=a,p=[].slice.call(e.liCollections)):(p=[].slice.call(e.liCollections),e.liCollections=[]),[].slice.call(t.liCollections)),y=(n?(i=d.splice(0,n),t.liCollections=i.concat(p).concat(d)):t.liCollections=d.concat(p),e.value=[],(o=(o=o.filter(function(e){return void 0!==e})).filter(function(e){return!0!==e.isHeader})).filter(function(e){return-1===t.jsonData.indexOf(e)})),m=0;m<y.length;m++)t.jsonData.splice(n+m,0,y[m]);if(t.listData=o,e.listData.length===e.jsonData.length)e.listData=e.sortedData=e.jsonData=l;else if(e.allowFiltering){var v=[];if(0<a.length){for(m=0;m<a.length;m++)v.push(e.getDataByValue(a[m].getAttribute("data-value")));e.listData=e.listData.filter(function(t){return!v.some(function(e){return t===e})})}for(m=0;m<e.listData.length;m++)for(var b=0;b<e.jsonData.length;b++)e.listData[m]===e.jsonData[b]&&e.jsonData.splice(b,1);0<a.length?(e.listData=v,e.sortedData=[]):e.listData=e.sortedData=[]}s?(i=t.renderItems(o,t.fields),t.updateListItems(i,t.ulElement)):t.sortedData=o,e.updateSelectedOptions(),0<a.length&&(this.list.parentElement.getElementsByClassName("e-listbox-tool")[0].querySelector('[data-value="'+this.toolbarAction+'"]').disabled=!0),0===e.listData.length&&0===a.length&&e.l10nUpdate()}},l7.prototype.changeData=function(e,t,i,n){var o=[].slice.call(this.listData),r=[].slice.call(this.jsonData),s=[].slice.call(this.sortedData),a=Array.prototype.indexOf.call(this.jsonData,this.getDataByElems([n])[0]),n=Array.prototype.indexOf.call(this.sortedData,this.getDataByElems([n])[0]),l=[].slice.call(this.liCollections);o.splice(t,0,o.splice(e,1)[0]),r.splice(i,0,r.splice(a,1)[0]),s.splice(t,0,s.splice(n,1)[0]),l.splice(t,0,l.splice(e,1)[0]),this.listData=o,this.jsonData=r,this.liCollections=l,this.sortedData=s},l7.prototype.getSelectedItems=function(){var t=[];return this.selectionSettings.showCheckbox?[].slice.call(this.ulElement.getElementsByClassName("e-check")).forEach(function(e){t.push(z(e,".e-list-item"))}):t=[].slice.call(this.ulElement.getElementsByClassName($_.selected)),t},l7.prototype.getScopedListBox=function(){var t,i=this;return this.scope&&[].slice.call(document.querySelectorAll(this.scope)).forEach(function(e){At(e,i.getModuleName())&&(t=At(e,i.getModuleName()))}),t},l7.prototype.getGrabbedItems=function(e){for(var t=!1,i=0;i<this.value.length;i++)if(this.value[i]===this.getFormattedValue(e.target.getAttribute("data-value"))){t=!0;break}if(t)for(i=0;i<this.value.length;i++)for(var n=this.list.querySelectorAll('[aria-selected="true"]'),o=0;o<n.length;o++)this.value[i]===this.getFormattedValue(n[o].getAttribute("data-value"))&&n[o].classList.add("e-grabbed");return this.isAngular?Array.prototype.slice.call(this.element.getElementsByClassName("e-list-parent")[0].querySelectorAll(".e-grabbed")):Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll(".e-grabbed"))},l7.prototype.getDragArgs=function(e,t){var i=this.getGrabbedItems(e);return i.length?t&&i.push(e.target):i=[e.target],{elements:i,event:e.event,items:this.getDataByElems(i)}},l7.prototype.onKeyDown=function(e){this.keyDownHandler(e),e.stopPropagation()},l7.prototype.keyDownHandler=function(e){var t;-1<[32,35,36,37,38,39,40,65].indexOf(e.keyCode)&&(!this.allowFiltering||this.allowFiltering&&e.target!==this.filterInput)?e.target&&-1<e.target.className.indexOf("e-edit-template")||(e.preventDefault(),32===e.keyCode&&this.ulElement.children.length?this.selectHandler({target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey}):65===e.keyCode&&e.ctrlKey&&"Multiple"===this.selectionSettings.mode?this.selectAll():(38===e.keyCode||40===e.keyCode)&&e.ctrlKey&&e.shiftKey?this.moveUpDown(38===e.keyCode,!0):!this.toolbarSettings.items.length&&!this.tBListBox||39!==e.keyCode&&37!==e.keyCode||!e.ctrlKey?37!==e.keyCode&&39!==e.keyCode&&"KeyA"!==e.code&&this.upDownKeyHandler(e):(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))):!this.allowFiltering||40!==e.keyCode&&38!==e.keyCode||this.upDownKeyHandler(e)},l7.prototype.upDownKeyHandler=function(e){var t=this.ulElement,i=40===e.keyCode||36===e.keyCode?0:t.childElementCount-1,n=t.getElementsByClassName("e-focused")[0]||t.getElementsByClassName($_.selected)[0];if(n){if(35!==e.keyCode&&36!==e.keyCode&&(i=Array.prototype.indexOf.call(t.children,n),40===e.keyCode?i++:i--,i<0||i>t.childElementCount-1))return;q([n],"e-focused")}var o=t.children[i];if(o)if(-1===(i=this.getValidIndex(o,i,e.keyCode)))U([n],"e-focused");else if(t.children[i].focus(),t.children[i].classList.add("e-focused"),e.ctrlKey&&(this.selectionSettings.showCheckbox||!e.shiftKey||36!==e.keyCode&&35!==e.keyCode)||this.selectHandler({target:t.children[i],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},!0),this.selectionSettings.showCheckbox&&e.ctrlKey&&e.shiftKey&&(36===e.keyCode||35===e.keyCode))for(var o=Array.prototype.indexOf.call(t.children,n),i="Home"===e.code?0:o,r="Home"===e.code?o:t.children.length-1,s=i;s<=r;s++){var a=t.children[s];this.notify("updatelist",{li:a,e:{target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},module:"listbox"})}},l7.prototype.KeyUp=function(e){var t,i,n,o=this;this.allowFiltering&&e.ctrlKey&&65===e.keyCode?e.preventDefault():(t=(i=String.fromCharCode(e.keyCode)).match(/\w/),i=i.match(/[A-Za-z0-9\u00C0-\u024F ]/),je(t)&&je(i)||(this.isValidKey=!0),this.isBackSpace=8===e.keyCode,this.isValidKey=8===e.keyCode||46===e.keyCode||this.isValidKey,this.isValidKey&&(this.isValidKey=!1,e.keyCode,this.allowFiltering)&&(n={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,t,i){n.cancel||(o.isFiltered=!0,o.remoteFilterAction=!0,o.preventDefActionFilter=n.preventDefaultAction,o.dataUpdater(e,t,i),o.preventDefActionFilter=!1)},event:e,cancel:!1},this.trigger("filtering",n,function(e){o.isDataFetched=!1,e.cancel||""!==o.filterInput.value&&o.isFiltered||(o.preventDefActionFilter=!1,e.cancel||o.isCustomFiltering||e.preventDefaultAction||(o.inputString=o.filterInput.value,o.filteringAction(o.jsonData,new ya,o.fields),0<o.toolbarSettings.items.length&&o.updateToolBarState()),o.isFiltered)||o.isCustomFiltering||e.preventDefaultAction||o.dataUpdater(o.jsonData,new ya,o.fields)})))},l7.prototype.filter=function(e,t,i){this.isCustomFiltering=!0,this.filteringAction(e,t,i)},l7.prototype.filteringAction=function(e,t,i){this.resetList(e,i,t)},l7.prototype.targetElement=function(){return this.targetInputElement=this.list.getElementsByClassName("e-input-filter")[0],je(this.targetInputElement)?null:this.targetInputElement.value},l7.prototype.dataUpdater=function(e,t,i){var n;this.isDataFetched=!1,this.targetElement()&&""===this.targetElement().trim()?(n=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.remoteCustomValue=!1,this.isAngular&&this.itemTemplate&&(n=this.renderItems(this.listData,i)),this.onActionComplete(n,this.jsonData),this.notify("reOrder",{module:"CheckBoxSelection",enable:this.selectionSettings.showCheckbox,e:this})):this.resetList(e,i,t)},l7.prototype.focusOutHandler=function(){var e=this.list.getElementsByClassName("e-focused")[0];e&&e.classList.remove("e-focused"),this.allowFiltering&&this.refreshClearIcon()},l7.prototype.resizeHandler=function(){!this.list||this.cssClass&&-1<this.cssClass.indexOf("e-horizontal-listbox")||0<this.list.getElementsByClassName("e-filter-parent").length&&this.allowFiltering&&this.ulElement.style.setProperty("height","calc(100% - "+this.filterParent.offsetHeight+"px)","important")},l7.prototype.getValidIndex=function(e,t,i){var n=this.ulElement;return(e.classList.contains("e-disabled")||e.classList.contains($_.group))&&(40===i||36===i?t++:t--),t<0||t===n.childElementCount?-1:(e=n.childNodes[t]).classList.contains("e-disabled")||e.classList.contains($_.group)?this.getValidIndex(e,t,i):t},l7.prototype.updateSelectedOptions=function(){var t=this,i=[],e=[];if(Pe(e,this.value),this.getSelectedItems().forEach(function(e){e.classList.contains("e-grabbed")||i.push(t.getFormattedValue(e.getAttribute("data-value")))}),this.mainList.childElementCount===this.ulElement.childElementCount)if(this.allowFiltering&&this.selectionSettings.showCheckbox){for(var n=0;n<i.length;n++)-1<e.indexOf(i[n])||e.push(i[n]);this.setProperties({value:e},!0)}else this.setProperties({value:i},!0);this.updateSelectTag(),this.updateToolBarState(),this.tBListBox&&this.tBListBox.updateToolBarState()},l7.prototype.clearSelection=function(t){var i,n=this;void 0===t&&(t=this.value),this.selectionSettings.showCheckbox&&this.getSelectedItems().forEach(function(e){i=n.getFormattedValue(e.getAttribute("data-value")),t.indexOf(i)<0&&(e.getElementsByClassName("e-check")[0].classList.remove("e-check"),e.removeAttribute("aria-selected"))})},l7.prototype.setSelection=function(e,t,i,n){var o,r,s=this;void 0===e&&(e=this.value),void 0===t&&(t=!0),void 0===i&&(i=!1),void 0===n&&(n=!0),e&&e.forEach(function(e){e=i?s.getValueByText(e):e;(o="string"==typeof e?(e=e.split("\\").join("\\\\"),s.list.querySelector('[data-value="'+e.replace(/"/g,'\\"')+'"]')):s.list.querySelector('[data-value="'+e+'"]'))&&(r=s.selectionSettings.showCheckbox&&!o.classList.contains("e-disabled")?o.getElementsByClassName("e-frame")[0].classList.contains("e-check"):o.classList.contains("e-selected"),!t&&r||t&&!r&&o)&&(s.selectionSettings.showCheckbox&&!o.classList.contains("e-disabled")?(s.notify("updatelist",{li:o,module:"listbox"}),n&&o.focus()):t&&!o.classList.contains("e-disabled")?(o.classList.add($_.selected),o.setAttribute("aria-selected","true"),n&&o.focus()):(o.classList.remove($_.selected),o.removeAttribute("aria-selected")))}),this.updateSelectTag()},l7.prototype.updateSelectTag=function(){var e=this.getSelectTag(),t="";if(!je(e)){if(e.innerHTML="",this.value){for(var i=0,n=this.value.length;i<n;i++)t+="<option selected>"+this.value[i]+"</option>";e.innerHTML+=t;for(i=0,n=e.childNodes.length;i<n;i++)e.childNodes[i].setAttribute("value",this.value[i].toString())}this.checkSelectAll()}},l7.prototype.checkDisabledState=function(e){return je(e.ulElement)?!(!je(this.dataSource)&&je(this.dataSource.length)):0<e.ulElement.querySelectorAll(".e-disabled").length?e.liCollections.length===e.ulElement.querySelectorAll(".e-disabled").length:0===e.ulElement.querySelectorAll("."+$_.li).length},l7.prototype.updateToolBarState=function(){var i,n,o=this;this.toolbarSettings.items.length&&(i=this.getScopedListBox(),n=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0],this.toolbarSettings.items.forEach(function(e){var t=n.querySelector('[data-value="'+e+'"]');switch(e){case"moveAllTo":t.disabled=o.checkDisabledState(o);break;case"moveAllFrom":t.disabled=o.checkDisabledState(i);break;case"moveFrom":t.disabled=!i.value||!i.value.length;break;case"moveUp":t.disabled=!(o.value&&o.value.length&&!o.isSelected(o.ulElement.children[0]));break;case"moveDown":t.disabled=!(o.value&&o.value.length&&!o.isSelected(o.ulElement.children[o.ulElement.childElementCount-1]));break;default:t.disabled=!o.value||!o.value.length}}))},l7.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")},l7.prototype.showCheckbox=function(e){var t=0,i=this.list.lastElementChild.querySelectorAll("li"),n=this.list.lastElementChild.getElementsByClassName("e-list-item").length;if(e)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]&&(e=new Cn(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",{}),this.checkSelectAll());else{for(this.list.getElementsByClassName("e-selectall-parent")[0]&&this.list.removeChild(this.list.getElementsByClassName("e-selectall-parent")[0]);t<n;t++)i[t].classList.contains("e-list-item")&&i[t].removeChild(i[t].getElementsByClassName("e-checkbox-wrapper")[0]),i[t].hasAttribute("aria-selected")&&i[t].removeAttribute("aria-selected");this.mainList=this.ulElement}this.value=[]},l7.prototype.isSelected=function(e){return!je(e)&&(e.classList.contains($_.selected)||null!==e.querySelector(".e-check"))},l7.prototype.getSelectTag=function(){return this.list.getElementsByClassName("e-hidden-select")[0]},l7.prototype.getToolElem=function(){return this.list.parentElement.getElementsByClassName("e-listbox-tool")[0]},l7.prototype.formResetHandler=function(){this.value=this.initialSelectedOptions},l7.prototype.getModuleName=function(){return"listbox"},l7.prototype.getPersistData=function(){return this.addOnPersist(["value"])},l7.prototype.getLocaleName=function(){return"listbox"},l7.prototype.destroy=function(){this.unwireEvents(),"EJS-LISTBOX"===this.element.tagName?this.element.innerHTML="":(this.element.style.display="inline-block",this.toolbarSettings.items.length&&(this.list.parentElement.parentElement.insertBefore(this.list,this.list.parentElement),G(this.list.nextElementSibling)),this.list.parentElement.insertBefore(this.element,this.list)),s7.prototype.destroy.call(this),this.enableRtlElements=[],this.liCollections=null,this.list=null,this.ulElement=null,this.mainList=null,this.spinner=null,this.rippleFun=null,this.itemTemplate&&this.clearTemplate()},l7.prototype.onPropertyChanged=function(e,t){var i=this.toolbarSettings.items.length?this.list.parentElement:this.list;s7.prototype.onPropertyChanged.call(this,e,t),this.setUpdateInitial(["fields","query","dataSource"],e);for(var n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"cssClass":t.cssClass&&q([i],t.cssClass.split(" ")),e.cssClass&&U([i],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":e.enableRtl?this.list.classList.add("e-rtl"):this.list.classList.remove("e-rtl");break;case"value":q(this.list.querySelectorAll("."+$_.selected),$_.selected),this.clearSelection(this.value),this.setSelection();break;case"height":this.setHeight();break;case"enabled":this.setEnable();break;case"allowDragAndDrop":e.allowDragAndDrop?this.initDraggable():this.ulElement.classList.contains("e-sortable")&&At(this.ulElement,"sortable").destroy();break;case"allowFiltering":this.allowFiltering?this.setFiltering():(this.list.removeChild(this.list.getElementsByClassName("e-filter-parent")[0]),this.filterParent=null,q([this.list],"e-filter-list"));break;case"filterBarPlaceholder":this.allowFiltering&&this.filterInput&&HF.setPlaceholder(e.filterBarPlaceholder,this.filterInput);break;case"scope":this.allowDragAndDrop&&(At(this.ulElement,"sortable").scope=e.scope),this.toolbarSettings.items.length&&(t.scope&&(At(document.querySelector(t.scope),this.getModuleName()).tBListBox=null),e.scope)&&(At(document.querySelector(e.scope),this.getModuleName()).tBListBox=this);break;case"toolbarSettings":var r=void 0,s=e.toolbarSettings.position,a=this.getToolElem();s&&(q([i],["e-right","e-left"]),i.classList.add("e-"+s.toLowerCase()),"Left"===s?i.insertBefore(a,this.list):i.appendChild(a)),e.toolbarSettings.items&&(t.toolbarSettings.items=je(t.toolbarSettings.items)?[]:t.toolbarSettings.items,t.toolbarSettings&&t.toolbarSettings.items.length&&((r=this.list.parentElement).parentElement.insertBefore(this.list,r),G(r)),this.initToolbarAndStyles(),this.wireToolbarEvent());break;case"selectionSettings":s=e.selectionSettings.showSelectAll,a=e.selectionSettings.showCheckbox;je(s)||(this.showSelectAll=s,this.showSelectAll&&(r=new Cn(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale),this.checkBoxSelectionModule.checkAllParent=null,this.showSelectAll=!0,this.selectAllText=r.getConstant("selectAllText"),this.unSelectAllText=r.getConstant("selectAllText"),this.popupWrapper=this.list),this.notify("selectAll",{}),this.checkSelectAll()),je(a)||this.showCheckbox(a),this.selectionSettings.showCheckbox&&this.setCheckboxPosition();break;case"dataSource":this.isDataSourceUpdate=!0,this.jsonData=[].slice.call(this.dataSource)}},bQ([e("")],l7.prototype,"cssClass",void 0),bQ([e([])],l7.prototype,"value",void 0),bQ([e("")],l7.prototype,"height",void 0),bQ([e(!0)],l7.prototype,"enabled",void 0),bQ([e(!1)],l7.prototype,"enablePersistence",void 0),bQ([e(!1)],l7.prototype,"allowDragAndDrop",void 0),bQ([e(1e3)],l7.prototype,"maximumSelectionLength",void 0),bQ([e(!1)],l7.prototype,"allowFiltering",void 0),bQ([e("")],l7.prototype,"scope",void 0),bQ([e(!0)],l7.prototype,"ignoreCase",void 0),bQ([e(null)],l7.prototype,"filterBarPlaceholder",void 0),bQ([e("None")],l7.prototype,"sortOrder",void 0),bQ([i()],l7.prototype,"beforeItemRender",void 0),bQ([i()],l7.prototype,"filtering",void 0),bQ([i()],l7.prototype,"select",void 0),bQ([i()],l7.prototype,"change",void 0),bQ([i()],l7.prototype,"beforeDrop",void 0),bQ([i()],l7.prototype,"dragStart",void 0),bQ([i()],l7.prototype,"drag",void 0),bQ([i()],l7.prototype,"drop",void 0),bQ([i()],l7.prototype,"dataBound",void 0),bQ([e(null)],l7.prototype,"groupTemplate",void 0),bQ([e("Request failed")],l7.prototype,"actionFailureTemplate",void 0),bQ([e(1e3)],l7.prototype,"zIndex",void 0),bQ([e(!1)],l7.prototype,"ignoreAccent",void 0),bQ([t({},o7)],l7.prototype,"toolbarSettings",void 0),bQ([t({},t7)],l7.prototype,"selectionSettings",void 0);var s7,a7,wQ=a7=bQ([Bt],l7);function l7(e,t){e=s7.call(this,e,t)||this;return e.isValidKey=!1,e.isBackSpace=!1,e.isDataSourceUpdate=!1,e.keyDownStatus=!1,e}var h7={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"};d7=function(e,t){return(d7=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])}))(e,t)};var d7,p7,bQ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},c7=(function(e,t){function i(){this.constructor=e}d7(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(u7,p7=Oz),u7.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"minLength":this.minLength=e.minLength;break;case"suffixText":this.suffixText=e.suffixText;break;case"allowSpaces":this.allowSpaces=e.allowSpaces;break;case"mentionChar":this.mentionChar=e.mentionChar;break;case"showMentionChar":this.showMentionChar=e.showMentionChar;break;case"requireLeadingSpace":this.requireLeadingSpace=e.requireLeadingSpace;break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass)}},u7.prototype.updateCssClass=function(e,t){je(t)||(t=t.replace(/\s+/g," ").trim()),je(e)||(e=e.replace(/\s+/g," ").trim()),this.setCssClass(e,[this.inputElement],t),this.popupObj&&this.setCssClass(e,[this.popupObj.element],t)},u7.prototype.setCssClass=function(e,t,i){je(i)||""===i||q(t,i.split(" ")),je(e)||""===e||U(t,e.split(" "))},u7.prototype.initializeData=function(){this.isSelected=!1,this.isFiltered=!1,this.beforePopupOpen=!1,this.initRemoteRender=!1,this.isListResetted=!1,this.isPopupOpen=!1,this.isCollided=!1,this.lineBreak=!1,this.isRTE=!1,this.keyEventName="mousedown"},u7.prototype.preRender=function(){this.initializeData(),p7.prototype.preRender.call(this)},u7.prototype.render=function(){var e="string"==typeof this.target;this.inputElement=je(this.target)?this.element:this.checkAndUpdateInternalComponent(e?document.querySelector(this.target):this.target),this.isContentEditable(this.inputElement)&&(this.inputElement.hasAttribute("contenteditable")||this.inputElement.setAttribute("contenteditable","true"),U([this.inputElement],["e-mention"]),je(this.target))&&U([this.inputElement],["e-editable-element"]),this.inputElement.setAttribute("role","textbox"),this.inputElement.setAttribute("aria-label","mention"),this.queryString=this.elementValue(),this.wireEvent()},u7.prototype.wireEvent=function(){E.add(this.inputElement,"keyup",this.onKeyUp,this),this.bindCommonEvent()},u7.prototype.unWireEvent=function(){E.remove(this.inputElement,"keyup",this.onKeyUp),this.unBindCommonEvent()},u7.prototype.bindCommonEvent=function(){F.isDevice||this.inputElement.addEventListener("keydown",this.keyDownHandler.bind(this),!this.isRTE)},u7.prototype.hideSpinner=function(){this.hideWaitingSpinner()},u7.prototype.hideWaitingSpinner=function(){je(this.spinnerElement)||BA(this.spinnerElement),je(this.spinnerTemplate)||je(this.spinnerTemplateElement)||G(this.spinnerTemplateElement)},u7.prototype.checkAndUpdateInternalComponent=function(e){if(!this.isVue&&e.classList.contains("e-richtexteditor"))return e.querySelector(".e-content");if(this.isVue&&"TEXTAREA"===e.nodeName&&e.classList.contains("e-rte-hidden")){var t=e.parentElement;if(t&&t.classList.contains("e-richtexteditor"))return t.querySelector(".e-content")}return e&&e.parentElement&&e.parentElement.classList.contains("e-rte-content")&&(this.isRTE=!0,this.keyEventName="click"),e},u7.prototype.showWaitingSpinner=function(){je(this.popupObj)||(je(this.spinnerTemplate)&&je(this.spinnerElement)&&(this.spinnerElement=this.popupObj.element,mA({target:this.spinnerElement,width:F.isDevice?"16px":"14px"},this.createElement),kA(this.spinnerElement)),je(this.spinnerTemplate))||this.setSpinnerTemplate()},u7.prototype.keyDownHandler=function(e){var t=!0;switch(e.keyCode){case 38:e.action=e.altKey?"hide":"up";break;case 40:e.action=e.altKey?"open":"down";break;case 33:e.action="pageUp";break;case 34:e.action="pageDown";break;case 36:e.action="home";break;case 35:e.action="end";break;case 9:e.action=e.shiftKey?"close":"tab";break;case 27:e.action="escape";break;case 32:e.action="space";break;case 13:e.action="enter";break;default:t=!1}t&&this.keyActionHandler(e)},u7.prototype.keyActionHandler=function(e){var t,i="down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action,n="tab"===e.action||"close"===e.action;if(void 0!==this.list||this.isRequested||n||"escape"===e.action||"space"===e.action||this.mentionChar.charCodeAt(0)!==this.getLastLetter(this.getTextRange()).charCodeAt(0)||this.renderList(),!(je(this.list)||!je(this.liCollections)&&i&&0===this.liCollections.length||this.isRequested))switch("escape"===e.action&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,e.action){case"down":case"up":this.isUpDownKey=!0,this.updateUpDownAction(e);break;case"tab":this.isPopupOpen&&(e.preventDefault(),(t=this.list.querySelector("."+_z.selected))&&(this.isSelected=!0,this.setSelection(t,e)),this.isPopupOpen)&&this.hidePopup(e);break;case"enter":this.isPopupOpen&&(e.preventDefault(),this.popupObj)&&this.popupObj.element.contains(this.selectedLI)&&this.updateSelectedItem(this.selectedLI,e,!1,!0);break;case"escape":this.isPopupOpen&&this.hidePopup(e)}},u7.prototype.updateUpDownAction=function(e){if(!this.fields.disabled||!this.list||0!==this.list.querySelectorAll(".e-list-item:not(.e-disabled)").length){var t,i=this.list.querySelector("."+_z.focus);this.isSelectFocusItem(i)?this.setSelection(i,e):je(this.liCollections)||(je(i=this.list.querySelector("."+_z.selected))||(i=this.getFormattedValue(i.getAttribute("data-value")),this.activeIndex=this.getIndexByValue(i)),n="down"===e.action?this.activeIndex+1:this.activeIndex-1,i=0,i="down"===e.action&&je(this.activeIndex)?0:this.liCollections.length-1,n=n<0?this.liCollections.length-1:n===this.liCollections.length?0:n,i=je(this.activeIndex)?this.liCollections[i]:this.liCollections[n],je(i))||this.setSelection(i,e);for(var n=0;n<this.liCollections.length;n++)if(this.liCollections[n].classList.contains(_z.focus)||this.liCollections[n].classList.contains(_z.selected)){t=n;break}null!=t&&this.isDisabledElement(this.liCollections[t])&&this.updateUpDownAction(e),this.isPopupOpen&&e.preventDefault()}},u7.prototype.isSelectFocusItem=function(e){return!je(e)},u7.prototype.unBindCommonEvent=function(){F.isDevice||this.inputElement.removeEventListener("keydown",this.keyDownHandler.bind(this),!this.isRTE)},u7.prototype.onKeyUp=function(e){var t,i,n,o,r,s,a;this.isUpDownKey&&this.isPopupOpen&&229===e.keyCode?this.isUpDownKey=!1:(this.isTyped="Enter"!==e.code&&"Space"!==e.code&&"ArrowDown"!==e.code&&"ArrowUp"!==e.code,i=!(!document.activeElement.parentElement||!document.activeElement.parentElement.querySelector(".e-rte-image")),document.activeElement===this.inputElement||i||this.inputElement.focus(),this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange(),t=this.range.startContainer.textContent.split("")),i=this.getTextRange(),n=new RegExp(this.mentionChar.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\s"),n=!i||!n.test(i),o=this.getLastLetter(i),r=i?i.charAt(Math.max(0,i.indexOf(this.mentionChar)-1)):"",n&&this.allowSpaces&&i&&i.includes(this.mentionChar)&&""!==i.split(this.mentionChar).pop()&&(!this.requireLeadingSpace||this.requireLeadingSpace&&(" "===r||0===i.indexOf(this.mentionChar)))&&(o=this.mentionChar+i.split(this.mentionChar).pop()),!this.requireLeadingSpace&&o&&o.includes(this.mentionChar)&&(o=this.mentionChar+o.split(this.mentionChar).pop()),r=this.mentionChar.toString()+this.mentionChar.toString(),s=new RegExp(this.mentionChar.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),a=new RegExp("[a-zA-Z]","g"),"Shift"!==e.key&&37!==e.keyCode&&39!==e.keyCode&&(this.beforePopupOpen&&this.isPopupOpen&&o===r?this.hidePopup():!i||!o||!o.includes(this.mentionChar)&&!this.requireLeadingSpace||"Enter"===e.code||27===e.keyCode||o.match(s)&&1<o.match(s).length||this.isContentEditable(this.inputElement)&&this.range.startContainer&&this.range.startContainer.previousElementSibling&&"BR"!==this.range.startContainer.previousElementSibling.tagName&&0<this.range.startContainer.textContent.split("").length&&(1===t.length||-1===t[t.length-2].indexOf("")||1===this.range.startContainer.nodeType)?n&&this.isPopupOpen&&this.allowSpaces&&i&&""!==i.trim()&&a.test(i)&&-1!==i.indexOf(this.mentionChar)&&!this.isMatchedText()&&1<i.length&&" "!==i.replace(/\u00A0/g," ").charAt(i.length-2)&&this.list&&0<this.list.querySelectorAll("ul").length&&"Enter"!==e.code?(this.queryString=i.substring(i.lastIndexOf(this.mentionChar)+1).replace(" "," "),this.searchLists(e)):this.requireLeadingSpace&&(!this.isPopupOpen||this.allowSpaces&&o||"ArrowDown"===e.code||"ArrowUp"===e.code)?"Backspace"!==e.key&&"Delete"!==e.key||!this.range||this.range.startOffset===this.range.endOffset||this.range.deleteContents():(this.hidePopup(),this.lineBreak=!0):(o.includes(this.mentionChar)&&(this.queryString=this.requireLeadingSpace?o.replace(this.mentionChar,""):o.substring(o.lastIndexOf(this.mentionChar)+1).trim()),this.mentionChar.charCodeAt(0)!==o.charCodeAt(0)||""===this.queryString||38===e.keyCode||40===e.keyCode||this.lineBreak?(this.requireLeadingSpace?0===o.indexOf(this.mentionChar):o.includes(this.mentionChar))&&!this.isPopupOpen&&8!==e.keyCode&&(!this.popupObj||je(this.target)&&!document.body.contains(this.popupObj.element)||!je(this.target)&&document.body.contains(this.popupObj.element))?(this.initRemoteRender&&this.list&&this.list.classList.contains("e-nodata")&&this.searchLists(e),this.resetList(this.dataSource,this.fields),je(this.list)&&this.initValue(),!this.isPopupOpen&&38!==e.keyCode&&40!==e.keyCode&&this.queryString.length>=this.minLength&&(this.didPopupOpenByTypingInitialChar=!0,this.showPopup(),this.initRemoteRender&&0===this.list.querySelectorAll("li").length&&this.showWaitingSpinner(),this.lineBreak=!1)):this.allowSpaces&&""!==this.queryString&&i&&""!==i.trim()&&i.replace(" "," ").lastIndexOf(" ")<i.length-1&&38!==e.keyCode&&40!==e.keyCode&&8!==e.keyCode&&(this.mentionChar.charCodeAt(0)===o.charCodeAt(0)||this.liCollections&&0<this.liCollections.length)?(this.queryString=i.substring(i.lastIndexOf(this.mentionChar)+1).replace(" "," "),this.searchLists(e)):""===this.queryString&&this.isPopupOpen&&38!==e.keyCode&&40!==e.keyCode&&this.mentionChar.charCodeAt(0)===o.charCodeAt(0)&&(this.searchLists(e),this.isListResetted||this.resetList(this.dataSource,this.fields)):(this.searchLists(e),!this.isPopupOpen&&this.queryString.length>=this.minLength&&(!this.isContentEditable(this.inputElement)||this.isContentEditable(this.inputElement)&&this.range&&this.range.startContainer!==this.inputElement&&9!==e.keyCode)&&this.showPopup()),this.isListResetted=!1)))},u7.prototype.isMatchedText=function(){for(var e=!1,t=0;t<(this.liCollections&&this.liCollections.length);t++)this.getTextRange()&&this.getTextRange().substring(this.getTextRange().lastIndexOf(this.mentionChar)+1).replace(" "," ").trim()===this.liCollections[t].getAttribute("data-value").toLowerCase()&&(e=!0);return e},u7.prototype.getCurrentRange=function(){return this.range=this.inputElement.ownerDocument.getSelection().getRangeAt(0),this.range},u7.prototype.searchLists=function(e){var n,o=this;this.isDataFetched=!1,je(this.list)&&(p7.prototype.render.call(this),this.unWireListEvents(),this.wireListEvents()),"mousedown"===e.type||40!==e.keyCode&&38!==e.keyCode?(this.isSelected=!1,this.activeIndex=null,n={preventDefaultAction:!1,text:this.queryString,updateData:function(e,t,i){n.cancel||(o.isFiltered=!0,o.filterAction(e,t,i))},cancel:!1},this.trigger("filtering",n,function(e){e.cancel||o.isFiltered||e.preventDefaultAction||o.filterAction(o.dataSource,null,o.fields)})):(this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,this.resetList(this.dataSource,this.fields))},u7.prototype.filterAction=function(e,t,i){this.beforePopupOpen=!0,this.queryString.length>=this.minLength?(this.resetList(e,i,t),this.isListResetted=!0):(this.isPopupOpen&&this.hidePopup(),this.beforePopupOpen=!1),this.setDataIndex(),this.renderReactTemplates()},u7.prototype.onActionComplete=function(e,t,i,n){p7.prototype.onActionComplete.call(this,e,t,i),this.isActive&&(je(e)||(pt(e,{id:this.inputElement.id+"_options",role:"listbox","aria-hidden":"false"}),this.isRTE&&this.cssClass&&-1<this.cssClass.indexOf("e-slash-menu")&&(e.id=this.inputElement.id+"_slash_menu_options")),(t=this.fields.disabled?e.querySelector("."+_z.li+":not(.e-disabled)"):e.querySelector("."+_z.li))&&(t.classList.add(_z.selected),this.selectedLI=t,i=this.getFormattedValue(t.getAttribute("data-value")),this.selectEventCallback(t,this.getDataByValue(i),i,!0)),this.beforePopupOpen)&&this.isPopupOpen&&(je(this.popupObj.element)||this.popupObj.element.remove(),this.renderPopup())},u7.prototype.setDataIndex=function(){for(var e=0;this.liCollections&&e<this.liCollections.length;e++)this.liCollections[e].setAttribute("data-index",e.toString())},u7.prototype.listOption=function(e,t){var i,n=this,e=p7.prototype.listOption.call(this,e,t);return je(e.itemCreated)?e.itemCreated=function(e){n.highlight&&(n.inputElement.tagName===n.getNgDirective()&&n.itemTemplate?setTimeout(function(){W_(e.item,n.queryString,n.ignoreCase,n.filterType)},0):W_(e.item,n.queryString,n.ignoreCase,n.filterType))}:(i=e.itemCreated,e.itemCreated=function(e){n.highlight&&W_(e.item,n.queryString,n.ignoreCase,n.filterType),i.apply(n,[e])}),e},u7.prototype.elementValue=function(){return(this.isContentEditable(this.inputElement)?this.inputElement.textContent:this.inputElement.value).replace(this.mentionChar,"")},u7.prototype.getQuery=function(e){var t,i=e?e.clone():this.query?this.query.clone():new ya,e=""!==this.queryString||je(this.elementValue())?this.filterType:"equal",n=""!==this.queryString||je(this.elementValue())?this.queryString:this.elementValue();if(!this.isFiltered&&(null!==this.queryString&&""!==this.queryString&&(t=this.typeOfData(this.dataSource).typeof,(this.dataSource instanceof me||"string"!==t)&&"number"!==t?(t=je(this.fields.text)?"":this.fields.text,i.where(t,e,n,this.ignoreCase,this.ignoreAccent)):i.where("",e,n,this.ignoreCase,this.ignoreAccent)),!je(this.suggestionCount))){if(25!==this.suggestionCount)for(var o=0;o<i.queries.length;o++)"onTake"===i.queries[o].fn&&i.queries.splice(o,1);i.take(this.suggestionCount)}return i},u7.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++)this.ulElement.querySelector(".e-active")||(Q_(this.liCollections[e]),W_(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType))},u7.prototype.getTextRange=function(){var e,t,i;return this.isContentEditable(this.inputElement)?this.range&&!je(t=this.range.startContainer)&&(t=t.textContent,i=this.range.startOffset,t)&&0<=i&&(e=t.substring(0,i)):je(t=this.inputElement)||(i=t.selectionStart,t.value&&0<=i&&(e=t.value.substring(0,i))),e},u7.prototype.getLastLetter=function(e){return je(e)?"":(e=(-1<e.indexOf("​")?e.replace(/\u200B/g,""):e).replace(/\u00A0/g," ").split(/\s+/))[e.length-1].trim()},u7.prototype.isContentEditable=function(e){return e&&"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName},u7.prototype.showPopup=function(){this.beforePopupOpen=!0,document.activeElement!==this.inputElement&&this.inputElement.focus(),this.queryString=this.didPopupOpenByTypingInitialChar?this.queryString:"",this.didPopupOpenByTypingInitialChar=!1,this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange()),this.isTyped||this.resetList(this.dataSource,this.fields),je(this.list)&&this.initValue(),this.renderPopup(),pt(this.inputElement,{"aria-activedescendant":this.selectedElementID}),null==this.selectedElementID&&this.inputElement.removeAttribute("aria-activedescendant")},u7.prototype.hidePopup=function(e){this.removeSelection(),this.closePopup(0,e)},u7.prototype.closePopup=function(e,t){var i,n=this;this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen&&(E.remove(document,"mousedown",this.onDocumentClick),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-activedescendant"),this.beforePopupOpen=!1,i=this.popupObj,this.trigger("closed",{popup:i,cancel:!1,animation:{name:"FadeOut",duration:100,delay:e||0},event:t||null},function(e){!e.cancel&&n.popupObj&&(n.isPopupOpen?n.popupObj.hide(new Vt(e.animation)):n.destroyPopup())}))},u7.prototype.renderPopup=function(){var s=this;this.trigger("beforeOpen",{cancel:!1},function(e){var t,i,n,o,r;e.cancel?s.beforePopupOpen=!1:(je(s.target)?t=s.createElement("div",{id:s.inputElement.id+"_popup",className:"e-mention e-popup "+(null!=s.cssClass?s.cssClass:"")}):(t=s.element,null!=s.cssClass&&U([t],s.cssClass.split(" "))),s.isRTE&&s.cssClass&&-1<s.cssClass.indexOf("e-slash-menu")?t.id=s.inputElement.id+"_slash_menu_popup":je(s.target)||(t.id=s.inputElement.id+"_popup"),s.listHeight=T(s.popupHeight),je(s.list.querySelector("li"))||s.initRemoteRender||je(e=s.list.querySelector("."+_z.focus))||(s.selectedLI=e,r=s.getFormattedValue(e.getAttribute("data-value")),s.selectEventCallback(e,s.getDataByValue(r),r,!0)),ht([s.list],t),s.inputElement.parentElement&&(e=s.inputElement.parentElement.closest(".e-richtexteditor"))&&t.firstElementChild&&0<t.firstElementChild.childElementCount&&(t.firstElementChild.setAttribute("aria-owns",e.id),U([t],"e-rte-elements")),s.popupObj&&document.body.contains(s.popupObj.element)&&(document.contains(t)||!je(s.target))||document.body.appendChild(t),t.style.visibility="hidden",s.setHeight(t),s.initializePopup(t,0,0),s.checkCollision(t),t.style.visibility="visible",n=t.parentElement.offsetWidth-t.offsetWidth,o=t.offsetHeight,U([t],["e-mention","e-popup","e-popup-close"]),je(s.list)||(s.unWireListEvents(),s.wireListEvents()),s.selectedElementID=s.selectedLI?s.selectedLI.id:null,pt(s.inputElement,{"aria-owns":s.inputElement.id+"_options","aria-activedescendant":s.selectedElementID}),null==s.selectedElementID&&s.inputElement.removeAttribute("aria-activedescendant"),s.beforePopupOpen=!0,r=s.popupObj,s.trigger("opened",{popup:r,cancel:!1,animation:{name:"FadeIn",duration:100}},function(e){e.cancel?(s.beforePopupOpen=!1,s.destroyPopup()):(s.renderReactTemplates(),s.popupObj&&s.popupObj.show(new Vt(e.animation),1e3===s.zIndex?s.inputElement:null),je(s.getTriggerCharPosition())||(i=s.getCoordinates(s.inputElement,s.getTriggerCharPosition()),s.isCollided?(0<s.collision.length&&-1<s.collision.indexOf("right")&&-1===s.collision.indexOf("bottom")?t.style.cssText="top: ".concat(i.top.toString(),"px;\n left: ").concat(n.toString(),"px;\nposition: absolute;\n display: block;"):s.collision&&0<s.collision.length&&-1<s.collision.indexOf("bottom")&&-1===s.collision.indexOf("right")?(t.style.left=T(i.left),t.style.top=T(i.top-parseInt(o.toString(),10))):s.collision&&0<s.collision.length&&-1<s.collision.indexOf("bottom")&&-1<s.collision.indexOf("right")?(t.style.left=T(n),t.style.top=T(i.top-parseInt(o.toString(),10))):(t.style.left=T(i.left),t.style.top=T(i.top-parseInt(s.popupHeight.toString(),10))),s.isCollided=!1,s.collision=[]):t.style.cssText="top: ".concat(i.top.toString(),"px;\n left: ").concat(i.left.toString(),"px;\nposition: absolute;\n display: block;"),t.style.width="100%"===s.popupWidth||je(s.popupWidth)?"auto":T(s.popupWidth),s.setHeight(t),t.style.zIndex=(1e3===s.zIndex?Iv(t):s.zIndex).toString()))}))})},u7.prototype.setHeight=function(e){"auto"!==this.popupHeight&&this.list?(this.list.style.maxHeight=(parseInt(this.listHeight,10)-2).toString()+"px",e.style.maxHeight=T(this.popupHeight)):e.style.height="auto"},u7.prototype.checkCollision=function(e){var t;(!F.isDevice||F.isDevice&&"mention"!==this.getModuleName())&&(t=this.getCoordinates(this.inputElement,this.getTriggerCharPosition()),this.collision=Y0(e,null,t.left,t.top),0<this.collision.length&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px",this.isCollided=!0),this.popupObj.resolveCollision())},u7.prototype.getTriggerCharPosition=function(){var e,t=this.getTextRange();return(e=null!=t&&(e=0)<=(t=t.lastIndexOf(this.mentionChar))?t:e)||0},u7.prototype.initializePopup=function(e,t,i){var n=this;this.popupObj=new Sv(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputElement,collision:{X:"flip",Y:"flip"},offsetY:t,enableRtl:this.enableRtl,offsetX:i,position:{X:"left",Y:"bottom"},actionOnScroll:"hide",zIndex:this.zIndex,close:function(){n.destroyPopup()},open:function(){E.add(document,"mousedown",n.onDocumentClick,n),n.isPopupOpen=!0,n.setDataIndex()}})},u7.prototype.setWidth=function(){var e=T(this.popupWidth);return e=-1<e.indexOf("%")?(this.inputElement.offsetWidth*parseFloat(e)/100).toString()+"px":e},u7.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.popupObj.destroy(),je(this.target)?G(this.popupObj.element):(this.popupObj.element.innerHTML="",this.popupObj.element.removeAttribute("style"),this.popupObj.element.removeAttribute("aria-disabled")),this.list.classList.contains("e-nodata")&&(this.list=null)},u7.prototype.onDocumentClick=function(e){var t=e.target;!je(this.popupObj)&&z(t,"#"+this.popupObj.element.id)||this.hidePopup(e)},u7.prototype.getCoordinates=function(e,t){var i,n,o,r,s,a=this.isContentEditable(this.inputElement)?(a=this.getTriggerCharPosition(),u=this.range,s=document.createRange(),this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)?(s.setStart(u.startContainer,a),s.setEnd(u.startContainer,a)):(s.setStart(u.startContainer,u.startOffset),s.setEnd(u.startContainer,u.endOffset)),this.isTyped=!1,s.collapse(!1),0===s.getBoundingClientRect().top?s.startContainer.getClientRects()[0]:s.getBoundingClientRect()):(i=this.createElement("div",{className:"e-form-mirror-div"}),document.body.appendChild(i),r=getComputedStyle(e),i.style.position="absolute",i.style.visibility="hidden",["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"].forEach(function(e){i.style[e]=r[e]}),i.textContent=e.value.substring(0,t),"INPUT"===this.inputElement.nodeName&&(i.textContent=i.textContent.replace(/\s/g," ")),(n=this.createElement("span")).textContent=e.value.substring(t)||".",i.appendChild(n),e.getBoundingClientRect()),l=a.top,h=a.left,d=document.querySelectorAll("iframe");if(0<d.length)for(var p=0;p<d.length;p++){var c=d[p];c.contentDocument&&c.contentDocument.contains(e)&&(l+=(c=c.getBoundingClientRect()).top,h+=c.left)}var u=document.documentElement,t=(window.pageXOffset||u.scrollLeft)-(u.clientLeft||0),a=(window.pageYOffset||u.scrollTop)-(u.clientTop||0),g=0;if(!je(s)&&0===s.getBoundingClientRect().top)for(var m,f,p=0;p<this.range.startContainer.childNodes.length;p++)this.range.startContainer.childNodes[p].nodeType!==Node.TEXT_NODE&&""!==this.range.startContainer.childNodes[p].textContent.trim()?g+=this.range.startContainer.childNodes[p].getClientRects()[0].width:""!==this.range.startContainer.childNodes[p].textContent&&((m=document.createElement("span")).innerHTML=this.range.startContainer.childNodes[p].nodeValue,document.body.appendChild(m),f=m.offsetWidth,document.body.removeChild(m),g+=f);return this.isContentEditable(this.inputElement)?o=this.collision&&0<this.collision.length&&-1<this.collision.indexOf("right")&&-1===this.collision.indexOf("bottom")?{top:l+a+parseInt(getComputedStyle(this.inputElement).fontSize,10),left:h+t+g}:{top:l+a+parseInt(getComputedStyle(this.inputElement).fontSize,10)-(this.isCollided?10:0),left:h+t+g}:(o={top:l+a+n.offsetTop+parseInt(r.borderTopWidth,10)+parseInt(r.fontSize,10)+3-e.scrollTop-(this.isCollided?10:0),left:h+t+n.offsetLeft+parseInt(r.borderLeftWidth,10)},document.body.removeChild(i)),o},u7.prototype.initValue=function(){this.isDataFetched=!1,this.renderList(),this.dataSource instanceof me?this.initRemoteRender=!0:this.updateValues()},u7.prototype.updateValues=function(){var e=this.list.querySelector("."+_z.focus);je(e)||this.setSelection(e,null)},u7.prototype.renderList=function(){p7.prototype.render.call(this),this.unWireListEvents(),this.wireListEvents()},u7.prototype.wireListEvents=function(){E.add(this.list,this.keyEventName,this.onMouseClick,this),E.add(this.list,"mouseover",this.onMouseOver,this),E.add(this.list,"mouseout",this.onMouseLeave,this)},u7.prototype.unWireListEvents=function(){E.remove(this.list,this.keyEventName,this.onMouseClick),E.remove(this.list,"mouseover",this.onMouseOver),E.remove(this.list,"mouseout",this.onMouseLeave)},u7.prototype.onMouseClick=function(e){var t=z(e.target,"."+_z.li);!this.isValidLI(t)||this.isDisabledElement(t)||(this.isSelected=!0,this.setSelection(t,e),this.closePopup(100,e),this.inputElement.focus(),this.isRTE)||e.preventDefault()},u7.prototype.updateSelectedItem=function(t,i,e,n){var o=this,r=(this.removeSelection(),t.classList.add(_z.selected),this.removeHover(),this.getFormattedValue(t.getAttribute("data-value"))),s=this.getDataByValue(r);e||je(i)||"down"===i.action||"up"===i.action?(this.selectEventCallback(t,s,r),n&&this.setSelectOptions(t,i)):(e=this.detachChanges(s),this.isSelected=!0,this.trigger("select",{e:i,item:t,itemData:e,isInteracted:!!i,cancel:!1},function(e){e.cancel?(t.classList.remove(_z.selected),o.isSelected=!1,o.isSelectCancel=!0):(o.selectEventCallback(t,s,r),n&&o.setSelectOptions(t,i))}))},u7.prototype.setSelection=function(e,t){this.isValidLI(e)&&(!e.classList.contains(_z.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(_z.selected))?this.updateSelectedItem(e,t,!1,!0):this.setSelectOptions(e,t)},u7.prototype.setSelectOptions=function(e,t){this.list&&this.removeHover(),this.previousSelectedLI=je(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.isPopupOpen&&!je(this.selectedLI)&&this.setScrollPosition(t),t&&(38===t.keyCode||40===t.keyCode)||je(t)||this.setValue(t)},u7.prototype.setScrollPosition=function(e){if(je(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.scrollBottom();break;default:this.scrollTop()}},u7.prototype.scrollBottom=function(e){var t,i,n;je(this.selectedLI)||(t=this.list.offsetHeight,i=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,n=this.list.scrollTop+i-t,n=e?n+2*parseInt(getComputedStyle(this.list).paddingTop,10):n,e=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,0===this.activeIndex?this.list.scrollTop=0:(t<i||!(0<e&&this.list.offsetHeight>e))&&(this.list.scrollTop=n))},u7.prototype.scrollTop=function(){var e,t;je(this.selectedLI)||(e=je(this.fields.groupBy)||je(this.fixedHeaderElement)?this.selectedLI.offsetTop-this.list.scrollTop:this.selectedLI.offsetTop-(this.list.scrollTop+this.fixedHeaderElement.offsetHeight),e=this.fields.groupBy&&e,t=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:0<t&&this.list.offsetHeight>t||(this.list.scrollTop=this.selectedLI.offsetTop))},u7.prototype.selectEventCallback=function(e,t,i,n){this.previousItemData=je(this.itemData)?null:this.itemData,this.item=e,this.itemData=t;t=this.list.querySelector("."+_z.focus);t&&q([t],_z.focus),n&&U([e],_z.selected),e.setAttribute("aria-selected","true"),this.activeIndex=this.getIndexByValue(i)},u7.prototype.detachChanges=function(e){e="string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e;return e},u7.prototype.setValue=function(e){return this.isReact?je(this.displayTemplate)?this.updateMentionValue(e):this.setDisplayTemplate(e):(je(this.displayTemplate)||this.setDisplayTemplate(),this.updateMentionValue(e)),!0},u7.prototype.updateMentionValue=function(e){var t,i,n=this.getItemData(),o="string"==typeof this.suffixText?this.suffixText:"",r=this.inputElement.ownerDocument.getSelection(),s=this.getTriggerCharPosition();if(this.isSelectCancel)this.isSelectCancel=!1;else{if(null!==n.text&&(t=this.mentionVal(n.text)),this.isContentEditable(this.inputElement)){i=this.getTriggerCharPosition()+this.mentionChar.length,this.range&&this.range.startContainer.textContent.trim()!==this.mentionChar&&(i=this.range.endOffset),n=this.range,p=document.createRange(),this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)||this.getTextRange()&&this.getTextRange().trim()===this.mentionChar?(p.setStart(n.startContainer,s),p.setEnd(n.startContainer,i)):""!==n.commonAncestorContainer.textContent.trim()&&!je(n.commonAncestorContainer.textContent.trim())&&this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)?(p.setStart(n.startContainer,n.startOffset-1),p.setEnd(n.startContainer,n.endOffset-1)):(p.setStart(n.startContainer,n.startOffset),p.setEnd(n.startContainer,n.endOffset)),this.isTyped=!1,p.deleteContents(),p.startContainer.parentElement.normalize();for(var a,l=this.createElement("div"),h=(l.innerHTML=t,document.createDocumentFragment()),d=void 0;a=l.firstChild;)d=h.appendChild(a);p.insertNode(h),d&&(p=p.cloneRange(),this.isRTE?p.setStart(d,d.textContent.length):p.setStartAfter(d),p.collapse(!0),r.removeAllRanges(),r.addRange(p)),this.isPopupOpen&&this.hidePopup(),je(e.pointerType)||"mouse"!==e.pointerType||(n=new CustomEvent("content-changed",{detail:{click:!0}}),this.inputElement.dispatchEvent(n))}else{var r=this.inputElement,p=this.getTextRange().substring(s+this.mentionChar.length,this.getTextRange().length);t+=o,i=s+this.mentionChar.length,i+=p.length,r.value=r.value.substring(0,s)+t+r.value.substring(i,r.value.length),r.selectionStart=s+t.length,r.selectionEnd=s+t.length,this.isPopupOpen&&this.hidePopup()}this.onChangeEvent(e)}},u7.prototype.mentionVal=function(e){var t=this.showMentionChar?this.mentionChar:"";return je(this.displayTemplate)||je(this.displayTempElement)||(e=this.displayTempElement.innerHTML),this.isContentEditable(this.inputElement)?F.isAndroid?'<span contenteditable="true" class="e-mention-chip">'+t+e+"</span>".concat("string"==typeof this.suffixText?this.suffixText:"&#8203;"):'<span contenteditable="false" class="e-mention-chip">'+t+e+"</span>".concat("string"==typeof this.suffixText?this.suffixText:"&#8203;"):t+e},u7.prototype.setDisplayTemplate=function(e){var t=this;this.isReact&&(this.clearTemplate(["displayTemplate"]),this.displayTempElement)&&(G(this.displayTempElement),this.displayTempElement=null),this.displayTempElement||(this.displayTempElement=this.createElement("div")),this.isReact||(this.displayTempElement.innerHTML="");var i=oo(this.displayTemplate)(this.itemData,this,"displayTemplate",this.displayTemplateId,this.isStringTemplate,null,this.displayTempElement);i&&0<i.length&&ht(i,this.displayTempElement),this.isReact?this.renderTemplates(function(){t.updateMentionValue(e)}):this.renderTemplates()},u7.prototype.renderTemplates=function(e){this.renderReactTemplates(e)},u7.prototype.setSpinnerTemplate=function(){var e=this;this.isReact&&(this.clearTemplate(["spinnerTemplate"]),this.spinnerTemplateElement)&&(G(this.spinnerTemplateElement),this.spinnerTemplateElement=null),this.spinnerTemplateElement||(this.spinnerTemplateElement=this.createElement("div")),this.isReact||(this.spinnerTemplateElement.innerHTML="");var t=oo(this.spinnerTemplate)(null,this,"spinnerTemplate",this.spinnerTemplateId,this.isStringTemplate,null,this.spinnerTemplateElement);if(t&&0<t.length)for(var i=0;i<t.length;i++)this.spinnerTemplateElement.appendChild(t[i]);this.isReact?this.renderTemplates(function(){e.popupObj.element.appendChild(e.spinnerTemplateElement)}):(this.renderTemplates(),this.popupObj.element.appendChild(this.spinnerTemplateElement))},u7.prototype.onChangeEvent=function(e){this.isSelected=!1;var t=this.detachMentionChanges(this.itemData),i="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,t={e:e,item:this.item,itemData:t,previousItem:this.previousSelectedLI,previousItemData:i,isInteracted:!!e,value:this.item.innerHTML,element:this.inputElement};this.trigger("change",t)},u7.prototype.detachMentionChanges=function(e){e="string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e;return e},u7.prototype.getItemData=function(){var e,t,i,n=this.fields;return je(i=this.itemData)||(e=R(n.value,i),t=R(n.text,i)),{value:je(i)||ee(e)?i:e,text:je(i)||ee(e)?i:t}},u7.prototype.removeSelection=function(){var e;this.list&&(e=this.list.querySelectorAll("."+_z.selected)).length&&(q(e,_z.selected),e[0].removeAttribute("aria-selected"))},u7.prototype.onMouseOver=function(e){e=z(e.target,"."+_z.li);this.setHover(e)},u7.prototype.setHover=function(e){this.isValidLI(e)&&!e.classList.contains(_z.hover)&&(this.removeHover(),U([e],_z.hover))},u7.prototype.removeHover=function(){var e;this.list&&(e=this.list.querySelectorAll("."+_z.hover))&&e.length&&q(e,_z.hover)},u7.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},u7.prototype.onMouseLeave=function(){this.removeHover()},u7.prototype.search=function(e,t,i){this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange());var n=this.getTextRange(),n=(this.queryString=e,this.getLastLetter(n));this.ignoreCase&&(e===n||e===n.toLowerCase())||!this.ignoreCase&&e===n?(this.resetList(this.dataSource,this.fields),je(this.list)?(this.renderList(),this.renderPopup()):this.isPopupOpen||this.renderPopup(),this.popupObj.element.style.left=T(t),this.popupObj.element.style.top=T(i)):this.isPopupOpen&&this.hidePopup()},u7.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t,i=-1;if(this.liCollections&&0<this.liCollections.length&&this.listData&&this.fields.disabled){if("string"==typeof e)i=this.getIndexByValue(e);else if("object"==typeof e){if(e instanceof HTMLLIElement){for(var n=0;n<this.liCollections.length;n++)if(this.liCollections[n]===e){i=this.getIndexByValue(e.getAttribute("data-value"));break}}else for(var o=JSON.parse(JSON.stringify(e))[this.fields.value],n=0;n<this.listData.length;n++)if(JSON.parse(JSON.stringify(this.listData[n]))[this.fields.value]===o){i=this.getIndexByValue(o);break}}else i=e;i<this.liCollections.length&&-1<i&&!JSON.parse(JSON.stringify(this.listData[i]))[this.fields.disabled]&&(t=this.liCollections[i])&&(this.disableListItem(t),(t=JSON.parse(JSON.stringify(this.listData[i])))[this.fields.disabled]=!0,this.listData[i]=t,this.dataSource=this.listData)}}},u7.prototype.destroy=function(){this.hidePopup(),this.unWireEvent(),this.list&&this.unWireListEvents(),this.inputElement&&!this.inputElement.classList.contains("e-"+this.getModuleName())||(this.previousSelectedLI=null,this.item=null,this.selectedLI=null,this.popupObj=null,p7.prototype.destroy.call(this))},u7.prototype.getLocaleName=function(){return"mention"},u7.prototype.getNgDirective=function(){return"EJS-MENTION"},u7.prototype.getModuleName=function(){return"mention"},bQ([e(null)],u7.prototype,"cssClass",void 0),bQ([e("@")],u7.prototype,"mentionChar",void 0),bQ([e(!1)],u7.prototype,"showMentionChar",void 0),bQ([e(!1)],u7.prototype,"allowSpaces",void 0),bQ([e(null)],u7.prototype,"suffixText",void 0),bQ([e(25)],u7.prototype,"suggestionCount",void 0),bQ([e(0)],u7.prototype,"minLength",void 0),bQ([e("None")],u7.prototype,"sortOrder",void 0),bQ([e(!0)],u7.prototype,"ignoreCase",void 0),bQ([e(!0)],u7.prototype,"requireLeadingSpace",void 0),bQ([e(!1)],u7.prototype,"highlight",void 0),bQ([e()],u7.prototype,"locale",void 0),bQ([e("auto")],u7.prototype,"popupWidth",void 0),bQ([e("300px")],u7.prototype,"popupHeight",void 0),bQ([e(null)],u7.prototype,"displayTemplate",void 0),bQ([e(null)],u7.prototype,"itemTemplate",void 0),bQ([e("No records found")],u7.prototype,"noRecordsTemplate",void 0),bQ([e(null)],u7.prototype,"spinnerTemplate",void 0),bQ([e()],u7.prototype,"target",void 0),bQ([e([])],u7.prototype,"dataSource",void 0),bQ([e(null)],u7.prototype,"query",void 0),bQ([e("Contains")],u7.prototype,"filterType",void 0),bQ([t({text:null,value:null,iconCss:null,groupBy:null},HH)],u7.prototype,"fields",void 0),bQ([i()],u7.prototype,"actionBegin",void 0),bQ([i()],u7.prototype,"actionComplete",void 0),bQ([i()],u7.prototype,"actionFailure",void 0),bQ([i()],u7.prototype,"change",void 0),bQ([i()],u7.prototype,"beforeOpen",void 0),bQ([i()],u7.prototype,"opened",void 0),bQ([i()],u7.prototype,"closed",void 0),bQ([i()],u7.prototype,"select",void 0),bQ([i()],u7.prototype,"filtering",void 0),bQ([i()],u7.prototype,"created",void 0),bQ([i()],u7.prototype,"destroyed",void 0),bQ([Bt],u7));function u7(e,t){return p7.call(this,e,t)||this}g7=function(e,t){return(g7=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])}))(e,t)};var g7,m7,bQ=function(e,t){function i(){this.constructor=e}g7(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},f7=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},y7="e-other-month",v7="e-other-year",b7="e-calendar",w7="e-device",C7="e-year",S7="e-month",A7="e-decade",x7="e-icons",I7="e-disabled",T7="e-overlay",E7="e-week-number",D7="e-selected",M7="e-focused-date",k7="e-focused-cell",P7="e-month-hide",B7="e-today",F7="e-zoomin",L7="e-calendar-day-header-lg",R7=(bQ(O7,m7=Ji),O7.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 Ti(this.locale),(je(this.firstDayOfWeek)||6<this.firstDayOfWeek||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(b7),this.enableRtl&&this.element.classList.add("e-rtl"),F.isDevice&&this.element.classList.add(w7),pt(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(b7),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),F.isDevice&&this.calendarElement.classList.add(w7),pt(this.calendarElement,{"data-role":"calendar"})),!je(z(this.element,"fieldset"))&&z(this.element,"fieldset").disabled&&(this.enabled=!1),this.createHeader(),this.createContent(),this.wireEvents()},O7.prototype.rangeValidation=function(e,t){je(e)&&this.setProperties({min:new Date(1900,0,1)},!0),je(t)&&this.setProperties({max:new Date(2099,11,31)},!0)},O7.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},O7.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||new Date((new Date).setHours(0,0,0,0)),!je(e)&&this.min<=this.max&&e>=this.min&&e<=this.max&&(this.currentDate=new Date(this.checkValue(e)))},O7.prototype.setOverlayIndex=function(e,t,i,n){!n||je(t)||je(i)||je(e)||(n=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3,i.style.zIndex=(n-1).toString(),e.style.zIndex=n.toString())},O7.prototype.minMaxUpdate=function(e){(+this.min<=+this.max?q:(this.setProperties({min:this.min},!0),U))([this.element],T7),this.min=je(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=je(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)))},O7.prototype.createHeader=function(){var e={tabindex:"0"},t=(this.headerElement=this.createElement("div",{className:"e-header"}),this.createElement("div",{className:"e-icon-container"}));this.previousIcon=this.createElement("button",{className:"e-prev",attrs:{type:"button"}}),Ht(this.previousIcon,{duration:400,selector:".e-prev",isCenterRipple:!0}),pt(this.previousIcon,{"aria-disabled":"false","aria-label":"previous month"}),pt(this.previousIcon,e),this.nextIcon=this.createElement("button",{className:"e-next",attrs:{type:"button"}}),Ht(this.nextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),"daterangepicker"===this.getModuleName()&&(pt(this.previousIcon,{tabIndex:"-1"}),pt(this.nextIcon,{tabIndex:"-1"})),pt(this.nextIcon,{"aria-disabled":"false","aria-label":"next month"}),pt(this.nextIcon,e),this.headerTitleElement=this.createElement("div",{className:"e-day e-title"}),pt(this.headerTitleElement,{"aria-atomic":"true","aria-live":"assertive","aria-label":"title"}),pt(this.headerTitleElement,e),this.headerElement.appendChild(this.headerTitleElement),this.previousIcon.appendChild(this.createElement("span",{className:"e-date-icon-prev "+x7})),this.nextIcon.appendChild(this.createElement("span",{className:"e-date-icon-next  "+x7})),t.appendChild(this.previousIcon),t.appendChild(this.nextIcon),this.headerElement.appendChild(t),("calendar"===this.getModuleName()?this.element:this.calendarElement).appendChild(this.headerElement),this.adjustLongHeaderSize()},O7.prototype.createContent=function(){this.contentElement=this.createElement("div",{className:"e-content"}),this.table=this.createElement("table",{attrs:{class:"e-calendar-content-table",tabIndex:"0",role:"grid","aria-activedescendant":"","aria-labelledby":this.element.id}}),("calendar"===this.getModuleName()?this.element:this.calendarElement).appendChild(this.contentElement),this.contentElement.appendChild(this.table),this.createContentHeader(),this.createContentBody(),this.showTodayButton&&this.createContentFooter(),"daterangepicker"!==this.getModuleName()&&(E.add(this.table,"focus",this.addContentFocus,this),E.add(this.table,"blur",this.removeContentFocus,this))},O7.prototype.addContentFocus=function(e){var t=this.tableBodyElement.querySelector("tr td.e-focused-date"),i=this.tableBodyElement.querySelector("tr td.e-selected");je(i)?je(t)||t.classList.add(k7):i.classList.add(k7)},O7.prototype.removeContentFocus=function(e){var t=je(this.tableBodyElement)?null:this.tableBodyElement.querySelector("tr td.e-focused-date"),i=je(this.tableBodyElement)?null:this.tableBodyElement.querySelector("tr td.e-selected");je(i)?je(t)||t.classList.remove(k7):i.classList.remove(k7)},O7.prototype.getCultureValues=function(){var e=[],t=je(this.dayHeaderFormat)?null:"days.stand-alone."+this.dayHeaderFormat.toLowerCase(),i="en"!==this.locale&&"en-US"!==this.locale||je(t)?this.getCultureObjects(Ai,""+this.locale):R(t,Pi());if(!je(i))for(var n=0,o=Object.keys(i);n<o.length;n++){var r=o[n];e.push(R(r,i))}return e},O7.prototype.toCapitalize=function(e){return!je(e)&&e.length?e[0].toUpperCase()+e.slice(1):e},O7.prototype.createContentHeader=function(){"calendar"===this.getModuleName()?je(this.element.querySelectorAll(".e-content .e-week-header")[0])||G(this.element.querySelectorAll(".e-content .e-week-header")[0]):je(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0])||G(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0]);var e="",t=((6<this.firstDayOfWeek||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" aria-hidden="true"></th>',"calendar"===this.getModuleName()?U([this.element],E7):U([this.calendarElement],E7)),0<this.getCultureValues().length&&this.getCultureValues()?this.shiftArray(0<this.getCultureValues().length&&this.getCultureValues(),this.firstDayOfWeek):null);if(!je(t))for(var i=0;i<=6;i++)e+='<th  class="">'+this.toCapitalize(t[i])+"</th>";this.tableHeadElement.innerHTML=e="<tr>"+e+"</tr>",this.table.appendChild(this.tableHeadElement)},O7.prototype.createContentBody=function(){switch("calendar"===this.getModuleName()?je(this.element.querySelectorAll(".e-content tbody")[0])||G(this.element.querySelectorAll(".e-content tbody")[0]):je(this.calendarElement.querySelectorAll(".e-content tbody")[0])||G(this.calendarElement.querySelectorAll(".e-content tbody")[0]),this.start){case"Year":this.renderYears();break;case"Decade":this.renderDecades();break;default:this.renderMonths()}},O7.prototype.updateFooter=function(){this.todayElement.textContent=this.l10.getConstant("today"),this.todayElement.setAttribute("aria-label",this.l10.getConstant("today")),this.todayElement.setAttribute("tabindex","0")},O7.prototype.createContentFooter=function(){var e,t;this.showTodayButton&&(e=new Date(+this.min),t=new Date(+this.max),this.globalize=new Ti(this.locale),this.l10=new Cn(this.getModuleName(),{today:"Today"},this.locale),this.todayElement=this.createElement("button",{attrs:{role:"button"}}),Ht(this.todayElement),this.updateFooter(),U([this.todayElement],["e-btn",B7,"e-flat","e-primary","e-css"]),+new Date(e.setHours(0,0,0,0))<=+this.todayDate&&+this.todayDate<=+new Date(t.setHours(0,0,0,0))&&!this.todayDisabled||U([this.todayElement],I7),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(I7)||E.add(this.todayElement,"click",this.todayButtonClick,this))},O7.prototype.wireEvents=function(e,t,i,n){E.add(this.headerTitleElement,"click",this.navigateTitle,this),this.defaultKeyConfigs=Pe(this.defaultKeyConfigs,this.keyConfigs),"calendar"===this.getModuleName()?this.keyboardModule=new bn(this.element,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs}):this.keyboardModule=new bn(this.calendarElement,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},O7.prototype.dateWireEvents=function(e,t,i,n){this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=Pe(this.defaultKeyConfigs,i),this.serverModuleName=n},O7.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))},O7.prototype.resetCalendar=function(){this.calendarElement&&G(this.calendarElement),this.tableBodyElement&&G(this.tableBodyElement),this.table&&G(this.table),this.tableHeadElement&&G(this.tableHeadElement),this.nextIcon&&G(this.nextIcon),this.previousIcon&&G(this.previousIcon),this.footer&&G(this.footer),this.todayElement=null,this.renderDayCellArgs=null,this.calendarElement=this.tableBodyElement=this.footer=this.tableHeadElement=this.nextIcon=this.previousIcon=this.table=null},O7.prototype.keyActionHandle=function(e,t,i){if(null!==this.calendarElement||"escape"!==e.action){var n,o,r=this.tableBodyElement.querySelector("tr td.e-focused-date"),s=!i||je(r)||+t!==parseInt(r.getAttribute("id").split("_")[0],10)?this.tableBodyElement.querySelector("tr td.e-selected"):r,a=this.getViewNumber(this.currentView()),i=this.getViewNumber(this.depth),l=a===i&&this.getViewNumber(this.start)>=i;switch(this.effect="",e.action){case"moveLeft":"daterangepicker"===this.getModuleName()||je(e.target)||(this.keyboardNavigate(-1,a,e,this.max,this.min),e.preventDefault());break;case"moveRight":"daterangepicker"===this.getModuleName()||je(e.target)||(this.keyboardNavigate(1,a,e,this.max,this.min),e.preventDefault());break;case"moveUp":"daterangepicker"===this.getModuleName()||je(e.target)||(0===a?this.keyboardNavigate(-7,a,e,this.max,this.min):this.keyboardNavigate(-4,a,e,this.max,this.min),e.preventDefault());break;case"moveDown":"daterangepicker"===this.getModuleName()||je(e.target)||(0===a?this.keyboardNavigate(7,a,e,this.max,this.min):this.keyboardNavigate(4,a,e,this.max,this.min),e.preventDefault());break;case"select":e.target===this.headerTitleElement?this.navigateTitle(e):e.target!==this.previousIcon||e.target.className.includes(I7)?e.target!==this.nextIcon||e.target.className.includes(I7)?e.target!==this.todayElement||e.target.className.includes(I7)?(n=je(r)?s:r,je(n)||n.classList.contains(I7)||(l?(o=new Date(parseInt(""+n.id,0)),this.selectDate(e,o,n),"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||(this.isAngular?this.inputElement:this.element).focus()):e.target.className.includes(I7)||this.contentClick(null,--a,n,t))):(this.todayButtonClick(e,t),"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||(this.isAngular?this.inputElement:this.element).focus()):this.navigateNext(e):this.navigatePrevious(e);break;case"controlUp":this.title(),e.preventDefault();break;case"controlDown":(je(r)||l)&&(je(s)||l)||this.contentClick(null,--a,r||s,t),e.preventDefault();break;case"home":this.currentDate=this.firstDay(this.currentDate),G(this.tableBodyElement),0===a?this.renderMonths(e):1===a?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"end":this.currentDate=this.lastDay(this.currentDate,a),G(this.tableBodyElement),0===a?this.renderMonths(e):1===a?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();break;case"tab":"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||e.target!==this.todayElement||(e.preventDefault(),(this.isAngular?this.inputElement:this.element).focus(),this.hide());break;case"shiftTab":"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||e.target!==this.headerTitleElement||(e.preventDefault(),(this.isAngular?this.inputElement:this.element).focus(),this.hide());break;case"escape":"datepicker"!==this.getModuleName()&&"datetimepicker"!==this.getModuleName()||e.target!==this.headerTitleElement&&e.target!==this.previousIcon&&e.target!==this.nextIcon&&e.target!==this.todayElement||this.hide()}}},O7.prototype.keyboardNavigate=function(e,t,i,n,o){var r=new Date(this.checkValue(this.currentDate));switch(t){case 2:this.addYears(this.currentDate,e),this.isMonthYearRange(this.currentDate)?(G(this.tableBodyElement),this.renderDecades(i)):this.currentDate=r;break;case 1:this.addMonths(this.currentDate,e),this.calendarMode,this.isMonthYearRange(this.currentDate)?(G(this.tableBodyElement),this.renderYears(i)):this.currentDate=r;break;case 0:this.addDay(this.currentDate,e,i,n,o),this.isMinMaxRange(this.currentDate)?(G(this.tableBodyElement),this.renderMonths(i)):this.currentDate=r}},O7.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)}},O7.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)),n=new Date(new Date(+this.max).setHours(0,0,0,0));return+t!=+i&&+t!=+n||+(e=+e<+this.min?new Date(+this.min):e)>+this.max&&(e=new Date(+this.max)),e},O7.prototype.renderMonths=function(e,t,i){var n=this.weekNumber?8:7,i="Gregorian"===this.calendarMode?this.renderDays(this.currentDate,t,null,null,i,e):je(this.islamicModule)?null:this.islamicModule.islamicRenderDays(this.currentDate,t);this.createContentHeader(),"Gregorian"===this.calendarMode?this.renderTemplate(i,n,S7,e,t):je(this.islamicModule)||this.islamicModule.islamicRenderTemplate(i,n,S7,e,t)},O7.prototype.renderDays=function(e,t,i,n,o,r){for(var s=[],a=o?new Date(+e):this.getDate(new Date,this.timezone),l=(h=new Date(this.checkValue(e))).getMonth(),o=(this.titleUpdate(e,"days"),h),h=new Date(o.getFullYear(),o.getMonth(),0,o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds());h.getDay()!==this.firstDayOfWeek;)this.setStartDate(h,-864e5);for(var d=0;d<42;++d){var p,c=this.createElement("td",{className:"e-cell"}),u=this.createElement("span"),u=(d%7==0&&this.weekNumber&&(p="FirstDay"===this.weekRule?6:"FirstFourDayWeek"===this.weekRule?3:0,p=new Date(h.getFullYear(),h.getMonth(),h.getDate()+p),u.textContent=""+this.getWeek(p),c.appendChild(u),U([c],E7),s.push(c)),p=new Date(+h),h=this.minMaxDate(h),{type:"dateTime",skeleton:"full"}),g=this.globalize.parseDate(this.globalize.formatDate(h,u),u),m=this.dayCell(h),c=this.globalize.formatDate(h,{type:"date",skeleton:"full"}),u=this.createElement("span"),f=(u.textContent=this.globalize.formatDate(h,{format:"d",type:"date",skeleton:"yMd"}),this.min>h||this.max<h),y=(f?(U([m],I7),U([m],T7)):u.setAttribute("title",""+c),l!==h.getMonth()&&(U([m],y7),u.setAttribute("aria-disabled","true")),0!==h.getDay()&&6!==h.getDay()||U([m],"e-weekend"),m.appendChild(u),this.renderDayCellArgs={date:h,isDisabled:!1,element:m,isOutOfRange:f},this.renderDayCellArgs);if(this.renderDayCellEvent(y),y.isDisabled){c=new Date(this.checkValue(t)),f=new Date(this.checkValue(y.date));if(i){if(!je(n)&&0<n.length)for(var v=0;v<n.length;v++)+new Date(this.globalize.formatDate(y.date,{type:"date",skeleton:"yMd"}))===+new Date(this.globalize.formatDate(n[v],{type:"date",skeleton:"yMd"}))&&(n.splice(v,1),v=-1)}else c&&+c==+f&&this.setProperties({value:null},!0)}this.renderDayCellArgs.isDisabled&&!m.classList.contains(D7)&&(U([m],I7),U([m],T7),u.setAttribute("aria-disabled","true"),+this.renderDayCellArgs.date==+this.todayDate)&&(this.todayDisabled=!0);var b=m.classList.contains(y7),w=m.classList.contains(I7),C=(w||E.add(m,"click",this.clickHandler,this),void 0);if(je(r)||"click"!==r.type||(C=r.currentTarget),!i||je(n)||w)!w&&this.getDateVal(h,t)&&U([m],D7);else{for(var S=0;S<n.length;S++){var A={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};if((this.globalize.formatDate(h,A)===this.globalize.formatDate(n[S],A)&&this.getDateVal(h,n[S])||this.getDateVal(h,t))&&U([m],D7),!je(C)&&C.innerText===m.innerText&&this.previousDates&&m.classList.contains(D7)&&C.classList.contains(D7)){q([m],D7),this.previousDates=!1;for(var x=this.copyValues(n),I=0;I<x.length;I++){var T={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};this.globalize.formatDate(g,T)===this.globalize.formatDate(x[I],T)&&(v=x.indexOf(x[I]),x.splice(v,1),n.splice(v,1))}this.setProperties({values:x},!0)}else this.updateFocus(b,w,h,m,e)}n.length<=0&&this.updateFocus(b,w,h,m,e)}this.updateFocus(b,w,h,m,e),je(g)||g.getFullYear()!==a.getFullYear()||g.getMonth()!==a.getMonth()||g.getDate()!==a.getDate()||U([m],B7),s.push(this.renderDayCellArgs.element),h=new Date(+p),this.addDay(h,1,null,this.max,this.min)}return s},O7.prototype.updateFocus=function(e,t,i,n,o){(o.getDate()===i.getDate()&&!e&&!t||(o>=this.max&&parseInt(n.id,0)===+this.max&&!e&&!t&&U([n],M7),o<=this.min&&parseInt(n.id,0)===+this.min&&!e&&!t))&&U([n],M7)},O7.prototype.renderYears=function(e,t){this.removeTableHeadElement();var i=[],n=je(t),o=new Date(this.checkValue(this.currentDate)),r=o.getMonth(),s=o.getFullYear(),a=o,l=a.getFullYear(),h=new Date(this.checkValue(this.min)).getFullYear(),d=new Date(this.checkValue(this.min)).getMonth(),p=new Date(this.checkValue(this.max)).getFullYear(),c=new Date(this.checkValue(this.max)).getMonth();a.setMonth(0),this.titleUpdate(this.currentDate,"months"),a.setDate(1);for(var u=0;u<12;++u){var g=this.dayCell(a),m=this.createElement("span"),f=t&&t.getMonth()===a.getMonth(),f=t&&t.getFullYear()===s&&f,y=this.globalize.formatDate(a,{type:"date",format:"MMM y"});m.textContent=this.toCapitalize(this.globalize.formatDate(a,{format:null,type:"dateTime",skeleton:"MMM"})),this.min&&(l<h||u<d&&l===h)||this.max&&(p<l||c<u&&p<=l)?U([g],I7):!n&&f?U([g],D7):a.getMonth()===r&&this.currentDate.getMonth()===r&&U([g],M7),a.setDate(1),a.setMonth(a.getMonth()+1),g.classList.contains(I7)||(E.add(g,"click",this.clickHandler,this),m.setAttribute("title",""+y)),g.appendChild(m),i.push(g)}this.renderTemplate(i,4,C7,e,t)},O7.prototype.renderDecades=function(e,t){this.removeTableHeadElement();var i=[],n=new Date(this.checkValue(this.currentDate)),o=(n.setMonth(0),n.setDate(1),n.getFullYear()),r=new Date(n.setFullYear(o-o%10)),s=new Date(n.setFullYear(o-o%10+9)),a=r.getFullYear(),l=s.getFullYear(),r=this.globalize.formatDate(r,{format:null,type:"dateTime",skeleton:"y"}),s=this.globalize.formatDate(s,{format:null,type:"dateTime",skeleton:"y"});this.headerTitleElement.textContent=r+" - "+s;for(var h=new Date(o-o%10-1,0,1).getFullYear(),d=0;d<12;++d){var p=h+d,c=(n.setFullYear(p),this.dayCell(n)),u=this.createElement("span");u.textContent=this.globalize.formatDate(n,{format:null,type:"dateTime",skeleton:"y"}),p<a||l<p?(U([c],v7),u.setAttribute("aria-disabled","true"),je(t)||n.getFullYear()!==t.getFullYear()||U([c],D7),(p<new Date(this.checkValue(this.min)).getFullYear()||p>new Date(this.checkValue(this.max)).getFullYear())&&U([c],I7)):p<new Date(this.checkValue(this.min)).getFullYear()||p>new Date(this.checkValue(this.max)).getFullYear()?U([c],I7):je(t)||n.getFullYear()!==t.getFullYear()?n.getFullYear()!==this.currentDate.getFullYear()||c.classList.contains(I7)||U([c],M7):U([c],D7),c.classList.contains(I7)||(E.add(c,"click",this.clickHandler,this),u.setAttribute("title",""+u.textContent)),c.appendChild(u),i.push(c)}this.renderTemplate(i,4,"e-decade",e,t)},O7.prototype.dayCell=function(e){var t,i={skeleton:"full",type:"dateTime",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"},e=this.globalize.parseDate(this.globalize.formatDate(e,i),i),i={className:"e-cell",attrs:{id:""+D(""+(t=je(e)?t:e.valueOf())),"aria-selected":"false"}};return this.createElement("td",i)},O7.prototype.firstDay=function(e){var t="Decade"!==this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+y7+"):not(."+E7+")"):this.tableBodyElement.querySelectorAll("td:not(."+v7);if(t.length)for(var i=0;i<t.length;i++)if(!t[i].classList.contains(I7)){e=new Date(parseInt(t[i].id,0));break}return e},O7.prototype.lastDay=function(e,t){var i=new Date(e.getFullYear(),e.getMonth()+1,0);return 2!==t?((t=Math.abs(i.getTimezoneOffset()-this.firstDay(e).getTimezoneOffset()))&&i.setHours(this.firstDay(e).getHours()+t/60),this.findLastDay(i)):this.findLastDay(this.firstDay(i))},O7.prototype.checkDateValue=function(e){return!je(e)&&e instanceof Date&&!isNaN(+e)?e:null},O7.prototype.findLastDay=function(e){var t="Decade"===this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+v7):this.tableBodyElement.querySelectorAll("td:not(."+y7+"):not(."+E7+")");if(t.length)for(var i=t.length-1;0<=i;i--)if(!t[i].classList.contains(I7)){e=new Date(parseInt(t[i].id,0));break}return e},O7.prototype.removeTableHeadElement=function(){"calendar"===this.getModuleName()?je(this.element.querySelectorAll(".e-content table thead")[0])||G(this.tableHeadElement):je(this.calendarElement.querySelectorAll(".e-content table thead")[0])||G(this.tableHeadElement)},O7.prototype.renderTemplate=function(e,t,i,n,o){for(var r,s=this.getViewNumber(this.currentView()),a=(this.tableBodyElement=this.createElement("tbody"),this.table.appendChild(this.tableBodyElement),q([this.contentElement,this.headerElement],[S7,A7,C7]),U([this.contentElement,this.headerElement],[i]),t),l=0,h=0;h<e.length/t;++h){for(r=this.createElement("tr"),l=0+l;l<a;l++)e[l].classList.contains("e-week-number")||je(e[l].children[0])||(U([e[l].children[0]],["e-day"]),Ht(e[l].children[0],{duration:600,isCenterRipple:!0})),r.appendChild(e[l]),this.weekNumber&&7===l&&e[7].classList.contains(y7)&&U([r],P7),!this.weekNumber&&6===l&&e[6].classList.contains(y7)&&U([r],P7),this.weekNumber?41===l&&e[41].classList.contains(y7)&&U([r],P7):35===l&&e[35].classList.contains(y7)&&U([r],P7);a+=t,l+=0,this.tableBodyElement.appendChild(r)}this.table.querySelector("tbody").className=this.effect,"Gregorian"===this.calendarMode?this.iconHandler():this.islamicModule.islamicIconHandler(),(s!==this.getViewNumber(this.currentView())||0===s&&s!==this.getViewNumber(this.currentView()))&&this.navigateHandler(n),this.setAriaActiveDescendant()},O7.prototype.clickHandler=function(e,t){this.clickEventEmitter(e);var i=e.currentTarget,n=this.getViewNumber(this.currentView());i.classList.contains(y7)?this.contentClick(e,0,null,t):n===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)||2===n?this.contentClick(e,1,null,t):i.classList.contains(y7)||0!==n?this.contentClick(e,0,i,t):this.selectDate(e,this.getIdValue(e,null),null),"calendar"===this.getModuleName()&&this.table.focus()},O7.prototype.clickEventEmitter=function(e){e.preventDefault()},O7.prototype.contentClick=function(e,t,i,n){var o,r=this.getViewNumber(this.currentView()),s=this.getIdValue(e,i);switch(t){case 0:r===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?(G(this.tableBodyElement),this.currentDate=s,this.effect=F7):("Gregorian"===this.calendarMode?(this.currentDate.setMonth(s.getMonth()),0<s.getMonth()&&this.currentDate.getMonth()!==s.getMonth()&&this.currentDate.setDate(0),this.currentDate.setFullYear(s.getFullYear())):this.currentDate=s,this.effect=F7,G(this.tableBodyElement)),this.renderMonths(e);break;case 1:r===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?this.selectDate(e,s,null):("Gregorian"===this.calendarMode?this.currentDate.setFullYear(s.getFullYear()):(this.islamicPreviousHeader=this.headerElement.textContent,o=this.islamicModule.getIslamicDate(s),this.currentDate=this.islamicModule.toGregorian(o.year,o.month,1)),this.effect=F7,G(this.tableBodyElement),this.renderYears(e))}},O7.prototype.switchView=function(e,t,i,n){switch(e){case 0:G(this.tableBodyElement),this.renderMonths(t,null,n);break;case 1:G(this.tableBodyElement),this.renderYears(t);break;case 2:G(this.tableBodyElement),this.renderDecades(t)}},O7.prototype.getModuleName=function(){return"calendar"},O7.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),e},O7.prototype.getPersistData=function(){return this.addOnPersist(["value"])},O7.prototype.onPropertyChanged=function(e,t,i,n){this.effect="";for(var o=0,r=Object.keys(e);o<r.length;o++){var s=r[o];switch(s){case"enableRtl":e.enableRtl?("calendar"===this.getModuleName()?this.element:this.calendarElement).classList.add("e-rtl"):("calendar"===this.getModuleName()?this.element:this.calendarElement).classList.remove("e-rtl");break;case"dayHeaderFormat":this.getCultureValues(),("datepicker"!==this.getModuleName()||this.calendarElement)&&this.createContentHeader(),this.adjustLongHeaderSize();break;case"min":case"max":this.rangeValidation(this.min,this.max),"min"===s?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&&G(this.tableBodyElement),this.minMaxUpdate(),i&&this.validateValues(i,n),("datepicker"!==this.getModuleName()||this.calendarElement)&&this.createContentBody(),(this.todayDate<this.min||this.max<this.todayDate)&&this.footer&&this.todayElement?(G(this.todayElement),G(this.footer),this.todayElement=this.footer=null,this.createContentFooter()):this.footer&&this.todayElement&&this.todayElement.classList.contains("e-disabled")&&(q([this.todayElement],I7),G(this.todayElement),G(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.calendarElement)&&(this.createContentHeader(),this.createContentBody());break;case"locale":this.globalize=new Ti(this.locale),("datepicker"!==this.getModuleName()||this.calendarElement)&&(this.createContentHeader(),this.createContentBody()),"calendar"===this.getModuleName()&&(this.l10=new Cn(this.getModuleName(),{today:"Today"},this.locale)),this.l10.setLocale(this.locale),this.showTodayButton&&this.updateFooter();break;case"showTodayButton":e.showTodayButton?this.createContentFooter():je(this.todayElement)||je(this.footer)||(G(this.todayElement),G(this.footer),this.todayElement=this.footer=void 0),this.setProperties({showTodayButton:e.showTodayButton},!0)}}},O7.prototype.validateValues=function(e,t){if(e&&!je(t)&&0<t.length){for(var i=this.copyValues(t),n=0;n<i.length;n++){var o=i[n],r="Gregorian"===this.calendarMode?"gregorian":"islamic",s=void 0,s="Gregorian"===this.calendarMode?this.globalize.formatDate(o,{type:"date",skeleton:"yMd"}):this.globalize.formatDate(o,{type:"dateTime",skeleton:"full",calendar:"islamic"}),o=this.globalize.formatDate(this.min,{type:"date",skeleton:"yMd",calendar:r}),r=this.globalize.formatDate(this.max,{type:"date",skeleton:"yMd",calendar:r});(+new Date(s)<+new Date(o)||+new Date(s)>+new Date(r))&&(i.splice(n,1),n=-1)}this.setProperties({values:i},!0)}},O7.prototype.setValueUpdate=function(){je(this.tableBodyElement)||(G(this.tableBodyElement),this.setProperties({start:this.currentView()},!0),this.createContentBody())},O7.prototype.copyValues=function(e){var t=[];if(!je(e)&&0<e.length)for(var i=0;i<e.length;i++)t.push(new Date(+e[i]));return t},O7.prototype.titleUpdate=function(e,t){var i,n=new Ti(this.locale),o="Gregorian"===this.calendarMode?"gregorian":"islamic",r="Gregorian"===this.calendarMode?(i=n.formatDate(e,{type:"dateTime",skeleton:"yMMMM",calendar:o}),n.formatDate(e,{format:null,type:"dateTime",skeleton:"y",calendar:o})):(i=n.formatDate(e,{type:"dateTime",format:"MMMM y",calendar:o}),n.formatDate(e,{type:"dateTime",format:"y",calendar:o}));switch(t){case"days":this.headerTitleElement.textContent=this.toCapitalize(i);break;case"months":this.headerTitleElement.textContent=r}},O7.prototype.setActiveDescendant=function(){var e,t=this.tableBodyElement.querySelector("tr td.e-focused-date"),i=this.tableBodyElement.querySelector("tr td.e-selected"),n="Gregorian"===this.calendarMode?"gregorian":"islamic",o=this.currentView(),o="Month"===o?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"full",calendar:n}):"Year"===o?"islamic"!=n?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"yMMMM",calendar:n}):this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"GyMMM",calendar:n}):this.globalize.formatDate(this.currentDate,{format:null,type:"date",skeleton:"y",calendar:n});return(i||t)&&(je(i)||i.setAttribute("aria-selected","true"),(t||i).setAttribute("aria-label",o),e=(t||i).getAttribute("id")),e},O7.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(-1<this.compareMonth(new Date(this.checkValue(this.currentDate)),this.max));break;case"Year":this.previousIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(-1<this.compareYear(new Date(this.checkValue(this.currentDate)),this.max));break;case"Decade":this.previousIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(-1<this.compareDecade(new Date(this.checkValue(this.currentDate)),this.max))}},O7.prototype.destroy=function(){("calendar"===this.getModuleName()&&this.element||this.calendarElement&&this.element)&&q([this.element],[b7]),"calendar"===this.getModuleName()&&this.element&&(je(this.headerTitleElement)||E.remove(this.headerTitleElement,"click",this.navigateTitle),this.todayElement&&E.remove(this.todayElement,"click",this.todayButtonClick),this.previousIconHandler(!0),this.nextIconHandler(!0),this.keyboardModule.destroy(),this.element.removeAttribute("data-role"),je(this.calendarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.element&&(this.element.innerHTML=""),this.todayElement=null,this.tableBodyElement=null,this.todayButtonEvent=null,this.renderDayCellArgs=null,this.headerElement=null,this.nextIcon=null,this.table=null,this.tableHeadElement=null,this.previousIcon=null,this.headerTitleElement=null,this.footer=null,this.contentElement=null,m7.prototype.destroy.call(this)},O7.prototype.title=function(e){var t=this.getViewNumber(this.currentView());this.effect=F7,this.switchView(++t,e)},O7.prototype.getViewNumber=function(e){return"Month"===e?0:"Year"===e?1:2},O7.prototype.navigateTitle=function(e){e.preventDefault(),this.title(e)},O7.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)}},O7.prototype.navigatePrevious=function(e){F.isDevice||e.preventDefault(),"Gregorian"===this.calendarMode?this.previous():this.islamicModule.islamicPrevious(),this.triggerNavigate(e)},O7.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)}},O7.prototype.navigateNext=function(e){F.isDevice||e.preventDefault(),"Gregorian"===this.calendarMode?this.next():this.islamicModule.islamicNext(),this.triggerNavigate(e)},O7.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)},O7.prototype.currentView=function(){return!je(this.contentElement)&&this.contentElement.classList.contains(C7)?"Year":!je(this.contentElement)&&this.contentElement.classList.contains(A7)?"Decade":"Month"},O7.prototype.getDateVal=function(e,t){return!je(t)&&e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},O7.prototype.getCultureObjects=function(e,t){var i=je(this.dayHeaderFormat)?null:".dates.calendars.gregorian.days.format."+this.dayHeaderFormat.toLowerCase(),n=je(this.dayHeaderFormat)?null:".dates.calendars.islamic.days.format."+this.dayHeaderFormat.toLowerCase();return"Gregorian"===this.calendarMode?R("main."+this.locale+i,e):R("main."+this.locale+n,e)},O7.prototype.getWeek=function(e){var t=new Date(this.checkValue(e)).valueOf(),e=new Date(e.getFullYear(),0,1).valueOf();return Math.ceil((t-e+864e5)/864e5/7)},O7.prototype.setStartDate=function(e,t){var i=e.getTimezoneOffset(),t=new Date(e.getTime()+t),i=t.getTimezoneOffset()-i;e.setTime(t.getTime()+6e4*i)},O7.prototype.addMonths=function(e,t){var i;"Gregorian"===this.calendarMode?(i=e.getDate(),e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,this.getMaxDays(e)))):(i=this.islamicModule.getIslamicDate(e),this.currentDate=this.islamicModule.toGregorian(i.year,i.month+t,1))},O7.prototype.addYears=function(e,t){var i;"Gregorian"===this.calendarMode?(i=e.getDate(),e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,this.getMaxDays(e)))):(i=this.islamicModule.getIslamicDate(e),this.currentDate=this.islamicModule.toGregorian(i.year+t,i.month,1))},O7.prototype.getIdValue=function(e,t){e=e?e.currentTarget:t,t={type:"dateTime",skeleton:"full",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"},e=this.globalize.formatDate(new Date(parseInt(""+e.getAttribute("id"),0)),t),e=this.globalize.parseDate(e,t),t=e.valueOf()-e.valueOf()%1e3;return new Date(t)},O7.prototype.adjustLongHeaderSize=function(){q([this.element],L7),"Wide"===this.dayHeaderFormat&&U(["calendar"===this.getModuleName()?this.element:this.calendarElement],L7)},O7.prototype.selectDate=function(e,t,i,n,o){var r=i||e.currentTarget,s=(this.isDateSelected=!1,"Decade"===this.currentView()?this.setDateDecade(this.currentDate,t.getFullYear()):"Year"===this.currentView()?this.setDateYear(this.currentDate,t):(n&&!this.checkPresentDate(t,o)?(a=this.copyValues(o),!je(o)&&0<a.length?(a.push(new Date(this.checkValue(t))),this.setProperties({values:a},!0),this.setProperties({value:o[o.length-1]},!0)):this.setProperties({values:[new Date(this.checkValue(t))]},!0)):this.setProperties({value:new Date(this.checkValue(t))},!0),this.currentDate=new Date(this.checkValue(t))),z(r,"."+b7));if(je(s)&&(s=this.tableBodyElement),n||je(s.querySelector("."+D7))||q([s.querySelector("."+D7)],D7),n||je(s.querySelector("."+M7))||q([s.querySelector("."+M7)],M7),n||je(s.querySelector("."+k7))||q([s.querySelector("."+k7)],k7),n){for(var a=this.copyValues(o),l=Array.prototype.slice.call(this.tableBodyElement.querySelectorAll("td")),h=0;h<l.length;h++){var d=s.querySelectorAll("td."+M7)[0],p=s.querySelectorAll("td."+D7)[0];l[h]===d&&q([l[h]],M7),l[h]!==p||this.checkPresentDate(new Date(parseInt(p.getAttribute("id").split("_")[0],10)),o)||q([l[h]],D7)}if(r.classList.contains(D7)){q([r],D7);for(var c=0;c<a.length;c++){var u={format:null,type:"date",skeleton:"short",calendar:"Gregorian"===this.calendarMode?"gregorian":"islamic"};this.globalize.formatDate(t,u)===this.globalize.formatDate(a[c],u)&&(h=a.indexOf(a[c]),a.splice(h,1),U([r],M7))}this.setProperties({values:a},!0)}else U([r],D7)}else U([r],D7);this.isDateSelected=!0},O7.prototype.checkPresentDate=function(e,t){var i=!1;if(!je(t))for(var n=0;n<t.length;n++){var o="Gregorian"===this.calendarMode?"gregorian":"islamic";this.globalize.formatDate(e,{format:null,type:"date",skeleton:"short",calendar:o})===this.globalize.formatDate(t[n],{format:null,type:"date",skeleton:"short",calendar:o})&&(i=!0)}return i},O7.prototype.setAriaActiveDescendant=function(){pt(this.table,{"aria-activedescendant":""+this.setActiveDescendant()})},O7.prototype.previousIconHandler=function(e){e?je(this.previousIcon)||(E.remove(this.previousIcon,"click",this.navigatePreviousHandler),U([this.previousIcon],I7),U([this.previousIcon],T7),this.previousIcon.setAttribute("aria-disabled","true")):(E.add(this.previousIcon,"click",this.navigatePreviousHandler),q([this.previousIcon],I7),q([this.previousIcon],T7),this.previousIcon.setAttribute("aria-disabled","false"))},O7.prototype.renderDayCellEvent=function(e){Pe(this.renderDayCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},O7.prototype.navigatedEvent=function(e){Pe(this.navigatedArgs,{name:"navigated",event:e}),this.trigger("navigated",this.navigatedArgs)},O7.prototype.triggerNavigate=function(e){this.navigatedArgs={view:this.currentView(),date:this.currentDate},this.navigatedEvent(e)},O7.prototype.nextIconHandler=function(e){e?je(this.previousIcon)||(E.remove(this.nextIcon,"click",this.navigateNextHandler),U([this.nextIcon],I7),U([this.nextIcon],T7),this.nextIcon.setAttribute("aria-disabled","true")):(E.add(this.nextIcon,"click",this.navigateNextHandler),q([this.nextIcon],I7),q([this.nextIcon],T7),this.nextIcon.setAttribute("aria-disabled","false"))},O7.prototype.compare=function(e,t,i){var t=t.getFullYear(),n=t,o=0;return i&&(n=(t-=t%i)-t%i+i-1),e.getFullYear()>n?o=1:e.getFullYear()<t&&(o=-1),o},O7.prototype.isMinMaxRange=function(e){return+e>=+this.min&&+e<=+this.max},O7.prototype.isMonthYearRange=function(e){return"Gregorian"===this.calendarMode?e.getMonth()>=this.min.getMonth()&&e.getFullYear()>=this.min.getFullYear()&&e.getMonth()<=this.max.getMonth()&&e.getFullYear()<=this.max.getFullYear():(e=this.islamicModule.getIslamicDate(e)).month>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).month&&e.year>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).year&&e.month<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).month&&e.year<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).year},O7.prototype.compareYear=function(e,t){return this.compare(e,t,0)},O7.prototype.compareDecade=function(e,t){return this.compare(e,t,10)},O7.prototype.shiftArray=function(e,t){return e.slice(t).concat(e.slice(0,t))},O7.prototype.addDay=function(e,t,i,n,o){var r=t,s=new Date(+e);if(!je(this.tableBodyElement)&&!je(i)){for(;this.findNextTD(new Date(+e),r,n,o);)r+=t;i=new Date(s.setDate(s.getDate()+r)),r=+n<+i||+i<+o?r===t?t-t:t:r}e.setDate(e.getDate()+r)},O7.prototype.findNextTD=function(e,t,i,n){var o=new Date(e.setDate(e.getDate()+t)),r=[],s=!1;if(r=(!je(o)&&o.getMonth())===(!je(this.currentDate)&&this.currentDate.getMonth())?("Gregorian"===this.calendarMode?this.renderDays(o):this.islamicModule.islamicRenderDays(this.currentDate,o)).filter(function(e){return e.classList.contains(I7)}):this.tableBodyElement.querySelectorAll("td."+I7),+o<=+i&&+n<=+o&&r.length)for(var a=0;a<r.length&&!(s=+o==+new Date(parseInt(r[a].id,0)));a++);return s},O7.prototype.getMaxDays=function(e){for(var t=new Date(this.checkValue(e)),i=28,n=t.getMonth();t.getMonth()===n;)t.setDate(++i);return i-1},O7.prototype.setDateDecade=function(e,t){e.setFullYear(t),this.setProperties({value:new Date(this.checkValue(e))},!0)},O7.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)},O7.prototype.compareMonth=function(e,t){e=e.getFullYear()>t.getFullYear()?1:e.getFullYear()<t.getFullYear()?-1:e.getMonth()===t.getMonth()?0:e.getMonth()>t.getMonth()?1:-1;return e},O7.prototype.checkValue=function(e){return e instanceof Date?e.toUTCString():""+e},O7.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)},O7.prototype.getDate=function(e,t){return e=t?new Date(e.toLocaleString("en-US",{timeZone:t})):e},f7([e(new Date(1900,0,1))],O7.prototype,"min",void 0),f7([e(!0)],O7.prototype,"enabled",void 0),f7([e(null)],O7.prototype,"cssClass",void 0),f7([e(new Date(2099,11,31))],O7.prototype,"max",void 0),f7([e(null)],O7.prototype,"firstDayOfWeek",void 0),f7([e("Gregorian")],O7.prototype,"calendarMode",void 0),f7([e("Month")],O7.prototype,"start",void 0),f7([e("Month")],O7.prototype,"depth",void 0),f7([e(!1)],O7.prototype,"weekNumber",void 0),f7([e("FirstDay")],O7.prototype,"weekRule",void 0),f7([e(!0)],O7.prototype,"showTodayButton",void 0),f7([e("Short")],O7.prototype,"dayHeaderFormat",void 0),f7([e(!1)],O7.prototype,"enablePersistence",void 0),f7([e(null)],O7.prototype,"keyConfigs",void 0),f7([e(null)],O7.prototype,"serverTimezoneOffset",void 0),f7([i()],O7.prototype,"created",void 0),f7([i()],O7.prototype,"destroyed",void 0),f7([i()],O7.prototype,"navigated",void 0),f7([i()],O7.prototype,"renderDayCell",void 0),f7([Bt],O7));function O7(e,t){e=m7.call(this,e,t)||this;return e.effect="",e.isPopupClicked=!1,e.isDateSelected=!0,e.isTodayClicked=!1,e.preventChange=!1,e.previousDates=!1,e}bQ(_7,N7=R7),_7.prototype.render=function(){if("Islamic"===this.calendarMode&&void 0===this.islamicModule&&O("Requires the injectable Islamic modules to render Calendar in Islamic mode"),this.isMultiSelection&&"object"==typeof this.values&&!je(this.values)&&0<this.values.length){for(var e=[],t=[],i=0;i<this.values.length;i++)-1===e.indexOf(+this.values[i])&&(e.push(+this.values[i]),t.push(this.values[i]));this.setProperties({values:t},!0);for(var n,o=0;o<this.values.length;o++)this.checkDateValue(this.values[o])||("string"==typeof this.values[o]&&this.checkDateValue(new Date(this.checkValue(this.values[o])))?(n=new Date(this.checkValue(this.values[o])),this.values.splice(o,1),this.values.splice(o,0,n)):this.values.splice(o,1));this.setProperties({value:this.values[this.values.length-1]},!0),this.previousValues=this.values.length}var r;this.validateDate(),this.minMaxUpdate(),"calendar"===this.getModuleName()&&(this.setEnable(this.enabled),this.setClass(this.cssClass)),N7.prototype.render.call(this),"calendar"===this.getModuleName()&&((r=z(this.element,"form"))&&E.add(r,"reset",this.formResetHandler.bind(this)),this.setTimeZone(this.serverTimezoneOffset)),this.renderComplete()},_7.prototype.setEnable=function(e){(e?q:U)([this.element],I7)},_7.prototype.setClass=function(e,t){je(t)||(t=t.replace(/\s+/g," ").trim()),je(e)||(e=e.replace(/\s+/g," ").trim()),je(t)||""===t||q([this.element],t.split(" ")),je(e)||U([this.element],e.split(" "))},_7.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)},_7.prototype.setTimeZone=function(e){!je(this.serverTimezoneOffset)&&this.value&&(e=e+(new Date).getTimezoneOffset()/60,e=this.isDayLightSaving()?e--:e,this.value=new Date(this.value.getTime()+60*e*60*1e3))},_7.prototype.formResetHandler=function(){this.setProperties({value:null},!0)},_7.prototype.validateDate=function(){"string"==typeof this.value&&this.setProperties({value:this.checkDateValue(new Date(this.checkValue(this.value)))},!0),N7.prototype.validateDate.call(this,this.value),!je(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)},_7.prototype.minMaxUpdate=function(){"calendar"===this.getModuleName()&&(!je(this.value)&&this.value<=this.min&&this.min<=this.max?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!je(this.value)&&this.value>=this.max&&this.min<=this.max&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})),"calendar"===this.getModuleName()||je(this.value)?N7.prototype.minMaxUpdate.call(this,this.value):!je(this.value)&&this.value<this.min&&this.min<=this.max?N7.prototype.minMaxUpdate.call(this,this.min):!je(this.value)&&this.value>this.max&&this.min<=this.max&&N7.prototype.minMaxUpdate.call(this,this.max)},_7.prototype.generateTodayVal=function(e){var t=new Date;return je(this.timezone)||(t=N7.prototype.getDate.call(this,t,this.timezone)),e&&je(this.timezone)?(t.setHours(e.getHours()),t.setMinutes(e.getMinutes()),t.setSeconds(e.getSeconds()),t.setMilliseconds(e.getMilliseconds())):t=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0),t},_7.prototype.todayButtonClick=function(e){var t,i;this.showTodayButton&&(t=this.generateTodayVal(this.value),this.setProperties({value:t},!0),this.isTodayClicked=!0,this.todayButtonEvent=e,this.isMultiSelection&&(i=this.copyValues(this.values),N7.prototype.checkPresentDate.call(this,t,this.values)||(i.push(t),this.setProperties({values:i}))),N7.prototype.todayButtonClick.call(this,e,new Date(+this.value)))},_7.prototype.keyActionHandle=function(e){N7.prototype.keyActionHandle.call(this,e,this.value,this.isMultiSelection)},_7.prototype.preRender=function(){var t=this;this.changeHandler=function(e){t.triggerChange(e)},this.checkView(),N7.prototype.preRender.call(this,this.value)},_7.prototype.createContent=function(){this.previousDate=this.value,this.previousDateTime=this.value,N7.prototype.createContent.call(this)},_7.prototype.minMaxDate=function(e){return N7.prototype.minMaxDate.call(this,e)},_7.prototype.renderMonths=function(e,t,i){N7.prototype.renderMonths.call(this,e,this.value,i)},_7.prototype.renderDays=function(e,t,i,n,o,r){e=N7.prototype.renderDays.call(this,e,this.value,this.isMultiSelection,this.values,o,r);return this.isMultiSelection&&N7.prototype.validateValues.call(this,this.isMultiSelection,this.values),e},_7.prototype.renderYears=function(e){"Gregorian"===this.calendarMode?N7.prototype.renderYears.call(this,e,this.value):this.islamicModule.islamicRenderYears(e,this.value)},_7.prototype.renderDecades=function(e){"Gregorian"===this.calendarMode?N7.prototype.renderDecades.call(this,e,this.value):this.islamicModule.islamicRenderDecade(e,this.value)},_7.prototype.renderTemplate=function(e,t,i,n){"Gregorian"===this.calendarMode?N7.prototype.renderTemplate.call(this,e,t,i,n,this.value):this.islamicModule.islamicRenderTemplate(e,t,i,n,this.value),this.changedArgs={value:this.value,values:this.values},n&&"click"===n.type&&n.currentTarget.classList.contains(y7)?this.changeHandler(n):this.changeHandler()},_7.prototype.clickHandler=function(e){var t=e.currentTarget,t=(this.isPopupClicked=!0,t.classList.contains(y7)&&(this.isMultiSelection?-1===(t=this.copyValues(this.values)).toString().indexOf(this.getIdValue(e,null).toString())?(t.push(this.getIdValue(e,null)),this.setProperties({values:t},!0),this.setProperties({value:this.values[this.values.length-1]},!0)):this.previousDates=!0:this.setProperties({value:this.getIdValue(e,null)},!0)),this.currentView());N7.prototype.clickHandler.call(this,e,this.value),this.isMultiSelection&&this.currentDate!==this.value&&!je(this.tableBodyElement.querySelectorAll("."+M7)[0])&&"Year"===t&&this.tableBodyElement.querySelectorAll("."+M7)[0].classList.remove(M7)},_7.prototype.switchView=function(e,t,i,n){N7.prototype.switchView.call(this,e,t,this.isMultiSelection,n)},_7.prototype.getModuleName=function(){return N7.prototype.getModuleName.call(this),"calendar"},_7.prototype.getPersistData=function(){N7.prototype.getPersistData.call(this);return this.addOnPersist(["value","values"])},_7.prototype.onPropertyChanged=function(e,t){this.effect="",this.rangeValidation(this.min,this.max);for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"value":this.isDateSelected&&("string"==typeof e.value?this.setProperties({value:new Date(this.checkValue(e.value))},!0):e.value=new Date(this.checkValue(e.value)),isNaN(+this.value)&&this.setProperties({value:t.value},!0),this.update());break;case"values":if(this.isDateSelected){if("string"==typeof e.values||"number"==typeof e.values)this.setProperties({values:null},!0);else{for(var o=this.copyValues(this.values),r=0;r<o.length;r++){var s=o[r];this.checkDateValue(s)&&!N7.prototype.checkPresentDate.call(this,s,o)&&o.push(s)}this.setProperties({values:o},!0),0<this.values.length&&this.setProperties({value:e.values[e.values.length-1]},!0)}this.validateValues(this.isMultiSelection,this.values),this.update()}break;case"isMultiSelection":this.isDateSelected&&(this.setProperties({isMultiSelection:e.isMultiSelection},!0),this.update());break;case"enabled":this.setEnable(this.enabled);break;case"cssClass":"calendar"===this.getModuleName()&&this.setClass(e.cssClass,t.cssClass);break;default:N7.prototype.onPropertyChanged.call(this,e,t,this.isMultiSelection,this.values)}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},_7.prototype.destroy=function(){var e;N7.prototype.destroy.call(this),"calendar"===this.getModuleName()&&(this.changedArgs=null,e=z(this.element,"form"))&&E.remove(e,"reset",this.formResetHandler.bind(this))},_7.prototype.navigateTo=function(e,t,i){this.minMaxUpdate(),N7.prototype.navigateTo.call(this,e,t,i)},_7.prototype.currentView=function(){return N7.prototype.currentView.call(this)},_7.prototype.addDate=function(e){if("string"!=typeof e&&"number"!=typeof e){var t=this.copyValues(this.values);if("object"==typeof e&&0<e.length)for(var i=e,n=0;n<i.length;n++)this.checkDateValue(i[n])&&!N7.prototype.checkPresentDate.call(this,i[n],t)&&(!je(t)&&0<t.length?t.push(i[n]):t=[new Date(+i[n])]);else this.checkDateValue(e)&&!N7.prototype.checkPresentDate.call(this,e,t)&&(!je(t)&&0<t.length?t.push(e):t=[new Date(+e)]);this.setProperties({values:t},!0),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.validateValues(this.isMultiSelection,t),this.update(),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},_7.prototype.removeDate=function(e){if("string"!=typeof e&&"number"!=typeof e&&!je(this.values)&&0<this.values.length){var t=this.copyValues(this.values);if("object"==typeof e&&0<e.length)for(var i=e,n=0;n<i.length;n++)for(var o=0;o<t.length;o++)+t[o]==+i[n]&&t.splice(o,1);else for(o=0;o<t.length;o++)+t[o]==+e&&t.splice(o,1);this.setProperties({values:t},!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()}},_7.prototype.setTodayDate=function(e){e=new Date(+e);this.setProperties({value:e},!0),N7.prototype.todayButtonClick.call(this,null,e,!0)},_7.prototype.update=function(){this.validateDate(),this.minMaxUpdate(),N7.prototype.setValueUpdate.call(this)},_7.prototype.selectDate=function(e,t,i){N7.prototype.selectDate.call(this,e,t,i,this.isMultiSelection,this.values),this.isMultiSelection&&!je(this.values)&&0<this.values.length&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler(e)},_7.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))},_7.prototype.triggerChange=function(e){!je(this.todayButtonEvent)&&this.isTodayClicked&&(e=this.todayButtonEvent,this.isTodayClicked=!1),this.changedArgs.event=e||null,this.changedArgs.isInteracted=!je(e),je(this.value)||this.setProperties({value:this.value},!0),this.isMultiSelection||+this.value===Number.NaN||(je(this.value)||je(this.previousDate))&&(null!==this.previousDate||isNaN(+this.value))?je(this.values)||this.previousValues===this.values.length||(this.changeEvent(e),this.previousValues=this.values.length):this.changeEvent(e)},f7([e(null)],_7.prototype,"value",void 0),f7([e(null)],_7.prototype,"values",void 0),f7([e(!1)],_7.prototype,"isMultiSelection",void 0),f7([i()],_7.prototype,"change",void 0);var N7,V7=f7([Bt],_7);function _7(e,t){return N7.call(this,e,t)||this}var H7="e-other-month",z7="e-disabled",j7="e-overlay",W7="e-selected",Q7="e-focused-date",U7="e-month-hide",bQ=(q7.prototype.getModuleName=function(){return"islamic"},q7.prototype.islamicTitleUpdate=function(e,t){var i=new Ti(this.calendarInstance.locale);switch(t){case"days":this.calendarInstance.headerTitleElement.textContent=i.formatDate(e,{type:"dateTime",format:"MMMMyyyy",calendar:"islamic"});break;case"months":this.calendarInstance.headerTitleElement.textContent=i.formatDate(e,{type:"dateTime",format:"yyyy",calendar:"islamic"})}},q7.prototype.islamicRenderDays=function(e,t,i,n){for(var o=[],r=new Date(this.islamicInValue(e)),s=(this.islamicTitleUpdate(e,"days"),this.getIslamicDate(r)),a=this.toGregorian(s.year,s.month,1),l=s.month,r=a;r.getDay()!==this.calendarInstance.firstDayOfWeek;)this.calendarInstance.setStartDate(r,-864e5);for(var h=0;h<42;++h){var d=this.calendarInstance.createElement("td",{className:"e-cell"}),p=this.calendarInstance.createElement("span"),d=(h%7==0&&this.calendarInstance.weekNumber&&(p.textContent=""+this.calendarInstance.getWeek(r),d.appendChild(p),U([d],"e-week-number"),o.push(d)),p=new Date(+r),r=this.calendarInstance.minMaxDate(r),{type:"dateTime",skeleton:"full",calendar:"islamic"}),d=this.calendarInstance.globalize.parseDate(this.calendarInstance.globalize.formatDate(r,d),d),c=this.islamicDayCell(r),u=this.calendarInstance.globalize.formatDate(r,{type:"date",skeleton:"full",calendar:"islamic"}),g=this.calendarInstance.createElement("span"),m=(g.textContent=this.calendarInstance.globalize.formatDate(r,{type:"date",skeleton:"d",calendar:"islamic"}),this.calendarInstance.min>r||this.calendarInstance.max<r);m?(U([c],z7),U([c],j7)):g.setAttribute("title",""+u);l!==this.getIslamicDate(r).month&&U([c],H7),0!==r.getDay()&&6!==r.getDay()||U([c],"e-weekend"),c.appendChild(g),this.calendarInstance.renderDayCellArgs={date:r,isDisabled:!1,element:c,isOutOfRange:m};var f=this.calendarInstance.renderDayCellArgs;if(this.calendarInstance.renderDayCellEvent(f),f.isDisabled)if(this.calendarInstance.isMultiSelection){if(!je(this.calendarInstance.values)&&0<this.calendarInstance.values.length)for(var y=0;y<n.length;y++)+new Date(this.calendarInstance.globalize.formatDate(f.date,{type:"date",skeleton:"yMd",calendar:"islamic"}))===+new Date(this.calendarInstance.globalize.formatDate(this.calendarInstance.values[y],{type:"date",skeleton:"yMd",calendar:"islamic"}))&&(this.calendarInstance.values.splice(y,1),y=-1)}else t&&+t==+f.date&&this.calendarInstance.setProperties({value:null},!0);this.calendarInstance.renderDayCellArgs.isDisabled&&!c.classList.contains(W7)&&(U([c],z7),U([c],j7),+this.calendarInstance.renderDayCellArgs.date==+this.calendarInstance.todayDate)&&(this.calendarInstance.todayDisabled=!0);var v=c.classList.contains(H7),b=c.classList.contains(z7);if(b||E.add(c,"click",this.calendarInstance.clickHandler,this.calendarInstance),!this.calendarInstance.isMultiSelection||je(this.calendarInstance.values)||v||b)v||b||!this.calendarInstance.getDateVal(r,t)?this.calendarInstance.updateFocus(v,b,r,c,e):U([c],W7);else{for(var w=0;w<this.calendarInstance.values.length;w++)this.calendarInstance.globalize.formatDate(r,{type:"date",skeleton:"short",calendar:"islamic"})===this.calendarInstance.globalize.formatDate(this.calendarInstance.values[w],{type:"date",skeleton:"short",calendar:"islamic"})&&this.calendarInstance.getDateVal(r,this.calendarInstance.values[w])?U([c],W7):this.calendarInstance.updateFocus(v,b,r,c,e);this.calendarInstance.values.length<=0&&this.calendarInstance.updateFocus(v,b,r,c,e)}d.getDate()===(new Date).getDate()&&d.getMonth()===(new Date).getMonth()&&d.getFullYear()===(new Date).getFullYear()&&U([c],"e-today"),r=new Date(+p),o.push(this.calendarInstance.renderDayCellArgs.element),this.calendarInstance.addDay(r,1,null,this.calendarInstance.max,this.calendarInstance.min)}return o},q7.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=-1<this.islamicCompareMonth(e,this.calendarInstance.max);this.calendarInstance.previousIconHandler(t),this.calendarInstance.nextIconHandler(i);break;case"Year":t=this.hijriCompareYear(e,this.calendarInstance.min)<1,i=-1<this.hijriCompareYear(e,this.calendarInstance.max);this.calendarInstance.previousIconHandler(t),this.calendarInstance.nextIconHandler(i);break;case"Decade":var t=Jt.toGregorian(1361,1,1),i=this.hijriCompareDecade(e,this.calendarInstance.min)<1,n=-1<this.hijriCompareDecade(e,this.calendarInstance.max),i=Jt.toGregorian(this.calendarInstance.headerTitleElement.textContent.split("-")[0].trim(),1,1).getFullYear()===t.getFullYear()||i;this.calendarInstance.previousIconHandler(i),this.calendarInstance.nextIconHandler(n)}},q7.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.nextIconClicked=!0,t.year-this.calendarInstance.headerElement.textContent.split("-")[0].trim()==1&&(t.year=t.year-this.calendarInstance.headerElement.textContent.split("-")[0].trim()==1?t.year+1:t.year),this.calendarInstance.currentDate=this.toGregorian(t.year+10,t.month,1),this.calendarInstance.switchView(e)}},q7.prototype.islamicPrevious=function(){var e=this.calendarInstance.getViewNumber(this.calendarInstance.currentView()),t=(this.calendarInstance.effect="",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.previousIconClicked=!0,this.calendarInstance.currentDate=this.toGregorian(t.year-10,t.month-1,1),this.calendarInstance.switchView(e)}},q7.prototype.islamicRenderYears=function(e,t){this.calendarInstance.removeTableHeadElement();var i=[],n=je(t),o=new Date(this.islamicInValue(this.calendarInstance.currentDate)),r=this.getIslamicDate(o),s=(o=Jt.toGregorian(r.year,1,1),r.month),a=r.year,l=r.year,h=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 u=1;u<=12;++u){var g=this.getIslamicDate(o),o=Jt.toGregorian(g.year,u,1),g=this.islamicDayCell(o),m=this.calendarInstance.createElement("span"),f=t&&this.getIslamicDate(t).month===this.getIslamicDate(o).month,f=t&&this.getIslamicDate(t).year===a&&f;m.textContent=this.calendarInstance.globalize.formatDate(o,{type:"dateTime",format:"MMM",calendar:"islamic"}),this.calendarInstance.min&&(l<h||u<d&&l===h)||this.calendarInstance.max&&(p<l||c<u&&p<=l)?U([g],z7):!n&&f?U([g],W7):this.getIslamicDate(o).month===s&&this.getIslamicDate(this.calendarInstance.currentDate).month===s&&U([g],Q7),g.classList.contains(z7)||E.add(g,"click",this.calendarInstance.clickHandler,this.calendarInstance),g.appendChild(m),i.push(g)}this.islamicRenderTemplate(i,4,"e-year",e,t)},q7.prototype.islamicRenderDecade=function(e,t){this.calendarInstance.removeTableHeadElement();var i=[],n=new Date(this.islamicInValue(this.calendarInstance.currentDate)),o=this.getIslamicDate(n),r=(n=Jt.toGregorian(o.year,1,1)).getFullYear(),s=new Date(this.islamicInValue(r-r%10)),r=new Date(this.islamicInValue(r-r%10+9)),a=(s.getFullYear(),r.getFullYear(),this.calendarInstance.globalize.formatDate(s,{type:"dateTime",format:"y",calendar:"islamic"})),l=this.calendarInstance.globalize.formatDate(r,{type:"dateTime",format:"y",calendar:"islamic"}),h=("ar"===this.calendarInstance.locale&&(a=Number(a.replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1632+48)})),l=Number(l.replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1632+48)}))),this.calendarInstance.headerElement.textContent.split("-"));if((!je(e)&&h[0]!==a&&"home"===e.action||!je(e)&&"keydown"===e.type&&"end"===e.action)&&(a=this.calendarInstance.headerElement.textContent.split("-")[0].trim(),l=this.calendarInstance.headerElement.textContent.split("-")[1].trim()),this.calendarInstance.islamicPreviousHeader&&(a=this.calendarInstance.islamicPreviousHeader.split("-")[0].trim(),l=this.calendarInstance.islamicPreviousHeader.split("-")[1].trim(),this.calendarInstance.islamicPreviousHeader=null),this.calendarInstance.previousIconClicked){var d=0;for(d=0;d<=h.length;d++)(l=l-h[d]==2||h[d]-l==2?(parseInt(l,10)+1).toString():l-h[d]==3||h[d]-l==3?(parseInt(l,10)+2).toString():l-h[d]==4||h[d]-l==4?(parseInt(l,10)+3).toString():l-h[d]==5||h[d]-l==5?(parseInt(l,10)+4).toString():l)-h[d]!=0&&h[d]-l!=0||(l=(parseInt(l,10)-1).toString());l-h[d]!=8&&h[d]-l!=8||(l=(parseInt(l,10)-9).toString(),a=(parseInt(l,10)-9).toString()),l-h[d]!=7&&h[d]-l!=7||(l=(parseInt(l,10)-8).toString(),a=(parseInt(l,10)-9).toString()),l-(a=l-a==10?(parseInt(a,10)+1).toString():l-a==11?(parseInt(a,10)+2).toString():l-a==12?(parseInt(a,10)+3).toString():a)==8&&(a=(parseInt(a,10)-1).toString())}if(this.calendarInstance.nextIconClicked){for(d=0;d<=h.length;d++)(a=a-h[d]!=0&&h[d]-a!=0?a:(parseInt(a,10)+1).toString())-h[d]==2&&a>h[d].trim()&&(a=(parseInt(a,10)-1).toString()),h[d]-a==1&&a<h[d].trim()&&(a=(parseInt(a,10)+2).toString());1<a-this.calendarInstance.headerTitleElement.textContent.split("-")[1].trim()&&(a=(parseInt(this.calendarInstance.headerTitleElement.textContent.split("-")[1].trim(),10)+1).toString(),l=(parseInt(a,10)+9).toString()),l=(l=l-a==10?(parseInt(l,10)-1).toString():l)-a==7?(parseInt(l,10)+2).toString():l-a==8?(parseInt(l,10)+1).toString():l}"ar"===this.calendarInstance.locale?(s=this.calendarInstance.globalize.formatDate(s,{type:"dateTime",format:"y",calendar:"islamic"}),r=this.calendarInstance.globalize.formatDate(r,{type:"dateTime",format:"y",calendar:"islamic"}),this.calendarInstance.headerTitleElement.textContent=s+" - "+r):this.calendarInstance.headerTitleElement.textContent=a+" - "+l,this.calendarInstance.nextIconClicked=this.calendarInstance.previousIconClicked=!1;for(var s=(parseInt(a,10)-2).toString(),p=Math.round(.97*parseInt(a,10)+622),c=Math.round(.97*parseInt(l,10)+622),u=Math.round(.97*parseInt(s,10)+622),g=1;g<=12;++g){var m,f,y=u+g,o=(n.setFullYear(y),n.setDate(1),n.setMonth(0),1<this.getIslamicDate(n).year-o.year&&(n.setMonth(1),g-=1,n.setFullYear(n.getFullYear()-1)),this.getIslamicDate(n)),n=Jt.toGregorian(o.year,1,1);(o.year===parseInt(a,10)-1||o.year>=a&&o.year<=c||o.year===parseInt(l,10)+1)&&(pt(m=this.islamicDayCell(n),{role:"gridcell"}),(f=this.calendarInstance.createElement("span")).textContent=this.calendarInstance.globalize.formatDate(n,{type:"dateTime",format:"y",calendar:"islamic"}),o.year===parseInt(a,10)-1||y<p||c<y&&o.year!==parseInt(l,10)?U([m],H7):y<new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()||y>new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear()?U([m],z7):je(t)||this.getIslamicDate(n).year!==this.getIslamicDate(t).year?n.getFullYear()!==this.calendarInstance.currentDate.getFullYear()||m.classList.contains(z7)||U([m],Q7):U([m],W7),m.classList.contains(z7)||E.add(m,"click",this.calendarInstance.clickHandler,this.calendarInstance),m.appendChild(f),(!je(e)&&"home"===e.action&&o.year.toString()===a||!je(e)&&"end"===e.action&&o.year.toString()===l)&&U([m],Q7),i.push(m))}this.islamicRenderTemplate(i,4,"e-decade",e,t)},q7.prototype.islamicDayCell=function(e){var t={skeleton:"full",type:"dateTime",calendar:"islamic"},e=this.calendarInstance.globalize.formatDate(e,t),e={className:"e-cell",attrs:{id:""+D(""+this.calendarInstance.globalize.parseDate(e,t).valueOf()),"aria-selected":"false",role:"gridcell"}};return this.calendarInstance.createElement("td",e)},q7.prototype.islamicRenderTemplate=function(e,t,i,n,o){for(var r,s=this.calendarInstance.getViewNumber(this.calendarInstance.currentView()),a=(this.calendarInstance.tableBodyElement=this.calendarInstance.createElement("tbody"),this.calendarInstance.table.appendChild(this.calendarInstance.tableBodyElement),q([this.calendarInstance.contentElement,this.calendarInstance.headerElement],["e-month","e-decade","e-year"]),U([this.calendarInstance.contentElement,this.calendarInstance.headerElement],[i]),t),l=0,h=0;h<Math.round(e.length/t);++h){for(r=this.calendarInstance.createElement("tr",{attrs:{role:"row"}}),l=0+l;l<a;l++)e[l].classList.contains("e-week-number")||je(e[l].children[0])||(U([e[l].children[0]],["e-day"]),Ht(e[l].children[0],{duration:600,isCenterRipple:!0})),r.appendChild(e[l]),this.calendarInstance.weekNumber&&7===l&&e[7].classList.contains(H7)&&U([r],U7),!this.calendarInstance.weekNumber&&6===l&&e[6].classList.contains(H7)&&U([r],U7),this.calendarInstance.weekNumber?41===l&&e[41].classList.contains(H7)&&U([r],U7):35===l&&e[35].classList.contains(H7)&&U([r],U7);a+=t,l+=0,this.calendarInstance.tableBodyElement.appendChild(r)}this.calendarInstance.table.querySelector("tbody").className=this.calendarInstance.effect,this.islamicIconHandler(),(s!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView())||0===s&&s!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView()))&&this.calendarInstance.navigateHandler(n),this.calendarInstance.setAriaActiveDescendant(),this.calendarInstance.changedArgs={value:this.calendarInstance.value,values:this.calendarInstance.values},this.calendarInstance.changeHandler()},q7.prototype.islamicCompareMonth=function(e,t){e=this.getIslamicDate(e),t=this.getIslamicDate(t),e=e.year>t.year?1:e.year<t.year?-1:e.month===t.month?0:e.month>t.month?1:-1;return e},q7.prototype.islamicCompare=function(e,t,i){var n=this.getIslamicDate(e),t=this.getIslamicDate(t).year,o=t,r=0;return i&&(o=(t-=t%i)-t%i+i-1),n.year>o?r=1:("Decade"===this.calendarInstance.currentView()&&n.year<t&&!(2060<=e.getFullYear()&&e.getFullYear()<=2069)||n.year<t&&"Year"===this.calendarInstance.currentView())&&(r=-1),r},q7.prototype.getIslamicDate=function(e){return Jt.getHijriDate(e)},q7.prototype.toGregorian=function(e,t,i){return Jt.toGregorian(e,t,i)},q7.prototype.hijriCompareYear=function(e,t){return this.islamicCompare(e,t,0)},q7.prototype.hijriCompareDecade=function(e,t){return this.islamicCompare(e,t,10)},q7.prototype.destroy=function(){this.calendarInstance=null},q7.prototype.islamicInValue=function(e){return e instanceof Date?e.toUTCString():""+e},q7);function q7(e){this.calendarInstance=e}G7=function(e,t){return(G7=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])}))(e,t)};var G7,Y7,f7=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},X7="e-datepicker",K7="e-popup-wrapper",J7="e-input-focus",Z7="e-error",$7="e-active",e9="e-date-overflow",t9="e-selected",i9="e-non-edit",n9=["title","class","style"],o9=(function(e,t){function i(){this.constructor=e}G7(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(r9,Y7=V7),r9.prototype.render=function(){this.initialize(),this.bindEvents(),"Never"!==this.floatLabelType&&HF.calculateWidth(this.inputElement,this.inputWrapper.container),je(this.inputWrapper.buttons[0])||je(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),!je(z(this.element,"fieldset"))&&z(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete(),this.setTimeZone(this.serverTimezoneOffset)},r9.prototype.setTimeZone=function(e){!je(this.serverTimezoneOffset)&&this.value&&(e=e+(new Date).getTimezoneOffset()/60,e=this.isDayLightSaving()?e--:e,this.value=new Date(this.value.getTime()+60*e*60*1e3),this.updateInput())},r9.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)},r9.prototype.setAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):pt(this.inputElement,{readonly:""}),this.updateIconState()},r9.prototype.updateIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&q([this.inputWrapper.container],[i9]):(""===this.inputElement.value?q:U)([this.inputWrapper.container],[i9])},r9.prototype.initialize=function(){this.checkInvalidValue(this.value),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}),this.createInput(),this.updateHtmlAttributeToWrapper(),this.setAllowEdit(),!this.enableMask||this.value||!this.maskedDateValue||"Always"!==this.floatLabelType&&this.floatLabelType&&this.placeholder?this.enableMask||this.updateInput(!0):(this.updateInput(!0),this.updateInputValue(this.maskedDateValue)),this.previousElementValue=this.inputElement.value,this.previousDate=je(this.value)?null:new Date(+this.value),this.inputElement.setAttribute("value",this.inputElement.value),this.inputValueCopy=this.value},r9.prototype.createInput=function(){"datepicker"===this.getModuleName()&&(e={placeholder:this.placeholder},this.globalize=new Ti(this.locale),this.l10n=new Cn("datepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0)),this.fullScreenMode&&F.isDevice&&(this.cssClass+=" e-popup-expand");var e=this.cssClass,t=(je(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),!this.enableMask);this.inputWrapper=HF.createInput({element:this.inputElement,floatLabelType:this.floatLabelType,bindClearAction:t,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:e,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),pt(this.inputElement,{"aria-atomic":"true","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-invalid":"false"}),this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),this.enabled?(this.inputElement.setAttribute("aria-disabled","false"),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.inputElement.setAttribute("aria-disabled","true"),this.inputElement.tabIndex=-1),HF.addAttributes({"aria-label":"select",role:"button"},this.inputWrapper.buttons[0]),U([this.inputWrapper.container],"e-date-wrapper")},r9.prototype.updateInput=function(e,t){var i;void 0===e&&(e=!1),void 0===t&&(t=!1),this.value&&!this.isCalendar()&&this.disabledDates(e,t),isNaN(+new Date(this.checkValue(this.value)))&&this.setProperties({value:null},!0),this.strictMode&&(Y7.prototype.validateDate.call(this),this.minMaxUpdates(),Y7.prototype.minMaxUpdate.call(this)),!je(this.value)&&(e=this.value,t=void 0,i=je(this.formatString)?this.dateTimeFormat:this.formatString,t="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?this.globalize.formatDate(this.value,{format:i,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(this.value,{format:i,type:"dateTime",skeleton:"yMd",calendar:"islamic"}):(i="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.formatDate(this.value,i)),+e<=+this.max&&+e>=+this.min||(i=+e>=+this.max||!+this.value||!+this.value||+e<=+this.min,!this.strictMode&&i))&&this.updateInputValue(t),je(this.value)&&this.strictMode&&(this.enableMask?(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime"})):this.updateInputValue("")),!this.strictMode&&je(this.value)&&this.invalidValueString&&this.updateInputValue(this.invalidValueString),this.changedArgs={value:this.value},this.errorClass(),this.updateIconState()},r9.prototype.minMaxUpdates=function(){!je(this.value)&&this.value<this.min&&this.min<=this.max&&this.strictMode?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!je(this.value)&&this.value>this.max&&this.min<=this.max&&this.strictMode&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})},r9.prototype.checkStringValue=function(e){var t,i=null,n=null,o=null;return"datetimepicker"===this.getModuleName()?(t=new Ti(this.locale),o="Gregorian"===this.calendarMode?(n={format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd"},{format:t.getDatePattern({skeleton:"yMd"}),type:"dateTime"}):(n={format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd",calendar:"islamic"},{format:t.getDatePattern({skeleton:"yMd"}),type:"dateTime",calendar:"islamic"})):n="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},i=je(i=this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(e),n)))&&"datetimepicker"===this.getModuleName()?this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(e),o)):i},r9.prototype.checkInvalidValue=function(e){var t,i,n;e instanceof Date||je(e)||(t=null,"number"==typeof(i=e)&&(i=e.toString()),"datetimepicker"===this.getModuleName()?(e=new Ti(this.locale),"Gregorian"===this.calendarMode?(this.dateTimeFormat,e.getDatePattern({skeleton:"yMd"})):(this.dateTimeFormat,e.getDatePattern({skeleton:"yMd"}))):"Gregorian"===this.calendarMode?this.formatString:this.formatString,e=!1,"string"!=typeof i?e=!(i=null):("string"==typeof i&&(i=i.trim()),(t=this.checkStringValue(i))||(n=/^\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)&&!n.test(i)||/^[a-zA-Z0-9- ]*$/.test(i)||isNaN(+new Date(this.checkValue(i)))?e=!0:t=new Date(i))),e?(this.strictMode||(this.invalidValueString=i),this.setProperties({value:null},!0)):this.setProperties({value:t},!0))},r9.prototype.bindInputEvent=function(){je(this.formatString)&&!this.enableMask||(this.enableMask||-1===this.formatString.indexOf("y")?E.add(this.inputElement,"input",this.inputHandler,this):E.remove(this.inputElement,"input",this.inputHandler))},r9.prototype.bindEvents=function(){E.add(this.inputWrapper.buttons[0],"mousedown",this.dateIconHandler,this),E.add(this.inputElement,"mouseup",this.mouseUpHandler,this),E.add(this.inputElement,"focus",this.inputFocusHandler,this),E.add(this.inputElement,"blur",this.inputBlurHandler,this),E.add(this.inputElement,"keyup",this.keyupHandler,this),this.enableMask&&E.add(this.inputElement,"keydown",this.keydownHandler,this),this.bindInputEvent(),E.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&E.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this),this.formElement&&E.add(this.formElement,"reset",this.resetFormHandler,this),this.defaultKeyConfigs=Pe(this.defaultKeyConfigs,this.keyConfigs),this.keyboardModules=new bn(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},r9.prototype.keydownHandler=function(e){switch(e.code){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":case"Home":case"End":case"Backspace":case"Delete":!this.enableMask||this.popupObj||this.readonly||("Delete"!==e.code&&"Backspace"!==e.code&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}))}},r9.prototype.unBindEvents=function(){je(this.inputWrapper)||E.remove(this.inputWrapper.buttons[0],"mousedown",this.dateIconHandler),E.remove(this.inputElement,"mouseup",this.mouseUpHandler),E.remove(this.inputElement,"focus",this.inputFocusHandler),E.remove(this.inputElement,"blur",this.inputBlurHandler),E.remove(this.inputElement,"change",this.inputChangeHandler),E.remove(this.inputElement,"keyup",this.keyupHandler),this.enableMask&&E.remove(this.inputElement,"keydown",this.keydownHandler),this.showClearButton&&this.inputWrapper.clearButton&&E.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.formElement&&E.remove(this.formElement,"reset",this.resetFormHandler)},r9.prototype.resetFormHandler=function(){var e;this.enabled&&!this.inputElement.disabled&&(e=this.inputElement.getAttribute("value"),"EJS-DATEPICKER"!==this.element.tagName&&"EJS-DATETIMEPICKER"!==this.element.tagName||(e="",this.inputValueCopy=null,this.inputElement.setAttribute("value","")),this.setProperties({value:this.inputValueCopy},!0),this.restoreValue(),this.inputElement)&&(this.updateInputValue(e),this.errorClass())},r9.prototype.restoreValue=function(){this.currentDate=this.value||new Date,this.previousDate=this.value,this.previousElementValue=je(this.inputValueCopy)?"":this.globalize.formatDate(this.inputValueCopy,{format:this.formatString,type:"dateTime",skeleton:"yMd"})},r9.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},r9.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&E.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},r9.prototype.resetHandler=function(e){this.enabled&&(e.preventDefault(),this.clear(e))},r9.prototype.mouseUpHandler=function(e){this.enableMask&&(e.preventDefault(),this.notify("setMaskSelection",{module:"MaskedDateTime"}))},r9.prototype.clear=function(e){var t;this.setProperties({value:null},!0),this.enableMask||this.updateInputValue(""),this.trigger("cleared",{event:e}),this.invalidValueString="",this.updateInput(),this.popupUpdate(),this.changeEvent(e),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),z(this.element,"form")&&(e=this.element,(t=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(t))},r9.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnDateIconClick")},r9.prototype.updateInputValue=function(e){HF.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},r9.prototype.dateIconHandler=function(e){this.enabled&&(this.isIconClicked=!0,F.isDevice&&(this.inputElement.setAttribute("readonly",""),this.inputElement.blur()),e.preventDefault(),this.readonly||(this.isCalendar()?this.hide(e):(this.isDateIconClicked=!0,this.show(null,e),"datetimepicker"===this.getModuleName()&&this.inputElement.focus(),this.inputElement.focus(),U([this.inputWrapper.container],[J7]),U(this.inputWrapper.buttons,$7))),this.isIconClicked=!1)},r9.prototype.updateHtmlAttributeToWrapper=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i,n=t[e];je(this.htmlAttributes[""+n])||-1<n9.indexOf(n)&&("class"===n?""!==(i=this.htmlAttributes[""+n].replace(/\s+/g," ").trim())&&U([this.inputWrapper.container],i.split(" ")):"style"===n?(je(i=this.inputWrapper.container.getAttribute(n))?i=this.htmlAttributes[""+n]:";"===i.charAt(i.length-1)?i+=this.htmlAttributes[""+n]:i=i+";"+this.htmlAttributes[""+n],this.inputWrapper.container.setAttribute(n,i)):this.inputWrapper.container.setAttribute(n,this.htmlAttributes[""+n]))}},r9.prototype.updateHtmlAttributeToElement=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];n9.indexOf(i)<0&&this.inputElement.setAttribute(i,this.htmlAttributes[""+i])}},r9.prototype.updateCssClass=function(e,t){je(t)||(t=t.replace(/\s+/g," ").trim()),je(e)||(e=e.replace(/\s+/g," ").trim()),HF.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&HF.setCssClass(e,[this.popupWrapper],t)},r9.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()}},r9.prototype.inputFocusHandler=function(){var e;this.isFocused=!0,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),this.enableMask&&this.showClearButton&&this.inputElement&&this.inputElement.value===this.maskedDateValue&&this.inputWrapper&&this.inputWrapper.clearButton&&!this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.inputWrapper.clearButton.classList.add("e-clear-icon-hide"),this.isDateIconClicked=!(e={model:this}),this.trigger("focus",e),this.updateIconState(),this.openOnFocus)&&!this.isIconClicked&&this.show()},r9.prototype.inputHandler=function(e){this.isPopupClicked=!1,this.enableMask&&(je(e)||je(e.inputType)||"insertFromPaste"!==e.inputType?this.notify("inputHandler",{module:"MaskedDateTime"}):this.notify("maskPasteInputHandler",{module:"MaskedDateTime"}))},r9.prototype.inputBlurHandler=function(e){this.enabled&&(this.strictModeUpdate(),""===this.inputElement.value&&je(this.value)&&(this.invalidValueString=null,this.updateInputValue("")),this.isBlur=!0,this.updateInput(!1,!0),this.isBlur=!1,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()&&this.trigger("blur",{model:this}),this.isCalendar()&&(this.defaultKeyConfigs=Pe(this.defaultKeyConfigs,this.keyConfigs),this.calendarKeyboardModules=new bn(this.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:this.calendarKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})),this.isPopupClicked=!1)},r9.prototype.documentHandler=function(e){je(this.popupObj)||je(this.inputWrapper)||!(this.inputWrapper.container.contains(e.target)&&"mousedown"!==e.type||this.popupObj.element&&this.popupObj.element.contains(e.target))||"touchstart"===e.type||e.preventDefault();var t=e.target;z(t,".e-datepicker.e-popup-wrapper")||je(this.inputWrapper)||z(t,".e-input-group")===this.inputWrapper.container||t.classList.contains("e-day")||t.classList.contains("e-dlg-overlay")?z(t,".e-datepicker.e-popup-wrapper")&&(t.classList.contains("e-day")&&!je(e.target.parentElement)&&e.target.parentElement.classList.contains("e-selected")&&z(t,".e-content")&&z(t,".e-content").classList.contains("e-"+this.depth.toLowerCase())||z(t,".e-footer-container")&&t.classList.contains("e-today")&&t.classList.contains("e-btn")&&+new Date(+this.value)==+Y7.prototype.generateTodayVal.call(this,this.value))&&this.hide(e):(this.hide(e),this.focusOut())},r9.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.strictModeUpdate(),this.updateInput(),this.changeTrigger(e),"datepicker"===this.getModuleName()&&this.show(null,e);break;case"escape":this.hide(e);break;case"enter":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,n=this.inputElement.selectionStart,o=this.inputElement.selectionEnd;!this.enableMask||this.popupObj||this.readonly||(i=this.inputElement.value.length,(0===n&&o===i||o!==i&&"tab"===e.action||0!==n&&"shiftTab"===e.action)&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}),n=this.inputElement.selectionStart,o=this.inputElement.selectionEnd),this.strictModeUpdate(),this.updateInput(),this.popupUpdate(),this.changeTrigger(e),this.errorClass(),this.enableMask&&(this.inputElement.selectionStart=n,this.inputElement.selectionEnd=o),"tab"===e.action&&e.target===this.inputElement&&this.isCalendar()&&document.activeElement===this.inputElement&&(e.preventDefault(),this.headerTitleElement.focus()),"shiftTab"===e.action&&e.target===this.inputElement&&this.isCalendar()&&document.activeElement===this.inputElement&&this.hide(e);break;default:this.defaultAction(e),"select"===e.action&&t===this.depth&&this.hide(e)}},r9.prototype.defaultAction=function(e){this.previousDate=!je(this.value)&&new Date(+this.value)||null,this.isCalendar()&&(Y7.prototype.keyActionHandle.call(this,e),this.isCalendar())&&pt(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()})},r9.prototype.popupUpdate=function(){var e;(je(this.value)&&!je(this.previousDate)||"datetimepicker"!==this.getModuleName()&&+this.value!=+this.previousDate||"datetimepicker"===this.getModuleName()&&+this.value!=+this.previousDateTime)&&(this.popupObj&&0<this.popupObj.element.querySelectorAll("."+t9).length&&q(this.popupObj.element.querySelectorAll("."+t9),[t9]),je(this.value)||+this.value>=+this.min&&+this.value<=+this.max&&(e=new Date(this.checkValue(this.value)),Y7.prototype.navigateTo.call(this,"Month",e)))},r9.prototype.strictModeUpdate=function(){var e,t,i,n;if("datetimepicker"===this.getModuleName()?e=je(this.formatString)?this.dateTimeFormat:this.formatString:/^y/.test(this.formatString)&&!/[^a-zA-Z]/.test(this.formatString)||(e=je(this.formatString)?this.formatString:this.formatString.replace("dd","d")),je(e)?e=this.formatString:e.split("M").length-1<3&&(e=e.replace("MM","M")),i="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:je(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:je(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:t="Gregorian"===this.calendarMode?{format:e,type:"dateTime",skeleton:"yMd"}:{format:e,type:"dateTime",skeleton:"yMd",calendar:"islamic"},"string"==typeof this.inputElement.value&&(this.inputElement.value=this.inputElement.value.trim()),"datetimepicker"===this.getModuleName()){if((je(n=this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),i))?this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),i):(t="Gregorian"===this.calendarMode?{format:e,type:"dateTime",skeleton:"yMd"}:{format:e,type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),t)))||"object"==typeof n&&isNaN(n.getTime()))&&!je(this.inputFormatsString))for(var o=0,r=this.inputFormatsString;o<r.length;o++){var s=r[o],a=void 0;if(a="Gregorian"===this.calendarMode?{format:s,type:"dateTime",skeleton:"yMd"}:{format:s,type:"dateTime",skeleton:"yMd",calendar:"islamic"},!je(n=this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),a))&&n instanceof Date&&!isNaN(n.getTime()))break}}else{if((je(n=this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),i))||"object"==typeof n&&isNaN(n.getTime()))&&!je(this.inputFormatsString))for(var l=0,h=this.inputFormatsString;l<h.length;l++){var d=h[l],a=void 0;if(a="Gregorian"===this.calendarMode?{format:d,type:"dateTime",skeleton:"yMd"}:{format:d,type:"dateTime",skeleton:"yMd",calendar:"islamic"},!je(n=this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),a))&&n instanceof Date&&!isNaN(n.getTime()))break}n=!je(n)&&isNaN(+n)?null:n,!je(this.formatString)&&""!==this.inputElement.value&&this.strictMode&&(this.isPopupClicked||!this.isPopupClicked&&this.inputElement.value===this.previousElementValue)&&-1===this.formatString.indexOf("y")&&n.setFullYear(this.value.getFullYear())}"datepicker"===this.getModuleName()&&this.value&&!isNaN(+this.value)&&n&&n.setHours(this.value.getHours(),this.value.getMinutes(),this.value.getSeconds(),this.value.getMilliseconds()),this.strictMode&&n?(this.updateInputValue(this.globalize.formatDate(n,i)),this.inputElement.value!==this.previousElementValue&&this.setProperties({value:n},!0)):this.strictMode||this.inputElement.value!==this.previousElementValue&&this.setProperties({value:n},!0),this.strictMode&&!n&&this.inputElement.value===(this.enableMask?this.maskedDateValue:"")&&this.setProperties({value:null},!0),isNaN(+this.value)&&this.setProperties({value:null},!0),je(this.value)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)))},r9.prototype.createCalendar=function(){var e=this;this.popupWrapper=this.createElement("div",{className:X7+" "+K7,id:this.inputElement.id+"_options"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),je(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),F.isDevice&&(this.modelHeader(),this.modal=this.createElement("div"),this.modal.className=X7+" e-date-modal",document.body.className+=" "+e9,this.modal.style.display="block",document.body.appendChild(this.modal)),this.calendarElement.querySelector("table tbody").className="",this.popupObj=new Sv(this.popupWrapper,{content:this.calendarElement,relateTo:F.isDevice?document.body:this.inputWrapper.container,position:F.isDevice?{X:"center",Y:"center"}:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},offsetY:4,targetType:"container",enableRtl:this.enableRtl,zIndex:this.zIndex,collision:F.isDevice?{X:"fit",Y:"fit"}:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},open:function(){F.isDevice&&e.fullScreenMode&&(e.iconRight=16<parseInt(window.getComputedStyle(e.calendarElement.querySelector(".e-header.e-month .e-prev")).marginRight,10),e.touchModule=new Mn(e.calendarElement.querySelector(".e-content.e-month"),{swipe:e.CalendarSwipeHandler.bind(e)}),E.add(e.calendarElement.querySelector(".e-content.e-month"),"touchstart",e.TouchStartHandler,e)),"datetimepicker"!==e.getModuleName()&&document.activeElement!==e.inputElement&&(e.defaultKeyConfigs=Pe(e.defaultKeyConfigs,e.keyConfigs),e.calendarElement.children[1].firstElementChild.focus(),e.calendarKeyboardModules=new bn(e.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}),e.calendarKeyboardModules=new bn(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.disabledDates(),e.popupObj&&e.popupObj.destroy(),e.resetCalendar(),G(e.popupWrapper),e.popupObj=e.popupWrapper=null,e.preventArgs=null,e.calendarKeyboardModules=null,e.setAriaAttributes()},targetExitViewport:function(){F.isDevice||e.hide()}}),this.popupObj.element.className+=" "+this.cssClass,this.setAriaAttributes()},r9.prototype.getAmPmValue=function(e){try{return"string"==typeof e&&""!==e.trim()?e.replace(/(am|pm|Am|aM|pM|Pm)/g,function(e){return e.toLocaleUpperCase()}):""}catch(e){return console.error("Error occurred while processing date:",e),""}},r9.prototype.CalendarSwipeHandler=function(e){var t=0;if(this.iconRight)switch(e.swipeDirection){case"Left":t=1;break;case"Right":t=-1}else switch(e.swipeDirection){case"Up":t=1;break;case"Down":t=-1}this.touchStart&&(1===t?this.navigateNext(e):-1===t&&this.navigatePrevious(e),this.touchStart=!1)},r9.prototype.TouchStartHandler=function(e){this.touchStart=!0},r9.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)},r9.prototype.modelHeader=function(){var e,t=this.createElement("div",{className:"e-model-header"}),i=this.createElement("h1",{className:"e-model-year"}),n=this.createElement("div"),o=this.createElement("span",{className:"e-model-day"}),r=this.createElement("span",{className:"e-model-month"}),s="Gregorian"===this.calendarMode?{format:"y",skeleton:"dateTime"}:{format:"y",skeleton:"dateTime",calendar:"islamic"};i.textContent=""+this.globalize.formatDate(this.value||new Date,s),s="Gregorian"===this.calendarMode?{format:"E",skeleton:"dateTime"}:{format:"E",skeleton:"dateTime",calendar:"islamic"},o.textContent=this.globalize.formatDate(this.value||new Date,s)+", ",s="Gregorian"===this.calendarMode?{format:"MMM d",skeleton:"dateTime"}:{format:"MMM d",skeleton:"dateTime",calendar:"islamic"},r.textContent=""+this.globalize.formatDate(this.value||new Date,s),this.fullScreenMode&&(s=this.createElement("span",{className:"e-popup-close"}),E.add(s,"mousedown touchstart",this.modelCloseHandler,this),e=this.calendarElement.querySelector("button.e-today"),n.classList.add("e-day-wrapper"),e.classList.add("e-outline"),t.appendChild(s),t.appendChild(e)),this.fullScreenMode||t.appendChild(i),n.appendChild(o),n.appendChild(r),t.appendChild(n),this.calendarElement.insertBefore(t,this.calendarElement.firstElementChild)},r9.prototype.modelCloseHandler=function(e){this.hide()},r9.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=!je(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),this.isKeyAction=!1},r9.prototype.navigatedEvent=function(e){Pe(this.navigatedArgs,{name:"navigated",event:e}),this.trigger("navigated",this.navigatedArgs)},r9.prototype.keyupHandler=function(e){this.isKeyAction=this.inputElement.value!==this.previousElementValue,this.enableMask&&this.showClearButton&&this.inputElement&&this.inputElement.value===this.maskedDateValue&&this.inputWrapper&&this.inputWrapper.clearButton&&!this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.inputWrapper.clearButton.classList.add("e-clear-icon-hide")},r9.prototype.changeEvent=function(e){this.isIconClicked||this.isBlur||this.isKeyAction||this.selectCalendar(e),(this.previousDate&&this.previousDate.valueOf())!==(this.value&&this.value.valueOf())?(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()):e&&this.hide(e),this.isKeyAction=!1},r9.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},r9.prototype.selectCalendar=function(e){var t,i="datetimepicker"===this.getModuleName()&&je(this.formatString)?this.dateTimeFormat:this.formatString;this.value&&(t=(i="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:i,type:"dateTime",skeleton:"yMd"}:{format:i,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:"Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.formatDate(this.changedArgs.value,i)),this.enableMask)&&this.notify("createMask",{module:"MaskedDateTime"}),je(t)||(this.updateInputValue(t),this.enableMask&&this.notify("setMaskSelection",{module:"MaskedDateTime"}))},r9.prototype.isCalendar=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(K7))},r9.prototype.setWidth=function(e){this.inputWrapper.container.style.width="number"==typeof e?T(this.width):"string"==typeof e?e.match(/px|%|em/)?this.width:T(this.width):"100%"},r9.prototype.show=function(e,t){var i,n,o=this;this.enabled&&this.readonly||!this.enabled||this.popupObj||(i=!0,n=void 0,je(this.value)||+this.value>=+new Date(this.checkValue(this.min))&&+this.value<=+new Date(this.checkValue(this.max))?n=this.value||null:(n=new Date(this.checkValue(this.value)),this.setProperties({value:null},!0)),this.isCalendar()||(Y7.prototype.render.call(this),this.setProperties({value:n||null},!0),this.previousDate=n,this.createCalendar()),F.isDevice&&(this.mobilePopupWrapper=this.createElement("div",{className:"e-datepick-mob-popup-wrap"}),document.body.appendChild(this.mobilePopupWrapper)),this.preventArgs={preventDefault:function(){i=!1},popup:this.popupObj,event:t||null,cancel:!1,appendTo:F.isDevice?this.mobilePopupWrapper:document.body},n=this.preventArgs,this.trigger("open",n,function(e){o.preventArgs=e,i&&!o.preventArgs.cancel?(U(o.inputWrapper.buttons,$7),o.preventArgs.appendTo.appendChild(o.popupWrapper),o.popupObj.refreshPosition(o.inputElement),e={name:"FadeIn",duration:F.isDevice?0:300},1e3===o.zIndex?o.popupObj.show(new Vt(e),o.element):o.popupObj.show(new Vt(e),null),Y7.prototype.setOverlayIndex.call(o,o.mobilePopupWrapper,o.popupObj.element,o.modal,F.isDevice),o.setAriaAttributes(),F.isDevice&&((e=o.createElement("div",{className:"e-dlg-overlay"})).style.zIndex=(o.zIndex-1).toString(),o.mobilePopupWrapper.appendChild(e))):(o.popupObj.destroy(),o.popupWrapper=o.popupObj=null),je(o.inputElement)||""!==o.inputElement.value||!je(o.tableBodyElement)&&0<o.tableBodyElement.querySelectorAll("td.e-selected").length&&(U([o.tableBodyElement.querySelector("td.e-selected")],"e-focused-date"),q(o.tableBodyElement.querySelectorAll("td.e-selected"),t9)),E.add(document,"mousedown touchstart",o.documentHandler,o)}))},r9.prototype.hide=function(e){var t,i=this;je(this.popupWrapper)?(F.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()):(t=!0,this.preventArgs={preventDefault:function(){t=!1},popup:this.popupObj,event:e||null,cancel:!1},q(this.inputWrapper.buttons,$7),q([document.body],e9),e=this.preventArgs,this.isCalendar()?this.trigger("close",e,function(e){i.closeEventCallback(t,e)}):this.closeEventCallback(t,e))},r9.prototype.closeEventCallback=function(e,t){this.preventArgs=t,this.isCalendar()&&e&&!this.preventArgs.cancel&&(this.popupObj.hide(),this.isAltKeyPressed=!1,this.keyboardModule.destroy(),q(this.inputWrapper.buttons,$7)),this.setAriaAttributes(),F.isDevice&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null),!F.isDevice||je(this.mobilePopupWrapper)||!e||!je(this.preventArgs)&&this.preventArgs.cancel||(this.mobilePopupWrapper.remove(),this.mobilePopupWrapper=null),E.remove(document,"mousedown touchstart",this.documentHandler),F.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},r9.prototype.focusIn=function(e){document.activeElement!==this.inputElement&&this.enabled&&(this.inputElement.focus(),U([this.inputWrapper.container],[J7]))},r9.prototype.focusOut=function(){document.activeElement===this.inputElement&&(q([this.inputWrapper.container],[J7]),this.inputElement.blur())},r9.prototype.currentView=function(){var e;return e=this.calendarElement?Y7.prototype.currentView.call(this):e},r9.prototype.navigateTo=function(e,t){this.calendarElement&&Y7.prototype.navigateTo.call(this,e,t)},r9.prototype.destroy=function(){this.unBindEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),Y7.prototype.destroy.call(this),HF.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),je(this.keyboardModules)||this.keyboardModules.destroy(),this.popupObj&&this.popupObj.element.classList.contains("e-popup")&&Y7.prototype.destroy.call(this);this.inputElement.hasAttribute("aria-label")&&this.inputElement.removeAttribute("aria-label"),this.inputElement&&(HF.removeAttributes({"aria-atomic":"true","aria-disabled":"true","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"},this.inputElement),je(this.inputElementCopy.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),E.remove(this.inputElement,"blur",this.inputBlurHandler),E.remove(this.inputElement,"focus",this.inputFocusHandler),this.ensureInputAttribute()),this.isCalendar()&&(this.popupWrapper&&G(this.popupWrapper),this.popupObj=this.popupWrapper=null,this.keyboardModule.destroy()),null===this.ngTag&&(this.inputElement&&(je(this.inputWrapper)||this.inputWrapper.container.insertAdjacentElement("afterend",this.inputElement),q([this.inputElement],["e-input"])),q([this.element],[X7]),je(this.inputWrapper)||G(this.inputWrapper.container)),this.formElement&&E.remove(this.formElement,"reset",this.resetFormHandler),this.inputWrapper=null,this.keyboardModules=null},r9.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(t=0;t<e.length;t++)je(this.inputElementCopy.getAttribute(e[t]))?("value"===e[t].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[t])):("value"===e[t].toLowerCase()&&(this.inputElement.value=this.inputElementCopy.getAttribute(e[t])),this.inputElement.setAttribute(e[t],this.inputElementCopy.getAttribute(e[t])))},r9.prototype.preRender=function(){this.inputElementCopy=this.element.cloneNode(!0),q([this.inputElementCopy],[X7,"e-control","e-lib"]),this.inputElement=this.element,this.formElement=z(this.inputElement,"form"),this.index=this.showClearButton?2:1,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=D("ej2-datetimepicker"):this.element.id=D("ej2-datepicker"),null!==this.ngTag&&pt(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.inputFormats&&this.checkInputFormats(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),Y7.prototype.preRender.call(this)},r9.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},r9.prototype.validationAttribute=function(e,t){for(var i,n=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id"),o=(t.setAttribute("name",n),e.removeAttribute("name"),["required","aria-required","form"]),r=0;r<o.length;r++)je(e.getAttribute(o[r]))||(i=e.getAttribute(o[r]),t.setAttribute(o[r],i),e.removeAttribute(o[r]))},r9.prototype.checkFormat=function(){var e,t=new Ti(this.locale);this.format?"string"==typeof this.format?this.formatString=this.format:""===this.format.skeleton||je(this.format.skeleton)?"datetimepicker"===this.getModuleName()?this.formatString=this.dateTimeFormat:this.formatString=null:(e=this.format.skeleton,"datetimepicker"===this.getModuleName()?this.formatString=t.getDatePattern({skeleton:e,type:"dateTime"}):this.formatString=t.getDatePattern({skeleton:e,type:"date"})):this.formatString=null},r9.prototype.checkInputFormats=function(){var e=new Ti(this.locale);if(this.inputFormatsString=[],this.inputFormats){for(var t=0,i=this.inputFormats;t<i.length;t++){var n=i[t],o="";"string"==typeof n?o=n:""===n.skeleton||je(n.skeleton)||(n=n.skeleton,o="datetimepicker"===this.getModuleName()?e.getDatePattern({skeleton:n,type:"dateTime"}):e.getDatePattern({skeleton:n,type:"date"})),o&&this.inputFormatsString.push(o)}0===this.inputFormatsString.length&&(this.inputFormatsString=null)}else this.inputFormatsString=null},r9.prototype.checkHtmlAttributes=function(e){this.globalize=new Ti(this.locale),this.checkFormat(),this.checkView();for(var t=e?je(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","disabled","readonly","style","name","placeholder","type"],i="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:je(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:je(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:"Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},n=0,o=t;n<o.length;n++){var r,s,a,l=o[n];if(!je(this.inputElement.getAttribute(l)))switch(l){case"disabled":(je(this.datepickerOptions)||void 0===this.datepickerOptions.enabled||e)&&(r="disabled"!==this.inputElement.getAttribute(l)&&""!==this.inputElement.getAttribute(l)&&"true"!==this.inputElement.getAttribute(l),this.setProperties({enabled:r},!e));break;case"readonly":(je(this.datepickerOptions)||void 0===this.datepickerOptions.readonly||e)&&(r="readonly"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l),this.setProperties({readonly:r},!e));break;case"placeholder":(je(this.datepickerOptions)||void 0===this.datepickerOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(l)},!e);break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(l));break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(l));break;case"value":(je(this.datepickerOptions)||void 0===this.datepickerOptions.value||e)&&(s=this.inputElement.getAttribute(l),this.setProperties(x(l,this.globalize.parseDate(this.getAmPmValue(s),i),{}),!e));break;case"min":+this.min!=+new Date(1900,0,1)&&!e||(s=this.inputElement.getAttribute(l),this.setProperties(x(l,this.globalize.parseDate(this.getAmPmValue(s),i),{}),!e));break;case"max":+this.max!=+new Date(2099,11,31)&&!e||(a=this.inputElement.getAttribute(l),this.setProperties(x(l,this.globalize.parseDate(this.getAmPmValue(a),i),{}),!e));break;case"type":"text"!==this.inputElement.getAttribute(l)&&this.inputElement.setAttribute("type","text")}}},r9.prototype.getModuleName=function(){return"datepicker"},r9.prototype.disabledDates=function(e,t){void 0===e&&(e=!1),void 0===t&&(t=!1);var i=this.checkDateValue(this.value)?new Date(+this.value):new Date(this.checkValue(this.value)),n=this.previousDate;this.minMaxUpdates(),e&&je(this.renderDayCell)||Y7.prototype.render.call(this),this.previousDate=n;var e='*[id^="/id"]'.replace("/id",""+(i&&+i));this.strictMode||("string"==typeof this.value||"object"==typeof this.value&&+this.value!=+i)&&this.setProperties({value:i},!0),je(this.calendarElement)||je(this.calendarElement.querySelectorAll(e)[0])||!this.calendarElement.querySelectorAll(e)[0].classList.contains("e-disabled")||this.strictMode||(this.currentDate=new Date((new Date).setHours(0,0,0,0))),e="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?this.globalize.formatDate(i,{format:je(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(i,{format:je(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}):(n="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.formatDate(i,n)),this.popupObj||(this.updateInputValue(e),this.enableMask&&(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime",isBlur:t})))},r9.prototype.setAriaAttributes=function(){this.isCalendar()?(HF.addAttributes({"aria-expanded":"true"},this.inputElement),pt(this.inputElement,{"aria-owns":this.inputElement.id+"_options"}),pt(this.inputElement,{"aria-controls":this.inputElement.id}),this.value&&pt(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()})):(HF.addAttributes({"aria-expanded":"false"},this.inputElement),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-controls"),this.inputElement.removeAttribute("aria-activedescendant"))},r9.prototype.errorClass=function(){var e='*[id^="/id"]'.replace("/id",""+ +this.value),e=this.calendarElement&&this.calendarElement.querySelectorAll(e)[0]&&this.calendarElement.querySelectorAll(e)[0].classList.contains("e-disabled");!(je(this.value)||je(this.min)||je(this.max)||new Date(this.value).setMilliseconds(0)>=new Date(this.min).setMilliseconds(0)&&new Date(this.value).setMilliseconds(0)<=new Date(this.max).setMilliseconds(0))||!this.strictMode&&""!==this.inputElement.value&&this.inputElement.value!==this.maskedDateValue&&je(this.value)||e||!this.isValidTime(this.value)?(U([this.inputWrapper.container],Z7),pt(this.inputElement,{"aria-invalid":"true"})):je(this.inputWrapper)||(q([this.inputWrapper.container],Z7),pt(this.inputElement,{"aria-invalid":"false"}))},r9.prototype.isValidTime=function(e){return!0},r9.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];switch(0<["blur","change","cleared","close","created","destroyed","focus","navigated","open","renderDayCell"].indexOf(o)&&this.isReact&&(this.isDynamicValueChanged=!0),o){case"value":this.isDynamicValueChanged=!0,this.isInteracted=!1,this.invalidValueString=null,this.checkInvalidValue(e.value),e.value=this.value,this.previousElementValue=this.inputElement.value,je(this.value)&&(this.enableMask?this.updateInputValue(this.maskedDateValue):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.updateInput(),this.enableMask&&(this.notify("createMask",{module:"MaskedDateTime"}),this.value||this.updateInputValue(this.maskedDateValue));break;case"inputFormats":this.checkInputFormats();break;case"allowEdit":this.setAllowEdit();break;case"placeholder":HF.setPlaceholder(this.placeholder,this.inputElement);break;case"readonly":HF.setReadonly(this.readonly,this.inputElement);break;case"enabled":HF.setEnabled(this.enabled,this.inputElement),this.setAriaDisabled();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkHtmlAttributes(!0);break;case"locale":this.globalize=new Ti(this.locale),this.l10n.setLocale(this.locale),this.datepickerOptions&&null==this.datepickerOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),HF.setPlaceholder(this.placeholder,this.inputElement)),this.updateInput(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"enableRtl":HF.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"start":case"depth":this.checkView(),this.calendarElement&&Y7.prototype.onPropertyChanged.call(this,e,t);break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0);break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass);break;case"showClearButton":HF.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent(),this.index=this.showClearButton?2:1;break;case"strictMode":this.invalidValueString=null,this.updateInput();break;case"width":this.setWidth(e.width),HF.calculateWidth(this.inputElement,this.inputWrapper.container),je(this.inputWrapper.buttons[0])||je(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"floatLabelType":this.floatLabelType=e.floatLabelType,HF.removeFloating(this.inputWrapper),HF.addFloating(this.inputElement,this.floatLabelType,this.placeholder),je(this.inputWrapper.buttons[0])||je(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");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.isCalendar()&&Y7.prototype.onPropertyChanged.call(this,e,t),"min"===o&&je(this.min)&&(this.min=new Date(1900,0,1)),"max"===o&&je(this.max)&&(this.max=new Date(2099,11,31))}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},r9.prototype.addDate=function(e){},f7([e(null)],r9.prototype,"width",void 0),f7([e(null)],r9.prototype,"value",void 0),f7([e(null)],r9.prototype,"cssClass",void 0),f7([e(!1)],r9.prototype,"strictMode",void 0),f7([e(null)],r9.prototype,"format",void 0),f7([e(null)],r9.prototype,"inputFormats",void 0),f7([e(!0)],r9.prototype,"enabled",void 0),f7([e(!1)],r9.prototype,"fullScreenMode",void 0),f7([e({})],r9.prototype,"htmlAttributes",void 0),f7([e(null)],r9.prototype,"values",void 0),f7([e(!1)],r9.prototype,"isMultiSelection",void 0),f7([e(!0)],r9.prototype,"showClearButton",void 0),f7([e(!0)],r9.prototype,"allowEdit",void 0),f7([e(null)],r9.prototype,"keyConfigs",void 0),f7([e(!1)],r9.prototype,"enablePersistence",void 0),f7([e(1e3)],r9.prototype,"zIndex",void 0),f7([e(!1)],r9.prototype,"readonly",void 0),f7([e(null)],r9.prototype,"placeholder",void 0),f7([e("Never")],r9.prototype,"floatLabelType",void 0),f7([e(null)],r9.prototype,"serverTimezoneOffset",void 0),f7([e(!1)],r9.prototype,"openOnFocus",void 0),f7([e(!1)],r9.prototype,"enableMask",void 0),f7([e({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],r9.prototype,"maskPlaceholder",void 0),f7([i()],r9.prototype,"open",void 0),f7([i()],r9.prototype,"cleared",void 0),f7([i()],r9.prototype,"close",void 0),f7([i()],r9.prototype,"blur",void 0),f7([i()],r9.prototype,"focus",void 0),f7([i()],r9.prototype,"created",void 0),f7([i()],r9.prototype,"destroyed",void 0),f7([Bt],r9));function r9(e,t){t=Y7.call(this,e,t)||this;return t.isDateIconClicked=!1,t.isAltKeyPressed=!1,t.isInteracted=!0,t.invalidValueString=null,t.checkPreviousValue=null,t.maskedDateValue="",t.preventChange=!1,t.isIconClicked=!1,t.isDynamicValueChanged=!1,t.moduleName=t.getModuleName(),t.isFocused=!1,t.isBlur=!1,t.isKeyAction=!1,t.datepickerOptions=e,t}s9=function(e,t){return(s9=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])}))(e,t)};var s9,a9,f7=function(e,t){function i(){this.constructor=e}s9(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},l9=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},h9="e-input-group",d9="e-popup",p9="e-left-calendar",c9="e-right-calendar",u9="e-daterangepicker",g9="e-error",m9="e-active",f9="e-start-date",y9="e-end-date",v9="e-start-btn",b9="e-input-focus",w9="e-range-hover",C9="e-other-month",S9="e-start-label",A9="e-end-label",x9="e-disabled",I9="e-selected",T9="e-calendar",E9="e-next",D9="e-prev",M9="e-header",k9="e-title",P9="e-icon-container",B9="e-date-range-container",F9="e-presets",L9="e-today",R9="e-focused-date",O9="e-content",N9="e-day-span",V9="e-week-number",_9="e-date-disabled",H9="e-icon-disabled",z9="e-device",j9="e-overlay",W9="e-list-item",Q9="e-hover",U9="e-range-overflow",q9="e-non-edit",G9="e-daterange-hidden",Y9=["title","class","style"],X9=(f7(K9,a9=n),l9([e()],K9.prototype,"label",void 0),l9([e()],K9.prototype,"start",void 0),l9([e()],K9.prototype,"end",void 0),K9);function K9(){return null!==a9&&a9.apply(this,arguments)||this}f7($9,J9=R7),$9.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"),"Never"!==this.floatLabelType&&HF.calculateWidth(this.inputElement,this.inputWrapper.container),je(this.inputWrapper.buttons[0])||je(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),!je(z(this.element,"fieldset"))&&z(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},$9.prototype.preRender=function(){var e;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=!!F.isDevice||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),q([this.cloneElement],[u9,"e-control","e-lib"]),this.updateHtmlAttributeToElement(),this.element.getAttribute("id")?null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):(this.element.id=D("ej2-datetimepicker"),null!==this.angularTag&&pt(this.inputElement,{id:this.element.id+"_input"})),this.checkInvalidRange(this.value),this.invalidValueString||"string"!=typeof this.value||(e=this.value.split(" "+this.separator+" "),this.value=[new Date(e[0]),new Date(e[1])]),this.initProperty(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),J9.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=z(this.element,"form")},$9.prototype.updateValue=function(){this.value&&0<this.value.length?(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.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.setProperties({endDate:new Date(this.checkValue(this.value[1]))},!0),this.endValue=new Date(this.checkValue(this.value[1]))),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.setProperties({endDate:null},!0),this.endValue=null),this.setValue())):je(this.value)&&(this.endValue=this.checkDateValue(new Date(this.checkValue(this.endDate))),this.startValue=this.checkDateValue(new Date(this.checkValue(this.startDate))),this.setValue())},$9.prototype.initProperty=function(){this.globalize=new Ti(this.locale),this.checkFormat(),this.checkView(),(je(this.firstDayOfWeek)||6<this.firstDayOfWeek||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.updateValue()},$9.prototype.checkFormat=function(){var e;this.format?"string"==typeof this.format?this.formatString=this.format:""===this.format.skeleton||je(this.format.skeleton)?this.formatString=null:(e=this.format.skeleton,this.formatString=this.globalize.getDatePattern({skeleton:e,type:"date"})):this.formatString=null},$9.prototype.initialize=function(){null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.checkHtmlAttributes(!1),I(this.defaultKeyConfigs,{shiftTab:"shift+tab",tab:"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 Cn("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()},$9.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 n=0,o=Object.keys(t);n<o.length;n++){var r=o[n];0===r.indexOf("data")&&(this.firstHiddenChild.setAttribute(r,t[""+r]),this.secondHiddenChild.setAttribute(r,t[""+r]))}},$9.prototype.setRangeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):pt(this.inputElement,{readonly:""}),this.updateClearIconState()},$9.prototype.updateClearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&q([this.inputWrapper.container],[q9]):(""===this.inputElement.value?q:U)([this.inputWrapper.container],[q9])},$9.prototype.validationAttribute=function(e,t){for(var i,n=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id"),o=(t.setAttribute("name",n),e.removeAttribute("name"),["required","aria-required","form"]),r=0;r<o.length;r++)je(e.getAttribute(o[r]))||(i=e.getAttribute(o[r]),t.setAttribute(o[r],i),e.removeAttribute(o[r]))},$9.prototype.updateHtmlAttributeToWrapper=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i,n=t[e];-1<Y9.indexOf(n)&&("class"===n?""!==(i=this.htmlAttributes[""+n].replace(/\s+/g," ").trim())&&U([this.inputWrapper.container],i.split(" ")):"style"===n?(i=je(i=this.inputWrapper.container.getAttribute(n))?this.htmlAttributes[""+n]:i+this.htmlAttributes[""+n],this.inputWrapper.container.setAttribute(n,i)):this.inputWrapper.container.setAttribute(n,this.htmlAttributes[""+n]))}},$9.prototype.updateHtmlAttributeToElement=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];Y9.indexOf(i)<0&&this.inputElement.setAttribute(i,this.htmlAttributes[""+i])}},$9.prototype.updateCssClass=function(e,t){je(t)||(t=t.replace(/\s+/g," ").trim()),je(e)||(e=e.replace(/\s+/g," ").trim()),HF.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&HF.setCssClass(e,[this.popupWrapper],t)},$9.prototype.processPresets=function(){this.presetsItem=[];var e=0;if(!je(this.presets[0])&&!ee(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){for(var t=0,i=this.presets;t<i.length;t++){var n=i[t],o=n.label.replace(/\s+/g,"")+"_"+ ++e;"string"==typeof n.end?this.presetsItem.push({id:o,text:n.label,end:new Date(this.checkValue(n.end)),start:new Date(this.checkValue(n.start))}):this.presetsItem.push({id:o,text:n.label,start:n.start,end:n.end})}var r=je(this.startValue)?null:new Date(+this.startValue),s=je(this.endValue)?null:new Date(+this.endValue);this.presetsItem.push({id:"custom_range",text:this.l10n.getConstant("customRange"),start:r,end:s}),je(this.startValue)||je(this.endValue)||(this.isCustomRange=!0,this.activeIndex=this.presetsItem.length-1)}},$9.prototype.bindEvents=function(){E.add(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler,this),E.add(this.inputElement,"focus",this.inputFocusHandler,this),E.add(this.inputElement,"blur",this.inputBlurHandler,this),E.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&E.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this),this.isMobile||(this.keyInputConfigs=Pe(this.keyInputConfigs,this.keyConfigs),this.inputKeyboardModule=new bn(this.inputElement,{eventName:"keydown",keyAction:this.inputHandler.bind(this),keyConfigs:this.keyInputConfigs})),this.formElement&&E.add(this.formElement,"reset",this.formResetHandler,this),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1},$9.prototype.unBindEvents=function(){E.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),E.remove(this.inputElement,"blur",this.inputBlurHandler),E.remove(this.inputElement,"focus",this.inputFocusHandler),E.remove(this.inputElement,"change",this.inputChangeHandler),this.showClearButton&&this.inputWrapper.clearButton&&E.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.isMobile||je(this.inputKeyboardModule)||this.inputKeyboardModule.destroy(),this.formElement&&E.remove(this.formElement,"reset",this.formResetHandler),this.inputElement.tabIndex=-1},$9.prototype.updateHiddenInput=function(){var e;this.firstHiddenChild&&this.secondHiddenChild&&(e={format:this.formatString,type:"datetime",skeleton:"yMd"},"string"==typeof this.startDate&&(this.startDate=this.globalize.parseDate(this.getAmPmValue(this.startDate),e)),"string"==typeof this.endDate&&(this.endDate=this.globalize.parseDate(this.getAmPmValue(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"))},$9.prototype.inputChangeHandler=function(e){this.enabled&&(e.stopPropagation(),this.updateHiddenInput())},$9.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&E.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},$9.prototype.resetHandler=function(e){var t;this.enabled&&(this.valueType=this.value,e.preventDefault(),this.clear(),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),z(this.element,"form"))&&(t=this.firstHiddenChild,(e=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),t.dispatchEvent(e))},$9.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()},$9.prototype.formResetHandler=function(e){this.enabled&&this.formElement&&e.target===this.formElement&&!this.inputElement.disabled&&(e=this.inputElement.getAttribute("value"),je(this.startCopy)?(this.setProperties({value:null,startDate:null,endDate:null},!0),this.startValue=this.endValue=null):(je(this.value)||je(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),e="",this.startValue=this.endValue=null,this.inputElement.setAttribute("value","")),this.restoreValue(),this.inputElement)&&(HF.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton),this.errorClass())},$9.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&&0<this.value.length&&this.setProperties({value:null},!0),HF.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),je(this.applyButton)||(this.applyButton.disabled=this.applyButton.element.disabled=!0),this.removeSelection()},$9.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||je(this.leftCalendar)||(this.isRangeIconClicked=!1,this.calendarFocus(),this.isRangeIconClicked=!0),U([this.inputWrapper.container],[b9])))},$9.prototype.checkHtmlAttributes=function(e){this.globalize=new Ti(this.locale);for(var t=e?je(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["startDate","endDate","minDays","maxDays","min","max","disabled","readonly","style","name","placeholder","type","value"],i={format:this.formatString,type:"date",skeleton:"yMd"},n=0,o=t;n<o.length;n++){var r,s,a,l=o[n];if(!je(this.inputElement.getAttribute(l)))switch(l){case"disabled":(je(this.dateRangeOptions)||void 0===this.dateRangeOptions.enabled||e)&&(r="disabled"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l),this.setProperties({enabled:!r},!e));break;case"readonly":(je(this.dateRangeOptions)||void 0===this.dateRangeOptions.readonly||e)&&(r="readonly"===this.inputElement.getAttribute(l)||"true"===this.inputElement.getAttribute(l)||""===this.inputElement.getAttribute(l),this.setProperties({readonly:r},!e));break;case"placeholder":(je(this.dateRangeOptions)||void 0===this.dateRangeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(l)},!e);break;case"value":(je(this.dateRangeOptions)||void 0===this.dateRangeOptions.value||e)&&(s=this.inputElement.getAttribute(l),this.setProperties(x(l,s,{}),!e));break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(l));break;case"min":(je(this.min)||+this.min==+new Date(1900,0,1)||e)&&(a=this.globalize.parseDate(this.getAmPmValue(this.inputElement.getAttribute(l)),i),this.setProperties(x(l,a,{}),!e));break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(l));break;case"max":(je(this.max)||+this.max==+new Date(2099,11,31)||e)&&(a=this.globalize.parseDate(this.getAmPmValue(this.inputElement.getAttribute(l)),i),this.setProperties(x(l,a,{}),!e));break;case"startDate":je(this.startDate)&&(a=this.globalize.parseDate(this.getAmPmValue(this.inputElement.getAttribute(l)),i),this.startValue=a,this.setValue());break;case"endDate":je(this.endDate)&&(a=this.globalize.parseDate(this.getAmPmValue(this.inputElement.getAttribute(l)),i),this.endValue=a,this.setValue());break;case"minDays":je(this.minDays)&&this.setProperties(x(l,parseInt(this.inputElement.getAttribute(l),10),{}),!0);break;case"maxDays":je(this.maxDays)&&this.setProperties(x(l,parseInt(this.inputElement.getAttribute(l),10),{}),!0);break;case"type":"text"!==this.inputElement.getAttribute(l)&&this.inputElement.setAttribute("type","text")}}},$9.prototype.createPopup=function(){for(var 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(e=0;e<=this.presetsItem.length-2;e++){var t=this.presetsItem[e].start,i=this.presetsItem[e].end;this.startValue&&this.endValue&&t.getDate()===this.startValue.getDate()&&t.getMonth()===this.startValue.getMonth()&&t.getFullYear()===this.startValue.getFullYear()&&i.getDate()===this.endValue.getDate()&&i.getMonth()===this.endValue.getMonth()&&i.getFullYear()===this.endValue.getFullYear()&&(this.activeIndex=e,this.isCustomRange=!1)}this.popupWrapper=Q("div",{id:this.element.id+"_popup",className:u9+" "+d9}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),this.adjustLongHeaderWidth();var n=!this.isCustomRange||this.isMobile;!ee(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)&&n?(this.isCustomWindow=!1,this.createPresets(),this.listRippleEffect(),this.renderPopup()):(this.isCustomWindow=!0,this.renderControl())},$9.prototype.renderControl=function(){this.createControl(),this.bindCalendarEvents(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),je(this.endValue)||je(this.startValue)||je(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.updateHeader()},$9.prototype.clearCalendarEvents=function(){this.leftCalPrevIcon&&this.leftCalNextIcon&&this.rightCalPrevIcon&&this.rightCalNextIcon&&(E.clearEvents(this.leftCalPrevIcon),E.clearEvents(this.leftCalNextIcon),E.clearEvents(this.rightCalPrevIcon),E.clearEvents(this.rightCalNextIcon))},$9.prototype.updateNavIcons=function(){J9.prototype.iconHandler.call(this)},$9.prototype.calendarIconEvent=function(){this.clearCalendarEvents(),this.leftCalPrevIcon&&!this.leftCalPrevIcon.classList.contains(x9)&&E.add(this.leftCalPrevIcon,"mousedown",this.navPrevFunction),this.leftCalNextIcon&&!this.leftCalNextIcon.classList.contains(x9)&&E.add(this.leftCalNextIcon,"mousedown",this.navNextFunction),this.rightCalPrevIcon&&!this.rightCalPrevIcon.classList.contains(x9)&&E.add(this.rightCalPrevIcon,"mousedown",this.navPrevFunction),this.rightCalNextIcon&&!this.rightCalNextIcon.classList.contains(x9)&&E.add(this.rightCalNextIcon,"mousedown",this.navNextFunction)},$9.prototype.bindCalendarEvents=function(){this.isMobile?(this.deviceCalendarEvent(),E.add(this.startButton.element,"click",this.deviceHeaderClick,this),E.add(this.endButton.element,"click",this.deviceHeaderClick,this)):(this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.headerTitleElement=this.popupObj.element.querySelector("."+c9+" ."+M9+" ."+k9),this.headerTitleElement=this.popupObj.element.querySelector("."+p9+" ."+M9+" ."+k9),this.defaultKeyConfigs=Pe(this.defaultKeyConfigs,this.keyConfigs),this.leftKeyboardModule=new bn(this.leftCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs}),this.rightKeyboardModule=new bn(this.rightCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs})),this.start===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},$9.prototype.calendarIconRipple=function(){Ht(this.leftCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),Ht(this.leftCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),Ht(this.rightCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),Ht(this.rightCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0})},$9.prototype.deviceCalendarEvent=function(){E.clearEvents(this.nextIcon),E.clearEvents(this.previousIcon),Ht(this.nextIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),Ht(this.previousIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),this.nextIcon&&!this.nextIcon.classList.contains(x9)&&E.add(this.nextIcon,"mousedown",this.deviceNavNextFunction),this.previousIcon&&!this.previousIcon.classList.contains(x9)&&E.add(this.previousIcon,"mousedown",this.deviceNavPrevFunction)},$9.prototype.deviceNavNext=function(e){var t=z(e.target,"."+T9);this.updateDeviceCalendar(t),this.navigateNext(e),this.deviceNavigation()},$9.prototype.deviceNavPrevious=function(e){var t=z(e.target,"."+T9);this.updateDeviceCalendar(t),this.navigatePrevious(e),this.deviceNavigation()},$9.prototype.updateDeviceCalendar=function(e){e&&(this.previousIcon=e.querySelector("."+D9),this.nextIcon=e.querySelector("."+E9),this.calendarElement=e,this.deviceCalendar=e,this.contentElement=e.querySelector("."+O9),this.tableBodyElement=ge("."+O9+" tbody",e),this.table=e.querySelector("."+O9).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector("."+M9+" ."+k9),this.headerElement=e.querySelector("."+M9))},$9.prototype.deviceHeaderClick=function(e){var t;e.currentTarget.classList.contains(v9)&&!je(this.startValue)?(this.endButton.element.classList.remove(m9),this.startButton.element.classList.add(m9),t=this.popupObj.element.querySelector("."+T9),this.updateDeviceCalendar(t),je(this.calendarElement.querySelector("."+f9+":not(.e-other-month)"))&&(this.currentDate=new Date(+this.startValue),ue(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.removeClassDisabled()):je(this.startValue)||je(this.endValue)||(this.startButton.element.classList.remove(m9),this.endButton.element.classList.add(m9),t=this.popupObj.element.querySelector("."+T9),this.updateDeviceCalendar(t),je(this.calendarElement.querySelector("."+y9+":not(.e-other-month)"))&&(this.currentDate=new Date(+this.endValue),ue(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.updateMinMaxDays(this.popupObj.element.querySelector("."+T9)),this.selectableDates())},$9.prototype.inputFocusHandler=function(){this.enabled&&(this.preventBlur=!1,this.preventFocus||this.trigger("focus",{model:this}),this.updateClearIconState(),this.openOnFocus&&!this.preventFocus?(this.preventFocus=!0,this.show()):this.preventFocus=!0)},$9.prototype.inputBlurHandler=function(e){if(this.enabled){if(!this.preventBlur){var t=this.inputElement.value;if(je(this.presetsItem)||0<this.presetsItem.length&&this.previousEleValue!==this.inputElement.value&&(this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0),!je(t)&&""!==t.trim()){var i=t.split(" "+this.separator+" ");if(1<i.length){this.invalidValueString=null;var n={format:this.formatString,type:"date",skeleton:"yMd"},o=this.globalize.parseDate(this.getAmPmValue(i[0]).trim(),n),i=this.globalize.parseDate(this.getAmPmValue(i[1]).trim(),n);if("Decade"!==this.start&&"Year"===this.start&&"Month"!==this.depth&&this.inputElement.defaultValue!==t&&(i=this.getStartEndDate(i,!0)),!(je(o)||isNaN(+o)||je(i)||isNaN(+i)))return n=this.startValue,this.startValue=o,o=this.endValue,this.endValue=i,this.setValue(),this.refreshControl(),t!==this.previousEleValue&&this.changeTrigger(e),this.preventBlur||document.activeElement===this.inputElement||(this.preventFocus=!1,this.trigger("blur",{model:this})),this.updateHiddenInput(),void(this.isMobile&&this.isPopupOpen()&&(this.startValue=n,this.endValue=o))}this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}this.strictMode?(je(t)||""!==t.trim()||(this.startValue=null,this.endValue=null),HF.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.updateInput()):(je(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,this.trigger("blur",{model:this}))}this.updateHiddenInput()}},$9.prototype.getStartEndDate=function(e,t){return"Year"===this.currentView()&&!je(e)||"Year"===this.depth?new Date(e.getFullYear(),e.getMonth()+(t?1:0),t?0:1):"Decade"!==this.currentView()||je(e)?null:new Date(e.getFullYear(),t?11:0,t?31:1)},$9.prototype.clearRange=function(){this.previousStartValue=this.previousEndValue=null,this.currentDate=null},$9.prototype.errorClass=function(){var e=je(this.inputElement.value)?null:this.inputElement.value.trim();(je(this.endValue)&&je(this.startValue)&&""!==e||!je(this.startValue)&&+this.startValue<+this.min||!je(this.startValue)&&!je(this.endValue)&&+this.startValue>+this.endValue||!je(this.endValue)&&+this.endValue>+this.max||this.startValue&&this.isDateDisabled(this.startValue)||this.endValue&&this.isDateDisabled(this.endValue))&&""!==e?(U([this.inputWrapper.container],g9),pt(this.inputElement,{"aria-invalid":"true"})):this.inputWrapper&&(q([this.inputWrapper.container],g9),pt(this.inputElement,{"aria-invalid":"false"}))},$9.prototype.keyCalendarUpdate=function(e,t,i){return(i=void 0===i?!0:i)&&this.removeFocusedDate(),t=e?(this.leftCalCurrentDate=new Date(+this.currentDate),this.leftCalendar):(this.rightCalCurrentDate=new Date(+this.currentDate),this.rightCalendar),this.updateCalendarElement(t),this.table.focus(),t},$9.prototype.navInCalendar=function(e,t,i,n,o){var r,s=this.getViewNumber(this.currentView()),a=this.min,l=je(this.maxDays)||!this.isMaxDaysClicked||je(this.startValue)?this.max:new Date(new Date(+this.startValue).setDate(this.startValue.getDate()+(this.maxDays-1)));switch(e.action){case"moveRight":r=new Date(+this.currentDate),this.addDay(r,1,e,l,a),t&&+r==+n&&(o=this.keyCalendarUpdate(!1,o)),this.keyboardNavigate(1,s,e,l,a),this.keyNavigation(o,e);break;case"moveLeft":r=new Date(+this.currentDate),this.addDay(r,-1,e,l,a),t||+r==+i&&(o=this.keyCalendarUpdate(!0,o)),this.keyboardNavigate(-1,s,e,l,a),this.keyNavigation(o,e);break;case"moveUp":0===s?(r=new Date(+this.currentDate),this.addDay(r,-7,e,l,a),+r<=+i&&!t&&(o=this.keyCalendarUpdate(!0,o)),this.keyboardNavigate(-7,s,e,l,a)):this.keyboardNavigate(-4,s,e,this.max,this.min),this.keyNavigation(o,e);break;case"moveDown":0===s?(r=new Date(+this.currentDate),this.addDay(r,7,e,l,a),t&&+n<=+r&&(o=this.keyCalendarUpdate(!1,o)),this.keyboardNavigate(7,s,e,l,a)):this.keyboardNavigate(4,s,e,this.max,this.min),this.keyNavigation(o,e);break;case"home":this.currentDate=this.firstDay(this.currentDate),ue(this.tableBodyElement),0===s?this.renderMonths(e):1===s?this.renderYears(e):this.renderDecades(e),this.keyNavigation(o,e);break;case"end":this.currentDate=this.lastDay(this.currentDate,s),ue(this.tableBodyElement),0===s?this.renderMonths(e):1===s?this.renderYears(e):this.renderDecades(e),this.keyNavigation(o,e);break;case"tab":this.tabKeyValidation(o,p9)&&(o=this.keyCalendarUpdate(!1,o,!1),this.currentDate=this.firstCellToFocus(this.rightCalendar),s=this.getViewNumber(this.currentView()),this.keyboardNavigate(0,s,e,l,a),this.keyNavigation(o,e));break;case"shiftTab":this.tabKeyValidation(o,c9)&&(o=this.keyCalendarUpdate(!0,o,!1),this.currentDate=this.firstCellToFocus(this.leftCalendar),this.keyboardNavigate(0,s,e,l,a),this.keyNavigation(o,e))}},$9.prototype.firstCellToFocus=function(e){var e=2===this.getViewNumber(this.currentView())?e.children[1].firstElementChild.querySelector("td.e-cell:not(.e-week-number):not(.e-disabled):not(.e-other-year)"):e.children[1].firstElementChild.querySelector("td.e-cell:not(.e-week-number):not(.e-disabled):not(.e-other-month)"),e=e&&e.id?e.id.split("_")[0]:null,t=new Date(this.currentDate.getFullYear(),this.currentDate.getMonth(),1);return e?new Date(+e):t},$9.prototype.keyInputHandler=function(e,t){var i,n,o=this.getViewNumber(this.currentView()),r=new Date(this.rightCalCurrentDate.getFullYear(),this.rightCalCurrentDate.getMonth(),1),s=new Date(this.leftCalCurrentDate.getFullYear(),this.leftCalCurrentDate.getMonth()+1,0),a=z(e.target,"."+c9),l=(a=je(a)?this.leftCalendar:a).classList.contains(p9),h=(this.updateCalendarElement(a),this.tableBodyElement.querySelector("tr td.e-selected")),d=a.querySelector("tr td."+R9),p=a.querySelector("tr td."+f9),c=a.querySelector("tr td."+y9),u=this.getViewNumber(this.depth),g=o===u&&this.getViewNumber(this.start)>=u,m=z(e.target,"."+p9),f=z(e.target,"."+c9),y=z(e.target,"."+F9);switch(je(d)?je(c)||this.dateDisabled?je(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="",e.action){case"altUpArrow":this.isPopupOpen()&&(this.hide(e),this.preventFocus=!0,this.inputElement.focus(),U([this.inputWrapper.container],[b9]));break;case"select":g?(n=je(d)?p:d,je(n)||n.classList.contains(x9)||this.selectRange(null,n)):(je(h)||g)&&je(d)||(je(this.value)||(t=this.calendarElement.classList.contains(p9)?this.startDate:this.endDate),this.controlDown=e,this.contentClick(null,--o,d||h,t)),e.preventDefault();break;case"controlHome":var v=new Date(this.currentDate.getFullYear(),0,1);!l&&+v<+s&&(a=this.keyCalendarUpdate(!0,a)),J9.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),0,1)),this.keyNavigation(a,e);break;case"altRightArrow":je(m)?je(f)?je(y)||this.cancelButton.element.focus():je(this.presetElement)?this.cancelButton.element.focus():(this.presetElement.focus(),this.removeFocusedDate()):this.rightCalendar.children[1].firstElementChild.focus(),e.preventDefault();break;case"altLeftArrow":je(m)?je(f)||this.leftCalendar.children[1].firstElementChild.focus():(!0!==this.applyButton.element.disabled?this.applyButton:this.cancelButton).element.focus(),e.preventDefault();break;case"controlUp":this.calendarElement.classList.contains(p9),this.calendarNavigation(e,this.calendarElement),e.preventDefault();break;case"controlDown":je(h)&&je(d)||g||(je(this.value)||(t=this.calendarElement.classList.contains(p9)?this.startDate:this.endDate),this.controlDown=e,this.contentClick(null,--o,h||d,t)),e.preventDefault();break;case"controlEnd":v=new Date(this.currentDate.getFullYear(),11,31);l&&+r<+v&&(a=this.keyCalendarUpdate(!1,a)),J9.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),11,31)),this.keyNavigation(a,e);break;case"pageUp":i=new Date(+this.currentDate),this.addMonths(i,-1),!l&&+i<=+s&&(a=this.keyCalendarUpdate(!0,a)),this.addMonths(this.currentDate,-1),J9.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(a,e);break;case"pageDown":i=new Date(+this.currentDate),this.addMonths(i,1),l&&+r<=+i&&(a=this.keyCalendarUpdate(!1,a)),this.addMonths(this.currentDate,1),J9.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(a,e);break;case"shiftPageUp":i=new Date(+this.currentDate),this.addYears(i,-1),!l&&+i<=+s&&(a=this.keyCalendarUpdate(!0,a)),this.addYears(this.currentDate,-1),J9.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(a,e);break;case"shiftPageDown":i=new Date(+this.currentDate),this.addYears(i,1),l&&+r<=+i&&(a=this.keyCalendarUpdate(!1,a)),this.addYears(this.currentDate,1),J9.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(a,e);break;case"shiftTab":je(this.presetElement)||(this.presetElement.setAttribute("tabindex","0"),this.presetElement.focus(),this.removeFocusedDate()),l&&e.preventDefault(),this.tabKeyValidation(a,c9)&&(this.currentDate=new Date(+this.leftCalCurrentDate),this.navInCalendar(e,l,s,r,a));break;case"spacebar":this.applyButton&&!this.applyButton.disabled&&this.applyFunction(e);break;case"tab":this.tabKeyValidation(a,p9)&&(this.currentDate=new Date(+this.rightCalCurrentDate),this.navInCalendar(e,l,s,r,a));break;default:this.navInCalendar(e,l,s,r,a),this.checkMinMaxDays()}this.presetHeight()},$9.prototype.tabKeyValidation=function(e,t){var e=e.classList.contains(t),t=this.rightCalendar.querySelector(".e-header"),i=this.leftCalendar.querySelector(".e-header"),n=!!t&&t.classList.contains("e-month"),o=!!i&&i.classList.contains("e-month"),r=!!t&&t.classList.contains("e-year"),s=!!i&&i.classList.contains("e-year"),t=!!t&&t.classList.contains("e-decade"),i=!!i&&i.classList.contains("e-decade");return e&&(o||s||i)&&(n||r||t)&&!this.isMobile},$9.prototype.keyNavigation=function(e,t){this.bindCalendarCellEvents(e),e.classList.contains(p9)?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()},$9.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||je(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())}},$9.prototype.bindCalendarCellEvents=function(e){for(var e=(e||this.popupObj.element).querySelectorAll("."+T9+" td"),t=0,i=e;t<i.length;t++){var n=i[t];E.clearEvents(n),n.classList.contains(x9)||n.classList.contains(_9)||n.classList.contains(V9)||(this.isMobile||E.add(n,"mouseover",this.hoverSelection,this),E.add(n,"mousedown",this.selectRange,this))}},$9.prototype.removeFocusedDate=function(){for(var e=!je(this.startValue)||!je(this.endValue),t=0,i=this.popupObj.element.querySelectorAll("."+T9+" ."+R9);t<i.length;t++){var n=i[t],o=new Date,r=this.getIdValue(null,n);("Month"===this.depth&&"Month"===this.currentView()&&(!n.classList.contains(L9)||n.classList.contains(L9)&&e)||"Year"===this.depth&&"Year"===this.currentView()&&(!this.isSameMonth(o,r)&&!this.isSameYear(o,r)||e)||"Decade"===this.depth&&"Decade"===this.currentView()&&(!this.isSameYear(o,r)||e))&&(n.classList.remove(R9),n.classList.contains(f9)||n.classList.contains(y9)||n.removeAttribute("aria-label"))}},$9.prototype.hoverSelection=function(e,t){var t=t||e.currentTarget,i=this.getIdValue(null,t);if(!je(this.startValue)&&+this.startValue>=+this.min&&+this.startValue<=+this.max&&(!this.isDateDisabled(this.endValue)&&!this.isDateDisabled(this.startValue)&&je(this.endValue)&&je(this.startValue)||!je(this.startValue)&&je(this.endValue)))for(var n=0,o=this.popupObj.element.querySelectorAll("."+T9+" td");n<o.length;n++){var r,s=o[n],a=!s.classList.contains(x9)||s.classList.contains(_9);!s.classList.contains(V9)&&a&&(a=this.getIdValue(null,s),r="Month"===this.currentView()?new Date(+this.startValue):this.getStartEndDate(new Date(+this.startValue),!1),new Date(+a).setHours(0,0,0,0)>=r.setHours(0,0,0,0)&&+a<=+i?U([s],w9):q([s],[w9]))}},$9.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},$9.prototype.updateRange=function(e){if(!je(this.startValue))for(var t=0,i=e;t<i.length;t++)for(var n=0,o=i[t].querySelectorAll("."+T9+" td");n<o.length;n++){var r,s,a,l,h=o[n];h.classList.contains(V9)||h.classList.contains(x9)||(r=this.getIdValue(null,h),l=this.getIdValue(null,h),je(this.endValue)?q([h],[w9]):(s="Month"===this.currentView()?new Date(+this.startValue):this.getStartEndDate(new Date(+this.startValue),!1),a="Month"===this.currentView()?new Date(+this.endValue):this.getStartEndDate(new Date(+this.endValue),!0),this.currentView()===this.depth&&+l.setHours(0,0,0,0)>=+s.setHours(0,0,0,0)&&+l.setHours(0,0,0,0)<=+a.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)&&U([h],w9)),h.classList.contains(I9)&&h.classList.contains(y9)&&+l!=+this.endValue&&(q([h],[I9]),q([h],[y9])),h.classList.contains(w9)&&+l>+this.endValue&&q([h],[w9]),h.classList.contains(C9))||(s="Month"===this.currentView()?new Date(+this.startValue):this.getStartEndDate(new Date(+this.startValue),!1),a=new Date(+r),this.currentView()===this.depth&&+a.setHours(0,0,0,0)==+s.setHours(0,0,0,0)&&+a.setHours(0,0,0,0)>=+s.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(U([h],[f9,I9]),this.addSelectedAttributes(h,this.startValue,!0)),l="Month"===this.currentView()?new Date(+this.endValue):this.getStartEndDate(new Date(+this.endValue),!0),"Year"===this.currentView()?a=new Date(a.getFullYear(),a.getMonth()+1,0):"Decade"===this.currentView()&&(a=new Date(a.getFullYear(),11,31)),this.currentView()===this.depth&&!je(this.endValue)&&+a.setHours(0,0,0,0)==+l.setHours(0,0,0,0)&&+a.setHours(0,0,0,0)<=+l.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(U([h],[y9,I9]),this.addSelectedAttributes(h,this.startValue,!1)),+r!=+this.startValue)||je(this.endValue)||+r!=+this.endValue||this.addSelectedAttributes(h,this.endValue,!1,!0)}},$9.prototype.checkMinMaxDays=function(){(!je(this.minDays)&&0<this.minDays||!je(this.maxDays)&&0<this.maxDays)&&(this.isMobile?this.updateMinMaxDays(this.popupObj.element.querySelector("."+T9)):(this.updateMinMaxDays(this.popupObj.element.querySelector("."+p9)),this.updateMinMaxDays(this.popupObj.element.querySelector("."+c9))))},$9.prototype.rangeArgs=function(e){var t,i=je(this.startValue)?null:this.globalize.formatDate(this.startValue,{format:this.formatString,type:"date",skeleton:"yMd"}),n=je(this.endValue)?null:this.globalize.formatDate(this.endValue,{format:this.formatString,type:"date",skeleton:"yMd"}),i=je(this.endValue)||je(this.startValue)?(t="",0):(t=i+" "+this.separator+" "+n,Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1);return{value:this.value,startDate:this.startValue,endDate:this.endValue,daySpan:i,event:e||null,element:this.element,isInteracted:!je(e),text:t}},$9.prototype.otherMonthSelect=function(e,t,i){var n=+this.getIdValue(null,e),n='*[id^="/id"]:not(.e-other-month)'.replace("/id",""+n),n=this.popupObj&&this.popupObj.element.querySelector(n);je(n)||(t?(U([n],[f9,I9]),this.addSelectedAttributes(n,this.startValue,!0)):(U([n],[y9,I9]),this.addSelectedAttributes(n,this.endValue,!0)),i&&this.addSelectedAttributes(e,this.endValue,!1,!0))},$9.prototype.selectRange=function(e,t){e&&e.preventDefault();var i,n,o=this.inputElement.value,o=(je(o)||""===o.trim()||1<(o=o.split(" "+this.separator+" ")).length&&("Year"===this.currentView()&&"Year"===this.depth||"Decade"===this.currentView()&&"Decade"===this.depth)&&(d={format:this.formatString,type:"date",skeleton:"yMd"},l=this.globalize.parseDate(this.getAmPmValue(o[0]).trim(),d),d=this.globalize.parseDate(this.getAmPmValue(o[1]).trim(),d),h=!0),je(e)?this.getIdValue(null,t):this.getIdValue(e,null)),r=(je(this.startValue)||("Year"===this.currentView()&&"Year"===this.depth?o=new Date(o.getFullYear(),o.getMonth(),this.startValue.getDate()):"Decade"===this.currentView()&&"Decade"===this.depth&&(o=new Date(o.getFullYear(),this.startValue.getMonth(),this.startValue.getDate()))),o.getFullYear()),s=o.getMonth(),a=h&&"Year"!==this.start?new Date(r,s,l.getDate(),l.getHours(),l.getMinutes(),l.getSeconds()):new Date(r,s,1),s=h&&"Year"!==this.start?new Date(r,s,d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds()):new Date(r,s+1,0),l=h&&"Year"!==this.start?new Date(r,l.getMonth(),l.getDate(),l.getHours(),l.getMinutes(),l.getSeconds()):new Date(r,0,1),h=h&&"Year"!==this.start?new Date(r,d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds()):new Date(r,11,31),d=(je(this.endValue)||je(this.startValue)?this.isMobile&&this.startButton.element.classList.contains(m9)&&this.removeSelection():this.isMobile&&(!this.isMobile||this.endButton.element.classList.contains(m9))||this.removeSelection(),t||e.currentTarget);if(je(this.startValue))je(this.previousStartValue)||(o.setHours(this.previousStartValue.getHours()),o.setMinutes(this.previousStartValue.getMinutes()),o.setSeconds(this.previousStartValue.getSeconds())),this.startValue="Month"===this.depth?new Date(this.checkValue(o)):"Year"===this.depth?a:l,this.endValue=null,this.setValue(),U([d],f9),this.addSelectedAttributes(d,this.startValue,!0),d.classList.contains(C9)&&this.otherMonthSelect(d,!0),this.checkMinMaxDays(),this.applyButton.disabled=!0,this.applyButton.element.disabled=!0,this.isMobile&&(this.endButton.element.classList.add(m9),this.startButton.element.classList.remove(m9),this.endButton.element.removeAttribute("disabled"),this.selectableDates()),this.trigger("select",this.rangeArgs(e));else if(+o==+this.startValue||+o>+this.startValue){if(+o==+this.startValue&&!je(this.minDays)&&1<this.minDays)return;this.endValue=null,this.setValue(),(this.isMobile||t)&&this.hoverSelection(e,t),je(this.previousEndValue)||(o.setHours(this.previousEndValue.getHours()),o.setMinutes(this.previousEndValue.getMinutes()),o.setSeconds(this.previousEndValue.getSeconds())),this.endValue="Month"===this.depth?new Date(this.checkValue(o)):"Year"===this.depth?s:h,this.setValue();r=this.popupObj.element.querySelectorAll("."+y9);if(this.isMobile){this.startButton.element.classList.remove(m9),this.endButton.element.classList.add(m9);for(var p=0,c=r;p<c.length;p++){var u=c[p];u.removeAttribute("aria-label"),u.classList.contains(f9)?(this.addSelectedAttributes(u,this.startValue,!0),q([u],[y9])):(u.setAttribute("aria-selected","false"),q([u],[y9,I9]))}}U([d],y9),+this.endValue==+this.startValue?this.addSelectedAttributes(d,this.endValue,!1,!0):this.addSelectedAttributes(d,this.endValue,!1),d.classList.contains(C9)&&(+this.endValue==+this.startValue?this.otherMonthSelect(d,!1,!0):this.otherMonthSelect(d,!1));for(var g=0,m=this.popupObj.element.querySelectorAll("."+y9);g<m.length;g++){var f=m[g];f.classList.contains(f9)&&q([f],[w9])}this.applyButton.disabled=!1,this.applyButton.element.disabled=!1,this.isMobile||this.removeClassDisabled(),!je(this.renderDayCellArgs)&&this.renderDayCellArgs.isDisabled&&this.disabledDateRender(),this.trigger("select",this.rangeArgs(e))}else+o<+this.startValue&&(this.removeClassDisabled(),this.startValue="Month"===this.depth?new Date(this.checkValue(o)):"Year"===this.depth?a:l,this.setValue(),this.removeSelectedAttributes(),q(this.popupObj.element.querySelectorAll("."+f9),[f9,I9]),U([d],f9),this.addSelectedAttributes(d,this.startValue,!0),d.classList.contains(C9)&&this.otherMonthSelect(d,!0),this.checkMinMaxDays());je(i=e?z(e.target,"."+p9):i)?je(n=e?e&&z(e.target,"."+c9):n)||this.rightCalendar.children[1].firstElementChild.focus():this.leftCalendar.children[1].firstElementChild.focus(),U([d],I9),this.calendarIconEvent(),this.updateHeader(),this.removeFocusedDate()},$9.prototype.selectableDates=function(){if(!je(this.startValue)){var e=this.calendarElement.querySelectorAll("."+T9+" td"),t=!1;if(this.currentView()===this.depth){for(var i=0,n=e;i<n.length;i++){var o=n[i];if(!o.classList.contains(f9)&&!o.classList.contains(V9)&&!o.classList.contains(x9)){if(+this.getIdValue(null,o)<+this.startValue){U([o],[_9,x9,j9]),E.clearEvents(o);continue}break}if(o.classList.contains(f9)&&!o.classList.contains(C9)){t=!0;break}}!t||this.previousIcon.classList.contains(x9)||U([this.previousIcon],[H9,x9,j9])}else{for(var r=0,s=e;r<s.length;r++){var o=s[r],a=this.startValue.getMonth(),l=this.startValue.getFullYear(),h=this.getIdValue(null,o);if(this.startButton.element.classList.contains(m9)||!("Year"===this.currentView()&&h.getMonth()<a&&h.getFullYear()<=l||"Decade"===this.currentView()&&h.getMonth()<=a&&h.getFullYear()<l))break;U([o],[x9])}e[0].classList.contains(x9)?this.previousIconHandler(!0):e[e.length-1].classList.contains(x9)&&this.nextIconHandler(!0)}}},$9.prototype.updateMinMaxDays=function(e){if(!je(this.startValue)&&je(this.endValue)||this.isMobile&&this.endButton&&this.endButton.element.classList.contains(m9)){if(!je(this.minDays)&&0<this.minDays||!je(this.maxDays)&&0<this.maxDays){var t=this.removeTimeValueFromDate(this.startValue),i=new Date(new Date(+t).setDate(t.getDate()+(this.minDays-1))),n=new Date(new Date(+t).setDate(t.getDate()+(this.maxDays-1))),i=!je(this.minDays)&&0<this.minDays?i:null,n=!je(this.maxDays)&&0<this.maxDays?n:null;"Year"===this.currentView()?(i=je(i)?null:new Date(i.getFullYear(),i.getMonth(),0),n=je(n)?null:new Date(n.getFullYear(),n.getMonth(),1)):"Decade"===this.currentView()&&(i=je(i)?null:new Date(i.getFullYear()-1,11,1),n=je(n)?null:new Date(n.getFullYear(),0,1));for(var o=void 0,r=0,s=e.querySelectorAll("."+T9+" td");r<s.length;r++){var a,l=s[r];l.classList.contains(f9)||l.classList.contains(V9)||(a=this.getIdValue(null,l),a=this.removeTimeValueFromDate(a),!je(i)&&+a==+i&&l.classList.contains(x9)&&i.setDate(i.getDate()+1),l.classList.contains(x9))||+a<=+t||(!je(i)&&+a<+i&&(U([l],[_9,x9,j9]),E.clearEvents(l)),!je(n)&&+n<+a&&(U([l],[_9,x9,j9]),this.isMaxDaysClicked=!0,E.clearEvents(l),je(o))&&!l.classList.contains(C9)&&(o=l))}je(o)||(this.isMobile?this.nextIcon.classList.contains(x9)||U([this.nextIcon],[H9,x9,j9]):(e=je(e=z(o,"."+c9))?this.leftCalendar:e).classList.contains(p9)?(this.rightCalNextIcon.classList.contains(x9)||U([this.rightCalNextIcon],[H9,x9,j9]),this.leftCalNextIcon.classList.contains(x9)||U([this.leftCalNextIcon],[H9,x9,j9]),this.rightCalPrevIcon.classList.contains(x9)||U([this.rightCalPrevIcon],[H9,x9,j9])):this.rightCalNextIcon.classList.contains(x9)||U([this.rightCalNextIcon],[H9,x9,j9]))}}else this.isMaxDaysClicked=!1},$9.prototype.removeTimeValueFromDate=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},$9.prototype.removeClassDisabled=function(){for(var e=0,t=this.popupObj.element.querySelectorAll("."+T9+" td."+_9);e<t.length;e++){var i=t[e];i.classList.contains(_9)&&(q([i],[_9,x9,j9]),E.add(i,"click",this.selectRange,this),this.isMobile||E.add(i,"mouseover",this.hoverSelection,this))}this.isMobile?(this.nextIcon.classList.contains(H9)&&q([this.nextIcon],[H9,x9,j9]),this.previousIcon.classList.contains(H9)&&q([this.previousIcon],[H9,x9,j9])):(this.rightCalNextIcon.classList.contains(H9)&&q([this.rightCalNextIcon],[H9,x9,j9]),this.rightCalPrevIcon.classList.contains(H9)&&q([this.rightCalPrevIcon],[H9,x9,j9]),this.leftCalNextIcon.classList.contains(H9)&&q([this.leftCalNextIcon],[H9,x9,j9]))},$9.prototype.updateHeader=function(){var e,t={type:"date",skeleton:"yMMMd"};je(this.endValue)||je(this.startValue)?this.popupObj.element.querySelector("."+N9).textContent=this.l10n.getConstant("selectedDays"):(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,je(this.disabledDayCnt)||(e-=this.disabledDayCnt,this.disabledDayCnt=null),this.popupObj.element.querySelector("."+N9).textContent=e.toString()+" "+this.l10n.getConstant("days")),this.isMobile?(je(this.startValue)?this.startButton.element.textContent=this.l10n.getConstant("startLabel"):this.startButton.element.textContent=this.globalize.formatDate(this.startValue,t),je(this.endValue)||je(this.startValue)?this.endButton.element.textContent=this.l10n.getConstant("endLabel"):this.endButton.element.textContent=this.globalize.formatDate(this.endValue,t)):(je(this.endValue)||je(this.startValue)?this.popupObj.element.querySelector("."+A9).textContent=this.l10n.getConstant("endLabel"):this.popupObj.element.querySelector("."+A9).textContent=this.globalize.formatDate(this.endValue,t),je(this.startValue)?this.popupObj.element.querySelector("."+S9).textContent=this.l10n.getConstant("startLabel"):this.popupObj.element.querySelector("."+S9).textContent=this.globalize.formatDate(this.startValue,t)),(this.isDateDisabled(this.startValue)||this.isDateDisabled(this.endValue)||!je(this.startValue)&&+this.startValue<+this.min||!je(this.endValue)&&+this.endValue>+this.max||!je(this.startValue)&&!je(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("."+N9).textContent=this.l10n.getConstant("selectedDays")):(this.popupObj.element.querySelector("."+N9).textContent=this.l10n.getConstant("selectedDays"),this.popupObj.element.querySelector("."+S9).textContent=this.l10n.getConstant("startLabel"),this.popupObj.element.querySelector("."+A9).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")},$9.prototype.removeSelection=function(){this.startValue=null,this.endValue=null,this.setValue(),this.removeSelectedAttributes(),this.popupObj&&(0<this.popupObj.element.querySelectorAll("."+I9).length&&q(this.popupObj.element.querySelectorAll("."+I9),[f9,y9,I9]),0<this.popupObj.element.querySelectorAll("."+R9).length&&q(this.popupObj.element.querySelectorAll("."+R9),R9),0<this.popupObj.element.querySelectorAll("."+w9).length)&&q(this.popupObj.element.querySelectorAll("."+w9),[w9])},$9.prototype.addSelectedAttributes=function(e,t,i,n){e&&(t=this.globalize.formatDate(t,{type:"date",skeleton:"full"}),!je(n)&&n?e.setAttribute("aria-label","The current start and end date is "+t):e.setAttribute("aria-label","The current "+(i?"start":"end")+" date is "+t),e.setAttribute("aria-selected","true"))},$9.prototype.removeSelectedAttributes=function(){if(this.popupObj){for(var e=0,t=this.popupObj.element.querySelectorAll("."+f9);e<t.length;e++)(i=t[e]).setAttribute("aria-selected","false"),i.removeAttribute("aria-label");for(var i,n=0,o=this.popupObj.element.querySelectorAll("."+y9);n<o.length;n++)(i=o[n]).setAttribute("aria-selected","false"),i.removeAttribute("aria-label")}},$9.prototype.updateCalendarElement=function(e){e.classList.contains(p9)?(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("."+O9),this.tableBodyElement=ge("."+O9+" tbody",e),this.table=e.querySelector("."+O9).getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector("."+M9+" ."+k9),this.headerElement=e.querySelector("."+M9)},$9.prototype.navPrevMonth=function(e){e.preventDefault();var t=je(t=z(e.target,"."+p9))?z(e.target,"."+c9):t;this.updateCalendarElement(t),this.navigatePrevious(e),!je(this.startValue)&&je(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},$9.prototype.deviceNavigation=function(e){this.deviceCalendarEvent(),this.updateRange([this.popupObj.element.querySelector("."+T9)]),this.endButton.element.classList.contains(m9)&&this.updateMinMaxDays(this.popupObj.element.querySelector("."+T9)),this.endButton.element.classList.contains(m9)&&this.selectableDates(),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},$9.prototype.updateControl=function(e,t){void 0===t&&(t=null),e.classList.contains(c9)?this.rightCalCurrentDate=new Date(+(t||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])},$9.prototype.navNextMonth=function(e){e.preventDefault();var t=je(t=z(e.target,"."+p9))?z(e.target,"."+c9):t;this.updateCalendarElement(t),this.navigateNext(e),!je(this.startValue)&&je(this.endValue)&&this.updateMinMaxDays(t),this.updateControl(t)},$9.prototype.isPopupOpen=function(){return!(je(this.popupObj)||!this.popupObj.element.classList.contains(d9))},$9.prototype.createRangeHeader=function(){var e,t,i,n=this.createElement("div",{className:"e-start-end"});return this.isMobile?(t=this.createElement("button",{className:"e-end-btn"}),e=this.createElement("button",{className:v9}),this.startButton=new zv({content:this.l10n.getConstant("startLabel")},e),this.endButton=new zv({content:this.l10n.getConstant("endLabel")},t),n.appendChild(e),n.appendChild(t)):(e=this.createElement("a",{className:S9}),t=this.createElement("a",{className:A9}),i=this.createElement("span",{className:"e-change-icon e-icons"}),pt(e,{"aria-atomic":"true","aria-live":"assertive","aria-label":"Start Date",role:"button"}),pt(t,{"aria-atomic":"true","aria-live":"assertive","aria-label":"End Date",role:"button"}),n.appendChild(e),n.appendChild(i),n.appendChild(t),e.textContent=this.l10n.getConstant("startLabel"),t.textContent=this.l10n.getConstant("endLabel")),n},$9.prototype.disableInput=function(){this.strictMode?je(this.previousStartValue)||je(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),HF.setEnabled(this.enabled,this.inputElement),this.bindEvents()},$9.prototype.validateMinMax=function(){this.min=je(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=je(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,this.min<=this.max?(je(this.minDays)||je(this.maxDays)||0<this.maxDays&&0<this.minDays&&this.minDays>this.maxDays&&(this.maxDays=null),!je(this.minDays)&&this.minDays<0&&(this.minDays=null),!je(this.maxDays)&&this.maxDays<0&&(this.maxDays=null)):this.disableInput()},$9.prototype.validateRangeStrict=function(){je(this.startValue)||(+this.startValue<=+this.min?(this.startValue=this.min,this.setValue()):+this.startValue>=+this.min&&+this.startValue>=+this.max&&(this.startValue=this.max)),je(this.endValue)||(+this.endValue>+this.max?(this.endValue=this.max,this.setValue()):+this.endValue<+this.min&&(this.endValue=this.min,this.setValue())),this.validateMinMaxDays()},$9.prototype.validateRange=function(){this.validateMinMaxDays()},$9.prototype.validateMinMaxDays=function(){var e,t;je(this.startValue)||je(this.endValue)||(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,je(this.minDays)||!(0<this.minDays)||e>=this.minDays||(this.strictMode?((t=new Date(+this.startValue)).setDate(t.getDate()+(this.minDays-1)),+t>+this.max?this.endValue=this.max:this.endValue=t):(this.startValue=null,this.endValue=null),this.setValue()),je(this.maxDays))||!(0<this.maxDays)||e<=this.maxDays||(this.strictMode?(this.endValue=new Date(+this.startValue),this.endValue.setDate(this.endValue.getDate()+(this.maxDays-1))):(this.startValue=null,this.endValue=null),this.setValue())},$9.prototype.renderCalendar=function(){this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(T9),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),pt(this.calendarElement,{"data-role":"calendar"}),J9.prototype.createHeader.call(this),J9.prototype.createContent.call(this)},$9.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},$9.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},$9.prototype.isSameDecade=function(e,t){e=e.getFullYear(),t=t.getFullYear();return e-e%10==t-t%10},$9.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)))},$9.prototype.selectNextMonth=function(){var e;je(this.endValue)||je(this.startValue)||this.isSameMonth(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)?(this.currentDate.setDate(1),this.currentDate.setMonth(this.currentDate.getMonth()+1)):(this.currentDate=new Date(+this.endValue),(!je(this.startValue)&&+this.startValue<+this.min||!je(this.endValue)&&+this.endValue>+this.max||!je(this.startValue)&&!je(this.endValue)&&+this.startValue>+this.endValue)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setDate(1),e=this.currentDate.getMonth()+1,this.currentDate.setMonth(e)))},$9.prototype.selectNextYear=function(){var e;je(this.endValue)||je(this.startValue)||this.isSameYear(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)?(this.currentDate.setMonth(0),e=this.currentDate.getFullYear()+1,this.currentDate.setFullYear(e)):(this.currentDate=new Date(+this.endValue),(!je(this.endValue)&&+this.endValue>+this.max||!je(this.startValue)&&!je(this.endValue)&&+this.startValue>+this.endValue||!je(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)))},$9.prototype.selectNextDecade=function(){var e;je(this.endValue)||je(this.startValue)||this.isSameDecade(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)?(e=this.currentDate.getFullYear()+10,this.currentDate.setFullYear(e)):(this.currentDate=new Date(+this.endValue),(!je(this.startValue)&&!je(this.endValue)&&+this.startValue>+this.endValue||!je(this.endValue)&&+this.endValue>+this.max||!je(this.startValue)&&+this.startValue<+this.min)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setFullYear(this.currentDate.getFullYear()+10)))},$9.prototype.selectStartMonth=function(){je(this.startValue)?(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.startMonthCurrentDate()):!je(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)),(!je(this.endValue)&&+this.endValue>+this.max||!je(this.startValue)&&+this.startValue<+this.min||!je(this.startValue)&&!je(this.endValue)&&+this.startValue>+this.endValue)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.startMonthCurrentDate()},$9.prototype.createCalendar=function(){var e,t,i=this.createElement("div",{className:"e-calendar-container"});return this.isMobile?(je(this.startValue)||(this.currentDate=new Date(+this.startValue)),J9.prototype.validateDate.call(this),J9.prototype.minMaxUpdate.call(this),J9.prototype.render.call(this),t=this.calendarElement.querySelector("."+T9+" ."+D9),e=this.calendarElement.querySelector("."+T9+" ."+E9),ue(this.calendarElement.querySelector("."+T9+" ."+P9)),this.calendarElement.querySelector("."+T9+" ."+M9).appendChild(e),this.calendarElement.querySelector("."+T9+" ."+M9).appendChild(t),lt([t],this.calendarElement.querySelector("."+T9+" ."+M9)),this.deviceCalendar=this.calendarElement,i.appendChild(this.calendarElement),this.headerTitleElement=this.calendarElement.querySelector("."+T9+" ."+M9+" ."+k9)):(this.selectStartMonth(),this.renderCalendar(),this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarElement.classList.add(p9),this.leftCalPrevIcon=this.calendarElement.querySelector("."+p9+" ."+D9),this.leftCalNextIcon=this.calendarElement.querySelector("."+p9+" ."+E9),this.leftTitle=this.calendarElement.querySelector("."+p9+" ."+k9),ue(this.calendarElement.querySelector("."+p9+" ."+P9)),this.calendarElement.querySelector("."+p9+" ."+M9).appendChild(this.leftCalNextIcon),this.calendarElement.querySelector("."+p9+" ."+M9).appendChild(this.leftCalPrevIcon),lt([this.leftCalPrevIcon],this.calendarElement.querySelector("."+p9+" ."+M9)),this.leftCalendar=this.calendarElement,e=this.createElement("div",{className:"e-left-container"}),t=this.createElement("div",{className:"e-right-container"}),e.appendChild(this.leftCalendar),i.appendChild(e),this.isMobile||E.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),U([this.calendarElement],c9),this.rightCalendar=this.calendarElement,q([this.leftCalendar&&this.leftCalendar.querySelector(".e-content tbody")],"e-zoomin"),q([this.rightCalendar&&this.rightCalendar.querySelector(".e-content tbody")],"e-zoomin"),this.rightCalPrevIcon=this.calendarElement.querySelector("."+c9+" ."+D9),this.rightCalNextIcon=this.calendarElement.querySelector("."+c9+" ."+E9),this.rightTitle=this.calendarElement.querySelector("."+c9+" ."+k9),ue(this.calendarElement.querySelector("."+c9+" ."+P9)),this.calendarElement.querySelector("table").setAttribute("tabindex","0"),this.calendarElement.querySelector("."+c9+" ."+M9).appendChild(this.rightCalNextIcon),this.calendarElement.querySelector("."+c9+" ."+M9).appendChild(this.rightCalPrevIcon),lt([this.rightCalPrevIcon],this.calendarElement.querySelector("."+c9+" ."+M9)),t.appendChild(this.rightCalendar),i.appendChild(t),this.isMobile||E.add(this.rightTitle,"click",this.rightNavTitle,this)),i},$9.prototype.leftNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.leftCalendar,this.calendarNavigation(e,this.calendarElement))},$9.prototype.calendarNavigation=function(e,t){this.table=t.querySelector("table"),this.headerTitleElement=t.querySelector(".e-title"),this.tableBodyElement=t.querySelector("tbody"),this.tableHeadElement=t.querySelector("thead"),this.contentElement=t.querySelector(".e-content"),this.updateCalendarElement(t),J9.prototype.navigateTitle.call(this,e),this.updateNavIcons()},$9.prototype.rightNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.rightCalendar,this.calendarNavigation(e,this.calendarElement))},$9.prototype.clickEventEmitter=function(e){this.isMobile||(z(e.target,".e-calendar.e-left-calendar")?(this.calendarElement=this.leftCalendar,this.updateCalendarElement(this.leftCalendar)):(this.calendarElement=this.rightCalendar,this.updateCalendarElement(this.rightCalendar)))},$9.prototype.currentView=function(){return J9.prototype.currentView.call(this)},$9.prototype.getCalendarView=function(e){return"Year"===e?"Year":"Decade"===e?"Decade":"Month"},$9.prototype.navigatedEvent=function(e){var t;this.trigger("navigated",this.navigatedArgs),je(this.popupObj)||(t=this.getCalendarView(this.currentView()),this.isMobile?t===this.depth?(this.bindCalendarCellEvents(),this.deviceNavigation(),this.removeFocusedDate(),this.checkMinMaxDays()):this.selectableDates():this.isMobile||t!==this.depth?(this.updateNavIcons(),this.calendarIconEvent()):((this.calendarElement.classList.contains("e-left-calendar")?this.leftCalendar:this.rightCalendar)!==this.leftCalendar||(!e||e.currentTarget.children[0].classList.contains("e-icons"))&&je(this.controlDown)?(!e||e.currentTarget.children[0].classList.contains("e-icons"))&&je(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&&je(this.endValue)&&("Month"===t&&this.startValue.getMonth()<this.rightCalCurrentDate.getMonth()&&this.startValue.getFullYear()<=this.rightCalCurrentDate.getFullYear()||"Year"===t&&this.startValue.getFullYear()<this.rightCalCurrentDate.getFullYear())?J9.prototype.navigateTo.call(this,t,new Date(+this.startValue)):J9.prototype.navigateTo.call(this,t,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),J9.prototype.navigateTo.call(this,t,this.rightCalCurrentDate),e=this.rightCalCurrentDate||this.currentDate,this.updateControl(this.rightCalendar,e),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null),this.checkMinMaxDays()))},$9.prototype.createControl=function(){var e=this.createElement("div",{className:B9}),t=this.createElement("div",{className:"e-range-header"}),i=(this.isMobile&&this.fullScreenMode&&(o=this.createElement("div",{className:"e-model-header-wrapper"}),i=this.createElement("span",{className:"e-popup-close"}),E.add(i,"mousedown touchstart",this.modelRangeCloseHandler,this),n=this.createElement("span",{className:"e-apply"}),E.add(n,"mousedown touchstart",this.applyFunction,this),o.appendChild(i),o.appendChild(n),t.appendChild(o)),this.createRangeHeader()),n=(t.appendChild(i),this.createElement("div",{className:N9})),o=(pt(n,{"aria-label":"Selected Days"}),n.textContent=this.l10n.getConstant("selectedDays"),t.appendChild(n),this.createElement("div",{className:"e-separator"})),i=this.createCalendar(),n=(e.appendChild(t),e.appendChild(o),e.appendChild(i),this.createElement("div",{className:"e-footer"})),t=this.createElement("button",{className:"e-cancel e-flat e-css"}),o=this.createElement("button"),i=(U([o],["e-apply","e-flat","e-primary","e-css"]),n.appendChild(o),n.appendChild(t),!je(this.startValue)&&!je(this.endValue));this.cancelButton=new zv({content:this.l10n.getConstant("cancelText")},t),this.applyButton=new zv({content:this.l10n.getConstant("applyText"),disabled:!i},o),E.add(o,"click",this.applyFunction,this),E.add(t,"click",this.cancelFunction,this),this.popupWrapper.appendChild(e),this.isMobile||ee(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||(this.createPresets(),this.listRippleEffect(),U([e],"e-range-border"),U([this.popupWrapper],"e-preset-wrapper"),this.popupWrapper.querySelector("."+F9).style.height=this.popupWrapper.querySelector("."+B9).getBoundingClientRect().height+"px"),this.popupWrapper.appendChild(n),this.isMobile&&this.deviceHeaderUpdate(),this.renderPopup()},$9.prototype.modelRangeCloseHandler=function(e){this.hide()},$9.prototype.cancelFunction=function(e){document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),U([this.inputWrapper.container],[b9])),e.preventDefault(),this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.startValue=null,this.endValue=null,this.removeSelection(),this.hide(e)},$9.prototype.deviceHeaderUpdate=function(){je(this.startValue)&&je(this.endValue)?(this.endButton.element.setAttribute("disabled",""),this.startButton.element.classList.add(m9)):je(this.startValue)||this.startButton.element.classList.add(m9)},$9.prototype.applyFunction=function(e){var t=!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(),U([this.inputWrapper.container],[b9])),"touchstart"!==e.type&&this.closeEventArgs&&!this.closeEventArgs.cancel&&e.preventDefault(),je(this.startValue)||je(this.endValue)?this.hide(e||null):(this.previousStartValue&&this.previousEndValue&&this.startValue.getDate()===this.previousStartValue.getDate()&&this.startValue.getMonth()===this.previousStartValue.getMonth()&&this.startValue.getFullYear()===this.previousStartValue.getFullYear()&&this.endValue.getDate()===this.previousEndValue.getDate()&&this.endValue.getMonth()===this.previousEndValue.getMonth()&&this.endValue.getFullYear()===this.previousEndValue.getFullYear()||HF.setValue(this.rangeArgs(e).text,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue),this.previousEleValue=this.inputElement.value,+this.initStartDate==+this.startValue&&+this.initEndDate==+this.endValue||(t=!0),this.changeTrigger(e),this.hide(e||null),this.errorClass(),t=!0),z(e.target,"."+h9)||t||this.focusOut(),this.isMobile||(this.isKeyPopup=!1,this.isRangeIconClicked&&(this.inputWrapper.container.children[1].focus(),this.keyInputConfigs=Pe(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new bn(this.inputWrapper.container.children[1],{eventName:"keydown",keyConfigs:this.keyInputConfigs,keyAction:this.popupKeyActionHandle.bind(this)})))},$9.prototype.onMouseClick=function(e,t){var i;"touchstart"===e.type||(i=(t=z(t||e.target,"."+W9))&&t.classList.contains(m9),t&&t.classList.contains(W9)&&this.setListSelection(t,e),this.preventFocus=!0,this.inputElement.focus(),this.isMobile)||(this.preventFocus=!0,t&&t.classList.contains(W9)&&"custom_range"===t.getAttribute("id")?this.leftCalendar.children[1].firstElementChild.focus():i||"keydown"!==e.type||this.inputElement.focus())},$9.prototype.onMouseOver=function(e){e=z(e.target,"."+W9);e&&e.classList.contains(W9)&&!e.classList.contains(Q9)&&U([e],Q9)},$9.prototype.onMouseLeave=function(e){e=z(e.target,"."+Q9);je(e)||q([e],Q9)},$9.prototype.setListSelection=function(e,t){if(e&&(!e.classList.contains(m9)||this.isMobile&&e.classList.contains(m9))){if(this.isMobile&&e.classList.contains(m9))return this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),"custom_range"===this.presetsItem[this.activeIndex].id?void this.renderCustomPopup():void 0;this.removeListSelection(),this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),U([e],m9),e.setAttribute("aria-selected","true");e=this.presetsItem[this.activeIndex];"custom_range"===e.id?this.renderCustomPopup():this.applyPresetRange(e,t)}},$9.prototype.removeListSelection=function(){var e=this.presetElement.querySelector("."+m9);je(e)||(q([e],m9),e.removeAttribute("aria-selected"))},$9.prototype.setValue=function(){this.modelValue=[this.startValue,this.endValue]},$9.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())},$9.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()},$9.prototype.renderCustomPopup=function(){var t=this,e=(this.isCustomWindow=!0,this.popupObj.hide(),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:u9+" "+d9}),this.renderControl(),this.openEventArgs={popup:this.popupObj||null,cancel:!1,date:this.inputElement.value,model:this,event:event||null,appendTo:this.isMobile||F.isDevice?this.mobileRangePopupWrap:document.body},this.openEventArgs);this.trigger("open",e,function(e){t.openEventArgs=e,t.openEventArgs.cancel}),this.openEventArgs.appendTo.appendChild(this.popupWrapper),this.showPopup(),this.isCustomRange=!0,this.isMobile||this.calendarFocus()},$9.prototype.listRippleEffect=function(){for(var e=0,t=this.liCollections;e<t.length;e++)Ht(t[e])},$9.prototype.createPresets=function(){var e,t,i,n,o;ee(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||(this.presetElement=this.createElement("div",{className:F9,attrs:{tabindex:"0"}}),pt(e=X_.createList(this.createElement,this.presetsItem,null,!0),{role:"listbox","aria-hidden":"false",id:this.element.id+"_options",tabindex:"0","aria-label":"daterangepicker-preset"}),this.presetElement.appendChild(e),this.popupWrapper.appendChild(this.presetElement),je(e=this.presetElement.querySelector("#custom_range"))||(e.textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range"),this.liCollections=this.presetElement.querySelectorAll("."+W9),this.wireListEvents(),this.isMobile&&(this.fullScreenMode?(e=Q("div",{className:"e-range-mob-popup-wrap"}),t=this.createElement("div",{className:"e-model-header"}),(i=this.createElement("span",{className:"e-model-title"})).textContent="Select Preset",n=this.createElement("span",{className:"e-popup-close"}),E.add(n,"mousedown touchstart",this.modelRangeCloseHandler,this),o=this.presetElement,t.appendChild(n),t.appendChild(i),e.appendChild(t),e.appendChild(o),this.popupWrapper.insertBefore(e,this.popupWrapper.firstElementChild),this.presetElement.style.width="100%"):this.presetElement.style.width=this.inputWrapper.container.getBoundingClientRect().width+"px"),!je(this.activeIndex)&&-1<this.activeIndex&&U([this.liCollections[this.activeIndex]],m9))},$9.prototype.wireListEvents=function(){E.add(this.presetElement,"click",this.onMouseClick,this),this.isMobile||(E.add(this.presetElement,"mouseover",this.onMouseOver,this),E.add(this.presetElement,"mouseout",this.onMouseLeave,this))},$9.prototype.unWireListEvents=function(){je(this.presetElement)||(E.remove(this.presetElement,"click touchstart",this.onMouseClick),this.isMobile)||(E.remove(this.presetElement,"mouseover",this.onMouseOver),E.remove(this.presetElement,"mouseout",this.onMouseLeave))},$9.prototype.renderPopup=function(){var t=this,e=(this.popupWrapper.classList.add("e-control"),this.popupWrapper.getBoundingClientRect().width);je(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 Sv(this.popupWrapper,{relateTo:this.isMobile&&this.isCustomWindow?document.body:je(this.targetElement)?this.inputWrapper.container:this.targetElement,position:this.isMobile?ee(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:-e,offsetY:4,collision:this.isMobile?ee(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.isMobile&&t.fullScreenMode&&(t.iconRangeRight=t.calendarElement&&window.getComputedStyle(t.calendarElement.querySelector(".e-header.e-month .e-prev")).cssFloat,t.iconRangeRight)&&(t.touchRangeModule=new Mn(t.calendarElement.querySelector(".e-content.e-month"),{swipe:t.dateRangeSwipeHandler.bind(t)}),E.add(t.calendarElement.querySelector(".e-content.e-month"),"touchstart",t.touchStartRangeHandler,t)),pt(t.inputElement,{"aria-expanded":"true","aria-owns":t.element.id,"aria-controls":t.inputElement.id}),t.value?pt(t.inputElement,{"aria-activedescendant":t.inputElement.id}):t.inputElement.removeAttribute("aria-activedescendant"),U([t.inputWrapper.buttons[0]],m9),t.isMobile||(t.cancelButton&&(t.btnKeyboardModule=new bn(t.cancelButton.element,{eventName:"keydown",keyAction:t.popupKeyActionHandle.bind(t),keyConfigs:{tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),t.btnKeyboardModule=new bn(t.applyButton.element,{eventName:"keydown",keyAction:t.popupKeyActionHandle.bind(t),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}})),je(t.leftCalendar)||t.isRangeIconClicked||t.calendarFocus(),je(t.presetElement)||(t.keyInputConfigs=Pe(t.keyInputConfigs,t.keyConfigs),t.presetKeyboardModule=new bn(t.presetElement,{eventName:"keydown",keyAction:t.presetKeyActionHandler.bind(t),keyConfigs:t.keyInputConfigs}),t.presetKeyboardModule=new bn(t.presetElement,{eventName:"keydown",keyAction:t.popupKeyActionHandle.bind(t),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),je(t.leftCalendar)?(t.preventBlur=!0,t.presetElement.focus()):t.presetElement.setAttribute("tabindex","-1")),t.popupKeyBoardHandler()),t.isMobile&&!F.isDevice&&E.add(document,"keydown",t.popupCloseHandler,t)},close:function(){pt(t.inputElement,{"aria-expanded":"false"}),t.inputElement.removeAttribute("aria-owns"),t.inputElement.removeAttribute("aria-controls"),t.inputElement.removeAttribute("aria-activedescendant"),q([t.inputWrapper.buttons[0]],m9),t.isRangeIconClicked&&t.inputWrapper.container.children[1].focus(),ee(t.presets[0].start&&t.presets[0].end&&t.presets[0].label)||t.unWireListEvents(),t.applyButton&&t.applyButton.destroy(),t.cancelButton&&t.cancelButton.destroy(),t.isMobile&&t.endButton&&t.endButton.destroy(),t.isMobile&&t.startButton&&t.startButton.destroy(),je(t.popupObj)||(je(t.popupObj.element.parentElement)||G(t.popupObj.element),t.popupObj.destroy(),t.popupObj=null),t.isMobile&&!F.isDevice&&E.remove(document,"keydown",t.popupCloseHandler)},targetExitViewport:function(){var e=t.popupObj&&t.popupObj.element;!F.isDevice&&e&&e.getBoundingClientRect().height<window.innerHeight&&t.hide()}}),this.isMobile&&this.popupObj.element.classList.add(z9),this.isMobile&&this.isCustomWindow&&(U([this.modal],[z9,u9,"e-range-modal"]),document.body.className+=" "+U9,this.modal.style.display="block"),E.add(document,"mousedown touchstart",this.documentHandler,this)},$9.prototype.dateRangeSwipeHandler=function(e){var t=0;if("left"===this.iconRangeRight)switch(e.swipeDirection){case"Left":t=1;break;case"Right":t=-1}else switch(e.swipeDirection){case"Up":t=1;break;case"Down":t=-1}this.touchRangeStart&&(1===t?this.navigateNext(e):-1===t&&this.navigatePrevious(e),this.touchRangeStart=!1)},$9.prototype.touchStartRangeHandler=function(e){this.touchRangeStart=!0},$9.prototype.popupCloseHandler=function(e){27===e.keyCode&&this.hide(e)},$9.prototype.calendarFocus=function(){var e,t=this.popupObj&&this.popupObj.element.querySelector("."+f9);t?(e=je(e=z(t,"."+c9))?this.leftCalendar:e,(this.isRangeIconClicked?this.inputWrapper.container:(this.preventBlur=!0,e.children[1].firstElementChild)).focus(),U([t],R9)):(this.isRangeIconClicked?this.inputWrapper.container:(this.preventBlur=!0,this.leftCalendar.children[1].firstElementChild)).focus()},$9.prototype.presetHeight=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+F9),t=this.popupObj&&this.popupObj.element.querySelector("."+B9);je(e)||je(t)||(e.style.height=t.getBoundingClientRect().height+"px")},$9.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 t=this.getHoverLI(),i=this.getActiveLI();if(!je(this.leftCalendar)&&!je(i))if(je(t)||!je(i)&&i===t)if(this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(i),"custom_range"===this.presetsItem[this.activeIndex].id)return this.calendarFocus(),i.classList.remove(Q9),void e.preventDefault();je(t)&&je(i)||this.onMouseClick(e,t||i),e.preventDefault();break;case"tab":this.leftCalendar?je(t=this.getHoverLI())||t.classList.remove(Q9):(this.hide(e),e.preventDefault())}},$9.prototype.listMoveDown=function(e){var t,i=this.getHoverLI(),n=this.getActiveLI();je(i)?je(n)?U([this.liCollections[0]],Q9):!je(t=n.nextElementSibling)&&t.classList.contains(W9)&&U([t],Q9):!je(t=i.nextElementSibling)&&t.classList.contains(W9)&&(q([i],Q9),U([t],Q9))},$9.prototype.listMoveUp=function(e){var t,i=this.getHoverLI(),n=this.getActiveLI();je(i)?je(n)||!je(t=n.previousElementSibling)&&t.classList.contains(W9)&&U([t],Q9):!je(t=i.previousElementSibling)&&t.classList.contains(W9)&&(q([i],Q9),U([t],Q9))},$9.prototype.getHoverLI=function(){return this.presetElement.querySelector("."+Q9)},$9.prototype.getActiveLI=function(){return this.presetElement.querySelector("."+m9)},$9.prototype.popupKeyBoardHandler=function(){this.popupKeyboardModule=new bn(this.popupWrapper,{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:{escape:"escape"}}),this.keyInputConfigs=Pe(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new bn(this.inputWrapper.container.children[1],{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:this.keyInputConfigs})},$9.prototype.setScrollPosition=function(){var e,t,i=this.presetElement.getBoundingClientRect().height,n=this.presetElement.querySelector("."+Q9),o=this.presetElement.querySelector("."+m9),o=je(n)?o:n;je(o)||(e=((n=o.nextElementSibling)||o).offsetTop,t=o.getBoundingClientRect().height,e+o.offsetTop>i?this.presetElement.scrollTop=n?e-(i/2+t/2):e:this.presetElement.scrollTop=0)},$9.prototype.popupKeyActionHandle=function(e){var t=z(e.target,"."+F9);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":(je(t)?document.activeElement===this.cancelButton.element&&!0!==this.applyButton.element.disabled?this.applyButton.element:this.leftCalendar.children[1].firstElementChild:this.cancelButton.element).focus(),e.preventDefault();break;case"altLeftArrow":(je(t)?document.activeElement===this.applyButton.element&&!0!==this.applyButton.element.disabled?this.cancelButton.element:je(this.presetElement)||document.activeElement!==this.cancelButton.element?this.rightCalendar.children[1].firstElementChild:this.presetElement:this.rightCalendar.children[1].firstElementChild).focus(),e.preventDefault()}},$9.prototype.documentHandler=function(e){var t;je(this.popupObj)||(t=e.target,this.inputWrapper.container.contains(t)&&(je(this.popupObj)||z(t,'[id="'+this.popupWrapper.id+'"]')||"mousedown"===e.type)||"touchstart"!==e.type&&("mousedown"===e.type||this.closeEventArgs&&!this.closeEventArgs.cancel)&&e.preventDefault(),!je(this.targetElement)&&(je(this.targetElement)||t===this.targetElement))||z(t,'[id="'+this.popupWrapper.id+'"]')||z(t,"."+h9)===this.inputWrapper.container||z(t,".e-daterangepicker.e-popup")&&!t.classList.contains("e-day")||t.classList.contains("e-dlg-overlay")||(this.preventBlur=!1,this.isPopupOpen()&&document.body.contains(this.popupObj.element)&&(this.applyFunction(e),this.isMobile||(this.isRangeIconClicked=!1)))},$9.prototype.createInput=function(){this.fullScreenMode&&this.isMobile&&(this.cssClass+=" e-popup-expand");var e=this.cssClass;je(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=HF.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),pt(this.inputElement,{tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),HF.addAttributes({"aria-label":"select",role:"button"},this.inputWrapper.buttons[0]),this.setEleWidth(this.width),U([this.inputWrapper.container],"e-date-range-wrapper"),je(this.inputElement.getAttribute("name"))&&pt(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},$9.prototype.setEleWidth=function(e){this.inputWrapper.container.style.width="string"==typeof e?this.width:"number"==typeof e?T(this.width):"100%"},$9.prototype.adjustLongHeaderWidth=function(){"Wide"===this.dayHeaderFormat&&U([this.popupWrapper],"e-daterange-day-header-lg")},$9.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(),je(this.endValue)||je(this.startValue)||e||je(this.renderDayCellArgs)||!this.renderDayCellArgs.isDisabled||this.disabledDateRender(),this.errorClass(),this.previousStartValue=je(this.startValue)||isNaN(+this.startValue)?null:new Date(+this.startValue),this.previousEndValue=je(this.endValue)||isNaN(+this.endValue)?null:new Date(+this.endValue)},$9.prototype.updateInput=function(){var e,t;je(this.endValue)||je(this.startValue)||(t={format:this.formatString,type:"date",skeleton:"yMd"},e=this.globalize.formatDate(this.startValue,t),t=this.globalize.formatDate(this.endValue,t),HF.setValue(e+" "+this.separator+" "+t,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue)),!this.strictMode&&je(this.value)&&this.invalidValueString&&HF.setValue(this.invalidValueString,this.inputElement,this.floatLabelType,this.showClearButton)},$9.prototype.checkInvalidRange=function(e){var t,i,n,o,r,s,a,l,h,d;!je(e)&&(n=i=void 0,s=r=o=null,h=l=a=t=!1,"string"==typeof e?2===(d=e.split(" "+this.separator+" ")).length?(o=d[0],r=d[1]):(t=!0,s=e):(n=0<e.length?(i=e[0],e[1]):(i=e.start,e.end),i instanceof Date||"object"==typeof i?i instanceof Date?a=!0:je(i)||(h=!0):o=this.getstringvalue(i),n instanceof Date||"object"==typeof n?n instanceof Date?l=!0:je(n)||(h=!0):r=this.getstringvalue(n)),(je(o)&&!a&&!je(r)||!je(o)&&!l&&je(r))&&(t=!0),h&&(t=!(o=r=s=null)),o&&(t=t||this.checkInvalidValue(o)),t=r?t||this.checkInvalidValue(r):t)&&(a&&!h&&(o=i.toLocaleDateString()),l&&!h&&(r=n.toLocaleDateString()),je(o)||je(r)?je(o)?je(r)||(s=r):s=o:s=o+" "+this.separator+" "+r,this.invalidValueString=s,this.setProperties({value:null},!0),this.setProperties({startValue:null},!0),this.setProperties({endValue:null},!0),this.startDate=null,this.endDate=null)},$9.prototype.getstringvalue=function(e){var t=null;return je(e)||"number"!=typeof e?je(e)||"string"!=typeof e||(t=""+e):t=e.toString(),t},$9.prototype.checkInvalidValue=function(e){var t,i=!1,n={format:this.formatString,type:"date",skeleton:"yMd"};return i="string"==typeof e&&(t=new Ti(this.locale),this.checkDateValue(t.parseDate(e,n))||(t=/^\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(e)||t.test(e))&&!/^[a-zA-Z0-9- ]*$/.test(e)&&!isNaN(+new Date(this.checkValue(e)))))?i:!0},$9.prototype.isDateDisabled=function(e){if(je(e))return!1;e=new Date(+e);if(+e<+this.min||+e>+this.max)return!0;this.virtualRenderCellArgs={date:e,isDisabled:!1};e=this.virtualRenderCellArgs;return this.virtualRenderCellEvent(e),!!e.isDisabled},$9.prototype.disabledDateRender=function(){this.disabledDays=[],this.disabledDayCnt=null;for(var e=new Date(+this.startValue),t=0;+e<=+this.endValue&&+this.endValue<=+this.max;){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},$9.prototype.virtualRenderCellEvent=function(e){Pe(this.virtualRenderCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},$9.prototype.disabledDates=function(){var e=!1,t=!1;return je(this.endValue)||je(this.startValue)||(e=this.isDateDisabled(this.startValue),t=this.isDateDisabled(this.endValue),this.isPopupOpen()||(this.currentDate=null),this.setValue()),e||t},$9.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&&0<this.value.length||this.valueType&&0<this.valueType.length?(+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()},$9.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e.dispatchEvent(i),this.firstHiddenChild.dispatchEvent(i)},$9.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)},$9.prototype.navigateTo=function(e,t){if(this.isPopupOpen()){if("month"===e.toLowerCase())e="Month";else if("year"===e.toLowerCase())e="Year";else{if("decade"!==e.toLowerCase())return;e="Decade"}this.getViewNumber(e)<this.getViewNumber(this.depth)&&(e=this.depth),this.isMobile?J9.prototype.navigateTo.call(this,e,t):(t<this.min?t=new Date(+this.min):t>=this.max&&(t=new Date(+this.max)),"Month"===e&&this.isSameMonth(t,this.max)?t=new Date(this.max.getFullYear(),this.max.getMonth()-1,this.min.getDate()):"Year"===e&&this.isSameYear(t,this.max)?t=new Date(this.max.getFullYear()-1,this.max.getMonth(),this.max.getDate()):"Decade"===e&&this.isSameDecade(t,this.max)&&(t=new Date(this.max.getFullYear()-10,this.max.getMonth(),this.max.getDate())),this.leftCalCurrentDate=t,this.navigate(this.leftCalendar,this.leftCalCurrentDate,e),t="Month"===e?new Date(this.currentDate.setMonth(this.currentDate.getMonth()+1)):"Year"===e?new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+1)):new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+10)),this.rightCalCurrentDate=t,this.navigate(this.rightCalendar,this.rightCalCurrentDate,e),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])}},$9.prototype.navigate=function(e,t,i){this.calendarElement=e,this.table=e.querySelector("table"),this.tableBodyElement=e.querySelector("tbody"),this.headerTitleElement=e.querySelector(".e-title"),this.tableHeadElement=e.querySelector("thead"),this.contentElement=e.querySelector(".e-content"),this.previousIcon=e.querySelector(".e-prev"),this.nextIcon=e.querySelector(".e-next"),this.effect="e-zoomin",J9.prototype.navigateTo.call(this,i,t)},$9.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&(U([this.inputWrapper.container],[b9]),this.inputElement.focus())},$9.prototype.focusOut=function(){var e=this.preventBlur;document.activeElement===this.inputElement&&(q([this.inputWrapper.container],[b9]),this.preventBlur=!1,this.inputElement.blur(),this.preventBlur=e)},$9.prototype.destroy=function(){this.unBindEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.hide(null);var e={tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off","aria-invalid":"false",spellcheck:"false"};this.inputElement&&(q([this.inputElement],[u9]),E.remove(this.inputElement,"blur",this.inputBlurHandler),HF.removeAttributes(e,this.inputElement),je(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.inputElement.classList.remove("e-input"),je(this.inputWrapper)||(E.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),G(this.inputWrapper.container))),je(this.inputKeyboardModule)||this.isMobile||this.inputKeyboardModule.destroy(),this.popupObj&&!this.isMobile&&this.clearCalendarEvents(),HF.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),J9.prototype.destroy.call(this),this.inputWrapper=this.popupWrapper=this.popupObj=this.cloneElement=this.presetElement=null,this.formElement&&E.remove(this.formElement,"reset",this.formResetHandler),je(this.firstHiddenChild)||je(this.secondHiddenChild)||(G(this.firstHiddenChild),G(this.secondHiddenChild),this.firstHiddenChild=this.secondHiddenChild=null,this.inputElement.setAttribute("name",this.element.getAttribute("data-name")),this.inputElement.removeAttribute("data-name")),this.closeEventArgs=null,this.leftCalendar=null,this.rightTitle=null,this.leftTitle=null,this.openEventArgs=null,this.leftCalNextIcon=null,this.rightCalendar=null,this.closeEventArgs=null,this.rightCalPrevIcon=null,this.leftCalPrevIcon=null,this.popupKeyboardModule=null,this.cancelButton=null,this.applyButton=null,this.calendarElement=null,this.leftKeyboardModule=null,this.rightCalNextIcon=null,this.leftCalNextIcon=null,this.btnKeyboardModule=null,this.rightKeyboardModule=null,this.leftKeyboardModule=null,this.presetKeyboardModule=null,this.liCollections=null,this.popupObj=null,this.popupWrapper=null},$9.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(t=0;t<e.length;t++)je(this.cloneElement.getAttribute(e[t]))?("value"===e[t].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[t])):("value"===e[t].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[t])),this.inputElement.setAttribute(e[t],this.cloneElement.getAttribute(e[t])))},$9.prototype.getModuleName=function(){return"daterangepicker"},$9.prototype.getPersistData=function(){return this.addOnPersist(["startDate","endDate","value"])},$9.prototype.getSelectedRange=function(){var e;return je(this.startValue)||je(this.endValue)?e=0:(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,!je(this.renderDayCellArgs)&&this.renderDayCellArgs.isDisabled&&this.disabledDateRender(),je(this.disabledDayCnt)||(e-=this.disabledDayCnt,this.disabledDayCnt=null)),{startDate:this.startValue,endDate:this.endValue,daySpan:e}},$9.prototype.show=function(t,i){var e,n=this;this.isMobile&&this.popupObj&&this.popupObj.refreshPosition(),this.enabled&&this.readonly||!this.enabled||this.popupObj||this.isPopupOpen()||(t&&(this.targetElement=t),this.createPopup(),(this.isMobile||F.isDevice)&&(this.mobileRangePopupWrap=this.createElement("div",{className:"e-daterangepick-mob-popup-wrap"}),document.body.appendChild(this.mobileRangePopupWrap)),this.openEventArgs={popup:this.popupObj||null,cancel:!1,date:this.inputElement.value,model:this,event:i||null,appendTo:this.isMobile||F.isDevice?this.mobileRangePopupWrap:document.body},e=this.openEventArgs,this.trigger("open",e,function(e){n.openEventArgs=e,n.openEventArgs.cancel||(n.openEventArgs.appendTo.appendChild(n.popupWrapper),n.showPopup(t,i),e=!n.isCustomRange||n.isMobile&&n.isCustomRange,!ee(n.presets[0].start&&n.presets[0].end&&n.presets[0].label)&&e&&n.setScrollPosition(),n.checkMinMaxDays(),n.isMobile&&!je(n.startDate)&&je(n.endDate)&&(n.endButton.element.classList.add(m9),n.startButton.element.classList.remove(m9),n.endButton.element.removeAttribute("disabled"),n.selectableDates()),J9.prototype.setOverlayIndex.call(n,n.mobileRangePopupWrap,n.popupObj.element,n.modal,n.isMobile||F.isDevice),F.isDevice&&((e=n.createElement("div",{className:"e-dlg-overlay"})).style.zIndex=(n.zIndex-1).toString(),n.mobileRangePopupWrap.appendChild(e)))}))},$9.prototype.hide=function(e){var t=this;this.popupObj?(je(this.previousEndValue)&&je(this.previousStartValue)?this.clearRange():(je(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))),je(this.previousEndValue)?this.endValue=null:this.endValue=new Date(this.checkValue(this.previousEndValue)),this.setValue()),this.isPopupOpen()&&(this.closeEventArgs={cancel:!1,popup:this.popupObj,date:this.inputElement.value,model:this,event:e||null},e=this.closeEventArgs,this.trigger("close",e,function(e){t.closeEventArgs=e,t.closeEventArgs.cancel?q([t.inputWrapper.buttons[0]],m9):(!t.isMobile||je(t.startButton)||je(t.endButton)||(E.remove(t.startButton.element,"click touchstart",t.deviceHeaderClick),E.remove(t.endButton.element,"click touchstart",t.deviceHeaderClick)),t.popupObj&&(t.popupObj.hide(),t.preventBlur)&&(t.inputElement.focus(),U([t.inputWrapper.container],[b9])),t.isMobile||(je(t.leftKeyboardModule)||je(t.rightKeyboardModule)||(t.leftKeyboardModule.destroy(),t.rightKeyboardModule.destroy()),je(t.presetElement)||t.presetKeyboardModule.destroy(),je(t.cancelButton))||t.btnKeyboardModule.destroy(),t.targetElement=null,q([document.body],U9),E.remove(document,"mousedown touchstart",t.documentHandler),t.isMobile&&t.modal&&(t.modal.style.display="none",t.modal.outerHTML="",t.modal=null),!t.isMobile&&!F.isDevice||je(t.mobileRangePopupWrap)||(t.mobileRangePopupWrap.remove(),t.mobileRangePopupWrap=null),t.isKeyPopup=t.dateDisabled=!1),t.updateClearIconState(),t.updateHiddenInput(),t.isMobile&&t.allowEdit&&!t.readonly&&t.inputElement.removeAttribute("readonly")}))):(this.updateClearIconState(),this.updateHiddenInput(),this.isMobile&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"))},$9.prototype.setLocale=function(){this.globalize=new Ti(this.locale),this.l10n.setLocale(this.locale),this.dateRangeOptions&&null==this.dateRangeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),HF.setPlaceholder(this.placeholder,this.inputElement)),this.updateInput(),this.updateHiddenInput(),this.changeTrigger()},$9.prototype.refreshChange=function(){this.checkView(),this.refreshControl(),this.changeTrigger()},$9.prototype.setDate=function(){HF.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.refreshChange()},$9.prototype.enableInput=function(){+this.min<=+this.max&&(this.setProperties({enabled:!0},!0),HF.setEnabled(this.enabled,this.inputElement),this.element.hasAttribute("disabled"))&&this.bindEvents()},$9.prototype.clearModelvalue=function(e,t){this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),t.value&&0<t.value.length?this.setProperties({value:null},!0):(t.value&&t.value.start||t.value&&!t.value.start)&&this.setProperties({value:{start:null,end:null}},!0),this.updateValue(),this.setDate()},$9.prototype.createHiddenInput=function(){je(this.firstHiddenChild)&&je(this.secondHiddenChild)&&(this.firstHiddenChild=this.createElement("input"),this.secondHiddenChild=this.createElement("input")),je(this.inputElement.getAttribute("name"))||(this.inputElement.setAttribute("data-name",this.inputElement.getAttribute("name")),this.inputElement.removeAttribute("name")),pt(this.firstHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:G9}),pt(this.secondHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:G9});var e={format:this.formatString,type:"datetime",skeleton:"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)},$9.prototype.setMinMaxDays=function(){this.isPopupOpen()&&(this.removeClassDisabled(),this.checkMinMaxDays(),this.isMobile&&this.selectableDates(),!this.strictMode&&je(this.startValue)&&je(this.endValue)?this.removeSelection():this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader())},$9.prototype.getAmPmValue=function(e){try{return"string"==typeof e&&""!==e.trim()?e.replace(/(am|pm|Am|aM|pM|Pm)/g,function(e){return e.toLocaleUpperCase()}):""}catch(e){return console.error("Error occurred while processing date:",e),""}},$9.prototype.getStartEndValue=function(e,t){return"Month"===this.depth?this.checkDateValue(new Date(this.checkValue(e))):"Year"===this.depth?new Date(e.getFullYear(),e.getMonth()+(t?1:0),t?0:1):new Date(e.getFullYear(),t?11:0,t?31:1)},$9.prototype.onPropertyChanged=function(e,t){for(var i={format:this.formatString,type:"date",skeleton:"yMd"},n=!1,o=0,r=Object.keys(e);o<r.length;o++){var s=r[o];switch(0<["blur","change","cleared","close","created","destroyed","focus","navigated","open","renderDayCell","select"].indexOf(s)&&this.isReact&&(n=!0),s){case"width":this.setEleWidth(this.width),HF.calculateWidth(this.inputElement,this.inputWrapper.container),je(this.inputWrapper.buttons[0])||je(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"separator":this.previousEleValue=this.inputElement.value,this.setProperties({separator:e.separator},!0),this.updateInput(),this.changeTrigger();break;case"placeholder":HF.setPlaceholder(e.placeholder,this.inputElement),this.setProperties({placeholder:e.placeholder},!0);break;case"readonly":HF.setReadonly(this.readonly,this.inputElement),this.setRangeAllowEdit();break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass);break;case"enabled":this.setProperties({enabled:e.enabled},!0),HF.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),HF.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 Ti(this.locale),this.l10n.setLocale(this.locale),this.dateRangeOptions&&null==this.dateRangeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),HF.setPlaceholder(this.placeholder,this.inputElement)),this.setLocale();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.setDataAttribute(!0),this.checkHtmlAttributes(!0);break;case"showClearButton":HF.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"startDate":"string"==typeof e.startDate&&(e.startDate=this.globalize.parseDate(this.getAmPmValue(e.startDate),i)),+this.initStartDate!=+e.startDate&&(this.startValue=this.getStartEndValue(e.startDate,!1),this.setDate(),this.setValue());break;case"endDate":"string"==typeof e.endDate&&(e.endDate=this.globalize.parseDate(this.getAmPmValue(e.endDate),i)),+this.initEndDate!=+e.endDate&&(this.endValue=this.getStartEndValue(e.endDate,!0),this.setDate(),this.setValue());break;case"value":var a,n=!0;if(this.invalidValueString=null,this.checkInvalidRange(e.value),"string"==typeof e.value?this.invalidValueString?this.clearModelvalue(e,t):(a=e.value.split(" "+this.separator+" "),this.value=[new Date(a[0]),new Date(a[1])],this.updateValue(),this.setDate()):!je(e.value)&&0<e.value.length||!je(e.value)&&e.value.start?(this.valueType=e.value,null===e.value[0]||null===e.value.start?1!==e.value.length&&!e.value.start&&null!==e.value[1]&&null!==e.value.start||this.clearModelvalue(e,t):+this.initStartDate==+e.value[0]&&+this.initEndDate==+e.value[1]&&+this.initStartDate==+(e.value.start||+this.initEndDate!=+e.value.start)||(1!==e.value.length&&!e.value.start||(this.modelValue=e.value),this.updateValue(),this.setDate())):!je(this.value)&&null!=e.value.start||(this.valueType=e.value,this.startValue=null,this.endValue=null,this.clearModelvalue(e,t)),this.isPopupOpen()){if(je(this.startValue)&&je(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},n=!0),this.refreshChange(),this.setMinMaxDays();break;case"maxDays":this.setProperties({maxDays:e.maxDays},n=!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,HF.removeFloating(this.inputWrapper),HF.addFloating(this.inputElement,this.floatLabelType,this.placeholder),je(this.inputWrapper.buttons[0])||je(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"start":this.setProperties({start:e.start},!0),this.refreshChange();break;case"depth":this.setProperties({depth:e.depth},!0),this.refreshChange()}n||this.hide(null)}},l9([e(null)],$9.prototype,"value",void 0),l9([e(!1)],$9.prototype,"enablePersistence",void 0),l9([e(new Date(1900,0,1))],$9.prototype,"min",void 0),l9([e(new Date(2099,11,31))],$9.prototype,"max",void 0),l9([e(null)],$9.prototype,"locale",void 0),l9([e(null)],$9.prototype,"firstDayOfWeek",void 0),l9([e(!1)],$9.prototype,"weekNumber",void 0),l9([e("Gregorian")],$9.prototype,"calendarMode",void 0),l9([e(!1)],$9.prototype,"openOnFocus",void 0),l9([e(!1)],$9.prototype,"fullScreenMode",void 0),l9([i()],$9.prototype,"created",void 0),l9([i()],$9.prototype,"destroyed",void 0),l9([i()],$9.prototype,"change",void 0),l9([i()],$9.prototype,"cleared",void 0),l9([i()],$9.prototype,"navigated",void 0),l9([i()],$9.prototype,"renderDayCell",void 0),l9([e(null)],$9.prototype,"startDate",void 0),l9([e(null)],$9.prototype,"endDate",void 0),l9([kt([{}],X9)],$9.prototype,"presets",void 0),l9([e("")],$9.prototype,"width",void 0),l9([e(1e3)],$9.prototype,"zIndex",void 0),l9([e(!0)],$9.prototype,"showClearButton",void 0),l9([e(!0)],$9.prototype,"showTodayButton",void 0),l9([e("Month")],$9.prototype,"start",void 0),l9([e("Month")],$9.prototype,"depth",void 0),l9([e("")],$9.prototype,"cssClass",void 0),l9([e("-")],$9.prototype,"separator",void 0),l9([e(null)],$9.prototype,"minDays",void 0),l9([e(null)],$9.prototype,"maxDays",void 0),l9([e(!1)],$9.prototype,"strictMode",void 0),l9([e(null)],$9.prototype,"keyConfigs",void 0),l9([e(null)],$9.prototype,"format",void 0),l9([e(!0)],$9.prototype,"enabled",void 0),l9([e(!1)],$9.prototype,"readonly",void 0),l9([e(!0)],$9.prototype,"allowEdit",void 0),l9([e("Never")],$9.prototype,"floatLabelType",void 0),l9([e(null)],$9.prototype,"placeholder",void 0),l9([e({})],$9.prototype,"htmlAttributes",void 0),l9([i()],$9.prototype,"open",void 0),l9([i()],$9.prototype,"close",void 0),l9([i()],$9.prototype,"select",void 0),l9([i()],$9.prototype,"focus",void 0),l9([i()],$9.prototype,"blur",void 0);var J9,Z9=l9([Bt],$9);function $9(e,t){t=J9.call(this,e,t)||this;return t.isCustomRange=!1,t.isCustomWindow=!1,t.presetsItem=[],t.liCollections=[],t.previousEleValue="",t.isKeyPopup=!1,t.dateDisabled=!1,t.isRangeIconClicked=!1,t.isMaxDaysClicked=!1,t.disabledDays=[],t.preventBlur=!1,t.preventFocus=!1,t.invalidValueString=null,t.preventChange=!1,t.dateRangeOptions=e,t}eq=function(e,t){return(eq=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])}))(e,t)};var eq,tq,iq,f7=function(e,t){function i(){this.constructor=e}eq(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},l9=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},nq="e-error",oq=(new Date).getDate(),rq=(new Date).getMonth(),sq=(new Date).getFullYear(),aq="e-timepicker",lq="e-active",hq="e-hover",dq="e-navigation",pq="e-disabled",cq="e-input-focus",uq="e-list-item",gq="e-time-overflow",mq="e-non-edit",fq=["title","class","style"],yq=((tq||(tq={})).createListItems=function(e,t,i,n,o,r){this.calendarMode;for(var s=6e4*r,a=[],l=[],h=+t.setMilliseconds(0),d=+i.setMilliseconds(0);h<=d;)l.push(h),a.push(n.formatDate(new Date(h),{format:o,type:"time"})),h+=s;return{collection:l,list:X_.createList(e,a,null,!0)}},f7(vq,iq=n),l9([e("day")],vq.prototype,"day",void 0),l9([e("month")],vq.prototype,"month",void 0),l9([e("year")],vq.prototype,"year",void 0),l9([e("day of the week")],vq.prototype,"dayOfTheWeek",void 0),l9([e("hour")],vq.prototype,"hour",void 0),l9([e("minute")],vq.prototype,"minute",void 0),l9([e("second")],vq.prototype,"second",void 0),vq);function vq(){return null!==iq&&iq.apply(this,arguments)||this}f7(Cq,bq=Ji),Cq.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),q([this.cloneElement],[aq,"e-control","e-lib"]),this.inputElement=this.element,this.angularTag=null,this.formElement=z(this.element,"form"),"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}},Cq.prototype.render=function(){this.initialize(),this.createInputElement(),this.updateHtmlAttributeToWrapper(),this.setTimeAllowEdit(),this.setEnable(),this.validateInterval(),this.bindEvents(),this.validateDisable(),this.setTimeZone(),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.inputEleValue=this.getDateObject(this.inputElement.value),je(this.inputWrapper.buttons[0])||je(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),!je(z(this.element,"fieldset"))&&z(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete()},Cq.prototype.setTimeZone=function(){var e;!je(this.serverTimezoneOffset)&&this.value&&(e=(new Date).getTimezoneOffset()/60,e=this.serverTimezoneOffset+e,e=this.isDayLightSaving()?e--:e,this.value=new Date(this.value.getTime()+60*e*60*1e3))},Cq.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)},Cq.prototype.setTimeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):pt(this.inputElement,{readonly:""}),this.clearIconState()},Cq.prototype.clearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&q([this.inputWrapper.container],[mq]):(""===this.inputElement.value?q:U)([this.inputWrapper.container],[mq])},Cq.prototype.validateDisable=function(){this.setMinMax(this.initMin,this.initMax),je(this.value)||(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))},Cq.prototype.validationAttribute=function(e,t){for(var i,n=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id"),o=(t.setAttribute("name",n),e.removeAttribute("name"),["required","aria-required","form"]),r=0;r<o.length;r++)je(e.getAttribute(o[r]))||(i=e.getAttribute(o[r]),t.setAttribute(o[r],i),e.removeAttribute(o[r]))},Cq.prototype.initialize=function(){this.globalize=new Ti(this.locale),this.defaultCulture=new Ti("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 Cn("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,je(this.element.getAttribute("id"))?(this.element.id=D("ej2_timepicker"),null!==this.angularTag&&pt(this.inputElement,{id:this.element.id+"_input"})):null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"),je(this.inputElement.getAttribute("name"))&&pt(this.inputElement,{name:this.element.id}),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})},Cq.prototype.checkTimeFormat=function(){var e;this.format?"string"==typeof this.format?this.formatString=this.format:je(this.format.skeleton)||""===this.format.skeleton?this.formatString=this.globalize.getDatePattern({type:"time",skeleton:"short"}):(e=this.format.skeleton,this.formatString=this.globalize.getDatePattern({type:"time",skeleton:e})):this.formatString=null},Cq.prototype.checkDateValue=function(e){return!je(e)&&e instanceof Date&&!isNaN(+e)?e:null},Cq.prototype.createInputElement=function(){this.fullScreenMode&&F.isDevice&&(this.cssClass+=" e-popup-expand");var e=this.cssClass,t=!this.enableMask;je(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=HF.createInput({element:this.inputElement,bindClearAction:t,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),pt(this.inputElement,{"aria-autocomplete":"list",tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-disabled":"false","aria-invalid":"false"}),this.isNullOrEmpty(this.inputStyle)||HF.addAttributes({style:this.inputStyle},this.inputElement),U([this.inputWrapper.container],"e-time-wrapper")},Cq.prototype.getCldrDateTimeFormat=function(){var e=new Ti(this.locale).getDatePattern({skeleton:"yMd"}),e=this.isNullOrEmpty(this.formatString)?e+" "+this.cldrFormat("time"):this.formatString;return e},Cq.prototype.checkInvalidValue=function(e){var t,i,n,o=!1;"object"==typeof e||je(e)||("string"==typeof(t=e)&&(t=t.trim()),n=i=null,"number"==typeof e?t=e.toString():"string"!=typeof e||/^[a-zA-Z0-9- ]*$/.test(e)||je(i=this.setCurrentDate(this.getDateObject(e)))&&je(i=this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(t),{format:this.getCldrDateTimeFormat(),type:"datetime"})))&&(i=this.checkDateValue(this.globalize.parseDate(this.getAmPmValue(t),{format:this.formatString,type:"dateTime",skeleton:"yMd"}))),i=!je(n=this.globalize.parseDate(this.getAmPmValue(t),{format:this.getCldrDateTimeFormat(),type:"datetime"}))&&n instanceof Date&&!isNaN(+n)?n:null,je(i)&&t.replace(/\s/g,"").length&&(n=/^\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(t)&&!n.test(t)||/^[a-zA-Z0-9- ]*$/.test(e)||isNaN(+new Date(""+t))?o=!0:i=new Date(""+t)),o?(this.strictMode||(this.invalidValueString=t),this.setProperties({value:null},!0),this.initValue=null):(this.setProperties({value:i},!0),this.initValue=this.value))},Cq.prototype.requiredModules=function(){var e=[];return this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},Cq.prototype.getAmPmValue=function(e){try{return"string"==typeof e&&""!==e.trim()?e.replace(/(am|pm|Am|aM|pM|Pm)/g,function(e){return e.toLocaleUpperCase()}):""}catch(e){return console.error("Error occurred while processing date:",e),""}},Cq.prototype.cldrFormat=function(e){var t="en"===this.locale||"en-US"===this.locale?R("timeFormats.short",Pi()):this.getCultureTimeObject(Ai,""+this.locale);return t},Cq.prototype.destroy=function(){this.hide(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.unBindEvents();this.inputElement&&(HF.removeAttributes({"aria-autocomplete":"list",tabindex:"0","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-disabled":"true","aria-invalid":"false"},this.inputElement),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),je(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"),je(this.cloneElement.getAttribute("disabled")))&&HF.setEnabled(!0,this.inputElement,this.floatLabelType),this.inputWrapper.container&&G(this.inputWrapper.container),this.inputWrapper=this.popupWrapper=this.cloneElement=void 0,this.liCollections=this.timeCollections=this.disableItemCollection=[],je(this.rippleFn)||this.rippleFn(),HF.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),bq.prototype.destroy.call(this),this.formElement&&E.remove(this.formElement,"reset",this.formResetHandler),this.rippleFn=null,this.openPopupEventArgs=null,this.selectedElement=null,this.listTag=null,this.liCollections=null},Cq.prototype.ensureInputAttribute=function(){for(var e=[],t=0;t<this.inputElement.attributes.length;t++)e[t]=this.inputElement.attributes[t].name;for(t=0;t<e.length;t++)je(this.cloneElement.getAttribute(e[t]))?(this.inputElement.removeAttribute(e[t]),"value"===e[t].toLowerCase()&&(this.inputElement.value="")):(this.inputElement.setAttribute(e[t],this.cloneElement.getAttribute(e[t])),"value"===e[t].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[t])))},Cq.prototype.popupCreation=function(){this.popupWrapper=this.createElement("div",{className:aq+" e-popup",attrs:{id:this.element.id+"_popup"}}),this.popupWrapper.style.visibility="hidden",this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),je(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),!je(this.step)&&0<this.step&&(this.generateList(),ht([this.listWrapper],this.popupWrapper)),this.addSelection(),this.renderPopup(),G(this.popupWrapper)},Cq.prototype.getPopupHeight=function(){var e=parseInt("240px",10),t=this.popupWrapper.getBoundingClientRect().height;return e<t?e:t},Cq.prototype.generateList=function(){this.createListItems(),this.wireListEvents(),this.rippleFn=Ht(this.listWrapper,{duration:300,selector:"."+uq}),this.liCollections=this.listWrapper.querySelectorAll("."+uq)},Cq.prototype.renderPopup=function(){var e,t,i,n=this;this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),this.popupObj=new Sv(this.popupWrapper,{width:this.setPopupWidth(this.width),zIndex:this.zIndex,targetType:"relative",position:F.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},collision:F.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},enableRtl:this.enableRtl,relateTo:F.isDevice?document.body:this.inputWrapper.container,offsetY:4,open:function(){n.popupWrapper.style.visibility="visible",U([n.inputWrapper.buttons[0]],lq)},close:function(){q([n.inputWrapper.buttons[0]],lq),n.unWireListEvents(),n.inputElement.removeAttribute("aria-activedescendant"),ue(n.popupObj.element),n.popupObj.destroy(),n.popupWrapper.innerHTML="",n.listWrapper=n.popupWrapper=n.listTag=void 0},targetExitViewport:function(){F.isDevice||n.hide()}}),F.isDevice||(this.popupObj.collision={X:"none",Y:"flip"}),F.isDevice&&this.fullScreenMode?(this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%"):this.popupObj.element.style.maxHeight="240px",F.isDevice&&this.fullScreenMode&&(e=this.createElement("div",{className:"e-model-header"}),(t=this.createElement("span",{className:"e-model-title"})).textContent="Select time",i=this.createElement("span",{className:"e-popup-close"}),E.add(i,"mousedown touchstart",this.timePopupCloseHandler,this),e.appendChild(i),e.appendChild(t),this.popupWrapper.insertBefore(e,this.popupWrapper.firstElementChild))},Cq.prototype.timePopupCloseHandler=function(e){this.hide()},Cq.prototype.getFormattedValue=function(e){return je(this.checkDateValue(e))?null:this.globalize.formatDate(e,{skeleton:"medium",type:"time"})},Cq.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var t,i,e=this.createDateObj(e),n=!this.isNullOrEmpty(this.initValue);if(this.checkDateValue(e))return t=n?this.initValue.getDate():oq,i=n?this.initValue.getMonth():rq,n=n?this.initValue.getFullYear():sq,new Date(n,i,t,e.getHours(),e.getMinutes(),e.getSeconds())}return null},Cq.prototype.updateHtmlAttributeToWrapper=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i,n=t[e];-1<fq.indexOf(n)&&("class"===n?""!==(i=this.htmlAttributes[""+n].replace(/\s+/g," ").trim())&&U([this.inputWrapper.container],i.split(" ")):"style"===n?(i=je(i=this.inputWrapper.container.getAttribute(n))?this.htmlAttributes[""+n]:i+this.htmlAttributes[""+n],this.inputWrapper.container.setAttribute(n,i)):this.inputWrapper.container.setAttribute(n,this.htmlAttributes[""+n]))}},Cq.prototype.updateHtmlAttributeToElement=function(){if(!je(this.htmlAttributes))for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];fq.indexOf(i)<0&&this.inputElement.setAttribute(i,this.htmlAttributes[""+i])}},Cq.prototype.updateCssClass=function(e,t){je(t)||(t=t.replace(/\s+/g," ").trim()),je(e)||(e=e.replace(/\s+/g," ").trim()),HF.setCssClass(e,[this.inputWrapper.container],t),this.popupWrapper&&HF.setCssClass(e,[this.popupWrapper],t)},Cq.prototype.removeErrorClass=function(){q([this.inputWrapper.container],nq),pt(this.inputElement,{"aria-invalid":"false"})},Cq.prototype.checkErrorState=function(e){e=this.getDateObject(e);this.validateState(e)&&!this.invalidValueString||this.enableMask&&this.inputElement.value===this.maskedDateValue?this.removeErrorClass():(U([this.inputWrapper.container],nq),pt(this.inputElement,{"aria-invalid":"true"}))},Cq.prototype.validateInterval=function(){!je(this.step)&&0<this.step?this.enableElement([this.inputWrapper.buttons[0]]):this.disableTimeIcon()},Cq.prototype.disableTimeIcon=function(){this.disableElement([this.inputWrapper.buttons[0]]),this.hide()},Cq.prototype.disableElement=function(e){U(e,pq)},Cq.prototype.enableElement=function(e){q(e,pq)},Cq.prototype.selectInputText=function(){this.inputElement.setSelectionRange(0,this.inputElement.value.length)},Cq.prototype.setCursorToEnd=function(){this.inputElement.setSelectionRange(this.inputElement.value.length,this.inputElement.value.length)},Cq.prototype.getMeridianText=function(){return"en"===this.locale||"en-US"===this.locale?R("dayPeriods.format.wide",Pi()):R("main."+this.locale+".dates.calendars.gregorian.dayPeriods.format.abbreviated",Ai)},Cq.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)}},Cq.prototype.getActiveElement=function(){return je(this.popupWrapper)?null:this.popupWrapper.querySelectorAll("."+lq)},Cq.prototype.isNullOrEmpty=function(e){return!!(je(e)||"string"==typeof e&&""===e.trim())},Cq.prototype.setWidth=function(e){return e="number"==typeof e?T(e):"string"==typeof e?e.match(/px|%|em/)?e:T(e):"100%"},Cq.prototype.setPopupWidth=function(e){return e=-1<(e=this.setWidth(e)).indexOf("%")?(this.containerStyle.width*parseFloat(e)/100).toString()+"px":e},Cq.prototype.setScrollPosition=function(){var e=this.selectedElement;je(e)?this.popupWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},Cq.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),i=e.nextElementSibling,n=(i||e).offsetTop,o=e.getBoundingClientRect().height;n+e.offsetTop>t?this.popupWrapper.scrollTop=i?n-(t/2+o/2):n:this.popupWrapper.scrollTop=0},Cq.prototype.setScrollTo=function(){var e,t,i;je(this.popupWrapper)?this.popupWrapper.scrollTop=0:(e=this.popupWrapper.querySelectorAll("."+uq)).length&&(t=this.timeCollections[0],i=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime(),i=e[Math.round((i-t)/(6e4*this.step))]),je(i)?this.popupWrapper.scrollTop=0:this.findScrollTop(i)},Cq.prototype.getText=function(){return je(this.checkDateValue(this.value))?"":this.getValue(this.value)},Cq.prototype.getValue=function(e){return je(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},Cq.prototype.cldrDateFormat=function(){var e="en"===this.locale||"en-US"===this.locale?R("dateFormats.short",Pi()):this.getCultureDateObject(Ai,""+this.locale);return e},Cq.prototype.cldrTimeFormat=function(){var e=this.isNullOrEmpty(this.formatString)?"en"===this.locale||"en-US"===this.locale?R("timeFormats.short",Pi()):this.getCultureTimeObject(Ai,""+this.locale):this.formatString;return e},Cq.prototype.dateToNumeric=function(){var e="en"===this.locale||"en-US"===this.locale?R("timeFormats.medium",Pi()):R("main."+this.locale+".dates.calendars.gregorian.timeFormats.medium",Ai);return e},Cq.prototype.getExactDateTime=function(e){return je(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.dateToNumeric(),type:"time"})},Cq.prototype.setValue=function(e){e=this.checkValue(e);this.strictMode||this.validateState(e)?this.isNullOrEmpty(e)?(this.initValue=null,this.validateMinMax(this.value,this.min,this.max)):this.initValue=this.compareFormatChange(e):(null===this.checkDateValue(this.valueWithMinutes)&&(this.initValue=this.valueWithMinutes=null),this.validateMinMax(this.value,this.min,this.max)),this.updateInput(!0,this.initValue)},Cq.prototype.compareFormatChange=function(e){return je(e)?null:e!==this.getText()?this.getDateObject(e):this.getDateObject(this.value)},Cq.prototype.updatePlaceHolder=function(){HF.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)},Cq.prototype.updateInputValue=function(e){HF.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},Cq.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnTimeIconClick")},Cq.prototype.popupHandler=function(e){this.enabled&&(F.isDevice&&this.inputElement.setAttribute("readonly",""),e.preventDefault(),this.isPopupOpen()?this.closePopup(0,e):(this.inputElement.focus(),this.show(e)))},Cq.prototype.mouseDownHandler=function(){!this.enabled||this.readonly||(this.inputElement.setSelectionRange(0,0),E.add(this.inputElement,"mouseup",this.mouseUpHandler,this))},Cq.prototype.mouseUpHandler=function(e){this.readonly||(e.preventDefault(),this.enableMask?(e.preventDefault(),this.notify("setMaskSelection",{module:"MaskedDateTime"})):(E.remove(this.inputElement,"mouseup",this.mouseUpHandler),0===(e=this.getCursorSelection()).start&&e.end===this.inputElement.value.length||(0<this.inputElement.value.length&&(this.cursorDetails=this.focusSelection()),this.inputElement.setSelectionRange(this.cursorDetails.start,this.cursorDetails.end))))},Cq.prototype.focusSelection=function(){var e=new RegExp("^[a-zA-Z0-9]+$"),t=this.inputElement.value.split(""),i=(t.push(" "),this.getCursorSelection()),n=0,o=0,r=!1;if(this.isTextSelected)n=i.start,o=i.end,this.isTextSelected=!1;else for(var s=0;s<t.length;s++)if(e.test(t[s])||(o=s,r=!0),r){if(i.start>=n&&i.end<=o){this.isTextSelected=!0;break}n=s+1,r=!1}return{start:n,end:o}},Cq.prototype.inputHandler=function(e){if(!this.readonly&&this.enabled)switch("right"!==e.action&&"left"!==e.action&&"tab"!==e.action&&("home"!==e.action&&"end"!==e.action&&"up"!==e.action&&"down"!==e.action||this.isPopupOpen()||this.enableMask)&&e.preventDefault(),e.action){case"home":case"end":case"up":case"down":this.isPopupOpen()||(this.popupCreation(),this.popupObj.destroy(),this.popupObj=this.popupWrapper=null),!this.enableMask||this.readonly||this.isPopupOpen()||(e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e})),this.isPopupOpen()&&this.keyHandler(e);break;case"enter":this.isNavigate?(this.selectedElement=this.liCollections[this.activeIndex],this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),this.updateValue(this.valueWithMinutes,e)):this.updateValue(this.inputElement.value,e),this.hide(),this.isNavigate=!1,this.isPopupOpen()&&e.stopPropagation();break;case"open":this.show(e);break;case"escape":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!==this.inputElement.value.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}},Cq.prototype.onMouseClick=function(e){var t=e.target,t=this.selectedElement=z(t,"."+uq);this.setSelection(t,e),t&&t.classList.contains(uq)&&this.hide()},Cq.prototype.closePopup=function(t,e){var i=this;this.isPopupOpen()&&this.popupWrapper?(e={popup:this.popupObj,event:e||null,cancel:!1,name:"open"},q([document.body],gq),this.trigger("close",e,function(e){e.cancel||(i.popupObj.hide(new Vt({name:"FadeOut",duration:50,delay:t||0})),q([i.inputWrapper.container],["e-icon-anim"]),pt(i.inputElement,{"aria-expanded":"false"}),i.inputElement.removeAttribute("aria-owns"),i.inputElement.removeAttribute("aria-controls"),i.inputElement.removeAttribute("aria-activedescendant"),E.remove(document,"mousedown touchstart",i.documentClickHandler)),F.isDevice&&i.modal&&(i.modal.style.display="none",i.modal.outerHTML="",i.modal=null),F.isDevice&&!je(i.mobileTimePopupWrap)&&(i.mobileTimePopupWrap.remove(),i.mobileTimePopupWrap=null),F.isDevice&&i.allowEdit&&!i.readonly&&i.inputElement.removeAttribute("readonly")})):F.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},Cq.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")},Cq.prototype.checkValueChange=function(e,t){var i;this.strictMode||this.validateState(this.valueWithMinutes)?t?(i=this.getDateObject(new Date(this.timeCollections[this.activeIndex])),+this.prevDate!=+i&&this.valueProcess(e,i)):(i=this.compareFormatChange(this.inputElement.value),+this.prevDate==+i&&!je(this.checkDateValue(this.value))||this.valueProcess(e,i)):(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))},Cq.prototype.onMouseOver=function(e){e=z(e.target,"."+uq);this.setHover(e,hq)},Cq.prototype.setHover=function(e,t){this.enabled&&this.isValidLI(e)&&!e.classList.contains(t)&&(this.removeHover(t),U([e],t),t===dq)&&e.setAttribute("aria-selected","true")},Cq.prototype.setSelection=function(e,t){this.isValidLI(e)&&(this.checkValue(e.getAttribute("data-value")),this.enableMask&&this.createMask(),this.selectedElement=e,this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),U([this.selectedElement],lq),this.selectedElement.setAttribute("aria-selected","true"),this.checkValueChange(t,!0))},Cq.prototype.onMouseLeave=function(){this.removeHover(hq)},Cq.prototype.scrollHandler=function(){"timepicker"===this.getModuleName()&&F.isDevice||this.hide()},Cq.prototype.setMinMax=function(e,t){je(this.checkDateValue(e))&&(this.initMin=this.getDateObject("12:00:00 AM")),je(this.checkDateValue(t))&&(this.initMax=this.getDateObject("11:59:59 PM"))},Cq.prototype.validateMinMax=function(e,t,i){var n=e instanceof Date?e:this.getDateObject(e);return je(this.checkDateValue(n))?+this.createDateObj(this.getFormattedValue(this.initMin))>+this.createDateObj(this.getFormattedValue(this.initMax))&&this.disableTimeIcon():e=this.strictOperation(this.initMin,this.initMax,e,n),this.strictMode&&(e=this.valueIsDisable(e)?e:null),this.checkErrorState(e),e},Cq.prototype.valueIsDisable=function(e){if(!je(this.disableItemCollection)&&0<this.disableItemCollection.length){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},Cq.prototype.validateState=function(e){if(!this.strictMode){if(!this.valueIsDisable(e))return!1;var e=this.setCurrentDate(this.getDateObject(e)),t=this.setCurrentDate(this.getDateObject(this.initMax)),i=this.setCurrentDate(this.getDateObject(this.initMin));if(je(this.checkDateValue(e))){if(+t<+i||""!==this.inputElement.value)return!1}else if(+t<+e||+e<+i)return!1}return!0},Cq.prototype.strictOperation=function(e,t,i,n){t=this.createDateObj(this.getFormattedValue(t)),e=this.createDateObj(this.getFormattedValue(e)),n=this.createDateObj(this.getFormattedValue(n));if(this.strictMode){if(+t<+e)return this.disableTimeIcon(),this.initValue=this.getDateObject(t),this.updateInputValue(this.getValue(this.initValue)),this.enableMask&&this.createMask(),this.inputElement.value;if(+n<=+e)return this.getDateObject(e);if(+t<=+n||+e==+t)return this.getDateObject(t)}else if(+t<+e&&(this.disableTimeIcon(),!isNaN(+this.createDateObj(i))));return i},Cq.prototype.bindEvents=function(){E.add(this.inputWrapper.buttons[0],"mousedown",this.popupHandler,this),E.add(this.inputElement,"blur",this.inputBlurHandler,this),E.add(this.inputElement,"focus",this.inputFocusHandler,this),E.add(this.inputElement,"change",this.inputChangeHandler,this),E.add(this.inputElement,"input",this.inputEventHandler,this),this.enableMask&&(E.add(this.inputElement,"keydown",this.keydownHandler,this),E.add(this.inputElement,"keyup",this.keyupHandler,this)),this.showClearButton&&this.inputWrapper.clearButton&&E.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this),this.formElement&&E.add(this.formElement,"reset",this.formResetHandler,this),F.isDevice||(this.keyConfigure=Pe(this.keyConfigure,this.keyConfigs),this.inputEvent=new bn(this.inputWrapper.container,{keyAction:this.inputHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.showClearButton&&this.inputElement&&E.add(this.inputElement,"mousedown",this.mouseDownHandler,this))},Cq.prototype.keydownHandler=function(e){"Delete"!==e.code||!this.enableMask||this.popupObj||this.readonly||this.notify("keyDownHandler",{module:"MaskedDateTime",e:e})},Cq.prototype.keyupHandler=function(e){("Backspace"===e.code||"Delete"===e.code)&&this.enableMask&&this.showClearButton&&this.inputElement&&this.inputElement.value===this.maskedDateValue&&this.inputWrapper&&this.inputWrapper.clearButton&&!this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.inputWrapper.clearButton.classList.add("e-clear-icon-hide")},Cq.prototype.formResetHandler=function(){var e,t;this.enabled&&!this.inputElement.disabled&&(e=this.inputElement.getAttribute("value"),t=this.checkDateValue(this.inputEleValue),"EJS-TIMEPICKER"===this.element.tagName&&(t=null,this.inputElement.setAttribute("value",e="")),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.checkErrorState(e),this.prevValue=this.inputElement.value)},Cq.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},Cq.prototype.inputEventHandler=function(){this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},Cq.prototype.unBindEvents=function(){this.inputWrapper&&E.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.popupHandler),E.remove(this.inputElement,"blur",this.inputBlurHandler),E.remove(this.inputElement,"focus",this.inputFocusHandler),E.remove(this.inputElement,"change",this.inputChangeHandler),E.remove(this.inputElement,"input",this.inputEventHandler),this.enableMask&&E.remove(this.inputElement,"keyup",this.keyupHandler),this.inputEvent&&this.inputEvent.destroy(),E.remove(this.inputElement,"mousedown touchstart",this.mouseDownHandler),!this.showClearButton||je(this.inputWrapper)||je(this.inputWrapper.clearButton)||E.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.clearHandler),this.formElement&&E.remove(this.formElement,"reset",this.formResetHandler)},Cq.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&E.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this)},Cq.prototype.raiseClearedEvent=function(e){this.trigger("cleared",{event:e})},Cq.prototype.clearHandler=function(e){var t;this.enabled&&(e.preventDefault(),je(this.value)?(this.resetState(),this.raiseClearedEvent(e)):this.clear(e),this.popupWrapper&&(this.popupWrapper.scrollTop=0),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}),z(this.element,"form"))&&(e=this.element,(t=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(t))},Cq.prototype.clear=function(e){this.setProperties({value:null},!0),this.initValue=null,this.resetState(),this.raiseClearedEvent(e),this.changeEvent(e)},Cq.prototype.setZIndex=function(){this.popupObj&&(this.popupObj.zIndex=this.zIndex,this.popupObj.dataBind())},Cq.prototype.checkAttributes=function(e){for(var t,i=0,n=e?je(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["step","disabled","readonly","style","name","value","min","max","placeholder"];i<n.length;i++){var o,r=n[i];if(!je(this.inputElement.getAttribute(r)))switch(r){case"disabled":(je(this.timeOptions)||void 0===this.timeOptions.enabled||e)&&(o="disabled"!==this.inputElement.getAttribute(r)&&""!==this.inputElement.getAttribute(r)&&"true"!==this.inputElement.getAttribute(r),this.setProperties({enabled:o},!e));break;case"style":this.inputStyle=this.inputElement.getAttribute(r);break;case"readonly":(je(this.timeOptions)||void 0===this.timeOptions.readonly||e)&&(o="readonly"===this.inputElement.getAttribute(r)||""===this.inputElement.getAttribute(r)||"true"===this.inputElement.getAttribute(r),this.setProperties({readonly:o},!e));break;case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(r));break;case"step":this.step=parseInt(this.inputElement.getAttribute(r),10);break;case"placeholder":(je(this.timeOptions)||void 0===this.timeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(r)},!e);break;case"min":(je(this.timeOptions)||void 0===this.timeOptions.min||e)&&(t=new Date(this.inputElement.getAttribute(r)),je(this.checkDateValue(t))||this.setProperties({min:t},!e));break;case"max":(je(this.timeOptions)||void 0===this.timeOptions.max||e)&&(t=new Date(this.inputElement.getAttribute(r)),je(this.checkDateValue(t))||this.setProperties({max:t},!e));break;case"value":(je(this.timeOptions)||void 0===this.timeOptions.value||e)&&(t=new Date(this.inputElement.getAttribute(r)),je(this.checkDateValue(t))||(this.initValue=t,this.updateInput(!1,this.initValue),this.setProperties({value:t},!e)))}}},Cq.prototype.setCurrentDate=function(e){return je(this.checkDateValue(e))?null:new Date(sq,rq,oq,e.getHours(),e.getMinutes(),e.getSeconds())},Cq.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(0<=t[i].toLowerCase().indexOf("h")){e=i;break}return e},Cq.prototype.updateValue=function(e,t){var i,n;this.isNullOrEmpty(e)?this.resetState():(n=this.checkValue(e),this.strictMode&&(i=null===n&&0<e.trim().length?this.previousState(this.prevDate):this.inputElement.value,this.updateInputValue(i),this.enableMask)&&(i||this.updateInputValue(this.maskedDateValue),je(n)&&e!==this.maskedDateValue&&this.createMask(),je(n))&&e===this.maskedDateValue&&this.updateInputValue(this.maskedDateValue)),this.checkValueChange(t,"string"!=typeof e)},Cq.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.getValue(e)},Cq.prototype.resetState=function(){this.removeSelection(),HF.setValue("",this.inputElement,this.floatLabelType,!1),this.valueWithMinutes=this.activeIndex=null,this.strictMode||this.checkErrorState(null)},Cq.prototype.objToString=function(e){return je(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},Cq.prototype.checkValue=function(e){var t;return this.isNullOrEmpty(e)?(this.resetState(),this.valueWithMinutes=null):(t=e instanceof Date?e:this.getDateObject(e),this.validateValue(t,e))},Cq.prototype.validateValue=function(e,t){var i=this.validateMinMax(t,this.min,this.max),n=this.getDateObject(i),n=(this.getFormattedValue(n)!==this.getFormattedValue(this.value)?this.valueWithMinutes=je(n)?null:n:(this.strictMode&&(e=n),this.valueWithMinutes=this.checkDateValue(e)),this.objToString(this.valueWithMinutes));return!this.strictMode&&je(n)?(e=0<i.trim().length?i:"",this.updateInputValue(e),this.enableMask&&!e&&this.updateInputValue(this.maskedDateValue)):(this.updateInputValue(n),this.enableMask&&(""===n&&this.updateInputValue(this.maskedDateValue),je(n)&&t!==this.maskedDateValue&&this.createMask(),je(n))&&t===this.maskedDateValue&&this.updateInputValue(this.maskedDateValue)),n},Cq.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},Cq.prototype.findNextElement=function(e){var t=this.inputElement.value,i=je(this.valueWithMinutes)?this.createDateObj(t):this.getDateObject(this.valueWithMinutes),n=null,o=this.liCollections.length,t=this.timeCollections;if(je(this.checkDateValue(i))&&je(this.activeIndex))this.selectNextItem(e);else{if("home"===e.action){var r=this.validLiElement(0),n=+this.createDateObj(new Date(this.timeCollections[r]));this.activeIndex=r}else if("end"===e.action){r=this.validLiElement(t.length-1,!0);n=+this.createDateObj(new Date(this.timeCollections[r])),this.activeIndex=r}else if("down"===e.action)for(var s=0;s<o;s++){if(+i<this.timeCollections[s]){r=this.validLiElement(s);n=+this.createDateObj(new Date(this.timeCollections[r])),this.activeIndex=r;break}if(s===o-1){r=this.validLiElement(0);n=+this.createDateObj(new Date(this.timeCollections[r])),this.activeIndex=r;break}}else for(s=o-1;0<=s;s--){if(+i>this.timeCollections[s]){r=this.validLiElement(s,!0);n=+this.createDateObj(new Date(this.timeCollections[r])),this.activeIndex=r;break}if(0===s){r=this.validLiElement(o-1);n=+this.createDateObj(new Date(this.timeCollections[r])),this.activeIndex=r;break}}this.selectedElement=this.liCollections[this.activeIndex],this.elementValue(je(n)?null:new Date(n))}},Cq.prototype.selectNextItem=function(e){e=this.validLiElement(0,"down"!==e.action);this.activeIndex=e,this.selectedElement=this.liCollections[e],this.elementValue(new Date(this.timeCollections[e]))},Cq.prototype.elementValue=function(e){je(this.checkDateValue(e))||this.checkValue(e)},Cq.prototype.validLiElement=function(e,t){var i=null,n=je(this.popupWrapper)?this.liCollections:this.popupWrapper.querySelectorAll("."+uq),o=!0;if(n.length)if(t)for(var r=e;0<=r;r--){if(!n[r].classList.contains(pq)){i=r;break}0===r&&o&&(e=r=n.length,o=!1)}else for(r=e;r<=n.length-1;r++){if(!n[r].classList.contains(pq)){i=r;break}r===n.length-1&&(o=o&&!(e=r=-1))}return i},Cq.prototype.keyHandler=function(e){var t,i,n;je(this.step)||this.step<=0||!je(this.inputWrapper)&&this.inputWrapper.buttons[0].classList.contains(pq)||(t=this.timeCollections.length,je(this.getActiveElement())||0===this.getActiveElement().length?0<this.liCollections.length&&je(this.value)&&je(this.activeIndex)?(n=this.validLiElement(0,"down"!==e.action),this.activeIndex=n,this.selectedElement=this.liCollections[n],this.elementValue(new Date(this.timeCollections[n]))):this.findNextElement(e):(i=void 0,37<=e.keyCode&&e.keyCode<=40?(n=40===e.keyCode||39===e.keyCode?++this.activeIndex:--this.activeIndex,this.activeIndex=n=this.activeIndex===t?0:this.activeIndex,this.activeIndex=n=this.activeIndex<0?t-1:this.activeIndex,this.activeIndex=n=this.validLiElement(this.activeIndex,40!==e.keyCode&&39!==e.keyCode),i=je(this.timeCollections[n])?this.timeCollections[0]:this.timeCollections[n]):"home"===e.action?(n=this.validLiElement(0),this.activeIndex=n,i=this.timeCollections[n]):"end"===e.action&&(n=this.validLiElement(t-1,!0),this.activeIndex=n,i=this.timeCollections[n]),this.selectedElement=this.liCollections[this.activeIndex],this.elementValue(new Date(i))),this.isNavigate=!0,this.setHover(this.selectedElement,dq),this.setActiveDescendant(),this.enableMask&&this.selectInputText(),!this.isPopupOpen())||null===this.selectedElement||e&&"click"===e.type||this.setScrollPosition()},Cq.prototype.getCultureTimeObject=function(e,t){return R("main."+t+".dates.calendars.gregorian.timeFormats.short",e)},Cq.prototype.getCultureDateObject=function(e,t){return R("main."+t+".dates.calendars.gregorian.dateFormats.short",e)},Cq.prototype.wireListEvents=function(){E.add(this.listWrapper,"click",this.onMouseClick,this),F.isDevice||(E.add(this.listWrapper,"mouseover",this.onMouseOver,this),E.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},Cq.prototype.unWireListEvents=function(){this.listWrapper&&(E.remove(this.listWrapper,"click",this.onMouseClick),F.isDevice||(E.remove(this.listWrapper,"mouseover",this.onMouseOver),E.remove(this.listWrapper,"mouseout",this.onMouseLeave)))},Cq.prototype.valueProcess=function(e,t){t=je(this.checkDateValue(t))?null:t;+this.prevDate!=+t&&(this.initValue=t,this.changeEvent(e))},Cq.prototype.changeEvent=function(e){this.addSelection(),this.updateInput(!0,this.initValue);e={event:e||null,value:this.value,text:this.inputElement.value,isInteracted:!je(e),element:this.element};e.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",e),this.invalidValueString=null,this.checkErrorState(this.value)},Cq.prototype.updateInput=function(e,t){e&&(this.prevValue=this.getValue(this.prevDate)),"number"==typeof(this.prevDate=this.valueWithMinutes=t)&&(this.value&&+new Date(+this.value).setMilliseconds(0))===+t||(this.setProperties({value:t},!0),this.enableMask&&this.value&&this.createMask()),!this.strictMode&&je(this.value)&&this.invalidValueString&&(this.checkErrorState(this.invalidValueString),this.updateInputValue(this.invalidValueString)),this.clearIconState()},Cq.prototype.setActiveDescendant=function(){!je(this.selectedElement)&&this.value?pt(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},Cq.prototype.removeSelection=function(){var e;this.removeHover(hq),je(this.popupWrapper)||(e=this.popupWrapper.querySelectorAll("."+lq)).length&&(q(e,lq),e[0].removeAttribute("aria-selected"))},Cq.prototype.removeHover=function(e){var t=this.getHoverItem(e);t&&t.length&&(q(t,e),e===dq)&&t[0].removeAttribute("aria-selected")},Cq.prototype.getHoverItem=function(e){var t;return t=je(this.popupWrapper)?t:this.popupWrapper.querySelectorAll("."+e)},Cq.prototype.setActiveClass=function(){if(!je(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll("."+uq);if(e.length)for(var t=0;t<e.length;t++)if(this.timeCollections[t]===+this.getDateObject(this.valueWithMinutes)){e[t].setAttribute("aria-selected","true"),this.selectedElement=e[t],this.activeIndex=t;break}}},Cq.prototype.addSelection=function(){this.selectedElement=null,this.removeSelection(),this.setActiveClass(),je(this.selectedElement)||(U([this.selectedElement],lq),this.selectedElement.setAttribute("aria-selected","true"))},Cq.prototype.isValidLI=function(e){return e&&e.classList.contains(uq)&&!e.classList.contains(pq)},Cq.prototype.createDateObj=function(e){var t=this.globalize.formatDate(new Date,{format:null,skeleton:"short",type:"date"}),i=null;return"string"==typeof e?(-1<e.toUpperCase().indexOf("AM")||-1<e.toUpperCase().indexOf("PM"))&&(t=this.defaultCulture.formatDate(new Date,{format:null,skeleton:"short",type:"date"}),!je(i=isNaN(+new Date(t+" "+e))?null:new Date(new Date(t+" "+e).setMilliseconds(0))))||(i=this.timeParse(t,e)):e instanceof Date&&(i=e),i},Cq.prototype.timeParse=function(e,t){var i=this.globalize.parseDate(this.getAmPmValue(e+" "+t),{format:this.cldrDateFormat()+" "+this.cldrTimeFormat(),type:"datetime"});return i=je(i)?this.globalize.parseDate(this.getAmPmValue(e+" "+t),{format:this.cldrDateFormat()+" "+this.dateToNumeric(),type:"datetime"}):i,i=je(i)?i:new Date(i.setMilliseconds(0))},Cq.prototype.createListItems=function(){for(var e,t=this,i=(this.listWrapper=this.createElement("div",{className:"e-content",attrs:{tabindex:"-1"}}),6e4*this.step),n=[],o=(this.timeCollections=[],this.disableItemCollection=[],e=+this.getDateObject(this.initMin).setMilliseconds(0),+this.getDateObject(this.initMax).setMilliseconds(0));e<=o;)this.timeCollections.push(e),n.push(this.globalize.formatDate(new Date(e),{format:this.cldrTimeFormat(),type:"time"})),e+=i;this.listTag=X_.createList(this.createElement,n,{itemCreated:function(e){e={element:e.item,text:e.text,value:t.getDateObject(e.text),isDisabled:!1};t.trigger("itemRender",e,function(e){e.isDisabled&&e.element.classList.add(pq),e.element.classList.contains(pq)&&t.disableItemCollection.push(e.element.getAttribute("data-value"))})}},!0),pt(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options",tabindex:"0"}),ht([this.listTag],this.listWrapper)},Cq.prototype.documentClickHandler=function(e){var t=e.target;je(this.popupObj)||je(this.inputWrapper)||!(this.inputWrapper.container.contains(t)&&"mousedown"!==e.type||this.popupObj.element&&this.popupObj.element.contains(t))||"touchstart"===e.type||e.preventDefault(),z(t,'[id="'+this.popupObj.element.id+'"]')||t===this.inputElement||t===(this.inputWrapper&&this.inputWrapper.buttons[0])||t===(this.inputWrapper&&this.inputWrapper.clearButton)||t===(this.inputWrapper&&this.inputWrapper.container)||t.classList.contains("e-dlg-overlay")?t===this.inputElement||F.isDevice||(this.isPreventBlur=(F.isIE||"edge"===F.info.name)&&document.activeElement===this.inputElement&&t===this.popupWrapper):this.isPopupOpen()&&(this.hide(),this.focusOut())},Cq.prototype.setEnableRtl=function(){HF.setEnableRtl(this.enableRtl,[this.inputWrapper.container]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},Cq.prototype.setEnable=function(){HF.setEnabled(this.enabled,this.inputElement,this.floatLabelType),this.enabled?(q([this.inputWrapper.container],pq),pt(this.inputElement,{"aria-disabled":"false"}),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.hide(),U([this.inputWrapper.container],pq),pt(this.inputElement,{"aria-disabled":"true"}),this.inputElement.tabIndex=-1)},Cq.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)},Cq.prototype.inputBlurHandler=function(e){this.enabled&&(this.isPreventBlur&&this.isPopupOpen()?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("")),q([this.inputWrapper.container],[cq]),this.getText()!==this.inputElement.value?this.updateValue(this.inputElement.value,e):0===this.inputElement.value.trim().length&&this.resetState(),this.cursorDetails=null,this.isNavigate=!1,""===this.inputElement.value&&(this.invalidValueString=null),this.trigger("blur",{model:this})))},Cq.prototype.focusOut=function(){document.activeElement===this.inputElement&&(this.inputElement.blur(),q([this.inputWrapper.container],[cq]),this.trigger("blur",{model:this}))},Cq.prototype.isPopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(aq))},Cq.prototype.inputFocusHandler=function(){var e;this.enabled&&(e={model:this},this.readonly||F.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.enableMask&&this.showClearButton&&this.inputElement&&this.inputElement.value===this.maskedDateValue&&this.inputWrapper&&this.inputWrapper.clearButton&&!this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.inputWrapper.clearButton.classList.add("e-clear-icon-hide"),this.trigger("focus",e),this.clearIconState(),this.openOnFocus)&&this.show()},Cq.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},Cq.prototype.hide=function(){this.closePopup(100,null),this.clearIconState()},Cq.prototype.show=function(e){var t=this;this.enabled&&this.readonly||!this.enabled||this.popupWrapper||(this.popupCreation(),F.isDevice&&this.listWrapper&&(this.modal=this.createElement("div"),this.modal.className=aq+" e-time-modal",document.body.className+=" "+gq,document.body.appendChild(this.modal)),F.isDevice&&(this.mobileTimePopupWrap=this.createElement("div",{className:"e-timepicker-mob-popup-wrap"}),document.body.appendChild(this.mobileTimePopupWrap)),this.openPopupEventArgs={popup:this.popupObj||null,cancel:!1,event:e||null,name:"open",appendTo:F.isDevice?this.mobileTimePopupWrap:document.body},e=this.openPopupEventArgs,this.trigger("open",e,function(e){t.openPopupEventArgs=e,t.openPopupEventArgs.cancel||t.inputWrapper.buttons[0].classList.contains(pq)?(t.popupObj.destroy(),t.popupWrapper=t.listTag=void 0,t.liCollections=t.timeCollections=t.disableItemCollection=[],t.popupObj=null):(t.openPopupEventArgs.appendTo.appendChild(t.popupWrapper),t.popupAlignment(t.openPopupEventArgs),t.setScrollPosition(),F.isDevice||t.inputElement.focus(),e={name:"FadeIn",duration:50},t.popupObj.refreshPosition(t.anchor),1e3===t.zIndex?t.popupObj.show(new Vt(e),t.element):t.popupObj.show(new Vt(e),null),t.setActiveDescendant(),pt(t.inputElement,{"aria-expanded":"true"}),pt(t.inputElement,{"aria-owns":t.inputElement.id+"_options"}),pt(t.inputElement,{"aria-controls":t.inputElement.id}),U([t.inputWrapper.container],cq),E.add(document,"mousedown touchstart",t.documentClickHandler,t),t.setOverlayIndex(t.mobileTimePopupWrap,t.popupObj.element,t.modal,F.isDevice),F.isDevice&&((e=t.createElement("div",{className:"e-dlg-overlay"})).style.zIndex=(t.zIndex-1).toString(),t.mobileTimePopupWrap.appendChild(e)))}))},Cq.prototype.setOverlayIndex=function(e,t,i,n){!n||je(t)||je(i)||je(e)||(n=parseInt(t.style.zIndex,10)?parseInt(t.style.zIndex,10):1e3,i.style.zIndex=(n-1).toString(),e.style.zIndex=n.toString())},Cq.prototype.formatValues=function(e){var t;return"number"==typeof e?t=T(e):"string"==typeof e&&(t=e.match(/px|%|em/)||isNaN(parseInt(e,10))?e:T(e)),t},Cq.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)),F.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")}},Cq.prototype.getPersistData=function(){return this.addOnPersist(["value"])},Cq.prototype.getModuleName=function(){return"timepicker"},Cq.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];switch(o){case"placeholder":HF.setPlaceholder(e.placeholder,this.inputElement);break;case"readonly":HF.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.setProperties({enableRtl:e.enableRtl},!0),this.setEnableRtl();break;case"cssClass":this.updateCssClass(e.cssClass,t.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.getProperty(e,o);break;case"showClearButton":HF.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"locale":this.setProperties({locale:e.locale},!0),this.globalize=new Ti(this.locale),this.l10n.setLocale(this.locale),this.timeOptions&&null==this.timeOptions.placeholder&&this.updatePlaceHolder(),this.setValue(this.value),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"width":gt(this.inputWrapper.container,{width:this.setWidth(e.width)}),this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),HF.calculateWidth(this.inputElement,this.inputWrapper.container),je(this.inputWrapper.buttons[0])||je(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"format":this.setProperties({format:e.format},!0),this.checkTimeFormat(),this.setValue(this.value),this.enableMask&&(this.createMask(),this.value||this.updateInputValue(this.maskedDateValue));break;case"value":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.enableMask&&je(e.value)&&(this.updateInputValue(this.maskedDateValue),this.checkErrorState(this.maskedDateValue)),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,HF.removeFloating(this.inputWrapper),HF.addFloating(this.inputElement,this.floatLabelType,this.placeholder),je(this.inputWrapper.buttons[0])||je(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"strictMode":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.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("")}}},Cq.prototype.checkInValue=function(e){return e instanceof Date?e.toUTCString():""+e},l9([e(null)],Cq.prototype,"width",void 0),l9([e(null)],Cq.prototype,"cssClass",void 0),l9([e(!1)],Cq.prototype,"strictMode",void 0),l9([e(null)],Cq.prototype,"keyConfigs",void 0),l9([e(null)],Cq.prototype,"format",void 0),l9([e(!0)],Cq.prototype,"enabled",void 0),l9([e(!1)],Cq.prototype,"fullScreenMode",void 0),l9([e(!1)],Cq.prototype,"readonly",void 0),l9([e({})],Cq.prototype,"htmlAttributes",void 0),l9([e("Never")],Cq.prototype,"floatLabelType",void 0),l9([e(null)],Cq.prototype,"placeholder",void 0),l9([e(1e3)],Cq.prototype,"zIndex",void 0),l9([e(!1)],Cq.prototype,"enablePersistence",void 0),l9([e(!0)],Cq.prototype,"showClearButton",void 0),l9([e(30)],Cq.prototype,"step",void 0),l9([e(null)],Cq.prototype,"scrollTo",void 0),l9([e(null)],Cq.prototype,"value",void 0),l9([e(null)],Cq.prototype,"min",void 0),l9([e(null)],Cq.prototype,"max",void 0),l9([e(!0)],Cq.prototype,"allowEdit",void 0),l9([e(!1)],Cq.prototype,"openOnFocus",void 0),l9([e(!1)],Cq.prototype,"enableMask",void 0),l9([e({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],Cq.prototype,"maskPlaceholder",void 0),l9([e(null)],Cq.prototype,"serverTimezoneOffset",void 0),l9([i()],Cq.prototype,"change",void 0),l9([i()],Cq.prototype,"created",void 0),l9([i()],Cq.prototype,"destroyed",void 0),l9([i()],Cq.prototype,"open",void 0),l9([i()],Cq.prototype,"itemRender",void 0),l9([i()],Cq.prototype,"close",void 0),l9([i()],Cq.prototype,"cleared",void 0),l9([i()],Cq.prototype,"blur",void 0),l9([i()],Cq.prototype,"focus",void 0);var bq,wq=l9([Bt],Cq);function Cq(e,t){t=bq.call(this,e,t)||this;return t.liCollections=[],t.timeCollections=[],t.disableItemCollection=[],t.invalidValueString=null,t.preventChange=!1,t.maskedDateValue="",t.moduleName=t.getModuleName(),t.timeOptions=e,t}Sq=function(e,t){return(Sq=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])}))(e,t)};var Sq,Aq,f7=function(e,t){function i(){this.constructor=e}Sq(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},l9=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},xq=(new Date).getDate(),Iq=(new Date).getMonth(),Tq=(new Date).getFullYear(),Eq=(new Date).getHours(),Dq=(new Date).getMinutes(),Mq=(new Date).getSeconds(),kq=(new Date).getMilliseconds(),Pq="e-datetimepicker",Bq="e-datetimepopup-wrapper",Fq="e-popup",Lq="e-input-focus",Rq="e-icon-anim",Oq="e-disabled",Nq="e-error",Vq="e-active",_q="e-hover",Hq="e-list-item",zq="e-time-overflow",jq=(f7(Wq,Aq=o9),Wq.prototype.focusHandler=function(){this.enabled&&U([this.inputWrapper.container],Lq)},Wq.prototype.focusIn=function(){Aq.prototype.focusIn.call(this)},Wq.prototype.focusOut=function(){document.activeElement===this.inputElement&&(this.inputElement.blur(),q([this.inputWrapper.container],[Lq]))},Wq.prototype.blurHandler=function(e){var t;this.enabled&&(this.isTimePopupOpen()&&this.isPreventBlur?this.inputElement.focus():(q([this.inputWrapper.container],Lq),t={model:this},this.isTimePopupOpen()&&this.hide(e),this.trigger("blur",t)))},Wq.prototype.destroy=function(){this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),this.popupObject&&this.popupObject.element.classList.contains(Fq)&&(this.popupObject.destroy(),G(this.dateTimeWrapper),this.dateTimeWrapper=void 0,this.liCollections=this.timeCollections=[],je(this.rippleFn)||this.rippleFn());this.inputElement&&HF.removeAttributes({"aria-live":"assertive","aria-atomic":"true","aria-invalid":"false",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-expanded":"false",role:"combobox",autocomplete:"off"},this.inputElement),this.isCalendar()&&(this.popupWrapper&&G(this.popupWrapper),this.popupObject=this.popupWrapper=null,this.keyboardHandler.destroy()),this.unBindInputEvents(),this.liCollections=null,this.rippleFn=null,this.selectedElement=null,this.listTag=null,this.timeIcon=null,this.popupObject=null,this.preventArgs=null,this.keyboardModule=null,HF.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),Aq.prototype.destroy.call(this)},Wq.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,"string"==typeof this.min&&(this.min=this.checkDateValue(new Date(this.min))),"string"==typeof this.max&&(this.max=this.checkDateValue(new Date(this.max))),"string"==typeof this.minTime&&(this.minTime=this.checkDateValue(new Date(this.minTime))),"string"==typeof this.maxTime&&(this.maxTime=this.checkDateValue(new Date(this.maxTime))),!je(z(this.element,"fieldset"))&&z(this.element,"fieldset").disabled&&(this.enabled=!1),Aq.prototype.updateHtmlAttributeToElement.call(this),this.checkAttributes(!1);var e={placeholder:this.placeholder};this.l10n=new Cn("datetimepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),Aq.prototype.render.call(this),this.createInputElement(),Aq.prototype.updateHtmlAttributeToWrapper.call(this),this.bindInputEvents(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}),this.setValue(!0),!this.enableMask||this.value||!this.maskedDateValue||"Always"!==this.floatLabelType&&this.floatLabelType&&this.placeholder||HF.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)),"Never"!==this.floatLabelType&&HF.calculateWidth(this.inputElement,this.inputWrapper.container),je(this.inputWrapper.buttons[0])||je(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-date-time-icon"),this.renderComplete()},Wq.prototype.setValue=function(e){var t;void 0===e&&(e=!1),this.initValue=this.validateMinMaxRange(this.value),!this.strictMode&&this.isDateObject(this.initValue)?(t=this.validateMinMaxRange(this.initValue),HF.setValue(this.getFormattedValue(t),this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({value:t},!0)):je(this.value)&&(this.initValue=null,this.setProperties({value:null},!0)),this.valueWithMinutes=this.value,Aq.prototype.updateInput.call(this,e)},Wq.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},Wq.prototype.checkValidState=function(e){this.isValidState=!0,this.strictMode||(+e>+this.max||+e<+this.min||!this.isValidTime(e))&&(this.isValidState=!1),this.checkErrorState()},Wq.prototype.checkErrorState=function(){(this.isValidState?q:U)([this.inputWrapper.container],Nq),pt(this.inputElement,{"aria-invalid":this.isValidState?"false":"true"})},Wq.prototype.isValidTime=function(e){var t,i,n,o,r;return!(null!=e&&(this.minTime||this.maxTime)&&(r=n=i=t=void 0,o=36e5*e.getHours()+6e4*e.getMinutes()+1e3*e.getSeconds()+e.getMilliseconds(),this.minTime&&(t=36e5*this.minTime.getHours()+6e4*this.minTime.getMinutes()+1e3*this.minTime.getSeconds()+this.minTime.getMilliseconds()),this.maxTime&&(i=36e5*this.maxTime.getHours()+6e4*this.maxTime.getMinutes()+1e3*this.maxTime.getSeconds()+this.maxTime.getMilliseconds()),this.min&&+e.getDate()==+this.min.getDate()&&+e.getMonth()==+this.min.getMonth()&&+e.getFullYear()==+this.min.getFullYear()&&(t=t<(r=36e5*this.min.getHours()+6e4*this.min.getMinutes()+1e3*this.min.getSeconds()+this.min.getMilliseconds())?r:t),this.max&&+e.getDate()==+this.max.getDate()&&+e.getMonth()==+this.max.getMonth()&&+this.max.getFullYear()==+this.max.getFullYear()&&(i=(n=36e5*this.max.getHours()+6e4*this.max.getMinutes()+1e3*this.max.getSeconds()+this.max.getMilliseconds())<i?n:i),this.strictMode?(r=void 0,t&&o<t?(r=new Date(e.getFullYear(),e.getMonth(),e.getDate(),this.minTime.getHours(),this.minTime.getMinutes(),this.minTime.getSeconds(),this.minTime.getMilliseconds()),this.setProperties({value:r},!0),this.changedArgs={value:this.value}):i&&i<o&&(r=new Date(e.getFullYear(),e.getMonth(),e.getDate(),this.maxTime.getHours(),this.maxTime.getMinutes(),this.maxTime.getSeconds(),this.maxTime.getMilliseconds()),this.setProperties({value:r},!0),this.changedArgs={value:this.value}),0):t&&o<t||i&&i<o))},Wq.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},Wq.prototype.disablePopupButton=function(e){e?(U([this.inputWrapper.buttons[0],this.timeIcon],Oq),this.hide()):q([this.inputWrapper.buttons[0],this.timeIcon],Oq)},Wq.prototype.getFormattedValue=function(e){var t;return je(e)?null:(t="Gregorian"===this.calendarMode?{format:this.cldrDateTimeFormat(),type:"dateTime",skeleton:"yMd"}:{format:this.cldrDateTimeFormat(),type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.formatDate(e,t))},Wq.prototype.isDateObject=function(e){return!je(e)&&!isNaN(+e)},Wq.prototype.createInputElement=function(){q([this.inputElement],"e-datepicker"),q([this.inputWrapper.container],"e-date-wrapper"),U([this.inputWrapper.container],"e-datetime-wrapper"),U([this.inputElement],Pq),this.renderTimeIcon()},Wq.prototype.renderTimeIcon=function(){this.timeIcon=HF.appendSpan("e-input-group-icon e-time-icon e-icons",this.inputWrapper.container)},Wq.prototype.bindInputEvents=function(){E.add(this.timeIcon,"mousedown",this.timeHandler,this),E.add(this.inputWrapper.buttons[0],"mousedown",this.dateHandler,this),E.add(this.inputElement,"blur",this.blurHandler,this),E.add(this.inputElement,"focus",this.focusHandler,this),this.defaultKeyConfigs=Pe(this.defaultKeyConfigs,this.keyConfigs),this.keyboardHandler=new bn(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyAction.bind(this),keyConfigs:this.defaultKeyConfigs})},Wq.prototype.unBindInputEvents=function(){E.remove(this.timeIcon,"mousedown touchstart",this.timeHandler),E.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.dateHandler),this.inputElement&&(E.remove(this.inputElement,"blur",this.blurHandler),E.remove(this.inputElement,"focus",this.focusHandler)),this.keyboardHandler&&this.keyboardHandler.destroy()},Wq.prototype.cldrTimeFormat=function(){var e=this.isNullOrEmpty(this.timeFormat)?"en"===this.locale||"en-US"===this.locale?R("timeFormats.short",Pi()):this.getCultureTimeObject(Ai,""+this.locale):this.timeFormat;return e},Wq.prototype.cldrDateTimeFormat=function(){var e=new Ti(this.locale).getDatePattern({skeleton:"yMd"}),e=this.isNullOrEmpty(this.formatString)?e+" "+this.getCldrFormat("time"):this.formatString;return e},Wq.prototype.getCldrFormat=function(e){var t="en"===this.locale||"en-US"===this.locale?R("timeFormats.short",Pi()):this.getCultureTimeObject(Ai,""+this.locale);return t},Wq.prototype.isNullOrEmpty=function(e){return!!(je(e)||"string"==typeof e&&""===e.trim())},Wq.prototype.getCultureTimeObject=function(e,t){return"Gregorian"===this.calendarMode?R("main."+this.locale+".dates.calendars.gregorian.timeFormats.short",e):R("main."+this.locale+".dates.calendars.islamic.timeFormats.short",e)},Wq.prototype.timeHandler=function(e){this.enabled&&(this.isIconClicked=!0,F.isDevice&&this.inputElement.setAttribute("readonly",""),e.currentTarget===this.timeIcon&&e.preventDefault(),this.enabled&&!this.readonly&&(this.isDatePopupOpen()&&Aq.prototype.hide.call(this,e),this.isTimePopupOpen()?this.closePopup(e):(this.inputElement.focus(),this.popupCreation("time",e),U([this.inputWrapper.container],[Lq]))),this.isIconClicked=!1)},Wq.prototype.dateHandler=function(e){this.enabled&&(e.currentTarget===this.inputWrapper.buttons[0]&&e.preventDefault(),this.enabled)&&!this.readonly&&(this.isTimePopupOpen()&&this.closePopup(e),je(this.popupWrapper)||this.popupCreation("date",e))},Wq.prototype.show=function(e,t){this.enabled&&this.readonly||!this.enabled||("time"!==e||this.dateTimeWrapper?this.popupObj||(this.isTimePopupOpen()&&this.hide(t),Aq.prototype.show.call(this),this.popupCreation("date",t)):(this.isDatePopupOpen()&&this.hide(t),this.popupCreation("time",t)))},Wq.prototype.toggle=function(e){this.isDatePopupOpen()?(Aq.prototype.hide.call(this,e),this.show("time",null)):this.isTimePopupOpen()?(this.hide(e),Aq.prototype.show.call(this,null,e),this.popupCreation("date",null)):this.show(null,e)},Wq.prototype.listCreation=function(){var e="Gregorian"===this.calendarMode?(this.cldrDateTimeFormat().replace(this.formatRegex,this.TimePopupFormat()),""===this.dateFormatString&&(this.dateFormatString=this.cldrDateTimeFormat()),this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),{format:this.dateFormatString,type:"datetime"})):this.globalize.parseDate(this.getAmPmValue(this.inputElement.value),{format:this.cldrDateTimeFormat(),type:"datetime",calendar:"islamic"}),e=je(this.value)?""!==this.inputElement.value?e:new Date:this.value,t=(this.valueWithMinutes=e,this.listWrapper=Q("div",{className:"e-content",attrs:{tabindex:"0"}}),this.startTime(e)),e=this.endTime(e),t=tq.createListItems(this.createElement,t,e,this.globalize,this.cldrTimeFormat(),this.step),e=(this.timeCollections=t.collection,this.listTag=t.list,pt(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),ht([t.list],this.listWrapper),this.wireTimeListEvents(),{duration:300,selector:"."+Hq});this.rippleFn=Ht(this.listWrapper,e),this.liCollections=this.listWrapper.querySelectorAll("."+Hq)},Wq.prototype.popupCreation=function(e,t){F.isDevice&&this.element.setAttribute("readonly","readonly"),"date"===e?!this.readonly&&this.popupWrapper&&(U([this.popupWrapper],Bq),pt(this.popupWrapper,{id:this.element.id+"_options"})):this.readonly||((e=Q("div",{className:Pq+" "+Fq,attrs:{id:this.element.id+"_timepopup"}})).style.cssText="visibility: hidden; display: block;",this.dateTimeWrapper=e,je(this.cssClass)||(this.dateTimeWrapper.className+=" "+this.cssClass),!je(this.step)&&0<this.step&&(this.listCreation(),ht([this.listWrapper],this.dateTimeWrapper)),document.body.appendChild(this.dateTimeWrapper),this.addTimeSelection(),this.renderPopup(),this.setTimeScrollPosition(),this.openPopup(t),F.isDevice&&(!F.isDevice||this.fullScreenMode)||this.popupObject.refreshPosition(this.inputElement),F.isDevice&&(this.modelWrapper.style.zIndex=(this.popupObject.zIndex-1).toString(),this.fullScreenMode)&&(this.dateTimeWrapper.style.left="0px"))},Wq.prototype.openPopup=function(e){var t=this,e=(this.preventArgs={cancel:!1,popup:this.popupObject,event:e||null},this.preventArgs);this.trigger("open",e,function(e){t.preventArgs=e,t.preventArgs.cancel||t.readonly||(e={name:"FadeIn",duration:100},1e3===t.zIndex?t.popupObject.show(new Vt(e),t.element):t.popupObject.show(new Vt(e),null),U([t.inputWrapper.container],[Rq]),pt(t.inputElement,{"aria-expanded":"true"}),pt(t.inputElement,{"aria-owns":t.inputElement.id+"_options"}),pt(t.inputElement,{"aria-controls":t.inputElement.id}),E.add(document,"mousedown touchstart",t.documentClickHandler,t))})},Wq.prototype.documentClickHandler=function(e){var t=e.target;!je(this.popupObject)&&(this.inputWrapper.container.contains(t)&&"mousedown"!==e.type||this.popupObject.element&&this.popupObject.element.contains(t))&&"touchstart"!==e.type&&e.preventDefault(),z(t,'[id="'+(this.popupObject&&this.popupObject.element.id+'"]'))||t===this.inputElement||t===this.timeIcon||je(this.inputWrapper)||t===this.inputWrapper.container||t.classList.contains("e-dlg-overlay")?t===this.inputElement||F.isDevice||(this.isPreventBlur=document.activeElement===this.inputElement&&(F.isIE||"edge"===F.info.name)&&t===this.popupObject.element):this.isTimePopupOpen()&&(this.hide(e),this.focusOut())},Wq.prototype.isTimePopupOpen=function(){return!(!this.dateTimeWrapper||!this.dateTimeWrapper.classList.contains(Pq))},Wq.prototype.isDatePopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(Bq))},Wq.prototype.renderPopup=function(){var e,t,i,n=this;this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),F.isDevice&&(this.timeModal=Q("div"),this.timeModal.className=Pq+" e-time-modal",document.body.className+=" "+zq,this.timeModal.style.display="block",document.body.appendChild(this.timeModal)),F.isDevice&&(this.modelWrapper=Q("div",{className:"e-datetime-mob-popup-wrap"}),this.modelWrapper.appendChild(this.dateTimeWrapper),(e=Q("div",{className:"e-dlg-overlay"})).style.zIndex=(this.zIndex-1).toString(),this.modelWrapper.appendChild(e),document.body.appendChild(this.modelWrapper));this.popupObject=new Sv(this.dateTimeWrapper,{width:this.setPopupWidth(),zIndex:this.zIndex,targetType:"container",collision:F.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},relateTo:F.isDevice?document.body:this.inputWrapper.container,position:F.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},enableRtl:this.enableRtl,offsetY:4,open:function(){n.dateTimeWrapper.style.visibility="visible",U([n.timeIcon],Vq),F.isDevice||(n.timekeyConfigure=Pe(n.timekeyConfigure,n.keyConfigs),n.inputEvent=new bn(n.inputWrapper.container,{keyAction:n.timeKeyActionHandle.bind(n),keyConfigs:n.timekeyConfigure,eventName:"keydown"}))},close:function(){q([n.timeIcon],Vq),n.unWireTimeListEvents(),n.inputElement.removeAttribute("aria-activedescendant"),ue(n.popupObject.element),n.popupObject.destroy(),n.dateTimeWrapper.innerHTML="",n.modelWrapper&&ue(n.modelWrapper),n.listWrapper=n.dateTimeWrapper=void 0,n.inputEvent&&n.inputEvent.destroy()},targetExitViewport:function(){F.isDevice||n.hide()}}),F.isDevice&&this.fullScreenMode?(this.popupObject.element.style.maxHeight="100%",this.popupObject.element.style.width="100%"):this.popupObject.element.style.maxHeight="250px",F.isDevice&&this.fullScreenMode&&(e=this.createElement("div",{className:"e-model-header"}),(t=this.createElement("span",{className:"e-model-title"})).textContent="Select time",i=this.createElement("span",{className:"e-popup-close"}),E.add(i,"mousedown touchstart",this.dateTimeCloseHandler,this),e.appendChild(i),e.appendChild(t),this.dateTimeWrapper.insertBefore(e,this.dateTimeWrapper.firstElementChild))},Wq.prototype.dateTimeCloseHandler=function(e){this.hide()},Wq.prototype.setDimension=function(e){return"number"==typeof e?e=T(e):"string"!=typeof e&&(e="100%"),e},Wq.prototype.setPopupWidth=function(){var e=this.setDimension(this.width);return e=-1<e.indexOf("%")?(this.containerStyle.width*parseFloat(e)/100).toString()+"px":e},Wq.prototype.wireTimeListEvents=function(){E.add(this.listWrapper,"click",this.onMouseClick,this),F.isDevice||(E.add(this.listWrapper,"mouseover",this.onMouseOver,this),E.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},Wq.prototype.unWireTimeListEvents=function(){this.listWrapper&&(E.remove(this.listWrapper,"click",this.onMouseClick),E.remove(document,"mousedown touchstart",this.documentClickHandler),F.isDevice||(E.add(this.listWrapper,"mouseover",this.onMouseOver,this),E.add(this.listWrapper,"mouseout",this.onMouseLeave,this)))},Wq.prototype.onMouseOver=function(e){e=z(e.target,"."+Hq);this.setTimeHover(e,_q)},Wq.prototype.onMouseLeave=function(){this.removeTimeHover(_q)},Wq.prototype.setTimeHover=function(e,t){this.enabled&&this.isValidLI(e)&&!e.classList.contains(t)&&(this.removeTimeHover(t),U([e],t))},Wq.prototype.getPopupHeight=function(){var e=parseInt("250px",10),t=this.dateTimeWrapper.getBoundingClientRect().height;return(!F.isDevice||!this.fullScreenMode)&&e<t?e:t},Wq.prototype.changeEvent=function(e){Aq.prototype.changeEvent.call(this,e),(this.value&&this.value.valueOf())!==(this.previousDateTime&&+this.previousDateTime.valueOf())&&(this.valueWithMinutes=this.value,this.setInputValue("date"),this.previousDateTime=this.value&&new Date(+this.value))},Wq.prototype.updateValue=function(e){this.setInputValue("time"),+this.previousDateTime!=+this.value&&(this.changedArgs={value:this.value,event:e||null,isInteracted:!je(e),element:this.element},this.addTimeSelection(),this.trigger("change",this.changedArgs),this.previousDateTime=this.previousDate=this.value)},Wq.prototype.setTimeScrollPosition=function(){var e=this.selectedElement;je(e)?this.dateTimeWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},Wq.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),i=e.nextElementSibling,n=(i||e).offsetTop,o=e.getBoundingClientRect().height;n+e.offsetTop>t?F.isDevice&&this.fullScreenMode?this.dateTimeWrapper.querySelector(".e-content").scrollTop=i?n-(t/2+o/2):n:this.dateTimeWrapper.scrollTop=i?n-(t/2+o/2):n:this.dateTimeWrapper.scrollTop=0},Wq.prototype.setScrollTo=function(){var e,t,i=this.dateTimeWrapper.querySelectorAll("."+Hq);0<=i.length?(this.scrollInvoked=!0,e=this.timeCollections[0],t=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime(),t=i[Math.round((t-e)/(6e4*this.step))]):this.dateTimeWrapper.scrollTop=0,je(t)?this.dateTimeWrapper.scrollTop=0:this.findScrollTop(t)},Wq.prototype.setInputValue=function(e){"date"===e?(this.inputElement.value=this.previousElementValue=this.getFormattedValue(this.getFullDateTime()),this.setProperties({value:this.getFullDateTime()},!0)):(e=this.getFormattedValue(new Date(this.timeCollections[this.activeIndex])),HF.setValue(e,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()},Wq.prototype.getFullDateTime=function(){var e=null,e=this.isDateObject(this.valueWithMinutes)?this.combineDateTime(this.valueWithMinutes):this.previousDate;return this.validateMinMaxRange(e)},Wq.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},Wq.prototype.combineDateTime=function(e){var t,i,n,o,r;return this.isDateObject(e)?(t=this.previousDate.getDate(),i=this.previousDate.getMonth(),n=this.previousDate.getFullYear(),o=e.getHours(),r=e.getMinutes(),e=e.getSeconds(),new Date(n,i,t,o,r,e)):this.previousDate},Wq.prototype.onMouseClick=function(e){var t=e.target,t=this.selectedElement=z(t,"."+Hq);t&&t.classList.contains(Hq)&&(this.timeValue=t.getAttribute("data-value"),this.hide(e)),this.setSelection(t,e)},Wq.prototype.setSelection=function(e,t){this.isValidLI(e)&&!e.classList.contains(Vq)&&(this.selectedElement=e,e=Array.prototype.slice.call(this.liCollections).indexOf(e),this.activeIndex=e,this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),U([this.selectedElement],Vq),this.selectedElement.setAttribute("aria-selected","true"),this.updateValue(t))},Wq.prototype.setTimeActiveClass=function(){var e=je(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;if(!je(e)){var t=e.querySelectorAll("."+Hq);if(t.length)for(var i=0;i<t.length;i++)if(this.timeCollections[i]===+this.valueWithMinutes){t[i].setAttribute("aria-selected","true"),this.selectedElement=t[i],this.activeIndex=i,this.setTimeActiveDescendant();break}}},Wq.prototype.setTimeActiveDescendant=function(){!je(this.selectedElement)&&this.value?pt(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")}):this.inputElement.removeAttribute("aria-activedescendant")},Wq.prototype.addTimeSelection=function(){this.selectedElement=null,this.removeTimeSelection(),this.setTimeActiveClass(),je(this.selectedElement)||(U([this.selectedElement],Vq),this.selectedElement.setAttribute("aria-selected","true"))},Wq.prototype.removeTimeSelection=function(){var e;this.removeTimeHover(_q),je(this.dateTimeWrapper)||(e=this.dateTimeWrapper.querySelectorAll("."+Vq)).length&&(q(e,Vq),e[0].removeAttribute("aria-selected"))},Wq.prototype.removeTimeHover=function(e){var t=this.getTimeHoverItem(e);t&&t.length&&q(t,e)},Wq.prototype.getTimeHoverItem=function(e){var t,i=je(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;return t=je(i)?t:i.querySelectorAll("."+e)},Wq.prototype.isValidLI=function(e){return e&&e.classList.contains(Hq)&&!e.classList.contains(Oq)},Wq.prototype.calculateStartEnd=function(e,t,i){var n=e.getDate(),o=e.getMonth(),r=e.getFullYear(),s=e.getHours(),a=e.getMinutes(),l=e.getSeconds(),e=e.getMilliseconds();return t?"starttime"===i?new Date(r,o,n,0,0,0):new Date(r,o,n,23,59,59):new Date(r,o,n,s,a,l,e)},Wq.prototype.startTime=function(e){var t,i,n,o=this.min,r=this.max,e=null===e?new Date:e,s=!1;return this.minTime?(n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),this.minTime.getHours(),this.minTime.getMinutes(),this.minTime.getSeconds(),this.minTime.getMilliseconds()),s=!0):n=e,+n.getDate()==+o.getDate()&&+n.getMonth()==+o.getMonth()&&+n.getFullYear()==+o.getFullYear()||+new Date(n.getFullYear(),n.getMonth(),n.getDate())<=+new Date(o.getFullYear(),o.getMonth(),o.getDate())?(i=!1,t=o,s&&+new Date(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())>=+new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds())&&t.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())):+n<+r&&+o<+n?(i=!s,t=n):+r<=+n&&(i=!0,t=r),this.calculateStartEnd(t,i,"starttime")},Wq.prototype.TimePopupFormat=function(){var t="",i=0,n=this;return function(e){switch(e){case"d":case"dd":case"ddd":case"dddd":case"M":case"MM":case"MMM":case"MMMM":case"y":case"yy":case"yyy":case"yyyy":""===t?t+=e:t=t+"/"+e,i+=1}return 2<i&&(n.dateFormatString=t),t}},Wq.prototype.endTime=function(e){var t,i,n,o=this.max,e=null===e?new Date:e,r=!1;return this.maxTime?(n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),this.maxTime.getHours(),this.maxTime.getMinutes(),this.maxTime.getSeconds(),this.maxTime.getMilliseconds()),r=!0):n=e,+n.getDate()==+o.getDate()&&+n.getMonth()==+o.getMonth()&&+n.getFullYear()==+o.getFullYear()||+new Date(n.getUTCFullYear(),n.getMonth(),n.getDate())>=+new Date(o.getFullYear(),o.getMonth(),o.getDate())?(i=!1,t=this.max,r&&+new Date(n.getUTCFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())<=+new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds())&&t.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())):+n<+this.max&&+n>+this.min?(i=!r,t=n):+n<=+this.min&&(i=!0,t=this.min),this.calculateStartEnd(t,i,"endtime")},Wq.prototype.hide=function(t){var e,i=this;this.popupObj||this.dateTimeWrapper?(this.preventArgs={cancel:!1,popup:this.popupObj||this.popupObject,event:t||null},e=this.preventArgs,je(this.popupObj)?this.trigger("close",e,function(e){i.dateTimeCloseEventCallback(t,e)}):this.dateTimeCloseEventCallback(t,e)):(F.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit())},Wq.prototype.dateTimeCloseEventCallback=function(e,t){this.preventArgs=t,this.preventArgs.cancel||(this.isDatePopupOpen()?Aq.prototype.hide.call(this,e):this.isTimePopupOpen()&&(this.closePopup(e),q([document.body],zq),F.isDevice&&this.timeModal&&(this.timeModal.style.display="none",this.timeModal.outerHTML="",this.timeModal=null),this.setTimeActiveDescendant())),F.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},Wq.prototype.closePopup=function(e){this.isTimePopupOpen()&&this.popupObject&&(this.popupObject.hide(new Vt({name:"FadeOut",duration:100,delay:0})),this.inputWrapper.container.classList.remove(Rq),pt(this.inputElement,{"aria-expanded":"false"}),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-controls"),E.remove(document,"mousedown touchstart",this.documentClickHandler))},Wq.prototype.preRender=function(){this.checkFormat(),this.dateTimeFormat=this.cldrDateTimeFormat(),Aq.prototype.preRender.call(this),q([this.inputElementCopy],[Pq])},Wq.prototype.getProperty=function(e,t){"min"===t?this.setProperties({min:this.validateValue(e.min)},!0):this.setProperties({max:this.validateValue(e.max)},!0)},Wq.prototype.checkAttributes=function(e){for(var t,i=0,n=e?je(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["style","name","step","disabled","readonly","value","min","max","placeholder","type"];i<n.length;i++){var o,r=n[i];if(!je(this.inputElement.getAttribute(r)))switch(r){case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(r));break;case"step":this.step=parseInt(this.inputElement.getAttribute(r),10);break;case"readonly":(je(this.dateTimeOptions)||void 0===this.dateTimeOptions.readonly||e)&&(o="disabled"===this.inputElement.getAttribute(r)||""===this.inputElement.getAttribute(r)||"true"===this.inputElement.getAttribute(r),this.setProperties({readonly:o},!e));break;case"placeholder":(je(this.dateTimeOptions)||void 0===this.dateTimeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(r)},!e);break;case"min":(je(this.dateTimeOptions)||void 0===this.dateTimeOptions.min||e)&&(t=new Date(this.inputElement.getAttribute(r)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({min:t},!e));break;case"disabled":(je(this.dateTimeOptions)||void 0===this.dateTimeOptions.enabled||e)&&(o="disabled"!==this.inputElement.getAttribute(r)&&"true"!==this.inputElement.getAttribute(r)&&""!==this.inputElement.getAttribute(r),this.setProperties({enabled:o},!e));break;case"value":(je(this.dateTimeOptions)||void 0===this.dateTimeOptions.value||e)&&(t=new Date(this.inputElement.getAttribute(r)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({value:t},!e));break;case"max":(je(this.dateTimeOptions)||void 0===this.dateTimeOptions.max||e)&&(t=new Date(this.inputElement.getAttribute(r)),this.isNullOrEmpty(t)||isNaN(+t)||this.setProperties({max:t},!e))}}},Wq.prototype.requiredModules=function(){var e=[];return"Islamic"===this.calendarMode&&e.push({args:[this],member:"islamic",name:"Islamic"}),this.enableMask&&e.push(this.maskedDateModule()),e},Wq.prototype.maskedDateModule=function(){return{args:[this],member:"MaskedDateTime"}},Wq.prototype.getTimeActiveElement=function(){return je(this.dateTimeWrapper)?null:this.dateTimeWrapper.querySelectorAll("."+Vq)},Wq.prototype.createDateObj=function(e){return e instanceof Date?e:null},Wq.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var t,i,n,o,r,s,e=this.createDateObj(e),a=this.valueWithMinutes,l=!je(a);if(this.checkDateValue(e))return t=l?a.getDate():xq,i=l?a.getMonth():Iq,n=l?a.getFullYear():Tq,o=l?a.getHours():Eq,r=l?a.getMinutes():Dq,s=l?a.getSeconds():Mq,l=l?a.getMilliseconds():kq,this.scrollInvoked?(this.scrollInvoked=!1,new Date(n,i,t,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())):new Date(n,i,t,o,r,s,l)}return null},Wq.prototype.findNextTimeElement=function(e){var t=this.inputElement.value,i=je(this.valueWithMinutes)?this.createDateObj(t):this.getDateObject(this.valueWithMinutes),n=null,o=this.liCollections.length;if(!je(this.activeIndex)||!je(this.checkDateValue(i))){if("home"===e.action)n=+this.createDateObj(new Date(this.timeCollections[0])),this.activeIndex=0;else if("end"===e.action)n=+this.createDateObj(new Date(this.timeCollections[this.timeCollections.length-1])),this.activeIndex=this.timeCollections.length-1;else if("down"===e.action){for(var r=0;r<o;r++)if(+i<this.timeCollections[r]){n=+this.createDateObj(new Date(this.timeCollections[r])),this.activeIndex=r;break}}else for(r=o-1;0<=r;r--)if(+i>this.timeCollections[r]){n=+this.createDateObj(new Date(this.timeCollections[r])),this.activeIndex=r;break}this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(je(n)?null:new Date(n))}},Wq.prototype.setTimeValue=function(e,t){t=this.validateMinMaxRange(t),t=this.createDateObj(t),this.getFormattedValue(t)!==(je(this.value)?null:this.getFormattedValue(this.value))?this.valueWithMinutes=je(t)?null:t:(this.strictMode&&(e=t),this.valueWithMinutes=this.checkDateValue(e)),t=new Date(+this.valueWithMinutes),e="Gregorian"===this.calendarMode?this.globalize.formatDate(t,{format:je(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd"}):this.globalize.formatDate(t,{format:je(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"});return this.strictMode||je(t),HF.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton),t},Wq.prototype.timeElementValue=function(e){var t;return je(this.checkDateValue(e))||this.isNullOrEmpty(e)?null:(t=e instanceof Date?e:this.getDateObject(e),this.setTimeValue(t,e))},Wq.prototype.timeKeyHandler=function(e){var t,i,n;je(this.step)||this.step<=0||(t=this.timeCollections.length,je(this.getTimeActiveElement())||0===this.getTimeActiveElement().length?0<this.liCollections.length&&(je(this.value)&&je(this.activeIndex)?(this.activeIndex=0,this.selectedElement=this.liCollections[0],this.timeElementValue(new Date(this.timeCollections[0]))):this.findNextTimeElement(e)):(i=void 0,37<=e.keyCode&&e.keyCode<=40?(n=40===e.keyCode||39===e.keyCode?++this.activeIndex:--this.activeIndex,this.activeIndex=n=this.activeIndex===t?0:this.activeIndex,this.activeIndex=n=this.activeIndex<0?t-1:this.activeIndex,i=je(this.timeCollections[n])?this.timeCollections[0]:this.timeCollections[n]):"home"===e.action?(this.activeIndex=0,i=this.timeCollections[0]):"end"===e.action&&(this.activeIndex=t-1,i=this.timeCollections[t-1]),this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(new Date(i))),this.isNavigate=!0,this.setTimeHover(this.selectedElement,"e-navigation"),this.setTimeActiveDescendant(),!this.isTimePopupOpen())||null===this.selectedElement||e&&"click"===e.type||this.setTimeScrollPosition()},Wq.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),U([this.inputWrapper.container],Lq),this.isNavigate=!1,e.stopPropagation();break;case"escape":this.hide(e);break;default:this.isNavigate=!1}},Wq.prototype.inputKeyAction=function(e){"altDownArrow"===e.action&&(this.strictModeUpdate(),this.updateInput(),this.toggle(e))},Wq.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];switch(0<["blur","change","cleared","close","created","destroyed","focus","navigated","open","renderDayCell"].indexOf(o)&&this.isReact&&(this.isDynamicValueChanged=!0),o){case"value":this.isDynamicValueChanged=!0,this.invalidValueString=null,this.checkInvalidValue(e.value),e.value=this.value,e.value=this.validateValue(e.value),this.enableMask?HF.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton):HF.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,o),this.updateInput();break;case"enableRtl":HF.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"cssClass":je(t.cssClass)||(t.cssClass=t.cssClass.replace(/\s+/g," ").trim()),je(e.cssClass)||(e.cssClass=e.cssClass.replace(/\s+/g," ").trim()),HF.setCssClass(e.cssClass,[this.inputWrapper.container],t.cssClass),this.dateTimeWrapper&&HF.setCssClass(e.cssClass,[this.dateTimeWrapper],t.cssClass);break;case"locale":this.globalize=new Ti(this.locale),this.l10n.setLocale(this.locale),this.dateTimeOptions&&null==this.dateTimeOptions.placeholder&&(this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),HF.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)),this.dateTimeFormat=this.cldrDateTimeFormat(),Aq.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||HF.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;case"placeholder":HF.setPlaceholder(e.placeholder,this.inputElement);break;case"enabled":HF.setEnabled(this.enabled,this.inputElement),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1;break;case"strictMode":this.invalidValueString=null,this.updateInput();break;case"width":this.setWidth(e.width),HF.calculateWidth(this.inputElement,this.inputWrapper.container),je(this.inputWrapper.buttons[0])||je(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-date-time-icon");break;case"readonly":HF.setReadonly(this.readonly,this.inputElement);break;case"floatLabelType":this.floatLabelType=e.floatLabelType,HF.removeFloating(this.inputWrapper),HF.addFloating(this.inputElement,this.floatLabelType,this.placeholder),je(this.inputWrapper.buttons[0])||je(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-date-time-icon");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"}),HF.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton)):this.inputElement.value===this.maskedDateValue&&(this.maskedDateValue="",HF.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;default:Aq.prototype.onPropertyChanged.call(this,e,t)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},Wq.prototype.getModuleName=function(){return"datetimepicker"},Wq.prototype.restoreValue=function(){this.previousDateTime=this.previousDate,this.currentDate=this.value||new Date,this.valueWithMinutes=this.value,this.previousDate=this.value,this.previousElementValue=this.previousElementValue=je(this.inputValueCopy)?"":this.getFormattedValue(this.inputValueCopy)},l9([e(null)],Wq.prototype,"timeFormat",void 0),l9([e(30)],Wq.prototype,"step",void 0),l9([e(null)],Wq.prototype,"scrollTo",void 0),l9([e(1e3)],Wq.prototype,"zIndex",void 0),l9([e(null)],Wq.prototype,"value",void 0),l9([e(null)],Wq.prototype,"keyConfigs",void 0),l9([e({})],Wq.prototype,"htmlAttributes",void 0),l9([e(!1)],Wq.prototype,"enablePersistence",void 0),l9([e(!0)],Wq.prototype,"allowEdit",void 0),l9([e(!1)],Wq.prototype,"isMultiSelection",void 0),l9([e(null)],Wq.prototype,"values",void 0),l9([e(!0)],Wq.prototype,"showClearButton",void 0),l9([e(null)],Wq.prototype,"placeholder",void 0),l9([e(!1)],Wq.prototype,"strictMode",void 0),l9([e(!1)],Wq.prototype,"fullScreenMode",void 0),l9([e(null)],Wq.prototype,"serverTimezoneOffset",void 0),l9([e(new Date(1900,0,1))],Wq.prototype,"min",void 0),l9([e(new Date(2099,11,31))],Wq.prototype,"max",void 0),l9([e(null)],Wq.prototype,"minTime",void 0),l9([e(null)],Wq.prototype,"maxTime",void 0),l9([e(null)],Wq.prototype,"firstDayOfWeek",void 0),l9([e("Gregorian")],Wq.prototype,"calendarMode",void 0),l9([e("Month")],Wq.prototype,"start",void 0),l9([e("Month")],Wq.prototype,"depth",void 0),l9([e(!1)],Wq.prototype,"weekNumber",void 0),l9([e(!0)],Wq.prototype,"showTodayButton",void 0),l9([e("Short")],Wq.prototype,"dayHeaderFormat",void 0),l9([e(!1)],Wq.prototype,"openOnFocus",void 0),l9([e(!1)],Wq.prototype,"enableMask",void 0),l9([e({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],Wq.prototype,"maskPlaceholder",void 0),l9([i()],Wq.prototype,"open",void 0),l9([i()],Wq.prototype,"close",void 0),l9([i()],Wq.prototype,"cleared",void 0),l9([i()],Wq.prototype,"blur",void 0),l9([i()],Wq.prototype,"focus",void 0),l9([i()],Wq.prototype,"created",void 0),l9([i()],Wq.prototype,"destroyed",void 0),l9([Bt],Wq));function Wq(e,t){t=Aq.call(this,e,t)||this;return t.valueWithMinutes=null,t.scrollInvoked=!1,t.moduleName=t.getModuleName(),t.formatRegex=/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yyy|yy|y|'[^']*'|'[^']*'/g,t.dateFormatString="",t.dateTimeOptions=e,t}var Qq="ArrowLeft",Uq="ArrowDown",qq="shiftTab",Gq="End",Yq=(Xq.prototype.getModuleName=function(){return"MaskedDateTime"},Xq.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),this.parent.on("maskPasteInputHandler",this.maskPasteInputHandler,this))},Xq.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),this.parent.off("maskPasteInputHandler",this.maskPasteInputHandler))},Xq.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.navigated=!0,this.isBlur=e.isBlur,this.setDynamicValue())},Xq.prototype.getCUltureMaskFormat=function(){this.l10n=new Cn(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())},Xq.prototype.validCharacterCheck=function(){for(var e=this.parent.inputElement.selectionStart,t=e="timepicker"!==this.parent.moduleName&&e===this.hiddenMask.length&&this.mask===this.parent.inputElement.value?0:e,i=e-1;t<this.hiddenMask.length||0<=i;t++,i--){if(t<this.hiddenMask.length&&-1!==this.validCharacters.indexOf(this.hiddenMask[t]))return void this.setSelection(this.hiddenMask[t]);if(0<=i&&-1!==this.validCharacters.indexOf(this.hiddenMask[i]))return void this.setSelection(this.hiddenMask[i])}},Xq.prototype.setDynamicValue=function(){this.maskDateValue=new Date(+this.parent.value),this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!0,this.updateValue(),this.isBlur||this.validCharacterCheck()},Xq.prototype.setSelection=function(e){for(var t=-1,i=0,n=0;n<this.hiddenMask.length;n++)this.hiddenMask[n]===e&&(i=n+1,-1===t)&&(t=n);this.parent.inputElement.setSelectionRange(t=t<0?0:t,i)},Xq.prototype.maskKeydownHandler=function(e){if("Backspace"===e.e.key){var t=this.parent.inputElement.selectionStart,i="";switch(i=-1!==this.validCharacters.indexOf(this.hiddenMask[t])?this.hiddenMask[t]:i){case"d":this.dayTypeCount=Math.max(this.dayTypeCount-1,0);break;case"M":this.monthTypeCount=Math.max(this.monthTypeCount-1,0);break;case"H":case"h":this.hourTypeCount=Math.max(this.hourTypeCount-1,0);break;case"m":this.minuteTypeCount=Math.max(this.minuteTypeCount-1,0);break;case"s":this.secondTypeCount=Math.max(this.secondTypeCount-1,0)}}else{var n;if(this.dayTypeCount=this.monthTypeCount=this.hourTypeCount=this.minuteTypeCount=this.secondTypeCount=0,"Delete"===e.e.key)this.isDeleteKey=!0;else if(e.e.altKey||e.e.ctrlKey||e.e.key!==Qq&&"ArrowRight"!==e.e.key&&e.e.key!==qq&&"Tab"!==e.e.key&&e.e.action!==qq&&e.e.key!==Gq&&"Home"!==e.e.key||(t=this.parent.inputElement.selectionStart,n=this.parent.inputElement.selectionEnd,o=this.parent.inputElement.value.length,0!==t||n!==o||"Tab"!==e.e.key&&e.e.action!==qq||(n=e.e.action===qq?n:0,this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=n),e.e.key!==Gq&&"Home"!==e.e.key||(n=e.e.key===Gq?o:0,this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=n),this.navigateSelection(e.e.key===Qq||e.e.action===qq||e.e.key===Gq)),!(e.e.altKey||e.e.ctrlKey||"ArrowUp"!==e.e.key&&e.e.key!==Uq)){var t=this.parent.inputElement.selectionStart,i="",o=(-1!==this.validCharacters.indexOf(this.hiddenMask[t])&&(i=this.hiddenMask[t]),this.dateAlteration(e.e.key===Uq),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=o,this.parent.inputElement.value=o;for(var r=0;r<this.hiddenMask.length;r++)if(i===this.hiddenMask[r]){t=r;break}this.parent.inputElement.selectionStart=t,this.validCharacterCheck()}}},Xq.prototype.isPersist=function(){return this.parent.isFocused||this.navigated},Xq.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),n=t.substring(0,e),o=new Date(+this.maskDateValue),r=new Date(o.getFullYear(),o.getMonth()+1,0).getDate();if(0===i.indexOf(n)&&(0===n.length||this.previousHiddenMask[n.length-1]!==this.previousHiddenMask[n.length])){for(var s=n.length;s<i.length;s++)""!==this.previousHiddenMask[s]&&0<=this.validCharacters.indexOf(this.previousHiddenMask[s])&&(this.isDeletion=this.handleDeletion(this.previousHiddenMask[s],!1));if(this.isDeletion)return}switch(this.previousHiddenMask[e-1]){case"d":var a=(this.isDayPart&&o.getDate().toString().length<2&&!this.isPersist()?10*o.getDate():0)+parseInt(n[e-1],10);if(this.isDateZero="0"===n[e-1],this.parent.isFocused=this.parent.isFocused&&!1,this.navigated=this.navigated&&!1,isNaN(a))return;for(s=0;r<a;s++)a=parseInt(a.toString().slice(1),10);if(1<=a){if(o.setDate(a),this.isNavigate=2===a.toString().length,this.previousDate=new Date(o.getFullYear(),o.getMonth(),o.getDate()),o.getMonth()!==this.maskDateValue.getMonth())return;this.isDayPart=!0;var l=new Date(o.getFullYear(),o.getMonth()+1,0).getDate();this.dayTypeCount+=0===this.dayTypeCount&&parseInt(a+"0",10)>l?2:1}else this.isDayPart=!1,1===this.dayTypeCount&&this.isDateZero||(this.dayTypeCount+=this.isDateZero?1:0);break;case"M":var h,d=void 0,d=o.getMonth().toString().length<2&&!this.isPersist()?(this.isMonthPart?10*(o.getMonth()+1):0)+parseInt(n[e-1],10):parseInt(n[e-1],10);if(this.parent.isFocused=this.parent.isFocused&&!1,this.navigated=this.navigated&&!1,this.isMonthZero="0"===n[e-1],isNaN(d)){var p=this.getCulturedValue("months[stand-alone].wide"),c=Object.keys(p);for(this.monthCharacter+=n[e-1].toLowerCase();0<this.monthCharacter.length;){for(var s=1,u=0,g=c;u<g.length;u++){g[u];if(0===p[s].toLowerCase().indexOf(this.monthCharacter))return o.setMonth(s-1),this.isMonthPart=!0,void(this.maskDateValue=o);s++}this.monthCharacter=this.monthCharacter.substring(1,this.monthCharacter.length)}}else{for(;12<d;)d=parseInt(d.toString().slice(1),10);1<=d?(o.setMonth(d-1),10<=d||1===d?this.isLeadingZero&&1===d?(this.isNavigate=1===d.toString().length,this.isLeadingZero=!1):this.isNavigate=2===d.toString().length:this.isNavigate=1===d.toString().length,o.getMonth()!==d-1&&(o.setDate(1),o.setMonth(d-1)),this.isDayPart&&(l=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),h=new Date(o.getFullYear(),o.getMonth()+1,0).getDate(),this.previousDate.getDate()===l)&&h<=l&&o.setDate(h),this.previousDate=new Date(o.getFullYear(),o.getMonth(),o.getDate()),this.isMonthPart=!0,this.monthTypeCount=this.monthTypeCount+1,this.isLeadingZero=!1):(o.setMonth(0),this.isLeadingZero=!0,this.isMonthPart=!1,1===this.monthTypeCount&&this.isMonthZero||(this.monthTypeCount+=this.isMonthZero?1:0))}break;case"y":var m=(this.isYearPart&&o.getFullYear().toString().length<4&&!this.isShortYear?10*o.getFullYear():0)+parseInt(n[e-1],10),l=2!==(l=(this.dateformat.match(/y/g)||[]).length)?4:l;if(this.isShortYear=!1,this.isYearZero="0"===n[e-1],isNaN(m))return;for(;9999<m;)m=parseInt(m.toString().slice(1),10);m<1?this.isYearPart=!1:(o.setFullYear(m),m.toString().length===l&&(this.isNavigate=!0),this.previousDate=new Date(o.getFullYear(),o.getMonth(),o.getDate()),this.isYearPart=!0);break;case"h":if(this.hour=(this.isHourPart&&(o.getHours()%12||12).toString().length<2&&!this.isPersist()?10*(o.getHours()%12||12):0)+parseInt(n[e-1],10),this.parent.isFocused=this.parent.isFocused&&!1,this.navigated=this.navigated&&!1,isNaN(this.hour))return;for(;12<this.hour;)this.hour=parseInt(this.hour.toString().slice(1),10);o.setHours(12*Math.floor(o.getHours()/12)+this.hour%12),this.isNavigate=2===this.hour.toString().length,this.isHourPart=!0,this.hourTypeCount=0===this.hourTypeCount&&this.hour&&12<parseInt(this.hour+"0",10)?2:this.hourTypeCount+1;break;case"H":if(this.hour=(this.isHourPart&&o.getHours().toString().length<2&&!this.isPersist()?10*o.getHours():0)+parseInt(n[e-1],10),this.parent.isFocused=this.parent.isFocused&&!1,this.navigated=this.navigated&&!1,isNaN(this.hour))return;for(s=0;23<this.hour;s++)this.hour=parseInt(this.hour.toString().slice(1),10);o.setHours(this.hour),this.isNavigate=2===this.hour.toString().length,this.isHourPart=!0,this.hourTypeCount=0===this.hourTypeCount&&this.hour&&23<parseInt(this.hour+"0",10)?2:this.hourTypeCount+1;break;case"m":var f=(this.isMinutePart&&o.getMinutes().toString().length<2&&!this.isPersist()?10*o.getMinutes():0)+parseInt(n[e-1],10);if(this.parent.isFocused=this.parent.isFocused&&!1,this.navigated=this.navigated&&!1,isNaN(f))return;for(s=0;59<f;s++)f=parseInt(f.toString().slice(1),10);o.setMinutes(f),this.isNavigate=2===f.toString().length,this.isMinutePart=!0,this.minuteTypeCount=0===this.minuteTypeCount&&59<parseInt(f+"0",10)?2:this.minuteTypeCount+1;break;case"s":var y=(this.isSecondsPart&&o.getSeconds().toString().length<2&&!this.isPersist()?10*o.getSeconds():0)+parseInt(n[e-1],10);if(this.parent.isFocused=this.parent.isFocused&&!1,this.navigated=this.navigated&&!1,isNaN(y))return;for(s=0;59<y;s++)y=parseInt(y.toString().slice(1),10);o.setSeconds(y),this.isNavigate=2===y.toString().length,this.isSecondsPart=!0,this.secondTypeCount=0===this.secondTypeCount&&59<parseInt(y+"0",10)?2:this.secondTypeCount+1;break;case"a":this.periodCharacter+=n[e-1].toLowerCase();for(var v=this.getCulturedValue("dayPeriods.format.wide"),b=Object.keys(v),s=0;0<this.periodCharacter.length;s++)(0===v[b[0]].toLowerCase().indexOf(this.periodCharacter)&&12<=o.getHours()||0===v[b[1]].toLowerCase().indexOf(this.periodCharacter)&&o.getHours()<12)&&(o.setHours((o.getHours()+12)%24),this.maskDateValue=o),this.periodCharacter=this.periodCharacter.substring(1,this.periodCharacter.length)}this.maskDateValue=o},Xq.prototype.formatCheck=function(){var g=this;return function(e){var t,i,n=g.getCulturedValue("days[stand-alone].abbreviated"),o=Object.keys(n),r=g.getCulturedValue("days[stand-alone].wide"),s=Object.keys(r),a=g.getCulturedValue("days[stand-alone].narrow"),l=Object.keys(a),h=g.getCulturedValue("months[stand-alone].abbreviated"),d=g.getCulturedValue("months[stand-alone].wide"),p=g.getCulturedValue("dayPeriods.format.wide");switch(e){case"ddd":case"dddd":case"d":t=(g.isDayPart?g.maskDateValue.getDate():g.defaultConstant.day).toString(),t=g.zeroCheck(g.isDateZero,g.isDayPart,t),2===g.dayTypeCount&&(g.isNavigate=!0,g.dayTypeCount=0);break;case"dd":t=g.isDayPart?g.roundOff(g.maskDateValue.getDate(),2):g.defaultConstant.day.toString(),t=g.zeroCheck(g.isDateZero,g.isDayPart,t),2===g.dayTypeCount&&(g.isNavigate=!0,g.dayTypeCount=0);break;case"E":case"EE":case"EEE":case"ccc":t=(g.isDayPart&&g.isMonthPart&&g.isYearPart?n[o[g.maskDateValue.getDay()]]:g.defaultConstant.dayOfTheWeek).toString();break;case"EEEE":case"cccc":t=(g.isDayPart&&g.isMonthPart&&g.isYearPart?r[s[g.maskDateValue.getDay()]]:g.defaultConstant.dayOfTheWeek).toString();break;case"EEEEE":t=(g.isDayPart&&g.isMonthPart&&g.isYearPart?a[l[g.maskDateValue.getDay()]]:g.defaultConstant.dayOfTheWeek).toString();break;case"M":t=(g.isMonthPart?g.maskDateValue.getMonth()+1:g.defaultConstant.month).toString(),t=g.zeroCheck(g.isMonthZero,g.isMonthPart,t),2===g.monthTypeCount&&(g.isNavigate=!0,g.monthTypeCount=0);break;case"MM":t=g.isMonthPart?g.roundOff(g.maskDateValue.getMonth()+1,2):g.defaultConstant.month.toString(),t=g.zeroCheck(g.isMonthZero,g.isMonthPart,t),2===g.monthTypeCount&&(g.isNavigate=!0,g.monthTypeCount=0);break;case"MMM":t=g.isMonthPart?h[g.maskDateValue.getMonth()+1]:g.defaultConstant.month.toString();break;case"MMMM":t=g.isMonthPart?d[g.maskDateValue.getMonth()+1]:g.defaultConstant.month.toString();break;case"yy":t=g.isYearPart?g.roundOff(g.maskDateValue.getFullYear()%100,2):g.defaultConstant.year.toString(),t=g.zeroCheck(g.isYearZero,g.isYearPart,t);break;case"y":case"yyy":case"yyyy":t=g.isYearPart?g.roundOff(g.maskDateValue.getFullYear(),4):g.defaultConstant.year.toString(),t=g.zeroCheck(g.isYearZero,g.isYearPart,t);break;case"h":t=(g.isHourPart?g.maskDateValue.getHours()%12||12:g.defaultConstant.hour).toString(),2===g.hourTypeCount&&(g.isNavigate=!0,g.hourTypeCount=0);break;case"hh":t=g.isHourPart?g.roundOff(g.maskDateValue.getHours()%12||12,2):g.defaultConstant.hour.toString(),2===g.hourTypeCount&&(g.isNavigate=!0,g.hourTypeCount=0);break;case"H":t=(g.isHourPart?g.maskDateValue.getHours():g.defaultConstant.hour).toString(),2===g.hourTypeCount&&(g.isNavigate=!0,g.hourTypeCount=0);break;case"HH":t=g.isHourPart?g.roundOff(g.maskDateValue.getHours(),2):g.defaultConstant.hour.toString(),2===g.hourTypeCount&&(g.isNavigate=!0,g.hourTypeCount=0);break;case"m":t=(g.isMinutePart?g.maskDateValue.getMinutes():g.defaultConstant.minute).toString(),2===g.minuteTypeCount&&(g.isNavigate=!0,g.minuteTypeCount=0);break;case"mm":t=g.isMinutePart?g.roundOff(g.maskDateValue.getMinutes(),2):g.defaultConstant.minute.toString(),2===g.minuteTypeCount&&(g.isNavigate=!0,g.minuteTypeCount=0);break;case"s":t=(g.isSecondsPart?g.maskDateValue.getSeconds():g.defaultConstant.second).toString(),2===g.secondTypeCount&&(g.isNavigate=!0,g.secondTypeCount=0);break;case"ss":t=g.isSecondsPart?g.roundOff(g.maskDateValue.getSeconds(),2):g.defaultConstant.second.toString(),2===g.secondTypeCount&&(g.isNavigate=!0,g.secondTypeCount=0);break;case"f":t=Math.floor(g.maskDateValue.getMilliseconds()/100).toString();break;case"ff":i=g.maskDateValue.getMilliseconds(),99<g.maskDateValue.getMilliseconds()&&(i=Math.floor(g.maskDateValue.getMilliseconds()/10)),t=g.roundOff(i,2);break;case"fff":t=g.roundOff(g.maskDateValue.getMilliseconds(),3);break;case"a":case"aa":t=g.maskDateValue.getHours()<12?p.am:p.pm;break;case"z":case"zz":case"zzz":case"zzzz":i={format:e,type:"dateTime",skeleton:"yMd",calendar:g.parent.calendarMode},t=g.parent.globalize.formatDate(g.maskDateValue,i)}if(t=void 0!==t?t:e.slice(1,e.length-1),g.isHiddenMask){for(var c="",u=0;u<t.length;u++)c+=e[0];return c}return t}},Xq.prototype.isValidDate=function(e){e=new Date(e);return!isNaN(e.getTime())},Xq.prototype.maskPasteInputHandler=function(){this.isValidDate(this.parent.inputElement.value)?(this.maskDateValue=new Date(this.parent.inputElement.value),this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!0,this.updateValue(),this.isBlur||this.validCharacterCheck()):this.maskInputHandler()},Xq.prototype.maskInputHandler=function(){var e=this.parent.inputElement.selectionStart,t="",i=(-1!==this.validCharacters.indexOf(this.hiddenMask[e])&&(t=this.hiddenMask[e]),this.differenceCheck(),this.dateformat.replace(this.formatRegex,this.formatCheck()));this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isDateZero=this.isMonthZero=this.isYearZero=!1,this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.previousValue=i,this.parent.inputElement.value=i;for(var n,o=0;o<this.hiddenMask.length;o++)if(t===this.hiddenMask[o]){e=o;break}F.isDevice&&(F.isIos||F.isIos7)&&(i=this.findScrollableParent(this.parent.inputElement),n=i?i.getBoundingClientRect().top:window.scrollY),this.parent.inputElement.selectionStart=e,this.validCharacterCheck(),!this.isNavigate&&!this.isDeletion||this.isDeleteKey||(i=!this.isNavigate,this.isNavigate=this.isDeletion=!1,this.navigateSelection(i),F.isDevice&&(F.isIos||F.isIos7)&&setTimeout(function(){window.scrollTo(0,n)},0)),this.isDeleteKey&&(this.isDeletion=!1),this.isDeleteKey=!1},Xq.prototype.findScrollableParent=function(e){for(;e;){if(this.isScrollable(e))return e;e=e.parentElement}return null},Xq.prototype.isScrollable=function(e){var t=window.getComputedStyle(e).overflowY;return e.scrollHeight>e.clientHeight&&("auto"===t||"scroll"===t)},Xq.prototype.navigateSelection=function(e){var t=this.parent.inputElement.selectionStart,i=this.parent.inputElement.selectionEnd,n=e?t-1:i;for(this.navigated=!0;n<this.hiddenMask.length&&0<=n;){if(0<=this.validCharacters.indexOf(this.hiddenMask[n])){this.setSelection(this.hiddenMask[n]);break}n+=e?-1:1}},Xq.prototype.roundOff=function(e,t){for(var e=e.toString(),i=t-e.length,n="",o=0;o<i;o++)n+="0";return n+e},Xq.prototype.zeroCheck=function(e,t,i){return e&&!t?"0":i},Xq.prototype.handleDeletion=function(e,t){switch(e){case"d":this.isDayPart=t;break;case"M":(this.isMonthPart=t)||(this.maskDateValue.setMonth(0),this.monthCharacter="");break;case"y":this.isYearPart=t;break;case"H":case"h":(this.isHourPart=t)||(this.periodCharacter="");break;case"m":this.isMinutePart=t;break;case"s":this.isSecondsPart=t;break;default:return!1}return!0},Xq.prototype.dateAlteration=function(e){var t=this.parent.inputElement.selectionStart,i="";if(-1!==this.validCharacters.indexOf(this.hiddenMask[t])){var i=this.hiddenMask[t],n=new Date(this.maskDateValue.getFullYear(),this.maskDateValue.getMonth(),this.maskDateValue.getDate(),this.maskDateValue.getHours(),this.maskDateValue.getMinutes(),this.maskDateValue.getSeconds()),o=(this.previousDate=new Date(this.maskDateValue.getFullYear(),this.maskDateValue.getMonth(),this.maskDateValue.getDate(),this.maskDateValue.getHours(),this.maskDateValue.getMinutes(),this.maskDateValue.getSeconds()),e?-1:1);switch(i){case"d":n.setDate(n.getDate()+o);break;case"M":var r,s=n.getMonth()+o;n.setDate(1),n.setMonth(s),this.isDayPart&&(s=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),r=new Date(n.getFullYear(),n.getMonth()+1,0).getDate(),this.previousDate.getDate()===s)&&r<=s?n.setDate(r):n.setDate(this.previousDate.getDate()),this.previousDate=new Date(n.getFullYear(),n.getMonth(),n.getDate());break;case"y":n.setFullYear(n.getFullYear()+o);break;case"H":case"h":n.setHours(n.getHours()+o);break;case"m":n.setMinutes(n.getMinutes()+o);break;case"s":n.setSeconds(n.getSeconds()+o);break;case"a":n.setHours((n.getHours()+12)%24)}this.maskDateValue=0<n.getFullYear()?n:this.maskDateValue,-1!==this.validCharacters.indexOf(this.hiddenMask[t])&&this.handleDeletion(this.hiddenMask[t],!0)}},Xq.prototype.getCulturedValue=function(e){var t=this.parent.locale,t="en"===t||"en-US"===t?R(e,Pi()):R("main."+t+".dates.calendars.gregorian."+e,Ai);return t},Xq.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),e="timepicker"===this.parent.moduleName?this.parent.cldrTimeFormat():e},Xq.prototype.clearHandler=function(){this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!1,this.updateValue(),this.parent.inputElement&&this.parent.inputElement.value===this.parent.maskedDateValue&&this.parent.inputWrapper&&this.parent.inputWrapper.clearButton&&!this.parent.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&this.parent.inputWrapper.clearButton.classList.add("e-clear-icon-hide")},Xq.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),!this.parent.strictMode||0===this.dayTypeCount&&0===this.monthTypeCount||(this.isLeadingZero=!1),this.dayTypeCount=0,this.monthTypeCount=0},Xq.prototype.destroy=function(){this.removeEventListener()},Xq);function Xq(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.navigated=!1,this.isBlur=!1,this.formatRegex=/EEEEE|EEEE|EEE|EE|E|cccc|ccc|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yyy|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.isDateZero=!1,this.isMonthZero=!1,this.isYearZero=!1,this.isLeadingZero=!1,this.dayTypeCount=0,this.monthTypeCount=0,this.hourTypeCount=0,this.minuteTypeCount=0,this.secondTypeCount=0,this.parent=e,this.dateformat=this.getCulturedFormat(),this.maskDateValue=null!=this.parent.value?new Date(+this.parent.value):new Date,this.maskDateValue.setMonth(0),this.maskDateValue.setHours(0),this.maskDateValue.setMinutes(0),this.maskDateValue.setSeconds(0),this.previousDate=new Date(this.maskDateValue.getFullYear(),this.maskDateValue.getMonth(),this.maskDateValue.getDate(),this.maskDateValue.getHours(),this.maskDateValue.getMinutes(),this.maskDateValue.getSeconds()),this.removeEventListener(),this.addEventListener()}Kq=function(e,t){return(Kq=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Kq(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})($q,Jq=B_),$q.prototype.getCMenuDS=function(e,t){for(var i={number:["Equal","NotEqual","","LessThan","LessThanOrEqual","GreaterThan","GreaterThanOrEqual","Between","","CustomFilter"],string:["Equal","NotEqual","","StartsWith","EndsWith","","Contains","NotContains","","CustomFilter"]},n=(i.date=i.number,i.datetime=i.number,i.dateonly=i.number,[]),o=0;o<i[""+e].length;o++)i[""+e][parseInt(o.toString(),10)].length?n.push(t?{text:this.getLocalizedLabel(i[""+e][parseInt(o.toString(),10)])+"...",iconCss:"e-icons e-icon-check "+(t===i[""+e][parseInt(o.toString(),10)].toLowerCase()?"":"e-emptyicon")}:{text:this.getLocalizedLabel(i[""+e][parseInt(o.toString(),10)])+"..."}):n.push({separator:!0});return n},$q.prototype.destroy=function(){var e;this.dlg&&(this.unwireExEvents(),Jq.prototype.closeDialog.call(this)),this.isDevice||!this.menuObj||(e=this.menuObj.element.querySelector("li.e-focused"))&&A(e,"e-excel-menu")||this.destroyCMenu(),this.dlgObj&&!this.dlgObj.isDestroyed&&this.removeDialog()},$q.prototype.createMenu=function(e,t,i,n){this.menu=this.parent.createElement("div",{className:"e-contextmenu-wrapper"}),this.parent.enableRtl?this.menu.classList.add("e-rtl"):this.menu.classList.remove("e-rtl"),this.parent.cssClass&&this.menu.classList.add(this.parent.cssClass);var o,r,s,a=this.parent.createElement("ul"),l=t?"e-excl-filter-icon e-filtered":"e-excl-filter-icon";this.parent.allowSorting&&"grid"===this.parent.getModuleName()&&!this.options.isResponsiveFilter&&(s=this.parent.getColumnHeaderByUid(n.uid).getAttribute("aria-sort"),o=(n=this.parent.getColumnByField(n.field).allowSorting)&&"ascending"!==s?"e-excel-ascending":"e-disabled e-excel-ascending",n=n&&"descending"!==s?"e-excel-descending":"e-disabled e-excel-descending",s="string"===e?this.getLocalizedLabel("SortAtoZ"):"datetime"===e||"date"===e?this.getLocalizedLabel("SortByOldest"):this.getLocalizedLabel("SortSmallestToLargest"),r="string"===e?this.getLocalizedLabel("SortZtoA"):"datetime"===e||"date"===e?this.getLocalizedLabel("SortByNewest"):this.getLocalizedLabel("SortLargestToSmallest"),a.appendChild(this.createMenuElem(s,o,"e-sortascending")),a.appendChild(this.createMenuElem(r,n,"e-sortdescending")),s=this.parent.createElement("li",{className:"e-separator e-menu-item e-excel-separator"}),a.appendChild(s)),this.options.isResponsiveFilter||a.appendChild(this.createMenuElem(this.getLocalizedLabel("ClearFilter"),t?"":"e-disabled",l)),"boolean"!==e&&a.appendChild(this.createMenuElem(this.getLocalizedLabel({string:"TextFilter",date:"DateFilter",dateonly:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"}[""+e]),"e-submenu",i&&this.ensureTextFilter()?"e-icon-check":l+" e-emptyicon",!0)),this.menu.appendChild(a),this.parent.notify(WI,{element:this.menu}),this.parent.notify(_T,{isFiltered:t})},$q.prototype.createMenuElem=function(e,t,i,n){t=this.parent.createElement("li",{className:t+" e-menu-item"});return t.innerHTML=e,t.tabIndex=t.classList.contains("e-disabled")?-1:0,t.insertBefore(this.parent.createElement("span",{className:"e-menu-icon e-icons "+i,attrs:{"aria-hidden":"true"}}),t.firstChild),n&&t.appendChild(this.parent.createElement("span",{className:"e-icons e-caret"})),t},$q.prototype.wireExEvents=function(){F.isDevice||E.add(this.dlg,"mouseover",this.hoverHandler,this),E.add(this.dlg,"click",this.clickExHandler,this),E.add(this.dlg,"keyup",this.keyUp,this),E.add(this.dlg,"keydown",this.keyDown,this)},$q.prototype.unwireExEvents=function(){F.isDevice||E.remove(this.dlg,"mouseover",this.hoverHandler),E.remove(this.dlg,"click",this.clickExHandler),E.remove(this.dlg,"keyup",this.keyUp),E.remove(this.dlg,"keydown",this.keyDown)},$q.prototype.clickExHandler=function(e){var t=A(e.target,"e-menu-item");t&&(this.getLocalizedLabel("ClearFilter")===t.innerText.trim()?(this.clearFilter(),this.closeDialog()):(this.options.isResponsiveFilter||F.isDevice)&&this.getLocalizedLabel({string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"}[this.options.type])===t.innerText.trim()&&this.hoverHandler(e))},$q.prototype.focusNextOrPrevElement=function(e,t,i){e="ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey?t.indexOf(document.activeElement)-1:t.indexOf(document.activeElement)+1,e=t[(e+t.length)%t.length];e&&(e.focus(),t=e.classList.contains("e-chk-hidden")?"e-chkfocus":i,i=e.classList.contains("e-chk-hidden")?A(e,"e-ftrchk"):A(e,"e-menu-item"),this.excelSetFocus(i,t))},$q.prototype.keyUp=function(e){var t,i;"Tab"===e.key&&e.shiftKey||"Tab"===e.key?(t=e.target.classList.contains("e-chk-hidden")?"e-chkfocus":"e-menufocus",i=e.target.classList.contains("e-menu-item")?A(e.target,"e-menu-item"):A(e.target,"e-ftrchk"),this.excelSetFocus(i,t)):"ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.altKey?"Enter"!==e.key&&"ArrowRight"!==e.code||!e.target.classList.contains("e-menu-item")||(e.preventDefault(),e.target.click(),e.target.classList.contains("e-submenu")&&(this.hoverHandler(e),this.menuObj.element.querySelector(".e-menu-item").focus(),this.excelSetFocus(A(this.menuObj.element.querySelector(".e-menu-item"),"e-menu-item"),"e-focused"),this.focusedMenuItem=this.menuObj.element.querySelector(".e-menu-item"))):(e.preventDefault(),i=Array.from(this.dlg.querySelectorAll('input, button, [tabindex]:not([tabindex="-1"]), .e-menu-item:not(.e-disabled):not(.e-separator)')),this.focusNextOrPrevElement(e,i,"e-menufocus"))},$q.prototype.keyDown=function(e){"ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.preventDefault()},$q.prototype.excelSetFocus=function(e,t){var i=this.cmenu.querySelector("."+t),n=this.menu.querySelector("."+t);i&&i.classList.remove(t),n&&n.classList.contains("e-menufocus")&&n.classList.remove(t),e&&e.classList.add(t)},$q.prototype.destroyCMenu=function(){this.isCMenuOpen=!1,this.menuObj&&!this.menuObj.isDestroyed&&(this.menuObj.destroy(),E.remove(this.menuObj.element,"keydown",this.contextKeyDownHandler),ue(this.cmenu),this.parent.notify(HT,{target:null,header:"",isOpen:!1,col:this.options.column}))},$q.prototype.hoverHandler=function(e){var t,i,n,o;this.options.isResponsiveFilter&&"mouseover"===e.type||(o=e.target.querySelector(".e-contextmenu"),i=A(e.target,"e-menu-item"),(n=this.menu.querySelector(".e-focused"))&&n.classList.remove("e-focused"),i&&(i.classList.add("e-focused"),t=i.classList.contains("e-submenu")),o)||(t||(je(n=this.menu.querySelector(".e-submenu"))||n.classList.remove("e-selected"),this.destroyCMenu()),o=this.ensureTextFilter(),!this.isCMenuOpen&&t&&(i.classList.add("e-selected"),this.isCMenuOpen=!0,n={items:this.getCMenuDS(this.options.type,o?o.replace(/\s/g,""):void 0),select:this.selectHandler.bind(this),onClose:this.destroyCMenu.bind(this),enableRtl:this.parent.enableRtl,animationSettings:{effect:F.isDevice?"ZoomIn":"None"},beforeClose:this.preventClose.bind(this),cssClass:this.options.isResponsiveFilter&&this.parent.cssClass?"e-res-contextmenu-wrapper "+this.parent.cssClass:this.options.isResponsiveFilter?"e-res-contextmenu-wrapper":this.parent.cssClass||""},this.parent.element.appendChild(this.cmenu),this.menuObj=new D4(n,this.cmenu),E.add(this.menuObj.element,"keydown",this.contextKeyDownHandler,this),t=this.menu.querySelector(".e-submenu").getBoundingClientRect(),i={top:0,left:0},this.options.isResponsiveFilter?(o=document.querySelector(".e-responsive-dialog > .e-dlg-header-content").offsetHeight+4,this.menuObj.element.style.height="calc(100% - "+o+"px)",this.menuObj.open(o,0,document.body),n=this.getLocalizedLabel({string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"}[this.options.type]),this.parent.notify(HT,{target:this.menuObj.element.parentElement,header:n,isOpen:!0})):(F.isDevice?(this.isDevice=!0,o=this.getContextBounds(),i.top=(window.innerHeight-o.height)/2,i.left=(window.innerWidth-o.width)/2,this.closeDialog(),this.isDevice=!1):(i.top=F.isIE?window.pageYOffset+t.top:window.scrollY+t.top,i.left=this.getCMenuYPosition(this.dlg)),this.menuObj.open(i.top,i.left,e.target)),WB(this.parent.element,this.menuObj.element.parentElement)))},$q.prototype.contextKeyDownHandler=function(e){var t;"Tab"===e.key&&e.shiftKey||"Tab"===e.key?(e.preventDefault(),t=Array.from(this.menuObj.element.querySelectorAll('[tabindex]:not([tabindex="-1"]), .e-menu-item:not(.e-disabled):not(.e-separator)')),this.focusNextOrPrevElement(e,t,"e-focused")):"ArrowLeft"!==e.key&&"Escape"!==e.key||(e.preventDefault(),this.menuObj.close(),this.focusedMenuItem=null,document.querySelector(".e-submenu.e-menu-item").classList.remove("e-selected"),document.querySelector(".e-submenu.e-menu-item").focus())},$q.prototype.ensureTextFilter=function(){var e,t=this.existingPredicate[this.options.field];return t&&2===t.length?e="greaterthanorequal"===t[0].operator&&"lessthanorequal"===t[1].operator?"between":"customfilter":t&&1===t.length&&(this.optrData=this.customFilterOperators[this.options.type+"Operator"],e=t[0].operator),e},$q.prototype.preventClose=function(e){var t;this.options&&this.options.isResponsiveFilter&&e.event?(t=(t=e.event.target).classList&&(t.classList.contains("e-resfilterback")||t.classList.contains("e-res-back-btn")||t.classList.contains("e-menu-item")),e.cancel=!t):e.event instanceof MouseEvent&&e.event.target&&e.event.target.classList&&e.event.target.classList.contains("e-submenu")&&(e.cancel=!0)},$q.prototype.getContextBounds=function(){return this.menuObj.element.style.display="block",this.menuObj.element.getBoundingClientRect()},$q.prototype.getCMenuYPosition=function(e){var t=this.getContextBounds().width,i=e.getBoundingClientRect(),n=i.right+t-this.parent.element.clientWidth,e=(e=e.offsetWidth-e.clientWidth)?1+e:0;return n<1?i.right+1-e:i.left-t-1+e},$q.prototype.openDialog=function(e){var t,i=this;this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e),e.cancel||(this.dialogObj.dataBind(),t=this.existingPredicate[e.field]&&this.existingPredicate[e.field].length||this.options.filteredColumns.filter(function(e){return i.options.field===e.field}).length,this.createMenu(e.type,0<t,1===t||2===t,e),this.dlg.insertBefore(this.menu,this.dlg.firstChild),this.dlg.classList.add("e-excelfilter"),this.parent&&!je(this.parent.getContent)&&this.parent.getContent()&&this.parent.getContent().firstElementChild.offsetHeight<this.dlg.offsetHeight&&!A(this.parent.element,"e-gantt-dialog")&&rF(this.parent,this.dialogObj),this.parent.enableRtl&&this.dlg.classList.add("e-rtl"),this.dlg.classList.remove("e-checkboxfilter"),this.cmenu=this.parent.createElement("ul",{className:"e-excel-menu"}),this.dlg.querySelectorAll(".e-menu-item").forEach(function(e){e.scrollWidth>e.clientWidth&&e.setAttribute("title",e.textContent)}),e.column.showColumnMenu&&this.parent.notify(hI,{}),this.wireExEvents())},$q.prototype.closeDialog=function(){this.destroy()},$q.prototype.selectHandler=function(e){e.item&&(this.parent.notify(zT,{}),this.menuItem=e.item,this.closeDialog(),this.renderDialogue(e))},$q.prototype.renderDialogue=function(e){var l=this,e=e?e.element:void 0,t=this.options.field,i=!je(t)&&hB(t),n=!je(t)&&dB(t),o=this.parent.createElement("div",{className:"e-xlfl-maindiv",id:i?n+"-xlflmenu":t+"-xlflmenu"});this.dlgDiv=this.parent.createElement("div",{className:"e-xlflmenu",id:i?n+"-xlfldlg":t+"-xlfldlg"}),(this.options.isResponsiveFilter?document.querySelector(".e-resfilter > .e-dlg-content > .e-xl-customfilterdiv"):this.parent.element).appendChild(this.dlgDiv),this.dlgObj=new pS({header:this.getLocalizedLabel("CustomFilter"),isModal:!0,overlayClick:this.removeDialog.bind(this),showCloseIcon:!0,locale:this.parent.locale,closeOnEscape:!0,target:document.body,visible:!1,enableRtl:this.parent.enableRtl,open:function(){for(var e=[].slice.call(l.dlgObj.element.querySelectorAll("table.e-xlfl-table tr.e-xlfl-fields")),t=0;t<e.length;t++){var i=e[t].children[1].querySelector(".e-control"),n=e[t].querySelector(".e-dropdownlist.e-control").ej2_instances[0];"isempty"===n.value||"isnotempty"===n.value||"isnull"===n.value||"isnotnull"===n.value?i.ej2_instances[0].enabled=!1:i&&!je(i.getAttribute("disabled"))&&(i.ej2_instances[0].enabled=!0)}var o,r,s,a=l.dlgObj.element.querySelector("table.e-xlfl-table>tr");l.options.column.filterTemplate&&(o=hB(l.options.column.field)?dB(l.options.column.field):l.options.column.field,r=l.parent.isReact&&"string"!=typeof l.options.column.filterTemplate&&!(l.options.column.filterTemplate.prototype&&l.options.column.filterTemplate.prototype.CSPTemplate),s=l.parent.parentDetails&&l.parent.parentDetails.parentInstObj&&l.parent.parentDetails.parentInstObj.isReact,r||s?l.parent.renderTemplates(function(){a.querySelector("#"+o+"-xlfl-frstvalue").focus()}):a.querySelector("#"+o+"-xlfl-frstvalue").focus())},close:this.removeDialog.bind(this),created:this.createdDialog.bind(this,e,t),buttons:[{click:this.filterBtnClick.bind(this,t),buttonModel:{content:this.getLocalizedLabel("OKButton"),isPrimary:!0,cssClass:this.parent.cssClass?"e-xlfl-okbtn "+this.parent.cssClass:"e-xlfl-okbtn"}},{click:this.removeDialog.bind(this),buttonModel:{content:this.getLocalizedLabel("CancelButton"),cssClass:this.parent.cssClass?"e-xlfl-cancelbtn "+this.parent.cssClass:"e-xlfl-cancelbtn"}}],content:o,width:430,animationSettings:{effect:"None"},cssClass:this.parent.cssClass||""});this.dlgObj.isStringTemplate=!0,this.renderResponsiveDialog(),this.dlgDiv.setAttribute("aria-label",this.getLocalizedLabel("CustomFilterDialogARIA")),this.childRefs.unshift(this.dlgObj),this.dlgObj.appendTo(this.dlgDiv)},$q.prototype.renderResponsiveDialog=function(){var e;this.options.isResponsiveFilter&&((e=document.querySelector(".e-row-responsive-filter"))&&e.classList.remove("e-row-responsive-filter"),this.dlgObj.buttons=[{}],this.dlgObj.header=void 0,this.dlgObj.position={X:"",Y:""},this.dlgObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-xl-customfilterdiv"),this.dlgObj.width="100%",this.dlgObj.isModal=!1,this.dlgObj.showCloseIcon=!1)},$q.prototype.removeDialog=function(){this.parent.notify(jT,{}),(this.parent.isReact||this.parent.isVue)&&void 0!==this.parent.destroyTemplate&&EF(this.parent,["filterTemplate"]),this.removeObjects(this.childRefs),ue(this.dlgDiv),this.parent.notify(NT,{})},$q.prototype.createdDialog=function(e,t){this.renderCustomFilter(e,t),this.dlgObj.element.style.left="0px",this.options.isResponsiveFilter?(e=document.querySelector(".e-responsive-dialog > .e-dlg-header-content").offsetHeight+4,this.dlgObj.element.style.top=e+"px"):this.dlgObj.element.style.top="0px",!this.options.isResponsiveFilter&&F.isDevice&&window.innerWidth<440&&(this.dlgObj.element.style.width="90%"),this.parent.notify(NI,{column:t,dialog:this.dialogObj}),this.dlgObj.show(),WB(this.parent.element,this.dlgObj.element.parentElement)},$q.prototype.renderCustomFilter=function(e,t){var i=this.dlgObj.element.querySelector(".e-xlfl-maindiv"),n=this.parent.createElement("div",{innerHTML:this.getLocalizedLabel("ShowRowsWhere"),className:"e-xlfl-dlgfields"}),n=(i.appendChild(n),this.parent.createElement("div",{innerHTML:this.options.displayName,className:"e-xlfl-fieldset"}));i.appendChild(n),this.renderFilterUI(t,i)},$q.prototype.filterBtnClick=function(e){var t,i=!je(e)&&hB(e),n=!je(e)&&dB(e),i=i?n:e,n=this.dlgDiv.querySelector("#"+i+"-xlfl-frstvalue").ej2_instances[0],e=this.dlgDiv.querySelector("#"+i+"-xlfl-frstoptr").ej2_instances[0],o=this.dlgDiv.querySelector("#"+i+"-xlfl-secndvalue").ej2_instances[0],r=this.dlgDiv.querySelector("#"+i+"-xlfl-secndoptr").ej2_instances[0];"string"===this.options.type&&(t=this.dlgDiv.querySelector("#"+i+"-xlflmtcase").ej2_instances[0].checked);i=this.dlgDiv.querySelector("#"+i+"e-xlfl-frstpredicate").ej2_instances[0].checked?"and":"or";this.filterByColumn(this.options.field,e.value,n.value,i,t,this.options.ignoreAccent,r.value,o.value),this.removeDialog()},$q.prototype.filterByColumn=function(e,t,i,n,o,r,s,a){var l=this.parent.getColumnByField?this.parent.getColumnByField(e):this.options.column,h=this.isForeignColumn(l)?l.foreignKeyValue:e,d=[],e={instance:this,handler:this.filterByColumn,arg1:e,arg2:t,arg3:i,arg4:n,arg5:o,arg6:r,arg7:s,arg8:a,cancel:!1};this.parent.notify(jI,e),e.cancel||(d.push({field:h,predicate:n,matchCase:o,ignoreAccent:r,operator:t,value:e.arg3,type:this.options.type}),i=new ba(h,t.toLowerCase(),e.arg3,!o,r),je(s)||(d.push({field:h,predicate:n,matchCase:o,ignoreAccent:r,operator:s,value:e.arg8,type:this.options.type}),i=i[""+n](h,s.toLowerCase(),a,!o,r)),t={action:"filtering",filterCollection:d,field:this.options.field,ejpredicate:i,actualPredicate:d},this.isForeignColumn(l)?this.foreignKeyFilter(t,d,i):this.options.handler(t))},$q.prototype.renderOperatorUI=function(e,t,i,n,o){var r=this.parent.createElement("tr",{className:"e-xlfl-fields",attrs:{role:"row"}}),t=(t.appendChild(r),this.parent.createElement("td",{className:"e-xlfl-optr"})),s=(r.appendChild(t),this.parent.createElement("div",{className:"e-xlfl-optrdiv"})),a=!je(e)&&hB(e),l=!je(e)&&dB(e),a=this.parent.createElement("input",{id:a?l+i:e+i}),l=(s.appendChild(a),t.appendChild(s),this.options.type+"Operator"),e=this.customFilterOperators[l],i=(this.optrData=e,this.dropSelectedVal(this.options.column,n,o)),s=(this.menuItem&&((t=this.menuItem.text.slice(0,-3))!==this.getLocalizedLabel("CustomFilter")&&(i=o?t:void 0),t===this.getLocalizedLabel("Between"))&&(i=this.getLocalizedLabel(o?"GreaterThanOrEqual":"LessThanOrEqual")),this.options.column),l=new qz(jP({dataSource:e,fields:{text:"text",value:"value"},text:i,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass||null},s.filter.params)),n=(this.childRefs.unshift(l),{open:this.dropDownOpen.bind(this),change:this.dropDownValueChange.bind(this)});return IF(a.id,[sD,aD],n,this),l.addEventListener(sD,this.eventHandlers[a.id][sD]),l.addEventListener(aD,this.eventHandlers[a.id][aD]),l.appendTo(a),{fieldElement:r,operator:this.getSelectedValue(i)}},$q.prototype.removeHandlersFromComponent=function(e){e.element.classList.contains("e-dropdownlist")?TF(e,[sD,aD],this):e.element.classList.contains("e-autocomplete")&&TF(e,[QA,lD],this)},$q.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},$q.prototype.dropDownValueChange=function(e){e.element.id.includes("-xlfl-frstoptr")?this.firstOperator=e.value.toString():this.secondOperator=e.value.toString();var t=e.element.closest(".e-xlfl-fields").children[1].querySelector(".e-control"),e=e.element.ej2_instances[0];"isempty"===e.value||"isnotempty"===e.value||"isnull"===e.value||"isnotnull"===e.value?t.ej2_instances[0].enabled=!1:je(t.getAttribute("disabled"))||(t.ej2_instances[0].enabled=!0)},$q.prototype.getFilterUIInfo=function(){return{firstOperator:this.firstOperator,secondOperator:this.secondOperator,field:this.options.field}},$q.prototype.getSelectedValue=function(e){e=new me(this.optrData).executeLocal((new ya).where("text","equal",e));return je(e[0])?"":e[0].value},$q.prototype.dropSelectedVal=function(e,t,i){t=t&&0<t.length?2===t.length?(i?t[0]:t[1]).operator:i?t[0].operator:void 0:i&&"string"===e.type&&!e.filter.operator?"startswith":i?e.filter.operator||"equal":void 0;return this.getSelectedText(t)},$q.prototype.getSelectedText=function(e){e=new me(this.optrData).executeLocal((new ya).where("value","equal",e));return je(e[0])?"":e[0].text},$q.prototype.renderFilterUI=function(e,t){var i=this.existingPredicate[""+e],n=this.parent.createElement("table",{className:"e-xlfl-table",attrs:{role:"grid"}}),t=(t.appendChild(n),this.parent.createElement(rD)),t=(t.innerHTML='<col style="width: 50%"></col><col style="width: 50%"></col>',n.appendChild(t),this.renderOperatorUI(e,n,"-xlfl-frstoptr",i,!0)),o=(this.firstOperator=t.operator,this.renderFlValueUI(e,t,"-xlfl-frstvalue",i,!0),this.parent.createElement("tr",{className:"e-xlfl-predicate",attrs:{role:"row"}}));n.appendChild(o),this.renderRadioButton(e,o,i),t=this.renderOperatorUI(e,n,"-xlfl-secndoptr",i,!1),this.secondOperator=t.operator,this.renderFlValueUI(e,t,"-xlfl-secndvalue",i,!1)},$q.prototype.renderRadioButton=function(e,t,i){var n=this.parent.createElement("td",{className:"e-xlfl-radio",attrs:{colSpan:"2"}}),o=(t.appendChild(n),this.parent.createElement("div",{className:"e-xlfl-radiodiv"})),r=(o.style.display="inline-block",!je(e)&&hB(e)),s=!je(e)&&dB(e),a=this.parent.createElement("input",{id:r?s+"e-xlfl-frstpredicate":e+"e-xlfl-frstpredicate",attrs:{type:"radio"}}),r=this.parent.createElement("input",{id:r?s+"e-xlfl-secndpredicate":e+"e-xlfl-secndpredicate",attrs:{type:"radio"}}),s=(o.appendChild(a),o.appendChild(r),n.appendChild(o),"string"===this.options.type&&this.renderMatchCase(e,t,n,"-xlflmtcase",i),new cb({label:this.getLocalizedLabel("AND"),name:"default",checked:!0,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass||""})),o=(this.childRefs.unshift(s),new cb({label:this.getLocalizedLabel("OR"),name:"default",enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass||""}));this.childRefs.unshift(o),"and"===(i&&2===i.length?i[1].predicate:"and")?(s.checked=!0,o.checked=!1):(o.checked=!0,s.checked=!1),s.appendTo(a),o.appendTo(r),s.element.nextElementSibling.classList.add("e-xlfl-radio-and"),o.element.nextElementSibling.classList.add("e-xlfl-radio-or")},$q.prototype.removeObjects=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];n&&!n.isDestroyed&&(this.removeHandlersFromComponent(n),n.destroy())}},$q.prototype.renderFlValueUI=function(t,e,i,n,o){var r,s,a=this.parent.createElement("td",{className:"e-xlfl-value"}),l=(e.fieldElement.appendChild(a),!je(t)&&hB(t)),h=!je(t)&&dB(t),d=this.parent.createElement("div",{className:"e-xlfl-valuediv"}),p=this.options.filteredColumns.some(function(e){return t===e.field}),c=this.options.filteredColumns.filter(function(e){return e.field===t});this.options.column.filterTemplate?(s={},r=this.options.column,p&&i&&(s=this.getExcelFilterData(i,s,r,n,c)),p=this.parent.isReact&&"string"!=typeof this.options.column.filterTemplate&&!(this.options.column.filterTemplate.prototype&&this.options.column.filterTemplate.prototype.CSPTemplate),c=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,r=this.parent.element.id+r.uid+"filterTemplate",p||c?this.options.column.getFilterTemplate()(s,this.parent,"filterTemplate",r,null,null,d):(s=this.options.column.getFilterTemplate()(s,this.parent,"filterTemplate",r,null,null,null,this.parent.root),eB(d,s)),p||c?this.parent.renderTemplates(function(){d.querySelector("input").id=l?h+i:t+i,a.appendChild(d)}):((this.parent.isAngular?d.children[0]:d.querySelector("input")).id=l?h+i:t+i,a.appendChild(d))):(r=this.parent.createElement("input",{id:l?h+i:t+i}),d.appendChild(r),s=void a.appendChild(d),p=void 0,n&&0<n.length&&je(s=(p=2===n.length?o?n[0]:n[1]:o?n[0]:void 0)&&p.operator===e.operator?p.value:void 0)&&(s=void 0),{string:this.renderAutoComplete.bind(this),number:this.renderNumericTextBox.bind(this),date:this.renderDate.bind(this),dateonly:this.renderDate.bind(this),datetime:this.renderDateTime.bind(this)}[this.options.type](this.options,t,r,s,this.parent.enableRtl))},$q.prototype.getExcelFilterData=function(e,t,i,n,o){var r="-xlfl-frstvalue"===e?0:1;return("-xlfl-frstvalue"===e||1<o.length)&&(t={column:n instanceof Array?n[parseInt(r.toString(),10)]:n},e=this.options.column.columnData&&1<o.length?1===this.options.column.columnData.length?0:1:r,t[this.options.field]=i.foreignKeyValue?this.options.column.columnData[parseInt(e.toString(),10)][i.foreignKeyValue]:o[parseInt(e.toString(),10)].value,this.options.foreignKeyValue)&&(t[this.options.foreignKeyValue]=this.options.column.columnData[parseInt(e.toString(),10)][i.foreignKeyValue]),t},$q.prototype.renderMatchCase=function(e,t,i,n,o){var r=this.parent.createElement("div",{className:"e-xlfl-matchcasediv"}),s=(r.style.display="inline-block",!je(e)&&hB(e)),a=!je(e)&&dB(e),s=this.parent.createElement("input",{id:s?a+n:e+n,attrs:{type:"checkbox"}}),a=(r.appendChild(s),i.appendChild(r),!!(o&&0<o.length)&&(o&&2===o.length?o[1]:o[0]).matchCase),e=new ib({label:this.getLocalizedLabel("MatchCase"),enableRtl:this.parent.enableRtl,checked:a,cssClass:this.parent.cssClass||""});this.childRefs.unshift(e),e.appendTo(s)},$q.prototype.renderDate=function(e,t,i,n,o){var r=LB(e.format,e.type)||e.format,r=new o9(jP({format:r,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:o,value:new Date(n),locale:this.parent.locale},e.column.filter.params));this.childRefs.unshift(r),r.appendTo(i)},$q.prototype.renderDateTime=function(e,t,i,n,o){var r=LB(e.format,e.type),r=new jq(jP({format:r,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:o,value:new Date(n),locale:this.parent.locale},e.column.filter.params));this.childRefs.unshift(r),r.appendTo(i)},$q.prototype.completeAction=function(e){e.result=bB(e.result)},$q.prototype.renderNumericTextBox=function(e,t,i,n,o){o=new NL(jP({format:e.format,placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:o,value:n,locale:this.parent.locale,cssClass:this.parent.cssClass||null},e.column.filter.params));this.childRefs.unshift(o),o.appendTo(i)},$q.prototype.renderAutoComplete=function(e,t,i,n,o){var r=this.options.column,s=this.isForeignColumn(r),a=(s?r:e).dataSource,s={value:s?r.foreignKeyValue:t},l=new lU(jP({dataSource:a instanceof me?a:new me(a),fields:s,query:this.getQuery(),sortOrder:"Ascending",locale:this.parent.locale,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",autofill:!0,placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:o,text:n},r.filter.params)),o=(a&&"result"in a&&(s=JB({requestType:"stringfilterrequest"},this.getQuery()),this.parent.trigger(yI,s.state),s.deffered.promise.then(function(e){l.dataSource=new me(e)})),this.childRefs.unshift(l),{actionComplete:this.acActionComplete(l,t),focus:this.acFocus(l,t,e,i)});IF(i.id,[QA,lD],o,this),l.addEventListener(lD,this.eventHandlers[i.id][lD]),l.addEventListener(QA,this.eventHandlers[i.id][QA]),l.appendTo(i)},$q.prototype.acActionComplete=function(o,t){return function(e){var n=!je(t)&&hB(t);e.result=e.result.filter(function(e,t,i){return i.map(function(e){return n?bF(o.fields.value,e):e[o.fields.value]}).indexOf(n?bF(o.fields.value,e):e[o.fields.value])===t})}},$q.prototype.acFocus=function(i,n,o,r){var s=this;return function(){var e=!je(n)&&hB(n),t=!je(n)&&dB(n),e=e?t:n;i.filterType=s.dlgDiv.querySelector("#"+e+(r.id===e+"-xlfl-frstvalue"?"-xlfl-frstoptr":"-xlfl-secndoptr")).ej2_instances[0].value,i.ignoreCase="string"!==o.type||!s.dlgDiv.querySelector("#"+e+"-xlflmtcase").ej2_instances[0].checked,i.filterType=je(i.filterType)?"equal":i.filterType}};var Kq,Jq,Zq=$q;function $q(e,t){e=Jq.call(this,e)||this;return e.childRefs=[],e.eventHandlers={},e.isDevice=!1,e.focusedMenuItem=null,e.customFilterOperators=t,e.isExcel=!0,e}tG.prototype.updateModel=function(){var e={field:this.columnName,direction:this.direction},t=this.parent.groupSettings.columns,i=!1;if(this.isMultiSort)-1<(a=this.getSortedColsIndexByField(this.columnName))&&this.sortSettings.columns.splice(a,1),this.sortSettings.columns.push(e),this.sortSettings.columns=this.sortSettings.columns;else if(t.length){for(var n=[],o=0,r=t.length;o<r;o++){var s,a=this.getSortedColsIndexByField(t[parseInt(o.toString(),10)],n);this.columnName===t[parseInt(o.toString(),10)]?(i=!0,n.push(e)):(s=this.getSortColumnFromField(t[parseInt(o.toString(),10)]),n.push({field:s.field,direction:s.direction,isFromGroup:s.isFromGroup}))}i||n.push(e),this.sortSettings.columns=n}else this.sortSettings.columns=[e];this.parent.dataBind(),this.lastSortedCol=this.columnName},tG.prototype.onActionComplete=function(e){var t=this.isRemove?{requestType:"sorting",type:QA}:{columnName:this.columnName,direction:this.direction,requestType:"sorting",type:QA};this.isRemove=!1,this.parent.trigger(QA,Pe(e,t))},tG.prototype.sortColumn=function(e,t,i){var n=this.parent;!1===this.parent.getColumnByField(e).allowSorting||this.parent.isContextMenuOpen()?this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:e}):(n.allowMultiSorting||(i=n.allowMultiSorting),this.isActionPrevent()?n.notify(zx,{instance:this,handler:this.sortColumn,arg1:e,arg2:t,arg3:i}):(this.backupSettings(),this.columnName=e,this.direction=t,this.isMultiSort=i,this.removeSortIcons(),this.updateSortedCols(e,i),this.updateModel()))},tG.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,NA.isSort)},tG.prototype.backupSettings=function(){this.lastSortedCols=_P(this.sortSettings.columns),this.lastCols=this.sortedColumns},tG.prototype.restoreSettings=function(){this.isModelChanged=!1,this.isMultiSort=!0,this.parent.setProperties({sortSettings:{columns:this.lastSortedCols}},!0),this.sortedColumns=this.lastCols,this.isModelChanged=!0},tG.prototype.updateSortedCols=function(e,t){if(!t)if(this.parent.allowGrouping)for(var i=0,n=this.sortedColumns.length;i<n;i++)this.parent.groupSettings.columns.indexOf(this.sortedColumns[parseInt(i.toString(),10)])<0&&(this.sortedColumns.splice(i,1),n--,i--);else this.sortedColumns.splice(0,this.sortedColumns.length);this.sortedColumns.indexOf(e)<0&&this.sortedColumns.push(e)},tG.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&(this.contentRefresh&&(e=this.sortSettings.columns.length?{columnName:this.columnName,direction:this.direction,requestType:"sorting",type:WA,target:this.currentTarget,cancel:!1}:{requestType:"sorting",type:WA,cancel:!1,target:this.currentTarget},this.parent.notify($1,e)),this.refreshSortSettings(),this.removeSortIcons(),this.addSortIcons())},tG.prototype.refreshSortSettings=function(){this.sortedColumns.length=0;for(var e=this.sortSettings.columns,t=0;t<e.length;t++)e[parseInt(t.toString(),10)].isFromGroup||this.sortedColumns.push(e[parseInt(t.toString(),10)].field)},tG.prototype.clearSorting=function(){var e=XP(this.sortSettings.columns);if(this.isActionPrevent())this.parent.notify(zx,{instance:this,handler:this.clearSorting});else for(var t=0,i=e.length;t<i;t++)this.removeSortColumn(e[parseInt(t.toString(),10)].field)},tG.prototype.isActionPrevent=function(){return mB(this.parent)},tG.prototype.removeSortColumn=function(e){var t=this.parent,i=this.sortSettings.columns;if(!(0===i.length&&this.sortedColumns.indexOf(e)<0))if(this.isActionPrevent())this.parent.notify(zx,{instance:this,handler:this.removeSortColumn,arg1:e});else{this.backupSettings(),this.removeSortIcons();for(var n={requestType:"sorting",type:WA,target:this.currentTarget},o=0,r=i.length;o<r;o++)if(i[parseInt(o.toString(),10)].field===e&&!(t.allowGrouping&&-1<t.groupSettings.columns.indexOf(i[parseInt(o.toString(),10)].field))){this.sortedColumns.splice(this.sortedColumns.indexOf(i[parseInt(o.toString(),10)].field),1),i.splice(o,1),this.isRemove=!0,this.isModelChanged&&this.parent.notify($1,n);break}n.cancel||this.addSortIcons()}},tG.prototype.getSortedColsIndexByField=function(e,t){for(var i=t||this.sortSettings.columns,n=0,o=i.length;n<o;n++)if(i[parseInt(n.toString(),10)].field===e)return n;return-1},tG.prototype.getModuleName=function(){return"sort"},tG.prototype.initialEnd=function(){if(this.parent.off(X1,this.initialEnd),this.parent.getColumns().length&&this.sortSettings.columns.length){var e=this.parent;this.contentRefresh=!1,this.isMultiSort=1<this.sortSettings.columns.length;for(var t=0,i=e.sortSettings.columns.slice();t<i.length;t++){var n=i[t];-1<this.sortedColumns.indexOf(n.field)&&this.sortColumn(n.field,n.direction,!0)}this.isMultiSort=!1,this.contentRefresh=!0}},tG.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:WT,handler:this.setFullScreenDialog},{event:vE,handler:this.renderResponsiveChangeAction},{event:X1,handler:this.initialEnd},{event:nx,handler:this.onActionComplete},{event:Z1,handler:this.onPropertyChanged},{event:wx,handler:this.clickHandler},{event:tx,handler:this.refreshSortIcons},{event:bx,handler:this.keyPressed},{event:AI,handler:this.cancelBeginEvent},{event:Cx,handler:this.destroy}],CF(this.parent,this.evtHandlers,!0,this),E.add(document.body,"click",this.excelFilterSortAction,this),E.add(document.body,"touchend",this.excelFilterSortAction,this))},tG.prototype.removeEventListener=function(){this.parent.isDestroyed||(CF(this.parent,this.evtHandlers,!1),E.remove(document.body,"click",this.excelFilterSortAction),E.remove(document.body,"touchend",this.excelFilterSortAction))},tG.prototype.excelFilterSortAction=function(e){var t=A(e.target,"e-grid-popup"),i=this.parent.element.id+"_e-popup";t&&t.id===i&&A(e.target,"e-excelfilter")&&this.excelFilterSortActionHandler(e)},tG.prototype.destroy=function(){this.isModelChanged=!1;var e=this.parent.element;e&&(e.querySelector("."+RE)||e.querySelector("."+OE))&&(this.parent.element.querySelector(".e-gridpopup").getElementsByClassName("e-sortdirect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none"),this.parent.refreshing||!this.parent.isDestroyed&&this.parent.allowSorting||this.clearSorting(),this.isModelChanged=!0,this.removeEventListener())},tG.prototype.cancelBeginEvent=function(e){"sorting"===e.requestType&&(this.restoreSettings(),this.refreshSortIcons(),this.isMultiSort=!0)},tG.prototype.clickHandler=function(e){var t=this.parent,i=(this.currentTarget=null,this.popUpClickHandler(e),z(e.target,".e-headercell"));!i||e.target.classList.contains("e-grptogglebtn")||i.classList.contains("e-resized")||e.target.classList.contains("e-rhandler")||e.target.classList.contains("e-columnmenu")||e.target.classList.contains("e-filtermenudiv")||A(e.target,"e-stackedheadercell")||t.allowSelection&&t.selectionSettings.allowColumnSelection&&e.target.classList.contains("e-headercell")||"checkbox"!==(t=this.parent.getColumnByUid(i.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"))).type&&(this.initiateSort(i,e,t),F.isDevice)&&this.showPopUp(e),i&&i.classList.remove("e-resized"),this.excelFilterSortActionHandler(e)},tG.prototype.excelFilterSortActionHandler=function(e){var t;(A(e.target,"e-excel-ascending")||A(e.target,"e-excel-descending"))&&(t=z(e.target,".e-filter-popup").getAttribute("uid"),e=je(A(e.target,"e-excel-descending"))?"Ascending":"Descending",this.sortColumn(this.parent.getColumnByUid(t).field,e,!1))},tG.prototype.keyPressed=function(e){var t,i=e.target;this.parent.isEdit||"enter"!==e.action&&"ctrlEnter"!==e.action&&"shiftEnter"!==e.action||!z(i,".e-headercell")||!je(i=this.focus.getFocusedElement())&&i.classList.contains("e-headercell")&&i.querySelector(".e-headercelldiv")&&(t=this.parent.getColumnByUid(i.querySelector(".e-headercelldiv").getAttribute("e-mappinguid")),this.initiateSort(i,e,t))},tG.prototype.initiateSort=function(e,t,i){var n=this.parent,i=i.field,o=(this.currentTarget=t.target,e.getElementsByClassName("e-ascending").length?"Descending":"Ascending");this.isMultiSort=t.ctrlKey||this.enableSortMultiTouch||-1!==navigator.userAgent.indexOf("Mac OS")&&t.metaKey,t.shiftKey||this.sortSettings.allowUnsort&&e.getElementsByClassName("e-descending").length&&!(-1<n.groupSettings.columns.indexOf(i))?this.removeSortColumn(i):this.sortColumn(i,o,this.isMultiSort)},tG.prototype.showPopUp=function(e){var t=z(e.target,".e-headercell");!this.parent.allowMultiSorting||je(t)&&!this.parent.isContextMenuOpen()||UP(this.parent.element.querySelector(".e-gridpopup"),e,"e-sortdirect e-icons e-icon-sortdirect"+(1<this.sortedColumns.length?" e-spanclicked":""))},tG.prototype.popUpClickHandler=function(e){var t=e.target;z(t,".e-headercell")||e.target.classList.contains(LE)||z(t,".e-gridpopup")?t.classList.contains("e-sortdirect")&&(t.classList.contains("e-spanclicked")?(t.classList.remove("e-spanclicked"),this.enableSortMultiTouch=!1,this.parent.element.querySelector(".e-gridpopup").style.display="none"):(t.classList.add("e-spanclicked"),this.enableSortMultiTouch=!0)):this.parent.element.querySelector(".e-gridpopup").style.display="none"},tG.prototype.addSortIcons=function(){for(var e,t=this.parent,i=this.sortSettings.columns,n=this.parent.getColumns().map(function(e){return e.field}),o=0,r=i.length;o<r;o++)e=t.getColumnHeaderByField(i[parseInt(o.toString(),10)].field),-1===n.indexOf(i[parseInt(o.toString(),10)].field)||je(e)||(this.aria.setSort(e,i[parseInt(o.toString(),10)].direction.toLowerCase()),1<i.length&&e.querySelector(".e-headercelldiv").insertBefore(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(o+1).toString()}),e.querySelector(".e-headertext")),e=e.querySelector(".e-sortfilterdiv"),"Ascending"===i[parseInt(o.toString(),10)].direction?mt(e,["e-ascending","e-icon-ascending"],[]):mt(e,["e-descending","e-icon-descending"],[]))},tG.prototype.removeSortIcons=function(e){for(var t,i=this.parent,n=this.sortSettings.columns,o=this.parent.getColumns().map(function(e){return e.field}),r=e||0,s=je(e)?n.length:e+1;r<s;r++)je(t=i.getColumnHeaderByField(n[parseInt(r.toString(),10)].field))||i.allowGrouping&&-1<i.groupSettings.columns.indexOf(n[parseInt(r.toString(),10)].field)&&!t.querySelector(".e-sortfilterdiv")||-1!==o.indexOf(n[parseInt(r.toString(),10)].field)&&(this.aria.setSort(t,"none"),mt(t.querySelector(".e-sortfilterdiv"),[],["e-descending","e-icon-descending","e-ascending","e-icon-ascending"]),t.querySelector(".e-sortnumber"))&&t.querySelector(".e-headercelldiv").removeChild(t.querySelector(".e-sortnumber"))},tG.prototype.getSortColumnFromField=function(e){for(var t=0,i=this.sortSettings.columns.length;t<i;t++)if(this.sortSettings.columns[parseInt(t.toString(),10)].field===e)return this.sortSettings.columns[parseInt(t.toString(),10)];return!1},tG.prototype.updateAriaAttr=function(){for(var e=this.parent.getColumns().map(function(e){return e.field}),t=0,i=this.sortedColumns;t<i.length;t++){var n,o=i[t];-1!==e.indexOf(o)&&(n=this.parent.getColumnHeaderByField(o),this.aria.setSort(n,this.getSortColumnFromField(o).direction))}},tG.prototype.refreshSortIcons=function(){this.removeSortIcons(),this.isMultiSort=!0,this.removeSortIcons(),this.addSortIcons(),this.isMultiSort=!1,this.updateAriaAttr()},tG.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},tG.prototype.showCustomSort=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog()};var eG=tG;function tG(e,t,i,n){this.contentRefresh=!0,this.isModelChanged=!0,this.aria=new HD,this.currentTarget=null,this.parent=e,this.sortSettings=t,this.sortedColumns=i,this.serviceLocator=n,this.focus=n.getService("focus"),this.addEventListener(),this.setFullScreenDialog()}nG.prototype.render=function(){this.pagerElement=this.pagerModule.element,this.renderNumericContainer(),this.refreshNumericLinks(),this.wireEvents()},nG.prototype.refresh=function(){this.pagerModule.updateTotalPages(),this.links.length&&this.updateLinksHtml(),this.refreshAriaAttrLabel(),this.updateStyles()},nG.prototype.refreshNumericLinks=function(){var e,t=this.pagerModule,i=t.element.querySelector(".e-numericcontainer"),n=document.createDocumentFragment();i.innerHTML="";for(var o=1;o<=t.pageCount;o++)e=Q("a",{className:"e-link e-numericitem e-spacing e-pager-default",attrs:{tabindex:"-1","aria-label":t.getLocalizedLabel("Page")+o+t.getLocalizedLabel("Of")+t.totalPages+t.getLocalizedLabel("Pages"),href:"#"}}),t.currentPage===o&&(mt(e,["e-currentitem","e-active"],["e-pager-default"]),e.setAttribute("aria-current","page")),n.appendChild(e);i.appendChild(n),this.links=[].slice.call(i.childNodes)},nG.prototype.wireEvents=function(){E.add(this.pagerElement,"click",this.clickHandler,this),E.add(this.pagerElement,"auxclick",this.auxiliaryClickHandler,this)},nG.prototype.unwireEvents=function(){E.remove(this.pagerModule.element,"click",this.clickHandler),E.remove(this.pagerModule.element,"auxclick",this.auxiliaryClickHandler)},nG.prototype.destroy=function(){this.unwireEvents()},nG.prototype.refreshAriaAttrLabel=function(){for(var e=this.pagerModule,t=e.element.querySelector(".e-numericcontainer").querySelectorAll("a"),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].hasAttribute("aria-label")&&t[parseInt(i.toString(),10)].hasAttribute("index")&&t[parseInt(i.toString(),10)].setAttribute("aria-label",e.getLocalizedLabel("Page")+t[parseInt(i.toString(),10)].getAttribute("index")+e.getLocalizedLabel("Of")+e.totalPages+e.getLocalizedLabel("Pages"))},nG.prototype.renderNumericContainer=function(){this.element=Q("div",{className:"e-pagercontainer",attrs:{role:"navigation"}}),this.renderFirstNPrev(this.element),this.renderPrevPagerSet(this.element),this.element.appendChild(Q("div",{className:"e-numericcontainer"})),this.renderNextPagerSet(this.element),this.renderNextNLast(this.element),this.pagerModule.element.appendChild(this.element)},nG.prototype.renderFirstNPrev=function(e){this.first=Q("div",{className:"e-first e-icons e-icon-first",attrs:{title:this.pagerModule.getLocalizedLabel("firstPageTooltip"),tabindex:"-1",role:"button"}}),this.prev=Q("div",{className:"e-prev e-icons e-icon-prev",attrs:{title:this.pagerModule.getLocalizedLabel("previousPageTooltip"),tabindex:"-1",role:"button"}}),ht([this.first,this.prev],e)},nG.prototype.renderPrevPagerSet=function(e){var t=Q("div");this.PP=Q("a",{className:"e-link e-pp e-spacing",innerHTML:"...",attrs:{title:this.pagerModule.getLocalizedLabel("previousPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("previousPagerTooltip"),tabindex:"-1",href:"#"}}),t.appendChild(this.PP),e.appendChild(t)},nG.prototype.renderNextPagerSet=function(e){var t=Q("div");this.NP=Q("a",{className:"e-link e-np e-spacing",innerHTML:"...",attrs:{title:this.pagerModule.getLocalizedLabel("nextPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("nextPagerTooltip"),tabindex:"-1",href:"#"}}),t.appendChild(this.NP),e.appendChild(t)},nG.prototype.renderNextNLast=function(e){this.next=Q("div",{className:"e-next e-icons e-icon-next",attrs:{title:this.pagerModule.getLocalizedLabel("nextPageTooltip"),tabindex:"-1",role:"button"}}),this.last=Q("div",{className:"e-last e-icons e-icon-last",attrs:{title:this.pagerModule.getLocalizedLabel("lastPageTooltip"),tabindex:"-1",role:"button"}}),ht([this.next,this.last],e)},nG.prototype.clickHandler=function(e){var t=this.pagerModule;return this.target=e.target,this.target.classList.contains("e-numericitem")&&e.preventDefault(),t.previousPageNo=t.currentPage,this.target.classList.contains("e-disable")||je(this.target.getAttribute("index"))||(t.currentPage=parseInt(this.target.getAttribute("index"),10),this.pagerModule.isInteracted=!0,t.dataBind()),!1},nG.prototype.auxiliaryClickHandler=function(e){this.target=e.target,this.target.classList.contains("e-numericitem")&&1===e.button&&e.preventDefault()},nG.prototype.updateLinksHtml=function(){var e,t=this.pagerModule,i=this.pagerElement.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)');t.currentPage=1===t.totalPages?1:t.currentPage,t.currentPage>t.totalPages&&t.totalPages&&(t.currentPage=t.totalPages),e=parseInt((t.currentPage/t.pageCount).toString(),10),t.currentPage%t.pageCount==0&&0<e&&(e-=1);for(var n=0;n<t.pageCount;n++){if(t.isPagerResized){var o=this.pagerElement.querySelector(".e-focus"),o=this.target||o||null,r=!1,s=!1,a=!1,l=!1,h=!1,d=!1,p=!1;if(o){var c=o.classList;if(c.contains("e-icons"))switch(!0){case c.contains("e-prev"):r=!0;break;case c.contains("e-next"):s=!0;break;case c.contains("e-first"):a=!0;break;case c.contains("e-last"):l=!0}else if(c.contains("e-numericitem"))switch(!0){case c.contains("e-np"):d=!0;break;case c.contains("e-pp"):p=!0;break;default:h=c.contains("e-numericitem")}}var u=l||"End"===this.pagerModule.keyAction,i=this.pagerElement.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)'),o=Array.from(i).some(function(e){return parseInt(e.getAttribute("index"),10)===t.currentPage}),o=a||"Home"===this.pagerModule.keyAction?1+n:l||"End"===this.pagerModule.keyAction?e*t.pageCount+1+n:s||"ArrowRight"===this.pagerModule.keyAction||r||"ArrowLeft"===this.pagerModule.keyAction?o?parseInt(i[0].getAttribute("index"),10)+n:r||"ArrowLeft"===this.pagerModule.keyAction?parseInt(this.PP.getAttribute("index"),10)+n:t.currentPage+n:d||p?t.currentPage+n:h?parseInt(i[0].getAttribute("index"),10)+n:e*t.pageCount+1+n}else o=e*t.pageCount+1+n;o<=t.totalPages?(this.links[parseInt(n.toString(),10)].classList.remove("e-hide"),this.links[parseInt(n.toString(),10)].style.display="",this.links[parseInt(n.toString(),10)].setAttribute("index",o.toString()),this.links[parseInt(n.toString(),10)].innerHTML=t.customText?t.customText+o:o.toString(),t.currentPage!==o?this.links[parseInt(n.toString(),10)].classList.add("e-pager-default"):this.links[parseInt(n.toString(),10)].classList.remove("e-pager-default")):(this.links[parseInt(n.toString(),10)].innerHTML=t.customText?t.customText+o:o.toString(),this.links[parseInt(n.toString(),10)].style.display="none"),mt(this.links[parseInt(n.toString(),10)],[],["e-currentitem","e-active"]),this.links[parseInt(n.toString(),10)].removeAttribute("aria-current")}pt(this.first,{index:"1",title:this.pagerModule.getLocalizedLabel("firstPageTooltip")}),pt(this.pagerElement.querySelector(".e-mfirst"),{index:"1",title:this.pagerModule.getLocalizedLabel("firstPageTooltip")}),pt(this.last,{index:t.totalPages.toString(),title:this.pagerModule.getLocalizedLabel("lastPageTooltip")}),pt(this.pagerElement.querySelector(".e-mlast"),{index:t.totalPages.toString(),title:this.pagerModule.getLocalizedLabel("lastPageTooltip")}),pt(this.prev,{index:(t.currentPage-1).toString(),title:this.pagerModule.getLocalizedLabel("previousPageTooltip")}),pt(this.pagerElement.querySelector(".e-mprev"),{index:(t.currentPage-1).toString(),title:this.pagerModule.getLocalizedLabel("previousPageTooltip")}),pt(this.next,{index:(t.currentPage+1).toString(),title:this.pagerModule.getLocalizedLabel("nextPageTooltip")}),pt(this.pagerElement.querySelector(".e-mnext"),{index:(t.currentPage+1).toString(),title:this.pagerModule.getLocalizedLabel("nextPageTooltip")});var g=this.pagerModule.isPagerResized&&i.length?u?parseInt(i[0].getAttribute("index"),10)-t.avgNumItems:parseInt(i[0].getAttribute("index"),10)-i.length:parseInt(this.links[0].getAttribute("index"),10)-t.pageCount,g=(pt(this.PP,{index:g<1?"1":g.toString(),title:this.pagerModule.getLocalizedLabel("previousPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("previousPagerTooltip")}),this.pagerModule.isPagerResized&&i.length?parseInt(i[i.length-1].getAttribute("index"),10):parseInt(this.links[this.links.length-1].getAttribute("index"),10));pt(this.NP,{index:(g+1).toString(),title:this.pagerModule.getLocalizedLabel("nextPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("nextPagerTooltip")}),this.target=void 0},nG.prototype.updateStyles=function(){var e,t=this;this.updateFirstNPrevStyles(),this.updatePrevPagerSetStyles(),this.updateNextPagerSetStyles(),this.updateNextNLastStyles(),this.links.length&&(e=this.links.findIndex(function(e){return e.getAttribute("index")===t.pagerModule.currentPage.toString()}),e=this.pagerModule.isPagerResized&&-1!==e?e:(this.pagerModule.currentPage-1)%this.pagerModule.pageCount,this.links[parseInt(e.toString(),10)])&&(mt(this.links[parseInt(e.toString(),10)],["e-currentitem","e-active"],[]),this.links[parseInt(e.toString(),10)].setAttribute("aria-current","page"))},nG.prototype.updateFirstNPrevStyles=function(){var e=["e-firstpage","e-pager-default"],t=["e-firstpagedisabled","e-disable"],i=["e-prevpage","e-pager-default"],n=["e-prevpagedisabled","e-disable"];0<this.pagerModule.totalPages&&1<this.pagerModule.currentPage?(mt(this.prev,i,n),mt(this.first,e,t),mt(this.pagerElement.querySelector(".e-mfirst"),e,t),mt(this.pagerElement.querySelector(".e-mprev"),i,n)):(mt(this.prev,n,i),mt(this.first,t,e),mt(this.pagerElement.querySelector(".e-mprev"),n,i),mt(this.pagerElement.querySelector(".e-mfirst"),t,e))},nG.prototype.updatePrevPagerSetStyles=function(){this.pagerModule.currentPage>this.pagerModule.pageCount||this.pagerModule.isPagerResized&&this.links.findIndex(function(e){return 1===parseInt(e.getAttribute("index"),10)})?mt(this.PP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"]):mt(this.PP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"])},nG.prototype.updateNextPagerSetStyles=function(){var t=this.pagerModule,e=this.links[0].innerHTML.replace(t.customText,""),i=this.pagerElement.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)');!e.length||!this.links.length||parseInt(e,10)+t.pageCount>t.totalPages||t.isPagerResized&&Array.from(i).some(function(e){return parseInt(e.getAttribute("index"),10)===t.totalPages})?mt(this.NP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]):mt(this.NP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"])},nG.prototype.updateNextNLastStyles=function(){var e=["e-lastpage","e-pager-default"],t=["e-lastpagedisabled","e-disable"],i=["e-nextpage","e-pager-default"],n=["e-nextpagedisabled","e-disable"],o=this.pagerModule;o.currentPage===o.totalPages||0===o.totalRecordsCount?(mt(this.last,t,e),mt(this.next,n,i),mt(this.pagerElement.querySelector(".e-mlast"),t,e),mt(this.pagerElement.querySelector(".e-mnext"),n,i)):(mt(this.last,e,t),mt(this.next,i,n),mt(this.pagerElement.querySelector(".e-mlast"),e,t),mt(this.pagerElement.querySelector(".e-mnext"),i,n))};var iG=nG;function nG(e){this.pagerModule=e}rG.prototype.render=function(){var e=Q("div",{className:"e-parentmsgbar"});this.pageNoMsgElem=Q("span",{className:"e-pagenomsg"}),this.pageNoMsgElem.style.textAlign="right",this.pageCountMsgElem=Q("span",{className:"e-pagecountmsg"}),this.pageCountMsgElem.style.textAlign="right",ht([this.pageNoMsgElem,this.pageCountMsgElem],e),this.pagerModule.element.appendChild(e),this.refresh()},rG.prototype.refresh=function(){var e=this.pagerModule;this.pageNoMsgElem.textContent=this.format(e.getLocalizedLabel("currentPageInfo"),[0===e.totalRecordsCount?0:e.currentPage,e.totalPages||0,e.totalRecordsCount||0])+" ",this.pageCountMsgElem.textContent=this.format(e.getLocalizedLabel(e.totalRecordsCount<=1?"totalItemInfo":"totalItemsInfo"),[e.totalRecordsCount||0,e.totalRecordsCount?e.pageSize*(e.currentPage-1)+1:0,e.pageSize*e.currentPage>e.totalRecordsCount?e.totalRecordsCount:e.pageSize*e.currentPage]),this.pageNoMsgElem.parentElement.classList.remove("e-hide")},rG.prototype.hideMessage=function(){this.pageNoMsgElem&&(this.pageNoMsgElem.style.display="none"),this.pageCountMsgElem&&(this.pageCountMsgElem.style.display="none")},rG.prototype.showMessage=function(){this.pageNoMsgElem||this.render(),this.pageNoMsgElem.style.display="",this.pageCountMsgElem.style.display=""},rG.prototype.destroy=function(){},rG.prototype.format=function(e,t){for(var i,n=RegExp,o=0;o<t.length;o++)i=new n("\\{"+o+"\\}","gm"),e=this.isValidLocale(this.pagerModule.locale)?e.replace(i,t[parseInt(o.toString(),10)].toLocaleString(this.pagerModule.locale)):e.replace(i,t[parseInt(o.toString(),10)].toString());return e},rG.prototype.isValidLocale=function(e){try{return new Intl.NumberFormat(e),!0}catch(e){return!1}};var oG=rG;function rG(e){this.pagerModule=e}sG=function(e,t){return(sG=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])}))(e,t)};var sG,aG,f7=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},lG=(function(e,t){function i(){this.constructor=e}sG(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(hG,aG=Ji),hG.prototype.requiredModules=function(){var e=[];return this.enableExternalMessage&&e.push({member:"externalMessage",args:[this],name:"ExternalMessage"}),this.checkpagesizes()&&e.push({member:"pagerdropdown",args:[this],name:"PagerDropDown"}),e},hG.prototype.preRender=function(){this.defaultConstants={currentPageInfo:"{0} of {1} pages",totalItemsInfo:"({0} items)",totalItemInfo:"({0} item)",firstPageTooltip:"Go to first page",lastPageTooltip:"Go to last page",nextPageTooltip:"Go to next page",previousPageTooltip:"Go to previous page",nextPagerTooltip:"Go to next pager items",previousPagerTooltip:"Go to previous pager items",pagerDropDown:"Items per page",pagerAllDropDown:"Items",CurrentPageInfo:"{0} of {1} pages",TotalItemsInfo:"({0} items)",FirstPageTooltip:"Go to first page",LastPageTooltip:"Go to last page",NextPageTooltip:"Go to next page",PreviousPageTooltip:"Go to previous page",NextPagerTooltip:"Go to next pager items",PreviousPagerTooltip:"Go to previous pager items",PagerDropDown:"Items per page",PagerAllDropDown:"Items",All:"All",Container:"Pager Container",Information:"Pager Information",ExternalMsg:"Pager external message",Page:"Page ",Of:" of ",Pages:" Pages"},this.containerModule=new iG(this),this.pagerMessageModule=new oG(this)},hG.prototype.render=function(){var e;this.element.setAttribute("data-role","pager"),this.element.setAttribute("tabindex","-1"),this.initLocalization(),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&this.element.classList.add("e-mac-safari"),this.cssClass&&(-1!==this.cssClass.indexOf(" ")?U([this.element],this.cssClass.split(" ")):U([this.element],[this.cssClass])),this.hasParent||this.element.setAttribute("tabindex","0"),this.enableQueryString&&!je(e=new URL(window.location.href).searchParams.get("page"))&&0<window.location.href.indexOf("?page=")&&(e=parseInt(e,10),this.hasParent&&this.parent.setProperties({pageSettings:{currentPage:e}},!0),this.currentPage=e),this.template?this.isReactTemplate()?(this.on(this.pageRefresh,this.pagerTemplate,this),this.notify(this.pageRefresh,{})):this.pagerTemplate():(this.updateRTL(),this.totalRecordsCount=this.totalRecordsCount||0,this.renderFirstPrevDivForDevice(),this.containerModule.render(),this.enablePagerMessage&&this.pagerMessageModule.render(),this.renderNextLastDivForDevice(),this.checkpagesizes()&&this.pagerdropdownModule&&this.pagerdropdownModule.render(),this.addAriaLabel(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.render(),this.refresh(),this.trigger("created",{currentPage:this.currentPage,totalRecordsCount:this.totalRecordsCount})),this.wireEvents(),this.addListener()},hG.prototype.getPersistData=function(){return this.addOnPersist(["currentPage","pageSize"])},hG.prototype.destroy=function(){this.isDestroyed||(this.isReactTemplate()&&(this.off(this.pageRefresh,this.pagerTemplate),this.hasParent||this.destroyTemplate(["pagerTemplate"])),this.removeListener(),this.unwireEvents(),aG.prototype.destroy.call(this),this.containerModule.destroy(),this.pagerMessageModule.destroy(),this.isReactTemplate())||(this.element.innerHTML="")},hG.prototype.destroyTemplate=function(e,t){this.clearTemplate(e,t)},hG.prototype.getModuleName=function(){return"pager"},hG.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed)if(e.pageSize===this.getLocalizedLabel("All")&&t.pageSize===this.totalRecordsCount)this.pageSize=this.totalRecordsCount;else{e.pageCount!==t.pageCount&&(this.containerModule.refreshNumericLinks(),this.containerModule.refresh());for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"currentPage":this.checkGoToPage(e.currentPage,t.currentPage)&&this.currentPageChanged(e,t);break;case"pageSize":case"totalRecordsCount":case"customText":this.checkpagesizes()&&this.pagerdropdownModule&&(t.pageSize!==e.pageSize&&(this.currentPage=1),this.pagerdropdownModule.setDropDownValue("value",this.pageSize)),e.pageSize!==t.pageSize?(this.pageSize=e.pageSize,this.currentPageChanged(e,t),this.isCancel&&this.hasParent&&this.parent.setProperties({pageSettings:{pageSize:t.pageSize}},!0)):this.refresh();break;case"pageSizes":this.checkpagesizes()&&this.pagerdropdownModule&&(this.pagerdropdownModule.destroy(),this.pagerdropdownModule.render()),this.refresh();break;case"template":this.templateFn=this.compile(this.template),this.refresh();break;case"locale":this.initLocalization(),this.refresh();break;case"enableExternalMessage":this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.render();break;case"externalMessage":this.externalMessageModule&&this.externalMessageModule.refresh();break;case"enableRtl":this.updateRTL();break;case"enablePagerMessage":this.enablePagerMessage?this.pagerMessageModule.showMessage():this.pagerMessageModule.hideMessage()}this.resizePager()}},hG.prototype.wireEvents=function(){this.hasParent||(E.add(this.element,"keydown",this.keyPressHandler,this),E.add(document.body,"keydown",this.keyDownHandler,this)),E.add(this.element,"focusin",this.onFocusIn,this),E.add(this.element,"focusout",this.onFocusOut,this),E.add(window,"resize",this.resizePager,this),E.add(window,"load",this.resizePager,this)},hG.prototype.unwireEvents=function(){this.hasParent||(E.remove(this.element,"keydown",this.keyPressHandler),E.remove(document.body,"keydown",this.keyDownHandler)),E.remove(this.element,"focusin",this.onFocusIn),E.remove(this.element,"focusout",this.onFocusOut),E.remove(window,"resize",this.resizePager),E.remove(window,"load",this.resizePager)},hG.prototype.onFocusIn=function(e){var t;je(this.getFocusedTabindexElement())&&(e=e.target,t=this.getDropDownPage(),this.hasParent||(this.element.tabIndex=-1),e!==this.element||this.hasParent?e===this.element?this.element.tabIndex=0:e===t||e.classList.contains("e-disable")||this.addFocus(e,!0):(t=this.getFocusablePagerElements(this.element,[]),this.addFocus(t[0],!0)))},hG.prototype.onFocusOut=function(e){var t=this.getFocusedElement(),i=this.getDropDownPage();je(t)||this.removeFocus(t,!0),this.pageSizes&&i&&i.classList.contains("e-input-focus")&&this.removeFocus(i,!0),this.setTabIndexForFocusLastElement(),this.hasParent||(this.element.tabIndex=0),this.hasParent&&(this.element.tabIndex=-1)},hG.prototype.keyDownHandler=function(e){e.altKey&&74===e.keyCode&&0<(e=this.getFocusablePagerElements(this.element,[])).length&&e[0].focus()},hG.prototype.keyPressHandler=function(e){var t=Pe(e,{cancel:!1});this.notify(bx,t),!0===t.cancel&&e.stopImmediatePropagation()},hG.prototype.addListener=function(){this.isDestroyed||this.hasParent||this.on(bx,this.onKeyPress,this)},hG.prototype.removeListener=function(){this.isDestroyed||this.hasParent||this.off(bx,this.onKeyPress)},hG.prototype.onKeyPress=function(e){this.hasParent||(this.checkPagerHasFocus()?this.changePagerFocus(e):(e.preventDefault(),this.setPagerFocus()))},hG.prototype.checkPagerHasFocus=function(){return!!this.getFocusedTabindexElement()},hG.prototype.setPagerContainerFocus=function(){this.element.focus()},hG.prototype.setPagerFocus=function(){var e=this.getFocusablePagerElements(this.element,[]);0<e.length&&e[0].focus()},hG.prototype.setPagerFocusForActiveElement=function(){var e=this.getActiveElement();e&&e.focus()},hG.prototype.setTabIndexForFocusLastElement=function(){var e=this.getFocusablePagerElements(this.element,[]),t=this.getDropDownPage();this.pageSizes&&t&&!je(t.offsetParent)?t.tabIndex=0:0<e.length&&(e[e.length-1].tabIndex=0)},hG.prototype.changePagerFocus=function(e){this.keyAction=e.key,e.shiftKey&&9===e.keyCode?this.changeFocusByShiftTab(e):9===e.keyCode?this.changeFocusByTab(e):13===e.keyCode||32===e.keyCode?this.navigateToPageByEnterOrSpace(e):37!==e.keyCode&&39!==e.keyCode&&35!==e.keyCode&&36!==e.keyCode||this.navigateToPageByKey(e),this.keyAction=""},hG.prototype.getFocusedTabindexElement=function(){for(var e,t=this.element.querySelectorAll('[tabindex]:not([tabindex="-1"])'),i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];if(n&&(n.classList.contains("e-focused")||n.classList.contains("e-input-focus"))){e=n;break}}return e},hG.prototype.changeFocusByTab=function(e){var t=this.getFocusedTabindexElement(),i=this.getFocusablePagerElements(this.element,[]),n=this.getDropDownPage();if(0<i.length)if(this.pageSizes&&n&&t===i[i.length-1])n.tabIndex=0;else for(var o=0;o<i.length;o++)if(t===i[parseInt(o.toString(),10)]){var r=o+1;r<i.length&&(e.preventDefault(),i[parseInt(r.toString(),10)].focus());break}},hG.prototype.changeFocusByShiftTab=function(e){var t=this.getFocusedTabindexElement(),i=this.getFocusablePagerElements(this.element,[]),n=this.getDropDownPage();if(this.pageSizes&&n&&n.classList.contains("e-input-focus"))n.tabIndex=-1,this.addFocus(i[i.length-1],!0);else if(0<i.length)for(var o=0;o<i.length;o++)if(t===i[parseInt(o.toString(),10)]){var r=o-1;0<=r?(e.preventDefault(),i[parseInt(r.toString(),10)].focus()):this.hasParent&&(r=(r=this.parent.getRows())[r.length-1].lastChild,e.preventDefault(),r.focus(),this.firstPagerFocus=!0);break}},hG.prototype.checkFirstPagerFocus=function(){return!!this.firstPagerFocus&&!(this.firstPagerFocus=!1)},hG.prototype.navigateToPageByEnterOrSpace=function(e){var t,i,n,o=this.getFocusedElement();o&&(this.goToPage(parseInt(o.getAttribute("index"),10)),t=this.getActiveElement(),i=this.getClass(o),n=this.getElementByClass(i),"e-first"!==i&&"e-prev"!==i&&"e-next"!==i&&"e-last"!==i&&"e-pp"!==i&&"e-np"!==i||!n||n.classList.contains("e-disable")?this.checkFocusInAdaptiveMode(o)?this.changeFocusInAdaptiveMode(o):t&&t.focus():n.focus())},hG.prototype.navigateToPageByKey=function(e){var e=37===e.keyCode?".e-prev":39===e.keyCode?".e-next":35===e.keyCode?".e-last":36===e.keyCode?".e-first":"",e=this.element.querySelector(e),t=this.getFocusedElement();je(e)||!e.hasAttribute("index")||isNaN(parseInt(e.getAttribute("index"),10))||(this.goToPage(parseInt(e.getAttribute("index"),10)),e=this.getActiveElement(),this.checkFocusInAdaptiveMode(t)?this.changeFocusInAdaptiveMode(t):e&&e.focus())},hG.prototype.checkFocusInAdaptiveMode=function(e){e=this.getClass(e);return"e-mfirst"===e||"e-mprev"===e||"e-mnext"===e||"e-mlast"===e},hG.prototype.changeFocusInAdaptiveMode=function(e){var e=this.getClass(e),t=this.getElementByClass(e);t&&t.classList.contains("e-disable")&&("e-mnext"===e||"e-mlast"===e?this.element.querySelector(".e-mprev").focus():this.setPagerFocus())},hG.prototype.removeTabindexLastElements=function(){var e=this.element.querySelectorAll('[tabindex]:not([tabindex="-1"])');if(1<e.length)for(var t=1;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i&&(i.tabIndex=-1)}},hG.prototype.getActiveElement=function(){return this.element.querySelector(".e-active")},hG.prototype.getDropDownPage=function(){var e,t=this.element.querySelector(".e-pagerdropdown");return e=t?t.children[0]:e},hG.prototype.getFocusedElement=function(){return this.element.querySelector(".e-focused")},hG.prototype.getClass=function(e){for(var t,i=["e-mfirst","e-mprev","e-first","e-prev","e-pp","e-np","e-next","e-last","e-mnext","e-mlast"],n=0;n<i.length;n++)if(e&&e.classList.contains(i[parseInt(n.toString(),10)]))return t=i[parseInt(n.toString(),10)];return t},hG.prototype.getElementByClass=function(e){return this.element.querySelector("."+e)},hG.prototype.getFocusablePagerElements=function(e,t){for(var i=e.children,n=t,o=0;o<i.length;o++){var r,s=i[parseInt(o.toString(),10)];0<s.children.length&&!s.classList.contains("e-pagesizes")?n=this.getFocusablePagerElements(s,n):!(r=i[parseInt(o.toString(),10)]).hasAttribute("tabindex")||s.classList.contains("e-disable")||"none"===s.style.display||je(s.offsetParent)||n.push(r)}return n},hG.prototype.addFocus=function(e,t){je(e)||(t&&U([e],["e-focused","e-focus"]),e.tabIndex=0)},hG.prototype.removeFocus=function(e,t){t&&q([e],["e-focused","e-focus"]),e.tabIndex=-1},hG.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},hG.prototype.goToPage=function(e){this.checkGoToPage(e)&&(this.currentPage=e,this.isInteracted=!1,this.dataBind())},hG.prototype.setPageSize=function(e){this.pageSize=e,this.dataBind()},hG.prototype.checkpagesizes=function(){return!(!0!==this.pageSizes&&!this.pageSizes.length)},hG.prototype.checkGoToPage=function(e,t){return e!==this.currentPage&&(this.previousPageNo=this.currentPage),je(t)||(this.previousPageNo=t),this.previousPageNo!==e&&1<=e&&e<=this.totalPages},hG.prototype.currentPageChanged=function(e,t){this.enableQueryString&&this.updateQueryString(this.currentPage),e.currentPage===t.currentPage&&e.pageSize===t.pageSize||(e={currentPage:this.currentPage,newProp:e,oldProp:t,cancel:!1,isInteracted:this.isInteracted},this.trigger("click",e),e.cancel?(this.isCancel=!0,t&&t.pageSize&&(this.setProperties({pageSize:t.pageSize},!0),this.pagerdropdownModule)&&(this.pagerdropdownModule.setDropDownValue("value",t.pageSize),this.pagerdropdownModule.dropDownListObject.text=t.pageSize+"")):(this.isCancel=!1,this.refresh()))},hG.prototype.pagerTemplate=function(){var e,t;this.isReactTemplate()&&this.hasParent||(this.element.classList.add("e-pagertemplate"),this.compile(this.template),e={currentPage:this.currentPage,pageSize:this.pageSize,pageCount:this.pageCount,totalRecordsCount:this.totalRecordsCount,totalPages:this.totalPages},t=this.element.parentElement.id+"_template",this.isReactTemplate()&&!this.isVue?(this.getPagerTemplate()(e,this,"pagerTemplate",t,null,null,this.element),this.renderReactTemplates()):(t=this.isVue?this.getPagerTemplate()(e,this,"pagerTemplate",null,null,null,null,this.root):this.getPagerTemplate()(e),eB(this.element,t)))},hG.prototype.updateTotalPages=function(){this.totalPages=this.isAllPage?1:this.totalRecordsCount%this.pageSize==0?this.totalRecordsCount/this.pageSize:parseInt((this.totalRecordsCount/this.pageSize).toString(),10)+1},hG.prototype.getPagerTemplate=function(){return this.templateFn},hG.prototype.compile=function(t){if(t)try{"function"!=typeof t&&document.querySelectorAll(t).length?this.templateFn=oo(document.querySelector(t).innerHTML.trim()):this.templateFn=oo(t)}catch(e){this.templateFn=oo(t)}},hG.prototype.refresh=function(){var e;this.template?this.isReactTemplate()?(this.updateTotalPages(),this.notify(this.pageRefresh,{})):(this.parent&&this.parent.isAngular?this.parent.destroyTemplate(["pagerTemplate"]):this.element.innerHTML="",this.updateTotalPages(),this.pagerTemplate()):(this.updateRTL(),e=this.getFocusedTabindexElement(),this.containerModule.refresh(),this.removeTabindexLastElements(),e&&e.classList.contains("e-disable")&&(this.checkFocusInAdaptiveMode(e)?this.changeFocusInAdaptiveMode(e):this.setPagerFocusForActiveElement()),this.enablePagerMessage&&this.pagerMessageModule.refresh(),this.pagerdropdownModule&&this.pagerdropdownModule.refresh(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.refresh(),this.setTabIndexForFocusLastElement(),this.resizePager())},hG.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},hG.prototype.initLocalization=function(){this.localeObj=new Cn(this.getModuleName(),this.defaultConstants,this.locale)},hG.prototype.updateQueryString=function(e){e=this.getUpdatedURL(window.location.href,"page",e.toString());window.history.pushState({path:e},"",e)},hG.prototype.getUpdatedURL=function(e,t,i){var n=new RegExp("([?|&])"+t+"=.*?(&|#|$)","i");return e.match(n)?e.replace(n,"$1"+t+"="+i+"$2"):(n="",-1!==e.indexOf("#")&&(n=e.replace(/.*#/,"#"),e=e.replace(/#.*/,"")),e+(-1!==e.indexOf("?")?"&":"?")+t+"="+i+n)},hG.prototype.renderFirstPrevDivForDevice=function(){this.element.appendChild(Q("div",{className:"e-mfirst e-icons e-icon-first",attrs:{title:this.getLocalizedLabel("firstPageTooltip"),tabindex:"-1"}})),this.element.appendChild(Q("div",{className:"e-mprev e-icons e-icon-prev",attrs:{title:this.getLocalizedLabel("previousPageTooltip"),tabindex:"-1"}}))},hG.prototype.renderNextLastDivForDevice=function(){this.element.appendChild(Q("div",{className:"e-mnext e-icons e-icon-next",attrs:{title:this.getLocalizedLabel("nextPageTooltip"),tabindex:"-1"}})),this.element.appendChild(Q("div",{className:"e-mlast e-icons e-icon-last",attrs:{title:this.getLocalizedLabel("lastPageTooltip"),tabindex:"-1"}}))},hG.prototype.addAriaLabel=function(){var e=[".e-mfirst",".e-mprev",".e-mnext",".e-mlast"];if(!F.isDevice)for(var t=0;t<e.length;t++){var i=this.element.querySelector(e[parseInt(t.toString(),10)]);i.setAttribute("aria-label",i.getAttribute("title"))}},hG.prototype.isReactTemplate=function(){return(this.isReact||this.isVue)&&this.template&&"string"!=typeof this.template&&!(this.template.prototype&&this.template.prototype.CSPTemplate)},hG.prototype.calculateActualWidth=function(){for(var e=this.element.querySelectorAll(".e-mfirst, .e-mprev, .e-icon-first, .e-icon-prev, .e-pp:not(.e-disable), .e-numericitem:not(.e-hide), .e-numericitem.e-active.e-hide, .e-np:not(.e-disable), .e-icon-next, .e-icon-last, .e-parentmsgbar, .e-mnext, .e-mlast, .e-pagerdropdown, .e-pagerconstant"),t=0,i=0;i<e.length;i++)"none"!==getComputedStyle(e[parseInt(i.toString(),10)]).display&&(t+=e[parseInt(i.toString(),10)].offsetWidth+parseFloat(getComputedStyle(e[parseInt(i.toString(),10)]).marginLeft)+parseFloat(getComputedStyle(e[parseInt(i.toString(),10)]).marginRight));var n=this.element.querySelector(".e-pagercontainer");return t+=parseFloat(getComputedStyle(n).marginLeft)+parseFloat(getComputedStyle(n).marginRight)},f7([e(!(hG.prototype.resizePager=function(){var t=this,e=this.element.classList.contains("e-pager")?getComputedStyle(this.element).getPropertyValue("border-style").includes("solid"):null;if(!this.template&&e){for(var i=this.element.querySelector(".e-pagercontainer"),e=this.calculateActualWidth(),n=this.element.clientWidth-parseFloat(getComputedStyle(this.element).paddingLeft)-parseFloat(getComputedStyle(this.element).paddingRight)-parseFloat(getComputedStyle(this.element).marginLeft)-parseFloat(getComputedStyle(this.element).marginRight),o=i.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)'),r=i.querySelectorAll('.e-numericitem.e-hide:not([style*="display: none"])'),s=o.length,a=je(A(this.element,"e-bigger"))?5:10,l=i.querySelector(".e-np"),h=i.querySelector(".e-pp"),d=this.element.querySelectorAll('.e-parentmsgbar:not(.e-hide):not([style*="display: none"]), .e-pagesizes:not(.e-hide):not([style*="display: none"])'),p=0,c=(d.length&&(d.forEach(function(e){p+=e.offsetWidth}),this.averageDetailWidth=p/d.length),0),u=0;u<o.length;u++)c+=o[parseInt(u.toString(),10)].offsetWidth+parseFloat(getComputedStyle(o[parseInt(u.toString(),10)]).marginLeft)+parseFloat(getComputedStyle(o[parseInt(u.toString(),10)]).marginRight);var g=c/o.length;if(0<n&&n-(g||0)<=e){this.isPagerResized=!0,this.currentPage!==this.totalPages&&mt(l,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"]);for(var e=this.calculateActualWidth(),m=Math.abs(e-n),f=0===(f=Math.ceil(m/g))?1:f>o.length?o.length-1:f,u=1;u<=f;u++){var y=s-parseInt(u.toString(),10),o=i.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)');1===this.currentPage||parseInt(o[Math.abs(y)].getAttribute("index"),10)!==this.currentPage&&parseInt(o[o.length-1].getAttribute("index"),10)!==this.currentPage||(y=0,mt(h,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"])),o[Math.abs(y)]&&!o[Math.abs(y)].classList.contains("e-currentitem")&&o[Math.abs(y)].classList.add("e-hide")}if((o=i.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)')).length<=1&&d.length&&768<=window.innerWidth){var v=this.calculateActualWidth();if(n-a<v)for(var b=Math.floor((n-(v-p))/this.averageDetailWidth),b=d.length-b,u=0;u<(b>d.length?d.length:b);u++)d[parseInt(u.toString(),10)].classList.add("e-hide")}}else if(e<n&&r.length){var m=Math.abs(n-e),v=this.element.querySelectorAll(".e-parentmsgbar.e-hide, .e-pagesizes.e-hide");if(v.length&&m>this.averageDetailWidth+this.averageDetailWidth/4&&v[v.length-1].classList.remove("e-hide"),2*g<m&&!v.length&&768<=window.innerWidth)for(var w=(w=Math.floor(m/(g+a)))>r.length?r.length:w-1,n=Array.from(r).filter(function(e){return parseInt(e.getAttribute("index"),10)<t.currentPage}).sort(function(e,t){return parseInt(t.getAttribute("index"),10)-parseInt(e.getAttribute("index"),10)}),e=Array.from(r).filter(function(e){return parseInt(e.getAttribute("index"),10)>t.currentPage}),C=n.length&&n||e.length&&e,u=1;u<=w;u++){var S=C&&C[Math.abs(1-u)];S&&(S.classList.remove("e-hide"),S===C[C.length-1])&&(C=null)}}(o=i.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)')).length&&(parseInt(o[o.length-1].getAttribute("index"),10)===this.totalPages&&mt(l,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]),1===parseInt(o[0].getAttribute("index"),10)&&mt(h,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]),v=Array.from(o).some(function(e){return parseInt(e.getAttribute("index"),10)===t.totalPages}),m=parseInt(o[0].getAttribute("index"),10)-(v&&!je(this.avgNumItems)?this.avgNumItems:o.length),h.setAttribute("index",m<1?"1":m.toString()),l.setAttribute("index",(parseInt(o[o.length-1].getAttribute("index"),10)+1).toString()),this.avgNumItems=v?this.avgNumItems:o.length),this.element.offsetWidth<769&&"none"!==window.getComputedStyle(this.element.querySelector(".e-mfirst")).getPropertyValue("display")&&this.pageSizes?(this.element.querySelector(".e-pagesizes").classList.remove("e-hide"),this.element.querySelector(".e-parentmsgbar").classList.remove("e-hide"),this.element.classList.add("e-adaptive"),this.element.querySelector(".e-pagenomsg").innerHTML=this.element.offsetWidth<481?this.currentPage+" / "+this.totalPages:this.pagerMessageModule.format(this.getLocalizedLabel("currentPageInfo"),[0===this.totalRecordsCount?0:this.currentPage,this.totalPages||0,this.totalRecordsCount||0])+" "):(this.element.classList.remove("e-adaptive"),this.element.querySelector(".e-pagenomsg").innerHTML=this.pagerMessageModule.format(this.getLocalizedLabel("currentPageInfo"),[0===this.totalRecordsCount?0:this.currentPage,this.totalPages||0,this.totalRecordsCount||0])+" ")}}))],hG.prototype,"enableQueryString",void 0),f7([e(!1)],hG.prototype,"enableExternalMessage",void 0),f7([e(!0)],hG.prototype,"enablePagerMessage",void 0),f7([e(12)],hG.prototype,"pageSize",void 0),f7([e(10)],hG.prototype,"pageCount",void 0),f7([e(1)],hG.prototype,"currentPage",void 0),f7([e()],hG.prototype,"totalRecordsCount",void 0),f7([e()],hG.prototype,"externalMessage",void 0),f7([e(!1)],hG.prototype,"pageSizes",void 0),f7([e()],hG.prototype,"template",void 0),f7([e("")],hG.prototype,"customText",void 0),f7([i()],hG.prototype,"click",void 0),f7([e("")],hG.prototype,"cssClass",void 0),f7([i()],hG.prototype,"dropDownChanged",void 0),f7([i()],hG.prototype,"created",void 0),f7([Bt],hG));function hG(e,t,i){e=aG.call(this,e,t)||this;return e.hasParent=!1,e.checkAll=!0,e.pageRefresh="pager-refresh",e.firstPagerFocus=!1,e.isCancel=!1,e.isInteracted=!1,e.parent=i,e}pG.prototype.getModuleName=function(){return"pagerdropdown"},pG.prototype.render=function(){var e=this.pagerModule,t=(this.pagerDropDownDiv=Q("div",{className:"e-pagesizes"}),Q("div",{className:"e-pagerdropdown"})),i=Q("div",{className:"e-pagerconstant"}),n=Q("input",{attrs:{type:"text",tabindex:"-1"}}),t=(this.pagerCons=Q("span",{className:"e-constant",innerHTML:this.pagerModule.getLocalizedLabel("pagerDropDown")}),t.appendChild(n),i.appendChild(this.pagerCons),this.pagerDropDownDiv.appendChild(t),this.pagerDropDownDiv.appendChild(i),this.pagerModule.element.appendChild(this.pagerDropDownDiv),this.pagerModule.pageSizes),i=t.length?this.convertValue(t):[this.pagerModule.getLocalizedLabel("All"),"5","10","12","20"],o=this.pagerModule.pageSize;this.dropDownListObject=new qz({dataSource:i,value:o.toString(),change:this.onChange.bind(this),placeholder:this.pagerModule.getLocalizedLabel("pagerDropDown"),cssClass:this.pagerModule.cssClass?"e-alldrop "+this.pagerModule.cssClass:"e-alldrop"}),this.dropDownListObject.appendTo(n),t.length&&(this.dropDownListObject.element.value=this.pagerModule.pageSize.toString()),e.pageSize=o,e.dataBind(),e.trigger("dropDownChanged",{pageSize:o}),this.addEventListener()},pG.prototype.onChange=function(e){this.dropDownListObject.value===this.pagerModule.getLocalizedLabel("All")?(this.pagerModule.pageSize=this.pagerModule.totalRecordsCount,this.pagerModule.isAllPage=!0,this.refresh(),e.value=this.pagerModule.pageSize,document.getElementsByClassName("e-popup-open e-alldrop").length&&(document.getElementsByClassName("e-popup-open e-alldrop")[0].style.display="none")):(this.pagerModule.pageSize=parseInt(this.dropDownListObject.value,10),this.pagerModule.isAllPage=!1,this.pagerCons.innerHTML!==this.pagerModule.getLocalizedLabel("pagerDropDown")&&this.refresh()),this.pagerModule.dataBind(),this.pagerModule.isCancel||this.pagerModule.trigger("dropDownChanged",{pageSize:this.pagerModule.isAllPage||void 0===this.pagerModule.isAllPage&&this.dropDownListObject.value===this.pagerModule.getLocalizedLabel("All")?this.pagerModule.totalRecordsCount:parseInt(this.dropDownListObject.value,10)})},pG.prototype.refresh=function(){this.pagerCons&&(this.isPageSizeAll(this.pagerModule.pageSize)?(this.pagerCons.innerHTML=this.pagerModule.getLocalizedLabel("pagerAllDropDown"),this.pagerCons.parentElement.classList.add("e-page-all")):(this.pagerCons.innerHTML=this.pagerModule.getLocalizedLabel("pagerDropDown"),this.pagerCons.parentElement.classList.remove("e-page-all")),this.pagerDropDownDiv.classList.remove("e-hide"))},pG.prototype.beforeValueChange=function(e){var t;"number"==typeof e.newProp.value&&(t=e.newProp.value.toString(),e.newProp.value=t)},pG.prototype.convertValue=function(e){for(var t=e,i=0;i<t.length;i++)t[parseInt(i.toString(),10)]=parseInt(t[parseInt(i.toString(),10)],10)?t[parseInt(i.toString(),10)].toString():""!==this.pagerModule.getLocalizedLabel(t[parseInt(i.toString(),10)])?this.pagerModule.getLocalizedLabel(t[parseInt(i.toString(),10)]):t[parseInt(i.toString(),10)];return t},pG.prototype.isPageSizeAll=function(e){return("string"==typeof e&&e!==this.pagerModule.getLocalizedLabel("All")?parseInt(e,10):e)===this.pagerModule.totalRecordsCount||e===this.pagerModule.getLocalizedLabel("All")},pG.prototype.setDropDownValue=function(e,t){var i;this.dropDownListObject&&(i=this.pagerModule.isAllPage,this.pagerModule.isAllPage=this.isPageSizeAll(t),this.pagerModule.isAllPage&&"object"==typeof this.pagerModule.pageSizes&&-1===this.pagerModule.pageSizes.indexOf("All")&&(this.pagerModule.isAllPage=!1),this.pagerModule.checkAll=!(!i||!this.pagerModule.isAllPage),this.dropDownListObject[""+e]=this.pagerModule.isAllPage?this.pagerModule.getLocalizedLabel("All"):t)},pG.prototype.addEventListener=function(){this.dropDownListObject.on("beforeValueChange",this.beforeValueChange,this)},pG.prototype.removeEventListener=function(){this.dropDownListObject.off("beforeValueChange",this.beforeValueChange)},pG.prototype.destroy=function(e){this.dropDownListObject&&!this.dropDownListObject.isDestroyed&&(this.removeEventListener(),this.dropDownListObject.destroy(),ue(this.pagerDropDownDiv))};var dG=pG;function pG(e){this.pagerModule=e}uG.prototype.getModuleName=function(){return"externalMessage"},uG.prototype.render=function(){this.element=Q("div",{className:"e-pagerexternalmsg",attrs:{"aria-label":this.pagerModule.getLocalizedLabel("ExternalMsg")}}),this.pagerModule.element.appendChild(this.element),this.refresh()},uG.prototype.refresh=function(){this.pagerModule.externalMessage&&this.pagerModule.externalMessage.toString().length?(this.showMessage(),this.element.innerHTML=this.pagerModule.externalMessage):this.hideMessage()},uG.prototype.hideMessage=function(){je(this.element)||(this.element.style.display="none")},uG.prototype.showMessage=function(){this.element.style.display=""},uG.prototype.destroy=function(){this.element&&this.element.parentElement&&ue(this.element)};var cG=uG;function uG(e){this.pagerModule=e}mG.prototype.getModuleName=function(){return"pager"},mG.prototype.render=function(){var e=this.parent,t=(this.pagerDestroy(),je(this.parent.pagerTemplate)||(this.pageSettings.template=this.parent.pagerTemplate,this.parent.pageTemplateChange=!0),this.element=this.parent.createElement("div",{className:"e-gridpager"}),jP({},Pe({},qP(this.pageSettings)),{click:this.clickHandler.bind(this),dropDownChanged:this.onSelect.bind(this),enableRtl:e.enableRtl,locale:e.locale,created:this.addAriaAttr.bind(this)},["parentObj","propName"]));t.cssClass=this.parent.cssClass||"",this.pagerObj=new lG(t,void 0,this.parent),this.pagerObj.root=e.root||e,this.pagerObj.hasParent=!0,this.pagerObj.on(KT,this.renderReactPagerTemplate,this),this.pagerObj.allowServerDataBinding=!1},mG.prototype.onSelect=function(e){this.pageSettings.pageSize=e.pageSize,this.isInitialLoad||(this.pageSettings.currentPage=1)},mG.prototype.addAriaAttr=function(){if(!this.pageSettings.template){for(var e=this.parent.createElement("div",{className:"e-numericcontainer"}),t=this.element.querySelector(".e-pagercontainer"),i=document.createDocumentFragment(),n=this.element.querySelector(".e-numericcontainer"),o=n.querySelectorAll("a"),r=0;r<o.length;r++){this.parent.getContentTable()?o[parseInt(r.toString(),10)].setAttribute("aria-owns",this.parent.getContentTable().id+" "+(r+1)):o[parseInt(r.toString(),10)].setAttribute("aria-owns",this.parent.element.getAttribute("id")+"_content_table "+(r+1));var s=this.parent.createElement("div");s.appendChild(o[parseInt(r.toString(),10)]),i.appendChild(s)}e.appendChild(i),t.replaceChild(e,n);for(var a=[".e-mfirst",".e-mprev",".e-first",".e-prev",".e-next",".e-last",".e-mnext",".e-mlast"],l=0;l<a.length;l++){var h=this.element.querySelector(a[parseInt(l.toString(),10)]);this.parent.getContentTable()&&h.setAttribute("aria-owns",this.parent.getContentTable().id+a[parseInt(l.toString(),10)].replace(".e-"," "))}}},mG.prototype.dataReady=function(e){this.updateModel(e)},mG.prototype.refresh=function(){this.pagerObj.refresh()},mG.prototype.goToPage=function(e){this.pagerObj.goToPage(e)},mG.prototype.setPageSize=function(e){this.pagerObj.setPageSize(e)},mG.prototype.updateModel=function(e){this.parent.pageSettings.totalRecordsCount=e.count;var t="add"===e.action&&"save"===e.requestType||"batchsave"===e.requestType;this.pagerObj.isAllPage&&!t&&(this.parent.pageSettings.pageSize=this.parent.pageSettings.totalRecordsCount),t&&this.pagerObj.isAllPage&&e.count===this.pageSettings.pageSize&&this.pagerObj.setProperties({pageSize:e.count},!0),this.parent.dataBind()},mG.prototype.onActionComplete=function(e){this.parent.trigger(QA,Pe(e,{currentPage:this.parent.pageSettings.currentPage,requestType:"paging",type:QA}))},mG.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){for(var t=e.properties,i=0,n=Object.keys(t);i<n.length;i++){var o=n[i];this.pagerObj[""+o]=t[""+o]}this.pagerObj.dataBind()}},mG.prototype.clickHandler=function(e){var t,i,n=this.parent;this.isForceCancel||mB(n)&&!n.prevPageMoving&&!this.isCancel?(this.isForceCancel?this.isForceCancel=!1:(je(e.newProp)||je(e.newProp.pageSize)?e.currentPage&&(n.notify(zx,{instance:this,handler:this.goToPage,arg1:e.currentPage}),this.pagerObj.currentPage=n.pageSettings.currentPage===this.pagerObj.currentPage?this.pagerObj.previousPageNo:n.pageSettings.currentPage):(n.notify(zx,{instance:this,handler:this.setPageSize,arg1:e.newProp.pageSize}),this.pagerObj.setProperties({pageSize:e.oldProp.pageSize},!0),this.parent.setProperties({pageSettings:{pageSize:e.oldProp.pageSize}},!0),this.pagerObj.setProperties({currentPage:n.pageSettings.currentPage===this.pagerObj.currentPage?this.pagerObj.previousPageNo:n.pageSettings.currentPage},!0)),this.isForceCancel=!0,this.pagerObj.dataBind()),e.cancel=!0):(n.pageSettings.pageSize=this.pagerObj.pageSize,i={cancel:n.prevPageMoving=!1,requestType:"paging",previousPage:t=this.pageSettings.currentPage,currentPage:e.currentPage,pageSize:n.pageSettings.pageSize,type:WA},this.isCancel||(this.pageSettings.currentPage=e.currentPage,this.parent.notify($1,i),n.pageRequireRefresh=!1),i.cancel?(e.cancel=!0,this.parent.setProperties({pageSettings:{currentPage:t}},!0),this.pagerObj.setProperties({currentPage:t},!0),this.isCancel=!0):(this.isCancel=!1,this.parent.requestTypeAction="paging"))},mG.prototype.keyPressHandler=function(e){e.action in fG&&(e.preventDefault(),(e=this.element.querySelector(fG[e.action])).classList.contains("e-nextprevitemdisabled")||e.click())},mG.prototype.updateExternalMessage=function(e){this.pagerObj.enableExternalMessage||(this.pagerObj.enableExternalMessage=!0,this.pagerObj.dataBind()),this.pagerObj.externalMessage=e,this.pagerObj.dataBind()},mG.prototype.appendToElement=function(){this.isInitialLoad=!0,this.parent.element.appendChild(this.element),this.parent.setGridPager(this.element),this.pagerObj.isReact=this.parent.isReact,this.pagerObj.isVue=this.parent.isVue||this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isVue,this.pagerObj.appendTo(this.element),this.isInitialLoad=!1},mG.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.render(),this.appendToElement(),this.isReactTemplate())&&(this.pagerObj.updateTotalPages(),this.created())},mG.prototype.addEventListener=function(){this.handlers={load:this.render,end:this.appendToElement,ready:this.dataReady,complete:this.onActionComplete,updateLayout:this.enableAfterRender,inboundChange:this.onPropertyChanged,keyPress:this.keyPressHandler,created:this.created},this.parent.isDestroyed||((this.parent.isReact||this.parent.isVue)&&this.parent.addEventListener(hD,this.handlers.created.bind(this)),this.evtHandlers=[{event:q1,handler:this.handlers.load},{event:G1,handler:this.handlers.end},{event:Y1,handler:this.handlers.ready},{event:ix,handler:this.handlers.complete},{event:K1,handler:this.handlers.updateLayout},{event:Z1,handler:this.handlers.inboundChange},{event:bx,handler:this.handlers.keyPress},{event:Cx,handler:this.destroy}],CF(this.parent,this.evtHandlers,!0,this))},mG.prototype.created=function(){this.isInitialRender&&this.isReactTemplate()&&(this.isInitialRender=!1,this.renderReactPagerTemplate())},mG.prototype.isReactTemplate=function(){return(this.parent.isReact||this.parent.isVue)&&this.pagerObj.template&&"string"!=typeof this.pagerObj.template},mG.prototype.renderReactPagerTemplate=function(){var e,t,i;!this.isInitialRender&&this.isReactTemplate()&&(e=void 0,this.parent.destroyTemplate(["pagerTemplate"]),this.element.classList.add("e-pagertemplate"),this.pagerObj.compile(this.pagerObj.template),t={currentPage:(t=this.parent.pageSettings).currentPage,pageSize:t.pageSize,pageCount:t.pageCount,totalRecordsCount:t.totalRecordsCount,totalPages:this.pagerObj.totalPages},i=this.parent.id+"_pagertemplate",this.parent.isReact?(this.pagerObj.templateFn(t,this.parent,"pagerTemplate",i,null,null,this.pagerObj.element),this.parent.renderTemplates()):(e=this.pagerObj.templateFn(t,this.parent,"pagerTemplate"),eB(this.pagerObj.element,e)))},mG.prototype.removeEventListener=function(){this.parent.isDestroyed||((this.parent.isReact||this.parent.isVue)&&this.parent.removeEventListener(hD,this.handlers.created),this.parent.off(KT,this.renderReactPagerTemplate),CF(this.parent,this.evtHandlers,!1))},mG.prototype.destroy=function(){this.removeEventListener(),this.isReactTemplate()&&this.parent.destroyTemplate(["pagerTemplate"]),this.pagerObj.destroy()},mG.prototype.pagerDestroy=function(){this.pagerObj&&!this.pagerObj.isDestroyed&&(this.pagerObj.destroy(),ue(this.element))};var gG=mG;function mG(e,t){this.isInitialRender=!0,this.isCancel=!1,lG.Inject(cG,dG),this.parent=e,this.pageSettings=t,this.addEventListener()}var fG={pageUp:".e-prev",pageDown:".e-next",ctrlAltPageDown:".e-last",ctrlAltPageUp:".e-first",altPageUp:".e-pp",altPageDown:".e-np"};yG=function(e,t){return(yG=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}yG(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(wG,vG=VD),wG.prototype.getGui=function(){return this.parent.createElement("div")},wG.prototype.render=function(e,t){var i,n,o,r,s,a=this.parent.element.querySelector(".e-filterbar"),l=this.element.cloneNode(),h=this.getGui(),d=e.column;return a.appendChild(l),l.setAttribute("e-mappinguid",d.uid),d.filterTemplate?(a={},t&&(a[d.field]=t[d.field]),(a.column=d).visible?("FilterBar"===this.parent.filterSettings.type&&l.classList.add("e-fltrtemp"),n=this.parent.isReact&&"string"!=typeof d.filterTemplate&&!(d.filterTemplate.prototype&&d.filterTemplate.prototype.CSPTemplate),o=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,r=this.parent.element.id+d.uid+"filterTemplate",n||o?(d.getFilterTemplate()(a,this.parent,"filterTemplate",r,null,null,l),this.parent.renderTemplates()):eB(l,d.getFilterTemplate()(a,this.parent,"filterTemplate",r,null,null,null,this.parent.root))):l.classList.add("e-hide")):"checkbox"!==d.type?(!je(d.allowFiltering)&&!d.allowFiltering||je(d.filterBarTemplate)?(pt(h,{class:"e-filterdiv e-fltrinputdiv"}),i=this.parent.createElement("input",{id:d.field+"_filterBarcell",className:"e-filtertext",attrs:{type:"search",title:d.headerText+e.attributes.title,value:t[e.column.field]||""}}),h.appendChild(i),s={element:i,floatLabelType:"Never",properties:{enableRtl:this.parent.enableRtl,showClearButton:!0,cssClass:this.parent.cssClass}},this.parent.filterModule.inputList.push(s),HF.createInput(s,this.parent.createElement)):(l.classList.add("e-fltrtemp"),pt(h,{class:"e-fltrtempdiv"}),je(d.filterBarTemplate.create)?i=this.parent.createElement("input",{id:d.field+"_filterBarcell",className:"e-filterUi_input e-filtertext e-fltrTemp",attrs:{type:"search",title:d.headerText}}):(s={column:d,node:Element},"string"==typeof(i=(n="string"==typeof(n=d.filterBarTemplate.create)?R(n,window):n)(s))&&((o=this.parent.createElement("div")).innerHTML=i,i=o.firstChild),pt(h,{class:"e-filterUi_input e-filtertext e-fltrTemp",title:d.headerText,id:d.field+"_filterBarcell"})),h.appendChild(i)),!1!==d.allowFiltering&&""!==d.field&&!je(d.field)||(i.setAttribute("disabled","true"),i.classList.add("e-disable")),(a=h.querySelector(".e-clear-icon"))&&a.setAttribute("title",this.parent.localeObj.getConstant("ClearButton")),d.visible||l.classList.add("e-hide"),this.appendHtml(l,h),this.parent.filterSettings.showFilterBarOperator&&"FilterBar"===this.parent.filterSettings.type&&!this.parent.isPrinting&&je(d.filterTemplate)&&je(d.filterBarTemplate)&&this.operatorIconRender(h,d,e),!je(d.allowFiltering)&&!d.allowFiltering||je(d.filterBarTemplate)||(s={element:i,column:d},(r="string"==typeof(r=d.filterBarTemplate.write)?R(r,window):r).call(this,s))):d.visible||l.classList.add("e-hide"),this.parent.isFrozenGrid()&&uF(this.parent,d,l),l},wG.prototype.appendHtml=function(e,t){return e.appendChild(t),e},wG.prototype.operatorIconRender=function(e,i,t){var n,o=this.parent,t=this.parent.createElement("input",{className:" e-filterbaroperator e-icons e-icon-filter",id:t.column.uid});if(e.querySelector("span").appendChild(t),i.filter&&i.filter.operator)n=i.filter.operator;else if(o.filterSettings.columns.length)for(var r=0,s=o.filterSettings.columns;r<s.length;r++){var a=s[parseInt(r.toString(),10)];if(a.field===i.field){n=a.operator;break}n="equal"}else n="equal";je(o.filterModule.operators[i.field])||(n=o.filterModule.operators[i.field]),this.dropOptr=new qz({fields:{text:"text",value:"value"},popupHeight:"auto",value:n,width:"0px",enabled:i.allowFiltering,popupWidth:"auto",enableRtl:this.parent.enableRtl,change:this.internalEvent.bind(this),beforeOpen:function(){var e=o.filterModule.customOperators;this.dataSource=e[o.getColumnByUid(this.element.id).type+"Operator"];for(var t=0;t<this.dataSource.length;t++)i.filter&&i.filter.operator&&je(o.filterModule.operators[i.field])&&this.dataSource[parseInt(t.toString(),10)].value===i.filter.operator&&(this.value=i.filter.operator)},cssClass:this.parent.cssClass?"e-popup-flbar "+this.parent.cssClass:"e-popup-flbar"}),this.dropOptr.appendTo(t);e=z(this.dropOptr.element,"span");e.classList.add("e-filterbardropdown"),e.removeAttribute("tabindex")},wG.prototype.internalEvent=function(e){var t=this.parent,i=t.getColumnByUid(e.element.getAttribute("id"));e.column=i,t.filterModule.operators[i.field]=e.value,t.notify(fT,e)};var yG,vG,bG=wG;function wG(){var e=null!==vG&&vG.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-filterbarcell",attrs:{role:"columnheader"}}),e}SG.prototype.renderOperatorUI=function(e,t,i,n,o){var r=this,s=(this.dialogObj=n,i.type+"Operator"),o=(this.optrData=this.customOptr=je(o)?(je(this.parent.filterSettings.operators)||je(this.parent.filterSettings.operators[s])?this.customFilterOperators:this.parent.filterSettings.operators)[s]:o,this.customOptr),s=this.dropSelectedVal(i,s),a=this.parent.createElement("div",{className:"e-flm_optrdiv"}),e=(e.appendChild(a),this.parent.createElement("input",{id:i.uid+"-floptr"}));a.appendChild(e),this.dropOptr=new qz({dataSource:o,fields:{text:"text",value:"value"},cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",enableRtl:this.parent.enableRtl,text:s,change:function(){var e=document.querySelector(".e-flmenu-valuediv").querySelector("input");"isempty"===r.dropOptr.value||"isnotempty"===r.dropOptr.value||"isnotnull"===r.dropOptr.value||"isnull"===r.dropOptr.value?je(e.ej2_instances)?e.setAttribute("disabled","true"):e.ej2_instances[0].enabled=!1:je(e.getAttribute("disabled"))||(je(e.ej2_instances)?e.removeAttribute("disabled"):e.ej2_instances[0].enabled=!0),SB(r.dropOptr.value,i.uid,i,i.type,n,r.dropOptr.previousValue)}}),this.dropOptr.addEventListener(sD,this.ddOpen),this.dropOptr.appendTo("#"+i.uid+"-floptr")},SG.prototype.renderResponsiveDropDownList=function(e){e.popup.element.style.width="100%"},SG.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString(),this.parent.enableAdaptiveUI&&this.renderResponsiveDropDownList(e)},SG.prototype.dropSelectedVal=function(e,t){for(var i="",n=0,o=this.parent.filterSettings.columns;n<o.length;n++){var r=o[n];(e.field===r.field||e.isForeignColumn()&&e.foreignKeyValue===r.field)&&(i=je((r=new me(this.optrData).executeLocal((new ya).where("value","equal",r.operator)))[0])?"":r[0].text)}if(""===i)if(e.filter.operator)for(var s=Object.keys(this.optrData).length,a=0;a<s;a++)this.optrData[parseInt(a.toString(),10)].value===e.filter.operator&&(i=this.optrData[parseInt(a.toString(),10)].text);else i=this.optrData[0].text;return i},SG.prototype.getFlOperator=function(){return this.dropOptr.value},SG.prototype.destroyDropDownList=function(){this.dropOptr.isDestroyed||(this.dropOptr.removeEventListener(sD,this.ddOpen),this.dropOptr.destroy(),this.parent.off(dI,this.destroyDropDownList),this.parent.off(Cx,this.destroyDropDownList))};var CG=SG;function SG(e,t,i,n){this.ddOpen=this.dropDownOpen.bind(this),this.parent=e,this.serviceLocator=i,this.filterSettings=n,this.customFilterOperators=t,this.parent&&(this.parent.on(dI,this.destroyDropDownList,this),this.parent.on(Cx,this.destroyDropDownList,this))}zU.Inject(JU);xG.prototype.create=function(e){this.instance=this.parent.createElement("input",{className:"e-flmenu-input",id:"strui-"+e.column.uid}),e.target.appendChild(this.instance),this.multiSelectCheckBoxInstance=this.parent.createElement("input",{className:"multiselect-input",id:"multiselectstrui-"+e.column.uid}),e.target.appendChild(this.multiSelectCheckBoxInstance),this.dialogObj=e.dialogObj,this.processDataOperation(e),this.createMultiSelectDropDown(e),SB(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,e.getOptrInstance.dropOptr.previousValue)},xG.prototype.processDataOperation=function(t){var i=this;t.column.isForeignColumn()?this.parent.getDataModule().dataManager.executeQuery(this.parent.getDataModule().generateQuery(!0)).then(function(e){i.getAutoCompleteOptions(t,e),SB(t.getOptrInstance.dropOptr.value,t.column.uid,t.column,t.column.type,t.dialogObj,t.getOptrInstance.dropOptr.previousValue)}):this.getAutoCompleteOptions(t)},xG.prototype.getAutoCompleteOptions=function(e,t){var i,n=e.column.isForeignColumn();if(n){for(var o=B_.getDistinct(t.result,e.column.field).records||[],r=void 0,s=0;s<o.length;s++)r=r?r.or(e.column.field,"contains",o[parseInt(s.toString(),10)][e.column.field],this.parent.filterSettings.enableCaseSensitivity,this.parent.filterSettings.ignoreAccent):new ba(e.column.field,"contains",o[parseInt(s.toString(),10)][e.column.field],this.parent.filterSettings.enableCaseSensitivity,this.parent.filterSettings.ignoreAccent);(i=(new ya).where(r)).params=this.parent.query.params}var t=(n?e.column:this.parent).dataSource,a={value:n?e.column.foreignKeyValue:e.column.field},l=new lU(Pe({dataSource:t instanceof me?t:new me(t),fields:a,locale:this.parent.locale,enableRtl:this.parent.enableRtl,query:n?i:this.parent.getDataModule().generateQuery(!0,!0),sortOrder:"Ascending",cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",autofill:!0,placeholder:e.localizeText.getConstant("EnterValue"),actionBegin:function(){if(this.query.queries.length&&"onWhere"===this.query.queries[0].fn&&this.query.queries[0].e&&this.query.queries[0].e.predicates){for(var e=0;e<this.query.queries[0].e.predicates.length;e++)this.properties.fields.value===this.query.queries[0].e.predicates[""+e].field&&(this.query.queries[0].e.predicates.splice(e,1),e-=1);this.query.queries[0].e.predicates.length||this.query.queries.splice(0,1)}}},e.column.filter.params));this.acFocus=this.focus(l,e),this.acComplete=this.actionComplete(l),this.acOpen=this.openPopup.bind(this),l.addEventListener(lD,this.acFocus),l.addEventListener(sD,this.acOpen),l.addEventListener(QA,this.acComplete),t&&"result"in t&&(a=JB({requestType:"stringfilterrequest"},this.parent.getQuery?this.parent.getQuery().clone():new ya),this.parent.trigger(yI,a.state),a.deffered.promise.then(function(e){l.dataSource=new me(e)})),this.actObj=l,this.actObj.appendTo(this.instance),n&&this.parent.filterModule.filterModule.afterRenderFilterUI()},xG.prototype.write=function(e){var t=this.parent.filterModule.filterModule.getOperatorDropdown(),i=this.getAutoCompleteInstance(e.column.uid),n=this.getMultiSelectInstance(e.column.uid);"in"===t.value||"notin"===t.value?n.value=Array.isArray(e.filteredValue)?e.filteredValue:[]:""===e.filteredValue||je(e.filteredValue)||Array.isArray(e.filteredValue)||(i.value=e.filteredValue)},xG.prototype.read=function(e,t,i,n){var o,r;"in"===i||"notin"===i?r=this.getMultiSelectInstance(t.uid).value:(r=(o=this.getAutoCompleteInstance(t.uid)).value,F.isDevice&&(o.hidePopup(),o.focusOut()),!je(r)&&""!==r||(r=null)),n.filterByColumn(t.field,i,r,"and",this.parent.filterSettings.enableCaseSensitivity)},xG.prototype.getAutoCompleteInstance=function(e){return document.querySelector("#strui-"+e).ej2_instances[0]},xG.prototype.getMultiSelectInstance=function(e){return document.querySelector("#multiselectstrui-"+e).ej2_instances[0]},xG.prototype.createMultiSelectDropDown=function(e){var t=e.column.isForeignColumn(),i=(t?e.column:this.parent).dataSource,t=t?e.column.foreignKeyValue:e.column.field;this.multiSelectObj=new zU(Pe({dataSource:i instanceof me?i:new me(i),fields:{text:t,value:t},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:(new ya).select(t),cssClass:this.parent.cssClass?"e-multiselect-flmenu "+this.parent.cssClass:"e-multiselect-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)),this.dialogObj=e.dialogObj,this.dropdownOpen=this.openPopup.bind(this),this.dropdownComplete=this.actionCompleteMultiCheckBox(t),this.multiSelectObj.addEventListener(sD,this.dropdownOpen),this.multiSelectObj.addEventListener(QA,this.dropdownComplete),this.multiSelectObj.appendTo(this.multiSelectCheckBoxInstance)},xG.prototype.openPopup=function(e){CB(e,this.dialogObj)},xG.prototype.focus=function(e,t){return function(){e.filterType=t.getOptrInstance.getFlOperator()}},xG.prototype.actionComplete=function(n){return function(e){e.result=e.result.filter(function(e,t,i){return i.map(function(e){return R(n.fields.value,e)}).indexOf(R(n.fields.value,e))===t})}},xG.prototype.actionCompleteMultiCheckBox=function(t){return function(e){e.result=Sa.distinct(e.result,t,!0)}},xG.prototype.destroy=function(){this.parent.off(dI,this.destroy),this.parent.off(Cx,this.destroy),this.actObj&&!this.actObj.isDestroyed&&(this.actObj.removeEventListener(lD,this.acFocus),this.actObj.removeEventListener(sD,this.acOpen),this.actObj.removeEventListener(QA,this.acComplete),this.actObj.destroy()),this.multiSelectObj&&!this.multiSelectObj.isDestroyed&&(this.multiSelectObj.removeEventListener(sD,this.dropdownOpen),this.multiSelectObj.removeEventListener(QA,this.dropdownComplete),this.multiSelectObj.destroy())};var AG=xG;function xG(e,t,i){this.parent=e,this.serLocator=t,this.filterSettings=i,this.parent&&(this.parent.on(dI,this.destroy,this),this.parent.on(Cx,this.destroy,this))}zU.Inject(JU);TG.prototype.keyEventHandler=function(e){13!==e.keyCode&&9!==e.keyCode||((e=document.createEvent("HTMLEvents")).initEvent("change",!1,!0),this.dispatchEvent(e))},TG.prototype.create=function(e){this.numericInstance=this.parent.createElement("input",{className:"e-flmenu-input",id:"numberui-"+e.column.uid}),this.multiSelectCheckBoxInstance=this.parent.createElement("input",{className:"multiselect-input",id:"multiselectnumberui-"+e.column.uid}),e.target.appendChild(this.numericInstance),e.target.appendChild(this.multiSelectCheckBoxInstance),this.createNumericTextBox(e),this.createMultiSelectDropDown(e),SB(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,e.getOptrInstance.dropOptr.previousValue)},TG.prototype.write=function(e){var t=this.parent.filterModule.filterModule.getOperatorDropdown(),i=this.getNumericInstance(e.column.uid),n=this.getMultiSelectInstance(e.column.uid);"in"===t.value||"notin"===t.value?n.value=Array.isArray(e.filteredValue)?e.filteredValue:[]:(i.element.addEventListener("keydown",this.keyEventHandler),Array.isArray(e.filteredValue)||(i.value=e.filteredValue))},TG.prototype.read=function(e,t,i,n){var o;o=("in"===i||"notin"===i?this.getMultiSelectInstance(t.uid):this.getNumericInstance(t.uid)).value,n.filterByColumn(t.field,i,o,"and",!0)},TG.prototype.createNumericTextBox=function(e){this.numericTxtObj=new NL(Pe({format:("string"==typeof e.column.format||ee(e.column.format)?e.column:e.column.format).format,locale:this.parent.locale,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("EnterValue"),enableRtl:this.parent.enableRtl},e.column.filter.params)),this.numericTxtObj.appendTo(this.numericInstance)},TG.prototype.createMultiSelectDropDown=function(e){var t=e.column.isForeignColumn(),i=(t?e.column:this.parent).dataSource,t=t?e.column.foreignKeyValue:e.column.field;this.multiSelectObj=new zU(Pe({dataSource:i instanceof me?i:new me(i),fields:{text:t,value:t},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:(new ya).select(t),cssClass:this.parent.cssClass?"e-multiselect-flmenu "+this.parent.cssClass:"e-multiselect-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)),this.dialogObj=e.dialogObj,this.dropdownOpen=this.openPopup.bind(this),this.dropdownComplete=this.actionComplete(t),this.multiSelectObj.addEventListener(sD,this.dropdownOpen),this.multiSelectObj.addEventListener(QA,this.dropdownComplete),this.multiSelectObj.appendTo(this.multiSelectCheckBoxInstance)},TG.prototype.getNumericInstance=function(e){return document.querySelector("#numberui-"+e).ej2_instances[0]},TG.prototype.getMultiSelectInstance=function(e){return document.querySelector("#multiselectnumberui-"+e).ej2_instances[0]},TG.prototype.openPopup=function(e){CB(e,this.dialogObj)},TG.prototype.actionComplete=function(t){return function(e){e.result=Sa.distinct(e.result,t,!0)}},TG.prototype.destroy=function(){this.parent.off(dI,this.destroy),this.parent.off(Cx,this.destroy),this.numericTxtObj&&!this.numericTxtObj.isDestroyed&&this.numericTxtObj.destroy(),this.multiSelectObj&&!this.multiSelectObj.isDestroyed&&(this.multiSelectObj.removeEventListener(sD,this.dropdownOpen),this.multiSelectObj.removeEventListener(QA,this.dropdownComplete),this.multiSelectObj.destroy())};var IG=TG;function TG(e,t,i){this.filterSettings=i,this.parent=e,this.serviceLocator=t,this.parent&&(this.parent.on(dI,this.destroy,this),this.parent.on(Cx,this.destroy,this))}zU.Inject(JU);DG.prototype.create=function(e){this.elem=this.parent.createElement("input",{className:"e-flmenu-input",id:"bool-ui-"+e.column.uid}),e.target.appendChild(this.elem),this.multiSelectElement=this.parent.createElement("input",{className:"multiselect-input",id:"multiselectbool-ui-"+e.column.uid}),e.target.appendChild(this.multiSelectElement),this.createDropDownList(e),this.createMultiSelectDropDown(e),SB(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,e.getOptrInstance.dropOptr.previousValue)},DG.prototype.write=function(e){var t=this.parent.filterModule.filterModule.getOperatorDropdown(),i=this.getBooleanInstance(e.column.uid),n=this.getMultiSelectInstance(e.column.uid);"in"===t.value||"notin"===t.value?n.value=Array.isArray(e.filteredValue)?e.filteredValue:[]:je(e.filteredValue)||Array.isArray(e.filteredValue)||(i.value=e.filteredValue)},DG.prototype.read=function(e,t,i,n){var o;"in"===i||"notin"===i?(o=this.getMultiSelectInstance(t.uid).value,n.filterByColumn(t.field,i,o,"and",!0)):(o=this.getBooleanInstance(t.uid).value,n.filterByColumn(t.field,i,o,"and",!1))},DG.prototype.createDropDownList=function(o){var r=this,e=o.column.isForeignColumn(),t=(e?o.column:this.parent).dataSource,e=e?o.column.foreignKeyValue:o.column.field;this.dialogObj=o.dialogObj,this.dropInstance=new qz(Pe({dataSource:t instanceof me?t:new me(t),query:(new ya).select(e),fields:{text:e,value:e},placeholder:o.localizeText.getConstant("SelectValue"),cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},o.column.filter.params)),this.dropdownOpen=this.openPopup.bind(this),this.dropdownComplete=this.actionComplete(e),this.dropInstance.addEventListener(sD,this.dropdownOpen),this.dropInstance.addEventListener(QA,this.dropdownComplete),t&&"result"in t&&(e=JB({requestType:"booleanfilterrequest"},this.parent.getQuery?this.parent.getQuery().clone():new ya),this.parent.trigger(yI,e.state),e.deffered.promise.then(function(e){r.dropInstance.dataSource=new me(e),r.dropInstance.dataBind();for(var t=0,i=r.parent.filterSettings.columns;t<i.length;t++){var n=i[t];o.column.uid===n.uid&&(r.dropInstance.value=n.value)}})),this.dropInstance.appendTo(this.elem)},DG.prototype.createMultiSelectDropDown=function(e){var t=e.column.isForeignColumn(),i=(t?e.column:this.parent).dataSource,t=t?e.column.foreignKeyValue:e.column.field;this.multiSelectCheckBoxInstance=new zU(Pe({dataSource:i instanceof me?i:new me(i),fields:{text:t,value:t},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:(new ya).select(t),cssClass:this.parent.cssClass?"e-multiselect-flmenu "+this.parent.cssClass:"e-multiselect-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)),this.dialogObj=e.dialogObj,this.multiSelectDropdownOpen=this.openPopup.bind(this),this.multiSelectDropdownComplete=this.actionComplete(t),this.multiSelectCheckBoxInstance.addEventListener(sD,this.multiSelectDropdownOpen),this.multiSelectCheckBoxInstance.addEventListener(QA,this.multiSelectDropdownComplete),this.multiSelectCheckBoxInstance.appendTo(this.multiSelectElement)},DG.prototype.getBooleanInstance=function(e){return document.querySelector("#bool-ui-"+e).ej2_instances[0]},DG.prototype.getMultiSelectInstance=function(e){return document.querySelector("#multiselectbool-ui-"+e).ej2_instances[0]},DG.prototype.openPopup=function(e){CB(e,this.dialogObj)},DG.prototype.actionComplete=function(t){return function(e){e.result=Sa.distinct(e.result,t,!0)}},DG.prototype.destroy=function(){this.parent.off(dI,this.destroy),this.parent.off(Cx,this.destroy),this.dropInstance&&!this.dropInstance.isDestroyed&&(this.dropInstance.removeEventListener(sD,this.dropdownOpen),this.dropInstance.removeEventListener(QA,this.dropdownComplete),this.dropInstance.destroy()),this.multiSelectCheckBoxInstance&&!this.multiSelectCheckBoxInstance.isDestroyed&&(this.multiSelectCheckBoxInstance.removeEventListener(sD,this.multiSelectDropdownOpen),this.multiSelectCheckBoxInstance.removeEventListener(QA,this.multiSelectDropdownComplete),this.multiSelectCheckBoxInstance.destroy())};var EG=DG;function DG(e,t,i){this.parent=e,this.serviceLocator=t,this.filterSettings=i,this.parent&&(this.parent.on(dI,this.destroy,this),this.parent.on(Cx,this.destroy,this))}kG.prototype.create=function(e){var t=LB(e.column.format,e.column.type);this.dialogObj=e.dialogObj,this.inputElem=this.parent.createElement("input",{className:"e-flmenu-input",id:"dateui-"+e.column.uid}),e.target.appendChild(this.inputElem),"date"===e.column.type||"dateonly"===e.column.type?this.datePickerObj=new o9(Pe({format:t,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)):"datetime"===e.column.type&&(this.datePickerObj=new jq(Pe({format:t,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params))),this.datePickerObj.addEventListener(sD,this.dpOpen),this.datePickerObj.appendTo(this.inputElem)},kG.prototype.write=function(e){document.querySelector("#dateui-"+e.column.uid).ej2_instances[0].value=je(e.filteredValue)?null:new Date(e.filteredValue)},kG.prototype.read=function(e,t,i,n){var o=je(o=document.querySelector("#dateui-"+t.uid).ej2_instances[0].value)?null:o;n.filterByColumn(t.field,i,o,"and",!0)},kG.prototype.openPopup=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},kG.prototype.destroy=function(){this.parent.off(dI,this.destroy),this.parent.off(Cx,this.destroy),je(this.datePickerObj)||this.datePickerObj.isDestroyed||(this.datePickerObj.removeEventListener(sD,this.dpOpen),this.datePickerObj.destroy())};var MG=kG;function kG(e,t,i){this.dpOpen=this.openPopup.bind(this),this.parent=e,this.locator=t,this.fltrSettings=i,this.parent&&(this.parent.on(dI,this.destroy,this),this.parent.on(Cx,this.destroy,this))}BG.prototype.clearCustomFilter=function(e){this.clearBtnClick(e)},BG.prototype.applyCustomFilter=function(e){this.filterBtnClick(e.col)},BG.prototype.openDialog=function(e){this.options=e,this.col=this.parent.getColumnByField(e.field),(je(this.col.filter)||je(this.col.filter.type)||"Menu"===this.col.filter.type)&&this.renderDlgContent(e.target,this.col)},BG.prototype.closeDialog=function(e){var t=this;if(this.dlgObj){var i=document.getElementById(this.dlgObj.element.id);if(this.dlgObj&&!this.dlgObj.isDestroyed&&i){e={cancel:!1,column:this.col,target:e,element:i};if(e.cancel)return void(this.parent.isColumnMenuFilterClosing=!1);this.parent.notify(dI,e),this.isDialogOpen=!1,this.isMenuCheck&&(this.menuFilterBase.unWireEvents(),this.parent.off(zI,this.actionComplete),this.isMenuCheck=!1);var e=this.col,e=(je(e.filter)||je(e.filter.ui)||je(e.filter.ui.destroy)||(e="string"==typeof(e=e.filter.ui.destroy)?R(e,window):e)(),(this.parent.isReact||this.parent.isVue)&&this.col.filterTemplate&&this.col.filterTemplate instanceof Function?this.parent.clearTemplate(["filterTemplate"],void 0,function(){t.dlgObj.destroy()}):(this.dlgObj.destroy(),ue(i)),document.getElementById(this.parent.element.id+"_e-popup"));je(e)||(ue(e),0),je(this.dlgObj.storeActiveElement)||this.dlgObj.storeActiveElement.focus()}this.parent.notify(NT,{})}},BG.prototype.renderDlgContent=function(e,t){var i={requestType:H1,columnName:t.field,columnType:t.type},i=((i.filterModel=this).parent.trigger(WA,i),this.parent.createElement("div",{className:"e-flmenu-maindiv",id:t.uid+"-flmenu"}));this.dlgDiv=this.parent.createElement("div",{className:"e-flmenu",id:t.uid+"-flmdlg"}),this.dlgDiv.setAttribute("aria-label",this.l10n.getConstant("FilterMenuDialogARIA")),(this.parent.enableAdaptiveUI?document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv"):this.parent.element).appendChild(this.dlgDiv),this.dlgObj=new pS({showCloseIcon:!1,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,created:this.dialogCreated.bind(this,e,t),position:this.parent.element.classList.contains("e-device")?{X:"center",Y:"center"}:{X:"",Y:""},target:this.parent.element.classList.contains("e-device")?document.body:this.parent.element,buttons:[{click:this.filterBtnClick.bind(this,t),buttonModel:{content:this.l10n.getConstant("FilterButton"),isPrimary:!0,cssClass:this.parent.cssClass?"e-flmenu-okbtn "+this.parent.cssClass:"e-flmenu-okbtn"}},{click:this.clearBtnClick.bind(this,t),buttonModel:{content:this.l10n.getConstant("ClearButton"),cssClass:this.parent.cssClass?"e-flmenu-cancelbtn "+this.parent.cssClass:"e-flmenu-cancelbtn"}}],content:i,width:!je(A(e,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:250,animationSettings:{effect:"None"},cssClass:this.parent.cssClass?"e-filter-popup "+this.parent.cssClass:"e-filter-popup"});this.dlgObj.isStringTemplate=!0,this.renderResponsiveDialog(),this.dlgObj.appendTo(this.dlgDiv)},BG.prototype.renderResponsiveDialog=function(){this.parent.enableAdaptiveUI&&(this.dlgObj.position={X:"",Y:""},this.dlgObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv"),this.dlgObj.width="100%",this.dlgObj.isModal=!1,this.dlgObj.buttons=[{}])},BG.prototype.dialogCreated=function(e,t){!F.isDevice&&e?wB(e,this.dlgObj):this.options.isResponsiveFilter||(this.dlgObj.position={X:"center",Y:"center"}),this.currentDialogCreatedColumn=t,this.renderFilterUI(e,t),t.isForeignColumn()&&(je(t.filter)||je(t.filter.ui)||je(t.filter.ui.create))||this.afterRenderFilterUI();var e=this.parent.isReact&&"string"!=typeof t.filterTemplate,i=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;je(t.filterTemplate)||e||i?je(this.dlgDiv.querySelector(".e-flmenu-input"))||(this.dlgDiv.querySelector(".e-flmenu-input").focus(),this.dlgDiv.querySelector(".e-flmenu-input").parentElement.classList.add("e-input-focus")):(this.dlgDiv.querySelector(".e-flmenu-valuediv").firstElementChild.focus(),this.dlgDiv.querySelector(".e-flmenu-valuediv").firstElementChild.classList.add("e-input-focus"))},BG.prototype.afterRenderFilterUI=function(){var e=this.currentDialogCreatedColumn,t=(e.showColumnMenu&&this.parent.notify(hI,{}),this.parent.enableAdaptiveUI?(this.dlgObj.element.style.left="0px",this.dlgObj.element.style.maxHeight="none"):this.dlgObj.element.style.maxHeight=this.maxHeight,this.dlgObj.show(),this.parent.getContent().firstElementChild.offsetHeight<this.dlgObj.element.offsetHeight&&!A(this.parent.element,"e-gantt-dialog")&&rF(this.parent,this.dlgObj),this.dlgObj.element.querySelector(".e-flm_optrdiv").querySelector("input")),i=this.dlgObj.element.querySelector(".e-flmenu-valuediv").querySelector("input"),t=("Empty"===t.value||"Not Empty"===t.value||"Null"===t.value||"Not Null"===t.value?je(i.ej2_instances)?i.setAttribute("disabled","true"):i.ej2_instances[0].enabled=!1:je(i&&i.getAttribute("disabled"))||(je(i.ej2_instances)?i.removeAttribute("disabled"):i.ej2_instances[0].enabled=!0),e.filterTemplate||this.writeMethod(e,this.dlgObj.element.querySelector("#"+e.uid+"-flmenu")),{requestType:_1,columnName:e.field,columnType:e.type});(t.filterModel=this).isDialogOpen=!0,this.isMenuCheck||this.parent.trigger(QA,t)},BG.prototype.renderFilterUI=function(e,t){var i=this.dlgObj.element.querySelector(".e-flmenu-maindiv");this.parent.log("column_type_missing",{column:t}),this.renderOperatorUI(i,e,t),this.renderFlValueUI(i,e,t)},BG.prototype.renderOperatorUI=function(e,t,i){this.flMuiObj.renderOperatorUI(e,t,i,this.dlgObj,this.filterObj.menuOperator)},BG.prototype.renderFlValueUI=function(e,t,i){var n,o,r,s=this.parent.createElement("div",{className:"e-flmenu-valuediv"}),a=this.filterObj,e=(e.appendChild(s),new this.colTypes[i.type](this.parent,this.serviceLocator,this.parent.filterSettings));i.filterTemplate?((n={})[i.field]=n.value=a.values[i.field],i.foreignKeyValue&&(n[i.foreignKeyValue]=a.values[i.field],n[i.field]=void 0),a=this.parent.isReact&&"string"!=typeof i.filterTemplate&&!(i.filterTemplate.prototype&&i.filterTemplate.prototype.CSPTemplate),o=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,r=this.parent.element.id+(n.column=i).uid+"filterTemplate",a||o?(i.getFilterTemplate()(n,this.parent,"filterTemplate",r,null,null,s),this.parent.renderTemplates()):eB(s,i.getFilterTemplate()(n,this.parent,"filterTemplate",r,null,null,null,this.parent.root)),this.isMenuCheck&&(this.menuFilterBase.cBox=this.dlgObj.element.querySelector(".e-checkboxlist.e-fields"),this.menuFilterBase.wireEvents(),this.parent.on(zI,this.actionComplete,this),this.menuFilterBase.getAllData())):je(i.filter)||je(i.filter.ui)||je(i.filter.ui.create)?e.create({column:i,target:s,getOptrInstance:this.flMuiObj,localizeText:this.l10n,dialogObj:this.dlgObj}):(a="string"==typeof(a=i.filter.ui.create)?R(a,window):a)({column:i,target:s,getOptrInstance:this.flMuiObj,dialogObj:this.dlgObj})},BG.prototype.writeMethod=function(e,t){for(var i,t=t.querySelector(".e-flmenu-valinput"),n=new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings),o=0,r=this.filterSettings.columns;o<r.length;o++){var s=r[o];e.uid===s.uid&&(i=s.value)}je(e.filter)||je(e.filter.ui)||je(e.filter.ui.write)?n.write({column:e,target:t,parent:this.parent,filteredValue:i}):(n="string"==typeof(n=e.filter.ui.write)?R(n,window):n)({column:e,target:t,parent:this.parent,filteredValue:i})},BG.prototype.filterBtnClick=function(e){var t,i,n,o=this.dlgObj.element.querySelector(".e-flmenu-valuediv input"),r=this.flMuiObj.getFlOperator(),s=new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings);e.filterTemplate?(i=void 0,(t=this.dlgDiv.querySelector(".e-flmenu-valuediv")).children[0].value?i=t.children[0].value:je(t.children[0].ej2_instances)?je(n=t.querySelector(".e-control"))||(i="boolean"===e.type?n.checked:(je(n.ej2_instances)?n:n.ej2_instances[0]).value):i=(this.parent.isAngular?t.children[0]:t.querySelector("input")).ej2_instances[0].value,this.filterObj.filterByColumn(e.field,r,i)):je(e.filter)||je(e.filter.ui)||je(e.filter.ui.read)?s.read(o,e,r,this.filterObj):(n="string"==typeof(n=e.filter.ui.read)?R(n,window):n)({element:o,column:e,operator:r,fltrObj:this.filterObj}),this.closeDialog(),this.parent.showColumnMenu&&this.parent.notify(dE,{})},BG.prototype.closeResponsiveDialog=function(){this.closeDialog()},BG.prototype.clearBtnClick=function(e){this.filterObj.removeFilteredColsByField(e.field),this.closeDialog(),this.parent.showColumnMenu&&this.parent.notify(dE,{})},BG.prototype.destroy=function(){this.closeDialog()},BG.prototype.getFilterUIInfo=function(){return{field:this.col.field,operator:this.flMuiObj.getFlOperator()}},BG.prototype.getOperatorDropdown=function(){return this.flMuiObj.dropOptr},BG.prototype.renderCheckBoxMenu=function(){return this.isMenuCheck=!0,this.menuFilterBase.updateModel(this.options),this.menuFilterBase.getAndSetChkElem(this.options),this.dlgObj.buttons=[{click:this.menuFilterBase.btnClick.bind(this.menuFilterBase),buttonModel:{content:this.menuFilterBase.getLocalizedLabel("FilterButton"),cssClass:"e-primary",isPrimary:!0}},{click:this.menuFilterBase.btnClick.bind(this.menuFilterBase),buttonModel:{cssClass:"e-flat",content:this.menuFilterBase.getLocalizedLabel("ClearButton")}}],this.menuFilterBase.dialogObj=this.dlgObj,this.menuFilterBase.dlg=this.dlgObj.element,this.menuFilterBase.dlg.classList.add("e-menucheckbox"),this.menuFilterBase.dlg.classList.remove("e-checkboxfilter"),this.maxHeight="800px",this.menuFilterBase.sBox.innerHTML},BG.prototype.actionComplete=function(e){this.isMenuCheck&&this.parent.trigger(QA,e)};var PG=BG;function BG(e,t,i,n,o){this.isDialogOpen=!1,this.maxHeight="350px",this.isMenuCheck=!1,this.colTypes={string:AG,number:IG,date:MG,dateonly:MG,boolean:EG,datetime:MG},this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.customFilterOperators=n,this.filterObj=o,this.flMuiObj=new CG(this.parent,this.customFilterOperators,this.serviceLocator),this.l10n=this.serviceLocator.getService("localization"),this.menuFilterBase=new B_(e)}LG.prototype.destroy=function(){this.removeEventListener(),this.checkBoxBase.closeDialog()},LG.prototype.openDialog=function(e){this.checkBoxBase.openDialog(e),this.parent.log("column_type_missing",{column:e.column})},LG.prototype.closeDialog=function(){this.destroy(),this.isresetFocus&&this.parent.notify(qI,{})},LG.prototype.closeResponsiveDialog=function(){this.checkBoxBase.closeDialog()},LG.prototype.getModuleName=function(){return"checkboxFilter"},LG.prototype.actionBegin=function(e){this.parent.trigger(WA,e)},LG.prototype.actionComplete=function(e){this.parent.trigger(QA,e)},LG.prototype.actionPrevent=function(e){mB(this.parent)&&(this.parent.notify(zx,e),e.cancel=!0)},LG.prototype.clearCustomFilter=function(e){this.checkBoxBase.clearFilter(e)},LG.prototype.applyCustomFilter=function(){this.checkBoxBase.fltrBtnHandler(),this.checkBoxBase.closeDialog()},LG.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(HI,this.actionBegin,this),this.parent.on(zI,this.actionComplete,this),this.parent.on(jI,this.actionPrevent,this))},LG.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(HI,this.actionBegin),this.parent.off(zI,this.actionComplete),this.parent.off(jI,this.actionPrevent))};var FG=LG;function LG(e,t,i){this.parent=e,this.isresetFocus=!0,this.checkBoxBase=new B_(e),this.addEventListener()}RG=function(e,t){return(RG=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}RG(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(VG,OG=FG),VG.prototype.destroy=function(){this.excelFilterBase.closeDialog()},VG.prototype.openDialog=function(e){this.excelFilterBase.openDialog(e)},VG.prototype.closeDialog=function(){this.excelFilterBase.closeDialog(),this.isresetFocus&&this.parent.notify(qI,{})},VG.prototype.clearCustomFilter=function(e){this.excelFilterBase.clearFilter(e)},VG.prototype.closeResponsiveDialog=function(e){e?this.excelFilterBase.removeDialog():this.closeDialog()},VG.prototype.applyCustomFilter=function(e){e.isCustomFilter?this.excelFilterBase.filterBtnClick(e.col.field):(this.excelFilterBase.fltrBtnHandler(),this.excelFilterBase.closeDialog())},VG.prototype.filterByColumn=function(e,t,i,n,o,r,s,a){this.excelFilterBase.filterByColumn(e,t,i,n,o,r,s,a)},VG.prototype.getFilterUIInfo=function(){return this.excelFilterBase.getFilterUIInfo()},VG.prototype.getModuleName=function(){return"excelFilter"};var RG,OG,NG=VG;function VG(e,t,i,n){t=OG.call(this,e,t,i)||this;return t.parent=e,t.isresetFocus=!0,t.excelFilterBase=new Zq(e,n),t}HG.prototype.render=function(e){if(!Sa.getObject("args.isFrozen",e)){e=this.parent;if(this.l10n=this.serviceLocator.getService("localization"),this.getLocalizedCustomOperators(),"FilterBar"===this.parent.filterSettings.type&&e.columns.length){var t=this.parent.element.querySelector(".e-filterbar"),t=(t&&ue(t),new yD(this.serviceLocator,LA.Filter,e)),i=(this.serviceLocator.getService("cellRendererFactory").addCellRenderer(LA.Filter,new bG(this.parent,this.serviceLocator)),this.valueFormatter=this.serviceLocator.getService("valueFormatter"),t.element=this.parent.createElement("tr",{className:"e-filterbar",attrs:{role:"row"}}),this.generateRow()),n=(i.data=this.values,this.parent.getHeaderContent().querySelector("thead:not(.e-masked-thead)").appendChild(t.element),this.parent.element.querySelector(".e-rowdragheader"));if(this.element=t.render(i,e.getColumns(),null,null,t.element),this.element.querySelectorAll(".e-leftfreeze").length&&(this.element.querySelectorAll(".e-indentcell").length||this.element.querySelectorAll(".e-grouptopleftcell").length))for(var o=this.element.querySelectorAll(".e-indentcell, .e-grouptopleftcell"),r=0;r<o.length;r++)o[parseInt(r.toString(),10)].classList.add("e-leftfreeze"),dF(o[parseInt(r.toString(),10)],30*r,this.parent.enableRtl,"Left");hF(this.element);i=this.element.querySelector(".e-detailheadercell"),e=(i&&(i.className="e-filterbarcell e-mastercell"),n&&(n.classList.contains("e-leftfreeze")?n.className="e-dragheadercell e-mastercell e-leftfreeze":n.className="e-filterbarcell e-mastercell"),[].slice.call(this.element.getElementsByClassName("e-grouptopleftcell")));e.length&&e[e.length-1].classList.add("e-lastgrouptopleftcell"),this.wireEvents(),this.parent.notify(oI,{case:"filter"})}}},HG.prototype.showCustomFilter=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog(this.column)},HG.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},HG.prototype.setFilterModel=function(e){e=e.filter.type||this.parent.filterSettings.type;this.filterModule=new this.type[""+e](this.parent,this.parent.filterSettings,this.serviceLocator,this.customOperators,this)},HG.prototype.destroy=function(){var e=this.parent.element;if(e&&(e.querySelector("."+RE)||e.querySelector("."+OE))){if(this.filterModule&&this.filterModule.destroy(),this.parent.refreshing||!this.parent.isDestroyed&&this.parent.allowFiltering||(this.filterSettings.columns=[]),this.updateFilterMsg(),this.removeEventListener(),this.unWireEvents(),"FilterBar"===this.filterSettings.type&&!this.parent.isDestroyed){if(this.filterSettings.showFilterBarOperator)for(var t=[].slice.call(this.element.getElementsByClassName("e-filterbaroperator")),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].ej2_instances[0]&&t[parseInt(i.toString(),10)].ej2_instances[0].destroy();this.parent.getColumns().map(function(e){e.filterBarTemplate&&!je(e.filterBarTemplate.destroy)&&(e="string"==typeof(e=e.filterBarTemplate.destroy)?R(e,window):e)()})}if(this.element){if(this.element.parentElement){for(i=0;i<this.inputList.length;i++)HF.destroy(this.inputList[parseInt(i.toString(),10)],this.inputList[parseInt(i.toString(),10)].element.nextElementSibling),ue(this.inputList[parseInt(i.toString(),10)].element);this.inputList=[],ue(this.element),this.element=null}e=this.parent.getHeaderContent().querySelector(".e-filterbar");e&&ue(e)}}},HG.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,NA.isFilter)},HG.prototype.generateRow=function(){var e=new DE({});return e.cells=this.generateCells(),e},HG.prototype.generateCells=function(){var e=[];if(this.parent.allowGrouping)for(var t=0,i=this.parent.groupSettings.columns.length;t<i;t++)e.push(this.generateCell({},LA.HeaderIndent));(this.parent.detailTemplate||this.parent.childGrid)&&e.push(this.generateCell({},LA.DetailHeader)),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&e.push(this.generateCell({},LA.RowDragHIcon));for(var n=0,o=this.parent.getColumns();n<o.length;n++){var r=o[n];e.push(this.generateCell(r))}return this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&e.push(this.generateCell({},LA.RowDragHIcon)),e},HG.prototype.generateCell=function(e,t){e={visible:e.visible,isDataCell:!1,rowId:"",column:e,cellType:t||LA.Filter,attributes:{title:this.l10n.getConstant("FilterbarTitle")}};return new kE(e)},HG.prototype.updateModel=function(){for(var e=this.column.isForeignColumn()?this.parent.getColumnByUid(this.column.uid):this.parent.getColumnByField(this.fieldName),t=(this.filterObjIndex=this.getFilteredColsIndexByField(e),this.prevFilterObject=this.filterSettings.columns[this.filterObjIndex],Array.isArray(this.value)&&this.value.length?this.value:[this.value]),i=this.parent.dataSource.adaptor&&this.parent.dataSource.adaptor.getModuleName?this.parent.dataSource.adaptor.getModuleName():void 0,n=0,o=t.length;n<o;n++){var r=e.isForeignColumn()?e.foreignKeyValue:this.fieldName,s="notequal"===this.operator,a=("in"===this.operator||"notin"===this.operator?(!this.parent.getDataModule().isRemote()||"date"!==e.type&&"dateonly"!==e.type&&"datetime"!==e.type||(t=Sa.parse.arrayReplacer(t)),this.currentFilterObject={field:r,uid:e.uid,isForeignKey:e.isForeignColumn(),operator:this.operator,value:t,predicate:this.predicate,matchCase:this.matchCase,ignoreAccent:this.ignoreAccent,actualFilterValue:{},actualOperator:{}},o=0):this.currentFilterObject={field:r,uid:e.uid,isForeignKey:e.isForeignColumn(),operator:this.operator,value:t[parseInt(n.toString(),10)],predicate:this.predicate,matchCase:this.matchCase,ignoreAccent:this.ignoreAccent,actualFilterValue:{},actualOperator:{}},this.getFilteredColsIndexByField(e));-1<a&&(!Array.isArray(this.value)||Array.isArray(this.value)&&("in"===this.operator||"notin"===this.operator))?this.filterSettings.columns[parseInt(a.toString(),10)]=this.currentFilterObject:this.filterSettings.columns.push(this.currentFilterObject),this.column.isForeignColumn()||!this.prevFilterObject||!je(this.prevFilterObject.value)&&""!==this.prevFilterObject.value||"equal"!==this.prevFilterObject.operator&&"notequal"!==this.prevFilterObject.operator||"ODataAdaptor"===i||"ODataV4Adaptor"===i||this.handleExistingFilterCleanup(r),this.column.isForeignColumn()||!je(this.value)||"equal"!==this.operator&&"notequal"!==this.operator||"ODataAdaptor"===i||"ODataV4Adaptor"===i||(this.handleExistingFilterCleanup(r),"string"===e.type&&this.filterSettings.columns.push({field:r,ignoreAccent:this.ignoreAccent,matchCase:this.matchCase,operator:this.operator,predicate:s?"and":"or",value:""}),this.filterSettings.columns.push({field:r,ignoreAccent:this.ignoreAccent,matchCase:this.matchCase,operator:this.operator,predicate:s?"and":"or",value:void 0}),this.filterSettings.columns.push({field:r,ignoreAccent:this.ignoreAccent,matchCase:this.matchCase,operator:this.operator,predicate:s?"and":"or",value:null}))}this.filterSettings.columns=this.filterSettings.columns,this.parent.dataBind()},HG.prototype.handleExistingFilterCleanup=function(e){for(var t=0;t<this.filterSettings.columns.length;t++)this.filterSettings.columns[""+t].field!==e||"equal"!==this.filterSettings.columns[""+t].operator&&"notequal"!==this.filterSettings.columns[""+t].operator||!je(this.filterSettings.columns[""+t].value)||(this.filterSettings.columns.splice(t,1),t-=1)},HG.prototype.getFilteredColsIndexByField=function(e){for(var t=this.filterSettings.columns,i=0,n=t.length;i<n;i++)if(t[parseInt(i.toString(),10)].uid===e.uid||e.isForeignColumn()&&this.parent.getColumnByUid(e.uid).field===e.foreignKeyValue)return i;return-1},HG.prototype.onActionComplete=function(e){var t=this.isRemove?{requestType:"filtering",type:QA}:{currentFilterObject:this.currentFilterObject,currentFilteringColumn:je(this.column)?void 0:this.column.field,columns:this.filterSettings.columns,requestType:"filtering",type:QA};this.parent.trigger(QA,Pe(e,t)),this.isRemove=!1},HG.prototype.wireEvents=function(){E.add(this.parent.getHeaderContent(),"keyup",this.keyUpHandlerImmediate,this)},HG.prototype.unWireEvents=function(){E.remove(this.parent.getHeaderContent(),"keyup",this.keyUpHandlerImmediate)},HG.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.parent.getHeaderTable().classList.add("e-sortfilter"),this.render())},HG.prototype.refreshFilterValue=function(){je(this.parent.modelObserver.boundedEvents)||this.parent.removeEventListener(D1,this.refreshFilterValueFn),"FilterBar"!==this.filterSettings.type&&"Excel"!==this.filterSettings.type||!this.filterSettings.columns.length||this.parent.getCurrentViewRecords().length||this.initialEnd()},HG.prototype.initialEnd=function(){if(this.parent.off(X1,this.initialEnd),this.parent.getColumns().length&&this.filterSettings.columns.length){var e=this.parent;this.contentRefresh=!1,this.initialLoad=!0;for(var t=0,i=e.filterSettings.columns;t<i.length;t++){var n=i[t];this.filterByColumn(n.field,n.operator,n.value,n.predicate,n.matchCase,n.ignoreAccent,n.actualFilterValue,n.actualOperator,n.isForeignKey)}this.initialLoad=!1,this.updateFilterMsg(),this.contentRefresh=!0}},HG.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(WT,this.setFullScreenDialog,this),this.parent.on(K1,this.enableAfterRender,this),this.parent.on(ox,this.onActionComplete,this),this.parent.on(Z1,this.onPropertyChanged,this),this.parent.on(bx,this.keyUpHandler,this),this.parent.on(Ix,this.columnPositionChanged,this),this.parent.on(tx,this.render,this),this.parent.on(X1,this.initialEnd,this),this.parent.on(dI,this.filterMenuClose,this),this.parent.on(vE,this.renderResponsiveChangeAction,this),this.docClickHandler=this.clickHandler.bind(this),E.add(document,"click",this.docClickHandler,this),E.add(this.parent.element,"mousedown",this.refreshClearIcon,this),this.parent.on(lI,this.columnMenuFilter,this),this.parent.on(wx,this.filterIconClickHandler,this),this.parent.on("persist-data-changed",this.initialEnd,this),this.parent.on(gT,this.clickHandler,this),this.parent.on(Cx,this.destroy,this),this.refreshFilterValueFn=this.refreshFilterValue.bind(this),this.parent.addEventListener(D1,this.refreshFilterValueFn))},HG.prototype.removeEventListener=function(){E.remove(document,"click",this.docClickHandler),E.remove(this.parent.element,"mousedown",this.refreshClearIcon),this.parent.isDestroyed||(this.parent.off(WT,this.setFullScreenDialog),this.parent.off(K1,this.enableAfterRender),this.parent.off(ox,this.onActionComplete),this.parent.off(Z1,this.onPropertyChanged),this.parent.off(bx,this.keyUpHandler),this.parent.off(Ix,this.columnPositionChanged),this.parent.off(tx,this.render),this.parent.off(lI,this.columnMenuFilter),this.parent.off(dI,this.filterMenuClose),this.parent.off(vE,this.renderResponsiveChangeAction),this.parent.off(wx,this.filterIconClickHandler),this.parent.off(gT,this.clickHandler),this.parent.off(Cx,this.destroy))},HG.prototype.refreshClearIcon=function(e){this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type&&e.target.closest("th")&&e.target.closest("th").classList.contains("e-filterbarcell")&&e.target.classList.contains("e-clear-icon")&&(e=e.target.previousElementSibling,HF.setValue(null,e,"Never",!0),"Immediate"===this.filterSettings.mode)&&this.removeFilteredColsByField(e.id.slice(0,-14))},HG.prototype.filterMenuClose=function(){this.fltrDlgDetails.isOpen=!1},HG.prototype.filterByColumn=function(e,t,i,n,o,r,s,a,l){var h,d=this,p=this.parent;if("string"==typeof i&&(i=this.parent.sanitize(i)),this.column=p.grabColumnByFieldFromAllCols(e,l),"like"===(t="FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&je(this.column.filterBarTemplate)&&je(this.column.filterTemplate)?this.getOperatorName(e):t)&&i&&-1===i.indexOf("%")&&(i="%"+i+"%"),this.column)if("FilterBar"===this.filterSettings.type&&(h=p.getHeaderContent().querySelector("[id='"+this.column.field+"_filterBarcell']")),je(this.column.allowFiltering)||this.column.allowFiltering)if(mB(p))p.notify(zx,{instance:this,handler:this.filterByColumn,arg1:e,arg2:t,arg3:i,arg4:n,arg5:o,arg6:r,arg7:s,arg8:a});else{if(this.predicate=n||(Array.isArray(i)?"or":"and"),this.value=i,this.matchCase=o||!1,this.ignoreAccent=this.ignoreAccent=je(r)?this.parent.filterSettings.ignoreAccent:r,this.fieldName=e,this.operator=t,""===(i=je(i)?i:i.toString())&&(i=null),"number"!==this.column.type&&"date"!==this.column.type||(this.matchCase=!0),h&&"FilterBar"===this.filterSettings.type){if(i&&i.length<1||!this.filterByMethod&&this.checkForSkipInput(this.column,i))return this.filterStatusMsg=i&&i.length<1?"":this.l10n.getConstant("InvalidFilterMessage"),void this.updateFilterMsg();h.value!==i&&(h.value=i)}je(this.column.format)?this.values[this.column.field]=i:(this.applyColumnFormat(i),this.initialLoad&&"FilterBar"===this.filterSettings.type&&(h.value=this.values[this.column.field]));l={field:this.fieldName,predicate:n,matchCase:o,ignoreAccent:r,operator:this.operator,value:this.value,type:this.column.type};1<this.parent.filterSettings.columns.filter(function(e){return e.field===d.fieldName}).length&&!je(this.actualPredicate[this.fieldName])?this.actualPredicate[this.fieldName].push(l):this.actualPredicate[this.fieldName]=[l],this.checkAlreadyColFiltered(this.column.field)||this.updateModel()}else this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:this.column.headerText})},HG.prototype.applyColumnFormat=function(e){var t=this,i="date"===this.column.type||"datetime"===this.column.type||"dateonly"===this.column.type?new Date(e):parseFloat(e);("date"===this.column.type||"datetime"===this.column.type||"dateonly"===this.column.type)&&e&&Array.isArray(this.value)&&1<e.split(",").length?this.values[this.column.field]=e.split(",").map(function(e){return""===e&&(e=null),t.setFormatForFlColumn(new Date(e),t.column)}):this.values[this.column.field]=this.setFormatForFlColumn(i,this.column)},HG.prototype.skipUid=function(e){for(var t=!0,i=Object.keys(e),n=0;n<i.length;n++){var o=Object.keys(e[i[parseInt(n.toString(),10)]]);1===o.length&&"uid"===o[0]&&(t=!1)}return t},HG.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var t=0,i=Object.keys(e.properties);t<i.length;t++){var n=i[t];switch(n){case"columns":var o={currentFilterObject:this.currentFilterObject,currentFilteringColumn:this.column?this.column.field:void 0,action:"filter",columns:this.filterSettings.columns,requestType:"filtering",type:WA,cancel:!1};if(this.contentRefresh&&this.skipUid(e.properties.columns)){if(this.parent.notify($1,o),o.cancel)return void("CheckBox"===this.filterSettings.type||"Excel"===this.filterSettings.type?(this.filterSettings.columns=this.actualData.length<=1?this.checkboxPrevFilterObject:this.checkboxFilterObject,this.actualPredicate[this.column.field]=this.filterSettings.columns,o=this.parent.getColumnByField(this.column.field),o=this.parent.showColumnMenu&&o.showColumnMenu?".e-columnmenu":".e-icon-filter",o=this.parent.getColumnHeaderByField(this.column.field).querySelector(o),0===this.checkboxPrevFilterObject.length?o.classList.remove("e-filtered"):o.classList.add("e-filtered")):je(this.prevFilterObject)?this.filterSettings.columns.splice(this.filterSettings.columns.length-1,1):this.filterSettings.columns[this.filterObjIndex]=this.prevFilterObject);this.updateFilterIcon(),this.refreshFilterSettings(),this.updateFilterMsg(),this.updateFilter()}break;case"showFilterBarStatus":e.properties[""+n]?this.updateFilterMsg():this.parent.allowPaging&&this.parent.updateExternalMessage("");break;case"showFilterBarOperator":case"type":this.parent.refreshHeader(),this.refreshFilterSettings(),"100%"===this.parent.height&&this.parent.scrollModule.refresh()}}},HG.prototype.refreshFilterSettings=function(){if("FilterBar"===this.filterSettings.type){for(var e=0;e<this.filterSettings.columns.length;e++){this.column=this.parent.grabColumnByUidFromAllCols(this.filterSettings.columns[parseInt(e.toString(),10)].uid);var t,i=!je(i=this.filterSettings.columns[parseInt(e.toString(),10)].value)&&i.toString();je(this.column.format)?(t=this.filterSettings.columns[parseInt(e.toString(),10)].field,this.values[""+t]=this.filterSettings.columns[parseInt(e.toString(),10)].value):this.applyColumnFormat(i),(n=this.getFilterBarElement(this.column.field))&&(""===this.cellText[this.filterSettings.columns[parseInt(e.toString(),10)].field]||je(this.cellText[this.filterSettings.columns[parseInt(e.toString(),10)].field])?n.value=this.filterSettings.columns[parseInt(e.toString(),10)].value:n.value=this.cellText[this.column.field])}if(0===this.filterSettings.columns.length)for(var n,o=this.parent.getColumns(),e=0;e<o.length;e++)(n=this.getFilterBarElement(o[parseInt(e.toString(),10)].field))&&""!==n.value&&(n.value="",delete this.values[o[parseInt(e.toString(),10)].field])}},HG.prototype.updateFilterIcon=function(){if(0===this.filterSettings.columns.length&&this.parent.element.querySelector(".e-filtered"))for(var e=[].slice.call(this.parent.element.getElementsByClassName("e-filtered")),t=0,i=e.length;t<i;t++)e[parseInt(t.toString(),10)].classList.remove("e-filtered")},HG.prototype.getFilterBarElement=function(e){var t,e="[id='"+e+"_filterBarcell']";return t=e&&!je(this.element)?this.element.querySelector(e):t},HG.prototype.refreshFilter=function(){this.refreshFilterSettings(),this.updateFilterMsg()},HG.prototype.clearFiltering=function(e){var t=this,i=XP(this.filterSettings.columns);if(je(e))if(mB(this.parent))this.parent.notify(zx,{instance:this,handler:this.clearFiltering});else{for(var n=0;n<i.length;n++)i[parseInt(n.toString(),10)].uid=i[parseInt(n.toString(),10)].uid||this.parent.getColumnByField(i[parseInt(n.toString(),10)].field).uid;var o=i.map(function(e){return e.uid}),r=o.filter(function(e,t){return o.indexOf(e)===t});this.refresh=!1;for(var n=0,s=r.length;n<s;n++)this.removeFilteredColsByField(this.parent.getColumnByUid(r[parseInt(n.toString(),10)]).field,!1);if(this.refresh=!0,r.length&&this.parent.renderModule.refresh(),0===this.parent.filterSettings.columns.length&&this.parent.element.querySelector(".e-filtered"))for(var a=[].slice.call(this.parent.element.getElementsByClassName("e-filtered")),n=0,s=a.length;n<s;n++)a[0].classList.remove("e-filtered");this.isRemove=!0,this.filterStatusMsg="",this.updateFilterMsg()}else this.refresh=!1,e.forEach(function(e){t.removeFilteredColsByField(e,!1)}),this.parent.setProperties({filterSettings:{columns:this.filterSettings.columns}},!0),this.parent.renderModule.refresh(),this.refresh=!0},HG.prototype.checkAlreadyColFiltered=function(e){for(var t=0,i=this.filterSettings.columns;t<i.length;t++){var n=i[t];if(n.field===e&&"Menu"===this.parent.filterSettings.type&&("date"===n.type||"datetime"===n.type))return this.checkDateColumnValue(n.value,this.value)&&n.operator===this.operator&&n.predicate===this.predicate;if(n.field===e&&n.value===this.value&&n.operator===this.operator&&n.predicate===this.predicate)return!0}return!1},HG.prototype.checkDateColumnValue=function(e,t){return!(!je(e)||!je(t))||e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()},HG.prototype.columnMenuFilter=function(e){this.column=e.col;var t=z(e.target,"#"+e.id);e.isClose&&!t?this.filterModule.closeDialog():t&&this.filterDialogOpen(this.column,e.target)},HG.prototype.filterDialogOpen=function(e,t,i,n){this.filterModule&&(this.filterModule.isresetFocus=!1,this.filterModule.closeDialog()),this.setFilterModel(e),this.filterModule.openDialog(this.createOptions(e,t,i,n))},HG.prototype.createOptions=function(e,t,i,n){var o=this.parent,r=e.filter.dataSource||o.dataSource&&"result"in o.dataSource?o.dataSource:o.getDataModule().dataManager,s=e.filter.type||this.parent.filterSettings.type;return{type:e.type,field:e.field,displayName:e.headerText,dataSource:r,format:e.format,height:800,columns:o.getColumns(),filteredColumns:o.filterSettings.columns,target:t,dataManager:o.getDataModule().dataManager,formatFn:e.getFormatter(),ignoreAccent:o.filterSettings.ignoreAccent,parserFn:e.getParser(),query:o.query,template:e.getFilterItemTemplate(),hideSearchbox:!je(e.filter.hideSearchbox)&&e.filter.hideSearchbox,handler:this.filterHandler.bind(this),localizedStrings:o.getLocaleConstants(),position:{X:i,Y:n},column:e,foreignKeyValue:e.foreignKeyValue,actualPredicate:this.actualPredicate,localeObj:o.localeObj,isRemote:o.getDataModule().isRemote(),allowCaseSensitive:this.filterSettings.enableCaseSensitivity,isResponsiveFilter:this.parent.enableAdaptiveUI,operator:this.actualPredicate[e.field]&&"Menu"===s?this.actualPredicate[e.field][0].operator:"equal",parentTotalDataCount:o.getDataModule().isRemote()&&o.allowPaging?o.pagerModule.pagerObj.totalRecordsCount:o.getDataModule().isRemote()?o.totalDataRecordsCount:o.getFilteredRecords().length,parentCurrentViewDataCount:o.currentViewData.length,parentFilteredLocalRecords:o.getDataModule().isRemote()?[]:o.getFilteredRecords()}},HG.prototype.removeFilteredColsByField=function(r,s){var a,l=this.filterSettings.columns;if(mB(this.parent))e={instance:this,handler:this.removeFilteredColsByField,arg1:r,arg2:s},this.parent.notify(zx,e);else{for(var e,i=l.map(function(e){return e.uid}),h=i.filter(function(e,t){return i.indexOf(e)===t}),d=(je(this.column)||(e=this.column.isForeignColumn()?this.parent.getColumnByUid(this.column.uid):this.parent.getColumnByField(r),this.filterObjIndex=this.getFilteredColsIndexByField(e),this.prevFilterObject=this.filterSettings.columns[this.filterObjIndex]),this),t=0,n=h.length;t<n;t++)if("break"===function(e){l[parseInt(e.toString(),10)].uid=l[parseInt(e.toString(),10)].uid||d.parent.getColumnByField(l[parseInt(e.toString(),10)].field).uid;var t=l.length,i=d.parent.grabColumnByUidFromAllCols(h[parseInt(e.toString(),10)]);if(i.field===r||i.field===i.foreignKeyValue&&i.isForeignColumn()){e=d.filterSettings.columns.filter(function(e){return e.uid===i.uid})[0];for("FilterBar"===d.filterSettings.type&&!s&&(o="[id='"+i.field+"_filterBarcell']",a=d.parent.getHeaderContent().querySelector(o))&&(a.value="",delete d.values[""+r]);t--;)l[parseInt(t.toString(),10)].uid===i.uid&&l.splice(t,1);var n,o=d.parent.getColumnHeaderByField(i.field);return"FilterBar"===d.filterSettings.type&&!d.parent.showColumnMenu||(n=d.parent.showColumnMenu&&i.showColumnMenu?".e-columnmenu":".e-icon-filter",o.querySelector(n).classList.remove("e-filtered")),d.isRemove=!0,d.actualPredicate[""+r]&&delete d.actualPredicate[""+r],d.values[""+r]&&delete d.values[""+r],d.refresh&&d.parent.notify($1,{requestType:"filtering",type:WA,currentFilterObject:e,currentFilterColumn:i,action:"clearFilter"}),"break"}}(t))break;this.updateFilterMsg()}},HG.prototype.getModuleName=function(){return"filter"},HG.prototype.keyUpHandlerImmediate=function(e){13!==e.keyCode&&this.keyUpHandler(e)},HG.prototype.keyUpHandler=function(e){var t=this.parent,i=e.target;if(i&&ft(i,".e-filterbar input")){var n=z(i,"th.e-filterbarcell");if(this.column=t.getColumnByUid(n.getAttribute("e-mappinguid")),!this.column)return;"altDownArrow"===e.action&&this.parent.filterSettings.showFilterBarOperator&&((n=z(i,"span").querySelector(".e-filterbaroperator")).ej2_instances[0].showPopup(),n.focus()),"Immediate"!==this.filterSettings.mode&&(13!==e.keyCode||e.target.classList.contains("e-filterbaroperator"))||9===e.keyCode||this.column.filterTemplate||(this.value=i.value.trim(),this.processFilter(e))}"altDownArrow"!==e.action||"FilterBar"===this.filterSettings.type||A(e.target,"e-toolbar")||!je(this.parent.element.querySelector(".e-filter-popup"))||this.parent.enableAdaptiveUI||(n=t.focusModule.currentInfo.element)&&n.classList.contains("e-headercell")&&!n.classList.contains("e-stackedheadercell")&&(i=t.getColumnByUid(n.firstElementChild.getAttribute("e-mappinguid")),this.openMenuByField(i.field),this.parent.focusModule.clearIndicator()),"escape"===e.action&&"Menu"===this.filterSettings.type&&this.filterModule&&(this.parent.showColumnMenu&&this.filterModule.isDialogOpen&&(this.parent.isColumnMenuFilterClosing=!0),this.filterModule.closeDialog(),t.notify(qI,{}),this.parent.showColumnMenu||t.notify(qI,{}))},HG.prototype.updateCrossIcon=function(e){e.value.length&&e.nextElementSibling.classList.remove("e-hide")},HG.prototype.updateFilterMsg=function(){if("FilterBar"===this.filterSettings.type){var e=this.parent,t=void 0,i=this.filterSettings.columns,n=void 0;if(this.filterSettings.showFilterBarStatus){if(0<i.length&&this.filterStatusMsg!==this.l10n.getConstant("InvalidFilterMessage")){this.filterStatusMsg="";for(var o=0;o<i.length;o++){var r,n=e.grabColumnByUidFromAllCols(i[parseInt(o.toString(),10)].uid)||e.grabColumnByFieldFromAllCols(i[parseInt(o.toString(),10)].field,i[parseInt(o.toString(),10)].isForeignKey);o&&(this.filterStatusMsg+=" && "),je(n.format)?this.filterStatusMsg+=n.headerText+": "+this.values[n.field]:(r="date"===n.type||"datetime"===n.type||"dateonly"===n.type?this.valueFormatter.fromView(this.values[n.field],n.getParser(),"dateonly"===n.type?"date":n.type):this.values[n.field],t="date"!==n.type&&"datetime"!==n.type&&"dateonly"!==n.type?this.serviceLocator.getService("valueFormatter").toView(r,n.getParser()).toString():this.setFormatForFlColumn(r,n),this.filterStatusMsg+=n.headerText+": "+t)}}e.allowPaging&&(e.updateExternalMessage(this.filterStatusMsg),"100%"===this.parent.height)&&this.parent.scrollModule.refresh(),this.filterStatusMsg=""}}},HG.prototype.setFormatForFlColumn=function(e,t){return this.serviceLocator.getService("valueFormatter").toView(e,t.getFormatter()).toString()},HG.prototype.checkForSkipInput=function(e,t){var i;if("number"===e.type)(Sa.operatorSymbols[""+t]||-1<this.skipNumberInput.indexOf(t))&&(i=!0);else if("string"===e.type)for(var n=0,o=t;n<o.length;n++){var r=o[n];-1<this.skipStringInput.indexOf(r)&&(i=!0)}return i},HG.prototype.processFilter=function(e){this.stopTimer(),this.startTimer(e)},HG.prototype.startTimer=function(e){var t=this;this.timer=window.setInterval(function(){t.onTimerTick()},13===e.keyCode?0:this.filterSettings.immediateModeDelay)},HG.prototype.stopTimer=function(){window.clearInterval(this.timer)},HG.prototype.onTimerTick=function(){var e,t="[id='"+this.column.field+"_filterBarcell']",i=(i=this.element.querySelector(t))||this.parent.getHeaderContent().querySelector(t);this.cellText[this.column.field]=i.value,this.stopTimer(),je(this.column.filterBarTemplate)?e=JSON.parse(JSON.stringify(i.value)):je(t="string"==typeof(t=this.column.filterBarTemplate.read)?R(t,window):t)||(this.value=t.call(this,i)),je(this.value)||""===this.value?this.removeFilteredColsByField(this.column.field):(this.validateFilterValue(this.value),this.filterByMethod=!1,this.filterByColumn(this.column.field,this.operator,this.value,this.predicate,this.filterSettings.enableCaseSensitivity,this.ignoreAccent,this.column.isForeignColumn()),this.filterByMethod=!0,i.value=e,this.updateFilterMsg())},HG.prototype.validateFilterValue=function(e){var t;switch(this.matchCase=this.filterSettings.enableCaseSensitivity,this.column.type){case"number":this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.equal;for(var i=[">","<","=","!"],n=0;n<e.length;n++)if(-1<i.indexOf(e[parseInt(n.toString(),10)])){t=n;break}this.getOperator(e.substring(t)),0!==t&&(this.value=e.substring(0,t)),""!==this.value&&1<=e.length&&(this.value=this.valueFormatter.fromView(this.value,this.column.getParser(),this.column.type)),isNaN(this.value)&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage"));break;case"date":case"datetime":this.operator=this.filterOperators.equal,""===this.value||this.value instanceof Date||(this.getOperator(e),this.value=this.valueFormatter.fromView(this.value,this.column.getParser(),this.column.type),je(this.value)&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage")));break;case"string":this.matchCase=!1,this.column.filter.operator?this.operator=this.column.filter.operator:-1!==e.indexOf("*")||-1!==e.indexOf("?")||-1!==e.indexOf("%3f")?this.operator=this.filterOperators.wildCard:-1!==e.indexOf("%")?this.operator=this.filterOperators.like:this.operator=this.filterOperators.startsWith;break;case"boolean":"true"===e.toLowerCase()||"1"===e?this.value=!0:"false"===e.toLowerCase()||"0"===e?this.value=!1:e.length&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage")),this.operator=this.filterOperators.equal;break;default:this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.equal}},HG.prototype.getOperator=function(e){var t=e.charAt(0),i=e.slice(0,2),n=Pe({"=":this.filterOperators.equal,"!":this.filterOperators.notEqual},Sa.operatorSymbols);(n.hasOwnProperty(t)||n.hasOwnProperty(i))&&(this.operator=n[""+t],this.value=e.substring(1),this.operator||(this.operator=n[""+i],this.value=e.substring(2))),this.operator!==this.filterOperators.lessThan&&this.operator!==this.filterOperators.greaterThan||"="===this.value.charAt(0)&&(this.operator=this.operator+"orequal",this.value=this.value.substring(1))},HG.prototype.columnPositionChanged=function(){this.parent.filterSettings.type},HG.prototype.getLocalizedCustomOperators=function(){var e=[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")}];this.customOperators={stringOperator:[{value:"startswith",text:this.l10n.getConstant("StartsWith")},{value:"endswith",text:this.l10n.getConstant("EndsWith")},{value:"contains",text:this.l10n.getConstant("Contains")},{value:"equal",text:this.l10n.getConstant("Equal")},{value:"isempty",text:this.l10n.getConstant("IsEmpty")},{value:"doesnotstartwith",text:this.l10n.getConstant("NotStartsWith")},{value:"doesnotendwith",text:this.l10n.getConstant("NotEndsWith")},{value:"doesnotcontain",text:this.l10n.getConstant("NotContains")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnotempty",text:this.l10n.getConstant("IsNotEmpty")},{value:"like",text:this.l10n.getConstant("Like")}],numberOperator:e,dateOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")}],datetimeOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")}],dateonlyOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")}],booleanOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}]},"Menu"===this.filterSettings.type&&(this.customOperators.stringOperator.push({value:"in",text:this.l10n.getConstant("In")},{value:"notin",text:this.l10n.getConstant("NotIn")}),this.customOperators.booleanOperator.push({value:"in",text:this.l10n.getConstant("In")},{value:"notin",text:this.l10n.getConstant("NotIn")}),this.customOperators.numberOperator.push({value:"in",text:this.l10n.getConstant("In")},{value:"notin",text:this.l10n.getConstant("NotIn")}))},HG.prototype.openMenuByField=function(e){var t,i,n=this.parent;n.enableAdaptiveUI?this.showCustomFilter(!1):(t=n.getColumnByField(e),(e=n.getColumnHeaderByField(e).querySelector(".e-filtermenudiv"))&&(n=n.element.getBoundingClientRect(),i=e.getBoundingClientRect(),this.filterDialogOpen(t,e,i.right-n.left,i.bottom-n.top)))},HG.prototype.filterIconClickHandler=function(e){var e=e.target;!e.classList.contains("e-filtermenudiv")||"Menu"!==this.parent.filterSettings.type&&"CheckBox"!==this.parent.filterSettings.type&&"Excel"!==this.parent.filterSettings.type||(e=this.parent.getColumnByUid(A(e,"e-headercell").firstElementChild.getAttribute("e-mappinguid")),this.column=e,this.fltrDlgDetails.field===e.field&&this.fltrDlgDetails.isOpen)||(this.filterModule&&this.filterModule.closeDialog(),this.fltrDlgDetails={field:e.field,isOpen:!0},this.openMenuByField(e.field))},HG.prototype.clickHandler=function(e){var t,i,n,o,r;"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&(A(e.target,"e-filterbarcell")&&e.target.classList.contains("e-input-group-icon")&&(z(e.target,"div").querySelector(".e-filterbaroperator")||e.target).focus(),e.target.classList.contains("e-list-item"))&&-1!==(t=document.querySelector(".e-popup-open").getAttribute("id").replace("_popup","")).indexOf("grid-column")&&z(document.getElementById(t),"div").querySelector(".e-filtertext").focus(),"Immediate"!==this.filterSettings.mode&&"Menu"!==this.parent.filterSettings.type&&"CheckBox"!==this.parent.filterSettings.type&&"Excel"!==this.parent.filterSettings.type||(e=(t=e.target).classList.contains("e-day"),i=A(this.parent.element,"e-dialog"),n=!1,o=A(t,"e-popup"),r=document.getElementById(this.parent.element.id+"_e-popup"),r=(this.parent.element.classList.contains("e-device")?document:r&&r.querySelector(".e-filter-popup")?r:this.parent.element).querySelector(".e-filter-popup"),i&&o&&(n=i.id===o.id),this.filterModule&&r&&(A(t,"e-excel-ascending")||A(t,"e-excel-descending"))&&this.filterModule.closeDialog(t),A(t,"e-filter-popup"))||t.classList.contains("e-filtermenudiv")||!this.filterModule||A(t,"e-date-overflow")||A(t,"e-popup-wrapper")||z(t,".e-filter-item.e-menu-item")||e||A(t,"e-search-wrapper")&&!r||(n&&!A(t,"e-filter-popup")&&!A(t,"e-popup-flmenu")||!o&&r)&&(this.filterModule.isresetFocus=A(t,"e-grid")&&A(t,"e-grid").id===this.parent.element.id&&!(A(t,"e-search-wrapper")&&r),this.filterModule.closeDialog(t))},HG.prototype.filterHandler=function(e){this.actualPredicate[e.field]=e.actualPredicate,this.actualData=Object.keys(this.actualPredicate);var t=new me(this.filterSettings.columns),i=(new ya).where("field",this.filterOperators.equal,e.field);this.checkboxFilterObject=t.dataSource.json,this.checkboxPrevFilterObject=t.executeLocal(i);for(var n=0;n<this.checkboxPrevFilterObject.length;n++){for(var o=-1,r=0;r<this.filterSettings.columns.length;r++)if(this.checkboxPrevFilterObject[parseInt(n.toString(),10)].field===this.filterSettings.columns[parseInt(r.toString(),10)].field){o=r;break}-1!==o&&this.filterSettings.columns.splice(o,1)}this.values[e.field]&&delete this.values[e.field];t=this.parent.getColumnByField(e.field),i=this.parent.showColumnMenu&&t.showColumnMenu?".e-columnmenu":".e-icon-filter",t=this.parent.getColumnHeaderByField(e.field).querySelector(i);"filtering"===e.action?(this.filterSettings.columns=this.filterSettings.columns.concat(e.filterCollection),this.filterSettings.columns.length&&t&&t.classList.add("e-filtered")):(t&&t.classList.remove("e-filtered"),e.requestType="filtering",this.parent.renderModule.refresh(e)),this.parent.dataBind()},HG.prototype.updateFilter=function(){var e=this.filterSettings.columns;this.actualPredicate={};for(var t=0;t<e.length;t++){this.column=this.parent.getColumnByField(e[parseInt(t.toString(),10)].field)||MB(e[parseInt(t.toString(),10)].field,this.parent.getForeignKeyColumns());var i=e[parseInt(t.toString(),10)].field;this.parent.getColumnByField(e[parseInt(t.toString(),10)].field)||(i=MB(e[parseInt(t.toString(),10)].field,this.parent.getForeignKeyColumns()).field),this.refreshFilterIcon(i,e[parseInt(t.toString(),10)].operator,e[parseInt(t.toString(),10)].value,e[parseInt(t.toString(),10)].type,e[parseInt(t.toString(),10)].predicate,e[parseInt(t.toString(),10)].matchCase,e[parseInt(t.toString(),10)].ignoreAccent,e[parseInt(t.toString(),10)].uid)}},HG.prototype.refreshFilterIcon=function(e,t,i,n,o,r,s,a){o={field:e,predicate:o,matchCase:r,ignoreAccent:s,operator:t,value:i,type:n},this.actualPredicate[""+e]?this.actualPredicate[""+e].push(o):this.actualPredicate[""+e]=[o],r=a?this.parent.grabColumnByUidFromAllCols(a).field:e;this.addFilteredClass(r)},HG.prototype.addFilteredClass=function(e){var t,i=this.parent.getColumnByField(e);this.parent.showColumnMenu&&i.showColumnMenu?t=this.parent.getColumnHeaderByField(e).querySelector(".e-columnmenu"):i&&(t=this.parent.getColumnHeaderByField(e).querySelector(".e-icon-filter")),t&&t.classList.add("e-filtered")},HG.prototype.getFilterUIInfo=function(){return this.filterModule?this.filterModule.getFilterUIInfo():{}},HG.prototype.getOperatorName=function(e){return document.getElementById(this.parent.getColumnByField(e).uid).ej2_instances[0].value},HG.prototype.renderCheckboxOnFilterMenu=function(){return this.filterModule.renderCheckBoxMenu()};var _G=HG;function HG(e,t,i){this.predicate="and",this.contentRefresh=!0,this.filterByMethod=!0,this.refresh=!0,this.values={},this.operators={},this.cellText={},this.nextFlMenuOpen="",this.type={Menu:PG,CheckBox:FG,Excel:NG},this.filterOperators={contains:"contains",endsWith:"endswith",equal:"equal",greaterThan:"greaterthan",greaterThanOrEqual:"greaterthanorequal",lessThan:"lessthan",lessThanOrEqual:"lessthanorequal",notEqual:"notequal",startsWith:"startswith",wildCard:"wildcard",isNull:"isnull",notNull:"notnull",like:"like"},this.fltrDlgDetails={field:"",isOpen:!1},this.skipNumberInput=["="," ","!"],this.skipStringInput=[">","<","="],this.actualPredicate={},this.inputList=[],this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.addEventListener(),this.setFullScreenDialog()}var zG={root:"e-rhandler",suppress:"e-rsuppress",icon:"e-ricon",helper:"e-rhelper",header:"th.e-headercell",cursor:"e-rcursor"},jG=(WG.prototype.autoFitColumns=function(e,t,i){var n=this,o=null==e||e.length<=0?this.parent.getColumns().map(function(e){return e.autoFit=!0,e.field}):"string"==typeof e?[e]:e;this.parent.isAutoFitColumns=!0,je(e)||"object"!=typeof e||0===e.length?"string"==typeof e&&""!==e.trim()&&(this.parent.getColumnByField(e).autoFit=!0):e.forEach(function(e){n.parent.getColumnByField(e)&&(n.parent.getColumnByField(e).autoFit=!0)}),this.parent.enableAdaptiveUI&&this.parent.element.classList.add("e-grid-autofit"),this.findColumn(o,t,i)},WG.prototype.autoFit=function(){var e=this.parent.getColumns(),t=0,e=e.filter(function(e){return je(e.maxWidth)||t++,!0===e.autoFit}).map(function(e){return e.field||e.headerText}),i=(0<e.length&&!this.parent.preventAutoFit&&this.autoFitColumns(e),this.parent.getContentTable());this.parent.allowResizing&&t&&("Auto"===this.parent.resizeSettings.mode||"Normal"===this.parent.resizeSettings.mode&&!this.parent.autoFit&&0===e.length)?this.widthService.setWidthToTable(-1===i.style.width.indexOf("px")):this.parent.autoFit&&"Auto"===this.parent.resizeSettings.mode&&this.widthService.setWidthToTable(),-1!==i.style.width.indexOf("px")&&i.getBoundingClientRect().width<i.parentElement.clientWidth&&U([this.parent.getHeaderTable(),i],["e-tableborder"])},WG.prototype.getCellElementsByColumnIndex=function(e){return this.parent.frozenRows?[].slice.call(this.parent.getHeaderTable().querySelectorAll("td.e-rowcell:nth-child("+(e+1)+"):not(.e-groupcaption):not(.e-detailcell)")).concat([].slice.call(this.parent.getContentTable().querySelectorAll("td.e-rowcell:nth-child("+(e+1)+"):not(.e-groupcaption):not(.e-detailcell)"))):[].slice.call(this.parent.getContentTable().querySelectorAll("td.e-rowcell:nth-child("+(e+1)+"):not(.e-groupcaption):not(.e-detailcell)"))},WG.prototype.resizeColumn=function(e,t,i,n,o){var r,s,a=this.parent,l=0,h=a.getHeaderTable(),d=a.getContentTable(),p=0,i=i||this.parent.getUidByColumnField(e),c=this.parent.getNormalizedColumnIndex(i),i=h.querySelector('[e-mappinguid="'+i+'"]').parentElement.cloneNode(!0),u=this.getCellElementsByColumnIndex(c),e=this.parent.getColumnIndexByField(e),g=((r=je(a.getFooterContent())?r:a.getFooterContentTable())&&(s=r.querySelectorAll("td:nth-child("+(c+1)+"):not(.e-groupcaption)")),[].slice.call(h.querySelector("tr").getElementsByClassName("e-grouptopleftcell")));if(0<g.length)for(var m=0;m<g.length;m++)p+=g[parseInt(m.toString(),10)].offsetWidth;var c=d.querySelector(".e-detailrowcollapse")||d.querySelector(".e-detailrowexpand"),c=((this.parent.detailTemplate||this.parent.childGrid)&&c&&(p+=c.offsetWidth),[i]),f=[],y=[];if(r)for(m=0;m<s.length;m++)y[parseInt(m.toString(),10)]=s[parseInt(m.toString(),10)].cloneNode(!0);for(m=0;m<u.length;m++)f[parseInt(m.toString(),10)]=u[parseInt(m.toString(),10)].cloneNode(!0);var i=this.createTable(h,c,"e-gridheader"),c=null,v=null,n=(a.getCurrentViewRecords().length&&(v=this.createTable(d,f,"e-gridcontent",n,o)),y.length&&(c=this.createTable(r,y,"e-gridfooter")),a.getColumns()[parseInt(e.toString(),10)]),o=n.width=T(Math.max(i,v,c)),i=n.maxWidth&&parseFloat(n.maxWidth.toString());if(parseInt(o,10)>i&&(n.width=i),this.widthService.setColumnWidth(a.getColumns()[parseInt(e.toString(),10)]),!1===a.getColumns().some(function(e){return(e.visible||a.groupSettings.columns.length)&&(null===e.width||void 0===e.width||e.width.length<=0)}))for(var b=a.getColumns(),m=0;m<b.length;m++)b[parseInt(m.toString(),10)].visible&&(l+=parseFloat(b[parseInt(m.toString(),10)].width));v=l+p;0<l&&((this.parent.detailTemplate||this.parent.childGrid)&&this.widthService.setColumnWidth(new C0({width:"30px"})),"Auto"===this.parent.resizeSettings.mode&&(v="100%"),h.style.width=T(v),d.style.width=T(v),je(r)||(r.style.width=T(v))),a.isFrozenGrid()&&a.enableColumnVirtualization&&this.widthService.refreshFrozenScrollbar(),h.offsetWidth<d.parentElement.scrollWidth?(je(d.querySelector(".e-emptyrow"))?U([h,d],["e-tableborder"]):(U([h],["e-tableborder"]),q([d],["e-tableborder"])),q([a.element],["e-left-shadow","e-right-shadow"])):(q([h,d],["e-tableborder"]),a.getVisibleFrozenRightCount()&&U([a.element],"e-right-shadow")),je(r)||r.classList.add("e-tableborder")},WG.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+RE)||e.querySelector("."+OE))&&(this.widthService=null,this.unwireEvents(),this.removeEventListener())},WG.prototype.getModuleName=function(){return"resize"},WG.prototype.findColumn=function(e,t,i){for(var n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)],r=this.parent.getColumnIndexByField(o),s=this.parent.getColumns()[parseInt(r.toString(),10)];-1<r&&!je(s)&&!0===s.visible&&this.resizeColumn(o,r,null,t,i)}this.parent.allowTextWrap&&this.parent.notify(oI,{case:"refreshHeight",isModeChg:!0}),this.parent.isFrozenGrid()&&this.refreshResizefrzCols(!0,!0)},WG.prototype.createTable=function(e,t,i,n,o){(o=void 0===o?t.length:o)<(n=void 0===n?1:n)&&(n=(n^=o)^(o^=n));for(var r=this.parent.createElement("div"),s=this.parent.enableAdaptiveUI?" e-bigger":"",s=(r.className=this.parent.element.className+s,r.style.cssText="display: inline-block;visibility:hidden;position:absolute",this.parent.createElement("div")),a=(s.className=i,this.parent.createElement("table",{attrs:{role:"grid"}})),l=(a.className=e.className,a.classList.add("e-resizetable"),a.style.cssText="table-layout: auto;width: auto",this.parent.createElement("tr")),h=n<=0?1:n;h<=(o>t.length?t.length:o);h++){var d=l.cloneNode();d.className=e.querySelector("tr").className,d.appendChild(t[parseInt((h-1).toString(),10)]),a.appendChild(d)}s.appendChild(a),r.appendChild(s),document.body.appendChild(r);i=a.getBoundingClientRect().width;return document.body.removeChild(r),Math.ceil(i)},WG.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(tx,this.refreshHeight,this),this.parent.on(fE,this.refreshResizePosition,this),this.parent.on(G1,this.wireEvents,this),this.parent.on(X1,this.autoFit,this),this.parent.on(xT,this.refreshHeight,this),this.parent.on(Cx,this.destroy,this))},WG.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(tx,this.refreshHeight),this.parent.off(fE,this.refreshResizePosition),this.parent.off(G1,this.wireEvents),this.parent.off(xT,this.refreshHeight),this.parent.off(Cx,this.destroy))},WG.prototype.render=function(){this.unwireEvents(),this.wireEvents(),this.setHandlerHeight()},WG.prototype.refreshHeight=function(){if(this.parent.getHeaderTable()){for(var e=this.getResizeHandlers(),t=0;t<e.length;t++)0<e[parseInt(t.toString(),10)].parentElement.offsetHeight&&(e[parseInt(t.toString(),10)].style.height="100%");this.setHandlerHeight()}},WG.prototype.wireEvents=function(){E.add(this.parent.getHeaderContent(),F.touchStartEvent,this.touchResizeStart,this),E.add(this.parent.getHeaderContent(),Fx,this.callAutoFit,this)},WG.prototype.unwireEvents=function(){E.remove(this.parent.getHeaderContent(),F.touchStartEvent,this.touchResizeStart),E.remove(this.parent.getHeaderContent(),Fx,this.callAutoFit)},WG.prototype.getResizeHandlers=function(){return[].slice.call(this.parent.getHeaderTable().getElementsByClassName(zG.root))},WG.prototype.setHandlerHeight=function(){for(var e=[].slice.call(this.parent.getHeaderTable().getElementsByClassName(zG.suppress)),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].style.height="100%"},WG.prototype.callAutoFit=function(e){var t;F.isDevice&&"function"==typeof e.preventDefault&&this.isDblClk&&e.preventDefault(),!e.target.classList.contains("e-rhandler")||this.isCancelAutoFit||(t=this.getTargetColumn(e)).columns||(this.resizeColumn(t.field,this.parent.getNormalizedColumnIndex(t.uid),t.uid),this.parent.isFrozenGrid()&&this.refreshResizefrzCols(!0,!0),z(e.target,zG.header).classList.add("e-resized"))},WG.prototype.touchResizeStart=function(e){if(!rB.timer)return rB.timer=setTimeout(function(){rB.timer=null},300),this.resizeStart(e);clearTimeout(rB.timer),rB.timer=null,this.callAutoFit(e)},WG.prototype.resizeStart=function(e){var t=this;if(e.target.classList.contains("e-rhandler")){this.isCancelAutoFit=!1;var i={e:e,column:this.getTargetColumn(e)};if(this.parent.trigger(P1,i,function(e){(e.cancel||t.parent.isEdit)&&(t.cancelResizeAction(),t.isCancelAutoFit=!0)}),!this.isCancelAutoFit){if(!this.helper){if(0===this.getScrollBarWidth()){if(this.resizeProcess=!0,this.parent.allowGrouping)for(var n=0;n<this.parent.groupSettings.columns.length;n++)this.widthService.setColumnWidth(new C0({width:"30px"}),n);this.parent.isRowDragable()&&this.widthService.setColumnWidth(new C0({width:"30px"}));for(var o=0,r=this.refreshColumnWidth();o<r.length;o++){var s=r[o];this.widthService.setColumnWidth(s)}this.widthService.setWidthToTable(),this.resizeProcess=!1}this.refreshStackedColumnWidth(),this.element=e.target,this.parentElementWidth=this.parent.element.getBoundingClientRect().width,this.appendHelper(),this.column=this.getTargetColumn(e),this.pageX=this.getPointX(e),this.column.getFreezeTableName()===eD?this.parent.enableRtl?this.minMove=(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0)-parseFloat(je(this.column.width)?"":this.column.width.toString()):this.minMove=parseFloat(je(this.column.width)?"":this.column.width.toString())-(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0):this.parent.enableRtl?this.minMove=parseFloat(this.column.width.toString())-(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0):this.minMove=(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0)-parseFloat(je(this.column.width)?"":this.column.width.toString()),this.minMove+=this.pageX}E.add(document,F.touchEndEvent,this.resizeEnd,this),E.add(this.parent.element,F.touchMoveEvent,this.resizing,this),F.isDevice&&!this.helper.classList.contains(zG.icon)?(this.helper.classList.add(zG.icon),E.add(document,F.touchStartEvent,this.removeHelper,this),E.add(this.helper,F.touchStartEvent,this.resizeStart,this)):this.updateCursor("add")}}},WG.prototype.cancelResizeAction=function(e){e&&(E.remove(this.parent.element,F.touchMoveEvent,this.resizing),E.remove(document,F.touchEndEvent,this.resizeEnd),this.updateCursor("remove")),F.isDevice&&!je(this.helper)&&(E.remove(document,F.touchStartEvent,this.removeHelper),E.remove(this.helper,F.touchStartEvent,this.resizeStart)),je(this.helper)||G(this.helper),this.refresh()},WG.prototype.getWidth=function(e,t,i){return t&&e<t?t:i&&i<e?i:e},WG.prototype.updateResizeEleHeight=function(){for(var e=[].slice.call(this.parent.getHeaderContent().getElementsByClassName("e-rhandler")),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].style.height=this.element.parentElement.offsetHeight+"px"},WG.prototype.getColData=function(e,t){return{width:parseFloat(je(this.widthService.getWidth(e))||"auto"===this.widthService.getWidth(e)?"0":this.widthService.getWidth(e).toString())+t,minWidth:e.minWidth?parseFloat(e.minWidth.toString()):null,maxWidth:e.maxWidth?parseFloat(e.maxWidth.toString()):null}},WG.prototype.refreshResizeFixedCols=function(e){for(var t=this.parent.getColumns(),i=this.parent.enableColumnVirtualization?this.parent.translateX:0,n=[].slice.call(this.parent.getHeaderContent().querySelector("tbody").querySelectorAll(".e-fixedfreeze")).concat([].slice.call(this.parent.getContent().querySelectorAll(".e-fixedfreeze"))),o=0;o<n.length;o++){var r,s=n[parseInt(o.toString(),10)],a=void 0,l=(a=s.classList.contains("e-summarycell")?(r=s.getAttribute("e-mappinguid"),this.parent.getColumnByUid(r)):(r=parseInt(s.getAttribute("aria-colindex"),10)-1,t[parseInt(r.toString(),10)]),0);if("Left"===e){this.parent.getVisibleFrozenLeftCount()?l=30*this.parent.getIndentCount():"Right"===this.parent.getFrozenMode()&&(l=30*this.parent.groupSettings.columns.length);for(var h=0;h<t.length;h++)if(a.index>t[parseInt(h.toString(),10)].index){if(a.uid===t[parseInt(h.toString(),10)].uid)break;("Left"===t[parseInt(h.toString(),10)].freeze||t[parseInt(h.toString(),10)].isFrozen||"Fixed"===t[parseInt(h.toString(),10)].freeze)&&t[parseInt(h.toString(),10)].visible&&(l+=parseFloat(t[parseInt(h.toString(),10)].width.toString()))}dF(s,(0===l?l:l-1)-i,this.parent.enableRtl,"Left")}if("Right"===e){for(l="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0,h=t.length-1;0<=h&&a.uid!==t[parseInt(h.toString(),10)].uid;h--)"Right"!==t[parseInt(h.toString(),10)].freeze&&"Fixed"!==t[parseInt(h.toString(),10)].freeze||t[parseInt(h.toString(),10)].visible&&(l+=parseFloat(t[parseInt(h.toString(),10)].width.toString()));var d=0;dF(s,l-(d=1<s.colSpan?this.calculateColspanWidth(t,s,a.index):d)+i,this.parent.enableRtl,"Right")}}},WG.prototype.calculateColspanWidth=function(e,t,i){for(var n=0,o=i+1;o<i+t.colSpan;o++)n+=parseInt(e[parseInt(o.toString(),10)].width.toString(),10);return n},WG.prototype.refreshResizePosition=function(){this.refreshResizefrzCols(!0)},WG.prototype.refreshResizefrzCols=function(e,t){var n=this,o=this.parent.enableColumnVirtualization?this.parent.translateX:0;if(e||"Left"===this.column.freeze||this.column.isFrozen||this.column.columns&&"Left"===lF(this.column)){var i=30*this.parent.getIndentCount(),r=this.parent.getColumns().filter(function(e){return"Left"===e.freeze||e.isFrozen});e&&!t||this.frzHdrRefresh("Left");for(var s=0;s<r.length;s++)(e||r[parseInt(s.toString(),10)].index>this.column.index)&&((this.parent.frozenRows?[].slice.call(this.parent.getHeaderContent().querySelectorAll('td[aria-colindex="'+(s+1)+'"]')).concat([].slice.call(this.parent.getContent().querySelectorAll('td[aria-colindex="'+(s+1)+'"]'))):[].slice.call(this.parent.getContent().querySelectorAll('td[aria-colindex="'+(s+1)+'"]'))).filter(function(e){dF(e,i-o,n.parent.enableRtl,"Left")}),this.parent.enableColumnVirtualization)&&(r[parseInt(s.toString(),10)].valueX=i),r[parseInt(s.toString(),10)].visible&&(i+=parseFloat(r[parseInt(s.toString(),10)].width.toString()));this.refreshResizeFixedCols("Left")}if(e||"Right"===this.column.freeze||this.column.columns&&"Right"===lF(this.column)){for(var a="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0,l=this.parent.getColumns(),h=(e&&!t||this.frzHdrRefresh("Right"),l.filter(function(e){return"Right"===e.freeze})),d=this,s=l.length-1;s>=l.length-h.length;s--)!function(i){(d.parent.frozenRows?[].slice.call(d.parent.getHeaderContent().querySelectorAll('td[aria-colindex="'+(i+1)+'"]')).concat([].slice.call(d.parent.getContent().querySelectorAll('td[aria-colindex="'+(i+1)+'"]'))):[].slice.call(d.parent.getContent().querySelectorAll('td[aria-colindex="'+(i+1)+'"]'))).filter(function(e){var t=0;1<e.colSpan&&(t=n.calculateColspanWidth(l,e,l[parseInt(i.toString(),10)].index)),dF(e,a-t+o,n.parent.enableRtl,"Right")}),d.parent.enableColumnVirtualization&&(l[parseInt(i.toString(),10)].valueX=a),l[parseInt(i.toString(),10)].visible&&(a+=parseFloat(l[parseInt(i.toString(),10)].width.toString()))}(s);this.refreshResizeFixedCols("Right")}this.column&&("Fixed"===this.column.freeze||this.column.columns&&"Fixed"===lF(this.column))&&(this.refreshResizeFixedCols("Left"),this.refreshResizeFixedCols("Right"),this.frzHdrRefresh("Left"),this.frzHdrRefresh("Right")),this.parent.groupSettings.columns.length&&this.parent.aggregates.length&&this.parent.getContent().querySelector(".e-groupcaptionrow")&&this.refreshGroupCaptionRow()},WG.prototype.refreshGroupCaptionRow=function(){for(var e=[].slice.call(this.parent.getContent().querySelectorAll(".e-groupcaptionrow")),t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i.querySelector(".e-summarycell")&&qB(i,this.parent)}},WG.prototype.frzHdrRefresh=function(e){var a=this,l=this.parent.enableColumnVirtualization?this.parent.translateX:0;if("Left"===e)for(var t=[].slice.call(this.parent.getHeaderContent().querySelector("thead").querySelectorAll("tr")),i=0;i<t.length;i++)for(var h=[].slice.call(t[parseInt(i.toString(),10)].querySelectorAll(".e-leftfreeze,.e-fixedfreeze")),d=this,n=0;n<h.length;n++)!function(e){e=h[parseInt(e.toString(),10)];if(e.classList.contains("e-rowdragheader")||e.classList.contains("e-dragheadercell")||e.classList.contains("e-grouptopleftcell"))return;var t=d.getParticularCol(e),i=d.parent.getColumns(),n=0,o=[];if(d.parent.aggregates.length&&d.parent.getFooterContent()&&(d.parent.getContent().querySelectorAll(".e-summaryrow").length&&[].slice.call(d.parent.getContent().querySelectorAll(".e-summaryrow")).filter(function(e){o.push(e.querySelector('[e-mappinguid="'+t.uid+'"]'))}),o=o.concat([].slice.call(d.parent.getFooterContent().querySelectorAll('[e-mappinguid="'+t.uid+'"]')))),e.classList.contains("e-fixedfreeze")){d.parent.getVisibleFrozenLeftCount()?n=30*d.parent.getIndentCount():"Right"===d.parent.getFrozenMode()&&(n=30*d.parent.groupSettings.columns.length);for(var r=0;r<i.length;r++)if(t.index>i[parseInt(r.toString(),10)].index){if(t.uid===i[parseInt(r.toString(),10)].uid)break;("Left"===i[parseInt(r.toString(),10)].freeze||i[parseInt(r.toString(),10)].isFrozen||"Fixed"===i[parseInt(r.toString(),10)].freeze)&&i[parseInt(r.toString(),10)].visible&&(n+=parseInt(i[parseInt(r.toString(),10)].width.toString(),10))}o&&o.length&&o.filter(function(e){dF(e,n-l,a.parent.enableRtl,"Left")}),dF(e,(0===n?n:n-1)-l,d.parent.enableRtl,"Left")}else{if(n=30*d.parent.getIndentCount(),0===t.index)o&&o.length&&o.filter(function(e){dF(e,n-l,a.parent.enableRtl,"Left")});else{for(var s=0;s<i.length&&!(t.index<i[parseInt(s.toString(),10)].index||t.uid===i[parseInt(s.toString(),10)].uid);s++)i[parseInt(s.toString(),10)].visible&&(n+=parseInt(i[parseInt(s.toString(),10)].width.toString(),10));o&&o.length&&o.filter(function(e){dF(e,n-l,a.parent.enableRtl,"Left")})}dF(e,n-l,d.parent.enableRtl,"Left"),d.parent.enableColumnVirtualization&&(t.valueX=n),uF(d.parent,t,e)}}(n);if("Right"===e)for(t=[].slice.call(this.parent.getHeaderContent().querySelector("thead").querySelectorAll("tr")),i=0;i<t.length;i++)for(var h=[].slice.call(t[parseInt(i.toString(),10)].querySelectorAll(".e-rightfreeze, .e-fixedfreeze")),p=this,n=h.length-1;0<=n;n--)!function(e){var e=h[parseInt(e.toString(),10)],t=p.getParticularCol(e),i=p.parent.getColumns(),n=0,o=[];if(p.parent.aggregates.length&&p.parent.getFooterContent()&&(p.parent.getContent().querySelectorAll(".e-summaryrow").length&&[].slice.call(p.parent.getContent().querySelectorAll(".e-summaryrow")).filter(function(e){o.push(e.querySelector('[e-mappinguid="'+t.uid+'"]'))}),o=o.concat([].slice.call(p.parent.getFooterContent().querySelectorAll('[e-mappinguid="'+t.uid+'"]')))),e.classList.contains("e-fixedfreeze")){for(var n="Right"===p.parent.getFrozenMode()&&p.parent.isRowDragable()?30:0,r=i.length-1;0<=r;r--)if(t.index<i[parseInt(r.toString(),10)].index){if(t.columns&&sF(t,i[parseInt(r.toString(),10)].uid)||t.index>i[parseInt(r.toString(),10)].index)break;"Right"!==i[parseInt(r.toString(),10)].freeze&&"Fixed"!==i[parseInt(r.toString(),10)].freeze||i[parseInt(r.toString(),10)].visible&&(n+=parseFloat(i[parseInt(r.toString(),10)].width.toString()))}o.length&&o.filter(function(e){dF(e,n+l,a.parent.enableRtl,"Right")}),dF(e,n+l,p.parent.enableRtl,"Right")}else{n="Right"===p.parent.getFrozenMode()&&p.parent.isRowDragable()?30:0;for(var s=i.length-1;0<=s&&!(t.columns&&sF(t,i[parseInt(s.toString(),10)].uid)||t.index>i[parseInt(s.toString(),10)].index||t.uid===i[parseInt(s.toString(),10)].uid);s--)i[parseInt(s.toString(),10)].visible&&(n+=parseInt(i[parseInt(s.toString(),10)].width.toString(),10));o.length&&o.filter(function(e){dF(e,n+l,a.parent.enableRtl,"Right")}),dF(e,n+l,p.parent.enableRtl,"Right"),p.parent.enableColumnVirtualization&&(t.valueX=n)}}(n)},WG.prototype.getParticularCol=function(e){e=(e.classList.contains("e-filterbarcell")?e:e.querySelector("[e-mappinguid]")).getAttribute("e-mappinguid");return this.parent.getColumnByUid(e)},WG.prototype.resizing=function(e){var t=this;if(F.isDevice&&"function"==typeof e.preventDefault&&e.preventDefault(),!je(this.column)){this.parent.isFrozenGrid()&&this.refreshResizefrzCols();var i=0,n=(je(this.column)&&(i=A(this.element,"th").offsetWidth),this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.setHelperHeight()),this.getPointX(e)),o=this.parent.enableRtl?-(n-this.pageX):n-this.pageX,r=parseFloat(this.column.width.toString()),s=this.getColData(this.column,o),s=(s.width||(s.width=z(this.element,"th").offsetWidth),this.getWidth(s.width,s.minWidth,s.maxWidth));if(this.parent.log("resize_min_max",{column:this.column,width:s}),(!this.parent.enableRtl&&this.minMove>=n||this.parent.enableRtl&&this.minMove<=n)&&(s=this.column.minWidth?parseFloat(this.column.minWidth.toString()):10,this.pageX=n=this.minMove),s!==parseFloat((je(this.column.width)||"auto"===this.column.width?i:this.column.width).toString())){this.pageX=n,this.column.width=T(s);i={e:e,column:this.column};if(this.parent.trigger(B1,i),i.cancel)return void this.cancelResizeAction(!0);this.column;n=[this.column],e=(this.column.columns&&(s=this.getSubColumns(this.column,[]),s=this.calulateColumnsWidth(s,!1,o),n=this.calulateColumnsWidth(s,!0,o)),this.parent.getColumns().filter(function(e){return e.visible&&(e.maxWidth||e.minWidth)}));"Auto"===this.parent.resizeSettings.mode&&e.length&&(i=this.parent.getColumns().filter(function(e){return e.visible&&e.uid!==t.column.uid}),s=this.distributeColWidth(i,o,0),Math.round(s.usedWidth)!==Math.abs(o)&&(n[0].width=r+s.usedWidth*Math.sign(o)),n=n.concat(s.columns)),this.resizeProcess=!0;for(var a=0,l=n;a<l.length;a++){var h=l[a];this.widthService.setColumnWidth(h,null,"resize")}this.resizeProcess=!1,this.updateHelper()}this.isDblClk=!1}},WG.prototype.distributeColWidth=function(e,t,i){for(var n=t/e.length,o=Math.abs(n),r=[],s=[],a=0,l=0,h=e;l<h.length;l++){var d,p=h[l],c=parseFloat(p.width.toString())-n;(p.minWidth&&c<parseInt(p.minWidth.toString(),10)?(a+=d=parseFloat((parseInt(p.minWidth.toString(),10)-c).toFixed(3)),i+=o-d,p.width=p.minWidth,r):p.maxWidth&&c>parseInt(p.maxWidth.toString(),10)?(a+=d=parseFloat((c-parseInt(p.maxWidth.toString(),10)).toFixed(3)),i+=o-d,p.width=p.maxWidth,r):(i+=o,p.width=c,s)).push(p)}e=a&&s.length?this.distributeColWidth(s,a*Math.sign(t),i):{columns:s,usedWidth:i};return{columns:r.concat(e.columns),usedWidth:e.usedWidth}},WG.prototype.calulateColumnsWidth=function(e,t,i){for(var n=[],o=0,r=e;o<r.length;o++){for(var s=r[o],a=0,l=0;l<e.length;l++)a+=parseFloat(e[parseInt(l.toString(),10)].width.toString());var h=this.getColData(s,parseFloat(s.width)*i/a),h=this.getWidth(h.width,h.minWidth,h.maxWidth);h!==parseFloat(s.width.toString())&&(t&&(s.width=T(h<1?1:h)),n.push(s))}return n},WG.prototype.getSubColumns=function(e,t){for(var i=0,n=e.columns;i<n.length;i++){var o=n[i];!1!==o.visible&&o.allowResizing&&(o.columns?this.getSubColumns(o,t):t.push(o))}return t},WG.prototype.resizeEnd=function(e){var t,i,n,o;this.helper&&!this.parent.isDestroyed&&((t=this.parent).isFrozenGrid()&&this.refreshResizePosition(),E.remove(this.parent.element,F.touchMoveEvent,this.resizing),E.remove(document,F.touchEndEvent,this.resizeEnd),F.isDevice&&(E.remove(document,F.touchStartEvent,this.removeHelper),E.remove(this.helper,F.touchStartEvent,this.resizeStart)),this.updateCursor("remove"),G(this.helper),n={e:e,column:this.column},(i=this.parent.getContent().querySelector("."+WE)).scrollHeight>i.clientHeight&&(this.parent.scrollModule.setPadding(),i.style.overflowY="scroll"),this.parent.trigger(F1,n),z(this.element,".e-headercell").classList.add("e-resized"),this.isFrozenColResized=!1,this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.parent.notify(CI,{case:"textwrap"})),i=t.getHeaderTable(),n=t.getContentTable(),je(t.getFooterContent())||(o=t.getFooterContentTable()),i.offsetWidth<t.getContent().scrollWidth?(je(n.querySelector(".e-emptyrow"))?U([i,n],["e-tableborder"]):(U([i],["e-tableborder"]),q([n],["e-tableborder"])),q([t.element],["e-left-shadow","e-right-shadow"])):(q([i,n],["e-tableborder"]),t.getVisibleFrozenRightCount()&&U([t.element],"e-right-shadow")),je(o)||o.classList.add("e-tableborder"),this.refresh(),this.doubleTapEvent(e),this.isDblClk=!0)},WG.prototype.getPointX=function(e){return(e.touches&&e.touches.length?e.touches[0]:e).pageX},WG.prototype.refreshColumnWidth=function(){for(var e=this.parent.getColumns(),t=0,i=[].slice.apply(this.parent.getHeaderContent().querySelectorAll("th.e-headercell"));t<i.length;t++)for(var n=i[t],o=0,r=e;o<r.length;o++){var s=r[o];if(n.querySelector("[e-mappinguid]")&&n.querySelector("[e-mappinguid]").getAttribute("e-mappinguid")===s.uid&&s.visible){s.width=n.getBoundingClientRect().width;break}}return e},WG.prototype.refreshStackedColumnWidth=function(){for(var e=0,t=this.parent.getStackedColumns(this.parent.columns);e<t.length;e++){var i=t[e];i.width=this.getStackedWidth(i,0)}},WG.prototype.getStackedWidth=function(e,t){for(var i=0,n=e.columns;i<n.length;i++){var o=n[i];!1!==o.visible&&(o.columns?t=this.getStackedWidth(o,t):t+=parseFloat(o.width.toString()))}return t},WG.prototype.getTargetColumn=function(e){e=z(e.target,zG.header),e=(e=e.querySelector(".e-headercelldiv")||e.querySelector(".e-stackedheadercelldiv")).getAttribute("e-mappinguid");return this.parent.getColumnByUid(e)},WG.prototype.updateCursor=function(e){var t=[].slice.call(this.parent.getHeaderContent().querySelectorAll("th"));t.push(this.parent.element);for(var i=0,n=t;i<n.length;i++)n[i].classList[""+e](zG.cursor)},WG.prototype.refresh=function(){this.column=null,this.pageX=null,this.element=null,this.helper=null},WG.prototype.appendHelper=function(){this.helper=this.parent.createElement("div",{className:zG.helper}),this.parent.element.appendChild(this.helper),this.setHelperHeight()},WG.prototype.setHelperHeight=function(){for(var e=this.parent.getContent().offsetHeight-this.getScrollBarWidth(),t=z(this.element,zG.header),i=[].slice.call(this.parent.getHeaderContent().querySelectorAll("tr")),n=i.indexOf(t.parentElement);n<i.length&&-1<n;n++)e+=i[parseInt(n.toString(),10)].offsetHeight;var o=this.calcPos(t);o.left+=this.parent.enableRtl?-1:t.offsetWidth-2,this.helper.style.cssText="height: "+e+"px; top: "+o.top+"px; left:"+Math.floor(o.left)+"px;",this.parent.enableVirtualization&&this.helper.classList.add("e-virtual-rhandler")},WG.prototype.getScrollBarWidth=function(e){var t=this.parent.getContent().firstChild;return t.scrollHeight>t.clientHeight&&e||t.scrollWidth>t.clientWidth?aB():0},WG.prototype.removeHelper=function(e){e=e.target.classList;e.contains(zG.root)||e.contains(zG.icon)||!this.helper||(E.remove(document,F.touchStartEvent,this.removeHelper),E.remove(this.helper,F.touchStartEvent,this.resizeStart),G(this.helper),this.refresh())},WG.prototype.updateHelper=function(){var e=z(this.element,zG.header),e=Math.floor(this.calcPos(e).left+(this.parent.enableRtl?-1:e.offsetWidth-2));e>this.parentElementWidth&&(e=this.parentElementWidth-2),this.helper.style.left=e+"px"},WG.prototype.calcPos=function(e){for(var t={top:0,left:0},i=e.getBoundingClientRect(),n=e.ownerDocument,o=A(e,"e-grid")||n.documentElement;o&&(o===n.body||o===n.documentElement)&&"static"===o.style.position;)o=o.parentNode;return o&&o!==e&&1===o.nodeType&&(t=o.getBoundingClientRect()),{top:i.top-t.top,left:i.left-t.left}},WG.prototype.doubleTapEvent=function(e){var t=this;this.getUserAgent()&&this.isDblClk&&(this.tapped?(clearTimeout(this.tapped),this.callAutoFit(e),this.tapped=null):this.tapped=setTimeout(function(){t.tapped=null},300))},WG.prototype.getUserAgent=function(){var e=F.userAgent.toLowerCase();return/iphone|ipod|ipad/.test(e)},WG.prototype.timeoutHandler=function(){this.tapped=null},WG);function WG(e){this.tapped=!1,this.isDblClk=!0,this.resizeProcess=!1,this.isCancelAutoFit=!1,this.parent=e,this.parent.isDestroyed||(this.widthService=new WM(e),this.addEventListener())}UG.prototype.chkDropPosition=function(e,t){var i=this.parent.getColumnByUid(t.firstElementChild.getAttribute("e-mappinguid")),i=!i||!i.lockColumn;return(e.parentElement.isEqualNode(t.parentElement)||this.parent.enableColumnVirtualization||this.parent.isFrozenGrid()&&Array.prototype.indexOf.call(z(e,"thead").children,e.parentElement)===Array.prototype.indexOf.call(z(t,"thead").children,t.parentElement))&&-1<this.targetParentContainerIndex(e,t)&&i},UG.prototype.chkDropAllCols=function(e,t){for(var i,n=this.getHeaderCells();!i&&0<n.length;)i=e!==n.pop()&&-1<this.targetParentContainerIndex(e,t);return i},UG.prototype.findColParent=function(e,t,i){for(var n=0,o=t.length;n<o;n++){if(e===t[parseInt(n.toString(),10)])return!0;if(t[parseInt(n.toString(),10)].columns){var r=i.length;if(i.push(t[parseInt(n.toString(),10)]),this.findColParent(e,t[parseInt(n.toString(),10)].columns,i))return!0;i.splice(r,i.length-r)}}return!1},UG.prototype.getColumnsModel=function(e,t){for(var i=[],n=[],o=0,r=e.length;o<r;o++)je(e[parseInt(o.toString(),10)])||((e[parseInt(o.toString(),10)].visible||t)&&i.push(e[parseInt(o.toString(),10)]),e[parseInt(o.toString(),10)].columns&&(n=n.concat(e[parseInt(o.toString(),10)].columns)));return i=n.length?i.concat(this.getColumnsModel(n)):i},UG.prototype.headerDrop=function(e){var t=this.parent,i=(this.element.querySelector(".e-headercelldiv")||this.element.querySelector(".e-stackedheadercelldiv")).getAttribute("e-mappinguid"),i=t.getColumnByUid(i);if(z(e.target,"th")&&(je(i)||i.allowReordering&&!i.lockColumn)){var n,o,r,s,e=z(e.target,".e-headercell"),a=(e.querySelector(".e-headercelldiv")||e.querySelector(".e-stackedheadercelldiv")).getAttribute("e-mappinguid");if(!je(a)){var t=t.getColumnByUid(a);if(je(t)||!t.allowReordering||t.lockColumn)return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:i,destColumn:t})}e&&this.chkDropPosition(this.element,e)&&this.chkDropAllCols(this.element,e)&&(this.parent.enableColumnVirtualization?(s=this.parent.columns,n=this.element.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"),a=this.parent.columns.filter(function(e){return e.uid===n}),o=null,t=a[0],r=e.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"),s.some(function(e,t){return e.uid===r&&(o=t,e.uid===r)}),je(o)||this.moveColumns(o,t)):(a=this.targetParentContainerIndex(this.element,e),t=this.element.firstElementChild.getAttribute("e-mappinguid"),this.destElement=e,this.parent.notify(TT,{ele:e}),t?this.moveColumns(a,this.parent.getColumnByUid(t)):(e=this.getHeaderCells(),t=GP(this.element,e),s=this.getColumnsModel(this.parent.columns),this.moveColumns(a,s[parseInt(t.toString(),10)]))))}else this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:i})},UG.prototype.isActionPrevent=mB,UG.prototype.moveColumns=function(e,t,i,n){var o=this.parent;if(this.isActionPrevent(o))o.notify(zx,{instance:this,handler:this.moveColumns,arg1:e,arg2:t});else{var r=this.getColParent(t,this.parent.columns),s=(r||this.parent).columns,a=YP(t,s);if((r||this.parent.lockcolPositionCount)&&!i&&!this.parent.enableColumnVirtualization){for(var l=0;l<s.length;l++)if(s[parseInt(l.toString(),10)].field===t.field){a=l;break}var h=this.parent.getColumnByUid(this.destElement.firstElementChild.getAttribute("e-mappinguid"));if(h){for(l=0;l<s.length;l++)if(s[parseInt(l.toString(),10)].field===h.field){e=l;break}}else for(l=0;l<s.length;l++)s[parseInt(l.toString(),10)].headerText===this.destElement.innerText.trim()&&(e=l)}if(o.allowReordering&&a!==e&&-1!==a&&-1!==e){s.splice(e,0,s.splice(a,1)[0]);i={column:t,destIndex:e,columns:s,parent:r,cancel:!1};if(o.notify(IT,i),!i.cancel){if(this.parent.isFrozenGrid())if(this.parent.frozenColumns)for(l=0;l<s.length;l++)"Left"===s[parseInt(l.toString(),10)].freeze&&(s[parseInt(l.toString(),10)].freeze=void 0);else r&&r.columns||(this.parent.getFrozenLeftCount()>e?t.freeze="Left":s.length-this.parent.getFrozenRightColumnsCount()<=e?t.freeze="Right":t.freeze="Fixed"===t.freeze?"Fixed":void 0);if(!1!==n){i={type:WA,requestType:"reorder",fromIndex:e,toIndex:a,toColumnUid:t.uid,cancel:!1};if(o.notify($1,i),i.cancel)return void s.splice(a,0,s.splice(e,1)[0])}o.getColumns(!0),o.preventAutoFit=!0,o.notify(Ix,{fromIndex:e,toIndex:a}),this.parent.isFrozenGrid()&&(r=this.parent.columns,this.idx=0,this.refreshColumnIndex(r),this.parent.notify(mE,{}))}}}},UG.prototype.refreshColumnIndex=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].index=this.idx,this.idx++,e[parseInt(t.toString(),10)].columns&&e[parseInt(t.toString(),10)].columns.length&&this.refreshColumnIndex(e[parseInt(t.toString(),10)].columns)},UG.prototype.targetParentContainerIndex=function(e,t){var i=this.parent.columns,n=this.getHeaderCells(),o=this.parent.getStackedColumns(i),r=[],o=(o.length&&(r=this.getAllStackedheaderParentColumns(n)),o.length&&r.length?this.getColumnsModel(r):this.getColumnsModel(i,!0)),r=this.getColParent(o[GP(e,n)],i),i=r?r.columns:i;return YP(o[GP(t,n)],i)},UG.prototype.getAllStackedheaderParentColumns=function(e){for(var t=[],i=0;i<e.length;i++)e[parseInt(i.toString(),10)].classList.contains("e-hide")?(e.splice(i,1),i--):e[parseInt(i.toString(),10)].closest("thead").firstChild===e[parseInt(i.toString(),10)].parentElement&&t.push(this.parent.getColumnByUid(e[parseInt(i.toString(),10)].firstElementChild.getAttribute("e-mappinguid")));return t},UG.prototype.getHeaderCells=function(){return[].slice.call(this.parent.element.getElementsByClassName("e-headercell"))},UG.prototype.getColParent=function(e,t){var i=[];return this.findColParent(e,t,i),i[i.length-1]},UG.prototype.reorderSingleColumn=function(t,i){var e,n=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(e){return e.field===t})[0]:this.parent.getColumnByField(t),o=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(e){return e.field===i})[0]:this.parent.getColumnByField(i);(je(n)||n.allowReordering&&!n.lockColumn)&&(je(o)||o.allowReordering&&!o.lockColumn)?-1<(e=YP(o,(this.getColParent(o,this.parent.columns)||this.parent).columns))&&this.moveColumns(e,n,!0):this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:n,destColumn:o})},UG.prototype.reorderMultipleColumns=function(e,t){var i=this.parent.getColumnIndexByField(t),t=this.parent.getColumnByField(t);if(!(i<0)&&(je(t)||t.allowReordering&&!t.lockColumn)){for(var n=0;n<e.length;n++)if(!je(o=this.parent.getColumnByField(e[parseInt(n.toString(),10)]))&&(!o.allowReordering||o.lockColumn))return;for(n=0;n<e.length;n++){var o=this.parent.getColumnByIndex(i),r=this.getColParent(o,this.parent.columns),r=YP(o,(r||this.parent).columns);-1<r&&this.moveColumns(r,this.parent.getColumnByField(e[parseInt(n.toString(),10)]),!0,!0),this.parent.getColumnIndexByField(e[n+1])>=r&&i++}}},UG.prototype.moveTargetColumn=function(e,t){-1<t&&this.moveColumns(t,e,!0)},UG.prototype.reorderSingleColumnByTarget=function(e,t){this.moveTargetColumn(this.parent.getColumnByField(e),t)},UG.prototype.reorderMultipleColumnByTarget=function(e,t){for(var i=0;i<e.length;i++)this.reorderSingleColumnByTarget(e[parseInt(i.toString(),10)],t)},UG.prototype.reorderColumns=function(e,t){"string"==typeof e?(this.reorderSingleColumn(e,t),this.fromCol=e):(this.reorderMultipleColumns(e,t),this.fromCol=e[0])},UG.prototype.reorderColumnByIndex=function(e,t){this.moveTargetColumn(this.parent.getColumnByIndex(e),t)},UG.prototype.reorderColumnByTargetIndex=function(e,t){"string"==typeof e?this.reorderSingleColumnByTarget(e,t):this.reorderMultipleColumnByTarget(e,t)},UG.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.createReorderElement()},UG.prototype.createReorderElement=function(e){e&&e.args&&e.args.isXaxis&&this.setDisplay("none");var e=this.parent.element.querySelector("."+VE),t=this.parent.createElement("div",{className:"e-icons e-icon-reorderuparrow e-reorderuparrow"}),t=(t.style.display="none",this.upArrow=t,e.appendChild(this.upArrow),this.parent.createElement("div",{className:"e-icons e-icon-reorderdownarrow e-reorderdownarrow"}));t.style.display="none",this.downArrow=t,e.appendChild(this.downArrow)},UG.prototype.onActionComplete=function(e){this.parent.preventAutoFit=!1,this.parent.trigger(QA,Pe(e,{type:QA}));e=this.fromCol&&this.parent.getColumnHeaderByField(this.fromCol);e&&this.parent.focusModule.onClick({target:e},!0)},UG.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+RE)||e.querySelector("."+OE))&&(this.upArrow.parentNode&&ue(this.upArrow),this.downArrow.parentNode&&ue(this.downArrow),this.parent.off(Mx,this.headerDrop),this.parent.off(K1,this.enableAfterRender),this.parent.off(sx,this.onActionComplete),this.parent.off(s1,this.drag),this.parent.off(r1,this.dragStart),this.parent.off(Dx,this.dragStop),this.parent.off(tx,this.createReorderElement),this.parent.off(bx,this.keyPressHandler),this.parent.off(Cx,this.destroy))},UG.prototype.keyPressHandler=function(e){var t=this.parent;switch(/(Mac)/i.test(navigator.platform)&&e.metaKey&&("leftArrow"===e.action?e.action="ctrlLeftArrow":"rightArrow"===e.action&&(e.action="ctrlRightArrow")),e.action){case"ctrlLeftArrow":case"ctrlRightArrow":var i,n,o=t.focusModule.currentInfo.element;o&&o.classList.contains("e-headercell")&&(o=t.getColumnByUid(o.firstElementChild.getAttribute("e-mappinguid")),i=(n=t.getVisibleColumns()).indexOf(o),n="ctrlLeftArrow"===e.action?n[i-1]:n[i+1])&&n.field&&o.field&&this.reorderColumns(o.field,n.field)}},UG.prototype.drag=function(e){var t,i=this.parent,n=e.target,o=z(n,".e-headercell:not(.e-stackedHeaderCell)"),r=i.element.querySelector(".e-cloneproperties"),s=i.getContent().firstElementChild,s=this.x>JP(e.event).x+s.scrollLeft;q([].slice.call(i.getHeaderTable().getElementsByClassName("e-reorderindicate")),["e-reorderindicate"]),this.setDisplay("none"),this.stopTimer(),mt(r,["e-defaultcur"],["e-notallowedcur"]),this.updateScrollPostion(e.event),o&&!o.isEqualNode(this.element)?(t=(n=o).querySelector(".e-headercelldiv, .e-stackedheadercelldiv").getAttribute("e-mappinguid"),this.chkDropPosition(this.element,n)&&this.chkDropAllCols(this.element,n)&&i.getColumnByUid(t).allowReordering&&e.column.allowReordering?(this.updateArrowPosition(n,s),mt(n,["e-allowDrop","e-reorderindicate"],[])):i.allowGrouping&&A(e.target,"e-groupdroparea")||mt(r,["e-notallowedcur"],["e-defaultcur"])):(!o||!o.isEqualNode(this.element)||i.allowGrouping&&e.column.allowGrouping||e.column.allowReordering)&&(o||i.allowGrouping&&A(e.target,"e-groupdroparea"))||mt(r,["e-notallowedcur"],["e-defaultcur"]),e.column.allowReordering&&!e.column.lockColumn&&i.trigger(s1,{target:n,draggableType:"headercell",column:e.column})},UG.prototype.updateScrollPostion=function(e){var t=this,e=JP(e).x,i=this.parent.element.getBoundingClientRect(),n=i.right,i=i.left,o=this.parent.getContent().firstElementChild;i<e&&e<i+35?this.timer=window.setInterval(function(){t.setScrollLeft(o,!0)},50):e<n&&n-35<e&&(this.timer=window.setInterval(function(){t.setScrollLeft(o,!1)},50))},UG.prototype.setScrollLeft=function(e,t){var i=e.scrollLeft;e.scrollLeft=e.scrollLeft+(t?-5:5),i!==e.scrollLeft&&this.setDisplay("none")},UG.prototype.stopTimer=function(){window.clearInterval(this.timer)},UG.prototype.updateArrowPosition=function(e,t){var i,e=e.getBoundingClientRect(),n=this.parent.element.getBoundingClientRect();t&&e.left<n.left||!t&&e.right>n.right||(i=this.parent.getHeaderContent().classList.contains("e-sticky"),this.upArrow.style.top=i?e.top+e.height+"px":e.top+e.height-n.top+"px",this.downArrow.style.top=i?e.top-7+"px":e.top-n.top-7+"px",this.upArrow.style.left=this.downArrow.style.left=i?(t?e.left:e.right)-4+"px":(t?e.left:e.right)-n.left-4+"px",this.setDisplay(""))},UG.prototype.dragStart=function(e){var t,i=this.parent,n=e.target;this.element=n.classList.contains("e-headercell")?n:A(n,"e-headercell"),e.column.allowReordering&&!e.column.lockColumn&&(t=i.getContent().firstElementChild,this.x=JP(e.event).x+t.scrollLeft,i.trigger(r1,{target:n,draggableType:"headercell",column:e.column}))},UG.prototype.dragStop=function(e){var t=this.parent;this.setDisplay("none"),this.stopTimer(),e.cancel||t.trigger(a1,{target:e.target,draggableType:"headercell",column:e.column}),q([].slice.call(t.getHeaderTable().getElementsByClassName("e-reorderindicate")),["e-reorderindicate"])},UG.prototype.setDisplay=function(e){this.upArrow.style.display=e,this.downArrow.style.display=e},UG.prototype.getModuleName=function(){return"reorder"};var QG=UG;function UG(e){this.idx=0,this.parent=e,this.parent.isDestroyed||(this.parent.on(Mx,this.headerDrop,this),this.parent.on(K1,this.enableAfterRender,this),this.parent.on(sx,this.onActionComplete,this),this.parent.on(s1,this.drag,this),this.parent.on(r1,this.dragStart,this),this.parent.on(Dx,this.dragStop,this),this.parent.on(Mx,this.headerDrop,this),this.parent.on(tx,this.createReorderElement,this),this.parent.on(bx,this.keyPressHandler,this),this.parent.on(Cx,this.destroy,this))}GG.prototype.getParentGrid=function(e){for(var t=e,i=!1;!i;)(t=t.ej2_instances[0].parentDetails?document.getElementById(t.ej2_instances[0].parentDetails.parentID):t).classList.contains("e-childgrid")||(i=!0);return t},GG.prototype.isNewRowAdded=function(){return this.parent.editSettings&&this.parent.editSettings.showAddNewRow&&!(this.parent.enableInfiniteScrolling||this.parent.enableVirtualization)},GG.prototype.groupRowDDIndicator=function(e,t){vB([e[0]],t,"e-dragleft"),vB(e,t,"e-dragtop","e-dragbottom"),vB([e[e.length-1]],t,"e-dragright")},GG.prototype.refreshRow=function(e,t,i){for(var n=this.parent,o=n.getContentTable().querySelector(oD),r=n.getHeaderTable().querySelector(oD),s=0,a=e.rows.length;s<a;s++){var l,h=e.rows[parseInt(s.toString(),10)],d=(!(n.enableVirtualization&&n.allowGrouping&&n.groupSettings.columns.length||n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache)||1!==e.rows.length||je(d=n.getRowElementByUID(h.getAttribute("data-uid")))||ue(d),h.querySelector(".e-dragstartrow"));d&&d.classList.remove("e-dragstartrow"),t.insertBefore(h,i),n.allowGrouping&&n.groupSettings.columns.length&&(h=h.getAttribute("data-uid"),l=e.target.parentElement.getAttribute("data-uid"),h=n.getRowObjectFromUID(h),l=n.getRowObjectFromUID(l),h.parentUid!==l.parentUid)&&n.groupModule.groupReorderHandler(h,l)}var p=[].slice.call(n.editSettings.showAddNewRow?t.querySelectorAll(".e-row:not(.e-addedrow)"):t.getElementsByClassName(UE));if(n.allowGrouping&&n.groupSettings.columns.length?n.groupSettings.enableLazyLoading||n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache&&p.length>3*n.pageSettings.pageSize?n.refresh():(iF(this.parent,e,p),n.enableVirtualization||n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache?tF(n):eF(this.parent,n.getRowsObject().filter(function(e){return e.isDataRow}),p),this.parent.notify(QT,{rows:n.enableVirtualization?this.parent.vRows:this.parent.getRowsObject()})):n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache&&!n.groupSettings.columns.length?p.length>3*n.pageSettings.pageSize?n.refresh():(iF(this.parent,e,p),tF(n)):this.refreshData(p),this.parent.frozenRows)for(s=0,a=p.length;s<a;s++)(s<this.parent.frozenRows?r:o).appendChild(p[parseInt(s.toString(),10)])},GG.prototype.updateFrozenRowreOrder=function(e){for(var t=this.parent,i=t.getContentTable().querySelector(oD),n=t.getHeaderTable().querySelector(oD),o=[].slice.call(n.getElementsByClassName(UE)).concat([].slice.call(i.getElementsByClassName(UE))),r=t.createElement(oD,{attrs:{role:"rowgroup"}}),n=(t.selectionSettings.persistSelection||0!==Object.keys(t.selectionModule.selectedRowState).length?this.parent.clearRowSelection():this.parent.clearSelection(),this.refreshRowTarget(e)),s=0,a=o.length;s<a;s++)r.appendChild(o[parseInt(s.toString(),10)]);this.refreshRow(e,r,n)},GG.prototype.refreshRowTarget=function(e){var t=this.parent,i=parseInt(e.target.parentElement.getAttribute(nD),10)-1,n=(t.enableVirtualization&&t.allowGrouping&&t.groupSettings.columns.length&&(i=this.parent.getDataRows().indexOf(e.target.parentElement)),!(e.fromIndex<e.dropIndex||e.fromIndex===e.dropIndex)||t.allowGrouping&&t.groupSettings.columns.length||(i+=1),t.getRowByIndex(i));return i===t.getRows().length&&this.isNewRowAdded()&&"Bottom"===this.parent.editSettings.newRowPosition&&(n=this.parent.element.querySelector(".e-row.e-addedrow")),t.allowGrouping&&t.groupSettings.columns.length&&-1!==i&&e.fromIndex<e.dropIndex&&n?n.nextSibling:n},GG.prototype.updateFrozenColumnreOrder=function(e){var t=this.parent,i=t.getContentTable().querySelector(oD),t=(t.selectionSettings.persistSelection||0!==Object.keys(t.selectionModule.selectedRowState).length?this.parent.clearRowSelection():this.parent.clearSelection(),this.refreshRowTarget(e));this.refreshRow(e,i,t)},GG.prototype.refreshData=function(e){for(var t={},i={},n=this.parent.getRowsObject(),o=this.parent.getCurrentViewRecords(),r=0,s=e.length;r<s;r++){var a=parseInt(e[parseInt(r.toString(),10)].getAttribute(nD),10)-1;t[parseInt(r.toString(),10)]=n[parseInt(a.toString(),10)],i[parseInt(r.toString(),10)]=o[parseInt(a.toString(),10)]}for(var l=this.parent.getRows(),r=0,s=e.length;r<s;r++)l[parseInt(r.toString(),10)]=e[parseInt(r.toString(),10)],n[parseInt(r.toString(),10)]=t[parseInt(r.toString(),10)],o[parseInt(r.toString(),10)]=i[parseInt(r.toString(),10)];eF(this.parent,n,e)},GG.prototype.rowOrder=function(e){if(e.dropIndex!==e.fromIndex&&!isNaN(e.dropIndex)&&!A(e.target,"e-groupcaption")){if(this.parent.isDetail()){this.parent.detailCollapseAll();var t=[].slice.call(this.parent.getContentTable().querySelector(oD).children),i=this.parent.getRowsObject();t.filter(function(e){e.classList.contains("e-detailrow")&&e.remove()});for(var n=0,o=i.length;n<o&&i[parseInt(n.toString(),10)];n++)i[parseInt(n.toString(),10)].isDetailRow&&(this.parent.getRowsObject().splice(n,1),n--)}if((e.target.classList.contains("e-rowcelldrag")||e.target.classList.contains("e-dtdiagonalright")||e.target.classList.contains("e-dtdiagonaldown"))&&(e.target=e.target.parentElement),!e.target.classList.contains("e-rowcell")&&A(e.target,"e-rowcell")&&(e.target=A(e.target,"e-rowcell")),this.parent.frozenRows?this.updateFrozenRowreOrder(e):this.updateFrozenColumnreOrder(e),(!this.parent.allowGrouping||!this.parent.groupSettings.columns.length)&&0<this.selectedRowColls.length){this.parent.selectRows(this.selectedRowColls);var r=[];if(this.parent.filterSettings.columns.length||this.parent.sortSettings.columns.length){for(n=0,o=e.rows.length;n<o;n++)r.push(parseInt(e.rows[parseInt(n.toString(),10)].getAttribute(nD),10)-1);this.selectedRowColls=r}}this.selectedRowColls=[]}},GG.prototype.currentViewData=function(){for(var e=this.parent.getSelectedRowIndexes(),t=[],i=parseInt(this.startedRow.getAttribute(nD),10)-1,n=0,o=e.length;n<o;n++)t[parseInt(n.toString(),10)]=this.parent.currentViewData[e[parseInt(n.toString(),10)]];return this.parent.rowDropSettings.targetID||0!==e.length||(t[0]=this.parent.currentViewData[parseInt(i.toString(),10)]),t},GG.prototype.reorderRows=function(e,t){for(var i=this.parent.getSelectedRowIndexes(),n=[],o=[],r=this.parent.getDataModule().isRemote()?this.parent.getCurrentViewRecords():this.parent.renderModule.data.dataManager.dataSource.json,s=this.parent.allowPaging?this.parent.pageSettings.currentPage*this.parent.pageSettings.pageSize-this.parent.pageSettings.pageSize:0,a=t+s,l=e[0]+s,h=0,d=e.length;h<d;h++)o[parseInt(h.toString(),10)]=r[e[parseInt(h.toString(),10)]+s];for(h=0,d=i.length;h<d;h++)n[parseInt(h.toString(),10)]=r[i[parseInt(h.toString(),10)]+s];for(h=0,d=o.length;h<d;h++){if(0!==h){for(var p=0,c=r.length;p<c;p++)if(JSON.stringify(r[parseInt(p.toString(),10)])===JSON.stringify(o[parseInt(h.toString(),10)])){l=p;break}for(p=0,c=r.length;p<c;p++)if(JSON.stringify(r[parseInt(p.toString(),10)])===JSON.stringify(o[h-1])){p<l&&(a=p+1);break}}this.reorderRow(l-s,a-s)}this.isRefresh&&this.parent.notify($1,{type:WA,requestType:"rowdraganddrop"});for(h=0,d=n.length;h<d;h++)for(p=0,c=r.length;p<c;p++)if(JSON.stringify(r[parseInt(p.toString(),10)])===JSON.stringify(n[parseInt(h.toString(),10)])){i[parseInt(h.toString(),10)]=p-s;break}this.selectedRowColls=i},GG.prototype.stopTimer=function(){window.clearInterval(this.timer)},GG.prototype.onActionComplete=function(e){this.parent.trigger(QA,Pe(e,{type:QA,requestType:"rowdraganddrop"}))},GG.prototype.initializeDrag=function(){var e=this.parent;this.draggable=new hn(e.element,{dragTarget:".e-rowcelldrag, .e-rowdragdrop, .e-rowcell",distance:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop,isReplaceDragEle:this.isReplaceDragEle,isPreventSelect:!1,isPreventScroll:!0})},GG.prototype.updateScrollPostion=function(e){var t,i,n=this,e=JP(e).y,o=this.isDropGrid.getContent().getBoundingClientRect(),r=this.isDropGrid.getRowHeight()-15,s=this.isDropGrid.getContent().firstElementChild,a=this.parent.enableVirtualization?20:0;o.top>=e?(t=-this.isDropGrid.getRowHeight(),this.isOverflowBorder=!1,this.timer=window.setInterval(function(){n.setScrollDown(s,t)},200)):o.top+this.isDropGrid.getContent().clientHeight-r-33-a<=e&&(i=this.isDropGrid.getRowHeight(),this.isOverflowBorder=!1,this.timer=window.setInterval(function(){n.setScrollDown(s,i)},200))},GG.prototype.setScrollDown=function(e,t){e.scrollTop=e.scrollTop+t},GG.prototype.moveDragRows=function(e,t,i){var n=this.parent.element.querySelector(".e-cloneproperties"),o=(this.parent.element.classList.contains("e-childgrid")&&(n=this.getParentGrid(this.parent.element).querySelector(".e-cloneproperties")),z(e.target,"tr"));A(o,"e-grid")&&(!this.parent.rowDropSettings.targetID&&A(n.parentElement,"e-grid").id===A(o,"e-grid").id||this.istargetGrid)&&this.setBorder(o||t,e.event,t,i)},GG.prototype.setBorder=function(e,t,i,n){var o,r=this.parent.element,s=(this.istargetGrid&&(r=this.isDropGrid.element),this.parent.element.querySelector(".e-cloneproperties"));this.parent.allowGrouping&&this.parent.groupSettings.columns.length?this.removeBorder(e):(this.removeFirstRowBorder(e),this.removeLastRowBorder(e)),A(e,"e-grid")&&e.classList.contains(UE)&&(!this.parent.rowDropSettings.targetID&&A(s.parentElement,"e-grid").id===A(e,"e-grid").id||this.istargetGrid)&&(this.parent.allowGrouping&&this.parent.groupSettings.columns&&this.parent.groupSettings.columns.length?q(r.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"),["e-dragtop","e-dragright","e-dragbottom","e-dragleft"]):q(r.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"),["e-dragborder"]),s=[],o=parseInt(n.getAttribute(nD),10)-1,!n||0!==o||this.isNewRowAdded()&&"Top"===this.parent.editSettings.newRowPosition?s=this.parent.rowDropSettings.targetID&&n?(e=this.isDropGrid.getRowByIndex(o-1),[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))):n&&parseInt(i.getAttribute(nD),10)-1>o?(this.parent.enableVirtualization&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&(o=this.parent.getDataRows().indexOf(n)),this.parent.allowGrouping&&this.parent.groupSettings.columns.length?[].slice.call((e=n).querySelectorAll(".e-groupcaption,.e-summarycell,.e-rowcell:not(.e-hide),.e-rowdragdrop:not(.e-hide),\n                        .e-detailrowcollapse:not(.e-hide)")):(e=0===o&&this.isNewRowAdded()&&"Top"===this.parent.editSettings.newRowPosition?this.parent.element.querySelector(".e-row.e-addedrow tr"):this.parent.getRowByIndex(o-1),[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse,.e-dragindentcell")))):[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")):this.parent.allowGrouping&&this.parent.groupSettings.columns.length?s=[].slice.call((e=n).querySelectorAll(".e-groupcaption,.e-summarycell,.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")):(i=this.parent.createElement("div",{className:"e-firstrow-dragborder"}),(o=this.isDropGrid.getHeaderContent()).classList.add("e-grid-relative"),i.style.width=r.offsetWidth-this.getScrollWidth()+"px",o.getElementsByClassName("e-firstrow-dragborder").length||(this.parent.frozenRows?(this.parent.isFrozenGrid()&&(i.style.width=this.parent.getContent().firstElementChild.scrollWidth+"px"),o.querySelector("thead").appendChild(i),i.style.position="relative"):o.appendChild(i))),0<s.length)&&(this.parent.allowGrouping&&this.parent.groupSettings.columns&&this.parent.groupSettings.columns.length?this.groupRowDDIndicator(s,!0):vB(s,!0,"e-dragborder"))},GG.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?mk.getScrollBarWidth():0},GG.prototype.removeFirstRowBorder=function(e){0<this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder").length&&e&&(0!==e.rowIndex||e.classList.contains("e-columnheader"))?ue(this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder")[0]):(e=this.parent.element.querySelector(".e-row.e-addedrow tr"))&&e.querySelector(".e-dragborder")&&vB([].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse,.e-dragindentcell")),!1,"e-dragborder")},GG.prototype.removeLastRowBorder=function(e){var t;t=this.parent.enableVirtualization?e&&parseInt(e.getAttribute(nD),10)-1!=this.parent.renderModule.data.dataManager.dataSource.json.length-1:(t=this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&!this.parent.groupSettings.enableLazyLoading?this.parent.pageSettings.currentPage*this.parent.pageSettings.pageSize-1:this.parent.getCurrentViewRecords().length-1,t=this.parent.getRowByIndex(t),e&&t&&t.getAttribute("data-uid")!==e.getAttribute("data-uid")),0<this.parent.element.getElementsByClassName("e-lastrow-dragborder").length&&e&&t&&ue(this.parent.element.getElementsByClassName("e-lastrow-dragborder")[0])},GG.prototype.removeBorder=function(e){this.removeFirstRowBorder(e),this.parent.rowDropSettings.targetID||this.removeLastRowBorder(e),(e=(this.parent.allowGrouping&&this.parent.groupSettings.columns.length?[].slice.call(this.isDropGrid.getContentTable().querySelectorAll("tr")).filter(function(e){return e.querySelector("td.e-dragtop.e-dragbottom")}):this.isDropGrid.getRows().filter(function(e){return e.querySelector("td.e-dragborder")}))[0])&&(e=this.parent.allowGrouping&&this.parent.groupSettings.columns.length?[].slice.call(e.querySelectorAll(".e-dragtop.e-dragbottom")):[].slice.call(e.getElementsByClassName("e-dragborder")),this.parent.allowGrouping&&this.parent.groupSettings.columns&&this.parent.groupSettings.columns.length?this.groupRowDDIndicator(e,!1):vB(e,!1,"e-dragborder"))},GG.prototype.getElementFromPosition=function(e,t){t=JP(t),e.style.display="none",t=document.elementFromPoint(t.x,t.y);return e.style.display="",t},GG.prototype.onDataBound=function(){0<this.selectedRowColls.length&&(this.parent.enableVirtualization||this.parent.allowRowDragAndDrop)&&(this.parent.selectRows(this.selectedRowColls),this.selectedRowColls=[])},GG.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute(nD),10)-1:0},GG.prototype.singleRowDrop=function(e){var t=z(e.target,"tr"),e=e.droppedElement.parentElement.ej2_instances[0],t=t?t.rowIndex:e.currentViewData.length-1;this.reorderRow(this.startedRowIndex,t)},GG.prototype.columnDrop=function(e){var t=this.parent;if("grouping"!==e.droppedElement.getAttribute("action")&&(A(e.target,UE)||A(e.target,"e-emptyrow")||A(e.target,OE))){var i=z(e.target,"tr"),n=void 0,o=document.querySelector(".e-drag-ref");if(!("true"!==e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&(e.droppedElement.parentElement.id===t.element.id||o&&o.parentElement.id===t.element.id)||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&e.droppedElement.parentElement.id!==t.element.id)){if(e.droppedElement.parentElement.id!==t.element.id)o?(n=o.parentElement.ej2_instances[0],ue(o)):n=e.droppedElement.parentElement.ej2_instances[0];else if(this.isSingleRowDragDrop||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow"))return void this.singleRowDrop(e);if(n.element.id===t.element.id||n.rowDropSettings.targetID===t.element.id){var o=n.getSelectedRecords(),i=this.getTargetIdx(i),r=(e.target&&e.target.classList.contains("e-content")&&t.getCurrentViewRecords().length&&(e=t.getContentTable().querySelector("tr:last-child"))&&(i=parseInt(e.getAttribute(nD),10)),isNaN(i)&&(i=0),t.allowPaging&&(i=i+t.pageSettings.currentPage*t.pageSettings.pageSize-t.pageSettings.pageSize),t.notify(Tx,{toIndex:i,records:o}),t.notify($1,{type:WA,requestType:"rowdraganddrop"}),n.getSelectedRowIndexes()),s=n.allowPaging?n.pageSettings.currentPage*n.pageSettings.pageSize-n.pageSettings.pageSize:0;this.selectedRows=[];for(var a=0,l=o.length;a<l;a++)this.selectedRows.push(s+r[parseInt(a.toString(),10)]);n.notify(Ex,{indexes:this.selectedRows,records:o}),n.dataSource instanceof me&&n.dataSource.dataSource.offline&&n.notify($1,{type:WA,requestType:"rowdraganddrop"})}}}},GG.prototype.reorderRow=function(e,t){var i,n=this.parent;n.groupSettings.columns.length||(t+=i=n.allowPaging?n.pageSettings.currentPage*n.pageSettings.pageSize-n.pageSettings.pageSize:0,this.selectedRows=n.getSelectedRowIndexes(),n.notify(kI,{fromIndex:e+i,toIndex:t}))},GG.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.initializeDrag()},GG.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+RE)||e.querySelector("."+OE))&&(this.draggable.destroy(),this.parent.off(G1,this.initializeDrag),this.parent.off(a1,this.columnDrop),this.parent.off(ax,this.onActionComplete),this.parent.removeEventListener(qA,this.onDataBoundFn),this.parent.off(K1,this.enableAfterRender),this.parent.off(Cx,this.destroy))},GG.prototype.getModuleName=function(){return"rowDragAndDrop"},GG.prototype.processArgs=function(e){var t=this.parent,i=parseInt(this.startedRow.getAttribute(nD),10)-1;0<t.getSelectedRecords().length&&!1===this.startedRow.cells[0].classList.contains("e-selectionbackground")||0===t.getSelectedRecords().length?(t.enableInfiniteScrolling&&t.infiniteScrollSettings.enableCache?this.rows=[this.startedRow]:this.rows=[t.getRowByIndex(i)],this.rowData=[t.getRowInfo(this.startedRow.querySelector("."+LE)).rowData],(t.enableVirtualization||t.enableInfiniteScrolling&&t.infiniteScrollSettings.enableCache)&&t.allowGrouping&&t.groupSettings.columns.length&&t.getSelectedRows().length&&(this.rows=t.getSelectedRows(),this.rowData=Array.from(this.rows,function(e){return t.getRowObjectFromUID(e.getAttribute("data-uid")).data}))):(this.rows=t.getSelectedRows(),this.rowData=Array.from(this.rows,function(e){return t.getRowObjectFromUID(e.getAttribute("data-uid")).data}))};var qG=GG;function GG(e){var d=this;this.selectedRows=[],this.isOverflowBorder=!0,this.selectedRowColls=[],this.isRefresh=!0,this.isReplaceDragEle=!0,this.istargetGrid=!1,this.helper=function(e){var t=d.parent,i=d.draggable.currentStateTarget,n=(je(i)||!t.rowDropSettings.targetID||je(i.classList)||i.classList.contains("e-rowcell")||(i=A(i,"e-rowcell")),d.parent.createElement("div",{className:"e-cloneproperties e-draganddrop e-grid e-dragclone"})),o=(n.style.height="auto",d.parent.createElement("table",{attrs:{role:"grid"}})),r=d.parent.createElement(oD,{attrs:{role:"rowgroup"}});if(document.getElementsByClassName("e-griddragarea").length||t.rowDropSettings.targetID&&(!je(i)&&!i.classList.contains("e-selectionbackground")&&"Single"!==t.selectionSettings.type||!A(i,"e-rowcell"))||!t.rowDropSettings.targetID&&!A(i,"e-rowdragdrop"))return!1;if(t.rowDropSettings.targetID&&"Row"===t.selectionSettings.mode&&"Single"===t.selectionSettings.type&&t.selectRow(parseInt(d.draggable.currentStateTarget.parentElement.getAttribute(nD),10)-1),d.startedRow=z(i,"tr").cloneNode(!0),d.parent.isFrozenGrid())for(var s=[].slice.call(d.startedRow.querySelectorAll(".e-rowcell")),a=0;a<s.length;a++)q([s[parseInt(a.toString(),10)]],["e-leftfreeze","e-freezeleftborder","e-fixedfreeze","e-freezerightborder","e-rightfreeze","e-unfreeze"]),s[parseInt(a.toString(),10)].removeAttribute("style");d.processArgs(i);var l={selectedRow:d.rows,dragelement:i,cloneElement:n,cancel:!1,data:d.rowData},h=t.getSelectedRows();t.trigger(l1,l);if(l.cancel)return!1;KP(d.startedRow,".e-indentcell"),KP(d.startedRow,".e-detailrowcollapse"),KP(d.startedRow,".e-detailrowexpand"),t.enableInfiniteScrolling&&t.infiniteScrollSettings.enableCache||d.removeCell(d.startedRow,qE);d.startedRow.querySelectorAll(".e-active").forEach(function(e){return e.classList.remove("e-active")}),r.appendChild(d.startedRow),1<t.getSelectedRowIndexes().length&&d.startedRow.hasAttribute("aria-selected")&&(l=d.parent.createElement("span",{className:"e-dropitemscount",innerHTML:""+h.length}),n.appendChild(l));h=z(i,"tr").querySelector(".e-icon-rowdragicon");return h&&h.classList.add("e-dragstartrow"),o.appendChild(r),n.appendChild(o),t.element.appendChild(n),n},this.dragStart=function(e){var t,i,n=d.parent;if((n.enableVirtualization||n.infiniteScrollSettings.enableCache)&&n.allowGrouping&&n.groupSettings.columns.length&&!je(e.target.closest("tr")))for(var o=e.dragElement.querySelectorAll("tr"),r=e.target.closest("tr").querySelectorAll(".e-indentcell"),s=0;s<o.length;s++)for(var a=0;a<r.length;a++){var l=r[parseInt(a.toString(),10)].cloneNode(!0);o[parseInt(s.toString(),10)].insertBefore(l,o[parseInt(s.toString(),10)].firstElementChild)}n.element.classList.contains("e-childgrid")&&(d.getParentGrid(n.element).appendChild(e.dragElement),n.element.appendChild(n.createElement("div",{className:"e-drag-ref"}))),document.body.classList.add("e-prevent-select"),document.getElementsByClassName("e-griddragarea").length||(t=e.target,i=d.parent.element.querySelector(".e-dropitemscount"),1<d.parent.getSelectedRecords().length&&i&&(i.style.left=d.parent.element.querySelector(".e-cloneproperties table").offsetWidth-5+"px"),d.processArgs(t),n.trigger(h1,{rows:d.rows,target:e.target,draggableType:"rows",fromIndex:parseInt(d.rows[0].getAttribute(nD),10)-1,data:d.rowData[0]&&0<Object.keys(d.rowData[0]).length?d.rowData:d.currentViewData()}),d.dragStartData=d.rowData,i=document.getElementById(n.rowDropSettings.targetID),n.rowDropSettings.targetID&&i&&i.ej2_instances&&"grid"===i.ej2_instances[0].getModuleName()&&i.ej2_instances[0].getContent().classList.add("e-allowRowDrop"))},this.drag=function(e){var t,i,n=d.parent,o=(d.isDropGrid=d.parent,d.istargetGrid=!1,d.parent.rowDropSettings.targetID&&(o=document.getElementById(n.rowDropSettings.targetID),d.isDropGrid=o.ej2_instances[0],A(e.target,"e-grid"))&&(d.istargetGrid=d.parent.rowDropSettings.targetID===A(e.target,"e-grid").id),d.parent.element.querySelector(".e-cloneproperties")),r=(n.element.classList.contains("e-childgrid")&&(o=d.getParentGrid(n.element).querySelector(".e-cloneproperties")),d.getElementFromPosition(o,e.event)),s=(mt(o,["e-defaultcur"],["e-notallowedcur","e-movecur","e-grabcur"]),d.isOverflowBorder=!0,d.hoverState=n.enableHover,A(r,"e-grid")?z(e.target,"tr"):null);e.target&&(d.processArgs(r),n.enableVirtualization&&je(d.rows[0])&&mt(o,["e-notallowedcur"],["e-movecur"]),i={rows:d.rows,target:r,draggableType:"rows",data:d.rowData,originalEvent:e,cancel:!1},n.trigger(d1,i),d.stopTimer(),i.cancel||(n.element.classList.add("e-rowdrag"),s&&(A(r,"e-grid").id===o.parentElement.id||A(r,"e-grid").id)?d.isDropGrid.element.querySelector(".e-emptyrow")?d.dragTarget=0:d.dragTarget=parseInt(s.getAttribute("aria-rowindex"),10)-1:d.dragTarget=parseInt(d.startedRow.getAttribute("aria-rowindex"),10)-1,n.rowDropSettings.targetID?(i=document.querySelector(".e-drag-ref"),!A(r,"e-grid")||i&&A(i.parentElement,"e-grid").id===A(r,"e-grid").id||A(o.parentElement,"e-grid").id===A(r,"e-grid").id?mt(o,["e-notallowedcur"],["e-defaultcur"]):mt(o,["e-grabcur"],["e-notallowedcur"])):(i=A(r,"e-grid"))&&i.id===o.parentElement.id&&A(r,"e-row")&&!A(r,"e-addedrow")?mt(o,["e-movecur"],["e-defaultcur"]):mt(o,["e-notallowedcur"],["e-movecur"]),A(d.isDropGrid.element,"e-grid")&&(d.isDropGrid.groupSettings.columns.length&&!d.isDropGrid.groupSettings.columns.length||d.isDropGrid.element.querySelector(".e-emptyrow")||(A(r,"e-grid")&&A(r,"e-grid").id===d.isDropGrid.element.id&&d.updateScrollPostion(e.event),(d.isOverflowBorder||d.parent.frozenRows>d.dragTarget)&&(parseInt(d.startedRow.getAttribute(nD),10)-1!==d.dragTarget||d.istargetGrid)||d.istargetGrid&&s&&d.isDropGrid.getRowByIndex(d.isDropGrid.getCurrentViewRecords().length-1).getAttribute("data-uid")===s.getAttribute("data-uid")?d.moveDragRows(e,d.startedRow,s):(i=void 0,d.parent.enableVirtualization?i=s&&parseInt(s.getAttribute(nD),10)-1==d.parent.renderModule.data.dataManager.dataSource.json.length-1:(t=d.parent.enableInfiniteScrolling&&d.parent.infiniteScrollSettings.enableCache&&!d.parent.groupSettings.enableLazyLoading?d.parent.pageSettings.currentPage*d.parent.pageSettings.pageSize-1:d.parent.getCurrentViewRecords().length-1,o=d.parent.getRowByIndex(t),i=s&&o&&o.getAttribute("data-uid")===s.getAttribute("data-uid")&&o.getAttribute("data-uid")!==d.startedRow.getAttribute("data-uid"),d.isNewRowAdded()&&"Bottom"===d.parent.editSettings.newRowPosition&&(i=!1)),i&&!d.parent.rowDropSettings.targetID&&(e=d.parent.createElement("div",{className:"e-lastrow-dragborder"}),o=d.parent.getContent(),e.style.width=d.parent.element.offsetWidth-d.getScrollWidth()+"px",d.parent.enableVirtualization&&(e.style.zIndex="1"),o.getElementsByClassName("e-lastrow-dragborder").length||n.allowGrouping&&n.groupSettings.columns.length&&!je(s.nextSibling)||(o.classList.add("e-grid-relative"),o.appendChild(e),e.style.bottom=d.getScrollWidth()+"px")),d.removeBorder(s))),r)&&r.classList.contains(WE)&&!d.isDropGrid.element.querySelector(".e-emptyrow")&&d.istargetGrid&&(d.removeBorder(s),t=d.isDropGrid.getCurrentViewRecords().length-1,i=[],0<(i=d.parent.allowGrouping&&d.parent.groupSettings.columns&&d.parent.groupSettings.columns.length?[].slice.call(d.isDropGrid.getRowByIndex(t).querySelectorAll(".e-rowcell:not(.e-hide),.e-rowdragdrop:not(.e-hide),.e-detailrowcollapse:not(.e-hide)")):[].slice.call(d.isDropGrid.getRowByIndex(t).querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))).length)&&(d.parent.allowGrouping&&d.parent.groupSettings.columns&&d.parent.groupSettings.columns.length?d.groupRowDDIndicator(i,!0):vB(i,!0,"e-dragborder"))))},this.dragStop=function(e){d.parent.isCheckBoxSelection&&d.parent.enableInfiniteScrolling&&window.getSelection().removeAllRanges(),document.body.classList.remove("e-prevent-select"),mB(d.parent)?d.parent.notify(zx,{instance:d,handler:d.processDragStop,arg1:e}):d.processDragStop(e)},this.processDragStop=function(t){var e,i,n,o,r=d.parent;d.parent.isDestroyed||(e=d.getElementFromPosition(t.helper,t.event),i=e&&!e.classList.contains("e-dlg-overlay")?e:t.target,r.element.classList.remove("e-rowdrag"),n=document.getElementById(r.rowDropSettings.targetID),r.rowDropSettings.targetID&&n&&n.ej2_instances&&"grid"===n.ej2_instances[0].getModuleName()&&n.ej2_instances[0].getContent().classList.remove("e-allowRowDrop"),A(d.isDropGrid.element,"e-grid")&&(d.stopTimer(),d.isDropGrid.enableHover=d.hoverState,d.isDropGrid.getContent().classList.remove("e-grid-relative"),d.removeBorder(e),n=d.isDropGrid.element.querySelector(".e-dragstartrow"))&&n.classList.remove("e-dragstartrow"),d.processArgs(i),r.enableVirtualization&&je(d.rows[0]))||(o={target:i,draggableType:"rows",cancel:!1,fromIndex:parseInt(d.rows[0].getAttribute(nD),10)-1,dropIndex:d.dragTarget,rows:d.rows,data:0<Object.keys(d.dragStartData[0]).length?d.dragStartData:d.currentViewData()},r.trigger(p1,o,function(){var e;!(A(i,UE)||A(i,"e-emptyrow")||A(i,OE))||o.cancel?(d.dragTarget=null,ue(t.helper)):(d.isRefresh=!1,e=d.parent.getSelectedRowIndexes(),r.isRowDragable()&&(!d.parent.rowDropSettings.targetID&&d.startedRow.querySelector("td.e-selectionbackground")&&1<e.length&&e.length!==d.parent.getCurrentViewRecords().length?d.reorderRows(e,o.dropIndex):d.reorderRows([parseInt(d.startedRow.getAttribute(nD),10)-1],d.dragTarget),d.dragTarget=null,r.rowDropSettings.targetID||(t.helper.classList.contains("e-cloneproperties")&&document.querySelector("."+t.helper.classList[0])&&ue(t.helper),!r.enableVirtualization||r.sortSettings.columns.length||r.filterSettings.columns.length||d.parent.allowGrouping&&r.groupSettings.columns.length?d.rowOrder(o):r.refresh()),d.parent.getContentTable().scrollHeight<d.parent.getContent().clientHeight)&&d.parent.scrollModule.setLastRowCell(),d.isRefresh=!0)}))},this.removeCell=function(t,i){return[].slice.call(t.querySelectorAll("td")).filter(function(e){e.classList.contains(i)&&t.deleteCell(e.cellIndex)})},this.parent=e,this.parent.isDestroyed||(this.parent.on(G1,this.initializeDrag,this),this.parent.on(a1,this.columnDrop,this),this.parent.on(ax,this.onActionComplete,this),this.onDataBoundFn=this.onDataBound.bind(this),this.parent.addEventListener(qA,this.onDataBoundFn),this.parent.on(K1,this.enableAfterRender,this),this.parent.on(Cx,this.destroy,this))}XG.prototype.addLabel=function(){var e;this.element.getElementsByClassName("e-group-animator").length||(e=this.l10n.getConstant("GroupDropArea"),this.element.innerHTML=e,this.element.classList.remove("e-grouped"))},XG.prototype.rearrangeGroup=function(){this.sortRequired=!1,this.updateModel()},XG.prototype.columnDrag=function(e){this.groupSettings.allowReordering&&e.column.allowGrouping&&this.animateDropper(e);var t=this.parent.element.querySelector(".e-cloneproperties");this.parent.allowReordering||mt(t,["e-defaultcur"],["e-notallowedcur"]),e.column.allowGrouping&&(A(e.target,"e-groupdroparea")||A(e.target,"e-headercell")&&A(e.target,"e-headercell").isEqualNode(this.parent.getColumnHeaderByField(e.column.field)))||this.parent.allowReordering&&A(e.target,"e-headercell")||mt(t,["e-notallowedcur"],["e-defaultcur"]),e.target.classList.contains("e-groupdroparea")?this.element.classList.add("e-hover"):this.element.classList.remove("e-hover")},XG.prototype.columnDragStart=function(e){var t;e.target.classList.contains("e-stackedheadercell")||(t=this.parent.element.querySelector(".e-groupdroparea"),this.aria.setDropTarget(t,e.column.allowGrouping),t=e.target.classList.contains("e-headercell")?e.target:A(e.target,"e-headercell"),this.aria.setGrabbed(t,!0,!e.column.allowGrouping))},XG.prototype.columnDrop=function(e){var t=this.parent;"grouping"!==e.droppedElement.getAttribute("action")||je(e=t.getColumnByUid(e.droppedElement.getAttribute("e-mappinguid")))||!1===e.allowGrouping||A(t.getColumnHeaderByUid(e.uid),"e-grid").getAttribute("id")!==t.element.getAttribute("id")||this.ungroupColumn(e.field)},XG.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(K1,this.enableAfterRender,this),this.parent.on(lx,this.onActionComplete,this),this.parent.on(hx,this.onActionComplete,this),this.parent.on(Z1,this.onPropertyChanged,this),this.parent.on(wx,this.clickHandler,this),this.parent.on(s1,this.columnDrag,this),this.parent.on(r1,this.columnDragStart,this),this.parent.on(Mx,this.columnDrop,this),this.parent.on(a1,this.columnDrop,this),this.parent.on(tx,this.refreshSortIcons,this),this.parent.on(nx,this.refreshSortIcons,this),this.parent.on(bx,this.keyPressHandler,this),this.parent.on(X1,this.initialEnd,this),this.parent.on(J1,this.initialEnd,this),this.parent.on(G1,this.render,this),this.parent.on(dx,this.onGroupAggregates,this),this.parent.on(Cx,this.destroy,this),this.parent.on("group-expand-collapse",this.updateExpand,this),this.parent.on("persist-data-changed",this.initialEnd,this))},XG.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(G1,this.render),this.parent.off(K1,this.enableAfterRender),this.parent.off(lx,this.onActionComplete),this.parent.off(hx,this.onActionComplete),this.parent.off(Z1,this.onPropertyChanged),this.parent.off(wx,this.clickHandler),this.parent.off(s1,this.columnDrag),this.parent.off(r1,this.columnDragStart),this.parent.off(a1,this.columnDrop),this.parent.off(Mx,this.columnDrop),this.parent.off(tx,this.refreshSortIcons),this.parent.off(nx,this.refreshSortIcons),this.parent.off(bx,this.keyPressHandler),this.parent.off(dx,this.onGroupAggregates),this.parent.off(Cx,this.destroy),this.parent.off("group-expand-collapse",this.updateExpand))},XG.prototype.initialEnd=function(){var e=this.parent;if(this.parent.off(X1,this.initialEnd),this.parent.off(J1,this.initialEnd),this.parent.getColumns().length&&this.groupSettings.columns.length){this.contentRefresh=!1;for(var t=0,i=e.groupSettings.columns;t<i.length;t++){var n=i[t];this.groupColumn(n)}this.contentRefresh=!0}},XG.prototype.keyPressHandler=function(e){var t=this.parent;if(e.target&&A(e.target,"e-groupheadercell")&&("tab"===e.action||"shiftTab"===e.action)){var i=this.getFocusableGroupedItems();if("tab"===e.action&&e.target===i[i.length-1]||"shiftTab"===e.action&&e.target===i[0])return;for(var n,o=0;o<i.length;o++)if(e.target===i[parseInt(o.toString(),10)])return e.preventDefault(),n="tab"===e.action?o+1:o-1,void i[parseInt(n.toString(),10)].focus()}var r=/(Mac)/i.test(navigator.platform);if(r&&e.metaKey&&("downArrow"===e.action?e.action="ctrlDownArrow":"upArrow"===e.action&&(e.action="ctrlUpArrow")),("ctrlSpace"===e.action||this.groupSettings.columns.length&&-1!==["altDownArrow","altUpArrow","ctrlDownArrow","ctrlUpArrow","enter"].indexOf(e.action))&&(!this.parent.groupSettings.enableLazyLoading||!this.groupSettings.columns.length||"ctrlUpArrow"!==e.action&&"ctrlDownArrow"!==e.action))switch(e.action){case"altDownArrow":case"altUpArrow":var s=t.allowSelection?t.getSelectedRowIndexes():[];if(s.length){e.preventDefault();for(var a=t.getContentTable().querySelector(oD).children,l=void 0,o=t.getDataRows()[s[s.length-1]].rowIndex;0<=o;o--)if(!a[parseInt(o.toString(),10)].classList.contains(UE)&&!a[parseInt(o.toString(),10)].classList.contains("e-detailrow")){l=a[parseInt(o.toString(),10)];break}this.expandCollapseRows(l.querySelector("altUpArrow"===e.action?".e-recordplusexpand":".e-recordpluscollapse"))}break;case"ctrlDownArrow":e.preventDefault(),this.expandAll();break;case"ctrlUpArrow":e.preventDefault(),this.collapseAll();break;case"enter":e.target.classList.contains("e-groupsort")?(this.groupSortFocus=!0,e.preventDefault(),this.applySortFromTarget(e.target)):e.target.classList.contains("e-ungroupbutton")?(this.groupCancelFocus=!0,e.preventDefault(),this.unGroupFromTarget(e.target)):this.parent.isEdit||null!==z(e.target,"#"+this.parent.element.id+"_searchbar")||A(e.target,"e-pager")||A(e.target,"e-toolbar")||(h=(s=(s=this.focus.getFocusedElement())&&(s.classList.contains("e-icon-grightarrow")||s.classList.contains("e-icon-gdownarrow"))?s.parentElement:s)&&s.parentElement?s.parentElement.querySelector('[class^="e-record"]'):null)&&s.children.length&&(s.children[0].classList.contains("e-icon-grightarrow")||s.children[0].classList.contains("e-icon-gdownarrow"))&&(e.preventDefault(),this.expandCollapseRows(h));break;case"ctrlSpace":var h,s=t.focusModule.currentInfo.element;s&&s.classList.contains("e-headercell")&&(e.preventDefault(),(h=t.getColumnByUid(s.firstElementChild.getAttribute("e-mappinguid"))).field&&t.groupSettings.columns.indexOf(h.field)<0?this.groupColumn(h.field):this.ungroupColumn(h.field))}},XG.prototype.getFocusableGroupedItems=function(){var e=[];if(this.groupSettings.columns.length)for(var t=this.element.querySelectorAll(".e-groupheadercell"),i=0;i<t.length;i++)e.push(t[parseInt(i.toString(),10)].querySelector(".e-grouptext")),e.push(t[parseInt(i.toString(),10)].querySelector(".e-groupsort")),e.push(t[parseInt(i.toString(),10)].querySelector(".e-ungroupbutton"));return e},XG.prototype.wireEvent=function(){E.add(this.element,"focusin",this.onFocusIn,this),E.add(this.element,"focusout",this.onFocusOut,this),E.add(this.parent.element,"auxclick",this.auxilaryclickHandler,this)},XG.prototype.unWireEvent=function(){E.remove(this.element,"focusin",this.onFocusIn),E.remove(this.element,"focusout",this.onFocusOut),E.remove(this.parent.element,"auxclick",this.auxilaryclickHandler)},XG.prototype.onFocusIn=function(e){this.parent.focusModule.currentInfo&&this.parent.focusModule.currentInfo.element&&(q([this.parent.focusModule.currentInfo.element,this.parent.focusModule.currentInfo.elementToFocus],["e-focused","e-focus"]),this.parent.focusModule.currentInfo.element.tabIndex=-1),this.addOrRemoveFocus(e)},XG.prototype.onFocusOut=function(e){this.addOrRemoveFocus(e)},XG.prototype.addOrRemoveFocus=function(e){var t;(e.target.classList.contains("e-groupdroparea")||e.target.classList.contains("e-grouptext")||e.target.classList.contains("e-groupsort")||e.target.classList.contains("e-ungroupbutton"))&&(t=e.target.classList.contains("e-grouptext")?e.target.parentElement.parentElement:e.target,"focusin"===e.type?(this.parent.focusModule.currentInfo.element=e.target,this.parent.focusModule.currentInfo.elementToFocus=e.target,U([t],["e-focused","e-focus"]),e.target.tabIndex=0):(q([t],["e-focused","e-focus"]),e.target.tabIndex=-1))},XG.prototype.clickHandler=function(e){e.target.classList.contains("e-grouptext")&&(this.groupTextFocus=!0),e.target.classList.contains("e-groupsort")&&(this.groupSortFocus=!0),e.target.classList.contains("e-ungroupbutton")&&(this.groupCancelFocus=!0),(e.target.classList.contains("e-icon-grightarrow")||e.target.classList.contains("e-icon-gdownarrow"))&&e.preventDefault();var t=A(e.target,"e-recordplusexpand")||A(e.target,"e-recordpluscollapse");t&&(t.children[0].classList.contains("e-icon-gdownarrow")||t.children[0].classList.contains("e-icon-grightarrow"))&&this.expandCollapseRows(e.target),this.applySortFromTarget(e.target),this.unGroupFromTarget(e.target),this.toogleGroupFromHeader(e.target)},XG.prototype.auxilaryclickHandler=function(e){(e.target.classList.contains("e-icon-grightarrow")||e.target.classList.contains("e-icon-gdownarrow")&&1===e.button)&&e.preventDefault()},XG.prototype.unGroupFromTarget=function(e){e.classList.contains("e-ungroupbutton")&&this.ungroupColumn(e.parentElement.getAttribute("ej-mappingname"))},XG.prototype.toogleGroupFromHeader=function(e){this.groupSettings.showToggleButton&&(e.classList.contains("e-grptogglebtn")?e.classList.contains("e-toggleungroup")?this.ungroupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("e-mappinguid")).field):this.groupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("e-mappinguid")).field):e.classList.contains("e-toggleungroup")&&this.ungroupColumn(e.parentElement.getAttribute("ej-mappingname")))},XG.prototype.applySortFromTarget=function(e){var t=this.parent,i=z(e,".e-groupheadercell");t.allowSorting&&i&&!e.classList.contains("e-ungroupbutton")&&!e.classList.contains("e-toggleungroup")&&(e=i.firstElementChild.getAttribute("ej-mappingname"),t.getColumnHeaderByField(e).getElementsByClassName("e-ascending").length?t.sortColumn(e,"Descending",!0):t.sortColumn(e,"Ascending",!0))},XG.prototype.expandCollapseRows=function(e){var t=A(e,"e-recordplusexpand")||A(e,"e-recordpluscollapse");if(t){var i=[].slice.call(this.parent.getContentTable().querySelector(oD).children),n=(this.parent.editSettings.showAddNewRow&&(i[0].classList.contains("e-addedrow")?i.shift():i[i.length-1].classList.contains("e-addedrow")&&i.pop()),void 0),o=this.parent,r=t.parentElement.getElementsByClassName("e-indentcell").length,s=t.parentElement.getAttribute("data-uid"),a=o.getRowObjectFromUID(s),l=!1;if(t.classList.contains("e-recordpluscollapse")?(U([t],"e-recordplusexpand"),q([t],"e-recordpluscollapse"),t.firstElementChild.className="e-icons e-gdiagonaldown e-icon-gdownarrow",t.firstElementChild.setAttribute("title",this.l10n.getConstant("Expanded")),a.isExpand=l=!0,BB(o)&&this.updateVirtualRows(o,e,l,void 0,void 0),this.parent.groupSettings.enableLazyLoading&&((this.parent.filterSettings.columns.length||this.parent.sortSettings.columns.length||this.parent.searchSettings.key.length)&&0===this.parent.getContent().firstElementChild.scrollTop&&(this.parent.contentModule.isTop=!0),(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).captionExpand(t.parentElement))):(a.isExpand=!(n=!0),q([t],"e-recordplusexpand"),U([t],"e-recordpluscollapse"),t.firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",t.firstElementChild.setAttribute("title",this.l10n.getConstant("Collapsed")),BB(o)&&this.updateVirtualRows(o,e,!n,void 0,void 0),this.parent.groupSettings.enableLazyLoading&&(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).captionCollapse(t.parentElement)),this.aria.setExpand(t,l),!BB(o)&&!this.parent.groupSettings.enableLazyLoading){for(var h=o.getRowsObject(),d=h.indexOf(a),p={},c=o.enableInfiniteScrolling&&o.infiniteScrollSettings&&o.infiniteScrollSettings.enableCache&&h.length!==i.length?Array.from(i).indexOf(t.parentElement):void 0,u=d;u<h.length&&!(d<u&&h[parseInt(u.toString(),10)].indent===r);u++){if(h[parseInt(u.toString(),10)].isDetailRow){var g=h[u-1].isExpand&&h[u-1].visible;c&&0<c&&c<i.length?i[parseInt(c.toString(),10)].style.display=g?"":"none":je(c)&&(i[parseInt(u.toString(),10)].style.display=g?"":"none")}else if(!1===p[h[parseInt(u.toString(),10)].parentUid])h[parseInt(u.toString(),10)].visible=!1,c&&0<c&&c<i.length?i[parseInt(c.toString(),10)].style.display="none":je(c)&&(i[parseInt(u.toString(),10)].style.display="none");else{if(!(h[parseInt(u.toString(),10)].isDataRow||h[parseInt(u.toString(),10)].isCaptionRow||h[parseInt(u.toString(),10)].isDetailRow||h[parseInt(u.toString(),10)].isAggregateRow))if((g=h[parseInt(u.toString(),10)].cells.some(function(e){return e.isDataCell&&e.visible}))===h[parseInt(u.toString(),10)].visible)continue;h[parseInt(u.toString(),10)].visible=!0,c&&0<c&&c<i.length?(i[parseInt(c.toString(),10)].style.display="",i[parseInt(c.toString(),10)].classList.remove("e-hide")):je(c)&&(i[parseInt(u.toString(),10)].style.display="",i[parseInt(u.toString(),10)].classList.remove("e-hide"))}h[parseInt(u.toString(),10)].isCaptionRow&&(p[h[parseInt(u.toString(),10)].uid]=h[parseInt(u.toString(),10)].isExpand&&h[parseInt(u.toString(),10)].visible),je(c)||c++}this.lastCaptionRowBorder(),this.parent.notify(QT,{rows:this.parent.getRowsObject()})}this.parent.enableInfiniteScrolling&&this.parent.groupSettings.enableLazyLoading||this.parent.notify(aE,{isCollapse:n,parentUid:s})}},XG.prototype.lastCaptionRowBorder=function(){var e=this.parent.getContentTable(),t=this.parent.getContent().clientHeight;if((!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||this.parent.groupSettings.enableLazyLoading)&&(e.scrollHeight<t||this.isAppliedCaptionRowBorder)){if(this.isAppliedCaptionRowBorder||e.querySelector(".e-lastrowcell")){for(var i=e.querySelectorAll(".e-lastrowcell"),n=0,o=i.length;n<o;n++)q([i[parseInt(n.toString(),10)]],"e-lastrowcell");this.isAppliedCaptionRowBorder=!1}var r=this.parent.getContentTable().querySelector(oD).children,s=r[r.length-1];if("none"===s.style.display||s.classList.contains("e-groupcaptionrow")){for(n=r.length-1,o=0;o<n;n--)if("none"!==r[parseInt(n.toString(),10)].style.display&&r[parseInt(n.toString(),10)].classList.contains("e-groupcaptionrow")&&r[parseInt(n.toString(),10)].querySelector(".e-recordpluscollapse")){U(r[parseInt(n.toString(),10)].childNodes,"e-lastrowcell"),this.isAppliedCaptionRowBorder=!0;break}}else e.scrollHeight<t&&(U(e.querySelectorAll("tr:last-child td"),"e-lastrowcell"),this.isAppliedCaptionRowBorder=!0)}},XG.prototype.updateVirtualRows=function(t,e,i,n,o){var e=t.getRowObjectFromUID(e.closest("tr").getAttribute("data-uid")),r=(e.isExpand=i,LP(t),this.parent.notify(GT,{}),n=t.getDataModule().generateQuery(!1),{requestType:"virtualscroll",rowObject:e});t.contentModule&&(r.virtualInfo=t.contentModule.prevInfo),t.getDataModule().getData(r,n.requiresCount()).then(function(e){return t.renderModule.dataManagerSuccess(e,r)})},XG.prototype.expandCollapse=function(e){if(this.parent.groupSettings.columns.length){e||this.parent.notify(uT,e);for(var t,i=this.parent.getContentTable().querySelector(oD).children,n=this.parent.getRowsObject(),o=0,r=i.length;o<r;o++)i[parseInt(o.toString(),10)].querySelectorAll(".e-recordplusexpand, .e-recordpluscollapse").length&&((t=i[parseInt(o.toString(),10)].querySelector(e?".e-recordpluscollapse":".e-recordplusexpand"))&&(e?(t.className="e-recordplusexpand",t.firstElementChild.className="e-icons e-gdiagonaldown e-icon-gdownarrow",t.setAttribute("aria-expanded","true"),t.firstElementChild.setAttribute("title",this.l10n.getConstant("Expanded"))):(t.className="e-recordpluscollapse",t.firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",t.setAttribute("aria-expanded","false"),t.firstElementChild.setAttribute("title",this.l10n.getConstant("Collapsed")))),i[parseInt(o.toString(),10)].firstElementChild.classList.contains("e-recordplusexpand")||i[parseInt(o.toString(),10)].firstElementChild.classList.contains("e-recordpluscollapse"))||(i[parseInt(o.toString(),10)].style.display=e?"":"none"),n[parseInt(o.toString(),10)].isCaptionRow&&(n[parseInt(o.toString(),10)].isExpand=!!e);this.parent.updateVisibleExpandCollapseRows(),this.lastCaptionRowBorder(),this.parent.notify(QT,{rows:this.parent.getRowsObject()})}},XG.prototype.expandAll=function(){this.expandCollapse(!0)},XG.prototype.collapseAll=function(){this.expandCollapse(!1)},XG.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.renderGroupDropArea(),this.initDragAndDrop(),this.refreshToggleBtn(),this.wireEvent()},XG.prototype.renderGroupDropArea=function(){var e=this.parent.element.querySelector(".e-groupdroparea");e&&ue(e),this.element=this.parent.createElement("div",{className:"e-groupdroparea",attrs:{tabindex:"-1"}}),this.groupSettings.allowReordering&&this.element.classList.add("e-group-animate"),this.updateGroupDropArea(),this.parent.element.insertBefore(this.element,this.parent.element.firstChild),this.groupSettings.showDropArea&&"Vertical"!==this.parent.rowRenderingMode||(this.element.style.display="none")},XG.prototype.updateGroupDropArea=function(e){var t;this.groupSettings.showDropArea&&!this.groupSettings.columns.length?(t=this.l10n.getConstant("GroupDropArea"),this.element.innerHTML=t,this.element.classList.remove("e-grouped")):((this.element.innerHTML!==this.l10n.getConstant("GroupDropArea")||1!==this.groupSettings.columns.length&&(this.isAppliedGroup||this.isAppliedUnGroup))&&!e||(this.element.innerHTML=""),this.element.classList.add("e-grouped"))},XG.prototype.initDragAndDrop=function(){this.initializeGHeaderDrop(),this.initializeGHeaderDrag()},XG.prototype.initializeGHeaderDrag=function(){new hn(this.element,{dragTarget:this.groupSettings.allowReordering?".e-drag":".e-groupheadercell",distance:this.groupSettings.allowReordering?-10:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop})},XG.prototype.initializeGHeaderDrop=function(){new un(this.element,{accept:".e-dragclone",drop:this.drop})},XG.prototype.groupColumn=function(e){var t=this.parent,i=t.getColumnByField(e);je(i)||!1===i.allowGrouping||this.contentRefresh&&-1<this.groupSettings.columns.indexOf(e)?this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:i.headerText}):mB(t)?t.notify(zx,{instance:this,handler:this.groupColumn,arg1:e}):(i.visible=t.groupSettings.showGroupedColumn,this.colName=e,this.isAppliedGroup=!0,this.contentRefresh?this.updateModel():this.addColToGroupDrop(e),this.updateGroupDropArea(),this.isAppliedGroup=!1)},XG.prototype.ungroupColumn=function(t){var e=this.parent,i=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(e){return e.field===t})[0]:e.getColumnByField(t);if(!(je(i)||!1===i.allowGrouping||this.groupSettings.columns.indexOf(t)<0))if(mB(e))e.notify(zx,{instance:this,handler:this.ungroupColumn,arg1:t});else{i.visible=!0,this.colName=i.field;i=JSON.parse(JSON.stringify(this.groupSettings.columns));if(i.splice(i.indexOf(this.colName),1),this.sortedColumns.indexOf(t)<0)for(var n=0,o=e.sortSettings.columns.length;n<o;n++)if(t===e.sortSettings.columns[parseInt(n.toString(),10)].field){e.sortSettings.columns.splice(n,1);break}this.groupSettings.allowReordering&&(this.reorderingColumns=i),this.groupSettings.columns=i,e.allowGrouping&&(this.isAppliedUnGroup=!0,this.parent.dataBind())}},XG.prototype.updateModel=function(){var e=JSON.parse(JSON.stringify(this.groupSettings.columns)),e=this.reorderingColumns.length?JSON.parse(JSON.stringify(this.reorderingColumns)):e;this.sortRequired&&(-1===e.indexOf(this.colName)&&e.push(this.colName),this.groupAddSortingQuery(this.colName)),this.sortRequired=!0,this.parent.groupSettings.columns=e,this.parent.dataBind()},XG.prototype.onActionComplete=function(e){"grouping"===e.requestType?this.addColToGroupDrop(this.colName):this.removeColFromGroupDrop(this.colName),this.groupSettings.showDropArea&&"100%"===this.parent.height&&this.parent.scrollModule.refresh();var t=-1<this.groupSettings.columns.indexOf(this.colName)?{columnName:this.colName,requestType:"grouping",type:QA}:{requestType:"ungrouping",type:QA};this.parent.trigger(QA,Pe(e,t)),this.colName=null},XG.prototype.groupAddSortingQuery=function(e){for(var t=0;t<this.parent.sortSettings.columns.length&&this.parent.sortSettings.columns[parseInt(t.toString(),10)].field!==e;)t++;this.parent.sortSettings.columns.length===t?this.parent.sortSettings.columns.push({field:e,direction:"Ascending",isFromGroup:!0}):this.parent.allowSorting||(this.parent.sortSettings.columns[parseInt(t.toString(),10)].direction="Ascending")},XG.prototype.createElement=function(e){var t=this.parent,i="Ascending",n=this.parent.createElement("div",{className:"e-grid-icon e-group-animator"}),o=this.parent.createElement("div",{className:"e-grid-icon e-groupheadercell"}),r=this.parent.createElement("div",{attrs:{"ej-mappingname":e}}),e=(hB(e)&&r.setAttribute("ej-complexname",dB(e)),this.parent.getColumnByField(e)),t=t.getColumnHeaderByUid(e.uid),t=(this.groupSettings.allowReordering&&r.appendChild(this.parent.createElement("span",{className:"e-drag e-icons e-icon-drag",innerHTML:"&nbsp;",attrs:{title:"Drag",tabindex:"-1","aria-label":this.l10n.getConstant("GroupedDrag")}})),r.appendChild(this.parent.createElement("span",{className:"e-grouptext",innerHTML:e.headerText,attrs:{tabindex:"-1"}})),this.groupSettings.showToggleButton&&r.appendChild(this.parent.createElement("span",{className:"e-togglegroupbutton e-icons e-icon-ungroup e-toggleungroup",innerHTML:"&nbsp;",attrs:{tabindex:"-1","aria-label":this.l10n.getConstant("UnGroupAria")}})),t.querySelectorAll(".e-ascending,.e-descending").length&&(i=t.querySelector(".e-ascending")?"Ascending":"Descending"),r.appendChild(this.parent.createElement("span",{className:"e-groupsort e-icons e-"+i.toLowerCase()+" e-icon-"+i.toLowerCase(),innerHTML:"&nbsp;",attrs:{tabindex:"-1","aria-label":this.l10n.getConstant("GroupedSortIcon")+e.headerText,role:"button"}})),this.parent.createElement("span",{className:"e-ungroupbutton e-icons e-icon-hide",innerHTML:"&nbsp;",attrs:{title:this.l10n.getConstant("UnGroup"),tabindex:"-1","aria-label":this.l10n.getConstant("UnGroupIcon")+e.headerText,role:"button"}}));return rt(t,this.groupSettings.showUngroupButton?"":"display: none;"),r.appendChild(t),o.appendChild(r),this.groupSettings.allowReordering&&(n.appendChild(o),n.appendChild(this.createSeparator()),o=n),o},XG.prototype.addColToGroupDrop=function(e){var t=hB(e)?this.parent.element.querySelector(".e-groupdroparea div[ej-complexname="+pB(dB(e))+"]"):this.parent.element.querySelector(".e-groupdroparea div[ej-mappingname="+pB(e)+"]");this.groupSettings.allowReordering&&t||je(this.parent.getColumnByField(e))||(t=this.createElement(e),this.groupSettings.allowReordering&&(e=this.element.getElementsByClassName("e-group-animator").length,t.setAttribute("index",e.toString())),this.element.appendChild(t),(e=this.parent.focusModule).setActive(!0),0===e.active.matrix.matrix[(t=[0,0])[0]][t[1]]&&(t=OF(e.active.matrix.matrix,t,!0)),e.active.matrix.current=t,this.parent.editSettings.showAddNewRow?this.parent.notify(wE,{}):this.parent.isInitialLoad&&!this.preventFocusOnGroup&&e.focus())},XG.prototype.createSeparator=function(){var e=this.parent.createElement("span",{className:"e-nextgroup e-icons e-icon-next",innerHTML:"&nbsp;",attrs:{tabindex:"-1","aria-label":this.l10n.getConstant("GroupSeperator")}});return rt(e,this.groupSettings.showUngroupButton?"":"display: none;"),e},XG.prototype.refreshToggleBtn=function(e){if(this.groupSettings.showToggleButton)for(var t,i=[].slice.call(this.parent.getHeaderTable().getElementsByClassName("e-headercelldiv")),n=0,o=i.length;n<o;n++)i[parseInt(n.toString(),10)].classList.contains("e-emptycell")||i[parseInt(n.toString(),10)].classList.contains("e-headerchkcelldiv")||(t=this.parent.getColumnByUid(i[parseInt(n.toString(),10)].getAttribute("e-mappinguid")),this.parent.showColumnMenu&&(!this.parent.showColumnMenu||t.showColumnMenu))||(i[parseInt(n.toString(),10)].getElementsByClassName("e-grptogglebtn").length&&ue(i[parseInt(n.toString(),10)].querySelectorAll(".e-grptogglebtn")[0]),e)||i[parseInt(n.toString(),10)].appendChild(this.parent.createElement("span",{className:"e-grptogglebtn e-icons "+(-1<this.groupSettings.columns.indexOf(t.field)?"e-toggleungroup e-icon-ungroup":"e-togglegroup e-icon-group"),attrs:{tabindex:"-1","aria-label":(je(this.l10n)?this.parent.localeObj:this.l10n).getConstant("GroupButton")}}))},XG.prototype.removeColFromGroupDrop=function(e){je(this.getGHeaderCell(e))||(e=this.getGHeaderCell(e),this.groupSettings.allowReordering?ue(A(e,"e-group-animator")):ue(e),this.updateGroupDropArea(),this.parent.editSettings.showAddNewRow&&this.parent.notify(wE,{})),this.isAppliedUnGroup=!1},XG.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var t=0,i=Object.keys(e.properties);t<i.length;t++){var n=i[t];switch(n){case"columns":var o=void 0;if(this.contentRefresh){if(this.isAppliedUnGroup)o={columnName:this.colName,requestType:"ungrouping",type:WA};else{if(!this.isAppliedGroup){this.updateGroupDropArea(!0);for(var r=0;r<this.parent.sortSettings.columns.length;r++)this.parent.sortSettings.columns[parseInt(r.toString(),10)].isFromGroup&&(this.parent.sortSettings.columns.splice(r,1),r--);for(var s=0;s<this.groupSettings.columns.length;s++)this.colName=this.groupSettings.columns[parseInt(s.toString(),10)],this.parent.getColumnByField(this.colName).visible=this.parent.groupSettings.showGroupedColumn,this.groupAddSortingQuery(this.colName),s<this.groupSettings.columns.length-1&&this.addColToGroupDrop(this.groupSettings.columns[parseInt(s.toString(),10)])}o={columnName:this.colName,requestType:e.properties[""+n].length?"grouping":"ungrouping",type:WA,preventFocusOnGroup:!1}}if(!this.groupSettings.showGroupedColumn)for(var a=e.oldProperties[""+n],s=0;s<a.length;s++)-1===e.properties[""+n].indexOf(a[parseInt(s.toString(),10)])&&(this.parent.getColumnByField(a[parseInt(s.toString(),10)]).visible=!0);this.parent.notify($1,o)}break;case"showDropArea":this.updateGroupDropArea(),this.groupSettings.showDropArea?(this.element.style.display="",this.parent.headerModule.refreshUI()):this.element.style.display="none","100%"===this.parent.height&&this.parent.scrollModule.refresh();break;case"showGroupedColumn":this.updateGroupedColumn(this.groupSettings.showGroupedColumn),this.parent.notify($1,{requestType:"refresh"});break;case"showUngroupButton":this.updateButtonVisibility(this.groupSettings.showUngroupButton,"e-ungroupbutton");break;case"showToggleButton":this.updateButtonVisibility(this.groupSettings.showToggleButton,"e-togglegroupbutton "),this.parent.refreshHeader();break;case"enableLazyLoading":this.parent.freezeRefresh()}}},XG.prototype.updateGroupedColumn=function(e){for(var t=0;t<this.groupSettings.columns.length;t++)this.parent.getColumnByField(this.groupSettings.columns[parseInt(t.toString(),10)]).visible=e},XG.prototype.updateButtonVisibility=function(e,t){for(var i=[].slice.call(this.element.getElementsByClassName(t)),n=0;n<i.length;n++)i[parseInt(n.toString(),10)].style.display=e?"":"none"},XG.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},XG.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+RE)||e.querySelector("."+OE))&&(!this.parent.isDestroyed&&this.parent.allowGrouping||this.parent.refreshing||this.clearGrouping(),this.unWireEvent(),this.removeEventListener(),this.refreshToggleBtn(!0),this.element.parentNode)&&ue(this.element)},XG.prototype.clearGrouping=function(){var e=JSON.parse(JSON.stringify(this.groupSettings.columns));this.contentRefresh=!1;for(var t=0,i=e.length;t<i;t++)t===i-1&&(this.contentRefresh=!0),this.ungroupColumn(e[parseInt(t.toString(),10)]);this.contentRefresh=!0},XG.prototype.getModuleName=function(){return"group"},XG.prototype.refreshSortIcons=function(){var e,t=this.parent,i=t.sortSettings.columns,n=this.parent.getColumns().map(function(e){return e.field});this.refreshToggleBtn();for(var o=0,r=i.length;o<r;o++)-1!==n.indexOf(i[parseInt(o.toString(),10)].field)&&(e=t.getColumnHeaderByField(i[parseInt(o.toString(),10)].field),!t.allowSorting&&(-1<this.sortedColumns.indexOf(i[parseInt(o.toString(),10)].field)||-1<this.groupSettings.columns.indexOf(i[parseInt(o.toString(),10)].field))?(mt(e.querySelector(".e-sortfilterdiv"),["e-ascending","e-icon-ascending"],[]),1<i.length&&e.querySelector(".e-headercelldiv").appendChild(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(o+1).toString()}))):this.getGHeaderCell(i[parseInt(o.toString(),10)].field)&&this.getGHeaderCell(i[parseInt(o.toString(),10)].field).getElementsByClassName("e-groupsort").length&&("Ascending"===i[parseInt(o.toString(),10)].direction?mt(this.getGHeaderCell(i[parseInt(o.toString(),10)].field).querySelector(".e-groupsort"),["e-ascending","e-icon-ascending"],["e-descending","e-icon-descending"]):mt(this.getGHeaderCell(i[parseInt(o.toString(),10)].field).querySelector(".e-groupsort"),["e-descending","e-icon-descending"],["e-ascending","e-icon-ascending"])))},XG.prototype.getGHeaderCell=function(e){return this.element&&this.element.querySelector('[ej-mappingname="'+e+'"]')?this.element.querySelector('[ej-mappingname="'+e+'"]').parentElement:null},XG.prototype.onGroupAggregates=function(e){if(this.parent.groupSettings.enableLazyLoading)"Batch"!==this.parent.editSettings.mode&&this.updateLazyLoadGroupAggregates(e);else{var e=this.iterateGroupAggregates(e),e=this.groupGenerator.generateRows(e,{}),t=this.parent.getRowsObject().filter(function(e){return!e.isDataRow}),i=e.filter(function(e){return!e.isDataRow});(this.parent.isReact||this.parent.isVue)&&this.parent.destroyTemplate(["groupFooterTemplate","groupCaptionTemplate","footerTemplate"]);for(var n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)],o={cells:o.cells.filter(function(e){return e.isDataCell}),data:o.data,dataUid:t[parseInt(n.toString(),10)]?t[parseInt(n.toString(),10)].uid:""};this.parent.notify(cx,o)}}},XG.prototype.updateLazyLoadGroupAggregates=function(l,e){var h=this,d=this.getGroupAggregateTemplates(!0),p=this.getGroupAggregateTemplates(!1);if(d.length||p.length)for(var c=this.parent,u=c.getDataModule().isRemote(),g=l[0],m=l.row,f=c.groupSettings.columns,y=c.contentModule,v=y.getGroupCache()[c.pageSettings.currentPage],b=e||[],w=this,t=0;t<f.length;t++)if("break"===function(t){var i,e=f[parseInt(t.toString(),10)],n=g[""+e],o=w.getGroupCaptionRowObject(m,f.length-t);if(u&&b.length)0!==t&&(e=f[t-1],i=g[""+e],b=b.find(function(e){return e.key===i}).items),w.updateLazyLoadGroupAggregatesRow(b,n,o,v,d,p);else{var r,s,a,e=c.renderModule.data.generateQuery();if(0!==t&&(r=v.filter(function(e){return e.isCaptionRow&&e.parentUid===o.parentUid}).indexOf(o),s=(a=c.groupSettings.columns.slice(0,t).reverse()).map(function(e){return g[""+e]}),a=LF(FF(a,s,y)),e.lazyLoad.push({key:"onDemandGroupInfo",value:{level:t,skip:r,take:1,where:a}})),c.renderModule.data.getData({},e).then(function(e){u?h.updateLazyLoadGroupAggregates(l,e.result):h.updateLazyLoadGroupAggregatesRow(e.result,n,o,v,d,p),t!==f.length-1&&!u||h.destroyRefreshGroupCaptionFooterTemplate()}).catch(function(e){return c.renderModule.dataManagerFailure(e,{requestType:"grouping"})}),u)return"break"}}(t))break},XG.prototype.destroyRefreshGroupCaptionFooterTemplate=function(){var e=this.parent;(e.isAngular||e.isReact||e.isVue)&&e.destroyTemplate(["groupCaptionTemplate","groupFooterTemplate"]),e.refreshGroupCaptionFooterTemplate(),e.removeMaskRow(),e.hideSpinner()},XG.prototype.updateLazyLoadGroupAggregatesRow=function(e,t,i,n,o,r){e=e.find(function(e){return e.key===t});o.length&&this.updateLazyLoadGroupAggregatesCell(e,i,o),r.length&&(o=n.find(function(e){return e.isAggregateRow&&e.parentUid===i.uid}),this.updateLazyLoadGroupAggregatesCell(e,o,r))},XG.prototype.updateLazyLoadGroupAggregatesCell=function(e,t,i){var n=t.data,o=e.aggregates;t.isCaptionRow&&(n.aggregates=o);for(var r=0;r<i.length;r++){var s=i[parseInt(r.toString(),10)],a=s.field+" - "+s.type,l=n[s.field];l[a]=o[a],l[NF(s.type)]=o[a],l[s.type]&&(l[s.type]=o[a])}},XG.prototype.getGroupCaptionRowObject=function(e,t){for(var i=this.parent,e=e.getAttribute("data-uid"),n=i.getRowObjectFromUID(e),o=0;o<t;o++)n=i.getRowObjectFromUID(n.parentUid);return n},XG.prototype.getGroupAggregateTemplates=function(e){for(var t=[],i=this.parent.aggregates,n=0;n<i.length;n++)for(var o,r=i[parseInt(n.toString(),10)],s=0;s<r.columns.length;s++)(e&&r.columns[parseInt(s.toString(),10)].groupCaptionTemplate||!e&&r.columns[parseInt(s.toString(),10)].groupFooterTemplate)&&(o={},o={type:r.columns[parseInt(s.toString(),10)].type.toString().toLowerCase(),field:r.columns[parseInt(s.toString(),10)].field},t.push(o));return t},XG.prototype.groupedRowReorder=function(e,t){var i=this.parent.getRowElementByUID(e.uid),n=this.parent.getRowElementByUID(t.uid),o={rows:[i],target:n,fromIndex:e.index,dropIndex:t.index};je(e)||je(t)||e.parentUid===t.parentUid||(n?("none"===n.style.display&&(i.style.display="none"),o.dropIndex<o.fromIndex?this.parent.getContentTable().querySelector(oD).insertBefore(i,n):this.parent.getContentTable().querySelector(oD).insertBefore(i,n.nextSibling)):ue(i),this.groupReorderHandler(e,t),n=[].slice.call(this.parent.getContentTable().getElementsByClassName(UE)),iF(this.parent,o,n,t),this.parent.enableVirtualization?tF(this.parent):eF(this.parent,this.parent.getRowsObject().filter(function(e){return e.isDataRow}),n),this.parent.notify(QT,{rows:this.parent.getRowsObject()}))},XG.prototype.groupReorderHandler=function(e,t){for(var i=this.parent,n=e.data,o=t.data,r=i.groupModule.getGroupAggregateTemplates(!1),s=i.getRowObjectFromUID(t.parentUid),a=i.getRowObjectFromUID(e.parentUid),l=[s],h=[a],d=i.groupSettings.columns,p=0;p<d.length;p++)n[d[parseInt(p.toString(),10)]]=o[d[parseInt(p.toString(),10)]],0<p&&(l.push(i.getRowObjectFromUID(l[p-1].parentUid)),h.push(i.getRowObjectFromUID(h[p-1].parentUid)));e.parentUid=t.parentUid,e.visible=t.visible,e.parentGid=t.parentGid,e.changes!==n&&(e.changes=n);var c=(s=this.iterateGroupAggregates([{dragRowObjects:h,dropRowObjects:l}])).filter(function(e){return e.key===h[h.length-1].data.key||e.key instanceof Date&&e.key.toString()===h[h.length-1].data.key.toString()}),u=s.filter(function(e){return e.key===l[l.length-1].data.key||e.key instanceof Date&&e.key.toString()===l[l.length-1].data.key.toString()}),s=[];je(c[0])||s.push(c[0]),je(u[0])||s.push(u[0]);for(var g=i.currentViewData,m=0;m<g.length;m++)je(c[0])&&g[parseInt(m.toString(),10)].key===h[h.length-1].data.key||je(u[0])&&g[parseInt(m.toString(),10)].key===l[l.length-1].data.key?(g.splice(m,1),m--):je(c[0])||g[parseInt(m.toString(),10)].key!==c[0].key?je(u[0])||g[parseInt(m.toString(),10)].key!==u[0].key||(g[parseInt(m.toString(),10)]=u[0]):g[parseInt(m.toString(),10)]=c[0];for(var a=this.groupGenerator.generateRows(s,{}),f=[],y=[],m=0;m<h.length;m++)f.push.apply(f,this.getGroupParentFooterAggregateRowObject(h[parseInt(m.toString(),10)].uid));for(m=0;m<l.length;m++)y.push.apply(y,this.getGroupParentFooterAggregateRowObject(l[parseInt(m.toString(),10)].uid));h.push.apply(h,f),l.push.apply(l,y),this.updatedRowObjChange(h,a,r,!0),this.updatedRowObjChange(l,a,r),this.groupReorderRefreshHandler(h),this.groupReorderRefreshHandler(l)},XG.prototype.updatedRowObjChange=function(e,t,i,n){var o=this.parent,r=o.getRowsObject(),s={},a=[];o.enableVirtualization&&(s=o.contentModule.vgenerator.cache,a=o.vcRows);for(var l=0;l<e.length;l++){for(var h=!1,d=e[parseInt(l.toString(),10)],p=0;p<t.length;p++){var c=t[parseInt(p.toString(),10)];if(je(c)||je(d.data.key)||je(c.data.key)||!(d.data.key===c.data.key||d.data.key instanceof Date&&d.data.key.toString()===c.data.key.toString())){if(d.isAggregateRow&&c.isAggregateRow){for(var u=0;u<i.length;u++)if(this.evaluateGroupAggregateValueChange(d,c,i[parseInt(u.toString(),10)])){-1!==(f=r.indexOf(d))&&(r[parseInt(f.toString(),10)].data=c.data,r[parseInt(f.toString(),10)].gSummary=c.gSummary),o.enableVirtualization&&-1!==(y=a.indexOf(d))&&(a[parseInt(y.toString(),10)].data=c.data,a[parseInt(y.toString(),10)].gSummary=c.gSummary),d.data=c.data,d.gSummary=c.gSummary,h=!0;break}if(h)break}}else{var g,m,f,y,v=!0,b=e[parseInt((l+1).toString(),10)];if((v=n&&b&&!b.isAggregateRow&&(g=b.data.key.toString(),b=b.data.field,m=c.data.items.records||c.data.items)&&m.length&&m[0][""+b]&&m[0][""+b].toString()!==g?!1:v)||!n){-1!==(f=r.indexOf(d))&&(r[parseInt(f.toString(),10)].data=c.data,r[parseInt(f.toString(),10)].gSummary=c.gSummary),o.enableVirtualization&&-1!==(y=a.indexOf(d))&&(a[parseInt(y.toString(),10)].data=c.data,a[parseInt(y.toString(),10)].gSummary=c.gSummary),d.data=c.data,d.gSummary=["gSummary"],t.splice(p,1),p--,h=!0;break}}}if(!h){var w=o.getRowElementByUID(d.uid);if(je(w)||ue(w),r.splice(r.indexOf(d),1),o.enableVirtualization){a.splice(a.indexOf(d),1);for(var C=1;C<=Object.keys(s).length;C++){var S=s[parseInt(C.toString(),10)].indexOf(d);-1!==S&&s[parseInt(C.toString(),10)].splice([parseInt(S.toString(),10)],1)}}o.enableInfiniteScrolling&&o.infiniteScrollSettings.enableCache&&o.infiniteScrollModule.resetInfiniteCache(r)}}},XG.prototype.groupReorderRefreshHandler=function(e){for(var t=this.parent,i=new yD(t.serviceLocator,null,t),n=t.getColumns(),o=0;o<e.length;o++){var r=e[parseInt(o.toString(),10)];je(r.uid)||je(t.getRowElementByUID(r.uid))||i.refresh(r,n,!1)}},XG.prototype.getGroupParentFooterAggregateRowObject=function(e){for(var t=this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&this.parent.groupSettings.columns.length?this.parent.contentModule.rows:this.parent.getRowsObject(),i=[],n=0;n<t.length;n++){var o=t[parseInt(n.toString(),10)];o.parentUid===e&&o.isAggregateRow&&i.push(o)}return i},XG.prototype.evaluateGroupAggregateValueChange=function(e,t,i){var n=!1;return n=e.data[i.field].field===t.data[i.field].field&&e.data[i.field].key===t.data[i.field].key&&e.data[i.field].hasOwnProperty(i.field+" - "+i.type)&&t.data[i.field].hasOwnProperty(i.field+" - "+i.type)?!0:n},XG.prototype.gettingVirtualData=function(n,o,r){for(var s=[],e=function(e){if(-1===o.indexOf(n[parseInt(e.toString(),10)].data)&&s.push(n[parseInt(e.toString(),10)].data),n[parseInt(e.toString(),10)].data.field===a.parent.groupSettings.columns[0])for(var i=n[parseInt(e.toString(),10)].data.items,t=(je(i.records)||(i=i.records),0);t<i.length;t++)!function(t){r&&-1===o.findIndex(function(e){return e[r.toString()]===i[parseInt(t.toString(),10)][r.toString()]})&&s.push(i[parseInt(t.toString(),10)])}(t)},a=this,t=0;t<n.length;t++)e(t);return s},XG.prototype.iterateGroupAggregates=function(e){var i=this,t=e instanceof Array?e:[],n=this.parent.getRowsObject(),o=this.parent.getCurrentViewRecords().slice(),r=this.parent.getPrimaryKeyFieldNames()[0],s=e&&e.length?e[0]&&e[0].dragRowObjects:null,a=e&&e.length?e[0]&&e[0].dropRowObjects:null,l=null,h=null,d=(!(this.parent.enableVirtualization&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length)||je(s)&&je(a)||(s&&o.push.apply(o,this.gettingVirtualData(s,o,r)),a&&o.push.apply(o,this.gettingVirtualData(a,o,r))),this.parent.enableInfiniteScrolling&&this.parent.allowGrouping&&e.length&&this.parent.groupSettings.columns.length&&!je(s)&&!je(a)),p=(d&&(o=[],l=a[a.length-1].data.key,h=s[s.length-1].data.key,this.parent.getRowsObject().map(function(e){var t=e.data[i.parent.groupSettings.columns[0]];e.isDataRow&&(t===l||t===h||t instanceof Date&&(t.toString()===l.toString()||t.toString()===h.toString()))&&o.push(e.data)})),[]),c=n.map(function(e){return"delete"===e.edit&&p.push(e.data),e.changes instanceof Object?e.changes:e.data}),c=0===t.length?c:t,u=o.map(function(e){var t,i=Sa.getObject(r,e);return c.some(function(e){return t=e,i===Sa.getObject(r,e)})?t:e});if((!e.type||"cancel"!==e.type)&&0<p.length)for(var g=0;g<p.length;g++){var m=u.indexOf(p[parseInt(g.toString(),10)]);u.splice(m,1)}for(var f,y=[],v=this.parent.aggregates,b=0;b<v.length;b++)for(var w=v[parseInt(b.toString(),10)],C=0;C<w.columns.length;C++)for(var S=0,A=w.columns[parseInt(C.toString(),10)].type.toString().split(",").map(function(e){return e.trim()});S<A.length;S++){var x={type:A[S].toLowerCase(),field:w.columns[parseInt(C.toString(),10)].field};y.push(x)}for(var I=this.parent.groupSettings.columns,T=0;T<I.length;T++)f=Sa.group(f||u,I[parseInt(T.toString(),10)],y,null,null);if(d){a=this.parent.currentViewData[this.parent.currentViewData.length-1].key;if(a instanceof Date&&(a.toString()===l.toString()||a.toString()===h.toString())||a===l||a===h){for(var E=[],g=0;g<f.length;g++)E.push(f[parseInt(g.toString(),10)]);for(var D=[],s=this.parent.getDataModule().generateQuery(!0),n=s,M=0;M<E.length;M++)D.push(new ba("field","==",E[parseInt(M.toString(),10)].field).and(i.parent.renderModule.getPredicate("key","equal",E[parseInt(M.toString(),10)].key)));n.where(ba.or(D));t=this.parent.getDataModule().dataManager.executeLocal(s);this.parent.renderModule.updateGroupInfo(f,t)}}return f},XG.prototype.updateExpand=function(e){for(var i=e.uid,t=e.isExpand,n=this.parent.getRowsObject(),o=0;o<n.length;o++){var r=n[parseInt(o.toString(),10)];if(r.uid===i||je(i)){r.isExpand=t;for(var s=o+1;s<n.length;s++)if("break"===function(e){var t=n[parseInt(e.toString(),10)],e=void 0;if(t.parentUid!==r.uid&&(e=n.filter(function(e){return e.uid===t.parentUid})[0]),t.parentUid===r.uid?t.visible=r.isExpand:je(e)||t.parentUid!==e.uid||(e.isExpand&&!0===e.visible?t.visible=!0:e.isExpand&&!1===e.visible&&(t.visible=!1)),je(i))return"break"}(s))break}}this.parent.notify(X1,{rows:n,args:{isFrozen:!1,rows:n}})};var YG=XG;function XG(e,t,i,n){var s=this;this.sortRequired=!0,this.groupSortFocus=!1,this.groupTextFocus=!1,this.groupCancelFocus=!1,this.preventFocusOnGroup=!1,this.isAppliedGroup=!1,this.isAppliedUnGroup=!1,this.isAppliedCaptionRowBorder=!1,this.reorderingColumns=[],this.visualElement=Q("div",{className:"e-cloneproperties e-dragclone e-gdclone",attrs:{action:"grouping"}}),this.helper=function(e){var t=s.parent,e=e.sender.target,i=e.classList.contains("e-groupheadercell")?e:A(e,"e-groupheadercell");return!(!i||!e.classList.contains("e-drag")&&s.groupSettings.allowReordering)&&(s.column=t.getColumnByField(i.firstElementChild.getAttribute("ej-mappingname")),s.visualElement.textContent=i.textContent,rt(s.visualElement,"width: "+(i.offsetWidth+2)+"px;\n            height: "+(i.offsetHeight+2)+"px; line-height: 23px;"),s.visualElement.setAttribute("e-mappinguid",s.column.uid),t.element.appendChild(s.visualElement),s.visualElement)},this.dragStart=function(e){s.parent.element.classList.add("e-ungroupdrag")},this.drag=function(e){s.groupSettings.allowReordering&&s.animateDropper(e);var e=e.target,t=s.parent.element.querySelector(".e-cloneproperties");s.parent.trigger(s1,{target:e,draggableType:"headercell",column:s.column}),s.groupSettings.allowReordering||(mt(t,["e-defaultcur"],["e-notallowedcur"]),A(e,OE))||A(e,"e-headercell")||mt(t,["e-notallowedcur"],["e-defaultcur"])},this.dragStop=function(e){s.parent.element.classList.remove("e-ungroupdrag");var t,i=!(A(e.target,OE)||A(e.target,"e-gridheader"));s.groupSettings.allowReordering&&i?(ue(e.helper),A(e.target,"e-groupdroparea")?s.rearrangeGroup():A(e.target,"e-grid")||(t=s.parent.getColumnByUid(e.helper.getAttribute("e-mappinguid")).field,-1!==s.groupSettings.columns.indexOf(t)&&s.ungroupColumn(t))):i&&ue(e.helper)},this.animateDropper=function(e){var t=s.parent.element.querySelector(".e-cloneproperties").getAttribute("e-mappinguid"),t=s.parent.getColumnByUid(t).field,i=A(e.target,"e-groupdroparea"),e=A(e.target,"e-group-animator"),n=[].slice.call(s.element.getElementsByClassName("e-groupheadercell")).map(function(e){return e.querySelector("div").getAttribute("ej-mappingname")}),o=JSON.parse(JSON.stringify(n));if(e||i){e?(n=e.querySelector("div[ej-mappingname]").getAttribute("ej-mappingname"),e=+e.getAttribute("index"),n!==t&&(-1!==(n=o.indexOf(t))&&o.splice(n,1),o.splice(e+(-1!=e&&n===e?1:0),0,t))):i&&-1===o.indexOf(t)&&o.push(t),s.element.innerHTML="",o.length&&!s.element.classList.contains("e-grouped")&&s.element.classList.add("e-grouped"),s.reorderingColumns=o;for(var r=0;r<o.length;r++)s.addColToGroupDrop(o[parseInt(r.toString(),10)])}else s.addLabel(),s.removeColFromGroupDrop(t)},this.drop=function(e){var t=s.parent,i=t.getColumnByUid(e.droppedElement.getAttribute("e-mappinguid"));s.element.classList.remove("e-hover"),ue(e.droppedElement),s.aria.setDropTarget(s.parent.element.querySelector(".e-groupdroparea"),!1),s.aria.setGrabbed(s.parent.getHeaderTable().querySelector("[aria-grabbed=true]"),!1),je(i)||!1===i.allowGrouping||A(t.getColumnHeaderByUid(i.uid),"e-grid").getAttribute("id")!==t.element.getAttribute("id")?s.parent.log("action_disabled_column",{moduleName:s.getModuleName(),columnName:i?i.headerText:void 0}):s.groupColumn(i.field)},this.contentRefresh=!0,this.aria=new HD,this.parent=e,this.groupSettings=t,this.serviceLocator=n,this.sortedColumns=i,this.focus=n.getService("focus"),this.addEventListener(),this.groupGenerator=new BD(this.parent)}JG.prototype.addEventListener=function(){this.parent.isDestroyed||(E.add(this.parent.element,"auxclick",this.auxilaryclickHandler,this),this.parent.on(wx,this.clickHandler,this),this.parent.on(Cx,this.destroy,this),this.parent.on(bx,this.keyPressHandler,this),this.parent.on(TI,this.expand,this),this.parent.on(Sx,this.refreshColSpan,this),this.parent.on(Cx,this.destroyChildGrids,this),this.parent.on(rE,this.destroyChildGrids,this),this.parent.on(Cx,this.detachDetailTemplate,this),this.parent.on(IE,this.detachDetailTemplate,this))},JG.prototype.clickHandler=function(e){!e.target.classList.contains("e-icon-grightarrow")&&!e.target.classList.contains("e-icon-gdownarrow")||this.parent.allowGrouping||e.preventDefault(),this.toogleExpandcollapse(z(e.target,"td"))},JG.prototype.auxilaryclickHandler=function(e){!e.target.classList.contains("e-icon-grightarrow")&&!e.target.classList.contains("e-icon-gdownarrow")||this.parent.allowGrouping||1!==e.button||e.preventDefault()},JG.prototype.toogleExpandcollapse=function(e){this.l10n=this.serviceLocator.getService("localization");var t,i=this.parent,n=this.parent.getContentTable(),o=this.parent.getCurrentViewRecords().length-1,r=e&&e.classList.contains("e-detailrowcollapse");if(!(!e||!e.classList.contains("e-detailrowcollapse")&&!e.classList.contains("e-detailrowexpand")||e&&e.classList.contains("e-masked-cell"))){var s=e.parentElement,a=s.getAttribute("data-uid"),l=i.getRowObjectFromUID(a),a=!1,h=this.parent.getContentTable().querySelector(oD).children[s.rowIndex+1];if(e.classList.contains("e-detailrowcollapse")){var d=l.data;if(this.isDetailRow(h))h.style.display="",i.notify(GI,{data:d,childGrid:i.childGrid,detailElement:e,isExpanded:r}),a=!0;else if(i.getDetailTemplate()||i.childGrid){var p=$P("grid-row"),c=this.parent.createElement("tr",{className:"e-detailrow",attrs:{"data-uid":p,role:"row"}}),u=this.parent.createElement("th",{className:"e-detailcell",attrs:{scope:"col",role:"columnheader"}}),g=this.parent.getVisibleColumns().length,m=(this.parent.allowRowDragAndDrop&&g++,u.setAttribute("colspan",g.toString()),new DE({isDataRow:!0,isExpand:!0,uid:p,isDetailRow:!0,cells:[new kE({cellType:LA.Indent}),new kE({isDataCell:!0,visible:!0})]}));m.parentUid=l.uid;for(var f=0,y=i.groupSettings.columns.length;f<y;f++)c.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),m.cells.unshift(new kE({cellType:LA.Indent}));c.appendChild(this.parent.createElement("th",{className:"e-detailindentcell",attrs:{scope:"col"}})),c.appendChild(u),s.parentNode.insertBefore(c,s.nextSibling);var g=void 0,p=void 0,v=(i.detailTemplate?(g=this.parent.isReact&&"string"!=typeof i.detailTemplate&&!(i.detailTemplate.prototype&&i.detailTemplate.prototype.CSPTemplate),p=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,b=this.parent.printGridParent&&this.parent.printGridParent.isReact,v=i.element.id+"detailTemplate",g||p||b?(i.getDetailTemplate()(d,i,"detailTemplate",v,null,null,u),this.parent.renderTemplates(function(){i.trigger(g1,{detailElement:u,data:d,childGrid:t})})):eB(u,i.getDetailTemplate()(d,i,"detailTemplate",v,void 0,void 0,void 0,this.parent.root))):((t=new IP(this.getGridModel(i,l,i.printMode))).height=i.enableInfiniteScrolling&&"auto"===t.height?300:t.height,t.root=i.root||i,this.childRefs.push(t),t.query&&(t.query=t.query.clone()),t.parentDetails={parentID:i.element.id,parentPrimaryKeys:i.getPrimaryKeyFieldNames(),parentKeyField:i.childGrid.queryString,parentKeyFieldValue:i.childGrid.queryString&&hB(i.childGrid.queryString)?FB(i.childGrid.queryString,d):d[i.childGrid.queryString],parentRowData:d},i.isReact||i.isVue?t.parentDetails.parentInstObj=i:i.parentDetails&&i.parentDetails.parentInstObj&&(i.parentDetails.parentInstObj.isReact||i.parentDetails.parentInstObj.isVue)&&(t.parentDetails.parentInstObj=i.parentDetails.parentInstObj),i.printGridParent&&i.printGridParent.isReact&&(t.printGridParent=i.printGridParent),t.isLegacyTemplate=i.isReact||i.isLegacyTemplate,i.isPrinting&&(t.isPrinting=!0,t.on(X1,this.promiseResolve(t),this),t.on(J1,this.promiseResolve(t),this)),b=(l.childGrid=t).getInjectedModules(),v=i.getInjectedModules(),b&&b.length===v.length||t.setInjectedModules(v),b=this.parent.createElement("div",{id:"child"+tB(s,"e-grid").length+"_grid"+s.rowIndex+$P(""),className:"e-childgrid"}),u.appendChild(b),t.appendTo(b)),c.appendChild(u),s.nextSibling?s.parentNode.insertBefore(c,s.nextSibling):s.parentNode.appendChild(c),i.getRows()),b=i.getRowsObject();if(v.splice(v.indexOf(s)+1,0,c),i.enableInfiniteScrolling&&i.infiniteScrollSettings.enableCache)for(var w=i.contentModule.infiniteCache,C=Object.keys(w),f=0;f<C.length;f++){var S=w[parseInt(C[parseInt(f.toString(),10)],10)].indexOf(l);if(-1!==S){w[parseInt(C[parseInt(f.toString(),10)],10)].splice(S+1,0,m);break}}else b.splice(b.indexOf(l)+1,0,m);g&&p||i.trigger(g1,{detailElement:u,data:d,childGrid:t}),i.notify(g1,{rows:b})}mt(e,["e-detailrowexpand"],["e-detailrowcollapse"]),mt(e.firstElementChild,["e-dtdiagonaldown","e-icon-gdownarrow"],["e-dtdiagonalright","e-icon-grightarrow"]),l.isExpand=!0,e.classList.contains("e-lastrowcell")&&this.parent.getContent().clientHeight>n.scrollHeight&&(q(e.parentElement.querySelectorAll("td"),"e-lastrowcell"),v=n.querySelector(oD).getElementsByClassName("e-detailrow").length-1,U(n.querySelector(oD).getElementsByClassName("e-detailrow")[parseInt(v.toString(),10)].childNodes,["e-lastrowcell"]),this.lastrowcell=!0),this.aria.setExpand(e,!0),e.firstElementChild.setAttribute("title",this.l10n.getConstant("Expanded"))}else this.isDetailRow(h)&&(h.style.display="none",i.notify(GI,{data:l.data,childGrid:i.childGrid,detailElement:e,isExpanded:r})),mt(e,["e-detailrowcollapse"],["e-detailrowexpand"]),mt(e.firstElementChild,["e-dtdiagonalright","e-icon-grightarrow"],["e-dtdiagonaldown","e-icon-gdownarrow"]),parseInt(s.getAttribute(nD),10)-1==o&&this.lastrowcell&&(U(e.parentElement.querySelectorAll("td"),"e-lastrowcell"),this.lastrowcell=!1),l.isExpand=!1,this.aria.setExpand(e,!(a=!0)),e.firstElementChild.setAttribute("title",this.l10n.getConstant("Collapsed"));(!je(i.detailTemplate)||i.childGrid&&a)&&(i.updateVisibleExpandCollapseRows(),i.notify(QT,{rows:i.getRowsObject()})),this.parent.allowTextWrap&&"auto"===this.parent.height&&(this.parent.getContentTable().scrollHeight>this.parent.getContent().clientHeight?this.parent.scrollModule.setPadding():this.parent.scrollModule.removePadding())}},JG.prototype.getGridModel=function(e,t,i){t=e.isPrinting&&t.isExpand&&e.expandedRows&&e.expandedRows[t.index]&&e.expandedRows[t.index].gridModel?(e.expandedRows[t.index].gridModel.hierarchyPrintMode=e.childGrid.hierarchyPrintMode,Pe({},e.expandedRows[t.index].gridModel,e.childGrid,!0)):(e.isPrinting&&e.childGrid.allowPaging&&(e.childGrid.allowPaging="CurrentPage"===i),Pe({},{},e.childGrid,!0));return t},JG.prototype.promiseResolve=function(e){var t=this;return function(){e.off(X1,t.promiseResolve),e.off(J1,t.promiseResolve),e.notify(II,{})}},JG.prototype.isDetailRow=function(e){return e&&e.classList.contains("e-detailrow")},JG.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+RE)||e.querySelector("."+OE))&&(E.remove(this.parent.element,"auxclick",this.auxilaryclickHandler),this.parent.off(wx,this.clickHandler),this.parent.off(Cx,this.destroy),this.parent.off(bx,this.keyPressHandler),this.parent.off(TI,this.expand),this.parent.off(Sx,this.refreshColSpan),this.parent.off(Cx,this.destroyChildGrids),this.parent.off(rE,this.destroyChildGrids),this.parent.off(Cx,this.detachDetailTemplate),this.parent.off(IE,this.detachDetailTemplate))},JG.prototype.getTDfromIndex=function(e,t){e=je(e)?void 0:this.parent.getDataRows()[parseInt(e.toString(),10)];return e&&e.querySelector(t)?e.querySelector(t):null},JG.prototype.expand=function(e){(e=isNaN(e)?e:this.getTDfromIndex(e,".e-detailrowcollapse"))&&e.classList.contains("e-detailrowcollapse")&&this.toogleExpandcollapse(e)},JG.prototype.collapse=function(e){(e=isNaN(e)?e:this.getTDfromIndex(e,".e-detailrowexpand"))&&e.classList.contains("e-detailrowexpand")&&this.toogleExpandcollapse(e)},JG.prototype.expandAll=function(){this.expandCollapse(!0),this.parent.trigger(QA,{requestType:"expandAllComplete",type:QA,moduleObj:this})},JG.prototype.collapseAll=function(){this.expandCollapse(!1),this.parent.trigger(QA,{requestType:"collapseAllComplete",type:QA,moduleObj:this})},JG.prototype.expandCollapse=function(e){for(var t,i=this.parent.getDataRows(),n=0,o=i.length;n<o;n++)t=i[parseInt(n.toString(),10)].querySelector(".e-detailrowcollapse, .e-detailrowexpand"),e?this.expand(t):this.collapse(t)},JG.prototype.keyPressHandler=function(e){var t=this.parent;switch(/(Mac)/i.test(navigator.platform)&&e.metaKey&&("downArrow"===e.action?e.action="ctrlDownArrow":"upArrow"===e.action&&(e.action="ctrlUpArrow")),e.action){case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"altUpArrow":case"altDownArrow":var i=t.allowSelection?t.getSelectedRowIndexes():[];i.length&&(i=t.getDataRows()[i[i.length-1]].querySelector(".e-detailrowcollapse, .e-detailrowexpand"),"altDownArrow"===e.action?this.expand(i):this.collapse(i));break;case"enter":!this.parent.isEdit&&(!(i=(i=this.focus.getFocusedElement())&&(i.classList.contains("e-icon-grightarrow")||i.classList.contains("e-icon-gdownarrow"))?i.parentElement:i)||i.classList.contains("e-detailrowcollapse")||i.classList.contains("e-detailrowexpand"))&&this.toogleExpandcollapse(i)}},JG.prototype.refreshColSpan=function(){for(var e=this.parent.contentModule.getTable().querySelectorAll("tr.e-detailrow"),t=this.parent.getVisibleColumns().length,i=0;i<e.length;i++)e[parseInt(i.toString(),10)].querySelector(".e-detailcell").setAttribute("colspan",t+"")},JG.prototype.destroyChildGrids=function(e){var o=this.parent;if(o.enableInfiniteScrolling&&(o.childGrid||o.detailTemplate)&&"infiniteScroll"===e.requestType&&o.infiniteScrollSettings.enableCache){var e="down"===e.direction?e.currentPage-o.infiniteScrollSettings.initialBlocks:e.currentPage+o.infiniteScrollSettings.initialBlocks,r=o.contentModule.infiniteCache[parseInt(e.toString(),10)],s=r.filter(function(e){return e.isDetailRow&&e.parentUid});if(o.childGrid)for(var a=this,t=0;t<s.length;t++)!function(e){var t=o.getContentTable().querySelector('[data-uid="'+s[parseInt(e.toString(),10)].uid+'"]'),i=t.querySelector(".e-childgrid"),n=a.childRefs.findIndex(function(e){return e.element.id===i.id}),n=(a.childRefs[parseInt(n.toString(),10)].isDestroyed||(a.childRefs[parseInt(n.toString(),10)].destroy(),a.childRefs.splice(n,1)),r.indexOf(s[parseInt(e.toString(),10)]));r.splice(n,1),r[n-1].childGrid=null,r[n-1].isExpand=!1,t.remove()}(t);if(o.detailTemplate&&s.length){for(var i=[],t=0;t<s.length;t++)!function(t){i.push({detailRow:o.getContentTable().querySelector('[data-uid="'+s[parseInt(t.toString(),10)].uid+'"]'),detailRowObject:s[parseInt(t.toString(),10)],parentRowObject:r.find(function(e){return s[parseInt(t.toString(),10)].parentUid===e.uid})})}(t);this.parent.trigger(xE,i,function(){for(var e=0;e<s.length;e++){var t=o.getContentTable().querySelector('[data-uid="'+s[parseInt(e.toString(),10)].uid+'"]'),i=r.indexOf(s[parseInt(e.toString(),10)]);r.splice(i,1),r[i-1].isExpand=!1,t.remove()}})}}else{for(var n=this.parent.getRowsObject(),t=0;t<n.length;t++)n[parseInt(t.toString(),10)].childGrid=null;for(t=0;t<this.childRefs.length;t++)this.childRefs[parseInt(t.toString(),10)].isDestroyed||this.childRefs[parseInt(t.toString(),10)].destroy();this.childRefs=[]}},JG.prototype.detachDetailTemplate=function(){var e,t,i,n=this.parent;n.detailTemplate&&(e=n.getRowsObject(),(t=e.filter(function(e){return e.isDetailRow&&e.parentUid})).length)&&(i=[],t.map(function(t){i.push({detailRow:n.getContentTable().querySelector('[data-uid="'+t.uid+'"]'),detailRowObject:t,parentRowObject:e.find(function(e){return t.parentUid===e.uid})})}),n.trigger(xE,i,function(){t.map(function(e){n.getContentTable().querySelector('[data-uid="'+e.uid+'"]').remove()})}))},JG.prototype.getModuleName=function(){return"detailRow"};var KG=JG;function JG(e,t){this.aria=new HD,this.childRefs=[],this.parent=e,this.serviceLocator=t,this.focus=t.getService("focus"),this.addEventListener()}$G.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization");for(var e=this.parent.enableAdaptiveUI,t=["Edit","Delete","Update","Cancel"],i=0,n=["Add","Edit","Update","Delete","Cancel","Print","PdfExport","ExcelExport","WordExport","CsvExport"];i<n.length;i++){var o=n[i],r=o.toLowerCase(),s=r[0].toUpperCase()+r.slice(1);this.predefinedItems[""+o]={id:this.gridID+"_"+r,prefixIcon:"e-"+r,text:this.l10n.getConstant(s),tooltipText:this.l10n.getConstant(s)},e&&(this.predefinedItems[""+o].text="",this.predefinedItems[""+o].visible=-1===t.indexOf(o))}this.predefinedItems.Search={id:this.gridID+"_search",tooltipText:this.l10n.getConstant("Search"),align:"Right",cssClass:"e-search-wrapper",type:"Input"},this.isRightToolbarMenu=!1,this.parent.enableAdaptiveUI&&this.isResponsiveToolbarMenuItems(!0)&&("Horizontal"===this.parent.rowRenderingMode||"Vertical"===this.parent.rowRenderingMode&&!this.parent.allowFiltering&&!this.parent.allowSorting)&&(this.isRightToolbarMenu=!0),e&&this.isResponsiveToolbarMenuItems(!1)?this.predefinedItems.responsiveToolbarItems={id:this.gridID+"_responsivetoolbaritems",cssClass:"e-responsive-toolbar-items e-menu-toolbar",suffixIcon:"e-responsivetoolbaritems-btn",align:this.isRightToolbarMenu?"Left":"Right"}:this.predefinedItems.ColumnChooser={id:this.gridID+"_columnchooser",cssClass:"e-cc e-ccdiv e-cc-toolbar",suffixIcon:"e-columnchooser-btn",text:e?"":this.l10n.getConstant("Columnchooser"),tooltipText:this.l10n.getConstant("Columnchooser"),align:"Right"},"Vertical"===this.parent.rowRenderingMode&&(this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&(this.predefinedItems.responsiveFilter={id:this.gridID+"_responsivefilter",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-resfilter-icon",tooltipText:this.l10n.getConstant("FilterIcon")}),this.parent.allowSorting)&&(this.predefinedItems.responsiveSort={id:this.gridID+"_responsivesort",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-ressort-icon",tooltipText:this.l10n.getConstant("SortIcon")}),this.parent.enableAdaptiveUI&&this.parent.toolbar&&this.parent.toolbar.some(function(e){return"object"==typeof e&&"Search"===e.text||"Search"===e})&&(this.predefinedItems.responsiveBack={id:this.gridID+"_responsiveback",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-resback-icon",visible:!1}),this.createToolbar(),this.parent.enableAdaptiveUI&&(je(this.responsiveToolbarMenu)&&this.renderResponsiveToolbarpopup(),this.toolbar.element)&&this.toolbar.refreshOverflow()},$G.prototype.isResponsiveToolbarMenuItems=function(e){for(var t=e?["Add","Edit","Delete","Search"]:["Print","ColumnChooser","PdfExport","ExcelExport","CsvExport"],i=this.parent.toolbar||[],n=0;n<t.length;n++)if(0<=i.indexOf(t[parseInt(n.toString(),10)]))return!e;return!!e},$G.prototype.getToolbar=function(){return this.toolbar.element},$G.prototype.destroy=function(){this.toolbar&&!this.toolbar.isDestroyed&&(this.responsiveToolbarMenu&&this.responsiveToolbarMenu.destroy(),this.toolbar.off("render-react-toolbar-template",this.addReactToolbarPortals),this.unWireEvent(),this.removeEventListener(),this.toolbar.created=null,this.toolbar.clicked=null,this.toolbar.element?this.toolbar.destroy():(this.parent.destroyTemplate(["toolbarTemplate"]),this.parent.isReact&&this.parent.renderTemplates()),this.parent.isAngular&&(this.toolbar.viewContainerRef=null,this.toolbar.registeredTemplate=null),this.element.parentNode)&&(ue(this.element),this.toolbar=null)},$G.prototype.bindSearchEvents=function(){this.searchElement=ge("#"+this.gridID+"_searchbar",this.element),this.wireEvent(),this.refreshToolbarItems(),this.parent.searchSettings&&this.updateSearchBox()},$G.prototype.toolbarCreated=function(e){this.element.querySelector(".e-search-wrapper")&&(!this.parent.enableAdaptiveUI||e?(e=this.parent.cssClass?"e-input-group e-search "+this.parent.cssClass:"e-input-group e-search",this.element.querySelector(".e-search-wrapper").innerHTML='<div class="'+e+'" role="search">                    <input id="'+this.gridID+'_searchbar" class="e-input e-search" name="input" type="search"                     placeholder= "'+this.l10n.getConstant("Search")+'"/>                    <span id="'+this.gridID+'_clearbutton" class="e-input-group-icon e-icons e-sicon"                     tabindex="-1" aria-label= "clear" role= "button" ></span>                    <span id="'+this.gridID+'_searchbutton" class="e-input-group-icon e-search-icon e-icons"                     tabindex="-1" title="'+this.l10n.getConstant("Search")+'" role= "search"></span>                     </div>'):this.element.querySelector(".e-search-wrapper").innerHTML='<span id="'+this.gridID+'_clearbutton" class="e-input-group-icon e-icons e-sicon"                     tabindex="-1" role= "button" aria-label= "clear" ></span>                    <span id="'+this.gridID+'_searchbutton" class="e-input-group-icon e-search-icon e-icons"                     tabindex="-1" role= "button" title="'+this.l10n.getConstant("Search")+'"></span>                     </div>',this.element.querySelector("#"+this.gridID+"_clearbutton").style.cursor="default"),this.element.querySelector(".e-responsive-toolbar-items")&&(this.element.querySelector(".e-responsive-toolbar-items").innerHTML='<button id="'+this.gridID+'_responsivetoolbaritems" class="e-tbar-btn e-control e-btn e-lib e-icon-btn"                     type="button" data-ripple="true" tabindex="-1" data-tabindex="-1" aria-label="responsivetoolbaritems"                      aria-disabled="false" ><span class="e-btn-icon e-responsivetoolbaritems-btn e-icons"></span>',this.element.querySelector("#"+this.gridID+"_responsivetoolbaritems").style.width="auto"),this.bindSearchEvents()},$G.prototype.createToolbar=function(){var e=this.getItems(),e=(this.toolbar=new U3({items:e,clicked:this.toolbarClickHandler.bind(this),enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,created:this.toolbarCreated.bind(this),cssClass:this.parent.cssClass||""}),this.toolbar.isReact=this.parent.isReact,this.toolbar.on("render-react-toolbar-template",this.addReactToolbarPortals,this),this.toolbar.isStringTemplate=!0,"viewContainerRef"),e=(this.parent[e]&&(this.toolbar.registeredTemplate={},this.toolbar[e]=this.parent[e]),this.element=this.parent.createElement("div",{id:this.gridID+"_toolbarItems"}),this.parent.enableAdaptiveUI&&this.element.classList.add("e-res-toolbar"),this.parent.toolbarTemplate?(e=this.parent.isVue||this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isVue,"string"!=typeof this.parent.toolbarTemplate||e&&!document.querySelectorAll(this.parent.toolbarTemplate).length||!document.querySelector(this.parent.toolbarTemplate)||"script"===document.querySelector(this.parent.toolbarTemplate).tagName.toLowerCase()?(e=this.parent.isReact&&"string"!=typeof this.parent.toolbarTemplate&&!(this.parent.toolbarTemplate.prototype&&this.parent.toolbarTemplate.prototype.CSPTemplate),t=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,i=this.parent.element.id+"toolbarTemplate",e||t?(HP(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",i,null,null,this.element),this.parent.renderTemplates()):eB(this.element,HP(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",null,null,null,null,this.parent.root))):(this.toolbar.appendTo(this.parent.toolbarTemplate),this.element=this.toolbar.element),this.element.classList.add("e-temp-toolbar")):this.toolbar.appendTo(this.element),this.parent.element.insertBefore(this.element,this.parent.getHeaderContent()),this.element.querySelector(".e-toolbar-left")),t=this.element.querySelector(".e-toolbar-center"),i=this.element.querySelector(".e-toolbar-right"),n=this.element.querySelector(".e-toolbar-items"),o=this.element,e=e?e.clientWidth:0,t=t?t.clientWidth:0,i=i?i.clientWidth:0,n=n?n.clientWidth:0,o=o?o.clientWidth:0;(o<e||o<t||o<i||o<n)&&this.toolbar.refreshOverflow()},$G.prototype.addReactToolbarPortals=function(e){this.parent.isReact&&e&&(this.parent.portals=this.parent.portals.concat(e),this.parent.renderTemplates())},$G.prototype.renderResponsiveSearch=function(e){e?(this.toolbarCreated(!0),this.refreshResponsiveToolbarItems(VA.isSearch),this.searchElement=ge("#"+this.gridID+"_searchbar",this.element),(e=A(this.searchElement,"e-toolbar-right"))&&e.classList.add("e-responsive-right"),this.parent.searchSettings&&this.updateSearchBox(),this.searchBoxObj.searchFocus({target:this.searchElement}),this.searchElement.focus()):this.refreshResponsiveToolbarItems(VA.isInitial)},$G.prototype.refreshResponsiveToolbarItems=function(e){if(e===VA.isInitial){for(var t=this.parent.element.id,i=[t+"_edit",t+"_delete"],n=this.parent.getSelectedRowIndexes(),o=[t+"_responsiveback",t+"_update",t+"_cancel"],r=0,s=this.toolbar.items;r<s.length;r++)(h=(d=s[r]).template&&d.template.length?A(this.toolbar.element.querySelector("#"+d.id),"e-template").children[0]:this.toolbar.element.querySelector("#"+d.id))&&(-1<i.indexOf(d.id)?n.length?h.parentElement.classList.remove("e-hidden"):h.parentElement.classList.add("e-hidden"):-1===o.indexOf(d.id)||0<o.indexOf(d.id)&&this.parent.isEdit?h.parentElement.classList.remove("e-hidden"):h.parentElement.classList.add("e-hidden"));this.searchElement&&((t=A(this.searchElement,"e-toolbar-right"))&&t.classList.remove("e-responsive-right"),this.toolbarCreated(!1),this.unWireEvent(),this.searchElement=void 0)}if(e===VA.isSearch)for(var i=[this.parent.element.id+"_responsiveback",this.parent.element.id+"_search"],a=0,l=this.toolbar.items;a<l.length;a++){var h,d=l[a];(h=this.toolbar.element.querySelector("#"+d.id))&&(-1<i.indexOf(d.id)?h.parentElement.classList.remove("e-hidden"):h.parentElement.classList.add("e-hidden"))}},$G.prototype.refreshToolbarItems=function(e){var t=this.parent,i=[],n=[],o=t.editSettings,r=t.currentViewData&&t.currentViewData.length||"Batch"===t.editSettings.mode&&!je(t.editModule)&&t.editModule.getBatchChanges()[JE].length,s=o.showAddNewRow&&!t.element.querySelector(".e-editedrow");(o.allowAdding?i:n).push(this.gridID+"_add"),(o.allowEditing&&r?i:n).push(this.gridID+"_edit"),(o.allowDeleting&&r?i:n).push(this.gridID+"_delete"),(t.allowPdfExport&&r?i:n).push(this.gridID+"_pdfexport"),(t.allowExcelExport&&r?(i.push(this.gridID+"_excelexport"),i):(n.push(this.gridID+"_excelexport"),n)).push(this.gridID+"_csvexport"),(t.showColumnChooser?i:n).push(this.gridID+"_columnchooser"),"Batch"===t.editSettings.mode?(t.element.getElementsByClassName("e-updatedtd").length&&(o.allowAdding||o.allowEditing)?(i.push(this.gridID+"_update"),i):(n.push(this.gridID+"_update"),n)).push(this.gridID+"_cancel"):(t.isEdit||o.showAddNewRow)&&(o.allowAdding||o.allowEditing)?(i=s?[this.gridID+"_update",this.gridID+"_cancel",this.gridID+"_edit",this.gridID+"_delete"]:[this.gridID+"_update",this.gridID+"_cancel"],n=s?[this.gridID+"_add"]:[this.gridID+"_add",this.gridID+"_edit",this.gridID+"_delete"]):(n.push(this.gridID+"_update"),n.push(this.gridID+"_cancel")),this.enableItems(i,!0),this.enableItems(n,!1)},$G.prototype.getItems=function(){var e=[],t=this.parent.toolbar||[];if("string"==typeof this.parent.toolbar)return[];"Vertical"===this.parent.rowRenderingMode&&(this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&e.push(this.getItemObject("responsiveFilter")),this.parent.allowSorting)&&e.push(this.getItemObject("responsiveSort"));for(var i=0,n=t;i<n.length;i++){var o=n[i];if(!this.parent.enableAdaptiveUI||-1===["Print","ColumnChooser","PdfExport","ExcelExport","CsvExport"].indexOf(o))switch(this.parent.enableAdaptiveUI&&("object"==typeof o&&"Search"===o.text||"Search"===o)&&e.push(this.getItemObject("responsiveBack")),typeof o){case"number":e.push(this.getItemObject(this.items[o]));break;case"string":e.push(this.getItemObject(o));break;default:e.push(this.getItem(o))}}return this.parent.enableAdaptiveUI&&this.isResponsiveToolbarMenuItems(!1)&&e.push(this.getItemObject("responsiveToolbarItems")),e},$G.prototype.getItem=function(e){var t=this.predefinedItems[e.text];return t?Pe(t,t,e):e},$G.prototype.getItemObject=function(e){return this.predefinedItems[""+e]||{text:e,id:this.gridID+"_"+e}},$G.prototype.enableItems=function(e,t){for(var i=0,n=e;i<n.length;i++){var o=ge("#"+n[i],this.element);o&&this.toolbar.enableItems(o.closest(".e-toolbar-item"),t)}},$G.prototype.toolbarClickHandler=function(e){var r=this,s=this.parent,a=this.gridID,l=e.originalEvent;this.parent.enableAdaptiveUI&&e.item.id===a+"_responsivetoolbaritems"?this.openResponsiveToolbarMenuPopup(l,e.item.id):(Pe(e,{cancel:!1}),s.trigger(m1,e,function(e){if(e.originalEvent=e.originalEvent||l,!e.cancel)switch(!je(e.item)&&e.item.id){case a+"_print":s.print();break;case a+"_edit":s.startEdit();break;case a+"_update":s.endEdit();break;case a+"_cancel":s.closeEdit();break;case a+"_add":s.addRecord();break;case a+"_delete":s.deleteRecord();break;case a+"_search":e.originalEvent.target.id===a+"_searchbutton"&&r.searchElement?r.search():!s.enableAdaptiveUI||r.searchElement||!e.originalEvent.target.classList.contains("e-search-wrapper")&&e.originalEvent.target.id!==a+"_searchbutton"?e.originalEvent.target.classList.contains("e-clear-icon")&&e.originalEvent.target.id===a+"_clearbutton"&&r.searchElement&&(r.searchElement.value="",r.searchElement&&(r.sIcon=r.searchElement.parentElement.querySelector(".e-sicon"),r.sIcon.classList.remove("e-clear-icon"),r.sIcon.removeAttribute("title"),r.sIcon.style.cursor="default"),r.isSearched||r.parent.searchSettings.key.length)&&(r.parent.search(r.searchElement.value),r.isSearched=!1):r.renderResponsiveSearch(!0);break;case a+"_columnchooser":var t,i,n,o;r.parent.enableAdaptiveUI?s.showResponsiveCustomColumnChooser():(o=(t=r.parent.element.querySelector(".e-ccdiv")).getBoundingClientRect().top,i=t.getBoundingClientRect().left,n=e.originalEvent.target,o=t.getBoundingClientRect().top+t.offsetTop,s.createColumnchooser(i,o,n));break;case a+"_responsivefilter":s.notify(vE,{action:3}),s.showResponsiveCustomFilter();break;case a+"_responsivesort":s.notify(vE,{action:2}),s.showResponsiveCustomSort();break;case a+"_responsiveback":r.renderResponsiveSearch(!1)}}))},$G.prototype.openResponsiveToolbarMenuPopup=function(e,t){var i={top:0,left:0},n=(this.toolbarMenuElement.style.cssText="display:block;visibility:hidden",this.toolbarMenuElement.getBoundingClientRect()),o=this.parent.element.getBoundingClientRect();this.toolbarMenuElement.style.cssText="display:none;visibility:visible",t=je(e)?this.parent.element.querySelector("#"+t):e.target,this.parent.enableRtl?(i=O0(t,"left","bottom"),this.isRightToolbarMenu&&(i.left-=n.width)):(i=O0(t,"right","bottom"),this.isRightToolbarMenu||(i.left-=n.width),i.left+n.width+1>=o.right&&(i.left-=35)),this.responsiveToolbarMenu.open(i.top,i.left),e&&e.preventDefault&&e.preventDefault(),WB(this.parent.element,this.responsiveToolbarMenu.element.parentElement)},$G.prototype.getMenuItems=function(){for(var e=[],t=0,i=this.parent.toolbar||[];t<i.length;t++){var n=i[t];"string"!=typeof n||"ColumnChooser"!==n&&"PdfExport"!==n&&"ExcelExport"!==n&&"CsvExport"!==n&&"Print"!==n||e.push({text:this.getLocaleText(n),id:this.gridID+"_"+n.toLowerCase(),iconCss:"e-btn-icon e-"+n.toLowerCase()+" e-icons"})}return e},$G.prototype.getLocaleText=function(e){var t;return"ColumnChooser"===e?t=this.l10n.getConstant("Columnchooser"):"PdfExport"===e?t=this.l10n.getConstant("Pdfexport"):"ExcelExport"===e?t=this.l10n.getConstant("Excelexport"):"CsvExport"===e?t=this.l10n.getConstant("Csvexport"):"Print"===e&&(t=this.l10n.getConstant("Print")),t},$G.prototype.renderResponsiveToolbarpopup=function(){this.l10n=this.serviceLocator.getService("localization"),this.toolbarMenuElement=this.parent.createElement("ul",{id:this.gridID+"__toolbaritemsmenu",className:"e-responsivetoolbar-menu"}),this.element.setAttribute("aria-label",this.l10n.getConstant("ToolbarMenuDialogARIA")),this.parent.element.appendChild(this.toolbarMenuElement),this.responsiveToolbarMenu=new D4({cssClass:this.parent.cssClass?"e-grid-toolbarmenu e-bigger "+this.parent.cssClass:"e-grid-toolbarmenu e-bigger",enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,beforeOpen:this.beforeOpenResponsiveToolbarMenuItem.bind(this),items:this.getMenuItems(),select:this.ResponsiveToolbarMenuItemClick.bind(this)}),this.responsiveToolbarMenu.appendTo(this.toolbarMenuElement)},$G.prototype.ResponsiveToolbarMenuItemClick=function(e){var t=this,i=this.parent,n=e.element,n=(e.item.id=n.id,{cancel:!1,name:"clicked",item:e.item,originalEvent:e.event});i.trigger(m1,n,function(e){if(!e.cancel)switch(!je(e.item)&&e.item.id){case t.gridID+"_columnchooser":i.notify(vE,{action:5}),i.showResponsiveCustomColumnChooser();break;case t.gridID+"_print":i.print()}})},$G.prototype.beforeOpenResponsiveToolbarMenuItem=function(){var i=this,n=this.parent.toolbar||[],e=[{key:"PdfExport",enabled:this.parent.allowPdfExport},{key:"ExcelExport",enabled:this.parent.allowExcelExport},{key:"CsvExport",enabled:this.parent.allowExcelExport},{key:"ColumnChooser",enabled:this.parent.showColumnChooser}],o=[],r=[];e.forEach(function(e){var t;-1!==n.indexOf(e.key)&&(t=i.getLocaleText(e.key),(e.enabled?o:r).push(t))}),this.responsiveToolbarMenu.enableItems(o,!0),this.responsiveToolbarMenu.enableItems(r,!1)},$G.prototype.modelChanged=function(e){"edit"===e.module&&this.refreshToolbarItems()},$G.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&this.parent.toolbar&&(this.element&&ue(this.element),this.render())},$G.prototype.keyUpHandler=function(e){13===e.keyCode&&(this.parent.searchModule.refreshSearch=!1,this.search()),this.searchElement&&(this.sIcon=this.searchElement.parentElement.querySelector(".e-sicon"),this.searchElement.value.length&&!je(this.sIcon)?(this.sIcon.classList.add("e-clear-icon"),this.sIcon.setAttribute("title",this.l10n.getConstant("Clear")),this.sIcon.style.cursor="pointer"):(this.sIcon.classList.remove("e-clear-icon"),this.sIcon.removeAttribute("title"),this.sIcon.style.cursor="default"))},$G.prototype.search=function(){this.isSearched=!0,this.parent.search(this.searchElement.value)},$G.prototype.updateSearchBox=function(){this.searchElement&&(this.searchElement.value=this.parent.searchSettings.key)},$G.prototype.wireEvent=function(){this.searchElement&&(this.searchBoxObj=new tk(this.searchElement,this.serviceLocator),E.add(this.searchElement,"keyup",this.keyUpHandler,this),this.searchBoxObj.wireEvent()),E.add(this.element,"focusin",this.onFocusIn,this),E.add(this.element,"focusout",this.onFocusOut,this)},$G.prototype.unWireEvent=function(){this.searchElement&&(E.remove(this.searchElement,"keyup",this.keyUpHandler),this.searchBoxObj.unWireEvent()),E.remove(this.element,"focusin",this.onFocusIn),E.remove(this.element,"focusout",this.onFocusOut)},$G.prototype.onFocusIn=function(e){var t=this.parent.focusModule.currentInfo;t&&t.element&&(q([t.element,t.elementToFocus],["e-focused","e-focus"]),t.element.tabIndex=-1),e.target.tabIndex=0},$G.prototype.onFocusOut=function(e){e.target.tabIndex=-1,e.target&&e.target.id===this.parent.element.id+"_searchbar"&&(!e.relatedTarget||e.relatedTarget.id!==this.parent.element.id+"_clearbutton"&&e.relatedTarget.id!==this.parent.element.id+"_searchbutton")&&(this.parent.searchModule.refreshSearch=!1,this.search())},$G.prototype.setFocusToolbarItem=function(e){var t=e.querySelector(".e-btn,.e-input,.e-toolbar-item-focus");(t=!t&&this.parent.enableAdaptiveUI&&!this.searchElement&&e.classList.contains("e-search-wrapper")?e.querySelector("#"+this.gridID+"_searchbutton"):t).focus()},$G.prototype.getFocusableToolbarItems=function(){for(var e=[].slice.call(this.element.querySelectorAll(".e-toolbar-item:not(.e-overlay):not(.e-hidden)")),t=[],i=0;i<e.length;i++)je(e[parseInt(i.toString(),10)].querySelector(".e-btn,.e-input,.e-toolbar-item-focus"))||t.push(e[parseInt(i.toString(),10)]);return t},$G.prototype.keyPressedHandler=function(e){if(e.target&&A(e.target,"e-toolbar-item")){var t=A(e.target,"e-toolbar-item"),i=this.getFocusableToolbarItems();if("tab"===e.action||"shiftTab"===e.action){if("tab"===e.action&&t===i[i.length-1]||"shiftTab"===e.action&&t===i[0])return;for(var n,o=0;o<i.length;o++)if(t===i[parseInt(o.toString(),10)])return e.preventDefault(),n="tab"===e.action?o+1:o-1,void this.setFocusToolbarItem(i[parseInt(n.toString(),10)])}"enter"===e.action&&this.parent.enableAdaptiveUI&&!this.searchElement&&e.target.id===this.gridID+"_searchbutton"&&this.renderResponsiveSearch(!0)}},$G.prototype.reRenderToolbar=function(){this.element&&ue(this.element),this.render()},$G.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:WT,handler:this.reRenderToolbar},{event:G1,handler:this.render},{event:K1,handler:this.onPropertyChanged},{event:Z1,handler:this.updateSearchBox.bind(this)},{event:$1,handler:this.refreshToolbarItems},{event:Lx,handler:this.refreshToolbarItems},{event:Z1,handler:this.modelChanged},{event:qA,handler:this.refreshToolbarItems},{event:wx,handler:this.removeResponsiveSearch},{event:UT,handler:this.reRenderToolbar},{event:Cx,handler:this.destroy},{event:bx,handler:this.keyPressedHandler}],CF(this.parent,this.evtHandlers,!0,this),this.rowSelectedFunction=this.rowSelected.bind(this),this.rowDeSelectedFunction=this.rowSelected.bind(this),this.parent.addEventListener(YA,this.rowSelectedFunction),this.parent.addEventListener(KA,this.rowDeSelectedFunction))},$G.prototype.removeEventListener=function(){this.parent.isDestroyed||(CF(this.parent,this.evtHandlers,!1),this.parent.removeEventListener(YA,this.rowSelectedFunction),this.parent.removeEventListener(KA,this.rowDeSelectedFunction))},$G.prototype.removeResponsiveSearch=function(e){var t=e.target,t=t.classList.contains("e-search-icon")||t.classList.contains("e-search-wrapper");this.parent.enableAdaptiveUI&&!t&&this.searchElement&&!A(e.target,"e-res-toolbar")&&this.renderResponsiveSearch(!1)},$G.prototype.rowSelected=function(){this.parent.enableAdaptiveUI&&this.toolbar.element&&(this.refreshResponsiveToolbarItems(VA.isInitial),this.toolbar.refreshOverflow())},$G.prototype.getModuleName=function(){return"toolbar"};var ZG=$G;function $G(e,t){this.predefinedItems={},this.isSearched=!1,this.items=["Add","Edit","Update","Delete","Cancel","Print","Search","ColumnChooser","PdfExport","ExcelExport","CsvExport","WordExport"],this.isRightToolbarMenu=!1,this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}eY=function(e,t){return(eY=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}eY(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(nY,tY=LD),nY.prototype.renderPanel=function(){var e=this.parent.createElement("div",{className:NE}),t=this.parent.createElement("div",{className:"e-summarycontent"});e.appendChild(t),this.setPanel(e),null!=this.parent.getPager()?this.parent.element.insertBefore(e,this.parent.getPager()):this.parent.element.appendChild(e)},nY.prototype.renderTable=function(){var e=this.createContentTable("_footer_table").querySelector("."+QE),t=this.parent.createElement("tfoot");e.appendChild(t),this.setTable(e)},nY.prototype.renderSummaryContent=function(e,t,i,n){var o=this.parent.dataSource instanceof Array?!this.parent.getDataModule().isRemote()&&this.parent.parentDetails?this.getData():this.parent.dataSource:this.parent.currentViewData,r=this.modelGenerator.getData(),s=je(i)?this.modelGenerator.getColumns():this.modelGenerator.getColumns(i),a=je(i)?this.modelGenerator.generateRows(o,e||this.aggregates):this.modelGenerator.generateRows(o,e||this.aggregates,i,n),l=document.createDocumentFragment(),h=new yD(this.locator,null,this.parent);h.element=this.parent.createElement("TR",{className:"e-summaryrow",attrs:{role:"row"}});for(var d=0,p=r.length;d<p;d++){var c=a[parseInt(d.toString(),10)];if(c){c=h.render(c,s);if(c.querySelectorAll(".e-leftfreeze").length&&c.querySelectorAll(".e-indentcell").length)for(var u=c.querySelectorAll(".e-indentcell"),g=0;g<u.length;g++)u[parseInt(g.toString(),10)].classList.add("e-leftfreeze"),dF(u[parseInt(g.toString(),10)],30*g,this.parent.enableRtl,"Left");this.parent.isFrozenGrid()&&c.querySelectorAll(".e-summarycell").length&&q([].slice.call(c.querySelectorAll(".e-summarycell")),["e-freezeleftborder","e-freezerightborder"]),l.appendChild(c)}}o=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;(this.parent.isReact||o)&&r.length&&this.parent.isInitialLoad?this.parent.renderTemplates(function(){t.tFoot.innerHTML="",t.tFoot.appendChild(l)}):t.tFoot.appendChild(l),this.aggregates=je(e)?this.aggregates:e},nY.prototype.refresh=function(e){var t=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;(this.parent.isReact||t)&&this.parent.isInitialLoad||(this.getTable().tFoot.innerHTML=""),this.renderSummaryContent(e,this.getTable(),void 0,void 0),je(e)&&this.parent.isAutoFitColumns&&this.parent.autoFitColumns(),this.onScroll()},nY.prototype.refreshCol=function(){var e=this.parent.enableColumnVirtualization?this.parent.headerModule.getColGroup():this.parent.element.querySelector("."+RE).querySelector(rD).cloneNode(!0);this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e)},nY.prototype.onWidthChange=function(e){this.getColFromIndex(e.index).style.width=T(e.width),this.parent.allowResizing&&"resize"===e.module&&this.updateFooterTableWidth(this.getTable())},nY.prototype.onScroll=function(e){void 0===e&&(e={left:this.parent.getContent().firstChild.scrollLeft}),this.getTable().parentElement.scrollLeft=e.left},nY.prototype.getColFromIndex=function(e){return this.getColGroup().children[parseInt(e.toString(),10)]},nY.prototype.columnVisibilityChanged=function(){this.refresh()},nY.prototype.addEventListener=function(){this.evtHandlers=[{event:ex,handler:this.refreshCol},{event:xx,handler:this.onWidthChange},{event:Ax,handler:this.onScroll},{event:Sx,handler:this.columnVisibilityChanged},{event:px,handler:this.refreshFooterRenderer}],CF(this.parent,this.evtHandlers,!0,this)},nY.prototype.removeEventListener=function(){CF(this.parent,this.evtHandlers,!1)},nY.prototype.updateFooterTableWidth=function(e){var t=this.parent.getHeaderTable();t&&e&&(e.style.width=t.style.width)},nY.prototype.refreshFooterRenderer=function(e){e=this.onAggregates(e);this.refresh(e)},nY.prototype.getIndexByKey=function(e,t){for(var i=this.parent.getPrimaryKeyFieldNames()[0],n=0;n<t.length;n++)if(t[parseInt(n.toString(),10)][""+i]===e[""+i])return n;return-1},nY.prototype.getData=function(){return this.parent.getDataModule().dataManager.executeLocal(this.parent.getDataModule().generateQuery(!0))},nY.prototype.onAggregates=function(n){n=n instanceof Array?n:[];var e,o=this.parent.getPrimaryKeyFieldNames()[0],t=[],i=!1,r={},s="dataSource",a=!1;if(this.parent.renderModule.data.isRemote()||!je(this.parent.dataSource)&&this.parent.dataSource.result||!(this.parent.allowFiltering&&this.parent.filterSettings.columns.length||this.parent.searchSettings.key.length)||(a=!0),e=!je(this.parent.dataSource)&&this.parent.dataSource.result?this.parent.getCurrentViewRecords():this.parent.dataSource instanceof Array?a?this.parent.getFilteredRecords():this.parent.dataSource:this.parent.dataSource[s].json.length?a?this.parent.getFilteredRecords():this.parent.dataSource[s].json:this.parent.getCurrentViewRecords(),this.parent.parentDetails&&!this.parent.getDataModule().isRemote()&&(e=this.getData()),this.parent.editModule&&(r=this.parent.editModule.getBatchChanges()),Object.keys(r).length){for(var l=0;l<e.length;l++)i=!1,r[KE].length&&-1<this.getIndexByKey(e[parseInt(l.toString(),10)],r[KE])&&(i=!0,t.push(r[KE][this.getIndexByKey(e[parseInt(l.toString(),10)],r[KE])])),r[ZE].length&&-1<this.getIndexByKey(e[parseInt(l.toString(),10)],r[ZE])?i=!0:i||t.push(e[parseInt(l.toString(),10)]);if(r[JE].length)for(l=0;l<r[JE].length;l++)t.push(r[JE][parseInt(l.toString(),10)])}else t=n.length?(c=_P(e)).map(function(e){var t,i=Sa.getObject(o,e);return n.some(function(e){return t=e,i===Sa.getObject(o,e)})?t:e}):e;for(var a=n,h=(a.type&&"cancel"===a.type&&(t=e),{}),d=this.parent.aggregates,l=0;l<d.length;l++)for(var p=0;p<d[parseInt(l.toString(),10)].columns.length;p++){var c=[];c=t;for(var u=0,g=d[parseInt(l.toString(),10)].columns[parseInt(p.toString(),10)].type.toString().split(",").map(function(e){return e.trim()});u<g.length;u++){var m=g[u],f=iB(m,c,d[parseInt(l.toString(),10)].columns[parseInt(p.toString(),10)],this.parent);h[d[parseInt(l.toString(),10)].columns[parseInt(p.toString(),10)].field+" - "+m.toLowerCase()]=f}}return{result:t,count:t.length,aggregates:h}};var eY,tY,iY=nY;function nY(e,t){var i=tY.call(this,e,t)||this;return i.aggregates={},i.parent=e,i.locator=t,i.modelGenerator=new SD(i.parent),i.addEventListener(),i}oY=function(e,t){return(oY=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}oY(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(aY,rY=VD),aY.prototype.getValue=function(e,t,i){var n=je(i.type)?i.columnName:i.field+" - "+("string"==typeof i.type?i.type.toLowerCase():"");return t[i.columnName]?t[i.columnName][""+n]:""},aY.prototype.evaluate=function(e,t,i,n){var o=t.column;if(this.parent.on(cx,this.refreshWithAggregate(e,t),this),!(o.footerTemplate||o.groupFooterTemplate||o.groupCaptionTemplate))return"Vertical"===this.parent.rowRenderingMode&&(e.style.display="none"),!0;"Vertical"===this.parent.rowRenderingMode&&e.classList.add("e-lastsummarycell");var t=o.getTemplate(t.cellType),r=this.parent.getColumnByField(i[o.columnName].field),s=(je(r)||(i[o.columnName].headerText=r.headerText,r.isForeignColumn()&&(s=r.columnData.filter(function(e){return e[r.foreignKeyField]===i[o.columnName].key})[0])&&(i[o.columnName].foreignKey=s[r.foreignKeyValue])),o.footerTemplate?"string"!=typeof o.footerTemplate&&!(o.footerTemplate.prototype&&o.footerTemplate.prototype.CSPTemplate):o.groupFooterTemplate?"string"!=typeof o.groupFooterTemplate&&!(o.groupFooterTemplate.prototype&&o.groupFooterTemplate.prototype.CSPTemplate):!(!o.groupCaptionTemplate||"string"==typeof o.groupCaptionTemplate||o.groupCaptionTemplate.prototype&&o.groupCaptionTemplate.prototype.CSPTemplate)),a=this.parent.isReact&&s,s=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact&&s,l=this.parent.printGridParent&&this.parent.printGridParent.isReact;return a||s||l?(a=i[o.columnName],"groupCaptionTemplate"!==t.property&&"groupFooterTemplate"!==t.property||(a.groupKey=a.key),t.fn(a,this.parent,t.property,"",null,null,e),this.parent.isInitialLoad||this.parent.renderTemplates()):eB(e,t.fn(i[o.columnName],this.parent,t.property,"",null,null,null,this.parent.root)),!1},aY.prototype.refreshWithAggregate=function(n,e){var o=this,r=e;return function(e){var t=r,i=t.column.columnName||null,t=je(i)?null:e.cells.filter(function(e){return e.column.columnName===i})[0];n.parentElement&&n.parentElement.getAttribute("data-uid")===e.dataUid&&i&&t&&i===t.column.columnName&&o.refreshTD(n,t,e.data)}};var oY,rY,sY=aY;function aY(){var e=null!==rY&&rY.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-summarycell",attrs:{tabindex:"-1",role:"gridcell"}}),e}hY.prototype.getModuleName=function(){return"aggregate"},hY.prototype.initiateRender=function(){for(var e=this,t=this.locator.getService("cellRendererFactory"),i=new sY(this.parent,this.locator),n=[LA.Summary,LA.CaptionSummary,LA.GroupSummary],o=0;o<n.length;o++)t.addCellRenderer(n[parseInt(o.toString(),10)],i);this.footerRenderer=new iY(this.parent,this.locator),this.footerRenderer.renderPanel(),this.footerRenderer.renderTable();var r=this.footerRenderer.getPanel(),s=(this.parent.element.scrollHeight>=this.parent.getHeight(this.parent.height)&&r&&U([r],["e-footerpadding"]),this.locator.register("footerRenderer",this.footerRenderer),function(){e.prepareSummaryInfo(),e.parent.off(Y1,s)});this.parent.on(Y1,s,this),this.parent.on(Y1,this.footerRenderer.refresh,this.footerRenderer)},hY.prototype.prepareSummaryInfo=function(){var i=this;dY(this.parent.aggregates,function(e){var t=R("customFormat",e);je(t)||e.setPropertiesSilent({format:t}),"object"==typeof e.format?(t=new v0,e.setFormatter(t.getFormatFunction(Pe({},e.format)))):"string"==typeof e.format&&(t=i.locator.getService("valueFormatter"),e.setFormatter(t.getFormatFunction({format:e.format}))),e.setPropertiesSilent({columnName:e.columnName||e.field})})},hY.prototype.onPropertyChanged=function(e){e.module!==this.getModuleName()||(je(this.footerRenderer)&&this.initiateRender(),this.prepareSummaryInfo(),this.footerRenderer.refresh(),e=new DD(this.parent),0===new ID(this.parent).getData().length&&e.isEmpty())||this.parent.notify($1,{})},hY.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(G1,this.initiateRender,this),this.parent.on(K1,this.onPropertyChanged,this),this.parent.on(ux,this.refresh,this),this.parent.on(Cx,this.destroy,this))},hY.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.footerRenderer.removeEventListener(),this.parent.off(G1,this.initiateRender),this.parent.off(Y1,this.footerRenderer.refresh),this.parent.off(K1,this.onPropertyChanged),this.parent.off(ux,this.refresh),this.parent.off(Cx,this.destroy),this.parent.element.querySelector("."+NE)&&ue(this.parent.element.querySelector("."+NE)))},hY.prototype.destroy=function(){this.removeEventListener()},hY.prototype.refresh=function(e,t){e=e instanceof Array?e:[e];this.parent.notify(px,e),t&&(e.row=t),0<this.parent.groupSettings.columns.length&&this.parent.notify(dx,e)};var lY=hY;function hY(e,t){this.parent=e,this.locator=t,this.addEventListener()}function dY(e,t){for(var i=0;i<e.length;i++)for(var n=0;n<e[parseInt(i.toString(),10)].columns.length;n++)t(e[parseInt(i.toString(),10)].columns[parseInt(n.toString(),10)],e[parseInt(i.toString(),10)])}cY.prototype.observe=function(e,t){var i=this;this.containerRect=this.options.container.getBoundingClientRect(),E.add(this.options.container,"wheel",function(){return i.fromWheel=!0},this),E.add(this.options.container,"scroll",this.virtualScrollHandler(e,t),this)},cY.prototype.check=function(e){e=this.sentinelInfo[""+e];return e.check(this.element.getBoundingClientRect(),e)},cY.prototype.virtualScrollHandler=function(e,r){var s=this,a=P(e,"chrome"===F.info.name?200:100),l=P(e,50);return this.options.prevTop=this.options.prevLeft=0,function(e){var t,i=e.target.scrollTop,e=e.target.scrollLeft,n=s.options.prevTop<i?"down":"up",n=s.options.prevLeft===e?n:s.options.prevLeft<e?"right":"left",o=(s.options.prevTop=i,s.options.prevLeft=e,s.sentinelInfo[n]);-1!==s.options.axes.indexOf(o.axis)&&(s.containerRect=s.options.container.getBoundingClientRect(),t=s.check(n),o.entered&&r(s.element,o,n,{top:i,left:e},s.fromWheel,t),t&&("X"===o.axis?l:a)({direction:n,sentinel:o,offset:{top:i,left:e},focusElement:document.activeElement}),s.fromWheel=!1)}},cY.prototype.setPageHeight=function(e){this.options.pageHeight=e};var pY=cY;function cY(e,t,i){var o=this;this.fromWheel=!1,this.touchMove=!1,this.options={},this.sentinelInfo={up:{check:function(e,t){var i=e.top-o.containerRect.top,n=o.containerRect.bottom>e.bottom?o.containerRect.bottom-e.bottom:0;return t.entered=0<=i,0<=i+o.options.pageHeight/2||0<n&&0<e.bottom},axis:"Y"},down:{check:function(e,t){var i=e.bottom;return t.entered=e.bottom<=o.containerRect.bottom,i-o.containerRect.top-o.options.pageHeight/2<=o.options.pageHeight/2},axis:"Y"},right:{check:function(e,t){e=e.right;return t.entered=e<o.containerRect.right,e-o.containerRect.width<=o.containerRect.right},axis:"X"},left:{check:function(e,t){e=e.left;return t.entered=0<e,e+o.containerRect.width>=o.containerRect.left},axis:"X"}},this.element=e,this.options=t,this.movableEle=i}gY.prototype.columnInfiniteRows=function(e,t){var i,n=[];return"virtualscroll"===t.requestType?(i=this.parent.getRowsObject(),n.push.apply(n,this.rowModelGenerator.refreshRows(i)),this.parent.infiniteScrollSettings.enableCache&&(i=this.parent.frozenRows&&1===this.parent.pageSettings.currentPage?0:PF(this.parent.getContentTable().querySelector(".e-row:not(.e-addedrow)")),i=n.slice(i,i+3*this.parent.pageSettings.pageSize),n=i=this.parent.frozenRows&&1!==this.parent.pageSettings.currentPage?n.slice(0,this.parent.frozenRows).concat(i):i)):n.push.apply(n,this.rowModelGenerator.generateRows(e,t)),n},gY.prototype.generateRows=function(p,c){var i=this;if(this.parent.enableColumnVirtualization&&this.parent.enableInfiniteScrolling)return this.columnInfiniteRows(p,c);var u=!1,g=c.virtualInfo=c.virtualInfo||("sorting"===c.requestType||"delete"===c.requestType)&&VF(this.parent)&&this.prevInfo||this.getData(),m=(this.prevInfo=g).sentinelInfo&&"X"===g.sentinelInfo.axis,e=(m||!g.loadNext||g.loadSelf?g:g.nextInfo).page,f=[],y=this.getBlockIndexes(e),v=[];if(this.currentInfo.blockIndexes&&(y=g.blockIndexes=c.virtualInfo.blockIndexes=this.includePrevPage?this.currentInfo.blockIndexes.slice(1):this.currentInfo.blockIndexes.slice(0,this.currentInfo.blockIndexes.length-1),u=!0),this.checkAndResetCache(c.requestType),BB(this.parent)&&this.parent.vcRows.length){e=this.parent.vcRows.filter(function(e){return e.isDataRow});if(this.parent.isManualRefresh&&e.length===p.records.length||!this.parent.isManualRefresh)return f=this.parent.vcRows}if(this.parent.enableColumnVirtualization)for(var t=0;t<g.blockIndexes.length;t++)this.isBlockAvailable(g.blockIndexes[parseInt(t.toString(),10)])&&(this.cache[g.blockIndexes[parseInt(t.toString(),10)]]=this.rowModelGenerator.refreshRows(this.cache[g.blockIndexes[parseInt(t.toString(),10)]]));for(var b=g.blockIndexes,w=this,t=0;t<b.length;t++)!function(e){if(!w.isBlockAvailable(b[parseInt(e.toString(),10)])){var t=je(w.startIndex)?w.getStartIndex(b[parseInt(e.toString(),10)],p):w.startIndex,t=!BB(w.parent)||w.parent.vcRows.length||"sorting"!==c.requestType&&"delete"!==c.requestType?t:0,i=w.rowModelGenerator.generateRows(p,{virtualInfo:g,startIndex:t});BB(w.parent)&&!w.parent.vcRows.length&&(w.recordsCount=p.records.length,w.parent.vRows=i,w.parent.vcRows=i,w.parent.notify(GT,{}));if(BB(w.parent))w.getGroupVirtualRecordsByIndex(i);else if(u)w.setBlockForManualRefresh(w.cache,y,i);else if("sorting"!==c.requestType&&"delete"!==c.requestType||!VF(w.parent))t=~~Math.max(i.length,w.model.pageSize)/2,w.isBlockAvailable(y[0])||(w.cache[y[0]]=i.slice(0,t)),w.isBlockAvailable(y[1])||(w.cache[y[1]]=i.slice(t));else for(var n=_F(g.blockIndexes),o=0,r=0;r<n.length;r++){var s=w.getBlockIndexes(n[parseInt(r.toString(),10)]),a=w.model.pageSize*r,l=a+w.model.pageSize,h=(w.parent.allowGrouping&&w.parent.groupSettings.columns.length&&(h=i.filter(function(e){return e.isDataRow}).slice(a,l),a=o,l=i.indexOf(h[h.length-1])+1),i.slice(a,l)),a=~~Math.max(h.length,w.model.pageSize)/2;w.isBlockAvailable(s[0])||(w.cache[s[0]]=h.slice(0,a)),w.isBlockAvailable(s[1])||(w.cache[s[1]]=h.slice(a)),o=l}}var d;w.parent.groupSettings.columns.length&&!m&&w.cache[b[parseInt(e.toString(),10)]]&&!w.parent.groupSettings.enableLazyLoading&&(w.cache[b[parseInt(e.toString(),10)]]=w.updateGroupRow(w.cache[b[parseInt(e.toString(),10)]],b[parseInt(e.toString(),10)])),c.renderMovableContent||c.renderFrozenRightContent||!w.cache[b[parseInt(e.toString(),10)]]||(f.push.apply(f,w.cache[b[parseInt(e.toString(),10)]]),d=[],w.parent.enableVirtualization&&w.parent.groupSettings.columns.length&&f.forEach(function(e){d.includes(e)||d.push(e)}),f=d.length?d:f),w.isBlockAvailable(b[parseInt(e.toString(),10)])&&v.push(b[parseInt(e.toString(),10)])}(t);if(BB(this.parent)&&this.parent.vcRows.length&&"sorting"===c.requestType&&0!==c.scrollTop.top)return f=this.parent.vcRows;g.blockIndexes=v;var n="records";return this.parent.allowGrouping&&this.parent.groupSettings.columns.length?this.parent.currentViewData[n]=f.map(function(e){return e.data}):this.parent.currentViewData=f.map(function(e){return e.data}),"grouping"===c.requestType&&(this.parent.currentViewData[n]=this.parent.currentViewData[n].filter(function(e,t){return i.parent.currentViewData[n].indexOf(e)===t})),BB(this.parent)&&this.parent.vcRows.length&&["save","delete"].some(function(e){return c.requestType===e})?f=this.parent.vcRows:f},gY.prototype.setBlockForManualRefresh=function(e,t,i){var n=this.model.pageSize/2;this.includePrevPage?(e[t[0]-1]=i.slice(0,n),e[t[0]]=i.slice(n,2*n),e[t[1]]=i.slice(2*n,3*n),e[t[2]]=i.slice(3*n,4*n)):(e[t[0]]=i.slice(0,n),e[t[1]]=i.slice(n,2*n),e[t[2]]=i.slice(2*n,3*n),e[t[2]+1]=i.slice(3*n,4*n))},gY.prototype.getBlockIndexes=function(e){return[e+(e-1),2*e]},gY.prototype.getPage=function(e){return e%2==0?e/2:(e+1)/2},gY.prototype.isBlockAvailable=function(e){return e in this.cache},gY.prototype.getData=function(){return{page:this.model.currentPage,blockIndexes:this.getBlockIndexes(this.model.currentPage),direction:"down",columnIndexes:this.parent.getColumnIndexesInView()}},gY.prototype.getStartIndex=function(e,t,i){void 0===i&&(i=!0);var n=(this.getPage(e)-1)*this.model.pageSize;return i||!(e%2==0)?n:n+~~(this.model.pageSize/2)},gY.prototype.getColumnIndexes=function(e){var i=this,n=(void 0===e&&(e=this.parent.getHeaderContent().querySelector("."+VE)),[]),t=0|e.scrollLeft,o=Object.keys(this.cOffsets),e=e.getBoundingClientRect().width,t=Math.min(this.cOffsets[o.length-1]-e,t),r=F.isDevice?2*e:e/2,s=t+e+(0===t?r:0),a=0,l=t-r;if(this.parent.isFrozenGrid()){if(a=this.parent.leftrightColumnWidth("left"),0<l)for(var h=this.parent.getVisibleFrozenLeftCount()-1;0<=h;h--)if(l<=this.cOffsets[parseInt(h.toString(),10)]){a-=this.cOffsets[parseInt(h.toString(),10)];break}this.parent.getFrozenMode()===$E&&(e=this.parent.getVisibleFrozenRightCount(),o.splice(o.length-1-e,e))}var d=this.parent.getVisibleFrozenLeftCount();return o.some(function(e){var t=Number(e),e=i.cOffsets[""+e];return(l<0&&t<d||l+a<=e&&e<=s+r)&&n.push(t),s+r<e}),n},gY.prototype.checkAndResetCache=function(t){var e=["paging","refresh","sorting","filtering","searching","grouping","ungrouping","reorder","save","delete"].some(function(e){return t===e});return e&&(this.cache={},this.data={},this.groups={}),e},gY.prototype.refreshColOffsets=function(){for(var e=this,t=0,i=(this.cOffsets={},this.parent.groupSettings.columns.length),n=this.parent.getVisibleColumns(),o=n.length,r=this.parent.groupSettings.columns,s=0;s<r.length;s++)this.cOffsets[parseInt(s.toString(),10)]=30+(0|this.cOffsets[s-1]);for(var a,l=Array.apply(null,Array(o)).map(function(){return t++}),h=0;h<l.length;h++)l[parseInt(h.toString(),10)]=l[parseInt(h.toString(),10)]+i,this.cOffsets[l[parseInt(h.toString(),10)]]=(0|this.cOffsets[l[parseInt(h.toString(),10)]-1])+((a=n[parseInt(h.toString(),10)]).visible&&(e.parent.groupSettings.showGroupedColumn?a.visible:e.parent.groupSettings.columns.indexOf(a.field)<0)?parseInt(n[parseInt(h.toString(),10)].width,10):0)},gY.prototype.updateGroupRow=function(e,t){for(var i=e[0],n=[],o=Object.keys(this.cache),r=0;r<o.length;r++)Number(o[parseInt(r.toString(),10)])<t&&(n=n.concat(this.cache[o[parseInt(r.toString(),10)]]));return i&&i.isDataRow||t%2==0?e:this.iterateGroup(e,n)},gY.prototype.iterateGroup=function(e,t){var i=e[0],n=0;return i&&i.isDataRow||e.some(function(i){return t.some(function(e,t){e=e&&void 0!==e.data.field&&e.data.field===i.data.field&&e.data.key===i.data.key;return e&&(n=t),e})})&&(e.shift(),e=this.iterateGroup(e,t.slice(n))),e},gY.prototype.getRows=function(){for(var e=[],t=Object.keys(this.cache),i=0;i<t.length;i++)e=e.concat(this.cache[t[parseInt(i.toString(),10)]]);return e},gY.prototype.generateCells=function(e){for(var t=[],i=this.parent.columnModel,n=0;n<i.length;n++)t.push(this.rowModelGenerator.generateCell(i[parseInt(n.toString(),10)],null,null,null,null,e));return t},gY.prototype.getGroupVirtualRecordsByIndex=function(e){var t=this.parent.contentModule.getGroupedTotalBlocks(),i=this.parent.contentModule.getBlockSize();if(0===Object.keys(this.cache).length)for(var n=0,o=1;o<=t;o++){var r=0;this.cache[parseInt(o.toString(),10)]=[];for(var s=(o-1)*i+n;s<e.length&&r!==i;s++)this.cache[parseInt(o.toString(),10)].push(e[parseInt(s.toString(),10)]),e[parseInt(s.toString(),10)].isDataRow&&r++,n++;n-=r}};var uY=gY;function gY(e){this.cOffsets={},this.cache={},this.rowCache={},this.data={},this.groups={},this.currentInfo={},this.prevInfo={},this.parent=e,this.model=this.parent.pageSettings,this.rowModelGenerator=new(this.parent.allowGrouping?BD:bD)(this.parent)}mY=function(e,t){return(mY=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])}))(e,t)};var mY,fY,l9=function(e,t){function i(){this.constructor=e}mY(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},yY=(l9(vY,fY=LD),vY.prototype.renderTable=function(){this.header=this.locator.getService("rendererFactory").getRenderer(RA.Header),fY.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.content=this.content=this.getPanel().querySelector("."+WE),this.virtualEle.renderWrapper(this.parent.height),this.virtualEle.renderPlaceHolder(),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||(this.virtualEle.wrapper.style.position="absolute");var e=this.parent.dataSource instanceof me&&!this.parent.dataSource.dataSource.offline,e={container:this.content,pageHeight:2*this.getBlockHeight(),debounceEvent:e,axes:this.parent.enableColumnVirtualization?["X","Y"]:["Y"]};this.observer=new pY(this.virtualEle.wrapper,e)},vY.prototype.renderEmpty=function(e){this.getTable().appendChild(e),this.parent.frozenRows&&(this.parent.getHeaderContent().querySelector(oD).innerHTML=""),this.virtualEle.adjustTable(0,0)},vY.prototype.getReorderedFrozenRows=function(e){var t=e.virtualInfo.blockIndexes,i=e.virtualInfo.columnIndexes,n=e.virtualInfo.page,o=(e.virtualInfo.blockIndexes=[1,2],e.virtualInfo.page=1,e.virtualInfo.columnIndexes=[],this.parent.getCurrentViewRecords().length),o=this.parent.renderModule.data.dataManager.dataSource.json.slice(0,o),o=this.vgenerator.generateRows(o,e);return e.virtualInfo.blockIndexes=t,e.virtualInfo.columnIndexes=i,e.virtualInfo.page=n,o.splice(0,this.parent.frozenRows)},vY.prototype.scrollListener=function(e){if((this.parent.enableVirtualization||!this.parent.enableColumnVirtualization||"up"!==e.direction&&"down"!==e.direction)&&!this.isBottomNotify)if(this.scrollAfterEdit(),this.parent.enablePersistence&&(this.parent.scrollPosition=e.offset),this.preventEvent||this.parent.isDestroyed)this.preventEvent=!1;else if(je(document.activeElement)?this.isFocused=!1:this.isFocused=this.content===z(document.activeElement,"."+WE)||this.content===document.activeElement,this.parent.islazyloadRequest&&"down"===e.direction)this.parent.removeMaskRow(),this.parent.islazyloadRequest=!1;else{var t=e.sentinel,i=this.currentInfo=this.getInfoFromView(e.direction,t,e.offset);if(BB(this.parent))return i.blockIndexes&&this.prevInfo.blockIndexes.toString()===i.blockIndexes.toString()?void this.parent.removeMaskRow():(i.event="refresh-virtual-block",je(i.offsets)||(i.offsets.top=this.content.scrollTop),this.parent.pageSettings.currentPage=i.page,this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(t.axis),this.parent.addShimmerEffect()),this.parent.editSettings.showAddNewRow&&this.parent.closeEdit(),void this.parent.notify(i.event,{requestType:"virtualscroll",virtualInfo:i,focusElement:e.focusElement}));if(this.prevInfo&&("Y"===t.axis&&this.prevInfo.blockIndexes.toString()===i.blockIndexes.toString()||"X"===t.axis&&this.prevInfo.columnIndexes.toString()===i.columnIndexes.toString()||this.parent.isFrozenGrid()&&"X"===t.axis&&this.parent.getVisibleFrozenLeftCount()>=i.columnIndexes[0]&&this.prevInfo.columnIndexes.toString().includes(i.columnIndexes.toString())))this.parent.removeMaskRow(),F.isIE&&this.parent.hideSpinner(),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,"Y"===t.axis&&this.restoreEdit(),this.parent.groupSettings.enableLazyLoading&&1===this.prevInfo.blockIndexes[0]&&1===i.blockIndexes[0]&&"up"===e.direction&&this.virtualEle.adjustTable(0,i.offsets.top<this.offsets[1]?0:this.getBlockHeight());else{if(this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?i.columnIndexes:[]),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||(this.parent.pageSettings.currentPage=(i.loadNext&&!i.loadSelf?i.nextInfo:i).page),this.requestType="virtualscroll",this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(t.axis),this.parent.addShimmerEffect()),this.parent.islazyloadRequest=!1,this.parent.editSettings.showAddNewRow&&this.parent.closeEdit(),this.parent.notify(bE,{action:"clear"}),this.parent.isInitialLoad||!this.parent.enablePersistence){if(this.prevPage===this.parent.pageSettings.currentPage&&i.event===$1)return void(this.currentInfo=this.prevCurrentInfo);i.event===$1&&(this.prevPage=this.parent.pageSettings.currentPage,this.prevCurrentInfo=this.currentInfo),this.isBottomNotify=this.isBottom&&i.event===$1,this.parent.notify(i.event,{requestType:"virtualscroll",virtualInfo:i,focusElement:e.focusElement})}this.parent.enableColumnVirtualization&&!this.parent.getContentTable().querySelector("tr.e-row")&&(this.parent.removeMaskRow(),this.appendContent(void 0,void 0,{requestType:"virtualscroll",virtualInfo:i,focusElement:e.focusElement}),this.prevInfo=i)}}},vY.prototype.block=function(e){return this.vgenerator.isBlockAvailable(e)},vY.prototype.getInfoFromView=function(e,t,i){var n=!1,o=[],r={direction:e,sentinelInfo:t,offsets:i,startIndex:this.preStartIndex,endIndex:this.preEndIndex},i=(r.page=this.getPageFromTop(i.top,r),r.blockIndexes=o=this.vgenerator.getBlockIndexes(r.page),r.loadSelf=!this.vgenerator.isBlockAvailable(o[r.block]),this.ensureBlocks(r));if("upArrow"===this.activeKey&&r.blockIndexes.toString()!==i.toString()&&(s=i[i.length-1],-1===r.blockIndexes.indexOf(s))&&(n=!0),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||(r.blockIndexes=i),r.loadNext=!i.filter(function(e){return-1===o.indexOf(e)}).every(this.block.bind(this)),r.event=r.loadNext||r.loadSelf?$1:Bx,r.nextInfo=r.loadNext?{page:Math.max(1,r.page+("down"===e?1:-1))}:{},n&&(r.blockIndexes=[r.blockIndexes[0]-1,r.blockIndexes[0],r.blockIndexes[0]+1]),"downArrow"===this.activeKey&&!isNaN(this.rowIndex)){var s=Math.ceil(this.rowIndex/this.getBlockSize());if(1!==s&&(r.blockIndexes[1]!==s||r.blockIndexes.length<3)&&(r.blockIndexes=[s-1,s,s+1],r.loadNext)){for(var a=this.vgenerator.getBlockIndexes(r.nextInfo.page),l=!1,h=0;h<r.blockIndexes.length;h++){for(var d=0;d<a.length;d++)if(r.blockIndexes[parseInt(h.toString(),10)]===a[parseInt(d.toString(),10)]){l=!0;break}if(l)break}l||(r.loadNext=!1,r.nextInfo={},r.event=Bx)}}return r.columnIndexes="X"===t.axis?this.vgenerator.getColumnIndexes():this.parent.getColumnIndexesInView(),this.parent.enableColumnVirtualization&&"X"===t.axis&&(r.event=Bx),r},vY.prototype.ensureBlocks=function(e){var i,n=this,t=e.blockIndexes[e.block],o=t,r=Math.max,s="down"===e.direction?[r(t,1),++t,++t]:[r(t-1,1),t,t+1],a=(this.prevInfo=this.prevInfo||this.vgenerator.getData(),s=s.filter(function(e,t){return s.indexOf(e)===t}),!1);return VF(this.parent)&&"up"===e.direction&&((e.page+1===this.prevInfo.page||e.page===this.prevInfo.page)&&(1===e.block||0===e.block&&1===e.page)||e.page===this.prevInfo.page&&2===s.length)&&this.vgenerator.isBlockAvailable(e.blockIndexes[1]+1)&&(a=e.page+1===this.prevInfo.page&&1===e.block,s=[r((t+=1)-1,1),t,t+1]),s=this.prevInfo.blockIndexes.toString()!==s.toString()&&((s=e.loadSelf&&!a||"down"===e.direction&&this.isEndBlock(o)?this.vgenerator.getBlockIndexes(e.page):s).some(function(e,t){e=e===(BB(n.parent)?n.getGroupedTotalBlocks():n.getTotalBlocks());return e&&(i=t),e}),void 0!==i&&(s=s.slice(0,i+1),0===e.block)&&1===s.length&&this.vgenerator.isBlockAvailable(s[0]-1))?[s[0]-1,s[0]]:s},vY.prototype.appendContent=function(e,t,i){var n,o=this,r=i.virtualInfo.sentinelInfo&&"Y"===i.virtualInfo.sentinelInfo.axis&&this.currentInfo.page&&this.currentInfo.page!==i.virtualInfo.page?this.currentInfo:i.virtualInfo,s=(this.prevInfo=this.prevInfo||i.virtualInfo,r.columnIndexes[0]-1),a=this.getColumnOffset(s),l=r.blockIndexes,h=(this.parent.groupSettings.columns.length&&this.refreshOffsets(),"100%"===this.parent.height&&(this.parent.element.style.height="100%"),(this.parent.height.toString().indexOf("%")<0?this.content:this.parent.element).getBoundingClientRect().height),d=(!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization&&(h=0),0);if(this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&(n=0,this.parent.getColumns().filter(function(e){e.visible&&(d+=parseInt(e.width.toString(),10),"Left"===e.freeze)&&(n+=parseInt(e.width.toString(),10))}),u=r.columnIndexes,c=this.getColumnOffset(u[u.length-1])-this.getColumnOffset(u[0]-1)+"",s>this.parent.getVisibleFrozenLeftCount()&&(a-=n),this.resetStickyLeftPos(a,t)),this.requestTypes.some(function(e){return e===o.requestType})||(s=this.getTranslateY(this.content.scrollTop,h,r),this.parent.groupSettings.enableLazyLoading&&r&&this.prevInfo&&1===this.prevInfo.blockIndexes[0]&&1===r.blockIndexes[0]&&"up"===r.direction?this.virtualEle.adjustTable(0,this.content.scrollTop<this.offsets[1]?0:this.getBlockHeight()):this.virtualEle.adjustTable(a,s)),this.parent.enableColumnVirtualization&&this.header.virtualEle.adjustTable(a,0),this.parent.enableColumnVirtualization&&(u=r.columnIndexes,c=this.getColumnOffset(u[u.length-1])-this.getColumnOffset(u[0]-1)+"",this.parent.isFrozenGrid()&&(c=d.toString(),this.parent.allowResizing)&&(this.parent.getHeaderTable().style.width=d+"px",this.parent.getContentTable().style.width=d+"Px"),this.header.virtualEle.setWrapperWidth(c)),this.virtualEle.setWrapperWidth(c,F.isIE||"edge"===F.info.name),!(this.parent.enableColumnVirtualization&&je(e)&&je(t))){je(e)||je(e.parentNode)||ue(e);h=this.parent.element.querySelector("."+WE).querySelector(oD);if(h&&(ue(h),e=null),this.parent.isReact&&!je(this.parent.rowTemplate)?e=t:(e=this.parent.createElement(oD,{attrs:{role:"rowgroup"}})).appendChild(t),this.parent.frozenRows&&"virtualscroll"===i.requestType&&(1===this.parent.pageSettings.currentPage||this.isInfiniteColumnvirtualization()))for(var p=0;p<this.parent.frozenRows;p++)e.children[0].remove();this.getTable().appendChild(e),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,this.parent.enableVirtualization||!this.parent.enableColumnVirtualization||"right"!==r.direction&&"left"!==r.direction||(this.content.scrollTop=this.currentInfo.offsets.top,this.content.scrollLeft=this.currentInfo.offsets.left),this.parent.groupSettings.columns.length&&(BB(this.parent)||"up"!==r.direction||(s=this.offsets[this.getTotalBlocks()]-this.prevHeight,a=this.content.scrollTop,this.content.scrollTop=a+s),this.setVirtualHeight(),this.parent.groupSettings.enableLazyLoading||this.observer.setPageHeight(this.getOffset(l[l.length-1])-this.getOffset(l[0]-1))),this.parent.groupSettings.enableLazyLoading||0!==this.parent.groupSettings.columns.length||"ungrouping"!==i.requestType||this.observer.setPageHeight(2*this.getBlockHeight()),this.prevInfo=r,this.isFocused&&"downArrow"!==this.activeKey&&"upArrow"!==this.activeKey&&this.content.focus();var c,u=Math.ceil(this.getTotalBlocks()/2);this.isBottom&&(this.isBottom=!1,this.isBottomNotify=!1,this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-1]),this.parent.pageSettings.currentPage+1!==u&&this.parent.pageSettings.currentPage!==u||2!==l.length||"delete"!==i.requestType||(this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-1]),this.parent.pageSettings.currentPage===u&&1===l.length&&(this.isBottom=!0,setTimeout(function(){var e=o.parent.getContent().firstElementChild,e=(e.scrollTop=o.offsets[o.offsetKeys.length-2],{direction:"up",sentinel:o.observer.sentinelInfo.up,offset:{top:e.scrollTop,left:e.scrollLeft},focusElement:o.parent.element});o.scrollListener(e)},0)),this.isTop&&(this.parent.getContent().firstElementChild.scrollTop=0,this.isTop=!1),"virtualscroll"===i.requestType&&"X"===i.virtualInfo.sentinelInfo.axis&&this.parent.notify(Ox,{}),this.focusCell(i),this.firstCellFocus&&(this.firstCellFocus=!1,h=(c=this.parent.focusModule).active.matrix.current,t=this.parent.getContentTable().rows[h[0]].cells[h[1]],c.currentInfo.element=t,(c.currentInfo.elementToFocus=t).classList.add("e-focus"),t.classList.add("e-focused"),t.tabIndex=0,t.focus()),this.restoreEdit(i),this.restoreAdd(),this.ensureSelectedRowPosition(),this.validationScrollLeft(),this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.widthServices.refreshFrozenScrollbar(),this.initialRowTop||(a=this.parent.element.getBoundingClientRect().top,this.parent.getRowByIndex(0)&&(this.initialRowTop=this.parent.getRowByIndex(0).getBoundingClientRect().top-a))}},vY.prototype.validationScrollLeft=function(){var e;this.validationCheck&&(this.validationCol?(e=this.vgenerator.cOffsets[this.validationCol.index-this.parent.getVisibleFrozenColumns()-1],this.validationCol=null,this.content.scrollLeft=e):(this.validationCheck=!1,this.parent.editModule.editFormValidate()))},vY.prototype.ensureSelectedRowPosition=function(){var e;this.isSelection||!this.isSelectionScroll||je(this.selectRowIndex)||(this.isSelectionScroll=!1,(e=this.parent.getRowByIndex(this.selectRowIndex))&&!this.isRowInView(e)&&this.rowSelected({rowIndex:this.selectRowIndex,row:e},!0))},vY.prototype.focusCell=function(e){var t;"upArrow"!==this.activeKey&&"downArrow"!==this.activeKey||((t=this.parent.getRowByIndex(this.rowIndex)).cells[this.cellIndex].focus({preventScroll:!0}),this.parent.selectionSettings.checkboxOnly||this.parent.selectRow(parseInt(t.getAttribute(nD),10)-1),this.activeKey=this.empty)},vY.prototype.restoreEdit=function(e){var t,i,n,o;this.isNormaledit&&(this.parent.editSettings.allowEditing&&this.parent.editModule&&!je(this.editedRowIndex)&&(t=this.getRowByIndex(this.editedRowIndex),o=this.content,i=Object.keys(this.virtualData),n=e&&e.virtualInfo&&"X"===e.virtualInfo.sentinelInfo.axis,i.length&&t&&!o.querySelector("."+GE)&&-1===["sorting","filtering","grouping","refresh","searching","ungrouping","reorder"].indexOf(e.requestType)&&(o=t.getBoundingClientRect().top-this.parent.element.getBoundingClientRect().top,n||o<this.content.offsetHeight&&o>this.parent.getRowHeight())&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(t)),t)&&this.content.querySelector("."+GE)&&!i.length&&(e=!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?this.enableCacheOnInfiniteColumnVirtual()?this.virtualInfiniteData:Pe({},this.parent.getCurrentViewRecords()[this.editedRowIndex]):Pe({},this.getRowObjectByIndex(this.editedRowIndex)),this.virtualData=this.getVirtualEditedData(e)),this.restoreAdd())},vY.prototype.getVirtualEditedData=function(e){var t=[].slice.call(this.parent.element.getElementsByClassName("e-gridform"));if(!(this.parent.editModule&&this.parent.editModule.formObj&&this.parent.editModule.formObj.isDestroyed))for(var i=0;i<t.length;i++)e=this.parent.editModule.getCurrentEditedData(t[parseInt(i.toString(),10)],e);return e},vY.prototype.restoreAdd=function(){var e,t=!this.parent.element.querySelector("."+YE);this.isNormaledit&&this.isAdd&&t&&(t="Top"===this.parent.editSettings.newRowPosition&&this.content.scrollTop<this.parent.getRowHeight(),e="Bottom"===this.parent.editSettings.newRowPosition&&this.parent.pageSettings.currentPage===this.maxPage,t||e)&&(this.parent.isEdit=!1,this.parent.addRecord())},vY.prototype.onDataReady=function(t){je(t.count)||(this.count=t.count,this.maxPage=Math.ceil((this.parent.groupSettings.columns.length&&this.parent.vcRows.length?this.parent.vcRows.length:t.count)/this.parent.pageSettings.pageSize)),this.vgenerator.checkAndResetCache(t.requestType),["refresh","filtering","searching","grouping","ungrouping","reorder",void 0].some(function(e){return t.requestType===e})&&this.refreshOffsets(),this.setVirtualHeight(),this.resetScrollPosition(t.requestType)},vY.prototype.setVirtualHeight=function(e){var t=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.getVisibleColumns().length+this.parent.groupSettings.columns.length-1)+"px":"100%",i=this.offsets[BB(this.parent)&&0!==this.count?this.getGroupedTotalBlocks():this.getTotalBlocks()],n=(!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization&&(i=0),BB(this.parent)&&0!==this.count?this.getGroupedTotalBlocks():this.getTotalBlocks()),n=Math.ceil(n/2),o=Math.round(this.virtualEle.placeholder.getBoundingClientRect().bottom),r=Math.round(this.virtualEle.wrapper.getBoundingClientRect().bottom);(this.currentInfo.page===n||this.currentInfo.page+1===n)&&"down"===this.currentInfo.direction&&r<o&&!this.diff&&(this.diff=o-r),this.diff&&this.currentInfo.page===n&&r<o&&(!this.isAdd||"Bottom"!==this.parent.editSettings.newRowPosition)?(i-=this.diff,this.heightChange=!0):"virtualscroll"===this.requestType&&this.diff&&this.heightChange&&(i-=this.diff,this.heightChange=!1),this.virtualEle.setVirtualHeight(i,t),this.virtualEle&&this.virtualEle.wrapper&&(!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?this.virtualEle.wrapper.style.minHeight="":this.virtualEle.wrapper.style.minHeight=je(i)?"0px":T(this.parent.height)),this.parent.enableColumnVirtualization&&this.header.virtualEle.setVirtualHeight(1,t)},vY.prototype.getPageFromTop=function(i,n){var o=this,r=BB(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks(),s=0;return this.offsetKeys.some(function(e){var t=Number(e),e=i<=o.offsets[""+e]||t===r&&i>o.offsets[""+e];return e&&(o.offsetKeys.length%2!=0&&t.toString()===o.offsetKeys[o.offsetKeys.length-2]&&i<=o.offsets[o.offsetKeys.length-1]&&(t+=1),n.block=t%2==0?1:0,s=Math.max(1,Math.min(o.vgenerator.getPage(t),o.maxPage))),e}),s},vY.prototype.getTranslateY=function(e,t,i,n){void 0===i&&((i={page:this.getPageFromTop(e,{})}).blockIndexes=this.vgenerator.getBlockIndexes(i.page));var o=(i.blockIndexes[0]||1)-1,r=this.getOffset(o),s=this.getOffset(i.blockIndexes[i.blockIndexes.length-1]),n=(n&&(i=this.prevInfo),e<r?this.getOffset(o-1):s<e+t?this.getOffset(1+o):r),s=this.offsets[i.blockIndexes[i.blockIndexes.length-1]]-this.tmpOffsets[i.blockIndexes[0]],e=BB(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();return n+s>this.offsets[parseInt(e.toString(),10)]&&(n-=n+s-this.offsets[parseInt(e.toString(),10)]),1===i.page&&0===i.block&&"up"===i.direction&&(n=0),n=!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?0:n},vY.prototype.getOffset=function(e){return Math.min(0|this.offsets[parseInt(e.toString(),10)],0|this.offsets[this.maxBlock])},vY.prototype.onEntered=function(){var h=this;return function(e,t,i,n,o,r){var s,a,l;("down"!==i&&"up"!==i||h.parent.enableVirtualization||!h.parent.enableColumnVirtualization)&&(!F.isIE||o||!r||h.preventEvent||h.parent.enableVirtualMaskRow||h.parent.showSpinner(),h.prevInfo=h.prevInfo||h.vgenerator.getData(),o=h.getInfoFromView(i,t,n),h.parent.isFrozenGrid()&&"X"===t.axis&&h.parent.getVisibleFrozenLeftCount()>=o.columnIndexes[0]&&h.prevInfo&&h.prevInfo.columnIndexes.toString().includes(o.columnIndexes.toString())||(h.parent.enableVirtualMaskRow&&!h.preventEvent&&(r=parseInt(h.offsetKeys[0],10),a=parseInt(h.offsetKeys[h.offsetKeys.length-1],10),s=h.currentInfo.blockIndexes,o=h.prevInfo&&"X"===t.axis&&h.prevInfo.columnIndexes.toString()===o.columnIndexes.toString()||"down"===i&&h.parent.allowGrouping&&h.parent.groupSettings.columns.length&&(h.parent.allowFiltering&&h.parent.filterSettings.columns.length||h.parent.searchSettings.key.length)&&h.offsetKeys.length<=2,s&&s[0]===r&&"up"===i||s&&s[s.length-1]===a&&"down"===i||o||setTimeout(function(){h.parent.showMaskRow(t.axis)},0)),r="X"===t.axis,s=h.prevInfo.offsets?h.prevInfo.offsets.top:null,a=h.content.getBoundingClientRect().height,i=h.getColumnOffset(r?h.vgenerator.getColumnIndexes()[0]-1:h.prevInfo.columnIndexes[0]-1),h.parent.isFrozenGrid()&&h.parent.enableColumnVirtualization&&h.currentInfo&&h.currentInfo.columnIndexes&&(o=h.currentInfo.columnIndexes[0]-1,l=0,h.parent.getColumns().filter(function(e){e.visible&&"Left"===e.freeze&&(l+=parseInt(e.width.toString(),10))}),o>h.parent.getVisibleFrozenLeftCount())&&(i-=l),r&&(o=Object.keys(h.vgenerator.cOffsets).length-h.prevInfo.columnIndexes.length,i=(o=h.vgenerator.cOffsets[o-1])<i?o:i),!h.parent.enableVirtualization&&h.parent.enableColumnVirtualization?h.virtualEle.adjustTable(i,0):(o=h.getTranslateY(n.top,a,r&&s===n.top?h.prevInfo:void 0,!0),h.virtualEle.adjustTable(i,Math.min(o,h.offsets[h.maxBlock]))),h.parent.enableColumnVirtualization&&(h.header.virtualEle.adjustTable(i,0),h.parent.isFrozenGrid())&&h.resetStickyLeftPos(i)))}},vY.prototype.dataBound=function(){this.parent.notify(ET,{}),this.isSelection&&"upArrow"!==this.activeKey&&"downArrow"!==this.activeKey?this.parent.selectRow(this.selectedRowIndex):(this.activeKey=this.empty,this.requestType=this.empty)},vY.prototype.resetStickyLeftPos=function(e,t){var i=[].slice.call(this.parent.getHeaderContent().querySelectorAll(".e-leftfreeze,.e-rightfreeze,.e-fixedfreeze")).concat([].slice.call((t||this.parent.getContent()).querySelectorAll(".e-leftfreeze,.e-rightfreeze,.e-fixedfreeze"))),n=0,o=0;if(this.parent.getHeaderContent().querySelectorAll(".e-fixedfreeze").length&&(n=this.parent.leftrightColumnWidth("left"),o=this.parent.leftrightColumnWidth("right")),i.length)for(var r=0;r<i.length;r++){var s,a,l=i[parseInt(r.toString(),10)],h=void 0;l.classList.contains("e-rowcell")?h=je(l.getAttribute("aria-colindex"))&&l.querySelector("[e-mappinguid]")?(a=l.querySelector("[e-mappinguid]").getAttribute("e-mappinguid"),this.parent.getColumnByUid(a)):(s=parseInt(l.getAttribute("aria-colindex"),10)-1,this.parent.getColumnByIndex(parseInt(s.toString(),10))):(l.classList.contains("e-headercell")||l.classList.contains("e-filterbarcell"))&&(a=(l.classList.contains("e-filterbarcell")?l:l.querySelector("[e-mappinguid]")).getAttribute("e-mappinguid"),h=this.parent.getColumnByUid(a)),"Left"===h.freeze?l.style.left=h.valueX-e+"px":"Right"===h.freeze?l.style.right=h.valueX+e+"px":"Fixed"===h.freeze&&(l.style.left=n-e+"px",l.style.right=o+e+"px")}this.parent.translateX=e},vY.prototype.rowSelected=function(e,t){var i,n,o,r,s;!this.isSelection&&!t||this.isLastBlockRow(e.rowIndex)||(t=jB(this.content.firstElementChild),i=this.parent.element.getBoundingClientRect().top,r=e.row.getBoundingClientRect().top-i,r=(o=(n=this.content.getBoundingClientRect().height)<r)?r-n:this.initialRowTop-r,o=o?t.height-r:t.height+r,this.virtualEle.adjustTable(t.width,o),r=this.virtualEle.wrapper.getBoundingClientRect(),s=this.content.getBoundingClientRect(),r.top>s.top&&this.virtualEle.adjustTable(t.width,o-(r.top-s.top)),this.content.querySelector("tbody").lastElementChild.getBoundingClientRect().top-i<n?(o+=n-(e.row.getBoundingClientRect().top-i),this.virtualEle.adjustTable(t.width,o-this.parent.getRowHeight()/2)):s.bottom>r.bottom&&this.virtualEle.adjustTable(t.width,o+(s.bottom-r.bottom)),this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.resetStickyLeftPos(t.width)),this.isSelection=!1},vY.prototype.isLastBlockRow=function(e){var t=this.parent.getContent().firstElementChild,t=Math.floor(t.offsetHeight/this.parent.getRowHeight())-1;return this.maxPage*this.parent.pageSettings.pageSize-t<=e},vY.prototype.refreshMaxPage=function(){this.parent.groupSettings.columns.length&&this.parent.vcRows.length&&(this.maxPage=Math.ceil(this.parent.vcRows.length/this.parent.pageSettings.pageSize))},vY.prototype.setVirtualPageQuery=function(e){var t,i=[];this.prevInfo&&this.prevInfo.blockIndexes&&(i=_F(this.prevInfo.blockIndexes)),("sorting"===this.requestType||"delete"===this.requestType)&&i.length&&VF(this.parent)?(e.query.skip(this.parent.pageSettings.pageSize*(i[0]-1)),e.query.take(this.parent.pageSettings.pageSize*i.length),e.skipPage=!0):(t=this.parent.getContent().querySelector(".e-row"),"virtualscroll"===this.requestType&&this.vgenerator.currentInfo.blockIndexes&&(this.vgenerator.currentInfo={}),t&&this.parent.isManualRefresh&&this.currentInfo.blockIndexes&&(3===this.currentInfo.blockIndexes.length||1<i.length)&&(this.vgenerator.startIndex=parseInt(t.getAttribute("aria-rowindex"),10)-1,this.vgenerator.currentInfo=Pe({},this.currentInfo),this.vgenerator.currentInfo.blockIndexes=this.currentInfo.blockIndexes.slice(),(this.vgenerator.includePrevPage=this.currentInfo.blockIndexes[0]%2==0)?(this.vgenerator.startIndex=this.vgenerator.startIndex-this.getBlockSize(),this.vgenerator.currentInfo.blockIndexes.unshift(this.currentInfo.blockIndexes[0]-1)):this.vgenerator.currentInfo.blockIndexes.push(this.currentInfo.blockIndexes[this.currentInfo.blockIndexes.length-1]+1),i=(this.vgenerator.currentInfo.blockIndexes[0]-1)*this.getBlockSize(),t=this.vgenerator.currentInfo.blockIndexes.length*this.getBlockSize(),e.query.skip(i),e.query.take(t),e.skipPage=!0))},vY.prototype.eventListener=function(e){for(var i=this,t=(this.parent[""+e](Y1,this.onDataReady,this),this.parent.addEventListener(qA,this.dataBound.bind(this)),this.parent.addEventListener(WA,this.actionBegin.bind(this)),this.parent.addEventListener(QA,this.actionComplete.bind(this)),this.parent.addEventListener(YA,this.rowSelected.bind(this)),this.parent[""+e](Bx,this.refreshContentRows,this),this.parent[""+e](gE,this.refreshVirtualLazyLoadCache,this),this.parent[""+e](VI,this.selectVirtualRow,this),this.parent[""+e](XI,this.virtualCellFocus,this),this.parent[""+e](KI,this.editActionBegin,this),this.parent[""+e](iT,this.addActionBegin,this),this.parent[""+e]($I,this.restoreEdit,this),this.parent[""+e](JI,this.editSuccess,this),this.parent[""+e](eT,this.refreshCache,this),this.parent[""+e](tT,this.resetIsedit,this),this.parent[""+e](nT,this.getVirtualData,this),this.parent[""+e](ZI,this.editCancel,this),this.parent[""+e](GT,this.refreshMaxPage,this),this.parent[""+e](YT,this.setVirtualPageQuery,this),this.parent[""+e](XT,this.selectRowOnContextOpen,this),this.parent[""+e]($T,this.resetVirtualFocus,this),this.parent[""+e](eE,this.refreshCells,this),this.parent[""+e](tE,this.scrollToEdit,this),this.actions),n=0;n<t.length;n++)this.parent[""+e](t[parseInt(n.toString(),10)]+"-begin",this.onActionBegin,this);var o=function(){i.observer.observe(function(e){return i.scrollListener(e)},i.onEntered());var e,t=i.parent;t.enablePersistence&&t.scrollPosition&&(0<t.scrollPosition.top&&(i.content.scrollTop=t.scrollPosition.top,e={direction:"down",sentinel:i.observer.sentinelInfo.down,offset:t.scrollPosition,focusElement:t.element},i.scrollListener(e)),t.enableColumnVirtualization)&&(i.content.scrollLeft=t.scrollPosition.left),i.parent.off(X1,o)};this.parent.on(X1,o,this)},vY.prototype.refreshVirtualLazyLoadCache=function(e){var t,i,n,o=this.currentInfo.blockIndexes;je(this.currentInfo.blockIndexes)&&(o=[1,2]);for(var r=0;r<o.length;r++)for(var s=this.vgenerator.cache[o[parseInt(r.toString(),10)]],a=0;a<s.length;a++)if(s[parseInt(a.toString(),10)].uid===e.uid){t=o[parseInt(r.toString(),10)],i=a,n=s;break}e.count?this.vgenerator.cache[parseInt(t.toString(),10)].splice(i+1,e.count):e.rows&&e.rows.length&&(this.vgenerator.cache[parseInt(t.toString(),10)]=[].slice.call(n.slice(0,i+1)).concat([].slice.call(e.rows)).concat([].slice.call(n.slice(i+1,n.length)))),this.refreshOffsets()},vY.prototype.scrollToEdit=function(e){var t=!0,i=(this.validationCheck=!0,this.isAdd&&0<this.content.scrollTop&&(t=!1,i=Object.keys(this.offsets),this.content.scrollTop="Top"===this.parent.editSettings.newRowPosition?0:this.offsets[i.length-1]),this.parent.getRowByIndex(this.editedRowIndex));i||je(this.editedRowIndex)||i&&this.isRowInView(i)||(i=this.parent.getRowHeight(),je(i=this.editedRowIndex*i))||(t=!1,this.content.scrollTop=i),e&&t&&(i=this.vgenerator.cOffsets[e.index-this.parent.getVisibleFrozenColumns()-1],this.parent.enableColumnVirtualization||(i=this.parent.getHeaderContent().querySelector('.e-headercelldiv[e-mappinguid="'+e.uid+'"]').parentElement.offsetLeft),this.parent.enableColumnVirtualization&&this.parent.getVisibleFrozenLeftCount()&&(i-=this.parent.leftrightColumnWidth("left")),this.content.scrollLeft=this.parent.enableRtl?-Math.abs(i):i),e&&!t&&(this.validationCol=e)},vY.prototype.refreshCells=function(e){e.cells=this.vgenerator.generateCells(e.foreignKeyData)},vY.prototype.resetVirtualFocus=function(e){this.isCancel=e.isCancel},vY.prototype.getVirtualData=function(e){var t,i;this.isNormaledit&&(t=this.parent.element.querySelector('.e-griderror:not([style*="display: none"])'),i=Object.keys(this.virtualData),e.isScroll=0!==i.length&&this.currentInfo.sentinelInfo&&"X"===this.currentInfo.sentinelInfo.axis,t||(this.virtualData=(i.length?this:e).virtualData,this.getVirtualEditedData(this.virtualData),e.virtualData=this.virtualData,e.isAdd=this.isAdd||this.parent.editSettings.showAddNewRow,e.isCancel=this.isCancel))},vY.prototype.selectRowOnContextOpen=function(e){this.isContextMenuOpen=e.isOpen},vY.prototype.editCancel=function(e){var t=KB(this.parent,e.data);je(t)||(e.data=this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)])},vY.prototype.editSuccess=function(e){this.isNormaledit&&(!this.isAdd&&e.data&&this.updateCurrentViewData(e.data),this.isAdd=!1)},vY.prototype.updateCurrentViewData=function(e){var t=KB(this.parent,e);je(t)||(this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)]=e)},vY.prototype.actionBegin=function(e){"virtualscroll"!==e.requestType&&(this.requestType=e.requestType),e.cancel||this.parent.notify(PT,e)},vY.prototype.virtualCellFocus=function(e){var t,i,n,o,r,s=document.activeElement;s.classList.contains(LE)||!(s instanceof HTMLInputElement)&&je(s.closest(".e-templatecell"))||(s=s.closest(".e-rowcell")),this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&s&&(s.classList.contains(LE)||!je(A(s,XE)))&&e&&("shiftEnter"===e.action||"upArrow"===e.action||"downArrow"===e.action)?(t=(i=this.parent.getContent().firstElementChild).getBoundingClientRect(),n=z(s,"tr"),o=je(r="downArrow"===e.action?n.nextElementSibling:n.previousElementSibling)?void 0:r.getBoundingClientRect(),je(r)||"downArrow"===e.action&&o.bottom>t.bottom||("upArrow"===e.action||"shiftEnter"===e.action)&&o.top<t.top?(this.activeKey=e.action,this.parent.focusModule.virtualSelectionInfo={isPending:je(r),direction:e.action,event:e},r=je(r)?this.parent.getRowHeight():"downArrow"===e.action?o.bottom-t.bottom:t.top-o.top,i.scrollTop="downArrow"===e.action?i.scrollTop+r:i.scrollTop-r):this.activeKey=this.empty):s&&s.classList.contains(LE)&&e&&("upArrow"===e.action||"downArrow"===e.action||"shiftEnter"===e.action)&&(t=parseInt(s.parentElement.getAttribute(nD),10)-1,!e||"upArrow"!==e.action&&"shiftEnter"!==e.action&&"downArrow"!==e.action||(i=this.parent.getContent().firstElementChild,"downArrow"===e.action?t+=1:--t,this.rowIndex=t,this.cellIndex=parseInt(s.getAttribute(iD),10)-1,n=this.parent.getRowByIndex(t),o=this.parent.pageSettings.currentPage,r=Math.floor(i.offsetHeight/this.parent.getRowHeight())-1,s=!1,(s=je(n)&&(s=!0,"downArrow"===e.action&&o===this.maxPage-1||("upArrow"===e.action||"shiftEnter"===e.action)&&1===o)?!1:s)||GB(n,this.parent)&&"downArrow"===e.action||YB(n,2*this.parent.getRowHeight())&&("upArrow"===e.action||"shiftEnter"===e.action)?(this.activeKey=e.action,i.scrollTop="downArrow"===e.action?(t-r)*this.parent.getRowHeight():t*this.parent.getRowHeight()):this.activeKey=this.empty,this.parent.selectionSettings.checkboxOnly)||this.parent.selectRow(t))},vY.prototype.editActionBegin=function(e){this.editedRowIndex=e.index;var t=!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?Pe({},this.parent.getCurrentViewRecords()[e.index]):Pe({},this.getRowObjectByIndex(e.index)),i=Object.keys(this.virtualData);e.data=i.length&&!this.parent.editSettings.showAddNewRow?this.virtualData:this.isInfiniteColumnvirtualization()?e.data:t,this.enableCacheOnInfiniteColumnVirtual()&&(this.virtualInfiniteData=e.data),e.isScroll=0!==i.length&&this.currentInfo.sentinelInfo&&"X"===this.currentInfo.sentinelInfo.axis},vY.prototype.getEditedRowObject=function(){for(var e,t=this.parent.vcRows,i=0;i<t.length;i++)t[parseInt(i.toString(),10)].index===this.editedRowIndex&&(e=t[parseInt(i.toString(),10)]);return e},vY.prototype.refreshCache=function(e){var t,i,n;this.isInfiniteColumnvirtualization()||(t=Math.ceil((this.editedRowIndex+1)/this.getBlockSize()),this.parent.allowPaging&&this.parent.enableColumnVirtualization&&(t=Math.ceil((this.editedRowIndex+1+(this.parent.pageSettings.currentPage-1)*this.parent.pageSettings.pageSize)/this.getBlockSize())),i=this.parent.allowPaging&&this.parent.enableColumnVirtualization?this.editedRowIndex%this.getBlockSize():this.editedRowIndex-(t-1)*this.getBlockSize(),this.parent.groupSettings.columns.length?(n=this.getEditedRowObject())&&(n.data=e.data):this.vgenerator.cache[parseInt(t.toString(),10)][parseInt(i.toString(),10)].data=e.data)},vY.prototype.actionComplete=function(t){var e;(this.parent.enableVirtualization||this.parent.enableColumnVirtualization)&&((e=["delete","save","cancel"]).some(function(e){return e===t.requestType})&&(this.refreshOffsets(),this.refreshVirtualElement()),this.isNormaledit&&(["sorting","filtering","grouping","refresh","searching","ungrouping","reorder"].some(function(e){return e===t.requestType})||e.some(function(e){return e===t.requestType}))&&(this.isCancel=!0,this.isAdd=this.parent.editSettings.showAddNewRow,this.editedRowIndex=this.empty,this.virtualData={},this.virtualInfiniteData={},this.parent.editModule)&&(this.parent.editModule.editModule.previousData=void 0),this.parent.enableColumnVirtualization)&&"filterAfterOpen"===t.requestType&&this.currentInfo.columnIndexes&&0<this.currentInfo.columnIndexes[0]&&this.parent.resetFilterDlgPosition(t.columnName)},vY.prototype.resetIsedit=function(){this.parent.enableVirtualization&&this.isNormaledit&&(this.parent.editSettings.allowEditing&&Object.keys(this.virtualData).length||this.parent.editSettings.allowAdding&&this.isAdd)&&(this.parent.isEdit=!0)},vY.prototype.scrollAfterEdit=function(){var e,t;this.parent.editModule&&this.parent.editSettings.allowEditing&&this.isNormaledit&&this.parent.element.querySelector(".e-gridform")&&(t=this.parent.element.querySelector("."+GE),e=this.parent.element.querySelector("."+YE),t||e)&&(e=Pe({},t?this.getRowObjectByIndex(this.editedRowIndex):this.emptyRowData),t=Object.keys(this.virtualData),this.virtualData=t.length?this.getVirtualEditedData(this.virtualData):this.getVirtualEditedData(e))},vY.prototype.createEmptyRowdata=function(){var t=this;this.parent.columnModel.filter(function(e){t.emptyRowData[e.field]=t.empty})},vY.prototype.addActionBegin=function(e){var t;this.isNormaledit&&(Object.keys(this.emptyRowData).length||this.createEmptyRowdata(),this.isAdd=!0,t=this.parent.pageSettings.currentPage,!this.parent.frozenRows&&0<this.content.scrollTop&&"Top"===this.parent.editSettings.newRowPosition&&(this.isAdd=!0,this.onActionBegin(),e.startEdit=!1,this.content.scrollTop=0),t<this.maxPage-1)&&"Bottom"===this.parent.editSettings.newRowPosition&&(this.isAdd=!0,this.parent.setProperties({pageSettings:{currentPage:this.maxPage-1}},!0),e.startEdit=!1,this.content.scrollTop=this.offsets[this.offsetKeys.length])},vY.prototype.getRowObjectByIndex=function(e){return this.getRowCollection(e,!0)},vY.prototype.getBlockSize=function(){return this.parent.pageSettings.pageSize>>1},vY.prototype.getBlockHeight=function(){return this.getBlockSize()*this.parent.getRowHeight()},vY.prototype.isEndBlock=function(e){var t=BB(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();return t<=e||e===t-1},vY.prototype.isOddPageSize=function(){return this.parent.pageSettings.pageSize%2!=0},vY.prototype.getOddBlockSize=function(){return this.isOddPageSize()?this.parent.pageSettings.pageSize/2:this.getBlockSize()},vY.prototype.getGroupedTotalBlocks=function(){var e=this.parent.vcRows;return Math.floor(e.length/this.getOddBlockSize()<1?1:e.length/this.getOddBlockSize())},vY.prototype.getTotalBlocks=function(){return Math.ceil(this.count/this.getOddBlockSize())},vY.prototype.getColumnOffset=function(e){return 0|this.vgenerator.cOffsets[parseInt(e.toString(),10)]},vY.prototype.getModelGenerator=function(){return new uY(this.parent)},vY.prototype.resetScrollPosition=function(t){this.actions.some(function(e){return e===t})&&(this.preventEvent=0!==this.content.scrollTop,this.content.scrollTop=0),"virtualscroll"!==t&&(this.isAdd=!1)},vY.prototype.onActionBegin=function(e){this.parent.setProperties({pageSettings:{currentPage:1}},!0)},vY.prototype.getRows=function(){return this.isInfiniteColumnvirtualization()?this.getInfiniteRows():this.vgenerator.getRows()},vY.prototype.getRowByIndex=function(t){var e;if(BB(this.parent))if(!je(t)&&this.parent.enableVirtualization&&this.parent.groupSettings.columns.length)for(var i=0;i<this.parent.getDataRows().length;i++)parseInt(this.parent.getDataRows()[parseInt(i.toString(),10)].getAttribute(nD),10)-1===t&&(e=this.parent.getDataRows()[parseInt(i.toString(),10)]);else e=je(t)?void 0:this.parent.getDataRows()[parseInt(t.toString(),10)];else!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?e=je(t)?void 0:this.enableCacheOnInfiniteColumnVirtual()?this.parent.getDataRows().find(function(e){return parseInt(e.getAttribute(nD),10)-1===t}):this.parent.getDataRows()[parseInt(t.toString(),10)]:this.prevInfo&&(e=this.getRowCollection(t,!1));return e},vY.prototype.getMovableVirtualRowByIndex=function(e){return this.getRowCollection(e,!1)},vY.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1)},vY.prototype.getRowCollection=function(e,t){var i=(this.prevInfo.blockIndexes[0]-1)*this.getBlockSize(),n=(this.parent.pageSettings.pageSize%2!=0&&(i+=Math.floor(i/this.getBlockSize()/2)),this.parent.getDataRows()),o=t?this.parent.getCurrentViewRecords():n,o=(t&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&(i=parseInt(this.parent.getRows()[0].getAttribute(nD),10)-1,o=o.filter(function(e){return je(e.items)})),o[e-(i=!t&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&n.length?parseInt(n[0].getAttribute(nD),10)-1:i)]);return o=this.parent.frozenRows&&1<this.parent.pageSettings.currentPage?t?e<=this.parent.frozenRows?this.parent.getRowsObject()[parseInt(e.toString(),10)].data:o:e<=this.parent.frozenRows?n[parseInt(e.toString(),10)]:n[e-i+this.parent.frozenRows]:o},vY.prototype.getVirtualRowIndex=function(e){var t=this.prevInfo.blockIndexes,i=(t[0]-1)*this.getBlockSize();if(this.parent.enableVirtualization&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length)for(var n=this.vgenerator.cache[t[0]],o=0;o<n.length;o++)if(n[""+o].isDataRow){i=n[""+o].index;break}return i+e},vY.prototype.refreshOffsets=function(){for(var e=this.parent,t=0,i=this.getBlockSize(),n=this.getOddBlockSize(),o=BB(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks(),r=(this.prevHeight=this.offsets[parseInt(o.toString(),10)],this.maxBlock=o%2==0?o-2:o-1,this.offsets={},Array.apply(null,Array(o)).map(function(){return++t})),s=0;s<r.length;s++){var a=(this.vgenerator.cache[r[parseInt(s.toString(),10)]]||[]).length,l=BB(this.parent)?this.isOddPageSize()?Math.ceil(e.vcRows.length%n):e.vcRows.length%i:this.isOddPageSize()?Math.ceil(this.count%n):this.count%i,a=!BB(this.parent)&&r[parseInt(s.toString(),10)]in this.vgenerator.cache?a*this.parent.getRowHeight():l&&r[parseInt(s.toString(),10)]===o?l*this.parent.getRowHeight():this.getBlockHeight();!this.isOddPageSize()||r[parseInt(s.toString(),10)]in this.vgenerator.cache||l&&r[parseInt(s.toString(),10)]===o||(a=(r[parseInt(s.toString(),10)]%2!=0?Math.floor(n):Math.ceil(n))*this.parent.getRowHeight()),this.offsets[r[parseInt(s.toString(),10)]]=(0|this.offsets[r[parseInt(s.toString(),10)]-1])+a,this.tmpOffsets[r[parseInt(s.toString(),10)]]=0|this.offsets[r[parseInt(s.toString(),10)]-1]}this.offsetKeys=Object.keys(this.offsets),BB(this.parent)&&(this.parent.vGroupOffsets=this.offsets),this.parent.enableColumnVirtualization&&this.vgenerator.refreshColOffsets()},vY.prototype.refreshVirtualElement=function(){this.vgenerator.refreshColOffsets(),this.setVirtualHeight()},vY.prototype.setVisible=function(e){var t,i=this.parent,n=[];(n=this.getRows()).some(function(e){return e.isDataRow&&(t=e),e.isDataRow});for(var o=!0,r=(!i.groupSettings.columns.length&&t&&(o=!1),i.getDataRows()),s=0,a=e.length;s<a;s++){var l=e[parseInt(s.toString(),10)],h=i.getNormalizedColumnIndex(l.uid),d=!0===l.visible?"":"none",p=this.getColGroup().children;-1!==h&&t&&h<t.cells.length&&gt(p[parseInt(h.toString(),10)],{display:d}),o||(p=void 0,(p=l.width?l.visible?this.virtualEle.wrapper.offsetWidth+parseInt(l.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(l.width.toString(),10):p)>i.width?(this.setDisplayNone(r,h,d,n),this.parent.enableColumnVirtualization&&this.virtualEle.setWrapperWidth(p+""),this.refreshVirtualElement()):o=!0),!this.parent.invokedFromMedia&&l.hideAtMedia&&this.parent.updateMediaColumns(l),this.parent.invokedFromMedia=!1}o?this.refreshContentRows({requestType:"refresh"}):this.parent.notify(OI,{rows:n,args:{isFrozen:!1,rows:n}})},vY.prototype.selectVirtualRow=function(t){var e,i,n=this,o=BB(this.parent)?this.vgenerator.recordsCount:this.count;t.isAvailable=t.selectedIndex<o,!t.isAvailable||this.isContextMenuOpen||"upArrow"===this.activeKey||"downArrow"===this.activeKey||this.isSelection||this.requestTypes.some(function(e){return e===n.requestType})||this.parent.selectionModule.isInteracted||(o=this.parent.getRowByIndex(t.selectedIndex),i=this.parent.getRowHeight(),o&&this.isRowInView(o))||(this.isSelection=!0,this.selectedRowIndex=t.selectedIndex,o=t.selectedIndex*i,BB(this.parent)?(o=-1!==(e=this.parent.vcRows.findIndex(function(e){return e.index===t.selectedIndex}))?e*i:void 0,this.isSelection=-1!==e&&this.isSelection):this.parent.groupSettings.columns.length&&this.parent.getDataModule().isRemote()&&(i=Math.ceil((t.selectedIndex+1)/this.parent.pageSettings.pageSize),e=this.vgenerator.getBlockIndexes(i),o=this.offsets[e[0]]),je(o))||(i=this.content.scrollTop<o?"down":"up",this.selectRowIndex=t.selectedIndex,this.content.scrollTop=o,this.isSelectionScroll=this.observer.check(i)),this.requestType=this.empty},vY.prototype.isRowInView=function(e){var t=e.getBoundingClientRect().top,e=e.getBoundingClientRect().bottom;return t>=this.content.getBoundingClientRect().top&&e<=this.content.getBoundingClientRect().bottom},vY);function vY(e,t){e=fY.call(this,e,t)||this;return e.prevHeight=0,e.startIndex=0,e.preStartIndex=0,e.preventEvent=!1,e.actions=["filtering","searching","grouping","ungrouping"],e.offsets={},e.tmpOffsets={},e.virtualEle=new SY,e.offsetKeys=[],e.isFocused=!1,e.isSelection=!1,e.isBottom=!1,e.isBottomNotify=!1,e.diff=0,e.heightChange=!1,e.isTop=!1,e.empty=void 0,e.isCancel=!1,e.requestTypes=["beginEdit","cancel","delete","add","save","sorting"],e.isNormaledit="Normal"===e.parent.editSettings.mode,e.virtualData={},e.virtualInfiniteData={},e.emptyRowData={},e.isContextMenuOpen=!1,e.isSelectionScroll=!1,e.validationCheck=!1,e.firstCellFocus=!1,e.prevPage=0,e.prevCurrentInfo={},e.locator=t,e.eventListener("on"),e.widthServices=t.getService("widthService"),e.parent.on(Sx,e.setVisible,e),e.vgenerator=e.generator,e}l9(CY,bY=OD),CY.prototype.renderTable=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector("."+VE))),bY.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.content=this.getPanel().querySelector("."+VE),this.virtualEle.content.style.position="relative",this.virtualEle.renderWrapper(),this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||!this.parent.enableColumnVirtualization?this.virtualEle.renderPlaceHolder("absolute"):this.virtualEle.renderPlaceHolder()},CY.prototype.appendContent=function(e){this.virtualEle.wrapper.appendChild(e)},CY.prototype.refreshUI=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector("."+VE))),bY.prototype.refreshUI.call(this)},CY.prototype.setVisible=function(e){for(var t,i=this.parent,n=0,o=e.length;n<o;n++){var r=e[parseInt(n.toString(),10)],s=i.getNormalizedColumnIndex(r.uid),a=r.visible?"":"none",l=this.getColGroup().children;i.getColumnByField(r.field)&&gt(l[parseInt(s.toString(),10)],{display:a}),i.enableColumnVirtualization&&!i.groupSettings.columns.length&&(l=void 0,(l=r.visible?this.virtualEle.wrapper.offsetWidth+parseInt(r.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(r.width.toString(),10))>i.width)?(this.setDisplayNone(r,a),this.virtualEle.setWrapperWidth(l+""),this.gen.refreshColOffsets()):t=!0,t&&this.refreshUI()}},CY.prototype.setDisplayNone=function(e,t){for(var i=this.getTable(),n=0,o=[].slice.apply(i.querySelectorAll("th.e-headercell"));n<o.length;n++){var r=o[n];if(r.querySelector("[e-mappinguid]")&&r.querySelector("[e-mappinguid]").getAttribute("e-mappinguid")===e.uid){gt(r,{display:t}),""===t&&q([r],"e-hide");break}}};var bY,wY=CY;function CY(e,t){var i=bY.call(this,e,t)||this;return i.virtualEle=new SY,i.isMovable=!1,i.gen=new uY(i.parent),i.parent.on(Sx,i.setVisible,i),i.parent.on(Bx,function(e){return"X"===e.virtualInfo.sentinelInfo.axis?i.refreshUI():null},i),i}AY.prototype.renderWrapper=function(e){this.wrapper=Q("div",{className:"e-virtualtable"}),this.wrapper.style.minHeight=T(e),this.wrapper.appendChild(this.table),this.content.appendChild(this.wrapper)},AY.prototype.renderPlaceHolder=function(e){void 0===e&&(e="relative"),this.placeholder=Q("div",{className:"e-virtualtrack"}),this.placeholder.style.position=e,this.content.appendChild(this.placeholder)},AY.prototype.renderFrozenWrapper=function(e){this.wrapper=Q("div",{className:"e-virtualtable"}),this.wrapper.style.cssText="min-height:"+T(e)+"; display: flex;",this.content.appendChild(this.wrapper)},AY.prototype.renderFrozenPlaceHolder=function(){this.placeholder=Q("div",{className:"e-virtualtrack"}),this.content.appendChild(this.placeholder)},AY.prototype.adjustTable=function(e,t){this.wrapper.style.transform="translate("+e+"px, "+t+"px)"},AY.prototype.setWrapperWidth=function(e,t){!e||-1!==e.indexOf("%")||this.content.getBoundingClientRect().width<parseInt(e,10)||(t=!(e=void 0)),this.wrapper.style.width=e?e+"px":t?"100%":""},AY.prototype.setVirtualHeight=function(e,t){this.placeholder.style.height=je(e)?"0px":e+"px",!t||-1!==t.indexOf("%")||this.content.getBoundingClientRect().width<parseInt(t,10)||(t="100%"),this.placeholder.style.width=t},AY.prototype.setFreezeWrapperWidth=function(e,t,i){e.style.width=t?t+"px":i?"100%":""};var SY=AY;function AY(){}IY.prototype.getModuleName=function(){return"virtualscroll"},IY.prototype.instantiateRenderer=function(){this.parent.log(["limitation","virtual_height"],"virtualization");var e=this.locator.getService("rendererFactory");this.parent.enableColumnVirtualization&&e.addRenderer(RA.Header,new wY(this.parent,this.locator)),e.addRenderer(RA.Content,new yY(this.parent,this.locator)),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||this.ensurePageSize()},IY.prototype.ensurePageSize=function(){var e=this.parent.getRowHeight(),t=(this.parent.height.toString().indexOf("%")<0?this.parent:this.parent.element.getBoundingClientRect()).height,t=(this.blockSize=~~(parseFloat(t.toString())/e),2*this.blockSize),e=this.parent.pageSettings.pageSize;this.parent.setProperties({pageSettings:{pageSize:e<t?t:e}},!0)},IY.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(q1,this.instantiateRenderer,this),this.parent.on(xx,this.refreshVirtualElement,this),this.parent.on(nE,this.createVirtualValidationForm,this),this.parent.on(oE,this.virtualEditFormValidation,this),this.parent.on(Cx,this.destroy,this))},IY.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(q1,this.instantiateRenderer),this.parent.off(xx,this.refreshVirtualElement),this.parent.off(nE,this.createVirtualValidationForm),this.parent.off(oE,this.virtualEditFormValidation),this.parent.off(Cx,this.destroy))},IY.prototype.getCurrentEditedData=function(e){e={virtualData:Pe({},{},e,!0),isAdd:!1,isScroll:!1,endEdit:!0};return this.parent.notify(nT,e),e.virtualData},IY.prototype.createVirtualValidationForm=function(e){var t=this.parent;if(t.enableVirtualization&&"Normal"===t.editSettings.mode){for(var i=t.columns,n=new yD(this.locator,null,this.parent),o=Pe({},{},t.getRowObjectFromUID(e.uid),!0),r=(t.notify(eE,o),e.argsCreator(this.getCurrentEditedData(e.prevData),{},!1)),s=(r.isCustomFormValidation=!0,r.row=n.render(o,i),e.renderer.update(r),{}),a=0;a<i.length;a++)i[parseInt(a.toString(),10)].visible&&i[parseInt(a.toString(),10)].validationRules&&fF(i[parseInt(a.toString(),10)],0,s,{},{},i.length,!0);r.form.classList.add("e-virtual-validation"),t.editModule.virtualFormObj=t.editModule.createFormObj(r.form,s)}},IY.prototype.virtualEditFormValidation=function(e){var t=this.parent,i=t.element.querySelector('.e-griderror:not([style*="display: none"])');if(t.editModule.virtualFormObj)if(i&&"none"!==i.style.display){var n=i.getBoundingClientRect(),o=t.element.querySelectorAll(".e-gridform"),r=o[0],s=t.getContent().getBoundingClientRect().left;1<o.length&&(r=o[1]),(n.left<s||n.right>t.element.offsetWidth)&&(a=r.querySelector('.e-tooltip-wrap:not([style*="display: none"])'),this.scrollToEdit(a,{editIdx:e.editIdx,addIdx:e.addIdx},!0))}else if(t.editModule.virtualFormObj&&(!i||"none"===i.style.display)){for(var a,l=t.editModule.virtualFormObj.element.querySelectorAll('.e-tooltip-wrap:not([style*="display: none"])'),h=0;h<l.length;h++)ue(l[parseInt(h.toString(),10)]);this.setEditedDataToValidationForm(t.editModule.virtualFormObj.element,this.getCurrentEditedData(e.prevData)),e.isValid=t.editModule.virtualFormObj.validate(),e.isValid||(a=t.editModule.virtualFormObj.element.querySelector('.e-tooltip-wrap:not([style*="display: none"])'),this.scrollToEdit(a,{editIdx:e.editIdx,addIdx:e.addIdx}))}},IY.prototype.scrollToEdit=function(e,t,i){var n=this.parent;if(e){var o=n.columnModel,r=cB(e.id).split("_")[0],s=n.getColumnByField(r),e=this.parent.getContent().firstElementChild.scrollTop,n=n.getRowByIndex(t.editIdx);if(!je(t.addIdx)&&0<e||!je(t.editIdx)&&!n||i||!s){for(var a=void 0,l=0;l<o.length&&!s;l++)if(o[parseInt(l.toString(),10)].field===r){a=o[parseInt(l.toString(),10)];break}this.parent.notify(tE,a=i?s:a)}}},IY.prototype.setEditedDataToValidationForm=function(e,t){for(var i=[].slice.call(e.getElementsByClassName("e-field")),n=0,o=i.length;n<o;n++){var r=AF(this.parent,i[parseInt(n.toString(),10)].getAttribute("e-mappinguid"));r.field&&(r=je(r=R(r.field,t))?"":r,i[parseInt(n.toString(),10)].value=r)}},IY.prototype.refreshVirtualElement=function(e){this.parent.enableColumnVirtualization&&"resize"===e.module&&this.locator.getService("rendererFactory").getRenderer(RA.Content).refreshVirtualElement()},IY.prototype.destroy=function(){this.removeEventListener()};var xY=IY;function IY(e,t){this.parent=e,this.locator=t,this.addEventListener()}EY.prototype.addNew=function(e,t){var i,n;this.isEdit=!1,i=((this.parent.frozenRows||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow)&&"Top"===this.parent.editSettings.newRowPosition?this.parent.getHeaderTable():this.parent.getContentTable()).querySelector(oD),t.row=this.parent.createElement("tr",{className:"e-row e-addedrow"}),this.parent.getContentTable().querySelector(".e-emptyrow")&&!this.parent.editSettings.showAddNewRow&&((n=this.parent.getContentTable().querySelector(".e-emptyrow")).parentNode.removeChild(n),this.parent.frozenRows)&&this.parent.element.querySelector(".e-frozenrow-empty")&&this.parent.element.querySelector(".e-frozenrow-empty").classList.remove("e-frozenrow-empty"),"Top"===this.parent.editSettings.newRowPosition?i.insertBefore(t.row,i.firstChild):i.appendChild(t.row),t.row.appendChild(this.getEditElement(e,!1,void 0,t,!0)),this.parent.editModule.checkLastRow(t.row,t)},EY.prototype.update=function(e,t){this.isEdit=!0;var i=[].slice.call(t.row.querySelectorAll("td.e-rowcell"));t.row.innerHTML="",t.row.appendChild(this.getEditElement(e,!0,i,t,!0)),t.row.classList.add(GE),this.parent.editModule.checkLastRow(t.row,t)},EY.prototype.getEditElement=function(e,t,i,n,o){var r=this.parent,s=0,a=je(r.detailTemplate)&&je(r.childGrid)?0:1,l=(r.allowGrouping&&(s=r.groupSettings.columns.length),this.parent.createElement("td",{className:"e-editcell e-normaledit",attrs:{colspan:(r.getCurrentVisibleColumns(this.parent.enableColumnVirtualization).length+this.parent.getIndentCount()).toString()}})),h=n.form=this.parent.createElement("form",{id:r.element.id+"EditForm",className:"e-gridform"});if(this.parent.editSettings.template)this.appendChildren(h,n.rowData,o);else{var o,d=((o=this.parent.createElement("table",{className:"e-table e-inline-edit",attrs:{cellspacing:"0.25",role:"grid"}})).appendChild(r.getContentTable().querySelector(rD).cloneNode(!0)),this.parent.createElement(oD,{attrs:{role:"rowgroup"}})),p=this.parent.createElement("tr"),c=(this.parent.rowHeight&&(p.style.height=this.parent.rowHeight+"px"),0);for(a&&p.insertBefore(this.parent.createElement("td",{className:"e-detailrowcollapse"}),p.firstChild),r.isRowDragable()&&p.appendChild(this.parent.createElement("td",{className:"e-dragindentcell"}));c<s;)p.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),c++;for(var u=0,c=0,g=!0,m=n.isCustomFormValidation?this.parent.columnModel:r.getColumns();t&&u<i.length&&c<m.length||c<m.length;){var f,y=t&&i[parseInt(u.toString(),10)]?i[parseInt(u.toString(),10)].getAttribute("colspan"):null,v=m[parseInt(c.toString(),10)],b=e[v.uid].value,w=this.parent.createElement("td",{className:LE,attrs:{colspan:y||""}});w.style.cssText=v.textAlign?"text-align: "+v.textAlign+";":"",v.visible?(w.appendChild(e[v.uid]),"Vertical"===this.parent.rowRenderingMode&&(zP(w,{"data-cell":v.headerText}),0===c)&&w.classList.add("e-responsive-editcell"),"booleanedit"===v.editType?w.classList.add("e-boolcell"):(v.commands||v.commandsTemplate)&&U([w],"e-unboundcell"),this.parent.enableRtl||"Vertical"!==r.gridLines&&"Both"!==r.gridLines||!s||!g||(w.classList.add("e-grid-group-first-cell"),g=!1)):w.classList.add("e-hide"),this.parent.isFrozenGrid()&&(uF(this.parent,v,w),this.parent.isSpan&&(f=w.getAttribute("colspan")?parseInt(w.getAttribute("colspan"),10):1,pF(this.parent,v,w,f)),this.parent.enableColumnVirtualization)&&("Left"!==v.freeze||je(v.valueX)?"Right"!==v.freeze||je(v.valueX)?"Fixed"===v.freeze&&(w.style.left=this.parent.leftrightColumnWidth("left")-this.parent.translateX+"px",w.style.right=this.parent.leftrightColumnWidth("right")+this.parent.translateX+"px"):w.style.right=v.valueX+this.parent.translateX+"px":w.style.left=v.valueX-this.parent.translateX+"px"),w.setAttribute("aria-label",b+this.parent.localeObj.getConstant("ColumnHeader")+v.headerText),p.appendChild(w),c=y?c+parseInt(y,10):c+1,u++}hF(p),d.appendChild(p),o.appendChild(d),h.appendChild(o)}return l.appendChild(h),l},EY.prototype.removeEventListener=function(){},EY.prototype.appendChildren=function(e,t,i){t=Pe({},t,{isAdd:!this.isEdit,isFrozen:i},!0),i=this.parent.element.id+"editSettingsTemplate";!this.parent.isReact||"string"==typeof this.parent.editSettings.template||this.parent.editSettings.template.prototype&&this.parent.editSettings.template.prototype.CSPTemplate?eB(e,this.parent.getEditTemplate()(t,this.parent,"editSettingsTemplate",i,null,null,null,this.parent.root)):(this.parent.getEditTemplate()(t,this.parent,"editSettingsTemplate",i,null,null,e),this.parent.renderTemplates())};var TY=EY;function EY(e){this.parent=e}MY.prototype.update=function(e,t){var i,n;this.parent.isReact&&t.columnObject&&t.columnObject.template&&(i=t.cell.parentElement,n=t.cell.cloneNode(!0),i.insertBefore(n,t.cell),n.focus(),t.cell.remove(),t.cell=n),t.cell.setAttribute("aria-label",t.cell.innerHTML+this.parent.localeObj.getConstant("ColumnHeader")+t.columnObject.field),t.cell.innerHTML="",t.cell.appendChild(this.getEditElement(e,t)),t.cell.classList.add("e-editedbatchcell"),mt(t.row,[GE,"e-batchrow"],[])},MY.prototype.getEditElement=function(e,t){var i=this.parent,i=this.parent.createElement("form",{id:i.element.id+"EditForm",className:"e-gridform"});return i.appendChild(e[t.columnObject.uid]),"booleanedit"===t.columnObject.editType&&t.cell.classList.add("e-boolcell"),t.columnObject.editType||t.cell.classList.add("e-inputbox"),i};var DY=MY;function MY(e){this.parent=e}PY.prototype.setLocaleObj=function(){this.l10n=this.serviceLocator.getService("localization")},PY.prototype.addNew=function(e,t){this.isEdit=!1,this.createDialog(e,t)},PY.prototype.update=function(e,t){this.isEdit=!0,this.createDialog(e,t)},PY.prototype.createDialogHeader=function(e){var t,i=this,n=this.parent;return this.parent.enableAdaptiveUI?((t=new NM(this.parent,this.serviceLocator)).action=this.isEdit?NA.isEdit:NA.isAdd,t.renderResponsiveHeader(void 0,e)):n.editSettings.headerTemplate?ao(function(){return i.getDialogEditTemplateElement("HeaderTemplate",e).outerHTML}):this.isEdit?this.l10n.getConstant("EditFormTitle")+e.primaryKeyValue[0]:this.l10n.getConstant("AddFormTitle")},PY.prototype.createDialog=function(e,t){var i=this,n=this.parent;this.dialog=this.parent.createElement("div",{id:n.element.id+"_dialogEdit_wrapper"}),this.dialog.style.width="auto",n.enableAdaptiveUI&&this.dialog.classList.add("e-responsive-dialog"),n.element.appendChild(this.dialog),this.setLocaleObj(),this.dialog.setAttribute("aria-label",this.l10n.getConstant("DialogEdit")),this.dialogObj=new pS(Pe({header:this.createDialogHeader(t),isModal:!0,visible:!0,cssClass:this.parent.cssClass?"e-edit-dialog "+this.parent.cssClass:"e-edit-dialog",content:this.getEditElement(e,t),showCloseIcon:!0,allowDragging:!0,close:this.dialogClose.bind(this),created:this.dialogCreated.bind(this),closeOnEscape:!0,width:n.editSettings.template?"auto":"330px",target:t.target||document.body,animationSettings:{effect:"None"},footerTemplate:n.editSettings.footerTemplate?ao(function(){return i.getDialogEditTemplateElement("FooterTemplate",t).outerHTML}):null,buttons:[{click:this.btnClick.bind(this),buttonModel:{content:this.l10n.getConstant("SaveButton"),cssClass:this.parent.cssClass?"e-primary "+this.parent.cssClass:"e-primary",isPrimary:!0}},{click:this.btnClick.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",content:this.l10n.getConstant("CancelButton")}}]},n.editSettings.dialog&&n.editSettings.dialog.params||{})),t.dialog=this.dialogObj;this.dialogObj.isStringTemplate=!0,this.renderResponsiveDialog(),this.dialogObj.appendTo(this.dialog),WB(this.parent.element,this.dialogObj.element.parentElement),n.enableAdaptiveUI&&this.dialogObj.show(!0)},PY.prototype.dialogCreated=function(){vF(this.parent)},PY.prototype.renderResponsiveDialog=function(){var e=this;this.parent.enableAdaptiveUI&&(this.parent.adaptiveDlgTarget&&(this.dialogObj.target=this.parent.adaptiveDlgTarget),this.dialogObj.buttons=[{}],this.dialogObj.showCloseIcon=!0,this.dialogObj.visible=!1,this.dialogObj.width="100%",this.dialogObj.open=function(){e.dialogObj.element.style.maxHeight="100%"})},PY.prototype.btnClick=function(e){this.l10n.getConstant("CancelButton").toLowerCase()===e.target.innerText.trim().toLowerCase()?this.dialogClose():this.parent.endEdit()},PY.prototype.dialogClose=function(){this.parent.closeEdit()},PY.prototype.destroy=function(e){for(var t,i=["template","headerTemplate","footerTemplate"],n=0;n<i.length;n++)this.parent.editSettings[i[parseInt(n.toString(),10)]]&&(t=i[parseInt(n.toString(),10)].charAt(0).toUpperCase()+i[parseInt(n.toString(),10)].slice(1),ro(this.parent.element.id+"editSettings"+t,t,this.parent.editSettings));this.parent.notify(Ux,{}),this.parent.isEdit=!1,this.parent.notify(Lx,{}),this.dialog&&!this.dialogObj.isDestroyed&&(this.dialogObj.destroy(),ue(this.dialog))},PY.prototype.getDialogEditTemplateElement=function(e,t){var i=this.parent.createElement("div",{className:"e-dialog"+e}),t=Pe({},t.rowData,{isAdd:!this.isEdit},!0),n=this.parent.element.id+"editSettings"+e;return eB(i,("HeaderTemplate"===e?this.parent.getEditHeaderTemplate():this.parent.getEditFooterTemplate())(t,this.parent,"editSettings"+e,n)),ro(n,e,this.parent.editSettings),i},PY.prototype.getEditElement=function(e,t){var i,n,o=this,r=this.parent,s=this.parent.createElement("div",{className:this.isEdit?GE:"e-insertedrow"}),a=t.form=this.parent.createElement("form",{id:r.element.id+"EditForm",className:"e-gridform"});if(this.parent.editSettings.template)i=this.parent.element.id+"editSettingsTemplate",t=Pe({},t.rowData,{isAdd:!this.isEdit},!0),d=this.parent.isReact&&"string"!=typeof this.parent.editSettings.template&&!(this.parent.editSettings.template.prototype&&this.parent.editSettings.template.prototype.CSPTemplate),n=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,d||n?(this.parent.getEditTemplate()(t,this.parent,"editSettingsTemplate",i,null,null,a),this.parent.renderTemplates()):eB(a,this.parent.getEditTemplate()(t,this.parent,"editSettingsTemplate",i,null,null,null,r.root)),ro(i,"Template",this.parent.editSettings,!0,function(){for(var e=o.parent.getColumns(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].validationRules&&(o.parent.editModule.formObj.rules[e[parseInt(t.toString(),10)].field]=e[parseInt(t.toString(),10)].validationRules)});else{for(var l,h,d=this.parent.createElement("table",{className:QE,attrs:{cellspacing:"6px",role:"grid"}}),p=this.parent.createElement(oD,{attrs:{role:"rowgroup"}}),c=r.getColumns(),u=0;u<c.length;u++)this.parent.editModule.checkColumnIsGrouped(c[parseInt(u.toString(),10)])||c[parseInt(u.toString(),10)].commands||c[parseInt(u.toString(),10)].commandsTemplate||"checkbox"===c[parseInt(u.toString(),10)].type||(l=this.parent.createElement("tr",{attrs:{role:"row"}}),(h=this.parent.createElement("td",{className:LE})).style.cssText="text-align: "+(this.parent.enableRtl?"right":"left")+"; width: 190px;",e[c[parseInt(u.toString(),10)].uid].classList.remove("e-input"),h.appendChild(e[c[parseInt(u.toString(),10)].uid]),l.appendChild(h),p.appendChild(l));d.appendChild(p),a.appendChild(d)}return s.appendChild(a),s},PY.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(jx,this.destroy),this.parent.off(Cx,this.destroy))};var kY=PY;function PY(e,t){this.parent=e,this.serviceLocator=t,this.parent.isDestroyed||(this.parent.on(jx,this.destroy,this),this.parent.on(Cx,this.destroy,this))}FY.prototype.addNew=function(e){this.renderer.addNew(this.getEditElements(e),e),this.convertWidget(e)},FY.prototype.update=function(e){this.renderer.update(this.getEditElements(e),e),e.isCustomFormValidation||(this.parent.notify(FI,e),this.convertWidget(e))},FY.prototype.convertWidget=function(e){for(var t,i=this.parent,n="Dialog"===i.editSettings.mode?ge("#"+i.element.id+"_dialogEdit_wrapper .e-gridform",document):(i.editSettings.showAddNewRow&&i.element.querySelector(".e-editedrow")?i.element.querySelector(".e-editedrow"):i.element).getElementsByClassName("e-gridform")[0],o=0,r="Batch"!==i.editSettings.mode?i.getColumns():[i.getColumnByField(e.columnName)];o<r.length;o++){var s,a,l=r[o];this.parent.editSettings.template&&!je(l.field)?((s=Pe({},e)).element=n.querySelector("[name="+dB(l.field)+"]"),"string"==typeof l.edit.write?FB(l.edit.write,window)(s):l.edit.write(s)):this.parent.editModule.checkColumnIsGrouped(l)||l.commands||(l.valueAccessor(l.field,e.rowData,l),s=n.querySelector("[e-mappinguid="+l.uid+"]"),a=l.edit.write,je(s))||("string"==typeof a?(a=FB(a,window))({rowData:e.rowData,element:s,column:l,requestType:e.requestType,row:e.row,foreignKeyData:l.isForeignColumn()&&FB(l.field,e.foreignKeyData)}):l.edit.write({rowData:e.rowData,element:s,column:l,requestType:e.requestType,row:e.row,foreignKeyData:l.isForeignColumn()&&FB(l.field,e.foreignKeyData)}),t)||!je(s.getAttribute("disabled"))||A(s,"e-checkbox-disabled")||(this.focusElement(s,e.type),t=!0)}},FY.prototype.focusElement=function(e,t){var i,n=this.parent.element.querySelector(".e-edit-checkselect");!je(n)&&n.nextElementSibling&&n.nextElementSibling.classList.add("e-focus"),"Batch"===this.parent.editSettings.mode?this.focus.onClick({target:z(e,"td")},!0):(n=!this.parent.enableVirtualization&&!this.parent.enableColumnVirtualization||"Normal"!==this.parent.editSettings.mode,i=e.classList.contains("e-dropdownlist")?e.parentElement:e,(n||(this.parent.enableVirtualization||this.parent.enableColumnVirtualization)&&"Bottom"===this.parent.editSettings.newRowPosition&&A(e,YE))&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&!A(e,YE)||this.parent.addNewRowFocus)?(i.focus(),this.parent.enableVirtualization&&this.parent.contentModule&&this.parent.contentModule.content&&(this.parent.contentModule.content.scrollTop+=this.parent.getRowHeight())):i.focus({preventScroll:!0})),e.classList.contains("e-defaultcell")&&e.setSelectionRange(e.value.length,e.value.length)},FY.prototype.getEditElements=function(e){var t=this.parent,i={},n="Batch"!==t.editSettings.mode?t.getColumns():[t.getColumnByField(e.columnName)];if(e.isCustomFormValidation&&(n=this.parent.columnModel),this.parent.editSettings.template)return{};for(var o=0,r=n.length;o<r;o++){var s,a,l,h,d,p,c,u,g,m=n[parseInt(o.toString(),10)];m.commands||m.commandsTemplate?(s=this.serviceLocator.getService("cellRendererFactory"),c=new bD(this.parent),s=s.getCellRenderer(LA.CommandColumn),c=c.generateRows(e.rowData)[0].cells.filter(function(e){return e.rowID}),(c=(s=s.render(c[parseInt(o.toString(),10)],e.rowData,{index:e.row?(parseInt(e.row.getAttribute(nD),10)-1).toString():0},this.parent.enableVirtualization)).firstElementChild).setAttribute("textAlign",s.getAttribute("textAlign")),i[m.uid]=c):(a=("dateonly"===m.type&&e.rowData[m.field]instanceof Date&&(s=e.rowData[m.field],e.rowData[m.field]=s.getFullYear()+"-"+kB(s.getMonth()+1)+"-"+kB(s.getDate())),m.valueAccessor(m.field,e.rowData,m)),a={column:m,value:a,type:e.requestType,data:e.rowData},l=m.edit.create,h=void 0,m.editTemplate?(h=this.parent.createElement("span",{attrs:{"e-mappinguid":m.uid}}),d=this.parent.element.id+m.uid+"editTemplate",p=NB({},e.rowData,{column:m}),u=this.parent.isReact&&"string"!=typeof m.editTemplate&&!(m.editTemplate.prototype&&m.editTemplate.prototype.CSPTemplate),g=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,u||g?(m.getEditTemplate()(Pe({index:e.rowIndex},p),this.parent,"editTemplate",d,null,null,h),this.parent.renderTemplates()):eB(h,m.getEditTemplate()(Pe({index:e.rowIndex},p),this.parent,"editTemplate",d,null,null,null,t.root))):("string"==typeof(h="string"==typeof l?(l=FB(l,window))(a):m.edit.create(a))&&((c=this.parent.createElement("div")).innerHTML=h,h=c.firstChild),u="input"!==h.tagName&&h.querySelectorAll("input").length,g=dB(m.field),pt(u?h.querySelector("input"):h,{name:g,"e-mappinguid":m.uid,id:t.element.id+g}),mt(h,["e-input","e-field"],[]),"Right"===m.textAlign&&h.classList.add("e-ralign"),((m.isPrimaryKey||m.isIdentity)&&"beginEdit"===e.requestType||m.isIdentity&&"add"===e.requestType)&&h.setAttribute("disabled","")),i[m.uid]=h)}return i},FY.prototype.destroy=function(){this.renderer.removeEventListener()};var BY=FY;function FY(e,t){this.editType={Inline:TY,Normal:TY,Batch:DY,Dialog:kY},this.parent=e,this.serviceLocator=t,this.renderer=new this.editType[this.parent.editSettings.mode](e,t),this.focus=t.getService("focus")}LY.prototype.create=function(e){return SF(this.parent,e.column,"e-field",{type:"text"})},LY.prototype.read=function(e){return e.ej2_instances[0].value},LY.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.removeEventHandler&&this.removeEventHandler(),this.obj.destroy(),this.obj.element.remove())};f7=LY;function LY(e){this.parent=e}RY=function(e,t){return(RY=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}RY(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(NY,OY=f7),NY.prototype.create=function(e){var t="e-field e-boolcell";return"checkbox"===e.column.type&&(t="e-field e-boolcell e-edit-checkselect"),this.removeEventHandler=this.removeEventListener,SF(this.parent,e.column,t,{type:"checkbox",value:e.value})},NY.prototype.read=function(e){return e.checked},NY.prototype.write=function(e){var t,i;je(e.row)||(t=e.row.querySelector(".e-edit-checkselect")),FB(e.column.field,e.rowData)&&(i=JSON.parse(FB(e.column.field,e.rowData).toString().toLowerCase())),je(t)||"checkbox"!==e.column.type||(this.editType=this.parent.editSettings.mode,this.editRow=e.row,"add"!==e.requestType&&(i=!!(t=this.parent.getRowObjectFromUID(e.row.getAttribute("data-uid")))&&t.isSelected),vB.apply(void 0,[[].slice.call(e.row.getElementsByClassName(LE)),i].concat(this.activeClasses))),this.obj=new ib(Pe({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:i,disabled:!uB(e.column,e.requestType,e.element),enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass||""},e.column.edit.params)),this.addEventListener(),this.obj.appendTo(e.element)},NY.prototype.addEventListener=function(){this.cbChange=this.checkBoxChange.bind(this),this.obj.addEventListener(aD,this.cbChange)},NY.prototype.removeEventListener=function(){this.obj.isDestroyed||this.obj.removeEventListener(aD,this.cbChange)},NY.prototype.checkBoxChange=function(e){var t;this.editRow&&"Dialog"!==this.editType&&(t=!1,e.checked?this.editRow.setAttribute("aria-selected",(t=!0).toString()):this.editRow.removeAttribute("aria-selected"),vB.apply(void 0,[[].slice.call(this.editRow.getElementsByClassName(LE)),t].concat(this.activeClasses)))};var RY,OY,l9=NY;function NY(){var e=null!==OY&&OY.apply(this,arguments)||this;return e.activeClasses=["e-selectionbackground","e-active"],e}VY=function(e,t){return(VY=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}VY(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(zY,_Y=f7),zY.prototype.write=function(e){var t="Dialog"!==this.parent.editSettings.mode,i=(this.column=e.column,new ba(e.column.field,"notequal",null,!0,!1)),n={};if(e.column.edit.params)for(var o=Object.keys(e.column.edit.params),r=0;r<o.length;r++)n[o[parseInt(r.toString(),10)]]="query"===o[parseInt(r.toString(),10)]?e.column.edit.params[o[parseInt(r.toString(),10)]].clone():e.column.edit.params[o[parseInt(r.toString(),10)]];this.obj=new qz(Pe({dataSource:this.parent.dataSource instanceof me?this.parent.dataSource:new me(this.parent.dataSource),query:(new ya).where(i).select(e.column.field),enabled:uB(e.column,e.requestType,e.element)&&gB(A(e.element,"e-rowcell")),fields:{value:e.column.field},value:FB(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,placeholder:t?"":e.column.headerText,popupHeight:"200px",floatLabelType:t?"Never":"Always",sortOrder:"Ascending",cssClass:this.parent.cssClass||null,close:this.dropDownClose.bind(this)},n)),this.parent.enableVirtualization&&(this.obj.dataSource=n.dataSource||(e.column.isForeignColumn()?[e.foreignKeyData[0]]:[e.rowData])),this.addEventListener(),this.obj.query.params=this.parent.query.params,this.obj.appendTo(e.element),e.element.setAttribute("name",dB(e.column.field))},zY.prototype.dropDownClose=function(e){e.event&&("escape"===e.event.action?this.parent.editModule.editCellDialogClose=!0:this.parent.isEdit&&"Batch"===this.parent.editSettings.mode&&"enter"===e.event.action&&e.event.stopPropagation())},zY.prototype.addEventListener=function(){this.ddCreated=this.dropdownCreated.bind(this),this.ddOpen=this.dropDownOpen.bind(this),this.ddBeforeOpen=this.dropdownBeforeOpen.bind(this),this.ddComplete=this.ddActionComplete.bind(this),this.obj.addEventListener(hD,this.ddCreated),this.obj.addEventListener(sD,this.ddOpen),this.obj.addEventListener(dD,this.ddBeforeOpen),this.obj.addEventListener(QA,this.ddComplete)},zY.prototype.removeEventListener=function(){this.obj.isDestroyed||(this.obj.removeEventListener(hD,this.ddCreated),this.obj.removeEventListener(sD,this.ddOpen),this.obj.removeEventListener(dD,this.ddBeforeOpen),this.obj.removeEventListener(QA,this.ddComplete))},zY.prototype.dropdownCreated=function(e){this.flag=!0},zY.prototype.dropdownBeforeOpen=function(){this.parent.enableVirtualization&&(this.column.edit.params&&this.column.edit.params.dataSource?this.obj.dataSource=this.column.edit.params.dataSource:this.obj.dataSource=this.column.isForeignColumn()?this.column.dataSource instanceof me?this.column.dataSource:new me(this.column.dataSource):this.parent.dataSource instanceof me?this.parent.dataSource:new me(this.parent.dataSource))},zY.prototype.ddActionComplete=function(e){e.result=Sa.distinct(e.result,this.obj.fields.value,!0),!this.flag||!this.column.dataSource||this.column.edit.params&&this.column.edit.params.ddEditedData||("result"in this.column.dataSource?this.column.dataSource.result=e.result:this.column.dataSource instanceof me&&(this.column.dataSource.dataSource.json=e.result)),this.flag=!1},zY.prototype.dropDownOpen=function(e){var t=A(this.obj.element,"e-dialog");"Dialog"!==this.parent.editSettings.mode||je(t)||(t=ge("#"+t.id,document).ej2_instances[0],e.popup.element.style.zIndex=(t.zIndex+1).toString())};var VY,_Y,HY=zY;function zY(e){var t=_Y.call(this)||this;return t.parent=e,t.flag=!1,t.removeEventHandler=t.removeEventListener,t}WY.prototype.keyEventHandler=function(e){13!==e.keyCode&&9!==e.keyCode||((e=document.createEvent("HTMLEvents")).initEvent("change",!1,!0),this.dispatchEvent(e))},WY.prototype.create=function(e){return this.instances=new Ti(this.parent.locale),SF(this.parent,e.column,"e-field",{})},WY.prototype.read=function(e){return this.obj.value},WY.prototype.write=function(e){var t=e.column,i="Dialog"!==this.parent.editSettings.mode;this.obj=new NL(Pe({value:parseFloat(FB(e.column.field,e.rowData)),enableRtl:this.parent.enableRtl,placeholder:i?"":e.column.headerText,enabled:uB(e.column,e.requestType,e.element)&&gB(A(e.element,"e-rowcell")),floatLabelType:"Dialog"!==this.parent.editSettings.mode?"Never":"Always",locale:this.parent.locale,cssClass:this.parent.cssClass||null},t.edit.params)),e.element.setAttribute("name",dB(e.column.field)),this.obj.appendTo(e.element),this.obj.element.addEventListener("keydown",this.keyEventHandler)},WY.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.obj.element.removeEventListener("keydown",this.keyEventHandler),this.obj.destroy(),this.obj.element.remove())};var jY=WY;function WY(e){this.parent=e}QY=function(e,t){return(QY=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}QY(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(GY,UY=f7),GY.prototype.create=function(e){var t={type:"text",value:je(e.value)?"":e.value},t=SF(this.parent,e.column,"e-field e-input e-defaultcell",t);return e.column.textAlign&&(t.style.textAlign=e.column.textAlign),t},GY.prototype.read=function(e){return("hidden"!==e.type||je(e.ej2_instances[0])||je(e.ej2_instances[0].textarea)?e:e.ej2_instances[0]).value},GY.prototype.write=function(e){var t,i=e.column,n="Dialog"!==this.parent.editSettings.mode,n={element:e.element,floatLabelType:"Dialog"!==this.parent.editSettings.mode?"Never":"Always",enableRtl:this.parent.enableRtl,enabled:uB(e.column,e.requestType,e.element)&&gB(A(e.element,"e-rowcell")),placeholder:n?"":e.column.headerText,cssClass:this.parent.cssClass||""};je(i.edit)||je(i.edit.params)||!i.edit.params.multiline||(t=i.valueAccessor(i.field,e.rowData,i),n.value=t),this.obj=new fV(Pe(n,i.edit.params)),this.obj.appendTo(e.element),"Batch"===this.parent.editSettings.mode&&this.obj.element.addEventListener("keydown",this.keyEventHandler)},GY.prototype.keyEventHandler=function(e){"Enter"!==e.key&&"Tab"!==e.key||(e=new Event("change",{bubbles:!1,cancelable:!0}),this.dispatchEvent(e))},GY.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.obj.element.removeEventListener("keydown",this.keyEventHandler),this.obj.destroy(),this.obj.element.remove())};var QY,UY,qY=GY;function GY(){return null!==UY&&UY.apply(this,arguments)||this}XY.prototype.clickHandler=function(e){var e=e.target,t=this.parent;t.editSettings.showAddNewRow&&je(t.element.querySelector("."+GE))||(A(e,OE)&&A(A(e,OE),"e-grid").id===t.element.id||t.frozenRows&&A(e,VE)&&!A(e,"e-columnheader"))&&!A(e,"e-unboundcelldiv")&&(this.rowIndex=A(e,LE)?parseInt(e.parentElement.getAttribute(nD),10)-1:-1,t.isEdit)&&t.editModule.endEdit()},XY.prototype.dblClickHandler=function(e){A(e.target,LE)&&this.parent.editSettings.allowEditOnDblClick&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&!A(e.target,"e-addedrow"))&&this.parent.editModule.startEdit(A(e.target,UE))},XY.prototype.editComplete=function(e){this.parent.isEdit=!!this.parent.editSettings.showAddNewRow;var t="action";switch(e.requestType){case"save":(this.parent.isCheckBoxSelection||"Multiple"===this.parent.selectionSettings.type)&&this.parent.isPersistSelection||"edit"===e[t]||this.parent.editSettings.showAddNewRow&&(!this.parent.editSettings.showAddNewRow||"add"===e[t])||this.parent.selectRow(e.index),this.parent.trigger(QA,Pe(e,{requestType:"save",type:QA})),this.parent.notify(ZT,{requestType:"save",action:e[t]});break;case"delete":this.parent.trigger(QA,Pe(e,{requestType:"delete",type:QA})),this.parent.isCheckBoxSelection||this.parent.enableInfiniteScrolling&&(this.parent.childGrid||this.parent.detailTemplate)||this.parent.selectRow(this.editRowIndex),this.parent.notify(ZT,{requestType:"delete",action:e[t]})}},XY.prototype.getEditArgs=function(e,t,i){for(var n=this.parent.getPrimaryKeyFieldNames(),o=[],r=0;r<n.length;r++)o.push(FB(n[parseInt(r.toString(),10)],e));return{primaryKey:n,primaryKeyValue:o,requestType:"beginEdit",rowData:e,rowIndex:this.rowIndex,type:"edit",cancel:!1,foreignKeyData:t&&t.foreignKeyData,target:void 0,isScroll:i}},XY.prototype.startEdit=function(t){var i=this,n=this.parent;if(this.rowIndex=this.editRowIndex=parseInt(t.getAttribute(nD),10)-1,n.enableVirtualization||n.enableColumnVirtualization||n.enableInfiniteScrolling){var e='.e-row[aria-rowindex="'+(this.rowIndex+1)+'"]';if(!this.parent.element.querySelector(e))return}var e={data:void 0,index:this.rowIndex,isScroll:!1},o=(this.parent.notify(KI,e),BB(n)?(o=n.getRowObjectFromUID(t.getAttribute("data-uid")),this.previousData=o.data):this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.parent.enableInfiniteScrolling&&(!this.previousData||this.parent.infiniteScrollSettings.enableCache)?this.previousData=e.data:this.parent.enableVirtualization||(this.previousData=Pe({},{},this.parent.getForeignKeyColumns().length?this.parent.getRowObjectFromUID(t.getAttribute("data-uid")).data:n.getCurrentViewRecords()[this.rowIndex],!0)),Pe({},{},e.data||this.previousData,!0)),r=(this.uid=t.getAttribute("data-uid"),n.getRowObjectFromUID(this.uid)),o=this.getEditArgs(o,r,e.isScroll);o.row=t,o.isScroll?this.inlineEditHandler(o,t):(this.parent.notify(nE,{uid:this.uid,prevData:this.previousData,argsCreator:this.getEditArgs.bind(this),renderer:this.renderer}),n.trigger(S1,o,function(e){e.type="actionBegin",n.trigger(WA,e,function(e){e.cancel||i.inlineEditHandler(e,t)})}))},XY.prototype.disabledShowAddRow=function(e,t){var i=this.parent.element.querySelector(".e-addedrow"),n=[].slice.call(i?i.querySelectorAll(".e-input"):[]);if(i&&i.querySelector(".e-unboundcell"))for(var o=[].slice.call(i.querySelector(".e-unboundcell").querySelectorAll(".e-btn")),r=0;r<o.length;r++)e?(o[parseInt(r.toString(),10)].classList.remove("e-disabled"),o[parseInt(r.toString(),10)].removeAttribute("disabled")):(o[parseInt(r.toString(),10)].classList.add("e-disabled"),o[parseInt(r.toString(),10)].setAttribute("disabled","disabled"));if(n.length)for(r=0;r<n.length;r++){var s=n[parseInt(r.toString(),10)],a=s.getAttribute("e-mappinguid"),a=this.parent.getColumnByUid(a),l=A(s,"e-rowcell").querySelector(".e-error");l&&l.classList.remove("e-error"),s.ej2_instances?(t&&je(a.defaultValue)&&("checkbox"===s.type?(s.ej2_instances[0].checked=!1,s.checked=!1):(s.ej2_instances[0].value=null,s.value=null)),"checkbox"!==s.type||je(e)?je(e)||(s.ej2_instances[0].enabled=!(!e||!a.allowEditing)):s.ej2_instances[0].disabled=!e||!a.allowEditing):(t&&s.value&&s.value.length&&je(a.defaultValue)&&(s.value=null),je(e)||(e?a.allowEditing&&(s.classList.remove("e-disabled"),s.removeAttribute("disabled")):(s.classList.add("e-disabled"),s.setAttribute("disabled","disabled"))))}},XY.prototype.inlineEditHandler=function(e,t){var i=this.parent;i.isEdit=!0,e.row=e.row||t,"Dialog"!==i.editSettings.mode&&i.clearSelection(),"Dialog"===i.editSettings.mode&&i.selectionModule&&(i.selectionModule.preventFocus=!0,e.row.classList.add("e-dlgeditrow")),this.renderer.update(e),this.uid=t.getAttribute("data-uid"),i.editModule.applyFormValidation(),i.editSettings.showAddNewRow&&!t.classList.contains("e-addedrow")&&this.disabledShowAddRow(!1,!0),e.type="actionComplete",i.trigger(QA,e),i.editSettings.template&&i.editModule.applyFormValidation(void 0,e.form.ej2_instances[0].rules),this.args=e,this.parent.allowTextWrap&&this.parent.notify(oI,{case:"textwrap"})},XY.prototype.updateRow=function(e,t){var i=this,n=this.parent,o=(this.editRowIndex=e,n.getRowByIndex(e));o&&(t={requestType:"save",action:"edit",type:WA,data:t,cancel:!1,previousData:n.getCurrentViewRecords()[parseInt(e.toString(),10)],row:o},n.showSpinner(),n.enableInfiniteScrolling&&(this.uid=t.row.getAttribute("data-uid"),e=parseInt(t.row.getAttribute("aria-rowindex"),10)-1,this.parent.notify(hE,{index:e})),n.notify(Vx,t),t.promise?t.promise.then(function(){return n.refresh()}).catch(function(e){return i.edFail(e)}):n.enableInfiniteScrolling||n.refresh())},XY.prototype.editFormValidate=function(){var e=this.parent,t=e.editModule.editFormValidate(),i={prevData:this.previousData,isValid:!0,editIdx:this.editRowIndex,addIdx:this.addedRowIndex};return e.notify(oE,i),t&&i.isValid},XY.prototype.endEdit=function(){var e,t,i,n,o,r,s=this,a=this.parent;this.parent.isEdit&&this.editFormValidate()&&(e=Pe({},{},this.previousData,!0),t=Pe(this.args,{requestType:"save",type:WA,data:e,cancel:!1,previousData:this.previousData,selectedRow:a.selectedRowIndex,foreignKeyData:{}}),i="Dialog"===a.editSettings.mode,n=ge("#"+a.element.id+"_dialogEdit_wrapper",document),r=i?n.querySelector(".e-gridform"):(a.editSettings.showAddNewRow&&a.element.querySelector("."+GE)?a.element.querySelector("."+GE):a.element).getElementsByClassName("e-gridform")[0],o={virtualData:Pe({},{},this.previousData,!0),isAdd:!1,isScroll:!1,endEdit:!0},this.parent.notify(nT,o),(this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.parent.enableInfiniteScrolling)&&"Normal"===this.parent.editSettings.mode&&Object.keys(o.virtualData).length?this.parent.isEdit&&(this.currentVirtualData=e=t.data=o.virtualData):e=a.editModule.getCurrentEditedData(r,e),r=[].slice.call(a.element.getElementsByClassName(GE)).length,!o.isAdd&&Object.keys(this.currentVirtualData).length&&(r=r||1),(i?n.getElementsByClassName(GE).length:r)?(t.action="edit",a.trigger(WA,t,function(e){e.cancel||("Spinner"===s.parent.loadingIndicator.indicatorType&&a.showSpinner(),"Shimmer"===s.parent.loadingIndicator.indicatorType&&s.parent.showMaskRow(),a.editSettings.showAddNewRow&&s.disabledShowAddRow(!0),a.notify(Vx,e))})):(t.action="add",t.selectedRow=0,t.index=this.addedRowIndex,a.notify(JI,{}),a.notify($1,t),this.addedRowIndex=null,t.cancel||this.parent.editSettings.showAddNewRow&&(this.parent.notify(wE,{}),this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.disabledShowAddRow(!0,!0)))},XY.prototype.destroyElements=function(){var e=this.parent;(!e.editSettings.showAddNewRow||e.editSettings.showAddNewRow&&e.element.querySelector(".e-editedrow"))&&(e.editModule.destroyWidgets(),e.editModule.destroyForm()),this.parent.notify(jx,{})},XY.prototype.editHandler=function(t){var i=this;t.promise?t.promise.then(function(e){return i.edSucc(e,t)}).catch(function(e){return i.edFail(e)}):this.editSuccess(t.data,t),this.parent.editSettings.showAddNewRow&&this.parent.editModule.applyFormValidation()},XY.prototype.edSucc=function(e,t){this.editSuccess(e,t)},XY.prototype.edFail=function(e){this.editFailure(e)},XY.prototype.updateCurrentViewData=function(e){this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||(this.parent.getCurrentViewRecords()[this.editRowIndex]=e)},XY.prototype.requestSuccess=function(e){this.parent.editModule.formObj&&!this.parent.editModule.formObj.isDestroyed&&(this.destroyElements(),this.stopEditStatus(),"Dialog"===this.parent.editSettings.mode)&&"add"!==e.action&&this.parent.selectionModule&&this.parent.element.querySelector(".e-dlgeditrow").classList.remove("e-dlgeditrow")},XY.prototype.editSuccess=function(e,l){if(je(e)||e instanceof Array||(l.data=Pe({},Pe({},l.rowData,l.data),e)),this.requestSuccess(l),this.parent.trigger(D1,l),l.type=QA,this.parent.isEdit=!!this.parent.editSettings.showAddNewRow,this.refreshRow(l.data),this.parent.notify(JI,l),this.parent.editModule.checkLastRow(l.row),this.parent.editModule.isLastRow=!1,this.updateCurrentViewData(l.data),this.blazorTemplate(),this.editRowIndex=null,this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.showGroupedColumn){for(var e=l.row,t=this.parent.getRowsObject(),e=e.getAttribute("data-uid"),h=this.parent.getRowObjectFromUID(e),i=this,n=0;n<this.parent.groupSettings.columns.length;n++)!function(s){var a=i;t=t.filter(function(e){var t=e.isDataRow&&e!==h&&!je(e.data);if(t){for(var i=a.parent.groupSettings.columns[parseInt(s.toString(),10)].split("."),n=e.data[i[0]],o=l.data[i[0]],r=1;r<i.length;r++)n=n[i[r]],o=o[i[r]];return t&&n===o}return t})}(n);e=t[0];je(h)||je(e)||h.parentUid===e.parentUid?this.parent.aggregates.length&&this.parent.aggregateModule.refresh(l.data,this.parent.groupSettings.enableLazyLoading?l.row:void 0):this.parent.groupModule.groupedRowReorder(h,e)}else this.parent.aggregates.length&&this.parent.aggregateModule.refresh(l.data,this.parent.groupSettings.enableLazyLoading?l.row:void 0);this.parent.trigger(QA,l),(this.parent.isCheckBoxSelection||"Multiple"===this.parent.selectionSettings.type)&&(this.parent.isPersistSelection||this.parent.selectionSettings.checkboxOnly)||"Dialog"===this.parent.editSettings.mode||this.parent.selectRow(-1<this.rowIndex?this.rowIndex:this.editRowIndex),this.parent.notify(ZT,{requestType:l.requestType,action:l.action}),this.parent.aggregates.length&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&(this.parent.groupModule.getGroupAggregateTemplates(!0).length||this.parent.groupModule.getGroupAggregateTemplates(!1).length)||(this.parent.removeMaskRow(),this.parent.hideSpinner())},XY.prototype.closeForm=function(){!this.cloneRow&&this.parent.isEdit&&this.stopEditStatus(),this.cloneRow&&(this.cloneRow.remove(),this.cloneRow=null,this.originalRow.classList.remove("e-hiddenrow"))},XY.prototype.blazorTemplate=function(){var e=this.parent.getColumns();this.parent.editSettings.template&&"Normal"===this.parent.editSettings.mode&&ro(this.parent.element.id+"editSettingsTemplate","Template",this.parent.editSettings);for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i.template&&ro(this.parent.element.id+i.uid,"Template",i,!1),i.editTemplate&&ro(this.parent.element.id+i.uid+"editTemplate","EditTemplate",i)}},XY.prototype.editFailure=function(e){e.cancel||(this.parent.removeMaskRow(),this.parent.trigger(UA,{error:e}),this.parent.hideSpinner(),this.parent.log("actionfailure",{error:e}))},XY.prototype.needRefresh=function(){var e=!0,t=this.parent.element.querySelector(".e-gridform");return e=!this.parent.enableVirtualization&&!this.parent.infiniteScrollSettings.enableCache||"Normal"!==this.parent.editSettings.mode||t?e:!1},XY.prototype.refreshRow=function(e){var t=new yD(this.serviceLocator,null,this.parent),i=this.parent.getRowObjectFromUID(this.uid);if(i){i.changes=e,this.parent.notify(eT,{data:e}),EB(i,this.parent.getForeignKeyColumns(),i.changes),this.needRefresh()&&t.refresh(i,this.parent.getColumns(),!0);for(var n=[].slice.call(this.parent.element.querySelectorAll('[aria-rowindex="'+(i.index+1)+'"]')),o=0;o<n.length;o++)if(hF(n[parseInt(o.toString(),10)]),this.parent.enableColumnVirtualization&&n[parseInt(o.toString(),10)].querySelectorAll(".e-leftfreeze,.e-rightfreeze,.e-fixedfreeze").length)for(var r,s=this.parent.getColumns(),a=[].slice.call(n[parseInt(o.toString(),10)].querySelectorAll(".e-leftfreeze,.e-rightfreeze.e-fixedfreeze")),l=0;l<a.length;l++)a[parseInt(l.toString(),10)].classList.contains("e-leftfreeze")?a[parseInt(l.toString(),10)].style.left=s[parseInt(l.toString(),10)].valueX-this.parent.translateX+"px":a[parseInt(l.toString(),10)].classList.contains("e-rightfreeze")?(r=parseInt(a[parseInt(l.toString(),10)].getAttribute("aria-colindex"),10)-1,a[parseInt(l.toString(),10)].style.right=s[parseInt(r.toString(),10)].valueX+this.parent.translateX+"px"):(a[parseInt(l.toString(),10)].style.left=this.parent.leftrightColumnWidth("left")-this.parent.translateX+"px",a[parseInt(l.toString(),10)].style.right=this.parent.leftrightColumnWidth("right")+this.parent.translateX+"px")}},XY.prototype.closeEdit=function(){var i,n,o=this;!this.parent.isEdit||this.parent.editSettings.showAddNewRow&&this.parent.element.querySelector(".e-addedrow")&&je(this.parent.element.querySelector("."+GE))?this.parent.editSettings.showAddNewRow&&(this.disabledShowAddRow(!0,!0),this.parent.notify(wE,{})):(i=this.parent,n=Pe(this.args,{requestType:"cancel",type:WA,cancel:!1,data:this.previousData,selectedRow:i.selectedRowIndex}),i.notify(ZI,n),this.blazorTemplate(),i.trigger(WA,n,function(e){var t;e.cancel||(o.parent.notify(AE,n),"Dialog"===o.parent.editSettings.mode&&o.parent.notify(jx,{}),e.type=QA,o.parent.editSettings.showAddNewRow||(i.isEdit=!1),"Dialog"!==i.editSettings.mode&&o.refreshRow(e.data),o.stopEditStatus(),i.isEdit=!1,i.editSettings.showAddNewRow&&(o.disabledShowAddRow(!0),i.editModule.applyFormValidation(),i.isEdit=!0),t=i.groupSettings.enableLazyLoading&&i.groupSettings.columns.length&&!i.getContentTable().querySelector("tr.e-emptyrow"),i.getContentTable().querySelector("tr.e-emptyrow")||i.getContentTable().querySelector("tr.e-row")||t||i.renderModule.emptyRow(),"Dialog"!==i.editSettings.mode&&i.selectRow(o.rowIndex),i.trigger(QA,e))}))},XY.prototype.addRecord=function(e,t){var i=this,n=this.parent;if(this.addedRowIndex=t=je(t)?0:t,e)n.notify($1,{requestType:"save",type:WA,data:e,selectedRow:0,action:"add",index:t});else if(!n.isEdit){this.previousData={},this.uid="";var o=n.getColumns(),r={virtualData:{},isScroll:!1};n.editSettings.showAddNewRow||this.parent.notify(nT,r);for(var s=0;s<o.length;s++)r.isScroll||o[parseInt(s.toString(),10)].field&&("string"===o[parseInt(s.toString(),10)].type&&(o[parseInt(s.toString(),10)].defaultValue=this.parent.sanitize(o[parseInt(s.toString(),10)].defaultValue)),Sa.setValue(o[parseInt(s.toString(),10)].field,o[parseInt(s.toString(),10)].defaultValue,this.previousData));e={cancel:!1,foreignKeyData:{},requestType:"add",data:this.previousData,type:WA,index:t,rowData:this.previousData,target:void 0,isScroll:r.isScroll};(this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.parent.infiniteScrollSettings.enableCache)&&Object.keys(r.virtualData).length&&(e.data=e.rowData=r.virtualData),e.isScroll||(this.parent.notify(nE,{uid:this.uid,prevData:this.previousData,argsCreator:this.getEditArgs.bind(this),renderer:this.renderer}),n.editSettings.showAddNewRow)?this.inlineAddHandler(e):n.trigger(WA,e,function(e){e.cancel||i.inlineAddHandler(e)})}},XY.prototype.inlineAddHandler=function(e){var t=this.parent;t.isEdit=!0,"Dialog"!==t.editSettings.mode&&t.clearSelection(),this.renderer.addNew(e),t.editModule.applyFormValidation(),e.type=QA,e.row=t.element.querySelector("."+YE),t.editSettings.showAddNewRow||t.trigger(QA,e),t.editSettings.template&&t.editModule.applyFormValidation(void 0,e.form.ej2_instances[0].rules),this.args=e},XY.prototype.deleteRecord=function(n,o){if(this.editRowIndex=this.parent.selectedRowIndex,o){o=o instanceof Array?o:[o];for(var r=this.parent,e=Object.keys(o).length,t=(n=n||this.parent.getPrimaryKeyFieldNames()[0],0);t<e;t++)!function(t){var i,e=r.currentViewData.some(function(e){return i=e,o[parseInt(t.toString(),10)]===FB(n,e)||o[parseInt(t.toString(),10)]===e});o[parseInt(t.toString(),10)]=e?i:o[parseInt(t.toString(),10)][""+n]?o[parseInt(t.toString(),10)]:((e={})[n]=o[parseInt(t.toString(),10)],e)}(t)}var i={requestType:"delete",type:WA,foreignKeyData:{},data:o||this.parent.getSelectedRecords(),tr:this.parent.getSelectedRows(),cancel:!1};je(this.parent.commandDelIndex)||(i.data[0]=this.parent.getRowObjectFromUID(this.parent.getRowByIndex(this.parent.commandDelIndex).getAttribute("data-uid")).data),this.parent.notify($1,i)},XY.prototype.stopEditStatus=function(){for(var e=this.parent,t=[].slice.call(e.editSettings.showAddNewRow?[]:e.element.getElementsByClassName(YE)),i=[].slice.call(e.element.getElementsByClassName(GE)),n=0;n<t.length;n++)ue(t[parseInt(n.toString(),10)]);for(n=0;n<i.length;n++)i[parseInt(n.toString(),10)].classList.remove(GE)},XY.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:Wx,handler:this.editHandler},{event:qx,handler:this.dblClickHandler},{event:wx,handler:this.clickHandler},{event:SI,handler:this.requestSuccess},{event:Fx,handler:this.dblClickHandler},{event:Hx,handler:this.editComplete},{event:_x,handler:this.editComplete},{event:UT,handler:this.closeEdit},{event:JT,handler:this.closeForm}],CF(this.parent,this.evtHandlers,!0,this))},XY.prototype.removeEventListener=function(){this.parent.isDestroyed||CF(this.parent,this.evtHandlers,!1)},XY.prototype.destroy=function(){this.removeEventListener(),this.renderer.destroy()};var YY=XY;function XY(e,t,i){this.args={},this.currentVirtualData={},this.parent=e,this.renderer=i,this.serviceLocator=t,this.addEventListener()}KY=function(e,t){return(KY=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}KY(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})($Y,JY=YY),$Y.prototype.closeEdit=function(){JY.prototype.closeEdit.call(this)},$Y.prototype.addRecord=function(e,t){JY.prototype.addRecord.call(this,e,t)},$Y.prototype.endEdit=function(){JY.prototype.endEdit.call(this)},$Y.prototype.updateRow=function(e,t){JY.prototype.updateRow.call(this,e,t)},$Y.prototype.deleteRecord=function(e,t){JY.prototype.deleteRecord.call(this,e,t)},$Y.prototype.startEdit=function(e){JY.prototype.startEdit.call(this,e)};var KY,JY,ZY=$Y;function $Y(e,t,i){var n=JY.call(this,e,t)||this;return n.parent=e,n.serviceLocator=t,n.renderer=i,n}tX.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:wx,handler:this.clickHandler},{event:Fx,handler:this.dblClickHandler},{event:yx,handler:this.onBeforeCellFocused},{event:vx,handler:this.onCellFocused},{event:qx,handler:this.dblClickHandler},{event:bx,handler:this.keyDownHandler},{event:xI,handler:this.editNextValCell},{event:Cx,handler:this.destroy}],CF(this.parent,this.evtHandlers,!0,this),E.add(this.parent.element,"mousedown",this.mouseDownHandler,this),this.dataBoundFunction=this.dataBound.bind(this),this.batchCancelFunction=this.batchCancel.bind(this),this.parent.addEventListener(qA,this.dataBoundFunction),this.parent.addEventListener(y1,this.batchCancelFunction))},tX.prototype.removeEventListener=function(){this.parent.isDestroyed||(CF(this.parent,this.evtHandlers,!1),E.remove(this.parent.element,"mousedown",this.mouseDownHandler),this.parent.removeEventListener(qA,this.dataBoundFunction),this.parent.removeEventListener(y1,this.batchCancelFunction))},tX.prototype.batchCancel=function(){this.parent.focusModule.restoreFocus({requestType:"batchCancel"})},tX.prototype.dataBound=function(){this.parent.notify(Lx,{})},tX.prototype.destroy=function(){this.removeEventListener()},tX.prototype.mouseDownHandler=function(e){je(this.parent.element.querySelector(".e-gridform"))?this.mouseDownElement=void 0:this.mouseDownElement=e.target},tX.prototype.clickHandler=function(e){A(e.target,this.parent.element.id+"_add",!0)||((this.parent.isEdit&&z(this.form,"td")!==z(e.target,"td")&&je(this.mouseDownElement)||this.mouseDownElement===e.target)&&(this.saveCell(),this.editNextValCell()),A(e.target,LE)&&!this.parent.isEdit&&this.setCellIdx(e.target))},tX.prototype.dblClickHandler=function(e){var t=A(e.target,LE),e=A(e.target,UE),e=e&&parseInt(e.getAttribute(nD),10)-1,i=t&&parseInt(t.getAttribute(iD),10)-1;je(t)||je(e)||isNaN(i)||t.parentElement.classList.contains(GE)||!this.parent.getColumns()[parseInt(i.toString(),10)].allowEditing||this.editCell(e,this.parent.getColumns()[parseInt(i.toString(),10)].field,this.isAddRow(e))},tX.prototype.onBeforeCellFocused=function(e){this.parent.isEdit&&this.validateFormObj()&&(e.byClick||-1<["tab","shiftTab","enter","shiftEnter"].indexOf(e.keyArgs.action))&&(e.cancel=!0,(e.byClick?e.clickArgs:e.keyArgs).preventDefault())},tX.prototype.onCellFocused=function(e){var t=!(e.container.isContent&&e.container.isDataCell||this.parent.frozenRows&&e.container.isHeader);if(this.parent.focusModule.active&&(this.prevEditedBatchCell=this.parent.focusModule.active.matrix.current.toString()===this.prevEditedBatchCellMatrix().toString(),this.crtRowIndex=[].slice.call(this.parent.focusModule.active.getTable().rows).indexOf(z(e.element,"tr"))),!e.byKey||t)this.parent.isEdit&&t&&this.saveCell();else{var t=e.container.indexes,i=t[0],n=t[1],t=e.element.getAttribute("aria-colindex")?parseInt(e.element.getAttribute("aria-colindex"),10)-1:n,o=(t!==n&&(n=t),this.parent.frozenRows&&e.container.isContent&&(i+=(this.parent.getContent().querySelector(".e-hiddenrow")?0:this.parent.frozenRows)+this.parent.getHeaderContent().querySelectorAll(".e-insertedrow").length),this.parent.isEdit);if(!this.parent.element.getElementsByClassName("e-popup-open").length)switch(o=o&&!this.validateFormObj(),e.keyArgs.action){case"tab":case"shiftTab":var r=this.parent.isRowDragable()&&this.parent.isDetail()?2:this.parent.isRowDragable()||this.parent.isDetail()?1:0,r=this.parent.getColumns()[n-r];r&&!this.parent.isEdit&&this.editCell(i,r.field),(o||this.parent.isLastCellPrimaryKey)&&this.editCellFromIndex(i,n);break;case"enter":case"shiftEnter":e.keyArgs.preventDefault();r={cancel:!1,keyArgs:e.keyArgs};this.parent.notify("beforeFocusCellEdit",r),!r.cancel&&o&&this.editCell(i,this.cellDetails.column.field);break;case"f2":this.editCellFromIndex(i,n),this.focus.focus()}}},tX.prototype.isAddRow=function(e){return this.parent.getDataRows()[parseInt(e.toString(),10)].classList.contains("e-insertedrow")},tX.prototype.editCellFromIndex=function(e,t){this.cellDetails.rowIndex=e,this.cellDetails.cellIndex=t,this.editCell(e,this.parent.getColumns()[parseInt(t.toString(),10)].field,this.isAddRow(e))},tX.prototype.closeEdit=function(){var e=this.parent,t=this.parent.getRowsObject(),i={cancel:!1,batchChanges:this.getBatchChanges()};if(e.notify(LI,i),!i.cancel){e.isEdit&&this.saveCell(!0),this.isAdded=!1;i=[];e.selectionModule&&(i=e.selectionModule.selectedRowIndexes),e.clearSelection();for(var n=0;n<t.length;n++){var o=t[parseInt(n.toString(),10)].isDirty;(o=this.removeBatchElementChanges(t[parseInt(n.toString(),10)],o))&&t.splice(n,1),o&&n--}e.getContentTable().querySelector("tr.e-row")||e.renderModule.renderEmptyRow();this.parent.getRowsObject();e.notify(y1,{rows:this.parent.getRowsObject().length?this.parent.getRowsObject():[new DE({isDataRow:!0,cells:[new kE({isDataCell:!0,visible:!0})]})]}),e.isCheckBoxSelection&&(e.selectionSettings.checkboxOnly||e.selectionSettings.persistSelection)?e.selectRows(i):e.selectRow(this.cellDetails.rowIndex),this.refreshRowIdx(),e.notify(Lx,{}),this.parent.notify(Nx,{}),i={requestType:"batchCancel",rows:this.parent.getRowsObject()},e.trigger(y1,i)}},tX.prototype.removeBatchElementChanges=function(e,t){var i=this.parent,n=new yD(this.serviceLocator,null,this.parent),o=!1;return t&&(e.isDirty=t,t=i.getRowElementByUID(e.uid))&&(t.classList.contains("e-insertedrow")?(ue(t),o=!0):(EB(e,this.parent.getForeignKeyColumns(),e.data),delete e.changes,delete e.edit,e.isDirty=!1,mt(t,[],["e-hiddenrow","e-updatedtd"]),n.refresh(e,i.getColumns(),!1)),0<this.parent.aggregates.length)&&((t=[]).type="cancel",this.parent.notify(px,t),0<this.parent.groupSettings.columns.length)&&this.parent.notify(dx,t),o},tX.prototype.deleteRecord=function(e,t){this.saveCell(),this.validateFormObj()&&this.saveCell(!0),this.isAdded=!1,this.bulkDelete(e,t),0<this.parent.aggregates.length&&(this.parent.isReact||this.parent.isVue||this.parent.notify(px,{}),0<this.parent.groupSettings.columns.length&&this.parent.notify(dx,{}),this.parent.isReact||this.parent.isVue)&&this.parent.notify(px,{})},tX.prototype.addRecord=function(e){this.bulkAddRow(e)},tX.prototype.endEdit=function(){this.parent.isEdit&&this.validateFormObj()||this.batchSave()},tX.prototype.validateFormObj=function(){return this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate()},tX.prototype.batchSave=function(){var e,t,i,n=this.parent,o="deletedRecords";n.isCheckBoxSelection&&(e=n.element.querySelector(".e-checkselectall").parentElement).classList.contains("e-checkbox-disabled")&&n.pageSettings.totalRecordsCount>n.currentViewData.length&&q([e],["e-checkbox-disabled"]),this.saveCell(),n.isEdit||this.editNextValCell()||n.isEdit||(t=this.getBatchChanges(),"Multiple"===this.parent.selectionSettings.type&&t[o].length&&this.parent.selectionSettings.persistSelection&&(t[o]=this.removeSelectedData,this.removeSelectedData=[]),i={changedRecords:this.parent.getRowsObject().filter(function(e){return e.isDirty&&-1===["add","delete"].indexOf(e.edit)}).map(function(e){return e.data})},n.trigger(C1,{batchChanges:t,cancel:!1},function(e){e.cancel||(n.showSpinner(),n.notify(Rx,{changes:t,original:i}))}))},tX.prototype.getBatchChanges=function(){for(var e={addedRecords:[],deletedRecords:[],changedRecords:[]},t=0,i=this.parent.getRowsObject();t<i.length;t++){var n=i[t];if(n.isDirty)switch(n.edit){case"add":e.addedRecords.push(n.changes);break;case"delete":e.deletedRecords.push(n.data);break;default:e.changedRecords.push(n.changes)}}return e},tX.prototype.removeRowObjectFromUID=function(e){for(var t=this.parent.getRowsObject(),i=0,n=t.length;i<n&&t[parseInt(i.toString(),10)].uid!==e;i++);t.splice(i,1)},tX.prototype.addRowObject=function(e){var t=this.parent,i="Top"===t.editSettings.newRowPosition,e=e.clone();i?t.getRowsObject().unshift(e):t.getRowsObject().push(e)},tX.prototype.bulkDelete=function(e,o){var r=this,s=(this.removeSelectedData=[],this.parent),a=s.selectedRowIndex,l=s.getSelectedRows(),t={primaryKey:this.parent.getPrimaryKeyFieldNames(),rowIndex:a,rowData:o||s.getSelectedRecords(),cancel:!1};t.row=o?s.editModule.deleteRowUid?s.getRowElementByUID(s.editModule.deleteRowUid):s.getRows()[s.getCurrentViewRecords().indexOf(o)]:l,t.row&&s.trigger(w1,t,function(e){if(!e.cancel){if(r.removeSelectedData=s.getSelectedRecords(),s.clearSelection(),e.row=e.row||(o?s.getRows()[parseInt(a.toString(),10)]:l),1===l.length||o){Array.isArray(e.row)&&(e.row=e.row[0]);var t=e.row.getAttribute("data-uid"),t=o&&r.parent.editModule.deleteRowUid?r.parent.editModule.deleteRowUid:t;e.row.classList.contains("e-insertedrow")?(r.removeRowObjectFromUID(t),ue(e.row)):((t=s.getRowObjectFromUID(t)).isDirty=!0,t.edit="delete",mt(e.row,["e-hiddenrow","e-updatedtd"],[]),s.frozenRows&&a<s.frozenRows&&s.getDataRows().length>=s.frozenRows&&s.getHeaderTable().querySelector(oD).appendChild(s.getRowByIndex(s.frozenRows-1)))}else{o&&(a=parseInt(e.row.getAttribute(nD),10)-1);for(var i=0;i<l.length;i++){var n=l[parseInt(i.toString(),10)].getAttribute("data-uid");l[parseInt(i.toString(),10)].classList.contains("e-insertedrow")?(r.removeRowObjectFromUID(n),ue(l[parseInt(i.toString(),10)])):(mt(l[parseInt(i.toString(),10)],["e-hiddenrow","e-updatedtd"],[]),(n=s.getRowObjectFromUID(n)).isDirty=!0,n.edit="delete",s.frozenRows&&a<s.frozenRows&&s.getDataRows().length>=s.frozenRows&&s.getHeaderTable().querySelector(oD).appendChild(s.getRowByIndex(s.frozenRows-1)))}}delete e.row,r.refreshRowIdx(),o&&(s.editModule.deleteRowUid=void 0),s.isCheckBoxSelection||s.selectRow(a),s.trigger(v1,e),s.notify(v1,{rows:r.parent.getRowsObject()}),s.focusModule.restoreFocus({requestType:"batchDelete"}),s.notify(Lx,{}),s.getContentTable().querySelector("tr.e-row")||s.renderModule.renderEmptyRow()}})},tX.prototype.refreshRowIdx=function(){for(var e=this.parent,t=e.getAllDataRows(!0),i=e.getRowsObject().filter(function(e){return!e.isDetailRow}),n=0,o=0,r=t.length;n<r;n++)t[parseInt(n.toString(),10)].classList.contains(UE)&&!t[parseInt(n.toString(),10)].classList.contains("e-hiddenrow")?(t[parseInt(n.toString(),10)].setAttribute(nD,(o+1).toString()),i[parseInt(n.toString(),10)].index=o,o++):(t[parseInt(n.toString(),10)].removeAttribute(nD),i[parseInt(n.toString(),10)].index=-1)},tX.prototype.bulkAddRow=function(l){var h=this,d=this.parent;if(d.editSettings.allowAdding){if(d.isEdit&&(this.saveCell(),this.parent.notify(xI,{})),!this.validateFormObj()){if(this.initialRender){for(var e,t=d.getVisibleColumns(),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].validationRules&&t[parseInt(i.toString(),10)].validationRules.required&&(e={field:t[parseInt(i.toString(),10)].field.slice(),cellIdx:i},this.validationColObj.push(e));this.initialRender=!1}this.parent.element.classList.add("e-editing");var n={defaultData:l||this.getDefaultData(),primaryKey:d.getPrimaryKeyFieldNames(),cancel:!1};d.trigger(b1,n,function(e){if(!e.cancel){h.isAdded=!0,d.clearSelection();var t,i,n=new yD(h.serviceLocator,null,h.parent),o=new bD(h.parent).generateRows([e.defaultData]),r=n.render(o[0],d.getColumns());hF(r);for(var s=0;s<h.parent.groupSettings.columns.length;s++)r.insertBefore(h.parent.createElement("td",{className:"e-indentcell"}),r.firstChild),o[0].cells.unshift(new kE({cellType:LA.Indent}));var n=d.getContentTable().querySelector(oD),a=(r.classList.add("e-insertedrow"),n.querySelector(".e-emptyrow")&&((a=n.querySelector(".e-emptyrow")).parentNode.removeChild(a),d.frozenRows)&&d.element.querySelector(".e-frozenrow-empty")&&d.element.querySelector(".e-frozenrow-empty").classList.remove("e-frozenrow-empty"),n=(d.frozenRows&&"Top"===d.editSettings.newRowPosition?d.getHeaderTable():d.getContentTable()).querySelector(oD),"Top"===h.parent.editSettings.newRowPosition?n.insertBefore(r,n.firstChild):n.appendChild(r),U([].slice.call(r.getElementsByClassName(LE)),["e-updatedtd"]),o[0].isDirty=!0,o[0].changes=Pe({},{},o[0].data,!0),o[0].edit="add",h.addRowObject(o[0]),h.refreshRowIdx(),h.focus.forgetPrevious(),d.notify(f1,{rows:h.parent.getRowsObject()}),h.getBatchChanges()),n=h.getBottomIndex(),n=("Top"===h.parent.editSettings.newRowPosition?d.selectRow(0):d.selectRow(n),l||(i=h.findNextEditableCell(0,!0),t=d.getColumns()[parseInt(i.toString(),10)],"Top"===h.parent.editSettings.newRowPosition?h.editCell(0,t.field,!0):h.editCell(n,t.field,!0)),0<h.parent.aggregates.length&&(l||a[JE].length)&&h.parent.notify(px,{}),{defaultData:e.defaultData,row:r,columnObject:t,columnIndex:i,primaryKey:e.primaryKey,cell:je(i)?void 0:r.cells[parseInt(i.toString(),10)]});d.trigger(f1,n)}})}}else d.isEdit&&this.saveCell()},tX.prototype.findNextEditableCell=function(e,t,i){for(var n,o=this.parent.getColumns(),r=o.length,s=e;s<r;s++)if(n=!!i&&je(o[parseInt(s.toString(),10)].validationRules),t&&(!o[parseInt(s.toString(),10)].template||o[parseInt(s.toString(),10)].field)&&o[parseInt(s.toString(),10)].allowEditing&&o[parseInt(s.toString(),10)].visible&&(!o[parseInt(s.toString(),10)].isIdentity||!o[parseInt(s.toString(),10)].isPrimaryKey)&&!n)return s;return-1},tX.prototype.getDefaultData=function(){for(var e={},t={number:0,string:null,boolean:!1,date:null,datetime:null,dateonly:null},i=0,n=this.parent.columnModel;i<n.length;i++){var o=n[i];o.field&&x(o.field,0<=Object.keys(o).indexOf("defaultValue")?o.defaultValue:t[o.type],e)}return e},tX.prototype.setCellIdx=function(e){var t=0;this.parent.allowGrouping&&(t=this.parent.groupSettings.columns.length),this.cellDetails.cellIndex=e.cellIndex-t,this.cellDetails.rowIndex=parseInt(e.getAttribute("index"),10)},tX.prototype.editCell=function(e,t,i){var n=this.parent,o=n.getColumnByField(t);this.index=e,this.field=t,this.isAdd=i;var r=(r=n.getDataRows()).filter(function(e){return"none"!==e.style.display&&!e.classList.contains("e-childrow-hidden")}),r=parseInt(r[r.length-1].getAttribute("aria-rowindex"),10)-1,r=n.isEdit&&!(this.cellDetails.column.field===t&&this.cellDetails.rowIndex===e&&r!==e&&this.prevEditedBatchCell);n.editSettings.allowEditing&&(!r&&(o.allowEditing||!o.allowEditing&&n.focusModule.active&&n.focusModule.active.getTable().rows[this.crtRowIndex]&&n.focusModule.active.getTable().rows[this.crtRowIndex].classList.contains("e-insertedrow"))?this.editCellExtend(e,t,i):r&&(this.editNext=!0,this.saveCell()))},tX.prototype.editCellExtend=function(i,e,t){var n,o,r,s,a=this,l=this.parent,h=l.getColumnByField(e),e=l.getPrimaryKeyFieldNames();l.isEdit||(s=Pe({},{},this.getDataByIndex(i),!0),n=l.getDataRows()[parseInt(i.toString(),10)],s=Pe({},{},this.getDataByIndex(i),!0),e[0]===h.field&&!n.classList.contains("e-insertedrow")||h.columns||h.isPrimaryKey&&h.isIdentity||h.commands?this.parent.isLastCellPrimaryKey=!0:(this.parent.isLastCellPrimaryKey=!1,this.parent.element.classList.add("e-editing"),o=l.getRowObjectFromUID(n.getAttribute("data-uid")),r=[].slice.apply(n.cells),(e={columnName:h.field,isForeignKey:!je(h.foreignKeyValue),primaryKey:e,rowData:s,validationRules:Pe({},h.validationRules||{}),value:FB(h.field,s),type:t?"add":"edit",cancel:!1,foreignKeyData:o&&o.foreignKeyData}).cell=r[this.getColIndex(r,this.getCellIdx(h.uid))],e.row=n,e.columnObject=h,e.cell&&l.trigger(A1,e,function(e){var t;e.cancel||(e.cell=e.cell||r[a.getColIndex(r,a.getCellIdx(h.uid))],e.row=e.row||n,e.columnObject=e.columnObject||h,a.cellDetails={rowData:s,column:h,value:e.value,isForeignKey:e.isForeignKey,rowIndex:i,cellIndex:parseInt(e.cell.getAttribute(iD),10)-1,foreignKeyData:e.foreignKeyData},e.cell.classList.contains("e-updatedtd")&&(a.isColored=!0,e.cell.classList.remove("e-updatedtd")),l.isEdit=!0,t=!je(e.row.querySelector(".e-selectionbackground")),l.clearSelection(),l.isCheckBoxSelection&&l.isPersistSelection||!t&&l.selectionSettings.checkboxOnly||l.selectRow(a.cellDetails.rowIndex,!0),a.renderer.update(e),a.parent.notify(RI,e),a.form=ge("#"+l.element.id+"EditForm",l.element),l.editModule.applyFormValidation([h]),a.parent.element.querySelector(".e-gridpopup").style.display="none")})))},tX.prototype.updateCell=function(e,t,i){var n,o,r,s,a=this.parent,l=a.getColumnByField(t),h=a.getColumnIndexByField(t),d=a.getRowByIndex(e).classList.contains("e-insertedrow")&&a.getRowByIndex(e).classList.contains("e-batchrow");l&&(!l.isPrimaryKey||d)&&l.allowEditing&&(n=this.parent.isSpan?cF(a,e,h):mF(this.parent,0,e,h),!this.parent.isSpan||n)&&(o=a.getRowObjectFromUID(n.parentElement.getAttribute("data-uid")),a.isEdit||!o.changes&&(!(i instanceof Date)&&o.data[""+t]!==i||i instanceof Date&&new Date(o.data[""+t]).toString()!==new Date(i).toString())||o.changes&&(!(i instanceof Date)&&o.changes[""+t]!==i||i instanceof Date&&new Date(o.changes[""+t]).toString()!==new Date(i).toString()))&&(this.refreshTD(n,l,o,i),d=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,(this.parent.isReact&&this.parent.requireTemplateRef||d&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&l.template?(s=(r=this).newReactTd,r.parent.renderTemplates(function(){r.parent.trigger(zA,{cell:s||n,column:l,data:o.changes})})):((this.parent.isReact||d)&&l.template&&this.parent.renderTemplates(),this.parent.trigger(zA,{cell:this.newReactTd||n,column:l,data:o.changes})))},tX.prototype.setChanges=function(e,t,i){var n;e.changes||(e.changes=Pe({},{},e.data,!0)),je(t)||("string"==typeof i&&(i=this.parent.sanitize(i)),Sa.setValue(t,i,e.changes)),e.data[""+t]!==i&&("date"!==(n=this.parent.getColumnByField(t).type)&&"datetime"!==n||new Date(e.data[""+t]).toString()!==new Date(i).toString())&&(e.isDirty=!0)},tX.prototype.updateRow=function(e,t){for(var i=0,n=Object.keys(t);i<n.length;i++){var o=n[i];this.updateCell(e,o,t[""+o])}},tX.prototype.getCellIdx=function(e){e=this.parent.getColumnIndexByUid(e)+this.parent.groupSettings.columns.length;return je(this.parent.detailTemplate)&&je(this.parent.childGrid)||e++,this.parent.isRowDragable()&&e++,e},tX.prototype.refreshTD=function(e,t,i,n){var o,r,s=new VD(this.parent,this.serviceLocator),n=(n="number"!==t.type||je(n)?n:parseFloat(n),i&&(this.setChanges(i,t.field,n),EB(i,this.parent.getForeignKeyColumns(),i.changes)),i?i.cells:void 0);this.parent.isReact&&(o=e.parentElement,r=e.cellIndex);i&&s.refreshTD(e,n[+this.getCellIdx(t.uid)],i.changes,{index:this.getCellIdx(t.uid)}),(this.parent.isReact?(this.newReactTd=o.cells[parseInt(r.toString(),10)],o.cells[parseInt(r.toString(),10)]):e).classList.add("e-updatedtd"),e.classList.add("e-updatedtd"),this.parent.notify(Lx,{})},tX.prototype.getColIndex=function(e,t){var i=0;this.parent.allowGrouping&&this.parent.groupSettings.columns&&(i=this.parent.groupSettings.columns.length),je(this.parent.detailTemplate)&&je(this.parent.childGrid)||i++,this.parent.isRowDragable()&&i++;for(var n=0;n<e.length;n++)if(parseInt(e[parseInt(n.toString(),10)].getAttribute(iD),10)-1==t-i)return n;return-1},tX.prototype.editNextValCell=function(){var e=this.parent,t=e.element.querySelectorAll(".e-insertedrow"),i=1===t.length;if(i&&this.isAdded&&!e.isEdit){for(var n=this.getBottomIndex(),o=this.cellDetails.cellIndex;o<e.getColumns().length;o++){if(e.isEdit)return;var r,s=this.findNextEditableCell(this.cellDetails.cellIndex+1,!0,!0),s=e.getColumns()[parseInt(s.toString(),10)];s&&("Bottom"===this.parent.editSettings.newRowPosition?this.editCell(n,s.field,!0):(this.parent.notify(LT,r={index:0,column:s}),this.editCell(r.index,s.field,!0)),this.saveCell())}e.isEdit||(this.isAdded=!1)}else if(!i&&this.isAdded&&!e.isEdit){for(o=0;o<t.length&&!e.isEdit;o++)for(var a=0;a<this.validationColObj.length&&!e.isEdit;a++)""===t[parseInt(o.toString(),10)].querySelectorAll("td:not(.e-hide)")[this.validationColObj[parseInt(a.toString(),10)].cellIdx].innerHTML&&(this.editCell(parseInt(t[parseInt(o.toString(),10)].getAttribute("aria-rowindex"),10)-1,this.validationColObj[parseInt(a.toString(),10)].field),this.validateFormObj())&&this.saveCell();e.isEdit||(this.isAdded=!1)}},tX.prototype.escapeCellEdit=function(){var e=this.generateCellArgs();e.value=e.previousValue,!e.value&&this.cellDetails.column.validationRules||this.successCallBack(e,e.cell.parentElement,e.column,!0)(e)},tX.prototype.generateCellArgs=function(){var e=this.parent,t=(this.parent.element.classList.remove("e-editing"),this.cellDetails.column),i={};i[t.field]=FB(t.field,this.cellDetails.rowData);i=Pe({},e=e.editModule.getCurrentEditedData(this.form,i)),e=Pe({},e,this.cellDetails.rowData),i=FB(t.field,i),je(t.field)||ee(i)||x(t.field,i,e),i={columnName:t.field,value:FB(t.field,e),rowData:this.cellDetails.rowData,column:t,previousValue:this.cellDetails.value,isForeignKey:this.cellDetails.isForeignKey,cancel:!1};return i.cell=this.form.parentElement,i.columnObject=t,i},tX.prototype.saveCell=function(e){var t,i,n,o;!this.preventSaveCell&&this.form&&(t=this.parent,e||t.isEdit&&!this.validateFormObj())&&(this.preventSaveCell=!0,n=(i=this.generateCellArgs()).cell.parentElement,o=i.column,i.cell.removeAttribute("aria-label"),e?this.successCallBack(i,n,o)(i):(t.trigger(x1,i,this.successCallBack(i,n,o)),t.notify(BI,{formObj:this.form})))},tX.prototype.successCallBack=function(e,o,r,s){var a=this;return function(e){var t=a.parent;if(e.cell=e.cell||a.form.parentElement,e.columnObject=e.columnObject||r,e.cancel){if(a.preventSaveCell=!1,a.editNext){if(a.editNext=!1,a.cellDetails.rowIndex===a.index&&a.cellDetails.column.field===a.field)return;a.editCellExtend(a.index,a.field,a.isAdd)}}else{t.editModule.destroyWidgets([r]),t.isEdit=!1,t.editModule.destroyForm(),a.parent.notify(Nx,{});var i,n=t.getRowObjectFromUID(o.getAttribute("data-uid"));if(a.refreshTD(e.cell,r,n,e.value),a.parent.isReact&&(e.cell=a.newReactTd),q([o],[GE,"e-batchrow"]),q([e.cell],["e-editedbatchcell","e-boolcell"]),(!je(e.value)&&e.value.toString()===(je(a.cellDetails.value)?"":a.cellDetails.value).toString()&&!a.isColored||je(e.value)&&je(n.data[r.field])&&je(a.cellDetails.value)&&!e.cell.parentElement.classList.contains("e-insertedrow"))&&e.cell.classList.remove("e-updatedtd"),je(s)&&(n=t.isReact&&r.template&&"string"!=typeof r.template,i=t.parentDetails&&t.parentDetails.parentInstObj&&t.parentDetails.parentInstObj.isReact,n||i?t.requireTemplateRef?t.renderTemplates(function(){t.trigger(I1,e)}):(t.renderTemplates(),t.trigger(I1,e)):t.trigger(I1,e)),t.notify(Lx,{}),a.isColored=!1,0<a.parent.aggregates.length&&(a.parent.isReact||a.parent.isVue||a.parent.notify(px,{}),0<a.parent.groupSettings.columns.length&&!a.isAddRow(a.cellDetails.rowIndex)&&a.parent.notify(dx,{}),a.parent.isReact||a.parent.isVue)&&a.parent.notify(px,{}),a.preventSaveCell=!1,a.editNext){if(a.editNext=!1,a.cellDetails.rowIndex===a.index&&a.cellDetails.column.field===a.field&&a.prevEditedBatchCell)return;n=t.getColumnByField(a.field);n&&(n.allowEditing||!n.allowEditing&&t.focusModule.active&&t.focusModule.active.getTable().rows[a.crtRowIndex]&&t.focusModule.active.getTable().rows[a.crtRowIndex].classList.contains("e-insertedrow"))&&a.editCellExtend(a.index,a.field,a.isAdd)}s&&t.notify(qI,{})}}},tX.prototype.prevEditedBatchCellMatrix=function(){var e,t=[],i=this.parent.focusModule.active.getTable().querySelector(".e-editedbatchcell");return i&&(e=i.parentElement,t=[[].slice.call(this.parent.focusModule.active.getTable().rows).indexOf(e),[].slice.call(e.cells).indexOf(i)]),t},tX.prototype.getDataByIndex=function(e){e=this.parent.getRowObjectFromUID(this.parent.getDataRows()[parseInt(e.toString(),10)].getAttribute("data-uid"));return e.changes||e.data},tX.prototype.keyDownHandler=function(e){var t,i,n,o,r;(this.addBatchRow||("tab"===e.action||"shiftTab"===e.action)&&this.parent.isEdit)&&(t=this.parent,i=this.getBottomIndex(),o=A(e.target,LE),this.addBatchRow||o&&!this.parent.isReact)&&(n=void 0,o&&(n=o.querySelector(".e-field")),this.addBatchRow||n)&&(o=this.parent.getVisibleColumns(),r="tab"===e.action?o.length-1:0,!this.addBatchRow&&o[parseInt(r.toString(),10)].field!==n.getAttribute("id").slice(this.parent.element.id.length)||(this.cellDetails.rowIndex===i&&"tab"===e.action?("Top"===t.editSettings.newRowPosition?(t.editSettings.newRowPosition="Bottom",this.addRecord(),t.editSettings.newRowPosition="Top"):this.addRecord(),this.addBatchRow=!1):this.saveCell()))},tX.prototype.addCancelWhilePaging=function(){this.validateFormObj()&&(this.parent.notify(Ux,{}),this.parent.isEdit=!1,this.editNext=!1,this.mouseDownElement=void 0,this.isColored=!1)},tX.prototype.getBottomIndex=function(){var e=this.getBatchChanges();return this.parent.getCurrentViewRecords().length+e[JE].length-e[ZE].length-1};var eX=tX;function tX(e,t,i){this.cellDetails={},this.originalCell={},this.cloneCell={},this.editNext=!1,this.preventSaveCell=!1,this.initialRender=!0,this.validationColObj=[],this.addBatchRow=!1,this.prevEditedBatchCell=!1,this.parent=e,this.serviceLocator=t,this.renderer=i,this.focus=t.getService("focus"),this.addEventListener()}iX=function(e,t){return(iX=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}iX(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(rX,nX=YY),rX.prototype.closeEdit=function(){nX.prototype.closeEdit.call(this)},rX.prototype.addRecord=function(e,t){nX.prototype.addRecord.call(this,e,t)},rX.prototype.endEdit=function(){nX.prototype.endEdit.call(this)},rX.prototype.updateRow=function(e,t){nX.prototype.updateRow.call(this,e,t)},rX.prototype.deleteRecord=function(e,t){nX.prototype.deleteRecord.call(this,e,t)},rX.prototype.startEdit=function(e){nX.prototype.startEdit.call(this,e)};var iX,nX,oX=rX;function rX(e,t,i){var n=nX.call(this,e,t)||this;return n.parent=e,n.serviceLocator=t,n.renderer=i,n}sX=function(e,t){return(sX=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}sX(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(hX,aX=f7),hX.prototype.write=function(e){this.edit=this.parent.editModule,"datepickeredit"===e.column.editType&&(this.obj=new o9(Pe(dX(e,this.parent.editSettings.mode,this.parent.enableRtl,this.parent.cssClass,this),e.column.edit.params)),this.isMaskModuleInjected)&&(o9.Inject(Yq),this.isMaskModuleInjected=!1),"datetimepickeredit"===e.column.editType&&(this.obj=new jq(Pe(dX(e,this.parent.editSettings.mode,this.parent.enableRtl,this.parent.cssClass,this),e.column.edit.params))),this.obj.appendTo(e.element)};var sX,aX,lX=hX;function hX(e){e=aX.call(this,e)||this;return e.isMaskModuleInjected=!0,e}function dX(e,t,i,n,o){var t="Dialog"!==t,r=LB(e.column.format,e.column.type),s=FB(e.column.field,e.rowData);return{floatLabelType:t?"Never":"Always",value:s?new Date(s):null,format:r,placeholder:t?"":e.column.headerText,enableRtl:i,enabled:uB(e.column,e.requestType,e.element)&&gB(A(e.element,"e-rowcell")),cssClass:n||null,close:function(e){e.event&&"escape"===e.event.action&&(this.edit.editCellDialogClose=!0)}.bind(o)}}cX.prototype.read=function(e,t){return t},cX.prototype.write=function(){},cX.prototype.destroy=function(){};var pX=cX;function cX(e){this.parent=e}gX.prototype.updateColTypeObj=function(){for(var e=this.parent.columnModel,t=0;t<e.length;t++)this.parent.editSettings.template||e[parseInt(t.toString(),10)].editTemplate?e[parseInt(t.toString(),10)].edit=Pe(new gX.editCellType.templateedit(this.parent),e[parseInt(t.toString(),10)].edit||{}):e[parseInt(t.toString(),10)].edit=Pe(new gX.editCellType[e[parseInt(t.toString(),10)].editType&&gX.editCellType[e[parseInt(t.toString(),10)].editType]?e[parseInt(t.toString(),10)].editType:"defaultedit"](this.parent,this.serviceLocator),e[parseInt(t.toString(),10)].edit||{});this.parent.log("primary_column_missing")},gX.prototype.getModuleName=function(){return"edit"},gX.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var t=this.parent,i=0,n=Object.keys(e.properties);i<n.length;i++)switch(n[i]){case"allowAdding":case"allowDeleting":case"allowEditing":(t.editSettings.allowAdding||t.editSettings.allowEditing||t.editSettings.allowDeleting)&&this.initialEnd();break;case"mode":this.updateEditObj(),t.isEdit=!!t.editSettings.showAddNewRow,t.refresh()}},gX.prototype.updateEditObj=function(){this.editModule&&this.editModule.destroy(),this.renderer=new BY(this.parent,this.serviceLocator),this.editModule=new this.editType[this.parent.editSettings.mode](this.parent,this.serviceLocator,this.renderer)},gX.prototype.initialEnd=function(){this.updateColTypeObj()},gX.prototype.startEdit=function(e){var t=this.parent;if(t.editSettings.allowEditing&&(!t.isEdit||t.editSettings.showAddNewRow&&(!t.editSettings.showAddNewRow||je(t.element.querySelector("."+GE))))&&"Batch"!==t.editSettings.mode){if(this.parent.element.classList.add("e-editing"),!t.getSelectedRows().length||je(this.parent.getRowByIndex(parseInt(this.parent.getSelectedRows()[0].getAttribute("aria-rowindex"),10)-1))){if(!e)return void this.showDialog("EditOperationAlert",this.alertDObj)}else e=e||t.getSelectedRows()[0];this.parent.enableVirtualization&&"Normal"===this.parent.editSettings.mode&&(i=parseInt(e.getAttribute("aria-rowindex"),10)-1,e=this.parent.getRowByIndex(i));var i=t.getContent().querySelector("tr:last-child"),n=t.getHeaderContent().querySelector("tbody");t.frozenRows&&je(i)&&n&&n.querySelector("tr:last-child")?this.isLastRow=e.rowIndex===parseInt(t.getHeaderContent().querySelector("tbody").querySelector("tr:last-child").getAttribute("aria-rowindex"),10)-1:i&&(this.isLastRow=e.rowIndex===i.rowIndex),"none"!==e.style.display&&(this.editModule.startEdit(e),this.refreshToolbar(),t.element.querySelector(".e-gridpopup").style.display="none",this.parent.notify("start-edit",{}),t.editSettings.showAddNewRow)&&this.destroyToolTip()}},gX.prototype.checkLastRow=function(e,t){var i=this.isLastRow;"auto"!==this.parent.height&&"Bottom"===this.parent.editSettings.newRowPosition&&t&&"add"===t.requestType&&this.parent.getContent().firstElementChild.offsetHeight>this.parent.getContentTable().scrollHeight?U([].slice.call(e.getElementsByClassName(LE)),"e-lastrowadded"):i&&e&&e.classList&&U([].slice.call(e.getElementsByClassName(LE)),"e-lastrowcell")},gX.prototype.closeEdit=function(){"Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&this.parent.element.getElementsByClassName("e-updatedtd").length?this.showDialog("CancelEdit",this.dialogObj):(this.parent.element.classList.remove("e-editing"),this.editModule.closeEdit(),this.refreshToolbar(),this.parent.notify(ZT,{requestType:"cancel"}),this.parent.editSettings.showAddNewRow&&this.destroyToolTip())},gX.prototype.refreshToolbar=function(){this.parent.notify(Lx,{})},gX.prototype.addRecord=function(e,t){var i;this.parent.editSettings.allowAdding&&(i={startEdit:!0},e||this.parent.notify(iT,i),i.startEdit)&&(this.parent.element.classList.add("e-editing"),this.editModule.addRecord(e,t),this.refreshToolbar(),this.parent.notify("start-add",{}))},gX.prototype.deleteRecord=function(e,t){var i=this.parent;i.editSettings.allowDeleting&&(t||i.getSelectedRecords().length||!je(i.commandDelIndex)?i.editSettings.showDeleteConfirmDialog?(this.fieldname=e,this.data=t,this.showDialog("ConfirmDelete",this.dialogObj)):this.editModule.deleteRecord(e,t):this.showDialog("DeleteOperationAlert",this.alertDObj))},gX.prototype.deleteRow=function(e){this.deleteRowUid=e.getAttribute("data-uid");e=this.parent.getRowObjectFromUID(this.deleteRowUid);je(e)||this.deleteRecord(null,e.data)},gX.prototype.endEdit=function(){"Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&(je(this.formObj)||this.formObj.validate())&&(this.parent.editModule.saveCell(),this.parent.notify(xI,{}),je(this.formObj)||this.formObj.validate())?this.showDialog("BatchSaveConfirm",this.dialogObj):this.endEditing()},gX.prototype.updateCell=function(e,t,i){this.editModule.updateCell(e,t,i)},gX.prototype.updateRow=function(e,t){this.editModule.updateRow(e,t)},gX.prototype.batchCancel=function(){this.closeEdit()},gX.prototype.batchSave=function(){this.endEdit()},gX.prototype.editCell=function(e,t){this.editModule.editCell(e,t)},gX.prototype.editFormValidate=function(){return!this.formObj||this.formObj.validate()},gX.prototype.getBatchChanges=function(){return this.editModule.getBatchChanges?this.editModule.getBatchChanges():{}},gX.prototype.getCurrentEditCellData=function(){var e=this.getCurrentEditedData(this.formObj.element,{});return e[Object.keys(e)[0]]},gX.prototype.saveCell=function(){this.editModule.saveCell()},gX.prototype.endEditing=function(){this.parent.editSettings.showAddNewRow||this.parent.element.classList.remove("e-editing"),this.editModule.endEdit(),this.isShowAddedRowValidate=!1,this.refreshToolbar()},gX.prototype.showDialog=function(e,t){t.content="<div>"+this.l10n.getConstant(e)+"</div>",t.dataBind(),t.show(),this.parent.enableRtl&&t.refresh()},gX.prototype.getValueFromType=function(e,t){var i=t;switch(e.type){case"number":i=isNaN(parseFloat(t))?null:parseFloat(t);break;case"boolean":"booleanedit"!==e.editType&&(i=t===this.l10n.getConstant("True")||!0===t);break;case"date":case"datetime":"datepickeredit"!==e.editType&&"datetimepickeredit"!==e.editType&&t&&t.length?i=new Date(t):""===t&&(i=null);break;case"dateonly":i=(t=t&&new Date(t))?t.getFullYear()+"-"+kB(t.getMonth()+1)+"-"+kB(t.getDate()):null}return i},gX.prototype.destroyToolTip=function(){for(var e=0,t=[].slice.call(this.parent.element.getElementsByClassName("e-griderror"));e<t.length;e++)ue(t[e]);this.parent.getContent().firstElementChild.style.position="relative",this.parent.isFrozenGrid()&&(this.parent.element.querySelector(".e-gridheader")&&(this.parent.element.querySelector(".e-gridheader").style.position=""),this.parent.element.querySelector(".e-gridcontent").style.position="")},gX.prototype.createConfirmDlg=function(){this.dialogObj=this.dlgWidget([{click:this.dlgOk.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),cssClass:this.parent.cssClass?"e-primary "+this.parent.cssClass:"e-primary",isPrimary:!0}},{click:this.dlgCancel.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",content:this.l10n.getConstant("CancelButton")}}],"EditConfirm")},gX.prototype.createAlertDlg=function(){this.alertDObj=this.dlgWidget([{click:this.alertClick.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",isPrimary:!0}}],"EditAlert")},gX.prototype.alertClick=function(){this.alertDObj.hide()},gX.prototype.dlgWidget=function(e,t){var t=this.parent.createElement("div",{id:this.parent.element.id+t}),i=(this.parent.element.appendChild(t),{showCloseIcon:!1,isModal:!0,visible:!1,closeOnEscape:!0,target:this.parent.element,width:"320px",animationSettings:{effect:"None"},cssClass:this.parent.cssClass||""}),e=(i.buttons=e,new pS(i));return e.isStringTemplate=!0,e.appendTo(t),e},gX.prototype.dlgCancel=function(){this.parent.pagerModule&&(this.parent.pagerModule.isForceCancel=!1),this.parent.focusModule.clearIndicator(),this.dialogObj.hide(),this.parent.focusModule.restoreFocus({requestType:"cancel"}),this.parent.notify("cancelcnfrmDlg",{})},gX.prototype.dlgOk=function(){switch(this.dialogObj.element.querySelector(".e-dlg-content").firstElementChild.innerText){case this.l10n.getConstant("ConfirmDelete"):this.editModule.deleteRecord(this.fieldname,this.data),this.parent.editSettings.showDeleteConfirmDialog&&!this.parent.allowSelection&&(this.parent.commandDelIndex=void 0);break;case this.l10n.getConstant("CancelEdit"):this.editModule.closeEdit();break;case this.l10n.getConstant("BatchSaveConfirm"):this.endEditing();break;case this.l10n.getConstant("BatchSaveLostChanges"):"Batch"===this.parent.editSettings.mode&&this.editModule.addCancelWhilePaging(),this.parent.pagerModule&&(this.parent.pagerModule.isForceCancel=!1),this.executeAction()}this.dlgCancel()},gX.prototype.destroyEditComponents=function(){this.parent.isEdit&&(this.destroyWidgets(),this.destroyForm()),this.destroy()},gX.prototype.addEventListener=function(){this.parent.isDestroyed||(this.eventDetails=[{event:Z1,handler:this.onPropertyChanged},{event:G1,handler:this.initialEnd},{event:bx,handler:this.keyPressHandler},{event:Ox,handler:this.updateColTypeObj},{event:Nx,handler:this.destroyToolTip},{event:zx,handler:this.preventBatch},{event:Ux,handler:this.destroyForm},{event:Cx,handler:this.destroyEditComponents}],CF(this.parent,this.eventDetails,!0,this),this.actionBeginFunction=this.onActionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.on(AE,this.actionBeginFunction),this.parent.addEventListener(QA,this.actionCompleteFunction))},gX.prototype.removeEventListener=function(){this.parent.isDestroyed||(CF(this.parent,this.eventDetails,!1),this.parent.removeEventListener(QA,this.actionCompleteFunction),this.parent.off(AE,this.actionBeginFunction))},gX.prototype.actionComplete=function(e){["add","beginEdit","save","delete","cancel","filterAfterOpen","filterchoicerequest"].indexOf(e.requestType)<0&&(this.parent.isEdit=!!this.parent.editSettings.showAddNewRow),"batchsave"===e.requestType&&this.parent.focusModule.restoreFocus({requestType:"save"}),this.refreshToolbar()},gX.prototype.getCurrentEditedData=function(e,t){var i=this.parent;if(i.editSettings.template)for(var n,o=[].slice.call(e.elements),r=0;r<o.length;r++)!(o[parseInt(r.toString(),10)].hasAttribute("name")&&"e-multi-hidden"!==o[parseInt(r.toString(),10)].className||o[parseInt(r.toString(),10)].classList.contains("e-multiselect"))||"hidden"===o[parseInt(r.toString(),10)].type&&(A(o[parseInt(r.toString(),10)],"e-switch-wrapper")||A(o[parseInt(r.toString(),10)],"e-checkbox-wrapper"))||(n=o[parseInt(r.toString(),10)].hasAttribute("name")?cB(o[parseInt(r.toString(),10)].getAttribute("name")):cB(o[parseInt(r.toString(),10)].getAttribute("id")),d=void 0,"checkbox"===(n=i.getColumnByField(n)||{field:n,type:o[parseInt(r.toString(),10)].getAttribute("type")}).type||"boolean"===n.type?d=o[parseInt(r.toString(),10)].checked:o[parseInt(r.toString(),10)].value?(d=o[parseInt(r.toString(),10)].value,o[parseInt(r.toString(),10)].ej2_instances&&o[parseInt(r.toString(),10)].ej2_instances.length&&!je(o[parseInt(r.toString(),10)].ej2_instances[0].value)&&(o[parseInt(r.toString(),10)].blur(),d=o[parseInt(r.toString(),10)].ej2_instances[0].value)):o[parseInt(r.toString(),10)].ej2_instances&&(d=o[parseInt(r.toString(),10)].ej2_instances[0].value),n.edit&&"string"==typeof n.edit.read?d=R(n.edit.read,window)(o[parseInt(r.toString(),10)],d):n.edit&&n.edit.read&&(d=n.edit.read(o[parseInt(r.toString(),10)],d)),d=i.editModule.getValueFromType(n,d),"radio"===o[parseInt(r.toString(),10)].type?o[parseInt(r.toString(),10)].checked&&Sa.setValue(n.field,d,t):("string"==typeof d&&this.parent.sanitize(d),Sa.setValue(n.field,d,t)));else{for(var s=i.columnModel.filter(function(e){return e.editTemplate}),a=0;a<s.length;a++)if(e[dB(s[parseInt(a.toString(),10)].field)]){var l=[].slice.call(e[dB(s[parseInt(a.toString(),10)].field)]).filter(function(e){return"input"===e.tagName.toLowerCase()}),h=(l=l.length?l:[e[dB(s[parseInt(a.toString(),10)].field)]]).filter(function(e){return!je(e.ej2_instances)});0===h.length&&(h=l.filter(function(e){return e.hasAttribute("name")}));for(r=0;r<h.length;r++){var d=this.getValue(s[parseInt(a.toString(),10)],h[parseInt(r.toString(),10)],t);"string"===s[parseInt(a.toString(),10)].type&&(d=this.parent.sanitize(d)),Sa.setValue(s[parseInt(a.toString(),10)].field,d,t)}}for(var p=[].slice.call(e.getElementsByClassName("e-field")),c=0,u=p.length;c<u;c++){var g=i.getColumnByUid(p[parseInt(c.toString(),10)].getAttribute("e-mappinguid"));g&&g.field&&(d=this.getValue(g,p[parseInt(c.toString(),10)],t),"string"!==g.type||g.isForeignColumn()&&"string"!=typeof d||(d=this.parent.sanitize(d)),Sa.setValue(g.field,d,t))}}return t},gX.prototype.getValue=function(e,t,i){var n=(t.ej2_instances?t.ej2_instances[0]:t).value,o=this.parent,r=e.edit.read;return"checkbox"!==e.type&&"boolean"!==e.type||(n=t.checked),n="string"==typeof r?(r=R(r,window),o.editModule.getValueFromType(e,r(t,n))):o.editModule.getValueFromType(e,e.edit.read(t,n)),n=je(i[e.field])&&""===n?i[e.field]:n},gX.prototype.onActionBegin=function(e){var t,i,n,o;("columnstate"===e.requestType||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&"sorting"===e.requestType)&&this.parent.isEdit&&"Batch"!==this.parent.editSettings.mode?this.closeEdit():(o=this.parent.element.querySelector("."+GE),t=this.parent.element.querySelector("."+YE),o&&this.parent.frozenRows&&"virtualscroll"===e.requestType&&parseInt(A(o,UE).getAttribute(nD),10)-1<this.parent.frozenRows||(i=-1===["filterAfterOpen","filterBeforeOpen","filterchoicerequest","filterSearchBegin","save","infiniteScroll","virtualscroll"].indexOf(e.requestType),n=!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&!je(this.parent.element.querySelector(".e-editedrow")),o=(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.formObj&&n&&!this.formObj.isDestroyed&&(o||t||"cancel"===e.requestType)&&i,(!this.parent.enableVirtualization&&n&&"Batch"!==this.parent.editSettings.mode&&this.formObj&&!this.formObj.isDestroyed&&i&&!e.cancel||o)&&(this.destroyWidgets(),this.destroyForm())))},gX.prototype.destroyWidgets=function(e){var t=this.parent;if(t.isWidgetsDestroyed=!0,t.editSettings.template&&((t=(t=BF(this.parent)).isReact?t:this.parent).destroyTemplate(["editSettingsTemplate"]),this.parent.isReact)&&this.parent.renderTemplates(),"Dialog"===this.parent.editSettings.mode&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length){e=[];for(var i=this.parent.getColumns(),n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)];(o.visible||-1<this.parent.groupSettings.columns.indexOf(o.field))&&e.push(o)}}else e=e||this.parent.getCurrentVisibleColumns(this.parent.enableColumnVirtualization);e.some(function(e){return!je(e.editTemplate)})&&(this.parent.destroyTemplate(["editTemplate"]),this.parent.isReact)&&this.parent.renderTemplates();for(var r=0,s=e;r<s.length;r++){var a=s[r],l=a.edit.destroy;a.edit.destroy&&("string"==typeof l?(l=R(l,window))():a.edit.destroy())}for(var h=[].slice.call(this.formObj.element.elements),n=0;n<h.length;n++){var d=h[parseInt(n.toString(),10)];d.hasAttribute("name")&&(d=je(d.parentElement)?null:d.parentElement.classList.contains("e-ddl")?d.parentElement.querySelector("input"):d)&&d.ej2_instances&&d.ej2_instances.length&&!d.ej2_instances[0].isDestroyed&&(d.ej2_instances[0].destroy(),d.remove())}},gX.prototype.destroyForm=function(){this.destroyToolTip();for(var e=[this.formObj,this.virtualFormObj],t=this.parent.columnModel.filter(function(e){return e.editTemplate}),i=0;i<e.length;i++)e[parseInt(i.toString(),10)]&&e[parseInt(i.toString(),10)].element&&!e[parseInt(i.toString(),10)].isDestroyed&&(e[parseInt(i.toString(),10)].destroy(),!BF(this.parent).isReact||"Dialog"!==this.parent.editSettings.mode||je(this.parent.editSettings.template)&&!t.length||e[parseInt(i.toString(),10)].element.remove());this.destroyToolTip()},gX.prototype.destroy=function(){var e,t=this.parent.element;t&&((t=!(!t.querySelector("."+RE)||!t.querySelector("."+OE)))&&this.destroyForm(),this.removeEventListener(),0<(e=this.dialogObj.element).childElementCount&&(this.dialogObj.destroy(),ue(e)),0<(e=this.alertDObj.element).childElementCount&&(this.alertDObj.destroy(),ue(e)),t)&&this.editModule&&this.editModule.destroy()},gX.prototype.keyPressHandler=function(e){switch(/(Mac)/i.test(navigator.platform)&&e.metaKey&&"ctrlEnter"===e.action&&(e.action="insert"),e.action){case"insert":this.addRecord();break;case"delete":"INPUT"===e.target.tagName&&!e.target.classList.contains("e-checkselect")||document.querySelector(".e-popup-open.e-edit-dialog")||this.deleteRecord();break;case"f2":this.startEdit();break;case"enter":A(e.target,"e-unboundcelldiv")||"Batch"===this.parent.editSettings.mode||!(A(e.target,OE)||(this.parent.frozenRows||this.parent.editSettings.showAddNewRow&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))&&A(e.target,VE))||document.getElementsByClassName("e-popup-open").length&&(!document.querySelectorAll(".e-popup-open .e-editcell").length||document.querySelectorAll(".e-popup-open:not(.e-dialog)").length)||(e.preventDefault(),this.parent.isEdit&&(this.parent.isFocusFirstCell=!0),this.endEdit());break;case"escape":this.parent.isEdit&&!this.editCellDialogClose&&("Batch"===this.parent.editSettings.mode?this.editModule.escapeCellEdit():this.curretRowFocus(e)),this.editCellDialogClose&&(this.editCellDialogClose=!1);break;case"tab":case"shiftTab":this.curretRowFocus(e)}},gX.prototype.curretRowFocus=function(e){if(this.parent.isEdit&&"Batch"!==this.parent.editSettings.mode){this.parent.isWidgetsDestroyed=!1;var t=A(e.target,"e-editedrow")||A(e.target,"e-addedrow");if(t){var i=[].slice.call(t.querySelectorAll(".e-input:not(.e-disabled)")),n=[].slice.call(t.querySelectorAll(".e-unboundcell"));if(n&&n.length)for(var o=0;o<n.length;o++)i=i.concat([].slice.call(n[parseInt(o.toString(),10)].querySelectorAll(".e-btn:not(.e-hide)")));var r=(r=A(e.target,"e-rowcell"))&&r.classList.contains("e-unboundcell")?e.target:r,s=A(i[i.length-1],"e-rowcell");if(r===(s=s&&s.classList.contains("e-unboundcell")?i[i.length-1]:s)&&"tab"===e.action||"escape"===e.action||r===A(i[0],"e-rowcell")&&"shiftTab"===e.action&&!this.parent.editSettings.showAddNewRow){s=t.getAttribute("data-uid"),r=(this.parent.allowGrouping?je(this.parent.getContent())?[]:[].slice.call(this.parent.getContent().querySelectorAll("tr")):this.parent.getRows()).map(function(e){return e.getAttribute("data-uid")}).indexOf(s);if(this.parent.frozenRows&&(A(t,"e-gridheader")?r=t.rowIndex:A(t,"e-gridcontent")&&(r-=this.parent.frozenRows)),t.classList.contains("e-addedrow")&&(r=0),"escape"===e.action?(this.parent.isFocusFirstCell=!0,this.closeEdit()):(this.isShowAddedRowValidate=!0,this.parent.selectionModule.preventFocus=!1,this.parent.isFocusFirstCell=!0,this.endEdit(),this.isShowAddedRowValidate=!1),this.parent.focusModule.active&&(!this.parent.editSettings.showAddNewRow||t.classList.contains("e-editedrow")||this.parent.editSettings.showAddNewRow&&t.classList.contains("e-addedrow")&&je(this.parent.element.querySelector('.e-griderror:not([style*="display: none"])')))){var a=0,s=this.parent.focusModule.active.matrix;if(s&&s.matrix.length&&s.matrix[parseInt(r.toString(),10)])for(var l=s.matrix[parseInt(r.toString(),10)],o=0;o<l.length;o++)if(0<l[parseInt(o.toString(),10)]){a=o;break}t=R(r+".cells."+a,this.parent.focusModule.active.matrix.getRowsFromIndex(r,this.parent.focusModule.active));t&&0===t.getBoundingClientRect().width&&(a=this.parent.focusModule.active.matrix.nextVisibleCellFocus(r,a,e.action,this.parent.focusModule.active.keyActions[e.action],this.parent.focusModule.active,this.parent.focusModule.active.matrix.current[1])[1]),this.parent.focusModule.active.matrix.current=[r,a]}}this.parent.editSettings.showAddNewRow&&"tab"===e.action&&A(e.target,"e-addedrow")&&(this.isShowAddedRowValidate=!0)}}},gX.prototype.preventBatch=function(e){this.preventObj=e,this.showDialog("BatchSaveLostChanges",this.dialogObj)},gX.prototype.executeAction=function(){this.preventObj.handler.call(this.preventObj.instance,this.preventObj.arg1,this.preventObj.arg2,this.preventObj.arg3,this.preventObj.arg4,this.preventObj.arg5,this.preventObj.arg6,this.preventObj.arg7,this.preventObj.arg8)},gX.prototype.applyFormValidation=function(e,t){var i=this.parent,n="Dialog"!==this.parent.editSettings.mode?(i.editSettings.showAddNewRow&&i.element.querySelector("."+GE)?i.element.querySelector("."+GE):i.element).getElementsByClassName("e-gridform")[parseInt(0..toString(),10)]:ge("#"+i.element.id+"_dialogEdit_wrapper .e-gridform",document),o={},r={},s={};e=e||i.getColumns();for(var a=0;a<e.length;a++)(e[parseInt(a.toString(),10)].visible||"Dialog"===i.editSettings.mode&&(-1!==i.groupSettings.columns.indexOf(e[parseInt(a.toString(),10)].field)||"Dialog"!==i.editSettings.mode))&&e[parseInt(a.toString(),10)].validationRules&&je(t)&&fF(e[parseInt(a.toString(),10)],1,o,r,s,e.length);o=Pe(o,r,s),this.parent.editModule.formObj=this.createFormObj(n,t||o)},gX.prototype.createFormObj=function(e,t){var n=this;return new nN(e,{rules:t,locale:this.parent.locale,validationComplete:function(e){n.validationComplete(e)},customPlacement:function(e,t){var i=e.getAttribute("e-mappinguid"),i={column:n.parent.getColumnByUid(i),error:t,inputElement:e,value:e.value};(!(event&&event.relatedTarget&&event.relatedTarget.classList.contains("e-cancelbutton"))&&!n.parent.editSettings.showAddNewRow||n.parent.editSettings.showAddNewRow&&event&&event.target&&(A(event.target,n.parent.element.id+"_update",!0)||A(event.target,"e-grid-menu")&&(event.target.classList.contains("e-save")||event.target.querySelector(".e-save"))||n.isShowAddedRowValidate||A(event.target,"e-unboundcell")&&A(event.target,"e-update")||"enter"===event.action&&(A(event.target,"e-content")||A(event.target,"e-addedrow")))||n.parent.editSettings.showAddNewRow&&!je(n.parent.element.querySelector("."+GE)))&&n.valErrorPlacement(e,t),n.isShowAddedRowValidate=!1,n.parent.notify(QI,i)}})},gX.prototype.valErrorPlacement=function(e,t){var i,n;this.parent.isEdit&&(i=t.getAttribute("for"),(n=this.getElemTable(e).querySelector("#"+pB(i)+"_Error"))?n.querySelector(".e-tip-content").innerHTML=t.outerHTML:this.createTooltip(e,t,i,""))},gX.prototype.getElemTable=function(e){var t=this.parent,e="Dialog"!==t.editSettings.mode?(e=t.frozenRows&&z(e,"."+UE)&&t.frozenRows>(parseInt(z(e,"."+UE).getAttribute(nD),10)-1||0),this.parent.isFrozenGrid()?t.element:e||t.editSettings.showAddNewRow&&(t.enableVirtualization||t.enableInfiniteScrolling)?t.getHeaderTable():t.getContentTable()):ge("#"+t.element.id+"_dialogEdit_wrapper",document);return e},gX.prototype.resetElemPosition=function(e,t){var i,t=A(t.element,LE);t&&(t=t.getBoundingClientRect().right)<(i=e.getBoundingClientRect().right)&&(e.style.left=e.offsetLeft-(i-t)+"px")},gX.prototype.validationComplete=function(e){var t,i;this.parent.isEdit&&(t=this.getElemTable(e.element).querySelector("#"+pB(e.inputName)+"_Error"),this.parent.editSettings.showAddNewRow&&!t&&e.element&&(i=A(e.element,"e-rowcell").querySelector(".e-error"))&&i.classList.remove("e-error"),t)&&("failure"===e.status?(t.style.display="",this.resetElemPosition(t,e)):t.style.display="none")},gX.prototype.createTooltip=function(e,t,i,n){var o,r,s,a,l=this.formObj.element,h=A(e,"e-virtual-validation"),d=(h&&(l=this.virtualFormObj.element),this.parent.getContent().firstElementChild),p=d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth,c="Dialog"!==this.parent.editSettings.mode,u=z(e,"."+LE),g=z(e,"."+UE),m=!1,f=!1,y=this.parent.editSettings.showAddNewRow&&!je(A(e,YE))&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling),v=Math.round(this.parent.getContent().clientHeight/this.parent.getRowHeight())-1,b=[].slice.call(this.parent.getContent().getElementsByClassName(UE)),w=("Batch"===this.parent.editSettings.mode&&(b=[].slice.call(this.parent.getContent().querySelectorAll(".e-row:not(.e-hiddenrow)")),1<v)&&b.length>v&&parseInt(b[b.length-1].getAttribute(nD),10)-1==parseInt(g.getAttribute(nD),10)-1&&(f=!0),c&&((m=(this.parent.frozenRows||y)&&(w=this.parent.editSettings.showAddNewRow?".e-row:not(.e-hiddenrow.e-addedrow)":".e-row:not(.e-hiddenrow)",m=(a=(w=[].slice.call(this.parent.getHeaderTable().querySelector(oD).querySelectorAll(w))).length>(parseInt(g.getAttribute(nD),10)-1||0))&&parseInt(g.getAttribute(nD),10)-1==w.length-1,1===(w=[].slice.call(this.parent.getHeaderTable().querySelector(oD).querySelectorAll(".e-row:not(.e-hiddenrow)"))).length)&&(w[0].classList.contains("e-addedrow")||w[0].classList.contains("e-insertedrow"))?!0:m)||1<v&&b.length>v&&("Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType||u.classList.contains("e-lastrowcell")&&!g.classList.contains(YE))||f)&&(o=!0),c?a?this.parent.getHeaderTable():this.parent.getContentTable():ge("#"+this.parent.element.id+"_dialogEdit_wrapper .e-dlg-content",document)),m=w.getBoundingClientRect(),g=(c?this.parent.element.getBoundingClientRect():m).left,f=z(e,"td"),C=(f||e.parentElement).getBoundingClientRect(),i=this.parent.createElement("div",{className:"e-tooltip-wrap e-lib e-control e-popup e-griderror",id:i+"_Error"}),n=(rt(i,"display:"+n+";top:"+((a?C.top+C.height:C.bottom-m.top)+w.scrollTop+9)+"px;left:"+(C.left-g+w.scrollLeft+C.width/2)+"px;max-width:"+C.width+"px;text-align:center;"),this.parent.cssClass&&i.classList.add(this.parent.cssClass),c&&m.left<g&&(i.style.left=parseInt(i.style.left,10)-m.left+g+"px"),this.parent.createElement("div",{className:"e-tip-content"})),w=(n.appendChild(t),o?((r=this.parent.createElement("div",{className:"e-arrow-tip e-tip-bottom"})).appendChild(this.parent.createElement("div",{className:"e-arrow-tip-outer e-tip-bottom"})),r.appendChild(this.parent.createElement("div",{className:"e-arrow-tip-inner e-tip-bottom"}))):((r=this.parent.createElement("div",{className:"e-arrow-tip e-tip-top"})).appendChild(this.parent.createElement("div",{className:"e-arrow-tip-outer e-tip-top"})),r.appendChild(this.parent.createElement("div",{className:"e-arrow-tip-inner e-tip-top"}))),i.appendChild(n),i.appendChild(r),h||!this.parent.frozenRows&&!y||"Dialog"===this.parent.editSettings.mode?h?this.virtualFormObj.element.appendChild(i):"Dialog"!==this.parent.editSettings.mode&&this.parent.isFrozenGrid()?u.classList.contains("e-unfreeze")?(U([i],"e-unfreeze"),this.formObj.element.appendChild(i)):((s=z(u,".e-gridheader")?this.parent.element.querySelector(".e-gridheader"):1===b.length?this.parent.element.querySelector(".e-gridcontent").querySelector(".e-content"):this.parent.element.querySelector(".e-gridcontent")).appendChild(i),s.style.position="relative"):this.formObj.element.appendChild(i):(("Normal"===this.parent.editSettings.mode?z(e,".e-editcell"):z(e,"."+QE)).style.position="relative",i.style.position="absolute",("Batch"===this.parent.editSettings.mode||z(e,"."+zE)||z(e,"."+jE)||this.parent.frozenRows||y)&&(this.parent.isFrozenGrid()?u.classList.contains("e-unfreeze")?(U([i],"e-unfreeze"),l.appendChild(i)):((s=z(u,".e-gridheader")?this.parent.element.querySelector(".e-gridheader"):1===b.length?this.parent.element.querySelector(".e-gridcontent").querySelector(".e-content"):this.parent.element.querySelector(".e-gridcontent")).appendChild(i),s.style.position="relative"):l.appendChild(i))),je(u)||(u.classList.contains("e-fixedfreeze")?i.classList.add("e-fixederror"):(u.classList.contains("e-leftfreeze")||u.classList.contains("e-rightfreeze"))&&i.classList.add("e-freezeerror")),!o&&c&&d.getBoundingClientRect().bottom<C.bottom+C.height&&(a=this.parent.getContent().querySelector(".e-content"),0===this.parent.currentViewData.length&&0===a.scrollTop?a.scrollTop=i.offsetHeight+r.scrollHeight:d.scrollTop=d.scrollTop+i.offsetHeight+r.scrollHeight),parseInt(document.defaultView.getComputedStyle(i,null).getPropertyValue("font-size"),10));(this.parent.frozenRows||y)&&"Dialog"!==this.parent.editSettings.mode?i.style.left=f.offsetLeft+(f.offsetWidth/2-i.offsetWidth/2)+"px":i.style.left=parseInt(i.style.left,10)-i.offsetWidth/2+"px",i.getBoundingClientRect().width<C.width&&2<=i.querySelector("label").getBoundingClientRect().height/(1.2*w)&&(i.style.width=i.style.maxWidth),(c&&!p&&!this.parent.allowPaging||this.parent.frozenRows||y)&&(m=R0(f,i),i.style.top=m.top+C.height+9+"px"),o&&(!p||"auto"===this.parent.height||this.parent.frozenRows&&y||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||i.classList.contains("e-freezeerror")&&i.classList.contains("e-fixederror")?i.style.bottom=C.height+9+"px":(g=d.scrollWidth>d.offsetWidth?aB():0,t=-1===this.parent.height.toString().indexOf("%")?parseInt(this.parent.height,10):d.offsetHeight,i.style.bottom=t-d.querySelector("table").offsetHeight-g+C.height+9+"px"),b.length<v&&"Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType&&(n=(this.parent.frozenRows?(y?this.parent.frozenRows+1:this.parent.frozenRows)+(b.length-1):b.length-1)*this.parent.getRowHeight(),h=this.parent.getContent().clientHeight-n,i.style.bottom=9+h+"px"),i.style.top=null)},gX.prototype.checkColumnIsGrouped=function(e){return!(e.visible||-1<this.parent.groupSettings.columns.indexOf(e.field))},gX.AddEditors=function(e){gX.editCellType=Pe(gX.editCellType,e)},gX.editCellType={dropdownedit:HY,numericedit:jY,datepickeredit:lX,datetimepickeredit:lX,booleanedit:l9,defaultedit:qY,templateedit:pX};var uX=gX;function gX(e,t){this.isShowAddedRowValidate=!1,this.editType={Inline:ZY,Normal:ZY,Batch:eX,Dialog:oX},this.fieldname="",this.data={},this.editCellDialogClose=!1,this.parent=e,this.serviceLocator=t,this.l10n=this.serviceLocator.getService("localization"),this.addEventListener(),this.updateEditObj(),this.createAlertDlg(),this.createConfirmDlg()}fX.prototype.destroy=function(){var e=this,t=this.parent.element;(t.querySelector("."+OE)||t.querySelector("."+RE))&&t&&(this.removeEventListener(),this.unWireEvents(),this.infiniteLoadedElement=null,this.infiniteDiv=null,je(this.dlgObj)||!this.dlgObj.element||this.dlgObj.isDestroyed||(this.parent.isReact&&this.parent.columnChooserSettings.template?rB.timer?(clearTimeout(rB.timer),rB.timer=null):rB.timer=setTimeout(function(){je(e.dlgObj)||!e.dlgObj.element||e.dlgObj.isDestroyed||e.dlgObj.destroy()},0):this.dlgObj.destroy(),je(t=document.getElementById(this.parent.element.id+"_e-popup")))||ue(t))},fX.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,NA.isColumnChooser),this.parent.enableAdaptiveUI&&(this.parent.on(bE,this.renderResponsiveColumnChooserDiv,this),this.parent.on(vE,this.renderResponsiveChangeAction,this))},fX.prototype.rtlUpdate=function(){je(this.innerDiv)||(this.parent.enableRtl?U:q)([].slice.call(this.innerDiv.getElementsByClassName("e-checkbox-wrapper")),["e-rtl"])},fX.prototype.addEventListener=function(){!this.parent.isDestroyed&&(E.add(document,"click",this.clickHandler,this),this.parent.on(K1,this.enableAfterRenderEle,this),this.parent.on(G1,this.render,this),this.parent.addEventListener(qA,this.hideDialogFunction),this.parent.on(Cx,this.destroy,this),this.parent.on(bI,this.rtlUpdate,this),this.parent.on(yT,this.onResetColumns,this),this.parent.on(WT,this.setFullScreenDialog,this),this.parent.enableAdaptiveUI&&this.parent.on(vE,this.renderResponsiveChangeAction,this),this.infiniteRenderMode||this.parent.enableAdaptiveUI)&&this.parent.on(bE,this.renderResponsiveColumnChooserDiv,this)},fX.prototype.removeEventListener=function(){!this.parent.isDestroyed&&(E.remove(document,"click",this.clickHandler),this.parent.off(G1,this.render),this.parent.off(Cx,this.destroy),this.parent.off(K1,this.enableAfterRenderEle),this.parent.off(bI,this.rtlUpdate),this.parent.off(yT,this.onResetColumns),this.parent.removeEventListener(qA,this.hideDialogFunction),this.parent.off(WT,this.setFullScreenDialog),this.infiniteDiv&&(E.remove(this.infiniteDiv,"scroll",this.infiniteScrollHandler),E.remove(this.infiniteDiv,"mouseup",this.infiniteScrollMouseKeyUpHandler),E.remove(this.infiniteDiv,"mousedown",this.infiniteScrollMouseKeyDownHandler)),this.parent.enableAdaptiveUI&&(this.parent.off(WT,this.setFullScreenDialog),this.parent.off(vE,this.renderResponsiveChangeAction)),this.infiniteRenderMode||this.parent.enableAdaptiveUI)&&this.parent.off(bE,this.renderResponsiveColumnChooserDiv)},fX.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.parent.enableAdaptiveUI||this.renderDlgContent(),this.getShowHideService=this.serviceLocator.getService("showHideService")},fX.prototype.clickHandler=function(e){var t=e.target;if(!this.isCustomizeOpenCC){if(je(z(t,".e-cc-toolbar"))&&je(z(t,".e-cc")))je(this.dlgObj)||!this.dlgObj.visible||t.classList.contains("e-toolbar-items")||(this.dlgObj.hide(),this.clearActions(),this.refreshCheckboxState(),this.isDlgOpen=!1);else if(t.classList.contains("e-columnchooser-btn")||t.classList.contains("e-cc-toolbar")){if(this.initialOpenDlg&&this.dlgObj.visible||!this.isDlgOpen)return void(this.isDlgOpen=!0)}else t.classList.contains("e-cc-cancel")&&(t.parentElement.querySelector(".e-ccsearch").value="",this.columnChooserSearch("",!1),this.removeCancelIcon(),this.refreshCheckboxButton());(this.parent.detailTemplate||this.parent.childGrid)&&(this.targetdlg=e.target)}this.isCustomizeOpenCC&&e.target.classList.contains("e-cc-cancel")&&this.refreshCheckboxState(),this.parent.enableAdaptiveUI?this.parent.enableRtl&&U([this.cBoxTrue,this.cBoxFalse],["e-rtl"]):this.rtlUpdate()},fX.prototype.hideDialog=function(){!je(this.dlgObj)&&this.dlgObj.visible&&(this.parent.enableAdaptiveUI?this.responsiveDialogRenderer.hideResponsiveColumnChooser():(this.dlgObj.hide(),this.isDlgOpen=!1))},fX.prototype.renderColumnChooser=function(e,t,i){if(this.dlgObj.visible||!this.parent.detailTemplate&&!this.parent.childGrid||this.hideOpenedDialog(),this.dlgObj.visible)this.hideDialog(),this.addcancelIcon(),this.clearActions(),this.refreshCheckboxState();else{var n=this.beforeOpenColumnChooserEvent();if(n.cancel)return;n.columns=null,i&&(this.targetdlg=i),this.infiniteRenderMode&&this.dlgObj.show(),this.refreshCheckboxState(),this.dlgObj.dataBind(),this.dlgObj.element.style.maxHeight="430px";var n=this.dlgObj.element.style.display,o=(this.parent.columnChooserSettings.enableSearching||(this.dlgObj.element.querySelector(".e-dlg-content").style.margin="0px"),this.dlgObj.element.style.display="block",this.parent.getHeaderContent().classList.contains("e-sticky")),r=z(i,".e-toolbar-item"),s=void 0;document.getElementById(this.parent.element.id+"_e-popup")&&document.getElementById(this.parent.element.id+"_e-popup").querySelector(".e-ccdlg")&&this.parent.element.appendChild(this.dlgObj.element),o?(s=r.getBoundingClientRect(),this.dlgObj.element.classList.add("e-sticky")):(this.dlgObj.element.classList.remove("e-sticky"),s=R0(r,this.dlgObj.element)),this.dlgObj.element.style.display=n,this.dlgObj.element.style.top=s.top+z(i,".e-cc-toolbar").getBoundingClientRect().height+"px";je(z(i,".e-bigger"))||(this.dlgObj.width=258),F.isDevice?(this.dlgObj.position={X:"center",Y:"center"},this.dlgObj.refreshPosition(),this.dlgObj.open=this.mOpenDlg.bind(this)):this.parent.enableRtl?this.dlgObj.element.style.left=i.offsetLeft+"px":this.dlgObj.element.style.left=s.left-250+z(i,".e-cc-toolbar").clientWidth+2+"px",this.removeCancelIcon(),this.infiniteRenderMode||this.dlgObj.show(),this.parent.getContent().firstElementChild.offsetHeight<this.dlgObj.element.offsetHeight&&!this.parent.element.classList.contains("e-drillthrough-grid")&&(rF(this.parent,this.dlgObj),this.dlgObj.element.querySelector(".e-ccsearch"))&&this.dlgObj.element.querySelector(".e-ccsearch").select(),this.parent.notify(PI,{dialog:this.dlgObj})}this.rtlUpdate()},fX.prototype.openColumnChooser=function(e,t){if(this.isCustomizeOpenCC=!0,this.parent.enableAdaptiveUI){if(!this.isColumnChooserOpen)return void this.parent.showResponsiveCustomColumnChooser();this.isColumnChooserOpen=!1,this.renderDlgContent()}var i;this.dlgObj.visible?this.hideDialog():(i=this.beforeOpenColumnChooserEvent()).cancel||(i.columns=null,this.infiniteRenderMode&&this.dlgObj.show(),this.isInitialOpen?this.refreshCheckboxState():(this.dlgObj.content=this.renderChooserList(),this.parent.columnChooserSettings.template||this.updateIntermediateBtn()),this.dlgObj.dataBind(),this.infiniteRenderMode&&this.refreshCheckboxState(),this.dlgObj.position={X:"center",Y:"center"},je(e)?(this.parent.enableAdaptiveUI&&(this.dlgObj.position={X:"",Y:""}),this.dlgObj.refreshPosition()):(this.dlgObj.element.style.top="",this.dlgObj.element.style.left="",this.dlgObj.element.style.top=t+"px",this.dlgObj.element.style.left=e+"px"),this.parent.columnChooserSettings.enableSearching||(this.dlgObj.element.querySelector(".e-dlg-content").style.margin="0px"),this.dlgObj.beforeOpen=this.customDialogOpen.bind(this),this.infiniteRenderMode||this.dlgObj.show(),this.parent.getContent().firstElementChild.offsetHeight<this.dlgObj.element.offsetHeight&&!this.parent.element.classList.contains("e-drillthrough-grid")&&rF(this.parent,this.dlgObj),this.isInitialOpen=!0,this.dlgObj.beforeClose=this.customDialogClose.bind(this))},fX.prototype.enableAfterRenderEle=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},fX.prototype.keyUpHandler=function(e){"Escape"===e.key&&this.resetColumnState(),e&&e.target&&!je(z(e.target,".e-grid-popup"))&&this.parent.trigger("keyPressed",e),this.setFocus(A(e.target,"e-cclist"))},fX.prototype.setFocus=function(e){var t=this.dlgDiv.querySelector(".e-colfocus");t&&t.classList.remove("e-colfocus"),e&&e.classList.add("e-colfocus")},fX.prototype.customDialogOpen=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");E.add(e,"keyup",this.columnChooserManualSearch,this)},fX.prototype.customDialogClose=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");E.remove(e,"keyup",this.columnChooserManualSearch)},fX.prototype.getColumns=function(){return(this.infiniteRenderMode?this.infiniteColumns:this.parent.getColumns()).filter(function(e){return"checkbox"!==e.type&&!0===e.showInColumnChooser||"checkbox"===e.type&&void 0!==e.field})},fX.prototype.renderDlgContent=function(){var e=this.parent.enableAdaptiveUI;this.dlgDiv=this.parent.createElement("div",{className:"e-ccdlg e-cc",id:this.parent.element.id+"_ccdlg"}),e||this.parent.element.appendChild(this.dlgDiv),this.dlgObj=new pS({header:this.parent.enableAdaptiveUI?null:this.renderHeader(),showCloseIcon:!1,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,target:document.getElementById(this.parent.element.id),content:this.renderChooserList(),width:250,cssClass:this.parent.cssClass?"e-cc "+this.parent.cssClass:"e-cc",animationSettings:{effect:"None"},footerTemplate:this.parent.enableAdaptiveUI?null:this.renderFooter()}),e||!this.infiniteRenderMode&&this.parent.columnChooserSettings.footerTemplate||(this.dlgObj.buttons=[{click:this.confirmDlgBtnClick.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),isPrimary:!0,cssClass:this.parent.cssClass?"e-cc e-cc_okbtn "+this.parent.cssClass:"e-cc e-cc_okbtn"}},{click:this.clearBtnClick.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat e-cc e-cc-cnbtn "+this.parent.cssClass:"e-flat e-cc e-cc-cnbtn",content:this.l10n.getConstant("CancelButton")}}]);this.dlgObj.isStringTemplate=!0,this.dlgObj.appendTo(this.dlgDiv),e&&((e=document.querySelector(".e-responsive-dialog > .e-dlg-content > .e-mainfilterdiv"))&&e.appendChild(this.dlgDiv),this.dlgObj.open=this.mOpenDlg.bind(this),this.dlgObj.target=document.querySelector(".e-rescolumnchooser > .e-dlg-content > .e-mainfilterdiv")),this.wireEvents()},fX.prototype.renderHeader=function(){var e,t;return this.parent.columnChooserSettings.headerTemplate&&!this.infiniteRenderMode?(e=this.parent.createElement("div",{className:"e-columnChooserHeaderTemplate"}),t=this.parent.element.id+"columnChooserHeaderTemplate",this.parent.isReact?(this.parent.getColumnChooserHeaderTemplate()(null,this.parent,"columnChooserHeaderTemplate",t,null,null,e),this.parent.renderTemplates()):eB(e,this.parent.getColumnChooserHeaderTemplate()(null,this.parent,"columnChooserHeaderTemplate",t)),e):this.l10n.getConstant("ChooseColumns")},fX.prototype.renderFooter=function(){var e,t;return this.parent.columnChooserSettings.footerTemplate&&!this.infiniteRenderMode?(e=this.parent.createElement("div",{className:"e-columnChooserFooterTemplate"}),t=this.parent.element.id+"columnChooserFooterTemplate",this.parent.isReact?(this.parent.getColumnChooserFooterTemplate()(null,this.parent,"columnChooserFooterTemplate",t,null,null,e),this.parent.renderTemplates()):eB(e,this.parent.getColumnChooserFooterTemplate()(null,this.parent,"columnChooserFooterTemplate",t)),e):null},fX.prototype.renderChooserList=function(){this.mainDiv=this.parent.createElement("div",{className:"e-main-div e-cc"});var e,t=this.parent.createElement("div",{className:"e-cc-searchdiv e-cc e-input-group"}),i=this.parent.createElement("input",{className:"e-ccsearch e-cc e-input",attrs:{placeholder:this.l10n.getConstant("Search"),cssClass:this.parent.cssClass}}),n=this.parent.createElement("span",{className:"e-ccsearch-icon e-icons e-cc e-input-group-icon",attrs:{title:this.l10n.getConstant("Search")}}),o=this.parent.createElement("div",{className:"e-cc-contentdiv"}),r=(this.innerDiv=this.parent.createElement("div",{className:"e-innerdiv e-cc"}),t.appendChild(i),t.appendChild(n),this.searchBoxObj=new tk(i,this.serviceLocator),this.getColumns()),s=[],a=[];if(r.forEach(function(e){(e.visible?s:a).push(e.headerText)}),this.infiniteRenderMode&&!this.isInitialOpen)for(var r=this.parent.columns,l=0;l<r.length;l++)r[parseInt(l.toString(),10)].showInColumnChooser&&this.infiniteColumns.push(r[parseInt(l.toString(),10)]);return this.parent.columnChooserSettings.template&&!this.infiniteRenderMode?((n=this.parent.createElement("div",{className:"e-columnChooserTemplate"})).style.cssText=this.parent.enableAdaptiveUI?"height: 90%; min-height: 160px; overflow-y: auto;":"height: 196px; overflow-y: auto;",i=this.parent.element.id+"columnChooserTemplate",e={columns:r,hideColumns:a,showColumns:s},this.parent.isReact?(this.parent.getColumnChooserTemplate()(e,this.parent,"columnChooserTemplate",i,null,null,n),this.parent.renderTemplates()):eB(n,this.parent.getColumnChooserTemplate()(e,this.parent,"columnChooserTemplate",i,null,null,null,this.parent.root)),this.parent.columnChooserSettings.renderCustomColumnChooser&&("function"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser?this.parent.columnChooserSettings.renderCustomColumnChooser(n,r):"string"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser&&(this.parent.columnChooserSettings.renderCustomColumnChooser=FB(this.parent.columnChooserSettings.renderCustomColumnChooser,window),this.parent.columnChooserSettings.renderCustomColumnChooser(n,r))),this.mainDiv.appendChild(t),this.mainDiv.appendChild(n)):(e=this.refreshCheckboxList(r),this.innerDiv.appendChild(e),o.appendChild(this.innerDiv),this.parent.enableAdaptiveUI?((i=this.parent.createElement("div",{className:"e-cc-searchBox"})).appendChild(t),this.mainDiv.appendChild(i)):this.mainDiv.appendChild(t),this.mainDiv.appendChild(o)),this.parent.columnChooserSettings.enableSearching||(t.style.display="none"),this.mainDiv},fX.prototype.confirmDlgBtnClick=function(e){var t,i={requestType:"columnVisibilityUpdate",columns:this.getColumns(),cancel:!1};this.parent.trigger(WA,i),i.cancel||(this.stateChangeColumns=[],this.changedStateColumns=[],i=this.infiniteRenderMode?this.infiniteColumns:this.parent.getColumns(),this.changedColumns=0<this.changedColumns.length?this.changedColumns:this.unchangedColumns,this.changedColumnState(this.changedColumns),t=this.infiniteRenderMode?this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-uncheck")}).length:this.ulElement&&this.ulElement.querySelector(".e-uncheck")&&this.ulElement.querySelectorAll(".e-uncheck:not(.e-selectall)").length,je(e)||(t<i.length&&(this.changeColumnVisibility({visibleColumns:this.showColumn,hiddenColumns:this.hideColumn},"uid"),0===this.parent.getCurrentViewRecords().length)&&this.parent.element.querySelector(".e-emptyrow").querySelector("td").setAttribute("colSpan",this.parent.getVisibleColumns().length.toString()),this.parent.enableAdaptiveUI&&this.parent.scrollModule&&this.parent.scrollModule.refresh(),this.parent.editSettings.showAddNewRow&&this.parent.notify(wE,{})),e={requestType:"columnVisibilityUpdate",columns:this.getColumns(),cancel:!1},this.parent.trigger(QA,e))},fX.prototype.changeColumnVisibility=function(t,i){var e;"uid"!==(i=i||"headerText")&&(t.visibleColumns||t.hiddenColumns)&&(this.stateChangeColumns=[],this.changedStateColumns=[],e=this.getColumns(),t.hiddenColumns=e.filter(function(e){return-1!==t.hiddenColumns.indexOf(e[i])}).map(function(e){return e.uid}),t.visibleColumns=e.filter(function(e){return-1!==t.visibleColumns.indexOf(e[i])}).map(function(e){return e.uid})),t.hiddenColumns.length&&this.columnStateChange(t.hiddenColumns,!1),t.visibleColumns.length&&this.columnStateChange(t.visibleColumns,!0),this.getShowHideService.setVisible(this.stateChangeColumns,this.changedStateColumns),this.clearActions(),this.parent.notify(Nx,{module:"edit"})},fX.prototype.onResetColumns=function(e){"columnstate"===e.requestType&&this.resetColumnState()},fX.prototype.renderResponsiveColumnChooserDiv=function(e){"open"===e.action?(this.isColumnChooserOpen=!0,this.openColumnChooser()):"clear"===e.action?this.clearBtnClick():"confirm"===e.action&&this.confirmDlgBtnClick(!0)},fX.prototype.resetColumnState=function(){var e;this.showColumn=[],this.hideColumn=[],this.changedColumns=[],this.filterColumns=[],this.searchValue="",this.infiniteRenderMode&&(e=this.dlgDiv.querySelector(".e-cclist.e-cc-selectall.e-colfocus"))&&e.classList.remove("e-colfocus"),this.hideDialog()},fX.prototype.changedColumnState=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)],i=this.parent.getColumnByUid(i,this.infiniteRenderMode);this.changedStateColumns.push(i)}},fX.prototype.columnStateChange=function(e,t){for(var i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)],n=this.parent.getColumnByUid(n,this.infiniteRenderMode);n&&("checkbox"!==n.type&&(n.visible=t),this.stateChangeColumns.push(n))}},fX.prototype.clearActions=function(){this.resetColumnState(),this.addcancelIcon()},fX.prototype.clearBtnClick=function(){var e={requestType:"columnChooserClose",cancel:!1};this.parent.trigger(WA,e),e.cancel||(this.clearActions(),this.parent.notify(mT,{dialog:this.dlgObj}),this.parent.trigger(QA,{requestType:"columnChooserClose",cancel:!1}))},fX.prototype.checkstatecolumn=function(e,t,i){void 0===i&&(i=!1);var n=this.parent.getColumnByUid(t,this.infiniteRenderMode);e?(-1!==this.hideColumn.indexOf(t)&&this.hideColumn.splice(this.hideColumn.indexOf(t),1),-1!==this.showColumn.indexOf(t)||n&&n.visible||this.showColumn.push(t)):(-1!==this.showColumn.indexOf(t)&&this.showColumn.splice(this.showColumn.indexOf(t),1),-1===this.hideColumn.indexOf(t)&&n&&n.visible&&this.hideColumn.push(t)),i?(e?this.unchangedColumns:this.changedColumns).push(t):-1!==this.changedColumns.indexOf(t)?this.changedColumns.splice(this.changedColumns.indexOf(t),1):this.changedColumns.push(t)},fX.prototype.columnChooserSearch=function(e,t){if(t){var i={requestType:"columnChooserSearch",columns:this.getColumns(),cancel:!1};if(this.parent.trigger(WA,i),i.cancel)return}var n,o,r,s,a,l,i=!1,h=this.dlgDiv.querySelector(".e-footer-content"),d=this.ulElement&&this.ulElement.querySelector(".e-check")&&this.ulElement.querySelectorAll(".e-check:not(.e-selectall)").length;this.infiniteRenderMode&&(d=this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-check")}).length),this.isInitialOpen=!0,h&&h.querySelector(".e-btn")&&(n=h.querySelector(".e-btn").ej2_instances[0]),""===e?(this.removeCancelIcon(),this.filterColumns=this.getColumns(),i=!0):this.filterColumns=new me(this.getColumns()).executeLocal((new ya).where("headerText",this.searchOperator,e,!0,this.parent.columnChooserSettings.ignoreAccent)),this.infiniteRenderMode&&this.updateIfiniteSelectAll(),this.parent.columnChooserSettings.template&&!this.infiniteRenderMode?(h=void 0,(l=this.parent.isReact)?(EF(this.parent,["columnChooserTemplate"]),h=this.mainDiv.querySelector(".e-columnChooserTemplate")):(this.mainDiv.querySelector(".e-columnChooserTemplate").remove(),(h=this.parent.createElement("div",{className:"e-columnChooserTemplate"})).style.cssText=this.parent.enableAdaptiveUI?"height: 90%; min-height: 160px; overflow-y: auto;":"height: 196px; overflow-y: auto;"),o=this.parent.element.id+"columnChooserTemplate",a=this.filterColumns,e=e,r=[],s=[],a.forEach(function(e){(e.visible?r:s).push(e.headerText)}),a={columns:a,hideColumns:s,showColumns:r,searchValue:e},l?(this.parent.getColumnChooserTemplate()(a,this.parent,"columnChooserTemplate",o,null,null,h),this.parent.renderTemplates()):eB(h,this.parent.getColumnChooserTemplate()(a,this.parent,"columnChooserTemplate",o,null,null,null,this.parent.root)),this.parent.columnChooserSettings.renderCustomColumnChooser&&("function"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser?this.parent.columnChooserSettings.renderCustomColumnChooser(h,this.filterColumns):"string"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser&&(this.parent.columnChooserSettings.renderCustomColumnChooser=FB(this.parent.columnChooserSettings.renderCustomColumnChooser,window),this.parent.columnChooserSettings.renderCustomColumnChooser(h,this.filterColumns))),this.mainDiv.appendChild(h)):this.filterColumns.length?(this.innerDiv.innerHTML=" ",this.innerDiv.classList.remove("e-ccnmdiv"),this.infiniteInitialLoad=!0,this.infiniteLoadedElement=[],this.innerDiv.appendChild(this.refreshCheckboxList(this.filterColumns)),this.infiniteRenderMode&&(this.mainDiv.querySelector(".e-ccheck .e-selectall").parentElement.classList.remove("e-checkbox-disabled"),this.updateIntermediateBtn()),i?(n&&d&&(n.disabled=!1),d&&this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(VT,{disabled:!1})):(this.addcancelIcon(),this.refreshCheckboxButton())):((e=this.parent.createElement("span",{className:"e-cc e-nmatch"})).innerHTML=this.l10n.getConstant("Matchs"),this.innerDiv.innerHTML=" ",this.infiniteRenderMode&&(q([this.mainDiv.querySelector(".e-frame.e-selectall")],["e-check","e-stop","e-uncheck"]),this.mainDiv.querySelector(".e-ccheck .e-selectall").parentElement.classList.add("e-checkbox-disabled")),this.innerDiv.appendChild(e),this.innerDiv.classList.add("e-ccnmdiv"),n&&(n.disabled=!0),this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(VT,{disabled:!0})),this.flag=!0,this.stopTimer(),t&&(l={requestType:"columnChooserSearch",columns:this.getColumns(),cancel:!1},this.parent.trigger(QA,l))},fX.prototype.updateIfiniteSelectAll=function(){this.changedColumns=[],this.hideColumn=[],this.showColumn=[];for(var e=this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-uncheck")}),t=0;t<e.length;t++)this.checkState(e[parseInt(t.toString(),10)].querySelector(".e-frame"),!0)},fX.prototype.wireEvents=function(){E.add(this.dlgObj.element,"click",this.checkBoxClickHandler,this),E.add(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch,this),E.add(this.dlgObj.element,"keyup",this.keyUpHandler,this),this.searchBoxObj.wireEvent()},fX.prototype.unWireEvents=function(){this.parent.isDestroyed||(this.dlgObj&&this.dlgObj.element&&(E.remove(this.dlgObj.element,"click",this.checkBoxClickHandler),E.remove(this.dlgObj.element,"keyup",this.keyUpHandler)),this.searchBoxObj&&(E.remove(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch),this.searchBoxObj.unWireEvent()))},fX.prototype.checkBoxClickHandler=function(e){if(!this.parent.columnChooserSettings.template||this.infiniteRenderMode){var t,i=A(e.target,"e-checkbox-wrapper"),n=this.infiniteRenderMode?this.infiniteColumns:this.parent.getColumns();if(i){i.querySelector(".e-selectall")?this.updateSelectAll(!i.querySelector(".e-check")):AB(i.parentElement),i.querySelector(".e-chk-hidden").focus(),i.querySelector(".e-check")?t=!0:i.querySelector(".e-uncheck")&&(t=!1),this.infiniteRenderMode||this.updateIntermediateBtn();var o=A(i,"e-ccheck").getAttribute("uid"),r=this.searchValue&&this.searchValue.length?this.filterColumns:n;if(o===this.parent.element.id+"-selectAll"){this.changedColumns=[],this.unchangedColumns=[];for(var s=0;s<r.length;s++)r[parseInt(s.toString(),10)].showInColumnChooser&&this.checkstatecolumn(t,r[parseInt(s.toString(),10)].uid,!0)}else this.checkstatecolumn(t,o);n=!!(this.infiniteRenderMode&&i.querySelector(".e-selectall")&&i.querySelector(".e-uncheck"));this.parent.columnChooserSettings.footerTemplate||this.refreshCheckboxButton(n),this.setFocus(A(e.target,"e-cclist")),this.infiniteRenderMode&&this.updateIntermediateBtn()}}},fX.prototype.updateIntermediateBtn=function(){var e,t=this.infiniteRenderMode?this.infiniteLoadedElement.length:this.ulElement.children.length-1,i=[],n=0,o=0,r=((this.searchValue&&this.searchValue.length?this.filterColumns:this.infiniteColumns).filter(function(e){!1===e.visible?n++:o++}),(this.infiniteRenderMode&&this.mainDiv.querySelector(".e-cc-selectall")?this.mainDiv.querySelector(".e-cc-selectall"):this.ulElement.children[0]).querySelector(".e-frame")),s=(this.infiniteRenderMode?this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-check")}):this.ulElement.querySelectorAll(".e-check:not(.e-selectall)")).length,a=(this.parent.enableAdaptiveUI||this.parent.columnChooserSettings.footerTemplate?this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(VT,{disabled:!1}):(e=this.dlgObj.btnObj[0]).disabled=!1,r.parentElement.querySelector("input"));t===s&&(!this.infiniteRenderMode||this.infiniteRenderMode&&n===this.showColumn.length)?(i=["e-check"],xB(a,!0)):s||this.infiniteRenderMode&&!s&&o!==this.hideColumn.length?(i=["e-stop"],a.indeterminate=!0):(xB(a,!(i=["e-uncheck"])),e&&!this.parent.enableAdaptiveUI?e.disabled=!0:this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(VT,{disabled:!0})),e&&!this.parent.enableAdaptiveUI&&e.dataBind(),q([r],["e-check","e-stop","e-uncheck"]),U([r],i)},fX.prototype.updateSelectAll=function(e){var t=[].slice.call(this.ulElement.getElementsByClassName("e-frame"));this.infiniteRenderMode&&(t=[],this.infiniteLoadedElement.map(function(e){return t.push(e.querySelector(".e-frame"))}),t.unshift(this.mainDiv.querySelector(".e-cc-selectall").querySelector(".e-frame")));for(var i=0,n=t;i<n.length;i++){var o=n[i],r=(TB(o,e),o.parentElement.querySelector("input"));o.classList.contains("e-check")?xB(r,!0):o.classList.contains("e-uncheck")&&xB(r,!1)}},fX.prototype.refreshCheckboxButton=function(e){for(var t=this.parent.getVisibleColumns(),i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)].uid;-1===this.prevShowedCols.indexOf(n)&&"checkbox"!==t[parseInt(i.toString(),10)].type&&this.prevShowedCols.push(n)}for(i=0;i<this.hideColumn.length;i++){var o=this.prevShowedCols.indexOf(this.hideColumn[parseInt(i.toString(),10)]);-1!==o&&this.prevShowedCols.splice(o,1)}for(var r,s=0!==this.showColumn.length?1:this.prevShowedCols.length,a=(this.infiniteRenderMode&&(s=this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-uncheck")}).length),this.parent.enableAdaptiveUI?this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(VT,{disabled:!1}):(r=this.dlgDiv.querySelector(".e-footer-content").querySelector(".e-btn").ej2_instances[0]).disabled=!1,[]),l=[].slice.call(document.getElementsByClassName("e-cc-chbox")),i=0,h=l.length;i<h;i++){var d=l[parseInt(i.toString(),10)];this.infiniteRenderMode&&d.classList.contains("e-selectall")||(n=A(d,"e-ccheck").getAttribute("uid"),a.push(n))}var p=this.showColumn.filter(function(e){return-1!==a.indexOf(e)});(this.infiniteRenderMode&&(e||a.length===s)||!this.infiniteRenderMode&&0===s&&0===p.length)&&(this.parent.enableAdaptiveUI?this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(VT,{disabled:!0}):r.disabled=!0),this.parent.enableAdaptiveUI||r.dataBind()},fX.prototype.refreshCheckboxList=function(e){this.ulElement=this.parent.createElement("ul",{className:"e-ccul-ele e-cc"});var t=this.l10n.getConstant("SelectAll"),i=this.parent.createElement("li",{className:"e-cclist e-cc e-cc-selectall"}),t=(rt(i,this.infiniteRenderMode?"list-style: None;":""),this.createCheckBox(t,!1,this.parent.element.id+"-selectAll"));return e.length&&(t.querySelector(".e-checkbox-wrapper").firstElementChild.classList.add("e-selectall"),t.querySelector(".e-frame").classList.add("e-selectall"),this.checkState(t.querySelector(".e-icons"),!0),i.appendChild(t),this.infiniteRenderMode?this.mainDiv.querySelector(".e-cc-contentdiv")&&!this.mainDiv.querySelector(".e-cc-selectall")&&(this.infiniteDiv=this.mainDiv.querySelector(".e-cc-contentdiv"),this.mainDiv.insertBefore(i,this.infiniteDiv),this.infiniteDiv.classList.add("e-checkbox-infinitescroll"),E.add(this.infiniteDiv,"scroll",this.infiniteScrollHandler,this),E.add(this.infiniteDiv,"mouseup",this.infiniteScrollMouseKeyUpHandler,this),E.add(this.infiniteDiv,"mousedown",this.infiniteScrollMouseKeyDownHandler,this)):this.ulElement.appendChild(i)),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?U([t],this.parent.cssClass.split(" ")):U([t],[this.parent.cssClass])),this.infiniteRenderMode&&e.length>3*this.itemsCount&&(this.infiniteSkipCount=2*this.itemsCount),this.renderCheckbox(e.slice(0,this.infiniteRenderMode?3*this.itemsCount:e.length)),this.ulElement},fX.prototype.infiniteScrollMouseKeyDownHandler=function(){E.remove(this.infiniteDiv,"scroll",this.infiniteScrollHandler)},fX.prototype.infiniteScrollMouseKeyUpHandler=function(e){var t=this,i=(E.add(this.infiniteDiv,"scroll",this.infiniteScrollHandler,this),this.infiniteDiv);1<this.ulElement.children.length&&(i.scrollTop>=i.scrollHeight-i.offsetHeight||i.scrollTop<=0)&&this.infiniteScrollHandler(),rB.timer=setTimeout(function(){t.clickHandler(e),rB.timer=null},0)},fX.prototype.infiniteScrollHandler=function(){var e,t,i=this.infiniteDiv,n=this.searchValue&&this.searchValue.length?this.filterColumns:this.infiniteColumns;i.scrollTop>=i.scrollHeight-i.offsetHeight&&this.infiniteLoadedElement.length<=this.infiniteSkipCount+this.itemsCount&&this.ulElement.children.length===3*this.itemsCount&&(!n.length||n.length>this.infiniteSkipCount+this.itemsCount)?(t=0,(e=n.length-(this.infiniteSkipCount+this.itemsCount))<this.itemsCount&&(t=e),DF([].slice.call(this.ulElement.children).splice(0,this.itemsCount)),this.infiniteInitialLoad=!0,this.infiniteSkipCount+=this.itemsCount,this.renderCheckbox(n.slice(this.infiniteSkipCount,this.infiniteSkipCount+(t+this.itemsCount))),this.prevInfiniteScrollDirection="down"):i.scrollTop>=i.scrollHeight-i.offsetHeight&&this.infiniteLoadedElement.length>this.infiniteSkipCount+this.itemsCount&&this.ulElement.children.length===3*this.itemsCount?(DF([].slice.call(this.ulElement.children).splice(0,this.itemsCount)),this.infiniteSkipCount+="down"===this.prevInfiniteScrollDirection?this.itemsCount:3*this.itemsCount,eB(this.ulElement,this.infiniteLoadedElement.slice(this.infiniteSkipCount,this.itemsCount+this.infiniteSkipCount)),this.prevInfiniteScrollDirection="down"):0===i.scrollTop&&!this.infiniteInitialLoad&&this.infiniteSkipCount&&this.infiniteLoadedElement.length&&this.infiniteLoadedElement.length>3*this.itemsCount&&this.ulElement.children.length===3*this.itemsCount?(DF([].slice.call(this.ulElement.children).splice(2*this.itemsCount,this.itemsCount)),this.infiniteSkipCount-="up"===this.prevInfiniteScrollDirection?this.itemsCount:3*this.itemsCount,MF([].slice.call(this.infiniteLoadedElement.slice(this.infiniteSkipCount,this.infiniteSkipCount+this.itemsCount)),this.ulElement),this.prevInfiniteScrollDirection="up",this.infiniteDiv.scrollTop=this.infiniteScrollAppendDiff):0===i.scrollTop&&!this.infiniteInitialLoad&&this.infiniteSkipCount&&this.infiniteSkipCount>2*this.itemsCount&&this.infiniteLoadedElement.length&&this.ulElement.children.length<3*this.itemsCount&&(DF([].slice.call(this.ulElement.children).splice(2*this.itemsCount,n.length%this.itemsCount)),this.infiniteSkipCount=(Math.floor(n.length/this.itemsCount)-3)*this.itemsCount,MF([].slice.call(this.infiniteLoadedElement.slice(this.infiniteSkipCount,this.infiniteSkipCount+this.itemsCount)),this.ulElement),this.infiniteDiv.scrollTop=this.infiniteScrollAppendDiff,this.prevInfiniteScrollDirection="up")},fX.prototype.refreshCheckboxState=function(){if(this.parent.columnChooserSettings.enableSearching){this.dlgObj.element.querySelector(".e-cc.e-input").value="",this.columnChooserSearch("",!1);for(var e=this.parent,t=this.dlgObj.element.querySelectorAll(".e-cc-chbox:not(.e-selectall)"),i=0,n=t.length;i<n;i++){var o=t[parseInt(i.toString(),10)],r=void 0,r=(this.parent.childGrid||this.parent.detailTemplate?A(this.dlgObj.element.querySelectorAll(".e-cc-chbox:not(.e-selectall)")[parseInt(i.toString(),10)],"e-ccheck"):A(o,"e-ccheck")).getAttribute("uid"),r=e.getColumnByUid(r,this.infiniteRenderMode),s=[].slice.call(o.parentElement.getElementsByClassName("e-uncheck"));r.visible&&!s.length?(o.checked=!0,this.checkState(o.parentElement.querySelector(".e-icons"),!0)):(o.checked=!1,this.checkState(o.parentElement.querySelector(".e-icons"),!1))}}},fX.prototype.checkState=function(e,t){t?mt(e,["e-check"],["e-uncheck"]):mt(e,["e-uncheck"],["e-check"])},fX.prototype.createCheckBox=function(e,t,i){var n=(t?this.cBoxTrue:this.cBoxFalse).cloneNode(!0),o=(this.parent.enableAdaptiveUI||!this.parent.enableRtl||n.classList.contains("e-rtl")||n.classList.add("e-rtl"),n.querySelector(".e-label")),r=n.querySelector("input");return xB(r,t),o.setAttribute("id",i+"label"),o.innerHTML=e,r.setAttribute("aria-labelledby",o.id),IB(i,n,"e-ccheck")},fX.prototype.renderCheckbox=function(e){for(var t,i=this.parent.createElement("div"),n=this.ulElement.offsetHeight,o=0;o<e.length;o++){var r,s,a,l=e[parseInt(o.toString(),10)];l.showInColumnChooser&&((r=this.parent.createElement("li",{className:"e-cclist e-cc",id:"e-ccli_"+l.uid})).style.listStyle="none",a=-1!==this.hideColumn.indexOf(l.uid),s=-1!==this.showColumn.indexOf(l.uid),a=this.createCheckBox(l.headerText,l.visible&&!a||s,l.uid),r.appendChild(a),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?U([a],this.parent.cssClass.split(" ")):U([a],[this.parent.cssClass])),this.infiniteRenderMode&&this.infiniteDiv&&(r.style.height=kF(this.infiniteDiv,!0)+"px"),i.appendChild(r))}this.infiniteRenderMode&&this.infiniteInitialLoad&&((t=this.infiniteLoadedElement).push.apply(t,[].slice.call(i.children)),this.infiniteInitialLoad=!1),eB(this.ulElement,[].slice.call(i.children)),this.infiniteRenderMode&&!this.infiniteScrollAppendDiff&&(this.infiniteScrollAppendDiff=this.ulElement.offsetHeight-n),this.isInitialOpen&&this.updateIntermediateBtn()},fX.prototype.columnChooserManualSearch=function(e){this.addcancelIcon(),this.searchValue=e.target.value,this.stopTimer(),this.startTimer(e)},fX.prototype.startTimer=function(e){var t=this,e=t.flag||13===e.keyCode?0:500;this.timer=window.setInterval(function(){t.columnChooserSearch(t.searchValue,!0)},e)},fX.prototype.stopTimer=function(){window.clearInterval(this.timer)},fX.prototype.addcancelIcon=function(){this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon")&&(this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").classList.add("e-cc-cancel"),this.dlgDiv.querySelector(".e-cc-cancel").setAttribute("title",this.l10n.getConstant("Clear")))},fX.prototype.removeCancelIcon=function(){this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon")&&(this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").classList.remove("e-cc-cancel"),this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").setAttribute("title",this.l10n.getConstant("Search")))},fX.prototype.mOpenDlg=function(){F.isDevice&&(this.dlgObj.element.querySelector(".e-cc-searchdiv")&&this.dlgObj.element.querySelector(".e-cc-searchdiv").classList.remove("e-input-focus"),this.dlgObj.element.querySelectorAll(".e-cc-chbox")[0])&&this.dlgObj.element.querySelectorAll(".e-cc-chbox")[0].focus(),this.parent.enableAdaptiveUI&&this.dlgObj.element.querySelector(".e-cc-searchdiv")&&this.dlgObj.element.querySelector(".e-cc-searchdiv").classList.add("e-input-focus")},fX.prototype.getModuleName=function(){return"columnChooser"},fX.prototype.hideOpenedDialog=function(){for(var e=[].slice.call(document.getElementsByClassName("e-ccdlg")).filter(function(e){return e.classList.contains("e-popup-open")}),t=0,i=e.length;t<i;t++)this.parent.element.id+"_ccdlg"===e[parseInt(t.toString(),10)].id&&!e[parseInt(t.toString(),10)].classList.contains("e-dialog")||e[parseInt(t.toString(),10)].ej2_instances[0].hide()},fX.prototype.beforeOpenColumnChooserEvent=function(){var e={requestType:"beforeOpenColumnChooser",element:this.parent.element,columns:this.getColumns(),cancel:!1,searchOperator:this.parent.columnChooserSettings.operator};return this.parent.trigger(M1,e),this.searchOperator=e.searchOperator,e},fX.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},fX.prototype.showCustomColumnChooser=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog()};var mX=fX;function fX(e,t){this.filterColumns=[],this.showColumn=[],this.hideColumn=[],this.changedColumns=[],this.unchangedColumns=[],this.infiniteLoadedElement=[],this.isDlgOpen=!1,this.isColumnChooserOpen=!1,this.initialOpenDlg=!0,this.stateChangeColumns=[],this.changedStateColumns=[],this.isInitialOpen=!1,this.isCustomizeOpenCC=!1,this.searchOperator="startswith",this.itemsCount=50,this.infiniteSkipCount=0,this.infiniteColumns=[],this.infiniteInitialLoad=!1,this.prevInfiniteScrollDirection="",this.prevShowedCols=[],this.hideDialogFunction=this.hideDialog.bind(this),this.infiniteRenderMode=!1,this.parent=e,this.serviceLocator=t,this.infiniteRenderMode=!!this.parent.enableColumnVirtualization,this.addEventListener(),this.cBoxTrue=kv(this.parent.createElement,!1,{checked:!0,label:" "}),this.cBoxFalse=kv(this.parent.createElement,!1,{checked:!1,label:" "}),this.cBoxTrue.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden e-cc e-cc-chbox",attrs:{type:"checkbox"}}),this.cBoxTrue.firstChild),this.cBoxFalse.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden e-cc e-cc-chbox",attrs:{type:"checkbox"}}),this.cBoxFalse.firstChild),this.cBoxFalse.querySelector(".e-frame").classList.add("e-uncheck"),this.parent.enableRtl&&U([this.cBoxTrue,this.cBoxFalse],["e-rtl"]),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?U([this.cBoxTrue,this.cBoxFalse],this.parent.cssClass.split(" ")):U([this.cBoxTrue,this.cBoxFalse],[this.parent.cssClass])),this.parent.enableAdaptiveUI&&this.setFullScreenDialog()}var yX=function(){this.numFmtId=0,this.backColor="none",this.fontName="Calibri",this.fontSize=10.5,this.fontColor="#000000",this.italic=!1,this.bold=!1,this.underline=!1,this.strikeThrough=!1,this.wrapText=!1,this.hAlign="general",this.vAlign="bottom",this.indent=0,this.rotation=0,this.numberFormat="GENERAL",this.type="datetime",this.borders=new IX,this.isGlobalStyle=!1},vX=function(){this.sz=10.5,this.name="Calibri",this.u=!1,this.b=!1,this.i=!1,this.color="FF000000",this.strike=!1},bX=function(){},wX=function(){},CX=function(){},SX=function(){this.name="Normal",this.xfId=0},AX=function(e,t){this.numFmtId=e,this.formatCode=t},xX=function(e,t){this.lineStyle=e,this.color=t},IX=function(){this.left=new xX("none","#FFFFFF"),this.right=new xX("none","#FFFFFF"),this.top=new xX("none","#FFFFFF"),this.bottom=new xX("none","#FFFFFF"),this.all=new xX("none","#FFFFFF")};TX=function(e,t){return(TX=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])}))(e,t)};var TX,EX,DX=function(){},MX=(function(e,t){function i(){this.constructor=e}TX(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(kX,EX=Array),kX);function kX(){var r=null!==EX&&EX.apply(this,arguments)||this;return r.add=function(e){for(var t=!1,i=0,n=0,o=r;n<o.length;n++)o[n].index===e.index&&(r[i]=e,t=!0),i++;t||r.push(e)},r}var PX=function(){};BX=function(e,t){return(BX=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])}))(e,t)};var BX,FX,LX=function(){},RX=(function(e,t){function i(){this.constructor=e}BX(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(OX,FX=Array),OX);function OX(){var t=null!==FX&&FX.apply(this,arguments)||this;return t.add=function(e){t.push(e)},t}NX=function(e,t){return(NX=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}NX(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(HX,VX=Array);var NX,VX,_X=HX;function HX(){return null!==VX&&VX.apply(this,arguments)||this}zX=function(e,t){return(zX=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])}))(e,t)};var zX,jX,WX=function(){this.isSummaryRowBelow=!0,this.showGridLines=!0,this.enableRtl=!1},QX=function(){},UX=function(){},qX=function(){},GX=function(){},YX=(function(e,t){function i(){this.constructor=e}zX(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(XX,jX=Array),XX.isIntersecting=function(e,t){return e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height},XX);function XX(){var a=null!==jX&&jX.apply(this,arguments)||this;return a.add=function(e){for(var t=!1,i=0,n=0,o=a;n<o.length;n++){var r,s=o[n];XX.isIntersecting(s,e)&&((r=new GX).x=Math.min(s.x,e.x),r.y=Math.min(s.Y,e.y),r.width=Math.max(s.Width+s.X,e.width+e.x),r.height=Math.max(s.Height+s.Y,e.height+e.y),r.ref=a[i].ref.split(":")[0]+":"+e.ref.split(":")[1],e=a[i]=r,t=!0),i++}return t||a.push(e),e},a}var KX=function(){},JX=(ZX.prototype.getFormatFunction=function(e,t){return e.type?(t&&(e.isServerRendered=!0),this.intl.getDateFormat(e)):this.intl.getNumberFormat(e)},ZX.prototype.toView=function(e,t){return je(t)||je(e)?e:t(e)},ZX.prototype.displayText=function(e,t,i){return this.toView(e,this.getFormatFunction(t,i))},ZX);function ZX(e){this.intl=new Ti}eK.prototype.parseWorksheet=function(e){null!==e.rows&&void 0!==e.rows&&this.parseRows(e.rows)},eK.prototype.parseRows=function(e){for(var t=1,i=0,n=e;i<n.length;i++){var o=n[i];if(null===o.index||void 0===o.index)throw Error("Row index is missing.");for(;t<o.index;)this.csvStr+="\r\n",t++;this.parseRow(o)}this.csvStr+="\r\n"},eK.prototype.parseRow=function(e){if(null!==e.cells&&void 0!==e.cells)for(var t=1,i=0,n=e.cells;i<n.length;i++){var o=n[i];if(null===o.index||void 0===o.index)throw Error("Cell index is missing.");for(;t<o.index;)this.csvStr+=this.separator,t++;this.parseCell(o)}},eK.prototype.parseCell=function(t){var i=this.csvStr;if(void 0!==t.value)if(t.value instanceof Date)if(void 0!==t.style&&void 0!==t.style.numberFormat)try{i+=this.parseCellValue(this.formatter.displayText(t.value,{type:"dateTime",skeleton:t.style.numberFormat},this.isServerRendered))}catch(e){i+=this.parseCellValue(this.formatter.displayText(t.value,{type:"dateTime",format:t.style.numberFormat},this.isServerRendered))}else if(void 0!==t.style&&void 0!==t.style.name&&this.globalStyles.has(t.style.name))try{i+=this.parseCellValue(this.formatter.displayText(t.value,{type:"dateTime",skeleton:this.globalStyles.get(t.style.name)},this.isServerRendered))}catch(e){i+=this.parseCellValue(this.formatter.displayText(t.value,{type:"dateTime",format:this.globalStyles.get(t.style.name)},this.isServerRendered))}else i+=t.value;else"boolean"==typeof t.value?i+=t.value?"TRUE":"FALSE":"number"==typeof t.value?void 0!==t.style&&void 0!==t.style.numberFormat?i+=this.parseCellValue(this.formatter.displayText(t.value,{format:t.style.numberFormat,ignoreCurrency:!0},this.isServerRendered)):void 0!==t.style&&void 0!==t.style.name&&this.globalStyles.has(t.style.name)?i+=this.parseCellValue(this.formatter.displayText(t.value,{format:this.globalStyles.get(t.style.name),ignoreCurrency:!0},this.isServerRendered)):i+=t.value:i+=this.parseCellValue(t.value);this.csvStr=i},eK.prototype.parseCellValue=function(e){for(var t="",i=e.length,n=0;n<i;n++)'"'===e[n]?t+=e[n].replace('"','""'):t+=e[n];return-1!==(e=t).indexOf(this.separator)||-1!==e.indexOf("\n")||-1!==e.indexOf('"')?'"'+e+'"':e},eK.prototype.save=function(e){var t,i;this.buffer=new Blob(["\ufeff"+this.csvStr],{type:"text/csv;charset=UTF-8"}),this.isMicrosoftBrowser?navigator.msSaveBlob(this.buffer,e):(t=window.URL.createObjectURL(this.buffer),(i=document.createElementNS("http://www.w3.org/1999/xhtml","a")).download=e,i.href=t,(e=document.createEvent("MouseEvent")).initEvent("click",!0,!0),i.dispatchEvent(e),setTimeout(function(){window.URL.revokeObjectURL(t)}))},eK.prototype.saveAsBlob=function(e){var t,i;return null!=e?(t=new Ql,i="UTF-8",i="ANSI"==e.toUpperCase()?(t.type="Ansi","ANSI"):"UNICODE"==e.toUpperCase()?(t.type="Unicode","UNICODE"):(t.type="Utf8","UTF-8"),e=t.getBytes(this.csvStr,0,this.csvStr.length),new Blob([e],{type:"text/csv;charset="+i})):new Blob(["\ufeff"+this.csvStr],{type:"text/csv;charset=UTF-8"})};var $X=eK;function eK(e,t){if(this.csvStr="",this.separator=null==t?",":t,this.formatter=new JX,this.isMicrosoftBrowser=!!navigator.msSaveBlob,null!==e.isServerRendered&&void 0!==e.isServerRendered&&(this.isServerRendered=e.isServerRendered),null!==e.styles&&void 0!==e.styles){this.globalStyles=new Map;for(var i=0;i<e.styles.length;i++)void 0!==e.styles[i].name&&void 0!==e.styles[i].numberFormat&&this.globalStyles.set(e.styles[i].name,e.styles[i].numberFormat)}null!==e.worksheets&&void 0!==e.worksheets&&this.parseWorksheet(e.worksheets[0])}iK.prototype.append=function(e){this.parts.push(e),this.blob=void 0},iK.prototype.getBlob=function(){return new Blob(this.parts,{type:"text/plain"})};var tK=iK;function iK(){this.parts=[]}var nK=function(){},oK=(rK.prototype.parserBuiltInProperties=function(e,t){null!==e.author&&void 0!==e.author&&(t.author=e.author),null!==e.comments&&void 0!==e.comments&&(t.comments=e.comments),null!==e.category&&void 0!==e.category&&(t.category=e.category),null!==e.company&&void 0!==e.company&&(t.company=e.company),null!==e.manager&&void 0!==e.manager&&(t.manager=e.manager),null!==e.subject&&void 0!==e.subject&&(t.subject=e.subject),null!==e.title&&void 0!==e.title&&(t.title=e.title),null!==e.createdDate&&void 0!==e.createdDate&&(t.createdDate=e.createdDate),null!==e.modifiedDate&&void 0!==e.modifiedDate&&(t.modifiedDate=e.modifiedDate),null!==e.tags&&void 0!==e.tags&&(t.tags=e.tags),null!==e.status&&void 0!==e.status&&(t.status=e.status)},rK.prototype.parserWorksheets=function(e){this.worksheets=new _X;for(var t=e.length,i=0;i<t;i++){var n=e[i],o=new WX;this.mergeCells=new YX,this.mergedCellsStyle=new Map,this.mHyperLinks=[],null!==n.name&&void 0!==n.name?o.name=n.name:o.name="Sheet"+(i+1).toString(),null!==n.enableRtl&&void 0!==n.enableRtl&&(o.enableRtl=n.enableRtl),o.index=i+1,null!==n.columns&&void 0!==n.columns&&this.parserColumns(n.columns,o),null!==n.rows&&void 0!==n.rows&&this.parserRows(n.rows,o),null!==n.showGridLines&&void 0!==n.showGridLines&&(o.showGridLines=n.showGridLines),null!==n.freeze&&void 0!==n.freeze&&this.parserFreezePanes(n.freeze,o),null!==n.printTitle&&void 0!==n.printTitle&&this.parserPrintTitle(n.printTitle,o),void 0!==n.pageSetup&&void 0!==n.pageSetup.isSummaryRowBelow&&(o.isSummaryRowBelow=n.pageSetup.isSummaryRowBelow),void 0!==n.images&&this.parserImages(n.images,o),null!==n.autoFilters&&void 0!==n.autoFilters&&this.parseFilters(n.autoFilters,o),o.index=i+1,o.mergeCells=this.mergeCells,o.hyperLinks=this.mHyperLinks,this.worksheets.push(o)}},rK.prototype.mergeOptions=function(e,t){var i={};return this.applyProperties(e,i),this.applyProperties(t,i),i},rK.prototype.applyProperties=function(e,t){for(var i=Object.keys(e),n=0;n<i.length;n++)"name"!==i[n]&&(t[i[n]]=e[i[n]])},rK.prototype.getCellName=function(e,t){return this.getColumnName(t)+e.toString()},rK.prototype.getColumnName=function(e){e--;var t="";do{var i=e%26}while(e=e/26-1,t=String.fromCharCode(65+i)+t,0<=e);return t},rK.prototype.parserPrintTitle=function(e,t){var i,n,o,r="";null!==e.fromRow&&void 0!==e.fromRow&&(i="$"+e.fromRow+":$"+(null!==e.toRow&&void 0!==e.toRow?e.toRow:e.fromRow)),null!==e.fromColumn&&void 0!==e.fromColumn&&(o=e.fromColumn,n=void 0,n=null!==e.toColumn&&void 0!==e.toColumn?e.toColumn:e.fromColumn,o="$"+this.getColumnName(o)+":$"+this.getColumnName(n)),void 0!==i&&(r+=t.name+"!"+i),void 0!==o&&void 0!==i?r+=","+t.name+"!"+o:void 0!==o&&(r+=t.name+"!"+o),""!==r&&this.printTitles.set(t.index-1,r)},rK.prototype.parserFreezePanes=function(e,t){t.freezePanes=new qX,null!==e.row&&void 0!==e.row?t.freezePanes.row=e.row:t.freezePanes.row=0,null!==e.column&&void 0!==e.column?t.freezePanes.column=e.column:t.freezePanes.column=0,t.freezePanes.leftCell=this.getCellName(t.freezePanes.row+1,t.freezePanes.column+1)},rK.prototype.parserColumns=function(e,t){var i=e.length;t.columns=[];for(var n=0;n<i;n++){var o=new PX;if(null===e[n].index||void 0===e[n].index)throw Error("Column index is missing.");o.index=e[n].index,null!==e[n].width&&void 0!==e[n].width&&(o.width=e[n].width),t.columns.push(o)}},rK.prototype.parserRows=function(e,t){for(var i=e.length,n=(t.rows=new RX,0),o=0;o<i;o++){var r=this.parserRow(e[o],n),n=r.index;t.rows.add(r)}this.insertMergedCellsStyle(t)},rK.prototype.insertMergedCellsStyle=function(s){var a=this;0<this.mergeCells.length&&this.mergedCellsStyle.forEach(function(t,e){var i,n,o,r=s.rows.filter(function(e){return e.index===t.y})[0];je(r)?(i=s.rows.filter(function(e){return e.index<=t.y}),(n=new LX).index=t.y,n.cells=new MX,n.cells.add(a.createCell(t,e)),(o=0)<i.length&&(o=s.rows.indexOf(i[i.length-1])+1),s.rows.splice(o,0,n)):je(i=r.cells.filter(function(e){return e.index===t.x})[0])?((o=0)<(n=r.cells.filter(function(e){return e.index<=t.x})).length&&(o=r.cells.indexOf(n[n.length-1])+1),r.cells.splice(o,0,a.createCell(t,e))):i.styleIndex=t.styleIndex})},rK.prototype.createCell=function(e,t){var i=new DX;return i.refName=t,i.index=e.x,i.cellStyle=new yX,i.styleIndex=e.styleIndex,i},rK.prototype.parserRow=function(e,t){var i=new LX;if(null!==e.height&&void 0!==e.height&&(i.height=e.height),null===e.index||void 0===e.index)throw Error("Row index is missing.");return i.index=e.index,null!==e.grouping&&void 0!==e.grouping&&this.parseGrouping(e.grouping,i),this.parseCells(e.cells,i),i},rK.prototype.parseGrouping=function(e,t){t.grouping=new UX,void 0!==e.outlineLevel&&(t.grouping.outlineLevel=e.outlineLevel),void 0!==e.isCollapsed&&(t.grouping.isCollapsed=e.isCollapsed),void 0!==e.isHidden&&(t.grouping.isHidden=e.isHidden)},rK.prototype.parseCells=function(e,t){t.cells=new MX;for(var i=void 0!==e?e.length:0,n=1,o=1,r=0;r<i;r++){var s,a=e[r],l=new DX;if(null===a.index||void 0===a.index)throw Error("Cell index is missing.");l.index=a.index,l.index<n?n=l.index:l.index>o&&(o=l.index),l.refName=this.getCellName(t.index,l.index),null!==a.rowSpan&&void 0!==a.rowSpan?l.rowSpan=a.rowSpan-1:l.rowSpan=0,null!==a.colSpan&&void 0!==a.colSpan?l.colSpan=a.colSpan-1:l.colSpan=0,null!==a.hyperlink&&void 0!==a.hyperlink&&(s=new QX,void 0!==a.hyperlink.target)&&(s.target=a.hyperlink.target,void 0!==a.hyperlink.displayText?l.value=a.hyperlink.displayText:l.value=a.hyperlink.target,l.type=this.getCellValueType(l.value),s.ref=l.refName,s.rId=this.mHyperLinks.length+1,this.mHyperLinks.push(s),l.cellStyle=new yX,this.parserCellStyle(void 0!==a.style?this.mergeOptions(a.style,this.hyperlinkStyle):this.hyperlinkStyle,l.cellStyle,"string"),l.styleIndex=l.cellStyle.index),null!==a.formula&&void 0!==a.formula&&(l.formula=a.formula,l.type="formula"),null!==a.value&&void 0!==a.value&&(void 0!==l.formula?l.value=0:(l.value=a.value,l.type=this.getCellValueType(l.value))),null!==a.style&&void 0!==a.style&&void 0===l.styleIndex?(l.cellStyle=new yX,l.value instanceof Date?this.parserCellStyle(a.style,l.cellStyle,l.type,14):this.parserCellStyle(a.style,l.cellStyle,l.type),l.styleIndex=l.cellStyle.index):l.value instanceof Date&&(l.cellStyle=new yX,this.parserCellStyle({},l.cellStyle,l.type,14),l.styleIndex=l.cellStyle.index),this.parseCellType(l),this.mergeCells=this.processMergeCells(l,t.index,this.mergeCells),t.cells.add(l),l.index}t.spans=n+":"+o},rK.prototype.GetColors=function(){var e=new Map;return e.set("WHITE","FFFFFFFF"),e.set("SILVER","FFC0C0C0"),e.set("GRAY","FF808080"),e.set("BLACK","FF000000"),e.set("RED","FFFF0000"),e.set("MAROON","FF800000"),e.set("YELLOW","FFFFFF00"),e.set("OLIVE","FF808000"),e.set("LIME","FF00FF00"),e.set("GREEN","FF008000"),e.set("AQUA","FF00FFFF"),e.set("TEAL","FF008080"),e.set("BLUE","FF0000FF"),e.set("NAVY","FF000080"),e.set("FUCHSIA","FFFF00FF"),e.set("PURPLE","FF800080"),e},rK.prototype.processColor=function(e){return 0===e.indexOf("#")?e.replace("#","FF"):(e=e.toUpperCase(),this.rgbColors=this.GetColors(),this.rgbColors.has(e)?this.rgbColors.get(e):"FF000000")},rK.prototype.processCellValue=function(e,t){var i=e;if(-1!==e.indexOf("<font")||-1!==e.indexOf("<a")||-1!==e.indexOf("<b>")||-1!==e.indexOf("<i>")||-1!==e.indexOf("<u>")){var n="",o=e.indexOf("<",0),r=e.indexOf(">",o+1);if(0<=o&&0<=r){for(0!==o&&(n+='<r><t xml:space="preserve">'+this.processString(e.substring(0,o))+"</t></r>");0<=o&&0<=r;)if(0<=(r=e.indexOf(">",o+1))){var s=e.substring(o+1,r),a=((o=e.indexOf("<",r+1))<0&&(o=i.length),i.substring(r+1,o));if(0!==a.length){s=s.split(" ");if(0<s.length&&(n+="<r><rPr>"),1<s.length)for(var l=0,h=s;l<h.length;l++){var d=h[l];switch(d.trim().substring(0,5)){case"size=":n+='<sz val="'+d.substring(6,d.length-1)+'"/>';break;case"face=":n+='<rFont val="'+d.substring(6,d.length-1)+'"/>';break;case"color":n+='<color rgb="'+this.processColor(d.substring(7,d.length-1))+'"/>';break;case"href=":var p=new QX;p.target=d.substring(6,d.length-1).trim(),p.ref=t.refName,p.rId=this.mHyperLinks.length+1,this.mHyperLinks.push(p),n+='<color rgb="FF0000FF"/><u/><b/>'}}else if(1===s.length)switch(s[0].trim()){case"b":n+="<b/>";break;case"i":n+="<i/>";break;case"u":n+="<u/>"}n+='</rPr><t xml:space="preserve">'+this.processString(a)+"</t></r>"}}return""===n?i:n}}return i},rK.prototype.applyGlobalStyle=function(t,e){this.cellStyles.has(t.name)&&(e.index=this.mStyles.filter(function(e){return e.name===t.name})[0].index,e.name=t.name)},rK.prototype.parserCellStyle=function(e,t,i,n){if(null!==e.name&&void 0!==e.name){if(!t.isGlobalStyle)return void this.applyGlobalStyle(e,t);t.name=e.name}null!==e.backColor&&void 0!==e.backColor&&(t.backColor=e.backColor),t.borders=new IX,null!==e.borders&&void 0!==e.borders&&this.parserBorder(e.borders,t.borders.all),null!==e.leftBorder&&void 0!==e.leftBorder&&this.parserBorder(e.leftBorder,t.borders.left),null!==e.rightBorder&&void 0!==e.rightBorder&&this.parserBorder(e.rightBorder,t.borders.right),null!==e.topBorder&&void 0!==e.topBorder&&this.parserBorder(e.topBorder,t.borders.top),null!==e.bottomBorder&&void 0!==e.bottomBorder&&this.parserBorder(e.bottomBorder,t.borders.bottom),null!==e.fontName&&void 0!==e.fontName&&(t.fontName=e.fontName),null!==e.fontSize&&void 0!==e.fontSize&&(t.fontSize=e.fontSize),null!==e.fontColor&&void 0!==e.fontColor&&(t.fontColor=e.fontColor),null!==e.italic&&void 0!==e.italic&&(t.italic=e.italic),null!==e.bold&&void 0!==e.bold&&(t.bold=e.bold),null!==e.hAlign&&void 0!==e.hAlign&&(t.hAlign=e.hAlign.toLowerCase()),null!==e.indent&&void 0!==e.indent&&(t.indent=e.indent,"left"!==t.hAlign)&&"right"!==t.hAlign&&(t.hAlign="left"),null!==e.rotation&&void 0!==e.rotation&&(t.rotation=e.rotation),null!==e.vAlign&&void 0!==e.vAlign&&(t.vAlign=e.vAlign.toLowerCase()),null!==e.underline&&void 0!==e.underline&&(t.underline=e.underline),null!==e.strikeThrough&&void 0!==e.strikeThrough&&(t.strikeThrough=e.strikeThrough),null!==e.wrapText&&void 0!==e.wrapText&&(t.wrapText=e.wrapText),null!==e.numberFormat&&void 0!==e.numberFormat?null!==e.type&&void 0!==e.type?t.numberFormat=this.getNumberFormat(e.numberFormat,e.type):t.numberFormat=this.getNumberFormat(e.numberFormat,i):(void 0!==n&&(t.numFmtId=14),t.numberFormat="GENERAL"),t.index=this.processCellStyle(t)},rK.prototype.switchNumberFormat=function(e,t){var i=this.getNumberFormat(e,t);if(i!==e){var n=this.mNumFmt.get(e);if(void 0!==n&&(n.formatCode=i,this.mNumFmt.has(i))){for(var o=0,r=this.mCellStyleXfs;o<r.length;o++){var s=r[o];s.numFmtId===n.numFmtId&&(s.numFmtId=this.mNumFmt.get(i).numFmtId)}for(var a=0,l=this.mCellXfs;a<l.length;a++){var h=l[a];h.numFmtId===n.numFmtId&&(h.numFmtId=this.mNumFmt.get(i).numFmtId)}}}},rK.prototype.changeNumberFormats=function(e){if("string"==typeof e){var t=new RegExp(this.currency,"g");e=e.replace(t,"[$"+this.currency+"]")}else if("object"==typeof e)for(var i=0;i<e.length;i++)e[i]=e[i].replace(this.currency,"[$"+this.currency+"]");return e},rK.prototype.getNumberFormat=function(t,e){var i;switch(e){case"number":try{i=this.intl.getNumberPattern({format:t,currency:this.currency,useGrouping:!0},!0),1<this.currency.length&&(i=this.changeNumberFormats(i))}catch(e){i=t}break;case"datetime":try{i=this.intl.getDatePattern({skeleton:t,type:"dateTime"},!0)}catch(e){try{i=this.intl.getDatePattern({format:t,type:"dateTime"},!0)}catch(e){i=t}}break;case"date":try{i=this.intl.getDatePattern({skeleton:t,type:"date"},!0)}catch(e){try{i=this.intl.getDatePattern({format:t,type:"date"},!0)}catch(e){i=t}}break;case"time":try{i=this.intl.getDatePattern({skeleton:t,type:"time"},!0)}catch(e){try{i=this.intl.getDatePattern({format:t,type:"time"},!0)}catch(e){i=t}}break;default:i=t}return i},rK.prototype.parserBorder=function(e,t){null!==e.color&&void 0!==e.color?t.color=e.color:t.color="#000000",null!==e.lineStyle&&void 0!==e.lineStyle?t.lineStyle=e.lineStyle:t.lineStyle="thin"},rK.prototype.processCellStyle=function(e){var t;return!e.isGlobalStyle&&(t=this.compareStyle(e)).result?t.index:(this.processNumFormatId(e),this.mStyles.push(e),this.mStyles.length)},rK.prototype.processNumFormatId=function(e){var t;"GENERAL"===e.numberFormat||this.mNumFmt.has(e.numberFormat)||(t=this.mNumFmt.size+164,this.mNumFmt.set(e.numberFormat,new AX(t,e.numberFormat)))},rK.prototype.isNewFont=function(e){for(var t=!1,i=0,n=0,o=this.mFonts;n<o.length;n++){var r=o[n],s=(i++,void 0);if(void 0!==e.fontColor&&(s="FF"+e.fontColor.replace("#","")),t=r.color===s&&r.b===e.bold&&r.i===e.italic&&r.u===e.underline&&r.strike===e.strikeThrough&&r.name===e.fontName&&r.sz===e.fontSize)break}return{index:i-=1,result:t}},rK.prototype.isNewBorder=function(e){var t=new yX;return this.isAllBorder(e.borders)?t.borders.all.color===e.borders.all.color&&t.borders.all.lineStyle===e.borders.all.lineStyle:t.borders.left.color===e.borders.left.color&&t.borders.left.lineStyle===e.borders.left.lineStyle&&t.borders.right.color===e.borders.right.color&&t.borders.right.lineStyle===e.borders.right.lineStyle&&t.borders.top.color===e.borders.top.color&&t.borders.top.lineStyle===e.borders.top.lineStyle&&t.borders.bottom.color===e.borders.bottom.color&&t.borders.bottom.lineStyle===e.borders.bottom.lineStyle},rK.prototype.isAllBorder=function(e){var t=new yX;return t.borders.all.color!==e.all.color&&t.borders.all.lineStyle!==e.all.lineStyle},rK.prototype.compareStyle=function(e){for(var t=!0,i=0,n=0,o=this.mStyles;n<o.length;n++){var r=o[n];if(t=!r.isGlobalStyle&&r.backColor===e.backColor&&r.bold===e.bold&&r.numFmtId===e.numFmtId&&r.numberFormat===e.numberFormat&&r.type===e.type&&r.fontColor===e.fontColor&&r.fontName===e.fontName&&r.fontSize===e.fontSize&&r.hAlign===e.hAlign&&r.italic===e.italic&&r.underline===e.underline&&r.strikeThrough===e.strikeThrough&&r.vAlign===e.vAlign&&r.indent===e.indent&&r.rotation===e.rotation&&r.wrapText===e.wrapText&&r.borders.all.color===e.borders.all.color&&r.borders.all.lineStyle===e.borders.all.lineStyle&&r.borders.left.color===e.borders.left.color&&r.borders.left.lineStyle===e.borders.left.lineStyle&&r.borders.right.color===e.borders.right.color&&r.borders.right.lineStyle===e.borders.right.lineStyle&&r.borders.top.color===e.borders.top.color&&r.borders.top.lineStyle===e.borders.top.lineStyle&&r.borders.bottom.color===e.borders.bottom.color&&r.borders.bottom.lineStyle===e.borders.bottom.lineStyle){i=r.index;break}}return{index:i,result:t}},rK.prototype.contains=function(e,t){t=e.indexOf(t);return-1<t&&t<e.length},rK.prototype.getCellValueType=function(e){return e instanceof Date?"datetime":"boolean"==typeof e?"boolean":"number"==typeof e?"number":"string"},rK.prototype.parseCellType=function(e){var t=e.type,i=e.value;switch(t){case"datetime":i=this.toOADate(i);void 0!==e.cellStyle&&void 0!==e.cellStyle.name&&this.globalStyles.has(e.cellStyle.name)&&(o=this.globalStyles.get(e.cellStyle.name),this.switchNumberFormat(o.format,o.type)),n="n";break;case"boolean":i=i?1:0,n="b";break;case"number":n="n",void 0!==e.cellStyle&&void 0!==e.cellStyle.name&&this.globalStyles.has(e.cellStyle.name)&&this.switchNumberFormat(this.globalStyles.get(e.cellStyle.name).format,"number");break;case"string":this.sharedStringCount++;var n="s",o=this.processCellValue(i,e);this.contains(this.sharedString,o)||this.sharedString.push(o),i=this.sharedString.indexOf(o)}e.saveType=n,e.value=i},rK.prototype.parserImages=function(e,t){var i=e.length;t.images=[];for(var n=0;n<i;n++){var o=this.parserImage(e[n]);t.images.push(o)}},rK.prototype.parseFilters=function(e,t){if(t.autoFilters=new nK,null===e.row||void 0===e.row)throw new Error("Argument Null Exception: row null or empty");if(t.autoFilters.row=e.row,null===e.lastRow||void 0===e.lastRow)throw new Error("Argument Null Exception: lastRow cannot be null or empty");if(t.autoFilters.lastRow=e.lastRow,null===e.column||void 0===e.column)throw new Error("Argument Null Exception: column cannot be null or empty");if(t.autoFilters.column=e.column,null===e.lastColumn||void 0===e.row)throw new Error("Argument Null Exception: lastColumn cannot be null or empty");t.autoFilters.lastColumn=e.lastColumn},rK.prototype.parserImage=function(e){var t=new KX;return null!==e.image&&void 0!==e.image&&(t.image=e.image),null!==e.row&&void 0!==e.row&&(t.row=e.row),null!==e.column&&void 0!==e.column&&(t.column=e.column),null!==e.lastRow&&void 0!==e.lastRow&&(t.lastRow=e.lastRow),null!==e.lastColumn&&void 0!==e.lastColumn&&(t.lastColumn=e.lastColumn),null!==e.width&&void 0!==e.width&&(t.width=e.width),null!==e.height&&void 0!==e.height&&(t.height=e.height),null!==e.horizontalFlip&&void 0!==e.horizontalFlip&&(t.horizontalFlip=e.horizontalFlip),null!==e.verticalFlip&&void 0!==e.verticalFlip&&(t.verticalFlip=e.verticalFlip),null!==e.rotation&&void 0!==e.rotation&&(t.rotation=e.rotation),t},rK.prototype.saveAsBlob=function(e,n){var o=this;return"text/csv"!==e?new Promise(function(i,e){o.saveInternal(),o.mArchive.saveAsBlob().then(function(e){var t={};t.blobData=new Blob([e],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),i(t)})}):new Promise(function(e,t){var i={};i.blobData=o.csvHelper.saveAsBlob(n),e(i)})},rK.prototype.save=function(e,t){var i=this;if(null==e||""===e)throw new Error("Argument Null Exception: fileName cannot be null or empty");var n=e.match(".xlsx$"),o=e.match(".csv$");if(null!==n&&n[0]==="."+this.mSaveType)this.saveInternal(),this.mArchive.save(e).then(function(){i.mArchive.destroy()});else{if(null===o||o[0]!=="."+this.mSaveType)throw Error("Save type and file extension is different.");this.csvHelper.save(e)}},rK.prototype.saveInternal=function(){this.saveWorkbook(),this.saveWorksheets(),this.saveSharedString(),this.saveStyles(),this.saveApp(this.builtInProperties),this.saveCore(this.builtInProperties),this.saveContentType(),this.saveTopLevelRelation(),this.saveWorkbookRelation()},rK.prototype.saveWorkbook=function(){for(var i,e='<?xml version="1.0" encoding="utf-8"?><workbook xmlns:r = "http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns= "http://schemas.openxmlformats.org/spreadsheetml/2006/main"><workbookPr codeName="ThisWorkbook" defaultThemeVersion= "153222"/><bookViews><workbookView activeTab="0"/></bookViews>',t="<sheets>",n=this.worksheets.length,o=0;o<n;o++){var r=this.worksheets[o].name;t+='<sheet name="'+(r=(r=(r=(r=r.replace("&","&amp;")).replace("<","&lt;")).replace(">","&gt;")).replace('"',"&quot;"))+'" sheetId="'+(o+1).toString()+'" r:id ="rId'+(o+1).toString()+'" />'}e+=t+="</sheets>",0<this.printTitles.size&&(i="<definedNames>",this.printTitles.forEach(function(e,t){i+='<definedName name="_xlnm.Print_Titles" localSheetId="'+t+'">'+e+"</definedName>"}),e+=i+="</definedNames>"),this.addToArchive(e+"</workbook>","xl/workbook.xml")},rK.prototype.saveWorksheets=function(){for(var e=this.worksheets.length,t=0;t<e;t++)this.saveWorksheet(this.worksheets[t],t)},rK.prototype.saveWorksheet=function(e,t){var i=new tK,n='<?xml version="1.0" encoding="utf-8" standalone="yes"?><worksheet xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">';if(e.isSummaryRowBelow?n+="<sheetPr />":n+='<sheetPr><outlinePr summaryBelow="0" ></outlinePr></sheetPr>',n+=this.saveSheetView(e),void 0!==e.columns){for(var o="<cols>",r=0,s=e.columns;r<s.length;r++){var a=s[r];void 0!==a.width?o+='<col min="'+a.index+'" max="'+a.index+'" width="'+this.pixelsToColumnWidth(a.width)+'" customWidth="1" />':o+='<col min="'+a.index+'" max="'+a.index+'" width="8.43" customWidth="1" />'}n+=o+"</cols>"}if(i.append(n+="<sheetData>"),n="",void 0!==e.rows)for(var l=0,h=e.rows;l<h.length;l++){var d=h[l],p='<row r="'+d.index+'" ';je(d.spans)||(p+='spans="'+d.spans+'" '),void 0!==d.height&&(p+='ht="'+this.pixelsToRowHeight(d.height)+'" customHeight="1" '),void 0!==d.grouping&&(d.grouping.isHidden&&(p+='hidden="1" '),void 0!==d.grouping.outlineLevel&&(p+='outlineLevel="'+d.grouping.outlineLevel+'" '),d.grouping.isCollapsed)&&(p+='collapsed="1" '),p+=">";for(var c=0,u=d.cells;c<u.length;c++){var g=u[c];void 0===g||void 0===g.value&&void 0===g.cellStyle||(p+='<c r="'+g.refName+'" ',void 0!==g.saveType&&(p+='t="'+g.saveType+'" '),void 0!==g.styleIndex&&(p+='s="'+g.styleIndex+'" '),p+=" >",void 0!==g.formula&&(p+="<f>"+g.formula+"</f>"),void 0!==g.value?p+="<v>"+g.value+"</v></c>":p+="</c>")}p+="</row>",i.append(p)}if(n+="</sheetData>",null!==e.autoFilters&&void 0!==e.autoFilters&&(n+='<autoFilter ref="'+this.getCellName(e.autoFilters.row,e.autoFilters.column)+":"+this.getCellName(e.autoFilters.lastRow,e.autoFilters.lastColumn)+'"/>'),0<e.mergeCells.length){n+='<mergeCells count="'+e.mergeCells.length+'">';for(var m=0,f=e.mergeCells;m<f.length;m++)n+='<mergeCell ref="'+f[m].ref+'" />';n+="</mergeCells>"}if(0<e.hyperLinks.length){n+="<hyperlinks>";for(var y=0,v=e.hyperLinks;y<v.length;y++){var b=v[y];n+='<hyperlink ref="'+b.ref+'" r:id="rId'+b.rId+'" />'}n+="</hyperlinks>"}n+='<pageMargins left="0.75" right="0.75" top="1" bottom="1" header="0.5" footer="0.5" /><headerFooter scaleWithDoc="1" alignWithMargins="0" differentFirst="0" differentOddEven="0" />',null!=e.images&&0<e.images.length&&(this.drawingCount++,this.saveDrawings(e,e.index),n+='<drawing r:id="rId'+(e.hyperLinks.length+1)+'"/>'),this.addToArchive(this.saveSheetRelations(e),"xl/worksheets/_rels/sheet"+e.index+".xml.rels"),i.append(n+"</worksheet>"),this.addToArchive(i.getBlob(),"xl/worksheets/sheet"+(t+1)+".xml")},rK.prototype.saveDrawings=function(e,t){var i=new tK,n='<xdr:wsDr xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">';if(void 0!==e.images){for(var o=0,r=0,s=e.images;r<s.length;r++){var a=s[r],a=(void 0!==a.height&&void 0!==a.width?(this.updatelastRowOffset(e,a),this.updatelastColumnOffSet(e,a),--a.lastRow,--a.lastColumn):void 0!==a.lastRow&&void 0!==a.lastColumn&&(a.lastRowOffset=0,a.lastColOffset=0),o++,n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n+'<xdr:twoCellAnchor editAs="oneCell">'+"<xdr:from><xdr:col>")+(a.column-1)+"</xdr:col><xdr:colOff>")+0+"</xdr:colOff><xdr:row>")+(a.row-1))+"</xdr:row><xdr:rowOff>"+0)+"</xdr:rowOff></xdr:from>"+"<xdr:to><xdr:col>")+a.lastColumn+"</xdr:col><xdr:colOff>")+a.lastColOffset+"</xdr:colOff><xdr:row>")+a.lastRow+"</xdr:row><xdr:rowOff>")+a.lastRowOffset)+"</xdr:rowOff></xdr:to>"+"<xdr:pic>")+"<xdr:nvPicPr>"+('<xdr:cNvPr id="'+o+'" name="Picture '+o+'"> </xdr:cNvPr>'))+'<xdr:cNvPicPr><a:picLocks noChangeAspect="1"/></xdr:cNvPicPr> </xdr:nvPicPr>'+"<xdr:blipFill>")+('<a:blip xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:embed="rId'+o+'" cstate="print">')+"</a:blip><a:stretch><a:fillRect /></a:stretch></xdr:blipFill>")+"<xdr:spPr>"+"<a:xfrm",null!=a.rotation&&a.rotation<=3600&&-3600<=a.rotation&&(n+=' rot="'+6e4*a.rotation+'"'),null!=a.verticalFlip&&0!=a.verticalFlip&&(n+=' flipV="1"'),null!=a.horizontalFlip&&0!=a.horizontalFlip&&(n+=' flipH="1"'),n=(n+="/>")+'<a:prstGeom prst="rect"><a:avLst /></a:prstGeom></xdr:spPr>'+"</xdr:pic><xdr:clientData /></xdr:twoCellAnchor>",this.convertBase64toImage(a.image));this.imageCount+=1,this.addToArchive(a,"xl/media/image"+this.imageCount+".png")}i.append(n),i.append("</xdr:wsDr>"),this.saveDrawingRelations(e),this.addToArchive(i.getBlob(),"xl/drawings/drawing"+this.drawingCount+".xml")}},rK.prototype.updatelastRowOffset=function(e,t){for(var i=t.height,n=t.row,o=0;0<=i;){var r=0,s=(r=void 0!==e.rows&&void 0!==e.rows[n-1]?this.convertToPixels(void 0===e.rows[n-1].height?15:e.rows[n-1].height):this.convertToPixels(15))-o*r/256;if(i<s){t.lastRow=n,t.lastRowOffset=o+256*i/r;r=0,r=void 0!==e.rows&&void 0!==e.rows[n-1]?this.convertToPixels(void 0===e.rows[n-1].height?15:e.rows[n-1].height):this.convertToPixels(15);t.lastRowOffset=r*t.lastRowOffset/256,t.lastRowOffset=Math.round(t.lastRowOffset/this.unitsProportions[7]);break}i-=s,n++,o=0}},rK.prototype.updatelastColumnOffSet=function(e,t){for(var i=t.width,n=t.column,o=0;0<=i;){var r=0,s=(r=void 0!==e.columns&&void 0!==e.columns[n-1]?this.ColumnWidthToPixels(void 0===e.columns[n-1].width?8.43:e.columns[n-1].width):this.ColumnWidthToPixels(8.43))-o*r/1024;if(i<s){t.lastColumn=n,t.lastColOffset=o+1024*i/r;r=0,r=void 0!==e.columns&&void 0!==e.columns[n-1]?this.ColumnWidthToPixels(void 0===e.columns[n-1].width?8.43:e.columns[n-1].width):this.ColumnWidthToPixels(8.43);t.lastColOffset=r*t.lastColOffset/1024,t.lastColOffset=Math.round(t.lastColOffset/this.unitsProportions[7]);break}i-=s,n++,o=0}},rK.prototype.convertToPixels=function(e){return e*this.unitsProportions[6]},rK.prototype.convertBase64toImage=function(e){for(var t=window.atob(e),e=new ArrayBuffer(t.length),i=new Uint8Array(e),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return new Blob([i],{type:"image/png"})},rK.prototype.saveDrawingRelations=function(e){for(var t='<?xml version="1.0" encoding="utf-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">',i=e.images.length,n=this.imageCount-e.images.length,o=1;o<=i;o++)t+='<Relationship Id="rId'+o+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image'+ ++n+'.png" />';this.addToArchive(t+"</Relationships>","xl/drawings/_rels/drawing"+this.drawingCount+".xml.rels")},rK.prototype.pixelsToColumnWidth=function(e){e=12<e?this.trunc((e-5)/7*100+.5)/100:e/12;return 1<e?(7*e+5)/7*256/256:12*e/7*256/256},rK.prototype.ColumnWidthToPixels=function(e){return this.trunc((256*(1<e?(7*e+5)/7*256/256:12*e/7*256/256)+this.trunc(128/7))/256*7)},rK.prototype.trunc=function(e){var t=e-e%1;return 0==t&&(e<0||0===e&&1/e!=1/0)?-0:t},rK.prototype.pixelsToRowHeight=function(e){return e*this.unitsProportions[5]/this.unitsProportions[6]},rK.prototype.saveSheetRelations=function(e){for(var t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">',i=0,n=e.hyperLinks;i<n.length;i++){var o=n[i];t+='<Relationship Id="rId'+o.rId+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="'+this.processString(o.target)+'" TargetMode="External" />'}return null!=e.images&&0<e.images.length&&(t+='<Relationship Id="rId'+(e.hyperLinks.length+1)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing" Target="../drawings/drawing'+this.drawingCount+'.xml" />'),t+="</Relationships>"},rK.prototype.saveSheetView=function(e){var t='<sheetViews><sheetView workbookViewId="0" ';return!0===e.enableRtl&&(t+='rightToLeft="1"'),!1===e.showGridLines?t+='showGridLines="0" >':t+=">",void 0!==e.freezePanes&&(t+='<pane state="frozen" topLeftCell="'+e.freezePanes.leftCell+'" ',0!==e.freezePanes.row&&(t+='ySplit="'+e.freezePanes.row+'" '),0!==e.freezePanes.column&&(t+='xSplit="'+e.freezePanes.column+'" '),t+="/>"),t+="</sheetView></sheetViews > "},rK.prototype.saveSharedString=function(){var e=this.sharedString.length;if(0<e){for(var t='<?xml version="1.0" encoding="utf-8"?><sst uniqueCount="'+e+'" count="'+this.sharedStringCount+'" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">',i="",n=0;n<e;n++)i=0!==this.sharedString[n].indexOf("<r>")?(i+="<si><t>")+this.processString(this.sharedString[n])+"</t></si>":(i+="<si>")+this.sharedString[n]+"</si>";this.addToArchive(t+(i+="</sst>"),"xl/sharedStrings.xml")}},rK.prototype.processString=function(e){if("string"==typeof e)-1!==(e=-1!==(e=-1!==(e=-1!==e.indexOf("&")?e.replace(/&/g,"&amp;"):e).indexOf("<")?e.replace(/</g,"&lt;"):e).indexOf(">")?e.replace(/>/g,"&gt;"):e).indexOf("\v")&&(e=e.replace(/\v/g,"_x000B_"));else if("object"==typeof e)for(var t=0;t<e.length;t++)-1!==e[t].indexOf("&")&&(e[t]=e[t].replace(/&/g,"&amp;")),-1!==e[t].indexOf("<")&&(e[t]=e[t].replace(/</g,"&lt;")),-1!==e[t].indexOf(">")&&(e[t]=e[t].replace(/>/g,"&gt;")),-1!==e[t].indexOf("\v")&&(e[t]=e[t].replace(/\v/g,"_x000B_"));return e},rK.prototype.saveStyles=function(){this.updateCellXfsStyleXfs();var e='<?xml version="1.0" encoding="utf-8"?><styleSheet xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">',e=(e=(e=(e=(e=(e=(e+=this.saveNumberFormats())+this.saveFonts())+this.saveFills())+this.saveBorders())+this.saveCellStyleXfs())+this.saveCellXfs())+this.saveCellStyles();this.addToArchive(e+"</styleSheet>","xl/styles.xml")},rK.prototype.updateCellXfsStyleXfs=function(){for(var e=0,t=this.mStyles;e<t.length;e++){var i,n=t[e],o=void 0,r=(n.isGlobalStyle?(o=new CX).xfId=n.index-1:(o=new bX).xfId=0,this.isNewFont(n));r.result?o.fontId=r.index:((r=new vX).b=n.bold,r.i=n.italic,r.name=n.fontName,r.sz=n.fontSize,r.u=n.underline,r.strike=n.strikeThrough,r.color="FF"+n.fontColor.replace("#",""),this.mFonts.push(r),o.fontId=this.mFonts.length-1),"none"!==n.backColor?(r="FF"+n.backColor.replace("#",""),this.mFills.has(r)?i=this.mFills.get(r):(i=this.mFills.size+2,this.mFills.set(r,i)),o.fillId=i):o.fillId=0,this.isNewBorder(n)?o.borderId=0:(this.mBorders.push(n.borders),o.borderId=this.mBorders.length),"GENERAL"!==n.numberFormat?this.mNumFmt.has(n.numberFormat)?(r=this.mNumFmt.get(n.numberFormat),o.numFmtId=r.numFmtId):(r=this.mNumFmt.size+164,this.mNumFmt.set(n.numberFormat,new AX(r,n.numberFormat)),o.numFmtId=r):"GENERAL"===n.numberFormat&&14===n.numFmtId?o.numFmtId=14:o.numFmtId=0,n.isGlobalStyle||(o.applyAlignment=1),o.alignment=new wX,o.alignment.indent=n.indent,o.alignment.horizontal=n.hAlign,o.alignment.vertical=n.vAlign,o.alignment.wrapText=n.wrapText?1:0,o.alignment.rotation=n.rotation,n.isGlobalStyle&&this.mCellStyleXfs.push(o),this.mCellXfs.push(o)}},rK.prototype.saveNumberFormats=function(){var i;return 1<=this.mNumFmt.size?(i='<numFmts count="'+this.mNumFmt.size+'">',this.mNumFmt.forEach(function(e,t){i+='<numFmt numFmtId="'+e.numFmtId+'" formatCode="'+e.formatCode.replace(/"/g,"&quot;")+'" />'}),i+="</numFmts>"):""},rK.prototype.saveFonts=function(){var e='<fonts count="'+this.mFonts.length+'">';if(1<=this.mFonts.length)for(var t=0,i=this.mFonts;t<i.length;t++){var n=i[t];e+="<font>",n.b&&(e+="<b />"),n.i&&(e+="<i />"),n.u&&(e+="<u />"),n.strike&&(e+="<strike />"),e=(e=(e+='<sz val="'+n.sz+'" />')+('<color rgb="'+n.color+'" />'))+('<name val="'+n.name+'" /></font>')}return e+"</fonts>"},rK.prototype.saveFills=function(){var i='<fills count="'+(this.mFills.size+2)+'"><fill><patternFill patternType="none"></patternFill></fill><fill><patternFill patternType="gray125"></patternFill></fill>';return 1<=this.mFills.size&&this.mFills.forEach(function(e,t){i+='<fill><patternFill patternType="solid"><fgColor rgb="'+t+'" /><bgColor rgb="FFFFFFFF" /></patternFill></fill>'}),i+"</fills>"},rK.prototype.saveBorders=function(){var e='<borders count="'+(this.mBorders.length+1)+'"><border><left /><right /><top /><bottom /><diagonal /></border>';if(1<=this.mBorders.length)for(var t=0,i=this.mBorders;t<i.length;t++){var n,o,r=i[t];this.isAllBorder(r)?(n=r.all.color.replace("#",""),e+='<border><left style="'+(o=r.all.lineStyle)+'"><color rgb="FF'+n+'" /></left><right style="'+o+'"><color rgb="FF'+n+'" /></right><top style="'+o+'"><color rgb="FF'+n+'" /></top><bottom style="'+o+'"><color rgb="FF'+n+'" /></bottom></border>'):e+='<border><left style="'+r.left.lineStyle+'"><color rgb="FF'+r.left.color.replace("#","")+'" /></left><right style="'+r.right.lineStyle+'"><color rgb="FF'+r.right.color.replace("#","")+'" /></right><top style="'+r.top.lineStyle+'"><color rgb="FF'+r.top.color.replace("#","")+'" /></top><bottom style="'+r.bottom.lineStyle+'"><color rgb="FF'+r.bottom.color.replace("#","")+'" /></bottom></border>'}return e+"</borders>"},rK.prototype.saveCellStyles=function(){var i=this,n='<cellStyles  count="'+this.cellStyles.size+'">';return this.cellStyles.forEach(function(e,t){n+='<cellStyle name="'+t+'" xfId="'+i.cellStyles.get(t).xfId+'"',"Normal"===t&&(n+=' builtinId="0"'),n+=" />"}),n+="</cellStyles>"},rK.prototype.saveCellStyleXfs=function(){var e='<cellStyleXfs count="'+(this.mCellStyleXfs.length+1)+'"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" />';if(1<=this.mCellStyleXfs.length)for(var t=0,i=this.mCellStyleXfs;t<i.length;t++){var n=i[t];e+='<xf numFmtId="'+n.numFmtId+'" fontId="'+n.fontId+'" fillId="'+n.fillId+'" borderId="'+n.borderId+'" ',void 0!==n.alignment?e+=">"+this.saveAlignment(n)+"</xf>":e+=" />"}return e+"</cellStyleXfs>"},rK.prototype.saveCellXfs=function(){var e='<cellXfs count="'+(this.mCellXfs.length+1)+'"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" />';if(1<=this.mCellXfs.length)for(var t=0,i=this.mCellXfs;t<i.length;t++){var n=i[t];e+='<xf numFmtId="'+n.numFmtId+'" fontId="'+n.fontId+'" fillId="'+n.fillId+'" borderId="'+n.borderId+'" xfId="'+n.xfId+'" ',1===n.applyAlignment&&(e+='applyAlignment="1"'),e+=">"+this.saveAlignment(n)+"</xf>"}return e+"</cellXfs>"},rK.prototype.saveAlignment=function(e){var t="<alignment ";return void 0!==e.alignment.horizontal&&(t+='horizontal="'+e.alignment.horizontal+'" '),void 0!==e.alignment.indent&&0!==e.alignment.indent?t+='indent="'+e.alignment.indent+'" ':void 0!==e.alignment.rotation&&0!==e.alignment.rotation&&(t+='textRotation="'+e.alignment.rotation+'" '),void 0!==e.alignment.vertical&&(t+='vertical="'+e.alignment.vertical+'" '),t+='wrapText="'+e.alignment.wrapText+'" />'},rK.prototype.saveApp=function(e){var t='<?xml version="1.0" encoding="utf-8" standalone="yes"?><Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"><Application>Essential XlsIO</Application>';void 0!==e&&(void 0!==e.manager&&(t+="<Manager>"+e.manager+"</Manager>"),void 0!==e.company)&&(t+="<Company>"+e.company+"</Company>"),this.addToArchive(t+"</Properties>","docProps/app.xml")},rK.prototype.saveCore=function(e){var t=new Date,i='<?xml version="1.0" encoding="utf-8" standalone="yes"?><cp:coreProperties xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties">';void 0!==this.builtInProperties?(void 0!==e.author&&(i+="<dc:creator>"+e.author+"</dc:creator>"),void 0!==e.subject&&(i+="<dc:subject>"+e.subject+"</dc:subject>"),void 0!==e.category&&(i+="<cp:category>"+e.category+"</cp:category>"),void 0!==e.comments&&(i+="<dc:description>"+e.comments+"</dc:description>"),void 0!==e.title&&(i+="<dc:title>"+e.title+"</dc:title>"),void 0!==e.tags&&(i+="<cp:keywords>"+e.tags+"</cp:keywords>"),void 0!==e.status&&(i+="<cp:contentStatus>"+e.status+"</cp:contentStatus>"),void 0!==e.createdDate?i+='<dcterms:created xsi:type="dcterms:W3CDTF">'+e.createdDate.toISOString()+"</dcterms:created>":i+='<dcterms:created xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:created>",void 0!==e.modifiedDate?i+='<dcterms:modified xsi:type="dcterms:W3CDTF">'+e.modifiedDate.toISOString()+"</dcterms:modified>":i+='<dcterms:modified xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:modified>"):i=(i+='<dcterms:created xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:created>")+'<dcterms:modified xsi:type="dcterms:W3CDTF">'+t.toISOString()+"</dcterms:modified>",this.addToArchive(i+="</cp:coreProperties>","docProps/core.xml")},rK.prototype.saveTopLevelRelation=function(){this.addToArchive('<?xml version="1.0" encoding="utf-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml" /><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml" /><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml" /></Relationships>',"_rels/.rels")},rK.prototype.saveWorkbookRelation=function(){for(var e='<?xml version="1.0" encoding="utf-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">',t=this.worksheets.length,i=0,n=0;n<t;n++,i++)e+='<Relationship Id="rId'+(n+1).toString()+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet'+(n+1).toString()+'.xml" />';e+='<Relationship Id="rId'+(++i).toString()+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" />',0<this.sharedStringCount&&(e+='<Relationship Id="rId'+(++i).toString()+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml" />'),this.addToArchive(e+"</Relationships>","xl/_rels/workbook.xml.rels")},rK.prototype.saveContentType=function(){for(var e='<?xml version="1.0" encoding="utf-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/xml" /><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />',t="",i=this.worksheets.length,n=0,o=0;o<i;o++)t+='<Override PartName="/xl/worksheets/sheet'+(o+1).toString()+'.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" />',null!=this.worksheets[o].images&&0<this.worksheets[o].images.length&&(t+='<Override PartName="/xl/drawings/drawing'+(++n).toString()+'.xml" ContentType="application/vnd.openxmlformats-officedocument.drawing+xml" />');0<this.imageCount&&(t+='<Default Extension="png" ContentType="image/png" />'),0<this.sharedStringCount&&(e+='<Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" />'),this.addToArchive(e+t+"</Types>","[Content_Types].xml")},rK.prototype.addToArchive=function(e,t){var i;i="string"==typeof e?(i=new Blob([e],{type:"text/plain"}),new ih(i,t)):new ih(e,t),this.mArchive.addItem(i)},rK.prototype.processMergeCells=function(e,t,i){var n,o,r;return 0===e.rowSpan&&0===e.colSpan||((n=new GX).x=e.index,n.width=e.colSpan,n.y=t,n.height=e.rowSpan,o=this.getCellName(n.y,n.x),r=this.getCellName(t+n.height,e.index+n.width),n.ref=o+":"+r,i.add(n),o={x:n.x,y:n.y},r={x:e.index+n.width,y:t+n.height},this.updatedMergedCellStyles(o,r,e)),i},rK.prototype.updatedMergedCellStyles=function(e,t,i){for(var n=e.x;n<=t.x;n++)for(var o=e.y;o<=t.y;o++)this.mergedCellsStyle.set(this.getCellName(o,n),{x:n,y:o,styleIndex:i.styleIndex})},rK.prototype.dateToTicks=function(e,t,i){var n;if(1<=e&&e<=9999&&1<=t&&t<=12)return 864e9*(365*(n=e-1)+(n/4|0)-(n/100|0)+(n/400|0)+(this.isLeapYear(e)?[0,31,60,91,121,152,182,213,244,274,305,335,366]:[0,31,59,90,120,151,181,212,243,273,304,334,365])[t-1]+i-1);throw new Error("Not a valid date")},rK.prototype.timeToTicks=function(e,t,i){if(0<=e&&e<24&&0<=t&&t<60&&0<=i&&i<60)return 1e4*(3600*e+60*t+i)*1e3;throw new Error("Not valid time")},rK.prototype.isLeapYear=function(e){return e%4==0&&(e%100!=0||e%400==0)},rK.prototype.toOADate=function(e){if(0===(e=this.dateToTicks(e.getFullYear(),e.getMonth()+1,e.getDate())+this.timeToTicks(e.getHours(),e.getMinutes(),e.getSeconds())))return 0;if(e<31241376e9)throw new Error("Arg_OleAutDateInvalid");return(e-599264352e9)/1e4/864e5},rK);function rK(e,t,i,n,o){if(this.sharedStringCount=0,this.unitsProportions=[1.28,.32,96,96/25.4,96/2.54,1,96/72,96/72/12700],this.hyperlinkStyle={fontColor:"#0000FF",underline:!0},this.culture=void 0!==i?i:"en-US",this.currency=void 0!==n?n:"USD",this.intl=new Ti(this.culture),"xlsx"===(this.mSaveType=t)){if(this.mArchive=new Zl,this.sharedString=[],this.mFonts=[],this.mBorders=[],this.mStyles=[],this.printTitles=new Map,this.cellStyles=new Map,this.mNumFmt=new Map,this.mFills=new Map,this.mStyles.push(new yX),this.mFonts.push(new vX),this.cellStyles.set("Normal",new SX),this.mCellXfs=[],this.mCellStyleXfs=[],this.drawingCount=0,this.imageCount=0,null!==e.styles&&void 0!==e.styles){this.globalStyles=new Map;for(var r=0;r<e.styles.length;r++)if(void 0!==e.styles[r].name){if(this.cellStyles.has(e.styles[r].name))throw Error("Style name "+e.styles[r].name+" is already existed");var s=new yX,a=(s.isGlobalStyle=!0,this.parserCellStyle(e.styles[r],s,"none"),new SX),s=(a.name=s.name,a.xfId=s.index-1,this.cellStyles.set(a.name,a),{});void 0!==e.styles[r].numberFormat&&(s.format=e.styles[r].numberFormat),void 0!==e.styles[r].type?s.type=e.styles[r].type:s.type="datetime",void 0!==s.format&&this.globalStyles.set(e.styles[r].name,s)}}if(null===e.worksheets||void 0===e.worksheets)throw Error("Worksheet is expected.");this.parserWorksheets(e.worksheets),null!==e.builtInProperties&&void 0!==e.builtInProperties&&(this.builtInProperties=new sK,this.parserBuiltInProperties(e.builtInProperties,this.builtInProperties))}else this.csvHelper=new $X(e,o)}var sK=function(){},aK=(lK.getQuery=function(e,t){var i=t.generateQuery(!0).requiresCount();return t.isRemote()&&(e.groupSettings.enableLazyLoading&&e.groupSettings.columns.length?i.lazyLoad=[]:i.take(e.pageSettings.totalRecordsCount)),i},lK.prototype.getFData=function(e,t){return DB(t,{},e,this.foreignKeyData[t.field])[0]},lK.prototype.getGridRowModel=function(e,t,i,n){void 0===n&&(n=0);var o=[],r=t.length;if(r){for(var s=0;s<r;s++,n++){var a={isExpand:!1},a=(a.data=t[parseInt(s.toString(),10)],a.index=n,(i.childGrid||i.detailTemplate)&&("All"===i.hierarchyPrintMode?a.isExpand=!0:"Expanded"===i.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[parseInt(n.toString(),10)]&&(a.isExpand=i.expandedRows[parseInt(n.toString(),10)].isExpand)),new DE(a));a.cells=this.generateCells(e,i),o.push(a)}this.processColumns(o)}return o},lK.prototype.generateCells=function(e,t){var i=[];if(t.childGridLevel)for(var n=t.childGridLevel,o=0;o<n;o++)i.push(this.generateCell({},LA.Indent));for(var r=0,s=e;r<s.length;r++){var a=s[r];i.push(this.generateCell(a,LA.Data))}return i},lK.prototype.getColumnData=function(e){var t,i=this,n=[],o=e.getForeignKeyColumns();if(o.length){for(var r=0;r<o.length;r++){var s="result"in o[parseInt(r.toString(),10)].dataSource?new me(o[parseInt(r.toString(),10)].dataSource.result):o[parseInt(r.toString(),10)].dataSource;n.push(s.executeQuery(new ya))}t=Promise.all(n).then(function(e){for(var t=0;t<o.length;t++)i.foreignKeyData[o[parseInt(t.toString(),10)].field]=e[parseInt(t.toString(),10)].result})}return t},lK.prototype.getHeaders=function(e,t){this.hideColumnInclude=!!t,this.colDepth=_B(e);for(var i=[],n=0;n<this.colDepth;n++)i[parseInt(n.toString(),10)]=new DE({}),i[parseInt(n.toString(),10)].cells=[];return i=this.processColumns(i),{rows:i=this.processHeaderCells(i,e),columns:this.generateActualColumns(e)}},lK.prototype.getConvertedWidth=function(e){var t=parseFloat(e);return-1!==e.indexOf("%")?this.parent.element.getBoundingClientRect().width*t/100:t},lK.prototype.generateActualColumns=function(e,t){void 0===t&&(t=[]);for(var i=0,n=e;i<n.length;i++){var o=n[i];o.commands||(o.columns?(o.visible||this.hideColumnInclude)&&0!==this.getCellCount(o,0)&&this.generateActualColumns(o.columns,t):(o.visible||this.hideColumnInclude)&&t.push(o))}return t},lK.prototype.processHeaderCells=function(e,t){for(var i=t,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].commands||(e=this.appendGridCells(i[parseInt(n.toString(),10)],e,0));return e},lK.prototype.appendGridCells=function(e,t,i){if(e.columns||!1===e.visible&&!this.hideColumnInclude||e.commands){if(e.columns)for(var n=this.getCellCount(e,0),o=(n&&t[parseInt(i.toString(),10)].cells.push(new kE({cellType:LA.StackedHeader,column:e,colSpan:n})),void 0),r=0,s=e.columns.length;r<s;r++)e.columns[parseInt(r.toString(),10)].visible&&!o&&(o=!0),t=this.appendGridCells(e.columns[parseInt(r.toString(),10)],t,i+1)}else t[parseInt(i.toString(),10)].cells.push(this.generateCell(e,LA.Header,this.colDepth-i,i));return t},lK.prototype.generateCell=function(e,t,i,n){e={visible:e.visible,isDataCell:t===LA.Data,column:e,cellType:t,rowSpan:i,index:n};return(!e.rowSpan||e.rowSpan<2)&&delete e.rowSpan,new kE(e)},lK.prototype.processColumns=function(e){var t=this.parent,i=[];t.enableColumnVirtualization&&(i=t.getColumnIndexesInView());for(var n=0,o=e.length;n<o;n++)if(t.allowGrouping)for(var r=0,s=t.groupSettings.columns.length-1;r<s;r++)t.enableColumnVirtualization&&-1===i.indexOf(r)||e[parseInt(n.toString(),10)].cells.splice(0,0,this.generateCell({},LA.HeaderIndent));return e},lK.prototype.getCellCount=function(e,t){if(e.columns)for(var i=0;i<e.columns.length;i++)t=this.getCellCount(e.columns[parseInt(i.toString(),10)],t);else(e.visible||this.hideColumnInclude)&&t++;return t},lK.prototype.checkAndExport=function(t,e){Object.keys(t).some(function(e){return!t[""+e]})||e()},lK.prototype.failureHandler=function(e,t,i){var n=this;return function(){e[t.id]=!0,n.checkAndExport(e,i)}},lK.prototype.createChildGrid=function(e,t,i,n){i=new IP(this.parent.detailRowModule.getGridModel(e,t,i)),e.isPrinting=!1,i.parentDetails={parentID:e.element.id,parentPrimaryKeys:e.getPrimaryKeyFieldNames(),parentKeyField:e.childGrid.queryString,parentKeyFieldValue:R(i.queryString,t.data),parentRowData:t.data},e=$P("child-grid"),t=Q("div",{id:e});return t.style.display="none",document.body.appendChild(t),n[""+(i.id=e)]=!1,i.isExportGrid=!0,{childGrid:i,element:t}},lK.prototype.getGridExportColumns=function(e){for(var t=[],i=0,n=e;i<n.length;i++)"checkbox"!==n[parseInt(i.toString(),10)].type&&t.push(n[parseInt(i.toString(),10)]);return t},lK.prototype.getForeignKeyData=function(){return this.foreignKeyData},lK);function lK(e,t){this.hideColumnInclude=!1,this.foreignKeyData={},!(this.parent=e).parentDetails&&t&&(this.foreignKeyData=t)}dK.prototype.returnFormattedValue=function(e,t){return!je(e.value)&&e.value?this.valueFormatter.getFormatFunction(t)(e.value):""},dK.prototype.formatCellValue=function(e){var t,i;return e.isForeignKey&&(e.value=R(e.column.foreignKeyValue,DB(e.column,{},e.value)[0])),"number"===e.column.type&&void 0!==e.column.format&&""!==e.column.format?("string"==typeof e.column.format&&(e.column.format={format:e.column.format}),e.value||0===e.value?this.internationalization.getNumberFormat(e.column.format)(e.value):""):"boolean"===e.column.type&&""!==e.value?e.value?"true":"false":"date"!==e.column.type&&"dateonly"!==e.column.type&&"datetime"!==e.column.type&&"time"!==e.column.type||void 0===e.column.format?(je(e.column.type)||je(e.value))&&je(e.value)?"":e.value.toString():("string"==typeof e.value&&(e.value=new Date(e.value)),"string"==typeof e.column.format?(t=void 0,i=e.column.format,t="date"===e.column.type||"dateonly"===e.column.type?{type:"date",skeleton:i}:"time"===e.column.type?{type:"time",skeleton:i}:{type:"dateTime",skeleton:i},this.returnFormattedValue(e,t)):e.column.format instanceof Object&&void 0===e.column.format.type?e.value.toString():(i=void 0,i="date"===e.column.type||"dateonly"===e.column.type?{type:e.column.format.type,format:e.column.format.format,skeleton:e.column.format.skeleton}:"time"===e.column.type?{type:"time",format:e.column.format.format,skeleton:e.column.format.skeleton}:{type:"dateTime",format:e.column.format.format,skeleton:e.column.format.skeleton},this.returnFormattedValue(e,i)))};var hK=dK;function dK(e){this.valueFormatter=new v0(e),this.internationalization=new Ti(e)}cK.prototype.getModuleName=function(){return"ExcelExport"},cK.prototype.init=function(e){null!==e.element&&""===e.element.id&&(e.element.id=(new Date).toISOString(),this.isElementIdChanged=!0),this.parent=e,this.parent.isDestroyed||(this.isExporting=void 0,this.book={},this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.rowLength=1,this.footer=void 0,this.expType="AppendToSheet",this.includeHiddenColumn=!1,this.exportValueFormatter=new hK(e.locale),e.id=$P("main-grid"),this.gridPool[e.id]=!1)},cK.prototype.Map=function(e,t,i,n,o,r){var s=e,e=(this.gridPool={},!e.childGrid&&!e.detailTemplate||!je(t)&&"None"===t.hierarchyExportMode||(e.expandedRows=OB(e).expandedRows),{requestType:"beforeExcelExport",gridObject:s,cancel:!1,isMultipleExport:i,workbook:n,isCsv:o,isBlob:r,isChild:this.isChild,grpFooterTemplates:this.grpFooterTemplates});return s.trigger(Gx,e),e.cancel?new Promise(function(e){return e()}):(this.parent.log("exporting_begin",this.getModuleName()),this.data=new TE(s),this.isExporting=!0,this.isBlob=e.isBlob,this.isChild=e.isChild,this.grpFooterTemplates=e.grpFooterTemplates,this.isCsvExport=e.isCsv||!1,BP(t)&&FP(t,s),this.processRecords(s,t,e.isMultipleExport,e.workbook))},cK.prototype.exportingSuccess=function(e){this.isExporting=!1,this.parent.trigger(Yx,this.isBlob?{promise:this.blobPromise}:{gridInstance:this.parent}),this.parent.log("exporting_complete",this.getModuleName()),e(this.book)},cK.prototype.processRecords=function(n,o,r,s){var e,t,i,a=this;return je(o)||je(o.dataSource)?je(o)||"CurrentPage"!==o.exportType||this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()?(e=[],t=aK.getQuery(n,this.data),this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()&&((o=je(o)?{hierarchyExportMode:"All"}:o).hierarchyExportMode="None"===o.hierarchyExportMode?"None":"All","All"===o.hierarchyExportMode)&&(t.lazyLoad=[]),e.push(this.data.getData({},t)),e.push(this.helper.getColumnData(n)),new Promise(function(t,i){Promise.all(e).then(function(e){a.init(n),a.processInnerRecords(n,o,r,s,e[0]).then(function(){a.exportingSuccess(t)})}).catch(function(e){i(a.book),a.parent.trigger(UA,e)})})):new Promise(function(e){a.init(n),a.processInnerRecords(n,o,r,s,a.parent.getCurrentViewRecords()),a.exportingSuccess(e)}):(o.dataSource=o.dataSource instanceof me?o.dataSource:new me(o.dataSource),(je((i=o.query||new ya).isCountRequired)||n.aggregates)&&(i.isCountRequired=!0),new Promise(function(t){o.dataSource.executeQuery(i).then(function(e){a.init(n),a.processInnerRecords(n,o,r,s,e).then(function(){a.exportingSuccess(t)})})}))},cK.prototype.processInnerRecords=function(i,n,o,r,s){var a,l=this,e=(this.groupedColLength=i.groupSettings.columns.length,5),h=[],d=_B(i.columns),p=!je(n);return p&&!je(n.multipleExport)&&(this.expType=je(n.multipleExport.type)?"AppendToSheet":n.multipleExport.type,je(n.multipleExport.blankRows)||(e=n.multipleExport.blankRows)),je(r)?(this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.sheet.images=[]):"NewSheet"===this.expType?(this.workSheet=r.worksheets,this.rows=[],this.columns=[],this.sheet.images=[],this.styles=r.styles):(this.workSheet=[],this.rows=r.worksheets[0].rows,this.columns=r.worksheets[0].columns,this.styles=r.styles,this.sheet.images=r.worksheets[0].images,this.rowLength=this.rows[this.rows.length-1].index+e,this.rowLength++),p&&(je(o)?(je(n.header)||this.processExcelHeader(JSON.parse(JSON.stringify(n.header))),je(n.footer)||(this.footer=JSON.parse(JSON.stringify(n.footer)))):(je(n.header)||!o&&"NewSheet"!==this.expType||this.processExcelHeader(JSON.parse(JSON.stringify(n.header))),je(n.footer)||"AppendToSheet"===this.expType&&o||(this.footer=JSON.parse(JSON.stringify(n.footer))))),this.includeHiddenColumn=p&&n.includeHiddenColumn,new Promise(function(e,t){i.childGridLevel=0,h=l.processGridExport(i,n,s),l.globalResolve=e,l.gridPool[i.id]=!0,l.helper.checkAndExport(l.gridPool,l.globalResolve)}).then(function(){var e,t=[];return l.organiseRows(h,h[0].index,t),l.rows=l.rows.concat(t),je(l.footer)||("AppendToSheet"!==l.expType||o)&&"NewSheet"!==l.expType||l.processExcelFooter(l.footer),0<l.columns.length&&(l.sheet.columns=l.columns),l.sheet.rows=l.rows,l.sheet.enableRtl=l.parent.enableRtl,l.parent.allowFiltering&&i.getVisibleColumns().length&&p&&n.enableFilter&&(t=n.header?n.header.headerRows||n.header.rows.length:0,t={row:d+t,column:l.groupedColLength?l.groupedColLength+1:l.sheet.columns[0].index,lastRow:l.sheet.rows.length,lastColumn:l.sheet.columns.length},l.sheet.autoFilters=t),l.workSheet.push(l.sheet),l.book.worksheets=l.workSheet,l.book.styles=l.styles,i.notify("finalPageSetup",l.book),o||(l.isCsvExport?(p&&!je(n.separator)&&","!==n.separator&&(a=n.separator),e=new oK(l.book,"csv",i.locale,oe,a),l.isBlob?l.blobPromise=e.saveAsBlob("text/csv"):p&&n.fileName?e.save(n.fileName):e.save("Export.csv")):(e=new oK(l.book,"xlsx",i.locale,oe),l.isBlob?l.blobPromise=e.saveAsBlob("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"):p&&n.fileName?e.save(n.fileName):e.save("Export.xlsx")),l.isElementIdChanged&&(i.element.id=""),delete i.expandedRows),r})},cK.prototype.organiseRows=function(e,t,i){if(e.length)for(var n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)],r=o.childRows;r?(o.index=t++,delete o.childRows,i.push(o),t=this.organiseRows(r,t,i)):(o.index=t++,i.push(o))}return t},cK.prototype.processGridExport=function(e,t,i){var n=[],o=(je(t)||je(t.theme)||(this.theme=t.theme),!e.childGrid&&!e.detailTemplate||je(t)||(e.hierarchyPrintMode=t.hierarchyExportMode||"Expanded"),new aK(e,this.helper.getForeignKeyData())),r=BP(t)?QP(t.columns,e.enableColumnVirtualization):o.getGridExportColumns(e.columns),r=o.getHeaders(r,this.includeHiddenColumn),s=e.groupSettings.columns.length?e.groupSettings.columns.length-1:0,n=this.processHeaderContent(e,r,s,n);return n=je(t)||!Object.keys(t).length||!je(t.dataSource)||"CurrentPage"!==t.exportType||e.groupSettings.enableLazyLoading&&!e.getDataModule().isRemote()?this.processRecordContent(e,i,r,t,void 0,n,o):this.processRecordContent(e,i,r,t,e.currentViewData,n,o),e.notify(MI,{excelRows:n,type:"excel"}),this.capTemplate=void 0,this.footerTemplates=[],this.grpFooterTemplates=[],this.aggIndex=0,this.totalAggregates=0,n},cK.prototype.processRecordContent=function(e,t,i,n,o,r,s){var a=!je(o)&&o.length?o:t.result;return je(a.level)?this.processRecordRows(e,a,i,0,0,n,r,s):this.processGroupedRows(e,a,i,a.level,0,n,r,s),je(t.aggregates)||(je(o)||this.parent.groupSettings.enableLazyLoading?(i=t.result.GroupGuid?t.result.records:t.result,this.processAggregates(e,i,r)):this.processAggregates(e,t.result,r,o)),r},cK.prototype.processGroupedRows=function(e,t,i,n,o,r,s,a){for(var l=0,h=t;l<h.length;l++){var d=h[l],p=[],c={},u=(c.index=1+n-1,e.getColumnByField(d.field)),g={value:d.key,column:u,style:void 0,isForeignKey:u.isForeignColumn()},u=e.getColumnByField(d.field).headerText+": "+(u.enableGroupByFormat?d.key:this.exportValueFormatter.formatCellValue(g))+" - ",g=(1<d.count?u+=d.count+" items":u+=d.count+" item",{captionText:u,type:this.isCsvExport?"CSV":"Excel",data:d});this.parent.trigger(W1,g),c.value=g.captionText,c.style=this.getCaptionThemeStyle(this.theme),je(g.style)||(c.style=this.mergeOptions(c.style,g.style));u=new DD(e).generateRows(d);if(this.fillAggregates(e,u,t.level+t.childLevels-1,s,this.rowLength),p.push(c),0<s[s.length-1].cells.length){for(var m=t.level+t.childLevels+u[0].cells.length,f=0,y=0,v=s[s.length-1].cells;y<v.length;y++){var b=v[y];b.index<m&&(m=b.index),b.index>f&&(f=b.index),p[p.length-1].index!==b.index&&p.push(b)}1<m-c.index&&(c.colSpan=m-c.index);for(var g=Object.keys(u[0].data),w=g?g.length:0;f<i.columns.length-w+n+t.childLevels;){var C={},S=(C.index=f+1,C.style=this.getCaptionThemeStyle(this.theme),{type:this.isCsvExport?"CSV":"Excel",data:d});this.parent.trigger(W1,S),je(S.style)||(C.style=this.mergeOptions(C.style,S.style)),p.push(C),f++}}else{for(var A=0,x=0,I=i.columns;x<I.length;x++)I[x].visible&&A++;c.colSpan=t.childLevels+A}s[s.length-1].cells=p,this.rowLength++,this.groupedColLength<8&&1<n&&(s[s.length-1].grouping={outlineLevel:n-1,isCollapsed:!0}),!je(t.childLevels)&&0<t.childLevels?(this.processGroupedRows(e,d.items,i,d.items.level,o,r,s,a),this.processAggregates(e,d,s,void 0,n-1+t.childLevels,!0)):(o=this.processRecordRows(e,d.items,i,n-1,o,r,s,a),this.processAggregates(e,d,s,void 0,n-1,!0))}},cK.prototype.processRecordRows=function(e,t,i,n,o,r,s,a){for(var l=1,h=[],i=i.columns,d=0,p=a.getGridRowModel(i,t,e,o);d<p.length;d++){var c=p[d],h=[];o++;for(var l=1,u=void 0,g=0,m=c.cells.length;g<m;g++){var f,y,v,b=c.cells[parseInt(g.toString(),10)];b.cellType===LA.Data&&(y=je(y=(b=b.column).field)?"":b.valueAccessor(y,c.data,b),y=je(y)?"":y,f=void("dateonly"===b.type&&"string"==typeof y&&y&&(f=y.split(/[^0-9.]/),y=new Date(parseInt(f[0],10),parseInt(f[1],10)-1,parseInt(f[2],10)))),b.isForeignColumn&&b.isForeignColumn()&&(f=a.getFData(y,b),y=R(b.foreignKeyValue,f)),je(y)||(v=l+n+e.childGridLevel,y={data:c.data,column:b,foreignKeyData:f,value:y,style:void 0,colSpan:1,cell:b={}},e.trigger(Xx,y),je(y.image)||je(y.image.base64)||(u=this.setImage(y,v),y.image.height&&""!==y.value&&(u+=30)),je(y.hyperLink)||(y.cell.hyperlink={target:y.hyperLink.target},y.value=y.hyperLink.displayText||y.value),(b=y.cell).index=v,b.value=y.value,""===y.data&&e.childGridLevel&&1===l&&(y={style:{hAlign:"left"}},b.colSpan=e.getVisibleColumns().length,b.value=this.l10n.getConstant("EmptyRecord")),1<y.colSpan&&(b.colSpan=y.colSpan),je(y.style)?b.style={name:e.element.id+"column"+(l+n)}:(v=this.getColumnStyle(e,l+n),b.style=this.mergeOptions(this.styles[parseInt(v.toString(),10)],y.style)),h.push(b)),l++)}var w,C,S,A,x={index:this.rowLength++,cells:h};je(u)||(x.height=u),this.groupedColLength&&this.groupedColLength<8&&0<n+1&&(x.grouping={outlineLevel:n+1,isCollapsed:!0}),s.push(x),!c.isExpand&&!this.isChild||je(e.childGrid)&&je(e.detailTemplate)||(je(e.childGrid)?(this.parent.trigger(Zx,A={parentRow:c,row:x,value:{},action:"excelexport",gridInstance:e}),x.childRows=this.processDetailTemplate(A)):(e.isPrinting=!0,C=!je(r)&&r.exportType?r.exportType:"AllPages",w=(C=this.helper.createChildGrid(e,c,C,this.gridPool)).childGrid,C=C.element,w.actionFailure=a.failureHandler(this.gridPool,w,this.globalResolve),w.childGridLevel=e.childGridLevel+1,S=Pe(r,{columns:null,dataSource:null,query:null}),this.parent.trigger(Jx,A={childGrid:w,row:c,exportProperties:S}),w.beforeDataBound=this.childGridCell(x,w,S,c),w.appendTo(C))),e.notify(DI,{rowObj:c,type:"excel",excelRows:s})}return o},cK.prototype.processDetailTemplate=function(e){var s,a,t,l=this,h=[],n=2;if(e.value.columnHeader||e.value.rows){var d=function(e,t){var i={};return je(e.index)&&(e.index=s,s++),i.index=e.index+n,je(e.value)||(i.value=e.value),je(e.colSpan)||(i.colSpan=e.colSpan),je(e.rowSpan)||(i.rowSpan=e.rowSpan),i.style=t?l.getHeaderThemeStyle(l.theme):l.getRecordThemeStyle(l.theme),je(e.style)||(t={fontColor:e.style.fontColor,fontName:e.style.fontName,fontSize:e.style.fontSize,hAlign:e.style.excelHAlign,vAlign:e.style.excelVAlign,rotation:e.style.excelRotation,bold:e.style.bold,indent:e.style.indent,italic:e.style.italic,underline:e.style.underline,backColor:e.style.backColor,wrapText:e.style.wrapText,borders:e.style.excelBorders,numberFormat:e.style.excelNumberFormat,type:e.style.excelType,strikeThrough:e.style.strikeThrough},i.style=l.mergeOptions(t,i.style)),je(e.image)||je(e.image.base64)||(1<e.rowSpan?l.setImage(e,i.index):(a=l.setImage(e,i.index),e.image.height&&""!==e.value&&(a+=30))),je(e.hyperLink)||(i.hyperlink={target:e.hyperLink.target},i.value=e.hyperLink.displayText),i},i=function(e,t){for(var i=[],n=s=0;n<e.cells.length;n++){var o=e.cells[parseInt(n.toString(),10)],o=d(o,t);i.push(o)}var r={index:l.rowLength++,cells:i};je(a)||(r.height=a,a=null),h.push(r)};if(e.value.columnHeader)for(var o=0;o<e.value.columnHeader.length;o++)i(e.value.columnHeader[parseInt(o.toString(),10)],!0);if(e.value.rows)for(o=0;o<e.value.rows.length;o++)i(e.value.rows[parseInt(o.toString(),10)])}else e.value.image?(a=this.setImage(e.value,n),t={index:this.rowLength++,cells:[{index:n,style:this.getRecordThemeStyle(this.theme)}]},je(a)||(t.height=a,a=null),h.push(t)):e.value.text?(t={index:this.rowLength++,cells:[{index:n,value:e.value.text,style:this.getRecordThemeStyle(this.theme)}]},h.push(t)):e.value.hyperLink&&(t={index:this.rowLength++,cells:[{index:2,hyperlink:{target:e.value.hyperLink.target},value:e.value.hyperLink.displayText,style:this.getRecordThemeStyle(this.theme)}]},h.push(t));for(o=0;o<h.length;o++)h[parseInt(o.toString(),10)].grouping={outlineLevel:1,isCollapsed:!e.parentRow.isExpand,isHidden:!e.parentRow.isExpand};return h},cK.prototype.setImage=function(e,t){je(this.sheet.images)&&(this.sheet.images=[]);var i={image:e.image.base64,row:this.rowLength,column:t,lastRow:this.rowLength,lastColumn:t};return e.image.width&&e.image.height&&(i.width=e.image.width,i.height=e.image.height),this.sheet.images.push(i),this.columns[t-1].width=e.image.width||this.columns[t-1].width,e.image.height||50},cK.prototype.childGridCell=function(o,r,s,a){var l=this;return function(e){r.beforeDataBound=null,e.cancel=!0,0===e.result.length&&(e.result=[""]),o.childRows=l.processGridExport(r,s,e);for(var t=l.parent.groupSettings.columns.length,i=o.childRows,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].grouping={outlineLevel:t+r.childGridLevel,isCollapsed:!a.isExpand,isHidden:!a.isExpand};return r.destroy(),G(r.element),l.gridPool[r.id]=!0,l.helper.checkAndExport(l.gridPool,l.globalResolve),o}},cK.prototype.processAggregates=function(e,t,i,n,o,r){var s=new SD(e),a=(a=s.getColumns()).filter(function(e){return je(e.commands)&&"checkbox"!==e.type}),l=(e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo(),void 0),l=je(n)?t:n;return void 0===o&&(o=0),0<e.groupSettings.columns.length&&r?0<(n=new ID(e).generateRows(l,{level:l.level})).length&&(i=this.fillAggregates(e,n,o,i)):(o=0<e.groupSettings.columns.length&&!r?e.groupSettings.columns.length:o,0<(n=s.generateRows(l,t.aggregates,null,null,a)).length&&!r&&(o=e.groupSettings.columns.length?o-1:o,i=this.fillAggregates(e,n,o,i))),i},cK.prototype.fillAggregates=function(e,t,i,n,o){for(var r=0,s=t;r<s.length;r++){for(var a,l,h=s[r],d=[],p=!0,c=0,u=0,g=h.cells;u<g.length;u++){var m=g[u],f={},y={};if(je(m.attributes.index)||(y=this.parent.getColumnByIndex(m.attributes.index)),m.cellType!==LA.DetailFooterIntent&&"checkbox"!==y.type&&!y.commands&&(m.visible||this.includeHiddenColumn))if(c++,m.isDataCell){var p=!1,y=!je(m.column.footerTemplate),v=!je(m.column.groupFooterTemplate),b=!je(m.column.groupCaptionTemplate);if(f.index=c+i+e.childGridLevel,y)f.value=this.getAggreateValue(e,LA.Summary,m.column.footerTemplate,m,h);else if(v)f.value=this.getAggreateValue(e,LA.GroupSummary,m.column.groupFooterTemplate,m,h);else if(b)f.value=this.getAggreateValue(e,LA.CaptionSummary,m.column.groupCaptionTemplate,m,h);else for(var w=0,C=Object.keys(h.data[m.column.field]);w<C.length;w++)C[w]===m.column.type&&(je(h.data[m.column.field].Sum)?je(h.data[m.column.field].Average)?je(h.data[m.column.field].Max)?je(h.data[m.column.field].Min)?je(h.data[m.column.field].Count)?je(h.data[m.column.field].TrueCount)?je(h.data[m.column.field].FalseCount)?je(h.data[m.column.field].Custom)||(f.value=h.data[m.column.field].Custom):f.value=h.data[m.column.field][m.column.field+" - falsecount"]:f.value=h.data[m.column.field][m.column.field+" - truecount"]:f.value=h.data[m.column.field][m.column.field+" - count"]:f.value=h.data[m.column.field][m.column.field+" - min"]:f.value=h.data[m.column.field][m.column.field+" - max"]:f.value=h.data[m.column.field][m.column.field+" - average"]:f.value=h.data[m.column.field][m.column.field+" - sum"]);f.style=this.getCaptionThemeStyle(this.theme),this.aggregateStyle(m.column,f.style,m.column.field);b=null!=m.attributes.class?m.attributes.class.toString():"",b=(b&&(f.style.hAlign=-1<b.indexOf("e-rightalign")?"right":-1<b.indexOf("e-centeralign")?"center":"left"),{row:h,type:y?"Footer":v?"GroupFooter":"GroupCaption",style:f,cell:m});this.parent.trigger(bT,b),d.push(f)}else void 0===o&&(f.index=c+i+e.childGridLevel,f.style=this.getCaptionThemeStyle(this.theme),b={row:h,type:je(m.column.footerTemplate)?je(m.column.groupFooterTemplate)?"GroupCaption":"GroupFooter":"Footer",style:f,cell:m},this.parent.trigger(bT,b),d.push(f))}je(o)?(l={},l=!(this.groupedColLength<8&&0<this.groupedColLength)||e.groupSettings.enableLazyLoading&&je(n[n.length-1].grouping)?{index:this.rowLength++,cells:d}:(a={outlineLevel:n[n.length-1].grouping.outlineLevel,isCollapsed:!0},{index:this.rowLength++,cells:d,grouping:a}),p||n.push(l)):n.push({index:o,cells:d})}return n},cK.prototype.aggregateStyle=function(e,t,i){var n,i=this.parent.getColumnByField(i);"object"==typeof e.format?(n=e.format,t.numberFormat=je(n.format)?n.skeleton:n.format,je(n.type)||(t.type=n.type.toLowerCase())):t.numberFormat=e.format,!je(i)&&je(t.type)&&(t.type=i.type.toLowerCase())},cK.prototype.getAggreateValue=function(e,t,i,n,o){var r,s={},i=(s[M(LA,n.cellType)]=oo(i),o.data[n.column.field||n.column.columnName]);return(this.parent.isReact||this.parent.isVue||this.parent.isVue3||this.parent.isAngular)&&"string"!=typeof n.column.footerTemplate&&"string"!=typeof n.column.groupFooterTemplate&&"string"!=typeof n.column.groupCaptionTemplate?je(r=i[n.column.type])?"":r:(r=s[M(LA,n.cellType)](i,this.parent),this.parent.isVue3&&!je(r[1])?r[1].textContent:je(r[0])?"":r[0].textContent)},cK.prototype.mergeOptions=function(e,t){for(var i={},n=Object.keys(e),o=0;o<n.length;o++)"name"!==n[parseInt(o.toString(),10)]&&(i[n[parseInt(o.toString(),10)]]=e[n[parseInt(o.toString(),10)]]);for(n=Object.keys(t),o=0;o<n.length;o++)"name"!==n[parseInt(o.toString(),10)]&&(i[n[parseInt(o.toString(),10)]]=t[n[parseInt(o.toString(),10)]]);return i},cK.prototype.getColumnStyle=function(e,t){for(var i=0,n=0,o=this.styles;n<o.length;n++){if(o[n].name===e.element.id+"column"+t)return i;i++}},cK.prototype.headerRotation=function(e){var t=e.style.rotation;t<=90&&0<=t?e.style.hAlign="Left":(90<t&&t<=180||(t=180),e.style.hAlign="Right"),e.style.rotation=t},cK.prototype.processHeaderContent=function(e,t,i,n){var o=t.rows,r=t.columns,s=[];if(0<i)for(var a=0;a!==i;)this.columns.push({index:a+1,width:30}),a++;for(var l,h=0;h<r.length;h++)this.parseStyles(e,r[parseInt(h.toString(),10)],this.getRecordThemeStyle(this.theme),i+h+1);for(var d=0;d<o.length;d++){for(var p=1+i,c=[],u=0;u<o[parseInt(d.toString(),10)].cells.length;u++){var g={},m={},f=o[parseInt(d.toString(),10)].cells[parseInt(u.toString(),10)];if(!f.isSpanned&&f.cellType!==LA.HeaderIndent&&f.cellType!==LA.DetailHeader){for(var y={contains:!0,index:1};y.contains;)if(p=(y=this.getIndex(s,1,p)).index,!y.contains){m.index=y.index+e.childGridLevel;break}if(!je(f.rowSpan)&&1!==f.rowSpan){m.rowSpan=f.rowSpan;for(var v=1;v<f.rowSpan+1;v++){var b={rowIndex:0,columnIndex:0,colSpan:0};b.rowIndex=v,b.columnIndex=p,b.colSpan=f.colSpan||1,s.push(b)}}je(f.colSpan)||1===f.colSpan||(m.colSpan=f.colSpan,p=p+m.colSpan-1),m.value=f.column.headerText,g=this.getHeaderThemeStyle(this.theme),je(f.column.textAlign)||(g.hAlign=f.column.textAlign.toLowerCase()),je(f.column.headerTextAlign)||(g.hAlign=f.column.headerTextAlign.toLowerCase());g={cell:m,gridCell:f,style:g};if(e.trigger(Kx,g),f.cellType===LA.Header&&1<m.colSpan){for(var p=p+m.colSpan-1,w=1;w<m.colSpan;w++){var C=u+w;C<o[parseInt(d.toString(),10)].cells.length&&(o[parseInt(d.toString(),10)].cells[parseInt(C.toString(),10)].isSpanned=!0)}for(v=0;v<s.length;v++)s[parseInt(v.toString(),10)].columnIndex===m.index&&(s[parseInt(v.toString(),10)].colSpan=m.colSpan)}g.style.rotation&&this.headerRotation(g),je(g.image)||je(g.image.base64)||(l=this.setImage(g,p)),je(g.hyperLink)||(g.cell.hyperlink={target:g.hyperLink.target},m.value=g.hyperLink.displayText||m.value),m.style=g.style,c.push(m),p++}}var S={index:this.rowLength++,cells:c};je(l)||(S.height=l),n.push(S)}return n},cK.prototype.getHeaderThemeStyle=function(e){var t={fontSize:12,borders:{color:"#E0E0E0"},bold:!0};return t=je(e)||je(e.header)?t:this.updateThemeStyle(e.header,t)},cK.prototype.updateThemeStyle=function(e,t){return Pe(t,e)},cK.prototype.getCaptionThemeStyle=function(e){var t={fontSize:13,backColor:"#F6F6F6"};return t=je(e)||je(e.caption)?t:this.updateThemeStyle(e.caption,t)},cK.prototype.getRecordThemeStyle=function(e){var t={fontSize:13,borders:{color:"#E0E0E0"}};return t=je(e)||je(e.record)?t:this.updateThemeStyle(e.record,t)},cK.prototype.processExcelHeader=function(e){if(!je(e.rows)&&("NewSheet"===this.expType||1===this.rowLength)){var t=void 0;void 0===e.headerRows?this.rowLength=e.rows.length:this.rowLength=e.headerRows,t=this.rowLength<e.rows.length?this.rowLength:e.rows.length,this.rowLength++;for(var i=0;i<t;i++){var n=e.rows[parseInt(i.toString(),10)];null!==n.index&&!je(n.index)||(n.index=i+1),this.updatedCellIndex(n)}}},cK.prototype.updatedCellIndex=function(e){for(var t=e.cells.length,i=0;i<t;i++){var n=e.cells[parseInt(i.toString(),10)];null!==n.index&&!je(n.index)||(n.index=i+1)}this.rows.push(e)},cK.prototype.processExcelFooter=function(e){if(!je(e.rows)){var t=void 0;void 0===e.footerRows?this.rowLength+=e.rows.length:t=e.footerRows>e.rows.length?(this.rowLength+=e.footerRows-e.rows.length,e.rows.length):e.footerRows;for(var i=0;i<t;i++){var n=e.rows[parseInt(i.toString(),10)];null===n.index||void 0===n.index?n.index=this.rowLength++:n.index+=this.rowLength,this.updatedCellIndex(n)}}},cK.prototype.getIndex=function(e,t,i){for(var n=0,o=e;n<o.length;n++){var r=o[n];if(r.rowIndex===t&&r.columnIndex===i)return{contains:!0,index:i+=r.colSpan||1}}return{contains:!1,index:i}},cK.prototype.parseStyles=function(e,t,i,n){var o;je(t.format)||("object"==typeof t.format?(o=t.format,i.numberFormat=je(o.format)?o.skeleton:o.format,je(o.type)||(i.type="dateonly"===o.type?"date":o.type.toLowerCase())):(i.numberFormat=t.format,i.type="dateonly"===t.type?"date":t.type)),je(t.textAlign)||(i.hAlign=t.textAlign.toLowerCase()),0<Object.keys(i).length&&(i.name=e.element.id+"column"+n,this.styles.push(i)),e.childGridLevel||(je(t.width)||"auto"===t.width?this.columns.push({index:n+e.childGridLevel,width:null}):this.columns.push({index:n+e.childGridLevel,width:"number"==typeof t.width?t.width:this.helper.getConvertedWidth(t.width)}))},cK.prototype.destroy=function(){};var pK=cK;function cK(e,t){this.book={},this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.rowLength=1,this.expType="AppendToSheet",this.includeHiddenColumn=!1,this.isCsvExport=!1,this.isChild=!1,this.isElementIdChanged=!1,this.gridPool={},this.sheet={},this.grpFooterTemplates=[],this.footerTemplates=[],this.aggIndex=0,this.totalAggregates=0,this.parent=e,this.helper=new aK(e),this.locator=t,this.l10n=this.locator.getService("localization")}gK.prototype.getModuleName=function(){return"PdfExport"},gK.prototype.init=function(e){this.exportValueFormatter=new hK(e.locale),this.pdfDocument=void 0,this.hideColumnInclude=!1,this.currentViewData=!1,this.parent=e,this.isGrouping=!1,this.isExporting=!0,e.id=$P("main-grid"),this.gridPool[e.id]=!1,this.pdfPageSettings=new Ap},gK.prototype.exportWithData=function(e,t,i,n,o,r,s){var a=this;this.init(e),je(t)?this.pdfDocument=new sg:this.pdfDocument=t,this.processExport(e,n,o,r).then(function(){a.isExporting=!1,e.trigger(eI,a.isBlob?{promise:a.blobPromise}:{gridInstance:a.parent}),a.parent.log("exporting_complete",a.getModuleName()),i(a.pdfDocument)}).catch(function(e){s(a.pdfDocument),a.parent.trigger(UA,e)})},gK.prototype.Map=function(n,o,r,s,e){var a,l=this,h=(this.data=new TE(this.parent),this.isBlob=e,this.gridPool={},o&&o.query?o.query:new ya),e=(!n.childGrid&&!n.detailTemplate||!je(o)&&"None"===o.hierarchyExportMode||(n.expandedRows=OB(n).expandedRows),{requestType:"beforePdfExport",cancel:!1,headerPageNumbers:[],gridDrawPosition:{xPosition:0,yPosition:0},generateQuery:!1});return(e.gridObject=n).trigger($x,e),!0===e.cancel?new Promise(function(e,t){return e()}):(BP(o)&&FP(o,n),e.generateQuery&&(h=aK.getQuery(n,this.data)),this.headerOnPages=e.headerPageNumbers,this.drawPosition=e.gridDrawPosition,this.parent.log("exporting_begin",this.getModuleName()),je(o)||je(o.dataSource)?je(o)||"CurrentPage"!==o.exportType||this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()?(a=[],e=aK.getQuery(n,this.data),this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()&&((o=je(o)?{hierarchyExportMode:"All"}:o).hierarchyExportMode="None"===o.hierarchyExportMode?"None":"All","All"===o.hierarchyExportMode)&&(e.lazyLoad=[]),a.push(this.data.getData({},e)),a.push(this.helper.getColumnData(n)),new Promise(function(t,i){Promise.all(a).then(function(e){l.init(n),je(s)?l.pdfDocument=new sg:l.pdfDocument=s.document,l.processExport(n,e[0],o,r,s).then(function(e){l.isExporting=!1,n.trigger(eI,l.isBlob?{promise:l.blobPromise}:{gridInstance:l.parent}),l.parent.log("exporting_complete",l.getModuleName()),o&&o.multipleExport&&"AppendToPage"===o.multipleExport.type?t(e):t(l.pdfDocument)}).catch(function(e){i(l.pdfDocument),l.parent.trigger(UA,e)})})})):new Promise(function(e,t){l.exportWithData(n,s,e,l.parent.getCurrentViewRecords(),o,r,t)}):(o.dataSource=o.dataSource instanceof me?o.dataSource:new me(o.dataSource),(je(h.isCountRequired)||n.aggregates)&&(h.isCountRequired=!0),new Promise(function(t,i){o.dataSource.executeQuery(h).then(function(e){l.exportWithData(n,s,t,e,o,r,i)})})))},gK.prototype.processExport=function(n,i,o,r,s){var a,l=this,e=s&&o&&o.multipleExport&&"AppendToPage"===o.multipleExport.type?null:this.pdfDocument.sections.add(),h=(this.processSectionExportProperties(e,o),s&&o&&o.multipleExport&&"AppendToPage"===o.multipleExport.type?s.result.page:e.pages.add());return new Promise(function(e,t){a=l.processGridExport(n,i,o),l.globalResolve=e,l.gridPool[n.id]=!0,l.helper.checkAndExport(l.gridPool,l.globalResolve)}).then(function(){var e,t,i=l.drawPosition.xPosition;return s&&o&&o.multipleExport&&"AppendToPage"===o.multipleExport.type?(e=s.result.bounds.y+s.result.bounds.height,o.multipleExport.blankSpace&&(e=s.result.bounds.y+s.result.bounds.height+o.multipleExport.blankSpace)):e=l.drawPosition.yPosition,t=r?((t=new Qf).layout=Xc.Paginate,t.break=Kc.FitPage,t.paginateBounds=new id(0,0,h.getClientSize().width,h.getClientSize().height),a.draw(h,i,e,t)):a.draw(h,i,e),l.drawHeader(o),r||(l.isBlob?l.blobPromise=l.pdfDocument.save():!je(o)&&o.fileName?l.pdfDocument.save(o.fileName):l.pdfDocument.save("Export.pdf"),l.pdfDocument.destroy(),delete n.expandedRows),o&&o.multipleExport&&"AppendToPage"===o.multipleExport.type?{document:l.pdfDocument,result:t}:l.pdfDocument})},gK.prototype.processSectionExportProperties=function(e,t){return je(e)||je(t)||je(t.pageOrientation)&&je(t.pageSize)||(this.pdfPageSettings.orientation="Landscape"===t.pageOrientation?up.Landscape:up.Portrait,this.pdfPageSettings.size=this.getPageSize(t.pageSize),e.setPageSettings(this.pdfPageSettings)),e},gK.prototype.processGridExport=function(e,t,i){var n=!0,o=(je(i)||(this.gridTheme=i.theme,n=!!je(i.allowHorizontalOverflow)||i.allowHorizontalOverflow),new aK(e,this.helper.getForeignKeyData())),r=this.processExportProperties(i,t.result),s=(s=BP(i)?QP(i.columns,e.enableColumnVirtualization):o.getGridExportColumns(e.columns)).filter(function(e){return je(e.commands)}),a=!1,l=(e.groupSettings.columns.length&&(a=!0),!e.childGrid&&!e.detailTemplate||je(i)||(e.hierarchyPrintMode=i.hierarchyExportMode||"Expanded"),new Lf),h=this.getHeaderThemeStyle(),d=h.border,p=h.font,h=h.brush,c=o.getHeaders(s,this.hideColumnInclude),u=c.columns,l=this.processGridHeaders(e.groupSettings.columns.length,l,c.rows,u,d,p,h,e,n,s),c=(this.setColumnProperties(u,l,o,e,n),this.getSummaryCaptionThemeStyle());return!je(r)&&r.length?(a?(je(c.border)||(d=c.border),this.processGroupedRecords(l,r,u,e,d,0,c.font,c.brush,c.backgroundBrush,t,i,o,0)):this.processRecord(d,u,e,r,l,0,i,o,0),je(t.aggregates)||(p=void 0,s=(s=(h=new SD(e)).getColumns()).filter(function(e){return je(e.commands)&&"checkbox"!==e.type}),e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo(),p=this.customDataSource?h.generateRows(r,t.aggregates,null,null,s):this.currentViewData?h.generateRows(this.parent.getCurrentViewRecords(),t.aggregates):a?h.generateRows(r.records,t.aggregates):h.generateRows(t.result,t.aggregates,null,null,s),this.processAggregates(p,l,d,c.font,c.brush,c.backgroundBrush,!1,null,null,null,!a))):l.rows.addRow().style.setBorder(d),l},gK.prototype.getSummaryCaptionThemeStyle=function(){var e,t,i,n,o;return je(this.gridTheme)||je(this.gridTheme.caption)?{font:new cg(dd.Helvetica,9.75),brush:new Sd(new se(0,0,0)),backgroundBrush:new Sd(new se(246,246,246))}:(e=je(this.gridTheme.caption.fontSize)?9.75:this.gridTheme.caption.fontSize,o=je(this.gridTheme.caption.fontName)?dd.Helvetica:this.getFontFamily(this.gridTheme.caption.fontName),t=this.getFontStyle(this.gridTheme.caption),i=new se(0,0,0),je(this.gridTheme.caption.fontColor)||(n=this.hexToRgb(this.gridTheme.caption.fontColor),i=new se(n.r,n.g,n.b)),n=this.gridTheme.caption.border?this.getBorderStyle(this.gridTheme.caption.border):null,o=new cg(o,e,t),{font:o=je(this.gridTheme.caption.font)?o:this.gridTheme.caption.font,brush:new Sd(i),backgroundBrush:new Sd(new se(246,246,246)),border:n})},gK.prototype.getGridPdfFont=function(e){var t,i,n,o="fontFamily",r="fontSize",s="fontStyle",a="isTrueType",l=0;e.header&&e.header.font&&(t=e.header.font[o],i=e.header.font[r],n=e.header.font[s],l=je(hd[""+n])?0:hd[""+n],e.header.font[a]?e.header.font=new Uy(t,i,l):(n=je(t)?dd.Helvetica:this.getFontFamily(t),e.header.font=new cg(n,i,l))),e.caption&&e.caption.font&&(t=e.caption.font[o],n=e.caption.font[r],i=e.caption.font[s],l=je(hd[""+i])?0:hd[""+i],e.caption.font[a]?e.caption.font=new Uy(t,n,l):(i=je(t)?dd.Helvetica:this.getFontFamily(t),e.caption.font=new cg(i,n,l))),e.record&&e.record.font&&(t=e.record.font[o],i=e.record.font[r],n=e.record.font[s],l=je(hd[""+n])?0:hd[""+n],e.record.font[a]?e.record.font=new Uy(t,i,l):(o=je(t)?dd.Helvetica:this.getFontFamily(t),e.record.font=new cg(o,i,l)))},gK.prototype.getHeaderThemeStyle=function(){var e,t,i,n,o=new Og;return je(this.gridTheme)||je(this.gridTheme.header)?(o.all=new Ep(new se(234,234,234)),{border:o,font:new cg(dd.Helvetica,10.5),brush:new Sd(new se(102,102,102))}):(o=je(this.gridTheme.header.fontName)?dd.Helvetica:this.getFontFamily(this.gridTheme.header.fontName),e=this.getFontStyle(this.gridTheme.header),t=je(this.gridTheme.header.fontSize)?10.5:this.gridTheme.header.fontSize,i=new se,je(this.gridTheme.header.fontColor)||(n=this.hexToRgb(this.gridTheme.header.fontColor),i=new se(n.r,n.g,n.b)),n=new cg(o,t,e),je(this.gridTheme.header.font)||(n=this.gridTheme.header.font),{border:this.getBorderStyle(this.gridTheme.header.border),font:n,brush:new Sd(i)})},gK.prototype.processGroupedRecords=function(o,r,s,a,l,e,h,d,p,c,u,g,m){for(var f=this,y=e,v=this,t=0,i=r;t<i.length;t++)!function(t){var i=o.rows.addRow(),e=a.getColumnByField(t.field),n={value:t.key,column:e,style:void 0,isForeignKey:e.isForeignColumn()},e=a.getColumnByField(t.field).headerText+": "+(e.enableGroupByFormat?t.key:v.exportValueFormatter.formatCellValue(n))+" - "+t.count+(1<r.count?" items":" item");v.parent.trigger(W1,{captionText:e,type:"PDF",data:t,style:void 0},function(e){i.cells.getCell(y).value=e.captionText,i.cells.getCell(y).style.stringFormat=new xd(Hh.Left),i.style.setBorder(l),i.style.setFont(h),i.style.setTextBrush(d),i.style.setBackgroundBrush(p),je(e.style)||f.processCellStyle(i.cells.getCell(y),e);var e=new DD(a);e=je(t.items.records)?e.generateRows(t.items,t):e.generateRows(t.items.records,t),je(e)||0!==e.length||(i.cells.getCell(y+1).columnSpan=o.columns.count-(y+1)),!je(r.childLevels)&&0<r.childLevels?(f.processAggregates(e,o,l,h,d,p,!0,i,y,null,null,a),f.processGroupedRecords(o,t.items,s,a,l,y+1,h,d,p,c,u,g,m),m=f.rowIndex,e=new ID(a).generateRows(t.items.records,t),f.processAggregates(e,o,l,h,d,p,!1)):(f.processAggregates(e,o,l,h,d,p,!0,i,y,null,null,a),m=f.processRecord(l,s,a,t.items,o,y+1,u,g,m),e=new ID(a).generateRows(t.items,t),f.processAggregates(e,o,l,h,d,p,!1,null,null,!0,null,a))})}(i[t])},gK.prototype.processGridHeaders=function(e,a,l,t,h,d,p,c,i,n){for(var u=this,t=t.length+e,e=_B(n),g=0,m=[],o=0;o<l.length;o++)m[parseInt(o.toString(),10)]=0;c.groupSettings.columns.length&&(g=c.groupSettings.columns.length-1,t-=1),a.columns.add(t),a.style.cellPadding=new Vg(5.76,5.76,.5,.5),a.headers.add(l.length);var f=function(e,t,i,n,o){var r=a.headers.getHeader(e),s=r.cells.getCell(t),t=l[parseInt(e.toString(),10)].cells[c.groupSettings.columns.length?t:m[parseInt(e.toString(),10)]],e=(m[parseInt(e.toString(),10)]=m[parseInt(e.toString(),10)]+1,je(i.headerTextAlign)||(s.style.stringFormat=u.getHorizontalAlignment(i.headerTextAlign)),0<n&&(s.rowSpan=n,s.style.stringFormat=u.getVerticalAlignment("Bottom",s.style.stringFormat,i.textAlign)),0<o&&(s.columnSpan=o),r.style.setBorder(h),r.style.setFont(d),r.style.setTextBrush(p),s.value=i.headerText,je(t)||t.cellType!==LA.HeaderIndent&&t.cellType!==LA.DetailHeader||(s.value="",s.width=20),{cell:s,gridCell:t,style:s.style}),n=(u.parent.trigger(iI,e),e),o=e.style.borders,i=e.style.font,t=e.style.textBrush;je(o)||r.style.setBorder(o),je(i)||r.style.setFont(i),je(t)||r.style.setTextBrush(t),je(n.style.verticalAlignment)||(s.style.stringFormat=u.getVerticalAlignment(n.style.verticalAlignment,s.style.stringFormat)),je(n.image)||(s.value=new oc(n.image.base64)),je(n.hyperLink)||(s.value=u.setHyperLink(n))},y=function(e,t,i,n,o,r){for(var s,a=0,l=0;l<e.length;l++)r&&(n=a=a+i+(0===l?0:-1),i=0),r||e[parseInt(l.toString(),10)].visible||(n-=1),e[parseInt(l.toString(),10)].columns&&e[parseInt(l.toString(),10)].columns.length?(s=y(e[parseInt(l.toString(),10)].columns,t-1,0,l+n,o+1,!1),f(o,l+n+g,e[parseInt(l.toString(),10)],0,s),i+=s,n=n+s-1):(e[parseInt(l.toString(),10)].visible||u.hideColumnInclude)&&(i++,f(o,l+n+g,e[parseInt(l.toString(),10)],t,0));return i};return y(n,e,0,0,0,!0),6<=a.columns.count&&i&&(a.style.allowHorizontalOverflow=!0),a},gK.prototype.processExportProperties=function(e,t){var i,n,o;return je(e)?(this.currentViewData=!1,this.customDataSource=!1):(je(e.theme)||(this.gridTheme=e.theme),n=this.pdfPageSettings.size,this.drawHeader(e),je(e.footer)||(i=e.footer,o=new ed(0,n.width-80-.75*i.fromBottom),n=new td(n.width-80,.75*i.height),o=new id(o,n),this.pdfDocument.template.bottom=this.drawPageTemplate(new Gy(o),i)),je(e.includeHiddenColumn)||this.isGrouping||(this.hideColumnInclude=e.includeHiddenColumn),je(e.dataSource)?(!je(e.exportType)&&"CurrentPage"===e.exportType?(t=this.parent.groupSettings&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()?t:this.parent.currentViewData,this.currentViewData=!0):this.currentViewData=!1,this.customDataSource=!1):(this.customDataSource=!0,this.currentViewData=!1)),t},gK.prototype.drawHeader=function(e){var t,i,n=this,o=this.pdfPageSettings.size;je(e)||je(e.header)||(e=e.header,t=new ed(0,e.fromTop),o=new td(o.width-80,.75*e.height),t=new id(t,o),this.headerOnPages.length?(i=this.drawPageTemplate(new Gy(t),e),this.headerOnPages.filter(function(e){0<=e-1&&e-1<=n.pdfDocument.pages.count-1&&n.pdfDocument.pages.getPageByIndex(e-1).graphics.drawPdfTemplate(i.template,new ed(0,0))})):this.pdfDocument.template.top=this.drawPageTemplate(new Gy(t),e))},gK.prototype.drawPageTemplate=function(e,t){for(var i=0,n=t.contents;i<n.length;i++){var o=n[i];switch(this.processContentValidation(o),o.type){case"Text":if(""===o.value||void 0===o.value||null===o.value||"string"!=typeof o.value)throw new Error("please enter the valid input value in text content...");this.drawText(e,o);break;case"PageNumber":this.drawPageNumber(e,o);break;case"Image":if(void 0===o.src||null===o.src||""===o.src)throw new Error("please enter the valid base64 string in image content...");this.drawImage(e,o);break;case"Line":this.drawLine(e,o);break;default:throw new Error("Please set valid content type...")}}return e},gK.prototype.processContentValidation=function(e){if(void 0===e.type||null===e.type)throw new Error("please set valid content type...");if("Line"===e.type){if(void 0===e.points||null===e.points)throw new Error("please enter valid points in "+e.type+" content...");if(void 0===e.points.x1||null===e.points.x1||"number"!=typeof e.points.x1)throw new Error("please enter valid x1 co-ordinate in "+e.type+" points...");if(void 0===e.points.y1||null===e.points.y1||"number"!=typeof e.points.y1)throw new Error("please enter valid y1 co-ordinate in "+e.type+" points...");if(void 0===e.points.x2||null===e.points.x2||"number"!=typeof e.points.x2)throw new Error("please enter valid x2 co-ordinate in "+e.type+" points...");if(void 0===e.points.y2||null===e.points.y2||"number"!=typeof e.points.y2)throw new Error("please enter valid y2 co-ordinate in "+e.type+" points...")}else{if(void 0===e.position||null===e.position)throw new Error("please enter valid position in "+e.type+" content...");if(void 0===e.position.x||null===e.position.x||"number"!=typeof e.position.x)throw new Error("please enter valid x co-ordinate in "+e.type+" position...");if(void 0===e.position.y||null===e.position.y||"number"!=typeof e.position.y)throw new Error("please enter valid y co-ordinate in "+e.type+" position...")}},gK.prototype.drawText=function(e,t){var i=this.getFont(t),n=this.getBrushFromContent(t),o=null,r=(je(t.style.textPenColor)||(r=this.hexToRgb(t.style.textPenColor),o=new Ep(new se(r.r,r.g,r.b))),null==n&&null==o&&(n=new Sd(new se(0,0,0))),t.value.toString()),s=.75*t.position.x,a=.75*t.position.y,l=new xd,t=(je(t.style.stringFormat)||(l.alignment=t.style.stringFormat.alignment),this.setContentFormat(t,l));null===t||je(t.format)||je(t.size)?e.graphics.drawString(r,i,o,n,s,a,l):e.graphics.drawString(r,i,o,n,s,a,t.size.width,t.size.height,t.format)},gK.prototype.drawPageNumber=function(e,t){var i,n,o,r=this.getFont(t),s=null,a=(s=je(t.style.textBrushColor)?new Sd(new se(0,0,0)):(a=this.hexToRgb(t.style.textBrushColor),new Sd(new se(a.r,a.g,a.b))),new vm(r,s)),a=(a.numberStyle=this.getPageNumberStyle(t.pageNumberType),o=je(t.format)?new Sm(r,s,n="{0}",a):(o="$current",-1!==t.format.indexOf(l="$total")&&-1!==t.format.indexOf(o)?((i=new km(r)).numberStyle=this.getPageNumberStyle(t.pageNumberType),n=t.format.indexOf(l)>t.format.indexOf(o)?(n=t.format.replace(o,"0")).replace(l,"1"):(n=t.format.replace(o,"1")).replace(l,"0"),new Sm(r,s,n,a,i)):-1!==t.format.indexOf(o)&&-1===t.format.indexOf(l)?(n=t.format.replace(o,"0"),new Sm(r,s,n,a)):(i=new km(r),n=t.format.replace(l,"0"),new Sm(r,s,n,i))),.75*t.position.x),l=.75*t.position.y,r=this.setContentFormat(t,o.stringFormat);null===r||je(r.format)||je(r.size)||(o.stringFormat=r.format,o.bounds=new id(a,l,r.size.width,r.size.height)),o.draw(e.graphics,a,l)},gK.prototype.drawImage=function(e,t){var i=.75*t.position.x,n=.75*t.position.y,o=je(t.size)?void 0:.75*t.size.width,r=je(t.size)?void 0:.75*t.size.height,t=new oc(t.src);je(o)?e.graphics.drawImage(t,i,n):e.graphics.drawImage(t,i,n,o,r)},gK.prototype.drawLine=function(e,t){var i=.75*t.points.x1,n=.75*t.points.y1,o=.75*t.points.x2,r=.75*t.points.y2,s=this.getPenFromContent(t);je(t.style)||null===t.style||(je(t.style.penSize)||null===t.style.penSize||"number"!=typeof t.style.penSize||(s.width=.75*t.style.penSize),s.dashStyle=this.getDashStyle(t.style.dashStyle)),e.graphics.drawLine(s,i,n,o,r)},gK.prototype.processAggregates=function(e,t,i,n,o,r,s,a,l,h,d,p){for(var c=0,u=e;c<u.length;c++){var g=u[c],m=-1,f=0,y=!0,v=[],b=d?0:1,w=void 0;je(a)&&((w=t.rows.addRow()).style.setBorder(i),w.style.setFont(n),w.style.setTextBrush(o),w.style.setBackgroundBrush(r));for(var C=0;C<t.columns.count+b;C++){var S,A,x,I,T,E,D=g.cells[parseInt(f.toString(),10)];if(D.cellType===LA.DetailFooterIntent)C--,f++;else{if(!this.hideColumnInclude){for(;void 0===D.visible;)D.cellType!==LA.DetailFooterIntent&&(je(a)||je(a.cells.getCell(C).value)?v.push(""):(v.push(a.cells.getCell(C).value),y=!1,s||(C+=1)),C+=1,f+=1,D=g.cells[parseInt(f.toString(),10)]);for(;!je(D.visible)&&!D.visible;)f+=1,D=g.cells[parseInt(f.toString(),10)]}D.isDataCell?(T={},S=!je(D.column.footerTemplate),A=!je(D.column.groupFooterTemplate),I=!je(D.column.groupCaptionTemplate),S||I||A?(T=(E=this.getTemplateFunction(T,C,m,D)).templateFunction,m=E.leastCaptionSummaryIndex,I=void 0,x=g.data[D.column.field||D.column.columnName],I=(this.parent.isReact||this.parent.isVue||this.parent.isVue3||this.parent.isAngular)&&"string"!=typeof D.column.footerTemplate&&"string"!=typeof D.column.groupFooterTemplate&&"string"!=typeof D.column.groupCaptionTemplate?je(I=x[D.column.type])?"":I:(I=T[M(LA,D.cellType)](x,this.parent),this.parent.isVue3&&!je(I[1])?I[1].textContent:je(I[0])?"":I[0].textContent),y=!1,T={row:g,type:S?"Footer":A?"GroupFooter":"GroupCaption",style:(je(a)?w:a).cells,cell:D,value:I},this.parent.trigger(vT,T),v.push(T.value)):je(E=this.getSummaryWithoutTemplate(g.data[D.column.field]))||v.push(E)):v.push(""),y&&""!==v[parseInt(C.toString(),10)]&&!je(v[parseInt(C.toString(),10)])&&null!==v[parseInt(C.toString(),10)]&&(y=!1),f+=1}}if(!d)if(s)for(C=p.groupSettings.columns.length;C<v.length-1;C++)v[parseInt(C.toString(),10)]=v[C+1],v[C+1]=v[C+2]||"";else v.splice(0,1);if(!y)if(s)for(C=0;C<t.columns.count;C++)a.cells.getCell(C).value=v[parseInt(C.toString(),10)].toString(),C===l&&-1!==m&&1!==m?a.cells.getCell(C).columnSpan=m-1-l:C===l&&-1===m&&(a.cells.getCell(C).columnSpan=t.columns.count-l);else for(var C=0;C<t.columns.count;C++)w.cells.getCell(C).value=v[parseInt(C.toString(),10)].toString()}},gK.prototype.getTemplateFunction=function(e,t,i,n){return je(n.column.footerTemplate)||n.cellType!==LA.Summary?je(n.column.groupCaptionTemplate)?e[M(LA,LA.GroupSummary)]=oo(n.column.groupFooterTemplate):(-1===i&&(i=t),e[M(LA,LA.CaptionSummary)]=oo(n.column.groupCaptionTemplate)):e[M(LA,LA.Summary)]=oo(n.column.footerTemplate),{templateFunction:e,leastCaptionSummaryIndex:i}},gK.prototype.getSummaryWithoutTemplate=function(e){if(je(e.Sum)){if(je(e.Average)){if(je(e.Max)){if(je(e.Min)){if(je(e.Count)){if(je(e.TrueCount)){if(je(e.FalseCount))return je(e.Custom)?void 0:e.Custom;return e.FalseCount}return e.TrueCount}return e.Count}return e.Min}return e.Max}return e.Average}return e.Sum},gK.prototype.setColumnProperties=function(e,t,i,n,o){for(var r=n.groupSettings.columns.length?n.groupSettings.columns.length-1:0,s=0;s<r;s++)t.columns.getColumn(s).width=20;for(s=0;s<e.length;s++)je(e[parseInt(s.toString(),10)].textAlign)||(t.columns.getColumn(s+r).format=this.getHorizontalAlignment(e[parseInt(s.toString(),10)].textAlign)),t.style.allowHorizontalOverflow&&!je(e[parseInt(s.toString(),10)].width)&&o&&(t.columns.getColumn(s+r).width="number"==typeof e[parseInt(s.toString(),10)].width?.75*e[parseInt(s.toString(),10)].width:.75*i.getConvertedWidth(e[parseInt(s.toString(),10)].width))},gK.prototype.setRecordThemeStyle=function(e,t){je(this.gridTheme)||je(this.gridTheme.record)?e.style.setTextBrush(new Sd(new se(0,0,0))):(o=je(this.gridTheme.record.fontName)?dd.Helvetica:this.getFontFamily(this.gridTheme.record.fontName),n=je(this.gridTheme.record.fontSize)?9.75:this.gridTheme.record.fontSize,i=this.getFontStyle(this.gridTheme.record),o=new cg(o,n,i),je(this.gridTheme.record.font)||(o=this.gridTheme.record.font),e.style.setFont(o),n=new se,je(this.gridTheme.record.fontColor)||(i=this.hexToRgb(this.gridTheme.record.fontColor),n=new se(i.r,i.g,i.b)),e.style.setTextBrush(new Sd(n)));var i,n,o=this.gridTheme&&this.gridTheme.record&&this.gridTheme.record.border?this.getBorderStyle(this.gridTheme.record.border):t;return e.style.setBorder(o),e},gK.prototype.processRecord=function(e,t,i,n,o,r,s,a,l){for(var h=0,d=a.getGridRowModel(t,n,i,l);h<d.length;h++){for(var p,c,u,g,m=d[h],f=(l++,this.rowIndex=l,this.setRecordThemeStyle(o.rows.addRow(),e)),y=m.cells.length,v=0;v<y;v++){var b=m.cells[parseInt(v.toString(),10)];if(b.cellType===LA.Data){var w,C,S,b=b.column,A=b.field,A=je(A)?"":b.valueAccessor(A,m.data,b),A=je(A)?"":A;if(b.isForeignColumn&&b.isForeignColumn()&&(w=a.getFData(A,b),A=R(b.foreignKeyValue,w)),(S={data:m.data,value:A,column:b,style:void 0,colSpan:1,cell:C=f.cells.getCell(v)}).value="boolean"===S.column.type&&"string"==typeof S.value?S.value:this.exportValueFormatter.formatCellValue(S),this.parent.trigger(tI,S),je(S.image)||(S.value=new oc(S.image.base64),S.value.height=S.image.height||S.value.height,S.value.width=S.image.width||S.value.width),C.value=S.value,je(S.hyperLink)||(C.value=this.setHyperLink(S)),je(S.style)||this.processCellStyle(C,S),1<S.colSpan){v+1+S.colSpan>f.cells.count&&(S.colSpan=f.cells.count-(v+1)),C.columnSpan=S.colSpan;for(var x=1;x<C.columnSpan;x++)f.cells.getCell(v+x).value="";v+=S.colSpan-1}}}m.isExpand&&(p=this.setRecordThemeStyle(o.rows.addRow(),e),u=this.parent.childGrid||this.parent.detailTemplate?0:r,(C=p.cells.getCell(u)).columnSpan=p.cells.count-u,C.style.cellPadding=new Vg(10,10,10,10),this.parent.childGrid?(i.isPrinting=!0,u=!je(s)&&s.exportType?s.exportType:"AllPages",c=(u=this.helper.createChildGrid(i,m,u,this.gridPool)).childGrid,u=u.element,c.actionFailure=a.failureHandler(this.gridPool,c,this.globalResolve),g=Pe(s,{columns:null,dataSource:null,query:null}),this.parent.trigger(Jx,S={childGrid:c,row:m,cell:C,exportProperties:g}),c.beforeDataBound=this.childGridCell(C,c,g),c.appendTo(u)):this.parent.detailTemplate&&(this.parent.trigger(Zx,S={parentRow:m,row:p,value:{},action:"pdfexport",gridInstance:i}),C.value=this.processDetailTemplate(S))),this.parent.notify(DI,{type:"pdf",rowObj:m})}return l},gK.prototype.processDetailTemplate=function(e){var s=this;if(e.value.columnHeader||e.value.rows){var t=new Lf,i=this.getHeaderThemeStyle(),a=i.border,l=i.font,h=i.brush,n=function(e,t,i){i&&(t.style.setBorder(a),t.style.setFont(l),t.style.setTextBrush(h));for(var n=0;n<e.cells.length;n++){var o=e.cells[parseInt(n.toString(),10)],r=t.cells.getCell(o.index||n);0<o.rowSpan&&(r.rowSpan=o.rowSpan),0<o.colSpan&&(r.columnSpan=o.colSpan),r.value=o.value,je(o.image)||(r.value=new oc(o.image.base64),r.value.height=o.image.height,r.value.width=o.image.width),je(o.hyperLink)||(r.value=s.setHyperLink(o)),je(o.style)||(o={style:{backgroundColor:o.style.backColor,textAlignment:o.style.pdfTextAlignment,verticalAlignment:o.style.pdfVerticalAlignment,textBrushColor:o.style.fontColor,textPenColor:o.style.pdfTextPenColor,fontFamily:o.style.pdfFontFamily,fontSize:o.style.fontSize,bold:o.style.bold,italic:o.style.italic,underline:o.style.underline,strikeout:o.style.strikeThrough,border:o.style.pdfBorder,paragraphIndent:o.style.pdfParagraphIndent,cellPadding:o.style.pdfCellPadding}},s.processCellStyle(r,o))}};if(e.value.columnCount?t.columns.add(e.value.columnCount):e.value.columnHeader&&e.value.columnHeader.length?t.columns.add(e.value.columnHeader[0].cells.length):e.value.rows&&e.value.rows.length&&t.columns.add(e.value.rows[0].cells.length),e.value.columnHeader){t.headers.add(e.value.columnHeader.length);for(var o=0;o<e.value.columnHeader.length;o++){var r=t.headers.getHeader(parseInt(o.toString(),10));n(e.value.columnHeader[parseInt(o.toString(),10)],r,!0)}}if(e.value.rows)for(var d=0,p=e.value.rows;d<p.length;d++)n(p[d],this.setRecordThemeStyle(t.rows.addRow(),a),!1);return t}return e.value.image?new oc(e.value.image.base64):e.value.text||(e.value.hyperLink?this.setHyperLink(e.value):"")},gK.prototype.setHyperLink=function(e){var t=new am;return t.url=e.hyperLink.target,t.text=e.hyperLink.displayText||e.hyperLink.target,t.font=new cg(dd.Helvetica,9.75),t.brush=new Sd(new se(51,102,187)),t},gK.prototype.childGridCell=function(t,i,n){var o=this;return function(e){return i.beforeDataBound=null,e.cancel=!0,t.value=o.processGridExport(i,e,n),i.destroy(),G(i.element),o.gridPool[i.id]=!0,o.helper.checkAndExport(o.gridPool,o.globalResolve),t}},gK.prototype.processCellStyle=function(e,t){var i,n,o,r;je(t.style.backgroundColor)||(i=this.hexToRgb(t.style.backgroundColor),e.style.backgroundBrush=new Sd(new se(i.r,i.g,i.b))),je(t.style.textAlignment)||(e.style.stringFormat=this.getHorizontalAlignment(t.style.textAlignment)),je(t.style.cellPadding)||(e.style.cellPadding=t.style.cellPadding),je(t.style.verticalAlignment)||(e.style.stringFormat=this.getVerticalAlignment(t.style.verticalAlignment,e.style.stringFormat)),je(t.style.textBrushColor)||(i=this.hexToRgb(t.style.textBrushColor),e.style.textBrush=new Sd(new se(i.r,i.g,i.b))),je(t.style.textPenColor)||(i=this.hexToRgb(t.style.textPenColor),e.style.textPen=new Ep(new se(i.r,i.g,i.b))),je(t.style.fontFamily)&&je(t.style.fontSize)&&je(t.style.bold)&&je(t.style.italic)&&je(t.style.underline)&&je(t.style.strikeout)||(e.style.font=this.getFont(t)),je(t.style.border)||(i=new Og,n=je(n=t.style.border.width)||"number"!=typeof n?void 0:.75*n,o=new se(196,196,196),je(t.style.border.color)||(r=this.hexToRgb(t.style.border.color),o=new se(r.r,r.g,r.b)),r=new Ep(o,n),je(t.style.border.dashStyle)||(r.dashStyle=this.getDashStyle(t.style.border.dashStyle)),i.all=r,e.style.borders=i),je(t.style.paragraphIndent)||(e.style.stringFormat=new xd,e.style.stringFormat.paragraphIndent=t.style.paragraphIndent)},gK.prototype.getHorizontalAlignment=function(e,t){switch(void 0===t&&(t=new xd),e){case"Right":t.alignment=Hh.Right;break;case"Center":t.alignment=Hh.Center;break;case"Justify":t.alignment=Hh.Justify;break;case"Left":t.alignment=Hh.Left}return t},gK.prototype.getVerticalAlignment=function(e,t,i){switch(void 0===t&&(t=new xd,t=this.getHorizontalAlignment(i,t)),e){case"Bottom":t.lineAlignment=_h.Bottom;break;case"Middle":t.lineAlignment=_h.Middle;break;case"Top":t.lineAlignment=_h.Top}return t},gK.prototype.getFontFamily=function(e){switch(e){case"TimesRoman":return 2;case"Courier":return 1;case"Symbol":return 3;case"ZapfDingbats":return 4;default:return 0}},gK.prototype.getFont=function(e){var t,i,n;return e.font||(t=je(e.style.fontSize)?9.75:.75*e.style.fontSize,i=je(e.style.fontFamily)?dd.TimesRoman:this.getFontFamily(e.style.fontFamily),n=hd.Regular,!je(e.style.bold)&&e.style.bold&&(n|=hd.Bold),!je(e.style.italic)&&e.style.italic&&(n|=hd.Italic),!je(e.style.underline)&&e.style.underline&&(n|=hd.Underline),!je(e.style.strikeout)&&e.style.strikeout&&(n|=hd.Strikeout),new cg(i,t,n))},gK.prototype.getPageNumberStyle=function(e){switch(e){case"LowerLatin":return 2;case"LowerRoman":return 3;case"UpperLatin":return 4;case"UpperRoman":return 5;default:return 1}},gK.prototype.setContentFormat=function(e,t){if(je(e.size))return null;var i=.75*e.size.width,n=.75*e.size.height;if(t=new xd(Hh.Left,_h.Middle),!je(e.style.hAlign))switch(e.style.hAlign){case"Right":t.alignment=Hh.Right;break;case"Center":t.alignment=Hh.Center;break;case"Justify":t.alignment=Hh.Justify;break;default:t.alignment=Hh.Left}return{format:t=je(e.style.vAlign)?t:this.getVerticalAlignment(e.style.vAlign,t),size:new td(i,n)}},gK.prototype.getPageSize=function(e){switch(e){case"Letter":return new td(612,792);case"Note":return new td(540,720);case"Legal":return new td(612,1008);case"A0":return new td(2380,3368);case"A1":return new td(1684,2380);case"A2":return new td(1190,1684);case"A3":return new td(842,1190);case"A5":return new td(421,595);case"A6":return new td(297,421);case"A7":return new td(210,297);case"A8":return new td(148,210);case"A9":return new td(105,148);case"B0":return new td(2836,4008);case"B1":return new td(2004,2836);case"B2":return new td(1418,2004);case"B3":return new td(1002,1418);case"B4":return new td(709,1002);case"B5":return new td(501,709);case"Archa":return new td(648,864);case"Archb":return new td(864,1296);case"Archc":return new td(1296,1728);case"Archd":return new td(1728,2592);case"Arche":return new td(2592,3456);case"Flsa":return new td(612,936);case"HalfLetter":return new td(396,612);case"Letter11x17":return new td(792,1224);case"Ledger":return new td(1224,792);default:return new td(595,842)}},gK.prototype.getDashStyle=function(e){switch(e){case"Dash":return 1;case"Dot":return 2;case"DashDot":return 3;case"DashDotDot":return 4;default:return 0}},gK.prototype.getPenFromContent=function(e){var t=new Ep(new se(0,0,0));return je(e.style)||null===e.style||je(e.style.penColor)||(e=this.hexToRgb(e.style.penColor),t=new Ep(new se(e.r,e.g,e.b))),t},gK.prototype.getBrushFromContent=function(e){var t=null;return je(e.style.textBrushColor)||(e=this.hexToRgb(e.style.textBrushColor),t=new Sd(new se(e.r,e.g,e.b))),t},gK.prototype.hexToRgb=function(e){if(null===e||""===e||7!==e.length)throw new Error("please set valid hex value for color...");e=e.substring(1);e=parseInt(e,16);return{r:e>>16&255,g:e>>8&255,b:255&e}},gK.prototype.getFontStyle=function(e){var t=hd.Regular;return!je(e)&&e.bold&&(t|=hd.Bold),!je(e)&&e.italic&&(t|=hd.Italic),!je(e)&&e.underline&&(t|=hd.Underline),!je(e)&&e.strikeout&&(t|=hd.Strikeout),t},gK.prototype.getBorderStyle=function(e){var t,i,n,o=new Og;return je(e)?o.all=new Ep(new se(234,234,234)):(t=je(t=e.width)||"number"!=typeof t?void 0:.75*t,i=new se(196,196,196),je(e.color)||(n=this.hexToRgb(e.color),i=new se(n.r,n.g,n.b)),n=new Ep(i,t),je(e.dashStyle)||(n.dashStyle=this.getDashStyle(e.dashStyle)),o.all=n),o},gK.prototype.destroy=function(){};var uK=gK;function gK(e){this.hideColumnInclude=!1,this.currentViewData=!1,this.customDataSource=!1,this.isGrouping=!1,this.headerOnPages=[],this.drawPosition={xPosition:0,yPosition:0},this.parent=e,this.helper=new aK(e),this.gridPool={}}mK=function(e,t){return(mK=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}mK(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(vK,fK=VD),vK.prototype.destroyButtons=function(e){for(var t=0;t<this.childRefs.length;t++)!this.childRefs[parseInt(t.toString(),10)]||this.childRefs[parseInt(t.toString(),10)].isDestroyed||this.parent.editSettings.showAddNewRow&&this.parent.enableVirtualization&&A(this.childRefs[parseInt(t.toString(),10)].element,"e-addedrow")||(this.childRefs[parseInt(t.toString(),10)].destroy(),this.childRefs[parseInt(t.toString(),10)].element&&(this.childRefs[parseInt(t.toString(),10)].element.innerHTML=""));if(this.childRefs=[],"refreshCommandColumn"===e.type){var i=this.parent.element.querySelectorAll(".e-gridcontent .e-unboundcell");if(i.length)for(t=0;t<i.length;t++)!i[parseInt(t.toString(),10)]||this.parent.editSettings.showAddNewRow&&this.parent.enableVirtualization&&A(i[parseInt(t.toString(),10)],"e-addedrow")||(i[parseInt(t.toString(),10)].querySelector(".e-unboundcelldiv")&&(i[parseInt(t.toString(),10)].querySelector(".e-unboundcelldiv").innerHTML=""),i[parseInt(t.toString(),10)].innerHTML="")}else this.parent.off(Cx,this.destroyButtons),this.parent.off(cE,this.destroyButtons)},vK.prototype.render=function(e,t,i,n){var o,r=this.element.cloneNode();if(r.appendChild(this.unbounDiv.cloneNode()),r.setAttribute("aria-label",this.localizer.getConstant("CommandColumnAria")+e.column.headerText),e.column.commandsTemplate)!this.parent.isReact||"string"==typeof e.column.commandsTemplate||e.column.commandsTemplate.prototype&&e.column.commandsTemplate.prototype.CSPTemplate?eB(r.firstElementChild,e.column.getColumnTemplate()(t,this.parent,"commandsTemplate",null,null,null,null,this.parent.root)):(o=this.parent+"commandsTemplate",e.column.getColumnTemplate()(t,this.parent,"commandsTemplate",o,null,null,r.firstElementChild),this.parent.renderTemplates());else for(var s=0,a=e.commands;s<a.length;s++)var l=a[s],r=this.renderButton(r,l,i.index,l.uid);return this.setAttributes(r,e,i),!this.parent.enableVirtualization&&this.parent.isEdit&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&!this.parent.element.querySelector(".e-editedrow"))||n?(U([].slice.call(r.getElementsByClassName("e-edit-delete")),"e-hide"),q([].slice.call(r.getElementsByClassName("e-save-cancel")),"e-hide")):(U([].slice.call(r.getElementsByClassName("e-save-cancel")),"e-hide"),q([].slice.call(r.getElementsByClassName("e-edit-delete")),"e-hide")),this.parent.isFrozenGrid()&&uF(this.parent,e.column,r),r},vK.prototype.renderButton=function(e,t,i,n){var o=this.buttonElement.cloneNode(),i=(pt(o,{id:this.parent.element.id+(t.type||"")+"_"+i+"_"+n,type:"button",title:je(t.title)?t.buttonOption.content||this.localizer.getConstant(t.type)||t.type:t.title,"data-uid":n}),o.onclick=t.buttonOption.click,t.buttonOption.cssClass=this.parent.cssClass?t.buttonOption.cssClass+" "+this.parent.cssClass:t.buttonOption.cssClass,new zv(t.buttonOption,o));switch(this.childRefs.push(i),i.commandType=t.type,e.firstElementChild.appendChild(i.element),t.type){case"Edit":case"Delete":U([o],["e-edit-delete","e-"+t.type.toLowerCase()+"button"]);break;case"Cancel":case"Save":U([o],["e-save-cancel","e-"+t.type.toLowerCase()+"button"])}return e};var mK,fK,yK=vK;function vK(e,t){e=fK.call(this,e,t)||this;return e.buttonElement=e.parent.createElement("button",{}),e.unbounDiv=e.parent.createElement("div",{className:"e-unboundcelldiv"}),e.childRefs=[],e.element=e.parent.createElement("TD",{className:"e-rowcell e-unboundcell",attrs:{tabindex:"-1",role:"gridcell"}}),e.parent.on(Cx,e.destroyButtons,e),e.parent.on(cE,e.destroyButtons,e),e}wK.prototype.initiateRender=function(){this.locator.getService("cellRendererFactory").addCellRenderer(LA.CommandColumn,new yK(this.parent,this.locator))},wK.prototype.commandClickHandler=function(e){var t=this.parent,i=z(e.target,"button");if(i&&z(e.target,".e-unboundcell")){for(var n,o=i.ej2_instances[0],r=o.commandType,s=i.getAttribute("data-uid"),e=t.getRowObjectFromUID(z(i,"."+UE).getAttribute("data-uid")),a=this.parent.columnModel,l=0;l<a.length;l++)if(a[parseInt(l.toString(),10)].commands)for(var h=a[parseInt(l.toString(),10)].commands,d=0;d<h.length;d++){var p;h[parseInt(d.toString(),10)].uid===s&&h[parseInt(d.toString(),10)].type===r?n=h[parseInt(d.toString(),10)]:(p=[].slice.call(z(i,".e-unboundcell").querySelectorAll("button")).findIndex(function(e){return e===i}))<h.length&&h[parseInt(p.toString(),10)].type===r&&String(h[parseInt(d.toString(),10)].uid)===s&&(n=h[parseInt(p.toString(),10)])}e={cancel:!1,target:i,commandColumn:n,rowData:je(e)?void 0:e.data};this.parent.trigger(j1,e,function(e){if(!o.disabled&&t.editModule&&!e.cancel)switch(r){case"Edit":t.editModule.endEdit(),t.editModule.startEdit(z(i,"tr"));break;case"Cancel":t.isFocusFirstCell=!0,t.editModule.closeEdit();break;case"Save":t.isFocusFirstCell=!0,t.editModule.endEdit();break;case"Delete":"Batch"!==t.editSettings.mode&&t.editModule.endEdit(),t.commandDelIndex=parseInt(z(i,"tr").getAttribute(nD),10)-1,t.clearSelection(),t.selectRow(t.commandDelIndex,!1),t.isFocusFirstCell=!0,t.editModule.deleteRecord(),t.editSettings.showDeleteConfirmDialog&&!t.allowSelection||(t.commandDelIndex=void 0)}})}},wK.prototype.getModuleName=function(){return"commandColumn"},wK.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},wK.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(wx,this.commandClickHandler),this.parent.off(bx,this.keyPressHandler),this.parent.off(G1,this.load),this.parent.off(Cx,this.destroy))},wK.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(wx,this.commandClickHandler,this),this.parent.on(bx,this.keyPressHandler,this),this.parent.on(G1,this.load,this),this.parent.on(Cx,this.destroy,this))},wK.prototype.keyPressHandler=function(e){"enter"!==e.action&&"space"!==e.action||!z(e.target,".e-unboundcelldiv")||(this.commandClickHandler(e),e.preventDefault())},wK.prototype.load=function(){for(var e=this.parent.columnModel,t=0;t<e.length;t++)if(e[parseInt(t.toString(),10)].commands)for(var i=e[parseInt(t.toString(),10)].commands,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].uid=$P("gridcommand")};var bK=wK;function wK(e,t){this.parent=e,this.locator=t,this.initiateRender(),this.addEventListener()}var CK={header:"."+RE,content:"."+OE,edit:".e-inline-edit",batchEdit:".e-editedbatchcell",editIcon:"e-edit",pager:".e-gridpager",delete:"e-delete",save:"e-save",cancel:"e-cancel",copy:"e-copy",pdf:"e-pdfexport",group:"e-icon-group",ungroup:"e-icon-ungroup",csv:"e-csvexport",excel:"e-excelexport",fPage:"e-icon-first",nPage:"e-icon-next",lPage:"e-icon-last",pPage:"e-icon-prev",ascending:"e-icon-ascending",descending:"e-icon-descending",groupHeader:"e-groupdroparea",touchPop:"e-gridpopup",autofit:"e-icon-autofit",autofitall:"e-icon-autofitall"},SK=(AK.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(K1,this.enableAfterRenderMenu,this),this.parent.on(q1,this.render,this),this.parent.on(Cx,this.destroy,this))},AK.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(q1,this.render),this.parent.off(K1,this.enableAfterRenderMenu),this.parent.off(Cx,this.destroy),E.remove(this.element,"keydown",this.keyDownHandler.bind(this)))},AK.prototype.keyDownHandler=function(e){"Tab"!==e.code&&9!==e.which||this.contextMenu.close(),"Escape"===e.code&&(this.contextMenu.close(),this.parent.notify(qI,{}))},AK.prototype.render=function(){this.parent.element.classList.add("e-noselect"),this.l10n=this.serviceLocator.getService("localization"),this.element=this.parent.createElement("ul",{id:this.gridID+"_cmenu"}),E.add(this.element,"keydown",this.keyDownHandler.bind(this)),this.parent.element.appendChild(this.element);var e="#"+this.gridID;this.contextMenu=new D4({items:this.getMenuItems(),enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,target:e,select:this.contextMenuItemClick.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this),onOpen:this.contextMenuOpen.bind(this),onClose:this.contextMenuOnClose.bind(this),cssClass:this.parent.cssClass?"e-grid-menu "+this.parent.cssClass:"e-grid-menu"}),this.contextMenu.appendTo(this.element)},AK.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.contextMenu&&(this.contextMenu.destroy(),ue(this.element),this.parent.element.classList.remove("e-noselect")),this.render())},AK.prototype.getMenuItems=function(){for(var e,t=[],i=[],n=0,o=this.parent.contextMenuItems;n<o.length;n++){var r=o[n];"string"==typeof r&&-1!==this.getDefaultItems().indexOf(r)?(-1!==r.toLocaleLowerCase().indexOf("export")?i:t).push(this.buildDefaultItems(r)):"string"!=typeof r&&t.push(r)}return 0<i.length&&((e=this.buildDefaultItems("export")).items=i,t.push(e)),t},AK.prototype.getLastPage=function(){var e=Math.floor(this.parent.pageSettings.totalRecordsCount/this.parent.pageSettings.pageSize);return this.parent.pageSettings.totalRecordsCount%this.parent.pageSettings.pageSize&&(e+=1),e},AK.prototype.contextMenuOpen=function(){this.isOpen=!0},AK.prototype.contextMenuItemClick=function(e){switch(this.getKeyFromId(e.item.id)){case"AutoFitAll":this.parent.autoFitColumns([]);break;case"AutoFit":this.parent.autoFitColumns(this.targetColumn.field);break;case"Group":this.parent.groupColumn(this.targetColumn.field);break;case"Ungroup":this.parent.ungroupColumn(this.targetColumn.field);break;case"Edit":this.parent.editModule&&("Batch"===this.parent.editSettings.mode?this.row&&this.cell&&!isNaN(parseInt(this.cell.getAttribute(iD),10)-1)&&this.parent.editModule.editCell(parseInt(this.row.getAttribute(nD),10)-1,this.parent.getColumns()[parseInt(this.cell.getAttribute(iD),10)-1].field):(this.parent.editModule.endEdit(),this.parent.editModule.startEdit(this.row)));break;case"Delete":this.parent.editModule&&("Batch"!==this.parent.editSettings.mode&&this.parent.editModule.endEdit(),1===this.parent.getSelectedRecords().length?(this.parent.isCheckBoxSelection||(this.parent.isFocusFirstCell=!0),this.parent.editModule.deleteRow(this.row)):this.parent.deleteRecord());break;case"Save":this.parent.editModule&&(this.parent.isEdit&&"Batch"!==this.parent.editSettings.mode&&(this.parent.isFocusFirstCell=!0),this.parent.editModule.endEdit());break;case"Cancel":this.parent.editModule&&(this.parent.isEdit&&(this.parent.isFocusFirstCell=!0),this.parent.editModule.closeEdit());break;case"Copy":this.parent.copy();break;case"PdfExport":this.parent.pdfExport();break;case"ExcelExport":this.parent.excelExport();break;case"CsvExport":this.parent.csvExport();break;case"SortAscending":this.isOpen=!1,this.parent.sortColumn(this.targetColumn.field,"Ascending");break;case"SortDescending":this.isOpen=!1,this.parent.sortColumn(this.targetColumn.field,"Descending");break;case"FirstPage":this.parent.goToPage(1);break;case"PrevPage":this.parent.goToPage(this.parent.pageSettings.currentPage-1);break;case"LastPage":this.parent.goToPage(this.getLastPage());break;case"NextPage":this.parent.goToPage(this.parent.pageSettings.currentPage+1)}e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger(nI,e)},AK.prototype.contextMenuOnClose=function(e){0<e.items.length&&e.items[0].parentObj instanceof D4&&this.updateItemStatus(),this.parent.notify(XT,{isOpen:!1})},AK.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[""+e])},AK.prototype.updateItemStatus=function(){this.contextMenu.showItems(this.hiddenItems),this.contextMenu.enableItems(this.disableItems),this.hiddenItems=[],this.disableItems=[],this.isOpen=!1},AK.prototype.contextMenuBeforeOpen=function(e){var t=z(e.event.target,".e-grid");if(e.event&&t&&t!==this.parent.element)e.cancel=!0;else if(e.event&&(z(e.event.target,"."+CK.groupHeader)||z(e.event.target,"."+CK.touchPop)||z(e.event.target,".e-summarycell")||z(e.event.target,".e-groupcaption")||z(e.event.target,".e-filterbarcell"))||this.parent.editSettings.showAddNewRow&&z(e.event.target,".e-addedrow")&&this.parent.element.querySelector(".e-editedrow"))e.cancel=!0;else{this.targetColumn=this.getColumn(e.event),A(e.event.target,"e-grid")&&(this.targetRowdata=this.parent.getRowInfo(e.event.target)),je(e.parentItem)&&this.targetColumn&&this.targetRowdata.cell&&(this.parent.notify(XT,{isOpen:!0}),this.selectRow(e.event,!this.targetRowdata.cell.classList.contains("e-selectionbackground")||"Multiple"!==this.parent.selectionSettings.type));for(var i=[],n=[],o=0,r=e.items;o<r.length;o++){var s=r[o],a=this.getKeyFromId(s.id),l=this.defaultItems[""+a];-1!==this.getDefaultItems().indexOf(a)?(this.ensureDisabledStatus(a)&&this.disableItems.push(s.text),e.event&&(this.ensureTarget(e.event.target,CK.edit)||this.ensureTarget(e.event.target,CK.batchEdit))?"Save"!==a&&"Cancel"!==a&&this.hiddenItems.push(s.text):this.parent.editModule&&"Batch"===this.parent.editSettings.mode&&(z(e.event.target,".e-gridform")||this.parent.editModule.getBatchChanges()[KE].length||this.parent.editModule.getBatchChanges()[JE].length||this.parent.editModule.getBatchChanges()[ZE].length)&&("Save"===a||"Cancel"===a)||je(e.parentItem)&&e.event&&!this.ensureTarget(e.event.target,l.target)&&this.hiddenItems.push(s.text)):s.target&&e.event&&!this.ensureTarget(e.event.target,s.target)?s.separator?i.push(s.id):this.hiddenItems.push(s.text):this.ensureTarget(e.event.target,s.target)&&s.separator&&n.push(s.id)}0<n.length&&this.contextMenu.showItems(n,!0),this.contextMenu.enableItems(this.disableItems,!1),this.contextMenu.hideItems(this.hiddenItems),0<i.length&&this.contextMenu.hideItems(i,!0),this.eventArgs=e.event,e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger(rI,e),(e.cancel||this.hiddenItems.length===e.items.length&&!e.parentItem)&&(this.updateItemStatus(),e.cancel=!0)}WB(this.parent.element,this.contextMenu.element.parentElement)},AK.prototype.ensureTarget=function(e,t){var i=e;return(i=!this.ensureFrozenHeader(e)||t!==CK.header&&t!==CK.content?t===CK.content||t===CK.header?A(z(e,"."+QE),t.substr(1,t.length)):z(e,t):z(e,t===CK.header?"thead":oD))&&A(i,"e-grid")===this.parent.element},AK.prototype.ensureFrozenHeader=function(e){return!(!this.parent.frozenRows||!z(e,CK.header))},AK.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"AutoFitAll":case"AutoFit":t=!(this.parent.ensureModuleInjected(jG)&&!this.parent.isEdit)||this.targetColumn&&!this.targetColumn.field&&"AutoFit"===e;break;case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(YG)&&this.targetColumn&&0<=this.parent.groupSettings.columns.indexOf(this.targetColumn.field)||this.targetColumn&&!this.targetColumn.field)&&(t=!0);break;case"Ungroup":this.parent.allowGrouping&&this.parent.ensureModuleInjected(YG)&&!(this.parent.ensureModuleInjected(YG)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)<0)||(t=!0);break;case"Edit":case"Delete":case"Save":case"Cancel":this.parent.editModule&&0!==this.parent.getDataRows().length||(t=!0);break;case"Copy":(0===this.parent.getSelectedRowIndexes().length&&0===this.parent.getSelectedRowCellIndexes().length||0===this.parent.getCurrentViewRecords().length)&&(t=!0);break;case"export":this.parent.allowExcelExport&&this.parent.ensureModuleInjected(pK)||this.parent.allowPdfExport&&this.parent.ensureModuleInjected(uK)||(t=!0);break;case"PdfExport":this.parent.allowPdfExport&&this.parent.ensureModuleInjected(uK)||(t=!0);break;case"ExcelExport":case"CsvExport":this.parent.allowExcelExport&&this.parent.ensureModuleInjected(pK)||(t=!0);break;case"SortAscending":case"SortDescending":if(!this.parent.allowSorting||!this.parent.ensureModuleInjected(eG)||this.targetColumn&&!this.targetColumn.field)t=!0;else if(this.parent.ensureModuleInjected(eG)&&0<this.parent.sortSettings.columns.length&&this.targetColumn)for(var i=this.parent.sortSettings.columns,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].field===this.targetColumn.field&&i[parseInt(n.toString(),10)].direction.toLowerCase()===e.toLowerCase().replace("sort","").toLocaleLowerCase()&&(t=!0);break;case"FirstPage":case"PrevPage":this.parent.allowPaging&&this.parent.ensureModuleInjected(gG)&&0!==this.parent.getCurrentViewRecords().length&&(!this.parent.ensureModuleInjected(gG)||1!==this.parent.pageSettings.currentPage)||(t=!0);break;case"LastPage":case"NextPage":this.parent.allowPaging&&this.parent.ensureModuleInjected(gG)&&0!==this.parent.getCurrentViewRecords().length&&(!this.parent.ensureModuleInjected(gG)||this.parent.pageSettings.currentPage!==this.getLastPage())||(t=!0)}return t},AK.prototype.getContextMenu=function(){return this.element},AK.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+RE)||e.querySelector("."+OE))&&(this.contextMenu&&(this.contextMenu.select=null,this.contextMenu.beforeOpen=null,this.contextMenu.onOpen=null,this.contextMenu.onClose=null),this.removeEventListener(),this.contextMenu.destroy(),this.element.parentNode&&ue(this.element),this.parent.element.classList.remove("e-noselect"))},AK.prototype.getModuleName=function(){return"contextMenu"},AK.prototype.generateID=function(e){return this.gridID+"_cmenu_"+e},AK.prototype.getKeyFromId=function(e){return e.replace(this.gridID+"_cmenu_","")},AK.prototype.buildDefaultItems=function(e){var t;switch(e){case"AutoFitAll":t={target:CK.header,iconCss:CK.autofitall};break;case"AutoFit":t={target:CK.header,iconCss:CK.autofit};break;case"Group":t={target:CK.header,iconCss:CK.group};break;case"Ungroup":t={target:CK.header,iconCss:CK.ungroup};break;case"Edit":t={target:CK.content,iconCss:CK.editIcon};break;case"Delete":t={target:CK.content,iconCss:CK.delete};break;case"Save":t={target:CK.edit,iconCss:CK.save};break;case"Cancel":t={target:CK.edit,iconCss:CK.cancel};break;case"Copy":t={target:CK.content,iconCss:CK.copy};break;case"export":t={target:CK.content};break;case"PdfExport":t={target:CK.content,iconCss:CK.pdf};break;case"ExcelExport":t={target:CK.content,iconCss:CK.excel};break;case"CsvExport":t={target:CK.content,iconCss:CK.csv};break;case"SortAscending":t={target:CK.header,iconCss:CK.ascending};break;case"SortDescending":t={target:CK.header,iconCss:CK.descending};break;case"FirstPage":t={target:CK.pager,iconCss:CK.fPage};break;case"PrevPage":t={target:CK.pager,iconCss:CK.pPage};break;case"LastPage":t={target:CK.pager,iconCss:CK.lPage};break;case"NextPage":t={target:CK.pager,iconCss:CK.nPage}}return this.defaultItems[""+e]={text:this.getLocaleText(e),id:this.generateID(e),target:t.target,iconCss:t.iconCss?"e-icons "+t.iconCss:""},this.defaultItems[""+e]},AK.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","Group","Ungroup","Edit","Delete","Save","Cancel","Copy","export","PdfExport","ExcelExport","CsvExport","SortAscending","SortDescending","FirstPage","PrevPage","LastPage","NextPage"]},AK.prototype.setLocaleKey=function(){return{AutoFitAll:"autoFitAll",AutoFit:"autoFit",Copy:"Copy",Group:"Group",Ungroup:"Ungroup",Edit:"EditRecord",Delete:"DeleteRecord",Save:"Save",Cancel:"CancelButton",PdfExport:"Pdfexport",ExcelExport:"Excelexport",CsvExport:"Csvexport",export:"Export",SortAscending:"SortAscending",SortDescending:"SortDescending",FirstPage:"FirstPage",LastPage:"LastPage",PrevPage:"PreviousPage",NextPage:"NextPage"}},AK.prototype.getColumn=function(e){var t=z(e.target,"th.e-headercell");return t?(t=t.querySelector(".e-headercelldiv, .e-stackedheadercelldiv").getAttribute("e-mappinguid"),this.parent.getColumnByUid(t)):this.parent.getRowInfo(e.target).column||null},AK.prototype.selectRow=function(e,t){this.cell=e.target,this.row=z(e.target,"tr.e-row")||this.row,this.row&&t&&!A(e.target,"e-gridpager")&&this.parent.selectRow(parseInt(this.row.getAttribute(nD),10)-1)},AK);function AK(e,t){this.defaultItems={},this.disableItems=[],this.hiddenItems=[],this.localeText=this.setLocaleKey(),this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}IK.prototype.getModuleName=function(){return"freeze"},IK.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(q1,this.instantiateRenderer,this),this.parent.on(Cx,this.destroy,this))},IK.prototype.instantiateRenderer=function(){this.parent.log("limitation",this.getModuleName())},IK.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(q1,this.instantiateRenderer),this.parent.off(Cx,this.destroy))},IK.prototype.destroy=function(){this.removeEventListener()};var xK=IK;function IK(e,t){this.parent=e,this.locator=t,this.addEventListener()}EK.prototype.wireEvents=function(){if(!this.parent.enableAdaptiveUI)for(var e=this.getColumnMenuHandlers(),t=0;t<e.length;t++)E.add(e[parseInt(t.toString(),10)],"mousedown",this.columnMenuHandlerDown,this)},EK.prototype.unwireEvents=function(){if(!this.parent.enableAdaptiveUI)for(var e=this.getColumnMenuHandlers(),t=0;t<e.length;t++)E.remove(e[parseInt(t.toString(),10)],"mousedown",this.columnMenuHandlerDown)},EK.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,NA.isColMenu)},EK.prototype.destroy=function(){var e=this.parent.element;(e.querySelector("."+OE)||e.querySelector("."+RE))&&e&&(this.columnMenu&&this.columnMenu.destroy(),this.removeEventListener(),this.unwireFilterEvents(),this.unwireEvents(),!this.parent.enableAdaptiveUI)&&this.element.parentNode&&ue(this.element)},EK.prototype.columnMenuHandlerClick=function(e){var t;e.target.classList.contains("e-columnmenu")&&(this.parent.enableAdaptiveUI?(this.headerCell=this.getHeaderCell(e),t=this.getColumn(),this.responsiveDialogRenderer.isCustomDialog=!0,this.parent.notify(vE,{action:4}),this.parent.notify(lI,{col:t,target:e.target,isClose:null,id:null}),this.responsiveDialogRenderer.showResponsiveDialog(null,t)):(this.columnMenu.items=this.getItems(),this.columnMenu.dataBind(),this.isOpen&&this.headerCell!==this.getHeaderCell(e)||document.querySelector(".e-grid-menu .e-menu-parent.e-ul")?(this.columnMenu.close(),this.openColumnMenu(e)):this.isOpen?this.columnMenu.close():this.openColumnMenu(e)))},EK.prototype.openColumnMenuByField=function(e){this.openColumnMenu({target:this.parent.getColumnHeaderByField(e).querySelector(".e-columnmenu")})},EK.prototype.afterFilterColumnMenuClose=function(){this.columnMenu&&(this.columnMenu.items=this.getItems(),this.columnMenu.dataBind(),this.columnMenu.close())},EK.prototype.openColumnMenu=function(e){var t=this.parent.getContent().getClientRects()[0],i=this.parent.getHeaderContent(),n=i.getBoundingClientRect(),o={top:0,left:0},r=(this.element.style.cssText="display:block;visibility:hidden",this.element.getBoundingClientRect()),s=this.parent.element.getBoundingClientRect();this.element.style.cssText="display:none;visibility:visible",this.headerCell=this.getHeaderCell(e),this.parent.enableRtl?o=this.parent.enableStickyHeader?O0(this.headerCell,"left","bottom",!0):O0(this.headerCell,"left","bottom"):((o=this.parent.enableStickyHeader?O0(this.headerCell,"right","bottom",!0):O0(this.headerCell,"right","bottom")).left-=r.width,i.classList.contains("e-sticky")?(o.top=this.parent.element.offsetTop+n.top+n.height,n.top+n.height>t.top&&(o.top+=n.top+n.height-t.top)):this.parent.enableStickyHeader&&(o.top=this.parent.element.offsetTop+i.offsetTop+n.height),o.left+r.width+1>=s.right&&(o.left-=35)),this.columnMenu.open(o.top,o.left),e.preventDefault&&e.preventDefault(),WB(this.parent.element,this.columnMenu.element.parentElement)},EK.prototype.columnMenuHandlerDown=function(){this.isOpen=!("none"===this.element.style.display||""===this.element.style.display)},EK.prototype.getColumnMenuHandlers=function(){return[].slice.call(this.parent.getHeaderTable().getElementsByClassName(this.ROOT))},EK.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(tx,this.wireEvents,this),this.parent.on(K1,this.enableAfterRenderMenu,this),this.parent.on(G1,this.render,this),this.isFilterItemAdded()&&this.parent.on(hI,this.filterPosition,this),this.parent.on(WT,this.setFullScreenDialog,this),this.parent.on(vE,this.renderResponsiveChangeAction,this),this.parent.on(wx,this.columnMenuHandlerClick,this),this.parent.on(dE,this.afterFilterColumnMenuClose,this),this.parent.on(bx,this.keyPressHandler,this),this.parent.on(Cx,this.destroy,this))},EK.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(tx,this.unwireEvents),this.parent.off(K1,this.enableAfterRenderMenu),this.parent.off(G1,this.render),this.isFilterItemAdded()&&this.parent.off(hI,this.filterPosition),this.parent.off(WT,this.setFullScreenDialog),this.parent.off(vE,this.renderResponsiveChangeAction),this.parent.off(wx,this.columnMenuHandlerClick),this.parent.on(dE,this.afterFilterColumnMenuClose),this.parent.off(bx,this.keyPressHandler),this.parent.off(Cx,this.destroy))},EK.prototype.keyPressHandler=function(e){var t=this.parent;"altDownArrow"!==e.action||this.parent.enableAdaptiveUI||(e=t.focusModule.currentInfo.element)&&e.classList.contains("e-headercell")&&(t=t.getColumnByUid(e.firstElementChild.getAttribute("e-mappinguid")),this.openColumnMenuByField(t.field))},EK.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.columnMenu&&(this.columnMenu.destroy(),ue(this.element)),this.parent.enableAdaptiveUI||this.render())},EK.prototype.render=function(){this.parent.enableAdaptiveUI||(this.l10n=this.serviceLocator.getService("localization"),this.element=this.parent.createElement("ul",{id:this.gridID+"_columnmenu",className:"e-colmenu"}),this.element.setAttribute("aria-label",this.l10n.getConstant("ColumnMenuDialogARIA")),this.parent.element.appendChild(this.element),this.columnMenu=new D4({cssClass:this.parent.cssClass?"e-grid-menu e-grid-column-menu "+this.parent.cssClass:"e-grid-menu e-grid-column-menu",enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,items:this.getItems(),select:this.columnMenuItemClick.bind(this),beforeOpen:this.columnMenuBeforeOpen.bind(this),onOpen:this.columnMenuOnOpen.bind(this),onClose:this.columnMenuOnClose.bind(this),beforeItemRender:this.beforeMenuItemRender.bind(this),beforeClose:this.columnMenuBeforeClose.bind(this)}),this.element&&A(this.element,"e-popup")&&this.element.classList.add(this.COL_POP),this.columnMenu.appendTo(this.element),this.wireFilterEvents())},EK.prototype.wireFilterEvents=function(){!F.isDevice&&this.isFilterItemAdded()&&E.add(this.element,"mouseover",this.appendFilter,this)},EK.prototype.unwireFilterEvents=function(){F.isDevice||!this.isFilterItemAdded()||this.parent.enableAdaptiveUI||E.remove(this.element,"mouseover",this.appendFilter)},EK.prototype.beforeMenuItemRender=function(e){var t,i,n;this.isChooserItem(e.item)?(i=this.getKeyFromId(e.item.id,this.CHOOSER),n=this.parent.columnModel.filter(function(e){return e.field===i}),n=kv(this.parent.createElement,!1,{label:e.item.text,checked:n[0].visible}),this.parent.enableRtl&&n.classList.add("e-rtl"),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?(t=n.classList).add.apply(t,this.parent.cssClass.split(" ")):n.classList.add(this.parent.cssClass)),e.element.innerHTML="",e.element.appendChild(n)):e.item.id&&"Filter"===this.getKeyFromId(e.item.id)&&(e.element.appendChild(this.parent.createElement("span",{className:"e-icons e-caret"})),e.element.className+="e-filter-item e-menu-caret-icon")},EK.prototype.columnMenuBeforeClose=function(e){var t;e.event&&e.event.target instanceof Document&&"scroll"===e.event.type?this.parent.enableStickyHeader||(e.cancel=!0):(t=e.event?z(e.event.target,".e-menu-item"):null,!je(e.parentItem)&&"ColumnChooser"===this.getKeyFromId(e.parentItem.id)&&t&&this.isChooserItem(t)?e.cancel=!e.event||"Escape"!==e.event.code:e.event&&(z(e.event.target,"."+this.POP)||e.event.currentTarget&&e.event.currentTarget.activeElement&&A(e.event.currentTarget.activeElement,"e-filter-popup")||A(e.event.target,"e-popup")&&A(e.event.target,"e-colmenu-popup")||A(e.event.target,"e-multiselect-flmenu")||A(e.event.target,"e-popup-wrapper"))&&!F.isDevice||e.event&&e.event.target&&e.event.target.classList.contains("e-filter-item")&&"Enter"===e.event.key?e.cancel=!0:this.parent.isColumnMenuFilterClosing&&(this.parent.isColumnMenuFilterClosing=!1,e.cancel=!0))},EK.prototype.isChooserItem=function(e){return e.id&&0<=e.id.indexOf("_colmenu_")&&-1===this.getKeyFromId(e.id,this.CHOOSER).indexOf("_colmenu_")},EK.prototype.columnMenuBeforeOpen=function(e){e.column=this.targetColumn=this.getColumn(),this.parent.trigger(aI,e);for(var t=0,i=e.items;t<i.length;t++){var n=i[t],o=this.getKeyFromId(n.id),r=this.defaultItems[""+o];-1!==this.getDefaultItems().indexOf(o)&&this.ensureDisabledStatus(o)&&!r.hide&&this.disableItems.push(n.text),n.hide&&this.hiddenItems.push(n.text)}this.columnMenu.enableItems(this.disableItems,!1),this.columnMenu.hideItems(this.hiddenItems)},EK.prototype.columnMenuOnOpen=function(e){"e-menu-parent e-ul "===e.element.className&&(e.element.offsetHeight>window.innerHeight||this.parent.element.offsetHeight>window.innerHeight)&&(e.element.style.maxHeight=.8*window.innerHeight+"px",e.element.style.overflowY="auto",this.parent.enableStickyHeader)&&(e.element.style.position="fixed")},EK.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(YG)&&this.targetColumn&&0<=this.parent.groupSettings.columns.indexOf(this.targetColumn.field)||this.targetColumn&&!this.targetColumn.allowGrouping)&&(t=!0);break;case"AutoFitAll":case"AutoFit":t=!this.parent.ensureModuleInjected(jG);break;case"Ungroup":(!this.parent.ensureModuleInjected(YG)||this.parent.ensureModuleInjected(YG)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)<0)&&(t=!0);break;case"SortDescending":case"SortAscending":if(this.parent.allowSorting&&this.parent.ensureModuleInjected(eG)&&0<this.parent.sortSettings.columns.length&&this.targetColumn&&this.targetColumn.allowSorting)for(var i=this.parent.sortSettings.columns,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].field===this.targetColumn.field&&i[parseInt(n.toString(),10)].direction.toLocaleLowerCase()===e.toLocaleLowerCase().replace("sort","")&&(t=!0);else this.parent.allowSorting&&this.parent.ensureModuleInjected(eG)&&(!this.parent.allowSorting||!this.targetColumn||this.targetColumn.allowSorting)||(t=!0);break;case"Filter":this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(_G)&&this.targetColumn&&this.targetColumn.allowFiltering?t=!1:this.parent.ensureModuleInjected(_G)&&this.parent.allowFiltering&&this.targetColumn&&(!this.targetColumn.allowFiltering||"FilterBar"===this.parent.filterSettings.type)&&(t=!0)}return t},EK.prototype.columnMenuItemClick=function(e){switch(this.isChooserItem(e.item)?"ColumnChooser":this.getKeyFromId(e.item.id)){case"AutoFit":this.parent.autoFitColumns(this.targetColumn.field);break;case"AutoFitAll":this.parent.autoFitColumns([]);break;case"Ungroup":this.parent.ungroupColumn(this.targetColumn.field);break;case"Group":this.parent.groupColumn(this.targetColumn.field);break;case"SortAscending":this.parent.sortColumn(this.targetColumn.field,"Ascending");break;case"SortDescending":this.parent.sortColumn(this.targetColumn.field,"Descending");break;case"ColumnChooser":var t=this.getKeyFromId(e.item.id,this.CHOOSER),i=e.element.querySelector(".e-checkbox-wrapper .e-frame");i&&i.classList.contains("e-check")?(i.classList.remove("e-check"),this.parent.hideColumns(t,"field")):i&&(this.parent.showColumns(t,"field"),i.classList.add("e-check"));break;case"Filter":this.getFilter(e.element,e.item.id)}e.column=this.targetColumn,this.parent.trigger(sI,e)},EK.prototype.columnMenuOnClose=function(e){0<e.items.length&&e.items[0].parentObj instanceof D4&&(this.columnMenu.enableItems(this.disableItems,!1),this.disableItems=[],this.columnMenu.showItems(this.hiddenItems),this.hiddenItems=[],this.isFilterPopupOpen())&&this.getFilter(e.element,e.element.id,!0),je(e.parentItem)||"ColumnChooser"!==this.getKeyFromId(e.parentItem.id)?this.parent.notify(qI,{}):this.columnMenu.element.querySelector(".e-selected")&&this.columnMenu.element.querySelector(".e-selected").focus()},EK.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","SortAscending","SortDescending","Group","Ungroup","ColumnChooser","Filter"]},EK.prototype.getItems=function(){for(var e=[],t=0,i=this.parent.columnMenuItems||this.getDefault();t<i.length;t++){var n,o=i[t];"string"==typeof o?"ColumnChooser"===o?((n=this.getDefaultItem(o)).items=this.createChooserItems(),e.push(n)):e.push(this.getDefaultItem(o)):e.push(o)}return e},EK.prototype.getDefaultItem=function(e){var t={};switch(e){case"SortAscending":t={iconCss:this.ASCENDING};break;case"SortDescending":t={iconCss:this.DESCENDING};break;case"Group":t={iconCss:this.GROUP};break;case"Ungroup":t={iconCss:this.UNGROUP};break;case"Filter":t={iconCss:this.FILTER};break;case"ColumnChooser":t={iconCss:this.COLUMNCHOOSER};break;case"AutoFit":t={iconCss:this.AUTOFIT};break;case"AutoFitAll":t={iconCss:this.AUTOFITALL}}return this.defaultItems[""+e]={text:this.getLocaleText(e),id:this.generateID(e),iconCss:t.iconCss?"e-icons "+t.iconCss:null},this.defaultItems[""+e]},EK.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[""+e])},EK.prototype.generateID=function(e,t){return this.gridID+"_colmenu_"+(t?t+e:e)},EK.prototype.getKeyFromId=function(e,t){return 0<e.indexOf("_colmenu_")&&e.replace(this.gridID+"_colmenu_"+(t||""),"")},EK.prototype.getColumnMenu=function(){return this.element},EK.prototype.getModuleName=function(){return"columnMenu"},EK.prototype.setLocaleKey=function(){return{AutoFitAll:"autoFitAll",AutoFit:"autoFit",Group:"Group",Ungroup:"Ungroup",SortAscending:"SortAscending",SortDescending:"SortDescending",ColumnChooser:"Columnchooser",Filter:"FilterMenu"}},EK.prototype.getHeaderCell=function(e){return z(e.target,"th.e-headercell")},EK.prototype.getColumn=function(){var e;return this.headerCell?(e=this.headerCell.querySelector(".e-headercelldiv").getAttribute("e-mappinguid"),this.parent.getColumnByUid(e)):null},EK.prototype.createChooserItems=function(){for(var e=[],t=0,i=this.parent.columnModel;t<i.length;t++){var n=i[t];n.showInColumnChooser&&n.field&&e.push({id:this.generateID(n.field,this.CHOOSER),text:n.headerText||n.field})}return e},EK.prototype.appendFilter=function(e){var t;this.defaultItems.Filter&&(t=this.defaultItems.Filter.id,z(e.target,"#"+t)&&!this.isFilterPopupOpen()?this.getFilter(e.target,t):!z(e.target,"#"+t)&&this.isFilterPopupOpen()&&this.getFilter(e.target,t,!0))},EK.prototype.getFilter=function(e,t,i){var n,o=this.getFilterPop();o?(o.style.display=!F.isDevice&&i?"none":"block","none"!==o.style.display&&("Menu"===this.parent.filterSettings.type?o.querySelector(".e-flmenu-input")?o.querySelector(".e-flmenu-input").focus():o.querySelector(".e-flmenu-valuediv")&&!je(n=o.querySelector(".e-flmenu-valuediv").firstElementChild)&&n.focus():"CheckBox"!==this.parent.filterSettings.type&&"Excel"!==this.parent.filterSettings.type||o.querySelector(".e-searchinput")&&o.querySelector(".e-searchinput").focus())):this.parent.notify(lI,{col:this.targetColumn,target:e,isClose:i,id:t})},EK.prototype.setPosition=function(e,t){var i=this.parent.element.getBoundingClientRect(),e=e.getBoundingClientRect(),n=e.left-i.left,o=e.top-i.top;i.height<o?o=o-t.offsetHeight+e.height:i.height<o+t.offsetHeight&&(o=i.height-t.offsetHeight),(o=window.innerHeight<t.offsetHeight+o+i.top?window.innerHeight-t.offsetHeight-i.top:o)+i.top<0&&(o=0),this.parent.enableStickyHeader&&i.top<=0&&(o=e.top-i.top),n+=this.parent.enableRtl?-t.offsetWidth:e.width,i.width<=n+t.offsetWidth?(n-=e.width+t.offsetWidth,e.left<t.offsetWidth&&(n=e.left+t.offsetWidth/2)):n<0&&(n+=t.offsetWidth+e.width),t.style.top=o+"px",t.style.left=n+"px"},EK.prototype.filterPosition=function(){var e,t,i=this.getFilterPop();this.parent.enableAdaptiveUI||(i.classList.add(this.WRAP),!F.isDevice&&(e=i.style.display,i.style.cssText+="display:block;visibility:hidden",t=this.element.querySelector("."+this.FILTER))&&(this.setPosition(t.parentElement,i),i.style.cssText+="display:"+e+";visibility:visible"))},EK.prototype.getDefault=function(){var e=[];return this.parent.ensureModuleInjected(jG)&&(e.push("AutoFitAll"),e.push("AutoFit")),this.parent.allowGrouping&&this.parent.ensureModuleInjected(YG)&&(e.push("Group"),e.push("Ungroup")),this.parent.allowSorting&&this.parent.ensureModuleInjected(eG)&&(e.push("SortAscending"),e.push("SortDescending")),e.push("ColumnChooser"),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(_G)&&e.push("Filter"),e},EK.prototype.isFilterPopupOpen=function(){var e=this.getFilterPop();return e&&"none"!==e.style.display},EK.prototype.getFilterPop=function(){var e,t;return!je(this.targetColumn)&&"Menu"===this.parent.filterSettings.type&&F.isDevice?document.getElementById(this.targetColumn.uid+"-flmdlg"):!(e=(e=this.parent.element.querySelector("."+this.POP))?e:(t=document.getElementById(this.parent.element.id+"_e-popup"))?t.querySelector("."+this.POP):null)&&this.parent.element.classList.contains("e-treelistgrid")?(t=z(this.parent.element,".e-gantt"))?t.querySelector("."+this.POP):null:e},EK.prototype.isFilterItemAdded=function(){return this.parent.columnMenuItems&&0<=this.parent.columnMenuItems.indexOf("Filter")||!this.parent.columnMenuItems},EK.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action};var TK=EK;function EK(e,t){this.defaultItems={},this.localeText=this.setLocaleKey(),this.disableItems=[],this.hiddenItems=[],this.isOpen=!1,this.GROUP="e-icon-group",this.UNGROUP="e-icon-ungroup",this.ASCENDING="e-icon-ascending",this.DESCENDING="e-icon-descending",this.ROOT="e-columnmenu",this.FILTER="e-icon-filter",this.POP="e-filter-popup",this.WRAP="e-col-menu",this.COL_POP="e-colmenu-popup",this.CHOOSER="_chooser_",this.AUTOFIT="e-icon-autofit",this.AUTOFITALL="e-icon-autofitall",this.COLUMNCHOOSER="e-icon-columnchooser",this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener(),this.parent.enableAdaptiveUI&&this.setFullScreenDialog()}DK=function(e,t){return(DK=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}DK(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(PK,MK=TE),PK.prototype.initEvent=function(){this.parent.isDestroyed||(this.parent.on(pI,this.initForeignKeyColumns,this),this.parent.on(cI,this.getForeignKeyData,this),this.parent.on(uI,this.generateQueryFormData,this))},PK.prototype.initForeignKeyColumns=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].dataSource=e[parseInt(t.toString(),10)].dataSource instanceof me?e[parseInt(t.toString(),10)].dataSource:je(e[parseInt(t.toString(),10)].dataSource)?new me:"result"in e[parseInt(t.toString(),10)].dataSource?e[parseInt(t.toString(),10)].dataSource:new me(e[parseInt(t.toString(),10)].dataSource)},PK.prototype.eventfPromise=function(e,t,i,n){var t=this.getStateEventArgument(t),o=new ll,r=new ll,s=(t.action=e.action,this.parent.getDataModule());return!je(e.action)&&e.action.requestType&&!1!==s.foreignKeyDataState.isDataChanged?(s.setForeignKeyDataState({isPending:!0,resolver:r.resolve}),r.promise.then(function(){o.resolve(n.dataSource)}),t.setColumnData=this.parent.setForeignKeyData.bind(this.parent),this.parent.trigger(fI,t)):(s.setForeignKeyDataState({}),o.resolve(i)),o},PK.prototype.getForeignKeyData=function(o){for(var i=this,r=o.column?[o.column]:this.parent.getForeignKeyColumns(),s=("ExcludeHidden"===this.parent.columnQueryMode&&(r=r.filter(function(e){return!1!==e.visible})),[]),a=this,e=0;e<r.length;e++)!function(e){var t=void 0,i=o.isComplex?a.genarateColumnQuery(r[parseInt(e.toString(),10)]):a.genarateQuery(r[parseInt(e.toString(),10)],o.result.result,!1,!0),n=(i.params=a.parent.query.params,r[parseInt(e.toString(),10)].dataSource);t=n&&"result"in n?a.eventfPromise(o,i,n,r[parseInt(e.toString(),10)]).promise:!n.ready||n.dataSource.offline?n.executeQuery(i):n.ready.then(function(){return n.executeQuery(i)}),s.push(t)}(e);Promise.all(s).then(function(e){for(var t=0;t<e.length;t++)r[parseInt(t.toString(),10)].columnData=e[parseInt(t.toString(),10)].result,"dropdownedit"===r[parseInt(t.toString(),10)].editType&&"result"in r[parseInt(t.toString(),10)].dataSource&&(r[parseInt(t.toString(),10)].edit.params=Pe(r[parseInt(t.toString(),10)].edit.params,{dataSource:e[parseInt(t.toString(),10)].result,query:new ya,fields:{value:r[parseInt(t.toString(),10)].foreignKeyField||r[parseInt(t.toString(),10)].field,text:r[parseInt(t.toString(),10)].foreignKeyValue}}));o.promise.resolve(o.result)}).catch(function(e){var t=e;return t.error||(t={error:t}),i.parent.log(["actionfailure","foreign_key_failure"],t),o.promise&&o.promise.reject&&o.promise.reject(e),e})},PK.prototype.generateQueryFormData=function(e){e.predicate.predicate=this.genarateQuery(e.column,e.column.columnData,!0)},PK.prototype.genarateQuery=function(e,t,i,n){var o=this.parent,r=[],s=new ya,a=i?e.foreignKeyField:e.field;if(o.allowPaging||o.enableVirtualization||i){t=new me(o.allowGrouping&&o.groupSettings.columns.length&&!i?t.records:t).executeLocal((new ya).select(a));for(var l=Sa.distinct(t,a,!1),a=i?e.field:e.foreignKeyField,h=0;h<l.length;h++)l[parseInt(h.toString(),10)]&&l[parseInt(h.toString(),10)].getDay?r.push(PB({field:a,operator:"equal",value:l[parseInt(h.toString(),10)],matchCase:!1})):r.push(new ba(a,"equal",l[parseInt(h.toString(),10)],!1))}return n?r.length?s.where(ba.or(r)):s:r.length?ba.or(r):{predicates:[]}},PK.prototype.genarateColumnQuery=function(e){var t=this.parent,i=new ya,n=this.isFiltered(e);return n.isTrue&&(i=this.filterQuery(i,n.column,!0)),t.searchSettings.key.length&&(n=t.searchSettings,e.dataSource instanceof me&&e.dataSource.adaptor.getModuleName&&"ODataV4Adaptor"===e.dataSource.adaptor.getModuleName()?i=this.searchQuery(i,e,!0):i.search(n.key,e.foreignKeyValue,n.operator,n.ignoreCase)),i},PK.prototype.isFiltered=function(t){var e=this.parent.filterSettings.columns.filter(function(e){return e.field===t.foreignKeyValue&&e.uid===t.uid});return{column:e,isTrue:!!e.length}},PK.prototype.getModuleName=function(){return"foreignKey"},PK.prototype.destroy=function(){this.destroyEvent()},PK.prototype.destroyEvent=function(){this.parent.isDestroyed||(this.parent.off(pI,this.initForeignKeyColumns),this.parent.off(cI,this.getForeignKeyData),this.parent.off(uI,this.generateQueryFormData))};var DK,MK,kK=PK;function PK(e,t){var i=MK.call(this,e,t)||this;return i.parent=e,i.serviceLocator=t,i.initEvent(),i}FK.prototype.getModuleName=function(){return"infiniteScroll"},FK.prototype.addEventListener=function(){this.parent.on(Y1,this.onDataReady,this),this.parent.on(kx,this.dataSourceModified,this),this.parent.on(aT,this.infinitePageQuery,this),this.parent.on(sT,this.infiniteScrollHandler,this),this.parent.on(yx,this.infiniteCellFocus,this),this.parent.on(hT,this.appendInfiniteRows,this),this.parent.on(dT,this.removeInfiniteCacheRows,this),this.parent.on(rT,this.resetInfiniteBlocks,this),this.parent.on(pT,this.setCache,this),this.parent.on(uT,this.ensureIntialCollapse,this),this.parent.on(bx,this.infiniteCellFocus,this),this.parent.on(lT,this.setDisplayNone,this),this.parent.on(KI,this.editActionBegin,this),this.parent.on(nT,this.getVirtualInfiniteData,this),this.parent.on(tT,this.resetInfiniteEdit,this),this.parent.on(JI,this.infiniteEditSuccess,this),this.parent.on(eT,this.refreshInfiniteCache,this),this.parent.on(hE,this.refreshInfiniteEditrowindex,this),this.parent.on(cT,this.infiniteEditHandler,this),this.parent.on(iT,this.infiniteAddActionBegin,this),this.parent.on($1,this.modelChanged,this),this.parent.on(RT,this.refreshInfiniteCurrentViewData,this),this.parent.on(Cx,this.destroy,this),this.parent.on(X1,this.selectNewRow,this),this.parent.on(aE,this.captionActionComplete,this),this.parent.on(YT,this.setGroupCollapsePageQuery,this),this.parent.on(CE,this.onActionComplete,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.dataBoundFunction=this.dataBound.bind(this),this.parent.addEventListener(WA,this.actionBeginFunction),this.parent.addEventListener(QA,this.actionCompleteFunction),this.parent.addEventListener(qA,this.dataBoundFunction)},FK.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Y1,this.onDataReady),this.parent.off(kx,this.dataSourceModified),this.parent.off(aT,this.infinitePageQuery),this.parent.off(sT,this.infiniteScrollHandler),this.parent.off(yx,this.infiniteCellFocus),this.parent.off(hT,this.appendInfiniteRows),this.parent.off(dT,this.removeInfiniteCacheRows),this.parent.off(rT,this.resetInfiniteBlocks),this.parent.off(pT,this.setCache),this.parent.off(uT,this.ensureIntialCollapse),this.parent.off(bx,this.infiniteCellFocus),this.parent.off(lT,this.setDisplayNone),this.parent.off(KI,this.editActionBegin),this.parent.off(nT,this.getVirtualInfiniteData),this.parent.off(tT,this.resetInfiniteEdit),this.parent.off(JI,this.infiniteEditSuccess),this.parent.off(eT,this.refreshInfiniteCache),this.parent.on(hE,this.refreshInfiniteEditrowindex),this.parent.off(cT,this.infiniteEditHandler),this.parent.off(iT,this.infiniteAddActionBegin),this.parent.off($1,this.modelChanged),this.parent.off(RT,this.refreshInfiniteCurrentViewData),this.parent.off(Cx,this.destroy),this.parent.off(X1,this.selectNewRow),this.parent.off(aE,this.captionActionComplete),this.parent.off(YT,this.setGroupCollapsePageQuery),this.parent.off(CE,this.onActionComplete),this.parent.removeEventListener(WA,this.actionBeginFunction),this.parent.removeEventListener(QA,this.actionCompleteFunction),this.parent.removeEventListener(qA,this.dataBoundFunction))},FK.prototype.dataBound=function(){"collapse"===this.groupCaptionAction?(this.groupCaptionAction="refresh",this.makeGroupCollapseRequest()):"refresh"===this.groupCaptionAction&&(this.parent.hideSpinner(),this.groupCaptionAction=this.empty)},FK.prototype.setGroupCollapsePageQuery=function(e){var t=this.parent;if(!t.infiniteScrollSettings.enableCache&&this.isGroupCollapse)if(e.skipPage=!0,this.isGroupCollapse=!1,"collapse"===this.groupCaptionAction){for(var i=t.getRowObjectFromUID(this.parentCapUid),n=t.getRowsObject(),o=0,r=n.length-1;0<=r&&n[parseInt(r.toString(),10)].indent!==i.indent;r--)n[parseInt(r.toString(),10)].isDataRow&&o++;for(var s=RF(n.indexOf(i),n),a=LF(l=FF(s.fields,s.keys,this)),l=a[a.length-1],r=a.length-2;0<=r;r--)l=l.and(a[parseInt(r.toString(),10)]);e.query.where(l),e.query.skip(o),this.parentCapUid=this.empty}else{var s=t.getRows(),h=t.pageSettings.pageSize,s=PF(s[s.length-1])+1,h=s%h==0?0:s-s%h+h-s;e.query.skip(s),e.query.take(t.infiniteScrollSettings.initialBlocks*t.pageSettings.pageSize+h)}},FK.prototype.captionActionComplete=function(e){var t,i,n=this.parent;!n.infiniteScrollSettings.enableCache&&e.isCollapse&&(t=n.getContent().firstElementChild.getBoundingClientRect(),i=n.contentModule.getTable().getBoundingClientRect(),Math.round(i.bottom-n.getRowHeight())<=Math.round(t.bottom))&&(this.parentCapUid=e.parentUid,this.groupCaptionAction="collapse",n.showSpinner(),i=n.getRowObjectFromUID(e.parentUid),this.getCaptionChildCount(i)?this.makeGroupCollapseRequest(e.parentUid):(this.groupCaptionAction="refresh",this.makeGroupCollapseRequest()))},FK.prototype.makeGroupCollapseRequest=function(e){var t=this.parent,i=[].slice.call(t.getContentTable().querySelectorAll("tr")),i=t.groupSettings.enableLazyLoading?i:t.getRows(),i=t.groupSettings.enableLazyLoading?t.contentModule.visibleRows.length-1:PF(i[i.length-1]),n=this.parent.pageSettings.currentPage,o=Math.ceil(i/this.parent.pageSettings.pageSize)+1;n>=this.maxPage||o>this.maxPage?t.hideSpinner():(this.parent.pageSettings.currentPage=o,t={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:n,startIndex:i+1,direction:"down",isCaptionCollapse:!0,parentUid:e},this.isGroupCollapse=!0,this.parent.notify("model-changed",t))},FK.prototype.getCaptionChildCount=function(e){for(var t=this.parent.getRowsObject(),i=!1,n=t.indexOf(e);n<t.length&&(!(t[parseInt(n.toString(),10)].indent===e.indent||t[parseInt(n.toString(),10)].indent<e.indent)||t[parseInt(n.toString(),10)].data.key===e.data.key);n++)if(t[parseInt(n.toString(),10)].isCaptionRow&&!this.childCheck(t,t[parseInt(n.toString(),10)],n)){i=!0;break}return i},FK.prototype.childCheck=function(e,t,i){for(var n=0,o=i+1;o<e.length&&e[parseInt(o.toString(),10)].indent!==t.indent;o++)e[parseInt(o.toString(),10)].indent===t.indent+1&&e[parseInt(o.toString(),10)].parentUid===t.uid&&n++;return t.data.count===n},FK.prototype.updateCurrentViewData=function(){var e=this.parent;if(!e.groupSettings.columns.length)for(var t=Object.keys(this.infiniteCurrentViewData),i=(e.currentViewData=[],e.pageSettings.currentPage),n=e.infiniteScrollSettings.enableCache,o=e.infiniteScrollSettings.maxBlocks,r=n&&(o<i||this.isUpScroll&&1<i),i=r?this.isUpScroll?i:i-o+1:1,s=r?i+o-1:n?o:t.length,a=i;a<=s;a++)this.infiniteCurrentViewData[parseInt(a.toString(),10)]&&(e.currentViewData=e.currentViewData.concat(this.infiniteCurrentViewData[parseInt(a.toString(),10)]))},FK.prototype.refreshInfiniteCurrentViewData=function(e){var t=this.parent,t=t.enableInfiniteScrolling&&(t.childGrid||t.detailTemplate)&&("add"===e.args.action&&"save"===e.args.requestType||"delete"===e.args.requestType),i=("add"!==e.args.action||"save"!==e.args.requestType||t||(this.parent.pageSettings.currentPage=Math.ceil(e.args.index/this.parent.pageSettings.pageSize)?Math.ceil(e.args.index/this.parent.pageSettings.pageSize):1),this.parent.pageSettings.currentPage),n=this.parent.pageSettings.pageSize,o=this.parent.infiniteScrollSettings.initialBlocks,r=Object.keys(this.infiniteCurrentViewData),s=this.parent.infiniteScrollSettings.enableCache;if(!this.parent.groupSettings.columns.length){var a="save"===e.args.requestType&&!(this.parent.sortSettings.columns.length||this.parent.filterSettings.columns.length||this.parent.groupSettings.columns.length||this.parent.searchSettings.key),l="delete"===e.args.requestType;if(s||!a&&!l||t)1<o&&e.data.length===o*n?(t&&(this.infiniteCurrentViewData={},this.firstBlock=1),this.setInitialCache(e.data.slice(),{},s&&"delete"===e.args.requestType,!0)):this.infiniteCurrentViewData[parseInt(i.toString(),10)]=e.data.slice();else if(a){for(var h=0,d=1;d<=r.length;d++)if(h+=this.infiniteCurrentViewData[parseInt(d.toString(),10)].length-1,e.args.index<=h){this.resetCurrentViewData(d),this.infiniteCurrentViewData[parseInt(d.toString(),10)].splice(e.args.index,0,e.args.data);break}}else this.infiniteCurrentViewData[r[r.length-1]].push(e.data[0])}},FK.prototype.resetCurrentViewData=function(e){for(var t=Object.keys(this.infiniteCurrentViewData),i=e;i<=t.length;i++){var n=this.infiniteCurrentViewData[parseInt(i.toString(),10)][this.infiniteCurrentViewData[parseInt(i.toString(),10)].length-1];this.infiniteCurrentViewData[i+1]&&this.infiniteCurrentViewData[i+1].splice(0,0,n),this.infiniteCurrentViewData[parseInt(i.toString(),10)].pop()}},FK.prototype.modelChanged=function(e){var t=this.parent.getRows();"save"===e.requestType&&e.index&&e.data&&(this.addRowIndex=e.index),t&&t.length&&"infiniteScroll"!==e.requestType&&("delete"===e.requestType||"add"===this.requestType)&&(this.firstIndex=PF(t[0]),this.firstBlock=Math.ceil((this.firstIndex+1)/this.parent.pageSettings.pageSize),this.lastIndex=PF(t[t.length-1]),"delete"===e.requestType?(t=this.parent.getRowsObject(),e.startIndex=this.parent.infiniteScrollSettings.enableCache?(this.firstBlock-1)*this.parent.pageSettings.pageSize:t[t.length-1].index):e.startIndex=this.firstIndex,this.parent.infiniteScrollSettings.enableCache||this.parent.pageSettings.currentPage!==this.maxPage||"delete"!==e.requestType||(this.isLastPage=!0,this.lastIndex=this.lastIndex-1))},FK.prototype.infiniteAddActionBegin=function(e){this.isNormaledit&&(this.isAdd=!0,this.parent.infiniteScrollSettings.enableCache)&&(Object.keys(this.emptyRowData).length||this.createEmptyRowdata(),1<this.parent.pageSettings.currentPage)&&(e.startEdit=!1,this.resetInfiniteBlocks({},!0),this.makeRequest({currentPage:1}))},FK.prototype.infiniteEditHandler=function(e){var t,i;this.parent.infiniteScrollSettings.enableCache||"delete"!==e.e.requestType&&("save"!==e.e.requestType||"add"!==this.requestType)||(t=this.parent.getRows(),i=this.parent.getRowsObject(),this.ensureRowAvailability(i,e.result[0])&&(!t.length||this.addRowIndex&&this.addRowIndex>=t.length||this.resetRowIndex(i,e.e,t,"add"===this.requestType,!0),this.isLastPage?(this.isLastPage=!1,this.parent.pageSettings.currentPage=this.maxPage,this.parent.selectionModule.index<this.parent.frozenRows&&(ue(t[this.parent.frozenRows-1]),this.createRow([i[this.parent.frozenRows-1]],e,!1,!0),oF(this.parent))):this.createRow(i,e)),this.parent.hideSpinner(),this.parent.notify(lE,{}),"delete"===this.requestType?this.parent.notify(Hx,e.e):this.parent.notify(_x,e.e)),this.parent.notify(oI,{case:"refreshHeight"})},FK.prototype.createRow=function(e,t,i,n,o){var r=n?e:this.generateRows(t.result,t.e),s=new yD(this.serviceLocator,null,this.parent);if(this.parent.removeMaskRow(),!("save"===t.e.requestType&&t.e.index&&t.e.data&&(r[0].index=this.addRowIndex,this.addRowIndex=null,r[0].index>=e.length))){var a=this.parent.getContent().querySelector(oD),l=(this.parent.frozenRows&&(a=n&&"add"!==this.requestType||!n&&"add"===this.requestType?this.parent.getHeaderContent().querySelector(oD):a),{rows:e,cancel:!1,args:t,isMovable:i,isFrozenRows:n,isFrozenRight:n,row:r});if(this.parent.notify(OT,l),!l.cancel)for(var h=r.length-1;0<=h;h--)"delete"===this.requestType?a.appendChild(s.render(r[parseInt(h.toString(),10)],this.parent.getColumns())):a.insertBefore(s.render(r[parseInt(h.toString(),10)],this.parent.getColumns()),a.rows[t.e.index]);!n&&this.parent.frozenRows&&(this.parent.selectionModule.index<this.parent.frozenRows||"add"===this.requestType)&&(l=this.parent.getRows(),i=(i||o)&&"add"===this.requestType?this.parent.frozenRows:this.parent.frozenRows-1,ue(l[parseInt(i.toString(),10)]),this.createRow([e[this.parent.frozenRows-1]],t,!1,!0,!1)),this.parent.infiniteScrollSettings.enableCache||n||(oF(this.parent),this.parent.contentModule.visibleRows="add"===this.requestType?r.concat(e):e.concat(r))}},FK.prototype.ensureRowAvailability=function(e,t){var i=!0;if(this.parent.frozenRows&&!this.parent.infiniteScrollSettings.enableCache&&this.parent.sortSettings.columns&&"add"===this.requestType)for(var n=this.parent.getPrimaryKeyFieldNames()[0],o=0;o<e.length;o++)if(e[parseInt(o.toString(),10)].data[""+n]===t[""+n]){i=!1;break}return i},FK.prototype.generateRows=function(e,t){return this.rowModelGenerator.generateRows(e,t)},FK.prototype.resetRowIndex=function(n,o,r,e,s){var a=this,l=this.parent.getPrimaryKeyFieldNames()[0],t=!(r.length%this.parent.pageSettings.pageSize),t=(e?t&&(s&&!this.parent.groupSettings.columns.length&&this.swapCurrentViewData(1,!0),ue(r[n.length-1]),r.splice(n.length-1,1),n.splice(n.length-1,1)):n.filter(function(e,t){var i;e.data[""+l]===o.data[0][""+l]&&(s&&!a.parent.groupSettings.columns.length&&(i=Math.ceil((t+1)/a.parent.pageSettings.pageSize),a.resetInfiniteCurrentViewData(i,t)),n.splice(t,1),i=a.parent.getRowElementByUID(e.uid))&&(t=r.indexOf(i),ue(i),r.splice(t,1))}),e?this.addRowIndex?this.addRowIndex+1:1:0);eF(this.parent,n,r,t,this.addRowIndex||0)},FK.prototype.resetInfiniteCurrentViewData=function(e,t){t-=(e-1)*this.parent.pageSettings.pageSize,this.infiniteCurrentViewData[parseInt(e.toString(),10)].splice(t,1),this.swapCurrentViewData(e,!1)},FK.prototype.swapCurrentViewData=function(e,t){for(var i,n,o=Object.keys(this.infiniteCurrentViewData),r=t?o.length+1:o.length,s=e;s<r;s++)this.infiniteCurrentViewData[s+1]&&(n=t?s:s+1,i=t?this.infiniteCurrentViewData[parseInt(s.toString(),10)].length-1:0,n=this.infiniteCurrentViewData[parseInt(n.toString(),10)].splice(i,1),t?(this.infiniteCurrentViewData[s+1]=n.concat(this.infiniteCurrentViewData[s+1]),s+1===r-1&&this.infiniteCurrentViewData[s+1].splice(this.infiniteCurrentViewData[s+1].length-1,1)):this.infiniteCurrentViewData[parseInt(s.toString(),10)].push(n[0]));this.updateCurrentViewData()},FK.prototype.setDisplayNone=function(t){if(this.parent.infiniteScrollSettings.enableCache){for(var e=Object.keys(this.infiniteCache),i=1;i<=e.length;i++)this.infiniteCache[parseInt(i.toString(),10)].filter(function(e){e.cells[t.index].visible=""===t.visible});this.resetContentModuleCache(this.infiniteCache)}},FK.prototype.refreshInfiniteCache=function(e){this.getEditedRowObject().data=e.data},FK.prototype.refreshInfiniteCacheRowVisibleLength=function(e,t){var i=e[parseInt(t.toString(),10)];if(this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache){for(var e=0,n=0,o=0,r=0;r<i.length;r++)i[parseInt(r.toString(),10)].visible||je(i[parseInt(r.toString(),10)].visible)?n++:o++;return n<o?n<(e=o-n)&&(e=n):o<(e=n-o)&&(e=o),e=0===e?1:e}return i.length},FK.prototype.refreshInfiniteEditrowindex=function(e){this.editRowIndex=e.index},FK.prototype.getEditedRowObject=function(){for(var e,t=this.parent.getRowsObject(),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].index===this.editRowIndex&&(e=t[parseInt(i.toString(),10)]);return e},FK.prototype.infiniteEditSuccess=function(e){this.isNormaledit&&(!this.isAdd&&e.data&&this.updateCurrentViewRecords(e.data),this.isAdd=this.parent.editSettings.showAddNewRow)},FK.prototype.updateCurrentViewRecords=function(e){var t=KB(this.parent,e);je(t)||(this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)]=e)},FK.prototype.actionBegin=function(e){"add"===e.requestType||"delete"===e.requestType?this.requestType=e.requestType:"add"===e.action&&"save"===e.requestType&&(this.requestType=e.action),(this.parent.isFrozenGrid()&&!e.cancel&&"searching"===e.requestType||"sorting"===e.requestType||"filtering"===e.requestType)&&(this.isInitialRender=!0)},FK.prototype.actionComplete=function(e){"delete"!==e.requestType&&"save"!==e.requestType&&"cancel"!==e.requestType||(this.requestType=this.empty,this.isCancel="cancel"===e.requestType||"save"===e.requestType,this.isAdd=this.isEdit=this.parent.editSettings.showAddNewRow,this.isNormaledit&&(this.editRowIndex=this.empty,this.virtualInfiniteData={},this.parent.editModule.previousVirtualData={}))},FK.prototype.onActionComplete=function(e){this.parent.trigger(QA,Pe(e,{type:QA}))},FK.prototype.resetInfiniteEdit=function(){this.parent.enableInfiniteScrolling&&this.isNormaledit&&(this.parent.editSettings.allowEditing&&this.isEdit||this.parent.editSettings.allowAdding&&this.isAdd)&&(this.parent.isEdit=!0)},FK.prototype.getVirtualInfiniteData=function(e){this.getVirtualInfiniteEditedData(),e.virtualData=this.parent.enableColumnVirtualization&&!this.parent.infiniteScrollSettings.enableCache?e.virtualData:this.virtualInfiniteData,e.isAdd=this.isAdd,e.isCancel=this.isCancel},FK.prototype.editActionBegin=function(e){this.isEdit=!0,this.editRowIndex=e.index;var t=Pe({},this.getEditedRowObject().data);e.data=Object.keys(this.virtualInfiniteData).length?this.virtualInfiniteData:t},FK.prototype.dataSourceModified=function(){this.resetInfiniteBlocks({requestType:this.empty},!0)},FK.prototype.onDataReady=function(e){je(e.count)||"infiniteScroll"===e.requestType||(this.maxPage=Math.ceil(e.count/this.parent.pageSettings.pageSize))},FK.prototype.ensureIntialCollapse=function(e){this.isInitialCollapse=!e},FK.prototype.infiniteScrollHandler=function(e){var t,i,n,o,r,s,a,l,h,d;this.infiniteDetailDestroy||(this.restoreInfiniteEdit(),this.restoreInfiniteAdd(),n=(t=e.target).classList.contains(WE),i=!(!this.parent.childGrid&&!this.parent.detailTemplate),n&&this.parent.enableInfiniteScrolling&&!e.isLeft&&(n=this.parent.getContent().firstElementChild,e=[].slice.call(this.parent.getContentTable().querySelectorAll("tr")),this.prevScrollTop=n.scrollTop,(e=i?this.parent.getRows().filter(function(e){return!e.classList.contains("e-detailrow")}):this.parent.groupSettings.enableLazyLoading?e:this.parent.getRows()).length)&&(e=PF(e[e.length-1])+1,o=this.parent.pageSettings.currentPage,r=void 0,a=t.scrollHeight-t.scrollTop,d=Math.round(t.scrollHeight-t.scrollTop),a=a<t.clientHeight?Math.ceil(a):Math.floor(a),(s=t.clientHeight)<a?a-=1:a<s&&(s-=1),je(this.groupCaptionAction))&&(this.isScroll&&(a===s||d===s)&&(this.parent.pageSettings.currentPage<=this.maxPage-1||this.enableContinuousScroll)&&(this.parent.infiniteScrollSettings.enableCache&&(this.isUpScroll=!1,this.isDownScroll=!0),l=(a=i?this.getGridRows().filter(function(e){return e.classList.contains("e-row")&&!e.classList.contains("e-addedrow")}):[].slice.call(n.querySelectorAll(".e-row:not(.e-addedrow)")))[a.length-1],h=this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length?this.parent.contentModule.visibleRows.length-1:PF(l),this.parent.pageSettings.currentPage=Math.ceil(h/this.parent.pageSettings.pageSize)+1,r={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:o,startIndex:e,direction:"down"},this.makeRequest(r)),this.isScroll&&this.parent.infiniteScrollSettings.enableCache&&0===t.scrollTop&&1!==this.parent.pageSettings.currentPage&&(this.parent.infiniteScrollSettings.enableCache&&(this.isDownScroll=!1,this.isUpScroll=!0),h=PF((l=i?this.getGridRows().filter(function(e){return e.classList.contains(UE)}):[].slice.call(n.getElementsByClassName(UE)))[this.parent.pageSettings.pageSize-1]),d=PF(l[0])-this.parent.pageSettings.pageSize,this.parent.pageSettings.currentPage=Math.ceil(h/this.parent.pageSettings.pageSize)-1,this.parent.pageSettings.currentPage)&&(r={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:o,startIndex:d,direction:"up"},this.makeRequest(r)),this.parent.infiniteScrollSettings.enableCache)&&!this.isScroll&&je(r)&&(this.isDownScroll||this.isUpScroll)&&(n.scrollTop=this.top))},FK.prototype.makeRequest=function(e){var t,i=this;this.parent.pageSettings.currentPage!==e.prevPage&&((t=this.parent.infiniteScrollSettings.initialBlocks)<this.maxPage&&this.parent.pageSettings.currentPage<=this.maxPage?(this.isInfiniteScroll=!0,je(this.infiniteCache[e.currentPage])?setTimeout(function(){i.getVirtualInfiniteEditedData(),i.parent.notify("model-changed",e)},100):setTimeout(function(){i.getVirtualInfiniteEditedData(),i.parent.notify(oT,e)},100)):this.parent.pageSettings.currentPage=this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&t>=this.maxPage?1:this.maxPage)},FK.prototype.infinitePageQuery=function(e){this.initialRender||("add"===this.requestType||"delete"===this.requestType)&&(this.parent.childGrid||this.parent.detailTemplate)?(this.initialRender=!1,this.intialPageQuery(e)):"delete"===this.requestType||"add"===this.requestType?this.isInfiniteScroll||this.parent.groupSettings.enableLazyLoading?this.parent.groupSettings.enableLazyLoading&&!this.parent.infiniteScrollSettings.enableCache?this.parent.infiniteScrollSettings.initialBlocks<this.parent.pageSettings.currentPage?e.page(1,this.parent.pageSettings.pageSize*this.parent.pageSettings.currentPage):e.page(1,this.parent.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks):e.page(this.parent.pageSettings.currentPage,this.parent.pageSettings.pageSize):this.editPageQuery(e):e.page(this.parent.pageSettings.currentPage,this.parent.pageSettings.pageSize)},FK.prototype.editPageQuery=function(e){var t,i=this.parent.infiniteScrollSettings.initialBlocks;this.parent.infiniteScrollSettings.enableCache?(this.infiniteCache={},this.infiniteCurrentViewData={},e.skip(this.firstIndex),e.take(i*this.parent.pageSettings.pageSize)):("Dialog"===this.parent.editSettings.mode&&this.parent.clearSelection(),t="delete"===this.requestType?this.lastIndex:this.addRowIndex||this.firstIndex,e.skip(t),je(this.parent.getDataModule().dataManager.dataSource.url)||""===this.parent.getDataModule().dataManager.dataSource.url||"delete"!==this.requestType&&"add"!==this.requestType?e.take(1):e.take(i*this.parent.pageSettings.pageSize))},FK.prototype.intialPageQuery=function(e){this.parent.infiniteScrollSettings.enableCache&&this.parent.infiniteScrollSettings.initialBlocks>this.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks);var t=this.parent.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks;e.page(1,t)},FK.prototype.scrollToLastFocusedCell=function(e){var t=this.parent,i=this.lastFocusInfo.rowIdx+(e.keyArgs.action===cD?-1:1),n=this.lastFocusInfo.cellIdx;if(!t.getRowByIndex(i)){for(var o=new yD(this.serviceLocator,null,this.parent),r=Math.floor(i/this.parent.pageSettings.pageSize)+1,s=(t.pageSettings.currentPage=r,t.getColumns()),a=(ue(t.getContent().querySelector("tbody")),t.getContent().querySelector("table").appendChild(t.createElement("tbody",{attrs:{role:"rowgroup"}})),[]),l=1===r||this.maxPage===r?0:-1,h=0;h<t.infiniteScrollSettings.maxBlocks;this.maxPage===r?l--:l++,h++){var d=this.infiniteCache[r+l];if(d)for(var a=a.concat(d),p=0;p<d.length;p++)t.getContent().querySelector("tbody").appendChild(o.render(d[parseInt(p.toString(),10)],s))}t.notify(X1,{rows:a,args:{}}),oF(t)}n=t.getRowByIndex(i).cells[parseInt(n.toString(),10)];t.focusModule.isInfiniteScroll=!0,t.focusModule.onClick({target:n},!0),t.selectRow(i),n.focus(),this.isFocusScroll=!1,e.cancel=!0},FK.prototype.setLastCellFocusInfo=function(e){var t,e=e.byClick&&e.clickArgs.target||e.byKey&&e.keyArgs.target||(!this.isFocusScroll&&e).target;e&&e.classList.contains("e-rowcell")&&(t=parseInt(e.getAttribute("aria-colindex"),10)-1,e=parseInt(e.parentElement.getAttribute("aria-rowindex"),10)-1,this.lastFocusInfo={rowIdx:e,cellIdx:t})},FK.prototype.infiniteCellFocus=function(e){var t=this.parent,i=t.infiniteScrollSettings.enableCache;if(e.byKey){if(i&&this.isFocusScroll)return void this.scrollToLastFocusedCell(e);var n,o,r=document.activeElement,s=PF(r.parentElement),a=(this.cellIndex=parseInt(r.getAttribute(iD),10)-1,t.getContent().firstElementChild),l=this.maxPage*t.pageSettings.pageSize-1,h=Math.floor(a.offsetHeight/this.parent.getRowHeight()),d=a.getBoundingClientRect();isNaN(s)||(e.keyArgs.action===pD||e.keyArgs.action===gD?(this.rowIndex=s+=1,o=(n=t.getRowByIndex(s))&&n.getBoundingClientRect(),i&&(s=r.parentElement.rowIndex+1),this.isFocusScroll||!n&&s<l||o&&o.bottom>=d.bottom?(this.isFocusScroll||(this.pressedKey=e.keyArgs.action),this.isFocusScroll=!1,a.scrollTop=(s-h+1)*this.parent.getRowHeight()):!i&&n&&o&&(o.bottom>=d.bottom||o.top<d.top)&&n.cells[this.cellIndex].scrollIntoView()):(e.keyArgs.action===cD||e.keyArgs.action===mD)&&(this.rowIndex=--s,o=(n=t.getRowByIndex(s))&&n.getBoundingClientRect(),i&&(s=r.parentElement.rowIndex-1),!n||o.top<=d.top)&&(this.pressedKey=e.keyArgs.action,a.scrollTop=s*this.parent.getRowHeight()))}else"PageDown"!==e.key&&"PageUp"!==e.key||(this.pressedKey=e.key);this.setLastCellFocusInfo(e)},FK.prototype.createEmptyRowdata=function(){var t=this;this.parent.getColumns().filter(function(e){t.emptyRowData[e.field]=t.empty})},FK.prototype.getVirtualInfiniteEditedData=function(){var e=this.parent.element.querySelector("."+GE),t=this.parent.element.querySelector("."+YE),i=this.parent.element.querySelector(".e-gridform");if(this.parent.infiniteScrollSettings.enableCache&&(e||t))for(var t=Pe({},e?this.getEditedRowObject().data:this.emptyRowData),n=(this.virtualInfiniteData=this.parent.editModule.getCurrentEditedData(i,t),this.parent.getHiddenColumns()),o=0;o<n.length;o++)n[parseInt(o.toString(),10)].defaultValue&&(this.virtualInfiniteData[n[parseInt(o.toString(),10)].field]=n[parseInt(o.toString(),10)].defaultValue)},FK.prototype.restoreInfiniteEdit=function(){var e,t=this.parent.getContent().firstElementChild,i=!this.parent.frozenRows||this.editRowIndex>=this.parent.frozenRows;this.isNormaledit&&this.parent.infiniteScrollSettings.enableCache&&i&&this.parent.editSettings.allowEditing&&!je(this.editRowIndex)&&(i=this.parent.getRowByIndex(this.editRowIndex),Object.keys(this.virtualInfiniteData).length)&&i&&!this.parent.getContent().querySelector("."+GE)&&(e=i.getBoundingClientRect().top)<t.offsetHeight&&e>this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(i))},FK.prototype.restoreInfiniteAdd=function(){var e=this.parent.getContent().firstElementChild;this.parent.getCurrentViewRecords().length&&this.parent.getRowByIndex(0)&&this.isNormaledit&&this.parent.infiniteScrollSettings.enableCache&&this.isAdd&&!e.querySelector("."+YE)&&e.scrollTop<this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.addRecord())},FK.prototype.appendInfiniteRows=function(e){var t,i=this.parent,n=this.parent.getContent().firstElementChild,o=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType;i.enableInfiniteScrolling&&(i.childGrid||i.detailTemplate)&&("add"===e.args.action&&"save"===e.args.requestType||"delete"===e.args.requestType)&&(n.scrollTop=0,i.pageSettings.currentPage=1),(this.parent.isAngular||this.parent.isReact||this.parent.isVue||this.parent.isVue3)&&o&&!e.args.isFrozen&&this.parent.infiniteScrollSettings.enableCache&&(i=!(!this.parent.childGrid||!this.parent.element.querySelectorAll(".e-childgrid").length),t=this.parent.getDataRows(),this.parent.refreshReactTemplateTD(t,i)),(!o||e.args.isFrozen)&&o||(o&&"up"===e.args.direction?e.tbody.insertBefore(e.frag,e.tbody.firstElementChild):e.tbody.appendChild(e.frag)),this.parent.contentModule.getTable().appendChild(e.tbody),this.updateCurrentViewData(),this.isInitialRender&&!e.args.isFrozen&&(this.isInitialRender=!1,this.parent.scrollModule.setHeight()),e.args.isFrozen||(this.rowTop=this.rowTop||this.parent.getRows()[0].getBoundingClientRect().top,o&&(this.parent.infiniteScrollSettings.enableCache&&this.isRemove&&(n.scrollTop=this.top),oF(this.parent)),this.restoreInfiniteAdd(),this.isScroll=!0),this.isInfiniteScroll=!1,this.infiniteDetailDestroy=!1},FK.prototype.selectNewRow=function(e){var t,i,n,o=this,r=this.parent,s=r.getRowByIndex(this.rowIndex),a=r.infiniteScrollSettings.enableCache;s&&this.keys.some(function(e){return e===o.pressedKey})?(t=r.getContent().firstElementChild,i=r.getRowHeight(),n=s.cells[this.cellIndex],this.pressedKey!==pD&&this.pressedKey!==gD&&(!a||this.pressedKey!==cD&&this.pressedKey!==mD)||(a||this.pressedKey===cD||this.pressedKey===mD||(t.scrollTop=t.scrollTop+i),r.focusModule.isInfiniteScroll=!0,r.focusModule.onClick({target:n},!0),r.selectRow(this.rowIndex))):!this.lastFocusInfo||this.pressedKey!==uD&&"PageUp"!==this.pressedKey||(s=a?0:this.lastFocusInfo.rowIdx,r.getRowByIndex(s)&&(n=r.getCellFromIndex(s,this.lastFocusInfo.cellIdx))&&(this.isFocusScroll=!0,a?n.focus({preventScroll:!0}):(r.focusModule.isInfiniteScroll=!0,r.focusModule.onClick({target:n},!0)))),this.pressedKey=void 0},FK.prototype.removeInfiniteCacheRows=function(e){var t,i,n,o=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType;!e.args.isFrozen&&o&&this.parent.infiniteScrollSettings.enableCache&&this.isRemove&&(t=(o=!(!this.parent.childGrid&&!this.parent.detailTemplate))?this.getGridRows().filter(function(e){return e.classList.contains(UE)}):[].slice.call(this.parent.getContentTable().getElementsByClassName(UE)),"down"===e.args.direction&&(this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&(n=o?this.getGridRows().filter(function(e){return!e.classList.contains("e-detailrow")}):[].slice.call(this.parent.getContentTable().querySelectorAll("tr")),this.removeCaptionRows(n,e.args)),i=this.parent.element.querySelector("."+YE)?0:1,this.removeTopRows(t,this.parent.pageSettings.pageSize-i)),"up"===e.args.direction&&(this.parent.allowGrouping&&this.parent.groupSettings.columns.length?(n=o?this.getGridRows().filter(function(e){return!e.classList.contains("e-detailrow")}):[].slice.call(this.parent.getContentTable().querySelectorAll("tr")),this.removeCaptionRows(n,e.args)):this.removeBottomRows(t,t.length-1,e.args)),this.isScroll=!1,this.top=this.calculateScrollTop(e.args))},FK.prototype.calculateScrollTop=function(e){var t=0,i=this.parent.getContent().firstElementChild;if("down"===e.direction){this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!this.isInitialCollapse&&(t=this.captionRowHeight());for(var n=[].slice.call(this.parent.getContent().firstElementChild.querySelectorAll("tr:not(.e-row)")),o=0,n=(o=this.isInitialCollapse&&!je(n)?Math.round((n.length-1)/this.parent.groupSettings.columns.length):o)||this.parent.pageSettings.pageSize*(this.parent.infiniteScrollSettings.maxBlocks-1),r=0,s=0;r<i.clientHeight;)r=++s*this.parent.getRowHeight();t+=(n-(s-=1))*this.parent.getRowHeight()}if("up"===e.direction)if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!this.isInitialCollapse)t=this.refreshInfiniteCacheRowVisibleLength(this.infiniteCache,this.parent.pageSettings.currentPage)*this.parent.getRowHeight();else if(this.isInitialCollapse){for(var a=this.infiniteCache[this.parent.pageSettings.currentPage],l=0,s=0;s<a.length;s++)a[parseInt(s.toString(),10)].isCaptionRow&&l++;t+=Math.round(l/this.parent.groupSettings.columns.length)*this.parent.getRowHeight()}else t+=this.parent.pageSettings.pageSize*this.parent.getRowHeight()+aB();return t},FK.prototype.captionRowHeight=function(){return[].slice.call(this.parent.getContent().querySelectorAll("tr:not(.e-row)")).length*this.parent.getRowHeight()},FK.prototype.removeTopRows=function(e,t){for(var i=0;i<=t;i++)this.parent.frozenRows&&this.parent.pageSettings.currentPage===this.parent.infiniteScrollSettings.maxBlocks+1&&i>t-this.parent.frozenRows||ue(e[parseInt(i.toString(),10)])},FK.prototype.removeBottomRows=function(e,t,i){var n=0,o=this.parent.pageSettings.pageSize;this.infiniteCache[i.prevPage].length<o&&(n=this.parent.pageSettings.pageSize-this.infiniteCache[i.prevPage].length);for(var r=t;n<o;r--)n++,ue(e[parseInt(r.toString(),10)])},FK.prototype.removeCaptionRows=function(e,t){var i=!(!this.parent.childGrid&&!this.parent.detailTemplate),n=i?this.getGridRows().filter(function(e){return e.classList.contains(UE)}):[].slice.call(this.parent.getContent().getElementsByClassName(UE));if("down"===t.direction)for(var o=PF(n[this.parent.pageSettings.pageSize-1])-1,r=0,s=0;r<o;s++)e[parseInt(s.toString(),10)].classList.contains(UE)?r=PF(e[parseInt(s.toString(),10)]):ue(e[parseInt(s.toString(),10)]);if("up"===t.direction){for(var t=PF(n[n.length-1]),a=Math.ceil(t/this.parent.pageSettings.pageSize),l=0,s=this.parent.pageSettings.currentPage+1;s<a;s++)l+=(i?this.infiniteCache[parseInt(s.toString(),10)].filter(function(e){return!e.isDetailRow}):this.infiniteCache[parseInt(s.toString(),10)]).length;for(s=l;s<e.length;s++)ue(e[parseInt(s.toString(),10)])}},FK.prototype.getGridRows=function(){return[].slice.call(this.parent.getContentTable().rows)},FK.prototype.resetInfiniteBlocks=function(t,e){var i=this.parent.enableInfiniteScrolling&&"infiniteScroll"!==t.requestType;this.initialRender||je(this.parent.infiniteScrollModule)||!i||(this.actions.some(function(e){return e===t.requestType})||e||"save"===t.requestType&&(this.parent.sortSettings.columns.length||this.parent.filterSettings.columns.length||this.parent.groupSettings.columns.length||this.parent.searchSettings.key))&&(i=this.parent.getContent().firstElementChild,this.parent.notify(IE,{}),this.initialRender=!0,i.scrollTop=0,this.parent.pageSettings.currentPage=1,this.infiniteCache={},this.infiniteCurrentViewData={},this.resetContentModuleCache({}),this.isRemove=!1,this.top=0,this.isInitialCollapse=!1,this.parent.contentModule.isRemove=this.isRemove,this.parent.contentModule.isAddRows=this.isRemove,this.parent.contentModule.visibleRows=[],this.parent.contentModule.visibleFrozenRows=[])},FK.prototype.setCache=function(e){var t,i,n;this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&(t=((t=this.parent).childGrid||t.detailTemplate)&&("add"===e.args.action&&"save"===e.args.requestType||"delete"===e.args.requestType),i="infiniteScroll"!==e.args.requestType&&("delete"===this.requestType||"add"===this.requestType),n=this.parent.pageSettings.currentPage,Object.keys(this.infiniteCache).length&&!i||(t&&(this.infiniteCache={}),this.setInitialCache(e.modelData,e.args,i)),je(this.infiniteCache[this.parent.pageSettings.currentPage])&&!t&&(this.infiniteCache[this.parent.pageSettings.currentPage]=e.modelData,this.resetContentModuleCache(this.infiniteCache)),e.isInfiniteScroll)&&!this.isRemove&&(this.isRemove=(n-1)%this.parent.infiniteScrollSettings.maxBlocks==0,this.parent.contentModule.isRemove=this.isRemove)},FK.prototype.setInitialCache=function(e,t,i,n){for(var o=!i||je(this.firstBlock)?1:this.firstBlock,r=1;r<=this.parent.infiniteScrollSettings.initialBlocks;r++){var s=(r-1)*this.parent.pageSettings.pageSize,a=r*this.parent.pageSettings.pageSize;this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!n?this.setInitialGroupCache(e,o,s,a):n?this.infiniteCurrentViewData[parseInt(o.toString(),10)]=e.slice(s,a):(this.infiniteCache[parseInt(o.toString(),10)]=e.slice(s,a),this.resetContentModuleCache(this.infiniteCache)),o++}},FK.prototype.setInitialGroupCache=function(e,t,i,n){for(var o=[],r=0,s=1;s<=Object.keys(this.infiniteCache).length;s++)r+=this.infiniteCache[parseInt(s.toString(),10)].length;for(var a=i,s=r;s<e.length&&a<n&&((e[parseInt(s.toString(),10)].index<n||e[parseInt(s.toString(),10)].isCaptionRow)&&(a=e[parseInt(s.toString(),10)].isCaptionRow?a:e[parseInt(s.toString(),10)].index,o.push(e[parseInt(s.toString(),10)])),!(e[parseInt(s.toString(),10)].index>=n||e[parseInt(s.toString(),10)].index===n-1));s++);this.infiniteCache[parseInt(t.toString(),10)]=o,this.resetContentModuleCache(this.infiniteCache)},FK.prototype.resetContentModuleCache=function(e){this.parent.contentModule.infiniteCache=e},FK.prototype.resetInfiniteCache=function(e){var t=Object.keys(this.infiniteCache).length;this.infiniteCache={};for(var i=1;i<=t;i++){var n=(i-1)*this.parent.pageSettings.pageSize,o=i*this.parent.pageSettings.pageSize;this.parent.allowGrouping&&this.parent.groupSettings.columns.length?this.setInitialGroupCache(e,i,n,o):(this.infiniteCache[parseInt(i.toString(),10)]=e.slice(n,o),this.resetContentModuleCache(this.infiniteCache))}},FK.prototype.destroy=function(){this.removeEventListener()};var BK=FK;function FK(e,t){this.infiniteCache={},this.infiniteCurrentViewData={},this.isDownScroll=!1,this.isUpScroll=!1,this.isScroll=!0,this.enableContinuousScroll=!1,this.initialRender=!0,this.isRemove=!1,this.isInitialCollapse=!1,this.prevScrollTop=0,this.actions=["filtering","searching","grouping","ungrouping","reorder","sorting","refresh"],this.keys=[pD,cD,gD,mD],this.rowTop=0,this.virtualInfiniteData={},this.isCancel=!1,this.emptyRowData={},this.isNormaledit=!1,this.isInfiniteScroll=!1,this.isLastPage=!1,this.isInitialRender=!0,this.isFocusScroll=!1,this.isGroupCollapse=!1,this.infiniteDetailDestroy=!1,this.parent=e,this.serviceLocator=t,this.isNormaledit="Normal"===this.parent.editSettings.mode,this.addEventListener(),this.widthService=t.getService("widthService"),this.rowModelGenerator=new bD(this.parent)}LK=function(e,t){return(LK=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}LK(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(NK,RK=LD),NK.prototype.eventListener=function(){this.parent.addEventListener(WA,this.actionBegin.bind(this)),this.parent.addEventListener(QA,this.actionComplete.bind(this)),this.parent.on(G1,this.setLazyLoadPageSize,this),this.parent.on(wT,this.setCache,this),this.parent.on(CT,this.scrollHandler,this),this.parent.on(Sx,this.setVisible,this),this.parent.on(ST,this.collapseShortcut,this)},NK.prototype.captionExpand=function(t){for(var i=this,n=this.parent.pageSettings.currentPage,e=this.groupCache[parseInt(n.toString(),10)],o=t.getAttribute("data-uid"),r=(this.refreshCaches(),this.scrollTopCache&&!(this.parent.scrollModule.content.scrollTop>this.scrollTopCache)||this.parent.enableVirtualization||(this.scrollTopCache=this.parent.scrollModule.content.scrollTop),this.getRowObjectIndexByUid(o)),s=!!e[r+1]&&e[parseInt(r.toString(),10)].indent<e[r+1].indent,a=(this.parent.enableVirtualization&&(s=!!this.cacheRowsObj[""+o]),e[parseInt(r.toString(),10)]),l=RF(r,e),h=0;h<l.fields.length;h++){var d=this.parent.getColumnByField(l.fields[parseInt(h.toString(),10)]);d.enableGroupByFormat&&(l.keys[parseInt(h.toString(),10)]=this.locator.getService("valueFormatter").fromView(l.keys[parseInt(h.toString(),10)],d.getParser(),"dateonly"===d.type?"date":d.type))}this.parent.trigger(Q1,{captionRowElement:t,groupInfo:a,enableCaching:!0,cancel:!1},function(e){e.cancel||(e.keys=l.keys,e.fields=l.fields,e.rowIndex=t.rowIndex,e.makeRequest=!e.enableCaching||!s,!e.enableCaching&&s&&i.clearCache([o]),e.skip=0,e.take=i.pageSize,a.isExpand=!0,i.rowsByUid[parseInt(n.toString(),10)][a.uid]&&(i.rowsByUid[parseInt(n.toString(),10)][a.uid].isExpand=!0),i.captionRowExpand(e))})},NK.prototype.captionCollapse=function(e){var n=this,t=this.groupCache[this.parent.pageSettings.currentPage],o=e.rowIndex,r=e.getAttribute("data-uid"),s=(this.refreshCaches(),this.getRowObjectIndexByUid(r)),e={captionRowElement:e,groupInfo:t[parseInt(s.toString(),10)],cancel:!1};this.parent.trigger(U1,e,function(e){if(!e.cancel){e.isExpand=!1;for(var t=0;t<n.lazyLoadQuery.length;t++){var i=n.lazyLoadQuery[parseInt(t.toString(),10)][0];e.groupInfo.data.key===i.value&&n.lazyLoadQuery.splice(t,1)}n.removeRows(s,o,r),(n.parent.enableInfiniteScrolling||n.parent.enableVirtualization)&&(n.groupCache[n.parent.pageSettings.currentPage]=Pe([],n.refRowsObj[n.parent.pageSettings.currentPage]),n.refreshRowObjects([],s))}})},NK.prototype.setLazyLoadPageSize=function(){var e=this.parent.getContent().firstElementChild,e=Math.floor(e.offsetHeight/this.parent.getRowHeight())-1;this.pageSize=this.pageSize||3*e,this.blockSize=Math.ceil(this.pageSize/2)},NK.prototype.clearLazyGroupCache=function(){this.clearCache()},NK.prototype.clearCache=function(e){e=e||this.getInitialCaptionIndexes();var t=this.groupCache[this.parent.pageSettings.currentPage];if(e.length)for(var i=0;i<e.length;i++){var n=this.getRowObjectIndexByUid(e[parseInt(i.toString(),10)]),o=t[parseInt(n.toString(),10)];if(o){if(this.captionCounts[this.parent.pageSettings.currentPage][o.uid])for(var r=n+1;r<t.length;r++){if(t[parseInt(r.toString(),10)].indent===o.indent||t[parseInt(r.toString(),10)].indent<o.indent){delete this.captionCounts[this.parent.pageSettings.currentPage][o.uid];break}t[parseInt(r.toString(),10)].isCaptionRow&&delete this.captionCounts[this.parent.pageSettings.currentPage][t[parseInt(r.toString(),10)].uid]}if(o.isExpand){var s=this.parent.getRowElementByUID(o.uid);if(!s)return;this.parent.groupModule.expandCollapseRows(s.querySelector(".e-recordplusexpand"))}var a,s=this.getNextChilds(n);s.length&&(n=[],s[s.length-1].isCaptionRow&&(n=this.getChildRowsByParentIndex(t.indexOf(s[s.length-1]),!1,!1,null,!0,!0)),a=t.indexOf(s[0]),n=n.length?t.indexOf(n[n.length-1]):t.indexOf(s[s.length-1]),t.splice(a,n-(a-1)),this.refreshCaches())}}},NK.prototype.refreshCaches=function(){var e=this.parent.pageSettings.currentPage,t=this.groupCache[parseInt(e.toString(),10)];this.parent.enableInfiniteScrolling?(this.rowsByUid[parseInt(e.toString(),10)]=[],this.objIdxByUid[parseInt(e.toString(),10)]=[]):(this.rowsByUid={},this.objIdxByUid={});for(var i=0;i<t.length;i++)this.maintainRows(t[parseInt(i.toString(),10)],i)},NK.prototype.getInitialCaptionIndexes=function(){for(var e=this.parent.pageSettings.currentPage,t=[],i=0;i<this.initialGroupCaptions[parseInt(e.toString(),10)].length;i++)t.push(this.initialGroupCaptions[parseInt(e.toString(),10)][parseInt(i.toString(),10)].uid);return t},NK.prototype.getRowObjectIndexByUid=function(e){return this.objIdxByUid[this.parent.pageSettings.currentPage][""+e]},NK.prototype.collapseShortcut=function(e){var t,i,n;this.parent.groupSettings.columns.length&&e.target&&A(e.target,WE)&&"TR"===e.target.parentElement.tagName&&(!e.collapse&&A(e.target,UE)||(t=e.target.parentElement.getAttribute("data-uid"),e.collapse?(e=this.getRowByUid(t),(i=this.getRowByUid(e.parentUid)).isCaptionRow&&i.isExpand&&(n=this.getRowElementByUid(e.parentUid),this.parent.groupModule.expandCollapseRows(n.cells[e.indent-1]))):(i=this.getRowByUid(t)).isCaptionRow&&!i.isExpand&&(n=this.getRowElementByUid(t),this.parent.groupModule.expandCollapseRows(n.cells[i.indent]))))},NK.prototype.getRowByUid=function(e){return this.rowsByUid[this.parent.pageSettings.currentPage][""+e]},NK.prototype.actionBegin=function(t){if(!t.cancel){if(this.requestType.some(function(e){return e===t.requestType})||(this.groupCache={},this.resetRowMaintenance(),this.parent.enableVirtualization&&(this.parent.contentModule.currentInfo={})),"reorder"===t.requestType&&this.parent.groupSettings.columns.length)for(var e=Object.keys(this.groupCache),i=0;i<e.length;i++)for(var n,o,r=this.groupCache[e[parseInt(i.toString(),10)]],s=0;s<r.length;s++)r[parseInt(s.toString(),10)].isCaptionRow&&!this.captionModelGen.isEmpty()&&this.changeCaptionRow(r[parseInt(s.toString(),10)],null,e[parseInt(i.toString(),10)]),r[parseInt(s.toString(),10)].isDataRow&&(n=t.fromIndex+r[parseInt(s.toString(),10)].indent,o=t.toIndex+r[parseInt(s.toString(),10)].indent,this.moveCells(r[parseInt(s.toString(),10)].cells,n,o));("delete"===t.requestType||"add"===t.action&&"save"===t.requestType)&&(this.groupCache={},this.resetRowMaintenance(),this.parent.enableVirtualization)&&(this.parent.contentModule.currentInfo={})}},NK.prototype.actionComplete=function(e){e.cancel||"columnstate"===e.requestType||"beginEdit"===e.requestType||"delete"===e.requestType||"save"===e.requestType||"reorder"===e.requestType||"infiniteScroll"===e.requestType||this.scrollReset()},NK.prototype.resetRowMaintenance=function(){this.startIndexes={},this.captionCounts={},this.rowsByUid={},this.objIdxByUid={},this.initialGroupCaptions={}},NK.prototype.moveCells=function(e,t,i){if(t>=e.length)for(var n=t-e.length;1+n--;)e.push(void 0);e.splice(t,0,e.splice(i,1)[0])},NK.prototype.removeRows=function(e,t,i){var n,o,r,s=this.parent.pageSettings.currentPage,a=this.groupCache[parseInt(s.toString(),10)],l=[].slice.call(this.parent.getContent().querySelectorAll("tr")),h=0,d=(this.parent.aggregates.length&&(o=(n=this.getAggregateByCaptionIndex(e)).length?n[n.length-1].uid:void 0),a[parseInt(e.toString(),10)].indent);this.addClass(this.getNextChilds(parseInt(e.toString(),10))),a[parseInt(e.toString(),10)].isExpand=!1,this.rowsByUid[parseInt(s.toString(),10)][a[parseInt(e.toString(),10)].uid]&&(this.rowsByUid[parseInt(s.toString(),10)][a[parseInt(e.toString(),10)].uid].isExpand=!1);for(var p=e+1;p<a.length;p++){if(a[parseInt(p.toString(),10)].indent===d||a[parseInt(p.toString(),10)].indent<d){r=a[parseInt(p.toString(),10)].uid;break}a[parseInt(p.toString(),10)].isCaptionRow&&a[parseInt(p.toString(),10)].isExpand&&this.addClass(this.getNextChilds(p))}for(p=t+1;p<l.length&&l[parseInt(p.toString(),10)].getAttribute("data-uid")!==r;p++){if(l[parseInt(p.toString(),10)].getAttribute("data-uid")===o){ue(l[parseInt(p.toString(),10)]);break}ue(l[parseInt(p.toString(),10)]),this.refRowsObj[parseInt(s.toString(),10)].splice(t+1,1),h+=1}this.parent.enableVirtualization&&(this.cacheRowsObj[""+i]=this.groupCache[parseInt(s.toString(),10)].slice(e+1,e+1+h),this.groupCache[parseInt(s.toString(),10)].splice(e+1,h),this.parent.notify(gE,{rows:[],uid:a[parseInt(e.toString(),10)].uid,count:h}),this.parent.contentModule.setVirtualHeight(),this.parent.islazyloadRequest=!1),this.parent.scrollModule.content.scrollTop>this.scrollTopCache&&!this.parent.enableVirtualization&&(this.parent.scrollModule.content.scrollTop=this.scrollTopCache),this.parent.getContentTable().scrollHeight<this.parent.getContent().clientHeight&&"auto"!==this.parent.height&&this.parent.scrollModule.setLastRowCell(),this.parent.notify(QT,{rows:this.refRowsObj[parseInt(s.toString(),10)]})},NK.prototype.addClass=function(e){e=e[this.blockSize];e&&(e.lazyLoadCssClass="e-lazyload-middle-down")},NK.prototype.getNextChilds=function(e,t){for(var i=this.groupCache[this.parent.pageSettings.currentPage],n=t||i,o=i[parseInt(e.toString(),10)].indent+1,r=[],s=t?0:e+1;s<n.length&&!(n[parseInt(s.toString(),10)].indent<o);s++)n[parseInt(s.toString(),10)].indent===o&&r.push(n[parseInt(s.toString(),10)]);return r},NK.prototype.lazyLoadHandler=function(e){this.setStartIndexes();var t=this.parent.getContent().querySelectorAll("tr")[e.index],i=t.getAttribute("data-uid"),n=this.getRowObjectIndexByUid(i),o=this.groupCache[this.parent.pageSettings.currentPage][parseInt(n.toString(),10)],r=e.isRowExist?e.isScroll?this.scrollData:this.parent.enableVirtualization?this.cacheRowsObj[""+i]:this.getChildRowsByParentIndex(n,!0,!0,null,!0):[];if(this.scrollData=[],!e.isRowExist)if(this.setRowIndexes(n,o),this.refreshCaptionRowCount(this.groupCache[this.parent.pageSettings.currentPage][parseInt(n.toString(),10)],e.count),-1!==Object.keys(e.data).indexOf("GroupGuid"))for(var s=0;s<e.data.length;s++){var a=this.groupGenerator.generateCaptionRow(e.data[parseInt(s.toString(),10)],e.level,o.parentGid,void 0,0,o.uid);r.push(a),this.parent.aggregates.length&&(r=r.concat(this.summaryModelGen.generateRows(e.data[parseInt(s.toString(),10)],{level:e.level+1,parentUid:a.uid})))}else this.groupGenerator.index=this.getStartIndex(n,e.isScroll),r=this.groupGenerator.generateDataRows(e.data,e.level,o.parentGid,0,o.uid);var l=e.isScroll?this.rowIndex:e.index,h=this.getNextChilds(n,r),d=!!e.up||this.hasLastChildRow(e.isScroll,e.count,h.length),h=(e.isRowExist||d||(h[this.blockSize].lazyLoadCssClass="e-lazyload-middle-down"),d||(h[h.length-1].lazyLoadCssClass="e-not-lazyload-end"),e.isScroll||e.isRowExist?[]:this.getAggregateByCaptionIndex(n));e.up||(!e.isRowExist||this.parent.enableVirtualization&&e.isRowExist&&this.cacheRowsObj[""+i])&&this.refreshRowObjects(r,e.isScroll?this.rowObjectIndex:n),this.parent.enableVirtualization&&(i=(e.isScroll?this.groupCache[this.parent.pageSettings.currentPage][this.rowIndex]:o).uid,this.parent.notify(gE,{rows:r,uid:i}),this.parent.contentModule.setVirtualHeight(),this.parent.contentModule.isTop=!1),this.render(l,r,d,h),this.isFirstChildRow&&!e.up&&(this.parent.getContent().firstElementChild.scrollTop=r.length*this.parent.getRowHeight()),this.isFirstChildRow=!1,this.rowIndex=void 0,this.rowObjectIndex=void 0;for(s=this.childCount=0;s<r.length;s++)this.refRowsObj[this.parent.pageSettings.currentPage].splice(n+s+1,0,r[parseInt(s.toString(),10)]);d&&t.querySelector(".e-lastrowcell")&&this.parent.groupModule.lastCaptionRowBorder(),this.parent.notify(QT,{rows:this.refRowsObj[this.parent.pageSettings.currentPage]}),this.parent.enableVirtualMaskRow&&this.parent.removeMaskRow()},NK.prototype.setRowIndexes=function(e,t){this.captionCounts[this.parent.pageSettings.currentPage]||(this.captionCounts[this.parent.pageSettings.currentPage]={}),t.isCaptionRow&&(this.captionCounts[this.parent.pageSettings.currentPage][t.uid]=t.data.count)},NK.prototype.getStartIndex=function(e,t){var i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)];if(t)return n[this.rowObjectIndex].index+1;var o=0,t=0,r=this.getRowByUid(n[parseInt(e.toString(),10)].parentUid);if(r&&(t=this.prevCaptionCount(r)),0<n[parseInt(e.toString(),10)].indent)for(var s=e-1;0<=s&&!(n[parseInt(s.toString(),10)].indent<n[parseInt(e.toString(),10)].indent);s--)n[parseInt(s.toString(),10)].isCaptionRow&&n[parseInt(s.toString(),10)].indent===n[parseInt(e.toString(),10)].indent&&(o+=n[parseInt(s.toString(),10)].data.count);return o+t+this.startIndexes[parseInt(i.toString(),10)][n[parseInt(e.toString(),10)].parentGid]},NK.prototype.prevCaptionCount=function(e){for(var t=this.parent.pageSettings.currentPage,i=this.groupCache[parseInt(t.toString(),10)],n=0,o=i.indexOf(e)-1;0<=o&&0!==i[parseInt(o.toString(),10)].indent&&!(i[parseInt(o.toString(),10)].indent<e.indent);o--)i[parseInt(o.toString(),10)].isCaptionRow&&i[parseInt(o.toString(),10)].indent===e.indent&&(n+=this.captionCounts[parseInt(t.toString(),10)][i[parseInt(o.toString(),10)].uid]||i[parseInt(o.toString(),10)].data.count);var r=this.getRowByUid(e.parentUid);return r&&(n+=this.prevCaptionCount(r)),n},NK.prototype.setStartIndexes=function(){var e=this.groupCache[this.parent.pageSettings.currentPage];if(!this.startIndexes[this.parent.pageSettings.currentPage]){for(var t=[],i=void 0,n=0;n<e.length;n++)e[parseInt(n.toString(),10)].isCaptionRow&&(t.push(t.length?e[parseInt(i.toString(),10)].data.count+t[t.length-1]:0),i=n);this.startIndexes[this.parent.pageSettings.currentPage]=t}},NK.prototype.hasLastChildRow=function(e,t,i){return e?t===this.childCount+i:t===i},NK.prototype.refreshCaptionRowCount=function(e,t){e.data.count=t},NK.prototype.render=function(e,t,i,n){var o=this.parent.getContent().querySelectorAll("tr")[parseInt(e.toString(),10)],r=this.parent.getContent().firstElementChild,s=this.parent.getRowHeight();if(o&&n.length)for(var a=n.length-1;0<=a;a--)o.insertAdjacentElement("afterend",this.rowRenderer.render(n[parseInt(a.toString(),10)],this.parent.getColumns()));if(o&&t.length)for(a=t.length-1;0<=a;a--)this.confirmRowRendering(t[parseInt(a.toString(),10)])&&(o.insertAdjacentElement("afterend",this.rowRenderer.render(t[parseInt(a.toString(),10)],this.parent.getColumns())),this.isScrollDown&&(r.scrollTop=r.scrollTop-s),this.isScrollUp)&&(r.scrollTop=r.scrollTop+s);this.isScrollDown=!1,this.isScrollUp=!1},NK.prototype.maintainRows=function(e,t){var i=this.parent.pageSettings.currentPage;this.rowsByUid[parseInt(i.toString(),10)]||(this.rowsByUid[parseInt(i.toString(),10)]={},this.objIdxByUid[parseInt(i.toString(),10)]={}),e.uid&&(this.rowsByUid[parseInt(i.toString(),10)][e.uid]=e),this.objIdxByUid[parseInt(i.toString(),10)][e.uid]=t},NK.prototype.confirmRowRendering=function(e){var t=!0;return!je(e.indent)||e.isDataRow||e.isCaptionRow||(e=this.getRowByUid(e.parentUid)).isCaptionRow&&!e.isExpand&&(t=!1),t},NK.prototype.refreshRowObjects=function(e,t){for(var i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)],o=(this.rowsByUid[parseInt(i.toString(),10)]={},this.objIdxByUid[parseInt(i.toString(),10)]={},[]),r=0,s=0;s<n.length;s++)if(s===t){this.maintainRows(n[parseInt(s.toString(),10)],r),o.push(n[parseInt(s.toString(),10)]),r++;for(var a=0;a<e.length;a++)this.maintainRows(e[parseInt(a.toString(),10)],r),o.push(e[parseInt(a.toString(),10)]),r++}else this.maintainRows(n[parseInt(s.toString(),10)],r),o.push(n[parseInt(s.toString(),10)]),r++;this.groupCache[this.parent.pageSettings.currentPage]=Pe([],o),this.updateCurrentViewData()},NK.prototype.getAggregateByCaptionIndex=function(e){for(var t=this.groupCache[this.parent.pageSettings.currentPage],i=t[parseInt(e.toString(),10)],n=i.indent,o=i.uid,r=[],s=e+1;s<t.length&&t[parseInt(s.toString(),10)].indent!==n;s++)je(t[parseInt(s.toString(),10)].indent)&&t[parseInt(s.toString(),10)].parentUid===o&&r.push(t[parseInt(s.toString(),10)]);return r},NK.prototype.getChildRowsByParentIndex=function(e,t,i,n,o,r){var s=n||this.groupCache[this.parent.pageSettings.currentPage],a=s[parseInt(e.toString(),10)],l=[];if(!a.isCaptionRow||a.isCaptionRow&&!a.isExpand&&!r)return[];o&&this.parent.aggregates.length&&(l=this.getAggregateByCaptionIndex(e));for(var h=a.indent,d=a.uid,p=[],c=0,u=e+1;u<s.length;u++){if(s[parseInt(u.toString(),10)].parentUid===d){if(je(s[parseInt(u.toString(),10)].indent))continue;if(c++,p.push(s[parseInt(u.toString(),10)]),t&&s[parseInt(u.toString(),10)].isCaptionRow&&(p=p.concat(this.getChildRowsByParentIndex(u,t,i,n,o))),i&&c===this.pageSize)break}if(s[parseInt(u.toString(),10)].indent===h)break}return p.concat(l)},NK.prototype.initialGroupRows=function(e){var t=[],i=this.groupCache[this.parent.pageSettings.currentPage];if(e)return this.getRenderedRowsObject();for(var n=0;n<i.length;n++)0===i[parseInt(n.toString(),10)].indent&&(t.push(i[parseInt(n.toString(),10)]),t=t.concat(this.getChildRowsByParentIndex(n,!0,!0,i,!0)));return t},NK.prototype.getRenderedRowsObject=function(){for(var e=[],t=[].slice.call(this.parent.getContent().querySelectorAll("tr")),i=0;i<t.length;i++)e.push(this.getRowByUid(t[parseInt(i.toString(),10)].getAttribute("data-uid")));return e},NK.prototype.getCacheRowsOnDownScroll=function(e){for(var t=[],i=this.groupCache[this.parent.pageSettings.currentPage],n=e,o=0;o<this.pageSize&&i[parseInt(n.toString(),10)]&&!(i[parseInt(n.toString(),10)].indent<i[parseInt(e.toString(),10)].indent);o++)i[parseInt(n.toString(),10)].indent===i[parseInt(e.toString(),10)].indent&&(t.push(i[parseInt(n.toString(),10)]),i[parseInt(n.toString(),10)].isCaptionRow)&&i[parseInt(n.toString(),10)].isExpand&&(t=t.concat(this.getChildRowsByParentIndex(n,!0,!0,null,!0))),(i[parseInt(n.toString(),10)].indent>i[parseInt(e.toString(),10)].indent||je(i[parseInt(n.toString(),10)].indent))&&o--,n++;return t},NK.prototype.getCacheRowsOnUpScroll=function(e,t,i){for(var n=[],o=this.groupCache[this.parent.pageSettings.currentPage],r=!1,s=0;s<o.length&&(!r||o[parseInt(s.toString(),10)]&&!(o[parseInt(s.toString(),10)].indent<o[parseInt(i.toString(),10)].indent)&&o[parseInt(s.toString(),10)].uid!==t);s++)(r=r||o[parseInt(s.toString(),10)].uid!==e?r:!0)&&o[parseInt(s.toString(),10)].indent===o[parseInt(i.toString(),10)].indent&&(n.push(o[parseInt(s.toString(),10)]),o[parseInt(s.toString(),10)].isCaptionRow)&&o[parseInt(s.toString(),10)].isExpand&&(n=n.concat(this.getChildRowsByParentIndex(s,!0,!0,null,!0)));return n},NK.prototype.scrollHandler=function(e){if(!this.parent.isDestroyed&&!this.childCount){var t,i,n=[].slice.call(this.parent.getContent().getElementsByClassName("e-lazyload-middle-down")),o=[].slice.call(this.parent.getContent().getElementsByClassName("e-lazyload-middle-up")),r=[].slice.call(this.parent.getContent().getElementsByClassName("e-not-lazyload-end")),s=!1,a=!1,l=!1;if(e.scrollDown&&n.length&&(t=(i=this.findRowElements(n)).tr,s=i.entered),!e.scrollDown&&r)for(var h=0;h<r.length;h++){var d=r[parseInt(h.toString(),10)].getBoundingClientRect().top,p=this.parent.getContent().scrollHeight;if(0<d&&d<p){t=r[parseInt(h.toString(),10)],l=!0,this.rowIndex=t.rowIndex;break}}e.scrollDown||!o.length||l||(t=(i=this.findRowElements(o)).tr,a=i.entered),t&&!t.classList.contains("e-masked-row")&&(s&&e.scrollDown&&s&&t&&this.scrollDownHandler(t),!e.scrollDown&&l&&t&&this.scrollUpEndRowHandler(t),this.cacheMode)&&!e.scrollDown&&!l&&a&&t&&this.scrollUpHandler(t)}},NK.prototype.scrollUpEndRowHandler=function(e){var t=this.parent.pageSettings.currentPage,t=this.groupCache[parseInt(t.toString(),10)],i=e.getAttribute("data-uid"),n=this.rowObjectIndex=this.getRowObjectIndexByUid(i),o=n,r=t[parseInt(n.toString(),10)],s=this.getRowByUid(r.parentUid),a=this.getRowObjectIndexByUid(s.uid),l=this.parent.getContent().querySelector("tr[data-uid="+s.uid+"]").rowIndex,h=this.getChildRowsByParentIndex(a).indexOf(r),h=Math.ceil(h/this.pageSize);1!==h&&(this.childCount=h*this.pageSize,n=this.getCurrentBlockEndIndex(r,n),this.childCount<s.data.count?(e.classList.remove("e-not-lazyload-end"),r.lazyLoadCssClass="",h=!!t[n+1]&&r.indent===t[n+1].indent,this.scrollData=h?this.getCacheRowsOnDownScroll(n+1):[],r={rowIndex:l,makeRequest:!h,groupInfo:s,fields:(e=RF(a,t)).fields,keys:e.keys,skip:this.childCount,take:this.pageSize,isScroll:!0},this.cacheMode&&this.childCount>=this.pageSize*this.cacheBlockSize&&(n=this.getChildRowsByParentIndex(a),l=Math.ceil(n.indexOf(t[parseInt(o.toString(),10)])/this.pageSize)-(this.cacheBlockSize-1),this.removeBlock(i,h,l,n),r.cachedRowIndex=l*this.pageSize),this.captionRowExpand(r)):this.childCount=0)},NK.prototype.scrollDownHandler=function(e){var t,i,n=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(n.toString(),10)],o=e.getAttribute("data-uid"),r=this.getRowObjectIndexByUid(o),s=r,a=n[parseInt(r.toString(),10)],l=this.getRowByUid(a.parentUid),h=this.getRowObjectIndexByUid(l.uid),d=this.getRowElementByUid(l.uid).rowIndex,p=this.getChildRowsByParentIndex(h);0===p.length||(t=p.indexOf(a),t=Math.ceil(t/this.pageSize),this.childCount=t*this.pageSize,je(p[this.childCount-1]))||(this.parent.enableVirtualization&&(this.parent.islazyloadRequest=!0),r=this.rowObjectIndex=this.getRowObjectIndexByUid(p[this.childCount-1].uid),p=n[parseInt(r.toString(),10)],i=this.getRowElementByUid(p.uid),this.rowIndex=i.rowIndex,r=this.getCurrentBlockEndIndex(p,r),this.childCount===l.data.count&&(this.parent.islazyloadRequest=!1),this.childCount<l.data.count?(a=!!n[r+1]&&a.indent===n[r+1].indent)&&!je(this.getRowElementByUid(n[r+1].uid))?(this.parent.islazyloadRequest=!1,this.childCount=0):((1<t||!this.cacheMode)&&(e.classList.remove("e-lazyload-middle-down"),i.classList.remove("e-not-lazyload-end"),p.lazyLoadCssClass=""),this.scrollData=a?this.getCacheRowsOnDownScroll(this.rowObjectIndex+1):[],t={rowIndex:d,makeRequest:!a,groupInfo:l,fields:(r=RF(h,n)).fields,keys:r.keys,skip:this.childCount,take:this.pageSize,isScroll:!0},this.cacheMode&&this.childCount-this.pageSize>=this.pageSize*this.cacheBlockSize&&(this.isScrollDown=!0,e=this.getChildRowsByParentIndex(h),i=Math.ceil(e.indexOf(n[parseInt(s.toString(),10)])/this.pageSize)-1-(this.cacheBlockSize-1)+1,this.removeBlock(o,a,i,e,p),t.cachedRowIndex=i*this.pageSize),this.captionRowExpand(t)):(this.childCount=0,this.parent.islazyloadRequest=!1))},NK.prototype.getCurrentBlockEndIndex=function(e,t){var i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)];if(e.isCaptionRow){e.isExpand&&(i=this.getChildRowsByParentIndex(t,!0).length,this.rowIndex=this.rowIndex+i);for(var e=this.getAggregateByCaptionIndex(t),o=(this.rowObjectIndex=this.rowObjectIndex+e.length,t),r=o+1;r<n.length;r++){if(n[parseInt(r.toString(),10)].indent===n[parseInt(t.toString(),10)].indent||n[parseInt(r.toString(),10)].indent<n[parseInt(t.toString(),10)].indent){t=o;break}o++}}return t},NK.prototype.removeBlock=function(e,t,i,n,o){var r=this.parent.pageSettings.currentPage,r=this.groupCache[parseInt(r.toString(),10)],s=n[(i+1)*this.pageSize-1-this.blockSize].uid,a=n[i*this.pageSize-this.pageSize].uid,n=n[i*this.pageSize].uid,i=this.getRowObjectIndexByUid(s);r[parseInt(i.toString(),10)].lazyLoadCssClass="e-lazyload-middle-up",this.getRowElementByUid(s).classList.add("e-lazyload-middle-up"),o&&(this.getRowElementByUid(n).classList.add("e-not-lazyload-first"),this.getRowByUid(n).lazyLoadCssClass="e-not-lazyload-first",this.getRowByUid(a).lazyLoadCssClass=""),t?this.removeTopRows(o?o.uid:e,a,n):(this.uid1=a,this.uid2=n,this.uid3=o?o.uid:e)},NK.prototype.scrollUpHandler=function(e){var t,i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)],o=e.getAttribute("data-uid"),r=this.getRowByUid(o),o=this.rowObjectIndex=this.getRowObjectIndexByUid(o),r=this.getRowByUid(r.parentUid),s=this.rowIndex=this.getRowObjectIndexByUid(r.uid),a=this.parent.getRowElementByUID(r.uid).rowIndex,s=this.getChildRowsByParentIndex(s),l=s.indexOf(n[parseInt(o.toString(),10)]),h=Math.floor(l/this.pageSize),d=this.blockSize,p=(2*this.blockSize>this.pageSize&&(d=2*this.blockSize-this.pageSize,d=this.blockSize-d),s[l-(d-1)-this.pageSize].uid),l=s[l-(d-1)].uid,o=(this.scrollData=this.getCacheRowsOnUpScroll(p,l,o-(d-1)),this.isFirstChildRow=1<h,this.isFirstChildRow&&(this.scrollData[0].lazyLoadCssClass="e-not-lazyload-first"),this.getRowByUid(l).lazyLoadCssClass="",this.getRowElementByUid(l).classList.remove("e-not-lazyload-first"),h+this.cacheBlockSize);s.length!==r.data.count&&o*this.pageSize>s.length?(this.isFirstChildRow=!1,this.scrollData[0].lazyLoadCssClass="",this.getRowElementByUid(l).classList.add("e-not-lazyload-first")):(h=o*this.pageSize>r.data.count?r.data.count:o*this.pageSize,l=o*this.pageSize>r.data.count?this.pageSize-(this.pageSize*o-r.data.count):this.pageSize,o=((o=this.getChildRowsByParentIndex(n.indexOf(s[h-1]),!0,!1,null,!0)).length?o[o.length-1]:s[h-1]).uid,t=s[h-l].uid,s=s[h-l-1].uid,h=this.objIdxByUid[parseInt(i.toString(),10)][""+t]-d,"e-lazyload-middle-down"===n[parseInt(h.toString(),10)].lazyLoadCssClass&&(l=this.getRowElementByUid(n[parseInt(h.toString(),10)].uid))&&l.classList.add("e-lazyload-middle-down"),this.getRowByUid(o).lazyLoadCssClass="",this.getRowByUid(s).lazyLoadCssClass="e-not-lazyload-end",this.getRowElementByUid(s).classList.add("e-not-lazyload-end"),this.removeBottomRows(o,t,s),this.rowIndex=e.rowIndex-d,1<e.classList.length?e.classList.remove("e-lazyload-middle-up"):e.removeAttribute("class"),je(this.getRowElementByUid(p))?(h={rowIndex:a,makeRequest:!1,groupInfo:r,fields:(i=RF(this.getRowObjectIndexByUid(r.uid),n)).fields,keys:i.keys,skip:this.childCount,take:this.pageSize,isScroll:!0,scrollUp:!0},this.isScrollUp=!0,this.captionRowExpand(h)):(this.childCount=0,this.scrollData=[]))},NK.prototype.findRowElements=function(e){for(var t,i=!1,n=0;n<e.length;n++){var o,r=e[parseInt(n.toString(),10)].rowIndex;if(this.parent.enableVirtualization&&(o=this.parent.contentModule.currentInfo)&&o.blockIndexes&&1<o.blockIndexes[0]&&(r+=this.parent.contentModule.offsets[o.blockIndexes[0]-1]/this.parent.getRowHeight()),XB(r,this.parent)){i=!0,this.rowIndex=r,t=e[parseInt(n.toString(),10)];break}}return{entered:i,tr:t}},NK.prototype.getRowElementByUid=function(e){return this.parent.getContent().querySelector("tr[data-uid="+e+"]")},NK.prototype.removeTopRows=function(e,t,i){for(var n=[].slice.call(this.parent.getContent().querySelectorAll("tr")),o=!1,r=0;r<n.length;r++){if(n[parseInt(r.toString(),10)].getAttribute("data-uid")===i){var s=this.parent.getContent().querySelector("tr[data-uid="+e+"]");s&&(this.rowIndex=s.rowIndex);break}(o=n[parseInt(r.toString(),10)].getAttribute("data-uid")===t?!0:o)&&ue(n[parseInt(r.toString(),10)])}},NK.prototype.removeBottomRows=function(e,t,i){for(var n=[].slice.call(this.parent.getContent().querySelectorAll("tr")),o=!1,r=0;r<n.length&&(!(o=n[parseInt(r.toString(),10)].getAttribute("data-uid")===t||o)||(ue(n[parseInt(r.toString(),10)]),n[parseInt(r.toString(),10)].getAttribute("data-uid")!==e));r++);},NK.prototype.setCache=function(e){var t=this.parent.pageSettings.currentPage;if(this.parent.enableVirtualization&&(this.parent.lazyLoadRender=this),this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType&&e.args.prevPage!==e.args.currentPage){this.groupCache[parseInt(t.toString(),10)]=this.initialGroupCaptions[parseInt(t.toString(),10)]=this.groupCache[e.args.prevPage].concat(Pe([],e.data));for(var i=Object.keys(this.groupCache),n=0;n<i.length;n++)e.args.currentPage!==parseInt(i[parseInt(n.toString(),10)],10)&&(delete this.groupCache[""+i[parseInt(n.toString(),10)]],delete this.initialGroupCaptions[""+i[parseInt(n.toString(),10)]])}else this.groupCache[parseInt(t.toString(),10)]=this.initialGroupCaptions[parseInt(t.toString(),10)]=Pe([],e.data)},NK.prototype.captionRowExpand=function(t){var e,i=this,n=t.groupInfo,o=this.parent.groupSettings.columns.indexOf(n.data.field)+1,n=LF(FF(t.fields,t.keys,this)),n={level:o,skip:t.skip,take:t.take,where:n};t.lazyLoadQuery=n,t.requestType="onDemandGroupInfo",t.makeRequest?((e=this.parent.renderModule.data.generateQuery(!0)).isCountRequired||(e.isCountRequired=!0),e.lazyLoad.push({key:"onDemandGroupInfo",value:n}),this.lazyLoadQuery.push(n.where),t.isScroll&&this.parent.enableVirtualMaskRow?this.parent.showMaskRow():this.parent.showSpinner(),this.parent.renderModule.data.getData(t,e).then(function(e){i.parent.enableVirtualization&&(i.parent.islazyloadRequest=!0),i.parent.hideSpinner(),i.parent.removeMaskRow(),0!==e.result.length&&(i.cacheMode&&i.uid1&&i.uid2&&(i.removeTopRows(i.uid3,i.uid1,i.uid2),i.uid1=i.uid2=i.uid3=void 0),i.lazyLoadHandler({data:e.result,count:e.count,level:o,index:t.rowIndex,isRowExist:!1,isScroll:t.isScroll,up:!1,rowIndex:t.cachedRowIndex}))}).catch(function(e){return i.parent.renderModule.dataManagerFailure(e,{requestType:"grouping"})})):this.lazyLoadHandler({data:null,count:t.groupInfo.data.count,level:o,index:t.rowIndex,isRowExist:!0,isScroll:t.isScroll,up:t.scrollUp,rowIndex:t.cachedRowIndex})},NK.prototype.scrollReset=function(e){this.parent.getContent().firstElementChild.scrollTop=e?this.parent.getContent().firstElementChild.scrollTop+e:0},NK.prototype.updateCurrentViewData=function(){var t=[];this.getRows().filter(function(e){e.isDataRow&&(t[e.index]=e.data)}),this.parent.currentViewData=t.length?t:this.parent.currentViewData},NK.prototype.getGroupCache=function(){return this.groupCache},NK.prototype.getRows=function(){return this.groupCache[this.parent.pageSettings.currentPage]||[]},NK.prototype.getRowElements=function(){return[].slice.call(this.parent.getContent().getElementsByClassName(UE))},NK.prototype.getRowByIndex=function(e){for(var t,i=[].slice.call(this.parent.getContent().getElementsByClassName(UE)),n=0;!je(e)&&n<i.length;n++)if(parseInt(i[parseInt(n.toString(),10)].getAttribute(nD).toString(),10)-1===e){t=i[parseInt(n.toString(),10)];break}return t},NK.prototype.setVisible=function(e){for(var t,i=this.parent,n=(this.getRows().some(function(e){return e.isDataRow&&(t=e),e.isDataRow}),this.getRows().filter(function(e){return!e.isDetailRow})),o=0;o<e.length;o++){var r=e[parseInt(o.toString(),10)],s=this.parent.getNormalizedColumnIndex(r.uid),a=this.parent.getColumnIndexByUid(r.uid),l=!0===r.visible?"":"none";-1!==s&&t&&s<t.cells.length&&gt(this.getColGroup().childNodes[parseInt(s.toString(),10)],{display:l}),this.setDisplayNone(i.getDataRows(),a,l,n,s),!this.parent.invokedFromMedia&&r.hideAtMedia&&this.parent.updateMediaColumns(r),this.parent.invokedFromMedia=!1}},NK.prototype.setDisplayNone=function(e,t,i,n,o){if(this.parent.groupSettings.columns.length)for(var r=Object.keys(this.groupCache),s=0;s<r.length;s++)for(var a=this.rowsByUid[r[parseInt(s.toString(),10)]],l=Object.keys(a),h=0;h<l.length;h++){var d=this.parent.getContent().querySelector("tr[data-uid="+l[parseInt(h.toString(),10)]+"]"),p=a[l[parseInt(h.toString(),10)]];p.isCaptionRow&&(this.captionModelGen.isEmpty()?(p.cells[p.indent+1].colSpan=""===i?p.cells[p.indent+1].colSpan+1:p.cells[p.indent+1].colSpan-1,d&&(d.cells[p.indent+1].colSpan=p.cells[p.indent+1].colSpan)):this.changeCaptionRow(p,d,r[parseInt(s.toString(),10)])),p.isDataRow&&(this.showAndHideCells(d,t,i,!1),p.cells[parseInt(o.toString(),10)].visible=""===i),p.isCaptionRow||p.isDataRow||!je(p.indent)||(p.cells[parseInt(o.toString(),10)].visible=""===i,p.visible=p.cells.some(function(e){return e.isDataCell&&e.visible}),this.showAndHideCells(d,t,i,!0,p))}else wF(e,t,i,n)},NK.prototype.changeCaptionRow=function(e,t,i){var n=e.data,n=this.groupGenerator.generateCaptionRow(n,e.indent,e.parentGid,void 0,e.tIndex,e.parentUid);n.uid=e.uid,n.isExpand=e.isExpand,n.lazyLoadCssClass=e.lazyLoadCssClass,this.rowsByUid[parseInt(i.toString(),10)][e.uid]=n,this.groupCache[parseInt(i.toString(),10)][this.objIdxByUid[parseInt(i.toString(),10)][e.uid]]=n,t&&this.parent.getContentTable().querySelector(oD).replaceChild(this.rowRenderer.render(n,this.parent.getColumns()),t)},NK.prototype.showAndHideCells=function(e,t,i,n,o){var r;e&&(gt(e.querySelectorAll(r=n?"td.e-summarycell":"td.e-rowcell")[parseInt(t.toString(),10)],{display:i}),e.querySelectorAll(r)[parseInt(t.toString(),10)].classList.contains("e-hide")&&q([e.querySelectorAll(r)[parseInt(t.toString(),10)]],["e-hide"]),n)&&(o.visible&&e.classList.contains("e-hide")?q([e],["e-hide"]):o.visible||U([e],["e-hide"]))};var LK,RK,OK=NK;function NK(e,t){e=RK.call(this,e,t)||this;return e.childCount=0,e.scrollData=[],e.isFirstChildRow=!1,e.isScrollDown=!1,e.isScrollUp=!1,e.groupCache={},e.cacheRowsObj={},e.startIndexes={},e.captionCounts={},e.rowsByUid={},e.objIdxByUid={},e.initialGroupCaptions={},e.requestType=["paging","columnstate","reorder","cancel","save","beginEdit","add","delete","filterBeforeOpen","filterchoicerequest","infiniteScroll","virtualscroll"],e.scrollTopCache=void 0,e.refRowsObj={},e.cacheMode=!1,e.cacheBlockSize=5,e.ignoreAccent=!!e.parent.allowFiltering&&e.parent.filterSettings.ignoreAccent,e.allowCaseSensitive=!1,e.lazyLoadQuery=[],e.locator=t,e.groupGenerator=new BD(e.parent),e.summaryModelGen=new ID(e.parent),e.captionModelGen=new DD(e.parent),e.rowRenderer=new yD(e.locator,null,e.parent),e.eventListener(),e}VK.prototype.getModuleName=function(){return"lazyLoadGroup"},VK.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(q1,this.instantiateRenderer,this),this.parent.on(Cx,this.destroy,this))},VK.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(q1,this.instantiateRenderer),this.parent.off(Cx,this.destroy))},VK.prototype.instantiateRenderer=function(){"auto"===this.parent.height&&(this.parent.height=this.parent.pageSettings.pageSize*this.parent.getRowHeight());var e=this.serviceLocator.getService("rendererFactory");this.parent.groupSettings.enableLazyLoading&&e.addRenderer(RA.Content,new OK(this.parent,this.serviceLocator)),this.parent.enableVirtualization&&(this.parent.lazyLoadRender=new OK(this.parent,this.serviceLocator))},VK.prototype.destroy=function(){this.removeEventListener()};pX=VK;function VK(e,t){this.parent=e,this.serviceLocator=t,this.addEventListener()}_K=function(e,t){return(_K=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}_K(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(jK,HK=f7),jK.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.object=new lU(Pe({dataSource:this.parent.dataSource instanceof me?this.parent.dataSource:new me(this.parent.dataSource),query:(new ya).select(e.column.field),enabled:uB(e.column,e.requestType,e.element),fields:{value:e.column.field},value:FB(e.column.field,e.rowData),actionComplete:this.selectedValues.bind(this),placeholder:t?"":e.column.headerText,floatLabelType:t?"Never":"Always"},e.column.edit.params)),this.object.appendTo(e.element),e.element.setAttribute("name",dB(e.column.field))},jK.prototype.selectedValues=function(e){e.result=Sa.distinct(e.result,this.object.fields.value,!0),this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result)};var _K,HK,zK=jK;function jK(){return null!==HK&&HK.apply(this,arguments)||this}WK=function(e,t){return(WK=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}WK(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(qK,QK=f7),qK.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.obj=new oU(Pe({dataSource:this.parent.dataSource instanceof me?this.parent.dataSource:new me(this.parent.dataSource),query:(new ya).select(e.column.field),fields:{value:e.column.field},value:FB(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,actionComplete:this.finalValue.bind(this),placeholder:t?"":e.column.headerText,floatLabelType:t?"Never":"Always",enabled:uB(e.column,e.requestType,e.element),cssClass:this.parent.cssClass||null},e.column.edit.params)),this.obj.appendTo(e.element)},qK.prototype.finalValue=function(e){e.result=Sa.distinct(e.result,this.obj.fields.value,!0),this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result)};var WK,QK,UK=qK;function qK(){return null!==QK&&QK.apply(this,arguments)||this}GK=function(e,t){return(GK=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}GK(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(KK,YK=f7),KK.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.obj=new zU(Pe({fields:{text:e.column.field,value:e.column.field},value:R(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,placeholder:t?"":e.column.headerText,popupHeight:"200px",floatLabelType:t?"Never":"Always",cssClass:this.parent.cssClass||null},e.column.edit.params)),this.obj.appendTo(e.element),e.element.setAttribute("name",dB(e.column.field))};var GK,YK,XK=KK;function KK(){return null!==YK&&YK.apply(this,arguments)||this}JK=function(e,t){return(JK=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}JK(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(eJ,ZK=f7),eJ.prototype.write=function(e){var t="Dialog"!==this.parent.editSettings.mode,i=(i=FB(e.column.field,e.rowData))?new Date(i):null;this.obj=new wq(Pe({floatLabelType:t?"Never":"Always",value:i,placeholder:t?"":e.column.headerText,enableRtl:this.parent.enableRtl,enabled:uB(e.column,e.requestType,e.element)&&gB(A(e.element,"e-rowcell")),cssClass:this.parent.cssClass||null},e.column.edit.params)),this.obj.appendTo(e.element)};var JK,ZK,$K=eJ;function eJ(){return null!==ZK&&ZK.apply(this,arguments)||this}tJ=function(e,t){return(tJ=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}tJ(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(oJ,iJ=f7),oJ.prototype.create=function(e){var t="e-field e-boolcell";return"checkbox"===e.column.type&&(t="e-field e-boolcell e-edit-checkselect"),SF(this.parent,e.column,t,{type:"checkbox",value:e.value})},oJ.prototype.read=function(e){return e.checked},oJ.prototype.write=function(e){var t=!je(e.row)&&e.row.querySelector(".e-edit-checkselect"),i=FB(e.column.field,e.rowData),i=i&&JSON.parse(i.toString().toLowerCase());je(t)||(this.editType=this.parent.editSettings.mode,this.editRow=e.row,"add"!==e.requestType&&(i=!!(t=this.parent.getRowObjectFromUID(e.row.getAttribute("data-uid")))&&t.isSelected),vB.apply(void 0,[[].slice.call(e.row.getElementsByClassName(LE)),i].concat(this.activeClasses))),this.obj=new Ab(Pe({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:i,disabled:!uB(e.column,e.requestType,e.element),enableRtl:this.parent.enableRtl,change:this.switchModeChange.bind(this),cssClass:this.parent.cssClass||""},e.column.edit.params)),this.obj.appendTo(e.element)},oJ.prototype.switchModeChange=function(e){var t;this.editRow&&"Dialog"!==this.editType&&(t=!1,e.checked?this.editRow.setAttribute("aria-selected",(t=!0).toString()):this.editRow.removeAttribute("aria-selected"),vB.apply(void 0,[[].slice.call(this.editRow.getElementsByClassName(LE)),t].concat(this.activeClasses)))};var tJ,iJ,nJ=oJ;function oJ(){var e=null!==iJ&&iJ.apply(this,arguments)||this;return e.activeClasses=["e-selectionbackground","e-active"],e}rJ=function(e,t){return(rJ=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}rJ(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(lJ,sJ=f7),lJ.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.obj=new LR(Pe({fields:{value:e.column.field},value:FB(e.column.field,e.rowData),floatLabelType:t?"Never":"Always",mask:"000-000-0000",enabled:uB(e.column,e.requestType,e.element)&&gB(A(e.element,"e-rowcell")),cssClass:this.parent.cssClass||null},e.column.edit.params)),this.obj.appendTo(e.element)};var rJ,sJ,aJ=lJ;function lJ(){return null!==sJ&&sJ.apply(this,arguments)||this}hJ=function(e,t){return(hJ=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])}))(e,t)};var hJ,dJ,pJ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},pJ=(function(e,t){function i(){this.constructor=e}hJ(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(cJ,dJ=n),pJ([e("Spinner")],cJ.prototype,"indicatorType",void 0),cJ);function cJ(){return null!==dJ&&dJ.apply(this,arguments)||this}uJ=function(e,t){return(uJ=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])}))(e,t)};var uJ,gJ,mJ=function(e,t){function i(){this.constructor=e}uJ(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},fJ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},yJ=(mJ(vJ,gJ=n),fJ([e()],vJ.prototype,"field",void 0),fJ([e()],vJ.prototype,"operator",void 0),fJ([e()],vJ.prototype,"value",void 0),fJ([e()],vJ.prototype,"matchCase",void 0),fJ([e()],vJ.prototype,"ignoreAccent",void 0),fJ([e()],vJ.prototype,"predicate",void 0),fJ([e({})],vJ.prototype,"actualFilterValue",void 0),fJ([e({})],vJ.prototype,"actualOperator",void 0),fJ([e()],vJ.prototype,"type",void 0),fJ([e()],vJ.prototype,"ejpredicate",void 0),fJ([e()],vJ.prototype,"uid",void 0),fJ([e()],vJ.prototype,"isForeignKey",void 0),vJ);function vJ(){return null!==gJ&&gJ.apply(this,arguments)||this}mJ(wJ,bJ=n),fJ([kt([],yJ)],wJ.prototype,"columns",void 0),fJ([e("FilterBar")],wJ.prototype,"type",void 0),fJ([e()],wJ.prototype,"mode",void 0),fJ([e(!0)],wJ.prototype,"showFilterBarStatus",void 0),fJ([e(1500)],wJ.prototype,"immediateModeDelay",void 0),fJ([e()],wJ.prototype,"operators",void 0),fJ([e(!1)],wJ.prototype,"ignoreAccent",void 0),fJ([e("Parent")],wJ.prototype,"hierarchyMode",void 0);var bJ,mJ=wJ;function wJ(){return null!==bJ&&bJ.apply(this,arguments)||this}CJ=function(e,t){return(CJ=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])}))(e,t)};var CJ,SJ,fJ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},fJ=(function(e,t){function i(){this.constructor=e}CJ(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(AJ,SJ=n),fJ([e("Both")],AJ.prototype,"wrapMode",void 0),AJ);function AJ(){return null!==SJ&&SJ.apply(this,arguments)||this}var xJ,IJ,TJ="https://ej2.syncfusion.com/documentation/treegrid",EJ="https://ej2.syncfusion.com/documentation",DJ=!(xJ=function(e,t){return(xJ=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])}))(e,t)}),MJ=(function(e,t){function i(){this.constructor=e}xJ(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(kJ,IJ=Bk),kJ.prototype.getModuleName=function(){return"logger"},kJ.prototype.log=function(e,t){for(var i=e=e instanceof Array?e:[e],n=0;n<i.length;n++){var o,r=Ok[i[parseInt(n.toString(),10)]],s=r.check(t,this.parent);s.success&&(s=(s=r.generateMessage(t,this.parent,s.options)).replace("EJ2Grid","EJ2TreeGrid").replace("* Hierarchy Grid","").replace("* Grouping",""),DJ&&"primary_column_missing"===i[parseInt(n.toString(),10)]&&(s=s.replace("Editing","Row DragAndDrop"),DJ=!1),o=s.indexOf("https"),o=s.substring(o),"module_missing"===i[parseInt(n.toString(),10)]?s=s.replace(o,TJ+"/modules"):"primary_column_missing"===i[parseInt(n.toString(),10)]||"selection_key_missing"===i[parseInt(n.toString(),10)]?s=s.replace(o,EJ+"/api/treegrid/column/#isprimarykey"):"grid_remote_edit"===i[parseInt(n.toString(),10)]?s=s.replace(o,TJ+"/edit"):"virtual_height"===i[parseInt(n.toString(),10)]?s=s.replace(o,TJ+"/virtual"):"check_datasource_columns"===i[parseInt(n.toString(),10)]?s=s.replace(o,TJ+"/columns"):"locale_missing"===i[parseInt(n.toString(),10)]&&(s=s.replace(o,TJ+"/global-local/#localization")),"datasource_syntax_mismatch"===i[parseInt(n.toString(),10)]&&(je(this.treeGridObj)||je(this.treeGridObj.dataStateChange))||console[r.logType](s))}},kJ.prototype.treeLog=function(e,t,i){this.treeGridObj=i;var n=e=e instanceof Array?e:[e];i.allowRowDragAndDrop&&!i.columns.filter(function(e){return e.isPrimaryKey}).length&&(DJ=!0,this.log("primary_column_missing",t));for(var o=0;o<n.length;o++){var r=PJ[n[parseInt(o.toString(),10)]],s=r.check(t,i);s.success&&(s=r.generateMessage(t,i,s.options),console[r.logType](s))}},kJ);function kJ(e){return IP.Inject(Bk),IJ.call(this,e)||this}var PJ={mapping_fields_missing:{type:"mapping_fields_missing",logType:"error",check:function(e,t){var i={success:!1};return i=je(t.idMapping)&&je(t.childMapping)&&je(t.parentIdMapping)||!je(t.idMapping)&&je(t.parentIdMapping)||je(t.idMapping)&&!je(t.parentIdMapping)?{success:!0}:i},generateMessage:function(){return"[EJ2TreeGrid.Error]: MAPPING FIELDS MISSING \nOne of the following fields is missing. It is required for the hierarchical relationship of records in TreeGrid:\n* childMapping\n* idMapping\n* parentIdMapping\nRefer to the following documentation links for more details.\n"+EJ+"/api/treegrid#childmapping\n"+EJ+"/api/treegrid#idmapping\n"+EJ+"/api/treegrid#$parentidmapping"}}},BJ="rowDataBound",FJ="dataBound",LJ="queryCellInfo",RJ="beforeDataBound",OJ="actionBegin",NJ="dataStateChange",VJ="actionComplete",_J="rowSelecting",HJ="rowSelected",zJ="checkboxChange",jJ="rowDeselected",WJ="toolbarClick",QJ="beforeExcelExport",UJ="beforePdfExport",qJ="resizeStop",GJ="expanded",YJ="expanding",XJ="collapsed",KJ="collapsing",JJ="remoteExpand",ZJ="localPagedExpandCollapse",$J="pagingActions",eZ="printGrid-Init",tZ="contextMenuOpen",iZ="contextMenuClick",nZ="beforeCopy",oZ="beforePaste",rZ="crudAction",sZ="beginEdit",aZ="beginAdd",lZ="recordDoubleClick",hZ="cellSave",dZ="cellSaved",pZ="cellEdit",cZ="batchDelete",uZ="batchCancel",gZ="batchAdd",mZ="beforeBatchDelete",fZ="beforeBatchAdd",yZ="beforeBatchSave",vZ="batchSave",bZ="key-pressed",wZ="double-tap",CZ="virtual-action-args",SZ="destroy",AZ="data-listener",xZ="index-modifier",IZ="edit-form",TZ="before-batch-cancel",EZ="detailDataBound",DZ="rowDrag",MZ="rowDragStartHelper",kZ="rowDrop",PZ="rowDragStart",BZ="rows-add",FZ="rows-remove",LZ="row-draging",RZ="row-dropped",OZ="auto-col",NZ="rowDeselecting",VZ="e-movablecontent",_Z="e-frozencontent",HZ="aria-rowindex",zZ="actionFailure";jZ=function(e,t){return(jZ=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}jZ(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(UZ,WZ=Ik),UZ.prototype.setCopyData=function(e){var t="copyContent",i="getCopyData",n=this.treeGridParent.getCurrentViewRecords();if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this[t]="";var o=this.treeGridParent.grid.getRows();if("Cell"!==this.treeGridParent.selectionSettings.mode){for(var r,s,a=this.treeGridParent.getSelectedRowIndexes().sort(function(e,t){return e-t}),l=0;l<a.length;l++)0<l&&(this.treeCopyContent+="\n"),o[a[parseInt(l.toString(),10)]].classList.contains("e-summaryrow")||(r=[].slice.call(o[a[parseInt(l.toString(),10)]].querySelectorAll(".e-rowcell")),s=this.treeGridParent.getSelectedRecords()[parseInt(l.toString(),10)].uniqueID,-1===this.copiedUniqueIdCollection.indexOf(s)&&("Parent"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.parentContentData(n,a[parseInt(l.toString(),10)],o,e,l),this[i](r,!1,"\t",e),this.treeCopyContent+=this[t],this.copiedUniqueIdCollection.push(s),this[t]="","Child"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.childContentData(n,a[parseInt(l.toString(),10)],o,e)));if(e){for(var h=[],l=0;l<this.treeGridParent.getVisibleColumns().length;l++)h[parseInt(l.toString(),10)]=this.treeGridParent.getVisibleColumns()[parseInt(l.toString(),10)].headerText;this[i](h,!1,"\t",e),this.treeCopyContent=this[t]+"\n"+this.treeCopyContent}var d={data:this.treeCopyContent,cancel:!1};this.treeGridParent.trigger(nZ,d),d.cancel||(this.clipBoardTextArea.value=this[t]=d.data,F.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0,this.copiedUniqueIdCollection=[],this.treeCopyContent="")}else WZ.prototype.setCopyData.call(this,e)}},UZ.prototype.parentContentData=function(e,t,i,n,o){var r="copyContent",s="parentItem",a="uniqueID";if(!je(e[parseInt(t.toString(),10)][s]))for(var l=e[parseInt(t.toString(),10)][s].level,h=0;h<l+1;h++)for(var d=0;d<e.length;d++)if(!je(e[parseInt(t.toString(),10)][s])&&e[parseInt(d.toString(),10)][a]===e[parseInt(t.toString(),10)][s][a]){t=d;var p=[].slice.call(i[parseInt(t.toString(),10)].querySelectorAll(".e-rowcell")),c=e[parseInt(d.toString(),10)][a];if(-1===this.copiedUniqueIdCollection.indexOf(c)){this.getCopyData(p,!1,"\t",n),this.treeCopyContent=0<o?this.treeCopyContent+this[r]+"\n":this[r]+"\n"+this.treeCopyContent,this.copiedUniqueIdCollection.push(c),this[r]="";break}}},UZ.prototype.copy=function(e){WZ.prototype.copy.call(this,e)},UZ.prototype.paste=function(e,t,i){WZ.prototype.paste.call(this,e,t,i)},UZ.prototype.getModuleName=function(){return"clipboard"},UZ.prototype.destroy=function(){WZ.prototype.destroy.call(this)},UZ.prototype.childContentData=function(e,t,i,n){var o="copyContent",r="uniqueID";if(e[parseInt(t.toString(),10)].hasChildRecords)for(var s=e[parseInt(t.toString(),10)].childRecords,a=0;a<s.length;a++)for(var l,h,d=0;d<e.length;d++)if(!je(s[parseInt(a.toString(),10)][r])&&e[parseInt(d.toString(),10)][r]===s[parseInt(a.toString(),10)][r]){je(i[parseInt(d.toString(),10)])||i[parseInt(d.toString(),10)].classList.contains("e-summaryrow")||(l=[].slice.call(i[parseInt(d.toString(),10)].querySelectorAll(".e-rowcell")),h=e[parseInt(d.toString(),10)][r],-1===this.copiedUniqueIdCollection.indexOf(h)&&(this.getCopyData(l,!1,"\t",n),this.treeCopyContent+="\n"+this[o],this[o]="",this.copiedUniqueIdCollection.push(h),this.childContentData(e,d,i,n)));break}};var jZ,WZ,QZ=UZ;function UZ(e,t){var i=WZ.call(this,e.grid,t)||this;return i.treeCopyContent="",i.copiedUniqueIdCollection=[],i.treeGridParent=e,i.serviceLocator=t,i}function qZ(e){return e.dataSource instanceof me&&((e=e.dataSource.adaptor)instanceof Ra||e instanceof za||e instanceof Qa||e instanceof il||e instanceof Ba)}function GZ(e){return!!(e.dataSource&&"result"in e.dataSource)}function YZ(e){for(var t=0;t<e.columns.length;t++)if(e.columns[parseInt(t.toString(),10)].showCheckbox)return!0;return!1}function XZ(e){return!((je(e.grid.searchSettings.key)||""===e.grid.searchSettings.key||"Child"!==e.searchSettings.hierarchyMode&&"None"!==e.searchSettings.hierarchyMode)&&(!e.allowFiltering||!e.grid.filterSettings.columns.length||"Child"!==e.filterSettings.hierarchyMode&&"None"!==e.filterSettings.hierarchyMode))}function KZ(e){for(var t=[],i=0,n=Object.keys(e).length;i<n;i++)FB("hasChildRecords",e[parseInt(i.toString(),10)])&&t.push(e[parseInt(i.toString(),10)]);return t}function JZ(e,t,i){var n,t=je(t.parentItem)?null:i$(e,t.parentItem.uniqueID);return null==t||(!e.initialRender||je(t[e.expandStateMapping])||t[e.expandStateMapping]?!1!==t.expanded&&(!t.parentItem||((n=i$(e,t.parentItem.uniqueID))&&e.initialRender&&!je(n[e.expandStateMapping])&&!n[e.expandStateMapping]?n.expanded=!1:(!n||!1!==n.expanded)&&(!n||JZ(e,n)))):t.expanded=!1)}function ZZ(e){var t=[];if(je(e)||!e.hasChildRecords&&!je(e.childRecords)&&!e.childRecords.length)return[];if(!je(e.childRecords))for(var i=e.childRecords.filter(function(e){return!e.isSummaryRow}),n=0,o=Object.keys(i).length;n<o;n++)t.push(i[parseInt(n.toString(),10)]),(i[parseInt(n.toString(),10)].hasChildRecords||!je(i[parseInt(n.toString(),10)].childRecords)&&i[parseInt(n.toString(),10)].childRecords.length)&&(t=t.concat(ZZ(i[parseInt(n.toString(),10)])));return t}function $Z(e){return!qZ(e)||!je(e.dataSource.ready)}function e$(e){for(var t=[],i=0;e&&i<e.length;i++){for(var n=Object.keys(e[parseInt(i.toString(),10)]),o={},r=0;r<n.length;r++)o[n[parseInt(r.toString(),10)]]=e[parseInt(i.toString(),10)][n[parseInt(r.toString(),10)]];t.push(o)}return t}function t$(e){return delete e.hasChildRecords,delete e.childRecords,delete e.index,delete e.parentItem,delete e.level,delete e.taskData,delete e.uniqueID,e}function i$(e,t,i){return(i?e.uniqueIDFilterCollection:e.uniqueIDCollection)[""+t]}function n$(e){e=window.getComputedStyle(e);return"none"===e.display||"hidden"===e.visibility}r$.prototype.getModuleName=function(){return"selection"},r$.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.headerCheckbox,this),this.parent.on("columnCheckbox",this.columnCheckbox,this),this.parent.on("updateGridActions",this.updateGridActions,this),this.parent.grid.on("colgroup-refresh",this.headerCheckbox,this),this.parent.on("checkboxSelection",this.checkboxSelection,this)},r$.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.headerCheckbox),this.parent.off("columnCheckbox",this.columnCheckbox),this.parent.grid.off("colgroup-refresh",this.headerCheckbox),this.parent.off("checkboxSelection",this.checkboxSelection),this.parent.off("updateGridActions",this.updateGridActions))},r$.prototype.destroy=function(){this.removeEventListener()},r$.prototype.checkboxSelection=function(e){var t,i,e=FB("target",e),n=A(e,"e-checkbox-wrapper");n&&0<n.querySelectorAll(".e-treecheckselect").length?(t=n.querySelector('input[type="checkbox"]'),(i=[]).push(e.closest("tr").rowIndex),this.selectCheckboxes(i),this.triggerChkChangeEvent(t,t.nextElementSibling.classList.contains("e-check"),e.closest("tr"))):n&&0<n.querySelectorAll(".e-treeselectall").length&&this.parent.autoCheckHierarchy&&(i=!n.querySelector(".e-frame").classList.contains("e-check")&&!n.querySelector(".e-frame").classList.contains("e-stop"),this.headerSelection(i),t=n.querySelector('input[type="checkbox"]'),this.triggerChkChangeEvent(t,i,e.closest("tr"))),!je(this.parent.parentQuery)&&this.parent.selectionSettings.persistSelection&&0<this.parent.columnModel.filter(function(e){return"checkbox"===e.type}).length&&qZ(this.parent)&&0<this.parent.parentQuery.length&&((n=this.parent.query.queries).push.apply(n,this.parent.parentQuery),this.parent.parentQuery=[])},r$.prototype.triggerChkChangeEvent=function(e,t,i){var n=this.parent.getCurrentViewRecords()[i.rowIndex],t={checked:t,target:e,rowElement:i,rowData:e.classList.contains("e-treeselectall")?this.parent.getCheckedRecords():n};this.parent.trigger(zJ,t)},r$.prototype.getCheckboxcolumnIndex=function(){for(var e,t,i=this.parent.stackedHeader?this.parent.columnModel:this.parent.columns,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].showCheckbox&&(e=i[parseInt(n.toString(),10)].uid);for(var o=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv").length,r=0;r<o;r++)this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[parseInt(r.toString(),10)].getAttribute("e-mappinguid")===e&&(t=r);return t},r$.prototype.headerCheckbox=function(){var e,t,i;this.columnIndex=this.getCheckboxcolumnIndex(),-1<this.columnIndex&&0===this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length?(e=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[this.columnIndex],i=this.parent.createElement("input",{className:"e-treeselectall",attrs:{type:"checkbox"}}),(t=kv(this.parent.createElement,!1,{checked:!1,label:" "})).classList.add("e-hierarchycheckbox"),t.insertBefore(i.cloneNode(),t.firstChild),je(e)||e.insertBefore(t,e.firstChild),this.parent.autoCheckHierarchy&&this.headerSelection()):-1<this.columnIndex&&0<this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length&&(i=(t=this.parent.getHeaderContent().querySelectorAll(".e-checkbox-wrapper")[0]).querySelector(".e-frame").classList.contains("e-check"),this.parent.autoCheckHierarchy)&&i&&this.headerSelection(i)},r$.prototype.renderColumnCheckbox=function(e){var t=this.parent.createElement("input",{className:"e-treecheckselect",attrs:{type:"checkbox","aria-label":"checkbox"}}),i=e.data,e=(e.cell.classList.add("e-treegridcheckbox"),e.cell.setAttribute("aria-label","checkbox"),!je(i.checkboxState)&&"uncheck"!==i.checkboxState),e=kv(this.parent.createElement,!1,{checked:e,label:" "});return e.classList.add("e-hierarchycheckbox"),this.parent.allowTextWrap&&(e.querySelector(".e-frame").style.width="18px"),"indeterminate"===i.checkboxState&&(q([e.querySelectorAll(".e-frame")[0]],["e-check","e-stop","e-uncheck"]),e.querySelector(".e-frame").classList.add("e-stop")),e.insertBefore(t.cloneNode(),e.firstChild),e},r$.prototype.columnCheckbox=function(e){var t,i,n=this.renderColumnCheckbox(e),o=e.cell.querySelector(".e-treecolumn-container");je(o)?(t=this.parent.createElement("span",{className:"e-treecheckbox"}),i=e.cell.innerHTML,e.cell.innerHTML="",t.innerHTML=i,(i=this.parent.createElement("div",{className:"e-treecheckbox-container"})).appendChild(n),i.appendChild(t),e.cell.appendChild(i)):e.cell.querySelector(".e-hierarchycheckbox")||o.insertBefore(n,o.querySelectorAll(".e-treecell")[0])},r$.prototype.selectCheckboxes=function(e){je(e)&&this.parent.trigger(zZ,{error:"The provided value for the rowIndexes is undefined. Please ensure the rowIndexes contains number."});for(var t=0;t<e.length;t++){for(var i=this.parent.getCurrentViewRecords()[e[parseInt(t.toString(),10)]],n=i$(this.parent,i.uniqueID),o="uncheck"===(i=n).checkboxState?"check":"uncheck",r=(i.checkboxState=o,Object.keys(i)),s=0;s<r.length;s++)Object.prototype.hasOwnProperty.call(n,r[parseInt(s.toString(),10)])&&(n[r[parseInt(s.toString(),10)]]=i[r[parseInt(s.toString(),10)]]);this.traverSelection(i,o,!1),this.parent.autoCheckHierarchy&&this.headerSelection()}},r$.prototype.traverSelection=function(e,t,i){if(this.updateSelectedItems(e,t),!i&&e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem),e.childRecords&&this.parent.autoCheckHierarchy)for(var n=e.childRecords,o=(n=!je(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&this.parent.autoCheckHierarchy?this.getFilteredChildRecords(n):n).length,r=0;r<o;r++)n[parseInt(r.toString(),10)].isSummaryRow||(n[parseInt(r.toString(),10)].hasChildRecords?this.traverSelection(n[parseInt(r.toString(),10)],t,!0):this.updateSelectedItems(n[parseInt(r.toString(),10)],t))},r$.prototype.getFilteredChildRecords=function(e){var t=this;return e.filter(function(e){return-1<t.parent.filterModule.filteredResult.indexOf(e)})},r$.prototype.updateParentSelection=function(e){var t,i=[],e=i$(this.parent,e.uniqueID),n=(e&&e.childRecords&&(i=e.childRecords),t=(i=!je(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&this.parent.autoCheckHierarchy?this.getFilteredChildRecords(i):i)&&i.length,0),o=0;if(!je(e)){for(var r=0;r<i.length;r++){var s=i$(this.parent,i[parseInt(r.toString(),10)].uniqueID);je(s)||("indeterminate"===s.checkboxState?n++:"check"===s.checkboxState&&o++)}0<n||0<o&&o!==t?e.checkboxState="indeterminate":(0!==o||e.hasFilteredChildRecords&&!je(e.hasFilteredChildRecords)||je(this.parent.dataResults.actionArgs)||"searching"!==this.parent.dataResults.actionArgs.requestType&&"filtering"!==this.parent.dataResults.actionArgs.requestType||"check"!==e.checkboxState)&&(0===o&&0===n||0===o&&e.hasFilteredChildRecords&&!je(this.parent.dataResults.actionArgs)&&("searching"===this.parent.dataResults.actionArgs.requestType||"filtering"===this.parent.dataResults.actionArgs.requestType)&&"check"===e.checkboxState)?e.checkboxState="uncheck":e.checkboxState="check",this.updateSelectedItems(e,e.checkboxState),e.parentItem&&this.updateParentSelection(e.parentItem)}},r$.prototype.headerSelection=function(e){var t,i=this,n=!1;if(!je(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&(r=this.parent.filterModule.filteredResult,0===this.filteredList.length&&(this.filteredList=r),this.parent.grid.searchSettings.key.length?this.searchingRecords=r:n=this.filteredList!==r&&(this.filteredList=r,!0)),0<this.filteredList.length&&(this.parent.filterSettings.columns.length||!this.filteredList.length||this.parent.grid.searchSettings.key.length||(this.filteredList=[]),this.searchingRecords.length)&&!je(e)&&(this.filteredList=this.searchingRecords),t=!je(this.parent.filterModule)&&0===this.parent.filterModule.filteredResult.length&&0===this.parent.getCurrentViewRecords().length&&0<this.parent.filterSettings.columns.length||!je(this.parent.filterModule)&&0<this.filteredList.length?this.filteredList:this.parent.flatData,t=qZ(this.parent)?this.parent.getCurrentViewRecords():t,!je(e))for(var o=0;o<t.length;o++)e?"check"===t[parseInt(o.toString(),10)].checkboxState||n||(t[parseInt(o.toString(),10)].checkboxState="check",this.updateSelectedItems(t[parseInt(o.toString(),10)],t[parseInt(o.toString(),10)].checkboxState)):-1<this.selectedItems.indexOf(t[parseInt(o.toString(),10)])&&(t[parseInt(o.toString(),10)].checkboxState="uncheck",this.updateSelectedItems(t[parseInt(o.toString(),10)],t[parseInt(o.toString(),10)].checkboxState),this.parent.autoCheckHierarchy)&&this.updateParentSelection(t[parseInt(o.toString(),10)]);!1===e&&this.parent.enableVirtualization&&(this.selectedItems=[],this.selectedIndexes=[],t.filter(function(e){e.checkboxState="uncheck",i.updateSelectedItems(e,e.checkboxState)}));var r=this.selectedItems.length,s=this.parent.getHeaderContent().querySelectorAll(".e-frame")[0];0<r&&0<t.length?r===t.length||e?(q([s],["e-stop"]),s.classList.add("e-check")):(q([s],["e-check"]),s.classList.add("e-stop")):q([s],["e-check","e-stop"])},r$.prototype.updateSelectedItems=function(t,e){var i,n=this.parent.grid.currentViewData.filter(function(e){return e.uniqueID===t.uniqueID}),n=this.parent.grid.currentViewData.indexOf(n[0]),o=i$(this.parent,t.uniqueID),r=this.parent.getRows()[parseInt(n.toString(),10)],o=(-1<n&&(i=void 0,(this.parent.frozenRows||this.parent.getFrozenColumns())&&(i=this.parent.getDataRows()[parseInt(n.toString(),10)]),je(i=(r.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]?r:i).querySelectorAll(".e-hierarchycheckbox .e-frame")[0])||q([i],["e-check","e-stop","e-uncheck"])),"check"===((o=je(o=o)?t:o).checkboxState=e)&&je(t.isSummaryRow)?(-1!==n&&-1===this.selectedIndexes.indexOf(n)&&this.selectedIndexes.push(n),-1===this.selectedItems.indexOf(o)&&-1!==n&&!je(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&this.selectedItems.push(o),-1===this.selectedItems.indexOf(o)&&(this.parent.enableVirtualization||this.parent.allowPaging)&&!je(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&this.selectedItems.push(o),-1!==this.selectedItems.indexOf(o)||je(this.parent.filterModule)||0!==this.parent.filterModule.filteredResult.length||this.selectedItems.push(o),-1===this.selectedItems.indexOf(o)&&je(this.parent.filterModule)&&this.selectedItems.push(o)):"uncheck"!==e&&"indeterminate"!==e||!je(t.isSummaryRow)||(-1!==(o=this.selectedItems.indexOf(o))&&this.selectedItems.splice(o,1),-1!==this.selectedIndexes.indexOf(n)&&(o=this.selectedIndexes.indexOf(n),this.selectedIndexes.splice(o,1))),"indeterminate"===e?"e-stop":"e-"+e);-1<n&&(je(i)||(i.classList.add(o),r.querySelector(".e-treecheckselect").setAttribute("aria-checked","check"===e?"true":"uncheck"===e?"false":"mixed")))},r$.prototype.updateGridActions=function(e){var n=this,t=e.requestType;if(YZ(this.parent)&&this.parent.autoCheckHierarchy)if("sorting"===t||"paging"===t){var i,o=this.parent.grid.getRows(),r=(i=this.parent.getCurrentViewRecords()).length;this.selectedIndexes=[];for(var s=0;s<r;s++)o[parseInt(s.toString(),10)].classList.contains("e-summaryrow")||this.updateSelectedItems(i[parseInt(s.toString(),10)],i[parseInt(s.toString(),10)].checkboxState)}else if("delete"===t||"add"===e.action){var a=[];"delete"===t?a=e.data:a.push(e.data);for(var l,s=0;s<a.length;s++)"delete"===t&&(l=this.parent.flatData.indexOf(a[parseInt(s.toString(),10)]),l=this.selectedIndexes.indexOf(l),this.selectedIndexes.splice(l,1),this.updateSelectedItems(a[parseInt(s.toString(),10)],"uncheck")),je(a[parseInt(s.toString(),10)].parentItem)||this.updateParentSelection(a[parseInt(s.toString(),10)].parentItem)}else"add"===e.requestType&&this.parent.autoCheckHierarchy?e.data.checkboxState="uncheck":"filtering"!==t&&"searching"!==t&&("refresh"!==t||qZ(this.parent))||(this.selectedItems=[],this.selectedIndexes=[],(i=!je(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length?this.parent.filterModule.filteredResult:this.parent.flatData).forEach(function(e){if(n.parent.enableVirtualization){e.hasChildRecords&&0<e.childRecords.length?n.updateParentSelection(e):n.updateSelectedItems(e,e.checkboxState);for(var t=ZZ(e),t=n.getFilteredChildRecords(t),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].hasChildRecords?n.updateParentSelection(t[parseInt(i.toString(),10)]):t[parseInt(i.toString(),10)].hasChildRecords||je(t[parseInt(i.toString(),10)])||n.updateSelectedItems(t[parseInt(i.toString(),10)],t[parseInt(i.toString(),10)].checkboxState)}else e.hasChildRecords?n.updateParentSelection(e):n.updateSelectedItems(e,e.checkboxState)}),this.headerSelection())},r$.prototype.getCheckedrecords=function(){return this.selectedItems},r$.prototype.getCheckedRowIndexes=function(){return this.selectedIndexes};var o$=r$;function r$(e){this.parent=e,this.selectedItems=[],this.selectedIndexes=[],this.filteredList=[],this.searchingRecords=[],this.addEventListener()}a$.prototype.getModuleName=function(){return"print"},a$.prototype.addEventListener=function(){this.parent.grid.on(eZ,this.printTreeGrid,this)},a$.prototype.removeEventListener=function(){this.parent.grid.off(eZ,this.printTreeGrid)},a$.prototype.printTreeGrid=function(e){var t=FB("printgrid",e),e=FB("element",e);t.addEventListener(LJ,this.parent.grid.queryCellInfo),t.addEventListener(BJ,this.parent.grid.rowDataBound),t.addEventListener(RJ,this.parent.grid.beforeDataBound),U([e],"e-treegrid")},a$.prototype.print=function(){this.parent.grid.print()},a$.prototype.destroy=function(){this.removeEventListener()};var s$=a$;function a$(e){this.parent=e,IP.Inject(EP),this.addEventListener()}l$=function(e,t){return(l$=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])}))(e,t)};var l$,h$,d$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},d$=(function(e,t){function i(){this.constructor=e}l$(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(p$,h$=n),d$([e()],p$.prototype,"fields",void 0),d$([e(!1)],p$.prototype,"ignoreCase",void 0),d$([e("contains")],p$.prototype,"operator",void 0),d$([e()],p$.prototype,"key",void 0),d$([e()],p$.prototype,"hierarchyMode",void 0),p$);function p$(){return null!==h$&&h$.apply(this,arguments)||this}c$=function(e,t){return(c$=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])}))(e,t)};var c$,u$,g$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},g$=(function(e,t){function i(){this.constructor=e}c$(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(m$,u$=n),g$([e("Row")],m$.prototype,"mode",void 0),g$([e("Flow")],m$.prototype,"cellSelectionMode",void 0),g$([e("Single")],m$.prototype,"type",void 0),g$([e(!1)],m$.prototype,"persistSelection",void 0),g$([e("Default")],m$.prototype,"checkboxMode",void 0),g$([e(!1)],m$.prototype,"checkboxOnly",void 0),g$([e(!0)],m$.prototype,"enableToggle",void 0),m$);function m$(){return null!==u$&&u$.apply(this,arguments)||this}y$.prototype.RowModifier=function(t){var i,n,e,o;t.data&&(e=(i=t.data).parentItem,je(i.parentItem)||XZ(this.parent)||this.parent.allowPaging&&"Root"!==this.parent.pageSettings.pageSizeMode&&(!qZ(this.parent)||$Z(this.parent))||(!this.parent.initialRender||(je(e[this.parent.expandStateMapping])||e[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll)&&JZ(this.parent,t.data,this.parent.grid.getCurrentViewRecords())||je(t.row)||(this.parent.toggleRowVisibility(t.row,"e-childrow-hidden"),e=this.parent.grid.getRowsObject(),this.parent.grid.isFrozenGrid())||je(t.row.getAttribute("data-uid"))||(e.filter(function(e){return e.uid===t.row.getAttribute("data-uid")})[0].visible=!1),qZ(this.parent)&&!$Z(this.parent)&&(n=this.parent,0<(e=this.parent.getCurrentViewRecords().filter(function(e){return R(n.idMapping,e)===R(n.parentIdMapping,i)})).length)&&!e[0].isSummaryRow&&!je(t.row)&&(e=e[0].expanded?"e-childrow-visible":"e-childrow-hidden",this.parent.toggleRowVisibility(t.row,e)),FB("isSummaryRow",t.data)&&U([t.row],"e-summaryrow"),je(t.row)||(t.row.querySelector(".e-treegridexpand")?t.row.setAttribute("aria-expanded","true"):t.row.querySelector(".e-treegridcollapse")&&t.row.setAttribute("aria-expanded","false"),this.parent.enableCollapseAll&&this.parent.initialRender&&(je(i.parentItem)||this.parent.toggleRowVisibility(t.row,"e-childrow-hidden"))),this.parent.rowDragAndDropModule&&this.parent.grid.rowDragAndDropModule&&(this.parent.grid.rowDragAndDropModule.dragStartData||this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.getContentTable().scrollHeight<=this.parent.getContent().clientHeight&&(this.parent.getVisibleRecords()[this.parent.getVisibleRecords().length-1].uniqueID!==t.data.uniqueID||je(t.row)||t.row.cells[0].classList.contains("e-lastrowcell")||this.parent.lastRowBorder(t.row,!0)),this.parent.isReact?(o=this).parent.renderReactTemplates(function(){o.parent.trigger(BJ,t)}):this.parent.trigger(BJ,t))},y$.prototype.cellRender=function(e){if(e.data){var t=this.parent.grid,i=e.data,n=je(i.filterLevel)?i.level:i.filterLevel,o=0,r=this.parent.getColumnByUid(e.column.uid),s=i.isSummaryRow,a=this.parent.getFrozenColumns(),l=(je(i.parentItem)?i:i.parentItem).index,h=this.parent.enableColumnVirtualization&&!this.parent.initialRender?this.parent.getVirtualColIndexByUid(e.column.uid):t.getColumnIndexByUid(e.column.uid);if(h!==this.parent.treeColumnIndex||"add"!==e.requestType&&"rowDragAndDrop"!==e.requestType&&"delete"!==e.requestType&&!je(e.cell.querySelector(".e-treecell")))this.templateResult&&(this.templateResult=null);else{var d=Q("div",{className:"e-treecolumn-container"}),p=Q("span",{className:"e-icons e-none"});p.style.width="10px",p.style.display="inline-block";for(var c=0;c<n;c++)o+=10,d.appendChild(p.cloneNode());var u,g,h=je(i.hasFilteredChildRecords)?i.hasChildRecords:i.hasFilteredChildRecords;(h=h&&!je(i.childRecords)?this.parent.isFromGantt&&this.parent.loadChildOnDemand?i.hasChildRecords:!(0===i.childRecords.length):h)?(U([e.cell],"e-treerowcell"),e.cell.setAttribute("aria-expanded",i.expanded?"true":"false"),h=Q("span",{className:"e-icons"}),g=void 0,this.parent.initialRender?g=i.expanded&&(je(i[this.parent.expandStateMapping])||i[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll:(g=!(!i.expanded||!JZ(this.parent,i,this.parent.grid.getCurrentViewRecords())),"Cell"!==this.parent.editSettings.mode||qZ(this.parent)||je(u=this.parent.flatData.find(function(e){return e.uniqueID===i.uniqueID}))||(g=(i.expanded!==u.expanded?u:i).expanded)),U([h],g?"e-treegridexpand":"e-treegridcollapse"),o+=18,d.appendChild(h),p.style.width="4px",o+=7,d.appendChild(p.cloneNode())):!n&&i.level||(o+=20,d.appendChild(p.cloneNode()),d.appendChild(p.cloneNode())),u=Q("span",{className:"e-treecell"}),this.parent.allowTextWrap&&(u.style.width="Calc(100% - "+o+"px)"),U([e.cell],"e-gridrowindex"+l+"level"+i.level),this.updateTreeCell(e,u),d.appendChild(u),e.cell.appendChild(d)}0<t.getFrozenLeftColumnsCount()||0<t.getFrozenRightColumnsCount()?(g=t.getFrozenRightColumns(),h=t.getFrozenLeftColumns(),f=t.getMovableColumns(),(0<g.length&&g[0].field===e.column.field||0<h.length&&h[0].field===e.column.field||0<f.length&&f[0].field===e.column.field)&&U([e.cell],"e-gridrowindex"+l+"level"+i.level)):(a>this.parent.treeColumnIndex&&0<a&&t.getColumnIndexByUid(e.column.uid)===a||a<this.parent.treeColumnIndex&&0<a&&(t.getColumnIndexByUid(e.column.uid)===a||t.getColumnIndexByUid(e.column.uid)===a-1)||a===this.parent.treeColumnIndex&&0<a&&t.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex-1)&&U([e.cell],"e-gridrowindex"+l+"level"+i.level),!je(r)&&r.showCheckbox&&(this.parent.notify("columnCheckbox",e),this.parent.allowTextWrap)&&(g=e.cell.querySelectorAll(".e-frame")[0],o=o+parseInt(g.style.width,16)+10,(u=t.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex?e.cell.querySelector(".e-treecell"):e.cell.querySelector(".e-treecheckbox")).style.width="Calc(100% - "+o+"px)"),s&&(U([e.cell],"e-summarycell"),h=je(h=FB(e.column.field,e.data))?null:h,null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML=h:e.column.template?e.cell.innerHTML=null:e.cell.innerHTML=h),this.parent.args=e;var m,f=R("columnModel",this.parent)[this.parent.treeColumnIndex];je(this.parent.rowTemplate)&&!this.parent.isReact||this.parent.isReact&&!e.column.template?this.parent.trigger(LJ,e):this.parent.isReact&&f.field!==e.column.field&&(m=this).parent.renderReactTemplates(function(){m.parent.trigger(LJ,e)})}},y$.prototype.updateTreeCell=function(e,t){var i=R("columnModel",this.parent)[this.parent.treeColumnIndex],n="templateFn",o=e.column.index,o=(je(i.field)&&e.cell.setAttribute("aria-colindex",o+1+""),i.field!==e.column.field||je(i.template)||(e.column.template=i.template,e.column[n]=HP(e.column.template),e.cell.classList.add("e-templatecell")),(null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell"):e.cell).innerHTML);if("object"==typeof e.column.template&&this.templateResult)eB(t,this.templateResult),this.templateResult=null,e.cell.innerHTML="";else if(e.cell.classList.contains("e-templatecell")){var r=e.cell.children.length,s=this.parent.element.id+e.column.uid;if(i.field!==e.column.field||je(i.template))for(;0<r;r=e.cell.children.length)t.appendChild(e.cell.children[parseInt(0..toString(),10)]);else{var a,i="portals";this.parent.isReact&&"string"!=typeof e.column.template?(e.column[n](e.data,this.parent,"columnTemplate",s,null,null,t),je(this.parent.grid[i])&&(this.parent.grid[i]=this.parent[i]),this.parent.notify("renderReactTemplate",this.parent[i]),(a=this).parent.renderReactTemplates(function(){a.parent.trigger(LJ,e)})):eB(t,e.column[n](jP({index:""},e.data),this.parent,"template",s,this.parent.isStringTemplate)),delete e.column.template,delete e.column[n],e.cell.innerHTML=""}}else t.innerHTML=o,e.cell.innerHTML=""},y$.prototype.refreshReactColumnTemplateByUid=function(l){var h=this;this.parent.isReact&&this.parent.clearTemplate(["columnTemplate"],void 0,function(){var e=h.parent.grid.getRowsObject(),t=h.parent.getDataRows(),i=h.parent.grid.getIndentCount(),n=h.parent.grid.getNormalizedColumnIndex(l);if(0!==t.length)for(var o,r,s,a=0;a<e.length;a++)e[parseInt(a.toString(),10)].isDataRow&&!je(e[parseInt(a.toString(),10)].index)&&(o=e[parseInt(a.toString(),10)].cells[parseInt(n.toString(),10)],s=new VD(h.parent.grid,h.parent.grid.serviceLocator),r=t.length>=e.length?h.parent.getCellFromIndex(e[parseInt(a.toString(),10)].index,n-i):t[e[parseInt(a.toString(),10)].index].querySelector(".e-templatecell"),s.refreshTD(r,o,e[parseInt(a.toString(),10)].data,{index:e[parseInt(a.toString(),10)].index}),s=h.parent.getRows()[parseInt(a.toString(),10)].cells[parseInt(n.toString(),10)],h.cellRender({data:e[parseInt(a.toString(),10)].data,cell:s,column:o.column}))})},y$.prototype.columnTemplateResult=function(e){this.templateResult=e.template},y$.prototype.reactTemplateRender=function(e,t){this.parent.portals=e,this.parent.notify("renderReactTemplate",this.parent.portals),this.parent.renderReactTemplates(t)},y$.prototype.destroy=function(){this.parent.grid.off("template-result",this.columnTemplateResult),this.parent.grid.off("reactTemplateRender",this.reactTemplateRender)};var f$=y$;function y$(e){this.parent=e,this.templateResult=null,this.parent.grid.on("template-result",this.columnTemplateResult,this),this.parent.grid.on("reactTemplateRender",this.reactTemplateRender,this)}C$.prototype.addEventListener=function(){this.parent.on("updateRemoteLevel",this.updateParentRemoteData,this),this.parent.grid.on("sorting-begin",this.beginSorting,this),this.parent.on("updateAction",this.updateData,this),this.parent.on(JJ,this.collectExpandingRecs,this),this.parent.on("dataProcessor",this.dataProcessor,this)},C$.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(JJ,this.collectExpandingRecs),this.parent.off("updateRemoteLevel",this.updateParentRemoteData),this.parent.off("updateAction",this.updateData),this.parent.off("dataProcessor",this.dataProcessor),this.parent.grid.off("sorting-begin",this.beginSorting))},C$.prototype.destroy=function(){this.removeEventListener()},C$.prototype.isRemote=function(){return this.parent.dataSource instanceof me},C$.prototype.convertToFlatData=function(e){var t,i,n=this;this.parent.flatData=je(e)||0!==Object.keys(e).length||this.parent.dataSource instanceof me?[]:this.parent.dataSource,this.parent.parentData=[],qZ(this.parent)&&!$Z(this.parent)&&e instanceof me&&!(e instanceof Array)?(t=this.parent.dataSource,this.parent.parentIdMapping&&(this.parent.query=je(this.parent.query)?new ya:this.parent.query,this.parent.parentIdMapping&&(i=this.parent.query.params.filter(function(e){return"IdMapping"===e.key}),this.parent.initialRender)&&!i.length&&(this.parent.query.where(this.parent.parentIdMapping,"equal",null),this.parent.query.addParams("IdMapping",this.parent.idMapping)),this.parent.hasChildMapping||((i=this.parent.query.clone()).queries=[],(i=i.select([this.parent.parentIdMapping])).isCountRequired=!0,t.executeQuery(i).then(function(e){n.parentItems=Sa.distinct(e.result,n.parent.parentIdMapping,!1),0===(e.result?0:1)&&(x("grid.contentModule.isLoaded",!0,n.parent),je(n.zerothLevelData)||(x("cancel",!1,n.zerothLevelData),R("grid.renderModule",n.parent).dataManagerSuccess(n.zerothLevelData),n.zerothLevelData=null),n.parent.grid.hideSpinner())})))):e instanceof Array&&this.convertJSONData(e)},C$.prototype.convertJSONData=function(e){if(this.hierarchyData=[],this.taskIds=[],this.parent.idMapping)for(var t=Object.keys(e),i=0;i<t.length;i++){var n=e[parseInt(i.toString(),10)];this.hierarchyData.push(Pe({},n)),je(n[this.parent.idMapping])||this.taskIds.push(n[this.parent.idMapping])}else this.hierarchyData=e;if(this.isSelfReference){for(var o=[],r=new me(this.hierarchyData).executeLocal((new ya).group(this.parent.parentIdMapping)),i=0;i<r.length;i++){var s,a=r[parseInt(i.toString(),10)],l=this.taskIds.indexOf(a.key);!je(a.key)&&-1<l?(s=a.items,this.hierarchyData[parseInt(l.toString(),10)][this.parent.childMapping]=s):o.push.apply(o,a.items)}this.hierarchyData=this.selfReferenceUpdate(o)}var h;Object.keys(this.hierarchyData).length?this.createRecords(this.hierarchyData):(h=!(this.parent.dataSource instanceof me)&&this.parent.isGantt,this.parent.flatData=h?this.parent.dataSource:[]),this.storedIndex=-1},C$.prototype.selfReferenceUpdate=function(e){for(var t=[];0<this.hierarchyData.length&&0<e.length;){var i=e.indexOf(this.hierarchyData[0]);-1===i?this.hierarchyData.shift():(t.push(this.hierarchyData.shift()),e.splice(i,1))}return t},C$.prototype.updateParentRemoteData=function(e){var r=this,t="actionArgs",s=(qZ(this.parent)&&this.parent.enableVirtualization&&"virtualscroll"===e[t].requestType&&this.parent.hideSpinner(),e.result);if(qZ(this.parent)&&this.parent.enableVirtualization&&("virtualscroll"===e[t].requestType||"clearFilter"===e[t].action||""===e[t].searchString)&&(this.parent.query.expands=[]),this.parent.hasChildMapping||this.parentItems.length||!this.parent.loadChildOnDemand)if(this.parent.loadChildOnDemand)for(var a=this,i=0;i<s.length;i++)!function(t){var i,n,o,e;GZ(a.parent)&&s[parseInt(t.toString(),10)].hasChildRecords&&a.parent.initialRender&&(s[parseInt(t.toString(),10)].expanded=!1),qZ(a.parent)&&a.parent.enableVirtualization&&(i=[],n=a.parent,s.filter(function(e){e[""+n.parentIdMapping]===s[parseInt(t.toString(),10)][""+n.idMapping]&&i.push(e)}),i.length?s[parseInt(t.toString(),10)].expanded=!0:s[parseInt(t.toString(),10)].hasChildRecords&&(s[parseInt(t.toString(),10)].expanded=!1)),je(s[parseInt(t.toString(),10)].index)&&(s[parseInt(t.toString(),10)].taskData=Pe({},s[parseInt(t.toString(),10)]),s[parseInt(t.toString(),10)].uniqueID=$P(a.parent.element.id+"_data_"),x("uniqueIDCollection."+s[parseInt(t.toString(),10)].uniqueID,s[parseInt(t.toString(),10)],a.parent),qZ(a.parent)&&a.parent.enableVirtualization&&s[parseInt(t.toString(),10)][""+a.parent.parentIdMapping]&&(je(s[parseInt(t.toString(),10)].level)||0===s[parseInt(t.toString(),10)].level)?(o=s[parseInt(t.toString(),10)][""+a.parent.parentIdMapping],(e=s.find(function(e){return e[""+r.parent.idMapping]===o}))&&(s[parseInt(t.toString(),10)].level=e.level+1)):s[parseInt(t.toString(),10)].level=0,s[parseInt(t.toString(),10)].index=Math.ceil(1e3*Math.random()),!s[parseInt(t.toString(),10)][a.parent.hasChildMapping]&&-1===a.parentItems.indexOf(s[parseInt(t.toString(),10)][a.parent.idMapping])||(s[parseInt(t.toString(),10)].hasChildRecords=!0),s[parseInt(t.toString(),10)].checkboxState="uncheck")}(i);else je(s)||!this.parent.loadChildOnDemand&&GZ(this.parent)&&!je(this.parent.dataResults.expandRecord)||qZ(this.parent)&&!this.parent.loadChildOnDemand&&e[t].isExpandCollapse&&this.parent.enableVirtualization||this.convertToFlatData(s);else x("cancel",!0,this.zerothLevelData=e);qZ(this.parent)&&!this.parent.loadChildOnDemand&&e[t].isExpandCollapse&&this.parent.enableVirtualization||qZ(this.parent)&&this.parent.enableVirtualization&&this.parent.loadChildOnDemand?e.result=s:e.result=this.parent.loadChildOnDemand?s:this.parent.flatData,qZ(this.parent)&&this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length&&(t=e.query.queries.filter(function(e){return"onAggregates"===e.fn}),e.result=this.parent.summaryModule.calculateSummaryValue(t,this.parent.flatData,!0)),this.parent.notify("updateResults",e)},C$.prototype.collectExpandingRecs=function(e,t){var i,n=this.parent.getRows();if(this.parent.rowTemplate&&(i=this.parent.getContentTable().rows,n=[].slice.call(i)),0<e.rows.length){t||(e.record.expanded=!0);for(var o=0;o<e.rows.length;o++){this.parent.toggleRowVisibility(e.rows[parseInt(o.toString(),10)],"e-childrow-visible"),this.parent.loadChildOnDemand||(s=e.rows[parseInt(o.toString(),10)].getElementsByClassName("e-treegridcollapse")[0],r=this.parent.rowTemplate?this.parent.grid.getCurrentViewRecords()[e.rows[parseInt(o.toString(),10)].rowIndex]:this.parent.grid.getRowObjectFromUID(e.rows[parseInt(o.toString(),10)].getAttribute("data-Uid")).data,!je(s)&&r.expanded&&(U([s],"e-treegridexpand"),q([s],"e-treegridcollapse")),s=[],(s=n.filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))})).length&&r.expanded&&this.collectExpandingRecs({record:r,rows:s,parentRow:e.parentRow},!0));var r,s=e.rows[parseInt(o.toString(),10)].querySelector(".e-detailrowcollapse");je(s)||this.parent.grid.detailRowModule.expand(s)}this.parent.grid.pageSettings.totalRecordsCount+=e.rows.length}else this.fetchRemoteChildData({action:e.name,record:e.record,rows:e.rows,parentRow:e.parentRow})},C$.prototype.fetchRemoteChildData=function(f){var e,y=this,v={row:f.parentRow,data:f.record},t=this.parent.dataSource,i=this.parent.grid.getDataModule().generateQuery(),n=i.queries.filter(function(e){return"onPage"!==e.fn&&"onWhere"!==e.fn}),n=(i.queries=n,i.isCountRequired=!0,parseInt(f.record[this.parent.idMapping],10));isNaN(n)&&(n=f.record[this.parent.idMapping].toString()),this.parent.enableVirtualization&&"remoteExpand"===f.action?(i.take(this.parent.pageSettings.pageSize),(e=[]).push("ExpandingAction",n.toString()),i.expand(e)):this.parent.enableVirtualization&&"collapse"===f.action&&(i.take(this.parent.grid.pageSettings.pageSize),(e=[]).push("CollapsingAction",n.toString()),i.expand(e)),i.where(this.parent.parentIdMapping,"equal",f.record[this.parent.idMapping]),"remoteExpand"===f.action&&this.parent.grid.filterSettings&&this.parent.grid.filterSettings.columns.length&&(n=this.parent.grid.getDataModule().generateQuery().queries.filter(function(e){return"onPage"!==e.fn&&void 0!==e.e.predicates}),i.queries.push(n[0])),kA(this.parent.element),t.executeQuery(i).then(function(e){var t,i="remoteExpandedData",n="remoteCollapsedData",o=y.parent.grid.currentViewData.slice(),r=y.parent.idMapping;if(y.parent.isGantt&&y.parent.loadChildOnDemand&&y.parent.hasChildMapping){for(var s=0;s<y.parent.grid.currentViewData.length;s++)if(f.record[r]===y.parent.grid.currentViewData[s][r]){t=s;break}}else t=o.indexOf(f.record);if(y.parent.enableVirtualization&&("collapse"===f.action||"remoteExpand"===f.action))for(o=[],s=0;s<t;s++)o.push(y.parent.grid.currentViewData[parseInt(s.toString(),10)]);-1===t&&y.parent.grid.getRowsObject().forEach(function(e){e.data.uniqueID===f.record.uniqueID&&(t=e.index)});var a=FB("actual.nextLevel",e),l=e.result,h=[];if("remoteExpand"===f.action&&y.parent.grid.filterModule&&y.parent.grid.filterModule.value){for(s=0;s<o.length;s++)Object.prototype.hasOwnProperty.call(o[parseInt(s.toString(),10)],y.parent.parentIdMapping)&&null!==o[parseInt(s.toString(),10)][""+y.parent.parentIdMapping]&&0===o[parseInt(s.toString(),10)].level&&(o.splice(s,1),s--);for(s=0;s<l.length;s++)f.record[""+y.parent.idMapping]!==l[parseInt(s.toString(),10)][""+y.parent.idMapping]&&f.record[""+y.parent.idMapping]===l[parseInt(s.toString(),10)][""+y.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(l,s)&&h.push(l[parseInt(s.toString(),10)]);l=h}if(y.parent.enableVirtualization&&"remoteExpand"===f.action){f.record.childRecords=[];for(s=0;s<l.length;s++)f.record[""+y.parent.idMapping]!==l[parseInt(s.toString(),10)][""+y.parent.idMapping]&&f.record[""+y.parent.idMapping]===l[parseInt(s.toString(),10)][""+y.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(l,s)&&f.record.childRecords.push(l[parseInt(s.toString(),10)])}else f.record.childRecords=l;for(var d=0;d<l.length;d++){var p=l[parseInt(d.toString(),10)];if(y.parent.enableVirtualization&&p[""+y.parent.idMapping]===f.record[""+y.parent.idMapping]&&"remoteExpand"===f.action)y.parent[i].push(f.record);else if(y.parent.enableVirtualization&&p[""+y.parent.idMapping]===f.record[""+y.parent.idMapping]&&"collapse"===f.action)for(s=0;s<y.parent[i].length;s++)f.record[""+y.parent.idMapping]===y.parent[i][parseInt(s.toString(),10)][""+y.parent.idMapping]&&y.parent[i].splice(s,1);if(p.taskData=Pe({},p),p[""+y.parent.parentIdMapping]&&y.parent.enableVirtualization&&y.parent[i].length)for(var c,s=0;s<y.parent[i].length;s++)p[""+y.parent.parentIdMapping]===y.parent[i][parseInt(s.toString(),10)][""+y.parent.idMapping]&&(p.level=y.parent[i][parseInt(s.toString(),10)].level+1,delete(c=y.parent[i][parseInt(s.toString(),10)]).childRecords,p.parentItem=c,p.parentUniqueID=c.uniqueID);else y.parent.enableVirtualization?!p[""+y.parent.hasChildMapping]&&-1===y.parentItems.indexOf(p[""+y.parent.idMapping])||a&&!a[parseInt(d.toString(),10)]?(delete(c=Pe({},f.record)).childRecords,p.parentItem=c,p.parentUniqueID=f.record.uniqueID):je(p[""+y.parent.parentIdMapping])?(p.level=0,"remoteExpand"===f.action&&(p.childRecords=[],p.childRecords=f.record.childRecords)):p.level=f.record.level:(p.level=f.record.level+1,delete(c=Pe({},f.record)).childRecords,p.parentItem=c,p.parentUniqueID=f.record.uniqueID);if(p.index=Math.ceil(1e3*Math.random()),p.uniqueID=$P(y.parent.element.id+"_data_"),f.record[""+y.parent.idMapping]===p[""+y.parent.idMapping]&&(f.record.uniqueID=p.uniqueID),p.checkboxState="uncheck",y.parent.enableVirtualization&&je(p.level))for(var u=0;u<y.parent.grid.currentViewData.length;u++)y.parent.grid.currentViewData[parseInt(u.toString(),10)][""+y.parent.idMapping]===p[""+y.parent.parentIdMapping]&&(p.level=y.parent.grid.currentViewData[parseInt(u.toString(),10)].level+1);if(x("uniqueIDCollection."+p.uniqueID,p,y.parent),(p[""+y.parent.hasChildMapping]||-1!==y.parentItems.indexOf(p[""+y.parent.idMapping]))&&(!a||a[parseInt(d.toString(),10)]))if(p.hasChildRecords=!0,y.parent.enableVirtualization&&!y.parent.loadChildOnDemand){for(s=0;s<y.parent[n].length;s++)p[""+y.parent.idMapping]===y.parent[n][parseInt(s.toString(),10)][""+y.parent.idMapping]&&(p.expanded=y.parent[n][parseInt(s.toString(),10)].expanded);if("collapse"===f.action&&p[""+y.parent.idMapping]!==f.record[""+y.parent.idMapping]&&!1!==p.expanded)p.expanded=!0;else if("collapse"===f.action&&p[""+y.parent.idMapping]===f.record[""+y.parent.idMapping])p.expanded=!1,y.parent[n].push(f.record);else if("remoteExpand"===f.action){for(s=0;s<y.parent.grid.currentViewData.length;s++)y.parent.grid.currentViewData[parseInt(s.toString(),10)][""+y.parent.idMapping]===p[""+y.parent.idMapping]&&l.splice(d,1,y.parent.grid.currentViewData[parseInt(s.toString(),10)]);if(p[y.parent.idMapping]===f.record[""+y.parent.idMapping])for(s=0;s<y.parent[n].length;s++)f.record[""+y.parent.idMapping]===y.parent[n][parseInt(s.toString(),10)][""+y.parent.idMapping]&&y.parent[n].splice(s,1);!1!==p.expanded&&(p.expanded=!0)}}else y.parent.enableVirtualization&&p[""+y.parent.idMapping]===f.record[""+y.parent.idMapping]&&"collapse"!==f.action?p.expanded=!0:y.parent.enableVirtualization&&!y.parent.loadChildOnDemand||(p.expanded=!1);o.splice(t+d+1,0,p)}x("result",o,e),x("action","beforecontentrender",e),y.parent.trigger(VJ,e),BA(y.parent.element),0<y.parent.grid.aggregates.length&&!y.parent.enableVirtualization&&(je(g=FB("query",e))&&(g=R("grid.renderModule.data",y.parent).aggregateQuery(new ya)),je(g)||(g=g.queries.filter(function(e){return"onAggregates"===e.fn}),e.result=y.parent.summaryModule.calculateSummaryValue(g,e.result,!0))),"remoteExpand"===f.action&&y.parent.allowPaging&&"All"===y.parent.pageSettings.pageSizeMode&&(y.parent.grid.pageSettings.totalRecordsCount=y.parent.grid.pageSettings.totalRecordsCount+l.length),y.parent.enableVirtualization&&(y.parent.grid.pageSettings.totalRecordsCount=e.count),e.count=y.parent.grid.pageSettings.totalRecordsCount;var g={},m=(y.parent.enableVirtualization&&y.remoteVirtualAction(g),{index:t,childData:l});y.parent.enableInfiniteScrolling?y.parent.notify("infinite-remote-expand",m):R("grid.renderModule",y.parent).dataManagerSuccess(e,g),y.parent.trigger(GJ,v)})},C$.prototype.remoteVirtualAction=function(e){e.requestType="refresh",x("isExpandCollapse",!0,e);var e=R("grid.contentModule",this.parent),t=R("currentInfo",e),e=R("prevInfo",e);t.loadNext&&this.parent.grid.pageSettings.currentPage===t.nextInfo.page&&(this.parent.grid.pageSettings.currentPage=e.page)},C$.prototype.beginSorting=function(){var e;this.isSortAction=!0,qZ(this.parent)&&this.parent.enableVirtualization&&(-1!==(e=this.parent.query.queries.indexOf(this.parent.query.queries.filter(function(e){return"onSortBy"===e.fn})[0]))&&this.parent.query.queries.splice(e,1),0===this.parent.grid.sortSettings.columns.length)&&this.parent.query.sortBy(null,null)},C$.prototype.createRecords=function(e,t){for(var i=[],n=0,o=Object.keys(e).length;n<o;n++){var r=Pe({},e[parseInt(n.toString(),10)]),s=(r.taskData=e[parseInt(n.toString(),10)],0),a=(this.storedIndex++,Object.prototype.hasOwnProperty.call(r,"index")||(r.index=this.storedIndex),r[this.parent.childMapping]),l=!je(a)&&0<a.length,h=GZ(this.parent),d=r[this.parent.hasChildMapping],p=(r.hasChildRecords=!!(l&&!h||d&&h),(!je(a)&&!h||d&&h)&&(this.parent.enableCollapseAll||!je(this.parent.dataStateChange)&&je(a)?r.expanded=!1:r.expanded=!!je(r[this.parent.expandStateMapping])||r[this.parent.expandStateMapping]),Object.prototype.hasOwnProperty.call(r,"index")||(r.index=(r.hasChildRecords,this.storedIndex)),this.isSelfReference&&je(r[this.parent.parentIdMapping])&&this.parent.parentData.push(r),r.uniqueID=$P(this.parent.element.id+"_data_"),x("uniqueIDCollection."+r.uniqueID,r,this.parent),je(t)||(delete(l=Pe({},t)).childRecords,delete l[this.parent.childMapping],this.isSelfReference&&delete l.taskData[this.parent.childMapping],r.parentItem=l,r.parentUniqueID=l.uniqueID,s=t.level+1),Object.prototype.hasOwnProperty.call(r,"level")||(r.level=s),r.checkboxState="uncheck","remoteCollapsedData");if(this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&qZ(this.parent)&&!this.parent.initialRender){if(!r.hasChildRecords&&je(r[""+this.parent.parentIdMapping])){r.hasChildRecords=!0;for(var c=0;c<this.parent[p].length;c++)this.parent[p][parseInt(c.toString(),10)][""+this.parent.idMapping]===r[""+this.parent.idMapping]&&(r.expanded=!1)}else 0===r.level&&je(t)&&!r.hasChildRecords&&(r.level=r.level+1);r[""+this.parent.hasChildMapping]&&!je(r[""+this.parent.expandStateMapping])&&(r.expanded=r[""+this.parent.expandStateMapping],r.hasChildRecords=!0),this.parent.flatData.push(r)}else(je(r[""+this.parent.parentIdMapping])||r.parentItem)&&(!je(this.parent.rowDropSettings.targetID)&&this.parent.rowDragAndDropModule.isDuplicateData(r)||this.parent.flatData.push(r),this.parent.infiniteScrollData.push(r));this.isSelfReference||0!==r.level||this.parent.parentData.push(r),je(r[this.parent.childMapping]&&r[this.parent.childMapping].length)||(d=this.createRecords(r[this.parent.childMapping],r),r.childRecords=d),i.push(r)}return i},C$.prototype.dataProcessor=function(e){var t=FB("isExport",e),i=FB("expresults",e),n=FB("exportType",e),o=FB("isPrinting",e),r=FB("actionArgs",e),s=FB("requestType",e),a=FB("data",e),l=FB("action",e),h=r,d=this.parent.getPrimaryKeyFieldNames()[0],p=FB("data",h),h=(je(h)||je(h.action)||"add"!==h.action||je(h.data)||!je(h.data[""+d])||(h.data[""+d]=e.result[h.index][""+d],p.taskData[""+d]=e.result[h.index][""+d]),(!je(r)&&Object.keys(r).length||"save"===s)&&(s=s||r.requestType,a=a||FB("data",r),l=l||FB("action",r),"Batch"===this.parent.editSettings.mode&&(this.batchChanges=this.parent.grid.editModule.getBatchChanges()),this.parent.isLocalData)&&this.updateAction(a,l,s),(p=t&&!je(i)?i:GZ(this.parent)?R("result",this.parent.grid.dataSource):this.parent.grid.dataSource)instanceof me?p.dataSource.json:p),d=(GZ(this.parent)?R("count",this.parent.dataSource):h.length,new ya),r=FB("query",e);if(je(r)||(v=r.queries.filter(function(e){return"onWhere"===e.fn}),f=r.queries.filter(function(e){return"onSearch"===e.fn})),(this.parent.grid.allowFiltering&&this.parent.grid.filterSettings.columns.length||0<this.parent.grid.searchSettings.key.length||!je(r)&&(v.length||f.length)&&this.parent.isLocalData)&&(je(r)&&(r=new ya,r=R("grid.renderModule.data",this.parent).filterQuery(r),r=R("grid.renderModule.data",this.parent).searchQuery(r)),a=r.queries.filter(function(e){return"onWhere"===e.fn}),l=r.queries.filter(function(e){return"onSearch"===e.fn}),d.queries=a.concat(l),s=new me(h).executeLocal(d),this.parent.notify("updateFilterRecs",{data:s}),h=this.dataResults.result,this.dataResults.result=null,0<this.parent.grid.aggregates.length)&&(c=FB("query",e),je(r)&&(r=R("grid.renderModule.data",this.parent).aggregateQuery(new ya)),je(c)||(y=c.queries.filter(function(e){return"onAggregates"===e.fn}),h=this.parent.summaryModule.calculateSummaryValue(y,h,!0))),this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length&&(y=(i=je(i=FB("query",e))?R("grid.renderModule.data",this.parent).aggregateQuery(new ya):i).queries.filter(function(e){return"onAggregates"===e.fn}),h=this.parent.summaryModule.calculateSummaryValue(y,this.parent.flatData,!0)),0<this.parent.grid.sortSettings.columns.length||this.isSortAction){this.isSortAction=!1;for(var p=this.parent.parentData,c=FB("query",e),u=new ya,g=this.parent.grid.sortSettings.columns.length-1;0<=g;g--){var m=this.parent.grid.renderModule.data.getColumnByField(this.parent.grid.sortSettings.columns[parseInt(g.toString(),10)].field),m=m.sortComparer&&$Z(this.parent)?m.sortComparer.bind(m):this.parent.grid.sortSettings.columns[parseInt(g.toString(),10)].direction;u.sortBy(this.parent.grid.sortSettings.columns[parseInt(g.toString(),10)].field,m)}var f,y,v=new me(p).executeLocal(u),l=(this.parent.allowRowDragAndDrop&&!je(this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition&&(f=v.indexOf(this.parent.rowDragAndDropModule.draggedRecord),v.splice(f,1),a=v.indexOf(this.parent.rowDragAndDropModule.droppedRecord),this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"topSegment"===this.parent.rowDragAndDropModule.dropPosition?v.splice(a,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&v.splice(a+1,0,this.parent.rowDragAndDropModule.draggedRecord)),{modifiedData:v,filteredData:h,srtQry:u});this.parent.notify("createSort",l),h=l.modifiedData,this.dataResults.result=null,this.sortedData=h,this.parent.notify("updateModel",{}),0<this.parent.grid.aggregates.length&&!je(c)&&(y=FB("query",e).queries.filter(function(e){return"onAggregates"===e.fn}),h=this.parent.summaryModule.calculateSummaryValue(y,this.sortedData,!1))}d=GZ(this.parent)?R("count",this.parent.dataSource):h.length,s=this.paging(h,d,t,o,n,e);h=s.result,d=s.count,e.result=h,e.count=d,this.parent.notify("updateResults",e)},C$.prototype.paging=function(e,t,i,n,o,r){!this.parent.allowPaging||i&&"CurrentPage"!==o||n&&"CurrentPage"!==this.parent.printMode?!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||i&&"CurrentPage"!==o||"save"===R("requestType",r)||(i=this.parent.enableInfiniteScrolling?r:R("actionArgs",r),this.parent.notify($J,{result:e,count:t,actionArgs:i}),e=this.dataResults.result,t=this.dataResults.count):(this.parent.notify($J,{result:e,count:t,actionArgs:r}),e=this.dataResults.result,t=GZ(this.parent)?R("count",this.parent.dataSource):this.dataResults.count);o="isCollapsedStatePersist";if((!0===n||r.isPdfExport&&(je(r[o])||r[o]))&&"AllPages"===this.parent.printMode){for(var s=[],a=0;a<e.length;a++)JZ(this.parent,e[parseInt(a.toString(),10)],this.parent.parentData)&&s.push(e[parseInt(a.toString(),10)]);t=(e=s).length}return{result:e,count:t}},C$.prototype.updateData=function(e){this.dataResults=e},C$.prototype.updateAction=function(e,t,i){"delete"!==i&&"save"!==i||this.parent.notify(rZ,{value:e,action:t||i}),"batchsave"===i&&"Batch"===this.parent.editSettings.mode&&this.parent.notify(vZ,{})};var v$,b$,w$=C$;function C$(e){this.addedRecords="addedRecords",this.parent=e,this.parentItems=[],this.taskIds=[],this.hierarchyData=[],this.storedIndex=-1,this.sortedData=[],this.isSortAction=!1,this.addEventListener(),this.dataResults={},this.isSelfReference=!je(this.parent.parentIdMapping)}(x$=v$=v$||{})[x$.Add=0]="Add",x$[x$.Edit=1]="Edit",x$[x$.Update=2]="Update",x$[x$.Delete=3]="Delete",x$[x$.Cancel=4]="Cancel",x$[x$.Search=5]="Search",x$[x$.ExpandAll=6]="ExpandAll",x$[x$.CollapseAll=7]="CollapseAll",x$[x$.ExcelExport=8]="ExcelExport",x$[x$.PdfExport=9]="PdfExport",x$[x$.CsvExport=10]="CsvExport",x$[x$.Print=11]="Print",x$[x$.RowIndent=12]="RowIndent",x$[x$.RowOutdent=13]="RowOutdent",(x$=b$=b$||{})[x$.AutoFit=0]="AutoFit",x$[x$.AutoFitAll=1]="AutoFitAll",x$[x$.SortAscending=2]="SortAscending",x$[x$.SortDescending=3]="SortDescending",x$[x$.Edit=4]="Edit",x$[x$.Delete=5]="Delete",x$[x$.Save=6]="Save",x$[x$.Cancel=7]="Cancel",x$[x$.PdfExport=8]="PdfExport",x$[x$.ExcelExport=9]="ExcelExport",x$[x$.CsvExport=10]="CsvExport",x$[x$.FirstPage=11]="FirstPage",x$[x$.PrevPage=12]="PrevPage",x$[x$.LastPage=13]="LastPage",x$[x$.NextPage=14]="NextPage",x$[x$.AddRow=15]="AddRow",x$[x$.RowIndent=16]="RowIndent",x$[x$.RowOutdent=17]="RowOutdent",S$=function(e,t){return(S$=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])}))(e,t)};var S$,A$,x$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},x$=(function(e,t){function i(){this.constructor=e}S$(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(I$,A$=n),x$([e(12)],I$.prototype,"pageSize",void 0),x$([e(8)],I$.prototype,"pageCount",void 0),x$([e(1)],I$.prototype,"currentPage",void 0),x$([e()],I$.prototype,"totalRecordsCount",void 0),x$([e(!1)],I$.prototype,"enableQueryString",void 0),x$([e(!1)],I$.prototype,"pageSizes",void 0),x$([e(null)],I$.prototype,"template",void 0),x$([e("All")],I$.prototype,"pageSizeMode",void 0),I$);function I$(){return null!==A$&&A$.apply(this,arguments)||this}T$=function(e,t){return(T$=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])}))(e,t)};var T$,E$,D$=function(e,t){function i(){this.constructor=e}T$(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},M$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},k$=(D$(P$,E$=n),P$.prototype.setFormatter=function(e){this.format&&(this.format.skeleton||this.format.format)&&(this.formatFn=this.getFormatFunction(this.format))},P$.prototype.getFormatFunction=function(e){return e.type?this.intl.getDateFormat(e):this.intl.getNumberFormat(e)},P$.prototype.getFormatter=function(){return this.formatFn},P$.prototype.setTemplate=function(e){void 0===e&&(e={}),void 0!==this.footerTemplate&&(this.templateFn[M(LA,LA.Summary)]={fn:oo(this.footerTemplate,e),property:"footerTemplate"})},P$.prototype.getTemplate=function(e){return this.templateFn[M(LA,e)]},P$.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},M$([e()],P$.prototype,"type",void 0),M$([e()],P$.prototype,"footerTemplate",void 0),M$([e()],P$.prototype,"field",void 0),M$([e()],P$.prototype,"format",void 0),M$([e()],P$.prototype,"columnName",void 0),M$([e()],P$.prototype,"customAggregate",void 0),P$);function P$(){var e=null!==E$&&E$.apply(this,arguments)||this;return e.intl=new Ti,e.templateFn={},e}D$(F$,B$=n),M$([kt([],k$)],F$.prototype,"columns",void 0),M$([e(!0)],F$.prototype,"showChildSummary",void 0);var B$,D$=F$;function F$(){return null!==B$&&B$.apply(this,arguments)||this}L$=function(e,t){return(L$=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])}))(e,t)};var L$,R$,M$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},M$=(function(e,t){function i(){this.constructor=e}L$(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(O$,R$=n),M$([e(!1)],O$.prototype,"allowAdding",void 0),M$([e(!1)],O$.prototype,"allowEditing",void 0),M$([e(!1)],O$.prototype,"allowDeleting",void 0),M$([e("Cell")],O$.prototype,"mode",void 0),M$([e("Top")],O$.prototype,"newRowPosition",void 0),M$([e(!0)],O$.prototype,"allowEditOnDblClick",void 0),M$([e(!0)],O$.prototype,"showConfirmDialog",void 0),M$([e(!1)],O$.prototype,"showDeleteConfirmDialog",void 0),M$([e("")],O$.prototype,"template",void 0),M$([e({})],O$.prototype,"dialog",void 0),M$([e(!1)],O$.prototype,"allowNextRowEdit",void 0),O$);function O$(){return null!==R$&&R$.apply(this,arguments)||this}N$=function(e,t){return(N$=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])}))(e,t)};var N$,V$,_$=function(e,t){function i(){this.constructor=e}N$(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},H$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},z$=(_$(j$,V$=n),H$([e()],j$.prototype,"field",void 0),H$([e()],j$.prototype,"direction",void 0),j$);function j$(){return null!==V$&&V$.apply(this,arguments)||this}_$(Q$,W$=n),H$([kt([],z$)],Q$.prototype,"columns",void 0),H$([e(!0)],Q$.prototype,"allowUnsort",void 0);var W$,_$=Q$;function Q$(){return null!==W$&&W$.apply(this,arguments)||this}function U$(e,r,s,a,t,l,i){var h,d,n=e.value,p=e.action,c=r.grid.getPrimaryKeyFieldNames()[0],u=r.dataSource instanceof me?r.dataSource.dataSource.json:r.dataSource,g=[],m=n,o=!1;if("Batch"===r.editSettings.mode&&(d=r.grid.editModule.getBatchChanges()),("add"===p||"batchsave"===p&&"Batch"===r.editSettings.mode&&d.addedRecords.length)&&(n=(e=function(e,t,i,n,o,r){var s,a=!1,l=i.grid.getCurrentViewRecords();switch(s=t$(s=Pe({},e.value)),i.editSettings.newRowPosition){case"Top":t.unshift(s),a=!0;break;case"Bottom":t.push(s),a=!0;break;case"Above":s=je(r)?t$(s=Pe({},l[n+1])):t$(s=Pe({},r));break;case"Below":case"Child":var h,d;je(r)?(h=i.grid.getPrimaryKeyFieldNames()[0],d=l[parseInt(n.toString(),10)],s=t$(s=!je(d)&&d[""+h]===e.value[""+h]||-1!==o?Pe({},d):Pe({},e.value)),i.editModule.internalProperties.taskData=s):s=t$(s=Pe({},r)),-1===o&&(t.unshift(s),a=!0)}return{value:s,isSkip:a}}(e,u,r,a,t,i)).value,o=e.isSkip),n instanceof Array?g=e$(n):g.push(Pe({},n)),!o&&("add"!==p||"Top"!==r.editSettings.newRowPosition&&"Bottom"!==r.editSettings.newRowPosition))for(var f=0;f<g.length;f++){"object"==typeof g[parseInt(f.toString(),10)][""+c]&&(g[parseInt(f.toString(),10)]=g[parseInt(f.toString(),10)][""+c]);for(var y=g[parseInt(f.toString(),10)].taskData?Object.keys(g[parseInt(f.toString(),10)].taskData):Object.keys(g[parseInt(f.toString(),10)]),v=u.length,b=function(){if(u[parseInt(v.toString(),10)][""+c]===g[parseInt(f.toString(),10)][""+c]){if("delete"!==p){var e;if("edit"===p)for(h=0;h<y.length;h++)Object.prototype.hasOwnProperty.call(u[parseInt(v.toString(),10)],y[parseInt(h.toString(),10)])&&("Cell"!==r.editSettings.mode||!je(d)&&0===d.changedRecords.length||y[parseInt(h.toString(),10)]===l)&&(e=i$(r,g[parseInt(f.toString(),10)].uniqueID),u[parseInt(v.toString(),10)][y[parseInt(h.toString(),10)]]=g[parseInt(f.toString(),10)][y[parseInt(h.toString(),10)]],e)&&e.taskData&&(e.taskData[y[parseInt(h.toString(),10)]]=e[y[parseInt(h.toString(),10)]]=u[parseInt(v.toString(),10)][y[parseInt(h.toString(),10)]]);else"add"!==p&&"batchsave"!==p||("Child"===r.editSettings.newRowPosition?s?(m.taskData[""+r.parentIdMapping]=u[parseInt(v.toString(),10)][""+r.idMapping],u.splice(v+1,0,m.taskData)):(Object.prototype.hasOwnProperty.call(u[parseInt(v.toString(),10)],r.childMapping)||(u[parseInt(v.toString(),10)][""+r.childMapping]=[]),u[parseInt(v.toString(),10)][""+r.childMapping].push(m.taskData),q$(c,u[parseInt(v.toString(),10)],p,r,s,m)):"Below"===r.editSettings.newRowPosition?(u.splice(v+1,0,m.taskData),je(m.parentItem)||q$(c,u[v+1],p,r,s,m)):a?"Above"===r.editSettings.newRowPosition&&(u.splice(v,0,m.taskData),je(m.parentItem)||q$(c,u[parseInt(v.toString(),10)],p,r,s,m)):u.splice(0,0,m.taskData));return"break"}var t=u[parseInt(v.toString(),10)];if(u.splice(v,1),s){if(!je(t[""+r.parentIdMapping]))for(var i=r.flatData.filter(function(e){return e[""+r.idMapping]===t[""+r.parentIdMapping]})[0],n=i?i[""+r.childMapping]:[],o=n.length-1;0<=o;o--)if(n[parseInt(o.toString(),10)][""+r.idMapping]===t[""+r.idMapping]){r.enableImmutableMode||i.childRecords.length!==i.Children.length||i.childRecords.splice(o,1),n.splice(o,1),n.length||(i.hasChildRecords=!1,q$(c,i,p,r,s));break}return"break"}}else!je(u[parseInt(v.toString(),10)][""+r.childMapping])&&function e(t,i,n,o,r,s,a,l){var h=!1;var d=t.length;for(;d--&&0<=d;)if(t[parseInt(d.toString(),10)][""+o]===i[""+o]||s&&t[parseInt(d.toString(),10)][r.parentIdMapping]===i[r.idMapping]){if("edit"===n){for(var p,c=Object.keys(i),u=i$(r,i.uniqueID),g=0;g<c.length;g++)!Object.prototype.hasOwnProperty.call(t[parseInt(d.toString(),10)],c[parseInt(g.toString(),10)])||"Cell"===r.editSettings.mode&&c[parseInt(g.toString(),10)]!==l||(u[c[parseInt(g.toString(),10)]]=u.taskData[c[parseInt(g.toString(),10)]]=t[parseInt(d.toString(),10)][c[parseInt(g.toString(),10)]]=i[c[parseInt(g.toString(),10)]],"Normal"!==r.grid.editSettings.mode)||"Cell"!==r.editSettings.mode||je(r.grid.editModule)||(p="editModule",r.grid.editModule[p].editRowIndex=i.index,r.grid.editModule[p].updateCurrentViewData(i));break}"add"===n||"batchsave"===n?"Child"===r.editSettings.newRowPosition?(s?(a[""+r.parentIdMapping]=t[parseInt(d.toString(),10)][r.idMapping],t.splice(d+1,0,a)):(Object.prototype.hasOwnProperty.call(t[parseInt(d.toString(),10)],r.childMapping)||(t[parseInt(d.toString(),10)][r.childMapping]=[]),t[parseInt(d.toString(),10)][r.childMapping].push(a.taskData)),q$(o,t[parseInt(d.toString(),10)],n,r,s,a)):"Above"===r.editSettings.newRowPosition?(t.splice(d,0,a.taskData),je(a.parentItem)||q$(o,t[parseInt(d.toString(),10)],n,r,s,a)):"Below"===r.editSettings.newRowPosition&&(t.splice(d+1,0,a.taskData),je(a.parentItem)||q$(o,t[parseInt(d.toString(),10)],n,r,s,a)):(t.splice(d,1),t.length||(h=!0))}else je(t[parseInt(d.toString(),10)][r.childMapping])||e(t[parseInt(d.toString(),10)][r.childMapping],i,n,o,r,s,a,l)&&q$(o,t[parseInt(d.toString(),10)],n,r,s);return h}(u[parseInt(v.toString(),10)][""+r.childMapping],g[parseInt(f.toString(),10)],p,c,r,s,m,l)&&q$(c,u[parseInt(v.toString(),10)],p,r,s)};v--&&0<=v;)if("break"===b())break}}function q$(i,n,e,t,o,r){if("Above"!==t.editSettings.newRowPosition&&"Below"!==t.editSettings.newRowPosition||"add"!==e&&"batchsave"!==e||je(r.parentItem)){for(var s,a=t.grid.getCurrentViewRecords(),l=(a.map(function(e,t){e[""+i]===n[""+i]&&(s=t)}),t.enableVirtualization&&je(s)&&(p=R("uniqueIDCollection."+r.parentUniqueID,t),n=p),je(s)||(n=a[parseInt(s.toString(),10)]),t.enableVirtualization&&je(n)&&!je(r)&&(n=R("uniqueIDCollection."+r.parentUniqueID,t)),o||je(n.childRecords)||!n.childRecords.length?n.hasChildRecords=!1:n.hasChildRecords=!0,"add"!==e&&"batchsave"!==e||(n.expanded=!0,n.hasChildRecords=!0,p=(r=t.sortSettings.columns.length&&je(r)?a.filter(function(e){return e.parentUniqueID===n.uniqueID?e:null}):r)?r instanceof Array?r[0]:r:a[s+1],"Below"!==t.editSettings.newRowPosition&&(Object.prototype.hasOwnProperty.call(n,"childRecords")?je(r)||n[""+i]===r[""+i]||n.childRecords.push(r):n.childRecords=[],-1===n.childRecords.indexOf(p)&&n[""+i]!==r[""+i]&&n.childRecords.unshift(p),o)&&(Object.prototype.hasOwnProperty.call(n,t.childMapping)||(n[t.childMapping]=[]),-1===n[""+t.childMapping].indexOf(p))&&n[""+i]!==r[""+i]&&n[t.childMapping].unshift(p)),t.grid.getPrimaryKeyFieldNames()[0]),h=t.grid.dataSource instanceof me?t.grid.dataSource.dataSource.json:t.grid.dataSource,d=0;d<h.length;d++)if(h[parseInt(d.toString(),10)][""+l]===n[""+l]){h[parseInt(d.toString(),10)]=n;break}t.grid.setRowData(i,n);var p,a=t.getRowByIndex(s),o=("Batch"===t.editSettings.mode&&(a="add"===e?t.getRows()[t.grid.getCurrentViewRecords().indexOf(n)]:t.getRows()[t.grid.getRowIndexByPrimaryKey(n[""+i])]),void 0);(t.frozenRows||t.getFrozenColumns())&&(o=t.getRowByIndex(s)),(t.enableVirtualization||je(a))&&je(o)||(p=t.treeColumnIndex,t.allowRowDragAndDrop&&t.enableImmutableMode&&(p+=1),t.renderModule.cellRender({data:n,cell:a.cells[parseInt(p.toString(),10)]?a.cells[parseInt(p.toString(),10)]:o.cells[p-t.getFrozenColumns()],column:t.grid.getColumns()[t.treeColumnIndex],requestType:e}),(t.enableImmutableMode&&"indenting"===t.action||"outdenting"===t.action)&&t.renderModule.RowModifier({data:n,row:a}))}else i$(t,r.parentItem.uniqueID).childRecords.push(r)}G$=function(e,t){return(G$=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])}))(e,t)};var G$,Y$,H$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},H$=(function(e,t){function i(){this.constructor=e}G$(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(X$,Y$=n),H$([e(!1)],X$.prototype,"enableCache",void 0),H$([e(3)],X$.prototype,"maxBlocks",void 0),H$([e(3)],X$.prototype,"initialBlocks",void 0),X$);function X$(){return null!==Y$&&Y$.apply(this,arguments)||this}K$=function(e,t){return(K$=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])}))(e,t)};var K$,J$,Z$,$$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},eee=(function(e,t){function i(){this.constructor=e}K$(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(tee,J$=Ji),(Z$=tee).prototype.excelExport=function(e,t,i,n){return this.excelExportModule.Map(e,t,i,n,!1)},tee.prototype.csvExport=function(e,t,i,n){return this.excelExportModule.Map(e,t,i,n,!0)},tee.prototype.pdfExport=function(e,t,i,n){return this.pdfExportModule.Map(e,t,i,n)},tee.prototype.serverExcelExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},tee.prototype.serverPdfExport=function(e){this.isExcel=!1,this.exportTreeGrid(e)},tee.prototype.serverCsvExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},tee.prototype.exportTreeGrid=function(e){var t=this.grid.getDataModule().generateQuery(!0),t=(new Ba).processQuery(new me({url:""}),t),t=JSON.parse(t.data),i=JSON.parse(this.addOnPersist(["allowPaging","pageSettings","sortSettings","allowPdfExport","allowExcelExport","aggregates","filterSettings","columns","locale","searchSettings","idMapping","parentIdMapping","childMapping","treeColumnIndex"])),t=(i.filterSettings.columns=t.where,i.searchSettings.fields=t.search&&t.search[0].fields||[],i.sortSettings.columns=t.sorted,i.columns=this.setHeaderText(i.columns,["field","headerText","type","format","visible","template","index","width","textAlign","headerTextAlign","columns"]),this.createElement("form",{id:"ExportForm"})),n=(t.style.display="none",this.createElement("input",{id:"treeGridInput",attrs:{name:"treeGridModel"}}));n.value=JSON.stringify(i),t.method="POST",t.action=e,t.appendChild(n),document.body.appendChild(t),t.submit(),t.remove()},tee.prototype.setHeaderText=function(e,t){for(var i=0;i<e.length;i++)for(var n=this.getColumnByUid(e[parseInt(i.toString(),10)].uid),o=(this.stackedHeader&&je(n)&&(n=je(e[parseInt(i.toString(),10)].field)?e[parseInt(i.toString(),10)]:this.getColumnByField(e[parseInt(i.toString(),10)].field)),e[parseInt(i.toString(),10)].headerText=n.headerText,je(n.template)||(e[parseInt(i.toString(),10)].template="true"),e[parseInt(i.toString(),10)].format&&(e[parseInt(i.toString(),10)].format=yF(this.getFormat(n.format),n.type,!1,this.currencyCode),this.isExcel||"datetime"!==n.type&&"date"!==n.type||(e[parseInt(i.toString(),10)].format=e[parseInt(i.toString(),10)].format.toString().replace("AM/PM","tt")),e[parseInt(i.toString(),10)].type=n.type),e[parseInt(i.toString(),10)].columns&&this.setHeaderText(e[parseInt(i.toString(),10)].columns,t),Object.keys(e[parseInt(i.toString(),10)])),r=0;r<o.length;r++)t.indexOf(o[parseInt(r.toString(),10)])<0&&delete e[parseInt(i.toString(),10)][o[parseInt(r.toString(),10)]];return e},tee.prototype.getFormat=function(e){return"object"==typeof e?je(e.format)?e.skeleton:e.format:e},tee.prototype.getModuleName=function(){return"treegrid"},tee.prototype.preRender=function(){this.TreeGridLocale(),this.initProperties(),this.defaultLocale={Above:"Above",Below:"Below",Child:"Child",AddRow:"Add Row",ExpandAll:"Expand All",CollapseAll:"Collapse All",RowIndent:"Indent",RowOutdent:"Outdent"},this.l10n=new Cn("treegrid",this.defaultLocale,this.locale),this.isSelfReference&&je(this.childMapping)&&(this.childMapping="Children")},tee.prototype.sortByColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},tee.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},tee.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},tee.prototype.search=function(e){this.grid.search(e)},tee.prototype.autoFitColumns=function(e){this.resizeModule.autoFitColumns(e),this.updateColumnModel()},tee.prototype.reorderColumns=function(e,t){this.grid.reorderColumns(e,t)},tee.prototype.TreeGridLocale=function(){var e,t,i;je(this.locale)||(e=Cn.locale,x(this.locale,{},t={}),i={},i=FB(this.locale,e),x("grid",FB(this.getModuleName(),i),FB(this.locale,t)),Cn.load(t))},tee.prototype.print=function(){this.printModule.print()},tee.prototype.treeGridkeyActionHandler=function(e){if(this.allowKeyboard){var t,i,n=void 0,o=void 0,r=void 0,s=void 0,a=void 0;switch(e.action){case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"ctrlShiftUpArrow":je(r=(n=e.target).closest(".e-rowcell"))||je(s=r.closest("tr"))||je(s.getElementsByClassName("e-treegridexpand")[0])||this.expandCollapseRequest(s.querySelector(".e-treegridexpand"));break;case"ctrlShiftDownArrow":je(r=(n=e.target).closest(".e-rowcell"))||je(s=r.closest("tr"))||je(s.getElementsByClassName("e-treegridcollapse")[0])||this.expandCollapseRequest(s.querySelector(".e-treegridcollapse"));break;case"downArrow":!this.enableVirtualization&&je(this.rowTemplate)&&(je((n=e.target).querySelectorAll(".e-rowcell"))||(n=A(n,"e-rowcell")),je(n)||je(o=n.parentElement)||(i=o.cellIndex,"dropdownedit"===this.grid.getColumnByIndex(i).editType&&je(this.grid.getColumnByIndex(i).edit.obj)&&(o=n),null!==(a=this.findnextRowElement(o))?(t=n.cellIndex,je(t=a.children[parseInt(t.toString(),10)])||this.grid.isEdit||(U([t],"e-focused"),U([t],"e-focus"))):this.clearSelection()));break;case"upArrow":!this.enableVirtualization&&je(this.rowTemplate)&&(je((n=e.target).querySelectorAll(".e-rowcell"))||(n=A(n,"e-rowcell")),je(n)||je(o=n.parentElement)||(i=o.cellIndex,"dropdownedit"===this.grid.getColumnByIndex(i).editType&&je(this.grid.getColumnByIndex(i).edit.obj)&&(o=n),null!==(a=this.findPreviousRowElement(o))?je(t=n.cellIndex)||je(i=a.children[parseInt(t.toString(),10)])||this.grid.isEdit||(U([i],"e-focused"),U([i],"e-focus")):this.clearSelection()))}}},tee.prototype.findnextRowElement=function(e){e=e.nextElementSibling;return e=null===e||-1===e.className.indexOf("e-summaryrow")&&!e.classList.contains("e-childrow-hidden")?e:this.findnextRowElement(e)},tee.prototype.findPreviousRowElement=function(e){e=e.previousElementSibling;return e=null===e||-1===e.className.indexOf("e-summaryrow")&&!e.classList.contains("e-childrow-hidden")?e:this.findPreviousRowElement(e)},tee.prototype.initProperties=function(){this.defaultLocale={},this.flatData=[],this.infiniteScrollData=[],this.remoteCollapsedData=[],this.remoteExpandedData=[],this.parentData=[],this.columnModel=[],this.isExpandAll=!1,this.isCollapseAll=!1,this.keyConfigs={ctrlDownArrow:"ctrl+downarrow",ctrlUpArrow:"ctrl+uparrow",ctrlShiftUpArrow:"ctrl+shift+uparrow",ctrlShiftDownArrow:"ctrl+shift+downarrow",downArrow:"downArrow",upArrow:"upArrow"},this.isLocalData=!(this.dataSource instanceof me)||this.dataSource.dataSource.offline||!je(this.dataSource.ready)||this.dataSource.adaptor instanceof Ga,this.isSelfReference=!je(this.parentIdMapping)},tee.prototype.wireEvents=function(){E.add(this.grid.element,"click",this.mouseClickHandler,this),E.add(this.element,"touchend",this.mouseClickHandler,this),this.keyboardModule=new bn(this.element,{keyAction:this.treeGridkeyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.allowKeyboard&&(this.element.tabIndex=-1===this.element.tabIndex?0:this.element.tabIndex)},tee.prototype.requiredModules=function(){var e,t,i=[];return je(this.changedProperties.columns)&&this.grid.splitFrozenCount(this.getColumns()),this.isDestroyed||(i.push({member:"filter",args:[this,this.filterSettings],name:"Filter"}),je(this.toolbar)||i.push({member:"toolbar",args:[this],name:"Toolbar"}),this.contextMenuItems&&i.push({member:"contextMenu",args:[this],name:"ContextMenu"}),this.allowPaging&&i.push({member:"pager",args:[this,this.pageSettings],name:"Page"}),this.allowReordering&&i.push({member:"reorder",args:[this],name:"Reorder"}),this.allowSorting&&i.push({member:"sort",args:[this],name:"Sort"}),0<this.aggregates.length&&i.push({member:"summary",args:[this],name:"Aggregate"}),this.resizeCheck()&&i.push({member:"resize",args:[this],name:"Resize"}),this.allowExcelExport&&i.push({member:"ExcelExport",args:[this],name:"ExcelExport"}),e=this.injectedModules.filter(function(e){return"freeze"===e.prototype.getModuleName()}),t=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze}),(this.frozenColumns||this.frozenRows||this.getFrozenColumns()||t)&&0<e.length&&i.push({member:"freeze",args:[this],name:"Freeze"}),this.detailTemplate&&i.push({member:"detailRow",args:[this],name:"DetailRow"}),this.allowPdfExport&&i.push({member:"PdfExport",args:[this],name:"PdfExport"}),this.showColumnMenu&&i.push({member:"columnMenu",args:[this],name:"ColumnMenu"}),this.showColumnChooser&&i.push({member:"ColumnChooser",args:[this],name:"ColumnChooser"}),this.extendRequiredModules(i)),i},tee.prototype.resizeCheck=function(){var e=!(!this.showColumnMenu||this.columnMenuItems&&!this.columnMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length),t=!(!this.contextMenuItems||!this.contextMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length);return this.allowResizing||e||t},tee.prototype.extendRequiredModules=function(e){var t=this.injectedModules.filter(function(e){return"rowDragAndDrop"===e.prototype.getModuleName()});(this.allowRowDragAndDrop||t.length)&&(je(this.toolbar)||!this.toolbar.includes("Indent")&&!this.toolbar.includes("Outdent")||(this.isIndentEnabled=!0),e.push({member:"rowDragAndDrop",args:[this],name:"RowDD"})),(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&e.push({member:"edit",args:[this],name:"Edit"}),!je(this.columns)&&this.isCommandColumn(this.columns)&&e.push({member:"commandColumn",args:[this],name:"CommandColumn"}),this.allowSelection&&e.push({member:"selection",args:[this],name:"Selection"}),this.enableVirtualization&&e.push({member:"virtualScroll",args:[this],name:"VirtualScroll"}),this.enableInfiniteScrolling&&e.push({member:"infiniteScroll",args:[this],name:"InfiniteScroll"}),e.push({member:"logger",args:[this.grid]})},tee.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},tee.prototype.unwireEvents=function(){this.grid&&this.grid.element&&E.remove(this.grid.element,"click",this.mouseClickHandler),this.element&&(E.remove(this.element,"touchend",this.mouseClickHandler),this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null),this.allowKeyboard)&&this.element.removeAttribute("tabIndex")},tee.prototype.log=function(e,t){this.loggerModule&&this.loggerModule.treeLog(e,t,this)},tee.prototype.render=function(){var i=this,e=(this.isReact&&(this.grid.isReact=!0,this.grid.portals=[]),this.isVue&&(this.grid.isVue=!0,this.grid.vueInstance=this.vueInstance),mA({target:this.element},this.createElement),this.log(["mapping_fields_missing"]),this.renderModule=new f$(this),this.dataModule=new w$(this),this.printModule=new s$(this),this.trigger("load"),this.autoGenerateColumns(),this.initialRender=!0,je(this.dataSource)||this.convertTreeData(this.dataSource),this.loadGrid(),this.element.classList.contains("e-treegrid")&&this.rowDropSettings.targetID&&(this.grid.rowDropSettings.targetID+="_gridcontrol"),this.addListener(),Q("div",{id:this.element.id+"_gridcontrol",className:"e-treelistgrid"})),n=(U([this.element],"e-treegrid"),je(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),je(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.element.appendChild(e),this.grid.requiredModules);this.grid.requiredModules=function(){for(var e=[],e=n.apply(this),t=0;t<e.length;t++)"virtualscroll"===e[parseInt(t.toString(),10)].member&&(e[parseInt(t.toString(),10)].member="treeVirtualScroll");return e};this.grid.root=this.root||this,this.grid.appendTo(e),this.actionFailureHandler();this.element.getElementsByClassName("e-gridcontent")[0].childNodes[0].setAttribute("tabindex","0");var e=this.element.getElementsByClassName("e-content")[0].querySelector(".e-table"),e=(je(e)||e.setAttribute("role","treegrid"),this.isIndentEnabled&&this.refreshToolbarItems(),this.wireEvents(),this.renderComplete(),"destroyTemplate"),o=this.grid[e];this.grid[e]=function(e,t){o.apply(i.grid);i.isReact&&je(i.portals)||i.clearTemplate(e,t)}},tee.prototype.actionFailureHandler=function(){var i,t=this,e=[],n=this.getPrimaryKeyFieldNames(),o=this.flatData.length,n=((this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&0===n.length&&0!==o&&e.push("For the CRUD actions, it is necessary to enable Primary Key field for the unique data column."),this.allowRowDragAndDrop&&0===n.length&&0!==o&&e.push("For the Row Drag and Drop actions, it is necessary to enable Primary Key field for the unique data column."),this.allowPaging&&this.enableVirtualization&&e.push("Paging is not allowed in virtualization case."),0===o&&0===this.columns.length&&e.push("Either of the Data source or columns should be given."),0<this.frozenColumns&&this.columnModel.filter(function(e){return e.isFrozen})&&e.push("Use only one attribute for Frozen either IsFrozen or FrozenColumns."),this.enableVirtualization&&!je(this.detailTemplate)&&e.push("Virtual scrolling is not compatible with the detail template"),!(0<this.frozenColumns||0<this.frozenRows||this.columnModel.filter(function(e){return e.isFrozen}))||je(this.detailTemplate)&&je(this.rowTemplate)||e.push("Frozen rows and columns are not supported with the Detail template and row template."),(0<this.frozenColumns||0<this.columnModel.filter(function(e){return e.isFrozen}).length||0<this.frozenRows)&&"Cell"===this.editSettings.mode&&e.push("Frozen rows and columns are not supported with cell editing."),this.allowSelection&&!je(this.rowTemplate)&&e.push("Selection is not supported in RowTemplate"),this.treeColumnIndex>=this.columns.length&&e.push("TreeColumnIndex value should not exceed the total column count."),this.enableVirtualization&&(this.columnModel.some(function(e){return/%$/.test(e.width)})||/%$/.test(this.height.toString()))&&e.push("column width and height should be in pixels"),"Children"===this.childMapping||je(this.idMapping)||e.push("Both IdMapping and ChildMapping should not be used together for tree grid rendering."),(!je(this.idMapping)&&je(this.parentIdMapping)||je(this.idMapping)&&!je(this.parentIdMapping))&&e.push("IdMapping and ParentIdMapping properties should be defined and vice versa."),this.columnModel.filter(function(e){return e.showCheckbox})),o=this.columns[this.treeColumnIndex];0!==n.length&&(n!==o&&e.push("ShowCheckbox column should not be defined other than the tree column."),1<n.length)&&e.push("Only one column can have the ShowCheckbox option enabled."),null!==this.treeColumnIndex&&-1!==this.treeColumnIndex&&0!==this.columnModel.filter(function(e){return"Right"===e.textAlign&&e.field===t.columnModel[t.treeColumnIndex].field}).length&&e.push("TextAlign right for the tree column is not applicable."),0<e.length&&(i={error:{}},e.forEach(function(e,t){i.error[parseInt(t.toString(),10)]=e}),this.trigger(zZ,i))},tee.prototype.refreshToolbarItems=function(){var e=this.toolbarModule.getToolbar(),t=this.element.id+"_gridcontrol_indent",i=this.element.id+"_gridcontrol_outdent",t=e.querySelector("#"+t).parentElement,e=e.querySelector("#"+i).parentElement;t.classList.add("e-hidden"),e.classList.add("e-hidden")},tee.prototype.afterGridRender=function(){je(this.grid.clipboardModule)||this.grid.clipboardModule.destroy(),this.clipboardModule=this.grid.clipboardModule=new QZ(this,this.grid.serviceLocator)},tee.prototype.convertTreeData=function(e){var t,i=this;(e=GZ(this)?R("result",e):e)instanceof Array&&0<e.length&&Object.prototype.hasOwnProperty.call(e[0],"level")?(this.flatData=e,this.flatData.filter(function(t){x("uniqueIDCollection."+t.uniqueID,t,i),0!==t.level||i.parentData.some(function(e){return e.uniqueID===t.uniqueID})||i.parentData.push(t)})):GZ(this)?(t=R("result",this.dataSource),this.dataModule.convertToFlatData(t)):this.dataModule.convertToFlatData(e)},tee.prototype.bindGridProperties=function(){this.bindedDataSource(),this.grid.enableRtl=this.enableRtl,this.grid.allowKeyboard=this.allowKeyboard,this.grid.columns=this.getGridColumns(this.columns),this.grid.allowExcelExport=this.allowExcelExport,this.grid.allowPdfExport=this.allowPdfExport,this.grid.query=this.query,this.grid.columnQueryMode=this.columnQueryMode,this.grid.allowPaging=this.allowPaging,this.grid.pageSettings=qP(this.pageSettings),this.grid.pagerTemplate=this.pagerTemplate,this.grid.showColumnMenu=this.showColumnMenu,this.grid.allowSorting=this.allowSorting,this.grid.allowFiltering=this.allowFiltering,this.grid.enableVirtualization=this.enableVirtualization,this.grid.enableColumnVirtualization=this.enableColumnVirtualization,this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling,this.grid.infiniteScrollSettings=this.infiniteScrollSettings,this.grid.enableVirtualMaskRow=this.enableVirtualMaskRow,this.grid.loadingIndicator=this.loadingIndicator,this.grid.width=this.width,this.grid.height=this.height,this.grid.enableAltRow=this.enableAltRow,this.grid.allowReordering=this.allowReordering,this.grid.allowTextWrap=this.allowTextWrap,this.grid.allowResizing=this.allowResizing,this.grid.enableHover=this.enableHover,this.grid.enableAutoFill=this.enableAutoFill,this.grid.enableAdaptiveUI=this.enableAdaptiveUI,this.grid.enableImmutableMode=this.enableImmutableMode,this.grid.allowRowDragAndDrop=this.allowRowDragAndDrop,this.grid.rowDropSettings=qP(this.rowDropSettings),this.grid.rowHeight=this.rowHeight,this.grid.gridLines=this.gridLines,this.grid.allowSelection=this.allowSelection,this.grid.toolbar=qP(this.getGridToolbar()),this.grid.toolbarTemplate=this.toolbarTemplate,this.grid.showColumnChooser=this.showColumnChooser,this.grid.filterSettings=qP(this.filterSettings),this.grid.selectionSettings=qP(this.selectionSettings),this.grid.sortSettings=qP(this.sortSettings),this.grid.searchSettings=qP(this.searchSettings),this.grid.aggregates=qP(this.aggregates),this.grid.textWrapSettings=qP(this.textWrapSettings),this.grid.printMode=qP(this.printMode),this.grid.locale=qP(this.locale),this.grid.selectedRowIndex=this.selectedRowIndex,this.grid.contextMenuItems=qP(this.getContextMenu()),this.grid.columnMenuItems=qP(this.columnMenuItems),this.grid.editSettings=this.getGridEditSettings(),this.grid.rowTemplate=qP(this.rowTemplate),this.grid.detailTemplate=qP(this.detailTemplate),this.grid.frozenRows=this.frozenRows,this.grid.frozenColumns=this.frozenColumns,this.grid.clipMode=qP(this.clipMode);var e="templateDotnetInstance";this.grid[e]=this[e],this.grid.isJsComponent=!0;this.grid.enableHtmlSanitizer=this.enableHtmlSanitizer},tee.prototype.triggerEvents=function(e){this.trigger(FB("name",e),e)},tee.prototype.IsExpandCollapseClicked=function(e){this.isFromChartSide||je(e.target)||!(e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-summarycell"))||this.selectionSettings.checkboxOnly||(!je(e.data)&&e.data.hasChildRecords||-1!==e.rowIndex&&je(e.data))&&(e.cancel=!0)},tee.prototype.bindGridEvents=function(){var i=this;this.grid.rowSelecting=function(e){i.IsExpandCollapseClicked(e),!je(e.data)&&i.selectionSettings.persistSelection&&0<i.columnModel.filter(function(e){return"checkbox"===e.type}).length&&qZ(i)&&(je(e.data.parentItem)&&!e.isHeaderCheckboxClicked||(i.parentQuery=i.query.queries.filter(function(e){return e.e.field===i.parentIdMapping}),i.query.queries=i.query.queries.slice(0,0))),"Root"===i.pageSettings.pageSizeMode&&(i.grid.selectionModule.totalRecordsCount=i.grid.currentViewData.length),e.cancel||i.trigger(_J,e)},this.grid.rowDeselecting=function(e){i.IsExpandCollapseClicked(e),!je(e.data)&&i.selectionSettings.persistSelection&&0<i.columnModel.filter(function(e){return"checkbox"===e.type}).length&&qZ(i)&&(i.parentQuery=i.query.queries.filter(function(e){return e.e.field===i.parentIdMapping}),i.query.queries=i.query.queries.slice(0,0)),i.trigger(NZ,e)},this.grid.rowSelected=function(e){i.enableVirtualization&&i.virtualScrollModule.updateSelection(e),i.selectedRowIndex=i.grid.selectedRowIndex,i.notify(HJ,e),i.trigger(HJ,e)},this.grid.rowDeselected=function(e){i.selectedRowIndex=i.grid.selectedRowIndex,je(e.data)||i.notify(jJ,e),i.trigger(jJ,e)},this.grid.resizeStop=function(e){i.updateColumnModel(),i.trigger(qJ,e)},this.grid.excelQueryCellInfo=function(e){i.notify("excelCellInfo",e),i.dataResults},this.grid.pdfQueryCellInfo=function(e){i.notify("pdfCellInfo",e),i.dataResults},this.grid.checkBoxChange=function(e){i.trigger(zJ,e)},this.grid.pdfExportComplete=this.triggerEvents.bind(this),this.grid.excelExportComplete=this.triggerEvents.bind(this),this.grid.excelHeaderQueryCellInfo=this.triggerEvents.bind(this),this.grid.pdfHeaderQueryCellInfo=this.triggerEvents.bind(this),this.grid.dataSourceChanged=this.triggerEvents.bind(this),this.grid.recordDoubleClick=this.triggerEvents.bind(this),this.grid.cellDeselected=this.triggerEvents.bind(this),this.grid.cellDeselecting=this.triggerEvents.bind(this),this.grid.columnMenuOpen=this.triggerEvents.bind(this),this.grid.columnMenuClick=this.triggerEvents.bind(this),this.grid.cellSelected=this.triggerEvents.bind(this),this.grid.headerCellInfo=this.triggerEvents.bind(this),this.grid.resizeStart=this.triggerEvents.bind(this),this.grid.resizing=this.triggerEvents.bind(this),this.grid.columnDrag=this.triggerEvents.bind(this),this.grid.columnDragStart=this.triggerEvents.bind(this),this.grid.columnDrop=this.triggerEvents.bind(this),this.grid.beforePrint=this.triggerEvents.bind(this),this.grid.beforeCopy=this.triggerEvents.bind(this),this.grid.beforePaste=function(e){for(var t=i.getRows();t[e.rowIndex].classList.contains("e-summaryrow");)e.rowIndex++;i.trigger(oZ,e)},this.grid.load=function(){i.grid.on("initial-end",i.afterGridRender,i),je(i.loggerModule)||(i.loggerModule=i.grid.loggerModule=new MJ(i.grid))},this.grid.printComplete=this.triggerEvents.bind(this),this.grid.actionFailure=function(e){i.trigger(zZ,e)},this.extendedGridDataBoundEvent(),this.extendedGridEvents(),this.extendedGridActionEvents(),this.extendedGridEditEvents(),this.bindGridDragEvents(),this.bindCallBackEvents()},tee.prototype.lastRowBorder=function(e,t){for(var i=0;i<e.cells.length;i++)(t?U:q)([e.cells[parseInt(i.toString(),10)]],"e-lastrowcell")},tee.prototype.isPixelHeight=function(){return"auto"!==this.height&&-1===this.height.toString().indexOf("%")},tee.prototype.extendedGridDataBoundEvent=function(){var s=this,n=(this.grid.dataBound=function(e){if(s.updateRowTemplate(),s.updateColumnModel(),s.updateAltRow(s.getRows()),s.notify("dataBoundArg",e),!qZ(s)||$Z(s)||s.hasChildMapping||x("grid.contentModule.isLoaded",!(0<(s.dataResults.result?0:1)),s),s.isPixelHeight()&&s.initialRender)for(var t=s.getContentTable().rows,i=[].slice.call(t),n=i.length-1;0<n;n--)if(!n$(i[parseInt(n.toString(),10)])){i[parseInt(n.toString(),10)].nextElementSibling&&s.lastRowBorder(i[parseInt(n.toString(),10)],!0);break}if(s.enableVirtualization&&s.selectionSettings.persistSelection&&("expand"===s.dataResults.action||"collapse"===s.dataResults.action)&&(s.grid.selectionModule.refreshPersistSelection(),"Single"===s.grid.selectionSettings.type)&&(o="updateRowSelection",r=s.getCurrentViewRecords().indexOf(s.grid.selectionModule.data),s.grid.selectionModule[""+o](s.getRows()[parseInt(r.toString(),10)],r)),s.enableVirtualization&&s.selectionSettings.persistSelection&&!je(s.virtualScrollModule.prevSelectedRecord))for(n=0;n<s.virtualScrollModule.prevSelectedRecord.length;n++){var o="updateRowSelection",r=s.getCurrentViewRecords().indexOf(s.virtualScrollModule.prevSelectedRecord[parseInt(n.toString(),10)]);s.grid.selectionModule[""+o](s.getRows()[parseInt(r.toString(),10)],r)}s.trigger(FJ,e),s.initialRender=!1},this);this.grid.beforeDataBound=function(e){var t,i=FB("action",e);if((qZ(n)&&!$Z(n)||GZ(this))&&"edit"!==i?(n.notify("updateRemoteLevel",e),e=n.dataResults):0===n.flatData.length&&$Z(n)&&n.dataSource instanceof me&&(i=n.dataSource,n.dataModule.convertToFlatData(i.dataSource.json),e.result=n.grid.dataSource.dataSource.json=n.flatData),qZ(n)||GZ(this)||je(n.dataSource)||(this.isPrinting&&x("isPrinting",!0,e),n.notify("dataProcessor",e)),Pe(e,n.dataResults),n.enableImmutableMode&&(e.result=e.result.slice()),n.initialRender&&(this.contentModule.objectEqualityChecker=n.objectEqualityChecker),!this.isPrinting)return t=new ll,n.trigger(RJ,e,function(e){t.resolve(e)}),t},this.grid.log=function(e,t){s.loggerModule&&s.loggerModule.log(e,t)}},tee.prototype.bindCallBackEvents=function(){var n=this;this.grid.toolbarClick=function(t){var i;if(!(t.item.id===n.grid.element.id+"_excelexport"&&!1===n.allowExcelExport||t.item.id===n.grid.element.id+"_pdfexport"&&!1===n.allowPdfExport||t.item.id===n.grid.element.id+"_csvexport"&&!1===n.allowExcelExport))return i=new ll,n.trigger(WJ,t,function(e){e.cancel||n.notify(WJ,t),i.resolve(e)}),i},this.grid.cellSelecting=function(e){var t=n.grid.selectionModule.actualTarget,i=(je(t)||!t.classList.contains("e-treegridexpand")&&!t.classList.contains("e-treegridcollapse")||(e.cancel=!0),new ll);return n.trigger(FB("name",e),e,function(e){i.resolve(e)}),i},this.grid.beginEdit=function(e){var t;if(je(e.row)||!e.row.classList.contains("e-summaryrow"))return t=new ll,n.trigger(sZ,e,function(e){t.resolve(e)}),t;e.cancel=!0}},tee.prototype.extendedGridEditEvents=function(){var n=this;this.grid.dataStateChange=function(e){n.isExpandRefresh?(n.isExpandRefresh=!1,n.grid.dataSource={result:n.flatData,count:R("count",n.grid.dataSource)}):("infiniteScroll"!==e.action.requestType&&(n.infiniteScrollData=[]),n.trigger(NJ,e))},this.grid.cellSave=function(e){n.grid.isContextMenuOpen()&&(je(t=n.grid.contextMenuModule.contextMenu.element.getElementsByClassName("e-selected")[0])||t.id!==n.element.id+"_gridcontrol_cmenu_Save")&&(e.cancel=!0);var t,i=new ll;return n.trigger(hZ,e,function(e){e.cancel||n.notify(hZ,e),i.resolve(e)}),i},this.grid.cellSaved=function(e){n.trigger(dZ,e),n.notify(dZ,e)},this.grid.cellEdit=function(e){var t=new ll;return e.promise=t,n.notify(pZ,e),t},this.grid.batchAdd=function(e){n.trigger(gZ,e),n.notify(gZ,e)},this.grid.beforeBatchSave=function(e){n.trigger(yZ,e),n.notify(yZ,e)},this.grid.beforeBatchAdd=function(e){n.trigger(fZ,e),n.notify(fZ,e)},this.grid.batchDelete=function(e){n.trigger(cZ,e),n.notify(cZ,e)},this.grid.beforeBatchDelete=function(e){n.trigger(mZ,e),n.notify(mZ,e)},this.grid.batchCancel=function(e){"Cell"!==n.editSettings.mode&&n.trigger(uZ,e),n.notify(uZ,e)}},tee.prototype.updateRowTemplate=function(){var o=this;this.rowTemplate&&(this.isReact&&0===this.getContentTable().rows.length?setTimeout(function(){if(o.treeColumnRowTemplate(),o.enableCollapseAll)for(var e=o.getCurrentViewRecords(),t=o.getContentTable().rows,i=0;i<t.length;i++){var n={data:e[parseInt(i.toString(),10)],row:t[parseInt(i.toString(),10)]};o.renderModule.RowModifier(n)}},0):this.treeColumnRowTemplate())},tee.prototype.bindedDataSource=function(){var e,t,i,n="dataSource";this.dataSource&&GZ(this)?(e=this.flatData,t=R("count",this.dataSource),this.grid.dataSource={result:e,count:t}):this.grid.dataSource=this.dataSource instanceof me?new me(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor):this.flatData,this.dataSource instanceof me&&(this.dataSource.dataSource.offline||this.dataSource.ready)&&(this.grid.dataSource[n].json=e$(this.dataSource[n].json),this.grid.dataSource.ready=this.dataSource.ready,je((i=this).grid.dataSource.ready)||this.grid.dataSource.ready.then(function(e){var t=i.grid.dataSource;t[n].offline=!0,t.isDataAvailable=!0,t[n].json=e.result,t.adaptor=new Ma}))},tee.prototype.extendedGridActionEvents=function(){var o=this;this.grid.actionBegin=function(e){var t;if("sorting"===e.requestType&&e.target&&e.target.parentElement&&e.target.parentElement.classList.contains("e-hierarchycheckbox")&&(e.cancel=!0),"reorder"===FB("requestType",e)&&o.notify("getColumnIndex",{}),qZ(o)&&o.enableVirtualization&&("virtualscroll"===e.requestType?(o.query.expand("VirtualScrollingAction"),o.showSpinner()):"searching"===e.requestType&&""===e.searchString?o.query.expand("ClearSearchingAction"):"clearFilter"===e.action&&o.query.expand("ClearFilteringAction")),o.notify("actionBegin",{editAction:e}),qZ(o)||je(o.filterModule)||GZ(o)||0!==o.grid.filterSettings.columns.length||0!==o.grid.searchSettings.key.length||(o.notify("clearFilters",{flatData:o.grid.dataSource}),o.grid.setProperties({dataSource:o.dataResults.result},!0),je(o.grid.changedProperties.dataSource)&&(o.grid.renderModule.data.dataManager=o.grid.dataSource instanceof me?o.grid.dataSource:je(o.grid.dataSource)?new me:new me(o.grid.dataSource),o.grid.renderModule.data.isQueryInvokedFromData=!0,o.grid.query=o.grid.query instanceof ya?o.grid.query:new ya)),"indenting"!==o.action&&"outdenting"!==o.action)return t=new ll,o.trigger(OJ,e,function(e){e.cancel||o.notify(sZ,e),t.resolve(e)}),t},this.grid.actionComplete=function(e){var t,i,n;o.notify("actioncomplete",e),o.updateColumnModel(),o.updateTreeGridModel(),"reorder"===e.requestType&&o.notify("setColumnIndex",{}),o.notify("actionComplete",{editAction:e}),"add"===e.requestType&&"Top"!==o.editSettings.newRowPosition&&"Bottom"!==o.editSettings.newRowPosition&&o.notify(aZ,e),"batchsave"===e.requestType&&o.notify(vZ,e),o.notify("updateGridActions",e),"save"===e.requestType&&o.aggregates.map(function(e){return!0===e.showChildSummary}).length&&o.grid.refresh(),"filter"!==e.action||""===o.filterModule.currentFilterObject||!o.enableVirtualization||o.initialRender||qZ(o)&&o.enableVirtualization||o.expandAll(),"searching"!==e.requestType||""===o.searchSettings.key||!o.enableVirtualization||o.initialRender||qZ(o)&&o.enableVirtualization||o.expandAll(),"clearFilter"===e.action&&o.enableCollapseAll&&o.collapseAll(),"indenting"===o.action||"outdenting"===o.action?(o.action="indenting"===o.action?"indented":"outdented",i={data:t=[o.selectedRecords],dropIndex:o.dropIndex,dropPosition:o.dropPosition,modifiedRecords:o.modifiedRecords,requestType:o.action,row:o.selectedRows},o.trigger(VJ,i),o.getCurrentViewRecords().filter(function(e){return e.uniqueID===t[0].uniqueID}).length||o.refreshToolbarItems(),o.action="",o.selectedRecords=o.selectedRows=o.modifiedRecords=[]):(o.grid.isFrozenGrid()&&o.enableVirtualization&&"movable"===e.tableName&&(i=o.grid.element.querySelector("."+VZ),n=o.grid.element.querySelector("."+_Z),i.style.height=n.style.height="auto"),o.trigger(VJ,e))}},tee.prototype.extendedGridEvents=function(){var t=this,i=this;this.grid.recordDoubleClick=function(e){t.trigger(lZ,e),t.notify(lZ,e)},this.grid.detailDataBound=function(e){t.notify("detaildataBound",e),t.trigger(EZ,e)},this.grid.rowDataBound=function(e){je(this.isPrinting)?x("isPrinting",!1,e):x("isPrinting",this.isPrinting,e),i.renderModule.RowModifier(e)},this.grid.queryCellInfo=function(e){je(this.isPrinting)?x("isPrinting",!1,e):x("isPrinting",this.isPrinting,e),i.renderModule.cellRender(e)},this.grid.contextMenuClick=function(e){t.notify(iZ,e),t.trigger(iZ,e)},this.grid.contextMenuOpen=function(e){t.notify(tZ,e),t.trigger(tZ,e)},this.grid.queryCellInfo=function(e){t.renderModule.cellRender(e)}},tee.prototype.bindGridDragEvents=function(){var t=this;this.grid.rowDragStartHelper=function(e){t.trigger(MZ,e)},this.grid.rowDragStart=function(e){t.trigger(PZ,e)},this.grid.rowDrag=function(e){t.grid.isEdit?e.cancel=!0:(t.notify(LZ,e),t.trigger(DZ,e))},this.grid.rowDrop=function(e){t.grid.isEdit||t.notify(RZ,e),e.cancel=!0}},tee.prototype.loadGrid=function(){this.bindGridProperties(),this.bindGridEvents(),x("registeredTemplate",this.registeredTemplate,this.grid);x("viewContainerRef",this.viewContainerRef,this.grid)},tee.prototype.autoGenerateColumns=function(){if(!this.columns.length&&!this.dataModule.isRemote()&&Object.keys(this.dataSource).length){this.columns=[];for(var e=this.dataSource[0],t=Object.keys(e),i=0;i<t.length;i++)-1===[this.childMapping,this.parentIdMapping].indexOf(t[parseInt(i.toString(),10)])&&this.columns.push(t[parseInt(i.toString(),10)])}},tee.prototype.getGridEditSettings=function(){var e={};switch(e.allowAdding=this.editSettings.allowAdding,e.allowEditing=this.editSettings.allowEditing,e.allowDeleting=this.editSettings.allowDeleting,e.newRowPosition="Bottom"===this.editSettings.newRowPosition?"Bottom":"Top",e.allowEditOnDblClick=this.editSettings.allowEditOnDblClick,e.showConfirmDialog=this.editSettings.showConfirmDialog,e.template=this.editSettings.template,e.showDeleteConfirmDialog=this.editSettings.showDeleteConfirmDialog,e.allowNextRowEdit=this.editSettings.allowNextRowEdit,e.guid=this.editSettings.guid,e.dialog=this.editSettings.dialog,this.editSettings.mode){case"Dialog":case"Batch":e.mode=this.editSettings.mode;break;case"Row":e.mode="Normal";break;case"Cell":e.mode="Normal",e.showConfirmDialog=!1}return e},tee.prototype.getContextMenu=function(){if(this.contextMenuItems){for(var e=[],t=0;t<this.contextMenuItems.length;t++)switch(this.contextMenuItems[parseInt(t.toString(),10)]){case"AddRow":case b$.AddRow:e.push({text:this.l10n.getConstant("AddRow"),target:".e-content",id:this.element.id+"_gridcontrol_cmenu_AddRow",items:[{text:this.l10n.getConstant("Above"),id:"Above"},{text:this.l10n.getConstant("Below"),id:"Below"},{text:this.l10n.getConstant("Child"),id:"Child"}]});break;case"Indent":case b$.RowIndent:e.push({text:this.l10n.getConstant("RowIndent"),target:".e-content",iconCss:"e-indent e-icons",id:this.element.id+"_gridcontrol_cmenu_Indent"});break;case"Outdent":case b$.RowOutdent:e.push({text:this.l10n.getConstant("RowOutdent"),target:".e-content",iconCss:"e-outdent e-icons",id:this.element.id+"_gridcontrol_cmenu_Outdent"});break;default:e.push(this.contextMenuItems[parseInt(t.toString(),10)])}return e}return null},tee.prototype.getGridToolbar=function(){if(this.toolbar){this.l10n=new Cn("treegrid",this.defaultLocale,this.locale);for(var e=[],t=void 0,i=0;i<this.toolbar.length;i++)switch(this.toolbar[parseInt(i.toString(),10)]){case"Search":case v$.Search:e.push("Search");break;case"Print":case v$.Print:e.push("Print");break;case"ExpandAll":case v$.ExpandAll:t=this.l10n.getConstant("ExpandAll"),e.push({text:t,tooltipText:t,prefixIcon:"e-expand",id:this.element.id+"_gridcontrol_expandall"});break;case"CollapseAll":case v$.CollapseAll:t=this.l10n.getConstant("CollapseAll"),e.push({text:t,tooltipText:t,prefixIcon:"e-collapse",id:this.element.id+"_gridcontrol_collapseall"});break;case"Indent":case v$.RowIndent:t=this.l10n.getConstant("RowIndent"),e.push({text:t,tooltipText:t,prefixIcon:"e-indent",id:this.element.id+"_gridcontrol_indent"});break;case"Outdent":case v$.RowOutdent:t=this.l10n.getConstant("RowOutdent"),e.push({text:t,tooltipText:t,prefixIcon:"e-outdent",id:this.element.id+"_gridcontrol_outdent"});break;default:e.push(this.toolbar[parseInt(i.toString(),10)])}return e}return null},tee.prototype.getGridColumns=function(e,t,i){void 0===i&&(i=0);for(var n=e,o=((t=void 0===t?!0:t)&&(this.columnModel=[]),0===this.columnModel.length&&(i=0===i?-1:i),[]),r=0;r<n.length;r++){i+=1;var s=this.grid.getColumnByUid(n[parseInt(r.toString(),10)].uid),a=s||{},l={};if("string"==typeof this.columns[parseInt(r.toString(),10)])a.field=l.field=this.columns[parseInt(r.toString(),10)];else for(var h=0,d=Object.keys(n[parseInt(r.toString(),10)]);h<d.length;h++){var p=d[h];i===this.treeColumnIndex&&"template"===p?l[""+p]=n[parseInt(r.toString(),10)][""+p]:"columns"!==p||je(n[parseInt(r.toString(),10)][""+p])?this.initialRender&&!je(s)&&this.enablePersistence&&"edit"===p?a[""+p]=l[""+p]=s[""+p]:s&&"sortComparer"===p||(a[""+p]=l[""+p]=n[parseInt(r.toString(),10)][""+p]):(a[""+p]=this.getGridColumns(n[parseInt(r.toString(),10)][""+p],!1,this.columnModel.length-1),l[""+p]=n[parseInt(r.toString(),10)][""+p])}l.columns||this.columnModel.push(new c0(l)),o.push(a),!je(this.columnModel[this.treeColumnIndex])&&this.enableRtl&&a.field===this.columnModel[this.treeColumnIndex].field&&(je(this.treeColumnTextAlign)&&(this.treeColumnTextAlign=this.columnModel[this.treeColumnIndex].textAlign,this.treeColumnField=this.columnModel[this.treeColumnIndex].field),a.textAlign="Right")}return o},tee.prototype.lastRowCellBorderUpdated=function(){var e=this.getContentTable().querySelectorAll("tr.e-row"),e=Array.from(e).filter(function(e){return!e.classList.contains("e-childrow-hidden")});0<e.length&&(e=e[e.length-1],this.lastRowBorder(e,!0))},tee.prototype.onPropertyChanged=function(e){var t=Object.keys(e),i=!1;-1<t.indexOf("columns")&&!je(e.columns)&&this.refreshColumns();for(var n=0,o=t;n<o.length;n++){var r,s=o[n];switch(s){case"treeColumnIndex":this.grid.refreshColumns();break;case"allowPaging":this.grid.allowPaging=this.allowPaging;break;case"pageSettings":this.grid.pageSettings=qP(this.pageSettings),i=!0;break;case"enableVirtualization":this.grid.enableVirtualization=this.enableVirtualization;break;case"enableColumnVirtualization":this.grid.enableColumnVirtualization=this.enableColumnVirtualization;break;case"toolbar":this.grid.toolbar=this.getGridToolbar();break;case"allowSelection":this.grid.allowSelection=this.allowSelection;break;case"selectionSettings":this.grid.selectionSettings=qP(this.selectionSettings);break;case"allowSorting":this.grid.allowSorting=this.allowSorting;break;case"allowMultiSorting":this.grid.allowMultiSorting=this.allowMultiSorting;break;case"sortSettings":this.grid.sortSettings=qP(this.sortSettings);break;case"searchSettings":this.grid.searchSettings=qP(this.searchSettings);break;case"allowFiltering":this.grid.allowFiltering=this.allowFiltering;break;case"filterSettings":this.initialRender||(this.grid.filterSettings=qP(this.filterSettings));break;case"showColumnMenu":this.grid.showColumnMenu=this.showColumnMenu;break;case"allowRowDragAndDrop":this.grid.allowRowDragAndDrop=this.allowRowDragAndDrop;break;case"aggregates":this.grid.aggregates=qP(this.aggregates);break;case"enableInfiniteScrolling":this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling;break;case"dataSource":this.isLocalData=!(this.dataSource instanceof me)||!je(this.dataSource.ready)||this.dataSource.adaptor instanceof Ga,this.convertTreeData(this.dataSource),this.isLocalData?(GZ(this)?(r=R("count",this.dataSource),this.grid.dataSource={result:this.flatData,count:r}):(r=this.dataSource,this.grid.dataSource=r instanceof me?new me(r.dataSource,r.defaultQuery,r.adaptor):this.flatData),this.enableVirtualization&&(this.grid.contentModule.isDataSourceChanged=!0)):(this.bindedDataSource(),this.enableVirtualization&&(this.grid.contentModule.removeEventListener(),this.grid.contentModule.eventListener("on"),this.grid.contentModule.renderTable()));break;case"query":this.grid.query=this.query;break;case"enableCollapseAll":e[""+s]?this.collapseAll():this.expandAll();break;case"expandStateMapping":this.grid.refresh();break;case"gridLines":this.grid.gridLines=this.gridLines;break;case"rowTemplate":this.grid.rowTemplate=qP(this.rowTemplate);break;case"frozenRows":this.grid.frozenRows=this.frozenRows;break;case"frozenColumns":this.grid.frozenColumns=this.frozenColumns;break;case"rowHeight":this.grid.rowHeight=this.rowHeight;break;case"height":je(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),this.grid.height=this.height;break;case"width":je(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.grid.width=this.width;break;case"locale":this.grid.locale=this.locale,this.TreeGridLocale(),this.grid.toolbar=this.getGridToolbar(),this.grid.contextMenuItems=this.getContextMenu();break;case"selectedRowIndex":this.grid.selectedRowIndex=this.selectedRowIndex;break;case"enableAltRow":this.grid.enableAltRow=this.enableAltRow;break;case"enableHover":this.grid.enableHover=this.enableHover;break;case"enableAutoFill":this.grid.enableAutoFill=this.enableAutoFill;break;case"enableAdaptiveUI":this.grid.enableAdaptiveUI=this.enableAdaptiveUI;break;case"enableImmutableMode":this.grid.enableImmutableMode=this.enableImmutableMode;break;case"allowExcelExport":this.grid.allowExcelExport=this.allowExcelExport;break;case"allowPdfExport":this.grid.allowPdfExport=this.allowPdfExport;break;case"enableRtl":je(this.treeColumnField)||this.updateTreeColumnTextAlign(),this.grid.enableRtl=this.enableRtl;break;case"allowReordering":this.grid.allowReordering=this.allowReordering;break;case"allowResizing":this.grid.allowResizing=this.allowResizing;break;case"textWrapSettings":this.grid.textWrapSettings=qP(this.textWrapSettings);break;case"allowTextWrap":this.grid.allowTextWrap=qP(this.allowTextWrap),this.grid.refresh();break;case"contextMenuItems":this.grid.contextMenuItems=this.getContextMenu();break;case"showColumnChooser":this.grid.showColumnChooser=this.showColumnChooser;break;case"detailTemplate":this.grid.detailTemplate=qP(this.detailTemplate);break;case"columnMenuItems":this.grid.columnMenuItems=qP(this.columnMenuItems);break;case"editSettings":this.grid.isEdit&&"Normal"===this.grid.editSettings.mode&&e[""+s].mode&&("Cell"===e[""+s].mode||"Row"===e[""+s].mode)&&this.grid.closeEdit(),this.grid.editSettings=this.getGridEditSettings()}i&&this.grid.refresh()}},tee.prototype.updateTreeColumnTextAlign=function(){this.grid.getColumnByField(this.treeColumnField).textAlign=this.enableRtl?"Right":this.treeColumnTextAlign,this.grid.refreshColumns()},tee.prototype.destroy=function(){var e=this.element;if(e){for(var e=!(!e.querySelector(".e-gridheader")||!e.querySelector(".e-gridcontent")),t=(e&&this.unwireEvents(),this.removeListener(),e&&J$.prototype.destroy.call(this),this.grid&&this.grid.destroy(),this.dataModule&&this.dataModule.destroy(),["dataModule","sortModule","renderModule","filterModule","printModule","clipboardModule","excelExportModule","pdfExportModule","toolbarModule","summaryModule","reorderModule","resizeModule","pagerModule","keyboardModule","columnMenuModule","contextMenuModule","editModule","virtualScrollModule","selectionModule","detailRow","rowDragAndDropModule","freezeModule"]),i=0;i<t.length;i++)this[t[parseInt(i.toString(),10)]]&&(this[t[parseInt(i.toString(),10)]]=null);this.element.innerHTML="",this.grid=null}},tee.prototype.dataBind=function(){je(this.grid)||(!je(this.rowDropSettings.targetID)&&je(document.getElementById(this.grid.rowDropSettings.targetID))&&(document.getElementById(this.rowDropSettings.targetID).id=this.grid.rowDropSettings.targetID,this.rowDropSettings.targetID=this.grid.rowDropSettings.targetID),J$.prototype.dataBind.call(this),this.grid.dataBind())},tee.prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex","scrollPosition"],t={pageSettings:["template","pageSizes","pageSizeMode","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[],scrollPosition:[]},i=0;i<e.length;i++)for(var n=this[e[parseInt(i.toString(),10)]],o=0,r=t[e[parseInt(i.toString(),10)]];!je(r)&&o<r.length;o++)delete n[""+r[parseInt(o.toString(),10)]];return this.ignoreInArrays(["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],this.columns),this.addOnPersist(e)},tee.prototype.ignoreInArrays=function(e,t){for(var i=0;i<t.length;i++)t[parseInt(i.toString(),10)].columns?(this.ignoreInColumn(e,t[parseInt(i.toString(),10)]),this.ignoreInArrays(e,t[parseInt(i.toString(),10)].columns)):this.ignoreInColumn(e,t[parseInt(i.toString(),10)])},tee.prototype.ignoreInColumn=function(e,t){if(je(t.template))for(var i=0;i<e.length;i++)delete t[e[parseInt(i.toString(),10)]],t.filter={}},tee.prototype.mouseClickHandler=function(e){var t,i=this;je(e.touches)&&(!(e=e.target).classList.contains("e-treegridexpand")&&!e.classList.contains("e-treegridcollapse")||this.isEditCollapse||this.grid.isEdit||this.expandCollapseRequest(e),(e.classList.contains("e-treegridexpand")||e.classList.contains("e-treegridcollapse"))&&this.grid.isEllipsisTooltip()&&this.grid.toolTipObj.close(),this.isEditCollapse=!1,this.notify("checkboxSelection",{target:e}),this.grid.isCheckBoxSelection&&!this.grid.isPersistSelection&&this.aggregates.map(function(e){return!0===e.showChildSummary}).length&&(t=this.grid.getHeaderContent().querySelector(".e-checkselectall"),this.grid.getSelectedRowIndexes().length===this.getCurrentViewRecords().length)&&(q([t=t.nextElementSibling],["e-stop","e-uncheck"]),U([t],["e-check"])),e.classList.contains("e-flmenu-cancelbtn")||e.classList.contains("e-flmenu-okbtn")||e.classList.contains("e-content")||e.classList.contains("e-rowcell"))&&!je(this.grid.filterModule)&&this.isReact&&!je(this.grid.filterModule.column)&&this.grid.filterModule.column.filterTemplate&&(t=document.getElementById(this.grid.filterModule.filterModule.dlgObj.element.id),this.grid.filterModule.fltrDlgDetails.isOpen=!1,this.grid.filterModule.filterModule.dlgObj)&&!this.grid.filterModule.filterModule.dlgObj.isDestroyed&&t&&this.clearTemplate(["filterTemplate"],void 0,function(){i.grid.filterModule.filterModule.dlgObj.destroy()})},tee.prototype.getRows=function(){return this.grid.getRows()},tee.prototype.getPager=function(){return this.grid.getPager()},tee.prototype.addRecord=function(e,t,i){this.editModule&&(this.editModule.isAddedRowByMethod=!0,this.editModule.addRecord(e,t,i))},tee.prototype.closeEdit=function(){this.grid.editModule&&this.editModule.closeEdit()},tee.prototype.saveCell=function(){this.grid.editModule&&this.grid.editModule.saveCell()},tee.prototype.updateCell=function(e,t,i){this.grid.editModule&&this.grid.editModule.updateCell(e,t,i)},tee.prototype.updateRow=function(e,t){var i;this.grid.editModule&&(je(e)?this.grid.editModule.updateRow(e,t):(Pe(i=this.grid.getCurrentViewRecords()[parseInt(e.toString(),10)],t),this.grid.editModule.updateRow(e,i)))},tee.prototype.deleteRecord=function(e,t){(je(e)&&je(t)||this.getSelectedRecords().length<=0)&&this.trigger(zZ,{error:"The provided value for the fieldName and data is undefined. Please ensure the fieldName and data contains number."}),this.grid.editModule&&this.grid.editModule.deleteRecord(e,t)},tee.prototype.startEdit=function(e){this.grid.editModule&&this.grid.editModule.startEdit(e)},tee.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},tee.prototype.enableToolbarItems=function(e,t){this.grid.toolbarModule&&this.grid.toolbarModule.enableItems(e,t)},tee.prototype.endEdit=function(){this.grid.editModule&&this.grid.editModule.endEdit()},tee.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},tee.prototype.deleteRow=function(e){this.grid.editModule&&this.grid.editModule.deleteRow(e)},tee.prototype.getPrimaryKeyFieldNames=function(){return this.grid.getPrimaryKeyFieldNames()},tee.prototype.setCellValue=function(e,t,i){this.grid.setCellValue(e,t,i);i=this.grid.getRowIndexByPrimaryKey(e),e=this.getCurrentViewRecords()[parseInt(i.toString(),10)];U$({value:e,action:"edit"},this,this.isSelfReference,e.index,this.grid.selectedRowIndex,t)},tee.prototype.setRowData=function(t,e){var i=this.getCurrentViewRecords(),n=this.grid.getPrimaryKeyFieldNames()[0],o={},r=(i.some(function(e){return e[""+n]===t&&(o=e,!0)}),r=o.level,e.level=r,e.index=o.index,e.childRecords=o.childRecords,e.taskData=o.taskData,e.uniqueID=o.uniqueID,e.parentItem=o.parentItem,e.checkboxState=o.checkboxState,e.hasChildRecords=o.hasChildRecords,e.parentUniqueID=o.parentUniqueID,e.expanded=o.expanded,this.grid.setRowData(t,e),this.getVisibleRecords());0<r.length&&t===r[r.length-1][""+n]&&(e=this.getContentTable().scrollHeight,r=this.getContent().clientHeight,this.lastRowBorder(this.getRows()[i.indexOf(o)],e<=r))},tee.prototype.goToPage=function(e){this.grid.pagerModule&&this.grid.pagerModule.goToPage(e)},tee.prototype.updateExternalMessage=function(e){this.pagerModule&&this.grid.pagerModule.updateExternalMessage(e)},tee.prototype.getCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},tee.prototype.getColumnByField=function(t){return VP(this.columnModel,function(e){if(e.field===t)return e})[0]},tee.prototype.getColumnByUid=function(t){var e=(this.initialRender?this.grid:this).columns;return VP(e=this.grid.columns.length!==this.columnModel.length?this.grid.columnModel:e,function(e){if(e.uid===t)return e})[0]},tee.prototype.getColumnFieldNames=function(){return this.grid.getColumnFieldNames()},tee.prototype.getFooterContent=function(){return this.grid.getFooterContent()},tee.prototype.getFooterContentTable=function(){return this.grid.getFooterContentTable()},tee.prototype.showColumns=function(e,t){this.grid.showColumns(e,t),this.updateColumnModel()},tee.prototype.hideColumns=function(e,t){this.grid.hideColumns(e,t),this.updateColumnModel()},tee.prototype.getColumnHeaderByField=function(e){return this.grid.getColumnHeaderByField(e)},tee.prototype.getColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},tee.prototype.getColumnHeaderByUid=function(e){return this.grid.getColumnHeaderByUid(e)},tee.prototype.getColumnIndexByField=function(e){return this.grid.getColumnIndexByField(e)},tee.prototype.getVirtualColIndexByUid=function(i){var e=VP(this.grid.columnModel,function(e,t){if(e.uid===i)return t})[0];return je(e)?-1:e},tee.prototype.getColumnIndexByUid=function(e){return this.grid.getColumnIndexByUid(e)},tee.prototype.getColumns=function(e){return this.updateColumnModel(this.grid.getColumns(e)),this.columnModel},tee.prototype.updateColumnModel=function(e){var t,i,n=je(e)?this.grid.getColumns():e;if(-1!==this.treeColumnIndex&&this.columnModel[this.treeColumnIndex]&&!je(this.columnModel[this.treeColumnIndex].template)&&(t=this.columnModel[this.treeColumnIndex].template,i=this.columnModel[this.treeColumnIndex].field),!this.enableColumnVirtualization||this.enableColumnVirtualization&&this.columnModel.length===n.length){this.columnModel=[];for(var o=0;o<n.length;o++){for(var r={},s=0,a=Object.keys(n[parseInt(o.toString(),10)]);s<a.length;s++){var l=a[s];r[""+l]=n[parseInt(o.toString(),10)][""+l]}this.columnModel.push(new c0(r)),i!==this.columnModel[parseInt(o.toString(),10)].field||"checkbox"===this.columnModel[parseInt(o.toString(),10)].type||je(t)||""===t||(this.columnModel[parseInt(o.toString(),10)].template=t)}}return this.deepMerge=["columns"],this.grid.columns.length!==this.columnModel.length&&(this.stackedHeader=!0),this.stackedHeader&&!je(this.detailTemplate)&&this.trigger(zZ,{error:"Stacked header is not compatible with the detail template"}),this.stackedHeader&&this.allowResizing&&!je(this.columns)&&this.updateColumnsWidth(this.columns),this.stackedHeader||je(this.columns)||I(this.columns,this.columnModel),this.deepMerge=void 0,this.columnModel},tee.prototype.updateColumnsWidth=function(e){var i=this;e.forEach(function(e){var t;!je(e)&&e.columns?i.updateColumnsWidth(e.columns):je(e)||!e.field||je(t=i.grid.getColumnByField(e.field))||(e.width=t.width)})},tee.prototype.getContent=function(){return this.grid.getContent()},tee.prototype.mergePersistTreeGridData=function(){this.grid.mergePersistGridData.apply(this)},tee.prototype.mergeColumns=function(e,t){this.grid.mergeColumns.apply(this,[e,t])},tee.prototype.setFrozenCount=function(){this.grid.setFrozenCount.apply(this.grid)},tee.prototype.splitFrozenCount=function(e){this.grid.splitFrozenCount.apply(this.grid,[e])},tee.prototype.isFrozenGrid=function(){return this.grid.isFrozenGrid()},tee.prototype.updateTreeGridModel=function(){this.setProperties({filterSettings:FB("properties",this.grid.filterSettings)},!0),this.setProperties({pageSettings:FB("properties",this.grid.pageSettings)},!0),this.setProperties({searchSettings:FB("properties",this.grid.searchSettings)},!0),this.setProperties({sortSettings:FB("properties",this.grid.sortSettings)},!0)},tee.prototype.getContentTable=function(){return this.grid.getContentTable()},tee.prototype.getDataRows=function(){for(var e=[],t=this.grid.getDataRows(),i=0,n=t.length;i<n;i++)t[parseInt(i.toString(),10)].classList.contains("e-summaryrow")||e.push(t[parseInt(i.toString(),10)]);return e},tee.prototype.getCurrentViewRecords=function(){return this.grid.currentViewData.filter(function(e){return je(e.isSummaryRow)})},tee.prototype.getBatchChanges=function(){return this.grid.editModule.getBatchChanges()},tee.prototype.getHeaderContent=function(){return this.grid.getHeaderContent()},tee.prototype.getHeaderTable=function(){return this.grid.getHeaderTable()},tee.prototype.getRowByIndex=function(e){return this.grid.getRowByIndex(e)},tee.prototype.getRowInfo=function(e){return this.grid.getRowInfo(e)},tee.prototype.getUidByColumnField=function(e){return this.grid.getUidByColumnField(e)},tee.prototype.getVisibleColumns=function(){for(var e=[],t=0,i=this.columnModel;t<i.length;t++){var n=i[t];n.visible&&e.push(n)}return e},tee.prototype.showSpinner=function(){kA(this.element)},tee.prototype.hideSpinner=function(){BA(this.element)},tee.prototype.refresh=function(){this.uniqueIDCollection={},this.convertTreeData(this.dataSource),GZ(this)||(this.dataSource instanceof me?this.grid.setProperties({dataSource:new me(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor)},!0):this.grid.dataSource=this.flatData),this.grid.refresh()},tee.prototype.getCheckedRecords=function(){return this.selectionModule.getCheckedrecords()},tee.prototype.getVisibleRecords=function(){var e=[],t=this.getCurrentViewRecords();if(this.allowPaging)e=t;else for(var i=0;i<t.length;i++)e.push(t[parseInt(i.toString(),10)]),t[parseInt(i.toString(),10)].expanded||(i+=ZZ(t[parseInt(i.toString(),10)]).length);return e},tee.prototype.getCheckedRowIndexes=function(){return this.selectionModule.getCheckedRowIndexes()},tee.prototype.selectCheckboxes=function(e){this.selectionModule.selectCheckboxes(e)},tee.prototype.refreshColumns=function(e){je(e)||e?(this.grid.columns=this.getGridColumns(this.columns),this.getTreeColumn(),this.grid.refreshColumns()):this.grid.setProperties({columns:this.getGridColumns(this.columns)},!0)},tee.prototype.getTreeColumn=function(){for(var e,t=this.columnModel[this.treeColumnIndex],i=this.getColumns(),n=0;n<i.length;n++)if(FB("field",t)===FB("field",i[parseInt(n.toString(),10)])){e=n;break}this.setProperties({treeColumnIndex:e},!0)},tee.prototype.refreshHeader=function(){this.grid.refreshHeader()},tee.prototype.expandCollapseRequest=function(e){if("Batch"===this.editSettings.mode)if((this.getBatchChanges()[this.changedRecords].length||this.getBatchChanges()[this.deletedRecords].length||this.getBatchChanges()[this.addedRecords].length)&&this.editSettings.showConfirmDialog)return t=this.grid.editModule.dialogObj,this.grid.editModule.showDialog("CancelEdit",t),void(this.targetElement=e);var t,i,n;this.rowTemplate?(t=e.closest(".e-treerowcell").parentElement,n=this.getCurrentViewRecords()[t.rowIndex],e.classList.contains("e-treegridexpand")?this.collapseRow(t,n):this.expandRow(t,n)):(n=(i=this.grid.getRowInfo(e)).rowData,this.grid.isFrozenGrid()&&this.enableVirtualization&&!Object.keys(n).length&&(n=this.grid.contentModule.freezeRows.filter(function(e){return e.uid===i.row.getAttribute("data-uid")})[0].data),this.enableImmutableMode&&(n=this.getCurrentViewRecords()[i.rowIndex]),e.classList.contains("e-treegridexpand")?this.collapseRow(i.row,n):this.expandRow(i.row,n))},tee.prototype.expandRow=function(t,i,n,o){var e,r,s=this,a=(this.isCollapseAll=!1,this.parentData);this.enableVirtualization||(a=this.flatData.filter(function(e){return e.hasChildRecords})),i=this.getCollapseExpandRecords(t,i),je(t)&&je(i)||(!je(t)&&t.cells&&t.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(t,!1),this.isExpandAll&&!qZ(this)?(e=!(r={data:a,row:t,cancel:!1}),this.grid.pagerModule&&!je(this.grid.pagerModule.pagerObj.pagerdropdownModule)&&(e=!!this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value),this.isExpandingEventTriggered?(!this.allowPaging||e&&"All"===this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value)&&!this.expandAllPrevent&&this.isExpandingEventTriggered&&this.expandRows(t,i,a):this.trigger(YJ,r,function(e){s.expandAllPrevent=e.cancel,e.cancel||je(i)||(e.expandAll&&s.expandCollapseAllChildren(i,"expand",n,o),s.expandRows(t,i,a))}),this.isExpandingEventTriggered=!0):(!this.isExpandAll||this.isExpandAll&&qZ(this))&&(r={data:i,row:t,cancel:!1},this.trigger(YJ,r,function(e){e.cancel||(e.expandAll&&s.expandCollapseAllChildren(i,"expand",n,o),s.expandRows(t,i,a))})))},tee.prototype.expandRows=function(e,t,i){this.expandCollapse("expand",e,t);qZ(this)&&!$Z(this)||GZ(this)&&je(t.Children)||(t={data:t,row:e},je(this.expandStateMapping)||this.updateExpandStateMapping(t.data,!0),this.isExpandAll&&!this.isExpandedEventTriggered?(this.isExpandedEventTriggered=!0,this.trigger(GJ,t={data:i,row:e})):!this.isExpandAll&&this.enableVirtualization&&this.selectionSettings.persistSelection&&!je(this.virtualScrollModule.prevSelectedRecord)?this.virtualScrollModule.prevSelectedRecord=[]:this.isExpandAll||this.trigger(GJ,t))},tee.prototype.expandCollapseAllChildren=function(e,t,i,n){if((je(i)||e[this.getPrimaryKeyFieldNames()[0]]===i)&&(je(n)||n===e.level)){var o=ZZ(e).filter(function(e){return e.hasChildRecords});o.unshift(e);for(var r=0;r<o.length;r++)this.expandCollapse(t,null,o[parseInt(r.toString(),10)])}},tee.prototype.getCollapseExpandRecords=function(e,t){return this.allowPaging&&"All"===this.pageSettings.pageSizeMode&&this.isExpandAll&&je(t)&&!qZ(this)?t=this.flatData.filter(function(e){return e.hasChildRecords}):je(t)&&!je(e)&&(t=this.detailTemplate?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]:this.enableVirtualization&&(this.isCollapseAll||this.isExpandAll)?-1===e.rowIndex?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]:this.grid.getCurrentViewRecords()[e.rowIndex]:this.rowTemplate?this.grid.getCurrentViewRecords()[e.rowIndex]:this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]),t},tee.prototype.collapseRow=function(t,i,n){var e,o=this,r=(this.isExpandAll=!1,this.parentData);this.enableVirtualization||(r=this.flatData.filter(function(e){return e.hasChildRecords})),i=this.getCollapseExpandRecords(t,i),je(t)&&je(i)||(this.isCollapseAll&&!qZ(this)?(e={data:r,row:t,cancel:!1},this.isCollapsingEventTriggered?this.allowPaging||this.collapseAllPrevent||!this.isCollapsingEventTriggered||this.collapseRows(t,i,r):this.trigger(KJ,e,function(e){o.collapseAllPrevent=e.cancel,e.cancel||(e.collapseAll&&o.expandCollapseAllChildren(i,"collapse",n),o.collapseRows(t,i,r))}),this.isCollapsingEventTriggered=!0):(!this.isCollapseAll||this.isCollapseAll&&qZ(this))&&(e={data:i,row:t,cancel:!1},this.trigger(KJ,e,function(e){e.cancel||o.collapseRows(t,i,r)})))},tee.prototype.collapseRows=function(e,t,i){this.expandCollapse("collapse",e,t);t={data:t,row:e};qZ(this)||(je(this.expandStateMapping)||this.updateExpandStateMapping(t.data,!1),this.isCollapseAll&&!this.isCollapsedEventTriggered?(this.isCollapsedEventTriggered=!0,this.trigger(XJ,t={data:i,row:e})):this.isCollapseAll||this.trigger(XJ,t),this.enableInfiniteScrolling&&this.grid.getContent().firstElementChild.scrollHeight-this.grid.getContent().firstElementChild.scrollTop<this.grid.getRowHeight()+ +this.height&&this.grid.getContent().firstElementChild.scrollBy(0,this.grid.getRowHeight()))},tee.prototype.updateExpandStateMapping=function(e,t){var i=e;if(i.length)for(var n=0;n<i.length;n++)i[parseInt(n.toString(),10)][this.expandStateMapping]=t,U$({value:i[parseInt(n.toString(),10)],action:"edit"},this,this.isSelfReference,i[parseInt(n.toString(),10)].index,this.grid.selectedRowIndex,this.expandStateMapping);else e[""+this.expandStateMapping]=t,U$({value:e,action:"edit"},this,this.isSelfReference,e.index,this.grid.selectedRowIndex,this.expandStateMapping)},tee.prototype.expandAtLevel=function(t){var e;(this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!qZ(this)?(e=this.grid.dataSource.filter(function(e){return e.hasChildRecords&&e.level===t&&(e.expanded=!0),e.hasChildRecords&&e.level===t}),this.expandAction(e,null,t,!0)):(e=FB("records",e=this.getRecordDetails(t)),this.expandAction(e,null,t))},tee.prototype.expandByKey=function(e){this.expandCollapseActionByKey(e,"Expand")},tee.prototype.expandAction=function(n,o,r,s){void 0===s&&(s=!1);for(var a=this,e=0;e<n.length;e++)!function(e){var t,i;je(n[parseInt(e.toString(),10)].parentItem)||(t=n[parseInt(e.toString(),10)].parentItem.uniqueID,i=a.flatData.filter(function(e){return e.uniqueID===t}),!1===(i=qZ(a)?a.getCurrentViewRecords().filter(function(e){return e.uniqueID===t}):i)[0].expanded?(n.push(i[0]),i[0].expanded=!0):JZ(a,i[0],a.parentData)||i[0].expanded&&void 0!==i[0].parentItem&&n.push(i[0])),s||a.expandRow(null,n[parseInt(e.toString(),10)],o,r)}(e);s&&this.expandRow(null,n,o,r)},tee.prototype.getRecordDetails=function(t){var e=this.getRows().filter(function(e){return-1!==e.className.indexOf("level"+t)&&(e.querySelector(".e-treegridcollapse")||e.querySelector(".e-treegridexpand"))});return{records:this.getCurrentViewRecords().filter(function(e){return e.level===t&&e.hasChildRecords}),rows:e}},tee.prototype.collapseAtLevel=function(t){var e;(this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!qZ(this)?(e=this.grid.dataSource.filter(function(e){return e.hasChildRecords&&e.level===t&&(e.expanded=!1),e.hasChildRecords&&e.level===t}),this.collapseAction(e,null,!0)):(e=FB("records",this.getRecordDetails(t)),this.collapseAction(e))},tee.prototype.collapseByKey=function(e){this.expandCollapseActionByKey(e,"Collapse")},tee.prototype.expandCollapseActionByKey=function(t,e){var i=this.getPrimaryKeyFieldNames()[0],n=qZ(this)?this.getCurrentViewRecords():this.grid.dataSource;je(i)||(n=n.filter(function(e){return e[""+i].toString()===t.toString()}),"Expand"===e?this.expandAction(n,t,null):this.collapseAction(n,t))},tee.prototype.collapseAction=function(e,t,i){if(i=void 0===i?!1:i)this.collapseRow(null,e);else for(var n=0;n<e.length;n++)this.collapseRow(null,e[parseInt(n.toString(),10)],t);!this.grid.contentModule.isDataSourceChanged&&this.enableVirtualization&&this.getRows()&&this.parentData.length===this.getRows().length&&(this.grid.contentModule.startIndex=-1,this.grid.contentModule.endIndex=-1)},tee.prototype.expandAll=function(){if(0===this.getCurrentViewRecords().length&&this.trigger(zZ,{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."}),this.isExpandedEventTriggered=!1,this.isExpandingEventTriggered=!1,"Batch"===this.editSettings.mode){var e;if((this.getBatchChanges()[this.changedRecords].length||this.getBatchChanges()[this.deletedRecords].length||this.getBatchChanges()[this.addedRecords].length)&&this.editSettings.showConfirmDialog)return e=this.grid.editModule.dialogObj,void this.grid.editModule.showDialog("CancelEdit",e)}this.expandCollapseAll("expand")},tee.prototype.collapseAll=function(){if(0===this.getCurrentViewRecords().length&&this.trigger(zZ,{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."}),this.isCollapsedEventTriggered=!1,this.isCollapsingEventTriggered=!1,"Batch"===this.editSettings.mode){var e;if((this.getBatchChanges()[this.changedRecords].length||this.getBatchChanges()[this.deletedRecords].length||this.getBatchChanges()[this.addedRecords].length)&&this.editSettings.showConfirmDialog)return e=this.grid.editModule.dialogObj,void this.grid.editModule.showDialog("CancelEdit",e)}this.expandCollapseAll("collapse")},tee.prototype.expandCollapseAll=function(t){var e,i=this.rowTemplate?[].slice.call(this.grid.getContentTable().querySelectorAll("tr")).filter(function(e){return e.querySelector(".e-treegrid"+("expand"===t?"collapse":"expand"))}):this.getRows().filter(function(e){return e.querySelector(".e-treegrid"+("expand"===t?"collapse":"expand"))});if(!i.length&&this.getRows().length&&i.push(this.getRows()[0]),this.isExpandAll=!0,this.isCollapseAll=!0,(this.allowPaging&&("All"===this.pageSettings.pageSizeMode||"Root"===this.pageSettings.pageSizeMode)||this.enableVirtualization||this.enableInfiniteScrolling)&&!qZ(this))if(this.flatData.filter(function(e){e.hasChildRecords&&(e.expanded="collapse"!==t)}),i.length)for(var n=0;n<i.length;n++)"collapse"===t?je(this.getCurrentViewRecords()[i[parseInt(n.toString(),10)].rowIndex])||this.collapseRow(i[parseInt(n.toString(),10)]):this.enableVirtualization?"true"!==i[0].getAttribute("aria-expanded")&&this.expandRow(i[0]):this.expandRow(i[parseInt(n.toString(),10)]);else this.allowPaging&&(e=this.enableCollapseAll,this.setProperties({enableCollapseAll:!0},!0),this.grid.pagerModule.goToPage(1),this.setProperties({enableCollapseAll:e},!0));else for(n=0;n<i.length;n++)"collapse"===t?this.collapseRow(i[parseInt(n.toString(),10)]):this.expandRow(i[parseInt(n.toString(),10)]);this.isExpandAll=!1,this.isCollapseAll=!1},tee.prototype.expandCollapse=function(e,t,i,n){var o,r=this,s={row:t,data:i,childData:[],requestType:e},a=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===i.uniqueID}),s=((!qZ(this)&&"expand"===e&&this.isSelfReference&&GZ(this)&&!a.length||"collapse"===e||this.isExpandAll&&!this.loadChildOnDemand&&!qZ(this)&&this.isSelfReference&&GZ(this))&&this.updateChildOnDemand(s),this.getRows());if(this.rowTemplate&&(d=this.getContentTable().rows,s=[].slice.call(d)),je(t)?(l=this.grid.currentViewData.indexOf(i),t=s[parseInt(l.toString(),10)]):l=+t.getAttribute("aria-rowindex")-1,je(t)||t.setAttribute("aria-expanded","expand"===e?"true":"false"),(!this.allowPaging||"All"!==this.pageSettings.pageSizeMode&&"Root"!==this.pageSettings.pageSizeMode)&&!this.enableVirtualization||qZ(this)||GZ(this)){var l=void 0;if("expand"===e){if(l="e-childrow-visible",n||(i.expanded=!0,this.flatData.forEach(function(e){e.expanded=(e.uniqueID===i.uniqueID&&e.expanded!==i.expanded?i:e).expanded}),this.uniqueIDCollection[i.uniqueID].expanded=i.expanded),je(t)||(o=t.getElementsByClassName("e-treegridcollapse")[0]),n&&!je(i[this.expandStateMapping])&&i[this.expandStateMapping]&&je(o)&&(o=t.getElementsByClassName("e-treegridexpand")[0]),je(o))return;o.classList.contains("e-treegridexpand")||U([o],"e-treegridexpand"),q([o],"e-treegridcollapse")}else{if(l="e-childrow-hidden",n&&!GZ(this)||(i.expanded=!1,this.flatData.forEach(function(e){e.expanded=(e.uniqueID===i.uniqueID&&e.expanded!==i.expanded?i:e).expanded}),this.uniqueIDCollection[i.uniqueID].expanded=i.expanded),je(t)||(o=t.getElementsByClassName("e-treegridexpand")[0]),n&&!je(i[this.expandStateMapping])&&!i[this.expandStateMapping]&&je(o)&&(o=t.getElementsByClassName("e-treegridcollapse")[0]),je(o))return;o.classList.contains("e-treegridcollapse")||U([o],"e-treegridcollapse"),q([o],"e-treegridexpand")}t.querySelectorAll(".e-treerowcell")[0].setAttribute("aria-expanded","expand"===e?"true":"false");n=s.filter(function(e){return e.classList.contains("e-griddetailrowindex"+i.index+"level"+(i.level+1))});if(qZ(this)&&!$Z(this)?this.remoteExpand(e,t,i):(GZ(this)&&!a.length&&"collapse"!==e||this.localExpand(e,t,i),a=this.getVisibleRecords()[this.getVisibleRecords().length-1].index,a=this.getRowByIndex(a),this.grid.getContentTable().clientHeight<=this.grid.getContent().clientHeight&&!je(a)&&!a.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(a,!0)),GZ(this)&&"expand"===e&&(a=this.getCurrentViewRecords().filter(function(e){return JZ(r,e,r.parentData)}),this.dataResults.result=a),!je(o)&&o.closest(".e-treerowcell").classList.contains("e-cellselectionbackground")&&(o.closest(".e-treerowcell").classList.remove("e-cellselectionbackground"),o.closest(".e-treerowcell").removeAttribute("aria-selected")),this.isPixelHeight()&&!t.cells[0].classList.contains("e-lastrowcell")){this.getRows();for(var h,d=this.getContentTable().rows,p=(h=[].slice.call(d)).length-1;0<=p;p--)if(!n$(h[parseInt(p.toString(),10)])){var c=this.getContentTable().scrollHeight,u=this.getContent().clientHeight;this.lastRowBorder(h[parseInt(p.toString(),10)],c<=u);break}}this.notify("rowExpandCollapse",{detailrows:n,action:l,record:i,row:t}),this.updateAltRow(s)}else this.notify(ZJ,{action:e,row:t,record:i})},tee.prototype.updateChildOnDemand=function(l){var h=this;if("collapse"===l.requestType&&GZ(this)){for(var e=this.flatData.slice(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].parentUniqueID===l.data.uniqueID&&(e.splice(t,1),t-=1);this.dataResults.result=e}else{var i=new ll,d=(l.childDataBind=i.resolve,l.data);this.trigger(NJ,l),i.promise.then(function(){if(l.childData.length){GZ(h)&&(h.flatData=h.dataResults.result),h.enableInfiniteScrolling&&GZ(h)&&(h.flatData=h.infiniteScrollData);for(var e=h.flatData,t=0,i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].taskData===d.taskData){t=i;break}for(var n=R("result",h.dataSource),o=e$(l.childData),r=(d[h.childMapping]&&d[h.childMapping].length>o.length?d[h.childMapping]:o).length,i=0;i<r;i++)d[h.childMapping]&&n.filter(function(e,t){e[h.parentIdMapping]===d[h.idMapping]&&n.splice(t,1)}),o[parseInt(i.toString(),10)]?(o[parseInt(i.toString(),10)].level=d.level+1,o[parseInt(i.toString(),10)].index=Math.ceil(1e3*Math.random()),o[parseInt(i.toString(),10)].parentItem=Pe({},d),o[parseInt(i.toString(),10)].taskData=Pe({},o[parseInt(i.toString(),10)]),delete o[parseInt(i.toString(),10)].parentItem.childRecords,delete o[parseInt(i.toString(),10)].taskData.parentItem,o[parseInt(i.toString(),10)].parentUniqueID=d.uniqueID,o[parseInt(i.toString(),10)].uniqueID=$P(h.element.id+"_data_"),x("uniqueIDCollection."+o[parseInt(i.toString(),10)].uniqueID,o[parseInt(i.toString(),10)],h),(!je(o[parseInt(i.toString(),10)][h.childMapping])||o[parseInt(i.toString(),10)][h.hasChildMapping]&&GZ(h))&&(o[parseInt(i.toString(),10)].hasChildRecords=!0),GZ(h)&&d[h.childMapping]&&d[h.childMapping][parseInt(i.toString(),10)]?e.splice(t+1+i,0,o[parseInt(i.toString(),10)]):e.splice(t+1+i,d[h.childMapping]&&d[h.childMapping][parseInt(i.toString(),10)]?1:0,o[parseInt(i.toString(),10)])):e.splice(t+1+i,1);e[parseInt(t.toString(),10)][""+h.childMapping]=o,e[parseInt(t.toString(),10)].childRecords=o,e[parseInt(t.toString(),10)].expanded=!0,x("uniqueIDCollection."+e[parseInt(t.toString(),10)].uniqueID,e[parseInt(t.toString(),10)],h);for(var s=0;s<l.childData.length;s++)n.push(l.childData[parseInt(s.toString(),10)])}GZ(h)&&!h.loadChildOnDemand&&"expand"===l.requestType&&(h.dataResults.expandRecord={},h.dataResults.expandRecord=l.data),h.isExpandRefresh=!0;var a=h.getContentTable().parentElement.scrollTop;h.grid.refresh(),h.enableInfiniteScrolling&&(h.getContentTable().parentElement.scrollTop=a),h.trigger(GJ,l)})}},tee.prototype.remoteExpand=function(e,t,i){var n=this.getRows(),o=(this.rowTemplate&&(o=this.getContentTable().rows,n=[].slice.call(o)),{data:i,row:t}),n=n.filter(function(e){return e.querySelector(".e-gridrowindex"+i.index+"level"+(i.level+1))||e.querySelector(".e-gridrowindex"+i.index+"level0.e-summarycell")});"expand"===e?(this.notify(JJ,{record:i,rows:n,parentRow:t}),0<n.length&&this.trigger(GJ,{row:t,data:i})):"collapse"===e&&this.enableVirtualization?this.dataModule.fetchRemoteChildData({action:e,record:o.data,rows:null,parentRow:o.row}):(this.collapseRemoteChild({record:i,rows:n}),this.trigger(XJ,o))},tee.prototype.localExpand=function(e,t,i){var n,o,r=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===i.uniqueID}),s=(this.isPixelHeight()&&t.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(t,!1),this.getRows()),a=(this.rowTemplate&&(t=this.getContentTable().rows,s=[].slice.call(t)),"expand"===e?"e-childrow-visible":"e-childrow-hidden"),l=this.getPrimaryKeyFieldNames()[0];if(this.enableImmutableMode&&!this.allowPaging)for(var h=[],d=0;d<r.length;d++){var p=this.grid.getRowIndexByPrimaryKey(r[parseInt(d.toString(),10)][""+l]);h.push(this.getRows()[parseInt(p.toString(),10)])}else h=s.filter(function(e){return e.querySelector(".e-gridrowindex"+i.index+"level"+(i.level+1))});for(var c,t=0<this.grid.getFrozenLeftColumnsCount()||0<this.grid.getFrozenRightColumnsCount(),u=((this.frozenRows||this.frozenColumns||this.getFrozenColumns()||t)&&(n=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+i.index+"level"+(i.level+1))})),t&&(o=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+i.index+"level"+(i.level+1))})),this.grid.getRowsObject()),g=this.grid.currentViewData,m=g.filter(function(e){return e.uniqueID===i.uniqueID}),f=g.indexOf(m[0]),y=(je(u[parseInt(f.toString(),10)].visible)||!1===u[parseInt(f.toString(),10)].visible||(u[parseInt(f.toString(),10)].visible=!0),s.filter(function(e){return e.classList.contains("e-griddetailrowindex"+i.index+"level"+(i.level+1))})),d=0;d<h.length;d++)je(h[parseInt(d.toString(),10)])||this.toggleRowVisibility(h[parseInt(d.toString(),10)],a),je(h[parseInt(d.toString(),10)])||this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||qZ(this)||GZ(this)||(je(u[h[parseInt(d.toString(),10)].rowIndex])||(u[h[parseInt(d.toString(),10)].rowIndex].visible="e-childrow-hidden"!=a),!je((c=g.filter(function(e){return e.uniqueID===m[0].parentUniqueID}))[0])&&s[g.indexOf(c[0])].getElementsByClassName("e-treegridcollapse").length&&(u[parseInt(f.toString(),10)].visible=!1)),je(n)||this.toggleRowVisibility(n[parseInt(d.toString(),10)],a),je(o)||this.toggleRowVisibility(o[parseInt(d.toString(),10)],a),this.notify("childRowExpand",{row:h[parseInt(d.toString(),10)]}),!je(r)&&!je(r[parseInt(d.toString(),10)].childRecords)&&0<r[parseInt(d.toString(),10)].childRecords.length&&("expand"!==e||je(r[parseInt(d.toString(),10)].expanded)||r[parseInt(d.toString(),10)].expanded)&&(this.expandCollapse(e,h[parseInt(d.toString(),10)],r[parseInt(d.toString(),10)],!0),this.frozenColumns<=this.treeColumnIndex)&&!je(n)&&this.expandCollapse(e,n[parseInt(d.toString(),10)],r[parseInt(d.toString(),10)],!0);for(d=0;d<y.length;d++)je(y[parseInt(d.toString(),10)])||this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||qZ(this)||GZ(this)||(u[y[parseInt(d.toString(),10)].rowIndex].visible="e-childrow-hidden"!=a,this.toggleRowVisibility(y[parseInt(d.toString(),10)],a));this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||qZ(this)||GZ(this)||this.grid.notify("refresh-Expand-and-Collapse",{rows:this.grid.getRowsObject()})},tee.prototype.toggleRowVisibility=function(e,t){e&&(e.classList.remove("e-childrow-hidden","e-childrow-visible","e-hide"),e.classList.add(t))},tee.prototype.updateAltRow=function(e){if(this.enableAltRow&&!this.rowTemplate)for(var t=0,i=0;e&&i<e.length;i++){var n=e[parseInt(i.toString(),10)];n.classList.contains("e-childrow-hidden")||(n.classList.contains("e-altrow")&&q([n],"e-altrow"),t%2==0||n.classList.contains("e-summaryrow")||n.classList.contains("e-detailrow")||U([n],"e-altrow"),n.classList.contains("e-summaryrow"))||n.classList.contains("e-detailrow")||t++}},tee.prototype.treeColumnRowTemplate=function(){for(var e=this.getContentTable().rows,e=[].slice.call(e),t=this.grid.getRowsObject(),i=0;i<e.length;i++){var n=this.grid.getContentTable().rows[parseInt(i.toString(),10)].cells[this.treeColumnIndex],o=e[parseInt(i.toString(),10)],o={data:0!==t.length?t[parseInt(i.toString(),10)].data:new Object,row:o,cell:n,column:this.getColumns()[this.treeColumnIndex]};this.renderModule.cellRender(o)}},tee.prototype.collapseRemoteChild=function(t,e){je(e)||e||!this.loadChildOnDemand||(t.record.expanded=!1);var i=t.rows,n=[],o=[],r=0<this.getFrozenLeftColumnsCount()||0<this.getFrozenRightColumnsCount();r&&(n=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+t.record.index+"level"+(t.record.level+1))}),o=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+t.record.index+"level"+(t.record.level+1))}));for(var s=0;s<i.length;s++){this.toggleRowVisibility(i[parseInt(s.toString(),10)],"e-childrow-hidden");var a=i[parseInt(s.toString(),10)],l=i[parseInt(s.toString(),10)].querySelector(".e-detailrowexpand");if(je(l)||this.grid.detailRowModule.collapse(l),r&&(this.toggleRowVisibility(n[parseInt(s.toString(),10)],"e-childrow-hidden"),this.toggleRowVisibility(o[parseInt(s.toString(),10)],"e-childrow-hidden"),i[parseInt(s.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")||(n[parseInt(s.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")?a=n[parseInt(s.toString(),10)]:o[parseInt(s.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")&&(a=o[parseInt(s.toString(),10)]))),a.querySelector(".e-treecolumn-container .e-treegridexpand")){var l=a.querySelector(".e-treecolumn-container .e-treegridexpand"),h=this.rowTemplate?this.grid.getCurrentViewRecords()[i[parseInt(s.toString(),10)].rowIndex]:this.grid.getRowObjectFromUID(i[parseInt(s.toString(),10)].getAttribute("data-Uid")).data;!je(l)&&h.expanded&&(q([l],"e-treegridexpand"),U([l],"e-treegridcollapse"));for(var d=[],p=this.getRows(),c=0;c<p.length;c++)p[parseInt(c.toString(),10)].querySelector(".e-gridrowindex"+h.index+"level"+(h.level+1))&&d.push(p[parseInt(c.toString(),10)]);d.length&&h.expanded&&this.collapseRemoteChild({record:h,rows:d},!1)}}this.grid.pageSettings.totalRecordsCount-=i.length},tee.prototype.sanitize=function(e){return this.enableHtmlSanitizer&&"string"==typeof e?go.sanitize(e):e},tee.prototype.addListener=function(){this.on("updateResults",this.updateResultModel,this),this.grid.on("initial-end",this.afterGridRender,this),this.grid.on("last-rowcell-border-updated",this.lastRowCellBorderUpdated,this)},tee.prototype.updateResultModel=function(e){this.dataResults=e},tee.prototype.removeListener=function(){this.isDestroyed||(this.off("updateResults",this.updateResultModel),this.grid.off("initial-end",this.afterGridRender),this.grid.off("last-rowcell-border-updated",this.lastRowCellBorderUpdated))},tee.prototype.filterByColumn=function(e,t,i,n,o,r,s,a){this.grid.filterByColumn(e,t,i,n,o,r,s,a)},tee.prototype.clearFiltering=function(){this.grid.clearFiltering()},tee.prototype.removeFilteredColsByField=function(e,t){this.grid.removeFilteredColsByField(e,t)},tee.prototype.selectRow=function(e,t){this.grid.selectRow(e,t)},tee.prototype.selectRows=function(e){this.grid.selectRows(e)},tee.prototype.clearSelection=function(){je(this.grid.selectionModule)||(this.grid.selectionModule.actualTarget=null),this.grid.clearSelection()},tee.prototype.copy=function(e){this.clipboardModule.copy(e)},tee.prototype.paste=function(e,t,i){this.clipboardModule.paste(e,t,i)},tee.prototype.selectCell=function(e,t){this.grid.selectCell(e,t)},tee.prototype.getSelectedRows=function(){return this.grid.getSelectedRows()},tee.prototype.getMovableCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},tee.prototype.getMovableDataRows=function(){return this.grid.getDataRows()},tee.prototype.getMovableRowByIndex=function(e){return this.grid.getRowByIndex(e)},tee.prototype.getMovableRows=function(){return this.grid.getRows()},tee.prototype.getFrozenRightRowByIndex=function(e){return this.grid.getRowByIndex(e)},tee.prototype.getFrozenRightRows=function(){return this.grid.getRows()},tee.prototype.getFrozenRightDataRows=function(){return this.grid.getDataRows()},tee.prototype.getFrozenRightCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},tee.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},tee.prototype.getFrozenRightColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},tee.prototype.getMovableColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},tee.prototype.getMovableColumnsCount=function(){return this.grid.getMovableColumnsCount()},tee.prototype.getFrozenLeftColumnsCount=function(){return this.grid.getFrozenLeftColumnsCount()},tee.prototype.getFrozenRightColumnsCount=function(){return this.grid.getFrozenRightColumnsCount()},tee.prototype.getFrozenLeftColumns=function(){return this.updateColumnModel(this.grid.getFrozenLeftColumns()),this.columnModel},tee.prototype.getFrozenRightColumns=function(){return this.updateColumnModel(this.grid.getFrozenRightColumns()),this.columnModel},tee.prototype.getVisibleMovableCount=function(){return this.grid.getVisibleMovableCount()},tee.prototype.getVisibleFrozenRightCount=function(){return this.grid.getVisibleFrozenRightCount()},tee.prototype.getVisibleFrozenLeftCount=function(){return this.grid.getVisibleFrozenLeftCount()},tee.prototype.getMovableColumns=function(){return this.updateColumnModel(this.grid.getMovableColumns()),this.columnModel},tee.prototype.getFrozenColumns=function(){return this.getFrozenCount(!je(this.columns)&&this.columns,0)+this.frozenColumns},tee.prototype.getFrozenCount=function(e,t){for(var i=0,n=e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?t=this.getFrozenCount(e[parseInt(i.toString(),10)].columns,t):e[parseInt(i.toString(),10)].isFrozen&&t++;return t},tee.prototype.getSelectedRowIndexes=function(){return this.grid.getSelectedRowIndexes()},tee.prototype.getSelectedRowCellIndexes=function(){return this.grid.getSelectedRowCellIndexes()},tee.prototype.getSelectedRecords=function(){return this.grid.getSelectedRecords()},tee.prototype.getDataModule=function(){return{baseModule:this.grid.getDataModule(),treeModule:this.dataModule}},tee.prototype.reorderRows=function(e,t,i){je(this.rowDragAndDropModule)||this.rowDragAndDropModule.reorderRows(e,t,i)},tee.prototype.indent=function(e){je(this.rowDragAndDropModule)||this.rowDragAndDropModule[this.indentOutdentAction](e,"indent")},tee.prototype.outdent=function(e){je(this.rowDragAndDropModule)||this.rowDragAndDropModule[this.indentOutdentAction](e,"outdent")},$$([e(0)],tee.prototype,"frozenRows",void 0),$$([e(0)],tee.prototype,"frozenColumns",void 0),$$([e("Ellipsis")],tee.prototype,"clipMode",void 0),$$([e([])],tee.prototype,"columns",void 0),$$([e(null)],tee.prototype,"childMapping",void 0),$$([e(null)],tee.prototype,"hasChildMapping",void 0),$$([e(0)],tee.prototype,"treeColumnIndex",void 0),$$([e(null)],tee.prototype,"idMapping",void 0),$$([e(null)],tee.prototype,"parentIdMapping",void 0),$$([e(!1)],tee.prototype,"enableCollapseAll",void 0),$$([e(null)],tee.prototype,"expandStateMapping",void 0),$$([e(!1)],tee.prototype,"allowRowDragAndDrop",void 0),$$([e([])],tee.prototype,"dataSource",void 0),$$([e()],tee.prototype,"query",void 0),$$([e()],tee.prototype,"cloneQuery",void 0),$$([e("AllPages")],tee.prototype,"printMode",void 0),$$([e(!1)],tee.prototype,"allowPaging",void 0),$$([e(!0)],tee.prototype,"loadChildOnDemand",void 0),$$([e(!1)],tee.prototype,"allowTextWrap",void 0),$$([t({},fJ)],tee.prototype,"textWrapSettings",void 0),$$([e(!1)],tee.prototype,"allowReordering",void 0),$$([e(!1)],tee.prototype,"allowResizing",void 0),$$([e(!1)],tee.prototype,"autoCheckHierarchy",void 0),$$([t({},x$)],tee.prototype,"pageSettings",void 0),$$([t({},sP)],tee.prototype,"rowDropSettings",void 0),$$([e("USD")],tee.prototype,"currencyCode",void 0),$$([e()],tee.prototype,"pagerTemplate",void 0),$$([e(!1)],tee.prototype,"showColumnMenu",void 0),$$([e(!1)],tee.prototype,"showColumnChooser",void 0),$$([e(!1)],tee.prototype,"allowSorting",void 0),$$([e(!0)],tee.prototype,"allowMultiSorting",void 0),$$([t({},_$)],tee.prototype,"sortSettings",void 0),$$([kt([],D$)],tee.prototype,"aggregates",void 0),$$([t({},M$)],tee.prototype,"editSettings",void 0),$$([e(!1)],tee.prototype,"allowFiltering",void 0),$$([e()],tee.prototype,"detailTemplate",void 0),$$([t({},mJ)],tee.prototype,"filterSettings",void 0),$$([t({},d$)],tee.prototype,"searchSettings",void 0),$$([e()],tee.prototype,"toolbar",void 0),$$([e()],tee.prototype,"toolbarTemplate",void 0),$$([e("Default")],tee.prototype,"gridLines",void 0),$$([e()],tee.prototype,"contextMenuItems",void 0),$$([e()],tee.prototype,"columnMenuItems",void 0),$$([e()],tee.prototype,"rowTemplate",void 0),$$([e("Parent")],tee.prototype,"copyHierarchyMode",void 0),$$([e(null)],tee.prototype,"rowHeight",void 0),$$([e(!0)],tee.prototype,"enableAltRow",void 0),$$([e(!0)],tee.prototype,"allowKeyboard",void 0),$$([e(!1)],tee.prototype,"enableHover",void 0),$$([e(!1)],tee.prototype,"enableAutoFill",void 0),$$([e(!1)],tee.prototype,"enableAdaptiveUI",void 0),$$([e(!1)],tee.prototype,"enableImmutableMode",void 0),$$([e("auto")],tee.prototype,"height",void 0),$$([e("auto")],tee.prototype,"width",void 0),$$([t({},pJ)],tee.prototype,"loadingIndicator",void 0),$$([e(!0)],tee.prototype,"enableVirtualMaskRow",void 0),$$([e(!1)],tee.prototype,"enableVirtualization",void 0),$$([e(!1)],tee.prototype,"enableColumnVirtualization",void 0),$$([e(!1)],tee.prototype,"enableHtmlSanitizer",void 0),$$([e(!1)],tee.prototype,"enableInfiniteScrolling",void 0),$$([t({},H$)],tee.prototype,"infiniteScrollSettings",void 0),$$([e("All")],tee.prototype,"columnQueryMode",void 0),$$([e(!0)],tee.prototype,"allowSelection",void 0),$$([e(-1)],tee.prototype,"selectedRowIndex",void 0),$$([t({},g$)],tee.prototype,"selectionSettings",void 0),$$([e(!1)],tee.prototype,"allowExcelExport",void 0),$$([e(!1)],tee.prototype,"allowPdfExport",void 0),$$([i()],tee.prototype,"created",void 0),$$([i()],tee.prototype,"load",void 0),$$([i()],tee.prototype,"expanding",void 0),$$([i()],tee.prototype,"expanded",void 0),$$([i()],tee.prototype,"collapsing",void 0),$$([i()],tee.prototype,"collapsed",void 0),$$([i()],tee.prototype,"cellSave",void 0),$$([i()],tee.prototype,"cellSaved",void 0),$$([i()],tee.prototype,"actionBegin",void 0),$$([i()],tee.prototype,"actionComplete",void 0),$$([i()],tee.prototype,"beginEdit",void 0),$$([i()],tee.prototype,"batchAdd",void 0),$$([i()],tee.prototype,"batchDelete",void 0),$$([i()],tee.prototype,"batchCancel",void 0),$$([i()],tee.prototype,"beforeBatchAdd",void 0),$$([i()],tee.prototype,"beforeBatchDelete",void 0),$$([i()],tee.prototype,"beforeBatchSave",void 0),$$([i()],tee.prototype,"cellEdit",void 0),$$([i()],tee.prototype,"actionFailure",void 0),$$([i()],tee.prototype,"dataBound",void 0),$$([i()],tee.prototype,"dataSourceChanged",void 0),$$([i()],tee.prototype,"dataStateChange",void 0),$$([i()],tee.prototype,"recordDoubleClick",void 0),$$([i()],tee.prototype,"rowDataBound",void 0),$$([i()],tee.prototype,"detailDataBound",void 0),$$([i()],tee.prototype,"queryCellInfo",void 0),$$([i()],tee.prototype,"rowSelecting",void 0),$$([i()],tee.prototype,"rowSelected",void 0),$$([i()],tee.prototype,"rowDeselecting",void 0),$$([i()],tee.prototype,"rowDeselected",void 0),$$([i()],tee.prototype,"headerCellInfo",void 0),$$([i()],tee.prototype,"cellSelecting",void 0),$$([i()],tee.prototype,"columnMenuOpen",void 0),$$([i()],tee.prototype,"columnMenuClick",void 0),$$([i()],tee.prototype,"cellSelected",void 0),$$([i()],tee.prototype,"cellDeselecting",void 0),$$([i()],tee.prototype,"cellDeselected",void 0),$$([i()],tee.prototype,"resizeStart",void 0),$$([i()],tee.prototype,"resizing",void 0),$$([i()],tee.prototype,"resizeStop",void 0),$$([i()],tee.prototype,"columnDragStart",void 0),$$([i()],tee.prototype,"columnDrag",void 0),$$([i()],tee.prototype,"columnDrop",void 0),$$([i()],tee.prototype,"checkboxChange",void 0),$$([i()],tee.prototype,"printComplete",void 0),$$([i()],tee.prototype,"beforePrint",void 0),$$([i()],tee.prototype,"toolbarClick",void 0),$$([i()],tee.prototype,"beforeDataBound",void 0),$$([i()],tee.prototype,"contextMenuOpen",void 0),$$([i()],tee.prototype,"contextMenuClick",void 0),$$([i()],tee.prototype,"beforeCopy",void 0),$$([i()],tee.prototype,"beforePaste",void 0),$$([i()],tee.prototype,"rowDrag",void 0),$$([i()],tee.prototype,"rowDragStart",void 0),$$([i()],tee.prototype,"rowDragStartHelper",void 0),$$([i()],tee.prototype,"rowDrop",void 0),$$([i()],tee.prototype,"pdfQueryCellInfo",void 0),$$([i()],tee.prototype,"pdfHeaderQueryCellInfo",void 0),$$([i()],tee.prototype,"excelQueryCellInfo",void 0),$$([i()],tee.prototype,"excelHeaderQueryCellInfo",void 0),$$([i()],tee.prototype,"beforeExcelExport",void 0),$$([i()],tee.prototype,"excelExportComplete",void 0),$$([i()],tee.prototype,"beforePdfExport",void 0),$$([i()],tee.prototype,"pdfExportComplete",void 0),Z$=$$([Bt],tee));function tee(e,t){e=J$.call(this,e,t)||this;e.dataResults={},e.uniqueIDCollection={},e.uniqueIDFilterCollection={},e.changedRecords="changedRecords",e.deletedRecords="deletedRecords",e.addedRecords="addedRecords",e.indentOutdentAction="indentOutdentAction",e.isFromChartSide=!1,e.modifiedRecords=[],e.stackedHeader=!1,e.objectEqualityChecker=function(e,t){if(e){for(var i=Object.keys(e),n=!0,o=["Children","childRecords","taskData","uniqueID","parentItem","parentUniqueID","index"],r=0;r<i.length;r++)if(e[i[parseInt(r.toString(),10)]]!==t[i[parseInt(r.toString(),10)]]&&-1===o.indexOf(i[parseInt(r.toString(),10)]))if(!(e[i[parseInt(r.toString(),10)]]instanceof Date&&t[i[parseInt(r.toString(),10)]]instanceof Date)||e[i[parseInt(r.toString(),10)]].getTime()!==t[i[parseInt(r.toString(),10)]].getTime()){n=!1;break}return n}return!1},Z$.Inject(o$,MJ),x("mergePersistData",e.mergePersistTreeGridData,e),je(e.injectedModules.Logger)||IP.Inject(Bk),e.injectedModules.filter(function(e){"freeze"===e.prototype.getModuleName()&&IP.Inject(xK)});return e.grid=new IP,e}nee.prototype.getModuleName=function(){return"reorder"},nee.prototype.addEventListener=function(){this.parent.on("getColumnIndex",this.updateTreeColumn,this)},nee.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("getColumnIndex",this.updateTreeColumn)},nee.prototype.destroy=function(){this.removeEventListener()},nee.prototype.updateTreeColumn=function(){this.parent.getTreeColumn()};var iee=nee;function nee(e){IP.Inject(QG),this.parent=e,this.addEventListener()}ree.prototype.autoFitColumns=function(e){this.parent.grid.autoFitColumns(e)},ree.prototype.getModuleName=function(){return"resize"},ree.prototype.destroy=function(){this.parent.isDestroyed||this.parent.grid.resizeModule.destroy()};var oee=ree;function ree(e){IP.Inject(jG),this.parent=e}aee.prototype.getChildrecordsByParentID=function(t){var e=this.parent.dataSource instanceof me&&$Z(this.parent)?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource;return e.filter(function(e){return e.uniqueID===t})},aee.prototype.addEventListener=function(){this.parent.on(LZ,this.Rowdraging,this),this.parent.on(RZ,this.rowDropped,this),this.parent.on(BZ,this.rowsAdded,this),this.parent.on(FZ,this.rowsRemoved,this)},aee.prototype.reorderRows=function(e,t,i){var n=this.parent;if(e[0]!==t&&-1!==["above","below","child"].indexOf(i)){var o="action";if(e[0]!==t&&-1!==["above","below","child"].indexOf(i)){"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment"),this.parent.dropPosition=this.dropPosition;for(var r=[],s=0;s<e.length;s++){var a=this.parent.getRowByIndex(e[parseInt(s.toString(),10)]).rowIndex;r[parseInt(s.toString(),10)]=this.parent.getCurrentViewRecords()[parseInt(a.toString(),10)]}var l,h,d,i={data:r,dropIndex:t};GZ(this.parent)||this.dropRows(i,!0),n.isLocalData&&(n.flatData=this.orderToIndex(n.flatData)),"outdenting"!==this.parent[o]||je(r[0].parentItem)||(r[0].level=r[0].parentItem.level+1),this.parent.grid.refresh(),this.parent.enableImmutableMode&&"middleSegment"===this.dropPosition&&(a=this.parent.allowRowDragAndDrop?this.parent.treeColumnIndex+1:"indenting"===this.parent[o]?this.parent.treeColumnIndex:void 0,l=this.parent.getRows()[e[0]],n=i.data[0],d=[],(h=[]).push(n),d.push(l),n=i$(this.parent,i.data[0].parentUniqueID),t=this.parent.getRows()[parseInt(t.toString(),10)],h.push(n),d.push(t),this.updateRowAndCellElements(h,d,a)),this.parent.enableImmutableMode&&"outdenting"===this.parent[o]&&(a=this.parent.allowRowDragAndDrop?this.parent.treeColumnIndex+1:"outdenting"===this.parent[o]?this.parent.treeColumnIndex:void 0,n=i.data[0],l=this.parent.getRows()[e[0]],d=[],(h=[]).push(n),d.push(l),this.updateRowAndCellElements(h,d,a))}}},aee.prototype.updateRowAndCellElements=function(e,t,i){for(var n=0;n<e.length;n++)this.parent.renderModule.cellRender({data:e[parseInt(n.toString(),10)],cell:t[parseInt(n.toString(),10)].cells[parseInt(i.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),"indenting"!==this.parent.action&&"outdenting"!==this.parent.action||this.parent.renderModule.RowModifier({data:e[parseInt(n.toString(),10)],row:t[parseInt(n.toString(),10)]})},aee.prototype.indentOutdentAction=function(e,t){var i=this.parent,n=-1;if(!je(e)||-1!==this.parent.selectedRowIndex){this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?n=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(n=this.parent.selectedRowIndex),this.selectedItem=je(e)?i.getCurrentViewRecords()[parseInt(n.toString(),10)]:e;var o,e=this.parent.getPrimaryKeyFieldNames()[0],e=this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[""+e]);if(this.selectedRow=this.parent[this.selectedRows]=-1!==n?this.parent.getSelectedRows()[0]:this.parent.grid.getRowByIndex(e),this.selectedRecord=this.parent[this.selectedRecords]=-1!==n?i.getCurrentViewRecords()[parseInt(n.toString(),10)]:this.selectedItem,"indent"===t){var r=i.getCurrentViewRecords()[this.selectedRow.rowIndex-1],s=void 0;if(0!==this.selectedRow.rowIndex&&-1!==this.selectedRow.rowIndex&&i.getCurrentViewRecords()[this.selectedRow.rowIndex].level-r.level!=1){if(r.level>this.selectedRecord.level)for(var a=0;a<i.getCurrentViewRecords().length;a++)i.getCurrentViewRecords()[parseInt(a.toString(),10)].taskData===r.parentItem.taskData&&(s=a,i.enableVirtualization)&&(s=parseInt(i.getRows()[parseInt(a.toString(),10)].getAttribute("aria-rowindex"),10)-1);else s=this.selectedRow.rowIndex-1;!this.parent.enableVirtualization||!this.selectedRecord||r.level>this.selectedRecord.level||(s=parseInt(this.selectedRow.getAttribute("aria-rowindex"),10)-2),i.action="indenting",i.dropIndex=s,this.eventTrigger("indenting",s)}}else"outdent"===t&&(e=-1===this.selectedRow.rowIndex||0===this.selectedRow.rowIndex,n=0===i.getCurrentViewRecords()[this.selectedRow.rowIndex].level,e||n||(o=this.selectedRecord.parentItem,-1!==(s=i.getCurrentViewRecords().findIndex(function(e){return e.uniqueID===o.uniqueID}))&&(this.parent.enableVirtualization&&this.selectedRecord&&(t=this.parent.getRows()[parseInt(s.toString(),10)].getAttribute("aria-rowindex"),s=parseInt(t,10)-1),i.action="outdenting",i.dropIndex=s,this.eventTrigger("outdenting",s))))}},aee.prototype.eventTrigger=function(e,t){var i=this,e={action:e,cancel:!1,data:[this.parent[this.selectedRecords]],row:this.parent[this.selectedRows]};this.parent.trigger(OJ,e,function(e){e.cancel||("indenting"===e.action?i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("aria-rowindex"),10)-1],t,"child"):i.reorderRows([i.selectedRow.rowIndex],t,"child"):"outdenting"===e.action&&(i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("aria-rowindex"),10)-1],t,"below"):i.reorderRows([i.selectedRow.rowIndex],t,"below")))})},aee.prototype.orderToIndex=function(e){for(var t,i=0;i<e.length;i++)e[parseInt(i.toString(),10)].index=i,je(e[parseInt(i.toString(),10)].parentItem)||(t=R("uniqueIDCollection."+e[parseInt(i.toString(),10)].parentUniqueID,this.parent),e[parseInt(i.toString(),10)].parentItem.index=t.index);return e},aee.prototype.rowsAdded=function(e){for(var t,i,n,o=e.records,r=e.records.length-1;-1<r;r--)(n=o[parseInt(r.toString(),10)]).parentUniqueID&&(i=o.filter(function(e){return e.uniqueID===n.parentUniqueID})).length&&(t=i[0].childRecords.indexOf(n),i=i[0],-1!==t)&&(je(this.parent.idMapping)&&(i.childRecords.splice(t,1),i.childRecords.length||(i.hasChildRecords=!1,i.hasFilteredChildRecords=!1)),this.isDraggedWithChild=!0);if(je(this.parent.dataSource)||!this.parent.dataSource.length){for(var s,a=this.parent,l=e.records,r=e.records.length-1;-1<r;r--){s=l[parseInt(r.toString(),10)],!r&&s.hasChildRecords&&(s.taskData[this.parent.parentIdMapping]=null);if(je(a.parentIdMapping)||(a.childMapping=null),je(s.taskData)||je(a.childMapping)||Object.prototype.hasOwnProperty.call(s.taskData,a.childMapping)||(s.taskData[a.childMapping]=[]),!je(s[a.childMapping])&&Object.prototype.hasOwnProperty.call(s,a.childMapping)&&s[a.childMapping].length&&!this.isDraggedWithChild&&!je(a.parentIdMapping))for(var h=s[a.childMapping],d=0;d<h.length;d++)-1===l.indexOf(h[parseInt(d.toString(),10)])&&(l.splice(d,0,h[parseInt(d.toString(),10)]),h[parseInt(d.toString(),10)].taskData=Pe({},h[parseInt(d.toString(),10)]),r+=1);Object.prototype.hasOwnProperty.call(s,a.parentIdMapping)&&null!==s[a.parentIdMapping]&&!this.isDraggedWithChild&&(s.taskData[a.parentIdMapping]=null,delete s.parentItem,delete s.parentUniqueID),je(a.dataSource)&&(a.dataSource=[]),a.dataSource.splice(0,0,s.taskData)}a.setProperties({dataSource:a.dataSource},!1)}else{for(r=0;r<o.length;r++)x("uniqueIDCollection."+o[parseInt(r.toString(),10)].uniqueID,o[parseInt(r.toString(),10)],this.parent);e={data:e.records,dropIndex:e.toIndex};this.parent.dataSource instanceof me?(this.treeGridData=this.parent.dataSource.dataSource.json,this.treeData=this.parent.dataSource.dataSource.json):(this.treeGridData=this.parent.grid.dataSource,this.treeData=this.parent.dataSource),je(this.dropPosition)&&(this.dropPosition="bottomSegment",e.dropIndex=1<this.parent.getCurrentViewRecords().length?this.parent.getCurrentViewRecords().length-1:e.dropIndex,e.data=e.data.map(function(e){return e.hasChildRecords&&je(e.parentItem)||(delete e.parentItem,delete e.parentUniqueID),e.level=0,e})),this.dropRows(e)}},aee.prototype.rowsRemoved=function(e){for(var t=0;t<e.records.length;t++)this.draggedRecord=e.records[parseInt(t.toString(),10)],(this.draggedRecord.hasChildRecords||this.draggedRecord.parentItem&&-1!==this.parent.grid.dataSource.indexOf(this.getChildrecordsByParentID(this.draggedRecord.parentUniqueID)[0])||0===this.draggedRecord.level)&&this.deleteDragRow()},aee.prototype.refreshGridDataSource=function(){var e,t=this.draggedRecord,i=this.droppedRecord,n=this.parent,o=this.parent.dataSource instanceof me&&$Z(this.parent)?n.dataSource.dataSource.json:n.dataSource;if(!o||je(i)||i.parentItem||je(i.taskData)){if(!this.parent.parentIdMapping&&!je(i)&&i.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition))for(var r=this.getChildrecordsByParentID(i.parentUniqueID)[0].childRecords,s=0;s<r.length;s++)i.parentItem.taskData[this.parent.childMapping][parseInt(s.toString(),10)]=r[parseInt(s.toString(),10)].taskData}else{for(var a=Object.keys(o),s=0;s<a.length;s++)o[parseInt(s.toString(),10)][this.parent.childMapping]===i.taskData[this.parent.childMapping]&&(e=s);this.parent.idMapping||(n="topSegment"===this.dropPosition?0:1,"topSegment"!==this.dropPosition&&"bottomSegment"!==this.dropPosition)||o.splice(e+n,0,t.taskData)}this.parent.parentIdMapping&&(t.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(t[this.parent.parentIdMapping]=i[this.parent.parentIdMapping],t.taskData[this.parent.parentIdMapping]=i[this.parent.parentIdMapping]):(t[this.parent.parentIdMapping]=i[this.parent.idMapping],t.taskData[this.parent.parentIdMapping]=i[this.parent.idMapping]):(t.taskData[this.parent.parentIdMapping]=null,t[this.parent.parentIdMapping]=null))},aee.prototype.removeFirstrowBorder=function(e){var t="bottomSegment"===this.dropPosition;0<this.parent.element.getElementsByClassName("e-firstrow-border").length&&e&&(0!==e.rowIndex||t)&&this.parent.element.getElementsByClassName("e-firstrow-border")[0].remove()},aee.prototype.removeLastrowBorder=function(e){var t;!e||e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow")||(e=(this.parent.enableVirtualization?this.parent.getRows()[this.parent.getCurrentViewRecords().length-1]:this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length-1)).getAttribute("data-uid")!==e.getAttribute("data-uid")||"topSegment"===this.dropPosition,(t=this.parent.element.getElementsByClassName("e-lastrow-border")[0])&&e&&t.remove())},aee.prototype.updateIcon=function(e,t,i){var n=i.target?z(i.target,"tr"):null,o=(this.dropPosition=void 0,0);this.removeFirstrowBorder(n),this.removeLastrowBorder(n);for(var r=0;r<i.rows.length;r++)(je(n)||n.getAttribute("data-uid")!==i.rows[parseInt(r.toString(),10)].getAttribute("data-uid"))&&A(i.target,"e-gridcontent")||(this.dropPosition="Invalid",this.addErrorElem(),je(this.parent.rowDropSettings.targetID)&&(this.removetopOrBottomBorder(),this.removeChildBorder()));var s=this.parent,a=0,l=s.toolbar&&s.toolbar.length?document.getElementById(s.element.id+"_gridcontrol_toolbarItems").offsetHeight:0,h=this.getOffset(s.element),h=s.getHeaderContent().offsetHeight+h.top+l,l=s.getContent().firstElementChild.scrollTop,a=(je(n)||(o=n.offsetTop-l),this.parent.enableVirtualization?n.getBoundingClientRect().top:o+h+0),s=((0!==e[0].offsetHeight&&je(n)?a+e[0].offsetHeight:a+n.offsetHeight)-a)/3,l=a+s,o=l+s,h=o+s,a=FB("originalEvent.event",i),s=FB("originalEvent.event",i),d="mousemove"===a.type?a.pageY:je(s)||je(s.changedTouches)?null:s.changedTouches[0].pageY,a=(d=this.parent.enableVirtualization?"mousemove"===a.type?a.clientY:je(s)||je(s.changedTouches)?null:s.changedTouches[0].clientY:d)<=l,s=l<d&&d<=o,l=o<d&&d<=h,o=!0;return(a||s||l)&&(a&&"Invalid"!==this.dropPosition&&(this.removeChildBorder(),this.dropPosition="topSegment",this.removetopOrBottomBorder(),this.addFirstrowBorder(n),this.removeErrorElem(),this.removeLastrowBorder(n)),s&&"Invalid"!==this.dropPosition&&(this.removetopOrBottomBorder(),this.dropPosition="middleSegment",this.addLastRowborder(n),this.addFirstrowBorder(n)),l&&"Invalid"!==this.dropPosition&&(this.removeErrorElem(),this.removetopOrBottomBorder(),this.removeChildBorder(),this.dropPosition="bottomSegment",this.addLastRowborder(n),this.removeFirstrowBorder(n)),(a||l)&&"Invalid"!==this.dropPosition?(o=this.updateBorderStatus(e,t),this.topOrBottomBorder(i.target,o)):s&&"Invalid"!==this.dropPosition&&(d=[],h=z(i.target,"tr"),d=[].slice.call(h.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")),o=this.updateBorderStatus(e,t),0<d.length)&&o&&this.addRemoveClasses(d,!0,"e-childborder")),this.dropPosition},aee.prototype.updateBorderStatus=function(a,l){var o=this,h=!0,d=this.parent.grid.getRows(),p=[],r=!1,e=(je(this.parent.detailTemplate)||(d=this.parent.getDataRows(),r=!0),this.parent.treeColumnIndex),c=this.parent.allowRowDragAndDrop?r?e+2:e+1:r?e+1:e,u=(je(this.parent.rowDropSettings.targetID)||(c=e),a),g=[d[""+l]];return"topSegment"===this.dropPosition&&(a.filter(function(e){if(!(je(e)||je(e.cells)||je(g[0])||je(g[0].cells))){var t=/index(\d+)|level(\d+)/g,e=null==e?void 0:e.cells[""+c].className.match(t),i=g[0].cells[""+c].className.match(t);if(!je(i)&&!je(i)){var n=+e[1].match(/\d+/)[0],e=+i[1].match(/\d+/)[0],o=!1;if(0==n||n==e){for(var r=0;r<d.length;r++)if((o=d[parseInt(r.toString(),10)]===u[0]?!0:o)&&d[parseInt(r.toString(),10)]!==u[0]){var s=+d[parseInt(r.toString(),10)].cells[""+c].className.match(t)[1].match(/\d+/)[0];if(!(s!=n&&n<s))break;p.push(d[parseInt(r.toString(),10)])}n==e&&(0<p.length&&parseInt(a[0].getAttribute("aria-rowindex"),10)-1==l-(p.length+1)||0===p.length&&parseInt(a[0].getAttribute("aria-rowindex"),10)-1==l-1)&&(h=!1)}}}return!0}),h=!(!je(a)&&0===p.length&&!je(a[0].getAttribute("aria-rowindex"))&&parseInt(a[0].getAttribute("aria-rowindex"),10)-1==l-1&&je(a[0]))&&h),"bottomSegment"===this.dropPosition&&(g.filter(function(e){if(!(je(e)||je(e.cells)||je(u[0])||je(u[0].cells))){var t=/index(\d+)|level(\d+)/g,e=null==e?void 0:e.cells[""+c].className.match(t),i=u[0].cells[""+c].className.match(t);if(!je(i)&&!je(e)){var n=+e[1].match(/\d+/)[0],e=+i[1].match(/\d+/)[0],o=!1;if(0==n||n==e){for(var r=0;r<d.length;r++)if((o=d[parseInt(r.toString(),10)]===g[0]?!0:o)&&d[parseInt(r.toString(),10)]!==g[0]){var s=+d[parseInt(r.toString(),10)].cells[""+c].className.match(t)[1].match(/\d+/)[0];if(!(s!=n&&n<s))break;p.push(d[parseInt(r.toString(),10)])}!je(a)&&n==e&&(0<p.length&&!je(a[0].getAttribute("aria-rowindex"))&&parseInt(a[0].getAttribute("aria-rowindex"),10)-1===l+(p.length+1)||0===p.length&&!je(a[0].getAttribute("aria-rowindex"))&&parseInt(a[0].getAttribute("aria-rowindex"),10)-1===l+1)&&(h=!1)}}}return!0}),h=!(!je(a)&&0===p.length&&!je(a[0].getAttribute("aria-rowindex"))&&parseInt(a[0].getAttribute("aria-rowindex"),10)-1===l+1&&je(a[0]))&&h),"middleSegment"===this.dropPosition&&g.filter(function(e){if(je(e)||je(e.cells)||je(u[0])||je(u[0].cells))return!0;for(var t=0;t<u.length;t++){var i=g[0].rowIndex,n=u[parseInt(t.toString(),10)].cells[""+c].className.match(/index(\d+)|level(\d+)/g);if(!n)return!0;n=parseInt(n.find(function(e){return e.includes("index")}).match(/\d+/)[0]||"0",10);if(r&&(i/=2),n!==i||o.parent.rowDropSettings.targetID){h=!0;break}h=!1}return h||(o.dropPosition="Invalid",o.addErrorElem()),h}),this.canDrop=h},aee.prototype.removeChildBorder=function(){var e;0<(e=[].slice.call(this.parent.element.querySelectorAll(".e-childborder"))).length&&this.addRemoveClasses(e,!1,"e-childborder")},aee.prototype.addFirstrowBorder=function(e){var t,i,n=this.parent.element,o=this.parent;e&&0===e.rowIndex&&!e.classList.contains("e-emptyrow")&&(e=this.parent.createElement("div",{className:"e-firstrow-border"}),t=this.parent.getHeaderContent(),i=0,o.toolbar&&(i=o.toolbarModule.getToolbar().offsetHeight),(o=!je(this.parent.rowDropSettings.targetID))&&(e.style.top=this.parent.grid.element.getElementsByClassName("e-gridheader")[0].offsetHeight+i+"px"),e.style.width=o?n.offsetWidth+"px":n.offsetWidth-this.getScrollWidth()+"px",t.querySelectorAll(".e-firstrow-border").length||t.appendChild(e))},aee.prototype.addLastRowborder=function(e){var t;!e||(t=e&&(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow")))||e&&!t&&this.parent.getRows()[this.parent.getCurrentViewRecords().length-1].getAttribute("data-uid")===e.getAttribute("data-uid")&&(t=this.parent.createElement("div",{className:"e-lastrow-border"}),e=this.parent.getContent(),t.style.width=this.parent.element.offsetWidth-this.getScrollWidth()+"px",e.querySelectorAll(".e-lastrow-border").length||(e.classList.add("e-treegrid-relative"),e.appendChild(t),t.style.bottom=this.getScrollWidth()+"px"))},aee.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?mk.getScrollBarWidth():0},aee.prototype.addErrorElem=function(){var e,t,i,n=document.getElementsByClassName("e-cloneproperties")[0];n.querySelectorAll(".e-errorelem").length||this.parent.rowDropSettings.targetID||((e=document.createElement("div")).classList.add("e-errorcontainer","e-icons","e-errorelem"),i=n.querySelector(".e-rowcell"),n=n.querySelector(".errorValue"),t=i.innerHTML,n&&(t=this.parent.sanitize(n.innerHTML),n.parentNode.removeChild(n)),i.innerHTML="",(n=document.createElement("span")).className="errorValue",n.style.paddingLeft="16px",n.innerHTML=this.parent.sanitize(t),i.appendChild(e),i.appendChild(n),t=document.querySelector(".e-dropitemscount"),this.hasDropItem&&t&&(i=parseInt(t.style.left,10)+e.offsetWidth+16,n=this.parent.enableRtl?0:i,t.style.left=n+"px",this.hasDropItem=!1))},aee.prototype.removeErrorElem=function(){var e,t=document.querySelector(".e-errorelem"),i=document.querySelector(".errorValue"),n=document.querySelector(".e-dropitemscount");t&&(n&&(e=parseInt(n.style.left,10)-t.offsetWidth-16,gt(i,{paddingLeft:"0px"}),this.parent.enableRtl||gt(n,{left:e+"px"})),t.remove()),this.hasDropItem=!0},aee.prototype.topOrBottomBorder=function(e,t){void 0===t&&(t=!0);var e=z(e,"tr"),e=e?Array.from(e.querySelectorAll(".e-rowcell, .e-rowdragdrop, .e-detailrowcollapse")):[];e.length&&(t=t?this.addRemoveClasses.bind(this,e,!0):this.addRemoveClasses.bind(this,e,!1,"e-dragborder"),"topSegment"===this.dropPosition&&(t("e-droptop"),e=this.parent.element.querySelector(".e-lastrow-dragborder"))&&e.remove(),"bottomSegment"===this.dropPosition)&&t("e-dropbottom")},aee.prototype.removetopOrBottomBorder=function(){var e;(e=[].slice.call(this.parent.element.querySelectorAll(".e-dropbottom, .e-droptop"))).length&&(this.addRemoveClasses(e,!1,"e-dropbottom"),this.addRemoveClasses(e,!1,"e-droptop"))},aee.prototype.addRemoveClasses=function(e,t,i){for(var n=0,o=e.length;n<o;n++)t?e[parseInt(n.toString(),10)].classList.add(i):e[parseInt(n.toString(),10)].classList.remove(i)},aee.prototype.getOffset=function(e){var e=e.getBoundingClientRect(),t=document.body,i=document.documentElement,n=window.pageYOffset||i.scrollTop||t.scrollTop,o=window.pageXOffset||i.scrollLeft||t.scrollLeft,r=i.clientTop||t.clientTop||0,i=i.clientLeft||t.clientLeft||0,t=e.top+n-r,n=e.left+o-i;return{top:Math.round(t),left:Math.round(n)}},aee.prototype.Rowdraging=function(e){var t,i,n,o,r=this.parent,s=this.parent.element.querySelector(".e-cloneproperties");s&&(s.style.cursor="",t=e.target?z(e.target,"tr"):null,(o=-1)===(o=je(this.parent.detailTemplate)?t?t.rowIndex:-1:t?this.parent.getDataRows().indexOf(t):-1)?(this.canDrop=!1,this.addErrorElem(),this.removetopOrBottomBorder(),this.removeChildBorder()):(t=Array.isArray(e.data)?e.data:[e.data],i=r.getCurrentViewRecords()[parseInt(o.toString(),10)],r.rowDropSettings.targetID&&(n=A(e.target,"e-treegrid"))&&n.id===this.parent.rowDropSettings.targetID&&(i=n.ej2_instances[0].getCurrentViewRecords()[parseInt(o.toString(),10)]),this.removeErrorElem(),this.canDrop=!0,this.ensuredropPosition(t,i),r.rowDropSettings.targetID||!this.canDrop||je(e.rows[0])||r.rowDragAndDropModule.updateIcon(e.rows,o,e),r.rowDropSettings.targetID&&(n=A(e.target,"e-treegrid"))&&n.id===this.parent.rowDropSettings.targetID&&n.ej2_instances[0].rowDragAndDropModule.updateIcon(e.rows,o,e),e.target&&z(e.target,"#"+r.rowDropSettings.targetID)&&((n=A(e.target,"e-treegrid"))||(s.style.cursor="default"))))},aee.prototype.rowDropped=function(e){var t=this.parent;if(t.rowDropSettings.targetID){if((e.target&&z(e.target,"#"+t.rowDropSettings.targetID)||A(e.target,"e-treegrid")&&A(e.target,"e-treegrid").id===t.rowDropSettings.targetID||e.target&&document.getElementById(t.rowDropSettings.targetID))&&(!this.parent.element.querySelector(".e-errorelem")&&this.canDrop||(this.dropPosition="Invalid"),x("dropPosition",this.dropPosition,e),t.trigger(kZ,e),!e.cancel)&&t.rowDropSettings.targetID){if("Invalid"===this.dropPosition&&!this.canDrop)return;this.dragDropGrid(e),t.isLocalData&&(t.flatData=this.orderToIndex(t.flatData))}}else if((A(e.target,"e-content")||"Invalid"===this.dropPosition||!this.canDrop)&&(!this.parent.element.querySelector(".e-errorelem")&&this.canDrop||(this.dropPosition="Invalid"),x("dropPosition",this.dropPosition,e),t.trigger(kZ,e),!e.cancel)){if(!GZ(this.parent)&&"Invalid"===this.dropPosition&&!this.canDrop)return;GZ(this.parent)||this.dropRows(e),t.isLocalData&&(t.flatData=this.orderToIndex(t.flatData)),t.grid.refresh(),this.removeRowBorders()}if(this.removetopOrBottomBorder(),this.removeChildBorder(),this.removeRowBorders(),this.parent.enableImmutableMode&&!this.parent.allowPaging&&!je(e.data[0].parentItem)){var i=this.parent.treeColumnIndex,t=(i+=1,this.parent.getPrimaryKeyFieldNames()[0]),n=this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+t]),o=this.parent.getRows()[parseInt(n.toString(),10)],r=e.data[0];if("middleSegment"===this.dropPosition){var s=[],a=[],r=(s.push(r),a.push(o),i$(this.parent,e.data[0].parentUniqueID)),n=this.parent.grid.getRowIndexByPrimaryKey(r[""+t]),e=this.parent.getRows()[parseInt(n.toString(),10)];s.push(r),a.push(e);for(var l=0;l<s.length;l++)this.parent.renderModule.cellRender({data:s[parseInt(l.toString(),10)],cell:a[parseInt(l.toString(),10)].cells[parseInt(i.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"});t=e.getElementsByClassName("e-treegridcollapse")[0];je(t)||(q([t],"e-treegridcollapse"),U([t],"e-treegridexpand"))}else this.parent.renderModule.cellRender({data:r,cell:o.cells[parseInt(i.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"})}},aee.prototype.removeRowBorders=function(){var t=this;["e-firstrow-border","e-lastrow-border"].forEach(function(e){e=t.parent.element.getElementsByClassName(e)[0];e&&e.remove()})},aee.prototype.dragDropGrid=function(e){var t=this.parent,i=z(e.target,"tr"),i=isNaN(this.getTargetIdx(i))?0:this.getTargetIdx(i),e=A(e.target,"e-treegrid");if(e&&e.id===this.parent.rowDropSettings.targetID&&!qZ(this.parent)&&!GZ(this.parent)){for(var n=e.ej2_instances[0],o=t.getSelectedRecords(),r=[],s=0;s<o.length;s++)r[parseInt(s.toString(),10)]=o[parseInt(s.toString(),10)].index;var a=n.dataSource;if(null!==this.parent.idMapping&&(je(this.dropPosition)||"bottomSegment"===this.dropPosition||"Invalid"===this.dropPosition)&&!a.length){for(var l=[],s=0;s<o.length;s++)if(o[parseInt(s.toString(),10)].hasChildRecords){l.push(o[parseInt(s.toString(),10)]);for(var h=ZZ(o[parseInt(s.toString(),10)]),d=0;d<h.length;d++)l.push(h[parseInt(d.toString(),10)])}l.length&&(o=l)}t.notify(FZ,{indexes:r,records:o}),n.notify(BZ,{toIndex:i,records:o});var p=n.rowDragAndDropModule.treeGridData;if(!je(p))for(var c,s=0;s<p.length;s++)p[parseInt(s.toString(),10)].index=s,je(p[parseInt(s.toString(),10)].parentItem)||(c=R("uniqueIDCollection."+p[parseInt(s.toString(),10)].parentUniqueID+".index",n),p[parseInt(s.toString(),10)].parentItem.index=c);t.grid.refresh(),n.grid.refresh(),1<n.grid.dataSource.length&&(n.grid.refresh(),je(n.getHeaderContent().querySelector(".e-firstrow-border"))||n.getHeaderContent().querySelector(".e-firstrow-border").remove(),je(n.getContent().querySelector(".e-lastrow-border"))||n.getContent().querySelector(".e-lastrow-border").remove())}GZ(this.parent)&&(n=e.ej2_instances[0],t.grid.refresh(),n.grid.refresh())},aee.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute("aria-rowindex"),10)-1:0},aee.prototype.getParentData=function(e,t){var i,e=e.parentItem,n=-1;this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?n=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(n=this.parent.selectedRowIndex),"bottomSegment"===this.dropPosition&&(i=this.parent.getPrimaryKeyFieldNames()[0],t=-1===n?this.parent.grid.getRowIndexByPrimaryKey(t[0][""+i]):this.parent.getSelectedRowIndexes()[0],i=this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)],this.droppedRecord=i$(this.parent,i.parentItem.uniqueID)),"middleSegment"===this.dropPosition&&(this.parent.getCurrentViewRecords()[parseInt(n.toString(),10)].level===e.level?this.droppedRecord=i$(this.parent,e.uniqueID):this.getParentData(e))},aee.prototype.dropRows=function(h,d){if("Invalid"!==this.dropPosition&&!qZ(this.parent)){var p,c=this.parent,u=void 0,g=(je(h.dropIndex)?(e=this.parent.getPrimaryKeyFieldNames()[0],e=-1===c.selectedRowIndex?this.parent.grid.getRowIndexByPrimaryKey(h.data[0][""+e])-1:c.getSelectedRowIndexes()[0]-1,e=c.getCurrentViewRecords()[parseInt(e.toString(),10)],this.getParentData(e,h.data)):(h.dropIndex=h.dropIndex===h.fromIndex?this.getTargetIdx(h.target.parentElement):h.dropIndex,this.parent.enableVirtualization?(e=this.parent.getRowByIndex(h.dropIndex).rowIndex,this.droppedRecord=c.getCurrentViewRecords()[parseInt(e.toString(),10)]):je(this.parent.rowDropSettings.targetID)?this.droppedRecord=c.getCurrentViewRecords()[h.dropIndex]:(e=this.parent.grid.getRowsObject(),this.droppedRecord=0<e.length?e[h.dropIndex].data:void 0)),[]),u=this.droppedRecord;h.data[0]?g=h.data:g.push(h.data),this.parent[this.modifiedRecords].push(h.data[0],u);for(var m=0,e=this.parent.rowDropSettings.targetID,t=((this.isMultipleGrid=e)?this.isaddtoBottom=e&&this.isDraggedWithChild:this.ensuredropPosition(g,u),g.length),f=(je(this.parent.idMapping)||g.reverse(),this),i=0;i<t;i++)!function(e){if(p=g[parseInt(e.toString(),10)],f.draggedRecord=p,!f.draggedRecord.hasChildRecords)for(var t=0,i=g;t<i.length;t++){var n=i[t];je(n.childRecords)||-1===n.childRecords.indexOf(f.draggedRecord)||(f.draggedRecord=void 0)}var o,r,s,a,l;je(f.draggedRecord)||("Invalid"===f.dropPosition||je(f.droppedRecord)||(c.rowDropSettings.targetID&&!d||f.deleteDragRow(),f.draggedRecord===f.droppedRecord&&(e=f.getTargetIdx(h.target.offsetParent.parentElement),isNaN(e)&&(e=f.getTargetIdx(h.target.parentElement)),h.dropIndex=e,u=f.droppedRecord=f.parent.getCurrentViewRecords()[h.dropIndex]),!u.parentItem&&"middleSegment"!==f.dropPosition||-1===(a=(s=c.parentData).indexOf(f.draggedRecord))||s.splice(a,1),e=f.treeGridData.indexOf(u),f.dropAtTop(e),"bottomSegment"===f.dropPosition&&(u.hasChildRecords?(m=f.getChildCount(u,0),f.parent.parentIdMapping&&f.treeData.splice(e+m+1,0,f.draggedRecord.taskData),f.treeGridData.splice(e+m+1,0,f.draggedRecord)):(f.parent.parentIdMapping&&f.treeData.splice(e+1,0,f.draggedRecord.taskData),f.treeGridData.splice(e+1,0,f.draggedRecord)),je(u.parentItem)&&(delete p.parentItem,delete p.parentUniqueID,p.level=0,f.parent.parentIdMapping)&&(p[f.parent.parentIdMapping]=null),u.parentItem&&(r=(o=f.getChildrecordsByParentID(u.parentUniqueID)[0].childRecords).indexOf(u)+1,o.splice(r,0,p),p.parentItem=u.parentItem,p.parentUniqueID=u.parentUniqueID,p.level=u.level,f.parent.parentIdMapping)&&(p[f.parent.parentIdMapping]=u[f.parent.parentIdMapping],p.parentItem=u.parentItem,p.level=u.level),p.hasChildRecords)&&(f.updateChildRecordLevel(p,1),f.updateChildRecord(p,e+m+1)),f.dropMiddle(e)),je(p.parentItem)&&(a=(s=c.parentData).indexOf(f.droppedRecord),l=0,s.filter(function(e){p.uniqueID===e.uniqueID&&l++}),"bottomSegment"===f.dropPosition&&0===l?s.splice(a+1,0,p):"topSegment"===f.dropPosition&&0===l&&s.splice(a,0,p)),c.rowDragAndDropModule.refreshGridDataSource())}(i)}},aee.prototype.dropMiddle=function(e){var t=this.parent,i=ZZ(this.droppedRecord),i=je(i)||0===i.length?e+1:i.length+e+1;"middleSegment"===this.dropPosition&&(t.parentIdMapping&&this.treeData.splice(i,0,this.draggedRecord.taskData),this.treeGridData.splice(i,0,this.draggedRecord),this.recordLevel(),this.draggedRecord.hasChildRecords)&&this.updateChildRecord(this.draggedRecord,i)},aee.prototype.dropAtTop=function(e){var t=this.parent;"topSegment"===this.dropPosition&&(t.parentIdMapping&&this.treeData.splice(e,0,this.draggedRecord.taskData),t=this.treeGridData[parseInt(e.toString(),10)],this.draggedRecord.parentItem=t.parentItem,this.draggedRecord.parentUniqueID=t.parentUniqueID,this.draggedRecord.level=t.level,this.treeGridData.splice(parseInt(e.toString(),10),0,this.draggedRecord),this.draggedRecord.hasChildRecords&&(this.updateChildRecord(this.draggedRecord,e),this.updateChildRecordLevel(this.draggedRecord,1)),this.droppedRecord.parentItem)&&(e=(t=this.getChildrecordsByParentID(this.droppedRecord.parentUniqueID)[0].childRecords).indexOf(this.droppedRecord),t.splice(e,0,this.draggedRecord))},aee.prototype.recordLevel=function(){var e,t=this.parent,i=this.draggedRecord,n=this.droppedRecord,o=t.childMapping;!n.hasChildRecords&&(n.hasChildRecords=!0,n.hasFilteredChildRecords=!0,je(n.childRecords)||0===n.childRecords.length)&&(n.childRecords=[],!t.parentIdMapping)&&je(n.taskData[""+o])&&(n.taskData[""+o]=[]),"middleSegment"===this.dropPosition&&(delete(e=Pe({},n)).childRecords,i.parentItem=e,i.parentUniqueID=n.uniqueID,n.childRecords.splice(n.childRecords.length,0,i),x("uniqueIDCollection."+i.uniqueID,i,t),t.isSelfReference&&(n[t.childMapping]=[],n[t.childMapping].splice(n[t.childMapping].length,0,i)),je(i)||t.parentIdMapping||je(n.taskData[""+o])||n.taskData[t.childMapping].splice(n.childRecords.length,0,i.taskData),i.hasChildRecords?(i.level=n.level+1,this.updateChildRecordLevel(i,1)):i.level=n.level+1,n.expanded=!0)},aee.prototype.deleteDragRow=function(){this.parent.dataSource instanceof me&&$Z(this.parent)?(this.treeGridData=this.parent.grid.dataSource.dataSource.json,this.treeData=this.parent.dataSource.dataSource.json):(this.treeGridData=this.parent.grid.dataSource,this.treeData=this.parent.dataSource);var e=i$(this.parent,this.draggedRecord.uniqueID);!je(e.childRecords)&&e.childRecords.length&&(e.hasChildRecords=!0),this.removeRecords(e)},aee.prototype.updateChildRecord=function(e,t){var i,n=this.parent;if(!e.hasChildRecords)return 0;for(var o=e.childRecords.length,r=0;r<o;r++)i=this.isMultipleGrid?e.childRecords[parseInt(r.toString(),10)]:R("uniqueIDCollection."+e.childRecords[parseInt(r.toString(),10)].uniqueID,n),n.flatData.splice(++t,0,i),x("uniqueIDCollection."+i.uniqueID,i,this.parent),n.parentIdMapping&&this.treeData.splice(t,0,i.taskData),i.hasChildRecords&&(t=this.updateChildRecord(i,t));return t},aee.prototype.updateChildRecordLevel=function(e,t){if(t++,!e.hasChildRecords)return 0;for(var i=e.childRecords.length,n=0;n<i;n++){var o=this.isMultipleGrid?e.childRecords[parseInt(n.toString(),10)]:R("uniqueIDCollection."+e.childRecords[parseInt(n.toString(),10)].uniqueID,this.parent),r=void 0;je(r=e.parentItem?i$(this.parent,e.parentItem.uniqueID):r)&&!je(e.parentItem)&&(r=e.parentItem),o.level=e.parentItem?r.level+t:e.level+1,o.hasChildRecords&&(t--,t=this.updateChildRecordLevel(o,t))}return t},aee.prototype.removeRecords=function(e){var t=this.parent,i=this.parent.dataSource instanceof me&&$Z(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource,n=e,e=!je(t.parentIdMapping),o=this.getChildrecordsByParentID(n.parentUniqueID)[0];if(n){if(n.parentItem&&(d=0,h=o?o.childRecords:[])&&0<h.length&&(d=h.indexOf(n),o.childRecords.splice(d,1),this.parent.parentIdMapping&&!t.enableImmutableMode||U$({value:n,action:"delete"},this.parent,e,n.index,n.index)),t.parentIdMapping){n.hasChildRecords&&0<n.childRecords.length&&this.removeChildItem(n);for(var r=void 0,s=void 0,a=i,l=0;l<a.length;l++)a[parseInt(l.toString(),10)][this.parent.idMapping]===n.taskData[this.parent.idMapping]&&(r=l);for(l=0;l<this.treeGridData.length;l++)this.treeGridData[parseInt(l.toString(),10)][this.parent.idMapping]===n.taskData[this.parent.idMapping]&&(s=l);-1===r||je(r)||i.splice(r,1),-1===s||je(s)||this.treeGridData.splice(s,1)}var h,d,p=this.treeGridData.indexOf(n);if(t.parentIdMapping||-1!==(h=this.parent.parentData.indexOf(n))&&(t.parentData.splice(h,1),i.splice(h,1)),-1===p&&!t.parentIdMapping)for(var c=t.getPrimaryKeyFieldNames()[0],u=0;u<this.treeGridData.length;u++)this.treeGridData[parseInt(u.toString(),10)][""+c]===n[""+c]&&(p=u);t.parentIdMapping||(d=this.getChildCount(n,0),this.treeGridData.splice(p,d+1)),n.parentItem&&o&&o.childRecords&&!o.childRecords.length&&(o.expanded=!1,o.hasChildRecords=!1,o.hasFilteredChildRecords=!1),-1!==this.parent[this.modifiedRecords].indexOf(o)||je(o)||this.parent[this.modifiedRecords].push(o),je(o)||this.updateModifiedRecords(o)}},aee.prototype.updateModifiedRecords=function(e){e=i$(this.parent,e.parentUniqueID);je(e)||(this.parent[this.modifiedRecords].push(e),this.updateModifiedRecords(e))},aee.prototype.removeChildItem=function(e){for(var t,i,n,o=this.parent.dataSource instanceof me&&$Z(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource,r=0;r<e.childRecords.length;r++){!je((t=e.childRecords[parseInt(r.toString(),10)]).childRecords)&&t.childRecords.length&&(t.hasChildRecords=!0);for(var s=void 0,s=this.parent.dataSource instanceof me&&$Z(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource,a=0;a<s.length;a++)s[parseInt(a.toString(),10)][this.parent.idMapping]===t.taskData[this.parent.idMapping]&&(i=a);for(var l=0;l<this.treeGridData.length;l++)if(this.treeGridData[parseInt(l.toString(),10)][this.parent.idMapping]===t.taskData[this.parent.idMapping]){n=l;break}-1===i||je(i)||o.splice(i,1),-1===n||je(n)||this.treeGridData.splice(n,1),t.hasChildRecords&&this.removeChildItem(t)}},aee.prototype.getChildCount=function(e,t){var i;if(!e.hasChildRecords)return 0;for(var n=0;n<e.childRecords.length;n++)t++,(i=e.childRecords[parseInt(n.toString(),10)]).hasChildRecords&&(t=this.getChildCount(i,t));return t},aee.prototype.ensuredropPosition=function(e,t){var i=this;e.filter(function(e){e.hasChildRecords&&!je(e.childRecords)&&(-1===e.childRecords.indexOf(t)?i.ensuredropPosition(e.childRecords,t):(i.dropPosition="Invalid",i.addErrorElem(),i.canDrop=!1,je(i.parent.rowDropSettings.targetID)&&(i.removetopOrBottomBorder(),i.removeChildBorder())))})},aee.prototype.isDuplicateData=function(i){var e=this.parent.getPrimaryKeyFieldNames();return 0!==e.length&&this.parent.flatData.some(function(t){return e.every(function(e){return t[e]===i[e]})})},aee.prototype.destroy=function(){this.removeEventListener()},aee.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(LZ,this.Rowdraging),this.parent.off(RZ,this.rowDropped),this.parent.off(BZ,this.rowsAdded),this.parent.off(FZ,this.rowsRemoved))},aee.prototype.getModuleName=function(){return"rowDragAndDrop"};var see=aee;function aee(e){this.canDrop=!0,this.isDraggedWithChild=!1,this.modifiedRecords="modifiedRecords",this.selectedRecords="selectedRecords",this.selectedRows="selectedRows",this.hasDropItem=!0,this.isaddtoBottom=!1,IP.Inject(qG),this.parent=e,this.addEventListener()}lee=function(e,t){return(lee=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])}))(e,t)};var lee,hee,fJ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},$$=(function(e,t){function i(){this.constructor=e}lee(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(dee,hee=n),fJ([e()],dee.prototype,"targetID",void 0),dee);function dee(){return null!==hee&&hee.apply(this,arguments)||this}pee=function(e,t){return(pee=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}pee(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(gee,cee=uY),gee.prototype.addEventListener=function(){this.parent.on(AZ,this.getDatas,this)},gee.prototype.getDatas=function(e){this.visualData=e.data},gee.prototype.getDataInfo=function(){return cee.prototype.getData.call(this)},gee.prototype.generateRows=function(e,t){!je(t.virtualInfo)&&t.virtualInfo.loadNext&&t.virtualInfo.nextInfo.page!==this.parent.pageSettings.currentPage?this.parent.setProperties({pageSettings:{currentPage:t.virtualInfo.nextInfo.page}},!0):je(t.virtualInfo)||t.virtualInfo.loadNext||t.virtualInfo.page===this.parent.pageSettings.currentPage||this.parent.setProperties({pageSettings:{currentPage:t.virtualInfo.page}},!0);var i=this.getDataInfo();if(je(t.virtualInfo)||("right"!==t.virtualInfo.direction&&"left"!==t.virtualInfo.direction?(this.parent.dataSource instanceof me&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||GZ(this.parent))&&1!==t.virtualInfo.blockIndexes.length||(t.virtualInfo.blockIndexes=i.blockIndexes):t.virtualInfo.blockIndexes=this.getBlockIndexes(t.virtualInfo.page)),this.parent.dataSource instanceof me&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||GZ(this.parent))return cee.prototype.generateRows.call(this,e,t);je(t.requestType)||"collapseAll"!==t.requestType.toString()||(t.requestType="refresh");var n=cee.prototype.generateRows.call(this,e,t);if(!je(this.visualData))for(var o=0;o<n.length;o++)n[parseInt(o.toString(),10)].index=this.visualData.indexOf(n[parseInt(o.toString(),10)].data);return n},gee.prototype.checkAndResetCache=function(t){var e,i=["paging","refresh","sorting","filtering","searching","reorder","save","delete"].some(function(e){return t===e});return this.parent.dataSource instanceof me&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||GZ(this.parent)?(e=this.model.currentPage,i?(this.cache={},this.data={},this.groups={}):"virtualscroll"===t&&this.cache[parseInt(e.toString(),10)]&&this.cache[parseInt(e.toString(),10)].length>this.parent.contentModule.getBlockSize()&&delete this.cache[parseInt(e.toString(),10)]):!i&&"virtualscroll"!==t||(this.cache={},this.data={},this.groups={}),i};var pee,cee,uee=gee;function gee(e){e=cee.call(this,e)||this;return e.addEventListener(),e}fee.prototype.getModuleName=function(){return"filter"},fee.prototype.destroy=function(){this.removeEventListener()},fee.prototype.addEventListener=function(){this.parent.on("updateFilterRecs",this.updatedFilteredRecord,this),this.parent.on("clearFilters",this.clearFilterLevel,this)},fee.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateFilterRecs",this.updatedFilteredRecord),this.parent.off("clearFilters",this.clearFilterLevel))},fee.prototype.updatedFilteredRecord=function(e){x("uniqueIDFilterCollection",{},this.parent),this.flatFilteredData=e.data,this.filteredParentRecs=[],this.filteredResult=[],this.isHierarchyFilter=!1;for(var t=0;t<this.flatFilteredData.length;t++){var i=this.flatFilteredData[parseInt(t.toString(),10)],n=(this.addParentRecord(i),(""===this.parent.grid.searchSettings.key?this.parent.filterSettings:this.parent.searchSettings).hierarchyMode),n=("Child"!==n&&"None"!==n||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||(this.isHierarchyFilter=!0),FB("childRecords",i)),n=(!je(n)&&n.length&&x("hasFilteredChildRecords",this.checkChildExsist(i),i),FB("parentItem",i));je(n)||(x("hasFilteredChildRecords",!0,n=i$(this.parent,i.parentItem.uniqueID,!0)),n&&n.parentItem&&this.updateParentFilteredRecord(n))}0<this.flatFilteredData.length&&this.isHierarchyFilter&&this.updateFilterLevel(),this.parent.notify("updateAction",{result:this.filteredResult})},fee.prototype.updateParentFilteredRecord=function(e){var e=i$(this.parent,e.parentItem.uniqueID,!0),t=R("uniqueIDFilterCollection",this.parent);e&&Object.prototype.hasOwnProperty.call(t,e.uniqueID)&&x("hasFilteredChildRecords",!0,e),e&&e.parentItem&&this.updateParentFilteredRecord(e)},fee.prototype.addParentRecord=function(e){var t=i$(this.parent,e.parentUniqueID);"None"!==(""===this.parent.grid.searchSettings.key?this.parent.filterSettings:this.parent.searchSettings).hierarchyMode||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key?(je(t)||("Child"!==(""===this.parent.grid.searchSettings.key?this.parent.filterSettings:this.parent.searchSettings).hierarchyMode||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||-1!==this.flatFilteredData.indexOf(t))&&this.addParentRecord(t),-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),x("uniqueIDFilterCollection."+e.uniqueID,e,this.parent))):je(t)?-1!==this.flatFilteredData.indexOf(e)&&-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),x("uniqueIDFilterCollection."+e.uniqueID,e,this.parent),e.hasFilteredChildRecords=!0):(this.addParentRecord(t),-1!==this.flatFilteredData.indexOf(t)||-1!==this.filteredResult.indexOf(t)?-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),x("uniqueIDFilterCollection."+e.uniqueID,e,this.parent)):-1===this.filteredResult.indexOf(e)&&-1!==this.flatFilteredData.indexOf(e)&&(this.filteredResult.push(e),x("uniqueIDFilterCollection."+e.uniqueID,e,this.parent)))},fee.prototype.checkChildExsist=function(e){for(var t=FB("childRecords",e),i=!1,n=0;n<t.length;n++){var o,r=t[parseInt(n.toString(),10)].childRecords,s=(""===this.parent.grid.searchSettings.key?this.parent.filterSettings:this.parent.searchSettings).hierarchyMode;if("Child"!==s&&"Both"!==s||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||(o=R("uniqueIDFilterCollection",this.parent),Object.prototype.hasOwnProperty.call(o,t[parseInt(n.toString(),10)].uniqueID))||(this.filteredResult.push(t[parseInt(n.toString(),10)]),x("uniqueIDFilterCollection."+t[parseInt(n.toString(),10)].uniqueID,t[parseInt(n.toString(),10)],this.parent),i=!0),"None"===s&&(0!==this.parent.grid.filterSettings.columns.length||""!==this.parent.grid.searchSettings.key)&&-1!==this.flatFilteredData.indexOf(t[parseInt(n.toString(),10)])){i=!0;break}!je(r)&&r.length&&(i=this.checkChildExsist(t[parseInt(n.toString(),10)])),"Child"!==s&&"Both"!==s||!t.length||(i=!0)}return i},fee.prototype.updateFilterLevel=function(){for(var e=this.filteredResult,t=this.filteredResult.length,i=0;i<t;i++){var n=i$(this.parent,e[parseInt(i.toString(),10)].parentUniqueID);-1!==e.indexOf(n)?(n=i$(this.parent,e[parseInt(i.toString(),10)].parentUniqueID,!0),e[parseInt(i.toString(),10)].filterLevel=n.filterLevel+1):(e[parseInt(i.toString(),10)].filterLevel=0,this.filteredParentRecs.push(e[parseInt(i.toString(),10)]))}},fee.prototype.clearFilterLevel=function(e){for(var t=0,i=e.flatData,n=i.length;t<n;t++){var o,r=(o=i[parseInt(t.toString(),10)]).filterLevel;!r&&0!==r&&je(o.hasFilteredChildRecords)||(o.hasFilteredChildRecords=null,o.filterLevel=null)}this.filteredResult=[],this.parent.notify("updateResults",{result:i,count:i.length})};var mee=fee;function fee(e){IP.Inject(_G),this.parent=e,this.isHierarchyFilter=!1,this.filteredResult=[],this.flatFilteredData=[],this.filteredParentRecs=[],this.addEventListener()}vee.prototype.getModuleName=function(){return"ExcelExport"},vee.prototype.addEventListener=function(){this.parent.on("updateResults",this.updateExcelResultModel,this),this.parent.on("excelCellInfo",this.excelQueryCellInfo,this),this.parent.grid.on("export-RowDataBound",this.exportRowDataBound,this),this.parent.grid.on("finalPageSetup",this.finalPageSetup,this)},vee.prototype.destroy=function(){this.removeEventListener()},vee.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateResults",this.updateExcelResultModel),this.parent.off("excelCellInfo",this.excelQueryCellInfo),this.parent.grid.off("export-RowDataBound",this.exportRowDataBound),this.parent.grid.off("finalPageSetup",this.finalPageSetup))},vee.prototype.updateExcelResultModel=function(e){this.dataResults=e},vee.prototype.Map=function(n,o,r,s,a){var l=this,h=this.parent.dataSource,d=new TE(this.parent.grid),p=Object();if(x("isCsv",a,p),x("cancel",!1,p),je(n)||(this.isCollapsedStatePersist=n.isCollapsedStatePersist),!je(n)){if(!je(n.dataSource)&&!n.dataSource.dataSource)return this.parent.grid.excelExportModule.Map(this.parent.grid,n,o,r,a,s);if("CurrentPage"===n.exportType)return n.dataSource=this.parent.getCurrentViewRecords(),this.parent.grid.excelExportModule.Map(this.parent.grid,n,o,r,a,s)}return new Promise(function(i){var e=!l.isLocal()||h instanceof me?l.parent.dataSource:new me(h),t=new ya;if(l.isLocal()||((t=l.generateQuery(t)).queries=l.parent.grid.getDataModule().generateQuery().queries,t=aK.getQuery(l.parent.grid,d),je(l.parent.filterModule)&&(t.queries=t.queries.slice(1,2),t.params=t.params.slice(0,0)),x("query",t,p)),l.parent.trigger(QJ,Pe(p,n)),FB("cancel",p))return null;e.executeQuery(t).then(function(e){var t=null;return je(n)||je(n.dataSource)||(t=n.dataSource),n=l.manipulateExportProperties(n,h,e),l.parent.grid.excelExportModule.Map(l.parent.grid,n,o,r,a,s).then(function(e){null!=t?n.dataSource=t:delete n.dataSource,i(e)})})})},vee.prototype.generateQuery=function(e,t){return!je(t)&&"CurrentPage"===t.exportType&&this.parent.allowPaging&&(t.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=FB("grid.renderModule.data.pageQuery",this.parent)(e)),e},vee.prototype.manipulateExportProperties=function(e,t,i){var n,o=Object();return je(this.parent.grid.getDataModule())||x("query",this.parent.grid.getDataModule().generateQuery(!0),o),x("isExport",!0,o),je(e)||je(e.exportType)||x("exportType",e.exportType,o),this.isLocal()||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData(FB("result",i)),x("expresults",this.parent.flatData,o)),this.parent.notify("dataProcessor",o),t=je((o=this.dataResults).result)?this.parent.flatData.slice(0):o.result,this.isLocal()||(this.parent.flatData=[]),e&&e.dataSource&&(i=this.parent.flatData,n=e.dataSource instanceof me?e.dataSource.dataSource.json:e.dataSource,this.parent.dataModule.convertToFlatData(n),t=this.parent.flatData,this.parent.flatData=i),(e=je(e)?Object():e).dataSource=new me({json:t}),0<this.parent.aggregates.length&&(e.query=o.query),e},vee.prototype.excelQueryCellInfo=function(e){var t,i;this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex&&(i=je((i=e.data).filterLevel)?i.level:i.filterLevel,(t={}).indent=i,e.style=t),this.parent.notify("updateResults",e),this.parent.trigger("excelQueryCellInfo",e)},vee.prototype.exportRowDataBound=function(e){var t,i,n,o,r,s;"excel"===e.type&&(t=e.rowObj.data,o=this.parent.grid.filterSettings.columns.length,i=e.excelRows.length,n=t.level,t.parentItem&&i$(this.parent,t.parentItem.uniqueID,Boolean(o))?(r=o=!1,s=JZ(this.parent,t,this.parent.parentData),!this.isCollapsedStatePersist||s&&this.parent.isLocalData||(o=!0,r=!t.expanded),e.excelRows[i-1].grouping={outlineLevel:n,isCollapsed:r,isHidden:o}):t.hasChildRecords&&je(t.parentItem)&&(e.excelRows[i-1].grouping={outlineLevel:n}))},vee.prototype.finalPageSetup=function(e){for(var t=0;t<e.worksheets.length;t++)e.worksheets[parseInt(t.toString(),10)].rows&&(e.worksheets[parseInt(t.toString(),10)].pageSetup={isSummaryRowBelow:!1})},vee.prototype.isLocal=function(){return!qZ(this.parent)&&$Z(this.parent)};var yee=vee;function vee(e){this.isCollapsedStatePersist=!1,IP.Inject(pK),this.parent=e,this.dataResults={},this.addEventListener()}bee.prototype.getModuleName=function(){return"PdfExport"},bee.prototype.addEventListener=function(){this.parent.on("pdfCellInfo",this.pdfQueryCellInfo,this),this.parent.on("updateResults",this.updatePdfResultModel,this)},bee.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("pdfCellInfo",this.pdfQueryCellInfo),this.parent.off("updateResults",this.updatePdfResultModel))},bee.prototype.destroy=function(){this.removeEventListener()},bee.prototype.updatePdfResultModel=function(e){this.dataResults=e},bee.prototype.Map=function(n,o,r,s){var a=this,l=this.parent.dataSource,h=Object(),d=!qZ(this.parent)&&$Z(this.parent);return x("cancel",!1,h),new Promise(function(i){var e=!d||l instanceof me?a.parent.dataSource:new me(l),t=new ya;if(d||x("query",t=a.generateQuery(t),h),a.parent.trigger(UJ,Pe(h,n)),FB("cancel",h))return null;e.executeQuery(t).then(function(e){var t=null;return je(n)||je(n.dataSource)||(t=n.dataSource),n=a.manipulatePdfProperties(n,l,e),a.parent.grid.pdfExportModule.Map(a.parent.grid,n,o,r,s).then(function(e){null!=t?n.dataSource=t:delete n.dataSource,i(e)})})})},bee.prototype.generateQuery=function(e,t){return!je(t)&&"CurrentPage"===t.exportType&&this.parent.allowPaging&&(t.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=FB("grid.renderModule.data.pageQuery",this.parent)(e)),e},bee.prototype.manipulatePdfProperties=function(e,t,i){var n={},o=!qZ(this.parent)&&$Z(this.parent);return x("query",this.parent.grid.getDataModule().generateQuery(!0),n),x("isExport",!0,n),x("isPdfExport",!0,n),je(e)||je(e.isCollapsedStatePersist)||x("isCollapsedStatePersist",e.isCollapsedStatePersist,n),je(e)||je(e.exportType)||x("exportType",e.exportType,n),o||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData(R("result",i)),x("expresults",this.parent.flatData,n)),this.parent.notify("dataProcessor",n),t=je((n=this.dataResults).result)?this.parent.flatData.slice(0):n.result,o||(this.parent.flatData=[]),e&&e.dataSource&&o&&(i=this.parent.flatData,o=e.dataSource instanceof me?e.dataSource.dataSource.json:e.dataSource,this.parent.dataModule.convertToFlatData(o),t=this.parent.flatData,this.parent.flatData=i),(e=je(e)?{}:e).dataSource=new me({json:t}),e.query=n.query,e},bee.prototype.pdfQueryCellInfo=function(e){var t,i;this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex&&(t={},i=je((i=FB("data",e)).filterLevel)?i.level:i.filterLevel,t.paragraphIndent=3*i,e.style=t),this.parent.notify("updateResults",e),this.parent.trigger("pdfQueryCellInfo",e)};fJ=bee;function bee(e){IP.Inject(uK),this.parent=e,this.dataResults={},this.addEventListener()}Cee.prototype.addEventListener=function(){this.parent.on(ZJ,this.collapseExpandPagedchilds,this),this.parent.on($J,this.pageAction,this)},Cee.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ZJ,this.collapseExpandPagedchilds),this.parent.off($J,this.pageAction))},Cee.prototype.getModuleName=function(){return"pager"},Cee.prototype.refresh=function(){this.parent.grid.pagerModule.refresh()},Cee.prototype.destroy=function(){this.removeEventListener()},Cee.prototype.goToPage=function(e){this.parent.grid.pagerModule.goToPage(e)},Cee.prototype.updateExternalMessage=function(e){je(e)&&this.parent.trigger(zZ,{error:"The provided value for the message is undefined. Please ensure the message contains string."}),this.parent.grid.pagerModule.updateExternalMessage(e)},Cee.prototype.collapseExpandPagedchilds=function(t){t.record.expanded="collapse"!==t.action,this.parent.flatData.map(function(e){return e.expanded=(e.uniqueID===t.record.uniqueID&&e.expanded!==t.record.expanded?t.record:e).expanded}),this.parent.enableImmutableMode&&(i=this.parent.getPrimaryKeyFieldNames()[0],(n=this.parent.flatData.filter(function(e){return e[""+i]===t.record[""+i]})).length)&&(n[0].expanded=t.record.expanded);var i,e,n={result:this.parent.flatData,row:t.row,action:t.action,record:t.record,count:this.parent.flatData.length};R("grid.renderModule",this.parent).dataManagerSuccess(n),this.parent.enableImmutableMode&&(e=void 0,"collapse"===n.action?je(e=n.row.getElementsByClassName("e-treegridexpand")[0])||(q([e],"e-treegridexpand"),U([e],"e-treegridcollapse")):"expand"!==n.action||je(e=n.row.getElementsByClassName("e-treegridcollapse")[0])||(q([e],"e-treegridcollapse"),U([e],"e-treegridexpand")))},Cee.prototype.pageRoot=function(i,n,e){for(var o=je(e)?[]:e,r=this,t=0;t<n.length;t++)!function(t){o.push(n[parseInt(t.toString(),10)]);var e;n[parseInt(t.toString(),10)].hasChildRecords&&(e=i.filter(function(e){return n[parseInt(t.toString(),10)].uniqueID===e.parentUniqueID}),o=r.pageRoot(i,e,o))}(t);return o},Cee.prototype.updatePageSize=function(e){var e=e.count,t=this.parent.grid.pagerModule;!0===this.parent.pageSettings.pageSizes&&t.pagerObj.pagerdropdownModule.dropDownListObject.value===t.pagerObj.getLocalizedLabel("All")&&(t.pagerObj.totalRecordsCount=e,this.parent.grid.pageSettings.pageSize=e)},Cee.prototype.pageAction=function(e){var t,i,n,o,r,s,a=this,l=new me(e.result);"Root"===this.parent.pageSettings.pageSizeMode?(t=[],n=0<this.parent.grid.filterSettings.columns.length&&("Child"===this.parent.filterSettings.hierarchyMode||"None"===this.parent.filterSettings.hierarchyMode)?"filterLevel":"level",n=(new ya).where(n,"equal",0),t=l.executeLocal(n),e.count=t.length,s=(o=this.parent.grid.pageSettings.pageSize)*((r=this.parent.grid.pageSettings.currentPage)-1),n=n.skip(s).take(o),t=l.executeLocal(n),l=this.pageRoot(e.result,t),e.result=l):(t=new me(e.result),l=new ba("expanded","notequal",null).or("expanded","notequal",void 0),l=t.executeLocal((new ya).where(l)),i=void 0,i=XZ(this.parent)&&"collapse"!==e.actionArgs.action&&"expand"!==e.actionArgs.action?l:l.filter(function(e){return JZ(a.parent,e)}),e.count=i.length,n=new ya,o=this.parent.grid.pageSettings.pageSize,this.updatePageSize(e),r=this.parent.grid.pageSettings.currentPage,i.length<r*o&&(r=Math.floor(i.length/o)+(i.length%o?1:0),this.parent.grid.setProperties({pageSettings:{currentPage:r=r||1}},!0)),n=n.skip(s=o*(r-1)).take(o),t.dataSource.json=i,e.result=t.executeLocal(n)),this.parent.notify("updateAction",e)};var wee=Cee;function Cee(e){IP.Inject(gG),this.parent=e,this.addEventListener()}Aee.prototype.getModuleName=function(){return"toolbar"},Aee.prototype.addEventListener=function(){this.parent.on(HJ,this.refreshToolbar,this),this.parent.on(jJ,this.refreshToolbar,this),this.parent.on(WJ,this.toolbarClickHandler,this)},Aee.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(HJ,this.refreshToolbar),this.parent.off(jJ,this.refreshToolbar),this.parent.off(WJ,this.toolbarClickHandler))},Aee.prototype.refreshToolbar=function(e){var t,i,n,o,r,s,a,l,h,d=this.parent.grid.toolbarModule.getToolbar();je(d)||(h=l=void 0,i=(t=this.parent).element.id+"_gridcontrol_indent",n=t.element.id+"_gridcontrol_outdent",a=d.querySelector("#"+i),o=d.querySelector("#"+n),r=e.row,s=t.getSelectedRows()[0],je(r[0])||(r=r[0]),r=je(s)||s.rowIndex===r.rowIndex?r:s,null!==a&&null!==o&&(l=d.querySelector("#"+i).parentElement,h=d.querySelector("#"+n).parentElement,0===r.rowIndex||1<t.getSelectedRowIndexes().length?(l.classList.add("e-hidden"),h.classList.add("e-hidden")):"rowDeselected"===e.name&&(je(s)||!t.grid.isCheckBoxSelection)||je(a=t.getCurrentViewRecords()[r.rowIndex])||(a.level>t.getCurrentViewRecords()[r.rowIndex-1].level?l.classList.add("e-hidden"):l.classList.remove("e-hidden"),a.level===t.getCurrentViewRecords()[r.rowIndex-1].level&&l.classList.remove("e-hidden"),0===a.level&&h.classList.add("e-hidden"),0!==a.level&&h.classList.remove("e-hidden")),"rowDeselected"===e.name)&&je(s)&&!t.grid.isCheckBoxSelection&&(this.parent.toolbar.includes("Indent")&&l.classList.add("e-hidden"),this.parent.toolbar.includes("Outdent"))&&h.classList.add("e-hidden"))},Aee.prototype.toolbarClickHandler=function(e){var t=this.parent,i="indentOutdentAction";"Cell"===this.parent.editSettings.mode&&"Batch"===this.parent.grid.editSettings.mode&&e.item.id===this.parent.grid.element.id+"_update"&&(e.cancel=!0,this.parent.grid.editModule.saveCell()),e.item.id===this.parent.grid.element.id+"_expandall"&&this.parent.expandAll(),e.item.id===this.parent.grid.element.id+"_collapseall"&&this.parent.collapseAll(),e.item.id===t.grid.element.id+"_indent"&&t.getSelectedRecords().length&&!je(t.rowDragAndDropModule)&&this.parent.rowDragAndDropModule[i](null,"indent"),e.item.id===t.grid.element.id+"_outdent"&&t.getSelectedRecords().length&&!je(t.rowDragAndDropModule)&&this.parent.rowDragAndDropModule[i](null,"outdent")},Aee.prototype.getToolbar=function(){return this.parent.grid.toolbarModule.getToolbar()},Aee.prototype.enableItems=function(e,t){this.parent.grid.toolbarModule.enableItems(e,t)},Aee.prototype.destroy=function(){this.removeEventListener()};var See=Aee;function Aee(e){IP.Inject(ZG),this.parent=e,this.addEventListener()}Iee.prototype.getModuleName=function(){return"summary"},Iee.prototype.removeEventListener=function(){this.parent.isDestroyed},Iee.prototype.calculateSummaryValue=function(e,t,s){var a;this.summaryQuery=e;for(var i=[],n=0,o=Object.keys(t).length;n<o;n++)FB("isSummaryRow",t[parseInt(n.toString(),10)])||i.push(t[parseInt(n.toString(),10)]);var l,r=KZ(i),h=i.slice(),d=Object.keys(this.parent.aggregates).length,e=Object.keys(r).length,p=this.parent.getColumns();if(this.parent.aggregates.filter(function(e){return e.showChildSummary}).length){for(var c=0,o=e;c<o;c++)if(a=r[parseInt(c.toString(),10)],l=this.getChildRecordsLength(a,h)){for(var u=this,g=1,m=d;g<=m;g++)!function(e){for(var t=void 0,t={},i=0;i<p.length;i++)t[""+(je(FB("field",p[parseInt(i.toString(),10)]))?p[parseInt(i.toString(),10)]:FB("field",p[parseInt(i.toString(),10)]))]=null;if(t=u.createSummaryItem(t,u.parent.aggregates[e-1]),!u.parent.aggregates[e-1].showChildSummary)return;h.map(function(e,t){e.uniqueID===a.uniqueID&&(n=t)});var n,e=n+l+e,o=Pe({},a),r=(delete o.childRecords,delete o[u.parent.childMapping],x("parentItem",o,t),FB("level",o));x("level",r+1,t),x("isSummaryRow",!0,t),x("parentUniqueID",o.uniqueID,t),s&&(r=FB("childRecords",a)).length&&r.push(t),h.splice(e,0,t)}(g);this.flatChildRecords=[]}}else{for(var f={},y=0,v=p.length;y<v;y++)f[""+(je(FB("field",p[parseInt(y.toString(),10)]))?p[parseInt(y.toString(),10)]:FB("field",p[parseInt(y.toString(),10)]))]=null;for(var g=1,b=d;g<=b;g++)this.createSummaryItem(f,this.parent.aggregates[g-1])}return h},Iee.prototype.getChildRecordsLength=function(e,t){for(var i,n=0,o=Object.keys(t).length;n<o;n++)e===(je((i=t[parseInt(n.toString(),10)]).parentItem)?null:t.filter(function(e){return e.uniqueID===i.parentItem.uniqueID})[0])&&(this.flatChildRecords.push(i),FB("hasChildRecords",i))&&this.getChildRecordsLength(i,t);return this.flatChildRecords.length},Iee.prototype.createSummaryItem=function(e,t){for(var i=0,n=Object.keys(t.columns).length;i<n;i++)for(var o=je(t.columns[parseInt(i.toString(),10)].columnName)?t.columns[parseInt(i.toString(),10)].field:t.columns[parseInt(i.toString(),10)].columnName,r=0,s=Object.keys(e);r<s.length;r++){var a,l=s[r];l===o&&(this.flatChildRecords.length?e[""+l]=this.getSummaryValues(t.columns[parseInt(i.toString(),10)],this.flatChildRecords):this.parent.isLocalData&&(a=this.parent.dataSource instanceof me?this.parent.dataSource.dataSource.json:this.parent.flatData,e[""+l]=this.getSummaryValues(t.columns[parseInt(i.toString(),10)],a)))}return e},Iee.prototype.getSummaryValues=function(e,t){for(var i=new ya,n={},o={},r=je(e.field)?void 0:this.parent.getColumnByField(e.field).type,s=(e.setPropertiesSilent({format:this.getFormatFromType(e.format,r)}),e.setFormatter(this.parent.grid.locale),e.getFormatter()||function(e){return e}),r=(e.setTemplate(o),e.getTemplate(2)),a=(i.queries=this.summaryQuery,i.requiresCount(),new me(t).executeLocal(i)),l=e.type,l=[e.type],h=0;h<l.length;h++){var d=l[parseInt(h.toString(),10)],p=e.field+" - "+l[parseInt(h.toString(),10)].toLowerCase(),c="Custom"!==l[parseInt(h.toString(),10)]?FB("aggregates",a):iB(l[parseInt(h.toString(),10)],a,e,this.parent),u=e.columnName,g="Custom"!==l[parseInt(h.toString(),10)]?c[p]:c;n[""+u]=n[""+u]||{},n[""+u][p]=g,n[""+u][l[parseInt(h.toString(),10)]]=je(c)?" ":s(g)}o.format=e.getFormatter();t=Q("td",{className:"e-summary"}),this.parent.isReact&&"string"!=typeof e.footerTemplate?(r.fn(n[e.columnName],this.parent,r.property,"",null,null,t),this.parent.renderReactTemplates()):eB(t,r.fn(n[e.columnName],this.parent,r.property)),i=n[""+e.columnName][""+d];return-1===t.innerHTML.indexOf(i)?t.innerHTML+i:t.innerHTML},Iee.prototype.getFormatFromType=function(e,t){if(je(t)||"string"!=typeof e)return e;var i;switch(t){case"number":i={format:e};break;case"datetime":i={type:"dateTime",skeleton:e};break;case"date":i={type:t,skeleton:e}}return i},Iee.prototype.destroy=function(){this.removeEventListener()};var xee=Iee;function Iee(e){IP.Inject(lY),this.parent=e,this.flatChildRecords=[],this.summaryQuery=[]}Eee.prototype.getModuleName=function(){return"sort"},Eee.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this),this.parent.on("createSort",this.createdSortedRecords,this)},Eee.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateModel",this.updateModel),this.parent.off("createSort",this.createdSortedRecords))},Eee.prototype.createdSortedRecords=function(e){var t=e.modifiedData,i=e.srtQry;this.iterateSort(t,i),this.storedIndex=-1,e.modifiedData=this.flatSortedData,this.flatSortedData=[]},Eee.prototype.iterateSort=function(e,t){for(var i,n,o=0;o<e.length;o++)(0<this.parent.grid.filterSettings.columns.length||""!==this.parent.grid.searchSettings.key)&&je(i$(this.parent,e[parseInt(o.toString(),10)].uniqueID,!0))||(this.storedIndex++,this.flatSortedData[this.storedIndex]=e[parseInt(o.toString(),10)]),e[parseInt(o.toString(),10)].hasChildRecords&&(i=new me(e[parseInt(o.toString(),10)].childRecords).executeLocal(t),this.parent.allowRowDragAndDrop&&-1!==e[parseInt(o.toString(),10)].childRecords.indexOf(this.parent.rowDragAndDropModule.draggedRecord)&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition&&(n=i.indexOf(this.parent.rowDragAndDropModule.draggedRecord),i.splice(n,1),n=i.indexOf(this.parent.rowDragAndDropModule.droppedRecord),"topSegment"===this.parent.rowDragAndDropModule.dropPosition?i.splice(n,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&i.splice(n+1,0,this.parent.rowDragAndDropModule.draggedRecord)),this.iterateSort(i,t))},Eee.prototype.sortColumn=function(e,t,i){this.parent.grid.sortColumn(e,t,i)},Eee.prototype.removeSortColumn=function(e){this.parent.grid.removeSortColumn(e)},Eee.prototype.updateModel=function(){this.parent.setProperties({sortSettings:qP(this.parent.grid.sortSettings)},!0)},Eee.prototype.clearSorting=function(){this.parent.grid.clearSorting(),this.updateModel()},Eee.prototype.destroy=function(){this.removeEventListener()};var Tee=Eee;function Eee(e){IP.Inject(eG),this.parent=e,this.taskIds=[],this.flatSortedData=[],this.storedIndex=-1,this.isSelfReference=!je(this.parent.parentIdMapping),this.addEventListener()}Mee.prototype.getColumnMenu=function(){return this.parent.grid.columnMenuModule.getColumnMenu()},Mee.prototype.destroy=function(){},Mee.prototype.getModuleName=function(){return"columnMenu"};var Dee=Mee;function Mee(e){IP.Inject(TK),this.parent=e}Pee.prototype.addEventListener=function(){this.parent.on("contextMenuOpen",this.contextMenuOpen,this),this.parent.on("contextMenuClick",this.contextMenuClick,this)},Pee.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("contextMenuOpen",this.contextMenuOpen),this.parent.off("contextMenuClick",this.contextMenuClick))},Pee.prototype.contextMenuOpen=function(e){var t=ge("#"+this.parent.element.id+"_gridcontrol_cmenu_AddRow",e.element),i=ge("#"+this.parent.element.id+"_gridcontrol_cmenu_Edit",e.element),n=ge("#"+this.parent.element.id+"_gridcontrol_cmenu_Indent",e.element),o=ge("#"+this.parent.element.id+"_gridcontrol_cmenu_Outdent",e.element),r=(t&&(!1===this.parent.grid.editSettings.allowAdding||this.parent.grid.isEdit?t.style.display="none":t.style.display="block"),"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||je(i)||i.classList.contains("e-menu-hide")||(i.style.display="none"),this.parent),t=r.getSelectedRows()[0];if(!n&&!o||je(t)){if((n||o||r.grid.isEdit)&&je(t)){for(var s=0,a=e.items;s<a.length;s++)"Outdent"!==(l=a[s]).text&&"Indent"!==l.text||r.grid.contextMenuModule.hiddenItems.includes(l.text)||r.grid.contextMenuModule.hiddenItems.push(l.text);r.grid.contextMenuModule.contextMenu.hideItems(r.grid.contextMenuModule.hiddenItems),n.style.display=o.style.display="none"}}else{var i=e.event.target.closest("td");if(!je(i)&&(je(i)||i.classList.contains("e-rowcell")&&0===i.querySelectorAll(".e-gridform").length))0===t.rowIndex||1<r.getSelectedRowIndexes().length?n.style.display=o.style.display="none":"rowDeselected"===e.name&&(je(t)||!r.grid.isCheckBoxSelection)||je(i=r.getCurrentViewRecords()[t.rowIndex])||(i.level>r.getCurrentViewRecords()[t.rowIndex-1].level?n.style.display="none":n.style.display="block",i.level===r.getCurrentViewRecords()[t.rowIndex-1].level&&(n.style.display="block"),0===i.level?o.style.display="none":o.style.display="block");else{for(var l,h=0,d=e.items;h<d.length;h++)"Outdent"!==(l=d[h]).text&&"Indent"!==l.text||r.grid.contextMenuModule.hiddenItems.push(l.text);r.grid.contextMenuModule.contextMenu.hideItems(r.grid.contextMenuModule.hiddenItems),n.style.display=o.style.display="none"}}},Pee.prototype.contextMenuClick=function(e){"Above"!==e.item.id&&"Below"!==e.item.id&&"Child"!==e.item.id||(this.parent.notify("savePreviousRowPosition",e),this.parent.setProperties({editSettings:{newRowPosition:e.item.id}},!0),this.parent.editModule.isAddedRowByContextMenu=!0,this.parent.addRecord()),e.item.id!==this.parent.element.id+"_gridcontrol_cmenu_Indent"&&e.item.id!==this.parent.element.id+"_gridcontrol_cmenu_Outdent"||je(this.parent.rowDragAndDropModule)||(e=e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Indent"?"indent":"outdent",this.parent.rowDragAndDropModule.indentOutdentAction(null,e))},Pee.prototype.getModuleName=function(){return"contextMenu"},Pee.prototype.destroy=function(){this.removeEventListener()},Pee.prototype.getContextMenu=function(){return this.parent.grid.contextMenuModule.getContextMenu()};var kee=Pee;function Pee(e){IP.Inject(SK),this.parent=e,this.addEventListener()}Fee.prototype.addEventListener=function(){this.parent.on(dZ,this.cellSaved,this),this.parent.on(gZ,this.batchAdd,this),this.parent.on(fZ,this.beforeBatchAdd,this),this.parent.on(vZ,this.batchSave,this),this.parent.on(mZ,this.beforeBatchDelete,this),this.parent.on(yZ,this.beforeBatchSave,this),this.parent.on("batchPageAction",this.batchPageAction,this),this.parent.on("batchCancelAction",this.batchCancelAction,this),this.parent.grid.on("immutable-batch-cancel",this.immutableBatchAction,this),this.parent.grid.on("next-cell-index",this.nextCellIndex,this)},Fee.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(dZ,this.cellSaved),this.parent.off(gZ,this.batchAdd),this.parent.off(vZ,this.batchSave),this.parent.off(fZ,this.beforeBatchAdd),this.parent.off(mZ,this.beforeBatchDelete),this.parent.off(yZ,this.beforeBatchSave),this.parent.off("batchPageAction",this.batchPageAction),this.parent.off("batchCancelAction",this.batchCancelAction),this.parent.grid.off("immutable-batch-cancel",this.immutableBatchAction),this.parent.grid.off("next-cell-index",this.nextCellIndex))},Fee.prototype.destroy=function(){this.removeEventListener()},Fee.prototype.getBatchRecords=function(){return this.batchRecords},Fee.prototype.getAddRowIndex=function(){return this.addRowIndex},Fee.prototype.getSelectedIndex=function(){return this.selectedIndex},Fee.prototype.getBatchChildCount=function(){return this.batchChildCount},Fee.prototype.batchPageAction=function(){var e,t=this.parent.grid.dataSource instanceof me?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,i=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!je(this.batchAddedRecords)&&this.batchAddedRecords.length)for(var n=0;n<this.batchAddedRecords.length;n++)e=t.map(function(e){return e[""+i]}).indexOf(this.batchAddedRecords[parseInt(n.toString(),10)][""+i]),t.splice(e,1);this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.batchDeletedRecords=this.currentViewRecords=[]},Fee.prototype.cellSaved=function(e){var t,i,n,o,r,s,a,l,h,d,p,c;e.column.index===this.parent.treeColumnIndex&&this.parent.renderModule.cellRender({data:e.rowData,cell:e.cell,column:this.parent.grid.getColumnByIndex(e.column.index)}),this.isAdd&&"Batch"===this.parent.editSettings.mode&&"Bottom"!==this.parent.editSettings.newRowPosition&&(e=this.parent.grid.dataSource instanceof me?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,t=void 0,i=this.parent.grid.getPrimaryKeyFieldNames()[0],n=p=void 0,o="parentItem",r=-1<this.selectedIndex?this.batchRecords[parseInt(this.addRowIndex.toString(),10)][o]:null,l=a=s=void 0,c="Top"===this.parent.editSettings.newRowPosition||-1===this.selectedIndex?0:"Above"===this.parent.editSettings.newRowPosition?this.addRowIndex:this.addRowIndex+1,c=this.getActualRowObjectIndex(c),this.newBatchRowAdded)&&(this.batchRecords.length&&(s=this.batchRecords[this.addRowIndex][this.parent.idMapping],l=this.batchRecords[this.addRowIndex][this.parent.parentIdMapping],this.batchRecords[parseInt(this.addRowIndex.toString(),10)][o])&&(a=this.batchRecords[parseInt(this.addRowIndex.toString(),10)][o].uniqueID),this.batchAddedRecords=e$(this.batchAddedRecords),this.batchAddRowRecord=e$(this.batchAddRowRecord),this.batchAddRowRecord.push(this.batchRecords[this.addRowIndex]),je(t=this.parent.grid.getRowsObject()[parseInt(c.toString(),10)].changes)||(t.uniqueID=$P(this.parent.element.id+"_data_"),x("uniqueIDCollection."+t.uniqueID,t,this.parent),Object.prototype.hasOwnProperty.call(t,"level"))||(this.batchIndex=-1===this.selectedIndex?0:this.batchIndex,"Child"===this.parent.editSettings.newRowPosition?(t.primaryParent=r,-1<this.selectedIndex&&(t.parentItem=Pe({},this.batchRecords[this.addRowIndex]),t.parentUniqueID=t.parentItem.uniqueID,delete t.parentItem.childRecords,delete t.parentItem[this.parent.childMapping],t.level=t.parentItem.level+1,t.index=this.batchIndex,h=ZZ(this.batchRecords[this.addRowIndex]).length,d=je(d=ZZ(this.batchRecords[this.addRowIndex])[h-1])?this.batchRecords[this.addRowIndex]:d,p=e.map(function(e){return e[""+i]}).indexOf(d[""+i]),this.isSelfReference&&(t[this.parent.parentIdMapping]=s),q$(i,t.parentItem,"add",this.parent,this.isSelfReference,t))):"Above"!==this.parent.editSettings.newRowPosition&&"Below"!==this.parent.editSettings.newRowPosition||je(this.batchRecords[this.addRowIndex])||(t.level=this.batchRecords[parseInt(this.addRowIndex.toString(),10)].level,t.level&&-1<this.selectedIndex&&(t.parentItem=r,t.parentUniqueID=a,delete t.parentItem.childRecords,delete t.parentItem[this.parent.childMapping]),t.index="Below"===this.parent.editSettings.newRowPosition?this.batchIndex:this.batchIndex-1,"Below"===this.parent.editSettings.newRowPosition&&-1<this.selectedIndex&&(h=ZZ(this.batchRecords[this.addRowIndex]).length,d=je(d=ZZ(this.batchRecords[this.addRowIndex])[h-1])?this.batchRecords[this.addRowIndex]:d,p=e.map(function(e){return e[""+i]}).indexOf(d[""+i])),"Above"===this.parent.editSettings.newRowPosition&&-1<this.selectedIndex&&(d=this.batchRecords[this.addRowIndex],p=e.map(function(e){return e[""+i]}).indexOf(d[""+i])),this.isSelfReference&&(t[this.parent.parentIdMapping]=l)),t.index=-1===t.index?0:t.index,t.hasChildRecords=!1,t.childRecords=[],this.batchRecords.splice(t.index,0,t),this.currentViewRecords.splice(t.index,0,t),n=p||t.index,"Above"!==this.parent.editSettings.newRowPosition&&(n=0===t.index?n:n+1),e.splice(n,0,t),this.batchAddedRecords.push(t)),this.parent.grid.getRowsObject()[parseInt(c.toString(),10)].data=t,this.newBatchRowAdded=!1)},Fee.prototype.beforeBatchAdd=function(e){var t="isTabLastRow";"Cell"===this.parent.editSettings.mode&&this.parent.editModule[t]?(e.cancel=!0,this.parent.editModule[t]=!1):!this.parent.editModule.isAddedRowByMethod||je(this.parent.editModule.addRowIndex)||this.parent.editModule.isAddedRowByContextMenu||-1!==this.parent.grid.selectedRowIndex&&!this.parent.editModule.batchEditModule.isAdd?(this.selectedIndex=this.parent.grid.selectedRowIndex,this.addRowIndex=-1<this.parent.grid.selectedRowIndex?this.parent.grid.selectedRowIndex:0,this.parent.editModule.addRowIndex=-1<this.parent.grid.selectedRowIndex?this.parent.grid.selectedRowIndex:0,this.addRowRecord=this.parent.getSelectedRecords()[0]):(this.selectedIndex=this.parent.editModule.selectedIndex,this.addRowIndex=this.parent.editModule.addRowIndex,this.addRowRecord=(this.batchRecords.length?this.batchRecords:this.parent.getCurrentViewRecords())[this.selectedIndex])},Fee.prototype.batchAdd=function(e){var t,i,n;"Bottom"!==this.parent.editSettings.newRowPosition&&(this.isAdd=!0,this.newBatchRowAdded=!0,t=0,this.batchRecords.length||(this.batchAddedRecords=[],this.batchRecords=e$(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=e$(this.parent.grid.getCurrentViewRecords())),this.parent.editModule.isAddedRowByMethod&&!je(this.parent.editModule.addRowIndex)&&mt(this.parent.grid.getDataRows()[0],["e-batchrow"],[]),"Top"!==this.parent.editSettings.newRowPosition&&(i=this.parent.grid.getCurrentViewRecords(),"Batch"===this.parent.editSettings.mode&&(1<this.parent.getBatchChanges()[this.addedRecords].length||this.parent.getBatchChanges()[this.deletedRecords].length)&&(i=this.batchRecords),this.updateChildCount(i),this.parent.notify(aZ,{}),this.batchChildCount=0),this.updateRowIndex(),i=R("focusModule",this.parent.grid),n=this.parent.getContentTable(),this.parent.getBatchChanges()[this.deletedRecords].length&&"Above"===this.parent.editSettings.newRowPosition?(t=e.row.rowIndex,i.getContent().matrix.matrix=this.matrix):t=n.getElementsByClassName("e-batchrow")[0].rowIndex,i.getContent().matrix.current=[t,i.getContent().matrix.current[1]],!this.parent.editModule.isAddedRowByMethod||je(this.parent.editModule.addRowIndex)||this.parent.editModule.isAddedRowByContextMenu||(e=this.parent.getBatchChanges().addedRecords,n=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[e.length-1].getAttribute("aria-rowindex"),10)-1,this.batchRecords.splice(n,0,e[e.length-1])))},Fee.prototype.beforeBatchDelete=function(e){this.batchRecords.length||(this.batchRecords=e$(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=e$(this.parent.grid.getCurrentViewRecords()));var t,i,n=R("focusModule",this.parent.grid),o=(this.matrix=n.getContent().matrix.matrix,[]),r=this.parent.grid.getPrimaryKeyFieldNames()[0],n=Array.isArray(e.row)?e.row[0]:e.row,e=(je(n)||-1!==this.parent.getSelectedRows().indexOf(n)?(i=ZZ(t=this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length-1]),this.parent.getSelectedRows()[0]):(i=ZZ(t=e.rowData),n)).getAttribute("data-uid"),n=parseInt(this.parent.grid.getRowElementByUID(e).getAttribute("aria-rowindex"),10)-1;if(i.length)for(var s=n+i.length,a=1+n;a<=s;a++)o.push(this.parent.grid.getDataRows()[parseInt(a.toString(),10)]),(this.parent.frozenRows||this.parent.frozenColumns||this.parent.getFrozenColumns())&&o.push(this.parent.grid.getHeaderContent()[parseInt(a.toString(),10)]);je(t.parentItem)||(!je(e=i$(this.parent,t.parentItem.uniqueID))&&e.hasChildRecords&&(n=e.childRecords.indexOf(t),e.childRecords.splice(n,1)),this.batchDeletedRecords=e$(this.batchDeletedRecords),this.batchDeletedRecords.push(t)),i.push(t);for(var l=i,a=0;a<l.length;a++){var h=this.batchRecords.map(function(e){return e[""+r]}).indexOf(l[parseInt(a.toString(),10)][""+r]);-1!==h&&this.batchRecords.splice(h,1)}for(a=0;a<o.length;a++)je(o[parseInt(a.toString(),10)])||this.parent.grid.selectionModule.selectedRecords.push(o[parseInt(a.toString(),10)])},Fee.prototype.updateRowIndex=function(){for(var e=this.parent.grid.getDataRows(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].setAttribute("aria-rowindex",(t+1).toString())},Fee.prototype.updateChildCount=function(e){for(var t=this.parent.grid.getPrimaryKeyFieldNames()[0],i="addedRecords",n="Child"===this.parent.editSettings.newRowPosition?"primaryParent":"parentItem",o=0;o<this.parent.getBatchChanges()[i].length;o++)je(this.parent.getBatchChanges()[i][parseInt(o.toString(),10)][n])||this.parent.getBatchChanges()[i][parseInt(o.toString(),10)][n][""+t]===e[parseInt(this.addRowIndex.toString(),10)][""+t]&&(this.batchChildCount=this.batchChildCount+1)},Fee.prototype.beforeBatchSave=function(e){var t="changedRecords",i="deletedRecords",n=e.batchChanges[t];if(e.batchChanges[t].length)for(var o=0;o<n.length;o++)U$({value:n[parseInt(o.toString(),10)],action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,void 0);if(e.batchChanges[i].length)for(var r=e.batchChanges[i],o=0;o<r.length;o++){this.deleteUniqueID(r[parseInt(o.toString(),10)].uniqueID);for(var s=ZZ(r[parseInt(o.toString(),10)]),a=0;a<s.length;a++)this.deleteUniqueID(s[parseInt(a.toString(),10)].uniqueID);e.batchChanges[i]=e.batchChanges[i].concat(s)}this.isAdd=!1},Fee.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},Fee.prototype.batchCancelAction=function(){var e,t="targetElement",i="parentItem",n=this.parent.grid.getCurrentViewRecords(),o="childRecords",r=this.parent.grid.dataSource instanceof me?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,s=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!je(this.batchAddedRecords))for(var a=0;a<this.batchAddedRecords.length;a++)if(-1!==(d=r.map(function(e){return e[""+s]}).indexOf(this.batchAddedRecords[parseInt(a.toString(),10)][""+s]))&&r.splice(d,1),"Child"===this.parent.editSettings.newRowPosition&&(d=n.map(function(e){return e[""+s]}).indexOf((this.batchAddedRecords[parseInt(a.toString(),10)][i]?this.batchAddedRecords[parseInt(a.toString(),10)][i]:this.batchAddedRecords[parseInt(a.toString(),10)])[""+s]),!je(n[parseInt(d.toString(),10)])))for(var l=n[parseInt(d.toString(),10)][o],h=0;l&&h<l.length;h++)l[parseInt(h.toString(),10)][""+s]===this.batchAddedRecords[parseInt(a.toString(),10)][""+s]&&n[parseInt(d.toString(),10)][o].splice(h,1);if(je(this.parent[t])||(e=this.parent[t].closest("tr"),this.parent.collapseRow(e),this.parent[t]=null),!je(this.batchDeletedRecords))for(var d,p,a=0;a<this.batchDeletedRecords.length;a++)je(this.batchDeletedRecords[parseInt(a.toString(),10)][i])||(d=n.map(function(e){return e[""+s]}).indexOf(this.batchDeletedRecords[parseInt(a.toString(),10)][i][""+s]),p=0===this.batchDeletedRecords[parseInt(a.toString(),10)].index?this.batchDeletedRecords[parseInt(a.toString(),10)].index:this.batchDeletedRecords[parseInt(a.toString(),10)].index-1,je(n[parseInt(d.toString(),10)]))||n[parseInt(d.toString(),10)][o].splice(p,0,this.batchDeletedRecords[parseInt(a.toString(),10)]);this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.currentViewRecords=[],this.batchRecords=e$(this.parent.grid.getCurrentViewRecords()),this.batchIndex=0,this.currentViewRecords=e$(this.parent.grid.getCurrentViewRecords()),this.batchDeletedRecords=[],this.parent.grid.renderModule.refresh()},Fee.prototype.batchSave=function(e){if("Batch"===this.parent.editSettings.mode){var t,i,n,o=void 0,r=Object.hasOwnProperty.call(e,"updatedRecords")?e.updatedRecords:this.parent.getBatchChanges(),s="deletedRecords",a=this.parent.grid.dataSource instanceof me?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,l=this.parent.grid.getCurrentViewRecords(),h=this.parent.grid.getPrimaryKeyFieldNames()[0],d=r.addedRecords,p="parentItem",c=void 0,u=void 0,g=void 0,m="childRecords";if(1<d.length&&"Bottom"!==this.parent.editSettings.newRowPosition&&d.reverse(),"Bottom"!==this.parent.editSettings.newRowPosition&&!Object.hasOwnProperty.call(e,"updatedRecords")){if(a.splice(a.length-d.length,d.length),this.parent.editModule.isAddedRowByMethod&&d.length&&!je(this.parent.editModule.addRowIndex)&&!this.parent.editModule.isAddedRowByContextMenu){d.reverse();for(var f=0;f<d.length;f++){var y=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[parseInt(f.toString(),10)].getAttribute("aria-rowindex"),10)-1;a.splice(y,0,d[parseInt(f.toString(),10)])}}this.parent.allowPaging||a.length===l.length?(t=e$(a)).length&&(n=(i=t.map(function(e){return e[""+h]}).indexOf(l[0][""+h]))+this.parent.grid.pageSettings.pageSize,l=t.splice(i,n)):l.length>d.length&&l.splice(l.length-d.length,d.length)}for(0===this.batchAddRowRecord.length&&this.batchAddRowRecord.push(this.parent.flatData[e.index]),this.parent.editModule.isAddedRowByContextMenu&&d.reverse(),o=0;o<d.length;o++){var v,b=Pe({},d[parseInt(o.toString(),10)]);if(delete b.parentItem,delete b.uniqueID,delete b.index,delete b.level,delete b.hasChildRecords,delete b.childRecords,delete b.parentUniqueID,je(b.primaryParent)||delete b.primaryParent,1<d.length&&this.parent.editModule.isAddedRowByContextMenu&&(v=this.parent.editSettings.newRowPosition,this.parent.editSettings.newRowPosition=this.parent.editModule.previousNewRowPosition,this.parent.editModule.previousNewRowPosition=v),d[parseInt(o.toString(),10)].taskData=b,je(g=this.batchAddRowRecord[parseInt(o.toString(),10)])&&(g=this.batchAddRowRecord[o-1]),!this.isSelfReference||je(d[parseInt(o.toString(),10)].parentItem)||q$(h,d[parseInt(o.toString(),10)].parentItem,"add",this.parent,this.isSelfReference,d[parseInt(o.toString(),10)]),je(g)||(u=g.index),je(d[parseInt(o.toString(),10)].index)&&(u=0),"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition&&je(d[parseInt(o.toString(),10)].parentItem)&&-1===this.selectedIndex&&(c=-1,g=null),U$({value:d[parseInt(o.toString(),10)],action:"add"},this.parent,this.isSelfReference,u,c,void 0,g),c=null,"Child"===this.parent.editSettings.newRowPosition&&!je(d[parseInt(o.toString(),10)][p])&&(je(this.parent.editModule.addRowIndex)||this.isSelfReference))for(var w=l.map(function(e){return e[""+h]}).indexOf(d[parseInt(o.toString(),10)][p][""+h]),C=l[parseInt(w.toString(),10)][m],S=0;S<C.length;S++)C[parseInt(S.toString(),10)][""+h]===d[parseInt(o.toString(),10)][""+h]&&l[parseInt(w.toString(),10)][m].splice(S,1)}if(r[s].length)for(o=0;o<r[s].length;o++)U$({value:r[s][parseInt(o.toString(),10)],action:"delete"},this.parent,this.isSelfReference,u,c,void 0,g);this.parent.parentData=[];for(var A=0;A<a.length;A++)a[parseInt(A.toString(),10)].index=A,x("uniqueIDCollection."+a[parseInt(A.toString(),10)].uniqueID+".index",A,this.parent),a[parseInt(A.toString(),10)].level||this.parent.parentData.push(a[parseInt(A.toString(),10)])}this.batchAddRowRecord=this.batchAddedRecords=this.batchRecords=this.batchDeletedRecords=this.currentViewRecords=[],this.parent.editModule.isAddedRowByContextMenu&&(this.parent.editModule.isAddedRowByContextMenu=!1)},Fee.prototype.getActualRowObjectIndex=function(e){var t=this.parent.grid.getDataRows();return("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&-1<this.selectedIndex&&(!je(this.batchRecords[this.addRowIndex])&&this.batchRecords[this.addRowIndex].expanded&&(1<this.parent.getBatchChanges()[this.addedRecords].length||this.parent.getBatchChanges()[this.deletedRecords].length?(e+=ZZ(this.batchRecords[this.addRowIndex]).length,"Child"!==this.parent.editSettings.newRowPosition&&(e+=this.getBatchChildCount())):e+=ZZ(this.batchRecords[this.addRowIndex]).length),e>=t.length&&(e=t.length-1),this.updateChildCount(this.parent.grid.getCurrentViewRecords()),this.batchChildCount&&(e+=this.batchChildCount),this.batchChildCount=0),e},Fee.prototype.immutableBatchAction=function(e){e.args.cancel=!0;var t=this.parent.grid.getBatchChanges(),i=[];Object.keys(t).length&&(i=t.addedRecords);for(var n=0;n<i.length;n++)e.rows.splice(i[parseInt(n.toString(),10)].index,1)},Fee.prototype.nextCellIndex=function(e){var t="index",i=this.parent.getBatchChanges().deletedRecords;this.parent.getSelectedRows().length?this.isAdd&&0<i.length?e[t]=this.parent.getSelectedRecords()[0][t]:e[t]=this.parent.getSelectedRows()[0].rowIndex:e[t]=this.batchIndex};var Bee=Fee;function Fee(e){this.batchChildCount=0,this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.batchAddedRecords=[],this.batchDeletedRecords=[],this.batchAddRowRecord=[],this.parent=e,this.isSelfReference=!je(e.parentIdMapping),this.batchRecords=[],this.currentViewRecords=[],this.isAdd=!1,this.addEventListener()}Ree.prototype.getModuleName=function(){return"edit"},Ree.prototype.addEventListener=function(){this.parent.on(rZ,this.crudAction,this),this.parent.on(sZ,this.beginEdit,this),this.parent.on(aZ,this.beginAdd,this),this.parent.on(lZ,this.recordDoubleClick,this),this.parent.on(hZ,this.cellSave,this),this.parent.on(uZ,this.batchCancel,this),this.parent.grid.on(bZ,this.keyPressed,this),this.parent.grid.on("batchedit-form",this.lastCellTab,this),this.parent.grid.on("content-ready",this.contentready,this),this.parent.on(pZ,this.cellEdit,this),this.parent.on("actionBegin",this.editActionEvents,this),this.parent.on("actionComplete",this.editActionEvents,this),this.parent.grid.on(wZ,this.recordDoubleClick,this),this.parent.grid.on("dblclick",this.gridDblClick,this),this.parent.grid.on("recordAdded",this.customCellSave,this),this.parent.on("savePreviousRowPosition",this.savePreviousRowPosition,this),this.parent.grid.on(IZ,this.beforeStartEdit,this),this.parent.grid.on(TZ,this.beforeBatchCancel,this),this.parent.grid.on("reset-edit-props",this.resetIsOnBatch,this),this.parent.grid.on("get-row-position",this.getRowPosition,this)},Ree.prototype.gridDblClick=function(e){this.doubleClickTarget=e.target,e.target.classList.contains("e-frame")&&0===this.parent.getCurrentViewRecords().length&&(this.doubleClickTarget=null),(e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-treegridexpand"))&&!je(e=(e=A(e.target,"e-row"))&&parseInt(e.getAttribute("aria-rowindex"),10)-1)&&0<=e&&this.parent.allowPaging&&(this.parent.grid.getDataRows()[e].dataset.uid=this.parent.grid.contentModule.getRows()[e].uid)},Ree.prototype.getRowPosition=function(e){e.newRowPosition=this.parent.editSettings.newRowPosition,e.addRowIndex=this.addRowIndex,e.dataRowIndex=+this.prevAriaRowIndex},Ree.prototype.beforeStartEdit=function(e){"Cell"===this.parent.editSettings.mode&&this.parent.trigger(OJ,e)},Ree.prototype.beforeBatchCancel=function(e){"Cell"===this.parent.editSettings.mode&&(e.requestType="cancel",this.parent.trigger(VJ,e))},Ree.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(rZ,this.crudAction),this.parent.off(sZ,this.beginEdit),this.parent.off(aZ,this.beginAdd),this.parent.off(lZ,this.recordDoubleClick),this.parent.off(uZ,this.batchCancel),this.parent.grid.off(bZ,this.keyPressed),this.parent.grid.off("batchedit-form",this.lastCellTab),this.parent.grid.off("content-ready",this.contentready),this.parent.off(pZ,this.cellEdit),this.parent.off("actionBegin",this.editActionEvents),this.parent.off("actionComplete",this.editActionEvents),this.parent.grid.off("recordAdded",this.customCellSave),this.parent.grid.off(wZ,this.recordDoubleClick),this.parent.off("savePreviousRowPosition",this.savePreviousRowPosition),this.parent.grid.off(IZ,this.beforeStartEdit),this.parent.grid.off(TZ,this.beforeBatchCancel),this.parent.grid.off("dblclick",this.gridDblClick),this.parent.grid.off("reset-edit-props",this.resetIsOnBatch),this.parent.grid.off("get-row-position",this.getRowPosition))},Ree.prototype.destroy=function(){this.removeEventListener()},Ree.prototype.applyFormValidation=function(e){this.parent.grid.editModule.applyFormValidation(e)},Ree.prototype.editActionEvents=function(e){var e=FB("editAction",e),t=FB("name",e),i=this.parent,n=!je(i.dataSource)&&i.dataSource.adaptor;if(!je(n)&&(qZ(i)||n instanceof Ga)&&"save"===e.requestType&&"add"===e.action&&("Child"===i.editSettings.newRowPosition||"Below"===i.editSettings.newRowPosition||"Above"===i.editSettings.newRowPosition))if("actionBegin"===t){n=je(e.row)||!Object.keys(e.row).length?this.selectedIndex:e.row.rowIndex-1,n=je(n)||-1===n?-1:i.getCurrentViewRecords()[parseInt(n.toString(),10)][i.getPrimaryKeyFieldNames()[0]];i.grid.query.addParams("relationalKey",n)}else if("actionComplete"===t)for(var o=i.grid.query.params.length,r=0;r<o;r++)"relationalKey"===i.grid.query.params[parseInt(r.toString(),10)].key&&i.grid.query.params.splice(r);this.parent.enableInfiniteScrolling&&"actionComplete"===t&&this.infiniteAddAction(e),"Batch"===this.parent.editSettings.mode&&"paging"===e.requestType&&this.parent.notify("batchPageAction",{})},Ree.prototype.infiniteAddAction=function(e){var t,i,n;("save"===e.requestType&&"add"===e.action||"delete"===e.requestType)&&("Top"!==this.parent.editSettings.newRowPosition&&-1!==this.selectedIndex&&"save"===e.requestType&&"add"===e.action&&(t=(e=this.parent.grid.getRowsObject()).splice(0,1)[0],n=this.addRowIndex,i=this.parent.getCurrentViewRecords(),"Below"!==this.parent.editSettings.newRowPosition&&"Child"!==this.parent.editSettings.newRowPosition||(n+=ZZ(i[n+1]).length),n="Below"===this.parent.editSettings.newRowPosition?n+1:n,e.splice(n,0,t),e=i.splice(0,1)[0],i.splice(n,0,e),this.updateInfiniteCurrentViewData(e,this.addRowIndex)),t=this.parent.grid.getRows(),i=this.parent.grid.getRowsObject(),(n=this.parent.infiniteScrollSettings.enableCache)||(eF(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0),this.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords())),!n)&&0<this.parent.getFrozenColumns()&&(eF(this.parent.grid,i,t,0),this.updateIndex(this.parent.grid.dataSource,t,this.parent.getCurrentViewRecords()))},Ree.prototype.updateInfiniteCurrentViewData=function(e,t){var i=this,n=Math.ceil(t/this.parent.grid.pageSettings.pageSize),n=0<n?n:1,o=t-(n-1)*this.parent.pageSettings.pageSize,t=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData,r=(t[1].splice(0,1),t[parseInt(n.toString(),10)]);!je(this.addRowRecord)&&(r.filter(function(e,t){e.uniqueID===i.addRowRecord.uniqueID&&(o=t)}),this.addRowRecord.hasChildRecords&&this.addRowRecord.childRecords.length&&"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(o+=ZZ(this.addRowRecord).length),o>=this.parent.pageSettings.pageSize&&(n+=1,r=t[parseInt(n.toString(),10)],o=0<=o-this.parent.pageSettings.pageSize?o-this.parent.pageSettings.pageSize:0),o="Below"===this.parent.editSettings.newRowPosition?o+1:o,r.splice(o,0,e),this.parent.grid.infiniteScrollModule.updateCurrentViewData()},Ree.prototype.recordDoubleClick=function(e){var t,i=e.target;je(i.closest("td.e-rowcell"))||this.parent.grid.editSettings.allowEditing&&!this.parent.grid.isEdit&&(t=this.parent.grid.getColumnByIndex(+i.closest("td.e-rowcell").getAttribute("aria-colindex")-1),"Cell"===this.parent.editSettings.mode&&!this.isOnBatch&&t&&!t.isPrimaryKey&&this.parent.editSettings.allowEditing&&t.allowEditing&&!i.classList.contains("e-treegridexpand")&&!i.classList.contains("e-treegridcollapse")&&this.parent.editSettings.allowEditOnDblClick?(this.isOnBatch=!0,this.parent.grid.setProperties({selectedRowIndex:e.rowIndex},!0),this.parent.enableVirtualization&&(i=A(e.target,"e-row"),this.prevAriaRowIndex=i.getAttribute("aria-rowindex"),i.setAttribute("aria-rowindex",i.rowIndex+1+"")),this.updateGridEditMode("Batch")):"Cell"!==this.parent.editSettings.mode||t.allowEditing&&!t.isPrimaryKey||(this.isOnBatch=!0,this.updateGridEditMode("Batch")))},Ree.prototype.updateGridEditMode=function(e){this.parent.grid.setProperties({editSettings:{mode:e}},!0),FB("updateEditObj",this.parent.grid.editModule).apply(this.parent.grid.editModule),this.parent.grid.isEdit=!1},Ree.prototype.resetIsOnBatch=function(){this.parent.enableVirtualization&&"Cell"===this.parent.editSettings.mode&&(this.isOnBatch=!1,this.updateGridEditMode("Normal"))},Ree.prototype.keyPressed=function(e){this.isOnBatch&&(this.keyPress=e.action),"f2"===e.action&&this.recordDoubleClick(e),"escape"===e.action&&this.closeEdit()},Ree.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},Ree.prototype.cellEdit=function(e){var t=this,i=e.promise;delete e.promise,this.parent.enableVirtualization&&!je(this.prevAriaRowIndex)&&"-1"!==this.prevAriaRowIndex&&(e.row.setAttribute("aria-rowindex",this.prevAriaRowIndex),this.prevAriaRowIndex=void 0),"enter"!==this.keyPress&&this.parent.trigger(pZ,e,function(e){e.cancel||"Cell"!==t.parent.editSettings.mode?e.cancel&&"Cell"===t.parent.editSettings.mode&&(t.isOnBatch=!1,t.updateGridEditMode("Normal")):t.enableToolbarItems("edit"),je(i)||i.resolve(e)}),this.doubleClickTarget&&(this.doubleClickTarget.classList.contains("e-treegridexpand")||this.doubleClickTarget.classList.contains("e-treegridcollapse")||this.doubleClickTarget.classList.contains("e-summarycell"))?(e.cancel=!0,this.doubleClickTarget=null):("Cell"===this.parent.editSettings.mode&&("tab"===this.keyPress||"shiftTab"===this.keyPress?this.keyPress=null:"enter"===this.keyPress&&(e.cancel=!0,this.keyPress=null,x("isEditCollapse",!1,this.parent)),e.columnObject.allowEditing||(e.cancel=!0)),this.parent.enableVirtualization&&(this.parent.grid.contentModule.editedRowIndex=this.parent.grid.editModule.editModule.index))},Ree.prototype.enableToolbarItems=function(e){var t;je(this.parent.grid.toolbarModule)||(t=this.parent.element.id+"_gridcontrol_",this.parent.grid.toolbarModule.enableItems([t+"add",t+"edit",t+"delete"],"save"===e),this.parent.grid.toolbarModule.enableItems([t+"update",t+"cancel"],"edit"===e))},Ree.prototype.batchCancel=function(){var e,t;"Cell"===this.parent.editSettings.mode&&(e=R("editModule.cellDetails",this.parent.grid.editModule),je(this.editedRowIndex)||(e.rowIndex=this.editedRowIndex),t=this.parent.getCellFromIndex(e.rowIndex,this.parent.treeColumnIndex),this.parent.renderModule.cellRender({data:e.rowData,cell:t,column:this.parent.grid.getColumns()[this.parent.treeColumnIndex]}),this.updateGridEditMode("Normal"),this.isOnBatch=!1),"Batch"===this.parent.editSettings.mode&&this.parent.notify("batchCancelAction",{})},Ree.prototype.customCellSave=function(e){GZ(this.parent)&&"Cell"===this.parent.editSettings.mode&&"edit"===e.action&&(this.updateCell(e,e.rowIndex),this.afterCellSave(e,e.row))},Ree.prototype.cellSave=function(i){var t,n,o,e,r=this;"Cell"===this.parent.editSettings.mode&&this.parent.element.querySelector("form")&&(x("isEditCollapse",i.cancel=!0,this.parent),i.rowData[i.columnName]=i.value,t=(je(i.cell)?this.parent.grid.editModule.editModule.form.parentElement:i.cell).parentNode,n=this.parent.getPrimaryKeyFieldNames(),je(t)?this.parent.grid.getCurrentViewRecords().filter(function(e,t){e[n[0]]===i.rowData[n[0]]&&(o=t)}):o=(0<this.parent.getFrozenLeftColumnsCount()||0<this.parent.getFrozenRightColumnsCount()?(this.parent.getRows().indexOf(t),this.parent):-1===this.parent.getRows().indexOf(t)&&0<this.parent.getFrozenColumns()?this.parent.grid:this.parent).getRows().indexOf(t),Pe(e={},i),e.cancel=!1,e.type="save",t=this.parent.grid.getRows()[t.rowIndex],this.parent.trigger(OJ,e),e.cancel?this.parent.grid.isEdit=!0:(t.rowIndex===this.parent.getCurrentViewRecords().length-1&&"tab"===this.keyPress&&(this.isTabLastRow=!0),qZ(this.parent)||this.parent.dataSource instanceof me&&this.parent.dataSource.adaptor instanceof Ga?(qZ(this.parent)||this.parent.dataSource instanceof me&&this.parent.dataSource.adaptor instanceof Ga)&&(e=this.parent.grid.query,this.parent.isGantt&&this.parent.loadChildOnDemand?(this.updateCell(i,o),x("isEdit",!1,this.parent.grid),this.afterCellSave(i,t)):this.parent.grid.dataSource.update(n[0],i.rowData,e.fromTable,e,i.previousValue).then(function(e){je(e)||(i.rowData[i.columnName]=e[i.columnName]),r.updateCell(i,o),x("isEdit",!1,r.parent.grid),r.afterCellSave(i,t)})):GZ(this.parent)?(e={requestType:"save",data:i.rowData,action:"edit",row:t,rowIndex:o,rowData:i.rowData,columnName:i.columnName,filterChoiceCount:null,excelSearchOperator:null},this.parent.grid.getDataModule().eventPromise(e,this.parent.grid.query)):(this.updateCell(i,o),x("isEdit",!1,this.parent.grid),this.afterCellSave(i,t)))),this.parent.enableVirtualization&&(this.parent.grid.contentModule.virtualData={})},Ree.prototype.afterCellSave=function(e,t){this.parent.grid.aggregateModule&&this.parent.grid.aggregateModule.refresh(e.rowData),this.parent.grid.editModule.destroyWidgets([this.parent.grid.getColumnByField(e.columnName)]),this.parent.grid.editModule.formObj.destroy(),"tab"!==this.keyPress&&"shiftTab"!==this.keyPress&&(this.updateGridEditMode("Normal"),this.isOnBatch=!1),this.enableToolbarItems("save"),q([t],["e-editedrow","e-batchrow"]),q(t.querySelectorAll(".e-rowcell"),["e-editedbatchcell","e-updatedtd"]),!1!==this.parent.isCellSaveFocus&&this.parent.grid.focusModule.restoreFocus(),U$({value:e.rowData,action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,e.columnName),t.rowIndex===this.parent.getCurrentViewRecords().length-1&&"enter"===this.keyPress&&(this.keyPress=null);t={type:"save",column:this.parent.getColumnByField(e.columnName),data:e.rowData,previousData:e.previousValue,row:t,target:e.cell};this.parent.aggregates.map(function(e){return!0===e.showChildSummary}).length&&this.parent.grid.refresh(),this.parent.trigger(VJ,t)},Ree.prototype.lastCellTab=function(){!this.parent.grid.isEdit&&this.isOnBatch&&"tab"===this.keyPress&&"Cell"===this.parent.editSettings.mode&&(this.parent.editSettings.allowNextRowEdit?this.enableToolbarItems("edit"):(this.updateGridEditMode("Normal"),this.isOnBatch=!1,this.keyPress=null))},Ree.prototype.updateCell=function(e,t){this.parent.grid.editModule.updateCell(t,e.columnName,e.rowData[e.columnName]),this.parent.grid.getRowsObject()[parseInt(t.toString(),10)].data=e.rowData},Ree.prototype.crudAction=function(e,t){U$(e,this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,t,this.addRowRecord),this.parent.parentData=[];for(var i=this.parent.grid.dataSource instanceof me?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,n=0;n<i.length;n++){i[parseInt(n.toString(),10)].index=n;var o=this.parent.grid.getPrimaryKeyFieldNames()[0],o=(e.value[""+o]===i[parseInt(n.toString(),10)][""+o]&&"add"===e.action&&(i[parseInt(n.toString(),10)].level=this.internalProperties.level,i[parseInt(n.toString(),10)].taskData=this.internalProperties.taskData,i[parseInt(n.toString(),10)].uniqueID=this.internalProperties.uniqueID,je(this.internalProperties.parentItem)||(i[parseInt(n.toString(),10)].parentItem=this.internalProperties.parentItem,i[parseInt(n.toString(),10)].parentUniqueID=this.internalProperties.parentUniqueID),i[parseInt(n.toString(),10)].childRecords=this.internalProperties.childRecords),x("uniqueIDCollection."+i[parseInt(n.toString(),10)].uniqueID+".index",n,this.parent),this.parent.dataSource.adaptor);(qZ(this.parent)||o instanceof Ga)&&x("uniqueIDCollection."+i[parseInt(n.toString(),10)].uniqueID,i[parseInt(n.toString(),10)],this.parent),i[parseInt(n.toString(),10)].level||this.parent.parentData.push(i[parseInt(n.toString(),10)])}this.parent.enableInfiniteScrolling||"add"===e.action&&null!=this.previousNewRowPosition&&(this.parent.setProperties({editSettings:{newRowPosition:this.previousNewRowPosition}},!0),this.previousNewRowPosition=null)},Ree.prototype.updateIndex=function(e,t,i){for(var n=0;n<this.parent.getDataRows().length;n++){var o,r=i[parseInt(n.toString(),10)];je(r)||(c=R("uniqueIDCollection."+r.uniqueID+".index",this.parent),r.index=c,je(r.parentItem))||(o=R("uniqueIDCollection."+r.parentItem.uniqueID+".index",this.parent),r.parentItem.index=o)}var s=-1,a=this.parent.treeColumnIndex;if(0<this.parent.getFrozenColumns())for(var l=t[0].querySelectorAll(".e-rowcell"),h=0;h<l.length;h++)if(l[parseInt(h.toString(),10)].classList.contains("e-gridrowindex0level0")){a=h;break}for(var d=0;d<this.parent.getRows().length;d++){t[parseInt(d.toString(),10)].classList.contains("e-detailrow")||s++;var p=i[parseInt(s.toString(),10)];if(!je(p)){var c=p.index,u=p.level,g=t[parseInt(d.toString(),10)],m=(je(p.parentItem)||(c=R("uniqueIDCollection."+p.parentItem.uniqueID+".index",this.parent)),g.cells[parseInt(a.toString(),10)]);if(!je(m)){for(h=0;h<m.classList.length;h++){var f=m.classList[parseInt(h.toString(),10)],y=f.match(/e-gridrowindex/i),v=f.match(/e-griddetailrowindex/i);null!=y&&q([m],f),null!=v&&q([m],f)}t[parseInt(d.toString(),10)].classList.contains("e-detailrow")?U([m],"e-griddetailrowindex"+c+"level"+u):U([m],"e-gridrowindex"+c+"level"+u)}}}},Ree.prototype.beginAdd=function(){var e=this.addRowIndex,t=this.parent.grid.getCurrentViewRecords(),i=("Batch"===this.parent.editSettings.mode&&(e=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex(),1<this.parent.getBatchChanges()[this.addedRecords].length||this.parent.getBatchChanges()[this.deletedRecords].length)&&(t=this.batchEditModule.getBatchRecords()),this.parent.grid.getDataRows()),n=i.length?+i[0].getAttribute("aria-rowindex")-1:0,o=i.length?+i[i.length-1].getAttribute("aria-rowindex")-1:0,n=this.selectedIndex>=n&&this.selectedIndex<=o,o=this.parent.enableVirtualization&&-1<this.addRowIndex&&"-1"!==this.prevAriaRowIndex;if("Dialog"!==this.parent.editSettings.mode&&("Above"===this.parent.editSettings.newRowPosition?r="before":("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(-1<this.selectedIndex||o)&&n&&(r="after",!je(t[parseInt(e.toString(),10)]))&&t[parseInt(e.toString(),10)].expanded&&("Batch"===this.parent.editSettings.mode&&(1<this.parent.getBatchChanges()[this.addedRecords].length||this.parent.getBatchChanges()[this.deletedRecords].length)?(e+=ZZ(t[parseInt(e.toString(),10)]).length,"Child"!==this.parent.editSettings.newRowPosition&&(e+=this.batchEditModule.getBatchChildCount())):this.parent.enableVirtualization||(e+=ZZ(t[parseInt(e.toString(),10)]).length)),(-1<this.selectedIndex||o)&&n&&(e||"Child"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition))){e>=i.length-1&&(e=i.length-2);var t=this.parent.grid.contentModule.rows[0],n=document.activeElement,r=(i[e+1][""+r](i[0]),x("batchIndex",e+1,this.batchEditModule),"Above"===this.parent.editSettings.newRowPosition?e:e+1);if("Batch"===this.parent.editSettings.mode&&(this.parent.grid.contentModule.rows.splice(0,1),this.parent.grid.contentModule.rows.splice(r,0,t)),"Row"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode){for(var s=this.parent.grid.getContentTable().querySelectorAll(".e-griderror"),a=0;a<s.length;a++)s[parseInt(a.toString(),10)].remove();x("errorRules",[],this.parent.grid.editModule.formObj)}o&&(this.prevAriaRowIndex="-1"),this.parent.enableVirtualization&&!this.parent.enableVirtualization||(this.isScrollByFocus=!0,n.focus()),this.parent.enableVirtualization&&!Object.keys(this.parent.grid.contentModule.emptyRowData).length&&this.parent.grid.contentModule.createEmptyRowdata()}if("Batch"===this.parent.editSettings.mode&&!je(this.addRowIndex)&&-1!==this.addRowIndex&&this.isAddedRowByMethod&&!this.isAddedRowByContextMenu){e=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex();var l=this.parent.getBatchChanges().addedRecords,h=void 0;if(l.length)for(a=0;a<l.length;a++)je(l[parseInt(a.toString(),10)].uniqueID)&&(h=l[parseInt(a.toString(),10)]);i={action:"add",data:h,index:e,seletedRow:0};this.beginAddEdit(i),this.batchEditModule.batchAddRowRecord.push(this.batchEditModule.addRowRecord),this.batchEditModule.batchAddedRecords.push(i.data)}},Ree.prototype.beginEdit=function(i){if("refresh"===i.requestType&&this.isOnBatch)i.cancel=!0;else if("Cell"===this.parent.editSettings.mode&&"beginEdit"===i.requestType)i.cancel=!0;else if(this.doubleClickTarget&&"delete"!==i.requestType&&(this.doubleClickTarget.classList.contains("e-treegridexpand")||this.doubleClickTarget.classList.contains("e-treegridcollapse")||this.doubleClickTarget.classList.contains("e-frame")))i.cancel=!0,this.doubleClickTarget=null;else{if("delete"===i.requestType){var n=i.data;if(je(i.data[0].uniqueID))for(var o=this.parent.getPrimaryKeyFieldNames(),e=this,t=0;t<n.length;t++)!function(t){e.parent.flatData.filter(function(e){e[""+o[0]]===i.data[parseInt(t.toString(),10)][o[0]]&&(n[parseInt(t.toString(),10)]=e)})}(t);for(t=0;t<n.length;t++){this.deleteUniqueID(n[parseInt(t.toString(),10)].uniqueID);for(var r=ZZ(n[parseInt(t.toString(),10)]),s=0;s<r.length;s++)this.deleteUniqueID(r[parseInt(s.toString(),10)].uniqueID);i.data=i.data.concat(r)}}var a,l;("add"===i.requestType||this.isAddedRowByMethod&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))&&((-1===this.parent.grid.selectedRowIndex&&this.isAddedRowByMethod||i.index!==this.parent.grid.selectedRowIndex)&&0!==i.index||(this.selectedIndex=this.parent.grid.selectedRowIndex),this.parent.enableVirtualization?(l='.e-row[aria-rowindex="'+(this.selectedIndex+1)+'"]',a=void 0,-1<this.selectedIndex&&"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition?(this.prevAriaRowIndex=this.selectedIndex.toString(),a=this.parent.getContent().querySelector(l),this.addRowIndex=a?a.rowIndex:0):this.prevAriaRowIndex&&"-1"!==this.prevAriaRowIndex?(l='.e-row[aria-rowindex="'+(this.prevAriaRowIndex+1)+'"]',a=this.parent.getContent().querySelector(l),this.addRowIndex=a?a.rowIndex:0):this.addRowIndex=0):this.isAddedRowByMethod&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?0!==i.index?this.addRowIndex=i.index:this.addRowIndex=this.parent.grid.selectedRowIndex:this.addRowIndex=-1<this.parent.grid.selectedRowIndex?this.parent.grid.selectedRowIndex:0,l=this.parent.getSelectedRecords()[0],(this.isAddedRowByMethod||this.isAddedRowByContextMenu&&-1!==this.parent.grid.selectedRowIndex)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?(this.addRowRecord=this.parent.flatData[this.parent.grid.selectedRowIndex],this.parent.enableVirtualization&&this.isAddedRowByContextMenu&&(this.addRowRecord=this.parent.getCurrentViewRecords()[this.addRowIndex])):je(l)||(this.addRowRecord=l)),this.isAddedRowByMethod&&0!==i.index&&(this.addRowRecord=this.parent.flatData[i.index],this.addRowIndex=i.index),"Child"!==this.parent.editSettings.newRowPosition||je(this.parent.getSelectedRecords()[0])||(this.addRowRecord=this.parent.getSelectedRecords()[0]),je(this.addRowRecord)&&this.parent.getCurrentViewRecords().length>this.addRowIndex&&"save"===i.requestType&&0!==this.parent.getSelectedRecords().length&&(this.addRowRecord=this.parent.getCurrentViewRecords()[this.addRowIndex]),this.isAddedRowByMethod=!1,i=this.beginAddEdit(i)}},Ree.prototype.savePreviousRowPosition=function(){null===this.previousNewRowPosition&&(this.previousNewRowPosition=this.parent.editSettings.newRowPosition)},Ree.prototype.beginAddEdit=function(e){var t,i,n,o,r,s,a,l,h,d,p,c,u=e.data;if("add"===e.action&&(t=this.parent.grid.getPrimaryKeyFieldNames()[0],a=null,c=void(u.taskData=je(u.taskData)?Pe({},e.data):u.taskData),c=this.parent.enableVirtualization&&0!==e.index?this.parent.flatData:"Batch"===this.parent.editSettings.mode&&this.isAddedRowByMethod&&!je(this.addRowIndex)?this.batchEditModule.batchRecords:this.parent.grid.getCurrentViewRecords(),this.parent.enableVirtualization&&0!==e.index&&(this.addRowIndex=this.parent.flatData.indexOf(this.addRowRecord),this.selectedIndex=this.addRowIndex),l=this.addRowIndex,u.uniqueID=$P(this.parent.element.id+"_data_"),x("uniqueIDCollection."+u.uniqueID,u,this.parent),o=g=n=i=void(p=0),r=this.parent.enableVirtualization&&-1<this.addRowIndex&&"-1"!==this.prevAriaRowIndex,s=(h=this.parent.getRows()).length?c.indexOf(c[0]):0,h=h.length?+h[h.length-1].getAttribute("aria-rowindex")-1:0,s=!(!this.parent.enableVirtualization||0===e.index)||this.selectedIndex>=s&&this.selectedIndex<=h,c.length&&(i=c[this.addRowIndex][this.parent.idMapping],o=c[this.addRowIndex][this.parent.parentIdMapping],c[this.addRowIndex].parentItem&&(n=c[this.addRowIndex].parentItem.uniqueID),g=c[this.addRowIndex].parentItem),"Top"!==this.parent.editSettings.newRowPosition&&c.length&&(p=c[this.addRowIndex].level,"Above"===this.parent.editSettings.newRowPosition?(a="before",l=c[this.addRowIndex].index):"Below"===this.parent.editSettings.newRowPosition?(a="after",h=ZZ(c[this.addRowIndex]).length,d=c[this.addRowIndex].index,l=0<h?d+h:d):"Child"===this.parent.editSettings.newRowPosition&&(a="after",(-1<this.selectedIndex||r)&&s&&(u.parentItem=Pe({},c[this.addRowIndex]),u.parentUniqueID=u.parentItem.uniqueID,delete u.parentItem.childRecords,delete u.parentItem[this.parent.childMapping]),h=ZZ(c[this.addRowIndex]).length,d=c[this.addRowIndex].index,0<=this.selectedIndex&&(u.level=p+1),l=0<h?d+h:d,this.isSelfReference)&&(this.parent.isLocalData||-1!==this.parent.editModule.selectedIndex?u.taskData[this.parent.parentIdMapping]=u[this.parent.parentIdMapping]=i:u.taskData[this.parent.parentIdMapping]=u[this.parent.parentIdMapping]=null,je(u.parentItem)||q$(t,u.parentItem,"add",this.parent,this.isSelfReference,u)),"Above"!==this.parent.editSettings.newRowPosition&&"Below"!==this.parent.editSettings.newRowPosition||((-1<this.selectedIndex||r)&&p&&s&&(u.parentUniqueID=n,u.parentItem=Pe({},g),delete u.parentItem.childRecords,delete u.parentItem[this.parent.childMapping]),u.level=p,this.isSelfReference&&(u.taskData[this.parent.parentIdMapping]=u[this.parent.parentIdMapping]=o,je(u.parentItem)||q$(t,u.parentItem,"add",this.parent,this.isSelfReference,u))),null!=a&&(-1<this.selectedIndex||r)&&s&&(e.index="before"===a?l:l+1),"Bottom"===this.parent.editSettings.newRowPosition)&&(p=0,c=this.parent.grid.dataSource instanceof me?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,e.index=c.length),je(u.level)&&(u.level=p),u.hasChildRecords=!1,u.childRecords=[],u.index=0),"add"===e.action&&(this.internalProperties={level:u.level,parentItem:u.parentItem,uniqueID:u.uniqueID,taskData:u.taskData,parentUniqueID:je(u.parentItem)?void 0:u.parentItem.uniqueID,childRecords:u.childRecords}),"delete"===e.requestType)for(var g,m,f=e.data,y=0;y<f.length;y++)f[parseInt(y.toString(),10)].parentItem&&!je(g=i$(this.parent,f[parseInt(y.toString(),10)].parentItem.uniqueID))&&g.hasChildRecords&&(m=g.childRecords.indexOf(f[parseInt(y.toString(),10)]),g.childRecords.splice(m,1));return e},Ree.prototype.addRecord=function(e,t,i){var n,o,r;this.parent.editSettings.newRowPosition!==this.previousNewRowPosition&&null!==this.previousNewRowPosition||(this.previousNewRowPosition=this.parent.editSettings.newRowPosition),this.isSelfReference||je(e)||!Object.hasOwnProperty.call(e,this.parent.childMapping)?(e&&(-1<t?(this.selectedIndex=t,this.addRowIndex=t):(this.selectedIndex=this.parent.selectedRowIndex,this.addRowIndex=this.parent.selectedRowIndex),i)&&this.parent.setProperties({editSettings:{newRowPosition:i}},!0),this.parent.grid.editModule.addRecord(e,t)):(o=this.parent.editSettings.mode,r=this.parent.grid.editSettings.mode,(n=[]).push(e),this.parent.setProperties({editSettings:{mode:"Batch"}},!0),this.parent.grid.setProperties({editSettings:{mode:"Batch"}},!0),je(i)||this.parent.setProperties({editSettings:{newRowPosition:i}},!0),this.parent.notify(vZ,{updatedRecords:{addedRecords:n,changedRecords:[],deletedRecords:[]},index:t}),this.parent.setProperties({editSettings:{mode:o}},!0),this.parent.grid.setProperties({editSettings:{mode:r}},!0),this.parent.refresh())},Ree.prototype.editFormValidate=function(){return this.parent.grid.editModule.editFormValidate()},Ree.prototype.destroyForm=function(){this.parent.grid.editModule.destroyForm()},Ree.prototype.contentready=function(e){je(e.args.requestType)||"delete"!==e.args.requestType.toString()&&"save"!==e.args.requestType.toString()&&("Batch"!==this.parent.editSettings.mode||"batchsave"!==e.args.requestType.toString())||(this.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),(this.parent.frozenRows||this.parent.getFrozenColumns()||this.parent.frozenColumns)&&this.parent.grid.dataSource.length===this.parent.getDataRows().length&&this.updateIndex(this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords()))},Ree.prototype.editCell=function(e,t){"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||("Batch"!==this.parent.editSettings.mode&&(this.isOnBatch=!0,this.updateGridEditMode("Batch")),this.parent.grid.editModule.editCell(e,t))},Ree.prototype.closeEdit=function(){this.parent.enableVirtualization&&"Batch"===this.parent.grid.editSettings.mode&&1<this.parent.grid.pageSettings.currentPage&&(this.editedRowIndex=this.parent.grid.editModule.editModule.cellDetails.rowIndex,this.parent.grid.editModule.editModule.cellDetails.rowIndex=parseInt(this.parent.getRows()[this.parent.grid.editModule.editModule.cellDetails.rowIndex].getAttribute("aria-rowIndex"),10)-1),this.parent.grid.editModule.closeEdit()};var Lee=Ree;function Ree(e){this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.prevAriaRowIndex="-1",this.isAddedRowByMethod=!1,this.isAddedRowByContextMenu=!1,IP.Inject(uX),this.parent=e,this.isSelfReference=!je(e.parentIdMapping),this.previousNewRowPosition=null,this.internalProperties={},this.batchEditModule=new Bee(this.parent),this.addEventListener()}Nee.prototype.getModuleName=function(){return"commandColumn"},Nee.prototype.destroy=function(){};var Oee=Nee;function Nee(e){IP.Inject(bK),this.parent=e}_ee.prototype.getModuleName=function(){return"detailRow"},_ee.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.dataBoundArg,this),this.parent.on("detaildataBound",this.detaildataBound,this),this.parent.grid.on("detail-indentcell-info",this.setIndentVisibility,this),this.parent.on("childRowExpand",this.childRowExpand,this),this.parent.on("rowExpandCollapse",this.rowExpandCollapse,this),this.parent.on("actioncomplete",this.actioncomplete,this)},_ee.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.dataBoundArg),this.parent.off("detaildataBound",this.detaildataBound),this.parent.off("childRowExpand",this.childRowExpand),this.parent.off("rowExpandCollapse",this.rowExpandCollapse),this.parent.off("actioncomplete",this.actioncomplete),this.parent.grid.off("detail-indentcell-info",this.setIndentVisibility))},_ee.prototype.setIndentVisibility=function(e){e.visible=!1},_ee.prototype.dataBoundArg=function(){for(var e=this.parent.getRows().filter(function(e){return!e.classList.contains("e-detailrow")}),t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)].getElementsByClassName("e-detailrowcollapse"),n=this.parent.grid.getRowObjectFromUID(e[parseInt(t.toString(),10)].getAttribute("data-Uid")),o=FB("parentItem",this.parent.grid.getCurrentViewRecords()[parseInt(t.toString(),10)]);(je(o)||!je(o)&&JZ(this.parent,n.data,this.parent.grid.getCurrentViewRecords()))&&this.parent.grid.detailRowModule.expand(i[0])}},_ee.prototype.childRowExpand=function(e){e=e.row.getElementsByClassName("e-detailrowcollapse");je(e[0])||this.parent.grid.detailRowModule.expand(e[0])},_ee.prototype.rowExpandCollapse=function(e){if(!qZ(this.parent))for(var t=0;t<e.detailrows.length;t++)this.parent.toggleRowVisibility(e.detailrows[parseInt(t.toString(),10)],e.action)},_ee.prototype.detaildataBound=function(e){var t=e.data,i=e.detailElement.parentElement.previousSibling,n="e-gridrowindex"+(je(t.parentItem)?t:t.parentItem).index+"level"+t.level,t=i.querySelector("."+n).classList,i=[].slice.call(t).filter(function(e){return e===n}),t=i[0].length,i=i.toString().slice(6,t);U([e.detailElement.parentElement],"e-griddetail"+i)},_ee.prototype.actioncomplete=function(e){"beginEdit"!==e.requestType&&"add"!==e.requestType||(t=e.row.querySelectorAll(".e-editcell")[0].getAttribute("colSpan"),t=(parseInt(t,10)-1).toString(),e.row.querySelectorAll(".e-editcell")[0].setAttribute("colSpan",t));for(var t,i=this.parent.grid.contentModule.getRows(),n=0;n<i.length;n++)i[parseInt(n.toString(),10)].cells[0].visible=!1;FB("focusModule",this.parent.grid).refreshMatrix(!0)({rows:this.parent.grid.contentModule.getRows()})},_ee.prototype.destroy=function(){this.removeEventListener()};var Vee=_ee;function _ee(e){IP.Inject(KG),this.parent=e,this.addEventListener()}Hee=function(e,t){return(Hee=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])}))(e,t)};var Hee,zee,jee=function(e,t){function i(){this.constructor=e}Hee(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Wee=(jee(Qee,zee=yY),Qee.prototype.getModelGenerator=function(){return new uee(this.parent)},Qee.prototype.getRowByIndex=function(t){var e;return this.parent.enableVirtualization&&this.parent.isFrozenGrid()?this.getRowCollection(t,!0):!(e=this.parent.getDataRows().find(function(e){return parseInt(e.getAttribute("aria-rowindex"),10)-1===t}))&&this.parent.isEdit&&"Batch"===this.parent.editSettings.mode?null!=t?this.parent.getRows()[parseInt(t.toString(),10)]:void 0:e},Qee.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1,!1,!0)},Qee.prototype.getRowCollection=function(e,t,i,n){var o=parseInt(this.parent.getRows()[0].getAttribute(HZ),10)-1,r=this.parent.getDataRows(),s=(i?this.parent.getCurrentViewRecords():r)[e-o];return s=null==(s=this.parent.frozenRows&&1<this.parent.pageSettings.currentPage?i?e<=this.parent.frozenRows?this.parent.getRowsObject()[parseInt(e.toString(),10)].data:s:e<=this.parent.frozenRows?r[parseInt(e.toString(),10)]:r[e-o+this.parent.frozenRows]:s)&&null!=e&&"Batch"===this.parent.editSettings.mode&&this.parent.isEdit&&t?r[parseInt(e.toString(),10)]:s},Qee.prototype.addEventListener=function(){this.parent.on(CZ,this.virtualOtherAction,this),this.parent.on(xZ,this.indexModifier,this)},Qee.prototype.virtualOtherAction=function(e){e.setTop?(this.translateY=0,this.startIndex=0,this.endIndex=this.parent.pageSettings.pageSize-1):e.isExpandCollapse&&(this.isExpandCollapse=!0)},Qee.prototype.indexModifier=function(e){var t,i=this.parent.getContent().querySelector(".e-content"),n=this.parent.pageSettings.pageSize;(this.recordAdded||"delete"===e.requestType&&this.endIndex>e.count-this.parent.pageSettings.pageSize)&&-1<this.startIndex&&-1<this.endIndex&&(this.endIndex>e.count-n?((t=(i=~~(i.scrollTop/this.parent.getRowHeight()))+this.parent.getRows().length)>e.count&&(t=i+(e.count-i)),this.startIndex=t-this.parent.getRows().length,this.endIndex=t):("Top"!==this.parent.root.editSettings.newRowPosition&&-1!==this.parent.root.editModule.selectedIndex||-1!==this.parent.root.editModule.selectedIndex)&&(this.startIndex+=1,this.endIndex+=1),this.recordAdded=!1),this.isDataSourceChanged&&(this.startIndex=0,this.endIndex=n-1),this.endIndex-this.startIndex!==n&&this.totalRecords>n&&this.endIndex===this.totalRecords?e.startIndex=this.endIndex-n:e.startIndex=this.startIndex,e.endIndex=this.endIndex},Qee.prototype.eventListener=function(e){var t=this;this.parent.dataSource instanceof me&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&GZ(this.parent)?zee.prototype.eventListener.call(this,"on"):(this.parent[""+e]("data-ready",this.onDataReady,this),this.parent[""+e]("refresh-virtual-block",this.refreshContentRows,this),this.fn=function(){t.observers.observes(function(e){return t.scrollListeners(e)},t.onEnteredAction(),t.parent);var e=t.parent;e.root.enablePersistence&&e.root.scrollPosition&&(t.content.scrollTop=e.root.scrollPosition.top,e.root.enableColumnVirtualization&&(t.content.scrollLeft=e.root.scrollPosition.left),e={direction:"down",sentinel:t.observer.sentinelInfo.down,offset:e.root.scrollPosition,focusElement:e.element},t.scrollListeners(e)),t.parent.off("content-ready",t.fn)},this.parent.addEventListener("dataBound",this.dataBoundEvent.bind(this)),this.parent.addEventListener("rowSelected",this.rowSelectedEvent.bind(this)),this.parent[""+e]("select-virtual-Row",this.toSelectVirtualRow,this),this.parent.on("content-ready",this.fn,this),this.parent.addEventListener(OJ,this.handleActionBegin.bind(this)),this.parent.addEventListener(VJ,this.onActionComplete.bind(this)),this.parent[""+e]("virtual-scroll-edit-action-begin",this.beginEdit,this),this.parent[""+e]("virtual-scroll-add-action-begin",this.beginAdd,this),this.parent[""+e]("virtual-scroll-edit-success",this.virtualEditSuccess,this),this.parent[""+e]("edit-reset",this.resetIseditValue,this),this.parent[""+e]("get-virtual-data",this.getData,this),this.parent[""+e]("virtual-scroll-edit-cancel",this.cancelEdit,this),this.parent[""+e]("select-row-on-context-open",this.toSelectRowOnContextOpen,this),this.parent[""+e]("refresh-virtual-editform-cells",this.refreshCell,this),this.parent[""+e]("virtaul-cell-focus",this.cellFocus,this),this.parent[""+e]("virtual-scroll-edit",this.restoreEditState,this))},Qee.prototype.cellFocus=function(e){zee.prototype.virtualCellFocus.call(this,e)},Qee.prototype.onDataReady=function(e){var t,i;zee.prototype.onDataReady.call(this,e),this.parent.dataSource instanceof me&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&GZ(this.parent)||(je(e.count)||(this.totalRecords=e.count,this.parent.isFrozenGrid()&&e.count<Object.keys(this.parent.dataSource).length&&(t=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.columns.length-1)+"px":"100%",i=this.parent.getRowHeight()*e.count-this.parent.getRowHeight()*this.parent.pageSettings.pageSize,R("virtualEle",this).setVirtualHeight(i,t)),this.parent.enableColumnVirtualization)||this.parent.isFrozenGrid()||R("virtualEle",this).setVirtualHeight(this.parent.getRowHeight()*e.count,"100%"),(!je(e.requestType)&&"collapseAll"===e.requestType.toString()||this.isDataSourceChanged&&(-1===this.startIndex||0===this.startIndex&&0===this.preStartIndex))&&(this.contents.scrollTop=0,this.isDataSourceChanged=!1))},Qee.prototype.renderTable=function(){zee.prototype.renderTable.call(this),this.parent.dataSource instanceof me&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&GZ(this.parent)||(R("observer",this).options.debounceEvent=!1,this.observers=new qee(R("observer",this).element,R("observer",this).options),this.contents=this.getPanel().firstChild)},Qee.prototype.getTranslateY=function(e,t,i,n){if(this.parent.dataSource instanceof me&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||GZ(this.parent)){if(this.isRemoteExpand)return this.isRemoteExpand=!1,this.preTranslate;this.preTranslate=zee.prototype.getTranslateY.call(this,e,t,i,n)}return zee.prototype.getTranslateY.call(this,e,t,i,n)},Qee.prototype.dataBoundEvent=function(){var e,t,i="initialRowTop";je(this.parent.getRows())||!this.parent.getRows().length||je(this.parent.getRowByIndex(0))||this[i]||(e=this.parent.getRowByIndex(0).getBoundingClientRect().top,t=this.parent.element.getBoundingClientRect().top,0<e?this[i]=this.parent.getRowByIndex(0).getBoundingClientRect().top-t:-1===this.parent.selectedRowIndex&&(this[i]=this.content.getBoundingClientRect().top-this.parent.getRowByIndex(0).getBoundingClientRect().height)),zee.prototype.dataBound.call(this)},Qee.prototype.rowSelectedEvent=function(e){zee.prototype.rowSelected.call(this,e),this.parent.notify("virtualTransform",{requestType:"transformChange"})},Qee.prototype.toSelectVirtualRow=function(t){var e;!this.parent.isEdit&&(je(this.observer[e="containerRect"])&&(this.observer[e]=this.observers[e]),je((e=this.parent.clipboardModule.treeGridParent).editModule)||je(e.editModule.addRowIndex)||0!==t.selectedIndex)&&(!je(e.grid.sortModule)&&0<e.grid.sortModule.sortedColumns.length&&!je(e=e.dataModule.sortedData)&&0<e.length&&(e=e.findIndex(function(e){return e.index===t.selectedIndex}),t.selectedIndex=e),zee.prototype.selectVirtualRow.call(this,t))},Qee.prototype.refreshCell=function(e){e.cells=this.generateCells()},Qee.prototype.generateCells=function(){for(var e=[],t=0;t<this.parent.columns.length;t++)e.push(this.generateCell(this.parent.columns[parseInt(t.toString(),10)]));return e},Qee.prototype.generateCell=function(e,t,i,n,o,r){t={visible:e.visible,isDataCell:!je(e.field||e.template),isTemplate:!je(e.template),rowID:t,column:e,cellType:je(i)?LA.Data:i,colSpan:n,commands:e.commands,isForeignKey:e.isForeignColumn&&e.isForeignColumn(),foreignKeyData:e.isForeignColumn&&e.isForeignColumn()&&R(e.field,r)};return(t.isDataCell||"checkbox"===t.column.type||t.commands)&&(t.index=o),new kE(t)},Qee.prototype.beginEdit=function(e){this.editedRowIndex=e.index;var t='.e-row[aria-rowindex="'+(e.index+1)+'"]',t=this.parent.getContent().querySelector(t).rowIndex,t=this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)];e.data=t},Qee.prototype.beginAdd=function(e){var t={newRowPosition:this.rowPosition,addRowIndex:this.addRowIndex,dataRowIndex:this.dataRowIndex},t=(this.parent.notify("get-row-position",t),this.rowPosition=t.newRowPosition,this.addRowIndex=t.addRowIndex,this.dataRowIndex=t.dataRowIndex,this.parent.getRows()),i=t.length?+t[0].getAttribute("aria-rowindex")-1:0,t=t.length?+t[t.length-1].getAttribute("aria-rowindex")-1:0,i=this.parent.selectedRowIndex>=i&&this.parent.selectedRowIndex<=t;"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.isAdd=!0),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.addRowIndex&&-1!==this.addRowIndex||-1!==this.parent.selectedRowIndex&&i)||zee.prototype.addActionBegin.call(this,e)},Qee.prototype.restoreEditState=function(){zee.prototype.restoreEdit.call(this)},Qee.prototype.resetIseditValue=function(){this.parent.notify("reset-edit-props",{}),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition||!this.isAdd||zee.prototype.resetIsedit.call(this)},Qee.prototype.virtualEditSuccess=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&e.querySelector(".e-addedrow")&&(this.recordAdded=!0)},Qee.prototype.cancelEdit=function(e){zee.prototype.editCancel.call(this,e)},Qee.prototype.toSelectRowOnContextOpen=function(e){zee.prototype.selectRowOnContextOpen.call(this,e)},Qee.prototype.restoreNewRow=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&!e.querySelector(".e-addedrow")&&(this.parent.isEdit=!1,this.parent.editModule.addRecord(null,this.parent.root.editModule.selectedIndex))},Qee.prototype.getData=function(e){zee.prototype.getVirtualData.call(this,e)},Qee.prototype.handleActionBegin=function(e){zee.prototype.actionBegin.call(this,e)},Qee.prototype.onActionComplete=function(e){var t;"add"===e.requestType&&(t={newRowPosition:this.rowPosition,addRowIndex:this.addRowIndex,dataRowIndex:this.dataRowIndex},this.parent.notify("get-row-position",t),this.rowPosition=t.newRowPosition,this.addRowIndex=t.addRowIndex,this.dataRowIndex=this.parent.root.editModule.selectedIndex);zee.prototype.actionComplete.call(this,e)},Qee.prototype.onEnteredAction=function(){var h=this;return function(e,t,i,n,o,r){var s,a,l;h.parent.directVirtualRender||(s="preventEvent",!F.isIE||o||!r||h[s]||h.parent.enableVirtualMaskRow||h.parent.showSpinner(),h.parent.enableVirtualMaskRow&&!h[s]&&setTimeout(function(){h.parent.showMaskRow(t.axis),h.parent.notify("showGanttShimmer",{requestType:"showShimmer"})},0),o=h.content.getBoundingClientRect().height,r=h.prevInfo.offsets?h.prevInfo.offsets.top:null,s="X"===t.axis,a=h.getColumnOffset(s?h.vgenerator.getColumnIndexes()[0]-1:h.prevInfo.columnIndexes[0]-1),s&&(l=Object.keys(h.vgenerator.cOffsets).length-h.prevInfo.columnIndexes.length,a=(l=h.vgenerator.cOffsets[l-1])<a?l:a),l=h.getTranslateY(n.top,o,s&&r===n.top?h.prevInfo:void 0,!0),h.parent.isFrozenGrid()&&!h.parent.enableVirtualMaskRow)||(h.parent.enableVirtualMaskRow?(o=n.top-h.translateY<0,l=Math.round(h.translateY)>l&&!o?Math.round(h.translateY):l,h.virtualEle.adjustTable(a,l)):h.virtualEle.adjustTable(a,h.translateY),h.parent.enableColumnVirtualization&&h.header.virtualEle.adjustTable(a,0))}},Qee.prototype.scrollListeners=function(e){this.scrollAfterEdit(),this.shouldPreventScrolling(e),this.parent.root.enablePersistence&&(this.parent.root.scrollPosition=e.offset);var t,i,n,o=e.sentinel,r=this.parent.getRowHeight(),s=this.parent.pageSettings.pageSize-Math.ceil(this.parent.pageSettings.pageSize/2),a=(je(this.parent.contentModule)||(t=this.parent.getContent().querySelector(".e-content")),s*r),l=e.offset.top-this.translateY<0&&"downArrow"!==this.activeKey,a=Math.ceil(e.offset.top-this.translateY)+r>=a,h="selectedRowIndex",d=this.parent.currentViewData,p="index";l&&"right"!==e.direction&&"left"!==e.direction&&!je(t)?(i=+(this.parent.height.toString().indexOf("%")<0?parseInt(this.parent.height.toString(),10):this.parent.element.getBoundingClientRect().height),i=0<(i=Math.floor(t.scrollTop/r)+Math.ceil(i/r)-this.parent.pageSettings.pageSize)?i:0,!je(this[h])&&-1!==this[h]&&i!==this[h]&&this.parent.rowHeight*this.parent.pageSettings.pageSize<t.scrollTop&&!this.parent.allowRowDragAndDrop&&(i=this[h]),this.startIndex=i,this.endIndex=i+this.parent.pageSettings.pageSize,this.endIndex>this.totalRecords&&(i=this.totalRecords,n=this.endIndex%i,this.endIndex=i,this.startIndex=this.startIndex-n<0?0:this.startIndex-n),d.length&&d[0][p]>=this.parent.pageSettings.pageSize/2&&d[0][p]-this.startIndex<this.parent.pageSettings.pageSize/2&&this.parent.selectionModule&&this.parent.selectionModule.isRowSelected&&(this.startIndex=d[0][p]-this.parent.pageSettings.pageSize/2,this.endIndex=this.startIndex+this.parent.pageSettings.pageSize),i=Math.ceil(e.offset.top/r),i%=this.parent.pageSettings.pageSize,(n=0)===(n=je(this.parent.getRows()[parseInt(i.toString(),10)])||je(this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(i.toString(),10)])?n:+this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(i.toString(),10)].querySelector("td").getAttribute("index"))?this.endIndex-this.startIndex<this.parent.pageSettings.pageSize?this.translateY=je(this.endIndex)?0:(this.endIndex-this.parent.pageSettings.pageSize)*(this.parent.rowHeight||this.parent.getRowHeight()):this.startIndex===this[h]?this.translateY=e.offset.top:this.translateY=0<e.offset.top-s*r?e.offset.top-s*r+r:0:(0<this.parent.getFrozenColumns()&&(e.offset.top=e.offset.top+80),this.translateY=0<e.offset.top-s*r?e.offset.top-s*r+10:0)):a&&"right"!==e.direction&&"left"!==e.direction&&!je(t)&&(i=~~(t.scrollTop/r),n=!(this[h]+this.parent.pageSettings.pageSize<this.totalRecords),(s=(i=je(this[h])||-1===this[h]||i===this[h]||n||this.parent.allowRowDragAndDrop?i:this[h])+this.parent.pageSettings.pageSize)>this.totalRecords&&(s=i+(this.totalRecords-i)),this.startIndex=!n||je(this[h])?s-this.parent.pageSettings.pageSize:i,this.endIndex=s,i+this.parent.pageSettings.pageSize>this.totalRecords&&this.endIndex-this.startIndex<this.parent.pageSettings.pageSize/2&&this.endIndex-i<this.parent.pageSettings.pageSize/2&&(this.startIndex=s-this.parent.pageSettings.pageSize/2),d.length&&this.startIndex>d[0][p]&&this.startIndex-d[0][p]<this.parent.pageSettings.pageSize/2&&this.parent.selectionModule&&this.parent.selectionModule.isRowSelected&&(this.startIndex=d[0][p]+this.parent.pageSettings.pageSize/2),e.offset.top>r*this.totalRecords?this.translateY=this.getTranslateY(e.offset.top,t.getBoundingClientRect().height):this.totalRecords===this.endIndex?this.totalRecords===this.endIndex&&(this.parent.isEdit?this.translateY=this.totalRecords*r-this.parent.pageSettings.pageSize*r+r:this.translateY=this.totalRecords*r-this.parent.pageSettings.pageSize*r):0<this.parent.getFrozenColumns()?this.translateY=e.offset.top-(2*r+this.parent.pageSettings.pageSize):this.translateY=e.offset.top),a&&"up"!==e.direction&&e.offset.top<r*this.totalRecords||l||"right"===e.direction||"left"===e.direction||this.parent.dataSource instanceof me&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&(a||l)||GZ(this.parent)?(n=this.currentInfo=R("getInfoFromView",this).apply(this,[e.direction,o,e.offset]),this.previousInfo=n,this.prevInfo&&"refresh-virtual-block"!==n.event&&("Y"===o.axis&&this.prevInfo.blockIndexes.toString()===n.blockIndexes.toString()||"X"===o.axis&&this.prevInfo.columnIndexes.toString()===n.columnIndexes.toString()||this.parent.isFrozenGrid()&&this.parent.getVisibleFrozenLeftCount()>=n.columnIndexes[0]&&this.prevInfo.columnIndexes.toString().includes(n.columnIndexes.toString()))?(this.parent.removeMaskRow(),F.isIE&&this.parent.hideSpinner(),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,"Y"===o.axis&&this.restoreEditState()):(this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?n.columnIndexes:[]),h=(n.loadNext&&!n.loadSelf?n.nextInfo:n).page,this.parent.setProperties({pageSettings:{currentPage:h}},!0),a&&this.endIndex===this.totalRecords&&n.loadNext&&(n.loadNext=!1),this.requestType="virtualscroll","right"!==e.direction&&"left"!==e.direction&&(n.event="refresh-virtual-block"===n.event?"model-changed":n.event),this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(o.axis),this.parent.addShimmerEffect(),this.parent.notify("showGanttShimmer",{requestType:"showShimmer"})),this.parent.notify(n.event,{requestType:"virtualscroll",virtualInfo:n,focusElement:e.focusElement}))):this.parent.enableVirtualMaskRow&&(this.parent.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}))},Qee.prototype.shouldPreventScrolling=function(e){this.parent.element.querySelector(".e-addedrow")&&"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&0!==e.offset.top&&this.parent.closeEdit()},Qee.prototype.appendContent=function(e,t,i){var n,o,r,s;this.parent.dataSource instanceof me&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||GZ(this.parent)||this.parent.isFrozenGrid()&&(void 0===i.requestType||!je(i.virtualInfo)&&("right"===i.virtualInfo.direction||"left"===i.virtualInfo.direction))?(R("isExpandCollapse",i)&&(this.isRemoteExpand=!0),zee.prototype.appendContent.call(this,e,t,i),-1!==R("requestTypes",this).indexOf("isFrozen")&&(R("requestTypes",this).splice(R("requestTypes",this).indexOf("isFrozen"),1),this.requestType="isFrozen"===this.requestType?void 0:this.requestType)):(o=(n=i.virtualInfo.sentinelInfo&&"Y"===i.virtualInfo.sentinelInfo.axis&&R("currentInfo",this).page&&R("currentInfo",this).page!==i.virtualInfo.page?R("currentInfo",this):i.virtualInfo).columnIndexes[0]-1,o=this.getColumnOffset(o),s=void 0,this.parent.enableColumnVirtualization&&(this.header.virtualEle.adjustTable(o,0),r=n.columnIndexes,s=this.getColumnOffset(r[r.length-1])-this.getColumnOffset(r[0]-1)+"",this.header.virtualEle.setWrapperWidth(s)),this.virtualEle.setWrapperWidth(s,F.isIE||"edge"===F.info.name),(e=this.parent.createElement("tbody")).appendChild(t),this.getTable().querySelector("tbody").replaceWith(e),"virtualscroll"===i.requestType&&"Y"===i.virtualInfo.sentinelInfo.axis&&(this.isExpandCollapse=!1),this.isExpandCollapse&&0!==this.translateY?this.isExpandCollapse=!1:(this.translateY=this.translateY<0?0:this.translateY,R("virtualEle",this).adjustTable(o,this.translateY)),x("prevInfo",this.previousInfo||n,this),"virtualscroll"===i.requestType&&"X"===i.virtualInfo.sentinelInfo.axis&&this.parent.notify(OZ,{}),zee.prototype.focusCell.call(this,i),this.isAdd&&!this.parent.getContent().querySelector(".e-content").querySelector(".e-addedrow")&&"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.dataRowIndex>=this.startIndex?this.restoreNewRow():this.addRowIndex&&-1<this.addRowIndex&&(this.isAdd=!1,this.parent.isEdit=!1)),this.restoreEditState(),zee.prototype.restoreAdd.call(this),zee.prototype.ensureSelectedRowPosition.call(this))},Qee.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("data-ready",this.onDataReady),this.parent.off("content-ready",this.fn),this.parent.off("select-virtual-Row",this.toSelectVirtualRow),this.parent.off("dataBound",this.dataBoundEvent),this.parent.off("rowSelected",this.rowSelectedEvent),this.parent.off(CZ,this.virtualOtherAction),this.parent.off(xZ,this.indexModifier),this.parent.off("virtual-scroll-edit-action-begin",this.beginEdit),this.parent.off("virtual-scroll-add-action-begin",this.beginAdd),this.parent.off("virtual-scroll-edit-success",this.virtualEditSuccess),this.parent.off("edit-reset",this.resetIseditValue),this.parent.off("get-virtual-data",this.getData),this.parent.off("virtual-scroll-edit-cancel",this.cancelEdit),this.parent.off("select-row-on-context-open",this.toSelectRowOnContextOpen),this.parent.off("refresh-virtual-editform-cells",this.refreshCell),this.parent.off("virtaul-cell-focus",this.cellFocus),this.parent.off("virtual-scroll-edit",this.restoreEditState))},Qee);function Qee(e,t){e=zee.call(this,e,t)||this;return e.isExpandCollapse=!1,e.translateY=0,e.maxiPage=0,e.recordAdded=!1,e.startIndex=-1,e.endIndex=-1,e.preTranslate=0,e.isRemoteExpand=!1,e.isDataSourceChanged=!1,e.addEventListener(),e}jee(Gee,Uee=pY),Gee.prototype.observes=function(e,t,i){Uee.prototype.containerRect=R("options",this).container.getBoundingClientRect(),E.add(R("options",this).container,"scroll",this.virtualScrollHandlers(e,t,i),this),R("options",this).movableContainer&&(Uee.prototype.movableContainerRect=R("options",this).movableContainer.getBoundingClientRect(),E.add(R("options",this).movableContainer,"scroll",this.virtualScrollHandlers(e,t,i),this))},Gee.prototype.clear=function(){this.lastPos=null},Gee.prototype.virtualScrollHandlers=function(s,a,l){var h=this,e="chrome"===F.info.name?200:100,d="options",p="movableEle",c="fromWheel",u=P(s,e),g=P(s,50),m=(this[d].prevTop=this[d].prevLeft=0,"isScrollByFocus");return function(e){var t,i,n,o,r;l.isEdit&&l.root.editModule[m]?l.root.editModule[m]=!1:(t=(h[d].movableContainer?h[d].container:e.target).scrollTop,i=(h[d].movableContainer?h[d].scrollbar:e.target).scrollLeft,n=h[d].prevTop<t?"down":"up",n=h[d].prevLeft===i?n:h[d].prevLeft<i?"right":"left",h[d].prevTop=t,h[d].prevLeft=i,o=h.sentinelInfo[n],r=0,h.newPos=t,null!=h.lastPos&&(r=h.newPos-h.lastPos),h.lastPos=h.newPos,h.timer&&clearTimeout(h.timer),h.timer=setTimeout(h.clear,0),(100<r||r<-100)&&e&&e.preventDefault&&(e.returnValue=!1,e.preventDefault()),-1!==h[d].axes.indexOf(o.axis)&&(h.containerRect=h[d].container.getBoundingClientRect(),r=h.check(n),o.entered&&("X"===o.axis||l.enableVirtualMaskRow)&&(!h[p]||"right"!=n&&"left"!=n?a(h.element,o,n,{top:t,left:i},h[c],r):a(h[p],o,n,{top:t,left:i},h[c],r)),r&&(e=g,("X"===o.axis?e:l.dataSource instanceof me&&void 0!==l.dataSource.dataSource.url&&!l.dataSource.dataSource.offline&&""!==l.dataSource.dataSource.url||GZ(l)||l.enableVirtualMaskRow?e=l.enableVirtualMaskRow?u:e:s)({direction:n,sentinel:o,offset:{top:t,left:i},focusElement:document.activeElement})),h[c]=!1))}};var Uee,qee=Gee;function Gee(){var e=null!==Uee&&Uee.apply(this,arguments)||this;return e.isWheeling=!1,e.newPos=0,e.lastPos=0,e.timer=0,e}Yee=function(e,t){return(Yee=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])}))(e,t)};var Yee,jee=function(e,t){function i(){this.constructor=e}Yee(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Xee=(Kee.prototype.getModuleName=function(){return"virtualScroll"},Kee.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ZJ,this.collapseExpandVirtualchilds,this),this.parent.on($J,this.virtualPageAction,this),this.parent.on(SZ,this.destroy,this))},Kee.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ZJ,this.collapseExpandVirtualchilds),this.parent.off($J,this.virtualPageAction),this.parent.off(SZ,this.destroy))},Kee.prototype.collapseExpandVirtualchilds=function(t){this.parent.grid.notify(CZ,{isExpandCollapse:!0}),this.expandCollapseRec=t.record,t.record.expanded="collapse"!==t.action,this.parent.flatData.map(function(e){return e.expanded=(e.uniqueID===t.record.uniqueID&&e.expanded!==t.record.expanded?t.record:e).expanded});var e={result:this.parent.flatData,row:t.row,action:t.action,record:t.record,count:this.parent.flatData.length},i=(this.handleSelection(),R("isCollapseAll",this.parent)?"collapseAll":"refresh");R("grid.renderModule",this.parent).dataManagerSuccess(e,{requestType:i})},Kee.prototype.handleSelection=function(){"Cell"!==this.parent.selectionSettings.mode&&("Row"!==this.parent.selectionSettings.mode||this.parent.selectionSettings.persistSelection)||this.parent.grid.clearSelection(),R("isCollapseAll",this.parent)&&this.parent.selectionSettings.persistSelection&&0<this.parent.getSelectedRecords().length&&(this.prevSelectedRecord=this.parent.getSelectedRecords(),this.parent.grid.clearSelection())},Kee.prototype.virtualPageAction=function(e){var t,i,n,o=this,r=new me(e.result),s=new ba("expanded","notequal",null).or("expanded","notequal",void 0),s=r.executeLocal((new ya).where(s)).filter(function(e){return JZ(o.parent,e)}),a=(this.visualData=s,e.count=s.length,this.parent.grid.notify(AZ,{data:s}),{startIndex:-1,endIndex:-1,count:e.count,requestType:e.actionArgs.requestType}),l=(this.parent.grid.notify(xZ,a),a.startIndex),h=a.endIndex;e.count=s.length,-1===l&&-1===h?(n=new ya,t=this.parent.grid.pageSettings.pageSize,i=this.parent.grid.pageSettings.currentPage,n=n.skip(t*(i-1)).take(t),r.dataSource.json=s,e.result=r.executeLocal(n)):(("filtering"===(i=e.actionArgs.requestType)||"collapseAll"===i||"searching"===i||"refresh"===i&&R("isExpandAll",this.parent)||"refresh"===i&&this.parent.enableCollapseAll&&h>s.length&&je(this.expandCollapseRec))&&(l=0,h=this.parent.grid.pageSettings.pageSize,this.parent.grid.getContent().firstElementChild.scrollTop=0,this.parent.grid.notify(CZ,{setTop:!0})),("save"===i&&e.actionArgs.index>=a.count-this.parent.grid.pageSettings.pageSize||"refresh"===i&&this.parent.isGantt&&this.parent.isAddedFromGantt)&&(this.setEndIndexToGantt&&(this.ganttEndIndex=a.endIndex),!(a.endIndex+this.parent.pageSettings.pageSize>=a.count&&this.parent.root&&a.count-this.ganttEndIndex==this.visualData.length-this.parent.root.previousFlatData.length)&&this.parent.isGantt&&this.parent.isAddedFromGantt||(l=a.startIndex+(a.count-a.endIndex),h=a.count,this.setEndIndexToGantt=!1),this.ganttEndIndex=h,this.parent.isAddedFromGantt=!1),t=jB(this.parent.grid.contentModule.virtualEle.wrapper).height,!je(this.expandCollapseRec)&&("virtualscroll"===e.actionArgs.requestType||"refresh"===e.actionArgs.requestType&&l!==this.prevstartIndex)&&l<this.parent.getRows().length&&h<=l+this.parent.getRows().length&&0===t&&(l=0),"save"===e.actionArgs.requestType&&l!==this.prevstartIndex&&l<this.parent.getRows().length&&h<=l+this.parent.getRows().length&&0===t&&(h=(l=0)+this.parent.grid.pageSettings.pageSize),je(this.expandCollapseRec)||(r=this.parent.grid.pageSettings.pageSize,n=s.indexOf(this.expandCollapseRec),s.slice(n,n+r).length<r&&0<=n&&0!==l?(n=s.length-r,(h=s.length)-l<r&&(l=n=0<n?n:0,s.indexOf(this.expandCollapseRec)>s.length-r/2)&&(i=l*this.parent.grid.getRowHeight(),this.parent.grid.contentModule.translateY=i,this.parent.grid.contentModule.virtualEle.adjustTable(0,i))):R("isCollapseAll",this.parent)&&(h=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify(CZ,{setTop:!(l=0)}))),"collapseAll"!==this.prevrequestType||"virtualscroll"!==e.actionArgs.requestType||je(this.parent.idMapping)||0!==l||(h=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify(CZ,{setTop:!(l=0)})),!this.parent.enableCollapseAll&&!this.parent.expandStateMapping||je(this.expandCollapseRec)||(e.count<this.parent.getRows()[0].getBoundingClientRect().height?l=0:this.parent.isExpandAll||0!==this.parent.grid.contentModule.translateY||(l=-1===this.prevstartIndex?0:this.prevstartIndex)),this.expandCollapseRec=null,l=l<0?0:l,0===h&&0<s.length?e.result=s:e.result=s.slice(l,h),this.prevstartIndex=l,this.prevendIndex=h,this.prevrequestType=e.actionArgs.requestType),this.parent.notify("updateAction",e)},Kee.prototype.destroy=function(){this.removeEventListener()},Kee.prototype.updateSelection=function(e){if(e.isHeaderCheckboxClicked&&this.parent.grid.currentViewData.length!==this.parent.grid.selectionModule.selectedRowIndexes.length)for(var t=0;t<this.parent.getRows().length;t++)this.parent.getRows()[parseInt(t.toString(),10)].getElementsByClassName("e-frame e-icons e-uncheck").length&&this.parent.grid.selectionModule.updateRowSelection(this.parent.getRows()[parseInt(t.toString(),10)],this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)].index)},Kee);function Kee(e){this.prevstartIndex=-1,this.setEndIndexToGantt=!0,this.prevendIndex=-1,this.prevSelectedRecord=[],this.parent=e,IP.Inject(Zee),this.addEventListener()}jee($ee,Jee=xY),$ee.prototype.getModuleName=function(){return"treeVirtualScroll"},$ee.prototype.instantiateRenderers=function(){var e=R("parent",this),t=(R("parent",this).log(["limitation","virtual_height"],"virtualization"),R("locator",this).getService("rendererFactory"));e.enableColumnVirtualization&&R("addRenderer",t).apply(t,[RA.Header,new wY(R("parent",this),R("locator",this))]),R("addRenderer",t).apply(t,[RA.Content,new Wee(R("parent",this),R("locator",this))]),this.ensurePageSize()},$ee.prototype.ensurePageSize=function(){var e=R("parent",this),t=e.getRowHeight();je(e.height)||"string"!=typeof e.height||-1===e.height.indexOf("%")||(e.element.style.height=e.height);var t=2*~~((e.height.toString().indexOf("%")<0?parseInt(e.height.toString(),10):e.element.getBoundingClientRect().height)/t),i=e.pageSettings.pageSize;e.setProperties({pageSettings:{pageSize:i<t?t:i}},!0)};var Jee,Zee=$ee;function $ee(e,t){e=Jee.call(this,e,t)||this;return R("parent",e).off("initial-load",R("instantiateRenderer",e),e),R("parent",e).on("initial-load",e.instantiateRenderers,e),e}ete.prototype.addEventListener=function(){this.parent.on("rowExpandCollapse",this.rowExpandCollapse,this),this.parent.on("dataBoundArg",this.dataBoundArg,this),this.parent.grid.on("dblclick",this.dblClickHandler,this)},ete.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("rowExpandCollapse",this.rowExpandCollapse),this.parent.off("dataBoundArg",this.dataBoundArg),this.parent.grid.off("dblclick",this.dblClickHandler))},ete.prototype.rowExpandCollapse=function(t){var e,i=this.parent.getDataRows(),n=this.parent.getRows(),o=0<this.parent.getFrozenLeftColumnsCount()||0<this.parent.getFrozenRightColumnsCount();o&&(e=this.parent.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+t.record.index+"level"+(t.record.level+1))}));for(var r=t.detailrows.length?t.detailrows:i.filter(function(e){return e.querySelector(".e-gridrowindex"+t.record.index+"level"+(t.record.level+1))}),s=0;s<r.length;s++){var a=r[parseInt(s.toString(),10)],l=this.parent.grid.getRowObjectFromUID(a.getAttribute("data-Uid")).data,h=(!je(i)&&0<a.parentElement.firstElementChild.clientHeight&&(a.style.height=a.parentElement.firstElementChild.clientHeight+"px"),this.parent.toggleRowVisibility(a,t.action),o&&e.length&&this.parent.toggleRowVisibility(e[parseInt(s.toString(),10)],t.action),"e-childrow-hidden"===t.action?".e-treecolumn-container .e-treegridcollapse":".e-treecolumn-container .e-treegridexpand");if(n[a.rowIndex].querySelector(h)){for(var d=[],p=0;p<i.length;p++)i[parseInt(p.toString(),10)].querySelector(".e-gridrowindex"+l.index+"level"+(l.level+1))&&d.push(i[parseInt(p.toString(),10)]);d.length&&(a=this.parent.getCurrentViewRecords()[d[0].rowIndex],this.rowExpandCollapse({detailrows:d,action:t.action,record:a}))}}},ete.prototype.dblClickHandler=function(e){A(e.target,"e-rowcell")&&this.parent.grid.editSettings.allowEditOnDblClick&&"Cell"!==this.parent.editSettings.mode&&!e.target.classList.contains("e-treegridcollapse")&&!e.target.classList.contains("e-treegridexpand")&&this.parent.startEdit(A(e.target,"e-row"))},ete.prototype.dataBoundArg=function(){this.parent.getColumns().filter(function(e){return e.showCheckbox}).length&&this.parent.freezeModule&&this.parent.initialRender&&U([this.parent.element.getElementsByClassName("e-grid")[0]],"e-checkselection")},ete.prototype.destroy=function(){this.removeEventListener()},ete.prototype.getModuleName=function(){return"freeze"};jee=ete;function ete(e){IP.Inject(xK),this.parent=e,this.addEventListener()}ite.prototype.openColumnChooser=function(e,t){return this.parent.grid.columnChooserModule.openColumnChooser(e,t)},ite.prototype.destroy=function(){},ite.prototype.getModuleName=function(){return"ColumnChooser"};var tte=ite;function ite(e){IP.Inject(mX),this.parent=e}ote.prototype.getModuleName=function(){return"infiniteScroll"},ote.prototype.addEventListener=function(){this.parent.on($J,this.infinitePageAction,this),this.parent.on("infinite-remote-expand",this.infiniteRemoteExpand,this),this.parent.grid.on("delete-complete",this.infiniteDeleteHandler,this),this.parent.grid.on("infinite-edit-handler",this.infiniteEditHandler,this),this.parent.grid.on("infinite-crud-cancel",this.createRows,this),this.parent.grid.on("content-ready",this.contentready,this)},ote.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("infinite-remote-expand",this.infiniteRemoteExpand),this.parent.grid.off("delete-complete",this.infiniteDeleteHandler),this.parent.grid.off("infinite-edit-handler",this.infiniteEditHandler),this.parent.off($J,this.infinitePageAction),this.parent.grid.off("infinite-crud-cancel",this.createRows),this.parent.grid.off("content-ready",this.contentready))},ote.prototype.infiniteRemoteExpand=function(e){for(var t=this.parent.grid.getRowsObject(),i=this.parent.grid.infiniteScrollModule.serviceLocator,n=new yD(i,null,this.parent.grid),o=this.parent.getRows(),r=e.index===o.length-1?"after":"before",s=this.parent.grid.getColumns(),a=this.parent.grid.infiniteScrollModule.generateRows(e.childData,e),l=[],h=0;h<a.length;h++)l.push(n.render(a[parseInt(h.toString(),10)],s));t.splice.apply(t,[e.index+1,0].concat(a));for(h=0;h<l.length;h++)("after"==r?o[e.index+h]:o[e.index+h+1])[r](l[parseInt(h.toString(),10)]),o.splice(e.index+1+h,0,l[parseInt(h.toString(),10)]);eF(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0)},ote.prototype.contentready=function(){var e;this.parent.infiniteScrollSettings.enableCache&&!je(this.parent.editModule)&&(this.parent.editModule[e="updateIndex"](this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),this.parent.getFrozenColumns())&&this.parent.editModule[e](this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords())},ote.prototype.infinitePageAction=function(e){var t=new me(e.result),i=new ba("expanded","notequal",null).or("expanded","notequal",void 0),i=t.executeLocal((new ya).where(i)),n=R("actionArgs",e.actionArgs),o=R("actions",this.parent.grid.infiniteScrollModule);this.parent.grid.infiniteScrollModule.isInitialRender&&!this.parent.initialRender&&(this.parent.grid.pageSettings.currentPage=1);var r,s,a,l,h,o=!!o.some(function(e){return e===n.requestType})||!!this.parent.initialRender;this.visualData=i,e.count=i.length,R("isPrinting",e.actionArgs)?e.result=i:(h=new ya,(r=this.parent.infiniteScrollSettings.enableCache)&&this.parent.infiniteScrollSettings.initialBlocks>this.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks),o=o?this.parent.grid.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks:this.parent.grid.pageSettings.pageSize,l=this.parent.grid.pageSettings.currentPage,h=je(n)?h.page(l,o):(s=R("lastIndex",this.parent.grid.infiniteScrollModule),a=R("firstIndex",this.parent.grid.infiniteScrollModule),r||"delete"!==n.requestType?r&&"delete"===n.requestType||"save"===n.requestType&&"add"===n.action?(h=h.skip(a)).take(this.parent.infiniteScrollSettings.initialBlocks*this.parent.pageSettings.pageSize):h.page(l,o):(a=s-n.data.length+1,l=n.data.length,h.skip(a).take(l))),t.dataSource.json=i,r||je(n)||"save"!==n.requestType||"add"!==n.action?e.result=t.executeLocal(h):e.result=[n.data]),this.parent.notify("updateAction",e)},ote.prototype.infiniteEditHandler=function(e){var t=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData,i=Object.keys(t);if("delete"===e.e.requestType&&1<e.result.length)for(var n=1;n<e.result.length;n++)t[i[i.length-1]].push(e.result[parseInt(n.toString(),10)])},ote.prototype.infiniteDeleteHandler=function(e){var t,i,n;"delete"===e.requestType&&(n=this.parent.grid.getRowsObject(),i=this.parent.getRows(),e=e.data instanceof Array?e.data:[e.data],t=this.parent.grid.getPrimaryKeyFieldNames()[0],this.removeRows(i,n,e,t,!0),0<this.parent.getFrozenColumns())&&(i=this.parent.grid.getRowsObject(),n=this.parent.grid.getRows(),this.removeRows(n,i,e,t))},ote.prototype.removeRows=function(n,o,r,s,a){for(var l=this,e=0;e<r.length;e++)!function(i){o.filter(function(e,t){e.data[""+s]===r[parseInt(i.toString(),10)][""+s]&&(a&&(e=Math.ceil((t+1)/l.parent.grid.pageSettings.pageSize),l.parent.grid.infiniteScrollModule.resetInfiniteCurrentViewData(e,t)),o.splice(t,1),ue(n[parseInt(t.toString(),10)]),n.splice(t,1))})}(e)},ote.prototype.createRows=function(e){var t,i=e.args.e,n=e.row,o=this.parent.grid.infiniteScrollModule.serviceLocator,r=new yD(o,null,this.parent.grid),s=this.parent.getCurrentViewRecords(),a=e.isMovable?this.parent.grid.getRows():this.parent.grid.getDataRows(),l=(e.isFrozenRight?this.parent.element.querySelector(".e-frozen-right-content"):(this.parent.grid.isFrozenGrid()?(e.isMovable,this.parent.grid):this.parent).getContent()).querySelector("tbody");this.parent.frozenRows&&(l=e.isFrozenRows&&"add"!==this.parent.grid.infiniteScrollModule.requestType||!e.isFrozenRows&&"add"===this.parent.grid.infiniteScrollModule.requestType?(this.parent.grid.isFrozenGrid()?!e.isMovable&&e.isFrozenRight?this.parent.element.querySelector(".e-frozen-right-header"):this.parent.grid.getHeaderContent():this.parent.getHeaderContent()).querySelector("tbody"):l);for(var h="addRowIndex",d=this.parent.editModule[h],p=0;p<n.length;p++){var c=r.render(n[parseInt(p.toString(),10)],this.parent.grid.getColumns());"save"===i.requestType&&"add"===i.action?-1!==R("selectedIndex",this.parent.editModule)&&"Top"!==this.parent.editSettings.newRowPosition?"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition?(t="after",d+=ZZ(s[parseInt(d.toString(),10)]).length,"Child"===this.parent.editSettings.newRowPosition&&--d,a[parseInt(d.toString(),10)][""+t](c)):"Above"===this.parent.editSettings.newRowPosition&&a[this.parent.editModule[h]][""+(t="before")](c):"Bottom"===this.parent.editSettings.newRowPosition?l.appendChild(c):l.insertBefore(c,l.firstElementChild):"delete"===i.requestType&&l.appendChild(c)}e.cancel=!0},ote.prototype.destroy=function(){this.removeEventListener()};var nte=ote;function ote(e){this.parent=e,IP.Inject(BK),this.addEventListener()}eee.Inject(mee,wee,Tee,iee,See,xee,oee,Dee,yee,fJ,Oee,kee,Lee,o$,Xee,Vee,see,jee,tte,MJ,nte);Dr=Object.freeze({__proto__:null,TreeGrid:eee,load:"load",rowDataBound:BJ,dataBound:FJ,queryCellInfo:LJ,beforeDataBound:RJ,actionBegin:OJ,dataStateChange:NJ,actionComplete:VJ,rowSelecting:_J,rowSelected:HJ,checkboxChange:zJ,rowDeselected:jJ,toolbarClick:WJ,beforeExcelExport:QJ,beforePdfExport:UJ,resizeStop:qJ,expanded:GJ,expanding:YJ,collapsed:XJ,collapsing:KJ,remoteExpand:JJ,localPagedExpandCollapse:ZJ,pagingActions:$J,printGridInit:eZ,contextMenuOpen:tZ,contextMenuClick:iZ,beforeCopy:nZ,beforePaste:oZ,savePreviousRowPosition:"savePreviousRowPosition",crudAction:rZ,beginEdit:sZ,beginAdd:aZ,recordDoubleClick:lZ,cellSave:hZ,cellSaved:dZ,cellEdit:pZ,batchDelete:cZ,batchCancel:uZ,batchAdd:gZ,beforeBatchDelete:mZ,beforeBatchAdd:fZ,beforeBatchSave:yZ,batchSave:vZ,keyPressed:bZ,updateData:"update-data",doubleTap:wZ,virtualColumnIndex:"virtualColumnIndex",virtualActionArgs:CZ,destroy:SZ,dataListener:AZ,indexModifier:xZ,beforeStartEdit:IZ,beforeBatchCancel:TZ,batchEditFormRendered:"batcheditform-rendered",detailDataBound:EZ,rowDrag:DZ,rowDragStartHelper:MZ,rowDrop:kZ,rowDragStart:PZ,rowsAdd:BZ,rowsRemove:FZ,rowdraging:LZ,rowDropped:RZ,autoCol:OZ,rowDeselecting:NZ,headerContent:"e-headercontent",movableContent:VZ,movableHeader:"e-movableheader",frozenContent:_Z,frozenHeader:"e-frozenheader",content:"e-content",table:"e-table",leftRight:"Left-Right",frozenRight:"frozen-right",frozenLeft:"frozen-left",ariaColIndex:"aria-colindex",ariaRowIndex:HZ,actionFailure:zZ,DataManipulation:w$,Reorder:iee,Resize:oee,RowDD:see,Column:c0,TreeGridColumn:Dr,StackedColumn:Pr,EditSettings:M$,Predicate:yJ,FilterSettings:mJ,PageSettings:x$,SearchSettings:d$,SelectionSettings:g$,AggregateColumn:k$,AggregateRow:D$,SortDescriptor:z$,SortSettings:_$,RowDropSettings:$$,InfiniteScrollSettings:H$,LoadingIndicator:pJ,Render:f$,TreeVirtualRowModelGenerator:uee,isRemoteData:qZ,isCountRequired:GZ,isCheckboxcolumn:YZ,isFilterChildHierarchy:XZ,findParentRecords:KZ,getExpandStatus:JZ,findChildrenRecords:ZZ,isOffline:$Z,extendArray:e$,getPlainData:t$,getParentData:i$,isHidden:n$,get ToolbarItem(){return v$},get ContextMenuItems(){return b$},Filter:mee,ExcelExport:yee,PdfExport:fJ,Page:wee,Toolbar:See,Aggregate:xee,Sort:Tee,TreeClipboard:QZ,ColumnMenu:Dee,ContextMenu:kee,Edit:Lee,CommandColumn:Oee,Selection:o$,DetailRow:Vee,VirtualScroll:Xee,TreeVirtual:Zee,Freeze:jee,ColumnChooser:tte,Logger:MJ,treeGridDetails:PJ,InfiniteScroll:nte}),Pr=Object.freeze({__proto__:null,TextStyle:Wo,TooltipBorder:qo,AreaBounds:Xo,ToolLocation:Zo,Tooltip:tr,getTooltipThemeColor:wo,measureText:So,withInAreaBounds:Ao,findDirection:xo,Size:Eo,Rect:Do,Side:Mo,CustomizeOption:Io,TextOption:ko,getElement:Bo,removeElement:Fo,drawSymbol:Lo,calculateShapes:Ro,PathOption:No,textElement:_o,TooltipLocation:jo,SvgRenderer:fo,CanvasRenderer:vo});function rte(e,t,i){var n,o,r=[];return e&&(o=void 0,t&&!je(i)&&(o=_re(t,i)),e=-1===(e=-1<e.lastIndexOf("!")?e.substring(e.lastIndexOf("!")+1):e).indexOf(":")?e+":"+e:e,new RegExp(/^(?=.*[a-zA-Z])(?=.*\d)/g).test(e)||(t=e.split(":"),e=je(e.match(/[0-9]/))?t[0]+"1:"+t[1]+(o?o.rowCount-1:"1"):"A"+t[0]+":"+(o?dte(o.colCount):"A")+t[1]),e.split(":").forEach(function(e){n=ste(e),r.push(n[0]),r.push(n[1])})),r}function ste(e){return[parseInt(e.match(/\d+/)[0],10)-1,ate(e.match(/[A-Z]+/i)[0].toUpperCase())]}function ate(e){for(var t=0,i=(e=e.split("").reverse().join("")).length-1;0<=i;i--)t+=(e[i].charCodeAt(0)-64)*Math.pow(26,i);return t-1}function lte(e,t){return dte(t+1)+(e+1)}function hte(e){return lte(e[0],e[1])+":"+(je(e[2])?lte(e[0],e[1]):lte(e[2],e[3]))}function dte(e){return 1<e/26?dte(e%26==0?e/26-1:Math.floor(e/26))+String.fromCharCode(e%26==0?"Z".charCodeAt(0):64+e%26):String.fromCharCode(64+e)}function pte(e,t,i){return rte(cte(e),t,i)}function cte(e){var t=e.lastIndexOf("!");return-1<t?e.substring(t+1):e}function ute(e){return e.name+"!"+e.selectedRange}function gte(e,t){var i=mte(e,t);return{sheetIndex:i,indices:pte(t,e,i)}}function mte(e,t){t=-1<t.indexOf("!")?Bre(e,Lre(t)):e.activeSheetIndex;return t}function fte(e){var t=e.slice();return e[0]>e[2]&&yte(t,0,2),e[1]>e[3]&&yte(t,1,3),t}function yte(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function vte(e){return e[0]===e[2]&&e[1]===e[3]}function bte(e,t,i,n,o,r){return new wte(e,t,i,n,o,r)}Cte.prototype.terminate=function(){this.worker.terminate(),URL.revokeObjectURL(this.workerUrl)},Cte.prototype.initWorker=function(){var e=new Blob([this.getFnCode()],{type:"text/javascript"});this.workerUrl=URL.createObjectURL(e),this.worker=new Worker(this.workerUrl),this.worker.onmessage=this.messageFromWorker.bind(this),this.worker.onerror=this.onError.bind(this),this.parent.isVue?(e=JSON.parse(JSON.stringify(this.workerData)),this.worker.postMessage(e)):this.worker.postMessage(this.workerData)},Cte.prototype.messageFromWorker=function(e){this.terminate(),this.defaultListener.apply(this.context,[e.data])},Cte.prototype.onError=function(e){if(this.terminate(),!e.message||!e.message.includes("FormData"))throw e.message||e;this.defaultListener.apply(this.context,[{isFormDataError:!0}])},Cte.prototype.getFnCode=function(){var e,t,i="",n="",o=!1;if("function"==typeof this.workerTask)this.workerTask.toString().indexOf("function")<0?n="function "+this.workerTask.toString():(n=this.workerTask.toString(),o=!0),i+="self.workerTask = "+n+"; \n";else if("object"==typeof this.workerTask)for(t=Object.keys(this.workerTask),e=0;e<t.length;e++)this.workerTask[t[e]].toString().indexOf("function")<0?n="function "+this.workerTask[t[e]].toString():(n=this.workerTask[t[e]].toString(),o=!0),i+=(0===e?"self.workerTask":t[e])+"= "+n+"; \n";return i+="self.onmessage = "+(o?"":" function ")+(this.preventCallback?this.getMessageFn:this.getCallbackMessageFn).toString()+"; \n"},Cte.prototype.getCallbackMessageFn=function(e){postMessage(this.workerTask.apply(this,e.data))},Cte.prototype.getMessageFn=function(e){this.workerTask.apply(this,e.data)};var wte=Cte;function Cte(e,t,i,n,o,r){this.preventCallback=!1,this.context=e,this.workerTask=t,this.defaultListener=i,this.workerData=n,this.parent=r,o&&(this.preventCallback=!0),this.initWorker()}function Ste(e,t){return(t=void 0===t?[]:t).push({member:"dataBind",args:[e]}),t.push({member:"workbookProtectSheet",args:[e]}),e.allowSave&&t.push({member:"workbookSave",args:[e]}),e.allowPrint&&t.push({member:"print",args:[e]}),e.allowOpen&&t.push({member:"workbookOpen",args:[e]}),e.allowEditing&&(t.push({member:"workbookEdit",args:[e]}),t.push({member:"workbookFormula",args:[e]})),e.allowNumberFormatting&&t.push({member:"workbookNumberFormat",args:[e]}),e.allowCellFormatting&&t.push({member:"workbookcellformat",args:[e]}),e.allowSorting&&t.push({member:"workbookSort",args:[e]}),e.allowHyperlink&&t.push({member:"workbookHyperlink",args:[e]}),e.allowFiltering&&t.push({member:"workbookFilter",args:[e]}),e.allowFindAndReplace&&t.push({member:"workbookfindAndReplace",args:[e]}),e.allowInsert&&t.push({member:"workbookinsert",args:[e]}),e.allowDelete&&t.push({member:"workbookdelete",args:[e]}),e.allowDataValidation&&t.push({member:"workbookDataValidation",args:[e]}),e.allowMerge&&t.push({member:"workbookmerge",args:[e]}),e.allowCellFormatting&&t.push({member:"workbookConditionalFormatting",args:[e]}),e.allowImage&&t.push({member:"workbookImage",args:[e]}),e.allowChart&&t.push({member:"workbookChart",args:[e]}),e.allowAutoFill&&t.push({member:"workbookautofill",args:[e]}),t}Ate=function(e,t){return(Ate=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])}))(e,t)};var Ate,xte,M$=function(e,t){function i(){this.constructor=e}Ate(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},yJ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},mJ=(M$(Ite,xte=n),yJ([e("Calibri")],Ite.prototype,"fontFamily",void 0),yJ([e("bottom")],Ite.prototype,"verticalAlign",void 0),yJ([e("left")],Ite.prototype,"textAlign",void 0),yJ([e("0pt")],Ite.prototype,"textIndent",void 0),yJ([e("#000000")],Ite.prototype,"color",void 0),yJ([e("#ffffff")],Ite.prototype,"backgroundColor",void 0),yJ([e("normal")],Ite.prototype,"fontWeight",void 0),yJ([e("normal")],Ite.prototype,"fontStyle",void 0),yJ([e("11pt")],Ite.prototype,"fontSize",void 0),yJ([e("none")],Ite.prototype,"textDecoration",void 0),yJ([e("")],Ite.prototype,"border",void 0),yJ([e("")],Ite.prototype,"borderTop",void 0),yJ([e("")],Ite.prototype,"borderBottom",void 0),yJ([e("")],Ite.prototype,"borderLeft",void 0),yJ([e("")],Ite.prototype,"borderRight",void 0),Ite);function Ite(){return null!==xte&&xte.apply(this,arguments)||this}M$(Ete,Tte=n),yJ([e()],Ete.prototype,"sheetIndex",void 0),yJ([e()],Ete.prototype,"filterRange",void 0),yJ([e(!1)],Ete.prototype,"hasFilter",void 0),yJ([e()],Ete.prototype,"column",void 0),yJ([e()],Ete.prototype,"criteria",void 0),yJ([e()],Ete.prototype,"value",void 0),yJ([e()],Ete.prototype,"dataType",void 0),yJ([e()],Ete.prototype,"predicates",void 0);var Tte,x$=Ete;function Ete(){return null!==Tte&&Tte.apply(this,arguments)||this}M$(Mte,Dte=n),yJ([e()],Mte.prototype,"sortRange",void 0),yJ([e()],Mte.prototype,"columnIndex",void 0),yJ([e()],Mte.prototype,"order",void 0),yJ([e()],Mte.prototype,"sheetIndex",void 0);var Dte,d$=Mte;function Mte(){return null!==Dte&&Dte.apply(this,arguments)||this}M$(Bte,kte=n),yJ([e("")],Bte.prototype,"name",void 0),yJ([e("")],Bte.prototype,"scope",void 0),yJ([e("")],Bte.prototype,"comment",void 0),yJ([e("")],Bte.prototype,"refersTo",void 0);var kte,Pte=Bte;function Bte(){return null!==kte&&kte.apply(this,arguments)||this}M$(Lte,Fte=n),yJ([e(!1)],Lte.prototype,"selectCells",void 0),yJ([e(!1)],Lte.prototype,"selectUnLockedCells",void 0),yJ([e(!1)],Lte.prototype,"formatCells",void 0),yJ([e(!1)],Lte.prototype,"formatRows",void 0),yJ([e(!1)],Lte.prototype,"formatColumns",void 0),yJ([e(!1)],Lte.prototype,"insertLink",void 0);var Fte,g$=Lte;function Lte(){return null!==Fte&&Fte.apply(this,arguments)||this}M$(Ote,Rte=n),yJ([e("")],Ote.prototype,"address",void 0);var Rte,k$=Ote;function Ote(){return null!==Rte&&Rte.apply(this,arguments)||this}M$(Vte,Nte=n),yJ([e("WholeNumber")],Vte.prototype,"type",void 0),yJ([e("Between")],Vte.prototype,"operator",void 0),yJ([e("0")],Vte.prototype,"value1",void 0),yJ([e("0")],Vte.prototype,"value2",void 0),yJ([e(!0)],Vte.prototype,"ignoreBlank",void 0),yJ([e(!0)],Vte.prototype,"inCellDropDown",void 0),yJ([e(!1)],Vte.prototype,"isHighlighted",void 0),yJ([e("")],Vte.prototype,"address",void 0);var Nte,D$=Vte;function Vte(){return null!==Nte&&Nte.apply(this,arguments)||this}M$(Hte,_te=n),yJ([e("General")],Hte.prototype,"format",void 0),yJ([t({},mJ)],Hte.prototype,"style",void 0),yJ([e(!0)],Hte.prototype,"isLocked",void 0);var _te,z$=Hte;function Hte(){return null!==_te&&_te.apply(this,arguments)||this}M$(jte,zte=n),yJ([e("GreaterThan")],jte.prototype,"type",void 0),yJ([t({},z$)],jte.prototype,"format",void 0),yJ([e("RedFT")],jte.prototype,"cFColor",void 0),yJ([e("")],jte.prototype,"value",void 0),yJ([e("")],jte.prototype,"range",void 0),yJ([e("")],jte.prototype,"action",void 0);var zte,_$=jte;function jte(){return null!==zte&&zte.apply(this,arguments)||this}M$(Qte,Wte=n),yJ([e(!0)],Qte.prototype,"visible",void 0),yJ([e("Auto")],Qte.prototype,"position",void 0);var Wte,$$=Qte;function Qte(){return null!==Wte&&Wte.apply(this,arguments)||this}M$(qte,Ute=n),yJ([e(!1)],qte.prototype,"visible",void 0),yJ([e("Auto")],qte.prototype,"position",void 0);var Ute,H$=qte;function qte(){return null!==Ute&&Ute.apply(this,arguments)||this}M$(Yte,Gte=n),yJ([e("")],Yte.prototype,"color",void 0),yJ([e(1)],Yte.prototype,"width",void 0);var Gte,pJ=Yte;function Yte(){return null!==Gte&&Gte.apply(this,arguments)||this}M$(Kte,Xte=n),yJ([e(!1)],Kte.prototype,"visible",void 0),yJ([e("Circle")],Kte.prototype,"shape",void 0),yJ([e(5)],Kte.prototype,"size",void 0),yJ([e(null)],Kte.prototype,"fill",void 0),yJ([e(!0)],Kte.prototype,"isFilled",void 0),yJ([t({},pJ)],Kte.prototype,"border",void 0);var Xte,fJ=Kte;function Kte(){return null!==Xte&&Xte.apply(this,arguments)||this}M$(Zte,Jte=n),yJ([e(0)],Zte.prototype,"width",void 0);var Jte,Oee=Zte;function Zte(){return null!==Jte&&Jte.apply(this,arguments)||this}M$(eie,$te=n),yJ([e(0)],eie.prototype,"width",void 0);var $te,Vee=eie;function eie(){return null!==$te&&$te.apply(this,arguments)||this}M$(iie,tie=n),yJ([e("")],iie.prototype,"title",void 0),yJ([t({},Oee)],iie.prototype,"majorGridLines",void 0),yJ([t({},Vee)],iie.prototype,"minorGridLines",void 0),yJ([e(!0)],iie.prototype,"visible",void 0);var tie,jee=iie;function iie(){return null!==tie&&tie.apply(this,arguments)||this}M$(oie,nie=n),yJ([e("Line")],oie.prototype,"type",void 0),yJ([e("Material")],oie.prototype,"theme",void 0),yJ([e(!1)],oie.prototype,"isSeriesInRows",void 0),yJ([t({},fJ)],oie.prototype,"markerSettings",void 0),yJ([e("")],oie.prototype,"range",void 0),yJ([e("")],oie.prototype,"id",void 0),yJ([e("")],oie.prototype,"title",void 0),yJ([e(290)],oie.prototype,"height",void 0),yJ([e(480)],oie.prototype,"width",void 0),yJ([e(0)],oie.prototype,"top",void 0),yJ([e(0)],oie.prototype,"left",void 0),yJ([t({},$$)],oie.prototype,"legendSettings",void 0),yJ([t({},jee)],oie.prototype,"primaryXAxis",void 0),yJ([t({},jee)],oie.prototype,"primaryYAxis",void 0),yJ([t({},H$)],oie.prototype,"dataLabelSettings",void 0);var nie,tte=oie;function oie(){return null!==nie&&nie.apply(this,arguments)||this}M$(sie,rie=n),yJ([e("")],sie.prototype,"src",void 0),yJ([e("")],sie.prototype,"id",void 0),yJ([e(300)],sie.prototype,"height",void 0),yJ([e(400)],sie.prototype,"width",void 0),yJ([e(0)],sie.prototype,"top",void 0),yJ([e(0)],sie.prototype,"left",void 0);var rie,nte=sie;function sie(){return null!==rie&&rie.apply(this,arguments)||this}M$(lie,aie=n),yJ([e("FillSeries")],lie.prototype,"fillType",void 0),yJ([e(!0)],lie.prototype,"showFillOptions",void 0);var aie,Wo=lie;function lie(){return null!==aie&&aie.apply(this,arguments)||this}var hie="workbookDestroyed",die="updateSheetFromDataSource",pie="dataSourceChanged",cie="dataChanged",uie="triggerDataChange",gie="workbookOpen",mie="beginSave",fie="actionBegin",yie="sortImport",vie="findToolDlg",bie="exportDialog",wie="setFilteredCollection",Cie="saveCompleted",Sie="applyNumber",Aie="getFormattedCell",xie="calculateFormula",Iie="refreshCellElem",Tie="setCellFormat",Eie="findAllValues",Die="textDecorationUpdate",Mie="applyCellFormat",kie="updateRowColCount",Pie="workbookFormulaOperation",Bie="workbookEditOperation",Fie="checkDateFormat",Lie="checkNumberFormat",Rie="parseDecimalNumber",Oie="getFormattedBarText",Nie="activeCellChanged",Vie="openSuccess",_ie="openFailure",Hie="sheetCreated",zie="sheetsDestroyed",jie="aggregateComputation",Wie="getUniqueRange",Qie="removeUniquecol",Uie="checkUniqueRange",qie="reApplyFormula",Gie="clearFormulaDependentCells",Yie="formulaInValidation",Xie="beforeSort",Kie="initiateSort",Jie="updateSortedDataOnCell",Zie="sortComplete",$ie="beforeHyperlinkCreate",ene="afterHyperlinkCreate",tne="beforeHyperlinkClick",ine="afterHyperlinkClick",nne="setLinkModel",one="initiateFilter",rne="filterRangeAlert",sne="wrapText",ane="onSave",lne="insert",hne="delete",dne="insertModel",pne="deleteModel",cne="isValidation",une="cellValidation",gne="addHighlight",mne="find",fne="gotoHandler",yne="replace",vne="replaceAll",bne="showFindAlert",wne="findKeyUp",Cne="removeHighlight",Sne="queryCellInfo",Ane="count",xne="protectSheet",Ine="updateToggleItem",Tne="protectsheetHandler",Ene="replaceAllDialog",Dne="unprotectsheetHandler",Mne="editAlert",kne="readonlyAlert",Pne="setLockCells",Bne="setMerge",Fne="applyMerge",Lne="mergedRange",Rne="activeCellMergedRange",One="insertMerge",Nne="hideShow",Vne="setCFRule",_ne="applyCF",Hne="clearCFRule",zne="clear",jne="clearCF",Wne="setImage",Qne="setChart",Une="initiateChart",qne="refreshRibbonIcons",Gne="refreshChart",Yne="refreshChartSize",Xne="deleteChartColl",Kne="focusChartBorder",Jne="saveError",Zne="updateHighlight",$ne="beforeInsert",eoe="beforeDelete",toe="deleteHyperlink",ioe="moveOrDuplicateSheet",noe="setAutoFill",ooe="refreshCell",roe="getFillInfo",soe="getautofillDDB",aoe="rowFillHandler",loe="getTextSpace",hoe="refreshClipboard",doe="updateView",poe="selectionComplete",coe="refreshInsertDelete",uoe="getUpdatedFormulaOnInsertDelete",goe="beforeCellUpdate",moe="duplicateSheetFilterHandler",foe="unMerge",yoe="checkFormulaRef",voe="parseFormulaArgument",boe="getCellRefValue",woe="commputeFormulaValue",Coe="getChartRowIdxFromClientY",Soe="getChartColIdxFromClientX",Aoe="refreshChartCellOnInit",xoe="localizedFormatAction",Ioe="moveSheetHandler",Toe="addListValidationDropdown",Eoe="sheetRenameUpdate",Doe="updateSortCollection";function Moe(e,t,i,n,o,r,s){if((a=e.value)&&"string"==typeof a){if(a.includes("\n"))return{isNumber:!1,value:a};if(mre(a))return{isNumber:!0,value:a};if(o&&a.includes(o)&&(s||e.format.includes(o)||e.format.includes("$"))&&(a=a.replace(o,"").trim()),i&&a.includes(i)&&koe(a,t,i,n)&&(a=a.split(i).join("").trim()),mre(a="."!==(n=n||Mi(t).decimal)&&a.includes(n)?a.replace(n,".").trim():a))return{isNumber:!0,value:a};if(r&&2===a.split("/").length)try{var a,l=a.split(" ");return{isNumber:!0,value:a=2===l.length&&1===l[0].split("/").length?fre(l[0])+fre(l[1]):fre(a)}}catch(e){}}else if(mre(a))return{isNumber:!0,value:a};return{isNumber:!1,value:a}}function koe(e,t,i,n){for(var o=!1,r=123456..toLocaleString(t).split(i).reverse(),s=e.split(n)[0].split(i),a=0;a<s.length&&(o=a===s.length-1?s[a].length===r[0].length:!ee(r[1])&&(0===a?s[a].length<=r[1].length:s[a].length===r[1].length));a++);return o}function Poe(e,t){return e&&"="===e[0]&&(1<e.length||t)}function Boe(e){if(-1<(e=e.split("$").join("")).indexOf(":")){var t=e.split(":");if(zoe(t[0])&&zoe(t[1]))return!0}else if(e.indexOf(":")<0&&zoe(e))return!0;return!1}function Foe(e){return 65<=e.charCodeAt(0)&&e.charCodeAt(0)<=90||97<=e.charCodeAt(0)&&e.charCodeAt(0)<=122}function Loe(e,t){return 0===t[1]&&t[3]===e.colCount-1}function Roe(e,t){return 0===t[0]&&t[2]===e.rowCount-1}function Ooe(e,t,i){return e&&t>=e[0]&&t<=e[2]&&i>=e[1]&&i<=e[3]}function Noe(e,t,i){for(var n,o=e.split(" "),r=0,s=o.length;r<s&&!(n=Ooe(rte(o[r]),t,i));r++);return n}function Voe(e,t,i){var n=e[0]<=t[0]&&e[2]>=t[2]&&e[1]<=t[1]&&e[3]>=t[3];if(n)return!0;if(i){if(t[0]<e[0]&&t[2]<e[0]||t[0]>e[2]&&t[2]>e[2])return!1;if(t[0]<e[0]&&t[2]>e[0]&&(t[0]=e[0],n=!0),t[2]>e[2]&&(t[2]=e[2],n=!0),t[1]<e[1]&&t[3]<e[1]||t[1]>e[3]&&t[3]>e[3])return!1;t[1]<e[1]&&t[3]>e[1]&&(t[1]=e[1],n=!0),t[3]>e[3]&&(t[3]=e[3],n=!0)}return n}function _oe(n,o,e){var r=dte(e+1);return n?n.split(" ").forEach(function(e){var t,i=rte(e);Voe(i,o)?n=n.split(e).join(r+(i[0]+1)+":"+r+o[0]+" "+r+(o[2]+2)+":"+r+(i[2]+1)):Voe(i,o,!0)&&(t=void 0,t=o[0]>i[0]?r+(i[0]+1)+":"+r+o[0]:r+(o[2]+2)+":"+r+(i[2]+1),n=n.split(e).join(t))}):n=r+"1:"+r+o[0]+" "+r+(o[2]+2)+":"+r+"1048576",n}function Hoe(e,t){return!!(e=e||{}).isLocked||!(!1===e.isLocked||(!t||!t.isLocked)&&(e.isLocked||!t||!1===t.isLocked))}function zoe(e){for(var t=e,i=0,n=t.length,o=0;o<n;o++)Foe(t[o])&&i++;var r=(e=t.substring(0,i)).length;if(r!==n&&r<4&&1!==n&&isNaN(parseInt(t,10))){if(16384<joe(e))return!1;r=parseFloat(t.substring(i,n));if(0<r&&r<1048577)return!0}return!1}function joe(e){var t=0,i=0;if(t<(e=e.toUpperCase()).length&&"!"===e[t]){for(t++;t<e.length&&"!"!==e[t];)t++;t++}for(;t<e.length&&Foe(e[t]);){i=26*i+e[t].charCodeAt(0)-64;t++}return 0===i?-1:i}function Woe(e,t,i,n,o){var r;if(void 0===n&&(n="rows"),i)for(var s=t;s<1/0;s++){if(!(r=e[""+n])[t]||!r[t].hidden){if(!o)break;o--}t++}else for(s=t;-1<s&&((r=e[""+n])[t]&&r[t].hidden);s--)t--;return t}function Qoe(e,t){var i=Object.keys(e);return(t?-1<i.indexOf("fontSize"):-1<i.indexOf("fontSize")&&12<Number(e.fontSize.split("pt")[0]))||-1<i.indexOf("fontFamily")||-1<i.indexOf("borderTop")||-1<i.indexOf("borderBottom")}function Uoe(e,t,i,n,o,r){var s;if(a=t?(s=o||Kre(t[0],t[1],i,!1,!0)).formula||"":a){r&&n.notify(Gie,{cellRef:lte(t[0],t[1])});for(var a,l=["+","-","*","/",">=","<=","<>",">","<","=","%","&"],h=void 0,d=a=(a=0===a.indexOf("=")?a.slice(1):a).split("(").join(n.listSeparator).split(")").join(n.listSeparator),p=0;p<l.length;p++)d=(h=d.split(l[p])).join(n.listSeparator);for(var c,u,g,m,h=d.split(n.listSeparator),f=[],y=void 0,v=void 0,b=void 0,w=void 0,C=0;C<h.length;C++)Boe((w=((m=h[C].includes("!"))?(c=h[C].lastIndexOf("!"),b=h[C].substring(0,c),h[C].substring(c+1)):h[C]).toUpperCase()).trim())&&!w.includes("$")&&(c=qoe(w),u=Goe(w),g=rte(w),y=!((g=[e[0]-(t[0]-g[0]),e[1]-(t[1]-g[1]),e[0]-(t[0]-g[2]),e[1]-(t[1]-g[3])])[1]<0||g[2]<0||g[3]<0||!r&&g[0]<0)&&(r&&g[0]<0&&(g[0]=g[2]),y=lte(g[0],g[1]),w.includes(":")&&(y+=":"+lte(g[2],g[3])),Boe(y))?y:"#REF!",(v={})[h[C]]=""+c+(y=m?b+"!"+y:y)+u,h[C].includes(":")?f.splice(0,0,v):f.push(v));for(var S=a=s.formula,C=0;C<f.length;C++){for(var A=Object.keys(f[C])[0],x=f[C][""+A],I=A.length,A=S.indexOf(A),T="",E=0;E<x.length;E++)T+=" ";a=a.slice(0,A)+x+a.slice(A+I),S=S.slice(0,A)+T+S.slice(A+I)}return a}return null}function qoe(e){for(var t="",i=0;i<e.length&&" "===e[i];i++)t+=" ";return t}function Goe(e){for(var t="",i=e.length-1;0<=i&&" "===e[i];i--)t=" "+t;return t}function Yoe(e,t,i,n,o){var r,s,a,l={cell:i.cell,rowIndex:i.rowIdx,colIndex:i.colIdx,cancel:!1,sheet:t.name};return i.preventEvt||e.trigger(goe,l),i.eventOnly||l.cancel||(i.valChange?(a=Kre(l.rowIndex,l.colIndex,t),r=!i.preventEvt&&e.getDisplayText(a),a=!(!a||!a.formula),Jre(l.rowIndex,l.colIndex,t,l.cell,!i.pvtExtend),s=Kre(l.rowIndex,l.colIndex,t,!1,!0),i.mergedCells&&(delete s.value,delete s.formula),s.formattedText&&delete s.formattedText,a={action:"updateCellValue",address:[l.rowIndex,l.colIndex],sheetIndex:Bre(e,t.name),value:a&&!s.formula?s.value||(0===s.value?"0":""):s.formula||s.value||(0===s.value?"0":""),skipFormatCheck:i.skipFormatCheck,isRandomFormula:i.isRandomFormula,isDelete:i.isDelete,deletedRange:i.deletedRange,fillType:i.fillType,cellInformation:n,isRedo:!o,actionName:i.fillType,isPaste:"paste"===i.requestType},e.notify(Bie,a),i.isFormulaDependent=a.isFormulaDependent,i.requestType&&null===l.cell&&Jre(l.rowIndex,l.colIndex,t,l.cell,!i.pvtExtend),i.cellDelete&&(delete s.value,delete s.formula,delete s.hyperlink),i.uiRefresh&&e.serviceLocator.getService("cell").refresh(l.rowIndex,l.colIndex,i.lastCell,i.td,i.checkCF,i.checkWrap,i.skipFormatCheck,i.isRandomFormula,i.fillType),i.preventEvt||(n=e.getDisplayText(s))!==r&&(a={value:o=(o=Kre(l.rowIndex,l.colIndex,t,!1,!0).value)||(0===o?"0":""),oldValue:r,formula:s.formula||"",address:t.name+"!"+lte(l.rowIndex,l.colIndex),displayText:n},i.requestType&&(a.requestType=i.requestType),e.trigger("cellSave",a))):Jre(l.rowIndex,l.colIndex,t,l.cell,!i.pvtExtend)),l.cancel}function Xoe(e,t,i){for(var n=e,o=e,r=t,s=t,a=i.usedRange.rowIndex,l=i.usedRange.colIndex,h=function(e){for(var t=0;t<=l;t++)if(!ee(Kre(e,t,i,null,!0).value))return!1;return!0},d=function(e){for(var t=n;t<=o;t++)if(!ee(Kre(t,e,i,null,!0).value))return!1;return!0},p=n;p<=a&&(!ee(Kre(p,t,i,null,!0).value)||!h(p));p++)o=p;for(p=n;0<=p&&(!ee(Kre(p,t,i,null,!0).value)||!h(p));p--)n=p;for(p=r;p<=l&&(!ee(Kre(e,p,i,null,!0).value)||!d(p));p++)s=p;for(p=r;0<=p&&(!ee(Kre(e,p,i,null,!0).value)||!d(p));p--)r=p;return[n,r,o,s]}function Koe(e,t,i){var n,o=rte(e.model.selectedRange),r=0,s=0;return"Column"===e.modelType?((i||"before"===e.insertType&&e.isUndoRedo)&&(o=[0,e.start,0,e.end]),"before"===e.insertType?t[1]<=o[1]&&t[3]>=o[1]?(r=0,s=o[3]-o[1]+1):o[1]<t[1]&&(r=s=o[3]-o[1]+1):(e.isUndoRedo&&(n=e.end-e.start+1,o=[0,e.start-n,0,e.end-n]),t[1]<=o[3]&&t[3]>=o[3]?(r=0,s=o[3]-o[1]+1):o[3]<t[3]&&(r=s=o[3]-o[1]+1)),[t[0],t[1]+r,t[2],t[3]+s]):((i||"above"===e.insertType&&e.isUndoRedo)&&(o=[e.start,0,e.end,0]),"above"===e.insertType?t[0]<=o[0]&&t[2]>=o[0]?s=o[2]-o[r=0]+1:o[0]<t[0]&&(r=s=o[2]-o[0]+1):(e.isUndoRedo&&(n=e.end-e.start+1,o=[e.start-n,0,e.end-n,0]),t[0]<=o[2]&&t[2]>=o[2]?s=o[2]-o[r=0]+1:o[2]<t[2]&&(r=s=o[2]-o[0]+1)),[t[0]+r,t[1],t[2]+s,t[3]])}function Joe(e,t){var i,n=0,o=0;return"Column"===e.modelType?((i=[0,e.start,e.model.usedRange.rowIndex,e.end])[3]<t[1]?n=o=i[3]-i[1]+1:i[1]>=t[1]&&i[3]<=t[3]?o=i[3]-i[1]+1:i[1]>=t[1]&&i[1]<=t[3]?o=t[3]-i[1]+1:i[1]<t[1]&&i[3]>=t[1]?(n=t[1]-i[1],o=i[3]-i[1]+1):i[1]<t[1]&&i[3]<t[3]&&(n=i[3]-t[1]+(i[3]-i[1])+1,o=i[3]-i[1]+1),[t[0],t[1]-n,t[2],t[3]-o]):((i=[e.start,0,e.end,e.model.usedRange.colIndex])[2]<t[0]?n=o=i[2]-i[0]+1:i[0]>=t[0]&&i[2]<=t[2]?o=i[2]-i[0]+1:i[0]>=t[0]&&i[0]<=t[2]?o=t[2]-i[0]+1:i[0]<t[0]&&i[2]>=t[0]?(n=t[0]-i[0],o=i[2]-i[0]+1):i[0]<t[0]&&i[2]<t[2]&&(n=i[2]-t[0]+(i[2]-i[0])+1,o=i[2]-i[0]+1),[t[0]-n,t[1],t[2]-o,t[3]])}function Zoe(e,t,i,n,o,r,s){for(var a,l=e.length-1;0<=l;l--)for(var h=e[l].range.trim().split(","),d=0;d<h.length;d++){if(i>=(a=rte(h[d].includes(":")?h[d]:h[d]+":"+h[d]))[0]&&n>=a[1]&&i<=a[2]&&n<=a[3]){t.push(e[l]),e.splice(l,1);break}if(o&&o[0]>=a[0]&&o[1]>=a[1]&&o[0]<=a[2]&&o[1]<=a[3]){var p={action:"autofillWithCF",cFColor:e[l].cFColor,range:hte(r),type:e[l].type,value:e[l].value};e.splice(l,1);for(var c=0,u=s.conditionalFormats;c<u.length&&("autofillWithCF"!==u[c].action||u[c].range!==p.range);c++)c===u.length-1&&(t.push(p),s.conditionalFormats.push(p));break}}}function $oe(e,t){for(var i,n,o,r,s,a=t.trim().split(","),l=0;l<e.length;l++)if(function(e){for(var t=0;t<a.length;t++){if(s=rte(a[t].includes(":")?a[t]:a[t]+":"+a[t]),e[0]<=s[0]&&e[1]<=s[1]&&e[2]>=s[2]&&e[3]>=s[3])return!0;if(o=e[0]>=s[0]&&e[0]<=s[2],r=e[2]>=s[0]&&e[2]<=s[2],i=e[1]>=s[1]&&e[1]<=s[3],n=e[3]>=s[1]&&e[3]<=s[3],o&&r){if(i||n||e[1]<s[1]&&e[3]>s[3]){if(0<e[0]-s[0])return!0;if(0<s[2]-e[2])return!0}if(i&&e[1]!==s[1])return!0;if(n&&e[3]!==s[3])return!0}else if(i&&n){if(o||r||e[0]<s[0]&&e[2]>s[2]){if(0<e[1]-s[1])return!0;if(0<s[3]-e[3])return!0}if(o){if(e[0]!==s[0])return!0}else if(r&&e[2]!==s[2])return!0}else if(o||r){if(i){if(e[1]!==s[1])return!0;if(0<e[0]-s[0])return!0;if(0<s[2]-e[2])return!0}else if(n){if(e[3]!==s[3])return!0;if(0<e[0]-s[0])return!0;if(0<s[2]-e[2])return!0}else if(e[1]<s[1]&&e[3]>s[3])return!0}else if((i||n)&&e[0]<s[0]&&e[2]>s[2])return!0}return!1}(e[l]))return!0;return!1}function ere(e,t,i){var n;i=i||Mi(t.locale);for(var o=0;o<e.length;o++)mre(e[o])?"."===i.group&&(e[o]=e[o].toString(),e[o].indexOf("."))&&koe(e[o],t.locale,i.group,i.decimal)&&(e[o]=e[o].split(i.group).join("")):(n={formattedText:e[o],value:e[o],format:"General",cell:{value:e[o],format:"General"},isEdit:!0},t.notify(Aie,n),mre(n.value)&&(e[o]=n.value.toString()));return e}function tre(e,t){var i,n,o=e.getActiveSheet(),r=[[t.topIndex+e.frozenRowCount(o),t.leftIndex+e.frozenColCount(o),t.bottomIndex,t.rightIndex]];return(o.frozenRows||o.frozenColumns)&&(i=e.frozenRowCount(o),e=e.frozenColCount(o),n=ste(o.topLeftCell),i&&e&&(r.push([n[0],n[1],i-1,e-1]),o=ste(o.paneTopLeftCell),r.push([o[0],n[1],t.bottomIndex,e-1])),i&&r.push([n[0],t.leftIndex+e,i-1,t.rightIndex]),e)&&r.push([t.topIndex+i,n[1],t.bottomIndex,e-1]),r}function ire(e){var t;zde(e.sheet,e.rowIdx)&&(t=Woe(e.sheet,e.rowIdx,!0))<e.rowIdx+e.cell.rowSpan&&(e.rowIdx=t,e.isMergedHiddenCell=!0),epe(e.sheet,e.colIdx)&&(t=Woe(e.sheet,e.colIdx,!0,"columns"))<e.colIdx+e.cell.colSpan&&(e.colIdx=t,e.isMergedHiddenCell=!0)}function nre(e){return e.workbookOpenModule&&e.workbookOpenModule.preventFormatCheck}function ore(i){var e=new Ti,n={intl:e,updateValue:!0,value:"",curSymbol:ki(i.locale,oe)},o={args:n,intl:e},r=Mi(i.locale);return function(e){var t;e.format||!e.value||mre(e.value)||(n.cell=e,n.value=e.value,i.notify(Fie,n),e.format)||((t=e.value.toString()).includes(o.args.curSymbol)||t.includes(r.group)||t.includes("%")?(o.fResult=t,i.notify(Lie,o)):"."===r.decimal||mre(t)||t.includes(r.decimal)&&mre(t=t.replace(r.decimal,"."))&&(e.value=t))}}function rre(e,t,i){var n=new ya,o=(t.length&&n.where(ba.and(t)),e.executeLocal(n));if(i)for(var r=0,s=i.length;r<s&&o.length;r++)n=new ya,i[r].length&&n.where(ba.or(i[r])),o=new me(o).executeLocal(n);return o}function sre(e,t,i){return e&&e.isReadOnly||i&&i.isReadOnly||t&&t.isReadOnly}function are(e,t){for(var i,n=e.getActiveSheet(),o=je(t)?fte(rte(n.selectedRange)):t,r=o[0];r<=o[2];r++)for(var s=o[1];s<=o[3];s++)if(sre(Kre(r,s,n),Kde(n,s),_de(n,r))){i=!0;break}return i}function lre(e,t){var t=t||e.selectedRange,i=rte(t),n=e.colCount,e=e.rowCount;return i[2]===e-1&&0===i[0]?t=t.replace(/[0-9]/g,""):i[3]===n-1&&0===i[2]&&(t=t.replace(/\D/g,"")),t}function hre(o,e,t){var r,s,a,l,h,d;e.length&&(r=o.getActiveSheet(),l=(a=o).frozenColCount(r),h=t&&t[0]||(l?ste(r.topLeftCell)[1]:a.viewport.leftIndex),d=t&&t[1]||a.viewport.rightIndex,e.forEach(function(e){for(var t=h;t<=d;t++){t===l&&(t+=a.viewport.leftIndex);var i,n=Kre(e-1,t,r,!1,!0);n.rowSpan&&1!==n.rowSpan&&n.colSpan&&1!==n.colSpan||n.style&&n.style.borderBottom&&"none"!==n.style.borderBottom||(s=Kre(e,t,r,!1,!0).style)&&s.borderTop&&(n=o.getCell(e-1,t))&&n.style.borderBottom&&(i=o.getCell(e,t))&&(n.style.borderBottom="",i.style.borderTop=s.borderTop)}}))}function dre(e){var t=e.toString();return e===parseInt(t,10)?parseInt(t,10)+"  ":(e=-1<t.indexOf(".")?t.split(".")[1]:0,t=Math.pow(10,e.toString().replace("-","").length),e/(e=Math.abs(pre(e,t)))+"/"+t/e)}function pre(e,t){return e=Number(e),(t=Number(t))?pre(t,e%t):e}function cre(e){60<(e=0<(e=Number(e))&&e<1?1+e:0===e?1:e)&&--e;var t=new Date("01/01/1900"),t=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return new Date(new Date(864e5*(e-1)+t).toUTCString().replace(" GMT",""))}function ure(e,t,i){var n=new Date("01/01/1900"),e=gre(e)?e:new Date(e),n=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e=(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())-n)/864e5;return(t?e:parseInt(e.toString(),10))+(i?0:60<e?2:1)}function gre(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.valueOf())}function mre(e){return 0<=e-parseFloat(e)}function fre(e){return Function('"use strict";return ('+e+")")()}function yre(e,h,t,i,n,o){function d(){"time"===u.type&&(u.dateObj=new Date((r?r.toDateString():"01/01/1900")+" "+u.dateObj.toLocaleTimeString()))}var r,p=ce.getDependables(Ai,t,null).dateObject,c=p.dateTimeFormats.availableFormats,u={dateObj:null,isCustom:!1,type:""};if(i&&(u.dateObj=h.parseDate(e,{format:i}),u.dateObj)&&(u.type=-1<e.toString().indexOf(":")?"time":"datetime",d(),u.isCustom=!0),je(u.dateObj)){if((e=e.toString())&&-1<e.indexOf("/")||0<e.indexOf("-")){t=n&&n.format||i;if(t){n=t.toLowerCase().includes("dd-mm-yy");if((n||t.toLowerCase().includes("dd/mm/yy"))&&(u.dateObj=h.parseDate(e,{format:t=n?"d-M-y":"d/M/y",skeleton:"yMd"}),u.dateObj))return u.type="date",u}}i=function(e){if(e.indexOf(":")<0)for(var t=0,i=Object.keys(p.dateFormats);t<i.length;t++){var n=i[t];if(u.dateObj=h.parseDate(e,{format:p.dateFormats[""+n],skeleton:n}),u.dateObj){u.type="date",u.isCustom=!1;break}}if(je(u.dateObj))for(var o=void 0,r=0,s=Object.keys(c);r<s.length;r++){n=s[r],o=c[""+n];if(u.dateObj=h.parseDate(e,{format:o,skeleton:n}),!u.dateObj&&-1<e.indexOf(":")&&-1<o.indexOf(":")&&(u.dateObj=h.parseDate(e,{format:o.split(" ")[0]})),u.dateObj){u.type=-1<e.toString().indexOf(":")?"time":"datetime",d(),u.isCustom=!0;break}}if(je(u.dateObj))for(var a=0,l=Object.keys(p.timeFormats);a<l.length;a++){n=l[a];if(u.dateObj=h.parseDate(e,{format:p.timeFormats[""+n],skeleton:n}),u.dateObj){u.type="time",d(),u.isCustom=!1;break}}};o?2<=(n=e.split(" ")).length&&(i(n.shift()),u.dateObj)&&(r=u.dateObj,u.dateObj=null,i(n.join(" ")),u.dateObj)&&(u.type="datetime"):i(e)}return"#DIV/0!"===e||u.dateObj||"Invalid Date"===new Date(e).toString()||(u.dateObj=new Date(e),u.type="date"),u}function vre(e,t,i){if(e&&"."!==e&&"-"!==e){var n=e.toString(),o=Number.MAX_SAFE_INTEGER.toString().length;if(n.startsWith("-")&&(n=(n=n.slice(1)).includes("-")?e:n),/^\d*\.?\d*$/.test(n))return t&&(n.length>o||i&&(n.startsWith("0")||n.endsWith("0")))?e:parseFloat(e)}return e}var bre="spreadsheetLocale",wre={SortOutOfRangeError:"Select a cell or range inside the used range and try again."};function Cre(T,E,D,M,k,P,i,n,B,o,F,L){return void 0===B&&(B=!0),new Promise(function(e){var t,x,I;e((-1<(e=E.lastIndexOf("!"))?(t=Bre(T,E.substring(0,e)),E=E.substring(e+1)):t=T.activeSheetIndex,x=_re(T,t),I=pte(o||E),e={sheet:x,indexes:I,formulaCellRef:i,sheetIndex:n,promise:new Promise(function(e){e(void 0)})},T.notify(die,e),e.promise.then(function(){var n,o,r=I[0],e=T.frozenRowCount(x),t=T.frozenColCount(x),s=!!L;if(D){var a,l,h,d,p,c,u,g,m=[];M?(c=Mi(T.locale),u=new Ti(T.locale)):g=ore(T),E.split(",").forEach(function(e,t){for(I=rte(e),r=I[a=0];r<=I[2];){for(l=m[a]||{},o=_de(x,r),n=I[1];n<=I[3];)if(!B||!zde(x,r)||P&&jde(x,r)){d=dte(n+1);var i=o?Kre(r,n,x):null;if(M)i&&(i.value||0===i.value)?(i.formattedText&&i.format&&!i.format.includes("*")?ise(i.format,!1)?l[d]=cre(i.value):l[d]=i.formattedText.toString().trim():l[d]=Sre(T,i,r,n,!1,u),"string"==typeof(p=i.value)&&("."!==c.decimal&&p.includes(c.decimal)?mre(h=p.replace(c.decimal,"."))&&(p=parseFloat(h)):mre(p)&&(p=parseFloat(p)))):(l[d]="",p=null),l[d+"_value"]=p;else if((i&&(i.formula||!je(i.value))||Object.keys(l).length)&&(n===F?((p={value:Sre(T,i,r,n,!0)}).value&&"string"==typeof p.value&&(mre(p.value)&&!i.value.toString().includes("\n")?i.format&&"@"===i.format||(p.value=parseFloat(p.value)):i.format||(g(i),mre(i.value)&&!i.value.toString().includes("\n")&&(p.value=parseFloat(i.value)))),l[d]=Pe({},i,p)):l[d]=i),i&&(i.rowSpan&&1!==i.rowSpan||i.colSpan&&1!==i.colSpan))return void(m=[{throwMergeAlert:!0}]);n===I[3]&&Object.keys(l).length&&(l.__rowIndex=(r+1).toString(),m[a]=l,s&&0===t&&!jde(x,r)&&L.push(l),a++),n++}else r++;r++}})}else{m=new Map;for(var i=!(M||!k||!k.length);r<=I[2];)if(i&&e<=r&&r<k[0])r=k[0];else{if(M||!zde(x,r))for(o=_de(x,r),n=I[1];n<=I[3];){var f,y={cell:Kre(r,n,x),address:lte(r,n),rowIndex:r,colIndex:n},v=(T.trigger(Sne,y),Kre(r,n,x,!1,!0));if(v.formula&&v.formula.toUpperCase().includes("UNIQUE")&&T.notify(xie,{cell:v,rowIdx:r,colIdx:n,sheetIndex:T.activeSheetIndex,address:y.address}),1<v.colSpan&&1<v.rowSpan)for(var b=void 0,w=r,C=r+v.rowSpan;w<C;w++)for(var S=n,A=n+v.colSpan;S<A;S++)w===r&&S===n||(b=new Object,w!==r&&(b.rowSpan=r-w),S!==n&&(b.colSpan=n-S),x.rows[w]&&x.rows[w].cells&&x.rows[w].cells[S]&&(delete x.rows[w].cells[S].value,delete x.rows[w].cells[S].formula),Jre(w,S,x,b,!0));else if(1<v.colSpan)for(w=n+1,C=n+v.colSpan;w<C;w++)Jre(r,w,x,{colSpan:n-w},!0),x.rows[r]&&x.rows[r].cells&&x.rows[r].cells[w]&&(delete x.rows[r].cells[w].value,delete x.rows[r].cells[w].formula);else if(1<v.rowSpan)for(w=r+1,C=r+v.rowSpan;w<C;w++)Jre(w,n,x,{rowSpan:r-w},!0),x.rows[w]&&x.rows[w].cells&&x.rows[w].cells[n]&&(delete x.rows[w].cells[n].value,delete x.rows[w].cells[n].formula);!M&&epe(x,n)?n++:i&&t<=n&&n<k[1]?n=k[1]:(v.style&&(f={},Object.assign(f,v.style),v.style=f),m.set(y.address,v),n++)}r++}}return m})))})}function Sre(e,t,i,n,o,r){return!t||je(t.value)?"":t.format?(i={value:t.value,formattedText:t.value,cell:t,format:t.format,checkDate:!o,rowIndex:i,colIndex:n,dataUpdate:!0},e.notify(Aie,i),i.dateObj&&"Invalid Date"!==i.dateObj.toString()?i.dateObj:o?i.value:i.formattedText.toString().trim()):o?t.value:(mre(n=t.value)&&((n=Number(t.value).toString()).includes(".")||11<n.length)&&(e.notify(Rie,i={args:{value:n,updateValue:!0},fResult:n,cellVal:n,intl:r}),n=i.fResult),n)}function Are(i,n,o,e){for(var r,s,a,l=0,h=i.length,t=(e&&0<i.length&&i.sort(function(e,t){return je(e)||ee(e.index)||je(t)||ee(t.index)?0:e.index-t.index}),0);t<h;t++)!function(e){if(je(i[e])||ee(i[e].index)||(s=l=i[e].index-e,delete i[e].index),0<l){for(r=0;l--;)n?(o.createSheet(e+r),r++):i.splice(e,0,null);e+=s,h+=s}var t;n&&(i[e].id<1&&(i[e].id=zre(o.sheets),i[e].properties)&&(i[e].properties.id=i[e].id),i[e].name||o.setSheetPropertyOnMute(i[e],"name","Sheet"+Hre(o)),t=0,i[e].rows.forEach(function(e){t=Math.max(t,e&&e.cells&&e.cells.length-1||0)}),o.setSheetPropertyOnMute(i[e],"usedRange",{rowIndex:i[e].rows.length?i[e].rows.length-1:0,colIndex:t})),a=e}(t),t=a}xre=function(e,t){return(xre=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])}))(e,t)};var xre,Ire,qo=function(e,t){function i(){this.constructor=e}xre(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Xo=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Zo=(qo(Tre,Ire=n),Tre.prototype.setProperties=function(e,t){var i=this;if(this.parentObj.isComplexArraySetter&&this.controlParent&&this.controlParent.isAngular)if(Object.keys(e).length){void 0===this.parentObj.currRangeIdx?this.parentObj.currRangeIdx=0:this.parentObj.currRangeIdx+=1;var n=this.parentObj.ranges[this.parentObj.currRangeIdx];n&&n.info&&(this.info=n.info),setTimeout(function(){void 0!==i.parentObj.currRangeIdx&&delete i.parentObj.currRangeIdx})}else if(this.controlParent.tagObjects[0].instance&&this.controlParent.tagObjects[0].instance.hasChanges&&!this.controlParent.tagObjects[0].instance.isInitChanges){n=this.controlParent.sheets.indexOf(this.parentObj);if(void 0===this.parentObj.changedRangeIdx){for(var o,r=this.controlParent.tagObjects[0].instance.list[n].tagObjects,s=0;s<r.length;s++)if("ranges"===r[s].name){r[s].instance.list.forEach(function(e,t){e.hasChanges&&(o=t)});break}this.parentObj.changedRangeIdx=o}}Ire.prototype.setProperties.call(this,e,t)},Xo([e(null)],Tre.prototype,"dataSource",void 0),Xo([e("A1")],Tre.prototype,"startCell",void 0),Xo([e(null)],Tre.prototype,"query",void 0),Xo([e(null)],Tre.prototype,"fieldsOrder",void 0),Xo([e(!0)],Tre.prototype,"showFieldAsHeader",void 0),Xo([e("")],Tre.prototype,"template",void 0),Xo([e("A1")],Tre.prototype,"address",void 0),Tre);function Tre(){return null!==Ire&&Ire.apply(this,arguments)||this}qo(Dre,Ere=n),Xo([e(0)],Dre.prototype,"rowIndex",void 0),Xo([e(0)],Dre.prototype,"colIndex",void 0);var Ere,M$=Dre;function Dre(){return null!==Ere&&Ere.apply(this,arguments)||this}qo(Pre,Mre=n),Xo([e(null)],Pre.prototype,"rows",void 0),Xo([e(null)],Pre.prototype,"columns",void 0),Xo([t({},g$)],Pre.prototype,"protectSettings",void 0),Xo([kt([],Zo)],Pre.prototype,"ranges",void 0),Xo([kt([],_$)],Pre.prototype,"conditionalFormats",void 0),Xo([e(0)],Pre.prototype,"index",void 0),Xo([e("")],Pre.prototype,"name",void 0),Xo([e(100)],Pre.prototype,"rowCount",void 0),Xo([e(100)],Pre.prototype,"colCount",void 0),Xo([e("A1:A1")],Pre.prototype,"selectedRange",void 0),Xo([e("A1")],Pre.prototype,"activeCell",void 0),Xo([t({},M$)],Pre.prototype,"usedRange",void 0),Xo([e("A1")],Pre.prototype,"topLeftCell",void 0),Xo([e(!0)],Pre.prototype,"showHeaders",void 0),Xo([e(!0)],Pre.prototype,"showGridLines",void 0),Xo([e(!1)],Pre.prototype,"isProtected",void 0),Xo([e("Visible")],Pre.prototype,"state",void 0),Xo([e(0)],Pre.prototype,"frozenRows",void 0),Xo([e(0)],Pre.prototype,"frozenColumns",void 0),Xo([e("A1")],Pre.prototype,"paneTopLeftCell",void 0),Xo([e("")],Pre.prototype,"password",void 0),Xo([e(null)],Pre.prototype,"standardHeight",void 0),Xo([e(!1)],Pre.prototype,"isSheetCalculated",void 0);var Mre,kre=Pre;function Pre(){return null!==Mre&&Mre.apply(this,arguments)||this}function Bre(e,t){var i;t.startsWith("'")&&t.endsWith("'")&&(t=t.replace(/''/g,"'").replace(/^'|'$/g,""));for(var n=0;n<e.sheets.length;n++)if(e.sheets[n].name.toLowerCase()===t.toLowerCase()){i=n;break}return i}function Fre(e,t){for(var i,n=0;n<e.sheets.length;n++)if(e.sheets[n].id===t){i=n;break}return i}function Lre(e){var t=e.lastIndexOf("!");return(-1<t?e.substring(0,t):e).replace(/'/gi,"")}function Rre(e,t,i){for(var n=i.length,o=0;o<n;o++)if(i[o].sheet.toUpperCase()===t.toUpperCase())return i[o].index;return-1}function Ore(e,t,i,n){e.setSheetPropertyOnMute(i=void 0===i?{}:i,"selectedRange",n?i.selectedRange+" "+t:t)}function Nre(e){return e&&e.selectedRange||"A1"}function Vre(e){return e.selectedRange.split(" ")[0]}function _re(e,t){return e.sheets[t]}function Hre(e){var t=[];e.sheets.forEach(function(e){t.push(e.name.toLowerCase())});for(var i=0;i<t.length;i++){if(!(-1<t.indexOf("sheet"+e.sheetNameCount)))return e.sheetNameCount++;e.sheetNameCount++}return e.sheetNameCount++}function zre(e){var t=0;return e.forEach(function(e){t=Math.max(e.id,t)}),t+1}function jre(n,e,o){e=e||n.sheets;e.forEach(function(e){var t,i;e.id=e.id||0,e.name=e.name||"",n.setSheetPropertyOnMute(e,"rowCount",e.rowCount||100),n.setSheetPropertyOnMute(e,"colCount",e.colCount||100),n.setSheetPropertyOnMute(e,"topLeftCell",e.topLeftCell||"A1"),n.setSheetPropertyOnMute(e,"activeCell",e.activeCell||"A1"),n.setSheetPropertyOnMute(e,"selectedRange",e.selectedRange||e.activeCell+":"+e.activeCell),n.setSheetPropertyOnMute(e,"usedRange",e.usedRange||{rowIndex:0,colIndex:0}),n.setSheetPropertyOnMute(e,"ranges",e.ranges||[]),n.setSheetPropertyOnMute(e,"rows",e.rows&&Pe([],e.rows,null,!0)||[]),n.setSheetPropertyOnMute(e,"columns",e.columns||[]),n.setSheetPropertyOnMute(e,"showHeaders",!!ee(e.showHeaders)||e.showHeaders),n.setSheetPropertyOnMute(e,"showGridLines",!!ee(e.showGridLines)||e.showGridLines),n.setSheetPropertyOnMute(e,"state",e.state||"Visible"),e.maxHgts=e.maxHgts||[],e.isImportProtected=e.isProtected&&o,e.protectSettings=e.protectSettings||{selectCells:!1,formatCells:!1,formatRows:!1,formatColumns:!1,insertLink:!1},e.isProtected=e.isProtected||!1,e.paneTopLeftCell&&"A1"!==e.paneTopLeftCell||(e.frozenRows=e.frozenRows||0,e.frozenColumns=e.frozenColumns||0,t=ste(e.topLeftCell),n.setSheetPropertyOnMute(e,"paneTopLeftCell",lte(e.frozenRows?t[0]+e.frozenRows:t[0],e.frozenColumns?t[1]+e.frozenColumns:t[1]))),Are(e.columns),t=e.rows,i=o,t.forEach(function(e){e&&e.cells&&Are(e.cells,null,void 0,i)}),Are(t,null,void 0,i)}),Are(e,!0,n)}function Wre(e,t){return _re(e,t=void 0===t?e.activeSheetIndex:t).name}function Qre(i,n,e,t,o){var r=!!e,s=(e=e||[i.activeSheetIndex],Wre(i)),a={action:"moveSheet",eventArgs:{position:n=function(e,t,i){for(var n=t;i?0<=n:n<e.length;i?n--:n++)if("Hidden"!==e[n].state&&"VeryHidden"!==e[n].state){t=n;break}return t}(i.sheets,n,i.activeSheetIndex>n),sheetIndexes:e,cancel:!1}};t&&i.trigger("actionBegin",a),a.eventArgs.cancel||(i.notify(Ioe,{prevIndex:i.activeSheetIndex,currentIndex:n}),e.forEach(function(e,t){i.sheets.splice(n+t,0,i.sheets.splice(e+(e<n?-1*t:0),1)[0])}),i.setProperties({activeSheetIndex:o?Bre(i,s):n>e[0]?n-(e.length-1):n},!0),i.notify(ioe,{refresh:r}),t&&(delete a.eventArgs.cancel,i.trigger("actionComplete",a)))}function Ure(e,t,i,n){var o={action:"duplicateSheet",eventArgs:{sheetIndex:t=ee(t)?e.activeSheetIndex:t,cancel:!1}};if(i&&e.trigger("actionBegin",o),!o.eventArgs.cancel){var r=_re(e,t),s=Pe({},r.properties||r,{},!0),a=(s.id=zre(e.sheets),s.name),l=(/^\(\d+\)$/.test("("+a.split(" (")[1])&&(a=a.split(" (")[0]),[]);e.sheets.forEach(function(e){l.push(e.name)});for(var h=2;;h++)if(-1===l.indexOf(a+" ("+h+")")){s.name=a+" ("+h+")";break}e.notify(moe,{sheetIndex:t,newSheetIndex:t+1}),e.notify(Doe,{isDuplicate:!0,curSheetIndex:t,newSheetIndex:t+1}),e.createSheet(t+1,[s]),e.notify(Pie,{action:"addSheet",sheetName:"Sheet"+s.id,visibleName:s.name,sheetId:s.id}),n||e.setProperties({activeSheetIndex:t+1},!0),e.notify(ioe,{refresh:!0,isDuplicate:!0}),i&&(delete o.eventArgs.cancel,e.trigger("actionComplete",o))}}qre=function(e,t){return(qre=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])}))(e,t)};var qre,Gre,yJ=function(e,t){function i(){this.constructor=e}qre(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},qo=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Yre=(yJ(Xre,Gre=n),qo([e("")],Xre.prototype,"notes",void 0),qo([kt([],nte)],Xre.prototype,"image",void 0),qo([kt([],tte)],Xre.prototype,"chart",void 0),qo([e("")],Xre.prototype,"value",void 0),qo([e("")],Xre.prototype,"formula",void 0),qo([e(0)],Xre.prototype,"index",void 0),qo([e("General")],Xre.prototype,"format",void 0),qo([t({},mJ)],Xre.prototype,"style",void 0),qo([e("")],Xre.prototype,"hyperlink",void 0),qo([e(!1)],Xre.prototype,"wrap",void 0),qo([e(!0)],Xre.prototype,"isLocked",void 0),qo([e("")],Xre.prototype,"validation",void 0),qo([e(1)],Xre.prototype,"colSpan",void 0),qo([e(1)],Xre.prototype,"rowSpan",void 0),qo([e(!1)],Xre.prototype,"isReadOnly",void 0),Xre);function Xre(){return null!==Gre&&Gre.apply(this,arguments)||this}function Kre(e,t,i,n,o){var r=_de(i,e);if(!r||!r.cells){if(!n)return o?{}:null;r?i.rows[e].cells=[]:i.rows[e]={cells:[]}}return i.rows[e].cells[t]||(o?{}:null)}function Jre(e,t,i,n,o,r){i.rows[e]?i.rows[e].cells||(i.rows[e].cells=[]):i.rows[e]={cells:[]},o&&i.rows[e].cells[t]&&!r?Pe(i.rows[e].cells[t],n,null,!0):i.rows[e].cells[t]=n}function Zre(t,e){var i,n={fontFamily:"Calibri",verticalAlign:"bottom",textIndent:"0pt",backgroundColor:"#ffffff",color:"#000000",textAlign:"left",fontSize:"11pt",fontWeight:"normal",fontStyle:"normal",textDecoration:"none",border:"",borderLeft:"",borderTop:"",borderRight:"",borderBottom:""},o={};return Object.keys(e?n:t).forEach(function(e){(i=t[""+e])!==n[""+e]&&(o[""+e]=i)}),o}function $re(e,t,i,n,o){void 0===t&&(t=!0);for(var e=i.getAddressInfo(e),r=e.indices,s=_re(i,e.sheetIndex),a=e.sheetIndex===i.activeSheetIndex,l=r[0];l<=r[2];l++)for(var h=r[1];h<=r[3];h++)!Yoe(i,s,{cell:{wrap:t},rowIdx:l,colIdx:h,preventEvt:n})&&a&&i.notify(sne,{range:[l,h,l,h],wrap:t,sheet:s,initial:!0,isPublic:o});i.setProperties({sheets:i.sheets},!0)}function ese(e){var t;return t=-1<e.indexOf("[")&&(e=e.split("[")[1].split("]")[0],-1<tse().indexOf(e))?e:t}function tse(){return["Black","Blue","Cyan","Green","Magenta","Red","White","Yellow"]}function ise(e,t,i,n){var o,r,s,a;return e.includes('"')&&((r=e.split(";")).forEach(function(e,t){for(var i=0;i<e.length;i++)if('"'===e[i]&&"\\"!==e[i-1]){for(s=i;s=e.indexOf('"',s+1),"\\"===(a=e[s-1])||"_"===a||"*"===a;);if(-1===s)break;e=e.substring(0,i)+e.substring(s+1),i--}r[t]=e}),e=r.join(";")),!e.includes("d")&&!e.includes("y")||e.includes("#")||ese(e)||(i&&(i.type="date"),n&&e.includes(" ")&&2===e.split(" ").length?e=e.split(" ")[1]:t=!1,o=!0),t&&(e.includes("h")||e.includes("m")||e.includes("s"))&&!e.includes("#")&&!ese(e)&&(i&&(i.type=i.type||"",i.type+="time"),o=!0),o}yJ(ose,nse=n),qo([e(0)],ose.prototype,"chunkSize",void 0),qo([e(3)],ose.prototype,"retryCount",void 0),qo([e(500)],ose.prototype,"retryAfterDelay",void 0);var nse,Xo=ose;function ose(){return null!==nse&&nse.apply(this,arguments)||this}sse.prototype.addEventListener=function(){this.parent.on(die,this.updateSheetFromDataSourceHandler,this),this.parent.on(pie,this.dataSourceChangedHandler,this),this.parent.on(cie,this.dataChangedHandler,this),this.parent.on(uie,this.triggerDataChangeHandler,this)},sse.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(die,this.updateSheetFromDataSourceHandler),this.parent.off(pie,this.dataSourceChangedHandler),this.parent.off(cie,this.dataChangedHandler),this.parent.off(uie,this.triggerDataChangeHandler))},sse.prototype.updateSheetFromDataSourceHandler=function(p){var c,u,g,m,t,f,y,v,b,w,i,C=this,S=[],A=[],n=new ll,x=(p.promise=n.promise,p.autoDetectFormat),I=x&&ore(this.parent);if(p.sheet&&p.sheet.ranges.length)for(var T,E=this,e=p.sheet.ranges.length-1;0<=e;e--)!function(o){var r,s=p.sheet.ranges[o],a=(i=rte(s.startCell),p.loadFromStartCell&&(p.indexes=i),p.indexes[0]),l=p.indexes[2],e=(v=i[0],i=s.dataSource instanceof me?s.dataSource:s.dataSource?new me(s.dataSource):new me,t=t||i.dataSource.url,p.sheet.isLocalData=!i.dataSource.url,v<=a?a-=v:a=v<=l?(l-=v,0):-1,s.showFieldAsHeader&&0!==a&&--a,!1),h=0,d=(E.initRangeInfo(s),E.getMaxCount(s));w=E.getLoadedInfo(a,l,s),a=w.unloadedRange[0],l=w.unloadedRange[1],s.info.insertRowRange&&(s.info.insertRowRange.forEach(function(e){h+=e[1]-e[0]+1}),a-=h,l-=h),d<=a?e=!0:d<l&&(l=d),p.loadComplete||E.requestedInfo.push({deferred:n,indexes:p.indexes,isNotLoaded:w.isNotLoaded}),0<=a&&w.isNotLoaded&&!e?(A[o]=a,S[o]=!1,s.fieldsOrder&&(r=[].slice.call(s.fieldsOrder)),e=(s.query||new ya).clone(),p.loadFullData||(e=e.range(a,d<=l?l:l+1)),i.executeQuery(e.requiresCount()).then(function(e){var i,t,n;C.parent&&!C.parent.isDestroyed&&(m=(e.result&&e.result.result?e.result:e).result,g=rte(s.startCell),v=g[0],b=g[1],m&&m.length?(s.info.count||(d=e.count,s.info.count=e.count),u=s.info.flds||r||Object.keys(m[0]),s.info.fldLen||(s.info.fldLen=u.length,s.info.flds=u),s.info.insertColumnRange&&(i=0,s.info.insertColumnRange.forEach(function(e){for(var t=e[0];t<=e[1];t++)t<=b?u.splice(0,0,"emptyCell"+i):u.splice(t-b,0,"emptyCell"+i),i++})),0===A[o]&&s.showFieldAsHeader&&(f=v+A[o]+h,u.forEach(function(e,t){(c=Kre(f,b+t,p.sheet,!0))?e.includes("emptyCell")||(c.value=e):p.sheet.rows[v+A[o]].cells[b+t]=e.includes("emptyCell")?{}:{value:e}})),m.forEach(function(i,e){f=v+A[o]+e+(s.showFieldAsHeader?1:0)+h,u.forEach(function(e,t){(c=Kre(f,y=b+t,p.sheet,!0))?(T=c.value,e.includes("emptyCell")||Jre(f,y,p.sheet,C.getCellDataFromProp(i[e]),!0)):(T=void 0,c=p.sheet.rows[f].cells[y]=e.includes("emptyCell")?{}:C.getCellDataFromProp(i[e])),x&&I(c),p.updateDependentCellsCallback&&T!==c.value&&p.updateDependentCellsCallback(f,y)})})):u=[],e=0<v+(d||e.count)?v+(d||e.count)+(s.showFieldAsHeader?1:0)+h-1:p.sheet.usedRange.rowIndex,t=b+u.length-1<0?p.sheet.usedRange.colIndex:b+u.length-1,p.loadFullData&&(l=e),n={rowIndex:e,colIndex:t},C.parent.scrollSettings&&C.parent.scrollSettings.isFinite&&(n.rowIndex=e<p.sheet.rowCount?e:p.sheet.rowCount-1,n.colIndex=t<p.sheet.colCount?t:p.sheet.colCount-1),p.sheet.usedRange.rowIndex<n.rowIndex&&C.parent.setSheetPropertyOnMute(p.sheet,"usedRange",{rowIndex:n.rowIndex,colIndex:p.sheet.usedRange.colIndex}),p.sheet.usedRange.colIndex<n.colIndex&&C.parent.setSheetPropertyOnMute(p.sheet,"usedRange",{rowIndex:p.sheet.usedRange.rowIndex,colIndex:n.colIndex}),h?(w=C.getLoadedInfo(a,l,s),a=w.unloadedRange[0],l=w.unloadedRange[1],d<a&&(w.isNotLoaded=!1),w.isNotLoaded&&(d<l&&(l=d),s.info.loadedRange.push([a,l]))):s.info.loadedRange.push([a,l]),S[o]=!0,-1===S.indexOf(!1))&&(n=void 0,l+v<v+s.info.count?(p.rangeSettingCount||(p.rangeSettingCount=[]),p.rangeSettingCount.push(o),n=!0,e={sheet:p.sheet,indexes:[0,0,e,t],promise:new Promise(function(e){e(void 0)}),rangeSettingCount:p.rangeSettingCount,loadComplete:p.loadComplete,autoDetectFormat:p.autoDetectFormat,resolveAfterFullDataLoaded:p.resolveAfterFullDataLoaded},C.updateSheetFromDataSourceHandler(e),e.promise.then(function(){"workbook"!==C.parent.getModuleName()&&(p.rangeSettingCount.pop(),p.rangeSettingCount.length||C.parent.notify("created",null),p.formulaCellRef?C.notfyFormulaCellRefresh(p.formulaCellRef,p.sheetIndex):p.loadComplete&&p.loadComplete())})):p.formulaCellRef?C.notfyFormulaCellRefresh(p.formulaCellRef,p.sheetIndex):p.loadComplete&&p.loadComplete(),n&&p.resolveAfterFullDataLoaded||(C.checkResolve(p.indexes),p.resolveAfterFullDataLoaded&&C.checkResolve([0,0,0,0])))})):0===o&&-1===S.indexOf(!1)&&(p.loadComplete&&p.loadComplete(),E.checkResolve(p.indexes))}(e);else n.resolve()},sse.prototype.notfyFormulaCellRefresh=function(e,t){this.parent.formulaRefCell=null,this.parent.notify(doe,{indexes:rte(e),sheetIndex:t,refreshing:!0})},sse.prototype.checkResolve=function(i){var n,o,r=0;this.requestedInfo.forEach(function(e,t){((o=JSON.stringify(e.indexes)===JSON.stringify(i))||n)&&(0===t?(e.deferred.resolve(),r++,n=!0):n&&(e.isLoaded||!e.isNotLoaded)||o&&n?(e.deferred.resolve(),r++):o?e.isLoaded=!0:n=!1)}),this.requestedInfo.splice(0,r)},sse.prototype.getCellDataFromProp=function(e){var t={};return"[object Object]"===Object.prototype.toString.call(e)?e.formula?t.formula=e.formula:je(e.value)||("string"==typeof e.value&&(0===e.value.indexOf("http://")||0===e.value.indexOf("https://")||0===e.value.indexOf("ftp://")||0===e.value.indexOf("www."))?(t.hyperlink=e.value,t.style={textDecoration:"underline",color:"#00e"}):t.value=e.value):Poe(e)?t.formula=e:"string"==typeof e&&(0===e.indexOf("http://")||0===e.indexOf("https://")||0===e.indexOf("ftp://")||0===e.indexOf("www."))?(t.hyperlink=e,t.style={textDecoration:"underline",color:"#00e"}):t.value=e,t},sse.prototype.getLoadedInfo=function(t,i,e){var n=!0;return e.info.loadedRange.forEach(function(e){e[0]<=t&&t<=e[1]?e[0]<=i&&i<=e[1]?n=!1:t=e[1]+1:e[0]<=i&&i<=e[1]&&(i=e[0]-1)}),{isNotLoaded:n,unloadedRange:[t,i]}},sse.prototype.getMaxCount=function(e){if(e.query)for(var t=e.query.queries,i=0;i<t.length;i++)if("onTake"===t[i].fn)return Math.min(t[i].e.nos,e.info.count||t[i].e.nos);return e.info.count},sse.prototype.initRangeInfo=function(e){e.info||(e.info={loadedRange:[]})},sse.prototype.dataSourceChangedHandler=function(e){var n,o,r,t,i=this,s=this.parent.sheets[e.sheetIdx],a=s.ranges[e.rangeIdx];!a||!this.checkRangeHasChanges(s,e.rangeIdx)&&a.info||(o=a.showFieldAsHeader,r=ste(a.startCell),a.info&&(a.info.loadedRange.forEach(function(e){for(var t=e[0];t<=e[1]&&t<a.info.count+(o?1:0);t++)if(n=s.rows[t+r[0]])for(var i=r[1];i<r[1]+a.info.fldLen;i++)n.cells&&n.cells[i]&&delete n.cells[i]}),a.info=null),t={sheet:s,indexes:[0,0,s.rowCount-1,s.colCount-1],loadFullData:!0,promise:new Promise(function(e){e(void 0)})},this.updateSheetFromDataSourceHandler(t),t.promise.then(function(){i.parent.trigger("dataSourceChanged",{data:e.changedData,action:"dataSourceChanged",rangeIndex:e.rangeIdx,sheetIndex:e.sheetIdx}),i.parent.notify(doe,{sheetIndex:e.sheetIdx,checkWrap:!0,checkCF:!0})}))},sse.prototype.checkRangeHasChanges=function(e,t){return!this.parent.isAngular||e.changedRangeIdx===t&&(delete e.changedRangeIdx,!0)},sse.prototype.dataChangedHandler=function(d){var p,c,u,g,m,f,y,v,b,w=this,C=[{}],S=void 0===d.sheetIdx?this.parent.activeSheetIndex:d.sheetIdx,A=this.parent.sheets[S];A.ranges.forEach(function(e,t){if(e.dataSource){var i=void 0;if(g=ste(e.startCell),u=g.concat([g[0]+e.info.count+(e.showFieldAsHeader?0:-1),g[1]+e.info.fldLen-1]),"Row"===d.modelType||"Column"===d.modelType){if("Column"===d.modelType){if(d.insertType)m=u[1]<d.index&&u[3]>=d.index,v=[d.index],m||u[3]+1===d.index&&"after"===d.insertType?(d.model.forEach(function(){e.info.flds.splice(d.index-g[1],0,"")}),e.info.fldLen+=d.model.length):u[1]>=d.index&&(e.startCell=lte(g[0],g[1]+d.model.length));else if(m=u[1]<=d.startIndex&&u[3]>=d.startIndex)for(var n=d.startIndex;n<=d.endIndex;n++)n<=u[3]&&(e.info.flds.splice(d.startIndex,1),--e.info.fldLen);return}if(d.insertType){if(m=(e.showFieldAsHeader||"above"!==d.insertType&&!d.isMethod?u[0]<d.index:u[0]<=d.index)&&u[2]>=d.index,v=[d.index],m||u[2]+1===d.index&&"below"===d.insertType?(i=!0,e.info.count+=d.model.length):u[0]>=d.index&&(e.startCell=lte(g[0]+d.model.length,g[1])),d.isMethod)return}else m=u[0]<=d.startIndex&&u[2]>=d.startIndex,d.isDataRequest?v=[d.startIndex,u[1],d.startIndex,u[1]]:p="delete"}else{var o=d.address||d.range||d.fillRange,r=(v=rte(d.requestType&&d.requestType.toLowerCase().includes("paste")?d.pastedRange.substring(d.pastedRange.lastIndexOf("!")+1):-1<d.sheetIdx?d.address:o.substring(o.lastIndexOf("!")+1)),[e.showFieldAsHeader?u[0]+1:u[0]].concat(u.slice(1,4)));if(e.showFieldAsHeader&&v[0]===g[0])for(n=v[1];n<=v[3];n++)n>=r[1]&&n<=r[3]&&(e.info.flds[n-g[1]]=Kre(g[0],n,A,!1,!0).value||"");if(m=Voe(r,v,!0),"paste"===d.requestType&&d.copiedInfo.isCut){if(b=[].slice.call(d.copiedInfo.range),e.showFieldAsHeader&&b[0]===g[0]){for(n=b[1];n<=b[3];n++)n>=r[1]&&n<=r[3]&&(e.info.flds[n-g[1]]="");m=!1}f=Voe(r,b,!0)}}if(m||i||f){if("Row"!==d.modelType||d.insertType||d.isDataRequest){p=i?"add":"edit";var s=0;if(f)for(s=b[2]-b[0]+1,n=0;n<s;n++)!function(i){C[i]={},e.info.flds.forEach(function(e,t){e&&(c=Kre(b[0]+i,g[1]+t,A),C[i][""+e]=w.getFormattedValue(c))})}(n);if(m||i)for(var a,l=!(d.isDataRequest||f||i||d.skipFilterCheck),n=0,h=0;n<(i?d.model.length:v[2]-v[0]+1||1);n++)!function(i,n){if(l&&jde(A,v[0]+i))return a=n;C[n+s]={},e.info.flds.forEach(function(e,t){e&&(c=Kre(v[0]+i,g[1]+t,A),C[n+s][""+e]=w.getFormattedValue(c))}),a=++n}(n,h),h=a}else{if(d.deletedModel.forEach(function(i,n){C[n]={},e.info.flds.forEach(function(e,t){i.cells?(c=i.cells[g[1]+t],C[n][""+e]=w.getFormattedValue(c)):C[n][""+e]=null}),--e.info.count}),d.isMethod)return;y={count:d.deletedModel.length,index:d.endIndex}}d.isDataRequest?d.data=C:w.parent.trigger("dataSourceChanged",{data:C,action:p,rangeIndex:t,sheetIndex:S})}else y&&y.count&&u[0]>y.index&&(e.startCell=lte(g[0]-y.count,g[1]))}})},sse.prototype.getFormattedValue=function(e){var t=this.parent.getDisplayText(e);return""===t?null:e&&!e.format&&"number"==typeof e.value?e.value:t},sse.prototype.triggerDataChangeHandler=function(e){var t=!0;(t=("delete"===e.action||"insert"===e.action)&&-1<["Sheet"].indexOf(e.eventArgs.modelType)||"clear"===e.action&&-1<["Clear Formats","Clear Hyperlinks"].indexOf(e.eventArgs.type)||"clipboard"===e.action&&"Formats"===e.eventArgs.requestType?!1:t)&&-1<["insert","delete","edit","cellDelete","cellSave","autofill","clipboard","clear"].indexOf(e.action)&&(t=void 0,!e.isUndo||"delete"!==e.action&&"insert"!==e.action?t=e.eventArgs:(t=Pe({},e.eventArgs),"delete"===e.action?(t.index=t.startIndex,t.model=t.deletedModel,t.insertType="below"):(t.startIndex=t.index,t.endIndex=e.eventArgs.index+e.eventArgs.model.length-1,t.deletedModel=t.model,delete t.insertType)),this.parent.notify(cie,t))},sse.prototype.getModuleName=function(){return"dataBind"},sse.prototype.destroy=function(){this.removeEventListener(),this.parent=null,this.requestedInfo=[]};var rse=sse;function sse(e){this.parent=e,this.requestedInfo=[],this.addEventListener()}var ase="ribbon",lse="formulaBar",hse="sheetTabs",dse="refreshSheetTabs",pse="isFormulaBarEdit",cse="contentLoaded",use="mouseDown",gse="spreadsheetDestroyed",mse="editOperation",fse="formulaOperation",yse="formulaBarOperation",vse="click",bse="keyUp",wse="keyDown",Cse="verticalScroll",Sse="horizontalScroll",Ase="focusRenameInput",xse="beforeContentLoaded",Ise="beforeVirtualContentLoaded",Tse="virtualContentLoaded",Ese="cellNavigate",Dse="mouseUpAfterSelection",Mse="contextmenuBeforeOpen",kse="insertSheetTab",Pse="removeSheetTab",Bse="renameSheetTab",Fse="ribboClick",Lse="enableToolbarItems",Rse="tabSwitch",Ose="selectRange",Nse="rangeSelectionByKeydown",Vse="cut",_se="copy",Hse="paste",zse="clearCopy",jse="dataBound",Wse="beforeDataBound",Qse="addContextMenuItems",Use="removeContextMenuItems",qse="enableContextMenuItems",Gse="enableFileMenuItems",Yse="hideFileMenuItems",Xse="addFileMenuItems",Kse="hideRibbonTabs",Jse="enableRibbonTabs",Zse="addRibbonTabs",$se="addToolbarItems",eae="hideToolbarItems",tae="beforeRibbonCreate",iae="rowHeightChanged",nae="colWidthChanged",oae="onContentScroll",rae="deInitProperties",sae="activeSheetChanged",aae="initiateCustomSort",lae="applySort",hae="autoFitRowsColumns",dae="refreshFilterCellsOnResize",pae="updateToggleItem",cae="initiateHyperlink",uae="editHyperlink",gae="openHyperlink",mae="addNote",fae="editNote",yae="deleteNote",vae="showNote",bae="createNoteIndicator",wae="updateNoteContainer",Cae="removeNoteContainer",Sae="removeHyperlink",Aae="createHyperlinkElement",xae="sheetNameUpdate",Iae="hideSheet",Tae="performUndoRedo",Eae="updateUndoRedoCollection",Dae="setActionData",Mae="getBeforeActionData",kae="clearUndoRedoCollection",Pae="initiateFilterUI",Bae="renderFilterCell",Fae="refreshFilterRange",Lae="reapplyFilter",Rae="filterByCellValue",Oae="clearFilter",Nae="getFilteredColumn",Vae="actionComplete",_ae="filterCellKeyDown",Hae="getFilterRange",zae="setAutoFit",jae="refreshFormulaDatasource",Wae="initiatedatavalidation",Qae="invalidData",Uae="protectSheet",qae="applyProtect",Gae="protectCellFormat",Yae="renderGotoDlgt",Xae="renderFindDlg",Kae="findHandler",Jae="created",Zae="spreadsheetCreated",$ae="editAlert",ele="readonlyAlert",tle="finiteAlert",ile="setUndoRedo",nle="enableFormulaInput",ole="protectSelection",rle="hiddenMerge",sle="checkPrevMerge",ale="checkMerge",lle="removeDataValidation",hle="showAggregate",dle="goToSheet",ple="showSheet",cle="renderCFDlg",ule="clearViewer",gle="initiateFormulaReference",mle="initiateCur",fle="clearCellRef",yle="editValue",vle="addressHandle",ble="initiateEdit",wle="forRefSelRender",Cle="insertImage",Sle="refreshOverlayElem",Ale="refreshImgCellObj",xle="getRowIdxFromClientY",Ile="getColIdxFromClientX",Tle="createImageElement",Ele="deleteImage",Dle="deleteChart",Mle="refreshChartCellObj",kle="refreshChartCellModel",Ple="refreshImagePosition",Ble="updateTableWidth",Fle="focusBorder",Lle="clearChartBorder",Rle="insertChart",Ole="chartRangeSelection",Nle="insertDesignChart",Vle="removeDesignChart",_le="chartDesignTab",Hle="addChartEle",zle="undoRedoForChartDesign",jle="protectWorkbook",Wle="unProtectWorkbook",Qle="setProtectWorkbook",Ule="removeWorkbookProtection",qle="importProtectWorkbook",Gle="selectionStatus",Yle="freeze",Xle="overlayEleSize",Kle="updateScroll",Jle="positionAutoFillElement",Zle="hideAutoFillOptions",$le="performAutoFill",ehe="selectAutoFillRange",the="hideAutoFillElement",ihe="unProtectSheetPassword",nhe="updateTranslate",ohe="getUpdatedScrollPosition",rhe="updateScrollValue",she="beforeCheckboxfilterRenderer",ahe="refreshCheckbox",lhe="renderInsertDlg",hhe="toggleProtect",dhe="propertyChange",phe="updateWrapCell",che=(uhe.prototype.open=function(e){this.load(e)},uhe.prototype.load=function(t,e){var i=this;if(this.parent.allowOpen)if(t.jsonObject)this.fetchSuccess(t.jsonObject,t,null,!0,!0);else{var n=new FormData;if(t.file)n.append("file",t.file);else{if(!(0<=t.sheetIndex))return void(this.parent.isOpen=!1);n.append("sheetPassword",t.sheetPassword),n.append("sheetIndex",t.sheetIndex.toString())}var o={passWord:""},r=(t.password&&t.password.length&&(o.passWord=t.password),o.passWord&&o.passWord.length&&(t.password=o.passWord),t.password&&n.append("password",t.password),n.append("IsManualCalculationEnabled",("Manual"===this.parent.calculationMode).toString()),{file:t.file||null,cancel:!1,requestData:{method:"POST",body:n},password:o.passWord}),o=t.guid;je(t.sheetPassword)&&!o&&je(e)?(this.parent.trigger("beforeOpen",r),this.parent.notify(fie,{eventArgs:r,action:"beforeOpen"})):o&&n.append("guid",o),r.cancel?this.parent.isOpen=!1:(o={chunkSize:null,documentId:null},0<this.parent.openSettings.chunkSize&&je(t.sheetPassword)&&(this.setToDefaults(e),je(this.parent.openSettings.chunkSize)||0===this.parent.openSettings.chunkSize||(o.chunkSize=this.parent.openSettings.chunkSize.toString()),je(this.currentDocumentId)||(o.documentId=this.currentDocumentId),je(o)||n.append("chunkPayload",JSON.stringify(o))),fetch(this.parent.openUrl,r.requestData).then(function(e){return e.ok?e.json():Promise.reject({status:e.status,statusText:e.statusText,url:e.url})}).then(function(e){return i.fetchSuccess(e,r,t.orginalFile,void 0,!0)}).catch(function(e){-1===e.toString().indexOf("Unexpected end of JSON input")&&0<i.parent.openSettings.chunkSize&&i.retryCount<i.parent.openSettings.retryCount?setTimeout(function(){i.retryCount++,i.load(t,!0)},i.parent.openSettings.retryAfterDelay):(i.retryCount>=i.parent.openSettings.retryCount&&(i.retryCount=0),i.fetchFailure(e))}))}},uhe.prototype.fetchFailure=function(e){ee(e.status)&&ee(e.statusText)&&(e.statusText="Improper response"),this.parent.notify(_ie,e),this.parent.isOpen=!1},uhe.prototype.fetchSuccess=function(e,t,i,n,o){var e="string"==typeof e?JSON.parse(e):e,r=e.Workbook;if(je(r)){var s=e.chunkTotalCount,a=(this.currentDocumentId=e.documentId,this.chunkList=new Array(s),0),l=s>this.parent.openSettings.chunkSize?this.parent.openSettings.chunkSize:s,h=0;this.processedLoopIndex=0;if(!je(s))for(;a<s;)this.processChunk(a,l,h,"",t,i,n,o),l=(a+=this.parent.openSettings.chunkSize)+this.parent.openSettings.chunkSize<s?this.parent.openSettings.chunkSize:s-a,h++,this.processedLoopIndex++}else-1<["UnsupportedFile","InvalidUrl","NeedPassword","InCorrectPassword","InCorrectSheetPassword","CorrectSheetPassword","DataLimitExceeded","FileSizeLimitExceeded","ExternalWorkbook"].indexOf(r)?(i&&(t.file=i),this.parent.notify(Vie,{context:this,data:r,guid:e.Guid,eventArgs:t,isOpenFromJson:n})):(this.updateModel(r,n,o),this.parent.notify(Vie,{context:this,data:r,isOpenFromJson:n,eventArgs:t}),this.parent.isOpen=!1,t&&t.password&&0<t.password.length&&(this.parent.showSheetTabs&&(this.parent.element.querySelector(".e-add-sheet-tab").removeAttribute("disabled"),this.parent.element.querySelector(".e-add-sheet-tab").classList.remove("e-disabled")),this.parent.password=""))},uhe.prototype.processChunk=function(t,i,n,s,a,l,h,d){var p=this,e={currentChunk:t.toString(),chunkSize:i.toString(),loopIndex:n.toString(),documentId:this.currentDocumentId},o=new FormData,e=(o.append("chunkPayload",JSON.stringify(e)),{file:l||null,cancel:!1,requestData:{method:"POST",body:o},password:a.password});fetch(this.parent.openUrl,e.requestData).then(function(e){return e.ok?e.json():Promise.reject({status:e.status,statusText:e.statusText,url:e.url})}).then(function(e){if(""!==e){for(var t=atob(e.chunk),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);if(t=new TextDecoder("utf-8").decode(i),p.chunkList[e.loopIndex]=t,p.loopIndex++,p.loopIndex===p.processedLoopIndex){for(var o=p.chunkList.splice(0,p.loopIndex),r=0;r<o.length;r++)s+=o.slice(r,r+1).join("");e=JSON.parse(s),p.setToDefaults(),p.fetchSuccess(e,a,l,h,d)}}}).catch(function(e){if(je(p.currentFailedChunkIndex)||p.currentFailedChunkIndex===t){if(p.currentFailedChunkIndex=t,!(p.retryCount<p.parent.openSettings.retryCount))return p.retryCount=0,p.fetchFailure(e);setTimeout(function(){p.processedLoopIndex=n,p.processChunk(t,i,n,s,a,l,h,d),p.retryCount++},p.parent.openSettings.retryAfterDelay)}})},uhe.prototype.setToDefaults=function(e){this.currentFailedChunkIndex=null,e||(this.retryCount=0),this.loopIndex=0,this.processedLoopIndex=0,this.chunkList=[]},uhe.prototype.updateModel=function(e,t,i){this.parent.notify(Pie,{action:"unRegisterSheet"}),this.setSelectAllRange(e.sheets,t),this.parent.sheetNameCount=1,this.parent.sheets=[],this.parent.notify(zie,{}),this.parent.notify(kae,null),e.activeSheetIndex=e.activeSheetIndex||e.sheets.findIndex(function(e){return"Hidden"!==e.state}),this.parent.setProperties({isProtected:e.isProtected||!1,password:e.password||"",sheets:e.sheets,activeSheetIndex:e.activeSheetIndex,definedNames:e.definedNames||[],filterCollection:e.filterCollection||[],sortCollection:e.sortCollection||[],listSeparator:e.listSeparator||this.parent.listSeparator},!0),je(e.showSheetTabs)||(this.parent.showSheetTabs=e.showSheetTabs),jre(this.parent,void 0,i),this.parent.notify(Hie,null),this.parent.notify(Pie,{action:"registerSheet",isImport:!0}),this.parent.notify(Pie,{action:"initiateDefinedNames"}),this.parent.notify(xne,null)},uhe.prototype.setSelectAllRange=function(e,r){var s,a,l=this;e.forEach(function(e){var t,i,n;if(e.selectedRange&&(t=rte(e.selectedRange),i=(ee(e.rowCount)?100:e.rowCount)-1,n=(ee(e.colCount)?100:e.colCount)-1,65535===t[2]&&(t[2]=i),255===t[3]&&(t[3]=n),65535===t[0]&&(t[0]=i),255===t[1]&&(t[1]=n),e.selectedRange=hte(t)),r&&l.parent.isAngular)for(var o=0;o<l.parent.sheets.length;o++)if(s=_re(l.parent,o),e.name===s.name){e.ranges&&e.ranges.forEach(function(e,t){(a=s.ranges[t])&&a.template&&(e.template=a.template)});break}})},uhe.prototype.sheetsDestroyHandler=function(e){je(e.sheetIndex)&&(this.preventFormatCheck=null)},uhe.prototype.addEventListener=function(){this.parent.on(gie,this.open.bind(this)),this.parent.on(zie,this.sheetsDestroyHandler,this)},uhe.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(gie,this.open.bind(this)),this.parent.off(zie,this.sheetsDestroyHandler))},uhe.prototype.destroy=function(){this.removeEventListener(),this.parent.refreshing||(this.preventFormatCheck=null),this.parent=null},uhe.prototype.getModuleName=function(){return"workbookOpen"},uhe);function uhe(e){this.loopIndex=0,this.processedLoopIndex=0,this.retryCount=0,this.currentDocumentId=null,this.parent=e,this.addEventListener()}function ghe(e){this.parent=e}ghe.prototype.processSheet=function(e,t){return[t,JSON.parse(e,function(e,t){if(!Array.isArray(t)&&"string"!=typeof t||t.length)return t})]},ghe.prototype.processSave=function(e,t,r,i,s){var n,a=this,o=new FormData,l=Object.keys(t);for(o.append("JSONData",JSON.stringify(e)),n=0;n<l.length;n++)o.append(l[n],t[l[n]]);for(l=Object.keys(r),n=0;n<l.length;n++)o.append(l[n],r[l[n]]);o.append("pdfLayoutSettings",JSON.stringify(i)),fetch(t.url,{method:"POST",body:o}).then(function(e){return e.ok?e.blob():Promise.reject({message:e.statusText})}).then(function(o){new Promise(function(i){var n=new FileReader;n.onload=function(){var e=n.result.toString(),t=r.customParams&&"string"==typeof r.customParams&&"saveashtml"===r.customParams.toLowerCase();-1<e.indexOf("data:text/plain;base64,")||!t&&-1<e.indexOf("data:text/html;base64,")||-1<e.indexOf("data:application/json;base64,")?(t=void 0,(t=-1<(e=(e=e.replace("data:text/plain;base64,","")).replace("data:text/html;base64,","")).indexOf("data:application/json;base64,")?(e=e.replace("data:application/json;base64,",""),atob(e).split(".")):atob(e).split(/(\r\n|\n|\r)/gm)).length&&(e=1<t[0].length&&'"'===t[0][0]?t[0].split('"')[1]+".":t[0],s?s.apply(a,[{dialog:e}]):postMessage({dialog:e}))):s?s.apply(a,[o]):postMessage(o),i(n.result)},n.readAsDataURL(o)})}).catch(function(e){s?s.apply(a,[{error:e.message}]):postMessage({error:e.message})})},mhe=function(e,t){return(mhe=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])}))(e,t)};var mhe,fhe,yhe,vhe,bhe,whe=function(){return(whe=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Che=(function(e,t){function i(){this.constructor=e}mhe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(She,fhe=ghe),She.prototype.getModuleName=function(){return"workbookSave"},She.prototype.destroy=function(){this.removeEventListener(),this.parent=null},She.prototype.addEventListener=function(){this.parent.on(mie,this.initiateSave,this),this.parent.on("getStringifyObject",this.performStringifyAction,this)},She.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(mie,this.initiateSave),this.parent.off("getStringifyObject",this.performStringifyAction))},She.prototype.initiateSave=function(e){var t=e.saveSettings;this.saveSettings={saveType:t.saveType,url:t.url,fileName:t.fileName||"Sample"},this.isFullPost=e.isFullPost,this.needBlobData=e.needBlobData,this.needBlobData&&(this.isFullPost=!1),this.customParams=e.customParams,this.pdfLayoutSettings=e.pdfLayoutSettings,this.updateBasicSettings(),this.processSheets(t.autoDetectFormat,e.jsonConfig)},She.prototype.updateBasicSettings=function(){var e=this.getStringifyObject(this.parent,["sheets","_isScalar","observers","closed","isStopped","hasError","__isAsync","beforeCellFormat","beforeCellRender","beforeDataBound","beforeOpen","beforeSave","beforeSelect","beforeSort","cellEdit","cellEdited","cellEditing","cellSave","beforeCellSave","contextMenuItemSelect","contextMenuBeforeClose","contextMenuBeforeOpen","created","dataBound","fileMenuItemSelect","fileMenuBeforeClose","fileMenuBeforeOpen","saveComplete","sortComplete","select","actionBegin","actionComplete","afterHyperlinkClick","afterHyperlinkCreate","beforeHyperlinkClick","beforeHyperlinkCreate","openComplete","openFailure","queryCellInfo","dialogBeforeOpen","dataSourceChanged","beforeConditionalFormat","beforeCellUpdate"]),e=JSON.parse(e);this.parent.sheets.length&&(e.sheets=[]),this.saveJSON=e,this.saveJSON.filterCollection=[]},She.prototype.processSheets=function(e,t){var i,n=this,o=["dataSource","startCell","query","showFieldAsHeader","result"];if(this.parent.isAngular&&o.push("template"),t)if(t.onlyValues)o.push.apply(o,["style","formula","format","conditionalFormats","validation","hyperlink","wrap","chart","image","notes"]);else{var r,s={style:t.ignoreStyle,formula:t.ignoreFormula,format:t.ignoreFormat,conditionalFormats:t.ignoreConditionalFormat,validation:t.ignoreValidation,wrap:t.ignoreWrap,chart:t.ignoreChart,image:t.ignoreImage,notes:t.ignoreNote};for(r in t.ignoreFreezePane&&o.push.apply(o,["frozenColumns","frozenRows"]),s)s[r]&&o.push(r)}for(var a=0,l=this.parent.sheets.length;a<l;a++){for(var h,d=!1,p=!1,c=0,u=(h=this.parent.sheets[a]).ranges.length;c<u;c++)if((i=h.ranges[c]).dataSource&&(p=!0,!i.info||!i.info.loadedRange||!i.info.loadedRange.length)){d=!0;break}d?this.parent.notify(die,{sheet:h,sheetIndex:a,loadComplete:function(e){bte(n,n.processSheet,n.updateSheet,[n.getStringifyObject(n.parent.sheets[e],o,e,!1,!0),e],null,n.parent)}.bind(this,a),loadFromStartCell:!0,autoDetectFormat:e}):bte(this,this.processSheet,this.updateSheet,[this.getStringifyObject(h,o,a,e&&p,!0),a],null,this.parent)}},She.prototype.updateSheet=function(e){this.saveJSON.sheets[e[0]]=e[1],this.isProcessCompleted=this.getSheetLength(this.saveJSON.sheets)===this.parent.sheets.length,this.isProcessCompleted&&this.save(this.saveSettings)},She.prototype.getSheetLength=function(e){var t=0;return e.forEach(function(e){e&&t++}),t},She.prototype.save=function(e){var t={cancel:!1,jsonObject:this.saveJSON};this.parent.notify(ane,t),t.cancel||(this.isFullPost?(this.initiateFullPostSave(),this.saveJSON={}):bte(this,{workerTask:this.processSave},this.updateSaveResult,[this.saveJSON,e,this.customParams,this.pdfLayoutSettings],!0,this.parent))},She.prototype.updateSaveResult=function(e){var t;e.isFormDataError?this.processSave(this.saveJSON,this.saveSettings,this.customParams,this.pdfLayoutSettings,this.updateSaveResult):(this.saveJSON={},t={status:"Success",message:"",url:this.saveSettings.url,fileName:this.saveSettings.fileName,saveType:this.saveSettings.saveType,blobData:null},"object"==typeof e&&e.error?(t.status="Failure",t.message=e.error.toString()):"object"==typeof e&&e.dialog?this.parent.notify(Jne,{content:e.dialog}):this.needBlobData?t.blobData=e:this.ClientFileDownload(e),this.parent.trigger("saveComplete",t),this.parent.notify(Cie,t))},She.prototype.ClientFileDownload=function(e){var t=this.parent.createElement("a",{attrs:{download:this.getFileNameWithExtension()}}),e=URL.createObjectURL(e);t.href=e,document.body.appendChild(t),t.click(),URL.revokeObjectURL(e),document.body.removeChild(t)},She.prototype.initiateFullPostSave=function(){var e,t=Object.keys(this.saveSettings),i=this.parent.createElement("form",{attrs:{method:"POST",action:this.saveSettings.url}}),n=this.parent.createElement("input",{attrs:{type:"hidden",name:"JSONData"}});for(n.value=JSON.stringify(this.saveJSON),i.appendChild(n),e=0;e<t.length;e++)(n=this.parent.createElement("input",{attrs:{type:"hidden",name:t[e]}})).value=this.saveSettings[t[e]],i.appendChild(n);for(t=Object.keys(this.customParams),e=0;e<t.length;e++)(n=this.parent.createElement("input",{attrs:{type:"hidden",name:t[e]}})).value=this.customParams[t[e]],i.appendChild(n);(n=this.parent.createElement("input",{attrs:{type:"hidden",name:"pdfLayoutSettings"}})).value=JSON.stringify(this.pdfLayoutSettings),i.appendChild(n),document.body.appendChild(i),i.submit(),G(i),this.parent.notify(Cie,{})},She.prototype.performStringifyAction=function(e){e.model='{"jsonObject":{"Workbook":{"sheets":[';for(var t=0,i=this.parent.sheets.length-1;t<=i;t++)e.model+=this.getStringifyObject(this.parent.sheets[t],e.skipProps,t)+(t<i?",":"]}}}")},She.prototype.getStringifyObject=function(p,c,u,g,e){var m,f=this,y=(void 0===c&&(c=[]),0===u&&this.parent.notify(Qie,{clearAll:!0}),e&&this.parent.notify(wie,{sheetIdx:u,isSaveAction:!0,saveJson:this.saveJSON}),[]),v=g&&ore(this.parent),e=JSON.stringify(p,function(e,i){if(!(-1<c.indexOf(e))){if("cellStyle"===e)return f.parent.commonCellStyle;if(i&&i.cells)for(var t=0,n=i.cells.length;t<n;t++){var o=i.cells[t],r=[Number(e),t];if(o&&(o.value?g&&!o.formula&&v(o):o.formula&&o.formula.indexOf("=UNIQUE(")<0&&("Automatic"===f.parent.calculationMode&&f.parent.notify(Pie,{action:"refreshCalculate",value:o.formula,rowIndex:r[0],colIndex:t,isFormula:Poe(o.formula),sheetIndex:u,isRefreshing:!0}),o.value=Kre(r[0],t,p).value),o.chart)){y.push({index:r,chart:o.chart}),m=[];for(var s=0,a=o.chart.length;s<a;s++){var l=Object.assign({},o.chart[s]);delete l.id,m.push(l)}o.chart=m}}var h,d;return"validation"===e&&i&&"string"==typeof i.type&&"Time"===i.type&&["value1","value2"].forEach(function(e){var t=i[e]&&i[e].toString();t&&!mre(Number(t))&&(i[e]=f.getDateAsNumber({range:[],cell:{value:t}},t))}),i&&i.properties&&i.maxHgts&&(i.properties=whe({},i.properties,{maxHgts:i.maxHgts})),i&&"object"==typeof i&&i.hasOwnProperty("properties")?(i.propName&&"conditionalFormats"===i.propName.toString()&&(h=i.properties).format&&h.format.style&&(d=h.format.style)&&"#ffffff"===d.backgroundColor&&"#000000"===d.color&&"bold"!==d.fontWeight&&"italic"!==d.fontStyle&&"underline"!==d.textDecoration&&delete h.format,i.properties):null!==i?i:void 0}}),t=_re(this.parent,u);return y.forEach(function(e){Jre(e.index[0],e.index[1],t,{chart:e.chart},!0)}),e},She.prototype.getDateAsNumber=function(e,t){e={value:t,rowIndex:e.range[0],cell:e.cell,colIndex:e.range[1],sheetIndex:e.sheetIdx,updatedVal:""};return this.parent.notify(Fie,e),e.updatedVal||t},She.prototype.getFileNameWithExtension=function(e){e=e||this.saveSettings.fileName;var t=this.getFileExtension(),i=e.lastIndexOf(".");return(e=-1<i?e.substr(0,i):e)+t},She.prototype.getFileExtension=function(){return"."+this.saveSettings.saveType.toLowerCase()},She);function She(e){e=fhe.call(this,e)||this;return e.isProcessCompleted=!1,e.saveJSON={},e.isFullPost=!1,e.needBlobData=!1,e.customParams=null,e.pdfLayoutSettings={fitSheetOnOnePage:!1},e.addEventListener(),e}(yJ=yhe=yhe||{})[yJ.NA=0]="NA",yJ[yJ.Value=1]="Value",yJ[yJ.Ref=2]="Ref",yJ[yJ.DivZero=3]="DivZero",yJ[yJ.Num=4]="Num",yJ[yJ.Name=5]="Name",yJ[yJ.Null=6]="Null",yJ[yJ.Calc=7]="Calc",(qo=vhe=vhe||{})[qo.OperatorsCannotStartWithExpression=0]="OperatorsCannotStartWithExpression",qo[qo.ReservedWordAND=1]="ReservedWordAND",qo[qo.ReservedWordXOR=2]="ReservedWordXOR",qo[qo.ReservedWordIf=3]="ReservedWordIf",qo[qo.NumberContains2DecimalPoints=4]="NumberContains2DecimalPoints",qo[qo.ReservedWordElse=5]="ReservedWordElse",qo[qo.ReservedWordNOT=6]="ReservedWordNOT",qo[qo.InvalidCharInNumber=7]="InvalidCharInNumber",qo[qo.InvalidCharactersFollowingWithOperator=6]="InvalidCharactersFollowingWithOperator",qo[qo.MismatchedParentheses=8]="MismatchedParentheses",qo[qo.UnknownFormulaName=9]="UnknownFormulaName",qo[qo.RequiresASingleArgument=10]="RequiresASingleArgument",qo[qo.Requires3Args=11]="Requires3Args",qo[qo.InvalidMathArgument=12]="InvalidMathArgument",qo[qo.Requires2Args=13]="Requires2Args",qo[qo.BadIndex=14]="BadIndex",qo[qo.TooComplex=15]="TooComplex",qo[qo.CircularReference=16]="CircularReference",qo[qo.MissingFormula=17]="MissingFormula",qo[qo.ImproperFormula=18]="ImproperFormula",qo[qo.InvalidExpression=19]="InvalidExpression",qo[qo.CellEmpty=20]="CellEmpty",qo[qo.BadFormula=21]="BadFormula",qo[qo.EmptyExpression=22]="EmptyExpression",qo[qo.VirtualModeRequired=23]="VirtualModeRequired",qo[qo.MismatchedTics=24]="MismatchedTics",qo[qo.WrongNumberArguments=25]="WrongNumberArguments",qo[qo.InvalidArguments=26]="InvalidArguments",qo[qo.IterationsDoNotConverge=27]="IterationsDoNotConverge",qo[qo.CalculationOverflow=29]="CalculationOverflow",qo[qo.AlreadyRegistered=28]="AlreadyRegistered",qo[qo.MissingSheet=30]="MissingSheet",qo[qo.CannotParse=31]="CannotParse",qo[qo.ExpressionCannotEndWithAnOperator=32]="ExpressionCannotEndWithAnOperator",qo[qo.Spill=33]="Spill",qo[qo.Div=34]="Div",(yJ=bhe=bhe||{}).xlsx="xlsx",yJ.xlsm="xlsm",yJ.xlsb="xlsb",yJ.xltx="xltx",yJ.xltm="xltm",yJ.xls="xls",yJ.xml="xml",yJ.xlam="xlam",yJ.xla="xla",yJ.xlw="xlw",yJ.xlr="xlr",yJ.prn="prn",yJ.txt="txt",yJ.csv="csv",yJ.dif="dif",yJ.slk="slk";Ahe.prototype.getModuleName=function(){return"calc-common"};qo=Ahe;function Ahe(e){this.parent=e}function xhe(e){switch(e){case"dd-MMM-yyyy":case"dd MMM yyyy":e="medium";break;case"MMM yyyy":e="yMMM";break;case"MM/dd/yyyy":case"dd/MM/yyyy":case"dd/MM/yy":e="short";break;case"dddd MMMM dd yyyy":case"dd MMMM yyyy":e="long";break;case"d MMMM yyyy":e="yMMMd";break;case"yyyy":e="y";break;case"h:mm":e="Hm";break;case"h:mm tt":e="hm";break;case"h":e="H";break;case"h tt":e="h";break;case"dddd":e="E";break;case"h:mm:ss tt":e="hms";break;case"h:mm:ss":e="Hms";break;case"d":e="d";break;case"d dddd":e="Ed";break;case"M":e="M";break;case"Md":e="Md";break;case"MMM":e="MMM";break;case"ddd MMM d":e="MMMEd";break;case"MMM d":e="MMMd";break;case"M/yyyy":e="yM";break;case"ddd":e="E";break;default:e=""}return e}function Ihe(e){var t,i=!1;for(t in bhe)if(-1<e.indexOf("."+t+"]")){i=!0;break}return i}Ehe.prototype.init=function(){for(var e,t=0;t<this.formulas.length;t++)e=R("Compute"+this.formulas[t].formulaName,this).bind(this),this.addFormulaCollection(this.formulas[t].formulaName.toUpperCase(),e,this.formulas[t].category,this.formulas[t].description)},Ehe.prototype.addFormulaCollection=function(e,t,i,n){this.parent.libraryFormulas={fName:e,handler:t,category:i,description:n}},Ehe.prototype.ComputeSUM=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i,n,o,r=!1;if(e.length&&("isSubtotal"===(o=e[e.length-1])?(r=!0,e.pop()):"isAggregate"===o&&(n=this.parent.parentObject.getActiveSheet(),i=!0,e.pop())),je(e)||1===e.length&&""===e[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];var s,a,l=0,h=0;if(!je(e))for(var d=e,p=function(e){-1<e.toString().indexOf(".")&&(h=Math.max(h,e.split(".")[1].length))},c=0;c<d.length;c++){var u=d[c].toString();if(-1<u.indexOf(":")&&this.parent.isCellReference(u)){for(var g=this.parent.getCellCollection(u.split(this.parent.tic).join("")),m=0;m<g.length;m++)if(!(i&&(zde(n,(a=ste(g[m]))[0])||epe(n,a[1]))||(s=r?this.parent.getValueFromArg(g[m],null,null,!0):this.parent.getValueFromArg(g[m]),r&&s.includes("SUBTOTAL(")))){if(-1<this.parent.getErrorStrings().indexOf(s))return s;je(s[0])||isNaN(this.parent.parseFloat(s))||(p(s),l+=this.parent.parseFloat(s))}}else{if(-1<d[c].indexOf(this.parent.tic)&&(isNaN(this.parent.parseFloat(d[c].split(this.parent.tic).join("")))||""===d[c].split(this.parent.tic).join("").trim()))return this.parent.getErrorStrings()[yhe.Value];if(d[c].split(this.parent.tic).join("")===this.parent.trueValue&&(d[c]="1"),d[c].split(this.parent.tic).join("")===this.parent.falseValue&&(d[c]="0"),u=r?this.parent.getValueFromArg(d[c].split(this.parent.tic).join(""),null,null,!0):this.parent.getValueFromArg(d[c].split(this.parent.tic).join("")),!r||!u.includes("SUBTOTAL(")){if(-1<this.parent.getErrorStrings().indexOf(u))return u;je(u)||isNaN(this.parent.parseFloat(u))||0<u.length&&(p(u),l+=this.parent.parseFloat(u+""))}}}return-1<l.toString().indexOf(".")?l.toFixed(h):l},Ehe.prototype.ComputeINT=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=this.parent.getErrorStrings();if(""===t[0]&&1===t.length)return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(1<t.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(e=this.parent.getValueFromArg(t[0]),!(-1<n.indexOf(e))){if(e.toUpperCase()===this.parent.trueValue?e="1":e.toUpperCase()===this.parent.falseValue&&(e="0"),!this.parent.isCellReference(t[0])&&""===(e=-1===t[0].indexOf(this.parent.tic+this.parent.tic)?e.split(this.parent.tic).join(""):e).trim())return n[yhe.Value];if(-1<e.indexOf("%")&&(e=(.01*Number(e.split("%")[0])).toString()),isNaN(this.parent.parseFloat(e)))return n[yhe.Value];e=this.parent.parseFloat(e),e=Math.floor(e)}return e},Ehe.prototype.ComputeTODAY=function(){for(var e,t,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];return 1!==i.length||""!==i[0]?e=this.parent.formulaErrorStrings[vhe.InvalidArguments]:(t=new Date(Date.now()),"spreadsheet"===this.parent.parentObject.getModuleName()?(e=this.parent.parentObject.dateToInt(t),0===this.parent.parser.storedStringText.toUpperCase().indexOf("TODAY")&&""!==this.parent.cell&&this.parent.parentObject.setDateFormat(this.parent.getSheetId(this.parent.grid),this.parent.rowIndex(this.parent.cell)-1,this.parent.colIndex(this.parent.cell)-1)):e=t.getFullYear()+"/"+this.parent.calculateDate((t.getMonth()+1).toString())+"/"+this.parent.calculateDate(t.getDate().toString())),e},Ehe.prototype.ComputeWEEKDAY=function(){for(var e,t,i,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(""===n[0]&&je(n[1])||2<n.length)return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(""===n[0]&&""===n[1]||""===n[1])return this.parent.getErrorStrings()[yhe.Num].toString();if(1===n.length&&n.push("1"),-1<n[0].indexOf(this.parent.tic)&&""===n[0].split(this.parent.tic).join("").trim()||""===n[1].split(this.parent.tic).join("").trim()||-1<n[1].indexOf(this.parent.tic)&&isNaN(this.parent.parseFloat(n[1].split(this.parent.tic).join(""))))return this.parent.getErrorStrings()[yhe.Value];if(this.parent.isCellReference(n[0])){if(-1<(e=this.parent.getValueFromArg(n[0].split(this.parent.tic).join(""))||"0").indexOf(this.parent.tic))return this.parent.getErrorStrings()[yhe.Value]}else e=-1<n[0].indexOf(this.parent.tic)&&isNaN(this.parent.parseFloat(n[0].split(this.parent.tic).join("")))?this.parent.getValueFromArg(n[0]):this.parent.getValueFromArg(n[0].split(this.parent.tic).join(""))||"0";if(t=this.parent.isCellReference(n[1])?this.parent.getValueFromArg(n[1].split(this.parent.tic).join(""))||"0":this.parent.getValueFromArg(n[1].split(this.parent.tic).join("")),-1<this.parent.getErrorStrings().indexOf(e))return e;if(-1<this.parent.getErrorStrings().indexOf(t))return t;if(e=e===this.parent.trueValue?"1":e===this.parent.falseValue?"0":e,t=t===this.parent.trueValue?"1":t===this.parent.falseValue?"0":t,i=this.parent.parseFloat(e),t=this.parent.parseFloat(t),isNaN(t)||isNaN(i))return this.parent.getErrorStrings()[yhe.Value];if(i<0||2958465<i)return this.parent.getErrorStrings()[yhe.Num].toString();switch(t=parseInt(t.toString(),10),i=i<1?0:Math.floor(i)%7,t){case 1:case 17:i=i<=0?i+7:i;break;case 2:case 11:i=(i-=1)<=0?i+7:i;break;case 3:i=(i-=2)<0?i+7:i;break;case 12:i=7<(i+=5)?i-7:i;break;case 13:i=7<(i+=4)?i-7:i;break;case 14:i=7<(i+=3)?i-7:i;break;case 15:i=7<(i+=2)?i-7:i;break;case 16:i=7<(i+=1)?i-7:i;break;default:i=this.parent.getErrorStrings()[yhe.Num].toString()}return i},Ehe.prototype.ComputePROPER=function(){for(var e,t,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var o=this.parent.getErrorStrings();return i.length&&"nestedFormulaTrue"===i[i.length-1]&&(t=!0,i.pop()),je(i)||""===i[0].trim()&&1===i.length?this.parent.formulaErrorStrings[vhe.InvalidArguments]:1<i.length?this.parent.formulaErrorStrings[vhe.WrongNumberArguments]:(e=this.parent.getValueFromArg(i[0]).trim(),-1<o.indexOf(e)||(-1<i[0].indexOf(this.parent.tic)?i[0]!==e&&i[0].startsWith("n")?e=this.parent.removeTics(e.trim()):-1<(e=this.parent.removeTics(i[0].trim())).indexOf(this.parent.tic+this.parent.tic)&&(e=e.replace(/""/g,this.parent.tic)):!i[0].startsWith("n")&&2===e.split("%").length&&this.parent.isNumber(e.split("%")[0])&&(e=(Number(e.split("%")[0])/100).toString()),e=e.toLowerCase().replace(/\b\w/g,function(e){return e.toUpperCase()}).replace(/(\d)([a-z])/g,function(e,t,i){return t+i.toUpperCase()}),t&&(e=this.parent.tic+e+this.parent.tic)),e)},Ehe.prototype.ComputeSUMPRODUCT=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(je(t)||1===t.length&&""===t[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];for(var n=0,o=0,r=null,s=t,a=[],l=0;l<s.length;l++){var h=this.parent.getCellCollection(s[l]);if("#REF!"===h[0])return this.parent.getErrorStrings()[yhe.Name];a.push(h.length)}for(var d=0;d<a.length;d++)if(a[d]&&a[d+1]&&a[d]!==a[d+1])return this.parent.getErrorStrings()[yhe.Value];for(var p=0;p<s.length;++p){var c,u=s[p];if(u.startsWith(this.parent.tic)||!this.parent.isCellReference(u))return c=(g=this.parent.getValueFromArg(u)).indexOf('"'),-1<this.parent.getErrorStrings().indexOf(g)?g:-1<c?0:this.parent.getErrorStrings()[yhe.Value];var l=u.indexOf(":"),g=this.parent.rowIndex(u.substr(0,l)),m=this.parent.rowIndex(u.substr(l+1));if(!(-1!==g||-1===m)==(-1===g||-1!==m))return this.parent.getErrorStrings()[yhe.Name];m<g&&(g=(c=[m,g])[0],m=c[1]);var f=this.parent.colIndex(u.substr(0,l)),y=this.parent.colIndex(u.substr(l+1));if(y<f&&(f=(e=[y,f])[0],y=e[1]),null===r)for(o=(m-g+1)*(y-f+1),r=[],l=0;l<o;++l)r[l]=1;l=0;for(var v=g;v<=m;++v)for(var b=f;b<=y;++b){var w=this.getSheetReference(u)+this.parent.convertAlpha(b)+v,w=this.parent.getValueFromArg(w);if(-1<this.parent.getErrorStrings().indexOf(w))return w;if(isNaN(this.parent.parseFloat(w)))r[l]=0;else{if(isNaN(r[l]))return this.parent.getErrorStrings()[yhe.Name];r[l]=r[l]*this.parent.parseFloat(w)}l++}}for(l=0;l<o;++l)n+=r[l];return n},Ehe.prototype.ComputeROUNDUP=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=t.length;if(!je(t)&&2<n&&(l=this.parent.formulaErrorStrings[vhe.InvalidArguments]),1===n&&""!==t[0])e=t[0].indexOf('"'),o="TRUE"===(o=-1<(o=-1<t[0].indexOf('"')?t[0].replace('"',""):t[0]).indexOf('"')?o.replace('"',""):o).toUpperCase()?"1":"FALSE"===o?"0":o,o=this.parent.getValueFromArg(o),0<(a=this.parent.parseFloat(o))?a+=.4999999999:a<0&&(a-=.4999999999),l=(a=this.parent.parseFloat(a.toFixed(0))).toString();else if(2===n){if(e=-1<t[0].indexOf('"')?t[0].indexOf('"'):-1<t[1].indexOf('"')?t[1].indexOf('"'):-1,this.parent.isCellReference(t[0]))o=this.parent.getValueFromArg(t[0])||"0";else{if(-1<t[0].indexOf(this.parent.tic)&&(t[0].split(this.parent.tic).join("")===this.parent.trueValue||t[0].split(this.parent.tic).join("")===this.parent.falseValue))return this.parent.getErrorStrings()[yhe.Value];o=this.parent.getValueFromArg(t[0]).split(this.parent.tic).join("")}if(-1<this.parent.getErrorStrings().indexOf(o))return o;if(this.parent.isCellReference(t[1]))r=this.parent.getValueFromArg(t[1])||"0";else{if(-1<t[1].indexOf(this.parent.tic)&&(t[1].split(this.parent.tic).join("")===this.parent.trueValue||t[1].split(this.parent.tic).join("")===this.parent.falseValue))return this.parent.getErrorStrings()[yhe.Value];r=this.parent.getValueFromArg(t[1]).split(this.parent.tic).join("")}if(-1<this.parent.getErrorStrings().indexOf(r))return r;var o="TRUE"===o.toUpperCase()?"1":"FALSE"===o?"0":o,r="TRUE"===r.toUpperCase()?"1":"FALSE"===r?"0":r,n=isNaN(Number(o))||""===o.trim(),s=isNaN(Number(r))||""===r.trim();if((-1<t[0].indexOf('"')||this.parent.isCellReference(t[0]))&&n||(-1<t[1].indexOf('"')||this.parent.isCellReference(t[1]))&&s)return this.parent.getErrorStrings()[yhe.Value];var a,l,n=Math.ceil(this.parent.parseFloat(r));a=this.parent.parseFloat(o),l=(a=0<n?(r=2===(s=o.split(".")).length?s[1].length>=n?n:s[1].length:0,this.parent.parseFloat(this.preciseRound(a,r,"ROUNDUP"))):(0<a?a=a/Math.pow(10,-n)+.49999:a<0&&(a=a/Math.pow(10,-n)-.49999),0<a&&n<-9?+Math.pow(10,-n):this.parent.parseFloat(a.toFixed(0))*Math.pow(10,-n))).toString(),isNaN(a)&&(l=-1<n.toString().indexOf('"')?this.parent.getErrorStrings()[yhe.Value]:this.parent.getErrorStrings()[yhe.Name])}else l=-1<e?this.parent.getErrorStrings()[yhe.Value]:this.parent.formulaErrorStrings[vhe.InvalidArguments];return l},Ehe.prototype.ComputeROUNDDOWN=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=t.length;if(!je(t)&&2<n&&(l=this.parent.formulaErrorStrings[vhe.InvalidArguments]),1===n&&""!==t[0])e=t[0].indexOf('"'),o="TRUE"===(o=-1<(o=-1<t[0].indexOf('"')?t[0].replace('"',""):t[0]).indexOf('"')?o.replace('"',""):o).toUpperCase()?"1":"FALSE"===o?"0":o,o=this.parent.getValueFromArg(o),0<(a=this.parent.parseFloat(o))?a-=.4999999999:a<0&&(a+=.4999999999),l=(a=this.parent.parseFloat(a.toFixed(0))).toString();else if(2===n){if(e=-1<t[0].indexOf('"')?t[0].indexOf('"'):-1<t[1].indexOf('"')?t[1].indexOf('"'):-1,this.parent.isCellReference(t[0]))o=this.parent.getValueFromArg(t[0])||"0";else{if(-1<t[0].indexOf(this.parent.tic)&&(t[0].split(this.parent.tic).join("")===this.parent.trueValue||t[0].split(this.parent.tic).join("")===this.parent.falseValue))return this.parent.getErrorStrings()[yhe.Value];o=this.parent.getValueFromArg(t[0]).split(this.parent.tic).join("")}if(-1<this.parent.getErrorStrings().indexOf(o))return o;if(this.parent.isCellReference(t[1]))r=this.parent.getValueFromArg(t[1])||"0";else{if(-1<t[1].indexOf(this.parent.tic)&&(t[1].split(this.parent.tic).join("")===this.parent.trueValue||t[1].split(this.parent.tic).join("")===this.parent.falseValue))return this.parent.getErrorStrings()[yhe.Value];r=this.parent.getValueFromArg(t[1]).split(this.parent.tic).join("")}if(-1<this.parent.getErrorStrings().indexOf(r))return r;var o="TRUE"===o.toUpperCase()?"1":"FALSE"===o?"0":o,r="TRUE"===r.toUpperCase()?"1":"FALSE"===r?"0":r,n=isNaN(Number(o))||""===o.trim(),s=isNaN(Number(r))||""===r.trim();if((-1<t[0].indexOf('"')||this.parent.isCellReference(t[0]))&&n||(-1<t[1].indexOf('"')||this.parent.isCellReference(t[1]))&&s)return this.parent.getErrorStrings()[yhe.Value];var n=Math.ceil(this.parent.parseFloat(r)),a=this.parent.parseFloat(o),l=(a=0<n?(s=0,-1!==(r=o.indexOf("."))&&(s=n<=(s=o.length-r-1)?n:s),this.parent.parseFloat(this.preciseRound(a,s,"ROUNDDOWN"))):(0<a?a=a/Math.pow(10,-n)-.49999:a<0&&(a=a/Math.pow(10,-n)+.49999),0<a&&n<-9?+Math.pow(10,-n):this.parent.parseFloat(a.toFixed(0))*Math.pow(10,-n))).toString();isNaN(a)&&(l=-1<n.toString().indexOf('"')?this.parent.getErrorStrings()[yhe.Value]:this.parent.getErrorStrings()[yhe.Name])}else l=-1<e?this.parent.getErrorStrings()[yhe.Value]:this.parent.formulaErrorStrings[vhe.InvalidArguments];return l},Ehe.prototype.ComputeCOUNT=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=!1;if(e.length&&"isSubtotal"===e[e.length-1]&&(i=!0,e.pop()),je(e)||1===e.length&&""===e[0])return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];for(var n,o,r,s=e,a=0,l=0;l<s.length;l++)if(this.parent.isCellReference(n=s[l]))if(-1<n.indexOf(":"))for(var h=this.parent.getCellCollection(n.split(this.parent.tic).join("")),d=0;d<h.length;d++)o=i?this.parent.getValueFromArg(h[d],null,null,!0):this.parent.getValueFromArg(h[d]),i&&o.includes("SUBTOTAL(")||isNaN(this.parent.parseFloat(o))||0<n.length&&""!==o.trim()&&a++;else o=i?this.parent.getValueFromArg(n,null,null,!0):this.parent.getValueFromArg(n),i&&o.includes("SUBTOTAL(")||isNaN(this.parent.parseFloat(o))||0<n.length&&""!==o.trim()&&a++;else r=this.parent.getValueFromArg(n).split(this.parent.tic).join(""),0===n.length&&""===r.trim()?a++:isNaN(this.parent.parseFloat(r))&&n!==this.parent.trueValue&&n!==this.parent.falseValue||0<n.length&&""!==n.trim()&&""!==r.trim()&&a++;return a},Ehe.prototype.ComputeDATE=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(t.length&&"nestedFormulaTrue"===t[t.length-1]&&(e=!0,t.pop()),je(t)||1===t.length&&""===t[0])return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(3!==t.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];for(var n=[],o=0;o<t.length;++o)n[o]=this.parent.getValueFromArg(t[o]);n[0]=n[0]===this.parent.trueValue?"1":n[0]===this.parent.falseValue?"0":n[0],n[1]=n[1]===this.parent.trueValue?"1":n[1]===this.parent.falseValue?"0":n[1],n[2]=n[2]===this.parent.trueValue?"1":n[2]===this.parent.falseValue?"0":n[2];for(var r=0;r<n.length;r++){var s=n[r];if(-1<this.parent.getErrorStrings().indexOf(s))return s;if('""'===s||'"0"'===s&&'"0"'!==t[r]||'"TRUE"'===s||'"FALSE"'===s)return this.parent.getErrorStrings()[yhe.Value].toString()}var a=Math.floor(this.parent.parseFloat(n[0].split(this.parent.tic).join(""))),l=Math.floor(this.parent.parseFloat(n[1].split(this.parent.tic).join(""))),h=Math.floor(this.parent.parseFloat(n[2].split(this.parent.tic).join(""))),d=0;if(isNaN(a)||isNaN(l)||isNaN(h))return this.parent.getErrorStrings()[yhe.Value].toString();if(a<0&&l<=12||1e4<=a&&0<l)return this.parent.getErrorStrings()[yhe.Num].toString();for(;12<l;)l-=12,a++;if(0===(d=this.parent.getSerialDateFromDate(a,l,h)))return this.parent.getErrorStrings()[yhe.Num].toString();h=this.parent.fromOADate(d);if("Invalid Date"!==h.toString()){if(h.getFullYear()<1900||1e4<=h.getFullYear())return this.parent.getErrorStrings()[yhe.Num].toString();if(!e)return new Ti(this.parent.parentObject.locale||"en-US").formatDate(h,{type:"date",skeleton:"yMd"})}return d.toString()},Ehe.prototype.ComputeFLOOR=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(je(e)||1===e.length&&""===e[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];var i,n=e;if(2!==n.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(""===n[0]&&""===n[1]||""===n[0]&&!n[1].includes('"'))return 0;""!==n[1]||n[0].includes('"')||(n[1]="0");for(var o=0;o<n.length;o++){var r=n[o].split(this.parent.tic).join("").trim();if(""===r||-1<n[o].indexOf(this.parent.tic)&&isNaN(this.parent.parseFloat(r)))return this.parent.getErrorStrings()[yhe.Value];if(Boe(n[o])){if((i=(i=this.parent.getValueFromArg(n[o])||"0")===this.parent.trueValue?"1":i===this.parent.falseValue?"0":i).toUpperCase().match(/[A-Z]/)||i.includes('"')||!this.parent.isNumber(i))return this.parent.getErrorStrings()[yhe.Value]}else if((i=(i=this.parent.getValueFromArg(n[o].split(this.parent.tic).join("")))===this.parent.trueValue?"1":i===this.parent.falseValue?"0":i).toUpperCase().match(/[A-Z]/)||i.includes('"')||!this.parent.isNumber(i))return this.parent.getErrorStrings()[yhe.Value];n[o]=i}var s=this.parent.parseFloat(n[0]),a=this.parent.parseFloat(n[1]);return 0<s&&a<0?this.parent.getErrorStrings()[yhe.Num]:(0<s||s<0)&&0===a?this.parent.getErrorStrings()[yhe.DivZero]:isNaN(s)?this.parent.getErrorStrings()[yhe.Name]:0===s&&0===a?0:Math.floor(s/a)*a},Ehe.prototype.ComputeCEILING=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(je(e)||1===e.length&&""===e[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];var i,n=e;if(2!==n.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(""===n[0]&&""===n[1]||""===n[0]&&!n[1].includes('"'))return 0;""!==n[1]||n[0].includes('"')||(n[1]="0");for(var o=0;o<n.length;o++){var r=n[o].split(this.parent.tic).join("").trim();if(""===r||-1<n[o].indexOf(this.parent.tic)&&isNaN(this.parent.parseFloat(r)))return this.parent.getErrorStrings()[yhe.Value];if(Boe(n[o])){if((i=(i=this.parent.getValueFromArg(n[o])||"0")===this.parent.trueValue?"1":i===this.parent.falseValue?"0":i).toUpperCase().match(/[A-Z]/)||i.includes('"')||!this.parent.isNumber(i))return this.parent.getErrorStrings()[yhe.Value]}else if((i=(i=this.parent.getValueFromArg(n[o].split(this.parent.tic).join("")))===this.parent.trueValue?"1":i===this.parent.falseValue?"0":i).toUpperCase().match(/[A-Z]/)||i.includes('"')||!this.parent.isNumber(i))return this.parent.getErrorStrings()[yhe.Value];n[o]=i}var s=this.parent.parseFloat(n[0]),a=this.parent.parseFloat(n[1]);return 0<s&&a<0?this.parent.getErrorStrings()[yhe.Num]:isNaN(s)?this.parent.getErrorStrings()[yhe.Name]:(0<s||0===s)&&0===a?0:Math.ceil(s/a)*a},Ehe.prototype.ComputeDAY=function(){for(var e,t,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var o=this.parent.getErrorStrings();if(je(i)||1===i.length&&""===i[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(1<i.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(i[0].startsWith(this.parent.tic)){if(""===(t=i[0].split(this.parent.tic).join(""))||t===this.parent.trueValue||t===this.parent.falseValue)return o[yhe.Value]}else if(t=this.parent.getValueFromArg(i[0].split(this.parent.tic).join("")),this.parent.isCellReference(i[0])&&-1<t.indexOf(this.parent.tic))return o[yhe.Value];return-1<o.indexOf(t)?t:Number(t)<0?o[yhe.Num]:0===Math.floor(Number(t))||t===this.parent.falseValue?0:t===this.parent.trueValue?1:(e=this.parent.isNaN(Number(t))?this.parent.parseDate(t):this.parent.intToDate(t),"NaN"===(e="[object Date]"===Object.prototype.toString.call(e)?new Date(e).getFullYear()<1900||9999<new Date(e).getFullYear()?this.parent.isNumber(t)?"Num":"NaN":e.getDate():e).toString()?o[yhe.Value]:"Num"===e.toString()?o[yhe.Num]:e)},Ehe.prototype.ComputeIF=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(t.length&&"nestedFormulaTrue"===t[t.length-1]&&(e=!0,t.pop()),je(t)||1===t.length&&""===t[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(0<this.parent.getErrorStrings().indexOf(t[0]))return t[0];var n,o,r=t;if(4===r.length&&"nestedFormulaTrue"===r[3]&&(n=!0,r.pop()),3<r.length||1===r.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(r.length<=3){var s=void 0,a=void 0,l="",h=this.parent.getValueFromArg(r[0]);if(-1<this.parent.getErrorStrings().indexOf(h))return h;var d=h.toUpperCase(),h=this.parent.parseFloat(h);if(d===this.parent.trueValue||h<0||0<h){if(e&&r[1].includes(":")){for(var s=this.parent.getCellCollection(r[1]),p=0;p<s.length;p++)a=this.parent.getValueFromArg(s[p]),isNaN(this.parent.parseFloat(a))||(l+=a+",");return l.slice(0,l.length-1)}o=""===r[1]?"0":this.parent.getValueFromArg(r[1])}else{if(d!==this.parent.falseValue&&0!==h)return this.parent.formulaErrorStrings[vhe.Requires3Args];if(je(r[2]))return this.parent.falseValue;if(e&&r[2].includes(":")){s=this.parent.getCellCollection(r[2]);for(p=0;p<s.length;p++)a=this.parent.getValueFromArg(s[p]),isNaN(this.parent.parseFloat(a))||(l+=a+",");return l.slice(0,l.length-1)}o=""===r[2]?"0":this.parent.getValueFromArg(r[2])}}return!n&&-1<o.indexOf(this.parent.tic)?o.split(this.parent.tic).join(""):""===o?"0":o},Ehe.prototype.ComputeIFERROR=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(je(e)||1===e.length&&""===e[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];var i,n=e;if(2!==n.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(this.parent.isCellReference(n[0])){if(i=this.parent.getValueFromArg(n[0])||"0",-1===this.parent.getErrorStrings().indexOf(i)&&"NaN"!==i)return i}else if(i=this.parent.getValueFromArg(n[0],null,!0)||"0",-1===this.parent.getErrorStrings().indexOf(i)&&"NaN"!==i)return i=i.split(this.parent.tic).join("").trim();return i=this.parent.isCellReference(n[1])?this.parent.getValueFromArg(n[1])||"0":(i=this.parent.getValueFromArg(n[1])||"0").split(this.parent.tic).join("").trim()},Ehe.prototype.ComputePRODUCT=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=!1;if(e.length&&"isSubtotal"===e[e.length-1]&&(i=!0,e.pop()),je(e)||1===e.length&&""===e[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];var n,o,r=1,s=!0;if(!je(e))for(var a=e,l=0;l<a.length;l++){var h,d=a[l];if(-1<d.indexOf(":")&&this.parent.isCellReference(d)){for(var p=this.parent.getCellCollection(d),c=0;c<p.length;c++)if(n=i?this.parent.getValueFromArg(p[c],null,null,!0):this.parent.getValueFromArg(p[c]),(!i||!n.includes("SUBTOTAL("))&&mre(n)){if(-1<this.parent.getErrorStrings().indexOf(n))return n;o=this.parent.parseFloat(n),isNaN(o)||0<n.length&&(r*=o,s=!1)}}else if(-1===d.indexOf(":")&&this.parent.isCellReference(d)){if(h=i?this.parent.getValueFromArg(a[l],null,null,!0):this.parent.getValueFromArg(a[l]),i&&h.includes("SUBTOTAL("))continue;if(!mre(h))continue;if(-1<this.parent.getErrorStrings().indexOf(h))return h}else{if(-1<(h=a[l]).indexOf(this.parent.tic)&&""===h.split(this.parent.tic).join("").trim()||-1<a[l].indexOf(this.parent.tic)&&isNaN(this.parent.parseFloat(h.split(this.parent.tic).join(""))))return this.parent.getErrorStrings()[yhe.Value];if(h=(h=this.parent.getValueFromArg(a[l].split(this.parent.tic).join("")))===this.parent.trueValue?"1":h===this.parent.falseValue?"0":h.split(this.parent.tic).join(""),-1<this.parent.getErrorStrings().indexOf(h))return h}o=this.parent.parseFloat(h),isNaN(o)||0<h.length&&(r*=o,s=!1)}return s?"0":r.toString()},Ehe.prototype.ComputeDAYS=function(){for(var i=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,o,r=this.parent.getErrorStrings();return je(e)&&1===e.length&&""===e[0]?this.parent.formulaErrorStrings[vhe.InvalidArguments]:2!==e.length?this.parent.formulaErrorStrings[vhe.WrongNumberArguments]:(o=(n=function(e){var t=i.parent.getValueFromArg(e).trim();if(-1<t.indexOf(i.parent.tic)&&(""===(t=t.split(i.parent.tic).join("").trim())||i.parent.isCellReference(e)||t.toUpperCase()===i.parent.trueValue||t.toUpperCase()===i.parent.falseValue))return r[yhe.Value];if((t=t.split(i.parent.tic).join("")).toUpperCase()===i.parent.trueValue)t="1";else if(""===t||t.toUpperCase()===i.parent.falseValue)t="0";else if(Number(t)<0)return r[yhe.Num];e={value:t.toString()};return i.parent.parentObject.notify(Fie,e),t=e.isDate||e.isTime?(i.parent.parseDate(t).getTime()/864e5).toString():t})(e[0]),-1<r.indexOf(o)?o:(n=n(e[1]),-1<r.indexOf(n)?n:(o=Math.floor(Number(o))-Math.floor(Number(n)),isNaN(o)?r[yhe.Value]:o)))},Ehe.prototype.ComputeUNIQUE=function(){for(var e,i=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=this.parent.getErrorStrings();if("isComputeExp"===t[t.length-1]&&(e=!0,t.pop()),je(t)||""===t[0]&&1===t.length)return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(3<t.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];function R(e){var t;return je(e)?i.parent.falseValue:(t=i.parent.getValueFromArg(e),-1<o.indexOf(t)?t:0===Number(t)?i.parent.falseValue:Number(t)<0||0<Number(t)?i.parent.trueValue:(t=i.parent.isCellReference(e)?t:i.parent.removeTics(t)).toUpperCase()===i.parent.trueValue||t.toUpperCase()===i.parent.falseValue?t.toUpperCase():-1<t.indexOf(i.parent.tic)||-1<e.indexOf(i.parent.tic)?o[yhe.Value]:o[yhe.Name])}var r=R(t[1]);if(-1<o.indexOf(r))return r;var s=R(t[2]);if(-1<o.indexOf(s))return s;var a=[];if(-1<t[0].indexOf(":")){je(t[0].match(/[0-9]/))?(l=t[0].split(":"),t[0]=l[0]+"1:"+l[1]+(this.parent.spreadSheetUsedRange[0]+1)):je(t[0].toUpperCase().match(/[A-Z]/))&&(l=t[0].split(":"),t[0]="A"+l[0]+":"+_he(this.parent.spreadSheetUsedRange[1]+1)+l[1]);var l=t[0].split(":");if(this.parent.isCellReference(l[0])&&this.parent.isCellReference(l[1])){for(var h=this.parent.dependencyCollection,d=0;d<h.length&&!e;d++)h[d].split(":")[0]===t[0].split(":")[0]&&this.clearDependency(h[d]);-1===this.parent.dependencyCollection.indexOf(t[0])?e||this.parent.dependencyCollection.push(t[0]):this.clearDependency(t[0]);var p,l=t[0].indexOf(":"),c=void 0,u=this.parent.rowIndex(this.parent.substring(t[0],0,l)),g=this.parent.colIndex(this.parent.substring(t[0],0,l)),m=this.parent.rowIndex(this.parent.substring(t[0],l+1,l+t[0].length-l-1)),l=this.parent.colIndex(this.parent.substring(t[0],l+1,l+t[0].length-l-1)),c=(m<u&&(c=m,m=u,u=c),l<g&&(c=l,l=g,g=c),""),f=(0===t[0].indexOf("!")&&(c=t[0].substring(0,t[0].replace("!","").indexOf("!")+2)),t[0]=c+_he(g)+u+":"+_he(l)+m,l-g),y=this.parent.getCellCollection(t[0]),v=void 0,v=p=this.parent.actCell;if(r===this.parent.falseValue)if(0==f)for(d=0;d<y.length;d++){var b=this.parent.getValueFromArg(y[d]);a.push(b=""===b?"0":b)}else for(var w="",C=f,d=0;d<y.length;d++)d===y.length-1&&(b=this.parent.getValueFromArg(y[d]),a.push((w=w+(b=""===b?"0":b)+"++").substring(0,w.length-2))),w=d<=C?w+(b=""===(b=this.parent.getValueFromArg(y[d]))?"0":b)+"++":(a.push(w.substring(0,w.length-2)),C=f+d,(b=""===(b=this.parent.getValueFromArg(y[d]))?"0":b)+"++");else for(var w="",C=1+f,O=m-u,d=0;d<C;d++){for(var S=0;S<=O;S++)w=w+(b=""===(b=this.parent.getValueFromArg(y[S*C+d]))?"0":b)+"++";a.push(w.substring(0,w.length-2)),w=""}for(var A,N=[],x=[],I=[],V=[],d=0;d<a.length;d++)(-1===N.indexOf(a[d].toLowerCase())?(N.push(a[d].toLowerCase()),I):(-1===x.indexOf(a[d].toLowerCase())&&x.push(a[d].toLowerCase()),V)).push(a[d]);if(s===this.parent.trueValue){for(var _=[],d=0;d<I.length;d++)-1===x.indexOf(I[d].toLowerCase())&&_.push(I[d]);if(0===(I=_).length)return o[yhe.Calc]}if(e)return 0!=f?(A=[],I.forEach(function(e){A=A.concat(e.split("++"))})):A=r===this.parent.falseValue?I:I[0].split("++"),A;-1<v.indexOf("!")&&(v=v.substring(v.lastIndexOf("!")+1));var T=this.parent.rowIndex(v),E=this.parent.colIndex(v);if(0===this.parent.dependencyLevel){var D=!1;if(r===this.parent.falseValue)for(d=T,C=I.length+T;d<C;d++)for(var M=E,k=(B=I[0].split("++")).length+E;M<k;M++)d===C-1&&M===k-1&&-1===this.parent.uniqueRange.indexOf(p+":"+_he(M)+d)&&this.parent.uniqueRange.push(p+":"+_he(M)+d),this.checkSpill(M,d)&&(D=!0);else for(d=E,C=I.length+E;d<C;d++)for(var P=T,k=(B=I[0].split("++")).length+T;P<k;P++)d===C-1&&P===k-1&&-1===this.parent.uniqueRange.indexOf(this.parent.actCell+":"+_he(d)+P)&&this.parent.uniqueRange.push(this.parent.actCell+":"+_he(d)+P),this.checkSpill(d,P)&&(D=!0);if(D)return this.parent.formulaErrorStrings[vhe.Spill]}else if(0<this.parent.dependencyLevel&&-1<this.parent.getValueFromArg(_he(E)+T,!0).indexOf("#SPILL!"))return this.parent.formulaErrorStrings[vhe.Spill];if(r===this.parent.falseValue){var c=this.parent.getSheetFamilyItem(this.parent.grid),H="",z=void 0;null!==c.sheetNameToParentObject&&0<c.sheetNameToParentObject.size&&(z=(H=c.parentObjectToToken.get(this.parent.grid))+v);for(d=0;d<I.length;d++){var B=I[d].split("++");0<d&&(T++,E=this.parent.colIndex(v));for(var F=0;F<B.length;F++)this.setValueRefresh(B[F],T,E),(0<d||0<F)&&this.parent.refresh(H+_he(E)+T.toString(),z),B[F+1]&&E++}}else for(d=0;d<I.length;d++)for(var B=I[d].split("++"),L=0;L<B.length;L++)this.setValueRefresh(B[L],T,E),B[L+1]?T++:(E++,T=this.parent.rowIndex(v));g=I[0].split("++")[0]}}else if(this.parent.isCellReference(t[0]))-1===this.parent.dependencyCollection.indexOf(t[0])?e||this.parent.dependencyCollection.push(t[0]):this.clearDependency(t[0]),g=this.parent.getValueFromArg(t[0]);else{if(g=this.parent.getValueFromArg(t[0].trim()),-1<o.indexOf(g))return g;g=this.parent.removeTics(g)}return g},Ehe.prototype.setValueRefresh=function(e,t,i){this.parent.parentObject.setValueRowCol(this.parent.getSheetId(this.parent.grid),e,t,i)},Ehe.prototype.checkSpill=function(e,t){var i,n=!1,o=this.parent.getValueFromArg(_he(e)+t,!0),e="!"+this.parent.getSheetID(this.parent.grid)+"!"+_he(e)+t;return this.parent.getFormulaInfoTable().get(e)&&(i=this.parent.getFormulaInfoTable().get(e).formulaText),n=o&&(o.toUpperCase().indexOf("UNIQUE")<0||i&&!i.toUpperCase().includes("UNIQUE"))&&o!==this.parent.formulaErrorStrings[vhe.WrongNumberArguments]?!0:n},Ehe.prototype.clearDependency=function(e){for(var t=this.parent.actCell,i="",n=(-1<t.lastIndexOf("!")&&(t=(r=t).substring(r.lastIndexOf("!")+1),i=r.substring(0,r.lastIndexOf("!"))+"!"),this.parent.rowIndex(t)),o=this.parent.colIndex(t),r=e.indexOf(":"),s=this.parent.rowIndex(this.parent.substring(e,0,r)),a=this.parent.colIndex(this.parent.substring(e,0,r)),l=this.parent.rowIndex(this.parent.substring(e,r+1,r+e.length-r-1))-s+n,h=this.parent.colIndex(this.parent.substring(e,r+1,r+e.length-r-1))-a+o,d=this.parent.getFormulaInfoTable().get("!"+this.parent.getSheetID(this.parent.grid)+"!"+t)?this.parent.getFormulaInfoTable().get("!"+this.parent.getSheetID(this.parent.grid)+"!"+t).getFormulaText():"",p=n;p<=l;p++)for(var c=o;c<=h;c++)if(0<this.parent.dependencyLevel||-1<d.indexOf("UNIQUE")){if(-1<this.parent.getValueFromArg("!"+this.parent.getSheetID(this.parent.grid)+"!"+_he(o)+n,!0).indexOf("#SPILL!"))return;this.parent.parentObject.setValueRowCol(this.parent.getSheetID(this.parent.grid)+1,"",p,c),this.parent.refresh("!"+this.parent.getSheetID(this.parent.grid)+"!"+_he(c)+p,t),this.parent.actCell=i+t}},Ehe.prototype.ComputeT=function(){for(var e,t,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var o=this.parent.getErrorStrings();if(i.length&&"nestedFormulaTrue"===i[i.length-1]&&(t=!0,i.pop()),je(i)||1===i.length&&""===i[0].trim())return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(1<i.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(e=this.parent.getValueFromArg(i[0]).trim(),!(-1<o.indexOf(e))){if(-1<i[0].indexOf(this.parent.tic))-1<(e=this.parent.removeTics(i[0].trim())).indexOf(this.parent.tic+this.parent.tic)&&(e=e.replace(/""/g,this.parent.tic));else if(2===e.split("%").length&&this.parent.isNumber(e.split("%")[0])&&(e=(Number(e.split("%")[0])/100).toString()),this.parent.isNumber(e)||e.toUpperCase()===this.parent.trueValue||e.toUpperCase()===this.parent.falseValue)return"";t&&(e=this.parent.tic+e+this.parent.tic)}return e},Ehe.prototype.ComputeHOUR=function(){for(var e,t,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];if(1!==i.length||je(i)||""===i[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(""===i[0].split(this.parent.tic).join("").trim())return this.parent.getErrorStrings()[yhe.Value];if(this.parent.isCellReference(i[0])){if(-1<(e=this.parent.getValueFromArg(i[0].split(this.parent.tic).join(""))||"0").indexOf(this.parent.tic))return this.parent.getErrorStrings()[yhe.Value]}else{if(-1<i[0].indexOf(this.parent.tic)&&(i[0].split(this.parent.tic).join("")===this.parent.trueValue||i[0].split(this.parent.tic).join("")===this.parent.falseValue))return this.parent.getErrorStrings()[yhe.Value];e=this.parent.getValueFromArg(i[0]).split(this.parent.tic).join("")}if(-1<this.parent.getErrorStrings().indexOf(e))return e;if(e=e===this.parent.trueValue?"1":e===this.parent.falseValue?"0":e,this.parent.isNumber(e)){if(this.parent.parseFloat(e)<0||2958465<this.parent.parseFloat(e))return this.parent.getErrorStrings()[yhe.Num];t=this.parent.intToTime(e)}else{var o={value:e.toString()};if(this.parent.parentObject.notify(Fie,o),!o.isDate&&!o.isTime)return this.parent.getErrorStrings()[yhe.Value];t=o.dateObj}return"Invalid Date"===(t="Invalid Date"===t.toString()?new Date(Date.parse(e)):t).toString()&&(o=new Date(Date.now()).toLocaleDateString()+" "+e,t=new Date(Date.parse(o))),"Invalid Date"===(t="Invalid Date"===t.toString()?this.parent.fromOADate(this.parent.parseFloat(e)):t).toString()||t.getFullYear()<1900||9999<t.getFullYear()?this.parent.getErrorStrings()[yhe.Value]:t.getHours()},Ehe.prototype.ComputeMINUTE=function(){for(var e,t,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];if(1!==i.length||je(i)||""===i[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(""===i[0].split(this.parent.tic).join("").trim())return this.parent.getErrorStrings()[yhe.Value];if(this.parent.isCellReference(i[0])){if(-1<(e=this.parent.getValueFromArg(i[0].split(this.parent.tic).join(""))||"0").indexOf(this.parent.tic))return this.parent.getErrorStrings()[yhe.Value]}else{if(-1<i[0].indexOf(this.parent.tic)&&(i[0].split(this.parent.tic).join("")===this.parent.trueValue||i[0].split(this.parent.tic).join("")===this.parent.falseValue))return this.parent.getErrorStrings()[yhe.Value];e=this.parent.getValueFromArg(i[0]).split(this.parent.tic).join("")}if(-1<this.parent.getErrorStrings().indexOf(e))return e;if(e=e===this.parent.trueValue?"1":e===this.parent.falseValue?"0":e,this.parent.isNumber(e)){if(this.parent.parseFloat(e)<0||2958465<this.parent.parseFloat(e))return this.parent.getErrorStrings()[yhe.Num];t=this.parent.intToTime(e)}else{var o={value:e.toString()};if(this.parent.parentObject.notify(Fie,o),!o.isDate&&!o.isTime)return this.parent.getErrorStrings()[yhe.Value];t=o.dateObj}return"Invalid Date"===(t="Invalid Date"===t.toString()?new Date(Date.parse(e)):t).toString()&&(o=new Date(Date.now()).toLocaleDateString()+" "+e,t=new Date(Date.parse(o))),"Invalid Date"===(t="Invalid Date"===t.toString()?this.parent.fromOADate(this.parent.parseFloat(e)):t).toString()||t.getFullYear()<1900||9999<t.getFullYear()?this.parent.getErrorStrings()[yhe.Value]:t.getMinutes()},Ehe.prototype.ComputeSECOND=function(){for(var e,t,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];if(1!==i.length||je(i)||""===i[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(""===i[0].split(this.parent.tic).join("").trim())return this.parent.getErrorStrings()[yhe.Value];if(this.parent.isCellReference(i[0])){if(-1<(e=this.parent.getValueFromArg(i[0].split(this.parent.tic).join(""))||"0").indexOf(this.parent.tic))return this.parent.getErrorStrings()[yhe.Value]}else{if(-1<i[0].indexOf(this.parent.tic)&&(i[0].split(this.parent.tic).join("")===this.parent.trueValue||i[0].split(this.parent.tic).join("")===this.parent.falseValue))return this.parent.getErrorStrings()[yhe.Value];e=this.parent.getValueFromArg(i[0]).split(this.parent.tic).join("")}if(-1<this.parent.getErrorStrings().indexOf(e))return e;if(e=e===this.parent.trueValue?"1":e===this.parent.falseValue?"0":e,this.parent.isNumber(e)){if(this.parent.parseFloat(e)<0||2958465<this.parent.parseFloat(e))return this.parent.getErrorStrings()[yhe.Num];t=this.parent.intToTime(e)}else{var o={value:e.toString()};if(this.parent.parentObject.notify(Fie,o),!o.isDate&&!o.isTime)return this.parent.getErrorStrings()[yhe.Value];t=o.dateObj}return"Invalid Date"===(t="Invalid Date"===t.toString()?new Date(Date.parse(e)):t).toString()&&(o=new Date(Date.now()).toLocaleDateString()+" "+e,t=new Date(Date.parse(o))),"Invalid Date"===(t="Invalid Date"===t.toString()?this.parent.fromOADate(this.parent.parseFloat(e)):t).toString()||t.getFullYear()<1900||9999<t.getFullYear()?this.parent.getErrorStrings()[yhe.Value]:t.getSeconds()},Ehe.prototype.ComputeMONTH=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this.parent.getErrorStrings();if(1===e.length&&""===e[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(1!==e.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];var n=this.parent.getValueFromArg(e[0]).trim();if(-1<i.indexOf(n))return n;if(this.parent.isCellReference(e[0])){if(-1<n.indexOf(this.parent.tic))return i[yhe.Value];if(""===n)return 1}else{if('"TRUE"'===n.toUpperCase()||'"FALSE"'===n.toUpperCase())return i[yhe.Value];n=n.split(this.parent.tic).join("")}if(""===n)return i[yhe.Value];if(n===this.parent.trueValue||n===this.parent.falseValue||-1<Number(n)&&Number(n)<32)return 1;if(Number(n)<0)return i[yhe.Num];-1<n.indexOf("%")&&(n=(.01*Number(n.split("%")[0])).toString()),this.parent.isNumber(n)&&(n=parseInt(Math.floor(Number(n)).toString(),10));var o=this.parent.parseDate(n);return"Invalid Date"===o.toString()?this.parent.isNumber(n)?i[yhe.Num]:i[yhe.Value]:o.getFullYear()<1900||1e4<=o.getFullYear()?i[yhe.Num]:(o.getMonth()+1).toString()},Ehe.prototype.ComputeNOW=function(){for(var e,t,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];return 1!==i.length||""!==i[0]?this.parent.formulaErrorStrings[vhe.InvalidArguments]:(e=new Date(Date.now()),t=(new Ti).getDateFormat({format:"M/d/yyyy h:mm:ss a"}),this.parent.parentObject.dateToInt(t(e),!0).toString())},Ehe.prototype.ComputeEXACT=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i,n,o,r=!1,s=e.length&&"nestedFormulaTrue"===e[e.length-1],a=this.parent.getErrorStrings();if(s&&e.pop(),!e||!e[0]&&1===e.length)return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(2!==e.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(e[0]){if(i=this.parent.getValueFromArg(e[0]),-1<a.indexOf(i))return i;-1===i.indexOf(this.parent.tic)&&i.includes("%")&&(i=(Number(i.split("%")[0])/100).toString()),this.parent.isCellReference(e[0])?o=!0:i=i.split(this.parent.tic).join("")}if(e[1]){if(n=this.parent.getValueFromArg(e[1]),-1<a.indexOf(n))return n;-1===n.indexOf(this.parent.tic)&&n.includes("%")&&(n=(Number(n.split("%")[0])/100).toString()),this.parent.isCellReference(e[1])?o||0!==i.trim().length||0!==n.trim().length||(r=!1):(n=n.split(this.parent.tic).join(""),o&&0===i.trim().length&&0===n.trim().length&&(r=!1))}return r=i===n&&(r=!0,s)?this.parent.tic+r+this.parent.tic:r},Ehe.prototype.ComputeLEN=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=this.parent.getErrorStrings();return je(t)||""===t[0].trim()&&1===t.length?this.parent.formulaErrorStrings[vhe.InvalidArguments]:1<t.length?this.parent.formulaErrorStrings[vhe.WrongNumberArguments]:(e=this.parent.getValueFromArg(t[0]).trim(),-1<n.indexOf(e)?e:(-1<t[0].indexOf(this.parent.tic)?t[0]!==e&&t[0].startsWith("n")?e=this.parent.removeTics(e.trim()):-1<(e=this.parent.removeTics(t[0].trim())).indexOf(this.parent.tic+this.parent.tic)&&(e=e.replace(/""/g,this.parent.tic)):!t[0].startsWith("n")&&2===e.split("%").length&&this.parent.isNumber(e.split("%")[0])&&(e=(Number(e.split("%")[0])/100).toString()),e.length))},Ehe.prototype.ComputeMOD=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(je(t)||2!==t.length)return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(""===t[1]&&!t[0].includes('"'))return this.parent.formulaErrorStrings[vhe.Div];if(""===t[0]&&!t[1].includes('"'))return 0;for(var n=0;n<t.length;n++){var o=t[n].split(this.parent.tic).join("").trim();if(""===o||-1<t[n].indexOf(this.parent.tic)&&isNaN(this.parent.parseFloat(o)))return this.parent.getErrorStrings()[yhe.Value];if(Boe(t[n])){if((e=(e=this.parent.getValueFromArg(t[n])||"0")===this.parent.trueValue?"1":e===this.parent.falseValue?"0":e).toUpperCase().match(/[A-Z]/)||e.includes('"')||!this.parent.isNumber(e))return this.parent.getErrorStrings()[yhe.Value]}else if(e=(e=this.parent.getValueFromArg(t[n].split(this.parent.tic).join("")))===this.parent.trueValue?"1":e===this.parent.falseValue?"0":e,-1<this.parent.getErrorStrings().indexOf(e))return e;t[n]=e}var r=t[0],s=t[1];return"0"===s||""===s?this.parent.formulaErrorStrings[vhe.Div]:"0"===r||""===r?0:(r=(parseFloat(r)%(s=parseFloat(s))+s)%s,isNaN(r)?this.parent.getErrorStrings()[yhe.Name]:r)},Ehe.prototype.ComputeODD=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(je(e)||1!==e.length||""===e[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];var i,n=e[0].split(this.parent.tic).join("").trim();if(""===n||-1<e[0].indexOf(this.parent.tic)&&isNaN(this.parent.parseFloat(n)))return this.parent.getErrorStrings()[yhe.Value];if(Boe(e[0])){if((i=this.parent.getValueFromArg(e[0]))===this.parent.trueValue)i="1";else if(""===i||i===this.parent.falseValue)i="0";else if(i.toUpperCase().match(/[A-Z]/)||i.includes('"')||!this.parent.isNumber(i))return this.parent.getErrorStrings()[yhe.Value]}else{if("#NAME?"===(i=this.parent.getValueFromArg(e[0].split(this.parent.tic).join(""))))return this.parent.getErrorStrings()[yhe.Name];if(i===this.parent.trueValue)i="1";else if(""===i||i===this.parent.falseValue)i="0";else if(i.toUpperCase().match(/[A-Z]/)||!this.parent.isNumber(i))return this.parent.getErrorStrings()[yhe.Value]}var o=0===(n=Math.ceil(parseInt(i,10))),n=n%2==0?0<n?n+1:n-1:n;return Math.ceil(parseInt(i,10))%2!=0&&(0<parseInt(i,10)&&parseFloat(i)>parseInt(i,10)?n+=2:parseInt(i,10)<0&&parseFloat(i)<parseInt(i,10)&&(n-=2)),isNaN(n)?this.parent.getErrorStrings()[yhe.Name]:o?1:n},Ehe.prototype.ComputeEVEN=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(je(e)||1!==e.length||""===e[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];var i,n=e[0].split(this.parent.tic).join("").trim();if(""===n||-1<e[0].indexOf(this.parent.tic)&&isNaN(this.parent.parseFloat(n)))return this.parent.getErrorStrings()[yhe.Value];if(Boe(e[0])){if((i=this.parent.getValueFromArg(e[0]))===this.parent.trueValue)i="1";else if(""===i||i===this.parent.falseValue)i="0";else if(i.toUpperCase().match(/[A-Z]/)||i.includes('"')||!this.parent.isNumber(i))return this.parent.getErrorStrings()[yhe.Value]}else{if("#NAME?"===(i=this.parent.getValueFromArg(e[0].split(this.parent.tic).join(""))))return this.parent.getErrorStrings()[yhe.Name];if(i===this.parent.trueValue)i="1";else if(""===i||i===this.parent.falseValue)i="0";else if(i.toUpperCase().match(/[A-Z]/)||!this.parent.isNumber(i))return this.parent.getErrorStrings()[yhe.Value]}n=(n=Math.ceil(parseInt(i,10)))%2==0?n:0<n?n+1:n-1;return Math.ceil(parseInt(i,10))%2==0&&(0<parseInt(i,10)&&parseFloat(i)>parseInt(i,10)?n+=2:parseInt(i,10)<0&&parseFloat(i)<parseInt(i,10)&&(n-=2)),isNaN(n)?this.parent.getErrorStrings()[yhe.Name]:n},Ehe.prototype.ComputePI=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e&&""!==e[0]?this.parent.formulaErrorStrings[vhe.InvalidArguments]:Math.PI},Ehe.prototype.ComputeMEDIAN=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=[];if(je(t)||""===t[0]&&1===t.length)return this.parent.formulaErrorStrings[vhe.InvalidArguments];for(var o=0;o<t.length;o++)if(this.parent.isCellReference(t[o]))if(-1<t[o].indexOf(":"))for(var r=this.parent.getCellCollection(t[o]),s=0;s<r.length;s++){var a=this.parent.getValueFromArg(r[s]);if(-1<this.parent.getErrorStrings().indexOf(a))return a;""!==a.trim()&&n.push(this.parent.parseFloat(a))}else{var l=this.parent.getValueFromArg(t[o]);if(-1<this.parent.getErrorStrings().indexOf(l))return l;""!==l.trim()&&n.push(this.parent.parseFloat(l))}else if(""===t[o]||t[o]===this.parent.falseValue&&!this.parent.isCellReference(t[o]))n.push(0);else if(t[o]!==this.parent.trueValue||this.parent.isCellReference(t[o])){if(-1<t[o].indexOf(this.parent.tic)&&isNaN(parseFloat(t[o].split(this.parent.tic).join(""))))return this.parent.getErrorStrings()[yhe.Value];l=this.parent.getValueFromArg(t[o]).split(this.parent.tic).join("");if(-1<this.parent.getErrorStrings().indexOf(l))return l;n.push(this.parent.parseFloat(l))}else n.push(1);for(var h=(n=n.sort(function(e,t){return e-t})).length,d=0;d<h&&(!isNaN(n[d])||(n.splice(d,1),h=n.length,d--,0!==n.length));d++);if(n.length%2==0||isNaN(n[parseInt((n.length/2).toString(),10)])){if(isNaN(n[n.length/2])||isNaN(n[n.length/2-1]))return this.parent.getErrorStrings()[yhe.Num];e=(n[n.length/2]+n[n.length/2-1])/2}else e=n[parseInt((n.length/2).toString(),10)];return e},Ehe.prototype.ComputeEDATE=function(){for(var e,t,i,n,o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];if(2!==o.length||je(o))return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(""===o[0]||""===o[1])return this.parent.getErrorStrings()[yhe.NA];if(""===o[0].split(this.parent.tic).join("")||""===o[1].split(this.parent.tic).join("")||-1<o[1].indexOf(this.parent.tic)&&isNaN(this.parent.parseFloat(o[1].split(this.parent.tic).join(""))))return this.parent.getErrorStrings()[yhe.Value];if(this.parent.isCellReference(o[0])){if(-1<o[0].indexOf(":"))return this.parent.getErrorStrings()[yhe.Value];if(-1<(e=this.parent.getValueFromArg(o[0].split(this.parent.tic).join(""))||"0").indexOf(this.parent.tic))return this.parent.getErrorStrings()[yhe.Value]}else e=this.parent.getValueFromArg(o[0].split(this.parent.tic).join(""));if(this.parent.isCellReference(o[1])){if(-1<o[1].indexOf(":"))return this.parent.getErrorStrings()[yhe.Value];n=this.parent.getValueFromArg(o[1].split(this.parent.tic).join(""))||"0"}else n=this.parent.getValueFromArg(o[1].split(this.parent.tic).join(""));if(-1<this.parent.getErrorStrings().indexOf(n))return n;if(n=parseInt(n,10),this.parent.isNumber(e)){if((e=parseInt(e,10))<0||2958465<e)return this.parent.getErrorStrings()[yhe.Num];t=this.parent.fromOADate(e)}else t=this.parent.checkDateFormat(e);return isNaN(n)||je(this.parent.isDate(t))||9999<t.getFullYear()?this.parent.getErrorStrings()[yhe.Value]:(i=t.getDate(),t.setMonth(t.getMonth()+n),i!==t.getDate()&&t.setDate(0),n=this.parent.parentObject.dateToInt(t),"0"===e.toString()&&--n,n<0||2958465<n?this.parent.getErrorStrings()[yhe.Num]:n.toString())},Ehe.prototype.ComputeEOMONTH=function(){for(var e,t,i,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(2!==n.length||je(n))return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(""===n[0]||""===n[1])return this.parent.getErrorStrings()[yhe.NA];if(""===n[0].split(this.parent.tic).join("")||""===n[1].split(this.parent.tic).join("")||-1<n[1].indexOf(this.parent.tic)&&isNaN(this.parent.parseFloat(n[1].split(this.parent.tic).join(""))))return this.parent.getErrorStrings()[yhe.Value];if(this.parent.isCellReference(n[0])){if(-1<n[0].indexOf(":"))return this.parent.getErrorStrings()[yhe.Value];if(-1<(i=this.parent.getValueFromArg(n[0].split(this.parent.tic).join(""))||"0").indexOf(this.parent.tic))return this.parent.getErrorStrings()[yhe.Value]}else i=this.parent.getValueFromArg(n[0]).split(this.parent.tic).join("");if(-1<this.parent.getErrorStrings().indexOf(i))return i;if(this.parent.isCellReference(n[1])){if(-1<n[1].indexOf(":"))return this.parent.getErrorStrings()[yhe.Value];e=this.parent.getValueFromArg(n[1].split(this.parent.tic).join(""))||"0"}else e=this.parent.getValueFromArg(n[1].split(this.parent.tic).join(""));if(-1<this.parent.getErrorStrings().indexOf(e))return e;if(e=parseInt(e,10),this.parent.isNumber(i)){if((i=parseInt(i,10))<0||2958465<i)return this.parent.getErrorStrings()[yhe.Num];t=this.parent.fromOADate(i)}else t=this.parent.checkDateFormat(i);return isNaN(e)||je(this.parent.isDate(t))||9999<t.getFullYear()?this.parent.getErrorStrings()[yhe.Value]:(t=new Date(t.getFullYear(),t.getMonth()+(e+1),0),(i=this.parent.parentObject.dateToInt(t))<0||2958465<i||t.getFullYear()<1900?this.parent.getErrorStrings()[yhe.Num]:i.toString())},Ehe.prototype.ComputeDATEVALUE=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n,o=this.parent.getErrorStrings();if(""===t[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(1<t.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(e=this.parent.getValueFromArg(t[0])||"0",-1<o.indexOf(e))return e;if(this.parent.isCellReference(t[0])){if(-1<t[0].indexOf(":")||e.startsWith(this.parent.tic))return o[yhe.Value]}else e=t[0].split(this.parent.tic).join("")||"0";return this.parent.isNumber(e)||je(this.parent.isDate(e))?o[yhe.Value]:(n=this.parent.parseDate(e),-1<o.indexOf(e)?e:je(n)||"Invalid Date"===n.toString()||n.getFullYear()<1900||9999<n.getFullYear()?this.parent.getErrorStrings()[yhe.Value]:(e=this.parent.toOADate(n).toString(),parseFloat(e).toFixed(0).toString()))},Ehe.prototype.ComputeCOUNTBLANK=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=0;if(1!==e.length||je(e)||!this.parent.isCellReference(e[0]))return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(""===e[0])return this.parent.getErrorStrings()[yhe.Value];for(var n=this.parent.getCellCollection(e[0]),o=0;o<n.length;o++)""===this.parent.getValueFromArg(n[o])&&i++;return i},Ehe.prototype.ComputeFACT=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=1,n=this.parent.getErrorStrings();if(""===e[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(1!==e.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];var o=e[0];if(this.parent.isCellReference(e[0])||isNaN(Number(o.split(this.parent.tic).join("")))){if(o=this.parent.getValueFromArg(e[0]),-1<n.indexOf(o))return o;if(o.startsWith(this.parent.tic)||o.match(/^(\d*\.\d+|\d+)\s*[+\-*/]\s*(\d*\.\d+|\d+)$/))return n[yhe.Value];if(""===o)return 1}if(o=o.split(this.parent.tic).join("").trim(),-1<n.indexOf(o))return o;if(o.toUpperCase()===this.parent.trueValue||o.toUpperCase()===this.parent.falseValue)return 1;-1<o.indexOf("%")&&(o=(Number(o.split("%")[0])/100).toString());var r=parseInt(o,10);if(r<0||170<r)return n[yhe.Num];if(o.toUpperCase().match(/[A-Z]/)||""===o)return n[yhe.Value];if(-1<o.indexOf(":"))return 0;for(var s=1;s<=r;s++)i*=s;return i},Ehe.prototype.ComputeDECIMAL=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i,n,o,r;return je(e)||2!==e.length?this.parent.formulaErrorStrings[vhe.InvalidArguments]:e[0].match(/[@#$%^&*()?:{}|<>+-]/g)?this.parent.getErrorStrings()[yhe.Num]:-1<e[1].indexOf(this.parent.tic)&&isNaN(this.parent.parseFloat(e[1].split(this.parent.tic).join("")))?this.parent.getErrorStrings()[yhe.Value]:(n=i=void 0,i=this.parent.isCellReference(e[0].toString())?this.parent.getValueFromArg(e[0]):this.parent.getValueFromArg(e[0]).split(this.parent.tic).join(""),n=this.parent.isCellReference(e[1].toString())?this.parent.getValueFromArg(e[1]):this.parent.getValueFromArg(e[1]).split(this.parent.tic).join(""),o=parseInt(i,10),r=parseInt(n,10),-1<this.parent.getErrorStrings().indexOf(i)?i:-1<this.parent.getErrorStrings().indexOf(n)?n:""===i&&""!==n?0:""===i||o<0||!isNaN(o)&&!Number.isInteger(parseFloat(i))||""===n||r<2||36<r||isNaN(r)||isNaN(this.parent.parseFloat(i))&&this.parent.parseFloat(n)<=10||(o=parseInt(i,parseInt(n,10)),isNaN(o))?this.parent.getErrorStrings()[yhe.Num]:o)},Ehe.prototype.ComputeDEGREES=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this.parent.getErrorStrings();if(je(e)||""===e[0]&&1===e.length)return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(1!==e.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];var n=this.parent.getValueFromArg(e[0]).trim();if(-1<i.indexOf(n))return n;if(this.parent.isCellReference(e[0])){if(""===n||-1<n.indexOf(":"))return 0;if(-1<n.indexOf(this.parent.tic)||isNaN(Number(n))&&!isNaN(parseInt(n,10)))return i[yhe.Value]}else if(-1<n.indexOf('"TRUE"'))return i[yhe.Value];if((n=n.split(this.parent.tic).join("")).toUpperCase()===this.parent.trueValue)n="1";else if(n.toUpperCase()===this.parent.falseValue)n="0";else if(-1<n.indexOf("%"))n=(Number(n.split("%")[0])/100).toString();else if(n.toUpperCase().match(/[A-Z]/)||isNaN(parseInt(n,10)))return i[yhe.Value];return parseFloat(n)*(180/Math.PI)},Ehe.prototype.ComputeADDRESS=function(){for(var e,i=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=this.parent.getErrorStrings();if(je(t)||1===t.length&&""===t[0].trim())return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(t.length<2||5<t.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(""===t[0].split(this.parent.tic).join("").trim()||""===t[1].split(this.parent.tic).join("").trim())return o[yhe.Value];function r(e){var t=i.parent.getValueFromArg(e).trim();if(!(0<o.indexOf(t))){if(t.toUpperCase()===i.parent.trueValue?t="1":t.toUpperCase()===i.parent.falseValue&&(t="0"),i.parent.isCellReference(e)&&-1<t.indexOf(i.parent.tic))return o[yhe.Value];2===(t=i.parent.removeTics(t)).split("%").length&&i.parent.isNumber(t.split("%")[0])&&(t=(Number(t.split("%")[0])/100).toString())}return t}var s=r(t[0]);if(0<o.indexOf(s))return s;if(s=Number(s),isNaN(s)||s<1)return o[yhe.Value];var a,l,h,s=s.toString(),d=r(t[1]);if(0<o.indexOf(d))return d;if(d=Number(d),isNaN(d)||d<1)return o[yhe.Value];if(d=d.toString(),je(t[2])||""===t[2].trim())a="1";else{if(a=r(t[2]),0<o.indexOf(a))return a;if(a=Number(a),isNaN(a)||a<1||4<a)return o[yhe.Value];a=a.toString()}if(je(t[3])||""===t[3].trim())l="1";else{if(l=r(t[3]),0<o.indexOf(l))return l;l.toUpperCase()===this.parent.trueValue||1<Number(l)?l="1":""!==l&&l.toUpperCase()!==this.parent.falseValue||(l="0")}if("1"===l)"1"===a?e="$"+_he(parseInt(d,10))+"$"+parseInt(s,10):"2"===a?e=_he(parseInt(d,10))+"$"+parseInt(s,10):"3"===a?e="$"+_he(parseInt(d,10))+parseInt(s,10):"4"===a&&(e=_he(parseInt(d,10))+parseInt(s,10));else{if("0"!==l)return o[yhe.Name];"1"===a?e="R"+parseInt(s,10)+"C"+parseInt(d,10):"2"===a?e="R"+parseInt(s,10)+"C["+parseInt(d,10)+"]":"3"===a?e="R["+parseInt(s,10)+"]C"+parseInt(d,10):"4"===a&&(e="R["+parseInt(s,10)+"]C["+parseInt(d,10)+"]")}return!je(t[4])&&""!==t[4]&&(h=this.parent.getValueFromArg(t[4]).split(this.parent.tic).join(""),0<o.indexOf(h))?h:je(h)?e:h+"!"+e},Ehe.prototype.ComputeTIME=function(){for(var e,t,i,n,o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];if(je(o)||3!==o.length)return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(-1<o[0].indexOf(this.parent.tic)&&""===o[0].split(this.parent.tic).join("").trim())return this.parent.getErrorStrings()[yhe.Value];if(-1<o[1].indexOf(this.parent.tic)&&""===o[1].split(this.parent.tic).join("").trim())return this.parent.getErrorStrings()[yhe.Value];if(-1<o[2].indexOf(this.parent.tic)&&""===o[2].split(this.parent.tic).join("").trim())return this.parent.getErrorStrings()[yhe.Value];if(this.parent.isCellReference(o[0])){if(-1<(n=this.parent.getValueFromArg(o[0].split(this.parent.tic).join(""))||"0").indexOf(this.parent.tic))return this.parent.getErrorStrings()[yhe.Value]}else{if(-1<o[0].indexOf(this.parent.tic)&&(o[0].split(this.parent.tic).join("")===this.parent.trueValue||o[0].split(this.parent.tic).join("")===this.parent.falseValue))return this.parent.getErrorStrings()[yhe.Value];n=this.parent.getValueFromArg(o[0]).split(this.parent.tic).join("")||"0"}if(-1<this.parent.getErrorStrings().indexOf(n))return n;if(isNaN(this.parent.parseFloat(n))&&n!==this.parent.trueValue&&n!==this.parent.falseValue)return this.parent.getErrorStrings()[yhe.Value];if(this.parent.isCellReference(o[1])){if(-1<(t=this.parent.getValueFromArg(o[1].split(this.parent.tic).join(""))||"0").indexOf(this.parent.tic))return this.parent.getErrorStrings()[yhe.Value]}else{if(-1<o[1].indexOf(this.parent.tic)&&(o[1].split(this.parent.tic).join("")===this.parent.trueValue||o[1].split(this.parent.tic).join("")===this.parent.falseValue))return this.parent.getErrorStrings()[yhe.Value];t=this.parent.getValueFromArg(o[1]).split(this.parent.tic).join("")||"0"}if(-1<this.parent.getErrorStrings().indexOf(t))return t;if(isNaN(this.parent.parseFloat(t))&&t!==this.parent.trueValue&&t!==this.parent.falseValue)return this.parent.getErrorStrings()[yhe.Value];if(this.parent.isCellReference(o[2])){if(-1<(e=this.parent.getValueFromArg(o[2].split(this.parent.tic).join(""))||"0").indexOf(this.parent.tic))return this.parent.getErrorStrings()[yhe.Value]}else{if(-1<o[2].indexOf(this.parent.tic)&&(o[2].split(this.parent.tic).join("")===this.parent.trueValue||o[2].split(this.parent.tic).join("")===this.parent.falseValue))return this.parent.getErrorStrings()[yhe.Value];e=this.parent.getValueFromArg(o[2]).split(this.parent.tic).join("")||"0"}return-1<this.parent.getErrorStrings().indexOf(e)?e:isNaN(this.parent.parseFloat(e))&&e!==this.parent.trueValue&&e!==this.parent.falseValue||(n=n===this.parent.trueValue?"1":n===this.parent.falseValue?"0":n,t=t===this.parent.trueValue?"1":t===this.parent.falseValue?"0":t,e=e===this.parent.trueValue?"1":e===this.parent.falseValue?"0":e,n=parseInt(this.parent.parseFloat(n).toString(),10),t=parseInt(this.parent.parseFloat(t).toString(),10),e=parseInt(this.parent.parseFloat(e).toString(),10),isNaN(n))||isNaN(t)||isNaN(e)?this.parent.getErrorStrings()[yhe.Value]:32767<n||32767<t||32767<e||(n=new Date(1900,0,1,n,t,e)).getFullYear()<1900?this.parent.getErrorStrings()[yhe.Num]:(t="AM",12<=(i=e=n.getHours())&&(i=e-12,t="PM"),n={value:(e=(i=(i=0===i?12:i)<10?"0"+i:i)+":"+(e=(e=n.getMinutes())<10?"0"+e:e)+":"+(i=(i=n.getSeconds())<10?"0"+i:i)+" "+t).toString()},this.parent.parentObject.notify(Fie,n),n.isTime?n.updatedVal:e)},Ehe.prototype.ComputeCHAR=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i,n=this.parent.getErrorStrings();return je(e)||""===e[0]?this.parent.formulaErrorStrings[vhe.InvalidArguments]:1!==e.length?this.parent.formulaErrorStrings[vhe.WrongNumberArguments]:(i=this.parent.getValueFromArg(e[0]).trim(),-1<n.indexOf(i)?i:-1<i.indexOf('"TRUE"')||this.parent.isCellReference(e[0])&&i.startsWith(this.parent.tic)||(i=i.split(this.parent.tic).join(""),this.parent.isNumber(i)?i=Math.floor(Number(i)).toString():-1<i.indexOf("%")?i=Math.floor(Number(i.split("%")[0])/100).toString():i===this.parent.trueValue&&(i="1"),!i.toUpperCase().match(/^[0-9]+$/))||255<(i=parseInt(i,10))||i<=0?n[yhe.Value]:String.fromCharCode(i))},Ehe.prototype.ComputeCODE=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=this.parent.getErrorStrings();if(je(t)||1===t.length&&""===t[0].trim())return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(1<t.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(e=this.parent.getValueFromArg(t[0]).trim(),!(-1<n.indexOf(e))){if(-1<t[0].indexOf(this.parent.tic)?e=t[0]!==e&&t[0].startsWith("n")?this.parent.removeTics(e.trim()):this.parent.removeTics(t[0].trim()):!t[0].startsWith("n")&&2===e.split("%").length&&this.parent.isNumber(e.split("%")[0])&&(e=(Number(e.split("%")[0])/100).toString()),""===e)return n[yhe.Value];e=e.charCodeAt(0)}return e},Ehe.prototype.ComputeDOLLAR=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(t.length&&"nestedFormulaTrue"===t[t.length-1]&&(e=!0,t.pop()),1===t.length&&(""===t[0]&&(o=!0),t.push("2")),je(t)||2!==t.length||o)return this.parent.formulaErrorStrings[vhe.InvalidArguments];for(var n=0;n<t.length;n++)if(-1<t[n].indexOf(this.parent.tic)&&isNaN(this.parent.parseFloat(t[n])))return this.parent.getErrorStrings()[yhe.Value];var o=this.parent.getValueFromArg(t[0]).split(this.parent.tic).join(""),r=this.parent.getValueFromArg(t[1]).split(this.parent.tic).join(""),o=""===o||o===this.parent.falseValue?"0":o===this.parent.trueValue?"1":o,r=""===r||r===this.parent.falseValue?"0":r===this.parent.trueValue?"1":r;if("#NAME?"===o||"#NAME?"===r)return this.parent.getErrorStrings()[yhe.Name];if(!o.toUpperCase().match(/^[-]?[0-9.]+$/)||!r.toUpperCase().match(/^[-]?[0-9.]+$/))return this.parent.getErrorStrings()[yhe.Value];for(var s=new Ti,a=parseInt(r,10),r=Math.pow(10,-1*a),l="",h=1;h<=a;h++)l+="0";o=Math.round(this.parent.parseFloat(o)/r)*r,r=isNaN(o)?this.parent.getErrorStrings()[yhe.Value]:s.formatNumber(o,{format:"$#,##0."+l+";($#,##0."+l+");$0."+l});return r=e?this.parent.tic+r+this.parent.tic:r},Ehe.prototype.ComputeSMALL=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this.parent.getErrorStrings();if(je(e)||1===e.length||""===e[0])return""===e[0]&&""===e[1]?i[yhe.Num]:this.parent.formulaErrorStrings[vhe.InvalidArguments];if(2<e.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];var n=[],o=[];if(!je(e[0])){var r=void 0;if(this.parent.isCellReference(e[0]))for(var s=this.parent.getCellCollection(e[0]),a=0;a<s.length;a++){if(r=this.parent.getValueFromArg(s[a]),-1<i.indexOf(r))return r;n.push(r)}else{if(r=this.parent.getValueFromArg(e[0]).split(this.parent.tic).join(""),-1<i.indexOf(r))return r;n.push(r)}for(a=0;a<n.length;a++)""===n[a]||isNaN(this.parent.parseFloat(n[a]))||o.push(this.parent.parseFloat(n[a]));if(0===o.length&&(je(n[0])||-1<e[0].indexOf(this.parent.tic)))return i[yhe.Value]}if(o=o.sort(function(e,t){return e-t}),!je(e[1])){if(this.parent.isCellReference(e[1])){if(""===(l=this.parent.getValueFromArg(e[1])))return i[yhe.Num];if(""===l.trim())return i[yhe.Value];l.toUpperCase()===this.parent.trueValue?l="1":l.toUpperCase()===this.parent.falseValue&&(l="0")}else l=this.parent.getValueFromArg(e[1]).split(this.parent.tic).join("");if(-1<i.indexOf(l))return l;if(""===l.trim())return 0<e[1].length?i[yhe.Value]:i[yhe.Num];if(isNaN(this.parent.parseFloat(l)))if(e[1].toUpperCase()===this.parent.trueValue)l="1";else{if(e[1].toUpperCase()!==this.parent.falseValue)return i[yhe.Value];l="0"}}var l=Number(l)<1?0:Math.floor(Number(l));return je(o[l-1])&&!isNaN(Number(l))?i[yhe.Num]:o[l-1]},Ehe.prototype.ComputeLARGE=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this.parent.getErrorStrings();if(je(e)||1===e.length||""===e[0])return""===e[0]&&""===e[1]?i[yhe.Num]:this.parent.formulaErrorStrings[vhe.InvalidArguments];if(2<e.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];var n=[],o=[];if(!je(e[0])){var r=void 0;if(this.parent.isCellReference(e[0]))for(var s=this.parent.getCellCollection(e[0]),a=0;a<s.length;a++){if(r=this.parent.getValueFromArg(s[a]),-1<i.indexOf(r))return r;n.push(r)}else{if(r=this.parent.getValueFromArg(e[0]).split(this.parent.tic).join(""),-1<i.indexOf(r))return r;n.push(r)}for(a=0;a<n.length;a++)""===n[a]||isNaN(this.parent.parseFloat(n[a]))||o.push(this.parent.parseFloat(n[a]));if(0===o.length&&(je(n[0])||-1<e[0].indexOf(this.parent.tic)))return i[yhe.Value]}if(o=o.sort(function(e,t){return t-e}),!je(e[1])){if(this.parent.isCellReference(e[1])){if(""===(l=this.parent.getValueFromArg(e[1])))return i[yhe.Num];if(""===l.trim())return i[yhe.Value];l.toUpperCase()===this.parent.trueValue?l="1":l.toUpperCase()===this.parent.falseValue&&(l="0")}else l=this.parent.getValueFromArg(e[1]).split(this.parent.tic).join("");if(-1<i.indexOf(l))return l;if(""===l.trim())return 0<e[1].length?i[yhe.Value]:i[yhe.Num];if(isNaN(this.parent.parseFloat(l)))if(e[1].toUpperCase()===this.parent.trueValue)l="1";else{if(e[1].toUpperCase()!==this.parent.falseValue)return i[yhe.Value];l="0"}}var l=Number(l)<1?0:Math.ceil(Number(l));return je(o[l-1])&&!isNaN(Number(l))?i[yhe.Num]:o[l-1]},Ehe.prototype.ComputeCHOOSE=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(je(t)||""===t[0]&&1===t.length)return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(t.length<2)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];var n,o=this.parent.getErrorStrings();if(n=t[0],(n=e.parent.getValueFromArg(n)).toUpperCase()===e.parent.trueValue?n="1":n.toUpperCase()===e.parent.falseValue&&(n="0"),e=n,-1<o.indexOf(e))return e;if(this.parent.isCellReference(t[0])){if(-1<t[0].indexOf(":"))return o[yhe.Value]}else 2===(e=this.parent.removeTics(e)).split("%").length&&this.parent.isNumber(e.split("%")[0])&&(e=(.01*Number(e.split("%")[0])).toString());return(e=Math.floor(this.parent.parseFloat(e)))<1||isNaN(e)||je(t[e])?o[yhe.Value]:this.parent.isCellReference(e=""===(e=t[e])?"0":e)?-1<e.indexOf(":")?o[yhe.Value]:this.parent.getValueFromArg(e):(-1<e.indexOf(this.parent.tic)&&(-1<o.indexOf(e.split(this.parent.tic).join(""))||this.parent.removeTics(e).match(/^(\d*\.\d+|\d+)\s*[-*/]\s*(\d*\.\d+|\d+)$/))&&(e=this.parent.removeTics(e)),-1<(e=this.parent.removeTics(this.parent.getValueFromArg(e))).indexOf(this.parent.tic+this.parent.tic)?e.replace(/""/g,this.parent.tic):2===e.split("%").length&&this.parent.isNumber(e.split("%")[0])?(.01*Number(e.split("%")[0])).toString():e)},Ehe.prototype.ComputeSUMIF=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e;return i[0].indexOf(":")<0&&!this.parent.isCellReference(i[0])||i[2]&&i[2].indexOf(":")<0&&!this.parent.isCellReference(i[2])?this.parent.formulaErrorStrings[vhe.ImproperFormula]:3<i.length||i.length<2?this.parent.formulaErrorStrings[vhe.WrongNumberArguments]:"string"==typeof(i=this.parent.computeSumIfAndAvgIf(e,!1))&&(this.parent.formulaErrorStrings.indexOf(i)||this.parent.getErrorStrings().indexOf(i))?i:i[0]},Ehe.prototype.ComputeABS=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i,n=e,o="";if(0===e.length||1<e.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(""===n[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];var r=n[0].split(this.parent.tic).join("").trim();if(""===r||-1<n[0].indexOf(this.parent.tic)&&isNaN(this.parent.parseFloat(r)))return this.parent.getErrorStrings()[yhe.Value];if(this.parent.isCellReference(n[0])){if(o=this.parent.getValueFromArg(n[0]),-1<this.parent.getErrorStrings().indexOf(o))return this.parent.getErrorStrings()[yhe.Value];if(""!==(o=o===this.parent.trueValue?"1":o)&&o!==this.parent.falseValue||(o="0"),i=this.parent.parseFloat(o),isNaN(i)&&!this.parent.isNumber(o))return this.parent.getErrorStrings()[yhe.Value]}else{if((o=(o=this.parent.getValueFromArg(n[0]).split(this.parent.tic).join())===this.parent.trueValue?"1":o)===this.parent.falseValue&&(o="0"),-1<this.parent.getErrorStrings().indexOf(o))return o;if(i=this.parent.parseFloat(o),isNaN(i)&&!this.parent.isNumber(o))return this.parent.getErrorStrings()[yhe.Value]}return Math.abs(i)},Ehe.prototype.ComputeAVERAGE=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i,n,o=!1;if(e.length&&("isSubtotal"===(n=e[e.length-1])?(o=!0,e.pop()):"isAggregate"===n&&(i=!0,e.pop())),je(e)||1===e.length&&""===e[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];for(var r=e,s=0;s<r.length;s++)if(-1<r[s].indexOf(":")&&-1<r[s].indexOf(this.parent.tic))return this.parent.getErrorStrings()[yhe.Value];return this.parent.calculateAvg(r,o,i)},Ehe.prototype.ComputeAVERAGEIF=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e;return i[0].indexOf(":")<0&&!this.parent.isCellReference(i[0])?this.parent.formulaErrorStrings[vhe.ImproperFormula]:0===(i=this.parent.computeSumIfAndAvgIf(e,!0))[1]||"NaN"===i[0].toString()?this.parent.formulaErrorStrings[vhe.Div]:"string"==typeof i&&(this.parent.formulaErrorStrings.indexOf(i)||this.parent.getErrorStrings().indexOf(i))?i:this.parent.parseFloat(i[0])/this.parent.parseFloat(i[1])},Ehe.prototype.ComputeCONCATENATE=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this.parent.getErrorStrings();if(je(e)||1===e.length&&""===e[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];for(var n=e,o="",r="",s=0;s<n.length;s++){var a=n[s];if(this.parent.isCellReference(a)){if(-1<a.indexOf(":")){if(!this.isConcat)return i[yhe.Value];for(var l=this.parent.getCellCollection(a),h=0;h<l.length;h++)o+=this.parent.getValueFromArg(l[h])}else{if(1===n.length&&n[0].indexOf(this.parent.tic)<0&&!zoe(n[0]))return i[yhe.Name];r=this.parent.getValueFromArg(a)}if(-1<i.indexOf(r))return r}else if(a.startsWith(this.parent.tic)&&a.endsWith(this.parent.tic)&&-1<a.indexOf('""')?r=(r=a.substring(1,a.length-1)).replace(/""/g,'"'):(r=a.split(this.parent.tic).join(""),(this.parent.isNumber(r)||je(this.parent.isDate(r))||a.startsWith(" n"))&&(r=this.parent.getValueFromArg(a).split(this.parent.tic).join(""))),-1<i.indexOf(r))return r;o+=r}return this.isConcat=!1,o},Ehe.prototype.ComputeCONCAT=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.isConcat=!0,this.ComputeCONCATENATE.apply(this,e)},Ehe.prototype.ComputeMAX=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.parent.computeMinMax(e,"max")},Ehe.prototype.ComputeMIN=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.parent.computeMinMax(e,"min")},Ehe.prototype.ComputeRAND=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length&&""===e[0]&&(e.length=0),0<e.length?this.parent.formulaErrorStrings[vhe.WrongNumberArguments]:Math.random().toString()},Ehe.prototype.ComputeAND=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return je(e)||1===e.length&&""===e[0]?this.parent.formulaErrorStrings[vhe.InvalidArguments]:this.parent.computeAndOrNot(e,"and")},Ehe.prototype.ComputeOR=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return je(e)||1===e.length&&""===e[0]?this.parent.formulaErrorStrings[vhe.InvalidArguments]:this.parent.computeAndOrNot(e,"or")},Ehe.prototype.ComputeNOT=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return je(e)||1<e.length||""===e[0]?this.parent.formulaErrorStrings[vhe.WrongNumberArguments]:this.parent.computeAndOrNot(e,"not")},Ehe.prototype.ComputeFIND=function(){for(var i=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.parent.getErrorStrings();if(je(e)||1===e.length)return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(3<e.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];function o(e){var t=i.parent.getValueFromArg(e);return-1<n.indexOf(t)||i.parent.isCellReference(e)||(2===t.split("%").length&&i.parent.isNumber(t.split("%")[0])?t=(.01*Number(t.split("%")[0])).toString():-1<e.indexOf(i.parent.tic)&&(i.parent.removeTics(e).match(/^(\d*\.\d+|\d+)\s*[-*/]\s*(\d*\.\d+|\d+)$/)?t=i.parent.getValueFromArg(i.parent.removeTics(e)):-1<t.indexOf(i.parent.tic+i.parent.tic)&&(t=t.replace(/""/g,i.parent.tic)))),t}var r,s;if(!je(e[0])){if(r=o(e[0]),-1<n.indexOf(r))return r;this.parent.isCellReference(e[0])||(r=this.parent.removeTics(r))}if(!je(e[1])){if(s=o(e[1]),-1<n.indexOf(s))return s;this.parent.isCellReference(e[1])||(s=this.parent.removeTics(s))}var a=1;if(!je(e[2])){if(a=o(e[2]),-1<n.indexOf(a))return a;if(a.toUpperCase()===this.parent.trueValue?a="1":a.toUpperCase()===this.parent.falseValue&&(a="0"),this.parent.isCellReference(e[2])||(a=this.parent.removeTics(a)),a=this.parent.parseFloat(a),isNaN(a)||a<=0)return n[yhe.Value]}return(a=s.indexOf(r,a-1))<0?n[yhe.Value]:(Number(a)+Number(1)).toString()},Ehe.prototype.ComputeINDEX=function(){for(var e,i=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o,r,s,a,l,h,d,p=this.parent.getErrorStrings();return t.length&&"nestedFormulaTrue"===t[t.length-1]&&(e=!0,t.pop()),je(t)||1===t.length&&""===t[0]?this.parent.formulaErrorStrings[vhe.InvalidArguments]:t.length<2||4<t.length?this.parent.formulaErrorStrings[vhe.WrongNumberArguments]:""===t[0]?p[yhe.Value]:-1===t[0].indexOf(":")?p[yhe.Ref]:(r=t[0],s=(o=function(e){if(je(e)||""===e)return 1;var t=i.parent.getValueFromArg(e);if(!(-1<p.indexOf(t))){if(t.toUpperCase()===i.parent.trueValue?t="1":t.toUpperCase()===i.parent.falseValue&&(t="0"),-1<t.indexOf(i.parent.tic)&&(t=i.parent.removeTics(t),-1===e.indexOf(i.parent.tic)||""===t.trim()))return p[yhe.Value];if(2===t.split("%").length&&i.parent.isNumber(t.split("%")[0])&&(t=(Number(t.split("%")[0])/100).toString()),t=parseInt(Number(t).toString(),10),isNaN(t)||t<0)return p[yhe.Value];0===t&&(t=1)}return t})(t[1]),-1<p.indexOf(s.toString())?s.toString():(o=o(t[2]),-1<p.indexOf(o.toString())?o.toString():(d=r.indexOf(":"),a=this.parent.rowIndex(r.substring(0,d)),l=this.parent.rowIndex(r.substring(d+1)),h=this.parent.colIndex(r.substring(0,d)),d=this.parent.colIndex(r.substring(d+1)),l-a+1<s||d-h+1<o?p[yhe.Ref]:(s=a+s-1,o=h+o-1,""===(r=this.parent.getValueFromArg(this.getSheetReference(r)+this.parent.convertAlpha(o)+s))?0:e&&-1===p.indexOf(r)&&!this.parent.isNumber(r)&&r!==this.parent.trueValue&&r!==this.parent.falseValue?this.parent.tic+r+this.parent.tic:r))))},Ehe.prototype.getSheetReference=function(e){return 0===e.indexOf(this.parent.sheetToken)&&e.lastIndexOf(this.parent.sheetToken)>e.indexOf(this.parent.sheetToken)?e.substring(0,e.lastIndexOf(this.parent.sheetToken)+1):""},Ehe.prototype.ComputeIFS=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e;if(je(e)||1===i.length&&""===i[0]||i.length%2!=0)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];for(var n,o="",r=0;r<i.length;r++){if(n=this.parent.getValueFromArg(i[r]),""===i[r])return this.parent.getErrorStrings()[yhe.NA];if(-1<this.parent.getErrorStrings().indexOf(n))return n;if(n!==this.parent.trueValue&&n!==this.parent.falseValue)return this.parent.getErrorStrings()[yhe.Value];if(n===this.parent.trueValue)return this.parent.isCellReference(i[r+1].split(this.parent.tic).join(""))||i[r+1].includes(this.parent.arithMarker)?o=""===(o=this.parent.getValueFromArg(i[r+1]))?"0":o:-1<(o=""===i[r+1]?"0":this.parent.getValueFromArg(i[r+1])).indexOf(this.parent.tic)&&(o=o.split(this.parent.tic).join("")),r+=1,o;n===this.parent.falseValue&&(r+=1)}return this.parent.getErrorStrings()[yhe.NA]},Ehe.prototype.ComputeCOUNTA=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i,n,o,r=!1;if(e.length&&("isSubtotal"===(o=e[e.length-1])?(r=!0,e.pop()):"isAggregate"===o&&(n=this.parent.parentObject.getActiveSheet(),i=!0,e.pop())),je(e)||1===e.length&&""===e[0])return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];for(var s,a,l,h=e,d=0,p=0;p<h.length;p++)if(this.parent.isCellReference(h[p]))if(-1<h[p].indexOf(":"))for(var c=this.parent.getCellCollection(h[p].split(this.parent.tic).join("")),u=0;u<c.length;u++)i&&(zde(n,(l=ste(c[u]))[0])||epe(n,l[1]))||(s=r?this.parent.getValueFromArg(c[u],null,null,!0):this.parent.getValueFromArg(c[u]),r&&s.includes("SUBTOTAL("))||0<s.length&&d++;else s=r?this.parent.getValueFromArg(h[p],null,null,!0):this.parent.getValueFromArg(h[p]),r&&s.includes("SUBTOTAL(")||0<s.length&&d++;else(0<(a=this.parent.getValueFromArg(h[p]).split(this.parent.tic).join("")).length||0===a.length&&""===a.trim())&&d++;return d},Ehe.prototype.ComputeAVERAGEA=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(je(e)||1===e.length&&""===e[0])return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];for(var i,n,o,r=e,s=0,a=0,l=0;l<r.length;l++)if(this.parent.isCellReference(r[l]))if(-1<r[l].indexOf(":"))for(var h=this.parent.getCellCollection(r[l].split(this.parent.tic).join("")),d=0;d<h.length;d++){if(i=this.parent.getValueFromArg(h[d]),i=this.processLogicalCellValue(i),-1<this.parent.getErrorStrings().indexOf(i))return i;je(i)||""===i||(o=this.parent.parseFloat(i),s+=i=isNaN(o)?0:o,a+=1)}else{if(i=this.parent.getValueFromArg(r[l]),i=this.processLogicalCellValue(i),-1<this.parent.getErrorStrings().indexOf(i))return i;je(i)||""===i||(o=this.parent.parseFloat(i),s+=i=isNaN(o)?0:o,a+=1)}else{if(-1<r[l].indexOf(this.parent.tic)&&(isNaN(this.parent.parseFloat(r[l].split(this.parent.tic).join("")))||""===r[l].split(this.parent.tic).join("").trim()))return this.parent.getErrorStrings()[yhe.Value];if(r[l]=this.processLogicalCellValue(r[l]),n=this.parent.getValueFromArg(r[l].split(this.parent.tic).join("")),-1<this.parent.getErrorStrings().indexOf(n))return n;s+=this.parent.parseFloat(n),a+=1}return 0===a?this.parent.getErrorStrings()[yhe.DivZero]:s/a},Ehe.prototype.processLogicalCellValue=function(e){return e.toUpperCase()===this.parent.trueValue?e="1":e.toUpperCase()===this.parent.falseValue&&(e="0"),e},Ehe.prototype.ComputeSORT=function(){for(var e,t=this,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];i.length&&"nestedFormulaTrue"===i[i.length-1]&&(e=!0,i.pop());var o,r=i,s=[];if(je(i)||""===i[0]||4<r.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];r[1]=r[1]||"1",r[2]=r[2]||"1",r[3]=r[3]||"FALSE",r[0]=r[0].split("$").join("");var a=[];if(-1<r[0].indexOf(":")){var l=r[0].split(":");if(this.parent.isCellReference(l[0])&&this.parent.isCellReference(l[1])){var l=r[0].indexOf(":"),h=void 0,d=this.parent.rowIndex(this.parent.substring(r[0],0,l)),p=this.parent.colIndex(this.parent.substring(r[0],0,l)),c=this.parent.rowIndex(this.parent.substring(r[0],l+1,l+r[0].length-l-1)),u=this.parent.colIndex(this.parent.substring(r[0],l+1,l+r[0].length-l-1));if(c<d&&(h=c,c=d,d=h),u<p&&(h=u,u=p,p=h),this.parent.isCellReference(r[3])){if(r[3]=this.parent.getValueFromArg(r[3]).toUpperCase(),r[3]!==this.parent.trueValue&&r[3]!==this.parent.falseValue)if(mre(r[3]))r[3]=0===Number(r[3])?this.parent.falseValue:this.parent.trueValue;else{if(""!==r[3])return this.parent.getErrorStrings()[yhe.Value];r[3]=this.parent.falseValue}}else if(S=r[3].startsWith(this.parent.tic)&&r[3].endsWith(this.parent.tic),r[3]=this.parent.getValueFromArg(r[3]),r[3]=mre(r[3])?0===Number(r[3])?this.parent.falseValue:this.parent.trueValue:r[3].split(this.parent.tic).join("").toUpperCase(),r[3]!==this.parent.trueValue&&r[3]!==this.parent.falseValue)return this.parent.getErrorStrings()[S?yhe.Value:yhe.Name];if(this.parent.isCellReference(r[2])?(r[2]=this.parent.getValueFromArg(r[2]),r[2]=r[2]===this.parent.trueValue?"1":r[2]):(r[2]=this.parent.getValueFromArg(r[2]),r[2]=r[2]===this.parent.trueValue?"1":r[2].split(this.parent.tic).join("")),r[2]=mre(r[2])?Math.floor(Number(r[2])).toString():r[2],"1"!==r[2]&&"-1"!==r[2])return-1<this.parent.getErrorStrings().indexOf(r[2])?this.parent.getErrorStrings()[yhe.Name]:this.parent.getErrorStrings()[yhe.Value];l="1"===r[2]?"Ascending":"Descending";if(this.parent.isCellReference(r[1])){if(r[1]=this.parent.getValueFromArg(r[1]),r[1]=mre(r[1])?Math.floor(Number(r[1])).toString():r[1]===this.parent.trueValue?"1":r[1]===this.parent.falseValue?"0":r[1],isNaN(this.parseDouble(r[1]))||this.parseDouble(r[1])<1||(r[3]===this.parent.trueValue?c-d+1<this.parseDouble(r[1]):u-p+1<this.parseDouble(r[1])))return this.parent.getErrorStrings()[yhe.Value]}else if(S=r[1].startsWith(this.parent.tic)&&r[1].endsWith(this.parent.tic),r[1]=this.parent.getValueFromArg(r[1]),r[1]=mre(r[1])?Math.floor(Number(r[1])).toString():r[1]===this.parent.trueValue?"1":r[1]===this.parent.falseValue?"0":r[1].split(this.parent.tic).join(""),isNaN(this.parseDouble(r[1]))?S:this.parseDouble(r[1])<1||(r[3]===this.parent.trueValue?c-d+1<this.parseDouble(r[1]):u-p+1<this.parseDouble(r[1])))return this.parent.getErrorStrings()[yhe.Value];var g="";0===r[0].indexOf("!")&&(g=(g=(g=r[0]).replace("!","")).indexOf("!"),g=r[0].substring(0,g+2)),r[0]=g+_he(p)+d+":"+_he(u)+c;for(var R=this.parent.getCellCollection(r[0]),m=0;m<R.length;m++)a.push(this.parent.getValueFromArg(R[m]));var f=[],y=[],v=[],b=[],w=[],C=u-p+1,O=function(e){e?"TRUE"===e.toUpperCase()||"FALSE"===e.toUpperCase()?(b.push(e),f.push(e)):isNaN(t.parseDouble(e))?(v.push(e),f.push(e)):(y.push(t.parseDouble(e)),f.push(t.parseDouble(e))):""===e&&(w.push(t.parseDouble(e).toString()),f.push(t.parseDouble(e).toString()))};if("TRUE"===r[3])for(m=0;m<C;m++)O(a[m+(this.parseDouble(r[1])-1)*C]);if("FALSE"===r[3])for(m=0;m<a.length;m++)O(a[m*C+this.parseDouble(r[1])-1]);for(var h=0<y.length?Sa.sort(y,null,Sa.fnSort(l)):[],S=0<v.length?Sa.sort(v,null,Sa.fnSort(l)):[],N=0<b.length?Sa.sort(b,null,Sa.fnSort(l)):[],V="Ascending"==l?h.concat(S,N,w):N.concat(S,h,w),A=[],x=0;x<V.length;x++)for(var I=0;I<f.length;I++)JSON.stringify(V[x])===JSON.stringify(f[I])&&-1===A.indexOf(I)&&A.push(I);if("TRUE"===r[3]){for(var T=d,E=0;T<=c;T++,E++)for(var x=0,D=0;x<A.length;x++,D++){var M=this.parent.getValueFromArg(g+_he(A[x]+p)+T);e&&""!==M?s.push(M):(M=""===M?"0":M,F=(P=-1<(P=this.parent.actCell).indexOf("!")?P.substring(P.lastIndexOf("!")+1):P,this.parent.rowIndex(P)),B=this.parent.colIndex(P),this.parent.parentObject.setValueRowCol(this.parent.getSheetID(this.parent.grid)+1,M,F+E,B+D))}o=this.parent.getValueFromArg(g+_he(A[0]+p)+d)}if("FALSE"===r[3]){for(x=0,E=0;x<A.length;x++,E++)for(var k=p,D=0;k<=u;k++,D++){var P,B,F,L=this.parent.getValueFromArg(g+_he(k)+(A[x]+d));e&&""!==L?s.push(L):(L=""===L?"0":L,B=(P=-1<(P=this.parent.actCell).indexOf("!")?P.substring(P.lastIndexOf("!")+1):P,this.parent.colIndex(P)),F=this.parent.rowIndex(P),this.parent.parentObject.setValueRowCol(this.parent.getSheetID(this.parent.grid)+1,L,F+E,B+D))}o=this.parent.getValueFromArg(g+_he(p)+(A[0]+d))}}}return e?s.join(","):""===o?"0":o},Ehe.prototype.ComputeCOUNTIF=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e;if(je(e)||""===e[0]||2!==i.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(i[0].indexOf(":")<0&&!this.parent.isCellReference(i[0]))return this.parent.getErrorStrings()[yhe.Name];var n,o=0,r=[],s="equal";if(""===i[1])return 0;var a=i[1].startsWith(this.parent.tic)&&i[1].endsWith(this.parent.tic),l=i[1].split(this.parent.tic).join(""),h=l.includes("*"),d="*"===l||"<>*"===l,p=h&&!d?l.replace(/\*/g,"").trim():l,c=!1,u=(!a&&this.parent.isCellReference(p)&&(p=this.parent.getValueFromArg(p),c=!0),(l=p=h&&!d&&(h=l.indexOf("*"),"*"===l[0]&&(p="*"+p),"*"===l[l.length-1]&&(p+="*"),0<h)&&h<l.length-1?l.substring(0,h)+"*"+l.substring(h+1):p).startsWith("<=")?(s="lessEq",l=l.substring(2)):l.startsWith(">=")?(s="greaterEq",l=l.substring(2)):l.startsWith("<>")?(s="notEq",l=l.substring(2)):l.startsWith("<")?(s="less",l=l.substring(1)):l.startsWith(">")?(s="greater",l=l.substring(1)):l.startsWith("=")&&(s="equal",l=l.substring(1)),-1<l.indexOf("*")||-1<l.indexOf("?"));if((!a&&this.parent.isCellReference(l)&&!c||l.includes(this.parent.arithMarker)||l.includes(this.parent.getParseDecimalSeparator())&&!u)&&(l=this.parent.getValueFromArg(l)),-1<i[0].indexOf(":")&&this.parent.isCellReference(i[0]))for(var g=this.parent.getCellCollection(i[0].split(this.parent.tic).join("")),m=0;m<g.length;m++)n=this.parent.getValueFromArg(g[m]),u&&(n=this.parent.findWildCardValue(l.toLowerCase(),n.toLowerCase())),r.push(n),r.push(l),this.parent.processLogical(r,s)===this.parent.trueValue&&o++;return o},Ehe.prototype.ComputeSUMIFS=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.calculateIFS(e)},Ehe.prototype.calculateIFS=function(t,i){var n,o,r,s=this;if(je(t)||""===t[0]||t.length<2||127<t.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(3===t.length&&t[2].includes(this.parent.tic+this.parent.tic))return n="",r=this.parent.getParseArgumentSeparator(),t[2].split(this.parent.tic+this.parent.tic).forEach(function(e){(e=e.trim().split(s.parent.tic).join(""))&&(o=s.parent.computeIfsFormulas([t[0],t[1],e],s.parent.falseValue,i).toString(),n+=(n?r:"")+o)}),n;return this.parent.computeIfsFormulas(t,this.parent.falseValue,i)},Ehe.prototype.ComputeTEXT=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];t.length&&"nestedFormulaTrue"===t[t.length-1]&&(e=!0,t.pop());var n=t[1];if(2!==t.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];var o=t[0],r=n;if(""===n)return this.parent.getValueFromArg(o);var s=new Date(1900,0,1,0,0,0),a=o+","+r,l=new Ti;if(-1<this.parent.getErrorStrings().indexOf(a))return a;if(mre((o=this.parent.getValueFromArg(o)).split(this.parent.tic).join(""))&&(o=o.split(this.parent.tic).join("")),""===(r=n.startsWith('"')&&n.endsWith('"')?r.split(this.parent.tic).join(""):this.parent.getValueFromArg(r)))return"";""===o&&(0<r.length&&(-1<r.toUpperCase().indexOf("M")||-1<r.toUpperCase().indexOf("D")||-1<r.toUpperCase().indexOf("Y")||-1<r.toUpperCase().indexOf("S")||-1<r.toUpperCase().indexOf("T"))||-1<r.toUpperCase().indexOf("H"))&&(o=s.toString());a=this.parseDouble(o);if(isNaN(a)&&null!==this.parent.isDate(new Date(o))&&(a=this.parent.toOADate(new Date(o))),s=Date.parse(o.split(this.parent.tic).join("")),!isNaN(a)||!isNaN(s))if(0<r.length&&-1===r.indexOf("#")&&(-1<r.toUpperCase().indexOf("M")||-1<r.toUpperCase().indexOf("D")||-1<r.toUpperCase().indexOf("Y")||-1<r.toUpperCase().indexOf("S")||-1<r.toUpperCase().indexOf("T"))||-1<r.toUpperCase().indexOf("H")){for(var h=(r=(r=r.split("Y").join("y").split("D").join("d").split("H").join("h")).split("S").join("s").split("m").join("M").split("AM/PM").join("tt")).split(""),d=!1,p=!1,c=0,u=0,c=0;c<h.length;){var g=h[c];"s"===g&&"M"===h[u]&&(h[u]="m","M"===h[u-1])&&(h[u-1]="m"),this.parent.isChar(g)&&(u=c),"M"===g&&d&&(h[c]="m",p=!0),"h"===g?d=!0:this.parent.isChar(g)&&"M"!==g&&"h"!==g&&!p&&(p=d=!1),c++}r=(r=String(h)).split(",").join("").split("\n").join(" ");var m,n=this.parent.fromOADate(a),s=(0===a&&(n=s),xhe(r));if(""===s)return m=ure(n),this.parent.parentObject.getDisplayText({format:r,value:m});o=l.getDateFormat({skeleton:s,type:"date"})(new Date(n.toString()))}else o=this.parent.parentObject.getDisplayText({format:r,value:a});return e?this.parent.tic+o+this.parent.tic:o},Ehe.prototype.ComputeCOUNTIFS=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.parent.computeIfsFormulas(e,this.parent.trueValue)},Ehe.prototype.ComputeAVERAGEIFS=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.calculateIFS(e,this.parent.trueValue)},Ehe.prototype.ComputeMATCH=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e.slice(),n=this.parent.getErrorStrings();if(je(i)||1===i.length&&""===i[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(i.length<2||3<i.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];i[0]=this.parent.getValueFromArg(e[0]);var o,r=-1<i[0].indexOf(this.parent.tic);if(i[0]=i[0].split(this.parent.tic).join(""),-1<n.indexOf(i[0]))return i[0];if(""===i[0])return n[yhe.NA];if(isNaN(Number(i[0]))&&(r=!0),je(e[2]))i[2]="1";else{if(i[2]=this.parent.getValueFromArg(i[2]),-1<i[2].indexOf(this.parent.tic)&&isNaN(Number(i[2].split(this.parent.tic).join(""))))return n[yhe.Value];i[2].toUpperCase()===this.parent.trueValue?i[2]="1":i[2].toUpperCase()===this.parent.falseValue&&(i[2]="0")}o=parseFloat(i[2]),-1===[-1,0,1].indexOf(o)&&(o=0);var s,a=[],l=!1;if(-1<i[1].indexOf(":")||this.parent.isCellReference(i[1])){if("#REF!"===(s=this.parent.getCellCollection(i[1]))[0])return this.parent.getErrorStrings()[yhe.Name];for(var h=0;h<s.length;h++){var d=this.parent.getValueFromArg(s[h]);(-1<d.indexOf(this.parent.tic)||isNaN(Number(d)))&&(l=!0),a[h]=d.split(this.parent.tic).join("")}if(r&&!l||!r&&l)return n[yhe.NA]}for(var p=0,c="",u=!1,g=isNaN(Number(i[0]))?i[0]:Number(i[0]),m=0;m<a.length;m++)if(""===a[m])m===a.length-1&&a.pop();else{if(-1===o&&(r||l))break;var f=isNaN(Number(a[m]))?a[m]:Number(a[m]);if(1===o)g===f?(p=m+1,u=!0,isNaN(Number(i[0]))&&(r=!1)):f<g&&!r&&!u&&(!c||f>(isNaN(Number(c))?c:Number(c)))&&(p=m+1,c=a[m]);else if(0===o){if((-1<i[0].indexOf("*")||-1<i[0].indexOf("?"))&&(a[m]=this.parent.findWildCardValue(i[0],a[m])),i[0]===a[m])return m+1}else if(-1===o){if(!(Number(a[m])>Number(a[m+1])||m===a.length-1))return n[yhe.NA];g===f?(p=m+1,g=void 0):g<f&&(!c||f<(isNaN(Number(c))?c:Number(c)))&&(p=m+1,c=a[m])}}return r&&l&&1===o?a.length:p||n[yhe.NA]},Ehe.prototype.ComputeLOOKUP=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return je(e)||1===e.length&&""===e[0]?this.parent.formulaErrorStrings[vhe.WrongNumberArguments]:this.parent.computeLookup(e)},Ehe.prototype.ComputeVLOOKUP=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.parent.computeVHLookup(e,!0)},Ehe.prototype.ComputeHLOOKUP=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.parent.computeVHLookup(e)},Ehe.prototype.ComputeSUBTOTAL=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=this.parent.getErrorStrings();if(je(t)||1===t.length&&""===t[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(t.length<2)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(e=this.parent.getValueFromArg(t[0]).trim(),!(-1<n.indexOf(e))){if(""===e.split(this.parent.tic).join("").trim())return n[yhe.Value];if((e=this.parent.isCellReference(t[0])?e:this.parent.removeTics(e)).toUpperCase()===this.parent.trueValue?e="1":e.toUpperCase()===this.parent.falseValue?e="0":2===e.split("%").length&&this.parent.isNumber(e.split("%")[0])&&(e=(Number(e.split("%")[0])/100).toString()),e=this.parent.parseFloat(e),isNaN(e)||(e<1||11<e)&&(e<101||111<e))return n[yhe.Value];var o=t.slice(1,t.length);switch(e){case 1:case 101:e=this.ComputeAVERAGE.apply(this,o.concat(["isSubtotal"]));break;case 2:case 102:e=this.ComputeCOUNT.apply(this,o.concat(["isSubtotal"]));break;case 3:case 103:e=this.ComputeCOUNTA.apply(this,o.concat(["isSubtotal"]));break;case 4:case 104:e=this.ComputeMAX.apply(this,o.concat(["isSubtotal"]));break;case 5:case 105:e=this.ComputeMIN.apply(this,o.concat(["isSubtotal"]));break;case 6:case 106:e=this.ComputePRODUCT.apply(this,o.concat(["isSubtotal"]));break;case 7:case 107:e=this.ComputeDAY.apply(this,o);break;case 8:case 108:e=this.ComputeCONCAT.apply(this,o);break;case 9:case 109:e=this.ComputeSUM.apply(this,o.concat(["isSubtotal"]));break;case 10:case 110:e=this.ComputeAVERAGEA.apply(this,o);break;case 11:case 111:e=this.ComputeABS.apply(this,o);break;default:e=n[yhe.Value]}}return e},Ehe.prototype.ComputeRADIANS=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=this.parent.getErrorStrings();if(je(t)||""===t[0]&&1===t.length||2===t[0].split("!").length&&-1===t[0].indexOf(this.parent.tic))return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(1<t.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(-1<t[0].indexOf(":")||""===t[0].split(this.parent.tic).join("").trim()||"!"===t[0].split(this.parent.tic).join("").trim()||2===t[0].split("!").length)return n[yhe.Value];if(e=this.parent.getValueFromArg(t[0]).trim(),!(-1<n.indexOf(e))){if(-1<e.indexOf(this.parent.tic)&&-1===t[0].indexOf(this.parent.tic)||3<e.split(this.parent.tic).length)return n[yhe.Value];if(e.toUpperCase()===this.parent.trueValue?e="1":e.toUpperCase()===this.parent.falseValue?e="0":2===e.split("%").length&&this.parent.isNumber(e.split("%")[0])&&(e=(Number(e.split("%")[0])/100).toString()),e=this.parent.parseFloat(e.split(this.parent.tic).join("")),isNaN(e))return this.parent.isCellReference(t[0])||-1<t[0].indexOf(this.parent.tic)?n[yhe.Value]:n[yhe.Name];e=Math.PI*e/180}return e},Ehe.prototype.ComputeRANDBETWEEN=function(){for(var n,e,t,o=this,i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];return 1===i.length&&""===i[0]?this.parent.formulaErrorStrings[vhe.InvalidArguments]:2!==i.length?this.parent.formulaErrorStrings[vhe.WrongNumberArguments]:(n=this.parent.getErrorStrings(),t=(e=function(e){var t=o.parent.getValueFromArg(e);if(-1<n.indexOf(t))return t;if(o.parent.isCellReference(e)){if(""===t)t="0";else if(-1<e.indexOf(":")||t.match(/^(\d*\.\d+|\d+)\s*[+\-*/]\s*(\d*\.\d+|\d+)$/))return n[yhe.Value]}else{if(""===t)return n[yhe.NA];if(-1<e.indexOf(o.parent.tic)&&o.parent.removeTics(e).match(/^(\d*\.\d+|\d+)\s*[+*]\s*(\d*\.\d+|\d+)$/))return n[yhe.Value];if(-1<t.indexOf(o.parent.tic)&&-1<(t=o.parent.removeTics(t)).indexOf(":")){e=t.split(":");if(!(e.length<=3))return n[yhe.Value];if(!o.parent.isNumber(e[0])||!o.parent.isNumber(e[1]))return n[yhe.Value];var i=Number(e[0])+Number(Number(e[1])/60);if(3===e.length){if(!o.parent.isNumber(e[2]))return n[yhe.Value];i+=Number(Number(e[2])/3600)}t=(i/24).toString()}2===t.split("%").length&&o.parent.isNumber(t.split("%")[0])&&(t=(.01*Number(t.split("%")[0])).toString())}return t=parseFloat(t),isNaN(t)?n[yhe.Value]:t})(i[1]),-1<n.indexOf(t)?t:(e=e(i[0]),-1<n.indexOf(e)?e:0===e&&0===t?"0":t<e?n[yhe.Num]:(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e))))},Ehe.prototype.ComputeSLOPE=function(){for(var i=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.parent.getErrorStrings();if(je(e)||1===e.length&&""===e[0].trim())return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(2!==e.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(""===e[0]||""===e[1])return n[yhe.Value];function o(e){return e=-1===e.indexOf(i.parent.tic)?i.parent.getCellCollection(e.split(i.parent.tic).join("")):void 0}var r=o(e[0].trim()),s=o(e[1].trim());if(je(r)||je(s)||r.length<2&&s.length<2)return n[yhe.DivZero];if(r.length!==s.length)return n[yhe.NA];function a(e){e=i.getDataCollection(e);for(var t=0;t<e.length;t++)if(-1<n.indexOf(e[t]))return e[t].toString();return e}r=a(r);if(-1<n.indexOf(r.toString()))return r.toString();if(s=a(s),-1<n.indexOf(s.toString()))return s.toString();for(var l=0,h=0,d=0,p=0,c=0,u=0,g=s.length;u<g;++u)""!==s[u]&&"NaN"!==Number(s[u]).toString()&&""!==r[u]&&"NaN"!==Number(r[u]).toString()&&(l+=Number(s[u])*Number(r[u]),d+=Number(s[u]),p+=Number(r[u]),h+=Number(s[u])*Number(s[u]),c++);var m=((l-d*p/c)/(h-d*d/c)).toString();return"NaN"===m?n[yhe.DivZero]:m},Ehe.prototype.ComputeINTERCEPT=function(){for(var i=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,o,r,s,a,l,h,d,p,c=this.parent.getErrorStrings();return je(e)||1===e.length&&""===e[0].trim()?this.parent.formulaErrorStrings[vhe.InvalidArguments]:2!==e.length?this.parent.formulaErrorStrings[vhe.WrongNumberArguments]:""===e[0]||""===e[1]?c[yhe.Value]:(o=(p=function(e){return e=-1===e.indexOf(i.parent.tic)?i.parent.getCellCollection(e.split(i.parent.tic).join("")):void 0})(e[0].trim()),n=p(e[1].trim()),je(o)||je(n)||o.length<2&&n.length<2?c[yhe.DivZero]:o.length!==n.length?c[yhe.NA]:(o=(p=function(e){e=i.getDataCollection(e);for(var t=0;t<e.length;t++)if(-1<c.indexOf(e[t]))return e[t];return e})(o),-1<c.indexOf(o.toString())?o.toString():(n=p(n),-1<c.indexOf(n.toString())?n.toString():((p=function(e){for(var t=0,i=n.length;t<i;++t)""!==o[t]&&"NaN"!==Number(o[t]).toString()&&""!==n[t]&&"NaN"!==Number(n[t]).toString()&&(e?(r+=Number(o[t]),s+=Number(n[t]),a++):(d=Number(n[t])-s,l+=d*(Number(o[t])-r),h+=d*d))})(!(h=l=a=s=r=0)),r/=a,s/=a,p(!1),"NaN"===(p=(r-l/h*s).toString())?c[yhe.DivZero]:p))))},Ehe.prototype.ComputeLN=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=this.parent.getErrorStrings();return je(t)||""===t[0]&&1===t.length?this.parent.formulaErrorStrings[vhe.InvalidArguments]:0===t.length||1<t.length?this.parent.formulaErrorStrings[vhe.WrongNumberArguments]:(e=this.parent.getValueFromArg(t[0]),-1<n.indexOf(e)?e:(e.toUpperCase()===this.parent.trueValue?e="1":e.toUpperCase()===this.parent.falseValue&&(e="0"),this.parent.isCellReference(t[0])||""!==(e=this.parent.removeTics(e)).trim()?(2===e.split("%").length&&this.parent.isNumber(e.split("%")[0])&&(e=(.01*Number(e.split("%")[0])).toString()),(e=this.parent.parseFloat(e))<=0?n[yhe.Num]:isNaN(e)?n[yhe.Value]:Math.log(e)):n[yhe.Value]))},Ehe.prototype.ComputeISNUMBER=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=e;return 1===e.length&&""===e[0]?this.parent.formulaErrorStrings[vhe.InvalidArguments]:1!==e.length?this.parent.formulaErrorStrings[vhe.WrongNumberArguments]:""!==(i=this.parent.isCellReference(i[0])?this.parent.getValueFromArg(i[0]):this.parent.getValueFromArg(i[0].split(this.parent.tic).join(""))).toString()&&!e.toString().startsWith(this.parent.tic)&&(i=this.parent.parseFloat(i),!isNaN(i))},Ehe.prototype.ComputeROUND=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!e.length||1===e.length||2<e.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];var i=e;if(1===e.length)return n="TRUE"===i[0].split(this.parent.tic).join("")?"1":"FALSE"===i[0].split(this.parent.tic).join("")?"0":i[0],isNaN(this.parent.parseFloat(n))?this.parent.formulaErrorStrings[vhe.InvalidArguments]:Math.round(this.parent.parseFloat(n)).toString();var n=this.parent.getValueFromArg(i[0]);if(-1<this.parent.getErrorStrings().indexOf(n))return n;var o=this.parent.getValueFromArg(i[1]);if(-1<this.parent.getErrorStrings().indexOf(o))return o;o="TRUE"===o?"1":"FALSE"===o?"0":o;var n=(n="TRUE"===n?"1":"FALSE"===n?"0":n).split(this.parent.tic).join(""),o=o.split(this.parent.tic).join(""),r=isNaN(Number(n))||""===n.trim(),s=isNaN(Number(o))||""===o.trim();return(-1<i[0].indexOf('"')||this.parent.isCellReference(i[0]))&&r||(-1<i[1].indexOf('"')||this.parent.isCellReference(i[1]))&&s?this.parent.getErrorStrings()[yhe.Value]:""===n&&""===o||""===n?0:(r=this.parent.parseFloat(n),i=this.parent.parseFloat(o),(!isNaN(i)&&!isNaN(r)&&0<i?this.parent.parseFloat(this.preciseRound(r,i,"ROUND")):(s=Math.pow(10,-i),Math.round(r/s)*s)).toString())},Ehe.prototype.preciseRound=function(e,t,i){var n=Math.pow(10,t),o=Math.abs(e)*n,e=0<=e?1:-1;return(("ROUND"===i?Math.round(o):"ROUNDDOWN"===i?Math.floor(o):Math.ceil(o))/n*e).toFixed(t)},Ehe.prototype.ComputePOWER=function(){for(var i=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,o,r=this.parent.getErrorStrings();return je(e)||1===e.length&&""===e[0].trim()?this.parent.formulaErrorStrings[vhe.InvalidArguments]:2<e.length?this.parent.formulaErrorStrings[vhe.WrongNumberArguments]:""===e[0].trim()&&""===e[1].trim()?r[yhe.Num]:(n=(o=function(e){var t=i.parent.getValueFromArg(e);if(-1<r.indexOf(t))return t;if(t.toUpperCase()===i.parent.trueValue?t="1":t.toUpperCase()===i.parent.falseValue&&(t="0"),-1<t.indexOf(i.parent.tic)&&(t=i.parent.removeTics(t),-1===e.indexOf(i.parent.tic)||""===t.trim()))return r[yhe.Value];if(2===t.split("%").length&&i.parent.isNumber(t.split("%")[0]))t=(Number(t.split("%")[0])/100).toString();else if(-1<t.indexOf("/")&&i.parent.isNumber(t.split("/").join("")))return r[yhe.Num];return t=i.parent.parseFloat(t),isNaN(t)?r[yhe.Value]:t})(e[0]),-1<r.indexOf(n)?n:(o=o(e[1]),-1<r.indexOf(o)?o:isNaN(n)||isNaN(o)?r[yhe.Value]:0===n&&o<0?r[yhe.DivZero]:0===n&&0===o||(n=Math.pow(n,o),isNaN(n))||n===1/0?r[yhe.Num]:n.toString()))},Ehe.prototype.ComputeSQRT=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=t[0];if(0===t.length||1<t.length||""===n)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(""===n.split(this.parent.tic).join("").trim())return this.parent.getErrorStrings()[yhe.Value];if(this.parent.isCellReference(n)){if(-1<(e=this.parent.getValueFromArg(n)||"0").indexOf(this.parent.tic))return this.parent.getErrorStrings()[yhe.Value]}else{if(-1<n.indexOf(this.parent.tic)&&(n.split(this.parent.tic).join("")===this.parent.trueValue||n.split(this.parent.tic).join("")===this.parent.falseValue))return this.parent.getErrorStrings()[yhe.Value];e=this.parent.getValueFromArg(n).split(this.parent.tic).join("")}if(-1<this.parent.getErrorStrings().indexOf(e))return e;if(e=e===this.parent.trueValue?"1":e===this.parent.falseValue?"0":e,this.parent.parseFloat(e)<0)return this.parent.getErrorStrings()[yhe.Num];if(isNaN(this.parent.parseFloat(e))){n={value:e};if(this.parent.parentObject.notify(Fie,n),!n.isDate&&!n.isTime)return this.parent.getErrorStrings()[yhe.Value];e=n.updatedVal}return Math.sqrt(this.parent.parseFloat(e))},Ehe.prototype.ComputeLOG=function(){for(var e,t,n=this,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var r=this.parent.getErrorStrings();if(je(i)||1===i.length&&""===i[0])return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(2<i.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];function s(e){var t=n.parent.getValueFromArg(e);if(t===n.parent.trueValue?t="1":t===n.parent.falseValue&&(t="0"),!n.parent.isCellReference(e)&&""!==t){if(-1<t.indexOf(n.parent.tic)&&-1===r.indexOf(t.split(n.parent.tic).join(""))){if(""===(t=n.parent.removeTics(t)).trim())return r[yhe.Value];if(-1<t.indexOf(":")){e=t.split(":");if(!(e.length<=3))return r[yhe.Value];if(!n.parent.isNumber(e[0])||!n.parent.isNumber(e[1]))return r[yhe.Value];var i=Number(e[0])+Number(Number(e[1])/60);if(3===e.length){if(!n.parent.isNumber(e[2]))return r[yhe.Value];i+=Number(Number(e[2])/3600)}t=(i/24).toString()}}2===t.split("%").length&&n.parent.isNumber(t.split("%")[0])&&(t=(.01*Number(t.split("%")[0])).toString())}return t}if(!je(i[0])){if(e=s(i[0]),-1<r.indexOf(e))return e;e=this.parent.parseFloat(e)}if(t=10,!je(i[1])){if(t=s(i[1]),-1<r.indexOf(t))return t;t=this.parent.parseFloat(t)}return e=Number(e),isNaN(e)||isNaN(t)?r[yhe.Value]:e<=0||t<=0?r[yhe.Num]:1===t?r[yhe.DivZero]:(Math.log(e)/Math.LN10/(Math.log(t)/Math.LN10)).toString()},Ehe.prototype.ComputeTRUNC=function(){for(var e,n=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var o=0,r=this.parent.getErrorStrings();if(je(t)||""===t[0]&&1===t.length)return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(0===t.length||2<t.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];function s(e){var t=n.parent.getValueFromArg(e);if(!(-1<r.indexOf(t)))if(t===n.parent.trueValue)t="1";else if(t===n.parent.falseValue)t="0";else if(!n.parent.isCellReference(e)){if(-1<e.indexOf(n.parent.tic)&&n.parent.removeTics(e).match(/^(\d*\.\d+|\d+)\s*[*]\s*(\d*\.\d+|\d+)$/))t=n.parent.getValueFromArg(n.parent.removeTics(e));else if(-1<t.indexOf(n.parent.tic)){if(""===(t=n.parent.removeTics(t)).trim())return r[yhe.Value];if(-1<t.indexOf(":")){e=t.split(":");if(!(e.length<=3))return r[yhe.Value];if(!n.parent.isNumber(e[0])||!n.parent.isNumber(e[1]))return r[yhe.Value];var i=Number(e[0])+Number(Number(e[1])/60);if(3===e.length){if(!n.parent.isNumber(e[2]))return r[yhe.Value];i+=Number(Number(e[2])/3600)}t=(i/24).toString()}}2===t.split("%").length&&n.parent.isNumber(t.split("%")[0])&&(t=(.01*Number(t.split("%")[0])).toString())}return t}if(!je(t[0])){if(e=s(t[0]),-1<r.indexOf(e))return e;if(e=this.parent.parseFloat(e),isNaN(e))return r[yhe.Value]}if(!je(t[1])){if(o=s(t[1]),-1<r.indexOf(o))return o;if(o=this.parent.parseFloat(o),isNaN(o))return r[yhe.Value]}return o=Math.pow(10,Math.floor(o)),(((e=Number(e))<0?-1:1)*Math.floor(o*Math.abs(e))/o).toString()},Ehe.prototype.ComputeEXP=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this.parent.getErrorStrings();if(""===e[0]&&1===e.length)return this.parent.formulaErrorStrings[vhe.InvalidArguments];if(1!==e.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(""===e[0].split(this.parent.tic).join("").trim())return i[yhe.Value];if(n=this.parent.getValueFromArg(e[0]),-1<i.indexOf(n))return n;if(-1<n.indexOf(this.parent.tic)&&(this.parent.isCellReference(e[0])||isNaN(Number(n.split(this.parent.tic).join("")))))return i[yhe.Value];if((n=n.split(this.parent.tic).join(""))===this.parent.trueValue)n="1";else if(n===this.parent.falseValue||""===n)n="0";else if(-1<n.indexOf("%"))n=(Number(n.split("%")[0])/100).toString();else if(-1<n.indexOf(":"))return"0";var n=this.parent.parseFloat(n);return isNaN(n)?i[yhe.Value]:709<n?i[yhe.Num]:Math.exp(n).toString()},Ehe.prototype.ComputeGEOMEAN=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i,n,o,r=e,s=1,a=0,l=0;if(0===e.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(1!==r.length||""!==r[0]){for(var h,d=0;d<r.length;d++)if(-1<r[d].indexOf(":")){if(r[0]===this.parent.tic)return this.parent.getErrorStrings()[yhe.Value];for(o=this.parent.getCellCollection(r[d].split(this.parent.tic).join("")),n=0;n<o.length;n++){if(h=(h=(l=this.parent.getValueFromArg(o[n])).split(this.parent.tic).join(""))===this.parent.trueValue||h===this.parent.falseValue,(i=this.parent.parseFloat(l))<=0)return this.parent.getErrorStrings()[yhe.Num];h||-1<this.parent.getErrorStrings().indexOf(l)||isNaN(i)||(a++,s*=i)}}else{if(l=this.parent.getValueFromArg(r[d]),-1<this.parent.getErrorStrings().indexOf(l))return l;var p=l.split(this.parent.tic).join("");if(-1<l.indexOf('"')&&isNaN(this.parent.parseFloat(p)))return this.parent.getErrorStrings()[yhe.Value];if(r[d]=r[d].startsWith("n")?r[d].slice(1):r[d],""===l&&""===r[d])return this.parent.getErrorStrings()[yhe.Num];if(("TRUE"!==p&&"FALSE"!==p||!this.parent.isCellReference(r[d]))&&0<l.length){if(l="TRUE"===(l=-1<l.indexOf('"')?p:l).split(this.parent.tic).join("")?"1":"FALSE"===l.split(this.parent.tic).join("")?"0":l,!this.parent.isCellReference(r[d])&&isNaN(this.parent.parseFloat(l)))return this.parent.getErrorStrings()[yhe.Value];if((i=this.parent.parseFloat(l))<=0)return this.parent.getErrorStrings()[yhe.Num];isNaN(i)||(a++,s*=i)}}0<a&&(s=Math.pow(s,1/a))}return s.toString()},Ehe.prototype.ComputeRSQ=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=0,n=e;if(2!==n.length)return this.parent.formulaErrorStrings[vhe.WrongNumberArguments];if(""===n[0]||""===n[1])return this.parent.getErrorStrings()[yhe.Value];if(n[0].includes('"')||n[1].includes('"'))return this.parent.getErrorStrings()[yhe.NA];if(-1===n[0].indexOf(":")&&Boe(n[0])&&-1===n[1].indexOf(":")&&Boe(n[1]))return this.parent.getErrorStrings()[yhe.DivZero];var o=this.parent.getCellCollection(n[0]),n=this.parent.getCellCollection(n[1]);if(o.length!==n.length)return this.parent.getErrorStrings()[yhe.NA];for(var r=this.getDataCollection(n),s=0;s<r.length;s++)if(-1<this.parent.getErrorStrings().indexOf(r[s]))return r[s];for(var a,l,h=this.getDataCollection(o),d=0;d<h.length;d++)if(-1<this.parent.getErrorStrings().indexOf(h[d]))return h[d];for(var p=0;p<r.length;p++)a=Number(r[p]),l=Number(h[p]),mre(a)&&mre(l)&&i++;return i<=1?this.parent.getErrorStrings()[yhe.DivZero]:2===i?1:(o=(n=this.getMeanArray(r,h))[0],n=n[1],o=this.getCorrelation(r,h,o,n),Math.pow(o,2))},Ehe.prototype.getCorrelation=function(e,t,i,n){for(var o,r,s=0,a=0,l=0,h=0;h<e.length;h++)mre(e[h])&&mre(t[h])&&(s+=(r=Number(e[h])-i)*(o=Number(t[h])-n),a+=Math.pow(r,2),l+=Math.pow(o,2));return s/Math.sqrt(a*l)},Ehe.prototype.getMeanArray=function(e,t){for(var i=0,n=0,o=0,r=0;r<e.length;r++)mre(e[r])&&mre(t[r])&&(n+=Number(e[r]),o+=Number(t[r]),i++);return[n/i,o/i]},Ehe.prototype.getDataCollection=function(e){for(var t=[],i=0,n=e.length;i<n;i++)t.push(this.parent.getValueFromArg(e[i]));return t},Ehe.prototype.parseDouble=function(e){e=this.parent.parseFloat(e.toString());return isNaN(e)?NaN:e},Ehe.prototype.spreadsheetDisplayText=function(e){var t;return this.parent.parentObject&&this.parent.parentObject.element&&this.parent.parentObject.element.classList.contains("e-spreadsheet")&&this.parent.isCellReference(e)&&(t=this.parent.parentObject.getIndexes(e),e=this.parent.parentObject.getDisplayText(this.parent.parentObject.getActiveSheet().rows[t.startIdx].cells[t.endIdx])),e},Ehe.prototype.spreadsheetFormat=function(e){var t;return this.parent.parentObject&&this.parent.parentObject.element&&this.parent.parentObject.element.classList.contains("e-spreadsheet")&&this.parent.isCellReference(e)&&(t=this.parent.parentObject.getIndexes(e),e=this.parent.parentObject.getActiveSheet().rows[t.startIdx].cells[t.endIdx].format),e};var The=Ehe;function Ehe(e){this.formulas=[{formulaName:"SUM",category:"Math & Trig",description:"Sums individual values, cell references or ranges."},{formulaName:"SUMIFS",category:"Math & Trig",description:"Sums the cells specified by a given set of conditionsor criteria."},{formulaName:"SUMPRODUCT",category:"Math & Trig",description:"Returns sum of the product of given ranges of arrays."},{formulaName:"ABS",category:"Math & Trig",description:"Returns the absolute value of a number."},{formulaName:"RAND",category:"Math & Trig",description:"Return a random number between 0 and 1."},{formulaName:"FLOOR",category:"Math & Trig",description:"Returns the round a number down to the nearest integer."},{formulaName:"CEILING",category:"Math & Trig",description:"Returns a number rounded up to a multiple of another number."},{formulaName:"SUMIF",category:"Math & Trig",description:"It will sum up cells that meet the given criteria."},{formulaName:"PRODUCT",category:"Math & Trig",description:"Multiplies all the numbers given as arguments and returns the product."},{formulaName:"AVERAGE",category:"Statistical",description:"The sum of the numbers divided by how many numbers are being averaged."},{formulaName:"AVERAGEIF",category:"Statistical",description:"Computes the average of the numbers in a range that meet the supplied criteria."},{formulaName:"COUNT",category:"Statistical",description:"Counts the numbers in the list of arguments, exclude text entries."},{formulaName:"COUNTA",category:"Statistical",description:"Counts the non-empty values in the list of arguments."},{formulaName:"COUNTIF",category:"Statistical",description:"Counts the number of cells in a range that meet a specified condition."},{formulaName:"COUNTIFS",category:"Statistical",description:"Counts the number of times each cells in all the ranges that meet the specific conditions."},{formulaName:"AVERAGEA",category:"Statistical",description:"Calculates the average of values in the list of arguments.Arguments can be numbers, names, arrays or references."},{formulaName:"AVERAGEIFS",category:"Statistical",description:"Conditionally returns the average of the contents of cells for the set of ranges."},{formulaName:"MIN",category:"Statistical",description:"Returns the smaller number in set of arguments."},{formulaName:"MAX",category:"Statistical",description:"Returns the largest number in set of arguments."},{formulaName:"DATE",category:"Date",description:"Returns the date, given the year, month and day of the month."},{formulaName:"DAY",category:"Date",description:"Returns the day of a given date."},{formulaName:"TODAY",category:"Date",description:"Returns the current date as date value."},{formulaName:"DAYS",category:"Date",description:"Returns the number of days between two dates."},{formulaName:"WEEKDAY",category:"Date",description:"Returns the day of the week corresponding to a date."},{formulaName:"IF",category:"Logical",description:"Returns one value if a logical expression is TRUE and another if it is FALSE"},{formulaName:"AND",category:"Logical",description:"Returns TRUE if all the arguments are considered TRUE, and FALSE otherwise."},{formulaName:"IFS",category:"Logical",description:"Checks multiple conditions and returns a value corresponding to the first TRUE result."},{formulaName:"IFERROR",category:"Logical",description:"Returns a value you specify if a formula evaluates to an error; otherwise, it returns the result of the formula."},{formulaName:"CHOOSE",category:"Lookup & Reference",description:"Returns a value from a list, given an index number."},{formulaName:"INDEX",category:"Lookup & Reference",description:"Returns a value from a table, given a row and column number."},{formulaName:"FIND",category:"Text",description:"Returns the position of a string of text within another string."},{formulaName:"CONCATENATE",category:"Text",description:" Used to join two or more strings together."},{formulaName:"CONCAT",category:"Text",description:"Concatenates a list or range of text strings."},{formulaName:"SUBTOTAL",category:"Lookup & Reference",description:"Returns a subtotal in a list or database."},{formulaName:"RADIANS",category:"Math & Trig",description:"Converts degrees to radians."},{formulaName:"OR",category:"Logical",description:"Returns TRUE if any arguments considered TRUE, and all the arguments are FALSE it will return FALSE."},{formulaName:"NOT",category:"Logical",description:"Returns the inverse of a given logical expression."},{formulaName:"MATCH",category:"Lookup & Reference",description:"Returns the relative position of an checked item in range that matches a specified value in a specified order"},{formulaName:"RANDBETWEEN",category:"Math & Trig",description:"Returns an integer random number in a specified range."},{formulaName:"SLOPE",category:"Statistical",description:"Returns the slope of the line from linear regression of the data points."},{formulaName:"INTERCEPT",category:"Statistical",description:"Calculates the point of the Y-intercept line via linear regression."},{formulaName:"RSQ",category:"Statistical",description:"Returns the square of the Pearson product moment correlation coefficient based on data points in known_ys and known_xs"},{formulaName:"UNIQUE",category:"Lookup & Reference",description:"Returns a unique values from a range or array."},{formulaName:"ROUNDUP",category:"Math & Trig",description:"Rounds a number away from zero."},{formulaName:"ROUNDDOWN",category:"Math & Trig",description:"Rounds a number down, toward zero."},{formulaName:"INT",category:"Math & Trig",description:"Returns a number to the nearest integer."},{formulaName:"LN",category:"Math & Trig",description:"Returns the natural logarithm of a number."},{formulaName:"ISNUMBER",category:"Information",description:"Returns TRUE, if the argument is number and FALSE otherwise."},{formulaName:"ROUND",category:"Math & Trig",description:"Rounds a number to a specified number of digits."},{formulaName:"LOG",category:"Math & Trig",description:"Returns the logarithm of a number to the base that you specify."},{formulaName:"POWER",category:"Math & Trig",description:"Returns the result of a number raised to power."},{formulaName:"SQRT",category:"Math & Trig",description:"Returns the square root of a positive number."},{formulaName:"TRUNC",category:"Math & Trig",description:"Returns the truncated value of a number to a specified number of decimal places."},{formulaName:"EXP",category:"Math & Trig",description:"Returns e raised to the power of the given number."},{formulaName:"GEOMEAN",category:"Statistical",description:"Returns the geometric mean of an array or range of positive data."},{formulaName:"TEXT",category:"Lookup & Reference",description:"Converts a value to text in specified number format."},{formulaName:"SORT",category:"Lookup & Reference",description:"Sorts a range of an array."},{formulaName:"LOOKUP",category:"Lookup & Reference",description:"Looks for a value in a one-row or one-column range, then returns a value from the same position in a second one-row or one-column range."},{formulaName:"VLOOKUP",category:"Lookup & Reference",description:"Looks for a specific value in the first column of a lookup range and returns a corresponding value from a different column within the same row."},{formulaName:"HLOOKUP",category:"Lookup & Reference",description:"Looks for a value in the top row of the array of values and then returns a value in the same column from a row in the array that you specify."},{formulaName:"T",category:"Text",description:"Checks whether a value is text or not and returns the text."},{formulaName:"EXACT",category:"Text",description:"Checks whether a two text strings are exactly same and returns TRUE or FALSE."},{formulaName:"LEN",category:"Text",description:"Returns a number of characters in a given string."},{formulaName:"MOD",category:"Math & Trig",description:"Returns a remainder after a number is divided by divisor."},{formulaName:"ODD",category:"Math & Trig",description:"Rounds a positive number up and negative number down to the nearest odd integer."},{formulaName:"PI",category:"Math & Trig",description:"Returns the value of pi."},{formulaName:"COUNTBLANK",category:"Statistical",description:"Returns the number of empty cells in a specified range of cells."},{formulaName:"EVEN",category:"Math & Trig",description:"Rounds a positive number up and negative number down to the nearest even integer."},{formulaName:"FACT",category:"Math & Trig",description:"Returns the factorial of a number."},{formulaName:"DECIMAL",category:"Math & Trig",description:"Converts a text representation of a number in a given base into a decimal number."},{formulaName:"DEGREES",category:"Math & Trig",description:"Converts radians to degrees."},{formulaName:"ADDRESS",category:"Lookup & Reference",description:"Returns a cell reference as text, given specified row and column numbers."},{formulaName:"TIME",category:"Date & Time",description:"Converts hours, minutes, seconds to the time formatted text."},{formulaName:"CHAR",category:"Text",description:"Returns the character from the specified number."},{formulaName:"CODE",category:"Text",description:"Returns the numeric code for the first character in a given string."},{formulaName:"DOLLAR",category:"Text",description:"Converts the number to currency formatted text."},{formulaName:"SMALL",category:"Statistical",description:"Returns the k-th smallest value in a given array."},{formulaName:"LARGE",category:"Statistical",description:"Returns the k-th largest value in a given array."},{formulaName:"MEDIAN",category:"Statistical",description:"Returns the median of the given set of numbers."},{formulaName:"EDATE",category:"Date & Time",description:"Returns a date with given number of months before or after the specified date."},{formulaName:"EOMONTH",category:"Date & Time",description:"Returns the last day of the month that is a specified number of months before or after an initially supplied start date."},{formulaName:"DATEVALUE",category:"Date & Time",description:"Converts a date string into date value."},{formulaName:"HOUR",category:"Date & Time",description:"Returns the number of hours in a specified time string."},{formulaName:"MINUTE",category:"Date & Time",description:"Returns the number of minutes in a specified time string."},{formulaName:"SECOND",category:"Date & Time",description:"Returns the number of seconds in a specified time string."},{formulaName:"NOW",category:"Date & Time",description:"Returns the current date and time."},{formulaName:"MONTH",category:"Date & Time",description:"Returns the number of months in a specified date string."},{formulaName:"PROPER",category:"Text",description:"Converts a text to proper case; first letter to uppercase and other letters to lowercase."}],this.isConcat=!1,this.parent=e,this.init()}Mhe.prototype.parse=function(t,i){var n=this;if(!this.parent.isTextEmpty(t)){if(Ihe(t))return this.parent.getErrorStrings()[yhe.Ref];this.parent.getFormulaCharacter()!==String.fromCharCode(0)&&this.parent.getFormulaCharacter()===t[0]&&(t=t.substring(1)),(0<this.parent.namedRanges.size||0<this.parent.storedData.size)&&(t=this.checkForNamedRangeAndKeyValue(t),this.findNamedRange=!1),t=(t=t.replace(/[-+*/&^]+/g,function(e){for(var t="";1<e.length;)switch(e.substring(0,2)){case"++":case"--":e="+"+e.substring(2);break;case"+-":case"-+":e="-"+e.substring(2);break;case"*+":e="*"+e.substring(2);break;case"/+":e="/"+e.substring(2);break;case"^+":e="^"+e.substring(2);break;case"&+":e="&"+e.substring(2);break;case"*-":case"/-":case"^-":case"&-":t=e.substring(0,1),e=e.substring(1);break;default:throw new Rhe(n.parent.formulaErrorStrings[vhe.InvalidExpression],!0)}return t+e})).split("-(-").join("(");var e,o,r=this.storeStrings(t),s=(t=this.storedStringText,0);-1<(t=(t=(t=(t=je(r)?t.split(" ").join(""):t).split("=>").join(">=")).split("=<").join("<="))[t.length-1]===this.parent.arithMarker&&this.indexOfAny(t,this.tokens)===t.length-2?t:t.toUpperCase()).indexOf(this.sheetToken)&&null!=(e=this.parent.getSheetFamilyItem(this.parent.grid)).sheetNameToParentObject&&0<e.sheetNameToParentObject.size&&(t[0]!==this.sheetToken.toString()&&(t=this.parent.setTokensForSheets(t)),e=this.parent.getSheetToken(t.split(this.parent.tic).join(this.emptyStr)),o=this.checkScopedRange(t.split('"').join(this.emptyStr).split(this.sheetToken).join("")),je(e))&&""!==e&&0<this.parent.namedRanges.size&&""!==o&&(t=o),t=this.markLibraryFormulas(t);try{t=this.formulaAutoCorrection(t)}catch(e){if(!(h={message:e.message,exception:e,isForceCalculable:e.formulaCorrection,computeForceCalculate:!1}).isForceCalculable)throw this.parent.formulaErrorStrings[vhe.InvalidExpression];if(this.isFailureTriggered||(this.parent.trigger("onFailure",h),this.isFailureTriggered=!0),!h.isForceCalculable||!h.computeForceCalculate)throw this.parent.formulaErrorStrings[vhe.InvalidExpression];t=this.formulaAutoCorrection(t,h),this.parent.storedData.get(i).formulaText="="+t}if(!this.ignoreBracet)for(s=t.indexOf(")");-1<s;){var a=t.substring(0,s).lastIndexOf("(");if(-1===a)throw new Rhe(this.parent.formulaErrorStrings[vhe.MismatchedParentheses]);if(a===s-1)throw new Rhe(this.parent.formulaErrorStrings[vhe.EmptyExpression]);var l=this.emptyStr,l=this.ignoreBracet?this.parent.substring(t,a,s-a+1):this.parent.substring(t,a+1,s-a-1);try{t=t.substring(0,a)+this.parseSimple(l)+t.substring(s+1)}catch(e){if(e===this.parent.formulaErrorStrings[vhe.CircularReference])throw e;var h=this.exceptionArgs(e),a=(this.isFailureTriggered||(this.parent.trigger("onFailure",h),this.isFailureTriggered=!0),"string"==typeof h.exception?h.exception:h.message);return(this.parent.getErrorLine(e)?"":"#"+this.parent.getErrorLine(e)+": ")+a}s=t.indexOf(")")}if(!this.ignoreBracet&&-1<t.indexOf("("))throw new Rhe(this.parent.formulaErrorStrings[vhe.MismatchedParentheses]);t=this.parseSimple(t),null!==r&&0<r.size&&(t=this.setStrings(t,r))}return t},Mhe.prototype.exceptionArgs=function(e){return{message:e.message,exception:e,isForceCalculable:e.formulaCorrection,computeForceCalculate:!1}},Mhe.prototype.formulaAutoCorrection=function(e,t){var i,n,o=["*","+","-","/","^","&"],r=[">","=","<"],s=0,a="",l="",h="",d=0;if(-1<this.parent.formulaErrorStrings.indexOf(e))return e;if(-1<this.indexOfAny(e,this.specialSym))throw new Rhe(this.parent.formulaErrorStrings[vhe.InvalidExpression],!1);for(;s<e.length;)if(e=e.split("-*").join("-").split("/*").join("/").split("*/").join("*").split("-/").join("-").split("*+").join("*").split("+*").join("+"),this.parent.isDigit(e[s])&&e.length>s+1&&-1<this.indexOfAny(e[s+1],o)&&e.length>s+2&&!je(e[s+2])&&-1<this.indexOfAny(e[s+2],o)&&("-"!==e[s+2]||"*"!==e[s+1]&&"/"!==e[s+1]&&"^"!==e[s+1]&&"&"!==e[s+1])){if(!t||!t.computeForceCalculate)throw this.parent.formulaErrorStrings[vhe.ImproperFormula];this.parent.isDigit(e[s])?(d<1?(d+=1,a=a+e[s]+(l="&"===(l=je(l=e[s+1])?this.emptyStr:l)?"":l)):d<2&&(n=e[s],i=e[s-1],h=e[s+1],d=0,a="-"===i?a+i+n+(h="&"===(h=je(h)?this.emptyStr:h)?"":h):a+n+(h=je(h)?this.emptyStr:h)),s+=2):(a="-"===e[s]?a+e[s]:a,s+=1)}else if((this.parent.isDigit(e[s])||e[s]===this.parent.rightBracket||this.parent.storedData.has(e[s].toUpperCase()))&&(je(e[s+1])||-1<this.indexOfAny(e[s+1],o)))i="&"===(i=je(e[s+1])?this.emptyStr:e[s+1])&&"-"!==e[s+2]?"":i,a="-"===e[s-1]?a+e[s-1]+e[s]+i:a+e[s]+i,s+=2;else if(-1<this.indexOfAny(e[s],r)&&!je(e[s-1])&&!je(e[s+1]))a+=e[s],s+=1;else if("q"===e[s])for(;e[s]!==this.parent.leftBracket;)a+=e[s],s+=1;else(e[s]===this.parent.leftBracket||e[s]===this.parent.rightBracket||"{"===e[s]||"}"===e[s]||"("===e[s]||")"===e[s]||this.parent.isUpperChar(e[s])||-1<e[s].indexOf(":")||e[s]===this.parent.getParseArgumentSeparator()||"%"===e[s]&&this.parent.isDigit(e[s-1])||e[s]===this.parent.tic||" "===e[s]||e[s]===this.parent.getParseDecimalSeparator()||e[s]===this.sheetToken||"$"===e[s]||"_"===e[s]||(this.parent.isDigit(e[s])&&(a="-"===e[s-1]?a+e[s-1]+e[s]:a+e[s]),"-"!==e[s]&&"+"!==e[s]||(a=(a+=e[s]).split("++").join("+").split("+-").join("-").split("-+").join("-")),"/"===e[s])||"*"===e[s]||"^"===e[s])&&(a+=e[s]),s+=1;return a=a===this.emptyStr?e:a,a=(a=-1<this.indexOfAny(a[a.length-1],o)?a.substring(0,a.length-1):a).split("--").join("-").split("-+").join("-").split("+-").join("-")},Mhe.prototype.checkScopedRange=function(n){var o,e,t,r=this,s=(this.emptyStr,"NaN"),i=this.parent.getSheetID(this.parent.grid),a=this.parent.getSheetFamilyItem(this.parent.grid),l=(n[0]===this.sheetToken.toString()&&(e=n.indexOf(this.sheetToken,1),t=parseInt(n.substr(1,e-1),10),1<e)&&!this.parent.isNaN(t)&&(n=n.substring(e+1),i=t),"!"+i.toString());return null!==a&&null!=a.sheetNameToToken&&a.sheetNameToToken.forEach(function(e,t){var i;a.sheetNameToToken.get(t).toString()===l+"!"&&(i=r.emptyStr,r.parent.namedRanges.forEach(function(e,t){i=je(r.parent.parentObject)?a.sheetNameToToken.get(t).toUpperCase():r.parent.parentObject.getActiveSheet().name+r.sheetToken+n.toUpperCase(),r.parent.getNamedRanges().has(i)&&(o=r.parent.getNamedRanges().get(i).toUpperCase(),s=o)}))}),s},Mhe.prototype.storeStrings=function(e){var t,i,n,o=0,r=0,s=null;if(-1<e.indexOf(this.parent.tic))for(o=e.indexOf(this.parent.tic);-1<o&&0<e.length;){if(null===s&&(s=this.stringsColl),-1===(t=o+1<e.length?e.indexOf(this.parent.tic,o+1):-1))throw new Rhe(this.parent.formulaErrorStrings[vhe.MismatchedTics]);n=this.parent.substring(e,o,t-o+1),i=this.parent.tic+this.spaceString+r.toString()+this.parent.tic,s=s.set(i,n),e=e.substring(0,o)+i+e.substring(t+1),(o+=i.length)<=e.length&&(o=e.indexOf(this.parent.tic,o)),r++}return this.storedStringText=e,s},Mhe.prototype.setStrings=function(i,e){for(var t=0;t<e.size;t++)e.forEach(function(e,t){i=i.split(t).join(e)});return i},Mhe.prototype.parseSimple=function(e){var t,i,n,o,r,s,a,l,h,d,p,c;return"#DIV/0!"===(e=0<e.length&&"+"===e[0]?e.substring(1):e)?"#DIV/0!":"#NAME?"===e?"#NAME?":(""===e||-1<this.parent.formulaErrorStrings.indexOf(e)||(e=(e=(e=(e=(e=(e=e.split(this.stringLessEq).join(this.charLessEq)).split(this.stringGreaterEq).join(this.charGreaterEq)).split(this.stringNoEqual).join(this.charNoEqual)).split(this.stringAnd).join(this.charAnd)).split(this.stringOr).join(this.charOr)).split(this.fixedReference).join(this.emptyStr),t=[this.tokenEp,this.tokenEm],i=[this.tokenMultiply,this.tokenDivide],n=[this.tokenAdd,this.tokenSubtract],o=[this.charMultiply,this.charDivide],r=[this.charAdd,this.charSubtract],s=[this.tokenLess,this.tokenGreater,this.tokenEqual,this.tokenLessEq,this.tokenGreaterEq,this.tokenNotEqual],a=[this.charLess,this.charGreater,this.charEqual,this.charLessEq,this.charGreaterEq,this.charNoEqual],l=[this.charEp,this.charEm],h=[this.tokenAnd],d=[this.charAnd],p=[this.charOr],c=[this.tokenOr],e=this.parseSimpleOperators(e,t,l),e=this.parseSimpleOperators(e,c,p),e=this.parseSimpleOperators(e,i,o),e=this.parseSimpleOperators(e,n,r),e=this.parseSimpleOperators(e,s,a),e=this.parseSimpleOperators(e,h,d)),e)},Mhe.prototype.parseSimpleOperators=function(e,t,i){if(-1<this.parent.getErrorStrings().indexOf(e))return e;for(var n=e,o=0,r="",s=0;s<i.length;s++)r+=i[s];0<(n=(n=(n=n.split("---").join("-").split("--").join("+").split(this.parent.getParseArgumentSeparator()+"-").join(this.parent.getParseArgumentSeparator()+"u").split(this.parent.leftBracket+"-").join(this.parent.leftBracket+"u").split("=-").join("=u")).split(",+").join(",").split(this.parent.leftBracket+"+").join(this.parent.leftBracket).split("=+").join("=").split(">+").join(">").split("<+").join("<").split("/+").join("/").split("*+").join("*").split("++").join("+").split("*-").join("*u").split("/-").join("/u").split("w-").join("wu").split("i-").join("iu").toString()).split(">-").join(">u").split("<-").join("<u").split("h-").join("hu").split("f-").join("fu").split("z-").join("zu")).length&&"-"===n[0]?(n=n.substring(1).split("-").join(this.tokenOr),n=(n=this.parseSimpleOperators(n="0-"+n,[this.tokenSubtract],[this.charSubtract])).split(this.tokenOr).join("-")):0<n.length&&"+"===n[0]?n=n.substring(1):0<n.length&&"+"===n[n.length-1]&&(n=n.substring(0,n.length-1));try{if(-1<this.indexOfAny(n,i)){if(n.includes(" ")){for(var a="",l=0;l<n.length;l++){var h=n[l];0<=i.indexOf(h)?a=a.trim()+h:" "===h&&0<=i.indexOf(a[a.length-1])||(a+=h)}n=a}for(var o=this.indexOfAny(n,i),d=this.parent.getParseDecimalSeparator();-1<o;){var p="",c="",u=0,g=0,m=!1,f=["*","+","-","/","w","=","<",">"],y=n[o]===this.charNOTop,v=0;if(y)u=o;else if(n[v=o-1]===this.parent.arithMarker){if((w=this.findLeftMarker(n.substring(0,v-1)))<0)throw new Rhe(this.parent.formulaErrorStrings[vhe.CannotParse]);p=this.parent.substring(n,w+1,v-w-1),u=w+1}else if(n[v]===this.parent.rightBracket){for(var b=0,w=v-1;0<w&&("q"!==n[w]||0!==b);)"q"===n[w]?b--:n[w]===this.parent.rightBracket&&b++,w--;if(w<0)throw new Rhe(this.parent.formulaErrorStrings[vhe.CannotParse]);p=this.parent.substring(n,w,v-w+1),u=w}else if(n[v]===this.parent.tic[0]){var C=n.substring(0,v-1).lastIndexOf(this.parent.tic);if(C<0)throw new Rhe(this.parent.formulaErrorStrings[vhe.CannotParse]);p=this.parent.substring(n,C,v-C+1),u=C}else{for(var S=!1;-1<v&&(this.parent.isDigit(n[v])||!S&&(n[v]===d||"%"===n[v]));)this.parent.isDigit(n[v])||"%"===n[v]||(S=!0),v-=1;if(-1<v&&S&&n[v]===d)throw new Rhe(this.parent.formulaErrorStrings[vhe.NumberContains2DecimalPoints]);if(0===(v+=1)||0<v&&!this.parent.isUpperChar(n[v-1]))p="n"+this.parent.substring(n,v,o-v),u=v;else if(0<v&&"E"===n[v-1]&&("TRUE"===n.substring(v-4,v)&&(je(n[v-5])||-1<f.indexOf(n[v-5]))||"FALSE"===n.substring(v-5,v)&&(je(n[v-6])||-1<f.indexOf(n[v-6])))&&("TRUE"===n.substring(v+1,v+5)||"FALSE"===n.substring(v+1,v+6)))v="TRUE"===n.substring(v-4,v)?v-4:v-5,p="TRUE"===n.substring(v,o)?"n1":"FALSE"===n.substring(v,o)?"n0":p,u=v,m=!0;else{for(v-=1;-1<v&&(this.parent.isUpperChar(n[v])||this.parent.isDigit(n[v])||"_"===n[v]);)v-=1;if(-1<v&&n[v]===this.sheetToken){for(v-=1;-1<v&&n[v]!==this.sheetToken;)v-=1;-1<v&&n[v]===this.sheetToken&&(v-=1)}if(-1<v&&":"===n[v]){for(v-=1;-1<v&&this.parent.isDigit(n[v]);)v-=1;for(;-1<v&&this.parent.isUpperChar(n[v]);)v-=1;if(-1<v&&n[v]===this.sheetToken){for(v--;-1<v&&n[v]!==this.sheetToken;)v--;-1<v&&n[v]===this.sheetToken&&v--}v+=1,p=this.parent.substring(n,v,o-v),p=this.parent.getCellFrom(p)}else{var A=!1;(A=0<v&&!this.parent.isUpperChar(n[v])?"u"===n[v]&&n[v-1]===this.parent.getParseArgumentSeparator():A)||(v+=1),p=this.parent.substring(n,v,o-v)}this.parent.updateDependentCell(p),u=v}(0<this.parent.namedRanges.size&&this.parent.namedRanges.has(p.toUpperCase())||this.parent.storedData.has(p.toUpperCase()))&&(p="n"+this.checkForNamedRangeAndKeyValue(p))}if(o===n.length-1)throw new Rhe(this.parent.formulaErrorStrings[vhe.ExpressionCannotEndWithAnOperator]);if((A="u"===n[v=o+1])&&(v+=1),n[v]===this.parent.tic[0]){if((w=n.substring(v+1).indexOf(this.parent.tic))<0)throw this.parent.formulaErrorStrings[vhe.CannotParse];c=this.parent.substring(n,v,w+2),g=w+v+2}else if(n[v]===this.parent.arithMarker){if((w=this.findRightMarker(n.substring(v+1)))<0)throw new Rhe(this.parent.formulaErrorStrings[vhe.CannotParse]);c=this.parent.substring(n,v+1,w),g=w+v+2}else if("q"===n[v]){for(b=0,w=v+1;w<n.length&&(n[w]!==this.parent.rightBracket||0!==b);)n[w]===this.parent.rightBracket?b++:"q"===n[w]&&b--,w++;if(w===n.length)throw this.parent.formulaErrorStrings[vhe.CannotParse];c=this.parent.substring(n,v,w-v+1),A&&(c="u"+c),g=w+1}else if(this.parent.isDigit(n[v])||n[v]===d){S=n[v]===d;for(v+=1;v<n.length&&(this.parent.isDigit(n[v])||!S&&n[v]===d);)n[v]===d&&(S=!0),v+=1;if(v<n.length&&"%"===n[v]&&(v+=1),S&&v<n.length&&n[v]===d)throw this.parent.formulaErrorStrings[vhe.NumberContains2DecimalPoints];c="n"+this.parent.substring(n,o+1,v-o-1),g=v}else if(this.parent.isUpperChar(n[v])||n[v]===this.sheetToken||"u"===n[v]){if(n[v]===this.sheetToken)for(v+=1;v<n.length&&n[v]!==this.sheetToken;)v+=1;v+=1;for(var x=0,I=!1;v<n.length&&(this.parent.isUpperChar(n[v])||"_"===n[v]||n[v]===d||"["===n[v]||"]"===n[v]||"#"===n[v]||" "===n[v]||"%"===n[v]||n[v]===d&&I);)v!==n.length-1&&"["===n[v]&&"["===n[v+1]&&(I=!0),v!==n.length-1&&"]"===n[v]&&"]"===n[v+1]&&(I=!1),v++,x++;var T=v===n.length||!this.parent.isDigit(n[v]);if(1<x){for(;v<n.length&&(this.parent.isUpperChar(n[v])||this.parent.isDigit(n[v])||" "===n[v]||"_"===n[v]);)v++;T=!0}for(;v<n.length&&this.parent.isDigit(n[v]);)v+=1;if(v<n.length&&":"===n[v]){if((v+=1)<n.length&&n[v]===this.sheetToken){for(v++;v<n.length&&n[v]!==this.sheetToken;)v+=1;v<n.length&&n[v]===this.sheetToken&&v++}for(;v<n.length&&this.parent.isUpperChar(n[v]);)v+=1;for(;v<n.length&&this.parent.isDigit(n[v]);)v+=1;v-=1,c=this.parent.substring(n,o+1,v-o),c=this.parent.getCellFrom(c)}else v-=1,c=this.parent.substring(n,o+1,v-o),(A="u"===n[v])&&(c="u"+c);(T=T&&c.startsWith(this.sheetToken)?!this.parent.isCellReference(c):T)||this.parent.updateDependentCell(c),(0<this.parent.namedRanges.size&&this.parent.namedRanges.has(c.toUpperCase())||this.parent.storedData.has(c.toUpperCase()))&&(c="n"+this.checkForNamedRangeAndKeyValue(c));var E=-1<["*","+","-","/","w"].indexOf(n[v-c.length]),c="TRUE"===c&&(m||E)?"n1":"FALSE"===c&&(m||E)?"n0":c,g=v+1}var D=r.indexOf(n[o]),M=this.parent.arithMarker+p+c+t[D]+this.parent.arithMarker;0<u&&(M=n.substring(0,u)+M),g<n.length&&(M+=n.substring(g)),n=M=M.split(this.parent.arithMarker2).join(this.parent.arithMarker.toString()),o=this.indexOfAny(n,i)}}else if(0<n.length&&(this.parent.isUpperChar(n[0])||n[0]===this.sheetToken)){for(var k=!0,P=!0,B=!1,F=n.length,w=0;w<F;++w)if(n[w]===this.sheetToken){if(0<w&&!B)throw this.parent.getErrorStrings()[yhe.Ref];for(B=!0,w++;w<F&&this.parent.isDigit(n[w]);)w++;if(w===F||n[w]!==this.sheetToken){k=!1;break}}else{if(!P&&this.parent.isChar(n[w])){k=!1;break}if(!this.parent.isChar(n[w])&&!this.parent.isDigit(n[w])&&n[w]!==this.sheetToken){k=!1;break}P=this.parent.isUpperChar(n[w])}k&&this.parent.updateDependentCell(n)}return n}catch(e){if(e===this.parent.formulaErrorStrings[vhe.CircularReference])throw e;return e}},Mhe.prototype.indexOfAny=function(e,t){for(var i=0;i<e.length;i++)if(-1<t.indexOf(e[i]))return i;return-1},Mhe.prototype.findLeftMarker=function(e){var t=-1;if(-1<e.indexOf(this.parent.arithMarker))for(var i=0,n=e.length-1;0<=n;--n)if(e[n]===this.parent.rightBracket)i--;else if(e[n]===this.parent.leftBracket)i++;else if(e[n]===this.parent.arithMarker&&0===i){t=n;break}return t},Mhe.prototype.findRightMarker=function(e){var t=-1;if(-1<e.indexOf(this.parent.arithMarker))for(var i=0,n=0;n<e.length;++n)if(e[n]===this.parent.rightBracket)i--;else if(e[n]===this.parent.leftBracket)i++;else if(e[n]===this.parent.arithMarker&&0===i){t=n;break}return t},Mhe.prototype.parseFormula=function(t,i){if(-1<(t=0<t.length&&t[0]===this.parent.getFormulaCharacter()?t.substring(1):t).indexOf("#REF!"))return this.parent.getErrorStrings()[yhe.Ref];0<t.length&&"+"===t[0]&&(t=t.substring(1));try{this.isFailureTriggered=!1,this.isError=!1,t=this.parse(t.trim(),i),this.isFormulaParsed=!0}catch(e){i=this.exceptionArgs(e),i=(this.isFailureTriggered||(this.parent.trigger("onFailure",i),this.isFailureTriggered=!0),"string"==typeof i.exception?i.exception:i.message);t=(je(this.parent.getErrorLine(e))?"":"#"+this.parent.getErrorLine(e)+": ")+i,this.isError=!0}return t},Mhe.prototype.markLibraryFormulas=function(e){var t=0,i=e.indexOf(")");if(-1===i)e=this.markNamedRanges(e);else for(;-1<i;){for(var n=0,o=i-1;-1<o&&("("!==e[o]||0!==n);)")"===e[o]&&n++,o--;if(-1===o)throw new Rhe(this.parent.formulaErrorStrings[vhe.MismatchedParentheses]);for(var r=o-1;-1<r&&this.parent.isChar(e[r]);)r--;var s=o-r-1,a=this.parent.substring(e,r+1,s);if(0<s&&!je(this.parent.getFunction(a))){var l=this.parent.substring(e,o,i-o+1),h=this.parent.getParseArgumentSeparator();"AREAS"===a?this.ignoreBracet=!0:(this.ignoreBracet=!1,a.includes("IFS")&&"COUNTIFS"!==a&&l.includes("{")&&(a=l.indexOf("{"),a=this.parent.substring(l,a,l.indexOf("}")-a+1),l=l.split(a).join(a.split(h).join(this.parent.tic+this.parent.tic))));try{var d=void 0;l=l.split("(").join("").split(")").join(""),l="("+this.formulaAutoCorrection(l,d)+")"}catch(e){if(!(d={message:e.message,exception:e,isForceCalculable:e.formulaCorrection,computeForceCalculate:!1}).isForceCalculable)throw this.parent.formulaErrorStrings[vhe.ImproperFormula];if(this.isFailureTriggered||(this.parent.trigger("onFailure",d),this.isFailureTriggered=!0,t+=1),d.computeForceCalculate=0<t||d.computeForceCalculate,!d.isForceCalculable)throw this.parent.formulaErrorStrings[vhe.ImproperFormula];if(!d.computeForceCalculate)throw this.parent.formulaErrorStrings[vhe.ImproperFormula];l=l.split("(").join("").split(")").join(""),l="("+this.formulaAutoCorrection(l,d)+")"}l=this.markNamedRanges(l),l=this.swapInnerParens(l),-1===(l=this.addParensToArgs(l)).lastIndexOf(h)&&2<l.length&&"("===l[0]&&")"===l[l.length-1]&&"{"!==l[1]&&"("!==l[1]&&(l=(l=l.substring(0,l.length-1)+"}"+l.substring(l.length-1))[0]+"{"+l.substring(1)),e=e.substring(0,r+1)+"q"+this.parent.substring(e,r+1,s)+l.split("(").join(this.parent.leftBracket).split(")").join(this.parent.rightBracket)+e.substring(i+1)}else{if(0<s)return this.parent.getErrorStrings()[yhe.Name];a=this.emptyStr,a=(a=0<o?e.substring(0,o):a)+"{"+this.parent.substring(e,o+1,i-o-1)+"}";i<e.length&&(a+=e.substring(i+1)),e=a=this.markNamedRanges(a)}i=e.indexOf(")")}return e=e.split("{").join("(").split("}").join(")")},Mhe.prototype.swapInnerParens=function(e){return e=2<e.length?e[0]+e.substr(1,e.length-2).split("(").join("{").split(")").join("}")+e[e.length-1]:e},Mhe.prototype.addParensToArgs=function(e){if(0===e.length)return this.emptyStr;var t=[],i=(t.push(this.parent.getParseArgumentSeparator()),t.push(this.parent.rightBracket),e.lastIndexOf(this.parent.getParseArgumentSeparator())),n=0;if(-1===i)2<e.length&&"("===e[0]&&")"===e[e.length-1]&&("{"!==e[1]&&"("!==e[1]?e=(e=e.substring(0,e.length-1)+"}"+e.substring(e.length-1))[0]+"{"+e.substring(1):(i=this.lastIndexOfAny(e,["+","-","*","/"]),0<(n=0===n&&")"===e[e.length-1]?e.length-1:n)&&"{"!==e[i+1]&&"}"===e[i-1]&&(e=(e=e.substr(0,n)+"}"+e.substr(n)).substr(0,i+1)+"{"+e.substr(i+1))));else for(var o=!0;-1<i;){var r=this.indexOfAny(e.substring(i+1,e.length),t);0<=r?r=i+r+1:-1===r&&")"===e[e.length-1]&&(r=e.length-1),i=(e=0<r&&"{"!==e[i+1]&&"}"!==e[r-1]&&"¢"!==e[r-1]?(e=e.substr(0,r).trim()+"}"+e.substr(r)).substr(0,i+1)+"{"+e.substr(i+1).trim():e).substr(0,i).lastIndexOf(this.parent.getParseArgumentSeparator()),o&&-1===i&&"("===e[0]&&(i=0,o=!1)}return e=e.split("{}").join(this.emptyStr)},Mhe.prototype.lastIndexOfAny=function(e,t){for(var i=e.length-1;-1<i;i--)if(-1<t.indexOf(e[i]))return i;return-1},Mhe.prototype.markNamedRanges=function(e){for(var t=[")",this.parent.getParseArgumentSeparator(),"}","+","-","*","/","<",">","=","&",":"],i=0<e.length&&("("===e[0]||"{"===e[0])?1:0,n=(-1<(e=-1<e.indexOf("#N/A")?e.split("#N/A").join("#N~A"):e).indexOf("#DIV/0!")&&(e=e.split("#DIV/0!").join("#DIV~0!")),this.indexOfAny(e.substring(i),t));-1<n&&n+i<e.length;){var o=this.emptyStr,r=null;if(-1<this.parent.substring(e,i,n).indexOf("[")?r=this.getTableRange(this.parent.substring(e,i,n)):(this.parent.storedData.has(this.parent.substring(e,i,n))||this.parent.namedRanges.has(this.parent.substring(e,i,n)))&&(r=this.checkForNamedRangeAndKeyValue(this.parent.substring(e,i,n))),je(r)&&("NaN"!==(o=this.checkScopedRange(this.parent.substring(e,i,n)))?(this.findNamedRange=!0,r=o):this.parent.substring(e,i,n).startsWith(this.sheetToken.toString()),!je(r))&&this.findNamedRange&&-1<r.indexOf(this.fixedReference)&&(r=r.split(this.fixedReference).join(this.emptyStr)),je(r)||(r=r.toUpperCase(),r=this.parent.setTokensForSheets(r),r=this.markLibraryFormulas(r)),je(r)||r===this.emptyStr)for(i+=n+1;i<e.length&&!this.parent.isUpperChar(e[i])&&e[i]!==this.sheetToken;)i++;else e=e.substring(0,i)+r+e.substring(i+n),i+=r.length+1;for((n=i)<e.length-1&&"{"===e[i]&&(i+=1),n=this.indexOfAny(e.substring(i),t);0===n&&i<e.length-1;)i++,n=this.indexOfAny(e.substring(i),t);(-1===n||-1<e.substring(i).indexOf("["))&&i<e.length&&(je(r=-1<e.substring(i).indexOf("[")?this.getTableRange(e.substring(i)):this.parent.storedData.has(e.substring(i))?0<this.parent.storedData.size?this.checkForNamedRangeAndKeyValue(e.substring(i)):r:0<this.parent.namedRanges.size?this.checkForNamedRangeAndKeyValue(e.substring(i)):r)&&"NaN"!==(o=this.checkScopedRange(e.substring(i)))&&(r=o),je(r)||r===this.emptyStr||(r=r.toUpperCase(),r=this.parent.setTokensForSheets(r),null!=(r=this.markLibraryFormulas(r))&&(e=")"===(o=e.substring(i))[o.length-1]?e.substring(0,i)+r+")":e.substring(0,i)+r,i+=r.toString().length+1)),n=i<e.length?this.indexOfAny(e.substring(i),t):-1)}return e=-1<(e=-1<e.indexOf("#N~A")?e.split("#N~A").join("#N/A"):e).indexOf("#DIV~0!")?e.split("#DIV~0!").join("#DIV/0!"):e},Mhe.prototype.checkForNamedRangeAndKeyValue=function(e){var t,i;this.emptyStr;return-1<e.indexOf("[")&&(je(t=this.getTableRange(e))||(this.findNamedRange=!0,e=t)),"NaN"!==(t=this.checkScopedRange(e))?(this.findNamedRange=!0,e=t):(-1<e.indexOf(this.sheetToken)&&(t=this.parent.getSheetFamilyItem(this.parent.grid),i=(i=e.split('"').join(this.emptyStr)).substr(0,i.indexOf(this.sheetToken)),t.sheetNameToToken.has(i.toUpperCase()))&&parseInt(t.sheetNameToToken.get(i.toUpperCase()).split(this.sheetToken).join(this.emptyStr)),0<this.parent.storedData.size&&this.parent.storedData.has(e)&&(e="A"+this.parent.colIndex(e)),0<this.parent.namedRanges.size&&this.parent.namedRanges.has(e.toUpperCase())&&(je(this.parent.parentObject)?(e=this.parse(this.parent.namedRanges.get(e.toUpperCase())),-1<(e=this.parent.setTokensForSheets(e)).indexOf(this.fixedReference)&&e.split(this.fixedReference).join(this.emptyStr),this.findNamedRange=!0):e=this.parse(this.parent.namedRanges.get(e.toUpperCase()))),this.findNamedRange&&"!"!==e[0]&&"q"!==e[0]&&"bq"!==e[0]&&-1<(e=this.parent.setTokensForSheets(e)).indexOf(this.fixedReference)&&(e=e.split(this.fixedReference).join(this.emptyStr))),e},Mhe.prototype.getTableRange=function(e){e=(e=e.replace(" ",this.emptyStr).toUpperCase()).replace("]",this.emptyStr).replace("#DATA",this.emptyStr);-1<e.indexOf(this.parent.getParseArgumentSeparator())&&(e.substring(0,e.indexOf(this.parent.getParseArgumentSeparator())).replace("[",this.emptyStr),e=e.replace("[",this.emptyStr).replace(this.parent.getParseArgumentSeparator(),"_")),this.emptyStr;return e.toUpperCase()},Mhe.prototype.findNextEndIndex=function(e,t){for(var i=0,n=t,o=!1;!o&&t<e.length;)"["===e[n]?i++:"]"===e[n]&&0===--i&&(o=!0),t++;return t-=n};var Dhe=Mhe;function Mhe(e){this.emptyStr="",this.storedStringText=this.emptyStr,this.sheetToken="!",this.tokenAdd="a",this.tokenSubtract="s",this.tokenMultiply="m",this.tokenDivide="d",this.tokenLess="l",this.charEm="r",this.charEp="x",this.tokenGreater="g",this.tokenEqual="e",this.tokenLessEq="k",this.tokenGreaterEq="j",this.tokenNotEqual="o",this.tokenAnd="c",this.tokenEm="v",this.tokenEp="t",this.tokenOr=String.fromCharCode(126),this.charAnd="i",this.charLess="<",this.charGreater=">",this.charEqual="=",this.charLessEq="f",this.charGreaterEq="h",this.charNoEqual="z",this.stringGreaterEq=">=",this.stringLessEq="<=",this.stringNoEqual="<>",this.stringAnd="&",this.stringOr="^",this.charOr="w",this.charAdd="+",this.charSubtract="-",this.charMultiply="*",this.charDivide="/",this.fixedReference="$",this.spaceString=" ",this.ignoreBracet=!1,this.isError=!1,this.isFormulaParsed=!1,this.findNamedRange=!1,this.stringsColl=new Map,this.tokens=[this.tokenAdd,this.tokenSubtract,this.tokenMultiply,this.tokenDivide,this.tokenLess,this.tokenGreater,this.tokenEqual,this.tokenLessEq,this.tokenGreaterEq,this.tokenNotEqual,this.tokenAnd,this.tokenOr],this.charNOTop=String.fromCharCode(167),this.specialSym=["~","@","#","?"],this.isFailureTriggered=!1,this.parent=e}khe=function(e,t){return(khe=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])}))(e,t)};var khe,Phe,yJ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Bhe=1048576,Fhe=(function(e,t){function i(){this.constructor=e}khe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Lhe,Phe=Ct),Object.defineProperty(Lhe.prototype,"libraryFormulas",{get:function(){return this.lFormulas},set:function(e){this.lFormulas.set(e.fName,{handler:e.handler,category:e.category,description:e.description})},enumerable:!0,configurable:!0}),Lhe.prototype.getParseArgumentSeparator=function(){return this.isArgumentSeparatorChanged||","===this.parseArgumentSeparator||(this.parseArgumentSeparator=","),this.parseArgumentSeparator},Lhe.prototype.setParseArgumentSeparator=function(e){this.parseArgumentSeparator=e,this.isArgumentSeparatorChanged=!0},Lhe.prototype.getParseDateTimeSeparator=function(){return this.parseDateTimeSeparator},Lhe.prototype.setTreatEmptyStringAsZero=function(e){this.treatEmptyStringAsZero=e},Lhe.prototype.getTreatEmptyStringAsZero=function(){return this.treatEmptyStringAsZero},Lhe.prototype.setParseDateTimeSeparator=function(e){this.parseDateTimeSeparator=e},Lhe.prototype.onPropertyChanged=function(e,t){},Lhe.prototype.getModuleName=function(){return"calculate"},Lhe.prototype.getFormulaCharacter=function(){return"="},Lhe.prototype.isUpperChar=function(e){e=e.charCodeAt(0);return 64<e&&e<91},Lhe.prototype.resetKeys=function(){this.storedData.clear(),this.keyToRowsMap.clear(),this.rowsToKeyMap.clear()},Lhe.prototype.updateDependentCell=function(e){var t,i,n,o,r=this,s=this.cell;s!==this.emptyString&&((t=this.getSheetFamilyItem(this.grid)).sheetNameToParentObject&&(s.includes(this.sheetToken)||(s=t.parentObjectToToken.get(this.grid)+s),e.includes(this.sheetToken)||(e=t.parentObjectToToken.get(this.grid)+e)),s!==e)&&((t=this.getDependentCells()).has(e)||t.set(e,[]),-1===(t=t.get(e)).indexOf(s))&&(i=this.getDependentFormulaCells(),n={},(o=function(e){if(i.has(e)){var t=i.get(e);if(t.has(s))throw r.formulaErrorStrings[vhe.CircularReference];n[e]||(n[e]=!0,t.forEach(function(e){o(e)}))}})(e),t.push(s),i.has(s)?i.get(s).has(e)||i.get(s).set(e,e):(i.set(s,new Map),i.get(s).set(e,e)))},Lhe.prototype.getDependentCells=function(){return null==this.dependentCells&&(this.dependentCells=new Map),this.dependentCells},Lhe.prototype.getDependentFormulaCells=function(){var e;return this.isSheetMember()?(null==(e=this.getSheetFamilyItem(this.grid)).sheetDependentFormulaCells&&(e.sheetDependentFormulaCells=new Map),e.sheetDependentFormulaCells):(null==this.dependentFormulaCells&&(this.dependentFormulaCells=new Map),this.dependentFormulaCells)},Lhe.prototype.getLibraryFormulas=function(){return this.lFormulas},Lhe.prototype.getFunction=function(e){return this.getLibraryFormulas().has(e.toUpperCase())?this.getLibraryFormulas().get(e.toUpperCase()).handler:null},Lhe.prototype.intToDate=function(e){var e=Number(e),t=(60<(e=0<e&&e<1?1+e:0===e?1:e)&&--e,new Date("01/01/1900")),t=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return new Date(new Date(864e5*(e-1)+t).toUTCString().replace(" GMT",""))},Lhe.prototype.getFormulaInfoTable=function(){var e;return this.isSheetMember()?(null===(e=this.getSheetFamilyItem(this.grid)).sheetFormulaInfotable&&(e.sheetFormulaInfotable=new Map),e.sheetFormulaInfotable):(null===this.formulaInfoTable&&(this.formulaInfoTable=new Map),this.formulaInfoTable)},Lhe.prototype.getParseDecimalSeparator=function(){return this.isParseDecimalSeparatorChanged||"."===this.parseDecimalSeparator||(this.parseDecimalSeparator="."),this.parseDecimalSeparator},Lhe.prototype.setParseDecimalSeparator=function(e){this.parseDecimalSeparator=e,this.isParseDecimalSeparatorChanged=!0},Lhe.prototype.getSheetToken=function(e){var t=0,i=this.emptyString;if(t<e.length&&e[t]===this.sheetToken){for(t++;t<e.length&&e[t]!==this.sheetToken;)t++;i=e.substring(0,t+1)}if(t<e.length)return i;throw this.formulaErrorStrings[vhe.BadIndex]},Lhe.prototype.getSheetID=function(e){var t=this.getSheetFamilyItem(e);if(null!=t.sheetNameToParentObject&&0<t.sheetNameToParentObject.size&&(t=t.parentObjectToToken.get(e))){t=t.split(this.sheetToken).join(this.emptyString),e=this.parseFloat(t);if(!this.isNaN(e))return e}return-1},Lhe.prototype.parseFloat=function(e){var t=Number(e);return t=isNaN(t)&&"string"==typeof e&&e.includes(",")?Number(e.split(",").join("")):t},Lhe.prototype.rowIndex=function(e){var t=0,i=!1;if(t<e.length&&e[t]===this.sheetToken){for(t++;t<e.length&&e[t]!==this.sheetToken;)t++;t++}for(;t<e.length&&this.isChar(e[t]);)i=!0,t++;var n=parseInt(e.substring(t),10);if(t<e.length&&!this.isNaN(n))return n;if(i)return-1;throw this.formulaErrorStrings[vhe.BadIndex]},Lhe.prototype.colIndex=function(e){var t=0,i=0;if(t<(e=e.toUpperCase()).length&&e[t]===this.sheetToken){for(t++;t<e.length&&e[t]!==this.sheetToken;)t++;t++}for(;t<e.length&&this.isChar(e[t]);){i=26*i+e[t].charCodeAt(0)-64;t++}return 0===i?-1:i},Lhe.prototype.getErrorStrings=function(){return null===this.errorStrings&&(this.errorStrings=["#N/A","#VALUE!","#REF!","#DIV/0!","#NUM!","#NAME?","#NULL!","#CALC!"]),this.errorStrings},Lhe.prototype.substring=function(e,t,i){return e.substring(t,i+t)},Lhe.prototype.isChar=function(e){return 65<=e.charCodeAt(0)&&e.charCodeAt(0)<=90||97<=e.charCodeAt(0)&&e.charCodeAt(0)<=122},Lhe.prototype.getSheetFamilyItem=function(e,t){return 0===this.sheetFamilyID?(null==this.defaultFamilyItem&&(this.defaultFamilyItem=new Vhe),this.defaultFamilyItem):(null==this.sheetFamiliesList&&(this.sheetFamiliesList=new Map),void 0===t&&(t=this.modelToSheetID.get(e)),this.sheetFamiliesList.has(t)||this.sheetFamiliesList.set(t,new Vhe),this.sheetFamiliesList.get(t))},Lhe.prototype.setKeyValue=function(e,t){e=e.toUpperCase();var t=t.toString().trim(),i=(this.storedData.get(e)&&0!==t.indexOf(this.leftBrace)||(this.storedData.set(e,new Ohe),this.keyToRowsMap.set(e,this.keyToRowsMap.size+1),this.rowsToKeyMap.set(this.rowsToKeyMap.size+1,e)),this.storedData.get(e));null!=i.getFormulaText()&&0<i.getFormulaText().length&&i.getFormulaText()!==t&&(e=this.cellPrefix+this.keyToRowsMap.get(e).toString(),null!=this.getDependentFormulaCells().get(e))&&this.clearFormulaDependentCells(e),0<t.length&&t[0]===this.getFormulaCharacter()?i.setFormulaText(t):i.getFormulaValue()!==t&&(i.setFormulaText(""),i.setParsedFormula(""),i.setFormulaValue(t))},Lhe.prototype.clearFormulaDependentCells=function(n){var o=this,e=this.getDependentFormulaCells().get(n);e&&(e.forEach(function(e,t){var i=o.getDependentCells().get(t);o.arrayRemove(i,n),0===i.length&&o.getDependentCells().delete(t)}),this.getDependentFormulaCells().delete(n))},Lhe.prototype.arrayRemove=function(e,t){t=e.indexOf(t);return-1!==t&&e.splice(t,1),e},Lhe.prototype.getKeyValue=function(t){if(t=t.toUpperCase(),null===this.storedData.has(t))return this.emptyString;var i=this.storedData.get(t),n=i.getFormulaText();if(0<n.length&&n[0]===this.getFormulaCharacter()){this.cell=this.cellPrefix+this.keyToRowsMap.get(t).toString(),n=n.substring(1);try{i.setParsedFormula(this.parser.parseFormula(n,t))}catch(e){var o={message:e.message,exception:e,isForceCalculable:!1,computeForceCalculate:!1};return this.trigger("onFailure",o),i.setFormulaValue(o.message),this.storedData.get(t).getFormulaValue()}try{i.setFormulaValue(this.computeFormula(i.getParsedFormula()))}catch(e){o={message:e.message,exception:e,isForceCalculable:!1,computeForceCalculate:!1},n=(this.trigger("onFailure",o),"string"==typeof o.exception?o.exception:o.message);return(je(this.getErrorLine(e))?"":"#"+this.getErrorLine(e)+": ")+n}}return this.storedData.get(t).getFormulaValue()},Lhe.prototype.getNamedRanges=function(){return this.namedRanges},Lhe.prototype.addNamedRange=function(e,t){var i=e.split(this.sheetToken);if(1<i.length){var n=this.getSheetId(this.grid).toString();if(!this.getSheetFamilyItem(n).parentObjectToToken.get(n))return!1;e=i[0]+this.sheetToken+i[1].toUpperCase()}else e=e.toUpperCase();return this.namedRanges.set(e,t),!0},Lhe.prototype.updateNamedRange=function(n,o){var r=new Map;this.namedRanges.forEach(function(e,t){var i=t;t.includes(n)&&((t=t.split("!"))[0]=o,i=t.join("!")),r.set(i,e)}),this.namedRanges=r},Lhe.prototype.removeNamedRange=function(e){return e=e.toUpperCase(),null!=this.namedRanges.get(e)&&(this.namedRanges.delete(e),!0)},Lhe.prototype.convertAlpha=function(e){for(var t=[],i=0;0<e;){e--;var n="A".charCodeAt(0);t[i]=String.fromCharCode(e%26+n),e=parseInt((e/26).toString(),10),i++}for(var o=[],r=0;r<i;r++)o[i-r-1]=t[r];return o.join("")},Lhe.prototype.getCellCollection=function(e){if(e.indexOf(":")<0){if(!this.isCellReference(e))return e.split(this.getParseArgumentSeparator());e=e+":"+e}var t,i,n,o=this.emptyString,r=e.indexOf(this.sheetToken);if(-1<r)for(var s=r+1;s<e.length;){if(e[s]===this.sheetToken){o=e.substr(0,s+1);break}s++}if(0<(p=e.indexOf(":"))&&this.isChar(e[p-1]))for(var a=p-2;0<=a&&this.isDigit(e[a]);)a--;if(r=this.rowIndex(this.substring(e,0,p)),t=this.rowIndex(this.substring(e,p+1,p+e.length-p-1)),i=this.colIndex(this.substring(e,0,p)),n=this.colIndex(this.substring(e,p+1,p+e.length-p-1)),Bhe<=r||Bhe<=t||16384<=i||16384<=n)return[this.getErrorStrings()[yhe.Ref]];t<r&&(p=t,t=r,r=p),n<i&&(p=n,n=i,i=p);for(var l,h=[],d=0,p=r;p<=t;p++)for(l=i;l<=n;l++)h[d]=o+this.emptyString+this.convertAlpha(l)+p.toString(),d++;return h},Lhe.prototype.computeFormula=function(e,t){return this.calculateFormula(e,!1,t)},Lhe.prototype.calculateFormula=function(t,c,u){var g,m,f,y=this,v=!1;if(this.parser.isError)return t;g=this.parser.isFormulaParsed?t:this.parser.parseFormula(t),this.parser.isFormulaParsed=!1;try{if(0<(m=this.findLastIndexOfq(g))&&(v=!0),g!==this.emptyString&&-1<m){for(var b=m+1,w=this;-1<b;)if("break"===function(){if(g[b]!==w.rightBracket)return b++,"continue";var e=g.substring(m,b+1),t=e.split(w.leftBracket)[0].split("q").join(w.emptyString),i=void 0;if(w.getLibraryFormulas().get(t.toUpperCase()).isCustom){for(var i=e.substring(e.indexOf(w.leftBracket)+1,e.indexOf(w.rightBracket)).split(w.getParseArgumentSeparator()),n=0,o=[],r=void 0,n=0;n<i.length;n++)i[n].includes(":")&&w.isCellReference(i[n])&&1<(r=w.getCellCollection(i[n])).length?(o.push(i[n]),r.forEach(function(e){y.updateDependentCell(e)})):o.push(w.getValueFromArg(i[n]));i=o}else{for(var s=e.substring(e.indexOf(w.leftBracket)+1,e.indexOf(w.rightBracket)),a=(i=[],w.getParseArgumentSeparator()),l="",h=void 0,d=0,p=s.length-1;d<=p;d++)'"'===s[d]&&(h=!h),s[d]!==a||h?l+=s[d]:(i.push(l),l=""),d===p&&i.push(l);i.length||(i=[""]),v&&t&&(["IF","INDEX","SORT","T","EXACT","PROPER","DOLLAR","DATE","TEXT"].some(function(e){return e===t})&&i.push("nestedFormulaTrue"),"IF"===t)&&i.push("nestedFormulaTrue"),u&&"UNIQUE"===t&&i.push("isComputeExp")}return C=je(w.getFunction(t))?w.getErrorStrings()[yhe.Name]:w.getFunction(t).apply(void 0,i),v?(f=w.processNestedFormula(g,e,C),0===(e=w.findLastIndexOfq(f))&&(v=!1),-1===e&&(C=w.computeValue(f,c)),m=b=e,g=f,"continue"):"break"}())break}else-1<this.formulaErrorStrings.indexOf(g)?C=g:g!==this.emptyString&&-1===m&&(C=this.computeValue(g,c))}catch(e){var t={message:e.message,exception:e,isForceCalculable:!1,computeForceCalculate:!1},t=(this.trigger("onFailure",t),"string"==typeof t.exception?t.exception:t.message),C=(je(this.getErrorLine(e))?"":"#"+this.getErrorLine(e)+": ")+t}return C},Lhe.prototype.computeSumIfAndAvgIf=function(e,t){if(je(e)||e[0]===this.emptyString||0===e.length)return this.formulaErrorStrings[vhe.WrongNumberArguments];for(var i,n=e,o=0;o<n.length;o++)this.isCellReference(n[o])&&je(n[o].match(/[0-9]/))&&n[o].indexOf("!")<0&&(i=n[o].split(":"),n[o]=i[0]+"1:"+i[1]+this.spreadSheetUsedRange[0]);e=n.length;if(2!==e&&3!==e&&0===e)return this.formulaErrorStrings[vhe.WrongNumberArguments];if(""===n[1])return t?this.getErrorStrings()[yhe.DivZero]:"0";var t=n[0],r=n[1].startsWith(this.tic)&&n[1].endsWith(this.tic),s=n[1].split(this.tic).join(this.emptyString);if(255<s.length)return this.getErrorStrings()[yhe.Value];var a=s.includes("*"),l=s.includes("?"),h=a?s.replace(/\*/g,"").trim():s,d=!1,p=(!r&&this.isCellReference(h)&&(h=this.getValueFromArg(h),d=!0),s=h=a&&(p=s.indexOf("*"),"*"===s[0]&&(h="*"+h),"*"===s[s.length-1]&&(h+="*"),0<p)&&p<s.length-1?s.substring(0,p)+"*"+s.substring(p+1):h,this.parser.tokenEqual),h=(s.startsWith("<=")?(p=this.parser.tokenLessEq,s=s.substring(2)):s.startsWith(">=")?(p=this.parser.tokenGreaterEq,s=s.substring(2)):s.startsWith("<>")?(p=this.parser.tokenNotEqual,s=s.substring(2)):s.startsWith("<")?(p=this.parser.tokenLess,s=s.substring(1)):s.startsWith(">")?(p=this.parser.tokenGreater,s=s.substring(1)):s.startsWith("=")&&(p=this.parser.tokenEqual,s=s.substring(1)),(!r&&this.isCellReference(s)&&!d||s.includes(this.arithMarker)||s.includes(this.getParseDecimalSeparator())&&!a&&!l)&&(s=this.getValueFromArg(s)),this.parseFloat(s)),r=n[0],d=this.getCellCollection(2<e?n[2]:t),e=this.getCellCollection(r);if("#REF!"===d[0]||"#REF!"===e[0])return this.getErrorStrings()[yhe.Name];if(e.length>d.length){t=this.colIndex(d[d.length-1])+this.colIndex(e[e.length-1])-this.colIndex(e[0]),r=n[2].split(":");if(r[1]=(this.convertAlpha(t)+this.rowIndex(e[e.length-1])).toString(),"#REF!"===(d=this.getCellCollection(r.join(":")))[0])return this.getErrorStrings()[yhe.Name]}t=this.getComputeSumIfValue(e,d,s.toLowerCase(),h,p,a,l);return[t[0],t[1]]},Lhe.prototype.computeLookup=function(e){var t,i,n,o=[],r=[],s=[],a=[],l=[],h=e.length;if(1===h||3<h)return this.formulaErrorStrings[vhe.WrongNumberArguments];if(""===e[1]||""===e[2])return this.getErrorStrings()[yhe.Value];if(n=this.getValueFromArg(e[0]),-1<e[0].indexOf(this.tic)&&e[0].toUpperCase().split(this.tic).join("")!==this.trueValue&&e[0].toUpperCase().split(this.tic).join("")!==this.falseValue&&this.isNaN(this.parseFloat(e[0].split(this.tic).join("")))&&(n=n.split(this.tic).join("")),-1<this.getErrorStrings().indexOf(n))return n;var d=e[1].split(":");if(2===d.length&&this.isCellReference(d[0])&&this.isCellReference(d[1])&&2===h&&(I=e[1].indexOf(":"),d=this.rowIndex(this.substring(e[1],0,I)),y=this.colIndex(this.substring(e[1],0,I)),g=this.rowIndex(this.substring(e[1],I+1,I+e[1].length-I-1)),v=this.colIndex(this.substring(e[1],I+1,I+e[1].length-I-1)),g<d&&(d=(u=[g,d])[0],g=u[1]),v<y&&(y=(u=[v,y])[0],v=u[1]),u="",0===e[1].indexOf("!")&&(u=(u=(u=e[1]).replace("!","")).indexOf("!"),u=e[1].substring(0,u+2)),(c=v-y+1)<(p=g-d+1)||p==c?(t=u+_he(y)+d+":"+_he(y)+g,i=u+_he(v)+d+":"+_he(v)+g):p<c&&(t=u+_he(y)+d+":"+_he(v)+d,i=u+_he(y)+g+":"+_he(v)+g),d===g&&y===v||(x=!0)),x){if(o=this.getCellCollection(t),r=this.getCellCollection(i),"#REF!"===o[0]||"#REF!"===r[0])return this.getErrorStrings()[yhe.Name]}else{var o=this.getCellCollection(e[1]),p=2===h?e[1]:e[2],r=this.getCellCollection(p);if("#REF!"===o[0]||"#REF!"===r[0])return this.getErrorStrings()[yhe.Name];var c=rte(e[1]),u=rte(p),d=c[1]===c[3]||c[0]===c[2],g=u[1]===u[3]||u[0]===u[2];if(!d||!g)return this.getErrorStrings()[yhe.NA]}for(var m=0;m<o.length;m++)a.push(this.getValueFromArg(o[m]).split(this.tic).join(""));var f=a.map(function(e){return""===e?NaN:Number(e)}).sort(function(e,t){return e-t}),y=f[f.length-1],v=f[0],b=this.parseFloat(n);if(this.isNaN(b))for(var w,C,S=0;S<o.length;S++)s[S]=this.getValueFromArg(o[S]).split(this.tic).join(""),je(r[S])||""===n||""===s[S]||(n.toUpperCase()===s[S].toUpperCase()||(-1<n.indexOf("*")||-1<n.indexOf("?"))&&(-1<(C=n).indexOf("*")&&(C=C.replace(/\*/g,"").trim(),this.isCellReference(C)&&(C=this.getValueFromArg(C)),w=n.indexOf("*"),"*"===n[0]&&(C="*"+C),"*"===n[n.length-1]&&(C+="*"),0<w)&&w<n.length-1&&(C=n.substring(0,w)+"*"+n.substring(w+1)),w=[],C=this.findWildCardValue(C.toLowerCase(),s[S].toLowerCase()),w.push(C),w.push(n),this.processLogical(w,"equal")===this.trueValue))&&l.push(this.getValueFromArg(r[S]).split(this.tic).join("")||"0");else for(var A=0;A<f.length;A++)s[A]=f[A].toString().split(this.tic).join(""),je(r[A])||""===s[A]||b!==this.parseFloat(s[A])||l.push(this.getValueFromArg(r[A]).split(this.tic).join("")||"0");if(0<l.length)return l[l.length-1];if(y<b&&!je(r[o.length-1]))return this.getValueFromArg(r[o.length-1]).split(this.tic).join("")||"0";if(!(b<v)&&a.indexOf(n.split(this.tic).join(""))<0&&n!==this.trueValue&&n!==this.falseValue)if(this.isNaN(b)||this.isNaN(y)||this.isNaN(v)){if(this.isNaN(b)&&""!==n&&/^[a-zA-Z!@#$%^&*()_+{}[\]:;<>,.?~\\/-]/.test(n)){var x=a.sort();if(!je(r[I=this.findClosestMatch(n.split(this.tic).join(""),x)])&&0<=I)return this.getValueFromArg(r[I]).split(this.tic).join("")||"0"}}else{for(var I,T=[],E=0;E<f.length;E++)b>f[E]&&T.push(f[E]);if(!je(r[I=T.length-1])&&0<=I)return this.getValueFromArg(r[I]).split(this.tic).join("")||"0"}return this.getErrorStrings()[yhe.NA]},Lhe.prototype.computeVHLookup=function(e,t){var i=this;if(je(e)||e.length<3||4<e.length)return this.formulaErrorStrings[vhe.WrongNumberArguments];if(""===e[1])return this.getErrorStrings()[yhe.NA];var n=this.getValueFromArg(e[0]),o=(n?n.includes(this.tic)&&(s=n.split(this.tic).join(""))&&!this.isNumber(s)&&(o=s.toUpperCase())!==this.trueValue&&o!==this.falseValue&&(n=s):n="0",this.getErrorStrings());if(-1<o.indexOf(n))return n;var r,s=(this.getValueFromArg(e[2])||"0").split(this.tic).join("").toUpperCase(),s=this.parseFloat(s===this.trueValue?"1":s);if(s<1)return o[yhe.Value];if(e[3]){if(e[3]=this.getValueFromArg(e[3]).split(this.tic).join(""),-1<o.indexOf(e[3]))return e[3];var a=e[3].toUpperCase();if(a===this.falseValue||"0"===e[3])r=!0;else if(a!==this.trueValue&&"1"!==e[3])return o[yhe.Value]}a=e[1].split(":");if(!this.isCellReference(a[0])||!this.isCellReference(a[1]))return o[yhe.Value];var l=this.rowIndex(a[0]),h=this.colIndex(a[0]),d=this.rowIndex(a[1]),a=this.colIndex(a[1]);if(d<l&&(l=(p=[d,l])[0],d=p[1]),a<h&&(h=(p=[a,h])[0],a=p[1]),!(0<l&&d<=Bhe&&0<h&&a<=16384))return this.getErrorStrings()[yhe.Name];var p=this.grid,c="",u=this.getSheetFamilyItem(p),e=(e[1].startsWith("!")?(c=e[1].substring(0,e[1].replace("!","").indexOf("!")+2),null!==u.tokenToParentObject&&(this.grid=u.tokenToParentObject.get(c))):null!==u.parentObjectToToken&&(c=u.parentObjectToToken.get(p)),this.getSheetId(this.grid)),u={action:"getSheetInfo",sheetInfo:[]};if(this.parentObject.notify(Pie,u),-1===Rre(this.parentObject,"Sheet"+e,u.sheetInfo))return this.grid=p,o[yhe.Ref];var g,m,f=this.getCellValueFn(p,this.cell,e,!0);if(t){var y=h+s-1;if(a<y)return o[yhe.Ref];var v=l,b=d,O=c+_he(h),w=function(e){return f(e,h,O+e)},N=c+_he(y),C=function(){return f(R,y,N+R)||"0"}}else{var S,A=l+s-1;if(d<A)return o[yhe.Ref];v=h,b=a,w=function(e){return S=c+_he(e),f(l,e,S+l)},C=function(){return f(A,R,S+A)||"0"}}var x=[];if(r){var I,T,E,D=void 0;for(D=this.isNumber(n)?(I=this.parseFloat(n),function(){return I===i.parseFloat(m)}):n.includes("*")||n.includes("?")?(-1<(u=(T=n).indexOf("*"))&&(T=T.replace(/\*/g,"").trim(),this.isCellReference(T)&&(T=this.getValueFromArg(T)),0===u?T="*"+T:u===n.length-1?T+="*":T=n.substring(0,u)+"*"+n.substring(u+1)),T=T.toLowerCase(),function(){return i.processLogical([i.findWildCardValue(T,m.toLowerCase()),n],"equal")===i.trueValue}):(E=n.toUpperCase(),function(){return E===m.toUpperCase()}),R=v;R<=b;R++)(m=w(R))&&D()&&x.push(C());g=x.length?x[0]:o[yhe.NA]}else if(-1<n.indexOf("*")||-1<n.indexOf("?"))g=o[yhe.NA];else{for(var M,k,P,B,F=void 0,L=(F=this.isNumber(n)?(k=this.parseFloat(n),P=Sa.fnSort(""),function(){M=P(i.isNumber(m)?i.parseFloat(m):m||null,k)}):(B=new Intl.Collator(this.parentObject.locale||"en-US",{sensitivity:"base"}),function(){M=!m||i.isNumber(m)?null:B.compare(m,n)}),void 0),R=v;R<=b;R++)m=w(R),L||(F(),0===M||M<0?x.push(C()):0<M&&x.length&&(L=!0));g=x.length?x[x.length-1]:o[yhe.NA]}return this.grid=p,g},Lhe.prototype.findClosestMatch=function(e,t){for(var i=0,n=t.length-1;i<=n;){var o=Math.floor((i+n)/2),r=t[o],r=this.compareStrings(e.toLowerCase(),r.toLowerCase());if(0===r)return o;1===r?i=o+1:n=o-1}for(var s=i-1;0<=s;s--)if(-1!==this.compareStrings(e.toLowerCase(),t[s].toLowerCase()))return s;return-1},Lhe.prototype.compareStrings=function(e,t){for(var i=Math.min(e.length,t.length),n=0;n<i;n++){var o=e.charCodeAt(n),r=t.charCodeAt(n);if(o<r)return-1;if(r<o)return 1}return e.length<t.length?-1:e.length>t.length?1:0},Lhe.prototype.findWildCardValue=function(e,t){var i="";if(-1<e.indexOf("?"))var n=RegExp(e.replace(/\?/g,"[\\s\\S]")),i=t.length===e.length&&this.isNaN(this.parseFloat(t))&&t.match(n)?e:t;else if(-1<e.indexOf("*")){for(var n=e.indexOf("*"),o="",r="",s=this.falseValue,a=this.falseValue,l=n-1;0<=l;l--)o+=e[l],a=this.trueValue;for(l=n+1;l<e.length;l++)r+=e[l],s=this.trueValue;var n=""===o?-1:t.indexOf(o.split("").reverse().join("")),h=""===r?-1:t.indexOf(r);-1<n||-1<h?(n=o.split("").reverse().join("")===t.substr(0,o.length),h=r===t.substring(t.length-r.length,t.length),a===this.trueValue&&s===this.trueValue&&this.isNaN(this.parseFloat(o))&&this.isNaN(this.parseFloat(r))?i=n&&h?e:t:a===this.trueValue&&this.isNaN(this.parseFloat(o))?i=n?e:t:s===this.trueValue&&this.isNaN(this.parseFloat(r))&&(i=h?e:t)):i=t}return i},Lhe.prototype.getComputeSumIfValue=function(e,t,i,n,o,r,s){var a=0,l=0;switch(o){case this.parser.tokenEqual:for(var h=r?i.replace(/\*/g,""):i,d=0;d<e.length;d++){var p=this.getValueFromRange(t,d),c=this.getValueFromArg(e[d].split(this.tic).join("")).toLowerCase(),u=this.parseFloat(c);c===i&&u===n?(f=this.getValueFromArg(t[d].split(this.tic).join("")),y=this.parseFloat(f),this.isNaN(y)||(a+=y,l+=1)):c===i?this.isNaN(p)||(a+=p,l+=1):r&&h&&c&&this.isNaN(this.parseFloat(c))?(g=i.indexOf("*"),"*"===i[0]&&h.length<=c.length&&h===c.slice(c.length-h.length,c.length)?this.isNaN(p)||(a+=p,l+=1):("*"===i[i.length-1]&&h.length<=c.length&&h===c.slice(0,h.length)||-1<g&&c.startsWith(i.substr(0,g))&&c.endsWith(i.substr(g+1)))&&!this.isNaN(p)&&(a+=p,l+=1)):r&&!h&&c&&this.isNaN(this.parseFloat(c))?this.isNaN(p)||(a+=p,l+=1):s&&h&&c&&this.isNaN(this.parseFloat(c))&&(m=RegExp(h.replace(/\?/g,"[\\s\\S]")),c.length===i.length)&&c.match(m)&&!this.isNaN(p)&&(a+=p,l+=1)}break;case this.parser.tokenLess:for(d=0;d<e.length;d++){c=this.getValueFromArg(e[d].split(this.tic).join(""));(u=this.parseFloat(c))<n&&(f=this.getValueFromArg(t[d].split(this.tic).join("")),y=this.parseFloat(f),this.isNaN(y)||(a+=y,l+=1))}break;case this.parser.tokenGreater:for(d=0;d<e.length;d++){c=this.getValueFromArg(e[d].split(this.tic).join(""));n<(u=this.parseFloat(c))&&(f=this.getValueFromArg(t[d].split(this.tic).join("")),y=this.parseFloat(f),this.isNaN(y)||(a+=y,l+=1))}break;case this.parser.tokenLessEq:for(d=0;d<e.length;d++){c=this.getValueFromArg(e[d].split(this.tic).join(""));(u=this.parseFloat(c))<=n&&(f=this.getValueFromArg(t[d].split(this.tic).join("")),y=this.parseFloat(f),this.isNaN(y)||(a+=y,l+=1))}break;case this.parser.tokenGreaterEq:for(d=0;d<e.length;d++){c=this.getValueFromArg(e[d].split(this.tic).join(""));n<=(u=this.parseFloat(c))&&(f=this.getValueFromArg(t[d].split(this.tic).join("")),y=this.parseFloat(f),this.isNaN(y)||(a+=y,l+=1))}break;case this.parser.tokenNotEqual:for(h=r?i.replace(/\*/g,""):i,d=0;d<e.length;d++){var g,m,f,y,p=this.getValueFromRange(t,d),c=this.getValueFromArg(e[d].split(this.tic).join("")).toLowerCase(),u=this.parseFloat(c);c===i||u===n||r||s?r&&h&&c&&this.isNaN(this.parseFloat(c))?(g=i.indexOf("*"),"*"===i[0]&&h.length<=c.length&&h!==c.slice(c.length-h.length,c.length)||"*"===i[i.length-1]&&h.length<=c.length&&h!==c.slice(0,h.length)?this.isNaN(p)||(a+=p,l+=1):(-1<g&&!c.startsWith(i.substr(0,g))||!c.endsWith(i.substr(g+1)))&&!this.isNaN(p)&&(a+=p,l+=1)):!r||h||this.isNaN(this.parseFloat(c))?s&&h&&c&&this.isNaN(this.parseFloat(c))&&(m=RegExp(h.replace(/\?/g,"[\\s\\S]")),c.length===i.length&&c.match(m)||this.isNaN(p)||(a+=p,l+=1)):this.isNaN(p)||(a+=p,l+=1):(f=this.getValueFromArg(t[d].split(this.tic).join("")),y=this.parseFloat(f),this.isNaN(y)||(a+=y,l+=1))}}return[a,l]},Lhe.prototype.getValueFromRange=function(e,t){e=e[t],e=this.getValueFromArg(e);return this.parseFloat(e.toString())},Lhe.prototype.computeAndOrNot=function(e,t){for(var i,n,o=this,r="and"===t,s="or"===t,a="not"===t,l=r||a,h=[],d=e,p=0;p<d.length;p++){if(d[p]===this.tic)return this.getErrorStrings()[yhe.Value];if(this.isCellReference(d[p]))for(var c=this.getCellCollection(d[p]),u=0;u<c.length;u++){if(-1<this.getErrorStrings().indexOf(c[u]))return c[u];if(c[u][0]===this.tic)return this.getErrorStrings()[yhe.Name];if(i=this.getValueFromArg(c[u]),-1<this.getErrorStrings().indexOf(i))return i;n=this.parseFloat(i),i===this.falseValue||""!==i&&0===n||a&&""===i?h.push(this.falseValue):i===this.trueValue||!isNaN(n)&&""!==i?h.push(this.trueValue):""!==i&&!isNaN(n)||h.push(this.getErrorStrings()[yhe.Value])}else{if(i=this.getValueFromArg(d[p]).split(this.tic).join("").toUpperCase(),-1<this.getErrorStrings().indexOf(i))return i;n=this.parseFloat(i),i===this.falseValue||""===d[p]||""!==i&&0===n?h.push(this.falseValue):i===this.trueValue||!isNaN(n)&&""!==i?h.push(this.trueValue):""!==i&&!isNaN(n)||h.push(this.getErrorStrings()[yhe.Value])}}if(h.every(function(e){return e===o.getErrorStrings()[yhe.Value]}))return this.getErrorStrings()[yhe.Value];for(u=0;u<h.length;u++){if((r||a)&&h[u]===this.falseValue){l=!1;break}if(s&&h[u]===this.trueValue){l=!0;break}}return(l=a?!l:l)?this.trueValue:this.falseValue},Lhe.prototype.removeTics=function(e){return e=1<e.length&&e[0]===this.tic[0]&&e[e.length-1]===this.tic[0]?this.substring(e,1,e.length-2):e},Lhe.prototype.getCellFrom=function(e){var t,i,n="",e=-1<e.indexOf(":")?e.split(":"):[e],o=e.length-1,r=this.rowIndex(e[0]);return r===this.rowIndex(e[o])?(i=this.colIndex(e[0]),t=this.colIndex(e[o]),i<=(i=this.colIndex(this.cell))&&i<=t&&(n=_he(i).toString()+r.toString())):this.colIndex(e[0])===this.colIndex(e[o])&&(t=this.colIndex(e[0]),i=this.rowIndex(e[o]),r<=(e=this.rowIndex(this.cell)))&&e<=i&&(n=_he(t).toString()+e.toString()),n},Lhe.prototype.computeValue=function(e,t,i){try{for(var n=[],o=0,r="",s=(n.length=0,this.getParseDecimalSeparator());o<e.length;){var a="u"===e[o];if(a&&(o+=1),e[o]===this.arithMarker)o+=1;else{if(this.isDigit(e[o])){for(var l=this.emptyString;o<e.length&&(this.isDigit(e[o])||e[o]===s);)l+=e[o]===s?".":e[o],o+=1;if(n.push(l),!e[o])return n.toString()}if(e[o]===this.sheetToken){for(r=e[o],o+=1;o<e.length&&e[o]!==this.sheetToken;)r+=e[o],o+=1;o<e.length&&(r+=e[o],o+=1)}else if(this.isUpperChar(e[o])){for(var l=this.emptyString,h="";o<e.length&&this.isUpperChar(e[o]);)l+=e[o],o+=1;for(;o<e.length&&this.isDigit(e[o]);)l+=e[o],o+=1;if(o<e.length&&":"===e[o]){if(l+=e[o],(o+=1)<e.length&&e[o]===this.sheetToken)for(l+=e[o],o+=1;o<e.length&&e[o]!==this.sheetToken;)l+=e[o],o+=1;for(;o<e.length&&this.isUpperChar(e[o]);)l+=e[o],o+=1;for(;o<e.length&&this.isDigit(e[o]);)l+=e[o],o+=1;l=r+this.getCellFrom(l)}else l=r+l;if(h=this.getParentObjectCellValue(l,t).toString(),r="","string"==typeof h&&-1<this.getErrorStrings().indexOf(h))return h;a&&(h=this.isNaN(this.parseFloat(h))?"-"+h:(-this.parseFloat(h)).toString()),n.push(h)}else if("q"===e[o]){var d=e.substring(o+1).indexOf(this.leftBracket),p=e.substring(o+d+1).indexOf(this.rightBracket);e=this.substring(e,o+d+2,p-1)}else if(e[o]===this.tic[0]){l=e[o].toString();for(o+=1;o<e.length&&e[o]!==this.tic[0];)l+=e[o],o+=1;(h=l.split(this.tic).join(this.emptyString))===this.trueValue||h===this.falseValue||!this.isNaN(this.parseFloat(h))&&""!==h?n.push(this.tic+h+this.tic):n.push(h),o+=1}else if("%"===e[o]&&0<n.length){var c=n[0],u=this.parseFloat(c);this.isNaN(u)||(n.pop(),n.push((u/100).toString())),o+=1}else if(0===e.substring(o).indexOf(this.trueValue))n.push(this.trueValue),o+=this.trueValue.length;else if(0===e.substring(o).indexOf(this.falseValue))n.push(this.falseValue),o+=this.falseValue.length;else if(e[o]===this.tic[0]||"|"===e[o]){l=e[o].toString();for(o++;o<e.length&&e[o]!==this.tic[0];)l+=e[o],o+=1;n.push(l+this.tic),o+=1}else if(" "===e[o]&&o<e.length-1)o+=1;else switch(e[o]){case"#":var g=0,g=-1<this.getErrorStrings().indexOf(e.substring(o))?-1===e.indexOf("!")||-1===e.substring(o).indexOf("!")?-1<e.indexOf("#N/A")?e.indexOf("#N/A")+4+o:e.indexOf("?")+1+o:e.indexOf("!")+1+o:o+1;n.push(this.substring(e,o,g-o)),o=g;break;case"n":l="";if("n"!==e[o+=1]){if(0===e.substring(o).indexOf("Infinity"))o+=(l="Infinity").length;else{for("u"!==e[o]&&!a&&"-"!==e[o]||(l="-",a)||(o+=1);o<e.length&&(this.isDigit(e[o])||e[o]===s||"."===e[o]);)l+=e[o]===s?".":e[o],o+=1;o<e.length&&"%"===e[o]&&(o+=1,""===l?0<n.length&&(c=n[0],u=this.parseFloat(c),this.isNaN(u)||(n.pop(),n.push((u/100).toString()))):l=(this.parseFloat(l)/100).toString())}l&&n.push(l)}break;case this.parser.tokenAdd:this.getValArithmetic(n,"add",i),o+=1;break;case this.parser.tokenSubtract:this.getValArithmetic(n,"sub",i),o+=1;break;case this.parser.tokenMultiply:this.getValArithmetic(n,"mul",i),o+=1;break;case this.parser.tokenDivide:this.getValArithmetic(n,"div",i),o+=1;break;case this.parser.tokenLess:this.processLogical(n,"less"),o+=1;break;case this.parser.tokenGreater:this.processLogical(n,"greater"),o+=1;break;case this.parser.tokenGreaterEq:this.processLogical(n,"greaterEq"),o+=1;break;case this.parser.tokenLessEq:this.processLogical(n,"lessEq"),o+=1;break;case this.parser.tokenNotEqual:this.processLogical(n,"notEq"),o+=1;break;case this.parser.tokenOr:this.processLogical(n,"or"),o+=1;break;case this.parser.tokenAnd:this.processLogical(n,"and"),o+=1;break;case this.parser.tokenEqual:this.processLogical(n,"equal"),o+=1;break;default:return this.getErrorStrings()[yhe.Value]}}}if(0===n.length)return this.emptyString;for(var l=this.emptyString,m=n.length;0<m;){var f=n.pop();if(-1<this.getErrorStrings().indexOf(f))return f;if((l=f+l)===this.emptyString&&this.isCellReference(e)&&this.getTreatEmptyStringAsZero())return"0";m--}return l}catch(e){if(-1<this.getErrorStrings().indexOf(e)||-1<this.formulaErrorStrings.indexOf(e))throw e;throw new Rhe(this.formulaErrorStrings[vhe.InvalidExpression])}},Lhe.prototype.getValArithmetic=function(e,t,i){var n=!1,o=e.pop(),r=-1!==o.indexOf(".")?o.split(".")[1].length:0,r=Math.pow(10,r),s=e.pop(),a=-1!==s.indexOf(".")?s.split(".")[1].length:0,a=Math.pow(10,a),l=a<=r?r:a,h=r*a,d=(o=(o=o===this.trueValue?"1":o===this.falseValue?"0":o)===this.emptyString?"0":this.getErrorStrings().indexOf(o.toString())<0?this.parseFloat(o+"").toString():o,Number(o));isNaN(d)&&!i&&(n=!0,o===this.getErrorStrings()[yhe.DivZero]?e.push(this.getErrorStrings()[yhe.DivZero]):e.push(this.getErrorStrings()[yhe.Value])),s=(s=s===this.trueValue?"1":s===this.falseValue?"0":s)===this.emptyString?"0":this.getErrorStrings().indexOf(s.toString())<0?this.parseFloat(s+"").toString():s,d=Number(s),isNaN(d)&&!i&&(n=!0,s===this.getErrorStrings()[yhe.DivZero]?e.push(this.getErrorStrings()[yhe.DivZero]):e.push(this.getErrorStrings()[yhe.Value])),"add"!==t||n||e.push(((Number(s)*l+Number(o)*l)/l).toString()),"sub"!==t||n||e.push(((Number(s)*l-Number(o)*l)/l).toString()),"mul"!==t||n||e.push((Number(s)*a*(Number(o)*r)/h).toString()),"div"!==t||n||(this.isNaN(this.parseFloat(o))||this.isNaN(this.parseFloat(s))?e.push(this.getErrorStrings()[yhe.Value]):0===this.parseFloat(o)?e.push(this.getErrorStrings()[yhe.DivZero]):e.push((Number(s)*h/(Number(o)*h)).toString()))},Lhe.prototype.processLogical=function(e,t){var i,n,o,r,s,a,l=!1;return"and"!==t&&"equal"!==t&&(i=e.pop(),n=e.pop(),-1<this.getErrorStrings().indexOf(i)?(a=i,l=!0):-1<this.getErrorStrings().indexOf(n)&&(a=n,l=!0),this.isNaN(this.parseFloat(i))&&this.isNaN(this.parseFloat(n))&&(i=i.toString().toLowerCase(),n=n.toString().toLowerCase()),je(i)||(o=-1<i.indexOf(this.tic)?i:this.parseFloat(i)),je(n)||(r=-1<n.indexOf(this.tic)?n:this.parseFloat(n)),"*"===i)&&this.isNaN(this.parseFloat(n))&&""!==n&&(s=!0),"less"!==t||l||(a=this.isNaN(o)||this.isNaN(r)?n.toUpperCase().split(this.tic).join("").localeCompare(i.toUpperCase().split(this.tic).join(""))<0?this.trueValue:this.falseValue:r<o?this.trueValue:this.falseValue),"greater"!==t||l||(a=this.isNaN(o)||this.isNaN(r)?0<n.toUpperCase().split(this.tic).join("").localeCompare(i.toUpperCase().split(this.tic).join(""))?this.trueValue:this.falseValue:o<r?this.trueValue:this.falseValue),"lessEq"!==t||l||(a=this.isNaN(o)||this.isNaN(r)?n.toUpperCase().split(this.tic).join("").localeCompare(i.toUpperCase().split(this.tic).join(""))<=0?this.trueValue:this.falseValue:r<=o?this.trueValue:this.falseValue),"greaterEq"!==t||l||(a=this.isNaN(o)||this.isNaN(r)?0<=n.toUpperCase().split(this.tic).join("").localeCompare(i.toUpperCase().split(this.tic).join(""))?this.trueValue:this.falseValue:o<=r?this.trueValue:this.falseValue),"notEq"!==t||l||(a=n!==i?this.trueValue:this.falseValue,s&&(a=this.falseValue)),"and"!==t||l||(i=e.pop().toString(),n="",0<e.length&&(n=e.pop().toString()),a=-1<this.getErrorStrings().indexOf(i)?i:-1<this.getErrorStrings().indexOf(n)?n:(a=this.emptyString+n+i+this.emptyString).split(this.tic).join("")),"equal"!==t||l||(i=e.pop(),n=e.pop(),a=-1<this.getErrorStrings().indexOf(i)?i:-1<this.getErrorStrings().indexOf(n)?n:(this.isNaN(this.parseFloat(i))&&this.isNaN(this.parseFloat(n))&&(i=i.toString().toLowerCase(),n=n.toString().toLowerCase()),"*"===i&&this.isNaN(this.parseFloat(n))&&""!==n&&(s=!0),i===n||s?this.trueValue:this.falseValue)),"or"!==t||l||(a=Math.pow(this.parseFloat(r),this.parseFloat(o)).toString(),a=this.isNaN(this.parseFloat(a))?this.getErrorStrings()[yhe.Value]:a),e.push(a),a},Lhe.prototype.computeStoreCells=function(e){for(var t=e.cellValue,i=e.cellRange,n=e.criteria,o=e.argArray,r=e.isCriteria,s=e.storedCells,a=e.isCountIfS===this.trueValue,l=e.countVal||0,h=r===this.trueValue?s:t,d=[],p=0;p<h.length;p++){var c=[],u=this.getValueFromArg(t[p]),g=o[a?1+2*l:2+l],m=g.startsWith(this.tic)&&g.endsWith(this.tic),f=(g=g.trim().split(this.tic).join(this.emptyString)).includes("*"),y="*"===g||"<>*"===g,v=f&&!y?g.replace(/\*/g,"").trim():g,b=!1,w=(!m&&this.isCellReference(v)&&(v=this.getValueFromArg(v),b=!0),g=v=f&&!y&&(f=g.indexOf("*"),"*"===g[0]&&(v="*"+v),"*"===g[g.length-1]&&(v+="*"),0<f)&&f<g.length-1?g.substring(0,f)+"*"+g.substring(f+1):v,"");if((r=a?this.trueValue:r)===this.trueValue){var C="",S=0,A=0,y=void 0,f=void 0,v=void 0,x=void 0,y=(s[p]=(a&&!l?t:s)[p],C=s[p],l&&(f=-1<(y=i[l-1]).indexOf("!")?rte(y.substring(y.lastIndexOf("!")+1)):rte(y),v=-1<C.indexOf("!")?ste(C.substring(C.lastIndexOf("!")+1)):ste(C),x=-1<i[l].indexOf("!")?rte(i[l].substring(i[l].lastIndexOf("!")+1)):rte(i[l])),-1<C.indexOf("!")),I=void 0,T="",E="";for(y&&(E=C.substring(0,C.lastIndexOf("!")+1),C=C.substring(C.lastIndexOf("!")+1));!this.isDigit(C[S]);)S+=1;if(this.isCellReference(i[l])&&-1<i[l].indexOf(":"))for(w=a&&!l?-1<h[p].indexOf("!")?h[p].substring(h[p].lastIndexOf("!")+1):h[p]:lte(x[0]+(v[0]-f[0]),x[1]+(v[1]-f[1])),(I=-1<i[l].indexOf("!"))&&(T=i[l].substring(0,i[l].lastIndexOf("!")+1));!this.isDigit(w[A]);)A+=1;var x=this.substring(C,S),v=this.substring(w,A),f=this.substring(C,S,C.length-S),D=this.substring(w,A,w.length-S);y&&(x=E+x,v=E+v),f!==D&&(s[p]=this.substring(s[p],y?E.length+S:S)+D),w=s[p].split(x).join(v),w=I?T+(w=-1<w.indexOf("!")?w.substring(w.lastIndexOf("!")+1):w):w.substring(w.lastIndexOf("!")+1),u=this.getValueFromArg(w),g=a?g:n[l-1].split(this.tic).join(this.emptyString)}f="equal";g.startsWith("<=")?(f="lessEq",g=g.substring(2)):g.startsWith(">=")?(f="greaterEq",g=g.substring(2)):g.startsWith("<>")?(f="notEq",g=g.substring(2)):g.startsWith("<")?(f="less",g=g.substring(1)):g.startsWith(">")?(f="greater",g=g.substring(1)):g.startsWith("=")&&(f="equal",g=g.substring(1)),(-1<(g=(m||!this.isCellReference(g)||b&&(""===w||a))&&!g.includes(this.arithMarker)?g:this.getValueFromArg(g)).indexOf("*")||-1<g.indexOf("?"))&&(u=this.findWildCardValue(g.toLowerCase(),u.toLowerCase())),c.push(u.toLowerCase()),c.push(g.toLowerCase()),this.processLogical(c,f)===this.trueValue&&(r===this.falseValue?d.push(t[p]):d.push(w))}return s=d,d=[],s},Lhe.prototype.computeIfsFormulas=function(e,t,i){if(t===this.trueValue&&(je(e)||""===e[0]||e.length<2||127<e.length||e.length%2!=0))return this.formulaErrorStrings[vhe.WrongNumberArguments];for(var n=e,o=[],r=[],s=[],a=0,l=0;l<n.length;l++)(-1<n[l].indexOf(":")&&this.isCellReference(n[l])?o:r).push(n[l].trim());for(var h=[],l=0;l<o.length;l++)h.push(this.getCellCollection(o[l]).length);for(var d=0;d<h.length;d++)if(h[d]&&h[d+1]&&h[d]!==h[d+1])return this.getErrorStrings()[yhe.Value];for(var p=0;p<r.length;p++)if(""===r[p])return i===this.trueValue?this.getErrorStrings()[yhe.DivZero]:0;if(t===this.falseValue){var c,u=this.falseValue,g={cellValue:c=this.getCellCollection(o[1]),cellRange:o,criteria:r,argArray:n,isCriteria:u,storedCells:s,isCountIfS:t};if(0===(s=this.computeStoreCells(g)).length)return i===this.trueValue?this.getErrorStrings()[yhe.DivZero]:0}for(l=t===this.trueValue?0:2;l<o.length;l++){u=this.trueValue,u=t===this.trueValue&&0===l?this.falseValue:this.trueValue;g={cellValue:c=this.getCellCollection(o[l]),cellRange:o,criteria:r,argArray:n,isCriteria:u,storedCells:s,isCountIfS:t,countVal:l};if(0===(s=this.computeStoreCells(g)).length)return i===this.trueValue?this.getErrorStrings()[yhe.DivZero]:0}for(var m=0,f=-1<o[0].indexOf("!")?rte(o[0].substring(o[0].lastIndexOf("!")+1)):rte(o[0]),e=o[o.length-1],y=-1<e.indexOf("!")?rte(e.substring(e.lastIndexOf("!")+1)):rte(e),d=0;d<s.length;d++){var v="",b="",w=0,C=0,S=-1<(v=s[d]).indexOf("!"),A=void 0,x="",I="";for(S&&(I=v.substring(0,v.lastIndexOf("!")+1),v=v.substring(v.lastIndexOf("!")+1));!this.isDigit(v[w]);)w+=1;if(this.isCellReference(o[0])&&-1<o[0].indexOf(":"))for(b=lte(f[0]+(ste(v)[0]-y[0]),f[1]+(ste(v)[1]-y[1])),(A=-1<o[0].indexOf("!"))&&(x=o[0].substring(0,o[0].lastIndexOf("!")+1));!this.isDigit(b[C]);)C+=1;var T=this.substring(v,w),E=this.substring(b,C),D=this.substring(v,w,v.length-w),M=this.substring(b,C,b.length-w);S&&(T=I+T,E=I+E),D!==M&&(s[d]=this.substring(s[d],S?I.length+w:w)+M),c=s[d].split(T).join(E),c=A?x+(c=-1<c.indexOf("!")?c.substring(c.lastIndexOf("!")+1):c):c.substring(c.lastIndexOf("!")+1),t===this.trueValue?a+=1:(D=this.getValueFromArg(c),S=parseFloat(""===D&&i!==this.trueValue?"0":D),this.isNumber(S)&&(m++,a+=S))}return i===this.trueValue&&(a/=m),a},Lhe.prototype.processNestedFormula=function(e,t,i){if(i&&!i.toString().includes('"')){var n=e.indexOf(t)+t.length;if('"'===e[n]&&this.getErrorStrings().indexOf(i.toString())<0&&!this.isNumber(i)&&i!==this.trueValue&&i!==this.falseValue)return e.split(t).join('"'+i+'"')}return e.split(t).join("n"+i)},Lhe.prototype.isNaN=function(e){return"NaN"===e.toString()||"string"==typeof e},Lhe.prototype.isNumber=function(e){return 0<=e-parseFloat(e)},Lhe.prototype.fromOADate=function(e){60<(e=0<e&&e<1?1+e:0===e?1:e)&&--e;var t=new Date("01/01/1900"),t=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return new Date(new Date((e-1)*this.millisecondsOfaDay+t).toUTCString().replace(" GMT",""))},Lhe.prototype.getSerialDateFromDate=function(e,t,i){for(var n=0,o=(e<1900&&(e+=1900),!1);!o;){for(;12<t;)e++,t-=12;for(;t<1;)t+=12,e--;for(var o=!0,r=new Date(e,t,1,-1).getDate();r<i;)r=new Date(e,t,1,-1).getDate(),t++,i-=r,o=!1;i<1&&(--t<1&&(t=12,e--),i=(r=new Date(e,t,1,-1).getDate())+i,o=!1)}var s=Date.parse(e+"/"+t+"/"+i);return n=this.isNaN(s)?n:this.toOADate(new Date(s))},Lhe.prototype.intToTime=function(e){var t=e.toString().split(".");return je(t[1])||(e=parseFloat(t[0]+1+"."+t[1])||e),this.intToDate(e.toString())},Lhe.prototype.toOADate=function(e,t,i){var n=new Date("01/01/1900"),e=gre(e)?e:new Date(e),n=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e=(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())-n)/864e5;return(t?e:parseInt(e.toString(),10))+(i?0:60<e?2:1)},Lhe.prototype.calculateDate=function(e){return this.parseFloat(e)<10?"0"+e:e},Lhe.prototype.isTextEmpty=function(e){return null===e||""===e},Lhe.prototype.isDigit=function(e){e=e.charCodeAt(0);return 47<e&&e<58},Lhe.prototype.findLastIndexOfq=function(e){for(var t=e.lastIndexOf("q"),i=e.lastIndexOf(this.leftBracket);i<t;)t=e.substring(0,t).lastIndexOf("q");return t},Lhe.prototype.getValueFromArg=function(t,e,i,n){if(!(t=t.trim())||-1<this.getErrorStrings().indexOf(t))return t;var o=t[0];if(o===this.tic||o===this.singleTic){var r=t.split(this.tic).join("");if(this.isNaN(this.parseFloat(r))){var s=this.isDate(r);if(s&&!this.isNaN(s.getDate()))return this.toOADate(s,!0).toString()}return t=t.endsWith(this.tic)&&"."!==(a=this.getParseDecimalSeparator())&&r.includes(a)&&(r=r.replace(a,"."),this.isNumber(r))?r:t}if("u"===o&&t.includes(this.arithMarker))t=this.parser.parseSimpleOperators(t.split("u").join("0-"),[this.parser.tokenSubtract],["-"]);else if(!this.isUpperChar(o)){var a=this.getParseDecimalSeparator();if(this.isDigit(o)||o===a||"-"===o||"n"===o)return"n"===o&&-1<(t=t.substring(1)).indexOf('"n')&&(t=t.replace('"n','"')),t="."!==a&&t.includes(a)&&(r=t.replace(a,"."),this.isNumber(r))?r:t}s=o===this.sheetToken;if(s||this.isUpperChar(o)&&!["+","-","/","*",")",")","{"].some(function(e){return t.includes(e)})){a=this.isCellReference(t);if((t=a&&!s&&null!==(r=this.getSheetFamilyItem(this.grid)).sheetNameToParentObject&&r.parentObjectToToken.has(this.grid)?r.parentObjectToToken.get(this.grid)+t:t)===this.cell){o=this.getDependentCells().get(t);if(null!=o&&-1<o.indexOf(t)&&this.arrayRemove(o,t),this.getDependentFormulaCells().has(this.cell)||this.clearFormulaDependentCells(this.cell),!e)throw new Rhe(this.formulaErrorStrings[vhe.CircularReference])}s=this.getParentObjectCellValue(t,!1,e,n).toString();return a&&this.updateDependentCell(t),s}return this.computeValue(t,!1,i)},Lhe.prototype.isDate=function(e){var t;return("object"==typeof e||null!==Date.parse(e))&&(t=void 0,(t="string"==typeof e?this.checkDateFormat(e):new Date(Date.parse(e)))>=this.dateTime1900)?t:null},Lhe.prototype.isValidCellReference=function(e){var t=0,i=0,n=[89,71,69],o=this.emptyString;if(!this.namedRanges.has(e)){for(var r=0;r<e.length;r++)this.isChar(e[r])&&t++;if((o=e.substring(0,t)).length<4){for(;i<o.length;){if(je(o[i])||!(o[i].charCodeAt(0)<n[i])){if(je(o[i])&&0<i)break;return!1}i++}if(this.parseFloat(e.substring(t,e.length))<1048576)return!0}}return!1},Lhe.prototype.parseDate=function(e){return this.isNaN(e)?"string"!=typeof e||(e=this.checkDateFormat(e,!0),this.isNaN(e))?this.getErrorStrings()[yhe.Value]:e:e instanceof Date?new Date(e):(e=parseInt(e,10))<0?this.getErrorStrings()[yhe.Num]:e<=60?new Date(this.dateTime1900.getTime()+864e5*(e-1)):new Date(this.dateTime1900.getTime()+864e5*(e-2))},Lhe.prototype.checkDateFormat=function(e,t){if("spreadsheet"===this.parentObject.getModuleName()&&"en-US"!==this.parentObject.locale){var i={value:e,cell:{value:e}};if(this.parentObject.notify("checkDateFormat",i),i.isDate)return i.dateObj}return t?new Date(e):new Date(Date.parse(e))},Lhe.prototype.isCellReference=function(e){if((e=e.trim())===this.emptyString)return!1;e=this.setTokensForSheets(e);var t=this.getSheetToken(e),i=!1,n=!1,o=!1;if((e=""!==t?e.split(t).join(this.emptyString):e).indexOf(":")!==e.lastIndexOf(":"))return!1;for(var r=e.split("").join(this.getParseArgumentSeparator()).split(this.getParseArgumentSeparator()),s=0;s<r.length;s++)if(this.isChar(r[s]))n=!0;else if(this.isDigit(r[s]))o=!0;else{if(":"!==r[s])return!1;n&&o&&(i=!0),o=n=!1}return-1<e.indexOf(":")&&-1===e.indexOf(this.tic)?!!(i&&n&&o)||!(!(n&&!o||!n&&o)||i):!!(n&&o&&-1===e.indexOf(this.tic)&&this.isValidCell(e))},Lhe.prototype.setTokensForSheets=function(e){var t,i=this.getSheetFamilyItem(this.grid),n=this.getSortedSheetNames();if(null!=n)for(var o=0;o<n.length;o++){var r=(r=i.sheetNameToToken.get(n[o])).split(this.sheetToken).join(this.tempSheetPlaceHolder),s=this.singleTic+"SHEET"+n[o]+this.singleTic+this.sheetToken;-1===e.indexOf(s)&&(s="SHEET"+n[o]+this.sheetToken),e=e.split(s).join(r),s=n[o]+this.sheetToken,e=e.split(s).join(r)}return-1<(e=e.split(this.tempSheetPlaceHolder).join(this.sheetToken)).indexOf("!!")&&((t=(e=e.replace("!!","!")).split("!"))[1]=(parseInt(t[1],10)+1).toString(),e=t.join("!")),e},Lhe.prototype.getParentObjectCellValue=function(e,t,i,n){if(e===this.trueValue||e===this.falseValue)return e;var o=e.lastIndexOf(this.sheetToken),r=this.grid;if(-1<o){if(null===(l=this.getSheetFamilyItem(r)).tokenToParentObject)return this.getErrorStrings()[yhe.Value];this.grid=l.tokenToParentObject.get(e.substring(0,o+1)),a=e.substring(o+1)}else{for(var s=0;s<e.length&&this.isChar(e[s]);)s++;if(s===e.length)return""===e?this.getErrorStrings()[yhe.Value]:this.getErrorStrings()[yhe.Name];var a=e;(l=this.getSheetFamilyItem(r)).isSheetMember&&null!=l.parentObjectToToken&&(e=l.parentObjectToToken.get(this.grid)+e)}this.isDigit(a[0])&&0<(o=a.search(/[a-zA-Z]/))&&(a=a.substring(o,a.length)+a.substring(0,o));var l=this.rowIndex(a),o=this.colIndex(a);if(0<l&&l<=Bhe&&0<o&&o<=16384){a=this.getSheetId(this.grid);if(this.parentObject.notify){var h={action:"getSheetInfo",sheetInfo:[]};if(this.parentObject.notify(Pie,h),-1===Rre(this.parentObject,"Sheet"+a,h.sheetInfo))return this.grid=r,this.getErrorStrings()[yhe.Ref]}h=this.getCellValueFn(r,this.cell,a,!1,t,i,n)(l,o,e)}else h=this.getErrorStrings()[yhe.Name];return this.grid=r,h},Lhe.prototype.getCellValueFn=function(e,n,o,r,s,a,l){var h=this,d=(d=n)&&(e===this.grid?"":d+","+("string"==typeof e&&-1<Number(e)?e:this.getSheetID(e))),p=this.parentObject.getValueRowCol.bind(this.parentObject)||this.getValueRowCol.bind(this);return function(e,t,i){if(n===i&&!a)throw h.formulaErrorStrings[vhe.CircularReference];h.cell=i;e=p(o,e,t,d,s,a,l);return je(e)?e=h.emptyString:(e=e.toString(),"."!==(t=h.getParseDecimalSeparator())&&e.includes(t)&&(t=e.replace(t,"."),h.isNumber(t))&&(e=t)),h.cell=n,r&&h.updateDependentCell(i),e}},Lhe.prototype.isValidCell=function(e){0===e.search(/\d/)&&(t=e.search(/[a-zA-Z]/),e=e.substring(t,e.length)+e.substring(0,t));var t=this.rowIndex(e),e=this.colIndex(e);return 0<t&&t<=Bhe&&0<e&&e<=16384},Lhe.prototype.getSheetId=function(e){return e&&"string"==typeof e&&-1<Number(e)?Number(e):this.getSheetID(e)+1},Lhe.prototype.getValueRowCol=function(e,t,i){var n,t=this.rowsToKeyMap.get(t).toString(),t=this.getKeyValue(t).toString();return t=null!=t&&"%"===t[t.length-1]&&1<t.length&&(n=this.parseFloat(t.substring(0,t.length-1)),this.isNaN(n))?(Number(n)/100).toString():t},Lhe.prototype.defineFunction=function(e,t,i){"string"==typeof t&&(t=R(t,window)),e=e.toUpperCase(),this.libraryFormulas.set(e,{handler:t,isCustom:!0,description:i})},Lhe.prototype.valueChanged=function(t,e,i,n,o,r,s,a,l,h,d,p){var c=t,n=(this.spreadSheetUsedRange=n,this.grid=t,!0),t=!0,u=this.getSheetFamilyItem(c),g=_he(e.getColIndex())+e.getRowIndex().toString(),r=(this.actCell=r+"!"+g,null!==u.sheetNameToParentObject&&0<u.sheetNameToParentObject.size&&(g=u.parentObjectToToken.get(c)+g),e.getFormulaValue().toUpperCase());if((-1<r.indexOf("=RAND()")||-1<r.indexOf("=NOW()")||-1<r.indexOf("NOW()")||-1<r.indexOf("RAND()")||-1<r.indexOf("=RANDBETWEEN(")||-1<r.indexOf("RANDBETWEEN(")||this.randomValues.has(g))&&(u=this.randCollection.toString(),this.randomValues.has(g)?this.randomValues.has(g)&&(-1<r.indexOf("=RAND()")||-1<r.indexOf("=NOW()")||-1<r.indexOf("NOW()")||-1<r.indexOf("RAND()")||-1<r.indexOf("=RANDBETWEEN(")||-1<r.indexOf("RANDBETWEEN(")?this.randomValues.set(g,e.getFormulaValue()):e.getFormulaValue().toUpperCase()!==this.randomValues.get(g.toUpperCase())&&(this.randomValues.delete(g),u=u.split(g+this.parseArgumentSeparator).join("").split(this.parseArgumentSeparator+g).join("").split(g).join(""),this.randCollection=u.split(this.parseArgumentSeparator)),0===this.randomValues.size)&&this.randCollection.length&&(this.isRandomVal=!1,this.randomValues.clear(),this.randCollection=[]):(this.randomValues.set(g,e.getFormulaValue()),this.randCollection.push(g),this.isRandomVal=!0)),e.getFormulaValue()&&e.getFormulaValue()[0]===this.getFormulaCharacter()){this.cell=g;var m,r=void 0;if(je(t)||(t=i),this.getFormulaInfoTable().has(g)){if(r=this.getFormulaInfoTable().get(g),e.getFormulaValue()!==r.getFormulaText()||null==r.getParsedFormula()){r.setFormulaText(e.getFormulaValue()),this.getDependentFormulaCells().has(this.cell)&&this.clearFormulaDependentCells(this.cell);try{r.setParsedFormula(this.parser.parseFormula(e.getFormulaValue()))}catch(e){r.setFormulaValue(e),t=!1}}else this.parser.isError=!1;t&&(this.parser.isFormulaParsed=!0,n=(m=this.calculateFormula(r.getParsedFormula(),o))!==r.getFormulaValue()&&(!this.parentObject.isEdit||m!==this.formulaErrorStrings[vhe.CircularReference]),r.setFormulaValue(m))}else{(r=new Ohe).setFormulaText(e.getFormulaValue()),this.getDependentFormulaCells().has(g)||this.getDependentFormulaCells().set(g,new Map),this.getFormulaInfoTable().set(g,r);try{r.setParsedFormula(this.parser.parseFormula(e.getFormulaValue()))}catch(e){r.setFormulaValue(e),t=!1}t&&(n=(m=this.calculateFormula(r.getParsedFormula(),o))!==this.formulaErrorStrings[vhe.CircularReference],r.setFormulaValue(m))}t&&(void 0===this.parentObject.setValueRowCol?this.setValueRowCol(this.getSheetID(c)+1,r.getFormulaValue(),e.getRowIndex(),e.getColIndex()):this.parentObject.setValueRowCol(this.getSheetId(c),r.getFormulaValue(),e.getRowIndex(),e.getColIndex(),r.getFormulaText(),s))}else this.getFormulaInfoTable().has(g)&&(this.getFormulaInfoTable().delete(g),this.getDependentFormulaCells().has(g))&&this.clearFormulaDependentCells(g);t&&n&&this.getDependentCells().has(g)&&("Automatic"===this.parentObject.calculationMode||!this.parentObject.isEdit||d)&&this.getDependentCells().get(g).toString()!==g&&this.refresh(g,void 0,void 0,a,l,h,d,p)},Lhe.prototype.setValueRowCol=function(e,t,i,n){},Lhe.prototype.getSortedSheetNames=function(){var i,e=this.getSheetFamilyItem(this.grid);return null!=e&&null!=e.sheetNameToToken&&(i=[],e.sheetNameToToken.forEach(function(e,t){i.push(t),i.sort()}),this.sortedSheetNames=i,this.sortedSheetNames.sort(),9<this.sortedSheetNames.length)&&this.sortedSheetNames[0].includes("1")&&this.sortedSheetNames[1].includes("10")&&(this.sortedSheetNames.splice(this.sortedSheetNames.indexOf("2"),0,this.sortedSheetNames[0]),this.sortedSheetNames.splice(0,1)),this.sortedSheetNames},Lhe.prototype.getErrorLine=function(e){e=e.stack?e.stack.split("\n")[1].split(":"):null;return e?e[e.length-2]:null},Lhe.prototype.createSheetFamilyID=function(){return this.sheetFamilyID===Number.MAX_SAFE_INTEGER&&(this.sheetFamilyID=Number.MIN_SAFE_INTEGER),this.sheetFamilyID++},Lhe.prototype.computeMinMax=function(e,t){var i,n,o,r=!1;if(e.length&&("isSubtotal"===(o=e[e.length-1])?(r=!0,e.pop()):"isAggregate"===o&&(n=this.parentObject.getActiveSheet(),i=!0,e.pop())),je(e)||0===e.length)return this.formulaErrorStrings[vhe.WrongNumberArguments];for(var s="max"===t?this.minValue:this.maxValue,a=0,l=e.length;a<l;a++)e[a].split(this.tic).join("").trim()===this.emptyString&&(s=0);var h=e;if(255<h.length)return this.getErrorStrings()[yhe.Value];for(var d=0;d<h.length;d++)if(-1<h[d].indexOf(":")&&this.isCellReference(h[d]))for(var p,c=this.getCellCollection(h[d]),u=0;u<c.length;u++)i&&(zde(n,(p=ste(c[u]))[0])||epe(n,p[1]))||(p=r?this.getValueFromArg(c[u],null,null,!0):this.getValueFromArg(c[u]),r&&p.includes("SUBTOTAL("))||(m=this.parseFloat(p),""===p)||this.isNaN(this.parseFloat(m))||-1<this.getErrorStrings().indexOf(p)||(s="max"===t?Math.max(s,m):Math.min(s,m));else{var g=r?this.getValueFromArg(h[d],null,null,!0):this.getValueFromArg(h[d]);if(!r||!g.includes("SUBTOTAL(")){var m=0,f=this.isCellReference(h[d]),y=""===g&&f,v=this.isNaN(this.parseFloat(g))&&f,f=g===(this.trueValue||this.falseValue)&&f;if(h[d]=h[d].startsWith("n")?h[d].slice(1):h[d],-1<this.getErrorStrings().indexOf(g))return g;if(g===this.trueValue&&h[d]===this.trueValue)g="1";else if(g===this.falseValue&&h[d]===this.falseValue)g="0";else if(y||v||f)continue;if(-1<g.indexOf('"')&&(g=g.split(this.tic).join("")),this.isNaN(this.parseFloat(g)))return this.getErrorStrings()[yhe.Value];m=this.parseFloat(g),s="max"===t?Math.max(s,m):Math.min(s,m)}}return(s=s!==this.minValue&&s!==this.maxValue?s:0).toString()},Lhe.prototype.calculateAvg=function(e,t,i){var n,o,r,s,a=e,l=0,h=0;i&&(s=this.parentObject.getActiveSheet());for(var d=0;d<a.length;d++)if(this.isCellReference(a[d])){if(-1<a[d].indexOf(":")){for(var p=this.getCellCollection(a[d]),c=0;c<p.length;c++)if(!(i&&(zde(s,(r=ste(p[c]))[0])||epe(s,r[1]))||(n=t?this.getValueFromArg(p[c],null,null,!0):this.getValueFromArg(p[c]),t&&n.includes("SUBTOTAL(")))){if(-1<this.getErrorStrings().indexOf(n))return n;je(n)||isNaN(this.parseFloat(n))||""===n||(l+=this.parseFloat(n),h+=1)}}else if(n=t?this.getValueFromArg(a[d],null,null,!0):this.getValueFromArg(a[d]),!t||!n.includes("SUBTOTAL(")){if(-1<this.getErrorStrings().indexOf(n))return n;je(n)||isNaN(this.parseFloat(n))||""===n||(l+=this.parseFloat(n),h+=1)}}else{if(-1<a[d].indexOf(this.tic)&&(isNaN(this.parseFloat(a[d].split(this.tic).join("")))||""===a[d].split(this.tic).join("").trim()))return this.getErrorStrings()[yhe.Value];if(0!==a[d].length&&e[d]!==this.falseValue||(a[d]="0"),e[d]===this.trueValue&&(a[d]="1"),o=this.getValueFromArg(a[d].split(this.tic).join("")),-1<this.getErrorStrings().indexOf(o))return o;l+=this.parseFloat(o),h+=1}return 0===h?this.getErrorStrings()[yhe.DivZero]:(l/h).toString()},Lhe.prototype.registerGridAsSheet=function(e,t,i){je(this.modelToSheetID)&&(this.modelToSheetID=new Map),je(this.modelToSheetID.get(t))&&this.modelToSheetID.set(t,i);var n,i=this.getSheetFamilyItem(t),o=(i.isSheetMember=!0,e.toUpperCase());return 0===i.parentObjectToToken.size&&(i.parentObjectToToken=new Map),0===i.sheetNameToParentObject.size&&(i.sheetNameToParentObject=new Map),0===i.sheetNameToToken.size&&(i.sheetNameToToken=new Map),0===i.tokenToParentObject.size&&(i.tokenToParentObject=new Map),ee(i.sheetNameToParentObject.get(o))?(n=this.sheetToken+this.tokenCount.toString()+this.sheetToken,this.tokenCount++,i.tokenToParentObject.set(n,t),i.parentObjectToToken.set(t,n),i.sheetNameToToken.set(o,n),i.sheetNameToParentObject.set(o,t)):(n=i.sheetNameToToken.get(o),i.tokenToParentObject.set(n,t),i.parentObjectToToken.set(t,n)),e},Lhe.prototype.unregisterGridAsSheet=function(o,e,r){var s=this,i=[e];r&&(i=[],je(this.modelToSheetID)||this.modelToSheetID.forEach(function(e,t){i.push(t)})),i.forEach(function(e){var t,i=s.getSheetFamilyItem(e),n=(r?e:o).toUpperCase();null!=i.sheetNameToParentObject&&i.sheetNameToParentObject.has(n)&&(i.sheetNameToParentObject.delete(n),t=i.sheetNameToToken.get(n),i.sheetNameToToken.delete(n),i.tokenToParentObject.delete(t),i.parentObjectToToken.delete(e))})},Lhe.prototype.computeExpression=function(e,t){e=this.parser.parseFormula(e);return this.computeFormula(e,t)},Lhe.prototype.isSheetMember=function(){var e=this.getSheetFamilyItem(this.grid);return!je(e)&&e.isSheetMember},Lhe.prototype.dispose=function(){this.resetKeys(),this.namedRanges.clear(),this.lFormulas.clear()},Lhe.prototype.refreshRandValues=function(e){var t,i,n,o;this.randomValues.has(e)&&(this.randomValues.delete(e),-1<(e=this.randCollection.indexOf(e))&&this.randCollection.splice(e,1),0!==this.randomValues.size||this.randCollection.length||(this.randomValues.clear(),this.randCollection=[]));for(var r=0;r<this.randomValues.size;r++)t=this.rowIndex(this.randCollection[r]),i=this.colIndex(this.randCollection[r]),n=(parseFloat(this.getSheetToken(this.randCollection[r]).split(this.sheetToken).join(""))+1).toString(),o=this.getSheetFamilyItem(n),this.grid=o.sheetNameToParentObject.get(n),o=this.randomValues.get(this.randCollection[r]),o=this.computeFormula(o),void 0===this.parentObject.setValueRowCol?this.setValueRowCol(this.getSheetID(this.grid)+1,o,t,i):this.parentObject.setValueRowCol(this.getSheetId(this.grid),o,t,i)},Lhe.prototype.refresh=function(e,t,i,s,n,o,r,a){var l,h=this,d=(i||(l=!0,i=[]),this.getSheetFamilyItem(this.grid));try{var p=this.getDependentCells().get(e);if(p&&0!==p.length&&("Automatic"===this.parentObject.calculationMode||r||"calculate"===a))for(var c=void 0,c=0;c<p.length;c++){var u=p[c];if(!(t&&-1<u.indexOf(t)||u===e||-1<i.indexOf(u))){var g=this.getSheetToken(u),m=this.parentObject.sheets,f=this.parentObject.activeSheetIndex;if(g.length){this.grid=d.tokenToParentObject.get(g);var y=Number(this.grid),v="";if(!this.isNaN(y)&&m)for(var b=0;b<m.length;b++)m[b].id===y&&(v=m[b].name,f=b);this.actCell=v+"!"+u.split(g)[1]}else this.actCell=u.split(g)[1];try{var w=function(e,t){t&&(h.cell=e,h.parser.isFormulaParsed=!0,t.setFormulaValue(h.calculateFormula(t.getParsedFormula(),!0)))},C=this.rowIndex(u),S=this.colIndex(u),A=this.getFormulaInfoTable().get(u);if(void 0===this.parentObject.setValueRowCol)w(u,A),this.setValueRowCol(this.getSheetID(this.grid)+1,A.getFormulaValue(),C,S);else{var x=m&&m[f].rows&&m[f].rows[C-1]&&m[f].rows[C-1].cells&&m[f].rows[C-1].cells[S-1],I=void 0;if(x&&x.formula&&x.formula.toLowerCase().includes("unique")){if(this.uniqueCells&&-1!==this.uniqueCells.indexOf(u))continue;this.uniqueCells||(this.uniqueCells=[]),this.uniqueCells.push(u),w(u,A),I=A.getFormulaValue(),this.uniqueCells.splice(this.uniqueCells.indexOf(u),1),this.uniqueCells.length||(this.uniqueCells=null)}else-1===i.indexOf(u)&&i.push(u),I=null;this.parentObject.setValueRowCol(this.getSheetId(this.grid),I,C,S,A.getFormulaText())}this.refresh(u,null,i,null,n)}catch(e){continue}}}if(l){if(!n&&o&&4===o.length){for(var g=this.getSheetToken(e),T=[],E=o[0],D=o[2];E<=D;E++)for(var M=o[1],k=o[3];M<=k&&(E!==D||M!==k);M++){x=g+lte(E,M);this.refresh(x,null,i,null,n),T.push(x)}var P=new Set(T);i=i&&i.filter(function(e){return!P.has(e)})}var B=this.parentObject.sheets;(i=B?i:[]).forEach(function(e){for(var t,i=h.getSheetId(d.tokenToParentObject.get(h.getSheetToken(e))),n=0;n<B.length;n++)if(B[n].id===i){t=n;break}var o=h.rowIndex(e)-1,e=h.colIndex(e)-1,r=B[t].rows[o]&&B[t].rows[o].cells[e];r&&h.parentObject.notify("calculateFormula",{cell:r,rowIdx:o,colIdx:e,sheetIndex:t,isDependentRefresh:!0,isRandomFormula:s,action:a})})}}finally{this.getDependentCells().has(e)&&(this.grid=d.tokenToParentObject.get(this.getSheetToken(e)))}},yJ([i()],Lhe.prototype,"onFailure",void 0),yJ([Bt],Lhe));function Lhe(e){var t=Phe.call(this,null,null)||this;return t.lFormulas=new Map,t.storedData=new Map,t.keyToRowsMap=new Map,t.rowsToKeyMap=new Map,t.rightBracket=String.fromCharCode(161),t.leftBracket=String.fromCharCode(162),t.sheetToken="!",t.emptyString="",t.leftBrace="{",t.rightBrace="}",t.cell=t.emptyString,t.cellPrefix="!0!A",t.treatEmptyStringAsZero=!1,t.tic='"',t.singleTic="'",t.trueValue="TRUE",t.falseValue="FALSE",t.parseDecimalSeparator=".",t.arithMarker=String.fromCharCode(180),t.arithMarker2=t.arithMarker+t.arithMarker,t.dependentCells=null,t.dependentFormulaCells=null,t.minValue=Number.MIN_SAFE_INTEGER,t.maxValue=Number.MAX_SAFE_INTEGER,t.categoryCollection=["All"],t.dependencyLevel=0,t.randomValues=new Map,t.isRandomVal=!1,t.randCollection=[],t.dependencyCollection=[],t.uniqueRange=[],t.formulaErrorStrings=["binary operators cannot start an expression","cannot parse","bad library","invalid char in front of","number contains 2 decimal points","expression cannot end with an operator","invalid characters following an operator","invalid character in number","mismatched parentheses","unknown formula name","requires a single argument","requires 3 arguments","invalid Math argument","requires 2 arguments","#NAME?","too complex","#CIRCULARREF!","missing formula","improper formula","invalid expression","cell empty","bad formula","empty expression","","mismatched string quotes","wrong number of arguments","invalid arguments","iterations do not converge","Control is already registered","Calculation overflow","Missing sheet","cannot_parse","expression_cannot_end_with_an_operator","#SPILL!","#DIV/0!"],t.errorStrings=null,t.parseArgumentSeparator=",",t.dateTime1900=new Date(1900,0,1,0,0,0),t.isParseDecimalSeparatorChanged=!1,t.isArgumentSeparatorChanged=!1,t.sheetFamilyID=0,t.defaultFamilyItem=null,t.sheetFamiliesList=null,t.modelToSheetID=null,t.tokenCount=0,t.sortedSheetNames=null,t.tempSheetPlaceHolder=String.fromCharCode(133),t.namedRanges=new Map,t.formulaInfoTable=null,t.millisecondsOfaDay=864e5,t.parseDateTimeSeparator="/",new The(t),t.parentObject=je(e)?t:e,t.grid=t.parentObject,t.parser=new Dhe(t),t}var Rhe=function(e,t){this.formulaCorrection=!1,this.message=e,this.formulaCorrection=t},Ohe=(Nhe.prototype.getFormulaText=function(){return this.formulaText},Nhe.prototype.setFormulaText=function(e){this.formulaText=e},Nhe.prototype.getFormulaValue=function(){return this.formulaValue},Nhe.prototype.setFormulaValue=function(e){this.formulaValue=e},Nhe.prototype.getParsedFormula=function(){return this.parsedFormula},Nhe.prototype.setParsedFormula=function(e){this.parsedFormula=e},Nhe);function Nhe(){this.calcID=Number.MIN_VALUE+1,this.calcID1=Number.MIN_VALUE+1}var Vhe=function(){this.isSheetMember=!1,this.parentObjectToToken=new Map,this.sheetDependentFormulaCells=new Map,this.sheetNameToParentObject=new Map,this.sheetNameToToken=new Map,this.tokenToParentObject=new Map,this.sheetFormulaInfotable=new Map};function _he(e){for(var t=[],i=0;0<e&&i<9;){e--;var n="A".charCodeAt(0);t[i]=String.fromCharCode(e%26+n),e=parseInt((e/26).toString(),10),i++}for(var o=[],r=0;r<i;r++)o[i-r-1]=t[r];return o.join("")}var Hhe=function(t,i,e){return this.row=t,this.col=i,this.value=e,this.getRowIndex=function(){return t},this.setRowIndex=function(e){t=e},this.getColIndex=function(){return i},this.setColIndex=function(e){i=e},this.getFormulaValue=function(){return e},this},zhe=(jhe.prototype.init=function(){var i=this;this.addEventListener(),this.initCalculate(),this.registerSheet(),this.parent.customFormulaCollection.forEach(function(e,t){i.addCustomFunction(e.handler,t,e.description)})},jhe.prototype.destroy=function(){var i=this;this.removeEventListener(),this.parent.refreshing&&(this.clearAllUniqueFormulaValue(),this.calculateInstance.getLibraryFormulas().forEach(function(e,t){e.isCustom&&i.parent.customFormulaCollection.set(t,{handler:e.handler,description:e.description})})),this.calculateInstance.dispose(),this.calculateInstance=null,this.sheetInfo&&(this.sheetInfo=[]),this.parent=null},jhe.prototype.addEventListener=function(){this.parent.on(Pie,this.performFormulaOperation,this),this.parent.on(jie,this.aggregateComputation,this),this.parent.on(Wie,this.getUniqueRange,this),this.parent.on(Qie,this.removeUniquecol,this),this.parent.on(Gie,this.clearFormulaDependentCells,this),this.parent.on(Yie,this.formulaInValidation,this),this.parent.on(coe,this.refreshInsertDelete,this),this.parent.on(uoe,this.getUpdatedFormulaOnInsertDelete,this),this.parent.on(yoe,this.autoCorrectCellRef,this),this.parent.on(voe,this.parseFormulaArgument,this),this.parent.on(boe,this.getCellRefValue,this),this.parent.on(woe,this.commputeFormulaValue,this),this.parent.on(Eoe,this.renameUpdation,this)},jhe.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Pie,this.performFormulaOperation),this.parent.off(jie,this.aggregateComputation),this.parent.off(Wie,this.getUniqueRange),this.parent.off(Qie,this.removeUniquecol),this.parent.off(Gie,this.clearFormulaDependentCells),this.parent.off(Yie,this.formulaInValidation),this.parent.off(coe,this.refreshInsertDelete),this.parent.off(uoe,this.getUpdatedFormulaOnInsertDelete),this.parent.off(yoe,this.autoCorrectCellRef),this.parent.off(voe,this.parseFormulaArgument),this.parent.off(boe,this.getCellRefValue),this.parent.off(woe,this.commputeFormulaValue),this.parent.off(Eoe,this.renameUpdation))},jhe.prototype.getModuleName=function(){return"workbookFormula"},jhe.prototype.initCalculate=function(){this.calculateInstance=new Fhe(this.parent),this.calcID=this.calculateInstance.createSheetFamilyID(),this.calculateInstance.setTreatEmptyStringAsZero(!0),this.calculateInstance.grid=this.parent.getActiveSheet().id.toString(),this.calculateInstance.setParseArgumentSeparator(this.parent.listSeparator);var e=Mi(this.parent.locale).decimal;"."!==e&&this.parent.listSeparator!==e&&this.calculateInstance.setParseDecimalSeparator(e)},jhe.prototype.clearFormulaDependentCells=function(e){var t,i,n;e.isOpen?(this.calculateInstance.getDependentCells().clear(),this.calculateInstance.getFormulaInfoTable().clear(),this.calculateInstance.getDependentFormulaCells().clear()):(t=e.cellRef.split(":")[0],i=this.parent.getActiveSheet().id.toString(),(n=this.calculateInstance.getSheetFamilyItem(i)).isSheetMember&&!je(n.parentObjectToToken)&&(t=n.parentObjectToToken.get(i)+t),e.clearFormulaInfo&&this.calculateInstance.getFormulaInfoTable().has(t)&&this.calculateInstance.getFormulaInfoTable().delete(t),this.calculateInstance.clearFormulaDependentCells(t))},jhe.prototype.formulaInValidation=function(e){var t=this.calculateInstance.getLibraryFormulas().get(e.value);e.skip=je(t)},jhe.prototype.performFormulaOperation=function(e){var t,i,n=e.action,o=("refreshCalculate"!==n&&(t=this.calculateInstance.getLibraryFormulas(),i=Array.from(t.values())),this.calculateInstance.getSheetFamilyItem(e.sheetId));switch(n){case"getLibraryFormulas":e.formulaCollection=Array.from(t.keys());break;case"getFormulaCategory":for(var r=["All"],s=1;s<Array.from(t.values()).length;s++)r.indexOf(i[s].category)<0&&r.push(i[s].category);e.categoryCollection=r;break;case"dropDownSelectFormulas":for(s=0;s<Array.from(t.values()).length;s++)e.selectCategory===i[s].category&&(e.formulaCollection[s]=Array.from(t.keys())[s]);break;case"getFormulaDescription":for(s=0;s<Array.from(t.values()).length;s++)e.selectedList===Array.from(t.keys())[s]&&(e.description=i[s].description,e.isCustom=i[s].isCustom);break;case"registerSheet":this.registerSheet(e.sheetIndex,e.sheetCount),e.isImport&&(this.calculateInstance.setParseArgumentSeparator(this.parent.listSeparator),this.updateSheetInfo());break;case"unRegisterSheet":this.unRegisterSheet(e.sheetIndex,e.sheetCount,e.propertyChange);break;case"initSheetInfo":this.updateSheetInfo();break;case"refreshCalculate":this.refreshCalculate(e);break;case"refreshRandomFormula":this.refreshRandomFormula(),this.calculateInstance.cell="";break;case"setArgumentSeparator":this.calculateInstance.setParseArgumentSeparator(this.parent.listSeparator);break;case"addDefinedName":e.isAdded=this.addDefinedName(e.definedName,!1,e.index,e.isEventTrigger);break;case"removeDefinedName":e.isRemoved=this.removeDefinedName(e.definedName,e.scope,e.isEventTrigger);break;case"initiateDefinedNames":this.initiateDefinedNames();break;case"addSheet":this.sheetInfo.push({visibleName:e.visibleName,sheet:e.sheetName,index:e.sheetId});break;case"getSheetInfo":e.sheetInfo=this.sheetInfo;break;case"deleteSheetTab":for(s=0;s<this.sheetInfo.length;s++)if(this.sheetInfo[s].index===e.sheetId){var a=this.sheetInfo[s].visibleName,l=this.sheetInfo[s].sheet,h=(this.sheetInfo.splice(s,1),e.sheetId.toString());this.sheetDeletion(l,h),this.calculateInstance.unregisterGridAsSheet(h,h),this.definedNamesDeletion(a);break}break;case"getReferenceError":e.refError=this.referenceError();break;case"getAlpha":e.col=_he(e.col);break;case"addCustomFunction":this.addCustomFunction(e.functionHandler,e.functionName,e.formulaDescription);break;case"computeExpression":e.calcValue=this.calculateInstance.computeExpression(e.formula,e.isFromComputeExpression);break;case"registerGridInCalc":this.calculateInstance.grid=e.sheetID;break;case"dependentCellsAvailable":case"checkFormulaAdded":o.isSheetMember&&!je(o.parentObjectToToken)&&(e.address=o.parentObjectToToken.get(e.sheetId)+e.address),"checkFormulaAdded"===n?e.added=this.calculateInstance.getFormulaInfoTable().has(e.address):e.isAvailable=this.calculateInstance.getDependentCells().has(e.address);break;case"calculateNow":this.calculateNow(e);break;case"ClearDependentCellCollection":this.calculateInstance.getDependentFormulaCells().clear(),this.calculateInstance.getDependentCells().clear(),this.calculateInstance.getFormulaInfoTable().clear()}},jhe.prototype.definedNamesDeletion=function(e){var t=this.parent.definedNames;if(t&&0<t.length)for(var i=t.length-1;0<=i;i--)t[i].refersTo.substring(1,t[i].refersTo.lastIndexOf("!")).split("'").join("")===e&&this.removeDefinedName(t[i].name,t[i].scope)},jhe.prototype.referenceError=function(){return this.calculateInstance.getErrorStrings()[yhe.Ref]},jhe.prototype.getSheetInfo=function(){return this.sheetInfo},jhe.prototype.addCustomFunction=function(e,t,i){this.calculateInstance.defineFunction(t,e,i)},jhe.prototype.updateSheetInfo=function(){var t=this;this.sheetInfo=[],this.parent.sheets.forEach(function(e){t.sheetInfo.push({visibleName:e.name,sheet:"Sheet"+e.id,index:e.id})})},jhe.prototype.getSheetRefUpdateOnDelete=function(){var r,s,a,l=this,e=this.calculateInstance.namedRanges;return e&&e.size&&(a=!0,r=Array.from(e.keys()),s=Array.from(e.values())),function(e,t){a&&!t.includes(e)&&(t=t.replace(/\w+/g,function(e){var t=r.indexOf(e);return-1!==t?(i=!0,s[t]):e}));for(var i,n=e.toUpperCase(),o=(t=t.toUpperCase()).indexOf(n);-1<o;)o=(t=t.split(("'"===t[o-1]&&"'"===t[o+n.length]?"'"+n+"'":n)+l.calculateInstance.sheetToken).join(l.referenceError())).indexOf(n);return{value:t,isNamedRange:i}}},jhe.prototype.sheetDeletion=function(i,n){var o,r,s,a=this,e=this.calculateInstance.getDependentCells(),l=this.calculateInstance.getSheetFamilyItem(n),h=this.getSheetRefUpdateOnDelete();e.forEach(function(e,t){e.forEach(function(e){je(o=a.calculateInstance.getFormulaInfoTable().get(e))||(s=h(i,o.formulaText)).value!==o.formulaText&&(r=e.slice(0,e.lastIndexOf(a.calculateInstance.sheetToken)+1),s.sheetId=l.tokenToParentObject.has(r)?Number(l.tokenToParentObject.get(r)):parseInt(e.split("!")[1],10)+1,a.updateDataContainer([a.calculateInstance.rowIndex(e)-1,a.calculateInstance.colIndex(e)-1],s),a.calculateInstance.refresh(o.getParsedFormula())),r=t.slice(0,t.lastIndexOf(a.calculateInstance.sheetToken)+1),n===(l.tokenToParentObject.has(r)?l.tokenToParentObject.get(r):t.split("!")[1])&&(a.calculateInstance.getFormulaInfoTable().delete(t),a.calculateInstance.clearFormulaDependentCells(t))})})},jhe.prototype.renameUpdation=function(e){function h(e){Poe(e.value1)&&e.value1.toUpperCase().includes(m)&&e.value1.match(f)&&(e.value1=e.value1.replace(f,u)),Poe(e.value2)&&e.value2.toUpperCase().includes(m)&&e.value2.match(f)&&(e.value2=e.value2.replace(f,u))}var d,p,c=this,u=e.value,g=e.pName,m=e.pName.toUpperCase(),e=new RegExp("[!@#$%^&()+=';,.{}|\\\":<>~_-]","g"),f=new RegExp(g.replace(e,"\\$&")+'(?=[\'!])(?=[^"]*(?:"[^"]*"[^"]*)*$)',"gi");this.sheetInfo.forEach(function(e,t){if((d=_re(c.parent,t))&&d.rows&&d.rows.length)for(var i=0,n=d.rows.length;i<n;i++)if(d.rows[i]&&d.rows[i].cells)for(var o=0,r=d.rows[i].cells.length;o<r;o++)(p=Kre(i,o,d,!1,!0)).formula&&Poe(p.formula)&&p.formula.toUpperCase().includes(m)&&p.formula.match(f)&&(p.formula=p.formula.replace(f,u)),p.validation&&h(p.validation);if(d&&d.columns&&d.columns.length)for(var s,i=0,a=d.columns.length;i<a;i++)(s=d.columns[i])&&s.validation&&h(s.validation);for(var l=c.parent.definedNames,i=0;i<l.length;i++)Poe(l[i].refersTo)&&l[i].refersTo.includes(g)&&l[i].refersTo.match(f)&&(l[i].refersTo=l[i].refersTo.replace(f,u),l[i].scope.includes(g))&&(l[i].scope=u);c.calculateInstance.updateNamedRange(g,u),e.visibleName===g&&(e.visibleName=u)})},jhe.prototype.updateDataContainer=function(e,t){for(var i,n,o,r=0,s=this.parent.sheets.length;r<s;r++)if((i=_re(this.parent,r)).id===t.sheetId){e[0]in i.rows?(n=i.rows[e[0]],e[1]in n.cells?((o=n.cells[e[1]]).formula=t.isNamedRange?o.formula:t.value,t.visible?r===this.parent.activeSheetIndex&&i.activeCell===lte(e[0],e[1])&&this.parent.notify(poe,{}):"Automatic"===this.parent.calculationMode&&(o.value=this.referenceError())):n.cells[e[1]]=o={}):(n=i.rows[e[0]]={})[e[1]]=o={};break}},jhe.prototype.parseSheetRef=function(e,t){for(var i,n,o,r,s,a,l=new RegExp("[!@#$%^&()+=';,.{}|\":<>~_-]","g"),h=0,d=this.getSheetInfo(),p=d.length,c=[],u=(c.length=0,'(?=[\'!])(?=[^"]*(?:"[^"]*"[^"]*)*$)'),g=RegExp,h=0;h<p;h++)if(d[h].sheet!==d[h].visibleName&&(i=new g(d[h].visibleName.replace(l,"\\$&")+u,"gi"),o=h,e.match(i))){for(var m=h+1;m<p;m++)d[m].visibleName.includes(d[h].visibleName)&&(n=new g(d[m].visibleName.replace(l,"\\$&")+u,"gi"),s=e.search(n),r=e.search(i),-1<s)&&(s<r||s===r&&d[m].visibleName.length>d[h].visibleName.length)&&(s=new RegExp("Sheet","gi"),0!==d[m].visibleName.search(s))&&(i=n,o=m);e=e.replace(i,o+"/"),c.push(o)}for(h=0;h<c.length;)i=new g(c[h]+"/"+u,"gi"),a=t?"`"+d[c[h]].sheet+"`":d[c[h]].sheet,e=e.replace(i,a),h++;return e},jhe.prototype.registerSheet=function(e,t){var i;for(void 0===e&&(e=0),void 0===t&&(t=this.parent.sheets.length);e<t;)i=_re(this.parent,e).id+"",this.calculateInstance.registerGridAsSheet(i,i,this.calcID),e++},jhe.prototype.unRegisterSheet=function(e,t,i){var n;if(void 0===e&&(e=0),void 0===t&&(t=this.parent.sheets.length),this.calculateInstance.tokenCount=0,i)this.calculateInstance.unregisterGridAsSheet(n,n,i);else for(;e<t;)n=_re(this.parent,e).id+"",this.calculateInstance.unregisterGridAsSheet(n,n),e++},jhe.prototype.getUniqueRange=function(e){e.range=this.calculateInstance.uniqueRange},jhe.prototype.removeUniquecol=function(e){if(e&&e.clearAll)this.clearAllUniqueFormulaValue();else for(var t=this.parent.getActiveSheet(),i=0;i<this.calculateInstance.uniqueRange.length;i++){var n=this.calculateInstance.uniqueRange[i].split(":")[0].split("!");if(n[0]===t.name&&n[1]===t.activeCell){var o=rte(this.calculateInstance.uniqueRange[i]);this.calculateInstance.uniqueRange.splice(i,1);for(var r=o[0];r<=o[2];r++)for(var s=o[1];s<=o[3];s++)Kre(r,s,this.parent.getActiveSheet()).formula="",this.parent.updateCellDetails({value:"",formula:""},hte([r,s]),void 0,void 0,!0)}}},jhe.prototype.refreshCalculate=function(e){e.sheet=je(e.sheetIndex)?this.parent.getActiveSheet():_re(this.parent,e.sheetIndex);var t=e.sheet.id+"",i=this.calculateInstance.getSheetFamilyItem(t),n=dte(e.colIndex+1)+(e.rowIndex+1);i.isSheetMember&&!je(i.parentObjectToToken)&&(n=i.parentObjectToToken.get(t)+n),e.isFormula?this.calculateFormula(e,n):(this.calculateInstance.getFormulaInfoTable().has(n)&&(this.calculateInstance.getFormulaInfoTable().delete(n),this.calculateInstance.clearFormulaDependentCells(n)),this.calculateInstance.refresh(n,null,null,null,e.isDelete,e.deletedRange),"Automatic"===this.parent.calculationMode&&this.calculateInstance.refreshRandValues(n)),this.calculateInstance.cell="",e.isFormulaDependent=this.calculateInstance.getDependentCells().has(n),e.value&&(e.value=e.value.toString().split("^+").join("^").split("&+").join("&"))},jhe.prototype.calculateFormula=function(i,e){var t=this,n=i.sheet,o=(this.autoCorrectFormula(i,n),i.value),r=(i.isClipboard&&o.toUpperCase().includes("UNIQUE")&&Jre(i.rowIndex,i.colIndex,n,{value:""},!0),o),o=this.parseSheetRef(o),o=new Hhe(i.rowIndex+1,i.colIndex+1,o),s=[n.usedRange.rowIndex,n.usedRange.colIndex],a=(this.calculateInstance.valueChanged(n.id.toString(),o,!0,s,i.isRefreshing,n.name,i.isRandomFormula,null,i.isDelete,i.deletedRange,i.isDependentRefresh,i.action),!0!==this.calculateInstance.isRandomVal||i.isRandomFormula||"Automatic"!==this.parent.calculationMode||this.refreshRandomFormula(),Kre(i.rowIndex,i.colIndex,n));if(a&&r&&!i.isDependentRefresh){o=void 0;if(0===(r=r.toUpperCase()).indexOf("=SUM(")?o="=SUM(":0===r.indexOf("=AVERAGE(")?o="=AVERAGE(":0===r.indexOf("=ROUNDDOWN(")?o="=ROUNDDOWN(":0===r.indexOf("=ROUNDUP(")?o="=ROUNDUP(":0===r.indexOf("=MOD(")&&(o="=MOD("),o){if((r=r.replace(o,"")).includes(")"))for(var r=r.slice(0,r.lastIndexOf(")")),l=void 0,h=void 0;r.includes("(")&&r.includes(")");)h=r.indexOf("("),l=r.slice(h+1),r=r.slice(0,h)+(l.includes(")")?l.slice(l.indexOf(")")+1):l);for(var d,p=r.split(this.calculateInstance.getParseArgumentSeparator()),c=void 0,u=void 0,g=void 0,m=void 0,f=void 0,y=this,h=0;h<p.length;h++)if("break"===function(e){if((d=p[e].split(":")[0]).includes("!")?(m=d.substring(0,d.lastIndexOf("!")).split("'").join(""),d=d.substring(d.lastIndexOf("!")+1)):m="",Boe(d)){u=m&&void 0!==(g=Bre(y.parent,m))?_re(y.parent,g):n,f=rte(d),c=Kre(f[0],f[1],u);var t=Yhe(a.format);if(c&&c.format&&(!a.format||!i.fillType&&["Number","Currency","LongDate","Time"].every(function(e){return t!==e})&&"Number"!==Yhe(c.format)))return a.format=c.format,"break"}}(h))break}else{var v,b,w,C,s=this.calculateInstance.getDependentFormulaCells().get(e);s&&s.size&&this.calculateInstance.getFormulaInfoTable().has(e)&&-1===this.calculateInstance.getFormulaInfoTable().get(e).getParsedFormula().lastIndexOf("q")&&!a.format&&(C=this.calculateInstance.getSheetFamilyItem(null,this.calcID),s.forEach(function(e){v||(b=e.slice(0,e.lastIndexOf("!")+1),Boe(e=e.replace(b,""))&&(w=rte(e),b=C.tokenToParentObject.has(b)&&void 0!==(b=Fre(t.parent,Number(C.tokenToParentObject.get(b))))?_re(t.parent,b):n,w=Kre(w[0],w[1],b))&&w.format&&(v=w.format))}),v)&&(a.format=v)}}},jhe.prototype.refreshRandomFormula=function(){var e=this.calculateInstance.randCollection;if(1<this.calculateInstance.randomValues.size&&this.calculateInstance.randomValues.size===e.length)for(var t=0;t<this.calculateInstance.randomValues.size;t++){var i=this.calculateInstance.rowIndex(e[t]),n=this.calculateInstance.colIndex(e[t]),o=this.calculateInstance.randomValues.get(e[t]),r=(parseFloat(this.calculateInstance.getSheetToken(e[t]).split(this.calculateInstance.sheetToken).join(""))+1).toString(),s=_re(this.parent,Fre(this.parent,Number(r)));s&&Kre(i-1,n-1,s).formula&&(s=new Hhe(i,n,o),this.calculateInstance.valueChanged(r,s,!0,void 0,void 0,void 0,!1,!0))}},jhe.prototype.autoCorrectFormula=function(e,t){if(!je(e.value)){var i=e.value,n=(2===(i=(i=this.autoCorrectCellRef({formula:e.value})).toString()).split("(").length&&i.indexOf(")")<0&&(i+=")"),void 0),o=(0===i.indexOf("=")&&(i=i.slice(1),n=!0),i.match(/</g)),r=i.match(/>/g),s=i.match(/=/g);if(o){for(var a="",l=0;l<o.length;l++)a+=o[l];i=i.replace(a,"<")}if(r){for(var h="",d=0;d<r.length;d++)h+=r[d];i=i.replace(h,">")}if(s){for(var p="",c=0;c<s.length;c++)p+=s[c];i=i.split(p).join("=")}i=n?"="+i:i,(o||r||s)&&(Kre(e.rowIndex,e.colIndex,t).formula=i),e.value=i}},jhe.prototype.correctCellReference=function(n){var o,r,s,a,l,h=this,d=n.split(":");return d.forEach(function(e,t){if(r=e.split("!"),n=r[1]||e,l=null,n.includes("&"))o=n.split("&"),h.calculateInstance.isCellReference(o[1].split("$").join(""))&&(o[1]=h.getUpdatedCellRef(o[1]),l=o.join("&"));else if(h.calculateInstance.isCellReference(n.split("$").join("")))l=h.getUpdatedCellRef(n),1<r.length&&(l=r[0]+"!"+l);else if(s=e.match(/[/+\-*^><>=<=<>]+/g)){o=e.split(s[0]);for(var i=0;i<o.length;i++)r=o[i].split("!"),n=r[1]||r[0],h.calculateInstance.isCellReference(n.split("$").join(""))&&(o[i]=h.getUpdatedCellRef(n),1<r.length)&&(o[i]=r[0]+"!"+o[i]);l=o.join(s[0])}l&&l!==e&&(a=!0,d[t]=l)}),{isInvalid:a,ref:d.join(":")}},jhe.prototype.autoCorrectCellRef=function(e){var t,i=e.formula.lastIndexOf(")");if(-1<i&&2===e.formula.split(")").length){for(var n=i-1;-1<n&&"("!==e.formula[n];){if(")"===e.formula[n])return e.formula;n--}if(-1<n){for(var i=e.formula.substring(n+1,i),o=this.calculateInstance.getParseArgumentSeparator(),r=i.split(o),s=void 0,a=0;a<r.length;a++)(t=this.correctCellReference(r[a])).isInvalid&&(s=!0,r[a]=t.ref);s&&(e.formula=e.formula.split(i).join(r.join(o)),e.isInvalid=!0)}}else e.formula.startsWith("=")&&!e.formula.includes(")")&&(t=this.correctCellReference(e.formula.substring(1,e.formula.length))).isInvalid&&(e.formula="="+t.ref,e.isInvalid=!0);return e.formula},jhe.prototype.getUpdatedCellRef=function(e){var t=e,i=0===(e=e.trim()).indexOf("$"),n=e.search(/[a-zA-Z]/),o=e.search(/\d/),n=i?n-1:n;return(i?1<o:0<o)&&mre(e.substring(o,e.length))?t:e.substring(n,e.length)+e.substring(0,n)},jhe.prototype.initiateDefinedNames=function(){for(var e=this.parent.definedNames,t=0;t<e.length;){var i,n=e[t],o=this.parseSheetRef(n.refersTo),r=cte(o),s=!1,o=-1<o.indexOf("http:")||-1<o.indexOf("https:");-1<(r=(r=r.split("$").join("")).split("=").join("")).indexOf(":")?(Boe((i=r.split(":"))[0])&&Boe(i[1])||i[0].match(/[0-9]/)&&i[1].match(/[0-9]/)||i[0].toUpperCase().match(/[A-Z]/)&&i[1].toUpperCase().match(/[A-Z]/))&&(s=!0):r.indexOf(":")<0&&Boe(r)&&(s=!0),(s=o?!1:s)?this.addDefinedName(n,!0,void 0,!0):(this.removeDefinedName(n.name,n.scope,!0),t--),t++}},jhe.prototype.addDefinedName=function(e,t,i,n){(void 0===i||i<-1)&&(i=this.parent.definedNames.length);var o=!0,r=e.name,s=(e.refersTo.indexOf("!")<0&&(s=-1!==(s=Wre(this.parent)).indexOf(" ")?"'"+s+"'":s,e.refersTo=s+"!"+(e.refersTo.indexOf("=")<0?e.refersTo:e.refersTo.split("=")[1])),e.refersTo),a=this.parseSheetRef(e.refersTo),l=(e.scope?-1<(l=Bre(this.parent,e.scope))&&(r=Wre(this.parent,l)+"!"+r):e.scope="Workbook",e.comment||(e.comment=""),!t&&this.checkIsNameExist(e.name,e.scope)?o=!1:(this.calculateInstance.addNamedRange(r,"="===a[0]?a.substr(1):a),"="!==a[0]&&(e.refersTo="="+s),this.parent.definedNames.indexOf(e)<0&&(this.parent.definedNames.splice(i,0,e),this.parent.notify(yse,{action:"setNameBoxValue",definedName:e}))),{name:e.name,scope:e.scope,comment:e.comment,refersTo:e.refersTo,cancel:!1});return n||this.parent.notify("actionComplete",{eventArgs:l,action:"addDefinedName"}),o},jhe.prototype.removeDefinedName=function(e,t,i){var n,o=!1,r=t||"Workbook",s=this.getIndexFromNameColl(e,r);return-1<s&&(n=e,t&&-1<(t=Bre(this.parent,t))&&(n=Wre(this.parent,t)+"!"+e),this.calculateInstance.removeNamedRange(n),t=this.parent.definedNames.splice(s,1),this.parent.notify(yse,{action:"setNameBoxValue",definedName:t[0],isRemove:!0}),i||this.parent.notify("actionComplete",{eventArgs:{name:e,scope:r,cancel:!1},action:"removeDefinedName"}),o=!0),o},jhe.prototype.checkIsNameExist=function(t,i){return this.parent.definedNames.some(function(e){return e.name===t&&(i?e.scope===i:""===e.scope)})},jhe.prototype.getIndexFromNameColl=function(i,n){void 0===n&&(n="");var o=-1;return this.parent.definedNames.filter(function(e,t){e.name===i&&e.scope===n&&(o=t)}),o},jhe.prototype.calculateNow=function(a){function o(){var e;--i||(t(),"Automatic"===h.parent.calculationMode&&"CalculateWorkbook"===a.scope&&h.parent.setProperties({calculationMode:"Manual"},!0),(e=h.parent.getActiveSheet()).conditionalFormats&&e.conditionalFormats.length&&h.parent.notify(_ne,{indexes:[],isAction:!0,refreshAll:!0,isEdit:!0}))}var l,h=this,e=new ll,t=(a.promise=e.promise,function(){var t,n,i,o,r={isRefreshing:!0,action:"calculate"},s=h.calculateInstance.getFormulaInfoTable();a.sheets.forEach(function(e){i=e.id.toString(),t=h.calculateInstance.getSheetFamilyItem(i),n=t.isSheetMember?t.parentObjectToToken.get(i):"",h.parent.setSheetPropertyOnMute(e,"isSheetCalculated",!0),(r.sheet=e).rows.forEach(function(e,i){r.rowIndex=i,e&&e.cells&&e.cells.forEach(function(e,t){e&&Poe(e.formula)&&(o=n+dte(t+1)+(i+1),void 0===e.value||null===e.value||!s.has(o)||l&&l[o])&&(r.colIndex=t,r.value=e.formula,h.calculateFormula(r,o))})})}),e.resolve(),h.calculateInstance.cell=""}),i=a.sheets.length;a.sheets.forEach(function(e){var t,i,n;e.ranges.some(function(e){return e.dataSource&&(!e.info||!e.info.loadedRange||!e.info.loadedRange.length)})?h.parent.notify(die,{sheet:e,autoDetectFormat:!0,loadFromStartCell:!0,updateDependentCellsCallback:(e=(e=e).id.toString(),t=h.calculateInstance.getSheetFamilyItem(e),i=t.isSheetMember?t.parentObjectToToken.get(e):"",l={},n=h.calculateInstance.getDependentCells(),function(e,t){e=i+lte(e,t);n.has(e)&&n.get(e).forEach(function(e){l[e]||(l[e]=!0)})}),loadComplete:o}):o()})},jhe.prototype.toFixed=function(e){var t=Number(e);return e=Math.round(t)!==t?t.toFixed(2):e},jhe.prototype.commputeFormulaValue=function(e){var t=this.parseSheetRef(e.value);e.value=this.calculateInstance.computeExpression(t).toString()},jhe.prototype.getCellRefValue=function(e){var t,i=this.getSheetInfo(),n=i.length,o=this.calculateInstance.sheetToken,r=e.value,s=r.lastIndexOf(o);if(-1!==s){var a=r.substring(0,s);0<a.length&&a[0]===this.calculateInstance.getFormulaCharacter()&&(a=a.substring(1,e.value.length));for(var l=0;l<n;l++)if(a.toUpperCase()===i[l].visibleName.toUpperCase()){t=l;break}e.value=this.calculateInstance.getValueFromArg(o+t+o+r.substring(s+1).toUpperCase())}else 0<r.length&&r[0]===this.calculateInstance.getFormulaCharacter()&&(e.value=this.calculateInstance.getValueFromArg(r.substring(1,e.value.length).toUpperCase()))},jhe.prototype.aggregateComputation=function(e){var t=this.parent.getActiveSheet(),i=Vre(t),n=rte(i.split(":")[1]),o=(n[0]+1===t.rowCount&&n[1]+1===t.colCount&&(i="A1:"+lte(t.usedRange.rowIndex,t.usedRange.colIndex)),this.calculateInstance.getCellCollection(i));for(l=0;l<o.length;l++)if(mre(d=this.calculateInstance.getValueFromArg(o[l]))){e.countOnly=!1;break}if(e.Count=this.calculateInstance.getFunction("COUNTA")(i,"isAggregate"),e.Count&&!e.countOnly){for(var r=["SUM","AVERAGE","MIN","MAX"],s=[],n=rte(t.activeCell),a=Kre(n[0],n[1],t,!1,!0),l=0;l<4;l++){var h,d=this.toFixed(this.calculateInstance.getFunction(r[l])(i,"isAggregate"));a.format&&(h={formattedText:d,value:d,format:a.format,cell:{value:d,format:a.format}},this.parent.notify(Aie,h),d=h.formattedText),s.push(d)}e.Sum=s[0],e.Avg=s[1],e.Min=s[2],e.Max=s[3]}},jhe.prototype.refreshInsertDelete=function(s){var e,a,l,h=this;"Sheet"!==s.modelType&&(e=this.calculateInstance.getDependentFormulaCells(),l=Fre(this.parent,s.sheet.id),this.parent.sheets.forEach(function(e,t){for(var i=0,n=e.usedRange.rowIndex;i<=n;i++)for(var o=0,r=e.usedRange.colIndex;o<=r;o++)(a=Kre(i,o,e,!1,!0)).formula&&Poe(a.formula)&&(t===l?!s.isInsert&&("Row"===s.modelType?i>=s.startIndex&&i<=s.endIndex:o>=s.startIndex&&o<=s.endIndex)||h.updateFormula(s,a,i,o,l):a.formula.includes(s.sheet.name)&&h.updateFormula(s,a,i,o,l,!0,e))}),e.clear(),this.calculateInstance.getDependentCells().clear(),this.calculateInstance.getFormulaInfoTable().clear(),this.refreshNamedRange(s))},jhe.prototype.getUpdatedFormulaOnInsertDelete=function(t){var e,i;t.sheetNames?(t.updateSheetRef||(t.updateSheetRef=this.getSheetRefUpdateOnDelete()),e=this.parseSheetRef(t.cell.formula,!1),i=e,t.sheetNames.forEach(function(e){i=t.updateSheetRef(e,i).value}),i!==e&&(t.cell.formula=i)):this.updateFormula(t.insertDeleteArgs,t.cell,t.row,t.col,t.sheetIdx,t.otherSheet,t.formulaSheet)},jhe.prototype.updateFormula=function(e,t,i,n,o,r,s){for(var a,l,h,d,p,c,u,g=new RegExp(/^(?=.*[a-zA-Z])(?=.*\d)/g),m=(t.formula&&t.formula.includes("UNIQUE")&&void 0!==i&&this.clearUniqueRange(i,n,s||e.sheet),this.parseFormulaArgument({formula:this.parseSheetRef(t.formula,!0),rangeRef:!0})),f=this.getSheetInfo(),y=!t.formula.includes(this.parent.listSeparator),v=0;v<m.length;v++)if(u=m[v].trim(),(c=u.includes("$"))&&(u=u.replace(/[$]/g,"")),h=!0,this.calculateInstance.isCellReference(u)){if(l=u.includes(":"),(a=v&&m[v-1].trim())&&"!"===a[a.length-1]){if((a=a.replace(/['!]/g,""))!==(f[o].sheet===f[o].visibleName?e.sheet.name:"`"+f[o].sheet+"`"))continue}else if(r)continue;!g.test(u)&&-1<u.indexOf(":")&&(h=!1,d=!!je(u.match(/[0-9]/))),a=fte(rte(u)),this.parent.updateRangeOnInsertDelete(e,a,l,i,n,c,y)&&(m[v]=a[2]<a[0]||a[3]<a[1]?this.calculateInstance.getErrorStrings()[yhe.Ref]:h?(u=void 0,u=(c?"$":"")+dte(a[1]+1)+(c?"$":"")+(a[0]+1),a[0]===a[2]&&a[1]===a[3]||(u+=":"+(c?"$":"")+dte(a[3]+1)+(c?"$":"")+(a[2]+1)),u):d?hte(a).replace(/\d/g,""):hte(a).replace(/[a-zA-Z]/g,""),p=!0)}var b,w,C="="+m.join("");p&&(w=RegExp,f.forEach(function(e){C.includes("`"+e.sheet+"`")&&(b=new w("`"+e.sheet+"`","gi"),C=C.replace(b,e.visibleName))}),t.formula!==C)&&(t.formula=C,"Manual"===this.parent.calculationMode&&(e.isInsert||e.isDelete)||(t.value=null))},jhe.prototype.clearUniqueRange=function(e,t,i){for(var e={cellIdx:[e,t,e,t],isUnique:!1,uniqueRange:"",sheetName:i.name},n=(this.parent.notify(Uie,e),rte(e.uniqueRange)),o=n[0];o<=n[2];o++)for(var r=n[1];r<=n[3];r++)delete Kre(o,r,i,!1,!0).value},jhe.prototype.clearAllUniqueFormulaValue=function(){for(var e=this.calculateInstance.uniqueRange,t=0;t<e.length;t++){var i,n=e[t].lastIndexOf("!"),o=_re(this.parent,Bre(this.parent,e[t].substring(0,n))),r=Kre((i=rte(e[t].substring(n+1)))[0],i[1],o);if(!r||"#SPILL!"!==r.value)for(var s=i[0];s<=i[2];s++)for(var a=i[1];a<=i[3];a++)(r=Kre(s,a,o))&&r.value&&delete r.value}},jhe.prototype.parseFormulaArgument=function(e){for(var t,i,n=0,o=[],r=this.markSpecialChar(e.formula.replace("=",""),e.rangeRef),s=RegExp,a=new s(e.rangeRef?/\(|\)|=|\^|>|<|\+|-|\*|\/|%|&/g:/\(|\)|=|\^|>|<|:|\+|-|\*|\/|%|&/g),l=new s(this.parent.listSeparator,"g"),h=(r=r.split(new s(a.source+"|"+l.source,"g"))).length;n<h;)(t=r[n])&&(1===t.length?o.push(this.isUniqueChar(t)?this.getUniqueCharVal(t):t):(i=t[0],0<t.indexOf("!")?(this.isUniqueChar(i)&&(o.push(this.getUniqueCharVal(i)),t=t.substr(1)),i=t.indexOf("!")+1,o.push(t.substring(0,i)),-1<(i=(t=t.substring(i)).indexOf(":"))&&t.indexOf("!")>i?(o.push(t.substring(0,i)),o.push(":"),i=(t=t.substring(i+1)).indexOf("!")+1,o.push(t.substring(0,i)),o.push(t.substring(i))):o.push(t)):this.isUniqueChar(i)?(o.push(this.getUniqueCharVal(i)),o.push(t.substr(1))):o.push(t))),n++;return e.formulaArr=o},jhe.prototype.getUniqueCharVal=function(e){switch(e){case this.uniqueOBracket:return"(";case this.uniqueCBracket:return")";case this.uniqueCSeparator:return this.parent.listSeparator;case this.uniqueCOperator:return":";case this.uniquePOperator:return"+";case this.uniqueSOperator:return"-";case this.uniqueMOperator:return"*";case this.uniqueDOperator:return"/";case this.uniqueModOperator:return"%";case this.uniqueConcateOperator:return"&";case this.uniqueEqualOperator:return"=";case this.uniqueExpOperator:return"^";case this.uniqueGTOperator:return">";case this.uniqueLTOperator:return"<"}return""},jhe.prototype.isUniqueChar=function(e){e=e.charCodeAt(e);return 129<=e&&e<=142},jhe.prototype.markSpecialChar=function(e,t){e=e.replace(/\(/g,"("+this.uniqueOBracket).replace(/\)/g,")"+this.uniqueCBracket);var i=RegExp;return(e=(e=(e=(e=(e=(e=(e=t?e.replace(new i(this.parent.listSeparator,"g"),this.parent.listSeparator+this.uniqueCSeparator):e.replace(new i(this.parent.listSeparator,"g"),this.parent.listSeparator+this.uniqueCSeparator).replace(/:/g,":"+this.uniqueCOperator)).replace(/\+/g,"+"+this.uniquePOperator).replace(/-/g,"-"+this.uniqueSOperator)).replace(/\*/g,"*"+this.uniqueMOperator).replace(/\//g,"/"+this.uniqueDOperator)).replace(/&/g,"&"+this.uniqueConcateOperator)).replace(/=/g,"="+this.uniqueEqualOperator)).replace(/\^/g,"^"+this.uniqueExpOperator)).replace(/>/g,">"+this.uniqueGTOperator).replace(/</g,"<"+this.uniqueLTOperator)).replace(/%/g,"%"+this.uniqueModOperator)},jhe.prototype.refreshNamedRange=function(e){var t=this;if(e.definedNames&&e.definedNames.length)e.definedNames.forEach(function(e){t.parent.removeDefinedName(e.name,e.scope),t.parent.addDefinedName(e)});else{var i=this.parent.definedNames.length;if(i)for(var n,o=Object.assign({},this.parent.definedNames),r=new RegExp(/^(?=.*[a-zA-Z])(?=.*\d)/g),s=0;s<i;s++){var a,l,h=!0,d=(a=o[s]).refersTo.lastIndexOf("!"),p=a.refersTo.substring(d+1);(l=(l=d=a.refersTo.substring(1,d)).match(/'/g)?l.slice(1,-1):l)===e.sheet.name&&(!r.test(p)&&-1<p.indexOf(":")&&(h=!1,n=!!je(p.match(/[0-9]/))),l=rte(p),p=this.parent.updateRangeOnInsertDelete(e,l),h=h?hte(l):n?hte(l).replace(/\d/g,""):hte(l).replace(/[a-zA-Z]/g,""),e.isInsert?this.updateDefinedNames(a,d,h,p):"Row"===e.modelType?this.updateDefinedNames(a,d,h,p,[l[0],l[2]],e):"Column"===e.modelType&&this.updateDefinedNames(a,d,h,p,[l[1],l[3]],e))}}},jhe.prototype.updateDefinedNames=function(e,t,i,n,o,r){if(n){var n=this.parent.definedNames.indexOf(e),s={action:"removeDefinedName",isRemoved:!1,definedName:e.name,scope:e.scope,isEventTrigger:!0};if(this.parent.notify(Pie,s),o){s={name:e.name,comment:e.comment,refersTo:e.refersTo,scope:e.scope},s=new Pte(this.parent,"definedNames",s,!0);if(r.definedNames?r.definedNames.push(s):r.definedNames=[s],o[1]<o[0])return}e.refersTo=t+"!"+i,this.parent.notify(Pie,{action:"addDefinedName",definedName:e,isAdded:!1,index:n,isEventTrigger:!0});r={name:e.name,scope:e.scope,comment:e.comment,refersTo:e.refersTo,cancel:!1};this.parent.notify("actionComplete",{eventArgs:r,action:"refreshNamedRange"})}},jhe);function jhe(e){this.uniqueOBracket=String.fromCharCode(129),this.uniqueCBracket=String.fromCharCode(130),this.uniqueCSeparator=String.fromCharCode(131),this.uniqueCOperator=String.fromCharCode(132),this.uniquePOperator=String.fromCharCode(133),this.uniqueSOperator=String.fromCharCode(134),this.uniqueMOperator=String.fromCharCode(135),this.uniqueDOperator=String.fromCharCode(136),this.uniqueModOperator=String.fromCharCode(137),this.uniqueConcateOperator=String.fromCharCode(138),this.uniqueEqualOperator=String.fromCharCode(139),this.uniqueExpOperator=String.fromCharCode(140),this.uniqueGTOperator=String.fromCharCode(141),this.uniqueLTOperator=String.fromCharCode(142),this.sheetInfo=[],this.parent=e,this.init()}qhe.prototype.numberFormatting=function(e){var t,i,n,o=this.parent.activeSheetIndex,r=!0,s=(e.range&&-1<e.range.indexOf("!")&&(r=(o=Bre(this.parent,e.range.substring(0,e.range.lastIndexOf("!"))))===this.parent.activeSheetIndex),_re(this.parent,o)),a=fte(rte(e.range?-1<e.range.lastIndexOf("!")?e.range.substring(e.range.lastIndexOf("!")+1):e.range:s.selectedRange));e.curSym=ki(this.parent.locale,oe);for(var l=a[0];l<=a[2];l++)for(var h=_de(s,l),d=r&&!zde(s,l),p=a[1];p<=a[3];p++)n=(i=Kre(l,p,s,!1,!0)).format,sre(i,s.columns[p],h)||Yoe(this.parent,s,{cell:{format:e.format},rowIdx:l,colIdx:p})||((i=Kre(l,p,s)).rowSpan<0||i.colSpan<0||(t={value:i.value,format:i.format,rowIndex:l,colIndex:p,sheetIndex:o,cell:i,refresh:r,curSymbol:e.curSym},this.getFormattedCell(t),d&&(this.setCell(t),t.td&&(this.parent.notify(Iie,t),!i.wrap||h&&h.customHeight||n===e.format||this.parent.notify(sne,{range:[l,p,l,p],wrap:!0,sheet:s,initial:!0,td:t.td,isOtherAction:!0})),n)&&n!==e.format&&n.includes("[")&&-1===tse().indexOf(ese(e.format))&&this.removeFormatColor(t,{format:n,style:i.style})),this.parent.setUsedRange(l,p));s.conditionalFormats&&s.conditionalFormats.length&&this.parent.notify(_ne,{indexes:a,isAction:!0,isEdit:!0}),this.parent.chartColl&&this.parent.chartColl.length&&this.parent.notify(Gne,{range:a})},qhe.prototype.isDigitPlaceHolder=function(e){return"#"===e||"0"===e||"?"===e||"."===e},qhe.prototype.parseToLocalizedFormat=function(e){if(e.decimalGroupSepsChanged&&(e.format.includes(".")||e.format.includes(","))){for(var t,i,n=void 0,o=e.format.split(""),r=0;r<o.length;r++)'"'===(t=o[r])?-1<(n=e.format.indexOf('"',r+1))&&(r=n):"_"===t||"*"===t||"\\"===t?r++:"["===t?-1<(n=e.format.indexOf("]",r+1))&&(r=n):","===t?this.isDigitPlaceHolder(o[r-1])&&(o[r]=this.localeObj.group):"."!==t||o[r-1]&&(i=o[r-1].toLowerCase(),["d","m","y","h"].some(function(e){return i===e}))||(o[r]=this.localeObj.decimal);e.format=o.join("")}e.curChanged&&e.format.includes('"'+e.curSym+'"')&&(e.format=e.format.split('"'+e.curSym+'"').join(e.curSym))},qhe.prototype.updateLocalizedFormats=function(e,t){for(var r,i,n,o=this,s=(Qhe={currency:["$#,##0.00","$#,##0","$#,##0_);($#,##0)","$#,##0_);[Red]($#,##0)","$#,##0.00_);($#,##0.00)","$#,##0.00_);[Red]($#,##0.00)"],accounting:['_($* #,##0_);_($* (#,##0);_($* "-"_);_(@_)','_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)','_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)','_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'],time:e.timeFormats&&"HH:mm:ss"===e.timeFormats.medium?"HH:mm:ss":"h:mm:ss AM/PM"},ki(this.parent.locale,oe)),a={curChanged:"$"!==s,curSym:s,decimalGroupSepsChanged:"."!==this.localeObj.decimal&&","!==this.localeObj.group},e=(a.curChanged&&((e=new Ti(this.parent.locale).getNumberPattern({currency:"$",useGrouping:!0,format:"c0"},!0))&&e.endsWith("$")?(r=e[e.indexOf("$")-1].trim().length?"":" ",Qhe.currency.forEach(function(e,t){if(e.includes("$#,##0")){var i="",n=e.split("$#,##0.")[1];if(n)for(var o=0;"0"===n[o];)i+="0",o++;Qhe.currency[t]=e.split("$#,##0"+(i=i&&"."+i)).join("#,##0"+i+r+'"'+s+'"')}}),Qhe.accounting.forEach(function(e,t){var i,n;e.slice(0,e.indexOf("#")).includes("$")&&((i=e.split(";")).forEach(function(e,t){e.includes("$")&&(e=e.replace("$",""),0<(n=e.includes("0)")?e.indexOf("0)")+2:e.lastIndexOf(e.includes("0")?"0":e.includes("?")?"?":e.includes('"-"')?'"':"#")+1))&&(i[t]=e.slice(0,n)+r+'"'+s+'"'+e.slice(n))}),Qhe.accounting[t]=i.join(";"))})):(Qhe.currency.forEach(e=function(e,t,i){return i[t]=e.split("$").join('"'+s+'"')}),Qhe.accounting.forEach(e))),["General","0","0.00","#,##0","#,##0.00","#,##0_);(#,##0)","#,##0_);[Red](#,##0)","#,##0.00_);(#,##0.00)","#,##0.00_);[Red](#,##0.00)",Qhe.currency[2],Qhe.currency[3],Qhe.currency[4],Qhe.currency[5],"0%","0.00%","0.00E+00","##0.0E+0","# ?/?","# ??/??","m/d/yyyy","d-mmm-yy","d-mmm","mmm-yy","h:mm AM/PM","h:mm:ss AM/PM","h:mm","h:mm:ss","m/d/yyyy h:mm","mm:ss","mm:ss.0","@","[h]:mm:ss"].concat(Qhe.accounting)),l=(t?(t=this.customFormats).splice.apply(t,[0,e.length].concat(e)):(this.customFormats=e,this.localizedFormats=[]),[0,1,2,3,4,37,38,39,40,5,6,7,8,9,10,11,48,12,13,14,15,16,17,18,19,20,21,22,45,47,49,46,42,41,44,43]),h=(l.forEach(function(e,t){Whe&&Whe.has(e)&&(o.customFormats[t]=Whe.get(e),-1<(i=[5,6,7,8].indexOf(e))?Qhe.currency[i+2]=o.customFormats[t]:-1<(i=[42,41,44,43].indexOf(e))&&(Qhe.accounting[i]=o.customFormats[t])),a.format=o.customFormats[t],o.parseToLocalizedFormat(a),o.localizedFormats[t]=a.format}),this),d=l.length;d<this.localizedFormats.length;d++)!function(i){-1<h.localizedFormats.findIndex(function(e,t){return e===o.localizedFormats[i]&&t<l.length})&&(h.localizedFormats.splice(i,1),h.customFormats.splice(i,1),i--),n=i}(d),d=n},qhe.prototype.localizedFormatAction=function(e){"getLocalizedFormats"===e.action?(e.defaultFormats=this.customFormats,e.localizedFormats=this.localizedFormats):"mapNumberFormatId"===e.action?this.updateLocalizedFormats(ce.getDependables(Ai,this.parent.locale,null).dateObject,!0):(e.curSym=ki(this.parent.locale,oe),"parseToDefaultFormat"===e.action?this.parseToDefaultFormat(e):(e.decimalGroupSepsChanged="."!==this.localeObj.decimal&&","!==this.localeObj.group,e.curChanged="$"!==e.curSym,e.defaultFormat||(e.defaultFormat=e.format,this.parseToLocalizedFormat(e)),-1===this.localizedFormats.indexOf(e.format)&&(this.localizedFormats.push(e.format),this.customFormats.push(e.defaultFormat))))},qhe.prototype.parseToDefaultFormat=function(o){var r,s,a,l,h=this,d="."!==this.localeObj.decimal&&o.format.includes(this.localeObj.decimal),p=","!==this.localeObj.group&&o.format.includes(this.localeObj.group),c="$"!==o.curSym&&o.format.includes(o.curSym);(d||p||c)&&((l=o.format.split(";")).forEach(function(e,t){for(var i=e.split(""),n=0;n<i.length;n++)'"'===(a=i[n])?n=e.indexOf('"',n+1):"_"===a||"*"===a||"\\"===a?n++:"["===a?-1<(r=e.indexOf("]",n+1))&&(n=r):d&&a===h.localeObj.decimal?(s=i[n-1])&&(s=s.toLowerCase(),["d","m","y","h"].some(function(e){return s===e}))||(i[n]="."):p&&a===h.localeObj.group?h.isDigitPlaceHolder(i[n-1])&&(i[n]=","):c&&(a===o.curSym?i[n]='"'+o.curSym+'"':o.curSym.startsWith(a)&&e.substring(n,n+o.curSym.length)===o.curSym&&i.splice(n,o.curSym.length,'"'+o.curSym+'"'));l[t]=i.join("")}),o.format=l.join(";"))},qhe.prototype.getFormattedCell=function(e){var t,i,n,o,r,s,a=void 0===e.value||null===e.value?"":e.value,l=(e.sheetIndex=void 0===e.sheetIndex?this.parent.activeSheetIndex:e.sheetIndex,_re(this.parent,e.sheetIndex)),h=e.cell||Kre(e.rowIndex,e.colIndex,l,!1,!0),d=!1,p=new Ti;return e.curSymbol||(e.curSymbol=ki(this.parent.locale,oe)),e.format&&"General"!==e.format||e.skipFormatCheck||h.formula&&h.formula.toLowerCase().startsWith("=text(")?(e.type=Yhe(e.format),e.skipFormatCheck&&!e.format&&"General"===e.type&&(e.format="General")):(e.type=e.format="General",(!h.formula||h.formula&&-1===h.formula.indexOf("&-"))&&(t={value:a,updatedVal:a,cell:h,isEdit:e.isEdit,intl:p},this.checkDateFormat(t),t.isDate||t.isTime)&&(d=!0,h.value=e.value=t.updatedVal,h.format&&"General"!==h.format?(e.format=h.format,e.type=Yhe(e.format)):h.format=e.format=Ghe(t.isDate?"ShortDate":"Time"))),h.format&&this.isCustomType(h)?(e.type="Custom",t=-1<h.format.indexOf("@"),i=void(""!==a&&!t&&this.isPercentageValue(a.toString(),e,h)&&(a=e.value.toString())),o={},Whe&&nre(this.parent)&&(h.format=e.format=this.getMatchingCustomFormat(h.format)),s=h.format,h.format=h.format.split("\\").join(""),ise((r=h.format.split(";"))[0],!0,o,!0)?(""!==a&&(e.result=this.processCustomDateTime(e,h,"time"!==o.type,r),i=!e.formatApplied),e.result=e.result||h.value):1<r.length?(-1<h.format.indexOf("<")||-1<h.format.indexOf(">")?e.result=this.processCustomConditions(h,e):i=(n=Moe(h,this.parent.locale,this.localeObj.group,this.localeObj.decimal,e.curSymbol)).isNumber?(h.value=n.value,this.processCustomAccounting(h,e,r,r[0]),!1):(e.result=this.processCustomText(h,e,r),!0),h.format=s):t?(i=!0,e.result=this.processCustomText(h,e)):(n=Moe({value:a},this.parent.locale,this.localeObj.group,this.localeObj.decimal)).isNumber?(h.value=e.value=n.value,h.format.includes("E+0")?(e.format!==h.format&&(e.format=h.format),this.checkAndSetColor(e),r=(o=e.format.split("E")[0]).split("."),"."!==this.localeObj.decimal&&1===r.length&&(r=o.split(this.localeObj.decimal)),e.result=1<r[0].length?this.scientificHashFormat(e,r):this.scientificFormat(e)):(e.result=this.processCustomNumberFormat(h,e),i=!mre(h.value))):(h.format&&h.format.includes("[")&&this.removeFormatColor(e,{format:h.format,style:h.style}),i=e.dataUpdate=!0),e.dataUpdate?e.formattedText=e.result||(je(e.value)?"":e.value.toString()):(e.value=e.result,e.formattedText=je(e.value)?"":e.value.toString()),e.isRightAlign=!i&&!je(e.value)):(s=this.processFormats(e,a,d,h,p,l),e.formattedText=s.fResult||(void 0===e.value||null===e.value?"":e.value.toString()),e.isRightAlign=s.rightAlign),void 0!==e.rowIndex&&(h.format&&e.formattedText&&e.formattedText!==h.value&&"General"!==h.format?h.formattedText=e.formattedText:h.formattedText&&delete h.formattedText),e.formattedText},qhe.prototype.isCustomType=function(e){var t=Yhe(e.format);return"General"===t&&"General"!==e.format||"Time"===t&&this.parent.isEdit},qhe.prototype.processCustomFill=function(e,t,i,n){var o,r,s=e[e.indexOf("*")+1],e=e.split("*"+s);return n=void 0===i.rowIndex||i.dataUpdate?n||this.processCustomNumberFormat({format:e.join(""),value:t.value},i):(o=void 0,e[1]?(n=(r=parseFloat(t.value))<0?(o=this.processCustomNumberFormat({format:e[1],value:Math.abs(r).toString()},i),"-"+e[0].split("'").join("")):(o=this.processCustomNumberFormat({format:e[1],value:t.value},i),e[0].split("'").join("")),0===r&&(o=o.split("0").join(""))):n=n||this.processCustomNumberFormat({format:e[0],value:t.value},i),i.isRowFill=!0,this.setCell(i),this.parent.notify(aoe,{cell:t,cellEle:i.td,rowIdx:i.rowIndex,colIdx:i.colIndex,beforeFillText:n,repeatChar:s,afterFillText:o}),this.parent.isPrintingProcessing?n+o:n)},qhe.prototype.processCustomDateTime=function(r,s,a,e){var l,t,i,h=this;"."!==this.localeObj.decimal&&s.value&&s.value.toString().includes(this.localeObj.decimal)&&mre(o=s.value.replace(this.localeObj.decimal,"."))&&(s.value=r.value=o);if(mre(s.value)){if(1<e.length&&parseFloat(s.value)<=0&&(r.formatApplied=this.processCustomAccounting(s,r,e),r.formatApplied))return r.result}else if(i=s.value.toString(),!(l=!!(i.includes(h.localeObj.dateSeparator)||0<i.indexOf("-")||i.includes(h.localeObj.timeSeparator))||(o=ce.getDependables(Ai,h.parent.locale,null).dateObject,(t=o.months["stand-alone"]&&o.months["stand-alone"].abbreviated)&&!!Object.keys(t).find(function(e){return i.includes(t[""+e])}))))return this.processCustomText(s,r,e);function n(e){var t;if(l){var i,n=void 0;if(s.format.includes("[h]")&&1<(i=s.value.toString().split(":")).length&&24<=Number(i[0])&&(n=Number(i[0])/24,i[0]="24",s.value=i.join(":")),t=(i=yre(s.value,new Ti,h.parent.locale,d,s)).dateObj&&"Invalid Date"!==i.dateObj.toString()){if(i.dateObj.getFullYear()<1900)return"";var o=ure(i.dateObj,s.value.toString().includes(":"),"time"===i.type);1<=n&&(i.dateObj=cre(o+=n)),s.value=o.toString()}}else{if(h.checkAndProcessNegativeValue(r,s.value))return r.formatApplied=!0,r.formattedText;t=(i={dateObj:cre(parseFloat(s.value))}).dateObj&&"Invalid Date"!==i.dateObj.toString()}return t?(e&&a&&(r.dateObj=i.dateObj),r.formatApplied=!0,n=void 0,d.startsWith("MM-dd-yyyy ")?(d=d.split(" ").splice(1).join(" "),n=p.formatDate(i.dateObj,{type:"date",skeleton:"yMd"})+(d?" "+p.formatDate(i.dateObj,{type:g,format:d}):"")):(n=p.formatDate(i.dateObj,{type:g,format:d}),(d=d.toLowerCase()).startsWith("[h]")?n=(24*Number(s.value.toString().split(".")[0])+i.dateObj.getHours()).toString()+n.slice(n.indexOf("]")+1):d.startsWith("[m")?n=(1440*Number(s.value.toString().split(".")[0])+60*i.dateObj.getHours()+i.dateObj.getMinutes()).toString()+n.slice(n.indexOf("]")+1):d.startsWith("[s")&&(n=(86400*Number(s.value.toString().split(".")[0])+60*(60*i.dateObj.getHours()+i.dateObj.getMinutes())+i.dateObj.getSeconds()).toString())),c?n.replace(h.localeObj.am,"A").replace(h.localeObj.pm,"P"):n):""}var o,d=e[0],p=new Ti,c=(d=d.split("_(").join(" ").split("_)").join(" "),-1<s.format.indexOf("h")&&(d=d.split("h").join("H"),g="time"),-1<s.format.indexOf("s")&&(g="time"),-1<s.format.indexOf("A/P"));if((-1<s.format.indexOf("AM/PM")||c)&&(d=(d=d.split("H").join("h")).split("A/P").join("AM/PM").split("AM/PM").join("a"),g="time"),-1<s.format.indexOf("d")){for(var u,g="date",m=d.split(" "),f=void 0,y=void 0,v=0;v<m.length;v++){for(var b=m[v].includes(this.localeObj.dateSeparator)?this.localeObj.dateSeparator:"-",f=m[v].split(b),w=0;w<f.length;w++)(u=(y=f[w]).match(/d/g))&&2<u.length&&(f[w]=y.split("d").join("E"));m[v]=f.join(b)}d=m.join(" ")}if(-1<s.format.indexOf("m"))if(-1<s.format.indexOf("s")||-1<s.format.indexOf("h"))g="time",s.format.includes(" ")&&((m=d.split(" "))[0].includes("d")||m[0].includes("y"))&&(m[0]=m[0].split("m").join("M"),d=m.join(" "));else if(g="date",(d=d.split("m").join("M")).includes("MMMMM"))return o=d,d="MMMM",e=n()[0],d=o.split("MMMMM").join("p"),n(r.checkDate).split("p").join(e);return n(r.checkDate)},qhe.prototype.processCustomConditions=function(e,t){if(mre(e.value)){for(var i=e.format.split(";"),n=Number(e.value),o=void 0,r=void 0,s=0;s<i.length;s++){if(e.format=i[s],(a=ese(e.format))&&(e.format=e.format.split("["+a+"]").join("")),!e.format.includes("[")){e.format=i[s],r=!1;break}var a=(o=e.format.split("[")[1].split("]")[0]).split("<="),l=o.split(">="),h=o.split("<"),d=o.split(">");if(2===a.length&&n<=Number(a[1])||2===l.length&&n>=Number(l[1])||2===h.length&&n<Number(h[1])||2===d.length&&n>Number(d[1])){e.format=i[s].split("["+o+"]").join(""),r=!1;break}r=2===o.split(/<=|>=|<|>/).length}return r?(this.removeFormatColor(t,{format:i.join(""),style:e.style}),this.processCustomFill("*#",e,t,"#####")):this.processCustomNumberFormat(e,t)}return e.value},qhe.prototype.processCustomAccounting=function(e,t,i,n){var o=parseFloat(e.value);return o<0?i[1].includes("@")||(n=i[1]):0===o&&i[2]&&!i[2].includes("@")&&(n=i[2].includes(t.curSymbol+"0")?i[2].split("0").join("#"):i[2]),!!n&&(t.result=this.processCustomNumberFormat({format:e.format,value:o<0?Math.abs(o).toString():e.value,style:e.style},t,n),!0)},qhe.prototype.processCustomText=function(e,t,i){var n,o=e.value||e.value?e.value.toString():"";if(i)if(i[3])n=i[3];else{if(!i[1]||!i[1].includes("@"))return o;n=i[1]}else n=e.format;i=this.processCustomNumberFormat({format:n.split("@").join("#"),value:o.split(o).join("1")},t);return i=i&&(i=i.split("1").join(o),"."!==this.localeObj.decimal)&&mre(i)&&i.includes(".")?i.replace(".",this.localeObj.decimal):i},qhe.prototype.thousandSeparator=function(e,t){for(;e;)t/=1e3,e--;return t},qhe.prototype.getSeparatorCount=function(e){for(var t=0,i=["#","0"],n=0;n<e.format.length;n++)'"'===e.format[n]&&"\\"!==e.format[n-1]?n=e.format.indexOf('"',n+1):","!==e.format[n]||-1<i.indexOf(e.format[n+1])||t++;return t},qhe.prototype.processDigits=function(e,t){t=t.split("?").join("0");var i=e.value.toString();return(i=(i=this.getFormattedNumber(t,parseFloat(i)))&&i.includes(this.localeObj.decimal)?(t=i.split(this.localeObj.decimal))[0]+this.localeObj.decimal+t[1].split("0").join("  "):i)||e.value},qhe.prototype.processFormatWithSpace=function(e,t,i){for(var n,o={cell:t,char:" ",width:0},r=(this.parent.notify(loe,o),o.width),t={format:e,formattedText:""},s=0;s<e.length;s++)"_"===e[s]&&(o.char=e[s+1],this.parent.notify(loe,o),n=o.width,n=Math.round(n/r),e=e.replace(e[s]+e[s+1]," ".repeat(n)));var a=e.length-e.trim().length;if(0<a){if(t.formattedText=this.getFormattedNumber(e.trim(),i)," "===e[0]){for(var l=1,h=1;" "===e[h];)l++,h++;a-=l,t.formattedText=" ".repeat(l)+t.formattedText}t.formattedText+=" ".repeat(a)}else t.formattedText=this.getFormattedNumber(e,i);return t.format=e,t},qhe.prototype.removeFormatColor=function(e,t){-1<tse().indexOf(ese(t.format))&&(e.color=t.style&&t.style.color?t.style.color:"",this.applyColor(e))},qhe.prototype.processCustomNumberFormat=function(e,t,i){var n,o,r,s,a,l;return e.format?(s=e.value,(o=Moe(e,this.parent.locale,this.localeObj.group,this.localeObj.decimal)).isNumber&&(n=r=void 0,e.value=o.value,o=parseFloat(e.value.toString()),i=i||e.format,-1<e.format.indexOf("[")&&((a=ese(i))?(i=i.split("["+a+"]").join(""),t.color=a.toLowerCase(),this.applyColor(t)):this.removeFormatColor(t,e)),(-1<i.indexOf('"')||-1<i.indexOf("\\"))&&(i=this.processText(i),n=0===o&&!i.includes("#")&&!i.includes("0"))&&(i+="#"),(a=this.getSeparatorCount(e))&&(r=!0,l=this.thousandSeparator(a,o),-1===i.indexOf(".")&&(l=Math.round(l)),s=this.getFormattedNumber(i.split(",").join(""),l),0===l)&&(s=s.replace("0","")),-1<i.indexOf("?")&&(r=!0,s=this.processDigits(e,i),i=i.split("?").join("")),-1<i.indexOf("_")&&(r=!0,i=(l=this.processFormatWithSpace(i,e,o)).format,s=l.formattedText),s&&-1<i.indexOf("?")&&(s=s.replace("?"," ")),-1<i.indexOf("*")&&(r=!0,s=this.processCustomFill(i,e,t)),"General"===i&&(r=!0,s=o.toString()),r||(s=this.getFormattedNumber(i,o)),n&&(s=s&&s.replace("0","")),"#"===i[0]&&0<=o&&o<1&&((a=i.split("#").join("").split("."))[0].includes("0")||((l=(s=0!==o||!i.includes(".")||a[1]&&a[1].includes("0")?s:(s=this.getFormattedNumber(i,.1)).replace("1","")).split(this.localeObj.decimal))[0]=l[0].toString().replace(/^0+/,""),s=l.join(this.localeObj.decimal))),"-0"===s)?"0":s):""},qhe.prototype.processText=function(e){return-1<e.indexOf('"')?e=e.split('"').join("'"):-1<e.indexOf("\\")&&(e=e.split("\\").join("")),e},qhe.prototype.processFormats=function(e,t,i,n,o,r){var s;if(this.parent.isEdit&&"Scientific"===e.type&&!mre(e.value)&&(e.type="General"),""!==t){var a=void 0;switch("General"!==e.type&&"Text"!==e.type&&this.isPercentageValue(t.toString(),e,n)&&(t=e.value.toString()),e.type){case"General":(s={args:e,fResult:t,intl:o,isRightAlign:i,cell:n,rowIdx:Number(e.rowIndex),colIdx:Number(e.colIndex),sheet:r}).fResult.toString().startsWith("\n")||s.fResult.toString().endsWith("\n ")||this.autoDetectGeneralFormat(s),t=s.fResult,i=s.isRightAlign;break;case"Number":(a=Moe({value:t},this.parent.locale,this.localeObj.group,this.localeObj.decimal,e.curSymbol,!0,!0)).isNumber&&(n.value=e.value=a.value,t=this.applyNumberFormat(e,o),i=!0);break;case"Currency":(a=Moe({value:t,format:e.format},this.parent.locale,this.localeObj.group,this.localeObj.decimal,e.curSymbol)).isNumber&&(n.value=e.value=a.value,t=this.currencyFormat(e,o,n),i=!0);break;case"Percentage":(a=Moe({value:t},this.parent.locale,this.localeObj.group,this.localeObj.decimal,e.curSymbol,!0,!0)).isNumber&&(n.value=e.value=a.value,t=this.percentageFormat(e,o),i=!0);break;case"Accounting":t=this.accountingFormat(e,t,o,n),i=e.formatApplied;break;case"ShortDate":i=!!(t=this.checkAndProcessNegativeValue(e,e.value)?e.formattedText:this.shortDateFormat(e,o,n));break;case"LongDate":i=!!(t=this.checkAndProcessNegativeValue(e,e.value)?e.formattedText:this.longDateFormat(e,o));break;case"Time":i=!!(t=this.checkAndProcessNegativeValue(e,e.value)?e.formattedText:this.timeFormat(e,o,n));break;case"Fraction":(a=Moe({value:t},this.parent.locale,this.localeObj.group,this.localeObj.decimal,null,!0)).isNumber&&(n.value=e.value=a.value,t=this.fractionFormat(e),i=!0);break;case"Scientific":(a=Moe({value:t},this.parent.locale,this.localeObj.group,this.localeObj.decimal)).isNumber&&(n.value=e.value=a.value,t=this.scientificFormat(e),i=!0);break;case"Text":"."!==this.localeObj.decimal&&mre(t)&&t.toString().includes(".")&&(t=t.toString().replace(".",this.localeObj.decimal)),i=!1}}return{fResult:t,rightAlign:i}},qhe.prototype.autoDetectGeneralFormat=function(e){var t,i,n=e.fResult,o=e.args.cell&&e.args.cell.formula&&0<e.args.cell.formula.indexOf("ADDRESS("),r=e.args.cell&&e.args.cell.formula&&0<e.args.cell.formula.indexOf("DOLLAR("),s=e.args.cell&&e.args.cell.formula&&0<e.args.cell.formula.indexOf("TEXT(");r&&e.fResult&&e.fResult.toString().includes(e.args.curSymbol)||s||(e.fResult&&"."!==this.localeObj.decimal&&(t=i=e.fResult.toString(),i.includes(this.localeObj.decimal))&&mre(i=i.replace(this.localeObj.decimal,"."))&&(i.includes("E")?e.fResult=i:(e.fResult=e.args.value=i=Number(i).toString(),Jre(e.rowIdx,e.colIdx,e.sheet,{value:i},!0)),t=i.replace(".",this.localeObj.decimal)),mre(e.fResult)&&(i=Number(e.fResult).toString(),e.fResult.toString().includes("E")?(e.args.format=Ghe("Scientific"),Jre(e.rowIdx,e.colIdx,e.sheet,{value:i,format:e.args.format},!0),e.args.value=i,e.fResult=this.scientificFormat(e.args)):e.args.format&&(-1<e.args.format.indexOf("%")?e.fResult=this.percentageFormat(e.args,e.intl):-1<e.args.format.indexOf(e.args.curSymbol)?e.fResult=this.currencyFormat(e.args,e.intl,e.args.cell):e.fResult=this.applyNumberFormat(e.args,e.intl)),"General"===e.args.format&&(e.args.cell&&e.args.cell.formula&&i.includes(".")&&11<i.length&&(r=i.indexOf(".")+1,t=null,e.args.cell.formula.includes("RANDBETWEEN"))&&(e.fResult=i=r<7?i:parseFloat(i).toFixed(0)),e.cellVal=i,e.prevVal=t,this.parseDecimalNumber(e),je(e.fResult))&&!je(e.cellVal)&&(e.fResult=e.cellVal),e.isRightAlign=!0),e.fResult&&this.updateAutoDetectNumberFormat(e),o&&(e.isRightAlign=!1,e.fResult=n))},qhe.prototype.parseDecimalNumber=function(e){var t,i=e.cellVal.split(".");11<i[0].length?(e.cellVal=Math.abs(Number(i[0])).toString().substring(0,6).replace(/0+$/,""),-1<(t=e.cellVal.length-1)&&(e.fResult=this.scientificFormat(e.args,5<t?5:t))):i[1]&&(11<e.cellVal.length?(i=10-(i[0].length-(Math.sign(Number(e.cellVal))<0?1:0)),e.fResult=Number(Number(e.cellVal).toFixed(0<i?i:0)).toString()):e.cellVal.includes("e-")?(i=e.cellVal.split("e-"),t=Number(i[1])+(i[0].includes(".")?i[0].split(".")[1].length:0),i[0]=i[0].replace(".",this.localeObj.decimal),1===i[1].length&&(i[1]="0"+i[1]),e.args.updateValue||Jre(e.rowIdx,e.colIdx,e.sheet,{value:Number(e.cellVal).toFixed(t)},!0),e.fResult=i.join("E-")):e.prevVal?e.fResult=e.prevVal:e.args.updateValue&&"."!==this.localeObj.decimal&&(e.fResult=e.cellVal.replace(".",this.localeObj.decimal)))},qhe.prototype.updateAutoDetectNumberFormat=function(e){var t=e.fResult.toString(),i=e.args.cell||e.cell;if(this.isPercentageValue(t,e.args,i))i.format=t.includes(this.localeObj.decimal)?Ghe("Percentage"):"0%",e.args.updateValue||(e.args.format=i.format,e.fResult=this.percentageFormat(e.args,e.intl),e.isRightAlign=!0);else{var n=t?t.toString().split("/"):[],o=this.parent.isEdit&&"Scientific"===Yhe(i.format)&&2===n.length&&mre(n[0])&&mre(n[1]);if(t.includes(" ")||o){var r=o?n:t.split(" ");if(o||r[1].includes("/")&&mre(r[0])&&Number(r[0])%1==0){n=o?n:r[1].split("/");if(mre(n[0])&&Number(n[0])%1==0&&mre(n[1])&&Number(n[1])%1==0)return i.format="# "+(1<n[0].length||1<n[1].length?"??/??":"?/?"),i.value=(o?Number(n[0])/Number(n[1]):Number(r[0])+Number(n[0])/Number(n[1])).toString(),void(e.args.updateValue||(e.args.value=i.value,e.args.format=i.format,e.fResult=this.fractionFormat(e.args),e.isRightAlign=!0))}}o="";t.includes(e.args.curSymbol)&&(o=t.includes(this.localeObj.decimal)?Qhe.currency[0]:Qhe.currency[1],t=t.replace(e.args.curSymbol,"")),("."===this.localeObj.decimal||e.args.isEdit&&!i.formula)&&t.includes(this.localeObj.group)&&koe(t,this.parent.locale,this.localeObj.group,this.localeObj.decimal)&&(t=t.split(this.localeObj.group).join(""),o=o||(t.includes(this.localeObj.decimal)?"#,##0.00":"#,##0")),o?mre(t=t.replace(this.localeObj.decimal,"."))&&(e.args.value=Number(t).toString(),e.args.updateValue?(e.args.cell.value=e.args.value,e.args.cell.format=o):(e.args.format=o,Jre(e.rowIdx,e.colIdx,e.sheet,{value:e.args.value,format:o},!0),o.includes('"')&&(o=this.processText(o)),e.fResult=this.getFormattedNumber(o,Number(e.args.value)),e.isRightAlign=!0)):"."!==this.localeObj.decimal&&"General"===e.args.format&&mre(t)&&t.includes(".")&&(e.fResult=Number(t).toString().replace(".",this.localeObj.decimal))}},qhe.prototype.isPercentageValue=function(e,t,i){if(e.includes("%")){e=e.split("%");if(""!==e[0]&&""===e[1].trim()){e=Moe({value:e[0]},this.parent.locale,this.localeObj.group,this.localeObj.decimal);if(e.isNumber)return t.value=Number(e.value)/100,i.value=t.value.toString(),!0}}return!1},qhe.prototype.findSuffix=function(e,t){var i=e.length-t.length;return e.substr(0,i<0?0:i)+t},qhe.prototype.applyNumberFormat=function(e,t){e.format=this.isCustomFormat(e.format);var i,n=e.format.split(";");if(0<Number(e.value))e.format=n[0];else if(0===Number(e.value)){if(e.format=n[2]||n[0],-1<e.format.indexOf('"')&&-1===e.format.indexOf("#"))return e.format=e.format.split("_").join(" ").split("*").join(" ").split("?").join(" ").split('"').join(""),e.format}else if(Number(e.value)<0)e.format=je(n[1])?n[0]:n[1].split("*").join(" "),-1<e.format.indexOf("-")&&(e.value=e.value.toString().split("-").join(""));else if(e.format=n[3]||n[0],e.format=e.format.split("_").join(" ").split("*").join(" ").split("?").join(" "),-1<e.format.indexOf("@"))return e.format.split("@").join(e.value.toString());return e.format=e.format.split("_").join(" ").split("*").join(" ").split('"').join(""),-1<e.format.indexOf("?")&&-1<e.format.indexOf(this.localeObj.decimal)?(n=e.format.split(this.localeObj.decimal)[1].length,i="",Number(e.value)%1&&(i=e.value.toString().split(".")[1].length<n?" ":"0"),e.format=e.format.split("?").join(i)):e.format=e.format.split("?").join(" "),Number(e.value)<0&&e.cell&&e.cell.format&&(e.format=e.cell.format),t.formatNumber(Number(e.value),{format:e.format})},qhe.prototype.isCustomFormat=function(e){return e=(e=""===(e='_-* #,##0.00_-;-* #,##0.00_-;_-* "-"_-;_-@_-'!==e&&'_-* #,##0_-;-* #,##0_-;_-* "-"_-;_-@_-'!==e?e:"")?Ghe("Number"):e).toString().split("_)").join(" ").split("_(").join(" ").split("[Red]").join("")},qhe.prototype.currencyFormat=function(e,t,i){e.format=e.format||Ghe("Currency"),e.format=e.format.split("_(").join(" ").split("_)").join(" ");var n=e.format.split(";"),o=ese(e.format),r=Number(e.value);return 0<=r||je(n[1])?(o&&(e.color=i.style&&i.style.color?i.style.color:"",this.applyColor(e)),e.format=n[0]):(r=Math.abs(r),e.format=n[1].split("["+o+"]").join("").split("*").join(" "),o&&(e.color=o.toLowerCase(),this.applyColor(e))),e.format=this.getFormatForOtherCurrency(e.format),e.format.includes('"')&&(e.format=this.processText(e.format)),t.formatNumber(r,{format:e.format,currency:oe})},qhe.prototype.applyColor=function(e){e.refresh&&(this.setCell(e),e.td)&&e.td.style.color!==e.color&&this.parent.notify(Mie,{style:{color:e.color},rowIdx:e.rowIndex,colIdx:e.colIndex,td:e.td})},qhe.prototype.setCell=function(e){var t;e.td||(t={sheet:_re(this.parent,e.sheetIndex),cell:e.cell,rowIdx:e.rowIndex,colIdx:e.colIndex},(1<e.cell.rowSpan||1<e.cell.colSpan)&&ire(t),e.td=this.parent.getCell(t.rowIdx,t.colIdx))},qhe.prototype.percentageFormat=function(e,t){return e.format=""===e.format?Ghe("Percentage"):e.format,t.formatNumber(Number(e.value),{format:e.format})},qhe.prototype.accountingFormat=function(e,t,i,n){e.format=e.format||Ghe("Accounting"),e.format=e.format.split("_(").join(" ").split("_)").join(" ").split("[Red]").join("").split("_").join("");var o,r=e.format.split(";"),s=Moe({value:t},this.parent.locale,this.localeObj.group,this.localeObj.decimal,e.curSymbol,!1,!0);return s.isNumber?(n.value=e.value=s.value,0<=(s=Number(e.value))?e.format=0===s&&r[2]?r[2]:r[0]:(e.format=r[1].split("*").join(" "),s=Math.abs(s)),e.format.includes(e.curSymbol)&&e.format.includes('"')&&(e.format=this.processText(e.format)),e.format=this.getFormatForOtherCurrency(e.format),e.formatApplied=!0,0!==s||(e.format=this.processText(e.format.split("*").join(" ").split("?").join(" ")),e.format.includes("#"))||e.format.includes("0")?(o=i.formatNumber(s,{format:e.format,currency:oe}),e.dataUpdate?o.split(" ").join(""):o):(e.format+="#",(o=i.formatNumber(s,{format:e.format,currency:oe})).includes("0")&&(o=o.replace("0","")),e.dataUpdate?o.split(" ").join(""):o)):r[3]?this.processCustomText(n,e,r):t},qhe.prototype.getFormatForOtherCurrency=function(e){var t;return-1<e.indexOf("[$")&&(t=e.split("]")[0].split("[$")[1].split("-")[0],e=e.indexOf("0")>e.indexOf("[$")?t+e.slice(e.indexOf("]")+1,e.length):e.slice(0,e.indexOf("[$"))+t),e},qhe.prototype.checkAndProcessNegativeValue=function(e,t){return!!(t&&mre(t)&&Number(t)<0)&&(void 0===e.rowIndex||e.dataUpdate?e.formattedText="#".repeat(e.dataUpdate?7:10):(e.isRowFill=!0,this.setCell(e),t={cell:e.cell,cellEle:e.td,rowIdx:e.rowIndex,colIdx:e.colIndex,repeatChar:"#"},this.parent.notify(aoe,t),e.formattedText=t.formattedText),!0)},qhe.prototype.shortDateFormat=function(e,t,i){Whe&&nre(this.parent)&&i&&"m/d/yyyy"===i.format&&Whe.has(14)&&(i.format=e.format=Whe.get(14)),n=""===e.format||"General"===e.format||"mm-dd-yyyy"===e.format||"m/d/yyyy"===e.format?(s="MM-dd-yyyy",{type:"date",skeleton:"yMd"}):(s=e.format,e.format===Ghe("ShortDate")?{type:"date",skeleton:"yMd"}:{type:"date",format:e.format}),e.value=e.value.toString();var n,o,r=this.checkForDateFormat(e,i);if(e.value&&i&&(!mre(e.value)||r)){var s={value:e.value,updatedVal:e.value,cell:i,isEdit:e.isEdit,intl:t,skipCellFormat:!0,format:s};if(this.checkDateFormat(s),s.isDate||s.isTime)i.value=e.value=s.updatedVal,o=s.dateObj;else{if(!r)return"";o=cre(e.value)}}else o=cre(e.value);return o&&"Invalid Date"!==o.toString()?o.getFullYear()<1900||9999<o.getFullYear()?mre(e.value)?e.value.toString():"":(e.checkDate&&(e.dateObj=o),t.formatDate(o,n)):""},qhe.prototype.longDateFormat=function(e,t){e.value=e.value.toString();var i,n=this.checkForDateFormat(e,e.cell);if(!(e.value.includes(this.localeObj.dateSeparator)||0<e.value.indexOf("-"))||mre(e.value)&&!n)i=cre(e.value);else if(n){n={value:e.value,updatedVal:e.value,cell:e.cell,isEdit:e.isEdit,intl:t};this.checkDateFormat(n),n.isDate||n.isTime?e.cell.value=e.value=ure(i=n.dateObj).toString():i=cre(e.value)}else{if(!((i=yre(e.value,t,this.parent.locale,"",e.cell).dateObj)&&"Invalid Date"!==i.toString()&&1900<=i.getFullYear()))return mre(e.value)?e.value:"";e.cell.value=e.value=ure(i).toString()}return i&&"Invalid Date"!==i.toString()?i.getFullYear()<1900||9999<i.getFullYear()?mre(e.value)?e.value.toString():"":(e.checkDate&&(e.dateObj=i),t.formatDate(i,{type:"date",skeleton:"full"})):""},qhe.prototype.checkForDateFormat=function(e,t){var i,n=e.value;if("."===this.localeObj.decimal||e.isEdit&&!t.formula){if(n.includes(this.localeObj.group)&&koe(n,this.parent.locale,this.localeObj.group,this.localeObj.decimal))return n=n.replace(this.localeObj.group,""),mre(n="."!==this.localeObj.decimal&&n.includes(this.localeObj.decimal)?n.replace(this.localeObj.decimal,"."):n)&&t&&(t.value=e.value=n),!1;i="."===this.localeObj.dateSeparator&&n.includes("."),"."!==this.localeObj.decimal&&!mre(n)&&n.includes(this.localeObj.decimal)&&mre(n=n.replace(this.localeObj.decimal,"."))&&t&&(t.value=e.value=n)}return i},qhe.prototype.timeFormat=function(e,t,i){if(je(e.value))return"";var n,o=Ghe("Time"),o=(""!==e.format&&"General"!==e.format||(n=o),n="h:mm:ss AM/PM"===e.format?"h:mm:ss a":e.format,e.value.toString());if(!mre(o)&&i){e={value:o,updatedVal:o,cell:i,isEdit:e.isEdit,intl:t,skipCellFormat:!0};if(this.checkDateFormat(e),!e.isDate&&!e.isTime)return"";i.value=o=e.updatedVal}i=o.split(".");return je(i[1])||(o=parseFloat(i[0]+1+"."+i[1])||o),t.formatDate(cre(o),{type:"time",skeleton:"medium",format:n})},qhe.prototype.scientificHashFormat=function(e,t){var i,n=this.findDecimalPlaces(e.format),o=t[0].split("0").length-1+(t[0].split("#").length-1),r=Number(e.value).toExponential(n+o);if(r.includes("e+"))i="e+";else{if(!r.includes("e-"))return r;i="e-"}var s,r=r.split(i),a=r[0].split("."),l=Number(r[1]),h=("e-"===i?(s=(h=l+Math.abs(l-o*(o<l?2:1)))-l,r[1]=h.toString()):r[1]=(l-(s=l%o)).toString(),0<s&&(a[0]+=a[1].substring(0,s),a[1]=a[1].slice(s),r[0]=a.join(".")),Number("1"+"0".repeat(n)));return this.getFormattedNumber(t.join("."),Number((Math.round(Number(r[0])*h)/h).toFixed(n)))+i.toUpperCase()+this.findSuffix(e.format.split("+")[1],r[1])},qhe.prototype.scientificFormat=function(e,t){e.format||(e.format=Ghe("Scientific"));var i=e.format.split("+")[1]||"00",e=(void 0===t&&(t=this.findDecimalPlaces(e.format)),Number(e.value).toExponential(t));return-1<e.indexOf("e+")?e=e.split("e+")[0]+"E+"+this.findSuffix(i,e.split("e+")[1]):-1<e.indexOf("e-")&&(e=e.split("e-")[0]+"E-"+this.findSuffix(i,e.split("e-")[1])),e.replace(".",this.localeObj.decimal)},qhe.prototype.fractionFormat=function(e){e.format=e.format||Ghe("Fraction"),this.checkAndSetColor(e);var t,i=e.value.toString().split("."),n=e.format.split("?").length/2,o=e.format.split(" "),r=o[1]?o[1].split("/"):[];if(/^\?{1,3}\/\?{1,3}$|^\?\/[248]$|^\?\?\/16$/.test(o[1])){if(2===i.length&&!i[1].startsWith("0".repeat(r[1].trim().length||0))){for(var s=[0,1,Number.MAX_VALUE],a=s[0],l=s[1],h=s[2],d=r[1].includes("?")?Number("9".repeat(r[1].split("?").length-1)):Number(r[1]),p=parseFloat("0."+i[1]),c=1;c<=d;c++){var u=Math.round(p*c),g=Math.abs(p-u/c);g<h&&(a=(u=[u,c,g])[0],l=u[1],h=u[2])}s=pre(a,l);(a=(r=[a/s,l/s])[0])===(l=r[1])?i[0]=""+(parseInt(i[0],10)+1):0!==a&&(t=a+"/"+l)}}else 2!==i.length||i[1].startsWith("0".repeat(n))||(t=dre(Number(e.value)));s=this.getFormattedNumber(o[0],Math.abs(Number(i[0])));return t?(s="0"===s?"":s,(Number(e.value)<0?"-":"")+s+" "+t):(Number(e.value)<0?"-":"")+s+" "+"  ".repeat(2*n)},qhe.prototype.checkAndSetColor=function(e){var t=ese(e.format);t&&(e.format=e.format.split("["+t+"]").join(""),e.color=t.toLowerCase(),this.applyColor(e))},qhe.prototype.findDecimalPlaces=function(e){var t,i=e.toUpperCase().indexOf("E");return-1<i?0<(t=-1===(t=e.indexOf(this.localeObj.decimal))&&"."!==this.localeObj.decimal?e.indexOf("."):t)?e.substring(t+1,i).length:0:2},qhe.prototype.checkDateFormat=function(e){if(!je(e.value)){var t=e.cell||Kre(e.rowIndex,e.colIndex,_re(this.parent,je(e.sheetIndex)?this.parent.activeSheetIndex:e.sheetIndex),!1,!0),i=t.format,n=(this.parent.isEdit&&"Scientific"===Yhe(t.format)&&(t.format=""),this.checkCustomDateFormat(e.value.toString(),t,e.isEdit));if("Invalid"!==n.val){var o=void 0,r=(n.format.startsWith("[h]")&&1<(r=n.val.split(":")).length&&24<=Number(r[0])&&(o=Number(r[0])/24,r[0]="24",n.val=r.join(":")),yre(n.val,e.intl||new Ti(this.parent.locale),this.parent.locale,n.format||e.format,e.skipCellFormat&&t,n.isDateTime));if(r.dateObj&&"Invalid Date"!==r.dateObj.toString()){var s=r.dateObj.getFullYear();if(1900<=s&&s<=9999){e.isTime="time"===r.type;s=ure(r.dateObj,n.val.includes(":"),e.isTime);if(1<=o&&(r.dateObj=cre(s+=o)),n.val=s.toString(),(!t.format||"General"===t.format)&&(e.isTime?t.format=Ghe("Time"):t.format=Ghe("ShortDate"),e.updateValue))return void(t.value=n.val);e.isDate="date"===r.type||"datetime"===r.type,e.dateObj=r.dateObj}e.updatedVal=n.val}}else i&&(t.format=i)}},qhe.prototype.checkCustomTimeFormat=function(i,e){var n,o,r,s,a=this,l=[],h=" "+this.localeObj.am,d=" "+this.localeObj.pm,t=i.includes(h)||i.includes(d),p=(t||(i.includes(h.toLowerCase())||i.includes(d.toLowerCase()))&&(i=i.replace(h.toLowerCase(),h).replace(d.toLowerCase(),d),t=!0),i.split(this.localeObj.timeSeparator)),c=3===p.length&&t;if(p.length<=3?(s=t?12:23,p.forEach(function(e,t){e=e.trim(),(p[t]=e).includes(h)||e.includes(d)?(n=" AM/PM",e=e.replace(h,"").replace(d,"")):n="",mre(o=Number(e))&&0<=o?24<=o&&0===t&&1<p.length?l.push("[h]"):o<=s&&0===t?(l.push("h"+n),1===p.length&&(n?((r=i.split(" "))[0]+=a.localeObj.timeSeparator+"00",p[0]=r.join(" ")):(l=[],i="Invalid"))):o<=60&&(1===l.length||2===l.length)?(1===l.length&&(l.push("mm"+n),2!==p.length||"[h]"!==l[0])||l.push("ss"),1===e.length&&(p[t]="0"+p[t])):(l=[],i="Invalid"):(l=[],i="Invalid")})):i="Invalid",l.length){i=p.join(this.localeObj.timeSeparator);t=void 0;if(c?t=this.customFormats[24]:(t=l.join(":"),Whe&&(t=this.getMatchingCustomFormat(t))),!e.format||"General"===e.format)return e.format=t,{val:i,format:t}}return{val:i,format:""}},qhe.prototype.checkCustomDateFormat=function(i,t,e){var n,o,r=this,s=t.format;if(i.includes(this.localeObj.dateSeparator)&&(!i.includes(" "+this.localeObj.am)&&!i.includes(" "+this.localeObj.pm)||i.replace(" "+this.localeObj.am,"").replace(" "+this.localeObj.pm,"").includes(this.localeObj.dateSeparator)))n=this.localeObj.dateSeparator;else{if(!(0<i.indexOf("-")))return 0<i.indexOf(",")?(a=new Ti(this.parent.locale).parseDate(i,{skeleton:"full"}))&&!isNaN(a.getTime())?{val:i,format:"",isDateTime:!1}:{val:"Invalid",format:""}:i.includes(this.localeObj.timeSeparator)||i.includes(" "+this.localeObj.am)||i.includes(" "+this.localeObj.pm)?this.checkCustomTimeFormat(i,t):{val:"Invalid",format:""};n="-"}if(i.includes(this.localeObj.timeSeparator)&&i.includes(" ")){var a=i.split(" ");if(i=a.shift(),"Invalid"===(o=this.checkCustomTimeFormat(a.join(" "),t)).val)return{val:"Invalid",format:""}}var l,h,d=i.split(n),p="",c=[],u=function(e){p=c.join(n),s&&"General"!==s||(t.format=e)},a=ce.getDependables(Ai,this.parent.locale,null).dateObject,g=a.months["stand-alone"]?a.months["stand-alone"].wide:{},m=a.months["stand-alone"]?a.months["stand-alone"].abbreviated:{1:""},f=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],y=function(e,t,i,n){(m[""+t]&&m[""+t].toLowerCase()===i||e.substring(0,n)===i)&&(l=f[Number(t)-1])};if(2===d.length){a=function(e){i=l,c[0]="MMM",Number(e)<=31&&0<Number(e)?(i=e+n+i,"/"!==r.localeObj.dateSeparator&&"-"!==n&&(i+=n+(new Date).getFullYear()),c.splice(0,0,"dd"),u(r.customFormats[21])):(2===e.length&&mre(e)&&-1<Number(e)&&(e=(Number(e)<30?(new Date).getFullYear().toString().slice(0,2):"19")+e),1900<=Number(e)&&Number(e)<=9999?(i="1"+n+i+n+e,c[1]="yyyy",u(r.customFormats[22])):i="Invalid")};d[0]=d[0].toLowerCase().trim(),d[1]=d[1].toLowerCase().trim(),!Number(d[0])&&d[0].length>=m[1].length?(Object.keys(g).find(function(e){return y(g[""+e].toLowerCase(),e,d[0],d[0].length)}),je(l)||d[0].includes(",")||a(d[1])):!Number(d[1])&&d[1].length>=m[1].length?(Object.keys(g).find(function(e){return y(g[""+e].toLowerCase(),e,d[1],d[1].length)}),je(l)||a(d[0])):Number(d[0])&&Number(d[0])<=12&&Number(d[1])&&("/"===this.localeObj.dateSeparator||"-"===n||e&&!t.formula)&&(l=f[Number(d[0])-1],a(d[1])),c.length||(i="Invalid")}else if(2<d.length)for(var v=this,b=0;b<d.length;b++)!function(t){mre(d[t])?4!==d[t].length&&2!==d[t].length&&1!==d[t].length&&(i="Invalid"):(d[t]=d[t].trim(),Object.keys(g).find(function(e){return y(g[""+e].toLowerCase(),e,d[t].trim().toLowerCase(),d[t].length)}),je(l)?i="Invalid":1===t&&(c[1]="MMM",d[2]=d[2].trim(),2===d[2].length&&mre(d[2])&&-1<Number(d[2])&&(d[2]=(Number(d[2])<30?(new Date).getFullYear().toString().slice(0,2):"19")+d[2]),Number(d[0])<=31)&&1900<=Number(d[2])&&Number(d[2])<=9999&&(i=d[0]+n+l,i+=n+d[2],c[0]="d",c[2]="yy",u(v.customFormats[20]),c[2]="yyyy",p=c.join(n)))}(b);return o&&"Invalid"!==i&&(s&&"General"!==s||(t.format=this.customFormats[27]),p&&o.format&&(p+=" "+o.format),i+=" "+o.val,h=!0),{val:i,format:p,isDateTime:h}},qhe.prototype.formattedBarText=function(e){var t,i,n,o,r,s,a,l=this;""!==e.value&&!je(e.value)&&(t={},a=e.cell&&e.cell.format||"",t=e.type||(a&&ise(a,!0,t,!0)?t.type:""),i=new Ti,n=e.value,o=!e.showFormattedText||"dd-MM-yyyy"!==a&&"dd/MM/yyyy"!==a?Ghe("ShortDate"):a,"h:mm:ss AM/PM"===(r=Ghe("Time"))&&(r="h:mm:ss a"),a=a.toLowerCase(),s=function(){"."!==l.localeObj.decimal&&e.value&&(e.value=e.value.toString(),mre(e.value))&&e.value.includes(".")&&(e.value=e.value.replace(".",l.localeObj.decimal))},"date"===(t="time"!==t||!a.includes("m")||a.includes(":m")||a.includes("m:")||a.includes("[m")||a.includes("am")?t:"date")?(a=e.value.toString(),e.value=this.shortDateFormat({type:t,value:e.value,format:o},i,e.cell),e.value&&a.includes(".")&&(e.value+=" "+this.timeFormat({type:t,value:a,format:r},i))):t.includes("time")?n&&1<=Number(n)||"datetime"===t?e.value=this.shortDateFormat({type:t,value:e.value,format:o},i)+" "+this.timeFormat({type:t,value:e.value,format:r},i):e.value=this.timeFormat({type:t,value:e.value,format:r},i):e.cell.format&&e.cell.format.includes("%")&&mre(e.cell.value)?(e.value=this.parent.getDisplayText(e.cell),e.value.includes("%")||(e.value=n,s())):s(),!e.value||e.value&&-1<e.value.toString().indexOf("null"))&&(e.value=n)},qhe.prototype.getFormattedNumber=function(e,t){return(new Ti).formatNumber(Number(t),{format:e})||""},qhe.prototype.getMatchingCustomFormat=function(e){return"#,##0_);(#,##0)"===e&&Whe.has(37)?Whe.get(37):"#,##0_);[Red](#,##0)"===e&&Whe.has(38)?Whe.get(38):"#,##0.00_);(#,##0.00)"===e&&Whe.has(39)?Whe.get(39):"#,##0.00_);[Red](#,##0.00)"===e&&Whe.has(40)?Whe.get(40):"d-mmm-yy"===e&&Whe.has(15)?Whe.get(15):"d-mmm"===e&&Whe.has(16)?Whe.get(16):"mmm-yy"===e&&Whe.has(17)?Whe.get(17):"h:mm AM/PM"===e&&Whe.has(18)?Whe.get(18):"h:mm:ss AM/PM"===e&&Whe.has(19)?Whe.get(19):"h:mm"===e&&Whe.has(20)?Whe.get(20):"h:mm:ss"===e&&Whe.has(21)?Whe.get(21):"m/d/yyyy h:mm"===e&&Whe.has(22)?Whe.get(22):"mm:ss"===e&&Whe.has(45)?Whe.get(45):e},qhe.prototype.addEventListener=function(){this.parent.on(Sie,this.numberFormatting,this),this.parent.on(Aie,this.getFormattedCell,this),this.parent.on(Fie,this.checkDateFormat,this),this.parent.on(Oie,this.formattedBarText,this),this.parent.on(Lie,this.updateAutoDetectNumberFormat,this),this.parent.on(Rie,this.parseDecimalNumber,this),this.parent.on(xoe,this.localizedFormatAction,this)},qhe.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Sie,this.numberFormatting),this.parent.off(Aie,this.getFormattedCell),this.parent.off(Fie,this.checkDateFormat),this.parent.off(Oie,this.formattedBarText),this.parent.off(Lie,this.updateAutoDetectNumberFormat),this.parent.off(Rie,this.parseDecimalNumber),this.parent.off(xoe,this.localizedFormatAction))},qhe.prototype.destroy=function(){this.removeEventListener(),Whe&&!this.parent.refreshing&&(Whe.clear(),Whe=null),Qhe=this.parent=this.localeObj=this.customFormats=this.localizedFormats=null},qhe.prototype.getModuleName=function(){return"workbookNumberFormat"};var Whe,Qhe,Uhe=qhe;function qhe(e){this.parent=e,this.localeObj=Mi(this.parent.locale);e=ce.getDependables(Ai,this.parent.locale,null).dateObject;e.dayPeriods&&e.dayPeriods&&e.dayPeriods.format&&e.dayPeriods.format.wide?(this.localeObj.am=e.dayPeriods.format.wide.am||"AM",this.localeObj.pm=e.dayPeriods.format.wide.pm||"PM"):(this.localeObj.am="AM",this.localeObj.pm="PM"),this.updateLocalizedFormats(e),this.addEventListener()}function Ghe(e){e=e.split(" ").join("");if(!Qhe)switch(e){case"Currency":return"$#,##0.00";case"Accounting":return'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)';case"Time":return"h:mm:ss AM/PM";default:return"General"}function t(e,t){return Whe&&Whe.has(t)?Whe.get(t):e}var i="General";switch(e){case"Number":i=t("0.00",2);break;case"Currency":i=Qhe.currency[0];break;case"Accounting":i=Qhe.accounting[2];break;case"ShortDate":i=t("m/d/yyyy",14);break;case"LongDate":i="dddd, mmmm dd, yyyy";break;case"Time":i=Qhe.time;break;case"Percentage":i=t("0.00%",10);break;case"Fraction":i=t("# ?/?",12);break;case"Scientific":i=t("0.00E+00",11);break;case"Text":i=t("@",49);break;case"CurrencyWithColorCode":i=Qhe.currency[5]}return i}function Yhe(t,e){var i,n="General";switch(t){case"0":case"0.00":case"#,##0":case"#,##0.00":n="Number";break;case"$#,##0.00":case"$#,##0":case"$#,##0_);[Red]($#,##0)":case"$#,##0.00_);($#,##0.00)":case"$#,##0_);($#,##0)":case"$#,##0.00_);[Red]($#,##0.00)":n="Currency";break;case'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)':case'_ $ * #,##0.00_ ;_ $ * -#,##0.00_ ;_ $ * "-"??_ ;_ @_ ':case'_($* #,##0_);_($* (#,##0);_($* "-"_);_(@_)':n="Accounting";break;case"mm-dd-yyyy":case"m/d/yyyy":case"dd/MM/yyyy":n="ShortDate";break;case"dddd, mmmm dd, yyyy":n="LongDate";break;case"h:mm:ss AM/PM":n="Time";break;case"0.00%":case"0%":n="Percentage";break;case"0.00E+00":n="Scientific";break;case"@":n="Text";break;default:if(t){if(!Qhe)break;t===Qhe.time?n="Time":-1<Qhe.currency.indexOf(t)?n="Currency":-1<Qhe.accounting.indexOf(t)?e&&(n="Accounting"):(t.includes("?/?")||-1<["2","4","8","16"].indexOf(t.split("?/")[1]))&&(n="Fraction"),Whe&&"General"===n&&e&&((i=function(e){return e.some(function(e){return Whe.has(e)&&Whe.get(e)===t})})([1,2,3,4])?n="Number":i([14])?n="ShortDate":i([9,10])?n="Percentage":i([11])?n="Scientific":i([49])&&(n="Text")),e=!1}}return n=e&&Qhe&&("Currency"===n&&"$#,##0.00"!==Qhe.currency[0]||"Accounting"===n&&'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'!==Qhe.accounting[2])?"General":n}function Xhe(e,t){t={action:"parseToDefaultFormat",format:t};return e.notify(xoe,t),t.format}Jhe.prototype.destroy=function(){this.removeEventListener(),this.parent=null},Jhe.prototype.addEventListener=function(){this.parent.on(Kie,this.initiateSortHandler,this),this.parent.on(Jie,this.updateSortedDataOnCell,this)},Jhe.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Kie,this.initiateSortHandler),this.parent.off(Jie,this.updateSortedDataOnCell))},Jhe.prototype.initiateSortHandler=function(s){var a=this,l=s.args,h=new ll,e=this.parent.getAddressInfo(l.range),d=_re(this.parent,e.sheetIndex),p=fte(e.indices),t=l.sortOptions||{sortDescriptors:{},containsHeader:!0},e=!1;if(s.promise=h.promise,p[0]>d.usedRange.rowIndex||p[1]>d.usedRange.colIndex)h.reject(this.parent.serviceLocator.getService(bre).getConstant("SortOutOfRangeError"));else{var i=t.containsHeader,n=l.checkForHeader;(p[0]===p[2]||n)&&(n||(p=Xoe(p[0],p[1],d)),e=!0,je(t.containsHeader))&&(i=typeof Kre(p[0],p[1],d,null,!0).value!=typeof Kre(p[0]+1,p[1],d,null,!0).value||!this.isSameStyle(Kre(p[0],p[1],d,null,!0).style,Kre(p[0]+1,p[1],d,null,!0).style)||this.isHeaderRow(d,p)),!je(l.sortOptions)&&!je(l.sortOptions.containsHeader)||e||(n=Kre(p[0],p[1],d),e=Kre(p[0]+1,p[1],d),n&&e&&(i=typeof n.value!=typeof e.value||!this.isSameStyle(n.style,e.style)||this.isHeaderRow(d,p))),p[0]=i?p[0]+1:p[0];var o=dte(ste(d.activeCell)[1]+1),r=(delete t.containsHeader,t.sortDescriptors),c=new ya;if(Array.isArray(r))for(var u=(r=r&&0!==r.length?r:[{field:o}]).length,g=u-1;-1<g;g--)r[u-1].field||(r[u-1].field=o),r[g].field&&(m=r[g].sortComparer||this.sortComparer.bind(this,r[g],t.caseSensitive),c.sortBy(r[g].field,m),o=r[g].field);else{(r=r||{field:o}).field||(r.field=o);var m=r.sortComparer||this.sortComparer.bind(this,r,t.caseSensitive);c.sortBy(r.field,m),o=r.field}var f=hte(p);Cre(this.parent,d.name+"!"+f,!0,null,null,null,null,null,void 0,null,ate(o)).then(function(t){var e=new me(t);if(1===t.length&&t[0].throwMergeAlert){var i=a.parent.sortCollection&&a.parent.sortCollection[a.parent.sortCollection.length-1];if(i){var n=void 0;if(s.previousSort&&s.previousSort.length)for(var o=0;o<s.previousSort.length;o++){var r=s.previousSort[o];i.sheetIndex===r.sheetIndex&&(n=r)}n?(i.columnIndex=n.columnIndex,i.order=n.order,i.sortRange=n.sortRange):a.parent.sortCollection.pop(),a.parent.notify(Fae,null)}h.reject(a.parent.serviceLocator.getService(bre).getConstant("AutoFillMergeAlertMsg"))}else e.executeQuery(c).then(function(e){a.parent.notify("setActionData",{args:{action:"beforeSort",eventArgs:{range:f,cellDetails:t,sortedCellDetails:e.result}}}),a.updateSortedDataOnCell({result:e.result,range:p,sheet:d,jsonData:t});e={range:d.name+"!"+f,sortOptions:l.sortOptions};s.previousSort&&(e.previousSort=s.previousSort),h.resolve(e)})})}},Jhe.prototype.isHeaderRow=function(e,t){return!(!e.ranges||!e.ranges.length)&&e.ranges.some(function(e){return!(!e.dataSource||!e.showFieldAsHeader)&&(e=ste(e.startCell))[0]===t[0]&&e[1]>=t[1]&&e[1]<=t[3]})},Jhe.prototype.updateSortedDataOnCell=function(r){for(var s,e,t,a=this,l=[],i=function(e,t){for(var i=r.range[1],n=0;i<=r.range[3];i++,n++){if(l[n]||(l[n]=dte(i+1)),t[l[n]])s=Pe({},t[l[n]],null,!0);else{if(!Kre(e,i,r.sheet))continue;s=null}(s=a.skipBorderOnSorting(e,i,r.sheet,s))&&s.validation&&delete s.validation;var o=Kre(e,i,r.sheet);o&&(o.validation&&(s=Object.assign({},s,{validation:o.validation})),o.wrap)&&$re(lte(e,i),!1,a.parent),s&&s.formula&&(s.formula=Uoe([e,i],[parseInt(t.__rowIndex,10)-1,i],r.sheet,a.parent,s,!0)),Jre(e,i,r.sheet,s)}},n=r.isUndo&&{},o=r.range[0],h=0;o<=r.range[2];o++,h++)zde(r.sheet,o)?h--:(t=r.result[h],r.isUndo?t&&(n[e=parseInt(t.__rowIndex,10)-1]=!0,i(e,t),o===e)||!n[o]&&r.sheet.rows[o]&&i(o,{}):i(o,t||{}))},Jhe.prototype.skipBorderOnSorting=function(e,t,i,n){var o=Kre(e,t,i),e=["borderBottom","borderTop","borderRight","borderLeft","border"];if(n&&n.style)for(var r=0,s=e;r<s.length;r++){var a=s[r];delete n.style[""+a]}if(o&&o.style)for(var l=0,h=e;l<h.length;l++){a=h[l];o.style[""+a]&&((n=n||{}).style||(n.style={}),n.style[""+a]=o.style[""+a])}return n},Jhe.prototype.isSameStyle=function(e,t){e=e||{},t=t||{};for(var i=!0,n=Object.keys(e),o=0;o<n.length;o++){if(e[n[o]]!==t[n[o]]&&this.parent.cellStyle[n[o]]!==e[n[o]]){i=!1;break}i=!0}return i},Jhe.prototype.sortComparer=function(e,t,i,n){var e=e.order||"",o=Sa.fnSort(e),r=i&&i.value,s=n&&n.value;if(i&&n&&("string"==typeof r||"string"==typeof s)&&""!==r&&""!==s){var a=void 0,l=void 0;if(mre(i.value)&&(r=vre(i.value),"@"!==i.format&&(i.value=r),a=!0),mre(n.value)&&(s=vre(n.value),"@"!==n.format&&(n.value=s),l=!0),!a&&!l)return i=new Intl.Collator(this.parent.locale,{sensitivity:t?"case":"base"}),e&&"ascending"!==e.toLowerCase()?-1*i.compare(r,s):i.compare(r,s)}return je(s)||""===s?-1:je(r)||""===r?1:o(r,s)},Jhe.prototype.getModuleName=function(){return"workbookSort"};var Khe=Jhe;function Jhe(e){this.parent=e,this.addEventListener()}$he.prototype.destroy=function(){this.removeEventListener(),this.parent=null},$he.prototype.addEventListener=function(){this.parent.on(one,this.initiateFilterHandler,this)},$he.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(one,this.initiateFilterHandler)},$he.prototype.initiateFilterHandler=function(t){var e,i,n=this,o=t.args,r=new ll,s=_re(this.parent,mte(this.parent,o.range)),a=o.filterOptions||{};t.promise=r.promise,a.datasource?(this.setFilter(a.datasource,a.predicates,o.range,t.refresh,a.equalOrPredicates),e={range:o.range,filterOptions:a},r.resolve(e)):(e=fte(pte(o.range)))[0]>s.usedRange.rowIndex||e[1]>s.usedRange.colIndex?r.reject("Select a cell or range inside the used range and try again."):(e[0]===e[2]&&e[2]-e[0]==0&&(e[0]=0,e[1]=0,e[3]=s.usedRange.colIndex),e[2]=s.usedRange.rowIndex,e[0]=e[0]+1,i=hte(e),Cre(this.parent,s.name+"!"+i,!0,!0,null,null,null,null,!1).then(function(e){e=new me(e);n.setFilter(e,a.predicates,o.range,t.refresh),r.resolve({range:i,filterOptions:a})}))},$he.prototype.setFilter=function(e,t,i,n,o){var r,s,a,l,h,d,p,c,u=this;e&&t&&(r=e.dataSource.json,s=rre(e,t,o),a="__rowIndex",-1<i.indexOf("!")?(h=Bre(this.parent,i.substring(0,i.lastIndexOf("!"))),l=_re(this.parent,h)):(l=this.parent.getActiveSheet(),h=Bre(this.parent,l.name)),"spreadsheet"===this.parent.getModuleName()?((e=this.parent).scrollSettings.enableVirtualization&&(l.rows||r).length>e.viewport.rowCount+2*e.getThreshold("row")||l.frozenRows||l.frozenColumns||n?(r.forEach(function(e){d=s.indexOf(e)<0,Hde(l,Number(e[a])-1,{hidden:d,isFiltered:d})}),p=h===e.activeSheetIndex,t=rte(l.paneTopLeftCell),this.parent.updateTopLeftCell(Woe(l,t[0],!0)-this.parent.frozenRowCount(l),null,"col")):r.forEach(function(e){d=s.indexOf(e)<0,p?Hde(l,Number(e[a])-1,{hidden:d,isFiltered:d}):((e={startIndex:Number(e[a])-1,hide:d,isFiltering:!0,sheetIndex:h}).endIndex=e.startIndex,u.parent.notify(Nne,e),p=e.refreshUI)}),p&&e.renderModule.refreshSheet(!1,!1,document.activeElement.id!==this.parent.element.id+"_SearchBox")):r.forEach(function(e){c=s.indexOf(e)<0,Hde(l,Number(e[a])-1,{hidden:c,isFiltered:c})}))},$he.prototype.getModuleName=function(){return"workbookFilter"};var Zhe=$he;function $he(e){this.parent=e,this.addEventListener()}tde.prototype.setImage=function(e){var t=e.range?e.range.lastIndexOf("!"):-1,i=e.range?-1<t?e.range.substring(t+1):e.range:this.parent.getActiveSheet().selectedRange,t=e.range&&-1<t?Bre(this.parent,e.range.substring(0,t)):this.parent.activeSheetIndex,i=rte(i),t=ee(t)?this.parent.getActiveSheet():_re(this.parent,t),n=Kre(i[0],i[1],t),o=e.options;if(n&&n.image)if(a=n.image,e.isPositionChanged)for(var r=0;r<a.length;r++)for(var s=0;s<o.length;s++)a[r].id===o[s].id&&(a[r]=o[s],document.getElementById(o[s].id))&&(e.isElementRemoved=!0,document.getElementById(o[s].id).remove());else for(var a=n.image,r=0;r<o.length;r++)a.push(o[r]);return Jre(i[0],i[1],t,{image:n&&n.image?a:o},!0,!0),e.isElementRemoved},tde.prototype.addEventListener=function(){this.parent.on(Wne,this.setImage,this)},tde.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Wne,this.setImage)},tde.prototype.destroy=function(){this.removeEventListener(),this.parent=null},tde.prototype.getModuleName=function(){return"workbookImage"};var ede=tde;function tde(e){this.parent=e,this.addEventListener()}nde.prototype.addEventListener=function(){this.parent.on(Qne,this.setChartHandler,this),this.parent.on(Xne,this.deleteChartColl,this),this.parent.on(Yne,this.refreshChartSize,this),this.parent.on(Kne,this.focusChartBorder,this)},nde.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Qne,this.setChartHandler),this.parent.off(Xne,this.deleteChartColl),this.parent.off(Yne,this.refreshChartSize),this.parent.off(Kne,this.focusChartBorder))},nde.prototype.setChartHandler=function(e){var t=0,i=[],n=(e.isInitCell=!je(e.isInitCell)&&e.isInitCell,e.isUndoRedo=!!je(e.isUndoRedo)||e.isUndoRedo,e.isPaste=!je(e.isPaste)&&e.isPaste,e.chart);if(0<n.length)for(;t<n.length;){if(!1===e.isCut&&document.getElementById(e.chart[t].id)&&(n[t]={range:n[t].range,id:D("e_spreadsheet_chart"),theme:n[t].theme,isSeriesInRows:n[t].isSeriesInRows,type:n[t].type,markerSettings:n[t].markerSettings,title:n[t].title,legendSettings:n[t].legendSettings,primaryXAxis:n[t].primaryXAxis,primaryYAxis:n[t].primaryYAxis,dataLabelSettings:n[t].dataLabelSettings}),document.getElementById(e.chart[t].id))return;(o=n[t]).theme=o.theme||"Material",o.type=o.type||"Line",o.isSeriesInRows=o.isSeriesInRows||!1,je(o.range)?(s=this.parent.getActiveSheet(),o.range=s.selectedRange,0===(i=fte(rte(o.range)))[0]&&i[2]===s.rowCount-1&&i[2]>s.usedRange.rowIndex&&(i[2]=s.usedRange.rowIndex),0===i[1]&&i[3]===s.colCount-1&&i[3]>s.usedRange.colIndex&&(i[3]=s.usedRange.colIndex)):i=fte(rte(o.range));var o,r,s,a,l,h,d,p=hte(i);0<o.range.indexOf("!")?o.range=o.range.substring(0,o.range.lastIndexOf("!"))+"!"+p:o.range=this.parent.getActiveSheet().name+"!"+p,je(o.id)&&(o.id=D("e_spreadsheet_chart")),o.markerSettings&&o.markerSettings.visible&&(void 0===o.markerSettings.isFilled&&(o.markerSettings.isFilled=!0),void 0===o.markerSettings.shape)&&(o.markerSettings.shape="Circle"),o.height=o.height||290,o.width=o.width||480,this.parent.notify(Une,{option:o,isInitCell:e.isInitCell,triggerEvent:e.isUndoRedo,dataSheetIdx:e.dataSheetIdx,range:e.range,isPaste:e.isPaste}),this.parent.chartColl.push(o),!e.isInitCell||e.isPaste||e.isUndo||e.isRedo?(r=d=p=void 0,r=e.range&&(e.isUndo||e.isRedo)?(p=Bre(this.parent,e.range.substring(0,e.range.lastIndexOf("!"))),d=(a=fte(rte(e.range)))[0],a[1]):(p=void 0===e.sheetId?o.range&&0<o.range.lastIndexOf("!")?Bre(this.parent,o.range.substring(0,o.range.lastIndexOf("!"))):this.parent.activeSheetIndex:Fre(this.parent,e.sheetId),l={clientY:o.top,isImage:!0},h={clientX:o.left,isImage:!0},this.parent.notify(Coe,l),this.parent.notify(Soe,h),d=l.clientY,h.clientX),a=Kre(d,r,s=ee(p)?this.parent.getActiveSheet():this.parent.sheets[p]),this.parent.isPrintingProcessing||(a&&a.chart?a.chart.push(o):Jre(d,r,s,{chart:[o]},!0))):(p=rte(e.range),l={clientY:o.top,isImage:!0},h={clientX:o.left,isImage:!0},this.parent.notify(Coe,l),this.parent.notify(Soe,h),d={prevTop:o.top,prevLeft:o.left,prevRowIdx:p[0],prevColIdx:p[1],prevHeight:o.height,prevWidth:o.width,currentTop:o.top,currentLeft:o.left,currentRowIdx:l.clientY,currentColIdx:h.clientX,currentHeight:o.height,currentWidth:o.width,id:o.id,requestType:"chartRefreshOnInit"},p[0]===l.clientY&&p[1]===h.clientX||(r=n.length,this.parent.notify(Aoe,d),t-=r-n.length)),t++}},nde.prototype.refreshChartSize=function(e){for(var t=1,i=this.parent.sheets.length+1;t<i;){var n,o=this.parent.chartColl;if(n=o?o.length:0)for(;n--;){var r=this.parent.chartColl[n];je(e.overlayEle.querySelector("#"+r.id))||(r=At(r=this.parent.element.querySelector("."+r.id),"chart")||At(r,"accumulationchart"))&&(r.height=e.height,r.width=e.width)}t++}},nde.prototype.focusChartBorder=function(e){for(var t=0;t<this.parent.chartColl.length;t++){var i=document.getElementById(e.id),n=document.getElementById(this.parent.chartColl[t].id);i&&n&&z(n,"."+i.classList[1])===i&&this.parent.notify(Une,{option:this.parent.chartColl[t],isRefresh:!0})}},nde.prototype.deleteChartColl=function(e){for(var t=0;t<this.parent.chartColl.length;t++)this.parent.chartColl[t].id+"_overlay"===e.id&&this.parent.chartColl.splice(t,1)},nde.prototype.destroy=function(){this.removeEventListener(),this.parent=null},nde.prototype.getModuleName=function(){return"workbookChart"};var ide=nde;function nde(e){this.parent=e,this.addEventListener()}rde.prototype.format=function(e){var t,i=this,n=e.range,o=(t=n&&"string"==typeof n&&-1<n.indexOf("!")?(o=n.lastIndexOf("!"),n=n.substring(o+1),this.parent.sheets[Bre(this.parent,e.range.substring(0,o))]):this.parent.getActiveSheet(),"object"!=typeof(n=void 0===n?t.selectedRange:n)&&e.onActionUpdate&&!e.isUndoRedo),r={range:n,style:Object.assign({},e.style),requestType:"CellFormat"},s=(e.borderType&&(r.borderType=e.borderType),{}),a="object"==typeof r.range?r.range:fte(rte(r.range)),l=[];if(are(this.parent,a))e.onActionUpdate&&this.parent.notify(kne,null);else if(Object.assign(s,r.style,null,!0),o&&(this.parent.trigger("beforeCellFormat",r),this.parent.notify("actionBegin",{eventArgs:r,action:"format"}),r.cancel))e.cancel=!0;else{e.borderType&&(this.setTypedBorder(t,e.style.border,a,e.borderType,e.onActionUpdate,l),delete e.style.border,delete r.style.border);var h,d,p={cell:null,rowIdx:0,colIdx:0,eventOnly:!0,preventEvt:!o},c=function(e){return p.cell={style:e},p.rowIdx=F,p.colIdx=m,Yoe(i.parent,t,p)};if(void 0!==r.style.borderTop){for(m=a[1];m<=a[3];m++)F=a[0],c({borderTop:r.style.borderTop})||(e.isUndoRedo||(this.checkAdjacentBorder(t,"borderBottom",F-1,m),this.checkFullBorder(t,"borderBottom",F-1,m)),this.checkFullBorder(t,"borderTop",F,m),this.setCellBorder(t,p.cell.style,F,m,e.onActionUpdate,m===a[3],null,null,e.isUndoRedo,l));delete r.style.borderTop}if(void 0!==r.style.borderBottom){for(var u,g=void 0,m=a[1];m<=a[3];m++){var g=0<(u=Kre(F=a[0],m,t,!1,!0)).rowSpan?Kre(a[2],a[1],t,!1,!0):Kre(a[2],a[3],t,!1,!0),f={range:[F=1<u.rowSpan&&g.rowSpan<0?F:a[2],m,F,m]};this.parent.notify(Rne,f),F=f.range[0],c({borderBottom:r.style.borderBottom})||(e.isUndoRedo||(this.checkAdjacentBorder(t,"borderTop",a[2]+1,m),this.checkFullBorder(t,"borderTop",a[2]+1,m)),this.checkFullBorder(t,"borderBottom",a[2],m),this.setCellBorder(t,p.cell.style,F,m,e.onActionUpdate,m===a[3],null,null,e.isUndoRedo),this.setBottomBorderPriority(t,a[2],m))}delete r.style.borderBottom}if(void 0!==r.style.borderLeft){for(var y=a[0];y<=a[2];y++)m=a[1],c({borderLeft:r.style.borderLeft})||(e.isUndoRedo||(this.checkAdjacentBorder(t,"borderRight",y,m-1),this.checkFullBorder(t,"borderRight",y,m-1)),this.checkFullBorder(t,"borderLeft",y,m),this.setCellBorder(t,p.cell.style,y,m,e.onActionUpdate,null,null,null,e.isUndoRedo));delete r.style.borderLeft}if(void 0!==r.style.borderRight){for(var v=a[0];v<=a[2];v++){f={range:[v,m=a[3],v,m]};this.parent.notify(Rne,f),m=f.range[1],c({borderRight:r.style.borderRight})||(e.isUndoRedo||(this.checkAdjacentBorder(t,"borderLeft",v,m+1),this.checkFullBorder(t,"borderLeft",v,m+1)),this.checkFullBorder(t,"borderRight",v,m),this.setCellBorder(t,p.cell.style,v,m,e.onActionUpdate,null,null,null,e.isUndoRedo))}delete r.style.borderRight}var b=Object.keys(r.style);if(b.length)for(var w,C,S,A,x=void 0,I=this.parent,T=I.viewport&&this.parent.getActiveSheet().id===t.id,E=this.parent.frozenRowCount(t),D=this.parent.frozenColCount(t),M=[E+I.viewport.topIndex,D+I.viewport.leftIndex,I.viewport.bottomIndex,I.viewport.rightIndex],k=void 0,P=void 0,B=-1<b.indexOf("color"),O=B||-1<b.indexOf("backgroundColor"),F=a[0];F<=a[2];F++)if(!(S=_de(t,F)||{}).isFiltered)for(C=M[0]<=F&&F<=M[2]||F<E,k=!1,m=a[1];m<=a[3];m++)if(!c(r.style)){if(void 0===d&&(d=void 0!==r.style.border&&(h=r.style.border,delete r.style.border,!0)),x=Kre(F,m,t,!1,!0),w=t.columns[m],1<x.rowSpan||1<x.colSpan)for(var L=F,N=1<x.rowSpan?F+(x.rowSpan-1):F;L<=N;L++)for(var R=m,V=1<x.colSpan?m+(x.colSpan-1):m;R<=V;R++)d&&this.setFullBorder(t,h,a,L,R,e.onActionUpdate,!0),this.setCellStyle(t,L,R,r.style);d&&this.setFullBorder(t,h,a,F,m,e.onActionUpdate,void 0,l),this.setCellStyle(t,F,m,r.style),T&&(C&&(M[1]<=m&&m<=M[3]||m<D)?(P=null,B&&x.format&&x.format.includes("[")&&(A=ese(x.format))&&(P=A.toLowerCase()),this.parent.notify(Mie,{style:r.style,rowIdx:F,colIdx:m,lastCell:m===a[3],isHeightCheckNeeded:!0,manualUpdate:!0,onActionUpdate:e.onActionUpdate,formatColor:P}),O&&(A=x.validation||tpe(w,F,m)&&w.validation)&&A.isHighlighted&&this.parent.notify(Zne,{rowIdx:F,colIdx:m,cell:x,validation:A,col:x.validation&&w})):S.customHeight||(k=k||Qoe(r.style,e.onActionUpdate))&&this.parent.notify(Mie,{rowIdx:F,colIdx:m,lastCell:m===a[3],checkHeight:!0,outsideViewport:!C,onActionUpdate:e.onActionUpdate}))}d&&(r.style.border=h),hre(this.parent,l,[a[1],a[3]]),this.parent.setUsedRange(a[2],a[3]),e.refreshRibbon&&this.parent.notify(Nie,null),t.conditionalFormats&&t.conditionalFormats.length&&this.parent.notify(_ne,{indexes:a}),o&&(r.style=s,r.range=t.name+"!"+n,this.parent.notify("actionComplete",{eventArgs:r,action:"format"}))}},rde.prototype.setBottomBorderPriority=function(e,t,i){var n;zde(e,t+1)&&(n=this.skipHiddenRows(e,t+1),""!==this.parent.getCellStyleValue(["borderTop"],[n,i]).borderTop)&&(e.rows[t].cells[i].style.bottomPriority=!0)},rde.prototype.setFullBorder=function(e,t,i,n,o,r,s,a){var l={};n===i[0]&&(this.checkAdjacentBorder(e,"borderBottom",n-1,o),this.checkFullBorder(e,"borderBottom",n-1,o)),o===i[1]&&(this.checkAdjacentBorder(e,"borderRight",n,o-1),this.checkFullBorder(e,"borderRight",n,o-1)),o===i[3]?(this.checkAdjacentBorder(e,"borderLeft",n,o+1),this.checkFullBorder(e,"borderLeft",n,o+1)):this.checkAdjacentBorder(e,"border",n,o+1),l.borderRight=t,l.borderTop=t,l.borderLeft=t,l.borderBottom=t,this.setCellBorder(e,l,n,o,r,o===i[3],null,s,void 0,a),n===i[2]?(this.checkAdjacentBorder(e,"borderTop",n+1,o),this.checkFullBorder(e,"borderTop",n+1,o),this.setBottomBorderPriority(e,n,o)):this.checkAdjacentBorder(e,"border",n+1,o)},rde.prototype.checkAdjacentBorder=function(e,t,i,n){var o={};""!==this.parent.getCellStyleValue([t],[i,n])[""+t]&&(o[""+t]=void 0,this.setCellStyle(e,i,n,o))},rde.prototype.checkFullBorder=function(e,t,i,n){var o,r=this.parent.getCellStyleValue(["border"],[i,n]).border;""!==r&&(o={border:void 0},["borderBottom","borderTop","borderLeft","borderRight"].forEach(function(e){e!==t&&(o[""+e]=r)}),this.setCellStyle(e,i,n,o))},rde.prototype.textDecorationActionUpdate=function(e){var t=this.parent.getActiveSheet(),i={range:t.selectedRange,style:e.style,requestType:"CellFormat"},n=fte(rte(t.selectedRange));if(are(this.parent,n))this.parent.notify(kne,null);else if(this.parent.trigger("beforeCellFormat",i),this.parent.notify("actionBegin",{eventArgs:i,action:"format"}),i.cancel)e.cancel=!0;else{var o=e.style.textDecoration.toLowerCase(),r=o,s=rte(t.activeCell),a=this.parent.getCellStyleValue(["textDecoration"],s).textDecoration.toLowerCase(),l=!1,h=("underline"===a?r="underline"===o?"none":"underline line-through":"line-through"===a?r="line-through"===o?"none":"underline line-through":"underline line-through"===a&&(r="underline"===o?"line-through":"underline",l=!0),"none"===r&&(l=!0),{textDecoration:r});this.format({style:h,range:s,refreshRibbon:e.refreshRibbon,onActionUpdate:!0});for(var d=n[0];d<=n[2];d++)for(var p=n[1];p<=n[3];p++)if(d!==s[0]||p!==s[1]){if(h={},"none"===(a=this.parent.getCellStyleValue(["textDecoration"],[d,p]).textDecoration.toLowerCase())){if(l)continue;h.textDecoration=o}else if("underline"===a||"line-through"===a)if(l){if(o!==a)continue;h.textDecoration="none"}else h.textDecoration=o!==a?"underline line-through":o;else if("underline line-through"===a){if(!l)continue;h.textDecoration="underline"===o?"line-through":"underline"}this.format({style:h,range:[d,p,d,p],refreshRibbon:e.refreshRibbon,onActionUpdate:!0})}i.range=t.name+"!"+i.range,i.style.textDecoration=r,this.parent.notify("actionComplete",{eventArgs:i,action:"format"})}},rde.prototype.setTypedBorder=function(e,t,i,n,o,r){if("Outer"===n){for(var s=i[1];s<=i[3];s++)this.checkAdjacentBorder(e,"borderBottom",i[0]-1,s),this.checkFullBorder(e,"borderBottom",i[0]-1,s),this.setCellBorder(e,{borderTop:t},i[0],s,o,s===i[3],void 0,void 0,void 0,r),this.checkAdjacentBorder(e,"borderTop",i[2]+1,s),this.checkFullBorder(e,"borderTop",i[2]+1,s),this.setCellBorder(e,{borderBottom:t},i[2],s,o,s===i[3],n),this.setBottomBorderPriority(e,i[2],s);for(var a=i[0];a<=i[2];a++)this.checkAdjacentBorder(e,"borderRight",a,i[1]-1),this.checkFullBorder(e,"borderRight",a,i[1]-1),this.setCellBorder(e,{borderLeft:t},a,i[1],o),this.checkAdjacentBorder(e,"borderLeft",a,i[3]+1),this.checkFullBorder(e,"borderLeft",a,i[3]+1),this.setCellBorder(e,{borderRight:t},a,i[3],o,null,n)}else if("Inner"===n){var l={range:[i[0],i[1],i[0],i[1]]};if(this.parent.notify(Lne,l),l.range[0]!==i[0]||l.range[1]!==i[1]||l.range[2]!==i[2]||l.range[3]!==i[3])for(var h=i[0];h<=i[2];h++)for(var d=i[1];d<=i[3];d++){var p,c={};""!==(p=this.parent.getCellStyleValue(["border"],[h,d]).border)&&(c.border=void 0,d!==i[3]&&d!==i[1]&&h!==i[0]&&h!==i[2]||(h===i[0]&&(c.borderTop=p),h===i[2]&&(c.borderBottom=p),d===i[3]&&(c.borderRight=p),d===i[1]&&(c.borderLeft=p))),d!==i[3]&&(c.borderRight=t),h!==i[0]&&(c.borderTop=t),h!==i[2]&&(c.borderBottom=t),d!==i[1]&&(c.borderLeft=t),this.setCellBorder(e,c,h,d,o,d===i[3],void 0,void 0,void 0,r)}}else if("Vertical"===n)for(h=i[0];h<=i[2];h++)for(d=i[1];d<=i[3];d++){c={borderRight:t,borderLeft:t};d===i[1]&&(this.checkAdjacentBorder(e,"borderRight",h,d-1),this.checkFullBorder(e,"borderRight",h,d-1)),d===i[3]&&(this.checkAdjacentBorder(e,"borderLeft",h,d+1),this.checkFullBorder(e,"borderLeft",h,d+1)),this.setCellBorder(e,c,h,d,o)}else for(h=i[0];h<=i[2];h++)for(d=i[1];d<=i[3];d++){c={borderTop:t,borderBottom:t};h===i[0]&&(this.checkAdjacentBorder(e,"borderBottom",h-1,d),this.checkFullBorder(e,"borderBottom",h-1,d)),this.setCellBorder(e,c,h,d,o,d===i[3]),h===i[2]&&(this.checkAdjacentBorder(e,"borderTop",h+1,d),this.checkFullBorder(e,"borderTop",h+1,d),this.setBottomBorderPriority(e,h,d))}},rde.prototype.setCellBorder=function(e,t,i,n,o,r,s,a,l,h){var d=Kre(i,n,e),p=Kde(e,n),c=_de(e,i);d&&d.isReadOnly||p&&p.isReadOnly||c&&c.isReadOnly||(this.setCellStyle(e,i,n,t),a)||this.parent.getActiveSheet().id!==e.id||("Outer"===s&&(t.borderBottom||t.borderRight)&&(this.parent.notify(Rne,d={range:[i,n,i,n]}),i=d.range[0],n=d.range[1]),l&&(""===t.borderTop&&""!==this.parent.getCellStyleValue(["borderBottom"],[i-1,n]).borderBottom&&(t.borderTop=this.parent.getCellStyleValue(["borderBottom"],[i-1,n]).borderBottom),""===t.borderLeft&&""!==this.parent.getCellStyleValue(["borderRight"],[i,n-1]).borderRight&&(t.borderLeft=this.parent.getCellStyleValue(["borderRight"],[i,n-1]).borderRight),""===t.borderRight)&&""!==this.parent.getCellStyleValue(["borderLeft"],[i,n+1]).borderLeft&&(t.borderRight=this.parent.getCellStyleValue(["borderLeft"],[i,n+1]).borderLeft),this.parent.notify(Mie,{style:t,rowIdx:i,colIdx:n,onActionUpdate:o,first:"",lastCell:r,isHeightCheckNeeded:!0,manualUpdate:!0,mergeBorderRows:h}))},rde.prototype.setCellStyle=function(e,t,i,n){e.rows[t]?e.rows[t].cells||(e.rows[t].cells=[]):e.rows[t]={cells:[]},e.rows[t].cells[i]||(e.rows[t].cells[i]={}),e.rows[t].cells[i].style||(e.rows[t].cells[i].style={}),Object.assign(e.rows[t].cells[i].style,n,null,!0)},rde.prototype.skipHiddenRows=function(e,t){return t=zde(e,++t)?this.skipHiddenRows(e,t):t},rde.prototype.addEventListener=function(){this.parent.on(Tie,this.format,this),this.parent.on(Die,this.textDecorationActionUpdate,this),this.parent.on(zne,this.clearCellObj,this)},rde.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Tie,this.format),this.parent.off(Die,this.textDecorationActionUpdate),this.parent.off(zne,this.clearCellObj))},rde.prototype.clearCellObj=function(e){for(var t,i,n,o,r,s=e.range?e.range.lastIndexOf("!"):0,a=e.range?0<s?e.range.substring(s+1):e.range:this.parent.getActiveSheet().selectedRange,l=e.range&&0<s?Bre(this.parent,e.range.substring(0,s)):this.parent.activeSheetIndex,h=_re(this.parent,l),d=fte(pte(a)),p=d[0],c=d[2],u=h.conditionalFormats&&h.conditionalFormats.length&&[].slice.call(h.conditionalFormats),g=[];p<=c;p++)for(n=d[1],o=d[3];n<=o;n++){var m,f=Kre(p,n,h),y=sre(f,Kde(h,n),_de(h,p));if(f&&("Clear All"===e.type||"Clear Formats"===e.type))if((1<f.rowSpan||1<f.colSpan)&&(this.parent.notify(Lne,m={range:[p,n,p,n]}),d[0]<=(m=m.range)[0])&&d[1]<=m[1]&&d[2]>=m[2]&&d[3]>=m[3]&&this.parent.notify(Bne,{merge:!1,range:m,type:"All",sheetIndex:l,preventRefresh:l!==this.parent.activeSheetIndex}),f.rowSpan&&1!==f.rowSpan||f.colSpan&&1!==f.colSpan)continue;if(f&&!y)switch(e.type){case"Clear Formats":delete f.format,delete f.rowSpan,delete f.style,delete f.wrap,delete f.colSpan,delete f.formattedText,f.hyperlink&&(f.style={textDecoration:"none",color:"inherit"});break;case"Clear Contents":f.hyperlink&&(this.parent.notify(toe,{sheet:h,rowIdx:p,colIdx:n,preventRefresh:!0}),f.style={textDecoration:"underline",color:"#00e"}),r=!(!f.value&&!f.formula),delete f.value,delete f.formula,delete f.formattedText,r&&(this.parent.notify(Pie,i={action:"refreshCalculate",rowIndex:p,colIndex:n,sheetIndex:l}),u)&&!(t=t||i.isFormulaDependent)&&Zoe(u,g,p,n);break;case"Clear Hyperlinks":delete f.hyperlink;break;case"Clear All":r=!(!f.value&&!f.formula),Jre(p,n,h,{},!1),r&&(this.parent.notify(Pie,i={action:"refreshCalculate",rowIndex:p,colIndex:n,sheetIndex:l}),u)&&!t&&(t=i.isFormulaDependent)}}(g.length||t)&&l===this.parent.activeSheetIndex&&this.parent.notify(_ne,{cfModel:!t&&g,refreshAll:t,isAction:!0})},rde.prototype.destroy=function(){this.removeEventListener(),this.parent=null},rde.prototype.getModuleName=function(){return"workbookcellformat"};var ode=rde;function rde(e){this.parent=e,this.addEventListener()}ade.prototype.destroy=function(){this.removeEventListener(),this.parent=null},ade.prototype.addEventListener=function(){this.parent.on(Bie,this.performEditOperation,this)},ade.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Bie,this.performEditOperation)},ade.prototype.getModuleName=function(){return"workbookEdit"},ade.prototype.performEditOperation=function(e){"updateCellValue"===e.action&&(e.isFormulaDependent=this.updateCellValue(e.address,e.value,e.sheetIndex,e.isValueOnly,e.skipFormatCheck,e.isRandomFormula,e.skipCellFormat,e.isDelete,e.deletedRange,e.fillType,e.cellInformation,e.isRedo,e.isDependentUpdate,e.actionName,e.isPaste))},ade.prototype.updateCellValue=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u,g){void 0===i&&(i=this.parent.activeSheetIndex),m="string"==typeof e?rte(e):e;var m,f,y=_re(this.parent,i),v=(v=Kre(m[0],m[1],y,!0))||(y.rows[m[0]].cells[m[1]]={});if(n)v.value=t,v.formattedText&&delete v.formattedText;else{var n=Poe(t),n="#SPILL!"===t||n,b=!1,w=(v.formula&&-1<v.formula.indexOf("UNIQUE")&&""===t&&(b=!0),!("Text"===Yhe(v.format)||n&&t.toLowerCase().startsWith("=text("))),g=((n="Text"!==Yhe(v.format)&&n)||b||(v.formula&&(v.formula=""),v.value=w?vre(t,g):t),{action:"refreshCalculate",value:t,rowIndex:m[0],colIndex:m[1],sheetIndex:i,isFormula:n,isRandomFormula:r,isDelete:a,deletedRange:l,fillType:h,isDependentRefresh:c});if(w&&!o&&(l={value:t,rowIndex:m[0],colIndex:m[1],sheetIndex:i,updatedVal:"",skipCellFormat:s},n?!je(t)&&t.toLowerCase().includes("unique(")&&0<t.length&&(v.value=t):(h=Yhe(v.format),w=t?t.toString().split("/"):[],("Number"!==h&&"Percentage"!==h&&"Fraction"!==h&&("Scientific"!==h||2!==w.length)||"Fraction"===h&&2!==w.length)&&this.parent.notify(Fie,l),!je(l.updatedVal)&&0<l.updatedVal.length?v.value=l.updatedVal:this.parent.isEdit&&t&&!mre(t)&&(s=ki(this.parent.locale,oe),v.format?(t.includes("%")||t.includes(s))&&ise(v.format)?(this.parent.notify(Aie,h={formattedText:t,value:t,format:"General",cell:{value:t,format:"General"},isEdit:!0}),"General"!==h.format&&-1<["Currency","Percentage"].indexOf(Yhe(h.format))&&(v.format=h.format,v.value=h.value)):(w={value:v.value,format:v.format,formattedText:v.value,type:"General",cell:v,rowIndex:m[0],colIndex:m[1]},this.parent.notify(Aie,w)):(t.includes(s)||t.includes("%")||t.includes(Mi(this.parent.locale).group))&&(l=new Ti,this.parent.notify(Lie,{args:{intl:l,updateValue:!0,value:"",curSymbol:s,cell:v},intl:l,fResult:t,cell:v}))))),"#SPILL!"===t)v.value=t;else if(this.parent.notify(Uie,{cellIdx:m,isUnique:!1}),"Manual"===this.parent.calculationMode&&n&&je(c)&&("autofill"!==u||""!==v.formula)&&!this.parent.isEdit&&je(this.parent.element.querySelector(".e-text-replaceInp"))&&(b=!0,p||void 0!==v.value||(b=!1)),b||a?t=v.value:(this.parent.notify(Pie,g),f=g.isFormulaDependent),n){if(v.formula=g.value,!("Manual"===this.parent.calculationMode&&b&&p&&!this.parent.isEdit&&d&&d.cellDetails&&0<d.cellDetails.length&&0===d.cutCellDetails.length)||je(d.cellDetails[0].autoFillText)&&je(d.cellDetails[0].copyCellValue))t=v.value,"Manual"===this.parent.calculationMode&&d&&p&&d.displayText&&(t=v.value=d.displayText);else for(var C=0;C<d.cellDetails.length;C++)if(d.cellDetails[C].rowIndex===e[0]&&d.cellDetails[C].colIndex===e[1]){t=d.cellDetails[C].copyCellValue?v.value=d.cellDetails[C].copyCellValue:v.value=d.cellDetails[C].autoFillText;break}h=v.formula.toLowerCase(),w="Scientific"===Yhe(v.format)&&!o&&this.parent.isEdit;"=now()"!==h||v.format&&"General"!==v.format&&!w?!h.includes("=time(")||v.format&&!w?h.includes("=date(")&&w&&(v.format=Ghe("ShortDate")):v.format="h:mm AM/PM":v.format=Ghe("ShortDate")+" h:mm"}else!v.value||"string"!=typeof v.value||0!==v.value.indexOf("www.")&&0!==v.value.indexOf("https://")&&0!==v.value.indexOf("http://")&&0!==v.value.indexOf("ftp://")||this.parent.notify(nne,{hyperlink:v.value,cell:y.name+"!"+lte(m[0],m[1])})}return this.parent.setUsedRange(m[0],m[1],y),!this.parent.chartColl.length||this.parent.isEdit||r||this.parent.notify(Gne,{cell:v,rIdx:m[0],cIdx:m[1],sheetIdx:i,isRefreshChart:!0}),f};var sde=ade;function ade(e){this.parent=e,this.addEventListener()}hde.prototype.destroy=function(){this.removeEventListener(),this.parent=null},hde.prototype.addEventListener=function(){this.parent.on(nne,this.setLinkHandler,this)},hde.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(nne,this.setLinkHandler)},hde.prototype.setLinkHandler=function(e){var t=e.hyperlink;if((o=e.cell)&&-1!==o.indexOf("!")){var i=o.lastIndexOf("!"),n=_re(this.parent,Bre(this.parent,o.substring(0,i))),o=o.substring(i+1);if(!n)return}else n=this.parent.getActiveSheet(),o=o||n.selectedRange;var r=!e.triggerEvt&&n.isProtected;if(!r||n.protectSettings.insertLink)for(var s,a=fte(rte(o)),l=("string"==typeof t?0===t.toLowerCase().indexOf("www.")&&(t="http://"+t):0===t.address.toLowerCase().indexOf("www.")&&(t.address="http://"+t.address),rte(n.activeCell)),h=a[0];h<=a[2];h++)for(var d=a[1];d<=a[3];d++)r&&Hoe(Kre(h,d,n),Kde(n,d))||(s={hyperlink:t},je(e.displayText)||(!e.triggerEvt&&!e.isUndoRedo||h===l[0]&&d===l[1])&&(s.value=e.displayText,delete s.formattedText),s.style={textDecoration:"underline",color:"#00e"},Yoe(this.parent,n,{cell:s,rowIdx:h,colIdx:d,preventEvt:!e.triggerEvt}))},hde.prototype.getModuleName=function(){return"workbookHyperlink"};var lde=hde;function hde(e){this.parent=e,this.addEventListener()}pde.prototype.insertModel=function(e){var t,i=this;if(e.model){var n,o,r,s=[];if("number"==typeof e.start){n=e.start,e.end=e.end||n,n>e.end&&(n=e.end,e.end=e.start),"Row"===e.modelType&&n<e.model.maxHgts.length&&(r=[]);for(var a=n;a<=e.end;a++)s.push({}),r&&r.push(null)}else e.start?(n=e.start[0].index||0,s=e.start,o=!0):(n=0,s.push({})),"Row"===e.modelType&&n<e.model.maxHgts.length&&(r=[],s.forEach(function(){r.push(null)}));var l={model:s,index:n,modelType:e.modelType,insertType:e.insertType,cancel:!1,isUndoRedo:e.isUndoRedo},h={eventArgs:l,action:"insert"};if(e.isAction){if(this.parent.notify(fie,h),l.cancel)return;delete l.cancel,l.isAction=e.isAction}var d={startIndex:n,endIndex:n+s.length-1,modelType:e.modelType,sheet:e.model,isInsert:!0};if("Row"===e.modelType){if(void 0!==e.checkCount&&e.model.rows&&e.checkCount===e.model.rows.length)return;if(this.parent.notify(coe,d),e.model=e.model,e.model.rows||(e.model.rows=[]),o&&-1<e.model.usedRange.rowIndex&&n>e.model.usedRange.rowIndex)for(a=e.model.usedRange.rowIndex;a<n-1;a++)s.splice(0,0,{});for(var p,c,u,g=this.parent.frozenRowCount(e.model),m=((n<g||n<=g&&e.freezePane)&&(D=e.model.frozenRows+s.length-(n===g&&0<g?1:0),this.parent.setSheetPropertyOnMute(e.model,"frozenRows",D),l.freezePane=!0),(D=e.model.rows).splice.apply(D,[n,0].concat(s)),r&&(D=e.model.maxHgts).splice.apply(D,[n,0].concat(r)),this.setRowColCount(d.startIndex,d.endIndex,e.model,"row"),n>e.model.usedRange.rowIndex?this.parent.setUsedRange(n+(s.length-1),e.model.usedRange.colIndex,e.model,!0):this.parent.setUsedRange(e.model.usedRange.rowIndex+s.length,e.model.usedRange.colIndex,e.model,!0),n+s.length),f=void 0,y=void 0,v=this,a=0;a<=e.model.usedRange.colIndex;a++)!function(t){e.model.rows[m]&&e.model.rows[m].cells&&e.model.rows[m].cells[t]&&void 0!==(f=e.model.rows[m].cells[t]).rowSpan&&f.rowSpan<0&&void 0===f.colSpan&&(y={range:[m,t,m,t],insertCount:s.length,insertModel:"Row"},v.parent.notify(One,y),!l.freezePane)&&y.range[0]<g&&y.range[2]>g&&(l.freezePane=!0),u=Kre(n-1,t,e.model,!1,!0),p=u.style,f=Kre(n+1,t,e.model,!1,!0),(p||u.wrap)&&(p&&(c={},Object.keys(p).forEach(function(e){"borderLeft"!==e&&"borderRight"!==e&&"borderTop"!==e&&"borderBottom"!==e&&(c[e]=p[e])}),f.style)&&v.checkBorder(f.style,e.model.rows[n-1].cells[t].style,c),e.isUndoRedo&&!e.isRedo||s.forEach(function(e){e.cells||(e.cells=[]),e.cells[t]||(e.cells[t]={}),p&&(e.cells[t].style||(e.cells[t].style={}),Object.assign(e.cells[t].style,c)),u.wrap&&(e.cells[t].wrap=!0)}))}(a);l.sheetCount=e.model.rows.length}else if("Column"===e.modelType){if(void 0!==e.checkCount&&e.model.columns&&e.checkCount===e.model.columns.length)return;this.parent.notify(coe,d),e.model=e.model,e.model.columns||(e.model.columns=[]),n&&!e.model.columns[n-1]&&(e.model.columns[n-1]={}),(D=e.model.columns).splice.apply(D,[n,0].concat(s));var b=this.parent.frozenColCount(e.model),w=((n<b||n<=b&&e.freezePane)&&(D=e.model.frozenColumns+s.length-(n===b&&0<b?1:0),this.parent.setSheetPropertyOnMute(e.model,"frozenColumns",D),l.freezePane=!0),this.setRowColCount(d.startIndex,d.endIndex,e.model,"col"),n>e.model.usedRange.colIndex?this.parent.setUsedRange(e.model.usedRange.rowIndex,n+(s.length-1),e.model,!0):this.parent.setUsedRange(e.model.usedRange.rowIndex,e.model.usedRange.colIndex+s.length,e.model,!0),e.model.rows||(e.model.rows=[]),[]);e.columnCellsModel||(e.columnCellsModel=[]);for(a=0;a<s.length;a++)w.push(null);for(var C,S,A,x=[],f=void 0,a=0;a<=e.model.usedRange.rowIndex;a++){e.model.rows[a]?e.model.rows[a].cells||(e.model.rows[a].cells=[]):e.model.rows[a]={cells:[]},n&&!e.model.rows[a].cells[n-1]&&(e.model.rows[a].cells[n-1]={}),(t=e.model.rows[a].cells).splice.apply(t,[n,0].concat(e.columnCellsModel[a]&&e.columnCellsModel[a].cells?e.columnCellsModel[a].cells:w));m=n+s.length;if(e.model.rows[a].cells[m]&&void 0!==(f=e.model.rows[a].cells[m]).colSpan&&f.colSpan<0&&void 0===f.rowSpan&&x.push({range:[a,m,a,m],insertCount:w.length,insertModel:"Column"}),A=Kre(a,n-1,e.model,!1,!0),C=A.style,f=Kre(a,n+1,e.model,!1,!0),(C||A.wrap)&&(C&&(S={},Object.keys(C).forEach(function(e){"borderLeft"!==e&&"borderRight"!==e&&"borderTop"!==e&&"borderBottom"!==e&&(S[e]=C[e])}),f.style)&&this.checkBorder(f.style,e.model.rows[a].cells[n-1].style,S),!e.isUndoRedo||e.isRedo))for(var I=n;I<m;I++)e.model.rows[a].cells[I]||(e.model.rows[a].cells[I]={}),C&&(e.model.rows[a].cells[I].style||(e.model.rows[a].cells[I].style={}),Object.assign(e.model.rows[a].cells[I].style,S)),A.wrap&&(e.model.rows[a].cells[I].wrap=!0)}x.forEach(function(e){i.parent.notify(One,e),!l.freezePane&&e.range[1]<b&&e.range[3]>b&&(l.freezePane=!0)}),l.sheetCount=e.model.columns.length}else{if(void 0!==e.checkCount&&e.checkCount===this.parent.sheets.length)return;for(var T,E=s,D=Wre(this.parent),d=e.isFromUpdateAction,a=0;a<E.length;a++)if(E[a].name)for(I=0;I<this.parent.sheets.length;I++)if(E[a].name===this.parent.sheets[I].name){E.splice(a,1),a--;break}if(!E.length)return;delete s[0].index,this.parent.createSheet(n,s),e.activeSheetIndex?(l.activeSheetIndex=e.activeSheetIndex,this.parent.setProperties({activeSheetIndex:e.activeSheetIndex},!0)):!e.isAction&&e.start<this.parent.activeSheetIndex&&this.parent.setProperties({activeSheetIndex:this.parent.skipHiddenSheets(this.parent.activeSheetIndex)},!0),d&&this.parent.setProperties({activeSheetIndex:Bre(this.parent,D)},!0),s.forEach(function(e){o&&i.updateRangeModel(e.ranges);var t=i.parent.viewport,t={sheet:e,resolveAfterFullDataLoaded:!0,indexes:[t.topIndex,t.leftIndex,t.bottomIndex,t.rightIndex],promise:new Promise(function(e){e(void 0)})};i.parent.notify(die,t),T=e.id,i.parent.notify(Pie,{action:"addSheet",visibleName:e.name,sheetName:"Sheet"+T,sheetId:T})}),l.activeSheetIndex=e.activeSheetIndex,l.sheetCount=this.parent.sheets.length}"Sheet"!==e.modelType&&(this.insertConditionalFormats(e),this.parent.notify(hoe,{start:n,end:n+s.length-1,modelType:e.modelType,model:e.model,isInsert:!0}),l.activeSheetIndex=Bre(this.parent,e.model.name)),this.parent.notify(lne,h)}},pde.prototype.setRowColCount=function(e,t,i,n){var o=n+"Count";this.parent.setSheetPropertyOnMute(i,o,i[o]+(t-e+1)),i.id===this.parent.getActiveSheet().id&&this.parent.notify(kie,{index:i[o]-1,update:n,isInsert:!0,start:e,end:t})},pde.prototype.updateRangeModel=function(e){e.forEach(function(e){e.dataSource&&(e.startCell=e.startCell||"A1",e.showFieldAsHeader=void 0===e.showFieldAsHeader||e.showFieldAsHeader,e.template=e.template||"",e.address=e.address||"A1")})},pde.prototype.checkBorder=function(e,t,i){e.borderLeft&&e.borderLeft===t.borderLeft&&(i.borderLeft=e.borderLeft),e.borderRight&&e.borderRight===t.borderRight&&(i.borderRight=e.borderRight),e.borderTop&&e.borderTop===t.borderTop&&(i.borderTop=e.borderTop),e.borderBottom&&e.borderBottom===t.borderBottom&&(i.borderBottom=e.borderBottom)},pde.prototype.setInsertInfo=function(e,t,i,n,o){void 0===o&&(o="Row");var r=i=t+(i-1);e.ranges.forEach(function(e){e.info&&t<e.info[""+n]&&(e.info["insert"+o+"Range"]?e.info["insert"+o+"Range"].push([t,r]):e.info["insert"+o+"Range"]=[[t,r]],e.info[""+n]+=r-t+1)})},pde.prototype.insertConditionalFormats=function(e){var t=e.model.conditionalFormats;if("delete"===e.prevAction)this.parent.setSheetPropertyOnMute(e.model,"conditionalFormats",e.conditionalFormats);else if(t)for(var i=0,n=t.length;i<n;i++)t[i].range=hte(Koe(e,rte(t[i].range),!e.isAction&&!e.isUndoRedo))},pde.prototype.addEventListener=function(){this.parent.on(dne,this.insertModel,this)},pde.prototype.destroy=function(){this.removeEventListener(),this.parent=null},pde.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(dne,this.insertModel)},pde.prototype.getModuleName=function(){return"workbookinsert"};var dde=pde;function pde(e){this.parent=e,this.addEventListener()}ude.prototype.deleteModel=function(e){var t=this,i=this.parent.sheets.length;if("Sheet"!==e.modelType||1!==i){var i=e.modelType.toLowerCase()+"s",n=(e.start=e.start,e.start>e.end&&(n=e.start,e.start=e.end,e.end=n),{startIndex:e.start,endIndex:e.end,modelType:e.modelType,cancel:!1,isUndoRedo:e.isUndoRedo}),o={eventArgs:n,action:"delete"};if(!e.isAction||(this.parent.notify(fie,o),!n.cancel)){var r,s,a=[],l=e.end-e.start+1,h={startIndex:e.start,endIndex:e.end,modelType:e.modelType,sheet:e.model,isDelete:!0},d=this.parent.scrollSettings.isFinite;if("Row"===e.modelType){if(void 0!==e.checkCount&&e.checkCount===e.model.usedRange.rowIndex)return;if(this.parent.notify(coe,h),e.model=e.model,d){if(e.start>=e.model.rowCount)return;e.end>=e.model.rowCount&&(e.end=e.model.rowCount-1)}else{if(e.start>e.model.usedRange.rowIndex)return;e.end>e.model.usedRange.rowIndex&&(e.end-=e.end-e.model.usedRange.rowIndex)}this.setRowColCount(e.start,e.end,e.model,"row"),e.start<=e.model.usedRange.rowIndex&&(this.parent.setSheetPropertyOnMute(e.model,"usedRange",{rowIndex:e.model.usedRange.rowIndex-(e.end-e.start+1),colIndex:e.model.usedRange.colIndex}),e.model.usedRange.rowIndex<0)&&this.parent.setSheetPropertyOnMute(e.model,"usedRange",{rowIndex:0,colIndex:e.model.usedRange.colIndex});var p=this.parent.frozenRowCount(e.model),c=(e.start<p&&(p=e.end<p?e.end-e.start+1:p-e.start,p=e.model.frozenRows-p,this.parent.setSheetPropertyOnMute(e.model,"frozenRows",p),n.freezePane=!0),e.end+1),u=void 0,g=void 0;if(e.model.rows[e.start]&&e.model.rows[e.start].cells)for(var m=0;m<=e.model.usedRange.colIndex;m++)e.model.rows[e.start].cells[m]&&void 0!==e.model.rows[e.start].cells[m].rowSpan&&e.model.rows[e.start].cells[m].rowSpan<0&&void 0===e.model.rows[e.start].cells[m].colSpan&&(g={range:[e.start,m,e.start,m]},this.parent.notify(Rne,g),g.range,g.range[2]<=e.end)&&((s=Kre(g.range[0],m,e.model))&&1<s.rowSpan&&(1<s.rowSpan-(g.range[2]-e.start+1)?Jre(g.range[0],m,e.model,{colSpan:s.rowSpan-(g.range[2]-e.start+1)},!0):delete e.model.rows[g.range[0]].cells[m].rowSpan),g=null),e.model.rows[c]&&e.model.rows[c].cells&&e.model.rows[c].cells[m]&&void 0!==e.model.rows[c].cells[m].rowSpan&&e.model.rows[c].cells[m].rowSpan<0&&void 0===e.model.rows[c].cells[m].colSpan&&(g||this.parent.notify(Rne,g={range:[c,m,c,m]}),u=new Object,g.range=g.range,Object.assign(u,Kre(g.range[0],g.range[1],e.model)),u)&&u.rowSpan&&(1<u.rowSpan||1<u.colSpan)&&((y=[])[1]=m,y[3]=1<u.colSpan?m+(u.colSpan-1):m,g.range=g.range,g.range[0]<e.start?(y[0]=y[2]=g.range[0],1<u.rowSpan-l&&(y[2]+=u.rowSpan-l-1)):(y[0]=y[2]=e.start,1<u.rowSpan-(e.end-g.range[0]+1)&&(y[2]+=u.rowSpan-(e.end-g.range[0]+1)-1)),a.push({range:y,isAction:!1,preventRefresh:!0,merge:!0,type:"All",skipChecking:!0})),g=null;n.sheetCount=e.model.usedRange.rowIndex}else if("Column"===e.modelType){if(void 0!==e.checkCount&&e.checkCount===e.model.usedRange.colIndex)return;if(this.parent.notify(coe,h),e.model=e.model,d){if(e.start>=e.model.colCount)return;e.end>=e.model.colCount&&(e.end=e.model.colCount-1)}else{if(e.start>e.model.usedRange.colIndex)return;e.end>e.model.usedRange.colIndex&&(e.end-=e.end-e.model.usedRange.colIndex)}this.setRowColCount(e.start,e.end,e.model,"col"),e.start<=e.model.usedRange.colIndex&&(this.parent.setSheetPropertyOnMute(e.model,"usedRange",{rowIndex:e.model.usedRange.rowIndex,colIndex:e.model.usedRange.colIndex-l}),e.model.usedRange.colIndex<0)&&this.parent.setSheetPropertyOnMute(e.model,"usedRange",{rowIndex:e.model.usedRange.rowIndex,colIndex:0});for(var f,y,p=this.parent.frozenColCount(e.model),c=(e.start<p&&(p=e.end<p?e.end-e.start+1:p-e.start,p=e.model.frozenColumns-p,this.parent.setSheetPropertyOnMute(e.model,"frozenColumns",p),this.parent.updateTopLeftCell(),n.freezePane=!0),r=[],e.end+1),u=void 0,g=void 0,m=0;m<=e.model.usedRange.rowIndex;m++)r.push({}),e.model.rows[m]&&e.model.rows[m].cells&&(e.model.rows[m].cells[e.start]&&void 0!==e.model.rows[m].cells[e.start].colSpan&&e.model.rows[m].cells[e.start].colSpan<0&&void 0===e.model.rows[m].cells[e.start].rowSpan&&(g={range:[m,e.start,m,e.start]},this.parent.notify(Rne,g),g.range=g.range,g.range[3]<=e.end)&&((f=Kre(m,g.range[1],e.model))&&1<f.colSpan&&(1<f.colSpan-(g.range[3]-e.start+1)?Jre(m,g.range[1],e.model,{colSpan:f.colSpan-(g.range[3]-e.start+1)},!0):delete e.model.rows[m].cells[g.range[1]].colSpan),g=null),e.model.rows[m].cells[c]&&void 0!==e.model.rows[m].cells[c].colSpan&&e.model.rows[m].cells[c].colSpan<0&&void 0===e.model.rows[m].cells[c].rowSpan&&(g||this.parent.notify(Rne,g={range:[m,c,m,c]}),u=new Object,g.range=g.range,Object.assign(u,Kre(g.range[0],g.range[1],e.model)),u)&&u.colSpan&&(1<u.colSpan||1<u.rowSpan)&&((y=[])[0]=m,y[2]=1<u.rowSpan?m+(u.rowSpan-1):m,g.range=g.range,g.range[1]<e.start?(y[1]=y[3]=g.range[1],1<u.colSpan-l&&(y[3]+=u.colSpan-l-1)):(y[1]=y[3]=e.start,1<u.colSpan-(e.end-g.range[1]+1)&&(y[3]+=u.colSpan-(e.end-g.range[1]+1)-1)),a.push({range:y,isAction:!1,preventRefresh:!0,merge:!0,type:"All",skipChecking:!0})),r[m].cells=e.model.rows[m].cells.splice(e.start,l),g=null);n.sheetCount=e.model.usedRange.colIndex,n.deletedCellsModel=r}else{if(e.end-e.start==this.parent.sheets.length-1||void 0!==e.checkCount&&e.checkCount===this.parent.sheets.length)return;this.parent.notify(coe,h),n.sheetCount=this.parent.sheets.length,n.activeSheetIndex=this.parent.activeSheetIndex}for(var v=[],b="Row"===e.modelType&&e.start<e.model.maxHgts.length,w=e.model[i],m=e.start;m<=e.end;m++)"Sheet"===e.modelType&&w[m]&&this.parent.notify(Pie,{action:"deleteSheetTab",sheetId:w[m].id}),w[e.start]||e.start<w.length?(v.push(w[e.start]||{}),w.splice(e.start,1)):v.push({}),m===e.start&&(v[0].index=e.start),b&&e.model.maxHgts.splice(e.start,1);a.forEach(function(e){return t.parent.notify(Bne,e)}),this.parent.notify(eoe,e),"Sheet"!==e.modelType&&(this.parent.notify(hoe,e),n.refreshSheet=e.refreshSheet,n.activeSheetIndex=Bre(this.parent,e.model.name),n.conditionalFormats=[],this.deleteConditionalFormats(e,n)),n.definedNames=h.definedNames,n.isAction=e.isAction,n.deletedModel=v,delete n.cancel,this.parent.notify(hne,o)}}},ude.prototype.setRowColCount=function(e,t,i,n){var o=n+"Count",r=i[o];(t=r<=t?r-1:t)<e||(this.parent.setSheetPropertyOnMute(i,o,r-(t-e+1)),i.id===this.parent.getActiveSheet().id&&this.parent.notify(kie,{index:r-1,update:n,isDelete:!0,start:e,end:t}))},ude.prototype.deleteConditionalFormats=function(e,t){var i=e.model.conditionalFormats;if(i)for(var n=0;n<i.length;n++){t.conditionalFormats.push(Pe({},i[n],null,!0));var o=rte(i[n].range),r=rte(e.model.selectedRange);"Column"===e.modelType&&r[1]<=o[1]&&r[3]>=o[3]||"Row"===e.modelType&&r[0]<=o[0]&&r[2]>=o[2]?(i.splice(i.indexOf(i[n]),1),n--):i[n].range=hte(Joe(e,o))}},ude.prototype.addEventListener=function(){this.parent.on(pne,this.deleteModel,this)},ude.prototype.destroy=function(){this.removeEventListener(),this.parent=null},ude.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(pne,this.deleteModel)},ude.prototype.getModuleName=function(){return"workbookdelete"};var cde=ude;function ude(e){this.parent=e,this.addEventListener()}mde.prototype.destroy=function(){this.removeEventListener(),this.highlightInvalidData=null,this.parent=null},mde.prototype.addEventListener=function(){this.parent.on(une,this.updateValidationHandler,this),this.parent.on(gne,this.addHighlightHandler,this),this.parent.on(Cne,this.removeHighlightHandler,this),this.parent.on($ne,this.beforeInsertDeleteHandler,this),this.parent.on(eoe,this.beforeInsertDeleteHandler,this),this.parent.on(coe,this.beforeInsertDeleteHandler,this)},mde.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(une,this.updateValidationHandler),this.parent.off(gne,this.addHighlightHandler),this.parent.off(Cne,this.removeHighlightHandler),this.parent.off($ne,this.beforeInsertDeleteHandler),this.parent.off(eoe,this.beforeInsertDeleteHandler),this.parent.off(coe,this.beforeInsertDeleteHandler))},mde.prototype.updateValidationHandler=function(t){var i,e,n,o,r,s,a,l,h,d,p,c,u,g,m,f,y,v,b,w=this,C=t.range.lastIndexOf("!"),S=(e=-1<C?(h=t.range.substring(0,C),t.range=t.range.substring(C+1),C=Bre(this.parent,h),i=_re(this.parent,C),C===this.parent.activeSheetIndex):(i=this.parent.getActiveSheet(),!0),this.getRangeWhenColumnSelected(t.range,i)),A=(h&&(t.range=h+"!"+S.range),fte(rte(S.range))),x={colIdx:A[1]};for(e&&(a=this.parent.frozenRowCount(i),l=this.parent.frozenColCount(i),h=(C=this.parent).viewport||{},p=C.scrollSettings&&C.scrollSettings.enableVirtualization?[a+h.topIndex,l+h.leftIndex,h.bottomIndex,h.rightIndex]:[0,0,i.rowCount-1,i.colCount-1],S.isFullCol&&(d=[[p[0],p[2]]],a&&d.push([rte(i.topLeftCell)[0],a-1]),s=function(t){t.isHighlighted&&(x.colIdx>=p[1]&&x.colIdx<=p[3]||x.colIdx<l)&&!epe(i,x.colIdx)&&d.forEach(function(e){for(x.rowIdx=e[0];x.rowIdx<=e[1];x.rowIdx++)zde(i,x.rowIdx)||(x.cell=Kre(x.rowIdx,x.colIdx,i,!1,!0),x.validation=x.cell.validation||t,w.parent.notify(Zne,x))})}),r=function(e){e.isHighlighted&&o&&(x.colIdx>=p[1]&&x.colIdx<=p[3]||x.colIdx<l)&&!epe(i,x.colIdx)&&w.parent.notify(Zne,x)}),t.isRemoveValidation?e&&((g=rte(i.activeCell))[0]>=A[0]&&g[1]>=A[1]&&g[0]<=A[2]&&g[1]<=A[3]&&(u=(b=Kre(g[0],g[1],i,!1,!0).validation||tpe(i.columns[A[1]],g[0],g[1])&&i.columns[g[1]].validation)&&"List"===b.type),x.isRemoveValidation=!0,x.isRemoveHighlightedData=!0):(t.isAction&&this.highlightInvalidData&&(c={isHighlighted:this.highlightInvalidData}),"List"===t.rules.type?(g=rte(i.activeCell),u=e&&g[0]>=A[0]&&g[1]>=A[1]&&g[0]<=A[2]&&g[1]<=A[3],t.rules.value1&&(t.rules.value1=t.rules.value1.trim(),t.rules.value1[t.rules.value1.length-1]===this.parent.listSeparator)&&(t.rules.value1=t.rules.value1.substring(0,t.rules.value1.length-1))):"Custom"!==t.rules.type||je(t.rules.value2)||delete t.rules.value2,e&&(x.removeOnValidData=!0),m=Poe(t.rules.value1),f=Poe(t.rules.value2),y=function(e){m&&(x.validation.value1=Uoe([e,x.colIdx,e,x.colIdx],A,i,w.parent,{formula:t.rules.value1})),f&&(x.validation.value2=Uoe([e,x.colIdx,e,x.colIdx],A,i,w.parent,{formula:t.rules.value2}))}),x.colIdx;x.colIdx<=A[3];x.colIdx++){if(S.isFullCol){if(!t.isRemoveValidation){x.validation=Object.assign({},t.rules,c),y(0),i.columns[x.colIdx]||(i.columns[x.colIdx]={}),i.columns[x.colIdx].validation=x.validation,e&&s(x.validation);continue}(n=i.columns[x.colIdx])&&n.validation&&(e&&s(n.validation),delete n.validation)}for(x.rowIdx=A[0];x.rowIdx<=A[2];x.rowIdx++)o=e&&(x.rowIdx>=p[0]&&x.rowIdx<=p[2]||x.rowIdx<a)&&!zde(i,x.rowIdx),t.isRemoveValidation?((n=i.columns[x.colIdx])&&n.validation&&(x.rowIdx===A[2]&&(n.validation.address=_oe(n.validation.address,[A[0],x.colIdx,A[2],x.colIdx],x.colIdx)),e)&&r(n.validation),(v=Kre(x.rowIdx,x.colIdx,i))&&v.validation&&!Yoe(this.parent,i,{cell:{validation:{}},rowIdx:x.rowIdx,colIdx:x.colIdx})&&(e&&r(v.validation),delete v.validation)):(x.validation=Object.assign({},t.rules,c),y(x.rowIdx),Yoe(this.parent,i,{cell:{validation:x.validation},rowIdx:x.rowIdx,colIdx:x.colIdx})||e&&(x.cell=Kre(x.rowIdx,x.colIdx,i),r(x.validation)))}u&&(b=(b=(v=Kre(g[0],g[1],i,!1,!0)).validation)||(tpe(i.columns[g[1]],g[0],g[1])?i.columns[g[1]].validation:{}),this.parent.notify(Toe,{validation:b,cell:v,rowIdx:g[0],colIdx:g[1],isRefresh:!0}))},mde.prototype.addHighlightHandler=function(e){e.isAction&&(this.highlightInvalidData=!0),this.invalidDataHandler(e.range)},mde.prototype.removeHighlightHandler=function(e){e.isAction&&(this.highlightInvalidData=null),this.invalidDataHandler(e.range,!0)},mde.prototype.invalidDataHandler=function(e,i){function n(){for(r=p[0];r<=p[2];r++)for(a=d&&(r>=v[0]&&r<=v[2]||r<f)&&!zde(m,r),l&&(h=_de(m,r),c=Math.max(h&&h.cells?h.cells.length-1:null,m.columns.length-1,p[3])),s=p[1];s<=c;s++)o=Kre(r,s,m,!1,!0),t=m.columns[s],o.validation?w(o.validation,!0,t):tpe(t,r,s)&&w(t.validation,r===p[2])}var o,t,r,s,a,l,h,d,p,c,u=this,g=this.parent,m=this.parent.getActiveSheet(),f=this.parent.frozenRowCount(m),y=this.parent.frozenColCount(m),v=g.scrollSettings&&g.scrollSettings.enableVirtualization?g.viewport?[f+g.viewport.topIndex,y+g.viewport.leftIndex,g.viewport.bottomIndex,g.viewport.rightIndex]:[]:[0,0,m.rowCount-1,m.colCount-1],b=function(e,t){a&&(s>=v[1]&&s<=v[3]||s<y)&&!epe(m,s)&&u.parent.notify(Zne,{isRemoveHighlightedData:i,rowIdx:r,colIdx:s,cell:o,validation:e,removeOnValidData:!0,col:t})},w=i?function(e,t){e.isHighlighted&&(t&&delete e.isHighlighted,b(e))}:function(e,t,i){t&&(e.isHighlighted=!0),b(e,i)};e?(d=!e.includes("!")||(g=mte(this.parent,e),m=_re(this.parent,g),e=cte(e),g===this.parent.activeSheetIndex),c=(p=fte(rte(this.getRangeWhenColumnSelected(lre(m,e),m).range)))[3],n()):(l=!0,this.parent.sheets.forEach(function(e,t){m=e,p=[0,0,Math.max(m.rows.length-1,v[2]),Math.max(m.usedRange.colIndex,v[3])],d=t===u.parent.activeSheetIndex,n()}))},mde.prototype.beforeInsertDeleteHandler=function(n){var i,t=this;if("Sheet"===n.modelType){if(n.name!==coe)return;i=!0}else if(n.name===coe)return;var o,r,s,a,l=n.name===$ne;if(l)s=_re(this.parent,n.activeSheetIndex),r=n.index+(n.model.length-1),o={insertDeleteArgs:{startIndex:n.index,endIndex:r,modelType:n.modelType,isInsert:!0,sheet:s},sheetIdx:n.activeSheetIndex},a=n.index-1;else if(i){var e=[],h={action:"getSheetInfo",sheetInfo:[]};this.parent.notify(Pie,h);for(var d=n.startIndex;d<=n.endIndex;d++)for(var p=this.parent.sheets[d].id,c=0;c<h.sheetInfo.length;c++)if(h.sheetInfo[c].index===p){e.push(h.sheetInfo[c].sheet);break}o={sheetNames:e}}else s=n.model,o={insertDeleteArgs:{startIndex:n.start,modelType:n.modelType,endIndex:n.end,sheet:s},sheetIdx:Fre(this.parent,s.id)};function u(e,t){if(e){o.insertDeleteArgs.forceUpdate=!0;for(var i=n.index;i<=r;i++)e=Pe({},e),C(e),t?Jde(s,i,{validation:e}):S?Jre(v,i,s,{validation:e},!0):Jre(i,b,s,{validation:e},!0);delete o.insertDeleteArgs.forceUpdate}}var g,m,f,y,v,b,w,C=function(e){!Poe(e.value1)||o.otherSheet&&!e.value1.includes(s.name)||(o.cell={formula:e.value1},t.parent.notify(uoe,o),e.value1=o.cell.formula),!Poe(e.value2)||o.otherSheet&&!e.value2.includes(s.name)||(o.cell={formula:e.value2},t.parent.notify(uoe,o),e.value2=o.cell.formula)},S="Column"===n.modelType;this.parent.sheets.forEach(function(e,t){if(i){if(t>=n.startIndex&&t<=n.endIndex)return}else t===o.sheetIdx?(w=l,delete o.otherSheet,delete o.formulaSheet):(o.otherSheet=!0,o.formulaSheet=e,w=!1);for(f=e.usedRange.rowIndex+1,b=0,y=e.usedRange.colIndex+1;b<y;b++)if(!(w&&S&&b>=n.index&&b<=r))for((m=e.columns&&e.columns[b])&&m.validation&&(C(m.validation),w)&&S&&a===b&&u(m.validation,!0),v=0;v<f;v++)(g=Kre(v,b,e,!1,!0)).validation&&(!w||S||v<n.index||r<v)&&(C(g.validation),w)&&a===(S?b:v)&&u(g.validation)})},mde.prototype.getRangeWhenColumnSelected=function(e,t){var i,n=e.split(":");return e.match(/\D/g)&&!e.match(/[0-9]/g)?(n[0]+=1,n[1]+=t.rowCount,e=n[0]+":"+n[1],i=!0):!e.match(/\D/g)&&e.match(/[0-9]/g)&&(n[0]="A"+n[0],n[1]=lte(0,t.colCount-1).replace(/[0-9]/g,"")+n[1],e=n[0]+":"+n[1]),{range:e,isFullCol:i}},mde.prototype.getModuleName=function(){return"workbookDataValidation"};var gde=mde;function mde(e){this.parent=e,this.addEventListener()}var fde=function(){return(fde=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},yde=(vde.prototype.destroy=function(){this.removeEventListener(),this.parent=null},vde.prototype.addEventListener=function(){this.parent.on(mne,this.find,this),this.parent.on(yne,this.replace,this),this.parent.on(vne,this.replaceAll,this),this.parent.on(Ane,this.totalCount,this),this.parent.on(Eie,this.findAllValues,this)},vde.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(mne,this.find),this.parent.off(yne,this.replace),this.parent.off(vne,this.replaceAll),this.parent.off(Ane,this.totalCount),this.parent.off(Eie,this.findAllValues))},vde.prototype.find=function(e){e.sheetIndex=ee(e.sheetIndex)?this.parent.activeSheetIndex:e.sheetIndex;var t,i=this.parent.sheets[e.sheetIndex],n=rte(i.activeCell),n={startRow:n[0],startCol:n[1],findVal:e.isCSen?e.value:e.value.toLowerCase(),activeCell:n},o=(("By Row"===e.searchBy?n.startRow>i.usedRange.rowIndex:n.startCol>i.usedRange.colIndex)?"next"===e.findOpt?n.startRow=n.startCol=0:(n.startRow=i.usedRange.rowIndex,n.startCol=i.usedRange.colIndex):"By Row"===e.searchBy?n.startCol>i.usedRange.colIndex&&("next"===e.findOpt?(n.startRow++,n.startRow>i.usedRange.rowIndex&&(n.startRow=0),n.startCol=0):(n.startRow--,n.startRow<0&&(n.startRow=i.usedRange.rowIndex),n.startCol=i.usedRange.colIndex)):n.startRow>i.usedRange.rowIndex&&("next"===e.findOpt?(n.startCol++,n.startCol>i.usedRange.colIndex&&(n.startRow=0),n.startRow=0):(n.startCol--,n.startCol<0&&(n.startCol=i.usedRange.colIndex),n.startRow=i.usedRange.colIndex)),"Workbook"===e.mode?(n.sheets=this.parent.sheets,n.sheetIdx=e.sheetIndex):(n.sheets=[i],n.sheetIdx=0),e.showDialog&&this.parent.element&&this.parent.element.querySelector(".e-header-panel"));o&&(t=(o.offsetHeight||(i.showHeaders?30:0))+1),e.localeObj=Mi(this.parent.locale),"next"===e.findOpt?this.findNext(e,n):this.findPrevious(e,n),e.showDialog&&this.parent.notify(vie,{findValue:e.value,isPublic:!0,headerHgt:t})},vde.prototype.findNext=function(s,a){function e(e,t,i){for(var n,o,r=e;r<=t&&(n=a.sheets[r],!(o=r===a.sheetIdx?i?l.findNextOnSheet(s,a.startRow,a.startCol,a.findVal,n,void 0,a.activeCell):l.findNextOnSheet(s,0,0,a.findVal,n,"By Row"===s.searchBy?a.startRow:a.startCol):l.findNextOnSheet(s,0,0,a.findVal,n)));r++);return o}var l=this,t=e(a.sheetIdx,a.sheets.length-1,!0);(t=t||e(0,a.sheetIdx))?this.parent.notify(fne,{address:t}):this.parent.notify(bne,null)},vde.prototype.findNextOnSheet=function(e,t,i,n,o,r,s){var a;if("By Row"===e.searchBy){void 0===r&&(r=o.rows.length-1);for(var l,h=t;h<=r;h++)if(!zde(o,h))for(p=s&&h===t?i:0,l=o.rows[h]&&o.rows[h].cells&&o.rows[h].cells.length;p<l;p++)if(!epe(o,p)&&(a=this.checkMatch(e,n,h,p,o,s)))return a}else{void 0===r&&(r=o.usedRange.colIndex);for(var d=o.rows&&o.rows.length-1,p=i;p<=r;p++)if(!epe(o,p))for(h=s&&p===i?t:0;h<=d;h++)if(!zde(o,h)&&(a=this.checkMatch(e,n,h,p,o,s)))return a}return a},vde.prototype.findPrevious=function(s,a){function e(e,t,i){for(var n,o,r=e;t<=r&&(n=a.sheets[r],!(o=r===a.sheetIdx?i?l.findPrevOnSheet(s,a.startRow,a.startCol,0,0,a.findVal,n,a.activeCell):"By Row"===s.searchBy?l.findPrevOnSheet(s,n.usedRange.rowIndex,n.usedRange.colIndex,a.startRow,0,a.findVal,n):l.findPrevOnSheet(s,n.usedRange.rowIndex,n.usedRange.colIndex,0,a.startCol,a.findVal,n):l.findPrevOnSheet(s,n.usedRange.rowIndex,n.usedRange.colIndex,0,0,a.findVal,n)));r--);return o}var l=this,t=e(a.sheetIdx,0,!0);(t=t||e(a.sheets.length-1,a.sheetIdx))?this.parent.notify(fne,{address:t}):this.parent.notify(bne,null)},vde.prototype.findPrevOnSheet=function(e,t,i,n,o,r,s,a){var l,h,d;if("By Row"===e.searchBy){for(d=t;n<=d;d--)if(!zde(s,d))for(h=a&&d===t?i:s.rows[d]&&s.rows[d].cells&&s.rows[d].cells.length-1;o<=h;h--)if(!epe(s,h)&&(l=this.checkMatch(e,r,d,h,s,a)))return l}else for(h=i;o<=h;h--)if(!epe(s,h))for(d=a&&h===i?t:s.rows&&s.rows.length-1;n<=d;d--)if(!zde(s,d)&&(l=this.checkMatch(e,r,d,h,s,a)))return l;return l},vde.prototype.checkMatch=function(t,i,n,o,r,e){var s,a,l;return e&&n===e[0]&&o===e[1]||(e=Kre(n,o,r,!1,!0),r.isProtected&&!r.protectSettings.selectCells&&r.protectSettings.selectUnLockedCells&&Hoe(e,Kde(r,o)))?null:(l=(s=function(e){if(e)if(t.isCSen||(e=e.toLowerCase()),t.isEMatch){if(e===i)return r.name+"!"+lte(n,o)}else if(e.includes(i))return r.name+"!"+lte(n,o);return null})(a=this.getDisplayText(e,n,o,t.localeObj)))||!(e=Kre(n,o,r,!1,!0)).format||ise(e.format,!0)||a.includes("%")?l:s(this.getCellVal(e,t.localeObj))},vde.prototype.replace=function(i){var n=this,e=ee(i.sheetIndex)?this.parent.activeSheetIndex:i.sheetIndex,t=_re(this.parent,i.sheetIndex);if(t.isProtected)this.parent.notify(Mne,null);else{var o,r=rte(i.address||t.activeCell),s=Kre(r[0],r[1],t,!1,!0),a=this.parent.getDisplayText(s).toString(),l=(i.value=i.value.toString(),i.isCSen||(o=i.value.toLowerCase()),Mi(this.parent.locale)),h=function(e){var t;return t=i.isCSen?i.isEMatch?a===i.value&&i.replaceValue:-1<a.indexOf(i.value)&&a.replace(i.value,i.replaceValue):i.isEMatch?a.toLowerCase()===o&&i.replaceValue:(t=RegExp,a.toLowerCase().includes(o)&&a.replace(new t(i.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"ig"),i.replaceValue)),e||d||!s.format||ise(s.format,!0)||a.includes("%")||(a=n.getCellVal(s,l))&&(t=h(!0)),t},d=h();if(d||(i.findOpt="next",this.find(i),r=ste(t.activeCell),s=Kre(r[0],r[1],t,!1,!0),a=this.parent.getDisplayText(s).toString(),d=h()))if(sre(Kre(r[0],r[1],t),Kde(t,r[1]),_de(t,r[0])))this.parent.notify(kne,null);else{e={address:t.name+"!"+lte(r[0],r[1]),cancel:!1,compareValue:i.value,replaceValue:i.replaceValue,sheetIndex:e};if(i.isAction){if(this.parent.notify(fie,{action:"beforeReplace",eventArgs:e}),e.cancel)return;delete e.cancel}Yoe(this.parent,t,{cell:{value:d},rowIdx:r[0],colIdx:r[1],uiRefresh:!0,checkCF:!0,valChange:!0}),i.isAction&&this.parent.notify("actionComplete",{action:"replace",eventArgs:e})}}},vde.prototype.replaceAll=function(o){for(var e,t,r,i,s=this,n="Sheet"===o.mode?o.sheetIndex:0,a=this.parent.sheets[n],l=a.usedRange.rowIndex,h=0,d=a.usedRange.colIndex,p=0,c=[],u=o.isAction,g=ste(a.activeCell),m=fde({addressCollection:c,cancel:!1},o),f=0,y=function(i,n,e){requestAnimationFrame?requestAnimationFrame(function(){var e,t;!m.cancel&&m.addressCollection[n]&&(e=ste(m.addressCollection[n].substring(m.addressCollection[n].lastIndexOf("!")+1)),t=mte(s.parent,m.addressCollection[n]),Yoe(s.parent,s.parent.sheets[t],{cell:{value:i},rowIdx:e[0],uiRefresh:!0,checkCF:!0,colIdx:e[1],valChange:!0,skipFormatCheck:o.skipFormatCheck}),g[0]===e[0]&&g[1]===e[1]&&s.parent.notify("formulaBarOperation",{action:"refreshFormulabar",cell:Kre(e[0],e[1],s.parent.sheets[t],!1,!0)}),n===m.addressCollection.length-1)&&u&&s.parent.notify("actionComplete",{action:"replaceAll",eventArgs:m})}):s.parent.updateCellDetails({value:i},m.addressCollection[n],void 0,void 0,!0),e.formula||f++},v=function(e,t){var i,n;return e&&(o.isCSen?o.isEMatch?e===o.value&&(y(o.replaceValue,c.length,t),c.push(a.name+"!"+lte(h,p)),i=!0):-1<e.indexOf(o.value)&&(y(e.replace(o.value,o.replaceValue),c.length,t),c.push(a.name+"!"+lte(h,p)),i=!0):o.isEMatch?e.toLowerCase()===o.value&&(y(o.replaceValue,c.length,t),c.push(a.name+"!"+lte(h,p)),i=!0):(n=e.toLowerCase(),(e===o.value||-1<n.indexOf(o.value.toString().toLowerCase())||n===o.value||e===o.value||-1<n.indexOf(o.value))&&(n=RegExp,r=new n(o.value.toString().replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"ig"),y(e.replace(r,o.replaceValue),c.length,t),c.push(a.name+"!"+lte(h,p)),i=!0))),i},b=Mi(this.parent.locale);h<=l+1;h++){if(d<p&&l<h&&"Workbook"===o.mode){if(n++,!(a=this.parent.sheets[n]))break;h=p=0,d=a.usedRange.colIndex,l=a.usedRange.rowIndex}if(t=a.rows[h])for(p===d+1&&(p=0);p<=d;p++)!t||!(i=t.cells&&t.cells[p])||sre(i,Kde(a,p),t)||v(e=this.getDisplayText(i,h,p,b).toString(),i)||!i.format||ise(i.format,!0)||e.includes("%")||v(this.getCellVal(t.cells[p],b),i)}c.length&&u&&(this.parent.notify("actionBegin",{action:"beforeReplaceAll",eventArgs:m}),m.cancel)||this.parent.notify(Ene,{count:f,replaceValue:m.replaceValue})},vde.prototype.getDisplayText=function(e,t,i,n){var o;return e?e.value||0===e.value?(o=e.value.toString(),e.format||o.includes(n.dateSeparator)?(n={value:e.value,format:e.format,formattedText:e.value,cell:e,rowIndex:t,colIndex:i},this.parent.notify(Aie,n),n.formattedText):o):e.hyperlink?"string"==typeof e.hyperlink?e.hyperlink:e.hyperlink.address||"":"":""},vde.prototype.getCellVal=function(e,t){return mre(e.value)?"."!==t.decimal?e.value.toString().split(".").join(t.decimal):e.value.toString():e.value?e.value.toString().toLowerCase():""},vde.prototype.totalCount=function(e){var n,o=this,r=this.parent.sheets[e.sheetIndex],s=ste(r.activeCell),a=0,l=0,h=e.value.toLowerCase(),d=Mi(this.parent.locale),t=(r.rows.filter(function(e,i){return e&&e.cells&&!e.isFiltered&&!e.hidden&&e.cells.filter(function(e,t){!e||!e.value&&0!==e.value||epe(r,t)||r.isProtected&&!r.protectSettings.selectCells&&Hoe(e,Kde(r,t))||((n=o.getDisplayText(e,i,t,d).toLowerCase()).includes(h)||e.format&&!ise(e.format,!0)&&!n.includes("%")&&o.getCellVal(e,d).includes(h))&&(a++,i===s[0]&&t>=s[1]||i>s[0])&&l++})}),a);0===(a=t<(a=t- --l)?t:a)||this.parent.getDisplayText(Kre(s[0],s[1],r)).toLowerCase().includes(h)||--a,e.findCount=a+" of "+t},vde.prototype.findAllValues=function(e){for(var t,i=e.sheetIndex,n=this.parent.sheets[i],o=n.usedRange.rowIndex,r=0,s=n.usedRange.colIndex,a=0,l=this.parent.sheets.length,h=e.sheetIndex;r<=o+1;r++){if(1!==h&&e.sheetIndex===l&&(i=1),o<r&&s<a&&"Workbook"===e.mode){if(h===(i=l-1<++i?0:i))return void 0;(n=this.parent.sheets[i])&&(a=r=0,s=n.usedRange.colIndex,o=n.usedRange.rowIndex)}if(!je(n)&&n.rows[r]){var d,p,c,u,g=n.rows[r];for(a===s+2&&(a=0);a<=s+1;a++)g&&g.cells&&g.cells[a]&&(d=n.rows[r].cells[a])&&!je(d.value)&&""!==d.value&&(!n.isProtected||n.protectSettings.selectCells||n.protectSettings.selectUnLockedCells&&!Hoe(d,Kde(n,a)))&&(p=void 0,p=(d.format?this.parent.getDisplayText(n.rows[r].cells[a]):d.value).toString(),e.isCSen&&e.isEMatch?p===e.value&&(t=n.name+"!"+lte(r,a),e.findCollection.push(t),0):e.isCSen&&!e.isEMatch?(u=-1<p.indexOf(e.value),p!==e.value&&!u||(t=n.name+"!"+lte(r,a),e.findCollection.push(t),0)):!e.isCSen&&e.isEMatch?(c=p.toString().toLowerCase())===e.value.toLowerCase()&&(t=n.name+"!"+lte(r,a),e.findCollection.push(t),0):e.isCSen||e.isEMatch||(u=-1<(c=p.toString().toLowerCase()).indexOf(e.value.toLowerCase()),c!==e.value&&p!==e.value&&!u&&p!==e.value)||(t=n.name+"!"+lte(r,a),e.findCollection.push(t),0))}}},vde.prototype.getModuleName=function(){return"workbookfindAndReplace"},vde);function vde(e){this.parent=e,this.addEventListener()}wde.prototype.protectsheetHandler=function(e){var t=je(e.sheetIndex)?this.parent.activeSheetIndex:e.sheetIndex,i=_re(this.parent,t);this.parent.setSheetPropertyOnMute(i,"isProtected",!0),this.parent.setSheetPropertyOnMute(i,"protectSettings",{selectCells:e.protectSettings.selectCells,formatCells:e.protectSettings.formatCells,formatColumns:e.protectSettings.formatColumns,formatRows:e.protectSettings.formatRows,insertLink:e.protectSettings.insertLink,selectUnLockedCells:e.protectSettings.selectUnLockedCells}),this.parent.notify(xne,{sheetIndex:t,triggerEvent:e.triggerEvent}),this.parent.notify(Ine,{props:"Protect"}),i.password=e.password||"",i.columns.forEach(function(e){e&&ee(e.isLocked)&&(e.isLocked=!0)})},wde.prototype.unprotectsheetHandler=function(e){var t=this.parent.getActiveSheet();(t=je(e.sheet)?t:this.parent.sheets[e.sheet]).isImportProtected&&(t.isImportProtected=!1),t.protectSettings.formatCells=t.protectSettings.formatColumns=!1,t.protectSettings.formatRows=t.protectSettings.selectCells=!1,this.parent.setSheetPropertyOnMute(t,"isProtected",!1),this.parent.notify(xne,t.protectSettings),this.parent.notify(Ine,{props:"Protect"})},wde.prototype.destroy=function(){this.removeEventListener(),this.parent=null},wde.prototype.addEventListener=function(){this.parent.on(Tne,this.protectsheetHandler,this),this.parent.on(Dne,this.unprotectsheetHandler,this),this.parent.on(Pne,this.lockCells,this)},wde.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Tne,this.protectsheetHandler),this.parent.off(Pne,this.lockCells),this.parent.off(Tne,this.unprotectsheetHandler))},wde.prototype.lockCells=function(e){var t=this.parent.getAddressInfo(e.range),i=fte(t.indices),n=_re(this.parent,t.sheetIndex),o=e.isLocked||!1;if(0===i[0]&&i[2]===n.rowCount-1)for(var r=i[1];r<=i[3];r++)Jde(n,r,{isLocked:e.isLocked});for(r=i[0];r<=i[2];r++)for(var s=i[1];s<=i[3];s++)Jre(r,s,n,{isLocked:o},!0);e.triggerEvent&&this.parent.notify("actionComplete",{action:"lockCells",eventArgs:e})},wde.prototype.getModuleName=function(){return"workbookProtectSheet"};var bde=wde;function wde(e){this.parent=e,this.addEventListener()}Sde.prototype.merge=function(e){e.sheetIndex=ee(e.sheetIndex)?this.parent.activeSheetIndex:e.sheetIndex,e.isAction&&(this.parent.notify("actionBegin",{eventArgs:e,action:"merge"}),e.model||(e.model=[])),"string"==typeof e.range&&(e.range=rte(e.range));var t=e.range=fte(e.range);if(e.skipChecking||this.mergedRange(e),e.merge&&"All"!==e.type){if("Horizontally"===e.type)for(var i=e.range[0],n=e.range[2];i<=n;i++)e.range=[i,t[1],i,t[3]],this.mergeAll(e,i-t[0]);else if("Vertically"===e.type)for(var o=e.range[1],n=e.range[3];o<=n;o++)e.range=[t[0],o,t[2],o],this.mergeAll(e,0,o-t[1])}else this.mergeAll(e),e.refreshRibbon&&this.parent.notify(Nie,null);e.range=t,this.parent.setUsedRange(e.range[2],e.range[3]),e.isAction&&this.parent.notify("actionComplete",{eventArgs:e,action:"merge"}),e.sheetIndex===this.parent.activeSheetIndex&&(this.parent.notify("selectRange",{address:_re(this.parent,e.sheetIndex).selectedRange,skipChecking:!0}),this.parent.chartColl)&&this.parent.chartColl.length&&this.parent.notify(Gne,{range:e.range})},Sde.prototype.mergeAll=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=0);for(var n,o,r,s,a=0,l=(e.range=e.range,ee(e.sheetIndex)?this.parent.getActiveSheet():_re(this.parent,e.sheetIndex)),h={cell:new Object,rowIdx:e.range[0],colIdx:e.range[1],valChange:!e.merge,preventEvt:!0,uiRefresh:!e.preventRefresh,skipFormatCheck:!0},d=e.range[0],p=t;d<=e.range[2];d++,p++){n=0,e.isAction&&!e.model[p]&&e.model.push({cells:[]});for(var c,u,g,m=e.range[1],f=i;m<=e.range[3];m++,f++){if((g=Kre(d,m,l))&&(g.value||0===g.value||g.formula)&&!o&&(o=g.formula||g.value,s=g.format),e.isAction&&e.merge&&Pe(c=e.model[p].cells[f]={},g,null,!0),g&&(delete g.rowSpan,delete g.colSpan,c=!e.merge&&!e.isAction&&e.model&&e.model[p]&&e.model[p].cells[f],u="Manual"===this.parent.calculationMode&&this.parent.getActiveSheet().isSheetCalculated&&!je(g.value)&&""!==g.value,c?(u&&(c.value=g.value),Jre(d,m,l,c)):e.model&&e.model[p].cells[f]&&u&&(e.model[p].cells[f].value=g.value)),d===e.range[0]&&m===e.range[1]){if(e.merge){0<e.range[3]-e.range[1]&&(h.cell.colSpan=e.range[3]-e.range[1]+1),0<e.range[2]-e.range[0]&&(h.cell.rowSpan=e.range[2]-e.range[0]+1),Yoe(this.parent,l,h),h.valChange=h.mergedCells=!0;continue}}else h.rowIdx=d,h.colIdx=m,h.cell={},e.merge&&(d!==e.range[0]&&(h.cell.rowSpan=-a),m!==e.range[1])&&(n++,h.cell.colSpan=-n);Yoe(this.parent,l,h),r=r||h.isFormulaDependent}a++}e.merge&&(o||0===o?(delete h.mergedCells,h.cell={},(t=Kre(e.range[0],e.range[1],l))&&(t.value||t.formula)||(Poe(o)?h.cell.formula=o:h.cell.value=o,s&&(h.cell.format=s)),h.rowIdx=e.range[0],h.colIdx=e.range[1],Yoe(this.parent,l,h)):e.preventRefresh||this.parent.notify(Fne,{rowIdx:e.range[0],colIdx:e.range[1]})),e.preventRefresh||this.refreshCF(l,e.range.slice(),r,e.merge)},Sde.prototype.refreshCF=function(e,t,i,n){e.conditionalFormats&&e.conditionalFormats.length&&(n?this.parent.notify(_ne,{indexes:[t[0],t[1]],refreshAll:i,isAction:!0}):this.parent.notify(_ne,{indexes:t,refreshAll:i,isAction:!0}))},Sde.prototype.activeCellRange=function(e){e.range=e.range;var t=this.parent.getActiveSheet(),i=Kre(e.range[0],e.range[1],t);i&&(!je(i.rowSpan)&&i.rowSpan<0&&(e.range[0]+=i.rowSpan,e.insertCount)&&(e.range[0]-=e.insertCount),!je(i.colSpan)&&i.colSpan<0&&(e.range[1]+=i.colSpan,e.insertCount)&&(e.range[1]-=e.insertCount),i=Kre(e.range[0],e.range[1],t))&&(1<i.rowSpan&&(e.range[0]+(i.rowSpan-1)>=e.range[2]||e.insertCount)&&(e.range[2]=e.range[0]+(i.rowSpan-1)),1<i.colSpan)&&(e.range[1]+(i.colSpan-1)>=e.range[3]||e.insertCount)&&(e.range[3]=e.range[1]+(i.colSpan-1))},Sde.prototype.mergedRange=function(e){"string"==typeof e.range&&(e.range=rte(e.range)),e.range[0]<=e.range[2]&&e.range[1]<=e.range[3]?this.forward(e):e.range[0]>=e.range[2]&&e.range[1]>=e.range[3]?this.reverse(e):e.range[0]<e.range[2]&&e.range[1]>e.range[3]?this.forwardReverse(e):e.range[0]>e.range[2]&&e.range[1]<e.range[3]&&this.reverseForward(e)},Sde.prototype.forward=function(e){e.range=e.range;var t,i,n=ee(e.sheetIndex)?this.parent.getActiveSheet():_re(this.parent,e.sheetIndex),o=Kre(e.range[0],e.range[1],n),r=t=e.range[0],s=i=e.range[1];if((o=o&&Kre(r=!je(o.rowSpan)&&o.rowSpan<0?t=e.range[0]+o.rowSpan:r,s=!je(o.colSpan)&&o.colSpan<0?i=e.range[1]+o.colSpan:s,n))&&(1<o.rowSpan&&(t+=o.rowSpan-1,r+(o.rowSpan-1)>=e.range[2])&&(e.range[2]=e.range[0],e.range[2]=r+(o.rowSpan-1)),1<o.colSpan)&&(i+=o.colSpan-1,s+(o.colSpan-1)>=e.range[3])&&(e.range[3]=e.range[1],e.range[3]=s+(o.colSpan-1)),e.range[0]=r,e.range[1]=s,e.range[0]===r&&e.range[1]===s&&e.range[2]===t&&e.range[3]===i&&(e.isActiveCell=!0),!e.skipChecking){for(var a,l,h=e.range[1];h<=e.range[3];h++)(o=Kre(e.range[2],h,n))&&(r=e.range[2],s=h,!je(o.colSpan)&&o.colSpan<0&&(s+=o.colSpan)<e.range[1]&&(e.range[1]=s),!je(o.rowSpan)&&o.rowSpan<0&&(r+=o.rowSpan)<e.range[0]&&(e.range[0]=r),o=Kre(r,s,n))&&(1<o.colSpan&&s+(o.colSpan-1)>e.range[3]&&(e.range[3]=s,e.range[3]=s+(o.colSpan-1)),1<o.rowSpan)&&r+(o.rowSpan-1)>e.range[2]&&(e.range[2]=r,e.range[2]=r+(o.rowSpan-1));for(h=e.range[1];h<=e.range[3];h++)(o=Kre(e.range[0],h,n))&&(l=h,a=e.range[0],!je(o.colSpan)&&o.colSpan<0&&(l+=o.colSpan)<e.range[1]&&(e.range[1]=l),!je(o.rowSpan))&&o.rowSpan<0&&(a+=o.rowSpan)<e.range[0]&&(e.range[0]=a);for(h=e.range[0];h<=e.range[2];h++)(o=Kre(h,e.range[3],n))&&(r=h,s=e.range[3],!je(o.rowSpan)&&o.rowSpan<0&&(r+=o.rowSpan)<e.range[0]&&(e.range[0]=r),!je(o.colSpan)&&o.colSpan<0&&(s+=o.colSpan)<e.range[1]&&(e.range[1]=s),o=Kre(r,s,n))&&(1<o.rowSpan&&r+(o.rowSpan-1)>e.range[2]&&(e.range[2]=r,e.range[2]=r+(o.rowSpan-1)),1<o.colSpan)&&s+(o.colSpan-1)>e.range[3]&&(e.range[3]=s,e.range[3]=s+(o.colSpan-1))}},Sde.prototype.forwardReverse=function(e){var t=this.parent.getActiveSheet(),i=(e.range=e.range,e.range[1]),n=Kre(e.range[0],e.range[1],t),o=e.range[0];if(n&&(!je(n.colSpan)&&n.colSpan<0&&(i+=n.colSpan,e.range[3]>=i)&&(e.range[3]=i),!je(n.rowSpan)&&n.rowSpan<0&&(o+=n.rowSpan)<e.range[0]&&(e.range[0]=o),n=Kre(o,i,t))&&(1<n.rowSpan&&o+(n.rowSpan-1)>=e.range[2]&&(e.range[2]=o+(n.rowSpan-1)),1<n.colSpan)&&i+(n.colSpan-1)>=e.range[1]&&(e.range[1]=i+(n.colSpan-1)),e.range[0]=o,!e.skipChecking){for(var r,s,a,l=e.range[3];l<=e.range[1];l++)(n=Kre(e.range[2],l,t))&&(s=l,r=e.range[2],!je(n.rowSpan)&&n.rowSpan<0&&(r+=n.rowSpan)<e.range[0]&&(e.range[0]=r),!je(n.colSpan)&&n.colSpan<0&&(s+=n.colSpan)<e.range[3]&&(e.range[3]=s),n=Kre(r,s,t))&&(1<n.rowSpan&&r+(n.rowSpan-1)>e.range[2]&&(e.range[2]=r+(n.rowSpan-1)),1<n.colSpan)&&s+(n.colSpan-1)>e.range[1]&&(e.range[1]=s+(n.colSpan-1));for(var h,l=e.range[3];l<=e.range[1];l++)(n=Kre(e.range[0],l,t))&&(s=l,a=e.range[0],!je(n.rowSpan)&&n.rowSpan<0&&(a+=n.rowSpan)<e.range[0]&&(e.range[0]=a),!je(n.colSpan)&&n.colSpan<0&&(s+=n.colSpan),n=Kre(a,s,t))&&(1<n.rowSpan&&a+(n.rowSpan-1)>e.range[2]&&(e.range[2]=a+(n.rowSpan-1)),1<n.colSpan)&&s+(n.colSpan-1)>e.range[1]&&(e.range[1]=s,e.range[1]=s+(n.colSpan-1));for(l=e.range[0];l<=e.range[2];l++)(n=Kre(l,e.range[3],t))&&(a=l,h=e.range[3],!je(n.rowSpan)&&n.rowSpan<0&&(a+=n.rowSpan)<e.range[0]&&(e.range[0]=a),!je(n.colSpan)&&n.colSpan<0&&(h+=n.colSpan)<e.range[3]&&(e.range[3]=h),n=Kre(a,h,t))&&(1<n.rowSpan&&a+(n.rowSpan-1)>e.range[2]&&(e.range[2]=a,e.range[2]=a+(n.rowSpan-1)),1<n.colSpan)&&h+(n.colSpan-1)>e.range[1]&&(e.range[1]=h,e.range[1]=h+(n.colSpan-1))}},Sde.prototype.reverse=function(e){e.range=e.range;var t=e.range[1],i=ee(e.sheetIndex)?this.parent.getActiveSheet():_re(this.parent,e.sheetIndex),n=Kre(e.range[0],e.range[1],i),o=e.range[0],r=(n&&(!je(n.colSpan)&&n.colSpan<0&&(t+=n.colSpan),!je(n.rowSpan)&&n.rowSpan<0&&(o+=n.rowSpan),e.range[2]>=o&&(e.range[2]=o,e.isActiveCell=!0),e.range[3]>=t?(e.range[3]=t,e.range[2]===o&&(e.isActiveCell=!0)):e.isActiveCell&&(e.isActiveCell=!1),n=Kre(o,t,i))&&(1<n.rowSpan&&o+(n.rowSpan-1)>=e.range[0]&&(e.range[0]=o,e.range[0]=o+(n.rowSpan-1)),1<n.colSpan)&&t+(n.colSpan-1)>=e.range[1]&&(e.range[1]=t,e.range[1]=t+(n.colSpan-1)),e.range[3]);if(!e.skipChecking){for(var s=e.range[3];s<=e.range[1];s++)(n=Kre(e.range[2],s,i))&&(r=s,o=e.range[2],!je(n.rowSpan)&&n.rowSpan<0&&(o+=n.rowSpan)<e.range[2]&&(e.range[2]=o),!je(n.colSpan)&&n.colSpan<0&&(r+=n.colSpan)<e.range[3]&&(e.range[3]=r),n=Kre(o,r,i))&&(1<n.rowSpan&&o+(n.rowSpan-1)>e.range[0]&&(e.range[0]=o,e.range[0]=o+(n.rowSpan-1)),1<n.colSpan)&&r+(n.colSpan-1)>e.range[1]&&(e.range[1]=r,e.range[1]=r+(n.colSpan-1));for(var a,l,r=e.range[3],s=e.range[3];s<=e.range[1];s++)(n=Kre(e.range[0],s,i))&&(r=s,o=e.range[0],!je(n.colSpan)&&n.colSpan<0&&(r+=n.colSpan),!je(n.rowSpan)&&n.rowSpan<0&&(o+=n.rowSpan),n=Kre(o,r,i))&&(1<n.colSpan&&r+(n.colSpan-1)>e.range[1]&&(e.range[1]=r,e.range[1]=r+(n.colSpan-1)),1<n.rowSpan)&&o+(n.rowSpan-1)>e.range[0]&&(e.range[0]=o,e.range[0]=o+(n.rowSpan-1));for(s=e.range[2];s<=e.range[0];s++)(n=Kre(s,e.range[3],i))&&(l=s,a=e.range[3],!je(n.rowSpan)&&n.rowSpan<0&&(l+=n.rowSpan)<e.range[2]&&(e.range[2]=l),!je(n.colSpan)&&n.colSpan<0&&(a+=n.colSpan)<e.range[3]&&(e.range[3]=a),n=Kre(l,a,i))&&(1<n.rowSpan&&l+(n.rowSpan-1)>e.range[0]&&(e.range[0]=l,e.range[0]=l+(n.rowSpan-1)),1<n.colSpan)&&a+(n.colSpan-1)>e.range[1]&&(e.range[1]=a,e.range[1]=a+(n.colSpan-1))}},Sde.prototype.reverseForward=function(e){e.range=e.range;var t=ee(e.sheetIndex)?this.parent.getActiveSheet():_re(this.parent,e.sheetIndex),i=e.range[0],n=e.range[1],o=Kre(e.range[0],e.range[1],t);if(o&&(!je(o.rowSpan)&&o.rowSpan<0&&(i+=o.rowSpan,e.range[2]>=i)&&(e.range[2]=i),!je(o.colSpan)&&o.colSpan<0&&(n+=o.colSpan),o=Kre(i,n,t))&&(1<o.rowSpan&&i+(o.rowSpan-1)>=e.range[0]&&(e.range[0]=i,e.range[0]=i+(o.rowSpan-1)),1<o.colSpan)&&n+(o.colSpan-1)>=e.range[3]&&(e.range[3]=e.range[1],e.range[3]=n+(o.colSpan-1)),!e.skipChecking){for(var r,s,a,l=e.range[3],h=e.range[1];h<=e.range[3];h++)(o=Kre(e.range[2],h,t))&&(r=e.range[2],l=h,!je(o.rowSpan)&&o.rowSpan<0&&(r+=o.rowSpan)<e.range[2]&&(e.range[2]=r),!je(o.colSpan)&&o.colSpan<0&&(l+=o.colSpan)<e.range[1]&&(e.range[1]=l),o=Kre(r,l,t))&&(1<o.colSpan&&l+(o.colSpan-1)>e.range[3]&&(e.range[3]=l+(o.colSpan-1)),1<o.rowSpan)&&o.rowSpan-1+r>e.range[0]&&(e.range[0]=o.rowSpan-1+r);for(var d,h=e.range[1];h<=e.range[3];h++)(o=Kre(e.range[0],h,t))&&(a=h,s=e.range[0],!je(o.colSpan)&&o.colSpan<0&&(a+=o.colSpan)<e.range[1]&&(e.range[1]=a),!je(o.rowSpan)&&o.rowSpan<0&&(s+=o.rowSpan),o=Kre(s,a,t))&&1<o.rowSpan&&s+(o.rowSpan-1)>e.range[0]&&(e.range[0]=s+(o.rowSpan-1));for(h=e.range[2];h<=e.range[0];h++)(o=Kre(h,e.range[3],t))&&(r=h,d=e.range[3],!je(o.rowSpan)&&o.rowSpan<0&&(r+=o.rowSpan)<e.range[2]&&(e.range[2]=r),!je(o.colSpan)&&o.colSpan<0&&(d+=o.colSpan)<e.range[1]&&(e.range[1]=d),o=Kre(r,d,t))&&(1<o.rowSpan&&o.rowSpan-1+r>e.range[0]&&(e.range[0]=o.rowSpan-1+r),1<o.colSpan)&&o.colSpan-1+d>e.range[3]&&(e.range[3]=d,e.range[3]=o.colSpan-1+d)}},Sde.prototype.insertHandler=function(e){this.activeCellRange(e),e.range=e.range,"Row"===e.insertModel?e.range[2]+=e.insertCount:e.range[3]+=e.insertCount,e.preventRefresh=!0,e.merge=!0,this.mergeAll(e)},Sde.prototype.addEventListener=function(){this.parent.on(Bne,this.merge,this),this.parent.on(Lne,this.mergedRange,this),this.parent.on(Rne,this.activeCellRange,this),this.parent.on(One,this.insertHandler,this)},Sde.prototype.destroy=function(){this.removeEventListener(),this.parent=null},Sde.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Bne,this.merge),this.parent.off(Lne,this.mergedRange),this.parent.off(Rne,this.activeCellRange),this.parent.off(One,this.insertHandler))},Sde.prototype.getModuleName=function(){return"workbookmerge"};var Cde=Sde;function Sde(e){this.parent=e,this.addEventListener()}xde.prototype.destroy=function(){this.removeEventListener(),this.parent=null},xde.prototype.addEventListener=function(){this.parent.on(Vne,this.setCFRule,this),this.parent.on(Hne,this.clearCFRule,this)},xde.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Vne,this.setCFRule),this.parent.off(Hne,this.clearCFRule))},xde.prototype.setCFRule=function(e){var t=e.cfModel,i=void 0===e.sheetIdx?mte(this.parent,t.range):e.sheetIdx,n=_re(this.parent,i),o=fte(rte(t.range||n.selectedRange));if(t.range=hte(o),e.isAction){var r={range:t.range,type:t.type,cancel:!1,cFColor:t.cFColor,value:t.value,sheetIdx:i};if(this.parent.notify(fie,{eventArgs:r,action:"conditionalFormat"}),r.cancel)return;t.type=r.type,t.cFColor=r.cFColor,t.value=r.value,r.range!==t.range&&(t.range=r.range,o=fte(rte(r.range))),delete r.cancel}n.conditionalFormats||this.parent.setSheetPropertyOnMute(n,"conditionalFormats",[]),n.conditionalFormats.push(t),i!==this.parent.activeSheetIndex?e.isUndoRedo&&!e.isFromUpdateAction&&this.parent.notify(fne,{address:n.name+"!"+t.range}):this.parent.notify(_ne,{cfModel:[t],isAction:!0}),this.parent.setUsedRange(o[2],o[3]),e.isAction&&this.parent.notify("actionComplete",{eventArgs:{range:t.range,type:t.type,cFColor:t.cFColor,value:t.value,sheetIdx:i},action:"conditionalFormat"})},xde.prototype.clearCFRule=function(e){void 0===e.sheetIdx&&(e.sheetIdx=this.parent.activeSheetIndex);var t=_re(this.parent,e.sheetIdx),i=t.conditionalFormats,n=i&&i[i.length-1]&&"autofillWithCF"!==i[i.length-1].action;if(e.isUndo)e.updatedCFModel&&e.updatedCFModel.forEach(function(e){for(var t=0;t<i.length;t++)if(i[t].type===e.type&&i[t].cFColor===e.cFColor&&i[t].range===e.range&&i[t].value===e.value){i.splice(t,1);break}}),i.push.apply(i,e.oldCFModel.map(function(e){return Object.assign({},e)})),this.parent.notify(_ne,{cfModel:e.oldCFModel,isAction:!0}),e.sheetIdx!==this.parent.activeSheetIndex&&this.parent.notify(fne,{address:t.name+"!"+e.range});else if(i&&i.length){var o,r,s,a,l,h,d,p=(p=e.range&&("string"==typeof e.range?rte(e.range):e.range))&&fte(p);e.oldCFModel=[],e.updatedCFModel=[];for(var c=[],u=[],g=[],m=0;m<i.length;m++){for(var f,y=(f=i[m]).range.split(","),v=0;v<y.length;v++){if(o=rte(y[v]),e.range)if(p[0]<=o[0]&&p[1]<=o[1]&&p[2]>=o[2]&&p[3]>=o[3])y.splice(v,1),v--;else{if(l=p[0]>=o[0]&&p[0]<=o[2],h=p[2]>=o[0]&&p[2]<=o[2],s=p[1]>=o[1]&&p[1]<=o[3],a=p[3]>=o[1]&&p[3]<=o[3],r=[],l&&h?((s||a||p[1]<o[1]&&p[3]>o[3])&&(0<p[0]-o[0]&&r.push(hte([o[0],o[1],p[0]-1,o[3]])),0<o[2]-p[2])&&r.push(hte([p[2]+1,o[1],o[2],o[3]])),s&&p[1]!==o[1]&&r.push(hte([p[0],o[1],p[2],p[1]-1])),a&&p[3]!==o[3]&&r.push(hte([p[0],p[3]+1,p[2],o[3]]))):s&&a?((l||h||p[0]<o[0]&&p[2]>o[2])&&(0<p[1]-o[1]&&r.push(hte([o[0],o[1],o[2],p[1]-1])),0<o[3]-p[3])&&r.push(hte([o[0],p[3]+1,o[2],o[3]])),l?p[0]!==o[0]&&r.push(hte([o[0],p[1],p[0]-1,p[3]])):h&&p[2]!==o[2]&&r.push(hte([p[2]+1,p[1],o[2],p[3]]))):(l||h)&&(s?(p[1]!==o[1]&&r.push(hte([o[0],o[1],o[2],p[1]-1])),0<p[0]-o[0]?r.push(hte([o[0],p[1],p[0]-1,o[3]])):0<o[2]-p[2]&&r.push(hte([p[2]+1,p[1],o[2],o[3]]))):a&&(p[3]!==o[3]&&r.push(hte([o[0],p[3]+1,o[2],o[3]])),0<p[0]-o[0]?r.push(hte([o[0],o[1],p[0]-1,p[3]])):0<o[2]-p[2]&&r.push(hte([p[2]+1,o[1],o[2],p[3]])))),!r.length)continue;y[v]=r.join(",")}else p=o,y.splice(v,1),v--;e.sheetIdx===this.parent.activeSheetIndex&&this.parent.notify(jne,{indexes:p.slice()})}(d=y.join(","))!==f.range&&(!e.cfModel||e.cfModel.cFColor===f.cFColor&&e.cfModel.type===f.type&&e.cfModel.value===f.value?(u.push(f.range),d?(e.oldCFModel.push({type:f.type,cFColor:f.cFColor,format:f.format,range:f.range,value:f.value}),f.range=d,f.result&&(delete f.result,this.parent.notify(_ne,{cfModel:[f],isAction:!0})),e.updatedCFModel.push(f),c.push(f)):(e.oldCFModel.push(f),c.concat(i.splice(m,1)),m--)):g.push(f))}e.sheetIdx!==this.parent.activeSheetIndex?e.isUndoRedo&&!e.isFromUpdateAction&&this.parent.notify(fne,{address:t.name+"!"+e.range}):g.length&&this.parent.notify(_ne,{cfModel:g,isAction:!0}),(e.isAction||e.isClear)&&e.oldCFModel.length&&(t={cFormats:c,oldRange:u,previousConditionalFormats:e.oldCFModel,sheetIdx:e.sheetIdx,selectedRange:e.range},e.updatedCFModel.length&&(t.conditionalFormats=e.updatedCFModel),e.isClear?e.cfClearActionArgs=t:n&&this.parent.notify("actionComplete",{eventArgs:t,action:"clearCF"}))}},xde.prototype.getModuleName=function(){return"workbookConditionalFormatting"};var Ade=xde;function xde(e){this.parent=e,this.addEventListener()}Tde.prototype.getFillInfo=function(e){for(var t,i=this.parent.serviceLocator.getService(bre),n=!0,o="CopyCells",r=[],s=-1<["Down","Up"].indexOf(e.direction),a=this.getRangeData({range:e.dataRange,sheetIdx:this.parent.activeSheetIndex}),l=a.join().replace(/,/g,"").length,h=this.isRange(e.dataRange)&&l?a.length:1;h--;)if(mre(t=a[h]&&!je(a[h].value)?a[h].value:"")||Poe(t)||mre(t[t.length-1])){n=!1,o=this.parent.autoFillSettings.fillType;break}return l&&!n||(r.push(i.getConstant("FillSeries")),o="FillSeries"===e.fillType?o:e.fillType),s&&e.dataRange[1]===e.dataRange[3]||r.push("Flash Fill"),{fillType:o,disableItems:r}},Tde.prototype.isRange=function(e){return e&&(e[0]!==e[2]||e[1]!==e[3])},Tde.prototype.autoFill=function(e){if(e.dataRange&&e.fillRange&&e.direction&&this.parent.allowEditing&&(!this.parent.getActiveSheet().isProtected||!e.isLockedCell)){var t=fte(rte(e.dataRange)),i=fte(rte(e.fillRange)),n={dataRange:t,fillRange:i,direction:e.direction,fillType:e.fillType||this.fillInfo.fillType,dataSheetIndex:mte(this.parent,e.dataRange),fillSheetIndex:mte(this.parent,e.fillRange),cells:e.cells};switch(this.fillInfo=this.getFillInfo({dataRange:t,fillRange:i,fillType:e.fillType,direction:e.direction}),this.fillInfo.fillType=(e.isFillOptClick?e:this.fillInfo).fillType,e.fillType){case"FillSeries":case"FillWithoutFormatting":this.fillSeries(n);break;case"CopyCells":case"FillFormattingOnly":this.copyCells(n)}}},Tde.prototype.fillSeries=function(e){for(var O,t,N,i,n,o,r,s,a,l,h,d,V,p,c,u,g,m={},f=0,y=ee(e.dataSheetIndex)?this.parent.activeSheetIndex:e.dataSheetIndex,v=_re(this.parent,y),b=ee(e.fillSheetIndex)?(u=this.parent.activeSheetIndex,!0):(u=e.fillSheetIndex)===this.parent.activeSheetIndex,w=_re(this.parent,u),_=e.dataRange[0],H=e.dataRange[1],z=e.dataRange[2],j=e.dataRange[3],W=e.fillRange[0],Q=e.fillRange[1],U=e.fillRange[2],q=e.fillRange[3],C=-1<["Down","Up"].indexOf(e.direction),S=-1<["Up","Left"].indexOf(e.direction),G=C?j-H:z-_,Y="FillSeries"===e.fillType,X=v.conditionalFormats&&v.conditionalFormats.length&&[].slice.call(v.conditionalFormats),A=[],K=b&&this.applyWrapToOuterCells(w),J="FillWithoutFormatting"!==e.fillType&&b&&C;f<=G;){var x=(I=this.updateFillValues(C,_,H,z,j,W,Q,U,q,f)).patternRange,I=I.fillRange,T=this.getPattern(x,{isReverseFill:S,isVFill:C},y),E=this.getRangeData({range:x,sheetIdx:y}),Z=!1;(E=C?E:this.getRangeData({range:x,sheetIdx:y},!0))[0]&&E[0].formula&&E[0].formula.match(/=[A-Za-z]+\(([^:]+):([^:]+)\)/)&&(Z=!0);for(var D=E.length,M=0;M<D;M++)if(E[M]&&E[M].isReadOnly)return void this.parent.notify(kne,null);if(!T||!T.length)return;for(O=T.length,V=(d=this.getSelectedRange(w,{rowIndex:I[0],colIndex:I[1]},{rowIndex:I[2],colIndex:I[3]})).length,S&&(d=d.reverse(),T=T.reverse(),T=this.ensurePattern(T),E=E.reverse()),o=0;o<V;){switch(p=d[o],s=o%D,(t=mre(t=T[o%O])?T[t]:t).type){case"number":case"date":if(t.isStartWithMonth&&1===D?(c=cre(t.regVal.a),P=new Date(c),c.setMonth(c.getMonth()+t.regVal.b*t.i),28<P.getDate()&&P.getDate()!==c.getDate()&&(P.setDate(1),P.setMonth(P.getMonth()+t.regVal.b*t.i),P.setDate(new Date(P.getFullYear(),P.getMonth()+1,0).getDate()),c=P),B=ure(c).toString()):(B=this.round(t.regVal.a+t.regVal.b*t.i,5).toString(),t.val&&(i="string"==typeof t.val[0]&&t.val[0].match(/^0+/))&&(N=this.getNextFormattedValue(t.val[0],Number(B)))),t.dataVal){if(void 0===t.copy&&!i&&(t.copy=2<t.val.length,t.copy))for(var k=2;k<t.val.length&&(t.copy=Math.abs(this.round(t.regVal.a+t.regVal.b*k,5))!==t.val[k],!t.copy);k++);B=t.copy?E[s]&&!je(E[s].value)?E[s].value:"":t.start?Math.abs(Number(B))+t.dataVal:i?t.dataVal+N:t.dataVal+Math.abs(Number(B))}S?t.i--:t.i++;break;case"string":var P=t.i%t.val.length,B=t.val[P];t.i++;break;case"formula":for(h=!1,B="=",r=0,a=t.val.length;r<a;)"object"==typeof(n=t.val[r])?(h=!0,(l=this.round(n.a+n.b*t.i,5))<1?(B+="#REF!",Z&&(B+=t.val[r=a-1])):B+=C?n.c+(n.b?l:"$"+l):(n.b?dte(l):n.c.substring(0,n.c.search(/\d/))+"$"+dte(l))+n.c.trim()):B+=n,r++;h&&S?t.i--:t.i++;break;case"time":B=(t.regVal.a+t.regVal.b*t.i).toString(),Number(B)<0&&S&&(B=(t.regVal.a+Math.ceil(Math.abs(t.i/24))+t.regVal.b*t.i).toString()),S?t.i--:t.i++}if((R=Kre(p.rowIndex,p.colIndex,w,!1,!0))&&R.isReadOnly)return void this.parent.notify(kne,null);Y?Object.assign(m,E[s],null,!0):("FillWithoutFormatting"===e.fillType&&E[s]&&E[s].hyperlink?(m.hyperlink=E[s].hyperlink,m.style={textDecoration:"none",color:"inherit"}):m.style=R.style,m.format=R.format,m.wrap=R.wrap,m.rowSpan=R.rowSpan,m.colSpan=R.colSpan),E[s]&&E[s].validation&&(m.validation=Object.assign({},E[s].validation),L=Uoe(R=[p.rowIndex,p.colIndex,p.rowIndex,p.colIndex],F=[e.dataRange[0],e.dataRange[1],e.dataRange[2],e.dataRange[3]],$=this.parent.sheets[this.parent.activeSheetIndex],this.parent,{formula:m.validation.value1}),m.validation.value1=L,""!==m.validation.value2)&&(L=Uoe(R,F,$,this.parent,{formula:m.validation.value2}),m.validation.value2=L);var F,$,L,R=Poe(B);R&&(m.formula=B),("0"!==B||"0"===B&&"FillWithoutFormatting"!==e.fillType)&&(m.value=R&&"Manual"===this.parent.calculationMode?E[s]?E[s].value:"0":B),je(m.notes)||delete m.notes,F={cell:m,rowIdx:p.rowIndex,colIdx:p.colIndex,valChange:!0,uiRefresh:b,pvtExtend:!0,skipFormatCheck:!0,fillType:e.fillType},!b||zde(w,p.rowIndex)||epe(w,p.colIndex)||(F.td=this.parent.getCell(p.rowIndex,p.colIndex),F.td&&(F.uiRefresh=!0)),Yoe(this.parent,w,F,e.cells)||(b&&K(F),X&&!(g=g||F.isFormulaDependent)&&Zoe(X,A,p.rowIndex,p.colIndex,e.dataRange,e.fillRange,v),J&&m.style&&Qoe(m.style)&&this.parent.notify(Mie,{rowIdx:p.rowIndex,colIdx:p.colIndex,style:m.style,lastCell:!0,isHeightCheckNeeded:!0,onActionUpdate:!0,manualUpdate:!0})),m={},o++}f++}(A.length||g)&&this.parent.notify(_ne,{cfModel:!g&&A,refreshAll:g,isAction:!0,isEdit:!0})},Tde.prototype.copyCells=function(e){for(var t,i,n,o,r,s,a,l,h=0,d={},p=e.dataRange[0],c=e.dataRange[1],u=e.dataRange[2],g=e.dataRange[3],m=e.fillRange[0],f=e.fillRange[1],y=e.fillRange[2],v=e.fillRange[3],b=-1<["Down","Up"].indexOf(e.direction),w=-1<["Up","Left"].indexOf(e.direction),C=b?g-c:u-p,S=ee(e.dataSheetIndex)?this.parent.activeSheetIndex:e.dataSheetIndex,A=_re(this.parent,S),x=ee(e.fillSheetIndex)?(r=!0,this.parent.activeSheetIndex):(r=e.fillSheetIndex===this.parent.activeSheetIndex,e.fillSheetIndex),I=_re(this.parent,x),T="FillFormattingOnly"===e.fillType,E=A.conditionalFormats&&A.conditionalFormats.length&&[].slice.call(A.conditionalFormats),D=r&&this.applyWrapToOuterCells(I),M=[],k=r&&b;h<=C;){for(var P,B=(F=this.updateFillValues(b,p,c,u,g,m,f,y,v,h)).patternRange,F=F.fillRange,L=(P=this.getRangeData({range:B,sheetIdx:S})).length,R=0;R<L;R++)if(P[R]&&P[R].isReadOnly)return void this.parent.notify(kne,null);for(n=(i=this.getSelectedRange(I,{rowIndex:F[0],colIndex:F[1]},{rowIndex:F[2],colIndex:F[3]})).length,t=0,w&&(i=i.reverse());t<n;){if(l=t%L,o=i[t],T&&(s=Kre(o.rowIndex,o.colIndex,I)),Object.assign(d,P[l],null,!0),T&&(d.value=s.value,d.formula=s.formula,je(d.notes)||delete d.notes,d.validation)&&delete d.validation,d&&d.isReadOnly)return void this.parent.notify(kne,null);je(d.notes)||je(d.isNoteEditable)||(delete d.notes,delete d.isNoteEditable),l={cell:d,rowIdx:o.rowIndex,colIdx:o.colIndex,valChange:!0,pvtExtend:!0,fillType:e.fillType},!r||zde(I,o.rowIndex)||epe(I,o.colIndex)||(l.td=this.parent.getCell(o.rowIndex,o.colIndex),l.uiRefresh=!!l.td),Yoe(this.parent,I,l,e.cells)||(r&&D(l),E&&!(a=a||l.isFormulaDependent)&&Zoe(E,M,o.rowIndex,o.colIndex,e.dataRange,e.fillRange,A),k&&d.style&&Qoe(d.style)&&this.parent.notify(Mie,{rowIdx:o.rowIndex,colIdx:o.colIndex,style:d.style,lastCell:!0,isHeightCheckNeeded:!0,onActionUpdate:!0,manualUpdate:!0})),d={},t++}h++}(M.length||a)&&this.parent.notify(_ne,{cfModel:!a&&M,refreshAll:a,isAction:!0,isEdit:!0})},Tde.prototype.applyWrapToOuterCells=function(t){var i,n,o,r=this,s=this.parent.frozenRowCount(t),a=this.parent.frozenColCount(t),e=this.parent.viewport;return e&&(i=e.topIndex+s,n=e.leftIndex+a),function(e){!e.td&&Kre(e.rowIdx,e.colIdx,t,!1,!0).wrap&&(e.rowIdx>=s&&e.rowIdx<i||e.colIdx>=a&&e.colIdx<n)&&((o=o||{range:null,wrap:!0,sheet:t,initial:!0,outsideViewport:!0}).range=[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx],r.parent.notify(sne,o))}},Tde.prototype.updateFillValues=function(e,t,i,n,o,r,s,a,l,h){var d,p,c,e=e?(d={rowIndex:t,colIndex:i+h},p={rowIndex:n,colIndex:i+h},c={rowIndex:r,colIndex:s+h},{rowIndex:a,colIndex:s+h}):(d={rowIndex:t+h,colIndex:i},p={rowIndex:t+h,colIndex:o},c={rowIndex:r+h,colIndex:s},{rowIndex:r+h,colIndex:l});return{patternRange:[d.rowIndex,d.colIndex,p.rowIndex,p.colIndex],fillRange:[c.rowIndex,c.colIndex,e.rowIndex,e.colIndex]}},Tde.prototype.getDataPattern=function(e,t){var i,n=0,o={val:null,type:null},r=[],s=this.getRangeData({range:e,sheetIdx:ee(t)?this.parent.activeSheetIndex:t}),a=s.length;if(a){for(var l=void 0,h=void 0,d=void 0,p=void 0,c=function(e){return!i&&e&&"-"===e[e.length-1]?e.slice(0,e.length-1):e};n<a;){var u,g,m,f=!1;if(s[n]?s[n].formula&&Poe(s[n].formula)?(u=s[n].formula,m="formula"):(u=je(s[n].value)?"":s[n].value,g={},d=s[n].format,p=mre(u),d&&ise(d,!0,g)?(m=g.type,u&&!p&&(g={value:u,updatedVal:u,cell:s[n]},this.parent.notify(Fie,g),g.isDate||g.isTime?s[n].value=u=g.updatedVal:m="string"),f="date"===m&&d.toLowerCase().startsWith("mmm")):m=p?"number":"string"):(u="",m="string"),h="","string"===m){if(i=!1,mre(u[0])){for(l=0;mre(u[++l]););" "===u[l]&&(i=!0,m="number",h=u.slice(l,u.length),u=Number(u.slice(0,l)))}if(!i&&mre(u[u.length-1])){for(l=1;l++,mre(u[u.length-l]););m="number",--l,h=u.slice(0,u.length-l),u=(g=u.slice(u.length-l,u.length)).match(/^0+/)?g:Number(g),o.dataVal&&o.dataVal!==h&&o.dataVal===c(h)&&(h=o.dataVal)}}0===n?(o={val:[u],type:m,isStartWithMonth:f},h&&(o.dataVal=h,o.start=i)):m!==o.type||o.dataVal&&c(o.dataVal)!==c(h)?(r.push(o),o={val:[u],type:m},h&&(o.dataVal=h,o.start=i)):o.val.push(u),n++}return r.push(o),r}return[{val:null,type:null}]},Tde.prototype.getPredictionValue=function(e,t){for(var i=0,n=0,o=0,r=0,s=0,a=0,l=0,h=e.length;i<h;)n+=i,o+=Number(e[i]),r+=i*Number(e[i]),s+=i*i,i++;return l=t?(a=(o*s-n*r)/(h*s-n*n),(h*r-n*o)/(h*s-n*n)):(a=this.round((o*s-n*r)/(h*s-n*n),5),this.round((h*r-n*o)/(h*s-n*n),5)),{a:a,b:l}},Tde.prototype.getPattern=function(e,t,i){var n,o,r,s,a=0,l=[],h=this.getDataPattern(e,i),d=h.length;if(h){for(;a<d;){switch((o=h[a]).type){case"number":case"date":var p,c=l.length,u=o.val.length,g=t.isReverseFill?-1:u;for(1===u&&(p=parseFloat(o.val[0])+1,"string"==typeof o.val[0]&&o.val[0].match(/^0+/)?o.val.push(this.getNextFormattedValue(o.val[0],p)):o.val.push(p)),p={regVal:this.getPredictionValue(o.dataVal?o.val.slice(0,2):o.val),type:o.type,i:g,isStartWithMonth:o.isStartWithMonth},o.dataVal&&(p.dataVal=o.dataVal,p.val=o.val,p.start=o.start),l.push(p),n=1;n<u;)l.push(c),n++;break;case"string":for(c=l.length,p={val:o.val,type:o.type,i:0},l.push(p),n=1,u=o.val.length;n<u;)l.push(c),n++;break;case"formula":if(u=o.val.length,o=this.getFormulaPattern(o.val,t),g=t.isReverseFill?-1:u,o.isInPattern)for(c=l.length,p={val:o.val,type:"formula",i:g},l.push(p),n=1;n<u;)l.push(c),n++;else for(n=0,g=t.isReverseFill?-1:1;n<u;)l.push({val:o.val[n],type:"formula",i:g}),n++;break;case"time":for(c=l.length,u=o.val.length,g=t.isReverseFill?-1:u,1===u&&(s=cre(o.val[0]),r=0<=(r=Number(o.val[0]))&&r<1,s=ure(new Date(s.getTime()+36e5),!0,r),o.val.push(s)),p={regVal:this.getPredictionValue(o.val,!0),type:o.type,i:g},l.push(p),n=1;n<u;)l.push(c),n++}a++}return l}return[{regVal:null}]},Tde.prototype.getNextFormattedValue=function(e,t){t=(new Ti).formatNumber(Math.abs(t),{minimumIntegerDigits:e.length,useGrouping:!1}),e=Moe({value:t},this.parent.locale);return e.isNumber?e.value:t},Tde.prototype.isCellReference=function(e){return/^[a-z]{1,3}\d{1,7}$/gi.test(e)?"relative":/^\$[a-z]{1,3}\$\d{1,7}$/gi.test(e)?"absolute":!!/^((\$[a-z]{1,3})\d{1,7}|[a-z]{1,3}(\$\d{1,7}))$/gi.test(e)&&"mixed"},Tde.prototype.round=function(e,t){return Number(Math.round(parseFloat(e+"e"+t))+"e-"+t)||Number(e)},Tde.prototype.getRangeData=function(e,t){for(var i,n,o,r,s,a=[],l=ee(e.sheetIdx)?this.parent.getActiveSheet():_re(this.parent,e.sheetIdx),h=e.range[0],d=e.range[1],p=e.range[2],c=e.range[3],u=d;h<=p;){if(zde(l,h));else for(d=u;d<=c;)epe(l,d)?d++:(r=Kre(h,d,l),t&&(r=Object.assign({},Kre(h,d,l)),s=Object.assign({},Kde(l,d)),r)&&!r.validation&&s&&s.validation&&(r.validation=Object.assign({},Kde(l,d).validation),o=Uoe(i=[h,d,h,d],n=[0,d,0,d],l,this.parent,{formula:s.validation.value1}),r.validation.value1=o,""!==r.validation.value2)&&(o=Uoe(i,n,l,this.parent,{formula:s.validation.value2}),r.validation.value2=o),a.push(r),d++);h++}return a},Tde.prototype.getFormulaPattern=function(e,t){for(var i,n,o,r,s=[],a=0,l=e.length,h={};a<l;)h.formula=e[a],this.parent.notify(voe,h),s.push(h.formulaArr),a++;var d=this.isInPattern(s,t.isVFill);if(d){for(a=(o=s[0]).length;a--;)n=o[a],(r=this.isCellReference(n))&&"absolute"!==r&&(o[a]=this.getCellRefPrediction(n,t,null,r));return{isInPattern:d,val:o}}for(a=0;a<l;){for(i=(o=s[a]).length;i--;)n=o[i],(r=this.isCellReference(n.trim()))&&"absolute"!==r&&(s[a][i]=this.getCellRefPrediction(n,t,l,r));a++}return{isInPattern:d,val:s}},Tde.prototype.generateColCount=function(e){for(var t=0,i=0;i<e.length;i++)t=26*t+(e.charCodeAt(i)-64);return t},Tde.prototype.getCellRefPrediction=function(e,t,i,n){e=e.toUpperCase();var o=new RegExp("[a-z$]","gi"),r=new RegExp("[0-9$]","g"),s=t.isVFill?e.replace(r,""):e.replace(o,""),o=t.isVFill?Number(e.replace(o,"")):this.generateColCount(e.replace(r,"").trim()),a=null,r=[o],l="$"===e[0];if(!l&&e.includes("$")&&"$"===e.trim()[0])for(var h=1;h<e.length;h++)if("$"===e[h]){a=h,l=!0;break}return r.push(i&&1!==i?o+i:o+1),o=this.getPredictionValue(r),n&&"mixed"===n&&(l===t.isVFill?s=a?s.substring(0,a)+"$"+s.substring(a):"$"+s:o.b=0),o.c=s,o},Tde.prototype.isInPattern=function(e,t){var i,n,o,r,s,a,l,h=0,d=1,p=e.length,c=new RegExp("[0-9$]","g"),u=new RegExp("[a-z$]","gi");if(1===p)return!1;for(;d<p;){if(i=e[h],o=e[d],(n=i.length)!==o.length)return!1;for(;n--;)if(r=i[n],s=o[n],this.isCellReference(r)===this.isCellReference(s)){if(l=t?(a=Number(r.replace(u,"")),Number(s.replace(u,""))):(a=this.generateColCount(r.replace(c,"")),this.generateColCount(s.replace(c,""))),a!==l-1)return!1}else if(r!==s)return!1;h++,d++}return!0},Tde.prototype.ensurePattern=function(e){for(var t,i=-1,n=e.length;n--;)"object"==typeof(t=e[n])?(i=n,"string"===t.type&&(t.val=t.val.reverse())):e[n]=i;return e},Tde.prototype.getSelectedRange=function(e,t,i){for(var n,o,r=[],s=fte([t.rowIndex,t.colIndex,i.rowIndex,i.colIndex]),a=s[0],l=s[2];a<=l;){if(jde(e,a));else for(n=s[1],o=s[3];n<=o;)r.push({rowIndex:a,colIndex:n}),n++;a++}return r},Tde.prototype.getFillType=function(e){return e.fillType=this.fillInfo.fillType,e.disableItems=this.fillInfo.disableItems,e},Tde.prototype.addEventListener=function(){this.parent.on(noe,this.autoFill,this),this.parent.on(roe,this.getFillType,this)},Tde.prototype.destroy=function(){this.removeEventListener(),this.parent=null},Tde.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(noe,this.autoFill),this.parent.off(roe,this.getFillType))},Tde.prototype.getModuleName=function(){return"workbookautofill"};var Ide=Tde;function Tde(e){this.parent=e,this.addEventListener()}Dde.prototype.getService=function(e){if(je(this.services[""+e]))throw"The service "+e+" is not registered";return this.services[""+e]},Dde.prototype.register=function(e,t){je(this.services[""+e])&&(this.services[""+e]=t)};var Ede=Dde;function Dde(){this.services={}}Mde=function(e,t){return(Mde=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])}))(e,t)};var Mde,kde,Pde,Bde=function(){return(Bde=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},yJ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},yJ=(function(e,t){function i(){this.constructor=e}Mde(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Fde,kde=Ji),(Pde=Fde).prototype.preRender=function(){Object.keys(this.commonCellStyle).length||(this.commonCellStyle=Zre(this.cellStyle,!0)),"spreadsheet"!==this.getModuleName()||this.refreshing||this.initEmptySheet()},Fde.prototype.initWorkbookServices=function(){this.serviceLocator.register(bre,new Cn(this.getModuleName(),wre,this.locale))},Fde.prototype.render=function(){},Fde.prototype.requiredModules=function(){return Ste(this)},Fde.prototype.getPersistData=function(){return this.addOnPersist([])},Fde.prototype.cellFormat=function(e,t){var i=this.getActiveSheet();!i||i.isProtected&&!i.protectSettings.formatCells||(t=t||i.selectedRange,this.notify(Tie,{style:e,range:t,refreshRibbon:-1<t.indexOf(i.activeCell)}))},Fde.prototype.lockCells=function(e,t){var i=this.getActiveSheet();e=e||i.selectedRange,this.notify(Pne,{range:e,isLocked:t,triggerEvent:!0})},Fde.prototype.getCellStyleValue=function(e,t){var i=this,n=Kre(t[0],t[1],this.getActiveSheet()),o={};return e.forEach(function(e){o[""+e]=i.cellStyle[""+e],n&&n.style&&n.style[""+e]&&(o[""+e]=n.style[""+e])}),o},Fde.prototype.numberFormat=function(e,t){this.notify(Sie,{format:e,range:t}),this.notify(xoe,{action:"addToCustomFormats",format:e})},Fde.prototype.createSheet=function(e,t){var i;void 0===e&&(e=this.sheets.length),(i=this.sheets).splice.apply(i,[e,0].concat(t=void 0===t?[{}]:t)),jre(this,t),this.notify(Hie,{sheetIndex:e||0,sheets:t}),this.notify(Pie,{action:"registerSheet",sheetIndex:e||0,sheetCount:e+t.length})},Fde.prototype.removeSheet=function(e){this.sheets.splice(e,1)},Fde.prototype.destroy=function(){this.notify(hie,null),kde.prototype.destroy.call(this)},Fde.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"cellStyle":I(this.commonCellStyle,e.cellStyle);break;case"sheets":e.sheets===this.sheets?(this.notify(Pie,{action:"unRegisterSheet",propertyChange:!0}),this.sheetNameCount=1,this.notify(zie,{}),jre(this),this.notify(Hie,null),this.notify(Pie,{action:"registerSheet"})):jre(this);break;case"listSeparator":this.notify(Pie,{action:"setArgumentSeparator"})}},Fde.prototype.appendTo=function(e){kde.prototype.appendTo.call(this,e)},Fde.prototype.hideRow=function(e,t,i){void 0===t&&(t=e),void 0===i&&(i=!0);for(var n=this.getActiveSheet(),o=e;o<=t;o++)Hde(n,o,{hidden:i})},Fde.prototype.hideColumn=function(e,t,i){void 0===t&&(t=e),void 0===i&&(i=!0);for(var n=this.getActiveSheet(),o=e;o<=t;o++)Jde(n,o,{hidden:i})},Fde.prototype.setBorder=function(e,t,i,n){this.notify(Tie,{style:e,borderType:i,range:t||this.getActiveSheet().selectedRange,isUndoRedo:n})},Fde.prototype.insertRow=function(e,t,i){this.notify(dne,{model:this.getSheetModel(i),start:e,end:t,modelType:"Row",insertType:"below"})},Fde.prototype.insertColumn=function(e,t,i){this.notify(dne,{model:this.getSheetModel(i),start:e,end:t,modelType:"Column",insertType:"after"})},Fde.prototype.insertSheet=function(e,t){this.isProtected||this.notify(dne,{model:this,start:e,end:t,modelType:"Sheet"})},Fde.prototype.delete=function(e,t,i,n){if(!this.isProtected){var o;if(e=e||0,t=je(t)?e:t,i&&"Sheet"!==i){if(!(o=this.getSheetModel(n)))return}else if(o=this,Math.abs(t-e)>=this.sheets.length)return;this.notify(pne,{model:o,start:e,end:t,modelType:i||"Sheet"})}},Fde.prototype.moveSheet=function(e,t){this.isProtected||Qre(this,e,t)},Fde.prototype.duplicateSheet=function(e){this.isProtected||Ure(this,e)},Fde.prototype.getSheetModel=function(e){return je(e)?this.getActiveSheet():je(e="string"==typeof e?Bre(this,e):e)||e>=this.sheets.length?null:this.sheets[e]},Fde.prototype.merge=function(e,t){var i,n;e?n=_re(this,i=this.isPrintingProcessing?this.currentPrintSheetIndex:mte(this,e)):(e=(n=this.getActiveSheet()).selectedRange,i=this.activeSheetIndex),this.notify(Bne,{merge:!0,range:e,type:t||"All",sheetIndex:i,refreshRibbon:-1<e.indexOf(n.activeCell),preventRefresh:this.activeSheetIndex!==i})},Fde.prototype.unMerge=function(e){var t,i;e?i=_re(this,t=mte(this,e)):(e=(i=this.getActiveSheet()).selectedRange,t=this.activeSheetIndex),this.notify(Bne,{merge:!1,range:e,sheetIndex:t,type:"All",refreshRibbon:-1<e.indexOf(i.activeCell),preventRefresh:this.activeSheetIndex!==t})},Fde.prototype.computeExpression=function(e){e={action:"computeExpression",formula:e,isFromComputeExpression:!0};return this.notify(Pie,e),e.calcValue},Fde.prototype.initEmptySheet=function(){this.sheets.length?jre(this):this.createSheet()},Fde.prototype.getActiveSheet=function(){return this.sheets[this.activeSheetIndex]},Fde.prototype.skipHiddenSheets=function(e,t,i){return void 0===i&&(i=0),this.sheets[e]&&"Visible"!==this.sheets[e].state&&(void 0===t&&(t=e),e=e&&e+1===this.sheets.length?t-1:e<t?--e:++e,e=this.skipHiddenSheets(e,t,++i)),i===this.sheets.length?(this.setSheetPropertyOnMute(this.sheets[0],"state","Visible"),0):e},Fde.prototype.setUsedRange=function(e,t,i,n,o){void 0===i&&(i=this.getActiveSheet()),o?this.setSheetPropertyOnMute(i,"usedRange",{rowIndex:e,colIndex:t}):(e>i.usedRange.rowIndex&&(this.setSheetPropertyOnMute(i,"usedRange",{rowIndex:e,colIndex:i.usedRange.colIndex}),i!==this.getActiveSheet()||n||this.notify(kie,{index:e,update:"row"})),t>i.usedRange.colIndex&&(this.setSheetPropertyOnMute(i,"usedRange",{rowIndex:i.usedRange.rowIndex,colIndex:t}),i!==this.getActiveSheet()||n||this.notify(kie,{index:t,update:"col"})))},Fde.prototype.getData=function(e){return Cre(this,e)},Fde.prototype.getModuleName=function(){return"workbook"},Fde.prototype.goTo=function(e){},Fde.prototype.getValueRowCol=function(e,t,i,n,o,r,s){var a,e=Fre(this,e),l=_re(this,e),h=Kre(t-1,i-1,l);if(n&&n.includes("!")&&!h&&l.ranges&&l.ranges.length){if(this.formulaRefCell&&this.formulaRefCell===n)return h&&h.value;if(l.ranges.forEach(function(e){e.info&&e.info.loadedRange&&e.info.loadedRange.length||(a=!0)}),a){if(this.formulaRefCell=n,je(e=Fre(this,Number(n.substring(n.lastIndexOf(",")+1,n.length)))))return h&&h.value;n=n.substring(n.lastIndexOf("!")+1,n.lastIndexOf(",")),Cre(this,l.name+"!A1:"+lte(t-1,i-1),null,null,null,null,n,e)}}else h&&h.formula&&(o||je(h.value))&&!r&&"Automatic"===this.calculationMode&&this.notify(xie,{cell:h,rowIdx:t-1,colIdx:i-1,sheetIndex:e,formulaRefresh:!0});return!h||mre(h.value)||this.isEdit||(l={formattedText:h.value,value:h.value,format:h.format,cell:h,skipFormatCheck:!1},this.notify(Aie,l),h=l.cell),s&&h&&h.formula&&h.formula.includes("SUBTOTAL(")?h.formula:h&&h.value},Fde.prototype.setValueRowCol=function(e,t,i,n,o,r){this.notify(Bie,{action:"updateCellValue",address:[i-1,n-1],value:t,sheetIndex:Fre(this,e),isValueOnly:!0,formula:o,isRandomFormula:r})},Fde.prototype.open=function(e){this.notify(gie,e)},Fde.prototype.openFromJson=function(e,t){this.isOpen=!0;var i="object"==typeof e.file?JSON.stringify(e.file):e.file;if(""!==i&&t){var n=[];if(t.onlyValues)n.push.apply(n,["style","formula","format","conditionalFormats","validation","hyperlink","wrap","chart","image","notes"]);else{var o,r={style:t.ignoreStyle,formula:t.ignoreFormula,format:t.ignoreFormat,conditionalFormats:t.ignoreConditionalFormat,validation:t.ignoreValidation,wrap:t.ignoreWrap,chart:t.ignoreChart,image:t.ignoreImage,notes:t.ignoreNote};for(o in t.ignoreFreezePane&&n.push.apply(n,["frozenColumns","frozenRows"]),r)r[o]&&n.push(o)}i=JSON.stringify(JSON.parse(i),function(e,t){if(!(-1<n.indexOf(e)))return t})}this.notify(gie,{jsonObject:i,triggerEvent:e.triggerEvent})},Fde.prototype.save=function(e,t){var i;void 0===e&&(e={}),this.allowSave&&(i={url:this.saveUrl,fileName:e.fileName||"Sample",saveType:"Xlsx"},i=Bde({},i,e,{customParams:{},isFullPost:!0,needBlobData:!1,cancel:!1,autoDetectFormat:!1,pdfLayoutSettings:{fitSheetOnOnePage:!1,orientation:"Portrait"}}),this.trigger("beforeSave",i),this.notify(fie,{eventArgs:i,action:"beforeSave"}),i.cancel||this.notify(mie,{saveSettings:i,isFullPost:i.isFullPost,needBlobData:i.needBlobData,customParams:i.customParams,pdfLayoutSettings:i.pdfLayoutSettings,jsonConfig:t}))},Fde.prototype.saveAsJson=function(e){var i=this;return new Promise(function(t){i.on(ane,function(e){e.cancel=!0,i.off(ane),t({jsonObject:{Workbook:e.jsonObject}}),i.notify(Cie,e)}),i.save({},e)})},Fde.prototype.addHyperlink=function(e,t){this.notify(nne,{hyperlink:e,cell:t})},Fde.prototype.findHandler=function(e){this.notify(mne,e)},Fde.prototype.replaceHandler=function(e){"replace"===e.replaceBy?this.notify(yne,e):this.notify(vne,e)},Fde.prototype.protectSheet=function(e,t,i){je(e)?e=this.activeSheetIndex:"string"==typeof e&&(e=Bre(this,e));var n=this.sheets[e];n&&(this.setSheetPropertyOnMute(n,"isProtected",!0),this.setSheetPropertyOnMute(n,"password",i||""),this.setSheetPropertyOnMute(n,"protectSettings",t||{}),this.notify(Tne,{protectSettings:n.protectSettings,password:n.password,sheetIndex:e}))},Fde.prototype.unprotectSheet=function(e){je(e)?e=this.activeSheetIndex:"string"==typeof e&&(e=Bre(this,e)),this.sheets[e]&&this.notify(Dne,{sheet:e})},Fde.prototype.sort=function(e,t,i){return this.allowSorting?(t={args:{range:t||this.getActiveSheet().selectedRange,sortOptions:e||{sortDescriptors:{}},cancel:!1},promise:new Promise(function(e){e(void 0)}),previousSort:i},this.notify(Kie,t),t.promise):Promise.reject()},Fde.prototype.addDataValidation=function(e,t){je(e.value1)||("List"===e.type?256<e.value1.length&&(e.value1=e.value1.substring(0,255)):(e.value1=ere([e.value1],this)[0],e.value2&&(e.value2=ere([e.value2],this)[0])),this.notify(une,{rules:e,range:t||lre(this.getActiveSheet())}))},Fde.prototype.removeDataValidation=function(e){this.notify(une,{range:e||lre(this.getActiveSheet()),isRemoveValidation:!0})},Fde.prototype.addInvalidHighlight=function(e){this.notify(gne,{range:e})},Fde.prototype.removeInvalidHighlight=function(e){this.notify(Cne,{range:e})},Fde.prototype.isValidCell=function(e){e?(t=(e=gte(this,e)).sheetIndex,i=e.indices,n=_re(this,t)):(i=ste((n=this.getActiveSheet()).activeCell),t=this.activeSheetIndex);var t,i,n,e=Kre(i[0],i[1],n,!1,!0);return!e.validation&&!tpe(n.columns[i[1]],i[0],i[1])||(n={value:e.value||"",range:i,sheetIdx:t,td:null,isValid:!0},this.notify(cne,n),n.isValid)},Fde.prototype.conditionalFormat=function(e){var t,i,n=this;e.range?","!==this.listSeparator&&e.range.includes(this.listSeparator)&&(e.range=e.range.split(this.listSeparator).join(",")):e.range=this.getActiveSheet().selectedRange,e.value&&(t=void 0,ere(t="Between"===e.type?","!==this.listSeparator&&e.value.includes(this.listSeparator)?1<(i=e.value.split('"').filter(function(e){return e.trim()&&e.trim()!==n.listSeparator})).length?i:e.value.split(this.listSeparator):1<(i=e.value.split('"').filter(function(e){return e.trim()&&","!==e.trim()})).length?i:e.value.split(","):[e.value],this),e.value=t.join(",")),this.notify(Vne,{cfModel:e})},Fde.prototype.clearConditionalFormat=function(e){var t,i={};e&&e.includes("!")?(t=e.lastIndexOf("!"),i.range=e.substring(t+1),i.sheetIdx=Bre(this,e.substring(0,t))):(i.range=e||this.getActiveSheet().selectedRange,i.sheetIdx=this.activeSheetIndex),this.notify(Hne,i)},Fde.prototype.updateCell=function(e,t,i){je(i)&&(i=!0),this.updateCellDetails(e,t,void 0,void 0,i)},Fde.prototype.updateCellDetails=function(e,t,i,n,o,r,s){var a,l;if((t=t||this.getActiveSheet().activeCell).includes("!")){if(a=pte(t),void 0===(l=Bre(this,t.substring(0,t.lastIndexOf("!")))))return}else a=rte(t),l=this.activeSheetIndex;var h,t=_re(this,l);!r||t.rowCount>a[0]&&t.rowCount>a[2]&&t.colCount>a[1]&&t.colCount>a[3]?(Yoe(this,t,{cell:e,rowIdx:a[0],colIdx:a[1],preventEvt:!0}),s=null!==(r=s?e.formula||(je(e.value)?null:e.value):je(e.value)?e.formula||null:e.value),h=Kre(a[0],a[1],t,!1,!0),i&&i.format&&n&&(h.format=i.format),s?(delete h.formattedText,this.notify(Bie,{action:"updateCellValue",address:a,value:r,sheetIndex:l,cellInformation:i,isRedo:n,isDependentUpdate:o}),this.isEdit&&"#CIRCULARREF!"===h.value&&(h.value="0")):!je(e.format)&&h.formattedText&&delete h.formattedText,l===this.activeSheetIndex&&(r={sheet:t,cell:h,rowIdx:a[0],colIdx:a[1]},(1<h.rowSpan||1<h.colSpan)&&ire(r),(i=!zde(t,r.rowIdx)&&!epe(t,r.colIdx)&&this.getCell(r.rowIdx,r.colIdx))&&this.serviceLocator.getService("cell").refresh(r.rowIdx,r.colIdx,!0,i,s,s),n=ste(t.activeCell),a[0]===n[0])&&a[1]===n[1]&&(this.notify(qne,null),this.notify(yse,{action:"refreshFormulabar",cell:h}),i)&&e.validation&&(r.validation=h.validation,r.td=i,r.isRefresh=!0,this.notify(Toe,r))):this.notify(tle,null)},Fde.prototype.getRowData=function(e,t){je(e)&&(e=0);t={sheetIdx:t=je(t)?this.activeSheetIndex:t,startIndex:e,modelType:"Row",isDataRequest:!0};return this.notify(cie,t),t.data},Fde.prototype.updateRange=function(e,t){var i=_re(this,t=void 0===t?this.activeSheetIndex:t);i&&(e.startCell||(e.startCell="A1"),void 0===e.showFieldAsHeader&&(e.showFieldAsHeader=!0),e.template&&!e.address&&(e.address=e.startCell),i.ranges.push(e),this.setSheetPropertyOnMute(i,"ranges",i.ranges),e.dataSource)&&this.notify(pie,{sheetIdx:t,rangeIdx:i.ranges.length-1,changedData:e.dataSource})},Fde.prototype.wrap=function(e,t){$re(e,t=void 0===t?!0:t,this,null,!0)},Fde.prototype.addDefinedName=function(e){e={action:"addDefinedName",isAdded:!1,definedName:e};return this.notify(Pie,e),e.isAdded},Fde.prototype.removeDefinedName=function(e,t){e={action:"removeDefinedName",isRemoved:!1,definedName:e,scope:t=void 0===t?"":t};return this.notify(Pie,e),e.isRemoved},Fde.prototype.insertImage=function(e,t){this.notify(Wne,{options:e,range:t||this.getActiveSheet().selectedRange})},Fde.prototype.autoFill=function(e,t,i,n){t={dataRange:t||this.getActiveSheet().selectedRange,fillRange:e,direction:i||"Down",fillType:n||"FillSeries"};this.notify(noe,t)},Fde.prototype.insertChart=function(e){this.notify(Qne,{chart:e})},Fde.prototype.deleteChart=function(e){this.notify(Dle,{id:e})},Fde.prototype.filter=function(e,t){return this.allowFiltering?(t={args:{range:t||this.getActiveSheet().selectedRange,filterOptions:e,cancel:!1},promise:new Promise(function(e){e(void 0)})},this.notify(one,t),t.promise):Promise.reject()},Fde.prototype.addCustomFunction=function(e,t,i){t=t||("string"==typeof e?e:e.name.replace("bound ","")),this.notify(Pie,{action:"addCustomFunction",functionHandler:e,functionName:t,formulaDescription:i})},Fde.prototype.clear=function(e){this.notify(zne,e)},Fde.prototype.getDisplayText=function(e){var t;return e?e.format&&!je(e.value)?(t={formattedText:e.value,value:e.value,format:e.format,cell:e,skipFormatCheck:!0},this.notify(Aie,t),t.formattedText):!e.value&&e.hyperlink?"string"==typeof e.hyperlink?e.hyperlink:e.hyperlink.address:e.value||"number"==typeof e.value?e.value.toString():"":""},Fde.prototype.freezePanes=function(e,t,i){void 0===e&&(e=1),void 0===t&&(t=1);i=this.getSheetModel(i);!this.allowFreezePane||i.frozenRows===e&&i.frozenColumns===t||(this.setSheetPropertyOnMute(i,"frozenRows",e),this.setSheetPropertyOnMute(i,"frozenColumns",t),this.updateTopLeftCell(),i.id===this.getActiveSheet().id&&"spreadsheet"===this.getModuleName()&&this.renderModule.refreshSheet())},Fde.prototype.Unfreeze=function(e){this.freezePanes(0,0,e)},Fde.prototype.unfreezePanes=function(e){this.freezePanes(0,0,e)},Fde.prototype.calculateNow=function(e,t){"Workbook"===e&&"Manual"===this.calculationMode&&(e="CalculateWorkbook",this.setProperties({calculationMode:"Automatic"},!0));e={action:"calculateNow",scope:e,sheets:"Workbook"===e||"CalculateWorkbook"===e?this.sheets:[_re(this,t="string"==typeof t?Bre(this,t):je(t)?this.activeSheetIndex:t)],promise:new Promise(function(e){e(void 0)})};return this.notify(Pie,e),e.promise},Fde.prototype.updateTopLeftCell=function(e,t,i,n){var o=ste((n=n||this.getActiveSheet()).topLeftCell);n.frozenRows||n.frozenColumns?((je(e)||e<0)&&(e=n.frozenRows?0:o[0]),(je(t)||t<0)&&(t=n.frozenColumns?0:o[1]),e+=this.frozenRowCount(n),t+=this.frozenColCount(n),i&&("row"===i?e=ste(n.paneTopLeftCell)[0]:t=ste(n.paneTopLeftCell)[1]),this.setSheetPropertyOnMute(n,"paneTopLeftCell",lte(e,t)),n.frozenRows&&(e=o[0]),n.frozenColumns&&(t=o[1])):(je(e)&&(e=o[0]),je(t)&&(t=o[1]),this.setSheetPropertyOnMute(n,"paneTopLeftCell",lte(e,t))),this.setSheetPropertyOnMute(n,"topLeftCell",lte(e,t))},Fde.prototype.getAddressInfo=function(e){return gte(this,e)},Fde.prototype.setSheetPropertyOnMute=function(e,t,i){this.isProtectedOnChange=!0,e[""+t]=i,this.isProtectedOnChange=!1},Fde.prototype.frozenRowCount=function(e){return e.frozenRows?"A1"===e.topLeftCell?e.frozenRows:ste(e.topLeftCell)[0]+e.frozenRows:0},Fde.prototype.frozenColCount=function(e){return e.frozenColumns?"A1"===e.topLeftCell?e.frozenColumns:ste(e.topLeftCell)[1]+e.frozenColumns:0},Fde.prototype.updateRangeOnInsertDelete=function(e,t,i,n,o,r,s){var a,l,h=!1;return e.isInsert?(l=e.endIndex-e.startIndex+1,"Row"===e.modelType?e.forceUpdate?(t[0]+=1,t[2]+=1,h=!0):(a=!r&&s&&t[2]===e.startIndex-1&&n===e.startIndex&&t[1]===t[3],e.startIndex<=t[0]&&(t[0]+=l,h=!0),(e.startIndex<=t[2]||i&&e.startIndex===t[2]+1&&a)&&(t[2]+=l,h=!0)):e.forceUpdate?(t[1]+=1,t[3]+=1,h=!0):(a=!r&&s&&t[3]===e.startIndex-1&&o===e.startIndex&&t[0]===t[2],e.startIndex<=t[1]&&(t[1]+=l,h=!0),(e.startIndex<=t[3]||i&&e.startIndex===t[3]+1&&a)&&(t[3]+=l,h=!0))):"Row"===e.modelType?(0<(l=t[0]-e.startIndex)&&(!(t[0]>e.endIndex)||0<(l=e.endIndex-e.startIndex+1))&&(t[0]-=l,h=!0),e.startIndex<=t[2]&&(e.endIndex<=t[2]?t[2]-=e.endIndex-e.startIndex+1:t[2]-=t[2]-e.startIndex+1,h=!0)):(0<(l=t[1]-e.startIndex)&&(!(t[1]>e.endIndex)||0<(l=e.endIndex-e.startIndex+1))&&(t[1]-=l,h=!0),e.startIndex<=t[3]&&(e.endIndex<=t[3]?t[3]-=e.endIndex-e.startIndex+1:t[3]-=t[3]-e.startIndex+1,h=!0)),h},Fde.prototype.getCell=function(e,t,i){return null},Fde.prototype.dateToInt=function(e,t){return ure(e,t)},Fde.prototype.setDateFormat=function(e,t,i){var e=_re(this,Fre(this,e)),n=Kre(t,i,e,null,!0).format;n&&"General"!==n||Jre(t,i,e,{format:Ghe("ShortDate")},!0)},yJ([kt([],kre)],Fde.prototype,"sheets",void 0),yJ([e(0)],Fde.prototype,"activeSheetIndex",void 0),yJ([e("100%")],Fde.prototype,"height",void 0),yJ([e(!0)],Fde.prototype,"allowFindAndReplace",void 0),yJ([e()],Fde.prototype,"filterCollection",void 0),yJ([e()],Fde.prototype,"sortCollection",void 0),yJ([e("100%")],Fde.prototype,"width",void 0),yJ([e(!0)],Fde.prototype,"showRibbon",void 0),yJ([e(!0)],Fde.prototype,"showFormulaBar",void 0),yJ([e(!0)],Fde.prototype,"showSheetTabs",void 0),yJ([e(!0)],Fde.prototype,"allowEditing",void 0),yJ([e(!0)],Fde.prototype,"allowOpen",void 0),yJ([e(!0)],Fde.prototype,"allowSave",void 0),yJ([e(!0)],Fde.prototype,"allowSorting",void 0),yJ([e(!0)],Fde.prototype,"allowFiltering",void 0),yJ([e(!0)],Fde.prototype,"allowNumberFormatting",void 0),yJ([e(!0)],Fde.prototype,"allowCellFormatting",void 0),yJ([e(!0)],Fde.prototype,"allowHyperlink",void 0),yJ([e(!0)],Fde.prototype,"enableNotes",void 0),yJ([e(!0)],Fde.prototype,"allowInsert",void 0),yJ([e(!0)],Fde.prototype,"allowDelete",void 0),yJ([e(!0)],Fde.prototype,"allowMerge",void 0),yJ([e(!0)],Fde.prototype,"allowDataValidation",void 0),yJ([e(!0)],Fde.prototype,"allowImage",void 0),yJ([e(!0)],Fde.prototype,"allowChart",void 0),yJ([e(!0)],Fde.prototype,"allowAutoFill",void 0),yJ([e(!0)],Fde.prototype,"allowPrint",void 0),yJ([e("Automatic")],Fde.prototype,"calculationMode",void 0),yJ([t({},Wo)],Fde.prototype,"autoFillSettings",void 0),yJ([e(!0)],Fde.prototype,"allowConditionalFormat",void 0),yJ([t({},mJ)],Fde.prototype,"cellStyle",void 0),yJ([e("")],Fde.prototype,"openUrl",void 0),yJ([t({},Xo)],Fde.prototype,"openSettings",void 0),yJ([e("")],Fde.prototype,"saveUrl",void 0),yJ([e("")],Fde.prototype,"password",void 0),yJ([e(!1)],Fde.prototype,"isProtected",void 0),yJ([kt([],Pte)],Fde.prototype,"definedNames",void 0),yJ([i()],Fde.prototype,"beforeOpen",void 0),yJ([i()],Fde.prototype,"openFailure",void 0),yJ([i()],Fde.prototype,"beforeSave",void 0),yJ([i()],Fde.prototype,"saveComplete",void 0),yJ([i()],Fde.prototype,"beforeCellFormat",void 0),yJ([i()],Fde.prototype,"queryCellInfo",void 0),yJ([i()],Fde.prototype,"beforeCellUpdate",void 0),yJ([e(!0)],Fde.prototype,"allowFreezePane",void 0),yJ([e(",")],Fde.prototype,"listSeparator",void 0),Pde=yJ([Bt],Fde));function Fde(e){var t=kde.call(this,e)||this;return t.isEdit=!1,t.sheetNameCount=1,t.dataValidationRange="",t.isOpen=!1,t.chartColl=[],t.isPrintingProcessing=!1,t.currentPrintSheetIndex=0,t.customFormulaCollection=new Map,Pde.Inject(rse,Che,che,Uhe,ode,sde,zhe,Khe,lde,Zhe,dde,yde,gde,bde,Cde,Ade,ede,ide,Ide),t.commonCellStyle={},e&&e.cellStyle&&(t.commonCellStyle=e.cellStyle),"workbook"===t.getModuleName()&&(t.serviceLocator=new Ede,t.initWorkbookServices(),t.dataBind(),t.initEmptySheet()),t}Lde=function(e,t){return(Lde=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])}))(e,t)};var Lde,Rde,Ode=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Nde=(function(e,t){function i(){this.constructor=e}Lde(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Vde,Rde=n),Ode([kt([],Yre)],Vde.prototype,"cells",void 0),Ode([e(0)],Vde.prototype,"index",void 0),Ode([e(20)],Vde.prototype,"height",void 0),Ode([e(!1)],Vde.prototype,"customHeight",void 0),Ode([e(!1)],Vde.prototype,"hidden",void 0),Ode([t({},z$)],Vde.prototype,"format",void 0),Ode([e(!1)],Vde.prototype,"isReadOnly",void 0),Vde);function Vde(){return null!==Rde&&Rde.apply(this,arguments)||this}function _de(e,t){return e.rows[t]}function Hde(t,i,n){t.rows[i]||(t.rows[i]={}),Object.keys(n).forEach(function(e){t.rows[i][""+e]=n[""+e]})}function zde(e,t){return e.rows[t]&&e.rows[t].hidden}function jde(e,t){return e.rows[t]&&e.rows[t].isFiltered}function Wde(e,t,i,n){var o,r;if(e&&e.standardHeight&&(r=e.standardHeight),e&&e.rows&&e.rows[t]){if(!n&&e.rows[t].hidden)return 0;o=void 0===e.rows[t].height?void 0===r?20:r:e.rows[t].height}else o=void 0===r?20:r;return i&&0<window.devicePixelRatio%1?o+((n=o*window.devicePixelRatio%1)?(.5<n?1-n:-1*n)/window.devicePixelRatio:0):o}function Qde(e,t,i){e&&e.rows&&(e.rows[t]||(e.rows[t]={}),e.rows[t].height=i)}function Ude(e,t,i,n,o){var r,s=0;(i=void 0===i?t:i)<t&&(r=t,t=i,i=r);for(var a=t;a<=i;a++)s+=Wde(e,a,n,o);return s}qde=function(e,t){return(qde=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])}))(e,t)};var qde,Gde,Ode=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Yde=(function(e,t){function i(){this.constructor=e}qde(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Xde,Gde=n),Ode([e(0)],Xde.prototype,"index",void 0),Ode([e(64)],Xde.prototype,"width",void 0),Ode([e(!1)],Xde.prototype,"customWidth",void 0),Ode([e(!1)],Xde.prototype,"hidden",void 0),Ode([t({},z$)],Xde.prototype,"format",void 0),Ode([e(!0)],Xde.prototype,"isLocked",void 0),Ode([e("")],Xde.prototype,"validation",void 0),Ode([e(!1)],Xde.prototype,"isReadOnly",void 0),Xde);function Xde(){return null!==Gde&&Gde.apply(this,arguments)||this}function Kde(e,t){return e.columns?e.columns[t]||(e.columns[t]={}):(e.columns=[],e.columns[t]={}),e.columns[t]}function Jde(e,t,i){var n=Kde(e,t);Object.keys(i).forEach(function(e){n[""+e]=i[""+e]})}function Zde(e,t,i,n){var o;if(e&&e.columns&&e.columns[t]){if(!i&&e.columns[t].hidden)return 0;o=e.columns[t].width||e.columns[t].customWidth?e.columns[t].width:64}else o=64;return n&&0<window.devicePixelRatio%1?o+((i=o*window.devicePixelRatio%1)?(.5<i?1-i:-1*i)/window.devicePixelRatio:0):o}function $de(e,t,i,n){var o,r=0;(i=void 0===i?t:i)<t&&(o=t,t=i,i=o);for(var s=t;s<=i;s++)r+=Zde(e,s,null,n);return r}function epe(e,t){return e.columns[t]&&e.columns[t].hidden}function tpe(e,t,i){return e&&e.validation&&(!e.validation.address||Noe(e.validation.address,t,i))}function ipe(e){var t=[],i=e,n=t;return i.showRibbon&&n.push({member:"ribbon",args:[i]}),i.showFormulaBar&&n.push({member:"formulaBar",args:[i]}),i.showSheetTabs&&n.push({member:"sheetTabs",args:[i]}),i.allowEditing&&(n.push({member:"edit",args:[i]}),n.push({member:"formula",args:[i]})),i.allowOpen&&n.push({member:"open",args:[i]}),i.allowSave&&n.push({member:"save",args:[i]}),i.enableContextMenu&&n.push({member:"contextMenu",args:[i]}),i.allowAutoFill&&n.push({member:"autofill",args:[i]}),"None"!==i.selectionSettings.mode&&n.push({member:"selection",args:[i]}),i.enableKeyboardNavigation&&n.push({member:"keyboardNavigation",args:[i]}),i.allowNumberFormatting&&n.push({member:"numberFormat",args:[i]}),i.enableKeyboardShortcut&&n.push({member:"keyboardShortcut",args:[i]}),i.enableClipboard&&n.push({member:"clipboard",args:[i]}),i.allowCellFormatting&&n.push({member:"cellformat",args:[i]}),i.allowSorting&&n.push({member:"sort",args:[i]}),i.allowResizing&&n.push({member:"resize",args:[i]}),n.push({member:"protectSheet",args:[i]}),n.push({member:"workbookFormula",args:[i]}),n.push({member:"workbookEdit",args:[i]}),i.allowHyperlink&&n.push({member:"spreadsheetHyperlink",args:[i]}),i.enableNotes&&n.push({member:"spreadsheetNote",args:[i]}),i.allowUndoRedo&&n.push({member:"undoredo",args:[i]}),i.allowFiltering&&n.push({member:"filter",args:[i]}),i.allowWrap&&n.push({member:"wrapText",args:[i]}),i.allowInsert&&n.push({member:"insert",args:[i]}),i.allowDelete&&n.push({member:"delete",args:[i]}),i.allowDataValidation&&n.push({member:"dataValidation",args:[i]}),i.allowFindAndReplace&&n.push({member:"findAndReplace",args:[i]}),i.allowMerge&&n.push({member:"merge",args:[i]}),i.allowConditionalFormat&&n.push({member:"conditionalFormatting",args:[i]}),i.allowImage&&n.push({member:"spreadsheetImage",args:[i]}),i.allowChart&&n.push({member:"spreadsheetChart",args:[i]}),Ste(e,t),t}var npe="e-wraptext",ope="spreadsheetLocale",rpe="dialog",spe="actionEvents",ape="shape",lpe={Custom:["#ffffff","#000000","#e7e6e6","#44546a","#4472c4","#ed7d31","#a5a5a5","#ffc000","#70ad47","#ff0000","#f2f2f2","#808080","#cfcdcd","#d5dce4","#d9e2f3","#fbe4d5","#ededed","#fff2cc","#e2efd9","#ffcccc","#d9d9d9","#595959","#aeaaaa","#acb9ca","#b4c6e7","#f7caac","#dbdbdb","#ffe599","#c5e0b3","#ff8080","#bfbfbf","#404040","#747070","#8496b0","#8eaadb","#f4b083","#c9c9c9","#ffd966","#a8d08d","#ff3333","#a6a6a6","#262626","#3b3838","#323e4f","#2f5496","#c45911","#7b7b7b","#bf8f00","#538135","#b30000","#7f7f7f","#0d0d0d","#161616","#212934","#1f3763","#823b0b","#525252","#7f5f00","#375623","#660000"]},hpe={Custom:["#ffffff","#000000","#ffff00","#00ff00","#00ffff","#0000ff","#ff0000","#000080","#800080","#996633","#f2f2f2","#808080","#ffffcc","#b3ffb3","#ccffff","#ccccff","#ffcccc","#ccccff","#ff80ff","#f2e6d9","#d9d9d9","#595959","#ffff80","#80ff80","#b3ffff","#8080ff","#ff8080","#8080ff","#ff00ff","#dfbf9f","#bfbfbf","#404040","#ffff33","#33ff33","#33ffff","#3333ff","#ff3333","#0000b3","#b300b3","#c68c53","#a6a6a6","#262626","#e6e600","#00b300","#009999","#000099","#b30000","#000066","#660066","#86592d","#7f7f7f","#0d0d0d","#999900","#006600","#006666","#000066","#660000","#00004d","#4d004d","#734d26"]},dpe={UP:38,DOWN:40,LEFT:37,RIGHT:39,FIRSTALPHABET:65,LASTALPHABET:90,SPACE:32,BACKSPACE:8,TAB:9,DELETE:46,ENTER:13,ESC:27},ppe={FindValue:"Find value",ReplaceValue:"Replace value",FindReplaceTooltip:"Find & Replace",InsertingEmptyValue:"Reference value is not valid.",ReplaceAllEnd:" matches replaced with ",ByRow:"By Rows",ByColumn:"By Columns",MatchCase:"Match case",MatchExactCellElements:"Match entire cell contents",EnterCellAddress:"Enter cell address",FindAndReplace:"Find and Replace",FindNextBtn:"Find Next",FindPreviousBtn:"Find Previous",ReplaceBtn:"Replace",ReplaceAllBtn:"Replace All",GotoHeader:"Go To",Sheet:"Sheet",Workbook:"Workbook",NoElements:"We couldn't find what you were looking for.",FindWhat:"Find what",ReplaceWith:"Replace with",Cut:"Cut",Copy:"Copy",Paste:"Paste",PasteSpecial:"Paste Special",Link:"Link",Spreadsheet:"Spreadsheet",AddNote:"Add Note",EditNote:"Edit Note",DeleteNote:"Delete Note",Hyperlink:"Hyperlink",EditHyperlink:"Edit Hyperlink",OpenHyperlink:"Open Hyperlink",RemoveHyperlink:"Remove Hyperlink",InvalidHyperlinkAlert:"The address of this site is not valid. Check the address and try again.",InsertLink:"Insert Link",EditLink:"Edit Link",All:"All",Values:"Values",Formats:"Formats",Bold:"Bold",Font:"Font",FontSize:"Font Size",Italic:"Italic",Underline:"Underline",Strikethrough:"Strikethrough",TextColor:"Text Color",FillColor:"Fill Color",HorizontalAlignment:"Horizontal Alignment",AlignLeft:"Align Left",AlignCenter:"Center",AlignRight:"Align Right",VerticalAlignment:"Vertical Alignment",AlignTop:"Align Top",AlignMiddle:"Align Middle",AlignBottom:"Align Bottom",WrapText:"Wrap Text",MergeCells:"Merge Cells",MergeAll:"Merge All",MergeHorizontally:"Merge Horizontally",MergeVertically:"Merge Vertically",Unmerge:"Unmerge",UnmergeCells:"Unmerge Cells",SelectMergeType:"Select Merge Type",MergeCellsAlert:"Merging cells will only preserve the top-leftmost(Uppermost) value. Merge anyway?",Borders:"Borders",TopBorders:"Top Borders",LeftBorders:"Left Borders",RightBorders:"Right Borders",BottomBorders:"Bottom Borders",AllBorders:"All Borders",HorizontalBorders:"Horizontal Borders",VerticalBorders:"Vertical Borders",OutsideBorders:"Outside Borders",InsideBorders:"Inside Borders",NoBorders:"No Borders",BorderColor:"Border Color",BorderStyle:"Border Style",InsertFunction:"Insert Function",CalcOptions:"Calculation Options",CalcOptionsTip:"Choose to calculate formulas either automatically or manually",CalcActiveSheet:"Calculate Sheet",CalcWorkbook:"Calculate Workbook",Automatic:"Automatic",Manual:"Manual",CalcSheetTip:"Calculate the active sheet",CalcWorkbookTip:"Calculate the entire workbook",Insert:"Insert",Delete:"Delete",DuplicateSheet:"Duplicate",MoveRight:"Move Right",MoveLeft:"Move Left",Rename:"Rename",Hide:"Hide",FileName:"File Name",PROPER:"Converts a text to proper case; first letter to uppercase and other letters to lowercase.",NameBox:"Name Box",ShowHeaders:"Show Headers",HideHeaders:"Hide Headers",ShowGridLines:"Show Gridlines",ExtendValidation:"The selection contains some cells without data validation. Do you want to extend validation to these cells?",Yes:"Yes",No:"No",HideGridLines:"Hide Gridlines",FreezePanes:"Freeze Panes",FreezeRows:"Freeze Rows",FreezeColumns:"Freeze Columns",UnfreezePanes:"Unfreeze Panes",UnfreezeRows:"Unfreeze Rows",UnfreezeColumns:"Unfreeze Columns",AddSheet:"Add Sheet",ListAllSheets:"List All Sheets",CollapseToolbar:"Collapse Toolbar",ExpandToolbar:"Expand Toolbar",CollapseFormulaBar:"Collapse Formula Bar",ExpandFormulaBar:"Expand Formula Bar",File:"File",Home:"Home",Formulas:"Formulas",View:"View",New:"New",Open:"Open",SaveAs:"Save As",Print:"Print",Update:"Update",ExcelXlsx:"Microsoft Excel",ExcelXls:"Microsoft Excel 97-2003",CSV:"Comma-separated values",FormulaBar:"Formula Bar",Sort:"Sort",SortAscending:"Ascending",SortDescending:"Descending",CustomSort:"Custom Sort",AddColumn:"Add Column",ContainsHeader:"Data contains header",CaseSensitive:"Case sensitive",SortBy:"Sort by",ThenBy:"Then by",SelectAColumn:"Select a column",SortEmptyFieldError:"All sort criteria must have a column specified. Check the selected sort criteria and try again.",SortDuplicateFieldError:"  is being sorted by values more than once. Delete the duplicate sort criteria and try again.",SortOutOfRangeError:"Select a cell or range inside the used range and try again.",MultiRangeSortError:"This can't be done on a multiple range selection. Select a single range and try again.",SortAndFilter:"Sort & Filter",Filter:"Filter",ClearAllFilter:"Clear",ClearFilterFrom:"Clear Filter From ",ReapplyFilter:"Reapply",FilterCellValue:"Filter by Value of Selected Cell",FilterOutOfRangeError:"Select a cell or range inside the used range and try again.",HideRow:"Hide Row",HideRows:"Hide Rows",UnhideRows:"Unhide Rows",HideColumn:"Hide Column",HideColumns:"Hide Columns",UnhideColumns:"Unhide Columns",InsertRow:"Insert Row",InsertRows:"Insert Rows",Above:"Above",Below:"Below",InsertColumn:"Insert Column",InsertColumns:"Insert Columns",Before:"Before",After:"After",DeleteRow:"Delete Row",DeleteRows:"Delete Rows",DeleteColumn:"Delete Column",DeleteColumns:"Delete Columns",Ok:"OK",Close:"Close",MoreOptions:"More Options",Cancel:"Cancel",Apply:"Apply",MoreColors:"More Colors",StandardColors:"Standard Colors",General:"General",Number:"Number",Currency:"Currency",Accounting:"Accounting",ShortDate:"Short Date",LongDate:"Long Date",Time:"Time",Percentage:"Percentage",Fraction:"Fraction",Scientific:"Scientific",Text:"Text",Custom:"Custom",MobileFormulaBarPlaceHolder:"Enter value or Formula",NumberFormat:"Number Format",PasteAlert:"You can't paste this here, because the copy area and paste area aren't in the same size. Please try pasting in a different range.",DestroyAlert:"Are you sure you want to destroy the current workbook without saving and create a new workbook?",SheetRenameInvalidAlert:"Sheet name contains invalid character.",SheetRenameEmptyAlert:"Sheet name cannot be empty.",SheetRenameAlreadyExistsAlert:"Sheet name already exists. Please enter another name.",DeleteSheetAlert:"You can't undo deleting sheets, and you might be removing some data. If you don't need it, click OK to delete.",DeleteSingleLastSheetAlert:"A Workbook must contain at least one visible worksheet.",PickACategory:"Pick a category",Description:"Description",UnsupportedFile:"Unsupported File",DataLimitExceeded:"File data is too large and it takes more time to process, do you want to continue?",FileSizeLimitExceeded:"File size is too large and it takes more time to process, do you want to continue?",InvalidUrl:"Invalid URL",SUM:"Adds a series of numbers and/or cells.",SUMIF:"Adds the cells based on specified condition.",SUMIFS:"Adds the cells based on specified conditions.",ABS:"Returns the value of a number without its sign.",RAND:"Returns a random number between 0 and 1.",RANDBETWEEN:"Returns a random integer based on specified values.",FLOOR:"Rounds a number down to the nearest multiple of a given factor.",CEILING:"Rounds a number up to the nearest multiple of a given factor.",PRODUCT:"Multiplies a series of numbers and/or cells.",INT:"Returns a number to the nearest integer.",ROUNDUP:"Rounds a number away from zero.",SUMPRODUCT:"Returns sum of the product of given ranges of arrays.",SORT:"Sorts a range of an array",T:"Checks whether a value is text or not and returns the text.",EXACT:"Checks whether a two text strings are exactly same and returns TRUE or FALSE.",LEN:"Returns a number of characters in a given string.",MOD:"Returns a remainder after a number is divided by divisor.",ODD:"Rounds a positive number up and negative number down to the nearest odd integer.",PI:"Returns the value of pi.",COUNTBLANK:"Returns the number of empty cells in a specified range of cells.",EVEN:"Rounds a positive number up and negative number down to the nearest even integer.",DECIMAL:"Converts a text representation of a number in a given base into a decimal number.",DEGREES:"Converts radians to degrees.",ADDRESS:"Returns a cell reference as text, given specified row and column numbers.",TIME:"Converts hours, minutes, seconds to the time formatted text.",CHAR:"Returns the character from the specified number.",CODE:"Returns the numeric code for the first character in a given string.",DOLLAR:"Converts the number to currency formatted text.",SMALL:"Returns the k-th smallest value in a given array.",LARGE:"Returns the k-th largest value in a given array.",FACT:"Returns the factorial of a number.",MEDIAN:"Returns the median of the given set of numbers.",EDATE:"Returns a date with given number of months before or after the specified date.",DATEVALUE:"Converts a date string into date value.",HOUR:"Returns the number of hours in a specified time string.",SECOND:"Returns the number of seconds in a specified time string.",MINUTE:"Returns the number of minutes in a specified time string.",NOW:"Returns the current date and time.",MONTH:"Returns the number of months in a specified date string.",TODAY:"Returns the current date as date value.",WEEKDAY:"Returns the day of the week corresponding to a date.",AVERAGE:"Calculates average for the series of numbers and/or cells excluding text.",AVERAGEIF:"Calculates average for the cells based on specified criterion.",AVERAGEIFS:"Calculates average for the cells based on specified conditions.",AVERAGEA:"Calculates the average for the cells evaluating TRUE as 1, text and FALSE as 0.",COUNT:"Counts the cells that contain numeric values in a range.",COUNTIF:"Counts the cells based on specified condition.",COUNTIFS:"Counts the cells based on specified conditions.",COUNTA:"Counts the cells that contains values in a range.",MIN:"Returns the smallest number of the given arguments.",MAX:"Returns the largest number of the given arguments.",DATE:"Returns the date based on given year, month, and day.",DAY:"Returns the day from the given date.",DAYS:"Returns the number of days between two dates.",IF:"Returns value based on the given expression.",IFS:"Returns value based on the given multiple expressions.",CalculateAND:"Returns TRUE if all the arguments are TRUE, otherwise returns FALSE.",CalculateOR:"Returns TRUE if any of the arguments are TRUE, otherwise returns FALSE.",IFERROR:"Returns value if no error found else it will return specified value.",CHOOSE:"Returns a value from list of values, based on index number.",INDEX:"Returns a value of the cell in a given range based on row and column number.",FIND:"Returns the position of a string within another string, which is case sensitive.",TEXT:"Converts a value to text in specified number format.",CONCATENATE:"Combines two or more strings together.",CONCAT:"Concatenates a list or a range of text strings.",SUBTOTAL:"Returns subtotal for a range using the given function number.",RADIANS:"Converts degrees into radians.",MATCH:"Returns the relative position of a specified value in given range.",LN:"Returns the natural logarithm of a number.",INTERCEPT:"Calculates the point of the Y-intercept line via linear regression.",UNIQUE:"Returns a unique values from a range or array",SLOPE:"Returns the slope of the line from linear regression of the data points.",LOOKUP:"Looks for a value in a one-row or one-column range, then returns a value from the same position in a second one-row or one-column range.",HLOOKUP:"Looks for a value in the top row of the array of values and then returns a value in the same column from a row in the array that you specify.",VLOOKUP:"Looks for a specific value in the first column of a lookup range and returns a corresponding value from a different column within the same row.",NOT:"Returns the inverse of a given logical expression.",EOMONTH:"Returns the last day of the month that is a specified number of months before or after an initially supplied start date.",SQRT:"Returns the square root of a positive number.",ROUNDDOWN:"Rounds a number down, toward zero.",RSQ:"Returns the square of the Pearson product moment correlation coefficient based on data points in known_y's and known_x's.",DefineNameExists:"This name already exists, try different name.",DefineNameInValid:"The name that you entered is not valid.",CircularReference:"When a formula refers to one or more circular references, this may result in an incorrect calculation.",OR:"OR",AND:"AND",CustomFilterDatePlaceHolder:"Choose a date",CustomFilterPlaceHolder:"Enter the value",CustomFilter:"Custom Filter",Between:"Between",DateTimeFilter:"DateTime Filters",Undo:"Undo",Redo:"Redo",DateFilter:"Date Filters",TextFilter:"Text Filters",NumberFilter:"Number Filters",ClearFilter:"Clear Filter",NoResult:"No Matches Found",FilterFalse:"False",FilterTrue:"True",Blanks:"Blanks",SelectAll:"Select All",GreaterThanOrEqual:"Greater Than Or Equal",GreaterThan:"Greater Than",LessThanOrEqual:"Less Than Or Equal",LessThan:"Less Than",NotEqual:"Not Equal",Equal:"Equal",Contains:"Contains",NotContains:"Does Not Contains",EndsWith:"Ends With",NotEndsWith:"Does Not End With",StartsWith:"Starts With",NotStartsWith:"Does Not Start With",IsEmpty:"Empty",IsNotEmpty:"Not Empty",ClearButton:"Clear",FilterButton:"Filter",CancelButton:"Cancel",OKButton:"OK",Search:"Search",ProtectSheet:"Protect Sheet",UnprotectSheet:"Unprotect Sheet",SelectCells:"Select locked cells",SelectUnlockedCells:"Select unlocked cells",FormatCells:"Format cells",FormatRows:"Format rows",FormatColumns:"Format columns",InsertLinks:"Insert links",ProtectContent:"Protect the contents of locked cells",ProtectAllowUser:" Allow all users of this worksheet to:",EditAlert:"The cell you're trying to change is protected. To make change, unprotect the sheet.",ReadonlyAlert:"You are trying to modify a cell that is in read-only mode. To make changes, please disable the read-only status.",FiniteAlert:"Finite mode is active: Cannot access the specified cell range outside the defined limits.",Alert:"Alert",SearchWithin:"Search within",SearchBy:"Search by",Reference:"Reference",DataValidation:"Data Validation",CellRange:"Cell Range",Allow:"Allow",Data:"Data",Minimum:"Minimum",Maximum:"Maximum",IgnoreBlank:"Ignore blank",WholeNumber:"Whole Number",Decimal:"Decimal",Date:"Date",TextLength:"Text Length",List:"List",NotBetween:"Not Between",EqualTo:"Equal To",NotEqualTo:"Not Equal To",GreaterThanOrEqualTo:"Greater Than Or Equal To",LessThanOrEqualTo:"Less Than Or Equal To",InCellDropDown:"In-cell-dropdown",Sources:"Sources",Value:"Value",Formula:"Formula",Retry:"Retry",DialogError:"The list source must be a reference to single row or column.",NamedRangeError:"A named range you specified cannot be found.",MinMaxError:"The Maximum must be greater than or equal to the Minimum.",InvalidNumberError:"Please enter a valid number.",InvalidFormula:"Please enter a valid formula.",MoreValidation:"This selection contains more than one validation. \n Erase current settings and continue?",FileNameError:"A file name can't contain characters like \\ / : * ? \" < > [ ] |",ListLengthError:"The list values allows only upto 256 characters",ValidationError:"This value doesn't match the data validation restrictions defined for the cell.",EmptyError:"You must enter a value",ClearHighlight:"Clear Highlight",HighlightInvalidData:"Highlight Invalid Data",ClearValidation:"Clear Validation",HighlightCellsRules:"Highlight Cells Rules",CFEqualTo:"Equal To",TextThatContains:"Text that Contains",Save:"Save",EmptyFileName:"File name cannot be empty.",LargeName:"The name is too long.",ADateOccuring:"A Date Occuring",DuplicateValues:"Duplicate Values",TopBottomRules:"Top/Bottom Rules",Directional:"Directional",Shapes:"Shapes",Indicators:"Indicators",Ratings:"Ratings",Top10Items:"Top 10 Items",Top10:"Top 10",Bottom10Items:"Bottom 10 Items",Bottom10:"Bottom 10",AboveAverage:"Above Average",BelowAverage:"Below Average",FormatCellsGreaterThan:"Format cells that are GREATER THAN:",FormatCellsLessThan:"Format cells that are LESS THAN:",FormatCellsBetween:"Format cells that are BETWEEN:",FormatCellsEqualTo:"Format cells that are EQUAL TO:",FormatCellsThatContainTheText:"Format cells that contain the text:",FormatCellsThatContainADateOccurring:"Format cells that contain a date occurring:",FormatCellsDuplicate:"Format cells that contain:",FormatCellsTop:"Format cells that rank in the TOP:",FormatCellsBottom:"Format cells that rank in the BOTTOM:",FormatCellsAbove:"Format cells that are ABOVE AVERAGE:",FormatCellsBelow:"Format cells that are BELOW AVERAGE:",With:"with",DataBars:"Data Bars",ColorScales:"Color Scales",IconSets:"Icon Sets",ClearRules:"Clear Rules",SelectedCells:"Clear Rules from Selected Cells",EntireSheet:"Clear Rules from Entire Sheet",ISNUMBER:"Returns true when the value parses as a numeric value.",ROUND:"Rounds a number to a specified number of digits.",GEOMEAN:"Returns the geometric mean of an array or range of positive data.",POWER:"Returns the result of a number raised to power",LOG:"Returns the logarithm of a number to the base that you specify.",TRUNC:"Returns the truncated value of a number to a specified number of decimal places.",EXP:"Returns e raised to the power of the given number.",Clear:"Clear",ClearContents:"Clear Contents",ClearAll:"Clear All",ClearFormats:"Clear Formats",ClearHyperlinks:"Clear Hyperlinks",LightRedFillWithDarkRedText:"Light Red Fill with Dark Red Text",YellowFillWithDarkYellowText:"Yellow Fill with Dark Yellow Text",GreenFillWithDarkGreenText:"Green Fill with Dark Green Text",RedFill:"Red Fill",RedText:"Red Text",Duplicate:"Duplicate",Unique:"Unique",And:"and",WebPage:"Web Page",ThisDocument:"This Document",DisplayText:"Display Text",Url:"URL",CellReference:"Cell Reference",DefinedNames:"Defined Names",EnterTheTextToDisplay:"Enter the text to display",EnterTheUrl:"Enter the URL",Image:"Image",ConditionalFormatting:"Conditional Formatting",BlueDataBar:"Blue Data Bar",GreenDataBar:"Green Data Bar",RedDataBar:"Red Data Bar",OrangeDataBar:"Orange Data Bar",LightBlueDataBar:"Light blue Data Bar",PurpleDataBar:"Purple Data Bar",GYRColorScale:"Green - Yellow - Red Color Scale",RYGColorScale:"Red - Yellow - Green Color Scale",GWRColorScale:"Green - White - Red Color Scale",RWGColorScale:"Red - White - Green Color Scale",BWRColorScale:"Blue - White - Red Color Scale",RWBColorScale:"Red - White - Blue Color Scale",WRColorScale:"White - Red Color Scale",RWColorScale:"Red - White Color Scale",GWColorScale:"Green - White Color Scale",WGColorScale:"White - Green Color Scale",GYColorScale:"Green - Yellow Color Scale",YGColorScale:"Yellow - Green Color Scale",ThreeArrowsColor:"3 Arrows (Colored)",ThreeArrowsGray:"3 Arrows (Gray)",ThreeTriangles:"3 Triangles",FourArrowsColor:"4 Arrows (Gray)",FourArrowsGray:"4 Arrows (Colored)",FiveArrowsColor:"5 Arrows (Gray)",FiveArrowsGray:"5 Arrows (Colored)",ThreeTrafficLights1:"3 Traffic Lights (Unrimmed)",ThreeTrafficLights2:"3 Traffic Lights (Rimmed)",ThreeSigns:"3 Signs",FourTrafficLights:"4 Traffic Lights",RedToBlack:"Red To Black",ThreeSymbols1:"3 Symbols (Circled)",ThreeSymbols2:"3 Symbols (Uncircled)",ThreeFlags:"3 Flags",ThreeStars:"3 Stars",FourRatings:"4 Ratings",FiveQuarters:"5 Quarters",FiveRatings:"5 Ratings",FiveBoxes:"5 Boxes",Chart:"Chart",Column:"Column",Bar:"Bar",Area:"Area",Pie:"Pie",Doughnut:"Doughnut",PieAndDoughnut:"Pie/Doughnut",Line:"Line",LineMarker:"Line with Markers",Radar:"Radar",Scatter:"Scatter",ChartDesign:"Chart Design",ClusteredColumn:"Clustered Column",StackedColumn:"Stacked Column",StackedColumn100:"100% Stacked Column",ClusteredBar:"Clustered Bar",StackedBar:"Stacked Bar",StackedBar100:"100% Stacked Bar",StackedArea:"Stacked Area",StackedArea100:"100% Stacked Area",StackedLine:"Stacked Line",StackedLineMarker:"Stacked Line with Markers",StackedLine100:"100% Stacked Line",StackedLine100Marker:"100% Stacked Line with Markers",AddChartElement:"Add Chart Element",Axes:"Axes",AxisTitle:"Axis Title",ChartTitle:"Chart Title",DataLabels:"Data Labels",Gridlines:"Gridlines",Legends:"Legends",PrimaryHorizontal:"Primary Horizontal",PrimaryVertical:"Primary Vertical",None:"None",AboveChart:"Above Chart",Center:"Center",InsideEnd:"Inside End",InsideBase:"Inside Base",OutsideEnd:"OutSide End",PrimaryMajorHorizontal:"Primary Major Horizontal",PrimaryMajorVertical:"Primary Major Vertical",PrimaryMinorHorizontal:"Primary Minor Horizontal",PrimaryMinorVertical:"Primary Minor Vertical",Right:"Right",Left:"Left",Bottom:"Bottom",Top:"Top",SwitchRowColumn:"Switch Row/Column",ChartTheme:"Chart Theme",ChartType:"Chart Type",Material:"Material",Fabric:"Fabric",Bootstrap:"Bootstrap",HighContrastLight:"HighContrast Light",MaterialDark:"Material Dark",FabricDark:"Fabric Dark",HighContrast:"HighContrast",BootstrapDark:"Bootstrap Dark",Bootstrap4:"Bootstrap4",Bootstrap5Dark:"Bootstrap5 Dark",Bootstrap5:"Bootstrap5",Tailwind:"Tailwind",TailwindDark:"Tailwind Dark",Tailwind3:"Tailwind 3",Tailwind3Dark:"Tailwind 3 Dark",VerticalAxisTitle:"Vertical Axis Title",HorizontalAxisTitle:"Horizontal Axis Title",EnterTitle:"Enter Title",ProtectWorkbook:"Protect Workbook",Password:"Password (optional):",EnterThePassword:"Enter the password",ConfirmPassword:"Confirm Password",EnterTheConfirmPassword:"Re-enter your password",PasswordAlert:"Confirmation password is not identical",UnprotectWorkbook:"Unprotect Workbook",UnprotectPasswordAlert:"The password you supplied is not correct.",IncorrectPassword:"Unable to open the file or worksheet with the given password",PasswordAlertMsg:"Please enter the password",ConfirmPasswordAlertMsg:"Please enter the confirm password",IsProtected:"is protected",PDF:"PDF Document",AutoFillMergeAlertMsg:"To do this, all the merged cells need to be the same size.",FillSeries:"Fill Series",CopyCells:"Copy Cells",FillFormattingOnly:"Fill Formatting Only",FillWithoutFormatting:"Fill Without Formatting",CustomFormat:"Custom Number Formats",CustomFormatPlaceholder:"Type or Select a custom format",CustomFormatTypeList:"Type",UnprotectWorksheet:"Unprotect Sheet",ReEnterPassword:"Re-enter password to proceed",SheetPassword:"Password to unprotect sheet:",Fluent:"Fluent",FluentDark:"Fluent Dark",Fluent2:"Fluent 2",Fluent2Dark:"Fluent 2 Dark",Fluent2HighContrast:"Fluent 2 HighContrast",Material3:"Material 3",Material3Dark:"Material 3 Dark",CellReferenceTypoError:"We found a typo in your cell reference. Do you want to correct this reference as follows?",InvalidFormulaError:"We found that you typed a formula which is invalid.",InvalidArguments:"We found that you typed a formula with an invalid arguments.",EmptyExpression:"We found that you typed a formula with an empty expression.",MismatchedParenthesis:"We found that you typed a formula with one or more missing opening or closing parenthesis.",ImproperFormula:"We found that you typed a formula which is improper.",WrongNumberOfArguments:"We found that you typed a formula with a wrong number of arguments.",Requires3Arguments:"We found that you typed a formula which requires 3 arguments.",MismatchedStringQuotes:"We found that you typed a formula with a mismatched quotes.",FormulaCircularRef:"We found that you typed a formula with a circular reference.",AddCurrentSelection:"Add current selection to filter",ExternalWorkbook:"An imported excel file contains an external workbook reference. Do you want to import that file?"};function cpe(e){requestAnimationFrame(function(){e()})}function upe(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function gpe(e){var t=30;return t=3<e.toString().length?10*e.toString().length:t}var mpe=null,fpe=1.24;function ype(){var e,t;return null!==mpe?mpe:(t=0,(e=document.createElement("div")).style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth|0,document.body.removeChild(e),mpe=t)}function vpe(e,t,i){return bpe(e,"previous",t=t||["e-ribbon","e-formula-bar-panel","e-sheet-tab-panel","e-header-toolbar"],i=void 0===i?1:i)+bpe(e,"next",t,i)}function bpe(e,t,i,n){for(var o=e[t+"ElementSibling"],r=0;o;)i.some(function(e){return o.classList.contains(e)})&&(r+=o.getBoundingClientRect().height*n),o=o[t+"ElementSibling"];return r}function wpe(e,t,i){if(e.scrollSettings.enableVirtualization){var n=e.getActiveSheet(),o=e.frozenRowCount(n),r=e.frozenColCount(n),s=e.viewport.topIndex+o,a=e.viewport.leftIndex+r,l=e.viewport.bottomIndex,h=e.viewport.rightIndex;if(n.frozenRows||n.frozenColumns){if(e.insideViewport(t[0],t[1])||e.insideViewport(t[2],t[3]))return!0}else if(s<=t[0]&&l>=t[2]&&a<=t[1]&&h>=t[3])return!0;n=!1;if(i){if(t[0]<s&&t[2]<s||t[0]>l&&t[2]>l)return!1;if(t[0]<s&&t[2]>s&&t[0]>=o&&(t[0]=s,n=!0),t[2]>l&&(t[2]=l,n=!0),t[1]<a&&t[3]<a||t[1]>h&&t[3]>h)return!1;t[1]<a&&t[3]>a&&t[1]>=r&&(t[1]=a,n=!0),t[3]>h&&(t[3]=h,n=!0)}return n}return!0}function Cpe(e,t,i,n,o,r,s,a){for(var l={idx:0,size:0},h={idx:0,size:0},d=h.size,p=l.size,c=h.idx;c<t[0];c++)i&&i-1<t[0]&&c<i||(d+=Wde(e,c,!a));for(c=l.idx;c<t[1];c++)n&&n-1<t[1]&&c<n||(p+=Zde(e,c,null,!a));return i&&t[0]<i&&(e.showHeaders&&(d+=30),o)&&(d-=o),n&&t[1]<n&&(e.showHeaders&&(p+=s||30),r)&&(p-=r),{top:d,left:p}}function Spe(o,r,e,s,a,l,h){void 0===s&&(s="e-selection");var d,p,c,t,i,n,u,g,m,f,y=o.getActiveSheet();if(!y.frozenRows&&!y.frozenColumns)return f=xpe(o,r,e,y,o.enableRtl,0,0,a),r&&!o.getMainContent().querySelector("."+s)&&o.getMainContent().appendChild(r),f;d=o.frozenRowCount(y),p=o.frozenColCount(y),"e-active-cell"===s?(e[0]<d||e[1]<p?(r.style.display="none",(u=(c=e[0]<d&&e[1]<p?o.getSelectAllContent():e[0]<d?o.getColumnHeaderContent():o.getRowHeaderContent()).querySelector("."+s))||(u=r.cloneNode(!0),c.appendChild(u)),xpe(o,r=u,e,y,o.enableRtl,d,p,a,!0,o.viewport.beforeFreezeHeight,o.viewport.beforeFreezeWidth,o.sheetModule.colGroupWidth)):xpe(o,r,e,y,o.enableRtl,d,p,a),r.style.display&&(r.style.display=""),Ape(o.getSelectAllContent(),c,"e-active-cell"),Ape(o.getColumnHeaderContent(),c,"e-active-cell"),Ape(o.getRowHeaderContent(),c,"e-active-cell")):"e-autofill"===s?(t=void 0,i=o.frozenRowCount(y),n=o.frozenColCount(y),e[0]<i||e[1]<n?(r.style.display="none",(u=(t=e[0]<i&&e[1]<n?o.getSelectAllContent():e[0]<i?o.getColumnHeaderContent():o.getRowHeaderContent()).querySelector("."+s))||(u=r.cloneNode(!0),t.appendChild(u)),xpe(o,r=u,e,y,o.enableRtl,i,n,a,!0,o.viewport.beforeFreezeHeight,o.viewport.beforeFreezeWidth,o.sheetModule.colGroupWidth,"e-autofill")):xpe(o,r,e,y,o.enableRtl,i,n,a,!1,0,0,0,"e-autofill"),r.style.display&&(r.style.display=""),Ape(o.getSelectAllContent(),t,"e-autofill"),Ape(o.getColumnHeaderContent(),t,"e-autofill"),Ape(o.getRowHeaderContent(),t,"e-autofill")):"e-filloption"===s?(t=void 0,i=o.frozenRowCount(y),n=o.frozenColCount(y),e[0]<i||e[1]<n?e[3]+1===n&&e[2]+1>i?xpe(o,o.getMainContent().querySelector(".e-filloption"),e,y,o.enableRtl,i,n,a,!1,0,0,0,"e-filloption",!0,{left:-4}):e[2]+1===i&&e[3]+1>n?xpe(o,o.getMainContent().querySelector(".e-filloption"),e,y,o.enableRtl,i,n,a,!1,0,0,0,"e-filloption",!0,{top:-4}):e[3]+1===n&&e[2]+1<i?((t=o.getColumnHeaderContent()).querySelector("."+s)||o.notify(soe,{id:o.element.id+"_autofilloptionbtn",appendElem:t}),r=o.autofillModule.autoFillDropDown.element,xpe(o,r,e,y,o.enableRtl,i,n,a,!1,0,0,0,"e-filloption",!0,{left:-4})):e[2]+1===i&&e[3]+1===n?xpe(o,o.getMainContent().querySelector(".e-filloption"),e,y,o.enableRtl,i,n,a,!1,0,0,0,"e-filloption",!0,{top:-4,left:-4}):((u=(t=e[0]<i&&e[1]<n?o.getSelectAllContent():e[0]<i?o.getColumnHeaderContent():o.getRowHeaderContent()).querySelector("."+s))||o.notify(soe,{id:o.element.id+"_autofilloptionbtn",appendElem:t}),r=o.autofillModule.autoFillDropDown.element,xpe(o,r,e,y,o.enableRtl,i,n,a,!0,o.viewport.beforeFreezeHeight,o.viewport.beforeFreezeWidth,o.sheetModule.colGroupWidth,"e-filloption",!0)):xpe(o,o.getMainContent().querySelector(".e-filloption"),e,y,o.enableRtl,i,n,a,!1,0,0,0,"e-filloption",!0),r.style.display&&(r.style.display=""),Ape(o.getSelectAllContent(),t,"e-filloption"),Ape(o.getColumnHeaderContent(),t,"e-filloption"),Ape(o.getRowHeaderContent(),t,"e-filloption")):(f=fte(e))[0]<d||f[1]<p?(r&&!r.classList.contains("e-multi-range")&&r.classList.add("e-hide"),g=[],f[0]<d&&f[1]<p?f[2]<d&&f[3]<p?(g.push(e),l||(Ape(o.getColumnHeaderContent(),c,s,!0),Ape(o.getRowHeaderContent(),c,s,!0))):f[2]>d-1?f[3]<p?(l||Ape(o.getColumnHeaderContent(),c,s,!0),g.push([f[0],f[1],d-1,f[3]]),g.push([d,f[1],f[2],f[3]])):(g.push([f[0],f[1],d-1,p-1]),g.push([d,f[1],f[2],p-1]),g.push([f[0],p,d-1,f[3]]),g.push([d,p,f[2],f[3]])):f[2]<d?(g.push([f[0],f[1],f[2],p-1]),g.push([f[0],p,f[2],f[3]]),l||Ape(o.getRowHeaderContent(),c,s,!0)):(g.push([d,f[1],f[2],p-1]),g.push([f[0],f[1],d-1,p-1]),g.push([d,p,f[2],f[3]]),g.push([f[0],p,d-1,f[3]])):f[0]<d?f[2]<d?(g.push(e),l||Ape(o.getRowHeaderContent(),c,s,!0)):(g.push([f[0],f[1],d-1,f[3]]),g.push([d,f[1],f[2],f[3]]),l||(Ape(o.getSelectAllContent(),c,s,!0),Ape(o.getRowHeaderContent(),c,s,!0))):f[3]<p?(g.push(e),l||Ape(o.getSelectAllContent(),c,s,!0)):(g.push([f[0],f[1],f[2],p-1]),g.push([f[0],p,f[2],f[3]]),l||(Ape(o.getSelectAllContent(),c,s,!0),Ape(o.getColumnHeaderContent(),c,s,!0))),g.forEach(function(t){var e,i,n;t[2]<d&&t[3]<p?c=o.getSelectAllContent():((d||p)&&(i=o.getSelectAllContent())&&(e=i.style.zIndex),t[2]<d?c=o.getColumnHeaderContent():t[3]<p?c=o.getRowHeaderContent():(c=o.getMainContent(),d&&!e&&(i=o.getColumnHeaderContent())&&(e=i.style.zIndex),p&&!e&&(i=o.getRowHeaderContent())&&(e=i.style.zIndex))),"e-copy-indicator"===s||"e-range-indicator"===s?(n=r.cloneNode(!0),c.appendChild(n),d&&(t[2]+1===d&&g.forEach(function(e){e!==t&&(m=n.getElementsByClassName("e-bottom")[0])&&e[0]===d&&G(m)}),t[0]===d)&&c.parentElement.classList.contains("e-main-panel")&&g.forEach(function(e){e!==t&&(m=n.getElementsByClassName("e-top")[0])&&e[2]+1===d&&G(m)}),p&&(t[3]+1===p&&g.forEach(function(e){e!==t&&(m=n.getElementsByClassName("e-right")[0])&&e[1]===p&&G(m)}),t[1]===p)&&(c.classList.contains("e-sheet-content")||c.classList.contains("e-column-header"))&&g.forEach(function(e){e!==t&&(m=n.getElementsByClassName("e-left")[0])&&e[3]+1===p&&G(m)})):((n=c.querySelector("."+s))||(n=r.cloneNode(!0),l&&!n.classList.contains("e-multi-range")&&n.classList.add("e-multi-range"),c.appendChild(n)),h&&n.classList.remove(s)),(d||p)&&(e?n.style.zIndex=e:n.style.zIndex&&(n.style.zIndex="")),xpe(o,n,t,y,o.enableRtl,d,p,a,!1,o.viewport.beforeFreezeHeight,o.viewport.beforeFreezeWidth,o.sheetModule.colGroupWidth),n.classList.contains("e-hide")&&n.classList.remove("e-hide")})):(l||(Ape(o.getSelectAllContent(),null,s,!0),Ape(o.getColumnHeaderContent(),null,s,!0),Ape(o.getRowHeaderContent(),null,s,!0)),xpe(o,r,e,y,o.enableRtl,d,p,a),"e-range-indicator"!==s&&o.getMainContent().querySelector("."+s)||o.getMainContent().appendChild(r),r.classList.contains("e-hide")&&r.classList.remove("e-hide"),h&&r.classList.remove(s))}function Ape(e,t,i,n,o){if(n||e!==t)if(o)for(var r=e.querySelectorAll("."+i),s=0;s<r.length;)r[s].classList.remove(i),s++;else{n=e.querySelector("."+i);n&&!n.classList.contains("e-multi-range")&&G(n)}}function xpe(e,t,i,n,o,r,s,a,l,h,d,p,c,u,g){var m,i=fte(i),r=Cpe(n,i,r,s,h,d,p),h=[Woe(n,0,!0),Woe(n,0,!0,"columns")],d=e.scrollSettings.isFinite?(m=i[0]>=n.rowCount?0:Ude(n,i[0],i[2]<n.rowCount?i[2]:n.rowCount-1,!0),i[1]>=n.colCount?0:$de(n,i[1],i[3]<n.colCount?i[3]:n.colCount-1,!0)):(m=Ude(n,i[0],i[2],!0),$de(n,i[1],i[3],!0)),p=0===i[1]&&i[3]===n.colCount-1,e=0===i[0]&&i[2]===n.rowCount-1,n=0,f=-5,y=-5,v=0,b=6,w=6;if(je(c)){if((C={top:(i[0]===h[0]?r.top:r.top-Hpe(1))+"px",height:m&&m+(i[0]===h[0]?0:Hpe(1))+"px",width:d&&d+(i[1]===h[1]?0:Hpe(1))+(l&&s&&i[1]<s&&i[3]>=s?1:0)+"px"})[o?"right":"left"]=(i[1]===h[1]?r.left:r.left-1)+"px",t)return Ipe([{element:t,attrs:C}],a)}else{p&&(f=-5,y=-2,b=6,w=3),e&&(y=-5,f=0,b=1,w=6),e||(n+=m),p||(v+=d),n+=Math.round(r.top)+f,v+=Math.round(r.left)+y;var C={};u?(q([t],"e-hide"),n=g&&g.top?g.top:n,v=g&&g.left?g.left:v,(C={top:n+b+"px"})[o?"right":"left"]=v+w+"px"):(C={top:n+"px"})[o?"right":"left"]=v+"px",t&&Ipe([{element:t,attrs:C}],a)}}function Ipe(i,n){return new Promise(function(t){function e(){i.forEach(function(e){gt(e.element,e.attrs),t()})}n?e():requestAnimationFrame(e)})}function Tpe(){return F.isPointer?"pointerdown":"mousedown touchstart"}function Epe(){return F.isPointer?"pointermove":"mousemove touchmove"}function Dpe(){return F.isPointer?"pointerup":"mouseup touchend"}function Mpe(e){return"touchstart"===e.type||"pointerdown"===e.type&&"touch"===e.pointerType}function kpe(e){return"touchmove"===e.type||"pointermove"===e.type&&"touch"===e.pointerType}function Ppe(e){return"touchend"===e.type||"pointerup"===e.type&&"touch"===e.pointerType}function Bpe(e){return e&&("mousedown"===e.type||"pointerdown"===e.type)}function Fpe(e){return e&&("mousemove"===e.type||"pointermove"===e.type)}function Lpe(e){return e&&("mouseup"===e.type||"pointerup"===e.type)}function Rpe(e){return e===dpe.UP||e===dpe.DOWN||e===dpe.LEFT||e===dpe.RIGHT}function Ope(e){return(e.changedTouches?e.changedTouches[0]:e).clientX}function Npe(e){return(e.changedTouches?e.changedTouches[0]:e).clientY}function Vpe(e){return(e.changedTouches?e.changedTouches[0]:e).pageX}function _pe(e){return(e.changedTouches?e.changedTouches[0]:e).pageY}function Hpe(e,t){var i;return 0<window.devicePixelRatio%1?e+((i=e*window.devicePixelRatio%1)?(.5<i||t?1-i:-1*i)/window.devicePixelRatio:0):e}var zpe={role:"role",selected:"aria-selected",multiselectable:"aria-multiselectable",busy:"aria-busy",colcount:"aria-colcount"};function jpe(t,i){Object.keys(i).forEach(function(e){t&&t.setAttribute(zpe[""+e],i[""+e])})}function Wpe(e,t){e&&(e=At(e,t))&&e.destroy()}function Qpe(e,t,i,n,o){var r,s,a,l,h=o.getActiveSheet(),d=o.frozenRowCount(h),p=o.frozenColCount(h);if(n)var c=e<p?o.getSelectAllContent():o.getColumnHeaderContent(),u=c.getElementsByTagName("th")[t],g=c.getElementsByTagName("col")[t],m=(e<p?o.getRowHeaderContent():o.getMainContent()).getElementsByTagName("col")[t];else{u=g=d||p?o.getRow(e,null,p-1):o.getRow(e,o.getRowHeaderTable()),g.style.height=0<parseInt(i,10)?Hpe(parseInt(i,10))+"px":"2px",(m=o.getRow(e,null,p)).style.height=0<parseInt(i,10)?Hpe(parseInt(i,10))+"px":"0px";for(var c=void 0,f=(h.showHeaders&&(d=o.getRowHeaderContent().getElementsByClassName("e-row"),(p=[])[0]=d[t].getElementsByTagName("td")[0].cloneNode(!0),c=qpe(o.getRowHeaderTable(),p,!1,o)+1),o.getMainContent().getElementsByClassName("e-row")),y=0,v=0,b=e,w=0;w<f[t].getElementsByTagName("td").length;w++){var C,S=f[t].getElementsByTagName("td")[w],A=(w,S.cloneNode(!0),Kre(b,w,h,!1,!0)),v=v<(y=A.value?Kpe(o,A.style):y)?y:v;S.getElementsByClassName("e-cf-databar")[0]&&(C=Number(m.style.height.split("px")[0]),o.notify(_ne,{indexes:[b,w],cell:A,ele:S,isRender:!0,resizedRowHeight:C}))}var d=v+1,p=d<=c?c:d;parseInt(m.style.height,10)<p||u&&u.classList.contains("e-reach-fntsize")&&parseInt(m.style.height,10)===p?(h.showHeaders&&(u.classList.add("e-reach-fntsize"),g.style.lineHeight=4<=parseInt(i,10)?parseInt(i,10)-4+"px":0<parseInt(i,10)?parseInt(i,10)-1+"px":"0px"),m.style.lineHeight=0<parseInt(i,10)?parseInt(i,10)-1+"px":"0px"):(g&&g.style.removeProperty("line-height"),m.style.removeProperty("line-height"),u&&u.classList.contains("e-reach-fntsize")&&u.classList.remove("e-reach-fntsize"))}if(e=m.previousElementSibling,c=m.nextElementSibling,e&&(h.showHeaders&&(r=u.previousElementSibling,s=g.previousElementSibling),e=m.previousElementSibling),c&&(h.showHeaders&&(a=u.nextElementSibling,l=g.nextElementSibling),c=m.nextElementSibling),parseInt(i,10)<=0&&!m.classList.contains("e-zero")&&!m.classList.contains("e-zero-start")){if(e&&c)if(n?(h.showHeaders&&(g.style.width="2px"),m.style.width="0px"):(h.showHeaders&&(g.style.height="2px"),m.style.height="0px"),e.classList.contains("e-zero-start")?(h.showHeaders&&u.classList.add("e-zero-start"),m.classList.add("e-zero-start")):(h.showHeaders&&u.classList.add("e-zero"),m.classList.add("e-zero")),!a||a.classList.contains("e-zero")||a.classList.contains("e-zero-last")||(h.showHeaders&&u.classList.add("e-zero-last"),m.classList.add("e-zero-last")),e.classList.contains("e-zero-last")&&(h.showHeaders&&r.classList.remove("e-zero-last"),e.classList.remove("e-zero-last")),h.showHeaders&&r.classList.contains("e-zero")?(u.classList.contains("e-zero-end"),Upe(s,-2,n)):h.showHeaders&&Upe(s,-1,n),h.showHeaders&&r.classList.contains("e-zero-start")&&Upe(g,-1,n),h.showHeaders&&a.classList.contains("e-zero"))if(u.classList.contains("e-zero-start"))for(;a;){if(a.classList.contains("e-zero")&&0!==parseInt(l.style.height,10)&&!n||0!==parseInt(l.style.width,10)&&n){n?(g.style.width=parseInt(g.style.width,10)-1+"px",l.style.width=parseInt(l.style.width,10)-1+"px"):(g.style.height=parseInt(g.style.height,10)-1+"px",l.style.height=parseInt(l.style.height,10)-1+"px"),a.classList.remove("e-zero"),a.classList.add("e-zero-start");break}var x=void 0;a.classList.remove("e-zero"),a.classList.add("e-zero-start"),l=(n?(x=parseInt(a.getAttribute("aria-colindex"),10)-1,a=o.getColHeaderTable().getElementsByTagName("th")[x+1],o.getColHeaderTable().getElementsByTagName("col")):(x=parseInt(a.getAttribute("aria-rowindex"),10)-1,a=o.getRowHeaderTable().getElementsByTagName("tr")[x+1],o.getRowHeaderTable().getElementsByTagName("tr")))[x+1]}else Upe(g,-2,n);else h.showHeaders&&(a.classList.contains("e-zero-end")?n?g.style.width="0px":g.style.height="0px":Upe(l,-1,n));else if(e)n?(h.showHeaders&&(g.style.width="1px"),m.style.width="0px"):(h.showHeaders&&(g.style.height="1px"),m.style.height="0px"),h.showHeaders&&u.classList.add("e-zero-end"),m.classList.add("e-zero-end"),h.showHeaders&&u.classList.add("e-zero-last"),m.classList.add("e-zero-last"),h.showHeaders&&r.classList.contains("e-zero")?Upe(s,-2,n):Upe(s,-1,n);else if(a)if(u.classList.add("e-zero-start"),m.classList.add("e-zero-start"),a.classList.contains("e-zero")||(u.classList.add("e-zero-last"),m.classList.add("e-zero-last")),n?(g.style.width="1px",m.style.width="0px"):(g.style.height="1px",m.style.height="0px"),h.showHeaders&&a.classList.contains("e-zero"))for(;a;){if(a.classList.contains("e-zero")&&0!==parseInt(l.style.width,10)&&n||0!==parseInt(l.style.height,10)&&!n){n?(l.style.width=parseInt(l.style.width,10)-1+"px",g.style.width=parseInt(g.style.width,10)-1+"px"):(l.style.height=parseInt(l.style.height,10)-1+"px",g.style.height=parseInt(g.style.height,10)-1+"px"),a.classList.add("e-zero-start"),a.classList.remove("e-zero");break}x=void 0;a.classList.add("e-zero-start"),a.classList.remove("e-zero"),a=(n?(x=parseInt(a.getAttribute("aria-colindex"),10)-1,l=o.getColHeaderTable().getElementsByTagName("col")[x+1],o.getColHeaderTable().getElementsByTagName("th")):(x=parseInt(a.getAttribute("aria-rowindex"),10)-1,l=o.getRowHeaderTable().getElementsByTagName("tr")[x+1],o.getRowHeaderTable().getElementsByTagName("tr")))[x+1]}else h.showHeaders&&Upe(l,-1,n)}else 0<parseInt(i,10)&&(d=Hpe(parseInt(i,10))+"px",n?(g.style.width=d,m.style.width=d):(g.style.height=d,m.style.height=d),h.showHeaders&&r&&a?(r.classList.contains("e-zero")?u.classList.contains("e-zero")?n?(s.style.width=parseInt(s.style.width,10)+2+"px",g.style.width=parseInt(g.style.width,10)-1+"px"):(s.style.height=parseInt(s.style.height,10)+2+"px",g.style.height=parseInt(g.style.height,10)-1+"px"):Upe(g,-1,n):u.classList.contains("e-zero")?Upe(s,1,n):u.classList.contains("e-zero-start")&&(n?(s.style.width=parseInt(s.style.width,10)+1+"px",g.style.width=parseInt(g.style.width,10)-1+"px"):(s.style.height=parseInt(s.style.height,10)+1+"px",g.style.height=parseInt(g.style.height,10)-1+"px")),a.classList.contains("e-zero")?Upe(g,-1,n):(u.classList.contains("e-zero")||u.classList.contains("e-zero-start"))&&Upe(l,1,n),u.classList.contains("e-zero")&&u.classList.remove("e-zero"),u.classList.contains("e-zero-start")&&u.classList.remove("e-zero-start"),m.classList.contains("e-zero")&&m.classList.remove("e-zero"),m.classList.contains("e-zero-start")&&m.classList.remove("e-zero-start"),u.classList.contains("e-zero-last")&&u.classList.remove("e-zero-last"),m.classList.contains("e-zero-last")&&m.classList.remove("e-zero-last"),(r.classList.contains("e-zero")||r.classList.contains("e-zero-start"))&&(r.classList.add("e-zero-last"),e.classList.add("e-zero-last"))):h.showHeaders&&r?(r.classList.contains("e-zero")?u.classList.contains("e-zero")?n?(g.style.width=parseInt(g.style.width,10)-1+"px",s.style.width=parseInt(s.style.width,10)+2+"px"):(g.style.height=parseInt(g.style.height,10)-1+"px",s.style.height=parseInt(s.style.height,10)+2+"px"):Upe(g,-1,n):u.classList.contains("e-zero")?Upe(s,1,n):Upe(g,-1,n),u.classList.contains("e-zero")&&u.classList.remove("e-zero"),u.classList.contains("e-zero-end")&&u.classList.remove("e-zero-end"),m.classList.contains("e-zero")&&m.classList.remove("e-zero"),m.classList.contains("e-zero-end")&&m.classList.remove("e-zero-end")):h.showHeaders&&a&&(a.classList.contains("e-zero")?Upe(g,-1,n):u.classList.contains("e-zero-start")&&(Upe(l,1,n),u.classList.remove("e-zero-start")),u.classList.contains("e-zero")&&u.classList.remove("e-zero"),m.classList.contains("e-zero")&&m.classList.remove("e-zero"),u.classList.contains("e-zero-start")&&u.classList.remove("e-zero-start"),m.classList.contains("e-zero-start"))&&m.classList.remove("e-zero-start"))}function Upe(e,t,i){i?e.style.width=parseInt(e.style.width,10)+t+"px":e.style.height=parseInt(e.style.height,10)+t+"px"}function qpe(e,t,i,n,o,r){var s,a,l=n.createElement("div",{className:n.element.className,styles:"display: block"}),h=n.createElement("table",{className:e.className+"e-resizetable",styles:"width: auto;height: auto"}),d=n.createElement("tr"),e=(i?t.forEach(function(e){var t=d.cloneNode();t.appendChild(e),h.appendChild(t)}):(t.forEach(function(e){d.appendChild(e.cloneNode(!0))}),h.appendChild(d)),l.appendChild(h),document.body.appendChild(l),h.getBoundingClientRect().width),n=h.getBoundingClientRect().height;return r?(s=i&&parseInt(o,10)>e?e:parseInt(o,10),a=!i&&parseInt(o,10)>n?n:parseInt(o,10)):(a=n,s=e),document.body.removeChild(l),i?Math.ceil(s):Math.ceil(a)}function Gpe(e,t,i,n,o,r){var s=e.eventArgs,a=e.isFromUpdateAction||ee(i);if(e.isUndoRedo)a=e.isFromUpdateAction=!0,delete e.isUndoRedo,t.notify(Tae,e);else{if(a&&!r){var r=s.address||s.range||s.pastedRange||s.addressCollection&&s.addressCollection[0]||s.dataRange,r=ee(s.sheetIndex)?ee(s.sheetIdx)?ee(s.activeSheetIndex)?r?mte(t,r):t.activeSheetIndex:s.activeSheetIndex:s.sheetIdx:s.sheetIndex;if(r!==t.activeSheetIndex)return r={sheet:_re(t,r),resolveAfterFullDataLoaded:!0,indexes:[0,0,0,0],promise:new Promise(function(e){e(void 0)})},t.notify(die,r),void r.promise.then(function(){Gpe(e,t,i,n,o,!0)})}var l,h,d,p,c=Fre(t,s.index);switch(e.action){case"sorting":l={range:e.eventArgs.range,sortOptions:e.eventArgs.sortOptions,cancel:!1},p=new Promise(function(e){e(void 0)}),t.notify(Kie,l={args:l,promise:p}),l.promise.then(function(e){t.serviceLocator.getService("cell").refreshRange(pte(e.range))});break;case"cellSave":l={element:(l=e.eventArgs).element,value:l.value,oldValue:l.oldValue,address:l.address,displayText:l.displayText,formula:l.formula,originalEvent:l.originalEvent,format:l.format},t.updateCellInfo(l.formula?{formula:l.formula}:{value:l.value},l.address,!1,e.eventArgs,i),!0===i&&t.trigger("cellSave",l);break;case"addNote":case"editNote":case"deleteNote":l=pte(e.eventArgs.address),i&&(Yoe(t,t.getActiveSheet(),{rowIdx:l[0],colIdx:l[1],preventEvt:!0,cell:{notes:e.eventArgs.notes}}),t.serviceLocator.getService("cell").refreshRange(pte(s.address),!1,!1,!0,!0,nre(t)));break;case"cellDelete":l=gte(t,e.eventArgs.address),hce(t,l.indices,l.sheetIndex);break;case"format":"CellFormat"===s.requestType?(s.style&&s.style.border&&!je(s.borderType)?(l={},Object.assign(l,s.style,null,!0),s.style.border=void 0,t.notify(Tie,{style:s.style,refreshRibbon:!0,range:s.range,onActionUpdate:!0,isUndoRedo:!0}),s.style.border=l.border,t.setBorder(s.style,s.range,s.borderType),s.style=l):t.notify(Tie,{style:s.style,refreshRibbon:!0,range:s.range,onActionUpdate:!0,isUndoRedo:!0}),cpe(function(){t.selectRange(t.getActiveSheet().selectedRange)})):t.numberFormat(s.format,s.range);break;case"clipboard":l=new Promise(function(e){e(void 0)}),d=t.getAddressInfo(s.copiedRange),t.notify(s.copiedInfo.isCut?Vse:_se,{range:d.indices,sId:_re(t,d.sheetIndex).id,promise:p,invokeCopy:!0,isPublic:!0,isFromUpdateAction:!0}),l.then(function(){return t.notify(Hse,{range:pte(s.pastedRange),sIdx:Bre(t,Lre(s.pastedRange)),type:s.type,isAction:!1,isInternal:!0,isFromUpdateAction:!0})});break;case"gridLines":t.setSheetPropertyOnMute(t.sheets[s.sheetIdx],"showGridLines",s.isShow),t.serviceLocator.getService("sheet").toggleGridlines(),t.notify(qne,null);break;case"headers":t.setSheetPropertyOnMute(t.sheets[s.sheetIdx],"showHeaders",s.isShow),t.serviceLocator.getService("sheet").showHideHeaders(),t.notify(qne,null);break;case"resize":case"resizeToFit":a&&(d=Kde(h=t.sheets[s.sheetIndex],s.index),l=_de(h,s.index),s.isCol&&d&&d.hidden||l&&l.hidden)&&t.notify(Nne,{startIndex:s.index,endIndex:s.index,hide:!1,isCol:s.isCol,sheetIndex:s.sheetIndex}),s.isCol?void 0===s.hide?t.setColWidth(a&&!ee(i)?s.oldWidth:s.width,s.index,s.sheetIndex):t.hideColumn(s.index,s.index,s.hide):(void 0===s.hide?t.setRowHeight(a&&!ee(i)?s.oldHeight:s.height,s.index,s.sheetIndex):t.hideRow(s.index,s.index,s.hide),t.notify(dae,{rowIndex:s.index}));break;case"renameSheet":t.setSheetPropertyOnMute(t.sheets[c],"name",s.value),t.notify(xae,{items:t.element.querySelector(".e-sheet-tabs-items"),value:s.value,idx:c});break;case"hideSheet":t.notify(Iae,{sheetIndex:s.sheetIndex});break;case"showSheet":t.notify(ple,s);break;case"removeSheet":t.notify(Pse,{index:s.index,isAction:!0,count:s.sheetCount,clicked:!0});break;case"gotoSheet":t.notify(dle,{selectedIndex:s.currentSheetIndex,previousIndex:s.previousSheetIndex});break;case"moveSheet":Qre(t,s.position,s.sheetIndexes,null,a);break;case"wrap":$re(e.eventArgs.address,e.eventArgs.wrap,t);break;case"hideShow":s.isCol?t.notify(Nne,{startIndex:s.startIndex,endIndex:s.endIndex,isCol:!0,hide:!1===i?!s.hide:s.hide,sheetIndex:s.sheetIndex,hiddenIndexes:s.hiddenIndexes}):t.notify(Nne,{startIndex:s.startIndex,endIndex:s.endIndex,hide:!1===i?!s.hide:s.hide,sheetIndex:s.sheetIndex});break;case"replace":t.notify(yne,{value:s.compareValue,replaceValue:s.replaceValue,sheetIndex:s.sheetIndex,address:s.address});break;case"replaceAll":t.notify(vne,s);break;case"filter":p=new Promise(function(e){e(void 0)}),!1===i?t.notify(Pae,{predicates:s.previousPredicates,range:s.range,sIdx:s.sheetIndex,promise:p,isInternal:!0}):t.notify(Pae,{predicates:s.predicates,range:s.range,sIdx:s.sheetIndex,promise:p,isInternal:!0,useFilterRange:s.useFilterRange,allowHeaderFilter:s.allowHeaderFilter}),o&&!a&&p.then(function(){t.notify(Vae,Pe({isUndo:!i,isUndoRedo:!a},o))});break;case"insert":if("Sheet"===e.eventArgs.modelType)h=t;else if(!(h=_re(t,e.eventArgs.activeSheetIndex)))break;!1===i?t.notify(pne,{model:h,start:e.eventArgs.index,isUndoRedo:!0,end:e.eventArgs.index+(e.eventArgs.model.length-1),modelType:e.eventArgs.modelType}):t.notify(dne,{model:h,start:e.eventArgs.index,end:e.eventArgs.index+(e.eventArgs.model.length-1),modelType:e.eventArgs.modelType,checkCount:void 0===i?e.eventArgs.sheetCount:null,activeSheetIndex:e.eventArgs.activeSheetIndex,isUndoRedo:!0,insertType:e.eventArgs.insertType,isFromUpdateAction:a,isRedo:i});break;case"delete":if("Sheet"===e.eventArgs.modelType)h=t;else if(!(h=_re(t,e.eventArgs.activeSheetIndex)))break;!1===i?t.notify(dne,{model:h,start:e.eventArgs.deletedModel,modelType:e.eventArgs.modelType,columnCellsModel:e.eventArgs.deletedCellsModel,definedNames:e.eventArgs.definedNames,activeSheetIndex:e.eventArgs.activeSheetIndex,isUndoRedo:!0,insertType:"Row"===e.eventArgs.modelType?"above":"before",conditionalFormats:e.eventArgs.conditionalFormats,prevAction:e.action,freezePane:s.freezePane}):t.notify(pne,{model:h,start:e.eventArgs.startIndex,checkCount:e.eventArgs.sheetCount,end:e.eventArgs.endIndex,modelType:e.eventArgs.modelType,isUndoRedo:!0,insertType:"Row"===e.eventArgs.modelType?"above":"before"});break;case"validation":!1===i?t.notify(lle,{range:s.range}):t.notify(une,{rules:{type:s.type,operator:s.operator,value1:s.value1,value2:s.value2,ignoreBlank:s.ignoreBlank,inCellDropDown:s.inCellDropDown},range:s.range,isAction:!0});break;case"removeHighlight":case"addHighlight":t.notify(Qae,{isRemoveHighlight:"removeHighlight"===e.action,isPublic:!0});break;case"merge":e.eventArgs.isAction=!1;for(var u=[],g=0,m=s.model.length;g<m;g++){u.push({cells:[]});for(var f=0,y=s.model[g].cells.length;f<y;f++)u[g].cells[f]={},Object.assign(u[g].cells[f],s.model[g].cells[f])}if(!1===i&&s.mergeCollection)for(var v=void 0,b=0;b<s.mergeCollection.length;b++)v={range:null},Object.assign(v,s),v.range=s.mergeCollection[b],t.notify(Bne,v);else t.notify(Bne,e.eventArgs);if("Manual"===t.calculationMode&&i&&t.getActiveSheet().isSheetCalculated)for(b=0;b<s.model.length;b++)for(var w=s.model[b].cells,C=0;C<w.length;C++){var S=s.model[b].cells[C].value;u[b].cells[C].value=je(S)||""===S?u[b].cells[C].value:S}s.model=u;break;case"clear":d={options:e.eventArgs,isFromUpdateAction:a},t.notify(ule,d),!a&&d.cfClearActionArgs&&(s.cfClearActionArgs.previousConditionalFormats=d.cfClearActionArgs.previousConditionalFormats,s.cfClearActionArgs.conditionalFormats=d.cfClearActionArgs.conditionalFormats);break;case"conditionalFormat":!1===i?t.notify(Hne,{range:s.range,cfModel:{type:s.type,cFColor:s.cFColor,value:s.value},sheetIdx:s.sheetIdx,isUndoRedo:!s.cancel,isFromUpdateAction:a}):t.notify(Vne,{cfModel:{type:s.type,cFColor:s.cFColor,value:s.value,range:s.range},sheetIdx:s.sheetIdx,isUndoRedo:!0,isFromUpdateAction:a});break;case"clearCF":!1===i?t.notify(Hne,{oldCFModel:s.previousConditionalFormats,updatedCFModel:s.conditionalFormats,range:s.selectedRange,isUndo:!0,sheetIdx:s.sheetIdx}):(l={range:s.selectedRange,sheetIdx:s.sheetIdx,isUndoRedo:!0,isFromUpdateAction:a},t.notify(Hne,l),a||(s.previousConditionalFormats=l.oldCFModel,l.updatedCFModel.length?s.conditionalFormats=l.updatedCFModel:delete s.conditionalFormats));break;case"insertImage":!1===i?t.notify(Ele,{id:e.eventArgs.id,sheetIdx:e.eventArgs.sheetIndex+1,range:e.eventArgs.range,preventEventTrigger:!0}):t.notify(Tle,{options:{src:e.eventArgs.imageData,height:e.eventArgs.imageHeight,width:e.eventArgs.imageWidth,id:e.eventArgs.id},range:e.eventArgs.range,isPublic:!1,isUndoRedo:!0});break;case"deleteImage":!1===i?t.notify(Tle,{options:{src:e.eventArgs.imageData,height:e.eventArgs.imageHeight,width:e.eventArgs.imageWidth,id:e.eventArgs.id},range:e.eventArgs.address,isPublic:!1,isUndoRedo:!0}):t.notify(Ele,{id:e.eventArgs.id,range:e.eventArgs.address,preventEventTrigger:!0});break;case"imageRefresh":p=document.getElementById(e.eventArgs.id),!1===i?t.notify(Ale,{prevTop:e.eventArgs.currentTop,prevLeft:e.eventArgs.currentLeft,currentTop:e.eventArgs.prevTop,currentLeft:e.eventArgs.prevLeft,id:e.eventArgs.id,currentHeight:e.eventArgs.prevHeight,currentWidth:e.eventArgs.prevWidth,requestType:"imageRefresh",prevHeight:e.eventArgs.currentHeight,prevWidth:e.eventArgs.currentWidth,isUndoRedo:!0}):(e.eventArgs.isUndoRedo=!0,t.notify(Ale,e.eventArgs)),p&&(p.style.height=!1===i?e.eventArgs.prevHeight+"px":e.eventArgs.currentHeight+"px",p.style.width=!1===i?e.eventArgs.prevWidth+"px":e.eventArgs.currentWidth+"px",p.style.top=!1===i?e.eventArgs.prevTop+"px":e.eventArgs.currentTop+"px",p.style.left=!1===i?e.eventArgs.prevLeft+"px":e.eventArgs.currentLeft+"px");break;case"insertChart":!1===i?t.notify(Dle,{id:s.id,range:s.posRange||s.range,isUndoRedo:!0}):(h=[{type:s.type,theme:s.theme,markerSettings:s.markerSettings,isSeriesInRows:s.isSeriesInRows,range:s.range,id:s.id,height:s.height,width:s.width,top:s.top,left:s.left}],t.notify(Qne,{chart:h,isUndoRedo:!1,range:s.posRange||s.range,isInitCell:!0,isRedo:!0}));break;case"deleteChart":!1===i?(d=[{type:s.type,theme:s.theme,markerSettings:s.markerSettings,dataLabelSettings:s.dataLabelSettings,title:s.title,legendSettings:s.legendSettings,primaryXAxis:s.primaryXAxis,primaryYAxis:s.primaryYAxis,isSeriesInRows:s.isSeriesInRows,range:s.range,id:s.id,height:s.height,width:s.width,top:s.top,left:s.left}],t.notify(Qne,{chart:d,isUndoRedo:!1,range:s.posRange,isInitCell:!0,isUndo:!0})):t.notify(Dle,{id:s.id,range:s.range,isUndoRedo:!0});break;case"chartRefresh":(l=document.getElementById(e.eventArgs.id))&&(l.style.height=!1===i?e.eventArgs.prevHeight+"px":e.eventArgs.currentHeight+"px",l.style.width=!1===i?e.eventArgs.prevWidth+"px":e.eventArgs.currentWidth+"px",l.style.top=!1===i?e.eventArgs.prevTop+"px":e.eventArgs.currentTop+"px",l.style.left=!1===i?e.eventArgs.prevLeft+"px":e.eventArgs.currentLeft+"px"),!1===i?(t.notify(Mle,Pe({},e.eventArgs,{currentColIdx:e.eventArgs.prevColIdx,currentHeight:e.eventArgs.prevHeight,currentLeft:e.eventArgs.prevLeft,currentRowIdx:e.eventArgs.prevRowIdx,currentTop:e.eventArgs.prevTop,currentWidth:e.eventArgs.prevWidth,prevColIdx:e.eventArgs.currentColIdx,prevHeight:e.eventArgs.currentHeight,prevLeft:e.eventArgs.currentLeft,prevRowIdx:e.eventArgs.currentRowIdx,prevTop:e.eventArgs.currentTop,prevWidth:e.eventArgs.currentWidth,isUndoRedo:!0})),t.notify(Yne,{height:e.eventArgs.prevHeight.toString(),width:e.eventArgs.prevWidth.toString(),overlayEle:l})):(e.eventArgs.isUndoRedo=!0,t.notify(Mle,e.eventArgs),t.notify(Yne,{height:e.eventArgs.currentHeight.toString(),width:e.eventArgs.currentWidth.toString(),overlayEle:l}));break;case"chartDesign":t.notify(_le,e.eventArgs);break;case"autofill":a&&s.undoArgs&&(s.undoArgs.isFromUpdateAction=s.undoArgs.isUndo=s.undoArgs.preventEvt=!0,s.undoArgs.isPublic=!0,t.notify(Tae,s.undoArgs)),t.notify(noe,{fillRange:e.eventArgs.fillRange,dataRange:e.eventArgs.dataRange,fillType:e.eventArgs.fillType,direction:e.eventArgs.direction,cells:e.eventArgs.beforeActionData});break;case"removeValidation":!1!==i&&t.notify(lle,{range:s.range,isCol:s.isColSelected});break;case"addDefinedName":!1===i?t.notify(Pie,{action:"removeDefinedName",isRemoved:!1,definedName:s.name,scope:s.scope,isEventTrigger:!0}):(p={name:s.name,refersTo:s.refersTo,scope:s.scope,comment:s.comment},t.notify(Pie,{action:"addDefinedName",isAdded:!1,definedName:p,isEventTrigger:!0}));break;case"hyperlink":t.notify(nne,{hyperlink:s.hyperlink,cell:s.address,displayText:s.displayText,isUndoRedo:!0}),t.serviceLocator.getService("cell").refreshRange(pte(s.address),!1,!1,!1,!0,nre(t));break;case"removeHyperlink":t.notify(Sae,{range:s.address,preventEventTrigger:!0});break;case"freezePanes":t.freezePanes(s.row,s.column,s.sheetIndex);break;case"duplicateSheet":Ure(t,s.sheetIndex,null,a);break;case"protectSheet":s.isProtected?t.notify(Tne,s):(t.setSheetPropertyOnMute(_re(t,s.sheetIndex),"password",""),t.notify(qae,{isActive:!0,sheetIndex:s.sheetIndex}));break;case"protectWorkbook":s.isProtected?t.notify(Qle,s):t.notify(Ule,null);break;case"lockCells":t.notify(Pne,s)}}}function Ype(e,t,i,n){for(var o,r=e.sheets[n].ranges,s=0,a=r.length;s<a;s++)if(r[s].template&&(o=rte(r[s].address.length?r[s].address:r[s].startCell))[0]<=t&&o[1]<=i&&o[2]>=t&&o[3]>=i)return!0;return!1}function Xpe(e,t,i,n,o,r,s,a){void 0===s&&(s=!0);var l=Wde(t,n,!0),h=Hpe(i);!a&&(a=e.frozenColCount(t),(o=o||(t.frozenRows?e.getRow(n,null,a):e.getRow(n)))&&(o.style.height=h+"px"),r=t.frozenColumns?r||e.getRow(n,null,a-1):(o=e.frozenRowCount(t),r||e.getRow(n,n<o?e.sheetModule.getSelectAllTable():e.getRowHeaderTable())))&&(r.style.height=h+"px"),Qde(t,n,i),e.setProperties({sheets:e.sheets},!0),s&&e.notify(iae,{rowIdx:n,threshold:h-l})}function Kpe(e,t,i,n){void 0===i&&(i=1);var o=t&&t.fontSize||e.cellStyle.fontSize,o=(-1<o.indexOf("pt")?parseInt(o,10)/.75:parseInt(o,10))*(n||Jpe(t&&t.fontFamily?t:e.cellStyle))*i;return Math.ceil(.9<o%1?1+o:o)}function Jpe(e){var t=fpe;return e&&("Arial Black"===e.fontFamily||"Comic Sans MS"===e.fontFamily?t=1.44:'"Segoe UI", sans-serif'===e.fontFamily&&(t=1.36)),t}function Zpe(e,t,i,n){t=t||i;var o=document.createElement("canvas").getContext("2d");return o.font=(t.fontStyle||i.fontStyle)+" "+(t.fontWeight||i.fontWeight)+" "+(t.fontSize||i.fontSize)+" "+(t.fontFamily||i.fontFamily),n?o.measureText(e).width:Hpe(o.measureText(e).width,!0)}function $pe(e,o,r,s){function a(e,t){u&&m++,1<=h/o&&(e.split("").forEach(function(e){p=Zpe(e,r,s,!0),o<(d+=p)&&(m++,d=p)}),h=Hpe(d,!0)),t||l(h),u=h}function l(e){h+=1<=(e+n)/o?0:n}var h,t,d,p,c,i,u=0,g=e.toString().split(" "),n=Zpe(" ",r,s),m=0,e=0;return g.forEach(function(i){var n;p=d=0,h=Zpe(i,r,s),1<(u+h)/o?1<(t=i.split("-")).length?(n=t.length-1,t.forEach(function(e,t){p=d=0,c=c||Zpe("-",r,s),h=Zpe(e,r,s),t<n&&(h+=c),1<=(u+h)/o?a(e,t!==n):(t===n&&g[g.length-1]!==i&&l(u+h),u+=h)})):a(i,!1):(l(u+h),u+=h)}),u&&(e=(u-n)/o,i=parseFloat(e.toString().split(".")[0]),m+=i+1<=e+.05?Math.ceil(e)+1:Math.ceil(e)),m}function ece(e,t,i){var n=0,o=Kre(e,t,i,null,!0),e=Kre(e,t+1,i,null,!0);return o.style&&(o.style.border?n=(0===t?2:1)*parseFloat(o.style.border.split("px")[0]):(0===t&&o.style.borderLeft&&(n=parseFloat(o.style.borderLeft.split("px")[0])),o.style.borderRight&&(n+=parseFloat(o.style.borderRight.split("px")[0])))),o.style&&(o.style.border||o.style.borderRight)||!e.style||!e.style.borderLeft||(n+=parseFloat(e.style.borderLeft.split("px")[0])),0<n&&n<1?1:n}function tce(e,t,i){var n=0,o=Kre(e,t,i,null,!0),e=(o.style&&(o.style.border?n=(0===e?2:1)*parseFloat(o.style.border.split("px")[0]):(0===e&&o.style.borderTop&&(n=parseFloat(o.style.borderTop.split("px")[0])),o.style.borderBottom&&(n+=parseFloat(o.style.borderBottom.split("px")[0])))),Kre(e+1,t,i,null,!0));return o.style&&(o.style.border||o.style.borderBottom)||!e.style||!e.style.borderTop||(n+=parseFloat(e.style.borderTop.split("px")[0])),Math.ceil(n)||1}function ice(e,t,i,n){return $de(e,i,n=void 0===n?i:n,!0)-Hpe(4+(ece(t,i,e)||1))}function nce(e,t,i,n,o,r,s){return Kpe(e,o,r,s)+tce(t,i,n)}function oce(e,t,i,n){e.maxHgts[t]||(e.maxHgts[t]={}),e.maxHgts[t][i]=n}function rce(e,t){var i=0,n=e.maxHgts[t];return n&&Object.keys(n).forEach(function(e){n[""+e]>i&&(i=n[""+e])}),i}function sce(e){var t,i;document.activeElement.classList.contains("e-text-findNext-short")||(F.isIE?(i=window.scrollX,t=window.scrollY,e.focus(),window.scrollTo(i,t)):(e.classList.contains("e-input")&&(i=e.value.length,e.setSelectionRange(i,i)),e.focus({preventScroll:!0})))}function ace(e,t){for(var i,n=e.getActiveSheet(),o=je(t)?fte(rte(n.selectedRange)):t,r=o[0];r<=o[2];r++)for(var s=o[1];s<=o[3];s++)if(Hoe(Kre(r,s,n),Kde(n,s))){i=!0;break}return i}function lce(e){return e.includes(" ")}function hce(e,t,i){for(var n,o,r,s=_re(e,i),a=i===e.activeSheetIndex,l=s.conditionalFormats&&s.conditionalFormats.length&&[].slice.call(s.conditionalFormats),h=[],d=!1,p=t[0],c=t[2];p<=c;p++)if(!jde(s,p))for(var u=t[1],g=t[3];u<=g;u++){var m,f={cellIdx:[p,u],isUnique:!1,uniqueRange:""},y=(e.notify(Uie,f),m=!1,""!==f.uniqueRange&&(m="#SPILL!"===Kre((y=pte(f.uniqueRange))[0],y[1],s).value),p===c&&u===g);f.isUnique&&!m||((f=Kre(p,u,s))&&0===f.value||f&&f.value&&(je(f.value)||""!==f.value)?(d=!1,n={},f.formula&&(n.formula=""),!f.value&&0!==f.value||(n.value=""),f.hyperlink&&(n.hyperlink=""),m={sheet:s,cell:f,rowIdx:p,colIdx:u},(1<f.colSpan||1<f.rowSpan)&&ire(m),o={cell:n,rowIdx:p,colIdx:u,valChange:!0,uiRefresh:a,td:f=e.getCell(m.rowIdx,m.colIdx),cellDelete:!0,isDelete:!y,deletedRange:t},Object.keys(n).length&&!Yoe(e,s,o)&&(l&&!(r=r||o.isFormulaDependent)&&Zoe(l,h,p,u),f)&&(f.querySelector(".e-cf-databar")&&f.removeChild(f.querySelector(".e-cf-databar")),f.querySelector(".e-iconsetspan"))&&f.removeChild(f.querySelector(".e-iconsetspan"))):!d&&o&&(o.isDelete=!(d=y),Object.keys(n).length)&&Yoe(e,s,o))}(h.length||r)&&a&&e.notify(_ne,{cfModel:!r&&h,refreshAll:r,isAction:!0,isEdit:!0})}function dce(e,t){for(var i=0,n=e.getActiveSheet(),o=(n.frozenRows?e.viewport.height-e.sheetModule.getColHeaderHeight(n,!0):e.viewport.height)-17||20,r=t;;r++)if(o<=(i+=Wde(n,r,!0)))return{index:r,height:i}}function pce(e,t){for(var i=0,n=e.getActiveSheet(),o=e.getMainContent().parentElement.offsetWidth-e.sheetModule.getRowHeaderWidth(n)-e.sheetModule.getScrollSize(),r=t;;r++)if(o<=(i+=Zde(n,r,null,!0)))return r}function cce(e){var t;return 0<window.devicePixelRatio%1?e+((t=e*window.devicePixelRatio%1)?(.5<t?1-t:-1*t)/window.devicePixelRatio:0):e}function uce(e){for(var t,i,n,o=[],r=e.getActiveSheet().name,s=0,a=e.chartColl.length;s<a;s++)r===Lre((n=e.chartColl[s]).range)&&(t={clientY:n.top,isImage:!0},i={clientX:n.left,isImage:!0},e.notify(xle,t),e.notify(Ile,i),o.push({chart:n,chartRowIdx:t.clientY,chartColIdx:i.clientX}));return o}function gce(e){return/^[A-Za-z]+:[A-Za-z]+$/.test(e)}function mce(e){return/^[0-9]+:[0-9]+$/.test(e)}function fce(e){e.forEach(function(e){e&&e.parentNode&&e.parentNode.removeChild(e)})}yce=function(e,t){return(yce=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])}))(e,t)};var yce,vce,Ode=function(e,t){function i(){this.constructor=e}yce(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},bce=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},wce=(Ode(Cce,vce=n),bce([e(!1)],Cce.prototype,"isFinite",void 0),bce([e(!0)],Cce.prototype,"enableVirtualization",void 0),Cce);function Cce(){return null!==vce&&vce.apply(this,arguments)||this}Ode(Ace,Sce=n),bce([e("Multiple")],Ace.prototype,"mode",void 0);var Sce,Ode=Ace;function Ace(){return null!==Sce&&Sce.apply(this,arguments)||this}Ice.prototype.refreshSelectALLContent=function(){var e,t,i=this.parent.getActiveSheet();i.frozenColumns||i.frozenRows?(i=this.getSelectAllTable().querySelector("thead"),t=this.rowRenderer.render(),i.appendChild(t),e=this.parent.createElement("th",{className:"e-select-all-cell"}),t.appendChild(e)):(e=this.headerPanel.firstElementChild).classList.add("e-select-all-cell"),e.appendChild(this.parent.createElement("button",{className:"e-selectall",id:this.parent.element.id+"_select_all",attrs:{"aria-label":this.parent.serviceLocator.getService(ope).getConstant("SelectAll"),type:"button"}}))},Ice.prototype.updateLeftColGroup=function(e,t){e&&(this.colGroupWidth=e);var i,n,o=(t=t||this.getRowHeaderPanel()).querySelector("table"),r=this.parent.getActiveSheet(),s=document.createDocumentFragment();e?o.querySelector("colgroup").firstElementChild.style.width=this.colGroupWidth+"px":(i=this.parent.createElement("colgroup"),(n=this.col.cloneNode()).style.width=this.colGroupWidth+"px",s.appendChild(n),i.appendChild(s),o.insertBefore(i,o.querySelector("tbody"))),(r.frozenRows||r.frozenColumns)&&(o=this.getSelectAllTable(),e?o.querySelector("colgroup").firstElementChild.style.width=this.colGroupWidth+"px":o.insertBefore(i.cloneNode(!0),o.querySelector("thead"))),this.setPanelWidth(r,t),this.setPanelHeight(r)},Ice.prototype.setPanelWidth=function(e,t,i){var n,o=this.getScrollSize(!0),r=this.getRowHeaderWidth(e),s=this.parent.enableRtl,a=s?"right":"left",l=this.getColHeaderPanel(),h=this.getContentPanel(),e=(i&&(h.style[""+(n=s?"left":"right")]=l.style[""+n]=""),e.frozenColumns&&((s=document.getElementById(this.parent.element.id+"_sheet").getElementsByClassName("e-frozen-column")[0]).style.height="calc(100% - "+o+"px)",i&&(s.style[""+n]=""),s.style[a]=r-Hpe(1)+"Px",s.style.display=""),"calc(100% - "+r+"px)"),s=(this.setHeaderPanelWidth(this.getSelectAllContent(),r),l.style.width=e,l.style[a]=r+"px",this.setHeaderPanelWidth(t,r),h.style.width=e,h.style[a]=r+"px",this.contentPanel.nextElementSibling||null);s&&(o?s.style.height=o+1+"px":(s.style.height="1px",s.style.borderTopWidth="0px"),s=s.firstElementChild,i&&(s.style[""+n]=""),s.style[a]=r+"px",s.style.width=e,-1<F.userAgent.indexOf("Mac OS"))&&"safari"===F.info.name&&(s.style.height="7px",s.style.top="-7px")},Ice.prototype.getScrollSize=function(e){var t=parseInt(this.headerPanel.style[this.parent.enableRtl?"margin-left":"margin-right"],10);return t?t+(e?1:0):0},Ice.prototype.setHeaderPanelWidth=function(e,t){[].slice.call(e.querySelectorAll("col.e-empty")).forEach(function(e){t+=parseInt(e.style.width,10)}),e.style.width=t+"px"},Ice.prototype.setPanelHeight=function(e){var t,i=this.getScrollSize(!0),n=this.contentPanel,o=this.headerPanel;e.frozenRows?(t=this.getColHeaderHeight(e),e.showHeaders||e.frozenColumns?o.style.height="":o.style.height=t+"px",n.style.height="calc(100% - "+(t+i)+"px)",(o=document.getElementById(this.parent.element.id+"_sheet").getElementsByClassName("e-frozen-row")[0]).style.width=F.isDevice?"100%":"calc(100% - "+i+"px)",o.style.top=t-1-(e.showHeaders?1:0)+"px",o.style.display=""):n.style.height="calc(100% - "+((e.showHeaders?Hpe(31):0)+i)+"px)"},Ice.prototype.renderPanel=function(){this.contentPanel=this.parent.createElement("div",{className:"e-main-panel",attrs:{tabindex:"0"}});var e=this.parent.getActiveSheet(),t=this.parent.element.id,i=document.createDocumentFragment(),n=this.parent.createElement("div",{className:"e-row-header",id:t+"_row_header"}),n=(i.appendChild(n),this.initHeaderPanel(),this.parent.allowScrolling&&this.parent.scrollModule.setPadding(),document.getElementById(this.parent.element.id+"_sheet")),t=(e.frozenColumns&&n.classList.add("e-frozen-columns"),e.frozenRows&&n.classList.add("e-frozen-rows"),this.updateHideHeaders(e,n),e.showGridLines||n.classList.add("e-hide-gridlines"),this.parent.createElement("div",{className:"e-sheet-content",id:t+"_main_content"}));i.appendChild(t),this.parent.allowScrolling||(t.style.overflow="hidden"),e.frozenRows&&n.appendChild(this.parent.createElement("div",{className:"e-frozen-row",styles:"display: none"})),e.frozenColumns&&n.appendChild(this.parent.createElement("div",{className:"e-frozen-column",styles:"display: none"})),-1<F.userAgent.indexOf("Mac OS")&&"safari"===F.info.name&&n.classList.add("e-mac-safari"),this.contentPanel.appendChild(i)},Ice.prototype.initHeaderPanel=function(){var e=this.parent.element.id,t=document.createDocumentFragment(),i=(this.headerPanel=this.parent.createElement("div",{className:"e-header-panel"}),this.parent.createElement("div",{className:"e-selectall-container",id:e+"_selectall"})),i=(t.appendChild(i),this.parent.createElement("div",{className:"e-column-header",id:e+"_col_header"}));t.appendChild(i),this.headerPanel.appendChild(t)},Ice.prototype.createHeaderTable=function(){var e=this.contentPanel.querySelector(".e-row-header"),t=this.parent.getActiveSheet();(t.frozenRows||t.frozenColumns)&&this.updateTable(t.frozenRows?["thead","tbody"]:["thead"],"selectall",this.headerPanel.querySelector(".e-selectall-container")),this.updateTable(t.frozenRows?["thead","tbody"]:["thead"],"colhdr",this.headerPanel.querySelector(".e-column-header")),this.updateTable(["tbody"],"rowhdr",e),this.updateLeftColGroup(null,e)},Ice.prototype.updateTable=function(e,t,i){var n=this,o=document.createDocumentFragment(),t=this.parent.createElement("table",{className:"e-table e-"+t+"-table",attrs:{role:"grid"}});e.forEach(function(e){o.appendChild(n.parent.createElement(e))}),t.appendChild(o),i.appendChild(t)},Ice.prototype.renderTable=function(r){var n,o,s,a,l,h=this,d=this.parent.getActiveSheet(),p=[],c=document.createDocumentFragment(),u=(c.appendChild(this.headerPanel),c.appendChild(this.contentPanel),this.parent.allowScrolling&&((e=this.parent.createElement("div",{className:"e-scrollbar"})).appendChild(this.parent.createElement("div",{className:"e-scroller"})),c.appendChild(e)),this.createHeaderTable(),this.updateTable(["tbody"],"content",this.contentPanel.lastElementChild),this.parent.createElement("colgroup")),g=this.contentPanel.querySelector(".e-sheet-content tbody"),m=(this.refreshSelectALLContent(),this.getSelectAllContent().querySelector("colgroup")),f=this.getRowHeaderPanel().querySelector("colgroup"),y=this.getSelectAllContent().querySelector("thead .e-header-row"),v=this.contentPanel.querySelector(".e-row-header tbody"),b=this.getSelectAllContent().querySelector("tbody"),e=this.headerPanel.querySelector(".e-column-header thead"),w=this.headerPanel.querySelector(".e-column-header tbody"),C=this.rowRenderer.render(),S=(e.appendChild(C),this.getColHeaderTable().insertBefore(u,e),this.parent.frozenRowCount(d)),A=this.parent.frozenColCount(d),x=Woe(d,A-1,!1,"columns"),e=(this.parent.notify(xse,{top:r.top,left:r.left}),d.colCount.toString()),t=d.colCount.toString(),I=r.top&&r.left?"RowColumn":r.top?"Row":r.left?"Column":"";this.parent.getColHeaderTable().setAttribute("aria-colcount",e),this.parent.getRowHeaderTable().setAttribute("aria-rowcount",t),pt(this.parent.getContentTable(),{"aria-rowcount":t,"aria-colcount":e}),r.cells.forEach(function(e,t){(n=rte(t))[1]!==r.indexes[1]&&o||(n[1]===r.indexes[1]&&(s=h.rowRenderer.render(n[0],!0)),A&&S&&n[1]<A&&n[0]<S?((l=b.querySelector(".e-empty"))?b.insertBefore(s,l):b.appendChild(s),o=s):A&&n[1]<A?(v.appendChild(s),o=s):(o=h.rowRenderer.render(n[0]),S&&n[0]<S?(l=w.querySelector(".e-empty"))?w.insertBefore(o,l):w.appendChild(o):g.appendChild(o),n[1]===r.indexes[1]&&(S&&n[0]<S?b:v).appendChild(s)),n[1]===r.indexes[1]&&h.cellRenderer.renderRowHeader(n[0],s)),a={colIdx:n[1],rowIdx:n[0],cell:e,mergeBorderRows:p,address:t,lastCell:n[1]===r.indexes[3],isHeightCheckNeeded:!0,row:o,hRow:s,pRow:o.previousSibling,pHRow:s.previousSibling,isRefreshing:r.isRefreshing,first:I?I.includes("Row")?n[0]===r.indexes[0]?"Row":I.includes("Column")&&n[1]===r.indexes[1]?"Column":"":n[1]===r.indexes[1]?"Column":"":""},a=h.cellRenderer.render(a);var t=h.parent.scrollSettings.enableVirtualization&&h.parent.viewport.topIndex!==Woe(d,0,!0),i=h.parent.scrollSettings.enableVirtualization&&h.parent.viewport.leftIndex!==Woe(d,0,!0,"columns");t&&h.checkRowMerge(n,r.indexes,a,e,d),i&&h.checkColMerge(n,r.indexes,a,e,d),A&&n[1]===x&&(o=null),n[0]===r.indexes[0]&&(A&&n[1]<A?(a=h.updateCol(d,n[1],m),(t=f.querySelector(".e-empty"))?f.insertBefore(a.cloneNode(!0),t):f.appendChild(a.cloneNode(!0)),h.cellRenderer.renderColHeader(n[1],y)):(h.updateCol(d,n[1],u),h.cellRenderer.renderColHeader(n[1],C)))}),this.parent.isReact&&this.parent.renderReactTemplates(),hre(this.parent,p),g.parentElement.insertBefore(u.cloneNode(!0),g),cpe(function(){if(h.parent){var e=h.parent.getMainContent(),t=document.getElementById(h.parent.element.id+"_sheet");if(t.childElementCount&&t.querySelector(".e-header-panel")!==h.headerPanel)for(var i=t.children,n=0;n<i.length;n++)i[n].classList.contains("e-frozen-row")||i[n].classList.contains("e-frozen-column")||i[n].classList.contains("e-ss-overlay")||t.removeChild(i[n]);if(t.appendChild(c),t.style.backgroundColor="",d.conditionalFormats&&d.conditionalFormats.length&&h.parent.notify(_ne,{indexes:r.indexes}),h.checkRowHeightChanged(r,d),r.top&&(e.parentElement.scrollTop=r.top),r.left&&(e.scrollLeft=r.left,h.parent.getColumnHeaderContent().scrollLeft=r.left),h.parent.notify(cse,r),h.checkTableWidth(d),h.parent.notify(mse,{action:"renderEditor",initLoad:r.initLoad&&!h.parent.isOpen}),r.initLoad||h.parent.isOpen||h.parent.hideSpinner(),jpe(e,{busy:!1}),h.parent.trigger(jse,{}),h.parent.isEdit&&h.parent.notify(ble,null),r.openOptions&&r.openOptions.eventArgs&&r.openOptions.eventArgs.triggerEvent&&h.parent.trigger("openComplete",{response:r.openOptions}),r.initLoad){var o=!0;if(h.parent.scrollSettings.enableVirtualization)for(n=0;n<d.ranges.length;n++)if(d.ranges[n].info.count-1>h.parent.viewport.bottomIndex){o=!1;break}o?h.parent.isReact?setTimeout(function(){h.parent&&h.triggerCreatedEvent()}):h.triggerCreatedEvent():h.parent.isOpen||h.parent.hideSpinner()}}})},Ice.prototype.triggerCreatedEvent=function(){this.parent.isOpen||this.parent.hideSpinner(),this.parent.createdHandler&&(this.parent.createdHandler.observers?(this.parent.created.observers=this.parent.createdHandler.observers,this.parent.isAngular&&this.parent.createdHandler.currentObservers&&(this.parent.created.currentObservers=this.parent.createdHandler.currentObservers)):this.parent.setProperties({created:this.parent.createdHandler},!0),this.parent.createdHandler=void 0,this.parent.trigger(Jae,null),this.parent)&&this.parent.notify(kae,null),this.parent&&this.parent.notify(Zae,null)},Ice.prototype.checkRowHeightChanged=function(e,t){var i={top:e.top,left:e.left,sheet:t};this.parent.notify(ohe,i),e.top!==i.top&&(this.parent.scrollModule&&this.parent.scrollModule.offset.top.idx&&i.top-e.top<Wde(t,this.parent.scrollModule.offset.top.idx)&&(this.parent.scrollModule.offset.top.size=i.top),e.top=i.top),e.left!==i.left&&(this.parent.scrollModule&&this.parent.scrollModule.offset.left.idx&&i.left-e.left<Zde(t,this.parent.scrollModule.offset.left.idx)&&(this.parent.scrollModule.offset.left.size=i.left),e.left=i.left)},Ice.prototype.checkTableWidth=function(e){var t,i;this.parent.scrollSettings.isFinite&&!this.parent.scrollSettings.enableVirtualization&&e.colCount-1===this.parent.viewport.rightIndex&&(t=$de(e,this.parent.viewport.leftIndex+this.parent.frozenColCount(e),this.parent.viewport.rightIndex),e=this.getRowHeaderWidth(e),i=this.getScrollSize(),t<this.contentPanel.getBoundingClientRect().width-e-i?(this.getContentPanel().style.width=t+"px",this.getColHeaderPanel().style.width=t+"px"):this.getContentPanel().style.width.includes("calc")||(this.getContentPanel().style.width="calc(100% - "+e+"px)",this.getColHeaderPanel().style.width="calc(100% - "+e+"px)"))},Ice.prototype.clearCFResult=function(e){e.conditionalFormats&&e.conditionalFormats.length&&e.conditionalFormats.forEach(function(e){delete e.result})},Ice.prototype.refreshColumnContent=function(o){function e(){var e=a.getColHeaderTable();upe(e),e.appendChild(i),upe(e=a.getContentTable()),e.appendChild(t),a.parent.notify(Tse,{refresh:"Column",prevRowColCnt:o.prevRowColCnt}),hre(a.parent,d),h.conditionalFormats&&h.conditionalFormats.length&&a.parent.notify(_ne,{indexes:o.indexes,isRender:!0}),a.parent.isEdit&&a.parent.notify(wle,{}),a.parent.allowChart&&a.parent.notify(Ole,null),a.parent.isOpen||a.parent.hideSpinner(),jpe(a.parent.getMainContent(),{busy:!1})}var r,s,a=this,l=0,h=this.parent.getActiveSheet(),d=[],t=document.createDocumentFragment(),i=document.createDocumentFragment(),p=this.parent.element.querySelector(".e-sheet-content tbody"),c=this.parent.element.querySelector(".e-column-header tbody"),u=(u=this.parent.element.querySelector(".e-sheet-content colgroup")).cloneNode(),p=(t.appendChild(u),t.appendChild(p.cloneNode(!0))),g=u.cloneNode(),n=(i.appendChild(g),this.parent.element.querySelector(".e-column-header thead")),m=(n=i.appendChild(n.cloneNode(!0))).querySelector("tr"),f=(m.innerText="",this.parent.frozenRowCount(h)),y=this.parent.frozenColCount(h),v=(f&&(c=i.appendChild(c.cloneNode(!0))),Woe(h,f-1,!1)),b=this.parent.scrollSettings.enableVirtualization&&this.parent.viewport.topIndex!==Woe(h,0,!0);this.clearCFResult(h),o.cells.forEach(function(e,t){var i,n=rte(t);if(n[0]===o.indexes[0]&&(i=a.updateCol(h,n[1],g),u.appendChild(i.cloneNode()),a.cellRenderer.renderColHeader(n[1],m)),n[1]-y===o.indexes[1]){if(!(r=(n[0]<f?c:p).children[l]))return;r.innerText="",l++}r&&(s={colIdx:n[1],rowIdx:n[0],cell:e,address:t,row:r,pRow:r.previousSibling,first:o.skipUpdateOnFirst||n[1]!==o.indexes[1]?b&&n[0]===o.indexes[0]?"Row":"":"Column",isRefreshing:!0,mergeBorderRows:d},i=a.cellRenderer.render(s),a.checkColMerge(n,o.indexes,i,e,h),f)&&n[0]===v&&(l=0)});o.insertDelete?e():cpe(function(){e()})},Ice.prototype.refreshRowContent=function(n){var o,r,s,a=this,l=this.colGroupWidth,h=this.parent.getActiveSheet(),d=[],e=document.createDocumentFragment(),t=document.createDocumentFragment(),p=this.parent.createElement("tbody"),c=p.cloneNode(),u=(t.appendChild(c),e.appendChild(p),this.parent.frozenColCount(h)),g=Woe(h,u-1,!1,"columns"),m=this.parent.scrollSettings.enableVirtualization&&this.parent.viewport.leftIndex!==Woe(h,0,!0,"columns"),i=(this.clearCFResult(h),n.cells.forEach(function(e,t){var i=rte(t);i[1]!==n.indexes[1]&&o||(i[1]===n.indexes[1]&&(r=a.rowRenderer.render(i[0],!0)),u&&i[1]<u?(c.appendChild(r),o=r):(i[1]===n.indexes[1]&&c.appendChild(r),o=a.rowRenderer.render(i[0]),p.appendChild(o)),i[1]===n.indexes[1]&&(a.cellRenderer.renderRowHeader(i[0],r),l=gpe(i[0]+1))),u&&(r=c.lastElementChild||r),s={rowIdx:i[0],colIdx:i[1],cell:e,address:t,lastCell:i[1]===n.indexes[3],row:o,hRow:r,pRow:o.previousSibling,pHRow:r.previousSibling,isHeightCheckNeeded:!0,first:n.skipUpdateOnFirst||i[0]!==n.indexes[0]?m&&i[1]===n.indexes[1]?"Column":"":"Row",isRefreshing:!0,mergeBorderRows:d},s=a.cellRenderer.render(s),a.checkRowMerge(i,n.indexes,s,e,h),u&&i[1]===g&&(o=null)}),this.colGroupWidth!==l&&this.updateLeftColGroup(l),this.contentPanel.querySelector(".e-row-header tbody")),i=(i&&(G(i),this.getRowHeaderTable().appendChild(t)),this.contentPanel.querySelector(".e-sheet-content tbody"));i&&(G(i),this.getContentTable().appendChild(e)),this.parent.notify(Tse,{refresh:"Row",prevRowColCnt:n.prevRowColCnt}),hre(this.parent,d),h.conditionalFormats&&h.conditionalFormats.length&&this.parent.notify(_ne,{indexes:n.indexes,isRender:!0}),this.parent.allowChart&&this.parent.notify(Ole,{}),this.parent.isEdit&&this.parent.notify(wle,null),this.parent.isOpen||this.parent.hideSpinner(),jpe(this.parent.getMainContent(),{busy:!1})},Ice.prototype.updateCol=function(e,t,i){var n=this.col.cloneNode();return n.style.width=T(Zde(e,t,null,!0)),i?(e=i.querySelector(".e-empty"))?i.insertBefore(n,e):i.appendChild(n):n},Ice.prototype.updateColContent=function(x){var I=this;cpe(function(){var n,o,r,s,a,l,h=0,d=I.parent.getActiveSheet(),p=[],c=I.parent.element.querySelector(".e-column-header .e-header-row"),u=I.parent.element.querySelector(".e-sheet-content colgroup"),g=I.parent.element.querySelector(".e-column-header colgroup"),m=c.firstElementChild,f=u.firstElementChild,y=g.firstElementChild,v=I.parent.element.querySelector(".e-sheet-content tbody"),b=I.parent.element.querySelector(".e-column-header tbody"),w=I.parent.frozenRowCount(d),C=I.parent.frozenColCount(d),S=Woe(d,w-1,!1),A=Woe(d,x.indexes[0],!0);I.clearCFResult(d),x.cells.forEach(function(e,t){if(!a){var i=rte(t);if("first"===x.direction&&i[1]===x.indexes[1]&&I.checkColMerge([i[0],I.parent.viewport.leftIndex+C],x.indexes,((i[0]<w?b:v).rows[h]||{cells:[]}).cells[x.indexes[3]-x.indexes[1]+1],Kre(i[0],I.parent.viewport.leftIndex+C,d)||{},d),i[0]===A&&("last"===x.direction?((s=I.col.cloneNode()).style.width=T(Zde(d,i[1],null,!0)),u.insertBefore(s,f),g.insertBefore(s.cloneNode(),y),I.cellRenderer.renderColHeader(i[1],c,m)):(s=I.updateCol(d,i[1],u),g.appendChild(s.cloneNode()),I.cellRenderer.renderColHeader(i[1],c)),I.parent.scrollSettings.enableVirtualization)&&x.direction&&(G(u[x.direction+"ElementChild"]),G(g[x.direction+"ElementChild"]),G(c[x.direction+"ElementChild"])),i[1]===x.indexes[1]){if(i[0]<w)n=b.children[h];else if(!(n=v.children[h]))return void(a=!0);h++,o=n.firstElementChild}l={colIdx:i[1],rowIdx:i[0],cell:e,address:t,row:n,pRow:n.previousSibling,lastCell:i[1]===x.indexes[3],isHeightCheckNeeded:"first"===x.direction,first:"last"!==x.direction||x.skipUpdateOnFirst||i[1]!==x.indexes[1]?"":"Column",checkNextBorder:"last"===x.direction&&i[3]===x.indexes[3]?"Column":"",isRefreshing:"first"===x.direction,mergeBorderRows:p},"last"===x.direction?(l.refChild=o,r=I.cellRenderer.render(l),I.checkColMerge(i,x.indexes,r,e,d,((i[0]<w?b:v).rows[h-1]||{cells:[]}).cells[1])):r=I.cellRenderer.render(l),I.parent.scrollSettings.enableVirtualization&&x.direction&&G(n[x.direction+"ElementChild"]),w&&i[0]===S&&(h=0)}}),I.parent.notify(Tse,{refresh:"Column",prevRowColCnt:x.prevRowColCnt}),hre(I.parent,p),d.conditionalFormats&&d.conditionalFormats.length&&I.parent.notify(_ne,{indexes:x.indexes,isRender:!0}),I.parent.allowChart&&I.parent.notify(Ole,null),I.parent.isEdit&&I.parent.notify(wle,{}),I.parent.isOpen||I.parent.hideSpinner(),jpe(I.parent.getMainContent(),{busy:!1})})},Ice.prototype.updateRowContent=function(r){var s,a,l,h,d,p,c,u,g,m,f,y,v,b,w,C,S=this,e=this.parent.getMainContent();""===r.direction&&!e.children.length||(d=[],p=0,c=this.colGroupWidth,u=this.parent.getActiveSheet(),g=e.querySelector("tbody"),m=this.parent.getRowHeaderContent().querySelector("tbody"),f=document.createDocumentFragment(),y=document.createDocumentFragment(),this.parent.showSpinner(),v=this.parent.frozenColCount(u),b=this.parent.frozenRowCount(u),w=Woe(u,r.indexes[1],!0,"columns"),C=Woe(u,v-1,!1,"columns"),this.clearCFResult(u),r.cells.forEach(function(e,t){var i,n,o=rte(t);"first"===r.direction&&o[0]===r.indexes[0]&&(i=m.rows[m.rows.length-1],n=g.rows[g.rows.length-1],void 0===l&&(l=(o[1]<v?m:g).rows[r.indexes[2]-r.indexes[0]+1]||null),S.checkRowMerge([S.parent.viewport.topIndex+b,o[1]],r.indexes,(l||{cells:[]}).cells[o[1]<v?p+1:p],Kre(S.parent.viewport.topIndex+b,o[1],u)||{},u)),o[1]!==w&&s||(o[1]===w&&(a=S.rowRenderer.render(o[0],!0)),v&&o[1]<v?(f.appendChild(a),s=a):(s=S.rowRenderer.render(o[0]),y.appendChild(s),o[1]===w&&f.appendChild(a),S.parent.scrollSettings.enableVirtualization&&r.direction&&G(g[r.direction+"ElementChild"])),o[1]===w&&(S.cellRenderer.renderRowHeader(o[0],a),c=gpe(o[0]+1),S.parent.scrollSettings.enableVirtualization)&&r.direction&&G(m[r.direction+"ElementChild"])),v&&(a=f.lastElementChild||a),h={colIdx:o[1],rowIdx:o[2],cell:e,address:t,row:s,lastCell:o[1]===r.indexes[3],pHRow:a.previousSibling||i,checkNextBorder:"last"===r.direction&&o[2]===r.indexes[2]?"Row":"",pRow:s.previousSibling||n,isHeightCheckNeeded:"first"===r.direction||""===r.direction,hRow:a,first:"last"!==r.direction||r.skipUpdateOnFirst||o[0]!==r.indexes[0]?"":"Row",isRefreshing:"first"===r.direction,mergeBorderRows:d},h=S.cellRenderer.render(h),"last"===r.direction&&g.rows.length&&S.checkRowMerge(o,r.indexes,h,e,u,(o[1]<v?m:g).rows[0].cells[o[1]<v?p+1:p]),p++,v&&o[1]===C&&(s=null,l=void 0,p=0)}),this.colGroupWidth!==c&&this.updateLeftColGroup(c),"last"===r.direction?(m.insertBefore(f,m.firstElementChild),g.insertBefore(y,g.firstElementChild)):(m.appendChild(f),g.appendChild(y)),this.parent.scrollSettings.enableVirtualization&&this.parent.notify(Tse,{refresh:"Row",prevRowColCnt:r.prevRowColCnt}),hre(this.parent,d),u.conditionalFormats&&u.conditionalFormats.length&&this.parent.notify(_ne,{indexes:r.indexes,isRender:!0}),this.parent.isEdit&&this.parent.notify(wle,null),this.parent.allowChart&&this.parent.notify(Ole,{}),this.parent.isOpen||this.parent.hideSpinner(),jpe(this.parent.getMainContent(),{busy:!1}))},Ice.prototype.checkRowMerge=function(e,t,i,n,o,r){if(this.parent.scrollSettings.enableVirtualization&&i&&(!je(n.rowSpan)||!je(n.colSpan))){var s=this.parent.frozenRowCount(o),s=this.parent.viewport.topIndex+s;if(e[0]===s){if(n.rowSpan<0){var i={td:i,rowIdx:e[0],colIdx:e[1],isRow:!0,isFreezePane:!0};if(this.parent.notify(ale,i),i.insideFreezePane)return;s>=t[2]&&this.refreshPrevMerge(t[2]+1,e[1])}r&&this.refreshFirstCell(e[0]+(t[2]-t[0])+1,e[1],o,r)}else 1<n.rowSpan&&(i=t[2]+1,e[0]+n.rowSpan-1>=i)&&e[0]<i&&this.refreshPrevMerge(i,e[1],s)}},Ice.prototype.refreshPrevMerge=function(e,t,i){i=this.parent.getCell(e,t,this.parent.getRow(i||0,null,t));i&&this.cellRenderer.refresh(e,t,null,i)},Ice.prototype.refreshFirstCell=function(e,t,i,n){i=Kre(e,t,i,!1,!0);(i.rowSpan<0||i.colSpan<0)&&this.cellRenderer.refresh(e,t,null,n)},Ice.prototype.checkColMerge=function(e,t,i,n,o,r){if(this.parent.scrollSettings.enableVirtualization&&i&&(!je(n.rowSpan)||!je(n.colSpan))){var s=this.parent.frozenColCount(o),s=this.parent.viewport.leftIndex+s;if(e[1]===s){if(n.colSpan<0){var a,i={td:i,colIdx:e[1],rowIdx:e[0],isFreezePane:!0};if(this.parent.notify(ale,i),i.insideFreezePane)return;s>=t[3]&&(a=this.parent.getCell(e[0],e[3]+1,this.parent.getRow(e[0],null,e[3]+1)))&&this.cellRenderer.refresh(e[0],t[3]+1,null,a)}r&&this.refreshFirstCell(e[0],e[1]+(t[3]-t[1])+1,o,r)}else 1<n.colSpan&&e[1]+n.colSpan-1>=t[3]+1&&e[1]<t[3]+1&&(a=this.parent.getCell(e[0],e[3]+1,this.parent.getRow(e[0],null,e[3]+1)))&&this.cellRenderer.refresh(e[0],t[3]+1,null,a)}},Ice.prototype.toggleGridlines=function(){var e=document.getElementById(this.parent.element.id+"_sheet");this.parent.getActiveSheet().showGridLines?e.classList.remove("e-hide-gridlines"):e.classList.add("e-hide-gridlines")},Ice.prototype.showHideHeaders=function(){var t=this,i=this.parent.getActiveSheet();cpe(function(){var e;i.showHeaders?(e=t.getContentPanel(),t.setPanelWidth(i,t.getRowHeaderPanel()),t.setPanelHeight(i),document.getElementById(t.parent.element.id+"_sheet").classList.remove("e-hide-headers"),t.getColHeaderPanel().scrollLeft=e.scrollLeft,t.parent.selectRange(i.selectedRange)):(t.updateHideHeaders(i,document.getElementById(t.parent.element.id+"_sheet")),t.setPanelHeight(i),t.parent.frozenColCount(i)||t.parent.frozenRowCount(i)?(t.setPanelWidth(i,t.getRowHeaderPanel()),t.parent.selectRange(i.selectedRange)):(t.getContentPanel().style.width="",t.getContentPanel().style[t.parent.enableRtl?"right":"left"]=""),t.getScrollElement().style.left=t.getRowHeaderWidth(i)+"px")})},Ice.prototype.updateHideHeaders=function(e,t){e.showHeaders||t.classList.add("e-hide-headers")},Ice.prototype.rowHeightChanged=function(e){var t;(e.threshold||e.isHideShow)&&(t=this.parent.getActiveSheet(),e.rowIdx<this.parent.frozenRowCount(t))&&this.setPanelHeight(t)},Ice.prototype.colWidthChanged=function(e){var t;(e.threshold||e.isHideShow)&&(t=this.parent.getActiveSheet(),e.colIdx<this.parent.frozenColCount(t)&&this.setPanelWidth(t,this.getRowHeaderPanel()),this.checkTableWidth(t))},Ice.prototype.getRowHeaderWidth=function(e,t,i){var n=0,i=i?this.parent.viewport.scaleX:1;return!t&&e.frozenColumns&&(n=$de(e,t=ste(e.topLeftCell)[1],t+e.frozenColumns-1,!0)/i),n+=e.showHeaders?Hpe(this.colGroupWidth)/i:0},Ice.prototype.getColHeaderHeight=function(e,t){var i=ste(e.topLeftCell)[0];return(e.showHeaders&&!t?Hpe(31):0)+Ude(e,i,i+e.frozenRows-1,!0)},Ice.prototype.getSelectAllContent=function(){return this.headerPanel.getElementsByClassName("e-selectall-container")[0]},Ice.prototype.getScrollElement=function(){var e;return(e=this.contentPanel?this.contentPanel.parentElement||this.contentPanel.nextElementSibling:e)&&e.querySelector(".e-scroller")},Ice.prototype.getSelectAllTable=function(){return this.headerPanel.getElementsByClassName("e-selectall-table")[0]},Ice.prototype.getColHeaderTable=function(){return this.headerPanel.getElementsByClassName("e-colhdr-table")[0]},Ice.prototype.getRowHeaderTable=function(){return this.contentPanel.getElementsByClassName("e-rowhdr-table")[0]},Ice.prototype.getContentTable=function(){return this.contentPanel.getElementsByClassName("e-content-table")[0]},Ice.prototype.getRowHeaderPanel=function(){return this.contentPanel.getElementsByClassName("e-row-header")[0]},Ice.prototype.getColHeaderPanel=function(){return this.headerPanel.getElementsByClassName("e-column-header")[0]},Ice.prototype.getContentPanel=function(){return this.contentPanel.getElementsByClassName("e-sheet-content")[0]},Ice.prototype.addEventListener=function(){this.parent.on(Jae,this.triggerCreatedEvent,this),this.parent.on(iae,this.rowHeightChanged,this),this.parent.on(nae,this.colWidthChanged,this),this.parent.on(gse,this.removeEventListener,this)},Ice.prototype.destroy=function(){this.headerPanel&&(upe(this.headerPanel),this.headerPanel.remove()),this.headerPanel=null,this.contentPanel&&(upe(this.contentPanel),this.contentPanel.remove()),this.contentPanel=null,this.col&&(upe(this.col),this.col.remove()),this.col=null,this.rowRenderer=null,this.cellRenderer=null,this.colGroupWidth=null,this.parent=null},Ice.prototype.removeEventListener=function(){this.parent.off(Jae,this.triggerCreatedEvent),this.parent.off(iae,this.rowHeightChanged),this.parent.off(nae,this.colWidthChanged),this.parent.off(gse,this.removeEventListener)};var xce=Ice;function Ice(e){this.colGroupWidth=30,this.parent=e,this.col=e.createElement("col"),this.rowRenderer=e.serviceLocator.getService("row"),this.cellRenderer=e.serviceLocator.getService("cell"),this.addEventListener()}Ece.prototype.render=function(e,t,i){var n,o,r,s,a=this.element.cloneNode(),l=this.parent.getActiveSheet();return void 0===e?a.classList.add("e-header-row"):(a.classList.add("e-row"),this.bottomBorderWidth||(s=1,0<window.devicePixelRatio%1&&(s=1+((n=+window.devicePixelRatio%1)?(.5<n?1-n:-1*n)/window.devicePixelRatio:0)),this.bottomBorderWidth=s),r={height:(n=Wde(l,e,!0))+"px",lineHeight:(o=Wde(l,e))<20?n>this.bottomBorderWidth?n-this.bottomBorderWidth+"px":"0px":""},Object.assign(a.style,r),pt(a,{"aria-rowindex":(e+1).toString()}),t&&!i&&(o<20&&(s=this.bottomBorderWidth-1+4,a.style.lineHeight=s<=n?n-s+"px":n>this.bottomBorderWidth?n-this.bottomBorderWidth+"px":"0px",a.classList.contains("e-reach-fntsize")||a.classList.add("e-reach-fntsize")),zde(l,e+1)&&!zde(l,e-1)&&a.classList.add("e-hide-start"),0!==e)&&zde(l,e-1)&&!zde(l,e+1)&&a.classList.add("e-hide-end")),a},Ece.prototype.refresh=function(e,t,i,n,o){var r,s,a,l,h,d=this,p=this.parent.getActiveSheet();return n?(r=this.render(e,n,o),this.cellRenderer.renderRowHeader(e,r)):(l=function(){for(;s<=a;)epe(p,s)||d.cellRenderer.render({colIdx:s,rowIdx:e,cell:Kre(e,s,p),address:lte(e,s),lastCell:s===a,row:r,hRow:i,isHeightCheckNeeded:!0,pRow:t,first:e===d.parent.viewport.topIndex&&Woe(p,e,!0)!==Woe(p,0,!0)?"Row":"",skipFormatCheck:nre(d.parent),checkCF:!0}),s++},(h=this.parent.frozenColCount(p))&&(r=i,s=ste(p.topLeftCell)[0],a=h-1,l()),r=this.render(e,n,o),s=this.parent.viewport.leftIndex+h,a=this.parent.viewport.rightIndex,l()),r},Ece.prototype.initProps=function(){this.bottomBorderWidth=null},Ece.prototype.destroy=function(){this.parent.off(rae,this.initProps),this.element&&this.element.remove(),this.bottomBorderWidth&&(this.bottomBorderWidth=null),this.parent=null,this.element=null};var Tce=Ece;function Ece(e){this.parent=e,this.element=this.parent.createElement("tr"),this.cellRenderer=e.serviceLocator.getService("cell"),this.parent.on(rae,this.initProps,this)}Mce.prototype.renderColHeader=function(e,t,i){var n=this.th.cloneNode(),o=dte(e+1),r=(n.innerText=o,this.parent.getActiveSheet());epe(r,e+1)&&n.classList.add("e-hide-start"),0!==e&&epe(r,e-1)&&n.classList.add("e-hide-end"),i?t.insertBefore(n,i):t.appendChild(n),this.parent.trigger("beforeCellRender",{cell:null,element:n,address:o,colIndex:e}),this.parent.notify(Bae,{td:n,rowIndex:0,colIndex:e}),pt(n,{"aria-colindex":(e+1).toString(),tabindex:"-1"})},Mce.prototype.renderRowHeader=function(e,t,i){var n=this.element.cloneNode();U([n],"e-header-cell"),pt(n,{role:"rowheader",tabindex:"-1"}),n.innerText=(e+1).toString(),i?t.insertBefore(n,i):t.appendChild(n),this.parent.trigger("beforeCellRender",{cell:null,element:n,address:""+(e+1),rowIndex:e})},Mce.prototype.render=function(e){var t=this.parent.getActiveSheet();if(e.td=this.element.cloneNode(),e.td.className="e-cell",pt(e.td,{"aria-colindex":(e.colIdx+1).toString(),tabindex:"-1"}),this.checkMerged(e))return this.createImageAndChart(e),e.refChild?e.row.insertBefore(e.td,e.refChild):e.row.appendChild(e.td),e.td;e.isRefresh=!1,e.skipFormatCheck=nre(this.parent);var i=this.update(e),n=(e.checkCF&&e.cell&&t.conditionalFormats&&t.conditionalFormats.length&&this.parent.notify(_ne,{indexes:[e.rowIdx,e.colIdx],cell:e.cell,ele:e.td,isRender:!0}),e.td.classList.contains("e-cell-template")||this.parent.notify(Bae,{td:e.td,rowIndex:e.rowIdx,colIndex:e.colIdx}),e.refChild?e.row.insertBefore(e.td,e.refChild):e.row.appendChild(e.td),{cell:e.cell,element:e.td,address:e.address,rowIndex:e.rowIdx,colIndex:e.colIdx,needHeightCheck:!1,row:e.row});return this.parent.trigger("beforeCellRender",n),t.rows[e.rowIdx]&&t.rows[e.rowIdx].customHeight||((n.needHeightCheck||i&&n.element&&n.element.children.length)&&((i=n.element.cloneNode(!0)).style.width=Zde(t,e.colIdx,!0)+"px",this.tableRow.appendChild(i)),e.lastCell&&this.tableRow.childElementCount&&((i=this.getRowHeightOnInit())>Wde(t,e.rowIdx)&&Xpe(this.parent,t,i,e.rowIdx,e.row,e.hRow),this.tableRow.innerText="")),this.setWrapByValue(t,e),n.element},Mce.prototype.setWrapByValue=function(e,t){t.cell&&je(t.cell.wrap)&&t.cell.value&&t.cell.value.toString().includes("\n")&&(Jre(t.rowIdx,t.colIdx,e,{wrap:!0},!0),this.parent.notify(sne,{range:[t.rowIdx,t.colIdx,t.rowIdx,t.colIdx],wrap:!0,initial:!0,sheet:e,td:t.td,row:t.row,hRow:t.hRow}))},Mce.prototype.update=function(e){var t,i=this.parent.getActiveSheet();if((!e.isRefresh||e.cell&&e.cell.template)&&(r=this.processTemplates(e.cell,e.rowIdx,e.colIdx))&&("string"==typeof r?e.td.innerHTML=r:(upe(e.td),ht(r,e.td)),e.td.classList.add("e-cell-template"),t=!0),e.isRefresh){if(e.td.rowSpan&&(this.mergeFreezeRow(i,e.rowIdx,e.colIdx,e.td.rowSpan,e.row,!0),e.td.removeAttribute("rowSpan")),e.td.colSpan&&(this.mergeFreezeCol(i,e.rowIdx,e.colIdx,e.td.colSpan,!0),e.td.removeAttribute("colSpan")),this.checkMerged(e))return!1;e.cell&&!e.cell.hyperlink&&(r=e.td.querySelector(".e-hyperlink"))&&G(r),e.cell&&0<e.td.children.length&&-1<e.td.children[e.td.childElementCount-1].className.indexOf("e-addNoteIndicator")&&(r=e.td.querySelector(".e-addNoteIndicator"))&&G(r),e.cell&&this.parent.allowWrap||!e.td.classList.contains("e-wraptext")||e.td.classList.remove("e-wraptext")}e.cell&&e.cell.formula&&!e.isRandomFormula&&"Automatic"===this.parent.calculationMode&&(this.calculateFormula(e),e.fillType)&&"FillWithoutFormatting"===e.fillType&&delete e.cell.format;var n,o,r={value:e.cell&&e.cell.value,type:e.cell&&Yhe(e.cell.format),format:e.cell&&e.cell.format,formattedText:e.cell&&e.cell.value,isRightAlign:!1,cell:e.cell,rowIndex:e.rowIdx,colIndex:e.colIdx,td:e.td,skipFormatCheck:e.skipFormatCheck,refresh:!0},s=("Manual"===this.parent.calculationMode&&e.cell&&!e.cell.value&&""!==e.cell.value&&e.cell.formula&&(r.value=0,e.cell.value="0"),e.cell&&this.parent.notify(Aie,r),this.parent.refreshNode(e.td,r),{});return e.cell&&(e.cell.style&&(s=e.cell.style.properties?Zre(e.cell.style,!0):e.cell.style),void 0!==r.color&&((s=Object.assign({},s)).color=r.color),this.createImageAndChart(e),e.cell.hyperlink&&("FillFormattingOnly"===e.fillType?(e.td.style.textDecoration="underline",e.td.style.color="#00e"):this.parent.notify(Aae,{cell:e.cell,style:s,td:e.td,rowIdx:e.rowIdx,colIdx:e.colIdx,fillType:e.fillType,action:e.action})),1<e.cell.rowSpan&&1<(r=e.rowSpan||e.cell.rowSpan-this.parent.hiddenCount(e.rowIdx,e.rowIdx+(e.cell.rowSpan-1)))&&(e.td.rowSpan=r,this.mergeFreezeRow(i,e.rowIdx,e.colIdx,r,e.row)),1<e.cell.colSpan&&1<(r=e.colSpan||e.cell.colSpan-this.parent.hiddenCount(e.colIdx,e.colIdx+(e.cell.colSpan-1),"columns"))&&(e.td.colSpan=r,this.mergeFreezeCol(i,e.rowIdx,e.colIdx,r)),je(e.cell.notes)||e.fillType?!je(e.td)&&0<e.td.children.length&&-1<e.td.children[e.td.childElementCount-1].className.indexOf("e-addNoteIndicator")&&this.parent.notify(yae,{rowIndex:e.rowIdx,columnIndex:e.colIdx}):this.parent.notify(bae,{targetElement:e.td,rowIndex:e.rowIdx,columnIndex:e.colIdx}),e.cell.isNoteEditable)&&this.parent.notify(vae,{rowIndex:e.rowIdx,columnIndex:e.colIdx,isNoteEditable:!0,isScrollWithNote:!0,cellElement:e.td}),e.isRefresh&&je(e.cell)&&!je(e.td)&&0<e.td.children.length&&-1<e.td.children[e.td.childElementCount-1].className.indexOf("e-addNoteIndicator")&&this.parent.notify(yae,{rowIndex:e.rowIdx,columnIndex:e.colIdx}),e.isRefresh&&this.removeStyle(e.td,e.rowIdx,e.colIdx),e.lastCell&&this.parent.chartColl&&this.parent.chartColl.length&&this.parent.notify(Gne,{cell:e.cell,rIdx:e.rowIdx,cIdx:e.colIdx,sheetIdx:this.parent.activeSheetIndex,isSelectAll:e.isSelectAll}),this.applyStyle(e,s),"Row"!==e.checkNextBorder||""===(r=this.parent.getCellStyleValue(["borderTop"],[Number(this.parent.getContentTable().rows[0].getAttribute("aria-rowindex"))-1,e.colIdx]).borderTop)||e.cell&&e.cell.style&&e.cell.style.bottomPriority||(e.style={borderBottom:r},this.parent.notify(Mie,e)),"Column"!==e.checkNextBorder||""===(s=this.parent.getCellStyleValue(["borderLeft"],[e.rowIdx,e.colIdx+1]).borderLeft)||e.cell&&e.cell.style&&(e.cell.style.borderRight||e.cell.style.border)||(e.style={borderRight:s},this.parent.notify(Mie,e)),e.cell&&!je(e.cell.wrap)&&this.parent.notify(sne,{range:[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx],wrap:e.cell.wrap,sheet:i,initial:!0,td:e.td,row:e.row,hRow:e.hRow,isCustomHgt:!e.isRefresh&&Wde(i,e.rowIdx)>(i&&i.standardHeight?i.standardHeight:20)}),e.cell&&e.cell.validation?(n=e.cell.validation,o=i.columns&&i.columns[e.colIdx]):n=tpe(i.columns&&i.columns[e.colIdx],e.rowIdx,e.colIdx)&&i.columns[e.colIdx].validation,n&&(n.isHighlighted&&(e.validation=n,e.col=o,this.parent.notify(Zne,e)),"List"!==n.type||e.isRefresh||e.address!==i.activeCell||(e.validation=n,this.parent.notify(Toe,e))),t},Mce.prototype.applyStyle=function(e,t){(Object.keys(t).length||Object.keys(this.parent.commonCellStyle).length||e.lastCell)&&(e.style=Pe({},this.parent.commonCellStyle,t),this.parent.notify(Mie,e))},Mce.prototype.createImageAndChart=function(e){if(e.cell.chart&&0<e.cell.chart.length&&this.parent.notify(Qne,{chart:e.cell.chart,isInitCell:!0,range:lte(e.rowIdx,e.colIdx),isUndoRedo:!1}),e.cell.image&&0<e.cell.image.length)for(var t=0;t<e.cell.image.length;t++)e.cell.image[t]&&this.parent.notify(Tle,{options:{src:e.cell.image[t].src,id:e.cell.image[t].id,height:e.cell.image[t].height,width:e.cell.image[t].width,top:e.cell.image[t].top,left:e.cell.image[t].left},range:hte([e.rowIdx,e.colIdx,e.rowIdx,e.colIdx]),isPublic:!1})},Mce.prototype.calculateFormula=function(e){if(void 0!==e.cell.value&&null!==e.cell.value){var t={action:"checkFormulaAdded",added:!0,address:e.address,sheetId:(void 0===e.sheetIndex?this.parent.getActiveSheet():_re(this.parent,e.sheetIndex)).id.toString()};if(this.parent.notify(Pie,t),t.added)return}else e.formulaRefresh&&(e.cell.value="");var t=Poe(e.cell.formula),i={action:"refreshCalculate",value:e.cell.formula,rowIndex:e.rowIdx,colIndex:e.colIdx,isFormula:t,sheetIndex:e.sheetIndex,isRefreshing:e.isRefreshing,isDependentRefresh:e.isDependentRefresh,isRandomFormula:e.isRandomFormula,fillType:e.fillType};("Automatic"===this.parent.calculationMode||e.isSortAction||"calculate"===e.action||e.isDependentRefresh)&&this.parent.notify(Pie,i),(void 0===e.cell.value&&"Manual"===this.parent.calculationMode&&!this.parent.getActiveSheet().isSheetCalculated||this.parent.isEdit&&"#CIRCULARREF!"===e.cell.value)&&(e.cell.value="0"),e.cell.value=Kre(e.rowIdx,e.colIdx,je(e.sheetIndex)?this.parent.getActiveSheet():_re(this.parent,e.sheetIndex)).value,t&&(-1<e.cell.formula.indexOf("^+")||-1<e.cell.formula.indexOf("&+"))&&(e.cell.formula=i.value)},Mce.prototype.checkMerged=function(e){var t,i,n,o;return!(!e.cell||!(e.cell.colSpan<0||e.cell.rowSpan<0))&&((!(n=this.parent.getActiveSheet()).frozenRows&&!n.frozenColumns||(t={range:[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx]},this.parent.notify(Rne,t),o=this.parent.frozenRowCount(n),i=this.parent.frozenColCount(n),n.frozenRows&&n.frozenColumns?t.range[0]<o&&t.range[1]<i?e.rowIdx<o&&e.colIdx<i:t.range[0]<o?e.rowIdx<o:!(t.range[1]<i)||e.colIdx<i:o?t.range[0]>=o||e.rowIdx<o:t.range[1]>=i||e.colIdx<i))&&(e.td.style.display="none"),e.isMerged=!0,n=e.cell.rowSpan,((o=e.cell.colSpan)<0||n<0)&&(this.parent.notify(sle,e),o<0&&e.cell.style&&e.cell.style.borderTop&&this.applyStyle(e,{borderTop:e.cell.style.borderTop}),n<0)&&e.cell.style&&e.cell.style.borderLeft&&this.applyStyle(e,{borderLeft:e.cell.style.borderLeft}),e.isMerged)},Mce.prototype.mergeFreezeRow=function(e,t,i,n,o,r){var s=this.parent.frozenRowCount(e);if(s&&t<s&&s<=t+(n-1)){var a,l=void 0,h=0,d=this.parent.frozenColCount(e),p=o||this.parent.getRow(t,null,i),c=[].slice.call(p.parentElement.querySelectorAll(".e-empty"));if(r){o=t+n-s;if(!(o<c.length)){var u=0;if(o===c.length){var g,m=void 0,f=void 0;for(f=d&&i<d?(m=ste(e.topLeftCell)[1],d):(m=this.parent.viewport.leftIndex+d,this.parent.viewport.rightIndex);m<f;m++)m!==i&&(g=Kre(t,m,e,!1,!0)).rowSpan&&t+g.rowSpan-s>u&&(u=t+g.rowSpan-s);if(u===o)return}else u=o;for(var y=t+(n-1),m=u,f=c.length;m<f;m++)h+=Wde(e,y),y--,G(c.pop());this.updateSpanTop(i,d,h,!0),c.length||this.updateColZIndex(i,d,!0)}}else{this.updateColZIndex(i,d);for(m=s,f=t+(n-1);m<=f;m++)h+=-(a=Wde(e,Woe(e,m,!0),!0)),s+c.length>m||((l=p.cloneNode()).classList.add("e-empty"),l.style.visibility="hidden",l.style.height=a+"px",p.parentElement.appendChild(l));this.updateSpanTop(i,d,h)}}},Mce.prototype.updateSpanTop=function(e,t,i,n){var o=this.parent.serviceLocator.getService("sheet").contentPanel;if(n){if(!parseInt(o.style.top,10))return;i=parseInt(o.style.top,10)+i}t&&e<t&&(n||!parseInt(o.style.top,10)||i<parseInt(o.style.top,10))&&(o.style.top=i+"px",e=o.nextElementSibling)&&(e.style.top=i+"px")},Mce.prototype.mergeFreezeCol=function(e,t,i,n,o){var r=this.parent.frozenColCount(e);if(r&&i<r&&r<=i+(n-1)){var s,a=void 0,l=this.parent.frozenRowCount(e),h=(t<l?this.parent.getSelectAllContent():this.parent.getRowHeaderContent()).querySelector("colgroup"),d=[].slice.call(h.querySelectorAll(".e-empty"));if(o){o=i+n-r;if(!(o<d.length)){var p=0;if(o===d.length){var c,u=void 0,g=void 0;for(g=l&&t<l?(u=l,ste(e.topLeftCell)[0]):(u=this.parent.viewport.bottomIndex,this.parent.viewport.topIndex+l);g<u;g++)g!==t&&(c=Kre(g,i,e,!1,!0)).colSpan&&i+c.colSpan-r>p&&(p=i+c.colSpan-r);if(p===o)return}else p=o;for(g=p,u=d.length;g<u;g++)G(d.pop());this.parent.serviceLocator.getService("sheet").setPanelWidth(e,this.parent.getRowHeaderContent()),d.length||this.updateRowZIndex(t,l,!0)}}else{this.updateRowZIndex(t,l);for(g=r,u=i+(n-1);g<=u;g++)r+d.length>g||((a=h.childNodes[0].cloneNode()).classList.add("e-empty"),a.style.visibility="hidden",s=Zde(e,Woe(e,g,!0,"columns"),null,!0),a.style.width=s+"px",h.appendChild(a),g===u&&this.parent.serviceLocator.getService("sheet").setPanelWidth(e,this.parent.getRowHeaderContent()))}}},Mce.prototype.updateColZIndex=function(e,t,i){e<t?this.updateSelectAllZIndex(i):(this.parent.getColumnHeaderContent().style.zIndex=i?"":"2",this.updatedHeaderZIndex(i))},Mce.prototype.updateSelectAllZIndex=function(e){var t,i=this.parent.element.querySelector(".e-frozen-row"),n=this.parent.element.querySelector(".e-frozen-column");e?(this.parent.getSelectAllContent().style.zIndex="",i&&(i.style.zIndex=""),n&&(n.style.zIndex="")):(e=this.parent.getRowHeaderContent(),t=this.parent.getColumnHeaderContent(),e.style.zIndex||t.style.zIndex?(this.parent.getSelectAllContent().style.zIndex="3",i&&(i.style.zIndex="4"),n&&(n.style.zIndex="4"),(i=e.querySelector(".e-selection"))&&(i.style.zIndex="3"),(n=t.querySelector(".e-selection"))&&(n.style.zIndex="3")):this.parent.getSelectAllContent().style.zIndex="2")},Mce.prototype.updatedHeaderZIndex=function(e){var t;!e&&"2"===this.parent.getSelectAllContent().style.zIndex&&(this.parent.getSelectAllContent().style.zIndex="3",e=this.parent.element.querySelector(".e-frozen-row"),(t=this.parent.element.querySelector(".e-frozen-column"))&&(t.style.zIndex="4"),e&&(e.style.zIndex="4"),(t=this.parent.getRowHeaderContent().querySelector(".e-selection"))&&(t.style.zIndex="3"),e=this.parent.getColumnHeaderContent().querySelector(".e-selection"))&&(e.style.zIndex="3")},Mce.prototype.updateRowZIndex=function(e,t,i){e<t?this.updateSelectAllZIndex(i):(this.parent.getRowHeaderContent().style.zIndex=i?"":"2",this.updatedHeaderZIndex(i))},Mce.prototype.processTemplates=function(e,t,i){for(var n,o=this.parent.getActiveSheet(),r=o.ranges,s=0,a=r.length;s<a;s++)if(r[s].template&&(n=rte(r[s].address.length?r[s].address:r[s].startCell))[0]<=t&&n[1]<=i&&n[2]>=t&&n[3]>=i){if(e)return this.compileCellTemplate(r[s].template,Object.assign({rowIndex:t,colIndex:i},e));if(!Kre(t,i,o,!0))return this.compileCellTemplate(r[s].template,Object.assign({rowIndex:t,colIndex:i},Kre(t,i,o,null,!0)))}return""},Mce.prototype.compileCellTemplate=function(e,t){var i;return"string"==typeof e?(i=oo(0===e.trim().indexOf("#")?document.querySelector(e).innerHTML.trim():e),!this.parent.isVue||this.isSelector(e)?i(t,this.parent,"ranges","",!0)[0].outerHTML:i(t,this.parent,"ranges","")):(e=(i=oo(e))(t,this.parent,"ranges",""))[0]?e:[e]},Mce.prototype.isSelector=function(e){try{return!!document.querySelector(e)}catch(e){return!1}},Mce.prototype.getRowHeightOnInit=function(){var e=this.parent.createElement("table",{className:"e-table e-test-table"}),t=(e.appendChild(this.parent.createElement("tbody")).appendChild(this.tableRow),this.parent.element.appendChild(e),this.tableRow.getBoundingClientRect().height);return this.parent.element.removeChild(e),t<20?20:t},Mce.prototype.removeStyle=function(t,e,i){t.style.length&&(o=(n=this.parent.getCellStyleValue(["borderLeft","border"],[e,i+1])).borderLeft||n.border,r=(n=this.parent.getCellStyleValue(["borderTop","border"],[e+1,i])).borderTop||n.border,o||r?[].slice.call(t.style).forEach(function(e){o&&r?e.includes("border-right")||e.includes("border-bottom")||t.style.removeProperty(e):(!o||-1<e.indexOf("border-right")||r&&"none"!==r)&&(!r||-1<e.indexOf("border-bottom")||o&&"none"!==o)||t.style.removeProperty(e)}):t.removeAttribute("style"));var n,o,r,s=this.parent.getCell(e-1,i),a=(s&&s.style.borderBottom&&(a=Number(s.parentElement.getAttribute("aria-rowindex"))-1,(n=this.parent.getCellStyleValue(["borderBottom","border"],[a,i])).borderBottom||n.border||(s.style.borderBottom="")),t.previousElementSibling);a&&a.style.borderRight&&(i=Number(a.getAttribute("aria-colindex"))-1,(n=this.parent.getCellStyleValue(["borderRight","border"],[e,i])).borderRight||n.border||(a.style.borderRight=""))},Mce.prototype.refreshRange=function(e,t,i,n,o,r,s,a,l,h,d,p){void 0===l&&(l=!0);var c,u,g=this.parent.getActiveSheet(),m=e.slice();if(wpe(this.parent,m,!0))for(var f=0,y=m[0];y<=m[2];y++)if(!zde(g,y))for(var v=m[1];v<=m[3];v++)epe(g,v)||((u=this.parent.getCell(y,v))&&(c={rowIdx:y,colIdx:v,td:u,cell:Kre(y,v,g),isRefreshing:t,lastCell:v===m[3],isRefresh:!0,isHeightCheckNeeded:l,manualUpdate:!0,first:"",onActionUpdate:n,skipFormatCheck:r,isFromAutoFillOption:a,isSelectAll:d,rowHeight:p&&p[f]&&p[f].rowHeight},f++,s&&(c.address=lte(y,v)),this.update(c),o&&g.conditionalFormats&&g.conditionalFormats.length&&this.parent.notify(_ne,{indexes:[y,v],isAction:!0}),this.parent.notify(Bae,{td:u,rowIndex:y,colIndex:v}),i)&&this.setWrapByValue(g,c),"Manual"===this.parent.calculationMode&&h&&(u?c.isSortAction=h:c={rowIdx:y,colIdx:v,td:u,cell:Kre(y,v,g),isRefreshing:t,lastCell:v===m[3],isRefresh:!0,isHeightCheckNeeded:l,manualUpdate:!0,first:"",onActionUpdate:n,skipFormatCheck:r,isFromAutoFillOption:a,isSortAction:h},c.cell)&&c.cell.formula&&g.isSheetCalculated&&this.calculateFormula(c))},Mce.prototype.refresh=function(e,t,i,n,o,r,s,a,l){var h=this.parent.getActiveSheet();(n||!zde(h,e)&&!epe(h,t))&&(n||!this.parent.scrollSettings.enableVirtualization||this.parent.insideViewport(e,t))&&(n=n||this.parent.getCell(e,t))&&(i={rowIdx:e,colIdx:t,td:n,cell:Kre(e,t,h),isRefresh:!0,lastCell:i,isHeightCheckNeeded:!0,manualUpdate:!0,first:"",skipFormatCheck:s,isRandomFormula:a,fillType:l},this.update(i),o&&h.conditionalFormats&&h.conditionalFormats.length&&this.parent.notify(_ne,{indexes:[e,t],isAction:!0}),this.parent.notify(Bae,{td:n,rowIndex:e,colIndex:t}),r)&&this.setWrapByValue(h,i)},Mce.prototype.updateView=function(e){var t,i,n;je(e.sheetIndex)||e.sheetIndex===this.parent.activeSheetIndex?(e.indexes||(n=this.parent.getActiveSheet(),t=this.parent.frozenRowCount(n),i=this.parent.frozenColCount(n),n=rte(n.topLeftCell),t&&i&&this.refreshRange([n[0],n[1],t-1,i-1],e.refreshing,e.checkWrap,!1,e.checkCF),t&&this.refreshRange([n[0],this.parent.viewport.leftIndex+i,t-1,this.parent.viewport.rightIndex],e.refreshing,e.checkWrap,!1,e.checkCF),i&&this.refreshRange([this.parent.viewport.topIndex+t,n[1],this.parent.viewport.bottomIndex,i-1],e.refreshing,e.checkWrap,!1,e.checkCF),e.indexes=[this.parent.viewport.topIndex+t,this.parent.viewport.leftIndex+i,this.parent.viewport.bottomIndex,this.parent.viewport.rightIndex]),this.refreshRange(e.indexes,e.refreshing,e.checkWrap,!1,e.checkCF)):e.refreshing&&this.calculateFormula({cell:Kre(e.indexes[0],e.indexes[1],_re(this.parent,e.sheetIndex),!0,!0),rowIdx:e.indexes[0],colIdx:e.indexes[1],sheetIndex:e.sheetIndex})},Mce.prototype.destroy=function(){this.parent.off(doe,this.updateView),this.parent.off(xie,this.calculateFormula),this.element&&this.element.remove(),this.element=null,this.th&&this.th.remove(),this.th=null,this.tableRow&&this.tableRow.remove(),this.tableRow=null,this.parent=null};var Dce=Mce;function Mce(e){this.parent=e,this.element=this.parent.createElement("td"),this.th=this.parent.createElement("th",{className:"e-header-cell"}),this.tableRow=e.createElement("tr",{className:"e-row"}),this.parent.on(doe,this.updateView,this),this.parent.on(xie,this.calculateFormula,this)}Pce.prototype.render=function(){this.parent.setProperties({activeSheetIndex:this.parent.skipHiddenSheets(this.parent.activeSheetIndex)},!0),this.parent.isMobileView()||(this.parent.notify(ase,null),this.parent.notify(lse,null));var e=this.parent.createElement("div",{id:this.parent.element.id+"_sheet_panel",className:"e-sheet-panel"});this.parent.enableRtl&&e.classList.add("e-rtl"),this.parent.element.appendChild(e),this.parent.showSheetTabs?this.parent.notify(hse,null):(this.parent.notify(Pie,{action:"initSheetInfo"}),this.parent.notify(Pie,{action:"initiateDefinedNames"})),this.parent.isMobileView()&&(this.parent.notify(lse,null),this.parent.notify(ase,null)),this.parent.password&&(0<this.parent.password.length||this.parent.isProtected)&&(this.parent.isProtected=!0,this.parent.showSheetTabs)&&(this.parent.element.querySelector(".e-add-sheet-tab").setAttribute("disabled","true"),this.parent.element.querySelector(".e-add-sheet-tab").classList.add("e-disabled")),"None"===this.parent.selectionSettings.mode&&(this.parent.allowAutoFill=!1),this.setSheetPanelSize(),this.renderSheet(e),this.checkTopLeftCell(!this.parent.refreshing)},Pce.prototype.checkTopLeftCell=function(e,t,i,n,o,r){var s,a,l,h=this.parent.getActiveSheet(),d=(this.parent.showSpinner(),"A1"===h.topLeftCell),p=ste(h.topLeftCell),c=(h.topLeftCell!==h.paneTopLeftCell&&(h.frozenRows||h.frozenColumns)?(c=ste(h.paneTopLeftCell),s=this.parent.scrollSettings.enableVirtualization,d=h.frozenRows&&h.frozenColumns?p[0]+h.frozenRows===c[0]&&p[1]+h.frozenColumns===c[1]:h.frozenRows?p[0]+h.frozenRows===c[0]&&0===p[1]:p[1]+h.frozenColumns===c[1]&&0===p[0],p[0]&&c[0]>p[0]?this.parent.viewport.beforeFreezeHeight=Ude(h,0,p[0]-1,!0):this.parent.viewport.beforeFreezeHeight=0,p[1]&&c[1]>p[1]?this.parent.viewport.beforeFreezeWidth=$de(h,0,p[1]-1,!0):this.parent.viewport.beforeFreezeWidth=0):this.parent.viewport.beforeFreezeHeight=this.parent.viewport.beforeFreezeWidth=0,this.parent.frozenRowCount(h)),u=this.parent.frozenColCount(h);!this.parent.scrollSettings.enableVirtualization||d?(this.refreshUI({rowIndex:p[0],colIndex:p[1],refresh:"All"},null,e,t,o,r),s&&(this.parent.viewport.topIndex=Woe(h,c,!0)-c,this.parent.viewport.leftIndex=Woe(h,u,!0,"columns")-u)):(d=h.paneTopLeftCell===h.topLeftCell?p:ste(h.paneTopLeftCell),(a={preventScroll:!0}).scrollTop=i||(d[0]>c?Ude(h,c,d[0]-1,!0):0),a.scrollLeft=n||(d[1]>u?$de(h,u,d[1]-1,!0):0),this.parent.notify(oae,a),i=this.parent.getThreshold("row"),n=h.frozenRows?p[0]:p[0]>i?Woe(h,p[0]-i,!0):0,l=[],h.frozenRows&&l.push(d[0]-i>c?d[0]-i:c),i=this.parent.getThreshold("col"),p=h.frozenColumns?p[1]:p[1]>i?Woe(h,p[1]-i,!0,"columns"):0,h.frozenColumns?(l.length||l.push(c),l.push(d[1]-i>u?d[1]-i:u)):l.length&&l.push(u),this.refreshUI({rowIndex:n,colIndex:p,refresh:"All",top:a.scrollTop,left:a.scrollLeft,frozenIndexes:l},null,e,t,o,r),s&&(c&&c<=l[0]&&(this.parent.viewport.topIndex=Woe(h,l[0],!0)-c),u)&&u<=l[1]&&(this.parent.viewport.leftIndex=Woe(h,l[1],!0,"columns")-u))},Pce.prototype.renderSheet=function(e){(e=void 0===e?document.getElementById(this.parent.element.id+"_sheet_panel"):e).appendChild(this.parent.createElement("div",{className:"e-sheet",id:this.parent.element.id+"_sheet",styles:"background-color: #fff"})),this.parent.serviceLocator.getService("sheet").renderPanel()},Pce.prototype.refreshUI=function(o,r,s,a,l,h){var e,t,i,n,d,p,c,u,g,m,f,y=this,v=("All"!==o.refresh&&this.parent.showSpinner(),this.parent.serviceLocator.getService("sheet")),b=this.parent.getActiveSheet(),w=Wre(this.parent),C={rowCount:b.rowCount,colCount:b.colCount},S=(o.frozenIndexes=o.frozenIndexes||[],r=r||(this.parent.scrollSettings.enableVirtualization?(p=o.rowIndex+this.parent.viewport.rowCount+2*this.parent.getThreshold("row"),g=o.colIndex+this.parent.viewport.colCount+2*this.parent.getThreshold("col"),e=this.parent.frozenRowCount(b),t=this.parent.frozenColCount(b),o.frozenIndexes.length&&(p+=o.frozenIndexes[0]-e,g+=o.frozenIndexes[1]-t),"Row"===o.refresh?p+=e:p+=b.frozenRows,"Column"===o.refresh?g+=t:g+=b.frozenColumns,i=o.frozenIndexes[0]>e?o.frozenIndexes[0]:o.rowIndex+("Row"===o.refresh?e:b.frozenRows),p=(u=this.parent.skipHidden(i,p,"rows",!1))[1],i!==u[0]&&(c=ste(b.paneTopLeftCell))[0]===i&&this.parent.updateTopLeftCell(u[0]-e,c[1],"col"),u[0]-=e,i=b.rowCount-1,d=0,n=o.rowIndex,this.parent.scrollSettings.isFinite&&i<p&&(d=p-i,p=Woe(b,i,!1),u[0]+e>Woe(b,e,!0))&&(f=o.rowIndex-d,f=this.decreaseHidden(f=f<0?0:f,o.rowIndex-1,e),o.top&&f<o.rowIndex&&this.parent.notify(nhe,{height:Ude(b,f+e,o.rowIndex-1+e,!0),isRender:!0}),this.parent.viewport.topIndex=u[0]=f,n="Row"===o.refresh?f:n),"Row"===o.refresh?o.rowIndex=Woe(b,n+e,!0)-e:n=o.rowIndex=e?Woe(b,n,!0):u[0],m=o.frozenIndexes[1]>t?o.frozenIndexes[1]:o.colIndex+("Column"===o.refresh?t:b.frozenColumns),g=(u=this.parent.skipHidden(m,g,"columns",!1))[1],m!==u[0]&&(c=ste(b.paneTopLeftCell))[1]===m&&this.parent.updateTopLeftCell(c[0],u[0]-t,"row"),u[0]-=t,i=b.colCount-1,d=0,m=o.colIndex,this.parent.scrollSettings.isFinite&&i<g&&(d=g-i,g=Woe(b,i,!1,"columns"),u[0]+t>Woe(b,t,!0,"columns"))&&(f=o.colIndex-d,f=this.decreaseHidden(f=-1<f?f:0,o.colIndex-1,t,"columns"),o.left&&f<o.colIndex&&this.parent.notify(nhe,{width:$de(b,f+t,o.colIndex-1+t,!0),isRender:!0}),this.parent.viewport.leftIndex=u[0]=f,m="Column"===o.refresh?f:m),"Column"===o.refresh?o.colIndex=Woe(b,m+t,!0,"columns")-t:m=o.colIndex=t?Woe(b,m,!0,"columns"):u[0],"Row"===o.refresh&&(n+=e,e&&(p+=ste(b.topLeftCell)[0]),g=this.parent.viewport.rightIndex),"Column"===o.refresh&&(m+=t,t&&(g+=ste(b.topLeftCell)[1]),p=this.parent.viewport.bottomIndex),this.parent.viewport.topIndex=o.rowIndex,this.parent.viewport.bottomIndex=p,this.parent.viewport.leftIndex=o.colIndex,this.parent.viewport.rightIndex=g,lte(n,m)+":"+lte(p,g)):("All"===o.refresh&&this.updateTopLeftScrollPosition(Pe(o,{sheet:b})),this.parent.viewport.bottomIndex=b.rowCount-1,this.parent.viewport.rightIndex=b.colCount-1,lte(o.rowIndex,o.colIndex)+":"+lte(this.parent.viewport.bottomIndex,this.parent.viewport.rightIndex))),"All"===o.refresh&&this.parent.trigger(Wse,{}),this.parent.isOpen||this.parent.refreshing),A=(jpe(this.parent.getMainContent(),{busy:!0}),this.parent.sheets.length);Cre(this.parent,w+"!"+r,null,null,o.frozenIndexes).then(function(e){if(y.parent&&!(A<y.parent.sheets.length)){var t=Fre(y.parent,b.id);if(l||void 0!==t&&t===y.parent.activeSheetIndex){var i,n=[o.rowIndex,o.colIndex].concat(ste(r.split(":")[1]));switch(o.refresh){case"All":v.renderTable({cells:e,indexes:n,top:o.top,left:o.left,initLoad:s,isRefreshing:a,isOpen:S,openOptions:h});break;case"Row":v.refreshRowContent({cells:e,indexes:n,skipUpdateOnFirst:o.skipUpdateOnFirst,prevRowColCnt:C}),y.parent.notify(pse,i={isEdit:!1}),i.isEdit&&y.parent.notify(mse,{action:"startEdit",refreshCurPos:!1});break;case"Column":v.refreshColumnContent({cells:e,indexes:n,skipUpdateOnFirst:o.skipUpdateOnFirst,prevRowColCnt:C,insertDelete:o.insertDelete});break;case"RowPart":v.updateRowContent({cells:e,indexes:n,direction:o.direction,skipUpdateOnFirst:o.skipUpdateOnFirst,prevRowColCnt:C});break;case"ColumnPart":v.updateColContent({cells:e,indexes:n,direction:o.direction,skipUpdateOnFirst:o.skipUpdateOnFirst,prevRowColCnt:C})}y.parent&&y.parent.isReact&&y.parent.renderReactTemplates()}else-1<t&&y.checkTopLeftCell()}}),this.parent.notify(Ise,{refresh:o.refresh,skipTranslate:o.skipTranslate})},Pce.prototype.updateTopLeftScrollPosition=function(e){var t,i=ste(e.sheet.topLeftCell),n=ste(e.sheet.paneTopLeftCell);e.sheet.frozenRows?(t=this.parent.frozenRowCount(e.sheet),n[0]>t&&(e.top=Ude(e.sheet,t,n[0]-1,!0))):(e.rowIndex&&(e.rowIndex=0),0!==i[0]&&(e.top=Ude(e.sheet,0,i[0]-1,!0))),e.sheet.frozenColumns?(t=this.parent.frozenColCount(e.sheet),n[1]>t&&(e.left=$de(e.sheet,t,n[1]-1,!0))):(e.colIndex&&(e.colIndex=0),0!==i[1]&&(e.left=$de(e.sheet,0,i[1]-1,!0)))},Pce.prototype.removeSheet=function(){document.getElementById(this.parent.element.id+"_sheet")&&ue(document.getElementById(this.parent.element.id+"_sheet"))},Pce.prototype.refreshSheet=function(e,t,i,n,o){var r=0,s=0;t&&((t=this.parent.element.getElementsByClassName("e-main-panel")[0])&&(r=t.scrollTop),t=this.parent.getMainContent())&&(s=t.scrollLeft),this.removeSheet(),this.renderSheet(),this.parent.notify(rae,{}),this.checkTopLeftCell(!1,e,r,s,n,o),i&&sce(this.parent.element)},Pce.prototype.setSheetPanelSize=function(e){var t,i,n=document.getElementById(this.parent.element.id+"_sheet_panel"),o=this.parent.element.getBoundingClientRect(),r=(this.parent.viewport.scaleY=this.parent.viewport.scaleX=1,this.parent.enableScaling&&(1!=(i=(r=this.parent.element.offsetHeight)/o.height)&&Math.abs(r-o.height)>=.1*r&&(this.parent.viewport.scaleY=i),1!=(i=(r=this.parent.element.offsetWidth)/o.width))&&Math.abs(r-o.width)>=.1*r&&(this.parent.viewport.scaleX=i),"auto"===this.parent.height?(n.style.height="260px",t=230):(t=o.height*this.parent.viewport.scaleY-vpe(n,null,this.parent.viewport.scaleY),n.style.height=t+"px",t-=32/this.parent.viewport.scaleY),void 0!==e&&(this.colMinWidth=e),this.parent.viewport.height=t,o.width*this.parent.viewport.scaleX);this.parent.viewport.width=r-32/this.parent.viewport.scaleX,this.parent.viewport.rowCount=this.roundValue(t,20),this.parent.viewport.colCount=this.roundValue(r,this.colMinWidth||64)},Pce.prototype.roundValue=function(e,t){e/=t,t=Math.round(e);return Math.abs(e-t)<.5?t:t-1},Pce.prototype.moveOrDuplicateSheetHandler=function(e){this.parent.notify(dse,null),e.refresh&&this.refreshSheet(e.isDuplicate)},Pce.prototype.decreaseHidden=function(e,t,i,n){void 0===n&&(n="rows"),e+=i,t+=i;for(var o=this.parent.getActiveSheet(),r=t;e<=r;r--)if(o[""+n][r]&&o[""+n][r].hidden&&--e<i){e=Woe(o,i,!0,n);break}return e-i},Pce.prototype.instantiateRenderer=function(){this.parent.serviceLocator.register("cell",new Dce(this.parent)),this.parent.serviceLocator.register("row",new Tce(this.parent)),this.parent.serviceLocator.register("sheet",new xce(this.parent))},Pce.prototype.destroy=function(){this.removeEventListener(),this.parent.serviceLocator.getService("row").destroy(),this.parent.serviceLocator.getService("cell").destroy(),this.colMinWidth&&(this.colMinWidth=null),this.parent=null},Pce.prototype.addEventListener=function(){this.parent.on(gse,this.destroy,this),this.parent.on(ioe,this.moveOrDuplicateSheetHandler,this),this.parent.on(ohe,this.updateTopLeftScrollPosition,this)},Pce.prototype.removeEventListener=function(){this.parent.off(gse,this.destroy),this.parent.off(ioe,this.moveOrDuplicateSheetHandler),this.parent.off(ohe,this.updateTopLeftScrollPosition)};var kce=Pce;function Pce(e){this.parent=e,this.addEventListener(),this.instantiateRenderer()}var Bce=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},Fce=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Lce=(Rce.prototype.init=function(){this.parent.element.appendChild(this.parent.createElement("input",{className:"e-clipboard",attrs:{contenteditable:"true",tabindex:"-1","aria-hidden":"true"}}))},Rce.prototype.addEventListener=function(){var e=this.getClipboardEle();this.parent.on(Vse,this.cut,this),this.parent.on(_se,this.copy,this),this.parent.on(Hse,this.paste,this),this.parent.on(zse,this.clearCopiedInfo,this),this.parent.on(Rse,this.tabSwitchHandler,this),this.parent.on(Mse,this.cMenuBeforeOpenHandler,this),this.parent.on(Fse,this.ribbonClickHandler,this),this.parent.on(cse,this.initCopyIndicator,this),this.parent.on(iae,this.rowHeightChanged,this),this.parent.on(nae,this.colWidthChanged,this),this.parent.on(hoe,this.refreshOnInsertDelete,this),E.add(e,"cut",this.cut,this),E.add(e,"copy",this.copy,this),E.add(e,"paste",this.paste,this)},Rce.prototype.removeEventListener=function(){var e=this.getClipboardEle();this.parent.isDestroyed||(this.parent.off(Vse,this.cut),this.parent.off(_se,this.copy),this.parent.off(Hse,this.paste),this.parent.off(zse,this.clearCopiedInfo),this.parent.off(Rse,this.tabSwitchHandler),this.parent.off(Mse,this.cMenuBeforeOpenHandler),this.parent.off(Fse,this.ribbonClickHandler),this.parent.off(cse,this.initCopyIndicator),this.parent.off(iae,this.rowHeightChanged),this.parent.off(nae,this.colWidthChanged),this.parent.off(hoe,this.refreshOnInsertDelete)),E.remove(e,"cut",this.cut),E.remove(e,"copy",this.copy),E.remove(e,"paste",this.paste)},Rce.prototype.ribbonClickHandler=function(e){var t=this.parent.element.id;switch(e.item.id){case t+"_cut":this.cut({invokeCopy:!0});break;case t+"_copy":this.copy({invokeCopy:!0})}},Rce.prototype.tabSwitchHandler=function(e){0!==e.activeTab||this.copiedInfo||this.copiedShapeInfo||this.hidePaste()},Rce.prototype.cMenuBeforeOpenHandler=function(e){var t=this.parent.getActiveSheet(),i=this.parent.serviceLocator.getService(ope),n=ste(t.activeCell),o=Kre(n[0],n[1],t),r=t.isProtected&&Hoe(o,Kde(t,n[1])),o=sre(o,Kde(t,n[1]),_de(t,n[0]));"Content"!==e.target&&"RowHeader"!==e.target&&"ColumnHeader"!==e.target&&"SelectAll"!==e.target||(this.parent.enableContextMenuItems([i.getConstant("Paste"),i.getConstant("PasteSpecial")],!!(this.copiedInfo||this.copiedShapeInfo&&!r)),this.parent.enableContextMenuItems([i.getConstant("Cut")],!r)),"Content"===e.target&&(t.isProtected&&this.parent.enableContextMenuItems([i.getConstant("Filter"),i.getConstant("Sort"),i.getConstant("AddNote")],!1),r?this.parent.enableContextMenuItems([i.getConstant("Cut"),i.getConstant("Hyperlink"),i.getConstant("EditNote"),i.getConstant("DeleteNote")],!1):o?this.parent.enableContextMenuItems([i.getConstant("Cut"),i.getConstant("Paste"),i.getConstant("PasteSpecial"),i.getConstant("Filter"),i.getConstant("Sort"),i.getConstant("Hyperlink"),i.getConstant("EditHyperlink"),i.getConstant("OpenHyperlink"),i.getConstant("RemoveHyperlink"),i.getConstant("AddNote")],!1):t.isProtected&&!t.protectSettings.insertLink&&this.parent.enableContextMenuItems([i.getConstant("Hyperlink")],!1)),t.isProtected&&("ColumnHeader"===e.target&&(n=[i.getConstant("DeleteColumn"),i.getConstant("DeleteColumns"),i.getConstant("InsertColumn"),i.getConstant("InsertColumns")],r=[i.getConstant("HideColumn"),i.getConstant("HideColumns"),i.getConstant("UnhideColumns")],this.parent.enableContextMenuItems(n,!1),this.parent.enableContextMenuItems(r,t.protectSettings.formatColumns)),"RowHeader"===e.target)&&(o=[i.getConstant("DeleteRow"),i.getConstant("DeleteRows"),i.getConstant("InsertRow"),i.getConstant("InsertRows")],n=[i.getConstant("HideRow"),i.getConstant("HideRows"),i.getConstant("UnhideRows")],this.parent.enableContextMenuItems(o,!1),this.parent.enableContextMenuItems(n,t.protectSettings.formatRows))},Rce.prototype.rowHeightChanged=function(e){var t;this.copiedInfo&&(t=this.getCopyIndicator())&&(this.copiedInfo.range[0]>e.rowIdx?t.style.top=parseFloat(t.style.top)+e.threshold+"px":Ooe(this.copiedInfo.range,e.rowIdx,this.copiedInfo.range[1])&&(t.style.height=parseFloat(t.style.height)+e.threshold+"px"))},Rce.prototype.colWidthChanged=function(e){var t;this.copiedInfo&&(t=this.getCopyIndicator())&&(this.copiedInfo.range[1]>e.colIdx?t.style.left=parseFloat(t.style.left)+e.threshold+"px":Ooe(this.copiedInfo.range,this.copiedInfo.range[0],e.colIdx)&&(t.style.width=parseFloat(t.style.width)+e.threshold+"px"))},Rce.prototype.cut=function(e){this.setCopiedInfo(e,!0)},Rce.prototype.copy=function(e){this.setCopiedInfo(e,!1)},Rce.prototype.paste=function(e){var O=this;if(this.parent.isEdit||0<this.parent.element.getElementsByClassName("e-dlg-overlay").length)this.parent.element.getElementsByClassName("e-spreadsheet-edit")[0].style.height="auto";else{var t,i=e&&e.clipboardData||window.clipboardData;if(!(i&&e.clipboardData&&e.clipboardData.getData("isInternalCut").length)||this.copiedInfo)if(i||this.copiedShapeInfo||e.isInternal&&this.copiedInfo){e.isInternal=!i;var N=void 0,n=this.getCopiedIdx(),o=(e.isAction=!!i||e.isAction,e&&-1<e.sIdx?e.sIdx:this.parent.activeSheetIndex),r=_re(this.parent,o),s=fte(e&&e.range||rte(r.selectedRange)),a=void 0,l=void 0;if(i){if(l=(a=this.getExternalCells(e)).model,!e.isInternal&&a.internal&&(i=!1,!this.copiedInfo))return;if(!l||!l.length){if(a.file)return void this.parent.notify(Cle,{file:a.file});if(!this.copiedInfo)return;i=!1}}var h,d,p,c=Object.assign({isExternal:i},this.copiedInfo),V=void 0,_=void 0,u=void 0,g=void 0,m=void 0,f=void 0,y=(i?(d=o,p=_re(this.parent,d),V={},u="Sheet"!==(g=a.selection)&&(s[2]-s[0]+1)%a.rowCount==0&&(s[3]-s[1]+1)%a.colCount==0,h=[0,0,a.usedRowIndex,a.usedColIndex]):(h=fte(this.copiedShapeInfo?rte(r.selectedRange):this.copiedInfo.range),d=n,V=Kde(r,h[1]),_=vte(h)&&this.isRangeMerged(s,r),p=_re(this.parent,d),u=!_&&(s[2]-s[0]+1)%(h[2]-h[0]+1)==0&&(s[3]-s[1]+1)%(h[3]-h[1]+1)==0,p&&(m=0===h[1]&&h[3]===p.colCount-1,f=0===h[0]&&h[2]===p.rowCount-1,m?(f?(g="Sheet",h[2]=p.usedRange.rowIndex):g="Row",h[3]=p.usedRange.colIndex):f&&(g="Column",h[2]=p.usedRange.rowIndex))),t=u?s:[s[0],s[1]].concat([s[0]+h[2]-h[0],s[1]+h[3]-h[1]||s[1]]),g&&(("Sheet"===g||"Column"===g)&&t[2]<r.usedRange.rowIndex&&(t[2]=r.usedRange.rowIndex),"Sheet"===g||"Row"===g)&&t[3]<r.usedRange.colIndex&&(t[3]=r.usedRange.colIndex),e&&e.type||"All");if(are(this.parent,t))this.parent.notify(ele,null);else if(r.isProtected&&ace(this.parent,t))this.parent.notify($ae,null);else{if(e.isAction&&!this.copiedShapeInfo){var v={requestType:"paste",copiedInfo:this.copiedInfo,copiedRange:hte(h),pastedRange:hte(t),type:y,cancel:!1};if(this.parent.notify(fie,{eventArgs:v,action:"clipboard"}),v.cancel)return;s=rte(v.pastedRange),t=(u=i?"Sheet"!==a.selection&&(s[2]-s[0]+1)%a.rowCount==0&&(s[3]-s[1]+1)%a.colCount==0:!_&&!m&&(s[2]-s[0]+1)%(h[2]-h[0]+1)==0&&!f&&(s[3]-s[1]+1)%(h[3]-h[1]+1)==0)?s:[s[0],s[1]].concat([s[0]+h[2]-h[0],s[1]+h[3]-h[1]||s[1]]),y=v.type}var a=void 0,b=(g?(a=[].concat(t),"Sheet"!==g&&"Column"!==g||(t[2]<r.usedRange.rowIndex&&(t[2]=r.usedRange.rowIndex),h[2]<r.usedRange.rowIndex&&(h[2]+=r.usedRange.rowIndex-h[2]),a[2]<r.rowCount&&(a[2]=r.rowCount-1)),"Sheet"!==g&&"Row"!==g||(t[3]<r.usedRange.colIndex&&(h[3]+=r.usedRange.colIndex-t[3],t[3]=r.usedRange.colIndex),h[3]<r.usedRange.colIndex&&(h[3]+=r.usedRange.colIndex-h[3]),a[3]<r.colCount&&(a[3]=r.colCount-1))):a=t,void 0),H=void 0,w=void 0,C=s[0],z=[];if(r.isProtected&&ace(this.parent,t))this.parent.notify($ae,null);else if(this.copiedShapeInfo&&!this.copiedInfo){v=this.copiedShapeInfo.pictureElem,v=(v.classList.contains("e-datavisualization-chart")?(this.copiedShapeInfo.chartInfo.top=null,this.copiedShapeInfo.chartInfo.left=null,this.parent.notify(Qne,{chart:[this.copiedShapeInfo.chartInfo],isInitCell:!0,isUndoRedo:!0,isPaste:!0,dataSheetIdx:this.copiedShapeInfo.sheetIdx,isCut:this.copiedShapeInfo.isCut,sheetId:r.id,range:e.range||r.name+"!"+r.selectedRange})):this.parent.notify(Tle,{options:{src:v.style.backgroundImage.replace(/url\((['"])?(.*?)\1\)/gi,"$2"),height:this.copiedShapeInfo.height,width:this.copiedShapeInfo.width,id:this.copiedShapeInfo.isCut?v.id:""},range:hte([C,s[1],C,s[1]]),isPublic:!1,isUndoRedo:!0}),Kre(C,s[1],r));v&&!je(v.image)&&0<v.image.length&&(L={requestType:"imagePaste",copiedShapeInfo:this.copiedShapeInfo,pasteSheetIndex:this.parent.activeSheetIndex,pastedRange:Wre(this.parent)+"!"+hte([C,s[1],C,s[1]]),pastedPictureElement:document.getElementById(v.image[v.image.length-1].id)},this.parent.notify(Vae,{eventArgs:L,action:"clipboard"}))}else{for(var j=[],W=this.isInRange(h,s,n),Q=!1,U=!1,q=0,S=[],A=void 0,G=(u||"Values"===y||(A=this.setCF(h,t,p,r,S,A)),!1),Y=[],v={sheet:r,isExternal:!!i},X=this.setCell(v),K=!i&&this.copiedInfo.isCut&&this.setCell({sheet:p}),J=[],Z=[],x=h[0],I=0;x<=h[2];x++,I++)if(i||c.isCut||!jde(p,x)){W&&(j[s[0]+I]={cells:[]});for(var $,ee,T,E=h[1],D=0;E<=h[3];E++,D++){if(W&&(j[s[0]+I].cells[s[1]+D]=Kre(s[0]+I,s[1]+D,p,!1,!0)),b=i?l[x]&&l[x].cells[E]||{}:Pe({},W&&j[x]&&j[x].cells[E]?j[x].cells[E]:Kre(x,E,p),null,!0),V=Kde(p,E),!b.validation&&tpe(V,x,E)&&(T=Object.assign({},V.validation),ne=[0,h[1],0,h[3]],$=T.value1,ee=T.value2,Poe($)&&(T.value1=Uoe([x,E],ne,p,this.parent,{formula:$})),Poe(ee)&&(T.value2=Uoe([x,E],ne,p,this.parent,{formula:ee})),b.validation=T),b&&b.isReadOnly&&delete b.isReadOnly,(m||f)&&(b&&b.rowSpan&&(0<b.rowSpan?b.rowSpan+x-1<=h[2]?Q=!0:b={}:(!Q||b.rowSpan<0&&($=b.rowSpan,ee=b.colSpan||0,T=Kre(C+$,s[1]+D+ee,r))&&!T.rowSpan)&&(b={})),b)&&b.colSpan&&(0<b.colSpan?b.colSpan+E-1<=h[3]?U=!0:b={}:U||(b={})),b&&y){var te=void 0;switch(y){case"Formats":te={format:b.format,style:b.style},this.copiedInfo&&!this.copiedInfo.isCut&&(b.rowSpan&&(te.rowSpan=b.rowSpan),b.colSpan)&&(te.colSpan=b.colSpan),b=te;break;case"Values":(b={value:b.value}).value&&-1<b.value.toString().indexOf("\n")&&this.parent.getCell(s[0],s[1]).classList.add("e-alt-unwrap")}H=-1<["Formats","Values"].indexOf(y)}if(!this.parent.scrollSettings.isFinite&&(h[2]-h[0]>1048575-s[0]||h[3]-h[1]>16383-s[1])||this.parent.scrollSettings.isFinite&&(h[2]-h[0]>r.rowCount-1-s[0]||h[3]-h[1]>r.colCount-1-s[1]))return void this.showDialog();if(u){for(var M=s[0];M<=s[2];M+=h[2]-h[0]+1)if(c.isCut||q||!jde(r,M+I))for(var k=s[1];k<=s[3];k+=h[3]-h[1]+1){if(x!==h[0]||E!==h[1]||void 0!==A&&!A.length||"Values"===y||(A=this.setCF(h,[M,k,M+(h[2]-h[0]),k+(h[3]-h[1])],p,r,S,A)),w=Kre(M+I,k+D,r,!1,!0),!(i||je(w.colSpan)&&je(w.rowSpan))){if(m||f)continue;var P={range:[M+I,k+D,M+I,k+D],merge:!1,isAction:!1,type:"All",sheetIndex:o,preventRefresh:o!==this.parent.activeSheetIndex};z.push(P),this.parent.notify(Bne,P)}var ie,ne,P=k+D,B=(b=Pe({},b||{},null,!0),H||!this.copiedInfo||this.copiedInfo.isCut||!b.formula||je(ie=Uoe([M+I,P],[x,E],p,this.parent,W?b:null))||(b.formula=ie),this.copiedInfo&&!this.copiedInfo.isCut&&b.validation&&(B=Uoe(ie=s,ne=h,p,this.parent,{formula:b.validation.value1}),b.validation.value1=B,""!==b.validation.value2)&&(B=Uoe(ie,ne,p,this.parent,{formula:b.validation.value2}),b.validation.value2=B),r.isProtected&&b&&!1!==b.isLocked&&(b.isLocked=w.isLocked),w&&w.formula&&-1<w.formula.indexOf("=UNIQUE(")&&this.parent.notify(Qie,null),{cellIdx:[x,E],isUnique:!1,uniqueRange:"",sheetName:p.name});this.parent.notify(Uie,B),B.isUnique&&(b.value=null),G=!1,b&&b.formula&&-1<b.formula.indexOf("=UNIQUE(")&&(G=!0,Y.push([M,P]),b.value=null),X(M+I,P,b,P===s[3],H,G,e.beforeActionData,e.isUndo)||b.formula&&this.copiedInfo&&this.copiedInfo.isCut&&this.parent.notify(Gie,{cellRef:hte([x,E,x,E])})}}else!i&&Ype(this.parent,x,E,n)||(_?X(C,s[1]+D,{value:b.value},E===h[3],!0):X(C,s[1]+D,b,E===h[3],H));if(!i&&this.copiedInfo.isCut&&(!Ooe(s,x,E)||n!==this.parent.activeSheetIndex)){var F=Kre(x,E,p);if(F){if(F.isReadOnly)continue;if(F.isLocked||je(F.isLocked)){if(!m&&!f||void 0===F.rowSpan&&void 0===F.colSpan)!F.validation&&p.columns[E]&&p.columns[E].validation&&-1===Z.indexOf(E)&&Z.push(E);else{if(!(1<F.rowSpan||1<F.colSpan))continue;J.push({range:[x,E,x,E],rowSpan:F.rowSpan,colSpan:F.colSpan})}F=null}else!1===F.isLocked&&(F=p.isProtected?{isLocked:!1}:null)}K(x,E,F,E===h[3])}}C++}else I--,q++;if(J.length&&J.forEach(function(e){Jre(e.range[0],e.range[1],p,{rowSpan:e.rowSpan,colSpan:e.colSpan});var t={range:e.range};O.parent.notify(Lne,t),O.parent.notify(Bne,{merge:!1,range:t.range,type:"All",sheetIndex:d,preventRefresh:d!==O.parent.activeSheetIndex});for(var i=t.range[0];i<=t.range[2];i++)for(var n=t.range[1];n<=t.range[3];n++)K(i,n,null)}),Z.length&&Z.forEach(function(e){O.parent.notify(une,{range:p.name+"!"+hte([h[0],e,h[2],e]),isRemoveValidation:!0})}),Y.length)for(x=0;x<Y.length;x++)this.parent.serviceLocator.getService("cell").refresh(Y[x][0],Y[x][1]);v.isRandFormula&&"Automatic"===this.parent.calculationMode&&this.parent.notify(Pie,{action:"refreshRandomFormula"}),this.parent.notify(qne,null);var L,v=t[2]-q,R=a[2]-q,v=(t[2]=v,a[2]=R,this.parent.setUsedRange(t[2],t[3]),hte(a)),R=(o!==this.parent.activeSheetIndex||e.isFromUpdateAction||this.parent.notify(Ose,{address:v}),!i&&this.copiedInfo.isCut&&(N=this.copiedInfo.isCut,n===this.parent.activeSheetIndex&&this.parent.serviceLocator.getService("cell").refreshRange(h),this.clearCopiedInfo()),(i||W)&&this.copiedInfo&&this.clearCopiedInfo(),void 0),a=(N&&(A&&A.length&&"Values"!==y&&(R={range:h,sheetIdx:d,isClear:!0},this.parent.notify(Hne,R)),oce(p,h[0],h[1],(this.parent.getRow(h[0],null,this.parent.frozenColCount(p))||{offsetHeight:20}).offsetHeight),oe=rce(p,h[0]),Xpe(this.parent,p,oe,h[0])),S.length&&o===this.parent.activeSheetIndex&&this.parent.notify(_ne,{cfModel:S,isAction:!0}),_re(this.parent,n));if(!i&&h[0]===h[2]&&"Row"===g){for(var oe=a.rows[h[0]].height,x=s[0];x<=s[2];x++)Xpe(this.parent,this.parent.getActiveSheet(),oe,x);N&&(g=a&&a.standardHeight?a.standardHeight:20,Xpe(this.parent,a,g,h[0]))}e.isAction&&(L={requestType:"paste",copiedInfo:c,mergeCollection:z,pasteSheetIndex:this.parent.activeSheetIndex,copiedRange:p.name+"!"+(c.range?hte(c.range):p.selectedRange),pastedRange:r.name+"!"+hte(t),type:y||"All",selectedRange:v},q&&(L.skipFilterCheck=!0),R&&R.cfClearActionArgs&&(L.cfClearActionArgs=R.cfClearActionArgs),S.length&&(L.cfActionArgs={cfModel:S,sheetIdx:o}),this.parent.notify(Vae,{eventArgs:L,action:"clipboard"})),e.focus&&sce(this.parent.element)}}}else this.getClipboardEle().select()}},Rce.prototype.setCF=function(t,i,e,n,o,r){function s(e){a=[i[0]+(l[0]<=t[0]?0:l[0]-t[0]),i[1]+(l[1]<=t[1]?0:l[1]-t[1]),i[2]-(l[2]>=t[2]?0:t[2]-l[2]),i[3]-(l[3]>=t[3]?0:t[3]-l[3])],n.conditionalFormats||h.parent.setSheetPropertyOnMute(n,"conditionalFormats",[]),e={range:hte(a),type:e.type,cFColor:e.cFColor,value:e.value,format:e.format},n.conditionalFormats.push(e),o.push(e)}var a,l,h=this;if(r)for(var d=0,p=r.length;d<p;d++)l=rte(r[d].range),s(r[d]);else if(r=[],e.conditionalFormats)for(d=0,p=e.conditionalFormats.length;d<p;d++)l=rte(e.conditionalFormats[d].range),$oe([t],e.conditionalFormats[d].range)&&(r.push(e.conditionalFormats[d]),s(e.conditionalFormats[d]));return r},Rce.prototype.isRangeMerged=function(e,t){var t=Kre(e[0],e[1],t);return!(!t||!(1<t.colSpan||1<t.rowSpan))&&(t={range:e.slice(2,4).concat(e.slice(2,4))},this.parent.notify(Rne,t),t.range[0]===e[0])&&t.range[1]===e[1]&&t.range[2]===e[2]&&t.range[3]===e[3]},Rce.prototype.updateFilter=function(e,t){var i;this.parent.notify(wie,null);for(var n,o,r=0;r<this.parent.sheets.length;r++)this.parent.filterCollection&&this.parent.filterCollection[r]&&this.parent.filterCollection[r].sheetIndex===Fre(this.parent,e.sId)&&(o=e.range,n=rte(this.parent.filterCollection[r].filterRange),o=fte(o),n[0]===o[0])&&n[2]===o[2]&&n[1]===o[1]&&n[3]===o[3]&&(i=!0,d=[Math.abs(o[0]-n[0]),Math.abs(o[1]-n[1]),Math.abs(o[2]-n[2]),Math.abs(o[3]-n[3])]);var s=this.parent.getCell(e.range[0],e.range[1]),a=(s=s&&(s.querySelector(".e-filter-icon")?s:this.parent.getCell(e.range[2],e.range[3])))&&s.querySelector(".e-sortasc-filter"),l=s&&s.querySelector(".e-sortdesc-filter");if(i)for(var h=0;h<this.parent.filterCollection.length;h++){var d,p=this.parent.filterCollection[h],c=e&&e.sId?Fre(this.parent,e.sId):this.parent.activeSheetIndex;p.sheetIndex===c&&this.parent.notify(Pae,{predicates:null,range:p.filterRange,sIdx:c,isCut:!0}),p.sheetIndex===c&&c===this.parent.activeSheetIndex&&(d=[t[0]+d[0],t[1]+d[1],Math.abs(t[2]-d[2]),Math.abs(t[3]-d[3])],this.parent.notify(Pae,{predicates:null,range:hte(d),sIdx:null,isCut:!0}),e.range[3]===e.range[1])&&(p=this.parent.getCell(t[0],t[1]),a&&p&&p.querySelector(".e-filter-icon").classList.add("e-sortasc-filter"),l)&&p&&p.querySelector(".e-filter-icon").classList.add("e-sortdesc-filter")}},Rce.prototype.isInRange=function(e,t,i){var n=this.parent.activeSheetIndex;return Ooe(e,t[0],t[1])&&i===n||Ooe(e,t[2],t[3])&&i===n},Rce.prototype.setCell=function(l){var h=this,d=l.sheet,p=d.name===this.parent.getActiveSheet().name;return function(e,t,i,n,o,r,s,a){i&&i.formula&&(-1<i.formula.indexOf("RANDBETWEEN(")||-1<i.formula.indexOf("RAND(")||-1<i.formula.indexOf("NOW("))&&(l.isRandFormula=!0);o=Yoe(h.parent,d,{cell:i,rowIdx:e,colIdx:t,pvtExtend:!o,valChange:!r,lastCell:n,uiRefresh:p,requestType:"paste",skipFormatCheck:!l.isExternal,isRandomFormula:l.isRandFormula},s,a);return!o&&i&&i.style&&l.isExternal&&(r=nce(h.parent,e,t,d,i.style||h.parent.cellStyle,i.wrap?$pe(h.parent.getDisplayText(i),ice(d,e,t,1<i.colSpan?t+i.colSpan-1:t),i.style,h.parent.cellStyle):1),r=Math.round(r),oce(d,e,t,r=r<20?20:r),Ude(d,e)<(n=rce(d,e)))&&Xpe(h.parent,d,n,e),o}},Rce.prototype.getCopiedIdx=function(){if(this.copiedInfo){for(var e=0;e<this.parent.sheets.length;e++)if(this.parent.sheets[e].id===this.copiedInfo.sId)return e;this.clearCopiedInfo()}return-1},Rce.prototype.setCopiedInfo=function(i,n){var o=this;if(!this.parent.isEdit){var e,r=new ll,s=(i.promise=r.promise,this.parent.getActiveSheet()),a=i&&i.range?(t=0===i.range[1]&&i.range[3]===s.colCount-1,l=0===i.range[0]&&i.range[2]===s.rowCount-1,e={range:i.range},t||l||this.parent.notify(Lne,e),e.range):rte(s.selectedRange);if(n&&are(this.parent,a))this.parent.notify(ele,null);else{if(i&&!i.isPublic&&!i.clipboardData){var t={copiedRange:s.name+"!"+hte(a),cancel:!1,action:n?"cut":"copy"};if(this.parent.notify(fie,t),t.cancel)return}var l={sheet:s,indexes:[0,0,s.rowCount-1,s.colCount-1],isFinite:this.parent.scrollSettings.isFinite,promise:new Promise(function(e){e(void 0)})},h=document.getElementsByClassName("e-ss-overlay-active"),d=h.length;!s.isLocalData||i&&i.clipboardData||0!==a[0]||a[2]!==s.rowCount-1||d||(this.parent.showSpinner(),this.parent.notify("updateSheetFromDataSource",l)),this.checkForUncalculatedFormula(a,i&&i.sId?i.sId:s.id),l.promise.then(function(){var e,t;0<d?(t={clientY:h[0].offsetTop,isImage:!0},o.parent.notify(xle,t),e={clientX:h[0].offsetLeft,isImage:!0},o.parent.notify(Ile,e),o.copiedShapeInfo={sId:i&&i.sId?i.sId:s.id,sheetIdx:s.index,isCut:n,pictureElem:h[0],copiedRange:hte([t.clientY,e.clientX,t.clientY,e.clientX]),height:h[0].offsetHeight,width:h[0].offsetWidth,chartInfo:o.getChartElemInfo(h[0])},h[0].classList.contains("e-datavisualization-chart")||(t=window.getComputedStyle(h[0]).backgroundImage.slice(5,-2),o.addImgToClipboard(t,o.copiedShapeInfo.height,o.copiedShapeInfo.width)),o.hidePaste(!0),n&&(h[0].classList.contains("e-datavisualization-chart")?o.parent.deleteChart(o.copiedShapeInfo.chartInfo.id):o.parent.notify(Ele,{id:o.copiedShapeInfo.pictureElem.id,sheetIdx:o.copiedShapeInfo.sId,range:o.copiedShapeInfo.copiedRange}))):i&&i.clipboardData||(o.copiedInfo&&o.clearCopiedInfo(),o.copiedInfo={range:a,sId:i&&i.sId?i.sId:s.id,isCut:n},o.hidePaste(!0),i.isFromUpdateAction||o.initCopyIndicator(),F.isIE||o.getClipboardEle().select(),i&&i.invokeCopy&&document.execCommand(n?"cut":"copy"),o.parent.hideSpinner()),F.isIE&&o.setExternalCells(i,n),r.resolve()}),i&&i.clipboardData&&(this.setExternalCells(i,n),this.getClipboardEle().setAttribute("aria-label",s.selectedRange+" "+this.parent.serviceLocator.getService(ope).getConstant(n?"Cut":"Copy")))}}},Rce.prototype.imageToCanvas=function(o,r,s){return new Promise(function(t){var e=document.createElement("canvas"),i=e.getContext("2d"),n=new Image;n.src=o,n.crossOrigin="anonymous",n.onload=function(){e.width=s,e.height=r,i.drawImage(n,0,0,s,r),e.toBlob(function(e){t(e)},"image/png")}})},Rce.prototype.addImgToClipboard=function(o,r,s){return Bce(this,void 0,void 0,function(){var t,i,n;return Fce(this,function(e){switch(e.label){case 0:return i=window.navigator,[4,this.imageToCanvas(o,r,s)];case 1:return n=e.sent(),[4,i.clipboard.write([new ClipboardItem(((t={})[n.type]=n,t))])];case 2:return e.sent(),[2]}})})},Rce.prototype.checkForUncalculatedFormula=function(e,t){for(var i,n=Fre(this.parent,t),o=_re(this.parent,n),r=e[0];r<=e[2];r++)for(var s=e[1];s<=e[3];s++)(i=Kre(r,s,o,null,!0)).formula&&ee(i.value)&&this.parent.notify(Pie,{action:"refreshCalculate",value:i.formula,rowIndex:r,colIndex:s,isFormula:Poe(i.formula),sheetIndex:n})},Rce.prototype.getChartElemInfo=function(e){var t=this.parent.chartColl;if(e.classList.contains("e-datavisualization-chart"))for(var i=e.getElementsByClassName("e-control")[0].id,n=0;n<t.length;n++)if(t[n].id===i)return t[n];return null},Rce.prototype.clearCopiedInfo=function(){this.copiedInfo&&(this.parent.getActiveSheet().id===this.copiedInfo.sId&&(this.removeIndicator(this.parent.getSelectAllContent()),this.removeIndicator(this.parent.getColumnHeaderContent()),this.removeIndicator(this.parent.getRowHeaderContent()),this.removeIndicator(this.parent.getMainContent())),this.copiedInfo=null,this.hidePaste()),this.copiedShapeInfo&&(this.copiedShapeInfo=null,this.hidePaste())},Rce.prototype.removeIndicator=function(e){e&&(e=e.getElementsByClassName("e-copy-indicator")[0])&&G(e)},Rce.prototype.initCopyIndicator=function(){var e;this.copiedInfo&&this.parent.getActiveSheet().id===this.copiedInfo.sId&&((e=this.parent.createElement("div",{className:"e-copy-indicator"})).appendChild(this.parent.createElement("div",{className:"e-top"})),e.appendChild(this.parent.createElement("div",{className:"e-bottom"})),e.appendChild(this.parent.createElement("div",{className:"e-left"})),e.appendChild(this.parent.createElement("div",{className:"e-right"})),Spe(this.parent,e,this.copiedInfo.range,"e-copy-indicator"))},Rce.prototype.showDialog=function(){var i=this;this.parent.serviceLocator.getService(rpe).show({header:"Spreadsheet",height:205,width:340,isModal:!0,showCloseIcon:!0,content:this.parent.serviceLocator.getService(ope).getConstant("PasteAlert"),beforeOpen:function(e){var t={dialogName:"PasteDialog",element:e.element,target:e.target,cancel:e.cancel};i.parent.trigger("dialogBeforeOpen",t),t.cancel&&(e.cancel=!0)}})},Rce.prototype.hidePaste=function(e){this.parent.getActiveSheet().isProtected&&(e=!1),this.parent.notify(Lse,[{items:[this.parent.element.id+"_paste"],enable:e||!1}])},Rce.prototype.setExternalCells=function(e,t){var n,i="",o=this.parent.getActiveSheet(),r=fte(this.copiedInfo.range),s=0===r[1]&&r[3]===o.colCount-1,a=0===r[0]&&r[2]===o.rowCount-1,l='<html><body><table class="e-spreadsheet" xmlns="http://www.w3.org/1999/xhtml" style="border-collapse:collapse;"';(s||a)&&(l=l+(' aria-rowcount="'+o.usedRange.rowIndex+'" aria-colcount="'+o.usedRange.colIndex)+'" aria-label="'+(s&&a?"Sheet":s?"Row":"Column")+'"'),l+="><tbody>";for(var h=r[0];h<=r[2];h++)if(t||!jde(o,h)){l+="<tr>";for(var d,p,c,u=r[1];u<=r[3];u++)(c=Kre(h,u,o,!1,!0)).colSpan<0||c.rowSpan<0||(l+="<td",c.colSpan&&(l+=' colspan="'+c.colSpan+'"'),c.rowSpan&&(l+=' rowspan="'+c.rowSpan+'"'),c.style?(n="",c.style.whiteSpace||(n+="white-space:"+(c.wrap?"normal":"nowrap")+";"),c.style.verticalAlign||(n+="vertical-align:bottom;"),Object.keys(c.style).forEach(function(e){var t=c.style[""+e],i=(e.includes("border")&&t.includes("dashed")&&t.includes("1px")&&(t=t.replace("1px","thin")),e.match(/[A-Z]/));n+=("backgroundColor"===e?"background":i?e.replace(i[0],"-"+i[0].toLowerCase()):e)+":"+("backgroundColor"===e||"color"===e?c.style[""+e].slice(0,7):t)+";"}),l+=n.includes('"')?" style='"+n+"'":' style="'+n+'"'):l+=' style="white-space:'+(c.wrap?"normal":"nowrap")+';vertical-align:bottom;"',je(c.value)?l+="></td>":(p=c.value,c.format&&"General"!==c.format&&(l=(l+=c.value.toString().includes('"')?" cell-value='"+p+"'":' cell-value="'+c.value+'"')+(c.format.includes('"')?" num-format='"+c.format+"'":' num-format="'+c.format+'"'),d={formattedText:p,value:p,format:c.format,cell:c,rowIndex:h,colIndex:u,dataUpdate:!0},this.parent.notify(Aie,d),p=d.formattedText),l+=">","string"==typeof p&&p.includes("\n")?l+=p.split("\n").join("<br>"):l+=p,i+=p,l+="</td>"),i+=u===r[3]?"":"\t");l+="</tr>",i+=h===r[2]?"":"\n"}l+="</tbody></table></body></html>",F.isIE?(window.clipboardData.setData("text",i),t&&window.clipboardData.setData("isInternalCut",i)):(e.clipboardData.setData("text/html",l),e.clipboardData.setData("text/plain",i),t&&e.clipboardData.setData("isInternalCut",i),e.preventDefault())},Rce.prototype.getExternalCells=function(e){function t(){setTimeout(function(){o.getClipboardEle().innerHTML=""},0)}var i,n,o=this,r=[],s={model:r},a=this.parent.createElement("span");if(F.isIE)n=window.clipboardData.getData("text");else{if(i=e.clipboardData.getData("text/html"),n=e.clipboardData.getData("text/plain"),this.copiedInfo&&i.includes('<table class="e-spreadsheet"')){var l,h=!1;if(this.copiedInfo.isCut||(d={sheetIdx:Fre(this.parent,this.copiedInfo.sId)},this.parent.notify(Hae,d),d.isFiltered&&(l=this.copiedInfo.range,h=(d=d.filterRange)[0]===l[0]&&d[1]===l[1]&&d[2]===l[2]&&d[3]===l[3])),!h)return t(),{internal:!0}}a.innerHTML=i}if(a.querySelector("table"))this.generateCells(a,s);else if(a.querySelector("img")){var d=a.querySelector("img");this.parent.notify(Tle,{options:{src:d.src,height:d.height,width:d.width},isPublic:!0})}else if(n){var p,c,u,g=[],m=(i&&(c=[].slice.call(a.children)),this.cellStyle(a));s.colCount=1,n.split("\n").forEach(function(t){p=null,i&&(u=c.filter(function(e){return e.textContent&&e.textContent.replace(/(\r\n|\n|\r|\s)/gm," ").trim()===t.trim()})[0])&&(p=m(u),c.splice(c.indexOf(u),1)),t.split("\t").forEach(function(e,t){(e||p)&&(g[t]={},!p||p.whiteSpace&&"nowrap"!==p.whiteSpace&&(g[t].wrap=!0,delete p.whiteSpace,!Object.keys(p).length)||(g[t].style=p),e)&&(Poe(e)?g[t].formula=e:g[t].value=vre(e.trim(),!0,!0))}),r.push({cells:g}),s.colCount=Math.max(s.colCount,g.length),g=[]}),s.rowCount=r.length,s.usedRowIndex=r.length-1,s.usedColIndex=s.colCount-1}else if(e.clipboardData.files&&e.clipboardData.files[0]&&e.clipboardData.files[0].type.includes("image"))return t(),{file:e.clipboardData.files[0]};return t(),s},Rce.prototype.generateCells=function(e,t){for(var i,n,o,r,s,a,l=t.model,h=e.querySelector("table"),d=h.classList.contains("e-spreadsheet"),p={},c={},u=(t.usedRowIndex=h.rows.length-1,t.rowCount=h.rows.length,d&&(t.selection=h.getAttribute("aria-label"),t.selection)&&("Sheet"===t.selection?(t.usedRowIndex=Number(h.getAttribute("aria-rowcount")),t.usedColIndex=Number(h.getAttribute("aria-colcount"))):"Row"===t.selection?t.usedColIndex=Number(h.getAttribute("aria-colcount")):t.usedRowIndex=Number(h.getAttribute("aria-rowcount"))),[]),g=(je(h)||je(h.getAttribute("style"))||(u.push(h.getAttribute("style")),this.generateStyles(u,p)),this.cellStyle(e,d)),m=1,f=(t.colCount=1,[]),y=0,v=t.usedRowIndex;y<=v;y++){je((i=h.rows[y]).getAttribute("style"))||(f.push(i.getAttribute("style")),this.generateStyles(f,c)),l[y]||(l[y]={cells:[]}),n=l[y].cells,t.colCount=Math.max(t.colCount,i.cells.length);for(var b=t.usedColIndex<i.cells.length?t.usedColIndex:i.cells.length-1,w=0;w<=b;w++){if(r=i.cells[w],n[w=n[a=w]?this.getNewIndex(n,w):w]={},o=g(r,c,p),r.textContent=r.textContent.replace(/(\r\n|\n|\r)/gm,""),r.textContent=r.textContent.replace(/\s+/g," "),o.whiteSpace&&"nowrap"!==o.whiteSpace&&(n[w].wrap=!0,delete o.whiteSpace),Object.keys(o).length&&(o.border&&(["borderBottom","borderTop","borderLeft","borderRight"].forEach(function(e){o[""+e]=o.border}),delete o.border),n[w].style=o),r.textContent&&(n[w].value=vre(r.textContent.trim(),!0,!0)),r.getAttribute(s=d?"num-format":"number-format")&&(n[w].format=r.getAttribute(s),n[w].value)&&r.getAttribute("cell-value")&&(n[w].value=vre(r.getAttribute("cell-value").trim(),!0,!0)),r.getAttribute("colspan")&&1<parseInt(r.getAttribute("colspan"),10)&&(n[w].colSpan=parseInt(r.getAttribute("colspan"),10)),r.getAttribute("rowspan")&&1<parseInt(r.getAttribute("rowspan"),10)&&(n[w].rowSpan=parseInt(r.getAttribute("rowspan"),10)),1<n[w].colSpan&&1<n[w].rowSpan)for(var C=void 0,S=y,A=y+n[w].rowSpan;S<A;S++)for(var x=w,I=w+n[w].colSpan;x<I;x++)S===y&&x===w||(C=n[w].style?{style:Pe({},n[w].style)}:{},S!==y&&(C.rowSpan=y-S),x!==w&&(C.colSpan=w-x),l[S]||(l[S]={cells:[]}),l[S].cells[x]=C);else if(1<n[w].colSpan)for(S=w+1,A=w+n[w].colSpan;S<A;S++)n[S]={colSpan:w-S,style:Pe({},o)};else if(1<n[w].rowSpan)for(S=y+1,A=y+n[w].rowSpan;S<A;S++)l[S]||(l[S]={cells:[]}),l[S].cells[w]={rowSpan:y-S,style:Pe({},o)};w=a}m=Math.max(m,n.length)}t.usedColIndex=m-1},Rce.prototype.getNewIndex=function(e,t){return t=e[t]?this.getNewIndex(e,++t):t},Rce.prototype.cellStyle=function(e,s){var a=this;if(!s){var l=e.querySelector("style")&&e.querySelector("style").innerHTML,t=Object.keys(this.parent.commonCellStyle);if(t&&t.length&&l)for(var i=((i=l.includes("td")?l.split("td")[1]:l).includes("{")?i.split("{")[1]:i).split("}")[0],h={},n=0;n<t.length;n++){var o=t[n],r=o.match(/[A-Z]/);r&&(o=o.replace(r[0],"-"+r[0].toLowerCase())),-1<i.indexOf(o)&&(h[t[n]]=i.split(o+":")[1].split(";")[0].trim())}}return function(e,t,i){var n={};if(s){if(!e.getAttribute("style"))return n;o=e.getAttribute("style").split(";")}else{var o=[],r=(l&&e.className&&l.includes(e.classList[0])&&(r=l.split(e.classList[0]),o.push(r[r.length-1].split("{")[1].split("}")[0])),[].slice.call(e.querySelectorAll("*")));r.unshift(e),r.forEach(function(e){e.getAttribute("style")&&o.push(e.getAttribute("style")),"B"===e.tagName&&o.push("font-weight:bold"),"I"===e.tagName&&o.push("font-style:italic"),"U"===e.tagName&&o.push("text-decoration:underline")}),Object.assign(n,i,t,h)}return o.length&&a.generateStyles(o,n),e.querySelector("S")&&(n.textDecoration=n.textDecoration?"underline line-through":"line-through"),n.textDecoration&&-1===["underline","line-through","underline line-through","none"].indexOf(n.textDecoration)&&(n.textDecoration="none"),n.textAlign&&-1===["left","center","right"].indexOf(n.textAlign)&&(n.textAlign="left"),n.verticalAlign&&-1===["bottom","middle","top"].indexOf(n.verticalAlign)&&(n.verticalAlign="bottom"),n.fontSize&&(n.fontSize=Math.round(parseFloat(-1<n.fontSize.indexOf("px")?(.75*parseFloat(n.fontSize)).toString():-1<n.fontSize.indexOf("em")?(16*parseFloat(n.fontSize)/1.3333).toString():n.fontSize))+"pt"),n.fontWeight&&-1===["bold","normal"].indexOf(n.fontWeight)&&(n.fontWeight="599"<n.fontWeight?"bold":"normal"),n}},Rce.prototype.generateStyles=function(e,i){var n,o,r,s,a,l=["font-family","vertical-align","text-align","text-indent","color","white-space","font-weight","font-style","font-size","text-decoration","background","background-color"],h=["fontFamily","verticalAlign","textAlign","textIndent","color","whiteSpace","fontWeight","fontStyle","fontSize","textDecoration","backgroundColor","backgroundColor"],d=["border-bottom","border-top","border-right","border-left","border"],p=["borderBottom","borderTop","borderRight","borderLeft","border"];e&&e.length&&e.forEach(function(e){e.split(";").forEach(function(e){if(o=e.split(":")[0].trim(),-1<(n=l.indexOf(o)))o=e.split(":")[1].trim(),i[h[n]]=o;else if(-1<(n=d.indexOf(o))){if("none"===(o=e.split(":")[1].trim()))o=void 0;else if(o.includes("pt")){r=o.split("pt"),s=r[0].split(" ");for(var t=0;t<s.length;t++)if(a=parseFloat(s[t])){s.splice(t,1),s.unshift((a/.75).toFixed(2)+"px"),r[0]=s.join(" ");break}o=r.join("")}i[p[n]]=o}})})},Rce.prototype.refreshOnInsertDelete=function(e){var t,i;this.copiedInfo&&e.model.id===this.copiedInfo.sId&&(t=this.copiedInfo.range,e.isInsert?"Column"===e.modelType?e.start<=t[3]&&(e.start<=t[1]?(i=e.end-e.start+1,t[1]+=i,t[3]+=i):t[3]=t[1]+(e.start-t[1]-1),this.performAction()):e.start<=t[2]&&(e.start<=t[0]?(i=e.end-e.start+1,t[0]+=i,t[2]+=i):t[2]=t[1]+(e.start-t[1]-1),this.performAction()):this.clearCopiedInfo())},Rce.prototype.performAction=function(){var e=this.getCopyIndicator();e&&Spe(this.parent,e,this.copiedInfo.range,"e-copy-indicator")},Rce.prototype.getClipboardEle=function(){return this.parent.element.getElementsByClassName("e-clipboard")[0]},Rce.prototype.getCopyIndicator=function(){return this.parent.element.getElementsByClassName("e-copy-indicator")[0]},Rce.prototype.getModuleName=function(){return"clipboard"},Rce.prototype.destroy=function(){this.removeEventListener(),G(this.getClipboardEle()),this.parent=null},Rce);function Rce(e){this.parent=e,this.init(),this.addEventListener()}Nce.prototype.destroy=function(){this.isEdit&&this.cancelEdit(!0,!1),this.removeEventListener(),this.editorElem=null,this.formulaErrorStrings&&(this.formulaErrorStrings=[]),this.editCellData&&(this.editCellData={}),this.keyCodes&&(this.keyCodes={}),this.parent=null},Nce.prototype.addEventListener=function(){F.isDevice&&"safari"===F.info.name&&(F.isIos||F.isIos7)?E.add(this.parent.element,"touchend",this.tapHandler,this):E.add(this.parent.element,"dblclick",this.dblClickHandler,this),this.parent.on(use,this.mouseDownHandler,this),this.parent.on(bse,this.keyUpHandler,this),this.parent.on(wse,this.keyDownHandler,this),this.parent.on(mse,this.performEditOperation,this),this.parent.on(mle,this.initiateCurPosition,this),this.parent.on(yle,this.updateFormulaBarValue,this),this.parent.on(vle,this.addressHandler,this),this.parent.on(ble,this.initiateRefSelection,this),this.parent.on(wle,this.refSelectionRender,this),this.parent.on(Uie,this.checkUniqueRange,this),this.parent.on(qie,this.reApplyFormula,this),this.parent.on(sae,this.sheetChangeHandler,this),this.parent.on(ele,this.readOnlyAlertHandler,this),this.parent.on(tle,this.finiteAlertHandler,this)},Nce.prototype.removeEventListener=function(){F.isDevice&&"safari"===F.info.name&&(F.isIos||F.isIos7)?E.remove(this.parent.element,"touchend",this.tapHandler):E.remove(this.parent.element,"dblclick",this.dblClickHandler),this.parent.isDestroyed||(this.parent.off(use,this.mouseDownHandler),this.parent.off(bse,this.keyUpHandler),this.parent.off(wse,this.keyDownHandler),this.parent.off(mse,this.performEditOperation),this.parent.off(mle,this.initiateCurPosition),this.parent.off(yle,this.updateFormulaBarValue),this.parent.off(vle,this.addressHandler),this.parent.off(ble,this.initiateRefSelection),this.parent.off(wle,this.refSelectionRender),this.parent.off(Uie,this.checkUniqueRange),this.parent.off(qie,this.reApplyFormula),this.parent.off(sae,this.sheetChangeHandler),this.parent.off(ele,this.readOnlyAlertHandler),this.parent.off(tle,this.finiteAlertHandler))},Nce.prototype.getModuleName=function(){return"edit"},Nce.prototype.performEditOperation=function(e){var t,i;switch(e.action){case"renderEditor":this.renderEditor(),e.initLoad&&F.isDevice&&"safari"===F.info.name&&(F.isIos||F.isIos7)&&(t=this.parent.createElement("div",{className:"e-ss-focus-edit",attrs:{contentEditable:"true",inputmode:"none",tabindex:"-1"}}),(i=this.parent.element.querySelector(".e-sheet-panel"))&&(i.style.position="relative",i.appendChild(t)),this.parent.element.onfocus=function(){sce(t)});break;case"refreshEditor":this.refreshEditor(e.value,e.refreshFormulaBar,e.refreshEditorElem,e.isAppend,e.trigEvent),e.refreshCurPos&&this.setCursorPosition();break;case"startEdit":this.isEdit&&(this.parent.notify(pse,i={isEdit:!1}),!i.isEdit)||(this.isNewValueEdit=e.isNewValueEdit,this.startEdit(e.address,e.value,e.refreshCurPos));break;case"endEdit":this.isEdit&&this.endEdit(e.refreshFormulaBar,null,e.isPublic);break;case"cancelEdit":this.isEdit&&this.cancelEdit(e.refreshFormulaBar);break;case"getCurrentEditValue":e.editedValue=this.editCellData.value,void 0!==e.endFormulaRef&&(e.endFormulaRef=this.endFormulaRef);break;case"refreshDependentCellValue":this.refreshDependentCellValue(e.rowIdx,e.colIdx,e.sheetIdx);break;case"getElement":e.element=this.getEditElement(this.parent.getActiveSheet());break;case"focusEditorElem":this.editorElem.focus();break;case"getCurrentEditSheetIdx":e.sheetIndex=this.editCellData.sheetIndex}},Nce.prototype.keyUpHandler=function(e){var t;this.isEdit&&(t=this.getEditElement(this.parent.getActiveSheet()),e.altKey&&13===e.keyCode?(t.focus(),this.altEnter(),this.isAltEnter=!0):this.isCellEdit&&this.editCellData.value!==t.textContent&&16!==e.keyCode&&(!e.shiftKey||e.shiftKey&&!Rpe(e.keyCode))&&this.refreshEditor(t.textContent,this.isCellEdit),!Poe(this.editCellData.value,!0)||e&&(16===e.keyCode||17===e.keyCode||e.shiftKey&&Rpe(e.keyCode))||(this.updateFormulaReference(t),this.endFormulaRef&&(e=this.getCurPosition(),t=["+","-","*","/",this.parent.listSeparator,"(","=","&",":"],e.end)&&-1<t.indexOf(this.editCellData.value[e.end-1])&&(this.endFormulaRef=!1)))},Nce.prototype.updateFormulaReference=function(e){var t=this.parent.element.querySelector(".e-formularef-indicator"),t=(t&&t.parentElement.removeChild(t),this.editCellData.value!==e.textContent&&this.refreshEditor(e.textContent,!0),this.editCellData.sheetIndex),e=this.editCellData.value;this.parent.notify(gle,{range:e,formulaSheetIdx:t})},Nce.prototype.keyDownHandler=function(e){var t,i,n,o,r,s,a,l=e.target,h=e.keyCode,d=this.parent.getActiveSheet(),p=ste(d.activeCell),c=Kre(p[0],p[1],d,!1,!0),u=this.parent.enableKeyboardShortcut;if(u||h!==this.keyCodes.SPACE||e.ctrlKey||e.altKey||e.metaKey){if(!z(l,".e-spreadsheet .e-dialog"))if(!d.isProtected||l.classList.contains("e-sheet-rename")||!Hoe(c,Kde(d,p[1]))||(l.classList.contains("e-formula-bar")||l.classList.contains("e-combobox"))&&!l.disabled)if(this.isEdit){var g,m=this.getEditElement(d),f=Poe(this.editCellData.value,!0);if((this.isCellEdit||f&&this.editCellData.value!==m.textContent&&16!==e.keyCode&&17!==e.keyCode)&&(p[1]<this.parent.frozenColCount(d)&&(!d.frozenRows||p[0]>=this.parent.frozenRowCount(d))&&m&&"auto"!==m.style.height&&Zpe(m.textContent,c.style,this.parent.cellStyle)>parseInt(m.style.maxWidth,10)&&(m.style.height="auto"),Zpe(m.textContent,c.style,this.parent.cellStyle)>parseInt(m.style.maxWidth,10)-5&&(m.style.height="auto"),p[0]<this.parent.frozenRowCount(d)&&m&&!m.style.overflow&&Zpe(m.textContent,c.style,this.parent.cellStyle)>parseInt(m.style.maxWidth,10)&&(m.style.overflow="auto"),e.shiftKey&&(!e.shiftKey||Rpe(e.keyCode))||this.refreshEditor(m.textContent,this.isCellEdit,!1,!1,!1)),!e.altKey)switch(h){case this.keyCodes.ENTER:F.isWindows&&e.preventDefault(),f&&((g=this.parent.element.querySelector(".e-formularef-indicator"))&&g.parentElement.removeChild(g),_re(this.parent,this.editCellData.sheetIndex).id!==d.id)&&this.parent.goTo(this.editCellData.fullAddr),this.endEdit(!1,e);break;case this.keyCodes.TAB:this.hasFormulaSuggSelected()||this.endEdit(!1,e);break;case this.keyCodes.ESC:u&&this.cancelEdit(!0,!0,e)}}else(l.classList.contains("e-spreadsheet")||z(l,".e-sheet-panel"))&&(13===h&&"true"===l.contentEditable&&e.preventDefault(),p=String.fromCharCode(h),c=h>=this.keyCodes.FIRSTALPHABET&&h<=this.keyCodes.LASTALPHABET||p.toLowerCase()!==p.toUpperCase()&&!(112<=h&&h<=123),m=h>=this.keyCodes.FIRSTNUMBER&&h<=this.keyCodes.LASTNUMBER,p=h>=this.keyCodes.FIRSTNUMPAD&&h<=this.keyCodes.LASTNUMPAD,t=(t=h>=this.keyCodes.SYMBOLSETONESTART&&h<=this.keyCodes.SYMBOLSETONEEND)||h>=this.keyCodes.SYMBOLSETTWOSTART&&h<=this.keyCodes.SYMBOLSETTWOEND,i=h===this.keyCodes.FIREFOXEQUALPLUS||h===this.keyCodes.FIREFOXMINUS,n=!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&h===this.keyCodes.F2&&u,o=h===this.keyCodes.BACKSPACE&&u,r=/(Macintosh|MacIntel|MacPPC|Mac68K|Mac|Mac OS|iPod|iPad)/i.test(navigator.userAgent)&&o,s=this.parent.element.querySelector(".e-readonly-alert-dlg"),a=this.parent.element.getElementsByClassName("e-ss-overlay-active"),(!e.ctrlKey&&!e.metaKey&&!e.altKey&&(!e.shiftKey&&h===this.keyCodes.SPACE||c||m||p||t||"mozilla"===F.info.name&&i)||n||o)&&(n&&(this.isNewValueEdit=!1),s||(are(this.parent)&&0===a.length?this.parent.notify(ele,null):a.length?o&&!r&&this.editingHandler("delete"):(this.startEdit(null,null,!0,!0),sce(this.getEditElement(d))))),h===this.keyCodes.DELETE||r)&&u&&(c=d.isProtected&&ace(this.parent),s||(c?this.parent.notify($ae,null):are(this.parent)&&0===a.length?this.parent.notify(ele,null):(this.editingHandler("delete"),this.parent.notify(Nie,null))));else!(h>=this.keyCodes.FIRSTALPHABET&&h<=this.keyCodes.LASTALPHABET||h>=this.keyCodes.FIRSTNUMBER&&h<=this.keyCodes.LASTNUMBER||h===this.keyCodes.DELETE||h===this.keyCodes.BACKSPACE||h===this.keyCodes.SPACE||h>=this.keyCodes.FIRSTNUMPAD&&h<=this.keyCodes.LASTNUMPAD||h>=this.keyCodes.SYMBOLSETONESTART&&h<=this.keyCodes.SYMBOLSETONEEND||219<=h&&h<=222)&&(e.shiftKey||e.ctrlKey||e.metaKey||h!==this.keyCodes.F2)||67===h||89===h||90===h||d.protectSettings.insertLink&&75===h||e.altKey&&(65===h||70===h||72===h||77===h||78===h||87===h)||e.ctrlKey||70===e.keyCode||this.parent.element.querySelector(".e-editAlert-dlg")||l.parentElement.classList.contains("e-unprotectpwd-content")||l.parentElement.classList.contains("e-password-content")||l.parentElement.classList.contains("e-sheet-password-content")||l.parentElement.classList.contains("e-unprotectsheetpwd-content")||l.parentElement.classList.contains("e-reenterpwd-content")||this.parent.notify($ae,null)}else e.preventDefault()},Nce.prototype.renderEditor=function(){if(!this.editorElem||!ge("#"+this.parent.element.id+"_edit",this.parent.element)){var e=this.parent.createElement("div",{id:this.parent.element.id+"_edit",className:"e-spreadsheet-edit",attrs:{contentEditable:"true",role:"textbox",spellcheck:"false","aria-multiline":"true"}}),t=(this.parent.element.getElementsByClassName("e-spreadsheet-edit")[0]&&this.parent.element.getElementsByClassName("e-spreadsheet-edit")[0].remove(),this.parent.element.querySelector(".e-sheet-content"));if(!t)return;t.appendChild(e),this.editorElem=e}this.parent.notify(fse,{action:"renderAutoComplete"})},Nce.prototype.refreshEditor=function(e,t,i,n,o,r){void 0===o&&(o=!0),n?e=this.editCellData.value=this.editCellData.value+e:this.editCellData.value=r||e;n=this.getEditElement(this.parent.getActiveSheet());i&&n&&(n.textContent=e),t&&this.parent.notify(yse,{action:"refreshFormulabar",value:e}),this.parent.isEdit&&n&&o&&this.editCellData.value===n.textContent&&this.triggerEvent("cellEditing").cancel&&this.cancelEdit(!1,!1,null,!0)},Nce.prototype.startEdit=function(e,t,i,n){void 0===i&&(i=!0),this.parent.showSheetTabs&&this.parent.element.querySelector(".e-add-sheet-tab").setAttribute("disabled","true");var o=this.parent.getActiveSheet(),r=ste(o.activeCell),o=Kre(r[0],r[1],o,!1,!0);if("Manual"===this.parent.calculationMode&&Poe(o.formula)&&(this.editCellData.prevFormulaValue=o.value),Ype(this.parent,r[0],r[1],this.parent.activeSheetIndex)){var r=this.parent.getCell(r[0],r[1]),s=!1,a=r.innerHTML;if(s=r&&-1<a.indexOf("<")&&-1<a.indexOf(">")&&-1<a.indexOf("input")?!0:s)return}r=this.updateEditCellDetail(e,t);this.initiateEditor(i,r),this.positionEditor(),this.parent.isEdit=this.isEdit=!0,this.parent.notify(zse,null),this.parent.notify(Lse,[{enable:!1}]),o.formula&&!n&&this.parent.notify(gle,{range:o.formula,formulaSheetIdx:this.editCellData.sheetIndex})},Nce.prototype.setCursorPosition=function(){var e,t,i=this.getEditElement(this.parent.getActiveSheet()),n=i.textContent.length;n&&(e=document.getSelection(),(t=document.createRange()).setStart(i.firstChild,n),t.collapse(!0),e.removeAllRanges(),e.addRange(t)),i.focus()},Nce.prototype.hasFormulaSuggSelected=function(){var e=document.getElementById(this.parent.element.id+"_ac_popup");return e&&"visible"===e.style.visibility&&0<e.querySelectorAll(".e-item-focus").length},Nce.prototype.editingHandler=function(e){var t,i=document.getElementsByClassName("e-ss-overlay-active"),n=i.length;if("delete"===e)if(0<n)i[0].classList.contains("e-datavisualization-chart")?this.parent.notify(Dle,{id:i[0].id,sheetIdx:this.parent.activeSheetIndex+1}):this.parent.notify(Ele,{id:i[0].id,sheetIdx:this.parent.activeSheetIndex+1});else{var o=this.parent.getActiveSheet(),n=pte(e=o.selectedRange),e=hte(n[0]>n[2]||n[1]>n[3]?fte(n):n),i={address:o.name+"!"+e,cancel:!1};if(this.parent.notify(fie,{action:"cellDelete",eventArgs:i}),i.cancel)return;n=rte(e=cte(i.address)),hce(this.parent,n,this.parent.activeSheetIndex),this.parent.notify(poe,{}),0===n[0]&&0===n[1]&&n[2]>=o.usedRange.rowIndex&&n[3]>=o.usedRange.colIndex&&this.parent.setUsedRange(0,0,o,!1,!0);i={cellIdx:n,isUnique:!1};if(this.checkUniqueRange(i),i.isUnique&&(p=Kre((n=rte(this.uniqueColl))[0],n[1],this.parent.getActiveSheet()))&&p.value&&(t=-1<p.value.toString().indexOf("#SPILL!")),i.isUnique&&this.uniqueColl.split(":")[0]===e.split(":")[0]){for(var r=rte(this.uniqueColl),s=r[0];s<=r[2];s++)for(var a=r[1];a<=r[3];a++)this.parent.updateCellInfo({value:"",formula:""},hte([s,a]),!0);this.parent.notify(Qie,null),this.uniqueColl=""}else if(i.isUnique){var l=rte(this.uniqueColl);if("#SPILL!"===Kre(l[0],l[1],o).value){for(var h=!1,a=l[0];a<=l[2];a++)for(var d=l[1];d<=l[3];d++){var p=Kre(a,d,o);a===l[0]&&d===l[1]?h=!1:p&&!je(p.value)&&""!==p.value&&(h=!0)}h||this.reApplyFormula()}}i.isUnique?this.parent.notify(Vae,{action:"cellDelete",eventArgs:{address:o.name+"!"+e,isSpill:t}}):this.parent.notify(Vae,{action:"cellDelete",eventArgs:{address:o.name+"!"+e}})}},Nce.prototype.getCurPosition=function(){var e,t={},i=window.getSelection();return i&&i.focusNode&&i.focusNode.classList&&i.focusNode.classList.contains("e-formula-bar-panel")?(e=i.focusNode.getElementsByClassName("e-formula-bar e-css")[0]).value===this.editCellData.value&&(t.start=e.selectionStart,t.end=e.selectionEnd):this.getEditElement(this.parent.getActiveSheet()).textContent===this.editCellData.value&&(t.start=i.anchorOffset,t.end=i.focusOffset,t.end<t.start)&&(e=t.start,t.start=t.end,t.end=e),t},Nce.prototype.mouseDownHandler=function(e){if(!z(e.target,".e-findtool-dlg")&&!z(e.target,".e-validation-error-dlg")&&this.isEdit){var t=this.getCurPosition(),i=void 0,n=void 0,t=(t.start&&(this.curStartPos=i=t.start),t.end&&(this.curEndPos=n=t.end),e.target),o=this.parent.getActiveSheet(),r=this.parent.element.querySelector(".e-formularef-indicator"),s=(this.isCellEdit=t.classList.contains("e-spreadsheet-edit"),Poe(this.editCellData.value,!0)),a=this.getEditElement(o),l=["+","-","*","/",this.parent.listSeparator,"(","=","&",":"];if(t.classList.contains("e-cell")||t.classList.contains("e-header-cell")||t.classList.contains("e-selectall")||z(t,".e-toolbar-item.e-active")||z(t,".e-table"))if(!s||this.endFormulaRef)this.endFormulaRef=!1,this.endEdit(!1,e);else{var h,d=ste(o.activeCell),d=Kre(d[0],d[1],o),p=document.activeElement.classList.contains("e-formula-bar")?document.activeElement.value:a.textContent;if(this.editCellData.value===p)if(i===n){if(this.editCellData.sheetIndex!==Bre(this.parent,o.name)){if(-1===l.indexOf(p.substring(i-1,i)))return r&&r.parentElement.removeChild(r),this.parent.goTo(this.editCellData.fullAddr),void this.endEdit(!1,e)}else if(-1===l.indexOf(a.textContent.substring(i-1,i)))return r&&r.parentElement.removeChild(r),void this.endEdit(!1,e)}else-1!==l.indexOf(p.substring(i-1,i))&&Boe(p.substring(i,n))&&p.indexOf(":")!==n&&(this.editCellData.value=p.substring(0,i)+p.substring(n,p.length));d&&(s=d.formula&&(Poe(d.formula)||this.editCellData.value&&0===this.editCellData.value.toString().indexOf("=")))&&this.parent.isEdit&&(h=n,this.editCellData.value.length===h?")"!==this.editCellData.value.substring(this.editCellData.value.length-1)&&!mre(this.editCellData.value.substring(this.editCellData.value.length-1))||(r&&r.parentElement.removeChild(r),this.endEdit(!1,e)):this.editCellData.value===p&&-1===l.indexOf(p.substring(h-1,h))&&(r&&r.parentElement.removeChild(r),this.endEdit(!1,e)))}else!s||this.editCellData.value!==a.textContent||a.textContent.indexOf("(")===a.textContent.length-1||this.isCellEdit||t.classList.contains("e-formula-bar")||-1!==l.indexOf(this.editCellData.value.substring(i-1,i))||_re(this.parent,this.editCellData.sheetIndex).id===o.id&&(h=window.getSelection().focusOffset,-1===l.indexOf(a.textContent.substring(h-1,h)))&&(r&&r.parentElement.removeChild(r),this.parent.goTo(this.editCellData.fullAddr),this.isEdit)&&this.endEdit(!1,e)}},Nce.prototype.tapHandler=function(t){var i=this;this.tapedTwice?(t.preventDefault(),this.dblClickHandler(t)):(this.tapedTwice=!0,setTimeout(function(){var e;i.tapedTwice=!1,!i.parent.isEdit&&t.target.classList.contains("e-cell")&&(e=i.parent.element.querySelector(".e-ss-focus-edit"))&&sce(e)},300))},Nce.prototype.dblClickHandler=function(e){var t,i,n,e=e.target;z(e,".e-datavisualization-chart")||e.classList.contains("e-ss-overlay")||!(e.classList.contains("e-active-cell")||e.classList.contains("e-cell")||e.classList.contains("e-wrap-content")||z(e,".e-sheet-content")||e.classList.contains("e-table"))||(sre(n=Kre((i=ste((t=this.parent.getActiveSheet()).activeCell))[0],i[1],t,!1,!0),Kde(t,i[1]),_de(t,i[0]))?this.parent.notify(ele,null):t.isProtected&&Hoe(n,Kde(t,i[1]))?this.parent.notify($ae,null):this.isEdit?e.classList.contains("e-spreadsheet-edit")||Poe(this.editCellData.value)&&(n=this.editCellData.fullAddr.substring(0,this.editCellData.fullAddr.lastIndexOf("!")),this.parent.getActiveSheet().name!==n)||this.endEdit():(this.isNewValueEdit=!1,this.startEdit(),sce(this.getEditElement(t))))},Nce.prototype.updateEditCellDetail=function(e,t){var i,n,o,r,s,a,l=je(this.editCellData.sheetIndex)?e&&-1<e.lastIndexOf("!")?Bre(this.parent,Lre(e)):this.parent.activeSheetIndex:this.editCellData.sheetIndex;return this.editCellData.addr?Poe(this.editCellData.value,!0)&&(i=_re(this.parent,l),this.isNewValueEdit=!1):(i=_re(this.parent,l),e=e?cte(e):i.activeCell),e&&((1<(s=Kre(o=(a=rte(e))[0],r=a[1],i,!1,!0)).colSpan||1<s.rowSpan)&&(ire(s={sheet:i,cell:s,rowIdx:o,colIdx:r}),o=s.rowIdx,r=s.colIdx,n=s.isMergedHiddenCell),s=this.parent.getCell(o,r),a=Cpe(i,a,this.parent.frozenRowCount(i),this.parent.frozenColCount(i),this.parent.viewport.beforeFreezeHeight,this.parent.viewport.beforeFreezeWidth,this.parent.sheetModule.colGroupWidth),this.editCellData={addr:e,fullAddr:Wre(this.parent,l)+"!"+e,rowIndex:o,colIndex:r,sheetIndex:l,element:s,value:t||"",position:a,prevFormulaValue:this.editCellData.prevFormulaValue}),n},Nce.prototype.initiateEditor=function(r,e){var s=this;Cre(this.parent,this.editCellData.fullAddr,!1,e).then(function(e){s.parent&&e.forEach(function(t){function e(){var e={cell:t,value:t?t.value:"",showFormattedText:s.editCellData.showFormattedText};s.parent.notify(Oie,e),i=t?t.formula||e.value:"",s.editCellData.oldValue=i}e();var i,n,o=s.triggerEvent("cellEdit",null,i);o.cancel?s.cancelEdit(!0,!1,null,!0):(o.showFormattedText&&(s.editCellData.showFormattedText=!0,e()),s.editCellData.value?i=s.editCellData.value:s.editCellData.value=i,s.isNewValueEdit?(n=i,i=""):s.isNewValueEdit=!0,ee(i)&&(i=""),s.refreshEditor(i,!1,!0,!1,!1,n),r&&s.setCursorPosition())})})},Nce.prototype.positionEditor=function(e){var t,i,n,o,r,s,a,l,h,d,p,c,u,g,m,f,y=this.editCellData.element,v={isEdit:!1};this.parent.notify(pse,v),v.isEdit&&je(y)&&(v=this.parent.getCell(this.editCellData.rowIndex,this.editCellData.colIndex),this.editCellData.element=y=v),y&&(y.classList.add("e-ss-edited"),v=this.parent.getActiveSheet(),t=Kre(this.editCellData.rowIndex,this.editCellData.colIndex,v,!1,!0),i=this.editCellData.position.left+1,n=this.editCellData.position.top+1,r={range:[this.editCellData.rowIndex,this.editCellData.colIndex,this.editCellData.rowIndex,this.editCellData.colIndex]},this.parent.notify(Rne,r),o=Ude(v,r.range[0],r.range[2])-3,r=$de(v,r.range[1],r.range[3])-3,f=(u=this.parent.getMainContent()).parentElement,d=void 0,p=this.parent.frozenColCount(v),a=s=void 0,l=this.parent.frozenRowCount(v),h=void 0,this.editCellData.colIndex<p?(d=Math.abs(this.parent.getRowHeaderContent().getBoundingClientRect()[this.parent.enableRtl?"left":"right"]-y.getBoundingClientRect()[this.parent.enableRtl?"right":"left"])-1,this.editCellData.rowIndex<l?"2"===this.parent.getRowHeaderContent().style.zIndex&&(s="3"):Zpe(t.value,t.style,this.parent.cellStyle)>d&&(h=!0)):(d=f.offsetWidth-(i-u.scrollLeft)-28-this.parent.sheetModule.getRowHeaderWidth(v),p=y.getBoundingClientRect(),u=f.getBoundingClientRect(),f=this.parent.enableRtl?p.left:p.right,u=this.parent.enableRtl?u.left:u.right,c=this.parent.getScrollElement(),m=this.parent.sheetModule.getScrollSize(),this.parent.enableRtl?f<u+m&&(c.scrollLeft-=p.width):u-m<f&&(c.scrollLeft+=p.width)),u=!(a=this.editCellData.rowIndex<l?!0:a)&&(t&&t.wrap||y&&e||h)?"auto;":o+"px;",g="display:block;top:"+n+"px;"+(this.parent.enableRtl?"right:":"left:")+i+"px;min-width:"+r+"px;max-width:"+(t&&t.wrap?r:d)+"px;height:"+u+(t&&t.wrap?"width:"+r+"px;":"")+"min-height:"+o+"px;"+(s?"z-index: "+s+";":"")+(a&&(t&&!t.wrap||y&&e)&&(Zpe(t.value,t.style,this.parent.cellStyle)>d||y&&e)?"overflow: auto;":""),y.style.cssText.split(";").forEach(function(e){e.includes("border")||(g+=e+";")}),(m=this.getEditElement(v,!0)).style.cssText=g,Zpe(m.textContent,t.style,this.parent.cellStyle)>d&&(m.style.height="auto"),(f=this.parent.element.querySelector(".e-active-cell"))&&(f.style.height=4+o+"px"),y.classList.contains("e-right-align")?m.classList.add("e-right-align"):y.classList.contains("e-center-align")&&m.classList.add("e-center-align"))},Nce.prototype.updateEditedValue=function(t,i,n,e){var o,r,s,a,l,h,d,p,c,u=this,g=this.editCellData.oldValue,m=(i&&(this.editCellData.value=i),this.editCellData.value),f=(this.parent.notify(Dae,{args:{action:"beforeCellSave",eventArgs:{address:this.editCellData.addr}}}),!0);this.parent.allowDataValidation&&(s=Kre((r=rte((o=this.parent.getActiveSheet()).activeCell))[0],r[1],o,!1,!0),a=Kde(o,r[1]),s.validation||tpe(a,r[0],r[1]))&&(a=this.editCellData.value||this.getEditElement(o).innerText,l=this.parent.activeSheetIndex,l={value:a,range:"string"==typeof this.editCellData.addr?rte(this.editCellData.addr):this.editCellData.addr,sheetIdx:l,isEdit:!0,td:null,isValid:!0},p=Object.assign({},s,{value:a}),Jre(r[0],r[1],o,p),this.parent.notify(cne,l),Jre(r[0],r[1],o,s),(f=l.isValid)?Poe(a)||!s.format?this.editCellData.value||(this.editCellData.value=a):(a!==l.value||!this.editCellData.value&&l.value)&&(this.editCellData.value=l.value):this.isCellEdit=!0),!e&&Poe(this.editCellData.value)&&(h={formula:this.editCellData.value},this.parent.notify(yoe,h),h.isInvalid)&&(f=!(this.isCellEdit=!0),p=this.parent.serviceLocator.getService(ope),(c=this.parent.serviceLocator.getService(rpe)).show({width:400,isModal:!0,showCloseIcon:!0,target:this.parent.element,cssClass:"e-validation-error-dlg",content:p.getConstant("CellReferenceTypoError")+"<br>"+h.formula,beforeOpen:function(){return u.editCellData.element.focus()},buttons:[{buttonModel:{content:p.getConstant("Yes"),isPrimary:!0},click:function(){d=!0,c.hide()}},{buttonModel:{content:p.getConstant("No")},click:function(){return c.hide()}}],close:function(){var e;d?(i=u.editCellData.value=h.formula,u.updateCell(g,t,i,m,n),u.parent.notify(yse,{action:"refreshFormulabar",value:h.formula})):(e=u.getEditElement(u.parent.getActiveSheet())).innerText&&window.getSelection().selectAllChildren(e)}},!1)),f?this.updateCell(g,t,i,m,n):n&&n.preventDefault()},Nce.prototype.updateCell=function(e,t,i,n,o){var r=e?e.toString().toUpperCase():"",s=this.parent.getActiveSheet(),a=(!e&&0!==e||(e=e.toString()),this.editCellData.value);if(e!==(a=a&&a.toString())||Poe(r)){this.isAltEnter&&a&&a.includes("\n")&&($re(s.activeCell,!0,this.parent,!0),this.refreshEditor(a,this.isCellEdit,!1,!1,!1));var a=rte(s.activeCell),l=(e&&-1<e.indexOf("=UNIQUE(")&&""===this.editCellData.value&&this.parent.notify(Qie,null),{cellIdx:a,isUnique:!1}),l=(this.checkUniqueRange(l),l.isUnique);if(l&&""!==e&&""===this.editCellData.value)if(-1===Kre((m=rte(this.uniqueColl))[0],m[1],s).value.toString().indexOf("#SPILL!"))return;e&&-1<e.indexOf("UNIQUE")&&this.editCellData.value&&-1<this.editCellData.value.toString().indexOf("UNIQUE")&&l&&this.updateUniqueRange("");var h={action:"updateCellValue",address:this.editCellData.addr,value:this.editCellData.value,skipCellFormat:this.editCellData.showFormattedText},d=(this.parent.notify(Bie,h),Kre(a[0],a[1],s,!0)),p=void 0,c="#CIRCULARREF!"===(p=je(d)?p:d.value.toString());if(-1<this.formulaErrorStrings.indexOf(p)||c){var u,g=void 0;if(!o||(u=o.target,g=["e-toolbar-item","e-tab-wrap","e-text-wrap","e-tab-text","e-caret"].some(function(e){return u.classList.contains(e)})&&z(u,".e-ribbon")||["e-scroller","e-main-panel","e-autofill"].some(function(e){return u.classList.contains(e)})?g:this.showFormulaAlertDlg(p,c))||o.preventDefault(),!g)return delete d.value,delete d.formula,this.parent.notify(Gie,{cellRef:s.activeCell,clearFormulaInfo:!0}),void(Poe(r)?this.parent.updateCellInfo({formula:r},s.activeCell):e&&this.parent.updateCellInfo({value:e},s.activeCell));d.value="0"}var m,p=void 0,c=(h.isFormulaDependent&&(p=tre(this.parent,this.parent.viewport)),Kre(a[0],a[1],s,!0)),g=this.getRefreshNodeArgs(c,this.editCellData.element,this.editCellData.rowIndex,this.editCellData.colIndex);if(this.editCellData.value=g.value,this.parent.notify(Gne,{cell:null,rIdx:this.editCellData.rowIndex,cIdx:this.editCellData.colIndex,viewportIndexes:p}),c&&c.formula&&(this.editCellData.formula=c.formula),t&&this.parent.refreshNode(this.editCellData.element,g),c&&c.hyperlink&&this.parent.serviceLocator.getService("cell").refreshRange(a),s.conditionalFormats&&s.conditionalFormats.length&&this.parent.notify(_ne,{indexes:[this.editCellData.rowIndex,this.editCellData.colIndex],isAction:!0,refreshAll:h.isFormulaDependent,isEdit:!0}),c&&c.wrap&&this.parent.notify(sne,{range:a,wrap:!0,sheet:s}),l)if(-1<Kre((m=rte(this.uniqueColl))[0],m[1],s).value.toString().indexOf("#SPILL!")&&(this.isSpill=!0),""!==e&&""===this.editCellData.value||this.editCellData.formula&&1<this.editCellData.formula.length&&e!==this.editCellData.formula){for(var f=!1,y=m[0];y<=m[2];y++)for(var v=m[1];v<=m[3];v++){var b=Kre(y,v,s);y===m[0]&&v===m[1]?f=!1:b&&!je(b.value)&&""!==b.value&&(f=!0)}f||this.reApplyFormula()}else this.updateUniqueRange(n)}this.triggerEvent("cellSave",o,i),this.resetEditState(),this.focusElement(o)},Nce.prototype.checkUniqueRange=function(e){var t={range:[]},i=(this.parent.notify(Wie,t),t.range);e.sheetName||(e.sheetName=this.parent.getActiveSheet().name);for(var n=0;n<i.length;n++)if(i[n].substring(0,i[n].lastIndexOf("!"))===e.sheetName)for(var o=rte(i[n]),r=o[0];r<=o[2];r++)for(var s,a,l,h=o[1];h<=o[3];h++)e.cellIdx[0]===r&&e.cellIdx[1]===h&&(e.isUnique=!0,this.uniqueCell=!0,s=""!==this.uniqueColl?rte(this.uniqueColl):[0,0,0,0],a=rte(i[n]),s[0]===a[0]&&s[1]===a[1]?((l=[s[0],a[1],s[0],a[1]])[2]=(s[2]>a[2]?s:a)[2],l[3]=(s[3]>a[3]?s:a)[3],this.uniqueColl=hte(l),e.uniqueRange=hte(l)):(this.uniqueColl=i[n],e.uniqueRange=i[n]))},Nce.prototype.updateUniqueRange=function(e){var t=rte(this.uniqueColl),i=!1;"#SPILL!"!==Kre(t[0],t[1],this.parent.getActiveSheet()).value&&(i=!0);for(var n=t[0];n<=t[2];n++)for(var o=t[1];o<=t[3];o++)i&&(n===t[0]&&o===t[1]?this.parent.updateCellInfo({value:"#SPILL!"},hte([n,o]),!0):hte([n,o]).split(":")[0]===this.editCellData.addr?this.parent.updateCellInfo({value:e},hte([n,o]),!0):this.parent.updateCellInfo({value:""},hte([n,o]),!0))},Nce.prototype.reApplyFormula=function(){for(var e=rte(this.uniqueColl),t=Kre(e[0],e[1],this.parent.getActiveSheet()),i=(this.parent.updateCellInfo({value:""},hte([e[0],e[1]]),!0),this.parent.sheets),n=t.formula,o=0;o<i.length;o++)-1<n.indexOf(i[o].name)&&(n=n.replace(i[o].name,"!"+o));this.parent.notify(Pie,{action:"computeExpression",formula:n}),this.uniqueCell=!1,""!==this.uniqueActCell&&(this.editCellData.value=this.uniqueActCell,this.uniqueActCell="")},Nce.prototype.refreshDependentCellValue=function(e,t,i){if(e&&t&&(t--,(this.editCellData.rowIndex!==--e||this.editCellData.colIndex!==t)&&this.parent.activeSheetIndex===i||this.uniqueCell&&this.parent.activeSheetIndex===i)){var i=_re(this.parent,i),n=void 0;if(n=zde(i,e)||epe(i,t)?n:this.parent.getCell(e,t)){if(n.parentElement){var o=n.parentElement.getAttribute("aria-rowindex");if(o&&Number(o)-1!==e)return}o=Kre(e,t,i),i=rte(i.activeCell),i=(i[0]===e&&i[1]===t&&(this.uniqueActCell=o.value),this.getRefreshNodeArgs(o,n,e,t));this.parent.refreshNode(n,i)}}},Nce.prototype.getRefreshNodeArgs=function(e,t,i,n){e={value:(e=e||{}).value,format:e.format,formattedText:e.formattedText&&""!==e.formattedText?e.formattedText:e.value,isRightAlign:!1,type:"General",cell:e,rowIndex:i,td:t,colIndex:n,refresh:!0,isEdit:!0};return this.parent.notify(Aie,e),e},Nce.prototype.endEdit=function(e,t,i){(e=void 0===e?!1:e)&&this.refreshEditor(this.editCellData.oldValue,!1,!0,!1,!1);var n,e=this.triggerEvent("beforeCellSave");e.cancel?this.parent.isEdit&&t&&t.preventDefault():(!this.isAltEnter&&e.value&&-1<e.value.toString().indexOf("\n")&&(n=Kre(this.editCellData.rowIndex,this.editCellData.colIndex,this.parent.getActiveSheet()),$re(this.parent.getActiveSheet().activeCell,!n||!1!==n.wrap,this.parent),this.refreshEditor(e.value,this.isCellEdit,!1,!1,!1)),this.updateEditedValue(!0,e.value,t,i))},Nce.prototype.cancelEdit=function(e,t,i,n){void 0===t&&(t=!0),this.refreshEditor(this.editCellData.oldValue,e=void 0===e?!0:e,!1,!1,!1),n||(t?this.triggerEvent("cellSave",i,void 0,!0):this.triggerEvent("cellEdited")),this.resetEditState(),this.focusElement()},Nce.prototype.focusElement=function(e){e&&9===e.keyCode&&document.activeElement.classList.contains("e-formula-bar")?(e=this.parent.element.querySelector(".e-formula-bar-panel "+(e.shiftKey?".e-insert-function":".e-combobox")))&&sce(e):sce(this.parent.element),this.parent.notify(Lse,[{enable:!0}])},Nce.prototype.triggerEvent=function(e,t,i,n){var o=this.parent.getActiveSheet(),r=Kre(this.editCellData.rowIndex,this.editCellData.colIndex,o),i={element:this.editCellData.element,value:i||this.editCellData.value,oldValue:this.editCellData.oldValue,address:this.editCellData.fullAddr,displayText:this.parent.getDisplayText(r),previousFormulaValue:this.editCellData.prevFormulaValue},s=(i.address&&(s={cellIdx:rte(i.address),isUnique:!1},this.checkUniqueRange(s),s.isUnique)&&(i.isSpill=this.isSpill),(i.value&&i.value.toString())!==(i.oldValue||0===i.oldValue?i.oldValue.toString():i.oldValue));if(!s&&(n||!Poe(i.value)||r&&r.format&&"Text"===Yhe(r.format)))"beforeCellSave"!==e&&("cellSave"===e?this.parent.trigger("cellEdited",i):this.parent.trigger(e,i));else{if("cellSave"!==e&&(i.cancel=!1),"beforeCellSave"===e){this.parent.notify(fie,{eventArgs:i,action:"cellSave",preventAction:!0});r=Poe(i.value)?{formula:i.value}:{value:i.value};if(Yoe(this.parent,o,{cell:r,rowIdx:this.editCellData.rowIndex,colIdx:this.editCellData.colIndex,eventOnly:!0}))return this.cancelEdit(!1,!1,null,!0),i.cancel=!0,i}this.parent.trigger(e,i),"cellSave"===e&&(this.parent.trigger("cellEdited",i),this.editCellData.formula?i.formula=this.editCellData.formula:s||(i.formula=i.value),r.format&&(i.format=r.format),i.originalEvent=t,this.parent.notify(Vae,{eventArgs:i,action:"cellSave"}))}return i},Nce.prototype.altEnter=function(){this.positionEditor(!0);var e=window.getSelection(),t=e.anchorNode,i=document.createRange(),n=3===t.nodeType?e.anchorOffset:t.textContent.length,o=(0===n&&0<t.textContent.length&&(n=t.textContent.length),t.textContent),r=o.slice(0,n),o=o.slice(n)||" ";t.textContent=r+"\n"+o,i=document.createRange(),3===t.nodeType?(i.setStart(t,n+1),i.setEnd(t,n+1)):1===t.nodeType&&(i.setStart(t.firstChild,n+1),i.setEnd(t.firstChild,n+1)),e.removeAllRanges(),e.addRange(i)},Nce.prototype.resetEditState=function(e){(e=void 0===e?!0:e)&&(!Poe((e=this.getEditElement(this.parent.getActiveSheet())).textContent)&&""!==e.textContent||this.parent.notify(fle,null),this.editCellData.element)&&(this.editCellData.element.classList.remove("e-ss-edited"),this.editorElem.textContent="",e===this.editorElem?(this.editorElem.removeAttribute("style"),this.editorElem.classList.remove("e-right-align")):G(e)),this.editCellData={},this.parent.isEdit=this.isEdit=!1,this.isCellEdit=!0,this.isAltEnter=!1,this.parent.notify(fse,{action:"endEdit"}),this.parent.showSheetTabs&&!this.parent.isProtected&&(e=this.parent.element.querySelector(".e-add-sheet-tab"))&&e.removeAttribute("disabled")},Nce.prototype.refSelectionRender=function(){var e=this.getEditElement(this.parent.getActiveSheet());e&&Poe(e.textContent)&&this.parent.notify(gle,{range:e.textContent,formulaSheetIdx:this.editCellData.sheetIndex})},Nce.prototype.initiateRefSelection=function(){var e=this.editCellData.fullAddr.substring(0,this.editCellData.fullAddr.lastIndexOf("!")),t=this.editCellData.value;this.parent.getActiveSheet().name===e&&Poe(this.editCellData.value,!0)&&(this.startEdit(this.editCellData.addr,t,!1),this.parent.notify(gle,{range:this.editCellData.value,formulaSheetIdx:this.editCellData.sheetIndex}),this.getEditElement(this.parent.getActiveSheet()).textContent=t),this.initiateCurPosition()},Nce.prototype.addressHandler=function(e){var t,i,n,o,r,s,a=this.parent.serviceLocator.getService(rpe).dialogInstance;a&&a.element&&a.element.classList.contains("e-validation-error-dlg")?e.isAlertDlgOpen=!0:(this.curStartPos||((a=this.getCurPosition()).start&&(this.curStartPos=a.start),a.end&&(this.curEndPos=a.end)),a=e.range,t=this.editCellData.sheetIndex,i=this.getEditElement(this.parent.getActiveSheet()),this.parent.activeSheetIndex!==t&&(a="'"+this.parent.getActiveSheet().name+"'!"+a,e.isNameBoxSelect)&&(t=this.parent.activeSheetIndex),n=this.editCellData.value,e.isSelect?this.parent.notify(gle,{range:n+a,formulaSheetIdx:t}):this.parent.activeSheetIndex===t&&(o=document.activeElement.classList.contains("e-formula-bar")?document.activeElement.value:i.textContent,r=void(e.isNameBoxSelect&&(this.parent.notify(gle,{range:n+a,formulaSheetIdx:t}),this.curStartPos=n.length)),s=void 0,e.isMouseDown&&o!==n?(r=o.substring(0,this.curEndPos)+this.parent.listSeparator,s=o.substring(this.curEndPos),this.refreshEditor(r+s,!1,!0),this.parent.notify(gle,{range:i.textContent,formulaSheetIdx:t}),this.curEndPos+=this.parent.listSeparator.length,this.curStartPos=this.curEndPos,r+=a):(r=n.substring(0,this.curStartPos)+a,s=n.substring(this.curStartPos),e.isNameBoxSelect&&this.refreshEditor(r+s,!0,!0)),i.textContent=r+s,this.curEndPos=r.length))},Nce.prototype.updateFormulaBarValue=function(e){var t,i,n,o=this.editCellData.value,r=this.parent.getActiveSheet().selectedRange.split(" "),s=vte(pte(s=r[r.length-1]))?s.split(":")[0]:s,a=this.parent.element.querySelector(".e-formula-bar");o&&Poe(o,!0)&&(t=this.editCellData.fullAddr.substring(0,this.editCellData.fullAddr.lastIndexOf("!")),i=void((t=this.parent.getActiveSheet().name!==t)&&(s="'"+this.parent.getActiveSheet().name+"'!"+s)),n=void 0,t&&e.isMouseDown&&1<r.length&&e.formulaBarVal&&e.formulaBarVal!==o?(i=e.formulaBarVal.substring(0,this.curEndPos)+this.parent.listSeparator,n=e.formulaBarVal.substring(this.curEndPos),this.refreshEditor(i+n,!0),this.curEndPos+=this.parent.listSeparator.length,this.curStartPos=this.curEndPos,i+=s):(i=o.substring(0,this.curStartPos)+s,n=o.substring(this.curStartPos)),a.value=i+n,this.curEndPos=i.length)},Nce.prototype.setFormulaBarCurPosition=function(e,t,i){e.setSelectionRange&&(e.focus(),e.selectionStart=t,e.selectionEnd=t,e.setSelectionRange(t,i))},Nce.prototype.initiateCurPosition=function(e){void 0===e&&(e={isCellEdit:!1});var t,i,n=this.getEditElement(this.parent.getActiveSheet(),!0);e.isCellEdit?(e=this.getCurPosition(),this.endFormulaRef||e.start!==e.end||(this.updateFormulaReference(n),i=["+","-","*","/",this.parent.listSeparator,"(","=","&",":"],e.end&&-1===i.indexOf(this.editCellData.value[e.end-1])&&(this.endFormulaRef=!0))):(i=n.innerText,(e=window.getSelection())&&e.focusNode&&e.focusNode.classList&&e.focusNode.classList.contains("e-formula-bar-panel")?(t=this.parent.element.querySelector(".e-formula-bar"),this.setFormulaBarCurPosition(t,this.curEndPos,this.curEndPos)):(i&&(t=document.createRange(),i.indexOf(")"),i.length,t.setStart(n.childNodes[0],this.curEndPos),t.setEnd(n.childNodes[0],this.curEndPos),e.removeAllRanges(),e.addRange(t)),this.editCellData.sheetIndex!==this.parent.activeSheetIndex&&(i=this.parent.element.querySelector(".e-formula-bar")).value&&(i.value.indexOf(")")===this.curEndPos-1?this.setFormulaBarCurPosition(i,this.curEndPos-1,this.curEndPos-1):this.setFormulaBarCurPosition(i,this.curEndPos,this.curEndPos))))},Nce.prototype.getEditElement=function(e,t){if(!this.isEdit&&!t||!e.frozenRows&&!e.frozenColumns)return this.editorElem;var i=this.parent.frozenRowCount(e),n=this.parent.frozenColCount(e),e=ste(e.activeCell),o=void 0;if(e[0]<i&&e[1]<n)o=this.parent.getSelectAllContent();else if(e[0]<i)o=this.parent.getColumnHeaderContent();else{if(!(e[1]<n))return this.editorElem;o=this.parent.getRowHeaderContent()}i=o.getElementsByClassName("e-spreadsheet-edit")[0];return i=!i&&t?o.appendChild(this.editorElem.cloneNode()):i},Nce.prototype.sheetChangeHandler=function(){this.isEdit||(this.editCellData.value=null)},Nce.prototype.showFormulaAlertDlg=function(e,i){var n,o,r=this,t=this.parent.serviceLocator.getService(ope),s=this.parent.serviceLocator.getService("dialog"),e=this.getFormulaErrorKey(e),a=t.getConstant(e),e=s.dialogInstance;return e&&e.visible&&e.element.classList.contains("e-circularref-dlg")||s.show({width:400,isModal:!0,showCloseIcon:!0,target:this.parent.element,cssClass:"e-validation-error-dlg e-circularref-dlg",content:a,beforeOpen:function(e){if(i){var t=r.parent.getActiveSheet(),t={dialogName:"CircularReferenceDialog",element:e.element,target:e.target,cancel:e.cancel,cellAddress:t.name+"!"+t.activeCell,content:a};if(r.parent.trigger("dialogBeforeOpen",t),t.cancel)return void(e.cancel=o=!0);t.content!==a&&(s.dialogInstance.content=t.content,s.dialogInstance.dataBind())}0<window.getSelection().rangeCount&&(e=window.getSelection().getRangeAt(0),n=e.endOffset)},buttons:[{buttonModel:{content:t.getConstant("Ok"),isPrimary:!0},click:function(){return s.hide()}}],close:function(){var e,t,i;o||((e=r.getEditElement(r.parent.getActiveSheet())).childElementCount&&(t=e.textContent,n=t.length,e.textContent=t),t=document.getSelection(),(i=document.createRange()).setStart(e.firstChild,n),i.collapse(!0),t.removeAllRanges(),t.addRange(i),e.focus())}},!1),o},Nce.prototype.getFormulaErrorKey=function(e){var t;switch(e){case"invalid arguments":t="InvalidArguments";break;case"improper formula":t="ImproperFormula";break;case"empty expression":t="EmptyExpression";break;case"mismatched parentheses":t="MismatchedParenthesis";break;case"mismatched string quotes":t="MismatchedStringQuotes";break;case"wrong number of arguments":t="WrongNumberOfArguments";break;case"requires 3 arguments":t="Requires3Arguments";break;case"#CIRCULARREF!":t="FormulaCircularRef";break;default:t="InvalidFormulaError"}return t},Nce.prototype.readOnlyAlertHandler=function(){var e,i=this,n=this.parent.serviceLocator.getService(ope),o=this.parent.serviceLocator.getService("dialog"),t=this.parent.element.querySelector(".e-find-dlg");je(t)||(e=At(t,"dialog")),o.show({content:n.getConstant("ReadonlyAlert"),isModal:!0,closeOnEscape:!0,showCloseIcon:!0,width:"400px",cssClass:"e-readonly-alert-dlg",beforeOpen:function(e){var t={dialogName:"ReadOnlyAlertDialog",content:n.getConstant("ReadonlyAlert"),element:e.element,target:e.target,cancel:e.cancel};i.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(o.dialogInstance.content=t.content,sce(i.parent.element))},close:function(){je(t)||(o.dialogInstance=e),sce(i.parent.element)}})},Nce.prototype.finiteAlertHandler=function(){var e=this.parent.serviceLocator.getService(ope);this.parent.serviceLocator.getService("dialog").show({header:e.getConstant("Alert"),content:e.getConstant("FiniteAlert"),isModal:!0,closeOnEscape:!0,showCloseIcon:!0,width:"400px",cssClass:"e-finite-alert-dlg"})};var Oce=Nce;function Nce(e){this.editorElem=null,this.editCellData={},this.isEdit=!1,this.isCellEdit=!0,this.isNewValueEdit=!0,this.isAltEnter=!1,this.curEndPos=null,this.curStartPos=null,this.uniqueColl="",this.uniqueActCell="",this.isSpill=!1,this.keyCodes={BACKSPACE:8,SPACE:32,TAB:9,DELETE:46,ESC:27,ENTER:13,FIRSTALPHABET:65,LASTALPHABET:90,FIRSTNUMBER:48,LASTNUMBER:59,FIRSTNUMPAD:96,LASTNUMPAD:111,SYMBOLSETONESTART:186,SYMBOLSETONEEND:192,SYMBOLSETTWOSTART:219,SYMBOLSETTWOEND:222,FIREFOXEQUALPLUS:61,FIREFOXMINUS:173,F2:113},this.formulaErrorStrings=["mismatched parentheses","requires 3 arguments","improper formula","empty expression","mismatched string quotes","wrong number of arguments","invalid arguments"],this.parent=e,this.addEventListener()}_ce.prototype.addEventListener=function(){this.parent.on(cse,this.init,this),this.parent.on(use,this.mouseDownHandler,this),this.parent.on(Tse,this.virtualContentLoadedHandler,this),this.parent.on(Ese,this.cellNavigateHandler,this),this.parent.on(Ose,this.selectRange,this),this.parent.on(iae,this.rowHeightChanged,this),this.parent.on(nae,this.colWidthChanged,this),this.parent.on(ole,this.protectHandler,this),this.parent.on(gle,this.initiateFormulaSelection,this),this.parent.on(fle,this.clearBorder,this),this.parent.on(xle,this.getRowIdxFromClientY,this),this.parent.on(Ile,this.getColIdxFromClientX,this),this.parent.on(Coe,this.getRowIdxFromClientY,this),this.parent.on(Soe,this.getColIdxFromClientX,this),this.parent.on(Fle,this.chartBorderHandler,this),this.parent.on(Gle,this.isTouchSelectionStarted,this),this.parent.on(Nse,this.selectionByKeydown,this)},_ce.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(cse,this.init),this.parent.off(use,this.mouseDownHandler),this.parent.off(Tse,this.virtualContentLoadedHandler),this.parent.off(Ese,this.cellNavigateHandler),this.parent.off(Ose,this.selectRange),this.parent.off(iae,this.rowHeightChanged),this.parent.off(nae,this.colWidthChanged),this.parent.off(ole,this.protectHandler),this.parent.off(gle,this.initiateFormulaSelection),this.parent.off(fle,this.clearBorder),this.parent.off(xle,this.getRowIdxFromClientY),this.parent.off(Ile,this.getColIdxFromClientX),this.parent.off(Coe,this.getRowIdxFromClientY),this.parent.off(Soe,this.getColIdxFromClientX),this.parent.off(Fle,this.chartBorderHandler),this.parent.off(Gle,this.isTouchSelectionStarted),this.parent.off(Nse,this.selectionByKeydown))},_ce.prototype.isTouchSelectionStarted=function(e){e.touchSelectionStarted=this.touchSelectionStarted},_ce.prototype.selectionByKeydown=function(e){this.selectRangeByIdx(e.range,e.e,!1,!1,!1,!1,void 0,!1)},_ce.prototype.rowHeightChanged=function(s){var a=this;s.threshold&&cpe(function(){var e,t,i,n,o,r;a.parent&&(r=a.parent.getActiveSheet(),(e=a.getActiveCell())&&(r.frozenRows||r.frozenColumns||r.selectedRange.includes(" "))?a.selectRange({address:r.selectedRange,isRowHeightChanged:!0}):(o={range:t=fte(rte(r.selectedRange)),isActiveCell:!1,skipChecking:!0},e&&(i=ste(r.activeCell)[0],a.parent.notify(Lne,o),o.isActiveCell&&(n=1<Kre(t[0],t[1],r,!1,!0).rowSpan&&t[0]<=s.rowIdx&&t[2]>=s.rowIdx),i===s.rowIdx||n?e.style.height=parseFloat(e.style.height)+s.threshold+"px":i>s.rowIdx&&(e.style.top=parseFloat(e.style.top)+s.threshold+"px")),!(e=a.getSelectionElement())||n||t[0]===t[2]&&t[1]===t[3]||(o=t[0],r=t[2],o<=s.rowIdx&&r>=s.rowIdx&&e?e.style.height=parseFloat(e.style.height)+s.threshold+"px":o>s.rowIdx&&e&&(e.style.top=parseFloat(e.style.top)+s.threshold+"px"))))})},_ce.prototype.colWidthChanged=function(a){var l=this;a.threshold&&cpe(function(){var e,t,i,n,o,r,s;l.parent&&(r=l.parent.getActiveSheet(),e=l.getActiveCell(),t=l.parent.enableRtl,e&&(r.frozenRows||r.frozenColumns||r.selectedRange.includes(" "))?l.selectRange({address:r.selectedRange}):(s={range:i=fte(rte(r.selectedRange)),isActiveCell:!1,skipChecking:!0},e&&(l.parent.notify(Lne,s),n=ste(r.activeCell)[1],s.isActiveCell&&(o=1<(s=Kre(i[0],i[1],r,!1,!0)).rowSpan||1<s.colSpan),n===a.colIdx||o?e.style.width=parseFloat(e.style.width)+a.threshold+"px":n>a.colIdx&&(t?e.style.right=parseFloat(e.style.right)+a.threshold+"px":e.style.left=parseFloat(e.style.left)+a.threshold+"px")),!(e=l.getSelectionElement())||o||i[0]===i[2]&&i[1]===i[3]||(r=i[1],s=i[3],r<=a.colIdx&&s>=a.colIdx&&e?e.style.width=parseFloat(e.style.width)+a.threshold+"px":r>a.colIdx&&e&&(t?e.style.right=parseFloat(e.style.right)+a.threshold+"px":e.style.left=parseFloat(e.style.left)+a.threshold+"px"))))})},_ce.prototype.selectRange=function(e){e.address="Single"===this.parent.selectionSettings.mode?hte(ste(e.address)):e.address,this.selectMultiRange(e.address,null,null,e.skipChecking,e.isRowHeightChanged)},_ce.prototype.init=function(){this.createSelectionElement();var e=this.parent.getActiveSheet(),t=fte(rte(e.selectedRange)),i=ste(e.activeCell),t=t[0]<=i[0]&&t[2]>=i[0]&&t[1]<=i[1]&&t[3]>=i[1];this.selectMultiRange(e.selectedRange,!0,t)},_ce.prototype.selectMultiRange=function(e,i,n,o,r){var s=this,t=this.parent.activeSheetIndex;-1<e.indexOf("!")&&(t=Bre(this.parent,Lre(e)),e=e.substring(e.lastIndexOf("!")+1)),this.parent.activeSheetIndex===t?e.split(" ").forEach(function(e,t){s.selectRangeByIdx(rte(e),{type:"mousedown",ctrlKey:0!==t},null,n,i,o,void 0,!1,r)}):Ore(this.parent,e,this.parent.sheets[t])},_ce.prototype.createSelectionElement=function(){var e=this.parent.getMainContent(),t=this.parent.createElement("div",{className:"e-selection"});e.appendChild(t),t=this.parent.createElement("div",{className:"e-active-cell"}),e.appendChild(t)},_ce.prototype.isMergeActiveCell=function(e,t,i,n){var e=Kre(i,n,e,!1,!0);return!!(e.rowSpan&&1!==e.rowSpan||e.colSpan&&1!==e.colSpan)&&(this.parent.notify(Rne,e={range:[i,n,i,n]}),(i=e.range)[0]===t[0])&&i[1]===t[1]},_ce.prototype.mouseDownHandler=function(e){var t=this;if(this.isNoteActiveElement=!je(document)&&!je(document.activeElement)&&"string"==typeof document.activeElement.className&&-1<document.activeElement.className.indexOf("e-addNoteContainer"),!(z(e.target,".e-scrollbar")||e.target.classList.contains("e-main-panel")||e.target.classList.contains("e-sheet"))){var i={action:"getCurrentEditValue",editedValue:""},n=this.parent.getActiveSheet(),i=(this.parent.notify(mse,i),Poe(i.editedValue,!0)),o=this.parent.enableNotes&&!je(this.parent.spreadsheetNoteModule.noteCellIndexes)?this.parent.spreadsheetNoteModule.noteCellIndexes:ste(this.parent.getActiveSheet().activeCell),r=this.parent.getCell(o[0],o[1]);if(!je(r)&&null!==r.children&&0<r.children.length&&this.isNoteActiveElement&&r.children[r.children.length-1].classList.contains("e-addNoteIndicator")&&(r=!je(m=Kre(o[0],o[1],n))&&m.notes?"editNote":"addNote",s=document.getElementsByClassName("e-addNoteContainer")[0],l=Wre(this.parent,this.parent.activeSheetIndex)+"!"+hte(o),je(s)||je(s.value)||"e-addNoteContainer"===e.target.className||!je(m)&&!je(m.notes)&&m.notes===s.value?"e-addNoteContainer"!==e.target.className&&Yoe(this.parent,this.parent.getActiveSheet(),{rowIdx:o[0],colIdx:o[1],preventEvt:!0,cell:{isNoteEditable:!1}}):(this.parent.notify(Dae,{args:{action:"beforeCellSave",eventArgs:{address:l}}}),Yoe(this.parent,this.parent.getActiveSheet(),{rowIdx:o[0],colIdx:o[1],preventEvt:!0,cell:{notes:s.value,isNoteEditable:!1}}),o={notes:s.value,address:l},this.parent.notify(Vae,{eventArgs:o,action:r})),this.parent.spreadsheetNoteModule.isShowNote=null),!this.isNoteTouch&&"e-addNoteContainer"!==e.target.className&&document.getElementsByClassName("e-addNoteContainer")&&0<document.getElementsByClassName("e-addNoteContainer").length&&this.parent.notify(Cae,""),this.isNoteTouch&&-1<e.type.indexOf("mouse")&&(this.isNoteTouch=!1),!this.parent.isEdit||i){var s=document.getElementById(this.parent.element.id+"_overlay");if("string"==typeof e.target.className){if(-1<e.target.className.indexOf("e-ss-overlay"))return}else s&&s.classList.remove("e-ss-overlay-active");if(z(e.target,".e-datavisualization-chart"))return;if(n.isProtected&&!n.protectSettings.selectCells&&!n.protectSettings.selectUnLockedCells)return;if(!z(e.target,".e-findtool-dlg")&&!z(e.target,".e-dragfill-ddb")&&this.getSheetElement().contains(e.target)&&!e.target.classList.contains("e-colresize")&&!e.target.classList.contains("e-rowresize")){var a,l=this.parent.getActiveSheet(),o=this.parent.selectionSettings.mode,r=Ope(e),s=Npe(e),n=this.getRowIdxFromClientY({clientY:s,target:e.target}),h=this.getColIdxFromClientX({clientX:r,target:e.target}),d=ste(l.activeCell),p=void 0,c=void 0;if(l.showHeaders&&(f=e.target,l.frozenColumns||l.frozenRows?(c=(g=this.parent.getSelectAllContent().querySelector("thead"))?(this.parent.getColumnHeaderContent().contains(f)||g.contains(f))&&f.classList.contains("e-header-cell")||f.classList.contains("e-selectall-table")&&n<0&&h>=this.parent.frozenColCount(l):this.parent.getColumnHeaderContent().contains(f)&&f.classList.contains("e-header-cell"),p=(g=this.parent.getSelectAllContent().querySelector("tbody"))?(this.parent.getRowHeaderContent().contains(f)||g.contains(f))&&f.classList.contains("e-header-cell")||f.classList.contains("e-selectall-table")&&h<0&&n>=this.parent.frozenRowCount(l):this.parent.getRowHeaderContent().contains(f)&&f.classList.contains("e-header-cell"),-1===n&&(n=0),-1===h&&(h=0)):(p=this.parent.getRowHeaderContent().contains(e.target),c=this.parent.getColumnHeaderContent().contains(e.target))),!l.frozenRows&&!l.frozenColumns||c||p||(a=e.target,-1<(g=["e-rowhdr-table","e-selectall-table","e-colhdr-table"].findIndex(function(e){return a.classList.contains(e)}))&&(f=z(a,[".e-row-header",".e-selectall-container",".e-column-header"][g]))&&f.style.zIndex&&((m=Kre(n,h,l))&&m.validation&&"List"===m.validation.type||tpe(l.columns[h],n,h)&&"List"===l.columns[h].validation.type)&&(g=this.parent.getCell(n,h))&&(f=g.querySelector(".e-validation-list"))&&r>=(m=f.getBoundingClientRect()).left&&r<=m.right&&s>=m.top&&s<=m.bottom&&(g=f.querySelector(".e-dropdownlist"))&&(r=At(g,"dropdownlist"))&&r.showPopup()),3===e.which&&this.isSelected(n,h))return;e.target.classList.contains("e-autofill")&&(this.isautoFillClicked=!0,(s=e.target.parentElement.querySelector(".e-dragfill-ddb"))&&!s.classList.contains("e-hide")||(this.dAutoFillCell=l.selectedRange));var u,g,m=rte(l.topLeftCell),f=void 0,r=(p?(this.isRowSelected=!0,e.shiftKey&&"Single"!==o?this.startCell||(this.startCell=[m[0],0]):this.startCell=[n,0],f=[this.startCell[0],l.frozenColumns?m[1]:0,n,l.colCount-1]):c?(this.isColSelected=!0,e.shiftKey&&"Single"!==o?this.startCell||(this.startCell=[0,m[1]]):this.startCell=[0,h],f=[l.frozenRows?m[0]:0,this.startCell[1],l.rowCount-1,h]):z(e.target,".e-select-all-cell")?(this.startCell=[l.frozenRows?m[0]:0,l.frozenColumns?m[1]:0],f=[].concat(this.startCell,[l.rowCount-1,l.colCount-1])):e.target.classList.contains("e-sheet-content")||(e.shiftKey&&"Single"!==o||(this.startCell=[n,h]),this.isautoFillClicked)||z(e.target,".e-filloption")||(f=[].concat(this.startCell||ste(l.activeCell),[n,h])),Mpe(e)&&!p&&!c&&f&&(g=this.isRowColSelected(f),this.isRowSelected=g.isRowSelected,this.isColSelected=g.isColSelected),e.ctrlKey&&f&&l.selectedRange.includes(hte(f))),s=(!r&&"Multiple"===o&&(!Ppe(e)&&(!Mpe(e)||Mpe(e)&&(d[0]===n&&d[1]===h||this.isMergeActiveCell(l,d,n,h)))||c||p)?(document.addEventListener(Epe().split(" ")[0],this.mouseMoveEvt),F.isPointer||(F.isIos&&Mpe(e)&&e.target&&e.target.classList.contains("e-cell")&&e.preventDefault(),document.addEventListener(Epe().split(" ")[1],this.mouseMoveEvt,{passive:!1})),this.touchSelectionStarted=!0):this.touchSelectionStarted=!1,Ppe(e)||(r?this.parent.isEdit&&(u=function(e){E.remove(document,Dpe(),u),t.updateFormulaCursorPosition(e)},E.add(document,Dpe(),u,this)):E.add(document,Dpe(),this.mouseUpHandler,this)),"e-addNoteIndicator"===e.target.className||0<e.target.children.length&&-1<e.target.children[e.target.childElementCount-1].className.indexOf("e-addNoteIndicator"));if(Mpe(e)&&s&&(m=ste(hte(f).split(":")[0]),this.parent.notify(vae,{rowIndex:m[0],columnIndex:m[1],isNoteEditable:!1}),this.isNoteTouch=!0,this.parent.spreadsheetNoteModule.isNoteVisibleOnTouch=!0),Mpe(e)&&!c&&!p)return void(this.touchEvt=e);f&&this.selectRangeByIdx(f,e),!this.isNoteTouch&&-1<e.type.indexOf("mouse")&&s&&(g=ste(hte(f).split(":")[0]),this.parent.notify(vae,{rowIndex:g[0],columnIndex:g[1],isNoteEditable:!1}),this.parent.spreadsheetNoteModule.isNoteVisible=!0),this.parent.isMobileView()&&(this.parent.element.classList.add("e-mobile-focused"),this.parent.renderModule.setSheetPanelSize())}}i&&(e.target.classList.contains("e-cell")||e.target.classList.contains("e-wrap-content")||e.target.classList.contains("e-header-cell"))&&this.parent.isEdit&&(f=vte(pte((o=(f=this.parent.getActiveSheet().selectedRange).split(" "))[o.length-1]))?o[o.length-1].split(":")[0]:o[o.length-1],this.parent.notify(vle,{range:f,isSelect:!1,isMouseDown:e.ctrlKey}))}},_ce.prototype.mouseMoveHandler=function(e){var t,i,n,o,r,s,a,l,h,d=this,p=this.parent.getActiveSheet(),c=(kpe(e)&&e.preventDefault(),{action:"getCurrentEditValue",editedValue:""}),c=(this.parent.notify(mse,c),Poe(c.editedValue,!0)),u=this.parent.getMainContent().parentElement,g=this.parent.element.getElementsByClassName("e-scroller")[0],m=u.getBoundingClientRect(),f=this.parent.frozenColCount(p),y=m.left+this.parent.sheetModule.getRowHeaderWidth(p,!1,!0),v=m.right-ype(),b=m.top,w=m.bottom,m=Ope(e),C=Npe(e),S=this.isRowSelected?p.colCount-1:this.getColIdxFromClientX({clientX:m,target:e.target}),A=this.isColSelected?p.rowCount-1:this.getRowIdxFromClientY({clientY:C,target:e.target}),x=(i=e.ctrlKey?rte((x=p.selectedRange.split(" "))[x.length-1]):rte(p.selectedRange),F.isDevice&&((x=screen.availWidth)-40<=v&&(v-=40-(x-v)),!p.showHeaders)&&y<40&&(y+=40-y),{range:[A,S,A,S]});this.parent.notify(Rne,x),x.range[2]===i[2]&&x.range[3]===i[3]&&C<=w&&b<=C&&m<=v&&y<=m||(x=this.parent.frozenRowCount(p),c||this.isColSelected||this.isRowSelected||(i=ste(p.activeCell)),n=w<C&&!this.isColSelected&&A<p.rowCount,o=C<b&&0<=A&&!this.isColSelected&&!!u.scrollTop&&(!x||i[0]>=x),r=v<m&&!this.isRowSelected&&S<p.colCount,s=m<y&&0<=S&&!this.isRowSelected&&!!g.scrollLeft&&(!f||i[1]>=f),this.clearInterval(),n||o||r||s?((o||s)&&(a=A,l=S),(h=function(){if(n||o){if((A=d.getRowIdxFromClientY({clientY:n?w:b}))>=p.rowCount)return void d.clearInterval();u.scrollTop+=(n?1:-1)*Wde(p,A)}if(r||s){if((S=d.getColIdxFromClientX({clientX:r?v:y,isFScroll:!0}))>=p.colCount)return void d.clearInterval();g.scrollLeft+=(r?1:-1)*Zde(p,S)}o&&p.frozenRows&&!u.scrollTop||s&&p.frozenColumns&&!g.scrollLeft?(d.selectRangeByIdx([].concat(i[0],i[1],[a,l]),e),d.clearInterval()):d.selectRangeByIdx([].concat(i[0],i[1],[A,S]),e)})(),this.scrollInterval=setInterval(function(){h(),d.clearInterval(),d.scrollInterval=setInterval(h,100)})):(C=[].concat(i[0],i[1],[A,S]),x&&C[0]<x&&C[2]>=x&&u.scrollTop&&!this.isColSelected&&(u.scrollTop=0,C[2]=x),f&&C[1]<f&&C[3]>=f&&g.scrollLeft&&!this.isRowSelected&&(g.scrollLeft=0,C[3]=f),this.isautoFillClicked&&(e.target.classList.contains("e-autofill")&&(this.dAutoFillCell=p.selectedRange),this.parent.notify(ehe,m={e:e,indexes:null}),t=C=m.indexes),this.selectRangeByIdx(C,e)),c&&this.parent.isEdit&&!z(e.target,"#"+this.parent.element.id+"_edit")&&(x=(this.isautoFillClicked?hte(t):this.parent.getActiveSheet().selectedRange).split(" "),this.parent.notify(vle,{range:x[x.length-1],isSelect:!1})))},_ce.prototype.mouseUpHandler=function(e){var t,i=this.getRowIdxFromClientY({clientY:Npe(e),target:e.target}),n=this.getColIdxFromClientX({clientX:Ope(e),target:e.target}),o=(this.clearInterval(),!Ppe(e)||this.isColSelected||this.isRowSelected||this.getRowIdxFromClientY({clientY:Npe(this.touchEvt),target:e.target})!==i||this.getColIdxFromClientX({clientX:Ope(this.touchEvt),target:e.target})!==n||this.mouseDownHandler(e),document.removeEventListener(Epe().split(" ")[0],this.mouseMoveEvt),F.isPointer||document.removeEventListener(Epe().split(" ")[1],this.mouseMoveEvt),E.remove(document,Dpe(),this.mouseUpHandler),this.parent.getActiveSheet());(o.frozenRows||o.frozenColumns)&&Ape(this.parent.element,null,"e-cur-selection",!0,!0),this.parent.notify(Dse,e),this.isautoFillClicked?(t=rte((o=this.parent.getActiveSheet()).selectedRange),this.isColSelected&&t[1]===n||this.isRowSelected&&t[0]===i||((n=e.target.parentElement.querySelector(".e-dragfill-ddb"))&&!n.classList.contains("e-hide")||(this.dAutoFillCell=o.selectedRange),this.parent.notify($le,{event:e,dAutoFillCell:this.dAutoFillCell})),this.isautoFillClicked=!1):e.ctrlKey||lce(Nre(this.parent.getActiveSheet()))?this.parent.notify(the,null):this.parent.notify(Jle,null),this.updateFormulaCursorPosition(e)},_ce.prototype.updateFormulaCursorPosition=function(e){var t;this.parent.isEdit&&(this.parent.notify(mse,t={action:"getCurrentEditValue",editedValue:""}),Poe(t.editedValue,!0))&&this.parent.notify(mle,{isCellEdit:e.target.classList.contains("e-spreadsheet-edit")})},_ce.prototype.isSelected=function(e,t){for(var i,n=!1,o=this.parent.getActiveSheet().selectedRange.split(" "),r=0;r<o.length;r++)if((i=fte(rte(o[r])))[0]<=e&&e<=i[2]&&i[1]<=t&&t<=i[3]){n=!0;break}return n},_ce.prototype.virtualContentLoadedHandler=function(n){var o,r,s,a=this,l=this.parent.getActiveSheet();l.selectedRange.split(" ").forEach(function(e,t){var i;o=rte(e),s=0===o[1]&&o[3]===n.prevRowColCnt.colCount-1,r=0===o[0]&&o[2]===n.prevRowColCnt.rowCount-1,s||r?(o=r&&s?[0,0,l.rowCount-1,l.colCount-1]:r?[0,o[1],l.rowCount-1,o[3]]:[o[0],0,o[2],l.colCount-1],l.frozenRows||l.frozenColumns?a.selectRangeByIdx(o,{type:"mousedown",ctrlKey:0!==t},!1,!1,!1,!1,void 0,!0):a.selectRangeByIdx(o,null,!0,null,null,null,t)):(o=rte(e),e=a.parent.viewport.topIndex+a.parent.frozenRowCount(l),i=a.parent.viewport.leftIndex+a.parent.frozenColCount(l),a.highlightHdr(o,0!==t,o[0]>=e||o[2]>=e,o[1]>=i||o[3]>=i))})},_ce.prototype.clearInterval=function(){this.scrollInterval&&(clearInterval(this.scrollInterval),this.scrollInterval=null)},_ce.prototype.getScrollLeft=function(){return this.parent.scrollModule?this.parent.scrollModule.prevScroll.scrollLeft:0},_ce.prototype.cellNavigateHandler=function(e){var t=this.parent.getActiveSheet();t.isProtected&&!t.protectSettings.selectCells&&!t.protectSettings.selectUnLockedCells||(e.type="mousedown",this.selectRangeByIdx(e.range,e,!1,!1,!1,!1,void 0,e.preventAnimation))},_ce.prototype.getColIdxFromClientX=function(e){var t,i=this,n=0,o=this.parent.getActiveSheet(),r=0;if(e.isImage)r=e.clientX;else{var s=document.getElementById(this.parent.element.id+"_sheet").getBoundingClientRect(),r=this.parent.enableRtl?s.right-this.parent.sheetModule.getRowHeaderWidth(o,!0,!0)-1-e.clientX:e.clientX-(s.left+this.parent.sheetModule.getRowHeaderWidth(o,!0,!0)+1);r+=this.parent.viewport.beforeFreezeWidth;if(e.target&&(z(e.target,".e-row-header")||z(e.target,".e-selectall-container"))&&!this.isScrollableArea(e.clientX,e.target,!0)||!(!this.parent.frozenColCount(o)||r>(s=i.parent.element.querySelector(".e-frozen-column"),parseInt(s.style[i.parent.enableRtl?"right":"left"],10)/i.parent.viewport.scaleX)||e.isFScroll)||(r+=this.getScrollLeft()/this.parent.viewport.scaleX),o.frozenRows&&r<0&&o.showHeaders)return-1}for(var a=0;;a++)if(t=n+=Zde(o,a,null,!e.isImage)/this.parent.viewport.scaleX,r<(e.isImage?Number(cce(t).toFixed(2)):t)||this.parent.scrollSettings.isFinite&&a===o.colCount-1)return e.isImage||(e.size=r),e.clientX=a},_ce.prototype.isScrollableArea=function(e,t,i){return!!t.classList.contains("e-table")&&(i?e>this.parent.getMainContent().getBoundingClientRect().left:e>this.parent.getMainContent().parentElement.getBoundingClientRect().top)},_ce.prototype.getRowIdxFromClientY=function(e){var t,i=0,n=this.parent.getActiveSheet(),o=0;if(e.isImage)o=e.clientY;else{var r=document.getElementById(this.parent.element.id+"_sheet"),o=e.clientY+this.parent.viewport.beforeFreezeHeight-(r.getBoundingClientRect().top+(n.showHeaders?31/this.parent.viewport.scaleY:0));if(e.target&&z(e.target,".e-header-panel")&&!this.isScrollableArea(e.clientY,e.target)||(o+=this.parent.getMainContent().parentElement.scrollTop/this.parent.viewport.scaleY),n.frozenColumns&&o<0&&n.showHeaders)return-1}for(var s=0;;s++)if(t=i+=Wde(n,s,!e.isImage)/this.parent.viewport.scaleY,o<(e.isImage?Number(cce(t).toFixed(2)):t)||this.parent.scrollSettings.isFinite&&s===n.rowCount-1)return e.isImage||(e.size=o),e.clientY=s},_ce.prototype.initFormulaReferenceIndicator=function(e){var t;this.parent.isEdit&&((t=this.parent.createElement("div",{className:"e-formularef-indicator"})).appendChild(this.parent.createElement("div",{className:"e-top"})),t.appendChild(this.parent.createElement("div",{className:"e-bottom"})),t.appendChild(this.parent.createElement("div",{className:"e-left"})),t.appendChild(this.parent.createElement("div",{className:"e-right"})),this.parent.getMainContent().appendChild(t),Spe(this.parent,t,e,"e-formularef-indicator"))},_ce.prototype.isMouseEvent=function(e){return Bpe(e)||Lpe(e)||Fpe(e)},_ce.prototype.selectRangeByIdx=function(e,t,i,n,o,r,s,a,l){var h=this,d=t&&this.isMouseEvent(t);if(!(t&&t.target&&d&&z(t.target,"#"+this.parent.element.id+"_edit"))){var p,c,u={action:"getCurrentEditValue",editedValue:"",endFormulaRef:!1},u=(this.parent.notify(mse,u),!!this.parent.isEdit&&Poe(u.editedValue,!0)&&!u.endFormulaRef),g=t&&t.ctrlKey&&Bpe(t),m=(g||(p=this.getSelectionElement(t,s)),this.parent.getActiveSheet()),f=rte(m.topLeftCell),y=this.parent.element.querySelector(".e-formularef-indicator"),r={range:[].slice.call(e),isActiveCell:!1,skipChecking:r},v=this.isRowColSelected(e),b=(v.isColSelected||v.isRowSelected||this.parent.notify(Lne,r),e!==r.range&&(c=!0),e=r.range,new Promise(function(e){e(void 0)})),w={range:hte(e),cancel:!1};if(m.isProtected){var C=Kre(e[2],e[3],m);if(m.protectSettings.selectUnLockedCells&&!m.protectSettings.selectCells)if(je(C)){if(!m.protectSettings.selectCells)return}else{if(!0===C.isLocked||je(C.isLocked))return;C=this.parent.element.getElementsByClassName("e-sheet-panel")[0];C&&C.classList.contains("e-protected")&&C.classList.remove("e-protected")}}if(this.parent.trigger("beforeSelect",w),!w.cancel){if(u&&y&&y.parentElement.removeChild(y),l||this.parent.notify(Zle,null),!vte(e)&&!r.isActiveCell||g){if(g){if(void 0===s){C=hte(e);if(m.selectedRange.includes(C)&&!u)return C=1<(x=m.selectedRange.split(" ")).length?(x.splice(x.indexOf(C),1),x.join(" ")):m.activeCell+":"+m.activeCell,void this.selectRange({address:C})}p=this.getSelectionElement(t,s)}if(u&&this.parent.isEdit){if(t&&t.target&&(!d||!t.target.classList.contains("e-spreadsheet-edit"))&&this.parent.isEdit){A={range:hte(e),isSelect:!0};if(this.parent.notify(vle,A),A.isAlertDlgOpen)return;this.initFormulaReferenceIndicator(e)}}else{var S=void 0,w=(p&&(p.classList.remove("e-hide"),m.frozenRows||m.frozenColumns)&&((t&&t.target||g)&&(S="e-cur-selection",Fpe(t)&&p.classList.contains("e-cur-selection")?p.classList.add("e-hide"):p.classList.add(S)),!g)&&(this.isColSelected||this.isRowSelected)&&Bpe(t)&&(Ape(this.parent.getSelectAllContent(),null,"e-selection"),Ape(this.parent.getColumnHeaderContent(),null,"e-selection"),Ape(this.parent.getRowHeaderContent(),null,"e-selection")),this.isColSelected&&this.isRowSelected?void 0:this.getOffset(e[2],e[3]));c&&w&&(w.left={idx:0,size:0}),b=Spe(this.parent,p,e,S,a,g,g&&!t.target)||b}}else if(p&&(p.classList.contains("e-multi-range")||p.classList.add("e-hide"),m.frozenRows||m.frozenColumns)&&(S=Fpe(t)?"e-cur-selection":"e-selection",Ape(this.parent.getSelectAllContent(),null,S,!0),Ape(this.parent.getColumnHeaderContent(),null,S,!0),Ape(this.parent.getRowHeaderContent(),null,S,!0)),m.frozenColumns||m.frozenRows||!p||Spe(this.parent,p,e),u&&t&&t.target&&(!d||!t.target.classList.contains("e-spreadsheet-edit"))&&this.parent.isEdit){var A={range:hte(e).split(":")[0],isSelect:!0};if(this.parent.notify(vle,A),A.isAlertDlgOpen)return;this.initFormulaReferenceIndicator(e)}var x,y={action:"getCurrentEditSheetIdx",sheetIndex:null},l=(this.parent.notify(mse,y),m.frozenColumns&&0<e[1]&&e[1]===f[1]&&e[3]===m.colCount-1&&(e[1]=0),m.frozenRows&&0<e[0]&&e[0]===f[0]&&e[2]===m.rowCount-1&&(e[0]=0),hte(e));t&&t.ctrlKey&&(Fpe(t)||Lpe(t))&&!u?l=m.selectedRange.slice(0,m.selectedRange.lastIndexOf(" "))+" "+l:-1<s&&((x=m.selectedRange.split(" "))[s]=l,l=x.join(" ")),u||this.isautoFillClicked?o||this.isautoFillClicked||Ore(this.parent,l,m,g):(r=!1,m.selectedRange!==l&&(r=!0),Ore(this.parent,l,m,g),r&&b.then(function(){h.parent&&h.parent.trigger("select",{range:h.parent.getActiveSheet().selectedRange})})),v=this.isRowColSelected(e),this.isRowSelected=v.isRowSelected,this.isColSelected=v.isColSelected,this.highlightHdr(e,t&&t.ctrlKey),i||t&&("mousemove"===t.type||kpe(t))||(u?y.sheetIndex===this.parent.getActiveSheet().id-1&&o?this.updateActiveCell((n=!0)?rte(m.activeCell):e,o,a):this.parent.isEdit||this.updateActiveCell(n?rte(m.activeCell):e,o,a):this.updateActiveCell(n?rte(m.activeCell):e,o,a)),je(t)&&(t={type:"mousedown"}),u&&o||this.parent.notify(poe,t),g||lce(Nre(this.parent.getActiveSheet()))?this.parent.notify(the,null):this.parent.notify(Jle,{preventAnimation:a}),this.parent.showAggregate&&this.parent.notify(hle,{}),this.parent.notify(Sle,null)}}},_ce.prototype.isRowColSelected=function(e){var t=this.parent.getActiveSheet();return{isRowSelected:0===e[1]&&e[3]===t.colCount-1,isColSelected:0===e[0]&&e[2]===t.rowCount-1}},_ce.prototype.updateActiveCell=function(e,t,i){var n,o,r=this.parent.getActiveSheet(),s=rte(r.topLeftCell),a=(o=(this.isColSelected?s:e)[0],e[1]),s={range:[o,a=this.isRowSelected?s[1]:a].concat([o,a])};this.parent.notify(Rne,s),e!==s.range&&(n=!0),r.activeCell!==lte((e=s.range)[0],e[1])||t?(this.previousActiveCell=-1<r.activeCell.indexOf(":")?this.previousActiveCell:r.activeCell,this.parent.setSheetPropertyOnMute(r,"activeCell",lte(e[0],e[1])),r.isProtected&&(o=this.parent.element.querySelector(".e-formula-bar"),(a=Hoe(Kre(e[0],e[1],r),Kde(r,e[1])))&&o&&!o.disabled?o.disabled=!0:!a&&o&&o.disabled&&(o.disabled=!1)),this.getActiveCell()&&(s=this.getOffset(e[2],e[3]),n&&(s.left={idx:0,size:0}),Spe(this.parent,this.getActiveCell(),e,"e-active-cell",i)),this.parent.notify(Nie,null)):Spe(this.parent,this.getActiveCell(),e,"e-active-cell",i)},_ce.prototype.getOffset=function(e,t){var i={left:{idx:0,size:0},top:{idx:0,size:0}};return this.parent.scrollModule&&(t>=this.parent.scrollModule.offset.left.idx&&(i.left=this.parent.scrollModule.offset.left),e>=this.parent.scrollModule.offset.top.idx)&&(i.top=this.parent.scrollModule.offset.top),i},_ce.prototype.getSelectionElement=function(e,t){var i,n=this.parent.getActiveSheet();return e&&e.ctrlKey&&!this.parent.isEdit?Lpe(e)||Fpe(e)?n.frozenColumns||n.frozenRows?(i=this.parent.getMainContent().querySelector(".e-cur-selection"))||(i=this.parent.element.querySelector(".e-multi-range"))&&i.cloneNode():this.parent.getMainContent().querySelector(".e-selection:last-child"):((i=(e=this.parent.getMainContent().getElementsByClassName("e-selection")[0]).cloneNode()).classList.add("e-multi-range"),n.frozenColumns||n.frozenRows?(n.selectedRange.includes(" ")||(e.classList.remove("e-hide"),Spe(this.parent,e,fte(rte(n.selectedRange)),void 0,!1,!0)),!this.parent.getMainContent().querySelector(".e-multi-range")&&e.classList.contains("e-hide")?e:i):(e.classList.remove("e-hide"),this.parent.getMainContent().appendChild(i))):-1<t?(n.frozenRows||n.frozenColumns?this.parent.element.querySelector(".e-sheet"):this.parent.getMainContent()).getElementsByClassName("e-selection")[t]:([].slice.call(this.parent.element.getElementsByClassName("e-multi-range")).forEach(function(e){ue(e)}),this.parent.getMainContent().getElementsByClassName("e-selection")[0])},_ce.prototype.getActiveCell=function(){return this.parent.getMainContent().getElementsByClassName("e-active-cell")[0]},_ce.prototype.getSheetElement=function(){return document.getElementById(this.parent.element.id+"_sheet")},_ce.prototype.highlightHdr=function(e,t,i,n){var o,r,s,a,l,h,d,p,c,u=this,g=(void 0===i&&(i=!0),void 0===n&&(n=!0),this.parent.getActiveSheet());g.showHeaders&&(t||(q(this.getSheetElement().querySelectorAll(".e-highlight"),"e-highlight"),q(this.getSheetElement().querySelectorAll(".e-prev-highlight"),"e-prev-highlight")),(t=this.parent.element.getElementsByClassName("e-select-all-cell")[0])&&q([t],["e-prev-highlight-right","e-prev-highlight-bottom"]),o=[],r=[],s=fte(e),this.isRowSelected&&(s[1]=Woe(g,s[1],!0,"columns")),this.isColSelected&&(s[0]=Woe(g,s[0],!0)),a=[0,0,0,0],l=[0,0,0,0],h=ste(g.topLeftCell),e=function(e,t,i){var n,o,r;e&&s[p]<e?(h[p]=Woe(g,h[p],!0,t),(r=Woe(g,s[p],!0,t))===h[p]&&(s[p]=r),n=u.parent.hiddenCount(h[p],s[p]-1,t,g),a[p]=s[p]-n-h[p],o=s[c]<e?s[c]:e-1,a[c]=o-u.parent.hiddenCount(s[p],o,t,g)-n-h[p]+1,o=u.parent.viewport[""+i]+e,s[c]>=o&&(l[p]=0,l[p]-=u.parent.hiddenCount(o,o,t,g),l[c]=s[c]-u.parent.hiddenCount(o,s[c],t,g)-o+1)):((o=Woe(g,u.parent.viewport[""+i]+e,!0,t))===(r=Woe(g,s[p],!0,t))&&(s[p]=o),n=u.parent.hiddenCount(o,s[p]-1,t,g),l[p]=s[p]-n-o,l[c]=s[c]-u.parent.hiddenCount(s[p],s[c],t,g)-n-o+1)},d=function(e,t,i){for(var n=[].slice.call(t.getElementsByClassName("e-header-cell")),o=e[p];o<e[c];o++)n[o]&&i.push(n[o])},i&&(p=0,c=2,e(this.parent.frozenRowCount(g),"rows","topIndex"),g.frozenRows&&(i=this.parent.getSelectAllContent().querySelector("tbody"))&&d(a,i,o),d(l,this.parent.getRowHeaderContent(),o)),n&&(p=1,c=3,e(this.parent.frozenColCount(g),"columns","leftIndex"),g.frozenColumns&&(i=this.parent.getSelectAllContent().querySelector("thead"))&&d(a,i,r),d(l,this.parent.getColumnHeaderContent(),r)),(g.isProtected&&!g.protectSettings.selectCells?q:U)([].concat(o,r),"e-highlight"),o.length&&o[0].parentElement.previousElementSibling&&o[0].parentElement.previousElementSibling.classList.add("e-prev-highlight"),r.length&&r[0].previousElementSibling&&r[0].previousElementSibling.classList.add("e-prev-highlight"),this.isRowSelected&&this.isColSelected&&(g.isProtected&&!g.protectSettings.selectCells?document.getElementById(this.parent.element.id+"_select_all").classList.remove("e-highlight"):document.getElementById(this.parent.element.id+"_select_all").classList.add("e-highlight")),t)&&(Woe(g,s[0],!0)===Woe(g,0,!0)&&t.classList.add("e-prev-highlight-bottom"),Woe(g,s[1],!0,"columns")===Woe(g,0,!0,"columns"))&&t.classList.add("e-prev-highlight-right")},_ce.prototype.protectHandler=function(){var e=rte(this.parent.getActiveSheet().selectedRange),t=fte(e),i=ste(this.parent.getActiveSheet().activeCell),t=t[0]<=i[0]&&t[2]>=i[0]&&t[1]<=i[1]&&t[3]>=i[1];this.selectRangeByIdx(e,null,null,t)},_ce.prototype.initiateFormulaSelection=function(e){this.processFormulaEditRange(e.range,e.formulaSheetIdx)},_ce.prototype.processFormulaEditRange=function(e,t){for(var i,n,o=t,r=0,e={formula:e},s=(this.parent.notify(voe,e),e.formulaArr),a=s.length,l=0,h=[["e-vborderright","e-vborderbottom"],["e-pborderright","e-pborderbottom"],["e-cborderright","e-cborderbottom"],["e-gborderright","e-gborderbottom"],["e-oborderright","e-oborderbottom"],["e-bborderright","e-bborderbottom"]],d=(this.clearBorder(),this.parent.getActiveSheet().id-1);r<a&&(n=s[r],!(-1<this.invalidOperators.indexOf(n)));)Boe(n.toUpperCase())&&(n=n.replace(/\$/g,""),0<r&&s[r-1].lastIndexOf("!")===s[r-1].length-1&&(o=(i=s[r-1].substring(1,s[r-1].lastIndexOf("!")-1))?Bre(this.parent,i):o),":"===s[r+1]&&s[++r+1]&&Boe(s[r+1].toUpperCase())&&(n=n+":"+s[r+1],r++),d===o&&this.updateFormulaEditRange(n,l,h),o=t,l++),r++},_ce.prototype.updateFormulaEditRange=function(e,t,i){var n=rte(e);this.formulaRange[t]=e,this.dStartCell={rowIndex:n[0],colIndex:n[1]},this.dEndCell={rowIndex:n[2],colIndex:n[3]},this.focusBorder(this.dStartCell,this.dEndCell,i[t%6])},_ce.prototype.chartBorderHandler=function(e){this.focusBorder(e.startcell,e.endcell,e.classes,!0)},_ce.prototype.focusBorder=function(e,t,i,n){n=!je(n)&&n;var o,r=this.parent.getActiveSheet(),e=fte([e.rowIndex,e.colIndex,t.rowIndex,t.colIndex]),t=rte(r.topLeftCell),t=this.parent.hiddenCount(t[1],e[3]-1,"columns",r);n&&0<t&&(e[1]-=t,e[3]-=t),r.frozenRows||r.frozenColumns?((t=this.parent.createElement("div",{className:n?"e-range-indicator e-chart-range":"e-range-indicator e-formuala-range"})).appendChild(this.parent.createElement("div",{className:"e-top"})),t.appendChild(this.parent.createElement("div",{className:"e-bottom"})),t.appendChild(this.parent.createElement("div",{className:"e-left"})),t.appendChild(this.parent.createElement("div",{className:"e-right"})),Spe(this.parent,t,e,"e-range-indicator")):(r=e[0],t=e[1],o=e[2],e=e[3],r&&this.getEleFromRange([r-1,t,r-1,e]).forEach(function(e){e&&(e.classList.add(i[1]),n||e.classList.add("e-formularef-selection"))}),this.getEleFromRange([r,e,o,e]).forEach(function(e){e&&(e.classList.add(i[0]),n||e.classList.add("e-formularef-selection"))}),this.getEleFromRange([o,t,o,e]).forEach(function(e){e&&(e.classList.add(i[1]),n||e.classList.add("e-formularef-selection"))}),t&&this.getEleFromRange([r,t-1,o,t-1]).forEach(function(e){e&&(e.classList.add(i[0]),n||e.classList.add("e-formularef-selection"))}))},_ce.prototype.getEleFromRange=function(e){var t,i,n,o=e[0],r=e[1],s=e[2],a=e[3],l=[];if(s<o&&(i=o,o=s,s=i),a<r&&(i=r,r=a,a=i),this.parent.scrollSettings.enableVirtualization)for(t=o;t<=s;t++)-1<(n=t)&&(n=this.parent.getRow(n,null))&&(n=n.getElementsByClassName("e-cell"),n=a===r?[n[a]]:this.getRowCells(n,r,a+1),this.merge(l,n));return l},_ce.prototype.getRowCells=function(e,t,i){for(var n=[];t<i;t++)e[t]&&n.push(e[t]);return n},_ce.prototype.merge=function(e,t){e&&t&&Array.prototype.push.apply(e,t)},_ce.prototype.clearBorder=function(){var e=this.parent.getActiveSheet();if(e.frozenColumns||e.frozenRows)[].slice.call(this.parent.element.getElementsByClassName("e-formuala-range")).forEach(function(e){G(e)});else for(var t=this.parent.element.getElementsByClassName("e-formularef-selection"),i=t.length-1;0<=i;i--)for(var n=t[i],o=["e-vborderright","e-vborderbottom","e-pborderright","e-pborderbottom","e-cborderright","e-cborderbottom","e-gborderright","e-gborderbottom","e-oborderright","e-oborderbottom","e-bborderright","e-bborderbottom","e-formularef-selection"],r=0;r<o.length;r++)n.classList.remove(o[r])},_ce.prototype.getModuleName=function(){return"selection"},_ce.prototype.destroy=function(){this.removeEventListener(),this.parent=null};var Vce=_ce;function _ce(e){this.invalidOperators=["%"],this.formulaRange=[],this.isNoteActiveElement=!1,this.isNoteTouch=!1,this.parent=e,this.addEventListener(),this.mouseMoveEvt=this.mouseMoveHandler.bind(this)}zce.prototype.onContentScroll=function(e){var t,i,n,o,r,s,a;this.parent&&(t=this.parent.getMainContent().parentElement,a=e.scrollLeft,t=e.scrollTop||t.scrollTop,i=a&&this.parent.enableRtl?this.initScrollValue-a:a,this.parent.allowAutoFill&&(o=document.querySelector("#"+this.parent.element.id+"_autofilloptionbtn-popup"),s=document.querySelector("#"+this.parent.element.id+"_autofilloptionbtn"),o)&&At(s,"dropdown-btn").toggle(),je(a)||this.prevScroll.scrollLeft===i||(o=i>this.prevScroll.scrollLeft,r=this.offset.left.size,this.offset.left=this.getColOffset(i,o,e.skipHidden),e.preventScroll||(this.parent.getColumnHeaderContent().scrollLeft=a,this.parent.getMainContent().scrollLeft=a,e.scrollLeft=a),n={cur:this.offset.left,prev:{idx:this.leftIndex,size:r},increase:o,preventScroll:e.preventScroll},this.updateTopLeftCell(o,!0),this.parent.notify(Ase,null),this.parent.notify(Sse,n),this.updateNoteContainer(),this.parent.scrollSettings.enableVirtualization||!o||this.parent.scrollSettings.isFinite||this.updateNonVirtualCols(),this.leftIndex=n.prev.idx,this.prevScroll.scrollLeft=i),Math.round(this.prevScroll.scrollTop)!==Math.round(t)&&(e.skipRowVirualScroll&&(this.prevScroll.scrollTop=0,this.offset.top={idx:0,size:0}),s=t>this.prevScroll.scrollTop,r=this.offset.top.size,this.offset.top=this.getRowOffset(t,s),n={cur:this.offset.top,prev:{idx:this.topIndex,size:r},increase:s,preventScroll:e.preventScroll},this.updateTopLeftCell(s),e.preventScroll&&this.offset.top.idx<=this.parent.getThreshold("row")?this.offset.top={idx:0,size:0}:e.skipRowVirualScroll?n.prev.idx=n.cur.idx:(this.parent.notify(Ase,null),this.parent.notify(Cse,n),this.updateNoteContainer()),this.parent.scrollSettings.enableVirtualization||!s||this.parent.scrollSettings.isFinite||this.updateNonVirtualRows(),this.topIndex=n.prev.idx,this.prevScroll.scrollTop=t),this.parent.notify(pse,a={isEdit:!1}),a.isEdit&&this.parent.element.querySelector(".e-formula-bar").focus(),this.isKeyScroll=!0)},zce.prototype.updateNoteContainer=function(){document.getElementsByClassName("e-addNoteContainer")&&0<document.getElementsByClassName("e-addNoteContainer").length&&this.parent.notify(wae,null)},zce.prototype.updateScrollValue=function(e){void 0!==e.scrollLeft&&(this.prevScroll.scrollLeft=e.scrollLeft+(this.prevScroll.scrollLeft-this.offset.left.size),this.offset.left.size=e.scrollLeft),void 0!==e.scrollTop&&(this.prevScroll.scrollTop=e.scrollTop+(this.prevScroll.scrollTop-this.offset.top.size),this.offset.top.size=e.scrollTop)},zce.prototype.updateNonVirtualRows=function(){var e=this.parent.getActiveSheet(),t=this.parent.getThreshold("row");this.offset.top.idx>e.rowCount-(this.parent.viewport.rowCount+t)&&(this.parent.renderModule.refreshUI({rowIndex:e.rowCount,colIndex:0,direction:"first",refresh:"RowPart"},lte(e.rowCount,0)+":"+lte(e.rowCount+t-1,e.colCount-1)),this.parent.setSheetPropertyOnMute(e,"rowCount",e.rowCount+t),this.parent.viewport.bottomIndex=e.rowCount-1)},zce.prototype.updateNonVirtualCols=function(){var e=this.parent.getActiveSheet(),t=this.parent.getThreshold("col");this.offset.left.idx>e.colCount-(this.parent.viewport.colCount+t)&&(this.parent.renderModule.refreshUI({rowIndex:0,colIndex:e.colCount,direction:"first",refresh:"ColumnPart"},lte(0,e.colCount)+":"+lte(e.rowCount-1,e.colCount+t-1)),this.parent.setSheetPropertyOnMute(e,"colCount",e.colCount+t),this.parent.viewport.rightIndex=e.colCount-1)},zce.prototype.updateTopLeftCell=function(e,t){var i=this.parent.getActiveSheet(),n=this.offset.top.idx,o=this.offset.left.idx;e||(n=Woe(i,n+(e=this.parent.frozenRowCount(i)),!0)-e,o=Woe(i,o+(e=this.parent.frozenColCount(i)),!0,"columns")-e),t?this.parent.updateTopLeftCell(null,o,"row"):this.parent.updateTopLeftCell(n,null,"col")},zce.prototype.getRowOffset=function(e,t){var i,n=this.offset.top.size,o=this.parent.getActiveSheet(),r=t?this.offset.top.idx+1:this.offset.top.idx?this.offset.top.idx-1:0,s=this.parent.frozenRowCount(o),a=this.parent.scrollSettings.isFinite?o.rowCount:1/0;for(e=Math.round(e);r<a;)if(t){if(n+=i=Wde(o,r-1+s,!0),Math.abs(Math.round(n)-e)<=1)return{idx:Woe(o,r+s,!0)-s,size:n};if(Math.round(n)>e)return{idx:r-1,size:n-i};r++}else{if((n-=i=Wde(o,r+s,!0))<=0)return{idx:0,size:0};if(Math.abs(Math.round(n)-e)<=1)return{idx:r,size:n};if(Math.round(n)<e)return n+=i,Math.round(n)>e?{idx:r,size:n-i<0?0:n-i}:{idx:Woe(o,r+1+s,!0)-s,size:n};r--}return{idx:this.offset.top.idx,size:this.offset.top.size}},zce.prototype.getColOffset=function(e,t,i){for(var n,o=this.offset.left.size,r=this.parent.getActiveSheet(),s=t?this.offset.left.idx+1:this.offset.left.idx?this.offset.left.idx-1:0,a=this.parent.frozenColCount(r),l=this.parent.scrollSettings.isFinite?r.colCount:1/0;s<l;)if(t){if(o+=n=Zde(r,s-1+a,i,!0),Math.abs(Math.round(o)-e)<=1)return{idx:Woe(r,s+a,!0,"columns")-a,size:o};if(Math.round(o)>e)return{idx:s-1,size:o-n};s++}else{if((o-=n=Zde(r,s+a,i,!0))<=0)return{idx:0,size:0};if(Math.abs(Math.round(o)-e)<=1)return{idx:s,size:o};if(Math.round(o)<e)return o+=n,Math.round(o)>e?{idx:s,size:(o-=n)<0?0:o}:{idx:Woe(r,s+1+a,!0,"columns")-a,size:o};s--}return{idx:this.offset.left.idx,size:this.offset.left.size}},zce.prototype.contentLoaded=function(e){var t;this.parent.scrollSettings.enableVirtualization||(t=this.parent.createElement("div",{className:"e-virtualtrack"}),this.updateNonVirualScrollWidth({scrollTrack:t}),this.parent.getScrollElement().appendChild(t)),e.left&&(this.parent.getScrollElement().scrollLeft=e.left),this.setScrollEvent(),this.parent.enableRtl&&(this.initScrollValue=this.parent.getScrollElement().scrollLeft)},zce.prototype.updateNonVirualScrollWidth=function(e){e.scrollTrack||(e.scrollTrack=this.parent.getScrollElement().getElementsByClassName("e-virtualtrack")[0]),e.scrollTrack.style.width=Math.abs(this.parent.getContentTable().getBoundingClientRect().width+(this.parent.scrollSettings.isFinite?this.parent.sheetModule.getScrollSize():0))+"px"},zce.prototype.onHeaderWheel=function(e){e.preventDefault(),this.parent.getMainContent().parentElement.scrollTop+=e.deltaY,this.parent.getScrollElement().scrollLeft+=e.deltaX},zce.prototype.onContentWheel=function(e){0!==e.deltaX&&(e.preventDefault(),this.parent.getScrollElement().scrollLeft+=e.deltaX)},zce.prototype.scrollHandler=function(e){this.onContentScroll({scrollLeft:e.target.scrollLeft})},zce.prototype.updateScroll=function(e){je(e.left)?this.parent.sheetModule.contentPanel.scrollTop=e.top:this.parent.getScrollElement().scrollLeft=e.left},zce.prototype.setScrollEvent=function(){E.add(this.parent.sheetModule.contentPanel,"scroll",this.onContentScroll,this),E.add(this.parent.getColumnHeaderContent(),"wheel",this.onHeaderWheel,this),E.add(this.parent.getSelectAllContent(),"wheel",this.onHeaderWheel,this),E.add(this.parent.getMainContent(),"wheel",this.onContentWheel,this),E.add(this.parent.getRowHeaderContent(),"wheel",this.onContentWheel,this),E.add(this.parent.getScrollElement(),"scroll",this.scrollHandler,this)},zce.prototype.initProps=function(){this.topIndex=0,this.leftIndex=0,this.prevScroll={scrollLeft:0,scrollTop:0},this.offset={left:{idx:0,size:0},top:{idx:0,size:0}}},zce.prototype.setPadding=function(e){this.parent.sheetModule.contentPanel.style.overflowY="scroll";var t,i,n=ype();0<n&&(t=this.parent.getColumnHeaderContent(),i=this.parent.enableRtl?{margin:"marginLeft",border:"borderLeftWidth"}:{margin:"marginRight",border:"borderRightWidth"},t.parentElement.style[i.margin]=n+"px",t.style[i.border]="1px"),e&&(this.initScrollValue=0)},zce.prototype.setClientX=function(e){var t;"mousedown"===e.type||"mouse"===e.pointerType||(this.parent.notify(Gle,t={touchSelectionStarted:!1}),t.touchSelectionStarted)||t.isOverlayClicked||(this.clientX=this.getPointX(e),t=document.getElementById(this.parent.element.id+"_sheet"),E.add(t,F.isPointer?"pointermove":"touchmove",this.onTouchScroll,this),E.add(t,F.isPointer?"pointerup":"touchend",this.pointerUpHandler,this))},zce.prototype.getPointX=function(e){return(e.touches&&e.touches.length?e.touches[0]:e).clientX},zce.prototype.onTouchScroll=function(e){var t,i,n;"mouse"!==e.pointerType&&(t=this.getPointX(e),i=this.clientX-t,n=this.parent.element.getElementsByClassName("e-scroller")[0],10<i||i<-10)&&0<=n.scrollLeft+i&&(e.preventDefault(),this.clientX=t,cpe(function(){n.scrollLeft+=i}))},zce.prototype.pointerUpHandler=function(){var e=document.getElementById(this.parent.element.id+"_sheet");E.remove(e,F.isPointer?"pointermove":"touchmove",this.onTouchScroll),E.remove(e,F.isPointer?"pointerup":"touchend",this.pointerUpHandler)},zce.prototype.addEventListener=function(){this.parent.on(cse,this.contentLoaded,this),this.parent.on(oae,this.onContentScroll,this),this.parent.on(Kle,this.updateScroll,this),this.parent.on(rae,this.initProps,this),this.parent.on(gse,this.destroy,this),this.parent.on(use,this.setClientX,this),this.parent.on(rhe,this.updateScrollValue,this),this.parent.scrollSettings.enableVirtualization||(this.parent.on(Tse,this.updateNonVirualScrollWidth,this),this.parent.on(nae,this.updateNonVirualScrollWidth,this))},zce.prototype.destroy=function(){this.removeEventListener();var e=document.querySelector("#"+this.parent.element.id+"_autofilloptionbtn");e&&(e=At(e,"dropdown-btn"))&&e.destroy(),this.parent=null},zce.prototype.removeEventListener=function(){this.parent.off(cse,this.contentLoaded),this.parent.off(oae,this.onContentScroll),this.parent.off(Kle,this.updateScroll),this.parent.off(rae,this.initProps),this.parent.off(gse,this.destroy),this.parent.off(use,this.setClientX),this.parent.off(rhe,this.updateScrollValue),this.parent.scrollSettings.enableVirtualization||(this.parent.off(Tse,this.updateNonVirualScrollWidth),this.parent.off(nae,this.updateNonVirualScrollWidth))};var Hce=zce;function zce(e){this.clientX=0,this.isKeyScroll=!0,this.parent=e,this.addEventListener(),this.initProps()}Wce.prototype.createVirtualElement=function(e){var t=this.parent.getActiveSheet(),i=this.parent.getMainContent(),n=(this.content=this.parent.createElement("div",{className:"e-virtualable"}),this.content.appendChild(i.querySelector(".e-table")),i.appendChild(this.content),i.appendChild(this.parent.createElement("div",{className:"e-virtualtrack"}))),o=0,r=(this.parent.sheets.length>this.scroll.length&&this.initScroll(),this.parent.viewport.bottomIndex),s=(t.rowCount>r+1||t.usedRange.rowIndex>r?(!this.parent.scrollSettings.isFinite&&t.rowCount<=t.usedRange.rowIndex&&this.parent.setSheetPropertyOnMute(t,"rowCount",t.usedRange.rowIndex+1),this.setScrollCount(t.rowCount,"row")):(this.parent.scrollSettings.isFinite||this.parent.setSheetPropertyOnMute(t,"rowCount",r+1),this.scroll[this.parent.activeSheetIndex].rowCount=t.rowCount),this.parent.frozenRowCount(t)),a=ste(t.topLeftCell),l=(e.top&&(o=e.top,t.frozenRows&&(o+=Ude(t,a[0],s-1,!0)),s=ste(t.paneTopLeftCell)[0]),o+=Ude(t,s,this.scroll[this.parent.activeSheetIndex].rowCount-1,!0),r=this.parent.viewport.rightIndex,0),h=this.parent.frozenColCount(t),s=e.left?(l=e.left,h&&(l+=$de(t,a[1],h-1,!0)),ste(t.paneTopLeftCell)[1]):h,a=t.colCount>r+1||t.usedRange.colIndex>r?(!this.parent.scrollSettings.isFinite&&t.colCount<=t.usedRange.colIndex&&this.parent.setSheetPropertyOnMute(t,"colCount",t.usedRange.colIndex+1),l+=$de(t,s,r,!0),this.setScrollCount(t.colCount,"col"),l+$de(t,r+1,this.scroll[this.parent.activeSheetIndex].colCount-1,!0)):(this.parent.scrollSettings.isFinite||this.parent.setSheetPropertyOnMute(t,"colCount",r+1),l+=$de(t,s,t.colCount-1,!0),this.scroll[this.parent.activeSheetIndex].colCount=t.colCount,l),s=(je(this.parent.viewport.leftIndex)&&(this.parent.viewport.leftIndex=0),je(this.parent.viewport.topIndex)&&(this.parent.viewport.topIndex=0),e.left&&(l=$de(t,this.parent.viewport.leftIndex+h,r,!0)),je(this.translateX)&&(this.translateX=0),je(this.translateY)&&(this.translateY=0),i=this.parent.getRowHeaderContent(),this.rowHeader=this.content.cloneNode(),this.rowHeader.appendChild(i.querySelector(".e-table")),i.appendChild(this.rowHeader),i.appendChild(n.cloneNode())),e=(this.rowHeader.style.transform="translate(0px, "+this.translateY+"px)",i=this.parent.getColumnHeaderContent(),this.colHeader=this.content.cloneNode(),this.colHeader.appendChild(i.querySelector(".e-table")),i.appendChild(this.colHeader),i.appendChild(n.cloneNode()));this.colHeader.style.width=l+"px",s.style.height=o+"px",e.style.width=a+"px",this.colHeader.style.transform="translate("+this.translateX+"px, 0px)",this.content.style.transform="translate("+this.translateX+"px, "+this.translateY+"px)",this.content.style.width=l+"px",n.style.height=o+"px",n.style.width=a+"px",this.parent.allowScrolling&&((t=e.cloneNode(!0)).style.width=a+(this.parent.scrollSettings.isFinite?this.parent.sheetModule.getScrollSize():0)+"px",this.parent.getScrollElement().appendChild(t))},Wce.prototype.initScroll=function(){for(var e=0;e<this.parent.sheets.length;)this.scroll[e]||this.scroll.push({rowCount:0,colCount:0}),e++},Wce.prototype.setScrollCount=function(e,t){var i=this.parent.activeSheetIndex;this.scroll[i][t+"Count"]&&this.scroll[i][t+"Count"]===e||(this.scroll[i][t+"Count"]=e)},Wce.prototype.getRowAddress=function(e){var t=this.parent.getActiveSheet();return hte([e[0],t.frozenColumns?ste(t.topLeftCell)[1]:this.parent.viewport.leftIndex,e[1],this.parent.viewport.rightIndex])},Wce.prototype.getColAddress=function(e){var t=this.parent.getActiveSheet();return hte([t.frozenRows?ste(t.topLeftCell)[0]:this.parent.viewport.topIndex,e[0],this.parent.viewport.bottomIndex,e[1]])},Wce.prototype.updateScrollCount=function(e,t,i){void 0===i&&(i=e);var n=this.parent.getActiveSheet(),e=e+this.parent.viewport[t+"Count"]+1+i,i=this.scroll[this.parent.activeSheetIndex][t+"Count"];if(e<i){if(n[t+"Count"]===i)return;e=i}this.parent.scrollSettings.isFinite||this.parent.setSheetPropertyOnMute(n,t+"Count",e)},Wce.prototype.onVerticalScroll=function(e){var t=e.cur.idx,i=e.cur.size,n=e.prev.idx,o=Math.abs(t-n),r=this.parent.getThreshold("row");if(o>Math.round(r/2)){var s,a=void 0,l=void 0,h=this.parent.getActiveSheet();if(t<=r&&(e.increase||(this.translateY&&r<n&&(this.translateY=0,c=this.parent.frozenColCount(h),d=this.parent.frozenRowCount(h),e.preventScroll?this.parent.viewport.topIndex=n-(r-d):(u=c?ste(h.topLeftCell)[1]:this.parent.viewport.leftIndex,p=c?[d,this.parent.viewport.leftIndex+c]:[],o<this.parent.viewport.rowCount+r?(a=Woe(h,d,!0),l=Woe(h,this.parent.viewport.topIndex+d-1,!1),this.parent.viewport.topIndex=a-d,g=this.skipHiddenLastIdx(this.parent.viewport.bottomIndex-(l-a+1-this.hiddenCount(a,l)),this.parent.viewport.bottomIndex),this.parent.viewport.bottomIndex=Woe(h,g,!1),this.parent.renderModule.refreshUI({colIndex:u,rowIndex:a,direction:"last",refresh:"RowPart",skipUpdateOnFirst:!0,frozenIndexes:p},this.getRowAddress([a,Woe(h,l,!1)]))):(s=this.parent.viewport.leftIndex,this.parent.renderModule.refreshUI({rowIndex:0,colIndex:u,refresh:"Row",skipUpdateOnFirst:!0,frozenIndexes:p,skipTranslate:!0}),c&&(this.parent.viewport.leftIndex=s),this.translate({refresh:"Row"})),sce(this.parent.element),t=0)),this.updateScrollCount(r,"row"))),n<r&&(o=Math.abs(t-r)),!e.increase&&this.parent.scrollSettings.isFinite&&this.parent.viewport.bottomIndex===Woe(h,h.rowCount-1,!1)){var d=this.parent.frozenRowCount(h),p=this.parent.viewport.topIndex+d+rte(h.paneTopLeftCell)[0]-1;if(p<t+d)return void(e.prev.idx=t);o=p-(t+d)}if(r<t){if(s=this.parent.viewport.topIndex,this.parent.viewport.topIndex=t-r,e.increase&&s>this.parent.viewport.topIndex)return void(this.parent.viewport.topIndex=s);d=this.parent.frozenRowCount(h);if(e.preventScroll)this.setThresholdHeight(i,r,d),this.translate({refresh:"Row"});else{var c,u=void 0,n=[];if((c=this.parent.frozenColCount(h))?(u=ste(h.topLeftCell)[1],n.push(d),n.push(this.parent.viewport.leftIndex+c)):u=this.parent.viewport.leftIndex,o<this.parent.viewport.rowCount+r)if(e.increase){if(a=this.parent.viewport.bottomIndex+1,l=this.parent.viewport.bottomIndex+(this.parent.viewport.topIndex-s),(l-=this.hiddenCount(s+d,this.parent.viewport.topIndex-1+d))<=this.parent.viewport.bottomIndex||this.parent.scrollSettings.isFinite&&a>Woe(h,h.rowCount-1,!1,"rows"))return void(this.parent.viewport.topIndex=s);p=this.parent.skipHidden(a,l,"rows",!1),o=this.checkLastIdx(p[1],"row"),a=p[0],l=o.index,p=this.parent.viewport.topIndex+d;o.diff&&(p=Woe(h,s,!0,"rows",l-a+1-this.hiddenCount(a,l))+d),this.parent.viewport.topIndex=Woe(h,p,!o.diff)-d,this.setThresholdHeight(i,t-this.parent.viewport.topIndex,d,!!o.diff,s===Woe(h,d,!0)),this.parent.viewport.bottomIndex=l,this.parent.renderModule.refreshUI({colIndex:u,rowIndex:a,direction:"first",refresh:"RowPart",frozenIndexes:n},this.getRowAddress([a,l]))}else{if((a=Woe(h,this.parent.viewport.topIndex+d,!1))<d&&(a=Woe(h,a=d,!0)),this.parent.viewport.topIndex=a-d,(l=Woe(h,s+d-1,!1))<d||l<a)return void(this.parent.viewport.topIndex=s);var g=this.skipHiddenLastIdx(this.parent.viewport.bottomIndex-(l-a+1-this.hiddenCount(a,l)),this.parent.viewport.bottomIndex);this.parent.viewport.bottomIndex=Woe(h,g,!1),this.setThresholdHeight(i,t-this.parent.viewport.topIndex,d),this.parent.renderModule.refreshUI({colIndex:u,rowIndex:a,direction:"last",refresh:"RowPart",frozenIndexes:n},this.getRowAddress([a,l]))}else s=this.parent.viewport.leftIndex,this.parent.viewport.topIndex=Woe(h,this.parent.viewport.topIndex+d,!1)-d,this.parent.viewport.topIndex<0&&(this.parent.viewport.topIndex=Woe(h,d,!0)-d),this.parent.renderModule.refreshUI({rowIndex:this.parent.viewport.topIndex,colIndex:u,refresh:"Row",frozenIndexes:n,skipTranslate:!0}),c&&(this.parent.viewport.leftIndex=s),this.setThresholdHeight(i,t-this.parent.viewport.topIndex,d,this.parent.scrollSettings.isFinite&&this.parent.viewport.bottomIndex===Woe(h,h.rowCount-1,!1)),this.translate({refresh:"Row"});this.updateScrollCount(t,"row",r),this.focusSheet()}}e.prev.idx=t}},Wce.prototype.skipHiddenLastIdx=function(e,t,i){void 0===i&&(i="rows");for(var n=this.parent.getActiveSheet(),o=0,r=e;r<=t;r++)n[""+i][r]&&n[""+i][r].hidden&&o++;return e=o?this.skipHiddenLastIdx(e-o,e-1,i):e},Wce.prototype.hiddenCount=function(e,t,i){void 0===i&&(i="rows");for(var n=0,o=this.parent.getActiveSheet(),r=e;r<=t;r++)o[""+i][r]&&o[""+i][r].hidden&&n++;return n},Wce.prototype.checkLastIdx=function(e,t){var i,n=0;return this.parent.scrollSettings.isFinite&&(i=Woe(i=this.parent.getActiveSheet(),i[t+"Count"]-1,!1,"col"===t?"columns":"rows"))<e&&(n=e-i,e=i),{index:e,diff:n}},Wce.prototype.onHorizontalScroll=function(e){var t=e.cur.idx,i=e.cur.size,n=e.prev.idx,o=Math.abs(t-n),r=this.parent.getThreshold("col");if(o>Math.round(r/2)){var s,a=void 0,l=void 0,h=this.parent.getActiveSheet();if(t<=r&&(e.increase||(this.translateX&&r<n&&(this.translateX=0,d=this.parent.frozenColCount(h),c=this.parent.frozenRowCount(h),e.preventScroll?this.parent.viewport.leftIndex=n-(r-d):(u=c?ste(h.topLeftCell)[0]:this.parent.viewport.topIndex,p=c?[this.parent.viewport.topIndex+c,d]:[],o<this.parent.viewport.colCount+r?(a=Woe(h,d,!0,"columns"),l=Woe(h,this.parent.viewport.leftIndex+d-1,!1,"columns"),this.parent.viewport.leftIndex=a-d,g=this.skipHiddenLastIdx(this.parent.viewport.rightIndex-(l-a+1-this.hiddenCount(a,l,"columns")),this.parent.viewport.rightIndex,"columns"),this.parent.viewport.rightIndex=Woe(h,g,!1,"columns"),this.parent.renderModule.refreshUI({rowIndex:u,colIndex:a,direction:"last",refresh:"ColumnPart",skipUpdateOnFirst:!0,frozenIndexes:p},this.getColAddress([a,Woe(h,l,!1,"columns")]))):(s=this.parent.viewport.topIndex,this.parent.renderModule.refreshUI({rowIndex:u,colIndex:0,refresh:"Column",skipUpdateOnFirst:!0,frozenIndexes:p,skipTranslate:!0}),c&&(this.parent.viewport.topIndex=s),this.translate({refresh:"Column"})),sce(this.parent.element),t=0)),this.updateScrollCount(r,"col"))),n<r&&(o=Math.abs(t-r)),!e.increase&&this.parent.scrollSettings.isFinite&&this.parent.viewport.rightIndex===Woe(h,h.colCount-1,!1,"columns")){var d=this.parent.frozenColCount(h),p=this.parent.viewport.leftIndex+d+rte(h.paneTopLeftCell)[1]-1;if((p+=this.hiddenCount(this.parent.viewport.leftIndex+d,p))<t+d)return void(e.prev.idx=t);o=p-(t+d)}if(r<t){if(s=this.parent.viewport.leftIndex,this.parent.viewport.leftIndex=t-r,e.increase&&s>this.parent.viewport.leftIndex)return void(this.parent.viewport.leftIndex=s);d=this.parent.frozenColCount(h);if(e.preventScroll)this.setThresholdWidth(i,r,d),this.translate({refresh:"Column"});else{var c,u=(c=this.parent.frozenRowCount(h))?ste(h.topLeftCell)[0]:this.parent.viewport.topIndex,n=[];if(c&&(n=[c+this.parent.viewport.topIndex,d]),o<this.parent.viewport.colCount+r)if(e.increase){if(a=this.parent.viewport.rightIndex+1,l=this.parent.viewport.rightIndex+(this.parent.viewport.leftIndex-s),(l-=this.hiddenCount(s+d,this.parent.viewport.leftIndex-1+d,"columns"))<=this.parent.viewport.rightIndex||this.parent.scrollSettings.isFinite&&a>Woe(h,h.colCount-1,!1,"columns"))return void(this.parent.viewport.leftIndex=s);p=this.parent.skipHidden(a,l,"columns",!1),o=this.checkLastIdx(p[1],"col"),a=p[0],l=o.index;this.parent.viewport.leftIndex=Woe(h,this.parent.viewport.leftIndex-o.diff+d,!o.diff,"columns")-d,this.setThresholdWidth(i,t-this.parent.viewport.leftIndex,d,!!o.diff,s===Woe(h,d,!0,"columns")),this.parent.viewport.rightIndex=l,this.parent.renderModule.refreshUI({rowIndex:u,colIndex:a,direction:"first",refresh:"ColumnPart",frozenIndexes:n},this.getColAddress([a,l]))}else{if((a=Woe(h,this.parent.viewport.leftIndex+d,!1,"columns"))<d&&(a=Woe(h,a=d,!0,"columns")),this.parent.viewport.leftIndex=a-d,(l=Woe(h,s+d-1,!1,"columns"))<d||l<a)return void(this.parent.viewport.leftIndex=s);var g=this.skipHiddenLastIdx(this.parent.viewport.rightIndex-(l-a+1-this.hiddenCount(a,l,"columns")),this.parent.viewport.rightIndex,"columns");this.parent.viewport.rightIndex=Woe(h,g,!1,"columns"),this.setThresholdWidth(i,t-this.parent.viewport.leftIndex,d),this.parent.renderModule.refreshUI({rowIndex:u,colIndex:a,direction:"last",refresh:"ColumnPart",frozenIndexes:n},this.getColAddress([a,l]))}else s=this.parent.viewport.topIndex,this.parent.viewport.leftIndex=Woe(h,this.parent.viewport.leftIndex+d,!1,"columns")-d,this.parent.viewport.leftIndex<0&&(this.parent.viewport.leftIndex=Woe(h,d,!0,"columns")-d),this.parent.renderModule.refreshUI({rowIndex:u,colIndex:this.parent.viewport.leftIndex,refresh:"Column",frozenIndexes:n,skipTranslate:!0}),c&&(this.parent.viewport.topIndex=s),this.setThresholdWidth(i,t-this.parent.viewport.leftIndex,d,this.parent.scrollSettings.isFinite&&this.parent.viewport.rightIndex===Woe(h,h.colCount-1,!1,"columns")),this.translate({refresh:"Column"});this.updateScrollCount(t,"col",r),this.focusSheet()}}e.prev.idx=t}},Wce.prototype.focusSheet=function(){document.activeElement.classList.contains("e-text-findNext-short")&&z(document.activeElement,"#"+this.parent.element.id)||sce(this.parent.element)},Wce.prototype.setThresholdHeight=function(e,t,i,n,o){var r=this.parent.getActiveSheet(),s=this.parent.viewport.topIndex+i,t=s+t-1;this.translateY=n||o||t<s?s<=i?0:Ude(r,i,s-1,!0):e-Ude(r,s,t,!0)},Wce.prototype.setThresholdWidth=function(e,t,i,n,o){var r=this.parent.getActiveSheet(),s=this.parent.viewport.leftIndex+i,t=s+t-1;this.translateX=n||o||t<s?s<=i?0:$de(r,i,s-1,!0):e-$de(r,s,t,!0)},Wce.prototype.translate=function(e){var t;!e.skipTranslate&&this.content&&(t=this.translateX||0,t=this.parent.enableRtl?-t:t,"Row"!==e.refresh&&"RowPart"!==e.refresh||(this.content.style.transform="translate("+t+"px, "+this.translateY+"px)",this.rowHeader.style.transform="translate(0px, "+this.translateY+"px)"),"Column"===e.refresh||"ColumnPart"===e.refresh)&&(this.content.style.transform="translate("+t+"px, "+this.translateY+"px)",this.colHeader.style.transform="translate("+t+"px, 0px)")},Wce.prototype.updateColumnWidth=function(e){var t,i,n,o;"Column"===e.refresh?(this.content.style.width="",i=$de(i=this.parent.getActiveSheet(),this.parent.viewport.leftIndex+this.parent.frozenColCount(i),this.parent.viewport.rightIndex,!0),this.colHeader.style.width=i+"px",this.content.style.width=i+"px",this.parent.scrollSettings.isFinite&&!e.isUpdate||(e=this.parent.element.querySelector(".e-scroller .e-virtualtrack"))&&((n=parseInt(e.style.width,10))<(i=i+this.translateX+this.parent.viewport.beforeFreezeWidth)?e.style.width=n+(o=i-n)+"px":(o=n-i,t=this.parent.getMainContent().getElementsByClassName("e-virtualtrack")[0],n-o<parseInt(t.style.width,10)&&(e.style.width=t.style.width)))):this.parent.scrollSettings.isFinite||(t=this.parent.getMainContent().getElementsByClassName("e-virtualtrack")[0],(i=parseInt(t.style.height,10))<(n=this.content.getBoundingClientRect().height+this.translateY+this.parent.viewport.beforeFreezeHeight)?t.style.height=i+(o=n-i)+"px":(o=i-n,e=this.parent.getRowHeaderContent().getElementsByClassName("e-virtualtrack")[0],i-o<parseInt(e.style.height,10)&&(t.style.height=e.style.height)))},Wce.prototype.updateRowColCount=function(e){var t,i,n;this.scroll.length&&(t=this.parent.getActiveSheet(),"row"===e.update?e.index!==this.scroll[this.parent.activeSheetIndex].rowCount-1&&(n=i=this.getVTrackHeight("height"),e.index>=this.scroll[this.parent.activeSheetIndex].rowCount?void 0===e.start?n+=Ude(t,this.scroll[this.parent.activeSheetIndex].rowCount,e.index,!0):n+=Ude(t,e.start,e.end,!0):void 0===e.start?n-=Ude(t,e.index+1,this.scroll[this.parent.activeSheetIndex].rowCount-1,!0):n-=Ude(t,e.start,e.end,!0),!e.isDelete&&n<i||(this.scroll[this.parent.activeSheetIndex].rowCount=e.index+1,this.updateVTrack(this.rowHeader,n,"height"),this.scroll[this.parent.activeSheetIndex].rowCount>t.rowCount&&this.parent.setSheetPropertyOnMute(t,"rowCount",this.scroll[this.parent.activeSheetIndex].rowCount))):e.index!==this.scroll[this.parent.activeSheetIndex].colCount-1&&(n=i=this.getVTrackHeight("width"),e.index>=this.scroll[this.parent.activeSheetIndex].colCount?void 0===e.start?n+=$de(t,this.scroll[this.parent.activeSheetIndex].colCount,e.index,!0):n+=$de(t,e.start,e.end,!0):void 0===e.start?n-=$de(t,e.index+1,this.scroll[this.parent.activeSheetIndex].colCount-1,!0):n-=$de(t,e.start,e.end,!0),!e.isDelete&&n<i||(this.scroll[this.parent.activeSheetIndex].colCount=e.index+1,this.updateVTrack(this.colHeader,n,"width"),this.scroll[this.parent.activeSheetIndex].colCount>t.colCount&&this.parent.setSheetPropertyOnMute(t,"colCount",this.scroll[this.parent.activeSheetIndex].colCount))))},Wce.prototype.getVTrackHeight=function(e){var t,e=this.content.nextElementSibling.style[""+e];return e.includes("e+")?(t=(e=e.split("px")[0]).split("e+"),Number(t[0])*Math.pow(10,Number(t[1]))):parseFloat(e)},Wce.prototype.updateVTrackHeight=function(e){var t,i=this.parent.frozenRowCount(this.parent.getActiveSheet());e.rowIdx<this.scroll[this.parent.activeSheetIndex].rowCount&&this.updateVTrack(this.rowHeader,this.getVTrackHeight("height")+e.threshold,"height"),e.rowIdx>=i&&e.rowIdx<this.parent.scrollModule.offset.top.idx+i&&((t=this.parent.element.getElementsByClassName("e-main-panel")[0])&&(this.parent.scrollModule.prevScroll.scrollTop=t.scrollTop+e.threshold,t.scrollTop+=e.threshold),this.parent.scrollModule.offset.top.size+=e.threshold,e.rowIdx<this.parent.viewport.topIndex+i)&&(this.translateY+=e.threshold,this.translate({refresh:"Row"}))},Wce.prototype.updateVTrackWidth=function(e){var t,i;epe(this.parent.getActiveSheet(),e.colIdx)||(t=this.parent.frozenColCount(this.parent.getActiveSheet()),e.colIdx>=this.parent.viewport.leftIndex+t&&e.colIdx<=this.parent.viewport.rightIndex?((i=this.parent.getColumnHeaderContent().getElementsByClassName("e-virtualtrack")[0]).style.width=parseFloat(i.style.width)+e.threshold+"px",(i=this.parent.getMainContent().getElementsByClassName("e-virtualtrack")[0]).style.width=parseFloat(i.style.width)+e.threshold+"px",(i=this.parent.getScrollElement().getElementsByClassName("e-virtualtrack")[0]).style.width=parseFloat(i.style.width)+e.threshold+"px",(i=this.parent.getColumnHeaderContent().getElementsByClassName("e-virtualable")[0]).style.width=parseFloat(i.style.width)+e.threshold+"px",(i=this.parent.getMainContent().getElementsByClassName("e-virtualable")[0]).style.width=parseFloat(i.style.width)+e.threshold+"px"):e.colIdx>=t&&e.colIdx<this.parent.viewport.leftIndex+t&&(this.parent.scrollModule.offset.left.size+=e.threshold,this.translateX+=e.threshold,this.translate({refresh:"Column"})))},Wce.prototype.updateVTrack=function(e,t,i){e.nextElementSibling.style[""+i]=t+"px",this.content.nextElementSibling.style[""+i]=t+"px","width"===i&&this.parent.allowScrolling&&(this.parent.getScrollElement().firstElementChild.style.width=t+"px")},Wce.prototype.deInitProps=function(){this.parent.viewport.leftIndex=null,this.parent.viewport.topIndex=null,this.parent.viewport.bottomIndex=null,this.translateX=null,this.translateY=null},Wce.prototype.updateScrollProps=function(e){var t=this;void 0===e&&(e={sheetIndex:0,sheets:this.parent.sheets}),0===this.scroll.length?this.initScroll():e.sheets.forEach(function(){t.scroll.splice(e.sheetIndex,0,{rowCount:0,colCount:0})})},Wce.prototype.sliceScrollProps=function(e){je(e.sheetIndex)?this.scroll.length=0:this.scroll.splice(e.sheetIndex,1)},Wce.prototype.updateTranslate=function(e){var t;e.height&&(e.isRender?this.translateY-=e.height:(t=parseInt(this.parent.getMainContent().getElementsByClassName("e-virtualtrack")[0].style.height,10),e.isHide?(this.updateVTrack(this.rowHeader,t-e.height,"height"),this.setThresholdHeight(this.translateY,e.prevSize-1-this.parent.viewport.topIndex+1,this.parent.frozenRowCount(this.parent.getActiveSheet()))):(this.updateVTrack(this.rowHeader,t+e.height,"height"),this.translateY=this.translateY+e.size)),this.translate({refresh:"Row"})),e.width&&(this.translateX-=e.width,this.translate({refresh:"Column"}))},Wce.prototype.addEventListener=function(){this.parent.on(xse,this.createVirtualElement,this),this.parent.on(Ise,this.translate,this),this.parent.on(Tse,this.updateColumnWidth,this),this.parent.on(Ble,this.updateColumnWidth,this),this.parent.on(Cse,this.onVerticalScroll,this),this.parent.on(Sse,this.onHorizontalScroll,this),this.parent.on(kie,this.updateRowColCount,this),this.parent.on(iae,this.updateVTrackHeight,this),this.parent.on(nae,this.updateVTrackWidth,this),this.parent.on(rae,this.deInitProps,this),this.parent.on(zie,this.sliceScrollProps,this),this.parent.on(Hie,this.updateScrollProps,this),this.parent.on(nhe,this.updateTranslate,this),this.parent.on(gse,this.destroy,this)},Wce.prototype.destroy=function(){this.removeEventListener();var e=document.querySelectorAll(".e-addNoteIndicator");e&&e.forEach(function(e){e.remove()}),this.rowHeader&&(upe(this.rowHeader),this.rowHeader.remove()),this.colHeader&&(upe(this.colHeader),this.colHeader.remove()),this.content&&(upe(this.content),this.content.remove()),this.rowHeader=null,this.colHeader=null,this.content=null,this.parent=null,this.scroll.length=0,this.translateX=null,this.translateY=null},Wce.prototype.removeEventListener=function(){this.parent.off(xse,this.createVirtualElement),this.parent.off(Ise,this.translate),this.parent.off(Tse,this.updateColumnWidth),this.parent.off(Ble,this.updateColumnWidth),this.parent.off(Cse,this.onVerticalScroll),this.parent.off(Sse,this.onHorizontalScroll),this.parent.off(kie,this.updateRowColCount),this.parent.off(iae,this.updateVTrackHeight),this.parent.off(nae,this.updateVTrackWidth),this.parent.off(zie,this.sliceScrollProps),this.parent.off(Hie,this.updateScrollProps),this.parent.off(nhe,this.updateTranslate),this.parent.off(gse,this.destroy)};var jce=Wce;function Wce(e){this.scroll=[],this.parent=e,this.addEventListener()}Uce.prototype.addEventListener=function(){this.parent.on(wse,this.keyDownHandler,this)},Uce.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(wse,this.keyDownHandler)},Uce.prototype.keyDownHandler=function(t){var i=this,e=t.target,n=this.parent.enableRtl,o=this.parent.enableKeyboardShortcut;if(!t.altKey||38!==t.keyCode&&40!==t.keyCode||o)if(t.altKey&&38===t.keyCode&&this.parent.element.lastElementChild.classList.contains("e-filter-popup"))this.parent.notify(_ae,{closePopup:!0});else if(this.parent.allowPrint&&t.ctrlKey&&80===t.keyCode&&o)t.preventDefault(),this.parent.print();else{var r=t.target;if(!je(r)&&r.classList.contains("e-addNoteContainer"))"Escape"!==t.key&&27!==t.keyCode||(f=Kre((s=!je(this.parent.spreadsheetNoteModule.noteCellIndexes)?this.parent.spreadsheetNoteModule.noteCellIndexes:ste(this.parent.getActiveSheet().activeCell))[0],s[1],this.parent.getActiveSheet()),p=this.parent.getCell(s[0],s[1]),a=Wre(this.parent,this.parent.activeSheetIndex)+"!"+hte(s),!je(r)&&!je(r.value)&&(je(f)||je(f.notes)||f.notes!==r.value)&&-1<document.activeElement.className.indexOf("e-addNoteContainer")&&(l=!je(f)&&f.notes?"editNote":"addNote",this.parent.notify(Dae,{args:{action:"beforeCellSave",eventArgs:{address:a}}}),Yoe(this.parent,this.parent.getActiveSheet(),{rowIdx:s[0],colIdx:s[1],preventEvt:!0,cell:{notes:r.value,isNoteEditable:!1}}),d={notes:r.value,address:a},this.parent.notify(Vae,{eventArgs:d,action:l})),this.parent.spreadsheetNoteModule.isShowNote=null,this.parent.notify(Cae,""),sce(p));else{var s=this.parent.serviceLocator.getService(rpe).dialogInstance,r=e.id===this.parent.element.id+"_name_box";if("None"===this.parent.selectionSettings.mode||s||this.parent.isEdit||e.classList.contains("e-ss-ddb")&&117!==t.keyCode&&9!==t.keyCode||r&&117!==t.keyCode||e.classList.contains("e-sheet-rename")||e.id===this.parent.element.id+"_SearchBox"||e.classList.contains("e-chk-hidden")||e.classList.contains("e-ddl")&&e.classList.contains("e-input-focus")){if(s){if(13===t.keyCode)s.element.classList.contains("e-spreadsheet-function-dlg")&&(e.classList.contains("e-formula-list")||e.classList.contains("e-list-item"))&&sce(s.element.querySelector(".e-footer-content .e-primary"));else if(9===t.keyCode)if(s.element.classList.contains("e-find-dlg")){var a=s.element.querySelectorAll(".e-footer-content .e-btn:not(:disabled)"),l=a.length?a[a.length-1].className:"e-findnreplace-checkmatch";t.shiftKey?document.activeElement.classList.contains("e-dlg-closeicon-btn")&&(t.preventDefault(),a.length?sce(a[a.length-1]):(p=s.element.querySelector(".e-findnreplace-exactmatchcheckbox"))&&(sce(p.querySelector(".e-findnreplace-checkmatch")),p.classList.add("e-focus"))):document.activeElement.className.includes(l)&&sce(s.element)}else if(s.element.classList.contains("e-protect-dlg"))(t.shiftKey?document.activeElement.classList.contains("e-primary"):document.activeElement.id===this.parent.element.id+"_protect_check")&&(b=s.element.querySelector(".e-protect-option-list"))&&!b.querySelector(".e-list-item.e-focused")&&(g=b.querySelector(".e-list-item"))&&g.classList.add("e-focused");else if(s.element.classList.contains("e-custom-format-dlg"))if(t.shiftKey)document.activeElement.className.includes("e-list-item e-active")&&(b=z(document.activeElement,".e-custom-listview"))&&sce(b);else if(document.activeElement.classList.contains("e-btn")&&document.activeElement.parentElement.classList.contains("e-custom-dialog")){var h=At(b=s.element.querySelector(".e-custom-listview"),"listview");if(b){if(!(g=b.querySelector(".e-list-item.e-active"))){if(!(g=b.querySelector(".e-list-item")))return;h.selectItem(g)}t.preventDefault(),g.focus()}}else document.activeElement.classList.contains("e-list-item")&&sce(s.element);else s.element.classList.contains("e-spreadsheet-function-dlg")?t.shiftKey&&document.activeElement.className.includes("e-list-item e-active")&&(b=z(document.activeElement,".e-formula-list"))&&sce(b):s.element.classList.contains("e-goto-dlg")&&!s.element.classList.contains("e-dlg-modal")&&(t.shiftKey?document.activeElement.className.includes("e-dlg-closeicon-btn")&&(a=s.element.querySelector(".e-footer-content .e-btn"))&&(t.preventDefault(),sce(a)):document.activeElement.className.includes("e-btn-goto-ok")&&sce(s.element))}else r&&9===t.keyCode&&t.shiftKey&&this.focusEle(t,".e-formula-bar",!1,!0);var d={action:"getCurrentEditValue",editedValue:""},p=(this.parent.notify(mse,d),Poe(d.editedValue,!0));this.parent.isEdit&&p&&t.shiftKey&&!t.ctrlKey&&Rpe(t.keyCode)&&this.shiftSelection(t)}else{var c=this.parent.getActiveSheet(),u=ste(c.activeCell);if(t.altKey){if(40===t.keyCode){if(e.classList.contains("e-dropdown-btn")||e.classList.contains("e-split-btn"))return;l={e:t,isFilterCell:!1};if(this.parent.notify(_ae,l),l.isFilterCell)return}if(40===t.keyCode&&!document.getElementById(this.parent.element.id+"listValid_popup"))if(f=this.parent.getCell(u[0],u[1])){var g=f.querySelector(".e-validation-list .e-ddl");if(g)return sce(g),void((h=At(g.querySelector(".e-dropdownlist")||g,"dropdownlist"))&&h.showPopup())}}e.id===this.parent.element.id+"_File"&&sce(this.parent.element);var m,f,y,v,b=e.classList.contains("e-add-sheet-tab")||e.classList.contains("e-sheets-list")||e.classList.contains("e-tab-wrap")&&!!z(e,".e-sheet-tabs-items")||e.classList.contains("e-aggregate-list")||e.classList.contains("e-scroll-nav"),w=(-1<[9,37,38,39,40,33,34,35,36].indexOf(t.keyCode)&&!b&&t.preventDefault(),rte(c.selectedRange));if(36===t.keyCode){var C,a=this.parent.frozenColCount(c),s=void 0;t.ctrlKey||t.metaKey?(d=Woe(c,this.parent.frozenRowCount(c),!0),t.shiftKey?s=[u[0],u[1],d,Woe(c,a,!0,"columns")]:(s=[d,Woe(c,a,!0,"columns"),d])[3]=s[1],(A=this.parent.element.querySelector(".e-main-panel")).scrollTop&&(A.scrollTop=0),(p=this.parent.getScrollElement()).scrollLeft&&(p.scrollLeft=0)):t.shiftKey?(C=Woe(c,a,!0,"columns"),s=c.frozenColumns&&Woe(c,u[1],!0,"columns")===C?[w[0],u[1],w[2],Woe(c,0,!0,"columns")]:[w[0],u[1],w[2],C],this.scrollNavigation([s[2],s[3]],!0)):(C=Woe(c,a,!0,"columns"),!c.frozenColumns||C!==u[1]&&a!==u[1]||(C=Woe(c,0,!0,"columns")),s=[u[0],C,u[0],C],this.scrollNavigation([s[0],s[1]],!0)),this.updateSelection(c,s,t)}else if(t.ctrlKey||t.metaKey)35===t.keyCode?(t.preventDefault(),l=-1<(l=Woe(c,c.usedRange.rowIndex,!1))?l:c.usedRange.rowIndex,g=-1<(g=Woe(c,c.usedRange.colIndex,!1,"columns"))?g:c.usedRange.colIndex,t.shiftKey||(u[0]=l,u[1]=g),u[2]=l,u[3]=g,this.updateSelection(c,u.concat(u),t),this.scrollNavigation([l,g],!0)):32===t.keyCode&&!t.shiftKey&&o&&(w[0]=0,w[2]=c.rowCount-1,this.updateSelection(c,w,{shiftKey:!0})),40===t.keyCode||39===t.keyCode||38===t.keyCode||37===t.keyCode?t.shiftKey?(40===t.keyCode?w[2]=this.getNextNonEmptyCell(w[2],u[1],"down"):39===t.keyCode&&!n||37===t.keyCode&&n?w[3]=this.getNextNonEmptyCell(u[0],w[3],"right"):38===t.keyCode?w[2]=this.getNextNonEmptyCell(w[2],u[1],"top"):w[3]=this.getNextNonEmptyCell(u[0],w[3],"left"),this.updateSelection(c,w,t),this.scrollNavigation([w[2],w[3]],!0)):(37===t.keyCode&&!n||39===t.keyCode&&n?u[1]=this.getNextNonEmptyCell(u[0],u[1],"left"):38===t.keyCode?u[0]=this.getNextNonEmptyCell(u[0],u[1],"top"):39===t.keyCode&&!n||37===t.keyCode&&n?u[1]=this.getNextNonEmptyCell(u[0],u[1],"right"):u[0]=this.getNextNonEmptyCell(u[0],u[1],"down"),this.parent.selectRange(hte(u)),this.scrollNavigation([u[0],u[1]],!0)):117===t.keyCode&&((h=document.activeElement).classList.contains("e-spreadsheet")||z(h,".e-sheet")?this.setFocus("Sheet",t,!0):b?this.setFocus("SheetTabs",t):z(h,".e-ribbon")?this.setFocus("Ribbon",t):(r||h.classList.contains("e-insert-function"))&&this.setFocus("FormulaBar",t));else{if(t.shiftKey){if(32===t.keyCode&&o&&(t.preventDefault(),w[1]=0,w[3]=c.colCount-1,this.updateSelection(c,w,t)),this.shiftSelection(t),(34===t.keyCode||33===t.keyCode)&&this.parent.scrollModule&&this.parent.scrollModule.isKeyScroll){var S=0,A=this.parent.element.querySelector(".e-main-panel"),d=Woe(c,ste(c.paneTopLeftCell)[0],!0),x=dce(this.parent,d).height;if(34===t.keyCode)S=x+this.parent.scrollModule.offset.top.size,this.parent.scrollSettings.isFinite||(T=this.parent.getMainContent().querySelector(".e-virtualtrack"))&&parseFloat(T.style.height)<S+x&&(T.style.height=S+x+"px");else if(S=this.parent.scrollModule.offset.top.size-x,Math.round(S)<0){if(!A.scrollTop)return void this.parent.selectRange(hte([w[0],w[1],d,w[3]]));S=0}var p=Woe(c,rte(c.selectedRange)[2],!0),I=p<d?0:p-d;this.parent.scrollModule&&A.scrollTop&&(this.parent.scrollModule.isKeyScroll=!1),A.scrollTop=S,cpe(function(){34===t.keyCode?(w[2]=Woe(c,ste(c.paneTopLeftCell)[0]+I,!0),i.parent.scrollSettings.isFinite&&w[2]>c.rowCount-1&&(w[2]=Woe(c,c.rowCount-1,!1),w[2]=w[2]<0?0:w[2])):(w[2]=Woe(c,ste(c.paneTopLeftCell)[0]+I,!1),w[2]=w[2]<0?0:w[2]),i.updateSelection(c,w,t)})}}else if(9===t.keyCode||(this.parent.enableRtl?37===t.keyCode:39===t.keyCode))(f=Kre(u[0],u[1],c))&&1<f.colSpan&&(u[1]+=f.colSpan-1),u[1]<c.colCount-1&&(!c.isProtected||c.protectSettings.selectCells)?(u[1]+=1,m=!0):c.protectSettings.selectUnLockedCells&&(y=this.getNextUnlockedCell("right",u),m=u[1]!==y[1]||u[0]!==y[0],u[1]=y[1],u[0]=y[0]);else if(13===t.keyCode||40===t.keyCode)(f=Kre(u[0],u[1],c))&&1<f.rowSpan&&(u[0]+=f.rowSpan-1),u[0]<c.rowCount-1&&(!c.isProtected||c.protectSettings.selectCells)?(m=!0,u[0]+=1):c.protectSettings.selectUnLockedCells&&(y=this.getNextUnlockedCell("down",u),m=u[0]!==y[0]||u[1]!==y[1],u[1]=y[1],u[0]=y[0]);else if((34===t.keyCode||33===t.keyCode)&&this.parent.scrollModule&&this.parent.scrollModule.isKeyScroll){var T,A=this.parent.element.querySelector(".e-main-panel"),S=0,E=Woe(c,ste(c.paneTopLeftCell)[0],!0),D=Woe(c,ste(c.activeCell)[0],!0),x=dce(this.parent,E).height;if(34===t.keyCode)S=this.parent.scrollModule.offset.top.size+x,this.parent.scrollSettings.isFinite||(T=this.parent.getMainContent().querySelector(".e-virtualtrack"))&&parseFloat(T.style.height)<S+x&&(T.style.height=S+x+"px");else{if(S=this.parent.scrollModule.offset.top.size-x,c.frozenRows&&u[0]<this.parent.frozenRowCount(c))return void this.parent.selectRange(hte([E,w[1],E,w[1]]));if(Math.round(S)<0){if(!A.scrollTop)return;S=0}}var M=D<E?0:D-E;this.parent.scrollModule&&A.scrollTop&&(this.parent.scrollModule.isKeyScroll=!1),A.scrollTop=S,cpe(function(){var e;34===t.keyCode?(e=Woe(c,ste(c.paneTopLeftCell)[0]+M,!0),i.parent.scrollSettings.isFinite&&e>c.rowCount-1&&(e=(e=Woe(c,c.rowCount-1,!1))<0?0:e)):(e=ste(c.paneTopLeftCell)[0]+M,e-=i.parent.hiddenCount(E,D),e=(e=Woe(c,e,!1))<0?0:e),i.parent.notify(Ese,{range:[e,u[1],e,u[1]],preventAnimation:!0})})}(t.shiftKey?9===t.keyCode:this.parent.enableRtl?39===t.keyCode:37===t.keyCode)?(0<u[1]&&(!c.isProtected||c.protectSettings.selectCells)?(--u[1],m=!0):c.protectSettings.selectUnLockedCells&&(y=this.getNextUnlockedCell("left",u),m=u[1]!==y[1]||u[0]!==y[0],u[1]=y[1],u[0]=y[0]),u[1]<=0&&(a=this.parent.getMainContent(),0===u[1])&&a.scrollLeft&&!this.parent.enableRtl&&(a.scrollLeft=0)):(t.shiftKey?13!==t.keyCode:38!==t.keyCode)||this.parent.element.querySelector(".e-find-toolbar")||(0<u[0]&&(!c.isProtected||c.protectSettings.selectCells)?(--u[0],m=!0):c.protectSettings.selectUnLockedCells&&(C=this.getNextUnlockedCell("up",u),m=u[0]!==C[0]||u[1]!==C[1],u[1]=C[1],u[0]=C[0]),u[0]<=0&&(s=this.parent.getMainContent().parentElement,0===u[0])&&s.scrollTop&&(s.scrollTop=0))}if(!m||this.parent.scrollModule&&!this.parent.scrollModule.isKeyScroll||b||z(document.activeElement,".e-ribbon")||e.classList.contains("e-insert-function")||e.classList.contains("e-formula-bar")&&(!e.classList.contains("e-formula-bar")||"TEXTAREA"!==e.nodeName||13!==t.keyCode))9===t.keyCode&&((l=this.parent.showRibbon&&z(document.activeElement,".e-ribbon"))?z(document.activeElement,".e-tab-header")?t.shiftKey||l.classList.contains("e-collapsed")?this.focusEle(t,".e-ribbon .e-drop-icon"):this.focusEle(t,".e-ribbon .e-content .e-toolbar-item:not(.e-separator):not(.e-overlay):not(.e-hide) .e-btn"):z(document.activeElement,".e-content")?t.shiftKey?this.focusEle(t,".e-ribbon .e-toolbar-items .e-toolbar-item.e-active .e-tab-wrap",!0):this.focusEle(t,".e-ribbon .e-drop-icon"):document.activeElement.classList.contains("e-drop-icon")&&(t.shiftKey&&!l.classList.contains("e-collapsed")?this.focusEle(t,".e-ribbon .e-content .e-toolbar-item:not(.e-separator):not(.e-overlay):not(.e-hide) .e-btn"):this.focusEle(t,".e-ribbon .e-toolbar-items .e-toolbar-item.e-active .e-tab-wrap",!0)):e.classList.contains("e-insert-function")?t.shiftKey?this.focusEle(t,".e-formula-bar-panel .e-combobox"):this.focusEle(t,".e-formula-bar",!1,!0):b&&(t.shiftKey?(g=e.classList.contains("e-aggregate-list")||e.classList.contains("e-scroll-left-nav"),e.classList.contains("e-add-sheet-tab")||g||e.classList.contains("e-sheets-list")&&e.previousElementSibling&&e.previousElementSibling.disabled?(n=!g&&this.parent.element.querySelector(".e-aggregate-list"))?this.focusEle(t,null,!1,!1,n):!e.classList.contains("e-scroll-left-nav")&&this.parent.element.querySelector(".e-sheet-tab-panel .e-scroll-nav")?this.focusEle(t,".e-sheet-tab-panel .e-scroll-right-nav",!0):(v=[].slice.call(this.parent.element.querySelectorAll(".e-sheet-tab-panel .e-toolbar-item")))[v.length-1]&&this.focusEle(t,null,!0,!1,v[v.length-1].querySelector(".e-tab-wrap")):e.classList.contains("e-scroll-right-nav")?this.focusEle(t,".e-sheet-tab-panel .e-scroll-left-nav",!0):e.classList.contains("e-tab-wrap")&&(0===(y=(v=[].slice.call(this.parent.element.querySelectorAll(".e-sheet-tab-panel .e-toolbar-item"))).indexOf(e.parentElement))?this.focusEle(t,".e-sheet-tab-panel .e-sheets-list"):this.focusEle(t,null,!0,!1,v[y-1].querySelector(".e-tab-wrap")))):(r=!!this.parent.element.querySelector(".e-aggregate-list"),e.classList.contains("e-aggregate-list")||!r&&e.classList.contains("e-scroll-right-nav")?this.focusEle(t,".e-sheet-tab-panel .e-icon-btn:not(:disabled)"):e.classList.contains("e-sheets-list")?this.focusEle(t,".e-sheet-tab-panel .e-toolbar-item .e-tab-wrap",!0):e.classList.contains("e-scroll-left-nav")?this.focusEle(t,".e-sheet-tab-panel .e-scroll-right-nav",!0):e.classList.contains("e-tab-wrap")&&((h=(v=[].slice.call(this.parent.element.querySelectorAll(".e-sheet-tab-panel .e-toolbar-item"))).indexOf(e.parentElement))===v.length-1?!(o=!!this.parent.element.querySelector(".e-sheet-tab-panel .e-scroll-nav"))&&r||this.focusEle(t,".e-sheet-tab-panel ."+(o?"e-scroll-nav":"e-icon-btn:not(:disabled)"),o):this.focusEle(t,null,!0,!1,v[h+1].querySelector(".e-tab-wrap"))))));else{if(40===t.keyCode||38===t.keyCode||13===t.keyCode)for(;zde(c,u[0]);)if(40!==t.keyCode&&(t.shiftKey||13!==t.keyCode)||(u[0]=u[0]+1),(38===t.keyCode||t.shiftKey&&13===t.keyCode)&&(u[0]=u[0]-1,u[0]<0))return;if(37===t.keyCode||39===t.keyCode||9===t.keyCode)for(;epe(c,u[1]);)if(39!==t.keyCode&&(t.shiftKey||9!==t.keyCode)||(u[1]=u[1]+1),(37===t.keyCode||t.shiftKey&&9===t.keyCode)&&(u[1]=u[1]-1,u[1]<0))return;var p=rte(c.topLeftCell),k=(c.frozenRows&&u[0]<p[0]&&(u[0]=Woe(c,p[0],!0)),c.frozenColumns&&u[1]<p[1]&&(u[1]=Woe(c,p[1],!0,"columns")),this.scrollNavigation(u),hte(u)),d=function(e){var t;k!==c.selectedRange&&(i.parent.selectionModule.previousActiveCell=c.activeCell,document.getElementsByClassName("e-addNoteContainer")&&0<document.getElementsByClassName("e-addNoteContainer").length&&i.parent.notify(Cae,""),i.parent.setSheetPropertyOnMute(c,"activeCell",k),i.parent.notify(Ese,{range:u.concat(u),preventAnimation:e}),t=(t=F.isDevice&&"safari"===F.info.name&&(F.isIos||F.isIos7)?i.parent.element.querySelector(".e-ss-focus-edit"):t)||i.parent.getCell(u[0],u[1]))&&sce(t)};if(this.parent.scrollModule&&this.parent.scrollModule.isKeyScroll){if(k===c.selectedRange)return;cpe(d.bind(this,!0))}else d()}121===t.keyCode&&t.shiftKey&&!this.parent.enableKeyboardShortcut&&t.preventDefault()}}}else t.preventDefault()},Uce.prototype.setFocus=function(e,t,i){"Sheet"===e?t.shiftKey?this.parent.showFormulaBar?this.focusEle(t,".e-formula-bar-panel .e-combobox"):this.setFocus("FormulaBar",t,i):this.parent.showSheetTabs?this.focusEle(t,".e-sheet-tab-panel .e-icon-btn:not(:disabled)"):this.setFocus("SheetTabs",t,i):"SheetTabs"===e?t.shiftKey?i||this.focusEle(t,".e-selectall"):this.parent.showRibbon?this.focusEle(t,".e-ribbon .e-toolbar-items .e-toolbar-item.e-active .e-tab-wrap",!0):this.setFocus("Ribbon",t,i):"Ribbon"===e?t.shiftKey?this.parent.showSheetTabs?this.focusEle(t,".e-sheet-tab-panel .e-icon-btn:not(:disabled)"):i||this.focusEle(t,".e-selectall"):this.parent.showFormulaBar?this.focusEle(t,".e-formula-bar-panel .e-combobox"):this.setFocus("FormulaBar",t,i):"FormulaBar"===e&&(t.shiftKey?this.parent.showRibbon?this.focusEle(t,".e-ribbon .e-toolbar-items .e-toolbar-item.e-active .e-tab-wrap",!0):this.setFocus("Ribbon",t,i):i||this.focusEle(t,".e-selectall"))},Uce.prototype.focusEle=function(e,t,i,n,o){var r;o=o||this.parent.element.querySelector(t),i&&!o&&(t=(r=this.parent.element.querySelector(".e-ribbon .e-tab"))&&At(r,"tab").selectedItem||0,o=(o=this.parent.element.querySelector(".e-tab-header").getElementsByClassName("e-toolbar-item")[t])&&o.querySelector(".e-tab-wrap")),o&&(e.preventDefault(),n?(o.click(),sce(o),o.setSelectionRange(o.value.length,o.value.length)):i?(o.setAttribute("tabindex","0"),o.parentElement.classList.contains("e-active")&&o.parentElement.classList.contains("e-toolbar-item")&&!(r=this.parent.element.querySelector(".e-sheet-tab-panel .e-sheet-tab"))&&r.classList.contains("e-focused")&&r.classList.add("e-focused"),o.focus()):sce(o))},Uce.prototype.updateSelection=function(e,t,i){e.isProtected&&!e.protectSettings.selectCells&&e.protectSettings.selectUnLockedCells&&ace(this.parent,fte(t))||this.parent.notify(Ese,{range:t,shiftKey:i.shiftKey})},Uce.prototype.getNextNonEmptyCell=function(e,t,i){function n(e,t){return!je(e=Kre(e,t,r,null,!0).value)&&""!==e}var o,r=this.parent.getActiveSheet();if("down"===i){for(var s=n(h=Woe(r,e+1,!0),t),a=Woe(r,r.rowCount-1,!1),l=h;l<r.rowCount;l++){if(l===a)return l;if(s){if(!n(Woe(r,l,!0),t))return Woe(r,l-1,!1)}else if(n(o=Woe(r,l+1,!0),t))return o}return e}if("top"===i){s=n(h=Woe(r,e-1,!1),t);for(var h,d=this.parent.frozenRowCount(r)?rte(r.topLeftCell)[0]:0,p=Woe(r,d,!0),c=h;0<=c;c--){if(c===p)return c;if(s){if(!n(Woe(r,c,!1),t))return Woe(r,c+1,!0)}else if(n(o=Woe(r,c-1,!1),t))return o}return e}if("right"===i){s=n(e,m=Woe(r,t+1,!0,"columns"));for(var u=Woe(r,r.colCount-1,!1,"columns"),g=m;g<r.colCount;g++){if(g===u)return g;if(s){if(!n(e,Woe(r,g,!0,"columns")))return Woe(r,g-1,!1,"columns")}else if(n(e,o=Woe(r,g+1,!0,"columns")))return o}}else{s=n(e,m=Woe(r,t-1,!1,"columns"));for(var m,d=this.parent.frozenColCount(r)?rte(r.topLeftCell)[1]:0,p=Woe(r,d,!0,"columns"),f=m;0<=f;f--){if(f===p)return f;if(s){if(!n(e,Woe(r,f,!1,"columns")))return Woe(r,f+1,!0,"columns")}else if(n(e,o=Woe(r,f-1,!1,"columns")))return o}}return t},Uce.prototype.getNextUnlockedCell=function(e,t){var i,n=this.parent.getActiveSheet();if("right"===e)for(var o=t[0],r=void 0,s=void 0,a=n.usedRange.rowIndex,l=n.usedRange.colIndex;o<=a;){for(r=void 0===r?t[1]+1:0,s&&o===t[0]&&(l=t[1]-1);r<=l;r++)if(!Hoe(Kre(o,r,n),i=Kde(n,r)||{})&&!i.hidden&&!zde(n,o))return[o,r];o!==n.usedRange.rowIndex||s?o++:(a=t[o=0],s=!0)}else if("left"===e)for(o=t[0],r=void 0,s=void 0,a=0,l=0;a<=o;){for(r=void 0===r?t[1]-1:n.usedRange.colIndex,s&&o===t[0]&&(l=t[1]+1);l<=r;r--)if(!Hoe(Kre(o,r,n),i=Kde(n,r)||{})&&!i.hidden&&!zde(n,o))return[o,r];0!==o||s?o--:(o=n.usedRange.rowIndex,a=t[0],s=!0)}else if("down"===e)for(r=t[1],o=void 0,s=void 0,l=n.usedRange.colIndex,a=n.usedRange.rowIndex;r<=l;){for(o=void 0===o?t[0]+1:0,s&&r===t[1]&&(a=t[0]-1);o<=a;o++)if(!Hoe(Kre(o,r,n),i=Kde(n,r)||{})&&!i.hidden&&!zde(n,o))return[o,r];r!==n.usedRange.colIndex||s?r++:(l=t[1],s=!(r=0))}else for(r=t[1],o=void 0,s=void 0,l=0,a=0;l<=r;){for(o=void 0===o?t[0]-1:n.usedRange.rowIndex,s&&r===t[1]&&(a=t[0]+1);a<=o;o--)if(!Hoe(Kre(o,r,n),i=Kde(n,r)||{})&&!i.hidden&&!zde(n,o))return[o,r];0!==r||s?r--:(r=n.usedRange.colIndex,l=t[1],s=!0)}return t},Uce.prototype.shiftSelection=function(e){var t=this.parent.getActiveSheet(),i=rte(t.selectedRange),n=fte(i),o=!0,r=this.parent.enableRtl;if(38===e.keyCode){for(var s=n[1];s<=n[3];s++)if(!je(l=Kre(i[2],s,t))&&l.rowSpan&&l.rowSpan<0){i[2]=Woe(t,i[2]-(Math.abs(l.rowSpan)+1),!1),o=!1;break}o&&(i[2]=Woe(t,i[2]-1,!1));var a=this.parent.frozenRowCount(t)?rte(t.topLeftCell)[0]:0;if(i[2]<a)return}if(40===e.keyCode){for(s=n[1];s<=n[3];s++)if(!je(l=Kre(i[2],s,t))&&l.rowSpan&&0<l.rowSpan){i[2]=Woe(t,i[2]+Math.abs(l.rowSpan),!0),o=!1;break}if(o&&(i[2]=Woe(t,i[2]+1,!0)),i[2]>=t.rowCount&&(i[2]=Woe(t,t.rowCount-1,!1),i[2]<0))return}if(39===e.keyCode&&!r||37===e.keyCode&&r){for(s=n[0];s<=n[2];s++)if(!je(l=Kre(s,i[3],t))&&l.colSpan&&0<l.colSpan){i[3]=Woe(t,i[3]+Math.abs(l.colSpan),!0,"columns"),o=!1;break}if(o&&(i[3]=Woe(t,i[3]+1,!0,"columns")),i[3]>=t.colCount&&(i[3]=Woe(t,t.colCount-1,!1,"columns"),i[3]<0))return}if(37===e.keyCode&&!r||39===e.keyCode&&r){for(var l,s=n[0];s<=n[2];s++)if(!je(l=Kre(s,i[3],t))&&l.colSpan&&l.colSpan<0){i[3]=Woe(t,i[3]-(Math.abs(l.colSpan)+1),!1,"columns"),o=!1;break}o&&(i[3]=Woe(t,i[3]-1,!1,"columns"));a=this.parent.frozenColCount(t)?rte(t.topLeftCell)[1]:0;if(i[3]<a)return}if(!this.parent.scrollSettings.enableVirtualization&&e.shiftKey&&e.ctrlKey){r=[t.usedRange.rowIndex,t.usedRange.colIndex];if(37===e.keyCode&&(i[3]<=r[1]?i[3]=Woe(t,0,!0,"columns"):i[3]=Woe(t,r[1],!0,"columns")),38===e.keyCode&&(i[2]<=r[0]?i[2]=Woe(t,0,!0):i[2]=Woe(t,r[0],!0)),39===e.keyCode&&(i[3]<=r[1]?i[3]=Woe(t,r[1],!1,"columns"):i[3]=Woe(t,t.colCount,!1,"columns"),i[3]<0))return;if(40===e.keyCode&&(i[2]<=r[0]?i[2]=Woe(t,r[0],!1):i[2]=Woe(t,t.rowCount,!1),i[2]<0))return}37!==e.keyCode&&39!==e.keyCode&&38!==e.keyCode&&40!==e.keyCode||(a=ste(t.activeCell),this.parent.isEdit&&e.shiftKey?(e.preventDefault(),this.parent.notify(Nse,{range:i,e:e}),this.parent.notify(vle,{range:hte(fte(i)),isSelect:!1}),this.parent.notify(mle,{})):this.parent.notify(Ese,{range:i,shiftKey:e.shiftKey}),this.scrollNavigation([Roe(t,i)?a[0]:i[2],Loe(t,i)?a[1]:i[3]]))},Uce.prototype.scrollNavigation=function(e,t){if(this.parent.allowScrolling){var i=this.parent.enableRtl?-1:1,n=this.parent.getMainContent().parentElement,o=this.parent.getScrollElement(),r=this.parent.getActiveSheet(),s=fte(rte(r.selectedRange)),a=ste(r.topLeftCell),l=this.parent.frozenRowCount(r),h=this.parent.frozenColCount(r),d=ste(r.paneTopLeftCell),a=Woe(r,(e[0]<l?a:d)[0],!0),p=this.parent.scrollModule.offset.top.size;if(n.scrollTop)if(l&&e[0]!==s[2]){if(e[0]===l)return void(n.scrollTop=0);e[0]===l-1&&(n.scrollTop=0)}else if(e[0]===Woe(r,0,!0))return void(n.scrollTop=0);if(o&&o.scrollLeft)if(h&&e[1]!==s[3]){if(e[1]===h)return void(o.scrollLeft=0);e[1]===h-1&&(o.scrollLeft=0)}else if(e[1]===Woe(r,0,!0,"columns"))return void(o.scrollLeft=0);var c,s=dce(this.parent,a).index,l=(s<=e[0]?e[0]>=l&&(t?(l=n.getBoundingClientRect().height,c=Ude(r,d[0],e[0],!0),n.scrollTop=2*l<c?p+c-l:p+c-Wde(r,e[0],!0),sce(this.parent.element)):n.scrollTop=p+Ude(r,s,e[0],!0)):a>e[0]&&(n.scrollTop&&(this.parent.scrollModule.isKeyScroll=!1),n.scrollTop=p-Math.ceil(Ude(r,e[0],a-1,!0)),t)&&sce(this.parent.element),pce(this.parent,d[1]));l<=e[1]&&o?e[1]>=h&&(t?(c=o.getBoundingClientRect().width,s=$de(r,d[1],e[1],!0),o.scrollLeft=2*c<s?(this.parent.scrollModule.offset.left.size+s-c)*i:(this.parent.scrollModule.offset.left.size+(s-Zde(r,e[0],null,!0)))*i,sce(this.parent.element)):o.scrollLeft=(this.parent.scrollModule.offset.left.size+$de(r,l,e[1],!0))*i):d[1]>e[1]&&o&&(o.scrollLeft&&(this.parent.scrollModule.isKeyScroll=!1),o.scrollLeft=(this.parent.scrollModule.offset.left.size-$de(r,e[1],d[1]-1,!0))*i,t)&&sce(this.parent.element)}},Uce.prototype.getModuleName=function(){return"keyboardNavigation"},Uce.prototype.destroy=function(){this.removeEventListener(),this.parent=null};var Qce=Uce;function Uce(e){this.parent=e,this.addEventListener()}Gce.prototype.addEventListener=function(){this.parent.on(wse,this.keyDownHandler,this),this.parent.on(bse,this.keyUpHandler,this)},Gce.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(wse,this.keyDownHandler),this.parent.off(bse,this.keyUpHandler))},Gce.prototype.isTrgtNotInput=function(e){e=e.target;return!(z(e,".e-filter-popup")||z(e,".e-find-dlg")||z(e,".e-hyperlink-dlg")||z(e,".e-sheet-tab")||z(e,".e-name-box")||z(e,".e-link-dialog"))},Gce.prototype.ribbonShortCuts=function(e){if(this.parent.showRibbon&&e.altKey&&!e.ctrlKey&&!e.shiftKey){var t=At(this.parent.element.querySelector(".e-ribbon .e-tab"),"tab"),i=void 0;if(72===e.keyCode)i=1;else if(78===e.keyCode)i=2;else if(65===e.keyCode)i=4;else if(87===e.keyCode)i=5;else if(77===e.keyCode)i=3;else if(70===e.keyCode)e.preventDefault(),ge("#"+this.parent.element.id+"_File",this.parent.element).click();else if(18===e.keyCode){e.preventDefault();var n=ste(this.parent.getActiveSheet().activeCell),o={sheetIdx:this.parent.activeSheetIndex};if(this.parent.notify(Hae,o),!(o.hasFilter&&o.filterRange&&o.filterRange[0]===n[0]&&o.filterRange[1]<=n[1]&&o.filterRange[3]>=n[1])){o=document.activeElement;if(!(o.classList.contains("e-spreadsheet-edit")||o.classList.contains("e-sheet-rename")||o.id===this.parent.element.id+"_name_box"||z(o,".e-dropdown-btn")||z(o,".e-split-btn")||z(o,".e-popup-open"))){n=this.parent.getCell(n[0],n[1]);if(n&&n.querySelector(".e-validation-list"))return;if(z(o,".e-ribbon"))return void sce(this.parent.element);for(var r,s=0;s<=this.parent.ribbonModule.ribbon.items.length;s++)if(s===this.parent.ribbonModule.ribbon.selectedTab)return(r=this.parent.element.querySelector(".e-toolbar-items").children[s+2].children[0]).setAttribute("tabindex","0"),void sce(r)}}}i&&(t.items[i].disabled||t.items[i].cssClass.includes("e-hide")?sce(this.parent.element):(e.preventDefault(),t.select(i,Object.assign(e,{isShortcut:!0}))))}},Gce.prototype.keyUpHandler=function(e){var t,i,n;37===e.keyCode||39===e.keyCode?((t=document.activeElement).classList.contains("e-colorpicker-wrapper")||t.classList.contains("e-split-btn-wrapper"))&&(t=t.querySelector(".e-split-btn"))&&sce(t):13===e.keyCode&&(i=e.target).classList.contains("e-scroll-nav")&&(n=function(){i.getAttribute("tabindex")||(i.setAttribute("tabindex","0"),sce(i)),E.remove(i,"blur",n)},E.add(i,"blur",n,this))},Gce.prototype.keyDownHandler=function(e){var t,i="None"===this.parent.selectionSettings.mode,n=(this.ribbonShortCuts(e),this.parent.getActiveSheet()),o=e.target,r=e.target;if(je(r)||!r.classList.contains("e-addNoteContainer")){if((e.ctrlKey||e.metaKey)&&this.isTrgtNotInput(e)){!z(o,".e-find-dlg")&&!i&&(-1<[79,83].indexOf(e.keyCode)||65===e.keyCode&&!this.parent.isEdit)&&e.preventDefault();var s=ste(n.activeCell);if(79===e.keyCode)this.parent.allowOpen&&this.parent.openUrl&&ge("#"+this.parent.element.id+"_fileUpload",this.parent.element).click();else if(83===e.keyCode)this.parent.saveUrl&&this.parent.allowSave&&this.parent.notify(bie,null);else if(67!==e.keyCode||i)if(75!==e.keyCode||i)if(90!==e.keyCode||i)if(89!==e.keyCode||i){if((82===e.keyCode||68===e.keyCode)&&!i){e.preventDefault();var r=fte(rte(n.selectedRange)),a={colIndex:r[1],rowIndex:r[0]},l=void 0,h=void 0;if(68===e.keyCode?(r[0]===r[2]?a.rowIndex=r[0]-1:r[0]+=1,h=hte([a.rowIndex,a.colIndex,a.rowIndex,r[3]]),l="Down"):(r[1]===r[3]?a.colIndex=r[1]-1:r[1]+=1,l="Right",h=hte([a.rowIndex,a.colIndex,r[2],a.colIndex])),a.rowIndex<0||a.colIndex<0)return;this.parent.notify($le,{fillType:Kre(a.rowIndex,a.colIndex,n,!1,!0).formula?"FillSeries":"CopyCells",dAutoFillCell:h,rangeInfo:{direction:l,startCell:a,endCell:{rowIndex:r[2],colIndex:r[3]},fillRange:r}}),this.parent.notify(poe,{type:"mousedown"}),this.parent.notify(qne,null)}}else this.parent.isEdit||(e.preventDefault(),this.parent.notify(Tae,{isUndo:!1}));else this.parent.isEdit||(e.preventDefault(),this.parent.notify(Tae,{isUndo:!0}));else{var h=n.rows[s[0]],l=void 0;e.preventDefault(),je(h)||(l=h.cells[s[1]]),je(l)&&Jre(s[0],s[1],n,l,!1),l&&l.hyperlink?this.parent.notify(uae,null):this.parent.notify(cae,null)}else this.parent.notify(_se,{promise:Promise});var d,a=n.isProtected&&Hoe(Kre(s[0],s[1],n),Kde(n,s[1]));70===e.keyCode&&!i&&this.parent.allowFindAndReplace&&(e.preventDefault(),this.parent.notify(vie,{})),a&&n.isProtected&&86!==e.keyCode||70===e.keyCode||i||(71===e.keyCode?(e.preventDefault(),this.parent.notify(Yae,null)):72===e.keyCode?(e.preventDefault(),this.parent.notify(Xae,null)):88===e.keyCode?this.parent.notify(Vse,{promise:Promise}):86===e.keyCode&&this.parent.notify(Hse,{isAction:!0}),!e.shiftKey)||76!==e.keyCode||this.parent.isEdit||n.isProtected||(e.preventDefault(),this.parent.notify(Pae,{})),i||n.isProtected&&!n.protectSettings.formatCells||(66===e.keyCode?(e.preventDefault(),d=this.parent.getCellStyleValue(["fontWeight"],s).fontWeight,this.parent.notify(Tie,{style:{fontWeight:d="bold"===d?"normal":"bold"},onActionUpdate:!0,refreshRibbon:!0})):73===e.keyCode?(e.preventDefault(),d=this.parent.getCellStyleValue(["fontStyle"],s).fontStyle,this.parent.notify(Tie,{style:{fontStyle:d="italic"===d?"normal":"italic"},onActionUpdate:!0,refreshRibbon:!0})):e.ctrlKey&&85===e.keyCode&&!e.shiftKey?(e.preventDefault(),this.parent.notify(Die,{style:{textDecoration:"underline"},refreshRibbon:!0})):e.ctrlKey&&53===e.keyCode&&!e.shiftKey&&(e.preventDefault(),this.parent.notify(Die,{style:{textDecoration:"line-through"},refreshRibbon:!0})))}27===e.keyCode&&this.parent.notify(zse,null),((e.ctrlKey||e.metaKey)&&119===e.keyCode||13===e.keyCode&&o.classList.contains("e-drop-icon"))&&this.parent.showRibbon&&(e.preventDefault(),r=this.parent.element.querySelector(".e-drop-icon"))&&r.click(),!e.ctrlKey&&!e.metaKey||i||(57===e.keyCode?n.isProtected&&!n.protectSettings.formatRows||(e.preventDefault(),s=rte(n.selectedRange),this.parent.notify(Nne,{startIndex:s[0],endIndex:s[2],hide:!e.shiftKey,isCol:!1,actionUpdate:!0})):48!==e.keyCode||n.isProtected&&!n.protectSettings.formatColumns||(s=rte(n.selectedRange),this.parent.notify(Nne,{startIndex:s[1],endIndex:s[3],hide:!e.shiftKey,isCol:!0,actionUpdate:!0}))),e.shiftKey&&!i&&(113!==e.keyCode||n.isProtected?114===e.keyCode?(e.preventDefault(),this.parent.notify(lhe,null)):116===e.keyCode&&this.parent.allowFindAndReplace?(e.preventDefault(),this.parent.notify(vie,{})):121===e.keyCode&&(t=document.activeElement.className,["e-spreadsheet","e-cell","e-header-cell","e-clipboard","e-rowhdr-table","e-selectall-table","e-main-panel"].some(function(e){return t.includes(e)}))&&this.focusTarget(n):(e.preventDefault(),0<e.target.children.length&&"string"==typeof e.target.children[e.target.children.length-1].className&&-1<e.target.children[e.target.children.length-1].className.indexOf("e-addNoteIndicator")?this.parent.notify(fae,null):this.parent.notify(mae,null))),e.altKey&&!i&&((e.ctrlKey||e.metaKey)&&78===e.keyCode?(e.preventDefault(),this.parent.refresh(!0)):113===e.keyCode&&this.parent.saveUrl&&(e.preventDefault(),this.parent.notify(bie,null))),(e.ctrlKey||e.metaKey)&&e.shiftKey&&!i&&(n.isProtected&&!n.protectSettings.formatCells||(h=n.selectedRange,l=void 0,192===e.keyCode?l="General":52===e.keyCode?l=Ghe("CurrencyWithColorCode"):53===e.keyCode?l="0%":54===e.keyCode?l=Ghe("Scientific"):51===e.keyCode?l="dd-mmm-yy":50===e.keyCode?l="h:mm AM/PM":49===e.keyCode?l=Ghe("Number"):55===e.keyCode&&(e.preventDefault(),this.parent.notify(Tie,{style:{border:"1px solid #000000"},onActionUpdate:!0,borderType:"Outer"})),!l)||are(this.parent,fte(rte(h)))||(d={range:n.name+"!"+(a={format:l,range:h,cancel:!1,requestType:"NumberFormat"}).range,format:a.format,requestType:"NumberFormat"},this.parent.trigger("beforeCellFormat",a),this.parent.notify(fie,{eventArgs:a,action:"format"}),a.cancel)||(this.parent.notify(Sie,a),this.parent.notify(poe,{type:"mousedown"}),this.parent.notify(Vae,{eventArgs:d,action:"format"}),this.parent.notify(qne,null)),85===e.keyCode)&&(e.preventDefault(),o=this.parent.element.querySelector(".e-formula-bar-panel .e-drop-icon"))&&o.click(),122!==e.keyCode||!e.shiftKey||e.ctrlKey||this.parent.isProtected||this.parent.notify(dne,{model:this.parent,start:this.parent.activeSheetIndex+1,end:this.parent.activeSheetIndex+1,modelType:"Sheet",isAction:!0,activeSheetIndex:this.parent.activeSheetIndex+1}),e.shiftKey&&e.altKey&&75===e.keyCode&&this.parent.showSheetTabs&&this.parent.element.querySelector(".e-sheets-list").click()}},Gce.prototype.focusTarget=function(e){var t,i,n,o,r,s,a,l,h,d=fte(rte(e.selectedRange)),p=0===d[1]&&d[3]===e.colCount-1,c=0===d[0]&&d[2]===e.rowCount-1;(t=p&&c?this.parent.element.querySelector(".e-selectall"):p?(o=this.parent.frozenRowCount(e),d[0]<o?(i=this.parent.getRow(d[0],this.parent.sheetModule.getSelectAllTable()))&&i.cells[0]:(d[0]=Woe(e,d[0],!0),s=Woe(e,rte(e.paneTopLeftCell)[0],!0),a=dce(this.parent,s).index,n=void 0,(n=d[0]>s&&d[0]<a?this.parent.getRow(d[0],this.parent.getRowHeaderTable()):d[0]>=a?this.parent.getRow(a-1,this.parent.getRowHeaderTable()):this.parent.getRow(s+1,this.parent.getRowHeaderTable()))&&n.cells[0])):c?(r=this.parent.frozenColCount(e),d[1]<r?(i=this.parent.element.querySelector(".e-selectall-container .e-header-row"))&&this.parent.getCell(0,d[1],i):(d[1]=Woe(e,d[1],!0,"columns"),l=Woe(e,rte(e.paneTopLeftCell)[1],!0,"columns"),h=pce(this.parent,l),n=this.parent.element.querySelector(".e-column-header .e-header-row"),d[1]>l&&d[1]<h?n&&this.parent.getCell(0,d[1],n):d[1]>=h?n&&this.parent.getCell(0,h-1,n):n&&this.parent.getCell(0,l+1,n))):(p=rte(e.paneTopLeftCell),t=this.parent.getCell(d[0],d[1]),o=this.parent.frozenRowCount(e),r=this.parent.frozenColCount(e),(t=d[0]<o&&d[1]<r?this.parent.getCell(d[0],d[1]):d[0]<o?(l=rte(e.paneTopLeftCell)[1],h=pce(this.parent,l),d[1]>l&&d[1]<h?this.parent.getCell(d[0],d[1]):d[1]>=h?this.parent.getCell(d[0],h-1):this.parent.getCell(d[0],l+1)):d[1]<r?(s=rte(e.paneTopLeftCell)[0],a=dce(this.parent,s).index,d[0]>s&&d[0]<a?this.parent.getCell(d[0],d[1]):d[0]>=a?this.parent.getCell(a-1,d[1]):this.parent.getCell(s+1,d[1])):(s=rte(e.paneTopLeftCell)[0],a=dce(this.parent,s).index,l=rte(e.paneTopLeftCell)[1],h=pce(this.parent,l),d[0]>s&&d[0]<a?d[1]>l&&d[1]<h?this.parent.getCell(d[0],d[1]):d[1]>=h?this.parent.getCell(d[0],h-1):this.parent.getCell(d[0],l+1):d[0]>=a?d[1]>l&&d[1]<h?this.parent.getCell(a-1,d[1]):d[1]>=h?this.parent.getCell(a-1,h-1):this.parent.getCell(a-1,l+1):d[1]>l&&d[1]<h?this.parent.getCell(s+1,d[1]):d[1]>=h?this.parent.getCell(s+1,h-1):this.parent.getCell(s+1,l+1)))||this.parent.getCell(p[0]+1,p[1]+1)))&&sce(t)},Gce.prototype.getModuleName=function(){return"keyboardShortcut"},Gce.prototype.destroy=function(){this.removeEventListener(),this.parent=null};var qce=Gce;function Gce(e){this.parent=e,this.addEventListener()}Xce.prototype.applyCellFormat=function(t){var e,i,n,o,r,s,a;t.checkHeight?(this.checkHeight||(this.checkHeight=!0),this.updateRowHeight(t.rowIdx,t.colIdx,t.lastCell,t.onActionUpdate,t.outsideViewport,t.rowHeight)):(i=Object.keys(t.style),e=this.parent.getActiveSheet(),t.lastCell&&!i.length&&rce(e,t.rowIdx)<=(e.standardHeight||20)||((i=t.td||this.parent.getCell(t.rowIdx,t.colIdx))?(this.updateMergeBorder(t,e),n=void 0,t.formatColor&&i.style.color===t.formatColor&&(n=t.style.color,delete t.style.color),void 0!==t.style.border||void 0!==t.style.borderTop||void 0!==t.style.borderLeft?(o={},Object.keys(t.style).forEach(function(e){o[""+e]=t.style[""+e]}),void 0!==o.border&&(Object.assign(i.style,{borderRight:t.style.border,borderBottom:t.style.border}),this.setLeftBorder(t.style.border,i,t.rowIdx,t.colIdx,t.colIdx===this.parent.frozenColCount(e)?t.hRow:t.row,t.onActionUpdate,t.first,e),this.setTopBorder(t.style.border,i,t.rowIdx,t.colIdx,t.pRow,t.pHRow,t.onActionUpdate,t.first,t.lastCell,t.manualUpdate,e,t),delete o.border),void 0!==o.borderTop&&(this.setTopBorder(t.style.borderTop,i,t.rowIdx,t.colIdx,t.pRow,t.pHRow,t.onActionUpdate,t.first,t.lastCell,t.manualUpdate,e,t),delete o.borderTop),void 0!==o.borderLeft&&(this.setLeftBorder(t.style.borderLeft,i,t.rowIdx,t.colIdx,t.colIdx===this.parent.frozenColCount(e)?t.hRow:t.row,t.onActionUpdate,t.first,e),delete o.borderLeft),Object.keys(o).length&&(void 0!==o.borderBottom&&this.setThickBorderHeight(o.borderBottom,t.rowIdx,t.colIdx,i,t.row,t.hRow,t.onActionUpdate,t.lastCell,t.manualUpdate),Object.assign(i.style,o))):(void 0!==t.style.borderBottom&&this.setThickBorderHeight(t.style.borderBottom,t.rowIdx,t.colIdx,i,t.row,t.hRow,t.onActionUpdate,t.lastCell,t.manualUpdate),Object.assign(i.style,t.style),i&&(r=i.querySelector(".e-cf-databar"))&&(r=r.querySelector(".e-databar-value"))&&(r.style.textDecoration=t.style.textDecoration,t.style.verticalAlign)&&(r.style.alignItems="top"===t.style.verticalAlign?"start":"middle"===t.style.verticalAlign?"center":"end"),(r=Kre(t.rowIdx,t.colIdx,e))&&(r.rowSpan||r.colSpan)&&0<i.offsetHeight&&(a=Kpe(this.parent,r.style||this.parent.cellStyle))>i.offsetHeight&&Xpe(this.parent,e,i.offsetHeight,t.rowIdx),t.style.fontSize&&i&&(r=i.querySelector(".e-validation-list"))&&this.parent.notify(Toe,{ddlCont:r,rowIdx:t.rowIdx,colIdx:t.colIdx,updatePosition:!0})),r=Kre(t.rowIdx,t.colIdx,e,null,!0),e.rows[t.rowIdx]&&e.rows[t.rowIdx].customHeight?r.wrap||!t.style.fontSize&&!t.style.fontFamily||((s=Wde(e,t.rowIdx,!0)-tce(t.rowIdx,t.colIdx,e))<Kpe(this.parent,r.style)?i.style.lineHeight=s+"px":i.style.lineHeight&&(i.style.lineHeight="")):t.isHeightCheckNeeded&&(t.manualUpdate?(this.checkHeight||(this.checkHeight=Qoe(t.style,t.onActionUpdate)),i&&i.children[0]&&"e-cf-databar"===i.children[0].className&&t.style.fontSize&&(i.children[0].querySelector(".e-databar-value").style.fontSize=t.style.fontSize),t.isFromAutoFillOption||this.updateRowHeight(t.rowIdx,t.colIdx,t.lastCell,t.onActionUpdate,null,t.rowHeight),r.wrap&&(t.style.fontSize||t.style.fontFamily)&&(i.style.lineHeight=parseFloat(r.style&&r.style.fontSize||this.parent.cellStyle.fontSize)*Jpe(r.style&&r.style.fontFamily?r.style:this.parent.cellStyle)+"pt")):(!r.wrap&&Qoe(t.style)&&oce(e,t.rowIdx,t.colIdx,nce(this.parent,t.rowIdx,t.colIdx,e,t.style)),t.lastCell&&(a=rce(e,t.rowIdx),(e.standardHeight||20)<a)&&a>Wde(e,t.rowIdx)&&Xpe(this.parent,e,a,t.rowIdx,t.row,t.hRow))),void 0!==n&&(t.style.color=n)):this.updateRowHeight(t.rowIdx,t.colIdx,!0,t.onActionUpdate,null,t.rowHeight)))},Xce.prototype.updateRowHeight=function(e,t,i,n,o,r){if(this.checkHeight){var s=this.parent.getActiveSheet(),a=Kre(e,t,s,null,!0);if(!a.rowSpan){var l=0,l=nce(this.parent,e,t,s,a.style||this.parent.cellStyle,a.wrap&&!a.colSpan?$pe(this.parent.getDisplayText(a),ice(s,e,t),a.style,this.parent.cellStyle):1),h=a.value&&a.value.toString();if(h&&-1<h.indexOf("\n")){for(var d=void 0,p=h.split("\n"),c=0,u=p.length,d=0;d<u;d++){var g=$pe(p[d],ice(s,e,t),a.style,this.parent.cellStyle);c+=g=0===g?1:g}l=nce(this.parent,e,t,s,a.style||this.parent.cellStyle,c)}var h=s&&s.standardHeight?s.standardHeight:20;oce(s,e,t,l=l<h?h:l),o||(h=this.parent.getCell(e,t))&&h.children[0]&&"e-cf-databar"===h.children[0].className&&(h.children[0].style.height="100%",h.children[0].firstElementChild.nextElementSibling.style.height="100%"),i&&(this.checkHeight=!1,l=r||rce(s,e),h=Wde(s,e),n?l!==h:h<l)&&Xpe(this.parent,s,l,e,null,null,!0,o)}}},Xce.prototype.updateMergeBorder=function(e,t){var i,n=Kre(e.rowIdx,e.colIdx,t,null,!0),o={range:[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx]};this.parent.notify(Rne,o),1<n.rowSpan&&!e.style.borderBottom&&(i=Kre(o.range[2],o.range[1],t,null,!0)).style&&i.style.borderBottom&&(e.style.borderBottom=i.style.borderBottom),1<n.colSpan&&!e.style.borderRight&&(i=Kre(o.range[0],o.range[3],t,null,!0)).style&&i.style.borderRight&&(e.style.borderRight=i.style.borderRight)},Xce.prototype.setLeftBorder=function(e,t,i,n,o,r,s,a){s&&s.includes("Column")||((s=this.parent.enableRtl?this.parent.getCell(i,n+1,o):this.parent.getCell(i,n-1,o))?(o=Kre(i,n-1,a,!1,!0)).rowSpan&&1!==o.rowSpan||o.colSpan&&1!==o.colSpan?(this.parent.notify(Rne,i={range:[i,n-1,i,n-1]}),(o=Kre(i.range[0],i.range[1],a,!1,!0)).style&&o.style.borderRight&&"none"!==o.style.borderRight||(o=Kre(i.range[0],i.range[3],a,null,!0)).style&&o.style.borderRight&&"none"!==o.style.borderRight||(t.style.borderLeft=e)):(r&&""!==e&&n===this.parent.viewport.leftIndex&&(this.parent.getMainContent().scrollLeft-=this.getBorderSize(e)),s.style.borderRight="none"===e?s.style.borderRight:e):t.style.borderLeft=e)},Xce.prototype.setTopBorder=function(e,t,i,n,o,r,s,a,l,h,d,p){if(!a||!a.includes("Row")){var a=n,c=Kre(i,n,d,!1,!0),a=(1<c.colSpan&&epe(d,n)&&(a=Woe(d,n,!0,"columns"))>n+c.colSpan-1&&(a=n),this.parent.getCell(i-1,a,o));if(a)if((c=Kre(i-1,n,d,!1,!0)).rowSpan&&1!==c.rowSpan||c.colSpan&&1!==c.colSpan){var u={range:[i-1,n,i-1,n]};this.parent.notify(Rne,u),(c=Kre(u.range[0],u.range[1],d,!1,!0)).style&&c.style.borderBottom&&"none"!==c.style.borderBottom||(c=Kre(u.range[2],u.range[1],d,null,!0)).style&&c.style.borderBottom&&"none"!==c.style.borderBottom||(t.style.borderTop=e,void 0!==p.mergeBorderRows&&-1===p.mergeBorderRows.indexOf(i)&&p.mergeBorderRows.push(i))}else{if(zde(d,i-1)){u=[Number(a.parentElement.getAttribute("aria-rowindex"))-1,n];if(this.parent.getCellStyleValue(["bottomPriority"],u).bottomPriority)return}s&&""!==e&&d.topLeftCell.includes(""+(i+1))&&(this.parent.getMainContent().parentElement.scrollTop-=this.getBorderSize(e)),this.setThickBorderHeight(e,i-1,n,a,o,r,s,l,h),a.style.borderBottom="none"===e?a.style.borderBottom:e}else t.style.borderTop=e}},Xce.prototype.setThickBorderHeight=function(e,t,i,n,o,r,s,a,l){var e=e?this.getBorderSize(e):1,h=this.parent.getActiveSheet();!(2<e)||h.rows[t]&&h.rows[t].customHeight||(l?(this.checkHeight||(this.checkHeight=!0),this.updateRowHeight(t,i,a,s)):Wde(h,t)<(l=Math.ceil(this.parent.calculateHeight(this.parent.getCellStyleValue(["fontFamily","fontSize"],[t,i]),1,3)))&&Xpe(this.parent,h,l,t,o,r)),!s||!a&&this.checkHeight||!(e<3)||h.rows[t]&&h.rows[t].customHeight||(this.checkHeight||(this.checkHeight=!0),this.updateRowHeight(t,i,a,s))},Xce.prototype.getBorderSize=function(e){e=e.split(" ")[0];return"thin"===e?1:"medium"===e?2:"thick"===e?3:parseInt(e,10)||1},Xce.prototype.clearObj=function(e){var t=this,i=e.options,n=i.range?0<i.range.indexOf("!")?i.range.substring(i.range.lastIndexOf("!")+1):i.range:this.parent.getActiveSheet().selectedRange,o=i.range&&0<i.range.indexOf("!")?Bre(this.parent,i.range.substring(0,i.range.lastIndexOf("!"))):this.parent.activeSheetIndex,r=fte(rte(n));if(are(this.parent,r))e.isAction&&this.parent.notify(ele,null);else{var s,a,l,h=this.parent.sheets[o],d=r[0],p=r[2],c=this.parent.element.getElementsByClassName("e-ss-overlay-active"),u=0<c.length,g=0<this.parent.element.getElementsByClassName("e-prev-highlight-bottom").length,m={range:n,type:i.type,requestType:"clear",sheetIndex:o},f=function(){e.isAction&&t.parent.notify(fie,{action:"beforeClear",eventArgs:m})},y=function(){e.isAction&&(m={range:h.name+"!"+n,type:i.type,sheetIndex:o},l&&(m.cfClearActionArgs=l.cfClearActionArgs),t.parent.notify(Vae,{eventArgs:m,action:"clear",isSelectAll:g}))},v="Clear All"===i.type;if(u)"Clear Contents"!==i.type&&!v||(f(),c[0].classList.contains("e-datavisualization-chart")?this.parent.notify(Dle,{id:c[0].id,sheetIdx:this.parent.activeSheetIndex+1,clearAction:!0}):this.parent.notify(Ele,{id:c[0].id,sheetIdx:this.parent.activeSheetIndex+1,clearAction:!0}),y());else{if(f(),"Clear Formats"===i.type||v)for(l={range:n,sheetIdx:o,isClear:!0},this.parent.notify(Hne,l),e.cfClearActionArgs=l.cfClearActionArgs,v&&(this.parent.notify(une,{range:n,isRemoveValidation:!0}),0===d)&&0===r[1]&&p>=h.usedRange.rowIndex&&r[3]>=h.usedRange.colIndex&&this.parent.setUsedRange(d,r[1],h,!1,!0);d<=p;d++)for(s=r[1],a=r[3];s<=a;s++){var b=Kre(d,s,h),w=this.parent.getCell(d,s);b&&(v&&b.formula&&this.parent.notify(Gie,{cellRef:hte([d,s,d,s])}),b.wrap&&this.parent.notify(sne,{range:[d,s,d,s],wrap:!1,sheet:h}),b.hyperlink)&&(w&&q(w.querySelectorAll(".e-hyperlink"),"e-hyperlink-style"),v)&&this.parent.removeHyperlink(h.name+"!"+hte([d,s,d,s]))}"Clear Hyperlinks"===i.type&&this.parent.removeHyperlink(h.name+"!"+n),this.parent.notify(zne,{range:h.name+"!"+n,type:i.type}),this.parent.serviceLocator.getService("cell").refreshRange(fte(rte(n)),!1,!1,!1,"Clear Hyperlinks"===i.type,nre(this.parent),!v,null,null,null,g),e.isFromUpdateAction||this.parent.notify(Ose,{address:n}),this.parent.notify(Nie,null),y()}}},Xce.prototype.addEventListener=function(){this.parent.on(Mie,this.applyCellFormat,this),this.parent.on(ule,this.clearObj,this)},Xce.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Mie,this.applyCellFormat),this.parent.off(ule,this.clearObj))},Xce.prototype.destroy=function(){this.removeEventListener(),this.parent=null,this.checkHeight=null},Xce.prototype.getModuleName=function(){return"cellformat"};var Yce=Xce;function Xce(e){this.checkHeight=!1,this.parent=e,this.addEventListener()}Jce.prototype.addEventListener=function(){this.parent.on(cse,this.wireEvents,this),this.parent.on(hae,this.autoFit,this),this.parent.on(zae,this.setAutoFitHandler,this),this.parent.on(dhe,this.propertyChange,this)},Jce.prototype.autoFit=function(e){for(var t=e.isRow?this.parent.getRowHeaderTable():this.parent.getColHeaderTable().rows[0],i=e.startIndex;i<=e.endIndex;i++)this.trgtEle=e.isRow?this.parent.getRow(i,t):this.parent.getCell(null,i,t),this.setAutofit(i,!e.isRow)},Jce.prototype.wireEvents=function(){var e=this.parent.getRowHeaderContent(),t=this.parent.element.getElementsByClassName("e-header-panel")[0];t&&(E.add(t,"dblclick",this.dblClickHandler,this),E.add(e,"dblclick",this.dblClickHandler,this),E.add(t,"mousedown",this.mouseDownHandler,this),E.add(e,"mousedown",this.mouseDownHandler,this),this.wireResizeCursorEvent(e,t))},Jce.prototype.wireResizeCursorEvent=function(e,t){E.add(e,"mousemove",this.setTarget,this),E.add(t,"mousemove",this.setTarget,this)},Jce.prototype.unWireResizeCursorEvent=function(){E.remove(this.parent.getRowHeaderContent(),"mousemove",this.setTarget);var e=this.parent.element.getElementsByClassName("e-header-panel")[0];e&&E.remove(e,"mousemove",this.setTarget)},Jce.prototype.unwireEvents=function(){var e=this.parent.getRowHeaderContent(),t=this.parent.element.getElementsByClassName("e-header-panel")[0];t&&(E.remove(t,"dblclick",this.dblClickHandler),E.remove(e,"dblclick",this.dblClickHandler),E.remove(t,"mousedown",this.mouseDownHandler),E.remove(e,"mousedown",this.mouseDownHandler),this.unWireResizeCursorEvent())},Jce.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(cse,this.wireEvents),this.parent.off(hae,this.autoFit),this.parent.off(zae,this.setAutoFitHandler),this.parent.off(dhe,this.propertyChange))},Jce.prototype.mouseMoveHandler=function(e){var t,i=this.parent.element.getElementsByClassName("e-colresize-handler")[0],n=this.parent.element.getElementsByClassName("e-rowresize-handler")[0];this.resizeTooltip(null,!0,e),(i||n)&&(this.isMouseMoved=!0,t=this.parent.enableRtl,i?(t?e.x<this.trgtEle.parentElement.firstChild.getBoundingClientRect().right:e.x>this.trgtEle.parentElement.firstChild.getBoundingClientRect().left)&&(i.style.left=e.clientX-document.getElementById(this.parent.element.id+"_sheet").getBoundingClientRect().left+"px"):n&&e.y>=this.trgtEle.parentElement.parentElement.firstChild.getBoundingClientRect().top&&(n.style.top=e.clientY-document.getElementById(this.parent.element.id+"_sheet").getBoundingClientRect().top+"px"))},Jce.prototype.mouseDownHandler=function(e){var t,i;z(e.target,".e-header-cell")&&!e.target.className.includes("e-filter-icon")&&(this.event=e,this.trgtEle=e.target,(this.trgtEle.parentElement.classList.contains("e-hide-end")||this.trgtEle.classList.contains("e-hide-end"))&&(t=this.trgtEle.offsetHeight,i=e.offsetY,10<=t&&i<5||t-2<8&&i<Math.ceil((i-2)/2))&&this.trgtEle.classList.add("e-skip-resize"),this.updateTarget(e,this.trgtEle),i=(t=this.trgtEle).classList.contains("e-colresize")?"e-colresize-handler":t.classList.contains("e-rowresize")?"e-rowresize-handler":"",this.createResizeHandler(t,i),this.unWireResizeCursorEvent(),E.add(this.parent.element,"mousemove",this.mouseMoveHandler,this),E.add(document,"mouseup",this.mouseUpHandler,this))},Jce.prototype.mouseUpHandler=function(e){var t=this.parent.element.getElementsByClassName("e-resize-handle")[0],e=(this.resizeOn(e),this.isMouseMoved=null,document.querySelector(".e-header-tooltip")),t=(t&&(G(t),this.updateCursor()),e&&e.remove(),E.remove(document,"mouseup",this.mouseUpHandler),E.remove(this.parent.element,"mousemove",this.mouseMoveHandler),this.parent.element.getElementsByClassName("e-header-panel")[0]);t&&this.wireResizeCursorEvent(this.parent.getRowHeaderContent(),t),this.parent.notify(Jle,null),this.parent.notify(Zle,null)},Jce.prototype.dblClickHandler=function(e){var t;z(e.target,".e-header-cell")&&!e.target.className.includes("e-filter-icon")&&(this.trgtEle=e.target,this.updateTarget(e,this.trgtEle)?this.parent.notify(ele,null):(this.trgtEle.classList.contains("e-colresize")?(e=parseInt(this.trgtEle.getAttribute("aria-colindex"),10)-1,t=Zde(this.parent.getActiveSheet(),e)+"px",this.trgtEle.classList.contains("e-unhide-column")?this.showHiddenColumns(e-1):this.setAutofit(e,!0,t,this.trgtEle)):this.trgtEle.classList.contains("e-rowresize")&&(e=parseInt(this.trgtEle.parentElement.getAttribute("aria-rowindex"),10)-1,t=Wde(this.parent.getActiveSheet(),e)+"px",this.setAutofit(e,!1,t)),this.parent.notify(Jle,null)))},Jce.prototype.setTarget=function(e){if(!this.parent.isEdit&&z(e.target,".e-header-cell")&&!e.target.className.includes("e-filter-icon")){var t,i,n,o,r,s=e.target,a=this.parent.getActiveSheet();if(a.isProtected&&(!a.protectSettings.formatColumns||!a.protectSettings.formatRows)){if(!a.protectSettings.formatRows&&!a.protectSettings.formatColumns)return;if(a.protectSettings.formatRows&&z(s,".e-colhdr-table"))return;if(a.protectSettings.formatColumns&&z(s,".e-rowhdr-table"))return}if(z(s,".e-header-row")?(i=s.offsetWidth,n="e-colresize",o=this.parent.enableRtl?i-e.offsetX:e.offsetX,(r=this.getColPrevSibling(s))&&!r.classList.contains("e-select-all-cell")?t=r:1<Number(s.getAttribute("aria-colindex"))&&(t=s)):z(s,".e-row")&&(o=e.offsetY,i=s.offsetHeight,n="e-rowresize",(r=this.getRowPrevSibling(s))?t=r.firstElementChild:1<Number(s.parentElement.getAttribute("aria-rowindex"))&&(t=s)),i-2<8&&o!==Math.ceil((i-2)/2))o<Math.ceil((i-2)/2)?(s.classList.add(n),t&&t.classList.add(n)):o>Math.ceil((i-2)/2)&&s.classList.add(n);else if(i-5<o&&o<=i&&10<=i)s.classList.add(n);else if(o<5&&t&&10<=i)s.classList.add(n),t.classList.add(n);else for(var l=this.parent.element.getElementsByClassName(n),h=0;h<l.length;h++)l[h].classList.remove(n)}},Jce.prototype.getColPrevSibling=function(e){var t=this.parent.frozenColCount(this.parent.getActiveSheet());return e.previousElementSibling||(t&&z(e,".e-column-header")?this.parent.getSelectAllContent().querySelector(".e-header-row").lastElementChild:null)},Jce.prototype.getRowPrevSibling=function(e){var t=this.parent.frozenRowCount(this.parent.getActiveSheet());return e.parentElement.previousElementSibling||(t&&z(e,".e-row-header")?this.parent.getSelectAllContent().querySelector("tbody").lastElementChild:null)},Jce.prototype.updateTarget=function(e,t){if(z(t,".e-header-row")){var i=this.parent.enableRtl?t.offsetWidth-e.offsetX:e.offsetX;if(t.offsetWidth<10&&i<Math.ceil((t.offsetWidth-2)/2)||i<5&&10<=t.offsetWidth&&t.classList.contains("e-colresize")){var n=this.parent.getActiveSheet(),o=Number(this.trgtEle.getAttribute("aria-colindex"))-2;if((r=this.getColPrevSibling(t))&&!epe(n,o))this.trgtEle=r;else if(-1<o){if(Kde(n,o).isReadOnly||are(this.parent,[0,o,n.rowCount-1,o]))return!0;this.trgtEle.classList.add("e-unhide-column")}}}else if(t.offsetHeight<10&&e.offsetY<Math.ceil((t.offsetHeight-2)/2)||e.offsetY<5&&10<=t.offsetHeight&&t.classList.contains("e-rowresize")){var r,n=this.parent.getActiveSheet(),o=Number(t.parentElement.getAttribute("aria-rowindex"))-2;if((r=this.getRowPrevSibling(t))||zde(n,o))if("dblclick"===e.type&&zde(n,o)){if(_de(n,o).isReadOnly||are(this.parent,[o,0,o,n.colCount-1]))return!0;i=fte(rte(n.selectedRange)),t=void 0,t=o<=i[2]&&o>i[0]&&Loe(n,i)?{startIndex:i[0],endIndex:i[2],hide:!1,autoFit:!0}:{startIndex:o,endIndex:o,hide:!1,autoFit:!0};this.parent.notify(Nne,t)}else zde(n,o)||(this.trgtEle=r.getElementsByClassName("e-header-cell")[0])}return!1},Jce.prototype.setAutoFitHandler=function(e){e.isCol&&epe(this.parent.getActiveSheet(),e.idx)?this.showHiddenColumns(e.idx):this.setAutofit(e.idx,e.isCol,null,null,e.sheetIdx)},Jce.prototype.getWrapText=function(e,i,n){function o(){var e=parseInt(h.toString(),10);(t<e||e===t&&Zpe(p.trim(),n,s.parent.cellStyle)>Zpe(d,n,s.parent.cellStyle))&&(d=p.trim(),t=e)}var r,s=this,a=e.toString().split(" "),l=Zpe(" ",n,this.parent.cellStyle),t=0,h=0,d=e,p="";return a.forEach(function(e,t){r=Zpe(e,n,s.parent.cellStyle),1<(h+r)/i?(o(),p="",h=r):h+=r+=1<=(h+r+l)/i?0:l,p+=e+" ",t===a.length-1&&o()}),d},Jce.prototype.setAutofit=function(e,t,i,n,o){var r,s=this,a=je(o)?this.parent.getActiveSheet():_re(this.parent,o),o=!!je(o)||o===this.parent.activeSheetIndex;if(n){var l={cancel:!1,index:e,isCol:t,sheetIndex:this.parent.activeSheetIndex};if(t?(l.oldWidth=i,l.autoFitWithHeader=!1):l.oldHeight=i,this.parent.notify(fie,{eventArgs:l,action:"resizeToFit"}),l.cancel)return;l=l.autoFitWithHeader}var h,d,p,c={},u=this.parent.createElement("table",{className:this.parent.getContentTable().className+" e-resizetable",styles:"height: auto"}),g=this.parent.createElement("tbody"),m=this.parent.createElement("tr",{className:"e-row"}),f=this.parent.createElement("td",{className:"e-cell"}),y=0;if(t){u.style.width="auto";var v,b=function(e){(h=f.cloneNode()).textContent=e,h.style.fontFamily=c.style&&c.style.fontFamily||s.parent.cellStyle.fontFamily,h.style.fontSize=c.style&&c.style.fontSize||s.parent.cellStyle.fontSize,h.style.fontWeight=c.style&&c.style.fontWeight||s.parent.cellStyle.fontWeight,(v=m.cloneNode()).appendChild(h),g.appendChild(v)};l&&b(n.textContent);for(var w=0,C=a.rows.length;w<C;w++)(c=Kre(w,e,a))&&c.value&&(c.wrap?(d=!0,b(this.getWrapText(this.parent.getDisplayText(c),ice(a,e,e,1<c.colSpan?e+c.colSpan-1:e),c.style))):b(this.parent.getDisplayText(c)));r=Zde(a,e)}else{for(var S=a.rows[e]&&a.rows[e].cells?a.rows[e].cells.length:0,A=this.parent.createElement("colgroup"),x=0;x<S;x++)(c=Kre(e,x,a))&&(h=f.cloneNode(),c.wrap&&h.classList.add("e-wraptext"),h.textContent=this.parent.getDisplayText(c),h.style.fontFamily=c.style&&c.style.fontFamily||this.parent.cellStyle.fontFamily,h.style.fontSize=c.style&&c.style.fontSize||this.parent.cellStyle.fontSize,m.appendChild(h),y+=p=c.colSpan&&1<=c.colSpan?this.getMergedColumnsWidth(c.colSpan,x,a):c.colSpan&&c.colSpan<1?0:Zde(a,x,!1,!0),A.appendChild(this.parent.createElement("col",{styles:"width:"+p+"px"})));u.appendChild(A),g.appendChild(m),r=Wde(a,e)}u.appendChild(g),y&&(u.style.width=y+"px");var I,l=this.parent.createElement("div",{className:this.parent.element.className,styles:"display: block"}),n=(l.appendChild(u),document.body.appendChild(l),u.getBoundingClientRect()),u=(document.body.removeChild(l),Math.ceil(t?n.width:n.height)),l=(t?this.getFloatingElementWidth(u+(d?1:0),e):u)||r;t?(I=0<l?-(r-l):-r,(n=this.parent.frozenColCount(a))&&e>=rte(a.topLeftCell)[1]&&e<n||e>=this.parent.viewport.leftIndex+n&&e<=this.parent.viewport.rightIndex?(Kde(a,e).width=0<l?l:0,o&&(this.resizeStart(e,this.parent.getViewportIndex(e,!0),l+"px",t,!0,i),this.parent.notify(nae,{threshold:I,colIdx:e}))):(o&&this.parent.notify(nae,{threshold:I,colIdx:e}),Kde(a,e).width=0<l?l:0)):(I=-(r-(l=20<l?l:20)),(u=this.parent.frozenRowCount(a))&&e>=rte(a.topLeftCell)[0]&&e<u||e>=this.parent.viewport.topIndex+u&&e<=this.parent.viewport.bottomIndex?(Qde(a,e,l),Hde(a,e,{customHeight:!1}),o&&(this.resizeStart(e,this.parent.getViewportIndex(e),l+"px",t,!0,i),this.parent.notify(iae,{threshold:I,rowIdx:e}))):(o&&this.parent.notify(iae,{threshold:I,rowIdx:e}),Qde(a,e,l))),o&&this.parent.selectRange(a.selectedRange)},Jce.prototype.getMergedColumnsWidth=function(e,t,i){for(var n=0,o=0;o<e;o++)n+=Zde(i,t,!1,!0),t++;return n},Jce.prototype.createResizeHandler=function(e,t){var t=this.parent.createElement("div",{className:t}),i=(t.classList.add("e-resize-handle"),document.getElementById(this.parent.element.id+"_sheet"));e.classList.contains("e-colresize")?(t.style.height=this.parent.getMainContent().parentElement.clientHeight+this.parent.getColumnHeaderContent().offsetHeight+"px",t.style.left=this.event.clientX-i.getBoundingClientRect().left+"px",t.style.top="0px"):e.classList.contains("e-rowresize")&&(t.style.width=this.parent.getMainContent().parentElement.clientWidth+"px",t.style.left="0px",t.style.top=this.event.clientY-i.getBoundingClientRect().top+"px"),i.appendChild(t),this.resizeTooltip(e,!1),this.updateCursor()},Jce.prototype.resizeTooltip=function(e,t,i){var n,o,r;t?(t=this.parent.enableRtl,r=document.querySelector(".e-header-tooltip"),n=this.parent.element.getElementsByClassName("e-colresize-handler")[0],o=this.parent.element.getElementsByClassName("e-rowresize-handler")[0],n?(n=t?Math.round(this.trgtEle.getBoundingClientRect().right)-i.clientX:i.clientX-Math.round(this.trgtEle.getBoundingClientRect().left),r&&(r.firstChild.textContent=0<n?"Width:("+n.toString()+" pixels)":"Width: 0.00")):o&&(t=i.clientY-Math.round(this.trgtEle.getBoundingClientRect().top),r)&&(r.firstChild.textContent=0<t?"Height:("+t.toString()+" pixels)":"Height: 0.00")):(n=e.classList.contains("e-colresize"),o=e.classList.contains("e-rowresize"),(n||o)&&(i=n?"e-colresize-handler":"e-rowresize-handler",r=new NS({cssClass:"e-header-tooltip",showTipPointer:!1}),n?r.content=ao(function(){return"Width:("+Math.round(e.getBoundingClientRect().width).toString()+" pixels)"}):o&&(r.content=ao(function(){return"Height:("+Math.round(e.getBoundingClientRect().height).toString()+" pixels)"}),r.offsetX=-(this.parent.getMainContent().parentElement.clientWidth/2-Math.round(e.getBoundingClientRect().width))),r.appendTo("."+i),r.open(),r.refresh()))},Jce.prototype.setColWidth=function(e,t,i,n){var o=this.parent.getActiveSheet(),r=Hpe(i)-n;r<0&&n<-r&&(r=-n),0<i?this.isMouseMoved&&this.trgtEle.classList.contains("e-unhide-column")?(this.showHiddenColumns(e,i),this.parent.notify(Vae,{eventArgs:{index:e,width:"0px",isCol:!0,sheetIndex:this.parent.activeSheetIndex,oldWidth:n+"px",hide:!1},action:"resize"})):(this.resizeStart(e,t,i+"px",!0,!1,n+"px"),Jde(o,e,{width:i,customWidth:!0}),this.parent.notify(nae,{threshold:r,colIdx:e,checkWrapCell:!0})):this.isMouseMoved&&(this.parent.hideColumn(e),this.showHideCopyIndicator(),this.parent.notify(Vae,{eventArgs:{index:e,width:"0px",isCol:!0,sheetIndex:this.parent.activeSheetIndex,oldWidth:n+"px",hide:!0},action:"resize"}))},Jce.prototype.showHideCopyIndicator=function(){var e=this.parent.element.getElementsByClassName("e-copy-indicator")[0],t=!1;e&&(G(e),this.parent.notify(the,null),t=!0),t&&this.parent.notify(cse,{})},Jce.prototype.showHiddenColumns=function(e,t){var i,n,o,r=this,s=this.parent.getActiveSheet(),a=rte(s.selectedRange);if(e>=a[1]&&e<=a[3]&&a[2]===s.rowCount-1&&ste(s.activeCell)[0]===ste(s.topLeftCell)[0]?(i=a[1],n=a[3],o=this.parent.getMainContent().querySelector("colgroup")):i=n=e,void 0!==t)for(var l=i;l<=n;l++)Jde(s,l,{width:t,customWidth:!0}),l>=this.parent.viewport.leftIndex&&l<=this.parent.viewport.rightIndex&&!epe(s,l)&&(o.children[this.parent.getViewportIndex(l,!0)].style.width=t+"px");this.trgtEle&&this.trgtEle.classList.remove("e-unhide-column");var h,a={startIndex:i,endIndex:n,hide:!1,isCol:!0,autoFit:!0};this.parent.notify(Nne,a),this.showHideCopyIndicator(),void 0===t&&(a.autoFit?this.autoFit({isRow:!1,startIndex:i,endIndex:n}):(h=function(){r.parent.off(cse,h),r.autoFit({isRow:!1,startIndex:i,endIndex:n})},this.parent.on(cse,h,this)))},Jce.prototype.setRowHeight=function(e,t,i,n){var o,r=this.parent.getActiveSheet(),s=this.parent.frozenColCount(r),s=parseInt(this.parent.getRow(e,null,s).style.height,10),a=Hpe(parseInt(i,10))-s;a<0&&s<-a&&(a=-s),r.rows[e]&&r.rows[e].customHeight&&(o=!0),this.resizeStart(e,t,i,!1,!1,n,o),Hde(r,e,{height:0<parseInt(i,10)?parseInt(i,10):0,customHeight:!0}),this.parent.notify(iae,{threshold:a,rowIdx:e,isCustomHgt:!0})},Jce.prototype.resizeOn=function(e){var t=this,i=this.parent.getActiveSheet(),n=rte(i.activeCell),o=Kre(n[0],n[1],i);if(this.trgtEle.classList.contains("e-rowresize")){var r=Number(this.trgtEle.parentElement.getAttribute("aria-rowindex"))-2;if(this.isMouseMoved&&zde(i,r)&&this.trgtEle.classList.contains("e-skip-resize")&&e.clientY>this.trgtEle.getBoundingClientRect().top){this.trgtEle.classList.remove("e-skip-resize");var s={startIndex:r,endIndex:r,hide:!1,skipAppend:!0},a=(this.parent.notify(Nne,s),this.parent.getRowHeaderTable().tBodies[0]),l=this.parent.getContentTable().tBodies[0];s.hdrRow.style.display="none",s.row.style.display="none",a.insertBefore(s.hdrRow,a.children[s.insertIdx]),l.insertBefore(s.row,l.children[s.insertIdx]),this.trgtEle=s.hdrRow.firstElementChild,s.hdrRow.nextElementSibling.classList.remove("e-hide-end"),s.mergeCollection.forEach(function(e){t.parent.notify(Bne,e)})}else if(this.trgtEle.classList.contains("e-skip-resize")){if(this.trgtEle.classList.remove("e-skip-resize"),!this.isMouseMoved&&zde(i,r)||!this.trgtEle.parentElement.previousElementSibling)return;this.trgtEle=this.trgtEle.parentElement.previousElementSibling.getElementsByClassName("e-header-cell")[0]}var h=a=parseInt(this.trgtEle.parentElement.getAttribute("aria-rowindex"),10)-1,a=this.parent.getViewportIndex(h),l=this.parent.frozenColCount(i),d=this.parent.getRow(h,null,l).style.height;if((u=e.clientY-this.event.clientY+parseInt(d,10))<=0)return this.parent.hideRow(h),this.showHideCopyIndicator(),Hde(i,h,{height:0,customHeight:!0}),void this.parent.notify(Vae,{eventArgs:{index:h,height:"0px",isCol:!1,sheetIndex:this.parent.activeSheetIndex,oldHeight:d},action:"resize"});if(this.setRowHeight(h,a,u+"px",d),this.parent.notify(dae,{rowIndex:h}),"none"===this.trgtEle.parentElement.style.display){var p=this.parent.getActiveSheet(),c=fte(rte(p.selectedRange));if(h<=c[2]&&h>c[0]){for(var u=Wde(p,h),g=void 0,m=c[0];m<=c[2];m++)m!==h&&(d=Wde(p,m)+"px",Hde(p,m,{customHeight:!0,height:u}),zde(p,m)?g=g||m:(this.parent.getRow(m).style.height=u+"px",p.showHeaders&&(this.parent.getRow(m,this.parent.getRowHeaderTable()).style.height=u+"px")),this.parent.notify(Vae,{eventArgs:{index:m,height:u+"px",isCol:!1,sheetIndex:this.parent.activeSheetIndex,oldHeight:d},action:"resize"}));this.parent.hideRow(c[0],h-1,!1),this.showHideCopyIndicator(),a+=Math.abs(h-g)}else 0===a||zde(p,h-1)?0!==a&&this.trgtEle.parentElement.classList.add("e-hide-end"):this.trgtEle.parentElement.previousElementSibling.classList.remove("e-hide-start"),this.parent.selectRange(p.selectedRange);this.trgtEle.parentElement.style.display="",this.parent.getContentTable().rows[a].style.display=""}}else this.trgtEle.classList.contains("e-colresize")&&(this.isMouseMoved&&this.trgtEle.classList.contains("e-unhide-column")&&e.clientX<this.trgtEle.getBoundingClientRect().left&&(this.trgtEle.classList.remove("e-unhide-column"),this.trgtEle.previousElementSibling)&&(this.trgtEle=this.trgtEle.previousElementSibling),a=parseInt(this.trgtEle.getAttribute("aria-colindex"),10)-1,s=void 0,s=this.trgtEle.classList.contains("e-unhide-column")?(--a,0):Zde(this.parent.getActiveSheet(),a),this.setColWidth(a,this.parent.getViewportIndex(a,!0),(this.parent.enableRtl?this.event.clientX-e.clientX:e.clientX-this.event.clientX)+s,s));o&&o.format&&o.format.includes("*")&&this.parent.notify(Aie,{value:o.value,format:o.format,cell:o,formattedText:o.value,rowIndex:n[0],colIndex:n[1]})},Jce.prototype.resizeStart=function(e,t,i,n,o,r,s){Qpe(e,t,i,n,this.parent);t=n?{index:e,width:i,isCol:n,sheetIndex:this.parent.activeSheetIndex,oldWidth:r}:{index:e,height:i,isCol:n,sheetIndex:this.parent.activeSheetIndex,oldHeight:r,isPrevCustomHeight:s};e=r!==i;e&&this.parent.notify(Vae,{eventArgs:t,action:o?"resizeToFit":"resize"})},Jce.prototype.updateCursor=function(){this.parent.element.getElementsByClassName("e-colresize-handler")[0]?this.parent.element.classList.add("e-col-resizing"):this.parent.element.classList.contains("e-col-resizing")&&this.parent.element.classList.remove("e-col-resizing"),this.parent.element.getElementsByClassName("e-rowresize-handler")[0]?this.parent.element.classList.add("e-row-resizing"):this.parent.element.classList.contains("e-row-resizing")&&this.parent.element.classList.remove("e-row-resizing")},Jce.prototype.getFloatingElementWidth=function(e,t){var i=e,n={filterRange:[],hasFilter:!1};return this.parent.notify(Hae,n),i=n.hasFilter&&n.filterRange&&n.filterRange[1]<=t&&n.filterRange[3]>=t?e+22:i},Jce.prototype.destroy=function(){this.unwireEvents(),this.removeEventListener(),this.trgtEle&&this.trgtEle.remove(),this.trgtEle=null,this.event=null,this.parent=null},Jce.prototype.getModuleName=function(){return"resize"},Jce.prototype.propertyChange=function(e){"allowResizing"===e.propertyName&&this.wireEvents()};var Kce=Jce;function Jce(e){this.parent=e,this.addEventListener()}$ce.prototype.hideShow=function(t){var e,i=this,n=ee(t.sheetIndex)?this.parent.activeSheetIndex:t.sheetIndex,o=_re(this.parent,n);if(t.startIndex>t.endIndex&&(r=t.startIndex,t.startIndex=t.endIndex,t.endIndex=r),void 0!==t.actionUpdate){var r=t.isCol?[0,t.startIndex,o.rowCount-1,t.endIndex]:[t.startIndex,0,t.endIndex,o.colCount-1];if(are(this.parent,r))return void(t.actionUpdate&&this.parent.notify(ele,null))}if(t.actionUpdate){if(t.sheetIndex=n,this.parent.notify(fie,e={eventArgs:t,action:"hideShow"}),t.cancel)return;delete t.cancel}t.hide&&(t.hiddenIndexes=[]);function s(e){t.isCol?(i.hideCol(t),e&&i.parent.sheetModule.colWidthChanged({colIdx:t.startIndex,isHideShow:!0})):(i.hideRow(t),e&&i.parent.sheetModule.rowHeightChanged({rowIdx:t.startIndex,isHideShow:!0}))}var a,r=t.isCol?this.parent.frozenColCount(o):this.parent.frozenRowCount(o);r&&t.startIndex<r?(t.freezePane=!(n=void 0),t.endIndex>=r&&(n=t.endIndex,t.endIndex=r-1),s(!0),delete t.freezePane,void 0!==n&&(a=t.startIndex,t.endIndex=n,t.startIndex=r,s(!this.parent.scrollSettings.enableVirtualization),t.startIndex=a)):s(!this.parent.scrollSettings.enableVirtualization),t.actionUpdate&&(this.updateIndexOnlyForHiddenColumnsAndRows(t,o),this.parent.notify(Vae,e),sce(this.parent.element))},$ce.prototype.updateIndexOnlyForHiddenColumnsAndRows=function(e,t){for(var i=e.startIndex,n=e.endIndex,o=e.startIndex;o<=n;o++)if(!1===(e.isCol?Kde(t,o):_de(t,o)||{}).hidden){e.startIndex=o;break}for(var r=e.endIndex;i<=r;r--)if(!1===(e.isCol?Kde(t,r):_de(t,r)||{}).hidden){e.endIndex=r;break}},$ce.prototype.hideRow=function(e){var t,i,n,o,O=this,r=ee(e.sheetIndex)?this.parent.activeSheetIndex:e.sheetIndex,s=_re(this.parent,r),a=0,l=Object.assign({},e),h=this.parent.scrollSettings.isFinite&&!l.freezePane;if(h){if(l.startIndex>=s.rowCount)return;l.endIndex>=s.rowCount&&(l.endIndex=s.rowCount-1),o=0}var d=this.parent.frozenRowCount(s);if(l.hide){for(var p,c=void 0,u=void 0,N=[],g=[],m=h&&l.endIndex===Woe(s,s.rowCount-1,!1),f=l.startIndex;f<=l.endIndex;f++)if(zde(s,f))l.isFiltering&&!jde(s,f)&&Hde(s,f,{isFiltered:!0});else if(void 0===t&&(c=l.freezePane?(p=this.parent.sheetModule.getSelectAllTable(),this.parent.getColHeaderTable()):(p=this.parent.getRowHeaderTable(),this.parent.getContentTable()),t=this.parent.getViewportIndex(f),a=0),n={hidden:!0},l.isFiltering&&(n.isFiltered=!0),l.isFiltering||(N=uce(this.parent)),Hde(s,f,n),l.isFiltering||(g=uce(this.parent)),r===this.parent.activeSheetIndex)if(h&&(o+=Wde(s,f,!0,!0)),this.refreshChart(f,"rows"),l.isFiltering||this.refreshChartCellModel(N,g),u=c&&c.rows[t]){if(!i)for(var y=0;y<=s.usedRange.colIndex;y++)if(((L=Kre(f,y,s)||{}).colSpan||L.rowSpan)&&(l.startIndex>=this.parent.viewport.topIndex||this.parent.scrollSettings.enableVirtualization)){i=!0;break}if(!i&&(p.rows[t]&&G(p.rows[t]),G(u),a++,(u=c.rows[t])&&f===l.endIndex))for(var V,v,_=(v=Woe(s,f+1,!0))!==Woe(s,0,!0)&&v===(this.parent.viewport.topIndex>=l.startIndex?l.endIndex+1:this.parent.viewport.topIndex)?"Row":"",y=this.parent.viewport.leftIndex;y<=this.parent.viewport.rightIndex;y++)""!==(R=this.parent.getCellStyleValue(["borderTop"],[v,y]).borderTop)&&(V=u.cells[y],this.parent.notify(Mie,{onActionUpdate:!1,rowIdx:v,colIdx:y,style:{borderTop:R},row:u,pRow:u.previousElementSibling,first:_,td:V}))}else f<=this.parent.viewport.bottomIndex?a++:a--;if(!l.refreshUI)if(i&&(l.startIndex>=this.parent.viewport.topIndex||!this.parent.scrollSettings.enableVirtualization))l.isFiltering?e.refreshUI=!0:(this.parent.selectRange(s.selectedRange),s.frozenRows||s.frozenColumns?(this.parent.renderModule.refreshSheet(!1,!1,!0),e.refreshUI=!0):this.parent.renderModule.refreshUI({rowIndex:this.parent.viewport.topIndex,colIndex:this.parent.viewport.leftIndex,refresh:"Row"}));else if(a){this.parent.selectRange(s.selectedRange);var b=function(){var e;s.showHeaders&&(e=l.freezePane?1:0,t===e?p.rows[e]&&p.rows[e].classList.add("e-hide-end"):(p&&p.rows[t-1]&&p.rows[t-1].classList.add("e-hide-start"),p&&p.rows[t]&&p.rows[t].classList.add("e-hide-end")))};if(!l.freezePane&&this.parent.scrollSettings.enableVirtualization){l.startIndex,l.startIndex;if(l.startIndex<ste(s.paneTopLeftCell)[0]||a>this.parent.viewport.rowCount){if(l.isFiltering)return void(e.refreshUI=!0);this.parent.updateTopLeftCell(Woe(s,l.startIndex-1<d?d:l.startIndex-1,!0)-d,null,"col"),this.parent.renderModule.refreshSheet(!1,!1,!0)}else{var w=this.parent.viewport.bottomIndex+1,C=this.parent.skipHidden(w,w+a-1,"rows",!1);if(w=C[0],C=C[1],h){if(w>=s.rowCount)return void(this.parent.viewport.topIndex+d===Woe(s,d,!0)?(b(),this.parent.notify(nhe,{isHide:!0,height:o}),m&&(this.parent.viewport.bottomIndex=Woe(s,s.rowCount-1,!1))):this.parent.renderModule.refreshSheet(!1,!1,!0));if(C>=s.rowCount)return void this.parent.renderModule.refreshSheet(!1,!1,!0);this.parent.notify(nhe,{isHide:!0,height:o})}this.parent.viewport.bottomIndex=C;var m=void 0,S=this.parent.frozenColCount(s),A=[],m=S?(A.push(d),A.push(this.parent.viewport.leftIndex+S),ste(s.topLeftCell)[1]):this.parent.viewport.leftIndex;this.parent.renderModule.refreshUI({colIndex:m,rowIndex:w,direction:"",refresh:"RowPart",frozenIndexes:A},lte(w,m)+":"+lte(C,this.parent.viewport.rightIndex))}}b()}}else{for(var H,x=void 0,I=void 0,u=void 0,T=void 0,z=void 0,c=void 0,E=void 0,D=void 0,M=l.startIndex-1,k=[],P=l.freezePane,B="lastElementChild",j=0,S=this.parent.viewport.topIndex+d,N=(h&&(A=Woe(s,s.rowCount-1,!1),this.parent.viewport.bottomIndex===A)&&(S===Woe(s,d,!0)?P=!0:(w=rte(s.paneTopLeftCell)[0],s.rowCount-1-w+1-this.parent.hiddenCount(w,s.rowCount-1)<this.parent.viewport.rowCount+Math.round(this.parent.getThreshold("row")/2)&&(B="firstElementChild"))),uce(this.parent)),f=l.startIndex,W=l.endIndex;f<=W;f++)if(l.isFiltering?zde(s,f):zde(s,f)&&!jde(s,f)){if(void 0!==T)W=f;else if(n={hidden:!1},l.isFiltering&&(n.isFiltered=!1),!P&&f>this.parent.viewport.bottomIndex){if(Hde(s,f,n),void 0===D)return}else if(void 0===D&&(D=f),Hde(s,f,n),r===this.parent.activeSheetIndex){h&&(o+=Wde(s,f,!0,!0)),this.refreshChart(f,"rows"),void 0===t&&(x=document.createDocumentFragment(),I=document.createDocumentFragment(),z=this.parent.serviceLocator.getService("row"),l.freezePane?(E=this.parent.sheetModule.getSelectAllTable(),c=this.parent.getColHeaderTable()):(E=this.parent.getRowHeaderTable(),c=this.parent.getContentTable(),f<this.parent.viewport.topIndex+d&&(this.parent.viewport.topIndex=f-d)),t=this.parent.getViewportIndex(f)),M++,H=z.refresh(f,null,null,!0,!0),x.appendChild(H),E&&E.rows.length&&!P&&G(E.tBodies[0][""+B]),u=I.appendChild(z.refresh(f,u,H)),c&&c.rows.length&&!P&&(G(c.tBodies[0][""+B]),"firstElementChild"===B)&&(void 0!==t&&-1<t-1&&--t,j+=Wde(s,this.parent.viewport.topIndex,!0),this.parent.viewport.topIndex=Woe(s,this.parent.viewport.topIndex+1,!0));for(var F,L,y=this.parent.viewport.leftIndex;y<=this.parent.viewport.rightIndex;y++)void 0===(L=Kre(f,y,s)||{}).rowSpan&&void 0===L.colSpan||(this.parent.notify(Rne,F={range:[f,y,f,y],isAction:!1,merge:!0,type:"All",skipChecking:!0}),k.length&&F.range[1]===k[k.length-1].range[1]&&F.range[0]===k[k.length-1].range[0])||k.push(F)}}else{if(l.startIndex===l.endIndex)return;void 0===t?M++:T=f}g=uce(this.parent);if(this.refreshChartCellModel(N,g),void 0!==t){m=void 0;if(!l.freezePane){if(l.isFiltering&&l.startIndex<ste(s.paneTopLeftCell)[0]&&(e.refreshUI=!0,void 0===T||T===l.endIndex))return;C=this.parent.viewport.bottomIndex,b=(this.parent.viewport.bottomIndex=this.parent.viewport.topIndex+d+this.parent.viewport.rowCount+2*this.parent.getThreshold("row"),this.parent.hiddenCount(l.endIndex+1,this.parent.viewport.bottomIndex)),a=this.parent.hiddenCount(this.parent.viewport.topIndex+d,l.startIndex)+b;this.parent.viewport.bottomIndex+=a,h&&this.parent.viewport.bottomIndex>=s.rowCount&&(this.parent.viewport.bottomIndex=Woe(s,s.rowCount-1,!1)),!l.isFiltering&&S<=D&&D<=C&&D>this.parent.viewport.bottomIndex-b-Math.abs(M-D)&&(m=!0)}if(l.insertIdx=e.insertIdx=t,l.row=e.row=I.querySelector(".e-row"),l.mergeCollection=e.mergeCollection=k,s.showHeaders&&(e.hdrRow=l.hdrRow=x.querySelector(".e-row"),0!==t&&!zde(s,M-1)&&E.rows[t-1]&&E.rows[t-1].classList.remove("e-hide-start"),0!==l.startIndex&&zde(s,l.startIndex-1)&&l.hdrRow.classList.add("e-hide-end"),zde(s,M+1)?x.lastElementChild.classList.add("e-hide-start"):E.rows[t]&&E.rows[t].classList.remove("e-hide-end")),u&&c&&c.rows[t]){v=Woe(s,M+1,!0);for(var R,Q,f=this.parent.viewport.leftIndex;f<=this.parent.viewport.rightIndex;f++)""!==(R=this.parent.getCellStyleValue(["borderTop"],[v,f]).borderTop)&&(this.parent.notify(Mie,{onActionUpdate:!1,rowIdx:v,colIdx:f,style:{borderTop:R},pRow:u,td:c.rows[t].cells[f],first:""}),-1<(Q=Woe(s,D-1,!1))?!c.rows[t-1]||this.parent.getCellStyleValue(["borderBottom"],[Q,f]).borderBottom||this.parent.getCellStyleValue(["borderTop"],[D,f]).borderTop||(c.rows[t-1].cells[f].style.borderBottom=""):c.rows[t].cells[f].style.borderTop="")}l.skipAppend||(h&&this.parent.notify(nhe,{height:o,size:j}),m||Math.abs(M-D)>this.parent.viewport.rowCount+2*this.parent.getThreshold("row")?this.parent.renderModule.refreshSheet(!1,!1,!0):(E&&(E.tBodies[0].rows.length?E.tBodies[0].insertBefore(x,E.rows[t]):E.tBodies[0].appendChild(x)),c&&c.tBodies[0]&&(c.tBodies[0].rows.length?c.tBodies[0].insertBefore(I,c.rows[t]):c.tBodies[0].appendChild(I)),this.parent.selectRange(s.selectedRange),l.autoFit&&s.showHeaders&&this.parent.notify(hae,{startIndex:l.startIndex,endIndex:l.endIndex,isRow:!0}),k.forEach(function(e){O.parent.notify(Bne,e)}),void 0!==T&&T!==l.endIndex&&(l.startIndex=T,this.hideRow(l))))}}},$ce.prototype.hideCol=function(t){for(var e,i=this,n=ee(t.sheetIndex)?this.parent.activeSheetIndex:t.sheetIndex,o=_re(this.parent,n),r=[],s=[],a=ste(o.paneTopLeftCell),l=this.parent.frozenColCount(o),h=this.parent.frozenRowCount(o),d=this.parent.viewport.leftIndex+l,p=Woe(o,o.colCount-1,!1,"columns"),c=t.startIndex;c<=t.endIndex;c++){if(t.hide){if(epe(o,c))continue}else if(!epe(o,c)||t.hiddenIndexes&&-1===t.hiddenIndexes.indexOf(c))continue;var u=uce(this.parent),g=(Jde(o,c,{hidden:t.hide}),uce(this.parent));this.refreshChart(c,"columns"),this.refreshChartCellModel(u,g),this.parent.scrollSettings.enableVirtualization&&!t.freezePane&&(c<d||c>this.parent.viewport.rightIndex&&(!this.parent.scrollSettings.isFinite||!(p===this.parent.viewport.rightIndex&&p<=c&&c<o.colCount)))?c<d&&s.push(c):(r.push(c),t.hide&&(t.hiddenIndexes.push(c),c<=a[1])&&(e=!0))}if((s.length||r.length)&&n===this.parent.activeSheetIndex){var m,f,y=ste(o.topLeftCell),n=function(){var e=i.parent.scrollSettings.enableVirtualization?[h?y[0]:i.parent.viewport.topIndex,i.parent.viewport.bottomIndex]:[0,o.rowCount-1];return f=t.freezePane?(m=i.parent.getRowHeaderTable(),i.parent.sheetModule.getSelectAllTable()):(m=i.parent.getContentTable(),i.parent.getColHeaderTable()),e};if(t.hide){if(r.length){if((r.length<=this.parent.getThreshold("col")||!this.parent.scrollSettings.enableVirtualization||t.freezePane)&&this.removeCell(o,r,n(),m,f),!t.freezePane&&this.parent.scrollSettings.enableVirtualization){if(e)return this.parent.updateTopLeftCell(null,Woe(o,r[0]-1<l?l:r[0]-1,!0,"columns")-l,"row"),void this.parent.renderModule.refreshSheet(!1,!1,!0);var v=[],b=this.parent.viewport.topIndex,w=h?y[0]:b;if(h&&(v=[h+b,l]),this.parent.scrollSettings.isFinite){var C,S=Woe(o,o.colCount-1,!1,"columns"),A=this.parent.viewport.leftIndex+l,x=this.parent.viewport.rightIndex;if(S<=x+r.length)return l<=(C=Woe(o,A-(x+r.length-S),!1,"columns"))&&(this.parent.viewport.leftIndex=C,this.parent.viewport.leftIndex-=this.parent.hiddenCount(x,S)),this.parent.viewport.rightIndex=S,A!==this.parent.viewport.leftIndex+l||x!==this.parent.viewport.rightIndex?(this.parent.renderModule.refreshUI({colIndex:this.parent.viewport.leftIndex,refresh:"Column",frozenIndexes:v,rowIndex:w,skipUpdateOnFirst:this.parent.viewport.leftIndex+l===Woe(o,l,!0,"columns")}),h&&(this.parent.viewport.topIndex=b)):this.parent.notify(Ble,{refresh:"Column",isUpdate:!0}),void this.parent.selectRange(o.selectedRange)}r.length<=this.parent.getThreshold("col")?(C=this.parent.skipHidden(this.parent.viewport.rightIndex+1,this.parent.viewport.rightIndex+r.length,"columns"),this.parent.viewport.rightIndex=C[1],this.parent.renderModule.refreshUI({rowIndex:w,colIndex:C[0],direction:"",refresh:"ColumnPart",frozenIndexes:v},""+hte([w,C[0],this.parent.viewport.bottomIndex,C[1]]))):(this.parent.renderModule.refreshUI({skipUpdateOnFirst:this.parent.viewport.leftIndex+l===Woe(o,l,!0,"columns"),rowIndex:w,colIndex:this.parent.viewport.leftIndex,refresh:"Column",frozenIndexes:v}),h&&(this.parent.viewport.topIndex=b))}this.parent.selectRange(o.selectedRange)}}else s.length&&this.parent.scrollSettings.enableVirtualization?(s.sort(function(e,t){return e-t}),this.parent.updateTopLeftCell(null,Woe(o,s[0]-1<l?l:s[0]-1,!0,"columns")-l,"row"),this.parent.renderModule.refreshSheet(!1,!1,!0),t.autoFit&&(t.autoFit=!1)):(!this.parent.scrollSettings.isFinite||this.parent.viewport.rightIndex<p)&&(r.length<=this.parent.getThreshold("col")||!this.parent.scrollSettings.enableVirtualization||t.freezePane)?(this.appendCell(o,r,n(),m,f,t.freezePane),this.parent.scrollSettings.enableVirtualization&&!t.freezePane&&this.parent.notify(Tse,{refresh:"Column",prevRowColCnt:{rowCount:o.rowCount,colCount:o.colCount}}),this.parent.selectRange(o.selectedRange)):this.parent.renderModule.refreshSheet(!1,!1,!0)}},$ce.prototype.removeCell=function(i,n,e,t,o){var r,s,a,l,h,d=this,p=e[0],c=e[1],u=0,g=n.length-1,m=this.parent.frozenRowCount(i),f=t.getElementsByTagName("colgroup")[0],y=this.parent.getViewportIndex(n[0],!0)+1,v=Woe(i,m-1,!1);for(i.showHeaders&&(a=o.getElementsByTagName("colgroup")[0],r=o.rows[0]);p<=c;)zde(i,p)?p++:(s=m&&p<m?o.rows[u+1]:t.rows[u],n.forEach(function(e,t){0===u&&m<=p&&(i.showHeaders&&(G(a.children[y]),G(r.cells[y])),G(f.children[y])),G(s.cells[y]),0===t&&(void 0!==(l=Kre(p,e,i,!1,!0)).colSpan&&(void 0===l.rowSpan||1<l.colSpan)||l.rowSpan<0&&-1<p-1&&zde(i,p-1)&&Math.abs(l.rowSpan)===d.parent.hiddenCount(p+l.rowSpan,p,"rows",i))&&d.parent.notify(rle,{rowIdx:p,colIdx:e,model:"col",start:n[0],end:n[g]}),t===g&&(h=Woe(i,e+1,!0,"columns"),""!==(t=d.parent.getCellStyleValue(["borderLeft"],[u,h]).borderLeft)&&d.parent.notify(Mie,{onActionUpdate:!1,rowIdx:u,colIdx:h,style:{borderLeft:t},row:s,first:""}),void 0!==(l=Kre(p,e,i)||{}).colSpan&&(void 0===l.rowSpan||1<l.colSpan)||l.rowSpan<0&&-1<p-1&&zde(i,p-1)&&Math.abs(l.rowSpan)===d.parent.hiddenCount(p+l.rowSpan,p,"rows",i))&&d.parent.notify(rle,{rowIdx:p,colIdx:e,model:"col",start:n[0],end:n[g],isEnd:!0})}),m&&p===v?(u=0,p=this.parent.viewport.topIndex+m):(u++,p++));-1<y-1&&i.showHeaders&&r.cells[y-1]&&r.cells[y-1].classList.add("e-hide-start"),i.showHeaders&&r.cells[y]&&r.cells[y].classList.add("e-hide-end")},$ce.prototype.appendCell=function(i,n,e,t,o,r){for(var s,a,l,h,d,p,c=this,u=e[0],g=e[1],m=0,f=n.length-1,y=this.parent.frozenRowCount(i),v=t.getElementsByTagName("colgroup")[0],b=(i.showHeaders&&(l=o.getElementsByTagName("colgroup")[0],s=o.rows[0]),this.parent.serviceLocator.getService("cell")),w=(n.sort(function(e,t){return e-t}),[]),C=[],S=Woe(i,y-1,!1);u<=g;)zde(i,u)?u++:(a=y&&u<y?o.rows[m+1]:t.rows[m],n.forEach(function(e,t){0===m&&(C[t]=c.parent.getViewportIndex(e,!0),i.showHeaders&&(h=s.cells[C[t]])&&(0===t&&n[t]&&!epe(i,n[t]-1)&&h.previousSibling&&h.previousElementSibling.classList.remove("e-hide-start"),t===f)&&h.classList.remove("e-hide-end"),y<=u)&&(v.children[C[t]]?(v.insertBefore(c.parent.sheetModule.updateCol(i,e),v.children[C[t]]),i.showHeaders&&b.renderColHeader(e,s,h)):(v.appendChild(c.parent.sheetModule.updateCol(i,e)),i.showHeaders&&b.renderColHeader(e,s)),r||(G(v.lastChild),i.showHeaders&&G(s.lastChild)),i.showHeaders)&&t===f&&(G(l),o.insertBefore(v.cloneNode(!0),o.tHead)),r||G(a.lastChild),h=a.cells[C[t]],p={rowIdx:u,colIdx:e,cell:Kre(u,e,i),row:a,address:lte(u,e),lastCell:e===f,isHeightCheckNeeded:!0,first:e!==Woe(i,0,!0,"columns")&&e===c.parent.viewport.leftIndex?"Column":"",checkNextBorder:t===f?"Column":"",checkCF:!0},h&&(p.refChild=h),p=b.render(p),0===t&&p.previousSibling&&""!==c.parent.getCellStyleValue(["borderLeft"],[m,Woe(i,n[n.length-1]+1,!0,"columns")]).borderLeft&&-1<(d=Woe(i,n[0]-1,!1,"columns"))&&!c.parent.getCellStyleValue(["borderRight"],[m,d]).borderRight&&!c.parent.getCellStyleValue(["borderLeft"],[m,n[0]]).borderLeft&&(p.previousSibling.style.borderRight=""),(void 0!==(d=Kre(u,e,i)||{}).colSpan&&(void 0===d.rowSpan||1<d.colSpan)||d.rowSpan<0&&-1<u-1&&zde(i,u-1)&&Math.abs(d.rowSpan)===c.parent.hiddenCount(u+d.rowSpan,u,"rows",i))&&(t={range:[u,e,u,e],isAction:!1,merge:!0,type:"All",skipChecking:!0},c.parent.notify(Rne,t),w.length&&t.range[1]===w[w.length-1].range[1]&&t.range[0]===w[w.length-1].range[0]||w.push(t))}),y&&u===S?(u=this.parent.viewport.topIndex+y,m=0):(u++,m++));w.forEach(function(e){c.parent.notify(Bne,e)}),this.parent.viewport.rightIndex=Woe(i,this.parent.viewport.rightIndex-n.length,!1,"columns")},$ce.prototype.refreshChart=function(e,t){this.parent.notify(Gne,{rIdx:e,showHide:t})},$ce.prototype.refreshChartCellModel=function(e,t){this.parent.notify(kle,{prevChartIndexes:e,currentChartIndexes:t})},$ce.prototype.addEventListener=function(){this.parent.on(Nne,this.hideShow,this),this.parent.on(gse,this.destroy,this)},$ce.prototype.destroy=function(){this.removeEventListener(),this.parent=null},$ce.prototype.removeEventListener=function(){this.parent.off(Nne,this.hideShow),this.parent.off(gse,this.destroy)};var Zce=$ce;function $ce(e){this.parent=e,this.addEventListener()}tue.prototype.destroy=function(){this.removeEventListener(),this.parent=null},tue.prototype.addEventListener=function(){this.parent.on(cae,this.initiateHyperlinkHandler,this),this.parent.on(uae,this.editHyperlinkHandler,this),this.parent.on(gae,this.openHyperlinkHandler,this),this.parent.on(vse,this.hyperlinkClickHandler,this),this.parent.on(Aae,this.createHyperlinkEle,this),this.parent.on(bse,this.keyUpHandler,this),this.parent.on(toe,this.removeHyperlink,this),this.parent.on(Sae,this.removeHyperlinkHandler,this)},tue.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(cae,this.initiateHyperlinkHandler),this.parent.off(uae,this.editHyperlinkHandler),this.parent.off(gae,this.openHyperlinkHandler),this.parent.off(vse,this.hyperlinkClickHandler),this.parent.off(Aae,this.createHyperlinkEle),this.parent.off(bse,this.keyUpHandler),this.parent.off(toe,this.removeHyperlink),this.parent.off(Sae,this.removeHyperlinkHandler))},tue.prototype.getModuleName=function(){return"spreadsheetHyperlink"},tue.prototype.keyUpHandler=function(e){var t,i,n,e=e.target;z(e,".e-document")&&(t=document.querySelector(".e-hyp-text"),i=this.parent.element.querySelector(".e-hyperlink-alert-span"),n=(z(e,".e-hyperlink-dlg")||z(e,".e-edithyperlink-dlg")).getElementsByClassName("e-footer-content")[0].firstChild,t)&&!je(t.value)&&(Boe(t.value.toUpperCase())?i&&(i.remove(),n.removeAttribute("disabled")):(this.showDialog(),n.setAttribute("disabled","true"))),e.classList.contains("e-text")&&z(e,".e-cont")&&z(e,".e-webpage")&&z(e,".e-webpage").getElementsByClassName("e-cont")[1]===e.parentElement&&(n=(z(e,".e-hyperlink-dlg")||z(e,".e-edithyperlink-dlg")).getElementsByClassName("e-footer-content")[0].firstChild,""!==e.value?n.removeAttribute("disabled"):z(e,".e-link-dialog").querySelector(".e-webpage").querySelectorAll(".e-cont")[1].querySelector(".e-text").value||n.setAttribute("disabled","true"))},tue.prototype.initiateHyperlinkHandler=function(){var i,n,o=this,e=this.parent.getActiveSheet();!e.isProtected||e.protectSettings.insertLink&&!ace(this.parent)?are(this.parent)?this.parent.notify(ele,null):(e=this.parent.serviceLocator.getService(ope),this.parent.element.querySelector(".e-hyperlink-dlg")||(i=this.parent.serviceLocator.getService(rpe)).show({width:323,isModal:!0,showCloseIcon:!0,cssClass:"e-hyperlink-dlg",header:e.getConstant("InsertLink"),beforeOpen:function(e){var t={dialogName:"InsertLinkDialog",element:e.element,target:e.target,cancel:e.cancel};o.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(i.dialogInstance.content=o.hyperlinkContent(),n=i.dialogInstance.content.querySelector(".e-text").value,i.dialogInstance.dataBind(),sce(o.parent.element))},open:function(){setTimeout(function(){sce(i.dialogInstance.element.querySelectorAll(".e-webpage input")[1])})},beforeClose:this.dialogBeforeClose.bind(this),buttons:[{buttonModel:{content:e.getConstant("Insert"),isPrimary:!0,disabled:!0},click:function(){o.dlgClickHandler(n),i.hide()}}]})):this.parent.notify($ae,null)},tue.prototype.dialogBeforeClose=function(){var e=this.headerTabs;e&&e.element&&(e.destroy(),e.element.remove()),this.headerTabs=null,fce(this.inputElements),this.inputElements=[],fce(this.divElements),this.divElements=[]},tue.prototype.dlgClickHandler=function(e){var t,i=this.parent.getActiveSheet(),n=i.name+"!"+i.selectedRange,i=this.parent.element.querySelector(".e-link-dialog").getElementsByClassName("e-content")[0].querySelector(".e-item.e-active");if(i)if((t=i.getElementsByClassName("e-cont")[0].querySelector(".e-text").value)===e&&(t=null),i.querySelector(".e-webpage")){var o,r={address:o=i.getElementsByClassName("e-cont")[1].querySelector(".e-text").value};this.parent.insertHyperlink(r,n,t,!1)}else{o=i.getElementsByClassName("e-cont")[1].querySelector(".e-text").value;e=i.getElementsByClassName("e-cont")[2];if(e.getElementsByClassName("e-list-item")[0].querySelector(".e-active")){r={address:o=i.getElementsByClassName("e-cont")[2].querySelector(".e-active").textContent+"!"+o.toUpperCase()};this.parent.insertHyperlink(r,n,t,!1)}else if(e.querySelector(".e-active"))for(var s=i.getElementsByClassName("e-cont")[2].querySelector(".e-active").textContent,a=0;a<this.parent.definedNames.length;a++)this.parent.definedNames[a].name===s&&(r={address:this.parent.definedNames[a].name},this.parent.insertHyperlink(r,n,t,!1))}},tue.prototype.showDialog=function(){this.parent.element.querySelector(".e-hyperlink-alert-span")&&this.parent.element.querySelector(".e-hyperlink-alert-span").remove();var e=this.parent.serviceLocator.getService(ope),t=this.parent.createElement("span",{className:"e-hyperlink-alert-span"});t.innerText=e.getConstant("HyperlinkAlert"),(this.parent.element.querySelector(".e-hyperlink-dlg")||this.parent.element.querySelector(".e-edithyperlink-dlg")).querySelector(".e-dlg-content").appendChild(t)},tue.prototype.editHyperlinkHandler=function(){var i,n=this,e=this.parent.serviceLocator.getService(ope),o=this.parent.serviceLocator.getService(rpe);o.show({width:323,isModal:!0,showCloseIcon:!0,cssClass:"e-edithyperlink-dlg",header:e.getConstant("EditLink"),beforeOpen:function(e){var t={dialogName:"EditLinkDialog",element:e.element,target:e.target,cancel:e.cancel};n.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(o.dialogInstance.content=n.hyperEditContent(),i=o.dialogInstance.content.querySelector(".e-text").value,o.dialogInstance.dataBind(),sce(n.parent.element))},open:function(){setTimeout(function(){o.dialogInstance.element.querySelector(".e-webpage")?sce(o.dialogInstance.element.querySelectorAll(".e-webpage input")[1]):sce(o.dialogInstance.element.querySelectorAll(".e-document input")[1])})},buttons:[{buttonModel:{content:e.getConstant("Update"),isPrimary:!0},click:function(){n.dlgClickHandler(i),o.hide()}}]})},tue.prototype.openHyperlinkHandler=function(){var e=ste(this.parent.getActiveSheet().activeCell),e=this.parent.getCell(e[0],e[1]);e.getElementsByClassName("e-hyperlink")[0]&&(e=e.querySelector(".e-hyperlink")),this.hlOpenHandler(e)},tue.prototype.hlOpenHandler=function(e,t,i){var n=this;if(e.classList.contains("e-hyperlink")){e=z(e,".e-cell");if(e){var o=["",""],r=void 0,s=!0,a=this.parent.getActiveSheet(),l=parseInt(e.getAttribute("aria-colindex"),10)-1,h=parseInt(e.parentElement.getAttribute("aria-rowindex"),10)-1,d=Kre(h,l,a,!1,!0);d.style&&"#00e"===d.style.color&&(Yoe(this.parent,a,{rowIdx:h,colIdx:l,preventEvt:!0,cell:{style:{color:"#551a8b"}}}),e.style.color="#551a8b");var p=void 0,h={hyperlink:d.hyperlink,address:a.activeCell,target:"_blank",cancel:!1};if(this.parent.trigger(tne,h),h.cancel)i&&i.preventDefault();else{var c,e={hyperlink:l=h.hyperlink,address:a.activeCell},u=("string"==typeof l&&(p=l),p="object"==typeof l?l.address:p);if(-1===p.indexOf("http://")&&-1===p.indexOf("https://")&&-1===p.indexOf("ftp://")){if(!je(p)){if(this.parent.definedNames)for(var g=0;g<this.parent.definedNames.length;g++)if(this.parent.definedNames[g].name===p){p=(p=this.parent.definedNames[g].refersTo).slice(1);break}-1!==p.lastIndexOf("!")?(o[0]=p.substring(0,p.lastIndexOf("!")),o[0].startsWith("'")&&o[0].endsWith("'")&&(o[0]=o[0].slice(1,o[0].length-1)),o[1]=p.substring(p.lastIndexOf("!")+1)):(o[0]=this.parent.getActiveSheet().name,o[1]=p);for(var g=0;g<this.parent.sheets.length;g++)this.parent.sheets[g].name===o[0]&&(c=g);a=this.parent.sheets[c],-1!==o[1].indexOf(":")&&(d=o[1].indexOf(":"),i=o[1].substr(0,d),l=o[1].substr(d+1,o[1].length),i=i.replace("$",""),(l=l.replace("$","")).match(/\D/g)&&!l.match(/[0-9]/g)&&i.match(/\D/g)&&!i.match(/[0-9]/g)?(l+=a.rowCount,o[1]=(i+="1")+":"+l):!l.match(/\D/g)&&l.match(/[0-9]/g)&&!i.match(/\D/g)&&i.match(/[0-9]/g)&&(s=!(r=[parseInt(i,10)-1,0,parseInt(l,10)-1,a.colCount-1])));var m,f=void 0,y=this.parent.definedNames;if(!je(y))for(g=0;g<y.length;g++)if(y[g].name===u){f=!0;break}Boe(o[1])||f?(r=s?rte(o[1]):r,je(a)||(m=hte(r),a===this.parent.getActiveSheet()?cpe(function(){n.parent.goTo(m)}):(0<=m.indexOf(":")&&(m=(d=m.split(":"))[0]===d[1]?d[0]:m),cpe(function(){n.parent.goTo(n.parent.sheets[c].name+"!"+m)})))):this.showInvalidHyperlinkDialog()}}else t||(this.isValidUrl(p)?window.open(p,h.target):this.showInvalidHyperlinkDialog());this.parent.trigger(ine,e)}}}},tue.prototype.isValidUrl=function(e){return/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(e)},tue.prototype.showInvalidHyperlinkDialog=function(){var e=this.parent.serviceLocator.getService(rpe),t=this.parent.serviceLocator.getService(ope);e.show({width:323,isModal:!0,showCloseIcon:!0,header:t.getConstant("Hyperlink"),content:t.getConstant("InvalidHyperlinkAlert"),buttons:[{buttonModel:{content:t.getConstant("Ok"),isPrimary:!0},click:function(){e.hide()}}]},!1)},tue.prototype.hyperlinkClickHandler=function(e){var t,i,n,o,r,s,a,l=e.target;z(l,".e-link-dialog")&&z(l,".e-toolbar-item")&&(a=(s=z(l,".e-hyperlink-dlg")||z(l,".e-edithyperlink-dlg")).getElementsByClassName("e-footer-content")[0].firstChild,n=s.querySelector(".e-document"),o=((t=s.querySelector(".e-webpage"))||n).querySelectorAll(".e-cont")[0].querySelector(".e-text").value,i=n?n.querySelectorAll(".e-cont")[0].querySelector(".e-text").value:o,z(l,".e-toolbar-items").getElementsByClassName("e-toolbar-item")[1].classList.contains("e-active")?(r=n.querySelectorAll(".e-cont")[2].querySelector(".e-active"),n.querySelectorAll(".e-cont")[0].querySelector(".e-text").value=o,z(r,".e-list-item").classList.contains("e-level-2")&&a.hasAttribute("disabled")?a.removeAttribute("disabled"):z(r,".e-list-item").classList.contains("e-level-1")&&!a.hasAttribute("disabled")&&a.setAttribute("disabled","true")):(n=!t.querySelectorAll(".e-cont")[1].querySelector(".e-text").value,t.querySelectorAll(".e-cont")[0].querySelector(".e-text").value=i,n&&!a.hasAttribute("disabled")?a.setAttribute("disabled","true"):!n&&a.hasAttribute("disabled")&&a.removeAttribute("disabled"))),z(l,".e-list-item")&&l.classList.contains("e-fullrow")?(o=this.parent.element.getElementsByClassName("e-link-dialog")[0])&&(r=(o=o.getElementsByClassName("e-content")[0].getElementsByClassName("e-active")[0]).getElementsByClassName("e-cont")[1].getElementsByClassName("e-text")[0],a=(s=z(l,".e-hyperlink-dlg")||z(l,".e-edithyperlink-dlg")).getElementsByClassName("e-footer-content")[0].firstChild,z(l,".e-list-item").classList.contains("e-level-2")?"defName"===z(l,".e-list-item").getAttribute("data-uid")?(r.classList.contains("e-disabled")||r.hasAttribute("readonly")||(r.setAttribute("readonly","true"),r.classList.add("e-disabled"),r.setAttribute("disabled","true")),a.hasAttribute("disabled")&&a.removeAttribute("disabled")):"sheet"===z(l,".e-list-item").getAttribute("data-uid")&&(r.classList.contains("e-disabled")&&r.hasAttribute("readonly")&&(r.removeAttribute("readonly"),r.classList.remove("e-disabled"),r.removeAttribute("disabled")),Boe(r.value.toUpperCase()))&&a.hasAttribute("disabled")&&a.removeAttribute("disabled"):z(l,".e-list-item").classList.contains("e-level-1")&&a.setAttribute("disabled","true")):this.hlOpenHandler(l,!0,e)},tue.prototype.createHyperlinkEle=function(e){var t,i,n,o=e.cell;je(o.hyperlink)||(t=e.td,i=this.parent.createElement("a",{className:"e-hyperlink e-hyperlink-style"}),n=void 0,"string"==typeof o.hyperlink?(0===o.hyperlink.toLowerCase().indexOf("www.")&&(o.hyperlink="http://"+o.hyperlink),n=o.hyperlink):0===(n=o.hyperlink.address).toLowerCase().indexOf("www.")&&(o.hyperlink.address=n="http://"+n),0===n.indexOf("http://")||0===n.indexOf("https://")||0===n.indexOf("ftp://")?(i.setAttribute("href",n),i.setAttribute("target","_blank")):(n.includes("=")||n.includes("!"))&&i.setAttribute("ref",n),"Accounting"===Yhe(o.format)?i.innerHTML=t.innerHTML:i.innerText=""!==t.innerText?t.innerText:n,t.textContent="",t.innerText="","FillWithoutFormatting"!==this.parent.autoFillSettings.fillType&&"FillWithoutFormatting"!==e.fillType&&"Clear Formats"!==e.action||(i.style.textDecoration="none"),t.appendChild(i),e.style.color&&e.style.textDecoration)||(o={},e.style.color||(e.style.color=o.color="#00e"),e.style.textDecoration||(e.style.textDecoration=o.textDecoration="underline"),Yoe(this.parent,this.parent.getActiveSheet(),{rowIdx:e.rowIdx,colIdx:e.colIdx,preventEvt:!0,cell:{style:o}}))},tue.prototype.hyperEditContent=function(){for(var e,t=!0,i=this.hyperlinkContent(),n=rte(this.parent.getActiveSheet().activeCell),o=this.parent.sheets[this.parent.getActiveSheet().id-1].rows[n[0]].cells[n[1]],n=(this.parent.scrollSettings.enableVirtualization&&(n[0]=n[0]-this.parent.viewport.topIndex,n[1]=n[1]-this.parent.viewport.leftIndex),this.parent.getDisplayText(o)),o=o.hyperlink,r=("string"==typeof o?(e=o,n=n||e,-1===e.indexOf("http://")&&-1===e.indexOf("https://")&&-1===e.indexOf("ftp://")&&(t=!1)):"object"==typeof o&&(e=o.address,n=n||e,-1===e.indexOf("http://"))&&-1===e.indexOf("https://")&&-1===e.indexOf("ftp://")&&(t=!1),0),s=0,a=this.parent.definedNames,l=this.parent.sheets,h=0,d=a.length;h<d;h++)a[h].name===e&&r++;for(h=0,d=l.length;h<d;h++)e.includes(l[h].name)&&s++;0===r&&0===s&&(t=!0);var p=i.querySelector(".e-content");if(t){t=p.querySelector(".e-webpage");t.getElementsByClassName("e-cont")[0].getElementsByClassName("e-text")[0].setAttribute("value",n),"string"==typeof o?t.getElementsByClassName("e-cont")[1].querySelector(".e-text").setAttribute("value",o):t.getElementsByClassName("e-cont")[1].querySelector(".e-text").setAttribute("value",o.address)}else{var c=void 0,t=p.querySelector(".e-document"),u=(t.getElementsByClassName("e-cont")[0].getElementsByClassName("e-text")[0].setAttribute("value",n),void 0),o=void 0;if(this.parent.definedNames)for(h=0;h<this.parent.definedNames.length;h++)if(this.parent.definedNames[h].name===e){c=!0;break}if(c){p=t.getElementsByClassName("e-cont")[1].getElementsByClassName("e-text")[0];p.setAttribute("readonly","true"),p.classList.add("e-disabled"),p.setAttribute("disabled","true");for(var g=t.getElementsByClassName("e-cont")[2].querySelectorAll(".e-list-item.e-level-1")[1],h=0;h<g.getElementsByTagName("li").length;h++)g.getElementsByTagName("li")[h].innerText===e&&g.getElementsByTagName("li")[h].classList.add("e-active")}else{e&&-1!==e.lastIndexOf("!")&&(n=e.lastIndexOf("!"),u=e.substring(0,n),o=e.substring(n+1)),t.getElementsByClassName("e-cont")[1].querySelector(".e-text").setAttribute("value",o);for(g=t.getElementsByClassName("e-cont")[2].querySelectorAll(".e-list-item.e-level-1")[0],h=0;h<g.getElementsByTagName("li").length;h++)if(g.getElementsByTagName("li")[h].innerText===u){if(g.getElementsByTagName("li")[h].classList.contains("e-active"))break;g.getElementsByTagName("li")[h].classList.add("e-active")}else g.getElementsByTagName("li")[h].classList.contains("e-active")&&g.getElementsByTagName("li")[h].classList.remove("e-active")}}return i},tue.prototype.hyperlinkContent=function(){var e,t,i=this.parent.serviceLocator.getService(ope),n=0,o=0,r=!0,s=!0,a=rte(this.parent.getActiveSheet().activeCell),l=this.parent.getActiveSheet(),a=Kre(a[0],a[1],l),l=!0;if(a){var l=!!(a.value&&"string"==typeof a.value&&null!==a.value.match("[A-Za-z]+")||""===a.value||je(a.value)),h=a.hyperlink;if("string"==typeof h?-1===(v=h).indexOf("http://")&&-1===v.indexOf("https://")&&-1===v.indexOf("ftp://")&&(t=h,r=!1):"object"==typeof h&&-1===(v=h.address).indexOf("http://")&&-1===v.indexOf("https://")&&-1===v.indexOf("ftp://")&&(t=h.address,r=!1),t){for(var d=0,p=0,c=this.parent.definedNames,u=this.parent.sheets,g=0,m=u.length;g<m;g++)t.includes(u[g].name)&&p++;for(var f=0,m=c.length;f<m;f++)c[f].name===t&&d++;0===d&&0===p&&(r=!0)}if(o=r?0:1,this.parent.definedNames)for(var y=0;y<this.parent.definedNames.length;y++)if(this.parent.definedNames[y].name===t){s=!(e=!0);break}}for(var v=this.parent.createElement("div",{className:"e-link-dialog"}),h=this.parent.createElement("div",{className:"e-webpage"}),b=this.parent.createElement("div",{className:"e-document"}),o=(this.headerTabs=new k5({selectedItem:o,items:[{header:{text:i.getConstant("WebPage")},content:h},{header:{text:i.getConstant("ThisDocument")},content:b}]}),this.headerTabs.appendTo(v),v.querySelector(".e-toolbar-items").querySelector(".e-indicator")),o=(o.style.cssText=r?"left: 0; right: 136px":"left: 136px; right: 0",this.parent.createElement("div",{className:"e-cont"})),r=this.parent.createElement("div",{className:"e-cont"}),w=this.parent.createElement("div",{className:"e-header"}),C=(w.innerText=i.getConstant("DisplayText"),this.parent.createElement("div",{className:"e-header"})),S=(C.innerText=i.getConstant("Url"),this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"Text"}})),A=(this.inputElements.push(S),l||(S.classList.add("e-disabled"),S.setAttribute("readonly","true"),S.setAttribute("disabled","true")),a&&je(a.hyperlink)&&S.setAttribute("value",this.parent.getDisplayText(a)),this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"Text"}})),x=(this.inputElements.push(A),S.setAttribute("placeholder",i.getConstant("EnterTheTextToDisplay")),A.setAttribute("placeholder",i.getConstant("EnterTheUrl")),o.appendChild(S),o.insertBefore(w,S),r.appendChild(A),r.insertBefore(C,A),h.appendChild(r),h.insertBefore(o,r),[]),I=[],T=this.parent.sheets;n<this.parent.sheets.length;n++){var E=this.parent.sheets[n].name;"Visible"===this.parent.sheets[n].state&&(T[n]===this.parent.getActiveSheet()?x.push({nodeId:"sheet",nodeText:-1!==E.indexOf(" ")?"'"+E+"'":E,selected:!0}):x.push({nodeId:"sheet",nodeText:-1!==E.indexOf(" ")?"'"+E+"'":E}))}for(n=0;n<this.parent.definedNames.length;n++)I.push({nodeId:"defName",nodeText:this.parent.definedNames[n].name});var S=[{nodeId:"01",nodeText:i.getConstant("CellReference"),expanded:s,nodeChild:x},{nodeId:"02",nodeText:i.getConstant("DefinedNames"),expanded:e,nodeChild:I}],A=new PW({fields:{dataSource:S,id:"nodeId",text:"nodeText",child:"nodeChild"}}),S=this.parent.createElement("div",{className:"e-cont"}),D=this.parent.createElement("div",{className:"e-header"}),M=(D.innerText=i.getConstant("CellReference"),this.parent.createElement("input",{className:"e-input e-text e-hyp-text",attrs:{type:"Text"}})),M=(M.setAttribute("value","A1"),this.inputElements.push(M),S.appendChild(M),S.insertBefore(D,M),this.parent.createElement("div",{className:"e-cont"})),k=this.parent.createElement("div",{className:"e-header"}),P=(k.innerText=i.getConstant("DisplayText"),this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"Text"}})),l=(this.inputElements.push(P),l||(P.classList.add("e-disabled"),P.setAttribute("readonly","true"),P.setAttribute("disabled","true")),a&&je(a.hyperlink)&&P.setAttribute("value",this.parent.getDisplayText(a)),P.setAttribute("placeholder",i.getConstant("EnterTheTextToDisplay")),M.appendChild(P),M.insertBefore(k,P),this.parent.createElement("div",{className:"e-cont"})),a=this.parent.createElement("div",{className:"e-header"}),P=(a.innerText=i.getConstant("Sheet"),this.parent.createElement("div",{className:"e-refcont"}));return this.divElements.push(o),this.divElements.push(r),this.divElements.push(w),this.divElements.push(C),this.divElements.push(S),this.divElements.push(D),this.divElements.push(M),this.divElements.push(k),this.divElements.push(l),this.divElements.push(a),this.divElements.push(P),this.divElements.push(b),this.divElements.push(h),this.divElements.push(v),l.appendChild(P),l.insertBefore(a,P),b.appendChild(S),b.insertBefore(M,S),A.appendTo(P),b.appendChild(l),v},tue.prototype.removeHyperlink=function(e){var t=Kre(e.rowIdx,e.colIdx,e.sheet);t&&t.hyperlink&&("string"==typeof t.hyperlink?t.value=t.value||0===t.value?t.value:t.hyperlink:t.value=t.value||0===t.value?t.value:t.hyperlink.address,delete t.hyperlink,t.style&&(delete t.style.textDecoration,delete t.style.color),t.validation&&t.validation.isHighlighted&&t.style.backgroundColor&&(t.style.color="#ff0000"),e.sheet===this.parent.getActiveSheet())&&(t.style&&this.parent.notify(qne,null),e.preventRefresh||this.parent.serviceLocator.getService("cell").refresh(e.rowIdx,e.colIdx,!1,null,!0,!1,nre(this.parent)))},tue.prototype.removeHyperlinkHandler=function(e){var t,i=e.range,n=this.parent.getActiveSheet();if(!e.preventEventTrigger){var o={address:-1===i.indexOf("!")?n.name+"!"+i:i,cancel:!1};if(this.parent.notify(fie,{action:"removeHyperlink",eventArgs:o}),o.cancel)return}if(i&&-1!==i.indexOf("!")){for(var o=i.lastIndexOf("!"),r=i.substring(0,o),s=this.parent.sheets,a=0;a<s.length;a++)s[a].name===r&&(t=a);n=this.parent.sheets[t],i=i.substring(o+1)}for(var l,h,d=rte(i||n.activeCell),p=d[0];p<=d[2];p++)for(var c=d[1];c<=d[3];c++)if(n&&n.rows[p]&&n.rows[p].cells[c]){if(h=[],l=this.parent.getCell(p,c))for(var u=0;u<l.classList.length;u++)h.push(l.classList[u]);this.parent.notify(toe,{sheet:n,rowIdx:p,colIdx:c});for(u=0;u<h.length;u++)l.classList.contains(h[u])||l.classList.add(h[u])}e.preventEventTrigger||this.parent.notify(Vae,{action:"removeHyperlink",eventArgs:{address:-1===i.indexOf("!")?n.name+"!"+i:i}})};var eue=tue;function tue(e){this.divElements=[],this.inputElements=[],this.parent=e,this.addEventListener()}var iue=function(){return(iue=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},nue=(oue.prototype.setActionData=function(e){var t,i=this.parent.getActiveSheet(),n=[],o=[],r=e.args,s=r.eventArgs;switch(r.action){case"format":t=rte(r.eventArgs.range);break;case"clipboard":a=s.copiedInfo,t=rte(cte(s.pastedRange)),a&&a.isCut&&(o=this.getCellDetails(a.range,_re(this.parent,Fre(this.parent,a.sId)),"clipboard"));break;case"beforeSort":(t=rte(r.eventArgs.range))[0]===t[2]&&t[2]-t[0]==0&&(t[0]=0,t[1]=0,t[2]=i.usedRange.rowIndex,t[3]=i.usedRange.colIndex);break;case"beforeCellSave":case"cellDelete":case"cellSave":case"addNote":case"editNote":case"deleteNote":t=rte(s.address);break;case"beforeWrap":case"beforeReplace":case"chartDesign":t=this.parent.getAddressInfo(s.address).indices;break;case"beforeClear":case"beforeInsertImage":t=rte(s.range);break;case"deleteImage":t=rte(s.address);break;case"beforeInsertChart":case"filter":t=rte(s.range);break;case"autofill":t=rte(s.fillRange);break;case"validation":gce(s.range.substring(s.range.lastIndexOf("!")+1))?(t=rte(s.range))[2]=i.usedRange.rowIndex:t=rte(s.range);break;case"removeValidation":if(s.isColSelected){this.beforeActionData={cellDetails:[]};for(var a=s.range.substring(s.range.lastIndexOf("!")+1).split(":"),l=ate(a[0]),h=ate(a[1]);l<=h;l++)i.columns[l]&&i.columns[l].validation&&this.beforeActionData.cellDetails.push({colIndex:l,validation:i.columns[l].validation})}else t=rte(s.range);break;case"hyperlink":case"removeHyperlink":t=rte(s.address)}"beforeSort"===r.action?(this.beforeActionData={cellDetails:s.cellDetails},this.beforeActionData.sortedCellDetails=s.sortedCellDetails):t&&(n=r.isClearAction&&0<this.beforeActionData.cellDetails.length?this.beforeActionData.cellDetails:this.getCellDetails(t,i,r.action),this.beforeActionData={cellDetails:n,cutCellDetails:o})},oue.prototype.getBeforeActionData=function(e){e.beforeDetails=this.beforeActionData},oue.prototype.performUndoRedo=function(e){var t;if(e.isFromUpdateAction?g=e:(g=(e.isUndo?this.undoCollection:this.redoCollection).pop(),e.setCollection&&(e.undoArgs=g)),this.isUndo=e.isUndo,g){var i,n=void 0,o=g.action,r={},s=[];if("autofill"===g.action||"autofillWithCF"===g.action?s=g.eventArgs.fillRange.split("!"):"cellSave"===g.action||"cellDelete"===g.action?s=g.eventArgs.address.split("!"):"clipboard"===g.action&&(s=g.eventArgs.pastedRange.split("!")),0<s.length?i=_re(this.parent,Bre(this.parent,s[0])):"clear"===g.action&&(i=_re(this.parent,g.eventArgs.sheetIndex)),"autofillWithCF"===g.action&&(g.action="autofill","autofillWithCF"===(s=i.conditionalFormats)[s.length-1].action)&&e.isUndo&&(s[s.length-1].value?s.pop():this.parent.notify(Hne,{range:s[s.length-1].range,isAction:!0})),!e.isPublic){var s=g.eventArgs.beforeActionData;if(delete g.eventArgs.beforeActionData,Pe((n={action:g.action,eventArgs:{}}).eventArgs,g.eventArgs,null,!0),"Manual"===this.parent.calculationMode&&("clipboard"===g.action||"cellDelete"===g.action||"autofill"===g.action||"clear"===g.action))if(e.isUndo){if("paste"===g.eventArgs.requestType&&"clipboard"===g.action||g.eventArgs.fillType){var a=void 0;if(s.cutCellDetails.length?i.isSheetCalculated&&(a="Cut"):a=g.eventArgs.fillType?"autofill":"Copy",a)for(var l=0,h=s.cellDetails,d=s.cutCellDetails;l<h.length;l++){var p=(p=Kre(h[l].rowIndex,h[l].colIndex,i,!1,!0))?p.value:"";"Copy"===a?h[l].copyCellValue=p:"autofill"===a?h[l].value!==p&&h[l].autoFillText!==p&&(h[l].autoFillText=p):"Cut"===a&&d[l].value!==p&&(d[l].value=p)}}}else i.isSheetCalculated&&(s.cutCellDetails.length?s.cutCellDetails:s.cellDetails).forEach(function(e){var t=Kre(e.rowIndex,e.colIndex,i,!1,!0).value;!t&&0!==t||e.value===t||(e.value=t)});if(g.eventArgs.beforeActionData=s,n.eventArgs.cancel=!1,g.preventAction=n.preventAction=!0,e.isUndo?(n.isUndo=!0,"cellSave"===g.action&&"Manual"===this.parent.calculationMode&&i.isSheetCalculated&&1===s.cellDetails.length&&(s=Kre(s.cellDetails[0].rowIndex,s.cellDetails[0].colIndex,i))&&g.eventArgs.displayText!==s.value&&(g.eventArgs.displayText=s.value)):n.isRedo=!0,e.isFromUpdateAction||this.parent.notify(fie,n),n.eventArgs.cancel)return void this.updateUndoRedoIcons();delete n.eventArgs.cancel}switch(g.action){case"cellSave":case"format":case"wrap":case"cellDelete":case"autofill":case"removeValidation":case"hyperlink":case"addNote":case"editNote":case"deleteNote":case"removeHyperlink":(g=this.performOperation(g,e.preventEvt,e.preventReSelect,e.isFromAutoFillOption)).action=o;break;case"sorting":this.undoForSorting(g,e.isUndo);break;case"clipboard":g=this.undoForClipboard(g,e.isUndo,n),t=!0;break;case"resize":case"resizeToFit":var c,u,g=this.undoForResize(g);!e.isUndo||(c=g.eventArgs).isPrevCustomHeight||(u=(u=this.parent.sheets[c.sheetIndex])&&_de(u,c.index))&&u.customHeight&&delete u.customHeight;break;case"hideShow":Gpe(g,this.parent,!e.isUndo);break;case"replace":g=this.performOperation(g);break;case"replaceAll":g.eventArgs.isAction=!1,e.isUndo&&(r.value=g.eventArgs.replaceValue,r.replaceValue=g.eventArgs.value,r.skipFormatCheck=nre(this.parent)),this.parent.notify(vne,iue({},g.eventArgs,r));break;case"insert":case"filter":Gpe(g,this.parent,!e.isUndo,null,n),t="filter"===g.action;break;case"delete":Gpe(g,this.parent,!e.isUndo);break;case"validation":Gpe(g,this.parent,!e.isUndo),g=this.performOperation(g);break;case"addHighlight":case"removeHighlight":Gpe(g,this.parent,!e.isUndo);break;case"merge":g.eventArgs.merge=g.isFromUpdateAction?g.eventArgs.merge:!g.eventArgs.merge,Gpe(g,this.parent,!e.isUndo);break;case"clear":g=this.performOperation(g),e.isUndo&&g.eventArgs.cfClearActionArgs&&Gpe({action:"clearCF",eventArgs:g.eventArgs.cfClearActionArgs},this.parent,!e.isUndo);for(l=this.undoCollection.length;0<l&&this.undoCollection[l-1].isClearAction;l--)this.performUndoRedo(e);break;case"conditionalFormat":Gpe(g,this.parent,!e.isUndo,this.undoCollection);break;case"clearCF":Gpe(g,this.parent,!e.isUndo);break;case"insertImage":case"deleteImage":case"imageRefresh":Gpe(g,this.parent,!e.isUndo);break;case"insertChart":case"deleteChart":case"chartRefresh":Gpe(g,this.parent,!e.isUndo);break;case"chartDesign":g.eventArgs.isUndo=e.isUndo,this.parent.notify(zle,g.eventArgs);break;case"addDefinedName":Gpe(g,this.parent,!e.isUndo)}e.isFromUpdateAction||((e.isUndo?this.redoCollection:this.undoCollection).push(g),this.undoCollection.length>this.undoRedoStep&&this.undoCollection.splice(0,1),this.redoCollection.length>this.undoRedoStep&&this.redoCollection.splice(0,1),this.updateUndoRedoIcons(),e.isPublic)||t||this.parent.notify(Vae,Pe({isUndoRedo:!0,isUndo:e.isUndo},g)),this.parent.notify(qne,null)}},oue.prototype.undoForSorting=function(e,t){function i(e,t){var i;o===n.parent.activeSheetIndex&&(i=(i=n.parent.getCell(r[0]-1,n.parent.sortCollection[e].columnIndex))&&ge(".e-filter-icon",i))&&(e="e-sort"+("Ascending"===n.parent.sortCollection[e].order?"asc":"desc")+"-filter",t?i.classList.add(e):i.classList.remove(e))}var n=this,o=mte(this.parent,e.eventArgs.range),r=rte(e.eventArgs.range);if(t){if(this.parent.notify(Jie,{result:e.eventArgs.beforeActionData.cellDetails,range:r,sheet:_re(this.parent,o),jsonData:e.eventArgs.beforeActionData.sortedCellDetails,isUndo:!0}),this.parent.notify(Zie,{range:e.eventArgs.range}),this.parent.sortCollection&&e.eventArgs.previousSort)for(var s=this.parent.sortCollection.length-1;0<=s;s--)if(this.parent.sortCollection[s].sheetIndex===o){i(s,!1),this.parent.sortCollection.splice(s,1);var a=e.eventArgs.previousSort;if(Array.isArray(a))for(var l=0;l<a.length;l++)this.parent.sortCollection.splice(l,0,a[l]),i(l,!0);this.parent.sortCollection.length||(this.parent.sortCollection=void 0);break}}else if(Gpe(e,this.parent,!0),e.eventArgs.previousSort){var h=0;if(this.parent.sortCollection)for(s=this.parent.sortCollection.length-1;0<=s;s--)this.parent.sortCollection[s].sheetIndex===o&&(i(s,!1),h=s,this.parent.sortCollection.splice(s,1));else this.parent.sortCollection=[];this.parent.sortCollection.splice(h,0,{sortRange:e.eventArgs.range.substring(e.eventArgs.range.lastIndexOf("!")+1),sheetIndex:o,columnIndex:ate(e.eventArgs.sortOptions.sortDescriptors.field),order:e.eventArgs.sortOptions.sortDescriptors.order}),i(h,!0)}},oue.prototype.updateUndoRedoCollection=function(e){var t,i=["clipboard","format","sorting","cellSave","resize","resizeToFit","wrap","hideShow","replace","validation","merge","clear","conditionalFormat","clearCF","insertImage","imageRefresh","insertChart","deleteChart","chartRefresh","filter","cellDelete","autofill","autofillWithCF","addDefinedName","removeValidation","removeHighlight","addHighlight","hyperlink","removeHyperlink","deleteImage","chartDesign","replaceAll","addNote","editNote","deleteNote"],n=("insert"!==e.args.action&&"delete"!==e.args.action||"Sheet"===e.args.eventArgs.modelType||i.push(e.args.action),e.args.action);-1===i.indexOf(n)&&!e.isPublic||(i=e.args.eventArgs,"clipboard"!==n&&"sorting"!==n&&"format"!==n&&"cellSave"!==n&&"wrap"!==n&&"replace"!==n&&"validation"!==n&&"clear"!==n&&"conditionalFormat"!==n&&"clearCF"!==n&&"insertImage"!==n&&"imageRefresh"!==n&&"insertChart"!==n&&"chartRefresh"!==n&&"filter"!==n&&"cellDelete"!==n&&"autofill"!==n&&"autofillWithCF"!==n&&"removeValidation"!==n&&"addDefinedName"!==n&&"hyperlink"!==n&&"removeHyperlink"!==n&&"deleteImage"!==n&&"chartDesign"!==n&&"addNote"!==n&&"editNote"!==n&&"deleteNote"!==n||(this.parent.notify(Mae,t={beforeDetails:{cellDetails:[]}}),i.beforeActionData=t.beforeDetails),"clipboard"===n&&i.copiedInfo&&i.copiedInfo.isExternal&&(t=this.parent.getAddressInfo(i.pastedRange),i.copiedInfo.cellDetails=this.getCellDetails(t.indices,_re(this.parent,t.sheetIndex),n)),0<this.redoCollection.length&&"autofillWithCF"===this.redoCollection[this.redoCollection.length-1].action&&"autofill"===e.args.action&&(e.args.action="autofillWithCF"),this.undoCollection.push(e.args),this.redoCollection=[],this.undoCollection.length>this.undoRedoStep&&this.undoCollection.splice(0,1),this.updateUndoRedoIcons())},oue.prototype.clearUndoRedoCollection=function(){this.undoCollection=[],this.redoCollection=[],this.updateUndoRedoIcons()},oue.prototype.updateUndoRedoIcons=function(){var e=this.parent.serviceLocator.getService(ope);this.parent.notify(Lse,[{tab:e.getConstant("Home"),items:[this.parent.element.id+"_undo"],enable:0<this.undoCollection.length}]),this.parent.notify(Lse,[{tab:e.getConstant("Home"),items:[this.parent.element.id+"_redo"],enable:0<this.redoCollection.length}])},oue.prototype.updateUndoRedoSheetReferences=function(i){function e(e){e.forEach(function(e){var t=e.eventArgs;t&&["address","dataRange","fillRange"].forEach(function(e){t[e]&&t[e].includes(i.pName)&&(t[e]=t[e].replace(i.pName,i.value))})})}e(this.undoCollection),e(this.redoCollection)},oue.prototype.undoForClipboard=function(e,t,i){var n,o,r,s=this,a=e.eventArgs,l=[],h=(l[0]=a.pastedRange.substring(0,a.pastedRange.lastIndexOf("!")),l[1]=a.pastedRange.substring(a.pastedRange.lastIndexOf("!")+1),rte(l[1])),d=Bre(this.parent,l[0]),p=_re(this.parent,d),c=a.copiedInfo,u=a.beforeActionData,g=e.isFromUpdateAction,m=d===this.parent.activeSheetIndex;return i&&(i.isUndoRedo=!0,i.eventArgs.beforeActionData=u),"imagePaste"===e.eventArgs.requestType?(n=a.copiedShapeInfo,t?(o=n.pictureElem,n.isCut?(this.parent.notify(Ele,{id:o.id,sheetIdx:a.pasteSheetIndex+1,isUndoRedo:!0}),this.parent.notify(Tle,{options:{src:o.style.backgroundImage.replace(/url\((['"])?(.*?)\1\)/gi,"$2"),height:n.height,width:n.width,id:o.id},range:n.copiedRange,isPublic:!1,isUndoRedo:!0})):this.parent.notify(Ele,{id:a.pastedPictureElement.id,sheetIdx:a.pasteSheetIndex+1,isUndoRedo:!0})):n.isCut?(o=n.pictureElem,this.parent.notify(Ele,{id:o.id,sheetIdx:n.sId,isUndoRedo:!0}),this.parent.notify(Tle,{options:{src:o.style.backgroundImage.replace(/url\((['"])?(.*?)\1\)/gi,"$2"),height:n.height,width:n.width,id:o.id},range:n.pastedRange,isPublic:!1,isUndoRedo:!0})):(o=a.pastedPictureElement,this.parent.notify(Tle,{options:{src:o.style.backgroundImage.replace(/url\((['"])?(.*?)\1\)/gi,"$2"),height:o.offsetHeight,width:o.offsetWidth,id:o.id},range:n.pastedRange,isPublic:!1,isUndoRedo:!0}))):(t?(c.isCut&&(o=u.cutCellDetails,this.updateCellDetails(o,_re(this.parent,Fre(this.parent,c.sId)),fte(c.range),m,e),a.cfClearActionArgs)&&Gpe({action:"clearCF",eventArgs:a.cfClearActionArgs},this.parent,!1),u&&this.updateCellDetails(u.cellDetails,p,h,m,e,null,null,i?i.isUndoRedo:null),a.cfActionArgs&&a.cfActionArgs.cfModel.forEach(function(e){Gpe({eventArgs:{range:e.range,type:e.type,cFColor:e.cFColor,value:e.value,sheetIdx:a.cfActionArgs.sheetIdx,cancel:!0},action:"conditionalFormat"},s.parent,!1)}),oce(p,h[0],h[1],Wde(p,h[0])),n=rce(p,h[0]),Xpe(this.parent,p,n,h[0]),a.mergeCollection.forEach(function(e){e.merge=!e.merge,s.parent.notify(Bne,e),e.merge=!e.merge}),i&&!g&&this.parent.notify(Vae,i)):c.isExternal?(r=this.parent.getAddressInfo(a.pastedRange),this.updateCellDetails(c.cellDetails,_re(this.parent,r.sheetIndex),r.indices,!0,e,null,null,i?i.isUndoRedo:null),i&&!g&&this.parent.notify(Vae,i)):(o=new Promise(function(e){e(void 0)}),r=this.parent.getAddressInfo(a.copiedRange),this.parent.notify(a.copiedInfo.isCut?Vse:_se,{range:r.indices,sId:_re(this.parent,r.sheetIndex).id,promise:o,invokeCopy:!0,isPublic:!0,isFromUpdateAction:g}),o.then(function(){s.parent.notify(Hse,{range:l&&pte(a.pastedRange),sIdx:l&&Bre(s.parent,Lre(a.pastedRange)),type:a.type,isAction:!1,isInternal:!0,isFromUpdateAction:g,beforeActionData:a.beforeActionData,isUndo:t}),i&&!g&&s.parent.notify(Vae,i)})),m&&!g?(this.parent.notify(Ose,{address:a.selectedRange}),this.parent.notify(Jle,{})):this.checkRefreshNeeded(d,g)),e},oue.prototype.undoForResize=function(e){var t,i=e.eventArgs,n=(void 0===i.hide?i.isCol?(n=i.oldWidth,i.oldWidth=i.width,i.width=n):(n=i.oldHeight,i.oldHeight=i.height,i.height=n):i.hide=!i.hide,Gpe(e,this.parent,!1),this.parent.getActiveSheet()),i=rte(n.activeCell),n=Kre(i[0],i[1],n);return n&&n.rowSpan?(t=this.parent.getCell(i[0],i[1]),this.parent.element.querySelector(".e-active-cell").style.height=t.offsetHeight+"px"):n&&n.colSpan&&(t=this.parent.getCell(i[0],i[1]),this.parent.element.querySelector(".e-active-cell").style.width=t.offsetWidth+"px"),e},oue.prototype.performOperation=function(e,t,i,n){var o,r=e.eventArgs,s=[],a="cellSave"===e.action||"wrap"===e.action||"replace"===e.action||"cellDelete"===e.action||"hyperlink"===e.action||"addNote"===e.action||"editNote"===e.action||"deleteNote"===e.action||"removeHyperlink"===e.action?r.address:r.range,a=("autofill"===e.action?(s[0]=r.fillRange.substring(0,r.fillRange.lastIndexOf("!")),s[1]=r.fillRange.substring(r.fillRange.lastIndexOf("!")+1)):(s[0]=a.substring(0,a.lastIndexOf("!")),s[1]=a.substring(a.lastIndexOf("!")+1)),Bre(this.parent,s[0])),l=_re(this.parent,a),h=o=r.isColSelected?[0,ate((d=s[1].split(":"))[0]),l.rowCount-1,ate(d[1])]:fte(rte(s[1])),d=r.beforeActionData,p=e.isFromUpdateAction,a=this.checkRefreshNeeded(a,p),c={cellIdx:[o[0],o[1]],isUnique:!1,uniqueRange:""};if(r.isColSelected||this.parent.notify(Uie,c),this.isUndo){if(c.isUnique&&r.formula&&-1<r.formula.indexOf("UNIQUE"))if("#SPILL!"!==Kre((m=rte(c.uniqueRange))[0],m[1],this.parent.getActiveSheet()).value)for(var u=m[0];u<=m[2];u++)for(var g=m[1];g<=m[3];g++)u===m[0]&&g===m[1]&&(g+=1),this.parent.updateCellInfo({value:""},hte([u,g]),!0);if(this.updateCellDetails(d.cellDetails,l,o,a,e,t,r.isColSelected,!0,n),c.isUnique&&"cellDelete"===e.action&&r.isSpill){for(var m,f=Kre((m=rte(c.uniqueRange))[0],m[1],this.parent.getActiveSheet()),y=m[0];y<=m[2];y++)for(u=m[1];u<=m[3];u++)for(g=o[0];g<=o[2];g++)for(var v=o[1];v<=o[3];v++)y===g&&u===v||this.parent.updateCellInfo({value:""},lte(y,u),!0);f.value="#SPILL!",this.parent.updateCellInfo(f,lte(m[0],m[1]),!0)}if(!r.isSpill&&""!==c.uniqueRange){for(var b=rte(c.uniqueRange),u=b[0];u<=b[2];u++)for(g=b[1];g<=b[3];g++)u===b[0]&&g===b[1]&&(g+=1),this.parent.updateCellInfo({value:""},hte([u,g]),!0);this.parent.notify(qie,null)}}else{var d=e.eventArgs,t=rte(l.activeCell),n=s[1]?s[1].split(":"):[],w=(h[0]!==t[0]&&h[1]!==t[1]&&"hyperlink"===e.action&&0<n.length&&(l.activeCell=n[0],t=rte(l.activeCell)),this.parent.getCellStyleValue(["textDecoration"],t).textDecoration);if(d&&d.style&&d.style.textDecoration){var C=d.style.textDecoration,n=C,S=void 0,A=!1;"underline"===w?n="underline"===C?"none":"underline line-through":"line-through"===w?n="line-through"===C?"none":"underline line-through":"underline line-through"===w&&(n="underline"===C?"line-through":"underline",A=!0),"none"===n&&(A=!0),d.style.textDecoration=n,e.eventArgs=d;for(y=h[0];y<=h[2];y++)for(u=h[1];u<=h[3];u++){if(S={},"none"===(w=this.parent.getCellStyleValue(["textDecoration"],[y,u]).textDecoration)){if(A)continue;S.textDecoration=C}else if("underline"===w||"line-through"===w)if(A){if(C!==w)continue;S.textDecoration="none"}else S.textDecoration=C!==w?"underline line-through":C;else if("underline line-through"===w){if(!A)continue;S.textDecoration="underline"===C?"line-through":"underline"}this.parent.notify(Tie,{style:{textDecoration:S.textDecoration},range:[y,u,y,u],refreshRibbon:!0,onActionUpdate:!0})}d.style.textDecoration=C,e.eventArgs=d}else{if(!je(r.oldValue)&&r.oldValue!==r.value&&c.isUnique){var x=rte(c.uniqueRange);if("#SPILL!"!==Kre(x[0],x[1],this.parent.getActiveSheet()).value)for(u=x[0];u<=x[2];u++)for(g=x[1];g<=x[3];g++)u===x[0]&&g===x[1]&&(this.parent.updateCellInfo({value:"#SPILL!"},hte([x[0],x[1]]),!0),g+=1),this.parent.updateCellInfo({value:""},hte([u,g]),!0)}if(Gpe(e,this.parent,!0),c.isUnique&&"cellDelete"===e.action&&r.isSpill){for(var I=rte(c.uniqueRange),T=!1,y=I[0];y<=I[1];y++)for(u=I[1];u<=I[3];u++)y===I[0]&&u===I[1]&&u++,Kre(y,u,l)&&!je(Kre(y,u,l).value)&&""!==Kre(y,u,l).value&&(T=!0);T||((f=Kre(I[0],I[1],this.parent.getActiveSheet())).value="",this.parent.updateCellInfo(f,lte(I[0],I[1]),!0),this.parent.notify(qie,null))}}}return"autofill"===e.action&&(s[1]=this.isUndo?e.eventArgs.dataRange:e.eventArgs.selectedRange),!a||i||p||(r.isColSelected&&(s[1]=l.selectedRange),this.parent.notify(Ose,{address:s[1]})),this.parent.showAggregate&&this.parent.notify(hle,{}),e},oue.prototype.getCellDetails=function(e,i,t){function n(e,t){var t={rowIndex:e,colIndex:t,value:o?o.value:"",formula:o?o.formula:""},e=Wde(i,e);o&&(o.format&&(t.format=o.format),je(o.isLocked)||(t.isLocked=o.isLocked),o.style&&(t.style=Object.assign({},o.style)),o.wrap&&(t.wrap=o.wrap),o.rowSpan&&(t.rowSpan=o.rowSpan),o.colSpan&&(t.colSpan=o.colSpan),o.image&&(t.image=o.image),o.chart&&(t.chart=JSON.parse(JSON.stringify(o.chart))),o.validation&&(t.validation=Object.assign({},o.validation)),o.notes&&(t.notes=o.notes),o.isReadOnly&&(t.isReadOnly=o.isReadOnly),o.formattedText&&(t.formattedText=o.formattedText),o.hyperlink&&(t.hyperlink=S(o.hyperlink)?Pe({},o.hyperlink):o.hyperlink),(i.standardHeight?e!==i.standardHeight:20!==e)&&(o.rowHeight=t.rowHeight=e),e=r.parent.editModule,t.value=o&&e&&o.formula===e.editCellData.value&&!je(e.editCellData.prevFormulaValue)?e.editCellData.prevFormulaValue:t.value),s.push(t)}var o,r=this,s=[],a="cellDelete"===t,l={};e=fte(e);if("validation"===t||"removeValidation"===t)for(var h=e[1];h<=e[3];h++)for(var d=Kde(i,h),p=e[0];p<=e[2];p++)!l[h]&&tpe(d,p,h)&&(s.push({colIndex:h,validation:Object.assign({},d.validation)}),l[h]=!0),(o=Kre(p,h,i))&&!o.validation||n(p,h);else for(var c=e[0];c<=e[2];c++)if(!a||!jde(i,c))for(var u=e[1];u<=e[3];u++)o=Kre(c,u,i),n(c,u);return s},oue.prototype.updateCellDetails=function(i,n,e,t,o,r,s,a,l){for(var h,d,p,c,u,g,m=this,f=i.length,y=o&&!r&&("cellSave"===o.action||"cellDelete"===o.action||"autofill"===o.action||"clipboard"===o.action),v=o&&!o.eventArgs.cfClearActionArgs&&n.conditionalFormats&&n.conditionalFormats.length&&[].slice.call(n.conditionalFormats),b=[],w=("cellDelete"===o.action&&(u=!1,g=e),this),C=0;C<f;C++)!function(t){if(s||ee(i[t].rowIndex))return Jde(n,i[t].colIndex,{validation:i[t].validation});(h=Kre(i[t].rowIndex,i[t].colIndex,n,!1,!0)).style&&o&&("format"===o.action||"clipboard"===o.action)&&(!h.style.borderTop||i[t].style&&i[t].style.borderTop||w.parent.setBorder({borderTop:""},n.name+"!"+lte(i[t].rowIndex,i[t].colIndex),null,a),!h.style.borderLeft||i[t].style&&i[t].style.borderLeft||w.parent.setBorder({borderLeft:""},n.name+"!"+lte(i[t].rowIndex,i[t].colIndex),null,a),!h.style.borderRight||i[t].style&&i[t].style.borderRight||w.parent.setBorder({borderRight:""},n.name+"!"+lte(i[t].rowIndex,i[t].colIndex),null,a),!h.style.fontSize||i[t].style&&i[t].style.fontSize||(h.style.fontSize="11pt",d=!0,w.parent.notify(Mie,{style:{fontSize:"11pt"},rowIdx:i[t].rowIndex,colIdx:i[t].colIndex,lastCell:!0,isHeightCheckNeeded:!0,manualUpdate:!0,onActionUpdate:!0})),!h.style.fontFamily||i[t].style&&i[t].style.fontFamily||(d=!0,h.style.fontFamily="Calibri",w.parent.notify(Mie,{style:{fontFamily:"Calibri"},rowIdx:i[t].rowIndex,colIdx:i[t].colIndex,lastCell:!0,isHeightCheckNeeded:!0,manualUpdate:!0,onActionUpdate:!0}))),h.image&&o&&"clipboard"===o.action&&h.image.forEach(function(e){m.parent.notify(Ele,{id:e.id,sheet:n,preventEventTrigger:!0,rowIdx:i[t].rowIndex,colIdx:i[t].colIndex})});var e={value:i[t].formula&&i[t].formula.toUpperCase().includes("UNIQUE")?null:i[t].value,formula:i[t].formula};i[t].format&&(e.format=i[t].format),je(i[t].isLocked)||(e.isLocked=h.isLocked||i[t].isLocked),i[t].style&&(e.style=Object.assign({},i[t].style)),i[t].wrap&&(e.wrap=i[t].wrap),i[t].rowSpan&&(e.rowSpan=i[t].rowSpan),i[t].colSpan&&(e.colSpan=i[t].colSpan),i[t].hyperlink&&(e.hyperlink=i[t].hyperlink),i[t].image&&(e.image=i[t].image),i[t].notes&&(e.notes=i[t].notes),i[t].isReadOnly&&(e.isReadOnly=i[t].isReadOnly),i[t].formattedText&&(e.formattedText=i[t].formattedText),Jre(i[t].rowIndex,i[t].colIndex,n,e),c={action:"updateCellValue",address:[i[t].rowIndex,i[t].colIndex,i[t].rowIndex,i[t].colIndex],notes:i[t].notes,value:i[t].formula||i[t].value,sheetIndex:Bre(w.parent,n.name),skipFormatCheck:nre(w.parent),isDelete:u,deletedRange:g,actionName:o.action},w.parent.notify(Bie,c),v&&!p&&(p=c.isFormulaDependent),o&&"format"===o.action&&"NumberFormat"===o.eventArgs.requestType&&e.wrap&&e.format!==h.format&&!_de(n,i[t].rowIndex).customHeight?w.parent.notify(sne,{range:[i[t].rowIndex,i[t].colIndex,i[t].rowIndex,i[t].colIndex],wrap:!0,sheet:n,initial:!0,isOtherAction:!0}):(o&&"wrap"===o.action&&o.eventArgs.wrap||h.wrap&&!i[t].wrap)&&w.parent.notify(sne,{range:[i[t].rowIndex,i[t].colIndex,i[t].rowIndex,i[t].colIndex],wrap:!1,sheet:n,initial:!0}),o&&i[t].hyperlink&&"clear"===o.action&&(e=n.name+"!"+hte([i[t].rowIndex,i[t].colIndex,i[t].rowIndex,i[t].colIndex]),c=w.parent.getCell(i[t].rowIndex,i[t].colIndex),"Clear All"===o.eventArgs.type||"Clear Hyperlinks"===o.eventArgs.type?w.parent.addHyperlink(i[t].hyperlink,e,i[t].value):"Clear Formats"===o.eventArgs.type&&c&&U(c.querySelectorAll(".e-hyperlink"),"e-hyperlink-style")),i[t].validation&&w.parent.notify(une,{rules:i[t].validation,range:n.name+"!"+lte(i[t].rowIndex,i[t].colIndex)}),y&&i[t].value!==h.value&&w.parent.trigger("cellSave",{element:null,value:i[t].value,oldValue:h.value,formula:i[t].formula,cancel:!1,address:n.name+"!"+lte(i[t].rowIndex,i[t].colIndex),displayText:w.parent.getDisplayText(i[t])}),v&&!p&&Zoe(v,b,i[t].rowIndex,i[t].colIndex)}(C);t&&(e[0]===e[2]&&e[1]===e[3]&&(1<(r=Kre(e[0],e[1],n)).rowSpan&&(e[2]=e[0]+r.rowSpan-1),1<r.colSpan)&&(e[3]=e[1]+r.colSpan-1),t=!1,"autofill"===o.action||"clipboard"===o.action||"wrap"===o.action?t=!0:"format"===o.action&&"CellFormat"===o.eventArgs.requestType&&(t=Qoe(o.eventArgs.style,!0)),this.parent.serviceLocator.getService("cell").refreshRange(e,!1,!1,!0,!1,nre(this.parent),null,l,t,null,null,i),(b.length||p)&&this.parent.notify(_ne,{cfModel:!p&&b,refreshAll:p,isAction:!0}),d)&&cpe(function(){m.parent.selectRange(n.selectedRange)})},oue.prototype.checkRefreshNeeded=function(e,t){var i=!0;return e!==this.parent.activeSheetIndex&&(t||(this.parent.activeSheetIndex=e,this.parent.dataBind()),i=!1),i},oue.prototype.addEventListener=function(){this.parent.on(Tae,this.performUndoRedo,this),this.parent.on(Eae,this.updateUndoRedoCollection,this),this.parent.on(Dae,this.setActionData,this),this.parent.on(Mae,this.getBeforeActionData,this),this.parent.on(kae,this.clearUndoRedoCollection,this),this.parent.on(ile,this.updateUndoRedoIcons,this),this.parent.on(Eoe,this.updateUndoRedoSheetReferences,this)},oue.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Tae,this.performUndoRedo),this.parent.off(Eae,this.updateUndoRedoCollection),this.parent.off(Dae,this.setActionData),this.parent.off(Mae,this.getBeforeActionData),this.parent.off(kae,this.clearUndoRedoCollection),this.parent.off(ile,this.updateUndoRedoIcons),this.parent.off(Eoe,this.updateUndoRedoSheetReferences))},oue.prototype.destroy=function(){this.removeEventListener(),0<this.undoCollection.length&&(this.undoCollection=[]),0<this.redoCollection.length&&(this.redoCollection=[]),this.beforeActionData&&this.beforeActionData.cellDetails&&(this.beforeActionData.cellDetails=[]),this.parent=null},oue.prototype.getModuleName=function(){return"undoredo"},oue);function oue(e){this.undoCollection=[],this.redoCollection=[],this.isUndo=!1,this.undoRedoStep=100,this.parent=e,this.addEventListener()}sue.prototype.addEventListener=function(){this.parent.on(Fse,this.ribbonClickHandler,this),this.parent.on(sne,this.wrapTextHandler,this),this.parent.on(iae,this.rowHeightChangedHandler,this),this.parent.on(nae,this.colWidthChanged,this),this.parent.on(phe,this.updateWrapCell,this)},sue.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Fse,this.ribbonClickHandler),this.parent.off(sne,this.wrapTextHandler),this.parent.off(iae,this.rowHeightChangedHandler),this.parent.off(nae,this.colWidthChanged),this.parent.off(phe,this.updateWrapCell))},sue.prototype.wrapTextHandler=function(e){if((e.initial||wpe(this.parent,e.range,!0))&&(!e.isPublic||!are(this.parent,e.range))){e.initial&&!e.td&&!e.outsideViewport&&wpe(this.parent,e.range,!0)&&(e.initial=!1);var t,i=void 0,n=void 0,o=void 0,r=void 0,s=this.parent.frozenRowCount(e.sheet),a=void 0,l=void 0,h=void 0;!je(e.sheet.standardHeight)&&e.sheet.standardHeight<20?a=!0:l=this.parent.allowFiltering&&this.parent.filterModule.filterRange.has(this.parent.activeSheetIndex)&&this.parent.filterModule.filterRange.get(this.parent.activeSheetIndex).range;for(var d=e.range[0];d<=e.range[2];d++)for(var p,c,n=0,u=(c=(p=_de(e.sheet,d)).customHeight)||e.isCustomHgt,g=!zde(e.sheet,d),m=e.range[1];m<=e.range[3];m++)if(!((t=Kre(d,m,e.sheet,null,!0)).rowSpan<0||t.colSpan<0)){var f=1<t.rowSpan||1<t.colSpan;if((i=e.initial?e.td:g&&!epe(e.sheet,m)&&this.parent.getCell(d,m))?(e.wrap?(r=Jpe(t.style&&t.style.fontFamily?t.style:this.parent.cellStyle),i.classList.add(npe)):(i.classList.remove(npe),r=null),(u||f||p.height<20||a||l&&d===l[0]&&m>=l[1]&&m<=l[3])&&this.updateWrapCell({rowIdx:d,colIdx:m,sheet:e.sheet,ele:i}),F.isIE&&i.classList.add("e-ie-wrap")):r=null,!u&&!f){var y,v=ice(e.sheet,d,m,1<t.colSpan?m+t.colSpan-1:m),b=this.parent.getDisplayText(t).toString();if(b=this.parent.isEdit&&i&&b.indexOf("\n")<0&&(I=this.parent.element.querySelector(".e-spreadsheet-edit"))&&-1<I.textContent.indexOf("\n")?I.textContent:b)if(e.wrap){i&&i.classList.contains("e-alt-unwrap")&&(i.classList.remove("e-alt-unwrap"),b.includes("\n"))&&(h=i.querySelector(".e-hyperlink"))&&!h.innerText.includes("\n")&&(h.innerText=b);var w=void 0,C=0,S=void 0;if(-1<b.indexOf("\n")){for(var A=b.split("\n"),x=A.length,S=0;S<x;S++)C+=w=0===(w=$pe(A[S],v,t.style,this.parent.cellStyle))?1:w;w=C}else w=$pe(b,v,t.style,this.parent.cellStyle);if(o=nce(this.parent,d,m,e.sheet,t.style||this.parent.cellStyle,w,r),n=Math.max(n,o),1<t.rowSpan){var I=Ude(e.sheet,d,d+(t.rowSpan-1));if(n<=I)return;o=n=Wde(e.sheet,d)+(n-I)}oce(e.sheet,d,m,o)}else i&&(-1<b.indexOf("\n")&&i.classList.add("e-alt-unwrap"),h=i.querySelector(".e-hyperlink"))&&(y=h.innerText).includes("\n")&&(h.innerText=y.split("\n").join(" ")),o=nce(this.parent,d,m,e.sheet,t.style||this.parent.cellStyle,1,r),oce(e.sheet,d,m,o),n=Math.max(rce(e.sheet,d),20);else e.wrap&&b||(oce(e.sheet,d,m,20),n=Math.max(rce(e.sheet,d),20));m===e.range[3]&&(y=Wde(e.sheet,d),e.wrap&&(e.isOtherAction?20<=n:20<n)&&rce(e.sheet,d)<=n||(!e.wrap||!b)&&rce(e.sheet,d)<y&&20<y)&&y!==n&&(i?(Xpe(this.parent,e.sheet,n,d,e.row,e.hRow,g),i&&e.sheet.conditionalFormats&&e.sheet.conditionalFormats.length&&this.parent.notify(_ne,{indexes:[d,m],isAction:!0})):Xpe(this.parent,e.sheet,n,d,null,null,g,!g||d>this.parent.viewport.bottomIndex||s<=d&&d<this.parent.viewport.topIndex+s))}i&&(u&&!f&&(b=this.parent.getDisplayText(t),e.wrap?i.classList.contains("e-alt-unwrap")&&i.classList.remove("e-alt-unwrap"):-1<b.indexOf("\n")&&i.classList.add("e-alt-unwrap")),e.wrap?c?i.style.lineHeight&&(i.style.lineHeight=""):i.style.lineHeight=parseFloat(t.style&&t.style.fontSize||this.parent.cellStyle.fontSize)*r+"pt":i.style.lineHeight="")}e.initial||this.parent.notify(Jle,null)}},sue.prototype.ribbonClickHandler=function(e){var t,i,e=z(e.originalEvent.target,".e-btn");e&&e.id===this.parent.element.id+"_wrap"&&(e=e.classList.contains("e-active"),i={address:t=ute(this.parent.getActiveSheet()),wrap:e,cancel:!1},are(this.parent)?this.parent.notify(ele,null):(this.parent.notify(fie,{action:"beforeWrap",eventArgs:i}),i.cancel||($re(this.parent.getActiveSheet().selectedRange,e,this.parent),this.parent.notify(Vae,{action:"wrap",eventArgs:{address:t,wrap:e}}))))},sue.prototype.rowHeightChangedHandler=function(e){if(e.isCustomHgt){e.sheet=this.parent.getActiveSheet();for(var t=this.parent.viewport.leftIndex,i=this.parent.viewport.rightIndex;t<=i;t++)Kre(e.rowIdx,t,e.sheet,!1,!0).wrap&&(e.colIdx=t,e.ele=this.parent.getCell(e.rowIdx,t),this.updateWrapCell(e),e.ele.style.lineHeight)&&(e.ele.style.lineHeight="")}},sue.prototype.colWidthChanged=function(e){if(e.checkWrapCell){e.sheet=this.parent.getActiveSheet();for(var t=this.parent.viewport.topIndex,i=this.parent.viewport.bottomIndex;t<=i;t++)Kre(t,e.colIdx,e.sheet,!1,!0).wrap&&(e.rowIdx=t,e.ele=this.parent.getCell(t,e.colIdx),this.updateWrapCell(e))}},sue.prototype.updateWrapCell=function(e){if(e.ele&&!e.ele.querySelector(".e-wrap-content")){for(var t=this.wrapCell.cloneNode(),i=e.ele.querySelector(".e-filter-btn");e.ele.childElementCount&&!je(e.ele.firstElementChild)&&-1===e.ele.firstElementChild.className.indexOf("e-addNoteIndicator");)t.appendChild(e.ele.firstElementChild);var n=void 0;!je(e.ele.firstElementChild)&&-1<e.ele.firstElementChild.className.indexOf("e-addNoteIndicator")&&(n=e.ele.firstElementChild),i&&(e.ele.firstChild?e.ele.insertBefore(i,e.ele.firstChild):e.ele.appendChild(i)),Kre(e.rowIdx,e.colIdx,e.sheet,!1,!0).hyperlink||((i=e.ele.lastChild)&&3===i.nodeType?(t.appendChild(document.createTextNode(i.textContent)),i.textContent=""):(t.appendChild(document.createTextNode(e.ele.textContent)),e.ele.textContent="")),e.ele.appendChild(t),je(n)||e.ele.appendChild(n)}},sue.prototype.getModuleName=function(){return"wrapText"},sue.prototype.destroy=function(){this.removeEventListener(),this.wrapCell&&(this.wrapCell.remove(),this.wrapCell=null),this.parent=null};var rue=sue;function sue(e){this.parent=e,this.wrapCell=this.parent.createElement("span",{className:"e-wrap-content"}),this.addEventListener()}lue.prototype.insert=function(e){var t,i,n,o,r,s=e.eventArgs,a=(this.parent.notify($ne,s),_re(this.parent,s.activeSheetIndex));switch(s.modelType){case"Sheet":this.parent.notify(kse,{startIdx:s.index,endIdx:s.index+(s.model.length-1),preventUpdate:!s.isAction}),this.parent.renderModule.refreshSheet();break;case"Row":s.activeSheetIndex===this.parent.activeSheetIndex&&(i=this.parent.frozenRowCount(a),!this.parent.scrollSettings.enableVirtualization||s.index<=this.parent.viewport.bottomIndex?!s.freezePane&&this.parent.scrollSettings.enableVirtualization?(t=this.parent.frozenColCount(a),s.index>=this.parent.viewport.topIndex+i&&(n=[],o=void 0,t?(o=ste(a.topLeftCell)[1],n.push(i),n.push(this.parent.viewport.leftIndex+t)):o=this.parent.viewport.leftIndex,r=this.parent.viewport.leftIndex,this.parent.renderModule.refreshUI({rowIndex:this.parent.viewport.topIndex,colIndex:o,refresh:"Row",frozenIndexes:n,skipUpdateOnFirst:this.parent.viewport.topIndex+i===Woe(a,i,!0)}),t)&&(this.parent.viewport.leftIndex=r),o=ste(a.paneTopLeftCell)[0],s.index<o&&(this.parent.notify(rhe,{scrollTop:Ude(a,i,o-1,!0)}),this.parent.goTo(lte(s.index,Woe(a,t,!0,"columns")))),this.parent.selectRange(a.selectedRange)):this.parent.renderModule.refreshSheet(!1,!1,!0):!this.parent.scrollSettings.isFinite||this.parent.viewport.topIndex+i!==Woe(a,0,!0)&&this.parent.viewport.bottomIndex!==Woe(a,a.rowCount-s.model.length-1,!1)||this.parent.renderModule.refreshSheet(!1,!1,!0));break;case"Column":s.activeSheetIndex===this.parent.activeSheetIndex&&(t=this.parent.frozenColCount(a),!this.parent.scrollSettings.enableVirtualization||s.index<=this.parent.viewport.rightIndex?!s.freezePane&&this.parent.scrollSettings.enableVirtualization?(i=this.parent.frozenRowCount(a),s.index>=this.parent.viewport.leftIndex+t&&(n=[],i&&(n=[i+this.parent.viewport.topIndex,t]),r=i?ste(a.topLeftCell)[0]:this.parent.viewport.topIndex,o=this.parent.viewport.topIndex,this.parent.renderModule.refreshUI({skipUpdateOnFirst:this.parent.viewport.leftIndex+t===Woe(a,t,!0,"columns"),rowIndex:r,colIndex:this.parent.viewport.leftIndex,refresh:"Column",frozenIndexes:n}),i)&&(this.parent.viewport.topIndex=o),r=ste(a.paneTopLeftCell)[1],s.index<r&&(this.parent.notify(rhe,{scrollLeft:$de(a,0,r-1,!0)}),this.parent.goTo(lte(Woe(a,i,!0),s.index))),this.parent.selectRange(a.selectedRange)):this.parent.renderModule.refreshSheet(!1,!1,!0):!this.parent.scrollSettings.isFinite||this.parent.viewport.leftIndex+t!==Woe(a,0,!0,"columns")&&this.parent.viewport.rightIndex!==Woe(a,a.colCount-s.model.length-1,!1,"columns")||this.parent.renderModule.refreshSheet(!1,!1,!0))}this.refreshImgElement(s.model.length,this.parent.activeSheetIndex,s.modelType,s.index),s.isAction?(delete s.isAction,this.parent.notify(Vae,e),sce(this.parent.element)):s.isUndoRedo||(s.isMethod=!0,this.parent.notify(uie,e))},lue.prototype.refreshImgElement=function(e,t,i,n){for(var o,r=this.parent.sheets[t],s=[0,0,r.usedRange.rowIndex,r.usedRange.colIndex],a=0;a<=s[2];a++)for(var l=s[1];l<=s[3];l++)(o=Kre(a,l,r))&&o.image&&0<o.image.length&&("Row"===i&&n<=a||"Column"===i&&n<=l)&&this.parent.notify(Ple,{rowIdx:a,colIdx:l,sheetIdx:t,type:i,count:e,status:"insert"})},lue.prototype.addEventListener=function(){this.parent.on(lne,this.insert,this)},lue.prototype.destroy=function(){this.removeEventListener(),this.parent=null},lue.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(lne,this.insert)},lue.prototype.getModuleName=function(){return"insert"};var aue=lue;function lue(e){this.parent=e,this.addEventListener()}due.prototype.delete=function(e){var t,i,n,o,r,s,a,l=e.eventArgs;"Sheet"===l.modelType?((t=l.activeSheetIndex>=l.startIndex&&l.activeSheetIndex<=l.endIndex)&&this.parent.setProperties({activeSheetIndex:this.parent.skipHiddenSheets(l.startIndex<this.parent.sheets.length?l.startIndex:l.startIndex?l.startIndex-1:0)},!0),l.endIndex<l.activeSheetIndex&&this.parent.setProperties({activeSheetIndex:l.activeSheetIndex-(l.endIndex+1-l.startIndex)},!0),this.parent.notify(dse,null),t&&this.parent.renderModule.refreshSheet(!1,!1,!0)):l.activeSheetIndex===this.parent.activeSheetIndex&&(t=this.parent.getActiveSheet(),s=this.parent.frozenRowCount(t),i=this.parent.frozenColCount(t),"Row"===l.modelType?(!this.parent.scrollSettings.enableVirtualization||l.startIndex<=this.parent.viewport.bottomIndex)&&(this.parent.scrollSettings.enableVirtualization?l.startIndex<ste(t.paneTopLeftCell)[0]?(this.parent.updateTopLeftCell(Woe(t,l.startIndex-1<s?s:l.startIndex-1,!0)-s,null,"col"),this.parent.renderModule.refreshSheet(!1,!1,!0)):l.freezePane||this.parent.scrollSettings.isFinite&&this.parent.viewport.bottomIndex>=Woe(t,t.rowCount-1,!1)?this.parent.renderModule.refreshSheet(!1,!1,!0):(r=[],a=this.parent.frozenColCount(t),o=void 0,n=this.parent.viewport.leftIndex,o=a?(r.push(s),r.push(n+a),ste(t.topLeftCell)[1]):n,this.parent.renderModule.refreshUI({rowIndex:this.parent.viewport.topIndex,refresh:"Row",colIndex:o,skipUpdateOnFirst:this.parent.viewport.topIndex+s===Woe(t,s,!0),frozenIndexes:r}),a&&(this.parent.viewport.leftIndex=n),this.parent.selectRange(t.selectedRange)):this.parent.renderModule.refreshSheet(!1,!1,!0)):(!1!==l.refreshSheet&&(!this.parent.scrollSettings.enableVirtualization||l.startIndex<=this.parent.viewport.rightIndex)&&(this.parent.scrollSettings.enableVirtualization?l.startIndex<ste(t.paneTopLeftCell)[1]?(this.parent.updateTopLeftCell(null,Woe(t,l.startIndex-1<i?i:l.startIndex-1,!0,"columns")-i,"row"),this.parent.renderModule.refreshSheet(!1,!1,!0)):l.freezePane||!0===l.refreshSheet?this.parent.renderModule.refreshSheet(!1,!1,!0):(o=this.parent.frozenRowCount(t),r=[],s=this.parent.viewport.topIndex,a=o?ste(t.topLeftCell)[0]:s,o&&(r=[o+s,i]),this.parent.renderModule.refreshUI({rowIndex:a,refresh:"Column",colIndex:this.parent.viewport.leftIndex,insertDelete:!0,skipUpdateOnFirst:this.parent.viewport.leftIndex+i===Woe(t,i,!0,"columns"),frozenIndexes:r}),o&&(this.parent.viewport.topIndex=s),this.parent.selectRange(t.selectedRange)):this.parent.renderModule.refreshSheet(!1,!1,!0)),delete l.refreshSheet)),this.refreshImgElement(l.deletedModel.length,this.parent.activeSheetIndex,l.modelType,l.startIndex),l.isAction?(delete l.isAction,this.parent.notify(Vae,e),sce(this.parent.element)):l.isUndoRedo||(l.isMethod=!0,this.parent.notify(uie,e))},due.prototype.addEventListener=function(){this.parent.on(hne,this.delete,this)},due.prototype.destroy=function(){this.removeEventListener(),this.parent=null},due.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(hne,this.delete)},due.prototype.getModuleName=function(){return"delete"},due.prototype.refreshImgElement=function(e,t,i,n){for(var o,r=this.parent.sheets[t],s=[0,0,r.usedRange.rowIndex,r.usedRange.colIndex],a=0;a<=s[2];a++)for(var l=s[1];l<=s[3];l++)(o=Kre(a,l,r))&&o.image&&0<o.image.length&&("Row"===i&&n<=a||"Column"===i&&n<=l)&&this.parent.notify(Ple,{rowIdx:a,colIdx:l,sheetIdx:t,type:i,count:e,status:"delete"})};var hue=due;function due(e){this.parent=e,this.addEventListener()}cue.prototype.destroy=function(){this.removeEventListener();var e,t={},i=(!this.parent.isDestroyed&&!this.parent.refreshing&&(i=ste(this.parent.getActiveSheet().activeCell),e=this.parent.getCell(i[0],i[1]))&&(t={rowIdx:i[0],colIdx:i[1],td:e,isRefresh:!0}),this.removeListDropdownHandler(this.parent.element.querySelector(".e-validation-list"),t),ge("#"+this.parent.element.id+"_datavalidation-popup"));i&&i.remove(),this.typeData=[],this.operatorData=[],this.dataList&&(this.dataList=null),this.formObj&&(this.formObj.destroy(),this.formObj=null),this.parent=null},cue.prototype.addEventListener=function(){F.isDevice&&"safari"===F.info.name&&(F.isIos||F.isIos7)?E.add(this.parent.element,"touchend",this.listOpen,this):E.add(this.parent.element,"dblclick",this.listOpen,this),this.parent.on(Wae,this.initiateDataValidationHandler,this),this.parent.on(Qae,this.invalidDataHandler,this),this.parent.on(cne,this.isValidCellHandler,this),this.parent.on(Nie,this.listHandler,this),this.parent.on(bse,this.keyUpHandler,this),this.parent.on(lle,this.removeValidationHandler,this),this.parent.on(Zne,this.updateHighlightHandler,this),this.parent.on(iae,this.listValidationHeightHandler,this),this.parent.on(Toe,this.addListValidationDropdownHandler,this)},cue.prototype.removeEventListener=function(){F.isDevice&&"safari"===F.info.name&&(F.isIos||F.isIos7)?E.remove(this.parent.element,"touchend",this.listOpen):E.remove(this.parent.element,"dblclick",this.listOpen),this.parent.isDestroyed||(this.parent.off(Wae,this.initiateDataValidationHandler),this.parent.off(Qae,this.invalidDataHandler),this.parent.off(cne,this.isValidCellHandler),this.parent.off(Nie,this.listHandler),this.parent.off(bse,this.keyUpHandler),this.parent.off(lle,this.removeValidationHandler),this.parent.off(Zne,this.updateHighlightHandler),this.parent.off(iae,this.listValidationHeightHandler),this.parent.off(Toe,this.addListValidationDropdownHandler))},cue.prototype.removeValidationHandler=function(e){var t={cancel:!1,isColSelected:e.isCol};if(e.range&&e.range.includes("!")){if(n=e.range,!(i=_re(this.parent,Bre(this.parent,n.substring(0,n.lastIndexOf("!"))))))return}else{var i,n=(i=this.parent.getActiveSheet()).name+"!";e.range?n+=e.range:(n+=(i=this.getRange(i.selectedRange)).range,t.isColSelected=i.isColSelected)}t.range=n,e.isAction&&this.parent.notify(fie,{eventArgs:t,action:"removeValidation"}),t.cancel||(this.parent.notify(une,{range:n,isRemoveValidation:!0}),e.isAction&&(delete t.cancel,this.parent.notify(Vae,{eventArgs:t,action:"removeValidation"})))},cue.prototype.updateNoteIndicator=function(e,t,i){var n=e.querySelector(".e-addNoteIndicator");n&&(ue(n),this.parent.notify(bae,{targetElement:e,rowIndex:t,columnIndex:i,skipEvent:!0}))},cue.prototype.keyUpHandler=function(e){var t=e.target,i=this.parent.element.querySelector(".e-datavalidation-dlg");z(t,".e-values")&&i&&13!==e.keyCode&&(e=(t=i.querySelector(".e-values")).querySelector(".e-dlg-error"),(i=i.querySelector(".e-footer-content").querySelector(".e-primary")).hasAttribute("disabled")&&i.removeAttribute("disabled"),e)&&t.removeChild(e)},cue.prototype.listOpen=function(e){e=e.target;this.listObj&&e.classList.contains("e-cell")&&e.querySelector(".e-validation-list")&&this.parent.isEdit&&this.listObj.showPopup()},cue.prototype.invalidDataHandler=function(e){var t,i={range:"",cancel:!1},n=e.isRemoveHighlight?Cne:gne;!e.isPublic&&(this.parent.notify(fie,t={eventArgs:i,action:n}),i.cancel)||(this.parent.notify(n,{range:i.range,isAction:!0}),e.isPublic)||(t.preventAction=!0,this.parent.notify(Vae,t))},cue.prototype.listHandler=function(){var e=this.parent.getActiveSheet(),t=ste(e.activeCell),i=Kre(t[0],t[1],e),n=this.parent.getCell(t[0],t[1]);if(n){this.removeListDropdownHandler(this.parent.element.getElementsByClassName("e-validation-list")[0]);e=i&&i.validation||e.columns&&e.columns[t[1]]&&e.columns[t[1]].validation;if(e&&"List"===e.type){if(e.address&&!Noe(e.address,t[0],t[1]))return;this.addListValidationDropdownHandler({cell:i,validation:e,td:n,rowIdx:t[0],colIdx:t[1]})}i&&i.validation&&(i.validation=e)}},cue.prototype.removeListDropdownHandler=function(e,t){e&&(this.listObj&&this.listObj.destroy(),ue(e),t?t.isRefresh&&this.updateNoteIndicator(t.td,t.rowIdx,t.colIdx):!je(this.parent.selectionModule.previousActiveCell)&&(e=ste(this.parent.selectionModule.previousActiveCell),t=this.parent.getCell(e[0],e[1]))&&this.updateNoteIndicator(t,e[0],e[1]))},cue.prototype.addListValidationDropdownHandler=function(e){var t=this;if(e.updatePosition)this.updateTopPosition({ddlCont:e.ddlCont,rowIdx:e.rowIdx,colIdx:e.colIdx});else{var i,n,o,r,s=e.validation.inCellDropDown;if(e.isRefresh){if(!e.td&&(e.td=this.parent.getCell(e.rowIdx,e.colIdx),!e.td))return;if(this.removeListDropdownHandler(e.td.querySelector(".e-validation-list"),e),"List"!==e.validation.type)return;je(s)&&(s=!0)}else je(e.validation.ignoreBlank)&&(e.validation.ignoreBlank=!0),je(s)&&(s=e.validation.inCellDropDown=!0);s&&(s=this.parent.createElement("div",{className:"e-validation-list"}),i=this.parent.createElement("input",{id:this.parent.element.id+"listValid"}),s.appendChild(i),r=(o=e.td).getElementsByClassName("e-wrap-content")[0]||o,this.updateTopPosition({ddlCont:s,rowIdx:e.rowIdx,colIdx:e.colIdx}),this.listValidationHeightHandler({ddlCont:s}),r.insertBefore(s,r.firstChild),s=e.validation.value1,e.cell&&e.cell.validation||!s.startsWith("=")||(s=Uoe([e.rowIdx,e.colIdx,e.rowIdx,e.colIdx],[0,e.colIdx,0,e.colIdx],this.parent.getActiveSheet(),this.parent,{formula:s})),r=this.getListDataSource(s),this.listObj=new qz({index:this.setDropDownListIndex(r,e.cell),dataSource:r,fields:{text:"text",value:"id"},width:"0px",popupHeight:"200px",change:function(){return t.listValueChange(t.listObj.text)},beforeOpen:function(){(n=window.browserDetails.isDevice)&&(window.browserDetails.isDevice=!1)},open:function(e){e.popup.offsetX=t.listObj.enableRtl?3:-o.offsetWidth+(t.parent.enableRtl?4:24),e.popup.offsetY=-(o.querySelector(".e-control-wrapper.e-ddl").offsetHeight-18),e.popup.element.style.width=o.offsetWidth-1+"px",n&&(window.browserDetails.isDevice=!0)},close:function(e){e.event&&(13===e.event.keyCode||e.event.altKey&&38===e.event.keyCode)&&(e.event.preventDefault(),e.event.stopPropagation()),sce(t.parent.element)}}),this.listObj.appendTo(i),this.updateNoteIndicator(o,e.rowIdx,e.colIdx))}},cue.prototype.updateTopPosition=function(e){var t=this.parent.getActiveSheet(),t=Kre(e.rowIdx,e.colIdx,t);t&&t.style&&t.style.fontSize&&11<parseFloat(t.style.fontSize)?e.ddlCont.style.top=parseFloat(t.style.fontSize)-11+"pt":e.ddlCont.style.top&&(e.ddlCont.style.top="")},cue.prototype.listValidationHeightHandler=function(e){var t,i=this.parent.getActiveSheet(),n=ste(i.activeCell),o=Kre(n[0],n[1],i),o=o&&o.validation||i.columns&&i.columns[n[1]]&&i.columns[n[1]].validation;o&&"List"===o.type&&o.inCellDropDown&&((o=Wde(i,n[0],!0)-tce(n[0],n[1],i))<=18?(t=e.ddlCont||this.parent.element.querySelector(".e-validation-list"))&&(t.style.height=o+"px"):e.ddlCont||(t=this.parent.element.querySelector(".e-validation-list"))&&t.style.removeProperty("height"))},cue.prototype.setDropDownListIndex=function(e,t){if(t&&!je(t.value))for(var i=t.value.toString(),n=mre(i),o=n&&Mi(this.parent.locale),r=0,s=e.length;r<s;r++)if(e[r].text===i||n&&this.parseValidationValue(e[r].text,o).toString()===i)return r;return null},cue.prototype.getListDataSource=function(i){var n=this,e=[],t=0,o=this.parent.definedNames,r=i,s=r.startsWith("=");if(0<o.length&&s)for(var a=r.split("=")[1],l=0,h=o.length;l<h;l++)if(o[l].name===a){for(var d=o[l].refersTo;d.includes("'");)d=d.replace("'","");r=d}if(s){var p=void 0,s=void 0,c=void 0,u=r.lastIndexOf("!"),g=(-1<u?(c=r.substring(1,u),s=r.substring(u+1),c.startsWith("'")&&c.endsWith("'")&&(c=c.substring(1,c.length-1)),p=_re(this.parent,Bre(this.parent,c))):(p=this.parent.getActiveSheet(),s=r.substring(1)),this.parent.getActiveSheet());if(p){p.name!==g.name&&(f=rte(g.selectedRange),p.ranges.forEach(function(e){e.info&&e.info.loadedRange&&e.info.loadedRange.length||(m=!0)}),m)&&(this.parent.showSpinner(),Cre(this.parent,p.name+"!"+s).then(function(){var e,t;n.parent.hideSpinner(),g.name===n.parent.getActiveSheet().name&&(t=rte(n.parent.getActiveSheet().selectedRange))[0]===f[0]&&t[1]===f[1]&&(e=n.getListDataSource(i),n.listObj.dataSource=e,t=Kre(t[0],t[1],g),n.listObj.index=n.setDropDownListIndex(e,t),n.listObj.dataBind())}));for(var m,f,y=void 0,u=s.split(":"),v=(y=u[0]&&u[1]&&(u[0].match(/[a-z]+$/gi)&&u[1].match(/[a-z]+$/gi)||u[0].match(/^[0-9]/g)&&u[1].match(/^[0-9]/g))?(c=this.parent.getIndexes(s)).isCol?[0,c.startIdx,p.usedRange.rowIndex,c.startIdx]:[c.startIdx,0,c.startIdx,p.usedRange.colIndex]:rte(s))[0];v<=y[2];v++){p.rows[v]||Hde(p,v,{});for(var b=y[1];b<=y[3];b++){p.rows[v].cells||Jre(v,b,p,{}),t+=1;var w=p.rows[v].cells[b],w=this.parent.getDisplayText(w)||"";e.push({text:w,id:"list-"+t})}}}}else for(var C=this.getListOfValues(r),l=0;l<C.length;l++)e.push({text:C[l],id:"list-"+(t+=1)});return e},cue.prototype.listValueChange=function(e){var t,i,n=this.parent.getActiveSheet(),o=pte(n.activeCell),r=Object.assign({},Kre(o[0],o[1],n));n.isProtected&&Hoe(r,Kde(n,o[1]))?this.parent.notify($ae,null):sre(r,Kde(n,o[1]),_de(n,o[0]))?this.parent.notify(ele,null):(this.parent.isEdit&&this.parent.closeEdit(),t={value:e,oldValue:r.value,address:n.name+"!"+n.activeCell,cancel:!1},this.parent.notify(fie,{action:"cellSave",eventArgs:t}),t.cancel||(t={value:e,formula:""},r.format&&ise(r.format)&&!mre(e)&&(this.parent.notify(Aie,i={formattedText:e,value:e,format:"General",cell:{value:e,format:"General"},isEdit:!0}),"General"!==i.format)&&-1<["Currency","Percentage"].indexOf(Yhe(i.format))&&(t.format=i.format,t.value=i.value),Yoe(this.parent,n,{cell:t,rowIdx:o[0],colIdx:o[1],valChange:!0,lastCell:!0,checkCF:!0,uiRefresh:!0}))||(delete(i=Kre(o[0],o[1],n,!1,!0)).formula,this.parent.notify(yse,{action:"refreshFormulabar",cell:i}),this.parent.notify(qne,null),this.parent.notify(Vae,{action:"cellSave",eventArgs:{value:e,oldValue:r.value,address:n.name+"!"+n.activeCell}})))},cue.prototype.getRange=function(e){var t,i=rte(e),n=this.parent.getActiveSheet().rowCount;return i[2]===n-1&&0===i[0]&&(e=e.replace(/[0-9]/g,""),t=!0),{range:e,isColSelected:t}},cue.prototype.initiateDataValidationHandler=function(){for(var e,t,i,n,o,r,s,a,l=this,h=this.parent.getActiveSheet(),d=rte(h.selectedRange),p=d[0],c=d[1],u=d[2]>=d[0]?(e=function(){return p<=d[2]},function(){p++}):(e=function(){return p>=d[2]},function(){p--}),g=d[3]>=d[1]?(t=function(){return c<=d[3]},function(){c++}):(t=function(){return c>=d[3]},function(){c--}),m=function(e,t){var i;s&&!(i=Uoe(e,t,h,l.parent,{formula:r.value1})).includes("#REF!")&&(r.value1=i),a&&!(i=Uoe(e,t,h,l.parent,{formula:r.value2})).includes("#REF!")&&(r.value2=i)};e();u()){for(;t();g())if(f=(i=Kre(p,c,h,!1,!0)).validation||tpe(h.columns[c],p,c)&&h.columns[c].validation)if(r){if(!(f.type===r.type&&f.operator===r.operator&&(s&&Poe(f.value1)||f.value1===r.value1)&&(a&&Poe(f.value2)||f.value2===r.value2))){n=!0;break}}else{r=Object.assign({},f),s=Poe(r.value1),a=Poe(r.value2),i.validation||m([p,c,p,c],[0,c,0,c]);var f=rte(h.activeCell);p===f[0]&&c===f[1]||m(f,[p,c,p,c])}else o=!0;c=d[1]}function y(i){var n;l.parent.element.querySelector(".e-datavalidation-dlg")||(n=l.getRange(h.selectedRange).range,S.show({width:375,showCloseIcon:!0,isModal:!0,cssClass:"e-datavalidation-dlg",header:C.getConstant("DataValidation"),beforeOpen:function(e){var t={dialogName:"ValidationDialog",element:e.element,target:e.target,cancel:e.cancel};l.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(S.dialogInstance.content=l.dataValidationContent(C,n,i),S.dialogInstance.dataBind(),sce(l.parent.element))},beforeClose:l.dialogBeforeClose.bind(l),buttons:[{buttonModel:{content:C.getConstant("ClearAll"),cssClass:"e-btn e-clearall-btn e-flat"},click:function(){S.dialogInstance.content=l.dataValidationContent(C,n),S.dialogInstance.dataBind()}},{buttonModel:{content:C.getConstant("Apply"),isPrimary:!0},click:function(){l.dlgClickHandler(S)}}]}))}var v,b,w,C=this.parent.serviceLocator.getService(ope),S=this.parent.serviceLocator.getService(rpe);n||r&&o?(w=[{buttonModel:{isPrimary:!0,cssClass:"e-btn-goto-ok"},click:function(){S.hide(!0),y()}}],n?(v="MoreValidation",w[0].buttonModel.content=C.getConstant("Ok")):(v="ExtendValidation",w[0].buttonModel.content=C.getConstant("No"),w.splice(0,0,{buttonModel:{content:C.getConstant("Yes"),isPrimary:!0,cssClass:"e-btn-goto-ok"},click:function(){S.hide(!0),y(r)}})),b=C.getConstant(v),w={width:350,isModal:!0,showCloseIcon:!0,cssClass:"e-goto-dlg",header:C.getConstant("Spreadsheet"),content:b,beforeOpen:function(e){var t={dialogName:v,element:e.element,target:e.target,cancel:e.cancel,content:b};l.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(t.content!==b&&(S.dialogInstance.content=t.content,S.dialogInstance.dataBind()),sce(l.parent.element))},buttons:w},S.show(w)):y(r)},cue.prototype.dataValidationContent=function(e,t,i){var n,o,r,s,a=this,l=!i,h=(l?(n=C="0",s=!0):(h=i.value1,p=i.value2,o=i.type,r=i.operator,s=!1!==i.ignoreBlank,C=("Date"===o||"Time"===o?(n=(d=function(e){var t;return mre(e)?(t={cell:{value:e},type:o.toLowerCase(),value:e},a.parent.notify(Oie,t),t.value):e})(h),d):(n=(d=function(e){var t;return e=mre(e)&&(e=e.toString(),"."!==(t=Mi(a.parent.locale)).decimal)&&e.includes(".")?e.replace(".",t.decimal):e})(h),d))(p)),this.parent.createElement("div",{className:"e-validation-dlg"})),d=this.parent.createElement("div",{className:"e-cellrange"}),p=this.parent.createElement("div",{className:"e-allowdata"}),c=this.parent.createElement("div",{className:"e-values"}),u=this.parent.createElement("div",{className:"e-ignoreblank"}),g=(this.divElements.push(h),this.divElements.push(d),this.divElements.push(p),this.divElements.push(c),this.divElements.push(u),h.appendChild(d),h.appendChild(p),h.appendChild(c),h.appendChild(u),this.parent.createElement("span",{className:"e-header"})),t=(g.innerText=e.getConstant("CellRange"),this.parent.createElement("input",{className:"e-input",attrs:{value:t,"aria-label":e.getConstant("CellRange")}})),d=(d.appendChild(g),d.appendChild(t),this.parent.createElement("div",{className:"e-allow"})),m=this.parent.createElement("div",{className:"e-data"}),p=(p.appendChild(d),p.appendChild(m),this.parent.createElement("span",{className:"e-header"})),f=(p.innerText=e.getConstant("Allow"),this.typeData=[{text:e.getConstant("WholeNumber"),id:"type-1"},{text:e.getConstant("Decimal"),id:"type-2"},{text:e.getConstant("Date"),id:"type-3"},{text:e.getConstant("Time"),id:"type-4"},{text:e.getConstant("TextLength"),id:"type-5"},{text:e.getConstant("List"),id:"type-6"},{text:e.getConstant("Custom"),id:"type-7"}],this.operatorData=[{text:e.getConstant("Between"),id:"operator-1"},{text:e.getConstant("NotBetween"),id:"operator-2"},{text:e.getConstant("EqualTo"),id:"operator-3"},{text:e.getConstant("NotEqualTo"),id:"operator-4"},{text:e.getConstant("GreaterThan"),id:"operator-5"},{text:e.getConstant("LessThan"),id:"operator-6"},{text:e.getConstant("GreaterThanOrEqualTo"),id:"operator-7"},{text:e.getConstant("LessThanOrEqualTo"),id:"operator-8"}],this.parent.createElement("input",{className:"e-select"})),y=(this.spanElements.push(g),this.inputElements.push(t),this.divElements.push(d),this.divElements.push(m),this.spanElements.push(p),this.inputElements.push(f),0);if(!l){o=o&&this.formattedType(o);for(var v=0;v<this.typeData.length;v++)if(o===this.formattedType(this.typeData[v].text)){y=v;break}}if(l||"List"!==o&&"Custom"!==o){var b=0,g=this.parent.createElement("span",{className:"e-header"}),t=(g.innerText=e.getConstant("Data"),this.parent.createElement("input",{className:"e-select"}));if(!l)for(v=0;v<this.operatorData.length;v++)if(r===this.formattedValue(this.operatorData[v].text)){b=v;break}m.appendChild(g),m.appendChild(t),this.spanElements.push(g),this.inputElements.push(t),this.dataList=new qz({dataSource:this.operatorData,index:b,popupHeight:"200px",change:this.userInput.bind(this)}),this.dropDownListElements.push(this.dataList),this.dataList.appendTo(t)}else"Custom"!==o&&(g=this.parent.createElement("input",{className:"e-checkbox"}),m.appendChild(g),t=new ib({label:e.getConstant("InCellDropDown"),checked:!1!==i.inCellDropDown}),this.checkBoxElements.push(t),t.appendTo(g),this.inputElements.push(g));d.appendChild(p),d.appendChild(f),this.typeList=new qz({dataSource:this.typeData,index:y,popupHeight:"200px",change:this.userInput.bind(this)}),this.dropDownListElements.push(this.typeList),this.typeList.appendTo(f);function w(e,t){var i=a.parent.createElement("span",{className:"e-header"}),e=(i.innerText=e,a.parent.createElement("input",{className:"e-input",attrs:{value:t}}));c.appendChild(i),c.appendChild(e),a.spanElements.push(i),a.inputElements.push(e)}l||this.typeList.value!==e.getConstant("List")&&this.typeList.value!==e.getConstant("Custom")&&(this.dataList.value===e.getConstant("Between")||this.dataList.value===e.getConstant("NotBetween"))?(m=this.parent.createElement("div",{className:"e-minimum"}),i=this.parent.createElement("div",{className:"e-maximum"}),c.appendChild(m),c.appendChild(i),(t=this.parent.createElement("span",{className:"e-header"})).innerText=e.getConstant("Minimum"),(g=this.parent.createElement("span",{className:"e-header"})).innerText=e.getConstant("Maximum"),p=this.parent.createElement("input",{id:"minvalue",className:"e-input",attrs:{value:n,"aria-label":e.getConstant("Minimum")}}),d=this.parent.createElement("input",{id:"maxvalue",className:"e-input",attrs:{value:C,"aria-label":e.getConstant("Maximum")}}),m.appendChild(t),m.appendChild(p),i.appendChild(g),i.appendChild(d),this.divElements.push(m),this.divElements.push(i),this.spanElements.push(t),this.spanElements.push(g),this.inputElements.push(p),this.inputElements.push(d),f=new NL({value:0}),this.numericTextBoxElements.push(f),f.appendTo("#minvalue"),C=new NL({value:0}),this.numericTextBoxElements.push(C),C.appendTo("#maxvalue")):w(l||"List"!==o?l||"Custom"!==o?e.getConstant("Value"):e.getConstant("Formula"):e.getConstant("Sources"),n);var C,m=this.parent.createElement("input",{className:"e-checkbox"}),i=(u.appendChild(m),new ib({label:e.getConstant("IgnoreBlank"),checked:s}));return this.checkBoxElements.push(i),i.appendTo(m),this.inputElements.push(m),h},cue.prototype.dialogBeforeClose=function(){this.checkBoxElements.forEach(function(e){e&&e.element&&(e.destroy(),e.element.remove())}),this.checkBoxElements=[],this.numericTextBoxElements.forEach(function(e){e&&e.element&&(e.destroy(),e.element.remove())}),this.numericTextBoxElements=[],this.dropDownListElements.forEach(function(e){e&&e.element&&(e.destroy(),e.element.remove())}),this.dropDownListElements=[],fce(this.spanElements),this.spanElements=[],fce(this.inputElements),this.inputElements=[],fce(this.divElements),this.divElements=[]},cue.prototype.userInput=function(){function e(e){for(;e.lastChild;)e.removeChild(e.lastChild)}var t,i,n=this.typeList,o=this.dataList,r=this.parent.element.querySelector(".e-datavalidation-dlg").querySelector(".e-validation-dlg"),s=r.querySelector(".e-allowdata"),r=r.querySelector(".e-values"),a=this.parent.serviceLocator.getService(ope),s=s.querySelector(".e-data");e(r),n.value===a.getConstant("List")?(e(s),t=this.parent.createElement("input",{className:"e-checkbox"}),this.inputElements.push(t),s.appendChild(t),i=new ib({label:a.getConstant("InCellDropDown"),checked:!0}),this.checkBoxElements.push(i),i.appendTo(t)):n.value===a.getConstant("Custom")?e(s):s.childElementCount&&!s.getElementsByClassName("e-checkbox-wrapper")[0]||(e(s),(i=this.parent.createElement("span",{className:"e-header"})).innerText=a.getConstant("Data"),t=this.parent.createElement("input",{className:"e-select"}),this.spanElements.push(i),this.inputElements.push(t),s.appendChild(i),s.appendChild(t),o.appendTo(t)),n.value===a.getConstant("List")||n.value===a.getConstant("Custom")||o.value!==a.getConstant("Between")&&o.value!==a.getConstant("NotBetween")?((i=this.parent.createElement("span",{className:"e-header"})).innerText=n.value===a.getConstant("List")?a.getConstant("Sources"):n.value===a.getConstant("Custom")?a.getConstant("Formula"):a.getConstant("Value"),s=n.value===a.getConstant("List")?this.parent.createElement("input",{className:"e-input",attrs:{placeholder:"Enter value"}}):this.parent.createElement("input",{className:"e-input",attrs:{value:"0"}}),this.spanElements.push(i),this.inputElements.push(s),r.appendChild(i),r.appendChild(s)):(t=this.parent.createElement("div",{className:"e-minimum"}),o=this.parent.createElement("div",{className:"e-maximum"}),this.divElements.push(t),this.divElements.push(o),r.appendChild(t),r.appendChild(o),(n=this.parent.createElement("span",{className:"e-header"})).innerText=a.getConstant("Minimum"),(i=this.parent.createElement("span",{className:"e-header"})).innerText=a.getConstant("Maximum"),s=this.parent.createElement("input",{id:"min",className:"e-input",attrs:{value:"0"}}),r=this.parent.createElement("input",{id:"max",className:"e-input",attrs:{value:"0"}}),this.spanElements.push(n),this.spanElements.push(i),this.inputElements.push(s),this.inputElements.push(r),a=new NL({value:0}),this.numericTextBoxElements.push(a),a.appendTo("min"),a=new NL({value:0}),this.numericTextBoxElements.push(a),a.appendTo("max"),t.appendChild(n),t.appendChild(s),o.appendChild(i),o.appendChild(r))},cue.prototype.dlgClickHandler=function(e){var t,i,n,o,r=this,s=this.parent.serviceLocator.getService(ope),a=this.parent.element.querySelector(".e-datavalidation-dlg"),l=a.querySelector(".e-footer-content"),a=a.getElementsByClassName("e-dlg-content")[0].getElementsByClassName("e-validation-dlg")[0],h=a.getElementsByClassName("e-allowdata")[0],d=h.getElementsByClassName("e-allow")[0].getElementsByTagName("input")[0],p=h.getElementsByClassName("e-data")[0].getElementsByTagName("input")[0],c=a.getElementsByClassName("e-values")[0],u=[],d=(u[0]=c.getElementsByTagName("input")[0].value,u[1]=c.getElementsByTagName("input")[1]?c.getElementsByTagName("input")[1].value:"",this.formattedType(d.value)),g=!0,m=a.querySelector(".e-ignoreblank .e-checkbox").checked,h=h.querySelector(".e-data").querySelector(".e-checkbox-wrapper")?!!h.querySelector(".e-data").querySelector(".e-checkbox-wrapper").querySelector(".e-check"):null,a=a.querySelector(".e-cellrange").getElementsByTagName("input")[0].value,p=(p&&(i=this.formattedValue(p.value)),[]);if("List"===d?(""!==u[0]&&p.push(u[0]),u[0].startsWith("=")?(n=u[0].substring(1),v=this.parent.definedNames.find(function(e){return e.name===n}),f=b=void 0,(n=v?v.refersTo.substring(1):n).includes("!")?(f=n.lastIndexOf("!"),y=n.substring(0,f),n=n.substring(f+1),y.startsWith("'")&&y.endsWith("'")&&(y=y.substring(1,y.length-1)),b=-1<Bre(this.parent,y),v||(p[0]="="+y+"!"+n)):b=!0,y=void(!n.includes(":")&&Boe(n)&&(n=n+":"+n)),(g=y=b&&2===(b=n.split(":")).length?n.match(/[a-z]/gi)&&b[0].replace(/[0-9]/g,"")===b[1].replace(/[0-9]/g,"")||n.match(/\d/g)&&b[0].replace(/\D/g,"")===b[1].replace(/\D/g,""):y)||(t=v||void 0!==f||n.includes(":")?s.getConstant("DialogError"):s.getConstant("NamedRangeError"))):256<u[0].length&&(g=!1,t=s.getConstant("ListLengthError"))):(o=Mi(this.parent.locale),"Decimal"===d&&"."!==o.decimal&&((b=function(e){return mre(e)&&e.includes(".")&&("."!==o.group||!koe(e,r.parent.locale,o.group,o.decimal))})(u[0])||b(u[1]))&&(g=!1,t=s.getConstant("InvalidNumberError")),ere(u,this.parent,o),""!==u[0]&&p.push(u[0]),""!==u[1]&&p.push(u[1])),g){var f,y=this.parent.getActiveSheet(),v=this.isDialogValidator(p,d,i);if("Between"===i&&v.isValid&&!isNaN(parseFloat(p[0]))&&!isNaN(parseFloat(p[1]))&&parseFloat(p[0])>parseFloat(p[1])&&(v.isValid=!1,v.errorMsg=s.getConstant("MinMaxError")),"Custom"===d&&Poe(p[0])&&(this.parent.notify(woe,f={value:p[0]}),-1<["#N/A","#VALUE!","#REF!","#DIV/0!","#NUM!","#NAME?","#NULL!","#CALC!"].indexOf(f.value))&&(v.isValid=!1,v.errorMsg=s.getConstant("InvalidFormula")),t=v.errorMsg,g=v.isValid){if(are(this.parent,fte(rte(a))))return e.hide(!0),void this.parent.notify(ele,null);var b={range:y.name+"!"+a,value1:p[0],value2:p[1]||"",ignoreBlank:m,type:d,operator:i,inCellDropDown:h,cancel:!1};this.parent.notify(fie,{eventArgs:b,action:"validation"}),b.cancel||(this.parent.notify(une,{rules:{type:b.type,operator:b.operator,value1:b.value1,value2:b.value2,ignoreBlank:b.ignoreBlank,inCellDropDown:b.inCellDropDown},range:b.range,isAction:!0}),delete b.cancel,this.parent.element.getElementsByClassName("e-validation-error-dlg")[0]||(e.dialogInstance||e).hide(),this.parent.notify(Vae,{eventArgs:b,action:"validation"}))}}g||((u=this.parent.createElement("div",{className:"e-dlg-error",id:"e-invalid"})).innerText=t,c.appendChild(u),l.querySelector(".e-primary").setAttribute("disabled","true"))},cue.prototype.formattedValue=function(e){var t=this.parent.serviceLocator.getService(ope);switch(e){case t.getConstant("Between"):e="Between";break;case t.getConstant("NotBetween"):e="NotBetween";break;case t.getConstant("EqualTo"):e="EqualTo";break;case t.getConstant("NotEqualTo"):e="NotEqualTo";break;case t.getConstant("GreaterThan"):e="GreaterThan";break;case t.getConstant("LessThan"):e="LessThan";break;case t.getConstant("GreaterThanOrEqualTo"):e="GreaterThanOrEqualTo";break;case t.getConstant("LessThanOrEqualTo"):e="LessThanOrEqualTo";break;default:e="Between"}return e},cue.prototype.formattedType=function(e){var t=this.parent.serviceLocator.getService(ope);switch(e){case t.getConstant("WholeNumber"):e="WholeNumber";break;case t.getConstant("Decimal"):e="Decimal";break;case t.getConstant("Date"):e="Date";break;case t.getConstant("TextLength"):e="TextLength";break;case t.getConstant("List"):e="List";break;case t.getConstant("Time"):e="Time";break;case t.getConstant("Custom"):e="Custom"}return e},cue.prototype.isDialogValidator=function(e,t,i){var n=this.parent.serviceLocator.getService(ope),o=0;if("List"!==t&&("Between"===i||"NotBetween"===i)?2!==e.length:!(0<e.length))return{isValid:!1,errorMsg:n.getConstant("EmptyError")};for(var r=void 0,s=0;s<e.length;s++){var a,l,r=Poe(e[s])?(a={value:e[s]},this.parent.notify(woe,a),a.value):"Date"===t||"Time"===t?e[s]=this.getDateAsNumber({range:[],cell:{value:e[s]}},e[s]):e[s];if(!(l=this.formatValidation(r,t,!0)).isValid)break;o+=1}return l.isValid=o===e.length,l},cue.prototype.getDateAsNumber=function(e,t){e={value:t,rowIndex:e.range[0],cell:e.cell,colIndex:e.range[1],sheetIndex:e.sheetIdx,updatedVal:""};return this.parent.notify(Fie,e),e.updatedVal||t},cue.prototype.getListOfValues=function(e){e=","!==this.parent.listSeparator&&e.includes(this.parent.listSeparator)?e.split(this.parent.listSeparator):e.split(",");return e},cue.prototype.checkValidationHandler=function(e,t){var i=e.value.toString(),n=this.parent.sheets[e.sheetIdx],o=Kre(e.range[0],e.range[1],n,null,!0),r=t.value1,s=t.value2,a=(o.validation||(o=e.range,l=[0,e.range[1],0,e.range[3]],Poe(r)&&(r=Uoe(o,l,n,this.parent,{formula:r})),Poe(s)&&(s=Uoe(o,l,n,this.parent,{formula:s}))),"List"!==t.type&&(Poe(r)&&(this.parent.notify(woe,o={value:r}),r=o.value),Poe(s)&&(this.parent.notify(woe,l={value:s}),s=l.value),Poe(e.value))&&(n={value:e.value},this.parent.notify(woe,n),e.value=n.value),e.value),o=t.operator||"Between",l=t.type||"WholeNumber",n=!!je(t.ignoreBlank)||t.ignoreBlank;if(n&&""===i)return!0;var h,d="Date"===l||"Time"===l,p=(e.value&&(d||"TextLength"===t.type?mre(e.value)||(a=e.value=this.getDateAsNumber(e,e.value)):(g=e.isEdit&&Mi(this.parent.locale),(h=this.parseValidationValue(e.value,g))!==e.value&&mre(h)&&(a=e.value=h.toString()))),this.formatValidation(e.value,l).isValid);if(p)if(p=!1,d?(r&&!mre(r)&&(r=this.getDateAsNumber(e,r)),s&&!mre(s)&&(s=this.getDateAsNumber(e,s))):"TextLength"===t.type&&(a=e.value.toString().length.toString()),"List"===l){var c=e.value.toString(),u=mre(c),g=u&&Mi(this.parent.locale);if(r.startsWith("=")){for(var m,f=this.getListDataSource(r),y=0;y<f.length;y++)if(i===(m=f[y].text.toString())||c===m||u&&c===this.parseValidationValue(m,g).toString()){p=!0;break}}else for(var v=this.getListOfValues(r),y=0;y<v.length;y++)if(i===v[y]||c===v[y]||u&&c===this.parseValidationValue(v[y],g).toString()){p=!0;break}!p&&n&&""===c&&(p=!0)}else if("Custom"===l)!(p=mre(h=parseFloat(r.toString()))?0!==h||(d={value:t.value1},this.parent.notify(boe,d),""===d.value):"TRUE"===r.toUpperCase())&&n&&""===r&&(p=!0);else switch(s="Decimal"===l||"Time"===l?(a=parseFloat(a.toString()),r=parseFloat(r.toString()),s?parseFloat(s.toString()):null):(a=parseInt(a.toString(),10),r=parseInt(r.toString(),10),s?parseInt(s.toString(),10):null),o){case"EqualTo":p=a===r;break;case"NotEqualTo":p=a!==r;break;case"Between":p=r<=a&&a<=s;break;case"NotBetween":p=!(r<=a&&a<=s);break;case"GreaterThan":p=r<a;break;case"LessThan":p=a<r;break;case"GreaterThanOrEqualTo":p=r<=a;break;case"LessThanOrEqualTo":p=a<=r}return p},cue.prototype.parseValidationValue=function(e,t){return mre(e)?t&&"."===t.group&&(e=e.toString()).indexOf(".")&&koe(e,this.parent.locale,t.group,t.decimal)?e.split(t.group).join(""):e:(this.parent.notify(Aie,e={formattedText:e,value:e,format:"General",cell:{value:e,format:"General"},isEdit:!!t}),e.value)},cue.prototype.isValidCellHandler=function(e){var t,i=this.parent.sheets[e.sheetIdx],n=Kre(e.range[0],e.range[1],i),o={skip:!1,value:""},n=n&&n.validation;n&&(Poe(n.value1)&&!Boe(n.value1.substring(1,n.value1.length))&&-1<n.value1.indexOf("(")&&(t=(t=n.value1).substring(t.indexOf("=")+1,t.indexOf("(")),o.value=t.toUpperCase(),this.parent.notify(Yie,o)),!o.skip)&&Poe(n.value2)&&!Boe(n.value2.substring(1,n.value2.length))&&-1<n.value1.indexOf("(")&&(t=(t=n.value2).substring(t.indexOf("=")+1,t.indexOf("(")),o.value=t.toUpperCase(),this.parent.notify(Yie,o)),o.skip||(e.value=je(e.value)?"":e.value,n?(e.isValid=this.checkValidationHandler(e,n),e.isValid&&tpe(i.columns[e.range[1]],e.range[0],e.range[1])&&(n=i.columns[e.range[1]].validation,e.isValid=this.checkValidationHandler(e,n))):tpe(i.columns[e.range[1]],e.range[0],e.range[1])&&(n=i.columns[e.range[1]].validation,e.isValid=this.checkValidationHandler(e,n)),n&&(t=void 0,e.isEdit&&!e.isValid&&(e.isValid=t=this.validationErrorHandler(this.parent.serviceLocator.getService(ope).getConstant("ValidationError"))),e.isValid)&&n.isHighlighted&&!zde(i,e.range[0])&&!epe(i,e.range[1])&&this.updateHighlightHandler({rowIdx:e.range[0],colIdx:e.range[1],isRemoveHighlightedData:!t,isRemoveValidation:!0}))},cue.prototype.formatValidation=function(e,t,i){var n,o,r=this.parent.element.getElementsByClassName("e-sheet-panel")[0],s=this.parent.createElement("form",{id:"formId",className:"form-horizontal"}),a=this.parent.createElement("input",{id:"e-validation"});switch(a.setAttribute("name","validation"),a.setAttribute("type","text"),"Date"===t&&mre(e)&&2===(l=e.toString().split(".")).length&&(e=l[0]),a.setAttribute("value",e),s.appendChild(a),r.appendChild(s),t){case"Date":o={rules:{validation:{date:!0}},customPlacement:function(e,t){n=t.innerText}};break;case"Decimal":o={rules:{validation:{number:!0}},customPlacement:function(e,t){n=t.innerText}};break;case"WholeNumber":o={rules:{validation:{regex:/^-?\d*\.?[0]*$/}},customPlacement:function(e,t){n=t.innerText}};break;case"TextLength":i&&(o={rules:{validation:{regex:/^\d*\.?[0]*$/}},customPlacement:function(e,t){n=t.innerText}})}this.formObj=new nN("#formId",o);var l=this.formObj.validate();return r.removeChild(r.getElementsByClassName("form-horizontal")[0]),{isValid:l,errorMsg:n}},cue.prototype.updateHighlightHandler=function(e){var t,i,n;e.isRemoveValidation||(t={value:n=e.cell.value||0===e.cell.value?e.cell.value:e.cell.hyperlink?"string"==typeof e.cell.hyperlink?e.cell.hyperlink:e.cell.hyperlink.address||"":"",range:[e.rowIdx,e.colIdx],sheetIdx:this.parent.activeSheetIndex},(i=this.checkValidationHandler(t,e.validation))&&e.col&&tpe(e.col,e.rowIdx,e.colIdx)&&(t.value=n,i=this.checkValidationHandler(t,e.col.validation))),i?e.removeOnValidData&&(n=this.parent.getCell(e.rowIdx,e.colIdx))&&n.style.backgroundColor&&(e.td=n,e.style=this.parent.getCellStyleValue(["backgroundColor","color"],[e.rowIdx,e.colIdx]),this.parent.notify(Mie,e),e.td=null):(e.isRemoveHighlightedData?e.style=this.parent.getCellStyleValue(["backgroundColor","color"],[e.rowIdx,e.colIdx]):e.style={backgroundColor:"#ffff00",color:"#ff0000"},this.parent.notify(Mie,e))},cue.prototype.validationErrorHandler=function(i){var n,o=this,r=this.parent.element.getElementsByClassName("e-spreadsheet-edit")[0],e=this.parent.serviceLocator.getService(ope),s=!1;return this.parent.element.querySelector(".e-validation-error-dlg")||(n=this.parent.serviceLocator.getService(rpe),e={width:400,height:200,isModal:!0,showCloseIcon:!0,cssClass:"e-validation-error-dlg",target:document.getElementById(this.parent.element.id)||this.parent.element,beforeOpen:function(e){var t={dialogName:"ValidationErrorDialog",element:e.element,target:e.target,cancel:e.cancel,content:i};o.parent.trigger("dialogBeforeOpen",t),t.cancel&&(e.cancel=!0,s=!0),r.focus(),n.dialogInstance.content=t.content,n.dialogInstance.dataBind()},buttons:[{buttonModel:{content:e.getConstant("Retry"),isPrimary:!0},click:function(){o.errorDlgHandler(n,"Retry")}},{buttonModel:{content:e.getConstant("Cancel")},click:function(){o.errorDlgHandler(n,"Cancel")}}]},n.show(e,!1)),s},cue.prototype.errorDlgHandler=function(e,t){"Retry"===t?(t=this.parent.element.getElementsByClassName("e-spreadsheet-edit")[0],e.hide(),t.innerText&&(window.getSelection().selectAllChildren(t),this.listObj)&&!this.listObj.isDestroyed&&this.listObj.showPopup()):(t=(t=Kre((t=ste(this.parent.getActiveSheet().activeCell))[0],t[1],this.parent.getActiveSheet()))?this.parent.getDisplayText(t):"",this.parent.notify(mse,{action:"cancelEdit",value:t,refreshFormulaBar:!0,refreshEditorElem:!0,isAppend:!1,trigEvent:!0}),e.hide())},cue.prototype.getModuleName=function(){return"dataValidation"};var pue=cue;function cue(e){this.divElements=[],this.spanElements=[],this.inputElements=[],this.checkBoxElements=[],this.numericTextBoxElements=[],this.dropDownListElements=[],this.parent=e,this.addEventListener()}gue.prototype.init=function(){this.addEventListener()},gue.prototype.destroy=function(){this.removeEventListener(),this.parent=null},gue.prototype.addEventListener=function(){this.parent.on(qae,this.protect,this),this.parent.on(Uae,this.protectSheetHandler,this),this.parent.on($ae,this.editProtectedAlert,this),this.parent.on(jle,this.protectWorkbook,this),this.parent.on(bse,this.KeyUpHandler,this),this.parent.on(Wle,this.unProtectWorkbook,this),this.parent.on(ihe,this.unProtectSheetPassword,this),this.parent.on(qle,this.importProtectWorkbook,this),this.parent.on(Qle,this.protectWorkbookHandler,this),this.parent.on(Ule,this.removeWorkbookProtection,this),this.parent.on(hhe,this.toggleProtect,this)},gue.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(qae,this.protect),this.parent.off(Uae,this.protectSheetHandler),this.parent.off($ae,this.editProtectedAlert),this.parent.off(jle,this.protectWorkbook),this.parent.off(bse,this.KeyUpHandler),this.parent.off(Wle,this.unProtectWorkbook),this.parent.off(ihe,this.unProtectSheetPassword),this.parent.off(qle,this.importProtectWorkbook),this.parent.off(Qle,this.protectWorkbookHandler),this.parent.off(Ule,this.removeWorkbookProtection),this.parent.off(hhe,this.toggleProtect))},gue.prototype.protect=function(e){var t;e.isActive&&(t=this.parent.getActiveSheet()).isImportProtected&&(t.isImportProtected=!1),this.parent.notify(zse,null),e.isActive?(this.parent.setSheetPropertyOnMute(_re(this.parent,e.sheetIndex),"isProtected",!1),this.parent.notify(pae,{props:"Protect"}),this.parent.notify(Uae,e),this.parent.notify(ole,null)):this.createDialogue()},gue.prototype.createDialogue=function(){function e(){var e=K(document.getElementById(n.parent.element.id+"_protect_check"),ib);d.dialogInstance.element.querySelector(".e-footer-content .e-btn.e-primary").disabled=!e.checked}var i,n=this,t=this.parent.serviceLocator.getService(ope),o=[{text:t.getConstant("SelectCells"),id:"1"},{text:t.getConstant("SelectUnlockedCells"),id:"6"},{text:t.getConstant("FormatCells"),id:"2"},{text:t.getConstant("FormatRows"),id:"3"},{text:t.getConstant("FormatColumns"),id:"4"},{text:t.getConstant("InsertLinks"),id:"5"}],o=(this.optionList=new MH({dataSource:o,showCheckBox:!0,select:this.dialogOpen.bind(this)}),this.parent.createElement("div",{className:"e-sheet-password-dialog"})),r=this.parent.createElement("div",{className:"e-sheet-password-content"}),s=this.parent.createElement("div",{className:"e-header"}),a=(s.innerText=t.getConstant("SheetPassword"),this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"password"}})),s=(a.setAttribute("placeholder",t.getConstant("EnterThePassword")),r.appendChild(a),r.insertBefore(s,a),o.appendChild(r),this.parent.createElement("div",{className:"e-protect-content"})),l=(s.innerText=t.getConstant("ProtectAllowUser"),this.parent.setSheetPropertyOnMute(this.parent.getActiveSheet(),"isProtected",!1),new ib({checked:!0,label:t.getConstant("ProtectContent"),cssClass:"e-protect-checkbox"})),a=this.parent.createElement("div",{className:"e-protect-option-list",id:this.parent.element.id+"_option_list"}),r=this.parent.createElement("div",{className:"e-header-content"}),h=(r.innerText=t.getConstant("ProtectSheet"),this.parent.createElement("input",{id:this.parent.element.id+"_protect_check",attrs:{type:"checkbox"}})),d=this.parent.serviceLocator.getService("dialog");d.show({header:r.outerHTML,content:o.outerHTML+h.outerHTML+s.outerHTML+a.outerHTML,showCloseIcon:!0,isModal:!0,cssClass:"e-protect-dlg",beforeOpen:function(e){var t={dialogName:"ProtectSheetDialog",element:e.element,target:e.target,cancel:e.cancel};n.parent.trigger("dialogBeforeOpen",t),t.cancel?i=e.cancel=!0:sce(n.parent.element)},beforeClose:function(){i||E.remove(l.element,"click",e)},buttons:[{click:this.selectOption.bind(this,d),buttonModel:{content:t.getConstant("Ok"),isPrimary:!0}},{click:function(){return d.hide()},buttonModel:{content:t.getConstant("Cancel")}}]},!1),i||(l.appendTo("#"+this.parent.element.id+"_protect_check"),this.optionList.appendTo("#"+this.parent.element.id+"_option_list"),this.optionList.selectMultipleItems([{id:"1"},{id:"6"}]),E.add(l.element,"click",e,this))},gue.prototype.dialogOpen=function(e){var t=this.parent.serviceLocator.getService(ope);e.text===t.getConstant("SelectCells")&&e.isChecked&&e.isInteracted&&this.optionList.checkItem({id:"6"}),e.text===t.getConstant("SelectUnlockedCells")&&!e.isChecked&&e.isInteracted&&this.optionList.uncheckItem({id:"1"})},gue.prototype.selectOption=function(e){var t,i=e.dialogInstance.element.querySelector(".e-sheet-password-content .e-input").value;i?this.reEnterSheetPassword(i):(t=this.parent.getActiveSheet(),this.parent.setSheetPropertyOnMute(t,"isProtected",!0),this.parent.setSheetPropertyOnMute(t,"password",i),this.updateProtectSheet(i),e.hide(),(!t.protectSettings.selectCells&&!t.protectSettings.selectUnLockedCells||t.protectSettings.selectUnLockedCells&&ace(this.parent,rte(t.selectedRange)))&&this.parent.notify(the,null))},gue.prototype.applySheetPwd=function(e){var t=this.parent.getActiveSheet();this.parent.setSheetPropertyOnMute(t,"isProtected",!0),this.parent.setSheetPropertyOnMute(t,"password",e),this.updateProtectSheet(e),t.protectSettings.selectCells||t.protectSettings.selectUnLockedCells||this.parent.notify(the,null)},gue.prototype.updateProtectSheet=function(e){var t=this.parent.serviceLocator.getService(ope),i=this.optionList.getSelectedItems(),i={selectCells:-1<i.text.indexOf(t.getConstant("SelectCells")),formatCells:-1<i.text.indexOf(t.getConstant("FormatCells")),formatRows:-1<i.text.indexOf(t.getConstant("FormatRows")),formatColumns:-1<i.text.indexOf(t.getConstant("FormatColumns")),insertLink:-1<i.text.indexOf(t.getConstant("InsertLinks")),selectUnLockedCells:-1<i.text.indexOf(t.getConstant("SelectUnlockedCells"))};this.parent.notify(Tne,{protectSettings:i,password:e,triggerEvent:!0}),this.parent.notify(ole,null),this.parent.notify(kae,null)},gue.prototype.protectSheetHandler=function(e){var t=je(e&&e.sheetIndex)?this.parent.activeSheetIndex:e.sheetIndex,i=_re(this.parent,t),n=this.parent.element.id,o=[n+"_undo",n+"_redo",n+"_cut",n+"_copy",n+"_paste",n+"_number_format",n+"_font_name",n+"_font_size",n+"_bold",n+"_italic",n+"_line-through",n+"_underline",n+"_font_color_picker",n+"_fill_color_picker",n+"_borders",n+"_merge_cells",n+"_text_align",n+"_vertical_align",n+"_wrap",n+"_sorting",n+"_clear",n+"_conditionalformatting"],r=[n+"_cut",n+"_copy",n+"_number_format",n+"_font_name",n+"_font_size",n+"_bold",n+"_italic",n+"_line-through",n+"_underline",n+"_font_color_picker",n+"_fill_color_picker",n+"_borders",n+"_text_align",n+"_vertical_align",n+"_wrap",n+"_sorting",n+"_clear",n+"_conditionalformatting"],s=[n+"_insert_function"],a=[n+"_hyperlink",n+"_",n+"_chart"],l=[n+"_image"],h=[n+"_find"],d=[n+"_datavalidation"],n=[n+"_chart"],p=document.getElementById(this.parent.element.id+"_sheet_panel");p&&(i.isProtected&&(i.protectSettings.selectCells||i.protectSettings.selectUnLockedCells&&!ace(this.parent,rte(i.selectedRange)))?p.classList.remove("e-protected"):p.classList.add("e-protected"),i.isProtected||p.classList.remove("e-protected")),this.parent.dataBind(),this.parent.notify(Gae,{disableHomeBtnId:o,enableHomeBtnId:r,enableFrmlaBtnId:s,enableInsertBtnId:a,findBtnId:h,dataValidationBtnId:d,imageBtnId:l,chartBtnId:n}),this.parent.notify(nle,null),i.isProtected&&this.parent.notify(pae,{props:"Protect"}),e&&e.triggerEvent&&this.parent.notify(Vae,{action:"protectSheet",eventArgs:{sheetIndex:t,isProtected:i.isProtected,password:i.password,protectSettings:i.protectSettings.properties||i.protectSettings}})},gue.prototype.editProtectedAlert=function(){var i=this,n=this.parent.serviceLocator.getService(ope),o=this.parent.serviceLocator.getService("dialog");o.show({content:n.getConstant("EditAlert"),isModal:!0,closeOnEscape:!0,showCloseIcon:!0,width:"400px",cssClass:"e-editAlert-dlg",beforeOpen:function(e){var t={dialogName:"EditAlertDialog",content:n.getConstant("EditAlert"),element:e.element,target:e.target,cancel:e.cancel};i.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(o.dialogInstance.content=t.content,sce(i.parent.element))},close:function(){return sce(i.parent.element)}})},gue.prototype.protectWorkbook=function(){var i=this,e=this.parent.serviceLocator.getService(ope),n=this.parent.serviceLocator.getService(rpe);n.show({width:323,isModal:!0,showCloseIcon:!0,cssClass:"e-protectworkbook-dlg",header:e.getConstant("ProtectWorkbook"),beforeOpen:function(e){var t={dialogName:"ProtectWorkbook",element:e.element,target:e.target,cancel:e.cancel};i.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(n.dialogInstance.content=i.passwordProtectContent(),n.dialogInstance.dataBind(),sce(i.parent.element))},buttons:[{buttonModel:{content:e.getConstant("Ok"),isPrimary:!0},click:function(){i.alertMessage(),i.dlgClickHandler(n)}}]})},gue.prototype.passwordProtectContent=function(){var e=this.parent.serviceLocator.getService(ope),t=this.parent.createElement("div",{className:"e-password-dialog"}),i=this.parent.createElement("div",{className:"e-password-content"}),n=this.parent.createElement("div",{className:"e-password-content"}),o=this.parent.createElement("div",{className:"e-header"}),r=(o.innerText=e.getConstant("Password"),this.parent.createElement("div",{className:"e-header"})),s=(r.innerText=e.getConstant("ConfirmPassword"),this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"password"}})),a=this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"password"}});return s.setAttribute("placeholder",e.getConstant("EnterThePassword")),a.setAttribute("placeholder",e.getConstant("EnterTheConfirmPassword")),i.appendChild(s),i.insertBefore(o,s),n.appendChild(a),n.insertBefore(r,a),t.appendChild(n),t.insertBefore(i,n),t},gue.prototype.KeyUpHandler=function(e){var t,i,e=e.target;e.classList.contains("e-text")&&z(e,".e-password-content")&&z(e,".e-password-dialog")&&z(e,".e-password-dialog").getElementsByClassName("e-password-content")[1]===e.parentElement&&(t=z(e,".e-protectworkbook-dlg").getElementsByClassName("e-footer-content")[0].firstChild,""!==e.value?t.removeAttribute("disabled"):t.setAttribute("disabled","true")),e.classList.contains("e-text")&&z(e,".e-unprotectpwd-content")&&z(e,".e-unprotectpwd-dialog")&&z(e,".e-unprotectpwd-dialog").getElementsByClassName("e-unprotectpwd-content")[0]===e.parentElement&&(t=z(e,".e-unprotectworkbook-dlg").getElementsByClassName("e-footer-content")[0].firstChild,""!==e.value?t.removeAttribute("disabled"):t.setAttribute("disabled","true")),e.classList.contains("e-text")&&z(e,".e-reenterpwd-content")&&z(e,".e-reenterpwd-dialog")&&z(e,".e-reenterpwd-dialog").getElementsByClassName("e-reenterpwd-content")[0]===e.parentElement&&(t=z(e,".e-reenterpwd-dlg").getElementsByClassName("e-footer-content")[0].firstChild,""!==e.value?t.removeAttribute("disabled"):t.setAttribute("disabled","true")),e.classList.contains("e-text")&&z(e,".e-unprotectsheetpwd-content")&&z(e,".e-unprotectsheetpwd-dialog")&&z(e,".e-unprotectsheetpwd-dialog").getElementsByClassName("e-unprotectsheetpwd-content")[0]===e.parentElement&&(i=z(e,".e-unprotectworksheet-dlg").getElementsByClassName("e-footer-content")[0].firstChild,""!==e.value?i.removeAttribute("disabled"):i.setAttribute("disabled","true")),e.classList.contains("e-text")&&z(e,".e-importprotectpwd-content")&&z(e,".e-importprotectpwd-dialog")&&z(e,".e-importprotectpwd-dialog").getElementsByClassName("e-importprotectpwd-content")[0]===e.parentElement&&(i=z(e,".e-importprotectworkbook-dlg").getElementsByClassName("e-footer-content")[0].firstChild,""!==e.value?i.removeAttribute("disabled"):i.setAttribute("disabled","true"))},gue.prototype.alertMessage=function(){var e=this.parent.element.querySelector(".e-pwd-alert-span"),t=this.parent.element.querySelector(".e-unprotectpwd-alert-span"),i=this.parent.element.querySelector(".e-importprotectpwd-alert-span"),n=this.parent.element.querySelector(".e-reenterpwd-alert-span"),o=this.parent.element.querySelector(".e-unprotectsheetpwd-alert-span");e&&e.remove(),t&&t.remove(),i&&i.remove(),n&&n.remove(),o&&o.remove()},gue.prototype.dlgClickHandler=function(e){var t=this.parent.serviceLocator.getService(ope),i=this.parent.element.querySelector(".e-password-dialog").getElementsByClassName("e-password-content")[0].querySelector(".e-input"),n=this.parent.element.querySelector(".e-password-dialog").getElementsByClassName("e-password-content")[1].querySelector(".e-input"),o=this.parent.createElement("span",{className:"e-pwd-alert-span"});i.value===n.value?(e.hide(),this.parent.notify(pae,{props:"Protectworkbook"}),this.protectWorkbookHandler({password:i.value}),this.parent.notify(Vae,{action:"protectWorkbook",eventArgs:{isProtected:!0,password:i.value}})):""===i.value?o.textContent=t.getConstant("PasswordAlertMsg"):""===n.value?o.textContent=t.getConstant("ConfirmPasswordAlertMsg"):i.value!==n.value&&(o.textContent=t.getConstant("PasswordAlert")),e.dialogInstance&&this.parent.element.querySelector(".e-protectworkbook-dlg").querySelector(".e-dlg-content").appendChild(o)},gue.prototype.protectWorkbookHandler=function(e){this.parent.password=e.password,this.parent.isProtected=!0,this.parent.showSheetTabs&&(this.parent.element.querySelector(".e-add-sheet-tab").setAttribute("disabled","true"),this.parent.element.querySelector(".e-add-sheet-tab").classList.add("e-disabled")),this.parent.notify(pae,{props:"Protectworkbook"})},gue.prototype.unProtectWorkbook=function(){var i=this,e=this.parent.serviceLocator.getService(ope),n=this.parent.serviceLocator.getService(rpe);n.show({width:323,isModal:!0,showCloseIcon:!0,cssClass:"e-unprotectworkbook-dlg",header:e.getConstant("UnprotectWorkbook"),beforeOpen:function(e){var t={dialogName:"UnprotectWorkbook",element:e.element,target:e.target,cancel:e.cancel};i.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(n.dialogInstance.content=i.unProtectPasswordContent(),n.dialogInstance.dataBind(),sce(i.parent.element))},buttons:[{buttonModel:{content:e.getConstant("Ok"),isPrimary:!0,disabled:!0},click:function(){i.alertMessage(),i.unprotectdlgOkClick(n)}}]})},gue.prototype.unProtectsheet=function(e){var i=this,t=this.parent.serviceLocator.getService(ope),n=this.parent.serviceLocator.getService(rpe);n.show({width:323,isModal:!0,showCloseIcon:!0,cssClass:"e-unprotectworksheet-dlg",header:t.getConstant("UnprotectWorksheet"),beforeOpen:function(e){var t={dialogName:"UnProtectSheet",element:e.element,target:e.target,cancel:e.cancel};i.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(n.dialogInstance.content=i.unProtectSheetPasswordContent(),n.dialogInstance.dataBind(),sce(i.parent.element))},buttons:[{buttonModel:{content:t.getConstant("Ok"),isPrimary:!0,disabled:!this.parent.allowOpen||!this.parent.openModule.isImportedFile||-1!==this.parent.openModule.unProtectSheetIdx.indexOf(this.parent.activeSheetIndex)},click:function(){i.alertMessage(),i.unprotectSheetdlgOkClick(n,e)}}]})},gue.prototype.reEnterSheetPassword=function(n){var o,r,s=this,e=this.parent.serviceLocator.getService(ope),a=this.parent.serviceLocator.getService(rpe),t=a.dialogInstance;a.show({width:323,isModal:!0,showCloseIcon:!0,cssClass:"e-reenterpwd-dlg",header:e.getConstant("ConfirmPassword"),beforeOpen:function(e){var t,i,n={dialogName:"Re-enterPassword",element:e.element,target:e.target,cancel:e.cancel};s.parent.trigger("dialogBeforeOpen",n),n.cancel?o=e.cancel=!0:(n=s.parent.serviceLocator.getService(ope),e=s.parent.createElement("div",{className:"e-reenterpwd-dialog"}),t=s.parent.createElement("div",{className:"e-reenterpwd-content"}),(i=s.parent.createElement("div",{className:"e-header"})).innerText=n.getConstant("ReEnterPassword"),n=s.parent.createElement("input",{className:"e-input e-text",attrs:{type:"password"}}),t.appendChild(n),t.insertBefore(i,n),e.appendChild(t),a.dialogInstance.content=e,a.dialogInstance.dataBind(),sce(s.parent.element.querySelector(".e-protect-dlg.e-dialog .e-footer-content .e-btn")))},close:function(){a.dialogInstance=t,o?(s.applySheetPwd(n),a.hide(!0)):r&&a.hide(!0)},buttons:[{buttonModel:{content:e.getConstant("Ok"),isPrimary:!0,disabled:!0},click:function(){s.alertMessage();var e,t=s.parent.serviceLocator.getService(ope),i=s.parent.element.querySelector(".e-reenterpwd-dialog .e-reenterpwd-content .e-input").value;n===i?(s.applySheetPwd(n),r=!0,a.hide()):((e=s.parent.createElement("span",{className:"e-reenterpwd-alert-span"})).textContent=i?t.getConstant("PasswordAlert"):t.getConstant("ConfirmPasswordAlertMsg"),s.parent.element.querySelector(".e-reenterpwd-dlg").querySelector(".e-reenterpwd-dialog").appendChild(e))}}]})},gue.prototype.unProtectPasswordContent=function(){var e=this.parent.serviceLocator.getService(ope),t=this.parent.createElement("div",{className:"e-unprotectpwd-dialog"}),i=this.parent.createElement("div",{className:"e-unprotectpwd-content"}),n=this.parent.createElement("div",{className:"e-header"}),e=(n.innerText=e.getConstant("EnterThePassword"),this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"password"}}));return i.appendChild(e),i.insertBefore(n,e),t.appendChild(i),t},gue.prototype.unProtectSheetPasswordContent=function(){var e=this.parent.serviceLocator.getService(ope),t=this.parent.createElement("div",{className:"e-unprotectsheetpwd-dialog"}),i=this.parent.createElement("div",{className:"e-unprotectsheetpwd-content"}),n=this.parent.createElement("div",{className:"e-header"}),e=(n.innerText=e.getConstant("EnterThePassword"),this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"password"}}));return i.appendChild(e),i.insertBefore(n,e),t.appendChild(i),t},gue.prototype.unprotectdlgOkClick=function(e){var t=this.parent.serviceLocator.getService(ope),i=this.parent.element.querySelector(".e-unprotectpwd-dialog").getElementsByClassName("e-unprotectpwd-content")[0].querySelector(".e-input");this.parent.password===i.value?(e.hide(),this.removeWorkbookProtection(),this.parent.notify(Vae,{action:"protectWorkbook",eventArgs:{isProtected:!1}})):((i=this.parent.createElement("span",{className:"e-unprotectpwd-alert-span"})).innerText=t.getConstant("UnprotectPasswordAlert"),this.parent.element.querySelector(".e-unprotectworkbook-dlg").querySelector(".e-dlg-content").appendChild(i))},gue.prototype.removeWorkbookProtection=function(){this.parent.password="",this.parent.isProtected=!1,this.parent.showSheetTabs&&(this.parent.element.querySelector(".e-add-sheet-tab").removeAttribute("disabled"),this.parent.element.querySelector(".e-add-sheet-tab").classList.remove("e-disabled"));var e=document.getElementById(this.parent.element.id+"_protectworkbook");e&&e.classList.remove("e-active"),this.parent.notify(pae,{props:"Protectworkbook"})},gue.prototype.unprotectSheetdlgOkClick=function(e,t){var i=this.parent.serviceLocator.getService(ope),n=this.parent.getActiveSheet(),o=this.parent.element.querySelector(".e-unprotectsheetpwd-dialog").getElementsByClassName("e-unprotectsheetpwd-content")[0].querySelector(".e-input");t&&0===n.password.length?(t={sheetPassword:o.value,sheetIndex:this.parent.activeSheetIndex},this.parent.open(t)):n.password===o.value?(e.hide(),this.unProtectSheetPassword()):((t=this.parent.createElement("span",{className:"e-unprotectsheetpwd-alert-span"})).innerText=i.getConstant("UnprotectPasswordAlert"),this.parent.element.querySelector(".e-unprotectworksheet-dlg").querySelector(".e-dlg-content").appendChild(t))},gue.prototype.unProtectSheetPassword=function(){var e=this.parent.getActiveSheet(),t=this.parent.activeSheetIndex,e=(this.parent.setSheetPropertyOnMute(e,"isProtected",!e.isProtected),this.parent.setSheetPropertyOnMute(e,"password",""),!e.isProtected);this.parent.notify(qae,{isActive:e,id:this.parent.element.id+"_protect",sheetIndex:t,triggerEvent:!0}),this.parent.allowOpen&&this.parent.openModule.isImportedFile&&-1===this.parent.openModule.unProtectSheetIdx.indexOf(t)&&this.parent.openModule.unProtectSheetIdx.push(t)},gue.prototype.importProtectWorkbook=function(i){var n=this,e=this.parent.serviceLocator.getService(ope),o=this.parent.serviceLocator.getService(rpe);o.show({width:323,isModal:!0,showCloseIcon:!0,cssClass:"e-importprotectworkbook-dlg",header:e.getConstant("UnprotectWorkbook"),beforeOpen:function(e){var t={dialogName:"ImportProtectWorkbook",element:e.element,target:e.target,cancel:e.cancel};n.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(o.dialogInstance.content=n.importProtectPasswordContent(i),o.dialogInstance.dataBind(),sce(n.parent.element))},buttons:[{buttonModel:{content:e.getConstant("Ok"),isPrimary:!0,disabled:!0},click:function(){n.alertMessage(),n.importOkClick(i)}}]})},gue.prototype.importProtectPasswordContent=function(e){var t=this.parent.serviceLocator.getService(ope),i=this.parent.createElement("div",{className:"e-importprotectpwd-dialog"}),n=this.parent.createElement("div",{className:"e-importprotectpwd-content"}),o=this.parent.createElement("span",{className:"e-header"}),e=(o.innerText='"'+e.file.name+'" '+t.getConstant("IsProtected"),this.parent.createElement("input",{className:"e-input e-text",attrs:{type:"password"}}));return e.setAttribute("placeholder",t.getConstant("EnterThePassword")),n.appendChild(o),n.appendChild(e),i.appendChild(n),i},gue.prototype.importOkClick=function(e){var t=this.parent.element.querySelector(".e-importprotectpwd-dialog").getElementsByClassName("e-importprotectpwd-content")[0].querySelector(".e-input"),e=(this.parent.password=t.value,{file:e.file,password:t.value});this.parent.open(e)},gue.prototype.toggleProtect=function(){var e=this.parent.element.id,t=this.parent.getActiveSheet();t.isProtected&&this.parent.allowOpen&&t.isImportProtected&&this.parent.openModule.isImportedFile&&-1===this.parent.openModule.unProtectSheetIdx.indexOf(this.parent.activeSheetIndex)?this.unProtectsheet(!0):t.password&&0<t.password.length?this.unProtectsheet():(this.parent.setSheetPropertyOnMute(t,"isProtected",!t.isProtected),t=!t.isProtected,this.parent.notify(qae,{isActive:t,id:e+"_protect",sheetIndex:this.parent.activeSheetIndex,triggerEvent:!0}))},gue.prototype.getModuleName=function(){return"protectSheet"};var uue=gue;function gue(e){this.parent=e,this.init()}fue.prototype.addEventListener=function(){this.parent.on(Xae,this.renderFindDlg,this),this.parent.on(Yae,this.renderGotoDlg,this),this.parent.on(fne,this.gotoHandler,this),this.parent.on(Kae,this.findHandler,this),this.parent.on(bne,this.showFindAlert,this),this.parent.on(Ene,this.replaceAllDialog,this),this.parent.on(wne,this.findKeyUp,this),this.parent.on(vie,this.findToolDlg,this),this.parent.on(sae,this.refreshFindDlg,this)},fue.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Xae,this.renderFindDlg),this.parent.off(Yae,this.renderGotoDlg),this.parent.off(fne,this.gotoHandler),this.parent.off(Kae,this.findHandler),this.parent.off(bne,this.showFindAlert),this.parent.off(Ene,this.replaceAllDialog),this.parent.off(wne,this.findKeyUp),this.parent.off(vie,this.findToolDlg),this.parent.off(sae,this.refreshFindDlg))},fue.prototype.findToolDlg=function(i){function t(e){var t=c.parent.showRibbon&&c.parent.element.querySelector(".e-ribbon");t&&(t=i.event&&i.event.target?z(i.event.target,"#"+c.parent.element.id+"_findbtn"):ge("#"+c.parent.element.id+"_findbtn",t))&&(e?t.classList.add("e-disabled"):t.classList.remove("e-disabled"),t.disabled=e)}function n(e){var t;r&&(!g.isProtected||g.protectSettings.selectCells||g.protectSettings.selectUnLockedCells)&&(t=r.value,e&&13===e.keyCode?r.value&&"0 of 0"!==o.textContent&&(c.parent.notify(Kae,{findOption:e.shiftKey?"prev":"next"}),c.updateCount(o,e.shiftKey)):(e=void 0,e=""===t?!(o.textContent="0 of 0"):(t={value:t,mode:"Sheet",isCSen:!1,sheetIndex:c.parent.activeSheetIndex,isEMatch:!1,searchBy:"By Row"},c.parent.notify(Ane,t),o.textContent=t.findCount,"0 of 0"!==t.findCount),l.enableItems(1,e),l.enableItems(2,e)))}var o,r,s,a,l,e,h,d,p,c=this,u=i.dialogEle||this.parent.element.getElementsByClassName("e-findtool-dlg")[0],g=(i.isPublic&&(this.findValue=i.findValue),this.parent.getActiveSheet());u?i.isPublic||i.refreshPosition?(i.isPublic&&((r=u.querySelector(".e-text-findNext-short")).value=this.findValue,o=u.querySelector(".e-input-group-icon"),l=At(u.querySelector(".e-find-toolbar"),"toolbar"),n()),i.refreshPosition&&(d=void 0,d=this.parent.getActiveSheet().showHeaders?((e=this.parent.getColumnHeaderContent().parentElement)&&e.offsetHeight||30)+1:1,u.style.top=d+"px")):(t(!0),this.findDialog.hide()):(e=this.parent.createElement("div",{className:"e-input-group"}),r=this.parent.createElement("input",{className:"e-input e-text-findNext-short",attrs:{type:"Text"}}),this.findValue&&(r.value=this.findValue),d=this.parent.serviceLocator.getService(ope),r.setAttribute("placeholder",d.getConstant("FindValue")),o=this.parent.createElement("span",{className:"e-input-group-icon"}),a=100<g.usedRange.rowIndex*g.usedRange.colIndex,r.onkeyup=function(e){a?(s&&clearTimeout(s),s=setTimeout(n.bind(c,e),500)):n(e)},e.appendChild(r),e.appendChild(o),e=[{type:"Input",template:e},{prefixIcon:"e-icons e-prev-icon",tooltipText:d.getConstant("FindPreviousBtn"),type:"Button",cssClass:"e-findRib-prev",disabled:!0},{prefixIcon:"e-icons e-next-icon",tooltipText:d.getConstant("FindNextBtn"),type:"Button",cssClass:"e-findRib-next",disabled:!0},{type:"Separator"},{prefixIcon:"e-icons e-option-icon",tooltipText:d.getConstant("MoreOptions"),type:"Button",cssClass:"e-findRib-more"},{prefixIcon:"e-icons e-close",tooltipText:d.getConstant("Close"),type:"Button",cssClass:"e-findRib-close"}],l=new U3({clicked:function(e){"e-findRib-next"===e.item.cssClass?(c.parent.notify(Kae,{findOption:"next"}),c.updateCount(o)):"e-findRib-prev"===e.item.cssClass?(c.parent.notify(Kae,{findOption:"prev"}),c.updateCount(o,!0)):"e-findRib-more"===e.item.cssClass&&(c.findDialog.animationSettings.effect="None",c.findDialog.setProperties({animationSettings:c.findDialog.animationSettings},!0),c.renderFindDlg(),c.findDialog.hide())},width:"auto",height:"auto",items:e,cssClass:"e-find-toolObj",created:function(){l.element.querySelectorAll(".e-toolbar-item .e-tbar-btn").forEach(function(e){return e.removeAttribute("tabindex")})}}),e=this.parent.createElement("div",{className:"e-find-toolbar",attrs:{tabindex:"-1"}}),l.createElement=this.parent.createElement,l.appendTo(e),u=this.parent.createElement("div",{className:"e-dlg-div",attrs:{"aria-label":d.getConstant("FindValue")}}),h=this.parent.element.getElementsByClassName("e-sheet-panel")[0],d={cssClass:"e-findtool-dlg",visible:!1,enableRtl:this.parent.enableRtl,target:h,open:function(){E.add(document,"click",c.closeDialog,c),c.findValue&&(!g.isProtected||g.protectSettings.selectCells||g.protectSettings.selectUnLockedCells)?(e={value:c.findValue,mode:"Sheet",isCSen:!1,sheetIndex:c.parent.activeSheetIndex,isEMatch:!1,searchBy:"By Row"},c.parent.notify(Ane,e),o.textContent=e.findCount,l.enableItems(1,e="0 of 0"!==e.findCount),l.enableItems(2,e)):o.textContent="0 of 0",t(!1);var e=l.element.querySelector(".e-input-group");e&&e.addEventListener("focus",function(){var e=l.element.querySelector(".e-text-findNext-short");sce(e),e.classList.add("e-input-focus"),e.setSelectionRange(0,e.value.length)}),p&&c.findDialog.setProperties({animationSettings:p},!0)},beforeOpen:function(){return sce(c.parent.element)},beforeClose:function(){c.findValue=r.value||null,l.destroy(),E.remove(document,"click",c.closeDialog)},close:function(){c.findDialog.destroy(),c.findDialog=null,G(u),h.style.position="",sce(c.parent.element),t(!1)},created:function(){h.style.position="relative",u.style.width=c.parent.getMainContent().offsetWidth+"px",u.style.visibility="hidden",u.style.display="block",c.findDialog.width=2*parseInt(getComputedStyle(u).borderLeftWidth,10)+u.querySelector(".e-toolbar-items").getBoundingClientRect().width+"px",u.style.display="",u.style.width="",u.style.visibility="",u.style.top=(i&&i.headerHgt||c.parent.getColumnHeaderContent().parentElement.offsetHeight+1)+"px",u.style.left="",u.style[c.parent.enableRtl?"left":"right"]=c.parent.sheetModule.getScrollSize()+"px",c.findDialog.show()}},F.isDevice?(d.header=e,d.allowDragging=!0):d.content=e,this.findDialog=new pS(d),this.findDialog.createElement=this.parent.createElement,i&&i.isPublic&&(p={effect:this.findDialog.animationSettings.effect},this.findDialog.setProperties({animationSettings:{effect:"None"}},!0)),this.findDialog.appendTo(u))},fue.prototype.refreshFindDlg=function(){var e,t=this.findDialog&&this.parent.element.getElementsByClassName("e-findtool-dlg")[0];t&&(e=t.querySelector(".e-text-findNext-short"),this.findToolDlg({findValue:e.value,isPublic:!0,refreshPosition:!0,dialogEle:t}))},fue.prototype.updateCount=function(e,t){var i,n=e.textContent.split(" ");t?(i=Number(n[0])-1)<1&&(i=Number(n[2])):(i=Number(n[0])+1)>Number(n[2])&&(i=1),n[0]=i.toString(),e.textContent=n.join(" ")},fue.prototype.closeDialog=function(e){!z(e.target,".e-findRib-close")&&z(e.target,".e-spreadsheet")||!this.findDialog||this.findToolDlg({})},fue.prototype.renderFindDlg=function(){var e,i=this,n=this.parent.serviceLocator.getService(rpe);this.parent.element.querySelector(".e-find-dlg")?n.hide():(e={isModal:!1,showCloseIcon:!0,cssClass:"e-find-dlg",header:(e=this.parent.serviceLocator.getService(ope)).getConstant("FindAndReplace"),beforeOpen:function(e){var t={dialogName:"FindAndReplaceDialog",element:e.element,target:e.target,cancel:e.cancel};i.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(n.dialogInstance.content=i.findandreplaceContent(),n.dialogInstance.dataBind(),sce(i.parent.element))},buttons:[{buttonModel:{content:e.getConstant("FindPreviousBtn"),isPrimary:!0,cssClass:"e-btn-findPrevious",disabled:!0},click:function(e){i.dialogMessage(),i.findHandler({findOption:e&&13===e.keyCode?"next":"prev"})}},{buttonModel:{content:e.getConstant("FindNextBtn"),isPrimary:!0,cssClass:"e-btn-findNext",disabled:!0},click:function(){i.dialogMessage(),i.findHandler({findOption:"next"})}},{buttonModel:{content:e.getConstant("ReplaceBtn"),isPrimary:!0,cssClass:"e-btn-replace",disabled:!0},click:function(){i.dialogMessage(),i.replaceHandler(yne)}},{buttonModel:{content:e.getConstant("ReplaceAllBtn"),isPrimary:!0,cssClass:"e-btn-replaceAll",disabled:!0},click:function(){i.dialogMessage(),i.replaceHandler(vne)}}],open:function(){var e=i.parent.element.querySelector(".e-text-findNext");e.value&&(At(i.parent.element.querySelector(".e-btn-findPrevious"),"btn").disabled=!1,At(i.parent.element.querySelector(".e-btn-findNext"),"btn").disabled=!1),cpe(function(){sce(e)})},beforeClose:this.dialogBeforeClose.bind(this)},n.show(e))},fue.prototype.dialogBeforeClose=function(){var e=this.checkBoxElements;e&&e.element&&(e.destroy(),e.element.remove()),this.checkBoxElements=null,this.textBoxElements.forEach(function(e){e&&e.element&&(e.destroy(),e.element.remove())}),this.textBoxElements=[],this.dropDownListElements.forEach(function(e){e&&e.element&&(e.destroy(),e.element.remove())}),this.dropDownListElements=[],fce(this.paraElements),this.paraElements=[],fce(this.inputElements),this.inputElements=[],fce(this.divElements),this.divElements=[]},fue.prototype.dialogMessage=function(){this.parent.element.querySelector(".e-replace-alert-span")?this.parent.element.querySelector(".e-replace-alert-span").remove():this.parent.element.querySelector(".e-find-alert-span")&&this.parent.element.querySelector(".e-find-alert-span").remove()},fue.prototype.renderGotoDlg=function(){var i=this,e=this.parent.serviceLocator.getService(ope),n=this.parent.serviceLocator.getService(rpe);je(this.parent.element.querySelector(".e-goto-dlg"))?(e={width:300,isModal:!1,showCloseIcon:!0,cssClass:"e-goto-dlg",header:e.getConstant("GotoHeader"),beforeOpen:function(e){var t={dialogName:"GoToDialog",element:e.element,target:e.target,cancel:e.cancel};i.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(n.dialogInstance.content=i.GotoContent(),n.dialogInstance.dataBind(),sce(i.parent.element))},buttons:[{buttonModel:{content:e.getConstant("Ok"),isPrimary:!0,cssClass:"e-btn-goto-ok"},click:function(){i.gotoHandler()&&n.hide()}}],open:function(){i.textFocus()}},n.show(e,!1)):n.hide()},fue.prototype.textFocus=function(){var e=this;this.parent.element.querySelector(".e-text-goto").addEventListener("focus",function(){e.parent.element.querySelector(".e-goto-alert-span")&&e.parent.element.querySelector(".e-goto-alert-span").remove()})},fue.prototype.findHandler=function(e){var t,i,n,o,r,s=this.parent.element.querySelector(".e-text-findNext"),a=((s=s||this.parent.element.querySelector(".e-text-findNext-short"))||this.gotoAlert(),s.value);""===s.value||(s=this.parent.getActiveSheet()).isProtected&&!s.protectSettings.selectCells&&!s.protectSettings.selectUnLockedCells||(s=this.parent.activeSheetIndex,t=void 0,t=!!(i=this.parent.element.querySelector(".e-findnreplace-checkcase"))&&At(i,"checkbox").checked,i=void 0,i=!!(n=this.parent.element.querySelector(".e-findnreplace-checkmatch"))&&At(n,"checkbox").checked,n=void 0,n=(o=this.parent.element.querySelector(".e-findnreplace-searchby"))?At(o,"dropdownlist").value.toString():"By Row",o=void 0,o=(r=this.parent.element.querySelector(".e-findnreplace-searchwithin"))?At(r,"dropdownlist").value.toString():"Sheet",r={value:a,sheetIndex:s,findOpt:e.findOption,mode:o,isCSen:t,isEMatch:i,searchBy:n,isAction:!0},this.parent.find(r))},fue.prototype.replaceHandler=function(e){var t=this.parent.element.querySelector(".e-find-dlg").querySelector(".e-text-findNext").value,i=this.parent.element.querySelector(".e-text-replaceInp").value,n=this.parent.element.querySelector(".e-findnreplace-checkcase").checked,o=this.parent.element.querySelector(".e-findnreplace-checkmatch").checked,r=this.parent.element.querySelector(".e-search-within .e-ddl-hidden").value,s=this.parent.element.querySelector(".e-searchby .e-ddl-hidden").value;this.parent.notify(e,{value:t,mode:r,isCSen:n,isEMatch:o,searchBy:s,findOpt:"next",replaceValue:i,replaceBy:e,sheetIndex:this.parent.activeSheetIndex,isAction:!0})},fue.prototype.gotoHandler=function(e){var t=!0;if(e)this.parent.goTo(e.address);else{for(var i=this.parent.element.querySelector(".e-text-goto").value,n=0;n<this.parent.definedNames.length;n++)if(this.parent.definedNames[n].name===i){i=this.parent.definedNames[n].refersTo.slice(1);break}var e=i,o=(e=(e=(e=i.includes("!")?i.substring(i.lastIndexOf("!")+1):e).split("$").join("")).includes(":")?e.split(":")[0]:e).match(/\d+/),r=e.match(/[A-Z]+/i);!o||!r||0!==r.index||(o=fte(rte(e)),r=this.parent.getActiveSheet(),1048576<=o[2])||16384<=o[3]?(this.gotoAlert(),t=!1):this.parent.scrollSettings.isFinite&&(r.rowCount<o[2]+1||r.colCount<o[3]+1)?(this.parent.notify(tle,null),t=!1):this.parent.goTo(i)}return t},fue.prototype.gotoAlert=function(){var e=this.parent.serviceLocator.getService(ope),t=this.parent.createElement("span",{className:"e-goto-alert-span"});t.innerText=e.getConstant("InsertingEmptyValue"),this.parent.element.querySelector(".e-goto-alert-span")&&this.parent.element.querySelector(".e-goto-alert-span").remove(),this.parent.element.querySelector(".e-goto-dlg").querySelector(".e-dlg-content").appendChild(t)},fue.prototype.showFindAlert=function(){this.parent.element.querySelector(".e-replace-alert-span")&&this.parent.element.querySelector(".e-replace-alert-span").remove();var e,t=this.parent.element.querySelector(".e-find-dlg .e-dlg-content");t&&((e=this.parent.createElement("span",{className:"e-find-alert-span"})).innerText=this.parent.serviceLocator.getService(ope).getConstant("NoElements"),t.appendChild(e))},fue.prototype.replaceAllDialog=function(e){this.parent.element.querySelector(".e-find-alert-span")&&this.parent.element.querySelector(".e-find-alert-span").remove();var t=this.parent.element.querySelector(".e-replace-alert-span"),t=(t&&t.remove(),this.parent.serviceLocator.getService(ope)),i=this.parent.createElement("span",{className:"e-replace-alert-span"});i.innerText=e.count+t.getConstant("ReplaceAllEnd")+e.replaceValue,this.parent.element.querySelector(".e-find-dlg")&&this.parent.element.querySelector(".e-find-dlg").querySelector(".e-dlg-content").appendChild(i)},fue.prototype.findKeyUp=function(e){e.target.classList.contains("e-text-findNext")&&(je(e=this.parent.element.querySelector(".e-text-findNext").value)||""===e?(At(this.parent.element.querySelector(".e-btn-findPrevious"),"btn").disabled=!0,At(this.parent.element.querySelector(".e-btn-findNext"),"btn").disabled=!0,this.dialogMessage()):(At(this.parent.element.querySelector(".e-btn-findPrevious"),"btn").disabled=!1,At(this.parent.element.querySelector(".e-btn-findNext"),"btn").disabled=!1));var e=this.parent.element.querySelector(".e-text-findNext").value,t=this.parent.element.querySelector(".e-text-replaceInp").value;je(e)||je(t)||""===e||""===t?(At(this.parent.element.querySelector(".e-btn-replace"),"btn").disabled=!0,At(this.parent.element.querySelector(".e-btn-replaceAll"),"btn").disabled=!0):this.parent.getActiveSheet().isProtected||(At(this.parent.element.querySelector(".e-btn-replace"),"btn").disabled=!1,At(this.parent.element.querySelector(".e-btn-replaceAll"),"btn").disabled=!1)},fue.prototype.findandreplaceContent=function(){this.parent.element.querySelector(".e-text-findNext-short")&&(this.shortValue=this.parent.element.querySelector(".e-text-findNext-short").value);var e=this.parent.createElement("div",{className:"e-link-dialog"}),t=this.parent.createElement("div",{className:"e-find"}),i=this.parent.createElement("div",{className:"e-findCheck"}),n=(this.divElements.push(e),this.divElements.push(t),this.divElements.push(i),this.parent.serviceLocator.getService(ope)),o=(e.appendChild(t),this.parent.createElement("div",{className:"e-cont"})),r=this.parent.createElement("p",{className:"e-header"}),s=(r.innerText=n.getConstant("FindWhat"),this.parent.createElement("input",{className:"e-input e-text-findNext",attrs:{type:"Text",placeholder:n.getConstant("FindValue"),value:this.shortValue}})),r=(this.divElements.push(o),this.paraElements.push(r),this.inputElements.push(s),o.appendChild(s),o.insertBefore(r,s),t.appendChild(o),new fV({width:"70%"})),o=(this.textBoxElements.push(r),r.createElement=this.parent.createElement,r.appendTo(s),this.parent.createElement("div",{className:"e-cont"})),r=this.parent.createElement("p",{className:"e-header"}),s=(r.innerText=n.getConstant("ReplaceWith"),this.parent.createElement("input",{className:"e-input e-text-replaceInp",attrs:{type:"Text",placeholder:n.getConstant("ReplaceValue")}})),r=(this.divElements.push(o),this.paraElements.push(r),this.inputElements.push(s),o.appendChild(s),o.insertBefore(r,s),t.appendChild(o),new fV({width:"70%"})),o=(this.textBoxElements.push(r),r.createElement=this.parent.createElement,r.appendTo(s),[{Id:"Sheet",Within:n.getConstant("Sheet")},{Id:"Workbook",Within:n.getConstant("Workbook")}]),r=new qz({dataSource:o,cssClass:"e-search-within",fields:{value:"Id",text:"Within"},width:"50%",index:0}),s=(this.dropDownListElements.push(r),n.getConstant("SearchWithin")),o=this.parent.createElement("input",{className:"e-findnreplace-searchwithin",attrs:{type:"select",label:s}}),a=this.parent.createElement("p",{className:"e-header"}),a=(a.innerText=s,this.inputElements.push(o),this.paraElements.push(a),t.appendChild(a),t.appendChild(o),r.createElement=this.parent.createElement,r.appendTo(o),[{Id:"By Row",Search:n.getConstant("ByRow")},{Id:"By Column",Search:n.getConstant("ByColumn")}]),r=new qz({dataSource:a,cssClass:"e-searchby",fields:{value:"Id",text:"Search"},width:"50%",index:0}),o=(this.dropDownListElements.push(r),s=n.getConstant("SearchBy"),this.parent.createElement("input",{className:"e-findnreplace-searchby",attrs:{type:"select",label:s}})),a=this.parent.createElement("p",{className:"e-header"}),s=(a.innerText=s,this.inputElements.push(o),this.paraElements.push(a),t.appendChild(a),t.appendChild(o),r.createElement=this.parent.createElement,r.appendTo(o),new ib({label:n.getConstant("MatchCase"),checked:!1,cssClass:"e-findnreplace-casecheckbox"})),a=this.parent.createElement("input",{className:"e-findnreplace-checkcase",attrs:{type:"checkbox"}}),r=(this.inputElements.push(a),i.appendChild(a),s.createElement=this.parent.createElement,s.appendTo(a),new ib({label:n.getConstant("MatchExactCellElements"),checked:!1,cssClass:"e-findnreplace-exactmatchcheckbox"})),o=(this.checkBoxElements=r,this.parent.createElement("input",{className:"e-findnreplace-checkmatch",attrs:{type:"checkbox"}}));return this.inputElements.push(o),i.appendChild(o),r.createElement=this.parent.createElement,r.appendTo(o),t.appendChild(i),e},fue.prototype.GotoContent=function(){var e=this.parent.serviceLocator.getService(ope),t=this.parent.createElement("div",{className:"e-link-dialog"}),i=this.parent.createElement("div",{className:"e-goto"}),n=(t.appendChild(i),this.parent.createElement("div",{className:"e-cont"})),o=this.parent.createElement("p",{className:"e-header"}),e=(o.innerText=e.getConstant("Reference"),new fV({placeholder:e.getConstant("EnterCellAddress")})),r=this.parent.createElement("input",{className:"e-text-goto",attrs:{type:"Text"}});return n.appendChild(r),n.insertBefore(o,r),i.appendChild(n),e.createElement=this.parent.createElement,e.appendTo(r),t},fue.prototype.destroy=function(){this.removeEventListener(),this.findDialog&&this.findDialog.hide(),this.parent=null},fue.prototype.getModuleName=function(){return"findAndReplace"};var mue=fue;function fue(e){this.shortValue="",this.divElements=[],this.paraElements=[],this.inputElements=[],this.textBoxElements=[],this.dropDownListElements=[],this.parent=e,this.addEventListener()}vue.prototype.merge=function(e){this.parent.serviceLocator.getService("cell").refresh(e.rowIdx,e.colIdx,e.lastCell,e.element,!1,!1,nre(this.parent))},vue.prototype.hideHandler=function(e){var t,i=this.parent.getActiveSheet(),n={range:[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx]},o=(this.parent.notify(Rne,n),Kre(n.range[0],n.range[1],i)||{}),r="row"===e.model?n.range[0]:n.range[1],s=r+((o[e.model+"Span"]||1)-1);!e.isEnd&&(e.start===r||epe(i,r))||e.isEnd&&e.start>r&&!epe(i,r)||1<o[e.model+"Span"]&&s>=e.start&&(("row"===e.model?zde:epe)(i,r)?e.colIdx<=s&&(r=Woe(i,n.range[1],!0,"columns"))<=s&&(t=n.range[0],1<o.rowSpan&&(t=(t=Woe(i,n.range[0],!0))<=n.range[2]?t:n.range[0]),e=this.parent.getCell(t,r))&&(e.style.display="",this.parent.serviceLocator.getService("cell").refresh(n.range[0],n.range[1],!0,e,!0,!0)):(t=1<o.rowSpan?Woe(i,n.range[0],!0):n.range[0],this.merge({rowIdx:n.range[0],colIdx:n.range[1],element:this.parent.getCell(t,n.range[1])})))},vue.prototype.checkPrevMerge=function(a){function e(e){if(l.range=l.range,zde(d,l.range[0])&&a.rowIdx>=l.range[0]&&a.rowIdx<=l.range[2]){r=!1;for(var t,i=l.range[0];i<a.rowIdx;i++)if(!zde(d,i)){r=!0;break}1<n.rowSpan&&!r&&0<(t=n.rowSpan-h.parent.hiddenCount(l.range[0],l.range[2]))&&(p(),a.td.style.display="",a.colSpan=o,a.rowSpan=t,a.cell=n,a.isMerged=!1)}else if(e){for(i=l.range[0];s&&i<a.rowIdx;i++)if(!zde(d,i)){r=!0;break}r||(p(),a.td.style.display="",a.colSpan=o,a.cell=n,a.isMerged=!1)}}var n,l,o,r,s,h=this,d=this.parent.getActiveSheet(),p=function(){var e=h.parent.getContentTable(),t=e&&e.rows[0];if(t){var i=parseInt(t.getAttribute("aria-rowindex"),10)-1;if(l.range=l.range,i>h.parent.viewport.topIndex+h.parent.frozenRowCount(d)&&i>l.range[0]&&i<=l.range[2]){var n=void 0,e=h.parent.getRowHeaderTable(),o=e&&e.rows[0],r=h.parent.frozenColCount(d);if(!r||o)for(var s=a.colIdx;s<=l.range[3];s++)(n=h.parent.getCell(i,s,s<r?o:t))&&(1<n.colSpan||1<n.rowSpan)&&(n.style.display="none",n.removeAttribute("colSpan"),n.removeAttribute("rowSpan"))}}};if(a.cell.colSpan<0){if(-1<a.colIdx-1&&epe(d,a.colIdx-1)&&(n=Kre(a.rowIdx,a.colIdx-1,d,!1,!0),s=-1<a.rowIdx-1&&zde(d,a.rowIdx-1),void 0!==n.colSpan||void 0!==n.rowSpan)&&(void 0===n.rowSpan||1<n.rowSpan||s)&&(l={range:[a.rowIdx,a.colIdx-1,a.rowIdx,a.colIdx-1]},this.parent.notify(Rne,l),l.range,n=Kre(l.range[0],l.range[1],d,!1,!0),epe(d,l.range[1]))&&a.colIdx>=l.range[1]&&a.colIdx<=l.range[3]){for(var t=l.range[1];t<a.colIdx;t++)if(!epe(d,t)){r=!0;break}1<n.colSpan&&!r&&0<(o=n.colSpan-this.parent.hiddenCount(l.range[1],l.range[3],"columns"))&&e(!0)}}else-1<a.rowIdx-1&&zde(d,a.rowIdx-1)&&void 0!==(n=Kre(a.rowIdx-1,a.colIdx,d,!1,!0)).rowSpan&&(l={range:[a.rowIdx-1,a.colIdx,a.rowIdx-1,a.colIdx]},this.parent.notify(Rne,l),l.range=l.range,n=Kre(l.range[0],l.range[1],d,!1,!0),e())},vue.prototype.checkMerge=function(e){var t,i=this.parent.getActiveSheet(),n=Kre(e.rowIdx,e.colIdx,i)||{};if(e.isRow){if(void 0===n.colSpan||epe(i,e.colIdx-1))if((t={range:[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx]}).range,this.parent.notify(Rne,t),epe(i,e.colIdx-1)&&!epe(i,t.range[1])||e.isFreezePane&&t.range[0]<this.parent.frozenRowCount(i))e.insideFreezePane=t.range[0]<this.parent.frozenRowCount(i);else{if(e.colIdx!==this.parent.viewport.leftIndex+this.parent.frozenColCount(i)&&epe(i,e.colIdx-1))for(var o=t.range[1];void 0!==n.colSpan&&o<e.colIdx;o++)if(!epe(i,o))return;var r,n=Kre(t.range[0],t.range[1],i);1<=(r=t.range[2]-e.rowIdx+1-this.parent.hiddenCount(e.rowIdx,t.range[2]))&&(this.merge({rowIdx:t.range[0],colIdx:t.range[1],element:e.td}),1===r?e.td.removeAttribute("rowspan"):e.td.rowSpan=r,e.td.style.display="")}}else if(void 0===n.rowSpan||zde(i,e.rowIdx-1))if((t={range:[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx]}).range=t.range,this.parent.notify(Rne,t),zde(i,e.rowIdx-1)&&!zde(i,t.range[0])||e.isFreezePane&&t.range[1]<this.parent.frozenColCount(i))e.insideFreezePane=t.range[1]<this.parent.frozenColCount(i);else{if(e.rowIdx!==this.parent.viewport.topIndex+this.parent.frozenRowCount(i)&&zde(i,e.rowIdx-1))for(var s=t.range[0];void 0!==n.rowSpan&&s<e.rowIdx;s++)if(!zde(i,s))return;n=Kre(t.range[0],t.range[1],i),1<=(r=t.range[3]-e.colIdx+1-this.parent.hiddenCount(e.colIdx,t.range[3],"columns"))&&(this.merge({rowIdx:t.range[0],colIdx:t.range[1],element:e.td}),1===r?e.td.removeAttribute("colspan"):e.td.colSpan=r,e.td.style.display="")}},vue.prototype.addEventListener=function(){this.parent.on(Fne,this.merge,this),this.parent.on(rle,this.hideHandler,this),this.parent.on(sle,this.checkPrevMerge,this),this.parent.on(ale,this.checkMerge,this)},vue.prototype.destroy=function(){this.removeEventListener(),this.parent=null},vue.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Fne,this.merge),this.parent.off(rle,this.hideHandler),this.parent.off(sle,this.checkPrevMerge),this.parent.off(ale,this.checkMerge))},vue.prototype.getModuleName=function(){return"merge"};var yue=vue;function vue(e){this.parent=e,this.addEventListener()}wue.prototype.destroy=function(){this.removeEventListener(),this.dupData&&(this.dupData=[]),this.colorData&&(this.colorData=[]),this.parent=null},wue.prototype.addEventListener=function(){this.parent.on(_ne,this.applyCF,this),this.parent.on(cle,this.renderCFDlg,this),this.parent.on(jne,this.clearCF,this)},wue.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(_ne,this.applyCF),this.parent.off(cle,this.renderCFDlg),this.parent.off(jne,this.clearCF))},wue.prototype.clearCF=function(e){var l=this,t=this.parent.getActiveSheet();this.updateRange(t,e.indexes,this.parent.frozenRowCount(t),this.parent.frozenColCount(t),ste(t.topLeftCell),function(t,i,n,o){var r,s,a;q([o],["e-redft","e-yellowft","e-greenft","e-redf","e-redt","e-iconset"]),["backgroundColor","color"].forEach(function(e){o.style[""+e]&&(o.style[""+e]="",r=n&&n.style&&n.style[""+e]||l.parent.commonCellStyle[""+e])&&((s={})[""+e]=r,l.parent.notify(Mie,{style:s,rowIdx:t,colIdx:i,td:o}))}),[".e-cf-databar",".e-iconsetspan"].forEach(function(e){a=o.querySelector(e);e=o.querySelector(".e-wrap-content");a&&((e||o).removeChild(a),o.textContent=l.parent.getDisplayText(n))})})},wue.prototype.renderCFDlg=function(i){var t,n=this,e=this.parent.serviceLocator.getService(ope),o=this.parent.serviceLocator.getService(rpe);o.show({width:375,showCloseIcon:!0,isModal:!0,cssClass:"e-conditionalformatting-dlg",header:i.action.replace("...",""),beforeOpen:function(e){var t={dialogName:"ConditionalFormatDialog",element:e.element,target:e.target,cancel:e.cancel};n.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(o.dialogInstance.content=n.cfDlgContent(i.action),o.dialogInstance.dataBind(),sce(n.parent.element))},beforeClose:this.dialogBeforeClose.bind(this),close:function(){t&&(n.parent.notify(ele,null),t=!1)},buttons:[{buttonModel:{content:e.getConstant("Ok"),isPrimary:!0},click:function(){var e=n.parent.getActiveSheet();are(n.parent,fte(rte(e.selectedRange)))?t=!0:n.dlgClickHandler(i.action),o.hide()}}]})},wue.prototype.dialogBeforeClose=function(){var e=this.numericTBElements;e&&e.element&&(e.destroy(),e.element.remove()),this.numericTBElements=null,this.dropDownListElements.forEach(function(e){e&&e.element&&(e.destroy(),e.element.remove())}),this.dropDownListElements=[],this.value1Inp&&(this.value1Inp.removeEventListener("input",this.validateCFInput.bind(this)),this.value1Inp.parentNode&&this.value1Inp.parentNode.removeChild(this.value1Inp),this.value1Inp=null),this.value2Inp&&(this.value2Inp.removeEventListener("input",this.validateCFInput.bind(this)),this.value2Inp.parentNode&&this.value2Inp.parentNode.removeChild(this.value2Inp),this.value2Inp=null),fce(this.spanElements),this.spanElements=[],fce(this.inputElements),this.inputElements=[],fce(this.divElements),this.divElements=[]},wue.prototype.dlgClickHandler=function(e){var t=this.parent.serviceLocator.getService(ope),i=this.parent.element.querySelector(".e-conditionalformatting-dlg .e-dlg-content .e-cf-dlg"),n={cFColor:this.getCFColor(i.querySelector(".e-cfsub .e-input").value),range:this.parent.getActiveSheet().selectedRange},i=i.querySelectorAll(".e-cfmain .e-input");e===t.getConstant("DuplicateValues")+"..."?n.type=i[0].value===t.getConstant("Duplicate")?"Duplicate":"Unique":(n.type=this.getType(e),t=[],i[0]&&t.push(i[0].value),i[1]&&t.push(i[1].value),ere(t,this.parent),n.value=t.join(",")),this.parent.notify(Vne,{cfModel:n,isAction:!0})},wue.prototype.getType=function(e){var t,i=this.parent.serviceLocator.getService(ope);switch(e){case i.getConstant("GreaterThan")+"...":t="GreaterThan";break;case i.getConstant("LessThan")+"...":t="LessThan";break;case i.getConstant("Between")+"...":t="Between";break;case i.getConstant("CFEqualTo")+"...":t="EqualTo";break;case i.getConstant("TextThatContains")+"...":t="ContainsText";break;case i.getConstant("ADateOccuring")+"...":t="DateOccur";break;case i.getConstant("Top10Items")+"...":t="Top10Items";break;case i.getConstant("Bottom10Items")+"...":t="Bottom10Items";break;case i.getConstant("Top10")+" %...":t="Top10Percentage";break;case i.getConstant("Bottom10")+" %...":t="Bottom10Percentage";break;case i.getConstant("AboveAverage")+"...":t="AboveAverage";break;case i.getConstant("BelowAverage")+"...":t="BelowAverage"}return t},wue.prototype.getCFColor=function(e){var t=this.parent.serviceLocator.getService(ope),i="RedFT";switch(e){case t.getConstant("LightRedFillWithDarkRedText"):i="RedFT";break;case t.getConstant("YellowFillWithDarkYellowText"):i="YellowFT";break;case t.getConstant("GreenFillWithDarkGreenText"):i="GreenFT";break;case t.getConstant("RedFill"):i="RedF";break;case t.getConstant("RedText"):i="RedT"}return i},wue.prototype.cfDlgContent=function(e){var t,i=this.getDlgText(e),n=this.parent.serviceLocator.getService(ope),o=this.parent.createElement("div",{className:"e-cf-dlg"}),r=this.parent.createElement("div",{className:"e-cfmain"}),s=this.parent.createElement("div",{className:"e-cfsub"}),a=(this.divElements.push(o),this.divElements.push(r),this.divElements.push(s),this.parent.createElement("span",{className:"e-header e-top-header"})),i=(a.innerText=i,this.value1Inp=this.parent.createElement("input",{className:"e-input",id:"valueInput",attrs:{type:"text","aria-label":i}}),this.parent.createElement("input",{className:"e-select"})),l=this.parent.createElement("span",{className:"e-header"}),h=(l.innerText=n.getConstant("With"),this.parent.createElement("input",{className:"e-select"})),i=(this.spanElements.push(a),this.inputElements.push(i),this.spanElements.push(l),this.inputElements.push(h),o.appendChild(r),o.appendChild(s),r.appendChild(a),e!==n.getConstant("DuplicateValues")+"..."?e!==n.getConstant("AboveAverage")+"..."&&e!==n.getConstant("BelowAverage")+"..."&&(r.appendChild(this.value1Inp),t=!0,a=e===n.getConstant("Top10")+" %..."||e===n.getConstant("Bottom10")+" %...",e!==n.getConstant("Top10Items")+"..."&&e!==n.getConstant("Bottom10Items")+"..."&&!a||(this.value1Inp.maxLength=a?3:4,a=new NL({value:10,min:1,max:a?100:1e3,format:"###"}),(this.numericTBElements=a).appendTo(this.value1Inp))):(r.appendChild(i),this.dupData=[{text:n.getConstant("Duplicate"),id:"duplicate"},{text:n.getConstant("Unique"),id:"unique"}],a=new qz({dataSource:this.dupData,index:0,popupHeight:"200px"}),this.dropDownListElements.push(a),a.appendTo(i)),e===n.getConstant("Between")+"..."&&((a=this.parent.createElement("span",{className:"e-header e-header-2"})).innerText=n.getConstant("And"),this.value2Inp=this.parent.createElement("input",{className:"e-input e-between"}),this.spanElements.push(a),r.appendChild(a),r.appendChild(this.value2Inp),this.value2Inp.addEventListener("input",this.validateCFInput.bind(this))),t&&(this.validateCFInput({target:this.value1Inp}),this.value1Inp.addEventListener("input",this.validateCFInput.bind(this))),s.appendChild(l),s.appendChild(h),this.colorData=[{text:n.getConstant("LightRedFillWithDarkRedText"),value:"redft",id:"redft"},{text:n.getConstant("YellowFillWithDarkYellowText"),id:"yellowft"},{text:n.getConstant("GreenFillWithDarkGreenText"),id:"greenft"},{text:n.getConstant("RedFill"),id:"redf"},{text:n.getConstant("RedText"),id:"redt"}],new qz({dataSource:this.colorData,index:0,popupHeight:"200px"}));return this.dropDownListElements.push(i),i.appendTo(h),o},wue.prototype.validateCFInput=function(e){var t=this.parent.serviceLocator.getService(rpe),i=e.target.value,t=t.dialogInstance.element.getElementsByClassName("e-primary")[0];i&&(e.target.classList.contains("e-between")||e.target.parentElement.querySelector(".e-between"))&&(i=e.target.parentElement.querySelector(e.target.classList.contains("e-between")?".e-input":".e-between").value),t.disabled=!i.trim()},wue.prototype.checkCellHandler=function(t,i,e){return e.range.trim().split(",").some(function(e){e=rte(e.includes(":")?e:e+":"+e);return t>=e[0]&&t<=e[2]&&i>=e[1]&&i<=e[3]})},wue.prototype.getDlgText=function(e){var t=this.parent.serviceLocator.getService(ope),i="";switch(e){case t.getConstant("GreaterThan")+"...":i=t.getConstant("FormatCellsGreaterThan");break;case t.getConstant("LessThan")+"...":i=t.getConstant("FormatCellsLessThan");break;case t.getConstant("Between")+"...":i=t.getConstant("FormatCellsBetween");break;case t.getConstant("CFEqualTo")+"...":i=t.getConstant("FormatCellsEqualTo");break;case t.getConstant("TextThatContains")+"...":i=t.getConstant("FormatCellsThatContainTheText");break;case t.getConstant("ADateOccuring")+"...":i=t.getConstant("FormatCellsThatContainADateOccurring");break;case t.getConstant("DuplicateValues")+"...":i=t.getConstant("FormatCellsDuplicate");break;case t.getConstant("Top10Items")+"...":case t.getConstant("Top10")+" %...":i=t.getConstant("FormatCellsTop");break;case t.getConstant("Bottom10Items")+"...":case t.getConstant("Bottom10")+" %...":i=t.getConstant("FormatCellsBottom");break;case t.getConstant("AboveAverage")+"...":i=t.getConstant("FormatCellsAbove");break;case t.getConstant("BelowAverage")+"...":i=t.getConstant("FormatCellsBelow")}return i},wue.prototype.updateResult=function(e,t,i,n,o,r,s,a){for(var l,h,d,p={},c={},u=e.range.split(","),g=[],m=i?function(){var e;mre(l)&&"Text"!==d&&(0<=(e=parseFloat(l))?(void 0===g[0]||e>g[0])&&(g[0]=e):(void 0===g[1]||e<g[1])&&(g[1]=e))}:n?function(){var e;mre(l)&&"Text"!==d&&(e=parseFloat(l),g.push(Number(e)))}:o?(g=[0,0],function(){mre(l)&&"Text"!==d&&(g[0]+=parseFloat(l),g[1]++)}):r?function(){mre(l)&&"Text"!==d&&g.push(parseFloat(l))}:s?function(){var e;mre(l)&&"Text"!==d&&(e=parseFloat(l),(void 0===g[0]||e<g[0])&&(g[0]=e),void 0===g[1]||e>g[1])&&(g[1]=e)}:function(){p[""+l]?""===l||c[""+l]||(c[""+l]=!0,g.push(l)):p[""+l]=!0},f=0;f<u.length;f++)for(var y,v=(y=rte(u[f]))[0];v<=y[2];v++)for(var b=y[1];b<=y[3];b++)h=Kre(v,b,t,!1,!0),d="",je(h.value)?h.formula&&(this.parent.notify(xie,{cell:h,rowIdx:v,colIdx:b,sheetIndex:this.parent.activeSheetIndex}),l=h.value.toString().toLowerCase(),d=Yhe(h.format),m()):(l=h.value.toString().toLowerCase(),d=Yhe(h.format),m());n||r?(g=g.sort(function(e,t){return e-t}),e.type.includes("Bottom")||(g=g.reverse()),r&&(i=parseFloat(a),e.type.includes("Percentage")&&(i=(i/=100/g.length)<1?1:i),g=g.slice(0,i))):o&&!(g=[g[0]/g[1]])[0]&&(g=[]),e.result=g},wue.prototype.applyCF=function(e){for(var t=!e.cfModel,i=this.parent.getActiveSheet(),n=e.cfModel||i.conditionalFormats,o=[e.indexes],r=(e.refreshAll&&(o=tre(this.parent,this.parent.viewport)),{}),s=n.length-1;0<=s;s--)t&&(2===o[0].length?!this.checkCellHandler(e.indexes[0],e.indexes[1],n[s]):!$oe(o,n[s].range))||this.updateCF(e,i,n[s],r)},wue.prototype.updateCF=function(g,e,m,f){var y,v,b=this,w="",t=!1;if(m.value){var i=[];if("Between"===m.type?1<(s=m.value.split('"').filter(function(e){return e.trim()&&","!==e.trim()})).length?(i=s,t=!0):i=m.value.split(",").filter(function(e){return!!e.trim()}):i=[m.value],1<i.length)if(1<i[0].split("(").length){for(var n="",o=0;o<i.length;o++)(n+=i[o]+",").split("(").length===n.split(")").length&&void 0===C&&(C=n.substring(0,n.length-1),n="");w=n.substring(0,n.length-1)}else for(var C=i[0],o=1;o<i.length;o++)w+=o+1===i.length?i[o]:i[o]+",";else C=i[0]||m.value}m.type||(m.type="GreaterThan"),m.format&&m.format.style?(y=Zre(m.format.style,!0),Object.keys(y).length||(v=(v=m.cFColor)||(m.cFColor="RedFT"))):(y={},v=(v=m.cFColor)||(m.cFColor="RedFT"));function r(e,t,i,n,o,r){var s,a,l=i&&!je(i.value)?i.value.toString():"",h=!0,d=i?Yhe(i.format):"";switch(m.type){case"GreaterThan":case"LessThan":s=b.isGreaterThanLessThan(m,l,C,d);break;case"Between":s=mre(l)&&"Text"!==d&&b.isBetWeen(m,l,C,w,r);break;case"EqualTo":s=b.isEqualTo(m,l,C);break;case"ContainsText":s=l&&C&&b.isContainsText(l,C);break;case"DateOccur":p={value:C,cell:{},updatedVal:C},mre(C)||b.parent.notify(Fie,p),s=l===p.updatedVal;break;case"Unique":s=""!==l&&-1===m.result.indexOf(l.toLowerCase());break;case"Duplicate":s=-1<m.result.indexOf(l.toLowerCase());break;case"Top10Items":case"Bottom10Items":case"Top10Percentage":case"Bottom10Percentage":m.result&&(u=parseFloat(l),gre(l)&&(u=ure(l)),s=-1<m.result.indexOf(u));break;case"AboveAverage":s=m.result.length&&mre(l)&&"Text"!==d&&parseFloat(l)>m.result[0];break;case"BelowAverage":s=m.result.length&&mre(l)&&"Text"!==d&&parseFloat(l)<m.result[0];break;default:var p,c,u,h=!1;S?f[e+"_"+t+"_bars"]||(f[e+"_"+t+"_bars"]=!0,b.applyDataBars(l,m,n,e,d,o)):A?f[e+"_"+t]||(u=mre(l)?parseFloat(l):NaN,isNaN(u)?!n.style.backgroundColor||n.classList.contains("e-yellowft")||n.classList.contains("e-greenft")||n.classList.value.includes("e-redf")||(n.style.backgroundColor="",(p=Pe({},b.parent.commonCellStyle,i&&i.style)).backgroundColor&&b.parent.notify(Mie,{style:{backgroundColor:p.backgroundColor},td:n,rowIdx:e,colIdx:t})):-1===(u=(p=m.result).indexOf(u))?n.style.backgroundColor&&(n.style.backgroundColor="",(c=Pe({},b.parent.commonCellStyle,i&&i.style)).backgroundColor)&&b.parent.notify(Mie,{style:{backgroundColor:c.backgroundColor},td:n,rowIdx:e,colIdx:t}):(c=b.getColor(m.type),n.style.backgroundColor=0===u?c[0]:u===p.length-1?c[c.length-1]:3===p.length&&1===u?c[1]:b.getGradient(u,c[0],c[1],c[2],p.length),f[e+"_"+t]=!0)):f[e+"_"+t+"_icons"]||(f[e+"_"+t+"_icons"]=!0,u=b.parent.createElement("span",{className:"e-icon e-iconsetspan"}),b.applyIconSet(l,m,n,u,d)&&i&&i.format&&i.format.includes("*")&&"Accounting"!==Yhe(i.format)&&b.parent.notify(aoe,{cell:i,cellEle:n,rowIdx:e,colIdx:t,updateFillSize:!0,iconSetSpan:u}))}g.isAction&&h&&(b.parent.trigger("beforeConditionalFormat",{conditionalFormat:m,cell:i,element:n,apply:s,address:lte(e,t)}),s||!g.isEdit||f[e+"_"+t]||(v?n.className.includes("e-"+v.toLowerCase())&&(n.classList.remove("e-"+v.toLowerCase()),n.style.backgroundColor="",n.style.color="",(a=Pe({},b.parent.commonCellStyle,i&&i.style)).backgroundColor||a.color)&&b.parent.notify(Mie,{rowIdx:e,colIdx:t,td:n,style:{backgroundColor:a.backgroundColor,color:a.color}}):(n.removeAttribute("style"),a=Pe({},b.parent.commonCellStyle,i&&i.style),Object.keys(a).length&&b.parent.notify(Mie,{style:a,rowIdx:e,colIdx:t,td:n})))),s&&!f[e+"_"+t]&&(f[e+"_"+t]=!0,q([n],["e-redft","e-yellowft","e-greenft","e-redf","e-redt"]),v&&(n.classList.add("e-"+v.toLowerCase()),b.setCFStyle(y,m)),Object.assign(n.style,y))}var s=m.type.includes("Average"),a=m.type.includes("10")&&mre(C),l=m.type.includes("Three")||m.type.includes("Four")||m.type.includes("Five"),S=m.type.includes("DataBar"),A=m.type.includes("ColorScale");g.isRender&&m.result||!("Duplicate"===m.type||"Unique"===m.type||S||A||s||a||l)||this.updateResult(m,e,S,A,s,a,l,C);if(g.ele)r(g.indexes[0],g.indexes[1],g.cell,g.ele,g.resizedRowHeight,t);else for(var h=m.range.split(","),d=this.parent.frozenRowCount(e),p=this.parent.frozenColCount(e),c=ste(e.topLeftCell),u=0;u<h.length;u++)this.updateRange(e,rte(h[u]),d,p,c,r,t)},wue.prototype.updateRange=function(e,t,i,n,o,r,s){var a;t[0]=t[0]<i?(t[0]<o[0]?o:t)[0]:t[0]<this.parent.viewport.topIndex+i?this.parent.viewport.topIndex+i:t[0],t[1]=t[1]<n?(t[1]<o[1]?o:t)[1]:t[1]<this.parent.viewport.leftIndex+n?this.parent.viewport.leftIndex+n:t[1],t[2]=t[2]<i?t[2]<o[0]?o[0]-1:t[2]:t[2]>this.parent.viewport.bottomIndex?this.parent.viewport.bottomIndex:t[2],t[3]=t[3]<n?t[3]<o[1]?o[1]-1:t[3]:t[3]>this.parent.viewport.rightIndex?this.parent.viewport.rightIndex:t[3];for(var l=t[0];l<=t[2];l++)if(!zde(e,l=i&&l===i?this.parent.viewport.topIndex+i:l))for(var h=t[1];h<=t[3];h++)epe(e,h=n&&h===n?this.parent.viewport.leftIndex+n:h)||(a=this.parent.getCell(l,h))&&r(l,h,Kre(l,h,e),a,void 0,s)},wue.prototype.applyIconSet=function(e,t,i,n,o){var r,s,a,l,h=i.classList.contains("e-iconset"),d=i.querySelector(".e-wrap-content"),p=(h&&(i.classList.remove("e-iconset"),p=i.querySelector(".e-iconsetspan"))&&(d||i).removeChild(p),mre(e)?parseFloat(e):NaN),c=t.result;return isNaN(p)||void 0===c[0]&&void 0===c[1]||mre(e)&&"Text"===o?h:(e=c[0],o=c[1],3===(h=this.getIconList(t.type).split(",")).length?r="e-"+(e+.67*(o-e)<=p?h[0]:e+.33*(o-e)<=p?h[1]:h[2]).trim():4===h.length?(s=e+.25*(o-e),a=e+.5*(o-e),r="e-"+((l=e+.75*(o-e))<=p?h[0]:a<=p?h[1]:s<=p?h[2]:h[3]).trim()):5===h.length&&(s=e+.2*(o-e),a=e+.4*(o-e),l=e+.6*(o-e),r="e-"+(e+.8*(o-e)<=p?h[0]:l<=p?h[1]:a<=p?h[2]:s<=p?h[3]:h[4]).trim()),n.classList.add(r),(c=i.querySelector(".e-cf-databar"))&&(n.style.height=c.style.height,n.classList.add("top"===i.style.verticalAlign?"e-cf-icon-top":"middle"===i.style.verticalAlign?"e-cf-icon-middle":"e-cf-icon-end")),d?d.insertBefore(n,d.firstChild):i.insertBefore(n,i.childNodes[0]),i.classList.add("e-iconset"),!0)},wue.prototype.getIconList=function(e){switch(e){case"ThreeArrows":return"3arrows-1,3arrows-2,3arrows-3";case"ThreeArrowsGray":return"3arrowsgray-1,3arrowsgray-2,3arrowsgray-3";case"FourArrowsGray":return"4arrowsgray-1,4arrowsgray-2,4arrowsgray-3,4arrowsgray-4";case"FourArrows":return"4arrows-1,4arrows-2,4arrows-3,4arrows-4";case"FiveArrowsGray":return"5arrowsgray-1,5arrowsgray-2,5arrowsgray-3,5arrowsgray-4,5arrowsgray-5";case"FiveArrows":return"5arrows-1,5arrows-2,5arrows-3,5arrows-4,5arrows-5";case"ThreeTrafficLights1":return"3trafficlights-1,3trafficlights-2,3trafficlights-3";case"ThreeTrafficLights2":return"3rafficlights2-1,3rafficlights2-2,3rafficlights2-3";case"ThreeSigns":return"3signs-1,3signs-2,3signs-3";case"FourTrafficLights":return"4trafficlights-1,4trafficlights-2,4trafficlights-3,4trafficlights-4";case"FourRedToBlack":return"4redtoblack-1,4redtoblack-2,4redtoblack-3,4redtoblack-4";case"ThreeSymbols":return"3symbols-1,3symbols-2,3symbols-3";case"ThreeSymbols2":return"3symbols2-1,3symbols2-2,3symbols2-3";case"ThreeFlags":return"3flags-1,3flags-2,3flags-3";case"FourRating":return"4rating-4,4rating-3,4rating-2,4rating-1";case"FiveQuarters":return"5quarters-1,5quarters-2,5quarters-3,5quarters-4,5quarters-5";case"FiveRating":return"5rating-5,5rating-4,5rating-3,5rating-2,5rating-1";case"ThreeTriangles":return"3triangles-1,3triangles-2,3triangles-3";case"ThreeStars":return"3stars-1,3stars-2,3stars-3";case"FiveBoxes":return"5boxes-1,5boxes-2,5boxes-3,5boxes-4,5boxes-5"}return"3arrows-1,3arrows-2,3arrows-3"},wue.prototype.applyDataBars=function(e,t,i,n,o,r){var s,a,l,h,d,p,c,u=this.parent.getActiveSheet(),g=t.result,m=0;mre(e)&&(a=parseFloat(e)),void 0===g[0]&&void 0===g[1]||isNaN(a)||mre(e)&&"Text"===o?(e=i.getElementsByClassName("e-cf-databar")[0])&&(o=e.getElementsByClassName("e-databar-value")[0].textContent,h=i.querySelector(".e-hyperlink"),d=i.querySelector(".e-addNoteIndicator"),(l=i.querySelector(".e-wrap-content"))?(l.textContent="",h?l.appendChild(h):l.innerText=o):(i.removeChild(e),h?i.appendChild(h):i.innerText=o),d)&&i.appendChild(d):(void 0!==g[0]&&void 0!==g[1]?(s=g[0]+Math.abs(g[1]),m=Math.abs(g[1]/s*100)):s=void 0!==g[0]?g[0]:g[1],l=this.parent.createElement("div",{id:"spreadsheet-databar",className:"e-cf-databar"}),e=this.parent.createElement("span",{id:"spreadsheet-leftspan",className:"e-databar"}),h=this.parent.createElement("span",{id:"spreadsheet-rightspan",className:"e-databar"}),o=this.parent.createElement("span",{id:"spreadsheet-dataspan",className:"e-databar-value"}),d=i.querySelector(".e-iconsetspan"),p=i.querySelector(".e-addNoteIndicator"),c=i.querySelector(".e-wrap-content"),r=r||Wde(u,n,!0),u=i.querySelector("#"+this.parent.element.id+"_currency"),l.style.height=r-1+"px",d&&(d.style.height=r-1+"px",d.classList.add("top"===i.style.verticalAlign?"e-cf-icon-top":"middle"===i.style.verticalAlign?"e-cf-icon-middle":"e-cf-icon-end")),u&&(u.style.alignItems="top"===i.style.verticalAlign?"start":"middle"===i.style.verticalAlign?"center":"end",u.classList.add("e-cf-currency")),"L"===(n=t.type[0])&&(n+="B"),void 0===g[1]?(h.style.width=Math.ceil(Math.abs(a/s*100))+"%",h.style.height=r-3+"px",h.style.backgroundColor=this.getColor(n)[0],h.style.left="0px"):void 0===g[0]?(h.style.width=Math.ceil(Math.abs(a/s*100))+"%",h.style.height=r-3+"px",h.style.backgroundColor=this.getColor("R")[0],h.style.left="0px"):0<=a?(e.style.width=m+"%",e.style.height=r-3+"px",e.style.backgroundColor="transparent",e.style.left="0px",h.style.width=Math.ceil(Math.abs(a/s*100))+"%",h.style.height=r-3+"px",h.style.backgroundColor=this.getColor(n)[0],h.style.left=m+"%"):(e.style.width=Math.ceil(Math.abs(a/s*100))+"%",e.style.height=r-3+"px",e.style.backgroundColor=this.getColor("R")[0],e.style.width===m+"%"?e.style.left="0px":e.style.right=100-m+"%"),o.style.fontSize=i.style.fontSize||"11pt",o.style.alignItems="top"===i.style.verticalAlign?"start":"middle"===i.style.verticalAlign?"center":"end",o.style.textDecoration=i.style.textDecoration,(u=i.querySelector("#"+this.parent.element.id+"_currency"))&&l.appendChild(u),(t=i.querySelector(".e-hyperlink"))?o.appendChild(t):(g=i.querySelector(".e-validation-list")?i.innerText:i.textContent,""===(o.innerText=g)&&o.appendChild(document.createTextNode(g))),l.appendChild(e),l.appendChild(h),l.appendChild(o),i.textContent="",c?(c.textContent="",d&&c.appendChild(d),c.appendChild(l),i.appendChild(c)):(d&&i.insertBefore(d,i.firstElementChild),i.appendChild(l)),p&&i.appendChild(p))},wue.prototype.getColor=function(e){if("LB"===e)return["#008aef"];for(var t=e.split(""),i=[],n=0;n<t.length;n++)switch(t[n]){case"G":i.push("#63be7b");break;case"Y":i.push("#ffeb84");break;case"R":i.push("#f8696b");break;case"W":i.push("#ffffff");break;case"B":i.push("#5a8ac6");break;case"O":i.push("#ffb628");break;case"LB":i.push("#008aef");break;case"P":i.push("#d6007b")}return i},wue.prototype.getGradient=function(e,t,i,n,o){return je(n)?this.getLinear(t,i,e/o):(o=o/2)<=e?this.getLinear(i,n,Math.abs((e-o)/o)):this.getLinear(t,i,e/o)},wue.prototype.getLinear=function(e,t,i){return"#"+this.byteLinear(e[1]+e[2],t[1]+t[2],i)+this.byteLinear(e[3]+e[4],t[3]+t[4],i)+this.byteLinear(e[5]+e[6],t[5]+t[6],i)},wue.prototype.byteLinear=function(e,t,i){e=parseInt(e,16)*(1-i)+parseInt(t,16)*i|0;return Math.abs(e).toString(16)},wue.prototype.isGreaterThanLessThan=function(e,t,i,n){if(mre(t)&&"Text"!==n){if(mre(i))return n=new RegExp(/[^.-a-zA-Z 0-9]+/g),"GreaterThan"===e.type?parseFloat(t)>parseFloat(i.replace(n,"")):parseFloat(t)<parseFloat(i.replace(n,""));n={value:i,rowIndex:0,colIndex:0,sheetIndex:0,isDate:!1,updatedVal:"",isTime:!1};if(this.parent.notify(Fie,n),n.isDate||n.isTime)return e.value=n.updatedVal.toString(),"GreaterThan"===e.type?Number(t)>Number(n.updatedVal):Number(t)<Number(n.updatedVal);if(i)return"GreaterThan"===e.type?t.toLowerCase()>i.toLowerCase():t.toLowerCase()<i.toLowerCase()}else if(""===t&&0<Number(i)&&"LessThan"===e.type)return!0;return!1},wue.prototype.isBetWeen=function(e,t,i,n,o){var r,s;return o||(o=new RegExp(/[^.-a-zA-Z 0-9]+/g),i=i.replace(o,""),n=n.replace(o,"")),mre(i)?(o=parseFloat(i),(r=parseFloat(n))<o&&(o=(s=[r,o])[0],r=s[1]),parseFloat(t)>=o&&parseFloat(t)<=r):!(!i||!n)&&(s={value:n,cell:{},updatedVal:""},this.parent.notify(Fie,o={value:i,cell:{},updatedVal:""}),this.parent.notify(Fie,s),(o.isDate||o.isTime)&&(s.isDate||s.isTime)?(e.value=o.updatedVal+","+s.updatedVal,o.updatedVal>s.updatedVal&&(r=[s.updatedVal,o.updatedVal],o.updatedVal=r[0],s.updatedVal=r[1]),t>=o.updatedVal&&t<=s.updatedVal):t.toLowerCase()>=i.toLowerCase()&&t.toLowerCase()<=n.toLowerCase())},wue.prototype.isEqualTo=function(e,t,i){var n;return mre(i)?""===t?0===parseFloat(i):(n=new RegExp(/[^.-a-zA-Z 0-9]+/g),parseFloat(t)===parseFloat(i.replace(n,""))):!(!t||!i)&&(this.parent.notify(Fie,n={value:i,cell:{},updatedVal:""}),n.isTime||n.isDate?(e.value=n.updatedVal,t===n.updatedVal):t.toLowerCase()===i.toLowerCase())},wue.prototype.isContainsText=function(e,t){var i=new RegExp(/[^.-a-zA-Z 0-9]+/g);return mre(t.replace(i,""))?(t=t.replace(i,""),-1<(e=gre(e)?ure(e).toString():e).indexOf(t)):gre(t)?-1<(e=gre(e)?ure(e).toString():e).indexOf(ure(t).toString()):-1<e.toLowerCase().indexOf(t.toLowerCase())},wue.prototype.setCFStyle=function(e,t){switch(t.cFColor){case"RedFT":e.backgroundColor="#ffc7ce",e.color="#9c0055";break;case"YellowFT":e.backgroundColor="#ffeb9c",e.color="#9c6500";break;case"GreenFT":e.backgroundColor="#c6efce",e.color="#006100";break;case"RedF":e.backgroundColor="#ffc7ce";break;case"RedT":e.color="#9c0055"}return e},wue.prototype.getModuleName=function(){return"conditionalFormatting"};var bue=wue;function wue(e){this.divElements=[],this.spanElements=[],this.inputElements=[],this.dropDownListElements=[],this.parent=e,this.addEventListener()}Sue.prototype.getfillItems=function(){var e=this.parent.serviceLocator.getService(ope);return[{text:e.getConstant("CopyCells")},{text:e.getConstant("FillSeries")},{text:e.getConstant("FillFormattingOnly")},{text:e.getConstant("FillWithoutFormatting")}]},Sue.prototype.createAutoFillElement=function(){var e,t;this.parent.allowAutoFill&&(e=this.parent.getMainContent(),t=this.parent.createElement("div",{className:"e-autofill"}),e.lastElementChild&&e.lastElementChild.classList.contains("e-ss-overlay")?e.insertBefore(t,e.getElementsByClassName("e-ss-overlay")[0]):e.appendChild(t),this.autoFillElement=t,this.autoFillDropDown&&(this.autoFillDropDown.destroy(),this.autoFillDropDown=null),this.getautofillDDB({id:this.parent.element.id+"_autofilloptionbtn",appendElem:e}))},Sue.prototype.getautofillDDB=function(e){var t=this;return this.splitBtnElem=this.parent.createElement("button",{id:e.id,className:"e-filloption",attrs:{type:"button"}}),this.splitBtnElem.appendChild(this.parent.createElement("span",{className:"e-tbar-btn-text"})),this.autoFillDropDown=new u2({cssClass:"e-dragfill-ddb",iconCss:"e-icons e-dragfill-icon",items:this.getfillItems(),createPopupOnClick:!0,enableRtl:this.parent.enableRtl,select:function(e){t.autoFillOptionClick({type:t.getFillType(e.item.text)})},beforeOpen:function(){return t.autoFillClick()}}),this.autoFillDropDown.createElement=this.parent.createElement,this.autoFillDropDown.appendTo(this.splitBtnElem),e.appendElem.appendChild(this.splitBtnElem),this.autoFillDropDown},Sue.prototype.getFillType=function(e){var t=this.parent.serviceLocator.getService(ope),e=e===t.getConstant("CopyCells")?"CopyCells":e===t.getConstant("FillSeries")?"FillSeries":e===t.getConstant("FillFormattingOnly")?"FillFormattingOnly":"FillWithoutFormatting";return e},Sue.prototype.autoFillClick=function(){var e=this.parent.serviceLocator.getService(ope),t={fillType:"FillSeries",disableItems:[""]};this.parent.notify(roe,t),this.autoFillDropDown.setProperties({items:this.getfillItems()},!0),this.autoFillDropDown.removeItems(t.disableItems),this.refreshAutoFillOption(e.getConstant(t.fillType))},Sue.prototype.getFillRange=function(e,t,i,n){switch(n){case"Up":return[i.rowIndex,e.colIndex,e.rowIndex-1,t.colIndex];case"Right":return[e.rowIndex,t.colIndex+1,t.rowIndex,i.colIndex];case"Down":return[t.rowIndex+1,e.colIndex,i.rowIndex,t.colIndex];case"Left":return[e.rowIndex,i.colIndex,t.rowIndex,e.colIndex-1]}},Sue.prototype.autoFillOptionClick=function(e){var t=this.parent.serviceLocator.getService(ope),i=this.parent.getActiveSheet(),n=fte(rte(this.parent.selectionModule.dAutoFillCell)),o=rte(i.selectedRange),r=n[0],s=n[1],a=n[2],n=n[3],l=this.getDirection({rowIndex:a,colIndex:n},{rowIndex:o[2],colIndex:o[3]}),h=[r,s,a,n],r=this.getFillRange({rowIndex:r,colIndex:s},{rowIndex:a,colIndex:n},{rowIndex:o[2],colIndex:o[3]},l),s=(this.refreshAutoFillOption(t.getConstant(e.type)),{isUndo:!0,isPublic:!0,preventReSelect:!0,preventEvt:"FillWithoutFormatting"===e.type,setCollection:"FillFormattingOnly"===e.type||"FillWithoutFormatting"===e.type,isFromAutoFillOption:!0}),a=(this.parent.notify(Tae,s),{dataRange:i.name+"!"+hte(h),fillRange:i.name+"!"+hte(r),direction:l,fillType:e.type,isFillOptClick:!0}),n=(this.isVerticalFill="Down"===a.direction||"Up"===a.direction,this.parent.notify(noe,a),this.positionAutoFillElement({isautofill:!0}),{dataRange:a.dataRange,fillRange:a.fillRange,fillType:a.fillType,direction:a.direction,selectedRange:i.name+"!"+hte(o),undoArgs:s.undoArgs});this.parent.notify(Vae,{eventArgs:n,action:"autofill"}),this.parent.showAggregate&&this.parent.notify(hle,{}),this.autoFillClick()},Sue.prototype.refreshAutoFillOption=function(e){for(var t=0;t<this.autoFillDropDown.items.length;t++)this.autoFillDropDown.items[t].iconCss="";for(t=0;t<this.autoFillDropDown.items.length;t++)this.autoFillDropDown.items[t].text===e&&(this.autoFillDropDown.items[t].iconCss="e-icons e-selected-icon");["Copy Cells","Fill Series","Fill Formatting Only","Fill Without Formatting"].indexOf(e)<0&&(this.autoFillDropDown.items[this.fillOptionIndex].iconCss=""),this.autoFillDropDown.dataBind()},Sue.prototype.positionAutoFillElement=function(e){var t,i=0,n=0,o=this.parent.getActiveSheet(),r=fte(rte(o.selectedRange)),s=-5,a=-5,l=6,h=6,d=0===r[1]&&r[3]===o.colCount-1,p=0===r[0]&&r[2]===o.rowCount-1,c=r[2],u=r[3],g=this.parent.enableRtl,m=this.parent.getCell(c,u);epe(o,r[3])||zde(o,r[2])||m&&m.classList.contains("e-formularef-selection")||o.isProtected&&o.protectSettings.selectUnLockedCells&&ace(this.parent,r)?this.hideAutoFillElement():(o.isProtected&&(o.protectSettings.selectCells||o.protectSettings.selectUnLockedCells)||!o.isProtected)&&(d?(s=-5,a=-1,l=6,c=r[h=2],u=r[1]):p&&(a=-5,l=1,h=6,c=r[s=0],u=r[3]),o.frozenColumns||o.frozenRows?(p||d?(Spe(this.parent,this.autoFillElement,r,"e-autofill",e&&e.preventAnimation),this.parent.autoFillSettings.showFillOptions&&e&&e.isautofill&&Spe(this.parent,this.autoFillDropDown.element,r,"e-filloption")):(Spe(this.parent,this.autoFillElement,[c,u,c,u],"e-autofill",e&&e.preventAnimation),this.parent.autoFillSettings.showFillOptions&&e&&e.isautofill&&Spe(this.parent,this.autoFillDropDown.element,[c,u,c,u],"e-filloption")),this.autoFillElement&&(this.autoFillCell={rowIndex:c,colIndex:u},(m=this.parent.element.querySelectorAll(".e-autofill")).length)&&(t=m[0].getBoundingClientRect(),this.autoFillElementPosition={left:t.left,top:t.top},[].slice.call(m).forEach(function(e){q([e],"e-hide")}))):(r=Cpe(o,[c,u,c,u],this.parent.frozenRowCount(o),this.parent.frozenColCount(o),this.parent.viewport.beforeFreezeHeight,this.parent.viewport.beforeFreezeWidth,this.parent.sheetModule.colGroupWidth),m=Ude(o,c,c,!0),o=$de(o,u,u,!0),p||(i+=m),d||(n+=o),i+=Math.round(r.top)+s,n+=Math.round(r.left)+a,this.autoFillElement&&(q([this.autoFillElement],"e-hide"),this.autoFillElement.style.top=i+"px",g?this.autoFillElement.style.right=n+"px":this.autoFillElement.style.left=n+"px",this.autoFillCell={rowIndex:c,colIndex:u},t=this.autoFillElement.getBoundingClientRect(),this.autoFillElementPosition={left:t.left,top:t.top},this.parent.autoFillSettings.showFillOptions)&&e&&e.isautofill&&(q([this.autoFillDropDown.element],"e-hide"),p=this.parent.element.querySelector(".e-main-panel"),m=this.parent.element.querySelector(".e-main-panel .e-sheet-content .e-virtualable"),d=this.parent.element.querySelector(".e-sheet-panel .e-scrollbar .e-scroller"),o=m&&m.clientHeight<p.clientHeight?p.clientHeight-m.clientHeight:0,s=m&&m.clientWidth<p.clientWidth?p.clientWidth-m.clientWidth:0,r=this.autoFillDropDown.element.getBoundingClientRect(),p.scrollTop+p.clientHeight-o<i+r.height&&(i-=r.height),d.scrollLeft+d.clientWidth-s<n+r.width&&(n-=r.width),this.autoFillDropDown.element.style.top=i+l+"px",g?this.autoFillDropDown.element.style.right=n+h+"px":this.autoFillDropDown.element.style.left=n+h+"px")))},Sue.prototype.hideAutoFillElement=function(){var t=this.parent.element;[].slice.call(t.querySelectorAll(".e-autofill")).forEach(function(e){t&&U([e],"e-hide")})},Sue.prototype.hideAutoFillOptions=function(){var t=this.parent.element;[].slice.call(t.querySelectorAll(".e-filloption")).forEach(function(e){t&&U([e],"e-hide")})},Sue.prototype.selectAutoFillRange=function(e){var t={clientY:Npe(e.e),target:e.e.target},i={clientX:Ope(e.e),target:e.e.target},n=this.parent.getActiveSheet(),t=(this.parent.notify(xle,t),this.parent.notify(Ile,i),this.getAutoFillRange({rowIndex:t.clientY,colIndex:i.clientX})),i=t&&t.fillRange?[t.startCell.rowIndex,t.startCell.colIndex,t.endCell.rowIndex,t.endCell.colIndex]:rte(n.selectedRange);return e.indexes=i},Sue.prototype.getAutoFillRange=function(e){var t=this.parent.getActiveSheet(),i=this.autoFillCell,t=fte(rte(t.selectedRange)),n=t[0],o=t[1],r=t[2],s=t[3],a=Voe(t,[e.rowIndex,e.colIndex,e.rowIndex,e.colIndex],!0),l={rowIndex:n,colIndex:o},h={rowIndex:t[0],colIndex:t[1]},d={rowIndex:t[2],colIndex:t[3]},p={rowIndex:r,colIndex:s},t=this.modifyRangeForMerge(e.rowIndex,e.colIndex,i.rowIndex,i.colIndex,t);return e.rowIndex<i.rowIndex?n-e.rowIndex>e.colIndex-s&&n-e.rowIndex>o-e.colIndex?a?{startCell:l,endCell:{rowIndex:e.rowIndex,colIndex:s}}:{startCell:p,endCell:{rowIndex:t.rowIndex,colIndex:o},fillRange:[t.rowIndex,o,n-1,s],direction:"Up"}:e.colIndex>i.colIndex?{startCell:l,endCell:{rowIndex:r,colIndex:e.colIndex},fillRange:[n,s+1,r,e.colIndex],direction:"Right"}:e.colIndex<i.colIndex?a?{startCell:l,endCell:p}:{startCell:p,endCell:{rowIndex:n,colIndex:e.colIndex},fillRange:[n,e.colIndex,r,o-1],direction:"Left"}:{startCell:h,endCell:d}:e.colIndex>i.colIndex?e.rowIndex-r>e.colIndex-s?{startCell:l,endCell:{rowIndex:e.rowIndex,colIndex:s},fillRange:[r+1,o,e.rowIndex,s],direction:"Down"}:{startCell:l,endCell:{rowIndex:r,colIndex:t.colIndex},fillRange:[n,s+1,r,t.colIndex],direction:"Right"}:e.colIndex<i.colIndex?e.rowIndex-r>s-e.colIndex||e.rowIndex-n>s-e.colIndex&&e.rowIndex!==r?{startCell:l,endCell:{rowIndex:e.rowIndex,colIndex:s},fillRange:[r+1,o,e.rowIndex,s],direction:"Down"}:a?{startCell:l,endCell:p}:{startCell:p,endCell:{rowIndex:n,colIndex:t.colIndex},fillRange:[n,t.colIndex,r,o-1],direction:"Left"}:e.rowIndex>i.rowIndex?{startCell:l,endCell:{rowIndex:t.rowIndex,colIndex:s},fillRange:[r+1,o,t.rowIndex,s],direction:"Down"}:(e.rowIndex===i.rowIndex&&(e.colIndex,i.colIndex),{startCell:h,endCell:d})},Sue.prototype.modifyRangeForMerge=function(e,t,i,n,o){var r,s,a,l={rowIndex:e,colIndex:t};return this.isMergedRange(o)&&(r=o[2]-o[0]+1,s=o[3]-o[1]+1,a=void 0,e<i?(a=(o[2]-e+1)%r)&&0<=e-(r-a)&&(l.rowIndex=e-(r-a)):n<t?(a=(t-o[1]+1)%s)&&(l.colIndex=t+(s-a)):t<n?(a=(o[3]-t+1)%s)&&0<=t-(s-a)&&(l.colIndex=t-(s-a)):i<e&&(a=(e-o[0]+1)%r)&&(l.rowIndex=e+(r-a))),l},Sue.prototype.performAutoFill=function(e){var t,i,n,o;!e.rangeInfo&&e.event.clientX>this.autoFillElementPosition.left&&e.event.clientX<this.autoFillElementPosition.left+10&&e.event.clientY>this.autoFillElementPosition.top&&e.event.clientY<this.autoFillElementPosition.top+10?this.positionAutoFillElement({isautofill:!1}):(t=void 0,t=e.rangeInfo||(i={clientY:Npe(e.event),target:e.event.target},n={clientX:Ope(e.event),target:e.event.target},this.parent.notify(xle,i),this.parent.notify(Ile,n),this.getAutoFillRange({rowIndex:i.clientY,colIndex:n.clientX})),i=this.parent.getActiveSheet(),t&&t.fillRange&&(n={dataRange:i.name+"!"+e.dAutoFillCell,fillRange:i.name+"!"+hte(t.fillRange),direction:t.direction,fillType:e.fillType||this.parent.autoFillSettings.fillType,cancel:!1},are(this.parent,rte(e.dAutoFillCell))||are(this.parent,t.fillRange)?this.parent.notify(ele,null):(this.parent.notify(fie,{eventArgs:n,action:"autofill"}),n.cancel||(o=ace(this.parent,t.fillRange),i.isProtected&&o?this.parent.notify($ae,null):e.rangeInfo?this.performAutoFillAction(n,null,o):(this.performAutoFillAction(n,t,o),this.positionAutoFillElement({isautofill:!0}))))))},Sue.prototype.refreshCell=function(e){this.parent.serviceLocator.getService("cell").refreshRange([e.rowIndex,e.colIndex,e.rowIndex,e.colIndex])},Sue.prototype.getDirection=function(e,t,i){if(i=je(i)?this.isVerticalFill:i){if(t.rowIndex<e.rowIndex)return"Up";if(t.rowIndex>e.rowIndex)return"Down";if(t.colIndex>e.colIndex)return"Right";if(t.colIndex<e.colIndex)return"Left"}else{if(t.colIndex>e.colIndex)return"Right";if(t.colIndex<e.colIndex)return"Left";if(t.rowIndex<e.rowIndex)return"Up";if(t.rowIndex>e.rowIndex)return"Down"}return null},Sue.prototype.performAutoFillAction=function(e,t,i){var n,o=this,r=this.parent.getActiveSheet(),s=this.parent.serviceLocator.getService(ope);this.isMergedRange(rte(e.fillRange))?(n=this.parent.serviceLocator.getService(rpe)).show({isModal:!0,showCloseIcon:!0,height:180,width:400,content:s.getConstant("AutoFillMergeAlertMsg"),buttons:[{buttonModel:{content:this.parent.serviceLocator.getService(ope).getConstant("Ok"),isPrimary:!0},click:function(){n.hide(),o.parent.selectRange(e.dataRange)}}],close:function(){n.hide(),o.parent.selectRange(e.dataRange)}},!1):(this.isVerticalFill="Down"===e.direction||"Up"===e.direction,this.parent.notify(noe,{dataRange:e.dataRange,fillRange:e.fillRange,direction:e.direction,fillType:e.fillType,isLockedCell:i}),s=t?hte([t.startCell.rowIndex,t.startCell.colIndex,t.endCell.rowIndex,t.endCell.colIndex]):r.selectedRange,Ore(this.parent,s,r),i={dataRange:e.dataRange,fillRange:e.fillRange,fillType:e.fillType,direction:e.direction,selectedRange:s},this.parent.notify(Vae,{eventArgs:i,action:r.conditionalFormats&&0<r.conditionalFormats.length&&"autofillWithCF"===r.conditionalFormats[r.conditionalFormats.length-1].action?"autofillWithCF":"autofill"}),this.parent.trigger("select",{range:this.parent.getActiveSheet().selectedRange}),this.parent.showAggregate&&this.parent.notify(hle,{}),this.parent.notify(qne,null))},Sue.prototype.getRangeData=function(e){for(var t,i=[],n=this.parent.getActiveSheet(),o=e.range[0],r=e.range[1],s=e.range[2],a=e.range[3],l=r;o<=s;){if(zde(n,o));else for(r=l;r<=a;)epe(n,r)||(t=Kre(o,r,n),i.push(t)),r++;o++}return i},Sue.prototype.isMergedRange=function(e){for(var t=0,i=this.getRangeData({range:e,sheetIdx:this.parent.activeSheetIndex}),t=0;t<i.length;t++)if(i[t]&&(i[t].rowSpan||i[t].colSpan))return!0;return!1},Sue.prototype.addEventListener=function(){this.parent.on(cse,this.createAutoFillElement,this),this.parent.on(Jle,this.positionAutoFillElement,this),this.parent.on(Zle,this.hideAutoFillOptions,this),this.parent.on(the,this.hideAutoFillElement,this),this.parent.on($le,this.performAutoFill,this),this.parent.on(ehe,this.selectAutoFillRange,this),this.parent.on(ooe,this.refreshCell,this),this.parent.on(soe,this.getautofillDDB,this)},Sue.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(cse,this.createAutoFillElement),this.parent.off(Jle,this.positionAutoFillElement),this.parent.off(Zle,this.hideAutoFillOptions),this.parent.off(the,this.hideAutoFillElement),this.parent.off($le,this.performAutoFill),this.parent.off(ehe,this.selectAutoFillRange),this.parent.off(ooe,this.refreshCell),this.parent.off(soe,this.getautofillDDB))},Sue.prototype.destroy=function(){this.removeEventListener(),this.autoFillElement&&this.autoFillElement.remove(),this.autoFillElement=null,this.autoFillElementPosition=null,this.autoFillCell=null,this.autoFillDropDown&&this.autoFillDropDown.destroy(),this.autoFillDropDown=null,this.isVerticalFill=null,this.fillOptionIndex=null,this.splitBtnElem&&(upe(this.splitBtnElem),this.splitBtnElem.remove()),this.splitBtnElem=null,this.parent=null},Sue.prototype.getModuleName=function(){return"autofill"};var Cue=Sue;function Sue(e){this.fillOptionIndex=0,this.parent=e,this.addEventListener()}xue.prototype.destroy=function(){if(this.removeEventListener(),!this.parent.isDestroyed&&!this.parent.refreshing)for(var e=this.parent.element.getElementsByClassName("e-addNoteIndicator");e.length;){var t=z(e[0],".e-cell");t&&(E.remove(t,"mouseover",this.mouseOver),E.remove(t,"mouseout",this.mouseOut)),G(e[0])}this.parent=null,this.isNoteVisible=null},xue.prototype.addEventListener=function(){this.parent.on(mae,this.addNote,this),this.parent.on(fae,this.editNote,this),this.parent.on(yae,this.deleteNote,this),this.parent.on(bae,this.createNoteIndicator,this),this.parent.on(vae,this.showNote,this),this.parent.on(Cae,this.removeNoteContainer,this),this.parent.on(wae,this.updateNoteContainer,this)},xue.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(mae,this.addNote),this.parent.off(fae,this.editNote),this.parent.off(vae,this.showNote),this.parent.off(yae,this.deleteNote),this.parent.off(bae,this.createNoteIndicator),this.parent.off(Cae,this.removeNoteContainer),this.parent.off(wae,this.updateNoteContainer))},xue.prototype.getModuleName=function(){return"spreadsheetNote"},xue.prototype.addNote=function(){var e=je(this.noteCellIndexes)?ste(this.parent.getActiveSheet().activeCell):this.noteCellIndexes,t=this.parent.getCell(e[0],e[1]);!je(t)&&(0===t.children.length||0<t.children.length&&-1===t.children[t.childElementCount-1].className.indexOf("e-addNoteIndicator"))&&(this.createNoteIndicator({targetElement:t,rowIndex:e[0],columnIndex:e[1]}),this.createNoteContainer(t,e[0],e[1],!1,!0))},xue.prototype.deleteNote=function(e){var t=ste(this.parent.getActiveSheet().activeCell),i=je(e)||je(e.rowIndex)?t[0]:e.rowIndex,t=je(e)||je(e.columnIndex)?t[1]:e.columnIndex,n=this.parent.getCell(i,t);0<n.children.length&&-1<n.children[n.children.length-1].className.indexOf("e-addNoteIndicator")&&(n.removeChild(n.children[n.children.length-1]),E.remove(n,"mouseover",this.mouseOver),E.remove(n,"mouseout",this.mouseOut),n=Wre(this.parent,this.parent.activeSheetIndex)+"!"+this.parent.getActiveSheet().activeCell,i=Kre(i,t,this.parent.getActiveSheet()),!je(e)&&e.isDeleteFromMenu&&this.parent.notify(Dae,{args:{action:"beforeCellSave",eventArgs:{address:n}}}),!je(i)&&i.notes&&delete i.notes,!je(e))&&e.isDeleteFromMenu&&(t={notes:i.notes,address:n},this.parent.notify(Vae,{eventArgs:t,action:"deleteNote"}),this.isShowNote=null)},xue.prototype.editNote=function(){var e=je(this.noteCellIndexes)?ste(this.parent.getActiveSheet().activeCell):this.noteCellIndexes,t=(this.showNote({rowIndex:e[0],columnIndex:e[1],isNoteEditable:!0}),document.getElementsByClassName("e-addNoteContainer")[0]);Yoe(this.parent,this.parent.getActiveSheet(),{rowIdx:e[0],colIdx:e[1],preventEvt:!0,cell:{isNoteEditable:!0}}),t&&this.getNoteFocus(t)},xue.prototype.createNoteIndicator=function(e){var t=this.parent.createElement("div",{className:"e-addNoteIndicator",styles:"position: absolute;top: 0;right: 0;width: 0;height: 0;border-left: 8px solid transparent;border-top: 8px solid red;cursor: pointer;"});if(0<e.targetElement.children.length)for(var i=Wde(this.parent.getActiveSheet(),e.rowIndex),n=0;n<e.targetElement.childElementCount;n++)-1<e.targetElement.children[n].className.indexOf("e-filter-btn")&&(t.style.right=(i<30?e.targetElement.children[n].getBoundingClientRect().width<=0?20:e.targetElement.children[n].getBoundingClientRect().width:2)+"px"),-1<e.targetElement.children[n].className.indexOf("e-validation-list")&&(t.style.right=(e.targetElement.children[n].getBoundingClientRect().width||20)+2+"px");(!je(e.targetElement)&&0===e.targetElement.children.length||0<e.targetElement.children.length&&-1===e.targetElement.children[e.targetElement.childElementCount-1].className.indexOf("e-addNoteIndicator"))&&(e.skipEvent||(E.add(e.targetElement,"mouseover",this.mouseOver,[this,e.rowIndex,e.columnIndex]),E.add(e.targetElement,"mouseout",this.mouseOut,this)),e.targetElement.appendChild(t))},xue.prototype.mouseOver=function(){var e=this[0];(e.isNoteVisibleOnTouch&&!je(document.getElementsByClassName("e-addNoteContainer")[0])||je(document.getElementsByClassName("e-addNoteContainer")[0]))&&(je(document.getElementsByClassName("e-addNoteContainer")[0])||e.removeNoteContainer(),e.showNote({rowIndex:this[1],columnIndex:this[2],isNoteEditable:!1}),e.isNoteVisible=!0)},xue.prototype.mouseOut=function(e){!this.isNoteVisible||this.isNoteVisibleOnTouch||je(document.getElementsByClassName("e-addNoteContainer")[0])||-1!==document.activeElement.className.indexOf("e-addNoteContainer")||je(e.relatedTarget)||-1!==e.relatedTarget.className.indexOf("e-connectorLine")||-1!==e.relatedTarget.className.indexOf("e-addNoteContainer")||(this.removeNoteContainer(),this.isNoteVisible=!1)},xue.prototype.createNoteContainer=function(e,t,i,n,o){t=Kre(t,i,this.parent.getActiveSheet()),i=e.getBoundingClientRect(),e=this.parent.createElement("textarea",{className:"e-addNoteContainer"});this.createContainer(e,t,i,n),this.createConnectorLine(e,i),o&&this.getNoteFocus(e),E.add(e,"mouseout",this.mouseOut,this),E.add(document.getElementsByClassName("e-connectorLine")[0],"mouseout",this.mouseOut,this)},xue.prototype.getNoteFocus=function(e){e.selectionStart=e.value.length,e.focus()},xue.prototype.createContainer=function(e,t,i,n){var o=5,r=(!je(document.getElementsByClassName("e-select-all-cell")[0])&&!je(document.getElementsByClassName("e-scroller")[0])&&i.top>=document.getElementsByClassName("e-select-all-cell")[0].getBoundingClientRect().bottom&&i.right>=document.getElementsByClassName("e-select-all-cell")[0].getBoundingClientRect().right&&i.bottom<=document.getElementsByClassName("e-scroller")[0].getBoundingClientRect().top&&i.right<=document.getElementsByClassName("e-scroller")[0].getBoundingClientRect().width?(e.style.display="block",o=i.top===document.getElementsByClassName("e-select-all-cell")[0].getBoundingClientRect().bottom?0:o):e.style.display="none",this.parent.element.getBoundingClientRect()),s=this.parent.element.style.getPropertyValue("position");e.style.position="absolute",e.style.top=i.top-(r.top-("absolute"===s?0:this.parent.element.offsetTop))-o+"px",e.style.left=i.left+i.width-(r.left-("absolute"===s?0:this.parent.element.offsetLeft))+10+"px",e.style.width="120px",e.style.height="120px",e.style.zIndex="5",e.style.color="black",e.style.backgroundColor="lightyellow",!n||je(t)||je(t.notes)?e.innerHTML="":e.innerHTML=t.notes,this.parent.element.appendChild(e)},xue.prototype.createConnectorLine=function(e,t){var i=this.parent.createElement("canvas",{className:"e-connectorLine",styles:"width: 100px; position: absolute;  z-index: 1;"}),n=i.getContext("2d"),o=this.parent.element.getBoundingClientRect(),r=this.parent.element.style.getPropertyValue("position");i.style.left=t.left+t.width-(o.left-("absolute"===r?0:this.parent.element.offsetLeft))+"px",i.style.top=e.getBoundingClientRect().top-(o.top-("absolute"===r?0:this.parent.element.offsetTop))-5+"px",n.clearRect(0,0,i.width,i.height),n.beginPath(),e.getBoundingClientRect().top===t.top?n.moveTo(0,16):n.moveTo(0,30),n.lineTo(30,15),n.strokeStyle="black",n.lineWidth=5,n.stroke(),this.parent.element.appendChild(i),0<e.getBoundingClientRect().top?(i.style.display="block",i.style.zIndex="4"):i.style.display="none"},xue.prototype.showNote=function(e){var t=je(this.parent.getCell(e.rowIndex,e.columnIndex))?e.cellElement:this.parent.getCell(e.rowIndex,e.columnIndex),i=document.getElementById(this.parent.element.id+"_contextmenu"),i=je(i)?"none":i.style.getPropertyValue("display"),i=!!e.isNoteEditable||"block"!==i;!je(t)&&je(document.getElementsByClassName("e-addNoteContainer")[0])&&i&&(e.isScrollWithNote||null!==t.children&&0<t.children.length&&t.children[t.children.length-1].classList.contains("e-addNoteIndicator"))&&(this.createNoteContainer(t,e.rowIndex,e.columnIndex,!0,e.isNoteEditable),this.noteCellIndexes=[e.rowIndex,e.columnIndex])},xue.prototype.removeNoteContainer=function(){E.remove(document.getElementsByClassName("e-addNoteContainer")[0],"mouseout",this.mouseOut),E.remove(document.getElementsByClassName("e-connectorLine")[0],"mouseout",this.mouseOut),this.parent.element.removeChild(document.getElementsByClassName("e-addNoteContainer")[0]),this.parent.element.removeChild(document.getElementsByClassName("e-connectorLine")[0]),this.noteCellIndexes=null,this.isNoteVisible=!1,this.isNoteVisibleOnTouch=!1},xue.prototype.updateNoteContainer=function(){this.parent.selectionModule.isNoteActiveElement=-1<document.activeElement.className.indexOf("e-addNoteContainer")||this.parent.selectionModule.isNoteActiveElement;var e,t,i=je(this.noteCellIndexes)?ste(this.parent.getActiveSheet().activeCell):this.noteCellIndexes,n=Kre(i[0],i[1],this.parent.getActiveSheet()),o=document.getElementsByClassName("e-addNoteContainer")[0];(je(n)||je(n.notes)||n.notes!==o.value)&&this.parent.selectionModule.isNoteActiveElement&&(t=Wre(this.parent,this.parent.activeSheetIndex)+"!"+hte(i),this.parent.notify(Dae,{args:{action:"beforeCellSave",eventArgs:{address:t}}}),e=!je(n)&&n.notes?"editNote":"addNote",Yoe(this.parent,this.parent.getActiveSheet(),{rowIdx:i[0],colIdx:i[1],preventEvt:!0,cell:{notes:o.value,isNoteEditable:!0}}),o={notes:o.value,address:t},this.parent.notify(Vae,{eventArgs:o,action:e}),this.isShowNote=null),this.isShowNote=je(this.isShowNote)?this.parent.selectionModule.isNoteActiveElement:this.isShowNote,this.isShowNote?(t=!je(n)&&!je(n.isNoteEditable)&&n.isNoteEditable,this.parent.notify(Cae,""),this.parent.notify(vae,{rowIndex:i[0],columnIndex:i[1],isNoteEditable:!0,isScrollWithNote:t})):(this.parent.notify(Cae,""),this.isShowNote=null)};var Aue=xue;function xue(e){this.isNoteVisible=!1,this.isNoteVisibleOnTouch=!1,this.parent=e,this.addEventListener()}Tue.prototype.show=function(e,t){var i=this,n=(t=!!je(t),e.beforeOpen||null),o=e.close||null,r={header:"Spreadsheet",cssClass:this.parent.cssClass,target:this.parent.element,buttons:[],allowDragging:!0},t=(e.beforeOpen=function(e){n&&(n(e),e.cancel)&&(i.hide(!0),e.preventFocus||sce(i.parent.element))},e.close=function(){i.destroyDialog(),o&&o()},Pe(r,e),t&&(e=this.parent.serviceLocator.getService(ope).getConstant(r.buttons.length?"Cancel":"Ok"),r.buttons.push({buttonModel:{content:e,isPrimary:0===r.buttons.length},click:this.hide.bind(this)})),this.parent.createElement("div"));document.body.appendChild(t),this.dialogInstance=new pS(r),this.dialogInstance.createElement=this.parent.createElement,this.dialogInstance.appendTo(t),this.dialogInstance&&this.dialogInstance.refreshPosition()},Tue.prototype.destroyDialog=function(){this.dialogInstance.destroy(),ue(this.dialogInstance.element),this.dialogInstance=null},Tue.prototype.hide=function(e){this.dialogInstance&&(e&&(this.dialogInstance.animationSettings.effect="None",this.dialogInstance.dataBind()),this.dialogInstance.hide())},Tue.prototype.destroy=function(){this.parent=null};var Iue=Tue;function Tue(e){this.parent=e}Due.prototype.initializeActionBegin=function(){var t=this,i=this.parent.beforeCellFormat,n=(this.parent.beforeCellFormat=function(e){t.actionEventHandler({evtArgs:e,evtFunc:i,actionType:"begin",eventType:"format"})},this.parent.beforeOpen),o=(this.parent.beforeOpen=function(e){t.actionEventHandler({evtArgs:e,evtFunc:n,actionType:"begin",eventType:"beforeOpen"})},this.parent.beforeSave),r=(this.parent.beforeSave=function(e){t.actionEventHandler({evtArgs:e,evtFunc:o,actionType:"begin",eventType:"beforeSave"})},this.parent.beforeSort);this.parent.beforeSort=function(e){t.actionEventHandler({evtArgs:e,evtFunc:r,actionType:"begin",eventType:"beforeSort"})}},Due.prototype.initializeActionComplete=function(){var t=this,i=this.parent.sortComplete,n=(this.parent.sortComplete=function(e){t.actionEventHandler({evtArgs:e,evtFunc:i,actionType:"complete",eventType:"sorting"})},this.parent.cellSave);this.parent.cellSave=function(e){t.actionEventHandler({evtArgs:e,evtFunc:n,actionType:"complete",eventType:"cellSave"})}},Due.prototype.actionEventHandler=function(e){e.evtFunc&&e.evtFunc.apply(this,[e]),"begin"===e.actionType?this.actionBeginHandler({eventArgs:e.evtArgs,action:e.eventType}):this.actionCompleteHandler({eventArgs:e.evtArgs,action:e.eventType})},Due.prototype.actionBeginHandler=function(e){var t=e.preventAction,i=(delete e.preventAction,{action:e.action});e.isUndo&&(i.isUndo=!0,delete e.isUndo),e.isRedo&&(i.isUndo=!1,delete e.isRedo),i.args=e,this.parent.trigger("actionBegin",i),t||this.parent.isPrintingProcessing||"clipboard"!==e.action&&"format"!==e.action&&"cellSave"!==e.action&&"addNote"!==e.action&&"editNote"!==e.action&&"deleteNote"!==e.action&&"beforeWrap"!==e.action&&"beforeReplace"!==e.action&&"filter"!==e.action&&"beforeClear"!==e.action&&"beforeInsertImage"!==e.action&&"beforeInsertChart"!==e.action&&"chartDesign"!==e.action&&"cellDelete"!==e.action&&"autofill"!==e.action&&"validation"!==e.action&&"removeValidation"!==e.action&&"hyperlink"!==e.action&&"removeHyperlink"!==e.action&&"deleteImage"!==e.action||this.parent.notify(Dae,{args:e}),t&&(e.preventAction=!0),i.isUndo&&(e.isUndo=!0),!1===i.isUndo&&(e.isRedo=!0)},Due.prototype.actionCompleteHandler=function(e){var t=e.preventAction;delete e.preventAction,this.parent.notify(uie,e),e.preventEventTrigger||this.parent.trigger("actionComplete",e),t||"undoRedo"===e.action||"gotoSheet"===e.action||this.parent.notify(Eae,{args:e}),this.parent.notify(Jle,null)},Due.prototype.addEventListener=function(){this.parent.on(Vae,this.actionCompleteHandler,this),this.parent.on(fie,this.actionBeginHandler,this),this.parent.on(gse,this.removeEventListener,this)},Due.prototype.removeEventListener=function(){this.parent.off(Vae,this.actionCompleteHandler),this.parent.off(fie,this.actionBeginHandler),this.parent.off(gse,this.removeEventListener)};var Eue=Due;function Due(e){this.parent=e,this.addEventListener()}kue.prototype.insertOverlayElement=function(e,t,i){var n,o,e=this.parent.createElement("div",{id:e,attrs:{class:"e-ss-overlay"},styles:"width: "+this.minWidth+";  height: "+this.minHeight}),r=(this.parent.allowEditing&&((r=this.parent.element.getElementsByClassName("e-ss-overlay-active")[0])&&(q([r],"e-ss-overlay-active"),this.parent.notify(Vle,{})),e.classList.add("e-ss-overlay-active")),rte(t)),t=this.parent.sheets[i],s=this.parent.frozenRowCount(t),a=this.parent.frozenColCount(t),l=Cpe(t,r,s,a,this.parent.viewport.beforeFreezeHeight,this.parent.viewport.beforeFreezeWidth,this.parent.sheetModule.colGroupWidth,!0);return r[0]>=s&&r[1]<a&&(n=this.parent.sheetModule.contentPanel).scrollTop&&(l.top-=n.scrollTop,l.top+=this.parent.getColumnHeaderContent().parentElement.getBoundingClientRect().height),r[1]>=a&&r[0]<s&&(n=this.parent.getScrollElement()).scrollLeft&&(l.left-=n.scrollLeft,l.left+=this.parent.sheetModule.getRowHeaderWidth(t)),r[0]<s||r[1]<a?(o=this.parent.element.querySelector("#"+this.parent.element.id+"_sheet"),s&&(r[0]>=s?l.top+=(t.showHeaders?31:0)+Ude(t,ste(t.topLeftCell)[0],s-1):a||(l.left+=this.parent.sheetModule.getRowHeaderWidth(t,!0))),a&&(r[1]>=a?l.left+=this.parent.sheetModule.getRowHeaderWidth(t):s||(l.left+=t.showHeaders?31:0))):o=this.parent.getMainContent(),e.style.top=Number(cce(l.top).toFixed(2))+"px",e.style.left=Number(cce(l.left).toFixed(2))+"px",i===this.parent.activeSheetIndex?(o.appendChild(e),this.renderResizeHandler(e),this.addEventListener(e)):this.parent.isPrintingProcessing&&(e.style.visibility="hidden",document.body.append(e)),this.originalWidth=parseFloat(getComputedStyle(e,null).getPropertyValue("width").replace("px","")),this.originalHeight=parseFloat(getComputedStyle(e,null).getPropertyValue("height").replace("px","")),{element:e,top:l.top,left:l.left}},kue.prototype.adjustFreezePaneSize=function(e,t,i){var i=rte(i),n=this.parent.getActiveSheet(),o=this.parent.frozenRowCount(n),r=this.parent.frozenColCount(n);i[0]<o||i[1]<r?(je(e.top)||(t.style.top=e.top+(n.showHeaders?31:0)-this.parent.viewport.beforeFreezeHeight+"px"),je(e.left)||(t.style.left=e.left+this.parent.sheetModule.getRowHeaderWidth(n,!0)-this.parent.viewport.beforeFreezeWidth+"px")):(je(e.top)||(t.style.top=e.top-this.parent.viewport.beforeFreezeHeight-(o?Ude(n,ste(n.topLeftCell)[0],o-1):0)+"px"),je(e.left)||(t.style.left=e.left-this.parent.viewport.beforeFreezeWidth-(r?$de(n,ste(n.topLeftCell)[1],r-1):0)+"px")),je(e.top)&&(t=ste(n.topLeftCell)[0],e.top=this.parent.viewport.beforeFreezeHeight+(o&&t===i[0]?0:Ude(n,o?t:0,i[0]-1))),je(e.left)&&(o=ste(n.topLeftCell)[1],e.left=this.parent.viewport.beforeFreezeWidth+(r&&o===i[1]?0:$de(n,r?o:0,i[1]-1)))},kue.prototype.addEventListener=function(e){E.add(e,Tpe(),this.overlayClickHandler,this),E.add(e,Epe(),this.overlayMouseMoveHandler,this),E.add(this.parent.element.querySelector("#"+this.parent.element.id+"_sheet"),Epe(),this.overlayMouseMoveHandler,this),E.add(document,Dpe(),this.overlayMouseUpHandler,this),this.parent.on(Xle,this.setOriginalSize,this)},kue.prototype.setOriginalSize=function(e){this.originalHeight=e.height,this.originalWidth=e.width},kue.prototype.overlayMouseMoveHandler=function(e){var t,i,n=e.target,o=document.getElementsByClassName("e-ss-overlay-active")[0],r=this.parent.getActiveSheet(),s=r.frozenRows||r.frozenColumns?[29,this.parent.sheetModule.getRowHeaderWidth(r,!0)]:[-1,-1];if(this.isOverlayClicked&&this.isResizerClicked)switch(kpe(e)&&e.preventDefault(),this.resizer){case"e-ss-overlay-t":i=Math.max(this.originalMouseY-Npe(e)+this.originalHeight,20),t=Npe(e)-(this.originalMouseY-this.originalResizeTop),20<i&&s[0]<t&&(o.style.height=i+"px",o.style.top=t+"px",this.resizedReorderTop=t,this.currenHeight=i,this.parent.notify(Yne,{height:o.style.height,width:o.style.width,overlayEle:o}));break;case"e-ss-overlay-r":20<(t=this.originalWidth+(Vpe(e)-this.originalMouseX))&&(o.style.width=t+"px",this.currentWidth=t,this.parent.notify(Yne,{height:o.style.height,width:o.style.width,overlayEle:o}));break;case"e-ss-overlay-b":20<(i=this.originalHeight+(_pe(e)-this.originalMouseY))&&(o.style.height=i+"px",this.currenHeight=i,this.parent.notify(Yne,{height:o.style.height,width:o.style.width,overlayEle:o}));break;case"e-ss-overlay-l":t=Math.max(this.originalMouseX-Ope(e)+this.originalWidth,20),i=Ope(e)-(this.originalMouseX-this.originalResizeLeft),20<t&&s[1]<i&&(o.style.width=t+"px",o.style.left=i+"px",this.resizedReorderLeft=i,this.currentWidth=t,this.parent.notify(Yne,{height:o.style.height,width:o.style.width,overlayEle:o}))}else this.isOverlayClicked&&(kpe(e)&&e.preventDefault(),z(n,".e-sheet")&&!n.classList.contains("e-sheet-content")||n.classList.contains("e-cell")?o&&(r=Ope(e)-this.diffX,n=Npe(e)-this.diffY,s[1]<r&&(o.style.left=r+"px"),s[0]<n&&(o.style.top=n+"px"),this.resizedReorderLeft=r<0?0:r,this.resizedReorderTop=n<0?0:n):this.overlayMouseUpHandler(e,!0))},kue.prototype.overlayMouseUpHandler=function(e,t){if(this.parent&&!this.parent.getActiveSheet().isProtected&&this.parent.allowEditing){this.isResizerClicked=!1;var i=e.target,n=document.getElementsByClassName("e-datavisualization-chart e-ss-overlay-active"),e=(i.classList.contains("e-ss-overlay")||(i=z(e.target,".e-datavisualization-chart")?z(e.target,".e-datavisualization-chart"):i),this.parent.getActiveSheet()),o={prevTop:e.frozenRows||e.frozenColumns?this.prevY:this.originalReorderTop,prevLeft:e.frozenRows||e.frozenColumns?this.prevX:this.originalReorderLeft,currentTop:0<=this.resizedReorderTop?parseInt(this.resizedReorderTop.toString(),10):this.originalReorderTop,currentLeft:0<=this.resizedReorderLeft?parseInt(this.resizedReorderLeft.toString(),10):this.originalReorderLeft,id:i.id,currentHeight:this.currenHeight,currentWidth:this.currentWidth,requestType:"imageRefresh",prevHeight:this.originalHeight,prevWidth:this.originalWidth};if(this.isOverlayClicked||t){var t=void 0,r=void 0,s={clientY:o.prevTop,isImage:!0},a={clientX:o.prevLeft,isImage:!0},l=this.parent.element.getElementsByClassName("e-ss-overlay-active")[0];if(e.frozenRows||e.frozenColumns){if(!l)return;a.isImage=s.isImage=!1,a.target=s.target=l,o.prevTop<this.parent.getColumnHeaderContent().getBoundingClientRect().bottom&&(s.target=this.parent.getColumnHeaderContent()),o.prevLeft<this.parent.getRowHeaderContent().getBoundingClientRect().right&&(a.target=this.parent.getRowHeaderTable());var h=l.getBoundingClientRect(),t={clientY:h.top},r={clientX:h.left};h.top<this.parent.getColumnHeaderContent().getBoundingClientRect().bottom&&(t.target=this.parent.getColumnHeaderContent()),h.left<this.parent.getRowHeaderContent().getBoundingClientRect().right&&(r.target=this.parent.getRowHeaderTable())}else t={clientY:o.currentTop,isImage:!0},r={clientX:o.currentLeft,isImage:!0};this.parent.notify(xle,s),this.parent.notify(xle,t),this.parent.notify(Ile,a),this.parent.notify(Ile,r),t.size&&(o.currentTop=t.size),r.size&&(o.currentLeft=r.size),o.prevRowIdx=s.clientY,o.prevColIdx=a.clientX,o.currentRowIdx=t.clientY,o.currentColIdx=r.clientX,!e.frozenColumns&&!e.frozenRows||z(l,".e-sheet-content")||(h=this.parent.frozenColCount(e),s=this.parent.frozenRowCount(e),o.currentRowIdx>=s&&o.currentColIdx>=h&&(a=parseInt(l.style.top,10),t=parseInt(l.style.left,10),a=(a+=this.parent.sheetModule.contentPanel.scrollTop)-this.parent.getColumnHeaderContent().parentElement.getBoundingClientRect().height,t=(t+=this.parent.getScrollElement().scrollLeft)-this.parent.sheetModule.getRowHeaderWidth(e),l.style.top=a+"px",l.style.left=t+"px",this.parent.getMainContent().appendChild(l))),n&&n[0]&&n[0].querySelector(".e-control")&&(o.id=n[0].id),this.originalReorderTop!==this.resizedReorderTop||this.originalReorderLeft!==this.resizedReorderLeft?(o.id=l.id,n&&n[0]?(o.requestType="chartRefresh",this.parent.notify(Mle,o)):this.parent.notify(Ale,o),this.resizedReorderTop=this.originalReorderTop,this.resizedReorderLeft=this.originalReorderLeft):this.currenHeight===this.originalHeight&&this.originalWidth===this.currentWidth||(o.id=(0<i.id.indexOf("overlay")?i:i.parentElement&&i.parentElement.classList.contains("e-ss-overlay")?i.parentElement:l).id,n&&n[0]?(o.requestType="chartRefresh",this.parent.notify(Mle,o)):this.parent.notify(Ale,o),this.originalHeight=this.currenHeight,this.originalWidth=this.currentWidth)}this.isOverlayClicked=!1}},kue.prototype.isOverlaySelected=function(e){e.isOverlayClicked=this.isOverlayClicked},kue.prototype.refreshOverlayElem=function(e){if(e){var t=".e-ss-overlay-active"+(e&&e.selector||""),e=this.parent.element.querySelector(t);e&&(q([e],"e-ss-overlay-active"),this.parent.notify(Vle,{}))}else for(var t="e-ss-overlay-active",i=Array.from(this.parent.element.getElementsByClassName(t)),n=0;n<i.length;n++){var o=i[n];o&&(q([o],"e-ss-overlay-active"),this.parent.notify(Vle,{}))}this.parent.notify(Lle,null)},kue.prototype.overlayClickHandler=function(e){var t,i,n,o,r;!this.parent.getActiveSheet().isProtected&&this.parent.allowEditing&&(this.isOverlayClicked=!0,t=e.target,i=e.target,t.classList.contains("e-ss-overlay")||(i=t.parentElement,z(e.target,".e-datavisualization-chart")&&(i=z(e.target,".e-datavisualization-chart"))),((o=this.parent.getActiveSheet()).frozenColumns||o.frozenRows)&&z(i,".e-sheet-content")&&(r=parseInt(i.style.top,10),n=parseInt(i.style.left,10),r=(r-=this.parent.sheetModule.contentPanel.scrollTop)+this.parent.getColumnHeaderContent().parentElement.getBoundingClientRect().height,n=(n-=this.parent.getScrollElement().scrollLeft)+this.parent.sheetModule.getRowHeaderWidth(o),i.style.top=r+"px",i.style.left=n+"px",this.parent.element.querySelector("#"+this.parent.element.id+"_sheet").appendChild(i)),this.originalWidth=this.currentWidth=parseFloat(i.style.width),this.originalHeight=this.currenHeight=parseFloat(i.style.height),this.originalReorderLeft=parseFloat(i.style.left),this.originalReorderTop=parseFloat(i.style.top),this.resizedReorderLeft=parseFloat(i.style.left),this.resizedReorderTop=parseFloat(i.style.top),this.originalResizeTop=this.originalReorderTop,this.originalResizeLeft=this.originalReorderLeft,this.originalMouseX=Ope(e),this.originalMouseY=Npe(e),this.diffX=this.originalMouseX-this.originalReorderLeft,this.diffY=this.originalMouseY-this.originalReorderTop,(o=document.getElementsByClassName("e-ss-overlay-active")[0])&&q([o],"e-ss-overlay-active"),this.parent.element.querySelector("#"+i.id).classList.add("e-ss-overlay-active"),t.classList.contains("e-ss-resizer")&&(this.resizer=t.classList[0],this.isResizerClicked=!0),i.classList.contains("e-datavisualization-chart")&&(this.parent.notify(Kne,{id:i.id}),o||this.parent.notify(Nle,{id:i.id})),r=i.getBoundingClientRect(),this.prevX=r.left,this.prevY=r.top)},kue.prototype.renderResizeHandler=function(e){for(var t,i=["e-ss-overlay-t","e-ss-overlay-r","e-ss-overlay-b","e-ss-overlay-l"],n=0;n<i.length;)t=this.parent.createElement("div",{className:i[n]+" e-ss-resizer"+(F.isDevice?" e-ss-resizer-touch":""),styles:"width: 8px; height: 8px; border-radius: 4px;"}),e.appendChild(t),n++},kue.prototype.removeEventListener=function(){var e=this.parent.element.querySelectorAll(".e-ss-overlay");if(e.length)for(var t=0;t<e.length;t++)E.remove(e[t],Tpe(),this.overlayClickHandler),E.remove(e[t],Epe(),this.overlayMouseMoveHandler);var i=this.parent.element.querySelector("#"+this.parent.element.id+"_sheet");i&&E.remove(i,Epe(),this.overlayMouseMoveHandler),document&&E.remove(document,Dpe(),this.overlayMouseUpHandler),this.parent.isDestroyed||(this.parent.off(Xle,this.setOriginalSize),this.parent.off(Gle,this.isOverlaySelected),this.parent.off(Sle,this.refreshOverlayElem),this.parent.off(gse,this.destroy))},kue.prototype.destroy=function(){this.removeEventListener(),this.currentWidth&&(this.currentWidth=null),this.currenHeight&&(this.currenHeight=null),this.minHeight&&(this.minHeight=null),this.minWidth&&(this.minWidth=null),this.isOverlayClicked&&(this.isOverlayClicked=null),this.isResizerClicked&&(this.isResizerClicked=null),this.parent=null};var Mue=kue;function kue(e){this.minHeight="300px",this.minWidth="400px",this.isOverlayClicked=!1,this.isResizerClicked=!1,this.currentWidth=400,this.currenHeight=300,this.parent=e,this.parent.on(Gle,this.isOverlaySelected,this),this.parent.on(Sle,this.refreshOverlayElem,this),this.parent.on(gse,this.destroy,this)}Pue=function(e,t){return(Pue=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])}))(e,t)};var Pue,Bue,bce=function(e,t){function i(){this.constructor=e}Pue(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Fue=function(){return(Fue=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Lue=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Rue=(bce(Oue,Bue=n),Lue([e("")],Oue.prototype,"text",void 0),Lue([e("")],Oue.prototype,"iconCss",void 0),Lue([e("left")],Oue.prototype,"iconPosition",void 0),Oue);function Oue(){return null!==Bue&&Bue.apply(this,arguments)||this}bce(_ue,Nue=n),Lue([t({},Rue)],_ue.prototype,"header",void 0),Lue([kt([],j3)],_ue.prototype,"content",void 0),Lue([e("")],_ue.prototype,"cssClass",void 0),Lue([e(!1)],_ue.prototype,"disabled",void 0);var Nue,Vue=_ue;function _ue(){return null!==Nue&&Nue.apply(this,arguments)||this}bce(jue,Hue=Ji),jue.prototype.preRender=function(){},jue.prototype.render=function(){this.element.id||(this.element.id=D("ribbon")),this.renderRibbon()},jue.prototype.destroy=function(){var e=this.element.querySelector(".e-drop-icon");e&&e.removeEventListener("click",this.ribbonExpandCollapse.bind(this)),this.menuItems.length&&(e=document.getElementById(this.element.id+"_menu"))&&At(e,"menu").destroy(),this.toolbarObj&&this.toolbarObj.destroy(),this.tabObj&&this.tabObj.destroy(),this.element.innerHTML="",this.toolbarObj=null,this.tabObj=null,Hue.prototype.destroy.call(this)},jue.prototype.getTabItems=function(){var t=this,i=[];return this.menuItems.length&&i.push({header:{text:this.initMenu(this.menuItems)},content:this.toolbarObj.element,cssClass:"e-menu-tab"}),this.items.forEach(function(e){i.push({header:e.header,content:t.toolbarObj.element})}),i},jue.prototype.initMenu=function(t){var i=this,e=this.createElement("ul",{id:this.element.id+"_menu"}),n=(this.element.appendChild(e),new L4({cssClass:"e-file-menu",items:t,showItemOnClick:!0,beforeOpen:function(e){e.parentItem.text===t[0].text&&(n.showItemOnClick=!1),i.trigger("beforeOpen",e)},select:function(e){i.trigger("fileMenuItemSelect",e)},beforeClose:function(e){"mouseover"!==e.event.type||z(e.event.target,".e-menu-popup")?(i.trigger("beforeClose",e),e.parentItem&&e.parentItem.text!==t[0].text||n.setProperties({showItemOnClick:!0},!0)):e.cancel=!0},beforeItemRender:function(e){i.trigger("beforeFileMenuItemRender",e)},created:function(){n.element.removeAttribute("tabindex");var e=n.element.querySelector(".e-menu-item");e&&e.removeAttribute("tabindex")}}));return n.createElement=this.createElement,n.appendTo(e),e.parentElement},jue.prototype.renderRibbon=function(){var i,n=this,e=this.createElement("div"),t=this.createElement("div"),t=(this.toolbarObj=new U3({items:this.items[this.selectedTab].content,clicked:function(e){return n.trigger("clicked",e)}}),this.toolbarObj.createElement=this.createElement,this.toolbarObj.appendTo(t),this.tabObj=new k5({selectedItem:this.getIndex(this.selectedTab),animation:{next:{duration:0},previous:{duration:0}},items:this.getTabItems(),selecting:function(e){var t;e.isSwiped?e.cancel=!0:(i=e.event&&e.event.isShortcut,n.menuItems.length&&0===e.selectingIndex?(e.cancel=!0,e.event&&!i&&"keydown"!==e.event.type||!e.selectingItem||(t=e.selectingItem.querySelector(".e-file-menu .e-menu-item"))&&t.click()):e.selectingIndex!==n.getIndex(n.selectedTab)&&(n.updateToolbar(n.getIndex(e.selectingIndex,!0)),n.toolbarObj.dataBind(),n.refreshTemplateItems(n.toolbarObj),n.element.classList.contains("e-collapsed")&&E.remove(e.selectedItem,"click",n.ribbonExpandCollapse),t=void 0,n.menuItems.length?(--(t=Fue({},e)).selectingIndex,--t.selectedIndex):t=e,n.trigger("selecting",t)))},selected:function(e){e.isInteracted||i||(e.preventFocus=!0),e.selectedIndex!==n.getIndex(n.selectedTab)&&(n.setProperties({selectedTab:n.getIndex(e.selectedIndex,!0)},!0),n.element.classList.contains("e-collapsed"))&&(n.element.classList.remove("e-collapsed"),n.trigger("expandCollapse",{element:n.toolbarObj.element,expanded:!0}))},created:function(){n.toolbarObj.refreshOverflow()}}),this.element.appendChild(e),this.tabObj.createElement=this.createElement,this.tabObj.appendTo(e),this.createElement("span",{className:"e-drop-icon e-icons"}));t.addEventListener("click",this.ribbonExpandCollapse.bind(this)),this.element.appendChild(t)},jue.prototype.ribbonExpandCollapse=function(e){var t,i={element:this.toolbarObj.element,expanded:!0};this.element.classList.contains("e-collapsed")?(t=this.tabObj.element.querySelector(".e-tab-header").getElementsByClassName("e-toolbar-item")[this.tabObj.selectedItem],this.element.classList.remove("e-collapsed"),t.classList.add("e-active"),E.remove(t,"click",this.ribbonExpandCollapse)):(t=this.tabObj.element.querySelector(".e-tab-header .e-toolbar-item.e-active"),this.element.classList.add("e-collapsed"),i.expanded=!1,t.classList.remove("e-active"),E.add(t,"click",this.ribbonExpandCollapse,this)),this.trigger("expandCollapse",i)},jue.prototype.getIndex=function(e,t){return this.menuItems.length?t?e-1:e+1:e},jue.prototype.updateToolbar=function(e){this.toolbarObj.items=this.items[e].content,this.toolbarObj.dataBind()},jue.prototype.refreshTemplateItems=function(e){this.spreadInstance&&this.spreadInstance.isReact&&this.spreadInstance.portals&&e&&e.portals&&(this.spreadInstance.portals=this.spreadInstance.portals.concat(e.portals),this.spreadInstance.renderReactTemplates())},jue.prototype.enableMenuItems=function(e,t,i){void 0===t&&(t=!0),this.menuItems.length&&At(document.getElementById(this.element.id+"_menu"),"menu").enableItems(e,t,i)},jue.prototype.hideMenuItems=function(e,t,i){var n;void 0===t&&(t=!0),this.menuItems.length&&(n=At(document.getElementById(this.element.id+"_menu"),"menu"),t?n.hideItems(e,i):n.showItems(e,i))},jue.prototype.addMenuItems=function(e,t,i,n){var o;void 0===i&&(i=!0),this.menuItems.length&&(o=At(document.getElementById(this.element.id+"_menu"),"menu"),i?o.insertAfter(e.reverse(),t,n):o.insertBefore(e,t,n))},jue.prototype.hideTabs=function(e,t){var i,n,o,r,s=this;if((t=void 0===t?!0:t)||(r=this.isAllHidden()),e.forEach(function(e){-1<(i=s.getTabIndex(e,-1))&&(t?s.items[i].cssClass.includes(" e-hide")||(s.items[i].cssClass=s.items[i].cssClass+" e-hide",s.tabObj.items[s.getIndex(i)].cssClass=s.items[i].cssClass,void 0===n&&i===s.selectedTab&&(n=!0),o=!0):s.items[i].cssClass.includes(" e-hide")&&(s.items[i].cssClass=s.items[i].cssClass.replace(" e-hide",""),s.tabObj.items[s.getIndex(i)].cssClass=s.items[i].cssClass,void 0===n&&i===s.selectedTab&&(n=!0),o=!0))}),this.setProperties({items:this.items},!0),this.tabObj.items=this.tabObj.items,this.tabObj.dataBind(),t&&(r=this.isAllHidden())&&(n=!1),!t&&r&&(n=!n),o&&r&&(this.element.classList.contains("e-collapsed")?(this.element.classList.remove("e-collapsed"),this.element.querySelector(".e-drop-icon").classList.remove("e-hide")):(this.element.classList.add("e-collapsed"),this.element.querySelector(".e-drop-icon").classList.add("e-hide"))),n)for(var a=0;a<this.items.length;a++)if(!this.items[a].cssClass.includes(" e-hide")){this.tabObj.selectedItem=this.getIndex(a),this.tabObj.dataBind();break}},jue.prototype.isAllHidden=function(){for(var e=!0,t=0;t<this.items.length;t++)if(!this.items[t].cssClass.includes(" e-hide")){e=!1;break}return e},jue.prototype.enableTabs=function(e,t){var i=this;void 0===t&&(t=!0),e.forEach(function(e){e=i.getTabIndex(e,-1);-1<e&&(i.items[e].disabled=!t,e=i.getIndex(e),i.tabObj.enableTab(e,t))}),this.setProperties({items:this.items},!0)},jue.prototype.addTabs=function(e,t){var i=this,n=this.getTabIndex(t);e.forEach(function(e){e=new Vue(i.items[0],"items",e,!0),i.items.splice(n,0,e),i.tabObj.addTab([{header:e.header,content:i.toolbarObj.element}],i.getIndex(n)),n++}),this.setProperties({items:this.items},!0),this.setProperties({selectedTab:this.getIndex(this.tabObj.selectedItem,!0)},!0)},jue.prototype.getTabIndex=function(e,t){if(void 0===t&&(t=this.items.length),e)for(var i=0;i<this.items.length;i++)if(this.items[i].header.text===e){t=i;break}return t},jue.prototype.addToolbarItems=function(e,t,i){var n=this,o=this.getTabIndex(e);je(i)&&(i=this.items[o].content.length),t.forEach(function(e){e=new j3(n.items[o].content[0],"content",e,!0),n.items[o].content.splice(i,0,e),i++}),this.setProperties({items:this.items},!0),o===this.selectedTab&&t.length&&this.updateToolbar(o)},jue.prototype.enableItems=function(e,t,i){if(void 0===i&&(i=!0),t){var n=this.getTabIndex(e,-1);if(!(n<0))for(var o=0;o<t.length;o++){if("string"==typeof t[o])for(var r=0;r<this.items[n].content.length;r++)if(this.items[n].content[r].id===t[o]){t[o]=r;break}if("string"==typeof t[o]){if(t.length-1>o)continue;return}this.items[n].content[t[o]].disabled=!i,this.setProperties({items:this.items},!0),n===this.selectedTab&&this.toolbarObj.enableItems(t[o],i)}}else this.toolbarObj.disable(!i)},jue.prototype.hideToolbarItems=function(e,t,i){var n,o,r=this;void 0===i&&(i=!0);for(var s=0;s<this.items.length;s++)if(this.items[s].header.text===e){n=s,t.forEach(function(e){(o=r.items[n].content[e])&&(i?o.cssClass.includes(" e-hide")||(o.cssClass=o.cssClass+" e-hide"):o.cssClass.includes(" e-hide")&&(o.cssClass=o.cssClass.replace(" e-hide","")))});break}this.setProperties({items:this.items},!0),void 0!==n&&n===this.selectedTab&&this.updateToolbar(n)},jue.prototype.getModuleName=function(){return"ribbon"},jue.prototype.getPersistData=function(){return this.addOnPersist([])},jue.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)"selectedTab"===n[i]&&(this.tabObj.selectedItem=this.getIndex(e.selectedTab),this.tabObj.dataBind())},Lue([e("")],jue.prototype,"cssClass",void 0),Lue([e(!0)],jue.prototype,"menuType",void 0),Lue([kt([],e3)],jue.prototype,"menuItems",void 0),Lue([e(0)],jue.prototype,"selectedTab",void 0),Lue([kt([],Vue)],jue.prototype,"items",void 0),Lue([e(null)],jue.prototype,"spreadInstance",void 0),Lue([i()],jue.prototype,"selecting",void 0),Lue([i()],jue.prototype,"fileMenuItemSelect",void 0),Lue([i()],jue.prototype,"beforeFileMenuItemRender",void 0),Lue([i()],jue.prototype,"beforeOpen",void 0),Lue([i()],jue.prototype,"beforeClose",void 0),Lue([i()],jue.prototype,"selectFormat",void 0),Lue([i()],jue.prototype,"clicked",void 0),Lue([i()],jue.prototype,"created",void 0),Lue([i()],jue.prototype,"expandCollapse",void 0);var Hue,zue=Lue([Bt],jue);function jue(e,t){return Hue.call(this,e)||this}Que.prototype.render=function(){function e(e){e.element.tabIndex=-1}var i=this,t=this.parent.element.id,n=this.parent.createElement("input",{attrs:{type:"color"}});this.fontColorPicker=new cV({value:"#000000ff",mode:"Palette",showButtons:!1,presetColors:lpe,enableOpacity:!1,cssClass:"e-spreadsheet-color-popup",beforeTileRender:e,beforeClose:function(){return i.beforeCloseHandler(i.fontColorPicker)},open:this.openHandler.bind(this),beforeModeSwitch:function(e){return i.beforeModeSwitch(i.fontColorPicker,e)},change:function(e){var t={style:{color:i.fontColorPicker.getValue(e.currentValue.rgba)},onActionUpdate:!0};i.parent.notify(Tie,t),t.cancel?i.fontColorPicker.setProperties({value:i.fontColorPicker.getValue(e.previousValue.rgba,"HEXA")},!0):i.updateSelectedColor(t.style.color,i.fontColorPicker.element,"TextColor")},created:function(){return i.updateSelectedColor("#000000",i.fontColorPicker.element,"TextColor",!0)}}),this.fontColorPicker.createElement=this.parent.createElement,this.parent.element.appendChild(n),this.fontColorPicker.appendTo(n),n.parentElement.id=t+"_font_color_picker",U([n.nextElementSibling.getElementsByClassName("e-selected-color")[0]],["e-icons","e-font-color"]),n=this.parent.createElement("input",{attrs:{type:"color"}}),this.filColorPicker=new cV({value:"#ffff00ff",mode:"Palette",presetColors:hpe,showButtons:!1,enableOpacity:!1,cssClass:"e-spreadsheet-color-popup",open:this.openHandler.bind(this),beforeTileRender:e,beforeClose:function(){return i.beforeCloseHandler(i.filColorPicker)},beforeModeSwitch:function(e){return i.beforeModeSwitch(i.filColorPicker,e)},change:function(e){var t={style:{backgroundColor:i.filColorPicker.getValue(e.currentValue.rgba)},onActionUpdate:!0};i.parent.notify(Tie,t),t.cancel?i.filColorPicker.setProperties({value:i.filColorPicker.getValue(e.previousValue.rgba,"HEXA")},!0):i.updateSelectedColor(t.style.backgroundColor,i.filColorPicker.element,"FillColor")},created:function(){return i.updateSelectedColor("#ffff00",i.filColorPicker.element,"FillColor",!0)}}),this.filColorPicker.createElement=this.parent.createElement,this.parent.element.appendChild(n),this.filColorPicker.appendTo(n),n.parentElement.id=t+"_fill_color_picker",U([n.nextElementSibling.getElementsByClassName("e-selected-color")[0]],["e-icons","e-fill-color"])},Que.prototype.updateSelectedColor=function(e,t,i,n){i=this.parent.serviceLocator.getService(ope).getConstant(i),n&&t.parentElement.querySelector(".e-dropdown-btn").setAttribute("aria-label",i),n=t.parentElement.querySelector(".e-split-colorpicker");n.setAttribute("aria-label",i+" "+e),n.firstElementChild.style.borderBottomColor=e},Que.prototype.openHandler=function(e){e.element.querySelector(".e-mode-switch-btn").title=this.parent.serviceLocator.getService(ope).getConstant("MoreColors")},Que.prototype.beforeCloseHandler=function(e){e.modeSwitcher||e.setProperties({modeSwitcher:!0},!0),e.showButtons&&e.setProperties({showButtons:!1},!0),sce(e.element.parentElement.querySelector(".e-split-colorpicker"))},Que.prototype.beforeModeSwitch=function(e,t){var i=this.parent.serviceLocator.getService(ope);"Picker"===t.mode?(e.showButtons=!0,e.dataBind(),t.element.querySelector(".e-apply").title=i.getConstant("Apply"),t.element.querySelector(".e-cancel").title=i.getConstant("Cancel"),t.element.querySelector(".e-mode-switch-btn").title=i.getConstant("StandardColors")):(e.showButtons=!1,e.dataBind(),t.element.querySelector(".e-mode-switch-btn").title=i.getConstant("MoreColors"))},Que.prototype.destroy=function(){this.parent&&(this.removeEventListener(),this.fontColorPicker&&this.fontColorPicker.destroy(),this.fontColorPicker=null,this.filColorPicker&&this.filColorPicker.destroy(),this.filColorPicker=null,this.parent=null)},Que.prototype.addEventListener=function(){this.parent.on(tae,this.render,this),this.parent.on("destroyRibbonComponents",this.destroy,this),this.parent.on(gse,this.destroy,this)},Que.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(tae,this.render),this.parent.off("destroyRibbonComponents",this.destroy),this.parent.off(gse,this.destroy))};var Wue=Que;function Que(e){this.parent=e,this.addEventListener()}que.prototype.getModuleName=function(){return"ribbon"},que.prototype.ribbonOperation=function(e){e&&e.onPropertyChange?this.onPropertyChanged(e.prop):this.initialize()},que.prototype.initialize=function(e){this.parent.notify(tae,{}),this.parent.isMobileView()?this.createMobileView():(e=e&&(this.parent.element.querySelector(".e-formula-bar-panel")||document.getElementById(this.parent.element.id+"_sheet_panel")),this.createRibbon(e))},que.prototype.getRibbonMenuItems=function(){var e=this.parent.serviceLocator.getService(ope),t=this.parent.element.id;return[{text:this.parent.isMobileView()?"":e.getConstant("File"),iconCss:this.parent.isMobileView()?"e-icons e-file-menu-icon":null,id:t+"_File",items:[{text:e.getConstant("New"),id:t+"_New",iconCss:"e-new e-icons"},{text:e.getConstant("Open"),id:t+"_Open",iconCss:"e-open e-icons"},{text:e.getConstant("SaveAs"),iconCss:"e-save e-icons",id:t+"_Save_As",items:[{text:e.getConstant("ExcelXlsx"),id:t+"_Xlsx",iconCss:"e-xlsx e-icons"},{text:e.getConstant("ExcelXls"),id:t+"_Xls",iconCss:"e-xls e-icons"},{text:e.getConstant("CSV"),id:t+"_Csv",iconCss:"e-csv e-icons"},{text:e.getConstant("PDF"),id:t+"_Pdf",iconCss:"e-pdf e-icons"}]},{text:e.getConstant("Print"),id:t+"_Print",iconCss:"e-print e-icons"}]}]},que.prototype.getRibbonItems=function(){var e=this,t=this.parent.element.id,i=this.parent.serviceLocator.getService(ope),n=[{header:{text:i.getConstant("Home")},content:[{prefixIcon:"e-undo-icon",tooltipText:i.getConstant("Undo")+" (Ctrl+Z)",htmlAttributes:{"aria-label":i.getConstant("Undo")},id:t+"_undo",disabled:!0},{prefixIcon:"e-redo-icon",tooltipText:i.getConstant("Redo")+" (Ctrl+Y)",htmlAttributes:{"aria-label":i.getConstant("Redo")},id:t+"_redo",disabled:!0},{type:"Separator",id:t+"_separator_1"},{prefixIcon:"e-cut-icon",tooltipText:i.getConstant("Cut")+" (Ctrl+X)",htmlAttributes:{"aria-label":i.getConstant("Cut")},id:t+"_cut"},{prefixIcon:"e-copy-icon",tooltipText:i.getConstant("Copy")+" (Ctrl+C)",htmlAttributes:{"aria-label":i.getConstant("Copy")},id:t+"_copy"},{tooltipText:i.getConstant("Paste")+" (Ctrl+V)",template:this.getPasteBtn(t,i),id:t+"_paste",disabled:!0},{type:"Separator",id:t+"_separator_2"},{template:this.getNumFormatDDB(t,i),tooltipText:i.getConstant("NumberFormat"),id:t+"_number_format"},{type:"Separator",id:t+"_separator_3"},{template:this.getFontNameDDB(t),tooltipText:i.getConstant("Font"),id:t+"_font_name"},{type:"Separator",id:t+"_separator_4"},{template:this.getFontSizeDDB(t),tooltipText:i.getConstant("FontSize"),id:t+"_font_size"},{type:"Separator",id:t+"_separator_5"},{template:this.getBtn(t,"bold",i.getConstant("Bold")),tooltipText:i.getConstant("Bold")+" (Ctrl+B)",id:t+"_bold"},{template:this.getBtn(t,"italic",i.getConstant("Italic")),tooltipText:i.getConstant("Italic")+" (Ctrl+I)",id:t+"_italic"},{template:this.getBtn(t,"line-through",i.getConstant("Strikethrough")),tooltipText:i.getConstant("Strikethrough")+" (Ctrl+5)",id:t+"_line-through"},{template:this.getBtn(t,"underline",i.getConstant("Underline")),tooltipText:i.getConstant("Underline")+" (Ctrl+U)",id:t+"_underline"},{template:document.getElementById(t+"_font_color_picker"),tooltipText:i.getConstant("TextColor"),id:t+"_font_color_picker"},{type:"Separator",id:t+"_separator_6"},{template:document.getElementById(t+"_fill_color_picker"),tooltipText:i.getConstant("FillColor"),id:t+"_fill_color_picker"},{template:this.getBordersDBB(t),tooltipText:i.getConstant("Borders"),id:t+"_borders"},{template:this.getMergeSplitBtn(t),tooltipText:i.getConstant("MergeCells"),id:t+"_merge_cells",disabled:!0},{type:"Separator",id:t+"_separator_7"},{template:this.getTextAlignDDB(t),tooltipText:i.getConstant("HorizontalAlignment"),id:t+"_text_align"},{template:this.getVerticalAlignDDB(t),tooltipText:i.getConstant("VerticalAlignment"),id:t+"_vertical_align"},{template:this.getBtn(t,"wrap",i.getConstant("WrapText"),!1),tooltipText:""+i.getConstant("WrapText"),id:t+"_wrap"}]},{header:{text:i.getConstant("Insert")},content:[{prefixIcon:"e-hyperlink-icon",text:i.getConstant("Link"),id:t+"_hyperlink",tooltipText:i.getConstant("Link"),click:function(){e.getHyperlinkDlg()}},{prefixIcon:"e-image-icon",text:i.getConstant("Image"),id:t+"_image",tooltipText:i.getConstant("Image"),click:function(){ge("#"+t+"_imageUpload",e.parent.element).click()}}]},{header:{text:i.getConstant("Formulas")},content:[{prefixIcon:"e-insert-function",tooltipText:i.getConstant("InsertFunction"),text:i.getConstant("InsertFunction"),id:t+"_insert_function"},{type:"Separator",id:t+"_separator_14"},{template:this.createCalcOptions(t,i),tooltipText:i.getConstant("CalcOptionsTip"),id:t+"_calc_types"},{type:"Separator",id:t+"_separator_15"},{prefixIcon:"e-calculate-sheet",tooltipText:i.getConstant("CalcSheetTip"),text:i.getConstant("CalcActiveSheet"),id:t+"_calc_current_sheet",click:function(){e.parent.notify(Pie,{action:"ClearDependentCellCollection"}),e.parent.calculateNow("Sheet")},disabled:"Automatic"===this.parent.calculationMode},{prefixIcon:"e-calculation",tooltipText:i.getConstant("CalcWorkbookTip"),text:i.getConstant("CalcWorkbook"),id:t+"_calc_entire_sheets",click:function(){e.parent.notify(Pie,{action:"ClearDependentCellCollection"}),e.parent.calculateNow("Workbook")},disabled:"Automatic"===this.parent.calculationMode}]},{header:{text:i.getConstant("Data")},content:[{prefixIcon:"e-protect-icon",text:i.getConstant("ProtectSheet"),id:t+"_protect",tooltipText:i.getConstant("ProtectSheet")},{prefixIcon:"e-password-protect-icon",text:i.getConstant("ProtectWorkbook"),id:t+"_protectworkbook",tooltipText:i.getConstant("ProtectWorkbook")},{type:"Separator",id:t+"_separator_8"},{template:this.datavalidationDDB(t),tooltipText:i.getConstant("DataValidation"),id:t+"_datavalidation"}]},{header:{text:i.getConstant("View")},content:[{prefixIcon:"e-hide-headers",text:this.getLocaleText("Headers"),id:t+"_headers",tooltipText:this.getLocaleText("Headers")},{type:"Separator",id:t+"_separator_9"},{prefixIcon:"e-hide-gridlines",text:this.getLocaleText("GridLines"),id:t+"_gridlines",tooltipText:this.getLocaleText("GridLines")},{type:"Separator",id:t+"_separator_13"},{prefixIcon:"e-freeze-pane",text:i.getConstant("FreezePanes"),id:t+"_freezepanes",tooltipText:i.getConstant("FreezePanes"),disabled:!this.parent.allowFreezePane},{prefixIcon:"e-freeze-row",text:i.getConstant("FreezeRows"),id:t+"_freezerows",tooltipText:i.getConstant("FreezeRows"),disabled:!this.parent.allowFreezePane},{prefixIcon:"e-freeze-column",text:i.getConstant("FreezeColumns"),id:t+"_freezecolumns",tooltipText:i.getConstant("FreezeColumns"),disabled:!this.parent.allowFreezePane}]}];return this.parent.allowConditionalFormat&&n.find(function(e){return e.header&&e.header.text===i.getConstant("Home")}).content.push({type:"Separator",id:t+"_separator_10"},{template:this.getCFDBB(t),tooltipText:i.getConstant("ConditionalFormatting"),id:t+"_conditionalformatting"}),this.parent.allowChart&&n.find(function(e){return e.header&&e.header.text===i.getConstant("Insert")}).content.push({type:"Separator",id:t+"_separator_11"},{template:this.getChartDDB(t,!0),text:i.getConstant("Chart"),tooltipText:i.getConstant("Chart"),id:t+"_chart"}),this.parent.allowCellFormatting&&n.find(function(e){return e.header&&e.header.text===i.getConstant("Home")}).content.push({type:"Separator",id:t+"_separator_12"},{template:this.getClearDDB(t),tooltipText:i.getConstant("Clear"),id:t+"_clear"}),(this.parent.allowSorting||this.parent.allowFiltering)&&n.find(function(e){return e.header&&e.header.text===i.getConstant("Home")}).content.push({template:this.getSortFilterDDB(t),tooltipText:i.getConstant("SortAndFilter"),id:t+"_sorting"}),this.parent.allowFindAndReplace&&n.find(function(e){return e.header&&e.header.text===i.getConstant("Home")}).content.push({template:this.getFindBtn(t),prefixIcon:"e-tbar-search-icon tb-icons",tooltipText:i.getConstant("FindReplaceTooltip"),id:t+"_find"}),n},que.prototype.createCalcOptions=function(e,t){var i=Q("button",{id:e+"_calc_types",attrs:{type:"button"},className:"e-calc-types"}),n=Q("span",{className:"e-calc-types-text"});return n.innerText=t.getConstant("CalcOptions"),i.appendChild(n),this.calcTypeOptions=new u2({items:[{id:e+"_Automatic",text:t.getConstant("Automatic"),iconCss:"Automatic"===this.parent.calculationMode?"e-icons e-selected-icon":""},{id:e+"_Manual",text:t.getConstant("Manual"),iconCss:"Manual"===this.parent.calculationMode?"e-icons e-selected-icon":""}],createPopupOnClick:!0,iconCss:"e-calculation e-icons",cssClass:"e-flat e-calc-types"}),this.calcTypeOptions.select=this.selectCalcOptions.bind(this),this.calcTypeOptions.appendTo(i),i},que.prototype.selectCalcOptions=function(e){e.item.id===this.parent.element.id+"_Automatic"?(this.calcTypeOptions.items[0].iconCss="e-icons e-selected-icon",this.calcTypeOptions.items[1].iconCss="","Manual"===this.parent.calculationMode&&this.parent.notify(Pie,{action:"ClearDependentCellCollection"}),this.parent.setProperties({calculationMode:"Automatic"},!0),this.updateFormulaButtons(),this.parent.calculateNow("Workbook")):(this.calcTypeOptions.items[0].iconCss="",this.calcTypeOptions.items[1].iconCss="e-icons e-selected-icon",this.parent.setProperties({calculationMode:"Manual"},!0),this.updateFormulaButtons())},que.prototype.updateFormulaButtons=function(){var e=this.parent.serviceLocator.getService(ope);this.parent.notify(Lse,[{tab:e.getConstant("Formulas"),items:[this.parent.element.id+"_calc_current_sheet"],enable:"Manual"===this.parent.calculationMode}]),this.parent.notify(Lse,[{tab:e.getConstant("Formulas"),items:[this.parent.element.id+"_calc_entire_sheets"],enable:"Manual"===this.parent.calculationMode}])},que.prototype.getPasteBtn=function(e,t){var i=this,n=this.parent.element.appendChild(this.parent.createElement("button",{id:e+"_paste",attrs:{type:"button"}}));return this.pasteSplitBtn=new b2({iconCss:"e-icons e-paste-icon",items:[{text:t.getConstant("All"),id:"All"},{text:t.getConstant("Values"),id:"Values"},{text:t.getConstant("Formats"),id:"Formats"}],createPopupOnClick:!0,select:function(e){i.pasteSplitBtn.element.setAttribute("aria-label",t.getConstant("Paste")+" "+e.item.text),i.parent.notify(Hse,{type:e.item.id,isAction:!0,isInternal:!0})},click:function(){n.setAttribute("aria-label",t.getConstant("Paste")),i.parent.notify(Hse,{isAction:!0,isInternal:!0})},beforeOpen:function(e){e.element.setAttribute("aria-label",t.getConstant("Paste"))}}),this.pasteSplitBtn.createElement=this.parent.createElement,this.pasteSplitBtn.appendTo(n),n.parentElement},que.prototype.getHyperlinkDlg=function(){var e=this.parent.getActiveSheet(),t=rte(e.activeCell),t=Kre(t[0],t[1],e);t&&t.hyperlink?this.parent.notify(uae,null):this.parent.notify(cae,null)},que.prototype.passwordProtectDlg=function(){0<this.parent.password.length?this.parent.notify(Wle,null):document.getElementById(this.parent.element.id+"_protectworkbook").classList.contains("e-active")?(document.getElementById(this.parent.element.id+"_protectworkbook").classList.remove("e-active"),this.parent.showSheetTabs&&this.parent.element.querySelector(".e-add-sheet-tab").removeAttribute("disabled")):this.parent.notify(jle,null)},que.prototype.getLocaleText=function(e){var t=this.parent.serviceLocator.getService(ope),t=this.parent.getActiveSheet()["show"+e]?t.getConstant("Hide"+e):t.getConstant("Show"+e);return t},que.prototype.getLocaleProtectText=function(e,t){var i=this.parent.serviceLocator.getService(ope),t=this.parent.getActiveSheet().isProtected?(t&&this.parent.getMainContent().classList.remove("e-hide-"+e.toLowerCase()),i.getConstant("Unprotect"+e)):(t&&this.parent.getMainContent().classList.add("e-hide-"+e.toLowerCase()),i.getConstant("Protect"+e));return t},que.prototype.getLocaleProtectWorkbook=function(e,t){var i=this.parent.serviceLocator.getService(ope),t=(this.parent.isProtected?t&&this.parent.getMainContent().classList.remove("e-hide-"+e.toLowerCase()):t&&this.parent.getMainContent().classList.add("e-hide-"+e.toLowerCase()),i.getConstant(e));return t},que.prototype.insertDesignChart=function(){var e=this,t=this.parent.serviceLocator.getService(ope),i=this.ribbon.items.length-1,n=t.getConstant("ChartDesign");this.parent.allowChart&&this.ribbon.items[i]&&this.ribbon.items[i].header.text!==n&&(this.preTabIdx=this.ribbon.selectedTab,i=this.parent.element.id,n=[{header:{text:n},content:[{template:this.getAddChartEleDBB(i),tooltipText:t.getConstant("AddChartElement"),id:i+"add_chart_ element_chart"},{type:"Separator"},{prefixIcon:"e-switch-row-column-icon",text:t.getConstant("SwitchRowColumn"),tooltipText:t.getConstant("SwitchRowColumn"),id:i+"switch_row_column_chart",click:function(){e.parent.notify(_le,{switchRowColumn:!0,triggerEvent:!0})}},{type:"Separator"},{template:this.getChartThemeDDB(i),tooltipText:t.getConstant("ChartTheme"),id:i+"_chart_theme"},{type:"Separator"},{template:this.getChartDDB(i,!1),tooltipText:t.getConstant("ChartType"),id:i+"_chart_type"}]}],this.addRibbonTabs({items:n}),this.ribbon.tabObj.select(this.ribbon.items.length))},que.prototype.removeDesignChart=function(){var e=this.parent.serviceLocator.getService(ope),t=this.ribbon.items.length-1;this.ribbon.items[t]&&this.ribbon.items[t].header.text===e.getConstant("ChartDesign")&&(this.ribbon.tabObj.select(this.preTabIdx+1),this.parent.hideRibbonTabs([e.getConstant("ChartDesign")],!0),0<document.getElementsByClassName("e-addchart-ddb").length&&document.getElementsByClassName("e-addchart-ddb")[0].remove(),0<document.getElementsByClassName("e-chart-type-ddb").length&&document.getElementsByClassName("e-chart-type-ddb")[0].remove(),0<document.getElementsByClassName("e-charttheme-ddb").length&&document.getElementsByClassName("e-charttheme-ddb")[0].remove(),delete this.ribbon.items[t].content[0],this.ribbon.items.length=this.ribbon.items.length-1)},que.prototype.createRibbon=function(e){var t=this.parent.createElement("div",{id:this.parent.element.id+"_ribbon"});this.ribbon=new zue({selectedTab:0,menuItems:this.getRibbonMenuItems(),items:this.getRibbonItems(),fileMenuItemSelect:this.fileMenuItemSelect.bind(this),beforeOpen:this.fileMenuBeforeOpen.bind(this),beforeClose:this.fileMenuBeforeClose.bind(this),clicked:this.toolbarClicked.bind(this),created:this.ribbonCreated.bind(this),selecting:this.tabSelecting.bind(this),expandCollapse:this.expandCollapseHandler.bind(this),beforeFileMenuItemRender:this.beforeRenderHandler.bind(this),spreadInstance:this.parent&&this.parent.isReact?this.parent:null}),this.ribbon.createElement=this.parent.createElement,e?this.parent.element.insertBefore(t,e):this.parent.element.appendChild(t),this.ribbon.appendTo(t)},que.prototype.tabSelecting=function(e){if(e.selectingIndex!==this.ribbon.selectedTab){var t=this.parent.serviceLocator.getService(ope);if(this.ribbon.items[e.selectingIndex]&&this.ribbon.items[e.selectingIndex].header.text===t.getConstant("Insert"))for(var i=(n=this.ribbon.items[e.selectingIndex].content).length-1;0<=i;i--)if(n[i].id===this.parent.element.id+"_chart"){(o=n[i].template)&&!o.classList.contains("e-dropdown-btn")&&this.createChartDdb(document.getElementById(this.parent.element.id+"_chart-btn"),!0);break}if(this.ribbon.items[e.selectedIndex]&&this.ribbon.items[e.selectedIndex].header.text===t.getConstant("Insert"))for(var n,o,i=(n=this.ribbon.items[e.selectedIndex].content).length-1;0<=i;i--)if(n[i].id===this.parent.element.id+"_chart"){(o=n[i].template)&&o.classList.contains("e-dropdown-btn")&&this.destroyComponent(o,"dropdown-btn");break}this.refreshRibbonContent(e.selectingIndex),this.parent.notify(Rse,{activeTab:e.selectingIndex})}},que.prototype.beforeRenderHandler=function(e){var t=this.parent.serviceLocator.getService(ope);e.item.text!==t.getConstant("Open")||this.parent.openUrl&&this.parent.allowOpen||e.element.classList.add("e-disabled"),e.item.text!==t.getConstant("SaveAs")||this.parent.saveUrl&&this.parent.allowSave||e.element.classList.add("e-disabled"),e.item.text!==t.getConstant("Print")||this.parent.allowPrint||e.element.classList.add("e-disabled")},que.prototype.getChartThemeDDB=function(e){var t,i=this,n=this.parent.serviceLocator.getService(ope),e=this.parent.createElement("button",{id:e+"_chart_theme",attrs:{type:"button"},className:"e-ss-ddb"}),o=(e.appendChild(this.parent.createElement("span",{className:"e-tbar-btn-text"})),"Material"),r=this.parent.element.querySelector(".e-ss-overlay-active"),s=(r&&((t=r.querySelector(".e-chart"))?o=At(t,"chart").theme:(t=r.querySelector(".e-accumulationchart"))&&(o=At(t,"accumulationchart").theme)),new u2({items:this.getChartThemeDdbItems(o),content:n.getConstant(o),createPopupOnClick:!0,select:function(e){i.parent.notify(poe,{type:"mousedown"}),e.element&&e.element.querySelector(".e-selected-icon")||(s.content=e.item.text,s.dataBind(),i.parent.notify(_le,{chartTheme:e.item.id,triggerEvent:!0}),s.setProperties({items:i.getChartThemeDdbItems(e.item.id)},!0))},cssClass:"e-flat e-charttheme-ddb",beforeOpen:function(e){i.tBarDdbBeforeOpen(e.element,e.items,i.parent.serviceLocator.getService(ope).getConstant("Chart"))}}));return s.createElement=this.parent.createElement,s.appendTo(e),e},que.prototype.getNumFormatDDB=function(e,t){var o=this,i=this.parent.createElement("button",{id:e+"_number_format",attrs:{type:"button"},className:"e-ss-ddb"}),n=this.parent.createElement("span",{className:"e-tbar-btn-text"}),t=(n.innerText=t.getConstant("General"),i.appendChild(n),{action:"getLocalizedFormats"}),r=(this.parent.notify(xoe,t),t.defaultFormats),s=t.localizedFormats;return this.numFormatDDB=new u2({items:this.getNumFormatDdbItems(e),createPopupOnClick:!0,select:function(e){var t,i,n=o.parent.serviceLocator.getService(ope);e.item.text===n.getConstant("Custom")?o.renderCustomFormatDialog(r,s):(t=Ghe(e=e.item.id.split(o.parent.element.id+"_")[1]),o.applyNumFormat(t),i=o.parent.getActiveSheet(),o.refreshNumFormatSelection(Yhe(t,!0),i,n,t),n=ste(i.activeCell),o.refreshTextAlign(i,Kre(n[0],n[1],i,!1,!0),e,n),o.numFormatDDB.element.setAttribute("aria-label",e),o.parent.showAggregate&&o.parent.notify(hle,{}))},open:function(e){return o.numDDBOpen(e)},beforeItemRender:function(e){return o.previewNumFormat(e)},cssClass:"e-flat e-numformat-ddb",beforeOpen:function(e){o.tBarDdbBeforeOpen(e.element,e.items,o.parent.serviceLocator.getService(ope).getConstant("NumberFormat"))}}),this.numFormatDDB.createElement=this.parent.createElement,this.numFormatDDB.appendTo(i),i},que.prototype.getFontSizeDDB=function(e){var i=this;return this.fontSizeDdb=new u2({cssClass:"e-font-size-ddb",content:"11",createPopupOnClick:!0,items:[{text:"8"},{text:"9"},{text:"10"},{text:"11"},{text:"12"},{text:"14"},{text:"16"},{text:"18"},{text:"20"},{text:"22"},{text:"24"},{text:"26"},{text:"28"},{text:"36"},{text:"48"},{text:"72"}],beforeOpen:function(e){i.tBarDdbBeforeOpen(e.element,e.items,i.parent.serviceLocator.getService(ope).getConstant("FontSize")),i.refreshSelected(i.fontSizeDdb,e.element,"content","text")},select:function(e){var t={style:{fontSize:e.item.text+"pt"},onActionUpdate:!0};i.parent.notify(Tie,t),t.cancel||(i.fontSizeDdb.content=t.style.fontSize.split("pt")[0],i.fontSizeDdb.dataBind()),i.fontSizeDdb.element.setAttribute("aria-label",e.item.text)}}),this.fontSizeDdb.createElement=this.parent.createElement,this.fontSizeDdb.appendTo(this.parent.createElement("button",{id:e+"_font_size",attrs:{type:"button"},className:"e-ss-ddb"})),this.fontSizeDdb.element},que.prototype.getChartDDB=function(e,t){var i,n,o=this.parent.serviceLocator.getService(ope);return t?(i=this.parent.createElement("button",{id:e+"_chart-btn",attrs:{type:"button"}}),(n=this.parent.createElement("span",{id:e+"_chart"})).innerText=o.getConstant("Chart"),i.appendChild(n)):(i=this.parent.createElement("button",{id:e+"_chart-type-btn",attrs:{type:"button"}}),(n=this.parent.createElement("span",{id:e+"_chart_type"})).innerText=o.getConstant("ChartType"),i.appendChild(n),this.createChartDdb(i,!1)),i},que.prototype.closeDropdownPopup=function(e){(e.altKey&&38===e.keyCode||27===e.keyCode)&&(e=this[1])&&(e.toggle(),sce(e.element))},que.prototype.createChartDdb=function(e,t){var i,n=this,o=this.parent.serviceLocator.getService(ope),r=t?"e-chart-menu":"e-chart-type-menu",s=this.parent.createElement("ul",{id:this.parent.element.id+(t?"_chart_menu":"_chart_type_menu")}),a=new u2({iconCss:"e-icons "+(t?"e-chart-icon":"e-chart-type-icon"),cssClass:t?"e-chart-ddb":"e-chart-type-ddb",target:s,createPopupOnClick:!0,beforeOpen:function(e){i=n.createChartMenu(s,r,o,a),n.tBarDdbBeforeOpen(e.element,i.items,n.parent.serviceLocator.getService(ope).getConstant("Chart")),E.add(s,"keydown",n.closeDropdownPopup,[n,a])},open:function(){return sce(s)},beforeClose:function(e){e.event&&z(e.event.target,"."+r)?e.cancel=!0:(E.remove(s,"keydown",n.closeDropdownPopup),i.destroy())}});a.createElement=this.parent.createElement,a.appendTo(e)},que.prototype.createChartMenu=function(e,t,i,n){var o=this,t=new L4({cssClass:t,items:[{iconCss:"e-icons e-column",text:i.getConstant("Column"),items:[{id:"column_chart"}]},{iconCss:"e-icons e-bar",text:i.getConstant("Bar"),items:[{id:"bar_chart"}]},{iconCss:"e-icons e-area",text:i.getConstant("Area"),items:[{id:"area_chart"}]},{iconCss:"e-icons e-pie-doughnut",text:i.getConstant("PieAndDoughnut"),items:[{id:"pie_doughnut_chart"}]},{iconCss:"e-icons e-line",text:i.getConstant("Line"),items:[{id:"line_chart"}]},{iconCss:"e-icons e-scatter",text:i.getConstant("Scatter"),items:[{id:"scatter_chart"}]}],orientation:"Vertical",beforeOpen:function(e){var t;e.parentItem.text===i.getConstant("Column")?(e.element.firstChild.appendChild(r),t="e-column-chart"):e.parentItem.text===i.getConstant("Bar")?(e.element.firstChild.appendChild(m),t="e-bar-chart"):e.parentItem.text===i.getConstant("Area")?(e.element.firstChild.appendChild(f),t="e-area-chart"):e.parentItem.text===i.getConstant("Line")?(e.element.firstChild.appendChild(y),t="e-line-chart"):e.parentItem.text===i.getConstant("PieAndDoughnut")?(e.element.firstChild.appendChild(v),t="e-pie-doughnut-chart"):e.parentItem.text===i.getConstant("Radar")?(e.element.firstChild.appendChild(b),t="e-radar-chart"):e.parentItem.text===i.getConstant("Scatter")&&(e.element.firstChild.appendChild(w),t="e-scatter-chart"),t&&(e.element.parentElement.classList.add(t),E.add(e.element,"keydown",o.menuIconKeyDown.bind(o,t+" .e-menu-icon",0)))},select:function(e){return o.chartSelected(e,n)},beforeItemRender:function(e){e.item.text||e.element.removeAttribute("tabindex")},beforeClose:function(e){e.event&&37===e.event.keyCode?e.cancel=!0:E.remove(e.element,"keydown",o.menuIconKeyDown)}}),r=this.parent.createElement("div",{id:"column_main",className:"e-column-main"}),s=this.parent.createElement("div",{id:"column1_text",className:"e-column1-text"}),a=(s.innerText=i.getConstant("Column"),this.parent.createElement("div",{id:"column1_cont",className:"e-column1-cont"})),l=this.parent.createElement("div",{id:"column2_cont",className:"e-column2-cont"}),s=(r.appendChild(s),r.appendChild(a),i.getConstant("ClusteredColumn")),h=this.parent.createElement("span",{id:"clusteredColumn",className:"e-clusteredcolumn e-column-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}}),s=i.getConstant("StackedColumn"),d=this.parent.createElement("span",{id:"stackedColumn",className:"e-stackedcolumn e-column-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}}),p=(s=i.getConstant("StackedColumn100"),this.parent.createElement("span",{id:"stackedColumn100",className:"e-stackedcolumn100 e-column-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),c=this.parent.createElement("span",{id:"clusteredColumn3D",className:"e-clusteredColumn3D e-column-icon"}),u=this.parent.createElement("span",{id:"stackedColumn3D",className:"e-stackedColumn3D e-column-icon"}),g=this.parent.createElement("span",{id:"stackedColumn1003D",className:"e-stackedColumn1003D e-column-icon"}),m=(a.appendChild(h),a.appendChild(d),a.appendChild(p),l.appendChild(c),l.appendChild(u),l.appendChild(g),this.parent.createElement("div",{id:"bar_main",className:"e-bar-main"})),h=this.parent.createElement("div",{id:"bar1_text",className:"e-bar1-text"}),d=(h.innerText=i.getConstant("Bar"),this.parent.createElement("div",{id:"bar1_cont",className:"e-bar1-cont"})),a=this.parent.createElement("div",{id:"bar2_cont",className:"e-bar2-cont"}),p=(m.appendChild(h),m.appendChild(d),s=i.getConstant("ClusteredBar"),this.parent.createElement("span",{id:"clusteredBar",className:"e-clusteredbar e-bar-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),c=(s=i.getConstant("StackedBar"),this.parent.createElement("span",{id:"stackedBar",className:"e-stackedbar e-bar-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),u=(s=i.getConstant("StackedBar100"),this.parent.createElement("span",{id:"stackedBar100",className:"e-stackedbar100 e-bar-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),l=this.parent.createElement("span",{id:"clusteredBar3D",className:"e-clusteredBar3D e-bar-icon"}),g=this.parent.createElement("span",{id:"stackedBar3D",className:"e-stackedBar3D e-bar-icon"}),h=this.parent.createElement("span",{id:"stackedBar1003D",className:"e-stackedBar1003D e-bar-icon"}),f=(d.appendChild(p),d.appendChild(c),d.appendChild(u),a.appendChild(l),a.appendChild(g),a.appendChild(h),this.parent.createElement("div",{id:"area_main",className:"e-area-main"})),p=this.parent.createElement("div",{id:"area_text",className:"e-area-text"}),c=(p.innerText=i.getConstant("Area"),this.parent.createElement("div",{id:"area_cont",className:"e-area-cont"})),d=(f.appendChild(p),f.appendChild(c),s=i.getConstant("Area"),this.parent.createElement("span",{id:"area",className:"e-area e-area-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),u=(s=i.getConstant("StackedArea"),this.parent.createElement("span",{id:"stackedArea",className:"e-stackedarea e-area-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),l=(s=i.getConstant("StackedArea100"),this.parent.createElement("span",{id:"stackedArea100",className:"e-stackedarea100 e-area-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),y=(c.appendChild(d),c.appendChild(u),c.appendChild(l),this.parent.createElement("div",{id:"line_main",className:"e-line-main"})),g=this.parent.createElement("div",{id:"line_text",className:"e-line-text"}),a=(g.innerText=i.getConstant("Line"),this.parent.createElement("div",{id:"line_cont",className:"e-line-cont"})),h=this.parent.createElement("div",{id:"line_cont_marker",className:"e-line-cont"}),p=(y.appendChild(g),y.appendChild(a),y.appendChild(h),s=i.getConstant("Line"),this.parent.createElement("span",{id:"line",className:"e-line e-line-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),d=(s=i.getConstant("StackedLine"),this.parent.createElement("span",{id:"stackedLine",className:"e-stackedline e-line-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),u=(s=i.getConstant("StackedLine100"),this.parent.createElement("span",{id:"stackedLine100",className:"e-stackedline100 e-line-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),c=(s=i.getConstant("LineMarker"),this.parent.createElement("span",{id:"lineMarker",className:"e-line-marker e-line-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),l=(s=i.getConstant("StackedLineMarker"),this.parent.createElement("span",{id:"stackedLineMarker",className:"e-stackedline-marker e-line-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),g=(s=i.getConstant("StackedLine100Marker"),this.parent.createElement("span",{id:"stackedLine100Marker",className:"e-stackedline100-marker e-line-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),v=(a.appendChild(p),a.appendChild(d),a.appendChild(u),h.appendChild(c),h.appendChild(l),h.appendChild(g),this.parent.createElement("div",{id:"pie_main",className:"e-pie-main"})),p=this.parent.createElement("div",{id:"pie_text",className:"e-pie-text"}),d=(p.innerText=i.getConstant("Pie"),this.parent.createElement("div",{id:"pie_cont",className:"e-pie-cont"})),a=(v.appendChild(p),v.appendChild(d),s=i.getConstant("Pie"),this.parent.createElement("span",{id:"pie",className:"e-pie e-pie-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),u=(s=i.getConstant("Doughnut"),this.parent.createElement("span",{id:"doughnut",className:"e-doughnut e-pie-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}})),b=(d.appendChild(a),d.appendChild(u),this.parent.createElement("div",{id:"radar_main",className:"e-radar-main"})),c=this.parent.createElement("div",{id:"radar_text",className:"e-radar-text"}),l=(c.innerText=i.getConstant("Radar"),this.parent.createElement("div",{id:"radar_cont",className:"e-radar-cont"})),h=(b.appendChild(c),b.appendChild(l),this.parent.createElement("span",{id:"radar",className:"e-radar e-radar-icon e-menu-icon e-icons",attrs:{tabindex:"-1"}})),g=this.parent.createElement("span",{id:"radar_markers",className:"e-radar-markers e-radar-icon e-menu-icon e-icons",attrs:{tabindex:"-1"}}),w=(h.title=i.getConstant("BlueDataBar"),g.title=i.getConstant("GreenDataBar"),l.appendChild(h),l.appendChild(g),this.parent.createElement("div",{id:"scatter_main",className:"e-scatter-main"})),p=this.parent.createElement("div",{id:"scatter_text",className:"e-scatter-text"}),a=(s=i.getConstant("Scatter"),p.innerText=s,this.parent.createElement("div",{id:"scatter_cont",className:"e-scatter-cont"})),d=(w.appendChild(p),w.appendChild(a),this.parent.createElement("span",{id:"scatter",className:"e-scatter e-scatter-icon e-menu-icon e-icons",attrs:{title:s,"aria-label":s,tabindex:"-1"}}));return a.appendChild(d),t.createElement=this.parent.createElement,t.appendTo(e),e.classList.add("e-ul"),t},que.prototype.getAddChartEleDBB=function(e){var t,i=this,n=this.parent.serviceLocator.getService(ope),o=this.parent.createElement("ul",{id:e+"_add_chart_menu"}),r=(this.addChartDdb=new u2({iconCss:"e-icons e-addchart-icon",cssClass:"e-addchart-ddb",target:o,createPopupOnClick:!0,close:function(){return sce(i.parent.element)},beforeOpen:function(e){t=i.createAddChartMenu(o,n),i.tBarDdbBeforeOpen(e.element,t.items),E.add(o,"keydown",i.closeDropdownPopup,[i,i.addChartDdb])},open:function(){return sce(o)},beforeClose:function(e){e.event&&z(e.event.target,".e-addchart-menu")?e.cancel=!0:(E.remove(o,"keydown",i.closeDropdownPopup),t.destroy())}}),this.addChartDdb.createElement=this.parent.createElement,this.parent.createElement("button",{id:e+"_addchart",attrs:{type:"button"}})),e=this.parent.createElement("span",{id:e+"_chart"});return e.innerText=n.getConstant("AddChartElement"),r.appendChild(e),this.addChartDdb.appendTo(r),this.addChartDdb.element},que.prototype.createAddChartMenu=function(e,n){var i=this,t=new L4({cssClass:"e-addchart-menu",title:n.getConstant("AddChartElement"),items:[{iconCss:"e-icons e-axes",text:n.getConstant("Axes"),items:[{iconCss:"e-icons e-ph-axes",id:"PHAxes",text:n.getConstant("PrimaryHorizontal")},{iconCss:"e-icons e-pv-axes",id:"PVAxes",text:n.getConstant("PrimaryVertical")}]},{iconCss:"e-icons e-axis-title",text:n.getConstant("AxisTitle"),items:[{iconCss:"e-icons e-ph-axistitle",id:"PHAxisTitle",text:n.getConstant("PrimaryHorizontal")},{iconCss:"e-icons e-pv-axistitle",id:"PVAxisTitle",text:n.getConstant("PrimaryVertical")}]},{iconCss:"e-icons e-chart-title",text:n.getConstant("ChartTitle"),items:[{iconCss:"e-icons e-ct-none",id:"ChartTitleNone",text:n.getConstant("None")},{iconCss:"e-icons e-ct-abovechart",id:"ChartTitleAbove",text:n.getConstant("AboveChart")}]},{iconCss:"e-icons e-data-labels",id:this.parent.element.id+"data-labels",text:n.getConstant("DataLabels"),items:[{iconCss:"e-icons e-dl-none",id:"DLNone",text:n.getConstant("None")},{iconCss:"e-icons e-dl-center",id:"DLCenter",text:n.getConstant("Center")},{iconCss:"e-icons e-dl-insideend",id:"DLInsideend",text:n.getConstant("InsideEnd")},{iconCss:"e-icons e-dl-insidebase",id:"DLInsidebase",text:n.getConstant("InsideBase")},{iconCss:"e-icons e-dl-outsideend",id:"DLOutsideend",text:n.getConstant("OutsideEnd")}]},{iconCss:"e-icons e-gridlines",text:n.getConstant("Gridlines"),items:[{iconCss:"e-icons e-gl-major-horizontal",id:"GLMajorHorizontal",text:n.getConstant("PrimaryMajorHorizontal")},{iconCss:"e-icons e-gl-major-vertical",id:"GLMajorVertical",text:n.getConstant("PrimaryMajorVertical")},{iconCss:"e-icons e-gl-minor-horizontal",id:"GLMinorHorizontal",text:n.getConstant("PrimaryMinorHorizontal")},{iconCss:"e-icons e-gl-minor-vertical",id:"GLMinorVertical",text:n.getConstant("PrimaryMinorVertical")}]},{iconCss:"e-icons e-legends",text:n.getConstant("Legends"),items:[{iconCss:"e-icons e-legends-none",id:"LegendNone",text:n.getConstant("None")},{iconCss:"e-icons e-legends-right",id:"LegendsRight",text:n.getConstant("Right")},{iconCss:"e-icons e-legends-left",id:"LegendsLeft",text:n.getConstant("Left")},{iconCss:"e-icons e-legends-bottom",id:"LegendsBottom",text:n.getConstant("Bottom")},{iconCss:"e-icons e-legends-top",id:"LegendsTop",text:n.getConstant("Top")}]}],orientation:"Vertical",select:this.addChartEleSelected.bind(this),beforeOpen:function(e){var t;e.parentItem.id===i.parent.element.id+"data-labels"&&(t=i.parent.element.querySelector(".e-ss-overlay-active"))&&(t=t.querySelector(".e-chart"))&&(t=At(t,"chart")).series[0]&&t.series[0].type.includes("Line")&&((t=function(e,t){var i;e&&((i=e.parentElement).innerHTML="",i.appendChild(e),i.appendChild(document.createTextNode(n.getConstant(t))))})(e.element.querySelector(".e-dl-insideend"),"Above"),t(e.element.querySelector(".e-dl-insidebase"),"Below"),t=e.element.querySelector(".e-dl-outsideend"))&&(t.parentElement.style.display="none")}});return t.createElement=this.parent.createElement,t.appendTo(e),e.classList.add("e-ul"),t},que.prototype.getCFDBB=function(e){var t,i=this,n=this.parent.createElement("ul",{id:e+"_cf_menu"});return this.cfDdb=new u2({iconCss:"e-icons e-conditionalformatting-icon",cssClass:"e-cf-ddb",target:n,createPopupOnClick:!0,close:function(){return sce(i.parent.element)},beforeOpen:function(e){t=i.createCFMenu(n),i.tBarDdbBeforeOpen(e.element,t.items,i.parent.serviceLocator.getService(ope).getConstant("ConditionalFormatting")),E.add(n,"keydown",i.closeDropdownPopup,[i,i.cfDdb])},open:function(){return sce(n)},beforeClose:function(e){e.event&&z(e.event.target,".e-cf-menu")?e.cancel=!0:(E.remove(n,"keydown",i.closeDropdownPopup),t&&t.element&&(fce(i.spanElements),i.spanElements=[],fce(i.iconWrapElements),i.iconWrapElements=[],fce(i.iconSetElements),i.iconSetElements=[],fce(i.iconSetGroupElement),i.iconSetGroupElement=[],t.destroy(),t.element.remove()))}}),this.cfDdb.createElement=this.parent.createElement,this.cfDdb.appendTo(this.parent.createElement("button",{id:e+"_conditionalformatting",attrs:{type:"button"}})),this.cfDdb.element},que.prototype.createCFMenu=function(e){function t(e,t,i){var n;e.forEach(function(e){n=l.getConstant(e+t);e=a.parent.createElement("span",{id:e+t,className:"e-"+e.toLowerCase()+" e-cf-icon",attrs:{title:n,"aria-label":n,tabindex:"-1"}});a.spanElements.push(e),i.appendChild(e)})}var a=this,l=this.parent.serviceLocator.getService(ope),i=new L4({cssClass:"e-cf-menu",items:[{iconCss:"e-icons e-hlcellrules",text:l.getConstant("HighlightCellsRules"),items:[{iconCss:"e-icons e-greaterthan",id:"cf_greaterthan_dlg",text:l.getConstant("GreaterThan")+"..."},{iconCss:"e-icons e-lessthan",id:"cf_lessthan_dlg",text:l.getConstant("LessThan")+"..."},{iconCss:"e-icons e-between",id:"cf_between_dlg",text:l.getConstant("Between")+"..."},{iconCss:"e-icons e-equalto",id:"cf_eqaulto_dlg",text:l.getConstant("CFEqualTo")+"..."},{iconCss:"e-icons e-textcontains",id:"cf_textcontains_dlg",text:l.getConstant("TextThatContains")+"..."},{iconCss:"e-icons e-adateoccuring",id:"cf_adateoccuring_dlg",text:l.getConstant("ADateOccuring")+"..."},{iconCss:"e-icons e-duplicate",id:"cf_duplicatevalues_dlg",text:l.getConstant("DuplicateValues")+"..."}]},{iconCss:"e-icons e-topbottomrules",text:l.getConstant("TopBottomRules"),items:[{iconCss:"e-icons e-top10items",id:"cf_top10items_dlg",text:l.getConstant("Top10Items")+"..."},{iconCss:"e-icons e-top10",id:"cf_top10_dlg",text:l.getConstant("Top10")+" %..."},{iconCss:"e-icons e-bottom10items",id:"cf_bottom10items_dlg",text:l.getConstant("Bottom10Items")+"..."},{iconCss:"e-icons e-bottom10",id:"cf_bottom10_dlg",text:l.getConstant("Bottom10")+" %..."},{iconCss:"e-icons e-aboveaverage",id:"cf_aboveaverage_dlg",text:l.getConstant("AboveAverage")+"..."},{iconCss:"e-icons e-belowaverage",id:"cf_belowaverage_dlg",text:l.getConstant("BelowAverage")+"..."}]},{iconCss:"e-icons e-databars",text:l.getConstant("DataBars"),items:[{id:"db_icons1"},{id:"db_icons2"}]},{iconCss:"e-icons e-colorscales",text:l.getConstant("ColorScales"),items:[{id:"cs_icons1"},{id:"cs_icons2"},{id:"cs_icons3"}]},{iconCss:"e-icons e-iconsets",text:l.getConstant("IconSets"),items:[{id:"is_icons"}]},{iconCss:"e-icons e-clearrules",text:l.getConstant("ClearRules"),items:[{id:"cf_cr_cells",text:l.getConstant("SelectedCells")},{id:"cf_cr_sheet",text:l.getConstant("EntireSheet")}]}],orientation:"Vertical",beforeOpen:function(e){var i,n,o,r,s;"e-icons e-databars"===e.parentItem.iconCss?(e.element.parentElement.classList.add("e-databars"),t(["Blue","Green","Red"],"DataBar",e.element.firstChild),t(["Orange","LightBlue","Purple"],"DataBar",e.element.lastChild),E.add(e.element,"keydown",a.menuIconKeyDown.bind(a,"e-cf-icon",3))):"e-icons e-colorscales"===e.parentItem.iconCss?(e.element.parentElement.classList.add("e-colorscales"),t(["GYR","RYG","GWR","RWG"],"ColorScale",e.element.firstChild),t(["BWR","RWB","WR","RW"],"ColorScale",e.element.querySelector("#cs_icons2")),t(["GW","WG","GY","YG"],"ColorScale",e.element.lastChild),E.add(e.element,"keydown",a.menuIconKeyDown.bind(a,"e-cf-icon",4))):"e-icons e-iconsets"===e.parentItem.iconCss&&(e.element.parentElement.classList.add("e-iconsets"),i=a.parent.createElement("div",{id:"is",className:"e-is"}),a.iconSetGroupElement.push(i),[{hdr:"Directional"},{cont:[{cls:"3arrows",key:"ThreeArrowsColor",id:"ThreeArrows",count:3},{cls:"3arrowsgray",key:"ThreeArrowsGray",count:3},{cls:"3triangles",key:"ThreeTriangles",count:3},{cls:"4arrowsgray",key:"FourArrowsGray",count:4},{cls:"4arrows",key:"FourArrowsColor",id:"FourArrows",count:4},{cls:"5arrowsgray",key:"FiveArrowsGray",count:5},{cls:"5arrows",key:"FiveArrowsColor",id:"FiveArrows",count:5}]},{hdr:"Shapes"},{cont:[{cls:"3trafficlights",key:"ThreeTrafficLights1",count:3},{cls:"3rafficlights2",key:"ThreeTrafficLights2",count:3},{cls:"3signs",key:"ThreeSigns",count:3},{cls:"4trafficlights",key:"FourTrafficLights",count:4},{cls:"4redtoblack",key:"RedToBlack",id:"FourRedToBlack",count:4}]},{hdr:"Indicators"},{cont:[{cls:"3symbols",key:"ThreeSymbols1",id:"ThreeSymbols",count:3},{cls:"3symbols2",key:"ThreeSymbols2",count:3},{cls:"3flags",key:"ThreeFlags",count:3}]},{hdr:"Ratings"},{cont:[{cls:"3stars",key:"ThreeStars",count:3},{cls:"4rating",key:"FourRatings",id:"FourRating",count:4},{cls:"5quarters",key:"FiveQuarters",count:5},{cls:"5rating",key:"FiveRatings",id:"FiveRating",count:5},{cls:"5boxes",key:"FiveBoxes",count:5}]}].forEach(function(e,t){n=a.parent.createElement("div",{id:"is"+(t+1),className:"e-is"+(t+1)}),a.iconSetElements.push(n),e.hdr?n.innerText=l.getConstant(e.hdr):e.cont.forEach(function(e){for(r=l.getConstant(e.key),o=a.parent.createElement("div",{id:e.id||e.key,className:"e-"+e.cls+" e-is-wrapper",attrs:{title:r,"aria-label":r,tabindex:"-1"}}),a.iconWrapElements.push(o),s=0;s<e.count;s++){var t=a.createElement("span","e-"+e.cls+"-"+(s+1)+" e-iconsetspan");a.spanElements.push(t),o.appendChild(t)}n.appendChild(o)}),i.appendChild(n)}),e.element.firstChild.appendChild(i),E.add(e.element,"keydown",a.menuIconKeyDown.bind(a,"e-is-wrapper",0)))},select:this.cfSelected.bind(this),beforeItemRender:function(e){(e.item.id.includes("db_icons")||e.item.id.includes("cs_icons")||"is_icons"===e.item.id)&&e.element.removeAttribute("tabindex")},beforeClose:function(e){var t=-1<["e-icons e-databars","e-icons e-colorscales","e-icons e-iconsets"].indexOf(e.parentItem.iconCss);e.cancel=e.event&&37===e.event.keyCode&&t,t&&!e.cancel&&E.remove(e.element,"keydown",a.menuIconKeyDown)}});return i.createElement=this.parent.createElement,i.appendTo(e),e.classList.add("e-ul"),i},que.prototype.menuIconKeyDown=function(e,t,i){var n,o,r,s,a=[];i?40!==i.keyCode&&39!==i.keyCode&&38!==i.keyCode&&37!==i.keyCode||(i.preventDefault(),-1===(n=(a=[].slice.call(document.querySelectorAll("."+e))).indexOf(i.target))?n=0:39===i.keyCode?++n===a.length&&(n=0):37===i.keyCode?-1===--n&&(n=a.length-1):e.includes("e-menu-icon")||(o=a.length,s=r=void 0,t||(t=2,s=40===i.keyCode?(r=[6,11,14,19],[5,10,13]):(r=[7,12,15],[8,13,16]),o--),40===i.keyCode?n===o-1?n=0:(n+=r&&-1<r.indexOf(n)?1:s&&-1<s.indexOf(n)?3:t,r&&o++,o<=n&&(n=n-o+1)):0===n?n=o-1:(n-=r&&-1<r.indexOf(n)?1:s&&-1<s.indexOf(n)?3:t)<0&&(n=r?o:o+n-1))):(n=0,a=[].slice.call(document.querySelectorAll("."+e))),a[n]&&sce(a[n])},que.prototype.createElement=function(e,t){return this.parent.createElement(e,{className:t})},que.prototype.getBordersDBB=function(e){var t,i=this,n=this.parent.createElement("ul",{id:e+"_borders_menu"});return this.cPickerEle=this.parent.createElement("input",{id:e+"_cell_border_color",attrs:{type:"color"}}),this.parent.element.appendChild(this.cPickerEle),this.colorPicker=new cV({cssClass:"e-border-colorpicker",mode:"Palette",inline:!0,beforeTileRender:function(e){e.element.tabIndex=-1},change:function(e){var t=i.border.split(" ");t[2]=e.currentValue.hex,i.border=t.join(" ")}}),this.colorPicker.createElement=this.parent.createElement,this.colorPicker.appendTo(this.cPickerEle),this.bordersDdb=new u2({iconCss:"e-icons e-bottom-borders",cssClass:"e-borders-ddb",target:n,createPopupOnClick:!0,beforeOpen:function(e){t=i.createBorderMenu(n),i.tBarDdbBeforeOpen(e.element,t.items,i.parent.serviceLocator.getService(ope).getConstant("Borders"),1),E.add(n,"keydown",i.closeDropdownPopup,[i,i.bordersDdb])},open:function(){return sce(n)},beforeClose:function(e){e.event&&z(e.event.target,".e-borders-menu")?e.cancel=!0:(E.remove(n,"keydown",i.closeDropdownPopup),t.destroy())},close:function(){return sce(i.bordersDdb.element)}}),this.bordersDdb.createElement=this.parent.createElement,this.bordersDdb.appendTo(this.parent.createElement("button",{id:e+"_borders",attrs:{type:"button"}})),this.bordersDdb.element},que.prototype.createBorderMenu=function(e){var i=this,t=this.parent.serviceLocator.getService(ope),n=this.parent.element.id,o=new L4({cssClass:"e-borders-menu",items:[{iconCss:"e-icons e-top-borders",text:t.getConstant("TopBorders"),id:n+"_border_topborders"},{iconCss:"e-icons e-left-borders",text:t.getConstant("LeftBorders"),id:n+"_border_leftborders"},{iconCss:"e-icons e-right-borders",text:t.getConstant("RightBorders"),id:n+"_border_rightborders"},{iconCss:"e-icons e-bottom-borders",text:t.getConstant("BottomBorders"),id:n+"_border_bottomborders"},{iconCss:"e-icons e-all-borders",text:t.getConstant("AllBorders"),id:n+"_border_allborders"},{iconCss:"e-icons e-horizontal-borders",text:t.getConstant("HorizontalBorders"),id:n+"_border_horizontalborders"},{iconCss:"e-icons e-vertical-borders",text:t.getConstant("VerticalBorders"),id:n+"_border_verticalborders"},{iconCss:"e-icons e-outside-borders",text:t.getConstant("OutsideBorders"),id:n+"_border_outsideborders"},{iconCss:"e-icons e-inside-borders",text:t.getConstant("InsideBorders"),id:n+"_border_insideborders"},{iconCss:"e-icons e-no-borders",text:t.getConstant("NoBorders"),id:n+"_border_noborders"},{separator:!0},{text:t.getConstant("BorderColor"),items:[{id:n+"_border_colors"}],id:n+"_border_bordercolor"},{text:t.getConstant("BorderStyle"),items:[{iconCss:"e-icons e-selected-icon",id:n+"_1px"},{id:n+"_2px"},{id:n+"_3px"},{id:n+"_dashed"},{id:n+"_dotted"},{id:n+"_double"}]}],orientation:"Vertical",beforeOpen:function(e){var t;e.parentItem.id===n+"_border_bordercolor"?(i.colorPicker.refresh(),t=i.colorPicker.element.parentElement,e.element.firstElementChild.appendChild(t),t.style.display="inline-block",e.element.parentElement.classList.add("e-border-color"),e.element.firstElementChild.removeAttribute("tabindex")):e.element.classList.add("e-border-style")},beforeClose:function(e){var t;e.event&&e.parentItem.id===n+"_border_bordercolor"&&(!z(e.event.target,".e-border-colorpicker")||z(e.event.target,".e-apply")||z(e.event.target,".e-cancel")?(i.colorPicker=At(i.cPickerEle,"colorpicker"),"Picker"===i.colorPicker.mode&&(i.colorPicker.mode="Palette",i.colorPicker.dataBind()),(t=i.colorPicker.element.parentElement).style.display="",i.parent.element.appendChild(t)):e.cancel=!0)},onOpen:function(e){e.parentItem.id===n+"_border_bordercolor"&&(e.element.parentElement.style.overflow="visible",e=e.element.querySelector(".e-color-palette .e-palette"))&&sce(e)},onClose:function(){return sce(o.element)},select:function(e){i.borderSelected(e,o)}});return o.createElement=this.parent.createElement,o.appendTo(e),e.classList.add("e-ul"),o},que.prototype.chartSelected=function(e,t){var i=!je(z(e.element,".e-chart-menu")),n=e.element.id;"column_chartbar_chartarea_chartpie_doughnut_chartline_chartradar_chartscatter_chart".includes(n)&&(!e.item||e.item.items&&e.item.items.length||t.toggle(),t=e.event.target.id,this.parent.notify(Rle,{action:n,id:t,isChart:i}))},que.prototype.addChartEleSelected=function(e){var t=e.element.id;this.parent.notify(_le,{addChartEle:t,triggerEvent:!0}),!e.item||e.item.items&&e.item.items.length||this.addChartDdb.toggle()},que.prototype.cfSelected=function(e){var t,i=this.parent.getActiveSheet();e.item.id.includes("_dlg")?this.parent.notify(cle,{action:e.item.text}):!(t=e.item.id.includes("icons"))&&"cf_cr_cells"!==e.item.id&&"cf_cr_sheet"!==e.item.id||(are(this.parent,fte(rte(i.selectedRange)))?this.parent.notify(ele,null):t?(t=e.event.target,this.parent.notify(Vne,{cfModel:{type:t.id||t.parentElement.id,range:i.selectedRange},isAction:!0})):"cf_cr_cells"===e.item.id?this.parent.notify(Hne,{range:i.selectedRange,isAction:!0}):"cf_cr_sheet"===e.item.id&&(this.parent.conditionalFormat=null,this.parent.notify(Hne,{isAction:!0}))),!e.item||e.item.items&&e.item.items.length||this.cfDdb.toggle()},que.prototype.borderSelected=function(t,e){this.bordersDdb.element.setAttribute("aria-label",t.item.text);var i,n,o=this.parent.element.id;if(!t.item.items.length&&t.item.id!==o+"_border_colors"){if(!t.item.text)return i=this.border.split(" "),(n="solid"===i[1]?o+"_"+i[0]:o+"_"+i[1])===t.item.id?void 0:(t.item.id===o+"_1px"||t.item.id===o+"_2px"||t.item.id===o+"_3px"?(i[0]=t.item.id.split(o+"_")[1],i[1]="solid"):(i[1]=t.item.id.split(o+"_")[1],i[0]="double"===i[1]?"3px":"1px"),this.border=i.join(" "),e.items[12].items.forEach(function(e){e.id===n&&(e.iconCss=null),e.id===t.item.id&&(e.iconCss="e-icons e-selected-icon")}),void e.setProperties({items:e.items},!0));switch(this.bordersDdb.toggle(),this.parent.showSpinner(),t.item.id){case o+"_border_topborders":this.parent.notify(Tie,{style:{borderTop:this.border},onActionUpdate:!0});break;case o+"_border_leftborders":this.parent.notify(Tie,{style:{borderLeft:this.border},onActionUpdate:!0});break;case o+"_border_rightborders":this.parent.notify(Tie,{style:{borderRight:this.border},onActionUpdate:!0});break;case o+"_border_bottomborders":this.parent.notify(Tie,{style:{borderBottom:this.border},onActionUpdate:!0});break;case o+"_border_allborders":this.parent.notify(Tie,{style:{border:this.border},onActionUpdate:!0});break;case o+"_border_horizontalborders":this.parent.notify(Tie,{style:{border:this.border},onActionUpdate:!0,borderType:"Horizontal"});break;case o+"_border_verticalborders":this.parent.notify(Tie,{style:{border:this.border},onActionUpdate:!0,borderType:"Vertical"});break;case o+"_border_outsideborders":this.parent.notify(Tie,{style:{border:this.border},onActionUpdate:!0,borderType:"Outer"});break;case o+"_border_insideborders":this.parent.notify(Tie,{style:{border:this.border},onActionUpdate:!0,borderType:"Inner"});break;case o+"_border_noborders":this.parent.notify(Tie,{style:{border:""},onActionUpdate:!0})}this.parent.hideSpinner()}},que.prototype.getFontNameDDB=function(e){var i=this,n=this.parent.createElement("button",{id:e+"_font_name",attrs:{type:"button"},className:"e-ss-ddb"}),e=this.parent.createElement("span",{className:"e-tbar-btn-text"});return e.innerText="Calibri",n.appendChild(e),this.fontNameDdb=new u2({cssClass:"e-font-family",items:this.getFontFamilyItems(),createPopupOnClick:!0,select:function(e){var t={style:{fontFamily:e.item.text},onActionUpdate:!0};i.parent.notify(Tie,t),n.setAttribute("aria-label",e.item.text),t.cancel||i.refreshFontNameSelection(t.style.fontFamily)},beforeOpen:function(e){i.tBarDdbBeforeOpen(e.element,e.items,i.parent.serviceLocator.getService(ope).getConstant("Font"))}}),this.fontNameDdb.createElement=this.parent.createElement,this.fontNameDdb.appendTo(n),n},que.prototype.getBtn=function(e,t,i,n){void 0===n&&(n=!0);var o=new zv({iconCss:"e-icons e-"+t+"-icon",cssClass:"e-flat",isToggle:!0});return o.createElement=this.parent.createElement,o.appendTo(this.parent.createElement("button",{id:e+"_"+t,attrs:{"aria-label":i,type:"button"}})),n&&o.element.addEventListener("click",this.toggleBtnClicked.bind(this)),o.element},que.prototype.datavalidationDDB=function(e){var t,i=this,n=this.parent.serviceLocator.getService(ope);return this.datavalidationDdb=new u2({cssClass:"e-datavalidation-ddb",iconCss:"e-datavalidation-icon e-icons",content:n.getConstant("DataValidation"),items:[{text:n.getConstant("DataValidation")},{text:n.getConstant("HighlightInvalidData")},{text:n.getConstant("ClearHighlight")},{text:n.getConstant("ClearValidation")}],createPopupOnClick:!0,beforeOpen:function(e){i.refreshSelected(i.datavalidationDdb,e.element,"iconCss"),e.element.setAttribute("aria-label",n.getConstant("DataValidation"))},select:function(e){switch(e.item.text){case n.getConstant("DataValidation"):i.parent.notify(Wae,null);break;case n.getConstant("HighlightInvalidData"):i.parent.notify(Qae,{});break;case n.getConstant("ClearHighlight"):i.parent.notify(Qae,{isRemoveHighlight:!0});break;case n.getConstant("ClearValidation"):i.parent.notify(lle,{isAction:!0});break;default:t=e.item.text===n.getConstant("SortAscending")?"Ascending":"Descending",i.parent.notify(lae,{sortOptions:{sortDescriptors:{order:t}}})}i.datavalidationDdb.element.setAttribute("aria-label",e.item.text)}}),this.datavalidationDdb.createElement=this.parent.createElement,this.datavalidationDdb.appendTo(this.parent.createElement("button",{id:e+"_datavalidation",attrs:{type:"button"},className:"e-ss-ddb"})),this.datavalidationDdb.element},que.prototype.getTextAlignDDB=function(e){var i=this,n=this.parent.serviceLocator.getService(ope);return this.textAlignDdb=new u2({cssClass:"e-align-ddb",iconCss:"e-icons e-left-icon",items:[{iconCss:"e-icons e-left-icon"},{iconCss:"e-icons e-center-icon"},{iconCss:"e-icons e-right-icon"}],beforeItemRender:this.alignItemRender.bind(this),createPopupOnClick:!0,beforeOpen:function(e){i.refreshSelected(i.textAlignDdb,e.element,"iconCss"),e.element.setAttribute("aria-label",n.getConstant("HorizontalAlignment"))},select:function(e){var t={style:{textAlign:e.item.iconCss.split(" e-")[1].split("-icon")[0]},onActionUpdate:!0};i.parent.notify(Tie,t),t.cancel||(i.textAlignDdb.iconCss="e-icons e-"+t.style.textAlign+"-icon",i.textAlignDdb.dataBind()),i.textAlignDdb.element.setAttribute("aria-label",n.getConstant("HorizontalAlignment")+" "+n.getConstant("Align"+i.getAlignText(e)))}}),this.textAlignDdb.createElement=this.parent.createElement,this.textAlignDdb.appendTo(this.parent.createElement("button",{id:e+"_text_align",attrs:{type:"button"},className:"e-ss-ddb"})),this.textAlignDdb.element},que.prototype.getVerticalAlignDDB=function(e){var i=this,n=this.parent.serviceLocator.getService(ope);return this.verticalAlignDdb=new u2({cssClass:"e-align-ddb",iconCss:"e-icons e-bottom-icon",items:[{iconCss:"e-icons e-top-icon"},{iconCss:"e-icons e-middle-icon"},{iconCss:"e-icons e-bottom-icon"}],beforeItemRender:this.alignItemRender.bind(this),createPopupOnClick:!0,beforeOpen:function(e){i.refreshSelected(i.verticalAlignDdb,e.element,"iconCss"),e.element.setAttribute("aria-label",n.getConstant("VerticalAlignment"))},select:function(e){var t={style:{verticalAlign:e.item.iconCss.split(" e-")[1].split("-icon")[0]},onActionUpdate:!0};i.parent.notify(Tie,t),t.cancel||(i.verticalAlignDdb.iconCss="e-icons e-"+t.style.verticalAlign+"-icon",i.verticalAlignDdb.dataBind()),i.verticalAlignDdb.element.setAttribute("aria-label",n.getConstant("VerticalAlignment")+" "+n.getConstant("Align"+i.getAlignText(e)))}}),this.verticalAlignDdb.createElement=this.parent.createElement,this.verticalAlignDdb.appendTo(this.parent.createElement("button",{id:e+"_vertical_align",attrs:{type:"button"},className:"e-ss-ddb"})),this.verticalAlignDdb.element},que.prototype.getMergeSplitBtn=function(e){var t=this,i=(this.parent.element.appendChild(this.parent.createElement("button",{id:e+"_merge",attrs:{type:"button"}})),this.parent.serviceLocator.getService(ope));return this.mergeSplitBtn=new b2({cssClass:"e-merge-ddb",iconCss:"e-icons e-merge-icon",createPopupOnClick:!0,items:[{text:i.getConstant("MergeAll"),id:e+"_merge_all"},{text:i.getConstant("MergeHorizontally"),id:e+"_merge_horizontally"},{text:i.getConstant("MergeVertically"),id:e+"_merge_vertically"},{separator:!0,id:e+"_merge_separator"},{text:i.getConstant("Unmerge"),id:e+"_unmerge"}],select:this.mergeSelectHandler.bind(this),click:function(e){e.element.setAttribute("aria-label",i.getConstant("MergeCells")),e.element.classList.contains("e-active")?t.unMerge():t.merge(t.parent.element.id+"_merge_all")},created:function(){var e=i.getConstant("MergeCells");t.mergeSplitBtn.element.title=e,t.mergeSplitBtn.element.setAttribute("aria-label",e),t.mergeSplitBtn.element.nextElementSibling.title=i.getConstant("SelectMergeType")},beforeOpen:function(e){return e.element.setAttribute("aria-label",i.getConstant("MergeCells"))}}),this.mergeSplitBtn.createElement=this.parent.createElement,this.mergeSplitBtn.appendTo("#"+e+"_merge"),this.mergeSplitBtn.element.parentElement},que.prototype.mergeSelectHandler=function(e){e.item.id===this.parent.element.id+"_unmerge"?this.unMerge():this.merge(e.item.id),this.mergeSplitBtn.element.setAttribute("aria-label",e.item.text)},que.prototype.unMerge=function(e){var t=this.parent.getActiveSheet(),i=fte(rte(t.selectedRange));if(are(this.parent,i))this.parent.notify(ele,null);else{this.parent.showSpinner();for(var n=t.selectedRange,o=[],r=i[0];r<=i[2];r++)for(var s=i[1];s<=i[3];s++){var a=Kre(r,s,t);a&&(1<a.rowSpan||1<a.colSpan)&&(this.parent.notify(Lne,a={range:[r,s,r,s]}),o.push(a.range))}e={merge:!1,range:e&&e.range||n,isAction:!0,refreshRibbon:!0,type:"All"};0<o.length&&(e.mergeCollection=o),this.parent.notify(Bne,e),this.toggleActiveState(!1),this.parent.hideSpinner()}},que.prototype.merge=function(e){var t,i=this,n=this.parent.getActiveSheet(),o=rte(n.selectedRange);if(are(this.parent,fte(o)))this.parent.notify(ele,null);else{for(var r,s,a=e.includes("merge_all"),l=o[0];l<=o[2];l++)for(var h=o[1];h<=o[3];h++)l===o[0]&&h===o[1]&&a||l===o[0]&&e.includes("merge_vertically")||h===o[1]&&e.includes("_merge_horizontally")||((t=Kre(l,h,n)||{}).value||t.formula)&&(r=!0);r?(s=this.parent.serviceLocator.getService(rpe)).show({height:200,width:400,isModal:!0,showCloseIcon:!0,cssClass:"e-merge-alert-dlg",content:this.parent.serviceLocator.getService(ope).getConstant("MergeCellsAlert"),beforeOpen:function(e){var t={dialogName:"MergeAlertDialog",element:e.element,target:e.target,cancel:e.cancel};i.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:sce(i.parent.element)},buttons:[{buttonModel:{content:this.parent.serviceLocator.getService(ope).getConstant("Ok"),isPrimary:!0},click:function(){s.hide(),i.performMerge(e),a&&i.toggleActiveState(!0)}}]}):(this.performMerge(e),a&&this.toggleActiveState(!0))}},que.prototype.performMerge=function(e){var t=this.parent.element.id;switch(this.parent.showSpinner(),e){case t+"_merge_all":this.parent.notify(Bne,{merge:!0,range:this.parent.getActiveSheet().selectedRange,type:"All",isAction:!0,refreshRibbon:!0});break;case t+"_merge_horizontally":this.parent.notify(Bne,{merge:!0,range:this.parent.getActiveSheet().selectedRange,type:"Horizontally",isAction:!0});break;case t+"_merge_vertically":this.parent.notify(Bne,{merge:!0,range:this.parent.getActiveSheet().selectedRange,type:"Vertically",isAction:!0})}this.parent.hideSpinner()},que.prototype.getSortFilterDDB=function(i){var o,r=this,s=this.parent.serviceLocator.getService(ope);return this.sortingDdb=new u2({cssClass:"e-sort-filter-ddb",iconCss:"e-icons e-sort-filter-icon",items:[{text:s.getConstant("SortAscending"),iconCss:"e-icons e-sort-asc"},{text:s.getConstant("SortDescending"),iconCss:"e-icons e-sort-desc"},{text:s.getConstant("CustomSort")+"...",iconCss:"e-icons e-sort-custom"},{separator:!0},{text:s.getConstant("Filter"),iconCss:"e-icons e-filter-apply",id:i+"_applyfilter"},{text:s.getConstant("ClearAllFilter"),iconCss:"e-icons e-filter-clear",id:i+"_clearfilter"},{text:s.getConstant("ReapplyFilter"),iconCss:"e-icons e-filter-reapply",id:i+"_reapplyfilter"}],createPopupOnClick:!0,beforeItemRender:function(e){var t={isFiltered:!1,isClearAll:!0};r.parent.notify(Nae,t),r.parent.allowSorting||e.item.text!==s.getConstant("SortAscending")&&e.item.text!==s.getConstant("SortDescending")&&e.item.text!==s.getConstant("CustomSort")+"..."||e.element.classList.add("e-disabled"),r.parent.allowFiltering||e.item.text!==s.getConstant("Filter")||e.element.classList.add("e-disabled"),e.item.id!==i+"_clearfilter"&&e.item.id!==i+"_reapplyfilter"||(t.isFiltered?e.element.classList.remove("e-disabled"):e.element.classList.add("e-disabled"))},beforeOpen:function(e){r.refreshSelected(r.sortingDdb,e.element,"iconCss"),e.element.setAttribute("aria-label",r.parent.serviceLocator.getService(ope).getConstant("SortAndFilter"))},select:function(e){var t=[];if(e.item.text===s.getConstant("SortAscending")||e.item.text===s.getConstant("SortDescending")||e.item.text===s.getConstant("CustomSort")+"..."){var i=rte(r.parent.getActiveSheet().selectedRange),i=Xoe(i[0],i[1],r.parent.getActiveSheet());if(are(r.parent,i))return void r.parent.notify(ele,null)}switch(e.item.text){case s.getConstant("Filter"):r.parent.notify(Pae,{});break;case s.getConstant("ClearAllFilter"):r.parent.notify(Oae,{isAction:!0});break;case s.getConstant("ReapplyFilter"):r.parent.notify(Lae,null);break;case s.getConstant("CustomSort")+"...":r.parent.notify(aae,null);break;default:if(o=e.item.text===s.getConstant("SortAscending")?"Ascending":"Descending",r.parent.sortCollection)for(var n=r.parent.sortCollection.length-1;0<=n;n--)r.parent.sortCollection[n]&&r.parent.sortCollection[n].sheetIndex===r.parent.activeSheetIndex&&(t.push(r.parent.sortCollection[n]),r.parent.sortCollection.splice(n,1));r.parent.notify(Doe,{sortOptions:{sortDescriptors:{order:o}}}),r.parent.notify(lae,{sortOptions:{sortDescriptors:{order:o}},previousSort:t})}r.sortingDdb.element.setAttribute("aria-label",e.item.text)}}),this.sortingDdb.createElement=this.parent.createElement,this.sortingDdb.appendTo(this.parent.createElement("button",{id:i+"_sorting",attrs:{type:"button"},className:"e-ss-ddb"})),this.sortingDdb.element},que.prototype.getFindBtn=function(e){var t=this,e=this.parent.createElement("button",{id:e+"_findbtn",attrs:{type:"button","aria-label":this.parent.serviceLocator.getService(ope).getConstant("FindReplaceTooltip")}});return this.findDdb=new zv({cssClass:"e-spreadsheet-find-ddb e-flat",iconCss:"e-icons e-search-icon"}),this.findDdb.createElement=this.parent.createElement,this.findDdb.appendTo(e),e.onclick=function(e){t.parent.notify(vie,{event:e})},this.findDdb.element},que.prototype.getClearDDB=function(n){var o=this,e=this.parent.serviceLocator.getService(ope);return this.clearDdb=new u2({cssClass:"e-clear-ddb",iconCss:"e-icons e-clear-icon",items:[{text:e.getConstant("ClearAll"),id:n+"_Clear All"},{text:e.getConstant("ClearFormats"),id:n+"_Clear Formats"},{text:e.getConstant("ClearContents"),id:n+"_Clear Contents"},{text:e.getConstant("ClearHyperlinks"),id:n+"_Clear Hyperlinks"}],createPopupOnClick:!0,beforeOpen:function(e){e.element.setAttribute("aria-label",o.parent.serviceLocator.getService(ope).getConstant("Clear"))},beforeItemRender:function(e){var t=o.parent.getActiveSheet(),i=fte(rte(t.selectedRange));t.isProtected&&t.protectSettings.formatCells&&e.item.id!==n+"_Clear Formats"&&(e.item.id===n+"_Clear Hyperlinks"||ace(o.parent,i))&&(e.element.classList.add("e-disabled"),e.element.setAttribute("aria-disabled","true"))},select:function(e){o.parent.notify(ule,{options:{type:e.item.id.replace(n+"_","")},isAction:!0}),o.clearDdb.element.setAttribute("aria-label",e.item.text)}}),this.clearDdb.createElement=this.parent.createElement,this.clearDdb.appendTo(this.parent.createElement("button",{id:n+"_clear",attrs:{type:"button"},className:"e-ss-ddb"})),this.clearDdb.element},que.prototype.ribbonCreated=function(){var e=this.parent.serviceLocator.getService(ope).getConstant("CollapseToolbar");pt(this.ribbon.element.querySelector(".e-drop-icon"),{role:"button",tabindex:"-1",title:e,"aria-label":e}),this.ribbon.toolbarObj&&(this.ribbon.toolbarObj.allowKeyboard=this.parent.enableKeyboardNavigation,this.ribbon.toolbarObj.dataBind())},que.prototype.alignItemRender=function(e){e.element.title=this.parent.serviceLocator.getService(ope).getConstant("Align"+this.getAlignText(e))},que.prototype.getAlignText=function(e){e=e.item.iconCss.split(" e-")[1].split("-icon")[0];return e[0].toUpperCase()+e.slice(1,e.length)},que.prototype.toggleBtnClicked=function(e){var t,i,n,o,r,e=z(e.target,".e-btn"),s=this.parent.element.id,a=e.id,l=Tie;switch(a){case s+"_bold":i={fontWeight:"normal"},n={fontWeight:"bold"},r="fontWeight";break;case s+"_italic":i={fontStyle:"normal"},n={fontStyle:"italic"},r="fontStyle";break;case s+"_line-through":l=Die,n=i={textDecoration:"line-through"},r="textDecoration";break;case s+"_underline":l=Die,n=i={textDecoration:"underline"},r="textDecoration"}e.classList.contains("e-active")?(t=n[""+r],this.parent.notify(l,o={style:n,onActionUpdate:!0}),o.cancel&&e.classList.remove("e-active")):(t=i[""+r],this.parent.notify(l,o={style:i,onActionUpdate:!0}),o.cancel&&e.classList.add("e-active")),o.cancel||t===o.style[""+r]||this.refreshToggleBtn(ste(this.parent.getActiveSheet().activeCell))},que.prototype.getCellStyleValue=function(e,t){var t=Kre(t[0],t[1],this.parent.getActiveSheet()),i=this.parent.cellStyle[""+e];return i=t&&t.style&&t.style[""+e]?t.style[""+e]:i},que.prototype.refreshSelected=function(e,t,i,n){void 0===n&&(n=i);for(var o=0;o<e.items.length;o++)if(e.items[o][""+n]===e[""+i]){t.children[o].classList.add("e-selected");break}},que.prototype.expandCollapseHandler=function(e){var t=this.ribbon.element.querySelector(".e-drop-icon"),i=this.parent.serviceLocator.getService(ope);e.expanded?(t.title=i.getConstant("CollapseToolbar"),t.setAttribute("aria-label",i.getConstant("ExpandToolbar"))):(t.title=i.getConstant("ExpandToolbar"),t.setAttribute("aria-label",i.getConstant("CollapseToolbar"))),this.parent.setPanelSize()},que.prototype.getChartThemeDdbItems=function(t){var i=this.parent.serviceLocator.getService(ope),n=[];return["Material","Fabric","Bootstrap","HighContrastLight","MaterialDark","FabricDark","HighContrast","BootstrapDark","Bootstrap4","Bootstrap5Dark","Bootstrap5","TailwindDark","Tailwind","Tailwind3","Tailwind3Dark","FluentDark","Fluent","Fluent2","Fluent2Dark","Material3","Material3Dark"].forEach(function(e){n.push({id:e,text:i.getConstant(e),iconCss:e===t?"e-icons e-selected-icon":""})}),n},que.prototype.getNumFormatDdbItems=function(e){var t=this.parent.serviceLocator.getService(ope);return[{id:e+"_General",text:t.getConstant("General")},{id:e+"_Number",text:t.getConstant("Number")},{id:e+"_Currency",text:t.getConstant("Currency")},{id:e+"_Accounting",text:t.getConstant("Accounting")},{id:e+"_ShortDate",text:t.getConstant("ShortDate")},{id:e+"_LongDate",text:t.getConstant("LongDate")},{id:e+"_Time",text:t.getConstant("Time")},{id:e+"_Percentage",text:t.getConstant("Percentage")},{id:e+"_Fraction",text:t.getConstant("Fraction")},{id:e+"_Scientific",text:t.getConstant("Scientific")},{id:e+"_Text",text:t.getConstant("Text")},{id:e+"_Custom",text:t.getConstant("Custom")}]},que.prototype.getFontFamilyItems=function(){return[{text:"Arial"},{text:"Arial Black"},{text:"Axettac Demo"},{text:"Batang"},{text:"Book Antiqua"},{text:"Calibri",iconCss:"e-icons e-selected-icon"},{text:"Comic Sans MS"},{text:"Courier"},{text:"Courier New"},{text:"Din Condensed"},{text:"Georgia"},{text:"Helvetica"},{text:"Helvetica New"},{text:"Roboto"},{text:"Tahoma"},{text:"Times New Roman"},{text:"Verdana"}]},que.prototype.applyNumFormat=function(e){var t=this.parent.getActiveSheet(),e={format:e,range:t.selectedRange,cancel:!1,requestType:"NumberFormat"},t={range:t.name+"!"+e.range,format:e.format,requestType:"NumberFormat"},i=are(this.parent,fte(rte(e.range)));return!i&&(this.parent.trigger("beforeCellFormat",e),this.parent.notify(fie,{eventArgs:e,action:"format"}),e.cancel)||(this.parent.notify(Sie,e),this.parent.notify(poe,{type:"mousedown"}),i)||this.parent.notify(Vae,{eventArgs:t,action:"format"}),e.format},que.prototype.renderCustomFormatDialog=function(i,n){var o=this,r=this.parent.serviceLocator.getService(ope),e=this.parent.createElement("div"),t=this.parent.createElement("div",{className:"e-custom-dialog"}),s=this.parent.createElement("button",{className:"e-btn",attrs:{type:"button"}}),a=(s.innerText=r.getConstant("Apply"),this.parent.createElement("div",{className:"e-custom-sample"})),l=(a.innerText=r.getConstant("CustomFormatTypeList")+":",this.parent.createElement("div",{className:"e-input-button"})),h=this.parent.createElement("input",{className:"e-input e-dialog-input",attrs:{type:"text",name:"input",spellcheck:"false",placeholder:r.getConstant("CustomFormatPlaceholder")}}),d=this.parent.createElement("div",{className:"e-custom-listview"}),p=this.parent.serviceLocator.getService(rpe),c=new MH({dataSource:n,select:function(e){h.value=e.item.textContent,e.event&&"keydown"===e.event.type&&e.item&&e.item.focus()}});if(l.appendChild(h),l.appendChild(s),t.appendChild(l),t.appendChild(a),t.appendChild(d),c.appendTo(d),n[4]!==i[4])for(var u=c.element.getElementsByClassName("e-list-text"),g=0,m=u.length;g<m;g++)u[g].textContent!==n[g]&&(u[g].textContent=n[g]);s.addEventListener("click",function(){var e=h.value,t=n.indexOf(e),t=-1<t?i[t]:Xhe(o.parent,e);(t=o.applyNumFormat(t))&&(o.refreshNumFormatSelection(Yhe(t,!0),o.parent.getActiveSheet(),r,t),o.parent.notify(xoe,{action:"addToCustomFormats",format:e,defaultFormat:t})),p.hide(),o.parent.showAggregate&&o.parent.notify(hle,{})});h.addEventListener("input",function(){c.getSelectedItems()&&c.unselectItem()}),p.show({header:r.getConstant("CustomFormat"),cssClass:"e-custom-format-dlg",height:-1<this.parent.cssClass.indexOf("e-bigger")?502:480,width:440,isModal:!0,showCloseIcon:!0,content:t,footerTemplate:e,beforeOpen:function(e){var t={dialogName:"CustomNumberFormatDlg",element:e.element,target:e.target,cancel:e.cancel};o.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:((e=Kre((e=ste((t=o.parent.getActiveSheet()).activeCell))[0],e[1],t))&&e.format&&(t=i.indexOf(e.format),c.selectItem(c.element.getElementsByClassName("e-list-item")[t])),sce(o.parent.element))}})},que.prototype.tBarDdbBeforeOpen=function(e,t,i,n){void 0===n&&(n=0);var o,r=this.parent.viewport.height,t=parseInt(getComputedStyle(e.firstElementChild).height,10)*(t.length-n)+2*parseInt(getComputedStyle(e).paddingTop,10);n&&(o=getComputedStyle(e.querySelector(".e-separator")),t+=n*(parseInt(o.borderBottomWidth,10)+2*parseInt(o.marginTop,10))),r<t?(e.style.height=r+"px",e.style.overflowY="auto"):e.style.height&&(e.style.height="",e.style.overflowY=""),e.setAttribute("aria-label",i)},que.prototype.numDDBOpen=function(e){this.numPopupWidth=0;for(var t=e.element.querySelectorAll("span.e-numformat-preview-text"),i=0,n=t.length;i<n;i++)this.numPopupWidth<t[i].offsetWidth&&(this.numPopupWidth=t[i].offsetWidth);e=this.numPopupWidth+160;document.querySelector(".e-numformat-ddb.e-dropdown-popup").style.width=e+"px"},que.prototype.previewNumFormat=function(e){var t,i,n;e.item.id.includes("_Custom")||(t=this.parent.createElement("div",{className:"e-numformat-text",styles:"width:100%",innerHTML:e.element.innerHTML}),e.element.innerHTML="",je((i=Kre((i=ste((n=this.parent.getActiveSheet()).activeCell))[0],i[1],n,!1,!0)).value)&&""===i.value||(n=Ghe(e.item.id.split(this.parent.element.id+"_")[1]),i={type:e.item.text,formattedText:"",value:i.value,format:n,cell:{value:i.value,format:n},skipFormatCheck:nre(this.parent)},this.parent.notify(Aie,i),(n=this.parent.createElement("span",{className:"e-numformat-preview-text",styles:"float:right;"})).innerText=i.formattedText,t.appendChild(n)),e.element.appendChild(t))},que.prototype.refreshRibbonContent=function(e){if(this.ribbon){je(e)&&(e=this.ribbon.selectedTab);var t=this.parent.serviceLocator.getService(ope),i=this.parent.getActiveSheet(),n=ste(i.activeCell);switch(this.ribbon.items[e].header.text){case t.getConstant("Home"):this.refreshHomeTabContent(n);break;case t.getConstant("Insert"):i.isProtected&&(i.protectSettings.insertLink&&!Hoe(Kre(n[0],n[1],i),Kde(i,n[1]))?this.enableToolbarItems([{tab:t.getConstant("Insert"),items:[this.parent.element.id+"_hyperlink"],enable:!0}]):this.enableToolbarItems([{tab:t.getConstant("Insert"),items:[this.parent.element.id+"_hyperlink"],enable:!1}]));break;case t.getConstant("Formulas"):i.isProtected&&(Hoe(Kre(n[0],n[1],i),Kde(i,n[1]))?this.enableToolbarItems([{tab:t.getConstant("Formulas"),items:[this.parent.element.id+"_insert_function"],enable:!1}]):this.enableToolbarItems([{tab:t.getConstant("Formulas"),items:[this.parent.element.id+"_insert_function"],enable:!0}]));break;case t.getConstant("Data"):this.refreshDataTabContent(e);break;case t.getConstant("View"):this.refreshViewTabContent(e)}}},que.prototype.refreshHomeTabContent=function(e){je(document.getElementById(this.parent.element.id+"_number_format"))||(this.numFormatDDB=At(document.getElementById(this.parent.element.id+"_number_format"),u2));var t,i=this.parent.getActiveSheet(),n=ste(i.activeCell),o=this.parent.serviceLocator.getService(ope),r=Kre(n[0],n[1],i,!1,!0),s=Yhe(r.format||"General",!0);this.refreshNumFormatSelection(s,i,o,r.format),i.isProtected&&this.parent.enableClipboard&&this.parent.clipboardModule.copiedInfo&&this.parent.notify(Lse,[{items:[this.parent.element.id+"_paste"],enable:!Hoe(r,Kde(i,n[1]))}]),this.fontNameDdb&&(i.isProtected&&!i.protectSettings.formatCells?this.refreshFontNameSelection("Calibri"):this.refreshFontNameSelection(this.getCellStyleValue("fontFamily",e))),this.fontSizeDdb&&(t=this.getCellStyleValue("fontSize",e),i.isProtected&&!i.protectSettings.formatCells?this.fontSizeDdb.content="11":(t=t.includes("pt")?t.split("pt")[0]:"11")!==this.fontSizeDdb.content&&(this.fontSizeDdb.content=t,this.fontSizeDdb.dataBind())),this.refreshTextAlign(i,r,s,e),this.verticalAlignDdb&&(t="e-icons e-"+this.getCellStyleValue("verticalAlign",e).toLowerCase()+"-icon",i.isProtected&&!i.protectSettings.formatCells?this.verticalAlignDdb.iconCss="e-icons e-bottom-icon":t!==this.verticalAlignDdb.iconCss&&(this.verticalAlignDdb.iconCss=t,this.verticalAlignDdb.dataBind())),this.refreshToggleBtn(e),!i.isProtected&&(1<r.rowSpan||1<r.colSpan)?(this.enableToolbarItems([{tab:o.getConstant("Home"),items:[this.parent.element.id+"_merge_cells"],enable:!0}]),this.toggleActiveState(!0)):(n=rte(i.selectedRange),this.enableToolbarItems([{tab:o.getConstant("Home"),items:[this.parent.element.id+"_merge_cells"],enable:n[0]!==n[2]||n[1]!==n[3]}]),this.toggleActiveState(!1))},que.prototype.refreshTextAlign=function(e,t,i,n){this.textAlignDdb&&(n=this.getCellStyleValue("textAlign",n),e.isProtected&&!e.protectSettings.formatCells?this.textAlignDdb.iconCss="e-icons e-left-icon":(e="e-icons e-"+(n=void 0!==t.value&&"left"===n&&("Accounting"===i||mre(t.value)&&"Text"!==i)?"right":n).toLowerCase()+"-icon")!==this.textAlignDdb.iconCss&&(this.textAlignDdb.iconCss=e,this.textAlignDdb.dataBind()))},que.prototype.toggleActiveState=function(e){var t=this.parent.serviceLocator.getService(ope);this.parent.getActiveSheet().isProtected||(e?this.mergeSplitBtn.element.classList.contains("e-active")||(this.mergeSplitBtn.element.classList.add("e-active"),this.mergeSplitBtn.element.title=t.getConstant("UnmergeCells")):this.mergeSplitBtn.element.classList.contains("e-active")&&(this.mergeSplitBtn.element.classList.remove("e-active"),this.mergeSplitBtn.element.title=t.getConstant("MergeCells")))},que.prototype.refreshToggleBtn=function(i){var n,o,r,s=this,a=this.parent.getActiveSheet(),l=this.parent.element.id,h=Kre(i[0],i[1],a),d=["fontWeight","fontStyle","textDecoration","textDecoration"];["bold","italic","line-through","underline","wrap"].forEach(function(e,t){(n=document.getElementById(l+"_"+e))&&(r=!1,a.isProtected&&!a.protectSettings.formatCells||("wrap"===e?r=s.parent.allowWrap&&h&&h.wrap:s.parent.allowCellFormatting&&(o=s.getCellStyleValue(d[t],i).toLowerCase(),r=-1<o.indexOf(e))),r?n.classList.add("e-active"):n.classList.contains("e-active")&&n.classList.remove("e-active"))})},que.prototype.refreshFontNameSelection=function(e){e=e.split('"').join(""),this.fontNameDdb.element.firstElementChild.textContent=e;for(var t=0;t<this.fontNameDdb.items.length;t++)if(this.fontNameDdb.items[t].text===e){this.fontNameDdb.items[t].iconCss="e-icons e-selected-icon",t!==this.fontNameIndex&&(this.fontNameDdb.items[this.fontNameIndex].iconCss=""),this.fontNameDdb.setProperties({items:this.fontNameDdb.items},!0),this.fontNameIndex=t;break}["Arial","Arial Black","Axettac Demo","Batang","Book Antiqua","Calibri","Comic Sans MS","Courier","Courier New","Din Condensed","Georgia","Helvetica","Helvetica New","Roboto","Tahoma","Times New Roman","Verdana"].indexOf(e)<0&&(this.fontNameDdb.items[this.fontNameIndex].iconCss=""),this.fontNameDdb.element.setAttribute("aria-label",e)},que.prototype.refreshNumFormatSelection=function(e,t,i,n){if(this.numFormatDDB){e=t.isProtected&&!t.protectSettings.formatCells?"General":i.getConstant(e=n&&"General"===e&&"General"!==n?"Custom":e);for(var o=0;o<this.numFormatDDB.items.length;o++)""!==this.numFormatDDB.items[o].iconCss&&(this.numFormatDDB.items[o].iconCss=""),this.numFormatDDB.items[o].text===e&&(this.numFormatDDB.items[o].iconCss="e-icons e-selected-icon");this.numFormatDDB.element.firstElementChild.textContent=e,this.numFormatDDB.setProperties({items:this.numFormatDDB.items},!0),this.numFormatDDB.element.setAttribute("aria-label",e)}},que.prototype.fileMenuItemSelect=function(e){var t,i=this,n=Pe({cancel:!1},e),o=(this.parent.trigger("fileMenuItemSelect",n),this.parent.element.id);if(!n.cancel)switch(e.item.id){case o+"_Print":this.parent.print();break;case o+"_Open":ge("#"+o+"_fileUpload",this.parent.element).click(),sce(this.parent.element);break;case o+"_Xlsx":case o+"_Xls":case o+"_Csv":case o+"_Pdf":this.parent.notify(bie,e);break;case o+"_New":(t=this.parent.serviceLocator.getService(rpe)).show({height:200,width:400,isModal:!0,showCloseIcon:!0,content:this.parent.serviceLocator.getService(ope).getConstant("DestroyAlert"),beforeOpen:function(e){var t={dialogName:"DestroySheetDialog",element:e.element,target:e.target,cancel:e.cancel};i.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:sce(i.parent.element)},buttons:[{buttonModel:{content:this.parent.serviceLocator.getService(ope).getConstant("Ok"),isPrimary:!0},click:function(){t.hide(),i.parent.refresh(!0)}}]})}},que.prototype.toolbarClicked=function(e){if(e.item&&"spreadsheet_find"!==e.item.id){var t,i,n=this.parent.element.id,o=this.parent.getActiveSheet();switch(e.item.id){case n+"_headers":if(t={isShow:!o.showHeaders,sheetIdx:this.parent.activeSheetIndex,cancel:!1},this.parent.notify(Vae,{eventArgs:t,action:"headers"}),t.cancel)return;this.parent.setSheetPropertyOnMute(o,"showHeaders",!o.showHeaders),this.parent.serviceLocator.getService("sheet").showHideHeaders(),this.toggleRibbonItems({props:"Headers",activeTab:this.ribbon.selectedTab});break;case n+"_gridlines":if(t={isShow:!o.showGridLines,sheetIdx:this.parent.activeSheetIndex,cancel:!1},this.parent.notify(Vae,{eventArgs:t,action:"gridLines"}),t.cancel)return;this.parent.setSheetPropertyOnMute(o,"showGridLines",!o.showGridLines),this.toggleRibbonItems({props:"GridLines",activeTab:this.ribbon.selectedTab});break;case n+"_protect":this.parent.notify(hhe,{});break;case n+"_undo":this.parent.notify(Tae,{isUndo:!0});break;case n+"_redo":this.parent.notify(Tae,{isUndo:!1});break;case n+"_freezepanes":t=ste(o.topLeftCell),i=o.frozenRows||o.frozenColumns?t:ste(o.activeCell),this.parent.notify(Yle,{row:i[0]-t[0],column:i[1]-t[1],triggerEvent:!0});break;case n+"_freezerows":this.parent.notify(Yle,{row:o.frozenRows?0:ste(o.activeCell)[0]-ste(o.topLeftCell)[0],column:o.frozenColumns,triggerEvent:!0});break;case n+"_freezecolumns":this.parent.notify(Yle,{row:o.frozenRows,column:o.frozenColumns?0:ste(o.activeCell)[1]-ste(o.topLeftCell)[1],triggerEvent:!0});break;case n+"_protectworkbook":0<this.parent.password.length?this.parent.notify(Wle,null):this.parent.isProtected?(this.parent.isProtected=!1,this.parent.showSheetTabs&&(this.parent.element.querySelector(".e-add-sheet-tab").removeAttribute("disabled"),this.parent.element.querySelector(".e-add-sheet-tab").classList.remove("e-disabled")),this.toggleRibbonItems({props:"Protectworkbook",activeTab:this.ribbon.selectedTab}),this.parent.notify(Vae,{action:"protectWorkbook",eventArgs:{isProtected:!1}})):this.parent.element.querySelector(".e-add-sheet-tab").classList.contains("e-disabled")?this.toggleRibbonItems({props:"Protectworkbook",activeTab:this.ribbon.selectedTab}):this.parent.notify(jle,null)}this.parent.notify(Fse,e)}},que.prototype.toggleRibbonItems=function(e){var t="",i=this.parent.serviceLocator.getService(ope).getConstant("View"),n=this.parent.serviceLocator.getService(ope).getConstant("Data");if(this.ribbon.items[this.ribbon.selectedTab].header.text===i){if(je(e.activeTab))for(var o=0,r=this.ribbon.items.length;o<r;o++)if(this.ribbon.items[o].header.text===i){e.activeTab=o;break}for(var s=this.getLocaleText(e.props),a=("GridLines"===e.props&&this.parent.serviceLocator.getService("sheet").toggleGridlines(),this.parent.element.id+"_"+e.props.toLowerCase()),l=this.ribbon.items[e.activeTab].content.length,o=void 0;o<l;o++)"Separator"!==this.ribbon.items[e.activeTab].content[o].type&&this.ribbon.items[e.activeTab].content[o].id===a&&(this.ribbon.items[e.activeTab].content[o].text=s,this.ribbon.setProperties({items:this.ribbon.items},!0));this.ribbon.items[this.ribbon.selectedTab].header.text===i&&"Protect"!==e.props&&this.updateToggleText(e.props.toLowerCase(),s)}if(this.ribbon.items[this.ribbon.selectedTab].header.text===n){if(je(e.activeTab))for(var o=0,h=this.ribbon.items.length;o<h;o++)if(this.ribbon.items[o].header.text===n){e.activeTab=o;break}if((a=this.parent.element.id+"_"+e.props.toLowerCase())===this.parent.element.id+"_protect"){var d=this.ribbon.items[this.ribbon.selectedTab].content.length,p=void 0;for(p=0;p<d&&this.ribbon.items[this.ribbon.selectedTab].content[p].id!==this.parent.element.id+"_protect";p++);t=this.getLocaleProtectText("Sheet",!0)}else if(a===this.parent.element.id+"_protectworkbook"){var c=this.ribbon.items[this.ribbon.selectedTab].content.length,p=void 0;for(p=0;p<c&&this.ribbon.items[this.ribbon.selectedTab].content[p].id!==this.parent.element.id+"_protectworkbook";p++);this.parent.isProtected||0<this.parent.password.length?t=this.getLocaleProtectWorkbook("UnprotectWorkbook"):this.parent.isProtected||(t=this.getLocaleProtectWorkbook("ProtectWorkbook"))}for(l=this.ribbon.items[e.activeTab].content.length,o=void 0;o<l;o++)"Separator"!==this.ribbon.items[e.activeTab].content[o].type&&this.ribbon.items[e.activeTab].content[o].id===a&&(this.ribbon.items[e.activeTab].content[o].text=t,this.ribbon.setProperties({items:this.ribbon.items},!0));this.ribbon.items[this.ribbon.selectedTab].header.text===n&&this.updateToggleText(e.props.toLowerCase(),t)}},que.prototype.enableFileMenuItems=function(e){this.ribbon.enableMenuItems(e.items,e.enable,e.isUniqueId)},que.prototype.hideRibbonTabs=function(e){this.ribbon.hideTabs(e.tabs,e.hide)},que.prototype.addRibbonTabs=function(e){this.ribbon.addTabs(e.items,e.insertBefore),ge(".e-ribbon .e-tab-header .e-toolbar-item:not(.e-menu-tab).e-hide",this.parent.element)&&this.parent.updateActiveBorder(ct(".e-ribbon .e-tab-header .e-toolbar-item:not(.e-menu-tab)",this.parent.element)[this.ribbon.selectedTab])},que.prototype.updateToggleText=function(e,t){var i=ge("#"+this.parent.element.id+"_"+e+" .e-tbar-btn-text",this.ribbon.element);"protect"===e||"protectworkbook"===e?i.parentElement.setAttribute("aria-label",t):i.parentElement.setAttribute("aria-label",i.textContent),cpe(function(){i&&(i.textContent=t)}),"headers"===e&&(e=this.parent.element.getElementsByClassName("e-findtool-dlg")[0])&&e.classList.contains("e-popup-open")&&this.parent.notify(vie,{refreshPosition:!0,dialogEle:e})},que.prototype.refreshViewTabContent=function(e){for(var t,i=this.parent.element.id,n=this.parent.getActiveSheet(),o=this.parent.serviceLocator.getService(ope),r=0;r<this.ribbon.items[e].content.length;r++)"Separator"!==(t=this.ribbon.items[e].content[r]).type&&(t.id===i+"_headers"&&this.updateViewTabContent(e,"Headers",r),t.id===i+"_gridlines"&&this.updateViewTabContent(e,"GridLines",r),t.id===i+"_freezepanes"&&(n.frozenRows||n.frozenColumns?t.text===o.getConstant("FreezePanes")&&this.updateToggleText("freezepanes",this.updateRibbonItemText("Unfreeze","Panes",r,e)):t.text===o.getConstant("UnfreezePanes")&&this.updateToggleText("freezepanes",this.updateRibbonItemText("Freeze","Panes",r,e))),t.id===i+"_freezerows"&&(n.frozenRows?t.text===o.getConstant("FreezeRows")&&this.updateToggleText("freezerows",this.updateRibbonItemText("Unfreeze","Rows",r,e)):t.text===o.getConstant("UnfreezeRows")&&this.updateToggleText("freezerows",this.updateRibbonItemText("Freeze","Rows",r,e))),t.id===i+"_freezecolumns")&&(n.frozenColumns?t.text===o.getConstant("FreezeColumns")&&this.updateToggleText("freezecolumns",this.updateRibbonItemText("Unfreeze","Columns",r,e)):t.text===o.getConstant("UnfreezeColumns")&&this.updateToggleText("freezecolumns",this.updateRibbonItemText("Freeze","Columns",r,e)))},que.prototype.updateViewTabContent=function(e,t,i){var n=this.parent.getActiveSheet(),o=this.parent.serviceLocator.getService(ope);n["show"+t]?this.ribbon.items[e].content[i].text===o.getConstant("Show"+t)&&this.updateToggleText(t.toLowerCase(),this.updateRibbonItemText("Hide",t,i,e)):this.ribbon.items[e].content[i].text===o.getConstant("Hide"+t)&&this.updateToggleText(t.toLowerCase(),this.updateRibbonItemText("Show",t,i,e))},que.prototype.updateRibbonItemText=function(e,t,i,n){e=this.parent.serviceLocator.getService(ope).getConstant(e+t);return this.ribbon.items[n].content[i].text=e,this.ribbon.setProperties({items:this.ribbon.items},!0),e},que.prototype.refreshDataTabContent=function(e){for(var t,i=this.parent.element.id,n=0;n<this.ribbon.items[e].content.length;n++)if("Separator"!==this.ribbon.items[e].content[n].type){if(this.ribbon.items[e].content[n].id===i+"_protect"){if(this.updateDataTabContent(e,"Sheet",n),t)break;t=!0}this.ribbon.items[e].content[n].id===i+"_protectworkbook"&&this.updateDataTabContent(e,"Workbook",n)}},que.prototype.updateDataTabContent=function(e,t,i){var n=this.parent.getActiveSheet(),o=this.parent.serviceLocator.getService(ope);"Sheet"===t?n.isProtected?this.ribbon.items[e].content[i].text===o.getConstant("Protect"+t)&&(this.ribbon.items[e].content[i].cssClass="e-active",this.updateProtectBtn("Unprotect",t,i,e)):this.updateProtectBtn("Protect",t,i,e):"Workbook"===t&&(n=this.parent.serviceLocator.getService(ope),this.parent.isProtected?this.ribbon.items[e].content[i].text===n.getConstant("Protect"+t)&&this.updateToggleText("protectworkbook",this.updateRibbonItemText("Unprotect",t,i,e)):this.ribbon.items[e].content[i].text===n.getConstant("Unprotect"+t)&&this.updateToggleText("protectworkbook",this.updateRibbonItemText("Protect",t,i,e)))},que.prototype.updateProtectBtn=function(e,t,i,n){e=this.parent.serviceLocator.getService(ope).getConstant(e+t);this.ribbon.items[n].content[i].text=e,this.ribbon.setProperties({items:this.ribbon.items},!0),this.updateToggleText("protect",e)},que.prototype.updateProtectWorkbookBtn=function(e,t,i,n){e=this.parent.serviceLocator.getService(ope).getConstant(e);this.ribbon.items[n].content[i].text=e,this.ribbon.setProperties({items:this.ribbon.items},!0),this.updateToggleText("protectworkbook",e)},que.prototype.addToolbarItems=function(e){var t=this.parent.serviceLocator.getService(ope);this.ribbon.addToolbarItems(t.getConstant(e.tab),e.items,e.index),this.parent&&this.parent.isReact&&this.parent.portals&&this.ribbon.toolbarObj&&this.ribbon.toolbarObj.portals&&(this.parent.portals=this.parent.portals.concat(this.ribbon.toolbarObj.portals),this.parent.renderReactTemplates())},que.prototype.enableToolbarItems=function(e){var t=this;e.forEach(function(e){t.ribbon.enableItems(e.tab||t.ribbon.items[t.ribbon.selectedTab].header.text,e.items,e.enable)})},que.prototype.createMobileView=function(){var t=this,i=this.parent.element.id,e=this.parent.createElement("div",{className:"e-header-toolbar"}),n=this.parent.createElement("ul"),o=(e.appendChild(n),new U3({items:[{prefixIcon:"e-tick-icon",align:"Left",id:i+"focused_tick",cssClass:"e-focused-tick"},{template:n,align:"Right",id:i+"file_menu"}],clicked:function(e){e.item.id===i+"focused_tick"&&(t.parent.element.classList.remove("e-mobile-focused"),t.parent.renderModule.setSheetPanelSize())},created:function(){var e=new L4({cssClass:"e-mobile e-file-menu",enableRtl:!0,showItemOnClick:!0,items:t.getRibbonMenuItems(),select:t.fileMenuItemSelect.bind(t),beforeOpen:function(e){e.element.parentElement.classList.remove("e-rtl"),t.fileMenuBeforeOpen(e)},beforeClose:t.fileMenuBeforeClose.bind(t)});e.createElement=t.parent.createElement,e.appendTo(n)}}));o.createElement=this.parent.createElement,o.appendTo(e),this.parent.element.insertBefore(e,this.parent.element.firstElementChild),this.renderMobileToolbar()},que.prototype.renderMobileToolbar=function(){var t=this,e=this.parent.createElement("div",{className:"e-toolbar-panel e-ribbon"}),i=this.parent.createElement("div"),n=this.parent.createElement("button",{attrs:{type:"button"}}),r=(e.appendChild(i),e.appendChild(n),e.style.display="block",this.parent.element.appendChild(e),new u2({cssClass:"e-caret-hide",content:this.ribbon.items[0].header.text,items:[{text:this.ribbon.items[0].header.text},{text:this.ribbon.items[1].header.text},{text:this.ribbon.items[2].header.text},{text:this.ribbon.items[3].header.text}],createPopupOnClick:!0,select:function(e){e.item.text!==r.content&&(o.element.style.display="none",r.content=e.item.text,r.dataBind(),o.items=t.ribbon.items[r.items.indexOf(e.item)+1].content,o.width="calc(100% - "+n.getBoundingClientRect().width+"px)",o.element.style.display="",o.dataBind(),o.items[0].text=e.item.text,o.dataBind())},open:function(e){var t=e.element.parentElement,i=t.getBoundingClientRect(),n=O0(r.element,"right","bottom");t.style.left=n.left-i.width+"px",t.style.top=n.top-i.height+"px";for(var o=0;o<r.items.length;o++)if(r.content===r.items[o].text){e.element.children[o].classList.add("e-selected");break}},close:function(){return sce(t.parent.element)}})),o=(r.createElement=this.parent.createElement,r.appendTo(n),new U3({width:"calc(100% - "+n.getBoundingClientRect().width+"px)",items:this.ribbon.items[0].content,clicked:this.toolbarClicked.bind(this)}));o.createElement=this.parent.createElement,o.appendTo(i),e.style.display=""},que.prototype.fileMenuBeforeOpen=function(e){var n,o=this,t=this.parent.serviceLocator.getService(ope),r=[".xlsx",".xls",".csv",".pdf"];e.parentItem.text===t.getConstant("SaveAs")&&[].slice.call(e.element.children).forEach(function(e,t){n=o.parent.createElement("div",{innerHTML:e.innerHTML}),e.innerHTML="";var i=o.parent.createElement("span",{className:"e-extension"});i.innerText=r[t],n.appendChild(i),e.appendChild(n)}),this.parent.trigger("fileMenuBeforeOpen",e),e.element.setAttribute("aria-label",t.getConstant("File"))},que.prototype.enableRibbonTabs=function(e){this.ribbon.enableTabs(e.tabs,e.enable)},que.prototype.fileMenuBeforeClose=function(e){var t=this;this.parent.trigger("fileMenuBeforeClose",e),e.parentItem&&e.event&&37===e.event.keyCode&&e.parentItem.id===this.parent.element.id+"_File"&&cpe(function(){var e=t.ribbon.element.querySelector(".e-tab-header .e-toolbar-item .e-tab-wrap");e&&(sce(e),e=e.querySelector(".e-menu-item.e-focused"))&&e.classList.remove("e-focused")})},que.prototype.hideFileMenuItems=function(e){this.ribbon.hideMenuItems(e.items,e.hide,e.isUniqueId)},que.prototype.addFileMenuItems=function(e){this.ribbon.addMenuItems(e.items,e.text,e.insertAfter,e.isUniqueId)},que.prototype.hideToolbarItems=function(e){this.ribbon.hideToolbarItems(e.tab,e.indexes,e.hide)},que.prototype.protectSheetHandler=function(e){for(var t=this.parent.getActiveSheet(),i=this.parent.serviceLocator.getService(ope),n=(t.isProtected&&t.protectSettings.formatCells||!t.isProtected?(this.parent.allowCellFormatting?(this.enableToolbarItems([{tab:i.getConstant("Home"),items:e.enableHomeBtnId,enable:!0}]),t.isProtected&&t.protectSettings.formatCells&&this.enableToolbarItems([{tab:i.getConstant("Home"),items:e.enableHomeBtnId.slice(15,16),enable:!1}])):this.enableToolbarItems([{tab:i.getConstant("Home"),items:e.enableHomeBtnId.slice(3,14),enable:!1}]),this.parent.allowWrap||this.enableToolbarItems([{tab:i.getConstant("Home"),items:e.enableHomeBtnId.slice(14,15),enable:!1}]),this.parent.allowNumberFormatting||this.enableToolbarItems([{tab:i.getConstant("Home"),items:e.enableHomeBtnId.slice(2,3),enable:!1}]),this.parent.notify(ile,null)):this.enableToolbarItems([{tab:i.getConstant("Home"),items:e.disableHomeBtnId,enable:!1}]),t.isProtected&&t.protectSettings.insertLink||!t.isProtected?!this.parent.allowHyperlink||t.isProtected&&t.protectSettings.insertLink?this.enableToolbarItems([{tab:i.getConstant("Insert"),items:e.enableInsertBtnId.slice(0,1),enable:!1}]):this.enableToolbarItems([{tab:i.getConstant("Insert"),items:e.enableInsertBtnId,enable:!0}]):this.enableToolbarItems([{tab:i.getConstant("Insert"),items:e.enableInsertBtnId,enable:!1}]),this.enableToolbarItems([{tab:i.getConstant("Home"),items:e.findBtnId,enable:!t.isProtected||t.protectSettings.selectCells||t.protectSettings.selectUnLockedCells}]),this.ribbon.items[this.ribbon.selectedTab].content.length),o=0;o<n&&this.ribbon.items[this.ribbon.selectedTab].content[o].id!==this.parent.element.id+"_protectworkbook";o++);t.isProtected?(this.parent.isProtected&&this.parent.element.querySelector("#"+this.parent.element.id+"_protectworkbook")&&this.parent.element.querySelector("#"+this.parent.element.id+"_protectworkbook").querySelector(".e-tbar-btn-text").textContent===i.getConstant("UnprotectWorkbook")?this.ribbon.items[this.ribbon.selectedTab].header.text===i.getConstant("Data")&&(this.ribbon.items[this.ribbon.selectedTab].content[o].text=i.getConstant("UnprotectWorkbook")):this.ribbon.items[this.ribbon.selectedTab].header.text===i.getConstant("Data")&&(this.ribbon.items[this.ribbon.selectedTab].content[o].text=i.getConstant("ProtectWorkbook")),this.enableToolbarItems([{tab:i.getConstant("Insert"),items:e.imageBtnId,enable:!1}]),this.enableToolbarItems([{tab:i.getConstant("Data"),items:e.dataValidationBtnId,enable:!1}]),this.enableToolbarItems([{tab:i.getConstant("Formulas"),items:e.enableFrmlaBtnId,enable:!1}]),this.enableToolbarItems([{tab:i.getConstant("Insert"),items:e.chartBtnId,enable:!1}])):(this.parent.isProtected&&this.parent.element.querySelector("#"+this.parent.element.id+"_protectworkbook")&&this.parent.element.querySelector("#"+this.parent.element.id+"_protectworkbook").querySelector(".e-tbar-btn-text").textContent===i.getConstant("UnprotectWorkbook")?this.ribbon.items[this.ribbon.selectedTab].header.text===i.getConstant("Data")&&(this.ribbon.items[this.ribbon.selectedTab].content[o].text=i.getConstant("UnprotectWorkbook")):this.ribbon.items[this.ribbon.selectedTab].header.text===i.getConstant("Data")&&(this.ribbon.items[this.ribbon.selectedTab].content[o].text=i.getConstant("ProtectWorkbook")),this.enableToolbarItems([{tab:i.getConstant("Insert"),items:e.imageBtnId,enable:this.parent.allowImage}]),this.enableToolbarItems([{tab:i.getConstant("Data"),items:e.dataValidationBtnId,enable:this.parent.allowDataValidation}]),this.enableToolbarItems([{tab:i.getConstant("Formulas"),items:e.enableFrmlaBtnId,enable:!0}]),this.enableToolbarItems([{tab:i.getConstant("Insert"),items:e.chartBtnId,enable:this.parent.allowChart}]))},que.prototype.updateMergeItem=function(e){var t;this.parent.allowMerge&&(Fpe(e)||"touchmove"===e.type||e.shiftKey&&("mousedown"===e.type||"touchend"===e.type))&&!(e=this.parent.getActiveSheet()).isProtected&&((t=rte(e.selectedRange))[1]===t[3]&&t[0]===t[2]?(this.enableToolbarItems([{tab:this.parent.serviceLocator.getService(ope).getConstant("Home"),items:[this.parent.element.id+"_merge_cells"],enable:!1}]),this.toggleActiveState(!1)):(this.enableToolbarItems([{tab:this.parent.serviceLocator.getService(ope).getConstant("Home"),items:[this.parent.element.id+"_merge_cells"],enable:!0}]),1<(e=Kre((t=fte(t))[0],t[1],e,!1,!0)).rowSpan||1<e.colSpan?this.toggleActiveState(!(1<e.rowSpan&&t[0]+e.rowSpan-1!==t[2]||1<e.colSpan&&t[1]+e.colSpan-1!==t[3])):this.toggleActiveState(!1)))},que.prototype.onPropertyChanged=function(e){var t,i=this.parent.serviceLocator.getService(ope),n=this.parent.element.id,o=this.parent.getActiveSheet();switch(e){case"allowFreezePane":this.ribbon.enableItems(i.getConstant("View"),[n+"_freezepanes",n+"_freezerows",n+"_freezecolumns"],this.parent.allowFreezePane);break;case"showRibbon":this.parent.showRibbon?this.initialize(!0):this.ribbon&&this.destroy();break;case"allowImage":this.ribbon.enableItems(i.getConstant("Insert"),[n+"_image"],this.parent.allowImage);break;case"allowChart":this.ribbon.enableItems(i.getConstant("Insert"),[n+"_chart"],this.parent.allowChart),this.parent.allowChart||this.removeDesignChart();break;case"allowWrap":case"allowCellFormatting":this.refreshToggleBtn(ste(o.activeCell)),o.isProtected&&!o.protectSettings.formatCells||("allowWrap"===e?this.ribbon.enableItems(i.getConstant("Home"),[n+"_wrap"],this.parent.allowWrap):(t=[n+"_font_name",n+"_font_size",n+"_bold",n+"_italic",n+"_line-through",n+"_underline",n+"_font_color_picker",n+"_fill_color_picker",n+"_borders",n+"_merge_cells",n+"_text_align",n+"_vertical_align"],this.enableToolbarItems([{tab:i.getConstant("Home"),items:t,enable:this.parent.allowCellFormatting}])));break;case"allowNumberFormatting":o.isProtected&&!o.protectSettings.formatCells||this.ribbon.enableItems(i.getConstant("Home"),[n+"_number_format"],this.parent.allowNumberFormatting);break;case"calculationMode":this.parent.notify(Lse,[{tab:i.getConstant("Formulas"),items:[this.parent.element.id+"_calc_current_sheet",this.parent.element.id+"_calc_entire_sheets"],enable:"Manual"===this.parent.calculationMode}]),this.calcTypeOptions&&(this.calcTypeOptions.items[0].iconCss="Automatic"===this.parent.calculationMode?"e-icons e-selected-icon":"",this.calcTypeOptions.items[1].iconCss="Manual"===this.parent.calculationMode?"e-icons e-selected-icon":""),"Automatic"===this.parent.calculationMode&&this.parent.calculateNow("Workbook")}},que.prototype.addEventListener=function(){this.parent.on(ase,this.ribbonOperation,this),this.parent.on(Lse,this.enableToolbarItems,this),this.parent.on(Nie,this.refreshRibbonContent,this),this.parent.on(pae,this.toggleRibbonItems,this),this.parent.on(Gse,this.enableFileMenuItems,this),this.parent.on(Kse,this.hideRibbonTabs,this),this.parent.on(Zse,this.addRibbonTabs,this),this.parent.on($se,this.addToolbarItems,this),this.parent.on(Yse,this.hideFileMenuItems,this),this.parent.on(Xse,this.addFileMenuItems,this),this.parent.on(eae,this.hideToolbarItems,this),this.parent.on(Jse,this.enableRibbonTabs,this),this.parent.on(Gae,this.protectSheetHandler,this),this.parent.on(poe,this.updateMergeItem,this),this.parent.on(qne,this.refreshRibbonContent,this),this.parent.on(Nle,this.insertDesignChart,this),this.parent.on(Vle,this.removeDesignChart,this),this.parent.on(foe,this.unMerge,this)},que.prototype.destroy=function(){var e,t=this.parent.element,i=this.ribbon?this.ribbon.element:null,n=this.cPickerEle,o=t.id,r=this.parent.serviceLocator.getService(ope),s=At(t.querySelector(".e-tab"),"tab"),r=(s&&(e=s.selectedItem),this.switchRibbonTab(r.getConstant("Home")),["bold","italic","line-through","underline","cut","copy","undo","redo","wrap"].forEach(function(e){Wpe(ge("#"+o+"_"+e,t),zv)}),this.pasteSplitBtn&&this.pasteSplitBtn.destroy(),this.pasteSplitBtn=null,this.mergeSplitBtn&&this.mergeSplitBtn.destroy(),this.mergeSplitBtn=null,this.numFormatDDB&&this.numFormatDDB.destroy(),this.numFormatDDB=null,this.fontSizeDdb&&this.fontSizeDdb.destroy(),this.fontSizeDdb=null,this.fontNameDdb&&this.fontNameDdb.destroy(),this.fontNameDdb=null,this.textAlignDdb&&this.textAlignDdb.destroy(),this.textAlignDdb=null,this.verticalAlignDdb&&this.verticalAlignDdb.destroy(),this.verticalAlignDdb=null,this.sortingDdb&&this.sortingDdb.destroy(),this.sortingDdb=null,this.clearDdb&&this.clearDdb.destroy(),this.clearDdb=null,this.colorPicker&&this.colorPicker.destroy(),this.colorPicker=null,this.destroyComponent(o+"_borders_menu","menu"),this.bordersDdb&&this.bordersDdb.destroy(),this.bordersDdb=null,this.findDdb&&this.findDdb.destroy(),this.findDdb=null,this.destroyComponent(o+"_chart_menu","menu"),this.destroyComponent(o+"_chart_type_menu","menu"),this.destroyComponent(o+"_chart-btn","dropdown-btn"),this.destroyComponent(o+"_chart-type-btn","dropdown-btn"),this.destroyComponent(o+"_cf_menu","menu"),this.cfDdb&&(this.cfDdb.destroy(),this.cfDdb.element)&&this.cfDdb.element.remove(),this.cfDdb=null,this.detachPopupElement(o),this.parent.notify("destroyRibbonComponents",null),e&&(s.selectedItem=e,s.dataBind()),this.addChartDdb&&(this.addChartDdb.destroy(),this.addChartDdb=null),this.destroyComponent(o+"_chart_theme","menu"),this.destroyComponent(o+"_chart_theme","dropdown-btn"),this.destroyComponent(o+"_chart-type-btn","menu"),this.destroyComponent(o+"_chart-type-btn","dropdown-btn"),this.datavalidationDdb&&this.datavalidationDdb.destroy(),this.datavalidationDdb=null,n&&G(n),this.parent.serviceLocator.getService(rpe));r.dialogInstance&&r.dialogInstance.element.classList.contains("e-custom-format-dlg")&&r.hide(!0),this.cPickerEle=null,this.border&&(this.border=""),this.fontNameIndex&&(this.fontNameIndex=null),this.preTabIdx&&(this.preTabIdx=null),this.numPopupWidth&&(this.numPopupWidth=null),this.ribbon&&this.ribbon.destroy(),i&&G(i),this.ribbon=null,this.removeEventListener(),this.parent=null},que.prototype.destroyComponent=function(e,t){var i,e="string"==typeof e?document.getElementById(e):e;e&&(("menu"!==t||e.childElementCount)&&(i=At(e,t))&&(i.destroy(),"dropdown-btn"===t)&&(i=document.getElementById(e.id+"-popup"))&&G(i),"menu"===t)&&G(e)},que.prototype.detachPopupElement=function(t){["_conditionalformatting","_chart-type-btn","_chart-btn","_borders"].forEach(function(e){e=document.getElementById(""+t+e+"-popup");e&&G(e)})},que.prototype.switchRibbonTab=function(e){for(var t,i=this.parent.element.querySelectorAll(".e-tab-text"),n=0;n<i.length;n++){var o=i[n];if(o.textContent.toLowerCase()===e.toLowerCase()){o=o.closest(".e-toolbar-item");if(o){t=o.getAttribute("data-id");break}}}var r=At(this.parent.element.querySelector(".e-tab"),"tab");r&&!je(t)&&(r.selectedItem=r.getItemIndex(t),r.dataBind())},que.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ase,this.ribbonOperation),this.parent.off(Lse,this.enableToolbarItems),this.parent.off(Nie,this.refreshRibbonContent),this.parent.off(pae,this.toggleRibbonItems),this.parent.off(Gse,this.enableFileMenuItems),this.parent.off(Kse,this.hideRibbonTabs),this.parent.off(Zse,this.addRibbonTabs),this.parent.off($se,this.addToolbarItems),this.parent.off(Yse,this.hideFileMenuItems),this.parent.off(Xse,this.addFileMenuItems),this.parent.off(eae,this.hideToolbarItems),this.parent.off(Jse,this.enableRibbonTabs),this.parent.off(Gae,this.protectSheetHandler),this.parent.off(poe,this.updateMergeItem),this.parent.off(qne,this.refreshRibbonContent),this.parent.off(Nle,this.insertDesignChart),this.parent.off(Vle,this.removeDesignChart),this.parent.off(foe,this.unMerge))};var Uue=que;function que(e){this.border="1px solid #000000",this.fontNameIndex=5,this.numPopupWidth=0,this.preTabIdx=1,this.spanElements=[],this.iconSetGroupElement=[],this.iconSetElements=[],this.iconWrapElements=[],this.parent=e,this.addEventListener(),new Wue(e)}Yue.prototype.getModuleName=function(){return"formulaBar"},Yue.prototype.createFormulaBar=function(e){var t,i,n,o,r=this;!this.parent.showFormulaBar&&this.insertFnRipple?this.destroy():(t=this.parent.serviceLocator.getService(ope),i=this.parent.element.id,n=this.parent.createElement("div",{className:"e-formula-bar-panel"}),this.parent.isMobileView()||(o=this.parent.createElement("input",{id:i+"_name_box",attrs:{type:"text"}}),n.appendChild(o),this.comboBoxInstance=new oU({value:"A1",cssClass:"e-name-box",width:"",noRecordsTemplate:ao(function(){return""}),fields:{text:"name",value:"refersTo"},beforeOpen:this.nameBoxBeforeOpen.bind(this),blur:this.nameBoxBlur.bind(this),select:this.nameBoxSelect.bind(this),open:function(){r.isDevice&&(window.browserDetails.isDevice=!0)},change:function(){}}),this.comboBoxInstance.createElement=this.parent.createElement,this.comboBoxInstance.appendTo(o),this.comboBoxInstance.element.parentElement.title=t.getConstant("NameBox")),n.appendChild(this.parent.createElement("button",{className:"e-btn e-css e-flat e-icon-btn e-insert-function",attrs:{title:t.getConstant("InsertFunction"),type:"button"}})).appendChild(this.parent.createElement("span",{className:"e-btn-icon e-icons"})),this.insertFnRipple=Ht(n,{selector:".e-insert-function"}),n.appendChild(this.parent.createElement("div",{className:"e-separator"})),o=t.getConstant("FormulaBar"),(o=n.appendChild(this.parent.createElement("textarea",{className:"e-formula-bar e-css",id:i+"_formula_input",attrs:{title:o,"aria-label":o,spellcheck:"false"}}))).rows=1,this.parent.isMobileView()?(o.placeholder=t.getConstant("MobileFormulaBarPlaceHolder"),E.add(o,"focus",this.textAreaFocusIn,this),E.add(o,"blur",this.textAreaFocusOut,this)):(o=t.getConstant("ExpandFormulaBar"),n.appendChild(this.parent.createElement("span",{className:"e-drop-icon e-icons",attrs:{title:o,role:"button",tabindex:"-1","aria-label":o}}))),e&&e.uiUpdate?this.parent.element.insertBefore(n,document.getElementById(i+"_sheet_panel")):this.parent.element.appendChild(n))},Yue.prototype.textAreaFocusIn=function(){var e=this.parent.element.querySelector(".e-formula-bar-panel"),t=this.parent.createElement("button",{className:"e-btn e-css e-flat e-icon-btn e-formula-submit",attrs:{type:"button"}});t.appendChild(this.parent.createElement("span",{className:"e-btn-icon e-icons e-tick-icon"})),e.classList.add("e-focused"),e.appendChild(t)},Yue.prototype.textAreaFocusOut=function(){var e=this.parent.element.querySelector(".e-formula-bar-panel");e.classList.remove("e-focused"),G(e.querySelector(".e-formula-submit"))},Yue.prototype.keyDownHandler=function(e){var t=e.target;!this.parent.isEdit||this.parent.getActiveSheet().isProtected&&(!t.classList.contains("e-formula-bar")||t.disabled)||(Poe(t.value)||t.validity&&0===t.value.toString().indexOf("="))&&(16===e.keyCode||17===e.keyCode)||!t.classList.contains("e-formula-bar")||e.shiftKey&&(!e.shiftKey||Rpe(e.keyCode))||this.parent.notify(mse,{action:"refreshEditor",value:t.value,refreshEditorElem:!0})},Yue.prototype.keyUpHandler=function(e){var t,i;this.parent.isEdit&&(t=e.target).classList.contains("e-formula-bar")&&(this.parent.notify(mse,i={action:"getCurrentEditValue",editedValue:""}),i.editedValue===t.value||16===e.keyCode||17===e.keyCode||e.shiftKey&&(!e.shiftKey||Rpe(e.keyCode))||this.parent.notify(mse,{action:"refreshEditor",value:t.value,refreshEditorElem:!0}))},Yue.prototype.nameBoxBeforeOpen=function(e){this.comboBoxInstance.element.classList.contains("e-name-editing")?e.cancel=!0:(this.comboBoxInstance.element.select(),this.isDevice=window.browserDetails.isDevice,this.isDevice&&(window.browserDetails.isDevice=!1))},Yue.prototype.nameBoxBlur=function(){this.comboBoxInstance.element.classList.contains("e-name-editing")&&(this.comboBoxInstance.element.classList.remove("e-name-editing"),this.updateValueAfterMouseUp())},Yue.prototype.nameBoxSelect=function(e){var t,i,n,o,r;e.isInteracted&&(!e.e||"keydown"!==e.e.type||40!==e.e.keyCode&&38!==e.e.keyCode)&&(e=e.itemData.refersTo.substr(1),void 0!==(t=Bre(this.parent,Lre(e))))&&(e=cte(e),i=_re(this.parent,t),r=o=void 0,-1===e.indexOf(":")?o=r=e.replace("$",""):(n=e.indexOf(":"),o=e.substr(0,n).replace("$",""),r=e.substr(n+1,e.length).replace("$","")),r.match(/\D/g)&&!r.match(/[0-9]/g)&&o.match(/\D/g)&&!o.match(/[0-9]/g)?e=(o+="1")+":"+(r+=i.rowCount):!r.match(/\D/g)&&r.match(/[0-9]/g)&&!o.match(/\D/g)&&o.match(/[0-9]/g)&&(e=(o=lte(parseInt(o,10)-1,0))+":"+(r=lte(parseInt(r,10)-1,i.colCount-1))),t===this.parent.activeSheetIndex?this.parent.isEdit||this.parent.selectRange(e):(Ore(this.parent,e,i),this.parent.activeSheetIndex=t),this.parent.notify(vle,{range:e,isSelect:!1,isMouseDown:!1,isNameBoxSelect:!0}),sce(this.parent.element))},Yue.prototype.formulaBarUpdateHandler=function(o){var e,t,r=this,i=this.parent.getActiveSheet().selectedRange.split(":"),s={action:"getElement",element:null},a=(this.parent.notify(mse,s),this.parent.element.querySelector(".e-formula-bar"));"mousemove"===o.type||"pointermove"===o.type?(e=rte(i[0]),t=rte(i[1]),e=Math.abs(e[0]-t[0])+1+"R x "+(Math.abs(e[1]-t[1])+1)+"C",this.parent.isEdit&&(o.target&&!o.target.classList.contains("e-spreadsheet-edit")?this.parent.notify(yle,{}):s.element&&(a.value=s.element.textContent))):(e=i[0],t=Wre(this.parent)+"!"+e,Cre(this.parent,t,!1,!0).then(function(e){r.parent&&e.forEach(function(e){var e=r.getFormulaBarValue(e),t={action:"getCurrentEditValue",editedValue:""},i=(r.parent.notify(mse,t),document.getElementById(r.parent.element.id+"_formula_input")),n=i.value;i.value=e,t.editedValue&&Poe(t.editedValue.toString(),!0)||r.parent.notify(mse,{action:"refreshEditor",value:e,refreshEditorElem:!0}),r.parent.isEdit&&(o.target&&!o.target.classList.contains("e-spreadsheet-edit")?r.parent.notify(yle,{isMouseDown:Bpe(o),formulaBarVal:n}):s.element&&(a.value=s.element.textContent))})})),this.updateComboBoxValue(e)},Yue.prototype.getFormulaBarValue=function(e){var t,i,n,o,r,s,a="";return e&&(e.formula?a=e.formula:je(e.value)||""===e.value?e.hyperlink&&(a="string"==typeof e.hyperlink?e.hyperlink:e.hyperlink.address||""):(t={},"date"===(t=e.format&&ise(e.format,!0,t,!0)&&t.type)||"time"===t||"datetime"===t?(i=cre(Number(e.value)))&&"Invalid Date"!==i.toString()&&1900<=i.getFullYear()&&(n=new Ti,"h:mm:ss AM/PM"===(o=Ghe("Time"))&&(o="h:mm:ss a"),r=e.format.toLowerCase(),"time"!==t||!r.includes("m")||r.includes(":m")||r.includes("m:")||r.includes("[m")||r.includes("am")||(t="date"),r=(s=2===(r=e.value.toString().split(".")).length)?cre(parseFloat(r[0]+1+"."+r[1])||Number(e.value)):i,"date"===t?(a=n.formatDate(i,{type:"date",skeleton:"yMd"}),s&&(a+=" "+n.formatDate(r,{type:"time",skeleton:"medium",format:o}))):((1<=Number(e.value)||"datetime"===t)&&(a=n.formatDate(i,{type:"date",skeleton:"yMd"})+" "),a+=n.formatDate(r,{type:"time",skeleton:"medium",format:o}))):e.format&&e.format.includes("%")&&mre(e.value)&&((a=this.parent.getDisplayText(e)).includes("%")||(a="")),a||("true"===(a=e.value.toString()).toLowerCase()||"false"===a.toLowerCase()?a=a.toUpperCase():"en-US"!==this.parent.locale&&"."!==(s=Mi(this.parent.locale).decimal)&&mre(a)&&a.includes(".")&&(a=a.replace(".",s))))),a},Yue.prototype.updateValueAfterMouseUp=function(){this.updateComboBoxValue(this.parent.getActiveSheet().selectedRange.split(":")[0])},Yue.prototype.updateComboBoxValue=function(e){var t=this.parent.getActiveSheet(),t={action:"getNameFromRange",range:Wre(this.parent)+"!"+t.selectedRange,definedName:null};this.parent.notify(fse,t),t.definedName&&(e=t.definedName.name),this.parent.isMobileView()||this.comboBoxInstance.text!==e&&(this.comboBoxInstance.text=e,this.comboBoxInstance.dataBind())},Yue.prototype.disabletextarea=function(){var e=this.getFormulaBar();this.parent.getActiveSheet().isProtected&&!this.parent.isEdit?e.disabled=!0:e.disabled=!1},Yue.prototype.updateNameBoxValue=function(e,t){var i,n=this.parent.element.id,n=At(this.parent.element.querySelector("#"+n+"_name_box"),"combobox"),o=this.parent.getActiveSheet();t?n.text===e.name&&(n.value=o.activeCell,n.dataBind()):2===(t=e.refersTo.split("!")).length&&e.refersTo.startsWith("=")&&(t=t[0].split("=")[1].replace(/'/g,""),i=e.refersTo.split("!")[1],t===o.name)&&i===o.selectedRange&&(n.value=e.name,n.dataBind())},Yue.prototype.formulaBarScrollEdit=function(){var e=rte(this.parent.getActiveSheet().selectedRange),t=ste(this.parent.getActiveSheet().topLeftCell);e[0]<t[0]&&(this.parent.goTo(this.parent.getActiveSheet().selectedRange),this.isGoto=!0),this.parent.notify(mse,{action:"startEdit",refreshCurPos:!1})},Yue.prototype.formulaBarClickHandler=function(e){var t,e=e.target,i=this.parent.getActiveSheet(),n=i.isProtected,o=ste(i.activeCell),r=Kre(o[0],o[1],i),s=Hoe(r,Kde(i,o[1]));if(e.classList.contains("e-drop-icon")&&e.parentElement.classList.contains("e-formula-bar-panel"))this.toggleFormulaBar(e);else if(e.classList.contains("e-formula-bar")){if(sre(r,Kde(i,o[1]),_de(i,o[0])))return void this.parent.notify(ele,null);!this.parent.isEdit&&(!n||!s)||this.parent.isEdit&&n&&!e.disabled?this.formulaBarScrollEdit():n&&s&&this.parent.notify($ae,null)}else e.parentElement&&e.parentElement.classList.contains("e-name-box")&&(e.classList.contains("e-ddl-icon")?(this.parent.notify(fse,r={action:"getNames",names:[]}),this.comboBoxInstance.dataSource.length===r.names.length&&this.comboBoxInstance.value!==this.comboBoxInstance.text||(t=this.comboBoxInstance.text,this.comboBoxInstance.dataSource=r.names,i=r.names.find(function(e){return e.name===t}),this.comboBoxInstance.value=i?i.refersTo:this.comboBoxInstance.value,this.comboBoxInstance.dataBind())):(this.comboBoxInstance.element.classList.add("e-name-editing"),this.comboBoxInstance.element.select()));!je(e.offsetParent)&&(e.offsetParent.classList.contains("e-insert-function")||e.classList.contains("e-insert-function")||this.parent.element.id+"_insert_function"===e.offsetParent.id||this.parent.element.id+"_insert_function"===e.id||e.parentElement.classList.contains("e-insert-function")||this.parent.element.id+"_insert_function"===e.parentElement.id)&&this.renderInsertDlg()},Yue.prototype.renderInsertDlg=function(){var e,t,i,n,o,r,s,a,l=this,h=this.parent.getActiveSheet(),d=ste(h.activeCell);h.isProtected&&Hoe(Kre(d[0],d[1],h),Kde(h,d[1]))&&!this.parent.isEdit?this.parent.notify($ae,null):sre(Kre(d[0],d[1],h),Kde(h,d[1]),_de(h,d[0]))?this.parent.notify(ele,null):(h=this.parent.serviceLocator.getService(ope),d={action:"getCurrentEditValue",editedValue:""},(t=!this.parent.isEdit)||(this.parent.notify(fse,e={action:"isFormulaEditing",isFormulaEdit:!1}),t=e.isFormulaEdit,this.parent.notify(mse,d)),!t&&""!==d.editedValue||this.parent.element.querySelector(".e-spreadsheet-function-dlg")||(""===d.editedValue&&this.parent.notify(mse,{action:"refreshEditor",value:"="}),e=this.parent.createElement("div",{className:"e-formula-description",id:this.parent.element.id+"_description_content"}),(t=this.parent.createElement("div",{className:"e-category-content",id:this.parent.element.id+"_category_content"})).innerText=h.getConstant("PickACategory"),d=this.parent.createElement("input",{className:"e-formula-category",id:this.parent.element.id+"_formula_category"}),i=this.parent.createElement("div",{className:"e-formula-list",id:this.parent.element.id+"_formula_list"}),(n=this.parent.createElement("div",{className:"e-description-content"})).innerText=h.getConstant("Description"),(o=this.parent.createElement("div",{className:"e-header-content"})).innerText=h.getConstant("InsertFunction"),this.parent.notify(Pie,s={action:"getFormulaCategory",categoryCollection:[]}),this.categoryCollection=s.categoryCollection,this.categoryList=new qz({dataSource:this.categoryCollection,cssClass:"e-ss-formula-category",index:0,width:"285px",popupHeight:"210px",select:this.dropDownSelect.bind(this),open:function(){return r=!0},close:function(){return r=!1}}),this.parent.notify(Pie,s={action:"getLibraryFormulas",formulaCollection:[]}),this.formulaCollection=s.formulaCollection,this.formulaList=new MH({dataSource:this.formulaCollection.sort(),actionComplete:this.updateFormulaList.bind(this),select:this.listSelected.bind(this),width:"285px",height:"200px"}),this.dialog=this.parent.serviceLocator.getService(rpe),this.dialog.show({header:o.outerHTML,content:t.outerHTML+d.outerHTML+i.outerHTML+n.outerHTML+e.outerHTML,width:"320px",height:"485px",cssClass:"e-spreadsheet-function-dlg",showCloseIcon:!0,isModal:!0,beforeOpen:function(e){var t={dialogName:"InsertFunctionDialog",element:e.element,target:e.target,cancel:e.cancel};l.parent.trigger("dialogBeforeOpen",t),t.cancel?(l.dialog.dialogInstance.setProperties({beforeClose:void 0},!0),a=e.cancel=!0):sce(l.parent.element)},open:this.dialogOpen.bind(this),beforeClose:this.dialogBeforeClose.bind(this),close:this.dialogClose.bind(this),buttons:[{click:function(e){e&&13===e.keyCode&&!r||l.selectFormula()},buttonModel:{content:h.getConstant("Ok"),isPrimary:!0}}]}),a?this.categoryList=this.formulaList=null:(this.categoryList.appendTo("#"+this.parent.element.id+"_formula_category"),this.formulaList.appendTo("#"+this.parent.element.id+"_formula_list"),E.add(this.formulaList.element,"dblclick",this.formulaClickHandler,this))))},Yue.prototype.toggleFormulaBar=function(e){var t=e.parentElement,i=this.parent.serviceLocator.getService(ope);t.classList.contains("e-expanded")?(t.classList.remove("e-expanded"),document.getElementById(this.parent.element.id+"_formula_input").rows=1,e.title=i.getConstant("ExpandFormulaBar"),e.setAttribute("aria-label",i.getConstant("CollapseFormulaBar"))):(t.classList.add("e-expanded"),document.getElementById(this.parent.element.id+"_formula_input").rows=3,e.title=i.getConstant("CollapseFormulaBar"),e.setAttribute("aria-label",i.getConstant("ExpandFormulaBar"))),this.parent.setPanelSize()},Yue.prototype.dialogOpen=function(){var i=this;cpe(function(){var e=i.dialog.dialogInstance.element.querySelector(".e-footer-content .e-primary"),t=i.parent.serviceLocator.getService(ope);e.setAttribute("aria-label",t.getConstant("InsertFunction")+" "+t.getConstant("Ok")),i.categoryList&&sce(i.categoryList.element)})},Yue.prototype.dialogClose=function(){var e={action:"getCurrentEditValue",editedValue:""};this.parent.notify(mse,e),"="===e.editedValue.toString().trim()&&this.parent.notify(mse,{action:"refreshEditor",value:""})},Yue.prototype.dialogBeforeClose=function(){E.remove(this.formulaList.element,"dblclick",this.formulaClickHandler);var e=document.getElementsByClassName("e-spreadsheet-function-dlg")[0].querySelector(".e-dlg-content");e.parentNode.removeChild(e),this.categoryList.destroy(),this.categoryList=null,this.formulaList.destroy(),this.formulaList=null},Yue.prototype.selectFormula=function(){var e=this.formulaList.getSelectedItems().text,t=_re(this.parent,this.parent.activeSheetIndex);this.parent.isEdit?this.parent.notify(mse,{action:"refreshEditor",value:e+"(",refreshFormulaBar:!0,refreshEditorElem:!0,isAppend:!0}):(this.parent.notify(mse,{action:"startEdit",value:"="+e+"(",address:t.activeCell}),this.parent.notify(yse,{action:"refreshFormulabar",value:"="+e+"("})),this.dialog.dialogInstance.storeActiveElement=document.getElementById(this.parent.element.id+"_edit"),this.dialog.hide()},Yue.prototype.listSelected=function(e){this.updateFormulaDescription(),e.isInteracted&&e.item&&e.item.focus()},Yue.prototype.updateFormulaList=function(){this.activeListFormula(),this.updateFormulaDescription()},Yue.prototype.dropDownSelect=function(e){this.formulaCollection=[];var t={action:"getLibraryFormulas",formulaCollection:[]};"All"===e.item.textContent?(this.parent.notify(Pie,t),this.formulaCollection=t.formulaCollection):(t={action:"dropDownSelectFormulas",formulaCollection:[],selectCategory:e.item.textContent},this.parent.notify(Pie,t),this.formulaCollection=t.formulaCollection),this.formulaList.dataSource=this.formulaCollection.sort()},Yue.prototype.activeListFormula=function(){var e=document.getElementById(this.parent.element.id+"_formula_list").children[0].children[0].firstElementChild;this.formulaList.selectItem(e)},Yue.prototype.updateFormulaDescription=function(){var e={action:"getFormulaDescription",description:"",selectedList:i=this.formulaList.getSelectedItems().text,isCustom:!1},t=(this.parent.notify(Pie,e),this.dialog.dialogInstance.element.querySelector(".e-footer-content .e-primary"));t.hasAttribute("aria-label")&&t.removeAttribute("aria-label");var i="AND"===i?"CalculateAND":"OR"===i?"CalculateOR":i;document.getElementById(this.parent.element.id+"_description_content").textContent=e.isCustom?e.description:this.parent.serviceLocator.getService(ope).getConstant(i)},Yue.prototype.formulaClickHandler=function(e){var e=e.target,t=_re(this.parent,this.parent.activeSheetIndex);(e.offsetParent.classList.contains("e-text-content")||e.classList.contains("e-list-item"))&&(this.parent.isEdit?this.parent.notify(mse,{action:"refreshEditor",value:e.innerText+"(",refreshFormulaBar:!0,refreshEditorElem:!0,isAppend:!0}):(this.parent.notify(mse,{action:"startEdit",value:"="+e.innerText+"(",address:t.activeCell}),this.parent.notify(yse,{action:"refreshFormulabar",value:"="+e.innerText+"("})),this.dialog.hide())},Yue.prototype.addEventListener=function(){this.parent.on(lse,this.createFormulaBar,this),this.parent.on(vse,this.formulaBarClickHandler,this),this.parent.on(wse,this.keyDownHandler,this),this.parent.on(lhe,this.renderInsertDlg,this),this.parent.on(bse,this.keyUpHandler,this),this.parent.on(poe,this.formulaBarUpdateHandler,this),this.parent.on(Dse,this.updateValueAfterMouseUp,this),this.parent.on(yse,this.editOperationHandler,this),this.parent.on(nle,this.disabletextarea,this),this.parent.on(pse,this.isFormulaBarEdit,this)},Yue.prototype.destroy=function(){this.removeEventListener(),this.comboBoxInstance&&this.comboBoxInstance.destroy(),this.comboBoxInstance=null,this.categoryCollection=null,this.formulaCollection=null,this.dialog=null,this.isGoto=null,this.insertFnRipple&&this.insertFnRipple(),this.insertFnRipple=null;var e=this.parent.element.querySelector(".e-formula-bar-panel");e&&(upe(e),G(e)),this.parent=null},Yue.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(lse,this.createFormulaBar),this.parent.off(vse,this.formulaBarClickHandler),this.parent.off(lhe,this.renderInsertDlg),this.parent.off(wse,this.keyDownHandler),this.parent.off(bse,this.keyUpHandler),this.parent.off(poe,this.formulaBarUpdateHandler),this.parent.off(Dse,this.updateValueAfterMouseUp),this.parent.off(yse,this.editOperationHandler),this.parent.off(nle,this.disabletextarea),this.parent.off(pse,this.isFormulaBarEdit))},Yue.prototype.editOperationHandler=function(e){switch(e.action){case"refreshFormulabar":e.cell?this.getFormulaBar().value=this.getFormulaBarValue(e.cell):this.getFormulaBar().value=ee(e.value)?"":e.value;break;case"setNameBoxValue":this.updateNameBoxValue(e.definedName,e.isRemove);break;case"getElement":e.element=this.getFormulaBar()}},Yue.prototype.isFormulaBarEdit=function(e){this.parent.isEdit&&this.isGoto?e.isEdit=!0:e.isEdit=!1},Yue.prototype.getFormulaBar=function(){return ge("#"+this.parent.element.id+"_formula_input",this.parent.element)};var Gue=Yue;function Yue(e){this.categoryCollection=[],this.formulaCollection=[],this.isGoto=!1,this.parent=e,this.addEventListener()}Kue.prototype.getModuleName=function(){return"formula"},Kue.prototype.destroy=function(){this.removeEventListener(),this.autocompleteInstance&&(this.autocompleteInstance.destroy(),this.autocompleteInstance.element)&&(this.autocompleteInstance.element.remove(),this.autocompleteInstance.element=null),this.autocompleteInstance=null,this.acInputElement&&(this.acInputElement.remove(),this.acInputElement=null),this.parent=null},Kue.prototype.addEventListener=function(){this.parent.on(fse,this.performFormulaOperation,this),this.parent.on(bse,this.keyUpHandler,this),this.parent.on(wse,this.keyDownHandler,this),this.parent.on(vse,this.formulaClick,this),this.parent.on(jae,this.refreshFormulaDatasource,this)},Kue.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(fse,this.performFormulaOperation),this.parent.off(bse,this.keyUpHandler),this.parent.off(wse,this.keyDownHandler),this.parent.off(vse,this.formulaClick),this.parent.off(jae,this.refreshFormulaDatasource))},Kue.prototype.performFormulaOperation=function(e){var t=this,i=e.action,n=this.parent.serviceLocator.getService(ope);switch(i){case"renderAutoComplete":this.renderAutoComplete();break;case"endEdit":this.endEdit();break;case"addDefinedName":e.isAdded=this.addDefinedName(e.definedName);break;case"getNames":e.sheetName||(e.sheetName=Wre(this.parent)),e.names=this.getNames(e.sheetName);break;case"getNameFromRange":e.definedName=this.getNameFromRange(e.range);break;case"isFormulaEditing":e.isFormulaEdit=this.isFormula;break;case"isCircularReference":var o,r=this.parent.serviceLocator.getService(rpe),s=n.getConstant("CircularReference"),a=function(e){t.parent.trigger("dialogBeforeOpen",e),e.content!==s&&(r.dialogInstance.content=e.content,r.dialogInstance.dataBind())},l=r.dialogInstance;l&&l.visible&&l.element.classList.contains("e-circularref-dlg")?a({dialogName:"CircularReferenceDialog",element:l.element,target:this.parent.element,cancel:!1,cellAddress:e.address,content:s}):(o=e.address,r.show({height:180,width:400,isModal:!0,showCloseIcon:!0,cssClass:"e-circularref-dlg",content:s,beforeOpen:function(e){var t={dialogName:"CircularReferenceDialog",element:e.element,target:e.target,cancel:e.cancel,cellAddress:o,content:s};a(t),e.cancel=t.cancel}})),e.argValue="0"}},Kue.prototype.renderAutoComplete=function(){var e,t;ge("#"+this.parent.element.id+"_ac",this.parent.element)||(e=this.parent.createElement("input",{id:this.parent.element.id+"_ac",className:"e-ss-ac"}),this.parent.element.appendChild(e),this.parent.notify(Pie,t={action:"getLibraryFormulas",formulaCollection:[]}),t={dataSource:t.formulaCollection,cssClass:"e-ss-atc",popupWidth:"130px",allowFiltering:!0,filterType:"StartsWith",sortOrder:"Ascending",open:this.onSuggestionOpen.bind(this),close:this.onSuggestionClose.bind(this),select:this.onSelect.bind(this),actionComplete:this.onSuggestionComplete.bind(this)},this.autocompleteInstance=new lU(t,e),this.autocompleteInstance.createElement=this.parent.createElement,this.acInputElement=e)},Kue.prototype.onSuggestionOpen=function(e){var t=this;this.isPopupOpened=!0,e.popup.relateTo=this.getRelateToElem(),e.popup.element.firstChild.style.maxHeight="180px",new Promise(function(e){setTimeout(function(){e()},100)}).then(function(){t.triggerKeyDownEvent(dpe.DOWN)})},Kue.prototype.onSuggestionClose=function(e){this.isPreventClose?e.cancel=!0:this.isPopupOpened=!1},Kue.prototype.onSelect=function(e){var t,i,n="="+e.itemData.value+"(";this.isSubFormula&&((-1<(t=(i=this.getEditingValue()).lastIndexOf(this.parent.listSeparator))||-1<(t=i.lastIndexOf("(")))&&(n=i.slice(0,t+1)),n+=e.itemData.value+"("),this.parent.notify(mse,{action:"refreshEditor",value:n,refreshFormulaBar:!0,refreshEditorElem:!0,refreshCurPos:!this.isFormulaBar}),this.isPopupOpened&&(this.hidePopUp(),(i=ge("#"+this.parent.element.id+"_ac_popup"))&&G(i),this.isPopupOpened=!1)},Kue.prototype.onSuggestionComplete=function(e){this.isPreventClose=0<e.result.length,this.isPreventClose||(e.cancel=!0,this.hidePopUp())},Kue.prototype.refreshFormulaDatasource=function(){var e={action:"getLibraryFormulas",formulaCollection:[]};this.parent.notify(Pie,e),this.autocompleteInstance&&(this.autocompleteInstance.dataSource=e.formulaCollection)},Kue.prototype.keyUpHandler=function(e){var t;this.parent.isEdit?(t=this.getEditingValue(),this.isFormula=Poe(t),(this.isFormula||this.isPopupOpened)&&(e.keyCode!==dpe.TAB&&this.isFormula&&(t=this.getSuggestionKeyFromFormula(t)),this.refreshFormulaSuggestion(e,t))):this.isPopupOpened&&this.hidePopUp()},Kue.prototype.keyDownHandler=function(e){var t=e.keyCode;if(this.isFormula){if(this.isPopupOpened)switch(t){case dpe.UP:case dpe.DOWN:e.preventDefault(),this.triggerKeyDownEvent(t);break;case dpe.TAB:e.preventDefault(),this.triggerKeyDownEvent(dpe.ENTER)}}else{var i=e.target;if(i.id===this.parent.element.id+"_name_box")switch(t){case dpe.ENTER:document.querySelector(".e-name-box.e-popup-open")||(this.addDefinedName({name:i.value}),sce(this.parent.element));break;case dpe.ESC:sce(this.parent.element)}}},Kue.prototype.formulaClick=function(e){this.parent.isEdit&&(e=e.target,this.isFormulaBar=e.classList.contains("e-formula-bar"))},Kue.prototype.refreshFormulaSuggestion=function(e,t){var i,n;0<t.length?(i=this.autocompleteInstance.element,e=e.keyCode,n=this.isPopupOpened,Rpe(e)||(i.value=t,i.dispatchEvent(new Event("input")),i.dispatchEvent(new Event("keyup")),n&&this.triggerKeyDownEvent(dpe.DOWN))):this.isPopupOpened&&(this.isPreventClose=!1,this.hidePopUp())},Kue.prototype.endEdit=function(){var e;this.isSubFormula=!1,this.isPreventClose=!1,this.isFormula=!1,this.isFormulaBar=!1,this.isPopupOpened&&(this.hidePopUp(),(e=ge("#"+this.parent.element.id+"_ac_popup"))&&G(e),this.isPopupOpened=!1)},Kue.prototype.hidePopUp=function(){this.autocompleteInstance.hidePopup()},Kue.prototype.getSuggestionKeyFromFormula=function(e){var t,i="";return(e=e.substr(1))&&(t=e.lastIndexOf("("),1===(e=(e=e.substr(t+1)).split(this.parent.listSeparator)).length?(i=e[0],this.isSubFormula=-1<t):(i=e[e.length-1],this.isSubFormula=!0),(t=i.match(/\w/))&&0===t.index||(i="")),i},Kue.prototype.getRelateToElem=function(){var e={action:"getElement"};return this.isFormulaBar?this.parent.notify(yse,e):this.parent.notify(mse,e),e.element},Kue.prototype.getEditingValue=function(){var e={action:"getCurrentEditValue",editedValue:""};return this.parent.notify(mse,e),e.editedValue},Kue.prototype.triggerKeyDownEvent=function(e){var t=this.autocompleteInstance.element,i=(t.dispatchEvent(new Event("input")),new Event("keydown"));i.keyCode=e,i.which=e,i.altKey=!1,i.shiftKey=!1,i.ctrlKey=!1,t.dispatchEvent(i)},Kue.prototype.getNames=function(t){return this.parent.definedNames.filter(function(e){return"Workbook"===e.scope||""===e.scope||e.scope===t})},Kue.prototype.getNameFromRange=function(t){var i,n,o=t.slice(0,t.indexOf(":")),e=t.substring(t.lastIndexOf("!")+1).split(":"),r=1<e.length&&e[0]===e[1],e=this.parent.definedNames.filter(function(e){i=e.refersTo.substring(0,e.refersTo.lastIndexOf("!")),n=e.refersTo.substring(e.refersTo.lastIndexOf("!")+1);e=(i=i.includes("'")&&i.match(/^='.*'$/)?"="+i.slice(2,-1):i)+"!"+n.split("$").join("");return r&&e=="="+o||e=="="+t});return e&&e[0]},Kue.prototype.addDefinedName=function(e){var t,i,n,o,r,s=this,a=e.name,l=!1;return a&&Boe(a.toUpperCase())?this.parent.goTo(a):(e.refersTo||(r=_re(this.parent,this.parent.activeSheetIndex),t=-1!==(t=Wre(this.parent)).indexOf(" ")?"'"+t+"'":t,je(o=r.selectedRange)||(n=o.indexOf(":"),i=o.substr(0,n),n=o.substr(n+1,o.length),o=parseInt(n.replace(/\D/g,""),10)===r.rowCount&&1===parseInt(i.replace(/\D/g,""),10)?(n=n.replace(/[0-9]/g,""),"$"+(i=i.replace(/[0-9]/g,""))+":$"+n):ste(n)[1]===r.colCount-1&&0===ste(i)[1]?(n=n.replace(/\D/g,""),"$"+(i=i.replace(/\D/g,""))+":$"+n):i===n?i:o),e.refersTo=t+"!"+o,e.scope="Workbook"),0<a.length&&/^([a-zA-Z_0-9.]){0,255}$/.test(a)?(this.parent.notify(Pie,r={action:"addDefinedName",definedName:e,isAdded:!1}),(l=r.isAdded)||this.parent.serviceLocator.getService(rpe).show({content:this.parent.serviceLocator.getService(ope).getConstant("DefineNameExists"),width:"300",beforeOpen:function(e){var t={dialogName:"DefineNameExistsDialog",element:e.element,target:e.target,cancel:e.cancel};s.parent.trigger("dialogBeforeOpen",t),t.cancel&&(e.cancel=!0)}})):this.parent.serviceLocator.getService(rpe).show({content:this.parent.serviceLocator.getService(ope).getConstant("DefineNameInValid"),width:"300",beforeOpen:function(e){var t={dialogName:"DefineNameInValidDialog",element:e.element,target:e.target,cancel:e.cancel};s.parent.trigger("dialogBeforeOpen",t),t.cancel&&(e.cancel=!0)}})),l};var Xue=Kue;function Kue(e){this.isFormulaBar=!1,this.isFormula=!1,this.isPopupOpened=!1,this.isPreventClose=!1,this.isSubFormula=!1,this.parent=e,this.addEventListener()}Zue.prototype.getModuleName=function(){return"sheetTabs"},Zue.prototype.createSheetTabs=function(){var i=this;if(!this.parent.showSheetTabs&&this.tabInstance)this.destroy();else{for(var t,n=this.parent.serviceLocator.getService(ope),e=this.parent.createElement("div",{className:"e-sheet-tab-panel",id:this.parent.element.id+"_sheet_tab_panel"}),o=this.parent.createElement("button",{className:"e-add-sheet-tab e-btn e-css e-flat e-icon-btn"+(this.parent.allowInsert?"":" e-disabled"),attrs:{title:n.getConstant("AddSheet"),type:"button"}}),o=(o.appendChild(this.parent.createElement("span",{className:"e-btn-icon e-icons e-add-icon"})),o.addEventListener("click",this.addSheetTab.bind(this)),o.disabled=!this.parent.allowInsert,e.appendChild(o),this.addBtnRipple=Ht(e,{selector:".e-add-sheet-tab"}),this.parent.createElement("button",{attrs:{title:n.getConstant("ListAllSheets"),type:"button"}})),r=(e.appendChild(o),this.parent.element.appendChild(e),this.getSheetTabItems()),o=(this.dropDownInstance=new u2({iconCss:"e-icons",items:r.ddbItems,createPopupOnClick:!0,beforeItemRender:function(e){var t=i.parent.sheets[i.dropDownInstance.items.indexOf(e.item)];"Hidden"===t.state?e.element.classList.add("e-hide"):"VeryHidden"===t.state&&(e.element.style.display="none")},select:function(e){return i.updateSheetTab({idx:i.dropDownInstance.items.indexOf(e.item)})},beforeOpen:function(e){return i.beforeOpenHandler(i.dropDownInstance,e.element,n.getConstant("ListAllSheets"))},open:function(e){return i.openHandler(i.dropDownInstance,e.element,"left")},cssClass:"e-sheets-list e-flat e-caret-hide",close:function(){return i.focusTab(i.tabInstance.element)}}),this.dropDownInstance.createElement=this.parent.createElement,this.dropDownInstance.appendTo(o),this.parent.createElement("div",{className:"e-sheet-tab"})),s=(this.tabInstance=new k5({selectedItem:this.parent.activeSheetIndex,overflowMode:"Scrollable",items:r.tabItems,scrollStep:250,selecting:function(e){e.selectingIndex!==e.selectedIndex&&(t=!t&&(e={currentSheetIndex:e.selectingIndex,previousSheetIndex:e.selectedIndex,cancel:!1},i.parent.notify(fie,{eventArgs:e,action:"gotoSheet"}),e.cancel))},selected:function(e){e.isInteracted||(e.preventFocus=!0),i.goToSheet(e,t,!0)},created:function(){var e=i.tabInstance.element.querySelector(".e-toolbar-items");e.classList.add("e-sheet-tabs-items"),E.add(e,"dblclick",i.renameSheetTab,i)}}),e.appendChild(o),this.tabInstance.createElement=this.parent.createElement,this.tabInstance.appendTo(o),E.remove(this.tabInstance.element,"keydown",this.tabInstance.spaceKeyDown),r.tabItems.length),a=0;a<s;a++){var l={action:"addSheet",sheetName:"Sheet"+(l=_re(this.parent,a)).id,sheetId:l.id,visibleName:l.name};this.parent.notify(Pie,l)}this.parent.notify(Pie,{action:"initiateDefinedNames"}),this.parent.notify(Uae,null)}},Zue.prototype.goToSheet=function(e,t,i){var n,o=this;e.selectedIndex!==e.previousIndex&&(t?(this.tabInstance.selectedItem=e.previousIndex,this.tabInstance.dataBind(),sce(this.parent.element)):(this.parent.notify(Vle,{}),!this.parent.isEdit||(t=window.getSelection(),this.parent.notify(mse,n={action:"getCurrentEditValue",editedValue:""}),n=!(n=!!n.editedValue&&Poe(n.editedValue,!0))&&t&&t.focusNode&&t.focusNode.classList&&t.focusNode.classList.contains("e-formula-bar-panel")?Poe(this.parent.element.querySelector(".e-formula-bar").value,!0):n)||this.parent.endEdit(),this.parent.activeSheetIndex=e.selectedIndex,this.parent.dataBind(),this.updateDropDownItems(e.selectedIndex,e.previousIndex),t={action:"registerGridInCalc",sheetID:(e.selectedIndex+1).toString()},this.parent.notify(Pie,t),i&&(this.parent.notify(Vae,{eventArgs:{previousSheetIndex:e.previousIndex,currentSheetIndex:e.selectedIndex},action:"gotoSheet"}),cpe(function(){sce(o.parent.element)}))))},Zue.prototype.updateDropDownItems=function(e,t){-1<t&&(this.dropDownInstance.items[t].iconCss=""),this.dropDownInstance.items[e].iconCss="e-selected-icon e-icons",this.dropDownInstance.setProperties({items:this.dropDownInstance.items},!0)},Zue.prototype.beforeOpenHandler=function(e,t,i){var n=this.parent.viewport.height;n<parseInt(getComputedStyle(t.firstElementChild).height,10)*e.items.length+2*parseInt(getComputedStyle(t).paddingTop,10)&&(t.style.height=n+"px",t.style.overflowY="auto"),t.parentElement.style.visibility="hidden",i&&t.setAttribute("aria-label",i)},Zue.prototype.openHandler=function(e,t,i){var n,o=t.parentElement;-1===Y0(o).indexOf("bottom")&&(n=("auto"===t.style.overflowY?this.parent.viewport:o.getBoundingClientRect()).height,e=O0(e.element,i,"top"),"right"===i&&(e.left-=o.getBoundingClientRect().width),o.style.left=e.left+"px",o.style.top=e.top-n+"px"),o.style.visibility="",sce(t)},Zue.prototype.getSheetTabItems=function(){var i,n=this,o=[],r=[];return this.parent.sheets.forEach(function(e,t){i=Wre(n.parent,t).replace(/</g,"&lt;").replace(/>/g,"&gt;"),o.push({header:{text:i},visible:"Visible"===e.state}),r.push({text:i,iconCss:t===n.parent.activeSheetIndex?"e-selected-icon e-icons":""})}),{tabItems:o,ddbItems:r}},Zue.prototype.refreshSheetTab=function(){var e=this.getSheetTabItems();this.dropDownInstance.items=e.ddbItems,this.dropDownInstance.setProperties({items:this.dropDownInstance.items},!0),this.tabInstance.items=e.tabItems,this.tabInstance.selectedItem=this.parent.activeSheetIndex,this.tabInstance.dataBind()},Zue.prototype.addSheetTab=function(){this.parent.notify(dne,{model:this.parent,start:this.parent.activeSheetIndex+1,end:this.parent.activeSheetIndex+1,modelType:"Sheet",isAction:!0,activeSheetIndex:this.parent.activeSheetIndex+1})},Zue.prototype.insertSheetTab=function(e){this.parent.notify(Vle,{}),e.preventUpdate&&e.startIdx!==this.tabInstance.selectedItem||(this.dropDownInstance.items[this.tabInstance.selectedItem].iconCss="");for(var t=e.startIdx;t<=e.endIdx;t++){var i=this.parent.sheets[t].name.replace(/</g,"&lt;").replace(/>/g,"&gt;");this.dropDownInstance.items.splice(t,0,{text:i}),this.tabInstance.addTab([{header:{text:i},content:""}],t)}e.preventUpdate&&e.startIdx!==this.tabInstance.selectedItem||(this.dropDownInstance.items[e.startIdx].iconCss="e-selected-icon e-icons"),this.dropDownInstance.setProperties({items:this.dropDownInstance.items},!0),e.preventUpdate?e.startIdx!==this.tabInstance.selectedItem?this.refreshSheetTab():this.parent.notify(Uae,null):this.updateSheetTab({idx:e.startIdx,preventDataBind:!0})},Zue.prototype.updateSheetTab=function(e){if("activeSheetChanged"===e.name)e.idx=this.parent.skipHiddenSheets(e.idx);else if("Hidden"===this.parent.sheets[e.idx].state){if(this.parent.isProtected)return;this.showSheet({sheetIndex:e.idx,triggerEvent:!0})}this.tabInstance.selectedItem=e.idx,e.preventDataBind||this.tabInstance.dataBind(),this.parent.notify(Uae,null)},Zue.prototype.showSheet=function(e){this.parent.setSheetPropertyOnMute(this.parent.sheets[e.sheetIndex],"state","Visible"),this.tabInstance.hideTab(e.sheetIndex,!1),e.triggerEvent&&this.parent.notify(Vae,{action:"showSheet",eventArgs:{sheetIndex:e.sheetIndex}})},Zue.prototype.switchSheetTab=function(e){var t=z(e.event.target,".e-toolbar-item");if(t){for(var i=t.querySelector(".e-tab-text").textContent,t=[],n=this.parent.element.id+"_cmenu",o=0,r=this.parent.sheets.length;o<r;o++)if(this.parent.sheets[o].name===i){this.parent.activeSheetIndex!==o&&this.updateSheetTab({idx:o});break}e.element.classList.contains("e-contextmenu")&&e.items[0]&&e.items[0].id===this.parent.element.id+"_cmenu_insert_sheet"&&(1===this.skipHiddenSheets()&&t.push(n+"_hide_sheet",n+"_delete_sheet"),this.parent.allowInsert&&!this.parent.isProtected||t.push(n+"_insert_sheet"),!this.parent.allowDelete)&&-1<t.indexOf(n+"_delete_sheet")&&t.push(n+"_delete_sheet"),(0<this.parent.password.length||this.parent.isProtected)&&(-1<t.indexOf(n+"_insert_sheet")&&t.push(n+"_insert_sheet"),-1<t.indexOf(n+"_delete_sheet")&&t.push(n+"_delete_sheet"),t.push(n+"_duplicate",n+"_rename",n+"_hide_sheet",n+"_delete_sheet",n+"_insert_sheet",n+"_move_left",n+"_move_right")),this.parent.enableContextMenuItems(t,!1,!0)}},Zue.prototype.skipHiddenSheets=function(){var t=this.parent.sheets.length;return this.parent.sheets.forEach(function(e){"Visible"!==e.state&&--t}),t},Zue.prototype.renameSheetTab=function(){var e,t,i=this.tabInstance.element.querySelector(".e-toolbar-item.e-active");i&&(t={eventArgs:{name:e=(i=i.querySelector(".e-text-wrap")).querySelector(".e-tab-text").textContent,index:this.parent.getActiveSheet().id},action:"renameSheet",cancel:!1},this.parent.trigger("actionBegin",t),t.cancel||this.parent.isProtected||(t=this.parent.createElement("input",{id:this.parent.element.id+"_rename_input",className:"e-input e-sheet-rename",styles:"width: "+i.getBoundingClientRect().width+"px",attrs:{type:"text",name:"Rename",required:"",value:e,spellcheck:"false",maxlength:"31"}}),i.firstElementChild.style.display="none",i.appendChild(t),E.add(document,"mousedown touchstart",this.renameInputFocusOut,this),E.add(t,"keydown",this.renameKeyDown,this),E.add(t,"input",this.updateWidth,this),t.focus(),t.setSelectionRange(0,e.length),E.remove(z(i,".e-toolbar-items"),"dblclick",this.renameSheetTab)))},Zue.prototype.updateWidth=function(e){var e=e.target,t=e.value.length,i=e.value.split(" ");i.length&&(t=t-(i=i.length-1)+.5*i),e.style.width=t+"ch"},Zue.prototype.renameKeyDown=function(e){32===e.keyCode?e.stopPropagation():27===e.keyCode?(this.removeRenameInput(e.target),this.focusTab(this.tabInstance.element)):13===e.keyCode&&this.renameInputFocusOut(e)},Zue.prototype.renameInputFocusOut=function(e){var t=e.target;if("mousedown"!==e.type&&"touchstart"!==e.type||!t.classList.contains("e-sheet-rename")&&!z(t,".e-dlg-container")){var i=(t=document.getElementById(this.parent.element.id+"_rename_input")).value,n=this.parent.serviceLocator.getService(ope);if(i){var o=this.tabInstance.selectedItem;if(i.match(new RegExp(".*[\\[\\]\\*\\\\/\\?].*")))this.showRenameDialog(t,n.getConstant("SheetRenameInvalidAlert"));else{if(this.parent.sheets[o].name!==i)for(var r=0,s=this.parent.sheets.length;r<s;r++)if(r!==this.parent.activeSheetIndex&&this.parent.sheets[r].name.toLowerCase()===i.toLowerCase())return void this.showRenameDialog(t,n.getConstant("SheetRenameAlreadyExistsAlert"));var a=this.removeRenameInput(t);this.parent.sheets[o].name!==i&&(this.parent.setSheetPropertyOnMute(this.parent.sheets[o],"name",i),this.updateSheetName({value:i,idx:o,items:a})),"keydown"===e.type?this.focusTab(a):z(e.target,".e-spreadsheet")&&sce(this.parent.element)}}else this.showRenameDialog(t,n.getConstant("SheetRenameEmptyAlert"));this.parent.notify(Vae,{eventArgs:{index:this.parent.getActiveSheet().id,value:i},action:"renameSheet"})}},Zue.prototype.focusTab=function(e){sce(ge(".e-toolbar-item.e-active .e-tab-wrap",e))},Zue.prototype.updateSheetName=function(t){var i,n,o=this.tabInstance.items[t.idx].header.text.replace(/&lt;/g,"<").replace(/&gt;/g,">"),e=t.value.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=(this.tabInstance.items[t.idx].header.text=e,this.dropDownInstance.items[t.idx].text=e,this.dropDownInstance.setProperties({items:this.dropDownInstance.items},!0),t.items.querySelectorAll(".e-toolbar-item")[t.idx].querySelector(".e-tab-text"));e.textContent="",e.appendChild(document.createTextNode(t.value)),-1<t.value.indexOf("  ")?this.tabInstance.setProperties({items:this.tabInstance.items},!0):this.tabInstance.dataBind(),this.parent.notify(Eoe,{value:t.value,pName:o}),this.parent.allowChart&&(i=[],this.parent.chartColl.forEach(function(e){e.range.includes("!")&&(n=e.range.lastIndexOf("!"),i[0]=e.range.substring(0,n),i[1]=e.range.substring(n+1),i[0].toLowerCase()===o.toLowerCase())&&(i[0]=t.value,e.range=i.join("!"))}))},Zue.prototype.hideSheet=function(e){var t={action:"hideSheet",eventArgs:{sheetIndex:e.sheetIndex,cancel:!1}};e.triggerEvent&&(this.parent.notify(fie,t),t.eventArgs.cancel)||(this.parent.setSheetPropertyOnMute(_re(this.parent,e.sheetIndex),"state","Hidden"),this.tabInstance.hideTab(e.sheetIndex),e.triggerEvent&&(delete t.eventArgs.cancel,this.parent.notify(Vae,t)))},Zue.prototype.removeRenameInput=function(e){var t=e.parentElement.querySelector(".e-tab-text"),i=z(e,".e-toolbar-items");return E.add(i,"dblclick",this.renameSheetTab,this),E.remove(document,"mousedown touchstart",this.renameInputFocusOut),E.remove(e,"keydown",this.renameKeyDown),E.remove(e,"input",this.updateWidth),ue(e),t.style.display="",i},Zue.prototype.showRenameDialog=function(i,n){var o,r=this;this.parent.serviceLocator.getService(rpe).show({height:180,width:400,isModal:!0,showCloseIcon:!0,content:n,beforeOpen:function(e){var t={dialogName:"SheetRenameDialog",element:e.element,target:e.target,cancel:e.cancel};r.parent.trigger("dialogBeforeOpen",t),t.cancel?o=e.preventFocus=e.cancel=!0:(e.element.querySelector(".e-footer-content .e-primary").setAttribute("aria-label",n+" "+r.parent.serviceLocator.getService(ope).getConstant("Ok")),sce(i))},close:function(){o?cpe(function(){var e=[i.selectionStart,i.selectionEnd];sce(i),i.setSelectionRange(e[0],e[1])}):i.setSelectionRange(0,i.value.length)}})},Zue.prototype.focusRenameInput=function(){var e=document.getElementById(this.parent.element.id+"_rename_input");e&&e.focus()},Zue.prototype.removeSheetTab=function(e){var i,t,n,o,r,s=this;e.count&&e.count===this.parent.sheets.length||(i=this.parent.serviceLocator.getService(ope),1<this.skipHiddenSheets()?(t=e.sheetName?_re(this.parent,Bre(this.parent,e.sheetName)):this.parent.getActiveSheet(),n=je(e.index)?Bre(this.parent,t.name):e.index,o={index:n,sheetCount:this.parent.sheets.length,sheetName:t.name},!!(t.rows&&t.rows.length&&(1!==t.rows.length||t.rows[0].cells&&t.rows[0].cells.length))?(r=this.parent.serviceLocator.getService(rpe),e.clicked?this.forceDelete(n):r.show({height:200,width:400,isModal:!0,showCloseIcon:!0,cssClass:"e-delete-sheet-dlg",content:i.getConstant("DeleteSheetAlert"),beforeOpen:function(e){var t={dialogName:"DeleteSheetDialog",element:e.element,target:e.target,cancel:e.cancel};s.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(e.element.querySelector(".e-footer-content .e-primary").setAttribute("aria-label",i.getConstant("DeleteSheetAlert")+" "+i.getConstant("Ok")),sce(s.parent.element))},buttons:[{buttonModel:{content:i.getConstant("Ok"),isPrimary:!0},click:function(){r.hide(),s.forceDelete(n),s.parent.notify(kae,null),e&&!e.isAction&&(o.sheetCount=s.parent.sheets.length,s.parent.notify(Vae,{eventArgs:o,action:"removeSheet"}))}}]})):(this.parent.notify(coe,{startIndex:n,endIndex:n,modelType:"Sheet",isDelete:!0}),this.parent.notify(Pie,{action:"deleteSheetTab",sheetId:_re(this.parent,n).id}),this.destroySheet(n),this.parent.notify(kae,null),e&&!e.isAction&&(o.sheetCount=this.parent.sheets.length,this.parent.notify(Vae,{eventArgs:o,action:"removeSheet"})))):this.parent.serviceLocator.getService(rpe).show({height:180,width:400,isModal:!0,showCloseIcon:!0,content:i.getConstant("DeleteSingleLastSheetAlert"),beforeOpen:function(e){var t={dialogName:"DeleteSingleSheetDialog",element:e.element,target:e.target,cancel:e.cancel};s.parent.trigger("dialogBeforeOpen",t),t.cancel&&(e.cancel=!0)}}))},Zue.prototype.forceDelete=function(e){this.parent.notify(Vle,{}),this.parent.notify(coe,{startIndex:e,endIndex:e,modelType:"Sheet",isDelete:!0}),this.parent.notify(Pie,{action:"deleteSheetTab",sheetId:_re(this.parent,e).id}),this.destroySheet(e)},Zue.prototype.destroySheet=function(e){e=je(e)?this.parent.activeSheetIndex:e,this.parent.removeSheet(e),this.parent.notify(zie,{sheetIndex:e}),this.dropDownInstance.items.splice(e,1),this.dropDownInstance.setProperties({items:this.dropDownInstance.items},!0),this.tabInstance.removeTab(e),e=this.parent.skipHiddenSheets(this.tabInstance.selectedItem);this.parent.activeSheetIndex=e,this.parent.setProperties({activeSheetIndex:e},!0),this.parent.renderModule.refreshSheet(),this.tabInstance.selectedItem=e,this.tabInstance.dataBind(),this.updateDropDownItems(e),this.parent.notify(Uae,null)},Zue.prototype.showAggregate=function(e){var t,i,n,o=this;!(vte(rte(this.parent.getActiveSheet().selectedRange))||e&&e.remove)&&(t={Count:0,Sum:"0",Avg:"0",Min:"0",Max:"0",countOnly:!0},this.parent.notify(jie,t),1<t.Count)?(this.aggregateContent=t.countOnly?"Count":this.selaggregateCnt,t.countOnly&&(this.aggregateContent="Count",delete t.Sum,delete t.Avg,delete t.Min,delete t.Max),e=t.countOnly?"e-aggregate-list e-flat e-aggregate-list-countonly e-caret-hide":"e-aggregate-list e-flat",delete t.countOnly,i=(i=this.aggregateContent)+": "+t[i.toString()],this.aggregateDropDown?this.updateAggregateContent(i,t):(n=this.parent.createElement("button",{id:this.parent.element.id+"_aggregate",attrs:{type:"button"}}),document.getElementById(this.parent.element.id+"_sheet_tab_panel").appendChild(n),this.aggregateDropDown=new u2({content:i,items:this.getAggregateItems(t),createPopupOnClick:!0,select:function(e){o.parent.notify(jie,t),o.updateAggregateContent(e.item.text,{Count:t.Count,Sum:t.Sum,Avg:t.Avg,Min:t.Min,Max:t.Max},!0)},beforeOpen:function(e){return o.beforeOpenHandler(o.aggregateDropDown,e.element)},open:function(e){return o.openHandler(o.aggregateDropDown,e.element,"right")},close:function(){return sce(o.parent.element)},cssClass:e}),this.aggregateDropDown.createElement=this.parent.createElement,this.aggregateDropDown.appendTo(n))):this.removeAggregate()},Zue.prototype.getAggregateItems=function(t){var i,n,o=this,r=[];return Object.keys(t).forEach(function(e){(n=t[""+e])!==jie&&(n=e+": "+n,i=e===o.aggregateContent?"e-selected-icon e-icons":"",r.push({text:n,iconCss:i}))}),r},Zue.prototype.updateAggregateContent=function(e,t,i){this.aggregateContent=e.split(": ")[0],i&&(this.selaggregateCnt=e.split(": ")[0]),this.aggregateDropDown.content=e,this.aggregateDropDown.dataBind(),this.aggregateDropDown.setProperties({items:this.getAggregateItems(t)},!0)},Zue.prototype.removeAggregate=function(){je(this.aggregateDropDown)||(this.aggregateDropDown.destroy(),ue(this.aggregateDropDown.element),this.aggregateDropDown=null)},Zue.prototype.addEventListener=function(){this.parent.on(hse,this.createSheetTabs,this),this.parent.on(dse,this.refreshSheetTab,this),this.parent.on(kse,this.insertSheetTab,this),this.parent.on(Pse,this.removeSheetTab,this),this.parent.on(Bse,this.renameSheetTab,this),this.parent.on(Mse,this.switchSheetTab,this),this.parent.on(sae,this.updateSheetTab,this),this.parent.on(Nie,this.removeAggregate,this),this.parent.on(Ase,this.focusRenameInput,this),this.parent.on(xae,this.updateSheetName,this),this.parent.on(Iae,this.hideSheet,this),this.parent.on(hle,this.showAggregate,this),this.parent.on(dle,this.goToSheet,this),this.parent.on(ple,this.showSheet,this)},Zue.prototype.destroy=function(){this.removeEventListener(),this.dropDownInstance&&this.dropDownInstance.destroy(),this.dropDownInstance=null,this.tabInstance&&this.tabInstance.destroy(),this.tabInstance=null,this.removeAggregate(),this.aggregateContent=null,this.addBtnRipple&&this.addBtnRipple(),this.addBtnRipple=null,E.remove(document,"mousedown touchstart",this.renameInputFocusOut);var e=document.getElementById(this.parent.element.id+"_sheet_tab_panel");e&&ue(e),this.selaggregateCnt&&(this.selaggregateCnt=null),this.parent=null},Zue.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(hse,this.createSheetTabs),this.parent.off(dse,this.refreshSheetTab),this.parent.off(kse,this.insertSheetTab),this.parent.off(Pse,this.removeSheetTab),this.parent.off(Bse,this.renameSheetTab),this.parent.off(Mse,this.switchSheetTab),this.parent.off(sae,this.updateSheetTab),this.parent.off(Nie,this.removeAggregate),this.parent.off(Ase,this.focusRenameInput),this.parent.off(xae,this.updateSheetName),this.parent.off(Iae,this.hideSheet),this.parent.off(hle,this.showAggregate),this.parent.off(dle,this.goToSheet),this.parent.off(ple,this.showSheet))};var Jue=Zue;function Zue(e){this.aggregateContent="",this.selaggregateCnt="Sum",this.parent=e,this.addEventListener()}ege.prototype.addEventListener=function(){this.parent.on(Vie,this.openSuccess,this),this.parent.on(_ie,this.openFailed,this),this.parent.on(zie,this.sheetsDestroyHandler,this)},ege.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Vie,this.openSuccess),this.parent.off(_ie,this.openFailed),this.parent.off(zie,this.sheetsDestroyHandler))},ege.prototype.renderFileUpload=function(){var e=this.parent.element.appendChild(this.parent.createElement("input",{id:this.parent.element.id+"_fileUpload",attrs:{type:"file",accept:".xls, .xlsx, .csv, .xlsm, .xlsb",name:"fileUpload"}}));e.onchange=this.fileSelect.bind(this),e.onerror=this.openFailed.bind(this),e.style.display="none"},ege.prototype.fileSelect=function(e){e=e.target.files[0];e&&e.length<1||(this.parent.open({file:e}),ge("#"+this.parent.element.id+"_fileUpload",this.parent.element).value="")},ege.prototype.openSuccess=function(t){function e(e){i.parent.serviceLocator.getService(rpe).hide(!0),e=new File([],t.guid,{type:e.toLowerCase()}),i.parent.open({file:e,guid:t.guid,password:t.eventArgs.password,orginalFile:t.eventArgs.file})}var i=this,n=["UnsupportedFile","InvalidUrl","NeedPassword","InCorrectPassword","InCorrectSheetPassword","CorrectSheetPassword","DataLimitExceeded","FileSizeLimitExceeded","ExternalWorkbook"];if(-1<n.indexOf(t.data)){var o,r=this.parent.serviceLocator.getService(ope);if(n[2]===t.data)this.parent.element.querySelector(".e-importprotectworkbook-dlg")||this.parent.notify(qle,t.eventArgs);else if(n[3]===t.data)(o=this.parent.createElement("span",{className:"e-importprotectpwd-alert-span"})).innerText=r.getConstant("IncorrectPassword"),this.parent.element.querySelector(".e-importprotectworkbook-dlg").querySelector(".e-dlg-content").appendChild(o);else if(n[4]===t.data)(o=this.parent.createElement("span",{className:"e-unprotectsheetpwd-alert-span"})).innerText=r.getConstant("IncorrectPassword"),this.parent.element.querySelector(".e-unprotectworksheet-dlg").querySelector(".e-dlg-content").appendChild(o);else{if(n[5]!==t.data)return n[8]===t.data?(this.parent.serviceLocator.getService(rpe).hide(!0),o=t.data.includes("ExternalWorkbook"),this.parent.serviceLocator.getService(rpe).show({content:this.parent.serviceLocator.getService("spreadsheetLocale").getConstant("ExternalWorkbook"),width:"350",buttons:o?[{click:e.bind(this,t.data+"Yes"),buttonModel:{content:r.getConstant("Yes"),isPrimary:!0}},{click:e.bind(this,t.data+"No"),buttonModel:{content:r.getConstant("No")}}]:[],beforeOpen:function(e){var t={dialogName:"OpenDialog",element:e.element,target:e.target,cancel:e.cancel};i.parent.trigger("dialogBeforeOpen",t),t.cancel&&(e.cancel=!0)}},!!o||null)):(this.parent.serviceLocator.getService(rpe).hide(!0),o=t.data.includes("LimitExceeded"),this.parent.serviceLocator.getService(rpe).show({content:this.parent.serviceLocator.getService("spreadsheetLocale").getConstant(t.data),width:"300",buttons:o?[{click:e.bind(this,t.data+"Open"),buttonModel:{content:r.getConstant("Ok"),isPrimary:!0}},{click:e.bind(this,t.data+"Cancel"),buttonModel:{content:r.getConstant("Cancel")}}]:[],beforeOpen:function(e){var t={dialogName:"OpenDialog",element:e.element,target:e.target,cancel:e.cancel};i.parent.trigger("dialogBeforeOpen",t),t.cancel&&(e.cancel=!0)}},!!o||null)),void this.parent.hideSpinner();this.parent.isOpen=!1,this.parent.notify(ihe,null),this.parent.serviceLocator.getService(rpe).hide(),this.parent.hideSpinner()}}else this.parent.serviceLocator.getService(rpe).hide(),this.parent.showSpinner();this.parent.element&&n[5]!==t.data&&(this.parent.notify(Gie,{cellRef:null,isOpen:!0}),t.isOpenFromJson||(this.parent.trigger("openComplete",{response:t}),this.parent.notify(Vae,{response:t,action:"import"})),this.parent.isProtected&&this.parent.showSheetTabs&&t.isOpenFromJson&&(this.parent.element.querySelector(".e-add-sheet-tab").setAttribute("disabled","true"),this.parent.element.querySelector(".e-add-sheet-tab").classList.add("e-disabled")),this.parent.renderModule.refreshSheet(t.isOpenFromJson,!1,!1,!1,t),this.parent.notify(dse,null),this.isImportedFile=!0,t.context.preventFormatCheck=t.eventArgs&&t.eventArgs.file&&t.eventArgs.file.name&&!t.eventArgs.file.name.includes(".csv"),this.unProtectSheetIdx=[],this.parent.hideSpinner())},ege.prototype.openFailed=function(e){this.parent.trigger("openFailure",e),this.parent.hideSpinner()},ege.prototype.sheetsDestroyHandler=function(e){je(e.sheetIndex)&&(this.isImportedFile=!1,this.unProtectSheetIdx=[])},ege.prototype.destroy=function(){this.removeEventListener();var e=ge("#"+this.parent.element.id+"_fileUpload",this.parent.element);e&&G(e),this.isImportedFile=null,this.unProtectSheetIdx=null,this.parent=null},ege.prototype.getModuleName=function(){return"open"};var $ue=ege;function ege(e){this.isImportedFile=!1,this.unProtectSheetIdx=[],this.parent=e,this.addEventListener(),this.renderFileUpload()}ige.prototype.destroy=function(){this.removeEventListener(),this.parent=null},ige.prototype.addEventListener=function(){this.parent.on(mie,this.initiateSave,this),this.parent.on(Cie,this.saveCompleted,this),this.parent.on(Jne,this.showErrorDialog,this),this.parent.on(bie,this.exportDialog,this)},ige.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(mie,this.initiateSave),this.parent.off(Cie,this.saveCompleted),this.parent.off(Jne,this.showErrorDialog),this.parent.off(bie,this.exportDialog))},ige.prototype.getModuleName=function(){return"save"},ige.prototype.initiateSave=function(){this.parent.showSpinner()},ige.prototype.saveCompleted=function(){this.parent.hideSpinner()},ige.prototype.showErrorDialog=function(e){var t=this;this.parent.serviceLocator.getService(rpe).show({isModal:!0,showCloseIcon:!0,height:180,width:400,content:e.content,beforeOpen:function(){return sce(t.parent.element)}})},ige.prototype.exportDialog=function(i){var e,n=this,o=this.parent.serviceLocator.getService(ope),r=this.parent.serviceLocator.getService(rpe),s=i?i.item.id.split(this.parent.element.id+"_")[1]:"xlsx";je(this.parent.element.querySelector(".e-open-dlg"))?(e={isModal:!0,showCloseIcon:!0,cssClass:"e-open-dlg",header:o.getConstant("SaveAs"),beforeOpen:function(e){var t={dialogName:o.getConstant("SaveAs"),element:e.element,target:e.target,cancel:e.cancel};n.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(r.dialogInstance.content=n.OpenContent(s),r.dialogInstance.dataBind(),n.parent.element.querySelector(".e-text-open").setSelectionRange(0,n.parent.element.querySelector(".e-text-open").value.length),sce(n.parent.element))},buttons:[{buttonModel:{content:o.getConstant("Save"),isPrimary:!0,cssClass:"e-btn-open-ok"},click:function(){var e,t=n.parent.element.querySelector(".e-text-open").value;n.checkValidName(t)?(r.hide(),e=i?i.item.id.split(n.parent.element.id+"_")[1]:"Xlsx",n.parent.save({saveType:e,fileName:t})):(At(n.parent.element.querySelector(".e-btn-open-ok"),"btn").disabled=!0,e=n.parent.serviceLocator.getService(ope),t=0===t.length?e.getConstant("EmptyFileName"):218<t.length?e.getConstant("LargeName"):e.getConstant("FileNameError"),(e=n.parent.createElement("span",{className:"e-file-alert-span"})).innerText=t,n.parent.element.querySelector(".e-file-alert-span")&&n.parent.element.querySelector(".e-file-alert-span").remove(),n.parent.element.querySelector(".e-open-dlg").querySelector(".e-dlg-content").appendChild(e))}}]},r.show(e)):r.hide()},ige.prototype.checkValidName=function(e){var t=!0;return t=e.match(new RegExp('.*[\\[\\]\\*\\\\/\\?\\:\\<\\>\\|\\"].*'))||e.length<1||218<e.length?!1:t},ige.prototype.OpenContent=function(e){var t=this,i=this.parent.serviceLocator.getService(ope),n=this.parent.createElement("div",{className:"e-open-dialog"}),o=this.parent.createElement("div",{className:"e-open-head"}),r=this.parent.createElement("div",{className:"e-input-group"}),s=(n.appendChild(o),n.appendChild(r),i.getConstant("FileName")),a=this.parent.element.id+"_filename",i=this.parent.createElement("p",{className:"e-header",id:a,attrs:{"aria-label":i.getConstant("SaveAs")+" "+s}}),s=(i.innerText=s,this.parent.createElement("input",{className:"e-input e-text-open",attrs:{type:"Text","aria-labelledby":a}})),a=this.parent.createElement("span",{className:"e-input-group-icon"});return s.onkeyup=function(e){t.parent.element.querySelector(".e-file-alert-span")&&13!==e.keyCode&&(At(t.parent.element.querySelector(".e-btn-open-ok"),"btn").disabled=!1,t.parent.element.querySelector(".e-file-alert-span").remove())},o.appendChild(i),a.textContent="."+e.toLowerCase(),r.appendChild(s),s.setAttribute("value","Sample"),r.appendChild(a),n};var tge=ige;function ige(e){this.parent=e,this.addEventListener()}oge.prototype.init=function(){this.initContextMenu(),this.addEventListener()},oge.prototype.initContextMenu=function(){var e=document.createElement("ul");e.id=this.parent.element.id+"_contextmenu",this.parent.element.appendChild(e),this.contextMenuInstance=new D4({cssClass:"e-spreadsheet-contextmenu",target:"#"+this.parent.element.id,select:this.selectHandler.bind(this),beforeOpen:this.beforeOpenHandler.bind(this),beforeClose:this.beforeCloseHandler.bind(this),beforeItemRender:function(e){e.element.setAttribute("aria-label",e.item.text)}},e),e.setAttribute("role","menu")},oge.prototype.beforeCloseHandler=function(e){var t=this;this.parent.trigger("contextMenuBeforeClose",e),this.parent.enableKeyboardShortcut&&e.event&&27===e.event.keyCode&&cpe(function(){sce(t.parent.element)})},oge.prototype.selectHandler=function(e){var t,i=Pe({cancel:!1},e),n=(this.parent.trigger("contextMenuItemSelect",i),this.parent.element.id+"_cmenu"),o=rte(this.parent.getActiveSheet().selectedRange),r=[];if((e.item.id===n+"_ascending"||e.item.id===n+"_descending")&&this.parent.sortCollection)for(var s=this.parent.sortCollection.length-1;0<=s;s--)this.parent.sortCollection[s]&&this.parent.sortCollection[s].sheetIndex===this.parent.activeSheetIndex&&(r.push(this.parent.sortCollection[s]),this.parent.sortCollection.splice(s,1));if(e.item.id===n+"_delete_row"||e.item.id===n+"_delete_column"||e.item.id===n+"_insert_column_before"||e.item.id===n+"_insert_column_after"||e.item.id===n+"_insert_row_above"||e.item.id===n+"_insert_row_below"){var a=_de(this.parent.getActiveSheet(),o[0]),l=Kde(this.parent.getActiveSheet(),o[1]);if(a&&!a.isReadOnly&&l&&!l.isReadOnly&&are(this.parent,o))return void this.parent.notify(ele,null)}if(e.item.id===n+"_ascending"||e.item.id===n+"_descending"||e.item.id===n+"_customsort"){a=Xoe(o[0],o[1],this.parent.getActiveSheet());if(are(this.parent,a))return void this.parent.notify(ele,null)}if(!i.cancel){var h=void 0;switch(e.item.id){case n+"_cut":this.parent.notify(Vse,{invokeCopy:!0,promise:Promise});break;case n+"_copy":this.parent.notify(_se,{invokeCopy:!0,promise:Promise});break;case n+"_paste":this.parent.notify(Hse,{isAction:!0,isInternal:!0,focus:!0});break;case n+"_pastevalues":this.parent.notify(Hse,{type:"Values",isAction:!0,isInternal:!0,focus:!0});break;case n+"_pasteformats":this.parent.notify(Hse,{type:"Formats",isAction:!0,isInternal:!0,focus:!0});break;case n+"_rename":this.parent.notify(Bse,{});break;case n+"_delete_sheet":this.parent.notify(Pse,{}),sce(this.parent.element);break;case n+"_insert_sheet":this.parent.notify(dne,{model:this.parent,start:this.parent.activeSheetIndex,end:this.parent.activeSheetIndex,modelType:"Sheet",isAction:!0,activeSheetIndex:this.parent.activeSheetIndex});break;case n+"_hide_sheet":this.parent.notify(Iae,{sheetIndex:this.parent.activeSheetIndex,triggerEvent:!0});break;case n+"_duplicate":Ure(this.parent,void 0,!0),sce(this.parent.element);break;case n+"_move_right":Qre(this.parent,this.parent.activeSheetIndex+1,null,!0),sce(this.parent.element);break;case n+"_move_left":Qre(this.parent,this.parent.activeSheetIndex-1,null,!0),sce(this.parent.element);break;case n+"_ascending":this.parent.notify(Doe,{sortOptions:{sortDescriptors:{order:"Ascending"}}}),this.parent.notify(lae,{sortOptions:{sortDescriptors:{order:"Ascending"}},previousSort:r});break;case n+"_descending":this.parent.notify(Doe,{sortOptions:{sortDescriptors:{order:"Descending"}}}),this.parent.notify(lae,{sortOptions:{sortDescriptors:{order:"Descending"}},previousSort:r});break;case n+"_customsort":this.parent.notify(aae,null);break;case n+"_filtercellvalue":this.parent.notify(Rae,null);break;case n+"_clearfilter":t=dte(ste(this.parent.getActiveSheet().activeCell)[1]+1),this.parent.notify(Oae,{field:t});break;case n+"_reapplyfilter":this.parent.notify(Lae,null);break;case n+"_hide_row":h=rte(this.parent.getActiveSheet().selectedRange),this.parent.notify(Nne,{startIndex:h[0],endIndex:h[2],hide:!0,isCol:!1,actionUpdate:!0});break;case n+"_unhide_row":h=rte(this.parent.getActiveSheet().selectedRange),this.parent.notify(Nne,{startIndex:h[0],endIndex:h[2],hide:!1,isCol:!1,actionUpdate:!0});break;case n+"_hide_column":h=rte(this.parent.getActiveSheet().selectedRange),this.parent.notify(Nne,{startIndex:h[1],endIndex:h[3],hide:!0,isCol:!0,actionUpdate:!0});break;case n+"_unhide_column":h=rte(this.parent.getActiveSheet().selectedRange),this.parent.notify(Nne,{startIndex:h[1],endIndex:h[3],hide:!1,isCol:!0,actionUpdate:!0});break;case n+"_insert_row_above":case n+"_delete_row":h=rte(this.parent.getActiveSheet().selectedRange),this.parent.notify(e.item.id.substr(n.length+1,6)+"Model",{model:this.parent.getActiveSheet(),start:h[0],end:h[2],modelType:"Row",isAction:!0,insertType:"above"});break;case n+"_insert_row_below":h=fte(rte(this.parent.getActiveSheet().selectedRange)),this.parent.notify(dne,{model:this.parent.getActiveSheet(),start:h[2]+1,end:h[2]+1+(h[2]-h[0]),modelType:"Row",isAction:!0,insertType:"below"});break;case n+"_insert_column_before":case n+"_delete_column":h=rte(this.parent.getActiveSheet().selectedRange),this.parent.notify(e.item.id.substr(n.length+1,6)+"Model",{model:this.parent.getActiveSheet(),start:h[1],end:h[3],modelType:"Column",isAction:!0,insertType:"before"});break;case n+"_insert_column_after":h=fte(rte(this.parent.getActiveSheet().selectedRange)),this.parent.notify(dne,{model:this.parent.getActiveSheet(),start:h[3]+1,end:h[3]+1+(h[3]-h[1]),modelType:"Column",isAction:!0,insertType:"after"});break;case n+"_addNote":this.parent.notify(mae,null);break;case n+"_editNote":this.parent.notify(fae,null);break;case n+"_deleteNote":this.parent.notify(yae,{rowIndex:null,columnIndex:null,isDeleteFromMenu:!0});break;case n+"_hyperlink":this.parent.notify(cae,null);break;case n+"_editHyperlink":this.parent.notify(uae,null);break;case n+"_openHyperlink":this.parent.notify(gae,null);break;case n+"_removeHyperlink":this.parent.notify(Sae,{range:this.parent.getActiveSheet().selectedRange});break;case n+"_protect":this.parent.notify(hhe,{})}}},oge.prototype.getInsertModel=function(e,t){for(var i=[],n=e;n<=t;n++)i.push(n===e?{index:n}:{});return i},oge.prototype.beforeOpenHandler=function(e){for(var t,i,n=e.event.target,o=["e-numericcontainer","e-active-cell","e-selection","e-row","e-header-row","e-select-all-cell","e-sheet-tabs-items","e-spreadsheet-contextmenu"],r=0,s=o.length;r<s;r++)if(z(n,"."+o[r])){i=!0;break}if(i?l=this.getTarget(n):(i=["e-header-cell","e-rowhdr-table","e-selectall-table","e-main-panel"].some(function(e){return n.classList.contains(e)}))&&(1<parseInt(n.parentElement.style.zIndex,10)||1<parseInt(n.parentElement.parentElement.style.zIndex,10))?(h={clientY:(a=e.event).clientY,isImage:!1,target:n},a={clientX:a.clientX,isImage:!1,target:n},this.parent.notify(xle,h),this.parent.notify(Ile,a),l=h.size<=0?"ColumnHeader":a.size<=0?"RowHeader":"Content"):i=!1,i){if(e.element.classList.contains("e-contextmenu")){var a,l,h=this.parent.getActiveSheet();if(e.event.target&&(n.classList.contains("e-rowresize")||n.classList.contains("e-colresize"))){var d=rte(h.selectedRange);if(!(n.classList.contains("e-rowresize")?0===d[1]&&d[3]===h.colCount-1:0===d[0]&&d[2]===h.rowCount-1))return void(e.cancel=!0);t=(n.classList.contains("e-rowresize")?this.parent.hiddenCount(d[0],d[2])!==Math.abs(d[2]-d[0])+1:this.parent.hiddenCount(d[1],d[3],"columns")!==Math.abs(d[3]-d[1])+1)?this.getDataSource(l):this.getDataSource(l,n)}else"Content"===l&&(a=0===(d=rte(h.selectedRange))[1]&&d[3]===h.colCount-1,d=0===d[0]&&d[2]===h.rowCount-1,l=a&&d?"SelectAll":a?"RowHeader":d?"ColumnHeader":"Content"),t=this.getDataSource(l,"Footer"===l?n:void 0);this.contextMenuInstance.items=t,this.contextMenuInstance.dataBind()}else t=e.items;"None"===this.parent.selectionSettings.mode&&"Content"===l&&this.parent.enableContextMenuItems(["Filter"],!1,!1),"ColumnHeader"===l||"RowHeader"===l?e.element&&0<e.element.childElementCount&&(h="ColumnHeader"===l?e.element.querySelector("#"+this.parent.element.id+"_cmenu_insert_column"):e.element.querySelector("#"+this.parent.element.id+"_cmenu_insert_row"),a="ColumnHeader"===l?e.element.querySelector("#"+this.parent.element.id+"_cmenu_delete_column"):e.element.querySelector("#"+this.parent.element.id+"_cmenu_delete_row"),this.parent.allowInsert&&h.classList.contains("e-disabled")?h.classList.remove("e-disabled"):this.parent.allowInsert&&!this.parent.element.querySelector(".e-selectall.e-highlight")||h.classList.contains("e-disabled")||h.classList.add("e-disabled"),this.parent.allowDelete&&a.classList.contains("e-disabled")?a.classList.remove("e-disabled"):this.parent.allowDelete||a.classList.contains("e-disabled")||a.classList.add("e-disabled"),"None"===this.parent.selectionSettings.mode)&&("ColumnHeader"===l&&this.parent.enableContextMenuItems(["Insert Column","Delete Column","Hide Column"],!1,!1),"RowHeader"===l)&&this.parent.enableContextMenuItems(["Insert Row","Delete Row","Hide Row"],!1,!1):"Footer"===l&&(0===(d=Bre(this.parent,n.textContent))&&e.element.querySelector("#"+this.parent.element.id+"_cmenu_move_left").classList.add("e-disabled"),d===this.parent.sheets.length-1&&e.element.querySelector("#"+this.parent.element.id+"_cmenu_move_right").classList.add("e-disabled"),"None"===this.parent.selectionSettings.mode)&&this.parent.enableContextMenuItems(["Insert"],!1,!1),this.parent.trigger("contextMenuBeforeOpen",e),this.parent.notify(Mse,Pe(e,{target:l,items:t}))}else e.cancel=!0},oge.prototype.getTarget=function(e){return z(e,".e-sheet-content")?"Content":z(e,".e-column-header")?e.classList.contains("e-header-cell")?"ColumnHeader":"Content":z(e,".e-row-header")?e.classList.contains("e-header-cell")?"RowHeader":"Content":z(e,".e-sheet-tabs-items")?"Footer":z(e,".e-selectall-container")?e.classList.contains("e-header-cell")?z(e,".e-header-row")?"ColumnHeader":"RowHeader":z(e,".e-select-all-cell")?"SelectAll":"Content":""},oge.prototype.getDataSource=function(e,t){var i,n=this.parent.serviceLocator.getService(ope),o=[],r=this.parent.element.id+"_cmenu";return"Content"===e?(this.setClipboardData(o,n,r),o.push({separator:!0}),this.setFilterItems(o,r),this.setSortItems(o,r),o.push({separator:!0}),this.parent.enableNotes&&(this.setNotesMenu(o,r),o.push({separator:!0})),this.setHyperLink(o,r)):"RowHeader"===e?(this.setClipboardData(o,n,r),i=rte(this.parent.getActiveSheet().selectedRange),this.setInsertDeleteItems(o,n,"Row",r,[i[0],i[2]],["Above","Below"]),t&&!t.classList.contains("e-rowresize")&&t.parentElement&&t.parentElement.classList.value.includes("e-hide")||this.setHideShowItems(o,n,"Row",r,[i[0],i[2]])):"ColumnHeader"===e?(this.setClipboardData(o,n,r),i=rte(this.parent.getActiveSheet().selectedRange),this.setInsertDeleteItems(o,n,"Column",r,[i[1],i[3]],["Before","After"]),t&&t.classList.value.includes("e-hide")||this.setHideShowItems(o,n,"Column",r,[i[1],i[3]])):"SelectAll"===e?(this.setClipboardData(o,n,r),this.setFilterItems(o,r),this.setSortItems(o,r)):"Footer"===e&&(o.push({text:n.getConstant("Insert"),id:r+"_insert_sheet"}),o.push({text:n.getConstant("Delete"),iconCss:"e-icons e-delete",id:r+"_delete_sheet"}),o.push({text:n.getConstant("DuplicateSheet"),id:r+"_duplicate"}),o.push({text:n.getConstant("Rename"),id:r+"_rename"}),o.push({text:n.getConstant("Hide"),id:r+"_hide_sheet"}),this.setProtectSheetItems(o,r,t),o.push({text:n.getConstant("MoveRight"),id:r+"_move_right"}),o.push({text:n.getConstant("MoveLeft"),id:r+"_move_left"})),o},oge.prototype.setProtectSheetItems=function(e,t,i){var n=this.parent.serviceLocator.getService(ope);_re(this.parent,Bre(this.parent,i.textContent)).isProtected?e.push({text:n.getConstant("UnprotectSheet"),id:t+"_protect",iconCss:"e-icons e-protect-icon"}):e.push({text:n.getConstant("ProtectSheet"),id:t+"_protect",iconCss:"e-icons e-protect-icon"})},oge.prototype.setFilterItems=function(e,t){var i,n;this.parent.allowFiltering&&(i=this.parent.serviceLocator.getService(ope),this.parent.notify(Nae,n={clearFilterText:null,isFiltered:!1}),e.push({text:i.getConstant("Filter"),id:t+"_filter",iconCss:"",items:[{text:n.clearFilterText,iconCss:"e-icons e-filter-clear",id:t+"_clearfilter"},{text:i.getConstant("ReapplyFilter"),iconCss:"e-icons e-filter-reapply",id:t+"_reapplyfilter"},{separator:!0},{text:i.getConstant("FilterCellValue"),iconCss:"",id:t+"_filtercellvalue"}]}))},oge.prototype.setSortItems=function(e,t){var i=this.parent.serviceLocator.getService(ope);this.parent.allowSorting&&e.push({text:i.getConstant("Sort"),id:t+"_sort",iconCss:"e-icons e-sort-icon",items:[{text:i.getConstant("SortAscending"),iconCss:"e-icons e-sort-asc",id:t+"_ascending"},{text:i.getConstant("SortDescending"),iconCss:"e-icons e-sort-desc",id:t+"_descending"},{text:i.getConstant("CustomSort")+"...",iconCss:"e-icons e-sort-custom",id:t+"_customsort"}]})},oge.prototype.setHyperLink=function(e,t){var i,n;this.parent.allowHyperlink&&(i=this.parent.serviceLocator.getService(ope),n=ste(this.parent.getActiveSheet().activeCell),!je(n=this.parent.getCell(n[0],n[1]))&&(n.getElementsByClassName("e-hyperlink")[0]||n.classList.contains("e-hyperlink"))?e.push({text:i.getConstant("EditHyperlink"),iconCss:"e-icons e-edithyperlink-icon",id:t+"_editHyperlink"},{text:i.getConstant("OpenHyperlink"),iconCss:"e-icons e-openhyperlink-icon",id:t+"_openHyperlink"},{text:i.getConstant("RemoveHyperlink"),iconCss:"e-icons e-removehyperlink-icon",id:t+"_removeHyperlink"}):e.push({text:i.getConstant("Hyperlink"),iconCss:"e-icons e-hyperlink-icon",id:t+"_hyperlink"}))},oge.prototype.setNotesMenu=function(e,t){var i,n;this.parent.enableNotes&&(i=this.parent.serviceLocator.getService(ope),n=ste(this.parent.getActiveSheet().activeCell),!je(n=this.parent.getCell(n[0],n[1]))&&0<n.children.length&&-1<n.children[n.children.length-1].className.indexOf("addNoteIndicator")?e.push({text:i.getConstant("EditNote"),iconCss:"e-icons e-edit-notes",id:t+"_editNote"},{text:i.getConstant("DeleteNote"),iconCss:"e-icons e-delete-notes",id:t+"_deleteNote"}):e.push({text:i.getConstant("AddNote"),iconCss:"e-icons e-add-notes",id:t+"_addNote"}))},oge.prototype.setClipboardData=function(e,t,i){this.parent.enableClipboard&&(e.push({text:t.getConstant("Cut"),iconCss:"e-icons e-cut-icon",id:i+"_cut"}),e.push({text:t.getConstant("Copy"),iconCss:"e-icons e-copy-icon",id:i+"_copy"}),e.push({text:t.getConstant("Paste"),iconCss:"e-icons e-paste-icon",id:i+"_paste"}),e.push({text:t.getConstant("PasteSpecial"),id:i+"_pastespecial",items:[{text:t.getConstant("Values"),id:i+"_pastevalues"},{text:t.getConstant("Formats"),id:i+"_pasteformats"}]}))},oge.prototype.setInsertDeleteItems=function(t,i,n,o,r,s){t.push({separator:!0}),["Insert","Delete"].forEach(function(e){r[0]===r[1]?t.push({text:i.getConstant(""+e+n),id:o+("_"+e.toLowerCase()+"_"+n.toLowerCase())}):t.push({text:i.getConstant(""+e+n+"s"),id:o+("_"+e.toLowerCase()+"_"+n.toLowerCase())}),"Insert"===e&&(t[t.length-1].items=[],s.forEach(function(e){t[t.length-1].items.push({text:i.getConstant(e),id:t[t.length-1].id+"_"+e.toLowerCase()})}))})},oge.prototype.setHideShowItems=function(e,t,i,n,o){var r;o[0]===o[1]?e.push({text:t.getConstant("Hide"+i),id:n+("_hide_"+i.toLowerCase())}):(r=o[0],o[0]=o[0]>o[1]?o[1]:o[0],o[1]=o[1]>r?o[1]:r,e.push({text:t.getConstant("Hide"+i+"s"),id:n+("_hide_"+i.toLowerCase())})),this.parent.hiddenCount(o[0],o[1],i.toLowerCase()+"s")&&e.push({text:t.getConstant("Unhide"+i+"s"),id:n+("_unhide_"+i.toLowerCase())})},oge.prototype.addEventListener=function(){this.parent.on(Qse,this.addItemsHandler,this),this.parent.on(Use,this.removeItemsHandler,this),this.parent.on(qse,this.enableItemsHandler,this)},oge.prototype.addItemsHandler=function(e){e.insertAfter?this.contextMenuInstance.insertAfter(e.items,e.text,e.isUniqueId):this.contextMenuInstance.insertBefore(e.items,e.text,e.isUniqueId)},oge.prototype.removeItemsHandler=function(e){this.contextMenuInstance.removeItems(e.items,e.isUniqueId)},oge.prototype.enableItemsHandler=function(e){this.contextMenuInstance.enableItems(e.items,e.enable,e.isUniqueId)},oge.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Qse,this.addItemsHandler),this.parent.off(Use,this.removeItemsHandler),this.parent.off(qse,this.enableItemsHandler))},oge.prototype.getModuleName=function(){return"contextMenu"},oge.prototype.destroy=function(){this.removeEventListener(),this.contextMenuInstance.destroy();var e=document.getElementById(this.parent.element.id+"_contextmenu");e&&G(e),this.contextMenuInstance=null,this.parent=null};var nge=oge;function oge(e){this.parent=e,this.init()}sge.prototype.refreshCellElement=function(e){this.parent.refreshNode(e.td,e)},sge.prototype.getTextSpace=function(e){e.width=Zpe(e.char,e.cell.style,this.parent.cellStyle)},sge.prototype.rowFillHandler=function(e){var t=e.cellEle;if(t){var i=void 0,n=e.colIdx,o=(1<e.cell.colSpan&&(o={range:[e.rowIdx,e.colIdx,e.rowIdx,e.colIdx]},this.parent.notify(Rne,o),n=o.range[3]),ice(this.parent.getActiveSheet(),e.rowIdx,e.colIdx,n)),n=e.iconSetSpan||t.querySelector(".e-iconsetspan");if(n&&(o-=n.getBoundingClientRect().width),e.updateFillSize){if(!(i=t.querySelector(".e-fill"))||!i.textContent)return;e.repeatChar=i.textContent[0],(s=t.querySelector(".e-fill-before"))&&(o-=Zpe(s.textContent,e.cell.style,this.parent.cellStyle)),(a=t.querySelector(".e-fill-sec"))&&(o-=Zpe(a.textContent,e.cell.style,this.parent.cellStyle))}else{var r=t.querySelector(".e-addNoteIndicator");t.innerText="",e.beforeFillText&&((s=this.parent.createElement("span",{className:"e-fill-before",styles:"float: "+(this.parent.enableRtl?"right":"left")})).innerText=e.beforeFillText,t.appendChild(s),o-=Zpe(e.beforeFillText,e.cell.style,this.parent.cellStyle)),i=this.parent.createElement("span",{className:"e-fill"}),t.appendChild(i),e.afterFillText&&((a=this.parent.createElement("span",{className:"e-fill-sec"})).innerText=e.afterFillText,t.appendChild(a),o-=Zpe(e.afterFillText,e.cell.style,this.parent.cellStyle)),n&&t.insertBefore(n,t.childNodes[0]),r&&t.appendChild(r)}var s=Zpe(e.repeatChar,e.cell.style,this.parent.cellStyle),a=parseInt((o/s).toString(),10);e.formattedText=0<a?e.repeatChar.repeat(a):"",i.textContent=e.formattedText}},sge.prototype.addEventListener=function(){this.parent.on(Iie,this.refreshCellElement,this),this.parent.on(aoe,this.rowFillHandler,this),this.parent.on(loe,this.getTextSpace,this)},sge.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Iie,this.refreshCellElement),this.parent.off(aoe,this.rowFillHandler),this.parent.off(loe,this.getTextSpace))},sge.prototype.destroy=function(){this.removeEventListener(),this.parent=null},sge.prototype.getModuleName=function(){return"numberFormat"};var rge=sge;function sge(e){this.parent=e,this.addEventListener()}lge.prototype.destroy=function(){this.removeEventListener(),this.parent=null},lge.prototype.addEventListener=function(){this.parent.on(lae,this.applySortHandler,this),this.parent.on(Zie,this.sortCompleteHandler,this),this.parent.on(aae,this.initiateCustomSortHandler,this),this.parent.on(yie,this.sortImport,this)},lge.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(lae,this.applySortHandler),this.parent.off(Zie,this.sortCompleteHandler),this.parent.off(aae,this.initiateCustomSortHandler),this.parent.off(yie,this.sortImport))},lge.prototype.getModuleName=function(){return"sort"},lge.prototype.isValidSortRange=function(){var e=this.parent.getActiveSheet(),t=fte(pte(e.selectedRange));return!(t[0]>e.usedRange.rowIndex||t[1]>e.usedRange.colIndex)},lge.prototype.sortImport=function(e){for(var t,i=this.parent.sortCollection,n=this.parent.getActiveSheet().usedRange.rowIndex-1,o=e?e.sheetIdx:this.parent.activeSheetIndex,r=0;r<i.length;r++)if(i[r].sheetIndex===o)for(var s=0;s<n;s++)if((t=this.parent.getCell(s,i[r].columnIndex))&&t.querySelector(".e-filter-icon"))return void("Ascending"===i[r].order||"OnTop"===i[r].order?t.querySelector(".e-filter-icon").classList.contains("e-sortasc-filter")||t.querySelector(".e-filter-icon").classList.add("e-sortasc-filter"):t.querySelector(".e-filter-icon").classList.contains("e-sortdesc-filter")||t.querySelector(".e-filter-icon").classList.add("e-sortdesc-filter"))},lge.prototype.sortRangeAlertHandler=function(i){var n=this,o=this.parent.serviceLocator.getService(rpe),r=this.parent.serviceLocator.getService(ope);o.show({height:180,width:400,isModal:!0,showCloseIcon:!0,content:i.error,beforeOpen:function(e){var t={dialogName:i.error===r.getConstant("MultiRangeSortError")?"MultiRangeSortDialog":"SortRangeDialog",content:i.error,element:e.element,target:e.target,cancel:e.cancel};n.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(o.dialogInstance.content=t.content,sce(n.parent.element))}}),this.parent.hideSpinner()},lge.prototype.initiateCustomSortHandler=function(){var n,o,r=this,e=this.parent.serviceLocator.getService(ope),t=this.parent.getActiveSheet();this.isValidSortRange()&&0!==t.rows.length?lce(t.selectedRange)?this.sortRangeAlertHandler({error:e.getConstant("MultiRangeSortError")}):(n=this.parent.serviceLocator.getService(rpe)).show({height:400,width:560,isModal:!0,showCloseIcon:!0,cssClass:"e-customsort-dlg",header:e.getConstant("CustomSort"),beforeOpen:function(e){var t={dialogName:"CustomSortDialog",element:e.element,target:e.target,cancel:e.cancel};r.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:(n.dialogInstance.content=r.customSortContent(),n.dialogInstance.dataBind(),sce(r.parent.element))},buttons:[{buttonModel:{content:e.getConstant("Ok"),isPrimary:!0},click:function(){var e=n.dialogInstance.content,t=At(e.getElementsByClassName("e-list-sort e-listview e-lib")[0],"listview").dataSource,i=(r.clearError(),e.getElementsByClassName("e-sort-error")[0]);i.style.display="block",r.validateError(t,e,i)||(o={sortDescriptors:t,containsHeader:e.getElementsByClassName("e-sort-checkheader")[0].checked,caseSensitive:e.getElementsByClassName("e-sort-checkcase")[0].checked},n.hide())}}],close:function(){o&&cpe(function(){r.applySortHandler({sortOptions:o})})}}):this.sortRangeAlertHandler({error:e.getConstant("SortOutOfRangeError")})},lge.prototype.validateError=function(e,t,i){var n,o,r,s,a=this.parent.serviceLocator.getService(ope);return e.some(function(e){return""===e.field.toString()})?(Array.prototype.some.call(t.getElementsByClassName("e-sort-field"),function(e){var t=!At(e,"dropdownlist").value;return t&&e.parentElement.classList.add("e-error"),t}),i.innerText=a.getConstant("SortEmptyFieldError"),!0):(n=new Set,o="",e=e.some(function(e){return o=e.field.toString(),n.size===n.add(e.field).size}),r="",!!e&&(s=0,Array.prototype.some.call(t.getElementsByClassName("e-sort-field"),function(e){var t=At(e,"dropdownlist");return t.value===o&&(e.parentElement.classList.add("e-error"),r=t.text,s++),2===s}),i.innerText="",(e=this.parent.createElement("strong")).innerText=r,i.appendChild(e),i.appendChild(document.createTextNode(a.getConstant("SortDuplicateFieldError"))),!0))},lge.prototype.customSortContent=function(){var e=this.parent.createElement("div",{className:"e-sort-dialog"}),t=this.getFields(),i=D("customSort"),n=this.getCustomListview(i),o=(this.setHeaderTab(e,n,t),this.parent.createElement("div",{className:"e-sort-listsection",styles:""})),r=(e.appendChild(o),this.parent.createElement("div",{className:"e-list-sort",styles:""})),o=(o.appendChild(r),n.createElement=this.parent.createElement,n.appendTo(r),r.removeAttribute("tabindex"),this.renderListItem(i,n,!0,t),this.parent.createElement("div",{className:"e-sort-error"}));return e.appendChild(o),e},lge.prototype.getFields=function(){var e,t=this.parent.getActiveSheet(),i=fte(pte(t.selectedRange)),n=(i[0]===i[2]&&i[2]-i[0]==0&&(i[0]=0,i[1]=0,i[3]=t.usedRange.colIndex,this.parent.notify(Hae,e={filterRange:[],hasFilter:!1}),e.hasFilter)&&e.filterRange&&(i[0]=e.filterRange[0]),[]);for(i[1];i[1]<=i[3];i[1]++){var o,r=Kre(i[0],i[1],t),s="Column "+dte(i[1]+1);r&&r.value?(o=r.value,r.format&&(r={formattedText:o,value:o,format:r.format,rowIndex:i[0],colIndex:i[1]},this.parent.notify(Aie,r),o=r.formattedText)):o=s,n.push({text:o,value:s})}return n},lge.prototype.setHeaderTab=function(i,t,n){var o=this,r=this.parent.serviceLocator.getService(ope),e=this.parent.createElement("div",{className:"e-sort-header"}),s=(i.appendChild(e),this.parent.createElement("button",{className:"e-btn e-sort-addbtn e-flat",attrs:{type:"button"}})),a=(s.innerText=r.getConstant("AddColumn"),this.parent.element.querySelector(".e-customsort-dlg .e-footer-content")),l=(a.insertBefore(s,a.firstElementChild),s.addEventListener("click",function(){var e;t&&(e=D("customSort"),t.addItem([{id:e,text:r.getConstant("ThenBy"),field:"",order:"ascending"}]),o.renderListItem(e,t,l.checked,n,!0))}),new ib({label:r.getConstant("ContainsHeader"),checked:!0,change:function(e){var t=e.checked?{text:"text",value:"value"}:{text:"value"};Array.prototype.forEach.call(i.getElementsByClassName("e-sort-field e-dropdownlist e-lib"),function(e){e=At(e,"dropdownlist");e.dataSource=null,e.dataSource=n,e.fields=t,e.dataBind()})},cssClass:"e-sort-headercheckbox"})),a=this.parent.createElement("input",{className:"e-sort-checkheader",attrs:{type:"checkbox"}}),s=(e.appendChild(a),l.createElement=this.parent.createElement,l.appendTo(a),new ib({label:r.getConstant("CaseSensitive"),checked:!1,cssClass:"e-sort-casecheckbox"})),a=this.parent.createElement("input",{className:"e-sort-checkcase",attrs:{type:"checkbox"}});e.appendChild(a),s.createElement=this.parent.createElement,s.appendTo(a)},lge.prototype.getCustomListview=function(e){e=[{id:e,text:this.parent.serviceLocator.getService(ope).getConstant("SortBy"),field:"",order:"ascending"}];return Gt=!1,new MH({dataSource:e,fields:{id:"id"},height:"100%",template:ao(function(e){return'<div class="e-sort-listwrapper"><span class="text">'+e.text+'</span><div class="e-sort-row"><div class="e-sort-field"></div><div class="e-sort-order"><span class="e-sort-ordertxt" style="display:none;">'+e.order+'</span></div><span class="e-icons e-sort-delete" tabindex="0"></span></div>'}),cssClass:"e-sort-template"})},lge.prototype.deleteHandler=function(e,t){e.getElementsByClassName("e-sort-delete")[0].addEventListener("click",function(){e&&t.removeItem(e)})},lge.prototype.renderListItem=function(i,n,e,t,o){var r=this,s=this.parent.serviceLocator.getService(ope),a=n.element.querySelector("li[data-uid="+i+"]"),e=e?{text:"text",value:"value"}:{text:"value"},l=a.getElementsByClassName("e-sort-field")[0],t=new qz({dataSource:t,width:"auto",cssClass:"e-sort-field-ddl",fields:e,placeholder:s.getConstant("SelectAColumn"),change:function(t){t.value&&(Array.prototype.some.call(n.dataSource,function(e){return e.id===i&&(e.field=t.value.toString().replace("Column ","")),e.id===i}),r.clearError())}}),e=(t.createElement=this.parent.createElement,t.appendTo(l),o||(t.index=0),a.getElementsByClassName("e-sort-order")[0]),l="ascending"===e.getElementsByClassName("e-sort-ordertxt")[0].innerText.toLocaleLowerCase(),o=new cb({label:s.getConstant("SortAscending"),name:"sortAZ_"+i,value:"ascending",checked:l,cssClass:"e-sort-radiobutton",change:function(e){r.setRadioBtnValue(n,i,e.value)}}),t=this.parent.createElement("input",{id:"orderAsc_"+i,className:"e-sort-radioasc",styles:"",attrs:{type:"radio"}}),o=(e.appendChild(t),o.createElement=this.parent.createElement,o.appendTo(t),new cb({label:s.getConstant("SortDescending"),name:"sortAZ_"+i,value:"descending",checked:!l,cssClass:"e-sort-radiobutton",change:function(e){r.setRadioBtnValue(n,i,e.value)}})),t=this.parent.createElement("input",{id:"orderDesc_"+i,className:"e-sort-radiodesc",styles:"",attrs:{type:"radio"}});e.appendChild(t),o.createElement=this.parent.createElement,o.appendTo(t),this.deleteHandler(a,n)},lge.prototype.setRadioBtnValue=function(e,t,i){i&&Array.prototype.some.call(e.dataSource,function(e){return e.id===t&&(e.order=i),e.id===t})},lge.prototype.clearError=function(){var e=document.getElementsByClassName("e-sort-dialog")[0],t=e.getElementsByClassName("e-sort-error")[0];"none"!==t.style.display&&""!==t.innerHTML&&(t.style.display="none",Array.prototype.forEach.call(e.getElementsByClassName("e-error"),function(e){e.classList.remove("e-error")}))},lge.prototype.applySortHandler=function(e){var t=this,i=this.parent.getActiveSheet(),n=fte(pte(e&&e.range||i.selectedRange)),o=e&&e.sortOptions||{sortDescriptors:{}},r=n[0]===n[2],s={filterRange:[],hasFilter:!1,sheetIdx:this.parent.activeSheetIndex},s=(this.parent.notify(Hae,s),s.hasFilter&&(r?Ooe(s.filterRange,n[0],n[1]):s.filterRange[0]===n[0]&&(this.parent.element.querySelector(".e-selectall.e-highlight")||n[1]>=s.filterRange[1]&&n[1]<=s.filterRange[3]||n[3]>=s.filterRange[1]&&n[3]<=s.filterRange[3]))&&(n[0]=s.filterRange[0],n[1]=s.filterRange[1],n[2]=i.usedRange.rowIndex,n[3]=i.usedRange.colIndex,o.containsHeader=!s.allowHeaderFilter,r=!1),{range:i=hte(n),sortOptions:o,cancel:!1});this.parent.trigger(Xie,s),s.cancel||(this.parent.notify(fie,{eventArgs:s,action:"beforeSort"}),this.parent.showSpinner(),n=new Promise(function(e){e(void 0)}),o={args:{range:s.range,sortOptions:s.sortOptions,checkForHeader:r&&i!==s.range},promise:n,previousSort:e&&e.previousSort},this.parent.notify(Kie,o),o.promise.then(function(e){return t.sortCompleteHandler(e),t.parent.trigger(Zie,e),t.parent.notify(Vae,{eventArgs:e,action:"sorting"}),"BODY"===document.activeElement.tagName&&sce(t.parent.element),Promise.resolve(e)}).catch(function(e){return t.sortRangeAlertHandler({error:e}),Promise.reject(e)}))},lge.prototype.sortCompleteHandler=function(e){for(var t,i,n,o=this.parent.activeSheetIndex,r=(n=e.range.includes("!")?(t=e.range.lastIndexOf("!"),o=Bre(this.parent,e.range.substring(0,t)),i=_re(this.parent,o),rte(e.range.substring(t+1))):(i=this.parent.getActiveSheet(),rte(e.range)))[0];r<=n[2];r++)for(var s=n[1];s<=n[3];s++)this.parent.notify(Pie,{action:"refreshCalculate",rowIndex:r,colIndex:s});this.parent.serviceLocator.getService("cell").refreshRange(n,!0,!0,!1,!1,nre(this.parent),void 0,void 0,void 0,!0),o===this.parent.activeSheetIndex&&i.conditionalFormats&&i.conditionalFormats.length&&this.parent.notify(_ne,{indexes:n}),this.parent.hideSpinner(),this.parent.notify(Fae,null)};var age=lge;function lge(e){this.parent=e,this.addEventListener()}dge.prototype.destroy=function(){var i=this,e=(this.removeEventListener(),this.parent.refreshing&&this.filterRange.size&&(this.parent.filterCollection=[],this.filterRange.forEach(function(e,t){i.setFilteredCollection({sheetIdx:t,saveJson:{filterCollection:i.parent.filterCollection}})})),this.filterRange=null,this.filterCollection=null,this.filterBtn&&this.filterBtn.remove(),this.filterBtn=null,this.treeViewObj&&this.treeViewObj.destroy(),this.treeViewObj=null,this.treeViewEle&&this.treeViewEle.remove(),this.treeViewEle=null,this.cBox&&(this.cBox.remove(),this.cBox=null),document.querySelectorAll(".e-filter-popup"));e&&e.forEach(function(e){e.remove()}),this.parent=null},dge.prototype.addEventListener=function(){this.parent.on(rne,this.filterRangeAlertHandler,this),this.parent.on(Pae,this.initiateFilterUIHandler,this),this.parent.on(use,this.filterMouseDownHandler,this),this.parent.on(Bae,this.renderFilterCellHandler,this),this.parent.on(Fae,this.refreshFilterRange,this),this.parent.on(Doe,this.updateSortCollectionHandler,this),this.parent.on(WI,this.beforeFilterMenuOpenHandler,this),this.parent.on(zT,this.closeDialog,this),this.parent.on(Lae,this.reapplyFilterHandler,this),this.parent.on(Rae,this.filterByCellValueHandler,this),this.parent.on(Oae,this.clearFilterHandler,this),this.parent.on(Nae,this.getFilteredColumnHandler,this),this.parent.on(Mse,this.cMenuBeforeOpenHandler,this),this.parent.on(UI,this.filterCboxValueHandler,this),this.parent.on(Hae,this.getFilterRangeHandler,this),this.parent.on(_ae,this.filterCellKeyDownHandler,this),this.parent.on(wie,this.setFilteredCollection,this),this.parent.on(cse,this.updateFilter,this),this.parent.on($ne,this.beforeInsertHandler,this),this.parent.on(eoe,this.beforeDeleteHandler,this),this.parent.on(zie,this.deleteSheetHandler,this),this.parent.on(zne,this.clearHandler,this),this.parent.on(hI,this.filterDialogCreatedHandler,this),this.parent.on(NT,this.removeFilterClass,this),this.parent.on(moe,this.duplicateSheetFilterHandler,this),this.parent.on(jI,this.beforeFilteringHandler,this),this.parent.on(NI,this.customFilterOpen,this),this.parent.on(Ioe,this.moveSheetHandler,this),this.parent.on(dae,this.refreshFilterCellsOnResize,this)},dge.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(rne,this.filterRangeAlertHandler),this.parent.off(Pae,this.initiateFilterUIHandler),this.parent.off(use,this.filterMouseDownHandler),this.parent.off(Bae,this.renderFilterCellHandler),this.parent.off(Fae,this.refreshFilterRange),this.parent.off(Doe,this.updateSortCollectionHandler),this.parent.off(WI,this.beforeFilterMenuOpenHandler),this.parent.off(zT,this.closeDialog),this.parent.off(Lae,this.reapplyFilterHandler),this.parent.off(Rae,this.filterByCellValueHandler),this.parent.off(Oae,this.clearFilterHandler),this.parent.off(Nae,this.getFilteredColumnHandler),this.parent.off(Mse,this.cMenuBeforeOpenHandler),this.parent.off(UI,this.filterCboxValueHandler),this.parent.off(Hae,this.getFilterRangeHandler),this.parent.off(_ae,this.filterCellKeyDownHandler),this.parent.off(wie,this.setFilteredCollection),this.parent.off(cse,this.updateFilter),this.parent.off($ne,this.beforeInsertHandler),this.parent.off(eoe,this.beforeDeleteHandler),this.parent.off(zie,this.deleteSheetHandler),this.parent.off(zne,this.clearHandler),this.parent.off(hI,this.filterDialogCreatedHandler),this.parent.off(NT,this.removeFilterClass),this.parent.off(moe,this.duplicateSheetFilterHandler),this.parent.off(jI,this.beforeFilteringHandler),this.parent.off(NI,this.customFilterOpen),this.parent.off(Ioe,this.moveSheetHandler),this.parent.off(dae,this.refreshFilterCellsOnResize))},dge.prototype.getModuleName=function(){return"filter"},dge.prototype.isInValidFilterRange=function(e,t){var t=fte(pte(t||e.selectedRange)),i=!1;return 0===e.usedRange.colIndex&&0===e.usedRange.rowIndex&&je(e.rows[e.usedRange.rowIndex])&&(i=!0),t[0]>e.usedRange.rowIndex||t[1]>e.usedRange.colIndex||i},dge.prototype.filterRangeAlertHandler=function(e){var i=this;this.parent.serviceLocator.getService(rpe).show({content:e.error,isModal:!0,height:180,width:400,showCloseIcon:!0,beforeOpen:function(e){var t={dialogName:"FilterRangeDialog",element:e.element,target:e.target,cancel:e.cancel};i.parent.trigger("dialogBeforeOpen",t),t.cancel?e.cancel=!0:sce(i.parent.element)}}),this.parent.hideSpinner()},dge.prototype.beforeFilterMenuOpenHandler=function(e){var t=this.parent.serviceLocator.getService(ope),i=(e.element.classList.add("e-spreadsheet-contextmenu"),e.element.querySelector("ul"));this.addMenuItem(i,t.getConstant("SortDescending"),"e-filter-sortdesc","e-sort-desc"),this.addMenuItem(i,t.getConstant("SortAscending"),"e-filter-sortasc","e-sort-asc"),e.element.appendChild(i)},dge.prototype.addMenuItem=function(e,t,i,n){i=this.parent.createElement("li",{className:i+" e-menu-item"});this.parent.allowSorting||i.classList.add("e-disabled"),i.innerText=t,i.insertBefore(this.parent.createElement("span",{className:"e-menu-icon e-icons "+n}),i.firstChild),e.insertBefore(i,e.firstChild)},dge.prototype.initiateFilterUIHandler=function(t){function i(){e&&e.resolve()}var e,n=this,o=t?t.predicates:null,r=t.sIdx,s=(r||0===r||(r=t.isOpen?0:this.parent.activeSheetIndex),t.promise&&(e=new ll,t.promise=e.promise),t.isInternal||t.isCut);if(0<this.filterRange.size&&this.filterRange.has(r)&&!this.parent.isOpen&&!o)this.removeFilter(r,s,!1),i();else{var a=_re(this.parent,r);if(this.isInValidFilterRange(a,t.range))c=this.parent.serviceLocator.getService(ope),this.filterRangeAlertHandler({error:c.getConstant("FilterOutOfRangeError")}),i();else{var l,h,d,p,c=t.range||a.selectedRange;if(!s){if(l={range:c,sheetIndex:r,cancel:!1,allowHeaderFilter:!1},t.predicates?(l.predicates=t.predicates,l.previousPredicates=this.filterCollection.get(r)&&[].slice.call(this.filterCollection.get(r))):l.filterOptions={predicates:t.predicates},l.useFilterRange=!1,h={action:"filter",eventArgs:l},this.parent.notify(fie,h),l.cancel)return void i();delete l.cancel,t.useFilterRange=l.useFilterRange,t.allowHeaderFilter=l.allowHeaderFilter}if(t.range||!s&&c!==l.range?s||(c=l.range):(p=rte(c))[0]===p[2]&&p[1]===p[3]&&(c=hte(p=Xoe(p[0],p[1],a)),s||(l.range=c)),o){if(o.length)return(p=this.filterRange.get(r))&&(t.useFilterRange=p.useFilterRange,t.allowHeaderFilter=p.allowHeaderFilter),this.processRange(a,r,c,!0,t.useFilterRange,t.allowHeaderFilter),p=this.filterRange.get(r).range.slice(),t.allowHeaderFilter||(p[0]=p[0]+1),t.useFilterRange||(p[2]=a.usedRange.rowIndex),p[1]=p[3]=ate(o[0].field),d=a.name+"!"+this.getPredicateRange(p,o.slice(1,o.length)),p=hte(p),void Cre(this.parent,d,!0,!0,null,!0,null,null,!1,p).then(function(e){n.filterSuccessHandler(new me(e),{action:"filtering",filterCollection:o,field:o[0].field,sIdx:t.sIdx,isInternal:s,isOpen:t.isOpen,prevPredicates:l&&l.previousPredicates}),i()});this.clearFilterHandler({sheetIndex:r})}else this.processRange(a,r,c,!1,t.useFilterRange,t.allowHeaderFilter);i(),s||(this.parent.notify(Vae,h),sce(this.parent.element))}}},dge.prototype.processRange=function(e,t,i,n,o,r){i=fte(pte(i||e.selectedRange)),i[0]===i[2]&&i[1]===i[3]?(i[0]=0,i[1]=0,i[2]=e.usedRange.rowIndex,i[3]=e.usedRange.colIndex):i[3]>e.usedRange.colIndex&&(i[3]=e.usedRange.colIndex),e={useFilterRange:o,range:i};r&&(e.allowHeaderFilter=r),this.filterRange.set(t,e),this.filterCollection.set(t,[]),n||this.refreshFilterRange(i,!1,t)},dge.prototype.removeFilter=function(e,t,i,n){var o,r=this.filterRange.get(e),s=r.range.slice(),r=r.allowHeaderFilter,a=hte(s);if(!t){if(this.parent.notify(fie,o={action:"filter",eventArgs:{range:a,sheetIndex:e,cancel:!1},isClearAction:n}),o.eventArgs.cancel)return;delete o.eventArgs.cancel}(this.filterCollection.get(e).length||i)&&(this.filterCollection.get(e).length&&n&&(a={action:"filter",eventArgs:{range:a,sheetIndex:e,predicates:[],previousPredicates:this.filterCollection.get(e)},isClearAction:n},this.parent.notify(Vae,a)),this.clearFilterHandler({preventRefresh:i,sheetIndex:e})),this.filterRange.delete(e),this.filterCollection.delete(e),this.refreshFilterRange(s,!0,e,r),t||this.parent.notify(Vae,o)},dge.prototype.filterByCellValueHandler=function(){var e,t,i,n,o,r,s,a,l=this,h=this.parent.activeSheetIndex,d=this.parent.getActiveSheet();this.isInValidFilterRange(d)?(a=this.parent.serviceLocator.getService(ope),this.filterRangeAlertHandler({error:a.getConstant("FilterOutOfRangeError")})):(a=rte(d.activeCell),this.isFilterRange(h,a[0],a[1])||(e=!0,this.processRange(d,h)),s=hte(i=(t=this.filterRange.get(h)).range.slice()),i[0]=i[0]+1,i[2]=d.usedRange.rowIndex,i[1]=i[3]=a[1],n=dte(a[1]+1),r=Kre(a[0],a[1],d),r=Sre(this.parent,r,a[0],a[1]),o=[{field:n,operator:"equal",type:this.getColumnType(d,a[1],a).type,matchCase:!1,value:r}],(a=[].slice.call(this.filterCollection.get(h))).length||(a=void 0),this.parent.notify(fie,{action:"filter",eventArgs:r={range:s,predicates:o,previousPredicates:a,sheetIndex:h,cancel:!1,allowHeaderFilter:!1}}),r.cancel?e&&this.removeFilter(h,!0):(r.allowHeaderFilter&&(t.allowHeaderFilter=r.allowHeaderFilter,i[0]--),s=d.name+"!"+this.getPredicateRange(i,this.filterCollection.get(h)),a=hte(i),Cre(this.parent,s,!0,!0,null,!0,null,null,!1,a).then(function(e){l.filterSuccessHandler(new me(e),{action:"filtering",filterCollection:o,field:n,isFilterByValue:!0})})))},dge.prototype.renderFilterCellHandler=function(e){var t=je(e.sIdx)?this.parent.activeSheetIndex:e.sIdx;if(t===this.parent.activeSheetIndex){var i=this.filterRange.get(t)&&this.filterRange.get(t),n=i&&i.range;if(n&&(n[0]===e.rowIndex||i.allowHeaderFilter)&&n[1]<=e.colIndex&&n[3]>=e.colIndex&&e.td&&!e.td.classList.contains(i.allowHeaderFilter?"e-cell":"e-header-cell")){for(var n=e.td.querySelector(".e-filter-icon"),o="",r=this.parent.sortCollection,s=dte(e.colIndex+1),a=this.filterCollection.get(t),l=0;l<a.length;l++)if(a[l].field===s){o=" e-filtered";break}if(r)for(l=0;l<r.length;l++)if(r[l].sheetIndex===t&&r[l].columnIndex===e.colIndex){o+="Ascending"===r[l].order?" e-sortasc-filter":" e-sortdesc-filter";break}n?n.className="e-btn-icon e-icons e-filter-icon"+o:(n=this.filterBtn.cloneNode(!(i=!1)),0<e.td.children.length&&-1<e.td.children[e.td.childElementCount-1].className.indexOf("e-addNoteIndicator")&&(e.td.removeChild(e.td.children[e.td.childElementCount-1]),i=!0),n.firstElementChild.className="e-btn-icon e-icons e-filter-icon"+o,e.td.insertBefore(n,e.td.firstChild),e.isAction&&(n=_re(this.parent,t),Kre(e.rowIndex,e.colIndex,n,!1,!0).wrap)&&this.parent.notify(phe,{rowIdx:e.rowIndex,colIdx:e.colIndex,sheet:n,ele:e.td}),i&&this.parent.notify(bae,{targetElement:e.td,rowIndex:e.rowIndex,columnIndex:e.colIndex}))}}},dge.prototype.refreshFilterRange=function(e,t,i,n){for(var o,r,s,a=i,i=(a||0===a||(a=this.parent.activeSheetIndex),this.filterRange&&this.filterRange.get(a)),l=(i?(e=e||i.range.slice(),n=i.allowHeaderFilter):e=e||[0,0,0,0],e),h=_re(this.parent,a),d=this.parent.frozenColCount(h),p=l[1];p<=l[3];p++)o=n?(o=(o=p<d?this.parent.sheetModule.getSelectAllTable():this.parent.getColHeaderTable())&&this.parent.getRow(0,o))&&this.parent.getCell(0,p,o):zde(h,l[0])?null:this.parent.getCell(l[0],p),t?o&&(r=o.querySelector(".e-filter-btn"))&&(s=!1,0<o.children.length&&-1<o.children[o.childElementCount-1].className.indexOf("e-addNoteIndicator")&&(o.removeChild(o.children[o.childElementCount-1]),s=!0),r.parentElement.removeChild(r),s)&&this.parent.notify(bae,{targetElement:o,rowIndex:l[0],columnIndex:p}):this.renderFilterCellHandler({td:o,rowIndex:l[0],colIndex:p,sIdx:a,isAction:!0});this.parent.sortCollection&&this.parent.notify(yie,null)},dge.prototype.isFilterCell=function(e,t,i){e=this.filterRange.has(e)&&this.filterRange.get(e).range;return e&&e[0]===t&&e[1]<=i&&e[3]>=i},dge.prototype.isFilterRange=function(e,t,i){e=this.filterRange.get(e)&&this.filterRange.get(e).range;return e&&e[0]<=t&&e[2]>=t&&e[1]<=i&&e[3]>=i},dge.prototype.getFilteredColumnHandler=function(t){var e,i,n,o,r=ee(t.sheetIndex)?this.parent.activeSheetIndex:t.sheetIndex,s=this.parent.serviceLocator.getService(ope);t.clearFilterText=s.getConstant("ClearFilter"),this.filterRange.has(r)&&(e=this.filterCollection.get(r),t.isClearAll?t.isFiltered=e&&0<e.length:(o=this.filterRange.get(r).range.slice(),n=ste((i=_re(this.parent,r)).activeCell),this.isFilterRange(r,n[0],n[1])&&(t.field=dte(n[1]+1),r=Kre(o[0],n[1],i),o=this.parent.getDisplayText(r),t.clearFilterText=s.getConstant("ClearFilterFrom")+'"'+(o?o.toString():"Column "+t.field)+'"',e.some(function(e){return t.isFiltered=e.field===t.field,t.isFiltered}))))},dge.prototype.cMenuBeforeOpenHandler=function(e){var t=this.parent.element.id+"_cmenu";e.parentItem&&e.parentItem.id===t+"_filter"&&""===e.target&&(this.getFilteredColumnHandler(e={isFiltered:!1}),this.parent.enableContextMenuItems([t+"_clearfilter",t+"_reapplyfilter"],!!e.isFiltered,!0))},dge.prototype.closeDialog=function(){var e,t=document.querySelector(".e-filter-popup");t&&t.id.includes(this.parent.element.id)&&(e=At(t,"dialog"),E.remove(t,Tpe(),this.filterMouseDownHandler),e&&e.hide(),this.parent.notify(NT,null))},dge.prototype.removeFilterClass=function(){"relative"===this.parent.element.style.position&&(this.parent.element.style.position=""),this.parent.element.classList.contains("e-filter-open")&&this.parent.element.classList.remove("e-filter-open")},dge.prototype.isPopupOpened=function(){var e=document.getElementsByClassName("e-filter-popup")[0];return e&&e.id.includes(this.parent.element.id)&&"none"!==e.style.display},dge.prototype.filterCellKeyDownHandler=function(e){var t=ste(this.parent.getActiveSheet().activeCell);this.isFilterCell(this.parent.activeSheetIndex,t[0],t[1])&&(e.closePopup?this.closeDialog():(e.isFilterCell=!0,this.isPopupOpened()||(e=this.parent.getCell(t[0],t[1]))&&this.openDialog(e)))},dge.prototype.filterMouseDownHandler=function(e){var t;F.isDevice&&"mousedown"===e.type||this.parent.getActiveSheet().isProtected||((e=e.target).classList.contains("e-filter-icon")||e.classList.contains("e-filter-btn")?(this.isPopupOpened()&&this.closeDialog(),this.openDialog(A(e,"e-cell")||A(e,"e-header-cell"))):this.isPopupOpened()&&(t=e.offsetParent,e.classList.contains("e-searchinput")||e.classList.contains("e-searchclear")||!t||t.classList.contains("e-filter-popup")||t.classList.contains("e-text-content")||t.classList.contains("e-checkboxtree")||t.classList.contains("e-checkbox-wrapper")?this.selectSortItemHandler(e):this.closeDialog()))},dge.prototype.cboxListSelected=function(e,t,i,n,o){n=A(n.target,"e-ftrchk");if(n){var r=o&&n.querySelector(".e-add-current");if(r)return r.classList.contains("e-check")?(mt(r,["e-uncheck"],["e-check"]),t.length||(e.btnObj.element.disabled=!0),!1):(mt(r,["e-check"],["e-uncheck"]),!(e.btnObj.element.disabled=!1));r=n.querySelector(".e-selectall");if(r){n.querySelector(".e-chk-hidden").indeterminate=!1;for(var s=n.querySelector(".e-frame").classList.contains("e-check"),a=void 0,l=void 0,h=o?2:1,d=e.element.childElementCount;h<d;h++)q([a=e.element.children[h].querySelector(".e-frame")],["e-check","e-stop","e-uncheck"]),s?(e.element.children[h].querySelector(".e-chk-hidden").checked=!1,a.classList.add("e-uncheck"),t.splice(0,1)):(e.element.children[h].querySelector(".e-chk-hidden").checked=!0,a.classList.add("e-check"),l=e.element.children[h].querySelector(".e-checkboxfiltertext").textContent,-1===t.indexOf(l)&&t.push(l))}else{l=n.querySelector(".e-checkboxfiltertext").textContent;n.querySelector(".e-frame").classList.contains("e-check")?t.splice(t.indexOf(l),1):t.push(l),AB(n),r=e.element.querySelector(".e-selectall")}this.updateState(e,r,r.parentElement.querySelector(".e-chk-hidden"),t.length!==i,t.length)}return null},dge.prototype.initCboxList=function(l,h,d){var n,o,p,c,u,i,r,g=this,m=l.column.field,e=new me(l.dataSource).executeLocal((new ya).sortBy(m+"_value","ascending")),f=[],s=this.parent.getActiveSheet(),y=this.parent.serviceLocator.getService(ope),a=document.createDocumentFragment(),v=this.createSelectAll(l,h),b=(a.appendChild(v),{}),w=[],C=[],S=(e.forEach(function(e){var t,i;""===e[m]?b.isBlank||(b.isBlank=!0,(t={})[m]=y.getConstant("Blanks"),n=jde(s,Number(e.__rowIndex)-1),i=IB($P("cbox"),h.createCheckbox(t[m],!n,t),"e-ftrchk"),1===a.childElementCount?a.appendChild(i):a.insertBefore(i,a.children[1]),f.splice(0,0,t[m]),n)||(w.push(t[m]),C.push(t[m])):b[e[m]]||(b[e[m]]=!0,n=jde(s,Number(e.__rowIndex)-1),o=e[m],a.appendChild(IB($P("cbox"),h.createCheckbox(o,!n,e),"e-ftrchk")),f.push(o),n)||(w.push(o),C.push(o))}),l.element.appendChild(a),v.querySelector(".e-frame")),A=(S.classList.add("e-selectall"),v.querySelector(".e-chk-hidden")),x=(this.updateState(l,S,A,C.length!==f.length,C.length),[].slice.call(l.element.childNodes)),I=(l.element.addEventListener("click",function(e){var t;p?null!==(t=g.cboxListSelected(l,p,l.element.childElementCount-2,e,!0))&&(u=t):g.cboxListSelected(l,C,f.length,e)}),function(e){var t;e.toLowerCase().includes(r)&&((t={})[l.column.field]=e,a.appendChild(IB($P("cbox"),h.createCheckbox(e,!0,t),"e-ftrchk")),c.push(e),p.push(e))}),T=1e3<l.dataSource.length?l.dataSource.length:1e3,E=f,D=d.length<=T?function(){f.forEach(function(e){I(e)})}:function(){i||(E=[],w=[],C=[],i=new me(d).executeLocal((new ya).sortBy(m+"_value","ascending")),b={},i.forEach(function(e){""===e[m]?b.isBlank||(b.isBlank=!0,o=y.getConstant("Blanks"),E.splice(0,0,o),jde(s,Number(e.__rowIndex)-1))||(w.push(o),C.push(o)):b[e[m]]||(o=e[m],b[o]=!0,E.push(e[m]),jde(s,Number(e.__rowIndex)-1))||(C.push(o),w.push(o))}));for(var e=0,t=E.length;e<t&&c.length<T;e++)I(E[e])};this.wireFilterEvents(l,function(){if(c)if(u){var e;C=w;for(var t=0,i=c.length;t<i;t++)e=c[t],c.length===p.length||-1<p.indexOf(e)?-1===C.indexOf(e)&&C.push(e):-1<(e=C.indexOf(e))&&C.splice(e,1)}else C=p;var n=C.length;if(n===f.length&&(!p||d.length<=T))g.filterSuccessHandler(new me(l.dataSource),{action:"clear-filter",field:l.column.field});else{var o=[],r={field:m,ignoreAccent:!1,matchCase:!1,isFilterByMenu:!0},s=Mi(g.parent.locale),a=function(e){var t=l.type;"number"===t&&(e===y.getConstant("Blanks")?(e="",t="string"):mre(ere([e],g.parent,s)[0])||(t="string")),o.push(Object.assign({value:e,type:t},r))};if(n>E.length/2){r.operator="notequal",r.predicate="and";for(t=0,i=E.length;t<i;t++)-1===C.indexOf(E[t])&&a(E[t])}else{r.operator="equal",r.predicate="or";for(t=0,i=n;t<i;t++)a(C[t])}h.initiateFilter(o)}},function(e){if("keyup"===e.event.type)r=e.event.target.value.toLowerCase();else if(e.event.target.classList.contains("e-search-icon"))return;var t;(a=document.createDocumentFragment()).appendChild(v),r?(c=[],p=[],D(),p.length?(g.updateState(l,S,A,!1,0),v.classList.remove("e-hide"),(e={})[m]=y.getConstant("AddCurrentSelection"),e=IB($P("cbox"),h.createCheckbox(e[m],!1,e),"e-ftrchk"),a.insertBefore(e,a.children[1]),e.querySelector(".e-frame").classList.add("e-add-current")):(v.classList.add("e-hide"),e=g.parent.createElement("div",{className:"e-checkfltrnmdiv"}),(t=g.parent.createElement("span")).innerText=y.getConstant("NoResult"),e.appendChild(t),a.appendChild(e),l.btnObj.element.disabled=!0)):x&&(c=p=null,g.updateState(l,S,A,C.length!==f.length,C.length),v.classList.remove("e-hide"),x.forEach(function(e){a.appendChild(e)})),l.element.innerHTML="",l.element.appendChild(a)}.bind(this))},dge.prototype.createSelectAll=function(e,t){var i={};return i[e.column.field]=this.parent.serviceLocator.getService(ope).getConstant("SelectAll"),IB($P("cbox"),t.createCheckbox(i[e.column.field],!1,i),"e-ftrchk")},dge.prototype.updateState=function(e,t,i,n,o){q([t],["e-check","e-stop","e-uncheck"]),e.btnObj.element.disabled&&(e.btnObj.element.disabled=!1),n?o?t.classList.add("e-stop"):(t.classList.add("e-uncheck"),o=e.element.querySelector(".e-add-current"),e.btnObj.element.disabled=!o||!o.classList.contains("e-check")):t.classList.add("e-check"),i.indeterminate=n,i.checked=!n},dge.prototype.beforeFilteringHandler=function(n){var s,e,t,a=this;n.instance&&n.instance.options&&(n.isOpen&&"string"===n.instance.options.type&&"."!==(e=Mi(this.parent.locale)).decimal&&2===(t=n.arg3.toString().split(".")).length&&(t=t.join(e.decimal),mre(new Ti(this.parent.locale).parseNumber(t,{format:"n"})))&&(n.arg3=t),s=function(e,t){var i,n,o,r;return t&&("notequal"===t||a.isCustomNumFilter(t))?e?mre(e)?e=parseFloat(e.toString()):"string"==typeof e&&(o=Mi(a.parent.locale),i=new Ti(a.parent.locale),r={},(r=!e.includes(o.percentSign)||""===(n=e.trim().split("%"))[0]||n[1]?r:Moe({value:n[0]},a.parent.locale,o.group,o.decimal)).isNumber?e=Number(r.value)/100:mre(n=i.parseNumber(e.trim(),{format:"n"}))?e=/^(\(\d+\)|\d+)$/.test(e.trim())?-n:n:(o=e.trim(),a.parent.notify(Fie,r={value:o,cell:{value:o}}),(r.isTime||r.isDate)&&(e=parseFloat(r.updatedVal)))):"notequal"===t&&null===e&&(e=""):"equal"===t&&(mre(e)?e=e.toString():"string"==typeof e&&mre(s(e,"notequal"))?e=e.trim():null===e&&(e="")),e},"date"!==n.instance.options.type?(n.arg3=s(n.arg3,n.arg2),n.arg8=s(n.arg8,n.arg7)):"yMd"===n.instance.options.format&&(e=function(e,t){var i;return e&&("string"==typeof e?(i=e.trim(),a.parent.notify(Fie,i={value:i,cell:{value:i}}),i.isDate?e="equal"===t?i.dateObj:parseFloat(i.updatedVal):"equal"!==t&&"notequal"!==t||(mre(i=s(e,"notequal"))?(n.instance.options.type="number","notequal"===t&&(e=i)):n.instance.options.type="string")):gre(e)&&"equal"!==t&&(e=ure(e,!0))),e},2===(t=document.querySelectorAll(".e-xlfl-valuediv input.e-datepicker")).length?(n.arg3=e(n.arg3||t[0].value,n.arg2),n.arg8=e(n.arg8||t[1].value,n.arg7)):n.arg3&&(n.arg3=e(n.arg3,n.arg2))))},dge.prototype.customFilterOpen=function(e){for(var t=document.querySelectorAll(".e-xlfl-optrdiv input.e-dropdownlist"),i=[],n=0;n<t.length;n++){var o=At(t[n],"dropdownlist");o&&i.push(o.value)}var r=[];if(2===i.length)for(var s,a=this.filterCollection.get(this.parent.activeSheetIndex),n=0;n<a.length;n++)a[n].field===e.column&&null!==a[n].value&&-1<(s=i.indexOf(a[n].operator))&&("equal"===a[n].operator&&gre(a[n].value)?r[s]=ure(a[n].value,!0).toString():r[s]=a[n].value.toString(),i[s]="");function l(e){if("."!==h.decimal&&mre(e)){var t=e.toString();if(t.includes("."))return t.replace(".",h.decimal)}return e}var h=Mi(this.parent.locale),d=document.querySelectorAll(".e-xlfl-valuediv input.e-ss-filter-input");if(d.length)for(n=0;n<d.length;n++){var p=new fV({placeholder:this.parent.serviceLocator.getService(ope).getConstant("CustomFilterPlaceHolder")});r[n]&&(p.value=l(r[n])),p.appendTo(d[n])}else for(var c=document.querySelectorAll(".e-xlfl-valuediv input.e-datepicker"),u=void 0,g=void 0,n=0;n<c.length;n++)g=mre(r[n])?this.parent.getDisplayText({value:r[n],format:Ghe("ShortDate")+(r[n].includes(".")?" "+Ghe("Time"):"")}):l(r[n]),(u=At(c[n],"datepicker"))&&(u.value=g,c[n].value=g)},dge.prototype.wireFilterEvents=function(e,t,i){var n=this,o=(e.btnObj.element.addEventListener("click",t.bind(this)),e.searchBox.addEventListener("keydown",function(e){13===e.keyCode&&t()}),function(){n.parent.off(ahe,i),n.parent.off(NT,o),sce(n.parent.element)});this.parent.on(NT,o,this),this.parent.on(ahe,i,this)},dge.prototype.initTreeView=function(t,e){function i(e){m[""+l]=!0,jde(S,Number(e.__rowIndex)-1)?C=!0:u.push(l),g.push(l)}function n(e){var t=[e.node];!e.event.target.classList.contains("e-fullrow")&&"Enter"!==e.event.key||("true"===T.getNode(e.node).isChecked?T.uncheckAll(t):T.checkAll(t))}var o,r,s,a,l,h,d,p,c=this,u=[],g=[],m={},f=[],y=[],v=[],b=[],w=["January","February","March","April","May","June","July","August","September","October","November","December"],C=("en-US"!==this.parent.locale&&(A=ce.getDependables(Ai,this.parent.locale,null).dateObject,d=A.months["stand-alone"]?A.months["stand-alone"].wide:{},12===Object.keys(d).length)&&(w=Object.keys(d).map(Number).map(function(e){return d[e]})),!1),S=this.parent.getActiveSheet(),A=(t.dataSource.forEach(function(e){"object"==typeof(s=e[t.column.field])&&Date.parse(s.toString())?(o=s.getFullYear().toString(),m[""+o]||((p={__rowIndex:o,hasChild:!0})[t.column.field]=o,f.push(p),m[""+o]=!0),h=s.getMonth(),r=w[h],m[a=o+" "+r]||((p={__rowIndex:a,pId:o,hasChild:!0,month:h})[t.column.field]=r,y.push(p),m[a]=!0),h=s.getDate(),l=a+" "+h.toString(),m[""+l]||((p={__rowIndex:l,pId:a})[t.column.field]=h,v.push(p),i(e))):(o=e[t.column.field]||0===e[t.column.field]?(l="text "+e[t.column.field].toString().toLowerCase(),e[t.column.field]):(l="blanks",c.parent.serviceLocator.getService(ope).getConstant("Blanks")),m[""+l]||((p={__rowIndex:l})[t.column.field]=o,b.push(p),i(e)))}),f=new me(f).executeLocal((new ya).sortBy(t.column.field,"decending")),y=new me(y).executeLocal((new ya).sortBy("month","ascending")),v=new me(v).executeLocal((new ya).sortBy(t.column.field,"ascending")),v=f.concat(y.concat(v)),b.length&&(b=new me(b).executeLocal((new ya).sortBy(t.column.field,"ascending")),v=v.concat(b)),this.createSelectAll(t,e)),x=(A.addEventListener("click",function(){I.indeterminate=!1,x.classList.contains("e-check")?(T.uncheckAll(),x.classList.add("e-uncheck"),I.checked=!1):(T.checkAll(),x.classList.add("e-check"),I.checked=!0)}.bind(this)),A.classList.add("e-spreadsheet-ftrchk"),A.querySelector(".e-frame")),I=(x.classList.add("e-selectall"),t.element.appendChild(A),A.querySelector(".e-chk-hidden")),A=this.parent.createElement("div"),T=new PW({fields:{dataSource:v,id:"__rowIndex",parentID:"pId",text:t.column.field,hasChildren:"hasChild"},enableRtl:this.parent.enableRtl,showCheckBox:!0,cssClass:"e-checkboxtree",checkedNodes:u,nodeClicked:n.bind(this),keyPress:n.bind(this),nodeChecked:function(e){"indeterminate"!==e.action&&(C=T.checkedNodes.length!==T.fields.dataSource.length,c.updateState(t,x,I,C,T.checkedNodes.length))}});T.createElement=this.parent.createElement,T.appendTo(A),t.element.appendChild(A),u=T.checkedNodes,this.updateState(t,x,I,C,T.checkedNodes.length);this.treeViewObj=T,this.treeViewEle=A,this.cBox=I,this.wireFilterEvents(t,function(){T.checkedNodes.length===v.length?c.filterSuccessHandler(new me(t.dataSource),{action:"clear-filter",field:t.column.field}):c.generatePredicate(T.checkedNodes,b.length?"string":t.type,t.column.field,e,g,T.checkedNodes.length>v.length/2)},this.refreshCheckbox.bind(this,v,T,u))},dge.prototype.generatePredicate=function(e,t,i,n,o,r){function s(){"blanks"===l[0]?c.push(Object.assign({value:"",type:t},g)):"text"===l[0]&&(l.splice(0,1),d=l.join(" "),p=isNaN(Number(d))?"string":(d=Number(d),"number"),c.push(Object.assign({value:d,type:p},g)))}function a(){(h=new Date(Number(l[0]),u[l[1]],Number(l[2]))).getDate()?c.push(Object.assign({value:h,type:t},g)):s()}var l,h,d,p,c=[],u={January:0,February:1,March:2,April:3,May:4,June:5,July:6,August:7,September:8,October:9,November:10,December:11};if(r)for(var g={field:i,ignoreAccent:!1,matchCase:!1,predicate:"and",operator:"notequal",isFilterByMenu:!0},m=0,f=o.length;m<f;m++)-1===e.indexOf(o[m])&&(l=o[m].split(" "),a());else{g={field:i,ignoreAccent:!1,matchCase:!1,predicate:"or",operator:"equal",isFilterByMenu:!0};for(m=0,f=e.length;m<f;m++)(3===(l=e[m].split(" ")).length?a:s)()}n.initiateFilter(c)},dge.prototype.refreshCheckbox=function(e,t,i,n){if("keyup"===n.event.type)r=n.event.target.value;else if(n.event.target.classList.contains("e-search-icon"))return;function o(){var e;s.length&&!t.fields.dataSource.length&&((e=t.element.parentElement).getElementsByClassName("e-spreadsheet-ftrchk")[0].classList.remove("e-hide"),G(e.getElementsByClassName("e-checkfltrnmdiv")[0])),t.fields.dataSource=s,t.dataBind()}if(r){var r,s=new me(e).executeLocal((new ya).where(new ba(t.fields.text,"contains",r,!0))),a={},l=[],h=void 0,n=void 0,d=void 0,p=void 0;if(isNaN(Number(r))){for(var c=0;c<s.length;c++)s[c].hasChild&&(l.push(new ba("pId","equal",s[c].__rowIndex,!1)),a[""+(h=s[c].pId)]||(l.push(new ba("__rowIndex","equal",h,!1)),a[""+h]=!0));n=s,p=1}else{for(var u,g={},d=[],c=0;c<s.length;c++)(h=s[c].pId)?(u=h.split(" ")[0],a[""+h]||(l.push(new ba("__rowIndex","equal",h,!1)),a[""+h]=!0,d.push(u),d.push(h)),g[""+u]||(a[""+u]||(l.push(new ba("__rowIndex","equal",u,!1)),a[""+u]=!0),l.push(new ba("__rowIndex","equal",s[c].__rowIndex,!1)))):g[""+(h=s[c].__rowIndex)]||(l.push(new ba("__rowIndex","contains",h,!1)),g[""+h]=!0);n=[]}s.length?(l.length&&(s=n.concat(new me(e).executeLocal((new ya).where(ba.or(l))))),o(),t.checkAll(),r=t.animation.expand.duration,t.animation.expand.duration=0,t.expandAll(d,p),t.animation.expand.duration=r):t.fields.dataSource.length&&(o(),(n=t.element.parentElement).getElementsByClassName("e-spreadsheet-ftrchk")[0].classList.add("e-hide"),p=this.parent.createElement("div",{className:"e-checkfltrnmdiv"}),(r=this.parent.createElement("span")).innerText=this.parent.serviceLocator.getService(ope).getConstant("NoResult"),p.appendChild(r),n.appendChild(p))}else s=e,o(),t.checkedNodes=i,t.refresh()},dge.prototype.openDialog=function(d){var p,c,u=this,e=parseInt(d.getAttribute("aria-colindex"),10),g=dte(e),t=(this.parent.showSpinner(),this.parent.activeSheetIndex),i=this.filterRange.get(t),n=i.range.slice(),o=this.parent.getActiveSheet(),r=Kre(n[0],e-1,o),m=this.parent.getDisplayText(r),r=(i.allowHeaderFilter||(n[0]=n[0]+1),i.useFilterRange||(n[2]=o.usedRange.rowIndex),[n[0],e-1,n[2],e-1]),i=this.getPredicateRange(r,this.filterCollection.get(t),e-1),f=i.otherColPredicate,y=i.curPredicate,t=(y.length&&((p={})[g]=y),o.name+"!"+i.address),r=hte(r),o=this.getColumnType(o,e-1,n,!0),v=o.type,b="date"===v||o.isDateAvail,w="number"===v,C=b||w,S=o.isMultiFormattedCol;C&&!i.filteredCol&&(c=[]),Cre(this.parent,t,!0,!0,null,!0,null,null,!0,r,null,c).then(function(t){u.parent.element.style.position="relative",u.parent.element.classList.add("e-filter-open"),h=C?(a=c||!f.length?new me(c||t):(r=u.getPredicates(f),r=rre(new me(t),r.predicates,r.equalOrPredicates),new me(r)),u.parent.on(she,i=function(e){u.parent.off(she,i),e.isCheckboxFilterTemplate=!0,b?u.initTreeView(e,l):u.initCboxList(e,l,t)},u),[]):(a=f.length?(h=u.getPredicates(f),r=rre(new me(t),h.predicates,h.equalOrPredicates),new me(r)):new me(t),u.getClonedPredicates(y));var i,n,e,o,r=d.querySelector(".e-filter-btn"),s={field:g,filter:{}},a=(w&&(n=u.parent,s.filterTemplate=function(e){if(!n.isReact||!e)return[n.createElement("input",{className:"e-ss-filter-input"})];e.appendChild(n.createElement("input",{className:"e-ss-filter-input"}))},s.getFilterTemplate=function(){return a=s.filterTemplate,function(e,t,i,n,o,r,s){return a(s)};var a},n.isReact)&&!n.renderTemplates&&(n.renderTemplates=function(e){return e()}),{type:v,field:g,format:"date"===v?"yMd":null,displayName:m||"Column "+g,dataSource:a||[],height:u.parent.element.classList.contains("e-bigger")?800:500,columns:[],hideSearchbox:!1,filteredColumns:h,column:s,handler:u.filterSuccessHandler.bind(u,new me(t)),target:r,position:{X:0,Y:0},localeObj:u.parent.serviceLocator.getService(ope),actualPredicate:p,isFormatted:C&&!b,isMultiFormattedCol:S}),l=new Zq(u.parent,u.getLocalizedCustomOperators()),h=(l.openDialog(a),document.querySelector(".e-filter-popup"));h&&h.id.includes(u.parent.element.id)&&(E.add(h,Tpe(),u.filterMouseDownHandler,u),a=u.parent.element.getBoundingClientRect(),r=r.getBoundingClientRect(),e=h.getBoundingClientRect(),(o=r.right-a.left-e.width)<0&&(o=r.left-a.left),h.style.left=o*u.parent.viewport.scaleX+"px",h.style.top="0px",h.style.visibility="hidden",h.classList.contains("e-hide")&&h.classList.remove("e-hide"),o=r.bottom-a.top,0<e.height-(a.bottom-r.bottom)&&(o-=e.height-(a.bottom-r.bottom))<0&&(o=0),h.style.top=o*u.parent.viewport.scaleY+"px",h.style.visibility=""),u.parent.hideSpinner()})},dge.prototype.getPredicateRange=function(t,e,i){var n,o,r,s=hte(t),a=[],l=[];return e&&e.length?e.forEach(function(e){e.field&&(o=""+e.field+(t[0]+1)+":"+e.field+(t[2]+1),r=ate(e.field),s.includes(o)||(s+=","+o,r<t[1]&&(t[1]=r),r>t[3]&&(t[3]=r)),void 0!==i)&&(r===i?(n=!0,l):a).push(e)}):n=!0,void 0===i?s:{address:s,filteredCol:n,otherColPredicate:a,curPredicate:l}},dge.prototype.filterDialogCreatedHandler=function(){var e=document.querySelector(".e-filter-popup");e&&e.id.includes(this.parent.element.id)&&e.classList.contains("e-popup-close")&&e.classList.add("e-hide")},dge.prototype.filterCboxValueHandler=function(e){var t;e.column&&e.data&&(t=e.column.field,e.value)&&(t=Kre((t=ste(t+e.data.dataObj.__rowIndex))[0],t[1],this.parent.getActiveSheet()))&&t.format&&(e.value=this.parent.getDisplayText(t))},dge.prototype.selectSortItemHandler=function(e){var t=this.parent.serviceLocator.getService(ope),i=e.classList.contains("e-filter-sortasc")?"Ascending":e.classList.contains("e-filter-sortdesc")?"Descending":null;if("Ascending"===i?e.setAttribute("aria-label",t.getConstant("SortAscending")):e.setAttribute("aria-label",t.getConstant("SortDescending")),i){var e=this.parent.getActiveSheet(),n=this.parent.activeSheetIndex,t=this.filterRange.get(n),o=t.range.slice();if(t.allowHeaderFilter||(o[0]=o[0]+1),t.useFilterRange||(o[2]=e.usedRange.rowIndex),are(this.parent,o))this.closeDialog(),this.parent.notify(ele,null);else{this.parent.sortCollection=this.parent.sortCollection||[];for(var r=[],s=this.parent.sortCollection.length-1;0<=s;s--)this.parent.sortCollection[s]&&this.parent.sortCollection[s].sheetIndex===n&&(r.push(this.parent.sortCollection[s]),this.parent.sortCollection.splice(s,1));this.parent.sortCollection.push({sortRange:hte(o),columnIndex:pte(e.activeCell)[1],order:i,sheetIndex:n}),this.parent.notify(lae,{sortOptions:{sortDescriptors:{order:i},containsHeader:!1},previousSort:r,range:hte(o)}),this.refreshFilterRange(),this.closeDialog()}}},dge.prototype.filterSuccessHandler=function(e,t){var i=t.sIdx,n=(i||0===i||(i=t.isOpen?0:this.parent.activeSheetIndex),t.prevPredicates||[].slice.call(this.filterCollection.get(i))),o=(t.isFilterByValue&&!n.length&&(n=void 0),this.filterCollection.get(i));this.updatePredicate(o,t.field),"clear-filter"===t.action&&o.length===n.length||("filtering"===t.action&&(o=o.concat(t.filterCollection.map(function(e){return e&&"string"==typeof e.value&&e.value.includes("*")&&(e.value.startsWith("*")&&e.value.endsWith("*")?(e.value=e.value.split("*").join(""),e.operator="contains"):e.value.endsWith("*")?(e.value=e.value.split("*").join(""),e.operator="startswith"):e.value.startsWith("*")&&(e.value=e.value.split("*").join(""),e.operator="endswith")),e}))),this.filterCollection.set(i,o),o={datasource:e,predicates:(e=this.getPredicates(o)).predicates,equalOrPredicates:e.equalOrPredicates},(e=this.filterRange.get(i)).useFilterRange||(e.range[2]=_re(this.parent,i).usedRange.rowIndex),this.applyFilter(o,hte(e.range),i,n,!1,t.isInternal,t.isFilterByValue))},dge.prototype.isCustomNumFilter=function(e){return e.includes("greaterthan")||e.includes("lessthan")||"between"===e},dge.prototype.getClonedPredicates=function(e,t){void 0===t&&(t=[]);for(var i,n,o=[],r=0;r<e.length;r++)i=e[r],(this.isCustomNumFilter(i.operator)||!i.isFilterByMenu&&"notequal"===i.operator)&&mre(i.value)?(o.push(Object.assign({},i,{field:i.field+"_value",type:"number"})),n=!0):(i.isFilterByMenu||"equal"!==i.operator||"or"!==i.predicate||t.push(i.field),o.push(i));return!n&&t.length&&t.splice(0),o},dge.prototype.updatePredicate=function(e,t){for(var i=new me(e),n=new ya,o=i.executeLocal(n.where("field","equal",t)),r=0;r<o.length;r++){for(var s=-1,a=0;a<e.length;a++)if(e[a].field===o[r].field){s=a;break}-1!==s&&e.splice(s,1)}},dge.prototype.applyFilter=function(e,t,i,n,o,r,s){var a=this,l={range:t,predicates:[].slice.call(this.filterCollection.get(i)),previousPredicates:n,sheetIndex:i,cancel:!1};!r&&!s&&(this.parent.notify(fie,{action:"filter",eventArgs:l}),l.cancel)||(t.indexOf("!")<0&&(t=this.parent.sheets[i].name+"!"+t),this.parent.showSpinner(),n={args:{range:t,filterOptions:e},promise:new Promise(function(e){e(void 0)}),refresh:o},s=uce(this.parent),this.parent.notify(one,n),i=uce(this.parent),this.parent.notify(kle,{prevChartIndexes:s,currentChartIndexes:i}),n.promise.then(function(e){return a.refreshFilterRange(),a.parent.hideSpinner(),r||(delete l.cancel,a.parent.notify(Vae,{action:"filter",eventArgs:l}),document.activeElement.id!==a.parent.element.id+"_SearchBox"&&sce(a.parent.element)),Promise.resolve(e)}).catch(function(e){return a.filterRangeAlertHandler({error:e}),Promise.reject(e)}))},dge.prototype.getPredicates=function(e){var r,t=[],i=this.getClonedPredicates(e,t);if(t.length){for(var n,o,s,a=new Map,l=0;l<i.length;l++)n=i[l].field.replace("_value",""),-1<t.indexOf(n)&&(o=i.splice(l,1)[0],l--,a.has(n)?a.get(n).push(o):a.set(n,[o]));r=[],a.forEach(function(e){s=[];for(var t=B_.getPredicate(e),i=0,n=Object.keys(t);i<n.length;i++){var o=n[i];s.push(t[""+o])}r.push(s)})}for(var h=[],d=B_.getPredicate(i),p=0,c=Object.keys(d);p<c.length;p++){var u=c[p];h.push(d[""+u])}return{predicates:h,equalOrPredicates:r}},dge.prototype.getColumnType=function(e,t,i,n){for(var o,r,s,a,l=0,h=0,d=0,p=i[0];p<=i[2];p++)if((o=Kre(p,t,e))&&(!n||o.value||0===Number(o.value))){if(o.format&&"General"!==o.format){switch(Yhe(o.format).toLowerCase()){case"number":case"currency":case"accounting":case"percentage":l++;break;case"shortdate":case"longdate":d++;break;case"time":l++;break;case"text":h++;break;default:ise(o.format,!0,r={})?"date"===r.type?d++:l++:mre(o.value)?l++:o.value&&h++}s=s||o.format}else mre(o.value)?l++:o.value&&h++;s&&s!==o.format&&(a=!0)}return{type:h<l&&d<l&&0<l?"number":l<=h&&d<=h&&0<=h?"string":l<d&&h<d&&0<d?"date":"datetime",isDateAvail:!!d,isMultiFormattedCol:a}},dge.prototype.clearFilterHandler=function(e){var t=e&&!je(e.sheetIndex)?e.sheetIndex:this.parent.activeSheetIndex;if(e&&e.field){var i=[].slice.call(this.filterCollection.get(t));i&&i.length&&(this.updatePredicate(i,e.field),this.initiateFilterUIHandler({predicates:i,range:hte(this.filterRange.get(t).range),sIdx:t}))}else{var i=e&&e.isAction,n={isFiltered:!1,isClearAll:!0,sheetIndex:t};if(this.getFilteredColumnHandler(n),n.isFiltered||e&&e.preventRefresh){var n=void 0,o=_re(this.parent,t),r=this.filterRange.get(t),s=r.range;if(!i||(n={range:hte(s),predicates:[],previousPredicates:this.filterCollection.get(t),sheetIndex:t,cancel:!1},this.parent.notify(fie,{action:"filter",eventArgs:n}),!n.cancel)){this.filterCollection.set(t,[]);var a=r.useFilterRange?s[2]:o.usedRange.rowIndex;if(this.parent.scrollSettings.enableVirtualization&&a-s[0]+1>this.parent.viewport.rowCount+2*this.parent.getThreshold("row")){for(var l=0;l<=a;l++)Hde(o,l,{hidden:!1,isFiltered:!1});e&&e.preventRefresh||this.parent.renderModule.refreshSheet(!1,!1,!0)}else{this.refreshFilterRange(null,null,t);r={startIndex:s[0],hide:!1,isFiltering:!0,refreshUI:!1,endIndex:r.useFilterRange?s[2]:o.usedRange.rowIndex,sheetIndex:t};this.parent.notify(Nne,r),!r.refreshUI||e&&e.preventRefresh||this.parent.renderModule.refreshSheet(!1,!1,!0)}i&&(delete n.cancel,this.parent.notify(Vae,{action:"filter",eventArgs:n}),sce(this.parent.element))}}}},dge.prototype.reapplyFilterHandler=function(i,n){var o,r,e,t,s=this,a=this.parent.activeSheetIndex;this.filterRange.has(a)&&(o=this.filterCollection.get(a))&&o.length&&(t=_re(this.parent,a),e=(r=this.filterRange.get(a)).range.slice(),r.allowHeaderFilter||(e[0]=e[0]+1),r.useFilterRange||(e[2]=t.usedRange.rowIndex),e[1]=e[3]=ate(o[0].field),t=t.name+"!"+this.getPredicateRange(e,o.slice(1,o.length)),Cre(this.parent,t,!0,!0,null,!0,null,null,!1,hte(e)).then(function(e){var t=s.getPredicates(s.filterCollection.get(a));s.applyFilter({predicates:t.predicates,datasource:new me(e),equalOrPredicates:t.equalOrPredicates},hte(r.range),a,[].slice.call(o),n,i)}))},dge.prototype.getFilterRangeHandler=function(e){var t=je(e.sheetIdx)?this.parent.activeSheetIndex:e.sheetIdx,i=this.filterRange&&this.filterRange.get(t);i?(e.hasFilter=!0,e.filterRange=i.range,e.allowHeaderFilter=i.allowHeaderFilter,e.isFiltered=this.filterCollection&&this.filterCollection.get(t)&&0<this.filterCollection.get(t).length):(e.hasFilter=!1,e.filterRange=null)},dge.prototype.getLocalizedCustomOperators=function(){var e=this.parent.serviceLocator.getService(ope),t=[{value:"equal",text:e.getConstant("Equal")},{value:"greaterthan",text:e.getConstant("GreaterThan")},{value:"greaterthanorequal",text:e.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:e.getConstant("LessThan")},{value:"lessthanorequal",text:e.getConstant("LessThanOrEqual")},{value:"notequal",text:e.getConstant("NotEqual")}];return{stringOperator:[{value:"startswith",text:e.getConstant("StartsWith")},{value:"endswith",text:e.getConstant("EndsWith")},{value:"contains",text:e.getConstant("Contains")},{value:"equal",text:e.getConstant("Equal")},{value:"isempty",text:e.getConstant("IsEmpty")},{value:"doesnotstartwith",text:e.getConstant("NotStartsWith")},{value:"doesnotendwith",text:e.getConstant("NotEndsWith")},{value:"doesnotcontain",text:e.getConstant("NotContains")},{value:"notequal",text:e.getConstant("NotEqual")},{value:"isnotempty",text:e.getConstant("IsNotEmpty")}],numberOperator:t,dateOperator:t,datetimeOperator:t,booleanOperator:[{value:"equal",text:e.getConstant("Equal")},{value:"notequal",text:e.getConstant("NotEqual")}]}},dge.prototype.setFilteredCollection=function(r){var s=this,e={sheetIdx:r.sheetIdx};if(this.getFilterRangeHandler(e),e.hasFilter){for(var t,a,l={sheetIndex:r.sheetIdx,filterRange:hte(e.filterRange),hasFilter:!0,column:[],criteria:[],value:[],dataType:[],predicates:[]},i=(r.saveJson.filterCollection.push(l),this.filterCollection.get(r.sheetIdx)),n=new Map,h=function(e){var t;return je(e)?"":r.isSaveAction&&"date"===a?(t=e).getMonth()+1+"/"+t.getDate()+"/"+t.getFullYear()+" "+t.getHours()+":"+t.getMinutes()+":"+t.getSeconds():e},o=0;o<i.length;o++)t=i[o],r.isSaveAction&&"notequal"===t.operator&&t.isFilterByMenu?n.has(t.field)?n.get(t.field).push(t):n.set(t.field,[t]):(l.column.push(ate(t.field)),l.criteria.push(t.operator),r.isSaveAction?"equal"===t.operator?(a=gre(t.value)?"date":"string",l.value.push(h(t.value)),l.dataType.push(a)):(l.value.push(t.value),l.dataType.push("custom")):(l.value.push(t.value),l.dataType.push(t.type)),l.predicates.push(t.predicate));var d,p=new Map;n.forEach(function(e,t){d=ate(t),p.has(t)||p.set(t,s.getColData(d,t,r.sheetIdx));for(var i=p.get(t),e=s.getPredicates(e).predicates,n=new me(i).executeLocal((new ya).where(ba.and(e))),o=0;o<n.length;o++)l.column.push(d),l.criteria.push("equal"),a=gre(n[o][t])?"date":"string",l.value.push(h(n[o][t])),l.dataType.push(a),l.predicates.push("or")})}},dge.prototype.updateFilter=function(e){if(this.parent.filterCollection&&(e.initLoad||e.isOpen)){for(var t=void 0,i=void 0,n={},o=void 0,r=0;r<this.parent.filterCollection.length;r++){var s=(i=this.parent.filterCollection[r]).sheetIndex;if(0!==r||this.parent.isOpen||e.isOpen||(s=0),t=[],i.column)for(var a=0;a<i.column.length;a++)if(o={field:dte(i.column[a]+1),operator:this.getFilterOperator(i.criteria[a]),value:"string"==typeof i.value[a]?i.value[a].split("*").join(""):i.value[a],predicate:i.predicates&&i.predicates[a],type:i.dataType&&i.dataType[a]},-1<["year","month","day"].indexOf(o.type)){var l={value:o.value,cell:{value:o.value}};if(this.parent.notify(Fie,l),l.isDate){l=l.dateObj;if(o.value=l,"day"===o.type)o.type="date",o.predicate="or",t.push(o);else{o.operator="greaterthanorequal",o.predicate="and";var h=o.type;o.type="date",h=this.getPredicates([o,{field:o.field,operator:"lessthanorequal",predicate:"and",type:"date",value:new Date(l.getFullYear(),"year"===h?12:l.getMonth()+1,0,0,0,0)}]).predicates,n[o.field]||(n[o.field]=this.getColData(i.column[a],o.field,r));for(var d=new me(n[o.field]).executeLocal((new ya).where(ba.and(h))),p=0;p<d.length;p++)t.push({field:o.field,operator:"equal",predicate:"or",type:"date",value:d[p][o.field]})}}}else{var c,u,l={isOpen:!0,instance:{options:{type:o.type}},arg3:o.value,arg2:o.operator};this.beforeFilteringHandler(l),o.value=l.arg3,"string"===o.type||"custom"===o.type?this.isCustomNumFilter(o.operator)&&mre(o.value)&&(o.type="number"):"date"===o.type&&"equal"===o.operator&&"string"==typeof o.value&&o.value.includes("/")&&o.value.includes(":")&&2===(h=o.value.split(" ")).length&&(c=h[0].split("/"),u=h[1].split(":"),3===c.length)&&3===u.length&&(o.value=new Date(Number(c[2]),Number(c[0])-1,Number(c[1]),Number(u[0]),Number(u[1]),Number(u[2]))),t.push(o)}if(!e.isOpen)for(var g=0;g<t.length-1;g++)t[g].field===t[g+1].field&&(t[g].predicate||(t[g].predicate="or"),t[g+1].predicate||(t[g+1].predicate="or"));this.parent.notify(Pae,{predicates:t.length?t:void 0,range:i.filterRange,sIdx:s,isInternal:!0,isOpen:e.isOpen})}this.parent.sortCollection&&this.parent.notify(yie,null),this.parent.setProperties({filterCollection:null},!0)}},dge.prototype.getColData=function(e,t,i){var n=_re(this.parent,i);if(!n.rows||!n.rows.length)return[];for(var o,r,s=[],a=1,l=n.rows.length;a<l;a++)n.rows[a]&&(r=Kre(a,e,n,!1,!0))&&r.value&&((o={})[t]=Sre(this.parent,r,a,e),s.push(o));return s},dge.prototype.getFilterOperator=function(e){switch(e){case"BeginsWith":e="startswith";break;case"Less":e="lessthan";break;case"EndsWith":e="endswith";break;case"Equal":e="equal";break;case"Notequal":e="notEqual";break;case"Greater":e="greaterthan";break;case"Contains":e="contains";break;case"LessOrEqual":e="lessthanorequal";break;case"GreaterOrEqual":e="greaterthanorequal";break;case"NotContains":e="doesnotcontain";break;case"NotBeginsWith":e="doesnotstartwith";break;case"NotEndsWith":e="doesnotendwith";break;case"Empty":e="isempty";break;case"NotEmpty":e="isnotempty"}return e},dge.prototype.beforeInsertHandler=function(i){if("Column"===i.modelType){var e,t=(ee(i.activeSheetIndex)?this.parent:i).activeSheetIndex;this.filterRange.size&&this.filterRange.has(t)&&(e=this.filterRange.get(t).range,this.isFilterCell(t,e[0],i.index)||i.index<e[1])&&(e[3]+=i.model.length,i.index<=e[1]&&(e[1]+=i.model.length),this.filterCollection.get(t).forEach(function(e){var t=ate(e.field);i.index<=t&&(e.field=dte(t+i.model.length+1))}),this.parent.sortCollection)&&this.parent.sortCollection.forEach(function(e){e.sheetIndex===t&&i.index<=e.columnIndex&&(e.columnIndex+=i.model.length)})}else if("Sheet"===i.modelType){for(var n=0,o=Array.from(this.filterRange.keys()).sort().reverse();n<o.length;n++){var r=o[n];i.index<=r&&(this.filterRange.set(r+i.model.length,this.filterRange.get(r)),this.filterRange.delete(r),this.filterCollection.set(r+i.model.length,this.filterCollection.get(r)),this.filterCollection.delete(r))}this.parent.sortCollection&&this.parent.sortCollection.forEach(function(e){i.index<=e.sheetIndex&&(e.sheetIndex+=i.model.length)})}},dge.prototype.beforeDeleteHandler=function(e){if("Column"===e.modelType){var t=this.parent.activeSheetIndex;if(this.filterRange.size&&this.filterRange.has(t)){var i=!0,n=this.filterRange.get(t).range;if(e.start>=n[1]&&e.end<=n[3]?n[3]-=e.end-e.start+1:e.start<n[1]&&e.end<n[1]?(n[1]-=e.end-e.start+1,n[3]-=e.end-e.start+1):e.start<n[1]&&e.end>n[1]&&e.end<n[3]?(n[1]=e.start,n[3]-=e.end-e.start+1):i=!1,i){for(var o=this.filterCollection.get(t),r=void 0,s=o.length-1;0<=s;s--){var a=ate(o[s].field);e.end<a?o[s].field=dte(a-(e.end-e.start+1)+1):e.start<=a&&e.end>=a&&(r=!0,o.splice(s,1))}var l=this.parent.sortCollection;if(l)for(s=0;s<l.length;s++)if(l[s].sheetIndex===t){if(e.end<l[s].columnIndex){l[s].columnIndex=l[s].columnIndex-(e.end-e.start+1);break}if(e.start<=l[s].columnIndex&&e.end>=l[s].columnIndex){l.splice(s,1);break}}n.some(function(e){return e<0})?(this.removeFilter(t,!0,!0),e.refreshSheet=!0):r&&(o&&o.length?(this.reapplyFilterHandler(!0,!0),e.refreshSheet=!1):(this.clearFilterHandler({preventRefresh:!0}),e.refreshSheet=!0))}}}},dge.prototype.deleteSheetHandler=function(e){if(ee(e.sheetIndex))this.filterRange.get(this.parent.activeSheetIndex)&&(this.filterRange.delete(this.parent.activeSheetIndex),this.filterCollection.delete(this.parent.activeSheetIndex));else{for(var t=0,i=Array.from(this.filterRange.keys()).sort().reverse();t<i.length;t++){var n=i[t];e.sheetIndex===n?(this.filterRange.delete(n),this.filterCollection.delete(n)):e.sheetIndex<n&&(this.filterRange.set(n-1,this.filterRange.get(n)),this.filterRange.delete(n),this.filterCollection.set(n-1,this.filterCollection.get(n)),this.filterCollection.delete(n))}var o=this.parent.sortCollection;if(o)for(var r=o.length-1;0<=r;r--)e.sheetIndex===o[r].sheetIndex?o.splice(r,1):e.sheetIndex<o[r].sheetIndex&&--o[r].sheetIndex}},dge.prototype.clearHandler=function(e){var t,e=this.parent.getAddressInfo(e.range);this.filterRange.has(e.sheetIndex)&&(t=this.filterRange.get(e.sheetIndex).range.slice(),Ooe(e.indices,t[0],t[1]))&&Ooe(e.indices,t[0],t[3])&&this.removeFilter(e.sheetIndex,null,null,!0)},dge.prototype.duplicateSheetFilterHandler=function(e){for(var t,i=0,n=Array.from(this.filterRange.keys()).sort().reverse();i<n.length;i++){var o=n[i];if(!(e.newSheetIndex<=o))break;this.filterRange.set(o+1,this.filterRange.get(o)),this.filterRange.delete(o),this.filterCollection.set(o+1,this.filterCollection.get(o)),this.filterCollection.delete(o)}this.filterCollection.has(e.sheetIndex)&&this.filterCollection.set(e.newSheetIndex,this.filterCollection.get(e.sheetIndex).slice()),this.filterRange.has(e.sheetIndex)&&(t=this.filterRange.get(e.sheetIndex),this.filterRange.set(e.newSheetIndex,{useFilterRange:t.useFilterRange,range:t.range.slice(),allowHeaderFilter:t.allowHeaderFilter}))},dge.prototype.updateSortCollectionHandler=function(e){if(e.isDuplicate){if(this.parent.sortCollection&&0<this.parent.sortCollection.length){for(var t=[],i=0;i<this.parent.sortCollection.length;i++){var n=this.parent.sortCollection[i];n.sheetIndex===e.curSheetIndex&&((n=Object.assign({},n)).sheetIndex=e.newSheetIndex,t.push(n))}(o=this.parent.sortCollection).push.apply(o,t)}}else{var o=this.parent.getActiveSheet(),r=this.parent.activeSheetIndex,s=this.filterRange.get(r);if(s){var a=s.range.slice(),l=(s.allowHeaderFilter||(a[0]=a[0]+1),s.useFilterRange||(a[2]=o.usedRange.rowIndex),e.sortOptions.sortDescriptors);if(this.parent.sortCollection=this.parent.sortCollection||[],Array.isArray(l))for(var h=0;h<l.length;h++)this.parent.sortCollection.push({sortRange:hte(a),columnIndex:ate(l[h].field),order:l[h].order,sheetIndex:r});else this.parent.sortCollection.push({sortRange:hte(a),columnIndex:pte(o.activeCell)[1],order:l.order,sheetIndex:r})}}},dge.prototype.moveSheetHandler=function(e){var t,i,n,o;this.filterRange.has(e.prevIndex)&&(t=this.filterRange.get(e.prevIndex),n=this.filterCollection.get(e.prevIndex)),this.filterRange.has(e.currentIndex)&&(i=this.filterRange.get(e.currentIndex),o=this.filterCollection.get(e.currentIndex)),t&&i?(this.filterRange.set(e.currentIndex,t),this.filterRange.set(e.prevIndex,i),this.filterCollection.set(e.currentIndex,n),this.filterCollection.set(e.prevIndex,o)):t?(this.filterRange.set(e.currentIndex,t),this.filterRange.delete(e.prevIndex),this.filterCollection.set(e.currentIndex,n),this.filterCollection.delete(e.prevIndex)):i&&(this.filterRange.set(e.prevIndex,i),this.filterRange.delete(e.currentIndex),this.filterCollection.set(e.prevIndex,o),this.filterCollection.delete(e.currentIndex))},dge.prototype.refreshFilterCellsOnResize=function(e){var t=this.filterRange.has(this.parent.activeSheetIndex)&&this.filterRange.get(this.parent.activeSheetIndex).range;if(t&&t[0]===e.rowIndex)for(var i,n=this.parent.getActiveSheet(),o=t[1];o<=t[3];o++)Kre(e.rowIndex,o,n,!1,!0).notes&&(i=this.parent.getCell(e.rowIndex,o))&&this.parent.serviceLocator.getService("cell").refresh(e.rowIndex,o,!1,i,!1,!1,!0)};var hge=dge;function dge(e){this.parent=e,this.filterCollection=new Map,this.filterRange=new Map,this.filterBtn=e.createElement("div",{className:"e-filter-btn e-control e-btn e-lib e-filter-iconbtn e-icon-btn"}),this.filterBtn.appendChild(e.createElement("span",{className:"e-btn-icon e-icons e-filter-icon"})),this.addEventListener()}cge.prototype.addEventListener=function(){this.parent.on(Cle,this.insertImage,this),this.parent.on(Ale,this.refreshImgCellObj,this),this.parent.on(Tle,this.createImageElement,this),this.parent.on(Ele,this.deleteImage,this),this.parent.on(Ple,this.refreshInsDelImagePosition,this)},cge.prototype.renderImageUpload=function(){var e=this.parent.createElement("input",{id:this.parent.element.id+"_imageUpload",attrs:{type:"file",accept:".image, .jpg, .png, .gif ,jpeg",name:"fileUpload"}});e.style.display="none",this.parent.element.appendChild(e),e.onchange=this.imageSelect.bind(this)},cge.prototype.imageSelect=function(e){var t=e.target.files[0];t&&(t.type.includes("image")?this.insertImage({file:t,isAction:!0}):this.parent.serviceLocator.getService(rpe).show({content:this.parent.serviceLocator.getService("spreadsheetLocale").getConstant("UnsupportedFile"),width:"300"}),e.target.value="")},cge.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Cle,this.insertImage),this.parent.off(Ale,this.refreshImgCellObj),this.parent.off(Tle,this.createImageElement),this.parent.off(Ele,this.deleteImage),this.parent.off(Ple,this.refreshInsDelImagePosition))},cge.prototype.insertImage=function(t,i){var n=this;this.binaryStringVal(t).then(function(e){return n.createImageElement({options:{src:e},range:i,isPublic:!0,isAction:t.isAction})})},cge.prototype.binaryStringVal=function(n){return new Promise(function(e,t){var i=new FileReader;i.readAsDataURL(n.file),i.onload=function(){return e(i.result)},i.onerror=function(e){return t(e)}})},cge.prototype.createImageElement=function(e){var t,i,n,o,r,s=e.range?e.range.lastIndexOf("!"):0,a=e.range?0<s?e.range.substring(s+1):e.range:this.parent.getActiveSheet().selectedRange,s=e.range&&0<s?Bre(this.parent,e.range.substring(0,s)):this.parent.activeSheetIndex,l=this.parent.serviceLocator.getService(ape),h=e.options.id||D(this.parent.element.id+"_overlay_picture_"),d=rte(a),p=ee(s)&&!e.isUndoRedo?this.parent.getActiveSheet():this.parent.sheets[s];p&&!this.parent.element.querySelector("#"+h)&&(e.isPublic&&are(this.parent,d)?e.isAction&&this.parent.notify(ele,null):(t={requestType:"beforeInsertImage",range:p.name+"!"+a,imageData:e.options.src,sheetIndex:s},e.isPublic&&this.parent.notify("actionBegin",{eventArgs:t,action:"beforeInsertImage"}),t.cancel||((i=l.insertOverlayElement(h,a,s)).element.style.backgroundImage="url('"+e.options.src+"')",(e.options.height||e.options.left)&&(i.element.style.height=e.options.height+"px",i.element.style.width=e.options.width+"px",je(e.options.top)||(i.element.style.top=Number(cce(e.options.top).toFixed(2))+"px"),je(e.options.left)||(i.element.style.left=Number(cce(e.options.left).toFixed(2))+"px")),(p.frozenRows||p.frozenColumns)&&l.adjustFreezePaneSize(e.options,i.element,a),n={src:e.options.src,id:h,height:parseFloat(i.element.style.height.replace("px","")),width:parseFloat(i.element.style.width.replace("px","")),top:p.frozenRows||p.frozenColumns?d[0]?Ude(p,0,d[0]-1):0:i.top,left:p.frozenRows||p.frozenColumns?d[1]?$de(p,0,d[1]-1):0:i.left},this.parent.setUsedRange(d[0],d[1]),r=!1,e.isPublic||e.isUndoRedo||n.top===e.options.top&&n.left===e.options.left||(e.options.top=n.top,e.options.left=n.left,r=!0),o={options:[n],range:p.name+"!"+a,isPositionChanged:r,isElementRemoved:!1},(e.isPublic||e.isUndoRedo||r)&&this.parent.notify(Wne,o),r&&o.isElementRemoved&&((i=l.insertOverlayElement(h,a,s)).element.style.backgroundImage="url('"+e.options.src+"')"),(r=Kre(d[0],d[1],p)).image[r.image.length-1].id||(r.image[r.image.length-1].id=n.id),!e.isUndoRedo&&e.isPublic&&(t={requestType:"insertImage",range:p.name+"!"+a,imageHeight:e.options.height||300,imageWidth:e.options.width||400,imageData:e.options.src,id:h,sheetIndex:s},this.parent.notify("actionComplete",{eventArgs:t,action:"insertImage"})))))},cge.prototype.refreshInsDelImagePosition=function(e){for(var t,i,n,o=e.count,r=e.sheetIdx,r=this.parent.sheets[r],s=Kre(e.rowIdx,e.colIdx,r),a=s.image.length,l=0;l<a;l++)t=document.getElementById(s.image[l].id),i="Row"===e.type?"insert"===e.status?s.image[l].top+20*o:s.image[l].top-20*o:s.image[l].top,n="Column"===e.type?"insert"===e.status?s.image[l].left+64*o:s.image[l].left-64*o:s.image[l].left,s.image[l].top=i,s.image[l].left=n,t&&(t.style.top=i+"px",t.style.left=n+"px")},cge.prototype.refreshImgCellObj=function(e){var t,i,n=ee(e.sheetIdx)?this.parent.activeSheetIndex:e.sheetIdx,n=_re(this.parent,n),o=Kre(e.prevRowIdx,e.prevColIdx,n),r=Kre(e.currentRowIdx,e.currentColIdx,n),s=o?o.image:[],a=s&&s.length?s.length:0;if(o&&o.image&&0<s.length){for(var l=0;l<a;l++)s[l]&&s[l].id===e.id&&((t=s[l]).height=e.currentHeight,t.width=e.currentWidth,t.top=e.currentTop,t.left=e.currentLeft,s.splice(l,1));r&&r.image&&(i=r.image,t)&&i.push(t),Jre(e.currentRowIdx,e.currentColIdx,n,i?{image:i}:{image:[t]},!0),"imageRefresh"!==e.requestType||e.isUndoRedo||(o={requestType:"imageRefresh",currentRowIdx:e.currentRowIdx,currentColIdx:e.currentColIdx,prevRowIdx:e.prevRowIdx,prevColIdx:e.prevColIdx,prevTop:e.prevTop,prevLeft:e.prevLeft,currentTop:e.currentTop,currentLeft:e.currentLeft,currentHeight:e.currentHeight,currentWidth:e.currentWidth,prevHeight:e.prevHeight,prevWidth:e.prevWidth,id:e.id,sheetIdx:this.parent.activeSheetIndex},this.parent.notify("actionComplete",{eventArgs:o,action:"imageRefresh"}))}},cge.prototype.deleteImage=function(e){var t,i,n=e.sheet||this.parent.getActiveSheet(),o=document.getElementById(e.id),r=e.rowIdx,s=e.colIdx;if(o){if(void 0===e.rowIdx&&void 0===e.colIdx&&(i=l=void 0,n.frozenRows||n.frozenColumns?(l={clientY:(t=o.getBoundingClientRect()).top},i={clientX:t.left},t.top<this.parent.getColumnHeaderContent().getBoundingClientRect().bottom&&(l.target=this.parent.getColumnHeaderContent()),t.left<this.parent.getRowHeaderContent().getBoundingClientRect().right&&(i.target=this.parent.getRowHeaderTable())):(l={clientY:parseFloat(o.style.top),isImage:!0},i={clientX:parseFloat(o.style.left),isImage:!0}),this.parent.notify(xle,l),this.parent.notify(Ile,i),r=l.clientY,s=i.clientX),t=n.name+"!"+lte(r,s),!e.preventEventTrigger){var o={address:t,cancel:!1};if(this.parent.notify(fie,{action:"deleteImage",eventArgs:o}),o.cancel)return}document.getElementById(e.id).remove()}else e.sheet||(l=e.range?0<e.range.lastIndexOf("!")?e.range.substring(e.range.lastIndexOf("!")+1):e.range:this.parent.getActiveSheet().selectedRange,i=e.range&&0<e.range.lastIndexOf("!")?Bre(this.parent,e.range.substring(0,e.range.lastIndexOf("!"))):this.parent.activeSheetIndex,r=(o=rte(l))[0],s=o[1],n=this.parent.sheets[i]);var a={};if(n){for(var l=Kre(r,s,n),h=l&&l.image?l.image:[],d=h.length-1;0<=d;d--)h[d].id===e.id&&(a=h.splice(d,1)[0]);Jre(r,s,n,{image:h},!0)}e.preventEventTrigger||this.parent.notify(Vae,{action:"deleteImage",eventArgs:{address:t,id:a.id,imageData:a.src,imageWidth:a.width,imageHeight:a.height,cancel:!1},preventAction:e.isUndoRedo,isClearAction:e.clearAction})},cge.prototype.destroy=function(){this.removeEventListener(),this.parent=null},cge.prototype.getModuleName=function(){return"spreadsheetImage"};var pge=cge;function cge(e){this.parent=e,this.addEventListener(),this.renderImageUpload()}uge=function(e,t){return(uge=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])}))(e,t)};var uge,gge,Rue=function(e,t){function i(){this.constructor=e}uge(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},bce=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Lue=(Rue(mge,gge=n),bce([e("Line")],mge.prototype,"type",void 0),bce([e(null)],mge.prototype,"color",void 0),bce([e(1)],mge.prototype,"width",void 0),bce([e(null)],mge.prototype,"length",void 0),bce([e("")],mge.prototype,"dashArray",void 0),mge);function mge(){return null!==gge&&gge.apply(this,arguments)||this}Rue(vge,fge=n),bce([e(0)],vge.prototype,"x",void 0),bce([e(0)],vge.prototype,"y",void 0);var fge,yge=vge;function vge(){return null!==fge&&fge.apply(this,arguments)||this}Rue(Cge,bge=n),bce([e(null)],Cge.prototype,"accessibilityDescription",void 0),bce([e(null)],Cge.prototype,"accessibilityRole",void 0),bce([e(!0)],Cge.prototype,"focusable",void 0),bce([e(0)],Cge.prototype,"tabIndex",void 0);var bge,wge=Cge;function Cge(){return null!==bge&&bge.apply(this,arguments)||this}Rue(xge,Sge=wge),bce([e(null)],xge.prototype,"accessibilityDescriptionFormat",void 0);var Sge,Age=xge;function xge(){return null!==Sge&&Sge.apply(this,arguments)||this}Rue(Ege,Ige=n),bce([e("Normal")],Ege.prototype,"fontStyle",void 0),bce([e("16px")],Ege.prototype,"size",void 0),bce([e("Normal")],Ege.prototype,"fontWeight",void 0),bce([e("")],Ege.prototype,"color",void 0),bce([e("Center")],Ege.prototype,"textAlignment",void 0),bce([e("Segoe UI")],Ege.prototype,"fontFamily",void 0),bce([e(1)],Ege.prototype,"opacity",void 0),bce([e("Wrap")],Ege.prototype,"textOverflow",void 0);var Ige,Tge=Ege;function Ege(){return null!==Ige&&Ige.apply(this,arguments)||this}Rue(kge,Dge=n),bce([e("Normal")],kge.prototype,"fontStyle",void 0),bce([e("16px")],kge.prototype,"size",void 0),bce([e("Normal")],kge.prototype,"fontWeight",void 0),bce([e("")],kge.prototype,"color",void 0),bce([e("Center")],kge.prototype,"textAlignment",void 0),bce([e("Segoe UI")],kge.prototype,"fontFamily",void 0),bce([e(1)],kge.prototype,"opacity",void 0);var Dge,Mge=kge;function kge(){return null!==Dge&&Dge.apply(this,arguments)||this}Rue(Fge,Pge=n),bce([e(null)],Fge.prototype,"text",void 0),bce([t({fontFamily:null,size:"16px",fontStyle:"Normal",fontWeight:"600",color:null},Tge)],Fge.prototype,"textStyle",void 0),bce([e(null)],Fge.prototype,"hoverTextFormat",void 0);var Pge,Bge=Fge;function Fge(){return null!==Pge&&Pge.apply(this,arguments)||this}Rue(Oge,Lge=n),bce([e("")],Oge.prototype,"color",void 0),bce([e(1)],Oge.prototype,"width",void 0),bce([e("")],Oge.prototype,"dashArray",void 0);var Lge,Rge=Oge;function Oge(){return null!==Lge&&Lge.apply(this,arguments)||this}Rue(_ge,Nge=n),bce([e(0)],_ge.prototype,"x",void 0),bce([e(0)],_ge.prototype,"y",void 0);var Nge,Vge=_ge;function _ge(){return null!==Nge&&Nge.apply(this,arguments)||this}Rue(jge,Hge=n),bce([e(F.isDevice?5:10)],jge.prototype,"left",void 0),bce([e(F.isDevice?5:10)],jge.prototype,"right",void 0),bce([e(F.isDevice?5:10)],jge.prototype,"top",void 0),bce([e(F.isDevice?5:10)],jge.prototype,"bottom",void 0);var Hge,zge=jge;function jge(){return null!==Hge&&Hge.apply(this,arguments)||this}Rue(Uge,Wge=n),bce([e(!0)],Uge.prototype,"enable",void 0),bce([e(1e3)],Uge.prototype,"duration",void 0),bce([e(0)],Uge.prototype,"delay",void 0);var Wge,Qge=Uge;function Uge(){return null!==Wge&&Wge.apply(this,arguments)||this}Rue(Yge,qge=n),bce([e(!1)],Yge.prototype,"enable",void 0),bce([e(!0)],Yge.prototype,"enableMarker",void 0),bce([e(!1)],Yge.prototype,"shared",void 0),bce([e(null)],Yge.prototype,"fill",void 0),bce([e(null)],Yge.prototype,"header",void 0),bce([e(null)],Yge.prototype,"opacity",void 0),bce([t({fontFamily:null,size:null,fontStyle:"Normal",fontWeight:null,color:null},Tge)],Yge.prototype,"textStyle",void 0),bce([e(null)],Yge.prototype,"format",void 0),bce([e(null)],Yge.prototype,"template",void 0),bce([e(!0)],Yge.prototype,"enableAnimation",void 0),bce([e(300)],Yge.prototype,"duration",void 0),bce([e(1e3)],Yge.prototype,"fadeOutDuration",void 0),bce([e("Move")],Yge.prototype,"fadeOutMode",void 0),bce([e(!1)],Yge.prototype,"enableTextWrap",void 0),bce([e(!0)],Yge.prototype,"showNearestPoint",void 0),bce([t({color:null,width:null},Rge)],Yge.prototype,"border",void 0),bce([t({x:null,y:null},yge)],Yge.prototype,"location",void 0),bce([e(!1)],Yge.prototype,"enableHighlight",void 0),bce([e(!1)],Yge.prototype,"showNearestTooltip",void 0),bce([e(!0)],Yge.prototype,"showHeaderLine",void 0);var qge,Gge=Yge;function Yge(){return null!==qge&&qge.apply(this,arguments)||this}Rue(Jge,Xge=n),bce([e(null)],Jge.prototype,"fill",void 0),bce([t({color:"",width:0},Rge)],Jge.prototype,"border",void 0),bce([e("Gap")],Jge.prototype,"mode",void 0);var Xge,Kge=Jge;function Jge(){return null!==Xge&&Xge.apply(this,arguments)||this}Rue(eme,Zge=n),bce([e(0)],eme.prototype,"series",void 0),bce([e(0)],eme.prototype,"point",void 0);var Zge,$ge=eme;function eme(){return null!==Zge&&Zge.apply(this,arguments)||this}Rue(nme,tme=n),bce([e(0)],nme.prototype,"topLeft",void 0),bce([e(0)],nme.prototype,"topRight",void 0),bce([e(0)],nme.prototype,"bottomLeft",void 0),bce([e(0)],nme.prototype,"bottomRight",void 0);var tme,ime=nme;function nme(){return null!==tme&&tme.apply(this,arguments)||this}Rue(sme,ome=n),bce([e(0)],sme.prototype,"left",void 0),bce([e(0)],sme.prototype,"right",void 0),bce([e(0)],sme.prototype,"top",void 0),bce([e(0)],sme.prototype,"bottom",void 0);var ome,rme=sme;function sme(){return null!==ome&&ome.apply(this,arguments)||this}Rue(hme,ame=n),bce([e("transparent")],hme.prototype,"color",void 0),bce([e(0)],hme.prototype,"width",void 0),bce([e(.8)],hme.prototype,"cornerRadius",void 0);var ame,lme=hme;function hme(){return null!==ame&&ame.apply(this,arguments)||this}Rue(cme,dme=n),bce([e("Normal")],cme.prototype,"fontStyle",void 0),bce([e("15px")],cme.prototype,"size",void 0),bce([e("500")],cme.prototype,"fontWeight",void 0),bce([e("")],cme.prototype,"color",void 0),bce([e("Center")],cme.prototype,"textAlignment",void 0),bce([e("Segoe UI")],cme.prototype,"fontFamily",void 0),bce([e(1)],cme.prototype,"opacity",void 0),bce([e("Wrap")],cme.prototype,"textOverflow",void 0),bce([e("Top")],cme.prototype,"position",void 0),bce([e(0)],cme.prototype,"x",void 0),bce([e(0)],cme.prototype,"y",void 0),bce([e("transparent")],cme.prototype,"background",void 0),bce([t({},lme)],cme.prototype,"border",void 0),bce([t({},wge)],cme.prototype,"accessibility",void 0);var dme,pme=cme;function cme(){return null!==dme&&dme.apply(this,arguments)||this}Rue(mme,ume=Tge),bce([e("Top")],mme.prototype,"position",void 0),bce([e(0)],mme.prototype,"x",void 0),bce([e(0)],mme.prototype,"y",void 0);var ume,gme=mme;function mme(){return null!==ume&&ume.apply(this,arguments)||this}Rue(vme,fme=n),bce([t({},Rge)],vme.prototype,"border",void 0),bce([e("transparent")],vme.prototype,"background",void 0),bce([e(1)],vme.prototype,"opacity",void 0),bce([e(null)],vme.prototype,"backgroundImage",void 0),bce([e(null)],vme.prototype,"width",void 0),bce([t({left:0,right:0,top:0,bottom:0},zge)],vme.prototype,"margin",void 0);var fme,yme=vme;function vme(){return null!==fme&&fme.apply(this,arguments)||this}Rue(Cme,bme=n),bce([e(!1)],Cme.prototype,"enable",void 0),bce([e(null)],Cme.prototype,"minY",void 0),bce([e(null)],Cme.prototype,"maxY",void 0),bce([e(null)],Cme.prototype,"fill",void 0);var bme,wme=Cme;function Cme(){return null!==bme&&bme.apply(this,arguments)||this}Rue(xme,Sme=n),bce([e("Years")],xme.prototype,"intervalType",void 0),bce([e(1)],xme.prototype,"interval",void 0),bce([e(null)],xme.prototype,"text",void 0),bce([e(!1)],xme.prototype,"selected",void 0);var Sme,Ame=xme;function xme(){return null!==Sme&&Sme.apply(this,arguments)||this}Rue(Eme,Ime=n),bce([e(43)],Eme.prototype,"height",void 0),bce([e("Bottom")],Eme.prototype,"position",void 0),bce([kt([],Ame)],Eme.prototype,"periods",void 0);var Ime,Tme=Eme;function Eme(){return null!==Ime&&Ime.apply(this,arguments)||this}Rue(Mme,Dme=n),bce([e(!1)],Mme.prototype,"enable",void 0),bce([e(!0)],Mme.prototype,"enableMarker",void 0),bce([e(!1)],Mme.prototype,"shared",void 0),bce([e(null)],Mme.prototype,"fill",void 0),bce([e(null)],Mme.prototype,"header",void 0),bce([e(.75)],Mme.prototype,"opacity",void 0),bce([t({fontFamily:null,size:"12px",fontStyle:"Normal",fontWeight:null,color:null},Tge)],Mme.prototype,"textStyle",void 0),bce([e(null)],Mme.prototype,"format",void 0),bce([e(null)],Mme.prototype,"template",void 0),bce([e(!0)],Mme.prototype,"enableAnimation",void 0),bce([e(300)],Mme.prototype,"duration",void 0),bce([e(1e3)],Mme.prototype,"fadeOutDuration",void 0),bce([e("Move")],Mme.prototype,"fadeOutMode",void 0),bce([e(!1)],Mme.prototype,"enableTextWrap",void 0),bce([e(!0)],Mme.prototype,"showNearestPoint",void 0),bce([t({color:null,width:null},Rge)],Mme.prototype,"border",void 0),bce([e("Fixed")],Mme.prototype,"position",void 0),bce([e(!1)],Mme.prototype,"showNearestTooltip",void 0),bce([e(!0)],Mme.prototype,"showHeaderLine",void 0);var Dme,Rue=Mme;function Mme(){return null!==Dme&&Dme.apply(this,arguments)||this}var kme=function(e,t){this.series=e,this.point=t},Pme=(Object.defineProperty(Bme.prototype,"start",{get:function(){return this.mStart},enumerable:!0,configurable:!0}),Object.defineProperty(Bme.prototype,"end",{get:function(){return this.mEnd},enumerable:!0,configurable:!0}),Object.defineProperty(Bme.prototype,"delta",{get:function(){return this.mEnd-this.mStart},enumerable:!0,configurable:!0}),Object.defineProperty(Bme.prototype,"median",{get:function(){return this.mStart+(this.mEnd-this.mStart)/2},enumerable:!0,configurable:!0}),Bme);function Bme(e,t){e<t?(this.mStart=e,this.mEnd=t):(this.mStart=t,this.mEnd=e)}Lme.prototype.calculateNumericNiceInterval=function(e,t,i){var n=C0e(i,e),o=t/n;if(je(e.desiredIntervals)||!this.isAutoIntervalOnBothAxis(e))for(var r=Math.pow(10,Math.floor(Bye(o,10))),s=0,a=e.intervalDivs;s<a.length;s++){var l=r*a[s];if(n<t/l)break;o=l}return o},Lme.prototype.isAutoIntervalOnBothAxis=function(e){return!(e.zoomFactor<1||0<e.zoomPosition)||!e.enableAutoIntervalOnZooming},Lme.prototype.getActualRange=function(e,t){this.initializeDoubleRange(e),!e.startFromZero&&0<this.isColumn?(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&&0<e.doubleRange.start?e.actualRange.min=0:e.actualRange.min=e.doubleRange.start-(this.isStacking?0: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)},Lme.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=-1<e.valueType.indexOf("Category")?this.max:this.min+1),e.doubleRange=new Pme(this.min,this.max),e.actualRange={}},Lme.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t,this.chart)},Lme.prototype.calculateRange=function(e){if(this.min=null,this.max=null,!b0e(e))for(var t=0,i=e.series;t<i.length;t++){var n=i[t];n.visible&&(this.paddingInterval=0,je(n.points)||(e.maxPointLength=n.points.length),e.maxPointLength=n.points.length,!((-1<n.type.indexOf("Column")||-1<n.type.indexOf("Histogram"))&&"Horizontal"===e.orientation||-1<n.type.indexOf("Bar")&&"Vertical"===e.orientation)||"Double"!==n.xAxis.valueType&&"DateTime"!==n.xAxis.valueType||"Auto"!==n.xAxis.rangePadding||(this.paddingInterval=.5*d0e(n.xAxis,e.series)),"Horizontal"===e.orientation&&(this.chart.requireInvertedAxis?this.yAxisRange(e,n):this.findMinMax(n.xMin-this.paddingInterval,n.xMax+this.paddingInterval)),"Vertical"===e.orientation)&&(this.isColumn+=-1!==n.type.indexOf("Column")||-1!==n.type.indexOf("Bar")||"Column"===n.drawType?1:0,this.isStacking=-1!==n.type.indexOf("Stacking"),this.chart.requireInvertedAxis?this.findMinMax(n.xMin-this.paddingInterval,n.xMax+this.paddingInterval):this.yAxisRange(e,n))}},Lme.prototype.yAxisRange=function(e,t){if(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),"Waterfall"===t.type){for(var i=0,n=0,o=0;o<t.yData.length;o++)t.intermediateSumIndexes&&-1!==t.intermediateSumIndexes.indexOf(o)||t.sumIndexes&&-1!==t.sumIndexes.indexOf(o)||(n+=t.yData[o]),i<n&&(i=n);this.findMinMax(t.yMin,i)}else this.findMinMax(t.yMin,t.yMax)},Lme.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)},Lme.prototype.applyRangePadding=function(e,t){var i,n,o=e.actualRange.min,r=e.actualRange.max;b0e(e)||(i=e.actualRange.interval,"Additional"===(n=e.getRangePadding(this.chart))||"Round"===n?this.findAdditional(e,o,r,i,t):"Normal"===n?this.findNormal(e,o,r,i,t):this.updateActualRange(e,o,r,i)),e.actualRange.delta=e.actualRange.max-e.actualRange.min,this.calculateVisibleRange(t,e)},Lme.prototype.updateActualRange=function(e,t,i,n){e.actualRange={min:null!=e.minimum?e.minimum:t,max:null!=e.maximum?e.maximum:i,interval:null!=e.interval?e.interval:n,delta:e.actualRange.delta}},Lme.prototype.findAdditional=function(e,t,i,n,o){t=Math.floor(t/n)*n,i=Math.ceil(i/n)*n;"Additional"===e.rangePadding&&(t-=n,i+=n),je(e.desiredIntervals)||(n=this.calculateNumericNiceInterval(e,i-t,o)),this.updateActualRange(e,t,i,n)},Lme.prototype.findNormal=function(e,t,i,n,o){var r,s=t;t<0?(n+(r=t+.05*t)%n<=.365*n&&(r-=n),r%n<(s=0)&&(r=r-n-r%n)):0<(r=t<5/6*i?0:t-.5*(i-t))%n&&(r-=r%n),n-(t=0<i?i+.05*(i-s):i-.05*(i-s))%n<=.365*n&&(t+=n),e.doubleRange=new Pme(r,t=0<t%n?t+n-t%n:t),(0===r||r<0&&t<0)&&(n=this.calculateNumericNiceInterval(e,e.doubleRange.delta,o),t=Math.ceil(t/n)*n),this.updateActualRange(e,r,t,n)},Lme.prototype.calculateVisibleRange=function(e,t){t.visibleRange={max:t.actualRange.max,min:t.actualRange.min,delta:t.actualRange.delta,interval:t.actualRange.interval},"Cartesian"===this.chart.chartAreaType&&(i=!je(t.zoomingScrollBar)&&t.zoomingScrollBar.isLazyLoad,t.zoomFactor<1||0<t.zoomPosition)&&!i&&(t.calculateVisibleRangeOnZooming(),t.visibleRange.interval=t.enableAutoIntervalOnZooming?this.calculateNumericNiceInterval(t,t.doubleRange.delta,e):t.visibleRange.interval);var i=(t.visibleRange.max-t.visibleRange.min)%t.visibleRange.interval;if(0!=i&&!isNaN(i)&&"Double"===t.valueType&&"Vertical"===t.orientation&&"Auto"===t.rangePadding){for(var n=void 0,o=t.visibleRange.min;o<=t.visibleRange.max&&n!==o;o+=t.visibleRange.interval)n=o;n<t.visibleRange.max&&(t.visibleRange.max=n+t.visibleRange.interval)}t.triggerRangeRender(this.chart,t.visibleRange.min,t.visibleRange.max,t.visibleRange.interval)},Lme.prototype.calculateVisibleLabels=function(e,t){e.visibleLabels=[];var i,n,o=e.visibleRange.min,r=(!("chart"===t.getModuleName()&&"PolarRadar"===t.chartAreaType)&&(e.zoomFactor<1||0<e.zoomPosition||this.paddingInterval)&&(o=e.visibleRange.min-e.visibleRange.min%e.visibleRange.interval),this.getFormat(e)),s=null!==r.match("{value}"),a=0,l=0;for(e.labelFormat&&-1<e.labelFormat.indexOf("n")&&(l=parseInt(e.labelFormat.substring(1,e.labelFormat.length),10)),e.format=t.intl.getNumberFormat({format:s?"":r,useGrouping:t.useGroupingSeparator}),e.startLabel=e.format(e.visibleRange.min),e.endLabel=e.format(e.visibleRange.max),e.visibleRange.interval&&0<=(e.visibleRange.interval+"").indexOf(".")&&(a=(e.visibleRange.interval+"").split(".")[1].length);o<=e.visibleRange.max&&n!==o;o+=e.visibleRange.interval)n=o,i=Pe({},R("properties",e.labelStyle),null,!0),Rye(o,e.visibleRange)&&v0e(t,o,this.formatValue(e,s,r,o),i,e);o&&0<=(o+"").indexOf(".")&&10<(o+"").split(".")[1].length&&(o=(o+"").split(".")[1].length>(l||a)?+o.toFixed(l||a):o)<=e.visibleRange.max&&v0e(t,o,this.formatValue(e,s,r,o),i,e),e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},Lme.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}%":""},Lme.prototype.formatValue=function(e,t,i,n){var o=n%1?Number(n.toLocaleString("en-US").split(",").join("")):n;return t?i.replace("{value}",e.format(o)):i?e.format(n):e.format(o)},Lme.prototype.getModuleName=function(){return"Double"},Lme.prototype.destroy=function(){};var Fme=Lme;function Lme(e){this.isColumn=0,this.isStacking=!1,this.chart=e}var Rme,Ome,Nme="legendClick",Vme="load",_me="animationComplete",Hme="legendRender",zme="textRender",jme="pointRender",Wme="sharedTooltipRender",Qme="seriesRender",Ume="axisLabelRender",qme="axisLabelClick",Gme="axisRangeCalculated",Yme="axisMultiLabelRender",Xme="tooltipRender",Kme="chartMouseMove",Jme="chartMouseClick",Zme="chartDoubleClick",$me="pointClick",efe="pointDoubleClick",tfe="pointMove",ife="chartMouseLeave",nfe="chartMouseDown",ofe="chartMouseUp",rfe="zoomComplete",sfe="dragComplete",afe="selectionComplete",lfe="resized",hfe="beforeResize",dfe="beforePrint",pfe="annotationRender",cfe="scrollStart",ufe="scrollEnd",gfe="scrollChanged",mfe="stockEventRender",ffe="multiLevelLabelClick",yfe=/~\d+~/g,vfe=/\^\d+\^/g,bfe="beforeExport",wfe="afterExport",Cfe="bulletChartMouseClick",Sfe="onZooming",bce=(Rme=function(e,t){return(Rme=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])}))(e,t)},function(e,t){function i(){this.constructor=e}Rme(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Afe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},xfe=(bce(Ife,Ome=n),Afe([e("0")],Ife.prototype,"x",void 0),Afe([e("0")],Ife.prototype,"y",void 0),Afe([e(null)],Ife.prototype,"content",void 0),Afe([e("Center")],Ife.prototype,"horizontalAlignment",void 0),Afe([e("Pixel")],Ife.prototype,"coordinateUnits",void 0),Afe([e("Chart")],Ife.prototype,"region",void 0),Afe([e("Middle")],Ife.prototype,"verticalAlignment",void 0),Afe([e(null)],Ife.prototype,"xAxisName",void 0),Afe([e(null)],Ife.prototype,"yAxisName",void 0),Afe([e(null)],Ife.prototype,"description",void 0),Afe([t({},wge)],Ife.prototype,"accessibility",void 0),Ife);function Ife(){return null!==Ome&&Ome.apply(this,arguments)||this}bce(Dfe,Tfe=n),Afe([e("")],Dfe.prototype,"color",void 0),Afe([e(1)],Dfe.prototype,"width",void 0),Afe([e("Rectangle")],Dfe.prototype,"type",void 0);var Tfe,Efe=Dfe;function Dfe(){return null!==Tfe&&Tfe.apply(this,arguments)||this}bce(Pfe,Mfe=n),Afe([e(null)],Pfe.prototype,"start",void 0),Afe([e(null)],Pfe.prototype,"end",void 0),Afe([e("")],Pfe.prototype,"text",void 0),Afe([e(null)],Pfe.prototype,"maximumTextWidth",void 0),Afe([e(null)],Pfe.prototype,"customAttributes",void 0),Afe([e("")],Pfe.prototype,"type",void 0);var Mfe,kfe=Pfe;function Pfe(){return null!==Mfe&&Mfe.apply(this,arguments)||this}bce(Lfe,Bfe=n),Afe([e(!0)],Lfe.prototype,"visible",void 0),Afe([e(!1)],Lfe.prototype,"startFromAxis",void 0),Afe([e(null)],Lfe.prototype,"start",void 0),Afe([e(null)],Lfe.prototype,"end",void 0),Afe([e(null)],Lfe.prototype,"size",void 0),Afe([e("#808080")],Lfe.prototype,"color",void 0),Afe([e(null)],Lfe.prototype,"dashArray",void 0),Afe([e("Auto")],Lfe.prototype,"sizeType",void 0),Afe([e(!1)],Lfe.prototype,"isRepeat",void 0),Afe([e(null)],Lfe.prototype,"repeatEvery",void 0),Afe([e(null)],Lfe.prototype,"repeatUntil",void 0),Afe([e(!1)],Lfe.prototype,"isSegmented",void 0),Afe([e(null)],Lfe.prototype,"segmentStart",void 0),Afe([e(null)],Lfe.prototype,"segmentEnd",void 0),Afe([e(null)],Lfe.prototype,"segmentAxisName",void 0),Afe([t({color:"transparent",width:1},Rge)],Lfe.prototype,"border",void 0),Afe([e("")],Lfe.prototype,"text",void 0),Afe([e(null)],Lfe.prototype,"rotation",void 0),Afe([e("Middle")],Lfe.prototype,"horizontalAlignment",void 0),Afe([e("Middle")],Lfe.prototype,"verticalAlignment",void 0),Afe([t({size:"12px",color:null,fontStyle:"Normal",fontWeight:"400",fontFamily:null},Tge)],Lfe.prototype,"textStyle",void 0),Afe([e("Behind")],Lfe.prototype,"zIndex",void 0),Afe([e(1)],Lfe.prototype,"opacity",void 0),Afe([e("")],Lfe.prototype,"imageUrl",void 0);var Bfe,Ffe=Lfe;function Lfe(){return null!==Bfe&&Bfe.apply(this,arguments)||this}bce(Nfe,Rfe=n),Afe([e("Center")],Nfe.prototype,"alignment",void 0),Afe([e("Wrap")],Nfe.prototype,"overflow",void 0),Afe([t({fontFamily:null,size:"12px",fontStyle:"Normal",fontWeight:"400",color:null},Tge)],Nfe.prototype,"textStyle",void 0),Afe([t({color:null,width:1,type:"Rectangle"},Efe)],Nfe.prototype,"border",void 0),Afe([kt([],kfe)],Nfe.prototype,"categories",void 0);var Rfe,Ofe=Nfe;function Nfe(){return null!==Rfe&&Rfe.apply(this,arguments)||this}bce(Hfe,Vfe=n),Afe([e(null)],Hfe.prototype,"minimum",void 0),Afe([e(null)],Hfe.prototype,"maximum",void 0);var Vfe,_fe=Hfe;function Hfe(){return null!==Vfe&&Vfe.apply(this,arguments)||this}bce(Wfe,zfe=n),Afe([e(!1)],Wfe.prototype,"enable",void 0),Afe([e(null)],Wfe.prototype,"pointsLength",void 0),Afe([t({},_fe)],Wfe.prototype,"range",void 0),Afe([e(null)],Wfe.prototype,"trackColor",void 0),Afe([e(0)],Wfe.prototype,"scrollbarRadius",void 0),Afe([e(null)],Wfe.prototype,"scrollbarColor",void 0),Afe([e(0)],Wfe.prototype,"trackRadius",void 0),Afe([e(null)],Wfe.prototype,"gripColor",void 0),Afe([e(16)],Wfe.prototype,"height",void 0),Afe([e(!0)],Wfe.prototype,"enableZoom",void 0),Afe([e("PlaceNextToAxisLine")],Wfe.prototype,"position",void 0);var zfe,jfe=Wfe;function Wfe(){return null!==zfe&&zfe.apply(this,arguments)||this}bce(qfe,Qfe=n),Afe([e("Far")],qfe.prototype,"horizontalAlignment",void 0),Afe([e("Top")],qfe.prototype,"verticalAlignment",void 0),Afe([e(0)],qfe.prototype,"x",void 0),Afe([e(0)],qfe.prototype,"y",void 0),Afe([e(!1)],qfe.prototype,"draggable",void 0);var Qfe,Ufe=qfe;function qfe(){return null!==Qfe&&Qfe.apply(this,arguments)||this}bce(Yfe,Gfe=n),Afe([e(!1)],Yfe.prototype,"visible",void 0),Afe([e("transparent")],Yfe.prototype,"fill",void 0),Afe([e(null)],Yfe.prototype,"format",void 0),Afe([e(0)],Yfe.prototype,"angle",void 0),Afe([e(5)],Yfe.prototype,"rx",void 0),Afe([e(5)],Yfe.prototype,"ry",void 0),Afe([t({left:5,right:5,top:5,bottom:5},zge)],Yfe.prototype,"margin",void 0),Afe([t({width:null,color:null},Rge)],Yfe.prototype,"border",void 0),Afe([t({size:null,color:null,fontStyle:null,fontWeight:"Bold",fontFamily:null},Mge)],Yfe.prototype,"font",void 0);var Gfe,bce=Yfe;function Yfe(){return null!==Gfe&&Gfe.apply(this,arguments)||this}Xfe=function(e,t){return(Xfe=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])}))(e,t)};var Xfe,Kfe,Afe=function(e,t){function i(){this.constructor=e}Xfe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Jfe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Zfe=(Afe($fe,Kfe=n),$fe.prototype.computeSize=function(e,t,i,n){var o=0;e.visible&&e.internalVisibility&&(o+=e.findTickSize(e.crossInAxis)+("Right"===e.scrollbarSettings.position||"Left"===e.scrollbarSettings.position?0:t)+e.findLabelSize(e.crossInAxis,5,i,n)+.5*e.lineStyle.width),(e.isAxisOpposedPosition?this.farSizes:this.nearSizes).push(o)},Jfe([e("100%")],$fe.prototype,"height",void 0),Jfe([t({},Rge)],$fe.prototype,"border",void 0),$fe);function $fe(){var e=null!==Kfe&&Kfe.apply(this,arguments)||this;return e.axes=[],e.nearSizes=[],e.farSizes=[],e.insideFarSizes=[],e.insideNearSizes=[],e}Afe(iye,eye=n),iye.prototype.computeSize=function(e,t,i,n){var o=0;e.visible&&e.internalVisibility&&(o+=e.findTickSize(e.crossInAxis)+("Top"===e.scrollbarSettings.position||"Bottom"===e.scrollbarSettings.position?0:t)+e.findLabelSize(e.crossInAxis,5,i,n)+.5*e.lineStyle.width),(e.isAxisOpposedPosition?this.farSizes:this.nearSizes).push(o)},Jfe([e("100%")],iye.prototype,"width",void 0),Jfe([t({},Rge)],iye.prototype,"border",void 0);var eye,tye=iye;function iye(){var e=null!==eye&&eye.apply(this,arguments)||this;return e.axes=[],e.nearSizes=[],e.farSizes=[],e.insideFarSizes=[],e.insideNearSizes=[],e.padding=0,e}Afe(rye,nye=n),Jfe([e(1)],rye.prototype,"width",void 0),Jfe([e("")],rye.prototype,"dashArray",void 0),Jfe([e(null)],rye.prototype,"color",void 0);var nye,oye=rye;function rye(){return null!==nye&&nye.apply(this,arguments)||this}Afe(lye,sye=n),Jfe([e(.7)],lye.prototype,"width",void 0),Jfe([e("")],lye.prototype,"dashArray",void 0),Jfe([e(null)],lye.prototype,"color",void 0);var sye,aye=lye;function lye(){return null!==sye&&sye.apply(this,arguments)||this}Afe(pye,hye=n),Jfe([e(1)],pye.prototype,"width",void 0),Jfe([e("")],pye.prototype,"dashArray",void 0),Jfe([e(null)],pye.prototype,"color",void 0);var hye,dye=pye;function pye(){return null!==hye&&hye.apply(this,arguments)||this}Afe(gye,cye=n),Jfe([e(1)],gye.prototype,"width",void 0),Jfe([e(5)],gye.prototype,"height",void 0),Jfe([e(null)],gye.prototype,"color",void 0);var cye,uye=gye;function gye(){return null!==cye&&cye.apply(this,arguments)||this}Afe(yye,mye=n),Jfe([e(.7)],yye.prototype,"width",void 0),Jfe([e(5)],yye.prototype,"height",void 0),Jfe([e(null)],yye.prototype,"color",void 0);var mye,fye=yye;function yye(){return null!==mye&&mye.apply(this,arguments)||this}Afe(wye,vye=n),Jfe([e(!1)],wye.prototype,"enable",void 0),Jfe([e(null)],wye.prototype,"fill",void 0),Jfe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},Tge)],wye.prototype,"textStyle",void 0);var vye,bye=wye;function wye(){return null!==vye&&vye.apply(this,arguments)||this}Afe(Aye,Cye=n),Aye.prototype.findTickSize=function(e){return"Inside"!==this.tickPosition&&(!e||e.visibleRange&&!this.isInside(e.visibleRange))?this.majorTickLines.height:0},Aye.prototype.isInside=function(e){return Lye(this.crossAt,e)||!this.isAxisOpposedPosition&&this.crossAt>=e.max||this.isAxisOpposedPosition&&this.crossAt<=e.min},Aye.prototype.findLabelSize=function(e,t,i,n){var o=0,r="Horizontal"===this.orientation,r=(this.title&&(o=je(s=this.titleRotation)?(this.titleSize=So(this.title,this.titleStyle,n.themeStyle.axisTitleFont),this.titleSize.height+t):(this.titleSize=kye(this.titleStyle,this.title,s,n,n.themeStyle.axisTitleFont),("Vertical"===this.orientation?this.titleSize.width:this.titleSize.height)+t),this.rect.width||this.rect.height)&&(s=r?this.rect.width:this.rect.height,this.titleCollection=hve(this.title,this.titleStyle,s,n.enableRtl,n.themeStyle.axisTitleFont),o*=this.titleCollection.length),o+t+this.titlePadding+this.labelPadding+("Vertical"===this.orientation?this.maxLabelSize.width:this.maxLabelSize.height)+this.multiLevelLabelHeight);if(e&&this.placeNextToAxisLine){var s=e.visibleRange,a="Horizontal"===e.orientation?e.rect.width:e.rect.height;if(!s||!a)return 0;this.isInside(s)&&(r=(e=(e=this.findDifference(e))*((a-((e=e*(a/s.delta))<r?r-e:0))/s.delta))<r?r-e:0)}a=""!==this.title&&5!==this.titlePadding?this.titlePadding:0;return(this.isAxisOpposedPosition?i.insideFarSizes:i.insideNearSizes).push(r),"Inside"===this.labelPosition?this.isAxisOpposedPosition&&i.farSizes.length<1||!this.isAxisOpposedPosition&&i.nearSizes.length<1?o+(t="Inside"===this.labelPosition&&-1<n.axes.indexOf(this)?-5:5)+a:o+t+a+this.labelPadding+("Vertical"===this.orientation?this.maxLabelSize.width:this.maxLabelSize.height)+this.multiLevelLabelHeight:r},Aye.prototype.updateCrossValue=function(){var e=this.crossAt;if(null===e||!this.isInside(this.crossInAxis.visibleRange))return this.updatedRect=this.rect,null;var t=this.crossInAxis.visibleRange;this.isAxisOpposedPosition?this.crossAt<t.min&&(e=t.min):this.crossAt>t.max&&(e=t.max),this.updatedRect=Pe({},this.rect,null,!0),"Horizontal"===this.orientation?(e=this.crossInAxis.rect.height-Yye(e,this.crossInAxis)*this.crossInAxis.rect.height,this.updatedRect.y=this.crossInAxis.rect.y+e):(e=Yye(e,this.crossInAxis)*this.crossInAxis.rect.width,this.updatedRect.x=this.crossInAxis.rect.x+e)},Aye.prototype.findDifference=function(e){var t=0,t=this.isAxisOpposedPosition?e.isAxisInverse?e.visibleRange.min:e.visibleRange.max:e.isAxisInverse?e.visibleRange.max:e.visibleRange.min;return Math.abs(this.crossAt-t)},Aye.prototype.calculateVisibleRangeOnZooming=function(){var e,t,i;w0e(this)&&(e=this.actualRange,i=t=void 0,i=this.isAxisInverse?(t=this.actualRange.max-this.zoomPosition*this.actualRange.delta)-this.zoomFactor*this.actualRange.delta:(t=this.actualRange.min+this.zoomPosition*this.actualRange.delta)+this.zoomFactor*this.actualRange.delta,t<e.min&&(i+=e.min-t,t=e.min),i>e.max&&(t-=i-e.max,i=e.max),this.doubleRange=new Pme(t,i),this.visibleRange={min:this.doubleRange.start,max:this.doubleRange.end,delta:this.doubleRange.delta,interval:this.visibleRange.interval})},Aye.prototype.triggerRangeRender=function(e,t,i,n){t={cancel:!1,name:Gme,axis:this,minimum:t,maximum:i,interval:n};e.trigger(Gme,t),t.cancel||(this.visibleRange={min:t.minimum,max:t.maximum,interval:t.interval,delta:t.maximum-t.minimum})},Aye.prototype.getRangePadding=function(e){var t=this.rangePadding;if("Auto"===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},Aye.prototype.getMaxLabelWidth=function(p){for(var c,u,g,e,m=this,f=0,y=!1,v=(this.angle=this.labelRotation,this.maxLabelSize=new Eo(0,0),this.labelIntersectAction),b=this,t=0,i=this.visibleLabels.length;t<i;t++)!function(e){g=b.visibleLabels[e],(u=Eye(g.originalText))?(g.size=So(g.originalText.replace(/<br>/g," "),b.labelStyle,p.themeStyle.axisLabelFont),g.breakLabelSize=So(b.enableTrim?g.text.join("<br>"):g.originalText,b.labelStyle,p.themeStyle.axisLabelFont)):b.enableWrap?(n=p.initialClipRect.height/b.visibleLabels.length,g.text=pve(g.text,b.maximumLabelWidth,b.labelStyle,p.enableRtl,null,null,p.themeStyle.axisLabelFont,"Vertical"===b.orientation?n:null),i=t=0,g.text.forEach(function(e){e=So(e,m.labelStyle,p.themeStyle.axisLabelFont);t=Math.max(t,e.width),i+=e.height}),g.size.width=t,g.size.height=i):-90!==b.angle&&90!==b.angle&&270!==b.angle&&-270!==b.angle||"Vertical"!==b.orientation?g.size=So(g.text,b.labelStyle,p.themeStyle.axisLabelFont):g.size=kye(b.labelStyle,g.text,b.angle,p,p.themeStyle.axisLabelFont);var t,i,n=(u?g.breakLabelSize:g.size).width,n=(n>b.maxLabelSize.width&&(b.maxLabelSize.width=n,b.rotatedLabel=g.text),(u?g.breakLabelSize:g.size).height);if(n>b.maxLabelSize.height&&(b.maxLabelSize.height=n),u&&(g.text=b.enableTrim?g.text:g.originalText.split("<br>")),"None"===v||"Hide"===v||"Trim"===v)return;if(("None"!==v||b.angle%360==0)&&"Horizontal"===b.orientation&&0<b.rect.width&&!y){var o=(u?g.breakLabelSize:g.size).width;switch(c=Yye(g.value,b)*b.rect.width+b.rect.x,c-=o/2,"Shift"===b.edgeLabelPlacement&&(0===e&&c<b.rect.x&&(c=b.rect.x),e===b.visibleLabels.length-1)&&c+o>b.rect.x+b.rect.width&&(c=b.rect.x+b.rect.width-o),v){case"MultipleRows":0<e&&b.findMultiRows(e,c,g,u);break;case"Rotate45":case"Rotate90":0<e&&(b.isAxisInverse?f<=c+o:c<=f)&&(b.angle="Rotate45"===v?45:90,y=!0);break;default:if(u){for(var r,s,a=[],l=0;l<g.text.length;l++)if(1<(r=pve(g.text[l],b.rect.width/b.visibleLabels.length,b.labelStyle,p.enableRtl,null,null,p.themeStyle.axisLabelFont)).length)for(var h=0;h<r.length;h++)s=r[h],a.push(s);else a.push(r[0]);g.text=a}else g.text=pve(g.text,b.rect.width/b.visibleLabels.length,b.labelStyle,p.enableRtl,null,null,p.themeStyle.axisLabelFont);var d=g.size.height*g.text.length;d>b.maxLabelSize.height&&(b.maxLabelSize.height=d)}f=b.isAxisInverse?c:c+o}}(t);(0!==this.angle&&"Horizontal"===this.orientation||0!==this.angle&&"Vertical"===this.orientation)&&(this.rotatedLabel=je(this.rotatedLabel)?"":this.rotatedLabel,e=-360===this.angle||0===this.angle||-180===this.angle||180===this.angle||360===this.angle,"Outside"===this.labelPosition&&!e&&Eye(this.rotatedLabel)?this.maxLabelSize=new Eo(this.maxLabelSize.height,this.maxLabelSize.width):this.maxLabelSize=kye(this.labelStyle,this.rotatedLabel,this.angle,p,p.themeStyle.axisLabelFont)),p.multiLevelLabelModule&&0<this.multiLevelLabels.length&&p.multiLevelLabelModule.getMultilevelLabelsHeight(this)},Aye.prototype.findMultiRows=function(e,t,i,n){for(var o,r,s,a=[],l=e-1;0<=l;l--)o=this.visibleLabels[l],s=(n?o.breakLabelSize:o.size).width,r=Yye(o.value,this)*this.rect.width+this.rect.x,(this.isAxisInverse?t+i.size.width>r-.5*s:t<r+.5*s)?(a.push(o.index),i.index=i.index>o.index?i.index:o.index+1):i.index=(-1<a.indexOf(o.index)?i:o).index;e=(n?i.breakLabelSize:i.size).height*i.index+5*(i.index-1);e>this.maxLabelSize.height&&(this.maxLabelSize.height=e)},Aye.prototype.getModule=function(e){"Double"===this.valueType?this.baseModule=new Fme(e):this.baseModule=e[l0e(this.valueType)+"Module"]},Aye.prototype.setIsInversedAndOpposedPosition=function(e){void 0===e&&(e=!1),this.isAxisOpposedPosition=this.opposedPosition||!e&&this.isRTLEnabled&&"Vertical"===this.orientation,this.opposedPosition&&!e&&this.isRTLEnabled&&"Vertical"===this.orientation&&(this.isAxisOpposedPosition=!1),this.isAxisInverse=this.isInversed||this.isRTLEnabled&&"Horizontal"===this.orientation,this.isInversed&&!e&&this.isRTLEnabled&&"Horizontal"===this.orientation&&(this.isAxisInverse=!1)},Aye.prototype.updateAxis=function(){var e=this.baseModule.chart,t=e.chartAxisLayoutPanel,i=e.axisCollections.indexOf(this),n=ie(e.element.id+"AxisInsideCollection"),o=ie(e.element.id+"AxisOutsideCollection"),r=(t.element=e.renderer.createGroup({id:e.element.id+"AxisGroup"+i+"Inside"}),e.renderer.createGroup({id:e.element.id+"AxisGroup"+i+"Outside"})),s=t.findAxisPosition(this);t.drawAxis(this,i,s,r,n,o),e.enableCanvas||O0e(e.enableCanvas,n,t.element,e.redraw)},Jfe([t({fontFamily:null,size:"12px",fontStyle:"Normal",fontWeight:"400",color:null},Tge)],Aye.prototype,"labelStyle",void 0),Jfe([t({},bye)],Aye.prototype,"crosshairTooltip",void 0),Jfe([e("")],Aye.prototype,"title",void 0),Jfe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},Tge)],Aye.prototype,"titleStyle",void 0),Jfe([e("")],Aye.prototype,"labelFormat",void 0),Jfe([e("")],Aye.prototype,"skeleton",void 0),Jfe([e("DateTime")],Aye.prototype,"skeletonType",void 0),Jfe([e("Center")],Aye.prototype,"lineBreakAlignment",void 0),Jfe([e(0)],Aye.prototype,"plotOffset",void 0),Jfe([e(null)],Aye.prototype,"plotOffsetLeft",void 0),Jfe([e(null)],Aye.prototype,"plotOffsetTop",void 0),Jfe([e(null)],Aye.prototype,"plotOffsetRight",void 0),Jfe([e(null)],Aye.prototype,"plotOffsetBottom",void 0),Jfe([e(!1)],Aye.prototype,"isIndexed",void 0),Jfe([e(10)],Aye.prototype,"logBase",void 0),Jfe([e(0)],Aye.prototype,"columnIndex",void 0),Jfe([e(0)],Aye.prototype,"rowIndex",void 0),Jfe([e(1)],Aye.prototype,"span",void 0),Jfe([e(null)],Aye.prototype,"desiredIntervals",void 0),Jfe([e(3)],Aye.prototype,"maximumLabels",void 0),Jfe([e(1)],Aye.prototype,"zoomFactor",void 0),Jfe([e(0)],Aye.prototype,"zoomPosition",void 0),Jfe([e(!0)],Aye.prototype,"enableScrollbarOnZooming",void 0),Jfe([e(!1)],Aye.prototype,"opposedPosition",void 0),Jfe([e(!0)],Aye.prototype,"enableAutoIntervalOnZooming",void 0),Jfe([e("Auto")],Aye.prototype,"rangePadding",void 0),Jfe([e("Double")],Aye.prototype,"valueType",void 0),Jfe([e("Shift")],Aye.prototype,"edgeLabelPlacement",void 0),Jfe([e("Auto")],Aye.prototype,"intervalType",void 0),Jfe([e("BetweenTicks")],Aye.prototype,"labelPlacement",void 0),Jfe([e("Outside")],Aye.prototype,"tickPosition",void 0),Jfe([e("Outside")],Aye.prototype,"labelPosition",void 0),Jfe([e("")],Aye.prototype,"name",void 0),Jfe([e(!0)],Aye.prototype,"visible",void 0),Jfe([e(0)],Aye.prototype,"minorTicksPerInterval",void 0),Jfe([e(0)],Aye.prototype,"labelRotation",void 0),Jfe([e(null)],Aye.prototype,"titleRotation",void 0),Jfe([e(null)],Aye.prototype,"crossesAt",void 0),Jfe([e(!0)],Aye.prototype,"placeNextToAxisLine",void 0),Jfe([e(null)],Aye.prototype,"crossesInAxis",void 0),Jfe([e(null)],Aye.prototype,"minimum",void 0),Jfe([e(null)],Aye.prototype,"maximum",void 0),Jfe([e(null)],Aye.prototype,"interval",void 0),Jfe([e(34)],Aye.prototype,"maximumLabelWidth",void 0),Jfe([e(!1)],Aye.prototype,"enableTrim",void 0),Jfe([e(!1)],Aye.prototype,"enableWrap",void 0),Jfe([e(5)],Aye.prototype,"labelPadding",void 0),Jfe([e(5)],Aye.prototype,"titlePadding",void 0),Jfe([t({},uye)],Aye.prototype,"majorTickLines",void 0),Jfe([t({},fye)],Aye.prototype,"minorTickLines",void 0),Jfe([t({},oye)],Aye.prototype,"majorGridLines",void 0),Jfe([t({},aye)],Aye.prototype,"minorGridLines",void 0),Jfe([t({},dye)],Aye.prototype,"lineStyle",void 0),Jfe([e(F.isDevice?"Rotate45":"Trim")],Aye.prototype,"labelIntersectAction",void 0),Jfe([e(!1)],Aye.prototype,"isInversed",void 0),Jfe([e(100)],Aye.prototype,"coefficient",void 0),Jfe([e(0)],Aye.prototype,"startAngle",void 0),Jfe([e(!0)],Aye.prototype,"startFromZero",void 0),Jfe([e(null)],Aye.prototype,"description",void 0),Jfe([e(2)],Aye.prototype,"tabIndex",void 0),Jfe([kt([],Ffe)],Aye.prototype,"stripLines",void 0),Jfe([kt([],Ofe)],Aye.prototype,"multiLevelLabels",void 0),Jfe([t({color:null,width:0,type:"Rectangle"},Efe)],Aye.prototype,"border",void 0),Jfe([t({},jfe)],Aye.prototype,"scrollbarSettings",void 0);var Cye,Sye=Aye;function Aye(e,t,i,n){e=Cye.call(this,e,t,i,n)||this;return e.visibleLabels=[],e.series=[],e.rect=new Do(void 0,void 0,0,0),e.axisBottomLine=null,e.intervalDivs=[10,5,2,1],e.isStack100=!1,e.crossAt=null,e.updatedRect=null,e.multiLevelLabelHeight=0,e.isChart=!0,e.isIntervalInDecimal=!0,e.titleCollection=[],e.titleSize=new Eo(0,0),e.internalVisibility=!0,e.isRTLEnabled=!1,e.angle=e.labelRotation,e}var xye,Iye=function(e,t,i,n,o,r,s){void 0===o&&(o=new Eo(0,0)),void 0===r&&(r=new Eo(0,0)),void 0===s&&(s=1),this.text=e,this.originalText=n,this.value=t,this.labelStyle=i,this.size=o,this.breakLabelSize=r,this.index=s},Afe=(xye=function(e,t){return(xye=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])}))(e,t)},function(e,t){function i(){this.constructor=e}xye(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});function Tye(e,r,s){for(var t=Pe([],e,null),i=0;i<t.length;i++)for(var n=0;n<r.length;n++)t[i][r[n]]instanceof Date&&(t[i][r[n]]=t[i][r[n]].getTime());return t.sort(function(e,t){for(var i=0,n=0,o=0;o<r.length;o++)i+=e[r[o]],n+=t[r[o]];return!s&&i<n||s&&n<i?-1:i===n?0:1}),t}function Eye(e){return-1!==e.indexOf("<br>")}function Dye(e){for(var t,i=Pe([],e.points,null,!0),n=[],o=0,r=0;r<i.length;r++)je((t=i[r]).x)||(t.index=o++,n.push(t));return n}function Mye(e,t){var i,n=e.component,o=0,r=0,s="Top"===n.titleStyle.position||"Bottom"===n.titleStyle.position&&!n.legendSettings.visible?15:5;return n.title&&(o=So(n.title,n.titleStyle,n.themeStyle.chartTitleFont).height*n.titleCollection.length+s,n.subTitle)&&(r=So(n.subTitle,n.subTitleStyle,n.themeStyle.chartSubTitleFont).height*n.subTitleCollection.length),t?"Top"===e.axis.scrollbarSettings.position?(i=n.margin.top+5+(e.height+5)*n.scrollBarModule.topScrollBarCount+("Top"===n.titleStyle.position?o+n.titleStyle.border.width:0)+("Top"===n.subTitleStyle.position?n.subTitleStyle.border.width+r:0),n.scrollBarModule.topScrollBarCount++):"Bottom"===e.axis.scrollbarSettings.position&&(i=n.availableSize.height-((e.height+5)*n.scrollBarModule.bottomScrollBarCount+e.height+n.margin.bottom+5+("Bottom"===n.titleStyle.position?o+n.titleStyle.border.width:0)+("Bottom"===n.subTitleStyle.position?n.subTitleStyle.border.width+r:0)),n.scrollBarModule.bottomScrollBarCount++):"Right"===e.axis.scrollbarSettings.position?(i=n.availableSize.width-((e.height+5)*n.scrollBarModule.rightScrollBarCount+e.height+5+n.margin.right+("Right"===n.titleStyle.position?o+n.titleStyle.border.width:0)+("Right"===n.subTitleStyle.position?n.subTitleStyle.border.width+r:0)),n.scrollBarModule.rightScrollBarCount++):"Left"===e.axis.scrollbarSettings.position&&(i=n.margin.left+5+(e.height+5)*n.scrollBarModule.leftScrollBarCount+("Left"===n.titleStyle.position?o+n.titleStyle.border.width:0)+("Left"===n.subTitleStyle.position?n.subTitleStyle.border.width+r:0),n.scrollBarModule.leftScrollBarCount++),i}function kye(e,t,i,n,o){var r,s,a=n.element.style.transform,l=(a&&(n.element.style.transform=""),new fo(n.element.id)),h=[],d={id:"rotate_text",x:n.initialClipRect.x,y:n.initialClipRect.y,"font-size":e.size||o.size,"font-style":e.fontStyle||o.fontStyle,"font-family":e.fontFamily,"font-weight":e.fontWeight||o.fontWeight,transform:"rotate("+i+", 0, 0)","text-anchor":"middle"},o=Eye(t)?(h=t.split("<br>"))[0]:t,p=l.createText(d,o);if(n.delayRedraw||n.redraw||n.stockChart||n.element.appendChild(n.svgObject),"string"!=typeof h&&1<h.length)for(var c=1,u=h.length;c<u;c++)s=So(h[c],e,n.themeStyle.axisLabelFont).height,r=h[c],s=l.createTSpan({x:d.x,id:d.id,y:d.y+c*s},r),p.appendChild(s);var o=n.svgRenderer.createSvg({id:"AxisLabelMax_svg",width:n.availableSize.width,height:n.availableSize.height}),g=(document.body.appendChild(o),o.appendChild(p),p.getBoundingClientRect());return a&&(n.element.style.transform=a),ue(o),n.delayRedraw||n.redraw||n.stockChart||n.pointsAdded||ue(n.svgObject),n.enableCanvas?(a=So(t,e,n.themeStyle.axisLabelFont).width,o=So(t,e,n.themeStyle.axisLabelFont).height,t=i*Math.PI/180,i=Math.abs(Math.cos(t)*a)+Math.abs(Math.sin(t)*o),a=Math.abs(Math.sin(t)*a)+Math.abs(Math.cos(t)*o),new Eo(i,a)):new Eo(g.right-g.left,g.bottom-g.top)}function Pye(e){if(!e)return null;e="string"==typeof e?ie(e):e;e&&ue(e)}function Bye(e,t){return Math.log(e)/Math.log(t)}function Fye(e,t,i,n,o,r,s,a,l){var h=document.getElementById(o),d=So(e,{fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"Regular"}),p=d.width+5;t=n<t+p?t-(p+15):t,l&&t<l.x&&(t=l.x),i=a?i-d.height/2:i+15,h?(h.innerText=e,h.style.top=i.toString()+"px",h.style.left=(t+15).toString()+"px"):((h=Q("div",{id:o,styles:"top:"+i.toString()+"px;left:"+(t+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"'})).innerText=e,r.appendChild(h),parseInt(h.style.left.replace("px",""),10)<0&&(h.style.left="0px")),s&&setTimeout(function(){Pye(o)},1500)}function Lye(e,t){return e<t.max&&e>t.min}function Rye(e,t){return e<=t.max&&e>=t.min}function Oye(e,t){return"Logarithmic"===t.valueType?Bye(e,t.logBase):e}function Nye(e,t,i,n){var o;return!(!n.chart.zoomModule||!n.chart.zoomSettings.enableAnimation)||(t=Oye(t.xValue,n.xAxis),e=e?Oye(e.xValue,n.xAxis):t,i=i?Oye(i.xValue,n.xAxis):t,o=Math.floor(n.xAxis.visibleRange.min),n=Math.ceil(n.xAxis.visibleRange.max),o<=e&&e<=n)||o<=t&&t<=n||o<=i&&i<=n||e<=o&&o<=i}function Vye(e){for(var t=0,i=0,n=e;i<n.length;i++)t+=n[i];return t}function _ye(e,t,i,n,o){var r=0,s=0;if(null!==n)for(var a=t+1;a<i;a++)-1===n.indexOf(a)&&(a===o.intermediateSumIndexes[s]||o.intermediateSumIndexes[o.intermediateSumIndexes.length-1]<a)&&(r+=e[a][o.yName],a===o.intermediateSumIndexes[s])&&(s+=1);else for(a=t+1;a<i;a++)je(e[a][o.yName])||je(o.sumIndexes)||-1!==o.sumIndexes.indexOf(a)||(r+=e[a][o.yName]);return r}function Hye(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 zye(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 jye(e,t,i){e=e*Math.PI/180;return new Tve(Math.cos(e)*t+i.x,Math.sin(e)*t+i.y)}function Wye(e){return e*(Math.PI/180)}function Qye(e,t,i,n){for(var o=[],r=0;r<4;r++){var s=e[r],a=s.x-t,l=s.y-i,h=a*Math.cos(Wye(n))-l*Math.sin(Wye(n)),a=a*Math.sin(Wye(n))+l*Math.cos(Wye(n));s.x=h+t,s.y=a+i,o.push(new Tve(s.x,s.y))}return o}function Uye(e,t){for(var i,n,o,r,s=[e,t],a=0;a<s.length;a++)for(var l=s[a],h=0;h<l.length;h++){for(var d=(h+1)%l.length,p=l[h],d=l[d],c=new Tve(d.y-p.y,p.x-d.x),u=i=void 0,g=0;g<e.length;g++)n=c.x*e[g].x+c.y*e[g].y,(je(u)||n<u)&&(u=n),(je(i)||i<n)&&(i=n);for(o=r=void 0,g=0;g<t.length;g++)n=c.x*t[g].x+c.y*t[g].y,(je(o)||n<o)&&(o=n),(je(r)||r<n)&&(r=n);if(i<o||r<u)return!1}return!0}function qye(e,t){t=Math.atan2(t.y-e.y,t.x-e.x);return(t<0?6.283+t:t)*(180/Math.PI)}function Gye(e,t){for(var i=[],n=0;n<=t-1;n++)i.push(e[n]);return i}function Yye(e,t){var i=t.visibleRange,e=(e-i.min)/i.delta;return(t.isChart?t.isAxisInverse:t.isInversed)?1-e:e}function Xye(e,t,i,n,o,r){e="Logarithmic"===i.valueType?Bye(1<e?e:1,i.logBase):e,t="Logarithmic"===n.valueType?Bye(1<t?t:1,n.logBase):t,e+="Category"===i.valueType&&"BetweenTicks"===i.labelPlacement&&"Radar"!==r.type?.5:0;t=r.chart.radius*Yye(t,n),n=Jye(Zye(e,i),r.chart.primaryXAxis.startAngle);return{x:r.clipRect.width/2+r.clipRect.x+t*n.x,y:r.clipRect.height/2+r.clipRect.y+t*n.y}}function Kye(e,t){void 0===t&&(t=!1);var i=["NaN","NaN"];return-1<e.indexOf("_polygon")?i=["NaN","NaN"]:-1<e.indexOf("_Point_")?i=e.split("_Series_")[1].split("_Point_"):-1<e.indexOf("_shape_")&&(!t||-1===e.indexOf("_legend_"))?(i=e.split("_shape_"))[0]="0":-1<e.indexOf("_text_")&&(!t||-1===e.indexOf("_legend_"))?(i=e.split("_text_"))[0]="0":-1<e.indexOf("_datalabel_")?(i=e.split("_datalabel_")[1].split("_g_"))[0]=i[0].replace("Series_",""):-1<e.indexOf("TextGroup")?(i=e.split("TextGroup"))[0]=i[1]:-1<e.indexOf("ShapeGroup")&&((i=e.split("ShapeGroup"))[0]=i[1]),new kme(parseInt(i[0],10),parseInt(i[1],10))}function Jye(e,t){t=t<0?t+360:t;e=Math.PI*(1.5-2*e);return e+=t*Math.PI/180,{x:Math.cos(e),y:Math.sin(e)}}function Zye(e,t){var i,n,o=t.visibleRange;return"Category"!==t.valueType?(i=o.max-("DateTime"===t.valueType?t.dateTimeInterval:o.interval)-o.min,n=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,n=t.visibleLabels.length),t.isAxisInverse?(e-o.min)/i*(1-1/n):1-(e-o.min)/i*(1-1/n)}var $ye=function(e,t,i,n,o,r){this.verticalStandardMean=e,this.horizontalStandardMean=i,this.verticalSquareRoot=t,this.horizontalSquareRoot=n,this.verticalMean=o,this.horizontalMean=r},e0e=function(e,t,i,n,o){this.startAngle=e,this.endAngle=t,this.innerRadius=i,this.radius=n,this.currentXPosition=o};function t0e(e,t,i,n,o){var r=ie(e),i="top:"+i.toString()+"px;left:"+n.toString()+"px;color:black !important; background:#FFFFFF !important; position:absolute;border:1px solid #707070;font-size:"+o+";border-radius:2px; z-index:1";r?(r.setAttribute("innerHTML","&nbsp;"+t+"&nbsp;"),r.style.cssText=i):(r=Q("div",{id:e,innerHTML:"&nbsp;"+t+"&nbsp;",styles:i}),document.body.appendChild(r))}function i0e(e,t,i,n,o,r){for(var s,a,l,h=t.isAxisOpposedPosition,d=e.enableRtl?"end":o?"start":"auto",p=e.availableSize.width,c=t.scrollbarSettings.enable||t.zoomingScrollBar&&t.zoomingScrollBar.svgObject?t.scrollBarHeight:0,u=e.enableRtl&&!o&&!t.isInversed||t.isInversed&&!(e.enableRtl&&!o),g=0;g<2;g++){var m,f=So(g?u?t.startLabel:t.endLabel:u?t.endLabel:t.startLabel,t.labelStyle,e.themeStyle.axisLabelFont),y=o?(l=g?new Tve(r.x-c,r.y+3):new Tve(t.rect.x-c,r.y+r.height-3),s=r.x+(h?r.width+5+c:-(f.width+5+5+c)),a=r.y+(g?0:r.height-f.height-5),s+=s<0||p<s+f.width+5?h?-f.width/2:f.width/2:0,n0e(3,3,new Do(s,a,f.width+5,f.height+5),l,5,!1,!1,!h,l.x,l.y+(g?-3:3))):(l=new Tve(g?r.x+r.width-3:r.x+3,r.y+r.height+c),s=r.x+(g?r.width-f.width-5:0),a=h?r.y-f.height-10-c:r.y+r.height+5+c,n0e(3,3,new Do(s,a,f.width+5,f.height+5),l,5,h,!h,!1,l.x+(g?3:-3),l.y));s+=2.5,a=a+f.height/4*3+2.5,f=e.renderer.drawPath({id:e.element.id+"_Zoom_"+n+"_AxisLabel_Shape_"+g,fill:e.themeStyle.crosshairFill,width:2,color:e.themeStyle.crosshairFill,opacity:1,"stroke-dasharray":null,d:y},null),i.appendChild(f),"Fluent"!==e.theme&&"FluentDark"!==e.theme||(y=e.element.id+"_shadow",f.setAttribute("filter",F.isIE?"":"url(#"+y+")"),y='<filter id="'+y+'" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="3"/>',y+='<feOffset dx="3" dy="3" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="0.5"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>',(m=e.renderer.createDefs()).setAttribute("id",e.element.id+"SVG_tooltip_definition"),i.appendChild(m),m.innerHTML=y,f.setAttribute("stroke","#cccccc"),f.setAttribute("stroke-width","0.5")),sve(e.renderer,new ko(e.element.id+"_Zoom_"+n+"_AxisLabel_"+g,s,a,d,g?u?t.startLabel:t.endLabel:u?t.endLabel:t.startLabel),{color:e.themeStyle.crosshairLabelFont.color,fontFamily:"Segoe UI",fontWeight:"Regular",size:"11px"},e.themeStyle.crosshairLabelFont.color,i,null,null,null,null,null,null,0,null,null,null,e.themeStyle.crosshairLabelFont)}return i}function n0e(e,t,i,n,o,r,s,a,l,h){var d="",p=i.x,c=i.y,u=i.x+i.width,i=i.y+i.height;return d=r?(d=(d=(d=d.concat("M "+p+" "+(c+t)+" Q "+p+" "+c+" "+(p+e)+" "+c)).concat(" L "+(u-e)+" "+c+" Q "+u+" "+c+" "+u+" "+(c+t))).concat(" L "+u+" "+(i-t)+" Q "+u+" "+i+" "+(u-e)+" "+i),0!==o&&(d=(d=d.concat(" L "+(n.x+o/2)+" "+i)).concat(" L "+l+" "+(i+o)+" L "+(n.x-o/2)+" "+i)),n.x-o/2>p||0===o?d.concat(" L "+(p+e)+" "+i+" Q "+p+" "+i+" "+p+" "+(i-t)+" z"):d.concat(" L "+p+" "+(i+t)+" z")):s?(d=(d=(d=(d=(d=d.concat("M "+p+" "+(c+t)+" Q "+p+" "+c+" "+(p+e)+" "+c+" L "+(n.x-o/2)+" "+c)).concat(" L "+l+" "+n.y)).concat(" L "+(n.x+o/2)+" "+c)).concat(" L "+(u-e)+" "+c+" Q "+u+" "+c+" "+u+" "+(c+t))).concat(" L "+u+" "+(i-t)+" Q "+u+" "+i+" "+(u-e)+" "+i)).concat(" L "+(p+e)+" "+i+" Q "+p+" "+i+" "+p+" "+(i-t)+" z"):a?(d=(d=(d=(d=(d=d.concat("M "+p+" "+(c+t)+" Q "+p+" "+c+" "+(p+e)+" "+c)).concat(" L "+(u-e)+" "+c+" Q "+u+" "+c+" "+u+" "+(c+t)+" L "+u+" "+(n.y-o/2))).concat(" L "+(u+o)+" "+h)).concat(" L "+u+" "+(n.y+o/2))).concat(" L "+u+" "+(i-t)+" Q "+u+" "+i+" "+(u-e)+" "+i)).concat(" L "+(p+e)+" "+i+" Q "+p+" "+i+" "+p+" "+(i-t)+" z"):(d=(d=(d=(d=(d=d.concat("M "+(p+e)+" "+c+" Q "+p+" "+c+" "+p+" "+(c+t)+" L "+p+" "+(n.y-o/2))).concat(" L "+(p-o)+" "+h)).concat(" L "+p+" "+(n.y+o/2))).concat(" L "+p+" "+(i-t)+" Q "+p+" "+i+" "+(p+e)+" "+i)).concat(" L "+(u-e)+" "+i+" Q "+u+" "+i+" "+u+" "+(i-t))).concat(" L "+u+" "+(c+t)+" Q "+u+" "+c+" "+(u-e)+" "+c+" z")}function o0e(e,t,i,n,o){return void 0===o&&(o=0),e>=i.x-(n=void 0===n?0:n)&&e<=i.x+i.width+n&&t>=i.y-o&&t<=i.y+i.height+o}function r0e(e,t,i){return(i.isAxisInverse?1-e/t:e/t)*i.visibleRange.delta+i.visibleRange.min}function s0e(e,t,i){return(i.isAxisInverse?e/t:1-e/t)*i.visibleRange.delta+i.visibleRange.min}function a0e(e,t){var i=e.clipRect;!(t=void 0===t?!1:t)||"Polar"!==e.type&&"Radar"!==e.type?e.chart.requireInvertedAxis?(i.x=e.yAxis.rect.x,i.y=e.xAxis.rect.y,i.width=e.yAxis.rect.width,i.height=e.xAxis.rect.height):(i.x=e.xAxis.rect.x,i.y=e.yAxis.rect.y,i.width=e.xAxis.rect.width,i.height=e.yAxis.rect.height):("Scatter"===e.drawType?(i.x=e.xAxis.rect.x,i.y=e.yAxis.rect.y):(i.x=e.xAxis.rect.x/2,i.y=e.yAxis.rect.y/2),i.width=e.xAxis.rect.width,i.height=e.yAxis.rect.height)}function l0e(e){return e.substr(0,1).toLowerCase()+e.substr(1)}function h0e(e,t,i){var n,o,r,i=(i?(n=t.rect.x,o=e.rect.y,r=t.rect.width,e):(n=e.rect.x,o=t.rect.y,r=e.rect.width,t)).rect.height;return new Do(n,o,r,i)}function d0e(e,t){for(var i=Number.MAX_VALUE,n=[],o=0;o<t.length;o++){var r=t[o],s=[];if(r.visible&&(e.name===r.xAxisName||"primaryXAxis"===e.name&&null===r.xAxisName||e.name===r.chart.primaryXAxis.name&&!r.xAxisName))if(-1<r.type.indexOf("Stacking")&&-1===n.indexOf(r.stackingGroup)&&n.push(r.stackingGroup),(s=r.points.map(function(e){return e.xValue})).sort(function(e,t){return e-t}),1===s.length){var a,l=1===t.length?2592e4:2592e6,l="DateTime"===e.valueType&&r.xMin===r.xMax?r.xMin-l:r.xMin;0!==(a=s[0]-(je(l)?e.visibleRange.min:l))&&(i=Math.min(i,a))}else for(var h=0;h<s.length;h++){var d=s[h];0<h&&d&&0!==(a=-1<r.type.indexOf("Stacking")&&"Category"===e.valueType?n.length:d-s[h-1])&&(i=Math.min(i,a))}}return i=i===Number.MAX_VALUE?1:i}function p0e(e){var t;return t="Linear"===e?c0e:t}function c0e(e,t,i,n){return-i*Math.cos(e/n*(Math.PI/2))+i+t}function u0e(i,e,t,n,o,r,s){var a=!!n.accumulation,l=(i.style.visibility="hidden",i.getAttribute("transform"));new Vt({}).animate(i,{duration:t,delay:e,progress:function(e){var t;e.timeStamp>e.delay&&(e.element.style.visibility="visible"),(a?-1<e.element.id.indexOf("_datalabel_Series_"):-1<e.element.parentElement.parentElement.id.indexOf("DataLabel")&&(!n.chart.stackLabels.visible||!i.getAttribute("data-collide")))&&(e.element.style.visibility="visible",t=(a?n:n.marker.dataLabel).opacity,e=e.timeStamp/500*t,(a?i:(n.textElement.setAttribute("opacity",Math.min(e,t).toString()),n.shapeElement)).setAttribute("opacity",Math.min(e,t).toString()))},end:function(){var e=document.getElementById(n.chart.element.id+"_Annotation_Collections");e&&"Line"!==n.type&&(e.style.visibility="visible"),(-1<i.parentElement.parentElement.id.indexOf("DataLabel")||-1<i.id.indexOf("_datalabel_Series_"))&&(a?i.setAttribute("opacity",n.opacity.toString()):(n.textElement.setAttribute("opacity",n.marker.dataLabel.opacity.toString()),n.shapeElement.setAttribute("opacity",n.marker.dataLabel.opacity.toString()))),n.chart.stackLabels.visible&&i.getAttribute("data-collide")||(i.style.visibility=""),i.setAttribute("transform",l||""),"Scatter"!==n.type&&"Bubble"!==n.type||s||o!==n.points.length-1||n.chart.trigger("animationComplete",{series:n.chart.isBlazor?{}:n})}})}function g0e(t,e,i,n,o){function r(e){t.setAttribute("x",e.x+""),t.setAttribute("y",e.y+""),t.setAttribute("width",e.width+""),t.setAttribute("height",e.height+"")}new Vt({}).animate(Q("div"),{duration:i,delay:e,progress:function(e){r(new Do(c0e(e.timeStamp,o.x,n.x-o.x,e.duration),c0e(e.timeStamp,o.y,n.y-o.y,e.duration),c0e(e.timeStamp,o.width,n.width-o.width,e.duration),c0e(e.timeStamp,o.height,n.height-o.height,e.duration)))},end:function(){r(n)}})}function m0e(e,t,i,n,o){if(!i||!n&&!e)return null;var r,s,a,l,h,i=300,o=(je(o)||(i=o),n||e.getAttribute("d")),d=o.split(/(?=[LMCZAQ])/),p=t.split(/(?=[LMCZAQ])/);e.setAttribute("d",o),new Vt({}).animate(Q("div"),{duration:i,progress:function(i){r="",d.map(function(e,t){if(s=e.split(" "),a=p[t]?p[t].split(" "):s,"Z"===s[0]?r+="Z ":""===s[0]?r="":r+=s[0]+" "+c0e(i.timeStamp,+s[1],+a[1]-+s[1],i.duration)+" "+c0e(i.timeStamp,+s[2],+a[2]-+s[2],i.duration)+" ","C"===s[0]||"Q"===s[0])for(l=3,h="Q"===s[0]?4:6;l<h;)r+=c0e(i.timeStamp,+s[l],+a[l]-+s[l],i.duration)+" "+c0e(i.timeStamp,+s[++l],+a[l]-+s[l],i.duration)+" ",++l;"A"===s[0]&&(r+="0 0 1 "+c0e(i.timeStamp,+s[6],+a[6]-+s[6],i.duration)+" "+c0e(i.timeStamp,+s[7],+a[7]-+s[7],i.duration)+" ")}),e.setAttribute("d",r)},end:function(){e.setAttribute("d",t)}})}function f0e(u,e,t,i,n,o){if(!t||!i&&!u)return null;var g=300,m=(je(n)||(g=n),i||u.getAttribute("d")),f=e,y="";u.setAttribute("d",m),new Vt({}).animate(Q("div"),{duration:g,progress:function(e){y="";for(var t=m.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),i=f.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),n=Math.max(t.length,i.length),o=0;o<n;o++){for(var r=t[o]||"",s=i[o]||"",a=r.trim().split(/\s+/),l=s.trim().split(/\s+/),h=[],d=1;d<a.length;d++){var p=parseFloat(a[d]),c=parseFloat(l[d]);isNaN(p)||isNaN(c)||a.length!==l.length||(c=c0e(e.timeStamp,p,c-p,g),h.push(c))}a.length!==l.length?y+="L":y+=a[0],y=y+(" "+h.join(" "))+" "}u.setAttribute("d",y)},end:function(){u.setAttribute("d",o||e)}})}function y0e(e,t,i,n){void 0===n&&(n="drawClipPath");var o,e=nve(e,t.id,t,i);return e?((o=i.createDefs()).appendChild(e),o):i[n](t)}function v0e(e,t,i,n,o){i={cancel:!1,name:Ume,axis:o,text:i,value:t,labelStyle:n};e.trigger(Ume,i),i.cancel||(t=-1!==i.text.indexOf("<br>"),n=o.enableTrim?t?tve(o.maximumLabelWidth,i.text,o.labelStyle,e.themeStyle.axisLabelFont):eve(o.maximumLabelWidth,i.text,o.labelStyle,e.enableRtl,e.themeStyle.axisLabelFont):i.text,o.visibleLabels.push(new Iye(n,i.value,i.labelStyle,i.text)))}function b0e(e){return null!=e.minimum&&null!=e.maximum}function w0e(e){return e.zoomFactor<1&&0<=e.zoomPosition}function C0e(e,t){var i,e="Horizontal"===t.orientation?e.width:e.height;return je(t.desiredIntervals)?(i=("Horizontal"===t.orientation?.533:1)*t.maximumLabels,Math.max(e*(i/100),1)):t.desiredIntervals}function S0e(e,t,i,n,o){new Vt({}).animate(e,{duration:i,delay:t,name:n,progress:function(e){e.element.style.visibility="visible"},end:function(e){o?ue(e.element):e.element.style.visibility="visible"}})}function A0e(e,t,i,n,o,r,s,a,l,h){s=s||new fo(""),e=x0e(e,i,t,o,n,l,h);return s["draw"+e.functionName](e.renderOption,a?new Int32Array([a.x,a.y]):null)}function x0e(e,t,i,n,o,r,s){var a,l,h,d="Path",p=r&&"Circle"===i?t.width-2:t.width,c=r&&"Circle"===i?t.height-2:t.height,u=r?s.targetWidth:0,g=e.x,m=e.y,f=e.y+-c/2,y=e.x+-p/2;switch(i){case"Bubble":case"Circle":d="Ellipse",I(n,{rx:p/2,ry:c/2,cx:g,cy:m});break;case"Plus":I(n,{d:a="M "+y+" "+m+" L "+(g+p/2)+" "+m+" M "+g+" "+(m+c/2)+" L "+g+" "+(m+-c/2)});break;case"Cross":I(n,{d:a="M "+y+" "+(m+-c/2)+" L "+(g+p/2)+" "+(m+c/2)+" M "+y+" "+(m+c/2)+" L "+(g+p/2)+" "+(m+-c/2)});break;case"Multiply":I(n,{d:a="M "+(g-u)+" "+(m-u)+" L "+(g+u)+" "+(m+u)+" M "+(g-u)+" "+(m+u)+" L "+(g+u)+" "+(m-u),stroke:n.fill});break;case"HorizontalLine":I(n,{d:a="M "+y+" "+m+" L "+(g+p/2)+" "+m});break;case"VerticalLine":I(n,{d:a="M "+g+" "+(m+c/2)+" L "+g+" "+(m+-c/2)});break;case"Diamond":I(n,{d:a="M "+y+" "+m+" L "+g+" "+(m+-c/2)+" L "+(g+p/2)+" "+m+" L "+g+" "+(m+c/2)+" L "+y+" "+m+" z"});break;case"ActualRect":I(n,{d:a="M "+y+" "+(m+-c/8)+" L "+(g+u)+" "+(m+-c/8)+" L "+(g+u)+" "+(m+c/8)+" L "+y+" "+(m+c/8)+" L "+y+" "+(m+-c/8)+" z"});break;case"TargetRect":I(n,{d:a="M "+(y+u)+" "+(m+-c/2)+" L "+(g+u/2)+" "+(m+-c/2)+" L "+(g+u/2)+" "+(m+c/2)+" L "+(y+u)+" "+(m+c/2)+" L "+(y+u)+" "+(m+-c/2)+" z"});break;case"Rectangle":case"Hilo":case"HiloOpenClose":case"Candle":case"Waterfall":case"BoxAndWhisker":case"StepArea":case"RangeStepArea":case"StackingStepArea":case"Square":case"Flag":I(n,{d:a="M "+y+" "+(m+-c/2)+" L "+(g+p/2)+" "+(m+-c/2)+" L "+(g+p/2)+" "+(m+c/2)+" L "+y+" "+(m+c/2)+" L "+y+" "+(m+-c/2)+" z"});break;case"Pyramid":case"Triangle":I(n,{d:a="M "+y+" "+(m+c/2)+" L "+g+" "+(m+-c/2)+" L "+(g+p/2)+" "+(m+c/2)+" L "+y+" "+(m+c/2)+" z"});break;case"Funnel":case"InvertedTriangle":I(n,{d:a="M "+(g+p/2)+" "+(m-c/2)+" L "+g+" "+(m+c/2)+" L "+(g-p/2)+" "+(m-c/2)+" L "+(g+p/2)+" "+(m-c/2)+" z"});break;case"Pentagon":for(var v=0;v<=5;v++)l=p/2*Math.cos(Math.PI/180*(72*v)),h=c/2*Math.sin(Math.PI/180*(72*v)),a=0===v?"M "+(g+l)+" "+(m+h)+" ":a.concat("L "+(g+l)+" "+(m+h)+" ");I(n,{d:a=a.concat("Z")});break;case"Image":d="Image",I(n,{href:o,height:c,width:p,x:y,y:f});break;case"Star":for(var b=Math.min(p,c)/2,w=b/2,C=Math.PI/5,S="",v=0;v<10;v++){var A=v%2==0?b:w;S+=(0===v?"M":"L")+(g+A*Math.cos(v*C-Math.PI/2))+","+(m+A*Math.sin(v*C-Math.PI/2))}I(n,{d:S+="Z"})}return{renderOption:n=$0e(e,new Eo(p,c),i,n).renderOption,functionName:d}}function I0e(e,t,i){var n=t.x<i.x?i.x:t.x>i.x+i.width?i.x+i.width:t.x,i=t.y<i.y?i.y:t.y>i.y+i.height?i.y+i.height:t.y;return new Do(n>e.x?e.x:n,i>e.y?e.y:i,Math.abs(n-e.x),Math.abs(i-e.y))}function T0e(e,t,i){return i<e?i:e<t?t:e}function ie(e){return document.getElementById(e)}function E0e(t){var i=null;try{i="function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){i=oo(t)}return i}function D0e(e,t,i,n,o,r,s,a,l,h){var d=e.getBoundingClientRect();t.accumulationDataLabelModule.calculateLabelSize(i,e,r,n,o,s,a,l,h,d,!0)}function M0e(e,t,i,n,o,r){var s=document.getElementById(t.element.id+"_Series_"+(void 0===n.index?n.category:n.index)+"_DataLabelCollections");s&&(0===i.index&&(t.dataLabelCollections=[]),t.dataLabelModule.calculateTemplateLabelSize(s,e,i,n,n.marker.dataLabel,o,n.clipRect,r,!0))}function k0e(e,t,i,n,o,r,s,a,l,h,d,p,c,u,g){i=E0e(i);try{var m=window.Blazor?s?o:{point:o}:{chart:n,series:r,point:o},f=i?i(m,n,s?s+"_template":"template",s||e.id.replace(/[^a-zA-Z0-9]/g,"")):[];if(f.length)for(var y,v=(y=Array.prototype.slice.call(f)).length,b=0;b<v;b++)e.appendChild(y[b]);var w=void 0;"accumulationchart"===n.getModuleName()?(w=D0e.bind(this,e,n,h,d,l,d[t],p,c,u,g),n.isReact&&n.renderReactTemplates(w)):"chart"===n.getModuleName()&&(w=o&&r?M0e.bind(this,e,n,o,r,a,g):w,n.isReact)&&n.renderReactTemplates(w)}catch(e){}return e}function P0e(e,t){return"font-size:"+(e.size||t.size)+"; font-style:"+(e.fontStyle||t.fontStyle)+"; font-weight:"+(e.fontWeight||t.fontWeight)+"; font-family:"+e.fontFamily+";opacity:"+e.opacity+"; color:"+e.color+";"}function B0e(e,t,i){void 0===t&&(t=!1),i||document.body.appendChild(e);var n=e.getBoundingClientRect();return t?ue(e):i||Pye(e.id),n}function F0e(e,t){for(var i,n=0,o=e.length;n<o;n++)-1<e[n].id.indexOf(t)&&(i=e[n]);return i}function L0e(e,t,i,n,o){e="Logarithmic"===i.valueType?Bye(0<e?e:Math.pow(i.logBase,i.visibleRange.min),i.logBase):e,t="Logarithmic"===n.valueType?Bye(0<t?t:Math.pow(n.logBase,n.visibleRange.min),n.logBase):t,e=Yye(e,i),t=Yye(t,n);i=o?i.rect.height:i.rect.width,n=o?n.rect.width:n.rect.height;return new Tve(o?t*n:e*i,o?(1-e)*i:(1-t)*n)}function R0e(e,t,i,n,o,r,s){if(void 0===i&&(i=!1),void 0===n&&(n=!1),void 0===o&&(o="x"),void 0===r&&(r="y"),!(e&&e.hasChildNodes()&&t))return null;O0e(!1,t,e,i,n,o,r,void 0,void 0,void 0,void 0,void 0,s)}function O0e(e,t,i,n,o,r,s,a,l,h,d,p,c,u,g,m,f){if(void 0===o&&(o=!1),void 0===r&&(r="x"),void 0===s&&(s="y"),void 0===h&&(h=!1),void 0===d&&(d=!1),void 0===p&&(p=null),void 0===g&&(g=0),e)return null;var e=(u=void 0===u?!1:u)?null:t.querySelector("#"+i.id),u=e||ie(i.id),y=i,c=je(c)?300:c;n&&o&&u?(a=a||("DIV"===u.tagName?new Tve(+u.style[r].split("px")[0],+u.style[s].split("px")[0]):new Tve(+u.getAttribute(r),+u.getAttribute(s))),l&&"undefined"!==l?m0e(i,i.getAttribute("d"),n,l,c):d&&p?g0e(y,0,c,new Do(+u.getAttribute("x"),+u.getAttribute("y"),+u.getAttribute("width"),+u.getAttribute("height")),p):(i="DIV"===y.tagName?new Tve(+y.style[r].split("px")[0],+y.style[s].split("px")[0]):new Tve(+y.getAttribute(r),+y.getAttribute(s)),l=u.getAttribute("transform"),ove(y,c,a,i,r,s,g,m,void 0!==f?new Tve(f.match(/\d+/g).map(Number)[0],f.match(/\d+/g).map(Number)[1]):l?new Tve(parseFloat(l.split(",")[1]),parseFloat(l.split(",")[2])):new Tve(0,0),void 0!==f))):n&&o&&!u&&h&&S0e(y,0,600,"FadeIn"),e?t.replaceChild(y,u):t.appendChild(y)}function N0e(e,t,i,n,o){var r=Math.abs(e-i),s=Math.abs(t-n),e=Math.max(V0e(Math.min(e,i),r,o.x,o.width),o.x),i=Math.max(V0e(Math.min(t,n),s,o.y,o.height),o.y);return new Do(e,i,Math.min(r,o.width),Math.min(s,o.height))}function V0e(e,t,i,n){return e<i?e=i:n+i<e+t&&(e=n+i-t),e}function _0e(e,t,i){var n=t.marker.dataLabel.format||t.yAxis.labelFormat,o=[],r=null!==n.match("{value}");switch(t.seriesType){case"XY":"PolarRadar"===t.chart.chartAreaType?-1!==t.drawType.indexOf("Stacking")?("Logarithmic"===t.yAxis.valueType&&Oye(t.stackedValues.endValues[e.index],t.yAxis)||Rye(t.stackedValues.endValues[e.index],t.yAxis.visibleRange))&&o.push(e.text||e.yValue.toString()):("Logarithmic"===t.yAxis.valueType&&Oye(e.yValue,t.yAxis)||Rye(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 s=0,a=e.outliers;s<a.length;s++){var l=a[s];o.push(e.text||l.toString())}}if((n||i.useGroupingSeparator)&&!e.text){t.yAxis.format=i.intl.getNumberFormat({format:r?"":n,useGrouping:i.useGroupingSeparator});for(var h=0;h<o.length;h++)o[h]=r?n.replace("{value}",t.yAxis.format(parseFloat(o[h]))):t.yAxis.format(parseFloat(o[h]))}return o}function H0e(e){window.clearInterval(e)}function z0e(e,t,i){var n=new Do(e.x+i.x,e.y+i.y,e.width,e.height);return t.some(function(e){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.height+n.y>e.y})}function j0e(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 W0e(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 Q0e(e,t,i){return new Do(e.x-t.width/2-i.left,e.y-t.height/2-i.top,t.width+i.left+i.right,t.height+i.top+i.bottom)}function U0e(e){return"#"+q0e(e.r)+q0e(e.g)+q0e(e.b)}function q0e(e){e=e.toString(16);return 1===e.length?"0"+e:e}function G0e(e){e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return e?new Dve(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)):new Dve(255,255,255)}function Y0e(e){e="transparent"===e?"white":e;var t,i=document.getElementById("chartmeasuretext");return i||(i=Q("text",{id:"chartmeasuretext"}),document.body.appendChild(i)),i.style.color=e,e=window.getComputedStyle(i).color,i.style.color="",(t=0!==e.indexOf("rgb")&&0!==e.indexOf("hsl")?t:(e=e.replace(/\s/g,"").replace(/[()]/g,"")).slice(3).split(","))&&t.length?(e=(i=t.map(function(e){return parseInt(e,10)}))[0],t=i[1],i=i[2],U0e(new Dve(e,t,i))):""}function X0e(e){if(0===e.indexOf("rgba(")||0===e.indexOf("rgb(")){var t=e.substring(e.indexOf("(")+1,e.lastIndexOf(")")).split(",");if(3===t.length||4===t.length)return t.every(function(e){e=parseFloat(e);return!isNaN(e)&&0<=e&&e<=255})}else if(0===e.indexOf("#"))return(3===(t=e.substring(1)).length||6===t.length)&&/^[0-9A-Fa-f]{3,6}$/.test(t);return!1}function K0e(e,t){(e=(e=Y0e(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,n="#",o=0;o<3;o++)i=parseInt(e.substr(2*o,2),16),n+=("00"+(i=Math.round(Math.min(Math.max(0,i+i*t),255))).toString(16)).substr(i.toString(16).length);return n}function J0e(e,t){e=G0e(e);return e.r=parseInt(Math.floor(e.r*t).toString(),10),e.g=parseInt(Math.floor(e.g*t).toString(),10),e.b=parseInt(Math.floor(e.b*t).toString(),10),"#"+q0e(e.r).toUpperCase()+q0e(e.g).toUpperCase()+q0e(e.b).toUpperCase()}function Z0e(e){var t=Math.floor(e.length/2);return e.length%2?e[t]:(e[t-1]+e[t])/2}function $0e(e,t,i,n){var o,r,s,a,l,h,d=t.height,p=t.width,c=e.x,u=e.y;switch(i){case"MultiColoredLine":case"Line":case"StackingLine":case"StackingLine100":I(n,{d:"M "+(c+.75*-p)+" "+u+" L "+(c+.75*p)+" "+u});break;case"StepLine":n.fill="transparent",I(n,{d:"M "+(c+-p/2-2.5)+" "+(u+d/2)+" L "+(c+-p/2+p/10)+" "+(u+d/2)+" L "+(c+-p/2+p/10)+" "+u+" L "+(c+-p/10)+" "+u+" L "+(c+-p/10)+" "+(u+d/2)+" L "+(c+p/5)+" "+(u+d/2)+" L "+(c+p/5)+" "+(u+-d/2)+" L "+(c+p/2)+" "+(u+-d/2)+"L "+(c+p/2)+" "+(u+d/2)+" L"+(c+p/2+2.5)+" "+(u+d/2)});break;case"UpArrow":n.fill=n.stroke,n.stroke="transparent",I(n,{d:"M "+(c+-p/2)+" "+(u+d/2)+" L "+c+" "+(u-d/2)+" L "+(c+p/2)+" "+(u+d/2)+"L "+(c+p/2-2)+" "+(u+d/2)+" L "+c+" "+(u-d/2+4)+"L"+(c-p/2+2)+" "+(u+d/2)+" Z"});break;case"DownArrow":I(n,{d:"M "+(c-p/2)+" "+(u-d/2)+" L "+c+" "+(u+d/2)+" L "+(c+p/2)+" "+(u-d/2)+"L "+(c+p/2-2)+" "+(u-d/2)+" L "+c+" "+(u+d/2-4)+"L"+(c-p/2+2)+" "+(u-d/2)+" Z"});break;case"RightArrow":I(n,{d:"M "+(c+-p/2)+" "+(u-d/2)+" L "+(c+p/2)+" "+u+" L "+(c+-p/2)+" "+(u+d/2)+" L "+(c+-p/2)+" "+(u+d/2-2)+" L "+(c+p/2-4)+" "+u+" L"+(c+-p/2)+" "+(u-d/2+2)+" Z"});break;case"LeftArrow":n.fill=n.stroke,n.stroke="transparent",I(n,{d:"M "+(c+p/2)+" "+(u-d/2)+" L "+(c+-p/2)+" "+u+" L "+(c+p/2)+" "+(u+d/2)+" L "+(c+p/2)+" "+(u+d/2-2)+" L "+(c+-p/2+4)+" "+u+" L"+(c+p/2)+" "+(u-d/2+2)+" Z"});break;case"Column":case"Pareto":case"StackingColumn":case"StackingColumn100":case"RangeColumn":case"Histogram":I(n,{d:"M "+(c-p/5*3)+" "+(u-d/5)+" L "+(c+-p/10*3)+" "+(u-d/5)+" L "+(c+-p/10*3)+" "+(u+d/2)+" L "+(c-p/5*3)+" "+(u+d/2)+" Z M "+(c+-p/10-p/20)+" "+(u-d/4-5)+" L "+(c+p/10+p/20)+" "+(u-d/4-5)+" L "+(c+p/10+p/20)+" "+(u+d/2)+" L "+(c+-p/10-p/20)+" "+(u+d/2)+" Z M "+(c+p/10*3)+" "+u+" L "+(c+p/5*3)+" "+u+" L "+(c+p/5*3)+" "+(u+d/2)+" L "+(c+p/10*3)+" "+(u+d/2)+" Z"});break;case"Bar":case"StackingBar":case"StackingBar100":I(n,{d:"M "+(c+-p/2+-2.5)+" "+(u-d/5*3)+" L "+(c+p/10*3)+" "+(u-d/5*3)+" L "+(c+p/10*3)+" "+(u-d/10*3)+" L "+(c-p/2-2.5)+" "+(u-d/10*3)+" Z M "+(c+-p/2+-2.5)+" "+(u-d/5+.5)+" L "+(c+p/2+2.5)+" "+(u-d/5+.5)+" L "+(c+p/2+2.5)+" "+(u+d/10+.5)+" L "+(c-p/2-2.5)+" "+(u+d/10+.5)+" Z M "+(c-p/2-2.5)+" "+(u+d/5+1)+" L "+(c+-p/4)+" "+(u+d/5+1)+" L "+(c+-p/4)+" "+(u+d/2+1)+" L "+(c-p/2-2.5)+" "+(u+d/2+1)+" Z"});break;case"Spline":n.fill="transparent",I(n,{d:"M "+(c-p/2)+" "+(u+d/5)+" Q "+c+" "+(u-d)+" "+c+" "+(u+d/5)+" M "+c+" "+(u+d/5)+" Q "+(c+p/2)+" "+(u+d/2)+" "+(c+p/2)+" "+(u-d/2)});break;case"Area":case"MultiColoredArea":case"RangeArea":case"StackingArea":case"StackingArea100":I(n,{d:"M "+(c-p/2-2.5)+" "+(u+d/2)+" L "+(c+-p/4+-1.25)+" "+(u-d/2)+" L "+c+" "+(u+d/4)+" L "+(c+p/4+1.25)+" "+(u+-d/2+d/4)+" L "+(c+d/2+2.5)+" "+(u+d/2)+" Z"});break;case"SplineArea":case"SplineRangeArea":I(n,{d:"M "+(c-p/2)+" "+(u+d/5)+" Q "+c+" "+(u-d)+" "+c+" "+(u+d/5)+" Z M "+c+" "+(u+d/5)+" Q "+(c+p/2)+" "+(u+d/2)+" "+(c+p/2)+" "+(u-d/2)+"  Z"});break;case"Pie":case"Doughnut":n.stroke="transparent";var g=Math.min(d,p)/2;s=d,a=p,l=jye(270,g=g,new Tve(o=c,r=u)),h=jye(270,g,new Tve(o+a/10,r)),I(n,{d:"M "+o+" "+r+" L "+(o+g)+" "+r+" A "+g+" "+g+" 0 1 1 "+l.x+" "+l.y+" Z M "+(o+a/10)+" "+(r-s/10)+" L"+(o+g)+" "+(r-s/10)+" A "+g+" "+g+" 0 0 0 "+h.x+" "+h.y+" Z"})}return{renderOption:n}}function eve(e,t,i,n,o){var r=t;if(e<So(t,i,o).width)for(var s=t.length-1;0<=s;--s)if(So(r=n?"..."+t.substring(0,s):t.substring(0,s)+"...",i,o).width<=e)return r;return r}function tve(e,t,i,n){for(var o=[],r=t.split("<br>"),s=0;s<r.length;s++)if(e<So(t=r[s],i,n).width){for(var a=t.length-1;0<=a;--a)if(So(t=t.substring(0,a)+"...",i,n).width<=e){o.push(t);break}}else o.push(t);return o}function ive(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function nve(e,t,i,n){return e?((e=ie(t))&&i&&n.setElementAttributes(i,"clipPath"===e.tagName?e.childNodes[0]:e),e):null}function ove(o,e,t,i,r,s,a,l,h,d){void 0===r&&(r="x"),void 0===s&&(s="y"),void 0===a&&(a=0),void 0===l&&(l=new Tve(0,0)),void 0===h&&(h=new Tve(0,0));function n(e,t,i,n){p?(o.style[r]=e+"px",o.style[s]=t+"px"):(o.setAttribute(r,e+""),o.setAttribute(s,t+""),a&&l.x&&l.y&&h.x&&h.y&&i&&n&&o.setAttribute("transform","rotate("+a+","+i+","+n+")"),d&&o.setAttribute("transform","translate("+i+","+n+")"))}var p="DIV"===o.tagName;n(t.x,t.y,h.x,h.y),new Vt({}).animate(Q("div"),{duration:e,progress:function(e){n(c0e(e.timeStamp,t.x,i.x-t.x,e.duration),c0e(e.timeStamp,t.y,i.y-t.y,e.duration),c0e(e.timeStamp,h.x,l.x-h.x,e.duration),c0e(e.timeStamp,h.y,l.y-h.y,e.duration))},end:function(){n(i.x,i.y,l.x,l.y)}})}function rve(t,e,i,n,o){var r;t&&i&&n&&(r=function(e){return o?o.replace("{value}",e.toString()):e.toString()},new Vt({}).animate(Q("div"),{duration:e,progress:function(e){t.style.animation="";e=e.timeStamp/e.duration,e=i+(n-i)*e,e=i%1!=0||n%1!=0?parseFloat(e.toFixed(1)):Math.round(e);t.textContent=r(e)},end:function(){t.textContent=r(n)}}))}function sve(e,t,i,n,o,r,s,a,l,h,d,p,c,u,g,m,f,y){void 0===r&&(r=!1),void 0===l&&(l=!1);var v,b,w,C=0,S=0;if(1<t.text.length&&g){for(var A=0,x=t.text.length;A<x;A++)S=Math.max(S,So(t.text[A],i,m).width);C=So(t.text[0],i,m).width}var I=1<t.text.length&&g?t.x+S/2-C/2:t.x,T={id:t.id,x:I,y:t.y,fill:n||"black","font-size":i.size||m.size,"font-style":i.fontStyle||m.fontStyle,"font-family":i.fontFamily||m.fontFamily,"font-weight":i.fontWeight||m.fontWeight,"text-anchor":t.anchor,labelRotation:t.labelRotation,transform:t.transform,opacity:i.opacity,"dominant-baseline":t.baseLine},n="string"==typeof t.text?t.text:r?t.text[t.text.length-1]:t.text[0],E=d?d.x:0,d=d?d.y:0,D=e.createText(T,n,E,d);if("string"!=typeof t.text&&1<t.text.length)for(A=1,x=t.text.length;A<x;A++)b=So(t.text[A],i,m).height,C=So(t.text[A],i,m).width,b=t.y+(r?-A*b:A*b),I=g?t.x+S/2-C/2:t.x,w=r?t.text[t.text.length-(A+1)]:t.text[A],u?v=e.createText(T,w,null,null,b,!0):(v=e.createTSpan({x:I,id:t.id,y:b},w),D.appendChild(v));return c||O0e(e instanceof vo,o,D,s,a,"x","y",null,null,l,!1,null,h,!1,t.labelRotation,f,y),D}function ave(e){var t,i,n,o,r=e.element.clientWidth||e.element.offsetWidth,s=e.element.clientHeight,a=(e.stockChart&&(r=e.stockChart.availableSize.width,s=e.stockChart.availableSize.height),450);"rangeNavigator"===e.getModuleName()&&(n=(t=e).tooltip.enable?35:0,i=t.periodSelectorSettings.periods.length?t.periodSelectorSettings.height:0,n=t.margin.top+t.margin.bottom+n,o=So("tempString",t.labelStyle,t.themeStyle.axisLabelFont).height,a=(e.series.length?F.isDevice?80:120:(t.enableGrouping?55+o:40)+n)+i,t.disableRangeSelector&&(a=i),e.stockChart)&&e.stockChart.chart&&"Outside"===e.stockChart.chart.axisCollections[1].labelPosition&&(o=e.stockChart.chart.axisCollections[1].labelPadding+.5*e.stockChart.chart.axisCollections[1].lineStyle.width,e.width=(e.stockChart.availableSize.width-(e.stockChart.chart.axisCollections[1].maxLabelSize.width+o)).toString()),e.availableSize=new Eo(ive(e.width,r)||r||600,ive(e.height,s||a)||s||a),"chart"===e.getModuleName()&&(e.scaleX=1,e.scaleY=1)}function lve(e){e.canvasRender=new vo(e.element.id),e.renderer=e.enableCanvas?e.canvasRender:new fo(e.element.id),ave(e),e.stockChart&&"chart"===e.getModuleName()?e.svgObject=e.stockChart.chartObject:e.stockChart&&"rangeNavigator"===e.getModuleName()&&e.stockChart.selectorObject?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}),e.enableCanvas&&(e.renderer.ctx.direction=e.enableRtl?"rtl":"ltr")}function hve(e,t,i,n,o){var r=[];switch(t.textOverflow){case"Wrap":r=pve(e,i,t,n,e.indexOf(" ")<0||null,null,o);break;case"Trim":r.push(eve(i,e,t,n,o));break;default:r.push(e)}return r}function dve(e,t){t="Near"===t.textAlignment?e.x:"Center"===t.textAlignment?e.x+e.width/2:e.x+e.width;return t}function pve(e,t,i,n,o,r,s,a){if(o)return cve(e,t,i,s);for(var l,h=e.split(" "),d="",p=[],c=So("chartMeasureText",i,s).height,u=0,g=0,m=h.length;g<m;g++){if(l=h[g],So(d.concat(""===d?"":" "+l),i,s).width<t)d=d.concat((""===d?"":" ")+l);else if(""!==d){if(u+=c,a&&a<u)return p[p.length-1]+="...",p;p.push(r?d:eve(t,d,i,n,s)),d=l}else{if(u+=c,a&&a<u)return p[p.length-1]+="...",p;p.push(r?l:eve(t,l,i,n,s))}if(d&&g===m-1){if(u+=c,a&&a<u)return p[p.length-1]+="...",p;p.push(r?d:eve(t,d,i,n,s))}}return p}function cve(e,t,i,n){var o,r=[];if(t<So(e,i,n).width){for(var s="",a=0,l=1;l<e.length;)(o=So(s=e.substring(a,l),i,n).width)<t?l++:o===t?(a=l,r.push(s),l++,s=""):t<o&&(s=s.slice(0,-1),a=l-1,r.push(s),s="");0<s.length&&r.push(s)}else r.push(e);return r}function uve(e,t){for(var i=e.replace(t," "),n=e.match(t),o=" ",r=0,s={0:"₀",1:"₁",2:"₂",3:"₃",4:"₄",5:"₅",6:"₆",7:"₇",8:"₈",9:"₉"},a={0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹"},l=0;l<=i.length-1;l++)if(" "===i[l]){for(var h=t===yfe?n[r].replace(/~/g,""):n[r].replace(/\^/g,""),d=0;d<h.length;d++)o+=(t===yfe?s:a)[h[d]];r++}else o+=i[l];return o.trim()}function gve(e){for(var t=0;t<e.annotations.length;t++)so((e.element.id+"_Annotation_"+t).replace(/[^a-zA-Z0-9]/g,""));so(e.element.id+"_tooltipparent_template_blazorTemplate"),so(e.element.id+"_DataLabel")}function mve(e){this.id=e}var fve,yve=function(e,t){this.startValues=e,this.endValues=t},vve=(Afe(bve,fve=No),bve);function bve(e,t,i,n,o,r,s,a,l){e=fve.call(this,e,t,i.width,i.color,n,l)||this;return e.y=o.y,e.x=o.x,e.height=o.height,e.width=o.width,e.rx=r||0,e.ry=s||0,e.transform=a||"",e.stroke=0!==i.width&&""!==e.stroke?null===i.color?"":i.color:"transparent",e}var wve,Cve=function(e,t,i,n,o,r,s,a){this.height=e,this.width=t,this.href=i,this.x=n,this.y=o,this.id=r,this.visibility=s,this.preserveAspectRatio=a},Sve=(Afe(Ave,wve=No),Ave);function Ave(e,t,i,n,o,r,s){e=wve.call(this,e,t,i.width,i.color,n)||this;return e.cy=r,e.cx=o,e.r=s,e}function xve(e,t){this.x=0,this.y=0,this.x=e,this.y=t}var Ive=function(e,t,i){this.id=e,this.points=t,this.fill=i},Tve=function(e,t){this.x=e,this.y=t},Eve=function(e,t,i,n){this.left=e,this.right=t,this.top=i,this.bottom=n},Dve=function(e,t,i){this.r=e,this.g=t,this.b=i},Mve=function(e,t,i){void 0===i&&(i=0),this.point=e,this.series=t,this.lierIndex=i},kve=function(e,t,i){void 0===i&&(i=0),this.point=e,this.series=t,this.index=i},Pve=function(e,t){this.point=e,this.series=t},Bve=function(e,t){this.controlPoint1=e,this.controlPoint2=t};function Fve(e,t){return Number(t)===e.start?e.colors[0]:Number(t)===e.end?e.colors[e.colors.length-1]:U0e(Lve(Number(t),e))}function Lve(e,t){var i=t.start,n=t.end,o=0,r=n-i,o=(e-i)/r;if(t.colors.length<=2)a="#"===t.colors[0].charAt(0)?t.colors[0]:Y0e(t.colors[0]),l="#"===t.colors[t.colors.length-1].charAt(0)?t.colors[t.colors.length-1]:Y0e(t.colors[t.colors.length-1]);else{for(var s,a="#"===t.colors[0].charAt(0)?t.colors[0]:Y0e(t.colors[0]),l="#"===t.colors[t.colors.length-1].charAt(0)?t.colors[t.colors.length-1]:Y0e(t.colors[t.colors.length-1]),h=r/(t.colors.length-1),d=t.colors.length-1,p=[],c=1;c<d;c++)s={b:i+c*h,color:t.colors[c]},p.push(s);for(var u=0;u<p.length;u++)i<=e&&e<=p[u].b&&0===u?(l="#"===p[u].color.charAt(0)?p[u].color:Y0e(p[u].color),o=e<=p[u].b?1-Math.abs((e-p[u].b)/h):(e-p[u].b)/h):p[u].b<=e&&e<=n&&u===p.length-1&&(a="#"===p[u].color.charAt(0)?p[u].color:Y0e(p[u].color),o=e<p[u].b?1-Math.abs((e-p[u].b)/h):(e-p[u].b)/h),u!==p.length-1&&u<p.length&&p[u].b<=e&&e<=p[u+1].b&&(a="#"===p[u].color.charAt(0)?p[u].color:Y0e(p[u].color),l="#"===p[u+1].color.charAt(0)?p[u+1].color:Y0e(p[u+1].color),o=Math.abs(e-p[u+1].b)/h)}return Rve(o,a,l)}function Rve(e,t,i){var i=i.split("#")[1],t=t.split("#")[1],n=Ove(e,parseInt(t.substr(0,2),16),parseInt(i.substr(0,2),16)),o=Ove(e,parseInt(t.substr(2,2),16),parseInt(i.substr(2,2),16)),e=Ove(e,parseInt(t.substr(4,2),16),parseInt(i.substr(4,2),16));return new Dve(n,o,e)}function Ove(e,t,i){return Math.round(t+(i-t)*e)}function Nve(e,t){switch(e){case"Near":return t?"end":"start";case"Far":return t?"start":"end";default:return"middle"}}Jfe={size:"13px",fontWeight:"400",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"};function Vve(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":t=["#79ECE4","#E98272","#DFE6B6","#C6E773","#BA98FF","#FA83C3","#00C27A","#43ACEF","#D681EF","#D8BC6E"];break;case"MaterialDark":t=["#9ECB08","#56AEFF","#C57AFF","#61EAA9","#EBBB3E","#F45C5C","#8A77FF","#63C7FF","#FF84B0","#F7C928"];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"Tailwind3":t=["#2F4074","#03B4B4","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];break;case"Tailwind3Dark":t=["#8029F1","#1ABC9C","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];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;case"Bootstrap5Dark":case"Bootstrap5":t=["#FD7E14","#6610F2","#6F42C1","#D63384","#DC3545","#FFC107","#198754","#0DCAF0"];break;case"FluentDark":case"Fluent":t=["#1AC9E6","#DA4CB2","#EDBB40","#AF4BCF","#FF7266","#1BD565","#EE993D","#5887FF","#EC548D","#7D39C0"];break;case"Fluent2":t=["#6200EE","#09AF74","#0076E5","#CB3587","#E7910F","#0364DE","#66CD15","#F3A93C","#107C10","#C19C00"];break;case"Fluent2Dark":case"Fluent2HighContrast":t=["#9BB449","#2A72D5","#43B786","#3F579A","#584EC6","#E85F9C","#6E7A89","#EA6266","#0B6A0B","#C19C00"];break;case"Material3":t=["#6355C7","#00AEE0","#FFB400","#F7523F","#963C70","#FD7400","#4BE0BC","#2196F5","#DE3D8A","#162F88"];break;case"Material3Dark":t=["#4EAAFF","#FA4EAB","#FFF500","#17EA58","#38FFE7","#FF9E45","#B3F32F","#B93CE4","#FC5664","#9B55FF"];break;default:t=["#00bdae","#404041","#357cd2","#e56590","#f8b883","#70ad47","#dd8abd","#7f84e8","#7bb4eb","#ea7a57"]}return t}function _ve(e,t,i){var n,o="MaterialDark"===e?"#383838":"FabricDark"===e?"#242424":"#1b1b1b";switch(e){case"HighContrastLight":case"HighContrast":n={axisLabel:"#ffffff",axisTitle:"#ffffff",axisLine:"#ffffff",majorGridLine:"#BFBFBF",minorGridLine:"#969696",majorTickLine:"#BFBFBF",minorTickLine:"#969696",chartTitle:"#ffffff",legendLabel:"#ffffff",background:t?"#000000":"transparent",areaBorder:"#ffffff",errorBar:"#ffffff",crosshairLine:"#ffffff",crosshairBackground:"rgba(255, 255, 255, 0.1)",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",tabColor:"#FFD939",bearFillColor:"#2ecd71",bullFillColor:"#e74c3d",toolkitSelectionColor:"#FFD939",toolkitFill:"#737373",toolkitIconRectOverFill:"transparent",toolkitIconRectSelectionFill:"transparent",toolkitIconRect:new Do(0,0,16,16),chartTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#000000",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},crosshairLabelFont:{color:"#000000",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},stripLineLabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"MaterialDark":case"FabricDark":case"BootstrapDark":n={axisLabel:"#DADADA",axisTitle:"#ffffff",axisLine:" #6F6C6C",majorGridLine:"#414040",minorGridLine:"#514F4F",majorTickLine:"#414040",minorTickLine:" #4A4848",chartTitle:"#ffffff",legendLabel:"#DADADA",background:t?o:"transparent",areaBorder:" #9A9A9A",errorBar:"#ffffff",crosshairLine:"#F4F4F4",crosshairBackground:"rgba(255, 255, 255, 0.1)",crosshairFill:"MaterialDark"===e?"#F4F4F4":"FabricDark"===e?"#A19F9D":"#F0F0F0",crosshairLabel:"#282727",tooltipFill:"#F4F4F4",tooltipBoldLabel:"#282727",tooltipLightLabel:"#333232",tooltipHeaderLine:"#9A9A9A",markerShadow:null,selectionRectFill:"rgba(56,169,255, 0.1)",selectionRectStroke:"#38A9FF",selectionCircleStroke:"#282727",tabColor:"MaterialDark"===e?"#00B0FF":"FabricDark"===e?"#0074CC":"#0070F0",bearFillColor:"#2ecd71",bullFillColor:"#e74c3d",toolkitSelectionColor:"MaterialDark"===e?"#00B0FF":"FabricDark"===e?"#0074CC":"#0070F0",toolkitFill:"#737373",toolkitIconRectOverFill:"transparent",toolkitIconRectSelectionFill:"transparent",toolkitIconRect:new Do(0,0,16,16),chartTitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"FabricDark"===e?"#DADADA":"#FFFFFF",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"FabricDark"===e?"#A19F9D":"#CED4DA",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"FabricDark"===e?"#DADADA":"#FFFFFF",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"FabricDark"===e?"#A19F9D":"#676767",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"MaterialDark"===e?"rgba(18, 18, 18, 1)":"FabricDark"===e?"#DADADA":"#1A1A1A",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"FabricDark"===e?"#DADADA":"#FFFFFF",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"FabricDark"===e?"#A19F9D":"#676767",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"FabricDark"===e?"#DADADA":"#FFFFFF",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},crosshairLabelFont:{color:"MaterialDark"===e?"rgba(18, 18, 18, 1)":"FabricDark"===e?"#DADADA":"#1A1A1A",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},stripLineLabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.24)":"FabricDark"===e?"#6F6C6C":"#414141",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap4":n={axisLabel:"#212529",axisTitle:"#212529",axisLine:"#CED4DA",majorGridLine:"#CED4DA",minorGridLine:"#DEE2E6",majorTickLine:"#ADB5BD",minorTickLine:"#CED4DA",chartTitle:"#212529",legendLabel:"#212529",background:t?"#FFFFFF":"transparent",areaBorder:"#DEE2E6",errorBar:"#000000",crosshairLine:"#6C757D",crosshairBackground:"rgba(0, 0, 0, 0.1)",crosshairFill:"#212529",crosshairLabel:"#FFFFFF",tooltipFill:"#020202",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",tabColor:"#007BFF",bearFillColor:"#2ecd71",bullFillColor:"#e74c3d",toolkitSelectionColor:"#007BFF",toolkitFill:"#495057",toolkitIconRectOverFill:"transparent",toolkitIconRectSelectionFill:"transparent",toolkitIconRect:new Do(-5,-5,26,26),chartTitleFont:{color:"#212529",fontFamily:"Helvetica",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#495057",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#212529",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#666666",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#212529",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#495057",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#212529",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},crosshairLabelFont:{color:"#F9FAFB",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},stripLineLabelFont:{color:"#6C757D",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Tailwind3":n={axisLabel:"#4B5563",axisTitle:"#6B7280",axisLine:"#D1D5DB",majorGridLine:"#E5E7EB",minorGridLine:"#E5E7EB",majorTickLine:"#D1D5DB",minorTickLine:"#D1D5DB",chartTitle:"#111827",legendLabel:"#4B5563",background:t?"rgba(255,255,255, 0.0)":"transparent",areaBorder:"#D1D5DB",errorBar:"#1F2937",crosshairLine:"#1F2937",crosshairBackground:"rgba(107, 114, 128, 0.1)",crosshairFill:"#111827",crosshairLabel:"#F9FAFB",tooltipFill:"#111827",tooltipBoldLabel:"#F9FAFB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#D1D5DB",markerShadow:null,selectionRectFill:"rgba(224, 231, 255, 0.25)",selectionRectStroke:"#4F46E5",selectionCircleStroke:"#6B7280",tabColor:"#4F46E5",bearFillColor:"#EF291F",bullFillColor:"#0D72DE",toolkitSelectionColor:"#212529",toolkitFill:"#6B7280",toolkitIconRectOverFill:"#F9FAFB",toolkitIconRectSelectionFill:"#F3F4F6",toolkitIconRect:new Do(-6,-8,32,32),chartTitleFont:{color:"#111827",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"},axisLabelFont:{color:"#4B5563",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#374151",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},legendLabelFont:{color:"#4B5563",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Inter",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#6B7280",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"},datalabelFont:{color:"#111827",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#6B7280",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"600"},crosshairLabelFont:{color:"#F9FAFB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},stripLineLabelFont:{color:"#374151",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Tailwind3Dark":n={axisLabel:"#D1D5DB",axisTitle:"#9CA3AF",axisLine:" #374151",majorGridLine:"#282F3C",minorGridLine:"#282F3C",majorTickLine:"#374151",minorTickLine:" #374151",chartTitle:"#FFFFFF",legendLabel:"#D1D5DB",background:t?"#1f2937":"transparent",areaBorder:" #374151",errorBar:"#6B7280",crosshairLine:"#6B7280",crosshairBackground:"rgba(107, 114, 128, 0.1)",crosshairFill:"#F9FAFB",crosshairLabel:"#1F2937",tooltipFill:"#F9FAFB",tooltipBoldLabel:"#1F2937",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#374151",markerShadow:null,selectionRectFill:"rgba(30, 27, 75, 0.25)",selectionRectStroke:"#6366F1",selectionCircleStroke:"#282727",tabColor:"#22D3EE",bearFillColor:"#EF291F",bullFillColor:"#0D72DE",toolkitSelectionColor:"#FFFFFF",toolkitFill:"#FFFFFF",toolkitIconRectOverFill:"#242A38",toolkitIconRectSelectionFill:"#242A38",toolkitIconRect:new Do(-6,-8,32,32),chartTitleFont:{color:"#FFFFFF",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"},axisLabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#E5E7EB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},legendLabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},tooltipLabelFont:{color:"#1F2937",fontFamily:"Inter",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#9CA3AF",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"},datalabelFont:{color:"#FFFFFF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#9CA3AF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"600"},crosshairLabelFont:{color:"#1F2937",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},stripLineLabelFont:{color:"#E5E7EB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Tailwind":n={axisLabel:"#6B728",axisTitle:"#374151",axisLine:" #D1D5DB",majorGridLine:"#E5E7EB",minorGridLine:"#E5E7EB",majorTickLine:"#D1D5DB",minorTickLine:" #D1D5DB",chartTitle:"#374151",legendLabel:"#374151",background:t?"rgba(255,255,255, 0.0)":"transparent",areaBorder:" #E5E7EB",errorBar:"#374151",crosshairLine:"#1F2937",crosshairBackground:"rgba(90, 97, 246, 0.1)",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",tabColor:"#4F46E5",bearFillColor:"#2ecd71",bullFillColor:"#e74c3d",toolkitSelectionColor:"#4F46E5",toolkitFill:"#6B7280",toolkitIconRectOverFill:"transparent",toolkitIconRectSelectionFill:"transparent",toolkitIconRect:new Do(0,0,16,16),chartTitleFont:{color:"#374151",fontFamily:"Inter",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#6B7280",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Inter",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#6B7280",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"},crosshairLabelFont:{color:"#F9FAFB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},stripLineLabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"TailwindDark":n={axisLabel:"#9CA3AF",axisTitle:"#9CA3AF",axisLine:" #4B5563",majorGridLine:"#374151",minorGridLine:"#374151",majorTickLine:"#4B5563",minorTickLine:" #4B5563",chartTitle:"#D1D5DB",legendLabel:"#D1D5DB",background:t?"#1f2937":"transparent",areaBorder:" #374151",errorBar:"#ffffff",crosshairLine:"#9CA3AF",crosshairBackground:"rgba(90, 97, 246, 0.1)",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",tabColor:"#22D3EE",bearFillColor:"#2ecd71",bullFillColor:"#e74c3d",toolkitSelectionColor:"#22D3EE",toolkitFill:"#D1D5DB",toolkitIconRectOverFill:"transparent",toolkitIconRectSelectionFill:"transparent",toolkitIconRect:new Do(0,0,16,16),chartTitleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#9CA3AF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#1F2937",fontFamily:"Inter",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#9CA3AF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"},crosshairLabelFont:{color:"#1F2937",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},stripLineLabelFont:{color:"#6B7280",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap5":n={axisLabel:"#212529",axisTitle:"#212529",axisLine:"#DEE2E6",majorGridLine:"#E9ECEF",minorGridLine:"#E9ECEF",majorTickLine:"#DEE2E6",minorTickLine:"#E9ECEF",chartTitle:"#212529",legendLabel:"#212529",background:t?"#212529":"transparent",areaBorder:"#E9ECEF",errorBar:"#343A40",crosshairLine:"#343A40",crosshairBackground:"rgba(52, 58, 64, 0.1)",crosshairFill:"#000000",crosshairLabel:"#FFFFFF",tooltipFill:"#E9ECEF",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#FFFFFF",markerShadow:null,selectionRectFill:"rgba(134,183,254, 0.1)",selectionRectStroke:"#0D6EFD",selectionCircleStroke:"#6B7280",tabColor:"#0D6EFD",bearFillColor:"#DC3545",bullFillColor:"#6F42C1",toolkitSelectionColor:"#6E757D",toolkitFill:"#6E757D",toolkitIconRectOverFill:"#F8F9FA",toolkitIconRectSelectionFill:"#F8F9FA",toolkitIconRect:new Do(-6,-8,32,32),chartTitleFont:{color:"#212529",fontFamily:"Segoe UI",size:"accumulationchart"===i.getModuleName()?"16px":"14px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"accumulationchart"===i.getModuleName()?"#21252980":"#212529",fontFamily:"Segoe UI",size:"accumulationchart"===i.getModuleName()?"14px":"12px",fontStyle:"Normal",fontWeight:"600"},crosshairLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},stripLineLabelFont:{color:"#6C757D",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap5Dark":n={axisLabel:"#DEE2E6",axisTitle:"#DEE2E6",axisLine:"#495057",majorGridLine:"#343A40",minorGridLine:"#343A40",majorTickLine:"#495057",minorTickLine:"#343A40",chartTitle:"#DEE2E6",legendLabel:"#DEE2E6",background:t?"#212529":"transparent",areaBorder:"#343A40",errorBar:"#ADB5BD",crosshairLine:"#ADB5BD",crosshairBackground:"rgba(138, 136, 134, 0.1)",crosshairFill:"#FFFFFF",crosshairLabel:"#212529",tooltipFill:"#FFFFFF",tooltipBoldLabel:"#212529",tooltipLightLabel:"#212529",tooltipHeaderLine:"#212529",markerShadow:null,selectionRectFill:"rgba(134,183,254, 0.25)",selectionRectStroke:"#0D6EFD",selectionCircleStroke:"#0D6EFD",tabColor:"#0D6EFD",bearFillColor:"#DC3545",bullFillColor:"#6F42C1",toolkitSelectionColor:"#F8F9FA",toolkitFill:"#ADB5BD",toolkitIconRectOverFill:"#2B3035",toolkitIconRectSelectionFill:"#343A40",toolkitIconRect:new Do(-6,-8,32,32),chartTitleFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"accumulationchart"===i.getModuleName()?"16px":"14px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"accumulationchart"===i.getModuleName()?"#DEE2E680":"#DEE2E6",fontFamily:"Segoe UI",size:"accumulationchart"===i.getModuleName()?"14px":"12px",fontStyle:"Normal",fontWeight:"600"},crosshairLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},stripLineLabelFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Fluent":n={axisLabel:"#3B3A39",axisTitle:"#201F1E",axisLine:"#D2D0CE",majorGridLine:"#EDEBE9",minorGridLine:"#EDEBE9",majorTickLine:"#D2D0CE",minorTickLine:" #D2D0CE",chartTitle:"#201F1E",legendLabel:"#323130",background:t?"#FFFFFF":"transparent",areaBorder:"#EDEBE9",errorBar:"#A19F9D",crosshairLine:"#A19F9D",crosshairBackground:"rgba(161, 159, 157, 0.1)",crosshairFill:"#FFFFFF",crosshairLabel:"#323130",tooltipFill:"#FFFFFF",tooltipBoldLabel:"#323130",tooltipLightLabel:"#323130",tooltipHeaderLine:"#D2D0CE",markerShadow:null,selectionRectFill:"rgba(79,70,229, 0.1)",selectionRectStroke:"#4F46E5",selectionCircleStroke:"#6B7280",tabColor:"#0078D4",bearFillColor:"#2ecd71",bullFillColor:"#e74c3d",toolkitSelectionColor:"#0078D4",toolkitFill:"#A19F9D",toolkitIconRectOverFill:"transparent",toolkitIconRectSelectionFill:"transparent",toolkitIconRect:new Do(0,0,16,16),chartTitleFont:{color:"#201F1E",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#3B3A39",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#201F1E",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#49454E",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#323130",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#201F1E",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#3B3A39",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#323129",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},crosshairLabelFont:{color:"#323130",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},stripLineLabelFont:{color:"#A19F9D",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"FluentDark":n={axisLabel:"#C8C6C4",axisTitle:"#F3F2F1",axisLine:"#3B3A39",majorGridLine:"#414040",minorGridLine:"#414040",majorTickLine:"#3B3A39",minorTickLine:"#3B3A39",chartTitle:"#F3F2F1",legendLabel:"#D2D0CE",background:t?"#383838":"transparent",areaBorder:"#414040",errorBar:"#D2D0CE",crosshairLine:"#D2D0CE",crosshairBackground:"rgba(161, 159, 157, 0.1)",crosshairFill:"#323130",crosshairLabel:"#F3F2F1",tooltipFill:"#252423",tooltipBoldLabel:"#F3F2F1",tooltipLightLabel:"#F3F2F1",tooltipHeaderLine:"#3B3A39",markerShadow:null,selectionRectFill:"rgba(79,70,229, 0.1)",selectionRectStroke:"#4F46E5",selectionCircleStroke:"#6B7280",tabColor:"#0078D4",bearFillColor:"#2ecd71",bullFillColor:"#e74c3d",toolkitSelectionColor:"#0078D4",toolkitFill:"#484644",toolkitIconRectOverFill:"transparent",toolkitIconRectSelectionFill:"transparent",toolkitIconRect:new Do(0,0,16,16),chartTitleFont:{color:"#C8C6C4",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#C8C6C4",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#F3F2F1",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#D2D0CE",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F3F2F1",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#F3F2F2",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#D2D0CE",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#F3F2F1",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},crosshairLabelFont:{color:"#F3F2F1",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},stripLineLabelFont:{color:"#484644",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Fluent2":n={axisLabel:"#616161",axisTitle:"#242424",axisLine:"#D2D0CE",majorGridLine:"#EDEBE9",minorGridLine:"#EDEBE9",majorTickLine:"#D2D0CE",minorTickLine:"#D2D0CE",chartTitle:"#242424",legendLabel:"#242424",background:t?"#383838":"transparent",areaBorder:"#EDEBE9",errorBar:"#A19F9D",crosshairLine:"#A19F9D",crosshairBackground:"rgba(138, 136, 134, 0.1)",crosshairFill:"#FFFFFF",crosshairLabel:"#242424",tooltipFill:"#FFFFFF",tooltipBoldLabel:"#242424",tooltipLightLabel:"#242424",tooltipHeaderLine:"#D2D0CE",markerShadow:null,selectionRectFill:"rgba(180, 214, 250, 0.1)",selectionRectStroke:"#0F6CBD",selectionCircleStroke:"#0F6CBD",tabColor:"#0078D4",bearFillColor:"#E7910F",bullFillColor:"#0076E5",toolkitSelectionColor:"#424242",toolkitFill:"#424242",toolkitIconRectOverFill:"#E6E6E6",toolkitIconRectSelectionFill:"#E6E6E6",toolkitIconRect:new Do(-6,-8,32,32),chartTitleFont:{color:"#242424",fontFamily:"Segoe UI",size:"accumulationchart"===i.getModuleName()?"16px":"14px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#616161",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#616161",fontFamily:"Segoe UI",size:"chart"===i.getModuleName()?"12px":"14px",fontStyle:"Normal",fontWeight:"600"},crosshairLabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"700"},stripLineLabelFont:{color:"#616161",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Fluent2HighContrast":n={axisLabel:"#FFFFFF",axisTitle:"#FFFFFF",axisLine:"#3B3A39",majorGridLine:"#292827",minorGridLine:"#3B3A39",majorTickLine:"#292827",minorTickLine:"#292827",chartTitle:"#FFFFFF",legendLabel:"#FFFFFF",background:t?"#383838":"transparent",areaBorder:"#292827",errorBar:"#8A8886",crosshairLine:"#8A8886",crosshairBackground:"rgba(255, 255, 255, 0.1)",crosshairFill:"#000000",crosshairLabel:"#FFFFFF",tooltipFill:"#292929",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#3B3A39",markerShadow:null,selectionRectFill:"rgba(26, 235, 255, 0.2)",selectionRectStroke:"#1AEBFF",selectionCircleStroke:"#1AEBFF",tabColor:"#0078D4",bearFillColor:"#584EC6",bullFillColor:"#43B786",toolkitSelectionColor:"#FFFFFF",toolkitFill:"#FFFFFF",toolkitIconRectOverFill:"#1AEBFF",toolkitIconRectSelectionFill:"#1AEBFF",toolkitIconRect:new Do(-6,-8,32,32),chartTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"accumulationchart"===i.getModuleName()?"16px":"14px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"chart"===i.getModuleName()?"12px":"14px",fontStyle:"Normal",fontWeight:"600"},crosshairLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"700"},stripLineLabelFont:{color:"#ADADAD",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Fluent2Dark":n={axisLabel:"#ADADAD",axisTitle:"#FFFFFF",axisLine:"#3B3A39",majorGridLine:"#3B3A39",minorGridLine:"#3B3A39",majorTickLine:"#292827",minorTickLine:"#292827",chartTitle:"#FFFFFF",legendLabel:"#FFFFFF",background:t?"#383838":"transparent",areaBorder:"#292827",errorBar:"#8A8886",crosshairLine:"#8A8886",crosshairBackground:"rgba(138, 136, 134, 0.1)",crosshairFill:"#292929",crosshairLabel:"#FFFFFF",tooltipFill:"#292929",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#3B3A39",markerShadow:null,selectionRectFill:"rgba(14, 71, 117, 0.1)",selectionRectStroke:"#115EA3",selectionCircleStroke:"#115EA3",tabColor:"#0078D4",bearFillColor:"#584EC6",bullFillColor:"#43B786",toolkitSelectionColor:"#D6D6D6",toolkitFill:"#D6D6D6",toolkitIconRectOverFill:"#333333",toolkitIconRectSelectionFill:"#333333",toolkitIconRect:new Do(-6,-8,32,32),chartTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"accumulationchart"===i.getModuleName()?"16px":"14px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#ADADAD",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#ADADAD",fontFamily:"Segoe UI",size:"chart"===i.getModuleName()?"12px":"14px",fontStyle:"Normal",fontWeight:"600"},crosshairLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"700"},stripLineLabelFont:{color:"#ADADAD",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Material3":n={axisLabel:"#1E192B",axisTitle:"#1C1B1F",axisLine:"#C4C7C5",majorGridLine:"#C4C7C5",minorGridLine:"#C4C7C5",majorTickLine:"#C4C7C5",minorTickLine:" #C4C7C5",chartTitle:"#1C1B1F",legendLabel:"#49454E",background:t?"#FFFFFF":"transparent",areaBorder:"#E7E0EC",errorBar:"#79747E",crosshairLine:"#49454E",crosshairBackground:"rgba(73, 69, 78, 0.1)",crosshairFill:"#313033",crosshairLabel:"#F4EFF4",tooltipFill:"#313033",tooltipBoldLabel:"#F4EFF4",tooltipLightLabel:"#F4EFF4",tooltipHeaderLine:"#F4EFF4",markerShadow:null,selectionRectFill:"rgb(98, 0, 238, 0.06)",selectionRectStroke:"#6200EE",selectionCircleStroke:"#79747E",tabColor:"#49454E",bearFillColor:"#5887FF",bullFillColor:"#F7523F",toolkitSelectionColor:"#49454E",toolkitFill:"#49454E",toolkitIconRectOverFill:"#EADDFF",toolkitIconRectSelectionFill:"#EADDFF",toolkitIconRect:new Do(-4,-5,26,26),histogram:"#D21020",chartTitleFont:{color:"#1C1B1F",fontFamily:"Roboto",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#1E192B",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#1C1B1F",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#49454E",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F4EFF4",fontFamily:"Roboto",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#1C1B1F",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#49454E",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#49454E",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"},crosshairLabelFont:{color:"#F4EFF4",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},stripLineLabelFont:{color:"#79747E",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Material3Dark":n={axisLabel:"#E6E1E5",axisTitle:"#E6E1E5",axisLine:"#49454F",majorGridLine:"#444746",minorGridLine:"#444746",majorTickLine:"#444746",minorTickLine:" #444746",chartTitle:"#E6E1E5",legendLabel:"#CAC4D0",background:t?"#FFFFFF":"transparent",areaBorder:"#49454F",errorBar:"#938F99",crosshairLine:"#CAC4D0",crosshairBackground:"rgba(73, 69, 78, 0.1)",crosshairFill:"#E6E1E5",crosshairLabel:"#313033",tooltipFill:"#E6E1E5",tooltipBoldLabel:"#313033",tooltipLightLabel:"#313033",tooltipHeaderLine:"#313033",markerShadow:null,selectionRectFill:"rgba(78, 170, 255, 0.06)",selectionRectStroke:"#4EAAFF",selectionCircleStroke:"#938F99",tabColor:"#CAC4D0",bearFillColor:"#B3F32F",bullFillColor:"#FF9E45",toolkitSelectionColor:"#CAC4D0",toolkitFill:"#CAC4D0",toolkitIconRectOverFill:"#4F378B",toolkitIconRectSelectionFill:"#4F378B",toolkitIconRect:new Do(-4,-5,26,26),histogram:"#FF9E45",chartTitleFont:{color:"#E6E1E5",fontFamily:"Roboto",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#E6E1E5",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#313033",fontFamily:"Roboto",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#E6E1E5",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"},crosshairLabelFont:{color:"#313033",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},stripLineLabelFont:{color:"#938F99",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;default:n={axisLabel:"#686868",axisTitle:"#424242",axisLine:"#b5b5b5",majorGridLine:"#dbdbdb",minorGridLine:"#eaeaea",majorTickLine:"#b5b5b5",minorTickLine:"#d6d6d6",chartTitle:"#424242",legendLabel:"#353535",background:t?"#FFFFFF":"transparent",areaBorder:"Gray",errorBar:"#000000",crosshairLine:"#4f4f4f",crosshairBackground:"rgba(0, 0, 0, 0.1)",crosshairFill:"Material"===e?"#000816":"Fabric"===e?"#FFFFFF":"#212529",crosshairLabel:"#e5e5e5",tooltipFill:"#000816",tooltipBoldLabel:"#ffffff",tooltipLightLabel:"#dbdbdb",tooltipHeaderLine:"#ffffff",markerShadow:null,selectionRectFill:"rgba(41, 171, 226, 0.1)",selectionRectStroke:"#29abe2",selectionCircleStroke:"#29abe2",tabColor:"Material"===e?"#ff4081":"Fabric"===e?"#0078D6":"#317AB9",bearFillColor:"#2ecd71",bullFillColor:"#e74c3d",toolkitSelectionColor:"Material"===e?"#ff4081":"Fabric"===e?"#0078D6":"#317AB9",toolkitFill:"#737373",toolkitIconRectOverFill:"transparent",toolkitIconRectSelectionFill:"transparent",toolkitIconRect:new Do(0,0,16,16),chartTitleFont:{color:"Material"===e?"rgba(0, 0, 0, 1)":"Fabric"===e?"#333333":"#212529",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"Material"===e?"rgba(97, 97, 97, 1)":"Fabric"===e?"#666666":"#676767",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"Material"===e?"rgba(0, 0, 0, 1)":"Fabric"===e?"#333333":"#212529",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"Material"===e?"rgba(97, 97, 97, 1)":"#666666",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"Material"===e?"rgba(249, 250, 251, 1)":"Fabric"===e?"#333333":"#F9FAFB",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"Material"===e?"rgba(0, 0, 0, 1)":"Fabric"===e?"#333333":"#212529",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"Material"===e?"rgba(97, 97, 97, 1)":"Fabric"===e?"#666666":"#676767",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"Material"===e?"rgba(0, 0, 0, 1)":"Fabric"===e?"#333333":"#212529",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},crosshairLabelFont:{color:"Material"===e?"rgba(249, 250, 251, 1)":"Fabric"===e?"#333333":"#F9FAFB",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},stripLineLabelFont:{color:"Material"===e?"rgba(158, 158, 158, 1)":"Fabric"===e?"#A6A6A6":"#676767",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"}}}return n}function Hve(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;case"MaterialDark":t={backRect:"#424242",thumb:"#616161",circle:"#757575",circleHover:"#616161",arrow:"#BDBDBD",grip:"#BDBDBD"};break;case"FabricDark":t={backRect:"#282727",thumb:"#333232",circle:"#4A4848",circleHover:"#514F4F",arrow:"#ADB5BD",grip:"#DADADA"};break;case"BootstrapDark":t={backRect:"#2A2A2A",thumb:"#313131",circle:"#414141",circleHover:"#484848",arrow:"#DADADA",grip:"#FFFFFF"};break;case"Bootstrap5":t={backRect:"#E9ECEF",thumb:"#ADB5BD",circle:"#F8F9FA",circleHover:"#F8F9FA",arrow:"#6E757D",grip:"#6E757D"};break;case"Bootstrap5Dark":t={backRect:"#343A40",thumb:"#ADB5BD",circle:"#2B3035",circleHover:"#2B3035",arrow:"#ADB5BD",grip:"#ADB5BD"};break;case"HighContrast":t={backRect:"#757575",thumb:"#BFBFBF",circle:"#FFFFFF",circleHover:"#FFFFFF",arrow:"#ADB5BD",grip:"#969696"};break;case"Tailwind3Dark":t={backRect:"#282F3C",thumb:"#374151",circle:"#111827",circleHover:"#eee",arrow:"#D1D5DB",grip:"#D1D5DB"};break;case"Fluent":t={backRect:"#F3F2F1",thumb:"#E1DFDD",circle:"#FFFFFF",circleHover:"#E1DFDD",arrow:"#605E5C",grip:"#605E5C"};break;case"FluentDark":t={backRect:"#252423",thumb:"#323130",circle:"#3B3A39",circleHover:"#3B3A39",arrow:"#ADB5BD",grip:"#A19F9D"};break;case"Fluent2":t={backRect:"#F5F5F5",thumb:"#F0F0F0",circle:"#FAFAFA",circleHover:"#FAFAFA",arrow:"#424242",grip:"#424242"};break;case"Fluent2Dark":t={thumb:"#0A0A0A",backRect:"#141414",circle:"#1F1F1F",circleHover:"#1F1F1F",arrow:"#D6D6D6",grip:"#D6D6D6"};break;case"Fluent2HighContrast":t={thumb:"#333333",backRect:"#000000",circle:"#000000",circleHover:"#000000",arrow:"#FFFFFF",grip:"#FFFFFF"};break;case"Material3":t={backRect:"rgba(103, 80, 164, 0.05)",thumb:" rgba(103, 80, 164, 0.14)",circle:"#FFFFFF",circleHover:"#E1DFDD",arrow:"#49454E",grip:"#49454E"};break;case"Material3Dark":t={backRect:"rgba(208, 188, 255, 0.05)",thumb:"rgba(208, 188, 255, 0.14)",circle:"#FFFFFF",circleHover:"#E1DFDD",arrow:"#CAC4D0",grip:"#CAC4D0"};break;case"Tailwind3":t={backRect:"#E5E7EB",thumb:"#D1D5DB",circle:"#FFFFFF",circleHover:"#eee",arrow:"#6B7280",grip:"#6B7280"};break;case"TailwindDark":t={backRect:"#6B7280",thumb:"#374151",circle:"#4B5563",circleHover:"#4B5563",arrow:"#ADB5BD",grip:"#D1D5DB"};break;default:t={backRect:"#f5f5f5",thumb:"#e0e0e0",circle:"#fff",circleHover:"#eee",arrow:"#9e9e9e",grip:"#9e9e9e"}}return t}jve.prototype.measureAxis=function(e){var t=this.chart,i=t.chartArea.width?ive(t.chartArea.width,t.availableSize.width):null;this.crossAt(t),this.seriesClipRect=new Do(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=Hye(this.initialClipRect,new Eve(this.leftSize,this.rightSize,0,0)),this.measureColumnAxis(t,this.initialClipRect),this.initialClipRect=Hye(this.initialClipRect,new Eve(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=Hye(this.seriesClipRect,new Eve(this.leftSize,this.rightSize,0,0)),this.measureColumnAxis(t,this.initialClipRect),this.seriesClipRect=Hye(this.seriesClipRect,new Eve(0,0,this.topSize,this.bottomSize)),i&&this.calculateFixedChartArea(t,i),this.chart.delayRedraw||(t.refreshAxis(),this.calculateAxisSize(this.seriesClipRect))},jve.prototype.calculateFixedChartArea=function(e,t){this.seriesClipRect.width=t,this.seriesClipRect.x=e.availableSize.width-e.margin.right-t-("Right"===e.legendSettings.position?e.legendModule.legendBounds.width:0);for(var i=0,n=e.rows;i<n.length;i++){var o=n[i];this.seriesClipRect.x-=Vye(o.farSizes)}},jve.prototype.measureRowAxis=function(e,t){this.calculateRowSize(t);for(var i,n=0,o=e.rows;n<o.length;n++)(i=o[n]).nearSizes=[],i.farSizes=[],i.insideNearSizes=[],i.insideFarSizes=[],this.arrangeAxis(i),this.measureDefinition(i,e,new Eo(e.availableSize.width,i.computedHeight)),this.leftSize<Vye(i.nearSizes)&&(this.leftSize=Vye(i.nearSizes)),this.rightSize<Vye(i.farSizes)&&(this.rightSize=Vye(i.farSizes))},jve.prototype.measureColumnAxis=function(e,t){this.calculateColumnSize(t);for(var i,n=0,o=e.columns;n<o.length;n++)(i=o[n]).farSizes=[],i.nearSizes=[],i.insideNearSizes=[],i.insideFarSizes=[],this.arrangeAxis(i),this.measureDefinition(i,e,new Eo(i.computedWidth,e.availableSize.height)),this.bottomSize<Vye(i.nearSizes)&&(this.bottomSize=Vye(i.nearSizes)),this.topSize<Vye(i.farSizes)&&(this.topSize=Vye(i.farSizes))},jve.prototype.measureDefinition=function(e,t,i){for(var n=0,o=e.axes;n<o.length;n++){var r=o[n],s=r.scrollbarSettings.height;r.scrollBarHeight=t.scrollBarModule&&t.zoomModule&&t.zoomSettings.enableScrollbar&&r.enableScrollbarOnZooming&&t.zoomModule.isZoomed&&(r.zoomFactor<1||0<r.zoomPosition)?s:0,r.scrollBarHeight=t.scrollBarModule&&(t.zoomModule&&t.zoomSettings.enableScrollbar&&r.enableScrollbarOnZooming&&t.zoomModule.isZoomed&&(r.zoomFactor<1||0<r.zoomPosition)||r.scrollbarSettings.enable)?s:0,r.getModule(t),r.baseModule.calculateRangeAndInterval(i,r),e.computeSize(r,r.scrollBarHeight,e,t)}0<e.farSizes.length&&(e.farSizes[e.farSizes.length-1]-=10),0<e.nearSizes.length&&(e.nearSizes[e.nearSizes.length-1]-=10)},jve.prototype.calculateAxisSize=function(e){var t,i,n,o,r,s=this.chart,a=0,l=0,h=0;this.calculateRowSize(e);for(var d=0,p=s.rows.length;d<p;d++)for(var c,a=0,l=0,u=0,g=(c=s.rows[d]).axes.length;u<g;u++){if(r=(i=c.axes[u]).plotOffset,0===i.rect.height){i.rect.height=c.computedHeight;for(var h=0,m=d+1,f=d+i.span;m<f;m++)h+=(t=s.rows[m]).computedHeight;i.rect.y=c.computedTop-h+(i.plotOffsetTop||r),i.rect.height=i.rect.height+h-this.getAxisOffsetValue(i.plotOffsetTop,i.plotOffsetBottom,i.plotOffset),i.rect.width=0}i.isAxisOpposedPosition?(n="Inside"===i.labelPosition&&"Vertical"===i.orientation?0<l?e.x+e.width+Vye(Gye(c.farSizes,l))+i.maxLabelSize.width+i.multiLevelLabelHeight+("Inside"===i.tickPosition?i.majorTickLines.height:0)+i.labelPadding:e.x+e.width-Vye(Gye(c.insideFarSizes,l)):e.x+e.width+Vye(Gye(c.farSizes,l)),i.rect.x=i.rect.x>=n?i.rect.x:n,l++):(n="Inside"===i.labelPosition&&"Vertical"===i.orientation?0<a?e.x-Vye(Gye(c.nearSizes,a))-i.maxLabelSize.width-i.multiLevelLabelHeight-("Inside"===i.tickPosition?i.majorTickLines.height:0)-i.labelPadding:e.x+Vye(Gye(c.insideNearSizes,a)):e.x-Vye(Gye(c.nearSizes,a)),i.rect.x=i.rect.x<=n?i.rect.x:n,a++)}this.calculateColumnSize(e);for(d=0,p=s.columns.length;d<p;d++)for(var y,u=l=a=0,v=(y=s.columns[d]).axes.length;u<v;u++){if(r=(i=y.axes[u]).plotOffset,0===i.rect.width){for(var m=d,b=d+i.span;m<b;m++)t=s.columns[m],i.rect.width+=t.computedWidth;i.rect.x=y.computedLeft+(i.plotOffsetLeft||r),i.rect.width-=this.getAxisOffsetValue(i.plotOffsetLeft,i.plotOffsetRight,i.plotOffset),i.rect.height=0}i.isAxisOpposedPosition?(o="Inside"===i.labelPosition&&"Horizontal"===i.orientation?0<l?e.y-Vye(Gye(y.farSizes,l))-i.maxLabelSize.height-i.multiLevelLabelHeight-("Inside"===i.tickPosition?i.majorTickLines.height:0)-i.labelPadding:e.y+Vye(Gye(y.insideFarSizes,l)):e.y-Vye(Gye(y.farSizes,l)),i.rect.y=i.rect.y<=o?i.rect.y:o,l++):(o="Inside"===i.labelPosition&&"Horizontal"===i.orientation?0<a?e.y+e.height+Vye(Gye(y.nearSizes,a))+i.maxLabelSize.height+i.multiLevelLabelHeight+("Inside"===i.tickPosition?i.majorTickLines.height:0)+i.labelPadding:e.y+e.height-Vye(Gye(y.insideNearSizes,a)):e.y+e.height+Vye(Gye(y.nearSizes,a)),i.rect.y=i.rect.y>=o?i.rect.y:o,a++)}},jve.prototype.measure=function(){for(var e,t,i,n,o=this.chart,r=0,s=o.axisCollections;r<s.length;r++){var a=s[r];if("Vertical"===a.orientation){o.verticalAxes.push(a),n=this.getActualRow(a),e=o.rows[n],this.pushAxis(e,a);for(var l=n+a.span>o.rows.length?o.rows.length:n+a.span,h=n+1;h<l;h++)(i=o.rows[h]).axes[e.axes.length-1]=a,o.rows[h]=i;o.rows[n]=e}else{o.horizontalAxes.push(a),n=this.getActualColumn(a),t=o.columns[n],this.pushAxis(t,a),l=n+a.span>o.columns.length?o.columns.length:n+a.span;for(h=n+1;h<l;h++)(i=o.columns[h]).axes[t.axes.length-1]=a,o.columns[h]=i;o.columns[n]=t}a.isRTLEnabled=o.enableRtl,a.setIsInversedAndOpposedPosition()}},jve.prototype.getAxisOffsetValue=function(e,t,i){return e?e+(t||i):t?t+i:2*i},jve.prototype.crossAt=function(e){for(var t=0,i=e.axisCollections;t<i.length;t++){var n=i[t];if(null!==n.crossesAt)if(n.crossesInAxis)for(var o=2,r=e.axisCollections.length;o<r;o++)n.crossesInAxis===e.axisCollections[o].name&&(n.crossInAxis=e.axisCollections[o],n.crossAt=this.updateCrossAt(n.crossInAxis,n.crossesAt));else e.requireInvertedAxis?n.crossInAxis="Horizontal"===n.orientation?e.primaryXAxis:e.primaryYAxis:n.crossInAxis="Horizontal"===n.orientation?e.primaryYAxis:e.primaryXAxis,n.crossAt=this.updateCrossAt(n.crossInAxis,n.crossesAt)}},jve.prototype.updateCrossAt=function(e,t){switch(e.valueType){case"DateTime":var i={skeleton:"full",type:"dateTime"},n=this.chart.intl.getDateParser(i),i=this.chart.intl.getDateFormat(i);return Date.parse(n(i(new Date(Sa.parse.parseJson({val:t}).val))));case"Category":return parseFloat(t)?parseFloat(t):e.labels.indexOf(t);case"Logarithmic":return Bye(t,e.logBase);default:return t}},jve.prototype.pushAxis=function(e,t){for(var i=0,n=e.axes.length;i<=n;i++)if(!e.axes[i]){e.axes[i]=t;break}},jve.prototype.arrangeAxis=function(e){for(var t=[],i=0,n=e.axes.length;i<=n;i++)e.axes[i]&&t.push(e.axes[i]);e.axes=t},jve.prototype.getActualColumn=function(e){var t=this.chart.columns.length,e=e.columnIndex;return t<=e?t-1:e<0?0:e},jve.prototype.getActualRow=function(e){var t=this.chart.rows.length,e=e.rowIndex;return t<=e?t-1:e<0?0:e},jve.prototype.calculateRowSize=function(e){for(var t,i=this.chart,n=e.y+e.height,o=0,r=Math.max(0,e.height),s=0,a=i.rows.length;s<a;s++)o=-1!==(t=i.rows[s]).height.indexOf("%")?Math.min(r,e.height*parseInt(t.height,10)/100):Math.min(r,parseInt(t.height,10)),n-=t.computedHeight=o=s!==a-1?o:r,t.computedTop=n,r-=o},jve.prototype.calculateColumnSize=function(e){for(var t,i=this.chart,n=e.x,o=0,r=Math.max(0,e.width),s=0,a=i.columns.length;s<a;s++)o=-1!==(t=i.columns[s]).width.indexOf("%")?Math.min(r,e.width*parseInt(t.width,10)/100):Math.min(r,parseInt(t.width,10)),t.computedWidth=o=s!==a-1?o:r,t.computedLeft=n,n+=o,r-=o},jve.prototype.renderAxes=function(){var e,t,i=this.chart,n=i.renderer.createGroup({id:i.element.id+"AxisInsideCollection"}),o=i.renderer.createGroup({id:i.element.id+"AxisOutsideCollection"});o&&o.setAttribute("aria-hidden","true"),i.scrollBarModule&&(i.scrollBarModule.topScrollBarCount=0,i.scrollBarModule.bottomScrollBarCount=0,i.scrollBarModule.leftScrollBarCount=0,i.scrollBarModule.rightScrollBarCount=0);for(var r=0,s=i.axisCollections.length;r<s;r++){var a,l=!0;(a=i.axisCollections[r]).index=r,this.element=i.renderer.createGroup({id:i.element.id+"AxisGroup"+r+"Inside"}),this.element&&this.element.setAttribute("aria-hidden","true"),(e=i.renderer.createGroup({id:i.element.id+"AxisGroup"+r+"Outside"}))&&e.setAttribute("aria-hidden","true");for(var h=0,d=a.series;h<d.length;h++){var p=d[h];if((a.name===p.yAxisName||a.name===p.xAxisName)&&(l=p.visible,l="Pareto"!==p.category||p.paretoOptions.showAxis||"Line"!==p.type?l:!1))break}l?(t=this.findAxisPosition(a),this.drawAxis(a,r,t,e,n,o)):a.zoomingScrollBar&&a.zoomingScrollBar.removeScrollSvg()}return this.drawPaneLines(i,n),O0e(i.enableCanvas,i.svgObject,n,i.redraw),o},jve.prototype.renderScrollbar=function(e,t){var i=!je(e.zoomModule)&&e.zoomModule.isZoomed;t.zoomingScrollBar||e.scrollBarModule.injectTo(t,e),(i&&(t.zoomFactor<1||0<t.zoomPosition)||t.scrollbarSettings.enable&&(t.zoomFactor<=1||0<=t.zoomPosition))&&!t.zoomingScrollBar.isScrollUI?(e.scrollElement||(e.scrollElement=nve(e.redraw,e.element.id+"_scrollElement")||Q("div",{id:e.element.id+"_scrollElement"})),O0e(!1,e.scrollElement,t.zoomingScrollBar.render(!0),!0)):1===t.zoomFactor&&0===t.zoomPosition&&t.zoomingScrollBar.svgObject&&!t.scrollbarSettings.enable?t.zoomingScrollBar.destroy():t.zoomingScrollBar.svgObject&&(i=(t.isAxisOpposedPosition&&"Horizontal"===t.orientation?-16:0)+t.rect.y+Math.max(.5,t.lineStyle.width/2),e=(t.isAxisOpposedPosition&&"Horizontal"!==t.orientation?16:0)+t.rect.x-("Vertical"===t.orientation?t.scrollbarSettings.height:0),"Horizontal"===t.orientation||"Left"!==t.scrollbarSettings.position&&"Right"!==t.scrollbarSettings.position?"Horizontal"!==t.orientation||"Top"!==t.scrollbarSettings.position&&"Bottom"!==t.scrollbarSettings.position||(i=Mye(t.zoomingScrollBar,!0)):e=Mye(t.zoomingScrollBar,!1),t.zoomingScrollBar.svgObject.style.top=i+"px",t.zoomingScrollBar.svgObject.style.left=e+"px"),t.zoomingScrollBar.isScrollUI&&(t.zoomingScrollBar.isScrollUI=!1)},jve.prototype.drawPaneLines=function(e,t){this.element=e.renderer.createGroup({id:e.element.id+"DefinitionLine"});for(var i=0,n=e.rows.length;i<n;i++){var o=e.rows[i];o.border.color&&this.drawBottomLine(o,i,!0)}for(i=0,n=e.columns.length;i<n;i++){var r=e.columns[i];r.border.color&&this.drawBottomLine(r,i,!1)}t=t||ie(e.element.id+"AxisInsideCollection"),this.chart.enableCanvas||t.appendChild(this.element)},jve.prototype.drawAxis=function(e,t,i,n,o,r){e.updateCrossValue();var s="",s="Horizontal"===e.orientation?(e.visible&&e.internalVisibility&&0<e.lineStyle.width&&this.drawAxisLine(e,t,e.plotOffset,0,0,0,e.plotOffsetLeft,e.plotOffsetRight,i?n:this.element,e.updatedRect),"X"):(e.visible&&e.internalVisibility&&0<e.lineStyle.width&&this.drawAxisLine(e,t,0,e.plotOffset,e.plotOffsetBottom,e.plotOffsetTop,0,0,i?n:this.element,e.updatedRect),"Y");(0<e.majorGridLines.width||0<e.majorTickLines.width||0<e.minorTickLines.width||0<e.minorGridLines.width)&&this["draw"+s+"AxisGridLine"](e,t,i||"Inside"===e.tickPosition?n:this.element,e.updatedRect),e.visible&&e.internalVisibility&&(this["draw"+s+"AxisLabels"](e,t,i||"Inside"===e.labelPosition?n:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect),this["draw"+s+"AxisBorder"](e,t,i||"Inside"===e.labelPosition?n:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect),this["draw"+s+"AxisTitle"](e,t,i?n:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect)),this.chart.enableCanvas||(o.appendChild(this.element),n&&0<n.childNodes.length&&r.appendChild(n)),this.chart.scrollBarModule&&(this.chart.zoomSettings.enableScrollbar&&e.enableScrollbarOnZooming||e.scrollbarSettings.enable)?this.renderScrollbar(this.chart,e):e.zoomingScrollBar&&e.zoomingScrollBar.destroy()},jve.prototype.findAxisPosition=function(e){return null!==e.crossAt&&e.isInside(e.crossInAxis.visibleRange)},jve.prototype.drawBottomLine=function(e,t,i){var n,o,r,s,a=this.chart,i=i?(r=s=e.computedTop+e.computedHeight,o=(n=this.seriesClipRect.x)+this.seriesClipRect.width,"Row"):(n=o=e.computedLeft,s=(r=this.seriesClipRect.y)+this.seriesClipRect.height,"Column"),i={id:a.element.id+"_AxisBottom_"+i+t,x1:n,y1:r,x2:o,y2:s,"stroke-width":e.border.width,stroke:e.border.color};this.htmlObject=a.renderer.drawLine(i),O0e(a.enableCanvas,this.element,this.htmlObject)},jve.prototype.drawAxisLine=function(e,t,i,n,o,r,s,a,l,h){var d=this.chart,p=(c=ie(d.element.id+"AxisLine_"+t))?c.getAttribute("d"):"",c=null,c={id:d.element.id+"AxisLine_"+t,d:"M "+(h.x-i-s)+" "+(h.y-n-r)+" L "+(h.x+h.width+i+a)+" "+(h.y+h.height+n+o),"stroke-dasharray":e.lineStyle.dashArray,"stroke-width":e.lineStyle.width,stroke:e.lineStyle.color||d.themeStyle.axisLine};this.htmlObject=d.renderer.drawPath(c),O0e(d.enableCanvas,l,this.htmlObject,d.redraw,!0,"x","y",null,p,null,null,null,d.duration)},jve.prototype.drawYAxisGridLine=function(e,t,i,n){for(var o,r,s="Logarithmic"===e.valueType,a=-1<e.valueType.indexOf("Category"),l="",h="",d=e.isAxisOpposedPosition,p=d?e.majorTickLines.height:-e.majorTickLines.height,c=d?.5*e.lineStyle.width:.5*-e.lineStyle.width,u="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?.5:0,g=je(e.crossesAt)&&"Right"!==e.scrollbarSettings.position&&"Left"!==e.scrollbarSettings.position?d?e.scrollBarHeight:-e.scrollBarHeight:0,m="Inside"===e.tickPosition,f=m?n.x-p-c:n.x+p+c+g,y=e.visibleLabels.length,v=this.chart.themeStyle,b=1,w=(-1<e.valueType.indexOf("Category")&&"BetweenTicks"===e.labelPlacement&&0<y&&!this.chart.stockChart&&(y+=1),e.minorGridLines),C=e.minorTickLines,S=0;S<y;S++)(r=-1*(Yye(o=e.visibleLabels[S]?e.visibleLabels[S].value-u:e.visibleLabels[S-1].value+e.visibleRange.interval-u,e)*n.height)+(n.y+n.height))>=n.y&&n.y+n.height>=r&&(this.chart.redraw&&!this.chart.enableCanvas&&this.chart.zoomRedraw&&e.visible&&e.majorGridLines.width&&0!==S&&!ie(this.chart.element.id+"_MajorGridLine_"+t+"_"+S)&&(l="M "+this.seriesClipRect.x+" "+(this.seriesClipRect.y+(e.isInversed?this.seriesClipRect.height+this.seriesClipRect.height/(S||1)*b:-this.seriesClipRect.height/(S||1)*b))+" L "+(this.seriesClipRect.x+this.seriesClipRect.width)+" "+(this.seriesClipRect.y+(e.isInversed?this.seriesClipRect.height+this.seriesClipRect.height/(S||1)*b:-this.seriesClipRect.height/(S||1)*b)),this.updateAxisElement(e,t,l,S,"_MajorGridLine_",this.element,!1),ie(i.id).appendChild(this.element.childNodes[this.element.childNodes.length-1])),(Lye(o,e.visibleRange)||this.isBorder(e,S,r))&&(l="M "+this.seriesClipRect.x+" "+r+" L "+(this.seriesClipRect.x+this.seriesClipRect.width)+" "+r,this.renderGridLine(e,t,l,e.majorGridLines,"_MajorGridLine_",S,this.element,v.majorGridLine,e.majorGridLines.dashArray)),this.chart.redraw&&this.chart.zoomRedraw&&e.majorTickLines.width&&0!==S&&!ie(this.chart.element.id+"_MajorTickLine_"+t+"_"+S)&&!this.chart.enableCanvas&&e.visible&&(h="M "+this.seriesClipRect.x+" "+(this.seriesClipRect.y+(e.isInversed?this.seriesClipRect.height+this.seriesClipRect.height/(S||1)*b:-this.seriesClipRect.height/(S||1)*b))+" L "+f+" "+(this.seriesClipRect.y+(e.isInversed?this.seriesClipRect.height+this.seriesClipRect.height/(S||1)*b:-this.seriesClipRect.height/(S||1)*b)),this.updateAxisElement(e,t,h,S,"_MajorTickLine_",i,!1),ie(i.id).appendChild(this.element.childNodes[this.element.childNodes.length-1]),b+=1),h="M "+(n.x+c+(m?g:0))+" "+r+" L "+f+" "+r,this.renderGridLine(e,t,h,e.majorTickLines,"_MajorTickLine_",S,i,v.majorTickLine),0<w.width||0<C.width)&&0<e.minorTicksPerInterval&&(0!==S||!w0e(e)||s||a||this.renderMinorGridOnZooming(e,o,n,S,t,v,i),r=this.drawAxisMinorLine(e,o,n,S),this.renderGridLine(e,t,r[0],w,"_MinorGridLine_",S,this.element,v.minorGridLine,w.dashArray),this.renderGridLine(e,t,r[1],C,"_MinorTickLine_",S,i,v.minorTickLine),S===y-1)&&w0e(e)&&s&&!a&&this.renderMinorGridOnZooming(e,o+e.visibleRange.interval,n,S,t,v,i);if(y&&this.previousYLabel>y&&!this.chart.enableCanvas&&e.visible&&this.chart.zoomRedraw&&this.chart.redraw)for(S=y;S<this.previousYLabel;S++){var A=this.seriesClipRect.y+(e.isInversed?this.seriesClipRect.height/y*(S-y+1)+this.seriesClipRect.height:-this.seriesClipRect.height/y*(S-y+1));e.majorGridLines.width&&(l="M "+this.seriesClipRect.x+" "+ +A+" L "+(this.seriesClipRect.x+this.seriesClipRect.width)+" "+A,this.updateAxisElement(e,t,l,S,"_MajorGridLine_",this.element,!0)),e.majorTickLines.width&&(h="M "+this.seriesClipRect.x+" "+A+" L "+f+" "+A,this.updateAxisElement(e,t,h,S,"_MajorTickLine_",i,!0))}},jve.prototype.isBorder=function(e,t,i){var n=this.chart.chartArea.border,o=this.seriesClipRect,r=e.orientation,s="Horizontal"===r?o.x:o.y,o="Horizontal"===r?o.width:o.height,a="Horizontal"===r?0:e.visibleLabels.length-1,r="Horizontal"===r?e.visibleLabels.length-1:0;return 0<e.plotOffset||(i===s||i===s+o)&&(n.width<=0||"transparent"===n.color)||i!==s&&t===a||i!==s+o&&t===r},jve.prototype.drawYAxisLabels=function(e,t,i,n){var o,r,s,a,l=this.chart,h=0,d=0,p=e.labelPadding,c="Inside"===e.labelPosition,u=e.isAxisOpposedPosition,g=(e.labelPosition===e.tickPosition?e.majorTickLines.height:0)+p+.5*e.lineStyle.width,m=e.angle%360,f=-90==m||90==m||270==m||-270==m,y=(g+=f?c?5:-5:0,g=u?g:-g,l.renderer.createGroup({id:l.element.id+"AxisLabels"+t})),p=je(e.crossesAt)&&"Left"!==e.scrollbarSettings.position&&"Right"!==e.scrollbarSettings.position?e.scrollBarHeight*(u?1:-1):0,v=e.isAxisInverse,b=1,w=v?n.y:n.y+n.height,C=!u&&!c||u&&c,S=c?C?g:-g:C?g+(l.enableRtl?-p:p):-g+(l.enableRtl?-p:p),A=[],x=[],I=(e.visibleLabels.map(function(e){A.push(e.size.width),x.push(e.breakLabelSize.width)}),Math.max.apply(Math,A)),T=Math.max.apply(Math,x),E=I;-45<=m&&m<=45&&0!=m&&(E=I*Math.cos(m*Math.PI/180))<0&&(E=-E);for(var D=0,M=e.visibleLabels.length;D<M;D++){switch(o=e.visibleLabels[D],r=(k=Eye(e.visibleLabels[D].originalText))?e.visibleLabels[D].breakLabelSize:e.visibleLabels[D].size,d=Yye(e.visibleLabels[D].value,e)*n.height+(l.stockChart?7:0),d=Math.floor(-1*d+(n.y+n.height)),P=r.height/8*e.visibleLabels[D].text.length/2,B=l.requireInvertedAxis&&"Inside"===e.labelPosition?0:r.height/4*3+3,a=n.height/e.visibleLabels.length,a=("Trim"===e.labelIntersectAction||"Wrap"===e.labelIntersectAction)&&0!=m&&r.width>a?a:r.width,d=k?"Inside"===e.labelPosition?d-r.height/2-P+B:d-P:"Inside"===e.labelPosition?d+B:d,"Inside"===e.labelPosition&&(0===D&&!e.isInversed||D===M-1&&e.isInversed)&&(l.stockChart?d-=B:d-=B-(l.requireInvertedAxis&&"Inside"===e.labelPosition?0:e.opposedPosition?-g:g)),P=(e.majorGridLines.width>e.majorTickLines.width?e.majorGridLines:e.majorTickLines).width,"Far"===e.labelStyle.textAlignment?d=d-P-10:"Near"===e.labelStyle.textAlignment&&(d=d+P+10),B=c?S+(0==m?r.width:k?T:I)/2:S-(0==m?r.width:k?T:E)/2,e.enableWrap&&l.requireInvertedAxis&&m&&(!e.opposedPosition&&"Inside"===e.labelPosition||e.opposedPosition&&"Outside"===e.labelPosition)&&(B=e.opposedPosition?B-I/2:B+I/2),h=u?0!==e.scrollBarHeight&&"Right"!==e.scrollbarSettings.position&&"Left"!==e.scrollbarSettings.position?n.x+e.scrollBarHeight+g-B:n.x-B:n.x+B,f&&(h+=u?5:-5),B=S,s=new ko(l.element.id+t+"_AxisLabel_"+D,h,d,"middle",o.text,"","middle",m),e.edgeLabelPlacement){case"None":break;case"Hide":((0===D||v&&D===M-1)&&s.y>n.y||(D===M-1||v&&0===D)&&s.y-.5*r.height<n.y)&&(s.text="");break;case"Shift":(0===D||v&&D===M-1)&&s.y>n.y+n.height?s.y=d=n.y+n.height:(D===M-1||v&&0===D)&&s.y<=0&&(s.y=d=n.y+.5*r.height)}var k,P=s.y,B=s.y-a;k&&(P=s.y-a/2,B=s.y+a/2),(90==m||270==m)&&"Hide"===e.labelIntersectAction&&0!==D&&(v?B<=w:w<=P)||(w=v?P:B,s.transform="rotate("+m+","+h+","+d+")",this.chart.redraw&&this.chart.zoomRedraw&&!ie(s.id)&&!this.chart.enableCanvas&&e.visible&&(k=s.y,s.y=this.seriesClipRect.y+(e.isInversed?this.seriesClipRect.height+this.seriesClipRect.height/(D||1)*b:-this.seriesClipRect.height/(D||1)*b),this.updateAxisElement(e,t,"",D,"_AxisLabel_",y,!1,s,o),s.y=k,b+=1),sve(l.renderer,s,o.labelStyle,o.labelStyle.color||l.themeStyle.axisLabelFont.color,y,!1,l.redraw,!0,!0,l.duration,null,0,null,l.enableCanvas,null,l.themeStyle.axisLabelFont,new Tve(h,d)))}if(this.previousYLabel&&e.visibleLabels.length&&this.previousYLabel>e.visibleLabels.length&&!this.chart.enableCanvas&&e.visible&&this.chart.zoomRedraw&&l.redraw&&s.text)for(D=e.visibleLabels.length;D<this.previousYLabel;D++)s.y=this.seriesClipRect.y+(e.isInversed?this.seriesClipRect.height+this.seriesClipRect.height/e.visibleLabels.length*(D-e.visibleLabels.length+1):-(this.seriesClipRect.height/e.visibleLabels.length*(D-e.visibleLabels.length+1))),s.id=l.element.id+t+"_AxisLabel_"+D,this.updateAxisElement(e,t,"",D,"_AxisLabel_",y,!0,s,o);else this.previousYLabel=e.visibleLabels.length;this.chart.enableCanvas||(l.delayRedraw?e.visible&&e.internalVisibility&&this.createZoomingLabel(this.chart,y,e,t,n):O0e(l.enableCanvas,i,y,l.redraw))},jve.prototype.rangeAnimate=function(t,i,e,n,o,r,s){var a=this;i&&new Vt({}).animate(i,{duration:e,progress:function(){var e,t=ie(i.id);t.style.animation="",n?o0e(parseFloat(t.getAttribute("x")),parseFloat(t.getAttribute("y")),o)?t.style.visibility="visible":t.style.visibility="hidden":(e=t.getAttribute("d").split(" "),o0e(parseFloat(e[1]),parseFloat(e[2]),o)?t.style.visibility="visible":t.style.visibility="hidden")},end:function(){var e=ie(i.id);e.style.visibility="",r&&s>=t.visibleLabels.length&&(Pye(e),n)&&("Vertical"===t.orientation?a.previousYLabel=t.visibleLabels.length:a.previousXLabel=t.visibleLabels.length)}})},jve.prototype.getAxisLabelXvalue=function(e,t,i){var n=t.lineBreakAlignment,o="Inside"===t.labelPosition,t=t.isAxisOpposedPosition;return t&&o||!t&&!o?"Right"===n?e:"Center"===n?e-i/2:e-i:"Left"===n?e:"Center"===n?e+i/2:e+i},jve.prototype.drawYAxisBorder=function(e,t,i,n){if(0<e.border.width){for(var o,r=void 0,s="Outside"===e.labelPosition&&"Right"!==e.scrollbarSettings.position&&"Left"!==e.scrollbarSettings.position?e.scrollBarHeight:0,a=e.isAxisOpposedPosition,l=(s*=a?1:-1,n.height/e.visibleRange.delta*("DateTime"===e.valueType?e.dateTimeInterval:e.visibleRange.interval)),h=void 0,d=e.maxLabelSize.width+10+(e.tickPosition===e.labelPosition?e.majorTickLines.height:0),p="",c="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?-.5:0,u=a&&"Inside"===e.labelPosition||!a&&"Outside"===e.labelPosition?n.x-d+s:n.x+d+s,g=0,m=e.visibleLabels.length;g<m;g++)switch(o=Yye(e.visibleLabels[g].value+c,e),o=(e.isAxisInverse?1-o:o)*n.height,h="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?(r=-1*o+(n.y+n.height),-1*o-l+(n.y+n.height)):(r=-1*o+l/2+(n.y+n.height),-1*o-l/2+(n.y+n.height)),e.border.type){case"Rectangle":case"WithoutTopBorder":r>n.y+n.height?p+="M "+u+" "+(n.y+n.height)+" L "+u+" "+h+" ":Math.floor(n.y)>h?p+="M "+(n.x+s)+" "+r+" L "+u+" "+r+" L "+u+" "+n.y+" ":(p+="M "+(n.x+s)+" "+r+" L "+u+" "+r+" L "+u+" "+h+" ",g===e.visibleLabels.length-1&&(p+="M "+(n.x+s)+" "+h+" L "+u+" "+h+" "));break;case"WithoutTopandBottomBorder":r>n.y+n.height||h<Math.floor(n.y)||(p+="M "+(n.x+s)+" "+r+" L "+u+" "+r+" M "+u+" "+h+" L "+(n.x+s)+" "+h)}""!==(p+="Rectangle"===e.border.type?"M "+(n.x+s)+" "+n.y+" L "+(n.x+s)+" "+(n.y+n.height)+" ":"")&&this.createAxisBorderElement(e,t,p,i)}for(g=0;g<this.chart.visibleSeries.length;g++)if(0<e.multiLevelLabels.length&&this.chart.multiLevelLabelModule&&this.chart.visibleSeries[g].visible){this.chart.multiLevelLabelModule.renderYAxisMultiLevelLabels(e,t,i,n);break}},jve.prototype.drawYAxisTitle=function(e,t,i,n){var o,r,s,a,l,h;e.title&&(o=this.chart,r=!1,a=e.isAxisOpposedPosition,s=(null==e.titleRotation?a?90:-90:e.titleRotation)%360,h=("Inside"===e.tickPosition?0:e.majorTickLines.height+e.titlePadding)+("Inside"===e.labelPosition?0:e.maxLabelSize.width+e.multiLevelLabelHeight+this.padding),h="Outside"===e.tickPosition||"Inside"!==e.tickPosition&&"Inside"!==e.labelPosition||5===e.titlePadding?h:h+e.titlePadding,h=a?h+("Right"===e.scrollbarSettings.position||"Left"===e.scrollbarSettings.position?0:e.scrollBarHeight):-h-("Right"===e.scrollbarSettings.position||"Left"===e.scrollbarSettings.position?0:e.scrollBarHeight),(-90!=s&&!a||90!=s&&a)&&(h+=e.isAxisOpposedPosition?e.titleSize.width/2+("Inside"===e.labelPosition&&5!==e.labelPadding?0:e.labelPadding):-e.titleSize.width/2-("Inside"===e.labelPosition&&5!==e.labelPadding?0:e.labelPadding),r=!0),a=n.x+h,l=h=void 0,h="Center"===e.titleStyle.textAlignment?(l="middle",n.y+.5*n.height):"Near"===e.titleStyle.textAlignment?(l=e.opposedPosition?"end":"start",n.height+n.y):(l=e.opposedPosition?"start":"end",n.y),n=e.titleSize.height*(e.titleCollection.length-1),t=new ko(o.element.id+"_AxisTitle_"+t,a,h+(r?-n:-("Inside"===e.labelPosition&&5!==e.labelPadding?0:e.labelPadding)-n),l,e.titleCollection,"rotate("+s+","+a+","+h+")",null,s),sve(o.renderer,t,e.titleStyle,e.titleStyle.color||o.themeStyle.axisTitleFont.color,i,null,null,null,null,null,null,0,null,o.enableCanvas,null,o.themeStyle.axisTitleFont,new Tve(a,h)).setAttribute("aria-hidden","true"))},jve.prototype.drawXAxisGridLine=function(e,t,i,n){for(var o,r,s="Logarithmic"===e.valueType,a=-1<e.valueType.indexOf("Category"),l="",h="",d=1,p=e.isAxisOpposedPosition,c=p?-e.majorTickLines.height:e.majorTickLines.height,u=p?.5*-e.lineStyle.width:.5*e.lineStyle.width,g=je(e.crossesAt)&&"Top"!==e.scrollbarSettings.position&&"Bottom"!==e.scrollbarSettings.position?p?-e.scrollBarHeight:e.scrollBarHeight:0,m=-1<e.valueType.indexOf("Category")&&"BetweenTicks"===e.labelPlacement&&!this.chart.stockChart?.5:0,f=e.visibleLabels.length,y="Inside"===e.tickPosition,v=y?n.y-c-u:n.y+c+u+g,b=this.chart.themeStyle,w=(-1<e.valueType.indexOf("Category")&&0<f&&"BetweenTicks"===e.labelPlacement&&!this.chart.stockChart&&(f+=1),this.calculateGridLineId(i,f)),C=0;C<f;C++)(r=Yye(o="DateTimeCategory"!==e.valueType?e.visibleLabels[C]?e.visibleLabels[C].value-m:e.visibleLabels[C-1].value+e.visibleRange.interval-m:e.visibleLabels[C]?e.visibleLabels[C].value-m:e.visibleRange.max,e)*n.width+n.x)>=n.x&&n.x+n.width>=r&&((Lye(o,e.visibleRange)||this.isBorder(e,C,r))&&(this.chart.redraw&&(this.chart.pointsAdded&&!this.chart.pointsRemoved||this.chart.zoomRedraw)&&e.majorGridLines.width&&0!==C&&e.visible&&!ie(this.chart.element.id+"_MajorGridLine_"+t+"_"+C)&&!this.chart.enableCanvas&&(l="M "+(S=this.seriesClipRect.x+(this.chart.enableRtl!==e.isInversed?-this.seriesClipRect.width/f*d:this.seriesClipRect.width+this.seriesClipRect.width/(C||1)*d))+" "+(this.seriesClipRect.y+this.seriesClipRect.height)+" L "+S+" "+this.seriesClipRect.y,this.renderGridLine(e,t,l,e.majorGridLines,"_MajorGridLine_",C,this.element,b.majorGridLine,e.majorGridLines.dashArray,w.MajorGridLine&&w.MajorGridLine.ids?w.MajorGridLine.ids[C]:null,!!w.MajorGridLine&&w.MajorGridLine.isPointRemoved),this.rangeAnimate(e,this.element.childNodes[this.element.childNodes.length-1],this.chart.duration,!1,new Do(this.seriesClipRect.x,e.rect.y,this.seriesClipRect.x+this.seriesClipRect.width,this.chart.availableSize.height),!1,C),ie(i.id))&&ie(i.id).appendChild(this.element.childNodes[this.element.childNodes.length-1]),l="M "+r+" "+(this.seriesClipRect.y+this.seriesClipRect.height)+" L "+r+" "+this.seriesClipRect.y,this.renderGridLine(e,t,l,e.majorGridLines,"_MajorGridLine_",C,this.element,b.majorGridLine,e.majorGridLines.dashArray,w.MajorGridLine&&w.MajorGridLine.ids?w.MajorGridLine.ids[C]:null,!!w.MajorGridLine&&w.MajorGridLine.isPointRemoved)),this.chart.redraw&&this.chart.zoomRedraw&&e.majorTickLines.width&&!ie(this.chart.element.id+"_MajorTickLine_"+t+"_"+C)&&!this.chart.enableCanvas&&e.visible&&(h="M "+(this.seriesClipRect.x+(this.chart.enableRtl!==e.isInversed?-this.seriesClipRect.width/f*d:this.seriesClipRect.width+this.seriesClipRect.width/(C||1)*d))+" "+(n.y+u+(y?g:0))+" L "+(this.seriesClipRect.x+(this.chart.enableRtl!==e.isInversed?-this.seriesClipRect.width/f*d:this.seriesClipRect.width+this.seriesClipRect.width/(C||1)*d))+" "+v,this.updateAxisElement(e,t,h,C,"_MajorTickLine_",i,!1),ie(i.id).appendChild(this.element.childNodes[this.element.childNodes.length-1]),d+=1),h="M "+r+" "+(n.y+u+(y?g:0))+" L "+r+" "+v,this.renderGridLine(e,t,h,e.majorTickLines,"_MajorTickLine_",C,i,b.majorTickLine,null,w.MajorTickLine&&w.MajorTickLine.ids?w.MajorTickLine.ids[C]:null,!!w.MajorTickLine&&w.MajorTickLine.isPointRemoved),0<e.minorTicksPerInterval)&&(0<e.minorGridLines.width||0<e.minorTickLines.width)&&(0!==C||!w0e(e)||s||a||this.renderMinorGridOnZooming(e,o,n,C,t,b,i),r=this.drawAxisMinorLine(e,o,n,C),this.renderGridLine(e,t,r[0],e.minorGridLines,"_MinorGridLine_",C,this.element,b.minorGridLine,e.minorGridLines.dashArray,w.MinorGridLine&&w.MinorGridLine.ids?w.MinorGridLine.ids[C]:null,!!w.MinorGridLine&&w.MinorGridLine.isPointRemoved),this.renderGridLine(e,t,r[1],e.minorTickLines,"_MinorTickLine_",C,i,b.minorTickLine,null,w.MinorTickLine&&w.MinorTickLine.ids?w.MinorTickLine.ids[C]:null,!!w.MinorTickLine&&w.MinorTickLine.isPointRemoved),C===f-1)&&w0e(e)&&s&&!a&&this.renderMinorGridOnZooming(e,o+e.visibleRange.interval,n,C,t,b,i);if(f&&this.previousXLabel>f&&!this.chart.enableCanvas&&e.visible&&this.chart.zoomRedraw&&this.chart.redraw)for(C=f;C<this.previousXLabel;C++){var S=this.seriesClipRect.x+(this.chart.enableRtl!==e.isInversed?-this.seriesClipRect.width/f*(C-f+1):this.seriesClipRect.width+this.seriesClipRect.width/f*(C-f+1));e.majorGridLines.width&&(l="M "+S+" "+(this.seriesClipRect.y+this.seriesClipRect.height)+" L "+S+" "+this.seriesClipRect.y,this.updateAxisElement(e,t,l,C,"_MajorGridLine_",this.element,!0)),e.majorTickLines.width&&(h="M "+S+" "+(n.y+u+(y?g:0))+" L "+S+" "+v,this.updateAxisElement(e,t,h,C,"_MajorTickLine_",i,!0))}},jve.prototype.calculateGridLineId=function(h,d){var p=this,c={};return this.chart.pointsRemoved&&["MajorGridLine","MajorTickLine","MinorGridLine","MinorTickLine"].forEach(function(e){for(var t=ie(h.id),i=t.querySelectorAll('[id*="_'+e+'_"]'),n=[],o=0;o<i.length;o++)n.push(i[o]);var r="MajorGridLine"===e&&p.chart.chartArea.border.width?d-2:d,r="MinorGridLine"===e||"MinorTickLine"===e?d-1:r;if(0<n.length&&r<n.length){for(var s=n.length,a=0;a<s-r;a++)n[a]&&t.removeChild(n[a]),n.shift();var l=n.map(function(e){e=e.id.split("_");return parseInt(e[e.length-1],10)});c[e]={ids:l,isPointRemoved:!0}}}),c},jve.prototype.renderMinorGridOnZooming=function(e,t,i,n,o,r,s){t=this.drawAxisMinorLine(e,t,i,n,!0);this.renderGridLine(e,o,t[0],e.minorGridLines,"_MinorGridLine_",-1,this.element,r.minorGridLine,e.minorGridLines.dashArray),this.renderGridLine(e,o,t[1],e.minorTickLines,"_MinorTickLine_",-1,s,r.minorTickLine)},jve.prototype.drawAxisMinorLine=function(e,t,i,n,o){var r=t,s=0,a=0,l=e.visibleRange,t="Inside"===e.tickPosition,h=[],d=e.isAxisOpposedPosition?-e.minorTickLines.height:e.minorTickLines.height,p=1,c=1,u=t?i.y-d:i.y+d,g=t?i.x+d:i.x-d,m="",f="",y=e.isAxisInverse;if("Logarithmic"===e.valueType&&(c=(t=Math.pow(e.logBase,r-l.interval))+(p=(Math.pow(e.logBase,r)-t)/(e.minorTicksPerInterval+1))),"Horizontal"===e.orientation)for(var v=0;v<e.minorTicksPerInterval;v++)r=this.findLogNumeric(e,c,r,n,o),c+=p,Lye(r,l)&&(a=(r-l.min)/(l.max-l.min),a=Math.ceil((y?1-a:a)*i.width),s=Math.floor(a+i.x),f=this.chart.enableCanvas?(m=""===m?"M "+s+" "+this.seriesClipRect.y+" L "+s+" "+(this.seriesClipRect.y+this.seriesClipRect.height):m+" M "+s+" "+this.seriesClipRect.y+" L "+s+" "+(this.seriesClipRect.y+this.seriesClipRect.height),s=Math.floor(a+i.x),""===f?f.concat("M "+s+" "+i.y+" L "+s+" "+(u+e.scrollBarHeight)):f.concat(" M "+s+" "+i.y+" L "+s+" "+(u+e.scrollBarHeight))):(m=m.concat("M "+s+" "+this.seriesClipRect.y+"L "+s+" "+(this.seriesClipRect.y+this.seriesClipRect.height)),s=Math.floor(a+i.x),f.concat("M "+s+" "+i.y+"L "+s+" "+(u+e.scrollBarHeight))));else for(v=0;v<e.minorTicksPerInterval;v++)Lye(r=this.findLogNumeric(e,c,r,n,o),l)&&(a=(r-l.min)/(l.max-l.min),a=-1*Math.ceil((y?1-a:a)*i.height),s=Math.floor(a+i.y+i.height),f=this.chart.enableCanvas?(m=""===m?"M "+this.seriesClipRect.x+" "+s+" L "+(this.seriesClipRect.x+this.seriesClipRect.width)+" "+s:m+" M "+this.seriesClipRect.x+" "+s+" L "+(this.seriesClipRect.x+this.seriesClipRect.width)+" "+s,s=Math.floor(a+i.y+i.height),""===f?f.concat("M "+i.x+" "+s+" L "+(g-e.scrollBarHeight)+" "+s+" "):f.concat(" M "+i.x+" "+s+" L "+(g-e.scrollBarHeight)+" "+s+" ")):(m=m.concat("M "+this.seriesClipRect.x+" "+s+"L "+(this.seriesClipRect.x+this.seriesClipRect.width)+" "+s+" "),s=Math.floor(a+i.y+i.height),f.concat("M "+i.x+" "+s+"L "+(g-e.scrollBarHeight)+" "+s+" "))),c+=p;return h.push(m),h.push(f),h},jve.prototype.findLogNumeric=function(e,t,i,n,o){var r,s=e.visibleRange;return"Logarithmic"===e.valueType?i=Bye(t,e.logBase):"DateTime"===e.valueType?(r=e.dateTimeInterval/(e.minorTicksPerInterval+1),i=o?i-r:i+r):"DateTimeCategory"===e.valueType?(t="BetweenTicks"===e.labelPlacement?.5:0,i+=((e.visibleLabels[n+1]?e.visibleLabels[n+1].value-t:e.visibleRange.max)-(e.visibleLabels[n]?e.visibleLabels[n].value-t:e.visibleRange.min))/(e.minorTicksPerInterval+1)):(r=s.interval/(e.minorTicksPerInterval+1),i=o?i-r:i+r),i},jve.prototype.drawXAxisLabels=function(e,t,O,i){for(var n,o,r,s,a,l=this.chart,h=0,d=0,p=0,N=e.labelPadding,c=l.renderer.createGroup({id:l.element.id+"AxisLabels"+t}),u="Inside"===e.labelPosition,g=e.isAxisOpposedPosition,V=e.labelPosition===e.tickPosition?e.majorTickLines.height:0,m=V+N+.5*e.lineStyle.width,f=e.angle%360,_=0==f||-180==f||180==f,y=e.isAxisInverse,H=1,z=y?i.x+i.width:i.x,v=e.visibleLabels.length,b=!(e.scrollbarSettings.enable||!u&&je(e.crossesAt)&&(e.zoomFactor<1||0<e.zoomPosition))||"Top"===e.scrollbarSettings.position||"Bottom"===e.scrollbarSettings.position?0:e.scrollBarHeight,w=[],j=!1,C=[],S=new Eo(0,0),W=(m+=90==f||270==f||-90==f||-270==f?u?5:-5:0,!g&&!u||g&&u),Q=ie(l.element.id+"AxisLabels"+t),U=this.removeAxisLabelElements(e,Q),A=l.legendModule&&"Right"===l.legendSettings.position&&l.legendModule.legendBounds.height+l.legendModule.legendBounds.y>=e.rect.y?l.legendModule.legendBounds.width:0,q=W?f<=360&&180<=f||f<=-1&&-180<=f:1<=f&&f<=180||f<=-181&&-360<=f,x=0,I=v;x<I;x++){a=Eye((s=e.visibleLabels[x]).originalText)||"Wrap"===e.labelIntersectAction&&1<s.text.length,h=Yye(s.value,e)*i.width+i.x,R=s.size,e.enableWrap&&(R.height=So(s.text,e.labelStyle,l.themeStyle.axisLabelFont).height),r=i.width/v,k=(a?s.breakLabelSize:R).width,o=("Trim"===e.labelIntersectAction||"Wrap"===e.labelIntersectAction)&&0==f&&r<k?r:k,k=R.height/4,h-=a||0!=f?0:o/2,0!=f&&(h-=a?"Left"===e.lineBreakAlignment?s.breakLabelSize.width/2:"Right"===e.lineBreakAlignment?-s.breakLabelSize.width/2:0:-90==f||270==f?-k:90==f||-270==f?k:0),"Far"===e.labelStyle.textAlignment?h=h+o-10:"Near"===e.labelStyle.textAlignment&&(h=h-o+10),a&&"Center"!==e.lineBreakAlignment&&0==f&&(h+="Left"===e.lineBreakAlignment?-o/2:o/2);var T,E,G,D=a?_?e.opposedPosition||u?0:R.height:s.breakLabelSize.width/2:0,m=a?V+N+.5*e.lineStyle.width:m,d=u&&f?a?g?i.y+m+D:i.y-m-D:g?i.y+m+k:i.y-m-k:(D=a?W?m+b+(f?D:3*k):-(m+b+D):W?m+b+(f?1:3)*k:-(m+b+(f?k:1<s.index?2*k:0)),i.y+D*s.index),M=a?this.getAnchor(e):l.enableRtl?q?"":"end":l.isRtlEnabled||q?"end":"";if((T=new ko(l.element.id+t+"_AxisLabel_"+x,h,d,M)).id=(U&&Q&&Q.children[x]?Q.children[x]:T).id,0!=f&&(S=kye(s.labelStyle,s.originalText,f,l,l.themeStyle.axisLabelFont),n=f<0&&-90<f||f<-180&&-270<f||90<f&&f<180||270<f&&f<360),e.edgeLabelPlacement)switch(e.edgeLabelPlacement){case"None":break;case"Hide":if((0===x||y&&x===I-1)&&T.x<i.x||(x===I-1||y&&0===x)&&T.x+(0==f?o:S.width)>i.x+i.width)continue;break;case"Shift":if(x===I-2&&"MultipleRows"!==e.labelIntersectAction&&(p="start"===M||""===M?T.x+o:"middle"===M?T.x+o/2:T.x),(0===x||y&&x===I-1)&&(T.x<i.x||0!=f&&n&&T.x<i.x||"Center"===e.lineBreakAlignment&&T.x-s.size.width/s.text.length/2<i.x&&0==f))if(r-=i.x-T.x,""===M)h=T.x<=0?T.x=0:T.x,r=i.width/v;else if(n&&0!=f)r=i.width/v,i.x+r>T.x+S.width?T.x=h=i.x+m:T.x=h=i.x+r-m;else if(a&&"Center"===e.lineBreakAlignment&&"OnTicks"===e.labelPlacement&&0==f){for(var Y=0,X=0;X<s.text.length;X++){var K=So(s.text[X],e.labelStyle,l.themeStyle.axisLabelFont).width;Y<K&&(Y=K)}T.x=h=i.x+Y/2}else"start"===M&&0<T.x||(T.x=h=_?i.x:i.x+m);else(x===I-1||y&&0===x)&&(T.x+o>l.availableSize.width-l.border.width-A&&("start"===M||""===M)&&0==f||"start"===M&&0!=f&&!n&&T.x+S.width>l.availableSize.width-l.border.width-A||"middle"===M&&0!=f&&!n&&T.x+S.width/2>l.availableSize.width-l.border.width-A||"end"===M&&0!=f&&!n&&T.x>l.availableSize.width-l.border.width-A||"end"===M&&T.x>l.availableSize.width-l.border.width-A&&0==f||"middle"===M&&T.x+o/2>l.availableSize.width-l.border.width-A&&0==f)&&(E=0!=f?S.width:o,G=void 0,G="start"===M||""===M?T.x-(T.x+E-l.availableSize.width+l.border.width+5+A):"middle"===M?T.x-(T.x+E/2-l.availableSize.width+l.border.width+5+A):T.x-(T.x-(l.availableSize.width+l.border.width+5+A)),0!==p&&G<p?(E=l.availableSize.width-p,s.text=eve(E,s.originalText,e.labelStyle,l.isRtlEnabled,l.themeStyle.axisLabelFont)):T.x=h=G)}T.text=this.getLabelText(s,e,r),T.labelRotation=f;var k=void 0,D=void 0,D=a&&0==f?"Right"===e.lineBreakAlignment?(k=T.x-o,T.x):"Center"===e.lineBreakAlignment?(k=T.x-o/2,T.x+o/2):(k=T.x,T.x+o):(k=T.x,T.x+o);if(0!=f||"Hide"!==e.labelIntersectAction||0===x||!(y?z<=D:k<=z)){if(z=a?"Right"===e.lineBreakAlignment?y?T.x-o:T.x:"Center"===e.lineBreakAlignment?y?T.x-o/2:T.x+o/2:y?T.x:T.x+o:y?T.x:T.x+o,0!=f){var D=void 0,k=void 0,k=a?(B=P=0,D=s.breakLabelSize.height,B=s.breakLabelSize.height-4,"Center"===e.lineBreakAlignment?P=-s.breakLabelSize.width/2:"Right"===e.lineBreakAlignment&&(P=-s.breakLabelSize.width),W&&(B=s.breakLabelSize.height/(T.text.length+1)),new Do(T.x+P,T.y-B,s.breakLabelSize.width,D)):(D=d-(T.y-s.size.height/2),new Do(T.x,T.y-(s.size.height/2-5),s.size.width,D)),P=this.getRectanglePoints(k),B=a?k.x+k.width/2:h,k=a?k.y+k.height/2:d-D/2;if(T.transform=a?"rotate("+f+","+B+","+k+")":"rotate("+f+","+h+","+d+")",w.push(Qye(P,B,k,f)),j=!1,"None"!==e.labelIntersectAction)for(var J=x;0<J;J--)if(w[x]&&w[J-1]&&Uye(w[x],w[J-1])){j=!0,w[x]=null;break}for(var F,L,Z=0<f&&f<90||180<f&&f<270||f<-90&&-180<f||f<-270&&-360<f,R=new Do(T.x,T.y-(R.height/2+m/2),s.size.width,D),D=this.getRectanglePoints(R),$=[],ee=($.push(new Tve(Z?this.chart.availableSize.width:this.padding,e.rect.y)),$.push(new Tve(Z?this.chart.availableSize.width:this.padding,e.rect.y+e.maxLabelSize.height)),C.push(Qye(D,B,k,f)),new Do(0,e.rect.y,this.chart.availableSize.width,2*e.maxLabelSize.height)),te=0;te<C[x].length;te++)e.opposedPosition||o0e(C[x][te].x,C[x][te].y,ee)||"string"!=typeof T.text||(F=this.calculateIntersection(C[x][0],C[x][1],$[0],$[1]),L=Z?this.chart.availableSize.width-h:h,F=F.y-e.rect.y,L=Math.sqrt(L*L+F*F),T.text=eve(L,s.text,s.labelStyle,l.enableRtl,l.themeStyle.axisLabelFont))}this.chart.redraw&&(l.pointsAdded&&!l.pointsRemoved||this.chart.zoomRedraw)&&!ie(T.id)&&0!==x&&!this.chart.enableCanvas&&e.visible&&(R=T.x,T.x=this.seriesClipRect.x+(l.enableRtl!==e.isInversed?-this.seriesClipRect.width/(x||1)*H:this.seriesClipRect.width+this.seriesClipRect.width/(x||1)*H),D=T.transform,T.transform=f?"rotate("+f+","+T.x+","+parseFloat(T.transform.split(",")[2])+")":"",k=sve(l.renderer,T,s.labelStyle,s.labelStyle.color||l.themeStyle.axisLabelFont.color,c,e.isAxisOpposedPosition!==("Inside"===e.labelPosition),l.redraw,!0,null,l.duration,null,s.size,j,l.enableCanvas,null,l.themeStyle.axisLabelFont),this.rangeAnimate(e,k,this.chart.duration,!0,new Do(this.seriesClipRect.x,e.rect.y,this.seriesClipRect.x+this.seriesClipRect.width,this.chart.availableSize.height),!1,x),T.x=R,T.transform=D,H+=1);k=sve(l.renderer,T,s.labelStyle,s.labelStyle.color||l.themeStyle.axisLabelFont.color,c,e.isAxisOpposedPosition!==("Inside"===e.labelPosition),l.redraw,!0,null,l.duration,null,s.size,j,l.enableCanvas,null,l.themeStyle.axisLabelFont,new Tve(parseFloat(T.transform.split(",")[1]),parseFloat(T.transform.split(",")[2])));U&&(k.id=l.element.id+t+"_AxisLabel_"+x)}}if(this.previousXLabel&&v&&this.previousXLabel>v&&!this.chart.enableCanvas&&e.visible&&this.chart.zoomRedraw&&this.chart.redraw&&T.text)for(x=v;x<this.previousXLabel;x++)T.x=this.seriesClipRect.x+(l.enableRtl!==e.isInversed?-this.seriesClipRect.width/v*(x-v+1):this.seriesClipRect.width+this.seriesClipRect.width/v*(x-v+1)),T.id=l.element.id+t+"_AxisLabel_"+x,T.transform=f?"rotate("+f+","+T.x+","+parseFloat(T.transform.split(",")[2])+")":"",this.updateAxisElement(e,t,"",x,"_AxisLabel_",c,!0,T,s);else this.previousXLabel=v;this.chart.enableCanvas||(l.delayRedraw?e.visible&&e.internalVisibility&&this.createZoomingLabel(this.chart,c,e,t,i):O.appendChild(c))},jve.prototype.updateAxisElement=function(e,t,i,n,o,r,s,a,l){var h,d=-1<o.indexOf("Grid"),p=-1<o.indexOf("Label");p?h=sve(this.chart.renderer,a,l.labelStyle,l.labelStyle.color||this.chart.themeStyle.axisLabelFont.color,r,e.isAxisOpposedPosition!==("Inside"===e.labelPosition),this.chart.redraw,!0,null,this.chart.duration,null,0,null,this.chart.enableCanvas,null,this.chart.themeStyle.axisLabelFont):(this.renderGridLine(e,t,i,d?e.majorGridLines:e.majorTickLines,o,n,this.element,d?this.chart.themeStyle.majorGridLine:this.chart.themeStyle.majorTickLine,d?e.majorGridLines.dashArray:null),this.element&&r.childNodes&&(h=this.element.childNodes[r.childNodes.length-1])),this.rangeAnimate(e,h,this.chart.duration,p,new Do("Vertical"===e.orientation?0:this.seriesClipRect.x,("Vertical"===e.orientation?this.seriesClipRect:e.rect).y,this.seriesClipRect.width,this.seriesClipRect.height),s,n)},jve.prototype.removeAxisLabelElements=function(e,t){if(this.chart.pointsRemoved&&t&&t.childNodes.length){var i=!1;if(-1<e.valueType.indexOf("Category")){var n=[];e.visibleLabels.map(function(e){"string"!=typeof e.text?n.push(e.text.join("")):n.push(e.text)});for(var o=t.childNodes.length-1;0<=o;o--){var r=t.childNodes[o];-1===n.indexOf(r.textContent.trim())&&(t.removeChild(r),i=!0)}}else if(t.childNodes.length>e.visibleLabels.length)for(var s=0;s<t.childNodes.length-e.visibleLabels.length;s++)t.removeChild(t.childNodes[s]),i=!0;return i}return!1},jve.prototype.calculateIntersection=function(e,t,i,n){var o=i.x-n.x,r=e.x-t.x,s=i.y-n.y,a=e.y-t.y,l=r*s-a*o,e=e.x*t.y-e.y*t.x,t=i.x*n.y-i.y*n.x;return{x:(e*o-r*t)/l,y:(e*s-a*t)/l}},jve.prototype.getAnchor=function(e){return"Center"===e.lineBreakAlignment?"middle":this.chart.enableRtl?"Left"===e.lineBreakAlignment?"end":"start":"Left"===e.lineBreakAlignment?"start":"end"},jve.prototype.getRectanglePoints=function(e){return[new Tve(e.x,e.y),new Tve(e.x+e.width,e.y),new Tve(e.x+e.width,e.y+e.height),new Tve(e.x,e.y+e.height)]},jve.prototype.getLabelText=function(e,t,i){if(Eye(e.originalText)){for(var n,o=[],r=0;r<e.text.length;r++)n=this.findAxisLabel(t,e.text[r],i),o.push(n);return o}return this.findAxisLabel(t,e.text,i)},jve.prototype.drawXAxisBorder=function(e,t,i,n){if(0<e.border.width){for(var o,r="Outside"===e.labelPosition&&"Top"!==e.scrollbarSettings.position&&"Bottom"!==e.scrollbarSettings.position?e.scrollBarHeight:0,s=e.isAxisOpposedPosition,a=void 0,l=n.y+(s?-1:1)*r,h=n.width/e.visibleRange.delta*("DateTime"===e.valueType?e.dateTimeInterval:e.visibleRange.interval),d=void 0,p=e.maxLabelSize.height+(e.tickPosition===e.labelPosition?e.majorTickLines.height:0),c="",u="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?-.5:0,g=s&&"Inside"===e.labelPosition||!s&&"Outside"===e.labelPosition?n.y+p+10+r:n.y-p-10-r,m=0,f=e.visibleLabels.length;m<f;m++)switch(o=Yye(e.visibleLabels[m].value+u,e),o=(e.isAxisInverse?1-o:o)*n.width,d="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?(a=o+n.x,o+h+n.x):(a=o-.5*h+n.x,o+.5*h+n.x),e.border.type){case"Rectangle":case"WithoutTopBorder":a<n.x&&"OnTicks"!==e.labelPlacement?c+="M "+n.x+" "+g+" L "+d+" "+g+" ":Math.floor(d)>n.width+n.x&&1!==e.visibleLabels.length&&m!==e.visibleLabels.length-1?c+="M "+a+" "+l+" L "+a+" "+g+" L "+(n.width+n.x)+" "+g+" ":(c+="M "+(a=0===m&&"OnTicks"===e.labelPlacement?n.x:a)+" "+l+" L "+a+" "+g+" L "+(d=m===e.visibleLabels.length-1&&"OnTicks"===e.labelPlacement?d-.5*h:d)+" "+g+" ",0===m&&(c+="M "+a+" "+l+" L "+a+" "+g+" M "+a+" "+g+" L "+n.x+" "+g),m===e.visibleLabels.length-1&&(c+="M "+d+" "+l+" L "+d+" "+g+" M "+d+" "+g+" L "+(n.width+n.x)+" "+g));break;case"WithoutTopandBottomBorder":a<n.x||Math.floor(d)>n.width+n.x||(c+="M "+a+" "+l+" L "+a+" "+g+" M "+d+" "+l+" L "+d+" "+g)}""!==(c+="Rectangle"===e.border.type?"M  "+n.x+" "+l+"L "+(n.x+n.width)+" "+l:"")&&this.createAxisBorderElement(e,t,c,i)}for(m=0;m<this.chart.visibleSeries.length;m++)if(this.chart.multiLevelLabelModule&&0<e.multiLevelLabels.length&&this.chart.visibleSeries[m].visible){this.chart.multiLevelLabelModule.renderXAxisMultiLevelLabels(e,t,i,n);break}},jve.prototype.createAxisBorderElement=function(e,t,i,n){var o=ie(this.chart.element.id+"_BorderLine_"+t),o=o?o.getAttribute("d"):"",t=this.chart.renderer.drawPath(new No(this.chart.element.id+"_BorderLine_"+t,"transparent",e.border.width,e.border.color||this.chart.themeStyle.axisLine,1,"",i));t.style.pointerEvents="none",O0e(this.chart.enableCanvas,n,t,this.chart.redraw,!1,"x","y",null,o,!0,null,null,this.chart.duration)},jve.prototype.findAxisLabel=function(e,t,i){return"Trim"!==e.labelIntersectAction||e.angle%360!=0||e.enableTrim?t:eve(i,t,e.labelStyle,this.chart.enableRtl,this.chart.themeStyle.axisLabelFont)},jve.prototype.drawXAxisTitle=function(e,t,i,n){var o,r,s,a,l,h;e.title&&(o=this.chart,r=So(e.title,e.titleStyle,this.chart.themeStyle.axisTitleFont),a=je(e.crossesAt)&&"Top"!==e.scrollbarSettings.position&&"Bottom"!==e.scrollbarSettings.position?e.scrollBarHeight:0,h=("Inside"===e.tickPosition?0:e.majorTickLines.height+e.titlePadding)+("Inside"===e.labelPosition?0:e.maxLabelSize.height+e.multiLevelLabelHeight+e.labelPadding),h="Outside"===e.tickPosition||"Inside"!==e.tickPosition&&"Inside"!==e.labelPosition||5===e.titlePadding?h:h+e.titlePadding,s=e.titleSize.height*(e.titleCollection.length-1),h=e.isAxisOpposedPosition?-(h+r.height/4+a+s):h+3*r.height/4+a,s=e.titleRotation||0,a=n.y+h,l=h=void 0,h="Center"===e.titleStyle.textAlignment?(l="middle",n.x+.5*n.width):"Near"===e.titleStyle.textAlignment?(l="start",n.x):(l="end",n.x+n.width),0!==s&&(a+=e.opposedPosition?-(e.titleSize.height/2+r.height/4):e.titleSize.height/2-r.height/4),n=new ko(o.element.id+"_AxisTitle_"+t,h,a,l,e.titleCollection,"rotate("+s+","+h+","+a+")",null,s),sve(o.renderer,n,e.titleStyle,e.titleStyle.color||o.themeStyle.axisTitleFont.color,i,null,o.redraw,o.redraw,null,null,null,0,null,o.enableCanvas,null,o.themeStyle.axisTitleFont,new Tve(h,a)).setAttribute("aria-hidden","true"))},jve.prototype.renderGridLine=function(e,t,i,n,o,r,s,a,l,h,d){void 0===l&&(l=null),void 0===h&&(h=null),void 0===d&&(d=!1);var p,c=this.chart;0<n.width&&e.visible&&e.internalVisibility&&i&&(p=(e=ie(c.element.id+o+t+"_"+(d?h:r)))?e.getAttribute("d"):null,this.htmlObject=c.renderer.drawPath(new No(c.element.id+o+t+"_"+(d?h:r),"transparent",n.width,n.color||a,e=null,l,i)),O0e(c.enableCanvas,s,this.htmlObject,c.redraw,!0,"x","y",null,p,!0,null,null,c.duration),d)&&(this.htmlObject.id=c.element.id+o+t+"_"+r)},jve.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")},jve.prototype.createZoomingLabel=function(e,t,i,n,o){var r=this.findParentNode(e.element.id,t,n),s=(t.setAttribute("opacity","0.3"),e.renderer.createGroup({id:e.element.id+"AxisLabels_Zoom"+n})),s=i0e(e,i,s,n,"Vertical"===i.orientation,o);r.replaceChild(t,document.getElementById(t.id)),ie(e.element.id+"AxisLabels_Zoom"+n)?r.replaceChild(s,document.getElementById(s.id)):r.appendChild(s)};var zve=jve;function jve(e){this.chart=e,this.padding=5}Qve.prototype.getData=function(){for(var e=this.chart,t=null,i=null,n=e.visibleSeries.length-1;0<=n;n--){var o,r,s,a="Scatter"===(i=e.visibleSeries[n]).type||"Scatter"===i.drawType||i.marker.visible?(i.marker.height+5)/2:0,l="Scatter"===i.type||"Scatter"===i.drawType||i.marker.visible?(i.marker.width+5)/2:0;if(s=e.mouseX,o=e.mouseY,i.dragSettings.enable&&i.isRectSeries&&("Bar"===i.type&&e.isTransposed||!e.isTransposed&&"Bar"!==i.type?(r=i.marker.height/2,o=i.yAxis.isAxisInverse?o-r:o+r):(r=i.marker.width/2,s=i.yAxis.isAxisInverse?s+r:s-r)),t=i.visible&&o0e(s,o,i.clipRect,a,l)?this.getRectPoint(i,i.clipRect,s,o):t)return new Mve(t,i)}return new Mve(t,i)},Qve.prototype.isSelected=function(e){return(-1<e.selectionMode.indexOf("Drag")||-1<e.selectionMode.indexOf("Lasso"))&&e.selectionModule&&null!==e.selectionModule.rectPoints},Qve.prototype.getRectPoint=function(e,t,i,n){var o,r,s,a,l,h,d=this.chart;if(!d.isScrolling)for(var p=0,c=e.points;p<c.length;p++){var u=c[p];if(u.regionData||u.regions&&u.regions.length){if(u.regionData&&"PolarRadar"===this.chart.chartAreaType&&-1<e.drawType.indexOf("Column")&&(o=i-(e.clipRect.width/2+e.clipRect.x),r=n-(e.clipRect.height/2+e.clipRect.y),h=2*Math.PI*(u.regionData.currentXPosition<0?1+u.regionData.currentXPosition:u.regionData.currentXPosition),s=(s=(Math.atan2(r,o)+.5*Math.PI-h)%(2*Math.PI))<0?2*Math.PI+s:s,s+=2*Math.PI*e.chart.primaryXAxis.startAngle,a=u.regionData.startAngle,a=(a-=h)<0?2*Math.PI+a:a,l=u.regionData.endAngle,l=(l-=h)<0?2*Math.PI+l:l,h=Math.sqrt(Math.pow(Math.abs(o),2)+Math.pow(Math.abs(r),2)),a<=s)&&s<=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&&"PolarRadar"!==this.chart.chartAreaType)&&this.isPointInThresholdRegion(i,n,u,t,e))return this.insideRegion=!0,u;if(!this.insideRegion&&this.checkRegionContainsPoint(u.regions,t,i,n))return u;if(this.insideRegion&&this.checkRegionContainsPoint(u.regions,t,i,n))return u}}return null},Qve.prototype.checkRegionContainsPoint=function(e,i,n,o){var r=this;return e.some(function(e,t){return r.lierIndex=t,o0e(n,o,new Do(("Cartesian"===r.chart.chartAreaType?i.x:0)+e.x,("Cartesian"===r.chart.chartAreaType?i.y:0)+e.y,e.width,e.height))})},Qve.prototype.isPointInThresholdRegion=function(t,i,e,n,o){var r,s=this,a="Bar"===o.type,l=o.yAxis.isAxisInverse,o=o.chart.isTransposed,h=0,d=0,p=r=20;return l&&o?a?(h=e.regions[0].height-10,r=e.regions[0].width):(d=-10,p=e.regions[0].height):l||e.yValue<0?a?(d=-10,p=e.regions[0].height):(h=e.regions[0].height-10,r=e.regions[0].width):o?a?(h=-10,r=e.regions[0].width):(d=e.regions[0].width-10,p=e.regions[0].height):a?(d=e.regions[0].width-10,p=e.regions[0].height):(h=-10,r=e.regions[0].width),e.regions.some(function(e){return o0e(t,i,new Do(("Cartesian"===s.chart.chartAreaType?n.x:0)+e.x+d,("Cartesian"===s.chart.chartAreaType?n.y:0)+e.y+h,r,p))})},Qve.prototype.getClosest=function(e,t,i){var n,o,r=i||e.xData,s=r.length,a=.5,l=.5;if("DateTime"===e.xAxis.valueType&&1===e.points.length){for(var a=e.xAxis.visibleRange.min,l=e.xAxis.visibleRange.max,h=0;h<e.chart.visibleSeries.length;h++){var d=e.chart.visibleSeries[h];d.xMin>=a&&d.xMin<e.xMin&&(a=d.xMin+.1),d.xMax<=l&&d.xMax>e.xMax&&(l=d.xMax-.1),d.visible&&1<d.points.length&&(d.xMax>=a&&d.xMax<e.xMin&&(a=d.xMax+.1),d.xMin<=l)&&d.xMin>e.xMax&&(l=d.xMin-.1)}a!==e.xAxis.visibleRange.min&&(a=Math.abs(e.xMin-a)/2),l!==e.xAxis.visibleRange.max&&(l=Math.abs(e.xMax-l)/2)}if(t>=e.xMin-a&&t<=e.xMax+l)for(var p=0;p<s;p++)o=r[p],(null==n||Math.abs(o-t)<Math.abs(n-t))&&(n=o);return-1!==e.xData.indexOf(n)?n:null},Qve.prototype.binarySearch=function(e,t){for(var i,n=0,o=t.length,r=-1,s=!1;!1===s&&n<=o;)t[i=Math.floor((n+o)/2)].xValue===e?(s=!0,r=i):t[i].xValue>e?o=i-1:n=i+1;return-1!==r?t[r]:null},Qve.prototype.getClosestX=function(e,t,i){var n=t.clipRect,e=(e.mouseX<=n.x+n.width&&e.mouseX>=n.x&&(o=e.requireInvertedAxis?s0e(e.mouseY-n.y,n.height,t.xAxis):r0e(e.mouseX-n.x,n.width,t.xAxis)),this.getClosest(t,o,i)),o=(e||0===e)&&0<t.points.length?this.binarySearch(e,Tye(t.points,["xValue"])):null;return o&&o.visible&&"Cartesian"===this.chart.chartAreaType&&("Indicator"===t.category&&"Histogram"===t.name||o.symbolLocations&&0<o.symbolLocations.length&&0<=o.symbolLocations[0].x&&o.symbolLocations[0].x<=n.width)?new Mve(o,t):null},Qve.prototype.mergeXvalues=function(e){if(e.length&&(!this.commonXvalues.length||this.commonXvalues.length!==e[0].xData.length)){this.commonXvalues=e[0].xData;for(var t=1;t<e.length;t++)this.commonXvalues=this.getDistinctValues(this.commonXvalues,e[t].xData)}return this.commonXvalues},Qve.prototype.commonXValue=function(e){for(var t=[],i=0;i<e.length;i++)for(var n=0;e[i].points&&n<e[i].points.length;n++){var o=e[i].points[n];o&&(0===o.index||o.index===e[i].points.length-1||o.symbolLocations&&0<o.symbolLocations.length)&&t.push(o.xValue)}return t},Qve.prototype.getDistinctValues=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]);for(var i,n={},o=[],r=0;r<e.length;r++)n[i=e[r]]||(n[i]=!0,o.push(i));for(r=0;r<t.length;r++)n[i=t[r]]||(n[i]=!0,o.push(i));return o},Qve.prototype.findMouseValues=function(e,t,i){t.requireInvertedAxis?(i.valueY=(1-Yye(e.point.xValue,e.series.xAxis))*e.series.xAxis.rect.height+e.series.xAxis.rect.y,i.valueX=t.mouseX,t.crosshair.snapToData&&("BoxAndWhisker"===e.series.type&&e.point.regions.length?i.valueX=e.point.regions[0].x+e.series.clipRect.x:t.tooltip.shared?t.crosshairModule.valueX=e.point.symbolLocations[0].x+e.series.clipRect.x:i.valueX=e.point.symbolLocations[0].x+e.series.clipRect.x)):("PolarRadar"===t.chartAreaType?i.valueX=Zye(e.point.xValue,e.series.xAxis)*e.series.xAxis.rect.width+e.series.xAxis.rect.x:i.valueX="TrendLine"===e.series.category&&t.tooltip.shared?i.valueX:Yye(e.point.xValue,e.series.xAxis)*e.series.xAxis.rect.width+e.series.xAxis.rect.x,i.valueY=t.mouseY,t.crosshair.snapToData&&("BoxAndWhisker"===e.series.type&&e.point.regions.length?i.valueY=e.point.regions[0].y+e.series.clipRect.y:i.valueY=e.point.symbolLocations[0].y+e.series.clipRect.y))};var Wve=Qve;function Qve(e){this.currentPoints=[],this.previousPoints=[],this.insideRegion=!1,this.commonXvalues=[],this.chart=e,this.lierIndex=0}Uve=function(e,t){return(Uve=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])}))(e,t)};var Uve,qve,Afe=function(e,t){function i(){this.constructor=e}Uve(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Gve=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Yve=(Afe(Xve,qve=n),Gve([e(!1)],Xve.prototype,"visible",void 0),Gve([e(!0)],Xve.prototype,"showZero",void 0),Gve([e(null)],Xve.prototype,"name",void 0),Gve([e("transparent")],Xve.prototype,"fill",void 0),Gve([e(null)],Xve.prototype,"format",void 0),Gve([e(1)],Xve.prototype,"opacity",void 0),Gve([e(0)],Xve.prototype,"angle",void 0),Gve([e(!1)],Xve.prototype,"enableRotation",void 0),Gve([e("Auto")],Xve.prototype,"position",void 0),Gve([e(5)],Xve.prototype,"rx",void 0),Gve([e(5)],Xve.prototype,"ry",void 0),Gve([e("Center")],Xve.prototype,"alignment",void 0),Gve([t({width:null,color:null},Rge)],Xve.prototype,"border",void 0),Gve([t({left:5,right:5,top:5,bottom:5},zge)],Xve.prototype,"margin",void 0),Gve([t({size:null,color:null,fontStyle:null,fontWeight:null,fontFamily:null},Tge)],Xve.prototype,"font",void 0),Gve([e(null)],Xve.prototype,"template",void 0),Gve([e("Hide")],Xve.prototype,"labelIntersectAction",void 0),Xve);function Xve(){return null!==qve&&qve.apply(this,arguments)||this}Afe(Zve,Kve=n),Gve([e(!1)],Zve.prototype,"visible",void 0),Gve([e(null)],Zve.prototype,"shape",void 0),Gve([e("")],Zve.prototype,"imageUrl",void 0),Gve([e(5)],Zve.prototype,"height",void 0),Gve([e(!1)],Zve.prototype,"isFilled",void 0),Gve([e(5)],Zve.prototype,"width",void 0),Gve([t({width:2,color:null},Rge)],Zve.prototype,"border",void 0),Gve([t({x:0,y:0},Vge)],Zve.prototype,"offset",void 0),Gve([e(null)],Zve.prototype,"fill",void 0),Gve([e(!0)],Zve.prototype,"allowHighlight",void 0),Gve([e(1)],Zve.prototype,"opacity",void 0),Gve([t({},Yve)],Zve.prototype,"dataLabel",void 0);var Kve,Jve=Zve;function Zve(){return null!==Kve&&Kve.apply(this,arguments)||this}Afe(tbe,$ve=n),Gve([e(null)],tbe.prototype,"fill",void 0),Gve([e(1)],tbe.prototype,"width",void 0),Gve([e("0")],tbe.prototype,"dashArray",void 0),Gve([t(null,Jve)],tbe.prototype,"marker",void 0),Gve([e(!0)],tbe.prototype,"showAxis",void 0);var $ve,ebe=tbe;function tbe(){return null!==$ve&&$ve.apply(this,arguments)||this}var ibe,nbe=function(){this.symbolLocations=null,this.regions=null,this.percentage=null,this.regionData=null,this.isSelect=!1,this.marker={visible:!1},this.isPointInRange=!0,this.verticalError=null,this.verticalNegativeError=null,this.horizontalError=null,this.horizontalNegativeError=null,this.verticalPositiveError=null,this.horizontalPositiveError=null},obe=(Afe(rbe,ibe=n),rbe.prototype.setDataSource=function(e,t){e&&(this.points=e.points),t.trendLineModule.initDataSource(this),t.visibleSeriesCount++},Gve([e("")],rbe.prototype,"name",void 0),Gve([e("")],rbe.prototype,"dashArray",void 0),Gve([e(!0)],rbe.prototype,"visible",void 0),Gve([e("Linear")],rbe.prototype,"type",void 0),Gve([e(2)],rbe.prototype,"period",void 0),Gve([e(2)],rbe.prototype,"polynomialOrder",void 0),Gve([e(0)],rbe.prototype,"backwardForecast",void 0),Gve([e(0)],rbe.prototype,"forwardForecast",void 0),Gve([t({},Qge)],rbe.prototype,"animation",void 0),Gve([t({},Jve)],rbe.prototype,"marker",void 0),Gve([e(!0)],rbe.prototype,"enableTooltip",void 0),Gve([e(null)],rbe.prototype,"intercept",void 0),Gve([e("")],rbe.prototype,"fill",void 0),Gve([e(1)],rbe.prototype,"width",void 0),Gve([e("SeriesType")],rbe.prototype,"legendShape",void 0),Gve([t({},wge)],rbe.prototype,"accessibility",void 0),rbe);function rbe(){var e=null!==ibe&&ibe.apply(this,arguments)||this;return e.clipRect=new Do(0,0,0,0),e}Afe(lbe,sbe=n),Gve([e(1)],lbe.prototype,"width",void 0),Gve([e(10)],lbe.prototype,"length",void 0),Gve([e(null)],lbe.prototype,"color",void 0),Gve([e(1)],lbe.prototype,"opacity",void 0);var sbe,abe=lbe;function lbe(){return null!==sbe&&sbe.apply(this,arguments)||this}Afe(pbe,hbe=n),Gve([e(null)],pbe.prototype,"value",void 0),Gve([e(null)],pbe.prototype,"color",void 0),Gve([e("0")],pbe.prototype,"dashArray",void 0);var hbe,dbe=pbe;function pbe(){return null!==hbe&&hbe.apply(this,arguments)||this}Afe(gbe,cbe=n),Gve([e(!1)],gbe.prototype,"visible",void 0),Gve([e("Fixed")],gbe.prototype,"type",void 0),Gve([e("Both")],gbe.prototype,"direction",void 0),Gve([e("Vertical")],gbe.prototype,"mode",void 0),Gve([e(null)],gbe.prototype,"color",void 0),Gve([e(1)],gbe.prototype,"verticalError",void 0),Gve([e(1)],gbe.prototype,"width",void 0),Gve([e(1)],gbe.prototype,"horizontalError",void 0),Gve([e(3)],gbe.prototype,"verticalPositiveError",void 0),Gve([e(3)],gbe.prototype,"verticalNegativeError",void 0),Gve([e(1)],gbe.prototype,"horizontalPositiveError",void 0),Gve([e(1)],gbe.prototype,"horizontalNegativeError",void 0),Gve([t(null,abe)],gbe.prototype,"errorBarCap",void 0),Gve([e("")],gbe.prototype,"errorBarColorMapping",void 0);var cbe,ube=gbe;function gbe(){return null!==cbe&&cbe.apply(this,arguments)||this}Afe(ybe,mbe=n),ybe.prototype.processJsonData=function(){var e=0,t=new nbe,i=this instanceof bbe&&"Histogram"===this.type?"x":this.xName,n=this instanceof bbe&&this.marker.dataLabel.name?this.marker.dataLabel.name:"",o=(this instanceof bbe&&("Waterfall"!==this.type&&"Histogram"!==this.type||(this.currentViewData=this.chart[l0e(this.type)+"SeriesModule"].processInternalData(Pe([],this.currentViewData,null,!0),this)),"Pareto"===this.category&&(this.currentViewData=Pe([],this.currentViewData,null,!0),"Line"===this.type)&&(this.currentViewData=this.chart.paretoSeriesModule.performCumulativeCalculation(this.currentViewData,this)),this.isRectTypeSeries=-1<this.type.indexOf("Column")||-1<this.type.indexOf("Bar")||-1<this.type.indexOf("Histogram")),(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<o;)this.pushCategoryPoint(t,e,n,i),e++;else if(-1<this.xAxis.valueType.indexOf("DateTime"))for(var r={skeleton:"full",type:"dateTime"},s=this.chart.intl.getDateParser(r),a=this.chart.intl.getDateFormat(r);e<o;)this.pushDateTimePoint(t,e,n,i,s,a),e++;else for(;e<o;)this.pushDoublePoint(t,e,n,i),e++;this.updateSplineValue(),this.updateYAxisForErrorBars(),this instanceof bbe&&"Waterfall"===this.type&&je(this.yAxis.minimum)&&(this.yMin=Math.min.apply(Math,this.chart.waterfallSeriesModule.cumulativeSums))},ybe.prototype.updateYAxisForErrorBars=function(){if(this instanceof bbe&&this.chart.errorBarModule){var e=void 0,t=void 0;if(this.errorBar.verticalError)for(var i=0;i<this.points.length;i++){for(var n=[],o=[],r=0;r<this.points.length;r++){var s=this.points[r];s.verticalError&&(n.push(s.verticalError),o.push(s.yValue-s.verticalError))}e=n&&0<n.length?Math.max.apply(Math,n):0,t=n&&0<n.length?Math.min.apply(Math,o):0}this.yMax+=!isNaN(e)&&je(this.yAxis.maximum)?e:0,this.yMin=!isNaN(t)&&t<this.yMin&&t<0&&je(this.yAxis.minimum)?t:this.yMin}},ybe.prototype.pushCategoryPoint=function(e,t,i,n){e=this.dataPoint(t,i,n),this.pushCategoryData(e,t,e.x),this.pushData(e,t),this.setEmptyPoint(e,t),this.rangeColorsInterior(e)},ybe.prototype.pushDoublePoint=function(e,t,i,n){(e=this.dataPoint(t,i,n)).xValue=e.x,this.pushData(e,t),this.setEmptyPoint(e,t)},ybe.prototype.pushDateTimePoint=function(e,t,i,n,o,r){je((e=this.dataPoint(t,i,n)).x)||""===e.x?e.visible=!1:(e.x=new Date(Sa.parse.parseJson({val:e.x}).val),"DateTime"===this.xAxis.valueType?e.xValue=Date.parse(e.x.toString()):this.chart.isBlazor?this.pushCategoryData(e,t,Date.parse(e.x.toString()).toString()):this.pushCategoryData(e,t,Date.parse(o(r(e.x))).toString()),this.pushData(e,t),this.setEmptyPoint(e,t))},ybe.prototype.updateSplineValue=function(){var e,t;this instanceof bbe&&(!this.chart.stockChart||"DateTimeCategory"!==this.xAxis.valueType)&&(-1<this.type.indexOf("Spline")||-1<this.drawType.indexOf("Spline")&&"PolarRadar"===this.chart.chartAreaType?(e=-1<this.type.indexOf("Area")||-1<this.drawType.indexOf("Area"),t=-1<this.type.indexOf("Range"),this.chart["spline"+(e?t?"RangeArea":"Area":"")+"SeriesModule"].findSplinePoint(this)):-1<this.type.indexOf("Histogram")&&(this.xAxis.maximum||this.xAxis.minimum)&&this.chart.histogramSeriesModule.calculateBinValues(this),-1<this.type.indexOf("Histogram"))&&1===this.points.length&&(this.xMin=this.xMin-this.histogramValues.binWidth,this.xMax=this.xMax+this.histogramValues.binWidth)},ybe.prototype.rangeColorsInterior=function(e){this.chart.rangeColorSettings&&0<this.chart.rangeColorSettings.length&&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)&&(this.rangeColorPoints[e.interior]?void 0!==this.rangeColorPoints[e.interior]&&this.rangeColorPoints[e.interior].push(e):this.rangeColorPoints[e.interior]=[])},ybe.prototype.pushData=function(e,t){e.index=t,e.yValue=e.y,(e.series=this).xMin=Math.min(this.xMin,e.xValue),this.xMax=Math.max(this.xMax,e.xValue),this.xData.push(e.xValue)},ybe.prototype.dataPoint=function(e,t,i){this.points[e]=new nbe;var n=this.points[e],e=this.currentViewData[e],o=this.enableComplexProperty?R:this.getObjectValue;return n.x=o(i,e),n.high=o(this.high,e),n.low=o(this.low,e),n.open=o(this.open,e),n.close=o(this.close,e),n.volume=o(this.volume,e),n.interior=o(this.pointColorMapping,e),this instanceof bbe&&(this.errorBar.visible&&(n.errorBarColor=o(this.errorBar.errorBarColorMapping,e),n.verticalError="string"==typeof this.errorBar.verticalError?o(this.errorBar.verticalError,e):this.errorBar.verticalError,n.horizontalError="string"==typeof this.errorBar.horizontalError?o(this.errorBar.horizontalError,e):this.errorBar.horizontalError,n.verticalNegativeError="string"==typeof this.errorBar.verticalNegativeError?o(this.errorBar.verticalNegativeError,e):this.errorBar.verticalNegativeError,n.verticalPositiveError="string"==typeof this.errorBar.verticalPositiveError?o(this.errorBar.verticalPositiveError,e):this.errorBar.verticalPositiveError,n.horizontalNegativeError="string"==typeof this.errorBar.horizontalNegativeError?o(this.errorBar.horizontalNegativeError,e):this.errorBar.horizontalNegativeError,n.horizontalPositiveError="string"==typeof this.errorBar.horizontalPositiveError?o(this.errorBar.horizontalPositiveError,e):this.errorBar.horizontalPositiveError),n.y=o(this.yName,e),n.size=o(this.size,e),n.text=o(t,e),n.tooltip=o(this.tooltipMappingName,e),this.isAdvancedColorSupported())&&(this.rangeColorName=0<this.colorName.length?this.colorName:this.yName,n.colorValue=o(this.rangeColorName,e),n.interior=this.getPointFillColor(n.interior,n.colorValue)),n},ybe.prototype.isAdvancedColorSupported=function(){return je(this.isAdvancedColor)&&(this.chart.rangeColorSettings&&0<this.chart.rangeColorSettings.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)?this.isAdvancedColor=!0:this.isAdvancedColor=!1),this.isAdvancedColor},ybe.prototype.getPointFillColor=function(e,t){var i=e;if(t&&this.chart.rangeColorSettings&&0<this.chart.rangeColorSettings.length)for(var n=0,o=this.chart.rangeColorSettings;n<o.length;n++){var r=o[n];t>=r.start&&t<=r.end&&(i=1<r.colors.length?Fve(r,t):r.colors[0])}return i},ybe.prototype.getObjectValue=function(e,t){return t[e]},ybe.prototype.setEmptyPoint=function(e,t){if(!this.findVisibility(e))return e.visible=!0,null;switch(e.isEmpty=!0,this instanceof bbe&&e.isPointInRange?this.emptyPointSettings.mode:"Drop"){case"Zero":e.visible=!0,this instanceof bbe&&-1<this.seriesType.indexOf("HighLow")?(e.high=e.low=0,-1<this.seriesType.indexOf("HighLowOpenClose")&&(e.open=e.close=0)):e.y=e.yValue=this.yData[t]=0;break;case"Average":this instanceof bbe&&(-1<this.seriesType.indexOf("HighLow")?(e.high=je(e.high)||isNaN(+e.high)?this.getAverage(this.high,t):e.high,e.low=je(e.low)||isNaN(+e.low)?this.getAverage(this.low,t):e.low,-1<this.seriesType.indexOf("HighLowOpenClose")&&(e.open=je(e.open)||isNaN(+e.open)?this.getAverage(this.open,t):e.open,e.close=je(e.close)||isNaN(+e.close)?this.getAverage(this.close,t):e.close)):e.y=e.yValue=this.yData[t]=this.getAverage(this.yName,t)),e.visible=!0;break;case"Drop":case"Gap":this.yData[t]=null,e.visible=!1}},ybe.prototype.findVisibility=function(e){var t,i=this instanceof bbe?this.seriesType:"HighLowOpenClose",n=this.yAxis.minimum,o=this.yAxis.maximum;switch(i){case"XY":return"PolarRadar"===this.chart.chartAreaType&&(!je(n)&&e.yValue<n||!je(o)&&e.yValue>o)?!(e.isPointInRange=!1):(this.setXYMinMax(e.yValue),this.yData.push(e.yValue),this instanceof bbe&&"Bubble"===this.type&&(this.sizeMax=Math.max(this.sizeMax,je(e.size)||isNaN(+e.size)?this.sizeMax:e.size)),je(e.x)||je(e.y)||isNaN(+e.y));case"HighLow":return this.setHiloMinMax(e.high,e.low),je(e.x)||je(e.low)||isNaN(+e.low)||je(e.high)||isNaN(+e.high);case"HighLowOpenClose":return this.setHiloMinMax(e.high,e.low),je(e.x)||je(e.low)||isNaN(+e.low)||je(e.open)||isNaN(+e.open)||je(e.close)||isNaN(+e.close)||je(e.high)||isNaN(+e.high);case"BoxPlot":return t=(e.y||[null]).filter(function(e){return!je(e)&&!isNaN(e)}).sort(function(e,t){return e-t}),e.y=t,this.yMin=Math.min(this.yMin,Math.min.apply(Math,t)),this.yMax=Math.max(this.yMax,Math.max.apply(Math,t)),!t.length}},ybe.prototype.setXYMinMax=function(e){var t="Logarithmic"===this.yAxis.valueType||"Logarithmic"===this.xAxis.valueType,i=e<0||"None"===this.yAxis.rangePadding,i=!this.isRectTypeSeries||b0e(this.yAxis)||t||i?e:0;this.yMin=t?Math.min(this.yMin,je(i)||isNaN(i)||0===i||"0"===i.toString()||""===i.toString()?this.yMin:i):Math.min(this.yMin,je(i)||isNaN(i)?this.yMin:i),this.yMax=Math.max(this.yMax,je(e)||isNaN(e)?this.yMax:e)},ybe.prototype.setHiloMinMax=function(e,t){this.yMin=Math.min(this.yMin,Math.min(je(t)||isNaN(t)?this.yMin:t,je(e)||isNaN(e)?this.yMin:e)),this.yMax=Math.max(this.yMax,Math.max(je(t)||isNaN(t)?this.yMax:t,je(e)||isNaN(e)?this.yMax:e))},ybe.prototype.getSeriesType=function(){var e;if(this instanceof bbe){var t="PolarRadar"===this.chart.chartAreaType?this.drawType:this.type;if(t)switch(t){case"RangeColumn":case"RangeArea":case"RangeStepArea":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},ybe.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):(void 0===this.xAxis.indexLabels[i]&&(this.xAxis.indexLabels[i]=this.xAxis.labels.length,this.xAxis.labels.push(i)),e.xValue=this.xAxis.indexLabels[i])},ybe.prototype.getAverage=function(e,t,i){return(((i=void 0===i?this.currentViewData:i)[t-1]&&i[t-1][e]||0)+(i[t+1]&&i[t+1][e]||0))/2},ybe.prototype.refreshDataManager=function(e){var t=this,e=(this.chart=e).isAngular?(Object.keys(this.dataSource).length?this:e).dataSource:this.dataSource||e.dataSource;e instanceof me||!je(this.query)?this.dataModule.getData(this.dataModule.generateQuery().requiresCount()).then(function(e){return t.dataManagerSuccess(e)}):this.dataManagerSuccess({result:e,count:e.length},!1)},ybe.prototype.dataManagerSuccess=function(e,t){var i;void 0===t&&(t=!0),this.currentViewData=e.count?e.result:[],this.chart.allowServerDataBinding=!1,this instanceof bbe&&(this.chart.stockChart&&(this.chart.stockChart.series[this.index].localData=this.currentViewData),i={name:Qme,series:this,data:this.currentViewData,fill:this.interior},this.chart.trigger(Qme,i),this.interior=i.fill,this.currentViewData=i.data),!this.chart.stockChart||this instanceof bbe||(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},ybe.prototype.refreshChart=function(e){var t=this.chart;if(this instanceof bbe&&(t.visibleSeriesCount+=e?1:0),t.refreshTechnicalIndicator(this),this instanceof bbe&&"TrendLine"!==this.category)for(var i=0,n=this.trendlines;i<n.length;i++)n[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 bbe&&(t.visibleSeriesCount+=e?0:1)},Gve([e("")],ybe.prototype,"xName",void 0),Gve([e("")],ybe.prototype,"colorName",void 0),Gve([e("")],ybe.prototype,"high",void 0),Gve([e("")],ybe.prototype,"low",void 0),Gve([e("")],ybe.prototype,"open",void 0),Gve([e("")],ybe.prototype,"close",void 0),Gve([e("")],ybe.prototype,"volume",void 0),Gve([e("")],ybe.prototype,"pointColorMapping",void 0),Gve([e(!0)],ybe.prototype,"visible",void 0),Gve([e(null)],ybe.prototype,"xAxisName",void 0),Gve([e(null)],ybe.prototype,"yAxisName",void 0),Gve([t(null,Qge)],ybe.prototype,"animation",void 0),Gve([e(null)],ybe.prototype,"fill",void 0),Gve([e(1)],ybe.prototype,"width",void 0),Gve([e("")],ybe.prototype,"dashArray",void 0),Gve([e("")],ybe.prototype,"dataSource",void 0),Gve([e()],ybe.prototype,"query",void 0),Gve([kt([],dbe)],ybe.prototype,"segments",void 0),Gve([e("X")],ybe.prototype,"segmentAxis",void 0),Gve([e(!1)],ybe.prototype,"enableComplexProperty",void 0);var mbe,fbe=ybe;function ybe(){var e=null!==mbe&&mbe.apply(this,arguments)||this;return e.rangeColorPoints=[],e.isAdvancedColor=void 0,e.currentViewData=[],e.clipRect=new Do(0,0,0,0),e.seriesType="XY",e.isRectTypeSeries=!1,e.removedPointIndex=null,e.isLegendClicked=!1,e}Afe(wbe,vbe=fbe),wbe.prototype.refreshAxisLabel=function(){if(-1===this.xAxis.valueType.indexOf("Category"))return null;this.xAxis.labels=[],this.xAxis.indexLabels={};for(var e={skeleton:"full",type:"dateTime"},t=this.chart.intl.getDateParser(e),i=this.chart.intl.getDateFormat(e),n=0,o=this.xAxis.series;n<o.length;n++){var r=o[n];if(r.visible&&"TrendLine"!==r.category){r.xMin=1/0,r.xMax=-1/0;for(var s=0,a=r.points;s<a.length;s++){var l=a[s];r.pushCategoryData(l,l.index,"DateTimeCategory"===this.xAxis.valueType?Date.parse(t(i(l.x))).toString():l.x),r.xMin=Math.min(r.xMin,l.xValue),r.xMax=Math.max(r.xMax,l.xValue)}}}},wbe.prototype.findSeriesCollection=function(e,t,i){for(var n=[],o=0,r=t.axes;o<r.length;o++)for(var s=0,a=r[o].series;s<a.length;s++)for(var l=a[s],h=0,d=e.axes;h<d.length;h++)for(var p=0,c=d[h].series;p<c.length;p++){var u=c[p];u===l&&u.visible&&this.rectSeriesInChart(u,i)&&n.push(u)}return n},wbe.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},wbe.prototype.calculateStackedValue=function(e,t){for(var i=0,n=t.columns;i<n.length;i++)for(var o=n[i],r=0,s=t.rows;r<s.length;r++){var a=s[r];this.calculateStackingValues(this.findSeriesCollection(o,a,!0),e)}},wbe.prototype.calculateStackingValues=function(e,t){for(var i,n,o,r,s,a,l=[],h=[],d=[],p=(t&&(d=this.findFrequencies(e)),[]),c=[],u=0;u<e.length;u++)p[(f=e[u]).stackingGroup]?void 0!==p[f.stackingGroup]&&p[f.stackingGroup].push(f):(p[f.stackingGroup]=[],p[f.stackingGroup].push(f));for(var g=Object.keys(p),m=0;m<g.length;m++){for(var f,y=[],v=[],b=0,w=p[g[m]];b<w.length;b++)if(-1!==(f=w[b]).type.indexOf("Stacking")||-1!==f.drawType.indexOf("Stacking")&&"PolarRadar"===f.chart.chartAreaType){l[r=-1!==f.type.indexOf("StackingArea")?"StackingArea100":-1!==f.type.indexOf("StackingLine")?"StackingLine100":f.stackingGroup]||(l[r]=[],h[r]=[]),o=f.yData,i=[],n=[],y.push(f);for(var C=0,S=(c=Dye(f)).length;C<S;C++)a=+o[C],void(s=0)===l[r][c[C].xValue]&&(l[r][c[C].xValue]=0),void 0===h[r][c[C].xValue]&&(h[r][c[C].xValue]=0),t?(a=a/d[r][c[C].xValue]*100,a=isNaN(a)?0:a,c[C].percentage=+a.toFixed(2)):v[C]=v[C]?v[C]+Math.abs(a):Math.abs(a),0<=a?(s=l[r][c[C].xValue],l[r][c[C].xValue]+=a):(s=h[r][c[C].xValue],h[r][c[C].xValue]+=a),i.push(s),n.push(a+s),t&&100<n[C]&&(n[C]=100);f.stackedValues=new yve(i,n);var A="Logarithmic"===f.yAxis.valueType,x=-1!==f.type.indexOf("Column")||-1!==f.type.indexOf("Bar");f.yMin=A&&x&&f.yMin<1?f.yMin:f.yAxis.startFromZero&&"Auto"===f.yAxis.rangePadding&&0<=f.yMin?0:parseFloat(Math.min.apply(0,t?i:n).toFixed(10)),f.yMax=Math.max.apply(0,n),f.yMin>Math.min.apply(0,n)&&(f.yMin=t?-100:A&&x&&f.yMin<1?f.yMin:Math.min.apply(0,n)),f.yMax<Math.max.apply(0,i)&&(f.yMax=0)}this.findPercentageOfStacking(y,v,t)}},wbe.prototype.findPercentageOfStacking=function(e,t,i){for(var n=0,o=e;n<o.length;n++){var r=o[n];if(i)return null;for(var s=0,a=Dye(r);s<a.length;s++){var l=a[s];l.percentage=Math.abs(+(l.y/t[l.index]*100).toFixed(2))}}},wbe.prototype.findFrequencies=function(e){for(var t,i,n=[],o=0,r=e;o<r.length;o++){var s=r[o];if(s.yAxis.isStack100=-1!==s.type.indexOf("100"),i=Dye(s),-1!==s.type.indexOf("Stacking")){n[t=-1!==s.type.indexOf("StackingArea")?"StackingArea100":-1!==s.type.indexOf("StackingLine")?"StackingLine100":s.stackingGroup]||(n[t]=[]);for(var a=0,l=i.length;a<l;a++)void 0===n[t][i[a].xValue]&&(n[t][i[a].xValue]=0),0<s.yData[a]?n[t][i[a].xValue]+=s.yData[a]:n[t][i[a].xValue]-=s.yData[a]}}return n},wbe.prototype.renderSeries=function(e){if(this.chart.stockChart&&"DateTimeCategory"===this.xAxis.valueType){for(var t,i=0;i<this.points.length;i++){var n=this.xAxis.labels.indexOf(Date.parse(this.points[i].x.toString()).toString());this.points[i].xValue=n,1<e.series.length&&(this.xData[i]=n,this.xMin=this.xMin>n?n:this.xMin,this.xMax=this.xMax<n?n:this.xMax)}this instanceof wbe&&-1<this.type.indexOf("Spline")&&(o=-1<this.type.indexOf("Area"),t=-1<this.type.indexOf("Range"),this.chart["spline"+(o?t?"RangeArea":"Area":"")+"SeriesModule"].findSplinePoint(this))}var o=l0e(this.type);e[(o=o.replace("100",""))+"SeriesModule"]&&("Indicator"!==this.category&&"TrendLine"!==this.category&&this.createSeriesElements(e),this.visiblePoints=Dye(this),this.chart.enableCanvas?(this.chart.canvasRender.ctx.save(),this.chart.canvasRender.ctx.beginPath(),e.requireInvertedAxis?this.chart.canvasRender.ctx.rect(this.yAxis.rect.x,this.xAxis.rect.y,this.yAxis.rect.width,this.xAxis.rect.height):this.chart.canvasRender.ctx.rect(this.xAxis.rect.x,this.yAxis.rect.y,this.xAxis.rect.width,this.yAxis.rect.height),this.chart.canvasRender.ctx.clip(),e[o+"SeriesModule"].render(this,this.xAxis,this.yAxis,e.requireInvertedAxis),this.chart.canvasRender.ctx.restore()):e[o+"SeriesModule"].render(this,this.xAxis,this.yAxis,e.requireInvertedAxis),"Indicator"!==this.category&&(this.errorBar.visible&&this.chart.errorBarModule.render(this),this.marker.dataLabel.visible&&(this.chart.enableCanvas?(this.chart.canvasRender.ctx.save(),this.chart.canvasRender.ctx.beginPath(),e.requireInvertedAxis?this.chart.canvasRender.ctx.rect(this.yAxis.rect.x,this.xAxis.rect.y,this.yAxis.rect.width,this.xAxis.rect.height):this.chart.canvasRender.ctx.rect(this.xAxis.rect.x,this.yAxis.rect.y,this.xAxis.rect.width,this.yAxis.rect.height),this.chart.canvasRender.ctx.clip(),e.dataLabelModule.render(this,this.chart,this.marker.dataLabel),this.chart.canvasRender.ctx.restore()):e.dataLabelModule.render(this,this.chart,this.marker.dataLabel)),this.appendSeriesElement(e.seriesElements,e)),this.chart.enableCanvas||this.performAnimation(e,o,this.errorBar,this.marker,this.marker.dataLabel))},wbe.prototype.createSeriesElements=function(e){var t,i,n,o,r,s,a;"Indicator"!==this.category&&(t=e.element.id,a=this.marker.border.width+8+5,i="Bubble"===this.type||"Scatter"===this.type||!this.marker.visible&&e.tooltip.shared&&e.enableCanvas?e.svgRenderer:e.renderer,n=void 0===this.index?this.category:this.index,r=s=o=void 0,s="Scatter"===this.type||"Scatter"===this.drawType?(o=(this.marker.height+a)/2,(this.marker.width+a)/2):o=0,"PolarRadar"===e.chartAreaType?(a="Scatter"===this.drawType?Math.max(this.marker.width,this.marker.height):0,r=new Sve(t+"_ChartSeriesClipRect_"+n,"transparent",{width:1,color:"Gray"},1,this.clipRect.width/2+this.clipRect.x,this.clipRect.height/2+this.clipRect.y,e.radius+a),this.clipRectElement=y0e(e.redraw,r,i,"drawCircularClipPath")):(r=new vve(t+"_ChartSeriesClipRect_"+n,"transparent",{width:1,color:"Gray"},1,{x:0===this.xAxis.columnIndex?-s:0,y:this.yAxis.rowIndex===e.rows.length-1?-o:0,width:this.clipRect.width+(this.xAxis.columnIndex===e.columns.length-1?2*s:s),height:this.clipRect.height+(0===this.yAxis.rowIndex?2*o:o)}),this.clipRectElement=y0e(e.redraw,r,i)),a="Cartesian"===e.chartAreaType?"translate("+this.clipRect.x+","+this.clipRect.y+")":"",this.symbolElement=null,this.seriesElement=i.createGroup({id:t+"SeriesGroup"+n,transform:a,"clip-path":"url(#"+t+"_ChartSeriesClipRect_"+n+")"}),this.seriesElement&&(this.seriesElement.setAttribute("role",this.accessibility.accessibilityRole||"region"),this.seriesElement.setAttribute("tabindex",this.accessibility.focusable?String(this.accessibility.tabIndex):"-1"),this.seriesElement.style.outline="none",this.seriesElement.setAttribute("aria-label",this.accessibility.accessibilityDescription||this.name+","+this.type+" series with "+this.points.length+" data points"),this.seriesElement.setAttribute("aria-hidden","false")),this.chart.enableCanvas&&"Bubble"!==this.type||(this.seriesElement.setAttribute("tabindex",this.accessibility.focusable?0===n?"0":this.checkTabindex(e.visibleSeries,n)?"":String(this.accessibility.tabIndex):"-1"),this.seriesElement.style.outline="none",this.seriesElement.appendChild(this.clipRectElement)))},wbe.prototype.checkTabindex=function(e,t){for(var i=0;i<t;i++)if(e[i].visible)return!0;return!1},wbe.prototype.appendSeriesElement=function(e,t){var i=this.marker,n=i.dataLabel,o=t.redraw;"TrendLine"!==this.category&&(O0e(t.enableCanvas,t.seriesElements,this.seriesElement,o),this.errorBar.visible)&&("PolarRadar"===t.chartAreaType?O0e(t.enableCanvas,t.seriesElements,this.seriesElement,o):O0e(t.enableCanvas,t.seriesElements,this.errorBarElement,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&&O0e(t.enableCanvas,t.seriesElements,this.symbolElement,o),n.visible&&this.textElement&&(O0e(t.enableCanvas,t.dataLabelElements,this.shapeElement,o),O0e(t.enableCanvas,t.dataLabelElements,this.textElement,o)),!t.enableCanvas&&t.dataLabelElements.hasChildNodes()&&t.seriesElements.appendChild(t.dataLabelElements)},wbe.prototype.performAnimation=function(e,t,i,n,o){!(this.animation.enable&&"Disable"!==Ut||"Enable"===Ut)||!e.animateSeries||e.stockChart&&e.stockChart.isStockChartRendered||(e[t+"SeriesModule"].doAnimation(this),i.visible&&e.errorBarModule.doErrorBarAnimation(this),n.visible&&(this.isRectSeries||"Line"===this.type||"Polar"===this.type||"Radar"===this.type)&&e.markerRender.doMarkerAnimation(this),o.visible&&"edge"!==F.info.name&&!F.isIE&&e.dataLabelModule.doDataLabelAnimation(this))},wbe.prototype.setPointColor=function(e,t){return t=e.interior||t,e.isEmpty&&this.emptyPointSettings.fill||t},wbe.prototype.setBorderColor=function(e,t){return t.width=e.isEmpty&&this.emptyPointSettings.border.width||t.width,t.color=e.isEmpty&&this.emptyPointSettings.border.color||t.color,t},wbe.prototype.addPoint=function(e,t){var i=this.yMin,n=this.yMax;if(this.removeTrackballElements(),this.dataSource.push(e),"Radar"===this.type||"Polar"===this.type)return this.chart.refresh();if("Histogram"===this.type){this.currentViewData=this.chart[l0e(this.type)+"SeriesModule"].processInternalData(Pe([],this.dataSource,null,!0),this);for(var o=0;o<this.currentViewData.length;o++)this.updatePoint(o)}else{this.currentViewData=this.dataSource;e=0===this.points.length?0:this.points[this.points.length-1].index+1;this.updatePoint(e)}if("Pareto"===this.category){var e=Pe([],this.dataSource,null,!0),r=this.chart.visibleSeries[this.index+this.chart.series.length];r.currentViewData=this.chart.paretoSeriesModule.performCumulativeCalculation(e,this);for(o=0;o<r.currentViewData.length;o++)r.points[o]||r.updatePoint(o),r.points[o].y=r.points[o].yValue=r.currentViewData[o][r.yName]}this.updateSplineValue(),this.chart.calculateStackValues(),this.chart.redraw=this.chart.enableAnimation;e=this.chart.duration;if(this.chart.duration=je(t)?500:t,this.chart.animateSeries=!1,this.chart.pointsAdded=!0,this.chart.enableAnimation&&!this.isRectSeries&&"Bubble"!==this.type&&"Scatter"!==this.type&&-1===this.type.indexOf("step")&&this.marker&&this.marker.visible&&this.visible)for(o=this.points.length-2;0<=o;o--)if(this.points[o]&&!je(this.points[this.points.length-2].y)&&this.points[o].symbolLocations&&void 0!==this.points[o].symbolLocations[0]){this.chart.markerRender.renderMarker(this,this.points[this.points.length-2],this.points[o].symbolLocations[0],null,!0);break}this.yMin>=i&&this.yMax<=n&&(b0e(this.xAxis)||(this.xAxis.baseModule.calculateRangeAndInterval(new Eo(this.xAxis.rect.width,this.chart.availableSize.height),this.xAxis),this.xAxis.updateAxis()),this.chart.pointsAdded=!1,this.updateSeries(!0,!1)),(this.yMin<i||this.yMax>n)&&(this.updateChartAxis(),this.chart.pointsAdded=!1,this.updateSeries(!0,!0)),this.chart.redraw=!1,this.chart.duration=e},wbe.prototype.removePoint=function(e,t){var i=Pe([],this.dataSource,null,!0),n=this.chart.duration;if(0<i.length&&0<=e&&e<i.length){if(i.splice(e,1),this.dataSource.splice(e,1),this.removeTrackballElements(e),"Radar"===this.type||"Polar"===this.type)return this.chart.refresh();if(this.chart.redraw=this.chart.enableAnimation,this.chart.animateSeries=!1,this.chart.pointsAdded=!0,this.chart.duration=je(t)?500:t,"Histogram"===this.type){i=this.points.length;this.points=[],this.visiblePoints=[],this.currentViewData=this.chart[l0e(this.type)+"SeriesModule"].processInternalData(Pe([],this.dataSource,null,!0),this);for(var o=0;o<this.currentViewData.length;o++)this.updatePoint(o);i>this.points.length&&(this.removedPointIndex=e)}else this.removedPointIndex=e,this.points.splice(e,1),this.visiblePoints.splice(e,1);this.yData=[],this.xData=[];t=this.yMin,i=this.yMax;this.yMin=1/0,this.xMin=1/0,this.yMax=-1/0,this.xMax=-1/0,-1<this.xAxis.valueType.indexOf("Category")&&1===this.chart.series.length&&(this.xAxis.labels=[],this.xAxis.indexLabels={}),0===e&&(this.chart.pointsRemoved=this.chart.enableAnimation);for(o=0;o<this.points.length;o++)this.updatePointsAfterRemoval(o);if("Pareto"===this.category){var r=this.chart.visibleSeries[this.index+this.chart.series.length];r.yMin=1/0,r.xMin=1/0,r.yMax=-1/0,r.xMax=-1/0,r.points.splice(e,1),r.visiblePoints.splice(e,1),r.currentViewData=this.chart.paretoSeriesModule.performCumulativeCalculation(this.dataSource,this);for(o=0;o<r.currentViewData.length;o++)r.points[o].y=r.points[o].yValue=r.currentViewData[o][r.yName],r.updatePointsAfterRemoval(o)}this.updateSplineValue(),this.chart.calculateStackValues(),b0e(this.xAxis)||i!==this.yMax||t!==this.yMin?(i<this.yMax||t>this.yMin||i>this.yMax||t<this.yMin)&&(this.updateChartAxis(),this.createSeriesElements(this.chart),this.chart.pointsAdded=!1,this.updateSeries(!0,!0)):(this.xAxis.baseModule.calculateRangeAndInterval(new Eo(this.xAxis.rect.width,this.chart.availableSize.height),this.xAxis),this.xAxis.updateAxis(),this.createSeriesElements(this.chart),this.chart.pointsAdded=!1,this.updateSeries(!0,!1))}O0e(this.chart.enableCanvas,this.chart.seriesElements,this.seriesElement,!0),this.chart.redraw=!1,this.chart.duration=n,this.chart.pointsRemoved=!1,this.removedPointIndex=null},wbe.prototype.updatePointsAfterRemoval=function(e){var t=this.points[e],i={skeleton:"full",type:"dateTime"},n=this.chart.intl.getDateParser(i),i=this.chart.intl.getDateFormat(i);"Category"===this.xAxis.valueType&&1===this.chart.series.length?this.pushCategoryData(t,e,t.x):"DateTimeCategory"===this.xAxis.valueType&&1===this.chart.series.length&&this.pushCategoryData(t,e,Date.parse(n(i(t.x))).toString()),this.pushData(t,e),this.setEmptyPoint(this.points[e],e)},wbe.prototype.removeTrackballElements=function(e){var t,i;this.marker.visible&&(void 0!==e?((i=ie((t=this.chart.element.id+"_Series_"+this.index+"_Point_"+e+"_Trackball_")+"0"))&&i.remove(),(i=ie(t+"1"))&&i.remove(),(t=ie(this.chart.element.id+"_Series_"+this.index+"_Point_"+e+"_Symbol"))&&t.setAttribute("visibility","visible")):(i=this.chart.element.id+"_EJ2-Trackball_Series_"+this.index+"_Point_",(e=document.querySelectorAll('[class*="'+i+'"]'))[0]&&(i=(i=e[0].id.match(/_Point_(\d+)_/))?parseInt(i[1],10):null,e[0].remove(),t=ie(this.chart.element.id+"_Series_"+this.index+"_Point_"+i+"_Symbol"))&&t.setAttribute("visibility","visible"),e[1]&&e[1].remove())),this.chart.tooltip.enable&&(this.chart.tooltipModule.previousPoints=[],i=ie(this.chart.element.id+"_tooltip"))&&i.remove()},wbe.prototype.setData=function(e,t){var i=this;if(!e)return null;var n=[];if(this.dataSource.length===e.length)for(var o,r=0;r<e.length;r++)e[r][this.xName]instanceof Date?n.push(e[r][this.xName].getTime()):n.push(e[r][this.xName]),this.currentData.length<this.dataSource.length&&((o=Pe([],this.dataSource,null,!0))[r][this.xName]instanceof Date?this.currentData.push(o[r][this.xName].getTime()):this.currentData.push(o[r][this.xName]));var s=n.every(function(e){return-1!==i.currentData.indexOf(e)}),a=(this.currentViewData&&(s=!0),!1),l=this.yMin,h=this.yMax,d=(this.yMin=1/0,this.yMax=-1/0,[]),p=(this.chart.dataLabelCollections=[],!(this.chart.rotatedDataLabelCollections=[])),c=null;if(this.dataSource.length===e.length&&"Radar"!==this.type&&"Polar"!==this.type&&s)if(p=!0,this.yData=[],"Histogram"===this.type&&this.dataSource.length===e.length){var u=this.chart[l0e(this.type)+"SeriesModule"].processInternalData(Pe([],e,null,!0),this);this.currentViewData=u;for(var g=0;g<u.length;g++)this.updatePoint(g)}else for(r=0;r<e.length;r++){var m=e[r][this.xName],m=(this.dataSource[r][this.xName],e[r][this.xName]instanceof Date&&(m=e[r][this.xName].getTime(),this.dataSource[r][this.xName].getTime()),this.currentData[r]!==m&&(a=!0),this.points[r]),f=this.enableComplexProperty?R:this.getObjectValue,y=this.dataSource[r],v=e[r];"XY"===this.seriesType||"BoxPlot"===this.seriesType?(m.y=f(this.yName,v),"Bubble"===this.type&&y[this.size]!==v[this.size]&&(m.size=f(this.size,v)),d.push(r)):y[this.high]===v[this.high]&&y[this.low]===v[this.low]&&y[this.open]===v[this.open]&&y[this.close]===v[this.close]&&y[this.volume]===v[this.volume]||(m.high=f(this.high,v),m.low=f(this.low,v),m.open=f(this.open,v),m.close=f(this.close,v),m.volume=f(this.volume,v),d.push(r)),m.yValue=m.y,m.x=f(this.xName,v),this.currentViewData||(m.index="DateTime"===this.xAxis.valueType&&"number"!=typeof m.x?this.currentData.indexOf(m.x.getTime()):this.currentData.indexOf(m.x)),("Category"===this.xAxis.valueType||"DateTimeCategory"===this.xAxis.valueType)&&r<this.xAxis.visibleLabels.length&&(this.xAxis.visibleLabels[r].value=n.indexOf(this.currentData[r*this.xAxis.visibleRange.interval]),this.xAxis.labels[r]=String(n[r])),this.setEmptyPoint(m,r),this.dataSource[r]=e[r]}p?(this.chart.redraw=this.chart.enableAnimation,this.chart.animateSeries=!1,this.chart.pointsAdded=!0,s=this.chart.duration,this.chart.duration=je(t)?500:t,-1!==this.type.indexOf("Stacking")&&this.chart.calculateStackValues(),this.updateSplineValue(),h===this.yMax&&l===this.yMin&&this.visible?(this.chart.pointsAdded=!1,this.chart[l0e("Pareto"===this.category?"Column":this.type.replace("100",""))+"SeriesModule"].updateDirection(this,d,this.chart.requireInvertedAxis),this.chart.annotationModule&&this.chart.annotationModule.renderAnnotations(ie(this.chart.element.id+"_Secondary_Element")),!b0e(this.xAxis)&&a&&this.xAxis.updateAxis()):(h<this.yMax||l>this.yMin||h>this.yMax||l<this.yMin)&&this.visible&&(p=this.yAxis.maxLabelSize.width,this.yAxis.baseModule.calculateRangeAndInterval(new Eo(this.chart.availableSize.width,this.yAxis.rect.height),this.yAxis),p<this.yAxis.maxLabelSize.width?(this.chart.calculateBounds(),this.chart.axisCollections.forEach(function(e){b0e(e)||e.updateAxis()}),this.chart.chartAxisLayoutPanel.drawPaneLines(this.chart),this.chart.renderAreaBorder()):(b0e(this.yAxis)||this.yAxis.updateAxis(),!b0e(this.xAxis)&&a&&this.xAxis.updateAxis(),"Histogram"!==this.type||b0e(this.xAxis)||(this.xAxis.baseModule.calculateRangeAndInterval(new Eo(this.xAxis.rect.width,this.chart.availableSize.height),this.xAxis),this.xAxis.updateAxis())),this.chart.pointsAdded=!1,a&&(this.chart[l0e("Pareto"===this.category?"Column":this.type.replace("100",""))+"SeriesModule"].updateDirection(this,d,this.chart.requireInvertedAxis),c=this.index),this.updateSeries(!1,!0,c),this.chart.stripLineModule)&&this.chart.stripLineModule.renderStripLine(this.chart,"Behind",this.chart.axisCollections),this.chart.redraw=!1,this.chart.pointsRemoved=!1,this.chart.duration=s):this.dataSource=e},wbe.prototype.updateChartAxis=function(){var e=this.yAxis.maxLabelSize.width;this.yAxis.baseModule.calculateRangeAndInterval(new Eo(this.chart.availableSize.width,this.yAxis.rect.height),this.yAxis),e<this.yAxis.maxLabelSize.width?(this.chart.calculateBounds(),this.chart.axisCollections.forEach(function(e){b0e(e)||e.updateAxis()}),this.chart.chartAxisLayoutPanel.drawPaneLines(this.chart),this.chart.renderAreaBorder()):(b0e(this.xAxis)||(this.xAxis.baseModule.calculateRangeAndInterval(new Eo(this.xAxis.rect.width,this.chart.availableSize.height),this.xAxis),this.xAxis.updateAxis()),b0e(this.yAxis)||this.yAxis.updateAxis()),this.chart.stripLineModule&&this.chart.stripLineModule.renderStripLine(this.chart,"Behind",this.chart.axisCollections)},wbe.prototype.updateSeries=function(e,t,i){var n=[];e&&t?new Set(this.xAxis.series.concat(this.yAxis.series)).forEach(function(e){n.push(e)}):n=(e?this.xAxis:this.yAxis).series.slice();for(var o=0,r=n;o<r.length;o++){var s,a=r[o];a.visible&&a.index!==i&&(a0e(a,this.chart.enableCanvas),s="translate("+this.clipRect.x+","+this.clipRect.y+")",a.seriesElement.setAttribute("transform",s),a.chart[l0e(a.type.replace("100",""))+"SeriesModule"].render(a,a.xAxis,a.yAxis,a.chart.requireInvertedAxis,a.chart.enableAnimation),a.marker.visible&&"Cartesian"===a.chart.chartAreaType&&"Scatter"!==a.type&&"Bubble"!==a.type&&"Candle"!==a.type&&"Hilo"!==a.type&&"HiloOpenClose"!==a.type&&a.symbolElement&&(a.symbolElement.setAttribute("transform",s),O0e(a.chart.enableCanvas,a.chart.seriesElements,a.symbolElement,!0)),a.marker.dataLabel.visible&&a.chart.dataLabelModule&&(a.chart.dataLabelCollections=[],a.chart.dataLabelModule.render(a,a.chart,a.marker.dataLabel),a.textElement)&&(a.shapeElement&&a.shapeElement.setAttribute("transform",s),O0e(a.chart.enableCanvas,a.chart.dataLabelElements,a.shapeElement,!0),a.textElement.setAttribute("transform",s),O0e(a.chart.enableCanvas,a.chart.dataLabelElements,a.textElement,!0)),a.chart.annotationModule)&&a.chart.annotationModule.renderAnnotations(ie(a.chart.element.id+"_Secondary_Element"))}},wbe.prototype.updatePoint=function(e){var t,i,n,o=new nbe,r=this instanceof wbe&&this.marker.dataLabel.name?this.marker.dataLabel.name:"",s=this instanceof wbe&&"Histogram"===this.type?"x":this.xName;"Category"===this.xAxis.valueType?this.pushCategoryPoint(o,e,r,s):-1<this.xAxis.valueType.indexOf("DateTime")?(t=this.points[e],i=this.chart.intl.getDateParser(n={skeleton:"full",type:"dateTime"}),n=this.chart.intl.getDateFormat(n),this.pushDateTimePoint(t,e,r,s,i,n)):this.pushDoublePoint(o,e,r,s)},wbe.prototype.formatAccessibilityDescription=function(e,t){return t.accessibility.accessibilityDescriptionFormat.replace("${series.name}",t&&t.name?t.name:"").replace("${point.x}",e&&e.x?e.x.toString():"").replace("${point.y}",e&&e.y?e.y.toString():"").replace("${point.high}",e&&e.high?e.high.toString():"").replace("${point.low}",e&&e.low?e.low.toString():"").replace("${point.close}",e&&e.close?e.close.toString():"").replace("${point.open}",e&&e.open?e.open.toString():"").replace("${point.maximum}",e&&e.maximum?e.maximum.toString():"").replace("${point.minimum}",e&&e.minimum?e.minimum.toString():"").replace("${point.median}",e&&e.median?e.median.toString():"").replace("${point.lowerQuartile}",e&&e.lowerQuartile?e.lowerQuartile.toString():"").replace("${point.upperQuartile}",e&&e.upperQuartile?e.upperQuartile.toString():"")},Gve([e("")],wbe.prototype,"name",void 0),Gve([e("")],wbe.prototype,"yName",void 0),Gve([e("Line")],wbe.prototype,"drawType",void 0),Gve([e(!0)],wbe.prototype,"isClosed",void 0),Gve([e(null)],wbe.prototype,"bearFillColor",void 0),Gve([e(null)],wbe.prototype,"bullFillColor",void 0),Gve([e(!1)],wbe.prototype,"enableSolidCandles",void 0),Gve([e("")],wbe.prototype,"size",void 0),Gve([e(null)],wbe.prototype,"binInterval",void 0),Gve([e(!1)],wbe.prototype,"showNormalDistribution",void 0),Gve([e("")],wbe.prototype,"stackingGroup",void 0),Gve([t({color:null,width:0},Rge)],wbe.prototype,"border",void 0),Gve([e(1)],wbe.prototype,"opacity",void 0),Gve([e(0)],wbe.prototype,"zOrder",void 0),Gve([e("")],wbe.prototype,"groupName",void 0),Gve([e("Line")],wbe.prototype,"type",void 0),Gve([t(null,ube)],wbe.prototype,"errorBar",void 0),Gve([t(null,Jve)],wbe.prototype,"marker",void 0),Gve([t(null,ebe)],wbe.prototype,"paretoOptions",void 0),Gve([t({},wme)],wbe.prototype,"dragSettings",void 0),Gve([kt([],obe)],wbe.prototype,"trendlines",void 0),Gve([e(!0)],wbe.prototype,"enableTooltip",void 0),Gve([e(!0)],wbe.prototype,"showNearestTooltip",void 0),Gve([e("")],wbe.prototype,"tooltipFormat",void 0),Gve([e("")],wbe.prototype,"tooltipMappingName",void 0),Gve([e("SeriesType")],wbe.prototype,"legendShape",void 0),Gve([e("")],wbe.prototype,"legendImageUrl",void 0),Gve([e(null)],wbe.prototype,"selectionStyle",void 0),Gve([e(null)],wbe.prototype,"unSelectedStyle",void 0),Gve([e(null)],wbe.prototype,"nonHighlightStyle",void 0),Gve([e(1)],wbe.prototype,"minRadius",void 0),Gve([e(3)],wbe.prototype,"maxRadius",void 0),Gve([e("Natural")],wbe.prototype,"splineType",void 0),Gve([e(.5)],wbe.prototype,"cardinalSplineTension",void 0),Gve([t(null,Kge)],wbe.prototype,"emptyPointSettings",void 0),Gve([e(!0)],wbe.prototype,"showMean",void 0),Gve([e("Normal")],wbe.prototype,"boxPlotMode",void 0),Gve([e(!0)],wbe.prototype,"showOutliers",void 0),Gve([e(null)],wbe.prototype,"columnWidth",void 0),Gve([e(null)],wbe.prototype,"columnWidthInPixel",void 0),Gve([e("Rectangle")],wbe.prototype,"columnFacet",void 0),Gve([e(0)],wbe.prototype,"columnSpacing",void 0),Gve([e("#C64E4A")],wbe.prototype,"negativeFillColor",void 0),Gve([e("#4E81BC")],wbe.prototype,"summaryFillColor",void 0),Gve([e()],wbe.prototype,"intermediateSumIndexes",void 0),Gve([e()],wbe.prototype,"sumIndexes",void 0),Gve([e("Left")],wbe.prototype,"step",void 0),Gve([e(!1)],wbe.prototype,"noRisers",void 0),Gve([t({},Age)],wbe.prototype,"accessibility",void 0),Gve([t({color:"black",width:2},Lue)],wbe.prototype,"connector",void 0),Gve([t(null,ime)],wbe.prototype,"cornerRadius",void 0);var vbe,bbe=wbe;function wbe(e,t,i,n){e=vbe.call(this,e,t,i,n)||this;return e.visibleSeriesCount=0,e.category="Series",e.isRectSeries=!1,e.drawPoints=[],e.lowDrawPoints=[],e.delayedAnimation=!1,e.rangeColorName=0<e.colorName.length?e.colorName:e.yName,e.currentData=[],e}Sbe.prototype.initDataManager=function(e,t){this.dataManager=e instanceof me?e:new me(e),this.query=t instanceof ya?t:new ya},Sbe.prototype.generateQuery=function(){return this.query.clone()},Sbe.prototype.getData=function(e){var t,i=this;return this.dataManager.ready?(t=new ll,this.dataManager.ready.then(function(){i.dataManager.executeQuery(e).then(function(e){t.resolve(e)})}).catch(function(e){t.reject(e)}),t.promise):this.dataManager.executeQuery(e)};var Cbe=Sbe;function Sbe(e,t){this.initDataManager(e,t)}Abe=function(e,t){return(Abe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Abe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ibe,xbe=Wve),Ibe.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on(F.touchMoveEvent,this.mouseMoveHandler,this),this.chart.on(F.touchEndEvent,this.mouseUpHandler,this))},Ibe.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off(F.touchMoveEvent,this.mouseMoveHandler),this.chart.off(F.touchEndEvent,this.mouseUpHandler))},Ibe.prototype.mouseUpHandler=function(){var e=this.chart;!e.isTouch||e.crosshair.enable||this.isSelected(e)||this.chart.zoomModule&&ie(this.elementId+"_ZoomArea")||this.markerMove(!0)},Ibe.prototype.mouseMoveHandler=function(){var e=this.chart;"None"===e.highlightMode&&!e.tooltip.enable||e.isTouch&&!e.startMove||this.isSelected(e)||this.chart.zoomModule&&(ie(this.elementId+"_ZoomArea")||this.chart.zoomModule.startPanning)||this.markerMove(!1)},Ibe.prototype.markerMove=function(e){var t,i,n,o=this,r=this.chart;if(this.currentPoints=[],r.tooltip.shared&&r.tooltip.enable){if(!o0e(r.mouseX,r.mouseY,r.chartAxisLayoutPanel.seriesClipRect))return null;if(r.tooltip.enable){var s="PolarRadar"===r.chartAreaType?this.getData():null;if(this.chart.tooltip.showNearestPoint)for(var a=0,l=r.visibleSeries;a<l.length;a++){var h=l[a];h.enableTooltip&&"Indicator"!==h.category&&("Cartesian"===r.chartAreaType&&h.visible?t=this.getClosestX(r,h,this.commonXValue(this.chart.visibleSeries)):"PolarRadar"===r.chartAreaType&&h.visible&&null!==s.point&&(t=new Mve(h.points[s.point.index],h)),t)&&(this.currentPoints.push(t),t=null)}else this.currentPoints=this.chart.tooltipModule.currentPoints}}else t=this.getData(),n=t.series,d=this.previousPoints[0],i=n&&("Bubble"===n.type||"Scatter"===n.drawType||"Scatter"===n.type||"Candle"!==n.type&&"Hilo"!==n.type&&"HiloOpenClose"!==n.type&&n.marker.visible&&0!==n.marker.width&&0!==n.marker.height),t.lierIndex=this.lierIndex,t.point&&i&&(!d||d.point!==t.point||d&&3<d.lierIndex&&d.lierIndex!==this.lierIndex)&&this.currentPoints.push(t),t.point&&i&&r.isPointMouseDown&&this.currentPoints.push(t),0!==this.currentPoints.length||!t.point||i||je(d)||d.point===t.point||(this.removeHighlightedMarker(d.series,d.point),this.previousPoints=Pe([],t,null,!0)),r.tooltip.showNearestTooltip&&this.chart.tooltipModule&&this.chart.tooltipModule.currentPoints&&(i||"Pareto"===n.type&&n.paretoOptions.marker.visible)&&0===this.currentPoints.length&&o0e(r.mouseX,r.mouseY,r.chartAxisLayoutPanel.seriesClipRect)&&(this.currentPoints=this.chart.tooltipModule.currentPoints);var d=this.previousPoints.length;if((0<this.currentPoints.length||0<d&&r.tooltip.shared)&&(0===d||r.isPointMouseDown||0<d&&(0===this.currentPoints.length||this.previousPoints[0].point!==this.currentPoints[0].point))){if(0<d)for(var p=0,c=this.previousPoints;p<c.length;p++){var u=c[p];je(u)||this.removeHighlightedMarker(u.series,u.point)}for(var g=this,m=0,f=this.currentPoints;m<f.length;m++)!function(i){(i&&i.point||"Candle"!==n.type&&"Hilo"!==n.type&&"HiloOpenClose"!==n.type)&&(H0e(g.markerExplode),g.isRemove=!0,i.point.symbolLocations.map(function(e,t){!i.series.marker.allowHighlight||i.series.isRectSeries&&!i.point.marker.visible||o.drawTrackBall(i.series,i.point,e,t)}))}(f[m]);this.previousPoints=Pe([],this.currentPoints,null,!0)}r.tooltip.enable||!(0===this.currentPoints.length&&this.isRemove||e&&this.isRemove)&&o0e(r.mouseX,r.mouseY,r.chartAxisLayoutPanel.seriesClipRect)||(this.isRemove=!1,je(this.previousPoints[0]))||(this.markerExplode=+setTimeout(function(){o.previousPoints[0]&&o.removeHighlightedMarker(o.previousPoints[0].series,o.previousPoints[0].point)},2e3)),this.currentPoints=[]},Ibe.prototype.animationDuration=function(){var e=200;return 100<this.chart.maxPointCount?e=10:50<this.chart.maxPointCount&&(e=100),e},Ibe.prototype.drawTrackBall=function(e,t,i,n){var o=t.marker,r=e.marker,s=o.shape||r.shape||"Circle";if("None"===s||"Image"===s)return null;var a,l,h=e.symbolElement||e.seriesElement,d=(this.chart.highlightModule&&"None"!==this.chart.highlightMode&&(a=this.chart.highlightModule.generateStyle(e)),this.chart.selectionModule&&"None"!==this.chart.selectionMode&&(a=this.chart.selectionModule.generateStyle(e)),this.elementId+"_Series_"+e.index+"_Point_"+t.index+"_Trackball"+(n||"")),p=(ie(d+"_1")&&ie(d+"_1").getAttribute("e-animate")&&(Vt.stop(ie(d+"_1")),ue(ie(d+"_1"))),new Eo((o.width||r.width)+3,(o.height||r.height)+3)),n=o.border||e.border,c="BoxAndWhisker"===e.type||"Bubble"===e.type||"Scatter"===e.type,u=n.color&&"transparent"!==n.color?n.color:o.fill||t.interior||(c?t.color:e.interior),n=G0e(Y0e(u)),g=(o.border?o:r).border.width,m=e.chart.themeStyle.markerShadow||"rgba("+n.r+","+n.g+","+n.b+",0.2)",n=document.getElementById(this.elementId+"_Series_"+e.index+"_Point_"+t.index+"_Symbol");je(n)||n.setAttribute("visibility","visible"),this.chart.enableCanvas&&(n=document.getElementById(this.chart.element.id+"_Secondary_Element"),(l=this.chart.svgRenderer.createSvg({id:this.chart.element.id+"_trackball_svg",width:this.chart.availableSize.width,height:this.chart.availableSize.height})).style.cssText="position: absolute; display:block; pointer-events: none",n.appendChild(l));for(var f=0;f<2;f++){var y=new No(d+"_"+f,f?o.fill||t.color||(c?e.interior:"#ffffff"):"transparent",g+(f?0:8),f?u:m,o.opacity||r.opacity,e.marker.border.dashArray,""),y=A0e(i,s,p,o.imageUrl,y,0,this.chart.svgRenderer,e.clipRect),v=(y.setAttribute("class",this.elementId+"_EJ2-Trackball_Series_"+e.index+"_Point_"+t.index),-1!==h.id.indexOf("Symbol")?"_Symbol":""),v=document.getElementById(this.elementId+"_Series_"+e.index+"_Point_"+t.index+v);""===a||je(a)||je(v)||!v.hasAttribute("class")||a!==v.getAttribute("class")||y.classList.add(a),y.setAttribute("clip-path",h.getAttribute("clip-path")),y.setAttribute("transform",h.getAttribute("transform")),(this.chart.enableCanvas?l:this.chart.svgObject).appendChild(y),1<t.symbolLocations.length&&e.marker.visible&&"Bubble"!==e.type&&"Scatter"!==e.type&&this.trackballAnimate(y,0,this.animationDuration(),e,t.index,i,!1,!1)}t.symbolLocations.length<2&&e.marker.visible&&this.doAnimation(e,t,!1)},Ibe.prototype.doAnimation=function(e,t,i){if(void 0===i&&(i=!1),"Bubble"!==e.type&&"Scatter"!==e.type)for(var n=this.animationDuration(),o=document.getElementsByClassName(this.elementId+"_EJ2-Trackball_Series_"+e.index+"_Point_"+t.index),r=0,s=o.length;r<s;r++)this.trackballAnimate(o[r],0,n,e,t.index,t.symbolLocations[0],!1,i)},Ibe.prototype.trackballAnimate=function(t,e,i,n,o,r,s,a,l){var h=r.x,d=r.y,p="Polar"!==n.type&&"Radar"!==n.type?n.clipRect.x:0,c="Polar"!==n.type&&"Radar"!==n.type?n.clipRect.y:0,u=t.getAttribute("transform"),r=n.marker.width/(n.marker.width+3),g=n.marker.height/(n.marker.height+3),m=Math.min(r,g);l||t.setAttribute("transform","translate("+(h+p)+" "+(d+c)+") scale("+m+") translate("+-h+" "+-d+")"),new Vt({}).animate(t,{duration:i,delay:e,progress:function(e){e.element.style.animation="",e.timeStamp>e.delay&&(!n.visible&&l?ue(t):(e=e.timeStamp/e.duration,e=l?Math.max(m,1-(1-m)*e):Math.min(1,m+(1-m)*e),t.setAttribute("transform","translate("+(h+p)+" "+(d+c)+") scale("+e+") translate("+-h+" "+-d+")")))},end:function(){t.style.visibility="",t.setAttribute("transform",u),s||o!==n.points.length-1||n.chart.trigger("animationComplete",{series:n.chart.isBlazor?{}:n}),(l||a)&&ue(t)}})},Ibe.prototype.removeHighlightedMarker=function(e,t,i){if(void 0===t&&(t=null),void 0===i&&(i=!1),je(e=void 0===e?null:e)||je(t))for(var n=0,o=e.points;n<o.length;n++)for(var r=o[n],s=document.getElementsByClassName(this.elementId+"_EJ2-Trackball_Series_"+e.index+"_Point_"+r.index),a=document.getElementById(this.elementId+"_Series_"+e.index+"_Point_"+r.index+"_Symbol"),l=0,h=s.length;l<h;l++)je(a)||a.setAttribute("visibility","visible"),ue(s[0]);else{var s,a=document.getElementById(this.elementId+"_Series_"+e.index+"_Point_"+t.index+"_Symbol"),d=document.getElementsByClassName(this.elementId+"_EJ2-Trackball_Series_"+e.index+"_Point_"+t.index);0===d.length&&((s=document.querySelectorAll('[class*="'+this.elementId+"_EJ2-Trackball_Series_"+e.index+"_Point_"+t.index+'"]'))[1]&&s[1].remove(),s[0])&&s[0].remove();for(var l=d.length-1;0<=l;l--)(!e.marker.visible||d[l]&&"0"===d[l].id[d[l].id.length-1])&&ue(d[l]);for(l=d.length-1;0<=l;l--)d[l]&&"1"===d[l].id[d[l].id.length-1]&&"Bubble"!==e.type&&"Scatter"!==e.type&&e.marker.visible&&(d[l].setAttribute("opacity",(a||d[l]).getAttribute("opacity")),this.trackballAnimate(d[l],0,this.animationDuration(),e,t.index,t.symbolLocations[l],null,null,!0));je(a)||a.setAttribute("visibility","visible")}i&&(this.previousPoints=[])};var Abe,xbe,Afe=Ibe;function Ibe(e){var t=xbe.call(this,e)||this;return t.elementId=e.element.id,t.commonXvalues=[],t}Tbe=function(e,t){return(Tbe=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])}))(e,t)};var Tbe,Ebe,Dbe=["Circle","Triangle","Diamond","Rectangle","Pentagon","InvertedTriangle","VerticalLine","Cross","Plus","HorizontalLine","Star"],Mbe=(function(e,t){function i(){this.constructor=e}Tbe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(kbe,Ebe=Afe),kbe.prototype.render=function(n){for(var o=this,r=n.chart.redraw,e=(this.createElement(n,r),0),t=n.points;e<t.length;e++)!function(i){i.visible&&i.symbolLocations&&i.symbolLocations.length&&i.symbolLocations.map(function(e,t){"None"!==n.marker.shape&&o.renderMarker(n,i,e,t,r)})}(t[e])},kbe.prototype.renderMarker=function(e,t,i,n,o){var r,s,a,l,h,d,p,c,u=void 0===e.index?e.category:e.index,g=e.marker,m=(e.marker.shape=e.marker.shape||Dbe[u%10],{color:g.border.color,width:g.border.width}),f=g.border.color,y=(i.x=i.x+g.offset.x,i.y=i.y-g.offset.y,"BoxAndWhisker"===e.type),v=g.fill||(y||e.marker.isFilled?t.interior||e.interior:"#ffffff"),b=y&&!this.chart.enableCanvas?F0e(e.seriesElement.childNodes,"Series_"+e.index+"_Point_"+t.index):e.symbolElement,w=(m.color=f||e.setPointColor(t,e.interior),this.elementId+"_Series_"+u+"_Point_"+(null!==e.removedPointIndex&&e.removedPointIndex<=t.index||this.chart.pointsAdded?t.index+1:t.index)+"_Symbol"+(n||"")),v={cancel:!1,name:jme,series:e,point:t,fill:t.isEmpty&&e.emptyPointSettings.fill||v,border:{color:"BoxAndWhisker"===e.type?je(f)||"transparent"===f?K0e(v,-.6):f:m.color,width:m.width},height:g.height,width:g.width,shape:g.shape};v.border=e.setBorderColor(t,{width:v.border.width,color:v.border.color}),e.isRectSeries&&"BoxAndWhisker"!==e.type||(this.chart.trigger(jme,v),t.color=v.fill),v.cancel?(i=null,t.marker={visible:!1}):(f=void 0,f="RangeArea"===e.type||"RangeColumn"===e.type||"RangeColumn"===e.drawType||"SplineRangeArea"===e.type||"RangeStepArea"===e.type?n?t.low:t.high:y?t.outliers[n]:t.y,m=v.point.marker.fill||v.fill,y=void 0,y=je(v.point.marker.border)?{color:v.border.color,width:v.border.width}:{color:v.point.marker.border.color||v.border.color,width:v.point.marker.border.width||v.border.width},h=v.point.marker.width||v.width,d=v.point.marker.height||v.height,p=v.point.marker.opacity||g.opacity,c=v.point.marker.shape||v.shape,v=v.point.marker.imageUrl||g.imageUrl,g=new No(w,m,y.width,y.color,p,e.marker.border.dashArray),(null!=b||this.chart.enableCanvas)&&(o&&ie(g.id)&&(r={x:+(l=ie(g.id)).getAttribute((a="Circle"===c?"c":"")+"x"),y:+l.getAttribute(a+"y")},s=l.getAttribute("d")),(l=A0e(i,c,new Eo(h,d),v,g,(t.x.toString(),f.toString()),this.chart.renderer,e.clipRect))&&(l.setAttribute("role","img"),"TrendLine"===e.category&&g.id===this.elementId+"_Series_0_Point_0_Symbol"&&(l.setAttribute("tabindex","0"),l.setAttribute("class","e-chart-focused")),l.setAttribute("aria-label",e.accessibility.accessibilityDescriptionFormat?e.formatAccessibilityDescription(t,e):t.x+": "+t.y+", "+e.name)),O0e(this.chart.enableCanvas,b,l,o,!0,a+"x",a+"y",r,s,!1,!1,null,e.chart.duration),null!==e.removedPointIndex)&&e.removedPointIndex<=t.index&&(b.lastChild.id=this.elementId+"_Series_"+u+"_Point_"+t.index+"_Symbol"+(n||"")),t.marker={border:y,fill:m,height:d,visible:!0,shape:c,width:h,imageUrl:v})},kbe.prototype.createElement=function(e,t){var i,n,o=e.marker,r=o.border.width+(this.chart.zoomModule&&this.chart.zoomModule.isAxisZoomed(this.chart.axisCollections)?0:13),s=e.chart.svgRenderer,a=void 0===e.index?e.category:e.index,l="Cartesian"===e.chart.chartAreaType?"translate("+e.clipRect.x+","+e.clipRect.y+")":"";o.visible&&(i=(o.height+r)/2,o=(o.width+r)/2,r="Cartesian"===e.chart.chartAreaType?y0e(t,n=new vve(this.elementId+"_ChartMarkerClipRect_"+a,"transparent",{width:1,color:"Gray"},1,{x:-o,y:-i,width:e.clipRect.width+2*o,height:e.clipRect.height+2*i},0,0,"",e.marker.border.dashArray),s):y0e(t,n=new Sve(this.elementId+"_ChartMarkerClipRect_"+a,"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(i,o)),s,"drawCircularClipPath"),n={id:this.elementId+"SymbolGroup"+a,transform:l,"clip-path":"url(#"+this.elementId+"_ChartMarkerClipRect_"+a+")"},e.symbolElement=s.createGroup(n),e.symbolElement.appendChild(r),this.chart.enableCanvas)&&document.getElementById(this.chart.element.id+"_tooltip_svg").appendChild(e.symbolElement)},kbe.prototype.getRangeLowPoint=function(e,t){var i=e.x,n=e.y;return t.chart.requireInvertedAxis?(n+=e.height/2,i+=t.yAxis.isAxisInverse?e.width:0):(n+=t.yAxis.isAxisInverse?0:e.height,i+=e.width/2),{x:i,y:n}},kbe.prototype.calculateDistance=function(e,t){var i=t.x-e.x,t=t.y-e.y;return Math.sqrt(i*i+t*t)},kbe.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,i=e.symbolElement.childNodes,n=e.animation.delay+(0===e.animation.duration&&"Enable"===Ut?1e3:e.animation.duration),o=e.chart.animated?e.chart.duration:200,r=n,s=e.pathElement?e.pathElement.getTotalLength():0,a=[],l=1;"Line"===e.type&&l<e.points.length;l++)e.points[l-1].symbolLocations[0]&&e.points[l].symbolLocations[0]&&(t=this.calculateDistance(e.points[l-1].symbolLocations[0],e.points[l].symbolLocations[0]),a.push(t));for(var h=1,d="RangeArea"===e.type||"RangeColumn"===e.type||"SplineRangeArea"===e.type||"RangeStepArea"===e.type?2:1,l=0;l<e.points.length;l++)e.points[l].symbolLocations&&e.points[l].symbolLocations.length&&i[h]&&("Line"===e.type&&(0===l&&(r=0),0<l)&&(r+=a[l-1]/s*n,o=0),u0e(i[h],r,o,e,l,e.points[l].symbolLocations[0],!1),2==d&&(this.getRangeLowPoint(e.points[l].regions[0],e),u0e(i[h+1],r,o,e,l,0,!1)),h+=d)}},kbe);function kbe(e){e=Ebe.call(this,e)||this;return e.addEventListener(),e}Pbe=function(e,t){return(Pbe=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])}))(e,t)};var Pbe,Bbe,Gve=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Afe=(function(e,t){function i(){this.constructor=e}Pbe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Fbe,Bbe=n),Gve([e(!0)],Fbe.prototype,"visible",void 0),Gve([e(null)],Fbe.prototype,"height",void 0),Gve([e(null)],Fbe.prototype,"width",void 0),Gve([t({x:0,y:0},yge)],Fbe.prototype,"location",void 0),Gve([e("Auto")],Fbe.prototype,"position",void 0),Gve([e("Series")],Fbe.prototype,"mode",void 0),Gve([e(8)],Fbe.prototype,"padding",void 0),Gve([e(null)],Fbe.prototype,"itemPadding",void 0),Gve([e("Center")],Fbe.prototype,"alignment",void 0),Gve([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},Tge)],Fbe.prototype,"textStyle",void 0),Gve([e(10)],Fbe.prototype,"shapeHeight",void 0),Gve([e(10)],Fbe.prototype,"shapeWidth",void 0),Gve([t({},Rge)],Fbe.prototype,"border",void 0),Gve([t({left:0,right:0,top:0,bottom:0},zge)],Fbe.prototype,"margin",void 0),Gve([t({left:0,right:0,top:0,bottom:0},rme)],Fbe.prototype,"containerPadding",void 0),Gve([e(8)],Fbe.prototype,"shapePadding",void 0),Gve([e("transparent")],Fbe.prototype,"background",void 0),Gve([e(1)],Fbe.prototype,"opacity",void 0),Gve([e(!0)],Fbe.prototype,"toggleVisibility",void 0),Gve([e(!1)],Fbe.prototype,"enableHighlight",void 0),Gve([e(null)],Fbe.prototype,"description",void 0),Gve([e(3)],Fbe.prototype,"tabIndex",void 0),Gve([e(null)],Fbe.prototype,"title",void 0),Gve([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},Tge)],Fbe.prototype,"titleStyle",void 0),Gve([e("Top")],Fbe.prototype,"titlePosition",void 0),Gve([e("Normal")],Fbe.prototype,"textWrap",void 0),Gve([e("Ellipsis")],Fbe.prototype,"textOverflow",void 0),Gve([e(100)],Fbe.prototype,"maximumTitleWidth",void 0),Gve([e(null)],Fbe.prototype,"maximumLabelWidth",void 0),Gve([e(!0)],Fbe.prototype,"enablePages",void 0),Gve([e(!1)],Fbe.prototype,"isInversed",void 0),Gve([e(!1)],Fbe.prototype,"reverse",void 0),Gve([e("Auto")],Fbe.prototype,"layout",void 0),Gve([e(null)],Fbe.prototype,"maximumColumns",void 0),Gve([e(!1)],Fbe.prototype,"fixedWidth",void 0),Gve([t({},wge)],Fbe.prototype,"accessibility",void 0),Fbe);function Fbe(){return null!==Bbe&&Bbe.apply(this,arguments)||this}Lbe.prototype.calculateLegendBounds=function(e,t,i,n,o){var r=this.legend,s=this.isBulletChartControl||("accumulationchart"===this.chart.getModuleName()||"chart"===this.chart.getModuleName())&&("Auto"!==this.legend.layout||0<this.legend.maximumColumns)?"40%":"20%";this.getPosition(r.position,t),this.legendBounds=new Do(e.x,e.y,0,0),this.isVertical="Left"===this.position||"Right"===this.position,this.itemPadding=this.legend.itemPadding||(this.isVertical?8:20),this.isVertical?(this.legendBounds.height=ive(r.height,t.height-(e.y-this.chart.margin.top))||e.height,this.legendBounds.width=ive(r.width||s,t.width)):(this.legendBounds.width=ive(r.width,t.width)||e.width,this.legendBounds.height=ive(r.height||s,t.height)),"chart3d"===this.chart.getModuleName()?this.library.get3DLegendBounds(t,this.legendBounds,r):this.library.getLegendBounds(t,this.legendBounds,r),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,r.alignment,this.legendBounds,e,t,i,n,o)},Lbe.prototype.getPosition=function(e,t){var i=this.chart,n=this.chart;this.isChartControl||this.isBulletChartControl||this.isStockChartControl?this.position="Auto"!==e?e:"Bottom":("Auto"===e&&((i||n).visibleSeries&&"Funnel"===(i||n).visibleSeries[0].type||"Pyramid"===(i||n).visibleSeries[0].type)&&(e="Top"),this.position="Auto"!==e?e:t.width>t.height?"Right":"Bottom")},Lbe.prototype.setBounds=function(e,t,i,n){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,n.width),t=Math.min(t,n.height),"Gradient"===i.mode?(n.width=i.width?n.width:this.isVertical?e:.75*n.width,n.height=i.height?n.height:this.isVertical?.75*n.height:t):(n.width=i.width?n.width:e,n.height=i.height?n.height:t),this.isBulletChartControl||this.isTop&&"None"!==i.titleStyle.textOverflow&&(this.calculateLegendTitle(i,n),n.height+="Wrap"===i.titleStyle.textOverflow&&1<this.legendTitleCollections.length?this.legendTitleSize.height-this.legendTitleSize.height/this.legendTitleCollections.length:0),this.rowCount=Math.max(1,Math.ceil((n.height-i.padding-o)/(this.maxItemHeight+i.padding)))},Lbe.prototype.getLocation=function(e,t,i,n,o,r,s,a){var l=this.legend.border.width,h=this.isBulletChartControl,d=this.bulletChart,p="Inside"===d.labelPosition,c="Inside"===d.tickPosition,u="Vertical"===d.orientation,g=h&&""!==d.categoryField?r.width+this.chart.border.width+3*l:0,m=this.chart.margin.bottom,f=i.height+l+this.legend.margin.top+this.legend.margin.bottom,y=i.width+l+this.legend.margin.left+this.legend.margin.right;"Bottom"===e?(i.x=this.alignLegend(i.x,o.width,i.width,t),i.y=!s||i.height!==s.height&&"Pie"===this.chart.series[0].type?n.y+(n.height-f)+l+this.legend.margin.top:s.y,i.y+=!h||d.opposedPosition||p||c||u?u&&""!==d.categoryField?r.height+2*l:0:d.majorTickLines.height+m+this.legend.border.width+2*l,a&&i.height===s.height||Hye(n,new Eve(0,0,0,f))):"Top"===e?(r=void 0,this.isChartControl&&(r=So("100",this.chart.verticalAxes[0].labelStyle,this.chart.themeStyle.legendLabelFont)),i.x=this.alignLegend(i.x,o.width,i.width,t),i.y=!s||i.height!==s.height&&"Pie"===this.chart.series[0].type?n.y+l+this.legend.margin.top:s.y,i.y-=!h||!d.opposedPosition||p||c||u?0:d.majorTickLines.height+this.chart.margin.top,f-=h?2*-l:this.isChartControl?2*-l-r.height/2:0,a&&i.height===s.height||Hye(n,new Eve(0,0,f,0))):"Right"===e?(i.x=!s||i.width!==s.width&&"Pie"===this.chart.series[0].type?n.x+(n.width-i.width)-this.legend.margin.right:s.x,i.y=n.y+this.alignLegend(0,o.height-(n.y+m),i.height,t),y+=h&&d.opposedPosition&&!p&&!c&&u?this.chart.margin.left+this.chart.margin.right+d.majorTickLines.height:0,a&&i.width===s.width||Hye(n,new Eve(0,y,0,0))):"Left"===e?(i.x=!s||i.width!==s.width&&"Pie"===this.chart.series[0].type?i.x+this.legend.margin.left:s.x,i.y=n.y+this.alignLegend(0,o.height-(n.y+m),i.height,t),y+=!h||d.opposedPosition||p||c||!u?"Vertical"!==d.orientation&&""!==d.categoryField?g:0:i.x-this.chart.margin.left+l+d.majorTickLines.height,a&&i.width===s.width||Hye(n,new Eve(y,0,0,0))):(i.x=this.legend.location.x,i.y=this.legend.location.y,Hye(n,new Eve(0,0,0,0)))},Lbe.prototype.alignLegend=function(e,t,i,n){switch(n){case"Far":e=t-i-e;break;case"Center":e=(t-i)/2}return e},Lbe.prototype.renderLegend=function(e,t,i,n,o){var r,s,a=0,l=(new Do(0,0,0,0),new Do(0,0,0,0)),h=(o&&(r=ie(this.legendID+"_element").getAttribute("x"),s=ie(this.legendID+"_element").getAttribute("y")),this.findFirstLegendPosition(this.legendCollections)),d=t.padding,p=(this.itemPadding=this.isBulletChartControl?t.padding:this.itemPadding,t.enablePages),c=t.titlePosition,u=this.isPaging&&!t.enablePages&&this.isVertical&&("accumulationchart"!==e.getModuleName()&&"chart"!==e.getModuleName()||"Auto"===this.legend.layout)?this.pageButtonSize:0,g=e.renderer.createGroup({id:this.legendID+"_g"}),m=this.createLegendElements(e,i,g,t,this.legendID,n),f=(this.legendRegions=[],this.chartRowCount=1,0),y=this.isTitle&&(this.isTop||this.isVertical)?this.legendTitleSize.height:0;if(this.isChartControl||this.isAccChartControl&&(!this.isVertical||t.layout&&"Auto"!==t.layout)){for(var v=1,b=this.rowHeights[0]+(this.isVertical||1<this.rowHeights.length&&this.legend.itemPadding&&"chart"===this.chart.getModuleName()?this.itemPadding:d),w=1;w<this.rowHeights.length;w++)b+this.rowHeights[w]+((this.isVertical||1<this.rowHeights.length&&"chart"===this.chart.getModuleName())&&this.legend.itemPadding?this.itemPadding:d)>this.legendBounds.height-this.pageButtonSize-this.maxItemHeight/2-this.legend.containerPadding.top-this.legend.containerPadding.bottom&&(this.pageHeights[v-1]=b+y,v++,b=0),b+=this.rowHeights[w]+(this.isVertical||1<this.rowHeights.length&&this.legend.itemPadding&&"chart"===this.chart.getModuleName()?this.itemPadding:d);this.pageHeights[v-1]=b+y,this.totalPages=v}for(w=0;w<this.legendCollections.length;w++)if(""!==this.legendCollections[w].text){f=Math.max(this.legendCollections[w].textSize.height,f);break}if(this.isChartControl||this.isAccChartControl||(this.maxItemHeight=Math.max(f,t.shapeHeight)),p||!this.isPaging||this.isVertical?this.isTitle&&!this.isVertical&&(a=c===(this.isRtlEnable?"Right":"Left")?this.fivePixel+this.legendTitleSize.width:0):(a=this.isTitle&&"Left"===c?this.legendTitleSize.width:0,a+=this.pageButtonSize+2*this.fivePixel),"Gradient"===e.legendSettings.mode&&1<this.legendCollections.length)this.getLinearLegend(i,e,t,m),this.totalPages=1;else if(h!==this.legendCollections.length){for(var C,S,A=void 0,x=0,I=this.legendCollections[h],p=this.isBulletChartControl?d:a+d+t.shapeWidth/2+t.containerPadding.left,a=this.isBulletChartControl&&!this.isRtlEnable?i.x+a+d+t.shapeWidth/2:this.isRtlEnable?i.x+("accumulationchart"!==this.chart.getModuleName()||!this.isVertical||"Auto"!==t.layout||0<t.maximumColumns?i.width:this.maxWidth)-p:i.x+p,T=new Tve(a,this.isBulletChartControl?i.y+y+u+d+this.maxItemHeight/2:i.y+y+u+d+this.maxItemHeight/2+t.containerPadding.top),p=e.isRtlEnabled||e.enableRtl?"end":"start",E=new ko("",T.x,T.y,p),D=t.shapePadding+this.itemPadding+t.shapeWidth,l=(this.totalPages=this.totalPages=this.isAccChartControl||this.isChartControl||this.isBulletChartControl||this.isStockChartControl?this.totalPages:0,this.pageXCollections=[],this.legendCollections[h].location=T,!t.enablePages&&this.isPaging?(a=T.x-this.fivePixel,u=T.y-this.fivePixel,p=this.isTitle&&!this.isVertical&&"Left"===c?this.legendTitleSize.width+this.fivePixel:0,S=this.isVertical?this.pageButtonSize+Math.abs(u-i.y):0,c=this.isTitle&&!this.isVertical&&"Right"===c?this.legendTitleSize.width+this.fivePixel:0,c+=this.isVertical?0:this.fivePixel+this.pageButtonSize+this.fivePixel,new Do(a,u,i.width-c-p,i.height-S)):i),M=void 0,w=0;w<this.legendCollections.length;w++)M=this.legendCollections[w],C=this.isReverse?this.legendCollections.length-1-x:x,"accumulationchart"===this.chart.getModuleName()&&(M.fill=(this.chart||this.chart||this.chart||this.chart).visibleSeries[0].points[M.pointIndex].color),"stockChart"===this.chart.getModuleName()&&(M.type=this.chart.visibleSeries[x].type),this.accessbilityText=this.isBulletChartControl?"Legend of bullet chart"+M.text:"Click to show or hide the "+M.text+" series",M.render&&M.text&&""!==M.text&&(!(A=e.renderer.createGroup({id:this.legendID+this.generateId(M,"_g_",C)}))||"chart"!==this.chart.getModuleName()&&"accumulationchart"!==this.chart.getModuleName()?A&&(A.setAttribute("tabindex",0===w?"0":""),A.style.outline="none",A.setAttribute("aria-label",t.description||M.text+" series is "+(M.visible?"showing, press enter to hide the ":"hidden, press enter to show the ")+M.text+" series"),A.setAttribute("role","button"),A.setAttribute("aria-pressed",M.visible?"true":"false")):(A.setAttribute("tabindex",0===w&&t.accessibility.focusable?String(t.accessibility.tabIndex):""),A.style.outline="none",A.setAttribute("aria-label",t.accessibility.accessibilityDescription||M.text+" series is "+(M.visible?"showing, press enter to hide the ":"hidden, press enter to show the ")+M.text+" series"),A.setAttribute("role",t.accessibility.accessibilityRole||"button"),A.setAttribute("aria-pressed",M.visible?"true":"false")),this.library.getRenderPoint(M,T,D,I,l,x,h),this.renderSymbol(M,A,C),this.renderText(e,M,A,E,x,C),A&&(A.style.cssText="pointer-events: bounding-box; cursor: "+(!t.toggleVisibility&&("None"===e.selectionMode||"None"===e.highlightMode||"None"===e.selectionMode)||this.isBulletChartControl?"auto":"pointer")),m&&m.appendChild(A),I=M),x++;this.totalPages=this.isPaging&&!this.isBulletChartControl&&!this.legend.enablePages&&!this.isVertical&&this.totalPages>this.chartRowCount?this.chartRowCount:this.totalPages,this.currentPage=1<this.currentPage&&this.currentPage>this.totalPages?this.totalPages:this.currentPage,this.isPaging&&1<this.totalPages?this.renderPagingElements(e,i,E,g):this.totalPages=1}o?(a="translate("+(1<this.rowCount?0:Math.round(Number(r))-Math.round(this.legendBounds.x))+" \n              + ',' + "+(Math.round(Number(s))-Math.round(this.legendBounds.y))+")",u="translate("+(Math.round(Number(r))-Math.round(this.legendBounds.x))+", "+(Math.round(Number(s))-Math.round(this.legendBounds.y))+")",O0e(e.enableCanvas,e.svgObject,g,n,!0,"x","y",void 0,void 0,void 0,void 0,void 0,e.duration,void 0,void 0,new Tve(0,0),"Top"===this.position||"Bottom"===this.position?a:u)):O0e(e.enableCanvas,e.svgObject,g,n)},Lbe.prototype.getLinearLegend=function(e,t,i,n){var o="http://www.w3.org/2000/svg",r=this.legendCollections[0],s=this.legendCollections[1],a=this.chart.renderer.createDefs(),l=document.createElementNS(o,"linearGradient"),h=[],d=[];i.title&&(this.isVertical?(e.y+=this.legendTitleSize.height,e.height-=this.legendTitleSize.height):"Left"===i.titlePosition?(e.x+=this.legendTitleSize.width,e.width-=this.legendTitleSize.width):"Right"===i.titlePosition?e.width-=this.legendTitleSize.width:"Top"===i.titlePosition&&(e.y+=this.legendTitleSize.height,e.height-=this.legendTitleSize.height));for(var p=0,c=this.chart.rangeColorSettings;p<c.length;p++){var u=c[p];if(d.indexOf(u.start)<0&&d.push(u.start),2<u.colors.length){var g=u.end-u.start,m=u.colors.length-1;if(0<g){g/=m;for(var f=1;f<m;f++){var O=u.start+g*f;d.push(O)}}else for(f=1;f<m;f++)d.push(u.start)}d.indexOf(u.end)<0&&d.push(u.end);for(var y=0,v=u.colors;y<v.length;y++){var N=v[y];h.indexOf(N)<0&&h.push(N)}0<u.colors.length&&u.colors.length<2&&h.push(u.colors[0])}for(var b=this.isRtlEnable&&!this.isVertical?"100%":"0%",w=this.isVertical||this.isRtlEnable?"0%":"100%",C=this.isVertical?"100%":"0%",V=(l.setAttribute("id",this.generateId(r,"linearGradient",0)),l.setAttribute("x1",b),l.setAttribute("y1","0%"),l.setAttribute("x2",w),l.setAttribute("y2",C),d[d.length-1]-d[0]),S=0;S<h.length;S++){var _=d[S]-d[0],A=(_/=V,document.createElementNS(o,"stop"));A.setAttribute("offset",_.toString()),A.setAttribute("stop-color",h[S]),A.setAttribute("stop-opacity",1..toString()),l.appendChild(A)}var x,I,T,E,D,b=r.text.toString(),w=s.text.toString(),C=So(b,i.textStyle,this.chart.themeStyle.legendLabelFont),s=So(w,i.textStyle,this.chart.themeStyle.legendLabelFont),M=(C.width>s.width?C:s).width,k=(C.height>s.height?C:s).height,P=2*M+4*i.padding,B=e.width,F=e.height,L=e.x+M+2*i.padding,R=e.y+i.padding,P=(this.isVertical?(P=2*k+4*i.padding,B=e.width-2*i.padding,F=e.height-P,L=e.x+i.padding,R=e.y+k+2*i.padding,x=e.y+i.padding+k,I=R+F+k,E=T=e.x+.5*e.width-.5*M,30<B&&(D=B-30,B=30,L+=D/2)):(B=e.width-P,F=e.height-2*i.padding,T=e.x+(this.isRtlEnable?B+3*i.padding+M:i.padding+(M-C.width)),E=e.x+(this.isRtlEnable?i.padding+(M-s.width):B+3*i.padding+M),I=x=e.y+.5*e.height+.25*k,30<F&&(D=F-30,F=30,R+=D/2)),t.enableRtl?"end":""),C=new ko("",T,x,P,b),s=(C.id=this.legendID+this.generateId(r,"_text_",1),r.visible?i.textStyle.color||t.themeStyle.legendLabelFont.color:"#D3D3D3"),M=!this.isStockChartControl&&this.chart.enableCanvas,e=(sve(t.renderer,C,i.textStyle,s,n,!1,!1,!1,!1,null,this.currentPageNumber&&M?new Do(0,-this.translatePage(M,null,this.currentPageNumber-1,this.currentPageNumber),0,0):null,0,null,null,null,this.chart.themeStyle.legendLabelFont),(C=new ko("",E,I,P,w)).id=this.legendID+this.generateId(r,"_text_",2),sve(t.renderer,C,i.textStyle,s,n,!1,!1,!1,!1,null,this.currentPageNumber&&M?new Do(0,-this.translatePage(M,null,this.currentPageNumber-1,this.currentPageNumber),0,0):null,0,null,null,null,this.chart.themeStyle.legendLabelFont),t.renderer.drawRectangle({width:B,height:F,x:L,y:R,fill:"url(#"+this.generateId(r,"linearGradient",0)+")"}));a.appendChild(l),n.appendChild(a),n.appendChild(e)},Lbe.prototype.findFirstLegendPosition=function(e){for(var t=0,i=0,n=e;i<n.length;i++){var o=n[i];if(o.render&&o.text&&""!==o.text)break;t++}return t},Lbe.prototype.calculateLegendTitle=function(e,t){var i;e.title?(this.isTop="Top"===e.titlePosition,i="Trim"===e.titleStyle.textOverflow?2*e.padding:0,this.isTop||this.isVertical?this.legendTitleCollections=hve(e.title,e.titleStyle,t.width-i,this.chart.enableRtl,this.chart.themeStyle.legendTitleFont):this.legendTitleCollections[0]=eve(e.maximumTitleWidth,e.title,e.titleStyle,this.chart.enableRtl,this.chart.themeStyle.legendTitleFont),t=this.isTop?e.title:this.legendTitleCollections[0],this.legendTitleSize=So(t,e.titleStyle,this.chart.themeStyle.legendTitleFont),this.legendTitleSize.height*=this.legendTitleCollections.length):this.legendTitleSize=new Eo(0,0)},Lbe.prototype.renderLegendTitle=function(e,t,i,n){var o=t.padding,r=t.titleStyle.textAlignment,s=(this.isTop="Top"===t.titlePosition,Nve(t.titleStyle.textAlignment,e.enableRtl)),a=dve(i,t.titleStyle),s=this.isTop||this.isVertical?s:e.enableRtl?"end":"",a="Near"===r?a+o:"Far"===r?a-o:a,r=(a=this.isTop||this.isVertical?a:i.x+("Left"===t.titlePosition?5:i.width-this.legendTitleSize.width-5),i.height/2+this.legendTitleSize.height/4),o=i.y+(this.isTop||this.isVertical?this.legendTitleSize.height/this.legendTitleCollections.length:r),i=new ko(this.legendID+"_title",a,o,s,this.legendTitleCollections);sve(e.renderer,i,t.titleStyle,t.titleStyle.color||this.chart.themeStyle.legendTitleFont.color,n,null,null,null,null,null,null,0,null,null,null,this.chart.themeStyle.legendTitleFont)},Lbe.prototype.createLegendElements=function(e,t,i,n,o,r){var s=n.padding,a=new vve(o+"_element",n.background,n.border,n.opacity,t,0,0,"",this.legend.border.dashArray),l=e.renderer.createGroup({id:o+"_collections"}),h=!this.isStockChartControl&&e.enableCanvas,d=e.renderer.createClipPath({id:o+"_clipPath"});return a.width=!this.isRtlEnable||"accumulationchart"!==this.chart.getModuleName()||!this.isVertical||"Auto"!==n.layout||0<n.maximumColumns?t.width:this.maxWidth,i?i.appendChild(e.renderer.drawRectangle(a)):e.renderer.drawRectangle(a),n.title&&this.renderLegendTitle(e,n,t,i),h||i.appendChild(l),this.legendTranslateGroup=e.renderer.createGroup({id:o+"_translate_g"}),h||l.appendChild(this.legendTranslateGroup),a.y+=(this.isTop?this.legendTitleSize.height:0)+(this.isBulletChartControl?0:n.containerPadding.top),a.height-=(!this.isTop||!this.isChartControl&&this.isVertical&&"Auto"===n.layout?0:this.legendTitleSize.height)+(this.isBulletChartControl?0:n.containerPadding.top),a.id+="_clipPath_rect",a.width=this.isChartControl||"bulletChart"===e.getModuleName()||this.isStockChartControl||"accumulationchart"===e.getModuleName()&&("Auto"!==n.layout||0<n.maximumColumns)||!this.isVertical?t.width:this.maxWidth-s+n.containerPadding.left+n.containerPadding.right,h?this.pagingClipRect=a:(this.clipRect=e.renderer.drawRectangle(a),d.appendChild(this.clipRect)),O0e(h,e.svgObject,d,r),h||(l.style.cssText="clip-path:url(#"+d.id+")"),this.legendTranslateGroup},Lbe.prototype.renderSymbol=function(e,t,i){var n,o=this.isBulletChartControl?this.chart:null,r=e.visible?e.fill:"#D3D3D3",s=("chart"===this.chart.getModuleName()||"stockChart"===this.chart.getModuleName())&&("SeriesType"===e.shape&&-1<e.type.toLowerCase().indexOf("line")&&-1===e.type.toLowerCase().indexOf("area")||"HorizontalLine"===e.shape||"VerticalLine"===e.shape||"Cross"===e.shape),a=!("chart"!==this.chart.getModuleName()&&"stockChart"!==this.chart.getModuleName()||"Scatter"!==e.type&&"Bubble"!==e.type),l=!this.isStockChartControl&&this.chart.enableCanvas,h="SeriesType"===e.shape?e.type:e.shape,s=s?("Series"===this.legend.mode?this.chart.visibleSeries[i]:this.chart.visibleSeries[0]).width:this.isBulletChartControl&&"Multiply"===e.shape?4:1,h="Scatter"===h?e.markerShape:h,d=(a&&i<this.chart.visibleSeries.length&&(c=(p=this.chart.visibleSeries[i]).border,n=!(d="HorizontalLine"===h||"VerticalLine"===h)&&c.color||r,s=d?p.width:c.width||1),new No(this.legendID+this.generateId(e,"_shape_",i),r,s,a?n:r,this.legend.opacity,e.dashArray,"")),p=So(e.text,this.legend.textStyle,this.chart.themeStyle.legendLabelFont),c=this.legend.isInversed&&!this.isRtlEnable?e.location.x+p.width+this.legend.shapePadding:e.location.x,s=e.location.y;l?(a=-this.translatePage(l,null,this.currentPageNumber-1,this.currentPageNumber),A0e({x:c,y:s},h,new Eo(this.legend.shapeWidth,this.legend.shapeHeight),"",d,this.accessbilityText,this.chart.renderer,this.currentPageNumber?new Do(0,a,0,0):null,this.isBulletChartControl,o),this.legendRegions.push({rect:new Do(e.location.x-this.legend.shapeWidth,e.location.y,this.legend.shapeWidth+this.legend.shapePadding,this.legend.shapeHeight+a),index:i})):t.appendChild(A0e({x:c,y:s},h,new Eo(this.legend.shapeWidth,this.legend.shapeHeight),e.url,d,this.accessbilityText,this.chart.renderer,null,this.isBulletChartControl,o)),("Line"===h&&e.markerVisibility&&"Image"!==e.markerShape||"Doughnut"===e.type&&"Doughnut"===h)&&(d.id=this.legendID+this.generateId(e,"_shape_marker_",i),h="Doughnut"===e.type?"Circle":e.markerShape,d.fill="Doughnut"===e.type?"#FFFFFF":d.fill,l?A0e({x:c,y:s},h,new Eo(this.legend.shapeWidth/2,this.legend.shapeHeight/2),"",d,this.accessbilityText,this.chart.renderer,this.currentPageNumber?new Do(0,-this.translatePage(l,null,this.currentPageNumber-1,this.currentPageNumber),0,0):null,this.isBulletChartControl,o):t.appendChild(A0e({x:c,y:s},h,new Eo(this.legend.shapeWidth/2,this.legend.shapeHeight/2),"",d,this.accessbilityText,null,null,this.isBulletChartControl,o)))},Lbe.prototype.renderText=function(e,t,i,n,o,r){var s=e.legendSettings,a=t.visible?s.textStyle.color||e.themeStyle.legendLabelFont.color:"#D3D3D3",l=!this.isStockChartControl&&this.chart.enableCanvas;if(n.id=this.legendID+this.generateId(t,"_text_",r),n.text=0<t.textCollection.length?t.textCollection:t.text,s.isInversed&&!this.isRtlEnable?n.x=t.location.x-s.shapeWidth/2:this.isRtlEnable?(r=So(t.text,s.textStyle,this.chart.themeStyle.legendLabelFont).width,n.x="bulletChart"===this.chart.getModuleName()?t.location.x-s.shapeWidth:t.location.x-((1<t.textCollection.length?r/t.textCollection.length:r)+s.shapeWidth/2+s.shapePadding)):n.x=t.location.x+s.shapeWidth/2+s.shapePadding,n.y=t.location.y+this.maxItemHeight/4,sve(e.renderer,n,s.textStyle,a,i,!1,!1,!1,!1,null,this.currentPageNumber&&l?new Do(0,-this.translatePage(l,null,this.currentPageNumber-1,this.currentPageNumber),0,0):null,0,null,null,null,this.chart.themeStyle.legendLabelFont),l){for(var r=So(t.text,s.textStyle,this.chart.themeStyle.legendLabelFont),h=void 0,d=0;d<this.legendRegions.length;d++)if(this.legendRegions[d].index===o){h=this.legendRegions[d];break}h.rect.y=(n.y<h.rect.y?n:h.rect).y,h.rect.width+=r.width,h.rect.height=r.height,h.rect.y-=.5*r.height,h.rect.x-=this.isRtlEnable?h.rect.width:0}},Lbe.prototype.renderPagingElements=function(e,t,i,n){var o,r=e.renderer.createGroup({id:this.legendID+"_navigation"}),s=!this.isStockChartControl&&e.enableCanvas,a=this.isBulletChartControl?0:this.legendTitleSize.height,l=-1<this.chart.theme.indexOf("Dark")||-1<this.chart.theme.indexOf("Contrast")?"#FFFFFF":"#545454",h=e.legendSettings,d=this.legendID+(this.isRtlEnable?"_pagedown":"_pageup"),p=this.legendID+(this.isRtlEnable?"_pageup":"_pagedown"),d=new No(d,"transparent",5,l,1,"",""),l=e.availableSize.width<110||e.availableSize.height<190?4:this.pageButtonSize,c=Pe({},R("properties",h.textStyle),null,!0),u=(c.size=e.availableSize.width<110||e.availableSize.height<190&&!this.isBulletChartControl&&"accumulationchart"===this.chart.getModuleName()?"8px":h.textStyle.size,h.enablePages||!this.isPaging||this.isVertical||this.isBulletChartControl?this.rowCount-1:1),g=this.isTitle&&"Left"===h.titlePosition?this.legendTitleSize.width:0,n=(this.pagingRegions=[],this.backwardArrowOpacity=1!==this.currentPage?1:0,this.forwardArrowOpacity=this.currentPage===this.totalPages?0:1,s||n.appendChild(r),this.isChartControl||this.isAccChartControl||(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)),r&&(r.style.cursor="pointer"),!this.isChartControl&&!this.isAccChartControl||!h.enablePages&&this.isPaging?this.clipPathHeight=u*(this.maxItemHeight+h.padding):this.clipPathHeight=this.pageHeights[0]-(this.isTitle&&this.isTop&&(this.isChartControl||!this.isVertical||"Auto"!==h.layout)?this.legendTitleSize.height:0)-h.containerPadding.top-h.containerPadding.bottom,s?(this.pagingClipRect.height=this.legendBounds.height-this.clipPathHeight-(this.pagingClipRect.y-this.legendBounds.y)-h.border.width,this.pagingClipRect.y=this.pagingClipRect.y+this.clipPathHeight,this.pagingClipRect.x+=h.border.width,this.pagingClipRect.width-=h.border.width+h.border.width/2,this.chart.renderer.clearRect(new Do(this.pagingClipRect.x,this.pagingClipRect.y,this.pagingClipRect.width,this.pagingClipRect.height))):this.clipRect.setAttribute("height",this.clipPathHeight.toString()),t.x+l/2),u=t.y+this.clipPathHeight+(a+t.height-this.clipPathHeight)/2,g=(!this.isPaging||h.enablePages||this.isVertical||this.isBulletChartControl||(n=t.x+this.pageButtonSize+g,u=h.title&&this.isTop?t.y+8+a+ +l+.5:t.y+8+l+.5),So(this.totalPages+"/"+this.totalPages,c,this.chart.themeStyle.legendLabelFont)),m=this.isRtlEnable?h.border.width+l/2:t.width-(2*(l+8)+8+g.width),a=(s?A0e({x:n,y:u},"LeftArrow",new Eo(l,l),"",d,0,this.chart.renderer,new Do(m,0,0,0)):!this.isVertical||h.enablePages||this.isBulletChartControl?(d.opacity=this.isBulletChartControl?d.opacity:h.enablePages?1:this.isRtlEnable?this.forwardArrowOpacity:this.backwardArrowOpacity,r.appendChild(A0e({x:n,y:u},"LeftArrow",new Eo(l,l),"",d))):(n=t.x+t.width/2,u=t.y+l/2+4+a,d.opacity=this.backwardArrowOpacity,r.appendChild(A0e({x:n,y:u},"UpArrow",new Eo(l,l),"",d))),this.pagingRegions.push(new Do(this.isRtlEnable?n:n+t.width-(2*(l+8)+8+g.width)-.5*l,u-.5*l,l,l)),i.x=n+l/2+8,i.y=u+g.height/4,i.id=this.legendID+"_pagenumber",i.text=this.isRtlEnable?this.totalPages+"/1":"1/"+this.totalPages,-1<this.chart.theme.indexOf("Dark")||-1<this.chart.theme.indexOf("Contrast")?"#FFFFFF":h.textStyle.color||"Tailwind3"===this.chart.theme?"#111827":"Tailwind3Dark"===this.chart.theme?"#FFFFFF":this.chart.themeStyle.legendLabelFont.color);s&&this.totalNoOfPages&&(i.text=this.isRtlEnable?this.totalNoOfPages+"/"+this.currentPageNumber:this.currentPageNumber+"/"+this.totalNoOfPages),(h.enablePages||this.isBulletChartControl)&&(o=sve(e.renderer,i,c,a,r,!1,!1,!1,!1,null,new Do(m,0,0,0),0,null,null,null,this.chart.themeStyle.legendLabelFont)),n=i.x+8+l/2+g.width,!this.isPaging||h.enablePages||this.isBulletChartControl||this.isVertical||(n=t.x+t.width-(this.isBulletChartControl?this.fivePixel:0)-this.pageButtonSize-(h.title&&"Right"===h.titlePosition?this.legendTitleSize.width+this.fivePixel:0)),d.id=p,d.opacity=h.enablePages?1:this.isRtlEnable?this.backwardArrowOpacity:this.forwardArrowOpacity,s?A0e({x:n,y:u},"RightArrow",new Eo(l,l),"",d,0,this.chart.renderer,new Do(m,0,0,0)):!this.isVertical||h.enablePages||this.isBulletChartControl?r.appendChild(A0e({x:n,y:u},"RightArrow",new Eo(l,l),"",d)):(n=t.x+t.width/2,u=t.y+t.height-l/2,r.appendChild(A0e({x:n,y:u},"DownArrow",new Eo(l,l),"",d))),this.pagingRegions.push(new Do(this.isRtlEnable?n:n+(t.width-(2*(l+8)+8+g.width)-.5*l),u-.5*l,l,l)),s||!h.enablePages&&!this.isBulletChartControl?(1===this.currentPageNumber&&this.calTotalPage&&(h.enablePages||this.isBulletChartControl)&&(this.totalNoOfPages=this.totalPages,this.calTotalPage=!1),h.enablePages||this.isBulletChartControl||this.translatePage(s,null,this.currentPage-1,this.currentPage,h)):r.setAttribute("transform","translate("+m+", 0)"),(h.enablePages||this.isBulletChartControl)&&this.translatePage(s,o,this.currentPage-1,this.currentPage,h)},Lbe.prototype.getPageHeight=function(e,t){for(var i=0,n=0;n<t;n++)i+=e[n]-(this.isTitle&&this.isTop?this.legendTitleSize.height:0);return i},Lbe.prototype.translatePage=function(e,t,i,n,o){var r=this.isChartControl||this.isAccChartControl?i?this.getPageHeight(this.pageHeights,i):0:this.clipPathHeight*i,e=(e||!this.isChartControl&&!this.isAccChartControl||(this.clipRect.setAttribute("height",(this.pageHeights[i]-(this.isTitle&&this.isTop&&(this.isChartControl||!this.isVertical||"Auto"!==o.layout)?this.legendTitleSize.height:0)-o.containerPadding.top-o.containerPadding.bottom).toString()),this.isAccChartControl&&this.isPaging&&!o.enablePages&&this.isVertical&&("accumulationchart"!==this.chart.getModuleName()||"Auto"===o.layout)&&this.clipRect.setAttribute("height",this.legendBounds.height.toString())),"translate(0,-"+r+")");return this.isChartControl||this.isBulletChartControl||this.isStockChartControl||"accumulationchart"===this.chart.getModuleName()&&"Auto"!==o.layout||!this.isVertical||(i=this.pageXCollections[i*this.maxColumns],r=this.isRtlEnable?this.legendBounds.x+this.maxWidth-i:i-this.legendBounds.x,e=(this.isRtlEnable?"translate(":"translate(-")+(r=r<0?0:r)+",0)"),this.chart.enableCanvas||this.legendTranslateGroup.setAttribute("transform",e),this.chart.enableCanvas||!o.enablePages&&!this.isBulletChartControl||(t.textContent=n+"/"+this.totalPages),this.currentPage=n,r},Lbe.prototype.changePage=function(e,t){var i=this.chart.legendSettings,n=document.getElementById(this.legendID+"_pageup"),o=document.getElementById(this.legendID+"_pagedown"),r=!this.isStockChartControl&&this.chart.enableCanvas,s=i.enablePages||this.isBulletChartControl?document.getElementById(this.legendID+"_pagenumber"):null,a=i.enablePages||this.isBulletChartControl?parseInt(s.textContent.split("/")[0],10):this.currentPage;t&&1<a?this.translatePage(r,s,a-2,a-1,i):!t&&a<this.totalPages&&this.translatePage(r,s,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(n):this.showArrow(n))},Lbe.prototype.hideArrow=function(e){e.setAttribute("opacity","0")},Lbe.prototype.showArrow=function(e){e.setAttribute("opacity","1")},Lbe.prototype.generateId=function(e,t,i){return this.isChartControl||this.isStockChartControl?t+i:t+e.pointIndex},Lbe.prototype.move=function(e){var t,i=this,n=this.chart.mouseX,o=this.chart.mouseY;-1<e.target.textContent.indexOf("...")?2===(e=e.target.id.split(this.legendID+"_text_")).length&&(e=parseInt(e[1],10),t=this.chart.element,isNaN(e)||(this.chart.isTouch&&Pye(this.chart.element.id+"_EJ2_Legend_Tooltip"),this.isChartControl?Fye(this.chart.series[e].name,n,o,t.offsetWidth,t.id+"_EJ2_Legend_Tooltip",ie(this.chart.element.id+"_Secondary_Element")):Fye("accumulationchart"===this.chart.getModuleName()?this.legendCollections[e].originalText:this.chart.visibleSeries[0].points[e].x.toString(),n+10,o+10,t.offsetWidth,t.id+"_EJ2_Legend_Tooltip",ie(this.chart.element.id+"_Secondary_Element")))):Pye(this.chart.element.id+"_EJ2_Legend_Tooltip"),this.chart.isTouch&&(clearTimeout(this.clearTooltip),this.clearTooltip=+setTimeout(function(){Pye(i.chart.element.id+"_EJ2_Legend_Tooltip")},1e3))};Gve=Lbe;function Lbe(e){this.maxItemHeight=0,this.rowHeights=[],this.pageHeights=[],this.columnHeights=[],this.pageXCollections=[],this.chartRowCount=1,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()||"chart3d"===e.getModuleName(),this.isAccChartControl="accumulationchart"===e.getModuleName()||"circularchart3d"===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}var Rbe=function(e,t,i,n,o,r,s,a,l,h,d,p){this.location={x:0,y:0},this.textCollection=[],this.text=e,this.fill=t,this.shape=i,this.url=r,this.visible=n,this.type=o,this.markerVisibility=a,this.markerShape=s,this.pointIndex=l,this.seriesIndex=h,this.dashArray=d,this.originalText=p};Obe=function(e,t){return(Obe=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])}))(e,t)};var Obe,Nbe,Vbe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},_be=(function(e,t){function i(){this.constructor=e}Obe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Hbe,Nbe=fbe),Hbe.prototype.setDataSource=function(e,t){e&&(this.xData=e.xData,this.yData=e.yData,this.points=e.points);e=l0e(this.type);this.visible&&t[e+"IndicatorModule"].initDataSource(this,t),t.visibleSeriesCount+=this.targetSeries.length},Vbe([e("Sma")],Hbe.prototype,"type",void 0),Vbe([e(14)],Hbe.prototype,"period",void 0),Vbe([e(14)],Hbe.prototype,"kPeriod",void 0),Vbe([e(3)],Hbe.prototype,"dPeriod",void 0),Vbe([e(80)],Hbe.prototype,"overBought",void 0),Vbe([e(20)],Hbe.prototype,"overSold",void 0),Vbe([e(2)],Hbe.prototype,"standardDeviation",void 0),Vbe([e("Close")],Hbe.prototype,"field",void 0),Vbe([e(12)],Hbe.prototype,"slowPeriod",void 0),Vbe([e(26)],Hbe.prototype,"fastPeriod",void 0),Vbe([e(!0)],Hbe.prototype,"showZones",void 0),Vbe([t({color:"#ff9933",width:2},Lue)],Hbe.prototype,"macdLine",void 0),Vbe([e("Both")],Hbe.prototype,"macdType",void 0),Vbe([e("#2ecd71")],Hbe.prototype,"macdPositiveColor",void 0),Vbe([e("#e74c3d")],Hbe.prototype,"macdNegativeColor",void 0),Vbe([e("rgba(211,211,211,0.25)")],Hbe.prototype,"bandColor",void 0),Vbe([t({color:"#ffb735",width:1},Lue)],Hbe.prototype,"upperLine",void 0),Vbe([t({color:"#f2ec2f",width:1},Lue)],Hbe.prototype,"lowerLine",void 0),Vbe([t({color:"#f2ec2f",width:1},Lue)],Hbe.prototype,"periodLine",void 0),Vbe([t({},wge)],Hbe.prototype,"accessibility",void 0),Vbe([e("")],Hbe.prototype,"seriesName",void 0),Hbe);function Hbe(){var e=null!==Nbe&&Nbe.apply(this,arguments)||this;return e.clipRect=new Do(0,0,0,0),e}jbe.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);e={cancel:!1,htmlContent:this.getHTMLContent(e),name:dfe};this.control.trigger(dfe,e),e.cancel||V(e.htmlContent,this.printWindow)},jbe.prototype.getHTMLContent=function(e){var t=Q("div");if(e)if(e instanceof Array)for(var i=0;i<e.length;i++){var n=e[i];t.appendChild(ie(n).cloneNode(!0))}else e instanceof Element?t.appendChild(e.cloneNode(!0)):t.appendChild(ie(e).cloneNode(!0));else t.appendChild(this.control.element.cloneNode(!0));for(var o=0;o<t.children.length;o++){for(var r=-1<this.control.theme.indexOf("Dark")||-1<this.control.theme.indexOf("HighContrast")?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)",s=t.children[o],a=0;a<s.children.length;a++){var l=void 0,h=!1;-1<s.id.indexOf("_stockChart_svg")?(l=s.children[0].getAttribute("fill"),h=!0):-1<s.children[a].id.indexOf("_svg")&&(l=s.children[a].children[0].getAttribute("fill"),h=!0),h&&s.children[a].children[0].setAttribute("fill",l="transparent"===l?r:l)}t[o]=s}return t};var zbe=jbe;function jbe(e){this.control=e}Wbe=function(e,t){return(Wbe=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])}))(e,t)};var Wbe,Qbe,Vbe=function(e,t){function i(){this.constructor=e}Wbe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ube=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},qbe=(Vbe(Gbe,Qbe=n),Ube([e()],Gbe.prototype,"start",void 0),Ube([e()],Gbe.prototype,"end",void 0),Ube([e([])],Gbe.prototype,"colors",void 0),Ube([e("")],Gbe.prototype,"label",void 0),Gbe);function Gbe(){return null!==Qbe&&Qbe.apply(this,arguments)||this}Vbe(Kbe,Ybe=n),Ube([e(!1)],Kbe.prototype,"enable",void 0),Ube([e("")],Kbe.prototype,"dashArray",void 0),Ube([t({color:null,width:1},Rge)],Kbe.prototype,"line",void 0),Ube([e("Both")],Kbe.prototype,"lineType",void 0),Ube([e("")],Kbe.prototype,"verticalLineColor",void 0),Ube([e("")],Kbe.prototype,"horizontalLineColor",void 0),Ube([e(1)],Kbe.prototype,"opacity",void 0),Ube([e(!1)],Kbe.prototype,"snapToData",void 0),Ube([e(!1)],Kbe.prototype,"highlightCategory",void 0);var Ybe,Xbe=Kbe;function Kbe(){return null!==Ybe&&Ybe.apply(this,arguments)||this}Vbe($be,Jbe=n),Ube([e(!1)],$be.prototype,"enableSelectionZooming",void 0),Ube([e(!1)],$be.prototype,"enablePinchZooming",void 0),Ube([e(!1)],$be.prototype,"showToolbar",void 0),Ube([e(!1)],$be.prototype,"enableMouseWheelZooming",void 0),Ube([e(!0)],$be.prototype,"enableDeferredZooming",void 0),Ube([e("XY")],$be.prototype,"mode",void 0),Ube([e(["Zoom","ZoomIn","ZoomOut","Pan","Reset"])],$be.prototype,"toolbarItems",void 0),Ube([e(!1)],$be.prototype,"enablePan",void 0),Ube([e(!1)],$be.prototype,"enableScrollbar",void 0),Ube([e(!1)],$be.prototype,"enableAnimation",void 0),Ube([t({},Ufe)],$be.prototype,"toolbarPosition",void 0),Ube([t({},wge)],$be.prototype,"accessibility",void 0);var Jbe,Zbe=$be;function $be(){return null!==Jbe&&Jbe.apply(this,arguments)||this}Vbe(iwe,ewe=Ji),iwe.prototype.mergePersistChartData=function(){var e=window.localStorage.getItem(this.getModuleName()+this.element.id);if(!je(e)&&""!==e){var t=JSON.parse(e),e=Object.keys(t);this.isProtectedOnChange=!0;for(var i=0,n=e;i<n.length;i++){var o=n[i];"object"!=typeof this[o]||je(this[o])?this[o]=t[o]:Pe(this[o],t[o])}this.isProtectedOnChange=!1}},iwe.prototype.isIdHasSpecialCharacter=function(e){var t=/^[A-Za-z ]+$/,i=/^[0-9 ]+$/,n="";if(t.test(e))return e;var o=0;i.test(e[0])&&(n+="\\3"+e[0],o=1);for(var r=o;r<e.length;r++)t.test(e[r])||-1!==e.indexOf("-")||-1!==e.indexOf("_")||-1!==e.indexOf("\\")||i.test(e[r])?n+=e[r]:n+="\\"+e[r];return n},iwe.prototype.preRender=function(){this.element.id=this.isIdHasSpecialCharacter(this.element.id);this.isBlazor=window.Blazor,this.allowServerDataBinding=!1,this.markerIndex=0,this.unWireEvents(),this.initPrivateVariable(),this.setCulture(),this.wireEvents(),this.stockChart&&(null===this.stockChart.tooltip.header&&(this.tooltip.header=-1<this.stockChart.theme.indexOf("Tailwind3")?"${point.x}":"<b>${point.x}</b>"),null===this.stockChart.tooltip.format)&&(this.tooltip.format=-1<this.stockChart.theme.indexOf("Tailwind3")?"High : ${point.high}<br/>Low : ${point.low}<br/>Open : ${point.open}<br/>Close : ${point.close}":"High : <b>${point.high}</b><br/>Low : <b>${point.low}</b><br/>Open : <b>${point.open}</b><br/>Close : <b>${point.close}</b>"),this.element.setAttribute("dir",this.enableRtl?"rtl":"ltr")},iwe.prototype.initPrivateVariable=function(){if(this.animateSeries=!0,this.delayRedraw=!1,this.dragY=null,this.horizontalAxes=[],this.verticalAxes=[],this.refreshAxis(),this.refreshDefinition(this.rows),this.refreshDefinition(this.columns),this.tooltipModule&&(this.tooltipModule.previousPoints=[]),this.element.setAttribute("role",this.accessibility.accessibilityRole||"region"),this.element.setAttribute("tabindex",this.accessibility.focusable?String(this.accessibility.tabIndex):"-1"),this.element.style.outline="none",this.element.setAttribute("aria-label",this.accessibility.accessibilityDescription||this.title+". Syncfusion interactive chart."),this.element.classList.contains("e-chart-focused")||this.element.setAttribute("class",this.element.getAttribute("class")+" e-chart-focused"),""===this.element.id){for(var e=document.getElementsByClassName("e-chart").length,t="chart_"+this.chartid+"_"+e;document.getElementById(t);)t="chart_"+this.chartid+"_"+ ++e;this.element.id="chart_"+this.chartid+"_"+e}this.svgId=this.stockChart?this.stockChart.element.id+"_stockChart_chart":this.element.id+(this.enableCanvas?"_canvas":"_svg")},iwe.prototype.render=function(){var e=this,t=(this.svgRenderer=new fo(this.element.id),{chart:this.isBlazor?{}:this,theme:this.theme,name:Vme,cancel:!1});this.stockChart?(this.isRtlEnabled="rtl"===window.getComputedStyle(document.querySelector("body")).direction,this.cartesianChartRendering(t)):this.trigger(Vme,t,function(){t.cancel||e.cartesianChartRendering(t)}),this.applyZoomkit()},iwe.prototype.cartesianChartRendering=function(e){this.theme=(this.isBlazor?e:this).theme,this.setTheme(),this.createChartSvg(),this.markerRender=new Mbe(this),this.calculateAreaType(),this.calculateVisibleSeries(),this.initTechnicalIndicators(),this.initTrendLines(),this.calculateVisibleAxis(),this.processData(),this.renderComplete(),this.mouseMoveEvent(),this.allowServerDataBinding=!0},iwe.prototype.getLocalizedLabel=function(e){return this.localeObject.getConstant(e)},iwe.prototype.animate=function(e){if(this.redraw=!0,this.animated=!0,this.duration=e||1e3,this.tooltipModule)this.tooltipModule.removeHighlightedMarker(this.tooltipModule.previousPoints,!0);else if(this.markerRender.previousPoints)for(var t=0;t<this.markerRender.previousPoints.length;t++)this.markerRender.removeHighlightedMarker(this.markerRender.previousPoints[t].series,this.markerRender.previousPoints[t].point)},iwe.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(),Pye("chartmeasuretext"),this.removeSelection(),this.markerRender&&this.markerRender.mergeXvalues(this.visibleSeries)},iwe.prototype.calculateStackValues=function(){for(var e,t=!1,i=0,n=this.visibleSeries.length;i<n;i++)(e=this.visibleSeries[i]).visible&&(e.position=e.rectCount=void 0),-1===e.type.indexOf("Stacking")&&(-1===e.drawType.indexOf("Stacking")||"PolarRadar"!==this.chartAreaType)||t||(e.calculateStackedValue(-1<e.type.indexOf("100"),this),t=!0)},iwe.prototype.removeSelection=function(){for(var e=0,t=this.visibleSeries;e<t.length;e++){var i=t[e];if(i.visible)for(var n=0,o=i.points;n<o.length;n++)o[n].isSelect=!1}ie(this.element.id+"_ej2_drag_multi_group")?(-1<this.selectionMode.indexOf("Drag")&&(this.selectionModule.filterArray=[]),Pye(this.element.id+"_ej2_drag_multi_group"),this.selectionModule.calculateDragSelectedElements(this,new Do(0,0,0,0),!0)):ie(this.element.id+"_ej2_drag_group")&&("Lasso"!==this.selectionMode&&(this.selectionModule.filterArray=[]),Pye(this.element.id+"_ej2_drag_group"),this.selectionModule.calculateDragSelectedElements(this,new Do(0,0,0,0),!0))},iwe.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,t=this.visibleSeries;e<t.length;e++){var i=t[e];ro(this.element.id+"_DataLabel","Template",i.marker.dataLabel)}this.renderAnnotation(),this.stackLabels.visible&&this.visibleSeries.some(function(e){return e.type&&-1<e.type.indexOf("Stacking")})&&this.dataLabelModule&&this.dataLabelModule.renderStackLabels()},iwe.prototype.renderAxes=function(){var e;return this.yAxisElements=this.renderer.createGroup({id:this.element.id+"yAxisCollection"}),0<this.rows.length&&0<this.columns.length&&(e=this.chartAxisLayoutPanel.renderAxes()),this.stripLineModule&&this.stripLineModule.renderStripLine(this,"Behind",this.axisCollections),e},iwe.prototype.renderLegend=function(){var e,t,i;this.legendModule&&this.legendModule.legendCollections.length&&this.legendSettings.visible&&(this.legendModule.calTotalPage=!0,e=this.legendSettings.border.width,t=this.legendModule.legendBounds,i=new Do(t.x,t.y,t.width,t.height),this.enableCanvas&&(this.canvasRender.ctx.beginPath(),i=new Do(i.x-e/2,i.y-e/2,i.width+e,i.height+e),this.renderer.canvasClip(i)),this.legendModule.renderLegend(this,this.legendSettings,t),this.enableCanvas)&&this.renderer.canvasRestore(),this.redraw||(this.stockChart?ie(this.stockChart.chartObject.id)||this.stockChart.mainObject.appendChild(this.svgObject):this.element.appendChild(this.svgObject))},iwe.prototype.setSecondaryElementPosition=function(){var e,t,i=ie(this.element.id+"_Secondary_Element");i&&(e=this.element.getBoundingClientRect(),t=ie(this.svgId).getBoundingClientRect(),i.style.left=Math.max((t.left-e.left)/this.scaleX,0)+"px",i.style.top=Math.max((t.top-e.top)/this.scaleY,0)+"px")},iwe.prototype.initializeModuleElements=function(){this.dataLabelCollections=[];var e=this.element.id;this.series.length&&(this.seriesElements=this.svgRenderer.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"})},iwe.prototype.hasTrendlines=function(){for(var e,t=0,i=this.series;t<i.length&&!(e=!!i[t].trendlines.length);t++);return e},iwe.prototype.renderSeriesElements=function(e){this.initializeModuleElements();var t,i,n=this.element.id;"g"!==this.element.tagName&&((t=nve(this.redraw,n+"_Secondary_Element")||this.createElement("div")).id=n+"_Secondary_Element",O0e(!(t.style.cssText="position: relative"),this.element,t,this.redraw)),this.enableCanvas&&(t=(t=document.getElementById(n+"_Secondary_Element"))||this.createElement("div",{id:n+"_Secondary_Element",attrs:{style:"position: relative; left:0px; top:0px"}}),(i=this.svgRenderer.createSvg({id:n+"_tooltip_svg",width:this.availableSize.width,height:this.availableSize.height})).style.cssText="position: absolute; pointer-events: none",t.appendChild(i)),this.tooltip.enable&&!this.stockChart&&O0e(this.enableCanvas,this.svgObject,this.renderer.createGroup({id:n+"_UserInteraction",style:"pointer-events:none;"}),this.redraw),0<this.rows.length&&0<this.columns.length&&(this.initializeIndicator(),this.initializeTrendLine(),this.renderSeries(),this.trendLineElements&&O0e(this.enableCanvas,this.svgObject,this.trendLineElements,this.redraw),this.appendElementsAfterSeries(e))},iwe.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]:i).visible?(this.visible++,a0e(i,this.enableCanvas),this.enableCanvas&&this.renderCanvasSeries(),i.renderSeries(this)):i.isLegendClicked&&(-1<i.type.indexOf("StackingArea")||-1<i.type.indexOf("StackingBar")||-1<i.type.indexOf("StackingColumn"))&&(a0e(i,this.enableCanvas),i.renderSeries(this))}this.enableCanvas&&this.renderer.canvasRestore(),this.visible=0;var n={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"};!this.seriesElements||n.height<0||n.width<0||(n="PolarRadar"===this.chartAreaType?y0e(this.redraw,n,this.renderer,"drawCircularClipPath"):y0e(this.redraw,n,this.renderer),this.enableCanvas||this.seriesElements.appendChild(n),(n=document.getElementById(this.element.id+"_series_svg"))?O0e(!1,n,this.seriesElements,this.redraw):O0e(this.enableCanvas,this.svgObject,this.seriesElements,this.redraw))},iwe.prototype.renderCanvasSeries=function(){this.enableCanvas||this.svgObject},iwe.prototype.initializeIndicator=function(){for(var e=0,t=this.indicators;e<t.length;e++){var i=t[e];this[l0e(i.type)+"IndicatorModule"]&&this[l0e(i.type)+"IndicatorModule"].createIndicatorElements(this,i,i.index)}this.indicatorElements&&O0e(this.enableCanvas,this.svgObject,this.indicatorElements,this.redraw)},iwe.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)}},iwe.prototype.appendElementsAfterSeries=function(e){"PolarRadar"===this.chartAreaType&&O0e(this.enableCanvas,this.svgObject,this.yAxisElements,this.redraw),O0e(this.enableCanvas,this.svgObject,e,this.redraw),(this.zoomModule&&this.zoomSettings.enableScrollbar&&this.scrollElement&&this.scrollElement.childElementCount||this.scrollElement&&this.scrollElement.childElementCount)&&O0e(!1,ie(this.element.id+"_Secondary_Element"),this.scrollElement,this.redraw),this.stripLineModule&&this.stripLineModule.renderStripLine(this,"Over",this.axisCollections),this.tooltip.enable&&!this.stockChart||O0e(this.enableCanvas,this.svgObject,this.renderer.createGroup({id:this.element.id+"_UserInteraction",style:"pointer-events:none;"}),this.redraw),this.stockChart&&this.stockChart.calculateStockEvents()},iwe.prototype.applyZoomkit=function(){"PolarRadar"===this.chartAreaType||this.redraw&&!this.zoomRedraw||!this.zoomModule||this.zoomSettings.enablePan&&!this.zoomModule.performedUI&&!this.zoomSettings.showToolbar||this.zoomModule.applyZoomToolkit(this,this.axisCollections)},iwe.prototype.renderAnnotation=function(){this.annotationModule&&this.annotationModule.renderAnnotations(ie((this.stockChart||this).element.id+"_Secondary_Element"))},iwe.prototype.performSelection=function(){var e=[];this.selectionModule&&(e=Pe([],this.selectionModule.selectedDataIndexes,null,!0),this.selectionModule.invokeSelection(this)),this.highlightModule&&this.highlightModule.invokeHighlight(this),0<e.length&&(this.selectionModule.selectedDataIndexes=e,this.selectionModule.redrawSelection(this,this.selectionMode))},iwe.prototype.processData=function(e){void 0===e&&(e=!0);for(var t=!(this.visibleSeriesCount=0),i=0,n=0,o=this.visibleSeries;n<o.length;n++)(l=o[n]).visible||this.legendSettings.visible?"Indicator"!==l.category&&"TrendLine"!==l.category&&this.initializeDataModule(l):this.visibleSeriesCount++;for(var r=0,s=this.indicators;r<s.length;r++){var a=s[r];a.dataSource&&(this.initializeDataModule(a),t=!1)}if(e&&(!this.visibleSeries.length||this.visibleSeriesCount===this.visibleSeries.length&&t)&&(this.refreshBound(),this.trigger("loaded",{chart:this.isBlazor?{}:this})),!this.stockChart&&0<this.visibleSeries.length)for(var l,h=0,d=this.visibleSeries;h<d.length;h++)je((l=d[h]).points)||(this.maxPointCount=Math.max(i,l.points.length),i=l.points.length)},iwe.prototype.initializeDataModule=function(e){e.xData=[],e.yData=[];var t=this.isAngular?(Object.keys(e.dataSource).length?e:this).dataSource:e.dataSource||this.dataSource;e.dataModule=new Cbe(t,e.query),e.points=[],e.refreshDataManager(this)},iwe.prototype.calculateBounds=function(){var e=this.margin,t=0,i=0,n="Top"===this.titleStyle.position||"Bottom"===this.titleStyle.position&&!this.legendSettings.visible?15:5,o=e.left+this.border.width,r=this.availableSize.width-o-e.right-this.border.width,s=0,a=(this.titleCollection=[],this.subTitleCollection=[],this.title?(this.titleCollection=hve(this.title,this.titleStyle,r,this.enableRtl,this.themeStyle.chartTitleFont),t=So(this.title,this.titleStyle,this.themeStyle.chartTitleFont).height*this.titleCollection.length+n,this.subTitle&&(this.subTitleCollection=hve(this.subTitle,this.subTitleStyle,r,this.enableRtl,this.themeStyle.chartSubTitleFont),i=So(this.subTitle,this.subTitleStyle,this.themeStyle.chartSubTitleFont).height*this.subTitleCollection.length+n)):"Top"!==this.legendSettings.position&&this.border.width&&(s=10),e.top+s+this.border.width+.5*this.chartArea.border.width),l=this.availableSize.height-a-this.border.width-e.bottom,h=i+t+this.titleStyle.border.width+this.subTitleStyle.border.width;switch(this.titleStyle.position){case"Top":a+=h,l-=h;break;case"Bottom":l-=h;break;case"Left":o+=h,r-=h;break;case"Right":o-=this.titleStyle.border.width+this.subTitleStyle.border.width,r-=h}if(this.stockChart&&this.stockChart.legendSettings.visible&&this.stockChart.stockLegendModule&&("Top"===this.stockChart.legendSettings.position?a+=this.stockChart.stockLegendModule.legendBounds.height:"Left"===this.stockChart.legendSettings.position&&(o+=this.stockChart.stockLegendModule.legendBounds.width)),this.scrollBarModule&&(this.zoomModule&&this.zoomSettings.enableScrollbar&&this.zoomModule.isZoomed||this.scrollSettingEnabled))for(var d=0,p=this.axisCollections.length;d<p;d++){var c=this.axisCollections[d];"Horizontal"===c.orientation&&"Bottom"===c.scrollbarSettings.position?l-=c.scrollbarSettings.height+10:"Horizontal"===c.orientation&&"Top"===c.scrollbarSettings.position?(l-=c.scrollbarSettings.height+10,a+=c.scrollbarSettings.height+10):"Vertical"===c.orientation&&"Right"===c.scrollbarSettings.position?r-=c.scrollbarSettings.height+10:"Vertical"===c.orientation&&"Left"===c.scrollbarSettings.position&&(r-=c.scrollbarSettings.height+10,o+=c.scrollbarSettings.height+10)}this.initialClipRect=new Do(o,a,r,l),this.legendModule&&this.legendSettings.visible&&this.legendModule.calculateLegendBounds(this.initialClipRect,this.availableSize,null),this.initialClipRect.y+=this.chartArea.margin.top,this.initialClipRect.height-=this.chartArea.margin.top+this.chartArea.margin.bottom,this.initialClipRect.x+=this.chartArea.margin.left,this.initialClipRect.width-=this.chartArea.margin.left+this.chartArea.margin.right,this.chartAxisLayoutPanel.measureAxis(this.initialClipRect)},iwe.prototype.print=function(e){var t=new zbe(this),i=this.width;"chart"===this.getModuleName()&&80<=parseInt(this.width,10)&&-1<this.width.indexOf("%")&&(this.width="80%",this.dataBind()),t.print(e),"chart"===this.getModuleName()&&80<=parseInt(this.width,10)&&-1<this.width.indexOf("%")&&(this.width=i,this.dataBind())},iwe.prototype.initTrendLines=function(){this.isProtectedOnChange=!0;for(var e=0,t=this.visibleSeries;e<t.length;e++)for(var i=t[e],n=0,o=0,r=i.trendlines;o<r.length;o++){var s=r[o];this.trendLineModule&&(s.index=n,s.sourceIndex=i.index,this.trendLineModule.initSeriesCollection(s,this),s.targetSeries)&&(s.targetSeries.xAxisName=i.xAxisName,s.targetSeries.yAxisName=i.yAxisName,this.visibleSeries.push(s.targetSeries)),n++}this.isProtectedOnChange=!1},iwe.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 zve(this)},iwe.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,n=t.length;i<n;i++){(e=t[i]).series=[],e.labels=[],e.indexLabels={};for(var o=0,r=this.visibleSeries;o<r.length;o++){var s=r[o];this.initAxis(s,e,!0),"Pareto"===s.category&&"Line"===s.type&&s.yAxis&&(s.yAxis.internalVisibility=s.paretoOptions.showAxis)}for(var a=0,l=this.indicators;a<l.length;a++){var h=l[a];this.initAxis(h,e,!1)}this.scrollBarModule&&!e.zoomingScrollBar&&this.scrollBarModule.injectTo(e,this),null!=e.orientation&&this.axisCollections.push(e)}0<this.rows.length&&0<this.columns.length&&this.chartAxisLayoutPanel.measure()},iwe.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)},iwe.prototype.initTechnicalIndicators=function(){for(var e=0,t=0,i=this.indicators;t<i.length;t++){var n=i[t],o=n,r=l0e(o.type);if(this[r+"IndicatorModule"]){o.index=e,this[r+"IndicatorModule"].initSeriesCollection(o,this);for(var s=0,a=o.targetSeries;s<a.length;s++){var l=a[s];(n.seriesName||n.dataSource)&&this.visibleSeries.push(l)}}e++}},iwe.prototype.refreshTechnicalIndicator=function(e){if(this.indicators.length)if(e instanceof bbe&&"Indicator"!==e.category)for(var t=0,i=this.indicators;t<i.length;t++){var n=i[t];n.seriesName!==e.name||n.dataSource||n.setDataSource(e,this)}else e instanceof _be&&e.setDataSource(e instanceof bbe?e:null,this)},iwe.prototype.calculateVisibleSeries=function(){this.visibleSeries=[];for(var e,t=this.palettes.length?this.palettes:Vve(this.theme),i=t.length,n=this.series.sort(function(e,t){return e.zOrder-t.zOrder}),o=0,r=n.length;o<r;o++){switch((e=n[o]).category="Pareto"===n[0].type?"Pareto":"Series",e.index=o,e.interior=e.fill||t[o%i],e.marker.shape||!e.marker.visible&&"Scatter"!==e.type&&"Scatter"!==e.drawType||(e.marker.shape=Dbe[this.markerIndex%10],this.markerIndex++),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})),e.type){case"Bar":case"StackingBar":case"StackingBar100":if(-1===n[0].type.indexOf("Bar"))continue;break;case"Polar":case"Radar":if("PolarRadar"!==this.chartAreaType)continue;if("PolarRadar"===this.chartAreaType&&(null!==e.xAxisName&&this.primaryXAxis.name!==e.xAxisName||null!==e.yAxisName&&this.primaryYAxis.name!==e.yAxisName))continue;break;case"Pareto":this.visibleSeries.push(e),this.paretoSeriesModule.initSeries(e,this);continue;default:if("PolarRadar"===this.chartAreaType||-1<n[0].type.indexOf("Bar"))continue}this.visibleSeries.push(e),n[o]=e}},iwe.prototype.isSecondaryAxis=function(e){return-1<this.axes.indexOf(e)},iwe.prototype.renderTitle=function(){var e=this.margin;if(this.title){var t=Nve(this.titleStyle.textAlignment,this.enableRtl),i=So(this.title,this.titleStyle,this.themeStyle.chartTitleFont),n=new Do(e.left,0,this.availableSize.width-e.left-e.right,0),o=this.titleStyle.border.width,r=this.margin.top+3*i.height/4,s=dve(n,this.titleStyle||this.themeStyle.chartTitleFont)+o,a=void 0,l=this.titleStyle.textAlignment,h=So(this.subTitle,this.subTitleStyle,this.themeStyle.chartSubTitleFont);switch(this.titleStyle.position){case"Top":r+=.5*o,s+="start"===t?.5*o+this.border.width:"end"===t?2*-o-this.border.width:0;break;case"Bottom":s+="start"===t?.5*o+this.border.width:"end"===t?2*-o-this.border.width:0,r=this.availableSize.height-this.margin.bottom-h.height-i.height/2-.5*o-.5*this.subTitleStyle.border.width;break;case"Left":s=this.margin.left+3*i.height/4+.5*o,r="Near"===l?e.bottom+.5*o+this.border.width:"Far"===l?this.availableSize.height-e.bottom-.5*o-this.border.width:this.availableSize.height/2,t="Near"===l?"end":"Far"===l?"start":"middle",t=this.enableRtl?"end"===t?"start":"start"===t?"end":t:t,a="rotate(-90,"+s+","+r+")";break;case"Right":s=this.availableSize.width-this.margin.right-3*i.height/4-.5*o,r="Near"===l?e.bottom+.5*o+this.border.width:"Far"===l?this.availableSize.height-e.bottom-.5*o-this.border.width:this.availableSize.height/2,t="Near"===l?"start":"Far"===l?"end":"middle",t=this.enableRtl?"end"===t?"start":"start"===t?"end":t:t,a="rotate(90,"+s+","+r+")";break;case"Custom":s=this.titleStyle.x,r=this.titleStyle.y,t="middle"}var n={id:this.element.id+"_ChartTitleBorder",x:s-("middle"===t?i.width/2+5:"end"===t?i.width+5:5),y:r-i.height+i.height/4,rx:this.titleStyle.border.cornerRadius,ry:this.titleStyle.border.cornerRadius,width:i.width+10,height:i.height*this.titleCollection.length,fill:this.titleStyle.background,"stroke-width":o,stroke:this.titleStyle.border.color,transform:a||"",d:""},n=nve(this.redraw,this.element.id+"_ChartTitleBorder",n,this.renderer)||this.renderer.drawRectangle(n),n=(O0e(this.enableCanvas,this.svgObject,n,this.redraw),new ko(this.element.id+"_ChartTitle",s,r,t,this.titleCollection,a,"auto")),d=nve(this.redraw,this.element.id+"_ChartTitle",n,this.renderer)||sve(this.renderer,n,this.titleStyle,this.titleStyle.color||this.themeStyle.chartTitleFont.color,this.svgObject,null,null,null,null,null,null,0,null,this.enableCanvas,null,this.themeStyle.chartTitleFont);d&&!this.enableCanvas&&(d.setAttribute("tabindex",this.titleStyle.accessibility.focusable?String(this.titleStyle.accessibility.tabIndex):"-1"),d.style.outline="none",d.setAttribute("class","e-chart-focused"),d.setAttribute("role",this.titleStyle.accessibility.accessibilityRole),d.setAttribute("aria-label",this.titleStyle.accessibility.accessibilityDescription)),this.subTitle&&this.renderSubTitle(n)}},iwe.prototype.renderSubTitle=function(e){for(var t=0,i=0,n=0,o=this.titleStyle.textAlignment,r=0,s=this.titleCollection;r<s.length;r++)t=t<(n=So(s[r],this.titleStyle,this.themeStyle.chartTitleFont).width)?n:t;for(var a=0,l=this.subTitleCollection;a<l.length;a++)var h,i=i<(h=So(l[a],this.subTitleStyle,this.themeStyle.chartSubTitleFont).width)?h:i;t=Math.max(n,i);var d=So(this.subTitleCollection.reduce(function(e,t){return e.length>t.length?e:t}),this.subTitleStyle,this.themeStyle.chartSubTitleFont),p=Nve(this.subTitleStyle.textAlignment,this.enableRtl),c=new Do("Center"===o?e.x-.5*t:"Far"===o?e.x-t:e.x,0,t,0),o=("Left"===this.titleStyle.position&&(c.x="Center"===o?e.x-.5*t:"Far"===o?this.margin.left+3*d.height/4:e.x-t),So(this.title,this.titleStyle,this.themeStyle.chartTitleFont)),u=e.y*e.text.length+d.height+5+this.titleStyle.border.width+.5*this.subTitleStyle.border.width,o=("Bottom"===this.titleStyle.position&&(u=e.y*e.text.length+5+o.height/2+d.height/2),{id:this.element.id+"_ChartSubTitleBorder",x:dve(c,this.subTitleStyle)-("middle"===p?d.width/2+5:"end"===p?d.width+5:5),y:u-d.height+d.height/4,rx:this.subTitleStyle.border.cornerRadius,ry:this.subTitleStyle.border.cornerRadius,width:d.width+10,height:d.height*this.subTitleCollection.length,fill:this.subTitleStyle.background,"stroke-width":this.subTitleStyle.border.width,stroke:this.subTitleStyle.border.color,transform:e.transform,d:""}),p=nve(this.redraw,this.element.id+"_ChartSubTitleBorder",o,this.renderer)||this.renderer.drawRectangle(o),d=(O0e(this.enableCanvas,this.svgObject,p,this.redraw),new ko(this.element.id+"_ChartSubTitle",dve(c,this.subTitleStyle),u,Nve(this.subTitleStyle.textAlignment,this.enableRtl),this.subTitleCollection,e.transform,"auto")),o=nve(this.redraw,this.element.id+"_ChartSubTitle",d,this.renderer)||sve(this.renderer,d,this.subTitleStyle,this.subTitleStyle.color||this.themeStyle.chartSubTitleFont.color,this.svgObject,null,null,null,null,null,null,0,null,this.enableCanvas,null,this.themeStyle.chartSubTitleFont);o&&!this.enableCanvas&&(o.setAttribute("tabindex",this.subTitleStyle.accessibility.focusable?String(this.subTitleStyle.accessibility.tabIndex):"-1"),this.subTitleStyle.accessibility.focusable&&(o.style.outline="none"),o.setAttribute("class","e-chart-focused"),o.setAttribute("role",this.subTitleStyle.accessibility.accessibilityRole),o.setAttribute("aria-label",this.subTitleStyle.accessibility.accessibilityDescription))},iwe.prototype.renderBorder=function(){var e=0,t=0,i=this.border.width,n=this.backgroundImage,o=n?"transparent":this.background||this.themeStyle.background,o=(this.stockChart&&this.stockChart.legendSettings.visible&&this.stockChart.stockLegendModule&&("Top"===this.stockChart.legendSettings.position?t+=this.stockChart.stockLegendModule.legendBounds.height:"Left"===this.stockChart.legendSettings.position&&(e+=this.stockChart.stockLegendModule.legendBounds.width)),new vve(this.element.id+"_ChartBorder",o,this.border,1,new Do(.5*i+e,.5*i+t,this.availableSize.width-i,this.availableSize.height-i),0,0,"",this.border.dashArray));this.htmlObject=nve(this.redraw,this.element.id+"_ChartBorder",o,this.renderer)||this.renderer.drawRectangle(o),this.htmlObject.setAttribute("aria-hidden","true"),O0e(this.enableCanvas,this.svgObject,this.htmlObject,this.redraw),n&&(e=new Cve(this.availableSize.height-i,this.availableSize.width-i,n,0,0,this.element.id+"_ChartBackground","visible","none"),this.htmlObject=nve(this.redraw,this.element.id+"_ChartBackground",e,this.renderer)||this.renderer.drawImage(e),O0e(this.enableCanvas,this.svgObject,this.htmlObject,this.redraw))},iwe.prototype.renderAreaBorder=function(){if("PolarRadar"===this.chartAreaType)return null;var e=ie(this.element.id+"_ChartAreaBorder"),e=e?new Do(+e.getAttribute("x"),+e.getAttribute("y"),+e.getAttribute("width"),+e.getAttribute("height")):null,t=new vve(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,0,0,"",this.chartArea.border.dashArray);if(t.height<0||t.width<0)return null;this.htmlObject=this.renderer.drawRectangle(t),this.htmlObject.setAttribute("aria-hidden","true"),O0e(this.enableCanvas,this.svgObject,this.htmlObject,this.redraw,!0,"x","y",null,null,!0,!0,e),this.htmlObject=null;t=this.chartArea.backgroundImage;t&&(e=this.chartArea.border.width,e=new Cve(this.initialClipRect.height-e,this.initialClipRect.width-e,t,this.initialClipRect.x,this.initialClipRect.y,this.element.id+"_ChartAreaBackground","visible","none"),this.htmlObject=this.renderer.drawImage(e),O0e(this.enableCanvas,this.svgObject,this.htmlObject,this.redraw,!0,"x","y",null,null,!0,!0))},iwe.prototype.addSeries=function(e){for(var t=window.scrollY||document.documentElement.scrollTop,i=0,n=e;i<n.length;i++){var o=n[i],o=new bbe(this,"series",o);this.series.push(o)}this.refresh(),window.scrollTo(0,t)},iwe.prototype.removeSeries=function(e){this.redraw=!1;var t=window.scrollY||document.documentElement.scrollTop,i=this.visibleSeries[e];i&&(i.xAxis.series.length<=1&&(i.xAxis.orientation=null),i.yAxis.series.length<=1)&&(i.yAxis.orientation=null);for(var n=0;n<this.axes.length;n++)null===this.axes[n].orientation&&this.axes.splice(n,1);this.series.splice(e,1),this.refresh(),window.scrollTo(0,t)},iwe.prototype.clearSeries=function(){this.series=[];var e=window.scrollY||document.documentElement.scrollTop;this.refresh(),window.scrollTo(0,e)},iwe.prototype.addAxes=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t],n=new Sye(this,"axes",n);this.isBlazor&&(n.interval=isNaN(n.interval)?null:n.interval,n.desiredIntervals=isNaN(n.desiredIntervals)?null:n.desiredIntervals),this.axes.push(n)}this.refresh()},iwe.prototype.removeAxis=function(e){this.redraw=!1,this.axes.splice(e,1),this.refresh()},iwe.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;var e=document.getElementById(this.element.id+"Keyboard_chart_focus"),e=(e&&e.remove(),document.getElementById(this.element.id+"_ej2_chart_highlight")),e=(e&&e.remove(),document.getElementById(this.element.id+"_ej2_chart_selection"));e&&e.remove(),Pye("chartmeasuretext"),this.element&&(this.unWireEvents(),this.isReact&&this.clearTemplate(),ewe.prototype.destroy.call(this),this.enableCanvas||(this.removeSvg(),this.svgObject=null))},iwe.prototype.getModuleName=function(){return"chart"},iwe.prototype.getPersistData=function(){return this.addOnPersist(["loaded","animationComplete","primaryXAxis","primaryYAxis"])},iwe.prototype.createChartSvg=function(){this.removeSvg(),lve(this)},iwe.prototype.unWireEvents=function(){var e=F.touchStartEvent,t=F.touchMoveEvent,i=F.touchEndEvent,n=F.isPointer?"pointerleave":"mouseleave";E.remove(this.element,e,this.chartOnMouseDown),E.remove(this.element,t,this.mouseMove),E.remove(this.element,i,this.mouseEnd),E.remove(this.element,"click",this.chartOnMouseClick),E.remove(this.element,"dblclick",this.chartOnDoubleClick),E.remove(this.element,"contextmenu",this.chartRightClick),E.remove(this.element,n,this.mouseLeave),E.remove(this.element,"keydown",this.chartKeyDown),E.remove(document.body,"keydown",this.documentKeyHandler),E.remove(this.element,"keyup",this.chartKeyUp),window.removeEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBound),this.touchObject&&(this.touchObject.destroy(),this.touchObject=null)},iwe.prototype.wireEvents=function(){var e;this.element&&(e=F.isPointer?"pointerleave":"mouseleave",E.add(this.element,F.touchStartEvent,this.chartOnMouseDown,this),E.add(this.element,F.touchMoveEvent,this.mouseMove,this),E.add(this.element,F.touchEndEvent,this.mouseEnd,this),E.add(this.element,"click",this.chartOnMouseClick,this),E.add(this.element,"dblclick",this.chartOnDoubleClick,this),E.add(this.element,"contextmenu",this.chartRightClick,this),E.add(this.element,e,this.mouseLeave,this),E.add(this.element,"keydown",this.chartKeyDown,this),E.add(document.body,"keydown",this.documentKeyHandler,this),E.add(this.element,"keyup",this.chartKeyUp,this),this.resizeBound=this.chartResize.bind(this),window.addEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBound),this.longPressBound=this.longPress.bind(this),this.touchObject=new Mn(this.element,{tapHold:this.longPressBound,tapHoldThreshold:500}),this.setStyle(this.element))},iwe.prototype.chartRightClick=function(e){return!this.crosshair.enable||!this.crosshairModule||2!==e.buttons&&0!==e.which&&"touch"!==e.pointerType||(e.preventDefault(),e.stopPropagation(),!1)},iwe.prototype.setStyle=function(e){var t=this.zoomSettings,t=t.enableSelectionZooming||t.enablePinchZooming||"None"!==this.selectionMode||"None"!==this.highlightMode;e.style.touchAction=t?"none":"element",e.style.msTouchAction=t?"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",e.style.height=e.style.height||this.height&&-1===this.height.indexOf("%")?e.style.height:"inherit"},iwe.prototype.isOrientation=function(){return"orientation"in window&&"onorientationchange"in window},iwe.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.allowPan=!this.stockChart&&this.allowPan,this.setMouseXY(this.mouseX,this.mouseY),this.notify("tapHold",e),!1},iwe.prototype.setMouseXY=function(e,t){var i,n;ie(this.svgId)&&(i=ie(this.svgId).getBoundingClientRect(),n=this.element.getBoundingClientRect(),this.scaleX=i.width/this.availableSize.width,this.scaleY=i.height/this.availableSize.height,this.mouseY=(t-n.top-Math.max(i.top-n.top,0))/this.scaleY,this.mouseX=(e-n.left-Math.max(i.left-n.left,0))/this.scaleX,this.stockChart)&&(this.mouseX+="Left"===this.stockChart.legendSettings.position?this.stockChart.stockLegendModule.legendBounds.width:0,this.mouseY+="Top"===this.stockChart.legendSettings.position?this.stockChart.stockLegendModule.legendBounds.height:0)},iwe.prototype.export=function(e,t){this.exportModule&&(this.exportModule.export(e,t),this.afterExport)&&this.exportModule.getDataUrl(this)},iwe.prototype.chartResize=function(){var e=this,t=(this.animateSeries=!1,{chart:this,name:lfe,currentSize:new Eo(0,0),previousSize:new Eo(this.availableSize.width,this.availableSize.height)}),i={name:"beforeResize",cancelResizedEvent:!1};return this.resizeTo&&clearTimeout(this.resizeTo),this.trigger(hfe,i),i.cancelResizedEvent||(this.resizeTo=+setTimeout(function(){e.isDestroyed||e.stockChart?clearTimeout(e.resizeTo):(e.createChartSvg(),t.currentSize=e.availableSize,e.trigger(lfe,t),e.refreshAxis(),e.refreshBound(),e.trigger("loaded",{chart:e.isBlazor?{}:e}))},500)),!1},iwe.prototype.mouseMove=function(e){var t,i;return this.allowPan||(i=("touchmove"===e.type?(this.isTouch=!0,t=e.changedTouches[0].clientX,e.changedTouches[0]):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType||this.isTouch,t=e.clientX,e)).clientY,this.previousPageX=t,this.previousPageY=i,ie(this.svgId)&&(this.setMouseXY(t,i),this.chartOnMouseMove(e))),!1},iwe.prototype.mouseLeave=function(e){var t,i;return this.stockChart&&this.stockChart.onPanning||(i=("touchleave"===e.type?(this.isTouch=!0,t=e.changedTouches[0].clientX,e.changedTouches[0]):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType,t=e.clientX,e)).clientY,this.previousPageX=null,this.previousPageY=null,this.setMouseXY(t,i),this.chartOnMouseLeave(e)),!1},iwe.prototype.chartOnMouseLeave=function(e){var t=e.target,i=F.isPointer?"pointerleave":"mouseleave";return this.trigger(ife,{target:t.id,x:this.mouseX,y:this.mouseY}),Pye(this.element.id+"_EJ2_AxisLabel_Tooltip"),this.isChartDrag=this.isPointMouseDown=!1,this.notify(i,e),!1},iwe.prototype.chartOnDoubleClick=function(e){e=e.target;return this.trigger(Zme,{target:e.id,x:this.mouseX,y:this.mouseY}),!1},iwe.prototype.chartKeyDown=function(e){var t="";return(this.isZoomed&&"Tab"===e.code||"Space"===e.code)&&e.preventDefault(),this.tooltip.enable&&("Tab"===e.code&&-1<this.previousTargetId.indexOf("Series")||"Escape"===e.code)&&(t="ESC"),"None"!==this.highlightMode&&"Tab"===e.code&&-1<this.previousTargetId.indexOf("_chart_legend_")&&this.highlightModule&&this.highlightModule.removeLegendHighlightStyles(),!e.ctrlKey||"+"!==e.key&&"Equal"!==e.code&&"-"!==e.key&&"Minus"!==e.code?82===e.keyCode&&this.isZoomed?(e.preventDefault(),this.isZoomed=!1,t="R"):-1<e.code.indexOf("Arrow")&&(e.preventDefault(),t=this.isZoomed?e.code:""):(e.preventDefault(),this.isZoomed=this.zoomModule&&(this.zoomSettings.enableDeferredZooming||this.zoomSettings.enableSelectionZooming||this.zoomSettings.enablePinchZooming||this.zoomSettings.enableMouseWheelZooming),t=this.isZoomed?e.code:""),e.ctrlKey&&"p"===e.key&&(e.preventDefault(),t="CtrlP"),""!==t&&this.chartKeyboardNavigations(e,e.target.id,t),"Tab"===e.code&&this.removeNavigationStyle(),!1},iwe.prototype.chartKeyUp=function(e){var t,i,n,o,r="",s=e.target.id,a=e.target,l=ie(this.element.id+"_ChartTitle"),h=ie(this.element.id+"SeriesCollection"),d=ie(this.element.id+"_chart_legend_translate_g"),p=ie(this.element.id+"_chart_legend_pageup");if(l&&l.setAttribute("class","e-chart-focused"),h&&h.firstElementChild&&h.firstElementChild.children[1]&&((n=(i=h.firstElementChild.children[1]).getAttribute("class"))&&-1===n.indexOf("e-chart-focused")?n+=" e-chart-focused":n=n||"e-chart-focused",i.setAttribute("class",n)),d&&((n=(i=d.firstElementChild).getAttribute("class"))&&-1===n.indexOf("e-chart-focused")?n+=" e-chart-focused":n=n||"e-chart-focused",i.setAttribute("class",n)),p&&p.setAttribute("class","e-chart-focused"),"Tab"===e.code)""!==this.previousTargetId&&(-1<this.previousTargetId.indexOf("_Series_")&&-1===s.indexOf("_Series_")?(o=ie(this.element.id+"SeriesCollection"),(-1<this.previousTargetId.indexOf("_Symbol")?ie(this.element.id+"SymbolGroup"+this.currentSeriesIndex):o.children[this.currentSeriesIndex])&&(-1<this.previousTargetId.indexOf("_Symbol")?ie(this.element.id+"SymbolGroup"+this.currentSeriesIndex).children[this.currentPointIndex+1]:-1<this.previousTargetId.indexOf("_Point_")?o.children[this.currentSeriesIndex].children[this.currentPointIndex+1]:o.children[this.currentSeriesIndex]),this.currentPointIndex=0,this.currentSeriesIndex=0):-1<this.previousTargetId.indexOf("_chart_legend_page")&&-1===s.indexOf("_chart_legend_page")&&-1===s.indexOf("_chart_legend_g_")?this.setTabIndex(e.target,ie(this.element.id+"_chart_legend_pageup")):-1<this.previousTargetId.indexOf("_chart_legend_g_")&&-1===s.indexOf("_chart_legend_g_")&&(o=ie(this.element.id+"_chart_legend_translate_g"),this.setTabIndex(o.children[this.currentLegendIndex],o.firstElementChild))),-1<(this.previousTargetId=s).indexOf("SeriesGroup")?(this.currentSeriesIndex=+s.split("SeriesGroup")[1],a.removeAttribute("tabindex"),a.blur(),-1===a.children[1].id.indexOf("_Point_")&&(t=ie(this.element.id+"SymbolGroup"+s.split("SeriesGroup")[1])),s=this.focusChild((null!=t?t:a).children[1])):-1<s.indexOf("_ChartTitle")&&this.setNavigationStyle(s),r=s!==this.element.id?"Tab":"";else if(-1<e.code.indexOf("Arrow")){if(e.preventDefault(),-1<(this.previousTargetId=s).indexOf("_chart_legend_page"))"ArrowLeft"===e.code?(ie(this.element.id+"_chart_legend_pagedown").removeAttribute("tabindex"),this.focusChild(ie(this.element.id+"_chart_legend_pageup"))):"ArrowRight"===e.code&&(ie(this.element.id+"_chart_legend_pageup").removeAttribute("tabindex"),this.focusChild(ie(this.element.id+"_chart_legend_pagedown")));else if(-1<s.indexOf("_chart_legend_")){l=a.parentElement.children,h=(l[this.currentLegendIndex].removeAttribute("tabindex"),this.currentLegendIndex+="ArrowUp"===e.code||"ArrowRight"===e.code?1:-1,this.currentLegendIndex=this.getActualIndex(this.currentLegendIndex,l.length),l[this.currentLegendIndex]);this.focusChild(h),this.removeNavigationStyle(),this.setNavigationStyle(h.id),s=h.children[1].id,r="None"!==this.highlightMode?"ArrowMove":""}else if(-1<s.indexOf("_Series_")){o=a.parentElement.parentElement;d=e.target;if(a.removeAttribute("tabindex"),a.blur(),"ArrowRight"===e.code||"ArrowLeft"===e.code){for(var c=[],u=0;u<o.children.length;u++)-1<o.children[u].id.indexOf("SeriesGroup")&&c.push(+o.children[u].id.split("SeriesGroup")[1]);this.currentSeriesIndex=c.indexOf(this.currentSeriesIndex)+("ArrowRight"===e.code?1:-1),this.currentSeriesIndex=c[this.getActualIndex(this.currentSeriesIndex,c.length)]}else this.currentPointIndex+="ArrowUp"===e.code?1:-1;-1<s.indexOf("_Symbol")?(this.currentPointIndex=this.getActualIndex(this.currentPointIndex,ie(this.element.id+"SymbolGroup"+this.currentSeriesIndex).childElementCount-1),d=ie(this.element.id+"_Series_"+this.currentSeriesIndex+"_Point_"+this.currentPointIndex+"_Symbol")):-1<s.indexOf("_Point_")&&(this.currentPointIndex=this.getActualIndex(this.currentPointIndex,ie(this.element.id+"SeriesGroup"+this.currentSeriesIndex).childElementCount-1),d=ie(this.element.id+"_Series_"+this.currentSeriesIndex+"_Point_"+this.currentPointIndex)),s=this.focusChild(d),r="ArrowMove"}}else"Enter"!==e.code&&"Space"!==e.code||!(-1<s.indexOf("_chart_legend_")||-1<s.indexOf("_Point_"))||(s=!(-1<s.indexOf("_chart_legend_page"))&&-1<s.indexOf("_chart_legend_")?a.children[1].id:s,r="Enter");return""!==r&&this.chartKeyboardNavigations(e,s,r),!1},iwe.prototype.setTabIndex=function(e,t){e&&e.removeAttribute("tabindex"),t&&t.setAttribute("tabindex","0")},iwe.prototype.getActualIndex=function(e,t){return t-1<e?0:e<0?t-1:e},iwe.prototype.focusChild=function(e){e.setAttribute("tabindex","0");var t=e.getAttribute("class");return e.setAttribute("tabindex","0"),t=t&&-1===t.indexOf("e-chart-focused")?"e-chart-focused "+t:t||"e-chart-focused",e.setAttribute("class",t),e.focus(),e.id},iwe.prototype.documentKeyHandler=function(e){e.altKey&&74===e.keyCode&&!je(this.element)&&(this.element.focus(),this.setNavigationStyle(this.element.id))},iwe.prototype.setNavigationStyle=function(e){e=document.getElementById(e);e&&(e.style.setProperty("outline",this.focusBorderWidth+"px solid "+(this.focusBorderColor||this.themeStyle.tabColor)),e.style.setProperty("margin",this.focusBorderMargin+"px"))},iwe.prototype.removeNavigationStyle=function(){var e=document.querySelectorAll("[id*=_Point_], [id*="+this.element.id+"], [id*=_ChartBorder], text[id*=_ChartTitle],g[id*=_chart_legend],  text[id*=_ChartSubTitle], div[id*=_Annotation], g[id*=IndicatorGroup], g[id*=_Zooming_Zoom], g[id*=_Zooming_ZoomIn], g[id*=_Zooming_ZoomOut], g[id*=_Zooming_Pan], g[id*=_Zooming_Reset], path[id*=_TrendLine_]");e&&e.forEach(function(e){(e instanceof HTMLElement||e instanceof SVGElement)&&(e.style.setProperty("outline","none"),e.style.setProperty("margin",""))})},iwe.prototype.chartKeyboardNavigations=function(e,t,i){switch(this.isLegendClicked=!1,this.removeNavigationStyle(),"Enter"!==i&&"Space"!==i&&this.setNavigationStyle(t),i){case"Tab":case"ArrowMove":if(this.highlightModule&&this.highlightModule.removeLegendHighlightStyles(),-1<t.indexOf("_Point_")&&(a=+t.split("_Series_")[1].split("_Point_")[0],n=+t.split("_Series_")[1].replace("_Symbol","").split("_Point_")[1],n=this.visibleSeries[a].points[n].symbolLocations[0],this.mouseX=n.x+this.initialClipRect.x-(-1<this.visibleSeries[a].type.indexOf("StackingBar")?this.visibleSeries[a].marker.height/2:0),this.mouseY=n.y+this.initialClipRect.y+(-1<this.visibleSeries[a].type.indexOf("StackingColumn")?this.visibleSeries[a].marker.height/2:0),this.highlightModule&&(this.highlightModule.highlightChart(document.getElementById(t),"mousemove"),this.highlightModule.completeSelection(document.getElementById(t),"mousemove")),this.tooltipModule)&&this.tooltipModule.tooltip(),this.highlightModule&&"None"!==this.highlightMode){t=-1<t.indexOf("_chart_legend_g_")?document.getElementById(t).firstChild.id:t;for(var n=this.element.id+"_chart_legend",o=[n+"_text_",n+"_shape_marker_",n+"_shape_"],r=0;r<o.length;r++){var s=o[r];if(-1<t.indexOf(s)){document.getElementById(t).setAttribute("class",""),this.highlightModule.legendSelection(this,parseInt(t.split(s)[1],10),document.getElementById(t),"mousemove");break}}}break;case"Enter":case"Space":-1<t.indexOf("_chart_legend_")?(this.isLegendClicked=!0,this.legendModule.click(e),this.focusChild(document.getElementById(t).parentElement),this.setNavigationStyle(document.getElementById(t).parentElement.id)):(this.selectionModule&&this.selectionModule.calculateSelectedElements(document.getElementById(t),"click"),this.setNavigationStyle(t));break;case"CtrlP":this.print();break;case"ESC":this.tooltipModule.removeTooltip(1);break;case"Equal":case"Minus":this.zoomModule.isZoomed=this.zoomModule.performedUI=!0,this.zoomModule.isPanning=this.isChartDrag=!1,"Equal"===i?this.zoomModule.toolkit.zoomInOutCalculation(1,this,this.axisCollections,this.zoomSettings.mode):this.zoomModule.toolkit.zoomInOutCalculation(-1,this,this.axisCollections,this.zoomSettings.mode),this.zoomModule.performZoomRedraw(this),this.element.focus();break;case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":var a="ArrowUp"===i?10:"ArrowDown"===i?-10:0,n="ArrowLeft"===i?-10:"ArrowRight"===i?10:0;this.zoomModule.isPanning=this.isChartDrag=!0,this.zoomModule.doPan(this,this.axisCollections,n,a),this.zoomModule.performZoomRedraw(this),this.element.focus();break;case"R":this.zoomModule.toolkit.reset(e)}},iwe.prototype.chartOnMouseClick=function(e){var t=this,i=e.target,n=this,o=(this.clickCount++,this.FindXYPointValue(n.mouseX,n.mouseY)),r=400;1===this.clickCount?this.singleClickTimer=+setTimeout(function(){n.clickCount=0,n.trigger(Jme,{target:i.id,x:n.mouseX,y:n.mouseY,axisData:o})},r):2!==this.clickCount||this.pointDoubleClick||(clearTimeout(this.singleClickTimer),this.clickCount=0);return r=this.isAngular?0<this.pointDoubleClick.observers.length?400:0:this.pointDoubleClick?400:0,1===this.clickCount&&this.pointClick?this.singleClickTimer=+setTimeout(function(){t.clickCount=0,t.triggerPointEvent($me,e)},r):2===this.clickCount&&this.pointDoubleClick&&(clearTimeout(this.singleClickTimer),this.clickCount=0,this.triggerPointEvent(efe,e)),this.axisLabelClick&&this.triggerAxisLabelClickEvent(qme,e),this.removeNavigationStyle(),this.notify("click",e),!1},iwe.prototype.FindXYPointValue=function(e,t){if(o0e(e,t,this.chartAxisLayoutPanel.seriesClipRect)&&this.series.some(function(e){return e.visible})){for(var i,n,o={},r=0,s=this.axisCollections.length;r<s;r++)"Horizontal"===(i=this.axisCollections[r]).orientation?(n=r0e(Math.abs(e-i.rect.x),i.rect.width,i),o[this.axisCollections[r].name]=n):(n=s0e(Math.abs(t-i.rect.y),i.rect.height,i),o[this.axisCollections[r].name]=n);return o}return null},iwe.prototype.triggerPointEvent=function(e,t){var i=new Wve(this).getData();i.series&&i.point&&this.trigger(e,{series:this.isBlazor?{}:i.series,point:i.point,seriesIndex:i.series.index,pointIndex:i.point.index,x:this.mouseX,y:this.mouseY,pageX:t.pageX,pageY:t.pageY})},iwe.prototype.triggerAxisLabelClickEvent=function(e,t){var i,n,o,r=t.target;-1!==r.id.indexOf("_AxisLabel_")&&(i=+(n=r.id.split("_AxisLabel_"))[0].slice(-1),n=+n[1],!(o=this.axisCollections[i]).visible||0!=i&&1!=i||this.trigger(e,{chart:this,axis:o,text:o.visibleLabels[n].text,labelID:r.id,index:n,location:new Tve(t.pageX,t.pageY),value:o.visibleLabels[n].value}))},iwe.prototype.chartOnMouseMove=function(e){var t=e.target,i=this.FindXYPointValue(this.mouseX,this.mouseY);return this.trigger(Kme,{target:t.id,x:this.mouseX,y:this.mouseY,axisData:i}),this.pointMove&&this.triggerPointEvent(tfe,e),this.isTouch||(this.titleTooltip(e,this.mouseX,this.mouseY),this.axisTooltip(e,this.mouseX,this.mouseY)),this.dataEditingModule&&this.dataEditingModule.pointMouseMove(e),this.crosshair.enable&&this.startMove&&e.preventDefault(),this.notify(F.touchMoveEvent,e),this.isTouch=!1},iwe.prototype.titleTooltip=function(e,t,i,n){var o=e.target.id,r=o===this.element.id+"_ChartTitle"||o===this.element.id+"_ChartSubTitle"||-1<o.indexOf("_AxisTitle")||-1<o.indexOf("_legend_title"),s=0;-1<o.indexOf("_AxisTitle")&&(s=parseInt(o.replace(this.element.id,"").replace("AxisLabel_","").split("_")[2],10)),r&&-1<e.target.textContent.indexOf("...")?Fye(o===this.element.id+"_ChartTitle"?this.title:-1<o.indexOf("_AxisTitle")?this.axisCollections[s].title:-1<o.indexOf("_ChartSubTitle")?this.subTitle:this.legendSettings.title,t,i,this.element.offsetWidth,this.element.id+"_EJ2_Title_Tooltip",ie(this.element.id+"_Secondary_Element"),n):Pye(this.element.id+"_EJ2_Title_Tooltip")},iwe.prototype.axisTooltip=function(e,t,i,n){var o=e.target.id;(-1<o.indexOf("AxisLabel")||-1<o.indexOf("Axis_MultiLevelLabel"))&&-1<e.target.textContent.indexOf("...")?(e=this.legendSettings.visible||""===this.primaryXAxis.title,Fye(this.findAxisLabel(o),t,i,this.element.offsetWidth,this.element.id+"_EJ2_AxisLabel_Tooltip",ie(this.element.id+"_Secondary_Element"),n,e)):Pye(this.element.id+"_EJ2_AxisLabel_Tooltip")},iwe.prototype.findAxisLabel=function(e){var t;return-1<e.indexOf("AxisLabel")?(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)},iwe.prototype.chartOnMouseDown=function(e){var t,i=this.FindXYPointValue(this.mouseX,this.mouseY),n=F.isDevice?20:30,o=this.element.getBoundingClientRect(),r=e.target,s=(this.stockChart&&this.stockChart.zoomSettings.enablePan&&(this.allowPan=!0),this.trigger(nfe,{target:r.id,x:this.mouseX,y:this.mouseY,axisData:i}),i=(r=("touchstart"===e.type?(this.isTouch=!0,t=e.changedTouches[0].clientX,e.changedTouches[0]):(this.isTouch="touch"===e.pointerType,t=e.clientX,e)).clientY,e.target),ie(this.svgId).getBoundingClientRect());return this.mouseDownX=this.previousMouseMoveX=t-o.left-Math.max(s.left-o.left,0),this.mouseDownY=this.previousMouseMoveY=r-o.top-Math.max(s.top-o.top,0),this.isTouch&&(this.isDoubleTap=(new Date).getTime()<this.threshold&&-1===i.id.indexOf(this.element.id+"_Zooming_")&&(this.mouseDownX-n>=this.mouseX||this.mouseDownX+n>=this.mouseX)&&(this.mouseDownY-n>=this.mouseY||this.mouseDownY+n>=this.mouseY)&&(this.mouseX-n>=this.mouseDownX||this.mouseX+n>=this.mouseDownX)&&(this.mouseY-n>=this.mouseDownY||this.mouseY+n>=this.mouseDownY)),this.dataEditingModule&&this.dataEditingModule.pointMouseDown(),this.notify(F.touchStartEvent,e),!1},iwe.prototype.mouseEnd=function(e){var t,i;return"touchend"===e.type?(t=(i=e).changedTouches[0].clientX,this.isTouch=!0,i=i.changedTouches[0].clientY):(i=e.clientY,t=e.clientX,this.isTouch="touch"===e.pointerType||"2"===e.pointerType),this.setMouseXY(t,i),this.chartOnMouseUp(e),!1},iwe.prototype.chartOnMouseUp=function(e){var t=e.target,i=this.FindXYPointValue(this.mouseX,this.mouseY);return this.trigger(ofe,{target:t.id,x:this.mouseX,y:this.mouseY,axisData:i}),this.isChartDrag=!1,this.allowPan=!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(F.touchEndEvent,e),!1},iwe.prototype.setCulture=function(){this.intl=new Ti,this.setLocaleConstants(),this.localeObject=new Cn(this.getModuleName(),this.defaultLocalConstants,this.locale)},iwe.prototype.setAnnotationValue=function(e,t){var i=ie(this.element.id+"_Annotation_Collections"),n=this.annotations[e];null!==t&&(n.content=t,i?(Pye(this.element.id+"_Annotation_"+e),t=this.createElement("div"),this.annotationModule.processAnnotation(n,e,t),i.appendChild(t.children[0])):this.annotationModule.renderAnnotations(ie(this.element.id+"_Secondary_Element")))},iwe.prototype.setLocaleConstants=function(){this.defaultLocalConstants={ZoomIn:"Zoom in",Zoom:"Zoom",ZoomOut:"Zoom out",Pan:"Pan",Reset:"Reset",ResetZoom:"Reset Zoom"}},iwe.prototype.setTheme=function(){this.themeStyle=_ve(this.theme,this.enableCanvas,this)},iwe.prototype.requiredModules=function(){var e,t,i=this,n=[],o=this.series,r=!1,s=!1,a=!1,l=this.zoomSettings;return this.chartAreaType=0<o.length&&("Polar"===o[0].type||"Radar"===o[0].type)?"PolarRadar":"Cartesian",this.tooltip.enable&&n.push({member:"Tooltip",args:[this]}),o.map(function(e){i.isLegend=i.legendSettings.visible&&(""!==e.name||!!i.isLegend),t=-1!==e.type.indexOf("100")?e.type.replace("100","")+"Series":e.type+"Series",r=e.errorBar.visible||r,a=e.marker.dataLabel.visible||a||"Pareto"===e.type&&e.paretoOptions.marker.dataLabel.visible,s=e.dragSettings.enable||s,n.some(function(e){return e.member===t})||n.push({member:t,args:[i,o]}),"PolarRadar"===i.chartAreaType&&n.push({member:e.drawType+"Series",args:[i,o]}),"Pareto"===e.type&&(n.push({member:"ColumnSeries",args:[i,o]}),n.push({member:"LineSeries",args:[i,o]}))}),this.findIndicatorModules(n),this.findTrendLineModules(n),n=this.findAxisModule(n),e=this.annotations.some(function(e){return null!==e.content}),r&&n.push({member:"ErrorBar",args:[this,o]}),this.isLegend&&n.push({member:"Legend",args:[this]}),(this.enableExport||this.allowExport)&&n.push({member:"Export",args:[this]}),"PolarRadar"!==this.chartAreaType&&this.crosshair.enable&&n.push({member:"Crosshair",args:[this]}),"PolarRadar"!==this.chartAreaType&&!this.scrollSettingEnabled&&(l.enableSelectionZooming||l.enableMouseWheelZooming||l.enablePinchZooming||l.enablePan||l.enableScrollbar||l.showToolbar)&&(n.push({member:"Zoom",args:[this,this.zoomSettings]}),l.enableScrollbar)&&n.push({member:"ScrollBar",args:[this]}),"None"===this.selectionMode||"PolarRadar"===this.chartAreaType&&-1<this.selectionMode.indexOf("Drag")||n.push({member:"Selection",args:[this]}),"None"===this.highlightMode&&!this.legendSettings.enableHighlight||n.push({member:"Highlight",args:[this]}),a&&n.push({member:"DataLabel",args:[this,o]}),s&&n.push({member:"DataEditing",args:[this]}),e&&n.push({member:"Annotation",args:[this]}),n},iwe.prototype.findAxisModule=function(e){for(var t=[],i=(t.push(this.primaryXAxis),t.push(this.primaryYAxis),!1),n=!1,o=!1,r=!1,s=!1,a=!1,l=0,h=t=t.concat(this.axes);l<h.length;l++){var d=h[l],i="DateTime"===d.valueType||i,n="Category"===d.valueType||n,o="Logarithmic"===d.valueType||o,s="DateTimeCategory"===d.valueType||s,r=this.findStriplineVisibility(d.stripLines)||r,a=0<d.multiLevelLabels.length||a;this.scrollSettingEnabled=!!d.scrollbarSettings.enable||this.scrollSettingEnabled}return i&&e.push({member:"DateTime",args:[this]}),n&&e.push({member:"Category",args:[this]}),o&&e.push({member:"Logarithmic",args:[this]}),r&&e.push({member:"StripLine",args:[this]}),a&&e.push({member:"MultiLevelLabel",args:[this]}),s&&e.push({member:"DateTimeCategory",args:[this]}),this.scrollSettingEnabled&&e.push({member:"ScrollBar",args:[this]}),e},iwe.prototype.findIndicatorModules=function(e){var t,i,n=this.indicators;if(this.indicators.length){e.push({member:"LineSeries",args:[this]}),n.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,r=this.indicators;o<r.length;o++){var s=r[o];e.push({member:s.type+"Indicator",args:[this]})}}},iwe.prototype.findTrendLineModules=function(i){for(var n,o,r=this,e=0,t=this.series;e<t.length;e++)!function(e){var t;e.trendlines.map(function(e){t=t||e.marker.visible,n=!(!n&&"Linear"!==e.type&&"MovingAverage"!==e.type),o=!(!o&&n&&"Exponential"!==e.type&&"Logarithmic"!==e.type&&"Power"!==e.type&&"Polynomial"!==e.type)}),t&&i.push({member:"Marker",args:[r,e]})}(t[e]);(n||o)&&i.push({member:"TrendLine",args:[this]}),n&&i.push({member:"LineSeries",args:[this]}),o&&i.push({member:"SplineSeries",args:[this]})},iwe.prototype.findStriplineVisibility=function(e){for(var t=!1,i=0,n=e;i<n.length;i++)if(n[i].visible){t=!0;break}return t},iwe.prototype.removeSvg=function(){if(this.redraw)return null;if(gve(this),this.enableCanvas&&this.svgObject&&"CANVAS"===this.svgObject.tagName)return this.renderer.clearRect(new Do(0,0,this.availableSize.width,this.availableSize.height)),this.svgObject.parentNode&&ue(this.svgObject),null;Pye(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),!je(this.resizeTo)){if(this.resizeTo!==this.checkResize&&this.isBlazor&&this.element.childElementCount)for(var t=document.querySelectorAll(".e-chart"),i=0;i<t.length;i++)for(var n=t[i];n.firstChild;)ue(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||ue(this.svgObject)}},iwe.prototype.refreshDefinition=function(e){for(var t=0,i=e;t<i.length;t++)i[t].axes=[]},iwe.prototype.refreshAxis=function(){var e=this.primaryXAxis;e.rect=new Do(void 0,void 0,0,0),(e=this.primaryYAxis).isStack100=!1,e.rect=new Do(void 0,void 0,0,0);for(var t=0,i=this.axes;t<i.length;t++)(e=i[t]).rect=new Do(void 0,void 0,0,0),e.isStack100=!1;if(this.paretoSeriesModule&&"Pareto"===this.series[0].type)for(var n=0,o=this.paretoSeriesModule.paretoAxes;n<o.length;n++)(e=o[n]).rect=new Do(void 0,void 0,0,0),e.isStack100=!1},iwe.prototype.axisChange=function(e){return!(!e.name&&!e.valueType||(this.refreshDefinition(this.columns),this.refreshDefinition(this.rows),this.calculateVisibleAxis(),this.processData(),0))},iwe.prototype.getVisibleSeries=function(e,t){for(var i=0,n=e;i<n.length;i++){var o=n[i];if(t===o.index)return o}return null},iwe.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}))},iwe.prototype.removeStyles=function(){Pye(this.element.id+"_ej2_chart_selection"),Pye(this.element.id+"_ej2_chart_highlight")},iwe.prototype.mouseMoveEvent=function(){var e;this.tooltip.enable&&null!==this.previousPageX&&null!==this.previousPageY&&((e=document.createEvent("MouseEvent")).initMouseEvent("mousemove",!0,!1,window,1,100,100,this.previousPageX,this.previousPageY,!1,!1,!1,!1,0,null),this.element.dispatchEvent(e))},iwe.prototype.showTooltip=function(e,t,i){if(i=void 0===i?!1:i)for(var n=0,o=this.visibleSeries;n<o.length;n++)for(var r=o[n],s=0,a=r.points;s<a.length;s++){var l=a[s],h="DateTime"===r.xAxis.valueType?l.xValue:l.x;if("DateTime"===r.xAxis.valueType&&new Date(e).getTime(),e===h&&t===l.yValue){this.mouseX=l.regions[0].x+this.chartAxisLayoutPanel.seriesClipRect.x,this.mouseY=l.regions[0].y+this.chartAxisLayoutPanel.seriesClipRect.y,this.tooltipModule.tooltip(),this.markerRender.mouseMoveHandler();break}}else this.isTouch&&(this.startMove=!0),this.mouseX=e,this.mouseY=t,this.tooltipModule.mouseMoveHandler(),this.markerRender.mouseMoveHandler()},iwe.prototype.hideTooltip=function(){this.tooltipModule.removeTooltip(F.isDevice?2e3:1e3)},iwe.prototype.showCrosshair=function(e,t){this.mouseX=e,this.mouseY=t,this.isCrosshair=!1,o0e(this.mouseX,this.mouseY,this.chartAxisLayoutPanel.seriesClipRect)?this.crosshairModule.crosshair():this.hideCrosshair(),this.isCrosshair=!0},iwe.prototype.hideCrosshair=function(){this.crosshairModule.removeCrosshair(F.isDevice?2e3:1e3)},iwe.prototype.sanitize=function(e){return this.enableHtmlSanitizer?go.sanitize(e):e},iwe.prototype.onPropertyChanged=function(e,t){var i=!1,n=!1,o=this.animateSeries=!1,r=!1;if(!this.delayRedraw&&!this.zoomRedraw){for(var s=0,a=Object.keys(e);s<a.length;s++){var l=a[s],o=o||"primaryXAxis"!==l&&"primaryYAxis"!==l&&"axes"!==l;switch(r&&o&&(this.redraw=!1),l){case"primaryXAxis":c=e.primaryXAxis,n=this.axisChange(c),e.primaryXAxis.edgeLabelPlacement&&(i=!0),e.primaryXAxis.crosshairTooltip||(n=!0),e.primaryXAxis.scrollbarSettings&&(n=!0),je(c.isInversed)&&je(c.opposedPosition)||this.primaryXAxis.setIsInversedAndOpposedPosition(),this.primaryXAxis.zoomingScrollBar&&this.primaryXAxis.zoomingScrollBar.isScrollUI||!this.zoomModule||je(c.zoomFactor)&&je(c.zoomPosition)||(this.redraw=this.zoomSettings.enableAnimation&&!o,r=this.zoomSettings.enableAnimation&&!o),!e.primaryXAxis.crosshairTooltip||e.primaryXAxis.crosshairTooltip.enable||(Pye(this.element.id+"_axis_tooltip_0"),Pye(this.element.id+"_axis_tooltip_text_0"));break;case"primaryYAxis":c=e.primaryYAxis,n=this.axisChange(c),e.primaryYAxis.edgeLabelPlacement&&(i=!0),e.primaryYAxis.crosshairTooltip||(n=!0),e.primaryYAxis.scrollbarSettings&&(n=!0),je(c.isInversed)&&je(c.opposedPosition)||this.primaryYAxis.setIsInversedAndOpposedPosition(),this.primaryYAxis.zoomingScrollBar&&this.primaryYAxis.zoomingScrollBar.isScrollUI||!this.zoomModule||je(c.zoomFactor)&&je(c.zoomPosition)||(this.redraw=this.zoomSettings.enableAnimation&&!o,r=this.zoomSettings.enableAnimation&&!o),!e.primaryYAxis.crosshairTooltip||e.primaryYAxis.crosshairTooltip.enable||(Pye(this.element.id+"_axis_tooltip_1"),Pye(this.element.id+"_axis_tooltip_text_1"));break;case"axes":for(var h=0,d=Object.keys(e.axes);h<d.length;h++){var p=d[h],c=e.axes[p],n=n||this.axisChange(c);c.crosshairTooltip||(n=!0),c.scrollbarSettings&&(n=!0),je(c.isInversed)&&je(c.opposedPosition)||this.axes[p].setIsInversedAndOpposedPosition(),this.axes[p].zoomingScrollBar&&this.axes[p].zoomingScrollBar.isScrollUI||!this.zoomModule||je(c.zoomFactor)&&je(c.zoomPosition)||(this.redraw=this.zoomSettings.enableAnimation&&!o,r=this.zoomSettings.enableAnimation&&!o),!c.crosshairTooltip||c.crosshairTooltip.enable||(Pye(this.element.id+"_axis_tooltip_"+this.axes[p].index),Pye(this.element.id+"_axis_tooltip_text_"+this.axes[p].index))}this.scrollElement&&this.zoomSettings.enableScrollbar&&(this.scrollElement=null);break;case"height":case"width":this.createChartSvg(),n=!0;break;case"subTitle":case"title":n=!0;break;case"titleStyle":e.titleStyle&&(e.titleStyle.size||e.titleStyle.textOverflow||e.titleStyle.position)?n=!0:i=!0;break;case"subTitleStyle":e.subTitleStyle&&(e.subTitleStyle.size||e.subTitleStyle.textOverflow)?n=!0:i=!0;break;case"border":i=!0;break;case"dataSource":this.processData(!1),n=!0;break;case"enableCanvas":this.refresh();break;case"series":for(var u,g=this.series.length,m=!1,f=void 0,y=0;y<g;y++)u=e.series[y],this.isBlazor&&u&&(u.visible!==t.series[y].visible||u.isClosed||u.marker||u.emptyPointSettings||u.type||u.boxPlotMode||u.showMean)&&(f=!0),!je(u)&&(u.dataSource||u.query||u.errorBar||u.xName||u.yName||u.size||u.high||u.low||u.open||u.close||u.trendlines||u.fill||u.name||u.marker||u.width||u.binInterval||u.type||u.visible!==t.series[y].visible||u.legendShape||u.emptyPointSettings||u.opacity||u.columnWidth||u.columnSpacing||u.opacity||u.dashArray||u.bearFillColor||u.bullFillColor||f)&&(Pe(this.getVisibleSeries(this.visibleSeries,y),u,null,!0),m=!0);m&&(this.calculateAreaType(),this.calculateVisibleSeries(),this.initTechnicalIndicators(),this.initTrendLines(),this.refreshDefinition(this.columns),this.refreshDefinition(this.rows),this.calculateVisibleAxis(),this.processData(!1),n=!0);break;case"indicators":n=!0;break;case"zoomSettings":(e.zoomSettings.enableScrollbar||t.zoomSettings.enableScrollbar)&&(n=!0),i=!0;break;case"background":i=!0;break;case"chartArea":e.chartArea.border&&e.chartArea.border.width&&(n=!0),i=!0;break;case"legendSettings":e.legendSettings.background&&e.legendSettings.opacity||(n=!0),i=!0;break;case"palettes":this.calculateVisibleSeries(),i=!0;break;case"selectedDataIndexes":this.selectionModule?(this.selectionModule.currentMode=this.selectionMode,this.selectionModule.selectedDataIndexes=this.selectedDataIndexes,this.selectionModule.styleId=this.element.id+"_ej2_chart_selection",this.selectionModule.redrawSelection(this,t.selectionMode,!0)):this.highlightModule&&(this.highlightModule.currentMode=this.highlightMode,this.highlightModule.highlightDataIndexes=this.selectedDataIndexes,this.highlightModule.styleId=this.element.id+"_ej2_chart_highlight",this.highlightModule.redrawSelection(this,t.selectionMode,!0));break;case"selectionMode":this.selectionModule&&e.selectionMode&&-1===e.selectionMode.indexOf("Drag")&&(this.selectionModule.currentMode=this.selectionMode,"None"===t.selectionMode&&this.selectionModule.invokeSelection(this),this.selectionModule.styleId=this.element.id+"_ej2_chart_selection",this.selectionModule.redrawSelection(this,t.selectionMode,!0));break;case"isMultiSelect":this.selectionModule&&!e.isMultiSelect&&1<this.selectionModule.selectedDataIndexes.length&&(this.selectionModule.currentMode=this.selectionMode,this.selectionModule.styleId=this.element.id+"_ej2_chart_selection",this.selectionModule.redrawSelection(this,t.selectionMode));break;case"highlightMode":case"selectionPattern":case"highlightPattern":this.removeStyles(),i=!0;break;case"theme":this.animateSeries=!0;break;case"enableRtl":case"locale":case"currencyCode":this.isBlazor?(this.setCulture(),i=!0):this.refresh();break;case"tooltip":this.tooltipModule&&(this.tooltipModule.previousPoints=[],this.tooltip.template)&&(this.tooltipModule.template=this.tooltip.template)}}!n&&i&&(this.rotatedDataLabelCollections=[],this.removeSvg(),this.renderElements(),this.trigger("loaded",{chart:this.isBlazor?{}:this})),n&&(this.enableCanvas?this.createChartSvg():this.removeSvg(),this.isReact&&this.clearTemplate(),this.dragY=null,this.refreshAxis(),this.refreshBound(),this.trigger("loaded",{chart:this.isBlazor?{}:this}),this.redraw=!1,this.animated=!1)}this.zoomRedraw=!1},Ube([e(null)],iwe.prototype,"width",void 0),Ube([e(null)],iwe.prototype,"height",void 0),Ube([e("")],iwe.prototype,"title",void 0),Ube([e("")],iwe.prototype,"dataSource",void 0),Ube([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},pme)],iwe.prototype,"titleStyle",void 0),Ube([e("")],iwe.prototype,"subTitle",void 0),Ube([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null,accessibility:{focusable:!1}},pme)],iwe.prototype,"subTitleStyle",void 0),Ube([t({},zge)],iwe.prototype,"margin",void 0),Ube([t({color:"#DDDDDD",width:0},Rge)],iwe.prototype,"border",void 0),Ube([e(null)],iwe.prototype,"background",void 0),Ube([t({border:{color:null,width:.5},background:"transparent"},yme)],iwe.prototype,"chartArea",void 0),Ube([e(!1)],iwe.prototype,"enableHtmlSanitizer",void 0),Ube([t({name:"primaryXAxis"},Sye)],iwe.prototype,"primaryXAxis",void 0),Ube([t({name:"primaryYAxis"},Sye)],iwe.prototype,"primaryYAxis",void 0),Ube([kt([{}],Zfe)],iwe.prototype,"rows",void 0),Ube([kt([{}],tye)],iwe.prototype,"columns",void 0),Ube([kt([{}],Sye)],iwe.prototype,"axes",void 0),Ube([kt([{}],bbe)],iwe.prototype,"series",void 0),Ube([kt([{accessibility:{focusable:!1}}],xfe)],iwe.prototype,"annotations",void 0),Ube([e([])],iwe.prototype,"palettes",void 0),Ube([e("Material")],iwe.prototype,"theme",void 0),Ube([t({},Gge)],iwe.prototype,"tooltip",void 0),Ube([t({},Xbe)],iwe.prototype,"crosshair",void 0),Ube([t({},Afe)],iwe.prototype,"legendSettings",void 0),Ube([kt([{}],qbe)],iwe.prototype,"rangeColorSettings",void 0),Ube([t({},Zbe)],iwe.prototype,"zoomSettings",void 0),Ube([e("")],iwe.prototype,"highlightColor",void 0),Ube([e("None")],iwe.prototype,"selectionMode",void 0),Ube([e("None")],iwe.prototype,"highlightMode",void 0),Ube([e("None")],iwe.prototype,"selectionPattern",void 0),Ube([e("None")],iwe.prototype,"highlightPattern",void 0),Ube([e(!1)],iwe.prototype,"isMultiSelect",void 0),Ube([e(!1)],iwe.prototype,"allowMultiSelection",void 0),Ube([e(!0)],iwe.prototype,"enableExport",void 0),Ube([e(!1)],iwe.prototype,"allowExport",void 0),Ube([kt([],$ge)],iwe.prototype,"selectedDataIndexes",void 0),Ube([e(!1)],iwe.prototype,"useGroupingSeparator",void 0),Ube([e(!1)],iwe.prototype,"enableAutoIntervalOnBothAxis",void 0),Ube([e(!1)],iwe.prototype,"isTransposed",void 0),Ube([e(!1)],iwe.prototype,"enableCanvas",void 0),Ube([e(null)],iwe.prototype,"backgroundImage",void 0),Ube([kt([],_be)],iwe.prototype,"indicators",void 0),Ube([e(!0)],iwe.prototype,"enableAnimation",void 0),Ube([e(null)],iwe.prototype,"description",void 0),Ube([e(1)],iwe.prototype,"tabIndex",void 0),Ube([e(!0)],iwe.prototype,"enableSideBySidePlacement",void 0),Ube([t({},wge)],iwe.prototype,"accessibility",void 0),Ube([e(null)],iwe.prototype,"focusBorderColor",void 0),Ube([e(1.5)],iwe.prototype,"focusBorderWidth",void 0),Ube([e(0)],iwe.prototype,"focusBorderMargin",void 0),Ube([t({},bce)],iwe.prototype,"stackLabels",void 0),Ube([i()],iwe.prototype,"resized",void 0),Ube([i()],iwe.prototype,"beforeResize",void 0),Ube([i()],iwe.prototype,"annotationRender",void 0),Ube([i()],iwe.prototype,"beforePrint",void 0),Ube([i()],iwe.prototype,"loaded",void 0),Ube([i()],iwe.prototype,"beforeExport",void 0),Ube([i()],iwe.prototype,"afterExport",void 0),Ube([i()],iwe.prototype,"load",void 0),Ube([i()],iwe.prototype,"animationComplete",void 0),Ube([i()],iwe.prototype,"legendRender",void 0),Ube([i()],iwe.prototype,"textRender",void 0),Ube([i()],iwe.prototype,"pointRender",void 0),Ube([i()],iwe.prototype,"seriesRender",void 0),Ube([i()],iwe.prototype,"axisLabelRender",void 0),Ube([i()],iwe.prototype,"axisLabelClick",void 0),Ube([i()],iwe.prototype,"axisRangeCalculated",void 0),Ube([i()],iwe.prototype,"axisMultiLabelRender",void 0),Ube([i()],iwe.prototype,"legendClick",void 0),Ube([i()],iwe.prototype,"multiLevelLabelClick",void 0),Ube([i()],iwe.prototype,"tooltipRender",void 0),Ube([i()],iwe.prototype,"sharedTooltipRender",void 0),Ube([i()],iwe.prototype,"chartMouseMove",void 0),Ube([i()],iwe.prototype,"chartMouseClick",void 0),Ube([i()],iwe.prototype,"chartDoubleClick",void 0),Ube([i()],iwe.prototype,"pointClick",void 0),Ube([i()],iwe.prototype,"pointDoubleClick",void 0),Ube([i()],iwe.prototype,"pointMove",void 0),Ube([i()],iwe.prototype,"chartMouseLeave",void 0),Ube([i()],iwe.prototype,"chartMouseDown",void 0),Ube([i()],iwe.prototype,"chartMouseUp",void 0),Ube([i()],iwe.prototype,"dragComplete",void 0),Ube([i()],iwe.prototype,"selectionComplete",void 0),Ube([i()],iwe.prototype,"zoomComplete",void 0),Ube([i()],iwe.prototype,"onZooming",void 0),Ube([i()],iwe.prototype,"scrollStart",void 0),Ube([i()],iwe.prototype,"scrollEnd",void 0),Ube([i()],iwe.prototype,"scrollChanged",void 0),Ube([i()],iwe.prototype,"dragStart",void 0),Ube([i()],iwe.prototype,"drag",void 0),Ube([i()],iwe.prototype,"dragEnd",void 0),Ube([e("USD")],iwe.prototype,"currencyCode",void 0);var ewe,twe=Ube([Bt],iwe);function iwe(e,t){e=ewe.call(this,e,t)||this;return e.rotatedDataLabelCollections=[],e.animated=!1,e.isPointMouseDown=!1,e.isScrolling=!1,e.checkResize=0,e.visible=0,e.clickCount=0,e.maxPointCount=0,e.singleClickTimer=0,e.chartAreaType="Cartesian",e.isRtlEnabled=!1,e.isCrosshair=!0,e.chartid=57723,e.isLegendClicked=!1,e.isZoomed=!1,e.previousTargetId="",e.currentPointIndex=0,e.currentSeriesIndex=0,e.currentLegendIndex=0,e.previousPageX=null,e.previousPageY=null,e.allowPan=!1,e.pointsRemoved=!1,e.pointsAdded=!1,e.zoomRedraw=!1,x("mergePersistData",e.mergePersistChartData,e),e}nwe=function(e,t){return(nwe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}nwe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(rwe,owe=Fme),rwe.prototype.calculateDateTimeNiceInterval=function(e,t,i,n,o){void 0===o&&(o=!0);var r,i=new Date(i),n=new Date(n),s=Math.abs((i.getTime()-n.getTime())/864e5);switch(e.actualIntervalType=e.intervalType,e.intervalType){case"Years":r=this.calculateNumericNiceInterval(e,s/365,t);break;case"Quarter":r=this.calculateNumericNiceInterval(e,s/365*4,t);break;case"Months":r=this.calculateNumericNiceInterval(e,s/30,t);break;case"Weeks":r=this.calculateNumericNiceInterval(e,s/7,t);break;case"Days":r=this.calculateNumericNiceInterval(e,s,t);break;case"Hours":r=this.calculateNumericNiceInterval(e,24*s,t);break;case"Minutes":r=this.calculateNumericNiceInterval(e,24*s*60,t);break;case"Seconds":r=this.calculateNumericNiceInterval(e,24*s*60*60,t);break;case"Auto":return 1<=(r=this.calculateNumericNiceInterval(e,s/365,t))?e.actualIntervalType="Years":1<=(r=this.calculateNumericNiceInterval(e,s/30,t))?e.actualIntervalType="Months":1<=(r=this.calculateNumericNiceInterval(e,s/7,t))&&!o?e.actualIntervalType="Weeks":1<=(r=this.calculateNumericNiceInterval(e,s,t))?e.actualIntervalType="Days":1<=(r=this.calculateNumericNiceInterval(e,24*s,t))?e.actualIntervalType="Hours":1<=(r=this.calculateNumericNiceInterval(e,24*s*60,t))?e.actualIntervalType="Minutes":(r=this.calculateNumericNiceInterval(e,24*s*60*60,t),e.actualIntervalType="Seconds"),r}return r},rwe.prototype.getSkeleton=function(e,t,i,n){var o=e.actualIntervalType;return e.skeleton||("Years"===o?n?(e.isChart&&e.valueType,"y"):!e.isChart||"DateTime"===e.valueType&&e.isIntervalInDecimal?"y":"yMMM":"Quarter"===o?n?"y":"yMMM":"Months"===o?n?(e.isChart,"m"):e.isChart?"MMMd":"MMM":"Weeks"===o?n?"m":"MEd":"Days"===o?n?"d":!e.isChart||"DateTime"===e.valueType?"MMMd":"yMd":"Hours"===o?n?"t":e.isChart?"DateTime"===e.valueType?"Hm":"EHm":"h":"Minutes"===o?n?"T":e.isChart?"Hms":"hm":n?"T":e.isChart?"Hms":"hms")},rwe.prototype.findCustomFormats=function(e){var t=e.labelFormat||"";return t=e.isChart&&!e.skeleton&&"Months"===e.actualIntervalType?t||("DateTime"===e.valueType?"MMM yyyy":"yMMM"):t};var nwe,owe,Vbe=rwe;function rwe(){return null!==owe&&owe.apply(this,arguments)||this}swe=function(e,t){return(swe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}swe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(lwe,awe=Vbe),lwe.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t,this.chart)},lwe.prototype.getActualRange=function(e,t){var i={skeleton:"full",type:"dateTime"},n=this.chart.intl.getDateParser(i),i=this.chart.intl.getDateFormat(i),n=(null!==e.minimum?this.min=this.chart.isBlazor?Date.parse(e.minimum.toString()):Date.parse(n(i(new Date(Sa.parse.parseJson({val:e.minimum}).val)))):null!==this.min&&this.min!==Number.POSITIVE_INFINITY||(this.min=Date.parse(n(i(new Date(1970,1,1))))),null!==e.maximum?this.max=this.chart.isBlazor?Date.parse(e.maximum.toString()):Date.parse(n(i(new Date(Sa.parse.parseJson({val:e.maximum}).val)))):null!==this.max&&this.max!==Number.NEGATIVE_INFINITY||(this.max=Date.parse(n(i(new Date(1970,5,1))))),this.min===this.max&&(this.max=this.max+2592e6,this.min=this.min-2592e6),e.actualRange={},e.doubleRange=new Pme(this.min,this.max),this.calculateDateTimeNiceInterval(e,t,e.doubleRange.start,e.doubleRange.end));e.interval?e.actualRange.interval=e.interval:e.actualRange.interval=n,e.actualRange.min=e.doubleRange.start,e.actualRange.max=e.doubleRange.end},lwe.prototype.applyRangePadding=function(e,t){this.min=e.actualRange.min,this.max=e.actualRange.max;var i=e.actualRange.interval;if(!b0e(e)){var n=e.getRangePadding(this.chart),o=new Date(this.min),r=new Date(this.max),s=e.actualIntervalType;if("None"===n)this.min=o.getTime(),this.max=r.getTime();else if("Additional"===n||"Round"===n)switch(s){case"Years":this.getYear(o,r,n,i);break;case"Months":this.getMonth(o,r,n,i);break;case"Days":this.getDay(o,r,n,i);break;case"Hours":this.getHour(o,r,n,i);break;case"Minutes":var a=o.getMinutes()/i*i,l=r.getMinutes()+(o.getMinutes()-a);"Round"===n?(this.min=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),a,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),l,59).getTime()):(this.min=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),a-i,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),l+i,0).getTime());break;case"Seconds":a=o.getSeconds()/i*i,l=r.getSeconds()+(o.getSeconds()-a);"Round"===n?(this.min=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),a,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),l,0).getTime()):(this.min=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),a-i,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),l+i,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 Pme(e.actualRange.min,e.actualRange.max),this.calculateVisibleRange(t,e)},lwe.prototype.getYear=function(e,t,i,n){e=e.getFullYear(),t=t.getFullYear();"Additional"===i?(this.min=new Date(e-n,1,1,0,0,0).getTime(),this.max=new Date(t+n,1,1,0,0,0).getTime()):(this.min=new Date(e,0,0,0,0,0).getTime(),this.max=new Date(t,11,30,23,59,59).getTime())},lwe.prototype.getMonth=function(e,t,i,n){var o=e.getMonth(),r=t.getMonth();"Round"===i?(this.min=new Date(e.getFullYear(),o,0,0,0,0).getTime(),this.max=new Date(t.getFullYear(),r,new Date(t.getFullYear(),t.getMonth(),0).getDate(),23,59,59).getTime()):(this.min=new Date(e.getFullYear(),o+-n,1,0,0,0).getTime(),this.max=new Date(t.getFullYear(),r+n,2===r?28:30,0,0,0).getTime())},lwe.prototype.getDay=function(e,t,i,n){var o=e.getDate(),r=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(),r,23,59,59).getTime()):(this.min=new Date(e.getFullYear(),e.getMonth(),o+-n,0,0,0).getTime(),this.max=new Date(t.getFullYear(),t.getMonth(),r+n,0,0,0).getTime())},lwe.prototype.getHour=function(e,t,i,n){var o=e.getHours()/n*n,r=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(),r,59,59).getTime()):(this.min=new Date(e.getFullYear(),e.getMonth(),e.getDate(),o-n,0,0).getTime(),this.max=new Date(t.getFullYear(),t.getMonth(),t.getDate(),r+n,0,0).getTime())},lwe.prototype.calculateVisibleRange=function(e,t){t.visibleRange={min:t.actualRange.min,max:t.actualRange.max,interval:t.actualRange.interval,delta:t.actualRange.delta};var i=!je(t.zoomingScrollBar)&&t.zoomingScrollBar.isLazyLoad;w0e(t)&&!i&&(t.calculateVisibleRangeOnZooming(),t.visibleRange.interval=t.enableAutoIntervalOnZooming?this.calculateDateTimeNiceInterval(t,e,t.visibleRange.min,t.visibleRange.max):t.visibleRange.interval),t.dateTimeInterval=this.increaseDateTimeInterval(t,t.visibleRange.min,t.visibleRange.interval).getTime()-t.visibleRange.min,t.triggerRangeRender(this.chart,t.visibleRange.min,t.visibleRange.max,t.visibleRange.interval)},lwe.prototype.calculateVisibleLabels=function(e,t){e.visibleLabels=[];var i=e.visibleRange.min,n="chart"===t.getModuleName()&&t.isBlazor,o=e.visibleLabels;for(null===e.minimum&&(i=this.alignRangeStart(e,i,e.visibleRange.interval).getTime()),this.startValue&&this.startValue<i&&t.zoomModule&&t.zoomModule.isPanning?i=this.startValue:this.startValue=i;i<=e.visibleRange.max;){var r=Pe({},R("properties",e.labelStyle),null,!0),s=o.length?e.visibleLabels[o.length-1].value:i;if(e.format=t.intl.getDateFormat({format:this.findCustomFormats(e)||this.blazorCustomFormat(e),type:l0e(e.skeletonType),skeleton:this.getSkeleton(e,i,s,n)}),e.startLabel=e.format(new Date(e.visibleRange.min)),e.endLabel=e.format(new Date(e.visibleRange.max)),Rye(i,e.visibleRange)&&(this.increaseDateTimeInterval(e,i,e.visibleRange.interval).getTime()>e.visibleRange.max&&(e.endLabel=e.format(new Date(i))),v0e(t,i,e.format(new Date(i)),r,e)),i===(i=this.increaseDateTimeInterval(e,i,e.visibleRange.interval).getTime()))break}"Months"!==e.actualIntervalType&&"Days"!==e.actualIntervalType||!e.isChart||(e.format=t.intl.getDateFormat({format:e.labelFormat||("Months"!==e.actualIntervalType||e.skeleton?"":"y MMM"),type:l0e(e.skeletonType),skeleton:e.skeleton||("Days"===e.actualIntervalType?"MMMd":"")})),e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},lwe.prototype.blazorCustomFormat=function(e){return this.chart.isBlazor?"Years"===e.actualIntervalType?e.isIntervalInDecimal?"yyyy":"MMM y":"Days"!==e.actualIntervalType||e.isIntervalInDecimal?"":"ddd HH tt":""},lwe.prototype.increaseDateTimeInterval=function(e,t,i){var n=new Date(t),t=(e.interval?e.isIntervalInDecimal=i%1==0:i=Math.ceil(i),e.visibleRange.interval=i,e.actualIntervalType);if(e.isIntervalInDecimal)switch(t){case"Years":return n.setFullYear(n.getFullYear()+i),n;case"Quarter":return n.setMonth(n.getMonth()+3*i),n;case"Months":return n.setMonth(n.getMonth()+i),n;case"Weeks":return n.setDate(n.getDate()+7*i),n;case"Days":return n.setDate(n.getDate()+i),n;case"Hours":return n.setHours(n.getHours()+i),n;case"Minutes":return n.setMinutes(n.getMinutes()+i),n;case"Seconds":return n.setSeconds(n.getSeconds()+i),n}else n=this.getDecimalInterval(n,i,t);return n},lwe.prototype.alignRangeStart=function(e,t,i){var n=new Date(t);switch(e.actualIntervalType){case"Years":var o=Math.floor(Math.floor(n.getFullYear()/i)*i);return n=new Date(o,n.getMonth(),n.getDate(),0,0,0);case"Months":o=Math.floor(Math.floor(n.getMonth()/i)*i);return n=new Date(n.getFullYear(),o,n.getDate(),0,0,0);case"Days":o=Math.floor(Math.floor(n.getDate()/i)*i);return n=new Date(n.getFullYear(),n.getMonth(),o,0,0,0);case"Hours":o=Math.floor(Math.floor(n.getHours()/i)*i);return n=new Date(n.getFullYear(),n.getMonth(),n.getDate(),o,0,0);case"Minutes":o=Math.floor(Math.floor(n.getMinutes()/i)*i);return n=new Date(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),o,0,0);case"Seconds":o=Math.floor(Math.floor(n.getSeconds()/i)*i);return n=new Date(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),o,0)}return n},lwe.prototype.getDecimalInterval=function(e,t,i){var n=Math.floor(t),o=t-n;switch(i){case"Years":var r=Math.round(12*o);return e.setFullYear(e.getFullYear()+n),e.setMonth(e.getMonth()+r),e;case"Quarter":return e.setMonth(e.getMonth()+3*t),e;case"Months":r=Math.round(30*o);return e.setMonth(e.getMonth()+n),e.setDate(e.getDate()+r),e;case"Weeks":return e.setDate(e.getDate()+7*t),e;case"Days":r=Math.round(24*o);return e.setDate(e.getDate()+n),e.setHours(e.getHours()+r),e;case"Hours":r=Math.round(60*o);return e.setHours(e.getHours()+n),e.setMinutes(e.getMinutes()+r),e;case"Minutes":r=Math.round(60*o);return e.setMinutes(e.getMinutes()+n),e.setSeconds(e.getSeconds()+r),e;case"Seconds":r=Math.round(1e3*o);return e.setSeconds(e.getSeconds()+n),e.setMilliseconds(e.getMilliseconds()+r),e}return e},lwe.prototype.getModuleName=function(){return"DateTime"},lwe.prototype.destroy=function(){};var swe,awe,Ube=lwe;function lwe(e){return awe.call(this,e)||this}hwe=function(e,t){return(hwe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}hwe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(cwe,dwe=Vbe),cwe.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t)},cwe.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/C0e(t,e))),e.actualRange.min=e.doubleRange.start,e.actualRange.max=e.doubleRange.end,e.actualRange.delta=e.doubleRange.delta},cwe.prototype.applyRangePadding=function(t,e){t.series.forEach(function(e){i=i||(-1<e.type.indexOf("Column")||-1<e.type.indexOf("Bar"))&&!(t.zoomFactor<1||0<t.zoomPosition)&&je(t.minimum)&&je(t.maximum)});var i,n="BetweenTicks"!==t.labelPlacement&&!i||this.chart.stockChart||"PolarRadar"===this.chart.chartAreaType?0:.5;0<n?(t.actualRange.min-=n,t.actualRange.max+=n):t.actualRange.max+=t.actualRange.max?0:.5,t.doubleRange=new Pme(t.actualRange.min,t.actualRange.max),t.actualRange.delta=t.doubleRange.delta,this.calculateVisibleRange(e,t)},cwe.prototype.calculateVisibleLabels=function(e){e.visibleLabels=[],e.visibleRange.interval=e.visibleRange.interval<1?1:e.visibleRange.interval;var t,i,n=Math.ceil(e.visibleRange.min);for((e.zoomFactor<1||0<e.zoomPosition)&&(n=e.visibleRange.min-e.visibleRange.min%e.visibleRange.interval),e.startLabel=e.labels[Math.round(e.visibleRange.min)],e.endLabel=e.labels[Math.floor(e.visibleRange.max)];n<=e.visibleRange.max;n+=e.visibleRange.interval)t=Pe({},R("properties",e.labelStyle),null,!0),Rye(n,e.visibleRange)&&0<e.labels.length&&(i=Math.round(n),v0e(this.chart,i,e.labels[i]?e.labels[i].toString():"",t,e));e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},cwe.prototype.getModuleName=function(){return"Category"},cwe.prototype.destroy=function(){};var hwe,dwe,pwe=cwe;function cwe(e){return dwe.call(this,e)||this}uwe=function(e,t){return(uwe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}uwe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(fwe,gwe=Fme),fwe.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.calculateVisibleRange(e,t),this.calculateVisibleLabels(t,this.chart)},fwe.prototype.getActualRange=function(e,t){this.initializeDoubleRange(e),this.min=this.min<0?0:this.min;var i=Bye(this.min,e.logBase),i=isFinite(i)?i:this.min,n=1===this.max?1:Bye(this.max,e.logBase),n=isFinite(i)?n:this.max;this.min=Math.floor(+i),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(+n),this.max=this.max===this.min?this.max+1:this.max,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},fwe.prototype.calculateVisibleRange=function(e,t){t.visibleRange={interval:t.actualRange.interval,max:t.actualRange.max,min:t.actualRange.min,delta:t.actualRange.delta};var i=!je(t.zoomingScrollBar)&&t.zoomingScrollBar.isLazyLoad;(t.zoomFactor<1||0<t.zoomPosition)&&!i&&(t.calculateVisibleRangeOnZooming(),t.visibleRange.interval=t.enableAutoIntervalOnZooming?this.calculateLogNiceInterval(t.doubleRange.delta,e,t):t.visibleRange.interval,t.visibleRange.interval=0===Math.floor(t.visibleRange.interval)?1:Math.floor(t.visibleRange.interval),t.triggerRangeRender(this.chart,t.visibleRange.min,t.visibleRange.max,t.visibleRange.interval))},fwe.prototype.calculateLogNiceInterval=function(e,t,i){for(var n=C0e(t,i),o=e,r=Math.pow(i.logBase,Math.floor(Bye(o,10))),s=0,a=i.intervalDivs.length;s<a;s++){var l=r*i.intervalDivs[s];if(n<e/l)break;o=l}return o},fwe.prototype.calculateVisibleLabels=function(e,t){var i,n,o=e.visibleRange.min,r=(e.visibleLabels=[],(e.zoomFactor<1||0<e.zoomPosition)&&(o=e.visibleRange.min-e.visibleRange.min%e.visibleRange.interval),this.getFormat(e)),s=null!==r.match("{value}"),a=Math.pow(e.logBase,e.visibleRange.min);for(e.format=t.intl.getNumberFormat({format:s?"":r,useGrouping:t.useGroupingSeparator,maximumFractionDigits:a<1?20:3}),e.startLabel=e.format(a<1?+a.toPrecision(1):a),e.endLabel=e.format(Math.pow(e.logBase,e.visibleRange.max));o<=e.visibleRange.max;o+=e.visibleRange.interval)i=Pe({},R("properties",e.labelStyle),null,!0),Rye(o,e.visibleRange)&&(n=Math.pow(e.logBase,o),v0e(this.chart,o,this.formatValue(e,s,r,n<1?+n.toPrecision(1):n),i,e));e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},fwe.prototype.getModuleName=function(){return"Logarithmic"},fwe.prototype.destroy=function(){};var uwe,gwe,mwe=fwe;function fwe(e){return gwe.call(this,e)||this}ywe=function(e,t){return(ywe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}ywe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(wwe,vwe=pwe),wwe.prototype.calculateRangeAndInterval=function(e,t){this.axisSize=e,this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t)},wwe.prototype.calculateVisibleLabels=function(e){e.visibleLabels=[];for(var t,i="BetweenTicks"===e.labelPlacement?.5:0,n=0,o="rangeNavigator"===this.chart.getModuleName(),r=(this.axisSize=o?this.chart.availableSize:this.axisSize,(o||this.chart.stockChart)&&e.labels.sort(function(e,t){return Number(e)-Number(t)}),"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:l0e(e.skeletonType),skeleton:this.getSkeleton(e,null,null,this.chart.isBlazor)}),!o&&this.chart.stockChart?1:0),s=e.interval||1;r<e.labels.length;r+=s)t=Pe({},R("properties",e.labelStyle),null,!0),this.chart.stockChart||o?"Auto"===e.intervalType?(!o&&1===r||this.StartOfWeek(e.labels.map(Number)[r],e.labels.map(Number)[r-1],e,r,n)||e.isIndexed)&&Rye(r,e.visibleRange)&&(v0e(this.chart,r,e.isIndexed?this.getIndexedAxisLabel(e.labels[r],e.format):e.format(new Date(e.labels.map(Number)[r])),t,e),n=r):(!o&&1===r||!this.sameInterval(e.labels.map(Number)[r],e.labels.map(Number)[r-1],e.actualIntervalType,r)||e.isIndexed)&&Rye(r,e.visibleRange)&&(!o&&1===r||this.isMaximum(r,n,e))&&(v0e(this.chart,r,e.isIndexed?this.getIndexedAxisLabel(e.labels[r],e.format):e.format(new Date(e.labels.map(Number)[r])),t,e),n=r):this.sameInterval(e.labels.map(Number)[r],e.labels.map(Number)[r-1],e.actualIntervalType,r)&&!e.isIndexed||Rye(r-i,e.visibleRange)&&v0e(this.chart,r,e.isIndexed?this.getIndexedAxisLabel(e.labels[r],e.format):e.format(new Date(e.labels.map(Number)[r])),t,e);e.startLabel=e.visibleLabels[0]?e.visibleLabels[0].text:"",e.endLabel=e.visibleLabels[e.visibleLabels.length-1]?e.visibleLabels[e.visibleLabels.length-1].text:"",e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},wwe.prototype.blazorCustomFormat=function(e){return this.chart.isBlazor&&"Years"===e.actualIntervalType?"yyyy":""},wwe.prototype.getIndexedAxisLabel=function(e,t){for(var i=e.split(","),n=0;n<i.length;n++)i[n]=t(new Date(parseInt(i[n],10)));return i.join(", ")},wwe.prototype.sameInterval=function(e,t,i,n){var o;if(0===n)o=!1;else switch(i){case"Years":o=new Date(e).getFullYear()===new Date(t).getFullYear();break;case"Quarter":o=new Date(e).getFullYear()===new Date(t).getFullYear()&&Math.floor(new Date(e).getMonth()/3)===Math.floor(new Date(t).getMonth()/3);break;case"Months":o=new Date(e).getFullYear()===new Date(t).getFullYear()&&new Date(e).getMonth()===new Date(t).getMonth();break;case"Weeks":o=new Date(e).getFullYear()===new Date(t).getFullYear()&&new Date(e).getMonth()===new Date(t).getMonth()&&Math.floor((new Date(e).getDate()-1)/7)===Math.floor((new Date(t).getDate()-1)/7);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},wwe.prototype.StartOfWeek=function(e,t,i,n,o){return 0===n||(!(30<=i.labels.length)||(t=new Date(t),e=new Date(e),t.setDate(t.getDate()-t.getDay()),e.setDate(e.getDate()-e.getDay()),!(t.getTime()===e.getTime())))&&this.isMaximum(n,o,i)},wwe.prototype.isMaximum=function(e,t,i){return 0===e||Yye(e,i)*i.rect.width-Yye(t,i)*i.rect.width>=(15<=i.labels.length?100:50)},wwe.prototype.getModuleName=function(){return"DateTimeCategory"},wwe.prototype.destroy=function(){};var ywe,vwe,bwe=wwe;function wwe(e){return vwe.call(this,e)||this}Swe.prototype.measureStripLine=function(e,t,i,n,o,r){var s,a,l=e.orientation,h="DateTime"===e.valueType,d=(n=t.isRepeat&&null!==t.size?(d=n,null):"DateTimeCategory"===e.valueType?(s=t.start,a=t.end,d=null!=s&&"number"!=typeof s?e.labels.indexOf(this.dateToMilliSeconds(s,r).toString()):s,null!=a&&"number"!=typeof a?e.labels.indexOf(this.dateToMilliSeconds(a,r).toString()):a):(d=null===t.start?null:h&&this.isCoreDate(t.start)?this.dateToMilliSeconds(t.start,r):+("Logarithmic"===e.valueType?Bye(t.start,e.logBase):t.start),null===t.end?null:h&&this.isCoreDate(t.start)?this.dateToMilliSeconds(t.end,r):+("Logarithmic"===e.valueType?Bye(t.end,e.logBase):t.end)),this.getFromTovalue(d,n,t.size,t.startFromAxis,e,t)),n="Vertical"===l?(d.to-d.from)*e.rect.height:i.height,p="Horizontal"===l?(d.to-d.from)*e.rect.width:i.width,c="Vertical"===l?i.x:d.from*e.rect.width+e.rect.x,l="Horizontal"===l?i.y:e.rect.y+e.rect.height-("Pixel"===t.sizeType?d.from:d.to)*e.rect.height;return t.isSegmented&&null!=t.segmentStart&&null!=t.segmentEnd&&"Pixel"!==t.sizeType&&(s=h&&this.isCoreDate(t.segmentStart)?this.dateToMilliSeconds(t.segmentStart,r):+t.segmentStart,a=h&&this.isCoreDate(t.segmentEnd)?this.dateToMilliSeconds(t.segmentEnd,r):+t.segmentEnd,i=this.getFromTovalue(s,a,null,null,o,t),"Vertical"===o.orientation?(l=o.rect.y+o.rect.height-i.to*o.rect.height,n=(i.to-i.from)*o.rect.height):(c=i.from*o.rect.width+o.rect.x,p=(i.to-i.from)*o.rect.width)),0!==n&&0!==p||"Pixel"===t.sizeType&&(null!==t.start||t.startFromAxis)?new Do(c,l,p,n):new Do(0,0,0,0)},Swe.prototype.getFromTovalue=function(e,t,i,n,o,r){var s=!r.isRepeat&&n?o.visibleRange.min:e,n=("Double"!==o.valueType||null===i||n||null!=r.start||(s+=i),this.getToValue(Math.max(e,je(t)?e:t),s,i,o,t,r)),s=this.findValue(s,o),n=this.findValue(n,o);return{from:Yye(o.isAxisInverse?n:s,o),to:Yye(o.isAxisInverse?s:n,o)}},Swe.prototype.getToValue=function(e,t,i,n,o,r){var s=r.sizeType,a=null===o;if("DateTime"!==n.valueType)return"Pixel"===r.sizeType?t:a?t+i:e;var l=new Date(t);switch("Auto"===s&&(s=n.actualIntervalType,i*=n.visibleRange.interval),s){case"Years":return a?new Date(l.setFullYear(l.getFullYear()+i)):e;case"Months":return a?new Date(l.setMonth(l.getMonth()+i)):e;case"Days":return a?new Date(l.setDate(l.getDate()+i)):e;case"Hours":return a?new Date(l.setHours(l.getHours()+i)):e;case"Minutes":return a?new Date(l.setMinutes(l.getMinutes()+i)):e;case"Seconds":return a?new Date(l.setSeconds(l.getSeconds()+i)):e;default:return t}},Swe.prototype.findValue=function(e,t){return e<t.visibleRange.min?e=t.visibleRange.min:e>t.visibleRange.max&&(e=t.visibleRange.max),e},Swe.prototype.dateParse=function(e,t){var i=t.intl.getDateParser({skeleton:"full",type:"dateTime"}),t=t.intl.getDateFormat({skeleton:"full",type:"dateTime"});return new Date(Date.parse(i(t(new Date(Sa.parse.parseJson({val:e}).val)))))},Swe.prototype.renderStripLine=function(e,t,i){var n,o,r=e.element.id+"_stripline_"+t+"_",s=e.chartAxisLayoutPanel.seriesClipRect,a=0,l=null,h=new vve(r+"ClipRect","transparent",{width:1,color:"Gray"},1,{x:s.x,y:s.y,width:s.width,height:s.height}),d=e.renderer.createGroup({id:r+"collections","clip-path":"url(#"+r+"ClipRect)"});e.enableCanvas||d.appendChild(y0e(e.redraw,h,e.renderer));for(var p=0,c=i;p<c.length;p++)for(var u=c[p],g=0,m=0,f=u.stripLines;m<f.length;m++){var y=f[m];if(y.visible&&y.zIndex===t)if(y.isSegmented&&null!=y.segmentStart&&null!=y.segmentEnd&&"Pixel"!==y.sizeType&&(l=this.getSegmentAxis(i,u,y)),y.isRepeat&&null!=y.repeatEvery&&null!==y.size&&"Pixel"!==y.sizeType)for(n=null!=y.repeatUntil?"DateTime"===u.valueType?this.dateToMilliSeconds(y.repeatUntil,e):+y.repeatUntil:u.actualRange.max,a="DateTime"===u.valueType&&this.isCoreDate(y.start)?this.dateToMilliSeconds(y.start,e):y.start,(y.startFromAxis&&"DateTime"===u.valueType&&"Auto"===y.sizeType||y.start<u.visibleRange.min)&&(a=u.visibleLabels[0]&&u.visibleLabels[0].value===u.visibleRange.min?u.visibleRange.min:u.visibleLabels[0]&&u.visibleLabels[0].value-("DateTime"===u.valueType?u.dateTimeInterval:u.visibleRange.interval)),a=y.startFromAxis&&"DateTime"!==u.valueType?u.visibleRange.min:a;a<n;)o=Rye(a+("DateTime"===u.valueType?u.dateTimeInterval*+y.size:y.size),u.visibleRange),(a>=u.visibleRange.min&&a<u.visibleRange.max||o)&&this.renderStripLineElement(u,y,s,r,d,e,a,l,g),g++,a=this.getStartValue(u,y,a);else this.renderStripLineElement(u,y,s,r,d,e,null,l,g),g++}O0e(e.enableCanvas,e.svgObject,d,e.redraw)},Swe.prototype.isCoreDate=function(e){return"string"==typeof e},Swe.prototype.dateToMilliSeconds=function(e,t){return this.dateParse(e,t).getTime()},Swe.prototype.renderPath=function(e,t,i,n,o,r){var s=ie(i),s=s?s.getAttribute("d"):"",a=e.size,l="Vertical"===r.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);"Pixel"!==e.sizeType&&(l="Vertical"===r.orientation?"M "+t.x+" "+(t.y+t.height/2)+" L "+(t.x+t.width)+" "+(t.y+t.height/2):"M "+(t.x+t.width/2)+" "+t.y+" L "+(t.x+t.width/2)+" "+(t.y+t.height),a="Vertical"===r.orientation?t.height:t.width),O0e(o.enableCanvas,n,o.renderer.drawPath(new No(i,"none",a,e.color,e.opacity,e.dashArray,l)),o.redraw,!0,"x","y",null,s,!0,null,null,o.duration)},Swe.prototype.renderRectangle=function(e,t,i,n,o){var r=ie(i),r=r?new Do(+r.getAttribute("x"),+r.getAttribute("y"),+r.getAttribute("width"),+r.getAttribute("height")):null;O0e(o.enableCanvas,n,o.renderer.drawRectangle(new vve(i,"none",e.border,e.opacity,t,0,0,"",e.border.dashArray)),o.redraw,!0,"x","y",null,null,!0,!0,r,o.duration)},Swe.prototype.drawImage=function(e,t,i,n,o){"Pixel"===e.sizeType&&(t.width=t.width||e.size,t.height=t.height||e.size);e=new Cve(t.height,t.width,e.imageUrl,t.x,t.y,i,"visible","none"),t=o.renderer.drawImage(e);O0e(o.enableCanvas,n,t,o.redraw,!0,"x","y",null,null,!0,!0)},Swe.prototype.renderText=function(e,t,i,n,o,r){var s=So(e.text,e.textStyle,o.themeStyle.stripLineLabelFont),a=null===e.rotation,l=a?s.height/8*3:0,h=t.y+t.height/2+l,d=a?"Vertical"===r.orientation?0:-90:e.rotation,p=t.x+t.width/2,c="Horizontal"===r.orientation?(p=this.getTextStart(p+l*this.factor(e.horizontalAlignment),t.width,e.horizontalAlignment),h=this.getTextStart(h-l,t.height,e.verticalAlignment)+("Start"!==e.verticalAlignment||a?0:s.height/4),c=a?this.invertAlignment(e.verticalAlignment):e.horizontalAlignment,p-s.width/2<r.rect.x?"Start":p+s.width/2>r.rect.width?"End":c):(p=this.getTextStart(p,t.width,e.horizontalAlignment),h=this.getTextStart(h+l*this.factor(e.verticalAlignment)-5,t.height,e.verticalAlignment),c=e.horizontalAlignment,o.enableRtl?"End"===c?"Start":"Start"===c?"End":c:c);sve(o.renderer,new ko(i,p,h,c,e.text,"rotate("+d+" "+p+","+h+")","middle"),e.textStyle,e.textStyle.color||o.themeStyle.stripLineLabelFont.color,n,null,null,null,null,null,null,0,null,o.enableCanvas,null,o.themeStyle.stripLineLabelFont)},Swe.prototype.invertAlignment=function(e){switch(e){case"Start":e="End";break;case"End":e="Start"}return e},Swe.prototype.getStartValue=function(e,t,i){return"DateTime"===e.valueType?this.getToValue(null,i,+t.repeatEvery,e,null,t):i+ +t.repeatEvery},Swe.prototype.getSegmentAxis=function(e,t,i){var n;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&&(n=e[o]);return n},Swe.prototype.renderStripLineElement=function(e,t,i,n,o,r,s,a,l){i=this.measureStripLine(e,t,i,s,a,r);t.imageUrl?this.drawImage(t,i,n+"rect_"+e.name+"_"+l,o,r):(this.renderPath(t,i,n+("Pixel"===t.sizeType?"path_":"rect_")+e.name+"_"+l,o,r,e),s=new Do("Horizontal"===e.orientation?i.x-t.size/2:i.x,"Vertical"===e.orientation?i.y-t.size/2:i.y,i.width||t.size,i.height||t.size),this.renderRectangle(t,"Pixel"===t.sizeType?s:i,n+"border_"+e.name+"_"+l,o,r)),""!==t.text&&this.renderText(t,i,n+"text_"+e.name+"_"+l,o,r,e)},Swe.prototype.factor=function(e){var t=0;switch(e){case"Start":t=1;break;case"End":t=-1}return t},Swe.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},Swe.prototype.getModuleName=function(){return"StripLine"},Swe.prototype.destroy=function(){};var Cwe=Swe;function Swe(){}xwe.prototype.enableComplexProperty=function(e){for(var t,i,n,o=[],r=[],s=e.xAxis.visibleRange,a=e.yAxis.visibleRange,l=e.points,h=e.clipRect,d=this.chart&&this.chart.zoomRedraw&&this.chart.redraw?this.previousX:Math.abs(s.delta/h.width),p=this.chart&&this.chart.zoomRedraw&&this.chart.redraw?this.previousY:Math.abs(a.delta/h.height),c=l[0]&&l[0].xValue>d?0:d,u=l[0]&&l[0].y>p?0:p,g=(this.previousX=d,this.previousY=p,0),m=l;g<m.length;g++){var f=m[g];f.symbolLocations=[],t=je(f.xValue)?s.min:f.xValue,i=je(f.yValue)?a.min:f.yValue,(Math.abs(c-t)>=d||Math.abs(u-i)>=p)&&(o.push(f),c=t,u=i)}for(var y=0;y<o.length;y++)je((n=o[y]).x)||"Indicator"===e.category&&(isNaN(n.xValue)||isNaN(n.yValue))||r.push(n);return r},xwe.prototype.getLineDirection=function(e,t,i,n,o,r){var s="";return null!=e&&(e=o(e.xValue,e.yValue,i.xAxis,i.yAxis,n,i),o=o(t.xValue,t.yValue,i.xAxis,i.yAxis,n,i),s=r+" "+e.x+" "+e.y+" L "+o.x+" "+o.y+" "),s},xwe.prototype.appendLinePath=function(e,t,i){i=this.appendPathElement(e,t,i);m0e(i.element,e.d,t.chart.redraw,i.previousDirection,i.chart.duration)},xwe.prototype.appendPathElement=function(e,t,i){var n=ie(e.id),o=t.chart,r=n?n.getAttribute("d"):null,e=t.chart.renderer.drawPath(e,new Int32Array([t.clipRect.x,t.clipRect.y]));return e&&e.setAttribute("clip-path",i),"TrendLine"===t.category&&e&&((i=o.series[t.sourceIndex].trendlines[t.index]).marker.visible||e.setAttribute("tabindex",i.accessibility.focusable?String(i.accessibility.tabIndex):"-1"),e.setAttribute("role",i.accessibility.accessibilityRole||""),e.setAttribute("aria-label",i.accessibility.accessibilityDescription||"")),t.pathElement=e,t.chart.enableCanvas||t.seriesElement.appendChild(e),t.isRectSeries=!1,{element:n,previousDirection:r,chart:o}},xwe.prototype.addPath=function(e,t,i){i=this.appendPathElement(e,t,i);if(""!==i.previousDirection&&""!==e.d){var n=i.previousDirection.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),o=e.d.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),r=Math.max(n.length,o.length),s=Math.min(n.length,o.length);if(n.length<o.length){for(var a=s;a<r;a++)o.length!==n.length&&n.push(n[n.length-1].replace("M","L"));f0e(i.element,e.d,t.chart.redraw,n.join(" "),this.chart.duration)}else if(n.length>o.length){for(a=s;a<r;a++)o.length!==n.length&&(t.removedPointIndex===t.points.length?o.push(o[o.length-1].replace("M","L")):o.splice(1,0,o[0].replace("M","L")));f0e(i.element,o.join(""),t.chart.redraw,i.previousDirection,this.chart.duration,e.d)}else f0e(i.element,e.d,t.chart.redraw,i.previousDirection,this.chart.duration)}},xwe.prototype.addAreaPath=function(e,t,i){i=this.appendPathElement(e,t,i);if(""!==i.previousDirection&&""!==e.d){var n=i.previousDirection.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),o=e.d.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),r=Math.max(n.length,o.length),s=Math.min(n.length,o.length);if(s<o.length){for(var a=s;a<r;a++)o.length!==n.length&&o.length!==n.length&&(1===n.length?n.push(n[n.length-(-1!==e.id.indexOf("border")?1:2)].replace("M","L")):n.splice(n.length-1,0,n[n.length-(-1!==e.id.indexOf("border")?1:2)]));f0e(i.element,e.d,t.chart.redraw,n.join(" "),this.chart.duration)}else if(n.length>o.length){for(a=s;a<r;a++)o.length!==n.length&&(t.removedPointIndex===t.points.length?1===o.length?o.push(o[o.length-(-1!==e.id.indexOf("border")?1:2)].replace("M","L")):o.splice(o.length-1,0,o[o.length-(-1!==e.id.indexOf("border")?1:2)]):o.splice(1,0,o[1]||o[0]));f0e(i.element,o.join(""),t.chart.redraw,i.previousDirection,this.chart.duration,e.d)}else f0e(i.element,e.d,t.chart.redraw,i.previousDirection,this.chart.duration)}},xwe.prototype.renderMarker=function(e){e.marker&&e.marker.visible&&e.chart.markerRender.render(e)},xwe.prototype.doProgressiveAnimation=function(t,e){var i,n=new Vt({}),o=t.pathElement,r=o.getAttribute("stroke-dasharray"),s=t.pathElement.getTotalLength();o.style.visibility="hidden",n.animate(o,{duration:0===e.duration&&"Enable"===Ut?1e3:e.duration,delay:e.delay,progress:function(e){o.style.visibility="visible",i=Math.abs(Math.round(e.timeStamp*s/e.duration)),o.setAttribute("stroke-dasharray",i+","+s)},end:function(){var e=ie(t.chart.element.id+"_Annotation_Collections");e&&(e.style.visibility="visible"),o.setAttribute("stroke-dasharray",r),o.style.visibility="",t.chart.trigger("animationComplete",{series:t.chart.isBlazor?{}:t})}})},xwe.prototype.storePointLocation=function(e,t,i,n){var o=t.marker&&t.marker.width?t.marker.width:0,r=t.marker&&t.marker.height?t.marker.height:0;e.symbolLocations.push(n(e.xValue,e.yValue,t.xAxis,t.yAxis,i,t)),e.regions.push(new Do(e.symbolLocations[0].x-o,e.symbolLocations[0].y-r,2*o,2*r))},xwe.prototype.withinYRange=function(e,t){return e.yValue>=t.visibleRange.min&&e.yValue<=t.visibleRange.max},xwe.prototype.GetStepLineDirection=function(e,t,i,n,o,r){void 0===n&&(n="L");var s=o.noRisers&&r?" M ":" L ";return"Right"===i?(n=o.noRisers&&r?"M":"L")+" "+t.x+" "+e.y+" L "+e.x+" "+e.y+" ":"Center"===i?n+" "+(o=t.x+(e.x-t.x)/2)+" "+t.y+s+o+" "+e.y+" L "+e.x+" "+e.y+" ":n+" "+e.x+" "+t.y+s+e.x+" "+e.y+" "},xwe.prototype.getFirstLastVisiblePoint=function(e){for(var t=null,i=null,n=0,o=e;n<o.length;n++){var r=o[n];null===t&&r.visible&&(t=i=r),i=r.visible?r:i}return{first:t||e[0],last:i||e[e.length-1]}},xwe.prototype.getBorderDirection=function(e){e=e.split(" ");return 3<e.length&&!this.chart.stackingAreaSeriesModule&&!this.chart.stackingStepAreaSeriesModule?e.splice(e.length-4,3):(this.chart.stackingAreaSeriesModule||this.chart.stackingStepAreaSeriesModule)&&(e.splice(e.length/2+1,e.length/2+1),"L"!==e[e.length-1]&&"M"!==e[e.length-1]||e.splice(e.length-1,1)),e.join(" ")},xwe.prototype.removeEmptyPointsBorder=function(e){var t,i=0,n=e.split(" ");if(4!==n.length)for(;-1<(t=n.indexOf("M",i))&&(n.splice(t+1,3),i=t+1,0<t-6)&&(n.splice(t-6,6),i-=6),-1!==t;);return n.join(" ")},xwe.prototype.doLinearAnimation=function(e,t){var i=e.clipRectElement.childNodes[0].childNodes[0],n=(e.chart.animated?e.chart:t).duration,o=p0e("Linear"),r=+i.getAttribute("height"),s=+i.getAttribute("width"),a=+i.getAttribute("x"),l=e.chart.requireInvertedAxis?+i.getAttribute("height")+ +i.getAttribute("y"):+i.getAttribute("y");i.style.visibility="hidden",this.animateRect(e,t,i,n,o,r,s,a,l,void 0),e.marker&&e.marker.visible&&e.symbolElement&&((i=e.symbolElement.childNodes[0].childNodes[0]).style.visibility="hidden",this.animateRect(e,t,i,n,o,r,s,a,l,void 0))},xwe.prototype.animateRect=function(t,e,i,n,o,r,s,a,l,h){new Vt({}).animate(i,{duration:0===n&&"Enable"===Ut?1e3:n,delay:e.delay,progress:function(e){i.style.visibility="visible",t.chart.requireInvertedAxis?(h=o(e.timeStamp,0,r,e.duration),i.setAttribute("transform","translate("+a+" "+l+") scale(1,"+h/r+") translate("+-a+" "+-l+")")):(h=o(e.timeStamp,0,s,e.duration),i.setAttribute("transform","translate("+a+" "+l+") scale("+h/s+", 1) translate("+-a+" "+-l+")"))},end:function(){var e=ie(t.chart.element.id+"_Annotation_Collections"),e=(e&&(e.style.visibility="visible"),document.getElementById(t.chart.element.id+"_StackLabelGroup"));e&&e.setAttribute("visibility","visible"),i.setAttribute("transform","translate(0,0)"),t.chart.trigger("animationComplete",{series:t.chart.isBlazor?{}:t})}})};var Awe=xwe;function xwe(e){this.chart=e}Iwe=function(e,t){return(Iwe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Iwe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Dwe,Twe=Awe),Dwe.prototype.render=function(e,t,i,n,o,r){for(var s,a="",l=null,h="M",d=e.chart&&"PolarRadar"===e.chart.chartAreaType,p=e.emptyPointSettings&&"Drop"===e.emptyPointSettings.mode,c=d?Xye:L0e,u="TrendLine"===e.category?e.points:this.enableComplexProperty(e),g=0,m=u;g<m.length;g++){var f=m[g];f.regions=[],f.symbolLocations=[],f.visible&&Nye(u[f.index-1],f,u[f.index+1],e)?(a+=this.getLineDirection(l,f,e,n,c,h),h=l?"L":h,this.storePointLocation(l=f,e,n,c),""===a&&1===u.length&&(a="M "+f.symbolLocations[0].x+" "+f.symbolLocations[0].y)):(l=p?l:null,h=p?h:"M")}d&&e.isClosed&&(s=c((d=this.getFirstLastVisiblePoint(u)).last.xValue,d.last.yValue,t,i,n,e),d=c(d.first.xValue,d.first.yValue,t,i,n,e),a=a.concat(h+" "+s.x+" "+s.y+" L "+d.x+" "+d.y));t="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),i=new No(t,"none",e.width,e.interior,e.opacity,e.dashArray,a);this[o?"addPath":"appendLinePath"](i,e,""),r||this.renderMarker(e)},Dwe.prototype.updateDirection=function(e,t){this.render(e,e.xAxis,e.yAxis,e.chart.requireInvertedAxis,!1,!0);for(var i=0;i<t.length;i++)e.marker&&e.marker.visible&&e.chart.markerRender.renderMarker(e,e.points[t[i]],e.points[t[i]].symbolLocations[0],null,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[i]],null,e.marker.dataLabel))},Dwe.prototype.doAnimation=function(e){var t=e.animation;this.doProgressiveAnimation(e,t)},Dwe.prototype.getModuleName=function(){return"LineSeries"},Dwe.prototype.destroy=function(){};var Iwe,Twe,Ewe=Dwe;function Dwe(){return null!==Twe&&Twe.apply(this,arguments)||this}kwe.prototype.getSideBySideInfo=function(e){var t,i,n,o,r,s;return e.isRectSeries=!0,(!e.chart.enableSideBySidePlacement||e.position)&&je(e.columnWidthInPixel)||this.getSideBySidePositions(e),e.columnWidthInPixel?new Pme(0,0):(r="Histogram"!==e.type&&e.chart.enableSideBySidePlacement?e.position:0,n="Histogram"!==e.type&&e.chart.enableSideBySidePlacement?e.rectCount:1,s=e.chart.visibleSeries,o=e.chart.enableSideBySidePlacement?e.columnSpacing:0,t=null===e.columnWidth||isNaN(+e.columnWidth)?"Histogram"===e.type?1:.7:Math.min(e.columnWidth,1),t=(s=d0e(e.xAxis,s))*t,r=new Pme(r=r/n-.5,r+1/n),isNaN(r.start)||isNaN(r.end)||(s=o*(r=e.groupName&&-1===e.type.indexOf("Stacking")?(i=.7,e.chart.series.filter(function(e){e.columnWidth>i&&(i=e.columnWidth)}),n=s*i,e=((o=new Pme(r.start*n,r.end*n)).delta-(r.end*t-r.start*t))/2,new Pme(o.start+e,o.end-e)):new Pme(r.start*t,r.end*t)).delta,r=new Pme(r.start+s/2,r.end-s/2)),r)},kwe.prototype.getRectangle=function(e,t,i,n,o){e=L0e(e,t,o.xAxis,o.yAxis,o.chart.requireInvertedAxis),t=L0e(i,n,o.xAxis,o.yAxis,o.chart.requireInvertedAxis);return new Do(Math.min(e.x,t.x),Math.min(e.y,t.y),Math.abs(t.x-e.x),Math.abs(t.y-e.y))},kwe.prototype.drawCylinder=function(e,O,t,i,n){var o=i.width,r=i.height;if(n.chart.enableCanvas){var s,a,l=n.chart.canvasRender.ctx,h=(l.save(),Y0e(e.fill)),d=i.x+n.clipRect.x,p=i.y+n.clipRect.y,N=2*Math.PI+.1,c=void 0,u=void 0,g=void 0,m=void 0,f=void 0,y=void 0,v=void 0,b=void 0,V=void 0,w=void 0,_=void 0,H=void 0,z=void 0,j=void 0,W=void 0,Q=void 0,U=void 0,q=0,C=0,S=0,A=0,G=0,x=(l.fillStyle=J0e(h,.9),l.lineWidth=0,l.strokeStyle=J0e(h,.9),l.globalAlpha=e.opacity,t.isColumn?(C=o+(q=d),m=g=d+(c=o/2),w=f=p-(u=c/4),v=(b=d)+o,y=V=p+r-u,W=Math.PI,Q=-c,U=u,t.stacking&&!t.isLastSeries&&(w=f=p+u)):(A=r+p,b=g=d+(c=(u=r/2)/4),v=m=d+o+c,V=(S=p)+r,y=f=(w=p)+u,G=Math.PI/2,W=1.5*Math.PI,t.stacking&&!t.isLastSeries&&(v=m=d+o-c),Q=c=-c,U=-(u=-u)),J0e(h,.7)),I=l.createLinearGradient(q,S,C,A);I.addColorStop(0,h),I.addColorStop(.3,x),I.addColorStop(.7,x),I.addColorStop(1,h);for(var T=1;T<=4;T++){var E=0;for(T<4&&l.beginPath(),j=T%2==0?(_=m,H=y,z=b,w):(_=g,H=f,z=v,V),4===T&&(c=Q,u=U,l.fillStyle=I),2<T&&(E=G,N=W);E<=N;E+=.1)s=_-c*Math.cos(E),a=H+u*Math.sin(E),0===E?l.moveTo(s,a):l.lineTo(s,a);2<T&&l.lineTo(z,j),3!==T&&(l.stroke(),l.fill())}0<=e.id.indexOf("Series")&&(l.clip(),l.restore())}else{var D=n.chart,d=i.x,p=i.y,M=e.id,q=h=e.fill,k=(X0e(h)||(h=Y0e(h)),0),P=0,S=0,C=0,A=0,x=0,B=void 0,F=void 0,i=void 0,L=void 0,R=void 0,Y=void 0,c=void 0,u=void 0,E=2;for(t.isColumn?(B=i=d,L=F=!((u=(c=o/2)/4)<p)&&t.stacking?p+u:p-u,k=2*c,C=!(u<p)&&!(r<2*u)&&t.stacking?r-2*u:r,R=B,Y=u<p?F+r:!(r<F)&&t.stacking?r+(p-u):r+F,A=100,t.stacking&&!t.isLastSeries&&(F=L=p+u,C=r<c/2?r:r-c/2)):(c=(u=r/2)/4,F=L=p,P=2*u,R=(B=i=Math.abs(d-c))+(S=o),Y=F,x=100,t.stacking&&!t.isLastSeries&&(R=B+o-2*c,S=o-2*c)),ue(this.element);E--;)e.d="M"+B.toString()+","+F.toString()+"a"+c.toString()+","+u.toString()+" 0 1,0 "+k.toString()+","+P.toString()+"a"+c.toString()+","+u.toString()+" 0 1,0 "+(-1*k).toString()+","+(-1*P).toString(),e.id=M+"_Region_"+E,e.fill=J0e(h,.9),E%2==0&&"StackingBar100"!==n.type&&"StackingBar"!==n.type&&"Bar"!==n.type&&(e.fill=e.fill+"10"),this.element=D.renderer.drawPath(this.options,new Int32Array([n.clipRect.x,n.clipRect.y])),O0e(n.chart.enableCanvas,n.seriesElement,this.element,D.redraw),B=R,F=Y;e.d="M"+i.toString()+","+L.toString()+"a"+c.toString()+","+u.toString()+" 0 1,0 "+k.toString()+","+P.toString()+"l"+S.toString()+" "+C.toString()+"a"+c.toString()+","+u.toString()+" 0 1,1 "+(-1*k).toString()+","+(-1*P).toString()+" z",e.id=M+"_Region_2",e.fill=J0e(h,.7);r=void 0;-1===q.indexOf("url")&&(document.getElementById(M)||(r={id:M,x1:"0%",y1:"0%",x2:A.toString()+"%",y2:x.toString()+"%"},p=[{colorStop:"0%",color:h},{colorStop:"30%",color:J0e(h,.7)},{colorStop:"70%",color:J0e(h,.7)},{colorStop:"100%",color:h}],this.drawGradient(r,p,n)),e.fill="url(#"+r.id+")"),this.element=D.renderer.drawPath(this.options,new Int32Array([n.clipRect.x,n.clipRect.y])),O0e(n.chart.enableCanvas,n.seriesElement,this.element,D.redraw)}},kwe.prototype.drawGradient=function(e,t,i){var n=i.chart.renderer.createDefs(),o="http://www.w3.org/2000/svg",r=document.createElementNS(o,"linearGradient");r.setAttribute("id",e.id),r.setAttribute("x1",e.x1),r.setAttribute("y1",e.y1),r.setAttribute("x2",e.x2),r.setAttribute("y2",e.y2);for(var s=0;s<t.length;s++){var a=document.createElementNS(o,"stop");a.setAttribute("offset",t[s].colorStop),a.setAttribute("stop-color",t[s].color),a.setAttribute("stop-opacity","1"),r.appendChild(a)}i.seriesElement.appendChild(n),n.appendChild(r)},kwe.prototype.getSideBySidePositions=function(e){for(var t=e.chart,i=0,n=t.columns;i<n.length;i++)for(var o=n[i],r=0,s=t.rows;r<s.length;r++){var a=s[r];this.findRectPosition(e.findSeriesCollection(o,a,!1))}},kwe.prototype.findRectPosition=function(e){for(var t,i=[],n={rectCount:0,position:null},o=0;o<e.length;o++)-1!==(r=e[o]).type.indexOf("Stacking")||""!==r.groupName?(t=-1!==r.type.indexOf("Stacking")?r.stackingGroup:r.type+r.groupName)?void 0===i[t]?(r.position=n.rectCount,i[t]=n.rectCount++):r.position=i[t]:null===n.position?(r.position=n.rectCount,n.position=n.rectCount++):r.position=n.position:r.position=n.rectCount++;for(var r,o=0;o<e.length;o++)(r=e[o]).rectCount=n.rectCount},kwe.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)},kwe.prototype.updateXRegion=function(e,t,i){e.symbolLocations.push({x:t.x+t.width/2,y:"BoxPlot"===i.seriesType||-1!==i.seriesType.indexOf("HighLow")||0<=e.yValue==!i.yAxis.isAxisInverse?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})},kwe.prototype.updateYRegion=function(e,t,i){e.symbolLocations.push({x:"BoxPlot"===i.seriesType||-1!==i.seriesType.indexOf("HighLow")||0<=e.yValue==!i.yAxis.isAxisInverse?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})},kwe.prototype.renderMarker=function(e){e.marker&&e.marker.visible&&e.chart.markerRender.render(e)},kwe.prototype.getRegion=function(e,t,i){var n;0===e.y?(n=i.marker&&i.marker.width?i.marker.width:0,i=i.marker&&i.marker.height?i.marker.height:0,e.regions.push(new Do(e.symbolLocations[0].x-n,e.symbolLocations[0].y-i,2*n,2*i))):e.regions.push(t)},kwe.prototype.triggerEvent=function(e,t,i,n){i={cancel:!1,name:jme,series:e,point:t,fill:e.setPointColor(t,i),border:e.setBorderColor(t,n),cornerRadius:e.cornerRadius};return e.chart.trigger(jme,i),t.color=i.fill,i},kwe.prototype.drawRectangle=function(e,t,i,n){var o,r,s,a=e.chart;if((a.requireInvertedAxis?i.height:i.width)<=0)return null;s=0===t.y?this.calculateRoundedRectPath(i,0,0,0,0):(r=o=h=l=void 0,s=t.y<0,r=a.requireInvertedAxis?(l=s?n.cornerRadius.topRight:n.cornerRadius.topLeft,h=s?n.cornerRadius.topLeft:n.cornerRadius.topRight,o=s?n.cornerRadius.bottomRight:n.cornerRadius.bottomLeft,s?n.cornerRadius.bottomLeft:n.cornerRadius.bottomRight):(l=s?n.cornerRadius.bottomLeft:n.cornerRadius.topLeft,h=s?n.cornerRadius.bottomRight:n.cornerRadius.topRight,o=s?n.cornerRadius.topLeft:n.cornerRadius.bottomLeft,s?n.cornerRadius.topRight:n.cornerRadius.bottomRight),this.calculateRoundedRectPath(i,l,h,o,r,a.requireInvertedAxis));var i="Indicator"===e.category?a.element.id+"_Indicator_"+e.index+"_"+e.name+"_Point_"+t.index:a.element.id+"_Series_"+e.index+"_Point_"+(null!==e.removedPointIndex&&e.removedPointIndex<=t.index?t.index+1:t.index),l=nve(a.redraw,i),h=l?l.getAttribute("d"):"";switch(this.options=new No(i,n.fill,n.border.width,n.border.color,e.opacity,e.border.dashArray,"Cylinder"===e.columnFacet?"":s),this.element=a.renderer.drawPath(this.options,new Int32Array([e.clipRect.x,e.clipRect.y])),null!==e.removedPointIndex&&e.removedPointIndex<=t.index&&(this.element.id=a.element.id+"_Series_"+e.index+"_Point_"+t.index),e.seriesType){case"XY":this.element.setAttribute("role","img"),this.element.setAttribute("aria-label",e.accessibility.accessibilityDescriptionFormat?e.formatAccessibilityDescription(t,e):t.x+":"+t.yValue+", "+e.name);break;case"HighLow":this.element.setAttribute("role","img"),this.element.setAttribute("aria-label",e.accessibility.accessibilityDescriptionFormat?e.formatAccessibilityDescription(t,e):t.x+":"+t.high+", "+t.low+", "+e.name)}"Cylinder"===e.columnFacet&&(a.redraw||!a.enableAnimation)&&e.seriesElement.querySelector("#"+this.element.id)||O0e(e.chart.enableCanvas,e.seriesElement,this.element,a.redraw),e.chart.enableCanvas||m0e(this.element,"Cylinder"===e.columnFacet?"":s,a.redraw,h,a.duration)},kwe.prototype.animate=function(e){for(var t=e.seriesElement.childNodes,i="Indicator"===e.category?0:1,n=0,o=Dye(e);n<o.length;n++){var r=o[n];if(r.symbolLocations.length||"BoxAndWhisker"===e.type&&r.regions.length)if("Column"!==e.type&&"Bar"!==e.type&&"StackingColumn"!==e.type&&"StackingColumn100"!==e.type&&"StackingBar"!==e.type&&"StackingBar100"!==e.type||"Cylinder"!==e.columnFacet)this.animateRect(t[i],e,r),i++;else for(var s=0;s<t.length;s++)this.animateRect(t[s],e,r)}},kwe.prototype.animateRect=function(n,o,r){var e,t,i,s,a,l=o.animation,h=(o.chart.animated?o.chart:l).duration,d=p0e("Linear"),p=r.yValue<0,c=+r.regions[0].height,u=+r.regions[0].width;o.chart.requireInvertedAxis?(t=+r.regions[0].y,-1<o.type.indexOf("Stacking")?(e=Yye(0,o.yAxis)*o.yAxis.rect.width,i=e,s=t):(e=+r.regions[0].x,s=p?t:t+c,i=-1!==o.seriesType.indexOf("HighLow")||-1!==o.type.indexOf("Waterfall")?e+u/2:p!==o.yAxis.isAxisInverse?e+u:e)):(e=+r.regions[0].x,-1<o.type.indexOf("Stacking")?(t=(1-Yye(0,o.yAxis))*o.yAxis.rect.height,i=e,s=t):(t=+r.regions[0].y,s=-1!==o.seriesType.indexOf("HighLow")||-1!==o.type.indexOf("Waterfall")?t+c/2:p!==o.yAxis.isAxisInverse?t:t+c,i=p?e:e+u)),je(n)||(n.style.visibility="hidden",new Vt({}).animate(n,{duration:0===h&&"Enable"===Ut?1e3:h,delay:l.delay,progress:function(e){e.timeStamp>=e.delay&&(n.style.visibility="visible",o.chart.requireInvertedAxis?(u=u||1,a=d(e.timeStamp-e.delay,0,u,e.duration),n.setAttribute("transform","translate("+i+" "+s+") scale("+a/u+", 1) translate("+-i+" "+-s+")")):(c=c||1,a=d(e.timeStamp-e.delay,0,c,e.duration),n.setAttribute("transform","translate("+i+" "+s+") scale(1,"+a/c+") translate("+-i+" "+-s+")")))},end:function(){var e=document.getElementById(o.chart.element.id+"_Annotation_Collections"),e=(e&&(e.style.visibility="visible"),document.getElementById(o.chart.element.id+"_StackLabelGroup")),e=(e&&e.setAttribute("visibility","visible"),n.setAttribute("transform","translate(0,0)"),o.seriesElement);if((n===e.lastElementChild||r.index===o.points.length-1||"Waterfall"===o.type&&n===e.children[e.childElementCount-2])&&(o.chart.trigger("animationComplete",{series:o.chart.isBlazor?{}:o}),"Waterfall"===o.type))for(var t=e.childNodes,i=0;i<t.length;i++)-1!==t[i].id.indexOf("Connector")&&(t[i].style.visibility="visible",t[i].setAttribute("transform","translate(0,0)"))}}))},kwe.prototype.calculateRoundedRectPath=function(e,t,i,n,o,r){r=(r=void 0===r?!1:r)?e.width/2:e.height/2;return t=Math.min(t,r),i=Math.min(i,r),n=Math.min(n,r),o=Math.min(o,r),"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+n)+" "+(e.y+e.height)+" Q "+e.x+" "+(e.y+e.height)+" "+e.x+" "+(e.y+e.height-n)+" L "+e.x+" "+(t+e.y)+" Z"};var Mwe=kwe;function kwe(){}Pwe=function(e,t){return(Pwe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Pwe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Lwe,Bwe=Mwe),Lwe.prototype.render=function(e){this.sideBySideInfo[e.index]=this.getSideBySideInfo(e);for(var t=Math.max(e.yAxis.visibleRange.min,0),i=0,n=e.points;i<n.length;i++){var o=n[i];this.renderPoint(e,o,this.sideBySideInfo[e.index],t)}this.renderMarker(e)},Lwe.prototype.renderPoint=function(e,t,i,n){var o,r;t.symbolLocations=[],t.regions=[],t.visible&&Nye(e.points[t.index-1],t,e.points[t.index+1],e)&&(this.rect=this.getRectangle(t.xValue+i.start,t.yValue,t.xValue+i.end,n,e),this.rect.width=e.columnWidthInPixel?e.columnWidthInPixel-(e.chart.enableSideBySidePlacement?e.columnWidthInPixel*e.columnSpacing:0):this.rect.width,this.rect.x=e.columnWidthInPixel?this.rect.x-(e.columnWidthInPixel/2*e.rectCount-e.columnWidthInPixel*e.index):this.rect.x,o="Indicator"===e.category?t.color:e.interior,(o=this.triggerEvent(e,t,o,{width:e.border.width,color:e.border.color})).cancel||(r=this.rect.y,t.yValue<n&&0<=t.yValue&&e.chart.zoomModule&&e.chart.zoomModule.isAxisZoomed(e.chart.axisCollections)&&(r=L0e(t.xValue+i.start,t.yValue,e.xAxis,e.yAxis,e.chart.requireInvertedAxis).y),this.updateSymbolLocation(t,new Do(this.rect.x,r,this.rect.width,this.rect.height),e),this.drawRectangle(e,t,this.rect,o),"Cylinder"===e.columnFacet&&this.drawCylinder(this.options,this.element,{isColumn:!0,stacking:!1,isLastSeries:!0},this.rect,e)))},Lwe.prototype.updateDirection=function(e,t){for(var i=Math.max(e.yAxis.visibleRange.min,0),n=0;n<t.length;n++)this.renderPoint(e,e.points[t[n]],this.sideBySideInfo[e.index],i),e.marker&&e.marker.visible&&e.chart.markerRender.renderMarker(e,e.points[t[n]],e.points[t[n]].symbolLocations[0],null,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[n]],null,e.marker.dataLabel))},Lwe.prototype.doAnimation=function(e){this.animate(e)},Lwe.prototype.getModuleName=function(){return"ColumnSeries"},Lwe.prototype.destroy=function(){};var Pwe,Bwe,Fwe=Lwe;function Lwe(){var e=null!==Bwe&&Bwe.apply(this,arguments)||this;return e.sideBySideInfo=[],e}Rwe=function(e,t){return(Rwe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Rwe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Vwe,Owe=Awe),Vwe.prototype.getAreaPathDirection=function(e,t,i,n,o,r,s){var a="";return null===r&&(a+=s+" "+(r=o(e,t,i.xAxis,i.yAxis,n,i)).x+" "+r.y+" "),a},Vwe.prototype.getAreaEmptyDirection=function(e,t,i,n,o){var r="";return(r+=this.getAreaPathDirection(e.x,e.y,i,n,o,null,"L"))+this.getAreaPathDirection(t.x,t.y,i,n,o,null,"L")},Vwe.prototype.setPointColor=function(e,t,i,n,o){if(""!==i.pointColorMapping)return!!t&&i.setPointColor(e,i.interior)!==i.setPointColor(t,i.interior);for(var r,s=0;s<o.length;s++)if(r=o[s],(n?e.xValue:e.yValue)<=this.getAxisValue(r.value,n?i.xAxis:i.yAxis,i.chart)||!r.value&&0!==r.value){e.interior=r.color;break}return null==e.interior&&(e.interior=i.interior),!1},Vwe.prototype.sortSegments=function(i,e){var n=this,o="X"===i.segmentAxis?i.xAxis:i.yAxis;return[].concat(e).sort(function(e,t){return n.getAxisValue(e.value,o,i.chart)-n.getAxisValue(t.value,o,i.chart)})},Vwe.prototype.applySegmentAxis=function(i,e,n,o){var r=this;if(""!==i.pointColorMapping)return e.map(function(e){r[o?"addMulticolorPath":"appendLinePath"](e,i,"")}),null;for(var s,a,l,h,d="X"===i.segmentAxis,p=d?i.xAxis:i.yAxis,c=i.chart,t=(this.includeSegment(n,p,i,n.length),n.length),u=0,g=this,m=0;m<t;m++)!function(t){s=n[t],a=g.getAxisValue(s.value,p,i.chart),(l=g.createClipRect(t?g.getAxisValue(n[t-1].value,p,i.chart):p.visibleRange.min,a,i,t,d))&&e.map(function(e){u+=1,h={"clip-path":l,"stroke-dasharray":s.dashArray,opacity:e.opacity,stroke:-1<i.type.indexOf("Line")?s.color||i.interior:e.stroke,"stroke-width":e["stroke-width"],fill:-1<i.type.indexOf("Line")?"none":s.color||i.interior,id:e.id+"_Segment_"+t,d:e.d},u%2==0&&r.chart.multiColoredAreaSeriesModule&&"transparent"!==i.border.color&&0!==h["stroke-width"]&&(h.fill="transparent"),o?r.addMulticolorPath(h,i,"",!0):m0e(ie(h.id),h.d,c.redraw),i.pathElement=c.renderer.drawPath(h),i.chart.enableCanvas||o||i.seriesElement.appendChild(c.renderer.drawPath(h))})}(m)},Vwe.prototype.includeSegment=function(e,t,i,n){if(n<=0)return e.push({value:t.visibleRange.max,color:i.interior}),null;this.getAxisValue(e[n-1].value,t,i.chart)<t.visibleRange.max&&e.push({value:t.visibleRange.max,color:i.interior})},Vwe.prototype.addMulticolorPath=function(e,t,i,n){i=this.appendPathElement(e,t,i);if(null!==i.previousDirection&&""!==i.previousDirection||(i.previousDirection="M "+e.d.split(" ").slice(-3)[0]+" "+e.d.split(" ").slice(-5)[0]+" L "+e.d.split(" ").slice(-3)[0]+" "+e.d.split(" ").slice(-5)[0]+" L "+e.d.split(" ").slice(-3)[0]+" "+e.d.split(" ").slice(-5)[0]),null!==e.d&&""!==e.d||(e.d="M "+i.previousDirection.split(" ").slice(-3)[0]+" "+i.previousDirection.split(" ").slice(-5)[0]+" L "+i.previousDirection.split(" ").slice(-3)[0]+" "+i.previousDirection.split(" ").slice(-5)[0]),n){var o=i.previousDirection.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),r=e.d.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),s=Math.max(o.length,r.length),n=Math.min(o.length,r.length);if(o.length===r.length&&f0e(ie(e.id),e.d,t.chart.redraw,i.previousDirection,this.chart.duration),o.length<r.length){for(var a=n;a<s;a++)r.length!==o.length&&o.splice(o.length-(-1!==t.type.indexOf("Line")?1:2),0,o[o.length-(-1!==t.type.indexOf("Line")?1:2)]);f0e(ie(e.id),e.d,t.chart.redraw,o.join(" "),this.chart.duration)}if(o.length>r.length){for(a=n;a<s;a++)r.length!==o.length&&r.splice(1,0,r[1].replace("M","L"));f0e(i.element,r.join(""),t.chart.redraw,o.join(""),this.chart.duration,e.d)}}},Vwe.prototype.createClipRect=function(e,t,i,n,o){var r=i.chart.requireInvertedAxis,s=L0e(o?e:i.xAxis.visibleRange.min,o?i.yAxis.visibleRange.max:t,i.xAxis,i.yAxis,r),t=L0e(o?t:i.xAxis.visibleRange.max,o?i.yAxis.visibleRange.min:e,i.xAxis,i.yAxis,r),t=r?[s,s=t][0]:t;return(i.xAxis.isInversed||i.xAxis.isAxisInverse?0<s.x-t.x:0<t.x-s.x)&&(i.yAxis.isInversed?0<s.y-t.y:0<t.y-s.y)?(o=new vve(i.chart.element.id+"_ChartSegment"+i.index+"ClipRect_"+n,"transparent",{width:1,color:"Gray"},1,{x:(i.xAxis.isInversed||i.xAxis.isAxisInverse?t:s).x,y:(i.yAxis.isInversed?t:s).y,width:i.xAxis.isInversed||i.xAxis.isAxisInverse?s.x-t.x:t.x-s.x,height:i.yAxis.isInversed?s.y-t.y:t.y-s.y}),i.chart.enableCanvas||i.seriesElement.appendChild(y0e(i.chart.redraw,o,i.chart.renderer)),"url(#"+i.chart.element.id+"_ChartSegment"+i.index+"ClipRect_"+n+")"):null},Vwe.prototype.getAxisValue=function(e,t,i){var n;return null===e&&(e=t.visibleRange.max),"DateTime"===t.valueType?(n={skeleton:"full",type:"dateTime"},Date.parse(i.intl.getDateParser(n)(i.intl.getDateFormat(n)(new Date(Sa.parse.parseJson({val:e}).val))))):!(-1<t.valueType.indexOf("Category"))||(i="DateTimeCategory"===t.valueType?e.getTime().toString():e,t.labels.indexOf(i)<0)?+e:t.labels.indexOf(i)};var Rwe,Owe,Nwe=Vwe;function Vwe(){return null!==Owe&&Owe.apply(this,arguments)||this}_we=function(e,t){return(_we=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}_we(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(jwe,Hwe=Nwe),jwe.prototype.render=function(e,t,i,n,o,r){for(var s,a,l,h,d=null,p="",c=e.chart&&"PolarRadar"===e.chart.chartAreaType,u=Math.max(e.yAxis.visibleRange.min,0),g=(c&&(u=this.getFirstLastVisiblePoint(e.points).first.yValue),e.emptyPointSettings&&"Drop"===e.emptyPointSettings.mode),m=e.border.width||0,f=e.border.color||e.interior,y="PolarRadar"===e.chart.chartAreaType?Xye:L0e,v=this.enableComplexProperty(e),b=0;b<v.length;b++)s=(a=v[b]).xValue,a.symbolLocations=[],a.regions=[],a.visible&&Nye(v[b-1],a,v[b+1],e)&&(p+=this.getAreaPathDirection(s,u,e,n,y,d,"M"),d=d||new Tve(s,u),p+=this.getAreaPathDirection(s,a.yValue,e,n,y,null,"L"),!v[b+1]||v[b+1].visible||c&&!this.withinYRange(v[b+1],i)||g||(p+=this.getAreaEmptyDirection({x:s,y:u},d,e,n,y),d=null),this.storePointLocation(a,e,n,y));c&&""!==p&&(l="",h=this.chart,l+=this.getAreaPathDirection(0,u,e,n,y,null,"L"),(t.isAxisInverse||i.isAxisInverse)&&(p+="Polar"===e.type?h.polarSeriesModule.getPolarIsInversedPath(t,l):h.radarSeriesModule.getRadarIsInversedPath(t,l)),p=p.concat(p+" Z")),this[o?"addAreaPath":"appendLinePath"](new No(e.chart.element.id+"_Series_"+e.index,e.interior,0,"transparent",e.opacity,e.dashArray,""!==p?p+this.getAreaPathDirection(e.points[e.points.length-1].xValue,"PolarRadar"===e.chart.chartAreaType?e.points[e.points.length-1].yValue:u,e,n,y,null,"L"):""),e,""),0!==e.border.width&&(h=this.removeEmptyPointsBorder(p),this[o?"addAreaPath":"appendLinePath"](new No(e.chart.element.id+"_Series_border_"+e.index,"transparent",m,f,1,e.border.dashArray,h),e,"")),r||this.renderMarker(e)},jwe.prototype.updateDirection=function(e,t){this.render(e,e.xAxis,e.yAxis,e.chart.requireInvertedAxis,!1,!0);for(var i=0;i<t.length;i++)e.marker&&e.marker.visible&&e.chart.markerRender.renderMarker(e,e.points[t[i]],e.points[t[i]].symbolLocations[0],null,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[i]],null,e.marker.dataLabel))},jwe.prototype.destroy=function(){},jwe.prototype.getModuleName=function(){return"AreaSeries"},jwe.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)};var _we,Hwe,zwe=jwe;function jwe(){return null!==Hwe&&Hwe.apply(this,arguments)||this}Wwe=function(e,t){return(Wwe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Wwe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(qwe,Qwe=Mwe),qwe.prototype.render=function(e){var t=Math.max(e.yAxis.visibleRange.min,0);this.sideBySideInfo[e.index]=this.getSideBySideInfo(e);for(var i=0,n=e.points;i<n.length;i++){var o=n[i];this.renderPoint(e,o,this.sideBySideInfo[e.index],t)}this.renderMarker(e)},qwe.prototype.renderPoint=function(e,t,i,n){t.symbolLocations=[],t.regions=[],t.visible&&Nye(e.points[t.index-1],t,e.points[t.index+1],e)&&(this.rect=this.getRectangle(t.xValue+i.start,t.yValue,t.xValue+i.end,n,e),this.rect.height=e.columnWidthInPixel||this.rect.height,this.rect.y=e.columnWidthInPixel?this.rect.y-(e.columnWidthInPixel/2*e.rectCount-e.columnWidthInPixel*e.index):this.rect.y,(i=this.triggerEvent(e,t,e.interior,{width:e.border.width,color:e.border.color})).cancel||(this.updateSymbolLocation(t,this.rect,e),this.drawRectangle(e,t,this.rect,i),"Cylinder"===e.columnFacet&&this.drawCylinder(this.options,this.element,{isColumn:!1,stacking:!1,isLastSeries:!0},this.rect,e)))},qwe.prototype.updateDirection=function(e,t){for(var i=Math.max(e.yAxis.visibleRange.min,0),n=0;n<t.length;n++)this.renderPoint(e,e.points[t[n]],this.sideBySideInfo[e.index],i),e.marker&&e.marker.visible&&e.chart.markerRender.renderMarker(e,e.points[t[n]],e.points[t[n]].symbolLocations[0],null,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[n]],null,e.marker.dataLabel))},qwe.prototype.doAnimation=function(e){this.animate(e)},qwe.prototype.destroy=function(){},qwe.prototype.getModuleName=function(){return"BarSeries"};var Wwe,Qwe,Uwe=qwe;function qwe(){var e=null!==Qwe&&Qwe.apply(this,arguments)||this;return e.sideBySideInfo=[],e}Gwe=function(e,t){return(Gwe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Gwe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Kwe,Ywe=Awe),Kwe.prototype.measureAxis=function(e){var t=this.chart;this.initialClipRect=e,this.seriesClipRect=new Do(e.x,e.y,e.width,e.height),this.measureRowAxis(t,this.initialClipRect),this.measureColumnAxis(t,this.initialClipRect),this.calculateAxisSize()},Kwe.prototype.measureRowAxis=function(e,t){this.calculateRowSize(t);t=e.rows[0];this.measureDefinition(t,e,new Eo(e.availableSize.width,t.computedHeight))},Kwe.prototype.measureColumnAxis=function(e,t){this.calculateColumnSize(t);t=e.columns[0];this.measureDefinition(t,e,new Eo(t.computedWidth,e.availableSize.height))},Kwe.prototype.measureDefinition=function(e,t,i){for(var n=0,o=e.axes;n<o.length;n++){var r=o[n];r.getModule(t),r.baseModule.calculateRangeAndInterval(i,r)}},Kwe.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},Kwe.prototype.measure=function(){var e=this.chart,t=e.primaryYAxis,i=(t.isRTLEnabled=e.enableRtl,t.setIsInversedAndOpposedPosition(!0),e.verticalAxes.push(t),e.rows[0]),t=(i.axes[0]=t,e.rows[0]=i,e.primaryXAxis),i=(t.isRTLEnabled=e.enableRtl,t.setIsInversedAndOpposedPosition(!0),e.horizontalAxes.push(t),e.columns[0]);i.axes[0]=t,e.columns[0]=i},Kwe.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},Kwe.prototype.calculateColumnSize=function(e){var t=this.chart,i=t.columns[0];i.computedLeft=e.x,i.computedWidth=e.width,t.columns[0]=i},Kwe.prototype.renderAxes=function(){for(var e,t=this.chart,i=(this.startAngle=t.primaryXAxis.startAngle,t.renderer.createGroup({id:t.element.id+"AxisCollection"})),n=t.renderer.createGroup({id:t.element.id+"AxisOutsideCollection"}),o=0,r=t.axisCollections.length;o<r;o++)this.element=t.renderer.createGroup({id:t.element.id+"AxisGroup"+o}),"Horizontal"===(e=t.axisCollections[o]).orientation?((0<e.majorGridLines.width||0<e.majorTickLines.width)&&this.drawXAxisGridLine(e,o),e.visible&&e.internalVisibility&&this.drawXAxisLabels(e,o)):(this.drawYAxisGridLine(e,o),0<e.lineStyle.width&&this.drawYAxisLine(e,o),e.visible&&e.internalVisibility&&this.drawYAxisLabels(e,o)),this.chart.enableCanvas||i.appendChild(this.element);return this.chart.enableCanvas||i.appendChild(this.element),O0e(t.enableCanvas,t.svgObject,i,t.redraw),n},Kwe.prototype.drawYAxisLine=function(e,t){var i=this.chart,n=Jye(Zye(e.visibleLabels[0].value,e),this.startAngle),n="M "+this.centerX+" "+this.centerY+"L "+(this.centerX+i.radius*n.x)+" "+(this.centerY+i.radius*n.y),t={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},n=i.renderer.drawPath(t);this.setPointerEventNone(n),this.chart.enableCanvas||i.yAxisElements.appendChild(n)},Kwe.prototype.drawYAxisLabels=function(e,t){for(var i,n,o,r,s=this.chart,a=this.startAngle<0?this.startAngle+360:this.startAngle,l=[],h=[],d=(h[0]=!0,e.labelIntersectAction),p=s.renderer.createGroup({id:s.element.id+"AxisLabels"+t}),c=Jye(Zye(e.visibleLabels[0].value,e),this.startAngle),u=0,g=e.visibleLabels.length;u<g;u++){if(r=!1,s.radius,Yye(e.visibleLabels[u].value,e),i=e.visibleLabels[u].size,o=s.radius*Yye(e.visibleLabels[u].value,e),n=this.centerX+o*c.x+(e.majorTickLines.height+i.width/2+2.5)*Math.cos(a*Math.PI/180)*(("Inside"!==e.labelPosition||!s.enableRtl)&&("Inside"===e.labelPosition||"Outside"===e.labelPosition&&s.enableRtl)?1:-1),o=this.centerY+o*c.y+(e.majorTickLines.height+i.height/2)*Math.sin(a*Math.PI/180)*(("Inside"!==e.labelPosition||!s.enableRtl)&&("Inside"===e.labelPosition||"Outside"===e.labelPosition&&s.enableRtl)?1:-1),o+=i.height/4,l[u]=this.getLabelRegion(n,o,e.visibleLabels[u],"middle"),0!==u&&"Hide"===d){for(var m=u;0<=m;m--){if(h[m=0===m?0:m===u?m-1:m]&&j0e(l[u],l[m])){h[u]=!(r=!0);break}h[u]=!0}if(r)continue;for(var f=0,y=this.visibleAxisLabelRect;f<y.length;f++){var v=y[f];if(j0e(l[u],v)){r=!0;break}}}r||(this.visibleAxisLabelRect.push(l[u]),i=new ko(s.element.id+t+"_AxisLabel_"+u,n,o,"middle",e.visibleLabels[u].text),sve(s.renderer,i,e.labelStyle,e.labelStyle.color||s.themeStyle.axisLabelFont.color,p,!1,s.redraw,!0,!0,null,null,0,null,s.enableCanvas,null,s.themeStyle.axisLabelFont))}this.chart.enableCanvas||s.yAxisElements.appendChild(p)},Kwe.prototype.drawYAxisGridLine=function(e,t){var i,n,o,r,s,a,l,h,d,p=this.chart,c="",u=this.startAngle<0?this.startAngle+360:this.startAngle,g={color:e.majorGridLines.color||p.themeStyle.majorGridLine,width:e.majorGridLines.width};if(0<e.majorGridLines.width)if("Polar"===p.visibleSeries[0].type){for(var m=0;m<e.visibleLabels.length;m++)l=(h=ie(p.element.id+"_MajorGridLine_"+t+"_"+m))?h.getAttribute("r"):null,n=p.radius*Yye(e.visibleLabels[m].value,e),e.isInversed&&!d&&(d=n),i=new Sve(p.element.id+"_MajorGridLine_"+t+"_"+m,"transparent",g,e.majorGridLines.width,this.centerX,this.centerY,n),O0e(p.enableCanvas,this.element,p.renderer.drawCircle(i),p.redraw,!0,"r","r",new Tve(+l,+l),null,!0);n===p.radius||e.isInversed&&d===p.radius||(i=new Sve(p.element.id+"_MajorGridLine_"+t+"_"+e.visibleLabels.length+1,"transparent",g,e.majorGridLines.width,this.centerX,this.centerY,p.radius),O0e(p.enableCanvas,this.element,p.renderer.drawCircle(i),p.redraw,!0,"r","r",new Tve(+l,+l),null,!0))}else{for(m=0;m<e.visibleLabels.length;m++)n=p.radius*Yye(e.visibleLabels[m].value,e),c=this.renderRadarGrid(n,"",p),l=(h=ie(p.element.id+"_MajorGridLine_"+t+"_"+m))?h.getAttribute("d"):null,i=new No(p.element.id+"_MajorGridLine_"+t+"_"+m,"transparent",e.majorGridLines.width,e.majorGridLines.color||p.themeStyle.majorGridLine,null,null,c),O0e(p.enableCanvas,this.element,p.renderer.drawPath(i),p.redraw,!0,"x","y",null,l,!0);n!==p.radius&&(c=this.renderRadarGrid(p.radius,"",p),l=(h=ie(p.element.id+"_MajorGridLine_"+t+"_"+e.visibleLabels.length))?h.getAttribute("d"):null,i=new No(p.element.id+"_MajorGridLine_"+t+"_"+e.visibleLabels.length,"transparent",e.majorGridLines.width,e.majorGridLines.color||p.themeStyle.majorGridLine,null,null,c),O0e(p.enableCanvas,this.element,p.renderer.drawPath(i),p.redraw,!0,"x","y",null,l,!0))}if(0<e.majorTickLines.width)for(var f=Jye(Zye(e.visibleLabels[0].value,e),this.startAngle),y=0;y<e.visibleLabels.length;y++)n=p.radius*Yye(e.visibleLabels[y].value,e),o=this.centerX+n*f.x,r=this.centerY+n*f.y,s=o+e.majorTickLines.height*Math.cos(u*Math.PI/180)*(("Inside"!==e.tickPosition||!p.enableRtl)&&("Inside"===e.tickPosition||"Outside"===e.tickPosition&&p.enableRtl)?1:-1),a=r+e.majorTickLines.height*Math.sin(u*Math.PI/180)*(("Inside"!==e.tickPosition||!p.enableRtl)&&("Inside"===e.tickPosition||"Outside"===e.tickPosition&&p.enableRtl)?1:-1),this.renderTickLine(e,t,"M "+o+" "+r+" L "+s+" "+a,"",y)},Kwe.prototype.renderRadarGrid=function(e,t,i){for(var n,o,r,s,a=0,l=i.primaryXAxis.visibleLabels.length;a<l;a++)o=Jye(Zye(i.primaryXAxis.visibleLabels[a].value,i.primaryXAxis),this.startAngle),s=Jye(Zye((a+1<l?i.primaryXAxis.visibleLabels[a+1]:i.primaryXAxis.visibleLabels[0]).value,i.primaryXAxis),this.startAngle),n=this.centerX+e*o.x,o=this.centerY+e*o.y,r=this.centerX+e*s.x,s=this.centerY+e*s.y,t=t.concat((a?"L ":"M ")+n+" "+o+" L "+r+" "+s+" ");return t},Kwe.prototype.drawXAxisGridLine=function(e,t){for(var i=this.chart,n="",o="",r=this.centerX,s=this.centerY,a=e.visibleLabels.length,l=0;l<a;l++){var h,d=e.visibleLabels[l].value,p=Jye(Zye(e.visibleLabels[l].value,e),this.startAngle),c="M "+r+" "+s+" L "+(u=this.centerX+i.radius*p.x)+" "+(h=this.centerY+i.radius*p.y),u="M "+u+" "+h+" L "+(u+e.majorTickLines.height*p.x*("Inside"===e.tickPosition?-1:1))+" "+(h+e.majorTickLines.height*p.y*("Inside"===e.tickPosition?-1:1));0<e.minorTicksPerInterval&&(0<e.minorGridLines.width||0<e.minorTickLines.width)&&"Category"!==e.valueType&&"Radar"!==i.visibleSeries[0].type&&(n=(h=this.drawAxisMinorLine(e,d,n,o))[0],o=h[1]),this.renderTickLine(e,t,u,o,l),this.renderGridLine(e,t,c,n,l)}},Kwe.prototype.drawAxisMinorLine=function(e,t,i,n){for(var o,r,s,a,l=t,h=e.visibleRange,t=[],d=0;d<e.minorTicksPerInterval;d++)Lye(l+=("DateTime"===e.valueType?e.dateTimeInterval:e.visibleRange.interval)/(e.minorTicksPerInterval+1),h)&&(a=Jye(Zye(l,e),this.startAngle),o=this.centerX+this.chart.radius*a.x,r=this.centerY+this.chart.radius*a.y,s=o+e.minorTickLines.height*a.x*("Inside"===e.tickPosition?-1:1),a=r+e.minorTickLines.height*a.y*("Inside"===e.tickPosition?-1:1),i=i.concat("M "+this.centerX+" "+this.centerY+"L "+o+" "+r),n=n.concat("M "+o+" "+r+"L "+s+" "+a));return t.push(i),t.push(n),t},Kwe.prototype.drawXAxisLabels=function(e,t){this.visibleAxisLabelRect=[],this.chart.legendModule&&(i=this.chart.legendModule.legendBounds);for(var i,n,o,r,s,a,l=this.chart,h=0,d=0,p=l.renderer.createGroup({id:l.element.id+"AxisLabels"+t}),c="Inside"===e.labelPosition,u="",g=[],m=[],f=(m[0]=!0,e.labelIntersectAction),y="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?.5:0,v=l.radius+e.majorTickLines.height,v=c?-v:v,b=0,w=e.visibleLabels.length;b<w;b++){if(a=!1,s=Jye(Zye(e.visibleLabels[b].value+y,e),this.startAngle),isNaN(s.x)||isNaN(s.y)||(h=this.centerX+(v+e.majorTickLines.height+5)*s.x,d=this.centerY+(v+e.majorTickLines.height+5)*s.y,u=parseFloat(h.toFixed(1))===parseFloat(this.centerX.toFixed(1))?"middle":h<this.centerX&&!c||h>this.centerX&&c?"end":"start"),n=(r=e.visibleLabels[b]).text,(e.enableTrim||"Trim"===f)&&!e.enableWrap)for(var C,S,A=e.visibleLabels[b].originalText,x=e.labelPosition,I=l.availableSize.width,T=A.length,E=T-1;0<=E;--E)if(S=So(C=A.substring(0,E)+"...",e.labelStyle,this.chart.themeStyle.axisLabelFont).width,h===I/2?0<=h-S/2&&h+S/2<=I:"Outside"===x&&(I/2<=h&&h+S<=I||h<=I/2&&0<=h-S)||"Inside"===x&&(h+S<=I/2||I/2<=h-S)){r.size.width=So(n=E===T-1?A:C,e.labelStyle,this.chart.themeStyle.axisLabelFont).width,r.text=n;break}if(g[b]=this.getLabelRegion(h,d,r,u),0===b?o=h:b===e.visibleLabels.length-1&&"Category"!==e.valueType&&(s=So(n,e.labelStyle,this.chart.themeStyle.axisLabelFont).height,n=o<(s+=h)?"":n),0!==b&&"Hide"===f)for(var D=b;0<=D;D--){if(m[D=0===D?0:D===b?D-1:D]&&j0e(g[b],g[D])){m[b]=!(a=!0);break}m[b]=!0}!a&&i&&(a=j0e(g[b],i))&&0<(s=this.getAvailableSpaceToTrim(i,g[b]))&&(n=eve(s,e.visibleLabels[b].originalText,e.labelStyle,this.chart.enableRtl,this.chart.themeStyle.axisLabelFont),a=!1),s=new ko(l.element.id+t+"_AxisLabel_"+b,h,d,l.enableRtl?"end"===u?"start":"start"===u?"end":u:u,n,"","central"),a||(this.visibleAxisLabelRect.push(g[b]),sve(l.renderer,s,r.labelStyle,r.labelStyle.color||l.themeStyle.axisLabelFont.color,p,!1,l.redraw,!0,!0,null,null,0,null,l.enableCanvas,null,l.themeStyle.axisLabelFont))}this.chart.enableCanvas||this.element.appendChild(p)},Kwe.prototype.getAvailableSpaceToTrim=function(e,t){var i=e.x,e=i+e.width,n=t.x,t=n+t.width,o=0;return i<n&&n<e&&e<t?o=t-e:i<n&&n<e&&t<e?o=0:(i<t&&t<e&&n<i||i<t&&e<t&&n<i)&&(o=i-n),o},Kwe.prototype.getLabelRegion=function(e,t,i,n){return"middle"===n?e-=i.size.width/2:"end"===n&&(e-=i.size.width),t-=i.size.height/2,new Do(e,t,i.size.width,i.size.height)},Kwe.prototype.renderTickLine=function(e,t,i,n,o){var r,s,a,l=this.chart;0<e.majorTickLines.width&&(s=(a=ie(l.element.id+"_MajorTickLine_"+t+"_"+o))?a.getAttribute("d"):null,r=new No(l.element.id+"_MajorTickLine_"+t+"_"+o,"transparent",e.majorTickLines.width,e.majorTickLines.color||l.themeStyle.majorTickLine,null,null,i),a=l.renderer.drawPath(r),this.setPointerEventNone(a),O0e(l.enableCanvas,l.yAxisElements,a,l.redraw,!0,"x","y",null,s)),0<e.minorTickLines.width&&(s=(a=ie(l.element.id+"_MinorTickLine_"+t+"_"+o))?a.getAttribute("d"):null,r=new No(l.element.id+"_MinorTickLine_"+t+"_"+o,"transparent",e.minorTickLines.width,e.minorTickLines.color||l.themeStyle.minorTickLine,null,null,n),a=l.renderer.drawPath(r),this.setPointerEventNone(a),O0e(l.enableCanvas,l.yAxisElements,a,l.redraw,!0,"x","y",null,s))},Kwe.prototype.renderGridLine=function(e,t,i,n,o){var r,s,a,l=this.chart;0<e.majorGridLines.width&&(s=(a=ie(l.element.id+"_MajorGridLine_"+t+"_"+o))?a.getAttribute("d"):null,r=new No(l.element.id+"_MajorGridLine_"+t+"_"+o,"transparent",e.majorGridLines.width,e.majorGridLines.color||l.themeStyle.majorGridLine,null,e.majorGridLines.dashArray,i),O0e(l.enableCanvas,this.element,l.renderer.drawPath(r),l.redraw,!0,"x","y",null,s)),0<e.minorGridLines.width&&(s=(a=ie(l.element.id+"_MinorGridLine_"+t+"_"+o))?a.getAttribute("d"):null,r=new No(l.element.id+"_MinorGridLine_"+t+"_"+o,"transparent",e.minorGridLines.width,e.minorGridLines.color||l.themeStyle.minorGridLine,null,e.minorGridLines.dashArray,n),O0e(l.enableCanvas,this.element,l.renderer.drawPath(r),l.redraw,!0,"x","y",null,s))},Kwe.prototype.setPointerEventNone=function(e){e&&(e.style.pointerEvents="none")};var Gwe,Ywe,Xwe=Kwe;function Kwe(){var e=null!==Ywe&&Ywe.apply(this,arguments)||this;return e.visibleAxisLabelRect=[],e}Jwe=function(e,t){return(Jwe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Jwe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(eCe,Zwe=Xwe),eCe.prototype.render=function(e,t,i,n){for(var o=l0e(e.drawType),r=i.minimum,s=i.maximum,a=0,l=e.points;a<l.length;a++){var h=l[a];h.visible=h.visible&&!(!je(r)&&h.yValue<r||!je(s)&&h.yValue>s)}e.points.length&&(-1<e.drawType.indexOf("Column")?this.columnDrawTypeRender(e,t,i):e.chart[o+"SeriesModule"].render(e,t,i,n))},eCe.prototype.columnDrawTypeRender=function(e,t,i){for(var n,o,r,s,a,l,h,d,p,c,u,g,m,f,y,v,b,w,C=t.actualRange.min,S=e.clipRect.width/2+e.clipRect.x,A=e.clipRect.height/2+e.clipRect.y,x="RangeColumn"===e.drawType,I="Polar"===e.type,T="Logarithmic"===i.valueType,E="StackingColumn"===e.drawType,D="",M=0,k=(e.points[1]?e.points[1].xValue:2*e.points[0].xValue)-e.points[0].xValue,P=t.isAxisInverse,O="Category"===t.valueType&&"BetweenTicks"===t.labelPlacement?0:P?-k/2:k/2,B="DateTime"===t.valueType?t.dateTimeInterval:1,N=(this.getSeriesPosition(e),P?e.rectCount-1-e.position:e.position);M+=B,(C+=B)<=t.actualRange.max-("Category"===t.valueType?0:1););for(var F=0,L=e.points;F<L.length;F++){var R=L[F];R.symbolLocations=[],R.regions=[],R.visible&&Nye(e.points[R.index-1],R,e.points[R.index+1],e)&&(r=(P?t.visibleRange.max-R.xValue:R.xValue-t.visibleRange.min)+(k/e.rectCount*N-O)+M/360*t.startAngle,r/=M,n=2*Math.PI*(r+t.startAngle),o=2*Math.PI*(r+t.startAngle+k/e.rectCount/M),w=0==n&&0===o?(o=2*Math.PI,"1"):"0",l=o,n=(a=n)-.5*Math.PI+e.columnSpacing/2,o=o-.5*Math.PI-1e-6-e.columnSpacing/2,g=E||x?(u=x?R.low:e.stackedValues.startValues[R.index],g=x?R.high:e.stackedValues.endValues[R.index],(g=T?Bye(0===g?1:g,i.logBase):g)>i.actualRange.max?i.actualRange.max:g):(u=i.visibleRange.min,R.yValue>i.actualRange.max?i.actualRange.max:R.yValue),h=S+(s=u===g?0:e.chart.radius*Yye(g,i))*Math.cos(n),d=S+s*Math.cos(o),p=A+s*Math.sin(n),c=A+s*Math.sin(o),f=S+(m=e.chart.radius*Yye(0===u&&0!==i.visibleRange.min?i.visibleRange.min:u,i))*Math.cos(n),y=A+m*Math.sin(n),v=S+m*Math.cos(o),b=A+m*Math.sin(o),D=I?"M "+h+" "+p+" A "+s+" "+s+" 0 "+w+" 1 "+d+" "+c+" L "+v+" "+b+" A "+m+" "+m+" 1 0 0 "+f+" "+y+" Z":"M "+h+" "+p+" L "+d+" "+c+" L "+v+" "+b+" L "+f+" "+y+" Z",R.regionData=new e0e(a,l,m,s,r),w=this.triggerEvent(e.chart,e,R),a=new No(e.chart.element.id+"_Series_"+e.index+"_Point_"+R.index,w.fill,w.border.width,w.border.color,e.opacity,e.dashArray,D),w.cancel||(this.appendLinePath(a,e,""),I?(R.symbolLocations.push({x:S+s*Math.cos(n+(o-n)/2),y:A+s*Math.sin(n+(o-n)/2)}),x&&R.symbolLocations.push({x:S+m*Math.cos(n+(o-n)/2),y:A+m*Math.sin(n+(o-n)/2)})):(R.symbolLocations.push({x:(h+d)/2,y:(p+c)/2}),x&&R.symbolLocations.push({x:(v+f)/2,y:(b+y)/2}))))}this.renderMarker(e),e.isRectSeries=!0},eCe.prototype.triggerEvent=function(e,t,i){t={cancel:!1,name:jme,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(jme,t),i.color=t.fill,t},eCe.prototype.getSeriesPosition=function(e){for(var t=[],i=[],n={rectCount:0,position:null},o=0,r=e.chart.visibleSeries;o<r.length;o++){var s=r[o];!s.visible||"Polar"!==s.type&&"Radar"!==s.type||-1===s.drawType.indexOf("Column")||t.push(s)}for(var a=0;a<t.length;a++){var l=t[a];-1!==l.drawType.indexOf("Stacking")?l.stackingGroup?void 0===i[l.stackingGroup]?(l.position=n.rectCount,i[l.stackingGroup]=n.rectCount++):l.position=i[l.stackingGroup]:null===n.position?(l.position=n.rectCount,n.position=n.rectCount++):l.position=n.position:l.position=n.rectCount++}for(a=0;a<t.length;a++)t[a].rectCount=n.rectCount},eCe.prototype.doAnimation=function(e){var t=e.animation.duration,i=e.animation.delay,n=e.seriesElement.childNodes,o=1;if("Scatter"===e.drawType)for(var r=0,s=e.points;r<s.length;r++){var a=s[r];a.symbolLocations.length&&n[o]&&(u0e(n[o],i,t,e,a.index,a.symbolLocations[0],!1),o++)}else for(o=1;o<n.length;o++)this.doPolarRadarAnimation(n[o],i,t,e)},eCe.prototype.doPolarRadarAnimation=function(t,e,i,n){var o,r=n.clipRect.width/2+n.clipRect.x,s=n.clipRect.height/2+n.clipRect.y;t.style.visibility="hidden",new Vt({}).animate(t,{duration:i,delay:e,progress:function(e){e.timeStamp>e.delay&&(e.element.style.visibility="visible",o=(e.timeStamp-e.delay)/e.duration,t.setAttribute("transform","translate("+r+" "+s+") scale("+o+") translate("+-r+" "+-s+")"))},end:function(){var e=document.getElementById(n.chart.element.id+"_Annotation_Collections");e&&(e.style.visibility="visible"),t.style.visibility="visible",t.removeAttribute("transform"),n.chart.trigger("animationComplete",{series:n.chart.isBlazor?{}:n})}})},eCe.prototype.getPolarIsInversedPath=function(e,t){var i=this.chart.radius,n=e.isAxisInverse?"1 1 ":"1 0 ",e=Jye(Zye(e.visibleLabels[0].value,e),this.startAngle),o=this.centerX+i*e.x,e=this.centerY+i*e.y;return t+("L "+o+" "+e+" A "+i+" "+i+" 0 "+n+o+" "+(this.centerY+i))+" A "+i+" "+i+" 0 "+n+o+" "+e+" "},eCe.prototype.getModuleName=function(){return"PolarSeries"},eCe.prototype.destroy=function(){};var Jwe,Zwe,$we=eCe;function eCe(){return null!==Zwe&&Zwe.apply(this,arguments)||this}tCe=function(e,t){return(tCe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}tCe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(oCe,iCe=$we),oCe.prototype.render=function(e,t,i,n){for(var o=l0e(e.drawType),r=i.minimum,s=i.maximum,a=0,l=e.points;a<l.length;a++){var h=l[a];h.visible=h.visible&&!(!je(r)&&h.yValue<r||!je(s)&&h.yValue>s)}e.points.length&&(-1===e.drawType.indexOf("Column")?e.chart[o+"SeriesModule"].render(e,t,i,n):this.columnDrawTypeRender(e,t,i))},oCe.prototype.getRadarIsInversedPath=function(e,t){var i=this.chart.radius,n=e.visibleLabels.length,o=t,r=Jye(Zye(e.visibleLabels[0].value,e),this.startAngle),s=this.centerY+i*r.y,t=this.centerX+i*r.x;if(!isNaN(t)&&!isNaN(s)){o+=" L "+t+" "+s+" ";for(var a=n-1;0<=a;a--)r=Jye(Zye(e.visibleLabels[a].value,e),this.startAngle),s=this.centerY+i*r.y,o+="L "+(this.centerX+i*r.x)+" "+s+" "}return o},oCe.prototype.getModuleName=function(){return"RadarSeries"},oCe.prototype.destroy=function(){};var tCe,iCe,nCe=oCe;function oCe(){return null!==iCe&&iCe.apply(this,arguments)||this}rCe=function(e,t){return(rCe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}rCe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(lCe,sCe=Mwe),lCe.prototype.render=function(e){this.sideBySideInfo[e.index]=this.getSideBySideInfo(e);for(var t=e.stackedValues,i=0,n=e.points;i<n.length;i++){var o=n[i];this.renderPoint(e,o,this.sideBySideInfo[e.index],t)}e.visible&&this.renderMarker(e)},lCe.prototype.renderPoint=function(e,t,i,n){if(t.symbolLocations=[],t.regions=[],t.visible&&Nye(e.points[t.index-1],t,e.points[t.index+1],e)){var o=void 0,r=void 0;if(!e.visible&&e.isLegendClicked){for(var s=e.index;0<=s;s--)if(e.chart.visibleSeries[s].visible){o=e.chart.visibleSeries[s].index;break}r=(0<e.index&&void 0!==o?e.chart.visibleSeries[o].stackedValues.endValues:e.stackedValues.startValues)[t.index]}this.rect=this.getRectangle(t.xValue+i.start,!e.visible&&e.isLegendClicked?r:n.endValues[t.index],t.xValue+i.end,!e.visible&&e.isLegendClicked?r:n.startValues[t.index],e),e.chart.isTransposed&&e.columnWidthInPixel?(this.rect.width=e.columnWidthInPixel||this.rect.height,this.rect.x-=e.columnWidthInPixel/2):this.rect.height=e.columnWidthInPixel||this.rect.height,this.rect.y=!e.columnWidthInPixel||e.chart.isTransposed?this.rect.y:this.rect.y-e.columnWidthInPixel/2;i=this.triggerEvent(e,t,e.interior,{width:e.visible?e.border.width:0,color:e.visible?e.border.color:""});i.cancel||(this.drawRectangle(e,t,this.rect,i),this.updateSymbolLocation(t,this.rect,e),"Cylinder"===e.columnFacet&&(r={isColumn:!1,stacking:"StackingBar100"===e.type,isLastSeries:!0},this.drawCylinder(this.options,this.element,r,this.rect,e)))}},lCe.prototype.updateDirection=function(e,t){for(var i=[],n=0;n<e.yAxis.series.length;n++){var o=e.yAxis.series[n];o.stackingGroup===e.stackingGroup&&i.push(o)}for(var r=0;r<i.length;r++)for(n=0;n<t.length;n++)this.renderPoint(i[r],i[r].points[t[n]],this.sideBySideInfo[e.index],i[r].stackedValues),e.marker&&e.marker.visible&&i[r].chart.markerRender.renderMarker(i[r],i[r].points[t[n]],i[r].points[t[n]].symbolLocations[0],null,!0),i[r].marker.dataLabel.visible&&i[r].chart.dataLabelModule&&(i[r].chart.dataLabelModule.commonId=i[r].chart.element.id+"_Series_"+i[r].index+"_Point_",i[r].chart.dataLabelModule.renderDataLabel(i[r],i[r].points[t[n]],null,i[r].marker.dataLabel))},lCe.prototype.destroy=function(){},lCe.prototype.getModuleName=function(){return"StackingBarSeries"},lCe.prototype.doAnimation=function(e){this.animate(e)};var rCe,sCe,aCe=lCe;function lCe(){var e=null!==sCe&&sCe.apply(this,arguments)||this;return e.sideBySideInfo=[],e}hCe=function(e,t){return(hCe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}hCe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(pCe,dCe=Mwe),pCe.prototype.render=function(e){this.sideBySideInfo[e.index]=this.getSideBySideInfo(e);for(var t=Math.max(e.border.width,1),i=0,n=e.points;i<n.length;i++){var o=n[i];this.renderPoint(e,o,this.sideBySideInfo[e.index],t)}},pCe.prototype.renderPoint=function(e,t,i,n){var o,r="";t.regions=[],t.symbolLocations=[],t.visible&&Nye(e.points[t.index-1],t,e.points[t.index+1],e)&&(o=this.getRectangle(t.xValue+i.median,Math.max(t.high,t.low),t.xValue+i.median,Math.min(t.high,t.low),e),e.chart.requireInvertedAxis?(o.y-=n/2,o.height=n):(o.x-=n/2,o.width=n),n=this.getRectangle(t.xValue+i.start,Math.max(t.open,t.close),t.xValue+i.end,Math.min(t.open,t.close),e),r=this.getPathString(o,n,e),(i=this.triggerPointRenderEvent(e,t)).cancel||(this.drawCandle(e,t,n,i,r),this.updateSymbolLocation(t,o,e),this.updateSymbolLocation(t,n,e)))},pCe.prototype.updateDirection=function(e,t){for(var i=Math.max(e.border.width,1),n=0;n<t.length;n++)this.renderPoint(e,e.points[t[n]],this.sideBySideInfo[e.index],i),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[n]],null,e.marker.dataLabel))},pCe.prototype.triggerPointRenderEvent=function(e,t){var i=this.getCandleColor(t,e),n={color:e.border.color,width:Math.max(e.border.width,1)};return this.triggerEvent(e,t,i,n)},pCe.prototype.getCandleColor=function(e,t){var i=t.points[e.index-1];return!1===t.enableSolidCandles?i&&i.close>e.close?t.bullFillColor||t.chart.themeStyle.bullFillColor:t.bearFillColor||t.chart.themeStyle.bearFillColor:e.open>e.close?t.bullFillColor||t.chart.themeStyle.bullFillColor:t.bearFillColor||t.chart.themeStyle.bearFillColor},pCe.prototype.getPathString=function(e,t,i){var n="",o=i.chart.requireInvertedAxis?e.y+e.height/2:e.x+e.width/2,n=(n+=i.chart.requireInvertedAxis?"M "+e.x+" "+o+" L "+t.x+" "+o:"M "+o+" "+e.y+" L "+o+" "+t.y).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");return n+=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)},pCe.prototype.drawCandle=function(e,t,i,n,o){if((e.chart.requireInvertedAxis?i.height:i.width)<=0)return null;var i=e.enableSolidCandles||t.open>t.close?n.fill:"transparent",i=(n.border.color=n.fill,new No(e.chart.element.id+"_Series_"+e.index+"_Point_"+(null!==e.removedPointIndex&&e.removedPointIndex<=t.index?t.index+1:t.index),i,n.border.width,n.border.color,e.opacity,e.dashArray,o)),n=ie(i.id),r=n?n.getAttribute("d"):null,i=e.chart.renderer.drawPath(i,new Int32Array([e.clipRect.x,e.clipRect.y]));null!==e.removedPointIndex&&e.removedPointIndex<=t.index&&(i.id=e.chart.element.id+"_Series_"+e.index+"_Point_"+t.index),i.setAttribute("role","img"),i.setAttribute("aria-label",e.accessibility.accessibilityDescriptionFormat?e.formatAccessibilityDescription(t,e):t.x.toString()+":"+t.high.toString()+":"+t.low.toString()+":"+t.close.toString()+":"+t.open.toString()),e.chart.enableCanvas||e.seriesElement.appendChild(i),m0e(n,o,e.chart.redraw,r,e.chart.duration)},pCe.prototype.doAnimation=function(e){this.animate(e)},pCe.prototype.getModuleName=function(){return"CandleSeries"},pCe.prototype.destroy=function(){};var hCe,dCe,Xwe=pCe;function pCe(){var e=null!==dCe&&dCe.apply(this,arguments)||this;return e.sideBySideInfo=[],e}cCe=function(e,t){return(cCe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}cCe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(mCe,uCe=Mwe),mCe.prototype.render=function(e){e.isRectSeries=!0,this.sideBySideInfo[e.index]=this.getSideBySideInfo(e);for(var t=e.stackedValues,i=Dye(e),n=0,o=i;n<o.length;n++){var r=o[n];this.renderPoint(e,r,this.sideBySideInfo[e.index],t,i)}e.visible&&this.renderMarker(e)},mCe.prototype.renderPoint=function(e,t,i,n,o){if(t.symbolLocations=[],t.regions=[],t.visible&&Nye(o[t.index-1],t,o[t.index+1],e)){var r=void 0,o=void 0;if(!e.visible&&e.isLegendClicked){for(var s=e.index;0<=s;s--)if(e.chart.visibleSeries[s].visible){r=e.chart.visibleSeries[s].index;break}o=(0<e.index&&void 0!==r?e.chart.visibleSeries[r].stackedValues.endValues:e.stackedValues.startValues)[t.index]}this.rect=this.getRectangle(t.xValue+i.start,!e.visible&&e.isLegendClicked?o:n.endValues[t.index],t.xValue+i.end,!e.visible&&e.isLegendClicked?o:n.startValues[t.index],e),e.chart.isTransposed&&e.columnWidthInPixel?(this.rect.height=e.columnWidthInPixel||this.rect.width,this.rect.y-=e.columnWidthInPixel/2):this.rect.width=e.columnWidthInPixel||this.rect.width,this.rect.x=!e.columnWidthInPixel||e.chart.isTransposed?this.rect.x:this.rect.x-(e.columnWidthInPixel/2*e.rectCount-e.columnWidthInPixel*e.position);i=this.triggerEvent(e,t,e.interior,{width:e.visible?e.border.width:0,color:e.visible?e.border.color:""});i.cancel||(this.drawRectangle(e,t,this.rect,i),this.updateSymbolLocation(t,this.rect,e),"Cylinder"===e.columnFacet&&(o={isColumn:!0,stacking:"StackingColumn100"===e.type,isLastSeries:!0},this.drawCylinder(this.options,this.element,o,this.rect,e)))}},mCe.prototype.updateDirection=function(e,t){for(var i=[],n=0;n<e.xAxis.series.length;n++){var o=e.xAxis.series[n];o.stackingGroup===e.stackingGroup&&i.push(o)}for(var r=0;r<i.length;r++)for(var s=Dye(i[r]),n=0;n<t.length;n++)this.renderPoint(i[r],i[r].points[t[n]],this.sideBySideInfo[e.index],i[r].stackedValues,s),e.marker&&e.marker.visible&&i[r].chart.markerRender.renderMarker(i[r],i[r].points[t[n]],i[r].points[t[n]].symbolLocations[0],null,!0),i[r].marker.dataLabel.visible&&i[r].chart.dataLabelModule&&(i[r].chart.dataLabelModule.commonId=i[r].chart.element.id+"_Series_"+i[r].index+"_Point_",i[r].chart.dataLabelModule.renderDataLabel(i[r],i[r].points[t[n]],null,i[r].marker.dataLabel))},mCe.prototype.doAnimation=function(e){this.animate(e)},mCe.prototype.destroy=function(){},mCe.prototype.getModuleName=function(){return"StackingColumnSeries"};var cCe,uCe,gCe=mCe;function mCe(){var e=null!==uCe&&uCe.apply(this,arguments)||this;return e.sideBySideInfo=[],e}fCe=function(e,t){return(fCe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}fCe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(bCe,yCe=Awe),bCe.prototype.render=function(e,t,i,n,o,r){for(var s,a,l="",h="M",d=null,p=this.enableComplexProperty(e),c="Category"===t.valueType&&"BetweenTicks"===t.labelPlacement?.5:0,u=0,g=p;u<g.length;u++){var m=g[u];m.symbolLocations=[],m.regions=[],m.visible&&Nye(p[m.index-1],m,p[m.index+1],e)?("M"!==h||p[m.index+1]&&p[m.index+1].visible||(l=""),h=(l=null!=d?(a=L0e(m.xValue,m.yValue,t,i,n),s=L0e(d.xValue,d.yValue,t,i,n),l.concat(h+" "+s.x+" "+s.y+this.GetStepLineDirection(a,s,e.step,"L",e,!0))):(s=L0e(m.xValue-c,m.yValue,t,i,n),l.concat(h+" "+s.x+" "+s.y+" ")),"L"),this.storePointLocation(m,e,n,L0e),""===l&&(l="M "+m.symbolLocations[0].x+" "+m.symbolLocations[0].y),d=m):(d="Drop"===e.emptyPointSettings.mode?d:null,h="Drop"===e.emptyPointSettings.mode?h:"M")}0<p.length&&(s=L0e(p[p.length-1].xValue+c,p[p.length-1].yValue,t,i,n),l=l.concat(h+" "+s.x+" "+s.y+" "));var f=new No(e.chart.element.id+"_Series_"+e.index,"transparent",e.width,e.interior,e.opacity,e.dashArray,l);this[o?"addPath":"appendLinePath"](f,e,""),r||this.renderMarker(e)},bCe.prototype.updateDirection=function(e,t){this.render(e,e.xAxis,e.yAxis,e.chart.requireInvertedAxis,!1,!0);for(var i=0;i<t.length;i++)e.marker&&e.marker.visible&&e.chart.markerRender.renderMarker(e,e.points[t[i]],e.points[t[i]].symbolLocations[0],null,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[i]],null,e.marker.dataLabel))},bCe.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},bCe.prototype.destroy=function(){},bCe.prototype.getModuleName=function(){return"StepLineSeries"};var fCe,yCe,vCe=bCe;function bCe(){return null!==yCe&&yCe.apply(this,arguments)||this}wCe=function(e,t){return(wCe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}wCe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ACe,CCe=Awe),ACe.prototype.render=function(e,t,i,n,o,r){for(var s,a,l,h,d=null,p="",c=this.enableComplexProperty(e),u=c.length,g=Math.max(e.yAxis.visibleRange.min,0),m=null,f="",y="Category"===t.valueType&&"BetweenTicks"===t.labelPlacement?.5:0,v=0;v<u;v++)h=(l=c[v]).xValue,l.symbolLocations=[],l.regions=[],l.visible&&Nye(c[v-1],l,c[v+1],e)&&(null===d&&(d=new Tve(h,0),p=(p+="M "+(s=L0e(h-y,g,t,i,n)).x+" "+s.y+" ")+"L "+(s=L0e(h-y,l.yValue,t,i,n)).x+" "+s.y+" ",f+="M "+s.x+" "+s.y+" "),null!=m?(s=L0e(l.xValue,l.yValue,t,i,n),a=L0e(m.xValue,m.yValue,t,i,n),p=p.concat(this.GetStepLineDirection(s,a,e.step,"L",e)),f+=this.GetStepLineDirection(s,a,e.step,"L",e,!0)):"Gap"===e.emptyPointSettings.mode&&(p+="L "+(s=L0e(l.xValue,l.yValue,t,i,n)).x+" "+s.y+" ",f+="L "+s.x+" "+s.y+" "),this.storePointLocation(l,e,n,L0e),m=l),c[v+1]&&!c[v+1].visible&&"Drop"!==e.emptyPointSettings.mode&&(p+="L "+(s=L0e(h+y,g,t,i,n)).x+" "+s.y,m=d=null);1<u&&""!==p?(p+="L "+(a=L0e((d={x:c[u-1].xValue+y,y:c[u-1].yValue}).x,d.y,t,i,n)).x+" "+a.y+" ",f+="L "+a.x+" "+a.y+" ",p+="L "+(a=L0e((d={x:c[u-1].xValue+y,y:g}).x,d.y,t,i,n)).x+" "+a.y+" "):p="";var b=new No(e.chart.element.id+"_Series_"+e.index,e.interior,0,"transparent",e.opacity,e.dashArray,p);this[o?"addAreaPath":"appendLinePath"](b,e,""),0!==e.border.width&&(b=new No(e.chart.element.id+"_Series_border_"+e.index,"transparent",e.border.width,e.border.color||e.interior,1,e.border.dashArray,f),this[o?"addAreaPath":"appendLinePath"](b,e,"")),r||this.renderMarker(e)},ACe.prototype.updateDirection=function(e,t){this.render(e,e.xAxis,e.yAxis,e.chart.requireInvertedAxis,!1,!0);for(var i=0;i<t.length;i++)e.marker&&e.marker.visible&&e.chart.markerRender.renderMarker(e,e.points[t[i]],e.points[t[i]].symbolLocations[0],null,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[i]],null,e.marker.dataLabel))},ACe.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},ACe.prototype.destroy=function(){},ACe.prototype.getModuleName=function(){return"StepAreaSeries"};var wCe,CCe,SCe=ACe;function ACe(){return null!==CCe&&CCe.apply(this,arguments)||this}xCe=function(e,t){return(xCe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}xCe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ECe,ICe=Awe),ECe.prototype.render=function(e,t,i,n,o,r){for(var s,a,l="PolarRadar"===e.chart.chartAreaType,h=l?Xye:L0e,d="",p=this.enableComplexProperty(e),c=p.length,u=e.stackedValues,g=l?Math.max(e.yAxis.visibleRange.min,u.endValues[0]):Math.max(e.yAxis.visibleRange.min,u.startValues[0]),m=0,f="",y=(0<c&&(w=h(p[0].xValue,g,t,i,n,e),d=d.concat("M "+w.x+" "+w.y+" ")),e.chart&&"PolarRadar"===e.chart.chartAreaType),v=e.index;0<=v;v--)if(e.chart.visibleSeries[v].visible){a=e.chart.visibleSeries[v].index;break}for(v=0;v<c;v++)if(A=p[v].index,p[v].symbolLocations=[],p[v].regions=[],p[v].visible&&Nye(p[v-1],p[v],p[v+1],e)){var b=(0<e.index&&void 0!==a?this.chart.visibleSeries[a].stackedValues.endValues:u.startValues)[A],w=h(p[v].xValue,!e.visible&&e.isLegendClicked?b:u.endValues[A],t,i,n,e),d=d.concat("L "+w.x+" "+w.y+" ");p[v].symbolLocations.push(h(p[v].xValue,u.endValues[A],t,i,n,e)),p[v].regions.push(new Do(p[v].symbolLocations[0].x-e.marker.width,p[v].symbolLocations[0].y-e.marker.height,2*e.marker.width,2*e.marker.height))}else if(!y&&"Drop"!==e.emptyPointSettings.mode){for(var C=v-1;m<=C;C--)A=p[C].index,s=h(p[C].xValue,u.startValues[A],t,i,n,e),d=d.concat("L "+s.x+" "+s.y+" ");p[v+1]&&p[v+1].visible&&(!y||this.withinYRange(p[v+1],i))&&(b=p[v+1].index,w=h(p[v+1].xValue,u.startValues[b],t,i,n,e),d=d.concat("M "+w.x+" "+w.y+" ")),m=v+1}if("PolarRadar"===e.chart.chartAreaType&&1<p.length&&(g=this.getFirstLastVisiblePoint(e.points),x=this.chart,d+="L "+(s=h((w={x:g.first.xValue,y:u.endValues[g.first.index]}).x,w.y,t,i,n,e)).x+" "+s.y+" ",1===this.chart.visible)&&(t.isAxisInverse||i.isAxisInverse)&&(this.chart.enableAnimation=!1,d="Polar"===e.type?x.polarSeriesModule.getPolarIsInversedPath(t,d):x.radarSeriesModule.getRadarIsInversedPath(t,d)),!y||e.index!==this.getFirstSeriesIndex(e.chart.visibleSeries))for(C=c-1;m<=C;C--){var S,A=p[C].index;y&&!p[C].visible||"Drop"===(S=this.getPreviousSeries(e)).emptyPointSettings.mode&&S.points[C].isEmpty||(s=h(p[C].xValue,(!e.visible&&e.isLegendClicked&&0<e.index&&void 0!==a?this.chart.visibleSeries[a].stackedValues.endValues:u.startValues)[A],t,i,n,e),u.startValues[A]===u.endValues[A]&&(s.y=Math.floor(s.y)),d=d.concat((C===c-1&&l?"M":"L")+" "+s.x+" "+s.y+" "))}var x,g=new No(e.chart.element.id+"_Series_"+e.index,e.interior,0,"transparent",e.opacity,e.dashArray,d);this[o?"addAreaPath":"appendLinePath"](g,e,""),0!==e.border.width&&e.visible&&(f=this.removeEmptyPointsBorder(this.getBorderDirection(d)),x=new No(e.chart.element.id+"_Series_border_"+e.index,"transparent",e.visible?e.border.width:0,e.border.color||e.interior,1,e.border.dashArray,f),this[o?"addAreaPath":"appendLinePath"](x,e,"")),!r&&e.visible&&this.renderMarker(e)},ECe.prototype.updateDirection=function(e,t){for(var i=0;i<e.xAxis.series.length;i++){var n=e.xAxis.series[i];this.render(n,n.xAxis,n.yAxis,n.chart.requireInvertedAxis,!1,!0);for(var o=0;o<t.length;o++)n.marker&&n.marker.visible&&n.chart.markerRender.renderMarker(n,n.points[t[o]],n.points[t[o]].symbolLocations[0],null,!0),n.marker.dataLabel.visible&&n.chart.dataLabelModule&&(n.chart.dataLabelModule.commonId=n.chart.element.id+"_Series_"+n.index+"_Point_",n.chart.dataLabelModule.renderDataLabel(n,n.points[t[o]],null,n.marker.dataLabel))}},ECe.prototype.addAreaPath=function(e,t,i){i=this.appendPathElement(e,t,i);if(""!==i.previousDirection&&""!==e.d){var n=i.previousDirection.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),o=e.d.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),r=Math.max(n.length,o.length),s=Math.min(n.length,o.length);if(n.length<o.length){for(var a=n.length;a<o.length;a++)o.length!==n.length&&n.splice((n.length+1)/2,0,n.slice((n.length-1)/2)[0],n.slice((n.length-1)/2)[1]);f0e(i.element,e.d,t.chart.redraw,n.join(" "),this.chart.duration)}else if(n.length>o.length){for(a=s;a<r;a++)o.length!==n.length&&(o.splice(1,0,o[1]),o.splice(o.length-1,0,o[o.length-1]));f0e(i.element,o.join(""),t.chart.redraw,i.previousDirection,this.chart.duration,e.d)}else f0e(i.element,e.d,t.chart.redraw,i.previousDirection,this.chart.duration)}},ECe.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},ECe.prototype.destroy=function(){},ECe.prototype.getModuleName=function(){return"StackingAreaSeries"},ECe.prototype.getPreviousSeries=function(e){for(var t=e.chart.visibleSeries,i=0,n=t.length;i<n;i++)if(e.index===t[i].index&&0!==i)return t[i-1];return t[0]},ECe.prototype.getFirstSeriesIndex=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];if(n.visible)return n.index}return 0};var xCe,ICe,TCe=ECe;function ECe(){return null!==ICe&&ICe.apply(this,arguments)||this}DCe=function(e,t){return(DCe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}DCe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(PCe,MCe=Awe),PCe.prototype.render=function(e,t,i,n,o,r){for(var s,a,l,h,d,p,c,u=null,g="",m="",f=e.stackedValues,y=this.enableComplexProperty(e),v=Math.max(e.yAxis.visibleRange.min,f.startValues[0]),b=y.length,w=null,C=0,S="Category"===t.valueType&&"BetweenTicks"===t.labelPlacement?.5:0,A=0;A<b;A++)if(p=(h=y[A]).xValue,h.symbolLocations=[],h.regions=[],c=h.index,h.visible&&Nye(y[A-1],h,y[A+1],e)&&(null===u&&(u=new Tve(p,0),g=(g+="M "+(s=L0e(p-S,v,t,i,n)).x+" "+s.y+" ")+"L "+(s=L0e(p-S,f.endValues[c],t,i,n)).x+" "+s.y+" ",m+="M "+s.x+" "+s.y+" "),null!=w?(s=L0e(h.xValue,f.endValues[c],t,i,n),a=L0e(w.xValue,f.endValues[w.index],t,i,n),g+=this.GetStepLineDirection(s,a,e.step,"L",e,!1),m+=this.GetStepLineDirection(s,a,e.step,"L",e,!0)):"Gap"===e.emptyPointSettings.mode&&(g+="L "+(s=L0e(h.xValue,f.endValues[c],t,i,n)).x+" "+s.y+" ",m+="L "+s.x+" "+s.y+" "),y[A].symbolLocations.push(L0e(y[A].xValue,f.endValues[c],t,i,n)),y[A].regions.push(new Do(y[A].symbolLocations[0].x-e.marker.width,y[A].symbolLocations[0].y-e.marker.height,2*e.marker.width,2*e.marker.height)),w=h),y[A+1]&&!y[A+1].visible&&null!==u&&"Drop"!==e.emptyPointSettings.mode){for(var x,I=A;C<=I;I--)c=y[I].index,x=0===I?0:y[I-1].index,s=L0e(y[c].xValue,f.startValues[c],t,i,n),a=0!==I&&(f.startValues[c]<f.startValues[x]||f.startValues[c]>f.startValues[x])?(g=g.concat("L "+s.x+" "+s.y+" "),L0e(y[x].xValue,f.startValues[x],t,i,n)):L0e(y[c].xValue,f.startValues[c],t,i,n),y[x].visible&&(g=g.concat(this.GetStepLineDirection(a,s,this.prevStep,"L",e)));C=A+2,w=u=null}if(""!==g){1<b&&(c=y[b-1].index,g+="L "+(a=L0e((u={x:y[b-1].xValue+S,y:f.endValues[c]}).x,u.y,t,i,n)).x+" "+a.y+" ",m+="L "+a.x+" "+a.y+" ",g+="L "+(a=L0e((u={x:y[b-1].xValue+S,y:f.startValues[c]}).x,u.y,t,i,n)).x+" "+a.y+" ");for(I=b-1;C<=I;I--){var T=void 0;y[I].visible&&(c=y[I].index,d=L0e(y[I].xValue,f.startValues[c],t,i,n),g=g.concat("L "+d.x+" "+d.y+" ")),0===I||y[I-1].visible||(T=this.getNextVisiblePointIndex(y,I)),0!==I&&(c=(T?y[T]:y[I-1]).index,T=L0e(y[T||I-1].xValue,f.startValues[c],t,i,n),0!==I&&!y[I-1].visible||(g=g.concat(this.GetStepLineDirection(T,d,this.prevStep,"L",e))))}this.prevStep="Right"===e.step?"Left":"Left"===e.step?"Right":e.step,l=new No(e.chart.element.id+"_Series_"+e.index,e.interior,0,"transparent",e.opacity,e.dashArray,g),this[o?"addPath":"appendLinePath"](l,e,""),0!==e.border.width&&(l=new No(e.chart.element.id+"_Series_border_"+e.index,"transparent",e.border.width,e.border.color||e.interior,1,e.border.dashArray,m),this[o?"addPath":"appendLinePath"](l,e,"")),r||this.renderMarker(e)}},PCe.prototype.updateDirection=function(e,t){for(var i=0;i<e.xAxis.series.length;i++){var n=e.xAxis.series[i];this.render(n,n.xAxis,n.yAxis,n.chart.requireInvertedAxis,!1,!0);for(var o=0;o<t.length;o++)n.marker&&n.marker.visible&&n.chart.markerRender.renderMarker(n,n.points[t[o]],n.points[t[o]].symbolLocations[0],null,!0),n.marker.dataLabel.visible&&n.chart.dataLabelModule&&(n.chart.dataLabelModule.commonId=n.chart.element.id+"_Series_"+n.index+"_Point_",n.chart.dataLabelModule.renderDataLabel(n,n.points[t[o]],null,n.marker.dataLabel))}},PCe.prototype.addPath=function(e,t,i){i=this.appendPathElement(e,t,i);if(""!==i.previousDirection&&""!==e.d){var n=i.previousDirection.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),o=e.d.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),r=Math.max(n.length,o.length),s=Math.min(n.length,o.length);if(n.length<o.length){for(var a=n.length;a<o.length;a++)o.length!==n.length&&(n.splice(Math.floor(n.length/2)-1,0,n[Math.floor(n.length/2)-1],n[Math.floor(n.length/2)-1]),n.splice(Math.floor(n.length/2)+2,0,n[Math.floor(n.length/2)+2],n[Math.floor(n.length/2)+2],n[Math.floor(n.length/2)+2]));f0e(i.element,e.d,t.chart.redraw,n.join(" "),this.chart.duration)}else if(n.length>o.length){for(a=s;a<r;a++)o.length!==n.length&&(o.splice(2,0,o[2]),o.splice(o.length-3,0,o[o.length-3]));f0e(i.element,o.join(""),t.chart.redraw,i.previousDirection,this.chart.duration,e.d)}else f0e(i.element,e.d,t.chart.redraw,i.previousDirection,this.chart.duration)}},PCe.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},PCe.prototype.destroy=function(){},PCe.prototype.getModuleName=function(){return"StackingStepAreaSeries"},PCe.prototype.getNextVisiblePointIndex=function(e,t){for(var i=t-1;0<=i;i--)if(e[i].visible)return i;return 0};var DCe,MCe,kCe=PCe;function PCe(){return null!==MCe&&MCe.apply(this,arguments)||this}BCe=function(e,t){return(BCe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}BCe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(RCe,FCe=Awe),RCe.prototype.render=function(e,t,i,n,o,r){for(var s,a,l="PolarRadar"===e.chart.chartAreaType?Xye:L0e,h="",d=this.enableComplexProperty(e),p=d.length,c=e.stackedValues,u=0;u<p;u++)d[u].regions=[],d[u].symbolLocations=[],s=d[u].index,d[u].visible&&Nye(d[u-1],d[u],d[u+1],e)?(a=l(d[u].xValue,c.endValues[s],t,i,n,e),h=h.concat((u?"L":"M")+" "+a.x+" "+a.y+" "),d[u].symbolLocations.push(l(d[u].xValue,c.endValues[s],t,i,n,e)),d[u].regions.push(new Do(d[u].symbolLocations[0].x-e.marker.width,d[u].symbolLocations[0].y-e.marker.height,2*e.marker.width,2*e.marker.height))):"Drop"!==e.emptyPointSettings.mode&&d[u+1]&&d[u+1].visible&&(s=d[u+1].index,a=l(d[u+1].xValue,c.endValues[s],t,i,n,e),h=h.concat("M "+a.x+" "+a.y+" "));"PolarRadar"===e.chart.chartAreaType&&1<d.length&&(h+="L "+(g=l((a={y:c.endValues[0],x:e.points[0].xValue}).x,a.y,t,i,n,e)).x+" "+g.y+" ");var g=new No(e.chart.element.id+"_Series_"+e.index,"none",e.width,e.interior,e.opacity,e.dashArray,h);this[o?"addPath":"appendLinePath"](g,e,""),r||this.renderMarker(e)},RCe.prototype.updateDirection=function(e,t){this.render(e,e.xAxis,e.yAxis,e.chart.requireInvertedAxis,!1,!0);for(var i=0;i<t.length;i++)e.marker&&e.marker.visible&&e.chart.markerRender.renderMarker(e,e.points[t[i]],e.points[t[i]].symbolLocations[0],null,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[i]],null,e.marker.dataLabel))},RCe.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},RCe.prototype.destroy=function(){},RCe.prototype.getModuleName=function(){return"StackingLineSeries"};var BCe,FCe,LCe=RCe;function RCe(){return null!==FCe&&FCe.apply(this,arguments)||this}NCe.prototype.render=function(e,t,i,n){e.isRectSeries=!1;for(var o=e.marker,r=this.enableComplexProperty(e),s="PolarRadar"===e.chart.chartAreaType?Xye:L0e,a={width:(this.isLineShapeMarker(o.shape)?e:e.border).width,color:this.isLineShapeMarker(o.shape)?e.interior:e.border.color},l=0,h=r;l<h.length;l++){var d=h[l];this.renderPoint(e,d,n,s,a,r)}},NCe.prototype.renderPoint=function(e,t,i,n,o,r){var s=e.chart.redraw&&t.symbolLocations?t.symbolLocations[0]:null;t.symbolLocations=[],t.regions=[],t.visible&&Nye(r[t.index-1],t,r[t.index+1],e)&&(r={cancel:!1,name:jme,series:e,point:t,fill:e.setPointColor(t,e.interior),border:e.setBorderColor(t,{width:o.width,color:o.color}),height:e.marker.height,width:e.marker.width,shape:e.marker.shape},e.chart.trigger(jme,r),r.cancel?t.marker={visible:!0}:(t.symbolLocations.push(n(t.xValue,t.yValue,e.xAxis,e.yAxis,i,e)),t.color=r.fill,this.refresh(e,t,r,s)))},NCe.prototype.updateDirection=function(e,t,i){for(var n=e.marker,o=this.enableComplexProperty(e),r="PolarRadar"===e.chart.chartAreaType?Xye:L0e,s={width:(this.isLineShapeMarker(n.shape)?e:e.border).width,color:this.isLineShapeMarker(n.shape)?e.interior:e.border.color},a=0;a<t.length;a++)this.renderPoint(e,e.points[t[a]],i,r,s,o),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[a]],null,e.marker.dataLabel))},NCe.prototype.isLineShapeMarker=function(e){return"HorizontalLine"===e||"VerticalLine"===e||"Cross"===e},NCe.prototype.enableComplexProperty=function(e){for(var t,i,n,o=[],r=[],s=e.yAxis.visibleRange,a=e.xAxis.visibleRange,l=e.clipRect,e=e.points,h=Math.abs(s.delta/l.height),d=Math.abs(a.delta/l.width),p=e[0]&&e[0].y>h?0:h,c=e[0]&&e[0].x>d?0:d,u=0,g=e;u<g.length;u++){var m=g[u];m.symbolLocations||(m.symbolLocations=[]),t=m.yValue||s.min,i=m.xValue||a.min,(Math.abs(p-t)>=h||Math.abs(c-i)>=d)&&(r.push(m),p=t,c=i)}for(var f=0;f<r.length;f++)je((n=r[f]).x)||""===n.x||o.push(n);return o},NCe.prototype.refresh=function(e,t,i,n){var o,r,s=e.chart,a=e.marker,l=i.point.marker.imageUrl||a.imageUrl,h=new No(s.element.id+"_Series_"+e.index+"_Point_"+t.index,i.fill,i.border.width,e.chart.enableCanvas&&!i.border.color?i.fill:i.border.color,e.opacity,e.border.dashArray),d=(s.redraw&&ie(h.id)&&(o="Circle"===i.shape?"c":"",r=ie(h.id).getAttribute("d"),n={x:+(d=ie(h.id)).getAttribute(o+"x"),y:+d.getAttribute(o+"y")}),A0e(t.symbolLocations[0],i.shape,new Eo(i.width,i.height),l,h,(t.x.toString(),t.yValue.toString()),e.chart.renderer,e.clipRect));O0e(e.chart.enableCanvas,e.seriesElement,d,s.redraw,!0,o+"x",o+"y",n,r,!1,!1,null,s.duration,!0),t.regions.push(new Do(t.symbolLocations[0].x-a.width,t.symbolLocations[0].y-a.height,2*a.width,2*a.height)),t.marker={border:i.border,fill:i.fill,height:i.height,visible:!0,width:i.width,shape:i.shape,imageUrl:l}},NCe.prototype.doAnimation=function(e){for(var t=e.animation.duration,i=e.animation.delay,n=e.seriesElement.childNodes,o=1,r=0,s=e.points;r<s.length;r++){var a=s[r];a.symbolLocations.length&&n[o]&&(u0e(n[o],i,t,e,a.index,a.symbolLocations[0],!1),o++)}},NCe.prototype.getModuleName=function(){return"ScatterSeries"},NCe.prototype.destroy=function(){};var OCe=NCe;function NCe(){}VCe=function(e,t){return(VCe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}VCe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(zCe,_Ce=Mwe),zCe.prototype.render=function(e){this.sideBySideInfo[e.index]=this.getSideBySideInfo(e);for(var t=0,i=e.points;t<i.length;t++){var n=i[t];this.renderPoint(e,n,this.sideBySideInfo[e.index])}this.renderMarker(e)},zCe.prototype.renderPoint=function(e,t,i){var n;t.symbolLocations=[],t.regions=[],t.visible&&Nye(e.points[t.index-1],t,e.points[t.index+1],e)&&((i=this.getRectangle(t.xValue+i.start,t.high,t.xValue+i.end,t.low,e)).width=e.columnWidthInPixel||i.width,i.x=e.columnWidthInPixel?i.x-(e.columnWidthInPixel/2*e.rectCount-e.columnWidthInPixel*e.index):i.x,(n=this.triggerEvent(e,t,e.interior,{width:e.border.width,color:e.border.color})).cancel||(this.updateSymbolLocation(t,i,e),this.drawRectangle(e,t,i,n)))},zCe.prototype.updateDirection=function(n,o){for(var e=this,t=0;t<o.length;t++)!function(i){e.renderPoint(n,n.points[o[i]],e.sideBySideInfo[n.index]),n.marker&&n.marker.visible&&n.points[o[i]].symbolLocations.map(function(e,t){n.chart.markerRender.renderMarker(n,n.points[o[i]],e,t,!0)}),n.marker.dataLabel.visible&&n.chart.dataLabelModule&&(n.chart.dataLabelModule.commonId=n.chart.element.id+"_Series_"+n.index+"_Point_",n.chart.dataLabelModule.renderDataLabel(n,n.points[o[i]],null,n.marker.dataLabel))}(t)},zCe.prototype.getModuleName=function(){return"RangeColumnSeries"},zCe.prototype.doAnimation=function(e){this.animate(e)},zCe.prototype.destroy=function(){};var VCe,_Ce,HCe=zCe;function zCe(){var e=null!==_Ce&&_Ce.apply(this,arguments)||this;return e.sideBySideInfo=[],e}jCe=function(e,t){return(jCe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}jCe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(UCe,WCe=Awe),UCe.prototype.render=function(e,t,i,n,o,r){var s,a=this.prevPoint=null,l="",h=0,d="M",p=void 0,c=e.border.width||0,u=e.border.color||e.interior,g=Math.max(e.yAxis.visibleRange.min,0),m=this.enableComplexProperty(e);"Category"===t.valueType&&"BetweenTicks"===t.labelPlacement&&(h=.5);for(var f=0,y=m.length;f<y;f++){(v=m[f]).symbolLocations=[],v.regions=[],w=Math.min(v.low,v.high),C=Math.max(v.low,v.high),i.isAxisInverse&&(b=w,w=C,C=b);var v,b=L0e(v.xValue,w,t,i,n),w=L0e(v.xValue,C,t,i,n),C=(v.symbolLocations.push(w),v.symbolLocations.push(b),new Do(Math.min(b.x,w.x),Math.min(b.y,w.y),Math.max(Math.abs(w.x-b.x),e.marker.width),Math.max(Math.abs(w.y-b.y),e.marker.width)));v.regions.push(C),v.visible&&Nye(m[v.index-1],v,m[v.index+1],e)?(null===a&&(a=new Tve(v.xValue,0),l=(l+=d+" "+(s=L0e(v.xValue-h,g,t,i,n)).x+" "+s.y+" ")+"L "+(s=L0e(v.xValue-h,v.high>v.low?v.high:v.low,t,i,n)).x+" "+s.y+" ",this.borderDirection+=d+" "+s.x+" "+s.y+" "),null!=this.prevPoint?(s=L0e(v.xValue,v.high>v.low?v.high:v.low,t,i,n),w=L0e(this.prevPoint.xValue,this.prevPoint.high>this.prevPoint.low?this.prevPoint.high:this.prevPoint.low,t,i,n),l+=this.GetStepLineDirection(s,w,e.step,d,e,!1),this.borderDirection+=this.GetStepLineDirection(s,w,e.step,d,e,!0)):"Gap"===e.emptyPointSettings.mode&&(l+=d+" "+(s=L0e(v.xValue,v.high>v.low?v.high:v.low,t,i,n)).x+" "+s.y+" ",this.borderDirection+=d+" "+s.x+" "+s.y+" "),p=!1,d=" L",this.prevPoint=v,(f+1<m.length&&!m[f+1].visible||f===m.length-1)&&(d="M",l=(l=this.closeRangeStepAreaPath(m,v,e,l,f,t,i,n)).concat(" Z "),p=!0,a=this.prevPoint=null)):(!1===p&&0!==f&&(l=this.closeRangeStepAreaPath(m,v,e,l,f,t,i,n),p=!0),d="M",v.symbolLocations=[])}var S=new No(e.chart.element.id+"_Series_"+e.index,e.interior,0,"transparent",e.opacity,e.dashArray,l);this[o?"addPath":"appendLinePath"](S,e,""),0!==e.border.width&&(this[o?"addPath":"appendLinePath"](new No(e.chart.element.id+"_Series_border_"+e.index,"transparent",c,u,1,e.border.dashArray,this.borderDirection),e,""),this.borderDirection=""),r||this.renderMarker(e)},UCe.prototype.closeRangeStepAreaPath=function(e,t,i,n,o,r,s,a){for(var l,h,d=o;0<=d&&e[d].visible;d--)t=e[d],Math.min(t.low,t.high),Math.max(t.low,t.high),s.isAxisInverse,null!=this.prevPoint&&(l=L0e(t.xValue,t.low<t.high?t.low:t.high,r,s,a),h=L0e(this.prevPoint.xValue,this.prevPoint.low<this.prevPoint.high?this.prevPoint.low:this.prevPoint.high,r,s,a),n+=this.GetStepLineDirection(l,h,"Right"===i.step?"Left":"Left"===i.step?"Right":i.step,"L",i,!1),this.borderDirection+=d===o?this.GetStepLineDirection(l,h,"Right"===i.step?"Left":"Left"===i.step?"Right":i.step,"M",i,!0):this.GetStepLineDirection(l,h,"Right"===i.step?"Left":"Left"===i.step?"Right":i.step,"L",i,!0)),this.prevPoint=t;return n},UCe.prototype.updateDirection=function(n,o){this.render(n,n.xAxis,n.yAxis,n.chart.requireInvertedAxis,!1,!0);for(var e=0;e<o.length;e++)!function(i){n.marker&&n.marker.visible&&n.points[o[i]].symbolLocations.map(function(e,t){n.chart.markerRender.renderMarker(n,n.points[o[i]],e,t,!0)}),n.marker.dataLabel.visible&&n.chart.dataLabelModule&&(n.chart.dataLabelModule.commonId=n.chart.element.id+"_Series_"+n.index+"_Point_",n.chart.dataLabelModule.renderDataLabel(n,n.points[o[i]],null,n.marker.dataLabel))}(e)},UCe.prototype.addPath=function(e,t,i){i=this.appendPathElement(e,t,i);if(""!==i.previousDirection&&""!==e.d){var n=i.previousDirection.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),o=e.d.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),r=Math.max(n.length,o.length),s=Math.min(n.length,o.length);if(n.length<o.length){for(var a=n.length;a<o.length;a++)o.length!==n.length&&(n.splice(Math.floor(n.length/2)-1,0,n[Math.floor(n.length/2)-1],n[Math.floor(n.length/2)-1]),n.splice(Math.floor(n.length/2)+2,0,n[Math.floor(n.length/2)+2],n[Math.floor(n.length/2)+2]));f0e(i.element,e.d,t.chart.redraw,n.join(" "),this.chart.duration)}else if(n.length>o.length){for(a=s;a<r;a++)o.length!==n.length&&(o.splice(2,0,o[2]),o.splice(o.length-3,0,o[o.length-3]));f0e(i.element,o.join(""),t.chart.redraw,i.previousDirection,this.chart.duration,e.d)}else f0e(i.element,e.d,t.chart.redraw,i.previousDirection,this.chart.duration)}},UCe.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},UCe.prototype.getModuleName=function(){return"RangeStepAreaSeries"},UCe.prototype.destroy=function(){};var jCe,WCe,QCe=UCe;function UCe(){var e=null!==WCe&&WCe.apply(this,arguments)||this;return e.borderDirection="",e.prevPoint=null,e}qCe=function(e,t){return(qCe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}qCe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(XCe,GCe=Mwe),XCe.prototype.render=function(e){for(var t=this.getSideBySideInfo(e),i=Math.max(e.yAxis.visibleRange.min,0),n=0,o="",r=0,s=null,a=e.chart.requireInvertedAxis,l=0,h=e.chart.redraw,d=0,p=e.points;d<p.length;d++){var c,u,g,m,f,y,v,b,w,C,S=p[d];S.symbolLocations=[],S.regions=[],S.visible&&Nye(e.points[S.index-1],S,e.points[S.index+1],e)&&(u=this.isIntermediateSum(e,S.index),c=this.isSumIndex(e,S.index),r+=u||!0===c?0:S.yValue,c=this.getRectangle(S.xValue+t.start,r,S.xValue+t.end,!0===u?l:null===n||c?i:n,e),u&&(l=r),n=r,(u=this.triggerPointRenderEvent(e,S)).cancel||(this.updateSymbolLocation(S,c,e),this.drawRectangle(e,S,c,u)),u=S.regions[0],null!==s&&(b=a?s.x:s.y,g=a?u.x:u.y,w=m=void 0,f=u.y,y=u.x,v=e.points[S.index-1==-1?1:S.index-1],w=0===S.yValue?(m=a?s.x+s.width:s.y+s.height,a?S.symbolLocations[0].x:S.symbolLocations[0].y):(m=a?0===v.yValue?v.symbolLocations[0].x:s.x+s.width:0===v.yValue?v.symbolLocations[0].y:s.y+s.height,a?u.x+u.width:u.y+u.height),C=Math.round(b)===Math.round(g)||Math.round(m)===Math.round(g)?(C=a?0===u.x&&0===s.x?w:u.x:u.y,0===S.yValue?a?S.symbolLocations[0].x:S.symbolLocations[0].y:C):w,o=a?(0===v.yValue&&(s.y=s.y+s.height/2+c.height/2-s.height),0===S.yValue&&(f=u.y+u.height/2-c.height/2),o.concat("M "+C+" "+(e.xAxis.isInversed?s.y+s.height:s.y)+" L "+C+" "+(e.xAxis.isInversed?f:f+u.height)+" ")):(b=s.x,0===v.yValue&&(b=b+s.width/2+c.width/2-s.width,y=u.x+u.width/2+c.width/2-u.width),0===S.yValue&&(y=u.x+u.width/2-c.width/2),o.concat("M "+(e.xAxis.isInversed?b:b+s.width)+" "+C+" L "+(e.xAxis.isInversed?y+u.width:y)+" "+C+" "))),s=S.regions[0])}var A=new No(e.chart.element.id+"_Series_"+e.index+"_Connector_","none",e.connector.width,e.connector.color,e.opacity,e.connector.dashArray,o),A=(h&&ie(A.id)&&(o=ie(A.id).getAttribute("d")),nve(h,A.id,A,e.chart.renderer)||e.chart.renderer.drawPath(A,new Int32Array([e.clipRect.x,e.clipRect.y])));A.style.visibility=e.chart.enableCanvas?null:(e.animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&e.chart.animateSeries?"hidden":"visible",O0e(e.chart.enableCanvas,e.seriesElement,A,h,!0,null,null,null,o,null,null,null,e.chart.duration),this.renderMarker(e)},XCe.prototype.updateDirection=function(e,t){if(this.render(e),e.marker.visible&&O0e(e.chart.enableCanvas,e.chart.seriesElements,e.symbolElement,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule)for(var i=0;i<t.length;i++){e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_";for(var n=e.chart.dataLabelModule.renderDataLabel(e,e.points[t[i]],null,e.marker.dataLabel),o=0;o<n.length;o++)e.chart.dataLabelModule.doDataLabelAnimation(e,n[o])}},XCe.prototype.isIntermediateSum=function(e,t){return void 0!==e.intermediateSumIndexes&&-1!==e.intermediateSumIndexes.indexOf(t)},XCe.prototype.isSumIndex=function(e,t){return void 0!==e.sumIndexes&&-1!==e.sumIndexes.indexOf(t)},XCe.prototype.triggerPointRenderEvent=function(e,t){var i=this.isIntermediateSum(e,t.index),n=this.isSumIndex(e,t.index),i=i||n?e.summaryFillColor:t.y<0?e.negativeFillColor:e.interior;return this.triggerEvent(e,t,i,{color:e.border.color,width:e.border.width})},XCe.prototype.processInternalData=function(e,t){for(var i,n=e,o=0,r=!je(t.intermediateSumIndexes)&&0<t.intermediateSumIndexes.length?t.intermediateSumIndexes.sort(function(e,t){return e-t}):t.intermediateSumIndexes,s=!je(t.sumIndexes)&&0<t.sumIndexes.length?t.sumIndexes.sort(function(e,t){return e-t}):t.sumIndexes,a=0,l=0;l<n.length;l++)a+=void 0!==n[l][t.yName]?n[l][t.yName]:0,this.cumulativeSums.push(a);if(void 0!==r&&0<r.length)for(l=0;l<r.length;l++)for(var h=0;h<n.length;h++)h===r[l]&&(i=_ye(n,0===l?-1:r[l-1],r[l],null,t),n[h][t.yName]=i);if(void 0!==s&&0<s.length)for(var d=0,p=0;p<s.length;p++)for(h=0;h<n.length;h++)h===s[p]&&(void 0!==r&&r.length>d&&r[p]!==s[p]&&r[p]<s[p]?(i=_ye(n,r.length<=1?r[0]-1:r[p]-1,s[p],s,t),d+=1):i=_ye(n,0===p?-1:s[p-1],s[p],null,t),n[h][t.yName]=o+=i);return n},XCe.prototype.doAnimation=function(e){this.animate(e)},XCe.prototype.getModuleName=function(){return"WaterfallSeries"},XCe.prototype.destroy=function(){};var qCe,GCe,YCe=XCe;function XCe(){var e=null!==GCe&&GCe.apply(this,arguments)||this;return e.cumulativeSums=[],e}KCe=function(e,t){return(KCe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}KCe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})($Ce,JCe=Mwe),$Ce.prototype.render=function(e){this.sideBySideInfo[e.index]=this.getSideBySideInfo(e);for(var t=0,i=e.points;t<i.length;t++){var n=i[t];this.renderPoint(e,n,this.sideBySideInfo[e.index])}},$Ce.prototype.renderPoint=function(e,t,i){var n;t.symbolLocations=[],t.regions=[],t.visible&&Nye(e.points[t.index-1],t,e.points[t.index+1],e)&&(i=this.getRectangle(t.xValue+i.median,t.high,t.xValue+i.median,t.low,e),(n=this.triggerPointRenderEvent(e,t)).cancel||(e.chart.requireInvertedAxis?(i.height=n.border.width,i.y=i.y-i.height/2):(i.width=n.border.width,i.x=i.x-i.width/2),n.border.width=0,this.updateSymbolLocation(t,i,e),this.drawRectangle(e,t,i,n)))},$Ce.prototype.updateDirection=function(e,t){for(var i=0;i<t.length;i++)this.renderPoint(e,e.points[t[i]],this.sideBySideInfo[e.index]),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[i]],null,e.marker.dataLabel))},$Ce.prototype.triggerPointRenderEvent=function(e,t){var i={color:e.fill,width:Math.max(e.border.width,2)};return JCe.prototype.triggerEvent.call(this,e,t,e.interior,i)},$Ce.prototype.getModuleName=function(){return"HiloSeries"},$Ce.prototype.doAnimation=function(e){this.animate(e)},$Ce.prototype.destroy=function(){};var KCe,JCe,ZCe=$Ce;function $Ce(){var e=null!==JCe&&JCe.apply(this,arguments)||this;return e.sideBySideInfo=[],e}eSe=function(e,t){return(eSe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}eSe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(nSe,tSe=Mwe),nSe.prototype.render=function(e){this.sideBySideInfo[e.index]=this.getSideBySideInfo(e);for(var t=Math.max(e.border.width,2),i=0,n=e.points;i<n.length;i++){var o=n[i];this.renderPoint(e,o,this.sideBySideInfo[e.index],t)}},nSe.prototype.renderPoint=function(e,t,i,n){var o,r,s;t.symbolLocations=[],t.regions=[],t.visible&&Nye(e.points[t.index-1],t,e.points[t.index+1],e)&&(o=this.getRectangle(t.xValue+i.start,Math.max(t.high,t.low),t.xValue+i.end,Math.min(t.high,t.low),e),t.regions.push(this.getRectangle(t.xValue+i.median,Math.max(t.high,t.low),t.xValue+i.median,Math.min(t.high,t.low),e)),this.updateTickRegion(!e.chart.requireInvertedAxis,t.regions[0],n),t.regions.push(this.getRectangle(t.xValue+i.start,Math.max(t.open,t.close),t.xValue+i.median,Math.max(t.open,t.close),e)),t.regions.push(this.getRectangle(t.xValue+i.median,Math.min(t.open,t.close),t.xValue+i.end,Math.min(t.open,t.close),e)),(i=this.triggerPointRenderEvent(e,t)).cancel||(this.updateSymbolLocation(t,t.regions[0],e),r=t.open>t.close?1:2,s=t.open>t.close?2:1,r={x:t.regions[r].x,y:t.regions[r].y},s={x:t.regions[s].x,y:t.regions[s].y},this.drawHiloOpenClosePath(e,t,r,s,o,i)),this.updateTickRegion(e.chart.requireInvertedAxis,t.regions[1],n),this.updateTickRegion(e.chart.requireInvertedAxis,t.regions[2],n))},nSe.prototype.updateDirection=function(e,t){for(var i=Math.max(e.border.width,2),n=0;n<t.length;n++)this.renderPoint(e,e.points[t[n]],this.sideBySideInfo[e.index],i),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[n]],null,e.marker.dataLabel))},nSe.prototype.updateTickRegion=function(e,t,i){e?(t.x-=i/2,t.width=i):(t.y-=i/2,t.height=i)},nSe.prototype.triggerPointRenderEvent=function(e,t){var i=t.open<=t.close?e.bearFillColor||e.chart.themeStyle.bearFillColor:e.bullFillColor||e.chart.themeStyle.bullFillColor,n={color:e.border.color,width:Math.max(e.border.width,1)};return this.triggerEvent(e,t,i,n)},nSe.prototype.drawHiloOpenClosePath=function(e,t,i,n,o,r){var s=e.chart.requireInvertedAxis?(s="M "+o.x+" "+(o.y+o.height/2)+" L "+(o.x+o.width)+" "+(o.y+o.height/2)+" ",(s+="M "+i.x+" "+(o.y+o.height/2)+" L "+i.x+" "+(o.y+o.height)+" ")+"M "+n.x+" "+(o.y+o.height/2)+" L "+n.x+" "+o.y+" "):(s="M "+(o.x+o.width/2)+" "+(o.y+o.height)+" L "+(o.x+o.width/2)+" "+o.y+" ",(s+="M "+o.x+" "+i.y+" L "+(o.x+o.width/2+r.border.width/2)+" "+i.y+" ")+"M "+(o.x+o.width/2-r.border.width/2)+" "+n.y+" L "+(o.x+o.width)+" "+n.y+" "),i=new No(e.chart.element.id+"_Series_"+e.index+"_Point_"+(null!==e.removedPointIndex&&e.removedPointIndex<=t.index?t.index+1:t.index),r.fill,r.border.width,r.fill,e.opacity,e.dashArray,s),o=(m0e(ie(i.id),s,e.chart.redraw,null,e.chart.duration),e.chart.renderer.drawPath(i,new Int32Array([e.clipRect.x,e.clipRect.y])));null!==e.removedPointIndex&&e.removedPointIndex<=t.index&&(o.id=e.chart.element.id+"_Series_"+e.index+"_Point_"+t.index),o.setAttribute("role","img"),o.setAttribute("aria-label",e.accessibility.accessibilityDescriptionFormat?e.formatAccessibilityDescription(t,e):t.x.toString()+":"+t.high.toString()+":"+t.low.toString()+":"+t.close.toString()+":"+t.open.toString()),e.chart.enableCanvas||e.seriesElement.appendChild(o)},nSe.prototype.getModuleName=function(){return"HiloOpenCloseSeries"},nSe.prototype.doAnimation=function(e){this.animate(e)},nSe.prototype.destroy=function(){};var eSe,tSe,iSe=nSe;function nSe(){var e=null!==tSe&&tSe.apply(this,arguments)||this;return e.sideBySideInfo=[],e}oSe=function(e,t){return(oSe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}oSe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(aSe,rSe=Awe),aSe.prototype.render=function(e,t,i,n,o,r){for(var s,a="",l="M",h=void 0,d=e.border.width||0,p=e.border.color||e.interior,c=this.enableComplexProperty(e),u=0,g=c.length;u<g;u++){(s=c[u]).symbolLocations=[],s.regions=[];var m=Math.min(s.low,s.high),f=Math.max(s.low,s.high),y=(i.isAxisInverse&&(y=m,m=f,f=y),L0e(s.xValue,m,t,i,n)),m=L0e(s.xValue,f,t,i,n),f=(s.symbolLocations.push(m),s.symbolLocations.push(y),new Do(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)));n?f.y-=e.marker.width/2:f.x-=e.marker.width/2,s.regions.push(f),s.visible&&Nye(c[s.index-1],s,c[s.index+1],e)?(a=a.concat(l+" "+y.x+" "+y.y+" "),this.borderDirection+=l+" "+y.x+" "+y.y+" ",h=!1,(u+1<c.length&&!c[u+1].visible||u===c.length-1)&&(l="M",a=(a=this.closeRangeAreaPath(c,s,e,a,u)).concat(" Z"),h=!0),l="L"):(!1===h&&0!==u&&(a=this.closeRangeAreaPath(c,s,e,a,u),h=!0),l="M",s.symbolLocations=[])}var v="Indicator"===e.category?e.chart.element.id+"_Indicator_"+e.index+"_"+e.name:e.chart.element.id+"_Series_"+e.index,v=new No(v,e.interior,0,"transparent",e.opacity,e.dashArray,a);this[o?"addPath":"appendLinePath"](v,e,""),0!==e.border.width&&(this[o?"addPath":"appendLinePath"](new No(e.chart.element.id+"_Series_border_"+e.index,"transparent",d,p,1,e.border.dashArray,this.borderDirection),e,""),this.borderDirection=""),r||this.renderMarker(e)},aSe.prototype.closeRangeAreaPath=function(e,t,i,n,o){for(var r=o;0<=r&&(e[r].visible&&e[r].symbolLocations[0]);r--)n+="L "+(t=e[r]).symbolLocations[0].x+" "+t.symbolLocations[0].y+" ",this.borderDirection+=(r===o?"M":"L")+" "+t.symbolLocations[0].x+" "+t.symbolLocations[0].y+" ";return n},aSe.prototype.updateDirection=function(n,o){this.render(n,n.xAxis,n.yAxis,n.chart.requireInvertedAxis,!1,!0);for(var e=0;e<o.length;e++)!function(i){n.marker&&n.marker.visible&&n.points[o[i]].symbolLocations.map(function(e,t){n.chart.markerRender.renderMarker(n,n.points[o[i]],e,t,!0)}),n.marker.dataLabel.visible&&n.chart.dataLabelModule&&(n.chart.dataLabelModule.commonId=n.chart.element.id+"_Series_"+n.index+"_Point_",n.chart.dataLabelModule.renderDataLabel(n,n.points[o[i]],null,n.marker.dataLabel))}(e)},aSe.prototype.addPath=function(e,t,i){i=this.appendPathElement(e,t,i);if(""!==i.previousDirection&&""!==e.d){var n=i.previousDirection.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),o=e.d.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),r=Math.max(n.length,o.length),s=Math.min(n.length,o.length);if(n.length<o.length){for(var a=n.length;a<o.length;a++)o.length!==n.length&&n.splice((n.length-1)/2,0,n.slice(0,(n.length-1)/2).pop(),n.slice(0,(n.length-1)/2+1).pop());f0e(i.element,e.d,t.chart.redraw,n.join(" "),this.chart.duration)}else if(n.length>o.length){for(a=s;a<r;a++)o.length!==n.length&&(o.splice(1,0,o[0]),o.splice(o.length-2,0,o[o.length-2]));f0e(i.element,o.join(""),t.chart.redraw,i.previousDirection,this.chart.duration,e.d)}else f0e(i.element,e.d,t.chart.redraw,i.previousDirection,this.chart.duration)}},aSe.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},aSe.prototype.getModuleName=function(){return"RangeAreaSeries"},aSe.prototype.destroy=function(){};var oSe,rSe,sSe=aSe;function aSe(){var e=null!==rSe&&rSe.apply(this,arguments)||this;return e.borderDirection="",e}lSe=function(e,t){return(lSe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}lSe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(pSe,hSe=Awe),pSe.prototype.findSplinePoint=function(e){for(var t,i,n=[],o=0,r=!1,s=this.filterEmptyPoints(e),a=0;a<s.length;a++)null!==(i=s[a]).x&&""!==i.x&&(i.index=o,o++,n.push(i));if(this.splinePoints=this.findSplineCoefficients(n,e,!1),"SplineRangeArea"===e.type&&(this.lowSplinePoints=this.findSplineCoefficients(n,e,!0)),1<n.length){e.drawPoints=[],e.lowDrawPoints=[];for(var l=0,h=n;l<h.length;l++){var d,p=h[l],r=r||p.yValue<0;0!==p.index&&(d=this.getPreviousIndex(n,p.index-1,e),"SplineRangeArea"===e.type&&(n[d].yValue=n[d].high>n[d].low?n[d].high:n[d].low,p.yValue=p.high>p.low?p.high:p.low),t=this.getControlPoints(n[d],p,this.splinePoints[d],this.splinePoints[p.index],e),e.drawPoints.push(t),"SplineRangeArea"===e.type&&(n[d].yValue=n[d].low<n[d].high?n[d].low:n[d].high,p.yValue=p.low<p.high?p.low:p.high,d=this.getControlPoints(n[d],p,this.lowSplinePoints[d],this.lowSplinePoints[p.index],e),e.lowDrawPoints.push(d)),d=e.yMax-e.yMin,p.yValue)&&t.controlPoint1.y&&t.controlPoint2.y&&1<d&&(e.yMin=Math.min(e.yMin,p.yValue,t.controlPoint1.y,t.controlPoint2.y),e.yMax=Math.ceil(Math.max(e.yMax,p.yValue,t.controlPoint1.y,t.controlPoint2.y)),e.yMin="Logarithmic"!==e.yAxis.valueType?Math.floor(e.yMin):e.yMin)}!r&&e.yMin<0&&(e.yMin=0),"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))}},pSe.prototype.getPreviousIndex=function(e,t,i){if("Drop"===i.emptyPointSettings.mode)for(;je(e[t])&&-1<t;)t-=1;return t},pSe.prototype.getNextIndex=function(e,t,i){if("Drop"===i.emptyPointSettings.mode)for(;je(e[t])&&t<e.length;)t+=1;return t},pSe.prototype.filterEmptyPoints=function(e,t){if("Drop"!==e.emptyPointSettings.mode&&this.isPointInRange(e.points))return t||e.points;for(var i=t||Pe([],e.points,null,!0),n=0;n<i.length;n++)i[n].index=n,i[n].isEmpty&&(i[n].symbolLocations=[],i[n].regions=[],i.splice(n,1),n--);return i},pSe.prototype.isPointInRange=function(e){for(var t=0,i=e;t<i.length;t++)if(!i[t].isPointInRange)return!1;return!0},pSe.prototype.findSplineCoefficients=function(e,t,i){var n=[],o=t.cardinalSplineTension||.5;switch(o<0?o=0:1<o&&(o=1),t.splineType){case"Monotonic":n=this.monotonicSplineCoefficients(e,t,i);break;case"Cardinal":n=this.cardinalSplineCofficients(e,t);break;default:"Clamped"===t.splineType?n=this.clampedSplineCofficients(e,t,i):(n[0]=[][0]=0,n[e.length-1]=0),n=this.naturalSplineCoefficients(e,t,i)}return n},pSe.prototype.monotonicSplineCoefficients=function(e,t,i){for(var n,o=e.length,r=[],s=[],a=[],l=[],h=0;h<o-1;h++)"SplineRangeArea"===t.type&&(i||(e[h+1].yValue=e[h+1].high>e[h+1].low?e[h+1].high:e[h+1].low,e[h].yValue=e[h].high>e[h].low?e[h].high:e[h].low),i)&&(e[h+1].yValue=e[h+1].low<e[h+1].high?e[h+1].low:e[h+1].high,e[h].yValue=e[h].low<e[h].high?e[h].low:e[h].high),s[h]=e[h+1].xValue-e[h].xValue,a[h]=e[h+1].yValue-e[h].yValue,l[h]=a[h]/s[h];var d=l.length;r[0]=l[0],r[o-1]=l[d-1];for(var p=0;p<s.length;p++)p+1<d&&(r[p+1]=l[p]*l[p+1]<=0?0:3*(n=s[p]+s[p+1])/((n+s[p+1])/l[p]+(n+s[p])/l[p+1]));return r},pSe.prototype.cardinalSplineCofficients=function(e,t){for(var i=e.length,n=[],o=(o=t.cardinalSplineTension||.5)<0?0:1<o?1:o,r=0;r<i;r++)n[r]=0===r?2<i?o*(e[r+2].xValue-e[r].xValue):0:r===i-1?2<i?o*(e[i-1].xValue-e[i-3].xValue):0:o*(e[r+1].xValue-e[r-1].xValue);return n},pSe.prototype.clampedSplineCofficients=function(e,t,i){for(var n=e.length,o=[],r=0;r<n-1;r++)"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,0,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]=(0,Math.abs(o[0])===1/0?0:o[0]),o[e.length-1]=(e.length-1,Math.abs(o[e.length-1])===1/0?0:o[e.length-1]);return o},pSe.prototype.naturalSplineCoefficients=function(e,t,i){var n,o,r,s,a=e.length,l=[],h=[];l[0]=h[0]=0,l[e.length-1]=0;for(var d,p=1;p<a-1;p++)"SplineRangeArea"===t.type&&(i||(e[p+1].yValue=e[p+1].low>e[p+1].high?e[p+1].low:e[p+1].high,e[p].yValue=e[p].low>e[p].high?e[p].low:e[p].high,e[p-1].yValue=e[p-1].low>e[p-1].high?e[p-1].low:e[p-1].high),i)&&(e[p+1].yValue=e[p+1].high<e[p+1].low?e[p+1].high:e[p+1].low,e[p].yValue=e[p].high<e[p].low?e[p].high:e[p].low,e[p-1].yValue=e[p-1].high<e[p-1].low?e[p-1].high:e[p-1].low),r=e[p].xValue-e[p-1].xValue,d=e[p+1].xValue-e[p-1].xValue,s=e[p+1].xValue-e[p].xValue,n=e[p+1].yValue-e[p].yValue||null,o=e[p].yValue-e[p-1].yValue||null,0==r||0==d||0==s?h[p]=l[p]=0:(l[p]=-(d=1/(r*l[p-1]+2*d))*s,h[p]=d*(6*(n/s-o/r)-r*h[p-1]));for(var c=a-2;0<=c;c--)l[c]=l[c]*l[c+1]+h[c];return l},pSe.prototype.getControlPoints=function(e,t,i,n,o){var r=i,s=n,a=e.xValue,l=e.yValue,h=t.xValue,d=t.yValue;switch(o.splineType){case"Cardinal":"DateTime"===o.xAxis.valueType&&(r=i/this.dateTimeInterval(o),s=n/this.dateTimeInterval(o)),c=new Tve(a+i/3,l+r/3),u=new Tve(h-n/3,d-s/3),g=new Bve(c,u);break;case"Monotonic":var p=(h-a)/3,c=new Tve(a+p,l+i*p),u=new Tve(h-p,d-n*p),g=new Bve(c,u);break;default:var p=h-a,m=1/3*(2*l+d-1/3*(p*=p)*(i+.5*n)),p=1/3*(l+2*d-1/3*p*(.5*i+n));c=new Tve((2*a+h)*(1/3),m),u=new Tve((a+2*h)*(1/3),p),g=new Bve(c,u)}return g},pSe.prototype.dateTimeInterval=function(e){e=e.xAxis.actualIntervalType,e="Years"===e?31536e6:"Months"===e?2592e6:"Days"===e?864e5:"Hours"===e?36e5:"Minutes"===e?6e4:"Seconds"===e?1e3:2592e6;return e},pSe.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)};var lSe,hSe,dSe=pSe;function pSe(e){e=hSe.call(this,e)||this;return e.splinePoints=[],e.lowSplinePoints=[],e}cSe=function(e,t){return(cSe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}cSe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(mSe,uSe=dSe),mSe.prototype.render=function(e,t,i,n,o,r){for(var s,a="",l=void 0,h=null,d=[],p=0,c=e.border.width||0,u=e.border.color||e.interior,g="",m=this.filterEmptyPoints(e),f=0;f<m.length;f++)null!==(s=m[f]).x&&""!==s.x&&(s.index=p,p++,d.push(s));for(var y=this.enableComplexProperty(e),v=y.length,f=0;f<v;f++){(s=y[f]).regions=[],s.symbolLocations=[];var b=this.getNextIndex(d,s.index-1,e),w=this.getPreviousIndex(d,s.index-1,e),C=Math.min(s.low,s.high),S=Math.max(s.low,s.high),A=(i.isAxisInverse&&(A=C,C=S,S=A),L0e(s.xValue,C,t,i,n)),C=L0e(s.xValue,S,t,i,n),S=(s.symbolLocations.push(C),s.symbolLocations.push(A),new Do(Math.min(A.x,C.x),Math.min(A.y,C.y),Math.max(Math.abs(C.x-A.x),e.marker.width),Math.max(Math.abs(C.y-A.y),e.marker.width)));n?S.y-=e.marker.width/2:S.x-=e.marker.width/2,s.regions.push(S),s.visible&&Nye(y[w],s,y[b],e)?(h?(S=e.drawPoints[w].controlPoint1,b=e.drawPoints[w].controlPoint2,w=L0e(s.xValue,s.high>s.low?s.high:s.low,t,i,n),S=L0e(S.x,S.y,t,i,n),b=L0e(b.x,b.y,t,i,n),a=a.concat("C "+S.x+" "+S.y+" "+b.x+" "+b.y+" "+w.x+" "+w.y+" "),this.borderDirection+="C "+S.x+" "+S.y+" "+b.x+" "+b.y+" "+w.x+" "+w.y+" "):(g=(a=i.isAxisInverse?a.concat("M "+C.x+" "+C.y+" L "+A.x+" "+A.y+" "):a.concat("M "+A.x+" "+A.y+" L "+C.x+" "+C.y+" "),this.borderDirection+="M "+C.x+" "+C.y+" ","L "+A.x+" "+A.y),l=!1),(f+1<y.length&&!y[f+1].visible||f===y.length-1)&&(a=this.closeSplineRangeAreaPath(y,s,e,a,f,t,i,n),this.borderDirection+=g,g="",a=a.concat(" Z"),l=!0),h=s):(!1===l&&0!==f&&(a=this.closeSplineRangeAreaPath(y,s,e,a,f,t,i,n),l=!0),h=null,s.symbolLocations=[])}var x="Indicator"===e.category?e.chart.element.id+"_Indicator_"+e.index+"_"+e.name:e.chart.element.id+"_Series_"+e.index,x=new No(x,e.interior,0,"transparent",e.opacity,e.dashArray,a);this[o?"addPath":"appendLinePath"](x,e,""),0!==e.border.width&&(this[o?"addPath":"appendLinePath"](new No(e.chart.element.id+"_Series_border_"+e.index,"transparent",c,u,1,e.border.dashArray,this.borderDirection),e,""),this.borderDirection=""),r||this.renderMarker(e)},mSe.prototype.closeSplineRangeAreaPath=function(e,t,i,n,o,r,s,a){for(var l,h,d=null,p=o;0<p&&e[p].visible;p--){t=e[p];var c=Math.min(t.low,t.high),u=Math.max(t.low,t.high),g=(s.isAxisInverse&&(g=c,c=u,u=g),L0e(t.xValue,c,r,s,a)),c=L0e(t.xValue,u,r,s,a);d?(u=i.lowDrawPoints[p].controlPoint1,h=i.lowDrawPoints[p].controlPoint2,l=L0e(t.xValue,t.low<t.high?t.low:t.high,r,s,a),u=L0e(u.x,u.y,r,s,a),h=L0e(h.x,h.y,r,s,a),isNaN(u.y)&&isNaN(h.y)||(n=n.concat("C "+h.x+" "+h.y+" "+u.x+" "+u.y+" "+l.x+" "+l.y+" "),this.borderDirection+="C "+h.x+" "+h.y+" "+u.x+" "+u.y+" "+l.x+" "+l.y+" ")):s.isAxisInverse?(n=n.concat("L "+c.x+" "+c.y+" "),this.borderDirection+="M "+c.x+" "+c.y+" "):(n=n.concat("L "+g.x+" "+g.y+" "),this.borderDirection+="M "+g.x+" "+g.y+" "),d=t}return n},mSe.prototype.updateDirection=function(n,o){this.render(n,n.xAxis,n.yAxis,n.chart.requireInvertedAxis,!1,!0);for(var e=0;e<o.length;e++)!function(i){n.marker&&n.marker.visible&&n.points[i].symbolLocations.map(function(e,t){n.chart.markerRender.renderMarker(n,n.points[o[i]],e,t,!0)}),n.marker.dataLabel.visible&&n.chart.dataLabelModule&&(n.chart.dataLabelModule.commonId=n.chart.element.id+"_Series_"+n.index+"_Point_",n.chart.dataLabelModule.renderDataLabel(n,n.points[o[i]],null,n.marker.dataLabel))}(e)},mSe.prototype.addPath=function(e,t,i){i=this.appendPathElement(e,t,i);if(""!==i.previousDirection&&""!==e.d){var n=i.previousDirection.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),o=e.d.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),r=Math.max(n.length,o.length),s=Math.min(n.length,o.length);if(n.length<o.length){for(var a=n.length;a<o.length;a++)o.length!==n.length&&(n.splice(n.length/2+1,0,"C "+n[(n.length-1)/2].split(" ").slice(5,7).join(" ")+" "+n[(n.length-1)/2].split(" ").slice(5,7).join(" ")+" "+n[(n.length-1)/2].split(" ").slice(5,7).join(" ")),n.splice(n.length/2+2,0,"C "+n[n.length/2+1].split(" ").slice(1,3).join(" ")+" "+n[n.length/2+1].split(" ").slice(1,3).join(" ")+" "+n[n.length/2+1].split(" ").slice(1,3).join(" ")));f0e(i.element,e.d,t.chart.redraw,n.join(" "),this.chart.duration)}else if(n.length>o.length){for(a=s;a<r;a++)o.length!==n.length&&(o.splice(2,0,"C "+o[1].split(" ").slice(-3).join(" ")+o[1].split(" ").slice(-3).join(" ")+o[1].split(" ").slice(-3).join(" ")),o.splice(o.length-1,0,"C "+o[o.length-2].split(" ").slice(-4).join(" ")+o[o.length-2].split(" ").slice(-4).join(" ")+o[o.length-2].split(" ").slice(-4).join(" ")));f0e(i.element,o.join(""),t.chart.redraw,i.previousDirection,this.chart.duration,e.d)}else f0e(i.element,e.d,t.chart.redraw,i.previousDirection,this.chart.duration)}},mSe.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},mSe.prototype.getModuleName=function(){return"SplineRangeAreaSeries"},mSe.prototype.destroy=function(){};var cSe,uSe,gSe=mSe;function mSe(){var e=null!==uSe&&uSe.apply(this,arguments)||this;return e.borderDirection="",e}ySe.prototype.render=function(e,t,i,n){var o,r=e.points,s=Math.max(e.chart.initialClipRect.height,e.chart.initialClipRect.width),a=s/100,l=e.maxRadius*a,h=e.minRadius*a,d=null;if(null===e.maxRadius||null===e.minRadius){for(var p=0,c=e.chart.visibleSeries;p<c.length;p++){var u=c[p];"Bubble"!==u.type||!0!==u.visible||null!==u.maxRadius&&null!==u.minRadius||(d=u.sizeMax>d?u.sizeMax:d)}h=l=1,o=s/5/2*l}else d=e.sizeMax,o=l-h;for(var g=0,m=r;g<m.length;g++){var f=m[g];this.renderPoint(e,f,n,o,d,h,r)}},ySe.prototype.renderPoint=function(e,t,i,n,o,r,s,a){var l=e.chart.redraw&&t.symbolLocations?t.symbolLocations[0]:null;t.symbolLocations=[],t.regions=[],t.visible&&Nye(s[t.index-1],t,s[t.index+1],e)&&(s=(s=null===e.maxRadius||null===e.minRadius?n*Math.abs(+t.size/o):r+n*Math.abs(+t.size/o))||r,n={cancel:!1,name:jme,series:e,point:t,fill:e.setPointColor(t,e.interior),border:e.setBorderColor(t,{width:e.border.width,color:e.border.color}),height:2*s,width:2*s},e.chart.trigger(jme,n),n.cancel?t.marker={visible:!1}:(t.symbolLocations.push(L0e(t.xValue,t.yValue,e.xAxis,e.yAxis,i)),t.color=n.fill,o=new No(e.chart.element.id+"_Series_"+e.index+"_Point_"+t.index,n.fill,n.border.width,n.border.color,e.opacity,e.border.dashArray),a&&ie(o.id)&&(l={x:+(r=ie(o.id)).getAttribute("cx"),y:+r.getAttribute("cy")}),i=A0e(t.symbolLocations[0],"Circle",new Eo(n.width,n.height),e.marker.imageUrl,o,(t.x.toString(),t.yValue.toString()),e.chart.svgRenderer,e.clipRect),O0e(e.chart.enableCanvas,e.seriesElement,i,e.chart.redraw,!0,"cx","cy",l,null,!1,!1,null,e.chart.duration,!0),t.regions.push(new Do(t.symbolLocations[0].x-s,t.symbolLocations[0].y-s,2*s,2*s)),t.marker={border:n.border,fill:n.fill,height:n.height,visible:!0,shape:"Circle",width:n.width},e.chart.enableCanvas&&e.chart.markerRender.render(e),l=e.chart.redraw&&!l?t.symbolLocations[0]:l,e.chart.redraw&&ove(i,e.chart.duration||300,l,t.symbolLocations[0],"cx","cy")))},ySe.prototype.updateDirection=function(e,t,i){var n,o=e.points,r=Math.max(e.chart.initialClipRect.height,e.chart.initialClipRect.width),s=r/100,a=e.maxRadius*s,l=e.minRadius*s,h=null;if(null===e.maxRadius||null===e.minRadius){for(var d=0,p=e.chart.visibleSeries;d<p.length;d++){var c=p[d];"Bubble"!==c.type||!0!==c.visible||null!==c.maxRadius&&null!==c.minRadius||(h=c.sizeMax>h?c.sizeMax:h)}l=a=1,n=r/5/2*a}else h=e.sizeMax,n=a-l;for(var u=0;u<t.length;u++)this.renderPoint(e,e.points[t[u]],i,n,h,l,o,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[u]],null,e.marker.dataLabel))},ySe.prototype.destroy=function(){},ySe.prototype.getModuleName=function(){return"BubbleSeries"},ySe.prototype.doAnimation=function(e){for(var t=e.animation.duration,i=e.animation.delay,n=e.seriesElement.childNodes,o=1,r=0,s=e.points;r<s.length;r++){var a=s[r];a.symbolLocations.length&&(u0e(n[o],i,t,e,a.index,a.symbolLocations[0],!1),o++)}};var fSe=ySe;function ySe(){}vSe=function(e,t){return(vSe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}vSe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(CSe,bSe=dSe),CSe.prototype.render=function(e,t,i,n,o,r){for(var s,a=null,l="",h="M",d="TrendLine"===e.category?e.points:this.enableComplexProperty(e),p=this.filterEmptyPoints(e,d),c="PolarRadar"===e.chart.chartAreaType?Xye:L0e,u=0,g=p;u<g.length;u++){var m=g[u];1===m.index&&(l=""),s=this.getPreviousIndex(p,m.index-1,e),m.symbolLocations=[],m.regions=[],m.visible?(Nye(p[s],m,p[this.getNextIndex(p,m.index-1,e)],e)&&(null!==a&&(l=this.getSplineDirection(e.drawPoints[s],a,m,t,i,n,e,h,c,l),h="L"),this.storePointLocation(m,e,n,c),""===l&&1===p.length&&(l="M "+m.symbolLocations[0].x+" "+m.symbolLocations[0].y),null===a)&&""!==l&&(m.index===p.length-1||p[m.index+1]&&!p[m.index+1].visible)&&(l+="M "+m.symbolLocations[0].x+" "+m.symbolLocations[0].y+" "),a=m):(h="M",a=null,m.symbolLocations=[])}0<p.length&&0<e.drawPoints.length&&"PolarRadar"===e.chart.chartAreaType&&e.isClosed&&(d=this.getFirstLastVisiblePoint(p),l=this.getSplineDirection(e.drawPoints[e.drawPoints.length-1],d.last,{xValue:d.first.xValue,yValue:d.first.yValue},t,i,n,e,h,c,l),h="L");d="TrendLine"===e.category?e.chart.element.id+"_Series_"+e.sourceIndex+"_TrendLine_"+e.index:e.chart.element.id+"_Series_"+e.index,d=new No(d,"transparent",e.width,e.interior,e.opacity,e.dashArray,l);this[o?"addPath":"appendLinePath"](d,e,""),r||this.renderMarker(e)},CSe.prototype.getSplineDirection=function(e,t,i,n,o,r,s,a,l,h){var d=e.controlPoint1,e=e.controlPoint2,t=l(t.xValue,t.yValue,n,o,r,s),i=l(i.xValue,i.yValue,n,o,r,s),d=l(d.x,d.y,n,o,r,s),l=l(e.x,e.y,n,o,r,s);return h.concat(a+" "+t.x+" "+t.y+" C "+d.x+" "+d.y+" "+l.x+" "+l.y+" "+i.x+" "+i.y+" ")},CSe.prototype.updateDirection=function(e,t){this.render(e,e.xAxis,e.yAxis,e.chart.requireInvertedAxis,!1,!0);for(var i=0;i<t.length;i++)e.marker&&e.marker.visible&&e.chart.markerRender.renderMarker(e,e.points[t[i]],e.points[t[i]].symbolLocations[0],null,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[i]],null,e.marker.dataLabel))},CSe.prototype.addPath=function(e,t,i){i=this.appendPathElement(e,t,i);if(""!==i.previousDirection&&""!==e.d){var n=i.previousDirection.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),o=e.d.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),r=Math.max(n.length,o.length),s=Math.min(n.length,o.length);if(0===t.removedPointIndex&&n.length>o.length&&n[2]&&0===n[2].indexOf("M")&&(n.splice(0,n.length-o.length),i.previousDirection=n.join("")),n.length<o.length){for(var a,l=n.length;l<o.length;l++)o.length!==n.length&&(o.length===n.length+1&&0===o[o.length-1].indexOf("M")?n.push(o[o.length-1]):0===n[n.length-1].indexOf("C")?n.push("L "+n[n.length-1].split(" ").slice(-3).join(" ")):0===n[n.length-1].indexOf("L")?(a=n[n.length-1].split(" ").slice(-3),n.push("C "+a.join(" ")+a.join(" ")+a.join(" "))):(a=n[n.length-1].replace("M",""),n.push("C"+a+a+a)));f0e(i.element,e.d,t.chart.redraw,n.join(" "),this.chart.duration)}else if(n.length>o.length){for(var h,d,l=s;l<r;l++)t.removedPointIndex===t.points.length&&o.length!==n.length?0===o[o.length-1].indexOf("C")?o.push("L "+o[o.length-1].split(" ").slice(-3).join(" ")):0===o[o.length-1].indexOf("L")?(h=o[o.length-1].split(" ").slice(-3),o.push("C "+h.join(" ")+h.join(" ")+h.join(" "))):(h=o[o.length-1].replace("M",""),o.push("C"+h+h+h)):1===o.length?(d=o[o.length-1].replace("M",""),o.push("C"+d+d+d)):o.length!==n.length&&o.splice(1,0,"C "+o[0].split(" ").slice(-3).join(" ")+o[0].split(" ").slice(-3).join(" ")+o[0].split(" ").slice(-3).join(" "),o[0].replace("M","L"));f0e(i.element,o.join(""),t.chart.redraw,i.previousDirection,this.chart.duration,e.d)}else f0e(i.element,e.d,t.chart.redraw,i.previousDirection,this.chart.duration)}},CSe.prototype.getModuleName=function(){return"SplineSeries"},CSe.prototype.destroy=function(){};var vSe,bSe,wSe=CSe;function CSe(){return null!==bSe&&bSe.apply(this,arguments)||this}SSe=function(e,t){return(SSe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}SSe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ISe,ASe=Fwe),ISe.prototype.render=function(e){ASe.prototype.render.call(this,e),e.showNormalDistribution&&this.renderNormalDistribution(e)},ISe.prototype.calculateBinInterval=function(e,t){for(var i=Vye(e)/e.length,n=0,o=0,r=e;o<r.length;o++){var s=r[o];n+=(s-i)*(s-i)}t.histogramValues.mean=i,t.histogramValues.sDValue=Math.sqrt(Math.abs(n/e.length)),t.histogramValues.binWidth=t.binInterval||Math.round(3.5*t.histogramValues.sDValue/Math.pow(e.length,1/3))||1},ISe.prototype.processInternalData=function(e,t){for(var i,n=[],o=[],r=Object.keys(e),s=0;s<r.length;s++){var a=r[s];o.push(e[a][t.yName])}t.histogramValues={yValues:o};for(var l,h=Math.min.apply(Math,t.histogramValues.yValues),d=Math.max.apply(Math,t.histogramValues.yValues),p=(this.calculateBinInterval(t.histogramValues.yValues,t),t.histogramValues.binWidth),c=0;c<e.length;)l=o.filter(function(e){return h<=e&&e<h+p}).length,h+p===d&&(l+=o.filter(function(e){return d<=e}).length),n.push(((i={x:h+p/2})[t.yName]=l,i)),h+=p,c+=l;return n},ISe.prototype.calculateBinValues=function(e){var t,i=e.histogramValues.yValues.length,n=e.histogramValues.binWidth,o=e.histogramValues.mean,r=e.histogramValues.sDValue,s=e.xAxis.minimum?parseInt(e.xAxis.minimum.toString(),10):e.xMin,a=((e.xAxis.maximum?parseInt(e.xAxis.maximum.toString(),10):e.xMax)-s)/499;if(e.points.length)for(var l=0;l<500;l++)t=s+l*a,t=Math.exp(-(t-o)*(t-o)/(2*r*r))/(r*Math.sqrt(2*Math.PI))*n*i,e.yMin=e.yMin>t?t:e.yMin,e.yMax=e.yMax<t?t:e.yMax},ISe.prototype.renderNormalDistribution=function(e){var t,i=e.xAxis.actualRange.min,n=e.xAxis.actualRange.max,o="",r="M",s=e.histogramValues.yValues.length,a=e.histogramValues.binWidth,l=e.histogramValues.mean,h=e.histogramValues.sDValue,d=(n-i)/499;if(e.points.length)for(var p=0;p<500;p++)o+=r+" "+(t=L0e(t=i+p*d,Math.exp(-(t-l)*(t-l)/(2*h*h))/(h*Math.sqrt(2*Math.PI))*a*s,e.xAxis,e.yAxis,e.chart.requireInvertedAxis)).x+" "+t.y+" ",r="L";n=e.chart.renderer.drawPath(new No(e.chart.element.id+"_Series_"+e.index+"_NDLine","transparent",2,e.chart.themeStyle.histogram||e.chart.themeStyle.errorBar,e.opacity,e.dashArray,o),new Int32Array([e.clipRect.x,e.clipRect.y]));n.style.visibility=e.chart.enableCanvas?null:(e.animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&e.chart.animateSeries?"hidden":"visible",e.chart.enableCanvas||e.seriesElement.appendChild(n)},ISe.prototype.doAnimation=function(e){ASe.prototype.doAnimation.call(this,e),e.showNormalDistribution&&S0e(e.seriesElement.lastElementChild,0===e.animation.duration?1e3:e.animation.duration,500,"FadeIn")},ISe.prototype.updateDirection=function(e){this.render(e),e.marker.visible&&O0e(e.chart.enableCanvas,e.chart.seriesElements,e.symbolElement,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelCollections=[],e.chart.dataLabelModule.render(e,e.chart,e.marker.dataLabel),e.textElement)&&(O0e(e.chart.enableCanvas,e.chart.dataLabelElements,e.shapeElement,!0),O0e(e.chart.enableCanvas,e.chart.dataLabelElements,e.textElement,!0))},ISe.prototype.getModuleName=function(){return"HistogramSeries"},ISe.prototype.destroy=function(){};var SSe,ASe,xSe=ISe;function ISe(){return null!==ASe&&ASe.apply(this,arguments)||this}TSe=function(e,t){return(TSe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}TSe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(MSe,ESe=dSe),MSe.prototype.render=function(e,t,i,n,o,r){for(var s,a,l,h,d=null,p="",c=null,u=[],g=0,m=this.filterEmptyPoints(e),f=0;f<m.length;f++)null!==(l=m[f]).x&&""!==l.x&&(l.index=g,g++,u.push(l));for(var y,v=u.length,b="PolarRadar"===e.chart.chartAreaType?Xye:L0e,w="PolarRadar"===e.chart.chartAreaType?e.points[0].yValue:Math.max(e.yAxis.visibleRange.min,0),f=0;f<v;f++)(l=u[f]).symbolLocations=[],l.regions=[],y=this.getPreviousIndex(u,l.index-1,e),l.visible&&Nye(u[y],l,u[this.getNextIndex(u,l.index-1,e)],e)?(p=d?(a=e.drawPoints[y].controlPoint1,y=e.drawPoints[y].controlPoint2,s=b(l.xValue,l.yValue,t,i,n,e),a=b(a.x,a.y,t,i,n,e),y=b(y.x,y.y,t,i,n,e),p.concat("C "+a.x+" "+a.y+" "+y.x+" "+y.y+" "+s.x+" "+s.y+" ")):(p+="M "+(c=b(l.xValue,w,t,i,n,e)).x+" "+c.y+" ")+"L "+(a=b(l.xValue,l.yValue,t,i,n,e)).x+" "+a.y+" ",this.storePointLocation(l,e,n,b),d=l):(d=null,l.symbolLocations=[]),(f+1<v&&!u[f+1].visible||f===v-1)&&s&&c&&(c=b(l.xValue,w,t,i,n,e),p=p.concat("L "+c.x+" "+c.y+" "));this[o?"addPath":"appendLinePath"](new No(e.chart.element.id+"_Series_"+e.index,e.interior,0,"transparent",e.opacity,e.dashArray,p),e,""),0!==e.border.width&&(h=this.removeEmptyPointsBorder(this.getBorderDirection(p)),this[o?"addPath":"appendLinePath"](new No(e.chart.element.id+"_Series_border_"+e.index,"transparent",e.border.width,e.border.color||e.interior,1,e.border.dashArray,h),e,"")),r||this.renderMarker(e)},MSe.prototype.updateDirection=function(e,t){this.render(e,e.xAxis,e.yAxis,e.chart.requireInvertedAxis,!1,!0);for(var i=0;i<t.length;i++)e.marker&&e.marker.visible&&e.chart.markerRender.renderMarker(e,e.points[t[i]],e.points[t[i]].symbolLocations[0],null,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[i]],null,e.marker.dataLabel))},MSe.prototype.addPath=function(e,t,i){i=this.appendPathElement(e,t,i);if(""!==i.previousDirection&&""!==e.d){2===i.previousDirection.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g).length&&(i.previousDirection=i.previousDirection.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g)[0]+"L "+i.previousDirection.split(" ")[1]+" "+i.previousDirection.split(" ")[2]+" C "+i.previousDirection.split(" ")[1]+" "+i.previousDirection.split(" ")[2]+" "+i.previousDirection.split(" ")[1]+" "+i.previousDirection.split(" ")[2]+" "+i.previousDirection.split(" ")[1]+" "+i.previousDirection.split(" ")[2]+" L "+i.previousDirection.split(" ")[1]+" "+i.previousDirection.split(" ")[2]),2===e.d.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g).length&&(e.d=i.previousDirection.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g)[0]+"L "+i.previousDirection.split(" ")[1]+" "+i.previousDirection.split(" ")[2]+" C "+i.previousDirection.split(" ")[1]+" "+i.previousDirection.split(" ")[2]+" "+i.previousDirection.split(" ")[1]+" "+i.previousDirection.split(" ")[2]+" "+i.previousDirection.split(" ")[1]+" "+i.previousDirection.split(" ")[2]+" L "+i.previousDirection.split(" ")[1]+" "+i.previousDirection.split(" ")[2]);var n=i.previousDirection.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),o=e.d.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/g),r=Math.max(n.length,o.length),s=Math.min(n.length,o.length);if(n.length<o.length){for(var a,l=n.length;l<o.length;l++)o.length!==n.length&&(a=void 0,d="C "+(a=(4===n[n.length-1].split(" ").length&&-1!==e.id.indexOf("border")?n[n.length-(-1!==e.id.indexOf("border")?1:2)].split(" ").slice(1):n[n.length-(-1!==e.id.indexOf("border")?1:2)].split(" ").slice(5)).join(" "))+a+a,-1!==e.id.indexOf("border")?n.push(d):n.splice(n.length-1,0,d));f0e(i.element,e.d,t.chart.redraw,n.join(" "),this.chart.duration)}else if(n.length>o.length){for(var h,d,l=s;l<r;l++)o.length!==n.length&&(h=void 0,t.removedPointIndex===t.points.length?(d="C "+(h=(4===n[n.length-1].split(" ").length&&-1!==e.id.indexOf("border")?o[o.length-(-1!==e.id.indexOf("border")?1:2)].split(" ").slice(1):o[o.length-(-1!==e.id.indexOf("border")?1:2)].split(" ").slice(5)).join(" "))+h+h,-1!==e.id.indexOf("border")?o.push(d):o.splice(o.length-1,0,d)):(h=4===n[n.length-1].split(" ").length?"C "+o[-1!==e.id.indexOf("border")?0:1].split(" ").slice(-3).join(" ")+o[-1!==e.id.indexOf("border")?0:1].split(" ").slice(1).join(" ")+o[-1!==e.id.indexOf("border")?0:1].split(" ").slice(1).join(" "):"C "+o[-1!==e.id.indexOf("border")?0:1].split(" ").slice(-3).join(" ")+o[-1!==e.id.indexOf("border")?0:1].split(" ").slice(-3).join(" ")+o[-1!==e.id.indexOf("border")?0:1].split(" ").slice(-3).join(" "),o.splice(-1!==e.id.indexOf("border")?1:2,0,h)));f0e(i.element,o.join(""),t.chart.redraw,i.previousDirection,this.chart.duration,e.d)}else f0e(i.element,e.d,t.chart.redraw,i.previousDirection,this.chart.duration)}},MSe.prototype.getModuleName=function(){return"SplineAreaSeries"},MSe.prototype.destroy=function(){};var TSe,ESe,DSe=MSe;function MSe(){return null!==ESe&&ESe.apply(this,arguments)||this}kSe=function(e,t){return(kSe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}kSe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(BSe,PSe=Awe),BSe.prototype.initSeriesCollection=function(e,t){e.targetSeries=[];var i=new bbe(e,"targetSeries",{},!0);this.setSeriesProperties(i,e,e.type,e.fill,e.width,t)},BSe.prototype.setSeriesProperties=function(e,t,i,n,o,r){e.name=i.length<=4?i.toLocaleUpperCase():i,e.xName="x",e.yName="y",e.fill=n||"#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=r,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)},BSe.prototype.createIndicatorElements=function(e,t,i){(t.seriesName||t.dataSource)&&a0e(t.targetSeries[0]);var n=new Do(0,0,0,0),o=((t.seriesName||t.dataSource)&&(n=t.targetSeries[0].clipRect),new vve(e.element.id+"_ChartIndicatorClipRect_"+i,"transparent",{width:1,color:"Gray"},1,{x:0,y:0,width:n.width,height:n.height})),r=y0e(e.redraw,o,e.renderer);t.indicatorElement=e.renderer.createGroup({id:e.element.id+"IndicatorGroup"+i,transform:"translate("+n.x+","+n.y+")","clip-path":"url(#"+e.element.id+"_ChartIndicatorClipRect_"+i+")"}),t.indicatorElement&&(t.indicatorElement.setAttribute("role",t.accessibility.accessibilityRole||""),t.indicatorElement.setAttribute("tabindex",t.accessibility.focusable?String(t.accessibility.tabIndex):"-1"),t.accessibility.focusable&&(t.indicatorElement.style.outline="none"),t.indicatorElement.setAttribute("aria-label",t.accessibility.accessibilityDescription||""),t.indicatorElement.appendChild(r));for(var s=0,a=t.targetSeries;s<a.length;s++){var l=a[s],h=(l.clipRectElement=r,l.chart.renderer.createGroup({id:l.chart.element.id+"_Indicator_"+t.index+"_"+l.name+"_Group"}));t.indicatorElement&&t.indicatorElement.appendChild(h),l.seriesElement=h}e.indicatorElements&&e.indicatorElements.appendChild(t.indicatorElement)},BSe.prototype.getDataPoint=function(e,t,i,n,o,r){void 0===r&&(r=null);var s=new nbe;return s.x=e,s.y=t,s.xValue=i.xValue,s.color=n.fill,s.index=o,s.yValue=t,s.visible=!0,n.xMin=Math.min(n.xMin,s.xValue),n.yMin=Math.min(n.yMin,s.yValue),n.xMax=Math.max(n.xMax,s.xValue),n.yMax=Math.max(n.yMax,s.yValue),n.xData.push(s.xValue),r&&"Macd"===r.type&&"Column"===n.type&&(0<=s.y?s.color=r.macdPositiveColor:s.color=r.macdNegativeColor),s},BSe.prototype.getRangePoint=function(e,t,i,n,o,r){var s=new nbe;return s.x=e,s.high=t,s.low=i,s.xValue=n.xValue,s.color=o.fill,s.index=r,s.visible=!0,o.xData.push(s.xValue),s},BSe.prototype.setSeriesRange=function(e,t,i){(i=void 0===i?null:i)?i.points=e:t.targetSeries[0].points=e};var kSe,PSe,dSe=BSe;function BSe(){return null!==PSe&&PSe.apply(this,arguments)||this}FSe=function(e,t){return(FSe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}FSe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(RSe,LSe=dSe),RSe.prototype.initDataSource=function(e){var t=[],i=e.points;if(i&&i.length){var n=i,o=l0e(e.field),r=e.targetSeries[0];if(n&&n.length&&n.length>=e.period){for(var s,a=0,l=0;l<e.period;l++)a+=n[l][o];s=a/e.period,t.push(this.getDataPoint(n[e.period-1].x,s,n[e.period-1],r,t.length));for(var h=e.period;h<n.length;)s=(a=(a-=n[h-e.period][o])+n[h][o])/e.period,t.push(this.getDataPoint(n[h].x,s,n[h],r,t.length)),h++}this.setSeriesRange(t,e)}},RSe.prototype.destroy=function(){},RSe.prototype.getModuleName=function(){return"SmaIndicator"};var FSe,LSe,Awe=RSe;function RSe(){return null!==LSe&&LSe.apply(this,arguments)||this}OSe=function(e,t){return(OSe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}OSe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(_Se,NSe=dSe),_Se.prototype.initDataSource=function(e){var t=l0e(e.field),i=[],n=e.targetSeries[0],o=e.points;if(o&&o.length&&o.length>=e.period){for(var r,s=0,a=2/(e.period+1),l=0;l<e.period;l++)s+=o[l][t];r=s/e.period,i.push(this.getDataPoint(o[e.period-1].x,r,o[e.period-1],n,i.length));for(var h=e.period;h<o.length;){var d=i[h-e.period][n.yName],d=(o[h][t]-d)*a+d;i.push(this.getDataPoint(o[h].x,d,o[h],n,i.length)),h++}}this.setSeriesRange(i,e)},_Se.prototype.destroy=function(){},_Se.prototype.getModuleName=function(){return"EmaIndicator"};var OSe,NSe,VSe=_Se;function _Se(){return null!==NSe&&NSe.apply(this,arguments)||this}HSe=function(e,t){return(HSe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}HSe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(WSe,zSe=dSe),WSe.prototype.initDataSource=function(e){var t=[],i=l0e(e.field),n=e.points;if(n&&n.length&&n.length>=e.period){var o=e.targetSeries[0],r=e.points;if(r.length&&r.length>=e.period){for(var s=0,a=[],l=0,h=r.length,d=e.period;d<=h;){for(var s=0,p=l=r.length-h;p<l+d;p++)s+=r[p][i];a.push(s/=d),h--}for(var c=0;c<d-1;c++){for(p=s=0;p<c+1;p++)s+=r[p][i];a.splice(c,0,s/=c+1)}for(l=e.period;l<=a.length;){s=0;for(p=l-e.period;p<l;p++)s+=a[p];s/=e.period,t.push(this.getDataPoint(r[l-1].x,s,r[l-1],o,t.length)),l++}}}this.setSeriesRange(t,e)},WSe.prototype.destroy=function(){},WSe.prototype.getModuleName=function(){return"TmaIndicator"};var HSe,zSe,jSe=WSe;function WSe(){return null!==zSe&&zSe.apply(this,arguments)||this}QSe=function(e,t){return(QSe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}QSe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(GSe,USe=dSe),GSe.prototype.initDataSource=function(e){var t=[],i=e.points;0<i.length&&i.length>e.period&&(t=this.calculateADPoints(e,i)),this.setSeriesRange(t,e)},GSe.prototype.calculateADPoints=function(e,t){for(var i,n,o,r=[],s=0,a=0,l=e.targetSeries[0],a=0;a<t.length;a++)i=Number(t[a].high),n=Number(t[a].low),s+=((o=Number(t[a].close))-n-(i-o))/(i-n||1)*Number(t[a].volume),r[a]=this.getDataPoint(t[a].x,s,t[a],l,r.length);return r},GSe.prototype.destroy=function(){},GSe.prototype.getModuleName=function(){return"AccumulationDistributionIndicator"};var QSe,USe,qSe=GSe;function GSe(){return null!==USe&&USe.apply(this,arguments)||this}YSe=function(e,t){return(YSe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}YSe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(JSe,XSe=dSe),JSe.prototype.initDataSource=function(e){var t=e.points;0<t.length&&t.length>e.period&&this.calculateATRPoints(e,t)},JSe.prototype.calculateATRPoints=function(e,t){for(var i,n=0,o=0,r=0,s=[],a=[],l=e.period,h=0,d=e.targetSeries[0],p=0;p<t.length;p++)i=Number(t[p].high)-Number(t[p].low),0<p&&(o=Math.abs(Number(t[p].high)-Number(t[p-1].close)),r=Math.abs(Number(t[p].low)-Number(t[p-1].close))),h+=i=Math.max(i,o,r),l<=p?(n=(Number(a[p-1].y)*(l-1)+i)/l,s.push(this.getDataPoint(t[p].x,n,t[p],d,s.length))):(n=h/l,p===l-1&&s.push(this.getDataPoint(t[p].x,n,t[p],d,s.length))),a[p]={x:t[p].x,y:n};this.setSeriesRange(s,e)},JSe.prototype.destroy=function(){},JSe.prototype.getModuleName=function(){return"AtrIndicator"};var YSe,XSe,KSe=JSe;function JSe(){return null!==XSe&&XSe.apply(this,arguments)||this}ZSe=function(e,t){return(ZSe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}ZSe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(tAe,$Se=dSe),tAe.prototype.initSeriesCollection=function(e,t){$Se.prototype.initSeriesCollection.call(this,e,t);var i=new bbe(e,"targetSeries",{},!0);$Se.prototype.setSeriesProperties.call(this,i,e,"UpperLine",e.upperLine.color,e.upperLine.width,t)},tAe.prototype.initDataSource=function(e){var t=[],i=[],n=e.points;if(n&&n.length){var o=e.targetSeries[1],r=e.targetSeries[0],s=e.period;if(n.length>=e.period)for(var a=0;a<n.length;a++)t.push(this.getDataPoint(n[a].x,100,n[a],o,t.length)),a<s||i.push(this.getDataPoint(n[a].x,Number(n[a].close)/Number(n[a-s].close)*100,n[a],r,i.length));this.setSeriesRange(i,e,e.targetSeries[0]),this.setSeriesRange(t,e,e.targetSeries[1])}},tAe.prototype.destroy=function(){},tAe.prototype.getModuleName=function(){return"MomentumIndicator"};var ZSe,$Se,eAe=tAe;function tAe(){return null!==$Se&&$Se.apply(this,arguments)||this}iAe=function(e,t){return(iAe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}iAe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(rAe,nAe=dSe),rAe.prototype.initSeriesCollection=function(e,t){var i;nAe.prototype.initSeriesCollection.call(this,e,t),e.showZones&&(i=new bbe(e,"targetSeries",{},!0),nAe.prototype.setSeriesProperties.call(this,i,e,"LowerLine",e.lowerLine.color,e.lowerLine.width,t),i=new bbe(e,"targetSeries",{},!0),nAe.prototype.setSeriesProperties.call(this,i,e,"UpperLine",e.upperLine.color,e.upperLine.width,t))},rAe.prototype.initDataSource=function(e){var t=[],i=[],n=[],o=e.targetSeries[0],r=e.points;if(r.length&&r.length>=e.period){if(e.showZones)for(var s=0;s<r.length;s++)n.push(this.getDataPoint(r[s].x,e.overBought,r[s],e.targetSeries[1],n.length)),i.push(this.getDataPoint(r[s].x,e.overSold,r[s],e.targetSeries[2],i.length));for(var a=Number(r[0].close),l=0,h=0,s=1;s<=e.period;s++){var d=Number(r[s].close);a<d?l+=d-a:h+=a-d,a=d}l/=e.period,h/=e.period,t.push(this.getDataPoint(r[e.period].x,100-100/(1+l/h),r[e.period],o,t.length));for(var p=e.period+1;p<r.length;p++){var c=Number(r[p].close);a<c?(l=(l*(e.period-1)+(c-a))/e.period,h=h*(e.period-1)/e.period):c<a&&(h=(h*(e.period-1)+(a-c))/e.period,l=l*(e.period-1)/e.period),a=c,t.push(this.getDataPoint(r[p].x,100-100/(1+l/h),r[p],o,t.length))}}this.setSeriesRange(t,e,e.targetSeries[0]),e.showZones&&(this.setSeriesRange(n,e,e.targetSeries[1]),this.setSeriesRange(i,e,e.targetSeries[2]))},rAe.prototype.destroy=function(){},rAe.prototype.getModuleName=function(){return"RsiIndicator"};var iAe,nAe,oAe=rAe;function rAe(){return null!==nAe&&nAe.apply(this,arguments)||this}sAe=function(e,t){return(sAe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}sAe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(hAe,aAe=dSe),hAe.prototype.initSeriesCollection=function(e,t){aAe.prototype.initSeriesCollection.call(this,e,t);var i=new bbe(e,"targetSeries",{},!0);this.setSeriesProperties(i,e,"PeriodLine",e.periodLine.color,e.periodLine.width,t),e.showZones&&(i=new bbe(e,"targetSeries",{},!0),this.setSeriesProperties(i,e,"UpperLine",e.upperLine.color,e.upperLine.width,t),i=new bbe(e,"targetSeries",{},!0),this.setSeriesProperties(i,e,"LowerLine",e.lowerLine.color,e.lowerLine.width,t))},hAe.prototype.initDataSource=function(e){var t,i=[],n=[],o=[],r=[],s=e.points;if(s.length&&s.length>=e.period){if(e.showZones)for(var a=0;a<s.length;a++)n.push(this.getDataPoint(s[a].x,e.overBought,s[a],e.targetSeries[2],n.length)),o.push(this.getDataPoint(s[a].x,e.overSold,s[a],e.targetSeries[3],o.length));t=this.calculatePeriod(e.period,e.kPeriod,s,e.targetSeries[1]),r=this.smaCalculation(e.period,e.kPeriod,t,e.targetSeries[1]),i=this.smaCalculation(e.period+e.kPeriod-1,e.dPeriod,t,e.targetSeries[0])}this.setSeriesRange(i,e,e.targetSeries[0]),this.setSeriesRange(r,e,e.targetSeries[1]),e.showZones&&(this.setSeriesRange(n,e,e.targetSeries[2]),this.setSeriesRange(o,e,e.targetSeries[3]))},hAe.prototype.smaCalculation=function(e,t,i,n){var o=[];if(i.length>=e+t){for(var r=e+(t-1),s=[],a=[],l=0;l<i.length;l++){var h=Number(i[l].y);s.push(h)}for(var d=s.length;r<=d;){for(var p=0,l=e-1;l<e+t-1;l++)p+=s[l];a.push((p/=t).toFixed(2)),s.splice(0,1),d=s.length}for(var c=r-1,l=0;l<i.length;l++)l<c||(o.push(this.getDataPoint(i[l].x,Number(a[l-c]),i[l],n,o.length)),i[l].y=Number(a[l-c]))}return o},hAe.prototype.calculatePeriod=function(e,t,i,n){for(var o=[],r=[],s=[],a=[],l=0;l<i.length;l++)o[l]=i[l].low,r[l]=i[l].high,s[l]=i[l].close;if(i.length>e){for(var h=[],d=[],p=0;p<e-1;++p)d.push(0),h.push(0),a.push(this.getDataPoint(i[p].x,i[p].close,i[p],n,a.length));for(p=e-1;p<i.length;++p){for(var c=Number.MAX_VALUE,u=Number.MIN_VALUE,l=0;l<e;++l)c=Math.min(c,o[p-l]),u=Math.max(u,r[p-l]);d.push(u),h.push(c)}for(p=e-1;p<i.length;++p){var g=0,m=0;g+=s[p]-h[p],m+=d[p]-h[p],a.push(this.getDataPoint(i[p].x,g/m*100,i[p],n,a.length))}}return a},hAe.prototype.destroy=function(){},hAe.prototype.getModuleName=function(){return"StochasticIndicator"};var sAe,aAe,lAe=hAe;function hAe(){return null!==aAe&&aAe.apply(this,arguments)||this}dAe=function(e,t){return(dAe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}dAe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(uAe,pAe=dSe),uAe.prototype.initSeriesCollection=function(e,t){e.targetSeries=[];var i=new bbe(e,"targetSeries",{},!0),i=(i.type="RangeArea","transparent"!==e.bandColor&&"none"!==e.bandColor&&this.setSeriesProperties(i,e,"BollingerBand",e.bandColor,0,t),new bbe(e,"targetSeries",{},!0)),i=(this.setSeriesProperties(i,e,"BollingerBand",e.fill,e.width,t),new bbe(e,"targetSeries",{},!0)),i=(this.setSeriesProperties(i,e,"UpperLine",e.upperLine.color,e.upperLine.width,t),new bbe(e,"targetSeries",{},!0));this.setSeriesProperties(i,e,"LowerLine",e.lowerLine.color,e.lowerLine.width,t)},uAe.prototype.initDataSource=function(e){var t="transparent"!==e.bandColor&&"none"!==e.bandColor,i=t?1:0,n=[],o=[],r=[],s=[],a=e.targetSeries[1+i],l=e.targetSeries[2+i],h=e.targetSeries[i],d=t?e.targetSeries[0]:null,p=e.points;if(p.length&&p.length>=e.period){for(var c=0,u=0,g=e.standardDeviation,m=p.length,f=Math.round(e.period),y=[],v=[],b=[],w=0;w<f;w++)c+=Number(p[w].close);for(var C=c/e.period,S=0;S<m;S++){var A=Number(p[S].close);if(f-1<=S&&S<m){0<=S-e.period?(C=(c+=A-Number(p[S-f].close))/e.period,y[S]=C,v[S]=Math.pow(A-C,2),u+=v[S]-v[S-f]):(y[S]=C,v[S]=Math.pow(A-C,2),u+=v[S]);var x=Math.sqrt(u/e.period),I=y[S]-g*x,T=y[S]+g*x;if(S+1===f)for(var E=0;E<f-1;E++)b[E]={X:p[E].x,mb:y[S],lb:I,ub:T,visible:!0};b[S]={X:p[S].x,mb:y[S],lb:I,ub:T,visible:!0}}else S<e.period-1&&(y[S]=C,v[S]=Math.pow(A-C,2),u+=v[S])}for(var D=-1,M=-1,k=0;k<m;k++)f-1<=k&&(o.push(this.getDataPoint(p[k].x,b[k].ub,p[k],a,o.length)),r.push(this.getDataPoint(p[k].x,b[k].lb,p[k],l,r.length)),n.push(this.getDataPoint(p[k].x,b[k].mb,p[k],h,n.length)),t)&&s.push(this.getRangePoint(p[k].x,o[++D].y,r[++M].y,p[k],d,s.length))}t&&this.setSeriesRange(s,e,e.targetSeries[0]),this.setSeriesRange(n,e,e.targetSeries[i]),this.setSeriesRange(o,e,e.targetSeries[1+i]),this.setSeriesRange(r,e,e.targetSeries[2+i])},uAe.prototype.destroy=function(){},uAe.prototype.getModuleName=function(){return"BollingerBandsIndicator"};var dAe,pAe,cAe=uAe;function uAe(){return null!==pAe&&pAe.apply(this,arguments)||this}gAe=function(e,t){return(gAe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}gAe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(fAe,mAe=dSe),fAe.prototype.initSeriesCollection=function(e,t){var i;mAe.prototype.initSeriesCollection.call(this,e,t),"Line"!==e.macdType&&"Both"!==e.macdType||(i=new bbe(e,"targetSeries",{},!0),this.setSeriesProperties(i,e,"MacdLine",e.macdLine.color,e.macdLine.width,t)),"Histogram"!==e.macdType&&"Both"!==e.macdType||((i=new bbe(e,"targetSeries",{},!0)).type="Column",this.setSeriesProperties(i,e,"Histogram",e.macdPositiveColor,e.width,t))},fAe.prototype.initDataSource=function(e){var t,i,n=[],o=e.fastPeriod,r=e.slowPeriod,s=e.period,a=o+s,l=[],h=[],d=e.points,p=e.targetSeries[0];"Histogram"===e.macdType?t=e.targetSeries[1]:(i=e.targetSeries[1],"Both"===e.macdType&&(t=e.targetSeries[2])),d&&a<d.length&&r<=o&&0<r&&0<=a-2&&(a=this.calculateEMAValues(r,d,"close"),r=this.calculateEMAValues(o,d,"close"),o=this.getMACDVales(e,a,r),l=this.getMACDPoints(e,o,d,i||p),a=this.calculateEMAValues(s,l,"y"),n=this.getSignalPoints(e,a,d,p),t)&&(h=this.getHistogramPoints(e,o,a,d,t)),this.setSeriesRange(n,e,e.targetSeries[0]),t&&this.setSeriesRange(h,e,t),i&&this.setSeriesRange(l,e,i)},fAe.prototype.calculateEMAValues=function(e,t,i){for(var n,o=0,r=[],s=2/(e+1),a=0;a<e;a++)o+=Number(t[a][i]);r.push(n=o/e);for(var l=n,h=e;h<t.length;h++)l=(Number(t[h][i])-l)*s+l,r.push(l);return r},fAe.prototype.getMACDPoints=function(e,t,i,n){for(var o=[],r=e.fastPeriod-1,s=0;r<i.length;)o.push(this.getDataPoint(i[r].x,t[s],i[r],n,o.length)),r++,s++;return o},fAe.prototype.getSignalPoints=function(e,t,i,n){for(var o=e.fastPeriod+e.period-2,r=0,s=[];o<i.length;)s.push(this.getDataPoint(i[o].x,t[r],i[o],n,s.length)),o++,r++;return s},fAe.prototype.getMACDVales=function(e,t,i){for(var n=[],o=e.fastPeriod-e.slowPeriod,r=0;r<i.length;r++)n.push(t[r+o]-i[r]);return n},fAe.prototype.getHistogramPoints=function(e,t,i,n,o){for(var r=e.fastPeriod+e.period-2,s=0,a=[];r<n.length;)a.push(this.getDataPoint(n[r].x,t[s+(e.period-1)]-i[s],n[r],o,a.length,e)),r++,s++;return a},fAe.prototype.destroy=function(){},fAe.prototype.getModuleName=function(){return"MacdIndicator"};var gAe,mAe,dSe=fAe;function fAe(){return null!==mAe&&mAe.apply(this,arguments)||this}vAe.prototype.initSeriesCollection=function(e,t){var i=new bbe(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)},vAe.prototype.setSeriesProperties=function(e,t,i,n,o,r){e.name=t.name,e.xName="x",e.yName="y",e.fill=n||"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=r,e.xMin=1/0,e.xMax=-1/0,e.yMin=1/0,e.yMax=-1/0,e.xData=[],e.yData=[],t.targetSeries=e,r.isBlazor&&(t.targetSeries.border={},t.targetSeries.connector={})},vAe.prototype.createTrendLineElements=function(e,t,i,n,o){t.trendLineElement=n,t.targetSeries.clipRectElement=o,t.targetSeries.seriesElement=n,e.trendLineElements&&e.trendLineElements.appendChild(t.trendLineElement)},vAe.prototype.getDataPoint=function(e,t,i,n){var o=new nbe;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=n,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},vAe.prototype.findSlopeIntercept=function(e,t,i,n){for(var o=0,r=0,s=0,a=0,l=0,h=0,d=0;l<n.length;)isNaN(t[l])&&(t[l]=(t[l-1]+t[l+1])/2),o+=e[l],r+=t[l],s+=e[l]*t[l],a+=e[l]*e[l],l++;var p=i.type;if(!i.intercept||"Linear"!==p&&"Exponential"!==p)h=(n.length*s-o*r)/(n.length*a-o*o),h="Linear"===p?h:Math.abs(h),d="Exponential"===p||"Power"===p?Math.exp((r-h*o)/n.length):(r-h*o)/n.length;else switch(d=i.intercept,p){case"Linear":h=(s-i.intercept*o)/a;break;case"Exponential":h=(s-Math.log(Math.abs(i.intercept))*o)/a}return{slope:h,intercept:d}},vAe.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)}},vAe.prototype.setExponentialRange=function(e,t,i){for(var n=[],o=[],r=0;r<e.length;){var s=e[r],a=s.yValue?Math.log(s.yValue):0;n.push(s.xValue),o.push(a),r++}var l=this.findSlopeIntercept(n,o,t,e);i.points=this.getExponentialPoints(t,e,n,o,i,l)},vAe.prototype.setLogarithmicRange=function(e,t,i){for(var n=[],o=[],r=[],s=0;s<e.length;){var a=e[s],l=a.xValue?Math.log(a.xValue):0;r.push(a.xValue),n.push(l),o.push(a.yValue),s++}var h=this.findSlopeIntercept(n,o,t,e);i.points=this.getLogarithmicPoints(t,e,r,o,i,h)},vAe.prototype.setPolynomialRange=function(e,t,i){for(var n=[],o=[],r=0;r<e.length;){var s=e[r];n.push(s.xValue),o.push(s.yValue),r++}i.points=this.getPolynomialPoints(t,e,n,o,i)},vAe.prototype.setPowerRange=function(e,t,i){for(var n=[],o=[],r=[],s=0;s<e.length;){var a=e[s],l=a.xValue?Math.log(a.xValue):0,h=a.yValue?Math.log(a.yValue):0;r.push(a.xValue),n.push(l),o.push(h),s++}var d=this.findSlopeIntercept(n,o,t,e);i.points=this.getPowerPoints(t,e,r,o,i,d)},vAe.prototype.setLinearRange=function(e,t,i){for(var n=[],o=[],r=0;r<e.length;){var s=e[r];n.push(s.xValue),o.push(s.yValue),r++}var a=this.findSlopeIntercept(n,o,t,e);i.points=this.getLinearPoints(t,e,n,o,i,a)},vAe.prototype.setMovingAverageRange=function(e,t,i){for(var n=[],o=[],r=0;r<e.length;){var s=e[r];o.push(s.xValue),n.push(s.yValue),r++}i.points=this.getMovingAveragePoints(t,e,o,n,i)},vAe.prototype.getLogarithmicPoints=function(e,t,i,n,o,r){var t=Math.round(t.length/2),s=[],a=i[0]-e.backwardForecast,l=a?Math.log(a):0,l=r.intercept+r.slope*l,t=i[t-1],h=t?Math.log(t):0,h=r.intercept+r.slope*h,i=i[i.length-1]+e.forwardForecast,e=i?Math.log(i):0,r=r.intercept+r.slope*e;return s.push(this.getDataPoint(a,l,o,s.length)),s.push(this.getDataPoint(t,h,o,s.length)),s.push(this.getDataPoint(i,r,o,s.length)),s},vAe.prototype.getPowerPoints=function(e,t,i,n,o,r){var t=Math.round(t.length/2),s=[],a=-1<(a=i[0]-e.backwardForecast)?a:0,l=r.intercept*Math.pow(a,r.slope),t=i[t-1],h=r.intercept*Math.pow(t,r.slope),i=i[i.length-1]+e.forwardForecast,e=r.intercept*Math.pow(i,r.slope);return s.push(this.getDataPoint(a,l,o,s.length)),s.push(this.getDataPoint(t,h,o,s.length)),s.push(this.getDataPoint(i,e,o,s.length)),s},vAe.prototype.getPolynomialPoints=function(e,t,i,n,o){var r=t.length<=e.polynomialOrder?t.length:e.polynomialOrder,r=Math.max(2,r);r=Math.min(6,r),e.polynomialOrder=r,e.polynomialSlopes=[],e.polynomialSlopes.length=e.polynomialOrder+1;for(var s=0;s<i.length;){for(var a=i[s],l=n[s],h=0;h<=e.polynomialOrder;)e.polynomialSlopes[h]||(e.polynomialSlopes[h]=0),e.polynomialSlopes[h]+=Math.pow(a,h)*l,++h;s++}for(var d=[],p=(d.length=1+2*e.polynomialOrder,[]),c=(p.length=e.polynomialOrder+1,0);c<e.polynomialOrder+1;)p[c]=[],p[c].length=3,c++;for(var u=0;u<i.length;){for(var g=i[u],m=1,f=0;f<d.length;)d[f]||(d[f]=0),d[f]+=m,m*=g,++f;++u}for(var y=0;y<=e.polynomialOrder;){for(var v=0;v<=e.polynomialOrder;)p[y][v]=d[y+v],++v;++y}return this.gaussJordanElimination(p,e.polynomialSlopes)||(e.polynomialSlopes=null),this.getPoints(e,t,i,o)},vAe.prototype.getMovingAveragePoints=function(e,t,i,n,o){for(var r,s,a=[],l=1===(l=e.period>=t.length?t.length-1:e.period)?1:Math.max(2,l),h=0;h<t.length;){for(var d=s=0,p=h;s<l;p++)s++,d+=n[p];je(d=+l<0?null:d&&d/+l)||isNaN(d)||(r=i[l-1+h],a.push(this.getDataPoint(r,d,o,a.length))),h++}return a},vAe.prototype.getLinearPoints=function(e,t,i,n,o,r){var s=[],a=i.indexOf(Math.max.apply(null,i)),l=i.indexOf(Math.min.apply(null,i)),l=i[l]-e.backwardForecast,h=r.slope*l+r.intercept,i=i[a]+e.forwardForecast,a=r.slope*i+r.intercept;return s.push(this.getDataPoint(l,h,o,s.length)),s.push(this.getDataPoint(i,a,o,s.length)),s},vAe.prototype.getExponentialPoints=function(e,t,i,n,o,r){var t=Math.round(t.length/2),s=[],a=i[0]-e.backwardForecast,l=r.intercept*Math.exp(r.slope*a),t=i[t-1],h=r.intercept*Math.exp(r.slope*t),i=i[i.length-1]+e.forwardForecast,e=r.intercept*Math.exp(r.slope*i);return s.push(this.getDataPoint(a,isNaN(l)?0:l,o,s.length)),s.push(this.getDataPoint(t,isNaN(h)?0:h,o,s.length)),s.push(this.getDataPoint(i,isNaN(e)?0:e,o,s.length)),s},vAe.prototype.getPoints=function(e,t,i,n){var o,r,s=e.polynomialSlopes,a=[],l=1,h=1;for(t.sort(function(e,t){return e.xValue-t.xValue}),i.sort(function(e,t){return e-t});null!==s&&h<=s.length;)r=(o=1===h?i[0]-e.backwardForecast:h===s.length?i[t.length-1]+e.forwardForecast:(l+=(t.length+("DateTime"===n.xAxis.valueType?h:e.forwardForecast))/s.length,i[parseInt(l.toString(),10)-1]),this.getPolynomialYValue(s,o)),a.push(this.getDataPoint(o,r,n,a.length)),h++;return a},vAe.prototype.getPolynomialYValue=function(e,t){for(var i=0,n=0;n<e.length;)i+=e[n]*Math.pow(t,n),n++;return i},vAe.prototype.gaussJordanElimination=function(e,t){for(var i=e.length,n=[],o=[],r=[],s=(r.length=o.length=n.length=i,0);s<i;)r[s]=0,++s;for(var a=0;a<i;){for(var l=0,h=0,d=0,p=0;p<i;){if(1!==r[p])for(var c=0;c<i;)0===r[c]&&Math.abs(e[p][c])>=l&&(l=Math.abs(e[p][c]),h=p,d=c),++c;++p}if(++r[d],h!==d){for(var u=0;u<i;){var g=e[h][u];e[h][u]=e[d][u],e[d][u]=g,++u}var m=t[h];t[h]=t[d],t[d]=m}if(o[a]=h,0===e[n[a]=d][d])return!1;for(var f=1/e[d][d],y=(e[d][d]=1,0);y<i;)e[d][y]*=f,++y;t[d]*=f;for(var v=0;v<i;){if(v!==d){for(g=e[v][d],c=e[v][d]=0;c<i;)e[v][c]-=e[d][c]*g,++c;t[v]-=t[d]*g}++v}++a}for(var b=i-1;0<=b;){if(o[b]!==n[b])for(var w=0;w<i;){var C=e[w][o[b]];e[w][o[b]]=e[w][n[b]],e[w][n[b]]=C,++w}--b}return!0},vAe.prototype.getTrendLineElements=function(e,t){a0e(e);var i=e.clipRect,n=t.renderer.drawClipPath(new vve(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(n);for(var r=0,s=e.trendlines;r<s.length;r++){var a=s[r];this.createTrendLineElements(t,a,a.index,o,n)}},vAe.prototype.destroy=function(){},vAe.prototype.getModuleName=function(){return"TrendLine"};var yAe=vAe;function vAe(){}wAe.prototype.addEventListener=function(){var e;this.chart.isDestroyed||(e=F.isPointer?"pointerleave":"mouseleave",this.chart.on(F.touchMoveEvent,this.mouseMoveHandler,this),this.chart.on(F.touchEndEvent,this.mouseUpHandler,this),this.chart.on(e,this.mouseLeaveHandler,this),this.chart.on("tapHold",this.longPress,this))},wAe.prototype.mouseUpHandler=function(){this.chart.startMove&&this.removeCrosshair(2e3)},wAe.prototype.mouseLeaveHandler=function(){this.removeCrosshair(1e3)},wAe.prototype.mouseMoveHandler=function(e){var t=this.chart;t.stockChart&&t.stockChart.onPanning&&(t.mouseY<t.chartAxisLayoutPanel.seriesClipRect.y?t.mouseY=t.chartAxisLayoutPanel.seriesClipRect.y:t.mouseY>t.chartAxisLayoutPanel.seriesClipRect.y+t.chartAxisLayoutPanel.seriesClipRect.height&&(t.mouseY=t.chartAxisLayoutPanel.seriesClipRect.y+t.chartAxisLayoutPanel.seriesClipRect.height)),"touchmove"===e.type&&(F.isIos||F.isIos7)&&t.startMove&&e.preventDefault&&e.preventDefault(),t.disableTrackTooltip||(t.crosshair.enable&&o0e(t.mouseX,t.mouseY,t.chartAxisLayoutPanel.seriesClipRect)?!t.startMove&&t.isTouch||this.crosshair():this.removeCrosshair(1e3))},wAe.prototype.longPress=function(){var e=this.chart;return o0e(e.mouseX,e.mouseY,e.chartAxisLayoutPanel.seriesClipRect)&&this.crosshair(),!1},wAe.prototype.findMousePoints=function(e){for(var t,i,n,o=this.data.getData(),r=e.isTransposed?"x":"y",s=null,a=1/0,l="x"==r?e.mouseX:e.mouseY,h=!1,d=this.data.mergeXvalues(this.chart.visibleSeries),p=0,c=e.visibleSeries;p<c.length;p++){var u,g=c[p],h=h||g.visible;g.visible&&"TrendLine"!==g.category&&(g=this.data.getClosestX(e,g,d)||o)&&g.point&&g.point.symbolLocations[0]&&(u=g.point.symbolLocations[0][r]+g.series.clipRect[r],e.crosshair.snapToData||e.crosshair.highlightCategory)&&(u=Math.abs(u-l))<a&&(a=u,s=g)}return(e.crosshair.snapToData||e.crosshair.highlightCategory)&&s&&(o=s,e.crosshairModule.highlightWidth=0,e.crosshair.highlightCategory)&&"Category"===o.series.xAxis.valueType&&(i=(t=e.isTransposed||e.requireInvertedAxis?e.chartAxisLayoutPanel.seriesClipRect.height:e.chartAxisLayoutPanel.seriesClipRect.width)/o.series.xAxis.visibleRange.delta,n=(o.point.xValue-o.series.xAxis.visibleRange.min)/(o.series.xAxis.visibleRange.max-o.series.xAxis.visibleRange.min),e.crosshairModule.crosshairLeftOverflow=Math.max(0,i/2-n*t),e.crosshairModule.crosshairRightOverflow=Math.max(0,n*t+i/2-t),e.crosshairModule.highlightWidth=Math.max(0,i-e.crosshairModule.crosshairLeftOverflow-e.crosshairModule.crosshairRightOverflow)),o&&o.point&&this.data.findMouseValues(o,e,this),h},wAe.prototype.crosshair=function(){var e,t,i=this.chart.series.filter(function(e){return e.visible}).length,n=!0,o=((this.chart.crosshair.snapToData||this.chart.crosshair.highlightCategory)&&(n=this.findMousePoints(this.chart)),this.chart),r="",s="",a=document.getElementById(this.elementID+"_crosshair_axis"),l=o.crosshair,h=document.getElementById(this.elementID+"_tooltip"),d=o.chartAxisLayoutPanel.seriesClipRect,p=o.enableCanvas?document.getElementById(this.elementID+"_Secondary_Element"):document.getElementById(this.elementID+"_UserInteraction"),c=document.getElementById(this.elementID+"_Crosshair");if(!o.enableCanvas||c||(c=Q("div",{id:this.elementID+"_Crosshair",styles:"position: absolute; pointer-events: none"}),p.appendChild(c)),this.stopAnimation(),0===i||o.crosshair.snapToData&&void 0===this.valueY||o.isCrosshair&&o.tooltip.enable&&o.tooltipModule&&!o0e(o.tooltipModule.valueX,o.tooltipModule.valueY,d)||o.crosshair.snapToData&&!n)return null;this.valueX=o.crosshair.snapToData||o.crosshair.highlightCategory?this.valueX:o.tooltip.enable&&o.tooltipModule&&o.tooltipModule.valueX?o.tooltipModule.valueX:o.mouseX,this.valueY=o.crosshair.snapToData||o.crosshair.highlightCategory?this.valueY:o.tooltip.enable&&o.tooltipModule&&o.tooltipModule.valueY?o.tooltipModule.valueY:o.mouseY,o.enableCanvas||p.setAttribute("opacity","1"),"Both"!==l.lineType&&"Horizontal"!==l.lineType||(o.crosshair.highlightCategory&&0!==this.highlightWidth&&(o.isTransposed||o.requireInvertedAxis)?(t=this.highlightWidth,o.crosshairModule.valueY=this.adjustCrosshairPositionForOverflow(this.valueY,!0,o),i=this.valueY-t/2,r="M "+d.x+" "+i+" L "+(d.x+d.width)+" "+i+" L "+(d.x+d.width)+" "+(i+t)+" L "+d.x+" "+(i+t)+" Z"):r+="M "+d.x+" "+this.valueY+" L "+(d.x+d.width)+" "+this.valueY),"Both"!==l.lineType&&"Vertical"!==l.lineType||(o.crosshair.highlightCategory&&0!==this.highlightWidth&&!o.requireInvertedAxis?(t=this.highlightWidth,o.crosshairModule.valueX=this.adjustCrosshairPositionForOverflow(this.valueX,!1,o),s="M "+(n=this.valueX-t/2)+" "+d.y+" L "+(n+t)+" "+d.y+" L "+(n+t)+" "+(d.y+d.height)+" L "+n+" "+(d.y+d.height)+" Z"):s+="M "+this.valueX+" "+d.y+" L "+this.valueX+" "+(d.y+d.height)),o.enableCanvas?(a=a||this.svgRenderer.createGroup({id:this.elementID+"_crosshair_axis"}),i=o.tooltip.enable?o.element.id+"_tooltip_svg":o.element.id+"_svg",t=this.svgRenderer.createSvg({id:i,width:o.availableSize.width,height:o.availableSize.height}),o.tooltip.enable&&((h=h||o.tooltipModule.createElement()).appendChild(t),p.appendChild(h)),e=new No(this.elementID+"_HorizontalLine","none",l.line.width,l.horizontalLineColor||l.line.color||o.themeStyle.crosshairLine,l.opacity,-1<o.theme.indexOf("Bootstrap5")||"Fluent2HighContrast"===o.theme||-1<o.theme.indexOf("Tailwind3")?l.dashArray||"2.5":l.dashArray,r),this.drawCrosshairLine(e,c,d.x,this.valueY,d.width,0,r),e=new No(this.elementID+"_VerticalLine","none",l.line.width,l.verticalLineColor||l.line.color||o.themeStyle.crosshairLine,l.opacity,-1<o.theme.indexOf("Bootstrap5")||"Fluent2HighContrast"===o.theme||-1<o.theme.indexOf("Tailwind3")?l.dashArray||"2.5":l.dashArray,s),this.drawCrosshairLine(e,c,this.valueX,d.y,0,d.height,s),this.renderAxisTooltip(o,d,a),t.appendChild(a),o.tooltip.enable||c.appendChild(t)):(0===p.childNodes.length?(n=o.crosshair.highlightCategory&&0!==this.highlightWidth&&(o.isTransposed||o.requireInvertedAxis),i=o.crosshair.highlightCategory&&0!==this.highlightWidth&&!o.requireInvertedAxis,a=o.renderer.createGroup({id:this.elementID+"_crosshair_axis"}),e=new No(this.elementID+"_HorizontalLine",n?l.horizontalLineColor||l.line.color?this.crosshairLightenColor(l.horizontalLineColor||l.line.color):o.themeStyle.crosshairBackground:"none",n?0:l.line.width,n?"none":l.horizontalLineColor||l.line.color||o.themeStyle.crosshairLine,l.opacity,n?null:-1<o.theme.indexOf("Bootstrap5")||"Fluent2HighContrast"===o.theme||-1<o.theme.indexOf("Tailwind3")?l.dashArray||"2.5":l.dashArray,r),this.renderCrosshairLine(e,p),e=new No(this.elementID+"_VerticalLine",i?l.verticalLineColor||l.line.color?this.crosshairLightenColor(l.verticalLineColor||l.line.color):o.themeStyle.crosshairBackground:"none",i?0:l.line.width,i?"none":l.verticalLineColor||l.line.color||o.themeStyle.crosshairLine,l.opacity,i?null:-1<o.theme.indexOf("Bootstrap5")||"Fluent2HighContrast"===o.theme||-1<o.theme.indexOf("Tailwind3")?l.dashArray||"2.5":l.dashArray,s),this.renderCrosshairLine(e,p),p.appendChild(a)):(document.getElementById(this.elementID+"_HorizontalLine").setAttribute("d",r),document.getElementById(this.elementID+"_VerticalLine").setAttribute("d",s)),this.renderAxisTooltip(o,d,p.lastChild))},wAe.prototype.crosshairLightenColor=function(e){e=G0e(Y0e(e));return"rgb("+e.r+","+e.g+","+e.b+",0.25)"},wAe.prototype.adjustCrosshairPositionForOverflow=function(e,t,i){return 0<i.crosshairModule.crosshairLeftOverflow&&(e+=t?-i.crosshairModule.crosshairLeftOverflow/2:i.crosshairModule.crosshairLeftOverflow/2),0<i.crosshairModule.crosshairRightOverflow&&(e+=t?i.crosshairModule.crosshairRightOverflow/2:-i.crosshairModule.crosshairRightOverflow/2),e},wAe.prototype.renderCrosshairLine=function(e,t){e=this.chart.renderer.drawPath(e);t.appendChild(e)},wAe.prototype.drawCrosshairLine=function(e,t,i,n,o,r,s){!document.getElementById(e.id)&&s&&(s=Q("div",{id:e.id}),t.appendChild(s)),document.getElementById(e.id)&&(s="top:"+n.toString()+"px;left:"+i.toString()+"px;width:"+o+"px;height:"+r+"px;fill:"+e.stroke+";border: 0.5px solid "+e.stroke+";opacity: "+e.opacity+" ; position: absolute",n=document.getElementById(e.id),i=document.getElementById(this.elementID+"_crosshair_axis"),n.style.cssText=s,t.style.opacity="1",i)&&(i.style.opacity="1")},wAe.prototype.renderAxisTooltip=function(e,t,i){for(var n,o,r,s,a=0,l=e.axisCollections.length;a<l;a++)if(c=(u=e.axisCollections[a]).placeNextToAxisLine?u.updatedRect:u.rect,u.crosshairTooltip.enable)if(c&&(this.valueX<=c.x+c.width&&c.x<=this.valueX||this.valueY<=c.y+c.height&&c.y<=this.valueY)){if(r=document.getElementById(this.elementID+"_axis_tooltip_"+a),s=document.getElementById(this.elementID+"_axis_tooltip_text_"+a),(n=(n=this.getAxisText(u))&&-1<n.indexOf("<br")?this.getAxisText(u).split(/<br.*?>/g):n)&&!((o=this.tooltipLocation(n,u,t,c)).y+o.height/2>e.availableSize.height||o.y<0)){if(null===r&&(r=e.enableCanvas?this.svgRenderer.drawPath({id:this.elementID+"_axis_tooltip_"+a,fill:u.crosshairTooltip.fill||e.themeStyle.crosshairFill}):e.renderer.drawPath({id:this.elementID+"_axis_tooltip_"+a,fill:u.crosshairTooltip.fill||e.themeStyle.crosshairFill},null),i.appendChild(r),c=new ko(this.elementID+"_axis_tooltip_text_"+a,0,0,e.stockChart&&e.enableRtl?"end":"start",n),s=sve(e.enableCanvas?this.svgRenderer:e.renderer,c,u.crosshairTooltip.textStyle,u.crosshairTooltip.textStyle.color||e.themeStyle.crosshairLabelFont.color,i,null,null,null,null,null,null,0,null,e.enableCanvas,null,this.chart.themeStyle.crosshairLabelFont)),c=n0e(this.rx,this.ry,o,this.arrowLocation,9,this.isTop,this.isBottom,this.isLeft,this.valueX,this.valueY),r.setAttribute("d",c),"string"!=typeof n&&1<n.length)for(var h=0;h<n.length;h++)s.childNodes[h].textContent=n[h];else s.textContent=n;s.setAttribute("x",(o.x+5+(e.enableRtl?this.elementSize.width:0)).toString()),s.setAttribute("y",(o.y+5+3*this.elementSize.height/4).toString());var d,p,c,u=this.chart.element.id+"_shadow";if("string"!=typeof n&&1<n.length){var g=0;s.setAttribute("y",(o.y+5+3*this.elementSize.height/(4*n.length)).toString());for(h=0;h<s.children.length;h++)g+=this.elementSize.height/n.length,s.children[h].setAttribute("x",(o.x+5+(e.enableRtl?this.elementSize.width:0)+this.elementSize.width/2).toString()),s.children[h].setAttribute("y",(parseInt(s.getAttribute("y"),10)+g).toString()),s.children[h].style.textAnchor="middle"}"Fluent"===this.chart.theme||"FluentDark"===this.chart.theme||"Fabric"===this.chart.theme||"FabricDark"===this.chart.theme||"Fluent2HighContrast"===this.chart.theme?(p=this.chart.renderer.createDefs(),c="Fluent"===this.chart.theme||"Fabric"===this.chart.theme?"#D2D0CE":"Fluent2HighContrast"===this.chart.theme?"#FFFFFF":null,d="Fluent"===this.chart.theme||"Fabric"===this.chart.theme||"Fluent2HighContrast"===this.chart.theme?1:null,p.setAttribute("id",this.chart.element.id+"SVG_tooltip_definition"),i.appendChild(p),r.setAttribute("stroke",c),r.setAttribute("stroke-width"," "+d)):-1<this.chart.theme.indexOf("Fluent2")&&(r.setAttribute("box-shadow","0px 1.6px 3.6px 0px #00000021, 0px 0.3px 0.9px 0px #0000001A"),r.setAttribute("filter",F.isIE?"":"url(#"+u+")"),c='<filter id="'+u+'" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="3"/><feOffset dx="-1" dy="3.6" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="0.2"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>',(p=this.chart.renderer.createDefs()).setAttribute("id",this.chart.element.id+"SVG_tooltip_definition"),r.appendChild(p),p.innerHTML=c)}}else Pye(this.elementID+"_axis_tooltip_"+a),Pye(this.elementID+"_axis_tooltip_text_"+a)},wAe.prototype.getAxisText=function(e){this.isBottom=!1,this.isTop=!1,this.isLeft=!1,this.isRight=!1;var t,i="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?.5:0,n=e.isAxisOpposedPosition;return"Horizontal"===e.orientation?(t=r0e(Math.abs(this.valueX-e.rect.x),e.rect.width,e)+i,this.isBottom=!n,this.isTop=n):(t=s0e(Math.abs(this.valueY-e.rect.y),e.rect.height,e)+i,this.isRight=n,this.isLeft=!n),"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.round(t)],e.format):"Logarithmic"===e.valueType?e.format(Math.pow(e.logBase,t)):e.labelFormat&&null!==e.labelFormat.match("{value}")?e.labelFormat.replace("{value}",e.format(t)):e.format(t)},wAe.prototype.tooltipLocation=function(e,t,i,n){var o=i.x,r=i.y,s="Inside"===t.labelPosition,a=t.scrollbarSettings.enable||t.zoomingScrollBar&&t.zoomingScrollBar.svgObject?t.scrollBarHeight:0;if(this.elementSize=So(e,t.crosshairTooltip.textStyle,this.chart.themeStyle.crosshairLabelFont),"string"!=typeof e&&1<e.length){this.elementSize.width=0;for(var l=this.elementSize.height=0;l<e.length;l++){var h=So(e[l],t.crosshairTooltip.textStyle,this.chart.themeStyle.crosshairLabelFont);this.elementSize.height+=h.height,this.elementSize.width<h.width&&(this.elementSize.width=h.width)}}var d,p,c=t.isAxisOpposedPosition;return"Horizontal"===t.orientation?(p=s?n.y-this.elementSize.height-19:n.y+a,d=s?n.y-this.elementSize.height-9:n.y+9,this.arrowLocation=new Tve(this.valueX,p),p=new Do(this.valueX-this.elementSize.width/2-5,d+(s?0:a),this.elementSize.width+10,this.elementSize.height+10),c&&(p.y=s?n.y:n.y-(this.elementSize.height+10+9)-a),p.x<o&&(p.x=o),p.x+p.width>o+i.width&&(p.x-=p.x+p.width-(o+i.width)),this.arrowLocation.x+4.5>p.x+p.width-this.rx&&(this.arrowLocation.x=p.x+p.width-this.rx-9),this.arrowLocation.x-9<p.x+this.rx&&(this.arrowLocation.x=p.x+this.rx+9)):(a*=c?1:-1,this.arrowLocation=new Tve(n.x,this.valueY),d=s?n.x-a:n.x-this.elementSize.width-19,p=new Do(d+a,this.valueY-this.elementSize.height/2-5,this.elementSize.width+10,this.elementSize.height+10),c?(p.x=s?n.x-this.elementSize.width-9:n.x+9+a,p.x+p.width>this.chart.availableSize.width&&(this.arrowLocation.x-=p.x+p.width-this.chart.availableSize.width,p.x-=p.x+p.width-this.chart.availableSize.width)):p.x<0&&(this.arrowLocation.x-=p.x,p.x=0),p.y<r&&(p.y=r),p.y+p.height>=r+i.height&&(p.y-=p.y+p.height-(r+i.height)),this.arrowLocation.y+4.5>p.y+p.height-this.ry&&(this.arrowLocation.y=p.y+p.height-this.ry-4.5),this.arrowLocation.y-4.5<p.y+this.ry&&(this.arrowLocation.y=p.y+this.ry+4.5)),p},wAe.prototype.stopAnimation=function(){H0e(this.crosshairInterval)},wAe.prototype.progressAnimation=function(){H0e(this.crosshairInterval)},wAe.prototype.removeCrosshair=function(e){var t=this.chart,i=t.enableCanvas?document.getElementById(this.elementID+"_Crosshair"):document.getElementById(this.elementID+"_UserInteraction"),n=t.enableCanvas?document.getElementById(this.elementID+"_crosshair_axis"):null;this.stopAnimation(),i&&"0"!==i.getAttribute("opacity")&&(this.crosshairInterval=+setTimeout(function(){new Vt({}).animate(i,{duration:200,progress:function(e){i.style.animation="",t.enableCanvas?(i.style.opacity=(1-e.timeStamp/e.duration).toString(),n.style.opacity=(1-e.timeStamp/e.duration).toString()):i.setAttribute("opacity",(1-e.timeStamp/e.duration).toString())},end:function(){t.enableCanvas?(i.style.opacity="0",n.style.opacity="0"):i.setAttribute("opacity","0"),t.startMove=!1,t.tooltipModule&&(t.tooltipModule.valueX=null,t.tooltipModule.valueY=null)}})},e))},wAe.prototype.getModuleName=function(){return"Crosshair"},wAe.prototype.destroy=function(){};var bAe=wAe;function wAe(e){this.arrowLocation=new Tve(0,0),this.rx=2,this.ry=2,this.highlightWidth=0,this.crosshairLeftOverflow=0,this.crosshairRightOverflow=0,this.chart=e,this.elementID=this.chart.element.id,this.svgRenderer=new fo(this.chart.element.id),(this.chart.crosshair.snapToData||this.chart.crosshair.highlightCategory)&&(this.data=new Wve(this.chart)),this.addEventListener()}SAe.prototype.seriesStyles=function(){var e,t,i=document.getElementById(this.styleId),n="{}",o=this.control.selectionPattern,r=this.control.highlightPattern;if(0<this.styleId.indexOf("highlight")&&""!==this.control.highlightColor||je(i)||"None"!==o||"None"!==r){document.getElementById(this.styleId)&&document.getElementById(this.styleId).remove(),(i=this.control.createElement("div")).setAttribute("id",this.styleId);for(var s=0,a=this.control.visibleSeries;s<a.length;s++){var l=a[s],h=this.control.visibleSeries[l.index]||this.control.visibleSeries[l.index];if(0<this.styleId.indexOf("highlight")&&""!==this.control.highlightColor||(!je(o)||!je(r))&&("None"!==o||"None"!==r)){var d=0<this.styleId.indexOf("highlight")?r:o;if("Pie"!==h.type&&"Funnel"!==h.type&&"Pyramid"!==h.type&&"circularchart3d"!==this.control.getModuleName()||"transparent"===this.control.highlightColor)h.type&&"transparent"!==this.control.highlightColor&&(t=h.opacity,n="{ fill:"+(e=this.pattern(this.control,0<this.styleId.indexOf("highlight")&&""!==this.control.highlightColor?this.control.highlightColor:""!==h.pointColorMapping||this.control.rangeColorSettings&&1<this.control.rangeColorSettings.length?h.points[0].color:h.interior,l.index,d,t))+"}");else for(var p=0;p<h.points.length;p++)t=h.opacity,n="{ fill:"+(e=this.pattern(this.control,0<this.styleId.indexOf("highlight")&&""!==this.control.highlightColor?this.control.highlightColor:h.points[p].color,l.points[p].index,d,t))+"}",l.selectionStyle||(this.styleId,l.index,l.points[p].index,this.styleId,l.index,l.points[p].index),"None"===this.control.highlightMode&&this.control.legendSettings.enableHighlight&&!l.isRectSeries&&(i.innerText+="."+this.styleId+"_series_"+l.index+"> * { stroke-width:3;} ",this.selectionStyle.push([this.styleId+"_series_"+l.index,"stroke-width","3"])),n=-1<n.indexOf("None")?"{fill:"+(0<this.styleId.indexOf("highlight")&&""!==this.control.highlightColor?this.control.highlightColor:h.points[p].color)+"!important}":n,this.selectionStyle.push([this.styleId+"_series_"+l.index+"_point_"+l.points[p].index,"fill",e?-1<e.indexOf("None")?-1<this.styleId.indexOf("highlight")?this.control.highlightColor:"":e:""])}l.selectionStyle||(this.styleId,l.index,this.styleId,l.index),"None"===this.control.highlightMode&&this.control.legendSettings.enableHighlight&&!l.isRectSeries&&this.selectionStyle.push([this.styleId+"_series_"+l.index,"stroke-width",(parseFloat(l.width?l.width.toString():"0")+1).toString()]),n=-1<n.indexOf("None")?"{}":n,this.selectionStyle.push([this.styleId+"_series_"+l.index,"fill",e?-1<e.indexOf("None")?-1<this.styleId.indexOf("highlight")?this.control.highlightColor:"":e:""])}var c="transparent"!==this.control.highlightColor?"circularchart3d"===this.control.getModuleName()?.2:.3:t,c=(je(this.control.selectionModule)&&"None"===this.control.selectionMode&&""!==this.control.highlightColor&&(c=1),this.selectionStyle.push([this.unselected,"opacity",c.toString()]),document.getElementById(this.control.element.id+"_Secondary_Element"));c&&c.appendChild(i)}},SAe.prototype.pattern=function(e,t,i,n,o){var r="#ffffff",s=e.svgObject,a=[],l={id:e.element.id+"_"+n+"_Selection_"+i,patternUnits:"userSpaceOnUse"},h="height",d="width";switch(n){case"Dots":l[h]=l[d]=6,l[d]=6,a[0]={x:0,y:0,width:7,height:7,transform:"translate(0,0)",fill:r,opacity:o,name:"rect"},a[1]={cx:3,cy:3,r:2,"stroke-width":1,fill:t,name:"circle"};break;case"Pacman":l[h]="18.384",l[d]="17.917",a[0]={name:"rect",x:0,y:0,width:17.917,height:18.384,transform:"translate(0,0)",fill:r,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":l[h]=l[d]=10,a[0]={x:0,y:0,width:10,height:10,fill:r,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":l[h]=l[d]="8",a[0]={x:0,y:0,width:8,height:8,transform:"translate(0,0)",fill:r,opacity:o,name:"rect"},a[1]={d:"M0 0L8 8ZM8 0L0 8Z","stroke-width":1,stroke:t,name:"path"};break;case"DiagonalForward":l[h]=l[d]=6,a[0]={x:0,y:0,width:6,height:6,transform:"translate(0,0)",fill:r,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":l[h]=l[d]=6,a[0]={x:0,y:0,width:6,height:6,transform:"translate(0,0)",fill:r,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":l[h]=l[d]=6,a[0]={name:"rect",x:0,y:0,width:6,height:6,transform:"translate(0,0)",fill:r,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":l[h]=l[d]=17,a[0]={name:"rect",x:0,y:0,width:17,height:17,transform:"translate(0,0)",fill:r,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":l[h]=l[d]=21,a[0]={name:"rect",x:0,y:0,width:21,height:21,transform:"translate(0,0)",fill:r,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":l[h]=l[d]=10,a[0]={name:"rect",x:0,y:0,width:10,height:10,transform:"translate(0,0)",fill:r,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":l[h]=l[d]=9,a[0]={name:"rect",x:0,y:0,width:9,height:9,transform:"translate(0,0)",fill:r,opacity:o},a[1]={name:"circle",cx:5.125,cy:3.875,r:3.625,"stroke-width":1,fill:t};break;case"Tile":l[h]=l[d]=18,a[0]={name:"rect",x:0,y:0,width:18,height:18,transform:"translate(0,0)",fill:r,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":l[h]=l[d]=12,a[0]={name:"rect",x:0,y:0,width:12,height:12,transform:"translate(0,0)",fill:r,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":l[h]=l[d]=12,a[0]={name:"rect",x:0,y:0,width:12,height:12,transform:"translate(0,0)",fill:r,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":l[h]=l[d]=12,a[0]={name:"rect",width:12,height:12,fill:r,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":l[h]=l[d]=10,a[0]={name:"rect",width:13,height:13,fill:r,opacity:o},a[1]={name:"rect",x:1.5,y:1.5,width:10,height:9,fill:t,opacity:o};break;case"HorizontalStripe":l[h]=12,a[0]={name:"rect",x:0,y:0,width:l[d]=10,height:12,transform:"translate(0,0)",fill:r,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":l[h]=10,a[0]={name:"rect",x:0,y:0,width:l[d]=12,height:10,transform:"translate(0,0)",fill:r,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":l[h]=l[d]=20,a[0]={name:"rect",x:0,y:0,width:20,height:20,transform:"translate(0,0)",fill:r,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 p=e.svgRenderer||e.renderer,c=p.createPattern(l,"pattern");return this.loadPattern(e,a,c,p),s.appendChild(c),"url(#"+e.element.id+"_"+n+"_Selection_"+i+")"},SAe.prototype.loadPattern=function(e,t,i,n){for(var o=0;o<t.length;o++){var r=n.createPattern(t[o],t[o].name);i.appendChild(r)}},SAe.prototype.concatIndexes=function(e,t){return e.concat(t)},SAe.prototype.checkVisibility=function(e,t){if(void 0===t&&(t=null),!e)return!1;for(var i=!1,n=[],o=0,r=e;o<r.length;o++){var s=r[o];-1===n.indexOf(s.series)&&n.push(s.series)}for(var a=0,l=n;a<l.length;a++){s=l[a];if(null!=t&&t.rangeColorSettings&&0<t.rangeColorSettings.length&&0<t.rangeColorSettings[0].colors.length){if(this.control.series[0].visible){i=!0;break}}else if(this.control.visibleSeries[s].visible){i=!0;break}}return i},SAe.prototype.addSvgClass=function(e,r){var t=e.getAttribute("class")||"",s=(t+=""!==t?" ":"",-1<e.id.indexOf("datalabel")||-1<e.id.indexOf("Text")||-1<e.id.indexOf("TextShape"));if(-1===t.indexOf(r)){e.setAttribute("class",t+r);var a=this.selectionStyle;if(r&&-1!==r.indexOf("highlight")&&("chart"===this.control.getModuleName()&&this.control.highlightModule?a=this.control.highlightModule.selectionStyle:"accumulationchart"===this.control.getModuleName()&&this.control.accumulationHighlightModule?a=this.control.accumulationHighlightModule.selectionStyle:"chart3d"===this.control.getModuleName()&&this.control.highlight3DModule?a=this.control.highlight3DModule.selectionStyle:"circularchart3d"===this.control.getModuleName()&&this.control.circularChartHighlight3DModule&&(a=this.control.circularChartHighlight3DModule.selectionStyle)),"g"===e.tagName.toLowerCase())e.querySelectorAll("*").forEach(function(e){for(var t=0;t<a.length;t++){var i=a[t],n=i[0],o=e.getAttribute("class")?e.getAttribute("class"):"";n!==r&&-1===n.indexOf(r)||-1!==o.indexOf("selection")||("fill"===i[1]&&i[2]&&!s&&(e.style.fill=i[2]),"opacity"===i[1]&&i[2]&&(e.style.opacity=i[2],e.style.fill=""),"stroke-width"===i[1]&&i[2]&&(e.style.strokeWidth=i[2]))}});else for(var i=0;i<a.length;i++){var n=a[i],o=n[0],l=e.getAttribute("class")?e.getAttribute("class"):"";o!==r&&-1===o.indexOf(r)||-1!==r.indexOf("highlight")&&-1!==l.indexOf("selection")||("fill"===n[1]&&n[2]&&!s&&(e.style.fill=n[2]),"opacity"===n[1]&&n[2]&&(e.style.opacity=n[2],e.style.fill=""),"stroke-width"===n[1]&&n[2]&&-1===e.id.indexOf("legend_shape")&&(e.style.strokeWidth=n[2]))}}},SAe.prototype.removeSvgClass=function(e,r){var t=e.getAttribute("class")||"";if(-1<t.indexOf(r)){e.setAttribute("class",t.replace(r,"").trim());var s=this.selectionStyle;if(r&&-1!==r.indexOf("highlight")&&("chart"===this.control.getModuleName()&&this.control.highlightModule?s=this.control.highlightModule.selectionStyle:"accumulationchart"===this.control.getModuleName()&&this.control.accumulationHighlightModule?s=this.control.accumulationHighlightModule.selectionStyle:"chart3d"===this.control.getModuleName()&&this.control.highlight3DModule?s=this.control.highlight3DModule.selectionStyle:"circularchart3d"===this.control.getModuleName()&&this.control.circularChartHighlight3DModule&&(s=this.control.circularChartHighlight3DModule.selectionStyle)),"g"===e.tagName.toLowerCase())e.querySelectorAll("*").forEach(function(e){for(var t=0;t<s.length;t++){var i=s[t],n=i[0],o=e.getAttribute("class")?e.getAttribute("class"):"";n!==r&&-1===n.indexOf(r)||-1!==o.indexOf("selection")||("fill"===i[1]&&i[2]&&(e.style.fill=""),"opacity"===i[1]&&i[2]&&(e.style.opacity=""),"stroke-width"===i[1]&&i[2]&&(e.style.strokeWidth=""))}});else for(var i=0;i<s.length;i++){var n=s[i],o=n[0],a=e.getAttribute("class")?e.getAttribute("class"):"";o!==r&&-1===o.indexOf(r)||-1!==r.indexOf("highlight")&&-1!==a.indexOf("selection")||("fill"===n[1]&&n[2]&&(e.style.fill=""),"opacity"===n[1]&&n[2]&&(e.style.opacity=""),"stroke-width"===n[1]&&n[2]&&(e.style.strokeWidth=""))}}},SAe.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};var CAe=SAe;function SAe(e){this.selectionStyle=[],this.control=e}AAe=function(e,t){return(AAe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}AAe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(TAe,xAe=CAe),TAe.prototype.addEventListener=function(){var e;this.chart.isDestroyed||this.chart.stockChart&&this.chart.stockChart.onPanning||(e=F.isPointer?"pointerleave":"mouseleave",this.chart.on(F.touchMoveEvent,this.mouseMove,this),this.chart.on(e,this.mouseLeave,this),this.chart.on("click",this.mouseClick,this),this.chart.on(F.touchStartEvent,this.mousedown,this),this.chart.on(F.touchEndEvent,this.mouseLeave,this))},TAe.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)},TAe.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off(F.touchMoveEvent,this.mouseMove),this.chart.off("pointerleave",this.mouseLeave),this.chart.off("click",this.mouseClick),this.chart.off(F.touchStartEvent,this.mousedown),this.chart.off(F.touchEndEvent,this.mouseLeave))},TAe.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},TAe.prototype.invokeSelection=function(e){this.initPrivateVariables(e),this.series=Pe({},e.visibleSeries,null,!0),this.seriesStyles(),this.currentMode=e.selectionMode,-1<e.selectionMode.indexOf("Drag")||this.selectDataIndex(e,this.concatIndexes(e.selectedDataIndexes,this.selectedDataIndexes))},TAe.prototype.generateStyle=function(e){return e?(1<this.styleId.indexOf("selection")&&"None"!==this.chart.selectionMode&&(this.unselected=e.unSelectedStyle||this.unselected),0<this.styleId.indexOf("highlight")&&("None"!==this.chart.highlightMode||this.chart.legendSettings.enableHighlight)&&(this.unselected=e.nonHighlightStyle||this.unselected),e.selectionStyle||this.styleId+"_series_"+e.index):"undefined"},TAe.prototype.selectDataIndex=function(e,t){for(var i=0,n=t;i<n.length;i++){var o=n[i];this.performSelection(o,e,this.getElementByIndex(e,o,"",this.series[o.series].marker.visible)[0])}},TAe.prototype.getElementByIndex=function(e,t,i,n,o){void 0===i&&(i="");var r=e.element.id+"_Series_"+t.series+"_Point_"+t.point,e=e.series[t.series],r="Scatter"!==e.type&&"Bubble"!==e.type&&n?r+"_Symbol"+i:r;return!n&&o?[ie(r+"_Text_0"+i),ie(r+"_TextShape_0"+i)]:[ie(r),"RangeArea"!==e.type&&"SplineRangeArea"!==e.type&&"RangeStepArea"!==e.type||!e.marker.visible?null:ie(r+"1")]},TAe.prototype.getClusterElements=function(e,t){for(var i,n,o=[],r=0,s=e.visibleSeries;r<s.length;r++){var a,l,h=s[r];h.visible&&(t=new kme(h.index,t.point),h.isRectSeries&&o.push(this.getElementByIndex(e,t)[0]),o.push(this.getElementByIndex(e,t,"",h.marker.visible)[0]),a=document.getElementById(e.element.id+"_Series_"+h.index+"_Point_"+t.point+"_Text_0"),l=document.getElementById(e.element.id+"_Series_"+h.index+"_Point_"+t.point+"_TextShape_0"),a&&o.push(a),l&&o.push(l),i=this.generateStyle(e.visibleSeries[t.series]),n=document.querySelectorAll("."+i),this.findTrackballElements(n,i),h=h.marker.visible&&h.isRectSeries?2:1,h+=a&&l?2:a||l?1:0,!e.isMultiSelect)&&0<n.length&&n[0].id!==(o[o.length-h]?o[o.length-h].id:"")&&this.removeSelection(e,t.series,n,i,!0)}return o},TAe.prototype.findTrackballElements=function(e,t){for(var i,n=0;n<e.length;n++)if(!je(e[n])&&0<(i=je(e[n].parentNode)?[]:[].slice.call(e[0].parentNode.querySelectorAll("."+t))).length){for(var o=[],r=0;r<i.length;r++)-1<i[r].id.indexOf("Trackball")&&o.push(i[r]);this.removeStyles(o)}},TAe.prototype.findElements=function(e,t,i,n,o,r){return void 0===n&&(n=""),this.isSeriesMode?this.getSeriesElements(t):"Cluster"===this.currentMode?this.getClusterElements(e,i):this.getElementByIndex(e,i,n,o,r)},TAe.prototype.isAlreadySelected=function(e,t){if("click"===t?(this.currentMode=this.chart.selectionMode,this.styleId=this.chart.element.id+(this.chart.selectionModule&&"None"!==this.chart.selectionMode?"_ej2_chart_selection":"_ej2_chart_highlight")):"mousemove"!==t&&"pointermove"!==t||(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"===t)return!1;if(("None"!==this.chart.highlightMode||this.chart.legendSettings.enableHighlight)&&this.previousSelectedEle&&this.previousSelectedEle[0]){var i=e.parentNode?e.parentNode.id:"",n=void 0;e.parentNode&&(n=0<i.indexOf("SeriesGroup")||0<i.indexOf("SymbolGroup"));for(var o=0;o<this.previousSelectedEle.length;o++)if(this.previousSelectedEle[o]&&this.previousSelectedEle[o].hasAttribute("class"))if(-1<this.previousSelectedEle[o].getAttribute("class").indexOf("highlight")&&(n||"click"===t)){if(this.previousSelectedEle[o].removeAttribute("class"),0<this.previousSelectedEle[o].id.indexOf("Group"))for(var r=0;r<this.previousSelectedEle[o].children.length;r++)""===this.chart.highlightColor||je(this.chart.highlightColor)||"None"!==this.chart.highlightPattern||this.previousSelectedEle[o].children[r].setAttribute("fill",-1<this.previousSelectedEle[o].children[r].id.indexOf("Text")||-1<this.previousSelectedEle[o].children[r].id.indexOf("TextShape")?this.previousSelectedEle[o].children[r].getAttribute("fill"):this.control.visibleSeries[this.indexFinder(this.previousSelectedEle[o].id).series].interior),this.previousSelectedEle[o].children[r].removeAttribute("style");else""===this.chart.highlightColor||je(this.chart.highlightColor)||"None"!==this.chart.highlightPattern||this.previousSelectedEle[o].setAttribute("fill",-1<this.previousSelectedEle[o].id.indexOf("Text")||-1<this.previousSelectedEle[o].id.indexOf("TextShape")?this.previousSelectedEle[o].getAttribute("fill"):this.control.visibleSeries[this.indexFinder(this.previousSelectedEle[o].id).series].interior),this.previousSelectedEle[o].removeAttribute("style");this.addOrRemoveIndex(this.highlightDataIndexes,this.indexFinder(this.previousSelectedEle[o].id))}else!n&&-1<this.previousSelectedEle[o].getAttribute("class").indexOf("highlight")&&this.performSelection(this.indexFinder(this.previousSelectedEle[o].id),this.chart,this.previousSelectedEle[o])}return!0},TAe.prototype.mouseClick=function(e){this.calculateSelectedElements(e.target,e.type,!0),this.chart.highlightModule&&this.chart.highlightModule.highlightDataIndexes&&0<this.chart.highlightModule.highlightDataIndexes.length&&-1===e.target.id.indexOf("_chart_legend_")&&-1===e.target.id.indexOf("_Series_")&&this.chart.isTouch&&F.isDevice&&this.removeLegendHighlightStyles()},TAe.prototype.calculateSelectedElements=function(e,t,i){if(!je(e)&&!("None"===this.chart.selectionMode&&"None"===this.chart.highlightMode||e.id&&-1===e.id.indexOf(this.chart.element.id+"_"))){if("mousemove"===t||"pointermove"===t){if(e.hasAttribute("class")&&(-1<e.getAttribute("class").indexOf("highlight")||-1<e.getAttribute("class").indexOf("selection")))return;if(!je(e.parentNode)&&e.parentNode.hasAttribute("class")&&(0<e.parentNode.getAttribute("class").indexOf("highlight")||0<e.parentNode.getAttribute("class").indexOf("selection")))return}if(this.isAlreadySelected(e,t),e.id&&-1<e.id.indexOf("_Series_")&&-1===e.id.indexOf("_Text_")){t=void 0;if(-1<e.id.indexOf("_Trackball_1"))t=je(t=ie(e.id.split("_Trackball_")[0]+"_Symbol"))?ie(e.id.split("_Trackball_")[0]):t;else if(-1<e.id.indexOf("_Trackball_0"))return null;this.performSelection(this.indexFinder(e.id),this.chart,t||e,i)}}},TAe.prototype.performSelection=function(e,t,i,n){var o,r,s,a,l,h;switch(this.isSeriesMode="Series"===this.currentMode,"BoxAndWhisker"===t.visibleSeries[e.series].type&&i&&i.id===t.element.id+"_Series_"+e.series+"_Point_"+e.point+"_BoxPath"&&(i=i.parentNode),"Area"!==t.visibleSeries[e.series].type||"Point"!==this.currentMode&&"Cluster"!==this.currentMode||!i||i.id!==this.chart.element.id+"_Series_"+e.series||(o=this.generateStyle(t.series[e.series]),r=document.querySelectorAll("."+o),this.findTrackballElements(r,o),this.blurEffect(t.element.id,t.visibleSeries,!1,e.point)),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,!1,e.point);break;case"Point":(!isNaN(e.point)&&i||!n&&isNaN(e.point))&&((s=[]).push(i),a=this.chart.visibleSeries[e.series],l=t.element.id+"_Series_"+e.series+"_Point_"+e.point,h=document.getElementById(l+"_Text_0"),a.marker.dataLabel.visible&&null!==h&&(s.push(h),s.push(document.getElementById(l+"_TextShape_0"))),null===s[0]||!t.series[e.series].marker.visible||-1===t.series[e.series].type.indexOf("Column")&&-1===t.series[e.series].type.indexOf("Bar")||(-1===i.id.indexOf("_Symbol")&&ie(i.id+"_Symbol")?s.push(ie(i.id+"_Symbol")):-1!==i.id.indexOf("_Symbol")&&ie(i.id.replace("_Symbol",""))&&s.push(ie(i.id.replace("_Symbol","")))),this.selection(t,e,!n&&isNaN(e.point)?this.getSeriesElements(t.series[e.series]):s),this.selectionComplete(t,e,this.currentMode),this.blurEffect(t.element.id,t.visibleSeries,!1,e.point));break;case"Cluster":isNaN(e.point)&&(n||!isNaN(e.point))||(!n&&isNaN(e.point)?this.selection(t,e,this.getSeriesElements(t.series[e.series])):this.clusterSelection(t,e),this.selectionComplete(t,e,this.currentMode),this.blurEffect(t.element.id,t.visibleSeries,!1,e.point))}},TAe.prototype.selectionComplete=function(e,t,i){var n,o,r=[];if("Cluster"===i){for(var s=0,a=e.visibleSeries;s<a.length;s++)if((d=a[s]).visible)for(var l=0;l<this.selectedDataIndexes.length;l++)p=(e.isMultiSelect?this.selectedDataIndexes[l]:t).point,c=d.index,u=d.points,!isNaN(p)&&p<u.length&&(n="RangeArea"!==d.type||-1<d.type.indexOf("SplineRangeArea")||-1<d.type.indexOf("RangeStepArea")?u[p].yValue:u[p].regions[0].y,o=u[p].xValue,"Category"===e.primaryXAxis.valueType?o=u[p].x.toLocaleString():"DateTime"===e.primaryXAxis.valueType&&(o=new Date(u[p].xValue)),"Indicator"!==d.category&&r.push({x:o,y:n,seriesIndex:c,pointIndex:p}),"RangeArea"!==d.type&&"SplineRangeArea"!==d.type&&"RangeStepArea"!==d.type||r.push({x:o,y:u[p].regions[0].y,seriesIndex:c,pointIndex:p}))}else if("Series"===i)if(e.isMultiSelect)for(l=0;l<this.selectedDataIndexes.length;l++)c=this.selectedDataIndexes[l].series,0<this.selectedDataIndexes.length&&r.push({seriesIndex:c});else c=0<this.selectedDataIndexes.length?this.selectedDataIndexes[0].series:this.highlightDataIndexes&&0<this.highlightDataIndexes.length?this.highlightDataIndexes[0].series:0,(0<this.selectedDataIndexes.length||this.highlightDataIndexes&&0<this.highlightDataIndexes.length)&&r.push({seriesIndex:c});else if("Point"===i)for(var h=[],h=-1<this.styleId.indexOf("highlight")?this.highlightDataIndexes:this.selectedDataIndexes,l=0;l<h.length;l++){var d,p=h[l].point,c=h[l].series,u=(d=e.series[c]).points;isNaN(p)||(o=u[p].xValue,n="RangeArea"!==d.type||-1<d.type.indexOf("SplineRangeArea")||-1<d.type.indexOf("RangeStepArea")?u[p].yValue:u[p].regions[0].y,"Category"===e.primaryXAxis.valueType?o=u[p].x.toLocaleString():"DateTime"===e.primaryXAxis.valueType&&(o=new Date(u[p].xValue)),r.push({x:o,y:n,seriesIndex:c,pointIndex:p}))}e.trigger(afe,{name:afe,selectedDataValues:r,cancel:!1,chart:e})},TAe.prototype.selection=function(e,t,i){"Lasso"===this.currentMode||e.isMultiSelect||-1!==this.currentMode.indexOf("Drag")||-1!==this.styleId.indexOf("highlight")||"None"===e.selectionMode||this.removeMultiSelectElements(e,this.selectedDataIndexes,t,e.series);var n,o,r=this.rangeColorMappingEnabled()?0:t.series;je(i[0])||(e.visibleSeries[r].isRectSeries&&i[0].id&&(document.getElementById(i[0].id+"_Symbol")?i.push(ie(i[0].id+"_Symbol")):-1!==i[0].id.indexOf("SeriesGroup")&&document.getElementById(i[0].id.replace("SeriesGroup","SymbolGroup"))&&i.push(ie(i[0].id.replace("SeriesGroup","SymbolGroup")))),r=void 0,n=(n=i[0]&&(i[0].getAttribute("class")||"")).replace("e-chart-focused","").trim(),o=i[0].parentNode&&(i[0].parentNode.getAttribute("class")||""),""!==n&&"Cluster"!==this.currentMode&&this.findTrackballElements(i,n),i[0]&&-1<n.indexOf(this.getSelectionClass(i[0].id))?this.removeStyles(i):i[0].parentNode&&-1<o.indexOf(this.getSelectionClass(i[0].id))?this.removeStyles([i[0].parentNode]):(this.previousSelectedEle="None"!==e.highlightMode||e.legendSettings.enableHighlight?i:[],this.applyStyles(i),r=!0),0<this.styleId.indexOf("highlight")&&("None"!==e.highlightMode||e.legendSettings.enableHighlight)?this.addOrRemoveIndex(this.highlightDataIndexes,t,r):this.addOrRemoveIndex(this.selectedDataIndexes,t,r))},TAe.prototype.clusterSelection=function(e,t){this.selection(e,t,this.getClusterElements(e,new kme(t.series,t.point)))},TAe.prototype.removeMultiSelectElements=function(e,t,i,n){for(var o,r=0;r<t.length;r++)o=n[t[r].series],(this.isSeriesMode&&!this.toEquals(t[r],i,this.isSeriesMode)||"Cluster"===this.currentMode&&!this.toEquals(t[r],i,!1)||!this.isSeriesMode&&this.toEquals(t[r],i,!0)&&!this.toEquals(t[r],i,!1))&&(this.removeStyles(this.findElements(e,o,t[r],"",!1)),o.marker.visible&&this.removeStyles(this.findElements(e,o,t[r],"",!0)),o.marker.dataLabel.visible&&this.removeStyles(this.findElements(e,o,t[r],"",!1,!0)),t.splice(r,1),r--)},TAe.prototype.blurEffect=function(e,t,i,n){void 0===i&&(i=!1),void 0===n&&(n=0);for(var o=this.checkVisibility(this.highlightDataIndexes,this.chart)||this.checkVisibility(this.selectedDataIndexes,this.chart),r=0,s=t;r<s.length;r++){var a=s[r],l=void 0,h=void 0,h=this.rangeColorMappingEnabled()?!1===i?(l=Object.keys(a.rangeColorPoints).indexOf(a.points[n].interior),a.points[n].interior):(l=n,document.getElementById(e+"_chart_legend_shape_"+n).getAttribute("fill")):(l=a.index,this.chart.visibleSeries[a.index].interior);a.visible&&(this.checkSelectionElements(ie(e+"SeriesGroup"+a.index),this.generateStyle(a),o,i,l,h),a.marker.dataLabel.visible&&!je(a.shapeElement)&&(this.checkSelectionElements(a.shapeElement,this.generateStyle(a),o,i,l,h),this.checkSelectionElements(a.textElement,this.generateStyle(a),o,i,l,h)),je(ie(e+"SymbolGroup"+a.index))||this.checkSelectionElements(ie(e+"SymbolGroup"+a.index),this.generateStyle(a),o,i,l,h))}},TAe.prototype.checkSelectionElements=function(e,t,i,n,o,r){void 0===n&&(n=!0),void 0===o&&(o=0),void 0===r&&(r="#D3D3D3");for(var s,a,l,h,d=this.isSeriesMode?e.childNodes||[e]:e.childNodes||e,p=("None"===this.chart.selectionMode||"None"===this.chart.highlightMode&&!this.chart.legendSettings.enableHighlight||(d=e.childNodes||e),"Cluster"===this.chart.selectionMode&&"text"===e.tagName.toLowerCase()&&0<=e.id.indexOf("_Text_")&&(d=[e]),e),c=this.chart.visibleSeries[this.rangeColorMappingEnabled()?0:o].marker.dataLabel.visible&&(-1<e.id.indexOf("Text")||-1<e.id.indexOf("TextShape"))&&"g"!==e.tagName,u=0;u<d.length&&!c;u++)s=d[u].getAttribute("class")||"",a=d[u].parentNode.getAttribute("class")||"","None"===this.chart.selectionMode||"None"===this.chart.highlightMode&&!this.chart.legendSettings.enableHighlight||(t=0<s.indexOf("selection")||0<s.indexOf("highlight")?s:t,t=0<a.indexOf("selection")||0<a.indexOf("highlight")?a:t),-1===s.indexOf(t)&&-1===a.indexOf(t)&&i?this.addSvgClass(d[u],this.unselected):(p=d[u],this.removeSvgClass(d[u],this.unselected),this.removeSvgClass(d[u].parentNode,this.unselected),""!==d[u].id&&-1!==s.indexOf(this.unselected)&&-1===a.indexOf(t)&&this.highlightAnimation(d[u],1===this.chart.series.length?0:this.indexFinder(d[u].id).series,700,.3)),0<d[u].id.indexOf("Trackball")&&p.classList[0]===t&&(this.removeSvgClass(d[u],this.unselected),this.removeSvgClass(d[u].parentNode,this.unselected),this.addSvgClass(d[u],t));if(-1<e.id.indexOf("Symbol")&&e.querySelectorAll("."+t)[0]&&e.querySelectorAll("."+t)[0].getAttribute("class")===t&&-1<((h=ie(this.control.element.id+"_Series_"+e.id[e.id.length-1]))&&h.hasAttribute("class")?h.getAttribute("class"):"").indexOf(this.unselected)&&this.removeSvgClass(h,this.unselected),this.control.legendModule&&this.control.legendSettings.visible&&this.control.legendSettings.visible&&(!n||!this.rangeColorMappingEnabled||e!==this.control.visibleSeries[0].textElement&&e!==this.control.visibleSeries[0].shapeElement)&&(l=ie(this.control.element.id+"_chart_legend_shape_"+o))){l.hasAttribute("class")&&(this.removeSvgClass(l,l.getAttribute("class")),je(this.chart.highlightColor&&""!==this.chart.highlightColor)||this.chart.legendSettings.enableHighlight||(l.setAttribute("stroke",r),"None"===this.chart.highlightPattern&&l.setAttribute("fill",r))),s=p.getAttribute("class")||"",a=p.parentNode.getAttribute("class")||"",-1===s.indexOf(t)&&-1===a.indexOf(t)&&i?(this.addSvgClass(l,"None"!==this.chart.highlightMode||!this.chart.legendSettings.enableHighlight||this.chart.selectionModule&&0!==this.chart.selectionModule.selectedDataIndexes.length?this.unselected:t),this.removeSvgClass(l,t),""===this.chart.highlightColor||je(this.chart.highlightColor)||(l.setAttribute("stroke",this.control.visibleSeries[o].interior),"None"===this.chart.highlightPattern&&l.setAttribute("fill",this.control.visibleSeries[o].interior))):(this.removeSvgClass(l,this.unselected),je(this.chart.highlightColor)||""===this.chart.highlightColor||(l.setAttribute("stroke",this.control.visibleSeries[o].interior),"None"===this.chart.highlightPattern&&l.setAttribute("fill",this.control.visibleSeries[o].interior)),""===s&&""===a||"EJ2-Trackball"===s.trim()?this.removeSvgClass(l,t):(this.addSvgClass(l,t),0<t.indexOf("highlight")&&""!==this.chart.highlightColor&&"transparent"!==this.chart.highlightColor&&!je(this.chart.highlightColor)&&(l.setAttribute("stroke",this.chart.highlightColor),0<this.styleId.indexOf("highlight"))&&"None"===this.chart.highlightPattern&&l.setAttribute("fill",this.chart.highlightColor)));var g;if(this.rangeColorMappingEnabled())for(u=0;u<this.chart.rangeColorSettings.length;u++)l!==(g=document.getElementById(this.chart.element.id+"_chart_legend_shape_"+u))?(this.addSvgClass(g,this.unselected),this.removeSvgClass(g,t)):!0===n&&this.addSvgClass(g,t),-1===s.indexOf(t)&&!1===n&&this.removeSvgClass(g,this.unselected);n&&-1<a.indexOf(t)&&this.addSvgClass(l,t)}},TAe.prototype.applyStyles=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];if(n){if(this.removeSvgClass(n.parentNode,this.unselected),this.removeSvgClass(n,this.unselected),"fill"===this.chart.series[0].pointColorMapping||this.rangeColorMappingEnabled()){var o=this.getSelectionClass(n.id),r=-1<o.indexOf("highlight")?parseInt(o.split(this.chart.element.id+"_ej2_chart_highlight_series_")[1],10):parseInt(o.split(this.chart.element.id+"_ej2_chart_selection_series_")[1],10),s=0<this.styleId.indexOf("highlight")?this.chart.highlightPattern:this.chart.selectionPattern,a=void 0;if((-1<o.indexOf("highlight")||-1<o.indexOf("selection"))&&(a=document.getElementById(this.chart.element.id+"_"+s+"_Selection_"+r)),-1===n.id.indexOf("legend")&&-1===n.id.indexOf("Text")&&-1===n.id.indexOf("TextShape")&&-1===n.id.indexOf("Group")&&null!=a)for(var l=1;l<a.children.length;l++)a.children[l].setAttribute("fill",n.getAttribute("fill")),a.children[l].setAttribute("stroke",n.getAttribute("fill"))}if(this.addSvgClass(n,this.getSelectionClass(n.id)),0<n.id.indexOf("Group"))for(var h=this.indexFinder(n.id),l=0;l<n.children.length;l++)"defs"!==n.children[l].nodeName&&this.stopElementAnimation(n.children[l],h.series);if(0<this.styleId.indexOf("highlight")&&""!==this.chart.highlightColor&&!je(this.chart.highlightColor)&&"None"===this.chart.highlightPattern&&"transparent"!==this.chart.highlightColor)if(0<n.id.indexOf("Group"))for(l=0;l<n.children.length;l++)n.children[l].setAttribute("fill",-1<n.id.indexOf("Text")||-1<n.id.indexOf("TextShape")?n.children[l].getAttribute("fill"):this.chart.highlightColor);else n.setAttribute("fill",-1<n.id.indexOf("Text")||-1<n.id.indexOf("TextShape")?n.getAttribute("fill"):this.chart.highlightColor)}}},TAe.prototype.getSelectionClass=function(e){return this.generateStyle(this.control.visibleSeries[this.indexFinder(e).series])},TAe.prototype.removeStyles=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];if(n&&(this.removeSvgClass(n,this.getSelectionClass(n.id)),"None"===this.chart.highlightPattern)&&""!==this.chart.highlightColor&&!je(this.chart.highlightColor)&&"transparent"!==this.chart.highlightColor)if(0<n.id.indexOf("Group"))for(var o=0;o<n.children.length;o++)n.children[o].setAttribute("fill",-1<n.id.indexOf("Text")||-1<n.id.indexOf("TextShape")?n.children[o].getAttribute("fill"):this.control.visibleSeries[this.indexFinder(n.id).series].interior);else n.setAttribute("fill",-1<n.id.indexOf("Text")||-1<n.id.indexOf("TextShape")?n.getAttribute("fill"):this.control.visibleSeries[this.indexFinder(n.id).series].interior)}},TAe.prototype.addOrRemoveIndex=function(e,t,i){for(var n=0;n<e.length;n++)this.toEquals(e[n],t,this.isSeriesMode)&&(e.splice(n,1),n--);i&&e.push(t)},TAe.prototype.toEquals=function(e,t,i){return(e.series===t.series||"Cluster"===this.currentMode&&!i)&&(i||e.point===t.point)},TAe.prototype.redrawSelection=function(e,t,i){this.isSeriesMode="Series"===t,je(t)||(-1!==t.indexOf("Drag")||"Lasso"===t||i?e.isRedrawSelection=!1:e.isRedrawSelection=!0);t=Pe([],this.selectedDataIndexes,null,!0),i=Pe([],this.highlightDataIndexes,null,!0);0<this.styleId.indexOf("highlight")&&0<i.length?(this.removeSelectedElements(e,this.highlightDataIndexes,e.series),t=i):this.removeSelectedElements(e,this.selectedDataIndexes,e.series),this.blurEffect(e.element.id,e.visibleSeries,!1),this.selectDataIndex(e,t)},TAe.prototype.legendSelection=function(e,t,i,n){if("mousemove"===n){if((i=1<(i=1<(i=1<i.id.indexOf("text")?ie(i.id.replace("text","shape")):i).id.indexOf("marker")?ie(i.id.replace("_marker","")):i).id.indexOf("g")?ie(i.id.replace("_g_","_shape_")):i).hasAttribute("class")&&(-1<i.getAttribute("class").indexOf("highlight")||-1<i.getAttribute("class").indexOf("selection")))return;this.currentMode=this.chart.highlightMode}if(this.isAlreadySelected(i,n)){var o=this.generateStyle(e.visibleSeries[t]),r=document.querySelectorAll("."+o);this.isSeriesMode="Series"===this.currentMode;if(0<r.length)this.removeSelection(e,t,r,o,!0);else{for(var s=0,a=e.visibleSeries;s<a.length;s++)(g=a[s]).index===t||e.isMultiSelect||(o=this.generateStyle(e.visibleSeries[g.index]),r=document.querySelectorAll("."+o),this.removeSelection(e,t,r,o,!0));var l=[];if(this.rangeColorMappingEnabled()){for(var h=0,d=e.visibleSeries[0].seriesElement.children;h<d.length;h++){var p,c,u=d[h];i.getAttribute("fill")===u.getAttribute("fill")&&(e.visibleSeries[0].marker.dataLabel.visible&&(c=this.indexFinder(u.id).point,!isNaN(c))&&0<=c&&(p=document.getElementById(this.chart.element.id+"_Series_0_Point_"+c+"_Text_0"),c=document.getElementById(this.chart.element.id+"_Series_0_Point_"+c+"_TextShape_0"),p&&l.push(p),c)&&l.push(c),l.push(u))}for(var g,m=0,f=l;m<f.length;m++){if(je(g=f[m]))return;this.checkSelectionElements(g,o,!1,!0,t)}}else if(e.visibleSeries[t].visible)for(var y=0,v=l=this.getSeriesElements(e.visibleSeries[t]);y<v.length;y++){var b=v[y];if(je(b))return;this.checkSelectionElements(b,o,!1,!0,t)}this.isSeriesMode=!0,this.selection(e,new kme(t,NaN),l),this.isSeriesMode="Series"===e.selectionMode,this.blurEffect(e.element.id,e.visibleSeries,!0,t)}}},TAe.prototype.rangeColorMappingEnabled=function(){return!(!(this.chart.rangeColorSettings&&0<this.chart.rangeColorSettings.length&&1===this.chart.visibleSeries.length&&0<this.chart.rangeColorSettings[0].colors.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)},TAe.prototype.removeSelection=function(e,t,i,n,o){if(0<i.length){for(var r=[],s=0;s<i.length;s++)r.push(i[s]);this.removeStyles(r),this.isSeriesMode=!0,this.addOrRemoveIndex(this.selectedDataIndexes,new kme(t,NaN));for(var a=0,l=e.visibleSeries;a<l.length;a++){var h=l[a];if(n=this.generateStyle(h),0<document.querySelectorAll("."+n).length){for(var d=0,p=r;d<p.length;d++)this.checkSelectionElements(p[d],n,!0,!0,t);o=!1;break}}o&&(this.isSeriesMode="Series"===e.selectionMode,this.blurEffect(e.element.id,e.visibleSeries))}},TAe.prototype.getSeriesElements=function(e){var t=[e.seriesElement];return(e.marker.visible&&"Scatter"!==e.type&&"Bubble"!==e.type&&!e.isRectSeries||e.marker.visible&&e.isRectSeries)&&t.push(e.symbolElement),e.marker.dataLabel.visible&&(t.push(e.textElement),t.push(e.shapeElement)),t},TAe.prototype.indexFinder=function(e){var t=["NaN","NaN"];return-1<e.indexOf("SeriesGroup")?(t=e.split("SeriesGroup"))[0]=t[1]:-1<e.indexOf("SymbolGroup")?(t=e.split("SymbolGroup"))[0]=t[1]:-1<e.indexOf("_Point_")?t=e.split("_Series_")[1].split("_Point_"):-1<e.indexOf("_border_")?t[0]=e.split("_border_")[1]:-1<e.indexOf("_Series_")?t[0]=e.split("_Series_")[1]:-1<e.indexOf("_chart_legend_shape_")?(t=e.split("_chart_legend_shape_"))[0]=t[1]:-1<e.indexOf("TextGroup")?(t=e.split("TextGroup"))[0]=t[1]:-1<e.indexOf("ShapeGroup")&&((t=e.split("ShapeGroup"))[0]=t[1]),new kme(parseInt(t[0],10),parseInt(t[1],10))},TAe.prototype.calculateDragSelectedElements=function(a,e,t){this.removeSelectedElements(a,this.selectedDataIndexes,a.series);for(var l,h,i="Lasso"===a.selectionMode,d=new Do(e.x,e.y,e.width,e.height),p=new Tve(a.chartAxisLayoutPanel.seriesClipRect.x,a.chartAxisLayoutPanel.seriesClipRect.y),c=(this.removeOffset(d,p),[]),u=[],n=(this.isSeriesMode=!1,a.allowMultiSelection&&(this.rectGrabbing||this.resizing)),g=(this.rectPoints=this.dragRectArray[n?this.targetIndex:this.count]=new Do(e.x,e.y,e.width,e.height),e.width&&e.height&&!t&&(s=new Do(e.x,e.y,e.width,e.height),this.removeOffset(s,p),this.filterArray[n?this.targetIndex:this.count]=s),this),o=0,r=a.visibleSeries;o<r.length;o++)!function(e){if(e.visible){var t;l=e.points,c=[];for(var i=!a.isTransposed&&-1===e.type.indexOf("Bar")||a.isTransposed&&-1!==e.type.indexOf("Bar")?(t=e.xAxis.rect.x-p.x,e.yAxis.rect.y-p.y):(t=e.xAxis.rect.y-p.y,e.yAxis.rect.x-p.x),n=0;n<l.length;n++){var o="RangeArea"!==e.type||-1<e.type.indexOf("SplineRangeArea")||-1<e.type.indexOf("RangeStepArea")?l[n].yValue:l[n].regions[0].y,r=void 0,s=l[n].xValue;"Category"===a.primaryXAxis.valueType?s=l[n].x.toLocaleString():"DateTime"===a.primaryXAxis.valueType&&(s=new Date(l[n].xValue)),(r="BoxAndWhisker"===e.type?l[n].regions.some(function(e){return o0e(e.x+t,e.y+i,d)}):"Lasso"===a.selectionMode?l[n].isSelect:a.allowMultiSelection?g.isPointSelect(l[n],t,i,g.filterArray):l[n].symbolLocations.some(function(e){return e&&o0e(e.x+t,e.y+i,d)}))&&"Indicator"!==e.category&&(h=new kme(e.index,l[n].index),g.selection(a,h,g.findElements(a,e,h,"",!e.isRectSeries&&e.marker.visible)),c.push({x:s,y:o})),!r||"RangeArea"!==e.type&&"SplineRangeArea"!==e.type&&"RangeStepArea"!==e.type||c.push({x:s,y:l[n].regions[0].y})}u.push(c)}}(r[o]);this.blurEffect(a.element.id,a.visibleSeries);var n=i?a.mouseDownX:e.x+e.width,s=i?a.mouseDownY:e.y;t||this.createCloseButton(n,s),a.trigger(sfe,{name:sfe,selectedDataValues:u,cancel:!1})},TAe.prototype.removeOffset=function(e,t){e.x-=t.x,e.y-=t.y},TAe.prototype.isPointSelect=function(e,t,i,n){for(var o=e.symbolLocations[0],r=0,s=n;r<s.length;r++){var a=s[r];if(a&&o&&o0e(o.x+t,o.y+i,a))return!0}return!1},TAe.prototype.drawDraggingRect=function(e,t){var i=e.chartAxisLayoutPanel.seriesClipRect,n=e.chartArea.border.width,o=e.themeStyle.selectionRectFill,r=e.themeStyle.selectionRectStroke,s="Lasso"===e.selectionMode;switch(this.isdrawRect&&(i.x=i.x-n/2,i.y=i.y-n/2,i.width=i.width+n,i.height=i.height+n,this.isdrawRect=!1),e.selectionMode){case"DragX":t.y=i.y,t.height=i.height;break;case"DragY":t.x=i.x,t.width=i.width}if((t.width<5||t.height<5)&&!s)return null;var a,l,h,d,n=-1<e.selectionMode.indexOf("Drag")||"Lasso"===e.selectionMode;e.allowMultiSelection&&n?(h=l=void 0,(n=ie(this.multiRectGroup))||(n=e.svgRenderer.createGroup({id:this.multiRectGroup}),e.svgObject.appendChild(n)),this.rectGrabbing||this.resizing?((a=ie(this.draggedRect+this.targetIndex)).nextSibling&&ue(a.nextSibling),this.setAttributes(a,t)):ie(this.draggedRectGroup+this.count)||(h=e.svgRenderer.createGroup({id:this.draggedRectGroup+this.count}),d=document.getElementById(e.element.id+"_series_svg"),(e.enableCanvas?d:n).appendChild(h)),"Lasso"!==e.selectionMode?(l=e.svgRenderer.drawRectangle(new vve(this.draggedRect+this.count,o,{color:r,width:1},1,t,0,0,"",e.theme.indexOf("Fluent2")<1?"3":""))).style.cursor="move":l=e.svgRenderer.drawPath(new No(this.lassoPath+this.count,o,3,r,1,"",this.path)),h||this.rectGrabbing||this.resizing?this.rectGrabbing||this.resizing||h.appendChild(l):ie(this.draggedRectGroup+this.count).appendChild(l)):(l=ie(s?this.lassoPath:this.draggedRect),this.closeIcon&&Pye(this.closeIconId),l?s?l.setAttribute("d",this.path):this.setAttributes(l,t):(h=e.svgRenderer.createGroup({id:this.draggedRectGroup}),d=document.getElementById(e.element.id+"_series_svg"),(e.enableCanvas?d:e.svgObject).appendChild(h),l="Lasso"!==e.selectionMode?e.svgRenderer.drawRectangle(new vve(this.draggedRect,o,{color:r,width:1},1,t,0,0,"",e.theme.indexOf("Fluent2")<1?"3":"")):e.svgRenderer.drawPath(new No(this.lassoPath,o,3,r,1,"",this.path)),h.appendChild(l)))},TAe.prototype.getIndex=function(e){for(var t=e.length-1;0<t;t--){var i=Number(e[t]);if(isNaN(i))break}return+e.substr(t+1,e.length-1)},TAe.prototype.createCloseButton=function(e,t){var i=this.chart.allowMultiSelection,n=this.chart.themeStyle.selectionCircleStroke,o=this.rectGrabbing||this.resizing,r=this.chart.svgRenderer.createGroup({id:this.closeIconId+(i?o?this.targetIndex:this.count:""),style:"cursor:pointer; visibility: visible;"}),e=(r.appendChild(this.chart.svgRenderer.drawCircle(new Sve(this.closeIconId+"_circle"+(i?o?this.targetIndex:this.count:""),"#FFFFFF",{color:n,width:1},1,e,t,10))),"M "+(e-4)+" "+(t-4)+" L "+(e+4)+" "+(t+4)+" M "+(e-4)+" "+(t+4)+" L "+(e+4)+" "+(t-4)),t=(r.appendChild(this.chart.svgRenderer.drawPath({id:this.closeIconId+"_cross"+(i?o?this.targetIndex:this.count:""),d:e,stroke:n,"stroke-width":2,fill:n})),this.closeIcon=r,ie(this.draggedRectGroup+(i?o?this.targetIndex:this.count:"")));t&&t.appendChild(r)},TAe.prototype.removeDraggedElements=function(e,t,i){if(t.id&&-1<t.id.indexOf(this.closeIconId)&&-1===i.indexOf("move")){var n=!0;if(e.allowMultiSelection){var o=this.getIndex(t.id),i=ie(this.multiRectGroup);if(ue(ie(this.draggedRectGroup+o)),this.dragRectArray[o]=null,this.filterArray[o]=null,this.totalSelectedPoints[o]=null,i&&0===i.childElementCount&&(Pye(i),this.dragRectArray=[],this.filterArray=[],this.totalSelectedPoints=[]),"Lasso"===this.currentMode){if(null!=this.multiDataIndexes[o])for(var r=0;r<this.multiDataIndexes[o].length;r++)this.multiDataIndexes[o][r].isSelect=!1;this.multiDataIndexes[o]=null;for(var s=0;s<this.multiDataIndexes.length;s++)if(null!=this.multiDataIndexes[s])for(var n=!1,a=0;a<this.multiDataIndexes[s].length;a++)this.multiDataIndexes[s][a].isSelect=!0;this.calculateDragSelectedElements(e,this.dragRect,!0)}else if(this.filterArray.length)for(r=0;r<this.filterArray.length;r++)this.filterArray[r]&&this.calculateDragSelectedElements(e,this.filterArray[r],!(n=!1));else this.calculateDragSelectedElements(e,new Do(0,0,0,0),!0)}else ue(ie(this.draggedRectGroup)),this.removeSelectedElements(e,this.selectedDataIndexes,e.series);this.blurEffect(e.element.id,e.visibleSeries),this.changeCursorStyle(!1,e.svgObject,"auto"),e.allowMultiSelection&&!n||(this.rectPoints=null)}},TAe.prototype.resizingSelectionRect=function(e,t,i,n){var o;(e.allowMultiSelection&&-1<n.id.indexOf("_ej2_drag_rect")||this.dragRectArray[this.targetIndex])&&(-1<n.id.indexOf("_ej2_drag_rect")&&(this.targetIndex=this.getIndex(n.id)),n=this.dragRectArray[this.targetIndex],o=new Do(n.x,n.y,n.width,n.height)),(o=e.allowMultiSelection?o:new Do(this.rectPoints.x,this.rectPoints.y,this.rectPoints.width,this.rectPoints.height))&&(n=this.findResizeMode(e.svgObject,o,t),this.resizing&&(o=N0e(o.x,o.y,o.x+o.width,o.y+o.height,e.chartAxisLayoutPanel.seriesClipRect),this.drawDraggingRect(e,o),this.dragRect=o),i)&&(this.resizing=n)},TAe.prototype.findResizeMode=function(e,t,i){var n="se-resize",o=!1;if(this.resizing){var r=t.x,s=t.y,a=i.x-r,l=i.y-s;switch(this.resizeMode){case 0:l=Math.abs(t.height+t.y-i.y),t.y=Math.min(t.height+t.y,i.y),t.height=l;break;case 1:a=Math.abs(t.width+t.x-i.x),t.x=Math.min(t.width+t.x,i.x),t.width=a;break;case 2:t.height=Math.abs(l),t.y=Math.min(i.y,s);break;case 3:t.width=Math.abs(a),t.x=Math.min(i.x,r);break;case 4:t.width=Math.abs(a),t.height=Math.abs(l),t.x=Math.min(i.x,r),t.y=Math.min(i.y,s)}}else for(var h=[new Do(t.x,t.y,t.width-5,5),new Do(t.x,t.y,5,t.height),new Do(t.x,t.y+t.height-5,t.width-5,5),new Do(t.x+t.width-5,t.y+5,5,t.height-15),new Do(t.x+t.width-10,t.y+t.height-10,10,10)],d=0;d<h.length;d++)if(o0e(i.x,i.y,h[d])){n=4===d?n:d%2==0?"ns-resize":"ew-resize",o=!0,this.resizeMode=d;break}return"Lasso"!==this.currentMode&&this.changeCursorStyle(o,ie(this.chart.allowMultiSelection?this.draggedRect+this.targetIndex:this.draggedRect),n),this.changeCursorStyle(o,e,n),o},TAe.prototype.changeCursorStyle=function(e,t,i){i=e?i:this.control.svgObject===t?"auto":"move",t&&(t.style.cursor=i)},TAe.prototype.removeSelectedElements=function(e,t,i){t=e.isRedrawSelection?t:t.splice(0,t.length);for(var n=0,o=i;n<o.length;n++){var r=o[n];if(r.visible){r=this.getSeriesElements(r),this.removeStyles(r);for(var s=0,a=r;s<a.length;s++){var l=a[s];this.removeStyles(this.getChildren(l))}}}},TAe.prototype.setAttributes=function(e,t){for(var i=0,n=Object.keys(t);i<n.length;i++){var o=n[i];e.setAttribute(o,t[o])}},TAe.prototype.draggedRectMoved=function(e,t,i){var n;(n=(this.resizing||this.rectGrabbing)&&e.allowMultiSelection?(n=this.dragRectArray[this.targetIndex],new Do(n.x,n.y,n.width,n.height)):new Do(this.rectPoints.x,this.rectPoints.y,this.rectPoints.width,this.rectPoints.height)).x-=t.x-e.mouseX,n.y-=t.y-e.mouseY,n=N0e(n.x,n.y,n.x+n.width,n.height+n.y,e.chartAxisLayoutPanel.seriesClipRect),i?this.drawDraggingRect(e,n):this.calculateDragSelectedElements(e,n)},TAe.prototype.mouseLeave=function(e){this.completeSelection(e.target,e.type)},TAe.prototype.completeSelection=function(e,t){var i=this.chart;"None"!==i.selectionMode&&(this.currentMode=i.selectionMode,(this.dragging||this.resizing)&&5<this.dragRect.width&&5<this.dragRect.height?this.calculateDragSelectedElements(i,this.dragRect):(!i.allowMultiSelection&&this.rectGrabbing&&this.rectPoints.width&&this.rectPoints.height||this.rectGrabbing&&this.dragRectArray[this.targetIndex].width&&this.dragRectArray[this.targetIndex].height)&&this.draggedRectMoved(i,this.dragRect),"Lasso"===i.selectionMode&&this.dragging&&this.path&&-1!==this.path.indexOf("L")&&(i.allowMultiSelection?ie(this.lassoPath+this.count)&&(ie(this.lassoPath+this.count).setAttribute("d",this.path+"Z"),this.pointChecking(ie(this.lassoPath+this.count))):(ie(this.lassoPath).setAttribute("d",this.path+"Z"),this.pointChecking(ie(this.lassoPath))),this.dragging||this.resizing)&&this.calculateDragSelectedElements(i,this.dragRect),this.dragging=!1,this.rectGrabbing=!1,this.resizing=!1,this.removeDraggedElements(i,e,t))},TAe.prototype.getDragRect=function(e,t){return N0e(e.mouseDownX,e.mouseDownY,e.mouseX,e.mouseY,t)},TAe.prototype.dragStart=function(e,t,i,n,o){var r=e.selectionMode,o=(this.currentMode=e.selectionMode,this.dragging=(-1<r.indexOf("Drag")||"Lasso"===r)&&(e.isDoubleTap||!e.isTouch)&&"PolarRadar"!==e.chartAreaType,o.target);if(this.path=void 0,this.dragging&&(this.count=ie(this.multiRectGroup)?this.count+1:0,this.dragRect=new Do(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"===r)for(var s=0,a=e.visibleSeries;s<a.length;s++){var l=a[s];if(l.visible)for(var h=0,d=l.points;h<d.length;h++){var p=d[h];e.allowMultiSelection||(p.isSelect=!1)}}"Lasso"!==r&&(this.rectPoints&&!e.allowMultiSelection&&(this.dragRect=new Do(e.mouseDownX,e.mouseDownY,0,0),this.resizingSelectionRect(e,new Tve(i,n),!0),this.rectGrabbing=o0e(i,n,this.rectPoints)),e.allowMultiSelection)&&(t=this.getIndex(o.id),this.targetIndex=this.isDragRect(o.id)?t:void 0,this.dragRectArray.length)&&this.isDragRect(o.id)&&(this.resizingSelectionRect(e,new Tve(i,n),!0,o),this.rectGrabbing=o0e(i,n,this.dragRectArray[t]))},TAe.prototype.isDragRect=function(e){return-1<e.indexOf("_ej2_drag_rect")},TAe.prototype.mouseMove=function(e){var t=this.chart,i=e.target,n=e.type;this.highlightChart(i,n),"None"!==t.selectionMode&&("touchmove"===n&&(F.isIos||F.isIos7)&&this.dragging&&e.preventDefault&&e.preventDefault(),this.selectionAndDrag(t,i,n))},TAe.prototype.highlightChart=function(e,t){if(("None"!==this.chart.highlightMode||this.chart.legendSettings.enableHighlight)&&!je(e)){if((e=1<e.id.indexOf("_legend_text")?ie(e.id.replace("text","shape")):e).hasAttribute("class")&&(-1<e.getAttribute("class").indexOf("highlight")||-1<e.getAttribute("class").indexOf("selection")))return;this.calculateSelectedElements(e,t),this.chart.highlightModule.highlightDataIndexes&&0<this.chart.highlightModule.highlightDataIndexes.length&&-1===e.id.indexOf("_chart_legend_g_")&&-1===e.id.indexOf("chart_legend_shape")&&-1===e.id.indexOf("_Series_")?this.removeLegendHighlightStyles():this.chart.highlightModule.highlightDataIndexes&&0<this.chart.highlightModule.highlightDataIndexes.length&&-1===e.id.indexOf("_chart_legend_")&&-1<e.id.indexOf("_Series_")&&this.chart.tooltip&&this.chart.tooltip.enableHighlight&&"None"===this.chart.highlightMode&&this.removeLegendHighlightStyles(!0)}},TAe.prototype.selectionAndDrag=function(e,t,i){o0e(e.mouseX,e.mouseY,e.chartAxisLayoutPanel.seriesClipRect)&&!this.chart.enableCanvas?(this.rectGrabbing&&!this.resizing?this.draggedRectMoved(e,this.dragRect,!0):this.dragging&&!this.resizing&&("Lasso"===e.selectionMode?this.getPath(e.mouseDownX,e.mouseDownY,e.mouseX,e.mouseY):this.dragRect=this.getDragRect(e,e.chartAxisLayoutPanel.seriesClipRect),this.drawDraggingRect(e,this.dragRect)),(this.rectPoints&&!e.allowMultiSelection||e.allowMultiSelection&&!this.dragging||this.resizing)&&this.resizingSelectionRect(e,new Tve(e.mouseX,e.mouseY),null,t)):this.completeSelection(t,i)},TAe.prototype.removeLegendHighlightStyles=function(e){var t;this.chart.highlightModule.highlightDataIndexes=[];for(var i=0;i<this.chart.visibleSeries.length;i++)if(t=document.getElementsByClassName(this.generateStyle(this.chart.visibleSeries[i])),0===this.selectedDataIndexes.length){for(t=document.getElementsByClassName(this.generateStyle(this.chart.visibleSeries[i]));0<t.length;){var n=t[0];if(n&&(this.removeSvgClass(n,n.getAttribute("class")),0<n.id.indexOf("Group"))&&!this.chart.visibleSeries[i].isRectSeries)for(var o=this.indexFinder(n.id),r=0;r<n.children.length;r++)"defs"!==n.children[r].nodeName&&this.highlightAnimation(n.children[r],o.series,e?0:700,.3,!e)}for(t=document.getElementsByClassName(this.unselected);0<t.length;)(n=t[0])&&(this.removeSvgClass(n,n.getAttribute("class")),""!==n.id)&&this.highlightAnimation(n,1===this.chart.series.length?0:this.indexFinder(n.id).series,e?0:700,.3)}else for(t=document.getElementsByClassName(this.generateStyle(this.chart.visibleSeries[i]));0<t.length;)(n=t[0])&&(this.removeSvgClass(n,n.getAttribute("class")),this.addSvgClass(n,this.unselected))},TAe.prototype.getPath=function(e,t,i,n){this.dragging&&(this.path?this.path=this.path+" L"+i+" "+n:this.path="M "+e+" "+t)},TAe.prototype.highlightAnimation=function(i,e,t,n,o){var r,s,a=this,l=parseFloat(this.chart.visibleSeries[e].width.toString())+1;o?s=-1!==i.id.indexOf("border")&&this.chart.visibleSeries[e].border.width?parseFloat(this.chart.visibleSeries[e].border.width.toString()):-1!==i.id.indexOf("Symbol")&&this.chart.visibleSeries[e].marker.border.width?parseFloat(this.chart.visibleSeries[e].marker.border.width.toString()):parseFloat(this.chart.visibleSeries[e].width.toString()):(r=-1!==i.id.indexOf("border")?1:-1!==i.id.indexOf("Symbol")?parseFloat(this.chart.visibleSeries[e].marker.opacity.toString()):-1!==i.id.indexOf("legend_shape")?parseFloat(this.chart.legendSettings.opacity.toString()):parseFloat(this.chart.visibleSeries[e].opacity.toString()),je(this.chart.selectionModule)&&"None"===this.chart.selectionMode&&""!==this.chart.highlightColor&&(n=1)),(r||o&&s&&l)&&new Vt({}).animate(i,{duration:t,progress:function(e){var t;i.style.animation="",a.chart.tooltip.enableHighlight&&a.chart.tooltipModule.svgTooltip||(e=e.timeStamp/e.duration,o?(t=l+(s-l)*e,i.setAttribute("stroke-width",t.toString())):(t=n+(r-n)*e,i.setAttribute("opacity",t.toString())))},end:function(){a.chart.tooltip.enableHighlight&&a.chart.tooltipModule.svgTooltip||(o?i.setAttribute("stroke-width",s.toString()):i.setAttribute("opacity",r.toString()))}})},TAe.prototype.stopElementAnimation=function(e,t){t=-1!==e.id.indexOf("border")?1:-1!==e.id.indexOf("Symbol")?parseFloat(this.chart.visibleSeries[t].marker.opacity.toString()):parseFloat(this.chart.visibleSeries[t].opacity.toString());e.getAttribute("e-animate")&&Vt.stop(e),e.setAttribute("opacity",t.toString())},TAe.prototype.pointChecking=function(t){var i,n=this,o=this.chart,e=ie(o.svgId).getBoundingClientRect(),r=o.chartAxisLayoutPanel.seriesClipRect.x+Math.max(e.left,0),s=o.chartAxisLayoutPanel.seriesClipRect.y+Math.max(e.top,0);this.multiDataIndexes[this.count]=[];for(var a=0,l=o.visibleSeries;a<l.length;a++)l[a].points.filter(function(e){(i=e.symbolLocations&&e.symbolLocations.length?document.elementFromPoint(e.symbolLocations[0].x+r,e.symbolLocations[0].y+s):i)===t?(e.isSelect=!0,n.chart.allowMultiSelection&&"Lasso"===n.currentMode&&(n.multiDataIndexes[n.count][n.seriesIndex]=e,n.seriesIndex++)):o.allowMultiSelection||(e.isSelect=!1)});this.seriesIndex=0},TAe.prototype.getModuleName=function(){return"Selection"},TAe.prototype.destroy=function(){this.removeEventListener()};var AAe,xAe,IAe=TAe;function TAe(e){var t=xAe.call(this,e)||this,i=(t.isdrawRect=!0,t.multiDataIndexes=[],t.pathIndex=0,t.seriesIndex=0,t.count=-1,t.dragRectArray=[],t.filterArray=[],t.totalSelectedPoints=[],t.chart=e,t.renderer=e.renderer,e.selectionMode);return t.isMultiDrag=e.isMultiSelect&&-1<i.indexOf("Drag"),t.addEventListener(),t}EAe=function(e,t){return(EAe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}EAe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(kAe,DAe=Wve),kAe.prototype.getElement=function(e){return document.getElementById(e)},kAe.prototype.getTooltipElement=function(e){this.inverted=this.chart.requireInvertedAxis,this.header=null===this.control.tooltip.header?this.control.tooltip.shared?"${point.x}":"${series.name}":this.control.tooltip.header,this.formattedText=[];var t=document.getElementById(this.chart.element.id+"_tooltip"),i=-1<this.chart.element.id.indexOf("stockChart");return!e&&!t||i?this.createElement():null},kAe.prototype.createElement=function(){var e=document.createElement("div");return e.id=this.element.id+"_tooltip",e.className="ejSVGTooltip",e.style.pointerEvents="none",e.style.position="absolute",e.style.zIndex="1",e},kAe.prototype.pushData=function(e,t,i,n,o){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"):document.getElementById(this.element.id+"_Secondary_Element")).appendChild(i),!0)},kAe.prototype.removeHighlight=function(){for(var e,t=0,i=this.previousPoints.length;t<i;t++)((e=this.previousPoints[t]).series.isRectSeries||this.chart.tooltip.enableHighlight)&&e.series.visible&&this.highlightPoint(e.series,e.point.index,!1)},kAe.prototype.animateHighlight=function(i,n,e,o){var r=this,s=parseFloat(n.getAttribute("opacity")),a=null;null!==o&&(a=parseFloat(n.getAttribute("stroke-width"))),new Vt({}).animate(n,{duration:e,progress:function(e){var t;n.style.animation="",r.svgTooltip||(null!==o&&(t=a+e.timeStamp/e.duration*(o-a),n.setAttribute("stroke-width",Math.max(t,o).toString())),t=s+e.timeStamp/e.duration*(i-s),n.setAttribute("opacity",Math.min(t,i).toString()))},end:function(){r.svgTooltip||(null!==o&&n.setAttribute("stroke-width",o.toString()),n.setAttribute("opacity",i.toString()))}})},kAe.prototype.highlightPoint=function(s,a,l){var h=this,e=this.getElement(this.element.id+"_Series_"+s.index+"_Point_"+a),t=this.control.accumulationSelectionModule,d="accumulationchart"===this.chart.getModuleName(),t=!!(t&&0<t.selectedDataIndexes.length);if(e||!s.isRectSeries)if(!t||e.getAttribute("class")&&-1===e.getAttribute("class").indexOf("_ej2_chart_selection_series_")||!s.isRectSeries){if(s.isRectSeries&&""!==this.chart.highlightColor&&!je(this.chart.highlightColor))e.setAttribute("fill",l&&"transparent"!==this.chart.highlightColor?this.chart.highlightColor:""!==s.pointColorMapping?s.points[0].color:s.points[a].color||s.interior);else if("None"!==this.control.highlightMode||!this.chart.tooltip.enableHighlight||this.chart.tooltip.shared&&!d)s.isRectSeries&&e.setAttribute("opacity",(l&&"transparent"!==this.chart.highlightColor?s.opacity/2:s.opacity).toString());else if(!l||!(d?this.control.accumulationSelectionModule&&0<this.control.accumulationSelectionModule.selectedDataIndexes.length:this.chart.selectionModule&&0<this.chart.selectionModule.selectedDataIndexes.length))for(var p=this.element.id+"_Series_"+s.index+"_Point_"+a,i=this,n=0,o=this.chart.visibleSeries;n<o.length;n++)!function(o){var e,t=[],r="number"==typeof o.width?o.width:parseFloat(o.width),t=d?[i.getElement(i.chart.element.id+"_Series_"+o.index)]:new IAe(i.chart).getSeriesElements(o);d&&i.control.series[0].dataLabel.visible&&(e=i.getElement(i.element.id+"_datalabel_Series_0"))&&t.push(e),t.forEach(function(n){n.childNodes.forEach(function(e){var t=-1<e.id.indexOf("border")?1:(-1<e.id.indexOf("Symbol")?o.marker:o).opacity,i=-1<e.id.indexOf("border")&&o.border.width?parseFloat(o.border.width.toString()):-1<e.id.indexOf("Symbol")&&o.marker.border.width?parseFloat(o.marker.border.width.toString()):r;l&&"transparent"!==h.chart.highlightColor&&""!==e.id?(d?-1<n.getAttribute("id").indexOf("datalabel")?Kye(e.id).point===a:e.id===p:n.getAttribute("id")===h.element.id+"DataLabelCollection"?Kye(e.id).series===s.index:o.index===s.index)?(e.setAttribute("opacity",t.toString()),s.isRectSeries&&!(-1<e.id.indexOf("border"))||d||e.setAttribute("stroke-width",(i+1).toString())):(e.setAttribute("opacity",d?-1<e.id.indexOf("datalabel")?"0.5":"0.3":-1<e.getAttribute("id").indexOf("Text")?"0.5":"0.3"),s.isRectSeries&&!(-1<e.id.indexOf("border"))||d||e.setAttribute("stroke-width",i.toString())):h.currentPoints[0]||""===e.id||h.animateHighlight(t,e,h.chart.tooltip.duration,s.isRectSeries&&!(-1<e.id.indexOf("border"))||d?null:i)})})}(o[n])}else e.setAttribute("opacity",s.opacity.toString())},kAe.prototype.highlightPoints=function(){for(var e=0,t=this.currentPoints;e<t.length;e++){var i=t[e];(i.series.isRectSeries||this.chart.tooltip.enableHighlight)&&"Series"===i.series.category&&this.highlightPoint(i.series,i.point.index,!0)}},kAe.prototype.createTooltip=function(e,t,i,n,o,r,s,a,l,h,d,p){void 0===l&&(l=!1),void 0===h&&(h=null),void 0===d&&(d=null);var c=this.currentPoints[0].series,u=e.tooltipModule||e.tooltip3DModule||e.accumulationTooltipModule;u&&null!==i?(t?(this.svgTooltip=new tr({opacity:e.tooltip.opacity||("Material3"===this.chart.theme||"Material3Dark"===this.chart.theme||-1<this.chart.theme.indexOf("Bootstrap5")?1:.75),header:this.headerText,content:this.text,fill:e.tooltip.fill,border:e.tooltip.border,enableAnimation:e.tooltip.enableAnimation,location:i,shared:this.control.tooltip.shared,crosshair:l,shapes:r,clipBounds:"PolarRadar"===this.chart.chartAreaType?new Tve(0,0):n,areaBounds:a,palette:this.findPalette(),template:p||this.template,data:d,theme:e.theme,offset:s,textStyle:e.tooltip.textStyle,isNegative:c.isRectSeries&&"Waterfall"!==c.type&&o&&o.y<0,inverted:this.chart.requireInvertedAxis&&c.isRectSeries,arrowPadding:1<this.text.length||this.chart.stockChart||null!==this.chart.tooltip.location.x||null!==this.chart.tooltip.location.y?0:7,availableSize:e.availableSize,duration:this.chart.tooltip.duration,isCanvas:this.chart.enableCanvas,isFixed:null!==this.chart.tooltip.location.x||null!==this.chart.tooltip.location.y,isTextWrap:e.tooltip.enableTextWrap&&"chart"===e.getModuleName(),blazorTemplate:{name:"Template",parent:this.chart.tooltip},controlInstance:this.chart,enableRTL:e.enableRtl,controlName:"Chart",allowHighlight:"chart"===e.getModuleName()&&!c.marker.allowHighlight,tooltipRender:function(){u.removeHighlight(),u.highlightPoints(),u.updatePreviousPoint(h)},animationComplete:function(e){e.tooltip.fadeOuted&&u.fadeOut(u.previousPoints)},showHeaderLine:this.chart.tooltip.showHeaderLine,showNearestTooltip:this.chart.tooltip.showNearestTooltip}),this.svgTooltip.appendTo(this.getElement(this.element.id+"_tooltip"))):this.svgTooltip&&(this.svgTooltip.location=i,this.svgTooltip.content=this.text,this.svgTooltip.header=this.headerText,this.svgTooltip.offset=s,this.svgTooltip.palette=this.findPalette(),this.svgTooltip.shapes=r,this.svgTooltip.data=d,this.svgTooltip.template=this.template,this.svgTooltip.controlName="Chart",this.svgTooltip.crosshair=l,this.svgTooltip.textStyle=e.tooltip.textStyle,this.svgTooltip.isNegative=c.isRectSeries&&"Waterfall"!==c.type&&o&&o.y<0,this.svgTooltip.clipBounds="PolarRadar"===this.chart.chartAreaType?new Tve(0,0):n,this.svgTooltip.arrowPadding=1<this.text.length||this.chart.stockChart||null!==this.chart.tooltip.location.x||null!==this.chart.tooltip.location.y?0:7,this.svgTooltip.allowHighlight="chart"===e.getModuleName()&&!c.marker.allowHighlight,this.svgTooltip.dataBind()),this.chart.isReact&&this.chart.renderReactTemplates()):Pye(this.chart.element.id+"_tooltip")},kAe.prototype.findPalette=function(){for(var e=[],t=0,i=this.currentPoints;t<i.length;t++){var n=i[t];e.push(this.findColor(n,n.series))}return e},kAe.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},kAe.prototype.updatePreviousPoint=function(e){e&&(this.currentPoints=this.currentPoints.concat(e)),this.previousPoints=Pe([],this.currentPoints,null,!0)},kAe.prototype.fadeOut=function(e){var t=this.chart.enableCanvas?this.getElement(this.element.id+"_tooltip_group"):this.getElement(this.element.id+"_tooltip_svg")||this.getElement(this.element.id+"_tooltipparent_template");t&&0<parseInt(t.getAttribute("opacity"),10)||(this.valueX=null,this.valueY=null,this.currentPoints=[],this.removeHighlight(),this.removeHighlightedMarker(e,!0),this.svgTooltip=null,this.control.trigger("animationComplete",{}))},kAe.prototype.removeHighlightedMarker=function(e,t){if(this.chart.markerRender)for(var i=0,n=e;i<n.length;i++){var o=n[i];Pye(this.element.id+"_Series_"+o.series.index+"_Point_"+o.point.index+"_Trackball"),this.chart.markerRender.removeHighlightedMarker(o.series,o.point,t)}this.previousPoints=[]},kAe.prototype.removeText=function(){this.textElements=[];var e=this.getElement(this.element.id+"_tooltip_group");if(e&&0<e.childNodes.length)for(;e.lastChild&&1!==e.childNodes.length;)e.removeChild(e.lastChild)},kAe.prototype.stopAnimation=function(){H0e(this.toolTipInterval)},kAe.prototype.removeTooltip=function(e){var t=this,i=this.getElement(this.element.id+"_tooltip");this.stopAnimation(),i&&0<this.previousPoints.length&&(this.toolTipInterval=+setTimeout(function(){t.svgTooltip&&t.svgTooltip.fadeOut()},e))};var EAe,DAe,MAe=kAe;function kAe(e){var t=DAe.call(this,e)||this;return t.element=t.chart.element,t.textStyle=e.tooltip.textStyle,t.control=e,t.template=e.tooltip.template,t}PAe=function(e,t){return(PAe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}PAe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(LAe,BAe=MAe),LAe.prototype.addEventListener=function(){var e;this.chart.isDestroyed||(e=F.isPointer?"pointerleave":"mouseleave",this.chart.on(e,this.mouseLeaveHandler,this),this.chart.on("tapHold",this.longPress,this),this.chart.on(F.touchMoveEvent,this.mouseMoveHandler,this),this.chart.on(F.touchEndEvent,this.mouseUpHandler,this))},LAe.prototype.mouseUpHandler=function(){var e=this.control,t=this.getData();t.lierIndex=this.lierIndex,e.isTouch&&!this.isSelected(e)&&(o0e(e.mouseX,e.mouseY,e.chartAxisLayoutPanel.seriesClipRect)&&e.tooltip.shared||!e.tooltip.shared)?e.crosshair.enable?e.startMove&&"Move"===e.tooltip.fadeOutMode&&this.removeTooltip(2e3):(this.tooltip(),"Move"===e.tooltip.fadeOutMode&&this.removeTooltip(e.tooltip.fadeOutDuration)):this.findData(t,this.previousPoints[0])||"Click"!==e.tooltip.fadeOutMode||this.removeTooltip(0)},LAe.prototype.mouseLeaveHandler=function(){this.removeTooltip(this.chart.tooltip.fadeOutDuration)},LAe.prototype.mouseMoveHandler=function(){var e=this.chart;e.stockChart&&e.stockChart.onPanning&&(e.mouseY<e.chartAxisLayoutPanel.seriesClipRect.y?e.mouseY=e.chartAxisLayoutPanel.seriesClipRect.y:e.mouseY>e.chartAxisLayoutPanel.seriesClipRect.y+e.chartAxisLayoutPanel.seriesClipRect.height&&(e.mouseY=e.chartAxisLayoutPanel.seriesClipRect.y+e.chartAxisLayoutPanel.seriesClipRect.height)),e.disableTrackTooltip||this.isSelected(e)||(e.tooltip.shared||e.isTouch&&!e.startMove||this.tooltip(),o0e(e.mouseX,e.mouseY,e.chartAxisLayoutPanel.seriesClipRect)?!e.tooltip.shared||e.isTouch&&!e.startMove||this.tooltip():e.tooltip.shared&&"Move"===e.tooltip.fadeOutMode&&this.removeTooltip(this.chart.tooltip.fadeOutDuration))},LAe.prototype.longPress=function(){var e=this.chart;return e.crosshair.enable&&o0e(e.mouseX,e.mouseY,e.chartAxisLayoutPanel.seriesClipRect)&&(this.tooltip(),e.markerRender.markerMove(!1)),!1},LAe.prototype.tooltip=function(){var e=this.chart.enableCanvas?this.element.id+"_tooltip_group":this.element.id+"_tooltip_svg",e=this.getElement(e),t=this.chart.stockChart&&e&&1<e.firstChild.childNodes.length,e=e&&0<parseInt(e.getAttribute("opacity"),10)&&!t,t=this.getTooltipElement(e);this.chart.enableCanvas&&t&&(document.getElementById(this.chart.element.id+"_Secondary_Element").appendChild(t),t.appendChild(document.getElementById(this.chart.element.id+"_tooltip_svg"))),this.chart.tooltip.shared?this.renderGroupedTooltip(this.chart,!e,t):this.renderSeriesTooltip(this.chart,!e,t)},LAe.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:""},LAe.prototype.findShapes=function(){if(!this.chart.tooltip.enableMarker)return[];for(var e=[],t=0,i=this.currentPoints;t<i.length;t++){var n=i[t];e.push(n.point.marker.shape||n.series.marker.shape||"Circle")}return e},LAe.prototype.renderSeriesTooltip=function(e,t,i){var n=null,o=1/0;if((l=this.getData()).lierIndex=this.lierIndex,this.currentPoints=[],this.findData(l,this.previousPoints[0])){if((!e.dataEditingModule||!e.dataEditingModule.isPointDragging)&&this.previousPoints[0]&&l.point.index===this.previousPoints[0].point.index&&l.series.index===this.previousPoints[0].series.index)return null;this.pushData(l,t,i,!0)&&this.triggerTooltipRender(l,t,this.getTooltipText(l),this.findHeader(l))}else{var r=o0e(e.mouseX,e.mouseY,e.chartAxisLayoutPanel.seriesClipRect);if(l.point||!this.isRemove||"Move"!==e.tooltip.fadeOutMode||e.tooltip.showNearestTooltip&&r){for(var s=this.mergeXvalues(this.chart.visibleSeries),a=e.visibleSeries.length-1;0<=a;a--){var l,h=e.visibleSeries[a];h.visible&&"TrendLine"!==h.category&&(l=this.getClosestX(e,h,s)||l,e.tooltip.showNearestTooltip)&&r&&h.showNearestTooltip&&l&&l.point&&h.enableTooltip&&l.point.symbolLocations[0]&&(h=Math.sqrt(Math.pow(e.mouseX-l.series.clipRect.x-l.point.symbolLocations[0].x,2)+Math.pow(e.mouseY-l.series.clipRect.y-l.point.symbolLocations[0].y,2)))<o&&(o=h,n=l)}e.tooltip.showNearestTooltip&&n&&this.pushData(n,t,i,!0)&&(l=n,this.triggerTooltipRender(l,t,this.getTooltipText(l),this.findHeader(l)))}else this.removeTooltip(this.chart.tooltip.fadeOutDuration),this.isRemove=!1}l&&l.point&&this.findMouseValues(l,e,this)},LAe.prototype.triggerTooltipRender=function(i,n,e,t){function o(e){var t;e.cancel?(r.removeHighlight(),ue(r.getElement(r.element.id+"_tooltip"))):("BoxAndWhisker"===i.series.type&&(r.removeText(),n=!0),r.headerText=e.headerText,r.formattedText=r.formattedText.concat(e.text),r.text=r.formattedText,(t=(t=r.getSymbolLocation(i))||new Tve(null,null)).x=(null!==a.location.x?a.location:t).x,t.y=(null!==a.location.y?a.location:t).y,t=null===t.x&&null===t.y?null:t,r.createTooltip(r.chart,n,t,i.series.clipRect,i.point,r.findShapes(),r.findMarkerHeight(r.currentPoints[0]),new Do(s,s,r.chart.availableSize.width-3-2*s,r.chart.availableSize.height-3-2*s),r.chart.crosshair.enable,null,r.getTemplateText(i),r.template?e.template:"")),r.isRemove=!0}var r=this,e={cancel:!1,name:Xme,text:e,headerText:t,template:void 0,series:this.chart.isBlazor?{}:i.series,textStyle:this.textStyle,point:i.point,data:{pointX:i.point.x,pointY:i.point.y,seriesIndex:i.series.index,seriesName:i.series.name,pointIndex:i.point.index,pointText:i.point.text}},s=this.chart.border.width,a=this.chart.tooltip;o.bind(this,i),this.chart.trigger(Xme,e,o)},LAe.prototype.findMarkerHeight=function(e){e=e.series;return(e.marker.visible||this.chart.tooltip.shared&&(!e.isRectSeries||e.marker.visible)||"Scatter"===e.type||"Scatter"===e.drawType)&&"Candle"!==e.type&&"Hilo"!==e.type&&"HiloOpenClose"!==e.type?(e.marker.height+2)/2+2*e.marker.border.width:0},LAe.prototype.findData=function(e,t){return e.point&&(!t||t.point!==e.point||t&&3<t.lierIndex&&t.lierIndex!==this.lierIndex||t.point===e.point)},LAe.prototype.getSymbolLocation=function(e){var t;if("BoxAndWhisker"!==e.series.type){if(!e.point.symbolLocations[0])return null;t=new Tve(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"RangeStepArea":case"SplineRangeArea":case"RangeColumn":return this.getRangeArea(e,t);default:return t}},LAe.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,"RangeStepArea"===e.series.type)&&(t.y=e.point.regions[0].y+e.point.regions[0].height/2+e.point.regions[0].width),t},LAe.prototype.getWaterfallRegion=function(e,t){return this.inverted?t.x=e.point.y<0?t.x+(this.chart.enableRtl?-e.point.regions[0].width:e.point.regions[0].width):t.x:t.y=e.point.y<0?t.y-e.point.regions[0].height:t.y,t},LAe.prototype.getTooltipText=function(e){var t=e.series;return this.parseTemplate(e.point,t,this.getFormat(this.chart,t),t.xAxis,t.yAxis)},LAe.prototype.getTemplateText=function(e){if(this.template=this.chart.enableHtmlSanitizer?this.chart.sanitize(this.template):this.template,this.template&&this.chart.tooltip.shared){for(var t=[],i=0;i<e.length;i++)t[i]=Pe({},e[i].point),t[i].x=this.formatPointValue(e[i].point,e[i].series.xAxis,"x",!0,!1),"XY"===e[i].series.seriesType?t[i].y=this.formatPointValue(e[i].point,e[i].series.yAxis,"y",!1,!0):(t[i].low=this.formatPointValue(e[i].point,e[i].series.yAxis,"low",!1,!0),t[i].high=this.formatPointValue(e[i].point,e[i].series.yAxis,"high",!1,!0));return t}return this.template?((t=Pe({},e.point)).x=this.formatPointValue(e.point,e.series.xAxis,"x",!0,!1),"XY"===e.series.seriesType?t.y=this.formatPointValue(e.point,e.series.yAxis,"y",!1,!0):(t.low=this.formatPointValue(e.point,e.series.yAxis,"low",!1,!0),t.high=this.formatPointValue(e.point,e.series.yAxis,"high",!1,!0)),t):e.point},LAe.prototype.renderGroupedTooltip=function(e,t,i){for(var n,o,r,s,a=[],l="PolarRadar"===e.chartAreaType?this.getData():null,h=(this.stopAnimation(),this.removeHighlight(),this.currentPoints=[],Number.MAX_VALUE),d=Number.MAX_VALUE,p=(t&&(e.stockChart?i&&!Bo(i.id)&&document.getElementById(e.stockChart.element.id+"_Secondary_Element").appendChild(i):i&&document.getElementById(this.element.id+"_Secondary_Element").appendChild(i)),this.removeText(),{text:[],cancel:!1,name:Wme,data:[],point:[],series:[],headerText:"",textStyle:this.textStyle,template:[]}),c=0,u=0,g=e.visibleSeries;u<g.length;u++){var m=g[u];m.enableTooltip&&m.visible&&("Cartesian"===e.chartAreaType&&m.visible?n=this.getClosestX(e,m,this.commonXValue(this.chart.visibleSeries)):"PolarRadar"===e.chartAreaType&&m.visible&&null!==l.point&&(n=new Mve(m.points[l.point.index],m)),(n=e.tooltip.showNearestPoint&&!n?this.getClosestX(e,m,this.commonXValue([m])):n)&&(p.data.push({pointX:n.point.x,pointY:n.point.y,seriesIndex:n.series.index,seriesName:n.series.name,pointIndex:n.point.index,pointText:n.point.text}),p.series[c]=n.series,p.point[c]=n.point,p.headerText=this.findHeader(n),this.currentPoints.push(n),null!=this.template&&p.template.push(e.enableHtmlSanitizer?e.sanitize(this.template.toString()):this.template.toString()),p.text.push(this.getTooltipText(n)),m=e.requireInvertedAxis?e.mouseY-n.series.clipRect.y:e.mouseX-n.series.clipRect.x,r=e.mouseY-n.series.clipRect.y,n.point.symbolLocations&&n.point.symbolLocations.length&&Math.abs(m-n.point.symbolLocations[0].x)<=h&&Math.abs(n.point.symbolLocations[0].y-r)<Math.abs(d-r)&&(h=Math.abs(m-n.point.symbolLocations[0].x),d=n.point.symbolLocations[0].y,s=n),o="TrendLine"===n.series.category&&e.tooltip.shared?o:s||n,a.push(n)),c++)}if(!e.tooltip.showNearestPoint){var f=[];this.currentPoints=[],p.point=[],p.series=[],p.data=[],p.text=[];for(var y=0,v=a;y<v.length;y++){var b=v[y];b.point.symbolLocations[0].x!==o.point.symbolLocations[0].x&&(-1===b.series.type.indexOf("Column")&&-1===o.series.type.indexOf("Column")||b.point.xValue!==o.point.xValue)||(p.point.push(b.point),p.series.push(b.series),p.text.push(this.getTooltipText(b)),p.headerText=this.findHeader(b),f.push(b),p.data.push({pointX:b.point.x,pointY:b.point.y,seriesIndex:b.series.index,seriesName:b.series.name,pointIndex:b.point.index,pointText:b.point.text}))}this.currentPoints=a=f}0<a.length&&0<this.currentPoints.length?this.triggerSharedTooltip(p,o,[],e,t,a):this.getElement(this.element.id+"_tooltip_path")&&this.getElement(this.element.id+"_tooltip_path").setAttribute("d","")},LAe.prototype.triggerSharedTooltip=function(e,o,r,s,a,l){function t(e){if(e.cancel)Pye(p.element.id+"_tooltip"),r.push(o);else{"BoxAndWhisker"===o.series.type&&(p.removeText(),a=!0);for(var t=0;t<e.text.length;t++)e.text[t]&&u.push(p.currentPoints[t]);p.currentPoints=u,p.formattedText=p.formattedText.concat(e.text),p.text=e.text,p.headerText=e.headerText,"object"!=typeof e.template?(e.template=e.template.split(","),e.template.length>u.length&&(e.template=e.template.splice(e.template.length-1))):e.template.length>u.length&&e.template.splice(e.template.length-1);var i=p.chart.tooltip,n=(p.findMouseValues(o,p.chart,p),p.findSharedLocation());(n=n||new Tve(null,null)).x=(null!==i.location.x?i.location:n).x,n.y=(null!==i.location.y?i.location:n).y,n=null===n.x&&null===n.y?null:n,-1===o.series.type.indexOf("Range")||o0e(n.x,n.y,s.chartAxisLayoutPanel.seriesClipRect)?p.createTooltip(s,a,n,1===p.currentPoints.length?p.currentPoints[0].series.clipRect:null,1===l.length?l[0].point:null,p.findShapes(),p.findMarkerHeight(p.currentPoints[0]),new Do(c,s.stockChart?h+d+c:c,p.chart.availableSize.width-3-2*c,p.chart.availableSize.height-3-2*c),p.chart.crosshair.enable,r,p.template?p.getTemplateText(l):null,p.template?e.template.join(""):""):(Pye(p.element.id+"_tooltip"),r.push(o)),o=null}}var h,d,p=this,i=e.template,i={cancel:!1,name:Wme,text:e.text,headerText:e.headerText,textStyle:e.textStyle,template:i,point:e.point,series:e.series,data:e.data},c=this.chart.border.width,u=[];s.stockChart&&(h=s.stockChart.enablePeriodSelector?s.stockChart.toolbarHeight:0,d=So(this.chart.stockChart.title,this.chart.stockChart.titleStyle,this.chart.themeStyle.tooltipLabelFont).height+10);t.bind(this,o,r),this.chart.trigger(Wme,i,t)},LAe.prototype.findSharedLocation=function(){var e,t,i=this.chart.stockChart;return i?(1===this.text.length&&this.text.push(""),e=i.enablePeriodSelector?i.toolbarHeight:0,t=document.getElementById(i.element.id+"_ChartTitle"),t=""!==i.title?t.getBoundingClientRect().height+10:0,"Nearest"===i.tooltip.position?new Tve(this.valueX,this.valueY+e+t):new Tve(this.chart.chartAxisLayoutPanel.seriesClipRect.x+5,this.chart.chartAxisLayoutPanel.seriesClipRect.y+e+5+t)):1<this.currentPoints.length?new Tve(this.valueX,this.valueY):this.getSymbolLocation(this.currentPoints[0])},LAe.prototype.getBoxLocation=function(e){return 3<this.lierIndex?0<e.point.outliers.length?e.point.symbolLocations[this.lierIndex-4]:null:{x:e.point.regions[0].x+e.point.regions[0].width/2,y:e.point.regions[0].y+e.point.regions[0].height/2}},LAe.prototype.parseTemplate=function(e,t,i,n,o){for(var r,s=RegExp,a=0,l=Object.keys(e);a<l.length;a++){var h=new s("${point."+(d=l[a])+"}","gm");i=i.replace(h.source,this.formatPointValue(e,"${point.x}"===h.source?n:o,d,"${point.x}"===h.source,"${point.high}"===h.source||"${point.open}"===h.source||"${point.close}"===h.source||"${point.low}"===h.source||"${point.y}"===h.source||"${point.minimum}"===h.source||"${point.maximum}"===h.source||"${point.outliers}"===h.source||"${point.upperQuartile}"===h.source||"${point.lowerQuartile}"===h.source||"${point.median}"===h.source))}for(var d,p=0,c=Object.keys(Object.getPrototypeOf(t));p<c.length;p++)h=new s("${series."+(d=c[p])+"}","gm"),r=t[d],i=i.replace(h.source,r);return i},LAe.prototype.formatPointValue=function(e,t,i,n,o){var r;return"Category"!==t.valueType&&n?(r=t.labelFormat&&null!==t.labelFormat.match("{value}"),n="Double"===t.valueType?+e[i]:e[i],r?t.labelFormat.replace("{value}",t.format(n)):t.format(n)):o&&!je(e[i])?(r=t.labelFormat&&null!==t.labelFormat.match("{value}"),n="outliers"===i?t.format(e[i][this.lierIndex-4]):t.format(+e[i]),r?t.labelFormat.replace("{value}",n):n):"size"===i?(o=this.chart.intl.getNumberFormat({format:"",useGrouping:this.chart.useGroupingSeparator}),("number"==typeof e[i]?o(e[i]):e[i])||""):e[i]},LAe.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}",n=e.tooltip.shared?"${series.name}":i;switch(t.seriesType){case"XY":return"Indicator"===t.category&&this.getIndicatorTooltipFormat(t,e,e.tooltip.format),n+" : "+("Bubble"===t.type?-1<e.theme.indexOf("Tailwind3")?"${point.y}  Size : ${point.size}":"<b>${point.y}</b>  Size : <b>${point.size}</b>":-1<e.theme.indexOf("Tailwind3")?"${point.y}":"<b>${point.y}</b>");case"HighLow":return n+"<br/>High : <b>${point.high}</b><br/>Low : <b>${point.low}</b>";case"HighLowOpenClose":return n+"<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 n+"<br/>"+(3<this.lierIndex?"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>")}},LAe.prototype.getIndicatorTooltipFormat=function(e,t,i){e="XY"===e.seriesType?e.name+" : <b>${point.y}</b>":i;return e},LAe.prototype.removeHighlightedMarker=function(e,t){for(var i=0,n=e;i<n.length;i++){var o=n[i];Pye(this.element.id+"_Series_"+o.series.index+"_Point_"+o.point.index+"_Trackball"),this.chart.markerRender&&this.chart.markerRender.removeHighlightedMarker(o.series,o.point,t)}this.previousPoints=[]},LAe.prototype.getModuleName=function(){return"Tooltip"},LAe.prototype.destroy=function(){};var PAe,BAe,FAe=LAe;function LAe(e){e=BAe.call(this,e)||this;return e.commonXvalues=[],e.addEventListener(),e}OAe.prototype.createPanButton=function(e,t){var i=this.chart.svgRenderer,n=this.chart.zoomModule.isPanning?this.chart.themeStyle.toolkitSelectionColor:this.chart.themeStyle.toolkitFill;this.elementOpacity=!this.chart.zoomModule.isZoomed&&this.chart.zoomSettings.showToolbar?"0.2":"1",e.setAttribute("opacity","Fluent2HighContrast"===this.chart.theme?"1":this.elementOpacity),e.id=this.elementId+"_Zooming_Pan",e.setAttribute("role",this.chart.zoomSettings.accessibility.accessibilityRole||"button"),e.setAttribute("tabindex",this.chart.zoomSettings.accessibility.focusable?String(this.chart.zoomSettings.accessibility.tabIndex):"-1"),e.setAttribute("aria-label",this.chart.zoomSettings.accessibility.accessibilityDescription||this.chart.getLocalizedLabel("Pan")),(this.panElements=e).appendChild(i.drawRectangle(new vve(this.elementId+"_Zooming_Pan_1","transparent",{},1,this.chart.themeStyle.toolkitIconRect,-1<this.chart.theme.indexOf("Fluent2")||-1<this.chart.theme.indexOf("Bootstrap5")?4:0,-1<this.chart.theme.indexOf("Fluent2")||-1<this.chart.theme.indexOf("Bootstrap5")?4:0))),e.appendChild(i.drawPath(new No(this.elementId+"_Zooming_Pan_2","Fluent2HighContrast"===this.chart.theme&&"0.2"===this.elementOpacity?"#3FF23F":n,null,null,1,null,"M5,3h2.3L7.275,5.875h1.4L8.65,3H11L8,0L5,3z M3,11V8.7l2.875,0.025v-1.4L3,7.35V5L0,8L3,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"))),t.appendChild(e),this.wireEvents(e,this.pan)},OAe.prototype.createZoomButton=function(e,t){var i=this.chart.svgRenderer,n=this.chart.zoomModule.isPanning||!this.chart.zoomModule.isZoomed&&this.chart.zoomSettings.showToolbar?this.chart.themeStyle.toolkitFill:this.chart.themeStyle.toolkitSelectionColor,o=(this.elementOpacity=this.chart.zoomModule.isPanning||this.chart.zoomModule.isZoomed||!this.chart.zoomSettings.showToolbar?"1":"0.2",this.chart.zoomModule.isPanning?"transparent":this.chart.themeStyle.toolkitIconRectSelectionFill),r=(r="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,")+"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"+"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("role",this.chart.zoomSettings.accessibility.accessibilityRole||"button"),e.setAttribute("tabindex",this.chart.zoomSettings.accessibility.focusable?String(this.chart.zoomSettings.accessibility.tabIndex):"-1"),e.setAttribute("aria-label",this.chart.zoomSettings.accessibility.accessibilityDescription||this.chart.getLocalizedLabel("Zoom")),e.setAttribute("opacity",this.elementOpacity),this.zoomElements=e,this.selectedID=this.chart.zoomModule.isPanning?this.chart.element.id+"_Zooming_Pan_1":this.elementId+"_Zooming_Zoom_1",e.appendChild(i.drawRectangle(new vve(this.elementId+"_Zooming_Zoom_1",o,{},1,this.chart.themeStyle.toolkitIconRect,-1<this.chart.theme.indexOf("Fluent2")||-1<this.chart.theme.indexOf("Bootstrap5")?4:0,-1<this.chart.theme.indexOf("Fluent2")||-1<this.chart.theme.indexOf("Bootstrap5")?4:0))),e.appendChild(i.drawPath(new No(this.elementId+"_Zooming_Zoom_3",n,null,null,1,null,r+"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)},OAe.prototype.createZoomInButton=function(e,t,i){var n=this.chart.svgRenderer,o=this.chart.themeStyle.toolkitFill;e.id=this.elementId+"_Zooming_ZoomIn",e.setAttribute("role",this.chart.zoomSettings.accessibility.accessibilityRole||"button"),e.setAttribute("tabindex",this.chart.zoomSettings.accessibility.focusable?String(this.chart.zoomSettings.accessibility.tabIndex):"-1"),e.setAttribute("aria-label",this.chart.zoomSettings.accessibility.accessibilityDescription||this.chart.getLocalizedLabel("ZoomIn"));e.appendChild(n.drawRectangle(new vve(this.elementId+"_Zooming_ZoomIn_1","transparent",{},1,this.chart.themeStyle.toolkitIconRect,-1<this.chart.theme.indexOf("Fluent2")?4:-1<this.chart.theme.indexOf("Bootstrap5")?2:0,-1<this.chart.theme.indexOf("Fluent2")?4:-1<this.chart.theme.indexOf("Bootstrap5")?2:0))),e.appendChild(n.drawPath(new No(this.elementId+"_Zooming_ZoomIn_2",o,null,null,1,null,"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,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,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,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(n.drawPolygon(new Ive(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",o))),this.zoomInElements=e,this.elementOpacity=i.zoomModule.isPanning||!i.zoomModule.isZoomed&&!i.zoomSettings.showToolbar&&!this.enableZoomButton?"0.2":"1",e.setAttribute("opacity",this.elementOpacity),t.appendChild(e),this.wireEvents(e,this.zoomIn)},OAe.prototype.createZoomOutButton=function(e,t,i){var n=this.chart.svgRenderer,o=this.chart.themeStyle.toolkitFill;e.id=this.elementId+"_Zooming_ZoomOut",e.setAttribute("role",this.chart.zoomSettings.accessibility.accessibilityRole||"button"),e.setAttribute("tabindex",this.chart.zoomSettings.accessibility.focusable?String(this.chart.zoomSettings.accessibility.tabIndex):"-1"),e.setAttribute("aria-label",this.chart.zoomSettings.accessibility.accessibilityDescription||this.chart.getLocalizedLabel("ZoomOut")),e.appendChild(n.drawRectangle(new vve(this.elementId+"_Zooming_ZoomOut_1","transparent",{},1,this.chart.themeStyle.toolkitIconRect,-1<this.chart.theme.indexOf("Fluent2")||-1<this.chart.theme.indexOf("Bootstrap5")?4:0,-1<this.chart.theme.indexOf("Fluent2")||-1<this.chart.theme.indexOf("Bootstrap5")?4:0))),e.appendChild(n.drawPath(new No(this.elementId+"_Zooming_ZoomOut_2","Fluent2HighContrast"===i.theme&&!i.zoomModule.isZoomed||"Fluent2HighContrast"===i.theme&&i.zoomModule.isPanning?"#3FF23F":o,null,null,1,null,"M0,14.622L1.378,16l4.533-4.533v-0.711l0.266-0.266c1.022,0.889,2.4,1.422,3.866,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,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,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=i.zoomModule.isPanning||!i.zoomModule.isZoomed&&i.zoomSettings.showToolbar&&!this.enableZoomButton?"0.2":"1",e.setAttribute("opacity","Fluent2HighContrast"===i.theme?"1":this.elementOpacity),t.appendChild(e),this.wireEvents(e,this.zoomOut)},OAe.prototype.createResetButton=function(e,t,i,n){var o=this.chart.svgRenderer,r=this.chart.themeStyle.toolkitFill;e.id=this.elementId+"_Zooming_Reset",e.setAttribute("role",this.chart.zoomSettings.accessibility.accessibilityRole||"button"),e.setAttribute("tabindex",this.chart.zoomSettings.accessibility.focusable?String(this.chart.zoomSettings.accessibility.tabIndex):"-1"),e.setAttribute("aria-label",this.chart.zoomSettings.accessibility.accessibilityDescription||this.chart.getLocalizedLabel("Reset")),this.elementOpacity=!i.zoomModule.isZoomed&&i.zoomSettings.showToolbar?"0.2":"1",e.setAttribute("opacity","Fluent2HighContrast"===i.theme?"1":this.elementOpacity),n?(n=So(this.chart.getLocalizedLabel("ResetZoom"),{size:"12px"},{size:"12px",fontStyle:"Normal",fontWeight:"400",fontFamily:"Segoe UI"}),e.appendChild(o.drawRectangle(new vve(this.elementId+"_Zooming_Reset_1","transparent",{},1,new Do(0,0,n.width,n.height)))),sve(i.renderer,new ko(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"},"Material3Dark"===this.chart.theme||"Fluent2Dark"===this.chart.theme||"Fluent2HighContrast"===this.chart.theme?"White":"black",e,null,null,null,null,null,null,0,null,i.enableCanvas,null,{size:"12px",fontStyle:"Normal",fontWeight:"400",fontFamily:"Segoe UI"})):(e.appendChild(o.drawRectangle(new vve(this.elementId+"_Zooming_Reset_1","transparent",{},1,this.chart.themeStyle.toolkitIconRect,-1<this.chart.theme.indexOf("Fluent2")||-1<this.chart.theme.indexOf("Bootstrap5")?4:0,-1<this.chart.theme.indexOf("Fluent2")||-1<this.chart.theme.indexOf("Bootstrap5")?4:0))),e.appendChild(o.drawPath(new No(this.elementId+"_Zooming_Reset_2","Fluent2HighContrast"===i.theme&&"0.2"===this.elementOpacity?"#3FF23F":r,null,null,1,null,"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,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,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,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)},OAe.prototype.wireEvents=function(e,t){E.add(e,"mousedown touchstart",t,this),E.add(e,"mouseover",this.showTooltip,this),E.add(e,"mouseout",this.removeTooltip,this),E.add(this.chart.element,"mousemove",this.mouseMoveHandler,this),E.add(this.chart.zoomModule.toolkitElements,"mousedown",this.mouseDownHandler,this),window.addEventListener("mouseup",this.mouseUpHandler.bind(this),!0)},OAe.prototype.mouseMoveHandler=function(e){this.chart.zoomSettings.toolbarPosition.draggable&&(this.isDragging?this.performDragAndDrop(e):this.chart.zoomModule.toolkitElements.setAttribute("cursor",-1<e.target.id.indexOf("Zooming_Rect")?"grab":"none"))},OAe.prototype.mouseDownHandler=function(e){this.chart.zoomSettings.toolbarPosition.draggable&&!this.isDragging&&-1<e.target.id.indexOf("Zooming_Rect")&&(this.isDragging=!0,this.chart.zoomModule.toolkitElements.setAttribute("cursor","grabbing"))},OAe.prototype.mouseUpHandler=function(e){this.isDragging&&(this.isDragging=!1,this.chart.zoomModule.toolkitElements.setAttribute("cursor",-1<e.target.id.indexOf("Zooming_Rect")?"grab":"none"))},OAe.prototype.performDragAndDrop=function(e){var t=this.chart.zoomModule.toolkitElements.getBoundingClientRect().width,i=this.chart.zoomModule.toolkitElements.getBoundingClientRect().height,n=-1<e.type.indexOf("touch")?e.changedTouches[0].clientX:this.chart.mouseX,e=-1<e.type.indexOf("touch")?e.changedTouches[0].clientY:this.chart.mouseY,t=Math.max(this.chart.border.width+2,Math.min(n-t/2,this.chart.availableSize.width-t-this.chart.border.width-2)),i=Math.max(this.chart.border.width+2,Math.min(e-i/2,this.chart.availableSize.height-i-this.chart.border.width-2));n<this.chart.availableSize.width&&e<this.chart.availableSize.height&&(this.chart.zoomModule.toolkitElements.setAttribute("transform","translate("+t+","+i+")"),this.dragHorizontalRatio=t/this.chart.availableSize.width,this.dragVerticalRatio=i/this.chart.availableSize.height)},OAe.prototype.showTooltip=function(e){var t=e.currentTarget.id.split("_Zooming_")[1],i=e.pageX-(So(t,{size:"10px"},{size:"10px",fontStyle:"Normal",fontWeight:"400",fontFamily:"Segoe UI"}).width+5),n=ie(e.currentTarget.id+"_1"),o=ie(e.currentTarget.id+"_2"),r=ie(e.currentTarget.id+"_3");"1"===e.currentTarget.getAttribute("opacity")?e.currentTarget.setAttribute("cursor","pointer"):e.currentTarget.setAttribute("cursor","auto"),n&&(this.hoveredID=n.id,n.setAttribute("fill","Fluent2HighContrast"===this.chart.theme&&"#3FF23F"===e.currentTarget.childNodes[1].getAttribute("fill")?"transparent":this.chart.themeStyle.toolkitIconRectOverFill)),o&&o.setAttribute("fill","Fluent2HighContrast"===this.chart.theme&&"#3FF23F"===e.currentTarget.childNodes[1].getAttribute("fill")?"#3FF23F":this.chart.themeStyle.toolkitSelectionColor),r&&r.setAttribute("fill","Fluent2HighContrast"===this.chart.theme&&"#3FF23F"===e.currentTarget.childNodes[1].getAttribute("fill")?"#3FF23F":this.chart.themeStyle.toolkitSelectionColor),this.chart.isTouch||this.isDragging||t0e("EJ2_Chart_ZoomTip",this.chart.getLocalizedLabel(t),e.pageY+10,i,"10px")},OAe.prototype.removeTooltip=function(){this.hoveredID&&ie(this.hoveredID)&&(t=this.chart.zoomModule.isPanning?-1<this.hoveredID.indexOf("_Pan_")?this.chart.themeStyle.toolkitIconRectSelectionFill:"transparent":-1<this.hoveredID.indexOf("_Zoom_")&&"0.2"!==this.elementOpacity&&"Fluent2HighContrast"!==this.chart.theme?this.chart.themeStyle.toolkitIconRectSelectionFill:"transparent",ie(this.hoveredID).setAttribute("fill",t));var e,t=this.hoveredID?ie(this.hoveredID.replace("_1","_2")):null,i=this.hoveredID?ie(this.hoveredID.replace("_1","_3")):null;t&&(e=this.chart.zoomModule.isPanning?-1<this.hoveredID.indexOf("_Pan_")?this.chart.themeStyle.toolkitSelectionColor:"0.2"===this.elementOpacity&&"Fluent2HighContrast"===this.chart.theme&&"#3FF23F"===ie(this.hoveredID).nextElementSibling.getAttribute("fill")?"#3FF23F":"1"===this.elementOpacity&&"Tailwind3"===this.chart.theme?"#212529":this.chart.themeStyle.toolkitFill:-1<this.hoveredID.indexOf("_Zoom_")?this.chart.themeStyle.toolkitSelectionColor:"Fluent2HighContrast"===this.chart.theme&&"#3FF23F"===ie(this.hoveredID).nextElementSibling.getAttribute("fill")?"#3FF23F":"Tailwind3Dark"===this.chart.theme&&this.chart.zoomModule.isDevice?"black":this.chart.themeStyle.toolkitFill,t.setAttribute("fill",e)),i&&(e=this.chart.zoomModule.isPanning||!this.chart.isZoomed&&this.chart.zoomSettings.showToolbar?"Fluent2HighContrast"===this.chart.theme&&"#3FF23F"===ie(this.hoveredID).nextElementSibling.getAttribute("fill")&&"1"===this.elementOpacity?"#3FF23F":"1"===this.elementOpacity&&"Tailwind3"===this.chart.theme?"#212529":this.chart.themeStyle.toolkitFill:-1<this.hoveredID.indexOf("_Zoom_")?this.chart.themeStyle.toolkitSelectionColor:"Fluent2HighContrast"===this.chart.theme&&"#3FF23F"===ie(this.hoveredID).nextElementSibling.getAttribute("fill")?"#3FF23F":this.chart.themeStyle.toolkitFill,i.setAttribute("fill",e)),Pye("EJ2_Chart_ZoomTip")},OAe.prototype.reset=function(e){var t=this;if(!this.chart.zoomModule.isZoomed)return!1;var i=this.chart,n=(this.enableZoomButton=!1,i.redraw=i.enableCanvas?i.redraw:i.zoomSettings.enableAnimation,i.zoomModule.isDevice?"touchstart"===e.type&&e.stopPropagation():ue(i.zoomModule.toolkitElements),this.removeTooltip(),i.svgObject.setAttribute("cursor","auto"),[]);this.zoomCompleteEvtCollection=[];for(var o=0,r=i.axisCollections;o<r.length;o++){var s=r[o],a={cancel:!1,name:rfe,axis:s,previousZoomFactor:s.zoomFactor,previousZoomPosition:s.zoomPosition,currentZoomFactor:1,currentZoomPosition:0,previousVisibleRange:s.visibleRange,currentVisibleRange:null};s.zoomFactor=1,s.zoomPosition=0,s.zoomingScrollBar&&(s.zoomingScrollBar.isScrollUI=!1),a.cancel||(s.zoomFactor=a.currentZoomFactor,s.zoomPosition=a.currentZoomPosition,this.zoomCompleteEvtCollection.push(a)),n.push({zoomFactor:s.zoomFactor,zoomPosition:s.zoomFactor,axisName:s.name,axisRange:s.visibleRange}),i.zoomModule.isDevice&&!this.chart.isBlazor&&i.trigger(rfe,a)}e={cancel:!1,axisCollection:n,name:Sfe};return!e.cancel&&this.chart.isBlazor?(this.chart.trigger(Sfe,e,function(){t.setDefferedZoom(i)}),!1):this.setDefferedZoom(i)},OAe.prototype.setDefferedZoom=function(e){e.disableTrackTooltip=!1;var t=e.duration;if(e.duration=600,e.zoomModule.isZoomed=e.zoomModule.isPanning=e.isChartDrag=e.delayRedraw=!1,e.zoomModule.touchMoveList=e.zoomModule.touchStartList=[],e.zoomModule.pinchTarget=null,e.zoomRedraw=e.zoomSettings.enableAnimation,e.redraw){var i=ie(e.element.id+"_Zooming_KitCollection");if(i&&i.remove(),e.tooltipModule){ie(e.element.id+"_tooltip")&&ie(e.element.id+"_tooltip").remove();for(var n=0,o=e.visibleSeries;n<o.length;n++){var r=o[n];je(r)||!r.marker.visible&&!e.tooltip.shared&&"Scatter"!==r.type&&"Bubble"!==r.type||e.markerRender.removeHighlightedMarker(r,null,!0)}}}else e.removeSvg();return e.refreshAxis(),e.refreshBound(),this.elementOpacity="1",e.duration=t,e.redraw=!1},OAe.prototype.zoomIn=function(){return this.zoomInOutCalculation(1,this.chart,this.chart.axisCollections,this.chart.zoomSettings.mode),!1},OAe.prototype.zoomOut=function(){return this.enableZoomButton=!1,this.zoomInOutCalculation(-1,this.chart,this.chart.axisCollections,this.chart.zoomSettings.mode),!1},OAe.prototype.zoom=function(){return this.chart.zoomModule.isPanning=!1,this.elementOpacity="1",this.chart.svgObject.setAttribute("cursor","auto"),this.zoomInElements&&this.zoomInElements.setAttribute("opacity",this.elementOpacity),this.elementOpacity=!this.chart.zoomModule.isZoomed&&this.chart.zoomSettings.showToolbar?"0.2":"1",this.zoomOutElements&&this.zoomOutElements.setAttribute("opacity",this.elementOpacity),this.applySelection(this.zoomElements.childNodes,this.chart.themeStyle.toolkitSelectionColor),"Fluent2HighContrast"===this.chart.theme&&(this.zoomInElements&&this.applySelection(this.zoomInElements.childNodes,this.chart.themeStyle.toolkitFill),this.zoomOutElements)&&this.applySelection(this.zoomOutElements.childNodes,this.chart.themeStyle.toolkitFill),this.panElements&&this.applySelection(this.panElements.childNodes,"Tailwind3Dark"===this.chart.theme?"#FFFFFF":"#737373"),ie(this.selectedID)&&ie(this.selectedID).setAttribute("fill","transparent"),this.selectedID=this.chart.element.id+"_Zooming_Zoom_1",ie(this.selectedID).setAttribute("fill",this.chart.themeStyle.toolkitIconRectSelectionFill),!1},OAe.prototype.pan=function(){var e;return this.chart.zoomModule.isZoomed&&(this.chart.zoomModule.isPanning=!0,this.chart.svgObject.setAttribute("cursor","pointer"),this.elementOpacity="0.2",this.zoomInElements&&this.zoomInElements.setAttribute("opacity",this.elementOpacity),this.zoomOutElements&&this.zoomOutElements.setAttribute("opacity",this.elementOpacity),"Fluent2HighContrast"===this.chart.theme&&((e=ie(this.chart.element.id+"_Zooming_ZoomOut"))&&e.setAttribute("opacity","1"),(e=ie(this.chart.element.id+"_Zooming_ZoomIn"))&&e.setAttribute("opacity","1"),(e=ie(this.chart.element.id+"_Zooming_ZoomOut_2"))&&e.setAttribute("fill","#3FF23F"),(e=ie(this.chart.element.id+"_Zooming_ZoomIn_2"))&&e.setAttribute("fill","#3FF23F"),e=ie(this.chart.element.id+"_Zooming_ZoomIn_3"))&&e.setAttribute("fill","#3FF23F"),this.panElements&&this.applySelection(this.panElements.childNodes,this.chart.themeStyle.toolkitSelectionColor),this.zoomElements&&this.applySelection(this.zoomElements.childNodes,"Tailwind3Dark"===this.chart.theme?"#FFFFFF":"#737373"),ie(this.selectedID)&&ie(this.selectedID).setAttribute("fill","transparent"),this.selectedID=this.chart.element.id+"_Zooming_Pan_1",ie(this.selectedID).setAttribute("fill",this.chart.themeStyle.toolkitIconRectSelectionFill)),!1},OAe.prototype.zoomInOutCalculation=function(e,t,i,n){var o=this;if(this.isZoomed=!0,t.zoomSettings.showToolbar&&(this.elementOpacity=this.zoomInElements.getAttribute("opacity")),!t.zoomModule.isPanning&&"0.2"!==this.elementOpacity){t.zoomSettings.showToolbar&&!t.isZoomed&&(t.zoomModule.isZoomed=!0);for(var r,s=void 0,a=(t.disableTrackTooltip=!0,t.delayRedraw=!0,void 0),l=(this.zoomCompleteEvtCollection=[],[]),h=0,d=i;h<d.length;h++){var p=d[h],a={cancel:!1,name:rfe,axis:p,previousZoomFactor:p.zoomFactor,previousZoomPosition:p.zoomPosition,currentZoomFactor:p.zoomFactor,currentZoomPosition:p.zoomPosition,previousVisibleRange:p.visibleRange,currentVisibleRange:null};("Horizontal"===p.orientation&&"Y"!==n||"Vertical"===p.orientation&&"X"!==n)&&(s=1===(r=Math.max(Math.max(1/T0e(p.zoomFactor,0,1),1)+.25*e,1))?1:T0e(1/r,0,1),r=1===r?0:p.zoomPosition+.5*(p.zoomFactor-s),p.zoomPosition===r&&p.zoomFactor===s||(s=1<r+s?1-r:s),a.currentZoomFactor=s,a.currentZoomPosition=r,a.cancel||(p.zoomFactor=a.currentZoomFactor,p.zoomPosition=a.currentZoomPosition,this.zoomCompleteEvtCollection.push(a)),l.push({zoomFactor:p.zoomFactor,zoomPosition:p.zoomFactor,axisName:p.name,axisRange:p.visibleRange}))}var c={cancel:!1,axisCollection:l,name:Sfe};this.chart.trigger(Sfe,c,function(){c.cancel&&new NAe(t).zoomCancel(i,o.zoomCompleteEvtCollection)})}},OAe.prototype.applySelection=function(e,t){for(var i=1,n=e.length;i<n;i++)e[i].setAttribute("fill",t)};var RAe=OAe;function OAe(e){this.iconRectOverFill="transparent",this.iconRectSelectionFill="transparent",this.zoomCompleteEvtCollection=[],this.isZoomed=!1,this.chart=e,this.elementId=e.element.id,this.chart.svgRenderer=new fo(this.elementId)}VAe.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&&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))},VAe.prototype.drawZoomingRectangle=function(e){var t=e.chartAxisLayoutPanel.seriesClipRect,i=new Tve(e.previousMouseMoveX,e.previousMouseMoveY),n=new Tve(e.mouseX,e.mouseY),i=this.zoomingRect=I0e(i,n,t);if(0<i.width&&0<i.height){if(this.isZoomed=!0,e.disableTrackTooltip=!0,e.svgObject.setAttribute("cursor","crosshair"),"X"===this.zooming.mode?(i.height=t.height,i.y=t.y):"Y"===this.zooming.mode&&(i.width=t.width,i.x=t.x),e.tooltipModule){e.tooltipModule.removeTooltip(0);for(var o=0,r=e.visibleSeries;o<r.length;o++){var s=r[o];je(s)||!s.marker.visible&&!e.tooltip.shared||e.markerRender.removeHighlightedMarker(s,null,!0)}}e.crosshairModule&&e.crosshairModule.removeCrosshair(0);n=e.svgObject;this.chart.enableCanvas&&(t=document.getElementById(this.chart.element.id+"_Secondary_Element"),(n=this.chart.svgRenderer.createSvg({id:this.chart.element.id+"_zoomRect_svg",width:this.chart.availableSize.width,height:this.chart.availableSize.height})).style.cssText="position: absolute; display:block; pointer-events: none",t.appendChild(n)),n.appendChild(e.svgRenderer.drawRectangle(new vve(this.elementId+"_ZoomArea",e.themeStyle.selectionRectFill,{color:e.themeStyle.selectionRectStroke,width:1},1,i,0,0,"","3")))}},VAe.prototype.doPan=function(e,t,i,n){var o,r=this;if(void 0===i&&(i=0),void 0===n&&(n=0),e.startMove&&e.crosshair.enable)return null;this.isZoomed=!0,this.startPanning=!0,this.offset=e.delayRedraw?this.offset:e.chartAxisLayoutPanel.seriesClipRect,e.delayRedraw=!0,this.zoomCompleteEvtCollection=[],e.disableTrackTooltip=!0;for(var s=[],a=0,l=t;a<l.length;a++){var h=l[a],d={cancel:!1,name:rfe,axis:h,previousZoomFactor:h.zoomFactor,previousZoomPosition:h.zoomPosition,currentZoomFactor:h.zoomFactor,currentZoomPosition:h.zoomPosition,previousVisibleRange:h.visibleRange,currentVisibleRange:null},p=Math.max(1/T0e(h.zoomFactor,0,1),1);"Horizontal"===h.orientation?(o=(0!==i?i:e.previousMouseMoveX-e.mouseX)/h.rect.width/p,d.currentZoomPosition=T0e(h.zoomPosition+o,0,1-h.zoomFactor)):(o=(0!==n?n:e.previousMouseMoveY-e.mouseY)/h.rect.height/p,d.currentZoomPosition=T0e(h.zoomPosition-o,0,1-h.zoomFactor)),d.cancel||(h.zoomFactor=d.currentZoomFactor,h.zoomPosition=d.currentZoomPosition,this.zoomCompleteEvtCollection.push(d)),s.push({zoomFactor:h.zoomFactor,zoomPosition:h.zoomFactor,axisName:h.name,axisRange:h.visibleRange})}if(e.tooltipModule){var c=ie(e.element.id+"_tooltip");c&&c.remove();for(var u=0,g=e.visibleSeries;u<g.length;u++){var m=g[u];je(m)||!m.marker.visible&&!e.tooltip.shared&&"Scatter"!==m.type&&"Bubble"!==m.type||e.markerRender.removeHighlightedMarker(m,null,!0)}}var f={cancel:!1,axisCollection:s,name:Sfe};!f.cancel&&this.chart.isBlazor?this.chart.trigger(Sfe,f,function(){f.cancel?r.zoomCancel(t,r.zoomCompleteEvtCollection):r.performDefferedZoom(e)}):this.chart.trigger(Sfe,f,function(){f.cancel?r.zoomCancel(t,r.zoomCompleteEvtCollection):(r.performDefferedZoom(e),r.redrawOnZooming(e,!1))})},VAe.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},VAe.prototype.performZoomRedraw=function(e){var t=this.zoomingRect;if(e.animateSeries=!1,this.isZoomed)if(0<t.width&&0<t.height)this.performedUI=!0,e.svgObject.setAttribute("cursor","auto"),this.doZoom(e,e.axisCollections,e.chartAxisLayoutPanel.seriesClipRect),e.isDoubleTap=!1;else if(e.disableTrackTooltip){if(e.disableTrackTooltip=!1,e.delayRedraw=!1,e.enableCanvas)e.createChartSvg();else{t=ie(e.element.id+"_ZoomArea"),t=(t&&t.remove(),ie(e.element.id+"_Zooming_KitCollection"));if(t&&t.remove(),e.tooltipModule){ie(e.element.id+"_tooltip")&&ie(e.element.id+"_tooltip").remove();for(var i=0,n=e.visibleSeries;i<n.length;i++){var o=n[i];je(o)||!o.marker.visible&&!e.tooltip.shared&&"Scatter"!==o.type&&"Bubble"!==o.type||e.markerRender.removeHighlightedMarker(o,null,!0)}}}var t=e.duration,r=(this.isPanning&&(e.isChartDrag||this.startPanning)||e.enableCanvas||(e.duration=600,e.redraw=this.zooming.enableAnimation,e.zoomRedraw=this.zooming.enableAnimation),[]);e.highlightModule&&(e.legendSettings.enableHighlight||"None"!==e.highlightMode)&&e.highlightModule.highlightDataIndexes&&(r=e.highlightModule.highlightDataIndexes),e.refreshAxis(),e.refreshBound(),e.highlightModule&&(e.legendSettings.enableHighlight||"None"!==e.highlightMode)&&r&&(e.highlightModule.highlightDataIndexes=r),this.isZoomed||(e.zoomRedraw=this.zooming.enableAnimation),this.startPanning=!1,e.redraw=!1,e.duration=t,this.toolkit.isZoomed&&(e.zoomRedraw=!1,this.toolkit.isZoomed=!1)}},VAe.prototype.refreshAxis=function(i,e,t){var n=e.zoomSettings.mode;i.measureAxis(new Do(e.initialClipRect.x,e.initialClipRect.y,e.initialClipRect.width,e.initialClipRect.height)),t.map(function(e,t){"Horizontal"===e.orientation&&"Y"!==n&&i.drawXAxisLabels(e,t,null,e.placeNextToAxisLine?e.updatedRect:e.rect),"Vertical"===e.orientation&&"X"!==n&&i.drawYAxisLabels(e,t,null,e.placeNextToAxisLine?e.updatedRect:e.rect)})},VAe.prototype.doZoom=function(e,t,i){var n=this,o=this.zoomingRect,r=this.zooming.mode,s=(this.isPanning=e.zoomSettings.enablePan||this.isPanning,[]);this.zoomCompleteEvtCollection=[];for(var a=0,l=t;a<l.length;a++){var h=l[a],d={cancel:!1,name:rfe,axis:h,previousZoomFactor:h.zoomFactor,previousZoomPosition:h.zoomPosition,currentZoomFactor:h.zoomFactor,currentZoomPosition:h.zoomPosition,previousVisibleRange:h.visibleRange,currentVisibleRange:null};"Horizontal"===h.orientation?"Y"!==r&&(d.currentZoomPosition+=Math.abs((o.x-i.x)/i.width)*h.zoomFactor,d.currentZoomFactor*=o.width/i.width):"X"!==r&&(d.currentZoomPosition+=(1-Math.abs((o.height+(o.y-i.y))/i.height))*h.zoomFactor,d.currentZoomFactor*=o.height/i.height),parseFloat(d.currentZoomFactor.toFixed(3))<=.001&&(d.currentZoomFactor=d.previousZoomFactor,d.currentZoomPosition=d.previousZoomPosition),d.cancel||(h.zoomFactor=d.currentZoomFactor,h.zoomPosition=d.currentZoomPosition,e.zoomRedraw=this.zooming.enableAnimation,this.zoomCompleteEvtCollection.push(d)),s.push({zoomFactor:h.zoomFactor,zoomPosition:h.zoomFactor,axisName:h.name,axisRange:h.visibleRange})}var p={cancel:!1,axisCollection:s,name:Sfe};!p.cancel&&this.chart.isBlazor?this.chart.trigger(Sfe,p,function(){p.cancel?n.zoomCancel(t,n.zoomCompleteEvtCollection):(n.zoomingRect=new Do(0,0,0,0),n.performZoomRedraw(e))}):this.chart.trigger(Sfe,p,function(){p.cancel?n.zoomCancel(t,n.zoomCompleteEvtCollection):(n.zoomingRect=new Do(0,0,0,0),n.redrawOnZooming(e))})},VAe.prototype.redrawOnZooming=function(e,t,i){var n,o=((i=void 0===i?!1:i)?this.toolkit:this).zoomCompleteEvtCollection;(t=void 0===t?!0:t)&&this.performZoomRedraw(e);for(var r=0;r<o.length;r++)o[r].cancel||(n={cancel:!1,name:rfe,axis:e.axisCollections[r],previousZoomFactor:o[r].previousZoomFactor,previousZoomPosition:o[r].previousZoomPosition,currentZoomFactor:e.axisCollections[r].zoomFactor,currentZoomPosition:e.axisCollections[r].zoomPosition,currentVisibleRange:e.axisCollections[r].visibleRange,previousVisibleRange:o[r].previousVisibleRange},e.trigger(rfe,n))},VAe.prototype.performMouseWheelZooming=function(e,t,i,n,o){for(var r,s,a,l=this,h="mozilla"!==this.browserName||this.isPointer?0<e.wheelDelta?1:-1:0<-e.detail/3?1:-1,d=this.zooming.mode,p=(this.isZoomed=!0,this.calculateZoomAxesRange(n),n.disableTrackTooltip=!0,this.performedUI=!0,this.isPanning=n.zoomSettings.enablePan||this.isPanning,this.zoomCompleteEvtCollection=[],[]),c=0,u=o;c<u.length;c++){var g=u[c],m={cancel:!1,name:rfe,axis:g,previousZoomFactor:g.zoomFactor,previousZoomPosition:g.zoomPosition,currentZoomFactor:g.zoomFactor,currentZoomPosition:g.zoomPosition,currentVisibleRange:null,previousVisibleRange:g.visibleRange};("Vertical"===g.orientation&&"X"!==d||"Horizontal"===g.orientation&&"Y"!==d)&&(1<=(a=5e10<(a=Math.max(Math.max(1/T0e(g.zoomFactor,0,1),1)+.25*h,1))?5e10:a)&&(r="Horizontal"===g.orientation?t/g.rect.width:1-i/g.rect.height,s=1===a?1:T0e((0<h?.9:1.1)/a,0,1),a=1===a?0:g.zoomPosition+(g.zoomFactor-s)*(1<r?1:r<0?0:r),g.zoomPosition===a&&g.zoomFactor===s||(s=1<a+s?1-a:s),parseFloat(m.currentZoomFactor.toFixed(3))<=.001?(m.currentZoomFactor=m.previousZoomFactor,m.currentZoomPosition=m.previousZoomPosition):(m.currentZoomFactor=s,m.currentZoomPosition=a)),m.currentZoomFactor===m.previousZoomFactor&&m.currentZoomPosition===m.previousZoomPosition&&(n.disableTrackTooltip=!1),m.cancel||(g.zoomFactor=m.currentZoomFactor,g.zoomPosition=m.currentZoomPosition,n.zoomRedraw=this.zooming.enableAnimation,this.zoomCompleteEvtCollection.push(m))),p.push({zoomFactor:g.zoomFactor,zoomPosition:g.zoomFactor,axisName:g.name,axisRange:g.visibleRange})}var f={cancel:!1,axisCollection:p,name:Sfe};!f.cancel&&this.chart.isBlazor?this.chart.trigger(Sfe,f,function(){f.cancel?l.zoomCancel(o,l.zoomCompleteEvtCollection):l.performZoomRedraw(n)}):this.chart.trigger(Sfe,f,function(){f.cancel?l.zoomCancel(o,l.zoomCompleteEvtCollection):l.redrawOnZooming(n)})},VAe.prototype.performPinchZooming=function(e,t){if(0<this.zoomingRect.width&&0<this.zoomingRect.height||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 i=t.element.getBoundingClientRect(),n=this.touchStartList,o=this.touchMoveList,r=n[0].pageX-i.left,s=n[0].pageY-i.top,a=o[0].pageX-i.left,l=o[0].pageY-i.top,h=n[1].pageX-i.left,n=n[1].pageY-i.top,d=o[1].pageX-i.left,o=o[1].pageY-i.top,p=Math.abs(a-d)/Math.abs(r-h),c=Math.abs(l-o)/Math.abs(s-n),i=(this.offset.x-a)/p+r,d=(this.offset.y-l)/c+s,h=new Do(i,d,this.offset.width/p,this.offset.height/c),u=a-p*r,g=l-c*s;if(!isNaN(p-p)&&!isNaN(c-c))switch(this.zooming.mode){case"XY":this.setTransform(u,g,p,c,t,!0);break;case"X":this.setTransform(u,0,p,1,t,!0);break;case"Y":this.setTransform(0,g,1,c,t,!0)}return this.calculatePinchZoomFactor(t,h)||(this.refreshAxis(t.chartAxisLayoutPanel,t,t.axisCollections),this.redrawOnZooming(t,!1)),!0},VAe.prototype.calculatePinchZoomFactor=function(e,t){var i,n,o,r,s,a,l,h,d=this.zooming.mode,p=[];this.zoomCompleteEvtCollection=[];for(var c=0;c<e.axisCollections.length;c++){var u=e.axisCollections[c];("Horizontal"===u.orientation&&"Y"!==d||"Vertical"===u.orientation&&"X"!==d)&&(l=u.zoomFactor,h=u.zoomPosition,a={cancel:!1,name:rfe,axis:u,previousZoomFactor:u.zoomFactor,previousZoomPosition:u.zoomPosition,currentZoomFactor:l,currentZoomPosition:h,previousVisibleRange:u.visibleRange,currentVisibleRange:null},o="Horizontal"===u.orientation?(n=(r=t.x-this.offset.x)/(s=u.rect.width/this.zoomAxes[c].delta)+this.zoomAxes[c].min,(r=t.x+t.width-this.offset.x)/s+this.zoomAxes[c].min):(r=t.y-this.offset.y,s=u.rect.height/this.zoomAxes[c].delta,n=(-1*r+u.rect.height)/s+this.zoomAxes[c].min,(-1*(r=t.y+t.height-this.offset.y)+u.rect.height)/s+this.zoomAxes[c].min),i=Math.min(n,o),o=Math.max(n,o),h=(i-this.zoomAxes[c].actualMin)/this.zoomAxes[c].actualDelta,l=(o-i)/this.zoomAxes[c].actualDelta,a.currentZoomPosition=h<0?0:h,a.currentZoomFactor=1<l?1:l<.03?.03:l,a.cancel||(u.zoomFactor=a.currentZoomFactor,u.zoomPosition=a.currentZoomPosition,e.zoomRedraw=this.zooming.enableAnimation,this.zoomCompleteEvtCollection.push(a)),p.push({zoomFactor:u.zoomFactor,zoomPosition:u.zoomFactor,axisName:u.name,axisRange:u.visibleRange}))}var g={cancel:!1,axisCollection:p,name:Sfe};return!(g.cancel||(this.chart.trigger(Sfe,g),!g.cancel)||(this.zoomCancel(e.axisCollections,this.zoomCompleteEvtCollection),0))},VAe.prototype.setTransform=function(e,t,i,n,o,r){if(o.enableCanvas||o.seriesElements.setAttribute("clip-path","url(#"+this.elementId+"_ChartAreaClipRect_)"),o.indicatorElements&&o.indicatorElements.setAttribute("clip-path","url(#"+this.elementId+"_ChartAreaClipRect_)"),null!==e&&null!==t)for(var s=0,a=o.visibleSeries;s<a.length;s++){var l=a[s],h=(o.requireInvertedAxis?l.yAxis:l.xAxis).rect.x,d=(o.requireInvertedAxis?l.xAxis:l.yAxis).rect.y,h="translate("+(e+(r?i*h:h))+","+(t+(r?n*d:d))+")";h=i||n?h+" scale("+i+" "+n+")":h,l.visible&&("Indicator"===l.category?l.seriesElement.parentNode.setAttribute("transform",h):o.enableCanvas||l.seriesElement.setAttribute("transform",h),d=ie(o.element.id+"_Series_"+l.index+"_DataLabelCollections"),l.errorBarElement&&l.errorBarElement.setAttribute("transform",h),l.symbolElement&&l.symbolElement.setAttribute("transform",h),l.textElement&&(l.textElement.setAttribute("visibility","hidden"),l.shapeElement.setAttribute("visibility","hidden")),d)&&(d.style.visibility="hidden")}},VAe.prototype.calculateZoomAxesRange=function(e){for(var t=0;t<e.axisCollections.length;t++){var i=e.axisCollections[t],n=i.visibleRange;this.zoomAxes[t]?e.delayRedraw||(this.zoomAxes[t].min=n.min,this.zoomAxes[t].delta=n.delta):(i={actualMin:i.actualRange.min,actualDelta:i.actualRange.delta,min:n.min,delta:n.delta},this.zoomAxes[t]=i)}},VAe.prototype.showZoomingToolkit=function(e){var t,i,n=this.zooming.toolbarItems,o=e.chartAxisLayoutPanel.seriesClipRect,r=e.svgRenderer,s=this.isDevice?0===n.length?0:1:n.length,a=this.isDevice?So("Reset Zoom",{size:"12px"},{size:"12px",fontStyle:"Normal",fontWeight:"400",fontFamily:"Segoe UI"}).width:16,l=this.isDevice?So("Reset Zoom",{size:"12px"},{size:"12px",fontStyle:"Normal",fontWeight:"400",fontFamily:"Segoe UI"}).height:-1<e.theme.indexOf("Fluent2")||-1<e.theme.indexOf("Bootstrap5")?18:22,h=s*a+10*(s+1)+10*(s-1),d=this.zooming.toolbarPosition;switch(d.horizontalAlignment){case"Far":t=o.x+o.width-h-10;break;case"Near":t=o.x+10;break;case"Center":t=o.width/2-h/2+o.x}switch(t+=d.x,d.verticalAlignment){case"Bottom":i=o.height-o.y+l+10;break;case"Top":i=o.y+10;break;case"Middle":i=o.height/2-l/2+o.y}i+=d.y,t=null!=this.toolkit.dragHorizontalRatio?Math.min(Math.max(this.chart.border.width+2,this.toolkit.dragHorizontalRatio*this.chart.availableSize.width),this.chart.availableSize.width-h-this.chart.border.width-2):t,i=null!=this.toolkit.dragVerticalRatio?Math.min(Math.max(this.chart.border.width+2,this.toolkit.dragVerticalRatio*this.chart.availableSize.height),this.chart.availableSize.height-l-this.chart.border.width-2):i;var p,c=10,u=this.toolkit;if(0===s||ie(this.elementId+"_Zooming_KitCollection"))return!1;d=r.createDefs(),n=this.isDevice?["Reset"]:n;d.innerHTML='<filter id="chart_shadow" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="5"/><feOffset dx="-3" dy="4" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="1"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>',this.toolkitElements=r.createGroup({id:this.elementId+"_Zooming_KitCollection",transform:"translate("+t+","+i+")"}),this.toolkitElements.appendChild(d);for(var g,m,d="Tailwind3"===this.chart.theme?"#F9FAFB":"Fluent"===this.chart.theme?"#F3F2F1":"Material3"===this.chart.theme?"#FFFFFF":"Material3Dark"===this.chart.theme?"#1C1B1F":"Fluent2"===this.chart.theme?"#F5F5F5":"Fluent2Dark"===this.chart.theme?"#141414":"Fluent2HighContrast"===e.theme?"#000000":"Bootstrap5"===e.theme?"#E9ECEF":"Bootstrap5Dark"===e.theme?"#343A40":"Tailwind3Dark"!==e.theme||this.isDevice?"Tailwind"===this.chart.theme?"#F3F4F6":"#fafafa":"#1D2432",d=(this.toolkitElements.appendChild(r.drawRectangle(new vve(this.elementId+"_Zooming_Rect",d,{color:"transparent",width:1},1,new Do(0,0,h,l+20),-1<this.chart.theme.indexOf("Bootstrap5")?1:4,-1<this.chart.theme.indexOf("Bootstrap5")?1:4))),r.drawRectangle(new vve(this.elementId+"_Zooming_Rect",d,{color:"transparent",width:1},.1,new Do(0,0,h,l+20),4,4))),f=("Tailwind"===this.chart.theme||"TailwindDark"===this.chart.theme||"Tailwind3Dark"===this.chart.theme?d.setAttribute("box-shadow","0px 1px 2px rgba(0, 0, 0, 0.06), 0px 1px 3px rgba(0, 0, 0, 0.1)"):"Material3"===this.chart.theme||"Material3Dark"===this.chart.theme||"Fluent2"===this.chart.theme||"Fluent2Dark"===this.chart.theme||-1<this.chart.theme.indexOf("Bootstrap5")?(d.setAttribute("filter","drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.15)) drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3))"),d.setAttribute("fill","Material3"===this.chart.theme?"#FFFFFF":"Fluent2"===this.chart.theme?"#F5F5F5":"Bootstrap5"===this.chart.theme?"#E9ECEF":"Bootstrap5Dark"===this.chart.theme?"#343A40":"#1C1B1F"),d.setAttribute("rx",-1<this.chart.theme.indexOf("Bootstrap5")?"1px":"4px"),d.setAttribute("ry",-1<this.chart.theme.indexOf("Bootstrap5")?"1px":"4px"),d.setAttribute("opacity","1")):("Tailwind3"===e.theme&&d.setAttribute("fill","#F9FAFB"),d.setAttribute("filter","url(#chart_shadow)")),this.toolkitElements.appendChild(d),!1),y=1;y<=s;y++){switch(g=n[y-1],p=r.createGroup({transform:"translate("+c+","+(this.isDevice?10:-1<e.theme.indexOf("Fluent2")||-1<e.theme.indexOf("Bootstrap5")?11:13)+")"}),g){case"Pan":u.createPanButton(p,this.toolkitElements),f=!0;break;case"Zoom":u.createZoomButton(p,this.toolkitElements);break;case"ZoomIn":u.createZoomInButton(p,this.toolkitElements,e);break;case"ZoomOut":u.createZoomOutButton(p,this.toolkitElements,e);break;case"Reset":u.createResetButton(p,this.toolkitElements,e,this.isDevice)}c+=a+20}return this.toolkitElements.setAttribute("opacity",this.isDevice?"1":""+this.zoomkitOpacity),this.toolkitElements.setAttribute("cursor","auto"),e.enableCanvas?((d=document.createElement("div")).id=e.element.id+"_zoom",d.style.cssText="position:absolute; z-index:1",m=e.availableSize.height/2,(m=e.svgRenderer.createSvg({id:e.element.id+"_zoomkit_svg",width:e.availableSize.width,height:m})).style.position="absolute",m.appendChild(this.toolkitElements),d.appendChild(m),document.getElementById(this.elementId+"_Secondary_Element").appendChild(d)):e.svgObject.appendChild(this.toolkitElements),this.isDevice||(E.add(this.toolkitElements,"mousemove touchstart",this.zoomToolkitMove,this),E.add(this.toolkitElements,"mouseleave touchend",this.zoomToolkitLeave,this),this.isPanning&&f&&u.pan()),!0},VAe.prototype.applyZoomToolkit=function(e,t){t=this.isAxisZoomed(t);t?(this.showZoomingToolkit(e),this.isZoomed=!0):e.zoomSettings.showToolbar?(this.isZoomed=t,this.showZoomingToolkit(e)):(this.toolkit.removeTooltip(),this.isPanning=!1,this.isZoomed=!1,e.isZoomed=!1,e.svgObject.setAttribute("cursor","auto"))},VAe.prototype.zoomCancel=function(e,t){for(var i=0,n=t;i<n.length;i++)for(var o=n[i],r=0,s=e;r<s.length;r++){var a=s[r];if(a.name===o.axis.name){a.zoomFactor=o.previousZoomFactor,a.zoomPosition=o.previousZoomPosition,a.visibleRange=o.previousVisibleRange;break}}},VAe.prototype.isAxisZoomed=function(e){for(var t=!1,i=0,n=e;i<n.length;i++)var o=n[i],t=t||1!==o.zoomFactor||0!==o.zoomPosition;return t},VAe.prototype.zoomToolkitMove=function(){var e=this.toolkitElements;return this.zoomkitOpacity=1,e.setAttribute("opacity",""+this.zoomkitOpacity),!1},VAe.prototype.zoomToolkitLeave=function(){var e=this.toolkitElements;return this.zoomkitOpacity=1,e.setAttribute("opacity",""+this.zoomkitOpacity),!1},VAe.prototype.addEventListener=function(){this.chart.isDestroyed||(E.add(this.chart.element,this.wheelEvent,this.chartMouseWheel,this),this.chart.on(F.touchMoveEvent,this.mouseMoveHandler,this),this.chart.on(F.touchStartEvent,this.mouseDownHandler,this),this.chart.on(F.touchEndEvent,this.mouseUpHandler,this),this.chart.on(this.cancelEvent,this.mouseCancelHandler,this))},VAe.prototype.removeEventListener=function(){E.remove(this.chart.element,this.wheelEvent,this.chartMouseWheel),this.chart.isDestroyed||(this.chart.off(F.touchMoveEvent,this.mouseMoveHandler),this.chart.off(F.touchStartEvent,this.mouseDownHandler),this.chart.off(F.touchEndEvent,this.mouseUpHandler),this.chart.off(this.cancelEvent,this.mouseCancelHandler))},VAe.prototype.chartMouseWheel=function(e){var t=this.chart,i=t.element.getBoundingClientRect(),n=ie(t.svgId).getBoundingClientRect(),o=e.clientX-i.left-Math.max(n.left-i.left,0),n=e.clientY-i.top-Math.max(n.top-i.top,0);return this.zooming.enableMouseWheelZooming&&o0e(o,n,t.chartAxisLayoutPanel.seriesClipRect)&&(e.preventDefault(),this.performMouseWheelZooming(e,o,n,t,t.axisCollections)),!1},VAe.prototype.mouseMoveHandler=function(e){var t=this.chart,i=null;"touchmove"===e.type&&(e.preventDefault&&this.isIOS&&(this.isPanning||t.isDoubleTap||this.zooming.enablePinchZooming&&1<this.touchStartList.length)&&e.preventDefault(),i=e.touches),t.isChartDrag&&(t.isTouch&&(this.touchMoveList=this.addTouchPointer(this.touchMoveList,e,i),this.zooming.enablePinchZooming)&&1<this.touchMoveList.length&&1<this.touchStartList.length&&this.performPinchZooming(e,t),this.renderZooming(e,t,t.isTouch))},VAe.prototype.mouseDownHandler=function(e){var t=this.chart,i=null,n=("touchstart"===e.type&&(i=e.touches),e.target);-1===n.id.indexOf(t.element.id+"_Zooming_")&&(t.zoomSettings.enablePinchZooming||t.zoomSettings.enableSelectionZooming||this.chart.zoomModule.isPanning)&&o0e(t.previousMouseMoveX,t.previousMouseMoveY,t.chartAxisLayoutPanel.seriesClipRect)&&(t.isChartDrag=!0),t.isTouch&&(this.touchStartList=this.addTouchPointer(this.touchStartList,e,i))},VAe.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&&o0e(t.mouseX,t.mouseY,t.chartAxisLayoutPanel.seriesClipRect)&&1===this.touchStartList.length&&this.isZoomed&&this.toolkit.reset(e),this.touchStartList=[],t.isDoubleTap=!1)},VAe.prototype.mouseCancelHandler=function(){this.isZoomed&&this.performZoomRedraw(this.chart),this.pinchTarget=null,this.touchStartList=[],this.touchMoveList=[]},VAe.prototype.addTouchPointer=function(e,t,i){if(i){e=[];for(var n=0,o=i.length;n<o;n++)e.push({pageX:i[n].clientX,pageY:i[n].clientY,pointerId:null})}else if(0===(e=e||[]).length)e.push({pageX:t.clientX,pageY:t.clientY,pointerId:t.pointerId});else for(var n=0,r=e.length;n<r;n++)e[n].pointerId===t.pointerId?e[n]={pageX:t.clientX,pageY:t.clientY,pointerId:t.pointerId}:e.push({pageX:t.clientX,pageY:t.clientY,pointerId:t.pointerId});return e},VAe.prototype.getModuleName=function(){return"Zoom"},VAe.prototype.destroy=function(){this.removeEventListener()};var NAe=VAe;function VAe(e){this.zoomCompleteEvtCollection=[],this.startPanning=!1,this.chart=e,this.isPointer=F.isPointer,this.browserName=F.info.name,this.wheelEvent="mozilla"!==this.browserName||this.isPointer?"mousewheel":"DOMMouseScroll",this.cancelEvent=this.isPointer?"pointerleave":"mouseleave",this.addEventListener(),this.isDevice=F.isDevice;var t=e.zoomSettings;this.toolkit=new RAe(e),this.zooming=t,this.elementId=e.element.id,this.zoomingRect=new Do(0,0,0,0),this.zoomAxes=[],this.zoomkitOpacity=1,this.isIOS=F.isIos||F.isIos7,this.isZoomed=this.performedUI=this.zooming.enablePan||this.chart.primaryXAxis.zoomFactor<1&&0<this.chart.primaryXAxis.zoomPosition||this.chart.primaryYAxis.zoomFactor<1&&0<this.chart.primaryYAxis.zoomPosition||this.isAxisZoomed(this.chart.axes),t.enableScrollbar&&(e.scrollElement=Q("div",{id:e.element.id+"_scrollElement"}))}HAe.prototype.pointMouseDown=function(){var e=this.chart,t=new Wve(e),i=t.getData(),n=e.zoomSettings.enableSelectionZooming||e.zoomSettings.enablePinchZooming;!i.point||!t.insideRegion&&i.series.isRectSeries||(this.seriesIndex=i.series.index,this.pointIndex=i.point.index,e.series[this.seriesIndex].dragSettings.enable&&!n&&(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))},HAe.prototype.pointMouseMove=function(e){var t=this.chart,e=("touchmove"===e.type&&e.preventDefault&&e.preventDefault(),new Wve(t)),i=e.getData();i.series.dragSettings.enable&&i.point&&(e.insideRegion||!i.series.isRectSeries)?this.getCursorStyle(i):t.svgObject.style.cursor="null",t.isPointMouseDown&&(-1<(e=t.series[this.seriesIndex]).type.indexOf("Spline")&&t[l0e(e.type)+"SeriesModule"].findSplinePoint(e),this.pointDragging(this.seriesIndex,this.pointIndex))},HAe.prototype.getCursorStyle=function(e){var t=this.chart;-1<e.series.type.indexOf("Stacking")?t.svgObject.style.cursor="":("Bar"!==e.series.type||!t.isTransposed)&&(t.isTransposed||"Bar"===e.series.type)?t.svgObject.style.cursor="ew-resize":t.svgObject.style.cursor="ns-resize"},HAe.prototype.pointDragging=function(e,t){var i=this.chart,n=[],o=i.visibleSeries[e],r=o.dragSettings,s=o.xAxis,a=o.yAxis,l=o.isRectSeries?1:0,s=h0e(s,a,i.requireInvertedAxis),s="Bar"===o.type?(h=i.isTransposed?s.y+s.height-i.mouseY:i.mouseX-s.x,i.isTransposed?s.height:s.width):(h=i.isTransposed?i.mouseX-s.x:s.y+s.height-i.mouseY,i.isTransposed?s.width:s.height),h=a.isAxisInverse?1-h/s:h/s,s=(h=h*a.visibleRange.delta+a.visibleRange.min,null!==a.minimum?a.visibleRange.min+l:je(r.minY)?h:r.minY);if(h<=(null!==a.maximum?a.visibleRange.max+l:je(r.maxY)?h:r.maxY)&&s<=h){o.points[t].yValue=o.points[t].y=i.dragY="Logarithmic"===a.valueType?Math.pow(a.logBase,h):parseFloat(h.toFixed(2)),o.points[t].interior=r.fill;for(var d=0;d<o.points.length;d++)n[d]=o.points[d].yValue;o.yMin=Math.min.apply(null,n),o.yMax=Math.max.apply(null,n),this.isPointDragging=!0,i.refreshBound(),i.trigger("drag",{seriesIndex:e,pointIndex:t,series:o,point:o.points[t],oldValue:i.visibleSeries[this.seriesIndex].yData[this.pointIndex],newValue:o.points[t].yValue}),i.zoomRedraw=!1}},HAe.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)},HAe.prototype.getModuleName=function(){return"DataEditing"},HAe.prototype.destroy=function(){};var _Ae=HAe;function HAe(e){this.isPointDragging=!1,this.chart=e}zAe=function(e,t){return(zAe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}zAe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(QAe,jAe=IAe),QAe.prototype.wireEvents=function(){this.chart.isDestroyed||this.chart.stockChart&&this.chart.stockChart.onPanning||this.chart.on(F.touchMoveEvent,this.mouseMove,this)},QAe.prototype.unWireEvents=function(){this.chart.isDestroyed||this.chart.off(F.touchMoveEvent,this.mouseMove)},QAe.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},QAe.prototype.invokeHighlight=function(e){this.declarePrivateVariables(e),this.series=Pe({},e.visibleSeries,null,!0),this.seriesStyles(),this.currentMode=e.highlightMode},QAe.prototype.getModuleName=function(){return"Highlight"},QAe.prototype.destroy=function(){this.unWireEvents()};var zAe,jAe,WAe=QAe;function QAe(e){var t=jAe.call(this,e)||this;return t.chart=e,t.renderer=e.renderer,t.wireEvents(),t}qAe.prototype.initPrivateVariables=function(e,t){var i="",n="",o=e.chart.renderer,r=void 0===e.index?e.category:e.index;"Cartesian"===e.chart.chartAreaType&&(i="translate("+e.clipRect.x+","+e.clipRect.y+")",n="url(#"+this.chart.element.id+"_ChartSeriesClipRect_"+r+")"),t.dataLabel.visible&&!this.chart.enableCanvas&&(e.shapeElement=o.createGroup({id:this.chart.element.id+"ShapeGroup"+r,transform:i,"clip-path":"url(#"+this.chart.element.id+"_ChartSeriesClipRect_"+r+")"}),e.textElement=o.createGroup({id:this.chart.element.id+"TextGroup"+r,transform:i,"clip-path":n}),e.textElement.setAttribute("aria-hidden","true")),this.markerHeight="Scatter"===e.type||t.visible?t.height/2:0,this.commonId=this.chart.element.id+"_Series_"+r+"_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},qAe.prototype.calculateErrorHeight=function(e,t){if(!e.errorBar.visible)return null;var i,n,o;e.errorBar.visible&&"PolarRadar"!==this.chart.chartAreaType?(i=e.errorBar.direction,n=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?n:0)):("Top"!==t&&"Outer"!==t&&"Auto"!==t||("Both"!==i&&"Plus"!==i||e.chart.isTransposed?this.errorHeight=0:this.errorHeight=n),"Bottom"!==t&&"Auto"!==t||(this.errorHeight="Both"===i||"Minus"===i?o:0))):this.errorHeight=0},qAe.prototype.isRectSeries=function(e){return e.isRectSeries||"RangeArea"===e.type||"SplineRangeArea"===e.type||"RangeStepArea"===e.type},qAe.prototype.render=function(e,t,i){this.initPrivateVariables(e,e.marker),this.inverted=t.requireInvertedAxis,this.yAxisInversed=e.yAxis.isAxisInverse;var n=Q("div",{id:t.element.id+"_Series_"+(void 0===e.index?e.category:e.index)+"_DataLabelCollections"}),o=Dye(e);if(e.visible)for(var r=0;r<o.length;r++)this.renderDataLabel(e,o[r],n,i);n.childElementCount&&(t.enableCanvas?ie(t.element.id+"_Secondary_Element").appendChild(n):O0e(t.enableCanvas,ie(t.element.id+"_Secondary_Element"),n,t.redraw,!1,"x","y",null,"",!1,!1,null,t.duration))},qAe.prototype.renderDataLabel=function(e,t,i,n){if(!n.showZero&&(0===t.y||0===t.y&&"Zero"===e.emptyPointSettings.mode))return null;this.margin=n.margin;var o,r,s,a,l,h={x:0,y:0},d=e.clipRect,p=!1,c=[],u=(n.angle="Rotate90"===n.labelIntersectAction?90:n.angle,n.enableRotation="Rotate90"===n.labelIntersectAction||n.enableRotation,s=n.angle),g={width:n.border.width,color:n.border.color},m=Pe({},R("properties",n.font),null,!0);if(t.symbolLocations.length&&t.symbolLocations[0]||"BoxAndWhisker"===e.type&&t.regions.length)for(var f,y=(f=null!==t.text?_0e(t,e,this.chart):[]).length,v=0;v<y;v++){var b={cancel:!1,name:zme,series:e,point:t,text:f[v],border:g,color:n.fill,template:n.template,font:m,location:h,textSize:So(f[v],n.font,this.chart.themeStyle.datalabelFont)};if(this.chart.trigger(zme,b),!b.cancel)if(this.fontBackground=b.color,this.isDataLabelShape(b),this.markerHeight="Bubble"===e.type?t.regions[0].height/2:this.markerHeight,null!==b.template)this.createDataLabelTemplate(i,e,n,t,b,v,this.chart.redraw);else{var w,C,S,A=n.enableRotation?kye(n.font,b.text,n.angle,this.chart,this.chart.themeStyle.datalabelFont):So(b.text,n.font,this.chart.themeStyle.datalabelFont),x=this.calculateTextPosition(t,e,A,n,v),I=new Do(x.x+d.x,x.y+d.y,x.width,x.height);if(n.enableRotation){var T=this.getRectanglePoints(I),E=x.x+x.width/2,D=x.y+x.height/2;if(!(p="Rotate90"!==n.labelIntersectAction&&-90!==u&&this.isDataLabelOverlapWithChartBound(T,this.chart,{x:0,y:0,width:0,height:0}))){this.chart.rotatedDataLabelCollections.push(T);for(var M=this.chart.rotatedDataLabelCollections.length-1,k=M;0<=k;k--)if(this.chart.rotatedDataLabelCollections[M]&&this.chart.rotatedDataLabelCollections[k-1]&&Uye(this.chart.rotatedDataLabelCollections[M],this.chart.rotatedDataLabelCollections[k-1])){p=!0,this.chart.rotatedDataLabelCollections[M]=null;break}}}else p=z0e(x,this.chart.dataLabelCollections,d);p&&"None"!==n.labelIntersectAction?ie(this.commonId+t.index+"_Text_0")&&e.chart.redraw&&e.currentData&&ie(this.commonId+t.index+"_Text_0").remove():((T=ie(this.commonId+t.index+"_TextShape_"+v))&&(l={x:+T.getAttribute("x"),y:+T.getAttribute("y")}),this.chart.dataLabelCollections.push(I),this.isShape&&(a=this.chart.renderer.drawRectangle(new vve(this.commonId+t.index+"_TextShape_"+v,b.color,b.border,n.opacity,x,n.rx,n.ry,"",n.border.dashArray),new Int32Array([d.x,d.y])),e.shapeElement)&&O0e(this.chart.enableCanvas,e.shapeElement,a,this.chart.redraw,!0,"x","y",l),w=G0e(Y0e("transparent"===this.fontBackground?-1<this.chart.theme.indexOf("Dark")||-1<this.chart.theme.indexOf("HighContrast")?"black":"white":this.fontBackground)),w=Math.round((299*w.r+587*w.g+114*w.b)/1e3),C=x.x+this.margin.left+A.width/2+h.x,S=n.enableRotation&&"PolarRadar"!==this.chart.chartAreaType?x.y+this.margin.top+A.height/2+A.width/4+("Auto"===n.position?t.regions[0].width/10:0)+h.y:x.y+this.margin.top+3*A.height/4+h.y,h={x:0,y:0},0!==u&&n.enableRotation?(o=E,r=D,s=360<u?u-360:u<-360?u+360:u):(s=0,o=x.x,r=x.y,C-=!("Cartesian"===this.chart.chartAreaType&&C+A.width/2>d.width)||!this.chart.requireInvertedAxis&&C>d.width?0:C+A.width/2-d.width,S-=S+A.height>d.y+d.height&&!(-1<e.type.indexOf("Bar"))?S+A.height-(d.y+d.height):0),x="Rotate90"===n.labelIntersectAction?"Top"===n.position?"start":"Middle"===n.position?"middle":"end":-90===u&&n.enableRotation?"Top"===n.position?"end":"Middle"===n.position?"middle":"start":"middle",A=void 0,this.chart.redraw&&document.getElementById(this.commonId+t.index+"_Text_"+v)&&(A=document.getElementById(this.commonId+t.index+"_Text_"+v).textContent),c.push(sve(this.chart.renderer,new ko(this.commonId+(null!==e.removedPointIndex&&e.removedPointIndex<=t.index?t.index+1:t.index)+"_Text_"+v,C,S,x,b.text,"rotate("+s+","+o+","+r+")","auto",s),b.font,b.font.color||("Bootstrap5"===this.chart.theme?"#212529":"Bootstrap5Dark"===this.chart.theme?"#DEE2E6":128<=w||"Hilo"===e.type||"HiloOpenClose"===e.type?-1<this.chart.theme.indexOf("Tailwind3")?"#111827":"black":-1<this.chart.theme.indexOf("Tailwind3")?"#FFFFFF":"white"),e.textElement,!1,this.chart.redraw,!0,!1,e.chart.duration,e.clipRect,0,null,this.chart.enableCanvas,null,this.chart.themeStyle.datalabelFont,new Tve(o,r))),this.isShape&&n.enableRotation&&a.setAttribute("transform","rotate("+n.angle+", "+o+", "+r+")"),this.chart.stackLabels.visible&&-1<e.type.indexOf("Stacking")&&(this.dataLabelRectCollection=this.dataLabelRectCollection||{},this.dataLabelRectCollection[this.commonId+(null!==e.removedPointIndex&&e.removedPointIndex<=t.index?t.index+1:t.index)+"_Text_"+v]=I,this.dataLabelRectCollection[this.commonId+t.index+"_TextShape_"+v]=I),null!==e.removedPointIndex&&e.removedPointIndex<=t.index&&(e.textElement.lastChild.id=this.commonId+t.index+"_Text_"+v),this.chart.redraw&&A!==b.text&&rve(e.textElement.querySelector("#"+this.commonId+t.index+"_Text_"+v),this.chart.duration,parseFloat(A),parseFloat(b.text),e.marker.dataLabel.format||e.yAxis.labelFormat))}}return c},qAe.prototype.renderStackLabels=function(){var m=this,f=this.chart.renderer.createGroup({id:this.chart.element.id+"_StackLabelGroup"}),y=(this.chart.seriesElements.appendChild(f),{}),v={};if(this.chart.visibleSeries&&0<this.chart.visibleSeries.length)for(var e=this.chart.visibleSeries.length-1;0<=e;e--){var t=this.chart.visibleSeries[e];if(t.animation.enable&&this.chart.animateSeries&&f.setAttribute("visibility","hidden"),t.visible&&t.points&&0<t.points.length)for(var i=0;i<t.points.length;i++){var n=t.points[i],o=String(n.x);!y[o]&&0<t.stackedValues.endValues[i]&&n.visible&&(y[o]=n),!v[o]&&t.stackedValues.endValues[i]<0&&n.visible&&(v[o]=n)}}var b=0;[y,v].forEach(function(p,c){var u,g;p&&(u=0,Object.keys(p).forEach(function(e){var t=p[e].series.stackedValues.endValues[p[e].index],i=v[e]?v[e].series.stackedValues.endValues[v[e].index]:0;if(0===c?(u=t+i,g=p[e]):y[e]||(u=t,g=p[e]),g&&g.symbolLocations[0]){var n,o,i=g.series,t=g.symbolLocations[0],e=m.chart.stackLabels.format,r=u%1==0?u.toFixed(0):"0"===u.toFixed(2).slice(-1)?u.toFixed(1):u.toFixed(2),e=So(r=e?null!==e.match("{value}")?e.replace("{value}",r.toString()):m.chart.intl.getNumberFormat({format:e,useGrouping:m.chart.useGroupingSeparator})(u):r,m.chart.stackLabels.font,m.chart.themeStyle.datalabelFont),s=G0e(Y0e("transparent"===m.chart.stackLabels.fill&&"transparent"===m.chartBackground?-1<m.chart.theme.indexOf("Dark")||-1<m.chart.theme.indexOf("HighContrast")?"black":"white":"transparent"!==m.chart.stackLabels.fill?m.chart.stackLabels.fill:m.chartBackground)),s=Math.round((299*s.r+587*s.g+114*s.b)/1e3),a=e.width+m.chart.stackLabels.border.width+m.chart.stackLabels.margin.left+m.chart.stackLabels.margin.right-5,l=m.chart.requireInvertedAxis?5:m.chart.primaryYAxis.isInversed?0===c?e.height+5:-10:0===c?-10:e.height+5,h=m.chart.requireInvertedAxis?m.chart.primaryYAxis.isInversed?0===c?-(10+e.width/2):10+e.width/2:0===c?10+e.width/2:-(10+e.width/2):0,a=(h+="Far"===m.chart.stackLabels.font.textAlignment?a:"Near"===m.chart.stackLabels.font.textAlignment?-a:0,Math.max(i.clipRect.x+e.width,Math.min(h+i.clipRect.x+t.x,i.clipRect.x+i.clipRect.width-e.width))),h=Math.max(i.clipRect.y+e.height,Math.min(l+i.clipRect.y+t.y-(0<m.chart.stackLabels.angle&&!m.chart.requireInvertedAxis?e.width/2:0),i.clipRect.y+i.clipRect.height-e.height)),d=new Do(a-e.width/2-m.chart.stackLabels.margin.left,h-e.height-m.chart.stackLabels.margin.top,e.width+(m.chart.stackLabels.margin.left+m.chart.stackLabels.margin.right),e.height+5+(m.chart.stackLabels.margin.top+m.chart.stackLabels.margin.bottom)),l=m.chart.renderer.drawRectangle(new vve(m.chart.element.id+"StackLabel_TextShape_"+b,m.chart.stackLabels.fill,m.chart.stackLabels.border,null,d,m.chart.stackLabels.rx,m.chart.stackLabels.ry,"",null),new Int32Array([t.x,t.y]));for(n in l.setAttribute("transform","rotate("+m.chart.stackLabels.angle+", "+a+", "+h+")"),f.appendChild(l),sve(m.chart.renderer,new ko(m.chart.element.id+"_StackLabel_"+b,a,h,"middle",r,"rotate("+m.chart.stackLabels.angle+", "+a+", "+h+")","auto",m.chart.stackLabels.angle),m.chart.stackLabels.font,m.chart.stackLabels.font.color||("Bootstrap5"===m.chart.theme?"#212529":"Bootstrap5Dark"===m.chart.theme?"#DEE2E6":128<=s?-1<m.chart.theme.indexOf("Tailwind3")?"#111827":"black":-1<m.chart.theme.indexOf("Tailwind3")?"#FFFFFF":"white"),f,null,m.chart.redraw,!0,null,m.chart.duration,i.clipRect,0,null,m.chart.enableCanvas,null,m.chart.themeStyle.datalabelFont,null),"StackingLine"!==i.type&&"StackingArea"!==i.type||document.querySelectorAll('[id^="'+m.chart.element.id+"_Series_"+i.index+"_Point_"+g.index+'_Text_"], \n                                [id^="'+m.chart.element.id+"_Series_"+i.index+"_Point_"+g.index+'_TextShape_"]').forEach(function(e){e.id&&(e.style.visibility="hidden",e.setAttribute("data-collide","true"))}),m.dataLabelRectCollection)Object.prototype.hasOwnProperty.call(m.dataLabelRectCollection,n)&&(o=m.dataLabelRectCollection[n])&&z0e(d,[o],{x:0,y:0,height:0,width:0})&&(o=document.getElementById(n))&&(o.style.visibility="hidden",o.setAttribute("data-collide","true"))}b++}))})},qAe.prototype.getRectanglePoints=function(e){return[new Tve(e.x,e.y),new Tve(e.x+e.width,e.y),new Tve(e.x+e.width,e.y+e.height),new Tve(e.x,e.y+e.height)]},qAe.prototype.isDataLabelOverlapWithChartBound=function(e,t,i){for(var n=0;n<e.length;n++)if(!o0e(e[n].x+i.x,e[n].y+i.y,t.initialClipRect))return!0;return!1},qAe.prototype.createDataLabelTemplate=function(e,t,i,n,o,r,s){this.margin={left:0,right:0,bottom:0,top:0};var a=t.clipRect,o=k0e(Q("div",{id:this.chart.element.id+"_Series_"+(void 0===t.index?t.category:t.index)+"_DataLabel_"+n.index+(r?"_"+r:""),styles:"position: absolute;background-color:"+o.color+";"+P0e(i.font,this.chart.themeStyle.datalabelFont)+";border:"+o.border.width+"px solid "+o.border.color+";"}),n.index,this.chart.enableHtmlSanitizer?this.chart.sanitize(o.template):o.template,this.chart,n,t,this.chart.element.id+"_DataLabel",r);this.calculateTemplateLabelSize(e,o,n,t,i,r,a,s)},qAe.prototype.calculateTemplateLabelSize=function(e,t,i,n,o,r,s,a,l){var h=B0e(t,a,l),r=this.calculateTextPosition(i,n,{width:h.width,height:h.height},o,r),d=!1,l=(l&&(d=0===h.width||0===h.height),t.style.left=+(("PolarRadar"===this.chart.chartAreaType?0:n.clipRect.x)+r.x)+"px",t.style.top=("PolarRadar"===this.chart.chartAreaType?0:n.clipRect.y)+r.y+0+"px",n.chart.requireInvertedAxis?n.xAxis:n.yAxis),h=n.chart.requireInvertedAxis?n.yAxis:n.xAxis;t.childElementCount&&!d&&(!z0e(r,this.chart.dataLabelCollections,s)||"None"===o.labelIntersectAction)&&("XY"!==n.seriesType||void 0===i.yValue||Rye(i.yValue,n.yAxis.visibleRange)||-1<n.type.indexOf("Stacking")||-1<n.type.indexOf("100")&&Rye(n.stackedValues.endValues[i.index],n.yAxis.visibleRange))&&Rye(i.xValue,n.xAxis.visibleRange)&&parseFloat(t.style.top)>=l.rect.y&&parseFloat(t.style.left)>=h.rect.x&&parseFloat(t.style.top)<=l.rect.y+l.rect.height&&parseFloat(t.style.left)<=h.rect.x+h.rect.width&&(this.chart.dataLabelCollections.push(new Do(r.x+s.x,r.y+s.y,r.width,r.height)),O0e(this.chart.enableCanvas,e,t,a,!0,"left","top"),n.animation.enable&&this.chart.animateSeries&&!this.chart.enableCanvas?this.doDataLabelAnimation(n,t):this.chart.enableCanvas&&e.appendChild(t))},qAe.prototype.calculateTextPosition=function(e,t,i,n,o){var r,s,a,l=1<o&&"Candle"===t.type?e.regions[1]:e.regions[0],h=(1<o&&"HiloOpenClose"===t.type&&(l=2===o?e.regions[1]:e.regions[2]),r=this.getLabelLocation(e,t,i,o),t.clipRect),e=(this.chart.requireInvertedAxis&&this.isRectSeries(t)&&"BoxAndWhisker"!==t.type?(this.locationY=r.y,s=i.width+this.borderWidth+this.margin.left+this.margin.right-5,r.x="Auto"===n.position?r.x:this.calculateAlignment(s,r.x,n.alignment,e.yValue<0),r.x=this.calculateRectPosition(r.x,l,e.yValue<0!==this.yAxisInversed,n.position,t,i,o,e)):(this.locationX=r.x,s=i.height+2*this.borderWidth+this.markerHeight+this.margin.bottom+this.margin.top+5,r.x="Auto"===n.position?r.x:this.calculateAlignment(s,r.x,n.alignment,!!this.isRectSeries(t)&&e.yValue<0),r.y=this.isRectSeries(t)&&"BoxAndWhisker"!==t.type?this.calculateRectPosition(r.y,l,e.yValue<0!==this.yAxisInversed,n.position,t,i,o,e):this.calculatePathPosition(r.y,n.position,t,e,i,o),this.isRectSeries(t)&&"PolarRadar"===this.chart.chartAreaType&&(r=this.calculatePolarRectPosition(r,n.position,t,e,i,o,n.alignment,s))),Q0e(r,i,this.margin));return!0===n.enableRotation&&0!==n.angle||e.y>h.y+h.height||e.x>h.x+h.width||e.x+e.width<0||e.y+e.height<0||(e.x=e.x<0?"StackingColumn"!==t.type||this.inverted?5:0:e.x,e.y=e.y<0&&!this.chart.requireInvertedAxis&&"None"!==n.labelIntersectAction?5:e.y,e.x-=e.x+e.width>h.x+h.width?e.x+e.width-(h.x+h.width)+5:0,e.y-=e.y+e.height>h.y+h.height?e.y+e.height-(h.y+h.height)+5:0,this.fontBackground="transparent"===this.fontBackground?this.chartBackground:this.fontBackground),this.inverted&&t.isRectSeries&&e.x+e.width>l.x+l.width&&(a=!0),this.fontBackground=a?this.chartBackground:this.fontBackground,e},qAe.prototype.calculatePolarRectPosition=function(e,t,i,n,o,r,s,a){var l=this.chart.availableSize.width,s="Center"===s?0:"Far"===s?1:-1,h=n.regionData.startAngle-.5*Math.PI+(n.regionData.endAngle-n.regionData.startAngle)/2,d=0===r?n.regionData.radius<n.regionData.innerRadius?n.regionData.innerRadius:n.regionData.radius:n.regionData.radius>n.regionData.innerRadius?n.regionData.innerRadius:n.regionData.radius;return this.fontBackground="transparent"===this.fontBackground?this.chartBackground:this.fontBackground,-1<i.drawType.indexOf("Stacking")?t="Outer"===t?"Top":t:-1<i.drawType.indexOf("Range")&&(t="Outer"===t||"Top"===t?t:"Auto"),"Outer"===t?d=0===r?d+10+this.markerHeight:d-10-this.markerHeight:"Middle"===t?(d=d/2+5,"StackingColumn"===i.drawType&&(d=n.regionData.innerRadius+(n.regionData.radius-n.regionData.innerRadius)/2+5-o.height/2)):"Top"===t?d=0===r?d-10-this.markerHeight:d+10+this.markerHeight:"Bottom"===t?(d=10,d+="StackingColumn"===i.drawType?n.regionData.innerRadius+this.markerHeight:0):d=0===r?d>=i.chart.radius?d-5:"StackingColumn"===i.drawType?d-10:d+10:d>=i.chart.radius?d+5:d-10,e.x=i.clipRect.width/2+i.clipRect.x+(d+=a*s)*Math.cos(h),"StackingColumn"===i.drawType?e.x=e.x<l/2?e.x+o.width/2:e.x>l/2?e.x-o.width/2:e.x:"Column"===i.drawType&&(e.x=e.x<l/2?e.x-o.width/2:e.x>l/2?e.x+o.width/2:e.x),e.y=i.clipRect.height/2+i.clipRect.y+d*Math.sin(h),e},qAe.prototype.getLabelLocation=function(e,t,i,n){var o,r=new Tve(0,0),s="Candle"===t.type&&1<n?e.regions[1]:e.regions[0],a=("HiloOpenClose"===t.type&&(s=2===n?e.regions[1]:e.regions[2]),t.xAxis),l=t.yAxis,h=t.chart.requireInvertedAxis;if("BoxAndWhisker"===t.type){switch(n){case this.markerHeight=0:r=L0e(e.xValue,e.median,a,l,h);break;case 1:r=L0e(e.xValue,e.maximum,a,l,h);break;case 2:r=L0e(e.xValue,e.minimum,a,l,h);break;case 3:r=L0e(e.xValue,e.upperQuartile,a,l,h);break;case 4:r=L0e(e.xValue,e.lowerQuartile,a,l,h);break;default:r=L0e(e.xValue,e.outliers[n-5],a,l,h),this.markerHeight=t.marker.height/2}h?r.y=e.regions[0].y+e.regions[0].height/2:r.x=e.regions[0].x+e.regions[0].width/2}else r=h&&-1<t.type.indexOf("Stacking")&&0===e.yValue?{x:s.x+s.width,y:s.y+s.height/2}:0===n||1===n?new Tve(e.symbolLocations[0].x,e.symbolLocations[0].y):2!==n&&3!==n||"Candle"!==t.type?h?{x:s.x+s.width/2,y:s.y}:{x:s.x+s.width,y:s.y+s.height/2}:new Tve(e.symbolLocations[1].x,e.symbolLocations[1].y);return 1<n&&"HiloOpenClose"===t.type&&(t.chart.requireInvertedAxis?(o=s.height,r.y=s.y+o/2+2*(2===n?1:-1)):(o=s.width,r.x=s.x+o/2+2*(2===n?1:-1))),r},qAe.prototype.calculateRectPosition=function(e,t,i,n,o,r,s,a){if("PolarRadar"===o.chart.chartAreaType)return null;var l=this.margin,h=o.marker.dataLabel.enableRotation||this.inverted?r.width:r.height;switch("Bottom"===n&&"StackingColumn"===o.type&&!this.inverted&&t.height<r.height?this.extraSpace=this.borderWidth+(Math.abs(t.height-r.height/2)<5?0:5):this.extraSpace=this.borderWidth+h/2+("Outer"!==n&&-1<o.type.indexOf("Column")&&Math.abs(t.height-r.height)<5?0:5),"StackingColumn100"===o.type||"StackingBar100"===o.type?n="Outer"===n?"Top":n:-1<o.type.indexOf("Range")?n="Outer"===n||"Top"===n?n:"Auto":"Waterfall"===o.type&&(n="Auto"===n?"Middle":n),n){case"Bottom":e=this.inverted?i?e+("Waterfall"===o.type?+this.extraSpace+l.left+this.markerHeight:+t.width-this.extraSpace-l.left):e-t.width+this.extraSpace+l.right:i?e+("Waterfall"===o.type?-this.extraSpace-l.top-this.markerHeight:-t.height+this.extraSpace+l.top):e+t.height-this.extraSpace-l.bottom;break;case"Middle":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,r,s,a);break;default:this.extraSpace+=this.errorHeight,e=this.calculateTopAndOuterPosition(e,t,n,o,s,this.extraSpace,i,a)}var h=this.inverted?e<t.x||e>t.x+t.width:e<t.y||e>t.y+t.height,d=(this.fontBackground=h?"transparent"===this.fontBackground?this.chartBackground:this.fontBackground:"transparent"===this.fontBackground?a.color||o.interior:this.fontBackground,o.chart.series.length);if("Outer"===n&&-1<o.type.indexOf("Stacking")&&d-1>o.index)for(var p,c=void 0,u=o.index+1;u<d;u++)if(p=(c=o.chart.series[u]).points[a.index],-1<c.type.indexOf("Stacking")&&-1===c.type.indexOf("100")){this.fontBackground=p&&(p.yValue<0&&a.yValue<0||0<p.yValue&&0<a.yValue)?p?p.color:c.interior:this.fontBackground;break}return e},qAe.prototype.calculatePathPosition=function(e,t,i,n,o,r){switch(-1<i.type.indexOf("Area")&&"RangeArea"!==i.type&&"SplineRangeArea"!==i.type&&"RangeStepArea"!==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,n,o,r)}return e},qAe.prototype.isDataLabelShape=function(e){this.isShape="transparent"!==e.color||0<e.border.width,this.borderWidth=e.border.width,this.isShape||(this.margin={left:0,right:0,bottom:0,top:0})},qAe.prototype.calculateRectActualPosition=function(e,t,i,n,o,r,s){for(var a,l,h=!0,d=0,p=this.chart.dataLabelCollections,c=-1!==n.type.indexOf("Range")||"Hilo"===n.type?2:4;h&&d<c;){var u=this.getPosition(d);this.fontBackground=n.marker.dataLabel.fill,-1<n.type.indexOf("Stacking")&&"Outer"===u&&(u="Top",d++),a=this.calculateRectPosition(e,t,i,u,n,o,r,s),this.inverted?h=(l=Q0e(new Tve(a,this.locationY),o,this.margin)).x<0||z0e(l,p,n.clipRect)||l.x+l.width>n.clipRect.width:(n.marker.dataLabel.enableRotation&&(o.width=o.width-s.regions[0].width/10),h=(l=Q0e(new Tve(this.locationX,a),o,this.margin)).y<0||z0e(l,p,n.clipRect)||l.y>n.clipRect.height,null===n.marker.dataLabel.template&&!0!==h&&(h=l.y/2+o.height+("Outer"===u?s.regions[0].height+this.extraSpace:s.regions[0].height-2*this.extraSpace)>n.clipRect.height)),d++}return a},qAe.prototype.calculateAlignment=function(e,t,i,n){switch(i){case"Far":t=this.inverted?n?t-e:t+e:n?t+e:t-e;break;case"Near":t=this.inverted?n?t+e:t-e:n?t-e:t+e}return t},qAe.prototype.calculateTopAndOuterPosition=function(e,t,i,n,o,r,s,a){var l,h=this.margin;switch(n.type){case"RangeColumn":case"RangeArea":case"RangeStepArea":case"SplineRangeArea":case"Hilo":l=0===o&&!this.yAxisInversed||1===o&&this.yAxisInversed,e=this.updateLabelLocation(i,e,r,h,t,l);break;case"Candle":l=(0===o||2===o)&&!this.yAxisInversed||(1===o||3===o)&&this.yAxisInversed,e=this.updateLabelLocation(i,e,r,h,t,l,1<o);break;case"HiloOpenClose":e=o<=1?(l=0===o&&!this.yAxisInversed||1===o&&this.yAxisInversed,this.updateLabelLocation(i,e,r,h,t,l)):this.yAxisInversed?this.inverted?e-r-h.right:e+r+h.top:this.inverted?e+r+h.left:e-r-h.bottom;break;default:e=s&&"Top"===i||!s&&"Outer"===i||"Top"===i&&0===n.visiblePoints[a.index].yValue?this.inverted?e+(s&&"Waterfall"===n.type?+t.width-r-h.left:+r+h.left+this.markerHeight):e+(s&&"Waterfall"===n.type?-t.height+r+h.bottom:-r-h.bottom-this.markerHeight):this.inverted?e+(s&&"Waterfall"===n.type?+t.width+r+h.top:-r-h.right-this.markerHeight):e+(s&&"Waterfall"===n.type?-t.height-r-h.top:+r+h.top+this.markerHeight)}return e},qAe.prototype.updateLabelLocation=function(e,t,i,n,o,r,s){return void 0===s&&(s=!1),t=this.inverted?r?"Outer"!==e||s?t-i-n.right-this.markerHeight:t+i+n.left+this.markerHeight:"Outer"!==e||s?t-o.width+i+n.left+this.markerHeight:t-o.width-i-n.right-this.markerHeight:r?"Outer"!==e||s?t+i+n.top+this.markerHeight:t-i-n.bottom-this.markerHeight:"Outer"!==e||s?t+o.height-i-n.bottom-this.markerHeight:t+o.height+i+n.top+this.markerHeight},qAe.prototype.calculatePathActualPosition=function(e,t,i,n,o,r){var s,a,l,h,d,p=i.points,c=n.index,u=p[c].yValue,g=p.length-1>c?p[c+1]:null,m=0<c?p[c-1]:null,f=!0,y=this.chart.dataLabelCollections;for("Bubble"===i.type?d="Top":-1<i.type.indexOf("Step")?(d="Top",c&&(d=m&&m.visible&&u>m.yValue===this.yAxisInversed&&u!==m.yValue?"Bottom":"Top")):"BoxAndWhisker"===i.type?1===r||3===r||4<r?d=i.yAxis.isAxisInverse?"Bottom":"Top":2===r||4===r?d=i.yAxis.isAxisInverse?"Top":"Bottom":(f=!1,s=this.calculatePathPosition(e,d="Middle",i,n,o,r)):d=0===c?!g||!g.visible||u>g.yValue||u<g.yValue&&this.yAxisInversed?"Top":"Bottom":c===p.length-1?!m||!m.visible||u>m.yValue||u<m.yValue&&this.yAxisInversed?"Top":"Bottom":g.visible||m&&m.visible?g.visible&&m?(p=(p=(g.yValue-m.yValue)/2)*c+(g.yValue-p*(c+1)),this.yAxisInversed?p<u?"Bottom":"Top":p<u?"Top":"Bottom"):g.yValue>u||m&&m.yValue>u?"Bottom":"Top":"Top",l="Bottom"===d,h=["Outer","Top","Bottom","Middle","Auto"].indexOf(d);f&&h<4;)s=this.calculatePathPosition(e,this.getPosition(h),i,n,o,r),f=(a=Q0e(new Tve(this.locationX,s),o,this.margin)).y<0||z0e(a,y,i.clipRect)||a.y+a.height>i.clipRect.height,h=l?h-1:h+1,l=!1;return s},qAe.prototype.doDataLabelAnimation=function(e,t){for(var i,n=e.shapeElement.childNodes,o=e.textElement.childNodes,r=e.animation.delay+e.animation.duration,s=e.chart.animated?e.chart.duration:200,a=t?1:o.length,l=0;l<a;l++)i=o[l],t?(t.style.visibility="hidden",S0e(t,r,s,"ZoomIn")):(new Tve(+i.getAttribute("x")+ +i.getAttribute("width")/2,+i.getAttribute("y")+ +i.getAttribute("height")/2),u0e(i,r,e.animation.duration,e,null,0,!0),n[l]&&(i=n[l],new Tve(+i.getAttribute("x")+ +i.getAttribute("width")/2,+i.getAttribute("y")+ +i.getAttribute("height")/2),u0e(i,r,e.animation.duration,e,null,0,!0)))},qAe.prototype.getPosition=function(e){return["Outer","Top","Bottom","Middle","Auto"][e]},qAe.prototype.getModuleName=function(){return"DataLabel"},qAe.prototype.destroy=function(){};var UAe=qAe;function qAe(e){this.errorHeight=0,this.dataLabelRectCollection={},this.chart=e}YAe.prototype.render=function(e){if("PolarRadar"===this.chart.chartAreaType)return null;this.createElement(e,this.chart),this.renderErrorBar(e)},YAe.prototype.renderErrorBar=function(e){for(var t=e.index,i=e.errorBar,n=e.errorBar.errorBarCap,o=e.chart.redraw,r=0,s=e.points;r<s.length;r++){var a=s[r];if(a.visible&&a.symbolLocations[0]){var l=0,h=0;switch(i.mode){case"Vertical":h=a.verticalError;break;case"Horizontal":l=a.horizontalError;break;case"Both":l=a.horizontalError,h=a.verticalError}var d=this["calculate"+i.type+"Value"](a,e,this.chart.requireInvertedAxis,l,h),p=this.chart.element.id+"_Series__ErrorBarGroup_"+t+"_Point_"+a.index,c=this.chart.element.id+"_Series__ErrorBarCap_"+t+"_Point_"+a.index,p=new No(p,"",i.width,i.errorBarColorMapping?a.errorBarColor:i.color||this.chart.themeStyle.errorBar,null,"",d[0]),u=ie(p.id),g=u?u.getAttribute("d"):null,p=(e.errorBarElement&&e.errorBarElement.appendChild(this.chart.renderer.drawPath(p)),m0e(u,d[0],o,g,this.chart.duration),new No(c,"",n.width,i.errorBarCap.color?n.color:i.errorBarColorMapping?a.errorBarColor:i.color||this.chart.themeStyle.errorBar,null,"",d[1])),g=(u=ie(p.id))?u.getAttribute("d"):null;e.errorBarElement&&O0e(this.chart.enableCanvas,e.errorBarElement,this.chart.renderer.drawPath(p),o),m0e(u,d[1],o,g,this.chart.duration)}}},YAe.prototype.findLocation=function(e,t,i,n,o){var r=t.errorBar,s=r.direction,a=[],l=-1<t.type.indexOf("Stacking")?t.stackedValues.endValues[e.index]:"HighLow"===t.seriesType||"HighLowOpenClose"===t.seriesType?t.points[e.index].high:e.yValue,h=L0e(e.xValue+("Plus"===s||"Both"===s?"Custom"!==r.type||"Horizontal"!==r.mode&&"Both"!==r.mode?n:n=e.horizontalPositiveError:0),l+("Plus"===s||"Both"===s?"Custom"!==r.type||"Vertical"!==r.mode&&"Both"!==r.mode?o:o=e.verticalPositiveError:0),t.xAxis,t.yAxis,i),h=(a.push(h),h=t.isRectSeries?e.symbolLocations[0]:L0e(e.xValue,e.yValue,t.xAxis,t.yAxis,i),a.push(h),L0e(e.xValue-("Minus"===s||"Both"===s?"Custom"!==r.type||"Horizontal"!==r.mode&&"Both"!==r.mode?n:n=e.horizontalNegativeError:0),l-("Minus"===s||"Both"===s?"Custom"!==r.type||"Vertical"!==r.mode&&"Both"!==r.mode?o:o=e.verticalNegativeError:0),t.xAxis,t.yAxis,i));return a.push(h),e.error="Vertical"===r.mode?r.verticalError:r.horizontalError,this.negativeHeight="Vertical"===r.mode||"Both"===r.mode?i?a[1].x-a[2].x:a[2].y-a[1].y:0,this.positiveHeight="Vertical"===r.mode||"Both"===r.mode?i?a[0].x-a[1].x:a[1].y-a[0].y:0,this.getErrorDirection(a[0],a[1],a[2],t,i)},YAe.prototype.calculateFixedValue=function(e,t,i,n,o){return this.findLocation(e,t,i,n,o)},YAe.prototype.calculatePercentageValue=function(e,t,i,n,o){return n=n/100*e.xValue,o=o/100*e.yValue,this.findLocation(e,t,i,n,o)},YAe.prototype.calculateStandardDeviationValue=function(e,t,i,n,o){var r=this.meanCalculation(t,t.errorBar.mode);return n*=r.horizontalSquareRoot+r.horizontalMean,o*=r.verticalSquareRoot+r.verticalMean,this.findLocation(e,t,i,n,o)},YAe.prototype.calculateStandardErrorValue=function(e,t,i,n,o){var r=t.points.length,s=this.meanCalculation(t,t.errorBar.mode);return n=n*s.horizontalSquareRoot/Math.sqrt(r),o=o*s.verticalSquareRoot/Math.sqrt(r),this.findLocation(e,t,i,n,o)},YAe.prototype.calculateCustomValue=function(e,t,i,n,o){return this.findLocation(e,t,i,n,o)},YAe.prototype.getHorizontalDirection=function(e,t,i,n,o,r){var s="",a="";return[s+="M "+e.x+" "+t.y+" L "+i.x+" "+t.y,(a+="Plus"===n||"Both"===n?"M "+e.x+" "+(t.y-r)+" L "+e.x+" "+(t.y+r):"")+("Minus"===n||"Both"===n?"M "+i.x+" "+(t.y-r)+" L "+i.x+" "+(t.y+r):" ")]},YAe.prototype.getVerticalDirection=function(e,t,i,n,o,r){var s="",a="";return[s+="M "+t.x+" "+e.y+" L "+t.x+" "+i.y,(a+="Plus"===n||"Both"===n?"M "+(t.x-r)+" "+e.y+" L "+(t.x+r)+" "+e.y:"")+("Minus"===n||"Both"===n?"M "+(t.x-r)+" "+i.y+" L "+(t.x+r)+" "+i.y:"")]},YAe.prototype.getBothDirection=function(e,t,i,n,o,r){var s=this.getHorizontalDirection(e,t,i,n,o,r),e=this.getVerticalDirection(e,t,i,n,o,r);return[s[0].concat(e[0]),s[1].concat(e[1])]},YAe.prototype.getErrorDirection=function(e,t,i,n,o){var r,s=n.errorBar.direction,a=n.errorBar.mode,l=n.errorBar.errorBarCap.length,h=a;switch(a){case"Both":h=a;break;case"Horizontal":h=o?"Vertical":a;break;case"Vertical":h=o?"Horizontal":a}switch(h){case"Horizontal":r=this.getHorizontalDirection(e,t,i,s,h,l);break;case"Vertical":r=this.getVerticalDirection(e,t,i,s,h,l);break;case"Both":r=this.getBothDirection(e,t,i,s,h,l)}return[r[0],r[1]]},YAe.prototype.meanCalculation=function(e,t){var i=0,n=0,o=0,r=0,s=e.points.length;switch(t){case"Vertical":o=(n=Vye(e.yData))/s;break;case"Horizontal":r=(i=Vye(e.xData))/s;break;case"Both":o=(n=Vye(e.yData))/s,r=(i=Vye(e.xData))/s}for(var a=0,l=e.points;a<l.length;a++){var h=l[a];"Vertical"===t?n+=Math.pow(h.yValue-o,2):("Horizontal"!==t&&(n+=Math.pow(h.yValue-o,2)),i+=Math.pow(h.xValue-r,2))}var d=n/(s-1),p=Math.sqrt(n/(s-1)),c=i/(s-1),u=Math.sqrt(i/(s-1));return new $ye(d,p,c,u,o,r)},YAe.prototype.createElement=function(e,t){var i="Cartesian"===t.chartAreaType?"translate("+e.clipRect.x+","+e.clipRect.y+")":"",n=e.marker.height/2,o=e.marker.width/2;"Cartesian"===t.chartAreaType&&(o=new vve(t.element.id+"_ChartErrorBarClipRect_"+e.index,"transparent",{width:1,color:"Gray"},1,{x:-o,y:-n,width:e.clipRect.width+2*o,height:e.clipRect.height+2*n}),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)&&e.errorBarElement.appendChild(y0e(t.redraw,o,t.renderer))},YAe.prototype.doErrorBarAnimation=function(e){var t=e.errorBarElement.childNodes;if(!t)return null;for(var i=e.animation.delay+(0===e.animation.duration&&"Enable"===Ut?1e3:e.animation.duration),n=1;n<t.length;){for(var o=0;o<e.points.length;o++)e.points[o].symbolLocations[0]&&(t[n].style.visibility="hidden",S0e(t[n],i,350,e.chart.requireInvertedAxis?"SlideLeftIn":"SlideBottomIn",!1));n++}},YAe.prototype.getModuleName=function(){return"ErrorBar"},YAe.prototype.destroy=function(){};var GAe=YAe;function YAe(e){this.chart=e}XAe=function(e,t){return(XAe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}XAe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ZAe,KAe=Gve),ZAe.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on(F.touchMoveEvent,this.mouseMove,this),this.chart.on("click",this.click,this),this.chart.on(F.touchEndEvent,this.mouseEnd,this))},ZAe.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off(F.touchMoveEvent,this.mouseMove),this.chart.off("click",this.click),this.chart.off(F.touchEndEvent,this.mouseEnd))},ZAe.prototype.mouseMove=function(e){if(this.chart.legendSettings.visible&&!this.chart.isTouch&&(this.move(e),this.chart.highlightModule)&&("None"!==this.chart.highlightMode||this.chart.legendSettings.enableHighlight))for(var t=[this.legendID+"_text_",this.legendID+"_shape_marker_",this.legendID+"_shape_",this.legendID+"_g_"],i=e.target.id,n=0,o=t;n<o.length;n++){var r=o[n];if(-1<i.indexOf(r)){r=parseInt(i.split(r)[1],10),this.chart.highlightModule.legendSelection(this.chart,r,e.target,e.type);break}}},ZAe.prototype.mouseEnd=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},ZAe.prototype.getLegendOptions=function(e,t){this.legendCollections=[];var i=[];this.isRtlEnable=t.enableRtl,this.isReverse=!this.isRtlEnable&&t.legendSettings.reverse,1<e.length&&(this.legend.mode="Series");for(var n=0,o=e;n<o.length;n++){var r,s,a=o[n];if("Series"===this.legend.mode)"Indicator"!==a.category&&(p="PolarRadar"===t.chartAreaType?a.drawType:a.type,r=!a.marker.visible&&-1<p.indexOf("Line")&&-1===p.indexOf("Area")?a.dashArray:"",c=a.interior,this.legendCollections.push(new Rbe(a.name,c,a.legendShape,("TrendLine"===a.category?this.chart.series[a.sourceIndex].trendlines[a.index]:a).visible,p,a.legendImageUrl||("Scatter"===a.type&&"Image"===a.marker.shape?a.marker.imageUrl:""),a.marker.shape,a.marker.visible,null,null,r)));else if("Point"===this.legend.mode)for(var l=0,h=a.points;l<h.length;l++){var d=h[l],p="PolarRadar"===t.chartAreaType?a.drawType:a.type,c=d.interior||a.interior;this.legendCollections.push(new Rbe(d.x.toString(),c,a.legendShape,("TrendLine"===a.category?this.chart.series[a.sourceIndex].trendlines[a.index]:d).visible,p,"Scatter"===a.type&&"Image"===a.marker.shape?a.marker.imageUrl:"",a.marker.shape,a.marker.visible))}else if("Range"===this.legend.mode)for(var u=0,g=a.points;u<g.length;u++){var d=g[u],m=(p="PolarRadar"===t.chartAreaType?a.drawType:a.type,c=d.interior||a.interior,"Others");if(i.indexOf(c)<0&&(i.push(c),1<=t.rangeColorSettings.length)&&1===t.rangeColorSettings[0].colors.length){for(var f=0,y=t.rangeColorSettings;f<y.length;f++){var v=y[f];v.colors[0]===c&&(m=v.label)}this.legendCollections.push(new Rbe(m,c,a.legendShape,("TrendLine"===a.category?this.chart.series[a.sourceIndex].trendlines[a.index]:d).visible,p,"Scatter"===a.type&&"Image"===a.marker.shape?a.marker.imageUrl:"",a.marker.shape,a.marker.visible))}}else 0===this.legendCollections.length&&0<t.rangeColorSettings.length&&(r=t.rangeColorSettings[0].start.toString(),s=t.rangeColorSettings[t.rangeColorSettings.length-1].end.toString(),this.legendCollections.push(new Rbe(r,a.interior,"Rectangle",!0,p,"",a.marker.shape,a.marker.visible)),this.legendCollections.push(new Rbe(s,a.interior,"Rectangle",!0,p,"",a.marker.shape,a.marker.visible)))}this.isReverse&&"Gradient"!==t.legendSettings.mode&&this.legendCollections.reverse()},ZAe.prototype.getLegendBounds=function(e,t,i){this.calculateLegendTitle(i,t),this.isTitle=!!i.title,this.chartRowCount=1,this.rowHeights=[],this.columnHeights=[],this.pageHeights=[];var n=i.padding,o=i.titlePosition,r=0,s=0,a=this.arrowWidth,l=this.arrowHeight,h=this.isVertical&&!i.enablePages?l:0,l=this.isTitle&&"Top"===o?this.legendTitleSize.height+this.fivePixel:0,l=this.isTitle&&this.isVertical&&"Top"!==o?this.legendTitleSize.height+this.fivePixel:l,d=(this.isVertical?s=i.width?0:e.width/100*5:r=i.height?0:e.height/100*5,t.height+=r,t.width+=s,i.shapeWidth),p=i.shapePadding,c=0,u=0,g=0,m=0,f=0,y=0,v=!1,b=(this.maxItemHeight=Math.max(So("MeasureText",i.textStyle,this.chart.themeStyle.legendLabelFont).height,i.shapeHeight),"Auto"===i.layout&&0<i.maximumColumns);if(i.fixedWidth)for(var w=0;w<this.legendCollections.length;w++){var C=d+p+(this.isVertical||0===w?n:this.itemPadding)+(i.maximumLabelWidth||So(this.legendCollections[w].text,i.textStyle,this.chart.themeStyle.legendLabelFont).width);this.maxWidth=Math.max(this.maxWidth,C)}for(w=0;w<this.legendCollections.length;w++){var S,A=this.legendCollections[w];yfe.test(A.text)&&(A.text=uve(A.text,yfe)),vfe.test(A.text)&&(A.text=uve(A.text,vfe)),S={fill:A.fill,text:A.text,shape:A.shape,markerShape:A.markerShape,name:Hme,cancel:!1},this.chart.trigger(Hme,S),A.render=!S.cancel,A.text=S.text,A.fill=S.fill,A.shape=S.shape,A.markerShape=S.markerShape,A.textSize=So(A.text,i.textStyle,this.chart.themeStyle.legendLabelFont),d=A.text?i.shapeWidth:0,p=A.text?i.shapePadding:0,A.render&&A.text&&(v=!0,u+=S=i.fixedWidth?this.maxWidth:d+p+(i.maximumLabelWidth||A.textSize.width)+(this.isVertical&&"Horizontal"!==i.layout||0===w||1===m&&0<f&&"Horizontal"===i.layout?n:this.itemPadding),i.enablePages||this.isVertical||(y=this.isTitle&&"Top"!==o?this.legendTitleSize.width+this.fivePixel:0,y+=a),this.getLegendHeight(A,i,t,u,this.maxItemHeight,n),(b?m===i.maximumColumns:"Vertical"===i.layout||t.width<n+u+y||this.isVertical&&"Auto"===i.layout)&&(c=Math.max(c,u+n+y-(this.isVertical&&"Auto"===this.legend.layout?0:S)),0===f&&S!==u&&(f=1),u=this.isVertical&&"Auto"===this.legend.layout?0:S,f++,m=0,g=h),this.rowHeights[S=0<f?f-1:0]=Math.max(this.rowHeights[S]||0,Math.max(A.textSize.height,i.shapeHeight)),this.columnHeights[m]=(this.columnHeights[m]||0)+Math.max(A.textSize.height,i.shapeHeight)+(!(this.isVertical||0<f&&this.legend.itemPadding)||0===w?n:this.itemPadding),m++)}g=Math.max.apply(null,this.columnHeights)+n+l,g=Math.max(g,this.maxItemHeight+n+n+l),"Horizontal"===i.layout&&(g=this.maxItemHeight+2*n+l+this.pageButtonSize+i.border.width),this.isPaging=(t.height<g||"Horizontal"===i.layout&&1<this.rowHeights.length)&&!b,!this.isPaging||i.enablePages||this.isVertical||(g=this.maxItemHeight+n+n+("Top"===o?l:0)),this.totalPages=f,b&&this.maxWidth&&i.fixedWidth&&(u=this.maxWidth*i.maximumColumns,this.isPaging=!1),this.isPaging&&"Auto"===this.legend.layout||this.isVertical||(u+=this.isTitle&&"Top"!==o?this.fivePixel+this.legendTitleSize.width+this.fivePixel:0),v?this.setBounds(Math.max(u+n,c),g,i,t):this.setBounds(0,0,i,t)},ZAe.prototype.getLegendHeight=function(e,t,i,n,o,r){var s=e.textSize.width,a=t.shapePadding+2*r+t.shapeWidth;switch(t.textWrap){case"Wrap":case"AnyWhere":s>t.maximumLabelWidth||s+n>i.width?e.textCollection=pve(e.text,t.maximumLabelWidth?Math.min(t.maximumLabelWidth,i.width-a):i.width-a,t.textStyle,this.chart.enableRtl,null,null,this.chart.themeStyle.legendLabelFont):e.textCollection.push(e.text),e.textSize.height=o*e.textCollection.length}},ZAe.prototype.getRenderPoint=function(e,t,i,n,o,r,s){var a=this.legend.padding,l=this.legend.fixedWidth?this.maxWidth:i+(this.legend.maximumLabelWidth||n.textSize.width),l=n.location.x+(this.isRtlEnable?-l:l),o=(("Auto"===this.legend.layout&&0<this.legend.maximumColumns?r%this.legend.maximumColumns==0:"Vertical"===this.legend.layout||this.isWithinBounds(l,(this.legend.maximumLabelWidth||e.textSize.width)+i-this.itemPadding,o)||this.isVertical&&"Auto"===this.legend.layout)?(e.location.x=t.x,r!==s&&this.chartRowCount++,e.location.y=r===s?n.location.y:n.location.y+(!this.isVertical||"Horizontal"===this.legend.layout||0<this.legend.maximumColumns?this.rowHeights[this.chartRowCount-2]:Math.max(n.textSize.height,this.legend.shapeHeight))+(this.isVertical||1<this.chartRowCount&&this.legend.itemPadding?this.itemPadding:a)):(e.location.x=r===s?n.location.x:l,e.location.y=n.location.y),this.isRtlEnable?e.location.x-i+this.itemPadding+this.legend.shapeWidth/2-this.legendBounds.x:this.legendBounds.x+this.legendBounds.width-(e.location.x+i-this.itemPadding-this.legend.shapeWidth/2));this.isVertical||!this.isPaging||this.legend.enablePages||(o=this.legendBounds.width-e.location.x-this.fivePixel),o=this.legend.maximumLabelWidth?Math.min(this.legend.maximumLabelWidth,o):o,"Ellipsis"===this.legend.textOverflow&&"Normal"===this.legend.textWrap&&(e.text=eve(+o.toFixed(4),e.text,this.legend.textStyle,this.chart.enableRtl,this.chart.themeStyle.legendLabelFont))},ZAe.prototype.isWithinBounds=function(e,t,i){return this.isRtlEnable?e-t<i.x-this.legend.shapeWidth/2:e+t>i.x+i.width+this.legend.shapeWidth/2},ZAe.prototype.LegendClick=function(e,t){var i=this.chart,n="Series"===i.legendSettings.mode?e:0,o=this.isReverse?this.legendCollections.length-1-e:e,r=i.visibleSeries[n],n=this.legendCollections[o],o="isProtectedOnChange";if("Series"===i.legendSettings.mode){var s={legendText:n.text,legendShape:n.shape,chart:i.isBlazor?{}:i,series:r,points:r.points,name:Nme,cancel:!1};this.chart.trigger(Nme,s),r.legendShape=s.legendShape,s.cancel||(null!==r.fill&&(i.visibleSeries[e].interior=r.fill),i.legendSettings.toggleVisibility?(r.chart[o]=!0,"TrendLine"===r.category?!i.series[r.sourceIndex].trendlines[r.index].visible&&i.series[r.sourceIndex].visible?i.series[r.sourceIndex].trendlines[r.index].visible=!0:i.series[r.sourceIndex].trendlines[r.index].visible=!1:this.changeSeriesVisiblity(r,r.visible),n.visible=("TrendLine"===r.category?i.series[r.sourceIndex].trendlines[r.index]:r).visible,this.refreshLegendToggle(i,r),i.highlightModule&&i.legendSettings.enableHighlight&&i.highlightModule.legendSelection(i,e,t.target,"mousemove")):i.highlightModule?i.highlightModule.legendSelection(i,e,t.target,t.type):i.selectionModule&&i.selectionModule.legendSelection(i,e,t.target,t.type),r.chart[o]=!1)}else if("Point"===i.legendSettings.mode){var a=r.points[e],s={legendText:n.text,legendShape:n.shape,chart:i.isBlazor?{}:i,series:r,points:[a],name:Nme,cancel:!1};this.chart.trigger(Nme,s),i.legendSettings.toggleVisibility&&!s.cancel&&(a.visible=!a.visible,(h=this.legendCollections[e]).visible=a.visible,this.refreshLegendToggle(i,r))}else if("Range"===i.legendSettings.mode){for(var l=[],h=this.legendCollections[e],d=0,p=r.points;d<p.length;d++){a=p[d];h.fill===(a.interior||r.interior)&&l.push(a)}s={legendText:n.text,legendShape:n.shape,chart:i.isBlazor?{}:i,series:r,points:l,name:Nme,cancel:!1};if(this.chart.trigger(Nme,s),i.legendSettings.toggleVisibility&&!s.cancel){h.visible=!h.visible;for(var c=0,u=l;c<u.length;c++)(a=u[c]).visible=!a.visible;this.refreshLegendToggle(i,r)}}},ZAe.prototype.refreshLegendToggle=function(e,t){var i=[];if(e.selectionModule&&(i=Pe([],e.selectionModule.selectedDataIndexes,null,!0)),0<e.svgObject.childNodes.length&&!e.enableAnimation&&!e.enableCanvas){for(;e.svgObject.lastChild;)e.svgObject.removeChild(e.svgObject.lastChild);ue(e.svgObject)}e.animateSeries=!1,e.redraw=e.enableAnimation,t.isLegendClicked=!0,e.rotatedDataLabelCollections=[],Pye(Bo(e.element.id+"_Secondary_Element").querySelectorAll(".ejSVGTooltip")[0]),gve(e),this.redrawSeriesElements(t,e),e.removeSvg(),e.refreshAxis(),t.refreshAxisLabel(),this.refreshSeries(e.visibleSeries);for(var n=0,o=e.visibleSeries;n<o.length;n++){var r=o[n];je(r)||e.markerRender.removeHighlightedMarker(r,null,!0)}e.refreshBound(),e.trigger("loaded",{chart:e}),0<i.length&&(e.selectionModule.selectedDataIndexes=i,e.selectionModule.redrawSelection(e,e.selectionMode)),e.enableCanvas||!e.highlightModule||"None"===e.highlightMode&&!e.legendSettings.enableHighlight||e.highlightModule.redrawSelection(e,e.highlightMode),e.redraw=!1,t.isLegendClicked=!1},ZAe.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)||"Pareto"===e.category&&"Line"===e.type)&&(e.yAxis.internalVisibility=e.yAxis.series.some(function(e){return e.visible})),e.trendlines.length&&e.visible&&e.trendlines.forEach(function(e){e.visible=!0})},ZAe.prototype.isSecondaryAxis=function(e){return-1<this.chart.axes.indexOf(e)},ZAe.prototype.redrawSeriesElements=function(e,t){if(!t.redraw)return null;Pye(t.element.id+"_Series_"+(void 0===e.index?e.category:e.index)+"_DataLabelCollections")},ZAe.prototype.refreshSeries=function(e){for(var t=0,i=e;t<i.length;t++){var n,o,r=i[t];-1<r.type.indexOf("Spline")&&(n=-1<r.type.indexOf("Area")||-1<r.drawType.indexOf("Area"),o=-1<r.type.indexOf("Range"),this.chart["spline"+(n?o?"RangeArea":"Area":"")+"SeriesModule"].findSplinePoint(r)),r.visible&&(r.position=void 0)}},ZAe.prototype.click=function(e){var t=this;if(this.chart.legendSettings.visible){for(var i,n=this.chart.mouseX,o=this.chart.mouseY,r=(-1<e.target.id.indexOf("_chart_legend_g_")?e.target.firstChild:e.target).id,s=0,a=[this.legendID+"_text_",this.legendID+"_shape_marker_",this.legendID+"_shape_"];s<a.length;s++){var l=a[s];if(-1<r.indexOf(l)){l=parseInt(r.split(l)[1],10),this.LegendClick(l,e);break}}-1<r.indexOf(this.legendID+"_pageup")?this.changePage(e,!0):-1<r.indexOf(this.legendID+"_pagedown")&&this.changePage(e,!1),this.chart.enableCanvas&&this.pagingRegions.length&&this.checkWithinBounds(n,o),(i=this.legendRegions.filter(function(e){return o0e(n,o+(t.isPaging?(t.currentPageNumber-1)*t.translatePage(t.chart.enableCanvas,null,1,2):0),e.rect)})).length&&this.chart.enableCanvas&&this.LegendClick(i[0].index,e)}},ZAe.prototype.checkWithinBounds=function(e,t){var i=this.chart.renderer,n=this.legendBounds,o=this.chart.legendSettings.border.width,r=new Do(n.x,n.y,n.width,n.height);return r.x=r.x-o/2,r.y=r.y-o/2,r.width=r.width+o,r.height=r.height+o,o0e(e,t,this.pagingRegions[0])?(this.isRtlEnable?this.canvasPageUp(i,r,n):this.canvasPageDown(i,r,n),null):o0e(e,t,this.pagingRegions[1])?(this.isRtlEnable?this.canvasPageDown(i,r,n):this.canvasPageUp(i,r,n),null):void 0},ZAe.prototype.canvasPageDown=function(e,t,i){0<--this.currentPageNumber?(this.legendRegions=[],e.clearRect(t),e.canvasClip(new vve("legendClipPath","transparent",{width:0,color:""},null,t)),this.renderLegend(this.chart,this.legend,i),e.canvasRestore()):++this.currentPageNumber},ZAe.prototype.canvasPageUp=function(e,t,i){0<++this.currentPageNumber&&this.currentPageNumber<=this.totalNoOfPages?(this.legendRegions=[],e.clearRect(t),e.canvasClip(new vve("legendClipPath","transpaent",{width:0,color:""},null,t)),this.renderLegend(this.chart,this.legend,i),e.canvasRestore()):--this.currentPageNumber},ZAe.prototype.getModuleName=function(){return"Legend"},ZAe.prototype.destroy=function(){this.removeEventListener()};var XAe,KAe,JAe=ZAe;function ZAe(e){e=KAe.call(this,e)||this;return(e.library=e).addEventListener(),e}e1e.prototype.render=function(e,t){return this.isChart="chart"===this.control.getModuleName(),this.annotation=e,k0e(Q("div",{id:this.control.element.id+"_Annotation_"+t,styles:"position: absolute; z-index: 1"}),t,this.control.enableHtmlSanitizer?this.control.sanitize(e.content):e.content,this.control)},e1e.prototype.setAnnotationPixelValue=function(e){var t="Chart"===this.annotation.region?new Do(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:ive(this.annotation.x,t.width))+t.x,e.y=("number"==typeof this.annotation.y?this.annotation.y:ive(this.annotation.y,t.height))+t.y,!0},e1e.prototype.setAnnotationPointValue=function(e){var t;new Tve(0,0);if(this.isChart){for(var i=this.control,n=this.annotation,o=n.xAxisName,r=n.yAxisName,s=i.requireInvertedAxis,a=this.control.stockChart,l=void 0,h=void 0,d=void 0,p=0,c=i.axisCollections;p<c.length;p++){var u=c[p];if(o===u.name||null==o&&"primaryXAxis"===u.name)if((l=u).isIndexed)d=Number(n.x);else if(-1<l.valueType.indexOf("Category")){var g="DateTimeCategory"===l.valueType?n.x.getTime().toString():n.x;if("object"==typeof g)for(var m=0;m<l.labels.length;m++)l.labels[m].toString()===n.x.toString()&&(d=m);if(l.labels.indexOf(g)<0)return!1;d=l.labels.indexOf(g)}else d="DateTime"===l.valueType?(g={skeleton:"full",type:"dateTime"},"object"==typeof this.annotation.x||"object"==typeof new Date(this.annotation.x)?Date.parse(i.intl.getDateParser(g)(i.intl.getDateFormat(g)(new Date(Sa.parse.parseJson({val:n.x}).val)))):0):+n.x;else(r===u.name||null==r&&"primaryYAxis"===u.name)&&(h=u)}return l&&h&&Rye("Logarithmic"===l.valueType?Bye(d,l.logBase):d,l.visibleRange)&&Rye("Logarithmic"===h.valueType?Bye(+n.y,h.logBase):+n.y,h.visibleRange)?(t=L0e(d,+n.y,l,h,s),e.x=t.x+(s?h:l).rect.x,e.y=t.y+(s?l:h).rect.y+(a&&a.enablePeriodSelector?a.toolbarHeight+a.titleSize.height:0),!0):!1}return this.setAccumulationPointValue(e)},e1e.prototype.processAnnotation=function(e,t,i){function n(){s.style.transform="translate(-50%, -50%)"}var o=this.control,r=new Tve(0,0),s=this.render(e,t);n.bind(r,this),this["setAnnotation"+e.coordinateUnits+"Value"](r)?this.setElementStyle(r,s,i):this.control.redraw&&Pye(s.id),ro((this.control.element.id+"Annotation"+t).replace(/[^a-zA-Z0-9]/g,""),"ContentTemplate",(o.stockChart||this.control).annotations[t],void 0,n)},e1e.prototype.setAccumulationPointValue=function(e){for(var t,i=0,n=this.control.visibleSeries[0].points;i<n.length;i++){var o=n[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))},e1e.prototype.setElementStyle=function(e,t,i){var n=B0e(t,this.control.redraw),t={cancel:!1,name:pfe,content:t,location:e},e=this.control;this.control.trigger(pfe,t),t.cancel||(t.content.style.left=this.setAlignmentValue(this.annotation.horizontalAlignment,n.width,t.location.x)+"px",t.content.style.top=this.setAlignmentValue(this.annotation.verticalAlignment,n.height,t.location.y)+"px",n=e.annotationModule.annotation,"chart"===e.getModuleName()&&n&&n.accessibility?(t.content.setAttribute("aria-label",n.accessibility.accessibilityDescription||"Annotation"),t.content.setAttribute("role",n.accessibility.accessibilityRole||"img"),t.content.setAttribute("tabindex",n.accessibility.focusable?String(n.accessibility.tabIndex):"-1"),n.accessibility.focusable&&(t.content.style.outline="none")):(t.content.setAttribute("aria-label",this.annotation.description||"Annotation"),t.content.setAttribute("role","img")),R0e(t.content,i,this.control.redraw,!0,"left","top",this.control.duration))},e1e.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};var $Ae=e1e;function e1e(e){this.control=e}t1e=function(e,t){return(t1e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}t1e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(o1e,i1e=$Ae),o1e.prototype.renderAnnotations=function(e){var i=this;this.annotations=this.chart.annotations,this.parentElement=nve(this.chart.redraw,this.chart.element.id+"_Annotation_Collections")||Q("div",{id:this.chart.element.id+"_Annotation_Collections"}),this.annotations.map(function(e,t){i.processAnnotation(e,t,i.parentElement)});for(var t=0;"chart"===this.chart.getModuleName()&&!this.chart.enableCanvas&&t<this.chart.visibleSeries.length;t++)if(this.chart.visibleSeries[t].animation.enable&&this.chart.animateSeries){this.parentElement.style.visibility="hidden";break}R0e(this.parentElement,e,this.chart.redraw)},o1e.prototype.destroy=function(){},o1e.prototype.getModuleName=function(){return"Annotation"};var t1e,i1e,n1e=o1e;function o1e(e,t){var i=i1e.call(this,e)||this;return i.chart=e,i.annotations=t,i}r1e=function(e,t){return(r1e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}r1e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(l1e,s1e=Mwe),l1e.prototype.render=function(e,t,i,n){this.sideBySideInfo=this.getSideBySideInfo(e);for(var o=0,r=e.points;o<r.length;o++){var s=r[o];this.renderPoint(e,s,this.sideBySideInfo,void 0,t,i,n)}e.marker.visible&&e.chart.markerRender.render(e)},l1e.prototype.updateTipRegion=function(e,t,i){i=this.getRectangle(t.xValue+i.median,t.maximum,t.xValue+i.median,t.minimum,e);this.updateTipSize(e,t,i,e.chart.requireInvertedAxis)},l1e.prototype.updateTipSize=function(e,t,i,n){e=e.border.width||1;n?(i.y-=e/2,i.height=i.height||e):(i.x-=e/2,i.width=i.width||e),t.regions.push(i)},l1e.prototype.renderPoint=function(e,t,i,n,o,r,s){var a;t.symbolLocations=[],t.regions=[],t.visible&&Nye(e.points[t.index-1],t,e.points[t.index+1],e)&&(this.findBoxPlotValues(t.y,t,e.boxPlotMode,e.showOutliers),this.updateTipRegion(e,t,i),a=this.getRectangle(t.xValue+i.start,t.upperQuartile,t.xValue+i.end,t.lowerQuartile,e),t.regions.push(a),(n=this.triggerEvent(e,t,e.interior,{color:je(e.border.color)||"transparent"===e.border.color?K0e(e.interior,-.6):e.border.color,width:e.border.width||1})).cancel||this.renderBoxAndWhisker(e,t,n,this.getPathString(t,e,L0e(t.xValue,t.median,o,r,s),L0e(t.xValue+i.median,t.average,o,r,s)),i.median))},l1e.prototype.updateDirection=function(e,t,i){for(var n=0;n<t.length;n++){var o,r=e.points[t[n]];this.renderPoint(e,r,this.sideBySideInfo,void 0,e.xAxis,e.yAxis,i),r.symbolLocations&&r.symbolLocations.length&&e.marker.visible&&e.chart.markerRender.renderMarker(e,r,r.symbolLocations[0],r.symbolLocations.length-1,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelCollections=[],e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",0===r.outliers.length&&(o=ie(e.chart.dataLabelModule.commonId+r.index+"_Text_5"))&&o.remove(),e.chart.dataLabelModule.renderDataLabel(e,r,null,e.marker.dataLabel))}for(var s=e.seriesElement.children,n=s.length-1;0<=n;n--)0===s[n].children.length&&e.seriesElement.removeChild(s[n])},l1e.prototype.getPathString=function(e,t,i,n){var o=e.regions[0],r=e.regions[1],s="",a=t.chart.requireInvertedAxis?o.y+o.height/2:o.x+o.width/2,l=r.x+r.width,h=r.y+r.height,d=o.x+o.width,p=o.y+o.height;return s=t.chart.requireInvertedAxis?(this.updateTipSize(t,e,{x:o.x,y:r.y,width:0,height:h-r.y},!1),this.updateTipSize(t,e,{x:d,y:r.y,width:0,height:h-r.y},!0),(s=(s=(s=(s=(s+="M "+o.x+" "+r.y+" L "+o.x+" "+h)+"M "+o.x+" "+a+" L "+r.x+" "+a)+" M "+r.x+" "+r.y+" L "+l+" "+r.y+" L "+l+" "+h+" L "+r.x+" "+h+" Z")+" M "+l+" "+a+" L "+d+" "+a+" M "+d+" "+r.y+" L "+d+" "+h)+" M "+i.x+" "+r.y+" L "+i.x+" "+h)+(t.showMean?"M "+(n.x+5)+" "+(n.y-5)+" L "+(n.x-5)+" "+(n.y+5)+"M "+(n.x-5)+" "+(n.y-5)+" L "+(n.x+5)+" "+(n.y+5):"")):(this.updateTipSize(t,e,{x:r.x,y:o.y,width:l-r.x,height:0},!0),this.updateTipSize(t,e,{x:r.x,y:p,width:l-r.x,height:0},!0),(s=(s=(s=(s=(s+="M "+r.x+" "+o.y+" L "+l+" "+o.y)+" M "+a+" "+o.y+" L "+a+" "+r.y)+" M "+r.x+" "+r.y+" L "+l+" "+r.y+" L "+l+" "+h+" L "+r.x+" "+h+" Z")+" M "+a+" "+h+" L "+a+" "+p+" M "+r.x+" "+p+" L "+l+" "+p)+" M "+r.x+" "+i.y+" L "+l+" "+i.y)+(t.showMean?" M "+(n.x-5)+" "+(n.y-5)+" L "+(n.x+5)+" "+(n.y+5)+" M "+(n.x+5)+" "+(n.y-5)+" L "+(n.x-5)+" "+(n.y+5):""))},l1e.prototype.renderBoxAndWhisker=function(e,t,i,n,o){var r,s,a=e.chart.element.id+"_Series_"+e.index+"_Point_"+(null!==e.removedPointIndex&&e.removedPointIndex<=t.index?t.index+1:t.index),l=ie(a+"_BoxPath")?ie(a+"_BoxPath").getAttribute("d"):"",i=e.chart.renderer.drawPath(new No(a+"_BoxPath",i.fill,i.border.width,i.border.color,e.opacity,e.border.dashArray,n),new Int32Array([e.clipRect.x,e.clipRect.y])),n=(i.setAttribute("role","img"),i.setAttribute("aria-label",e.accessibility.accessibilityDescriptionFormat?e.formatAccessibilityDescription(t,e):t.x.toString()+":"+t.maximum.toString()+":"+t.minimum.toString()+":"+t.lowerQuartile.toString()+":"+t.upperQuartile.toString()),e.chart.renderer.createGroup({id:a}));O0e(e.chart.enableCanvas,n,i,e.chart.redraw,!0,null,null,null,l,null,null,null,e.chart.duration),null!==e.removedPointIndex&&e.removedPointIndex<=t.index&&(n.id=e.chart.element.id+"_Series_"+e.index+"_Point_"+t.index,i.id=e.chart.element.id+"_Series_"+e.index+"_Point_"+t.index+"_BoxPath");for(var h=0;h<t.outliers.length;h++)r=L0e(t.xValue+o,t.outliers[h],e.xAxis,e.yAxis,e.chart.requireInvertedAxis),s=new Eo(e.marker.width,e.marker.height),t.symbolLocations.push(r),this.updateTipSize(e,t,{x:r.x-s.width/2,y:r.y-s.height/2,width:s.width,height:s.height},!0);O0e(e.chart.enableCanvas,e.seriesElement,n,e.chart.redraw,!1,null,null,null,null,null,null,null,e.chart.duration,!0)},l1e.prototype.findBoxPlotValues=function(e,t,i,n){var o=e.length,r={average:Vye(e)/o,lowerQuartile:0,upperQuartile:0,maximum:0,minimum:0,median:0,outliers:[]};"Exclusive"===i?(r.lowerQuartile=this.getExclusiveQuartileValue(e,o,.25),r.upperQuartile=this.getExclusiveQuartileValue(e,o,.75),r.median=this.getExclusiveQuartileValue(e,o,.5)):"Inclusive"===i?(r.lowerQuartile=this.getInclusiveQuartileValue(e,o,.25),r.upperQuartile=this.getInclusiveQuartileValue(e,o,.75),r.median=this.getInclusiveQuartileValue(e,o,.5)):(r.median=Z0e(e),this.getQuartileValues(e,o,r)),this.getMinMaxOutlier(e,o,r,n),t.minimum=r.minimum,t.maximum=r.maximum,t.lowerQuartile=r.lowerQuartile,t.upperQuartile=r.upperQuartile,t.median=r.median,t.outliers=r.outliers,t.average=r.average},l1e.prototype.getExclusiveQuartileValue=function(e,t,i){var n;return 0===t?0:1===t||(i=i*(t+1),0===(n=Math.floor(Math.abs(i))))?e[0]:t-1<n?e[t-1]:(i-n)*(e[n]-e[n-1])+e[n-1]},l1e.prototype.getInclusiveQuartileValue=function(e,t,i){return 0===t?0:1===t?e[0]:((i=i*(t-1))-(t=Math.floor(Math.abs(i))))*(e[t+1]-e[t])+e[t]},l1e.prototype.getQuartileValues=function(e,t,i){if(1===t)return i.lowerQuartile=e[0],i.upperQuartile=e[0],null;var n=t%2==0,o=t/2,r=e.slice(0,o),e=e.slice(n?o:1+o,t);i.lowerQuartile=Z0e(r),i.upperQuartile=Z0e(e)},l1e.prototype.getMinMaxOutlier=function(e,t,i,n){for(var o=1.5*(i.upperQuartile-i.lowerQuartile),r=0;r<t;r++){if(!(e[r]<i.lowerQuartile-o&&n)){i.minimum=e[r];break}i.outliers.push(e[r])}for(r=t-1;0<=r;r--){if(!(e[r]>i.upperQuartile+o&&n)){i.maximum=e[r];break}i.outliers.push(e[r])}},l1e.prototype.doAnimation=function(e){this.animate(e)},l1e.prototype.getModuleName=function(){return"BoxAndWhiskerSeries"},l1e.prototype.destroy=function(){};var r1e,s1e,a1e=l1e;function l1e(){return null!==s1e&&s1e.apply(this,arguments)||this}h1e=function(e,t){return(h1e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}h1e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(c1e,d1e=Nwe),c1e.prototype.render=function(n,o,r,s,e,t){var a,l,h,d,i,p=this,c=null,u="",g=Math.max(n.yAxis.visibleRange.min,0),m=[],f=this.sortSegments(n,n.segments);this.enableComplexProperty(n).map(function(e,t,i){e.symbolLocations=[],e.regions=[],d=!1,e.visible&&Nye(i[t-1],e,i[t+1],n)&&(u+=p.getAreaPathDirection(e.xValue,g,n,s,L0e,c,"M"),c=c||new Tve(e.xValue,g),a=L0e(e.xValue,e.yValue,o,r,s),h&&p.setPointColor(e,h,n,"X"===n.segmentAxis,f)?(d=!0,l=L0e(c.x,g,o,r,s),u=(u+="L "+a.x+" "+a.y+" ")+"L "+a.x+" "+l.y+" ",p.generatePathOption(m,n,h,u,"_Point_"+h.index),u="M "+a.x+" "+l.y+" L "+a.x+" "+a.y+" "):(u+="L "+a.x+" "+a.y+" ",p.setPointColor(e,null,n,"X"===n.segmentAxis,f)),i[t+1]&&!i[t+1].visible&&"Drop"!==n.emptyPointSettings.mode&&(u+=p.getAreaEmptyDirection({x:e.xValue,y:g},c,n,s,L0e),c=null),h=e,p.storePointLocation(e,n,s,L0e))}),je(d)||d||(u=1<n.points.length?u+this.getAreaPathDirection(h.xValue,g,n,s,L0e,null,"L"):"",this.generatePathOption(m,n,h,u,"")),0!==n.border.width&&(i=this.removeEmptyPointsBorder(this.getBorderDirection(u)),this.generateBorderPathOption(m,n,h,i,"")),this.applySegmentAxis(n,m,f,e),t||this.renderMarker(n)},c1e.prototype.generatePathOption=function(e,t,i,n,o){e.push(new No(t.chart.element.id+"_Series_"+t.index+o,t.setPointColor(i,t.interior),0,"transparent",t.opacity,t.dashArray,n))},c1e.prototype.generateBorderPathOption=function(e,t,i,n,o){e.push(new No(t.chart.element.id+"_Series_border_"+t.index+o,"transparent",t.border.width,t.border.color||t.interior,1,t.border.dashArray,n))},c1e.prototype.updateDirection=function(e,t){this.render(e,e.xAxis,e.yAxis,e.chart.requireInvertedAxis,!1,!0);for(var i=0;i<t.length;i++)e.marker&&e.marker.visible&&e.chart.markerRender.renderMarker(e,e.points[t[i]],e.points[t[i]].symbolLocations[0],null,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[i]],null,e.marker.dataLabel))},c1e.prototype.destroy=function(){},c1e.prototype.getModuleName=function(){return"MultiColoredAreaSeries"},c1e.prototype.doAnimation=function(e){this.doLinearAnimation(e,e.animation)};var h1e,d1e,p1e=c1e;function c1e(){return null!==d1e&&d1e.apply(this,arguments)||this}u1e=function(e,t){return(u1e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}u1e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(f1e,g1e=Nwe),f1e.prototype.render=function(e,t,i,n,o,r){for(var s,a=null,l="M",h=this.enableComplexProperty(e),d=[],p="",c=null,u=this.sortSegments(e,e.segments),g=0,m=h;g<m.length;g++){var f=m[g];f.regions=[],f.visible&&Nye(h[f.index-1],f,h[f.index+1],e)?(p+=this.getLineDirection(a,s=f,e,n,L0e,l),null!=a?this.setPointColor(f,a,e,"X"===e.segmentAxis,u)?(d.push(new No(e.chart.element.id+"_Series_"+e.index+"_Point_"+a.index,"none",e.width,e.setPointColor(a,e.interior),e.opacity,e.dashArray,p)),l="M",p=""):l="L":this.setPointColor(f,c,e,"X"===e.segmentAxis,u)&&""!==p&&(d.push(new No(e.chart.element.id+"_Series_"+e.index+"_Point_"+c.index,"none",e.width,e.setPointColor(c,e.interior),e.opacity,e.dashArray,p)),l="M",p=""),this.storePointLocation(c=a=f,e,n,L0e)):(a="Drop"===e.emptyPointSettings.mode?a:null,l="Drop"===e.emptyPointSettings.mode?l:"M",f.symbolLocations=[])}""!==p&&d.push(new No(e.chart.element.id+"_Series_"+e.index,"none",e.width,e.setPointColor(s,e.interior),e.opacity,e.dashArray,p)),this.applySegmentAxis(e,d,u,o),r||this.renderMarker(e)},f1e.prototype.updateDirection=function(e,t){this.render(e,e.xAxis,e.yAxis,e.chart.requireInvertedAxis,!1,!0);for(var i=0;i<t.length;i++)e.marker&&e.marker.visible&&e.chart.markerRender.renderMarker(e,e.points[t[i]],e.points[t[i]].symbolLocations[0],null,!0),e.marker.dataLabel.visible&&e.chart.dataLabelModule&&(e.chart.dataLabelModule.commonId=e.chart.element.id+"_Series_"+e.index+"_Point_",e.chart.dataLabelModule.renderDataLabel(e,e.points[t[i]],null,e.marker.dataLabel))},f1e.prototype.doAnimation=function(e){this.doLinearAnimation(e,e.animation)},f1e.prototype.getModuleName=function(){return"MultiColoredLineSeries"},f1e.prototype.destroy=function(){};var u1e,g1e,m1e=f1e;function f1e(){return null!==g1e&&g1e.apply(this,arguments)||this}v1e.prototype.addEventListener=function(){this.chart.isDestroyed||this.chart.on("click",this.click,this)},v1e.prototype.getMultilevelLabelsHeight=function(r){var s,a,l,h=this,e=0,d=[],t=[],p="Vertical"===r.orientation,c=p?r.rect.height:r.rect.width;r.multiLevelLabels.map(function(n,o){n.categories.map(function(e,t){var i;""!==e.text&&null!==e.start&&null!==e.end&&(s=So(e.text,n.textStyle,h.chart.themeStyle.axisLabelFont),a=p?s.width:s.height,a+=2*n.border.width+("CurlyBrace"===n.border.type?10:0),l=null!==e.maximumTextWidth?e.maximumTextWidth:Yye("string"==typeof e.end?Number(new Date(e.end)):e.end,r)*c-Yye("string"==typeof e.start?Number(new Date(e.start)):e.start,r)*c,i=r.multiLevelLabels[o].categories.length,l=0!==t&&t!==i-1||"OnTicks"!==r.labelPlacement||"Shift"!==r.edgeLabelPlacement?l:l/2,s.width>l-10&&(h.chart.enableRtl?l<0:0<l)&&"Wrap"===n.overflow&&!p&&(a*=pve(e.text,l-10,n.textStyle,h.chart.enableRtl,null,null,h.chart.themeStyle.axisLabelFont).length),d[o]=!d[o]||d[o]<a?a:d[o])}),t[o]=e,e+=d[o]?d[o]+10:0}),r.multiLevelLabelHeight=e+(""!==r.title||this.chart.legendModule&&this.chart.legendSettings.visible?5:0),p?(this.yAxisMultiLabelHeight=d,this.yAxisPrevHeight=t):(this.xAxisMultiLabelHeight=d,this.xAxisPrevHeight=t)},v1e.prototype.renderXAxisMultiLevelLabels=function(s,a,e,l){var h,d,p,c,u,g,m,f,y,v,b=this,w=(s.labelPosition===s.tickPosition?s.majorTickLines.height:0)+s.maxLabelSize.height+10,C="",S="Outside"===s.labelPosition,A=s.isAxisInverse,x=s.isAxisOpposedPosition,I=s.scrollbarSettings.enable||S&&je(s.crossesAt)?s.scrollBarHeight:0,t=x&&!S||!x&&S?l.y+w-s.majorTickLines.width:l.y-w-s.multiLevelLabelHeight;this.createClipRect(l.x-s.majorTickLines.width,t+I,s.multiLevelLabelHeight+10,l.width+2*s.majorTickLines.width,this.chart.element.id+"_XAxis_Clippath_"+a,this.chart.element.id+"XAxisMultiLevelLabel"+a),s.multiLevelLabels.map(function(o,r){p=0,b.labelElement=b.chart.renderer.createGroup({id:b.chart.element.id+a+"_MultiLevelLabel"+r}),o.categories.map(function(e,t){v=o.categories.length,C="",c="string"==typeof e.start?Number(new Date(e.start)):e.start,u="string"==typeof e.end?Number(new Date(e.end)):e.end;var i=Pe({},R("properties",o.textStyle),null,!0);if(!(y=b.triggerMultiLabelRender(s,e.text,i,s.multiLevelLabels[r].alignment,e.customAttributes)).cancel){c=Yye(c,s)*l.width,u=Yye(u,s)*l.width,u=A?[c,c=u][0]:u,g=So(y.text,y.textStyle,b.chart.themeStyle.axisLabelFont),m=(null===e.maximumTextWidth?u-c:e.maximumTextWidth)-10,h=c+l.x+10,d=(x&&!S||!x&&S?w+l.y+g.height/2+10+b.xAxisPrevHeight[r]:l.y-w+g.height/2-b.xAxisMultiLabelHeight[r]-b.xAxisPrevHeight[r])+I,"Center"===y.alignment?(h+=(u-c-10)/2,f="middle"):"Far"===y.alignment?(h=h+(u-c-10)-o.border.width/2,"OnTicks"!==s.labelPlacement||0!==t&&t!==v-1||(h=(h+=(u-c-10)/2)-g.width/2),f="end"):(f="start",h+=o.border.width/2),d="CurlyBrace"===o.border.type?!x&&S||x&&!S?d+10:d-5:d;var n=new ko(b.chart.element.id+a+"_Axis_MultiLevelLabel_Level_"+r+"_Text_"+t,h,d,f,y.text);if("None"!==o.overflow){if(s.edgeLabelPlacement&&"OnTicks"===s.labelPlacement)switch(s.edgeLabelPlacement){case"None":break;case"Shift":0===t||A&&t===v-1?("Center"===y.alignment&&(n.x<l.x+10||n.x-g.width/2)<s.rect.x?(n.x+=l.x/2,n.x/2<l.x&&(n.x=l.x+5,n.anchor="start")):"Far"===y.alignment&&(n.x<l.x+10||n.x>l.x+10)?n.x+=g.width/2-m/2:"Near"===y.alignment&&(n.x<l.x+10||n.x>l.x+10)&&(n.x=l.x+10),m/=2):(t===v-1||A&&0===t)&&("Center"===y.alignment&&n.x>l.x+l.width?(n.x-=10,n.x>l.width&&(n.x=l.width+l.x,n.anchor="end")):"Far"===y.alignment&&(n.x=l.width+l.x),m/=2)}n.text="Wrap"===o.overflow?pve(y.text,m,y.textStyle,b.chart.enableRtl,null,null,b.chart.themeStyle.axisLabelFont):eve(m,y.text,y.textStyle,b.chart.enableRtl,b.chart.themeStyle.axisLabelFont),n.x=n.x-5}sve(b.chart.renderer,n,y.textStyle,y.textStyle.color||b.chart.themeStyle.axisLabelFont.color,b.labelElement,!1,b.chart.redraw,!0,null,null,null,0,null,b.chart.enableCanvas,null,b.chart.themeStyle.axisLabelFont),b.chart.enableCanvas&&(i=So(y.text,y.textStyle,b.chart.themeStyle.axisLabelFont),b.multiLevelLabelRectXRegion.push(new Do(n.x,n.y,i.width,i.height)),b.xLabelCollection.push(n)),0<o.border.width&&"WithoutBorder"!==o.border.type&&""!==(C=b.renderXAxisLabelBorder(r,u-c-10,s,c,w,g,n,l,y.alignment,C,S,x,p))&&(b.createBorderElement(r,a,s,C,p),p++),b.chart.enableCanvas||b.multiElements.appendChild(b.labelElement)}})}),this.chart.enableCanvas||e.appendChild(this.multiElements)},v1e.prototype.renderXAxisLabelBorder=function(e,t,i,n,o,r,s,a,l,h,d,p,c){var u,g,m=10,f=i.multiLevelLabels[e],y=f.categories[c].type,v=t+m,b=je(this.xAxisMultiLabelHeight[e])?0:this.xAxisMultiLabelHeight[e]+m,t="Outside"===i.labelPosition?i.scrollBarHeight:0,w=n+a.x,C=!p&&d||p&&!d?o+a.y+this.xAxisPrevHeight[e]+t:a.y-o-this.xAxisPrevHeight[e]-t,S=y||f.border.type;switch(S){case"WithoutTopandBottomBorder":case"Rectangle":case"WithoutTopBorder":var A=c===i.multiLevelLabels[e].categories.length-1&&w+v>a.width?a.width+a.x:w+v,x=0===c&&i.multiLevelLabels[e].categories[0].start<=0?a.x:w;h=(h+="M "+x+" "+C+" L "+x+" "+(C+(b=!p&&d||p&&!d?b:-b))+" M "+A+" "+C+" L "+A+" "+(C+b))+("WithoutTopandBottomBorder"!==S?" L "+x+" "+(C+b)+" ":" ")+("Rectangle"===S?"M "+x+" "+C+" L "+A+" "+C:" ");break;case"Brace":x="Near"===l?(g=s.x,s.x+r.width+2):"Center"===l?(g=s.x-r.width/2-2,s.x+r.width/2+2):(g=s.x-r.width-2,s.x),h+="M "+w+" "+C+" L "+w+" "+(C+(b=!p&&d||p&&!d?b:-b)/2)+" M "+w+" "+(C+b/2)+" L "+(g-2)+" "+(C+b/2)+" M "+x+" "+(C+b/2)+" L "+(w+v)+" "+(C+b/2)+" M "+(w+v)+" "+(C+b/2)+" L "+(w+v)+" "+C;break;case"CurlyBrace":A=!p&&d||p&&!d?(m=10,u=15,5):(m=-10,u=-15,-5),h+="Center"===l?"M "+w+" "+C+" C "+w+" "+C+" "+(w+5)+" "+(C+m)+" "+(w+10)+" "+(C+m)+" L "+(w+v/2-5)+" "+(C+m)+" L "+(w+v/2)+" "+(C+u)+" L "+(w+v/2+5)+" "+(C+m)+" L "+(w+v-10)+" "+(C+m)+" C "+(w+v-10)+" "+(C+m)+" "+(w+v)+" "+(C+A)+" "+(w+v)+" "+C:"Near"===l?"M "+w+" "+C+" C "+w+" "+C+" "+(w+5)+" "+(C+m)+" "+(w+10)+" "+(C+m)+" L "+(w+15)+" "+(C+u)+" L "+(w+20)+" "+(C+m)+" L "+(w+v-10)+" "+(C+m)+" C "+(w+v-10)+" "+(C+m)+" "+(w+v)+" "+(C+A)+" "+(w+v)+" "+C:"M "+w+" "+C+" C "+w+" "+C+" "+(w+5)+" "+(C+m)+" "+(w+10)+" "+(C+m)+" L "+(w+v-20)+" "+(C+m)+" L "+(w+v-15)+" "+(C+u)+" L "+(w+v-10)+" "+(C+m)+" L "+(w+v-10)+" "+(C+m)+" C "+(w+v-10)+" "+(C+m)+" "+(w+v)+" "+(C+A)+" "+(w+v)+" "+C}return h},v1e.prototype.renderYAxisMultiLevelLabels=function(r,s,e,a){var l,h,d,p,c,u,g,m,f=this,y="Outside"===r.labelPosition,v=(r.tickPosition===r.labelPosition?r.majorTickLines.height:0)+r.maxLabelSize.width+10,b="",w=r.isAxisInverse,C=r.isAxisOpposedPosition,S=y&&je(r.crossesAt)?r.scrollBarHeight:0,t=C&&!y||!C&&y?a.x-r.multiLevelLabelHeight-v-10:a.x+v;this.createClipRect(t+(S*=C?1:-1),a.y-r.majorTickLines.width,a.height+2*r.majorTickLines.width,r.multiLevelLabelHeight+10,this.chart.element.id+"_YAxis_Clippath_"+s,this.chart.element.id+"YAxisMultiLevelLabel"+s),r.multiLevelLabels.map(function(n,o){f.labelElement=f.chart.renderer.createGroup({id:f.chart.element.id+s+"_MultiLevelLabel"+o}),c=0,n.categories.map(function(e,t){b="",g="string"==typeof e.end?Number(new Date(e.end)):e.end,u="string"==typeof e.start?Number(new Date(e.start)):e.start,u=Yye(u,r)*a.height,g=Yye(g,r)*a.height,g=w?[u,u=g][0]:g;var i=Pe({},R("properties",n.textStyle),null,!0);(p=f.triggerMultiLabelRender(r,e.text,i,n.alignment,e.customAttributes)).cancel||(i=null===e.maximumTextWidth?f.yAxisMultiLabelHeight[o]/2:e.maximumTextWidth/2,l=So(p.text,p.textStyle,f.chart.themeStyle.axisLabelFont),m=g-u,h=a.x-v-f.yAxisPrevHeight[o]-i-5,d=a.height+a.y-u-m/2,h=C?y?a.x+v+5+i+f.yAxisPrevHeight[o]+S:a.x-v-i-f.yAxisPrevHeight[o]-5:y?h+S:a.x+v+5+i+f.yAxisPrevHeight[o],"Center"===p.alignment?d+=l.height/4:"Far"===p.alignment?d+=m/2-l.height/2:d=d-m/2+l.height,h="CurlyBrace"===n.border.type?!C&&y||C&&!y?h-10:h+10:h,(i=new ko(f.chart.element.id+s+"_Axis_MultiLevelLabel_Level_"+o+"_Text_"+t,h,d,"middle",p.text)).text="Trim"===n.overflow?eve(null===e.maximumTextWidth?f.yAxisMultiLabelHeight[o]:e.maximumTextWidth,p.text,p.textStyle,f.chart.enableRtl,f.chart.themeStyle.axisLabelFont):i.text,i.text="Wrap"===n.overflow?pve(p.text,null===e.maximumTextWidth?f.yAxisMultiLabelHeight[o]:e.maximumTextWidth,p.textStyle,f.chart.enableRtl,null,null,f.chart.themeStyle.axisLabelFont):i.text,"string"!=typeof i.text&&1<i.text.length&&(i.y-=10*i.text.length/2),sve(f.chart.renderer,i,p.textStyle,p.textStyle.color||f.chart.themeStyle.axisLabelFont.color,f.labelElement,f.chart.redraw,!0,null,null,null,null,0,null,f.chart.enableCanvas,null,f.chart.themeStyle.axisLabelFont),0<n.border.width&&"WithoutBorder"!==n.border.type&&""!==(b=f.renderYAxisLabelBorder(o,m,r,g,v,u,l,i,a,p.alignment,b,y,C,c))&&(f.createBorderElement(o,s,r,b,c),c++),f.chart.enableCanvas)||f.multiElements.appendChild(f.labelElement)})}),this.chart.enableCanvas||e.appendChild(this.multiElements)},v1e.prototype.renderYAxisLabelBorder=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u){var g,m,f=n-r,y=10,r=i.multiLevelLabels[e],v=r.categories[u].type,b=l.y+l.height-n,n=p&&je(i.crossesAt)?i.scrollBarHeight:0,w=(null===r.categories[u].maximumTextWidth?this.yAxisMultiLabelHeight[e]:r.categories[u].maximumTextWidth)+y,C=(!c&&p||c&&!p?l.x-o-this.yAxisPrevHeight[e]:l.x+o+this.yAxisPrevHeight[e])+(n*=c?1:-1),S=v||r.border.type;switch(S){case"WithoutTopandBottomBorder":case"Rectangle":case"WithoutTopBorder":d=(d+="M "+C+" "+b+" L "+(C+(w=!c&&p||c&&!p?-w:w))+" "+b+" M "+C+" "+(b+f)+" L "+(C+w)+" "+(b+f))+("WithoutTopandBottomBorder"!==S?" L "+(C+w)+" "+b+" ":" ")+("Rectangle"===S?"M "+C+" "+(b+f)+"L "+C+" "+b+" ":" ");break;case"Brace":d+="M "+C+" "+b+" L "+(C-(w=!c&&p||c&&!p?w:-w)/2)+" "+b+" L "+(C-w/2)+" "+(a.y-s.height/2-4)+" M "+(C-w/2)+" "+(a.y+s.height/4+2)+" L "+(C-w/2)+" "+(b+f)+" L "+C+" "+(b+f);break;case"CurlyBrace":m=!c&&p||c&&!p?(y=-10,g=-15,-5):(y=10,g=15,5),d+="Center"===h?"M "+C+" "+b+" C "+C+" "+b+" "+(C+y)+" "+b+" "+(C+y)+" "+(10+b)+" L "+(C+y)+" "+(b+(f-10)/2)+" L "+(C+g)+" "+(b+(f-10)/2+5)+" L "+(C+y)+" "+(b+(f-10)/2+10)+" L "+(C+y)+" "+(f-10+b)+" C "+(C+y)+" "+(f-10+b)+" "+(C+m)+" "+(b+f)+" "+C+" "+(b+f):"Far"===h?"M "+C+" "+b+" C "+C+" "+b+" "+(C+y)+" "+b+" "+(C+y)+" "+(10+b)+" L "+(C+y)+" "+(b+f-20)+"  L "+(C+g)+" "+(f-15+b)+" L "+(C+y)+" "+(f-10+b)+" L "+(C+y)+" "+(f-10+b)+" C "+(C+y)+" "+(f-10+b)+" "+(C+y)+" "+(b+f)+" "+C+" "+(b+f):"M "+C+" "+b+" C "+C+" "+b+" "+(C+y)+" "+b+" "+(C+y)+" "+(10+b)+" L "+(C+g)+" "+(15+b)+" L "+(C+y)+" "+(20+b)+" L "+(C+y)+" "+(f-10+b)+" C "+(C+y)+" "+(f-10+b)+" "+(C+m)+" "+(b+f)+" "+C+" "+(b+f)}return d},v1e.prototype.createClipRect=function(e,t,i,n,o,r){this.multiElements=this.chart.renderer.createGroup({id:r,"clip-path":"url(#"+o+")"}),this.chart.enableCanvas||this.multiElements.appendChild(y0e(this.chart.redraw,{id:o,x:e,y:t,width:n,height:i,fill:"white","stroke-width":1,stroke:"Gray"},this.chart.renderer))},v1e.prototype.createBorderElement=function(e,t,i,n,o){var r=n,t=this.chart.renderer.drawPath(new No(this.chart.element.id+t+"_Axis_MultiLevelLabel_Rect_"+e+"_"+o,"Transparent",i.multiLevelLabels[e].border.width,i.multiLevelLabels[e].border.color||this.chart.themeStyle.axisLine,1,"",n));t.style.pointerEvents="none",O0e(this.chart.enableCanvas,this.labelElement,t,this.chart.redraw,!0,"x","y",null,r)},v1e.prototype.triggerMultiLabelRender=function(e,t,i,n,o){e={cancel:!1,name:Yme,axis:e,text:t,textStyle:i,alignment:n,customAttributes:o};return this.chart.trigger(Yme,e),e},v1e.prototype.MultiLevelLabelClick=function(e,t){var i=parseInt(e.substr(0,1),10),e=parseInt(e.substr(7),10),t=this.chart.axisCollections[t],n=t.multiLevelLabels[i].categories,o=n[e].text,r=n[e].start,s=n[e].end,t={axis:t,level:i,text:o,customAttributes:n[e].customAttributes,start:r,end:s,name:ffe,cancel:!1};return this.chart.trigger(ffe,t),t},v1e.prototype.click=function(e){var t,i=e.target.id,n="_Axis_MultiLevelLabel_Level_";if(this.chart.enableCanvas)for(var o=0;o<this.multiLevelLabelRectXRegion.length;o++)o0e(e.x,e.y,this.multiLevelLabelRectXRegion[o],this.multiLevelLabelRectXRegion[o].width,this.multiLevelLabelRectXRegion[o].height)&&(i=this.xLabelCollection[o].id);-1<i.indexOf(n)&&(t=i.split(n)[1],n=i.split(n)[0],n=parseInt(n.charAt(n.length-1),10),this.MultiLevelLabelClick(t,n))},v1e.prototype.getModuleName=function(){return"MultiLevelLabel"},v1e.prototype.destroy=function(){};var y1e=v1e;function v1e(e){this.xAxisPrevHeight=[],this.xAxisMultiLabelHeight=[],this.yAxisPrevHeight=[],this.yAxisMultiLabelHeight=[],this.multiLevelLabelRectXRegion=[],this.xLabelCollection=[],this.chart=e,this.addEventListener()}w1e.prototype.renderElements=function(e,t){var i=e.axis.isAxisInverse,n=e.axis.scrollbarSettings,i=t.createGroup({id:this.chartId+"scrollBar_"+e.axis.name,transform:"translate("+(e.isVertical&&i?e.height:i?e.width:"0")+","+(e.isVertical&&i?"0":i?e.height:e.isVertical?e.width:"0")+") rotate("+(e.isVertical&&i?"90":e.isVertical?"270":i?"180":"0")+")"}),o=t.createGroup({id:this.chartId+"scrollBar_backRect_"+e.axis.name}),r=t.createGroup({id:this.chartId+"scrollBar_thumb_"+e.axis.name,transform:"translate(0,0)"});return this.backRect(e,t,o,n),this.thumb(e,t,r,n),this.renderCircle(e,t,r,n),this.arrows(e,t,r,n),this.thumbGrip(e,t,r,n),i.appendChild(o),i.appendChild(r),i},w1e.prototype.backRect=function(e,t,i,n){var o=e.scrollbarThemeStyle,t=t.drawRectangle(new vve(this.chartId+"scrollBarBackRect_"+e.axis.name,n.trackColor||o.backRect,{width:1,color:n.trackColor||o.backRect},1,new Do(0,0,e.width,e.height),n.trackRadius,n.trackRadius));i.appendChild(t)},w1e.prototype.arrows=function(e,t,i,n){var o=e.scrollbarThemeStyle,o=new No(this.chartId+"scrollBar_leftArrow_"+e.axis.name,o.arrow,1,o.arrow,1,"","");this.leftArrowEle=t.drawPath(o),o.id=this.chartId+"scrollBar_rightArrow_"+e.axis.name,this.rightArrowEle=t.drawPath(o),this.setArrowDirection(this.thumbRectX,this.thumbRectWidth,e.height),n.enableZoom&&(i.appendChild(this.leftArrowEle),i.appendChild(this.rightArrowEle))},w1e.prototype.setArrowDirection=function(e,t,i){var n=i/2,t="M "+(e+t+n/2)+" "+i/2+" L "+(e+t+n/2-(i/2-n/4))+" "+(i-n/2)+" L "+(e+t+n/2-(i/2-n/4))+" "+n/2+" Z";this.leftArrowEle.setAttribute("d","M "+(e-n/2)+" "+i/2+" L "+(e-n/2+(i/2-n/4))+" "+(i-n/2)+" L "+(e-n/2+(i/2-n/4))+" "+n/2+" Z"),this.rightArrowEle.setAttribute("d",t)},w1e.prototype.thumb=function(e,t,i,n){e.startX=this.thumbRectX;var o=e.scrollbarThemeStyle;this.slider=t.drawRectangle(new vve(this.chartId+"scrollBarThumb_"+e.axis.name,n.scrollbarColor||o.thumb,{width:1,color:n.scrollbarColor||o.thumb},1,new Do(n.enableZoom?this.thumbRectX:this.thumbRectX-e.height/2,0,n.enableZoom?this.thumbRectWidth:this.thumbRectWidth+e.height/2,e.height),n.scrollbarRadius,n.scrollbarRadius)),i.appendChild(this.slider)},w1e.prototype.renderCircle=function(e,t,i,n){var o=e.scrollbarThemeStyle,o=new Sve(this.chartId+"scrollBar_leftCircle_"+e.axis.name,o.circle,{width:1,color:o.circle},1,this.thumbRectX,e.height/2,e.height/2),r=t.createDefs(),s=t.createGroup({id:this.chartId+e.axis.name+"_thumb_shadow"});r.innerText='<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>',s.innerText='<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(r),n.enableZoom&&(i.appendChild(this.leftCircleEle),i.appendChild(this.rightCircleEle)),i.appendChild(s)},w1e.prototype.thumbGrip=function(e,t,i,n){var o=-1<e.component.theme.indexOf("Fluent2")||-1<e.component.theme.indexOf("Bootstrap5")||-1<e.component.theme.indexOf("Tailwind3")?-5:0,r=0,s=e.scrollbarThemeStyle,a=new Sve(this.chartId+"scrollBar_gripCircle0_"+e.axis.name,n.gripColor||s.grip,{width:1,color:n.gripColor||s.grip},1,0,0,1);this.gripCircle=t.createGroup({id:this.chartId+"scrollBar_gripCircle_"+e.axis.name,transform:"translate("+(n.enableZoom?this.thumbRectX+this.thumbRectWidth/2+5*(e.isVertical?1:-1):this.thumbRectX+this.thumbRectWidth/2+5*(e.isVertical?2:0)-n.height/2)+","+(e.isVertical?e.height/2+2.5-.5:e.height/2-2.5-.5)+") rotate("+(e.isVertical?"180":"0")+")"});for(var l=1;l<=(-1<e.component.theme.indexOf("Fluent2")||-1<e.component.theme.indexOf("Bootstrap5")||-1<e.component.theme.indexOf("Tailwind3")?10:6);l++)a.id=this.chartId+"scrollBar_gripCircle"+l+"_"+e.axis.name,a.cx=o,a.cy=r,this.gripCircle.appendChild(t.drawCircle(a)),o=l===(-1<e.component.theme.indexOf("Fluent2")||-1<e.component.theme.indexOf("Bootstrap5")||-1<e.component.theme.indexOf("Tailwind3")?5:3)?-1<e.component.theme.indexOf("Fluent2")||-1<e.component.theme.indexOf("Bootstrap5")||-1<e.component.theme.indexOf("Tailwind3")?-5:0:o+5,r=l>=(-1<e.component.theme.indexOf("Fluent2")||-1<e.component.theme.indexOf("Bootstrap5")||-1<e.component.theme.indexOf("Tailwind3")?5:3)?5:0;12<=n.height&&i.appendChild(this.gripCircle)};var b1e=w1e;function w1e(e){this.chartId=e.element.id+"_"}S1e.prototype.getMouseXY=function(e){var t,e=(-1<e.type.indexOf("touch")?(t=e.changedTouches[0].clientX,e.changedTouches[0]):(t=e.clientX,e)).clientY,i=ie(this.component.element.id+"_scrollBar_svg"+this.axis.name).getBoundingClientRect();this.mouseX=t-Math.max(i.left,0),this.mouseY=e-Math.max(i.top,0)},S1e.prototype.wireEvents=function(e){E.add(e,F.touchStartEvent,this.scrollMouseDown,this),E.add(e,F.touchMoveEvent,this.scrollMouseMove,this),E.add(e,F.touchEndEvent,this.scrollMouseUp,this),E.add(e,"mousewheel",this.scrollMouseWheel,this),window.addEventListener("mousemove",this.mouseMoveListener,!1),window.addEventListener("mouseup",this.mouseUpListener,!1)},S1e.prototype.unWireEvents=function(e){E.remove(e,F.touchStartEvent,this.scrollMouseDown),E.remove(e,F.touchMoveEvent,this.scrollMouseMove),E.remove(e,F.touchEndEvent,this.scrollMouseUp),E.remove(e,"mousewheel",this.scrollMouseWheel),window.removeEventListener("mousemove",this.mouseMoveListener,!1),window.removeEventListener("mouseup",this.mouseUpListener,!1)},S1e.prototype.scrollMouseDown=function(e){var t=e.target.id,i=this.scrollElements,n=this.axis.isAxisInverse;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&&n?this.mouseY:this.isVertical?this.width-this.mouseY:n?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(cfe,this.getArgs(cfe)),this.isExist(t,"scrollBarThumb_")||this.isExist(t,"gripCircle")?(this.isThumbDrag=!0,12<=this.axis.scrollbarSettings.height&&(this.svgObject.style.cursor="-webkit-grabbing")):this.isExist(t,"scrollBarBackRect_")&&(e=this.moveLength(this.previousXY,this.previousRectX),i.thumbRectX=this.isWithIn(e)?e:i.thumbRectX,this.positionThumb(i.thumbRectX,i.thumbRectWidth),this.setZoomFactorPosition(i.thumbRectX,i.thumbRectWidth),this.axis.zoomPosition=this.zoomPosition<0?0:.9<this.zoomPosition?1:this.zoomPosition,this.isLazyLoad)&&(n=i.thumbRectX>this.previousRectX?"RightMove":"LeftMove",t=this.calculateLazyRange(i.thumbRectX,i.thumbRectWidth,n))&&this.component.trigger(ufe,t),""===this.component.element.style.height&&(this.isCustomHeight=!0,this.component.element.style.height=this.component.availableSize.height+"px")},S1e.prototype.isExist=function(e,t){return-1<e.indexOf(t)},S1e.prototype.isWithIn=function(e){var t=this.axis.scrollbarSettings.height/2;return 0<=e-t&&e+this.scrollElements.thumbRectWidth+t<=this.width},S1e.prototype.moveLength=function(e,t,i){void 0===i&&(i=this.axis.scrollbarSettings.height/2);var n=.1*(this.width-2*i);return n=e<t?t-(i<t-n?n:i):t+(t+this.scrollElements.thumbRectWidth+n<this.width-i?n:i)},S1e.prototype.setZoomFactorPosition=function(e,t){this.isScrollUI=!0;var i=this.axis,n=this.axis.scrollbarSettings.height/2,o=e+t+n+1,r=.5+n,s=this.isVertical?i.rect.height:this.width;this.zoomFactor=(t+(o>=this.width?1+n:0))/s,this.zoomPosition=s<o?1-i.zoomFactor:e<1+n?0:(e-(e-r<=0?r:0))/s,this.zoomPosition=this.component.enableRtl&&!this.isVertical&&!i.isInversed||i.isInversed&&(!this.component.enableRtl||this.isVertical)?1-(this.zoomPosition+i.zoomFactor):this.zoomPosition},S1e.prototype.scrollMouseMove=function(e){var t=e.target,i=this.scrollElements,n=this.axis.isAxisInverse;if(!ie(this.svgObject.id))return null;this.getMouseXY(e),je(t.id)||(this.setCursor(t),this.setTheme(t));var o,e=this.isVertical&&n?this.width-this.mouseY:this.isVertical?this.mouseY:this.mouseX,r=this.axis.visibleRange,s=this.zoomPosition,a=this.zoomFactor,l=this.previousRectX-i.thumbRectX,l=(o=this.isLazyLoad&&(this.isThumbDrag||this.isResizeLeft||this.isResizeRight)?this.calculateLazyRange(i.thumbRectX,i.thumbRectWidth,l<0?"RightMove":"LeftMove"):o)?o.currentRange:null;this.isThumbDrag?(this.component.isScrolling=this.isThumbDrag,(e=this.isVertical||n?this.width-e:e)>=(o=i.thumbRectX+(e-this.previousXY))+i.thumbRectWidth?this.setCursor(t):12<=this.axis.scrollbarSettings.height&&(this.svgObject.style.cursor="-webkit-grabbing"),0<=e&&e<=o+i.thumbRectWidth&&(i.thumbRectX=this.isWithIn(o)?o:i.thumbRectX,this.positionThumb(i.thumbRectX,i.thumbRectWidth),this.previousXY=e,this.setZoomFactorPosition(o,i.thumbRectWidth),this.axis.zoomPosition=this.zoomPosition<0?0:.9<this.zoomPosition?1:this.zoomPosition),this.component.trigger(gfe,this.getArgs(gfe,r,s,a,l))):(this.isResizeLeft||this.isResizeRight)&&this.resizeThumb()},S1e.prototype.scrollMouseWheel=function(e){if(!this.axis.scrollbarSettings.enableZoom)return null;var t,i=ie(this.component.element.id+"_scrollBar_svg"+this.axis.name).getBoundingClientRect(),i=(this.mouseX=e.clientX-Math.max(i.left,0),this.mouseY=e.clientY-Math.max(i.top,0),this.scrollElements),n=this.axis,e="mozilla"!==this.browserName||this.isPointer?0<e.wheelDelta/120?1:-1:0<-e.detail/3?1:-1,e=Math.max(Math.max(1/T0e(n.zoomFactor,0,1),1)+.25*e,1),o=this.axis.visibleRange,r=this.zoomPosition,s=this.zoomFactor;1<=e&&(t=1<(t="Horizontal"===n.orientation?this.mouseX/n.rect.width:1-this.mouseY/n.rect.height)?1:t<0?0:t,this.zoomFactor=1===e?1:T0e(1/e,0,1),this.zoomPosition=1===e?0:n.zoomPosition+(n.zoomFactor-this.zoomFactor)*t),i.thumbRectX=this.isWithIn(this.zoomPosition*this.width)?this.zoomPosition*this.width:i.thumbRectX,this.isScrollUI=!0,this.positionThumb(i.thumbRectX,i.thumbRectWidth),this.isLazyLoad&&(this.setZoomFactorPosition(i.thumbRectX,i.thumbRectWidth),this.axis.zoomFactor=this.zoomFactor,this.axis.zoomPosition=this.zoomPosition<0?0:.9<this.zoomPosition?1:this.zoomPosition),n.zoomFactor=this.zoomFactor,n.zoomPosition=this.zoomPosition,this.isLazyLoad&&(e=this.calculateMouseWheelRange(i.thumbRectX,i.thumbRectWidth))&&e.currentRange.minimum!==e.previousAxisRange.minimum&&e.currentRange.maximum!==e.previousAxisRange.maximum&&(this.component.trigger(ufe,e),this.isScrollEnd=!1),this.isLazyLoad||this.component.trigger(gfe,this.getArgs(gfe,o,r,s))},S1e.prototype.scrollMouseUp=function(){this.startX=this.scrollElements.thumbRectX;var e,t=this.axis.scrollbarSettings.height/2,i=this.startX+this.scrollElements.thumbRectWidth+t+1;!this.isResizeLeft&&!this.isResizeRight||this.isLazyLoad||(this.axis.zoomFactor=i>=this.width-1&&this.startX-(.5+t)<=0?1:this.zoomFactor),this.isLazyLoad&&((0<(i=this.previousRectX-this.startX)||i<0)&&this.isThumbDrag&&(this.startX="RightMove"==(e=i<0?"RightMove":"LeftMove")?this.startX+Math.abs(i)<this.width-t?this.startX:this.width-t-this.scrollElements.thumbRectWidth:this.startX+this.scrollElements.thumbRectWidth-Math.abs(i)>t?this.startX:t,e=this.calculateLazyRange(this.startX,this.scrollElements.thumbRectWidth,e))&&(this.component.trigger(ufe,e),this.scrollStarted=!1),this.isResizeLeft||this.isResizeRight)&&(e=this.calculateLazyRange(this.startX,this.scrollElements.thumbRectWidth))&&(this.component.trigger(ufe,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(ufe,this.getArgs(gfe,this.startRange,this.startZoomPosition,this.startZoomFactor)),this.scrollStarted=!1),this.isCustomHeight&&(this.component.element.style.height=null)},S1e.prototype.calculateMouseWheelRange=function(e,t){var i,n,o,r=this.scrollRange,s=this.getStartEnd(this.previousStart,this.previousEnd,!1),a=this.axis.scrollbarSettings.height/2,e=(e+t+a<=this.width&&(n=(e-a)/this.width,i=t/this.width),r.min+n*r.delta),a=e+i*r.delta;return o=a?{axis:this.axis,currentRange:this.getStartEnd(e,a,!0),previousAxisRange:s}:o},S1e.prototype.calculateLazyRange=function(e,t,i){var n,o,r,s,a,l=this.scrollRange,h=this.getStartEnd(this.previousStart,this.previousEnd,!1),d=this.axis.scrollbarSettings.height/2;return this.isResizeRight||"RightMove"===i?(n=(t=this.isResizeRight?t+16:t)/this.width,o="RightMove"===i?(e+d)/this.width:this.axis.zoomPosition,s=(r="RightMove"===i?l.min+o*l.delta:this.previousStart)+n*l.delta):this.isResizeLeft||"LeftMove"===i?(o=(e-d)/this.width,n=t/this.width,r=(r=l.min+o*l.delta)>=l.min?r:l.min,s="LeftMove"===i?r+n*l.delta:this.previousEnd):this.isThumbDrag&&(o="RightMove"===i?(e+d)/this.width:(e-d)/this.width,n=this.scrollElements.thumbRectWidth/this.width,s=(r=(r=l.min+o*l.delta)>=l.min?r:l.min)+n*l.delta),a=s?{axis:this.component.isBlazor?{}:this.axis,currentRange:this.getStartEnd(r,s,!0),previousAxisRange:h}:a},S1e.prototype.getStartEnd=function(e,t,i){var n,o=this.valueType;switch("DateTime"!==o&&"DateTimeCategory"!==o||!i?i&&(i=Math.round(e),n=Math.ceil(t),"Category"===this.axis.valueType&&(n-=!this.axis.scrollbarSettings.enableZoom&&n-i>this.previousEnd-this.previousStart?n-i-(this.previousEnd-this.previousStart):0),this.previousStart=e=i,this.previousEnd=t=n):(this.previousStart=e,this.previousEnd=t),o){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}},S1e.prototype.render=function(e){(this.component.zoomModule||e&&this.axis.scrollbarSettings.enable)&&this.getDefaults(),this.getTheme(),this.removeScrollSvg();for(var t,e=this,i=this.component.svgRenderer,n=e.axis.rect,o="Horizontal"===e.axis.orientation,r=!1,s=0,a=0,l=e.axis.series;a<l.length;a++)(h=l[a]).marker.visible&&h.marker.height>s&&(s=h.marker.height);for(var h,d=0,p=e.axis.series;d<p.length;d++)if((h=p[d]).visible&&(t=h.yMin.toString(),r=h.yData.some(function(e){return e===t})),r)break;var c=(e.axis.isAxisOpposedPosition&&o?-16:r?s:0)+n.y+Math.max(.5,e.axis.lineStyle.width/2),n=(e.axis.isAxisOpposedPosition&&!o?16:0)+n.x-(e.isVertical?e.height:0);return o||"Left"!==e.axis.scrollbarSettings.position&&"Right"!==e.axis.scrollbarSettings.position?!o||"Top"!==e.axis.scrollbarSettings.position&&"Bottom"!==e.axis.scrollbarSettings.position||(c=Mye(e,o)):n=Mye(e,o),e.svgObject=i.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: "+c+"px;left: "+n+"px;cursor:auto;"}),e.elements.push(e.svgObject),this.wireEvents(this.svgObject),this.svgObject.appendChild(this.scrollElements.renderElements(this,this.component.svgRenderer)),this.svgObject},S1e.prototype.getTheme=function(){this.scrollbarThemeStyle=Hve(this.component.theme)},S1e.prototype.removeScrollSvg=function(){document.getElementById(this.component.element.id+"_scrollBar_svg"+this.axis.name)&&ue(document.getElementById(this.component.element.id+"_scrollBar_svg"+this.axis.name))},S1e.prototype.setCursor=function(e){e=e.id;this.svgObject.style.cursor=(-1<e.indexOf("scrollBarThumb_")||-1<e.indexOf("_gripCircle"))&&12<=this.axis.scrollbarSettings.height?"-webkit-grab":-1<e.indexOf("Circle_")||-1<e.indexOf("Arrow_")?this.isVertical?"ns-resize":"ew-resize":"auto"},S1e.prototype.setTheme=function(e){var t=e.id,i=-1<t.indexOf("_leftCircle_")||-1<t.indexOf("_leftArrow_"),t=-1<t.indexOf("_rightCircle_")||-1<t.indexOf("_rightArrow_"),n=this.scrollbarThemeStyle,o=this.scrollElements.leftArrowEle,r=this.scrollElements.rightArrowEle,s=this.scrollElements.leftCircleEle,a=this.scrollElements.rightCircleEle,e=this.isCurrentAxis(e,o);s.style.fill=i&&e?n.circleHover:n.circle,a.style.fill=t&&e?n.circleHover:n.circle,s.style.stroke=i&&e?n.circleHover:n.circle,a.style.stroke=t&&e?n.circleHover:n.circle,"HighContrastLight"===this.component.theme&&(o.style.fill=i&&e?n.arrowHover:n.arrow,o.style.stroke=i&&e?n.arrowHover:n.arrow,r.style.fill=t&&e?n.arrowHover:n.arrow,r.style.stroke=t&&e?n.arrowHover:n.arrow,s.style.stroke=i&&e?n.circleHover:n.circle,a.style.stroke=t&&e?n.circleHover:n.circle)},S1e.prototype.isCurrentAxis=function(e,t){return e.id.split("_")[2]===t.id.split("_")[2]},S1e.prototype.resizeThumb=function(){var e,t,i,n=this.axis.scrollbarSettings.height/2,o=2*n+10+14,r=this.previousRectX,s=this.axis.isAxisInverse,s=this.isVertical&&s?this.mouseY:this.isVertical?this.width-this.mouseY:s?this.width-this.mouseX:this.mouseX,a=Math.abs(this.previousXY-s);this.isResizeLeft&&0<=s?(e=0<=(t=r+(s>this.previousXY?a:-a))-n?this.previousWidth+(s>this.previousXY?-a:a):this.previousWidth,t=0<=t-n?t:r,o<=e&&s<t+e&&(this.scrollElements.thumbRectX=this.previousRectX=t,this.scrollElements.thumbRectWidth=this.previousWidth=e,this.previousXY=s,this.setZoomFactorPosition(t,e),i={axis:this.component.isBlazor?{}:this.axis,name:gfe,range:this.axis.visibleRange,zoomFactor:this.zoomFactor,zoomPosition:this.zoomPosition,previousRange:this.axis.visibleRange,previousZoomFactor:this.axis.zoomFactor,previousZoomPosition:this.axis.zoomPosition,currentRange:null,cancel:!1},this.component.trigger(gfe,i),i.cancel?(this.zoomFactor=i.previousZoomFactor,this.zoomPosition=i.previousZoomPosition):(this.positionThumb(t,e),this.axis.zoomFactor=i.zoomFactor,this.axis.zoomPosition=i.zoomPosition))):this.isResizeRight&&(e=s>=o+this.scrollElements.thumbRectX&&s<=this.width-n?s-this.scrollElements.thumbRectX:this.previousWidth,this.scrollElements.thumbRectWidth=this.previousWidth=e,this.previousXY=s,this.setZoomFactorPosition(this.startX,e),this.isLazyLoad||this.setZoomFactorPosition(this.startX,e),i={axis:this.component.isBlazor?{}:this.axis,name:gfe,range:this.axis.visibleRange,zoomFactor:this.zoomFactor,zoomPosition:this.zoomPosition,previousRange:this.axis.visibleRange,previousZoomFactor:this.axis.zoomFactor,previousZoomPosition:this.axis.zoomPosition,currentRange:null,cancel:!1},this.component.trigger(gfe,i),i.cancel?(this.zoomFactor=i.previousZoomFactor,this.zoomPosition=i.previousZoomPosition):(this.positionThumb(this.startX,e),this.axis.zoomFactor=i.zoomFactor,this.axis.zoomPosition=i.zoomPosition))},S1e.prototype.positionThumb=function(e,t){var i=this.scrollElements;i.slider.setAttribute("x",(this.axis.scrollbarSettings.enableZoom?e:e-this.axis.scrollbarSettings.height/2).toString()),i.slider.setAttribute("width",(this.axis.scrollbarSettings.enableZoom?t:t+this.axis.scrollbarSettings.height).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?this.axis.scrollbarSettings.height/2+2.5-.5:this.axis.scrollbarSettings.height/2-2.5-.5)+") rotate("+(this.isVertical?"180":"0")+")")},S1e.prototype.getDefaults=function(){var e=this.axis,t=this.axis.scrollbarSettings.height/2,i=2*t+10+14,n=(this.axis.scrollbarSettings.enable&&(this.isLazyLoad=!0,this.getLazyDefaults(e)),this.isVertical="Vertical"===e.orientation,this.component.enableRtl&&!this.isVertical&&!e.isInversed||e.isInversed&&!(this.component.enableRtl&&!this.isVertical)),n=(this.zoomFactor=(this.isLazyLoad?this:e).zoomFactor,this.zoomPosition=this.isLazyLoad?n?1-(this.zoomPosition+this.zoomFactor):this.zoomPosition:n?1-(e.zoomPosition+e.zoomFactor):e.zoomPosition,this.zoomFactor*(this.isVertical?e.rect.height:e.rect.width)),n=this.isLazyLoad&&!this.axis.scrollbarSettings.enableZoom||i<n?n:i,e=(this.scrollX=e.rect.x,this.scrollY=e.rect.y,this.width=this.isVertical?e.rect.height:e.rect.width,this.height=this.axis.scrollbarSettings.height,this.zoomPosition*(this.isVertical?e.rect.height:this.width)),i=this.width-i-t;this.scrollElements.thumbRectX=i<e?i:e<t?t:e,this.scrollElements.thumbRectWidth=this.isThumbDrag?this.scrollElements.thumbRectWidth:n+this.scrollElements.thumbRectX<this.width-2*t?n:this.width-this.scrollElements.thumbRectX-t},S1e.prototype.getLazyDefaults=function(e){var t=e.valueType,i=e.scrollbarSettings,n=e.scrollbarSettings.range,o=e.visibleRange,r=e.scrollbarSettings.pointsLength,i=(this.valueType=t=i.range.minimum&&i.range.maximum||!i.pointsLength?t:"Double",{skeleton:"full",type:"dateTime"}),s=this.component.intl.getDateParser(i),a=this.component.intl.getDateFormat(i);switch(t){case"Double":case"Category":case"Logarithmic":l=n.minimum||(r?0:o.min),h=n.maximum||(r?r-1:o.max);break;case"DateTime":case"DateTimeCategory":l=n.minimum?Date.parse(s(a(n.minimum))):o.min,h=n.maximum?Date.parse(s(a(n.maximum))):o.max}var l=Math.min(l,o.min),h=Math.max(h,o.max),i=(o.max-o.min)/(h-l),t=(o.min-l)/(h-l);this.zoomFactor=n.minimum||n.maximum?i:this.axis.maxPointLength/e.scrollbarSettings.pointsLength,this.zoomPosition=n.minimum||n.maximum?t:e.zoomPosition,this.zoomPosition=this.component.enableRtl&&"Horizontal"===e.orientation&&!e.isInversed||e.isInversed&&(!this.component.enableRtl||"Horizontal"!==e.orientation)?1-(this.zoomPosition+this.zoomFactor):this.zoomPosition,this.scrollRange.min=l,this.scrollRange.max=h,this.scrollRange.delta=h-l,this.previousStart=o.min,this.previousEnd=o.max},S1e.prototype.getLogRange=function(e){var t=e.scrollbarSettings.range,i=Bye(t.minimum,e.logBase),e=Bye(t.maximum,e.logBase),i=isFinite(i)?i:t.minimum,e=isFinite(i)?e:t.maximum;return{minimum:Math.floor(+i),maximum:Math.ceil(+e)}},S1e.prototype.injectTo=function(e,t){e.zoomingScrollBar=new S1e(t,e)},S1e.prototype.destroy=function(){var t=this;this.axes?this.axes.map(function(e){e.zoomingScrollBar.destroy()}):(this.elements.map(function(e){t.unWireEvents(e),ue(e.firstChild)}),this.elements=[])},S1e.prototype.getModuleName=function(){return"ScrollBar"},S1e.prototype.getArgs=function(e,t,i,n,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:n,previousZoomPosition:i,currentRange:o}};var C1e=S1e;function S1e(e,t){this.scrollRange={max:null,min:null,interval:null,delta:null},this.component=e,this.elements=[],this.scrollElements=new b1e(e),this.axis=t,this.mouseMoveListener=this.scrollMouseMove.bind(this),this.mouseUpListener=this.scrollMouseUp.bind(this),this.animateDuration=500,this.isPointer=F.isPointer,this.browserName=F.info.name}A1e=function(e,t){return(A1e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}A1e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(T1e,x1e=Mwe),T1e.prototype.initSeries=function(e,t){var i=new bbe(t,"series",e.properties,!0),n=t.palettes.length?t.palettes:Vve(t.theme),o=n.length;i.name="Pareto",i.yAxisName=e.yAxisName+"_CumulativeAxis",i.category="Pareto",e.category="Pareto",i.index=e.index+t.series.length,i.type="Line",i.interior=i.fill=i.paretoOptions.fill||n[i.index%o],i.width=i.paretoOptions.width,i.dashArray=i.paretoOptions.dashArray,i.marker=i.paretoOptions.marker,i.marker&&i.marker.visible&&(i.marker.shape=i.marker.shape||Dbe[t.markerIndex%10],t.markerIndex++),t.visibleSeries.push(i),this.initAxis(e,i,t)},T1e.prototype.initAxis=function(t,i,e){var n;this.paretoAxes.some(function(e){return e.name===i.yAxisName})||(n=t.yAxisName&&e.axes.length?e.axes.filter(function(e){return e.name===t.yAxisName})[0]:e.primaryYAxis,e=new Sye(e,"axes",{name:i.yAxisName,majorGridLines:{width:0},majorTickLines:n.majorTickLines,lineStyle:n.lineStyle,minimum:0,maximum:100,interval:20,rowIndex:n.rowIndex,opposedPosition:!0,labelFormat:"{value}%"}),this.paretoAxes.push(e))},T1e.prototype.render=function(e){e.chart.columnSeriesModule.render(e)},T1e.prototype.performCumulativeCalculation=function(e,t){for(var i=e,n=0,o=0,r=i.length,s=0;s<r;s++)n+=i[s][t.yName];for(s=0;s<r;s++)o+=i[s][t.yName],i[s][t.yName]=Number((o/n*100).toFixed(2));return i},T1e.prototype.doAnimation=function(e){this.animate(e)},T1e.prototype.getModuleName=function(){return"ParetoSeries"},T1e.prototype.destroy=function(){};var A1e,x1e,I1e=T1e;function T1e(){var e=null!==x1e&&x1e.apply(this,arguments)||this;return e.paretoAxes=[],e}D1e.prototype.export=function(l,h,d,p,c,u,e,g,m,t){for(var f=this,y=this.getControlsValue(p,e,t&&"PDF"===l,l),v=[],b=[],w=[],C=!(-1<F.userAgent.toString().indexOf("HeadlessChrome")),S=(d=je(d)?up.Landscape:d,this),i=0;i<y.length;i++)!function(e){b.push(c||y[e].width),w.push(u||y[e].height);var t,i,n=p[e].svgObject,o=p[e].enableCanvas,r=void 0,s=(o||(n=Q("canvas",{id:"ej2-canvas",attrs:{width:b[e].toString(),height:w[e].toString()}})),'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+y[e].svg.outerHTML+"</svg>"),a=window.URL.createObjectURL(new Blob("SVG"===l?[s]:[(new XMLSerializer).serializeToString(y[e].svg)],{type:"image/svg+xml"}));"SVG"===l?"msie"===F.info.name?(s=new Blob([(new XMLSerializer).serializeToString(y[e].svg)],{type:"application/octet-stream"}),window.navigator.msSaveOrOpenBlob(s,h+"."+l.toLocaleLowerCase())):S.triggerDownload(h,l,a,C):"msie"===F.info.name?(r=(o?n:S.createCanvas()).toDataURL(),v.push(n),"PDF"===l?v.length===y.length&&S.exportPdf(v,d,b,w,C,h,g,m):S.doexport(l,r,h)):(t=new Image,i=n.getContext("2d"),t.onload=function(){i.drawImage(t,0,0),window.URL.revokeObjectURL(a),v.push(n),"PDF"===l?v.length===y.length&&f.exportPdf(v,d,b,w,C,h,g,m):window.navigator.msSaveOrOpenBlob?window.navigator.msSaveOrOpenBlob(n.toBlob(null),h+"."+l.toLocaleLowerCase()):f.triggerDownload(h,l,n.toDataURL("image/"+l.toLowerCase()),C)},t.src=a),o||Pye(document.getElementById(p[e].element.id+"_canvas"))}(i)},D1e.prototype.getDataUrl=function(t){var i,n,e=this.getControlsValue([t]),o=this.control.svgObject,r=this.control.enableCanvas,s=(r||(o=Q("canvas",{id:"ej2-canvas",attrs:{width:e[0].width.toString(),height:e[0].height.toString()}})),window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(e[0].svg)],{type:"image/svg+xml"})));return"msie"===F.info.name?(e=o,r||(e=this.createCanvas()),r={name:wfe,cancel:!1,dataUrl:o.toDataURL("image/png")},t.trigger(wfe,r),{element:e,dataUrl:e.toDataURL()}):(i=new Image,n=o.getContext("2d"),i.onload=function(){n.drawImage(i,0,0),window.URL.revokeObjectURL(s);var e={name:wfe,cancel:!1,dataUrl:o.toDataURL("image/png")};return t.trigger(wfe,e),e.dataUrl},i.src=s,{element:o,blobUrl:s})},D1e.prototype.triggerDownload=function(e,t,i,n){Q("a",{attrs:{download:e+"."+t.toLocaleLowerCase(),href:i}}).dispatchEvent(new MouseEvent(n?"click":"move",{view:window,bubbles:!1,cancelable:!0}))},D1e.prototype.getControlsValue=function(e,t,i,n){for(var o=0,r=0,s=new fo("").createSvg({id:"Svg_Export_Element",width:200,height:200}),a=[],l=0;l<e.length;l++){var h,d=e[l],p=(d.enableRtl&&s.setAttribute("direction","rtl"),d.enableCanvas),c=d.svgObject.cloneNode(!0),u=d.renderer.createGroup({style:je(t)||t?"transform: translateY("+r+"px)":"transform: translateX("+o+"px)"});if("transparent"===(h=c.childNodes[0]?c.childNodes[0].getAttribute("fill"):"transparent")&&(h=-1<d.theme.indexOf("Dark")||-1<d.theme.indexOf("HighContrast")?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)"),!p){if("stockChart"===d.getModuleName()){c.childNodes[0].firstChild.setAttribute("fill",h);for(var g=1;g<c.childNodes.length;g++)c.childNodes[g].childNodes[0].setAttribute("fill",h)}else"SVG"===n&&c.childNodes[0].setAttribute("fill",h);u.appendChild(c)}var m=0,f=0;d.stockLegendModule&&d.legendSettings.visible&&("Bottom"===d.legendSettings.position||"Top"===d.legendSettings.position||"Auto"===d.legendSettings.position?m+=d.stockLegendModule.legendBounds.height:"Left"!==d.legendSettings.position&&"Right"!==d.legendSettings.position||(f+=d.stockLegendModule.legendBounds.width)),o=je(t)||t?Math.max(d.availableSize.width+f,o):o+d.availableSize.width+f,r=je(t)||t?r+d.availableSize.height+m:Math.max(d.availableSize.height+m,r),p||s.appendChild(u),!i&&l!==e.length-1||((!i&&!this.control.enableCanvas||i&&!p)&&(s.setAttribute("width",o+""),s.setAttribute("height",r+""),s.style.backgroundColor=h),a.push({width:o,height:r,svg:s})),i&&l<e.length&&(r=o=0,s=new fo("").createSvg({id:"Svg_Export_Element",width:200,height:200}))}return a},D1e.prototype.createCanvas=function(){var e=this.control,t=(this.canvasRender(!0,e),e.svgObject);return this.canvasRender(!1,e),t},D1e.prototype.canvasRender=function(e,t){t.enableCanvas=e,t.preRender(),t.render()},D1e.prototype.exportPdf=function(e,t,i,n,o,r,s,a){for(var l=new sg,h=l.pageSettings.margins,d=l.pageSettings.width,p=l.pageSettings.height,c=0;e.length>c;c++){var u,g,m=e[c].toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream"),f=(l.pageSettings.orientation=t,d<i[c]?i[c]+h.left+h.right:d),y=0===t&&p>n[c]?i[c]+h.left+h.right:p<n[c]?n[c]+h.top+h.bottom:p;void 0!==s&&(u=new cg(1,s.fontSize||15),(g=new Gy(f,30)).graphics.drawString(s.content+"",u,null,new Sd(new se(0,0,0)),s.x,s.y,null),l.template.top=g),void 0!==a&&(u=new cg(1,a.fontSize||15),(g=new Gy(f,30)).graphics.drawString(a.content+"",u,null,new Sd(new se(0,0,0)),a.x,a.y,null),l.template.bottom=g),l.pageSettings.size=new td(f,y),m=m.slice(m.indexOf(",")+1),l.pages.add().graphics.drawImage(new oc(m),0,0,i[c],n[c])}o&&(l.save(r+".pdf"),l.destroy())},D1e.prototype.doexport=function(e,t,i){this.exportImage([t],i,e||"JPG",t)},D1e.prototype.exportImage=function(e,t,i,n){for(var o=[],r=e instanceof HTMLElement?0:e.length,s=0;s<r;s++){for(var a=e[s].replace(/^data:[a-z]*;,/,"").split(","),l=atob(a[1]),a=new ArrayBuffer(l.length),h=new Uint8Array(a),d=0;d<l.length;d++)h[d]=l.charCodeAt(d);o.push(a)}for(var p=0;p<o.length;p++){var c=new Blob([o[p]],{type:"application/octet-stream"});"msie"===F.info.name&&window.navigator.msSaveOrOpenBlob(c,t+"."+i.toLocaleLowerCase())}};var E1e=D1e;function D1e(e){this.control=e}k1e.prototype.export=function(e,t,i,n,o,r,s,a,l,h){var d,p=new E1e(this.chart);n=n||[this.chart],"CSV"===e||"XLSX"===e?this.excelExport(n,t,e,o,r):(this.chart.trigger(bfe,d={cancel:!1,name:bfe,width:o,height:r,excelProperties:{rows:void 0,columns:void 0}}),d.cancel||p.export(e,t,i,n,o=d.width,r=d.height,s,a,l,h))},k1e.prototype.excelExport=function(e,t,i,n,o){this.rows=[],this.actualRowCount=1;for(var r,s,a=[],l={bold:!0,hAlign:"Center",vAlign:"Center",wrapText:!0},h=0;h<e.length;h++){var d="rangeNavigator"===e[h].getModuleName(),p="accumulationchart"===e[h].getModuleName();if(this.series=d?e[h].series:e[h].visibleSeries,d&&0===this.series.length)e[h].dataSource&&this.createRangeNavigatorExcelSheet(e[h],l,i);else{if(this.histogramSeriesCount=0,this.requiredValuesLength=0,this.axisCollection=[],p||d?this.axisCollection.push(null):this.axisCollection=("stockChart"===e[h].getModuleName()?e[h].chart:e[h]).horizontalAxes,r=this.getRequiredValues(d),0===this.requiredValuesLength&&this.series.length===this.histogramSeriesCount)return;s=this.getXValue(r,e[h],d,p),this.getTitle(r,l,e[h],d,p,i,s[0].length),this.createExcelSheet(d,p,s,i,r,l,e[h])}}var c=[];this.requiredValuesLength=0===this.requiredValuesLength?1:this.requiredValuesLength;for(var u=0;u<this.requiredValuesLength;u++)c.push({index:u+1,width:100});n={cancel:!1,name:bfe,width:n,height:o,excelProperties:{rows:this.rows,columns:c}};e[0].trigger(bfe,n),n.cancel||(a.push({columns:n.excelProperties.columns,rows:n.excelProperties.rows}),new oK({worksheets:a},"XLSX"===i?"xlsx":"csv").save((t=t||("XLSX"===i?"XLSX":"CSV"))+("XLSX"===i?".xlsx":".csv")))},k1e.prototype.createRangeNavigatorExcelSheet=function(e,t,i){for(var n=e.xName,o=e.yName,r=(this.rows.push({index:this.actualRowCount,cells:[{index:1,value:-1<e.valueType.indexOf("DateTime")?e.valueType:"Category",colSpan:1,rowSpan:1,style:t},{index:2,value:o,colSpan:1,rowSpan:1,style:t}]}),this.actualRowCount++,e.dataSource),s=0;s<r.length;s++)this.rows.push({index:this.actualRowCount,cells:[{index:1,value:"CSV"===i&&null===r[s][n]?"":r[s][n],colSpan:1,rowSpan:1,style:t},{index:2,value:"CSV"===i&&null===r[s][o]?"":r[s][o],colSpan:1,rowSpan:1,style:{}}]}),this.actualRowCount++;this.requiredValuesLength=2},k1e.prototype.getRequiredValues=function(n){for(var o=[],r=this,e=0;e<this.series.length;e++)!function(t){var i,e=r.series[t].type;if(!n&&!r.series[t].visible||"TrendLine"===r.series[t].category)return o.push([]);"Histogram"===e?(o.push([]),r.histogramSeriesCount++):"Pareto"===r.series[t].category?o.push([r.series[t].xName,"y"]):-1!==e.indexOf("Range")||"Hilo"===e?o.push([r.series[t].xName,r.series[t].high,r.series[t].low]):"HiloOpenClose"===e||"Candle"===e?(o.push([r.series[t].xName,r.series[t].high,r.series[t].low,r.series[t].open,r.series[t].close]),"Candle"===e&&""!==r.series[t].volume&&o[t].push(r.series[t].volume)):"BoxAndWhisker"===e?o.push([r.series[t].xName,"maximum","upperQuartile","median","lowerQuartile","minimum","outliers"]):"Bubble"===e?(o.push([r.series[t].xName,r.series[t].yName]),""!==r.series[t].size&&o[t].push(r.series[t].size)):"Pie"===e?(o.push([r.series[t].xName,r.series[t].yName]),r.series[t].radius.match(/[a-zA-Z]/)&&o[t].push(r.series[t].radius)):o.push([r.series[t].xName,r.series[t].yName]),r.series[t].errorBar&&r.series[t].errorBar.visible&&(i=r.series[t].errorBar,["verticalError","horizontalError","verticalNegativeError","horizontalNegativeError","verticalPositiveError","horizontalPositiveError"].forEach(function(e){"string"==typeof i[e]&&o[t].push(i[e])})),r.requiredValuesLength+=o[t].length}(e);return o},k1e.prototype.getTitle=function(e,t,i,n,o,r,s){var a,l=[],h=[],d=1,p=!1;!n&&"XLSX"===r&&i.title&&(this.rows.push({}),a=0<this.rows.length?this.rows.length-1:-1,this.actualRowCount++,p=!0);for(var c=0;c<this.axisCollection.length&&(!o||0!==s);c++){for(var u=!1,g="",m=d,f=!1,y=0;y<this.series.length;y++){var v=null!==this.axisCollection[c]?"primaryXAxis"===this.axisCollection[c].name||"primaryYAxis"===this.axisCollection[c].name&&-1<this.series[y].type.indexOf("Bar")?null:this.axisCollection[c].name:"";if(n||(o||v===this.series[y].xAxisName)&&this.series[y].visible&&"TrendLine"!==this.series[y].category&&"Histogram"!==this.series[y].type){f||(l.push({}),d++);var f=!0,b=this.series[y].name,w="BoxAndWhisker"===this.series[y].type?e[y].length-1:e[y].length;if(e[y][1]===this.series[y].yName)for(var C=1;C<w;C++)l.push({index:d,value:1===C?b||"Series-"+(y+1):e[y][C],colSpan:1,rowSpan:1,style:t}),d++;else{l.push({index:d,value:b||"Series-"+(y+1),colSpan:w-1,rowSpan:1,style:t});for(var S=d,C=1;C<w;C++)h.push({index:S,value:e[y][C],colSpan:1,rowSpan:1,style:t}),S++;"BoxAndWhisker"===this.series[y].type&&(l.push({index:S,value:e[y][w],colSpan:1,rowSpan:2,style:t}),S++),d=S,u=!0}g=o?e[0][0]:(n?i:this.axisCollection[c]).valueType,g=o||-1<g.indexOf("DateTime")?g:"Category"}}f&&(l[m-1]={index:m,value:g,colSpan:1,rowSpan:u?2:1,style:t})}l.length&&(this.rows.push({index:this.actualRowCount,cells:l}),this.actualRowCount++),h.length&&(this.rows.push({index:this.actualRowCount,cells:h}),this.actualRowCount++),p&&((l=[]).push({index:1,value:i.title,colSpan:1===d?d:d-1,rowSpan:1,style:t}),this.rows[a]={index:a+1,cells:l}),this.requiredValuesLength=d-1},k1e.prototype.getXValue=function(e,t,i,n){for(var o=[],r=0;r<this.axisCollection.length;r++){for(var s=[],a=n?"":(i?t:this.axisCollection[r]).valueType,l=0;l<this.series.length;l++){var h=null!==this.axisCollection[r]?"primaryXAxis"===this.axisCollection[r].name||"primaryYAxis"===this.axisCollection[r].name&&-1<this.series[l].type.indexOf("Bar")?null:this.axisCollection[r].name:"";if((i||(n||h===this.series[l].xAxisName)&&this.series[l].visible)&&"TrendLine"!==this.series[l].category&&"Histogram"!==this.series[l].type)for(var d=0;d<this.series[l].dataSource.length;d++)n&&!this.series[l].points[d].visible||s.push(-1<a.indexOf("DateTime")?new Date(this.series[l].dataSource[d][e[l][0]]).getTime():this.series[l].dataSource[d][e[l][0]])}o.push(s)}for(var p=0;p<o.length;p++)!function(i){o[i]=o[i].filter(function(e,t){return o[i].indexOf(e)===t})}(p);return o},k1e.prototype.createExcelSheet=function(e,t,i,n,o,r,s){for(var a=0,l=0,h=0;h<this.axisCollection.length;h++){for(var d=t?"":(e?s[0]:this.axisCollection[h]).valueType,p=0;p<i[h].length;p++){for(var l=a||1,c=[],u=!0,g=0;g<this.series.length;g++){var m=null!==this.axisCollection[h]?"primaryXAxis"===this.axisCollection[h].name||"primaryYAxis"===this.axisCollection[h].name&&-1<this.series[g].type.indexOf("Bar")?null:this.axisCollection[h].name:"";if((e||(t||this.series[g].xAxisName===m)&&this.series[g].visible)&&"TrendLine"!==this.series[g].category&&"Histogram"!==this.series[g].type){for(var f=!1,y=this.series[g].dataSource,v=0;v<y.length;v++){var b=-1<d.indexOf("DateTime")?("Pareto"===this.series[g].category?new Date(this.series[g].points[v][o[g][0]]):new Date(y[v][o[g][0]])).getTime():("Pareto"===this.series[g].category?this.series[g].points:y)[v][o[g][0]];if(i[h][p]===b){for(var w=u?0:1,C="BoxAndWhisker"===this.series[g].type?o[g].length-1:o[g].length;w<C;w++){var S=this.series[g].enableComplexProperty?R(o[g][w],y[v]):y[v][o[g][w]],S=0===w||"BoxAndWhisker"!==this.series[g].type&&"Pareto"!==this.series[g].category?S:this.series[g].points[v][o[g][w]];c.push({index:0===w?0===a?1:a:l,value:S=null===S&&"CSV"===n?"":S,colSpan:1,rowSpan:1,style:0===w?r:{}}),l++}"BoxAndWhisker"===this.series[g].type&&(c.push({index:l,value:this.series[g].points[v].outliers[0],colSpan:1,rowSpan:1,style:{}}),l++),f=!(u=!1);break}}f||(l+=o[g].length-1)}}this.rows.push({index:this.actualRowCount,cells:c}),this.actualRowCount++}a=l}},k1e.prototype.getDataUrl=function(e){return new E1e(e).getDataUrl(e)},k1e.prototype.getModuleName=function(){return"Export"},k1e.prototype.destroy=function(){};var M1e=k1e;function k1e(e){this.actualRowCount=0,this.series=[],this.axisCollection=[],this.requiredValuesLength=0,this.histogramSeriesCount=0,this.chart=e}P1e=function(e,t){return(P1e=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])}))(e,t)};var P1e,B1e,Mwe=function(e,t){function i(){this.constructor=e}P1e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},F1e=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},L1e=(Mwe(R1e,B1e=n),F1e([e(null)],R1e.prototype,"content",void 0),F1e([e("0")],R1e.prototype,"x",void 0),F1e([e("0")],R1e.prototype,"y",void 0),F1e([e("Pixel")],R1e.prototype,"coordinateUnits",void 0),F1e([e("Chart")],R1e.prototype,"region",void 0),F1e([e("Middle")],R1e.prototype,"verticalAlignment",void 0),F1e([e("Center")],R1e.prototype,"horizontalAlignment",void 0),F1e([e(null)],R1e.prototype,"description",void 0),R1e);function R1e(){return null!==B1e&&B1e.apply(this,arguments)||this}Mwe(V1e,O1e=n),F1e([e(!1)],V1e.prototype,"visible",void 0),F1e([e(!0)],V1e.prototype,"showZero",void 0),F1e([e(null)],V1e.prototype,"name",void 0),F1e([e("transparent")],V1e.prototype,"fill",void 0),F1e([e("Inside")],V1e.prototype,"position",void 0),F1e([e(5)],V1e.prototype,"rx",void 0),F1e([e(5)],V1e.prototype,"ry",void 0),F1e([e(0)],V1e.prototype,"angle",void 0),F1e([e(!1)],V1e.prototype,"enableRotation",void 0),F1e([t({width:null,color:null},Rge)],V1e.prototype,"border",void 0),F1e([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},Tge)],V1e.prototype,"font",void 0),F1e([t({},Lue)],V1e.prototype,"connectorStyle",void 0),F1e([e(null)],V1e.prototype,"template",void 0),F1e([e("")],V1e.prototype,"format",void 0),F1e([e(null)],V1e.prototype,"maxWidth",void 0),F1e([e("Ellipsis")],V1e.prototype,"textOverflow",void 0),F1e([e("Normal")],V1e.prototype,"textWrap",void 0);var O1e,N1e=V1e;function V1e(){return null!==O1e&&O1e.apply(this,arguments)||this}Mwe(z1e,_1e=n),F1e([e("50%")],z1e.prototype,"x",void 0),F1e([e("50%")],z1e.prototype,"y",void 0);var _1e,H1e=z1e;function z1e(){return null!==_1e&&_1e.apply(this,arguments)||this}var j1e,W1e=function(){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},Mwe=(Mwe(Q1e,j1e=n),Q1e.prototype.refreshDataManager=function(t,e){var i=this,n=(this.accumulation=t,this.radius=this.radius||(F.isDevice&&"Outside"===this.dataLabel.position?"40%":"80%"),this.dataSource||t.dataSource);n instanceof me||!je(this.query)?this.dataModule.getData(this.dataModule.generateQuery().requiresCount()).then(function(e){return i.dataManagerSuccess(e,t)}):this.dataManagerSuccess({result:n,count:n.length},t,e)},Q1e.prototype.dataManagerSuccess=function(e,t,i){void 0===i&&(i=!0);var n={name:Qme,series:this,data:e.result};t.allowServerDataBinding=!1,t.trigger(Qme,n),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())},Q1e.prototype.getPoints=function(e,t){var i,n=Object.keys(e).length;if((this.sumOfPoints=0)===n)return this.points=[],null;this.findSumOfPoints(e),this.points=[],this.clubbedPoints=[],this.sumOfClub=0;for(var o,r,s=this.palettes.length?this.palettes:Vve(t.theme),a=ive(this.groupTo,this.sumOfPoints),l=0;l<n;l++)i=this.setPoints(e,l,s,t),this.isClub(i,a,l)?(i.index=this.clubbedPoints.length,i.isExplode=!0,this.clubbedPoints.push(i),i.isSliced=!0):(je(i.y)&&(i.visible=!1),this.pushPoints(i,s));this.lastGroupTo=this.groupTo,0<this.sumOfClub&&(o=this.generateClubPoint(),this.pushPoints(o,s),r=this.points.length-1,this.clubbedPoints.map(function(e){e.index+=r,e.color=o.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))},Q1e.prototype.generateClubPoint=function(){var e=new W1e;return e.isClubbed=!0,e.x="Others",e.y=this.sumOfClub,e.text=e.originalText=e.x+": "+this.sumOfClub,e.sliceRadius="80%",e},Q1e.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)},Q1e.prototype.isClub=function(e,t,i){if(!je(t)){if("Value"===this.groupMode&&Math.abs(e.y)<=t)return this.sumOfClub+=Math.abs(e.y),!0;if("Point"===this.groupMode&&t<=i)return this.sumOfClub+=Math.abs(e.y),!0}return!1},Q1e.prototype.findSumOfPoints=function(e){for(var t=Object.keys(e).length,i=0;i<t;i++)je(e[i])||je(e[i][this.yName])||isNaN(e[i][this.yName])||(this.sumOfPoints+=Math.abs(e[i][this.yName]))},Q1e.prototype.setPoints=function(e,t,i,n){var o=new W1e;return o.x=R(this.xName,e[t]),o.y=R(this.yName,e[t]),o.legendImageUrl=R(this.legendImageUrl,e[t]),o.color=R(this.pointColorMapping,e[t]),o.text=o.originalText=R(this.dataLabel.name||"",e[t]),o.tooltip=R(this.tooltipMappingName||"",e[t]),o.sliceRadius=R(this.radius,e[t]),o.sliceRadius=je(o.sliceRadius)?"80%":o.sliceRadius,o.separatorY=n.intl.formatNumber(o.y,{useGrouping:n.useGroupingSeparator}),this.setAccEmptyPoint(o,t,e),o},Q1e.prototype.renderSeries=function(e,t){var i,n=t?ie(e.element.id+"_Series_"+this.index):e.renderer.createGroup({id:e.element.id+"_Series_"+this.index});this.renderPoints(e,n,t),e.accumulationDataLabelModule&&this.dataLabel.visible&&((i=e.renderer.createGroup({id:e.element.id+"_datalabel_Series_"+this.index})).style.visibility=(this.animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&e.animateSeries&&"Pie"===this.type?"hidden":"visible",this.renderDataLabel(e,i,t)),"Pie"===this.type&&(e.redraw||this.findMaxBounds(this.labelBound,this.accumulationBound),e.pieSeriesModule.animateSeries(e,this.animation,this,n,this.borderRadius,this.points)),!e.redraw&&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)},Q1e.prototype.renderPoints=function(e,t,i,n,o,r){for(var s=e.element.id+"_Series_"+this.index+"_Point_",a=[],l=[],h=["Chessboard","Dots","DiagonalForward","Crosshatch","Pacman","DiagonalBackward","Grid","Turquoise","Star","Triangle","Circle","Tile","HorizontalDash","VerticalDash","Rectangle","Box","VerticalStripe","HorizontalStripe","Bubble"],d=0,p=this.points;d<p.length;d++){var c,u=p[d],g=(u.percentage=+(u.y/this.sumOfPoints*100).toFixed(2),{cancel:!1,name:jme,series:this,point:u,fill:u.color,border:this.isEmpty(u)?{width:this.emptyPointSettings.border.width,color:this.emptyPointSettings.border.color}:{width:this.border.width,color:this.border.color},pattern:this.applyPattern?h[u.index%h.length]:"None"});e.trigger(jme,g),u.color=g.fill,c=u.color,this.applyPattern&&(c=new CAe(e).pattern(e,u.color,u.index,g.pattern,this.opacity)),c=new No(s+u.index,c,g.border.width||1,g.border.color||u.color,this.opacity,g.series.dashArray,""),"Trapezoidal"===this.funnelMode&&"Funnel"===this.type?(a.push(c),u.visible&&l.push(u)):e[l0e(this.type)+"SeriesModule"].renderPoint(u,this,e,c,t,i,n,o,r)}"Trapezoidal"===this.funnelMode&&"Funnel"===this.type?e[l0e(this.type)+"SeriesModule"].renderTrapezoidalFunnel(this,l,e,a,t,i):O0e(!1,e.getSeriesElement(),t,i)},Q1e.prototype.renderDataLabel=function(e,t,i){e.accumulationDataLabelModule.findAreaRect();for(var n,o=Q("div",{id:e.element.id+"_Series_0_DataLabelCollections"}),r=(this.leftSidePoints=[],this.rightSidePoints=[],[]),s=[],a=0,l=this.points;a<l.length;a++){var h=l[a];h.visible&&(this.dataLabel.showZero||!this.dataLabel.showZero&&(0!==h.y||0===h.y&&"Zero"===this.emptyPointSettings.mode))&&e.accumulationDataLabelModule.renderDataLabel(h,this.dataLabel,t,this.points,this.index,o,i),(90<=h.midAngle&&h.midAngle<=270?this.leftSidePoints:0<=h.midAngle&&h.midAngle<=90?s:r).push(h)}r.sort(function(e,t){return e.midAngle-t.midAngle}),s.sort(function(e,t){return e.midAngle-t.midAngle}),this.leftSidePoints.sort(function(e,t){return e.midAngle-t.midAngle}),this.rightSidePoints=r.concat(s),e.accumulationDataLabelModule.drawDataLabels(this,this.dataLabel,t,o,i),null!==this.dataLabel.template&&o.childElementCount&&(n=e.accumulationDataLabelModule.drawDataLabels.bind(e.accumulationDataLabelModule,this,this.dataLabel,t,o,i),e.isReact&&e.renderReactTemplates(n),O0e(!1,ie(e.element.id+"_Secondary_Element"),o,i)),O0e(!1,e.getSeriesElement(),t,i)},Q1e.prototype.findMaxBounds=function(e,t){e.x=(t.x<e.x?t:e).x,e.y=(t.y<e.y?t: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},Q1e.prototype.findMaxLabelWidth=function(){for(var e,t=0;t<this.points.length;t++)(e=this.points[0].textSize.width)<this.points[t].textSize.width&&(e=this.points[t].textSize.width);return e},Q1e.prototype.setAccEmptyPoint=function(e,t,i){if(!je(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=i[t-1]&&i[t-1][this.yName]||0,o=i[t+1]&&i[t+1][this.yName]||0;e.y=(Math.abs(n)+Math.abs(o))/2,this.sumOfPoints+=e.y,e.visible=!0;break;default:e.visible=!1}},Q1e.prototype.setData=function(e,t){if(!e)return null;var i=!1;if(this.dataSource.length===e.length)for(var i=!0,n=0;n<e.length;n++){if(this.dataSource[n][this.xName]!==e[n][this.xName]){i=!1;break}var o=this.points[n];this.dataSource[n][this.yName]!==e[n][this.yName]&&(o.y=e[n][this.yName],this.dataSource[n]=e[n])}if(i){for(var r=[],n=this.sumOfPoints=0;n<this.resultData.length;n++)this.points[n]&&this.points[n].visible&&r.push(this.resultData[n]);this.findSumOfPoints(r),this.accumulation.redraw=!this.borderRadius&&this.accumulation.enableAnimation,this.accumulation.animateSeries=!1;var s=this.accumulation.duration;this.accumulation.duration=je(t)?500:t,this.accumulation[l0e(this.type)+"SeriesModule"].initProperties(this.accumulation,this),this.renderPoints(this.accumulation,ie(this.accumulation.element.id+"_Series_"+this.index),this.accumulation.redraw,null,null,!0),this.accumulation.centerLabel.text&&this.accumulation.renderCenterLabel(!0,!0),this.accumulation.annotationModule&&this.accumulation.annotationModule.renderAnnotations(ie(this.accumulation.element.id+"_Secondary_Element")),this.accumulation.accumulationDataLabelModule&&this.dataLabel.visible&&this.renderDataLabel(this.accumulation,ie(this.accumulation.element.id+"_datalabel_Series_"+this.index),this.accumulation.redraw),this.accumulation.redraw=!1,this.accumulation.duration=s}else this.dataSource=e},Q1e.prototype.addPoint=function(e,t){this.accumulation.series[0].dataLabel.visible&&(i=this.findMaxLabelWidth()),this.dataSource.push(e),this.resultData=this.dataSource;for(var i,n=[],o=this.sumOfPoints=0;o<this.resultData.length;o++)(this.points[o]&&this.points[o].visible||o===this.resultData.length-1)&&n.push(this.resultData[o]);this.findSumOfPoints(n);var e=0===this.points.length?0:this.points[this.points.length-1].index+1,r=this.palettes.length?this.palettes:Vve(this.accumulation.theme),e=this.setPoints(this.dataSource,e,r,this.accumulation),e=(this.pushPoints(e,r),this.accumulation.redraw=!this.borderRadius&&this.accumulation.enableAnimation,this.accumulation.duration);this.accumulation.duration=je(t)?500:t,this.updateSeries(ie(this.accumulation.element.id+"_Series_"+this.index),i,"addPoint"),this.accumulation.redraw=!1,this.accumulation.duration=e},Q1e.prototype.removePoint=function(e,t){var i=Pe([],this.dataSource,null,!0),n=this.accumulation.duration;if(0<i.length&&0<=e&&e<i.length){for(var o=[],r=this.sumOfPoints=0;r<this.dataSource.length;r++)r!==e&&this.points[r]&&this.points[r].visible&&o.push(this.dataSource[r]);i.splice(e,1),this.dataSource.splice(e,1),this.findSumOfPoints(o),this.accumulation.redraw=!this.borderRadius&&this.accumulation.enableAnimation,this.accumulation.duration=je(t)?500:t,this.points.splice(e,1);for(r=e;r<this.points.length;r++){var s=this.points[r];s.index=r,s.y=this.points[r].y}i=ie(this.accumulation.element.id+"_Series_0_Point_"+this.points.length);i&&i.parentNode.removeChild(i),this.updateSeries(ie(this.accumulation.element.id+"_Series_"+this.index),void 0,"removePoint",e),this.accumulation.redraw=!1,this.accumulation.duration=n}},Q1e.prototype.updateSeries=function(e,t,i,n){var o,r=this.accumulation[l0e(this.type)+"SeriesModule"].radius,s=this.accumulation[l0e(this.type)+"SeriesModule"].center;if(this.accumulation.legendSettings.visible){if("addPoint"===i)this.accumulation.accumulationLegendModule.legendCollections.push(new Rbe(this.points[this.points.length-1].x.toString(),this.points[this.points.length-1].color,this.legendShape,this.points[this.points.length-1].visible,this.type,this.points[this.points.length-1].legendImageUrl,null,null,this.points[this.points.length-1].index,this.index));else{this.accumulation.accumulationLegendModule.legendCollections.splice(n,1);for(var a=n;a<this.accumulation.accumulationLegendModule.legendCollections.length;a++)this.accumulation.accumulationLegendModule.legendCollections[a].pointIndex=a}1<=this.accumulation.accumulationLegendModule.legendCollections.length&&(o=this.accumulation.accumulationLegendModule.legendBounds,this.accumulation.accumulationLegendModule.calculateLegendBounds(this.accumulation.initialClipRect,this.accumulation.availableSize,null,o,!0),!this.dataLabel||"Outside"!==this.dataLabel.position||"Bottom"!==this.accumulation.legendSettings.position&&"Top"!==this.accumulation.legendSettings.position?o.width!==this.accumulation.accumulationLegendModule.legendBounds.width:o.height!==this.accumulation.accumulationLegendModule.legendBounds.height)&&(i=this.accumulation.title?So(this.accumulation.title,this.accumulation.titleStyle,this.accumulation.themeStyle.chartTitleFont).height*this.accumulation.titleCollection.length:0,n=this.accumulation.subTitle?So(this.accumulation.subTitle,this.accumulation.subTitleStyle,this.accumulation.themeStyle.chartSubTitleFont).height*this.accumulation.subTitleCollection.length:0,this.accumulation.initialClipRect=new Do(this.accumulation.margin.left,this.accumulation.margin.top,this.accumulation.availableSize.width,this.accumulation.availableSize.height),zye(this.accumulation.initialClipRect,new Do(0,n+i,this.accumulation.margin.right+this.accumulation.margin.left,this.accumulation.margin.bottom+this.accumulation.margin.top)),this.accumulation.accumulationLegendModule.calculateLegendBounds(this.accumulation.initialClipRect,this.accumulation.availableSize,null))}this.accumulation[l0e(this.type)+"SeriesModule"].initProperties(this.accumulation,this),this.renderPoints(this.accumulation,e,this.accumulation.redraw,r,s,!0),o&&("Bottom"===this.accumulation.legendSettings.position||"Top"===this.accumulation.legendSettings.position?o.height!==this.accumulation.accumulationLegendModule.legendBounds.height:o.width!==this.accumulation.accumulationLegendModule.legendBounds.width)&&this.accumulation.centerLabel.text&&this.accumulation.renderCenterLabel(!0,!0),this.accumulation.annotationModule&&this.accumulation.annotationModule.renderAnnotations(ie(this.accumulation.element.id+"_Secondary_Element")),this.accumulation.accumulationDataLabelModule&&this.dataLabel.visible&&(n=this.accumulation.renderer.createGroup({id:this.accumulation.element.id+"_datalabel_Series_"+this.index}),this.renderDataLabel(this.accumulation,n,this.accumulation.redraw)),this.accumulation.legendSettings.visible&&("Pie"===this.type&&(this.dataLabel.visible&&this.points[this.points.length-1]&&this.points[this.points.length-1].textSize.width>t&&"Top"!==this.accumulation.legendSettings.position&&"Bottom"!==this.accumulation.legendSettings.position&&(this.accumulation.visibleSeries[0].findMaxBounds(this.accumulation.visibleSeries[0].labelBound,this.points[this.points.length-1].labelRegion),this.findMaxBounds(this.labelBound,this.accumulationBound),this.labelBound.x-=this.accumulation.explodeDistance,this.labelBound.y-=this.accumulation.explodeDistance,this.labelBound.height+=this.accumulation.explodeDistance-this.labelBound.y,this.labelBound.width+=this.accumulation.explodeDistance-this.labelBound.x),this.accumulation.accumulationLegendModule.getSmartLegendLocation(this.accumulation.visibleSeries[0].labelBound,this.accumulation.accumulationLegendModule.legendBounds,this.accumulation.margin)),this.accumulation.accumulationLegendModule.renderLegend(this.accumulation,this.accumulation.legendSettings,this.accumulation.accumulationLegendModule.legendBounds,this.accumulation.redraw,!0))},Q1e.prototype.isEmpty=function(e){return e.color===this.emptyPointSettings.fill},F1e([e("")],Q1e.prototype,"dataSource",void 0),F1e([e()],Q1e.prototype,"query",void 0),F1e([e("")],Q1e.prototype,"xName",void 0),F1e([e("")],Q1e.prototype,"name",void 0),F1e([e("")],Q1e.prototype,"tooltipMappingName",void 0),F1e([e("")],Q1e.prototype,"yName",void 0),F1e([e(!0)],Q1e.prototype,"visible",void 0),F1e([t({color:null,width:0},Rge)],Q1e.prototype,"border",void 0),F1e([t(null,Qge)],Q1e.prototype,"animation",void 0),F1e([e("SeriesType")],Q1e.prototype,"legendShape",void 0),F1e([e("")],Q1e.prototype,"legendImageUrl",void 0),F1e([e("")],Q1e.prototype,"pointColorMapping",void 0),F1e([e(!1)],Q1e.prototype,"applyPattern",void 0),F1e([e(null)],Q1e.prototype,"selectionStyle",void 0),F1e([e(null)],Q1e.prototype,"groupTo",void 0),F1e([e("Value")],Q1e.prototype,"groupMode",void 0),F1e([t({},N1e)],Q1e.prototype,"dataLabel",void 0),F1e([e([])],Q1e.prototype,"palettes",void 0),F1e([e(0)],Q1e.prototype,"startAngle",void 0),F1e([e(null)],Q1e.prototype,"endAngle",void 0),F1e([e(null)],Q1e.prototype,"radius",void 0),F1e([e("0")],Q1e.prototype,"innerRadius",void 0),F1e([e("Pie")],Q1e.prototype,"type",void 0),F1e([e(!0)],Q1e.prototype,"enableTooltip",void 0),F1e([e(!1)],Q1e.prototype,"explode",void 0),F1e([e("30%")],Q1e.prototype,"explodeOffset",void 0),F1e([e(!1)],Q1e.prototype,"explodeAll",void 0),F1e([e(null)],Q1e.prototype,"explodeIndex",void 0),F1e([t({mode:"Drop"},Kge)],Q1e.prototype,"emptyPointSettings",void 0),F1e([e(0)],Q1e.prototype,"gapRatio",void 0),F1e([e("80%")],Q1e.prototype,"width",void 0),F1e([e("80%")],Q1e.prototype,"height",void 0),F1e([e("20%")],Q1e.prototype,"neckWidth",void 0),F1e([e("20%")],Q1e.prototype,"neckHeight",void 0),F1e([e("Linear")],Q1e.prototype,"pyramidMode",void 0),F1e([e("Standard")],Q1e.prototype,"funnelMode",void 0),F1e([e(1)],Q1e.prototype,"opacity",void 0),F1e([e("0")],Q1e.prototype,"dashArray",void 0),F1e([t({},wge)],Q1e.prototype,"accessibility",void 0),F1e([e(0)],Q1e.prototype,"borderRadius",void 0),Q1e);function Q1e(){var e=null!==j1e&&j1e.apply(this,arguments)||this;return e.points=[],e.clubbedPoints=[],e.sumOfPoints=0,e.isRectSeries=!0,e.clipRect=new Do(0,0,0,0),e.category="Series",e.rightSidePoints=[],e.leftSidePoints=[],e}function U1e(e,t){for(var i=0,n=t;i<n.length;i++){var o=n[i];if(e===o.index)return o}return t[0]}function q1e(e,t){for(var i=0,n=t;i<n.length;i++){var o=n[i];if(o.index===e)return o}return null}Object.defineProperty(Y1e.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(Y1e.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(Y1e.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}),Y1e.prototype.isCircular=function(){return"Pie"===this.accumulation.type},Y1e.prototype.isVariousRadius=function(){return this.accumulation.pieSeriesModule.isRadiusMapped},Y1e.prototype.processExplode=function(e){if(-1<e.target.id.indexOf("_Series_")||-1<e.target.id.indexOf("_datalabel_")){var t=Kye(e.target.id).point;if(isNaN(t)||-1<e.target.id.indexOf("_datalabel_")&&"Outside"===this.accumulation.visibleSeries[0].points[t].labelPosition)return null;this.explodePoints(t,this.accumulation),this.deExplodeAll(t,this.accumulation.enableAnimation?300:0)}},Y1e.prototype.invokeExplode=function(){for(var e=this.accumulation.visibleSeries[0],t=this.accumulation.enableAnimation?300:0,i=0,n=e.points;i<n.length;i++){var o=n[i];o.isExplode&&0!==o.y&&this.pointExplode(o.index,o,t)}if(this.accumulation.accumulationSelectionModule&&"None"!==this.accumulation.selectionMode&&this.accumulation.accumulationSelectionModule.selectedDataIndexes.length)for(var r=0,s=this.accumulation.accumulationSelectionModule.selectedDataIndexes;r<s.length;r++){var a=s[r];this.explodePoints(a.point,this.accumulation,!0),this.deExplodeAll(a.point,t)}},Y1e.prototype.deExplodeAll=function(e,t){for(var i=this.accumulation.element.id+"_Series_0_Point_",n=0,o=this.accumulation.visibleSeries[0].points;n<o.length;n++){var r=o[n];(e!==r.index&&!r.isSliced||r.isClubbed)&&(r.isExplode=!1,this.deExplodeSlice(r.index,i,t))}},Y1e.prototype.explodePoints=function(e,t,i,n){void 0===i&&(i=!1);var o=t.visibleSeries[0],r=o.points,s=q1e(e,r),a=!0,l=this.accumulation.enableAnimation?300:0;if(je(s))return null;var h=!i&&(s.isSliced||o.clubbedPoints.length&&r[r.length-1].index===o.clubbedPoints[o.clubbedPoints.length-1].index);(a="Pie"===o.type&&(h||s.isClubbed)?this.clubPointExplode(e,s,o,r,t,l,h):a)&&0!==s.y&&this.pointExplode(e,s,l,i,n)},Y1e.prototype.getSum=function(e){var t=0;return e.map(function(e){t+=e.visible?e.y:0}),t},Y1e.prototype.clubPointExplode=function(e,t,i,n,o,r,s){if(void 0===s&&(s=!1),t.isClubbed)return o.animateSeries=!1,n.splice(n.length-1,1),i.clubbedPoints.map(function(e){e.visible=!0,e.isExplode=!0}),o.visibleSeries[0].points=n.concat(i.clubbedPoints),this.deExplodeAll(e,r),i.sumOfPoints=this.getSum(o.visibleSeries[0].points),o.refreshChart(),!1;if(s||t.isSliced){o.animateSeries=!1,n.splice(n.length-i.clubbedPoints.length,i.clubbedPoints.length);s=i.generateClubPoint();if(s.index=n.length,s.color=i.clubbedPoints[0].color,n.push(s),i.sumOfPoints=this.getSum(n),this.deExplodeAll(e,r),s.isExplode=!1,o.visibleSeries[0].points=n,o.refreshChart(),this.pointExplode(s.index,n[s.index],0,!0),s.isExplode=!1,this.deExplodeSlice(s.index,o.element.id+"_Series_0_Point_",r),t.isSliced)return!1}return!0},Y1e.prototype.pointExplode=function(e,t,i,n,o){var r=this.accumulation.element.id+"_Series_0_Point_",s=this.accumulation,s=this.isCircular()?jye(t.midAngle,s.explodeDistance,this.center):{x:t.labelRegion&&t.labelRegion.x<t.region.x?-s.explodeDistance:s.explodeDistance,y:0};this.isExplode(r+e)||n?(t.isExplode=!0,this.explodeSlice(e,s,r,this.center||{x:0,y:0},i,o)):(t.isExplode=!1,this.deExplodeSlice(e,r,i))},Y1e.prototype.isExplode=function(e){var e=ie(e),t=e?e.getAttribute("transform"):null;return e&&("translate(0, 0)"===t||null===t||"translate(0)"===t)},Y1e.prototype.deExplodeSlice=function(e,t,i){var n=ie(t+e),o=n?n.getAttribute("transform"):null;this.accumulation.enableAnimation&&n&&o&&"translate(0, 0)"!==o&&"translate(0)"!==o?(n=o.split("(")[1].split(")")[0].split(","),this.performAnimation(e,t,0,0,+n[0],+n[1]||0,i,!0)):this.performAnimation(e,t,0,0,0,0,i,!0)},Y1e.prototype.setTranslate=function(e,t,i,n){this.setElementTransform(t+e,i),this.setElementTransform(t+e+"_polygon",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+n),this.setElementTransform(t+"connector_"+e,i))},Y1e.prototype.setElementTransform=function(e,t){e=ie(e);e&&e.setAttribute("transform",t)},Y1e.prototype.explodeSlice=function(e,t,i,n,o,r){r&&ie(this.accumulation.element.id+"_Series_0_Point_"+e).getAttribute("transform")?this.setElementTransform(i+e,"translate("+(t.x-n.x)+", "+(t.y-n.y)+")"):this.performAnimation(e,i,0,0,t.x-n.x,t.y-n.y,o)},Y1e.prototype.performAnimation=function(t,i,n,o,r,s,e,a){var l,h,d=this,p=this.accumulation,c=i.split("_"),c=parseInt(i.split("_")[c.length-3],10),u=p.visibleSeries[c].points[t];if(e<=0)return this.setTranslate(t,i,"translate("+r+", "+s+")",u.transform),null;p="Pie"===this.accumulation.series[c].type&&this.accumulation.animateSeries&&this.accumulation.series[0].animation.enable?this.accumulation.series[0].animation.duration:0;new Vt({}).animate(Q("div"),{duration:e,delay:p,progress:function(e){l=c0e(e.timeStamp,n,r,e.duration),h=c0e(e.timeStamp,o,s,e.duration),d.setTranslate(t,i,"translate("+(a?r-l:l)+", "+(a?s-h:h)+")",u.transform)},end:function(){d.setTranslate(t,i,"translate("+(a?n:r)+", "+(a?n:s)+")",u.transform)}})};var G1e=Y1e;function Y1e(e){this.accumulation=e}X1e=function(e,t){return(X1e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}X1e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(J1e,K1e=G1e),J1e.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 n=[];this.isRadiusMapped=!0;for(var o=0;o<Object.keys(t.points).length;o++)-1!==t.points[o].sliceRadius.indexOf("%")?n[o]=ive(t.points[o].sliceRadius,this.size/2):n[o]=parseInt(t.points[o].sliceRadius,10);var i=Math.min.apply(null,n),r=Math.max.apply(null,n);this.pieBaseRadius=this.seriesRadius=r,this.innerRadius=ive(t.innerRadius,this.seriesRadius),this.innerRadius=this.innerRadius>i?this.innerRadius/2:this.innerRadius}else this.isRadiusMapped=!1,this.pieBaseRadius=ive(t.radius,this.size/2),this.innerRadius=ive(t.innerRadius,this.pieBaseRadius),this.pieBaseLabelRadius="Inside"===t.dataLabel.position?(this.pieBaseRadius-this.innerRadius)/2+this.innerRadius:this.pieBaseRadius+ive(t.dataLabel.connectorStyle.length||"4%",this.size/2);this.radius=this.pieBaseRadius,this.labelRadius=this.pieBaseLabelRadius,e.explodeDistance=t.explode?ive(t.explodeOffset,this.pieBaseRadius):0,this.findCenter(e,t),this.center=this.pieBaseCenter,e.redraw||this.defaultLabelBound(t,t.dataLabel.visible,t.dataLabel.position),this.totalAngle-=.001},J1e.prototype.getLabelRadius=function(e,t){return"Inside"===e.dataLabel.position?(ive(t.sliceRadius,this.pieBaseRadius)-this.innerRadius)/2+this.innerRadius:ive(t.sliceRadius,this.size/2)+ive(e.dataLabel.connectorStyle.length||"4%",this.size/2)},J1e.prototype.findCenter=function(e,t){this.accumulation=e,this.pieBaseCenter={x:ive(e.center.x,e.initialClipRect.width)+e.initialClipRect.x,y:ive(e.center.y,e.initialClipRect.height)+e.initialClipRect.y};e=this.getSeriesBound(t),t=new Tve(e.x+e.width/2,e.y+e.height/2);this.pieBaseCenter.x+=this.pieBaseCenter.x-t.x,this.pieBaseCenter.y+=this.pieBaseCenter.y-t.y,this.accumulation.origin=this.pieBaseCenter},J1e.prototype.initAngles=function(e){var t=je(e.endAngle)?e.startAngle:e.endAngle;this.totalAngle=(t-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},J1e.prototype.defaultLabelBound=function(e,t,i){var n=this.getSeriesBound(e);e.accumulationBound=n,e.labelBound=new Do(n.x,n.y,n.width+n.x,n.height+n.y),t&&"Outside"===i&&(e.labelBound=new Do(1/0,1/0,-1/0,-1/0))},J1e.prototype.getSeriesBound=function(e){var t=new Do(1/0,1/0,-1/0,-1/0),i=(this.initAngles(e),this.startAngle),n=this.totalAngle,o=0==(o=(this.startAngle+n)%360)?360:o,r=(e.findMaxBounds(t,this.getRectFromAngle(i)),e.findMaxBounds(t,this.getRectFromAngle(o)),e.findMaxBounds(t,new Do(this.pieBaseCenter.x,this.pieBaseCenter.y,0,0)),(90*Math.floor(i/90)+90)%360),s=0==(s=90*Math.floor(o/90)%360)?360:s;(90<=n||s===r)&&(e.findMaxBounds(t,this.getRectFromAngle(r)),e.findMaxBounds(t,this.getRectFromAngle(s))),(0===i||360<=i+n)&&e.findMaxBounds(t,this.getRectFromAngle(0));for(var a=r===s?0:Math.floor(n/90),l=1;l<a;l++)((r+=90)<s||o<i||360===n)&&e.findMaxBounds(t,this.getRectFromAngle(r));return t.width-=t.x,t.height-=t.y,t},J1e.prototype.getRectFromAngle=function(e){e=jye(e,this.pieBaseRadius,this.pieBaseCenter);return new Do(e.x,e.y,0,0)},J1e.prototype.getPathArc=function(e,t,i,n,o,r,s,a){var l=i-t,l=(l<0?360+l:l)<180?0:1;return o||0!==o?this.getDoughnutPath(e,jye(t,n,e),jye(i,n,e),n,jye(t,o,e),jye(i,o,e),o,l,r,s,a):this.getPiePath(e,jye(t,n,e),jye(i,n,e),n,l,r,a)},J1e.prototype.getPiePath=function(e,t,i,n,o,r,s){r=1===this.sliceCheck(s)?0:r;var s=Math.atan2(t.y-e.y,t.x-e.x),a=Math.atan2(i.y-e.y,i.x-e.x),l=(r=this.adjustCornerRadius(s,a,n,r),t.x-r*Math.cos(s)),h=t.y-r*Math.sin(s),d=i.x-r*Math.cos(Math.PI/2+a),p=i.y-r*Math.sin(Math.PI/2+a),c=i.x-r*Math.cos(a),i=i.y-r*Math.sin(a),a=t.x+r*Math.cos(Math.PI/2+s),t=t.y+r*Math.sin(Math.PI/2+s);return"M "+e.x+" "+e.y+" L "+l+" "+h+" A "+r+" "+r+" 0 0 1 "+a+" "+t+" A "+n+" "+n+" 0 "+o+" 1 "+d+" "+p+" A "+r+" "+r+" 0 0 1 "+c+" "+i+" Z"},J1e.prototype.getDoughnutPath=function(e,t,i,n,o,r,s,a,l,h,d){l=1===this.sliceCheck(d)?0:l;var d=Math.atan2(t.y-o.y,t.x-o.x),p=Math.atan2(i.y-r.y,i.x-r.x),c=(l=this.adjustCornerRadius(d,p,s,l),l=h&&0===this.innerRadius?-1*l:l,t.x-l*Math.cos(d)),u=t.y-l*Math.sin(d),g=i.x-l*Math.cos(Math.PI/2+p),m=i.y-l*Math.sin(Math.PI/2+p),f=r.x+l*Math.cos(p),y=r.y+l*Math.sin(p),v=o.x+l*Math.cos(Math.PI/2+d),b=o.y+l*Math.sin(Math.PI/2+d),w=t.x+l*Math.cos(Math.PI/2+d),t=t.y+l*Math.sin(Math.PI/2+d),C=i.x-l*Math.cos(p),i=i.y-l*Math.sin(p),S=r.x-l*Math.cos(Math.PI/2+p),r=r.y-l*Math.sin(Math.PI/2+p),p=o.x+l*Math.cos(d),o=o.y+l*Math.sin(d);return h?"M "+w+" "+t+" A "+n+" "+n+" 0 "+a+" 1 "+g+" "+m+" L "+S+" "+r+" A "+s+" "+s+" 0 "+a+" 0 "+v+" "+b+" Z":"M "+c+" "+u+" A "+l+" "+l+" 0 0 1 "+w+" "+t+" A "+n+" "+n+" 0 "+a+" 1 "+g+" "+m+" A "+l+" "+l+" 0 0 1 "+C+" "+i+" L "+f+" "+y+" A "+l+" "+l+" 0 0 1 "+S+" "+r+" A "+s+" "+s+" 0 "+a+" 0 "+v+" "+b+" A "+l+" "+l+" 0 0 1 "+p+" "+o+" Z"},J1e.prototype.adjustCornerRadius=function(e,t,i,n){t=Math.abs(t-e),e=(t=t>Math.PI?2*Math.PI-t:t)/(2*Math.PI);return Math.min(n,i*e)},J1e.prototype.sliceCheck=function(e){for(var t=0,i=0;i<e.length;i++)e[i].visible&&t++;return t},J1e.prototype.doAnimation=function(t,i,n,o,r){var s,a=this,l=i.startAngle-90,e=this.accumulation.duration||i.animation.duration,h=(this.pieBaseCenter.x+=1,.75*Math.max(this.accumulation.availableSize.height,this.accumulation.availableSize.width)),d=(h+=.414*h,p0e("Linear"));new Vt({}).animate(t,{duration:0===e&&"Enable"===Ut?1e3:e,delay:i.animation.delay,progress:function(e){s=d(e.timeStamp,l,a.totalAngle,e.duration),t.setAttribute("d",a.getPathArc(a.pieBaseCenter,l,s,h,0,o,!1,r))},end:function(){--a.pieBaseCenter.x,t.setAttribute("d",a.getPathArc(a.pieBaseCenter,0,359.99999,h,0,o,!1,r)),a.accumulation.trigger(_me,a.accumulation.isBlazor?{}:{series:i,accumulation:a.accumulation,chart:a.accumulation});var e=ie(a.accumulation.element.id+"_datalabel_Series_"+i.index),e=(e&&u0e(e,i.animation.delay,i.animation.duration,i,null,0,!1),n.style.cssText="",ie(a.accumulation.element.id+"_Annotation_Collections"));e&&(e.style.visibility="visible")}})};var X1e,K1e,F1e=J1e;function J1e(){return null!==K1e&&K1e.apply(this,arguments)||this}Z1e=function(e,t){return(Z1e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Z1e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(txe,$1e=F1e),txe.prototype.renderPoint=function(e,t,i,n,o,r,s,a,l){var h,d=t.sumOfPoints,p=this.accumulation.visibleSeries[0].points,c=t.borderRadius,u=(e.startAngle=this.startAngle,e.visible?e.y:0),u=d?Math.abs(u)/d*this.totalAngle:null,d=Math.PI/180*(90-(360-this.startAngle)-90);this.radius=this.isRadiusMapped?ive(e.sliceRadius,this.seriesRadius):this.radius,n.d=this.getPathOption(e,u,this.startAngle%360,c,p),e.midAngle=(this.startAngle-u/2)%360,e.endAngle=this.startAngle%360,e.symbolLocation=jye(e.midAngle,(this.radius+this.innerRadius)/2,this.center),r?(h=i.renderer.drawPath(n),!e.isExplode&&l&&h.setAttribute("transform","translate(0, 0)"),h.setAttribute("role",t.accessibility.accessibilityRole||"img"),h.setAttribute("tabindex",0===e.index&&t.accessibility.focusable?String(t.accessibility.tabIndex):"-1"),h.style.outline="none",h.setAttribute("aria-label",t.accessibility.accessibilityDescription||e.x+": "+e.y+"%. "+t.name),void 0===e.degree&&(e.degree=u,e.start=d),o.appendChild(h),this.refresh(e,u,d,i,n,c,p,s,a,l)):((h=i.renderer.drawPath(n)).setAttribute("role",t.accessibility.accessibilityRole||"img"),h.setAttribute("tabindex",0===e.index&&t.accessibility.focusable?String(t.accessibility.tabIndex):"-1"),h.style.outline="none",h.setAttribute("aria-label",t.accessibility.accessibilityDescription||e.x+": "+e.y+"%. "+t.name),o.appendChild(h),e.degree=u,e.start=d)},txe.prototype.findSeries=function(e,t){var i=0===this.innerRadius?this.radius+3:this.innerRadius-3,n=0===this.innerRadius?i+2:i-2;this.toggleInnerPoint(e,i,n,t)},txe.prototype.toggleInnerPoint=function(e,t,i,n){var o=Kye(e.target.id,!0),r=e.target.id.substring(0,e.target.id.indexOf("Series")-1),s=document.getElementById(this.accumulation.element.id+"PointHover_Border"),a=this.accumulation.visibleSeries[0].points,l=o.series,h=o.point,d=ie(r+"_Series_"+l+"_Point_"+h);!isNaN(o.series)&&d?je(l)||isNaN(l)||je(h)||isNaN(h)||(o=this.accumulation.visibleSeries[0].points[h],h=d.getAttribute("class")===r+"_ej2_deselected"?this.accumulation.tooltip.enable?.5:.3:this.accumulation.tooltip.enable?.5:1,t=this.getPathArc(this.accumulation.pieSeriesModule.center,o.startAngle%360,(o.startAngle+o.degree)%360,t,i,n,!0,a),s&&r===this.accumulation.element.id&&(s.getAttribute("d")!==t||o.isExplode)&&(s.parentNode.removeChild(s),s=null),i=ie(r+"_Series_"+l),s)||o.isExplode&&(!o.isExplode||"click"===e.type)||(n=new No(r+"PointHover_Border",o.color,1,o.color,h,"",t),(a=this.accumulation.renderer.drawPath(n)).removeAttribute("transform"),"None"!==this.accumulation.selectionMode&&e.target.hasAttribute("class")&&this.accumulation.accumulationSelectionModule.addSvgClass(a,e.target.getAttribute("class")),i.appendChild(a),o.isExplode&&a&&(l=d.getAttribute("transform"))&&a.setAttribute("transform",l)):s&&this.removeBorder(s,1e3)},txe.prototype.removeBorder=function(e,t){e&&setTimeout(function(){e.parentNode&&e.parentNode.removeChild(e)},t)},txe.prototype.refresh=function(r,s,a,l,e,h,d,p,c,u){var g=this,m=ie(e.id),t=l.duration||300;new Vt({}).animate(Q("div"),{duration:t,delay:0,progress:function(e){var t,i,n=c0e(e.timeStamp,r.degree,s-r.degree,e.duration),o=(c0e(e.timeStamp,r.start,a-r.start,e.duration)/(Math.PI/180)+360)%360;p&&c?(t=c0e(e.timeStamp,p,g.radius-p,e.duration),i=c0e(e.timeStamp,c.x,g.center.x-c.x,e.duration),e=c0e(e.timeStamp,c.y,g.center.y-c.y,e.duration),m.setAttribute("d",g.getPathOption(r,n,o,h,d,t,i,e))):m.setAttribute("d",g.getPathOption(r,n,o,h,d)),r.isExplode&&l.accBaseModule.explodePoints(r.index,l,!0,u),m.style.visibility="visible"},end:function(){m.style.visibility=r.visible?"visible":"hidden",m.setAttribute("d",e.d),r.degree=s,r.start=a}})},txe.prototype.getPathOption=function(e,t,i,n,o,r,s,a){return t?(s=this.getPathArc(s?{x:s,y:a}:this.center,i%360,(i+t)%360,this.isRadiusMapped?ive(e.sliceRadius,this.size/2):r||this.radius,this.innerRadius,n,!1,o),this.startAngle+=t,s):""},txe.prototype.animateSeries=function(e,t,i,n,o,r){var s,a=e.element.id+"SeriesGroup"+i.index;(i.animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&e.animateSeries&&(s=e.renderer.createClipPath({id:a+"_clipPath"}),a=new No(a+"_slice","transparent",1,"transparent",1,"",""),a=e.renderer.drawPath(a),s.appendChild(a),e.svgObject.appendChild(s),n.style.cssText="clip-path:url(#"+s.id+"); -webkit-clip-path:url(#"+s.id+");",this.doAnimation(a,i,n,o,r))},txe.prototype.getModuleName=function(){return"PieSeries"},txe.prototype.destroy=function(){};var Z1e,$1e,exe=txe;function txe(){return null!==$1e&&$1e.apply(this,arguments)||this}ixe=function(e,t){return(ixe=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])}))(e,t)};var ixe,nxe,F1e=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},oxe=(function(e,t){function i(){this.constructor=e}ixe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(rxe,nxe=Ji),rxe.prototype.animate=function(e){this.duration=0===e&&"Enable"===Ut?700:e,this.animateselected=!0,this.animateSeries=!1;var i=0,n=[],o=[],r=[],t=this.visibleSeries[0],s=[],s=t.dataSource;if(t.sumOfPoints=0,t.points.length<Object.keys(t.dataSource).length)this.refresh();else{if(t.points.length>Object.keys(t.dataSource).length){for(var a=this.visibleSeries[0],e=(a.points=a.points.filter(function(t){return t.visible=!1,o.push(t.index),n.push(t.color),s.some(function(e){return t.x===e.x&&(t.visible=!0,r.push(t.index),t.index=i,i++),t.x===e.x})}),o.filter(function(e){return r.indexOf(e)<0})),l=o.length-e.length,h=o.length-1;l<=h;h--)Pye("container_Series_0_Point_"+o[h]);for(h=0;h<a.points.length;h++)a.points[h].y=a.dataSource[h].y,a.points[h].color=n[h],a.sumOfPoints+=a.dataSource[h].y;this.redraw=this.enableAnimation,this.animateSeries=!1,this.calculateBounds()}else{for(h=0;h<t.points.length;h++)t.points[h].y=t.dataSource[h][t.yName],t.points[h].color=null!=t.dataSource[h][t.pointColorMapping]?t.dataSource[h][t.pointColorMapping]:t.points[h].color,t.sumOfPoints+=t.dataSource[h][t.yName];this.redraw=this.enableAnimation,this.animateSeries=!1,this.removeSvg(),this.refreshPoints(t.points)}this.renderElements()}},Object.defineProperty(rxe.prototype,"type",{get:function(){return this.series&&this.series.length?this.series[0].type:"Pie"},enumerable:!0,configurable:!0}),rxe.prototype.preRender=function(){var e;this.isBlazor=window.Blazor,this.allowServerDataBinding=!1,this.unWireEvents(),this.setCulture(),this.animateSeries=!0,""===this.element.id&&(e=document.getElementsByClassName("e-accumulationchart").length,this.element.id="acc_chart_"+this.chartid+"_"+e),this.wireEvents(),this.element.setAttribute("dir",this.enableRtl?"rtl":"ltr"),this.element.style.outline="none"},rxe.prototype.setTheme=function(){this.themeStyle=_ve(this.theme,!1,this)},rxe.prototype.render=function(){var e=this,t=(-1===this.element.className.indexOf("e-accumulationchart")&&this.element.classList.add("e-accumulationchart"),this.element.setAttribute("role",this.accessibility.accessibilityRole||"region"),this.element.setAttribute("tabindex",this.accessibility.focusable?String(this.accessibility.tabIndex):"-1"),this.element.setAttribute("aria-label",this.accessibility.accessibilityDescription||this.title+". Syncfusion interactive chart."),this.element.setAttribute("class",this.element.getAttribute("class")+" e-accumulationchart-focused"),{chart:this.isBlazor?{}:this,accumulation:this.isBlazor?{}:this,theme:this.theme,name:Vme,cancel:!1});this.trigger(Vme,t,function(){e.theme=(e.isBlazor?t:e).theme,e.setTheme(),e.accBaseModule=new G1e(e),e.pieSeriesModule=new exe(e),e.calculateVisibleSeries(),e.processData(),e.renderComplete(),e.allowServerDataBinding=!0})},rxe.prototype.unWireEvents=function(){var e=F.isPointer,t=F.touchStartEvent,i=F.touchMoveEvent,n=F.touchEndEvent,e=e?"pointerleave":"mouseleave";E.remove(this.element,i,this.accumulationMouseMove),E.remove(this.element,n,this.accumulationMouseEnd),E.remove(this.element,t,this.accumulationMouseStart),E.remove(this.element,"click",this.accumulationOnMouseClick),E.remove(this.element,"dblclick",this.accumulationOnDoubleClick),E.remove(this.element,"contextmenu",this.accumulationRightClick),E.remove(this.element,e,this.accumulationMouseLeave),E.remove(this.element,"keydown",this.accumulationChartKeyDown),E.remove(document.body,"keydown",this.documentKeyHandler),E.remove(this.element,"keyup",this.accumulationChartKeyUp),window.removeEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.accumulationResizeBound)},rxe.prototype.wireEvents=function(){var e,t,i,n;this.element&&(n=F.isPointer,e=F.touchStartEvent,t=F.touchEndEvent,i=F.touchMoveEvent,n=n?"pointerleave":"mouseleave",E.add(this.element,i,this.accumulationMouseMove,this),E.add(this.element,t,this.accumulationMouseEnd,this),E.add(this.element,e,this.accumulationMouseStart,this),E.add(this.element,"click",this.accumulationOnMouseClick,this),E.add(this.element,"dblclick",this.accumulationOnDoubleClick,this),E.add(this.element,"contextmenu",this.accumulationRightClick,this),E.add(this.element,n,this.accumulationMouseLeave,this),E.add(this.element,"keydown",this.accumulationChartKeyDown,this),E.add(document.body,"keydown",this.documentKeyHandler,this),E.add(this.element,"keyup",this.accumulationChartKeyUp,this),this.accumulationResizeBound=this.accumulationResize.bind(this),window.addEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.accumulationResizeBound),new Mn(this.element),this.setStyle(this.element))},rxe.prototype.setMouseXY=function(e){var t,i,n,o=ie(this.element.id+"_svg");o&&this.element&&(o=o.getBoundingClientRect(),t=this.element.getBoundingClientRect(),-1<e.type.indexOf("touch")?(this.isTouch=!0,i=e.changedTouches[0].clientY,n=e.changedTouches[0].clientX):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType,n=e.clientX,i=e.clientY),this.mouseY=i-t.top-Math.max(o.top-t.top,0),this.mouseX=n-t.left-Math.max(o.left-t.left,0))},rxe.prototype.accumulationMouseEnd=function(e){return this.setMouseXY(e),this.trigger(ofe,{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.centerLabel.hoverTextFormat&&this.updateCenterLabel(e),this.notify(F.touchEndEvent,e),!1},rxe.prototype.accumulationMouseStart=function(e){return this.setMouseXY(e),this.trigger(nfe,{target:e.target.id,x:this.mouseX,y:this.mouseY}),!1},rxe.prototype.accumulationResize=function(){var e=this,t=(this.animateSeries=!1,{accumulation:this.isBlazor?{}:this,previousSize:new Eo(this.availableSize.width,this.availableSize.height),name:lfe,currentSize:new Eo(0,0),chart:this.isBlazor?{}:this}),i={name:"beforeResize",cancelResizedEvent:!1};return this.resizeTo&&clearTimeout(this.resizeTo),this.trigger(hfe,i),i.cancelResizedEvent||(this.resizeTo=+setTimeout(function(){e.isDestroyed?clearTimeout(e.resizeTo):(ave(e),t.currentSize=e.availableSize,e.trigger(lfe,t),e.refreshSeries(),e.refreshChart())},500)),!1},rxe.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 zbe(this).print(e),document.getElementById(this.element.id+"_Series_0").style.clipPath=t},rxe.prototype.export=function(e,t){this.exportModule&&(this.exportModule.export(e,t),this.afterExport)&&this.exportModule.getDataUrl(this)},rxe.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",e.style.height=e.style.height||this.height&&-1===this.height.indexOf("%")?e.style.height:"inherit",this.theme},rxe.prototype.setAnnotationValue=function(e,t){var i=this.annotations[e],n=ie(this.element.id+"_Annotation_Collections");t&&(i.content=t,n?(t=this.createElement("div"),Pye(this.element.id+"_Annotation_"+e),this.annotationModule.processAnnotation(i,e,t),n.appendChild(t.children[0])):this.annotationModule.renderAnnotations(ie(this.element.id+"_Secondary_Element")))},rxe.prototype.accumulationMouseMove=function(e){return ie(this.element.id+"_svg")&&(this.setMouseXY(e),this.trigger(Kme,{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.pointMove&&this.triggerPointEvent(tfe,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.centerLabel.hoverTextFormat&&this.updateCenterLabel(e),this.isTouch||this.titleTooltip(e,this.mouseX,this.mouseY),this.enableBorderOnMouseMove&&"Pie"===this.type&&this.pieSeriesModule&&o0e(this.mouseX,this.mouseY,this.initialClipRect)&&this.pieSeriesModule.findSeries(e,this.series[0].borderRadius),this.notify(F.touchMoveEvent,e)),!1},rxe.prototype.titleTooltip=function(e,t,i,n){var o=e.target.id,r=o===this.element.id+"_title"||o===this.element.id+"_subTitle"||o===this.element.id+"_chart_legend_title";-1<e.target.textContent.indexOf("...")&&r?Fye(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",ie(this.element.id+"_Secondary_Element"),n):Pye(this.element.id+"_EJ2_Title_Tooltip")},rxe.prototype.accumulationChartKeyDown=function(e){var t="";return this.tooltip.enable&&("Tab"===e.code&&-1<this.previousTargetId.indexOf("Series")||"Escape"===e.code)&&(t="ESC"),-1<e.code.indexOf("Arrow")&&e.preventDefault(),e.ctrlKey&&"p"===e.key&&(e.preventDefault(),t="CtrlP"),""!==t&&this.chartKeyboardNavigations(e,e.target.id,t),"Tab"===e.code&&this.removeNavigationStyle(),!1},rxe.prototype.accumulationChartKeyUp=function(e){var t,i="",n=e.target.id,o=ie(this.element.id+"_chart_legend_translate_g"),r=ie(this.element.id+"_chart_legend_pageup");if(o&&((s=(t=o.firstElementChild).getAttribute("class"))&&-1===s.indexOf("e-accumulationchart-focused")?s+=" e-accumulationchart-focused":s=s||"e-accumulationchart-focused",t.setAttribute("class",s)),r&&r.setAttribute("class","e-accumulationchart-focused"),this.removeNavigationStyle(),"Tab"===e.code)""!==this.previousTargetId&&(-1<this.previousTargetId.indexOf("_Point_")&&-1===n.indexOf("_Point_")?(t=document.getElementById(this.previousTargetId).parentElement,this.setTabIndex(t.children[this.currentPointIndex],t.firstElementChild),this.currentPointIndex=0):-1<this.previousTargetId.indexOf("_chart_legend_page")&&-1===n.indexOf("_chart_legend_page")&&-1===n.indexOf("_chart_legend_g_")?this.setTabIndex(e.target,r):-1<this.previousTargetId.indexOf("_chart_legend_g_")&&-1===n.indexOf("chart_legend_g_")&&o&&this.setTabIndex(o.children[this.currentLegendIndex],o.firstElementChild)),-1<(this.previousTargetId=n).indexOf("_chart_legend_g_")&&"None"!==this.highlightMode?(n=e.target.lastElementChild.id,i="Tab"):-1<n.indexOf("_Point_")&&("None"!==this.highlightMode||this.tooltip.enable)&&(i="Tab");else if(-1<e.code.indexOf("Arrow")){if(e.preventDefault(),-1<n.indexOf("_chart_legend_page"))e.target.removeAttribute("tabindex"),this.previousTargetId=n=this.element.id+"_chart_legend_page"+("ArrowRight"===e.code?"up":"down"),this.focusTarget(ie(n));else if(-1<n.indexOf("_chart_legend_")&&o){e.target.removeAttribute("tabindex"),this.currentLegendIndex+="ArrowUp"===e.code||"ArrowRight"===e.code?1:-1,this.currentLegendIndex=this.getActualIndex(this.currentLegendIndex,o.children.length);var s=o.children[this.currentLegendIndex];this.focusTarget(s),this.removeNavigationStyle(),this.setNavigationStyle(s.id),this.previousTargetId=n=s.lastElementChild.id,i="None"!==this.highlightMode?"ArrowMove":""}else if(-1<n.indexOf("_Point_")){e.target.setAttribute("tabindex","-1"),this.currentPointIndex+="ArrowUp"===e.code||"ArrowRight"===e.code?1:-1;for(var a=0,l=0;l<e.target.parentElement.children.length;l++)a=-1<e.target.parentElement.children[l].id.indexOf("_Point_")?a+1:a;this.currentPointIndex=this.getActualIndex(this.currentPointIndex,a),n=this.element.id+"_Series_0_Point_"+this.currentPointIndex,this.focusTarget(ie(n)),this.removeNavigationStyle(),this.setNavigationStyle(n),i=this.tooltip.enable?"ArrowMove":""}}else"Enter"!==e.code&&"Space"!==e.code||!(-1<n.indexOf("_chart_legend_")||-1<n.indexOf("_Point_"))||(n=-1<n.indexOf("_chart_legend_g")?e.target.lastElementChild.id:n,i="Enter");return""!==i&&this.chartKeyboardNavigations(e,n,i),"Tab"===e.code&&this.setNavigationStyle(n),!1},rxe.prototype.setTabIndex=function(e,t){e&&e.removeAttribute("tabindex"),t&&t.setAttribute("tabindex","0")},rxe.prototype.getActualIndex=function(e,t){return t-1<e?0:e<0?t-1:e},rxe.prototype.focusTarget=function(e){var t=e.getAttribute("class");return e.setAttribute("tabindex","0"),t&&-1===t.indexOf("e-accumulationchart-focused")?t+=" e-accumulationchart-focused":t=t||"e-accumulationchart-focused",e.setAttribute("tabindex","0"),e.setAttribute("class",t),e.focus(),e.id},rxe.prototype.documentKeyHandler=function(e){e.altKey&&74===e.keyCode&&!je(this.element)&&this.element.focus()},rxe.prototype.setNavigationStyle=function(e){e=document.getElementById(e);e&&(e.style.setProperty("outline",this.focusBorderWidth+"px solid "+(this.focusBorderColor||this.themeStyle.tabColor)),e.style.setProperty("margin",this.focusBorderMargin+"px"))},rxe.prototype.removeNavigationStyle=function(){var e=document.querySelectorAll("path[id*=_Series_0_Point_], [id*="+this.element.id+"], [id*=_ChartBorder], text[id*=_title],g[id*=_chart_legend]");e&&e.forEach(function(e){(e instanceof HTMLElement||e instanceof SVGElement)&&(e.style.setProperty("outline","none"),e.style.setProperty("margin",""))})},rxe.prototype.chartKeyboardNavigations=function(e,t,i){switch(this.isLegendClicked=!1,i){case"Tab":case"ArrowMove":if(this.accumulationHighlightModule,-1<t.indexOf("_Point_")){var n=+t.split("_Series_")[1].split("_Point_")[0],o=+t.split("_Series_")[1].replace("_Symbol","").split("_Point_")[1],r=this.visibleSeries[n].points[o].symbolLocation;if(this.mouseX=r.x+this.initialClipRect.x,this.mouseY=r.y+this.initialClipRect.y,this.accumulationHighlightModule){var r=ie(t);if(!je(r))return(r=1<r.id.indexOf("text")?ie(r.id.replace("text","shape")):r).hasAttribute("class")&&-1<r.getAttribute("class").indexOf("highlight")?void 0:void this.accumulationHighlightModule.calculateSelectedElements(this,r,"mousemove")}this.accumulationTooltipModule&&(r=void 0,(n=this.visibleSeries[n]).enableTooltip&&(r=new kve(n.points[o],n)),this.accumulationTooltipModule.renderSeriesTooltip(this,r))}if(this.accumulationHighlightModule&&"None"!==this.highlightMode){t=-1<t.indexOf("_chart_legend_g_")?document.getElementById(t).firstChild.id:t;for(var o=this.element.id+"_chart_legend",s=[o+"_text_",o+"_shape_marker_",o+"_shape_"],a=0;a<s.length;a++){var l=s[a];if(-1<t.indexOf(l)){document.getElementById(t).setAttribute("class",""),this.accumulationHighlightModule.legendSelection(this,0,parseInt(t.split(l)[1],10),ie(t),"mousemove");break}}}break;case"Enter":case"Space":-1<t.indexOf("_chart_legend_")&&this.accumulationLegendModule?(this.isLegendClicked=!0,this.accumulationLegendModule.click(e),this.focusChild(document.getElementById(t).parentElement),this.setNavigationStyle(document.getElementById(t).parentElement.id)):(this.accumulationSelectionModule&&this.accumulationSelectionModule.calculateSelectedElements(this,document.getElementById(t),"click"),this.setNavigationStyle(t));break;case"CtrlP":this.print();break;case"ESC":this.accumulationTooltipModule&&this.accumulationTooltipModule.removeTooltip(1)}},rxe.prototype.focusChild=function(e){e.setAttribute("tabindex","0");var t=e.getAttribute("class");return e.setAttribute("tabindex","0"),t=t&&-1===t.indexOf("e-accumulationchart-focused")?"e-accumulationchart-focused "+t:t||"e-accumulationchart-focused",e.setAttribute("class",t),e.focus(),e.id},rxe.prototype.accumulationOnDoubleClick=function(e){return this.trigger(Zme,{target:e.target.id,x:this.mouseX,y:this.mouseY}),!1},rxe.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.target,e.type),this.visibleSeries[0].explode&&this.accBaseModule.processExplode(e),this.enableBorderOnMouseMove&&this.pieSeriesModule&&"Pie"===this.type&&this.pieSeriesModule.findSeries(e,this.series[0].borderRadius),this.trigger(Jme,{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.pointClick&&this.triggerPointEvent($me,e.target,e),this.removeNavigationStyle(),!1},rxe.prototype.triggerPointEvent=function(e,t,i){t=Kye(t.id,!0);0<=t.series&&0<=t.point&&this.trigger(e,{series:this.isBlazor?{}:this.series[t.series],point:this.series[t.series].points[t.point],seriesIndex:t.series,pointIndex:t.point,x:this.mouseX,y:this.mouseY,pageX:i.pageX,pageY:i.pageY})},rxe.prototype.accumulationRightClick=function(e){return 2!==e.buttons||"touch"!==e.pointerType||(e.preventDefault(),e.stopPropagation(),!1)},rxe.prototype.accumulationMouseLeave=function(e){this.setMouseXY(e),this.trigger(ife,{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.notify(F.isPointer?"pointerleave":"mouseleave",e);e=document.getElementById(this.element.id+"PointHover_Border");return e&&(this.pieSeriesModule.removeBorder(e,1e3),0),!1},rxe.prototype.setCulture=function(){this.intl=new Ti},rxe.prototype.createPieSvg=function(){this.removeSvg(),lve(this)},rxe.prototype.removeSvg=function(){if(this.redraw)return null;if(gve(this),Pye(this.element.id+"_Secondary_Element"),this.svgObject){for(;0<this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&ue(this.svgObject)}Pye("EJ2_legend_tooltip"),Pye("EJ2_datalabel_tooltip"),Pye(this.element.id+"PointHover_Border")},rxe.prototype.createSecondaryElement=function(){var e=nve(this.redraw,this.element.id+"_Secondary_Element")||this.createElement("div",{id:this.element.id+"_Secondary_Element",styles:"position: relative"});O0e(!1,this.element,e,this.redraw)},rxe.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}},rxe.prototype.processData=function(e){void 0===e&&(e=!0);for(var t=this.seriesCounts=0,i=this.visibleSeries;t<i.length;t++){var n=i[t];n.dataModule=new Cbe(n.dataSource||this.dataSource,n.query),n.refreshDataManager(this,e)}},rxe.prototype.refreshChart=function(){this.doGrouppingProcess(),this.createPieSvg(),this.calculateBounds(),this.renderElements(),Pye("chartmeasuretext")},rxe.prototype.doGrouppingProcess=function(){var e=this.visibleSeries[0];je(e.resultData)||je(e.lastGroupTo)||e.lastGroupTo===e.groupTo||e.getPoints(e.resultData,this)},rxe.prototype.calculateBounds=function(){this.initialClipRect=new Do(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height),this.titleCollection=[],this.subTitleCollection=[];var e,t=0;if(this.title&&(this.titleCollection=hve(this.title,this.titleStyle,this.initialClipRect.width,this.enableRtl,this.themeStyle.chartTitleFont)),e=this.title?So(this.title,this.titleStyle,this.themeStyle.chartTitleFont).height*this.titleCollection.length:0,this.subTitle){for(var i=0,n=this.titleCollection;i<n.length;i++)So(n[i],this.titleStyle,this.themeStyle.chartSubTitleFont).width;this.subTitleCollection=hve(this.subTitle,this.subTitleStyle,this.initialClipRect.width,this.enableRtl,this.themeStyle.chartSubTitleFont),t=So(this.subTitle,this.subTitleStyle,this.themeStyle.chartSubTitleFont).height*this.subTitleCollection.length}var o=this.margin.left+this.border.width,r=this.availableSize.width-o-this.margin.right-this.border.width,s=this.margin.top+this.border.width,a=this.availableSize.height-s-this.border.width-this.margin.bottom,l=t+e;switch(this.titleStyle.position){case"Top":o=0,s=t+e,r=this.margin.right+this.margin.left,a=this.margin.bottom+this.margin.top;break;case"Bottom":a-=l+2*this.margin.bottom;break;case"Left":o+=l,r-=l;break;case"Right":r-=l}"Top"!==this.titleStyle.position?this.initialClipRect=new Do(o,s,r,a):this.initialClipRect=zye(this.initialClipRect,new Do(o,s,r,a)),this.calculateLegendBounds()},rxe.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)},rxe.prototype.renderElements=function(){this.renderBorder(),this.createSecondaryElement(),this.renderSeries(),this.renderTitle(),this.renderCenterLabel(!0),this.renderLegend(),O0e(!1,this.element,this.svgObject,this.redraw),this.processSelection(),this.processExplode(),this.renderAnnotation(),this.setSecondaryElementPosition(),ro(this.element.id+"_DataLabel","Template",this.series[0].dataLabel),this.trigger("loaded",{accumulation:this.isBlazor?{}:this,chart:this.isBlazor?{}:this}),this.animateSeries=!1},rxe.prototype.setSecondaryElementPosition=function(){var e,t,i=ie(this.element.id+"_Secondary_Element");i&&(e=this.element.getBoundingClientRect(),t=ie(this.element.id+"_svg").getBoundingClientRect(),i.style.left=Math.max(t.left-e.left,0)+"px",i.style.top=Math.max(t.top-e.top,0)+"px")},rxe.prototype.renderAnnotation=function(){this.annotationModule&&this.annotationModule.renderAnnotations(ie(this.element.id+"_Secondary_Element"))},rxe.prototype.processExplode=function(){return!this.redraw&&this.visibleSeries[0].explode?void this.accBaseModule.invokeExplode():null},rxe.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[l0e(i.type)+"SeriesModule"]&&(this[l0e(i.type)+"SeriesModule"].initProperties(this,i),i.renderSeries(this,this.redraw))}},rxe.prototype.renderBorder=function(){var e=this.border.width,t=new vve(this.element.id+"_border",this.background||this.themeStyle.background,this.border,1,new Do(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e),0,0,"",this.border.dashArray),t=this.renderer.drawRectangle(t),t=(t.setAttribute("aria-hidden","true"),O0e(!1,this.svgObject,t,this.redraw),this.backgroundImage);t&&(e=new Cve(this.availableSize.height-e,this.availableSize.width-e,t,0,0,this.element.id+"_background","visible","none"),O0e(!1,this.svgObject,this.renderer.drawImage(e),this.redraw))},rxe.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))},rxe.prototype.processSelection=function(){var e=[];this.accumulationSelectionModule&&"None"!==this.selectionMode&&(e=Pe([],this.accumulationSelectionModule.selectedDataIndexes,null,!0),this.accumulationSelectionModule.invokeSelection(this)),this.accumulationHighlightModule&&"None"!==this.highlightMode&&this.accumulationHighlightModule.invokeHighlight(this),0<e.length&&(this.accumulationSelectionModule.selectedDataIndexes=e,this.accumulationSelectionModule.redrawSelection(this))},rxe.prototype.renderTitle=function(){var e=this.margin;if(!this.title)return null;var t,i=Nve(this.titleStyle.textAlignment,this.enableRtl),n=So(this.title,this.titleStyle,this.themeStyle.chartTitleFont),o=this.margin.top+3*n.height/4,r=void 0!==this.accumulationLegendModule&&"Top"===this.legendSettings.position?this.accumulationLegendModule.legendBounds.height:0,s=0===this.explodeDistance?0:this.explodeDistance,s=0!==r?0:s/2,a=new Do(e.left,0,this.availableSize.width-e.left-e.right,0),l=this.margin.top+3*n.height/4,h=dve(a,this.titleStyle||this.themeStyle.chartTitleFont),d=this.titleStyle.textAlignment,p=So(this.subTitle,this.subTitleStyle,this.themeStyle.chartSubTitleFont);switch(this.titleStyle.position){case"Top":h=dve(a,this.titleStyle),l=o;break;case"Bottom":h+="start"===i||"end"===i?this.border.width:0,l=this.availableSize.height-this.margin.bottom-p.height-n.height/2;break;case"Left":h=this.margin.left+3*n.height/4,l="Near"===d?e.bottom+this.border.width:"Far"===d?this.availableSize.height-e.bottom-this.border.width:this.availableSize.height/2,i="Near"===d?"end":"Far"===d?"start":"middle",i=this.enableRtl?"end"===i?"start":"start"===i?"end":i:i,t="rotate(-90,"+h+","+l+")";break;case"Right":h=this.availableSize.width-this.margin.right-3*n.height/4,l="Near"===d?e.bottom+this.border.width:"Far"===d?this.availableSize.height-e.bottom-this.border.width:this.availableSize.height/2,i="Near"===d?"start":"Far"===d?"end":"middle",i=this.enableRtl?"end"===i?"start":"start"===i?"end":i:i,t="rotate(90,"+h+","+l+")";break;case"Custom":h=this.titleStyle.x,l=this.titleStyle.y,i="middle"}var c=new ko(this.element.id+"_title",h,l,i,this.titleCollection,t,"auto"),u="Pie"===this.series[0].type&&"Outside"===this.visibleSeries[0].dataLabel.position&&this.visibleSeries[0].dataLabel.connectorStyle.length?ive(this.visibleSeries[0].dataLabel.connectorStyle.length,this.accBaseModule.radius):0,s=(this.subTitle||"Funnel"===this.series[0].type||"Pyramid"===this.series[0].type||(c.y=80<=parseInt(this.series[0].radius,10)?c.y:this.accBaseModule.center.y-this.accBaseModule.radius-20-o-r-s-u,"Pie"===this.series[0].type&&(parseInt(this.series[0].radius,10)<80||isNaN(parseInt(this.series[0].radius,10)))&&(c.y=c.y<this.initialClipRect.y-r?this.initialClipRect.y-r:c.y)),sve(this.renderer,c,this.titleStyle,this.titleStyle.color||this.themeStyle.chartTitleFont.color,this.svgObject,!1,this.redraw,null,null,null,null,0,null,null,null,this.themeStyle.chartTitleFont));s&&(s.setAttribute("tabindex","0"),s.style.outline="none",s.parentNode.insertBefore(s,this.svgObject.children&&this.svgObject.children[1])),this.subTitle&&this.renderSubTitle(c)},rxe.prototype.updateCenterLabel=function(e){e=this.getPieData(e);this.format=null==e.point?"":this.parseFormat(e.point,this.visibleSeries[0],this.centerLabel.hoverTextFormat),this.renderCenterLabel()},rxe.prototype.getPieData=function(e){e=Kye(e.target.id,!0);return isNaN(e.series)?new kve(null,null):new kve(this.visibleSeries[0].points[e.point],this.visibleSeries[0])},rxe.prototype.parseFormat=function(e,t,i){for(var n,o=RegExp,r=0,s=Object.keys(e);r<s.length;r++){var a=new o("${point."+(l=s[r])+"}","gm");i=i.replace(a.source,e[l])}for(var l,h=0,d=Object.keys(Object.getPrototypeOf(t));h<d.length;h++)a=new o("${series."+(l=d[h])+"}","gm"),n=t[l],i=i.replace(a.source,n);return i},rxe.prototype.renderCenterLabel=function(e,t){var i=this;if(!this.centerLabel.text||"Pie"!==this.type)return null;for(var n,o=[],r=(t&&ie(this.element.id+"_centerLabel").querySelectorAll("tspan").forEach(function(e){o.push({x:e.getAttribute("x"),y:e.getAttribute("y")})}),this.series[0]),s=Nve(this.centerLabel.textStyle.textAlignment,this.enableRtl),a=this.pieSeriesModule.innerRadius?2*this.pieSeriesModule.innerRadius*.7071067:2*this.pieSeriesModule.radius*.7071067,l=(this.format||this.centerLabel.text).split("<br>"),h=So(l[0],this.centerLabel.textStyle,this.themeStyle.chartTitleFont),d=l.length,p=0;p<d;p++)So(l[p],this.centerLabel.textStyle,this.themeStyle.chartTitleFont).width>a&&l.splice.apply(l,[p,1].concat(pve(l[p],a,this.centerLabel.textStyle,this.enableRtl,null,null,this.themeStyle.chartTitleFont)));h.height*l.length>a?n=this.accBaseModule.center.y+(h.height+10)/2-a/2:r.startAngle&&r.endAngle&&180===Math.abs(r.endAngle-r.startAngle)?(n=this.accBaseModule.center.y-h.height*l.length/2+(h.height+10)/2-this.pieSeriesModule.innerRadius/2+(this.pieSeriesModule.innerRadius?10:0),h.height*l.length+this.pieSeriesModule.innerRadius/2+10>a&&(n=this.accBaseModule.center.y+(h.height+10)/2-a/2)):n=1<l.length?this.accBaseModule.center.y-h.height*l.length/2+(h.height+10)/2:this.accBaseModule.center.y+h.height/4;for(var c=new ko(this.element.id+"_centerLabel",(this.series[0].animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&e?this.pieSeriesModule.center.x-1:this.pieSeriesModule.center.x,n,s,"","","auto"),u=sve(this.renderer,c,this.centerLabel.textStyle,this.centerLabel.textStyle.color||this.themeStyle.chartTitleFont.color,this.svgObject,!1,this.redraw,null,null,null,null,0,null,null,null,this.themeStyle.chartTitleFont),g=[],p=0;p<l.length;p++){var m={x:c.x,y:c.y+p*h.height,fill:""},m=this.renderer.createTSpan(m,"");m.style.fontFamily="inherit",m.style.fontStyle="inherit",m.style.fontSize="inherit",m.style.fontWeight=-1<l[p].indexOf("<b>")||-1<l[p].indexOf("</b>")?"bold":"inherit",m.textContent=l[p].replace(/<\/?b>/g,""),u.appendChild(m),g.push(m)}t&&g.forEach(function(e,t){i.animateTspan(e,Number(o[t].x),Number(o[t].y),Number(e.getAttribute("x")),Number(e.getAttribute("y")),i.duration)}),e&&(this.series[0].animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&this.animateSeries&&this.centerLabelDelay(u)},rxe.prototype.animateTspan=function(i,n,o,r,s,e){new Vt({}).animate(i,{duration:e,progress:function(e){i.style.animation="";var e=e.timeStamp/e.duration,t=n+(r-n)*e,e=o+(s-o)*e;i.setAttribute("x",t.toString()),i.setAttribute("y",e.toString())},end:function(){i.setAttribute("x",r.toString()),i.setAttribute("y",s.toString())}})},rxe.prototype.centerLabelDelay=function(e){e.style.visibility="hidden",new Vt({}).animate(e,{delay:this.duration||this.series[0].animation.duration,progress:function(e){e.element.style.visibility="visible"}})},rxe.prototype.renderSubTitle=function(e){for(var t=0,i=this.titleStyle.textAlignment,n=So(this.subTitle,this.subTitleStyle,this.themeStyle.chartSubTitleFont),o=0,r=this.titleCollection;o<r.length;o++)var s,t=t<(s=So(r[o],this.titleStyle,this.themeStyle.chartSubTitleFont).width)?s:t;var a=new Do("Center"===i?e.x-t/2:"Far"===i?e.x-t:e.x,0,t,0),i=("Left"===this.titleStyle.position&&(a.x="Center"===i?e.x-.5*t:"Far"===i?this.margin.left+3*n.height/4:e.x-t),new ko(this.element.id+"_subTitle",dve(a,this.subTitleStyle),e.y*e.text.length+3*n.height/4+10,Nve(this.subTitleStyle.textAlignment,this.enableRtl),this.subTitleCollection,e.transform,"auto"));sve(this.renderer,i,this.subTitleStyle,this.subTitleStyle.color||this.themeStyle.chartSubTitleFont.color,this.svgObject,!1,this.redraw,null,null,null,null,0,null,null,null,this.themeStyle.chartSubTitleFont)},rxe.prototype.getSeriesElement=function(){return this.svgObject.getElementsByTagName("g")[0]},rxe.prototype.refreshSeries=function(){for(var e=0,t=this.visibleSeries;e<t.length;e++){var i=t[e];this.refreshPoints(i.points)}},rxe.prototype.refreshPoints=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];n.labelPosition=null,n.labelRegion=null,n.labelVisible=!0}},rxe.prototype.getModuleName=function(){return"accumulationchart"},rxe.prototype.destroy=function(){var e;this.element&&(this.unWireEvents(),nxe.prototype.destroy.call(this),this.element.classList.remove("e-accumulationchart"),this.element.classList.remove("e-accumulationchart-focused"),(e=document.getElementById(this.element.id+"Keyboard_accumulationchart_focus"))&&e.remove(),Pye("chartmeasuretext"),this.removeSvg(),(e=document.getElementById(this.element.id+"_ej2_chart_highlight"))&&e.remove(),(e=document.getElementById(this.element.id+"_ej2_chart_selection"))&&e.remove(),this.svgObject=null)},rxe.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]}),"None"!==this.highlightMode&&e.push({member:"AccumulationHighlight",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},rxe.prototype.findDatalabelVisibility=function(){for(var e=0,t=this.series;e<t.length;e++)if(t[e].dataLabel.visible)return!0;return!1},rxe.prototype.changeVisibleSeries=function(e,t){for(var i=0,n=e;i<n.length;i++){var o=n[i];if(t===o.index)return o}return null},rxe.prototype.getPersistData=function(){return""},rxe.prototype.sanitize=function(e){return this.enableHtmlSanitizer?go.sanitize(e):e},rxe.prototype.onPropertyChanged=function(e,t){for(var i={refreshElements:!1,refreshBounds:!1},n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"theme":this.animateSeries=!0;break;case"title":case"subTitle":case"height":case"width":case"margin":i.refreshBounds=!0;break;case"titleStyle":e.titleStyle&&(e.titleStyle.size||e.titleStyle.textOverflow)?i.refreshBounds=!0:i.refreshElements=!0;break;case"subTitleStyle":e.subTitleStyle&&(e.subTitleStyle.size||e.subTitleStyle.textOverflow)?i.refreshBounds=!0:i.refreshElements=!0;break;case"legendSettings":i.refreshBounds=!0,i.refreshElements=!0;break;case"dataSource":this.processData(!1),i.refreshBounds=!0;break;case"series":if(!this.animateselected){for(var r,s=this.series.length,a=!1,l=void 0,h=0;h<s;h++)((r=e.series[h]).startAngle||r.endAngle||r.explodeOffset||r.neckHeight||r.neckWidth||r.radius||r.innerRadius||r.groupMode||r.emptyPointSettings)&&this.isBlazor&&(l=!0),e.series[h]&&(e.series[h].dataSource||e.series[h].yName||e.series[h].xName||r.type||e.series[h].dataLabel||r.radius||r.innerRadius||r.startAngle||r.endAngle||r.gapRatio||r.neckWidth||r.explode||r.neckWidth||r.pyramidMode||r.explodeOffset||r.funnelMode||l)&&(Pe(this.changeVisibleSeries(this.visibleSeries,h),r,null,!0),a=!0),e.series[h]&&!je(e.series[h].explodeIndex)&&0<=e.series[h].explodeIndex&&e.series[h].explodeIndex!==t.series[h].explodeIndex?(this.accBaseModule.explodePoints(e.series[h].explodeIndex,this),this.accBaseModule.deExplodeAll(e.series[h].explodeIndex,this.enableAnimation?300:0)):e.series[h].explodeIndex<0&&this.accBaseModule.deExplodeAll(e.series[h].explodeIndex,this.enableAnimation?300:0),this.pieSeriesModule||(this.pieSeriesModule=new exe(this));a&&(this.calculateVisibleSeries(),this.processData(!1),i.refreshBounds=!0)}this.animateselected=!1,this.redraw=!1;break;case"enableRtl":case"locale":case"currencyCode":nxe.prototype.refresh.call(this);break;case"background":case"border":case"annotations":case"enableSmartLabels":i.refreshElements=!0;break;case"isMultiSelect":case"selectedDataIndexes":case"selectionMode":this.accumulationSelectionModule&&(je(this.accumulationSelectionModule.selectedDataIndexes)?this.accumulationSelectionModule.invokeSelection(this):(this.accumulationSelectionModule.selectedDataIndexes=this.selectedDataIndexes,this.accumulationSelectionModule.redrawSelection(this)));break;case"tooltip":this.accumulationTooltipModule&&(this.accumulationTooltipModule.previousPoints=[],this.tooltip.template)&&(this.accumulationTooltipModule.template=this.tooltip.template);break;case"center":je(e.center.x)||(this.center.x=e.center.x,i.refreshElements=!0),je(e.center.y)||(this.center.y=e.center.y,i.refreshElements=!0)}!i.refreshBounds&&i.refreshElements?(this.createPieSvg(),this.renderElements()):i.refreshBounds&&(this.refreshSeries(),this.createPieSvg(),this.calculateBounds(),this.renderElements())},F1e([e(null)],rxe.prototype,"width",void 0),F1e([e(null)],rxe.prototype,"height",void 0),F1e([e(null)],rxe.prototype,"title",void 0),F1e([e(null)],rxe.prototype,"backgroundImage",void 0),F1e([t({},H1e)],rxe.prototype,"center",void 0),F1e([e("")],rxe.prototype,"dataSource",void 0),F1e([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},gme)],rxe.prototype,"titleStyle",void 0),F1e([e(null)],rxe.prototype,"subTitle",void 0),F1e([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},gme)],rxe.prototype,"subTitleStyle",void 0),F1e([t({},Afe)],rxe.prototype,"legendSettings",void 0),F1e([t({},Gge)],rxe.prototype,"tooltip",void 0),F1e([t({},Bge)],rxe.prototype,"centerLabel",void 0),F1e([e("None")],rxe.prototype,"selectionMode",void 0),F1e([e("")],rxe.prototype,"highlightColor",void 0),F1e([e("None")],rxe.prototype,"highlightMode",void 0),F1e([e("None")],rxe.prototype,"selectionPattern",void 0),F1e([e("None")],rxe.prototype,"highlightPattern",void 0),F1e([e(!1)],rxe.prototype,"enableHtmlSanitizer",void 0),F1e([e(!0)],rxe.prototype,"enableBorderOnMouseMove",void 0),F1e([e(!1)],rxe.prototype,"isMultiSelect",void 0),F1e([e(!0)],rxe.prototype,"enableAnimation",void 0),F1e([kt([],$ge)],rxe.prototype,"selectedDataIndexes",void 0),F1e([t({},zge)],rxe.prototype,"margin",void 0),F1e([e(!0)],rxe.prototype,"enableSmartLabels",void 0),F1e([t({color:"#DDDDDD",width:0},Rge)],rxe.prototype,"border",void 0),F1e([e(null)],rxe.prototype,"background",void 0),F1e([kt([{}],Mwe)],rxe.prototype,"series",void 0),F1e([kt([{}],L1e)],rxe.prototype,"annotations",void 0),F1e([e("Material")],rxe.prototype,"theme",void 0),F1e([e(!1)],rxe.prototype,"useGroupingSeparator",void 0),F1e([e(!0)],rxe.prototype,"enableExport",void 0),F1e([e(!1)],rxe.prototype,"allowExport",void 0),F1e([t({},wge)],rxe.prototype,"accessibility",void 0),F1e([e(null)],rxe.prototype,"focusBorderColor",void 0),F1e([e(1.5)],rxe.prototype,"focusBorderWidth",void 0),F1e([e(0)],rxe.prototype,"focusBorderMargin",void 0),F1e([i()],rxe.prototype,"loaded",void 0),F1e([i()],rxe.prototype,"legendClick",void 0),F1e([i()],rxe.prototype,"load",void 0),F1e([i()],rxe.prototype,"seriesRender",void 0),F1e([i()],rxe.prototype,"legendRender",void 0),F1e([i()],rxe.prototype,"textRender",void 0),F1e([i()],rxe.prototype,"tooltipRender",void 0),F1e([i()],rxe.prototype,"pointRender",void 0),F1e([i()],rxe.prototype,"annotationRender",void 0),F1e([i()],rxe.prototype,"beforePrint",void 0),F1e([i()],rxe.prototype,"chartMouseMove",void 0),F1e([i()],rxe.prototype,"chartMouseClick",void 0),F1e([i()],rxe.prototype,"chartDoubleClick",void 0),F1e([i()],rxe.prototype,"pointClick",void 0),F1e([i()],rxe.prototype,"pointMove",void 0),F1e([i()],rxe.prototype,"animationComplete",void 0),F1e([i()],rxe.prototype,"chartMouseDown",void 0),F1e([i()],rxe.prototype,"chartMouseLeave",void 0),F1e([i()],rxe.prototype,"chartMouseUp",void 0),F1e([i()],rxe.prototype,"beforeResize",void 0),F1e([i()],rxe.prototype,"resized",void 0),F1e([i()],rxe.prototype,"beforeExport",void 0),F1e([i()],rxe.prototype,"afterExport",void 0),F1e([i()],rxe.prototype,"selectionComplete",void 0),F1e([e("USD")],rxe.prototype,"currencyCode",void 0),F1e([Bt],rxe));function rxe(e,t){e=nxe.call(this,e,t)||this;return e.animateselected=!1,e.explodeDistance=0,e.currentLegendIndex=0,e.currentPointIndex=0,e.previousTargetId="",e.isLegendClicked=!1,e.chartid=57724,e}sxe=function(e,t){return(sxe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}sxe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(lxe,axe=G1e),lxe.prototype.initProperties=function(e,t){var i=e.initialClipRect,e=(t.triangleSize=new Eo(ive(t.width,i.width),ive(t.height,i.height)),t.neckSize=new Eo(ive(t.neckWidth,i.width),ive(t.neckHeight,i.height)),this.defaultLabelBound(t,t.dataLabel.visible,t.dataLabel.position,e),"30%"===t.explodeOffset&&(t.explodeOffset="25px"),e.explodeDistance=ive(t.explodeOffset,i.width),t.points);this.initializeSizeRatio(e,t)},lxe.prototype.initializeSizeRatio=function(e,t,i){void 0===i&&(i=!1);for(var n=t.sumOfPoints,t=Math.min(Math.max(t.gapRatio,0),1),o=0!==n?1/(n*(1+t/(1-t))):0,r=t/(e.length-1),s=0,a=e.length-1;0<=a;a--){var l,h=i?e.length-1-a:a;e[h].visible&&(l=o*e[h].y,e[h].yRatio=s,s+=(e[h].heightRatio=l)+r)}},lxe.prototype.setLabelLocation=function(e,t,i){var n=i.length-1,e="Funnel"===e.type?i.length-2:i.length-1,o=(i[0].x+i[e].x)/2,r=(i[1].x+i[e-1].x)/2;t.region=new Do(o,i[0].y,r-o,i[e].y-i[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-(i[0].x+i[n].x)/2,y:t.symbolLocation.y-(i[0].y+i[n].y)/2}},lxe.prototype.getPath=function(e,t,i,n,o,r){var s=r.points.length,a=r.borderRadius,l=Math.min(t.region.width,t.region.height),h=Math.min(r.neckSize.height,r.neckSize.width),l=(0===h&&(h=0===r.neckSize.height&&0===r.neckSize.width?t.region.height:0===r.neckSize.width?r.neckSize.height:r.neckSize.width),a=l/2<a?l/2:a,"Funnel"===r.type&&(a=h/2<a?h/2:a),Math.atan2(e[1].x-e[2].x,e[1].y-e[2].y)),h=a;return"Pyramid"===r.type&&(a=t.index===o&&1!==s&&n!==o?0:a,i=(i+=e[0].x-h*Math.sin(-l)+" "+(e[0].y+-h*Math.cos(l))+" Q"+e[0].x+" "+e[0].y+" "+(e[0].x+a*Math.sin(-l))+" "+(e[0].y+-a*Math.cos(-l)))+" L"+(e[1].x+a*Math.sin(-l))+" "+(e[1].y+-a*Math.cos(l)),a=t.index===o?h:0,i=(i+=" L"+(e[2].x-h*Math.sin(-l))+" "+(e[2].y- -h*Math.cos(l))+" Q"+e[2].x+" "+e[2].y+" "+(e[2].x-a)+" "+e[2].y)+" L"+(e[3].x+a)+" "+e[3].y+" Q"+e[3].x+" "+e[3].y+" "+(e[3].x+h*Math.sin(-l))+" "+(e[3].y- -h*Math.cos(l))),"Funnel"===r.type&&(a=t.index===n&&1!==s&&n!==o?0:a,i=(i+=e[0].x+-(a*Math.sin(-l))+" "+(e[0].y+-a*Math.cos(l))+" Q"+e[0].x+" "+e[0].y+" "+(e[0].x+a)+" "+e[0].y)+" L"+(e[1].x-a)+" "+e[1].y+" Q"+e[1].x+" "+e[1].y+" "+(e[1].x-a*Math.sin(l))+" "+(e[1].y+-a*Math.cos(l)),a=t.index===n?h:0,"0%"===r.neckWidth?(s=e[5].x+(e[3].x-e[5].x)/2,i+=" L"+(e[2].x+-a*Math.sin(-l))+" "+(e[2].y- -a*Math.cos(l))+" Q"+s+" "+e[2].y+" "+(e[5].x- -a*Math.sin(-l))+" "+(e[2].y- -a*Math.cos(l))):(i="0%"!==r.neckHeight&&e[2].y!==e[3].y?i+(" L"+e[2].x+" "+e[2].y):i,o="0%"===r.neckHeight?a*Math.sin(-l):0,t="0%"===r.neckHeight?-a*Math.cos(l):a,i=(i+=" L"+(e[3].x-o)+" "+(e[3].y-t)+" Q"+e[3].x+" "+e[3].y+" "+(e[3].x-t)+" "+e[3].y)+" L"+(e[4].x+t)+" "+e[4].y+" Q"+e[4].x+" "+e[4].y+" "+(e[5].x+o)+" "+(e[4].y-t),i="0%"!==r.neckHeight&&e[4].y!==e[5].y?i+(" L"+e[5].x+" "+e[5].y):i)),i},lxe.prototype.findPath=function(e,t,i){for(var n="M ",o=-1,r=-1,s=0;s<i.points.length;s++)i.points[s].visible&&(-1===o&&(o=s),r=s);if(!i.borderRadius||t.index!==r&&t.index!==o)for(var a=0;a<e.length;a++)n+=e[a].x+" "+e[a].y,a!==e.length-1&&(n+=" L ");else n=this.getPath(e,t,n,o,r,i);return n+" Z "},lxe.prototype.defaultLabelBound=function(e,t,i,n){var o=(n.initialClipRect.width-e.triangleSize.width)/2,n=(n.initialClipRect.height-e.triangleSize.height)/2,o=new Do(o,n,e.triangleSize.width,e.triangleSize.height);e.labelBound=new Do(o.x,o.y,o.width+o.x,o.height+o.y),e.accumulationBound=o,t&&"Outside"===i&&(e.labelBound=new Do(1/0,1/0,-1/0,-1/0))};var sxe,axe,Afe=lxe;function lxe(){return null!==axe&&axe.apply(this,arguments)||this}hxe=function(e,t){return(hxe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}hxe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(cxe,dxe=Afe),cxe.prototype.getSegmentData=function(e,t,i){var n,o,r,s,a,l=t.triangleSize,h=(i.initialClipRect.width-t.triangleSize.width)/2+i.initialClipRect.x,i=i.initialClipRect.y+(i.initialClipRect.height-l.height)/2,d=e.yRatio*l.height,p=d+e.heightRatio*l.height,c=t.neckSize,u=c.width+(l.width-c.width)*((l.height-c.height-d)/(l.height-c.height)),g=l.width/2-u/2,m=g+u,u=(u=p>l.height-c.height||l.height===c.height?c.width:c.width+(l.width-c.width)*((l.height-c.height-p)/(l.height-c.height)),o=(n=l.width/2-u/2)+u,d>=l.height-c.height?(g=n=r=l.width/2-c.width/2,m=o=s=l.width/2+c.width/2):p>l.height-c.height&&(s=o=(r=n=l.width/2-u/2)+u,a=l.height-c.height),{x:h+0+g,y:d+=i}),l={x:h+0+o,y:p+=i},c={x:h+0+n,y:p},g=((a+=i)&&(l={x:h+0+s,y:a},c={x:h+0+r,y:a}),[u,{x:h+0+m,y:d},l,{x:h+0+o,y:p},{x:h+0+n,y:p},c]);return this.setLabelLocation(t,e,g),this.findPath(g,e,t)},cxe.prototype.renderPoint=function(e,t,i,n,o,r,s,a,l){if(!e.visible)return Pye(n.id),null;var h,d=this.getSegmentData(e,t,i),d=(e.midAngle=0,n.d=d,l&&document.getElementById(n.id)&&(h=document.getElementById(n.id).getAttribute("d")),i.renderer.drawPath(n));d.setAttribute("role",t.accessibility.accessibilityRole||"img"),d.setAttribute("tabindex",0===e.index&&t.accessibility.focusable?String(t.accessibility.tabIndex):"-1"),d.setAttribute("aria-label",t.accessibility.accessibilityDescription||e.x+":"+e.y+"%. "+t.name),O0e(!1,o,d,r,l||void 0,l?"x":void 0,l?"y":void 0,void 0,l?h:void 0,void 0,void 0,void 0,l?i.duration:void 0),e.isExplode&&i.accBaseModule.explodePoints(e.index,i,!0)},cxe.prototype.renderTrapezoidalFunnel=function(e,t,i,n,o,r){for(var s=e.triangleSize.width,a=e.triangleSize.height,l=(i.initialClipRect.width-s)/2+i.initialClipRect.x,h=i.initialClipRect.y+(i.initialClipRect.height-a)/2,d=Math.max.apply(Math,t.map(function(e){return e.y})),p=0,c=r?ie(i.element.id+"_Series_"+e.index+"_Polygon"):i.renderer.createGroup({id:i.element.id+"_Series_"+e.index+"_Polygon"}),u=0;u<e.points.length;u++){var g,m,f,y,v,b,w,C,S=e.points[u],A=n[S.index];S.visible?(g=(a-10*(t.length-1))/t.length,m=s*(S.y/d),f=(w=t.indexOf(S))<t.length-1?s*(t[w+1].y/d):0,v=h+p,b="M"+((y=l+(s-m)/2)+(C=Math.min(e.borderRadius,g/2)))+" "+v+" L"+(y+m-C)+" "+v+" A"+C+" "+C+" 0 0 1 "+(y+m)+" "+(v+C)+" L"+(y+m)+" "+(v+g-C)+" A"+C+" "+C+" 0 0 1 "+(y+m-C)+" "+(v+g)+" L"+(y+C)+" "+(v+g)+" A"+C+" "+C+" 0 0 1 "+y+" "+(v+g-C)+" L"+y+" "+(v+C)+" A"+C+" "+C+" 0 0 1 "+(y+C)+" "+v+" Z",S.midAngle=0,A.d=b,(b=i.renderer.drawPath(A)).setAttribute("role",e.accessibility.accessibilityRole||"img"),b.setAttribute("tabindex",0===S.index&&e.accessibility.focusable?String(e.accessibility.tabIndex):"-1"),b.setAttribute("aria-label",e.accessibility.accessibilityDescription||S.x+":"+S.y+"%. "+e.name),O0e(!1,o,b,r),w<t.length-1?(b=new No(A.id+"_polygon",this.lightenColor(A.fill),.4*A["stroke-width"],this.lightenColor(A.stroke),A.opacity,A["stroke-dasharray"],""),C="M"+(w=[[(s-m)/2+l+C,v+g],[(s+m)/2+l-C,v+g],[(s+f)/2+l,v+g+10],[(s-f)/2+l,v+g+10]])[0][0]+" "+w[0][1]+" L"+w[1][0]+" "+w[1][1]+" L"+w[2][0]+" "+w[2][1]+" L"+w[3][0]+" "+w[3][1]+" Z",b.d=C,O0e(!1,c,i.renderer.drawPath(b),r)):Pye(A.id+"_polygon"),p+=10+g,S.region=new Do(y,v,m,g),S.symbolLocation={x:S.region.x+S.region.width/2,y:S.region.y+S.region.height/2},S.labelOffset={x:S.symbolLocation.x+S.region.width/2,y:S.symbolLocation.y+S.region.height/2},S.isExplode&&i.accBaseModule.explodePoints(S.index,i,!0)):(Pye(A.id),Pye(A.id+"_polygon"))}O0e(!1,i.getSeriesElement(),o,r),O0e(!1,i.getSeriesElement(),c,r)},cxe.prototype.lightenColor=function(e){e=G0e(Y0e(e));return"rgb("+e.r+","+e.g+","+e.b+",0.4)"},cxe.prototype.getModuleName=function(){return"FunnelSeries"},cxe.prototype.destroy=function(){};var hxe,dxe,pxe=cxe;function cxe(){return null!==dxe&&dxe.apply(this,arguments)||this}uxe=function(e,t){return(uxe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}uxe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(fxe,gxe=Afe),fxe.prototype.getSegmentData=function(e,t,i){var n=t.triangleSize,o=i.initialClipRect.y+(i.initialClipRect.height-n.height)/2,i=(i.initialClipRect.width-t.triangleSize.width)/2+i.initialClipRect.x,r=e.yRatio,s=e.yRatio+e.heightRatio,a=.5*(1-e.yRatio),l=.5*(1-s);r+=o/n.height,s+=o/n.height;o=[{x:i+0+a*n.width,y:r*n.height},{x:i+0+(1-a)*n.width,y:r*n.height},{x:i+0+(1-l)*n.width,y:s*n.height},{x:i+0+l*n.width,y:s*n.height}];return this.setLabelLocation(t,e,o),this.findPath(o,e,t)},fxe.prototype.initializeSizeRatio=function(e,t){"Linear"===t.pyramidMode?gxe.prototype.initializeSizeRatio.call(this,e,t,!0):this.calculateSurfaceSegments(t)},fxe.prototype.calculateSurfaceSegments=function(e){for(var t=e.points.length,i=e.sumOfPoints,n=[],o=[],r=Math.min(0,Math.max(e.gapRatio,1)),s=1<e.points.length?r/(t-1):0,a=this.getSurfaceHeight(0,i),l=0,h=0;h<t;h++)e.points[h].visible&&(n[h]=l,o[h]=this.getSurfaceHeight(l,Math.abs(e.points[h].y)),l+=o[h]+s*a);for(var d=1/(l-s*a),h=0;h<t;h++)e.points[h].visible&&(e.points[h].yRatio=d*n[h],e.points[h].heightRatio=d*o[h])},fxe.prototype.getSurfaceHeight=function(e,t){return this.solveQuadraticEquation(1,2*e,-t)},fxe.prototype.solveQuadraticEquation=function(e,t,i){var i=t*t-4*e*i;return 0<=i?(i=Math.sqrt(i),Math.max((-t-i)/(2*e),(-t+i)/(2*e))):0},fxe.prototype.renderPoint=function(e,t,i,n,o,r,s,a,l){if(!e.visible)return Fo(n.id),null;n.d=this.getSegmentData(e,t,i),l&&document.getElementById(n.id)&&(h=document.getElementById(n.id).getAttribute("d")),e.midAngle=0;var h,n=i.renderer.drawPath(n);n.setAttribute("role",t.accessibility.accessibilityRole||"img"),n.setAttribute("tabindex",0===e.index&&t.accessibility.focusable?String(t.accessibility.tabIndex):"-1"),n.setAttribute("aria-label",t.accessibility.accessibilityDescription||e.x+": "+e.y+"%. "+t.name),O0e(!1,o,n,r,l||void 0,l?"x":void 0,l?"y":void 0,void 0,l?h:void 0,void 0,void 0,void 0,l?i.duration:void 0),e.isExplode&&i.accBaseModule.explodePoints(e.index,i,!0)},fxe.prototype.getModuleName=function(){return"PyramidSeries"},fxe.prototype.destroy=function(){};var uxe,gxe,mxe=fxe;function fxe(){return null!==gxe&&gxe.apply(this,arguments)||this}yxe=function(e,t){return(yxe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}yxe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(wxe,vxe=Gve),wxe.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on(F.touchMoveEvent,this.mouseMove,this),this.chart.on(F.touchEndEvent,this.mouseEnd,this),this.chart.on("click",this.click,this))},wxe.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off(F.touchMoveEvent,this.mouseMove),this.chart.off("click",this.click),this.chart.off(F.touchEndEvent,this.mouseEnd))},wxe.prototype.mouseMove=function(e){if(this.chart.legendSettings.visible&&!this.chart.isTouch&&this.chart.accumulationHighlightModule&&"None"!==this.chart.highlightMode){this.chart.legendSettings.toggleVisibility||this.click(e);for(var t=[this.legendID+"_text_",this.legendID+"_shape_marker_",this.legendID+"_shape_",this.legendID+"_g_"],i=e.target.id,n=0,o=t;n<o.length;n++){var r=o[n];if(-1<i.indexOf(r)){r=parseInt(i.split(r)[1],10),this.chart.accumulationHighlightModule.legendSelection(this.chart,0,r,e.target,e.type);break}}}},wxe.prototype.mouseEnd=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},wxe.prototype.getLegendOptions=function(e,t){this.legendCollections=[],this.isRtlEnable=e.enableRtl,this.isReverse=!this.isRtlEnable&&e.legendSettings.reverse;for(var i=0;i<1;i++){var n=t[i].type;"Pie"!==n&&"Doughnut"!==n||(n="0"!==t[i].innerRadius&&"0%"!==t[i].innerRadius?"Doughnut":"Pie");for(var o=0,r=t[i].points;o<r.length;o++){var s=r[o];je(s.x)||je(s.y)||this.legendCollections.push(new Rbe(e.useGroupingSeparator&&"number"==typeof s.x?e.intl.formatNumber(s.x,{useGrouping:!0}):s.x.toString(),s.color,t[i].legendShape,s.visible,n,s.legendImageUrl,null,null,s.index,t[i].index,null,s.x.toString()))}this.isReverse&&this.legendCollections.reverse()}},wxe.prototype.getLegendBounds=function(e,t,i){this.calculateLegendTitle(i,t),this.isTitle=!!i.title;var n=0,o=0,r=(this.chartRowCount=1,this.rowHeights=[],this.columnHeights=[],this.pageHeights=[],i.padding),s=i.titlePosition,a=0,l=this.arrowWidth,h=i.enablePages?0:this.arrowHeight,d=(this.isVertical?n=i.width?0:e.width/100*5:o=i.height?0:e.height/100*5,t.width+=n,t.height+=o,i.shapePadding),p=i.maximumLabelWidth||0,c=i.shapeWidth,u=0,g=0,m=0,f=[],y=[],v=0,b=0,w=0,C=(this.maxItemHeight=Math.max(So("MeasureText",i.textStyle,this.chart.themeStyle.legendLabelFont).height,i.shapeHeight),!1),S="Auto"===i.layout&&0<i.maximumColumns;if(i.fixedWidth)for(var A=0;A<this.legendCollections.length;A++){var x=c+d+(this.isVertical||0===A?r:this.itemPadding)+(i.maximumLabelWidth||So(this.legendCollections[A].text,i.textStyle,this.chart.themeStyle.legendLabelFont).width);this.maxColumnWidth=this.maxColumnWidth>x?this.maxColumnWidth:x}for(var I,A=0;A<this.legendCollections.length;A++){var T,E={fill:(T=this.legendCollections[A]).fill,text:T.text,shape:T.shape,name:"legendRender",cancel:!1};this.chart.trigger("legendRender",E),T.render=!E.cancel,T.text=T.originalText=-1<E.text.indexOf("&")?this.convertHtmlEntities(E.text):E.text,T.fill=E.fill,T.shape=E.shape,T.textSize=So(T.text,i.textStyle,this.chart.themeStyle.legendLabelFont),T.render&&""!==T.text&&(C=!0,w=i.fixedWidth?this.maxColumnWidth:c+d+(i.maximumLabelWidth||T.textSize.width)+(this.isVertical&&"Horizontal"!==i.layout||0===A||1===g&&0<m&&"Horizontal"===i.layout?r:this.itemPadding),this.getLegendHeight(T,i,t,u,this.maxItemHeight,r),this.isVertical&&"Auto"===i.layout&&!S?((b+=Math.max(T.textSize.height,i.shapeHeight)+(0===A?r:this.itemPadding))+this.itemPadding+h/this.pageButtonSize>t.height&&(u+=p,E=this.getPageWidth(y),this.totalPages=Math.max(m,this.totalPages||1),u-E+w>t.width?(y.push(u-E),v=m=this.rowHeights.length):m=v,f.push(p),p=0,b=Math.max(T.textSize.height,i.shapeHeight)+r,g++),this.columnHeights[g]=(this.columnHeights[g]||0)+Math.max(T.textSize.height,i.shapeHeight)+(0===A?r:this.itemPadding),p=Math.max(w,p),this.rowHeights[m]=Math.max(this.rowHeights[m]||0,Math.max(T.textSize.height,i.shapeHeight)),m++):(i.enablePages||(a=this.isTitle&&"Top"!==s?this.legendTitleSize.width+this.fivePixel:0,a+=l),u+=w,(S?i.maximumColumns===g:t.width<r+u+a||"Vertical"===this.legend.layout&&1===g)&&(p=Math.max(p,u+r+a-w),0===m&&w!==u&&(m=1),u=w,m++,g=0),this.rowHeights[E=m&&m-1]=Math.max(this.rowHeights[E]||0,Math.max(T.textSize.height,i.shapeHeight)),this.columnHeights[g]=(this.columnHeights[g]||0)+Math.max(T.textSize.height,i.shapeHeight)+r,S&&this.columnHeights[g]>t.height&&(this.columnHeights[g]-=Math.max(T.textSize.height,i.shapeHeight)+r),g++))}e="Top"===s?this.legendTitleSize.height:0,this.isVertical&&"Auto"===i.layout&&!S?(this.isPaging=t.width<(u+=p)+r,b=Math.max.apply(null,this.columnHeights)+r+h+e,b=Math.max(b,(this.totalPages||1)*(this.maxItemHeight+r)+r+h),this.isPaging=this.isPaging&&1<this.totalPages,f.push(p)):(this.totalPages=this.totalRowCount=m,b=Math.max.apply(null,this.columnHeights)+r+h+e,this.isPaging=(t.height<b||"Horizontal"===i.layout&&1<this.rowHeights.length)&&!S,b=!i.enablePages&&this.isPaging&&"Vertical"!==i.layout?this.maxItemHeight+r+r+e:b,b=Math.max(b,this.maxItemHeight+r+r+e),"Horizontal"===i.layout&&(b=this.maxItemHeight+2*r+e+this.pageButtonSize+i.border.width),this.isPaging||(u+=this.isTitle&&"Top"!==s?this.fivePixel+this.legendTitleSize.width+this.fivePixel:0)),this.maxColumns=0,S&&this.maxColumnWidth&&i.fixedWidth?(I=this.maxColumnWidth*i.maximumColumns+r,this.isPaging=!1):I=this.isVertical&&"Auto"===i.layout&&!S?this.getMaxColumn(f,t.width,r,u+r):Math.max(u+r,p),C?this.setBounds(I,b,i,t):this.setBounds(0,0,i,t)},wxe.prototype.getPageWidth=function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i];return t},wxe.prototype.getLegendHeight=function(e,t,i,n,o,r){var s=e.textSize.width,a=t.shapePadding+2*r+t.shapeWidth;switch(t.textWrap){case"Wrap":case"AnyWhere":s>t.maximumLabelWidth||s+n>i.width?e.textCollection=pve(e.text,t.maximumLabelWidth?Math.min(t.maximumLabelWidth,i.width-a):i.width-a,t.textStyle,this.chart.enableRtl,"AnyWhere"===t.textWrap,null,this.chart.themeStyle.legendLabelFont):e.textCollection.push(e.text),e.textSize.height=o*e.textCollection.length}},wxe.prototype.convertHtmlEntities=function(e){return e.replace("&amp;","&").replace("&lt;","<").replace("&gt;",">").replace("&quot;",'"').replace("&nbsp;"," ").replace("&cent;","¢").replace("&pound;","£").replace("&yen;","¥").replace("&euro;","€").replace("&copy;","©").replace("&reg;","®").replace("&#38;","&").replace("&#60;","<").replace("&#62;",">").replace("&#34;",'"').replace("&#160;"," ").replace("&#162;","¢").replace("&#163;","£").replace("&#165;","¥").replace("&#8364;","€").replace("&#169;","©").replace("&#174;","®")},wxe.prototype.getMaxColumn=function(e,t,i,n){var o=i;this.maxColumnWidth=Math.max.apply(null,e);for(var r=0,s=e;r<s.length;r++){s[r];if(o+=this.maxColumnWidth,this.maxColumns++,t<o+i){o-=this.maxColumnWidth,this.maxColumns--;break}}this.isPaging=o<n&&1<this.totalPages,o===i&&(o=t),this.maxColumns=Math.max(1,this.maxColumns),this.maxWidth=o;var a=this.maxColumnWidth+i,l=0,h=this.columnHeights.length;if(this.isPaging&&this.isVertical){for(var d=1;d<h;d++)t<(a+=this.maxColumnWidth+i)&&(this.pageHeights.push(l!==d-1?Math.max.apply(null,this.columnHeights.slice(l,d-1)):this.columnHeights[l]),a=this.maxColumnWidth+i,l=d);this.pageHeights.push(l!==h-1?Math.max.apply(null,this.columnHeights.slice(l,h-1)):this.columnHeights[l]),this.totalPages=this.pageHeights.length}return o},wxe.prototype.getAvailWidth=function(e,t){if(!this.isVertical||"Auto"!==this.legend.layout||0<this.legend.maximumColumns){if(!this.isVertical&&"Vertical"!==this.legend.layout&&!(0<this.legend.maximumColumns)&&this.isPaging&&!this.legend.enablePages)return t-e-this.fivePixel}else t=this.maxWidth;return t-(2*this.legend.padding+this.legend.shapeWidth+this.legend.shapePadding)},wxe.prototype.getRenderPoint=function(e,t,i,n,o,r,s){var a=this.legend.padding,l=n.location.y+this.maxItemHeight/4+(0<n.textCollection.length?(n.textCollection.length-1)*this.maxItemHeight:0),h=(!this.isVertical||"Auto"!==this.legend.layout||0<this.legend.maximumColumns?(h=this.legend.fixedWidth?this.maxColumnWidth:i+(this.legend.maximumLabelWidth||n.textSize.width),h=n.location.x+(this.isRtlEnable?-h:h),("Auto"===this.legend.layout&&0<this.legend.maximumColumns?r%this.legend.maximumColumns==0:this.isWithinBounds(h,(this.legend.maximumLabelWidth||e.textSize.width)+i-this.itemPadding,o,this.legend.shapeWidth/2)||"Vertical"===this.legend.layout)?(r!==s&&this.chartRowCount++,e.location.y=r===s?n.location.y:n.location.y+this.rowHeights[this.chartRowCount-2]+a,e.location.x=t.x):(e.location.y=n.location.y,e.location.x=r===s?n.location.x:h)):r===s||l+Math.max(e.textSize.height,this.legend.shapeHeight)+a>o.y+o.height?(e.location.x=n.location.x+(r===s?0:this.isRtlEnable?-this.maxColumnWidth:this.maxColumnWidth),e.location.y=t.y,i=this.legend.shapeWidth/2+a,this.pageXCollections.push(e.location.x+(this.isRtlEnable?i:-i))):(e.location.x=n.location.x,e.location.y=n.location.y+Math.max(n.textSize.height,this.legend.shapeHeight)+this.itemPadding),this.getAvailWidth(e.location.x,this.legendBounds.width)),h=this.legend.maximumLabelWidth?Math.min(this.legend.maximumLabelWidth,h):h;"Ellipsis"===this.legend.textOverflow&&"Normal"===this.legend.textWrap&&(e.text=eve(+h.toFixed(4),e.text,this.legend.textStyle,this.chart.enableRtl,this.chart.themeStyle.legendLabelFont))},wxe.prototype.isWithinBounds=function(e,t,i,n){return this.isRtlEnable?e-t<i.x-n:e+t>i.x+i.width+n},wxe.prototype.getSmartLegendLocation=function(e,t,i){var n;switch(this.position){case"Left":n=(e.x-t.width-i.left)/2,t.x=e.x-t.width<i.left?t.x:e.x-t.width-n;break;case"Right":n=(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+n;break;case"Top":this.getTitleRect(this.chart),n=(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-n;break;case"Bottom":n=(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+n}},wxe.prototype.getTitleRect=function(e){if(!e.title)return null;var t=So(e.title,e.titleStyle,this.chart.themeStyle.legendTitleFont);this.titleRect=new Do(e.availableSize.width/2-t.width/2,e.margin.top,t.width,t.height)},wxe.prototype.legendByIndex=function(e,t){for(var i=0,n=t;i<n.length;i++){var o=n[i];if(o.pointIndex===e)return o}return null},wxe.prototype.click=function(e){var t=(-1<e.target.id.indexOf("_chart_legend_g_")?e.target.firstChild:e.target).id,i=this.chart,n=[this.legendID+"_text_",this.legendID+"_shape_",this.legendID+"_shape_marker_"];this.chart.animateSeries=!1;for(var o=0,r=n;o<r.length;o++){var s,a,l,h,d=r[o];-1<t.indexOf(d)&&(d=parseInt(t.split(d)[1],10),this.chart.legendSettings.toggleVisibility&&!isNaN(d)?(a=q1e(d,(s=this.chart.visibleSeries[0]).points),h={legendText:(l=this.legendByIndex(d,this.legendCollections)).text,legendShape:l.shape,chart:i.isBlazor?{}:i,series:s,point:a,name:Nme,cancel:!1},this.chart.trigger(Nme,h),h.cancel||(a.visible=!a.visible,l.visible=a.visible,s.sumOfPoints+=a.visible?a.y:-a.y,i.redraw=i.enableAnimation,this.sliceVisibility(d,a.visible),i.removeSvg(),gve(i),this.chart.refreshPoints(s.points),this.chart.calculateBounds(),(h=document.getElementById(this.chart.element.id+"PointHover_Border"))&&this.chart.pieSeriesModule.removeBorder(h,0),this.chart.accumulationTooltipModule&&this.chart.accumulationTooltipModule.removeTooltip(0),this.chart.renderElements())):this.chart.accumulationSelectionModule&&!isNaN(d)?this.chart.accumulationSelectionModule.legendSelection(this.chart,0,d,e.target,e.type):this.chart.accumulationHighlightModule&&!isNaN(d)&&this.chart.accumulationHighlightModule.legendSelection(this.chart,0,d,e.target,e.type))}-1<t.indexOf(this.legendID+"_pageup")?this.changePage(e,!0):-1<t.indexOf(this.legendID+"_pagedown")&&this.changePage(e,!1),i.redraw=!1},wxe.prototype.sliceVisibility=function(e,t){var i;this.chart.element.id;this.chart.visibleSeries[0].dataLabel.visible&&(i=this.chart.element.id+"_datalabel_Series_0_",this.sliceAnimate(ie(i+"g_"+e),t))},wxe.prototype.sliceAnimate=function(e,t){if(!e)return null;new Vt({}).animate(e,{duration:300,delay:0,name:t?"FadeIn":"FadeOut",end:function(e){e.element.style.visibility=t?"visible":"hidden"}})},wxe.prototype.getModuleName=function(){return"AccumulationLegend"},wxe.prototype.destroy=function(){this.removeEventListener()};var yxe,vxe,bxe=wxe;function wxe(e){var t=vxe.call(this,e)||this;return(t.library=t).titleRect=new Do(0,e.margin.top,0,0),t.addEventListener(),t}Cxe=function(e,t){return(Cxe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Cxe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(xxe,Sxe=G1e),xxe.prototype.getDataLabelPosition=function(e,t,i,n){var o,r=this.isCircular()?this.isVariousRadius()?this.accumulation.pieSeriesModule.getLabelRadius(this.accumulation.visibleSeries[0],e):this.accumulation.pieSeriesModule.labelRadius:this.getLabelDistance(e,t);this.accumulation.title&&(o=So(this.accumulation.title,this.accumulation.titleStyle,this.accumulation.themeStyle.datalabelFont),this.titleRect=new Do(this.accumulation.availableSize.width/2-o.width/2,this.accumulation.margin.top,o.width,o.height)),this.getLabelRegion(e,t.position,i,r,this.marginValue),e.labelAngle=e.midAngle,e.labelPosition=t.position,this.accumulation.enableSmartLabels&&this.getSmartLabel(e,t,i,n)},xxe.prototype.getLabelRegion=function(e,t,i,n,o,r){r=(r=void 0===r?0:r)||e.midAngle,n=jye(r,n,this.isCircular()?this.center:this.getLabelLocation(e,t));n.y="Inside"===t?n.y-i.height/2:n.y,n.x="Inside"===t?n.x-i.width/2:n.x,e.labelRegion=new Do(n.x,n.y,i.width+2*o,i.height+2*o),"Outside"===t&&(e.labelRegion.y-=e.labelRegion.height/2,90<=r&&r<=270?e.labelRegion.x-=e.labelRegion.width+20:e.labelRegion.x+=20)},xxe.prototype.calculateLabelCollection=function(e,t){if(null!==e.argsData.template)return null;var i=e.labelPosition||t.position,n=this.isCircular()?this.isVariousRadius()?this.accumulation.pieSeriesModule.getLabelRadius(this.accumulation.visibleSeries[0],e):this.accumulation.pieSeriesModule.labelRadius:this.getLabelDistance(e,t),o=this.isVariousRadius()?this.accumulation.pieSeriesModule.getLabelRadius(this.accumulation.visibleSeries[0],e):this.accumulation.pieSeriesModule.radius-this.accumulation.pieSeriesModule.innerRadius,n=jye(e.midAngle,n,this.isCircular()?this.center:this.getLabelLocation(e,i)),r=(r=t.maxWidth)||("Outside"===i?this.isCircular()?n.x>=this.center.x?this.areaRect.x+this.areaRect.width-n.x:n.x-this.areaRect.x:n.x>=e.region.x?this.areaRect.x+this.areaRect.width-n.x:n.x-this.areaRect.x:this.isCircular()?o-20:e.region.width);-1!==e.label.indexOf("<br>")?e.labelCollection=e.label.split("<br>"):"Normal"===t.textWrap&&"Ellipsis"===t.textOverflow?e.labelCollection[0]=eve(r,e.label,e.argsData.font,this.accumulation.enableRtl,this.accumulation.themeStyle.datalabelFont):"Wrap"===t.textWrap||"AnyWhere"===t.textWrap?e.labelCollection=pve(e.label,r,e.argsData.font,this.accumulation.enableRtl,"AnyWhere"===t.textWrap,"Clip"===t.textOverflow,this.accumulation.themeStyle.datalabelFont):e.labelCollection[0]=e.label},xxe.prototype.getTextSize=function(e,t){for(var i,n=0,o=t.font,r=t.maxWidth||0,s=0;s<e.length;s++)i=So(e[s],o,this.accumulation.themeStyle.datalabelFont),r=Math.max(i.width,r),n+=i.height;return"Clip"===t.textOverflow&&"Normal"!==t.textWrap&&t.maxWidth&&(r=t.maxWidth),new Eo(r,n)},xxe.prototype.getSmartLabel=function(e,t,i,n){var o=this.isCircular(),r=o?this.radius:this.getLabelDistance(e,t),s=(r+=ive(o?t.connectorStyle.length||"4%":"0px",r),this.findPreviousPoint(n,e.index,e.labelPosition));"Inside"===t.position?(e.labelRegion.height-=4,e.labelRegion.width-=4,(s&&s.labelRegion&&!t.enableRotation&&(j0e(e.labelRegion,s.labelRegion)||this.isOverlapping(e,n))||!o&&!W0e(e.region,e.labelRegion))&&(e.labelPosition="Outside",o||(r=this.getLabelDistance(e,t)),this.calculateLabelCollection(e,t),(i=this.getTextSize(e.labelCollection,t)).height+=4,i.width+=4,this.getLabelRegion(e,e.labelPosition,i,r,this.marginValue),s=this.findPreviousPoint(n,e.index,e.labelPosition))&&(j0e(e.labelRegion,s.labelRegion)||this.isConnectorLineOverlapping(e,s))&&this.setOuterSmartLabel(s,e,t.border.width,r,i,this.marginValue)):s&&s.labelRegion&&(j0e(e.labelRegion,s.labelRegion)||this.isOverlapping(e,n)||this.isConnectorLineOverlapping(e,s))&&this.setOuterSmartLabel(s,e,t.border.width,r,i,this.marginValue),!this.isOverlapping(e,n)||"Pyramid"!==this.accumulation.type&&"Funnel"!==this.accumulation.type||(o=jye(e.midAngle||0,-(r=o?this.radius:this.getLabelDistance(e,t)),this.isCircular()?this.center:this.getLabelLocation(e,"OutsideLeft")),e.labelRegion=new Do(o.x,o.y,i.width+2*this.marginValue,i.height+2*this.marginValue),e.labelRegion.y-=e.labelRegion.height/2,e.labelRegion.x=e.labelRegion.x-20-e.labelRegion.width,s&&s.labelRegion&&(j0e(e.labelRegion,s.labelRegion)||this.isOverlapping(e,n)||this.isConnectorLineOverlapping(e,s))&&this.setOuterSmartLabel(s,e,t.border.width,r,i,this.marginValue))},xxe.prototype.move=function(e,t,i,n){var o,r=this;-1<e.target.textContent.indexOf("...")?2===(e=e.target.id.split(this.id)).length&&(o=parseInt(e[1].split("_text_")[0],10),e=parseInt(e[1].split("_text_")[1],10),isNaN(o)||isNaN(e)||(n&&Pye(this.accumulation.element.id+"_EJ2_Datalabel_Tooltip"),Fye((o=U1e(o,this.accumulation.visibleSeries).points[e]).text||o.y.toString(),t,i,this.areaRect.width,this.accumulation.element.id+"_EJ2_Datalabel_Tooltip",ie(this.accumulation.element.id+"_Secondary_Element"),null,null,this.accumulation.initialClipRect))):Pye(this.accumulation.element.id+"_EJ2_Datalabel_Tooltip"),n&&(clearTimeout(this.clearTooltip),this.clearTooltip=+setTimeout(function(){Pye(r.accumulation.element.id+"_EJ2_Datalabel_Tooltip")},1e3))},xxe.prototype.findPreviousPoint=function(e,t,i){e[0];for(var n,o=t-1;0<=o;o--)if((n=e[o]).visible&&n.labelVisible&&n.labelRegion&&n.labelPosition===i)return n;return null},xxe.prototype.isOverlapping=function(e,t){for(var i=e.index-1;0<=i;i--)if(t[i].visible&&t[i].labelVisible&&t[i].labelRegion&&e.labelRegion&&e.labelVisible&&j0e(e.labelRegion,t[i].labelRegion))return!0;return!1},xxe.prototype.textTrimming=function(e,t,i,n,o){if(j0e(e.labelRegion,t)){var r=e.labelRegion.width;if("Right"===n?r=t.x-e.labelRegion.x:"Left"===n?(r=e.labelRegion.x-(t.x+t.width))<0&&(r+=e.labelRegion.width,e.labelRegion.x=t.x+t.width):"InsideRight"===n?r=t.x+t.width-e.labelRegion.x:"InsideLeft"===n?(r=e.labelRegion.x+e.labelRegion.width-t.x)<e.labelRegion.width&&(e.labelRegion.x=t.x):this.accumulation.enableSmartLabels&&this.setPointVisibileFalse(e),e.labelVisible&&e.labelRegion){-1!==e.label.indexOf("<br>")?e.labelCollection=e.label.split("<br>"):r<e.labelRegion.width&&("Normal"===o.textWrap&&"Ellipsis"===o.textOverflow?e.labelCollection[0]=eve(r-2*this.marginValue,e.label,i,this.accumulation.enableRtl,this.accumulation.themeStyle.datalabelFont):"Wrap"!==o.textWrap&&"AnyWhere"!==o.textWrap||(e.labelCollection=pve(e.label,r-2*this.marginValue,i,this.accumulation.enableRtl,"AnyWhere"===o.textWrap,"Clip"===o.textOverflow,this.accumulation.themeStyle.datalabelFont)),e.labelRegion.width=r);for(var s=0;s<e.labelCollection.length;s++)if(3===e.labelCollection[s].length&&-1<e.labelCollection[s].indexOf("...")){this.setPointVisibileFalse(e);break}}}},xxe.prototype.setPointVisibileFalse=function(e){e.labelVisible=!1,e.labelRegion=null},xxe.prototype.setPointVisibleTrue=function(e){e.labelVisible=!0},xxe.prototype.setOuterSmartLabel=function(e,t,i,n,o,r){if(this.isCircular()){var s=this.getOverlappedAngle(e.labelRegion,t.labelRegion,t.midAngle,2*i);for(this.getLabelRegion(t,"Outside",o,n,r,s),s>t.endAngle&&(s=t.midAngle),t.labelAngle=s;t.labelVisible&&(j0e(e.labelRegion,t.labelRegion)||s<=e.labelAngle||s<=.9*t.midAngle||this.isConnectorLineOverlapping(t,e))&&!(s>t.endAngle);)t.labelAngle=s,this.getLabelRegion(t,"Outside",o,n,r,s),s+=.1}else this.setSmartLabelForSegments(t,e)},xxe.prototype.setSmartLabelForSegments=function(e,t){var i=e.labelRegion,i="Funnel"===this.accumulation.type?t.labelRegion.y-(i.y+i.height):e.labelRegion.y-(t.labelRegion.y+t.labelRegion.height);i<0&&(e.labelRegion.y+="Funnel"===this.accumulation.type?i:-i)},xxe.prototype.isConnectorLineOverlapping=function(e,t){!this.isCircular()&&e.labelRegion.x<e.region.x&&(i="outsideLeft");var i=this.getLabelLocation(e,i),n=new Tve(0,0),o=(this.getEdgeOfLabel(e.labelRegion,e.labelAngle,n,0,e),this.getLabelLocation(t)),r=new Tve(0,0);return this.getEdgeOfLabel(t.labelRegion,t.labelAngle,r,0,e),this.isLineRectangleIntersect(i,n,e.labelRegion)||this.isLineRectangleIntersect(i,n,t.labelRegion)||this.isLineRectangleIntersect(o,r,e.labelRegion)},xxe.prototype.isLineRectangleIntersect=function(e,t,i){var n=[new Tve(Math.round(i.x),Math.round(i.y)),new Tve(Math.round(i.x+i.width),Math.round(i.y)),new Tve(Math.round(i.x+i.width),Math.round(i.y+i.height)),new Tve(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<n.length;o++)if(this.isLinesIntersect(e,t,n[o],n[(o+1)%n.length]))return!0;return!1},xxe.prototype.isLinesIntersect=function(e,t,i,n){var o=t.y-e.y,r=e.x-t.x,s=o*e.x+r*e.y,a=n.y-i.y,l=i.x-n.x,h=a*i.x+l*i.y,d=o*l-a*r;return 0!=d&&(l=(l*s-r*h)/d,r=(o*h-a*s)/d,Math.min(e.x,t.x)<=l)&&l<=Math.max(e.x,t.x)&&Math.min(e.y,t.y)<=r&&r<=Math.max(e.y,t.y)&&Math.min(i.x,n.x)<=l&&l<=Math.max(i.x,n.x)&&Math.min(i.y,n.y)<=r&&r<=Math.max(i.y,n.y)},xxe.prototype.getOverlappedAngle=function(e,t,i,n){var o=e.x;return 90<=i&&i<=270?(t.y=e.y-(n+t.height/2),o=e.x+e.width):t.y=e.y+e.height+n,qye(this.center,new Tve(o,t.y))},xxe.prototype.getConnectorPath=function(e,t,i,n){void 0===n&&(n=0);var o=i.connectorStyle,r=this.isCircular()?this.isVariousRadius()?this.accumulation.pieSeriesModule.getLabelRadius(this.accumulation.visibleSeries[0],t):this.labelRadius:this.getLabelDistance(t,i),s=this.getConnectorStartPoint(t,o),n=!this.accumulation.enableSmartLabels&&n||t.midAngle,a=new Tve(0,0),e=this.getEdgeOfLabel(e,n,a,o.width,t);return"Curve"===o.type?this.isCircular()?(o=r-(this.isVariousRadius()?ive(t.sliceRadius,this.accumulation.pieSeriesModule.size/2):this.radius),t.isLabelUpdated?a=this.getPerpendicularDistance(s,t):(a=jye(n,r-o/2,this.center),"Outside"===t.labelPosition&&"Inside"===i.position&&(a=jye(n,r-1.25*o,this.center))),"M "+s.x+" "+s.y+" Q "+a.x+" "+a.y+" "+e.x+" "+e.y):this.getPolyLinePath(s,e):"M "+s.x+" "+s.y+" L "+a.x+" "+a.y+" L "+e.x+" "+e.y},xxe.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 n="M",o=0;o<=16;o++){var r=this.getBezierPoint(o/16,i,0,2);n+=r.x+","+r.y,16!==o&&(n+=" L")}return n},xxe.prototype.getBezierPoint=function(e,t,i,n){var o;return 1===n?t[i]:(o=this.getBezierPoint(e,t,i,n-1),t=this.getBezierPoint(e,t,i+1,n-1),i=o.x||o.x,n=o.y||o.y,i=(1-e)*i+e*(t.x||t.x),n=(1-e)*n+e*(t.y||t.y),o.x,{x:i,y:n})},xxe.prototype.getEdgeOfLabel=function(e,t,i,n,o){void 0===n&&(n=1);var r=new Tve(e.x,e.y);return 90<=t&&t<=270?(r.x+=e.width+n/2+10,r.y+=e.height/2,i.x=r.x+10):o&&o.region&&o.region.x>o.labelRegion.x?(r.x+=2*n+e.width+10,r.y+=e.height/2,i.x=r.x+10):(r.x-=10-n/2,r.y+=e.height/2,i.x=r.x-10),i.y=r.y,r},xxe.prototype.getLabelDistance=function(e,t){if(e.labelPosition&&t.position!==e.labelPosition||t.connectorStyle.length&&"Outside"===t.position){var i=ive(t.connectorStyle.length||"70px",this.accumulation.initialClipRect.width);if(i<this.accumulation.initialClipRect.width)return i}var n,i=e.labelPosition||t.position,t=this.accumulation.visibleSeries[0],o=(this.accumulation.initialClipRect.width-t.triangleSize.width)/2;switch(i){case"Inside":return 0;case"Outside":return n=e.symbolLocation.x+e.labelOffset.x,this.accumulation.initialClipRect.width-n-o}},xxe.prototype.getLabelLocation=function(e,t){var i;if(void 0===t&&(t="Outside"),"Pie"===this.accumulation.type||"Trapezoidal"===this.accumulation.series[0].funnelMode)return"Trapezoidal"===this.accumulation.series[0].funnelMode&&"Funnel"===this.accumulation.type?(i={x:e.symbolLocation.x,y:e.symbolLocation.y},"Outside"===t&&(i.x=e.labelOffset.x),i):jye(e.midAngle,this.isVariousRadius()?ive(e.sliceRadius,this.accumulation.pieSeriesModule.seriesRadius):this.radius,this.center);t="OutsideLeft"===t?"OutsideLeft":e.labelPosition||t;var n={x:e.symbolLocation.x,y:e.symbolLocation.y-e.labelOffset.y};switch(t){case"Inside":n.y=e.region.y+e.region.height/2;break;case"Outside":n.x+=e.labelOffset.x;break;case"OutsideLeft":n.x-=e.labelOffset.x}return n},xxe.prototype.getConnectorStartPoint=function(e,t){var i;return!this.isCircular()&&e.region.x>e.labelRegion.x&&(i="OutsideLeft"),this.isCircular()?jye(e.midAngle,(this.isVariousRadius()?ive(e.sliceRadius,this.accumulation.pieSeriesModule.seriesRadius):this.radius)-t.width,this.center):this.getLabelLocation(e,i)},xxe.prototype.findAreaRect=function(){this.areaRect=new Do(0,0,this.accumulation.availableSize.width,this.accumulation.availableSize.height);var e=this.accumulation.margin;Hye(this.areaRect,new Eve(e.left,e.right,e.top,e.bottom))},xxe.prototype.renderDataLabel=function(e,t,i,n,o,r,s){var o=this.accumulation.element.id+"_datalabel_Series_"+o+"_",a=this.accumulation.renderer.createGroup({id:o+"g_"+e.index}),l={width:t.border.width,color:t.border.color},h=Pe({},R("properties",t.font),null,!0),l=(e.label=this.getDatalabelText(t.format,this.accumulation,e.originalText||e.y.toString()),{cancel:!1,name:zme,series:this.accumulation.visibleSeries[0],point:e,text:e.label,border:l,color:t.fill,template:this.accumulation.enableHtmlSanitizer?this.accumulation.sanitize(t.template):t.template,font:h}),h=(this.accumulation.trigger(zme,l),null!==(e.argsData=l).template),d=(e.labelVisible=!l.cancel,e.text=e.label=l.text,e.labelCollection=[],this.marginValue=l.border.width?5+l.border.width:1,Q("div",{id:this.accumulation.element.id+"_Series_0_DataLabel_"+e.index,styles:"position: absolute;background-color:"+l.color+";"+P0e(t.font,this.accumulation.themeStyle.datalabelFont)+";border:"+l.border.width+"px solid "+l.border.color+";"}));this.calculateLabelSize(h,d,e,n,l,a,o,t,s)},xxe.prototype.getDatalabelText=function(e,t,i){var n;return Number(i)&&(n=null!==e.match("{value}"),t=t.intl.getNumberFormat({format:n?"":e,useGrouping:t.useGroupingSeparator}),i=n?e.replace("{value}",t(parseFloat(i))):t(parseFloat(i))),i},xxe.prototype.calculateLabelSize=function(e,t,i,n,o,r,s,a,l,h,d){this.calculateLabelCollection(i,a);d=e?d?{width:h.width,height:h.height}:this.getTemplateSize(t,i,o,l,e,n,r,s,a):this.getTextSize(i.labelCollection,a);d.height+=4,d.width+=4,i.textSize=d,i.templateElement=t,this.getDataLabelPosition(i,a,d,n),i.labelRegion&&this.correctLabelRegion(i.labelRegion,i.textSize)},xxe.prototype.drawDataLabels=function(e,t,i,n,o){var r=e.leftSidePoints.concat(e.rightSidePoints);r.sort(function(e,t){return e.index-t.index}),"Pie"===e.type&&this.accumulation.enableSmartLabels&&this.extendedLabelsCalculation();for(var s=0,a=r;s<a.length;s++){var l=a[s];if(!je(l.argsData)&&!je(l.y)){this.finalizeDatalabels(l,r,t);var h=document.getElementById(this.accumulation.element.id+"_Series_0_Point_"+l.index),d=this.accumulation.element.id+"_datalabel_Series_0_",p=this.accumulation.renderer.createGroup({id:d+"g_"+l.index}),c=(p.setAttribute("aria-hidden","true"),void 0),u=void 0;if(l.visible&&l.labelVisible){var g,m,f,y=g=t.angle;if(l.argsData.template?this.setTemplateStyle(l.templateElement,l,n,t.font.color,l.color,o):(c=new Tve(l.labelRegion.x+this.marginValue,l.labelRegion.y+3*l.textSize.height/(4*l.labelCollection.length)+this.marginValue),f=(u=ie(d+"shape_"+l.index))?new Tve(+u.getAttribute("x"),+u.getAttribute("y")):null,m=l.textSize.width,y="rotate("+(g=t.enableRotation?0===y?"Outside"===l.labelPosition?0:90<=l.midAngle&&l.midAngle<=260?l.midAngle+180:l.midAngle:360<y?y-360:y<-360?y+360:y:0)+","+(c.x+m/2)+","+c.y+")",l.transform=y,O0e(!1,p,this.accumulation.renderer.drawRectangle(new vve(d+"shape_"+l.index,l.argsData.color,l.argsData.border,1,l.labelRegion,t.rx,t.ry,y,e.dataLabel.border.dashArray)),o,!0,"x","y",f,null,!1,!1,null,this.accumulation.duration),sve(this.accumulation.renderer,new ko(d+"text_"+l.index,c.x,c.y,this.accumulation.enableRtl?"end":"start",l.labelCollection,y,"auto",g),l.argsData.font,l.argsData.font.color||this.getSaturatedColor(l,l.argsData.color),p,!1,o,!0,!1,this.accumulation.duration,null,0,null,null,!0,this.accumulation.themeStyle.datalabelFont),u=null),h&&"None"!==this.accumulation.highlightMode){p.setAttribute("class",h.getAttribute("class")?h.getAttribute("class"):"");for(var v=0;v<p.children.length;v++){var b=document.getElementById(p.children[v].id);b&&(p.children[v].style.opacity=b.style.opacity)}}this.accumulation.accumulationLegendModule&&this.accumulation.legendSettings.visible&&!this.accumulation.redraw&&("Outside"===t.position||this.accumulation.enableSmartLabels)&&this.accumulation.visibleSeries[0].findMaxBounds(this.accumulation.visibleSeries[0].labelBound,l.labelRegion),"Outside"===l.labelPosition&&(f=(m=ie(d+"connector_"+l.index))?m.getAttribute("d"):"",O0e(!1,p,this.accumulation.renderer.drawPath(new No(d+"connector_"+l.index,"transparent",t.connectorStyle.width,t.connectorStyle.color||l.color,1,t.connectorStyle.dashArray,this.getConnectorPath(Pe({},l.labelRegion,null,!0),l,t,l.labelAngle))),o,!0,null,null,null,f,!1,!1,null,this.accumulation.duration)),O0e(!1,i,p,o)}else ie(p.id)&&ie(p.id).parentNode.removeChild(ie(p.id))}}"Pie"===this.accumulation.type&&"Normal"===t.textWrap&&"Clip"===t.textOverflow&&this.dataLabelClipPath(t,i)},xxe.prototype.dataLabelClipPath=function(e,t){var i,n,o,r,s,a=this.accumulation.element.id+"_datalabel_Series_0_",l=this.accumulation.renderer.createClipPath({id:a+"clipPath"}),h=this.accumulation.pieSeriesModule.pieBaseRadius;"Inside"===e.position?i=this.accumulation.renderer.drawCircle(new Sve(a+"clipPath_rect","transparent",{width:0},0,this.center.x,this.center.y,h)):e.maxWidth&&(n=this.center.x-h-ive(e.connectorStyle.length||"4%",h)-e.maxWidth,o=this.center.y-h-ive(e.connectorStyle.length||"4%",h)-e.maxWidth,r=h=2*(h+ive(e.connectorStyle.length||"4%",h)+e.maxWidth),this.accumulation.legendSettings.visible&&("Left"===(s=this.accumulation.accumulationLegendModule).position?(r=0<s.legendBounds.x+s.legendBounds.width-n?r-(s.legendBounds.width-n):r,n=s.legendBounds.x+s.legendBounds.width<n?n:s.legendBounds.x+s.legendBounds.width):"Right"===s.position&&(r=0<n+r-s.legendBounds.x?r-(n+r-s.legendBounds.x):r)),i=this.accumulation.renderer.drawRectangle(new vve(a+"clipPath_rect","transparent",{width:0},0,new Do(n,o,h,r),0,0))),"Inside"!==e.position&&!e.maxWidth||(l.appendChild(i),O0e(!1,this.accumulation.svgObject,l),t.style.cssText="clip-path:url(#"+l.id+")")},xxe.prototype.finalizeDatalabels=function(e,t,i){var n;(this.isOverlapping(e,t)||this.titleRect&&e.labelRegion&&j0e(e.labelRegion,this.titleRect))&&this.isCircular()&&"Outside"===e.labelPosition&&this.accumulation.enableSmartLabels&&this.setPointVisibileFalse(e),this.accumulation.accumulationLegendModule&&this.accumulation.legendSettings.visible&&e.labelVisible&&e.labelRegion&&!i.maxWidth&&("Clip"!==i.textOverflow||"Normal"!==i.textWrap)&&(t=this.accumulation.accumulationLegendModule.legendBounds,"Pie"!==this.accumulation.visibleSeries[0].type&&"Left"===this.accumulation.legendSettings.position&&"Outside"===i.position&&(e.labelRegion.x=e.labelRegion.x+t.width),n=this.accumulation.legendSettings.border.width/2,this.textTrimming(e,new Do(t.x-n,t.y-n,t.width+2*n,t.height+2*n),i.font,this.accumulation.accumulationLegendModule.position,i)),!e.labelVisible||!e.labelRegion||i.maxWidth||"Clip"===i.textOverflow&&"Normal"===i.textWrap||(t=this.isCircular()?e.labelRegion.x>=this.center.x?"InsideRight":"InsideLeft":e.labelRegion.x>=e.region.x?"InsideRight":"InsideLeft",this.textTrimming(e,this.areaRect,i.font,t,i)),e.labelVisible&&e.labelRegion&&!i.maxWidth&&"Clip"!==i.textOverflow&&this.accumulation.enableSmartLabels&&(e.labelRegion.y+e.labelRegion.height/2>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)},xxe.prototype.getTemplateSize=function(e,t,i,n,o,r,s,a,l){t=B0e(e=k0e(e,t.index,i.template,this.accumulation,t,this.accumulation.visibleSeries[0],this.accumulation.element.id+"_DataLabel",0,i,o,r,s,a,l,n),n);return{width:t.width,height:t.height}},xxe.prototype.setTemplateStyle=function(e,t,i,n,o,r){e.style.left=t.labelRegion.x+"px",e.style.top=t.labelRegion.y+"px",e.style.color=n||this.getSaturatedColor(t,"Inside"===t.labelPosition?o:this.getLabelBackground(t)),this.accumulation.isBlazor&&(n=this.isCircular()?t.labelRegion.x>=this.center.x?"InsideRight":"InsideLeft":t.labelRegion.x>=t.region.x?"InsideRight":"InsideLeft",e.style.transform="InsideRight"==n?"translate(0%, -50%)":"translate(-100%, -50%)"),e.childElementCount&&(O0e(!1,i,e,r,!0,"left","top"),this.doTemplateAnimation(this.accumulation,e))},xxe.prototype.getSaturatedColor=function(e,t){e=!(1<=this.marginValue)||"transparent"===t?this.getLabelBackground(e):t,t=G0e(Y0e(e="transparent"===e?-1<this.accumulation.theme.indexOf("Dark")||-1<this.accumulation.theme.indexOf("HighContrast")?"black":"white":e)),e=Math.round((299*t.r+587*t.g+114*t.b)/1e3);return"Bootstrap5"===this.accumulation.theme?"#212529":"Bootstrap5Dark"===this.accumulation.theme?"#DEE2E6":128<=e?-1<this.accumulation.theme.indexOf("Tailwind3")?"#111827":"black":-1<this.accumulation.theme.indexOf("Tailwind3")?"#FFFFFF":"white"},xxe.prototype.doTemplateAnimation=function(e,t){var i=e.visibleSeries[0],n=i.animation.delay+i.animation.duration;(i.animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&e.animateSeries&&(t.style.visibility="hidden",S0e(t,n,200,"ZoomIn"))},xxe.prototype.getLabelBackground=function(e){return"Outside"===e.labelPosition?this.accumulation.background||this.accumulation.themeStyle.background:e.y?e.color:this.accumulation.theme.indexOf("dark")?"white":"black"},xxe.prototype.correctLabelRegion=function(e,t,i){e.height-=i=void 0===i?4:i,e.width-=i,e.x+=i/2,e.y+=i/2,t.height-=i,t.width-=i},xxe.prototype.getModuleName=function(){return"AccumulationDataLabel"},xxe.prototype.destroy=function(){},xxe.prototype.extendedLabelsCalculation=function(){var n=this,e=this.accumulation.series[0];e.rightSidePoints.forEach(function(e,t,i){e.initialLabelRegion=e.labelRegion,e.isLabelUpdated=0,n.skipPoints(e,i,t)}),e.leftSidePoints.forEach(function(e,t,i){e.initialLabelRegion=e.labelRegion,e.isLabelUpdated=0,n.skipPoints(e,i,t)}),this.arrangeLeftSidePoints(e),this.isIncreaseAngle=!1,this.arrangeRightSidePoints(e)},xxe.prototype.arrangeRightSidePoints=function(e){var t,i,n,o,r=e.rightSidePoints.filter(function(e){return e.labelVisible&&"Outside"===e.labelPosition}),s=(this.rightSideRenderingPoints=r)[r.length-1];s&&90<s.labelAngle&&s.labelAngle<270&&(this.isIncreaseAngle=!0,this.changeLabelAngle(s,89));for(var a=r.length-1;0<=a;a--)if(n=r[a],o=r[a+1],this.isOverlapWithNext(n,r,a)&&n.labelVisible||!(n.labelAngle<=90||270<=n.labelAngle))if(n=s.labelAngle+10,i=!0,t?this.isIncreaseAngle=!1:90<n&&n<270&&o.isLabelUpdated&&(this.isIncreaseAngle=!0),this.isIncreaseAngle)for(l=a+1;0<l;l--)this.decreaseAngle(r[l],r[l-1],e,!0);else for(var l=a+1;l<r.length;l++)this.increaseAngle(r[l-1],r[l],e,!0);else i&&o&&!o.isLabelUpdated&&(t=!0)},xxe.prototype.arrangeLeftSidePoints=function(e){var t,i,n,o,r=this,s=e.leftSidePoints.filter(function(e){return e.labelVisible&&"Outside"===e.labelPosition});this.leftSideRenderingPoints=s;for(var a=0;a<s.length;a++)if(i=s[a],t=s[a-1],this.isOverlapWithPrevious(i,s,a)&&i.labelVisible||!(i.labelAngle<270))if(n=!0,o&&(this.isIncreaseAngle=!1),this.isIncreaseAngle)for(l=a;l<s.length;l++)this.increaseAngle(s[l-1],s[l],e,!1);else for(var l=a;0<l;l--)this.decreaseAngle(s[l],s[l-1],e,!1),s.filter(function(e,t){e.isLabelUpdated&&s[t].labelAngle-10<100&&(r.isIncreaseAngle=!0)});else n&&t&&t.isLabelUpdated&&(o=!0)},xxe.prototype.decreaseAngle=function(e,t,i,n){if(je(e)||je(t))return null;var o,r=1;if(n)for(;j0e(e.labelRegion,t.labelRegion)||!this.isVariousRadius()&&!(t.labelRegion.height+t.labelRegion.y<e.labelRegion.y);){if((o=(o=t.midAngle-r)<0?360+o:o)<=270&&90<=o){o=270,this.isIncreaseAngle=!0;break}this.changeLabelAngle(t,o),r++}else for(270<e.labelAngle&&(this.changeLabelAngle(e,270),t.labelAngle=270);j0e(e.labelRegion,t.labelRegion)||!this.isVariousRadius()&&e.labelRegion.y+e.labelRegion.height>t.labelRegion.y;){if(!((o=t.midAngle-r)<=270&&90<=o)){o=90,this.isIncreaseAngle=!0;break}if(this.changeLabelAngle(t,o),j0e(e.labelRegion,t.labelRegion)&&!i.leftSidePoints.indexOf(t)&&o-1<90&&270<o-1){this.changeLabelAngle(e,e.labelAngle+1),this.arrangeLeftSidePoints(i);break}r++}},xxe.prototype.increaseAngle=function(e,t,i,n){if(je(e)||je(t))return null;var o,r=1;if(n)for(;j0e(e.labelRegion,t.labelRegion)||!this.isVariousRadius()&&!(e.labelRegion.y+e.labelRegion.height<t.labelRegion.y);){if((o=t.midAngle+r)<270&&90<o){o=90,this.isIncreaseAngle=!0;break}if(this.changeLabelAngle(t,o),j0e(e.labelRegion,t.labelRegion)&&90<o+1&&o+1<270&&this.rightSideRenderingPoints.indexOf(t)===this.rightSideRenderingPoints.length-1){this.changeLabelAngle(e,e.labelAngle-1),t.labelRegion=t.initialLabelRegion,this.arrangeRightSidePoints(i);break}if(360<r)break;r++}else for(;j0e(e.labelRegion,t.labelRegion)||!this.isVariousRadius()&&e.labelRegion.y<t.labelRegion.y+t.labelRegion.height;){if(!((o=t.midAngle+r)<270&&90<o)){this.isIncreaseAngle=!(o=270);break}if(this.changeLabelAngle(t,o),360<r)break;r++}},xxe.prototype.changeLabelAngle=function(e,t){var i=this.accumulation.series[0].dataLabel,i=(this.isVariousRadius()&&(n=this.accumulation.pieSeriesModule.getLabelRadius(this.accumulation.visibleSeries[0],e)),"Outside"===e.labelPosition&&this.accumulation.enableSmartLabels&&"Inside"===i.position?this.radius+ive(i.connectorStyle.length||"4%",this.accumulation.pieSeriesModule.size/2):this.isVariousRadius()?n:this.accumulation.pieSeriesModule.labelRadius+10),n=this.isVariousRadius()?n:i;this.getLabelRegion(e,"Outside",e.textSize,n,this.marginValue,t),e.isLabelUpdated=1,e.labelAngle=t},xxe.prototype.isOverlapWithPrevious=function(e,t,i){for(var n=0;n<i;n++)if(n!==t.indexOf(e)&&t[n].visible&&t[n].labelVisible&&t[n].labelRegion&&e.labelRegion&&e.labelVisible&&j0e(e.labelRegion,t[n].labelRegion))return!0;return!1},xxe.prototype.isOverlapWithNext=function(e,t,i){for(var n=i;n<t.length;n++)if(n!==t.indexOf(e)&&t[n].visible&&t[n].labelVisible&&t[n].labelRegion&&e.labelRegion&&e.labelVisible&&j0e(e.labelRegion,t[n].labelRegion))return!0;return!1},xxe.prototype.skipPoints=function(e,t,i){var n,o,r;0<i&&(e.midAngle<285&&255<e.midAngle||e.midAngle<105&&75<e.midAngle)?(n=t[i-1],o=e.endAngle%360-e.startAngle%360,(r=n.endAngle%360-n.startAngle%360)<=o&&o<5&&n.labelVisible&&this.setPointVisibleTrue(e)):1<i&&(e.midAngle<300&&240<e.midAngle||e.midAngle<120&&60<e.midAngle)&&(n=t[i-1],t=t[i-2],o=e.endAngle%360-e.startAngle%360,r=n.endAngle%360-n.startAngle%360,i=t.endAngle%360-t.startAngle%360,o<3)&&r<3&&i<3&&n.labelVisible&&e.labelVisible&&this.setPointVisibleTrue(e)},xxe.prototype.getPerpendicularDistance=function(e,t){var i=10+10*Math.sin(t.midAngle*Math.PI/360),e=270<t.midAngle&&t.midAngle<360?new Tve(e.x+i*Math.cos((360-t.midAngle)*Math.PI/180),e.y-i*Math.sin((360-t.midAngle)*Math.PI/180)):0<t.midAngle&&t.midAngle<90?new Tve(e.x+i*Math.cos(t.midAngle*Math.PI/180),e.y+i*Math.sin(t.midAngle*Math.PI/180)):0<t.midAngle&&t.midAngle<90?new Tve(e.x-i*Math.cos((t.midAngle-90)*Math.PI/180),e.y+i*Math.sin((t.midAngle-90)*Math.PI/180)):new Tve(e.x-i*Math.cos((t.midAngle-180)*Math.PI/180),e.y-i*Math.sin((t.midAngle-180)*Math.PI/180));return e};var Cxe,Sxe,Axe=xxe;function xxe(e){var t=Sxe.call(this,e)||this;return t.rightSideRenderingPoints=[],t.leftSideRenderingPoints=[],t.id=e.element.id+"_datalabel_Series_",t}Ixe=function(e,t){return(Ixe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Ixe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Dxe,Txe=MAe),Dxe.prototype.addEventListener=function(){this.accumulation.isDestroyed||(this.accumulation.on(F.isPointer?"pointerleave":"mouseleave",this.mouseLeaveHandler,this),this.accumulation.on(F.touchMoveEvent,this.mouseMoveHandler,this),this.accumulation.on(F.touchEndEvent,this.mouseUpHandler,this))},Dxe.prototype.mouseLeaveHandler=function(){this.removeTooltip(this.accumulation.tooltip.fadeOutDuration)},Dxe.prototype.mouseUpHandler=function(e){var t=this.accumulation;t.tooltip.enable&&t.isTouch&&o0e(t.mouseX,t.mouseY,t.initialClipRect)&&(this.tooltip(e),this.removeTooltip(2e3))},Dxe.prototype.mouseMoveHandler=function(e){var t=this.accumulation;t.tooltip.enable&&o0e(t.mouseX,t.mouseY,t.initialClipRect)&&this.tooltip(e)},Dxe.prototype.tooltip=function(e){this.renderSeriesTooltip(this.accumulation,this.getPieData(e,this.accumulation))},Dxe.prototype.renderSeriesTooltip=function(e,t){var i=this.getElement(this.element.id+"_tooltip_svg"),i=i&&0<parseInt(i.getAttribute("opacity"),10),n=this.getTooltipElement(i),i=!i;if(this.currentPoints=[],!t.point||this.previousPoints[0]&&this.previousPoints[0].point===t.point)!t.point&&this.isRemove&&(this.removeTooltip(this.accumulation.tooltip.fadeOutDuration),this.isRemove=!1);else{if(this.previousPoints[0]&&t.point.index===this.previousPoints[0].point.index&&t.series.index===this.previousPoints[0].series.index)return null;this.pushData(t,i,n,!1)&&this.triggerTooltipRender(t,i,this.getTooltipText(t,e.tooltip),this.findHeader(t))}},Dxe.prototype.triggerTooltipRender=function(t,i,e,n){function o(e){e.cancel?(r.removeHighlight(),ue(r.getElement(r.element.id+"_tooltip"))):(r.formattedText=r.formattedText.concat(e.text),r.text=r.formattedText,r.headerText=e.headerText,r.createTooltip(r.chart,i,{x:(null!==s.location.x?s.location:t.point.symbolLocation).x,y:(null!==s.location.y?s.location:t.point.symbolLocation).y},t.series.clipRect,t.point,s.enableMarker?["Circle"]:[],0,r.chart.initialClipRect,!1,null,t.point,r.template?r.accumulation.enableHtmlSanitizer?r.accumulation.sanitize(r.template):e.template:"")),r.isRemove=!0}var r=this,s=this.chart.tooltip,e={cancel:!1,name:Xme,text:e,point:t.point,textStyle:this.textStyle,series:this.accumulation.isBlazor?{}:t.series,headerText:n,data:{pointX:t.point.x,pointY:t.point.y,seriesIndex:t.series.index,pointIndex:t.point.index,pointText:t.point.text,seriesName:t.series.name}};o.bind(this,t),this.chart.trigger(Xme,e,o)},Dxe.prototype.getPieData=function(e,t){e=Kye(e.target.id,!0);if(!isNaN(e.series)){var i=e.series,e=e.point;if(!(je(i)||isNaN(i)||je(e)||isNaN(e))){i=this.getSeriesFromIndex(i,t.visibleSeries);if(i.enableTooltip)return new kve(i.points[e],i)}}return new kve(null,null)},Dxe.prototype.getSeriesFromIndex=function(e,t){return t[0]},Dxe.prototype.getTooltipText=function(e,t){var i=e.series,t=t.format||(-1<this.accumulation.theme.indexOf("Tailwind3")?"${point.x} : ${point.y}":"${point.x} : <b>${point.y}</b>"),t=this.accumulation.useGroupingSeparator?t.replace("${point.y}","${point.separatorY}"):t;return this.parseTemplate(e.point,i,t)},Dxe.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:""},Dxe.prototype.parseTemplate=function(e,t,i){for(var n,o=RegExp,r=0,s=Object.keys(e);r<s.length;r++){var a=new o("${point."+(h=s[r])+"}","gm"),l="x"===h&&this.accumulation.useGroupingSeparator&&"number"==typeof e[h]?this.accumulation.intl.formatNumber(e.x,{useGrouping:!0}):e[h];i=i.replace(a.source,l)}for(var h,d=0,p=Object.keys(Object.getPrototypeOf(t));d<p.length;d++)a=new o("${series."+(h=p[d])+"}","gm"),n=t[h],i=i.replace(a.source,n);return i},Dxe.prototype.getModuleName=function(){return"AccumulationTooltip"},Dxe.prototype.destroy=function(){};var Ixe,Txe,Exe=Dxe;function Dxe(e){var t=Txe.call(this,e)||this;return t.accumulation=e,t.addEventListener(),t.template=t.accumulation.tooltip.template,t}Mxe=function(e,t){return(Mxe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Mxe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Pxe,kxe=CAe),Pxe.prototype.addEventListener=function(){this.accumulation.isDestroyed||(this.accumulation.on(F.touchMoveEvent,this.mouseMove,this),this.accumulation.on("click",this.mouseClick,this))},Pxe.prototype.removeEventListener=function(){this.accumulation.isDestroyed||(this.accumulation.off(F.touchMoveEvent,this.mouseMove),this.accumulation.off("click",this.mouseClick))},Pxe.prototype.initPrivateVariables=function(e){this.styleId=e.element.id+"_ej2_chart_selection",this.unselected=e.element.id+"_ej2_deselected",this.selectedDataIndexes=[],this.rectPoints=null},Pxe.prototype.invokeSelection=function(e){this.initPrivateVariables(e),this.series=Pe({},e.visibleSeries,null,!0),this.seriesStyles(),this.currentMode=e.selectionMode,this.selectDataIndex(this.concatIndexes(e.selectedDataIndexes,this.selectedDataIndexes),e)},Pxe.prototype.generateStyle=function(e,t){return e.selectionStyle||this.styleId+"_series_"+e.index+"_point_"+t},Pxe.prototype.findElements=function(e,t,i){return[this.getElementByIndex(i)]},Pxe.prototype.getElementByIndex=function(e){e=this.control.element.id+"_Series_"+e.series+"_Point_"+e.point;return document.getElementById(e)},Pxe.prototype.isAlreadySelected=function(e,t){if("mousemove"===t?(this.currentMode=this.accumulation.highlightMode,this.highlightDataIndexes=[],this.styleId=this.accumulation.element.id+"_ej2_chart_highlight"):"click"===t&&(this.currentMode=this.accumulation.selectionMode,this.styleId=this.accumulation.element.id+"_ej2_chart_selection"),"None"!==this.accumulation.highlightMode&&"None"===this.accumulation.selectionMode&&"click"===t)return!1;if("None"!==this.accumulation.highlightMode&&this.previousSelectedElement&&this.previousSelectedElement[0]){var i=e.parentNode.id,n=void 0;e.parentNode&&(n=0<i.indexOf("SeriesGroup")||0<i.indexOf("SymbolGroup"));for(var o=0;o<this.previousSelectedElement.length;o++)this.previousSelectedElement[o].hasAttribute("class")&&(-1<this.previousSelectedElement[o].getAttribute("class").indexOf("highlight")&&(n||"click"===t)?(this.previousSelectedElement[o].removeAttribute("class"),this.addOrRemoveIndex(this.highlightDataIndexes,Kye(this.previousSelectedElement[o].id))):!n&&-1<this.previousSelectedElement[o].getAttribute("class").indexOf("highlight")&&this.performSelection(Kye(this.previousSelectedElement[o].id),this.accumulation,this.previousSelectedElement[o]))}return!0},Pxe.prototype.mouseClick=function(e,t){this.calculateSelectedElements(e,t.target,t.type)},Pxe.prototype.calculateSelectedElements=function(e,t,i){if(!je(t)&&("None"!==e.highlightMode||"None"!==e.selectionMode)&&-1!==t.id.indexOf(e.element.id+"_")&&("mousemove"!==i||je(t.parentNode)||!t.parentNode.hasAttribute("class")||!(0<t.parentNode.getAttribute("class").indexOf("highlight")||0<t.parentNode.getAttribute("class").indexOf("selection")))&&!(-1<t.getAttribute("id").indexOf("_connector_"))){if(this.isAlreadySelected(t,i),"Point"===this.accumulation.selectionMode&&"mousemove"===i&&this.accumulation.accumulationLegendModule&&this.accumulation.accumulationHighlightModule.highlightDataIndexes&&0<this.accumulation.accumulationHighlightModule.highlightDataIndexes.length&&-1===t.id.indexOf("_chart_legend_")&&-1===t.id.indexOf("_Series_"))for(var n=0;n<this.accumulation.accumulationHighlightModule.previousSelectedElement.length;n++)this.removeStyles(this.accumulation.accumulationHighlightModule.previousSelectedElement,Kye(this.accumulation.accumulationHighlightModule.previousSelectedElement[n].id)),this.blurEffect(this.accumulation.element.id,this.accumulation.visibleSeries);(-1<t.id.indexOf("_Series_")||-1<t.id.indexOf("_datalabel_"))&&this.performSelection(Kye(t.id),e,t)}},Pxe.prototype.performSelection=function(e,t,i){var n;i=-1<i.id.indexOf("datalabel")?t.getSeriesElement().childNodes[e.series].childNodes[e.point]:i,"Point"!==this.currentMode||isNaN(e.point)||(n=document.getElementById(t.element.id+"_datalabel_Series_"+e.series+"_g_"+e.point),this.series[0].dataLabel.visible&&n&&(n.setAttribute("class",i&&i.hasAttribute("class")?i.getAttribute("class"):n.hasAttribute("class")?n.getAttribute("class"):""),this.selection(t,e,[n])),this.selection(t,e,[i]),this.selectionComplete(t,t.series[0]),this.blurEffect(t.element.id,t.visibleSeries))},Pxe.prototype.selectionComplete=function(e,t){for(var i,n=[],o=0;o<this.selectedDataIndexes.length;o++)i=this.selectedDataIndexes[o].point,isNaN(i)||n.push({x:t.dataSource[i][t.xName],y:t.points[i].y,seriesIndex:this.selectedDataIndexes[o].series,pointIndex:i});e.trigger(afe,{name:afe,selectedDataValues:n,cancel:!1})},Pxe.prototype.selection=function(e,t,i){e.isMultiSelect||-1!==this.styleId.indexOf("highlight")||"None"===e.selectionMode||this.removeMultiSelectEelments(e,this.selectedDataIndexes,t,e.series);var n,o=i[0]&&(i[0].getAttribute("class")||"");i[0]&&-1<o.indexOf(this.getSelectionClass(i[0].id,t.point))?(this.removeStyles(i,t),0<this.styleId.indexOf("highlight")&&"None"!==e.highlightMode?this.addOrRemoveIndex(this.highlightDataIndexes,t):this.addOrRemoveIndex(this.selectedDataIndexes,t),e.enableBorderOnMouseMove&&-1===i[0].id.indexOf("datalabel")&&!je(n=document.getElementById(i[0].id.split("_")[0]+"PointHover_Border"))&&this.removeSvgClass(n,n.getAttribute("class"))):(this.previousSelectedElement="None"!==e.highlightMode?i:[],i[0]&&o.indexOf("selection")<0&&this.applyStyles(i,t),e.enableBorderOnMouseMove&&-1===i[0].id.indexOf("datalabel")&&!je(n=document.getElementById(i[0].id.split("_")[0]+"PointHover_Border"))&&(this.removeSvgClass(n,n.getAttribute("class")),this.addSvgClass(n,i[0].getAttribute("class"))),0<this.styleId.indexOf("highlight")&&"None"!==e.highlightMode?this.addOrRemoveIndex(this.highlightDataIndexes,t,!0):this.addOrRemoveIndex(this.selectedDataIndexes,t,!0))},Pxe.prototype.redrawSelection=function(e){var t=Pe([],this.selectedDataIndexes,null,!0),i=Pe([],this.highlightDataIndexes,null,!0);0<this.styleId.indexOf("highlight")&&0<i.length?(this.removeSelectedElements(e,this.highlightDataIndexes),t=i):this.removeSelectedElements(e,this.selectedDataIndexes),this.blurEffect(e.element.id,e.visibleSeries),this.selectDataIndex(t,e)},Pxe.prototype.removeSelectedElements=function(e,t){for(var i=0,n=t;i<n.length;i++){var o=n[i];this.removeStyles([this.getElementByIndex(o)],o)}for(var r=e.visibleSeries[0].points,s=0;s<r.length;s++){o=new kme(0,r[s].index);this.removeStyles([this.getElementByIndex(o)],o),e.visibleSeries[0].dataLabel.visible&&this.removeStyles([document.getElementById(e.element.id+"_datalabel_Series_0_g_"+r[s].index)],o)}},Pxe.prototype.legendSelection=function(e,t,i,n,o){if("mousemove"===o){if((n=1<n.id.indexOf("text")?ie(n.id.replace("text","shape")):n).hasAttribute("class")&&(-1<n.getAttribute("class").indexOf("highlight")||-1<n.getAttribute("class").indexOf("selection")))return;this.currentMode=this.accumulation.highlightMode}this.isAlreadySelected(n,o)&&(n=e.getSeriesElement().childNodes[t].childNodes[i],o=document.getElementById(e.element.id+"_datalabel_Series_"+t+"_g_"+i),this.series[0].dataLabel.visible&&o&&this.selection(e,new kme(t,i),[o]),this.selection(e,new kme(t,i),[n]),this.blurEffect(e.element.id,e.visibleSeries))},Pxe.prototype.selectDataIndex=function(e,t){for(var i=0,n=e;i<n.length;i++){var o,r=n[i];(o=this.getElementByIndex(r))&&this.performSelection(r,t,o)}},Pxe.prototype.removeMultiSelectEelments=function(e,t,i,n){for(var o,r=0;r<t.length;r++)o=n[t[r].series],this.checkEquals(t[r],i)||(this.removeStyles(this.findElements(e,o,t[r]),t[r]),o.dataLabel.visible&&this.removeStyles([document.getElementById(e.element.id+"_datalabel_Series_0_g_"+t[r].point)],t[r]),t.splice(r,1),r--)},Pxe.prototype.blurEffect=function(e,t){for(var i=this.checkVisibility(this.highlightDataIndexes)||this.checkVisibility(this.selectedDataIndexes),n=0,o=t;n<o.length;n++){var r=o[n];r.visible&&this.checkSelectionElements(document.getElementById(e+"_SeriesCollection"),this.generateStyle(r),i)}},Pxe.prototype.checkSelectionElements=function(e,t,i){var n,o,r,s=[],e=(e.childNodes[0].childNodes.forEach(function(e){return s.push(e)}),document.getElementById(this.control.element.id+"_datalabel_Series_0"));e&&e.childNodes.forEach(function(e){return s.push(e)});for(var a=0;a<s.length;a++)o=s[a].getAttribute("class")||"",r=s[a].parentNode.getAttribute("class")||"","None"===this.accumulation.selectionMode&&"None"===this.accumulation.highlightMode||(t=0<o.indexOf("selection")||0<o.indexOf("highlight")?o:t,t=0<r.indexOf("selection")||0<r.indexOf("highlight")?r:t),-1===o.indexOf(t)&&-1===r.indexOf(t)&&i?this.addSvgClass(s[a],this.unselected):this.removeSvgClass(s[a],this.unselected),-1===o.indexOf(t)&&-1===r.indexOf(t)&&i?this.addSvgClass(s[a],this.unselected):(this.removeSvgClass(s[a],this.unselected),this.removeSvgClass(s[a].parentNode,this.unselected)),this.control.accumulationLegendModule&&this.control.legendSettings.visible&&(n=document.getElementById(this.control.element.id+"_chart_legend_shape_"+a))&&(-1===o.indexOf(t)&&-1===r.indexOf(t)&&i?this.addSvgClass(n,this.unselected):this.removeSvgClass(n,this.unselected))},Pxe.prototype.applyStyles=function(e,t){for(var i=this.control.accumulationTooltipModule,n=0,o=e;n<o.length;n++){var r=o[n],s=void 0;r&&(this.control.accumulationLegendModule&&this.control.legendSettings.visible&&(s=document.getElementById(this.control.element.id+"_chart_legend_shape_"+t.point),this.removeSvgClass(s,s.getAttribute("class")),this.addSvgClass(s,this.getSelectionClass(s.id,t.point))),this.removeSvgClass(r.parentNode,this.unselected),this.removeSvgClass(r,this.unselected),s=(i&&0<i.previousPoints.length&&i.previousPoints[0].point.index!==t.point?i.svgTooltip:this.series[t.series]).opacity,r.setAttribute("opacity",s.toString()),this.addSvgClass(r,this.getSelectionClass(r.id,t.point)))}},Pxe.prototype.getSelectionClass=function(e,t){return this.generateStyle(this.control.series[Kye(e).series],t)},Pxe.prototype.removeStyles=function(e,t){for(var i=this.control.accumulationTooltipModule,n=0,o=e;n<o.length;n++){var r,s=o[n];s&&(this.control.accumulationLegendModule&&this.control.legendSettings.visible&&(r=document.getElementById(this.control.element.id+"_chart_legend_shape_"+t.point),this.removeSvgClass(r,this.getSelectionClass(r.id,t.point))),r=(i&&0<i.previousPoints.length&&i.previousPoints[0].point.index===t.point?i.svgTooltip:this.series[t.series]).opacity,s.setAttribute("opacity",r.toString()),this.removeSvgClass(s,this.getSelectionClass(s.id,t.point)))}},Pxe.prototype.addOrRemoveIndex=function(e,t,i){for(var n=0;n<e.length;n++)this.checkEquals(e[n],t)&&(e.splice(n,1),n--);i&&e.push(t)},Pxe.prototype.checkEquals=function(e,t){return e.point===t.point&&e.series===t.series},Pxe.prototype.mouseMove=function(e){var t=this.accumulation,i=e.target;if("None"!==t.highlightMode&&!je(i))return(i=1<e.target.id.indexOf("text")?ie(e.target.id.replace("text","shape")):i).hasAttribute("class")&&-1<i.getAttribute("class").indexOf("highlight")?void 0:void this.calculateSelectedElements(t,e.target,e.type);t.selectionMode},Pxe.prototype.getModuleName=function(){return"AccumulationSelection"},Pxe.prototype.destroy=function(){this.removeEventListener()};var Mxe,kxe,F1e=Pxe;function Pxe(e){var t=kxe.call(this,e)||this;return t.accumulation=e,t.renderer=e.renderer,t.addEventListener(),t}Bxe=function(e,t){return(Bxe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Bxe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Lxe,Fxe=F1e),Lxe.prototype.wireEvents=function(){this.accumulation.isDestroyed||this.accumulation.on(F.touchMoveEvent,this.mouseMove,this)},Lxe.prototype.unWireEvents=function(){this.accumulation.isDestroyed||this.accumulation.off(F.touchMoveEvent,this.mouseMove)},Lxe.prototype.declarePrivateVariables=function(e){this.styleId=e.element.id+"_ej2_chart_highlight",this.unselected=e.element.id+"_ej2_deselected",this.selectedDataIndexes=[],this.highlightDataIndexes=[]},Lxe.prototype.invokeHighlight=function(e){this.declarePrivateVariables(e),this.series=Pe({},e.visibleSeries,null,!0),this.seriesStyles(),this.currentMode=e.highlightMode},Lxe.prototype.getModuleName=function(){return"AccumulationHighlight"},Lxe.prototype.destroy=function(){this.unWireEvents()};var Bxe,Fxe,Afe=Lxe;function Lxe(e){var t=Fxe.call(this,e)||this;return t.accumulation=e,t.renderer=e.renderer,t.wireEvents(),t}Rxe=function(e,t){return(Rxe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Rxe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Nxe,Oxe=$Ae),Nxe.prototype.renderAnnotations=function(e){var i=this,t=(this.annotations=this.pie.annotations,this.pie.redraw);this.parentElement=nve(t,this.pie.element.id+"_Annotation_Collections")||Q("div",{id:this.pie.element.id+"_Annotation_Collections"}),this.annotations.map(function(e,t){i.processAnnotation(e,t,i.parentElement)}),this.pie.series[0].animation.enable&&"Pie"===this.pie.series[0].type&&this.pie.animateSeries&&(this.parentElement.style.visibility="hidden"),R0e(this.parentElement,e,t)},Nxe.prototype.getModuleName=function(){return"Annotation"},Nxe.prototype.destroy=function(){};var Rxe,Oxe,$Ae=Nxe;function Nxe(e){var t=Oxe.call(this,e)||this;return t.pie=e,t}function Vxe(e,t,i){e=(e-t.min)/t.delta;return i?1-e:e}function _xe(e,t,i,n){return(e=Vxe(e,t,n))*i}function Hxe(e,t,i,n){return(n?1-e/t:e/t)*i.delta+i.min}function zxe(e,t,i){var n=[];return e.map(function(e){e.xValue>=t&&e.xValue<=i&&n.push({x:e.x,y:e.y})}),n}function jxe(e,i){return e.reduce(function(e,t){return Math.abs(t-i)<Math.abs(e-i)?t:e})}var Wxe=function(e,t,i,n,o){void 0===o&&(o=!0),this.x=e,this.y=t,this.xValue=i,this.visible=o};Qxe=function(e,t){return(Qxe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Qxe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Gxe,Uxe=Vbe),Gxe.prototype.renderChart=function(t){var i,n,o=this;this.seriesLength=0,t.rangeSlider.points=[],t.series.length?t.series.map(function(e){i=e.dataSource||t.dataSource,n=e.query||t.query,e.points=[],o.processDataSource(i,n,t,e)}):this.processDataSource(t.dataSource,t.query,t)},Gxe.prototype.processDataSource=function(e,t,i,n){var o=this;e instanceof me||je(e)||!je(t)?(i.dataModule=new Cbe(e,t),i.dataModule.getData(i.dataModule.generateQuery().requiresCount()).then(function(e){return o.dataManagerSuccess(e,i,n)})):this.dataManagerSuccess({result:e,count:e.length},i,n)},Gxe.prototype.dataManagerSuccess=function(e,t,i){e=e.count?e.result:[];t.allowServerDataBinding=!1,this.processJsonData(e,t,Object.keys(e).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())},Gxe.prototype.processJsonData=function(e,t,i,n){for(var o,r,s,a=0,l=n&&n.xName||t.xName,h=n&&n.yName||t.yName;a<i;)(s=new Wxe(R(l,e[a]),R(h,e[a]))).yValue=+s.y,-1<t.valueType.indexOf("DateTime")?(o=t.intl.getDateParser({skeleton:"full",type:"dateTime"}),r=t.intl.getDateFormat({skeleton:"full",type:"dateTime"}),s.x=new Date(Sa.parse.parseJson({val:s.x}).val),s.xValue=Date.parse(o(r(s.x))),"DateTimeCategory"===t.valueType&&(void 0===this.indexLabels[s.xValue.toString()]&&(this.indexLabels[s.xValue.toString()]=this.labels.length,this.labels.push(s.xValue.toString())),s.xValue=this.indexLabels[s.xValue])):s.xValue=+s.x,n&&n.points.push(s),this.xMin=Math.min(this.xMin,s.xValue),this.yMin=Math.min(this.yMin,s.yValue),this.xMax=Math.max(this.xMax,s.xValue),this.yMax=Math.max(this.yMax,s.yValue),t.rangeSlider.points.push(s),a++},Gxe.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},t=(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",this.xAxis.labels=this.labels,this.xAxis.indexLabels=this.indexLabels,e[l0e(e.valueType)+"Module"]);t.min=this.xMin,t.max=this.xMax,t.getActualRange(this.xAxis,e.bounds),"Double"!==this.xAxis.valueType&&"DateTime"!==this.xAxis.valueType&&"DateTimeCategory"!==this.xAxis.valueType||t.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,t.calculateVisibleLabels(this.xAxis,e),"DateTimeCategory"===this.xAxis.valueType&&e.periodSelectorModule&&(e.periodSelectorModule.isDatetimeCategory=!0,e.periodSelectorModule.sortedData=this.labels.map(function(e){return parseInt(e,10)}))},Gxe.prototype.processYAxis=function(e){this.yAxis={majorGridLines:{width:0},rangePadding:"None",majorTickLines:{width:0},labelStyle:{size:"0"},visible:!1,valueType:"Double",minimum:null,maximum:null,interval:null},this.yAxis.rect=e.bounds,this.yAxis.maximumLabels=3,this.yAxis.intervalDivs=[10,5,2,1],this.yAxis.orientation="Vertical",this.yMin===this.yMax&&(this.yMax+=1,--this.yMin),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},Gxe.prototype.renderSeries=function(n){var o=this,r=(this.chartGroup=n.renderer.createGroup({id:n.element.id+"_chart"}),Vve(n.theme));n.series.map(function(e,t){if(!n.stockChart||n.stockChart.series[t].visible){if(e.xAxis=o.xAxis,e.yAxis=o.yAxis,e.chart=n,e.index=t,e.xAxis.isInversed=n.enableRtl,e.interior=e.fill||r[t%r.length],o.createSeriesElement(n,e,t),"DateTimeCategory"===e.xAxis.valueType)for(var i=0;i<e.points.length;i++)e.points[i].xValue=o.xAxis.labels.indexOf(Date.parse(e.points[i].x.toString()).toString());(n[l0e(e.type)+"SeriesModule"]?n[l0e(e.type)+"SeriesModule"]:n.lineSeriesModule).render(e,o.xAxis,o.yAxis,!1),o.chartGroup.appendChild(e.seriesElement),(e.animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&n.animateSeries&&n[l0e(e.type)+"SeriesModule"]&&n[l0e(e.type)+"SeriesModule"].doAnimation(e)}})},Gxe.prototype.appendSeriesElements=function(e){e.svgObject.appendChild(this.chartGroup),e.series.length&&this.drawSeriesBorder(e)},Gxe.prototype.createSeriesElement=function(e,t,i){var n=e.element.id;t.clipRect=new Do(this.xAxis.rect.x,this.yAxis.rect.y,this.xAxis.rect.width,this.yAxis.rect.height),t.clipRectElement=e.renderer.drawClipPath(new vve(n+"_RangeSeriesClipRect_"+i,"transparent",{width:1,color:"Gray"},1,{x:0,y:0,width:t.clipRect.width,height:t.clipRect.height})),t.seriesElement=e.renderer.createGroup({id:n+"SeriesGroup"+i,transform:"translate("+t.clipRect.x+","+t.clipRect.y+")","clip-path":"url(#"+n+"_RangeSeriesClipRect_"+i+")"}),t.seriesElement.appendChild(t.clipRectElement)},Gxe.prototype.calculateGroupingBounds=function(e){var t=e.margin.bottom,i=So("string",e.labelStyle,e.themeStyle.axisLabelFont).height,n="DateTimeCategory"===e.valueType?parseInt(this.xAxis.labels[this.xMin],10):this.xMin,o="DateTimeCategory"===e.valueType?parseInt(this.xAxis.labels[this.xMax],10):this.xMax;this.calculateDateTimeNiceInterval(this.xAxis,new Eo(e.bounds.width,e.bounds.height),n,o,!1),!e.enableGrouping||"DateTime"!==e.valueType&&"DateTimeCategory"!==e.valueType||"Years"===this.xAxis.actualIntervalType&&e.series.length||(e.bounds.height-="Outside"===e.labelPosition||0===e.series.length?t+i:i+2*t),e.series.length||(e.bounds.y+=e.bounds.height/4,e.bounds.height=e.bounds.height/2)},Gxe.prototype.drawSeriesBorder=function(e){var t=e.stockChart?"M":"L",i=e.stockChart?"":"Z",t=new No(e.element.id+"_SeriesBorder","transparent",e.navigatorBorder.width,e.navigatorBorder.color||(-1<e.theme.indexOf("Dark")?"#49454F":"#DDDDDD"),1,e.navigatorBorder.dashArray,"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)+i),i=e.renderer.drawPath(t);e.svgObject.appendChild(i)};var Qxe,Uxe,qxe=Gxe;function Gxe(e){var t=Uxe.call(this)||this;return t.dataSource=e.dataSource,t.xName=e.xName,t.yName=e.yName,t.query=e.query,t.xMin=1/0,t.xMax=-1/0,t.yMin=1/0,t.yMax=-1/0,t.labels=[],t.indexLabels={},t}Yxe=function(e,t){return(Yxe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Yxe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Jxe,Xxe=Ube),Jxe.prototype.renderGridLines=function(){for(var e,t=this.rangeNavigator,i=t.majorGridLines,n=t.majorTickLines,o="",r="",s=t.bounds,a=t.chartSeries.xAxis,l=t.disableRangeSelector?"transparent":null,h=(this.gridLines=t.renderer.createGroup({id:t.element.id+"_GridLines"}),"Outside"===t.tickPosition||0===t.series.length?s.y+s.height+n.height:s.y+s.height-n.height),d=(this.firstLevelLabels=[],a.labelStyle=t.labelStyle,a.skeleton=t.skeleton,a.skeletonType=t.skeletonType,a.isChart=!1,-1<t.valueType.indexOf("DateTime")&&(c=this.calculateDateTimeNiceInterval(a,s,a.doubleRange.start,a.doubleRange.end,a.isChart),"DateTime"===t.valueType&&this.findAxisLabels(a,c),this.actualIntervalType=a.actualIntervalType,"DateTimeCategory"!==t.valueType||"Quarter"!==this.actualIntervalType&&"Weeks"!==this.actualIntervalType||this.findSecondaryAxisLabels(a)),this.firstLevelLabels=a.visibleLabels,this.lowerValues=[],a.visibleLabels.length),p=0;p<d;p++)this.lowerValues.push(this.firstLevelLabels[p].value),(e=Yye(this.firstLevelLabels[p].value,a)*s.width+s.x)>=s.x&&s.x+s.width>=e&&(o=o.concat("M "+e+" "+(t.bounds.y+t.bounds.height)+" L "+e+" "+t.bounds.y+" "),r=r.concat("M "+e+" "+(s.y+s.height)+" L "+e+" "+h+" "));var c=new No(t.element.id+"_MajorGridLine","transparent",i.width,t.series.length?l||i.color||t.themeStyle.gridLineColor:"transparent",1,i.dashArray,o);this.gridLines.appendChild(t.renderer.drawPath(c)),c=new No(t.element.id+"_MajorTickLine","transparent",n.width,l||n.color||t.themeStyle.gridLineColor,1,i.dashArray,r),this.gridLines.appendChild(t.renderer.drawPath(c))},Jxe.prototype.renderAxisLabels=function(){var e,t=this.rangeNavigator.chartSeries.xAxis,i=this.rangeNavigator,n=i.renderer.createGroup({id:i.element.id+"_AxisLabels"}),o=i.renderer.createGroup({id:i.element.id+"_FirstLevelAxisLabels"}),r=i.renderer.createGroup({id:i.element.id+"_SecondLevelAxisLabels"}),s=t,a=this.findLabelY(i,!1);this.placeAxisLabels(t,a,"_AxisLabel_",i,o),s.intervalType=s.actualIntervalType=i.groupBy||this.getSecondaryLabelType(t.actualIntervalType),s.labelFormat="",i.enableGrouping&&-1<i.valueType.indexOf("DateTime")&&"Years"!==this.actualIntervalType&&(s.visibleRange.interval=1,s.visibleLabels=[],e=this.calculateDateTimeNiceInterval(s,i.bounds,s.doubleRange.start,s.doubleRange.end,s.isChart),"DateTime"===i.valueType?this.findAxisLabels(s,e):this.findSecondaryAxisLabels(s),this.secondLevelLabels=s.visibleLabels,a=this.findLabelY(i,!0),e=this.placeAxisLabels(s,a,"_SecondaryLabel_",i,r),a=new No(i.element.id+"_SecondaryMajorLines","transparent",i.majorTickLines.width,i.majorTickLines.color||i.themeStyle.gridLineColor,1,i.majorGridLines.dashArray,e),this.gridLines.appendChild(i.renderer.drawPath(a))),i.chartSeries.xAxis.visibleLabels=i.chartSeries.xAxis.visibleLabels.concat(s.visibleLabels),n.style.cursor=-1<t.valueType.indexOf("DateTime")?"cursor: pointer":"cursor: default",n.appendChild(o),n.appendChild(r),i.svgObject.appendChild(this.gridLines),i.svgObject.appendChild(n)},Jxe.prototype.getSecondaryLabelType=function(e){var t=["Years","Quarter","Months","Weeks","Days","Hours","Minutes","Seconds"];return"Years"===e?"Years":t[t.indexOf(e)-1]},Jxe.prototype.findSecondaryAxisLabels=function(e){var t;e.visibleLabels=[],e.visibleRange.interval=Math.max(e.visibleRange.interval,1),this.rangeNavigator.format=this.rangeNavigator.intl.getDateFormat({format:e.labelFormat||"",type:l0e(e.skeleton),skeleton:this.getSkeleton(e,null,null)});for(var i,n,o=Math.ceil(e.visibleRange.min);o<=e.visibleRange.max;o+=e.visibleRange.interval)(!this.rangeNavigator.dateTimeCategoryModule.sameInterval(e.labels.map(Number)[o],e.labels.map(Number)[o-e.visibleRange.interval],e.actualIntervalType,o)||e.isIndexed)&&Rye(o,e.visibleRange)&&this.rangeNavigator.dateTimeCategoryModule.isMaximum(o,t,e)&&(i=new Date(e.labels.map(Number)[o]),"Quarter"===e.actualIntervalType&&(n=Math.floor(i.getMonth()/3),i.setMonth([0,3,6,9][n])),e.visibleLabels.push(new Iye(this.dateFormats(this.rangeNavigator.format(i),e,e.visibleLabels.length),o,this.rangeNavigator.labelStyle,this.rangeNavigator.format(i))),t=o)},Jxe.prototype.findAxisLabels=function(e,t){e.visibleLabels=[];var i,n,o=new Date(e.visibleRange.min);switch(t=this.rangeNavigator.interval||t,e.actualIntervalType){case"Years":o=new Date(o.getFullYear(),0,1);break;case"Quarter":o=o.getMonth()<=2?new Date(o.getFullYear(),0,1):o.getMonth()<=5?new Date(o.getFullYear(),3,1):o.getMonth()<=8?new Date(o.getFullYear(),6,1):new Date(o.getFullYear(),9,1);break;case"Months":o=new Date(o.getFullYear(),o.getMonth());break;case"Weeks":o=new Date(o.getFullYear(),o.getMonth(),o.getDate()-o.getDay());break;case"Days":o=new Date(o.getFullYear(),o.getMonth(),o.getDate());break;case"Hours":o=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours());break;case"Minutes":o=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes());break;case"Seconds":o=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds())}for(i=o.getTime(),this.rangeNavigator.format=this.rangeNavigator.intl.getDateFormat({format:e.labelFormat||"",type:l0e(e.skeletonType),skeleton:this.getSkeleton(e,null,null)});i<=e.visibleRange.max;)n=this.dateFormats(this.rangeNavigator.format(new Date(i)),e,e.visibleLabels.length),e.visibleLabels.push(new Iye(n,i,this.rangeNavigator.labelStyle,n)),i=this.increaseDateTimeInterval(e,i,t).getTime()},Jxe.prototype.dateFormats=function(e,t,i){var n=e,o=this.rangeNavigator.enableGrouping&&0===this.firstLevelLabels.length;switch(t.actualIntervalType){case"Quarter":-1<e.indexOf("Jan")?n=o?"Quarter1":e.replace("Jan","Quarter1"):-1<e.indexOf("Apr")?n=o?"Quarter2":e.replace("Apr","Quarter2"):-1<e.indexOf("Jul")?n=o?"Quarter3":e.replace("Jul","Quarter3"):-1<e.indexOf("Oct")&&(n=o?"Quarter4":e.replace("Oct","Quarter4"));break;case"Weeks":n="Week"+ ++i;break;default:n=e}return n},Jxe.prototype.findLabelY=function(e,t){var i=e.bounds.y+e.bounds.height,n=e.majorTickLines.height,o=So("Quarter1 2011",e.labelStyle,e.themeStyle.axisLabelFont).height,r="Inside"===e.labelPosition?3:8,r="Outside"===e.labelPosition&&"Outside"===e.tickPosition||0===e.series.length?i+n+r+.75*o:"Inside"===e.labelPosition&&"Inside"===e.tickPosition?i-n-r:"Inside"===e.labelPosition&&"Outside"===e.tickPosition?i-r:i+r+.75*o;return t&&("Outside"===e.labelPosition||0===e.series.length?r+=15+.75*o:r="Outside"===e.tickPosition||0===e.series.length?i+n+15+.75*o:i+15+.75*o),r},Jxe.prototype.placeAxisLabels=function(e,t,i,n,o){var r,s,a,l=e.visibleLabels.length,h=n.bounds,d="",p=n.disableRangeSelector?"transparent":null,c=n.enableRtl?h.x+h.width:h.x,u=e.actualIntervalType,g="Auto"===n.labelPlacement&&"DateTime"===n.valueType||"BetweenTicks"===n.labelPlacement?1<l?e.visibleLabels[1].value-e.visibleLabels[0].value:(e.visibleRange.max-e.visibleLabels[0].value)/2:0;-1<n.valueType.indexOf("DateTime")&&("Quarter"===u||"Weeks"===u)&&this.findSuitableFormat(e,n);for(var m,f=0,y=l;f<y;f++)(r=e.visibleLabels[f]).size=So(r.text,e.labelStyle,n.themeStyle.axisLabelFont),!("Middle"===n.secondaryLabelAlignment||-1<i.indexOf("_AxisLabel_"))||"Auto"!==n.labelPlacement&&"BetweenTicks"!==n.labelPlacement?-1<i.indexOf("Secondary")&&(a=this.findAlignment(e,f)):a=Yye(r.value+g/2,e)*h.width+h.x,"OnTicks"===n.labelPlacement&&"Inside"===n.labelPosition?a=Yye(r.value,e)*h.width+h.x+r.size.width/2+2:"OnTicks"===n.labelPlacement&&"Outside"===n.labelPosition&&(a=Yye(r.value,e)*h.width+h.x),m=Yye(r.value,e)*h.width+h.x,(0===f||f===e.visibleLabels.length-1&&n.enableRtl)&&a<h.x&&(a=h.x+r.size.width/2),(f===e.visibleLabels.length-1||0===f&&n.enableRtl)&&a+r.size.width>h.x+h.width&&(a=h.x+h.width-r.size.width/2),-1<i.indexOf("_SecondaryLabel_")&&a>=h.x&&h.x+h.width>=a&&(d=d.concat("M "+m+" "+t+" L "+m+" "+(t-r.size.height))),"Hide"===n.labelIntersectAction&&0!==f&&this.isIntersect(e,a,r.size.width,c,s.size.width)||("Middle"===n.secondaryLabelAlignment&&1===e.visibleLabels.length&&(a=Yye(r.value,e)+(h.x+h.width/2)),m={cancel:!(m={size:(m=n.labelStyle).size,color:p||m.color||n.themeStyle.axisLabelFont.color,fontFamily:m.fontFamily,fontStyle:m.fontStyle||n.labelStyle.fontStyle,fontWeight:m.fontWeight||n.labelStyle.fontWeight,opacity:m.opacity||n.labelStyle.opacity,textAlignment:m.textAlignment||n.labelStyle.textAlignment,textOverflow:m.textOverflow||n.labelStyle.textOverflow}),name:"labelRender",text:r.text,value:r.value,labelStyle:m,region:new Do(a,t,r.size.width,r.size.height)},n.trigger("labelRender",m),m.cancel)||(n.labels.push(m),sve(this.rangeNavigator.renderer,new ko(this.rangeNavigator.element.id+i+f,a,t,"middle",m.text),m.labelStyle,m.labelStyle.color||n.themeStyle.labelFontColor,o,null,null,null,null,null,null,0,null,null,null,n.themeStyle.axisLabelFont).style.cursor=-1<e.valueType.indexOf("DateTime")?"cursor: pointer":"cursor: default",c=a,s=r);return d},Jxe.prototype.isIntersect=function(e,t,i,n,o){return e.isInversed?n-o/2<t+i/2:t-i/2<n+o/2},Jxe.prototype.findSuitableFormat=function(e,t){for(var i,n,o=e.visibleLabels,r=o.length,s=t.bounds,a="DateTime"===t.valueType?1<r?o[1].value-o[0].value:e.visibleRange.interval:0,l=0;l<r;l++)n=Yye(o[l].value+a/2,e)*s.width+s.x,o[l].size=So(o[l].text,e.labelStyle,t.themeStyle.axisLabelFont),0===l&&n<s.x&&(n=s.x+o[l].size.width/2),"Quarter"===e.actualIntervalType?0!==l&&(-1<o[l].text.indexOf("Quarter")&&this.isIntersect(e,n,o[l].size.width,i,o[l-1].size.width)?(o.every(function(e){return e.text=e.text.toString().replace("Quarter","QTR"),!0}),e.visibleLabels=o,this.findSuitableFormat(e,t)):this.isIntersect(e,n,o[l].size.width,i,o[l-1].size.width)&&(o.every(function(e){return e.text=e.text.toString().replace("QTR","Q"),!0}),e.visibleLabels=o)):"Weeks"===e.actualIntervalType&&0!==l&&-1<o[l].text.indexOf("Week")&&this.isIntersect(e,n,o[l].size.width,i,o[l-1].size.width)&&(o.every(function(e){return e.text=e.text.toString().replace("Week","W"),!0}),e.visibleLabels=o),i=n},Jxe.prototype.findAlignment=function(e,t){var i=e.visibleLabels[t],t=e.visibleLabels[t+1],n=this.rangeNavigator.bounds;return"Near"===this.rangeNavigator.secondaryLabelAlignment?Yye(i.value,e)*n.width+n.x+i.size.width/2:Yye(t?t.value:e.visibleRange.max,e)*n.width+n.x-i.size.width};var Yxe,Xxe,Kxe=Jxe;function Jxe(e){var t=Xxe.call(this)||this;return t.firstLevelLabels=[],t.secondLevelLabels=[],t.rangeNavigator=e,t}Zxe=function(e,t){return(Zxe=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])}))(e,t)};var Zxe,$xe,eIe=function(e,t){function i(){this.constructor=e}Zxe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},tIe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},iIe=(eIe(nIe,$xe=n),tIe([e(null)],nIe.prototype,"dataSource",void 0),tIe([e(null)],nIe.prototype,"xName",void 0),tIe([e(null)],nIe.prototype,"yName",void 0),tIe([e()],nIe.prototype,"query",void 0),tIe([e("Line")],nIe.prototype,"type",void 0),tIe([t({enable:!1},Qge)],nIe.prototype,"animation",void 0),tIe([t({color:"transparent",width:2},Rge)],nIe.prototype,"border",void 0),tIe([e(null)],nIe.prototype,"fill",void 0),tIe([e(1)],nIe.prototype,"width",void 0),tIe([e(1)],nIe.prototype,"opacity",void 0),tIe([e("0")],nIe.prototype,"dashArray",void 0),nIe);function nIe(){var e=null!==$xe&&$xe.apply(this,arguments)||this;return e.clipRect=new Do(0,0,0,0),e}eIe(sIe,oIe=n),tIe([e(null)],sIe.prototype,"width",void 0),tIe([e(null)],sIe.prototype,"height",void 0),tIe([t({width:1,color:null},Rge)],sIe.prototype,"border",void 0),tIe([e(null)],sIe.prototype,"fill",void 0),tIe([e("Circle")],sIe.prototype,"type",void 0);var oIe,rIe=sIe;function sIe(){return null!==oIe&&oIe.apply(this,arguments)||this}eIe(hIe,aIe=n),tIe([t({},rIe)],hIe.prototype,"thumb",void 0),tIe([e(null)],hIe.prototype,"selectedRegionColor",void 0),tIe([e(null)],hIe.prototype,"unselectedRegionColor",void 0);var aIe,lIe=hIe;function hIe(){return null!==aIe&&aIe.apply(this,arguments)||this}eIe(pIe,dIe=n),tIe([e(!1)],pIe.prototype,"enable",void 0),tIe([e(null)],pIe.prototype,"opacity",void 0),tIe([e(null)],pIe.prototype,"fill",void 0),tIe([e(null)],pIe.prototype,"format",void 0),tIe([t({fontFamily:null,size:"12px",fontStyle:"Normal",fontWeight:null,color:null},Tge)],pIe.prototype,"textStyle",void 0),tIe([e(null)],pIe.prototype,"template",void 0),tIe([t({color:null,width:null},Rge)],pIe.prototype,"border",void 0),tIe([e("OnDemand")],pIe.prototype,"displayMode",void 0);var dIe,eIe=pIe;function pIe(){return null!==dIe&&dIe.apply(this,arguments)||this}uIe.prototype.render=function(e){var t=e.renderer,i=e.navigatorStyleSettings,n=e.disableRangeSelector?"transparent":null,o=t.createGroup({id:this.elementId+"_sliders",style:e.disableRangeSelector?"pointer-events:none;":""}),r=new vve(this.elementId+"_leftUnSelectedArea",n||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},0,0,"",i.thumb.border.dashArray);this.leftUnSelectedElement=t.drawRectangle(r),r.id=this.elementId+"_rightUnSelectedArea",this.rightUnSelectedElement=t.drawRectangle(r),r.id=this.elementId+"_SelectedArea",r.fill=n||i.selectedRegionColor||e.themeStyle.selectedRegionColor,this.selectedElement=t.drawRectangle(r),this.selectedElement.setAttribute("role","region"),this.selectedElement.setAttribute("aria-label","Range Slider with "+e.rangeSlider.points.length+" data points"),this.selectedElement.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)},uIe.prototype.createThump=function(e,t,i,n,o){var r=this.control,s=r.navigatorStyleSettings.thumb,a=r.themeStyle,l=t.y+t.height/2,h=this.thumpPadding,d=r.themeStyle.thumbHeight/2-5,p=r.disableRangeSelector?"transparent":null,a=p||s.border.color||a.thumpLineColor;i.appendChild(e.drawPath(new No(n+"_ThumpLine","transparent",s.border.width,r.series.length?a:"transparent",1,s.border.dashArray,"M "+h+" "+t.y+" L "+h+" "+(t.y+t.height)+" "))),this.thumpY=l-r.themeStyle.thumbHeight/2,this.sliderY=t.y>this.thumpY?this.thumpY:t.y,o&&!r.disableRangeSelector&&((t=e.createDefs()).innerText='<rect xmlns="http://www.w3.org/2000/svg" id="'+this.control.element.id+'_shadow" x="0" y="'+this.thumpY+'" width="'+r.themeStyle.thumbWidth+'" height="'+r.themeStyle.thumbHeight+'" rx="'+("Circle"===s.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>',o.appendChild(t)),i.innerText+='<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"===s.type?i.appendChild(A0e({x:h,y:l},"Circle",{width:r.themeStyle.thumbWidth,height:r.themeStyle.thumbHeight},"",new No(n+"_ThumpSymbol",p||this.thumbColor,s.border.width,a,1,null))):i.appendChild(e.drawRectangle(new vve(n+"_ThumpSymbol",p||this.thumbColor,{width:s.border.width,color:a},1,{x:h-r.themeStyle.thumbWidth/2,y:l-r.themeStyle.thumbHeight/2,width:r.themeStyle.thumbWidth,height:r.themeStyle.thumbHeight},2,2,"",s.border.dashArray))),this.thumbVisible&&i.appendChild(e.drawPath(new No(n+"_ThumpGrip","transparent",1,p||r.themeStyle.gripColor,1,null,"M "+(h+2)+" "+(l+d)+" L "+(h+2)+" "+(l-d)+" "+(-1<this.control.theme.indexOf("Fluent2")||-1<this.control.theme.indexOf("Bootstrap5")||-1<this.control.theme.indexOf("Tailwind3")?"":"M "+h+" "+(l+d)+" L "+h+" "+(l-d)+" ")+"M "+(h-2)+" "+(l+d)+" L "+(h-2)+" "+(l-d)+" ")))},uIe.prototype.setSlider=function(e,t,i,n,o){void 0===o&&(o=!1);var r=this.control,s=r.bounds.x,a=r.chartSeries.xAxis.actualRange,l=0===r.series.length,h=(isNaN(e)&&isNaN(t)&&(e=0,t=r.bounds.width),e=(e=e<=t?e:[t,t=e][0])<=t?e:[t,t=e][0],e=Math.max(e,a.min),t=Math.min(t,a.max),this.startX=s+_xe(e,a,r.bounds.width,r.enableRtl),this.endX=s+_xe(t,a,r.bounds.width,r.enableRtl),r.enableRtl?this.endX:this.startX),d=r.enableRtl?this.startX:this.endX,h=(this.sliderWidth=Math.abs(this.endX-this.startX),this.selectedElement.setAttribute("x",h+""),this.selectedElement.setAttribute("width",this.sliderWidth+""),this.leftUnSelectedElement.setAttribute("width",h-s+""),this.rightUnSelectedElement.setAttribute("x",d+""),this.rightUnSelectedElement.setAttribute("width",r.bounds.width-(d-s)+""),this.leftSlider.setAttribute("transform","translate("+(this.startX-this.thumpPadding)+", 0)"),this.rightSlider.setAttribute("transform","translate("+(this.endX-this.thumpPadding)+", 0)"),this.control.svgObject.getBoundingClientRect().left-this.control.element.getBoundingClientRect().left),p=this.control.enableRtl?this.endX:this.startX,c=this.control.enableRtl?this.startX:this.endX,d=(this.leftRect={x:l?h+s:s,y:l?0:r.bounds.y,width:l?p-s:p,height:l?this.thumpY:r.bounds.height},this.rightRect={x:l?h+c:c,y:l?0:r.bounds.y,width:r.bounds.width-(d-s),height:l?this.thumpY:r.bounds.height},this.midRect={x:l?p+h:0,y:l?0:r.bounds.y,width:l?Math.abs(this.endX-this.startX):c,height:l?this.thumpY:r.bounds.height},this.currentStart=e,this.currentEnd=t,n&&(this.control.rangeTooltipModule.renderLeftTooltip(this),this.control.rangeTooltipModule.renderRightTooltip(this)),this.control.periodSelectorModule);d&&this.control.redraw&&"rangeNavigator"===this.control.getModuleName()&&(s=d.findSelectedIndex(e,t,d.control.periods),d.setSelectedStyle(s),this.control.redraw=!1),i&&!o&&this.triggerEvent(a)},uIe.prototype.triggerEvent=function(e){var t=this.control.chartSeries.xAxis,i=t.valueType,i={cancel:!1,start:"DateTime"===i?new Date(this.currentStart):"DateTimeCategory"!==i&&"Logarithmic"===i?Math.pow(t.logBase,this.currentStart):this.currentStart,end:"DateTime"===i?new Date(this.currentEnd):"DateTimeCategory"!==i&&"Logarithmic"===i?Math.pow(t.logBase,this.currentEnd):this.currentEnd,name:"changed",selectedData:zxe(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,selectedPeriod:this.selectedPeriod||""};this.control.trigger("changed",i)},uIe.prototype.addEventListener=function(){this.control.isDestroyed||(this.control.on(F.touchMoveEvent,this.mouseMoveHandler,this),this.control.on(F.touchStartEvent,this.mouseDownHandler,this),this.control.on(F.touchEndEvent,this.mouseUpHandler,this),this.control.on(F.isPointer?"pointerleave":"mouseleave",this.mouseCancelHandler,this))},uIe.prototype.removeEventListener=function(){this.control.isDestroyed||(this.control.off(F.touchMoveEvent,this.mouseMoveHandler),this.control.off(F.touchStartEvent,this.mouseDownHandler),this.control.off(F.touchEndEvent,this.mouseUpHandler),this.control.off(F.isPointer?"pointerleave":"mouseleave",this.mouseCancelHandler))},uIe.prototype.mouseMoveHandler=function(e){var t,i=this.control,n=i.chartSeries.xAxis.actualRange,o=i.bounds;if(this.getCurrentSlider(e.target.id),this.isDrag&&i.mouseX>=o.x){switch(this.currentSlider){case"Left":i.startValue=this.getRangeValue(Math.abs(i.mouseX-o.x));break;case"Right":i.endValue=this.getRangeValue(Math.abs(i.mouseX-o.x));break;case"Middle":var r=Math.max(this.getRangeValue(Math.abs(this.startX-(this.previousMoveX-i.mouseX)-o.x)),n.min),s=Math.min(this.getRangeValue(Math.abs(this.endX-(this.previousMoveX-i.mouseX)-o.x)),n.max);Math.floor(Math.abs(_xe(s,n,i.bounds.width,i.enableRtl)-_xe(r,n,i.bounds.width,i.enableRtl)))===Math.floor(this.sliderWidth)?(i.startValue=r,i.endValue=s):(s===n.max&&(i.endValue=n.max),Math.floor(this.startX)===o.x&&(i.startValue=n.min))}e.preventDefault&&this.isIOS&&e.preventDefault(),"Middle"!==this.currentSlider&&(e=this.control.periodSelectorModule)&&((t=e.control.periods).map(function(e){e.selected=!1}),e.selectedIndex=void 0,t=e.findSelectedIndex(i.startValue,i.endValue,t),e.setSelectedStyle(t)),this.setSlider(i.startValue,i.endValue,!i.enableDeferredUpdate,i.rangeTooltipModule&&i.tooltip.enable),this.previousMoveX=i.mouseX}},uIe.prototype.getRangeValue=function(e){var t=this.control,i=t.chartSeries.xAxis.actualRange;return Hxe(e,t.bounds.width,i,t.enableRtl)},uIe.prototype.mouseDownHandler=function(e){this.currentSlider=this.getCurrentSlider(e.target.id),this.selectedElement.style.cursor="-webkit-grabbing",this.isDrag=!("UnSelectedArea"===this.currentSlider||!this.currentSlider),this.previousMoveX=this.control.mouseDownX},uIe.prototype.getCurrentSlider=function(e){var t=this.control.themeStyle.thumbHoverColor;return-1<e.indexOf(this.elementId+"_LeftSlider")?(this.leftSlider.childNodes[2].setAttribute("fill",t),"Left"):-1<e.indexOf(this.elementId+"_RightSlider")?(this.rightSlider.childNodes[2].setAttribute("fill",t),"Right"):-1<e.indexOf(this.elementId+"_SelectedArea")?"Middle":-1<e.indexOf("UnSelectedArea")?(this.leftSlider.childNodes[2].setAttribute("fill",this.thumbColor),this.rightSlider.childNodes[2].setAttribute("fill",this.thumbColor),"UnSelectedArea"):-1<e.indexOf(this.elementId+"_AxisLabel_")&&("DateTime"===this.control.valueType||"DateTimeCategory"===this.control.valueType)?(this.labelIndex=+e.substring(e.lastIndexOf("_")+1,e.length),"firstLevelLabels"):-1<e.indexOf(this.elementId+"_SecondaryLabel")&&("DateTime"===this.control.valueType||"DateTimeCategory"===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)},uIe.prototype.mouseUpHandler=function(){var e,t,i,n,o,r=this.control,s=r.chartSeries.xAxis.actualRange,a=r.enableDeferredUpdate,l=r.tooltip.enable;r.stockChart&&(r.stockChart.zoomChange=!1),"UnSelectedArea"===this.currentSlider?(e=o=n=void 0,t=r.enableRtl,i=r.endValue-r.startValue,r.mouseDownX<this.startX?(n=Math.max(this.getRangeValue(r.mouseDownX-this.sliderWidth/2-r.bounds.x),s.min),e=t?n:n+i,o=t?n-i:n):(n=Math.min(this.getRangeValue(r.mouseDownX+this.sliderWidth/2-r.bounds.x),s.max),o=t?n:n-i,e=t?n+i:n),this.performAnimation(o,e,r),a=!1):"firstLevelLabels"===this.currentSlider||"secondLevelLabels"===this.currentSlider?(t=r.rangeAxis[this.currentSlider][this.labelIndex+1],this.selectedPeriod&&(i=this.control.periodSelectorModule)&&((n=i.control.periods).map(function(e){e.selected=!1}),i.selectedIndex=void 0,o=i.findSelectedIndex(r.rangeAxis[this.currentSlider][this.labelIndex].value,t?r.allowIntervalData?t.value-1:t.value:s.max,n),i.setSelectedStyle(o)),this.performAnimation(r.rangeAxis[this.currentSlider][this.labelIndex].value,t?r.allowIntervalData?t.value-1:t.value:s.max,r),a=!1):null===this.currentSlider&&(a=!1),this.isDrag&&r.allowSnapping&&(this.setAllowSnapping(r,this.currentStart,this.currentEnd,!0,l),a=!1),a&&this.setSlider(this.currentStart,this.currentEnd,!0,l),null!==this.currentSlider&&0<this.control.periodSelectorSettings.periods.length&&(this.control.periodSelectorModule.triggerChange=!1,this.control.periodSelectorModule.datePicker.startDate=this.control.periodSelectorModule.isDatetimeCategory?new Date(this.control.periodSelectorModule.sortedData[Math.floor(this.currentStart)]):new Date(this.currentStart),this.control.periodSelectorModule.datePicker.endDate=this.control.periodSelectorModule.isDatetimeCategory?new Date(this.control.periodSelectorModule.sortedData[Math.floor(this.currentEnd)]):new Date(this.currentEnd)),this.selectedElement.style.cursor="-webkit-grab",r.startValue=this.currentStart,r.endValue=this.currentEnd,this.isDrag=!1,this.labelIndex=null,this.currentSlider=null},uIe.prototype.setAllowSnapping=function(e,t,i,n,o){var r=e.rangeAxis.lowerValues;r.push(e.chartSeries.xAxis.actualRange.max),this.setSlider(jxe(r,t),jxe(r,i),n,o),e.startValue=this.currentStart,e.endValue=this.currentEnd},uIe.prototype.performAnimation=function(t,i,e){var n=this,o=this.currentStart,r=this.currentEnd,s=e.enableDeferredUpdate,a=e.tooltip.enable;new Vt({}).animate(Q("div"),{duration:0===this.control.animationDuration&&"Enable"===Ut?1e3:this.control.animationDuration,progress:function(e){n.setSlider(c0e(e.timeStamp,0,t-o,e.duration)+o,c0e(e.timeStamp,0,i-r,e.duration)+r,!s,a)},end:function(){e.allowSnapping?n.setAllowSnapping(e,t,i,!0,a):n.setSlider(t,i,!0,a),n.control.startValue=n.currentStart,n.control.endValue=n.currentEnd,0<n.control.periodSelectorSettings.periods.length&&(n.control.periodSelectorModule.triggerChange=!1,n.control.periodSelectorModule.datePicker.startDate=n.control.periodSelectorModule.isDatetimeCategory?new Date(n.control.periodSelectorModule.sortedData[Math.floor(n.currentStart)]):new Date(n.currentStart),n.control.periodSelectorModule.datePicker.endDate=n.control.periodSelectorModule.isDatetimeCategory?new Date(n.control.periodSelectorModule.sortedData[Math.floor(n.currentEnd)]):new Date(n.currentEnd))}})},uIe.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},uIe.prototype.destroy=function(){this.removeEventListener()};var cIe=uIe;function uIe(e){this.control=e,this.points=[],this.isIOS=F.isIos||F.isIos7;var t=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":t.fill||e.themeStyle.thumbBackground}function gIe(e,t){var i=t.navigatorStyleSettings.thumb,n=je(i.width)?F.isDevice?15:20:i.width,o=je(i.height)?F.isDevice?15:20:i.height,r="HighContrast"===e?"#969696":"#6F6C6C",s="HighContrast"===e?"#4A4848":"#414040",a={gridLineColor:"#E0E0E0",axisLineColor:"#000000",labelFontColor:"#686868",unselectedRectColor:t.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:t.series.length?"transparent":"#FF4081",tooltipBackground:"Material"===e?"#000816":"Fabric"===e?"#FFFFFF":"#212529",tooltipFontColor:"#dbdbdb",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"Material"===e?"rgba(97, 97, 97, 1)":"Fabric"===e?"#666666":"#676767",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"Material"===e?"rgba(249, 250, 251, 1)":"Fabric"===e?"#333333":"#F9FAFB",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"}};switch(e){case"Fabric":a.selectedRegionColor=t.series.length?"transparent":"#007897";break;case"Bootstrap":a.selectedRegionColor=t.series.length?"transparent":"#428BCA";break;case"HighContrastLight":a={gridLineColor:"#bdbdbd",axisLineColor:"#969696",labelFontColor:"#ffffff",unselectedRectColor:t.series.length?"rgba(255, 255, 255, 0.3)":"#EEEEEE",thumpLineColor:"#ffffff",thumbBackground:"#262626",gripColor:"#ffffff",background:"transparent",thumbHoverColor:"#BFBFBF",selectedRegionColor:t.series.length?"transparent":"#FFD939",tooltipBackground:"#ffffff",tooltipFontColor:"#000000",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#000000",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"HighContrast":a={gridLineColor:s,axisLineColor:r,labelFontColor:"#DADADA",unselectedRectColor:t.series.length?"rgba(43, 43, 43, 0.6)":"#514F4F",thumpLineColor:"#969696",thumbBackground:"#333232",gripColor:"#DADADA",background:"transparent",thumbHoverColor:"#BFBFBF",selectedRegionColor:t.series.length?"rgba(22, 22, 22, 0.6)":"#FFD939",tooltipBackground:"#FFFFFF",tooltipFontColor:"#282727",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#000000",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"MaterialDark":case"FabricDark":case"BootstrapDark":a={labelFontColor:"#DADADA",axisLineColor:" #6F6C6C",gridLineColor:"#414040",tooltipBackground:"FabricDark"===e?"#A19F9D":"BootstrapDark"===e?"#F0F0F0":"#F4F4F4",tooltipFontColor:"#333232",unselectedRectColor:t.series.length?"rgba(43, 43, 43, 0.6)":"#514F4F",thumpLineColor:"#969696",thumbBackground:"#333232",gripColor:"#DADADA",background:"transparent",thumbHoverColor:"#BFBFBF",selectedRegionColor:t.series.length?"rgba(22, 22, 22, 0.6)":"FabricDark"===e?"#007897":"BootstrapDark"===e?"#428BCA":"#FF4081",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"FabricDark"===e?"#A19F9D":"#CED4DA",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"MaterialDark"===e?"rgba(18, 18, 18, 1)":"FabricDark"===e?"#DADADA":"#1A1A1A",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap4":a={gridLineColor:"#E0E0E0",axisLineColor:"#CED4DA",labelFontColor:"#212529",unselectedRectColor:t.series.length?"rgba(255, 255, 255, 0.6)":"#514F4F",thumpLineColor:"rgba(189, 189, 189, 1)",thumbBackground:"#FFFFFF",gripColor:"#495057",background:"transparent",thumbHoverColor:"#EEEEEE",selectedRegionColor:t.series.length?"transparent":"#FFD939",tooltipBackground:"#212529",tooltipFontColor:"rgba(255, 255, 255)",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#495057",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Tailwind3":a={gridLineColor:"#D1D5DB",axisLineColor:"#D1D5DB",labelFontColor:"#4B5563",unselectedRectColor:t.series.length?"transparent":"#E5E7EB",thumpLineColor:"#1F2937",thumbBackground:"#FFFFFF",gripColor:"#6B7280",background:"transparent",thumbHoverColor:"#1F2937",selectedRegionColor:t.series.length?"#6B72801A":"#4F46E5",tooltipBackground:"#111827",tooltipFontColor:"#F9FAFB",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#4B5563",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"}};break;case"Tailwind3Dark":a={gridLineColor:"#374151",axisLineColor:"#374151",labelFontColor:"#D1D5DB",unselectedRectColor:t.series.length?"transparent":"#4B5563",thumpLineColor:"#6B7280",thumbBackground:"#111827",gripColor:"#D1D5DB",background:"transparent",thumbHoverColor:"#E5E7EB",selectedRegionColor:t.series.length?"#6B72801A":"#22D3EE",tooltipBackground:"#F9FAFB",tooltipFontColor:"#1F2937",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#1F2937",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"}};break;case"Tailwind":a={gridLineColor:"#E5E7EB",axisLineColor:"#D1D5DB",labelFontColor:"#6B7280",unselectedRectColor:t.series.length?"transparent":"#E5E7EB",thumpLineColor:"#9CA3AF",thumbBackground:"#FFFFFF",gripColor:"#6B7280",background:"transparent",thumbHoverColor:"#374151",selectedRegionColor:t.series.length?"rgba(79, 70, 229, 0.3)":"#4F46E5",tooltipBackground:"#111827",tooltipFontColor:"#F9FAFB",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#6B7280",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"TailwindDark":a={gridLineColor:"#374151",axisLineColor:"#4B5563",labelFontColor:"#9CA3AF",unselectedRectColor:t.series.length?"transparent":"#4B5563",thumpLineColor:"#6B7280",thumbBackground:"#1F2937",gripColor:"#D1D5DB",background:"transparent",thumbHoverColor:"#E5E7EB",selectedRegionColor:t.series.length?"rgba(255, 255, 255, 0.6)":"#22D3EE",tooltipBackground:"#E9ECEF",tooltipFontColor:"#1F2937",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#9CA3AF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#1F2937",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap5":a={gridLineColor:"#E9ECEF",axisLineColor:"#DEE2E6",labelFontColor:"#21252980",unselectedRectColor:t.series.length?"transparent":"#E5E7EB",thumpLineColor:"#CED4DA",thumbBackground:"#FFFFFF",gripColor:"#6E757D",background:"transparent",thumbHoverColor:"#666666",selectedRegionColor:t.series.length?"rgba(52, 58, 64, 0.1)":"#ADB5BD",tooltipBackground:"#000000E5",tooltipFontColor:"#FFFFFF",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#21252980",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap5Dark":a={gridLineColor:"#343A40",axisLineColor:"#495057",labelFontColor:"#DEE2E680",unselectedRectColor:t.series.length?"transparent":"#E5E7EB",thumpLineColor:"#6C757D",thumbBackground:"#212529",gripColor:"#ADB5BD",background:"transparent",thumbHoverColor:"#666666",selectedRegionColor:t.series.length?"rgba(173, 181, 189, 0.1)":"#ADB5BD",tooltipBackground:"#FFFFFFE5",tooltipFontColor:"#212529",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#DEE2E680",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Fluent":a={gridLineColor:"#EDEBE9",axisLineColor:"#D2D0CE",labelFontColor:"#3B3A39",unselectedRectColor:t.series.length?"transparent":"#A19F9D",thumpLineColor:"#0078D4",thumbBackground:"#FFFFFF",gripColor:"#0078D4",background:"transparent",thumbHoverColor:"#FFFFFF",selectedRegionColor:t.series.length?"rgba(0, 120, 212, 0.1)":"#ADB5BD",tooltipBackground:"#FFFFFF",tooltipFontColor:"#323130",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#3B3A39",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#323130",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"FluentDark":a={gridLineColor:"#414040",axisLineColor:"#3B3A39",labelFontColor:"#C8C6C4",unselectedRectColor:t.series.length?"transparent":"#A19F9D",thumpLineColor:"#797775",thumbBackground:"black",gripColor:"#797775",background:"transparent",thumbHoverColor:"black",selectedRegionColor:t.series.length?"rgba(121, 119, 117, 0.1)":"#797775",tooltipBackground:"#323130",tooltipFontColor:"#F3F2F1",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#C8C6C4",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F3F2F1",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Fluent2":a={gridLineColor:"#EDEBE9",axisLineColor:"#D2D0CE",labelFontColor:"#616161",unselectedRectColor:t.series.length?"rgba(250, 250, 250, 0.1)":"#A19F9D",thumpLineColor:"#A19F9D",thumbBackground:"#FAFAFA",gripColor:"#424242",background:"transparent",thumbHoverColor:"#FAFAFA",selectedRegionColor:t.series.length?"rgba(161, 159, 157, 0.4)":"#797775",tooltipBackground:"#FFFFFF",tooltipFontColor:"#242424",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#616161",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Fluent2Dark":a={gridLineColor:"#8A8886",axisLineColor:"#3B3A39",labelFontColor:"#ADADAD",unselectedRectColor:t.series.length?"transparent":"#A19F9D",thumpLineColor:"#8A8886",thumbBackground:"#1F1F1F",gripColor:"#D6D6D6",background:"transparent",thumbHoverColor:"#1F1F1F",selectedRegionColor:t.series.length?"rgba(138, 136, 134, 0.4)":"#797775",tooltipBackground:"#292929",tooltipFontColor:"#FFFFFF",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#ADADAD",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Fluent2HighContrast":a={gridLineColor:"#8A8886",axisLineColor:"#3B3A39",labelFontColor:"#ADADAD",unselectedRectColor:t.series.length?"transparent":"#A19F9D",thumpLineColor:"#8A8886",thumbBackground:"#1F1F1F",gripColor:"#FFFFFF",background:"transparent",thumbHoverColor:"#1F1F1F",selectedRegionColor:t.series.length?"rgba(138, 136, 134, 0.1)":"#797775",tooltipBackground:"#000000",tooltipFontColor:"#FFFFFF",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"10px",fontStyle:"Normal",fontWeight:"600"}};break;case"Material3":a={gridLineColor:"#C4C7C5",axisLineColor:"#C4C7C5",labelFontColor:"#1E192B",unselectedRectColor:t.series.length?"transparent":"#E5E5E5",thumpLineColor:"#49454E",thumbBackground:"#FFFFFF",gripColor:"#49454E",background:"transparent",thumbHoverColor:"#FFFFFF",selectedRegionColor:t.series.length?"rgba(73, 69, 78, 0.1)":"#49454E",tooltipBackground:"#313033",tooltipFontColor:"#F4EFF4",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#1E192B",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F4EFF4",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Material3Dark":a={gridLineColor:"#444746",axisLineColor:"#444746",labelFontColor:"#E6E1E5",unselectedRectColor:t.series.length?"transparent":"#E5E5E5",thumpLineColor:"#CAC4D0",thumbBackground:"#1C1B1F",gripColor:"#CAC4D0",background:"transparent",thumbHoverColor:"#FFFFFF",selectedRegionColor:t.series.length?"rgba(202, 196, 208, 0.1)":"#49454E",tooltipBackground:"#E6E1E5",tooltipFontColor:"#313033",thumbWidth:n,thumbHeight:o,axisLabelFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F4EFF4",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;default:a.selectedRegionColor=t.series.length?"transparent":"#FF4081"}return a}fIe.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},fIe.prototype.appendSelector=function(e,t){this.renderSelectorElement(null,e,t=void 0===t?0:t),this.renderSelector()},fIe.prototype.renderSelectorElement=function(e,t,i){var n;this.periodSelectorSize=e?this.periodSelectorSize:new Do(i,this.rootControl.titleSize.height||10,t.width,t.height),ie((i=(e?(n=e.themeStyle.thumbWidth,e):(n=t.thumbSize,t)).element).id+"_Secondary_Element")&&ue(ie(i.id+"_Secondary_Element")),this.periodSelectorDiv=Q("div",{id:i.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"}),i.appendChild(this.periodSelectorDiv)},fIe.prototype.renderSelector=function(){var i,o=this,e=(this.setControlValues(this.rootControl),!0),r=this.control.element.id,t=Q("div",{id:r+"_selector"}),n=this.control.periods,s=this.updateCustomElement(),a=r+"customRange";this.periodSelectorDiv.appendChild(t);for(var l=0;l<n.length;l++)s.push({align:"Left",text:n[l].text});(e="stockChart"===this.rootControl.getModuleName()?this.rootControl.enableCustomRange:e)&&(this.calendarId=r+"_calendar",s.push({template:"<button id="+this.calendarId+"></button>",align:"Right"}));var h,d={selector:s,name:"RangeSelector",cancel:!1,enableCustomFormat:!0,content:"Date Range"};"stockChart"===this.rootControl.getModuleName()&&this.rootControl.exportType.length&&((h=Q("button",{id:r+"_export",styles:"text-transform: none; text-overflow: unset",className:"e-dropdown-btn e-btn e-flat"})).innerText="Export",s.push({template:h,align:"Right"})),this.rootControl.trigger("selectorRender",d),this.toolbar=new U3({items:d.selector,height:this.periodSelectorSize.height,clicked:function(e){o.buttonClick(e,o.control)},created:function(){var e;o.nodes=o.toolbar.element.querySelectorAll(".e-toolbar-left")[0],je(o.selectedIndex)&&n.map(function(e,t){e.selected&&null!==o.selectedPeriod&&(i=e,o.control.startValue=o.changedRange(e.intervalType,o.control.endValue,e.interval).getTime(),o.isDatetimeCategory&&(o.control.startValue="stockChart"!==o.rootControl.getModuleName()?o.findStartValue(o.control.startValue,o.control.endValue):o.rootControl.startValue),o.control.startValue=e.text&&"all"===e.text.toLowerCase()?o.control.seriesXMin:o.control.startValue,o.control.endValue=e.text&&"all"===e.text.toLowerCase()?o.control.seriesXMax:o.control.endValue,o.selectedIndex=o.nodes.childNodes.length-n.length+t,t=o.control.rangeSlider)&&(t.selectedPeriod=e.text)}),i||"stockChart"===o.rootControl.getModuleName()||(e=o.findSelectedIndex(o.control.startValue,o.control.endValue,n),o.selectedIndex=e||o.selectedIndex),o.setSelectedStyle(o.selectedIndex)}}),this.toolbar.isStringTemplate=!0,this.toolbar.appendTo(t),this.triggerChange=!0,e&&(this.datePicker=new Z9({min:this.isDatetimeCategory?new Date(this.sortedData[this.control.seriesXMin]):new Date(this.control.seriesXMin),max:this.isDatetimeCategory?new Date(this.sortedData[this.control.seriesXMax]):new Date(this.control.seriesXMax),format:"dd/MM/yyyy",placeholder:"Select a range",showClearButton:!1,startDate:this.isDatetimeCategory?new Date(this.sortedData[Math.floor(this.control.startValue)]):new Date(this.control.startValue),endDate:this.isDatetimeCategory?new Date(this.sortedData[Math.floor(this.control.endValue)]):new Date(this.control.endValue),created:function(){if(d.enableCustomFormat){for(var e=document.getElementsByClassName("e-date-range-wrapper"),t=void 0,i=0;i<e.length;i++)-1!==e[i].children[0].id.indexOf(r)&&(t=e[i]);t.style.display="none";var n=Q("div",{id:a,className:"e-control e-btn e-dropdown-btn e-flat",styles:"font-size: 14px; font-weight: 500; text-transform: none "});n.innerText=d.content,t.insertAdjacentElement("afterend",n),ie(a).insertAdjacentElement("afterbegin",Q("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(a).onclick=function(){o.datePicker.show(ie(a))}}},change:function(e){if(o.triggerChange&&(o.isDatetimeCategory&&(o.startValue=e.startDate.getTime(),o.endValue=e.endDate.getTime(),o.findPeriodValue(o.startValue,o.endValue)),o.control.rangeSlider&&e.event?("stockChart"!==o.rootControl.getModuleName()&&(o.control.rangeNavigatorControl.startValue=o.isDatetimeCategory?o.startValue:e.startDate.getTime(),o.control.rangeNavigatorControl.endValue=o.isDatetimeCategory?o.endValue:e.endDate.getTime(),o.selectedIndex=void 0,o.selectedPeriod=null,o.control.rangeNavigatorControl.refresh()),o.control.rangeSlider.performAnimation(o.isDatetimeCategory?o.startValue:e.startDate.getTime(),o.isDatetimeCategory?o.endValue:e.endDate.getTime(),o.control.rangeNavigatorControl)):e.event&&o.rootControl.rangeChanged(o.isDatetimeCategory?o.startValue:e.startDate.getTime(),o.isDatetimeCategory?o.endValue:e.endDate.getTime()),o.nodes=o.toolbar.element.querySelectorAll(".e-toolbar-left")[0],!o.rootControl.resizeTo)&&o.control.rangeSlider&&o.control.rangeSlider.isDrag)for(var t=0,i=o.nodes.childNodes.length;t<i;t++)o.nodes.childNodes[t].childNodes[0].classList.remove("e-active"),o.nodes.childNodes[t].childNodes[0].classList.remove("e-active")}}),this.datePicker.appendTo("#"+this.calendarId))},fIe.prototype.findPeriodValue=function(e,t){for(var i=0;i<this.sortedData.length;i++)if(this.sortedData[i]>=e){this.startValue=i;break}for(i=this.sortedData.length-1;0<=i;i--)if(this.sortedData[i]<=t){this.endValue=i;break}},fIe.prototype.findSelectedIndex=function(e,t,i){for(var n,o=(t-e)/864e5,r=0;r<i.length;r++){var s=i[r];("Years"===s.intervalType&&o/365===s.interval||"Months"===s.intervalType&&(o/30===s.interval||o/31===s.interval)||"Days"===s.intervalType&&o===s.interval||"Weeks"===s.intervalType&&o/7===s.interval||"Hours"===s.intervalType&&24*o===s.interval||"Seconds"===s.intervalType&&24*o*3600===s.interval)&&(n=r)}return n},fIe.prototype.updateCustomElement=function(){var e,t=[],i=this.rootControl.element.id,n="text-transform: none; text-overflow: unset",o="e-dropdown-btn e-btn e-flat";return"stockChart"===this.rootControl.getModuleName()&&(this.rootControl.seriesType.length&&((e=Q("button",{id:i+"_seriesType",styles:n,className:o})).innerText="Series",t.push({template:e,align:"Left"})),this.rootControl.indicatorType.length&&((e=Q("button",{id:i+"_indicatorType",styles:n,className:o})).innerText="Indicators",t.push({template:e,align:"Left"})),this.rootControl.trendlineType.length)&&((e=Q("button",{id:i+"_trendType",styles:n,className:o})).innerText="Trendline",t.push({template:e,align:"Left"})),t},fIe.prototype.setSelectedStyle=function(e){for(var t=0,i=this.nodes.childNodes.length;t<i;t++)this.nodes.childNodes[t].childNodes[0].classList.remove("e-active");je(e)||(this.nodes.childNodes[e].childNodes[0].classList.add("e-flat"),this.nodes.childNodes[e].childNodes[0].classList.add("e-active"))},fIe.prototype.buttonClick=function(i,e){var t,n,o=this,r=i.item,s=this.control.rangeSlider,a=this.control.periods,l=a.filter(function(e){return e.text===r.text});a.map(function(e,t){e.selected&&"stockChart"!==o.rootControl.getModuleName()&&(e.selected=!1),e.text===i.item.text&&(o.selectedIndex=o.nodes.childNodes.length-a.length+t,"stockChart"!==o.rootControl.getModuleName())&&(e.selected=!0)}),""!==i.item.text&&this.setSelectedStyle(this.selectedIndex),s&&r.text&&(s.selectedPeriod=r.text),"all"===r.text.toLowerCase()?(t=e.seriesXMin,n=e.seriesXMax,s?s.performAnimation(t,n,this.control.rangeNavigatorControl):this.rootControl.rangeChanged(t,n)):"ytd"===r.text.toLowerCase()?s?(t=(this.isDatetimeCategory?new Date(new Date(this.sortedData[Math.floor(s.currentEnd)]).getFullYear().toString()):new Date(new Date(s.currentEnd).getFullYear().toString())).getTime(),t=this.isDatetimeCategory?this.findStartValue(t,s.currentEnd):t,n=s.currentEnd,s.performAnimation(t,n,this.control.rangeNavigatorControl)):(t=(this.isDatetimeCategory?new Date(new Date(this.sortedData[Math.floor(this.rootControl.currentEnd)]).getFullYear().toString()):new Date(new Date(this.rootControl.currentEnd).getFullYear().toString())).getTime(),t=this.isDatetimeCategory?this.findStartValue(t,this.rootControl.currentEnd):t,n=this.rootControl.currentEnd,this.rootControl.rangeChanged(t,n)):""!==r.text.toLowerCase()&&(s?(t=this.changedRange(l[0].intervalType,s.currentEnd,l[0].interval).getTime(),t=this.isDatetimeCategory?this.findStartValue(t,s.currentEnd):t,n=s.currentEnd,s.performAnimation(t,n,this.control.rangeNavigatorControl)):(t=this.changedRange(l[0].intervalType,this.rootControl.currentEnd,l[0].interval).getTime(),t=this.isDatetimeCategory?this.findStartValue(t,this.rootControl.currentEnd):t,n=this.rootControl.currentEnd,this.rootControl.rangeChanged(t,n))),"stockChart"===this.rootControl.getModuleName()&&(this.rootControl.zoomChange=!1),ie(this.calendarId+"_popup")&&!F.isDevice&&(ie(this.calendarId+"_popup").querySelectorAll(".e-range-header")[0].style.display="none")},fIe.prototype.findStartValue=function(e,t){for(var i=Math.floor(t);0<=i;i--)if(this.sortedData[i]<=e)return i+1;return 0},fIe.prototype.changedRange=function(e,t,i){var n=this.isDatetimeCategory?new Date(this.sortedData[Math.floor(t)]):new Date(t);switch(e){case"Quarter":n.setMonth(n.getMonth()-3*i);break;case"Months":n.setMonth(n.getMonth()-i);break;case"Weeks":n.setDate(n.getDate()-7*i);break;case"Days":n.setDate(n.getDate()-i);break;case"Hours":n.setHours(n.getHours()-i);break;case"Minutes":n.setMinutes(n.getMinutes()-i);break;case"Seconds":n.setSeconds(n.getSeconds()-i);break;default:n.setFullYear(n.getFullYear()-i)}return n},fIe.prototype.getModuleName=function(){return"PeriodSelector"},fIe.prototype.destroy=function(){};var mIe=fIe;function fIe(e){this.control={},this.isDatetimeCategory=!1,this.sortedData=[],this.startValue=0,this.endValue=0,this.rootControl=e,"stockChart"===this.rootControl.getModuleName()&&(this.sortedData=this.rootControl.sortedData,this.isDatetimeCategory=this.rootControl.isDateTimeCategory)}yIe=function(e,t){return(yIe=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])}))(e,t)};var yIe,vIe,tIe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},bIe=(function(e,t){function i(){this.constructor=e}yIe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(wIe,vIe=Ji),wIe.prototype.preRender=function(){var e;this.unWireEvents(),this.setCulture(),this.allowServerDataBinding=!1,this.periodSelectorModule&&(this.periodSelectorModule.selectedIndex=null),""===this.element.id&&(e=document.getElementsByClassName("e-rangenavigator").length,this.element.id="rangenavigator_"+this.chartid+"_"+e),this.wireEvents()},wIe.prototype.initPrivateVariables=function(){this.doubleModule=new Fme,this.labels=[],this.rangeSlider=new cIe(this),this.chartSeries=new qxe(this),this.lineSeriesModule=new Ewe,this.rangeAxis=new Kxe(this)},wIe.prototype.setCulture=function(){this.intl=new Ti},wIe.prototype.setSliderValue=function(){var e="DateTime"===this.valueType,t="DateTimeCategory"===this.valueType,i=this.chartSeries.xAxis.actualRange;this.startValue=this.startValue||t&&0===this.startValue?this.startValue:this.value[0]?e?new Date(this.value[0].toString()).getTime():t?this.getRangeValue(new Date(this.value[0].toString()).getTime(),!0):+this.value[0]:i.min,this.endValue=this.endValue||t&&0===this.endValue?this.endValue:this.value[1]?e?new Date(this.value[1].toString()).getTime():t?this.getRangeValue(new Date(this.value[1].toString()).getTime(),!1):+this.value[1]:i.max},wIe.prototype.getRangeValue=function(e,t){for(var i=this.chartSeries.xAxis.labels,n=i.length-1;0<=n&&parseInt(i[n],10)>e;)n--;return t?-1!==n?n:this.chartSeries.xAxis.actualRange.min:0===n?this.chartSeries.xAxis.actualRange.max:n},wIe.prototype.render=function(){var e=this,t={name:"load",rangeNavigator:this,theme:this.theme};this.trigger("load",t,function(){e.setTheme(),e.initPrivateVariables(),e.createRangeSvg(),e.calculateBounds(),e.chartSeries.renderChart(e),Pye("chartmeasuretext"),e.renderComplete(),e.allowServerDataBinding=!0}),this.element.setAttribute("tabindex","0"),this.element.style.outline="none",this.element.setAttribute("role","region"),this.element.setAttribute("aria-label","Range navigator Syncfusion interactive chart.")},wIe.prototype.setTheme=function(){this.themeStyle=gIe(this.theme,this)},wIe.prototype.createRangeSvg=function(){this.removeSvg(),lve(this),this.renderChartBackground()},wIe.prototype.calculateBounds=function(){var e=this.enableGrouping?15:8,t=this.navigatorStyleSettings.thumb,i=So("tempString",this.labelStyle,this.themeStyle.axisLabelFont).height,n=this.margin,o=!this.series.length,r=!this.disableRangeSelector&&o&&this.tooltip.enable?35:0,s=(this.periodSelectorModule||!this.periodSelectorSettings.periods.length||this.stockChart||(this.periodSelectorModule=new mIe(this)),this.periodSelectorModule),a=(this.periodSelectorModule&&0<this.periodSelectorSettings.periods.length&&(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),"Top"===this.periodSelectorSettings.position&&s?s.periodSelectorSize.y+s.periodSelectorSize.height:0),l=0,h=0,l=(this.stockChart&&this.stockChart.stockLegendModule&&this.stockChart.legendSettings.visible&&("Left"===this.stockChart.legendSettings.position?l+=this.stockChart.stockLegendModule.legendBounds.width:"Top"===this.stockChart.legendSettings.position&&(h+=this.stockChart.stockLegendModule.legendBounds.height)),this.bounds=new Do(this.themeStyle.thumbWidth/2+t.border.width+n.left+l,n.top+r+a+h,this.availableSize.width-this.themeStyle.thumbWidth-2*t.border.width-n.left-n.right,this.availableSize.height-n.top-n.bottom-r-(s?s.periodSelectorSize.height:0)),("Outside"===this.labelPosition||o?i+e:0)+("Outside"===this.tickPosition||o?this.majorTickLines.height:0));this.bounds.height-=l,o&&(a=this.enableGrouping?this.bounds.height-(i+e):this.bounds.height,this.bounds.y+=this.themeStyle.thumbHeight>a?(this.themeStyle.thumbHeight-a)/2:0),this.disableRangeSelector&&(this.bounds.y=0,this.bounds.height=0<this.periodSelectorSettings.periods.length?this.periodSelectorSettings.height:0)},wIe.prototype.renderChart=function(e){void 0===e&&(e=!1),this.chartSeries.renderSeries(this),this.chartSeries.appendSeriesElements(this),this.rangeAxis.renderGridLines(),this.rangeAxis.renderAxisLabels(),this.createSecondaryElement(),this.setSliderValue(),this.renderPeriodSelector(),this.renderSlider(e),this.stockChart||this.element.appendChild(this.svgObject),this.trigger("loaded",{rangeNavigator:this}),this.rangeSlider.setSlider(this.startValue,this.endValue,!1,this.tooltip.enable&&"Always"===this.tooltip.displayMode,e)},wIe.prototype.renderPeriodSelector=function(){this.periodSelectorModule&&(this.periodSelectorModule.renderSelectorElement(this),this.periodSelectorModule.renderSelector())},wIe.prototype.createSecondaryElement=function(){var e;this.tooltip.enable&&((e=this.createElement("div")).id=this.element.id+"_Secondary_Element",e.style.position="relative",this.element.appendChild(e))},wIe.prototype.renderSlider=function(e){this.rangeSlider.render(this),this.periodSelectorModule&&(this.startValue=this.periodSelectorModule.control.startValue,this.endValue=this.periodSelectorModule.control.endValue),this.rangeSlider.setSlider(this.startValue,this.endValue,!0,this.tooltip.enable&&"Always"===this.tooltip.displayMode,e)},wIe.prototype.removeSvg=function(){ie(this.element.id+"_Secondary_Element")&&(ue(ie(this.element.id+"_Secondary_Element")),this.isReact)&&this.clearTemplate();if(this.svgObject){for(;0<this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);this.svgObject.hasChildNodes()||!this.svgObject.parentNode||this.stockChart||ue(this.svgObject)}},wIe.prototype.unWireEvents=function(){var e=F.touchStartEvent,t=F.touchMoveEvent,i=F.touchEndEvent,n=F.isPointer?"pointerleave":"mouseleave";E.remove(this.element,e,this.rangeOnMouseDown),E.remove(this.element,t,this.mouseMove),E.remove(this.element,i,this.mouseEnd),E.remove(this.element,"click",this.rangeOnMouseClick),E.remove(this.element,n,this.mouseLeave),window.removeEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.rangeResize)},wIe.prototype.wireEvents=function(){var e=F.isPointer?"pointerleave":"mouseleave",e=(E.add(this.element,F.touchStartEvent,this.rangeOnMouseDown,this),E.add(this.element,F.touchMoveEvent,this.mouseMove,this),E.add(this.element,F.touchEndEvent,this.mouseEnd,this),E.add(this.element,"click",this.rangeOnMouseClick,this),E.add(this.element,e,this.mouseLeave,this),window.addEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.rangeResize.bind(this)),this.element);e.style.touchAction="none",e.style.msTouchAction="none",e.style.msContentZooming="none",e.style.msUserSelect="none",e.style.webkitUserSelect="none",e.style.position="relative",e.style.display="block"},wIe.prototype.rangeResize=function(){var e,t,i=this;return document.getElementById(this.element.id)&&this.svgObject&&(this.animateSeries=!1,this.removeAllTooltip(),e={name:"beforeResize",cancelResizedEvent:!1},this.resizeTo&&clearTimeout(this.resizeTo),t={rangeNavigator:this,name:"resized",currentSize:new Eo(0,0),previousSize:new Eo(this.availableSize.width,this.availableSize.height)},this.trigger(hfe,e),e.cancelResizedEvent||(this.resizeTo=+setTimeout(function(){i.isDestroyed?clearTimeout(i.resizeTo):(i.createRangeSvg(),t.currentSize=i.availableSize,i.trigger("resized",t),i.calculateBounds(),i.chartSeries.processXAxis(i),i.chartSeries.calculateGroupingBounds(i),i.chartSeries.processYAxis(i),i.renderChart(!0))},500))),!1},wIe.prototype.removeAllTooltip=function(){this.tooltip.enable&&"Always"===this.tooltip.displayMode&&(ie(this.element.id+"_leftTooltip")&&ue(ie(this.element.id+"_leftTooltip")),ie(this.element.id+"_rightTooltip"))&&ue(ie(this.element.id+"_rightTooltip"))},wIe.prototype.mouseMove=function(e){return this.stockChart||ie(this.stockChart?this.element.id:this.element.id+"_svg")&&(this.mouseX=this.setMouseX(e),this.notify(F.touchMoveEvent,e)),!1},wIe.prototype.mouseLeave=function(e){var t=this.rangeSlider;if(t.isDrag){if(this.stockChart)return!1;var i=t.control.tooltip.enable;t.control.allowSnapping&&(t.isDrag=!1,t.setAllowSnapping(t.control,t.currentStart,t.currentEnd,!1,i)),t.triggerEvent(this.chartSeries.xAxis.actualRange)}i=F.isPointer?"pointerleave":"mouseleave";return this.mouseX=this.setMouseX(e),this.notify(i,e),!1},wIe.prototype.rangeOnMouseClick=function(e){return this.notify("click",e),!1},wIe.prototype.print=function(e){new zbe(this).print(e)},wIe.prototype.export=function(e,t,i,n,o,r,s){n=n||[this],new E1e(this).export(e,t,i,n,o,r,s)},wIe.prototype.renderChartBackground=function(){var e=0,t=0,t=(this.stockChart&&this.stockChart.legendSettings.visible&&this.stockChart.stockLegendModule&&("Top"===this.stockChart.legendSettings.position?e+=this.stockChart.stockLegendModule.legendBounds.height:"Left"===this.stockChart.legendSettings.position&&(t+=this.stockChart.stockLegendModule.legendBounds.width)),new vve(this.element.id+"_ChartBorder",this.background||this.themeStyle.background,{width:0,color:"transparent"},1,new Do(t,e,this.availableSize.width,this.availableSize.height)));this.svgObject.appendChild(this.renderer.drawRectangle(t))},wIe.prototype.rangeOnMouseDown=function(e){return this.mouseDownX=this.setMouseX(e),this.notify(F.touchStartEvent,e),!1},wIe.prototype.mouseEnd=function(e){return this.mouseX=this.setMouseX(e),this.notify(F.touchEndEvent,e),!1},wIe.prototype.setMouseX=function(e){var e=(-1<e.type.indexOf("touch")?e.changedTouches[0]:e).clientX,t=this.element.getBoundingClientRect(),i=(this.stockChart?ie(this.element.id):ie(this.element.id+"_svg")).getBoundingClientRect();return e-t.left-Math.max(i.left-t.left,0)},wIe.prototype.getPersistData=function(){return this.addOnPersist(["loaded"])},wIe.prototype.onPropertyChanged=function(e){var t=!1,i=!1,n=!1;this.animateSeries=!1;for(var o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"width":case"height":case"navigatorBorder":case"enableGrouping":case"labelPosition":case"tickPosition":case"labelStyle":i=!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":t=!0;break;case"dataSource":case"series":i=t=!0;break;case"theme":this.animateSeries=!0;break;case"locale":vIe.prototype.refresh.call(this);break;case"value":this.startValue=null,this.endValue=null,this.redraw=n=!0}!i&&t&&(this.removeSvg(),this.chartSeries.xMin=1/0,this.chartSeries.xMax=-1/0,this.chartSeries.renderChart(this)),i&&t&&(this.removeSvg(),this.chartSeries.xMin=this.chartSeries.yMin=1/0,this.chartSeries.xMax=this.chartSeries.yMax=-1/0,this.calculateBounds(),this.chartSeries.renderChart(this)),i&&!t&&(this.removeSvg(),this.calculateBounds(),this.chartSeries.renderChart(this)),i||t||!n||(this.setSliderValue(),this.rangeSlider.setSlider(this.startValue,this.endValue,!0,this.tooltip.enable&&"Always"===this.tooltip.displayMode))},wIe.prototype.requiredModules=function(){var t=this,i=[];return this.series.map(function(e){"Area"!==e.type&&"StepLine"!==e.type||i.push({member:e.type+"Series",args:[t]})}),0<this.periodSelectorSettings.periods.length&&i.push({member:"PeriodSelector",args:[this]}),"Double"!==this.valueType&&i.push({member:this.valueType,args:[this]}),this.tooltip.enable&&i.push({member:"RangeTooltip",args:[this]}),i},wIe.prototype.getModuleName=function(){return"rangeNavigator"},wIe.prototype.destroy=function(){this.unWireEvents(),this.isReact&&this.clearTemplate(),this.rangeSlider.destroy(),vIe.prototype.destroy.call(this),this.element.innerText="",this.element.classList.remove("e-rangenavigator")},tIe([e(null)],wIe.prototype,"width",void 0),tIe([e(null)],wIe.prototype,"height",void 0),tIe([e(null)],wIe.prototype,"dataSource",void 0),tIe([e(null)],wIe.prototype,"xName",void 0),tIe([e(null)],wIe.prototype,"yName",void 0),tIe([e()],wIe.prototype,"query",void 0),tIe([kt([],iIe)],wIe.prototype,"series",void 0),tIe([t({},eIe)],wIe.prototype,"tooltip",void 0),tIe([e(null)],wIe.prototype,"minimum",void 0),tIe([e(null)],wIe.prototype,"maximum",void 0),tIe([e(null)],wIe.prototype,"interval",void 0),tIe([e("Auto")],wIe.prototype,"intervalType",void 0),tIe([e("Hide")],wIe.prototype,"labelIntersectAction",void 0),tIe([e(10)],wIe.prototype,"logBase",void 0),tIe([e("Double")],wIe.prototype,"valueType",void 0),tIe([e("Outside")],wIe.prototype,"labelPosition",void 0),tIe([e("Auto")],wIe.prototype,"labelPlacement",void 0),tIe([e(500)],wIe.prototype,"animationDuration",void 0),tIe([e(!1)],wIe.prototype,"enableGrouping",void 0),tIe([e(!1)],wIe.prototype,"enableDeferredUpdate",void 0),tIe([e(!1)],wIe.prototype,"disableRangeSelector",void 0),tIe([e(!1)],wIe.prototype,"allowSnapping",void 0),tIe([e(!1)],wIe.prototype,"allowIntervalData",void 0),tIe([e(!1)],wIe.prototype,"useGroupingSeparator",void 0),tIe([e()],wIe.prototype,"groupBy",void 0),tIe([e("Outside")],wIe.prototype,"tickPosition",void 0),tIe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},Tge)],wIe.prototype,"labelStyle",void 0),tIe([t({},oye)],wIe.prototype,"majorGridLines",void 0),tIe([t({},uye)],wIe.prototype,"majorTickLines",void 0),tIe([t({},lIe)],wIe.prototype,"navigatorStyleSettings",void 0),tIe([t({},Tme)],wIe.prototype,"periodSelectorSettings",void 0),tIe([t({color:null,width:1},Rge)],wIe.prototype,"navigatorBorder",void 0),tIe([e("Material")],wIe.prototype,"theme",void 0),tIe([e([])],wIe.prototype,"value",void 0),tIe([e(null)],wIe.prototype,"background",void 0),tIe([e("")],wIe.prototype,"labelFormat",void 0),tIe([e("")],wIe.prototype,"skeleton",void 0),tIe([e("DateTime")],wIe.prototype,"skeletonType",void 0),tIe([e("Middle")],wIe.prototype,"secondaryLabelAlignment",void 0),tIe([t({top:5,bottom:5,right:5,left:5},zge)],wIe.prototype,"margin",void 0),tIe([i()],wIe.prototype,"load",void 0),tIe([i()],wIe.prototype,"loaded",void 0),tIe([i()],wIe.prototype,"resized",void 0),tIe([i()],wIe.prototype,"beforeResize",void 0),tIe([i()],wIe.prototype,"labelRender",void 0),tIe([i()],wIe.prototype,"changed",void 0),tIe([i()],wIe.prototype,"tooltipRender",void 0),tIe([i()],wIe.prototype,"selectorRender",void 0),tIe([i()],wIe.prototype,"beforePrint",void 0),tIe([Bt],wIe));function wIe(e,t){e=vIe.call(this,e,t)||this;return e.animateSeries=!0,e.chartid=57725,e.redraw=!1,e}SIe.prototype.initializeChart=function(e){var i,n,o=this,t=this.stockChart,r="isProtectedOnChange";if(t[r]=!0,t.chartObject){for(var s=document.getElementById(t.chartObject.id);s.firstChild;)s.removeChild(s.firstChild);ie(t.chartObject+"_tooltip")&&ue(ie(t.chartObject+"_tooltip"))}else t.chartObject=t.renderer.createGroup({id:t.element.id+"_stockChart_chart"}),t.mainObject.appendChild(t.chartObject);if(this.stockChart.isDateTimeCategory="DateTimeCategory"===this.stockChart.primaryXAxis.valueType,this.stockChart.isDateTimeCategory&&!this.stockChart.sortedData.length){for(var a=0,l=this.stockChart.series;a<l.length;a++)for(var h=l[a],d=h.dataSource,p=h.xName,c=0,u=d;c<u.length;c++){var g=u[c],g=Date.parse(new Date(Sa.parse.parseJson({val:g[p]}).val).toString());-1===this.stockChart.sortedData.indexOf(g)&&this.stockChart.sortedData.push(g)}this.stockChart.sortedData.sort(function(e,t){return e-t})}if(this.cartesianChartSize=this.calculateChartSize(),t.chart=new twe({chartArea:t.chartArea,margin:this.findMargin(t),primaryXAxis:this.copyObject(t.primaryXAxis),primaryYAxis:this.copyObject(t.primaryYAxis),rows:t.rows,indicators:t.indicators,axes:t.axes,tooltipRender:function(e){o.stockChart.trigger("tooltipRender",e)},axisLabelRender:function(e){o.stockChart.trigger("axisLabelRender",e)},seriesRender:function(t){i=null!=o.stockChart.startValue&&o.stockChart.isDateTimeCategory?o.stockChart.sortedData[Math.floor(o.stockChart.startValue)]:o.stockChart.startValue,n=null!=o.stockChart.endValue&&o.stockChart.isDateTimeCategory?o.stockChart.sortedData[Math.floor(o.stockChart.endValue)]:o.stockChart.endValue,t.data&&i&&n&&(t.data=t.data.filter(function(e){return new Date(Sa.parse.parseJson({val:e[t.series.xName]}).val).getTime()>=i&&new Date(Sa.parse.parseJson({val:e[t.series.xName]}).val).getTime()<=n})),t.data=e||t.data,o.stockChart.trigger("seriesRender",t)},onZooming:function(e){o.stockChart.trigger(Sfe,e)},pointClick:function(e){o.stockChart.trigger("pointClick",e)},pointMove:function(e){o.stockChart.trigger("pointMove",e)},dataSource:t.dataSource,series:this.findSeriesCollection(t.series),zoomSettings:this.copyObject(t.zoomSettings),tooltip:t.tooltip,crosshair:t.crosshair,height:this.cartesianChartSize.height.toString(),selectedDataIndexes:t.selectedDataIndexes,selectionMode:t.selectionMode,isMultiSelect:t.isMultiSelect,annotations:t.annotations,theme:t.theme,legendSettings:{visible:!1},enableRtl:t.enableRtl,zoomComplete:function(e){-1!==e.axis.valueType.indexOf("DateTime")&&t.rangeNavigator&&(o.stockChart.zoomChange=!0,e=o.calculateUpdatedRange(e.currentZoomFactor,e.currentZoomPosition,e.axis),t.rangeSelector.sliderChange(e.start,e.end))}}),0!==t.indicators.length){if(t.isSelect)for(var m=0;m<t.indicators.length;m++)t.chart.indicators[m].animation.enable=!1,t.chart.indicators[m].dataSource=Pe([],t.chart.series[0].dataSource,null,!0);t.isSelect=!0}(t.chart.stockChart=t).chart.appendTo(t.chartObject),t[r]=!1,t.onPanning&&(ie(this.stockChart.element.id+"_stockChart_chart").setAttribute("cursor","pointer"),t.chart.mouseMove(t.mouseMoveEvent))},SIe.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},SIe.prototype.findSeriesCollection=function(e){for(var t=[],i=0,n=e.length;i<n;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,t[i].splineType="Spline"===t[i].type?"Cardinal":"Natural";return t},SIe.prototype.calculateChartSize=function(){var e=this.stockChart;return new Eo(e.availableSize.width,e.enablePeriodSelector&&e.enableSelector?e.availableSize.height-e.toolbarHeight-51:e.enableSelector&&!e.enablePeriodSelector?e.availableSize.height-51:e.enablePeriodSelector&&!e.enableSelector?e.availableSize.height-e.toolbarHeight:e.availableSize.height)},SIe.prototype.calculateUpdatedRange=function(e,t,i){var n=i.actualRange,e=(t=n.min+t*n.delta)+e*n.delta;return this.stockChart.isDateTimeCategory&&(t=this.stockChart.sortedData.indexOf(parseInt(i.labels[Math.floor(t)],10)),e=this.stockChart.sortedData.indexOf(parseInt(i.labels[Math.floor(e)],10))),{start:t,end:e}},SIe.prototype.cartesianChartRefresh=function(e,t){e.cartesianChart.initializeChart(t)},SIe.prototype.copyObject=function(e){return Pe({},e,{},!0)};var CIe=SIe;function SIe(e){this.stockChart=e}xIe.prototype.initializeRangeNavigator=function(){var i=this,n=this.stockChart;n.chart.axisCollections[1].labelPadding,n.chart.axisCollections[1].lineStyle.width;if(n.selectorObject){for(var e=document.getElementById(n.selectorObject.id);e.firstChild;)e.removeChild(e.firstChild);ie(n.selectorObject.id+"_leftTooltip")&&ue(ie(n.selectorObject.id+"_leftTooltip")),ie(n.selectorObject.id+"_rightTooltip")&&ue(ie(n.selectorObject.id+"_rightTooltip"))}else n.selectorObject=n.renderer.createGroup({id:n.element.id+"_stockChart_rangeSelector",transform:"translate(0,"+n.cartesianChart.cartesianChartSize.height+")"}),n.mainObject.appendChild(n.selectorObject);n.rangeNavigator=new bIe({locale:"en",valueType:n.primaryXAxis.valueType,theme:this.stockChart.theme,series:this.findSeriesCollection(n.series),height:this.calculateChartSize().height.toString(),tickPosition:"Inside",majorTickLines:{width:0},value:[n.isDateTimeCategory?new Date(n.sortedData[Math.floor(n.startValue)]):new Date(n.startValue),n.isDateTimeCategory?new Date(n.sortedData[Math.floor(n.endValue)]):new Date(n.endValue)],margin:this.findMargin(),tooltip:{enable:n.tooltip.enable,displayMode:"OnDemand"},labelPlacement:"OnTicks",labelPosition:"Inside",dataSource:n.dataSource,intervalType:n.primaryXAxis.intervalType,enableRtl:n.enableRtl,changed:function(e){var t={name:"rangeChange",end:e.end,selectedData:e.selectedData,start:e.start,zoomFactor:e.zoomFactor,zoomPosition:e.zoomPosition,data:void 0};i.stockChart.trigger("rangeChange",t),i.stockChart.startValue=e.start,i.stockChart.endValue=e.end,i.stockChart.zoomChange||i.stockChart.cartesianChart.cartesianChartRefresh(i.stockChart,t.data),n.periodSelector&&n.periodSelector.datePicker&&(n.periodSelector.datePicker.startDate=i.stockChart.isDateTimeCategory?new Date(i.stockChart.sortedData[Math.floor(e.start)]):new Date(e.start),n.periodSelector.datePicker.endDate=i.stockChart.isDateTimeCategory?new Date(i.stockChart.sortedData[Math.floor(e.end)]):new Date(e.end),n.periodSelector.datePicker.dataBind())}}),(n.rangeNavigator.stockChart=n).rangeNavigator.appendTo(n.selectorObject)},xIe.prototype.findMargin=function(){var e={top:5,left:0,right:0,bottom:0};return e},xIe.prototype.findSeriesCollection=function(e){for(var t=[],i=0,n=e.length;i<n;i++)t.push(e[i]),t[i].xName=e[i].xName,t[i].yName=e[i].yName;return t},xIe.prototype.calculateChartSize=function(){var e=this.stockChart;return new Eo(e.availableSize.width,e.enableSelector?51:0)},xIe.prototype.sliderChange=function(e,t){this.stockChart.rangeNavigator.rangeSlider.performAnimation(e,t,this.stockChart.rangeNavigator)};var AIe=xIe;function xIe(e){this.stockChart=e}TIe.prototype.initializePeriodSelector=function(){var e=this.stockChart.tempPeriods,e=(this.stockChart.periods=e,this.stockChart.periodSelector.rootControl=this.stockChart,this.stockChart.chart.chartAxisLayoutPanel.seriesClipRect),t=ie(this.stockChart.element.id+"_Secondary_Element"),i=this.stockChart.toolbarHeight;this.stockChart.periodSelector.appendSelector({thumbSize:0,element:t,width:e.width,height:i},e.x),0<this.stockChart.seriesType.length&&this.initializeSeriesSelector(),this.initializeIndicatorSelector(),0<this.stockChart.trendlineType.length&&this.initializeTrendlineSelector(),this.exportButton()},TIe.prototype.getDropDownItems=function(e){var t=[];if(e===this.stockChart.seriesType){for(var i=0;i<e.length;i++)t.push({text:"&nbsp;&nbsp;&nbsp;"+e[i].toString()});for(i=0;i<this.stockChart.series.length;i++)for(var n=0;n<t.length;n++)(o="OHLC"===(o=t[n].text.replace("&nbsp;&nbsp;&nbsp;",""))?"HiloOpenClose":o)===this.stockChart.series[i].type&&(t[n].text=t[n].text.replace("&nbsp;&nbsp;&nbsp;","&#10004&nbsp;"))}else if(e===this.stockChart.indicatorType){for(i=0;i<e.length;i++)t.push({text:"&nbsp;&nbsp;&nbsp;"+e[i].toString()});for(i=0;i<this.stockChart.indicators.length;i++)for(var o,n=0;n<t.length;n++)(o="Accumulation distribution"===(o=(o=t[n].text.replace("&nbsp;&nbsp;&nbsp;","")).toLowerCase().replace(/(^\w|_\w)/g,function(e){return e.toUpperCase()}).replace(/_/g,""))?"AccumulationDistribution":"Bollinger bands"===o?"BollingerBands":o)===this.stockChart.indicators[i].type&&(t[n].text=t[n].text.replace("&nbsp;&nbsp;&nbsp;","&#10004&nbsp;"),this.indicators.push(o))}else if(e===this.stockChart.exportType)for(i=0;i<e.length;i++)t.push({text:e[i].toString()});else for(i=0;i<e.length;i++)"Print"!==e[i].toString()&&t.push({text:"&nbsp;&nbsp;&nbsp;"+e[i].toString()});return t},TIe.prototype.addedSeries=function(e){for(var t=this.stockChart.series,i=0;i<t.length;i++)if("volume"!==t[i].yName){t[i].type=-1<e.indexOf("Candle")?"Candle":-1<e.indexOf("OHLC")?"HiloOpenClose":e,t[i].enableSolidCandles="Candle"===e;for(var n=0;n<t[i].trendlines.length;n++){var o=t[i].trendlines[n];o.animation.enable=!1,o.enableTooltip=!1}}},TIe.prototype.initializeSeriesSelector=function(){var t=this;-1<this.stockChart.seriesType.indexOf("HiloOpenClose")&&(this.stockChart.seriesType[this.stockChart.seriesType.indexOf("HiloOpenClose")]="OHLC"),-1<this.stockChart.seriesType.indexOf("Candle")&&-1===this.stockChart.seriesType.indexOf("Hollow Candle")&&(this.stockChart.seriesType[this.stockChart.seriesType.length]="Hollow Candle"),new u2({enableHtmlSanitizer:!1,items:this.getDropDownItems(this.stockChart.seriesType),select:function(e){t.selectedSeries=e.item.text;var e=t.tickMark(e);t.addedSeries(e),t.stockChart.cartesianChart.initializeChart(),t.stockChart.stockLegendModule&&t.stockChart.stockLegendModule.legendCollections.length&&t.stockChart.legendSettings.visible&&(e=t.stockChart.stockLegendModule.legendBounds,t.stockChart.stockLegendModule.renderLegend(t.stockChart,t.stockChart.legendSettings,e))}}).appendTo("#"+this.stockChart.element.id+"_seriesType")},TIe.prototype.initializeTrendlineSelector=function(){var o=this;this.trendlineDropDown=new u2({enableHtmlSanitizer:!1,items:this.stockChart.resizeTo?this.trendlineDropDown.items:this.getDropDownItems(this.stockChart.trendlineType),select:function(e){var t=o.tickMark(e);if(o.selectedTrendLine=""===o.selectedTrendLine?t:o.selectedTrendLine+","+t,o.trendline!==t){o.trendline=t;for(var i,n=0;n<o.stockChart.series.length;n++)"volume"!==o.stockChart.series[n].yName&&(0===o.stockChart.series[0].trendlines.length?(i=void 0,o.stockChart.trendlinetriggered&&(o.stockChart.trendlinetriggered=!(i=[{type:t,width:1,enableTooltip:!1}])),o.stockChart.series[0].trendlines=i):(o.stockChart.series[0].trendlines[0].width=1,o.stockChart.series[0].trendlines[0].type=t,o.stockChart.series[0].trendlines[0].animation.enable=!!o.stockChart.trendlinetriggered))}else e.item.text="&nbsp;&nbsp;&nbsp;"+e.item.text.replace("&#10004&nbsp;",""),o.stockChart.series[0].trendlines[0].width=0,o.trendline=null;o.stockChart.cartesianChart.initializeChart()}}),this.trendlineDropDown.appendTo("#"+this.stockChart.element.id+"_trendType")},TIe.prototype.initializeIndicatorSelector=function(){var r=this;this.indicatorDropDown=new u2({enableHtmlSanitizer:!1,items:this.stockChart.resizeTo?this.indicatorDropDown.items:this.getDropDownItems(this.stockChart.indicatorType),select:function(e){for(var t=0;t<r.stockChart.series.length;t++)0!==r.stockChart.series[t].trendlines.length&&(r.stockChart.series[t].trendlines[0].animation.enable=!1);e.item.text=0<=e.item.text.indexOf("&#10004&nbsp;")?e.item.text.substr(e.item.text.indexOf(";")+1):e.item.text;var i=e.item.text.replace("&nbsp;&nbsp;&nbsp;",""),n=i=(i=i.split(" ")[0].toLocaleLowerCase()+(i.split(" ")[1]?i.split(" ")[1]:"")).substr(0,1).toUpperCase()+i.substr(1);if(r.selectedIndicator=-1===r.selectedIndicator.indexOf(n)?r.selectedIndicator+" "+n:r.selectedIndicator.replace(n,""),"Tma"===n||"BollingerBands"===n||"Sma"===n||"Ema"===n){if(-1===r.indicators.indexOf(n)){e.item.text="&#10004&nbsp;"+e.item.text.replace("&nbsp;&nbsp;&nbsp;","");i=r.getIndicator(n,r.stockChart.series[0].yAxisName);r.indicators.push(n),r.stockChart.indicators=r.stockChart.indicators.concat(i)}else{e.item.text="&nbsp;&nbsp;&nbsp;"+e.item.text;for(var o=0;o<r.stockChart.indicators.length;o++)r.stockChart.indicators[o].type===n&&r.stockChart.indicators.splice(o,1);r.indicators.splice(r.indicators.indexOf(n),1)}r.stockChart.cartesianChart.initializeChart()}else r.createIndicatorAxes(n,e)}}),this.indicatorDropDown.appendTo("#"+this.stockChart.element.id+"_indicatorType")},TIe.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)"}]},TIe.prototype.createIndicatorAxes=function(e,t){if(-1===this.indicators.indexOf(e)){t.item.text="&#10004&nbsp;"+t.item.text.replace("&nbsp;&nbsp;&nbsp;",""),this.indicators.push(e);var i=this.stockChart.rows.length,n=(this.stockChart.rows[this.stockChart.rows.length-1].height="15%",[{height:100-15*i+"px"}]);if(1===this.stockChart.rows.length&&(this.stockChart.isSingleAxis=!0),this.stockChart.rows=this.stockChart.rows.concat(n),this.stockChart.isSingleAxis)for(var o=0;o<this.stockChart.axes.length;o++)this.stockChart.axes[o].rowIndex+=1;else this.stockChart.axes[0].rowIndex+=1;n=[{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()}],n=(this.stockChart.axes=this.stockChart.axes.concat(n),this.stockChart.primaryYAxis.rowIndex=this.stockChart.isSingleAxis?i+1:0,this.getIndicator(e,e.toString()));this.stockChart.indicators=this.stockChart.indicators.concat(n)}else{t.item.text="&nbsp;&nbsp;&nbsp;"+t.item.text;for(o=0;o<this.stockChart.indicators.length;o++)this.stockChart.indicators[o].type===e&&this.stockChart.indicators.splice(o,1);this.indicators.splice(this.indicators.indexOf(e),1);for(var r=0,s=0;s<this.stockChart.axes.length;s++)this.stockChart.axes[s].name===e&&(r=this.stockChart.axes[s].rowIndex,this.stockChart.rows.splice(s,1),this.stockChart.axes.splice(s,1));for(s=0;s<this.stockChart.axes.length;s++)0!==this.stockChart.axes[s].rowIndex&&this.stockChart.axes[s].rowIndex>r&&(this.stockChart.axes[s].rowIndex=this.stockChart.axes[s].rowIndex-1)}this.stockChart.cartesianChart.initializeChart()},TIe.prototype.tickMark=function(e){for(var t,i=e.item.parentObj.items,n=0;n<i.length;n++)i[n].text=0<=i[n].text.indexOf("&#10004&nbsp;")?i[n].text.substr(i[n].text.indexOf(";")+1):i[n].text,0<=i[n].text.indexOf("&nbsp;&nbsp;&nbsp;")||(i[n].text="&nbsp;&nbsp;&nbsp;"+i[n].text);return 0<=e.item.text.indexOf("&nbsp;&nbsp;&nbsp;")?(t=e.item.text.replace("&nbsp;&nbsp;&nbsp;",""),e.item.text=e.item.text.replace("&nbsp;&nbsp;&nbsp;","&#10004&nbsp;")):t=e.item.text.replace("&#10004&nbsp;",""),t},TIe.prototype.exportButton=function(){var s=this;new u2({enableHtmlSanitizer:!1,items:this.getDropDownItems(this.stockChart.exportType),select:function(e){var t,i,n,o,r,e=e.item.text;s.stockChart.chart.exportModule&&(i=(t=s.stockChart).element.id+"_stockChart_",n=t.svgObject.getBoundingClientRect(),s.stockChart.svgObject.insertAdjacentElement("afterbegin",s.addExportSettings("Print"===e)),o=t.svgObject.firstElementChild.getBoundingClientRect(),r=new vve("additionalRect","transparent",{width:0,color:"transparent"},1,new Do(0,0,s.stockChart.availableSize.width,o.height)),t.svgObject.firstElementChild.insertAdjacentElement("afterbegin",s.stockChart.renderer.drawRectangle(r)),s.stockChart.svgObject.setAttribute("height",(n.height+o.height).toString()),ie(i+"chart").style.transform="translateY("+o.height+"px)",t.enableSelector&&ie(i+"rangeSelector").setAttribute("transform","translate(0,"+(t.cartesianChart.cartesianChartSize.height+o.height)+")"),s.stockChart.legendSettings.visible&&s.stockChart.stockLegendModule&&(ie(t.element.id+"_chart_legend_g").style.transform="translateY("+o.height+"px)"),"Print"===e?s.stockChart.chart.print(s.stockChart.svgObject.id):t.chart.exportModule.export(e,"StockChart",null,[t],null,t.svgObject.clientHeight),ue(ie(s.stockChart.element.id+"_additionalExport")),ie(i+"chart").style.transform="",t.enableSelector&&ie(i+"rangeSelector").setAttribute("transform","translate(0,"+t.cartesianChart.cartesianChartSize.height+")"),s.stockChart.legendSettings.visible&&s.stockChart.stockLegendModule&&(ie(t.element.id+"_chart_legend_g").style.transform="translateY(0px)"),s.stockChart.svgObject.setAttribute("height",n.height.toString()))}}).appendTo("#"+this.stockChart.element.id+"_export")},TIe.prototype.calculateAutoPeriods=function(){var e=[],t=this.stockChart.isDateTimeCategory?this.stockChart.sortedData[this.stockChart.seriesXMin]:this.stockChart.seriesXMin,i=this.stockChart.isDateTimeCategory?this.stockChart.sortedData[this.stockChart.seriesXMax]:this.stockChart.seriesXMax;return(e=this.findRange(t,i)).push({text:"YTD",selected:!0},{text:"All"}),e},TIe.prototype.findRange=function(e,t){var i=[];return 1<=(t-e)/3154e7?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"}):1<=(t-e)/1577e7?i.push({text:"1M",interval:1,intervalType:"Months"},{text:"3M",interval:3,intervalType:"Months"},{text:"6M",interval:6,intervalType:"Months"}):1<=(t-e)/2628e6?i.push({text:"1D",interval:1,intervalType:"Days"},{text:"3W",interval:3,intervalType:"Weeks"},{text:"1M",interval:1,intervalType:"Months"}):1<=(t-e)/864e5&&i.push({text:"1H",interval:1,intervalType:"Hours"},{text:"12H",interval:12,intervalType:"Hours"},{text:"1D",interval:1,intervalType:"Days"}),i},TIe.prototype.addExportSettings=function(e){var t=this.stockChart.renderer.createGroup({id:this.stockChart.element.id+"_additionalExport",width:this.stockChart.availableSize.width,fill:this.stockChart.background||"transparent"}),i=So(this.stockChart.title,this.stockChart.titleStyle,this.stockChart.themeStyle.chartTitleFont).height,n=new ko(t.id+"_Title",dve(new Do(0,0,this.stockChart.availableSize.width,0),this.stockChart.titleStyle),0,"middle",this.stockChart.title,"","text-before-edge");return sve(this.stockChart.renderer,n,this.stockChart.titleStyle,this.stockChart.titleStyle.color||this.stockChart.themeStyle.chartTitleFont.color,t,null,null,null,null,null,null,0,null,null,null,this.stockChart.themeStyle.chartTitleFont),e||(n={size:"16px",fontWeight:"600",color:this.stockChart.themeStyle.chartTitleFont.color,fontStyle:"Normal",fontFamily:this.stockChart.themeStyle.chartTitleFont.fontFamily},e=So("Series: "+this.selectedSeries,n).width/2,this.textElementSpan(new ko(t.id+"_Series",e,i=i,"start",["Series : ",this.selectedSeries],"","text-before-edge"),n,this.stockChart.themeStyle.chartTitleFont.color,t),e+=So("Series: "+this.selectedSeries+" Z",n).width,""!==this.selectedIndicator&&(this.textElementSpan(new ko(t.id+"_Indicator",e,i,"start",["Indicator :",this.selectedIndicator],"","text-before-edge"),n,this.stockChart.themeStyle.chartTitleFont.color,t),e+=So("Indicator: "+this.selectedIndicator+" Z",n).width),""!==this.selectedTrendLine&&this.textElementSpan(new ko(t.id+"_TrendLine",e,i,"start",["Trendline :",this.selectedTrendLine],"","text-before-edge"),n,this.stockChart.themeStyle.chartTitleFont.color,t)),t},TIe.prototype.textElementSpan=function(e,t,i,n,o,r,s,a,l){void 0===o&&(o=!1),void 0===a&&(a=!1);var h,d=new fo(""),i={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:i,"font-size":t.size,transform:e.transform,opacity:t.opacity,"dominant-baseline":e.baseLine},p="string"==typeof e.text?e.text:o?e.text[e.text.length-1]:e.text[0],c=d.createText(i,p);if("string"!=typeof e.text&&1<e.text.length)for(var u=1,g=e.text.length;u<g;u++)e.text[u]=" "+e.text[u],h=d.createTSpan({x:e.x+So(p,t).width+5,id:e.id,y:e.y,opacity:.5},e.text[u]),c.appendChild(h);return O0e(!1,n,c,r,s,"x","y",null,null,a,!1,null,l),c};var IIe=TIe;function TIe(e){this.selectedSeries="",this.selectedIndicator="",this.selectedTrendLine="",this.indicators=[],this.stockChart=e,this.selectedSeries=this.stockChart.series[0].type}EIe=function(e,t){return(EIe=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])}))(e,t)};var EIe,DIe,tIe=function(e,t){function i(){this.constructor=e}EIe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},MIe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},kIe=(tIe(PIe,DIe=n),MIe([e("")],PIe.prototype,"color",void 0),MIe([e("16px")],PIe.prototype,"size",void 0),MIe([e("Segoe UI")],PIe.prototype,"fontFamily",void 0),MIe([e("Normal")],PIe.prototype,"fontStyle",void 0),MIe([e("Normal")],PIe.prototype,"fontWeight",void 0),MIe([e(1)],PIe.prototype,"opacity",void 0),MIe([e("Trim")],PIe.prototype,"textOverflow",void 0),MIe([e("Center")],PIe.prototype,"textAlignment",void 0),PIe);function PIe(){return null!==DIe&&DIe.apply(this,arguments)||this}tIe(LIe,BIe=n),MIe([e("")],LIe.prototype,"color",void 0),MIe([e(1)],LIe.prototype,"width",void 0);var BIe,FIe=LIe;function LIe(){return null!==BIe&&BIe.apply(this,arguments)||this}tIe(NIe,RIe=n),MIe([t({},FIe)],NIe.prototype,"border",void 0),MIe([e("transparent")],NIe.prototype,"background",void 0),MIe([e(1)],NIe.prototype,"opacity",void 0);var RIe,OIe=NIe;function NIe(){return null!==RIe&&RIe.apply(this,arguments)||this}tIe(HIe,VIe=n),MIe([e(null)],HIe.prototype,"left",void 0),MIe([e(null)],HIe.prototype,"right",void 0),MIe([e(null)],HIe.prototype,"top",void 0),MIe([e(null)],HIe.prototype,"bottom",void 0);var VIe,_Ie=HIe;function HIe(){return null!==VIe&&VIe.apply(this,arguments)||this}tIe(WIe,zIe=n),MIe([e(!1)],WIe.prototype,"startFromAxis",void 0),MIe([e(!0)],WIe.prototype,"visible",void 0),MIe([e(null)],WIe.prototype,"start",void 0),MIe([e("#808080")],WIe.prototype,"color",void 0),MIe([e(null)],WIe.prototype,"end",void 0),MIe([e(null)],WIe.prototype,"size",void 0),MIe([e("Auto")],WIe.prototype,"sizeType",void 0),MIe([e(null)],WIe.prototype,"dashArray",void 0),MIe([e(!1)],WIe.prototype,"isRepeat",void 0),MIe([e(null)],WIe.prototype,"repeatEvery",void 0),MIe([e(!1)],WIe.prototype,"isSegmented",void 0),MIe([e(null)],WIe.prototype,"repeatUntil",void 0),MIe([e(null)],WIe.prototype,"segmentStart",void 0),MIe([e(null)],WIe.prototype,"segmentAxisName",void 0),MIe([e(null)],WIe.prototype,"segmentEnd",void 0),MIe([e(1)],WIe.prototype,"opacity",void 0),MIe([e("")],WIe.prototype,"text",void 0),MIe([t({color:"transparent",width:1},FIe)],WIe.prototype,"border",void 0),MIe([e(null)],WIe.prototype,"rotation",void 0),MIe([e("Behind")],WIe.prototype,"zIndex",void 0),MIe([e("Middle")],WIe.prototype,"horizontalAlignment",void 0),MIe([e("Middle")],WIe.prototype,"verticalAlignment",void 0),MIe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},kIe)],WIe.prototype,"textStyle",void 0);var zIe,jIe=WIe;function WIe(){return null!==zIe&&zIe.apply(this,arguments)||this}tIe(qIe,QIe=n),MIe([e(null)],qIe.prototype,"fill",void 0),MIe([e("Gap")],qIe.prototype,"mode",void 0),MIe([t({color:"transparent",width:0},FIe)],qIe.prototype,"border",void 0);var QIe,UIe=qIe;function qIe(){return null!==QIe&&QIe.apply(this,arguments)||this}tIe(XIe,GIe=n),MIe([e("Line")],XIe.prototype,"type",void 0),MIe([e(null)],XIe.prototype,"length",void 0),MIe([e(null)],XIe.prototype,"color",void 0),MIe([e("")],XIe.prototype,"dashArray",void 0),MIe([e(1)],XIe.prototype,"width",void 0);var GIe,YIe=XIe;function XIe(){return null!==GIe&&GIe.apply(this,arguments)||this}tIe(ZIe,KIe=n),MIe([e("date")],ZIe.prototype,"xName",void 0),MIe([e("close")],ZIe.prototype,"yName",void 0),MIe([e("open")],ZIe.prototype,"open",void 0),MIe([e("close")],ZIe.prototype,"close",void 0),MIe([e("high")],ZIe.prototype,"high",void 0),MIe([e("low")],ZIe.prototype,"low",void 0),MIe([e("volume")],ZIe.prototype,"volume",void 0),MIe([e("")],ZIe.prototype,"pointColorMapping",void 0),MIe([e("SeriesType")],ZIe.prototype,"legendShape",void 0),MIe([e("")],ZIe.prototype,"legendImageUrl",void 0),MIe([t(null,Qge)],ZIe.prototype,"animation",void 0),MIe([e(null)],ZIe.prototype,"xAxisName",void 0),MIe([e(null)],ZIe.prototype,"yAxisName",void 0),MIe([e(null)],ZIe.prototype,"fill",void 0),MIe([e("0")],ZIe.prototype,"dashArray",void 0),MIe([e(1)],ZIe.prototype,"width",void 0),MIe([e("")],ZIe.prototype,"name",void 0),MIe([e("")],ZIe.prototype,"dataSource",void 0),MIe([e()],ZIe.prototype,"query",void 0),MIe([e("#e74c3d")],ZIe.prototype,"bullFillColor",void 0),MIe([e("#2ecd71")],ZIe.prototype,"bearFillColor",void 0),MIe([e(!1)],ZIe.prototype,"enableSolidCandles",void 0),MIe([e(!0)],ZIe.prototype,"visible",void 0),MIe([t({color:"transparent",width:0},Rge)],ZIe.prototype,"border",void 0),MIe([e(1)],ZIe.prototype,"opacity",void 0),MIe([e("Candle")],ZIe.prototype,"type",void 0),MIe([t(null,Jve)],ZIe.prototype,"marker",void 0),MIe([kt([],obe)],ZIe.prototype,"trendlines",void 0),MIe([e(!0)],ZIe.prototype,"enableTooltip",void 0),MIe([e("")],ZIe.prototype,"tooltipMappingName",void 0),MIe([e(null)],ZIe.prototype,"selectionStyle",void 0),MIe([e(.5)],ZIe.prototype,"cardinalSplineTension",void 0),MIe([t(null,ime)],ZIe.prototype,"cornerRadius",void 0),MIe([t(null,UIe)],ZIe.prototype,"emptyPointSettings",void 0),MIe([e(null)],ZIe.prototype,"columnWidth",void 0),MIe([e(0)],ZIe.prototype,"columnSpacing",void 0),MIe([e(!0)],ZIe.prototype,"showNearestTooltip",void 0);var KIe,JIe=ZIe;function ZIe(){var e=null!==KIe&&KIe.apply(this,arguments)||this;return e.localData=void 0,e}tIe(tTe,$Ie=n),MIe([e("Sma")],tTe.prototype,"type",void 0),MIe([e(14)],tTe.prototype,"period",void 0),MIe([e(3)],tTe.prototype,"dPeriod",void 0),MIe([e(14)],tTe.prototype,"kPeriod",void 0),MIe([e(80)],tTe.prototype,"overBought",void 0),MIe([e(20)],tTe.prototype,"overSold",void 0),MIe([e("Close")],tTe.prototype,"field",void 0),MIe([e(2)],tTe.prototype,"standardDeviation",void 0),MIe([e(12)],tTe.prototype,"slowPeriod",void 0),MIe([e(!0)],tTe.prototype,"showZones",void 0),MIe([e(26)],tTe.prototype,"fastPeriod",void 0),MIe([t({color:"#ff9933",width:2},YIe)],tTe.prototype,"macdLine",void 0),MIe([e("Both")],tTe.prototype,"macdType",void 0),MIe([e("#e74c3d")],tTe.prototype,"macdNegativeColor",void 0),MIe([e("#2ecd71")],tTe.prototype,"macdPositiveColor",void 0),MIe([e("rgba(211,211,211,0.25)")],tTe.prototype,"bandColor",void 0),MIe([t({color:"#ffb735",width:1},YIe)],tTe.prototype,"upperLine",void 0),MIe([e("")],tTe.prototype,"seriesName",void 0),MIe([t({color:"#f2ec2f",width:1},YIe)],tTe.prototype,"periodLine",void 0),MIe([t({color:"#f2ec2f",width:1},YIe)],tTe.prototype,"lowerLine",void 0),MIe([e("")],tTe.prototype,"high",void 0),MIe([e("")],tTe.prototype,"open",void 0),MIe([e("")],tTe.prototype,"low",void 0),MIe([e("")],tTe.prototype,"xName",void 0),MIe([e("")],tTe.prototype,"close",void 0),MIe([e("")],tTe.prototype,"pointColorMapping",void 0),MIe([e("")],tTe.prototype,"volume",void 0),MIe([e(null)],tTe.prototype,"xAxisName",void 0),MIe([e(null)],tTe.prototype,"yAxisName",void 0),MIe([t(null,Qge)],tTe.prototype,"animation",void 0),MIe([e(null)],tTe.prototype,"fill",void 0),MIe([e("0")],tTe.prototype,"dashArray",void 0),MIe([e(1)],tTe.prototype,"width",void 0),MIe([e()],tTe.prototype,"query",void 0),MIe([e("")],tTe.prototype,"dataSource",void 0);var $Ie,eTe=tTe;function tTe(){return null!==$Ie&&$Ie.apply(this,arguments)||this}tIe(oTe,iTe=n),MIe([t({},bye)],oTe.prototype,"crosshairTooltip",void 0),MIe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},Tge)],oTe.prototype,"labelStyle",void 0),MIe([e("")],oTe.prototype,"title",void 0),MIe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},kIe)],oTe.prototype,"titleStyle",void 0),MIe([e("")],oTe.prototype,"labelFormat",void 0),MIe([e("DateTime")],oTe.prototype,"skeletonType",void 0),MIe([e("")],oTe.prototype,"skeleton",void 0),MIe([e(0)],oTe.prototype,"plotOffset",void 0),MIe([e(10)],oTe.prototype,"logBase",void 0),MIe([e(0)],oTe.prototype,"rowIndex",void 0),MIe([e(1)],oTe.prototype,"span",void 0),MIe([e(3)],oTe.prototype,"maximumLabels",void 0),MIe([e(null)],oTe.prototype,"desiredIntervals",void 0),MIe([e(1)],oTe.prototype,"zoomFactor",void 0),MIe([e(0)],oTe.prototype,"zoomPosition",void 0),MIe([e(!1)],oTe.prototype,"opposedPosition",void 0),MIe([e(!0)],oTe.prototype,"enableAutoIntervalOnZooming",void 0),MIe([e("Double")],oTe.prototype,"valueType",void 0),MIe([e("Auto")],oTe.prototype,"rangePadding",void 0),MIe([e("None")],oTe.prototype,"edgeLabelPlacement",void 0),MIe([e("BetweenTicks")],oTe.prototype,"labelPlacement",void 0),MIe([e("Auto")],oTe.prototype,"intervalType",void 0),MIe([e("Outside")],oTe.prototype,"tickPosition",void 0),MIe([e("")],oTe.prototype,"name",void 0),MIe([e("Outside")],oTe.prototype,"labelPosition",void 0),MIe([e(!0)],oTe.prototype,"visible",void 0),MIe([e(0)],oTe.prototype,"labelRotation",void 0),MIe([e(0)],oTe.prototype,"minorTicksPerInterval",void 0),MIe([e(null)],oTe.prototype,"crossesAt",void 0),MIe([e(null)],oTe.prototype,"crossesInAxis",void 0),MIe([e(!0)],oTe.prototype,"placeNextToAxisLine",void 0),MIe([e(null)],oTe.prototype,"minimum",void 0),MIe([e(null)],oTe.prototype,"interval",void 0),MIe([e(null)],oTe.prototype,"maximum",void 0),MIe([e(34)],oTe.prototype,"maximumLabelWidth",void 0),MIe([t({},uye)],oTe.prototype,"majorTickLines",void 0),MIe([e(!1)],oTe.prototype,"enableTrim",void 0),MIe([t({},fye)],oTe.prototype,"minorTickLines",void 0),MIe([t({},aye)],oTe.prototype,"minorGridLines",void 0),MIe([t({},oye)],oTe.prototype,"majorGridLines",void 0),MIe([t({},dye)],oTe.prototype,"lineStyle",void 0),MIe([e(!1)],oTe.prototype,"isInversed",void 0),MIe([e("Trim")],oTe.prototype,"labelIntersectAction",void 0),MIe([e(100)],oTe.prototype,"coefficient",void 0),MIe([e(0)],oTe.prototype,"startAngle",void 0),MIe([e(2)],oTe.prototype,"tabIndex",void 0),MIe([kt([],jIe)],oTe.prototype,"stripLines",void 0),MIe([e(null)],oTe.prototype,"description",void 0);var iTe,nTe=oTe;function oTe(){return null!==iTe&&iTe.apply(this,arguments)||this}tIe(aTe,rTe=n),MIe([e("100%")],aTe.prototype,"height",void 0),MIe([t({},FIe)],aTe.prototype,"border",void 0);var rTe,sTe=aTe;function aTe(){return null!==rTe&&rTe.apply(this,arguments)||this}tIe(dTe,lTe=n),MIe([e(2)],dTe.prototype,"period",void 0),MIe([e("")],dTe.prototype,"name",void 0),MIe([e("Linear")],dTe.prototype,"type",void 0),MIe([e(2)],dTe.prototype,"polynomialOrder",void 0),MIe([e(0)],dTe.prototype,"forwardForecast",void 0),MIe([e(0)],dTe.prototype,"backwardForecast",void 0),MIe([t({},Qge)],dTe.prototype,"animation",void 0),MIe([e(!0)],dTe.prototype,"enableTooltip",void 0),MIe([t({},Jve)],dTe.prototype,"marker",void 0),MIe([e(null)],dTe.prototype,"intercept",void 0),MIe([e("")],dTe.prototype,"fill",void 0),MIe([e("SeriesType")],dTe.prototype,"legendShape",void 0),MIe([e(1)],dTe.prototype,"width",void 0);var lTe,hTe=dTe;function dTe(){return null!==lTe&&lTe.apply(this,arguments)||this}tIe(uTe,pTe=n),MIe([e("0")],uTe.prototype,"y",void 0),MIe([e("0")],uTe.prototype,"x",void 0),MIe([e(null)],uTe.prototype,"content",void 0),MIe([e("Chart")],uTe.prototype,"region",void 0),MIe([e("Center")],uTe.prototype,"horizontalAlignment",void 0),MIe([e("Pixel")],uTe.prototype,"coordinateUnits",void 0),MIe([e("Middle")],uTe.prototype,"verticalAlignment",void 0),MIe([e(null)],uTe.prototype,"yAxisName",void 0),MIe([e(null)],uTe.prototype,"description",void 0),MIe([e(null)],uTe.prototype,"xAxisName",void 0);var pTe,cTe=uTe;function uTe(){return null!==pTe&&pTe.apply(this,arguments)||this}tIe(fTe,gTe=n),MIe([e(0)],fTe.prototype,"point",void 0),MIe([e(0)],fTe.prototype,"series",void 0);var gTe,mTe=fTe;function fTe(){return null!==gTe&&gTe.apply(this,arguments)||this}tIe(vTe,yTe=n),MIe([e("Circle")],vTe.prototype,"type",void 0),MIe([e("")],vTe.prototype,"text",void 0),MIe([e("")],vTe.prototype,"description",void 0),MIe([e()],vTe.prototype,"date",void 0),MIe([t({color:"black",width:1},FIe)],vTe.prototype,"border",void 0),MIe([e("transparent")],vTe.prototype,"background",void 0),MIe([e(!0)],vTe.prototype,"showOnSeries",void 0),MIe([e("close")],vTe.prototype,"placeAt",void 0),MIe([t(Jfe,kIe)],vTe.prototype,"textStyle",void 0),MIe([e([])],vTe.prototype,"seriesIndexes",void 0);var yTe,tIe=vTe;function vTe(){return null!==yTe&&yTe.apply(this,arguments)||this}bTe=function(e,t){return(bTe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}bTe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(STe,wTe=MAe),STe.prototype.renderStockEvents=function(){var e,t=this.stockChart,i=t.renderer.createGroup({id:this.chartId+"_StockEvents"});this.symbolLocations=function(e,t,i){for(var n=[],o=0;o<e;++o){for(var r=[],s=0;s<t;++s)r[s]=i;n[o]=r}return n}(t.series.length,t.stockEvents.length,new Tve(0,0));for(var n=0;n<t.stockEvents.length;n++)for(var o=this.stockChart.stockEvents[n],r=0,s=t.chart.series;r<s.length;r++){var a=s[r],l={name:mfe,stockChart:t,text:o.text,type:o.type,cancel:!1,series:a};if(t.trigger(mfe,l),o.text=l.text,o.type=l.type,e=So(o.text+"W",o.textStyle,this.stockChart.themeStyle.axisLabelFont),!l.cancel){var h=t.renderer.createGroup({id:this.chartId+"_Series_"+a.index+"_StockEvents_"+n}),l=this.dateParse(o.date).getTime();if(Rye(l=this.stockChart.isDateTimeCategory?a.xAxis.labels.indexOf(l.toString()):l,a.xAxis.visibleRange)&&l>=a.xMin&&l<=a.xMax)if(0<o.seriesIndexes.length)for(var d=0;d<o.seriesIndexes.length;d++)o.seriesIndexes[d]===a.index&&i.appendChild(this.creatEventGroup(h,a,o,n,e));else i.appendChild(this.creatEventGroup(h,a,o,n,e))}}return i},STe.prototype.creatEventGroup=function(e,t,i,n,o){var r=this.findClosePoint(t,i);return i.showOnSeries||(r.y=t.yAxis.rect.y+t.yAxis.rect.height),this.symbolLocations[t.index][n]=r,this.createStockElements(e,i,t,n,r,o),e},STe.prototype.findClosePoint=function(e,t){for(var i,n,o=this.dateParse(t.date).getTime(),o=this.stockChart.isDateTimeCategory?e.xAxis.labels.indexOf(o.toString()):o,r=this.getClosest(e,o),s=0;s<e.points.length;s++)(r===(n=e.points[s]).xValue&&n.visible||0!==s&&s!==e.points.length-1&&r>e.points[s-1].xValue&&r<e.points[s+1].xValue)&&(i=new Mve(n,e));o=e.xAxis.rect.x+Yye(i.point.xValue,e.xAxis)*e.xAxis.rect.width;return t=-1*(Yye(i.point[t.placeAt],e.yAxis)*e.yAxis.rect.height)+(e.yAxis.rect.y+e.yAxis.rect.height),new Tve(o,t)},STe.prototype.createStockElements=function(e,t,i,n,o,r){var s,a,l=new Eo(20<r.width?r.width:20,20<r.height?r.height:20),h=o.x,d=o.y,p=this.chartId+"_Series_"+i.index+"_StockEvents_"+n,c=t.border;switch(t.type){case"Flag":case"Circle":case"Square":e.appendChild(A0e(new Tve(h,d),"Circle",new Eo(2,2),"",new No(p+"_Circle","transparent",c.width,c.color),this.dateParse(t.date).toISOString())),e.appendChild(A0e(new Tve(h,d-5),"VerticalLine",new Eo(9,9),"",new No(p+"_Path",c.color,c.width,c.color),this.dateParse(t.date).toISOString())),e.appendChild(A0e(new Tve("Flag"!==t.type?h:h+l.width/2,d-l.height),t.type,l,"",new No(p+"_Shape",t.background,c.width,c.color),this.dateParse(t.date).toISOString())),sve(this.stockChart.renderer,new ko(p+"_Text","Flag"!==t.type?o.x:o.x+l.width/2,o.y-l.height,"middle",t.text,"","middle"),t.textStyle,t.textStyle.color,e);break;case"ArrowUp":case"ArrowDown":case"ArrowRight":case"ArrowLeft":s="M "+h+" "+d+" "+this.findArrowpaths(t.type),a=new No(p+"_Shape",t.background,c.width,c.color,1,"",s),e.appendChild(this.stockChart.renderer.drawPath(a));break;case"Triangle":case"InvertedTriangle":l.height=3*r.height,l.width=r.width+1.5*r.width,e.appendChild(A0e(new Tve(o.x,o.y),t.type,new Eo(20,20),"",new No(p+"_Shape",t.background,c.width,c.color),this.dateParse(t.date).toISOString())),sve(this.stockChart.renderer,new ko(p+"_Text",o.x,o.y,"middle",t.text,"","middle"),t.textStyle,t.textStyle.color,e);break;case"Text":r.height+=8,s="M "+h+" "+d+" L "+(h-5)+" "+(d-5)+" L "+(h-r.width/2)+" "+(d-5)+" L "+(h-r.width/2)+" "+(d-r.height)+" L "+(h+r.width/2)+" "+(d-r.height)+" L "+(h+r.width/2)+" "+(d-5)+" L "+(h+5)+" "+(d-5)+" Z",a=new No(p+"_Shape",t.background,c.width,c.color,1,"",s),e.appendChild(this.stockChart.renderer.drawPath(a)),sve(this.stockChart.renderer,new ko(p+"_Text",h,d-r.height/2,"middle",t.text,"","middle"),t.textStyle,t.textStyle.color,e);break;default:s="M "+h+" "+d+" L "+(h-r.width/2)+" "+(d-r.height/3)+" L "+(h-r.width/2)+" "+(d-r.height)+" L "+(h+r.width/2)+" "+(d-r.height)+" L "+(h+r.width/2)+" "+(d-r.height/3)+" Z",a=new No(p+"_Shape",t.background,c.width,c.color,1,"",s),e.appendChild(this.stockChart.renderer.drawPath(a)),sve(this.stockChart.renderer,new ko(p+"_Text",h,d-r.height/2,"middle",t.text,"","middle"),t.textStyle,t.textStyle.color,e)}},STe.prototype.renderStockEventTooltip=function(e){var t=parseInt(e.split("_StockEvents_")[0].split(this.chartId+"_Series_")[1],10),e=parseInt(e.split("_StockEvents_")[1].replace(/\D+/g,""),10),i=this.symbolLocations[t][e],i=new Tve(i.x,i.y+this.stockChart.toolbarHeight+this.stockChart.titleSize.height),t=(this.applyHighLights(e,t),this.getElement(this.chartId+"_StockEvents_Tooltip_svg"));this.stockEventTooltip&&t&&0<parseInt(t.getAttribute("opacity"),10)?(this.stockEventTooltip.content=[this.stockChart.stockEvents[e].description],this.stockEventTooltip.location=i,this.stockEventTooltip.dataBind()):(ie(this.chartId+"_StockEvents_Tooltip_svg")&&ue(ie(this.chartId+"_StockEvents_Tooltip")),t=Q("div",{id:this.chartId+"_StockEvents_Tooltip",className:"ejSVGTooltip",attrs:{style:"pointer-events:none; position:absolute;z-index: 1"}}),ie(this.chartId+"_Secondary_Element").appendChild(t),this.stockEventTooltip=new tr({opacity:1,header:"",content:[this.stockChart.stockEvents[e].description],enableAnimation:!0,location:i,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("#"+t.id))},STe.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):i&&this.stockChart.onPanning&&ue(i)},STe.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},STe.prototype.applyHighLights=function(e,t){this.pointIndex===e&&this.seriesIndex===t||this.removeHighLights(),this.pointIndex=e,this.seriesIndex=t;t=this.chartId+"_Series_"+t+"_StockEvents_"+e;this.setOpacity(t+"_Shape",.5),this.setOpacity(t+"_Text",.5)},STe.prototype.removeHighLights=function(){var e=this.chartId+"_Series_"+this.seriesIndex+"_StockEvents_"+this.pointIndex;this.setOpacity(e+"_Shape",1),this.setOpacity(e+"_Text",1)},STe.prototype.setOpacity=function(e,t){ie(e)&&ie(e).setAttribute("opacity",t.toString())},STe.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(Sa.parse.parseJson({val:e}).val)))))};var bTe,wTe,CTe=STe;function STe(e){var t=wTe.call(this,e.chart)||this;return t.symbolLocations=[],t.stockChart=e,t.chartId=t.stockChart.element.id,t}ATe=function(e,t){return(ATe=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])}))(e,t)};var ATe,xTe,MIe=function(e,t){function i(){this.constructor=e}ATe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},ITe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},ITe=(MIe(TTe,xTe=n),ITe([e(!1)],TTe.prototype,"visible",void 0),ITe([e(null)],TTe.prototype,"height",void 0),ITe([e(null)],TTe.prototype,"width",void 0),ITe([t({x:0,y:0},yge)],TTe.prototype,"location",void 0),ITe([e("Auto")],TTe.prototype,"position",void 0),ITe([e("Series")],TTe.prototype,"mode",void 0),ITe([e(8)],TTe.prototype,"padding",void 0),ITe([e(null)],TTe.prototype,"itemPadding",void 0),ITe([e("Center")],TTe.prototype,"alignment",void 0),ITe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},kIe)],TTe.prototype,"textStyle",void 0),ITe([e(10)],TTe.prototype,"shapeHeight",void 0),ITe([e(10)],TTe.prototype,"shapeWidth",void 0),ITe([t({},FIe)],TTe.prototype,"border",void 0),ITe([t({left:0,right:0,top:0,bottom:0},_Ie)],TTe.prototype,"margin",void 0),ITe([t({left:0,right:0,top:0,bottom:0},rme)],TTe.prototype,"containerPadding",void 0),ITe([e(8)],TTe.prototype,"shapePadding",void 0),ITe([e("transparent")],TTe.prototype,"background",void 0),ITe([e(1)],TTe.prototype,"opacity",void 0),ITe([e(!0)],TTe.prototype,"toggleVisibility",void 0),ITe([e(null)],TTe.prototype,"description",void 0),ITe([e(3)],TTe.prototype,"tabIndex",void 0),ITe([e(null)],TTe.prototype,"title",void 0),ITe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},kIe)],TTe.prototype,"titleStyle",void 0),ITe([e("Top")],TTe.prototype,"titlePosition",void 0),ITe([e(100)],TTe.prototype,"maximumTitleWidth",void 0),ITe([e(!0)],TTe.prototype,"enablePages",void 0),ITe([e(!1)],TTe.prototype,"isInversed",void 0),TTe);function TTe(){return null!==xTe&&xTe.apply(this,arguments)||this}MIe(DTe,ETe=Gve),DTe.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on("click",this.click,this),this.chart.on(F.touchEndEvent,this.mouseEnd,this),this.chart.on(F.touchMoveEvent,this.mouseMove,this))},DTe.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off("click",this.click),this.chart.off(F.touchEndEvent,this.mouseEnd),this.chart.off(F.touchMoveEvent,this.mouseMove))},DTe.prototype.mouseMove=function(e){this.chart.legendSettings.visible&&!this.chart.isTouch&&this.move(e)},DTe.prototype.mouseEnd=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},DTe.prototype.getLegendOptions=function(e){var t,i;this.legendCollections=[],1<e.length&&(this.legend.mode="Series");for(var n=0,o=e;n<o.length;n++){var r=o[n];"Series"===this.legend.mode&&"Indicator"!==r.category&&(t=r.type,i=r.pointColorMapping&&0<r.points.length&&r.points[0].interior||r.interior,this.legendCollections.push(new Rbe(r.name,i,r.legendShape,("TrendLine"===r.category?this.chart.series[r.sourceIndex].trendlines[r.index]:r).visible,t,r.legendImageUrl,r.marker.shape,r.marker.visible)))}},DTe.prototype.getLegendBounds=function(e,t,i){this.calculateLegendTitle(i,t);var n,o=i.padding,r=(this.isTitle=!!i.title,i.titlePosition),s=0,a=0,l=this.arrowHeight,h=this.arrowWidth,d=this.isVertical&&!i.enablePages?l:0,p=this.isTitle&&"Top"===r?this.fivePixel+this.legendTitleSize.height:0,p=this.isTitle&&this.isVertical&&"Top"!==r?this.fivePixel+this.legendTitleSize.height:p;this.isVertical?s=i.width?0:e.width/100*5:a=i.height?0:e.height/100*5,t.height+=a,t.width+=s;for(var c,u=i.shapePadding,g=i.shapeWidth,m=0,f=0,y=0,v=0,b=0,w=(this.maxItemHeight=Math.max(So("MeasureText",i.textStyle,this.chart.themeStyle.legendLabelFont).height,i.shapeHeight),!1),C=0;C<this.legendCollections.length;C++)n=this.legendCollections[C],vfe.test(n.text)&&(n.text=uve(n.text,vfe)),yfe.test(n.text)&&(n.text=uve(n.text,yfe)),c={fill:n.fill,text:n.text,shape:n.shape,markerShape:n.markerShape,name:Hme,cancel:!1},this.chart.trigger(Hme,c),n.text=c.text,n.render=!c.cancel,n.shape=c.shape,n.fill=c.fill,n.markerShape=c.markerShape,n.textSize=So(n.text,i.textStyle,this.chart.themeStyle.legendLabelFont),n.render&&(w=!0,f+=c=u+g+n.textSize.width+(this.isVertical||0===C?o:this.itemPadding),i.enablePages||this.isVertical||(b=this.isTitle&&"Top"!==r?this.legendTitleSize.width+this.fivePixel:0,b+=h),t.width<o+f+b||this.isVertical)&&(m=Math.max(m,f+o+b-(this.isVertical?0:c)),0===v&&c!==f&&(v=1),f=this.isVertical?0:c,y=++v*(this.maxItemHeight+(this.isVertical?this.itemPadding:o))+o+p+d);y=Math.max(y,this.maxItemHeight+o+o+p),this.isPaging=t.height<y,!this.isPaging||i.enablePages||this.isVertical||(y=this.maxItemHeight+o+o+("Top"===r?p:0)),this.totalPages=v,this.isPaging||this.isVertical||(f+=this.isTitle&&"Top"!==r?this.fivePixel+this.legendTitleSize.width+this.fivePixel:0),w?this.setBounds(Math.max(f+o,m),y,i,t):this.setBounds(0,0,i,t)},DTe.prototype.getRenderPoint=function(e,t,i,n,o,r,s){var a=n.location.x+i+n.textSize.width,l=this.legend.padding,o=(a+(e.textSize.width+i-this.itemPadding)>o.x+o.width+this.legend.shapeWidth/2||this.isVertical?(e.location.x=t.x,e.location.y=r===s?n.location.y:n.location.y+this.maxItemHeight+(this.isVertical?this.itemPadding:l)):(e.location.x=r===s?n.location.x:a,e.location.y=n.location.y),this.legendBounds.width+this.legendBounds.x-(e.location.x+i-this.itemPadding-this.legend.shapeWidth/2));e.text=eve(+o.toFixed(4),e.text,this.legend.textStyle,this.chart.enableRtl,this.chart.themeStyle.legendLabelFont)},DTe.prototype.legendClick=function(e){var t=this.chart,i="Series"===t.legendSettings.mode?e:0,i=t.visibleSeries[i],n=this.legendCollections[e],o={legendText:n.text,legendShape:n.shape,chart:t,series:i,name:Nme,cancel:!1};this.chart.trigger(Nme,o),i.legendShape=o.legendShape,null!==i.fill&&(t.visibleSeries[e].interior=i.fill),t.legendSettings.toggleVisibility&&(t.legendClicked=!0,this.changeSeriesVisiblity(i,i.visible),n.visible=("TrendLine"===i.category?t.series[i.sourceIndex].trendlines[i.index]:i).visible,this.refreshLegendToggle(t))},DTe.prototype.refreshLegendToggle=function(e){var t=e.stockLegendModule.legendBounds;e.stockLegendModule.renderLegend(e,e.legendSettings,t)},DTe.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}))},DTe.prototype.SecondaryAxis=function(e){return-1<this.chart.axes.indexOf(e)},DTe.prototype.click=function(e){var t=this;if(this.chart.legendSettings.visible){for(var i=this.chart.mouseY,n=this.chart.mouseX,o=[this.legendID+"_text_",this.legendID+"_shape_marker_",this.legendID+"_shape_"],r=e.target.id,s=0,a=o;s<a.length;s++){var l=a[s];if(-1<r.indexOf(l)){l=parseInt(r.split(l)[1],10),this.legendClick(l);break}}-1<r.indexOf(this.legendID+"_pagedown")?this.changePage(e,!1):-1<r.indexOf(this.legendID+"_pageup")&&this.changePage(e,!0),this.legendRegions.filter(function(e){return o0e(n,i+(t.isPaging?(t.currentPageNumber-1)*t.translatePage(!1,null,1,2):0),e.rect)})}},DTe.prototype.getModuleName=function(){return"StockLegend"},DTe.prototype.destroy=function(){this.removeEventListener()};var ETe,MIe=DTe;function DTe(e){e=ETe.call(this,e)||this;return(e.library=e).addEventListener(),e}MTe=function(e,t){return(MTe=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])}))(e,t)};var MTe,kTe,PTe,BTe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},BTe=(function(e,t){function i(){this.constructor=e}MTe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(FTe,kTe=Ji),(PTe=FTe).prototype.onPropertyChanged=function(e){for(var t=0,i=Object.keys(e);t<i.length;t++)"series"===i[t]&&(this.storeDataSource(),this.chartRender(),this.stockChartDataManagerSuccess(),this.legendClicked=!1)},FTe.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=this.isDateTimeCategory?new Date(this.sortedData[e]):new Date(e),this.periodSelector.datePicker.endDate=this.isDateTimeCategory?new Date(this.sortedData[t]):new Date(t),this.periodSelector.datePicker.dataBind()},FTe.prototype.preRender=function(){this.unWireEvents(),this.initPrivateVariable(),this.allowServerDataBinding=!1,this.isProtectedOnChange=!0,this.setCulture(),this.wireEvents()},FTe.prototype.unWireEvents=function(){var e=F.touchStartEvent,t=F.touchMoveEvent,i=F.touchEndEvent,n=F.isPointer?"pointerleave":"mouseleave";E.remove(this.element,e,this.stockChartOnMouseDown),E.remove(this.element,t,this.stockChartOnMouseMove),E.remove(this.element,i,this.stockChartMouseEnd),E.remove(this.element,"click",this.stockChartOnMouseClick),E.remove(this.element,"contextmenu",this.stockChartRightClick),E.remove(this.element,n,this.stockChartOnMouseLeave),window.removeEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.stockChartResize)},FTe.prototype.wireEvents=function(){var e=F.isPointer?"pointerleave":"mouseleave";E.add(this.element,F.touchStartEvent,this.stockChartOnMouseDown,this),E.add(this.element,F.touchMoveEvent,this.stockChartOnMouseMove,this),E.add(this.element,F.touchEndEvent,this.stockChartMouseEnd,this),E.add(this.element,"click",this.stockChartOnMouseClick,this),E.add(this.element,"contextmenu",this.stockChartRightClick,this),E.add(this.element,e,this.stockChartOnMouseLeave,this),window.addEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.stockChartResize.bind(this)),this.setStyle(this.element)},FTe.prototype.initPrivateVariable=function(){var e;""===this.element.id&&(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,this.margin={right:null===this.margin.right?F.isDevice?5:10:this.margin.right,left:null===this.margin.left?F.isDevice?5:10:this.margin.left,top:null===this.margin.top?F.isDevice?5:10:this.margin.top,bottom:null===this.margin.bottom?F.isDevice?5:10:this.margin.bottom},this.isStockChartRendered=!1},FTe.prototype.setCulture=function(){this.intl=new Ti},FTe.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=!this.legendClicked,this.rangeFound=!1,this.resizeTo=null,this.startValue=null,this.endValue=null},FTe.prototype.render=function(){var e=this,t={name:"load",stockChart:this,theme:this.theme};this.trigger("load",t,function(){e.themeStyle=_ve(e.theme,!1,e),e.storeDataSource(),e.drawSVG(),e.renderTitle(),e.renderLegend(),e.chartModuleInjection(),e.chartRender(),e.dataSource instanceof me&&e.series[0].dataSource instanceof me||(e.stockChartDataManagerSuccess(),e.initialRender=!1),e.renderComplete(),e.allowServerDataBinding=!0,e.isStockChartRendered=!0}),this.isProtectedOnChange=!1},FTe.prototype.stockChartDataManagerSuccess=function(){this.findRange(),this.renderRangeSelector(),this.renderPeriodSelector(),this.trigger("loaded",{stockChart:this})},FTe.prototype.setStyle=function(e){var t=this.zoomSettings,t=t.enableSelectionZooming||t.enablePinchZooming||"None"!==this.selectionMode||this.crosshair.enable;e.style.msTouchAction=t?"none":"element",e.style.touchAction=t?"none":"element",e.style.msUserSelect="none",e.style.msContentZooming="none",e.style.position="relative",e.style.display="block",e.style.webkitUserSelect="none"},FTe.prototype.drawSVG=function(){this.removeSvg(),ave(this),this.renderer=new fo(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,style:"display: block;"}),this.svgObject=this.mainObject,this.element.appendChild(this.mainObject)},FTe.prototype.calculateVisibleSeries=function(){this.visibleSeries=[];for(var e,t=Vve(this.theme),i=t.length,n=this.series.sort(function(e,t){return e.zOrder-t.zOrder}),o=0,r=n.length;o<r;o++)(e=n[o]).category="Series",e.index=o,e.interior=e.fill||t[o%i],this.visibleSeries.push(e),n[o]=e},FTe.prototype.createSecondaryElements=function(){var e=nve(!1,this.element.id+"_Secondary_Element")||this.createElement("div"),t=(e.id=this.element.id+"_Secondary_Element",this.title?(this.titleSize=So(this.title,this.titleStyle,this.themeStyle.chartTitleFont),this.titleSize.height+=15):this.titleSize={height:null,width:null},(this.enablePeriodSelector?this.toolbarHeight:0)+this.titleSize.height);e.style.cssText="position: relative; height:"+t+"px",O0e(!1,this.element,e,!1)},FTe.prototype.requiredModules=function(){var e=[];return this.legendSettings.visible&&e.push({member:"StockLegend",args:[this]}),e},FTe.prototype.findCurrentData=function(e,t){var i=this.enablePeriodSelector||this.enableSelector?void 0:e,n=this.isDateTimeCategory?new Date(this.sortedData[Math.floor(this.startValue)]).getTime():this.startValue,o=this.isDateTimeCategory?new Date(this.sortedData[Math.floor(this.endValue)]).getTime():this.endValue;return i=e&&n&&o?e.filter(function(e){return new Date(Date.parse(e[t])).getTime()>=n&&new Date(Date.parse(e[t])).getTime()<=o}):i},FTe.prototype.renderPeriodSelector=function(){this.enablePeriodSelector&&(this.toolbarSelector.initializePeriodSelector(),this.periodSelector.toolbar.refreshOverflow(),this.enableSelector||this.cartesianChart.cartesianChartRefresh(this))},FTe.prototype.chartRender=function(){this.sortedData=[],this.cartesianChart=new CIe(this),this.cartesianChart.initializeChart()},FTe.prototype.renderRangeSelector=function(){this.enableSelector&&(this.rangeSelector=new AIe(this),this.rangeSelector.initializeRangeNavigator())},FTe.prototype.getModuleName=function(){return"stockChart"},FTe.prototype.getPersistData=function(){return""},FTe.prototype.removeSvg=function(){document.getElementById(this.element.id+"_Secondary_Element")&&ue(document.getElementById(this.element.id+"_Secondary_Element"));if(this.mainObject){for(;0<this.mainObject.childNodes.length;)this.mainObject.removeChild(this.mainObject.firstChild);!this.mainObject.hasChildNodes()&&this.mainObject.parentNode&&(ue(this.mainObject),this.mainObject=null,this.selectorObject=null,this.chartObject=null)}},FTe.prototype.chartModuleInjection=function(){for(var e=0,t=this.getInjectedModules();e<t.length;e++){var i,n=t[e];(-1===(i=n.prototype.getModuleName().toLowerCase()).indexOf("rangetooltip")?twe:bIe).Inject(n),"datetime"!==i&&"areaseries"!==i&&"steplineseries"!==i&&"datetimecategory"!==i||bIe.Inject(n)}},FTe.prototype.findRange=function(){var n=this;this.seriesXMin=1/0,this.seriesXMax=-1/0;for(var e=0,t=this.chart.series;e<t.length;e++){var i=t[e];i.visible&&(this.seriesXMin=Math.min(this.seriesXMin,i.xMin),this.seriesXMax=Math.max(this.seriesXMax,i.xMax))}this.endValue=this.currentEnd=this.seriesXMax,this.enablePeriodSelector?(this.toolbarSelector=new IIe(this),this.periodSelector=new mIe(this),this.tempPeriods=this.periods.length?this.periods:this.toolbarSelector.calculateAutoPeriods(),this.tempPeriods.map(function(e){if(e.selected&&"ytd"===e.text.toLowerCase())if(n.isDateTimeCategory){for(var t=new Date(n.sortedData[n.currentEnd]).getFullYear(),i=n.currentEnd-1;0<=i;i--)if(new Date(n.sortedData[i]).getFullYear()!==t){n.startValue=i+1;break}n.startValue=-1===i?0:n.startValue}else n.startValue=new Date(new Date(n.currentEnd).getFullYear().toString()).getTime();else e.selected&&"all"===e.text.toLowerCase()?n.startValue=n.seriesXMin:e.selected&&(n.startValue=n.periodSelector.changedRange(e.intervalType,n.endValue,e.interval).getTime(),n.startValue=n.isDateTimeCategory?n.periodSelector.findStartValue(n.startValue,n.endValue):n.startValue)})):this.startValue=this.seriesXMin,this.rangeFound=!0},FTe.prototype.stockChartResize=function(){var e=this;return document.getElementById(this.element.id)&&(this.animateSeries=!1,this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=+setTimeout(function(){e.cartesianChart&&(ave(e),e.renderBorder(),e.calculateLegendBounds(),e.renderTitle(),e.renderLegend(),e.cartesianChart.cartesianChartRefresh(e),e.mainObject.setAttribute("width",(e.availableSize.width+(!e.stockLegendModule||"Right"!==e.legendSettings.position&&"Left"!==e.legendSettings.position?0:e.stockLegendModule.legendBounds.width)).toString()),e.enablePeriodSelector)&&e.renderPeriodSelector()},500)),!1},FTe.prototype.stockChartOnMouseDown=function(e){var t,i,n,o=this.chart.element.getBoundingClientRect(),r=e.target;return this.trigger("stockChartMouseDown",{target:r.id,x:this.mouseX,y:this.mouseY}),"touchstart"===e.type?(this.isTouch=!0,t=e.changedTouches[0].clientX,n=e.target,i=e.changedTouches[0].clientY):(this.isTouch="touch"===e.pointerType,t=e.clientX,i=e.clientY,n=e.target),-1<n.id.indexOf(this.element.id+"_stockChart_chart")&&(r=ie(this.element.id+"_stockChart_chart").getBoundingClientRect(),this.mouseDownY=this.previousMouseMoveY=i-o.top-Math.max(r.top-o.top,0),this.mouseDownX=this.previousMouseMoveX=t-o.left-Math.max(r.left-o.left,0),this.setMouseXY(t,i),this.referenceXAxis=this.chart.primaryXAxis,ie(this.element.id+"_stockChart_chart").setAttribute("cursor","pointer"),this.isDateTimeCategory?(this.visibleRange.min=this.sortedData.indexOf(parseInt(this.referenceXAxis.labels[this.referenceXAxis.visibleRange.min],10)),this.visibleRange.max=this.sortedData.indexOf(parseInt(this.referenceXAxis.labels[this.referenceXAxis.visibleRange.max],10)),this.visibleRange.delta=this.referenceXAxis.visibleRange.delta,this.visibleRange.interval=this.referenceXAxis.visibleRange.interval):this.visibleRange=this.referenceXAxis.visibleRange,this.mouseDownXPoint=Hxe(this.mouseX-this.referenceXAxis.rect.x,this.referenceXAxis.rect.width,this.visibleRange,this.referenceXAxis.isInversed),this.allowPan=!0,this.notify(F.touchStartEvent,e)),!1},FTe.prototype.stockChartMouseEnd=function(e){var t,i;return"touchend"===e.type?(i=e.changedTouches[0].clientX,t=e.changedTouches[0].clientY,this.isTouch=!0):(t=e.clientY,i=e.clientX,this.isTouch="touch"===e.pointerType||"2"===e.pointerType),ie(this.element.id+"_stockChart_chart").setAttribute("cursor","auto"),this.onPanning=!1,this.setMouseXY(i,t),this.stockChartOnMouseUp(e),!1},FTe.prototype.stockChartOnMouseUp=function(e){var t=e.target;return this.trigger("stockChartMouseUp",{target:t.id,x:this.mouseX,y:this.mouseY}),this.isChartDrag=!1,this.allowPan=!1,this.rangeNavigator&&(this.rangeNavigator.rangeSlider.isDrag=!1),this.isTouch&&(this.threshold=(new Date).getTime()+300),this.notify(F.touchEndEvent,e),this.stockEvent&&this.stockEvent.removeStockEventTooltip(0),!1},FTe.prototype.setMouseXY=function(e,t){var i,n=ie(this.element.id+"_stockChart_chart");this.element&&n&&(i=this.element.getBoundingClientRect(),n=n.getBoundingClientRect(),this.mouseX=e-i.left-Math.max(n.left-i.left,0),this.mouseY=t-i.top-Math.max(n.top-i.top,0))},FTe.prototype.stockChartOnMouseMove=function(e){var t,i;return"touchmove"===(this.mouseMoveEvent=e).type?(this.isTouch=!0,i=e.changedTouches[0].clientY,t=e.changedTouches[0].clientX):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType||this.isTouch,t=e.clientX,i=e.clientY),this.trigger("stockChartMouseMove",{target:e.target.id,x:this.mouseX,y:this.mouseY}),ie(this.element.id+"_stockChart_chart")&&(this.setMouseXY(t,i),this.chartOnMouseMove(e)),!1},FTe.prototype.chartOnMouseMove=function(e){var t;return this.rangeNavigator&&this.rangeNavigator.rangeSlider.isDrag&&(this.rangeNavigator.mouseX=this.mouseX,this.rangeNavigator.rangeSlider.mouseMoveHandler(e)),this.allowPan&&!this.chart.startMove&&this.mouseDownXPoint&&this.mouseX!==this.previousMouseMoveX&&this.zoomSettings.enablePan&&(this.onPanning=!0,this.zoomChange=!1,ie(this.element.id+"_stockChart_chart").setAttribute("cursor","pointer"),this.mouseUpXPoint=Hxe(this.mouseX-this.referenceXAxis.rect.x,this.referenceXAxis.rect.width,this.visibleRange,this.referenceXAxis.isInversed),t=Math.abs(this.mouseUpXPoint-this.mouseDownXPoint),this.mouseDownXPoint<this.mouseUpXPoint?this.seriesXMin<=this.visibleRange.min-t&&(this.startValue=this.visibleRange.min-t,this.endValue=this.visibleRange.max-t,this.enableSelector?this.rangeNavigator.rangeSlider.setSlider(this.visibleRange.min-t,this.visibleRange.max-t,!this.rangeNavigator.enableDeferredUpdate,this.rangeNavigator.rangeTooltipModule&&this.rangeNavigator.tooltip.enable):this.cartesianChart.cartesianChartRefresh(this)):this.seriesXMax>=this.visibleRange.max+t&&(this.startValue=this.visibleRange.min+t,this.endValue=this.visibleRange.max+t,this.enableSelector?this.rangeNavigator.rangeSlider.setSlider(this.visibleRange.min+t,this.visibleRange.max+t,!this.rangeNavigator.enableDeferredUpdate,this.rangeNavigator.rangeTooltipModule&&this.rangeNavigator.tooltip.enable):this.cartesianChart.cartesianChartRefresh(this))),this.notify(F.touchMoveEvent,e),""===e.target.id&&!0==!this.onPanning&&(t=void 0,(this.chart.tooltip.enable||this.crosshair.enable)&&(t=document.getElementById(this.element.id+"_stockChart_chart_tooltip"))&&ue(t),ie(this.element.id+"_StockEvents_Tooltip"))&&this.stockEvent.removeStockEventTooltip(0),-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},FTe.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},FTe.prototype.stockChartRightClick=function(e){return!this.crosshair.enable||2!==e.buttons&&0!==e.which&&"touch"!==e.pointerType||(e.preventDefault(),e.stopPropagation(),!1)},FTe.prototype.stockChartOnMouseLeave=function(e){var t,i;return"touchleave"===e.type?(this.isTouch=!0,t=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(t=e.clientX,i=e.clientY,this.isTouch="touch"===e.pointerType||"2"===e.pointerType),this.setMouseXY(t,i),this.allowPan=!1,this.stockChartOnMouseLeaveEvent(e),!1},FTe.prototype.stockChartOnMouseLeaveEvent=function(e){var t=F.isPointer?"pointerleave":"mouseleave";return this.isChartDrag=!1,this.notify(t,e),this.stockEvent&&this.stockEvent.removeStockEventTooltip(1e3),this.rangeNavigator&&(this.rangeNavigator.rangeSlider.isDrag=!1),this.onPanning&&(this.onPanning=!1,this.chart.mouseLeave(e),ie(this.element.id+"_stockChart_chart").setAttribute("cursor","auto")),!1},FTe.prototype.destroy=function(){this.cartesianChart=null,this.chart=null,this.periodSelector=null,this.rangeNavigator=null,this.rangeSelector=null,this.tempPeriods=[],this.toolbarSelector=null,this.visibleSeries=[],this.yAxisElements=null;var e=document.getElementById(this.element.id+"_stockChart_chartKeyboard_chart_focus"),e=(e&&e.remove(),document.getElementById(this.element.id+"_stock_border"));e&&e.remove(),this.element&&(this.unWireEvents(),kTe.prototype.destroy.call(this),this.removeSvg(),this.svgObject=null)},FTe.prototype.renderBorder=function(){var e;this.border.width&&((e=this.createElement("div")).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,O0e(!(e.style.pointerEvents="none"),ie(this.element.id),e))},FTe.prototype.renderTitle=function(){var e,t;this.title&&(O0e(!1,ie(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),e="Near"===(e=this.titleStyle.textAlignment)?"start":"Far"===e?"end":"middle",t=new Do(0,0,this.availableSize.width,0),t=new ko(this.element.id+"_ChartTitle",dve(t,this.titleStyle),this.titleSize.height-10,e,this.title,"","auto"),sve(this.renderer,t,this.titleStyle,this.titleStyle.color||this.themeStyle.chartTitleFont.color||this.findTitleColor(),ie(this.element.id+"_stockChart_Title"),!1,!1,null,null,null,null,0,null,null,null,this.themeStyle.chartTitleFont),this.availableSize.height-=this.titleSize.height+5)},FTe.prototype.calculateLegendBounds=function(){this.stockLegendModule&&this.legendSettings.visible&&this.stockLegendModule.getLegendOptions(this.visibleSeries);var e=this.titleSize.height,t=this.border.width,i=this.availableSize.width-this.border.width-t,n=.5*this.chartArea.border.width+this.border.width,o=this.availableSize.height-n-this.border.width-(this.enablePeriodSelector?this.toolbarHeight:0)-e;this.initialClipRect=new Do(t,n,i,o),this.tempAvailableSize=new Eo(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)},FTe.prototype.renderLegend=function(){var e;this.stockLegendModule&&this.stockLegendModule.legendCollections.length&&this.legendSettings.visible&&(this.stockLegendModule.calTotalPage=!0,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))},FTe.prototype.findTitleColor=function(){return-1<this.theme.toLocaleLowerCase().indexOf("highcontrast")||-1<this.theme.indexOf("Dark")?"#ffffff":"#424242"},FTe.prototype.calculateStockEvents=function(){this.stockEvents.length&&(this.stockEvent=new CTe(this),O0e(!1,this.chartObject,this.stockEvent.renderStockEvents()))},BTe([e(null)],FTe.prototype,"width",void 0),BTe([e(null)],FTe.prototype,"height",void 0),BTe([e("")],FTe.prototype,"dataSource",void 0),BTe([t({},_Ie)],FTe.prototype,"margin",void 0),BTe([t({color:"#DDDDDD",width:1},FIe)],FTe.prototype,"border",void 0),BTe([e(null)],FTe.prototype,"background",void 0),BTe([e("Material")],FTe.prototype,"theme",void 0),BTe([t({name:"primaryXAxis",valueType:"DateTime"},nTe)],FTe.prototype,"primaryXAxis",void 0),BTe([t({border:{color:null,width:.5},background:"transparent"},OIe)],FTe.prototype,"chartArea",void 0),BTe([t({name:"primaryYAxis",opposedPosition:!0,labelPosition:"Inside",tickPosition:"Inside"},nTe)],FTe.prototype,"primaryYAxis",void 0),BTe([kt([{}],sTe)],FTe.prototype,"rows",void 0),BTe([kt([{opposedPosition:!0}],nTe)],FTe.prototype,"axes",void 0),BTe([kt([],JIe)],FTe.prototype,"series",void 0),BTe([kt([],tIe)],FTe.prototype,"stockEvents",void 0),BTe([e(!1)],FTe.prototype,"isTransposed",void 0),BTe([e("")],FTe.prototype,"title",void 0),BTe([t({size:null,fontWeight:null,color:null,fontStyle:null,fontFamily:null},kIe)],FTe.prototype,"titleStyle",void 0),BTe([kt([],eTe)],FTe.prototype,"indicators",void 0),BTe([t({shared:!0,enableMarker:!1},Rue)],FTe.prototype,"tooltip",void 0),BTe([t({dashArray:"5",lineType:"Vertical"},Xbe)],FTe.prototype,"crosshair",void 0),BTe([t({},ITe)],FTe.prototype,"legendSettings",void 0),BTe([t({enablePan:!0},Zbe)],FTe.prototype,"zoomSettings",void 0),BTe([e(!0)],FTe.prototype,"enablePeriodSelector",void 0),BTe([e(!0)],FTe.prototype,"enableCustomRange",void 0),BTe([e(!1)],FTe.prototype,"isSelect",void 0),BTe([e(!0)],FTe.prototype,"enableSelector",void 0),BTe([kt([],Ame)],FTe.prototype,"periods",void 0),BTe([kt([{}],cTe)],FTe.prototype,"annotations",void 0),BTe([i()],FTe.prototype,"selectorRender",void 0),BTe([i()],FTe.prototype,"stockChartMouseMove",void 0),BTe([i()],FTe.prototype,"stockChartMouseLeave",void 0),BTe([i()],FTe.prototype,"stockChartMouseDown",void 0),BTe([i()],FTe.prototype,"stockChartMouseUp",void 0),BTe([i()],FTe.prototype,"stockChartMouseClick",void 0),BTe([i()],FTe.prototype,"pointClick",void 0),BTe([i()],FTe.prototype,"pointMove",void 0),BTe([i()],FTe.prototype,"onZooming",void 0),BTe([i()],FTe.prototype,"legendRender",void 0),BTe([i()],FTe.prototype,"legendClick",void 0),BTe([e("None")],FTe.prototype,"selectionMode",void 0),BTe([e(!1)],FTe.prototype,"isMultiSelect",void 0),BTe([i()],FTe.prototype,"load",void 0),BTe([i()],FTe.prototype,"loaded",void 0),BTe([i()],FTe.prototype,"rangeChange",void 0),BTe([i()],FTe.prototype,"axisLabelRender",void 0),BTe([i()],FTe.prototype,"beforeExport",void 0),BTe([i()],FTe.prototype,"tooltipRender",void 0),BTe([i()],FTe.prototype,"seriesRender",void 0),BTe([i()],FTe.prototype,"stockEventRender",void 0),BTe([kt([],mTe)],FTe.prototype,"selectedDataIndexes",void 0),BTe([e([])],FTe.prototype,"seriesType",void 0),BTe([e(["EMA","TMA","SMA","Momentum","ATR","Accumulation Distribution","Bollinger Bands","MACD","Stochastic","RSI"])],FTe.prototype,"indicatorType",void 0),BTe([e(["PNG","JPEG","SVG","PDF","XLSX","CSV","Print"])],FTe.prototype,"exportType",void 0),BTe([e([])],FTe.prototype,"trendlineType",void 0),PTe=BTe([Bt],FTe));function FTe(e,t){e=kTe.call(this,e,t)||this;return e.isSingleAxis=!1,e.chartid=57723,e.tempSeriesType=[],e.zoomChange=!1,e.allowPan=!1,e.onPanning=!1,e.trendlinetriggered=!0,e.initialRender=!0,e.rangeFound=!1,e.tempPeriods=[],e.isDateTimeCategory=!1,e.sortedData=[],e.visibleRange={min:0,max:0,delta:0,interval:0},e.isStockChartRendered=!1,PTe.Inject(Fwe,sSe,gSe),e.toolbarHeight=e.enablePeriodSelector?F.isDevice?56:42:0,e}RTe.prototype.renderLeftTooltip=function(e){this.fadeOutTooltip();var t=this.getTooltipContent(e.currentStart),i=this.getContentSize(t),n=this.control.enableRtl?e.rightRect:e.leftRect;i>n.width&&(n=e.midRect),this.leftTooltip=this.renderTooltip(n,this.createElement("_leftTooltip"),e.startX,t)},RTe.prototype.getContentSize=function(e){var t=this.control.tooltip.textStyle,e=this.control.tooltip.template?k0e(Q("div",{id:"measureElement",styles:"position: absolute;"}),0,this.control.tooltip.template,this.control).getBoundingClientRect().width:So(e[0],t,this.control.themeStyle.tooltipLabelFont).width+20;return e},RTe.prototype.renderRightTooltip=function(e){this.fadeOutTooltip();var t=this.getTooltipContent(e.currentEnd),i=this.getContentSize(t),n=this.control.enableRtl?e.leftRect:e.rightRect;i>n.width&&((n=e.midRect).x=this.control.series.length?0:n.x),this.rightTooltip=this.renderTooltip(n,this.createElement("_rightTooltip"),e.endX,t)},RTe.prototype.createElement=function(e){var t;return ie(this.elementId+e)?ie(this.elementId+e):((t=document.createElement("div")).id=this.elementId+e,t.className="ejSVGTooltip",t.style.cssText="pointer-events:none; position:absolute;z-index: 1",this.control.stockChart?(ie((e=this.control.stockChart).element.id+"_Secondary_Element").appendChild(t),t.style.transform="translateY("+(e.availableSize.height-e.toolbarHeight-51+e.toolbarHeight+e.titleSize.height)+"px)"):ie(this.elementId+"_Secondary_Element").appendChild(t),t)},RTe.prototype.renderTooltip=function(e,t,i,n){var o=this.control,r=o.tooltip,s={cancel:!1,name:"tooltipRender",text:n,textStyle:r.textStyle},a=(s.textStyle.fontWeight=r.textStyle.fontWeight||this.control.themeStyle.tooltipLabelFont.fontWeight,this.control.trigger("tooltipRender",s),o.svgObject.getBoundingClientRect().left-o.element.getBoundingClientRect().left);return s.cancel?null:new tr({location:{x:i,y:o.rangeSlider.sliderY},content:s.text,marginX:2,enableShadow:!1,marginY:2,arrowPadding:8,rx:4,ry:4,inverted:0<o.series.length,areaBounds:e,fill:r.fill||this.control.themeStyle.tooltipBackground,theme:this.control.theme,clipBounds:{x:a},border:r.border,opacity:r.opacity||("Material3"===this.control.theme||"Material3Dark"===this.control.theme||-1<this.control.theme.indexOf("Bootstrap5")?1:.75),template:r.template,textStyle:s.textStyle,availableSize:o.availableSize,controlName:"RangeNavigator",data:{start:this.getTooltipContent(this.control.startValue)[0],end:this.getTooltipContent(this.control.endValue)[0],value:n[0]}},t)},RTe.prototype.getTooltipContent=function(e){var t=this.control,i=t.tooltip,n=t.chartSeries.xAxis,i=i.format||n.labelFormat,o=null!==i.match("{value}"),r=n.valueType;return e="DateTimeCategory"===r?parseInt(n.labels[Math.floor(e)],10):e,[-1<r.indexOf("DateTime")?t.intl.getDateFormat({format:i||"MM/dd/yyyy",type:l0e(t.skeletonType),skeleton:("DateTime"===r?t.dateTimeModule:t.dateTimeCategoryModule).getSkeleton(n,null,null)})(new Date(e)):(n.format=t.intl.getNumberFormat({format:o?"":i,useGrouping:t.useGroupingSeparator}),t.doubleModule.formatValue(n,o,i,"Logarithmic"===r?Math.pow(n.logBase,e):e))]},RTe.prototype.fadeOutTooltip=function(){var e=this;"OnDemand"===this.control.tooltip.displayMode&&(H0e(this.toolTipInterval),this.rightTooltip)&&(this.toolTipInterval=+setTimeout(function(){e.leftTooltip.fadeOut(),e.rightTooltip.fadeOut()},1e3))},RTe.prototype.getModuleName=function(){return"RangeTooltip"},RTe.prototype.destroy=function(){};var LTe=RTe;function RTe(e){this.control=e,this.elementId=e.element.id}NTe.prototype.renderMajorTickLines=function(e,t){"Horizontal"===this.bulletChart.orientation?this.renderXMajorTickLines(e,t):this.renderYMajorTickLines(e,t)},NTe.prototype.renderMinorTickLines=function(e,t){"Horizontal"===this.bulletChart.orientation?this.renderXMinorTickLines(e,t):this.renderYMinorTickLines(e,t)},NTe.prototype.renderAxisLabels=function(e,t){"Horizontal"===this.bulletChart.orientation?this.renderXAxisLabels(e,t):this.renderYAxisLabels(e,t)},NTe.prototype.renderXMajorTickLines=function(e,t){for(var i=this.bulletChart,n=i.renderer.createGroup({id:i.svgObject.id+"_majorTickGroup"}),o=i.minimum,r=i.maximum,s=i.interval,a=i.enableRtl,l=i.initialClipRect.y+(i.opposedPosition?0:i.initialClipRect.height),h=l+(i.opposedPosition?"Inside"!==i.tickPosition?-this.majorTickSize:this.majorTickSize:"Inside"!==i.tickPosition?this.majorTickSize:-this.majorTickSize),d=i.majorTickLines,p=d.color||i.themeStyle.majorTickLineColor,c=i.initialClipRect.x+(i.enableRtl?i.initialClipRect.width:0),u=i.initialClipRect.x+d.width/2+(a?i.initialClipRect.width:0),g=o;g<=r;g+=s){(i.enableRtl?g===o:g===r)&&(u-=d.width/2),m=i.enableRtl?g===o:g===r,i.majorTickLines.useRangeColor&&(p=this.bindingRangeStrokes(u-(m?this.bulletChart.majorTickLines.width/2:0),c,this.bulletChart.orientation,i.enableRtl));var m=this.majorTicks(u,u,l,h,p,g),m=i.renderer.drawLine(m);u+=a?-e:e,n.appendChild(m),t.appendChild(n)}},NTe.prototype.renderYMajorTickLines=function(e,t){for(var i=this.bulletChart,n=i.renderer.createGroup({id:i.svgObject.id+"_majorTickGroup"}),o=i.minimum,r=i.maximum,s=i.interval,a=i.enableRtl,l=i.initialClipRect,h=l.x+(i.opposedPosition?l.width:0),d=h-(i.opposedPosition?"Inside"!==i.tickPosition?-this.majorTickSize:this.majorTickSize:"Inside"!==i.tickPosition?this.majorTickSize:-this.majorTickSize),p=i.majorTickLines,c=p.color||i.themeStyle.majorTickLineColor,u=l.y+(i.enableRtl?0:l.height),g=l.y+p.width/2+(a?0:l.height),m=o;m<=r;m+=s){(i.enableRtl?m===r:m===o)&&(g-=p.width/2),f=i.enableRtl?m===o:m===r,i.majorTickLines.useRangeColor&&(c=this.bindingRangeStrokes(g-(f?this.bulletChart.majorTickLines.width/2:0),u,this.bulletChart.orientation,i.enableRtl));var f=this.majorTicks(h,d,g,g,c,m),f=i.renderer.drawLine(f);g+=a?e:-e,n.appendChild(f),t.appendChild(n)}},NTe.prototype.majorTicks=function(e,t,i,n,o,r){return{id:this.bulletChart.svgObject.id+"_MajorTickLine_"+r,x1:e,y1:i,x2:t,y2:n,"stroke-width":this.bulletChart.majorTickLines.width,stroke:(!this.bulletChart.majorTickLines.useRangeColor||!o)&&this.bulletChart.majorTickLines.color||o}},NTe.prototype.bindingRangeStrokes=function(e,t,i,n){return"Vertical"===i&&!n||n&&"Horizontal"===i?this.backwardStrokeBinding(e,t):this.forwardStrokeBinding(e,t)},NTe.prototype.renderXMinorTickLines=function(e,t){for(var i,n=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_minorTickGroup"}),o=this.bulletChart,r=o.maximum,s=o.minimum,a=o.interval,l=o.minorTickLines.height,h=this.bulletChart.minorTicksPerInterval,d=o.initialClipRect.x,p=o.initialClipRect.y+(o.opposedPosition?0:o.initialClipRect.height),c=p+(o.opposedPosition?"Inside"!==o.tickPosition?-l:l:"Inside"!==o.tickPosition?l:-l),u=o.minorTickLines.color||o.themeStyle.minorTickLineColor,g=o.initialClipRect.x+(o.enableRtl?o.initialClipRect.width:0),m=s;m<r;m+=a){for(var f=e/h,y=1;y<=h;y++)i=d+f-f/(h+1),o.minorTickLines.useRangeColor&&(u=this.bindingRangeStrokes(i,g,this.bulletChart.orientation,o.enableRtl)),i=this.minorXTicks(i,i,p,c,u,m.toString()+y.toString()),i=this.bulletChart.renderer.drawLine(i),n.appendChild(i),t.appendChild(n),f=e/h*(y+1);d+=e}},NTe.prototype.renderYMinorTickLines=function(e,t){for(var i,n=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_minorTickGroup"}),o=this.bulletChart,r=o.maximum,s=o.minimum,a=o.interval,l=o.minorTickLines.height,h=this.bulletChart.minorTicksPerInterval,d=o.initialClipRect.y+(o.enableRtl?0:o.initialClipRect.height),p=o.initialClipRect.x+(o.opposedPosition?o.initialClipRect.width:0),c=p-(o.opposedPosition?"Inside"!==o.tickPosition?-l:l:"Inside"!==o.tickPosition?l:-l),u=o.minorTickLines.color||o.themeStyle.minorTickLineColor,g=o.initialClipRect.y+(o.enableRtl?0:o.initialClipRect.height),m=s;m<r;m+=a){for(var f=e/h,y=1;y<=h;y++)i=this.bulletChart.enableRtl?d+f-f/(h+1):d-f+f/(h+1),o.minorTickLines.useRangeColor&&(u=this.bindingRangeStrokes(i,g,this.bulletChart.orientation,o.enableRtl)),i=this.minorXTicks(p,c,i,i,u,m.toString()+y.toString()),i=this.bulletChart.renderer.drawLine(i),n.appendChild(i),t.appendChild(n),f=e/h*(y+1);d-=this.bulletChart.enableRtl?-e:e}},NTe.prototype.minorXTicks=function(e,t,i,n,o,r){return{id:this.bulletChart.svgObject.id+"_MajorTickLine_"+r,x1:e,x2:t,y1:i,y2:n,"stroke-width":this.bulletChart.minorTickLines.width,stroke:(!this.bulletChart.minorTickLines.useRangeColor||!o)&&this.bulletChart.minorTickLines.color||o}},NTe.prototype.forwardStrokeBinding=function(e,t){for(var i=this.bulletChart,n=t,o=0;o<=i.rangeCollection.length-1;o++)if((n+=o?i.rangeCollection[o-1]:0)<=e&&e<n+i.rangeCollection[o])return i.ranges[o].color;return null},NTe.prototype.backwardStrokeBinding=function(e,t){for(var i=this.bulletChart,n=t,o=0;o<=i.rangeCollection.length-1;o++)if(n-=o?i.rangeCollection[o-1]:0,Math.round(e)>=Math.round(n-i.rangeCollection[o])&&e<=n)return i.ranges[o].color;return null},NTe.prototype.renderXAxisLabels=function(e,t){var i=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_axisLabelGroup"}),n=this.bulletChart,o=this.bulletChart.locale,r=n.enableRtl,s=(n.tickPosition===n.labelPosition?n.majorTickLines.height:0)+10,a=n.initialClipRect.y+(n.opposedPosition?"Inside"===n.labelPosition?s:-s:n.initialClipRect.height+("Inside"===n.labelPosition?-s:s)),l=n.initialClipRect.x+(r?n.initialClipRect.width:0),h=n.minimum,d=n.maximum,p=n.interval,c=o&&this.bulletChart.enableGroupSeparator,u=this.getFormat(this.bulletChart),g=n.labelStyle.color||n.themeStyle.axisLabelFont.color,m=null!==u.match("{value}"),f=(this.format=this.bulletChart.intl.getNumberFormat({format:m?"":u,useGrouping:this.bulletChart.enableGroupSeparator}),n.initialClipRect.x+(n.enableRtl?n.initialClipRect.width:0));a+=So(this.formatValue(this,m,u,this.bulletChart.maximum),n.labelStyle,this.bulletChart.themeStyle.axisLabelFont).height/3;for(var y=h;y<=d;y+=p){v=n.enableRtl?y===h:y===d,n.labelStyle.useRangeColor&&(g=this.bindingRangeStrokes(l-(v?this.bulletChart.majorTickLines.width/2:0),f,this.bulletChart.orientation,n.enableRtl));var v=c?y.toLocaleString(o):this.formatValue(this,m,u,y),v=this.labelXOptions(l,a,v,y),v=(this.bulletChart.labelStyle.fontFamily=this.bulletChart.labelStyle.fontFamily||this.bulletChart.themeStyle.axisLabelFont.fontFamily,_o(v,this.bulletChart.labelStyle,g,t,this.bulletChart.themeStyle.axisLabelFont));i.appendChild(v),l+=r?-e:e}t.appendChild(i)},NTe.prototype.labelXOptions=function(e,t,i,n){return{id:this.bulletChart.svgObject.id+"_AxisLabel_"+n,anchor:"middle",text:i,transform:"",x:e,y:t,baseLine:"",labelRotation:0}},NTe.prototype.renderYAxisLabels=function(e,t){var i=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_axisLabelGroup"}),n=this.bulletChart,o=n.locale,r=n.enableRtl,s=(n.tickPosition===n.labelPosition?n.majorTickLines.height:0)+10,a=n.initialClipRect.y+(r?0:n.initialClipRect.height),l=n.initialClipRect.x+(n.opposedPosition?n.initialClipRect.width+("Inside"===n.labelPosition?-(s+10):s):"Inside"===n.labelPosition?s+10:-s),h=n.minimum,d=n.maximum,p=n.interval,c=o&&this.bulletChart.enableGroupSeparator,u=n.labelStyle.color||n.themeStyle.axisLabelFont.color,g=this.getFormat(this.bulletChart),m=null!==g.match("{value}"),f=(this.format=this.bulletChart.intl.getNumberFormat({format:m?"":g,useGrouping:this.bulletChart.enableGroupSeparator}),n.initialClipRect.y+(n.enableRtl?0:n.initialClipRect.height)),y=So(this.formatValue(this,m,g,this.bulletChart.maximum),n.labelStyle,this.bulletChart.themeStyle.axisLabelFont).width/2,v=So(this.formatValue(this,m,g,this.bulletChart.maximum),n.labelStyle,this.bulletChart.themeStyle.axisLabelFont).height/3;a+=v;for(var b=h;b<=d;b+=p){w=n.enableRtl?b===d:b===h,n.labelStyle.useRangeColor&&(u=this.bindingRangeStrokes(a-v-(w?this.bulletChart.majorTickLines.width/2:0),f,this.bulletChart.orientation,n.enableRtl));var w=c?b.toLocaleString(o):this.formatValue(this,m,g,b),w=this.labelXOptions(l-(this.bulletChart.opposedPosition?-y:y),a,w,b),w=(this.bulletChart.labelStyle.fontFamily=this.bulletChart.labelStyle.fontFamily||this.bulletChart.themeStyle.axisLabelFont.fontFamily,_o(w,this.bulletChart.labelStyle,u,t,n.themeStyle.axisLabelFont));i.appendChild(w),a+=r?e:-e}t.appendChild(i)},NTe.prototype.getFormat=function(e){return e.labelFormat||""},NTe.prototype.formatValue=function(e,t,i,n){return t?i.replace("{value}",e.format(n)):e.format(n)};var OTe=NTe;function NTe(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}_Te.prototype.drawScaleGroup=function(e){for(var t,i=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_rangeGroup"}),n=this.bulletChart.maximum,o=this.bulletChart.ranges,r=(this.scaleSettingsGroup=e,this.bulletChart),s=r.enableRtl,a=r.initialClipRect,l=a.x+(s&&"Horizontal"===r.orientation?a.width:0),h=a.y+(s||"Vertical"!==r.orientation?0:a.height),d=(r.rangeCollection=[],0),p="Horizontal"===r.orientation?a.width:a.height,c="Horizontal"===r.orientation?a.height:a.width,u=0;u<o.length;u++){t=p*((o[u].end-d)/n),"Horizontal"===r.orientation?l-=s?t:0:h-=s?0:t;var g=new vve(r.svgObject.id+"_range_"+u,o[u].color||this.bulletChart.themeStyle.rangeStrokes[u].color,{width:1},o[u].opacity,new Do(l,h,"Horizontal"===r.orientation?t:c,"Horizontal"===r.orientation?c:t)),g=r.renderer.drawRectangle(g);i.appendChild(g),e.appendChild(i),"Horizontal"===r.orientation?l+=s?0:t:h+=s?t:0,r.rangeCollection.push(t),d=o[u].end}return this.bulletChart.rangeCollection},_Te.prototype.sortRangeCollection=function(e,t){return e-t},_Te.prototype.renderFeatureBar=function(e){0!==e&&this.renderCommonFeatureBar(e,this.isHorizontal)},_Te.prototype.renderCommonFeatureBar=function(e,t){for(var i=this.bulletChart,n=t?i.initialClipRect.y+i.initialClipRect.height:i.initialClipRect.x,o=i.renderer.createGroup({id:i.svgObject.id+"_featureGroup"}),r=(t?i.initialClipRect.height:i.initialClipRect.width)/e,s=0;s<e;s++){var a,l,h,d=(h=i.dataSource[s])[i.categoryField],p=t?n-r*s-(r+i.valueHeight)/2:n+r*s+r/2-i.valueHeight/2,c=this.calculateFeatureMeasureBounds(h[i.valueField],d,t);h&&"Dot"===i.type&&(h=h[i.valueField],c.pointX=t?c.pointX+(0<h&&!i.enableRtl||h<0&&i.enableRtl?c.width:0)-3:c.pointX+(0<h&&i.enableRtl||h<0&&!i.enableRtl?c.width:0)-3,c.width=6),c&&(h=t?this.featureBar(c.pointX,p,c.width,s):this.verticalFeatureBar(p,c.pointX,c.width,s),o.appendChild(h),this.feature=h,this.scaleSettingsGroup.appendChild(o),this.featureBarBounds[s]={x:c.pointX,y:p,width:c.width,height:i.valueHeight},je(d)||(h=So(d,i.categoryLabelStyle,i.themeStyle.axisLabelFont),c=t?h.width:h.height,h=i.initialClipRect,l=a=void 0,l=t?(a=i.enableRtl?h.x+h.width+5+c/2:h.x-5-c/2,this.drawcategory(a,p,d)):(a=i.enableRtl?h.y-5-c/2:h.y+h.height+5+c/2,this.drawcategory(p+i.valueHeight/2,a,d)),i.categoryLabelStyle.fontFamily=i.categoryLabelStyle.fontFamily||i.themeStyle.axisLabelFont.fontFamily,_o(l,i.categoryLabelStyle,i.categoryLabelStyle.color||i.themeStyle.categoryFontColor,this.scaleSettingsGroup))),(i.animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&this.doValueBarAnimation()}},_Te.prototype.featureBar=function(e,t,i,n){e=new vve(this.bulletChart.svgObject.id+"_FeatureMeasure_"+n,this.bulletChart.dataSource[n][this.bulletChart.valueFill]||this.bulletChart.valueFill,this.bulletChart.valueBorder,1,new Do(e,t,i,this.bulletChart.valueHeight),0,0,"",this.bulletChart.valueBorder.dashArray),t=this.bulletChart.renderer.drawRectangle(e);return t.setAttribute("class",this.bulletChart.svgObject.id+"_FeatureMeasure"),t.id=this.bulletChart.svgObject.id+"_FeatureMeasure_"+n,t.setAttribute("role","img"),t.setAttribute("tabindex","0"),t.style.outline="none",t.setAttribute("aria-label",this.bulletChart.title+", value: "+this.bulletChart.dataSource[n].value+", target: "+this.bulletChart.dataSource[n].target),t},_Te.prototype.verticalFeatureBar=function(e,t,i,n){e=new vve(this.bulletChart.svgObject.id+"_FeatureMeasure_"+n,this.bulletChart.dataSource[n][this.bulletChart.valueFill]||this.bulletChart.valueFill,this.bulletChart.valueBorder,1,new Do(e,t,this.bulletChart.valueHeight,i)),t=this.bulletChart.renderer.drawRectangle(e);return t.setAttribute("class",this.bulletChart.svgObject.id+"_FeatureMeasure"),t.id=this.bulletChart.svgObject.id+"_FeatureMeasure_"+n,t.setAttribute("role","img"),t.setAttribute("tabindex","0"),t.style.outline="none",t.setAttribute("aria-label",this.bulletChart.title+", value: "+this.bulletChart.dataSource[n].value+", target: "+this.bulletChart.dataSource[n].target),t},_Te.prototype.drawcategory=function(e,t,i){return{id:"",anchor:"middle",x:e,y:t+(parseInt(this.bulletChart.categoryLabelStyle.size,10)/4+this.bulletChart.valueHeight/2),transform:"",text:i,baseLine:"",labelRotation:0}},_Te.prototype.renderComparativeSymbol=function(e){0!==e&&this.renderCommonComparativeSymbol(e,this.isHorizontal)},_Te.prototype.renderCommonComparativeSymbol=function(e,t){for(var i,n,o,r,s=this.bulletChart,a=s.initialClipRect,l=t?a.width:a.height,h=t?a.y+a.height:a.x,d=s.renderer.createGroup({id:s.svgObject.id+"_comparativeGroup"}),p=s.minimum,c=s.maximum,u=c-p,g=t?a.x-2.5:a.y+a.height,m=[],f=s.targetTypes,y=f.length,v=(t?a.height:a.width)/e,b=0;b<e;b++){for(var w=s.dataSource[b][s.targetField],m=m.concat(w),C=0;C<m.length;C++)r=f[C%y],m[C]>=p&&m[C]<=c&&(i=(o=t?h-v*b-v/2:h+v*b+v/2)-7.5,n=o+7.5,o=l/(u/(u-(c-m[C]))),o=t?g+(s.enableRtl?l-o:o):g-(s.enableRtl?l-o:o),r=this.getTargetElement(r,t,o,i,n,m[C],b),this.comparative.push(r),d.appendChild(r)),this.scaleSettingsGroup.appendChild(d);m=[],(s.animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&this.doTargetBarAnimation(0)}},_Te.prototype.getTargetElement=function(e,t,i,n,o,r,s){var a,l=this.bulletChart,h="Cross"===e?l.targetWidth-1:1,d="Circle"===e?l.targetWidth-1:l.targetWidth,p=t?i+d/2:n+(o-n)/2,c=t?n+(o-n)/2:i,u=l.svgObject.id+"_ComparativeMeasure_"+s,g=l.svgObject.id+"_ComparativeMeasure",m=l.dataSource[s][l.targetColor]||l.targetColor;return(t="Rect"===e?(a=t?this.compareMeasure(i,n,o,s,r):this.compareVMeasure(n,o,i,s),l.renderer.drawLine(a)):"Circle"===e?(a=new Sve(u,m,{width:1,color:m||"black"},1,p,c,d),l.renderer.drawCircle(a)):(a=new No(u,"transparent",h,m,1,"","M "+(p-d)+" "+(c-d)+" L "+(p+d)+" "+(c+d)+" M "+(p-d)+" "+(c+d)+" L "+(p+d)+" "+(c-d)),l.renderer.drawPath(a))).setAttribute("class",g),t},_Te.prototype.compareMeasure=function(e,t,i,n,o){var r=this.bulletChart;return{class:r.svgObject.id+"_ComparativeMeasure",id:r.svgObject.id+"_ComparativeMeasure_"+n,x1:o===r.maximum?e-r.targetWidth/2:o===r.minimum?e+r.targetWidth/2:e,y1:t,x2:o===r.maximum?e-r.targetWidth/2:o===r.minimum?e+r.targetWidth/2:e,y2:i,"stroke-width":r.targetWidth,stroke:r.dataSource[n][r.targetColor]||r.targetColor||"black"}},_Te.prototype.compareVMeasure=function(e,t,i,n){var o=this.bulletChart;return{class:o.svgObject.id+"_ComparativeMeasure",id:o.svgObject.id+"_ComparativeMeasure_"+n,x1:e,y1:i,x2:t,y2:i,"stroke-width":o.targetWidth,stroke:o.dataSource[n][o.targetColor]||o.targetColor||"black"}},_Te.prototype.calculateFeatureMeasureBounds=function(e,t,i){var n=this.bulletChart,o=n.minimum;if(o<=(e=e<o&&o<=0?o:e)){var r=void 0,s=void 0,a=void 0,l=i?n.initialClipRect.x:n.initialClipRect.y,h=i?n.initialClipRect.width:n.initialClipRect.height,d=n.maximum-n.minimum,p=n.maximum-e,c=(n.enableRtl?"backward":"forward")+this.scaleOrientation.toLowerCase(),u=So((t=je(t)?"":t).toString(),n.labelStyle,this.bulletChart.themeStyle.axisLabelFont).width;switch(c){case"forwardhorizontal":case"backwardvertical":r=l+(0<o?0:h/d*Math.abs(o)),a=h/(d/(0<o?d-p:e)),e<0&&(r-=a=Math.abs(a)),a=r+a<l+h?a:l+h-r,s=l-("forwardhorizontal"==c?u/2+5:this.labelOffset);break;default:r=l+(h-h/(d/(d-p))),a=0<o?h/(d/(d-p)):h/(d/e),e<0&&(r-=a=Math.abs(a)),r<l&&(a=r+a-l,r=l),s=l+h+("backwardhorizontal"==c?u/2+5:5)}return{pointX:r,width:a,lastPointX:s}}return null},_Te.prototype.doValueBarAnimation=function(){var t=this.feature;if(!t)return null;var e,i,n,o,r,s=this.bulletChart.animation,a=(this.bulletChart.animateSeries?this.bulletChart.animation:s).duration,l=p0e("Linear"),h=this.bulletChart.dataSource<0,d=t.getBoundingClientRect().height,p=t.getBoundingClientRect().width;"Horizontal"===this.bulletChart.orientation&&t&&(i=parseInt(t.getAttribute("height"),10),e=parseInt(t.getAttribute("x"),10),o=h?i:i+d,n=e),t.style.visibility="hidden",new Vt({}).animate(t,{duration:0===a&&"Enable"===Ut?1e3:a,delay:s.delay,progress:function(e){e.timeStamp>=e.delay&&(t.style.visibility="visible",p=p||1,r=l(e.timeStamp-e.delay,0,p,e.duration),t.setAttribute("transform","translate("+n+" "+o+") scale("+r/p+", 1) translate("+-n+" "+-o+")"))},end:function(){t.setAttribute("transform","translate(0,0)"),t.style.visibility="visible"}})},_Te.prototype.doTargetBarAnimation=function(e){var t,i,n=this.comparative[e];if(!n)return null;"Horizontal"===this.bulletChart.orientation&&n&&(i=parseFloat(n.getAttribute("y1"))+parseFloat(n.getAttribute("y2")),t=parseFloat(n.getAttribute("x1"))),n.style.visibility="hidden",this.animateRect(n,t,i,e+1)},_Te.prototype.animateRect=function(t,i,n,e){var o,r=this,s=p0e("Linear"),a=this.bulletChart.animation,l=this.comparative.length,h=(this.bulletChart.animateSeries?this.bulletChart.animation:a).duration;new Vt({}).animate(t,{duration:0===h&&"Enable"===Ut?1e3:h,delay:a.delay,progress:function(e){e.timeStamp>=e.delay&&(t.style.visibility="visible",o=s(e.timeStamp-e.delay,0,1,e.duration),t.setAttribute("transform","translate("+i+" "+n/2+") scale(1,"+o+") translate("+-i+" "+-n/2+")"))},end:function(){t.setAttribute("transform","translate(0,0)"),e<l&&r.doTargetBarAnimation(e+1)}})};var VTe=_Te;function _Te(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=[]}HTe=function(e,t){return(HTe=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])}))(e,t)};var HTe,zTe,jTe=function(e,t){function i(){this.constructor=e}HTe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},WTe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},QTe=(jTe(UTe,zTe=n),WTe([e(null)],UTe.prototype,"end",void 0),WTe([e(1)],UTe.prototype,"opacity",void 0),WTe([e(null)],UTe.prototype,"color",void 0),WTe([e(null)],UTe.prototype,"index",void 0),WTe([e(null)],UTe.prototype,"name",void 0),WTe([e("Rectangle")],UTe.prototype,"shape",void 0),WTe([e("")],UTe.prototype,"legendImageUrl",void 0),UTe);function UTe(){return null!==zTe&&zTe.apply(this,arguments)||this}jTe(YTe,qTe=n),WTe([e(12)],YTe.prototype,"height",void 0),WTe([e(1)],YTe.prototype,"width",void 0),WTe([e(null)],YTe.prototype,"color",void 0),WTe([e(!1)],YTe.prototype,"useRangeColor",void 0);var qTe,GTe=YTe;function YTe(){return null!==qTe&&qTe.apply(this,arguments)||this}jTe(JTe,XTe=n),WTe([e(8)],JTe.prototype,"height",void 0),WTe([e(1)],JTe.prototype,"width",void 0),WTe([e(null)],JTe.prototype,"color",void 0),WTe([e(!1)],JTe.prototype,"useRangeColor",void 0);var XTe,KTe=JTe;function JTe(){return null!==XTe&&XTe.apply(this,arguments)||this}jTe(eEe,ZTe=n),WTe([e("Normal")],eEe.prototype,"fontStyle",void 0),WTe([e("16px")],eEe.prototype,"size",void 0),WTe([e("")],eEe.prototype,"color",void 0),WTe([e("Normal")],eEe.prototype,"fontWeight",void 0),WTe([e("Segoe UI")],eEe.prototype,"fontFamily",void 0),WTe([e("Center")],eEe.prototype,"textAlignment",void 0),WTe([e("None")],eEe.prototype,"textOverflow",void 0),WTe([e(1)],eEe.prototype,"opacity",void 0),WTe([e(!0)],eEe.prototype,"enableTrim",void 0),WTe([e(null)],eEe.prototype,"maximumTitleWidth",void 0),WTe([e(!1)],eEe.prototype,"useRangeColor",void 0);var ZTe,$Te=eEe;function eEe(){return null!==ZTe&&ZTe.apply(this,arguments)||this}jTe(nEe,tEe=n),WTe([e(!1)],nEe.prototype,"enable",void 0),WTe([e(null)],nEe.prototype,"fill",void 0),WTe([t({fontFamily:null,size:"12px",fontStyle:"Normal",fontWeight:"400",color:null},$Te)],nEe.prototype,"textStyle",void 0),WTe([t({color:null,width:null},Rge)],nEe.prototype,"border",void 0),WTe([e(null)],nEe.prototype,"template",void 0);var tEe,iEe=nEe;function nEe(){return null!==tEe&&tEe.apply(this,arguments)||this}jTe(sEe,oEe=n),WTe([e(!1)],sEe.prototype,"enable",void 0),WTe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},$Te)],sEe.prototype,"labelStyle",void 0);var oEe,rEe=sEe;function sEe(){return null!==oEe&&oEe.apply(this,arguments)||this}jTe(lEe,aEe=n),WTe([e(!1)],lEe.prototype,"visible",void 0),WTe([t({x:0,y:0},yge)],lEe.prototype,"location",void 0),WTe([e(8)],lEe.prototype,"padding",void 0),WTe([e("Center")],lEe.prototype,"alignment",void 0),WTe([e(10)],lEe.prototype,"shapeHeight",void 0),WTe([e(10)],lEe.prototype,"shapeWidth",void 0),WTe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},$Te)],lEe.prototype,"textStyle",void 0),WTe([e("Auto")],lEe.prototype,"position",void 0),WTe([t({left:0,right:0,top:0,bottom:0},zge)],lEe.prototype,"margin",void 0),WTe([t({},Rge)],lEe.prototype,"border",void 0),WTe([e(5)],lEe.prototype,"shapePadding",void 0),WTe([e("transparent")],lEe.prototype,"background",void 0),WTe([e(1)],lEe.prototype,"opacity",void 0),WTe([e(3)],lEe.prototype,"tabIndex",void 0);var aEe,jTe=lEe;function lEe(){return null!==aEe&&aEe.apply(this,arguments)||this}function hEe(e){var t="MaterialDark"===e?"#383838":"FabricDark"===e?"#242424":"#1b1b1b",i={majorTickLineColor:"#424242",minorTickLineColor:"#424242",background:"#FFFFFF",labelFontColor:"rgba(0,0,0,0.54)",categoryFontColor:"#666666",labelFontFamily:"SegoeUI",tooltipFill:"#000816",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",tabColor:"Material"===e?"#ff4081":"Fabric"===e?"#0078D6":"#317AB9",rangeStrokes:[{color:"#959595"},{color:"#BDBDBD"},{color:"#E3E2E2"}],titleFont:{color:"rgba(0, 0, 0, 1)",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"500"},subTitleFont:{color:"rgba(0, 0, 0, 1)",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"rgba(97, 97, 97, 1)",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"rgba(97, 97, 97, 1)",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"rgba(97, 97, 97, 1)",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"rgba(249, 250, 251, 1)",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"}};switch(e){case"Fabric":i={majorTickLineColor:"#424242",minorTickLineColor:"#424242",background:"#FFFFFF",labelFontColor:"#666666",categoryFontColor:"#666666",labelFontFamily:"SegoeUI",tooltipFill:"#FFFFFF",legendLabel:"#353535",tooltipBoldLabel:"#ffffff",featuredMeasureColor:"#181818",comparativeMeasureColor:"#181818",titleFontColor:"#333333",dataLabelFontColor:"#ffffff",titleFontFamily:"SegoeUI",subTitleFontColor:"#666666",subTitleFontFamily:"SegoeUI",firstRangeColor:"#959595",secondRangeColor:"#BDBDBD",thirdRangeColor:"#E3E2E2",tabColor:"#0078D6",rangeStrokes:[{color:"#959595"},{color:"#BDBDBD"},{color:"#E3E2E2"}],titleFont:{color:"#333333",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"500"},subTitleFont:{color:"#333333",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"#666666",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#666666",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#666666",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#333333",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap":i={majorTickLineColor:"#424242",minorTickLineColor:"#424242",background:"#FFFFFF",labelFontColor:"rgba(0,0,0,0.54)",categoryFontColor:"rgba(0,0,0,0.54)",labelFontFamily:"Helvetica",tooltipFill:"#212529",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",tabColor:"#317AB9",rangeStrokes:[{color:"#959595"},{color:"#BDBDBD"},{color:"#E3E2E2"}],titleFont:{color:"#212529",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"500"},subTitleFont:{color:"#212529",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"#666666",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#676767",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#676767",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"HighContrast":i={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",tabColor:"#FFD939",rangeStrokes:[{color:"#757575"},{color:"#BDBDBD"},{color:"#EEEEEE"}],titleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"500"},subTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#000000",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"MaterialDark":case"FabricDark":case"BootstrapDark":i={majorTickLineColor:"#F0F0F0",minorTickLineColor:"#F0F0F0",background:t,labelFontColor:"#FFFFFF",categoryFontColor:"#FFFFFF",labelFontFamily:"Helvetica",tooltipFill:"MaterialDark"===e?"#F4F4F4":"FabricDark"===e?"#A19F9D":"#F0F0F0",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",tabColor:"MaterialDark"===e?"#00B0FF":"FabricDark"===e?"#0074CC":"#0070F0",rangeStrokes:[{color:"#8D8D8D"},{color:"#ADADAD"},{color:"#EEEEEE"}],titleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"FabricDark"===e?"#DADADA":"#FFFFFF",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"500"},subTitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"FabricDark"===e?"#DADADA":"#FFFFFF",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"FabricDark"===e?"#A19F9D":"#676767",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"FabricDark"===e?"#A19F9D":"#676767",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"FabricDark"===e?"#A19F9D":"#676767",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"MaterialDark"===e?"rgba(18, 18, 18, 1)":"FabricDark"===e?"#DADADA":"#1A1A1A",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap4":i={majorTickLineColor:"#424242",minorTickLineColor:"#424242",background:"#FFFFFF",labelFontColor:"#202528",categoryFontColor:"#202528",labelFontFamily:"HelveticaNeue",tooltipFill:"#212529",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",tabColor:"#007BFF",rangeStrokes:[{color:"#959595"},{color:"#BDBDBD"},{color:"#E3E2E2"}],titleFont:{color:"#212529",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"500"},subTitleFont:{color:"#212529",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"#666666",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#495057",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#495057",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Tailwind3":i={majorTickLineColor:"#9CA3AF",minorTickLineColor:"#9CA3AF",background:"transparent",labelFontColor:"#4B5563",categoryFontColor:"#111827",labelFontFamily:"Inter",tooltipFill:"#111827",legendLabel:"#4B5563",tooltipBoldLabel:"#F9FAFB",featuredMeasureColor:"#1F2937",comparativeMeasureColor:"#1F2937",titleFontColor:"#111827",dataLabelFontColor:"#111827",titleFontFamily:"Inter",subTitleFontColor:"#6B7280",subTitleFontFamily:"Inter",firstRangeColor:"#9CA3AF",secondRangeColor:"#D1D5DB",thirdRangeColor:"#E5E7EB",tabColor:"#4F46E5",rangeStrokes:[{color:"#9CA3AF"},{color:"#D1D5DB"},{color:"#E5E7EB"}],titleFont:{color:"#111827",fontFamily:"Inter",size:"16px",fontStyle:"Normal",fontWeight:"600"},subTitleFont:{color:"#6B7280",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"},legendLabelFont:{color:"#4B5563",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"},axisLabelFont:{color:"#4B5563",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#111827",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"}};break;case"Tailwind3Dark":i={majorTickLineColor:"#4B5563",minorTickLineColor:"#4B5563",background:"transparent",labelFontColor:"#D1D5DB",categoryFontColor:"#FFFFFF",labelFontFamily:"Inter",tooltipFill:"#F9FAFB",legendLabel:"#D1D5DB",tooltipBoldLabel:"#1F2937",featuredMeasureColor:"#6B7280",comparativeMeasureColor:"#6B7280",titleFontColor:"#FFFFFF",dataLabelFontColor:"#FFFFFF",titleFontFamily:"Inter",subTitleFontColor:"#9CA3AF",subTitleFontFamily:"Inter",firstRangeColor:"#4B5563",secondRangeColor:"#374151",thirdRangeColor:"#282F3C",tabColor:"#22D3EE",rangeStrokes:[{color:"#4B5563"},{color:"#374151"},{color:"#282F3C"}],titleFont:{color:"#FFFFFF",fontFamily:"Inter",size:"16px",fontStyle:"Normal",fontWeight:"600"},subTitleFont:{color:"#9CA3AF",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"},legendLabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},axisLabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#FFFFFF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#1F2937",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"}};break;case"Tailwind":i={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",tabColor:"#4F46E5",rangeStrokes:[{color:"#9CA3AF"},{color:"#D1D5DB"},{color:"#E5E7EB"}],titleFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"},subTitleFont:{color:"#374151",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#6B7280",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#6B7280",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"TailwindDark":i={majorTickLineColor:"#4B5563",minorTickLineColor:"#4B5563",background:"transparent",labelFontColor:"#9CA3AF",categoryFontColor:"#9CA3AF",labelFontFamily:"Inter",tooltipFill:"#E9ECEF",legendLabel:"#D1D5DB",tooltipBoldLabel:"#1F2937",featuredMeasureColor:"#1F2937",comparativeMeasureColor:"#1F2937",titleFontColor:"#D1D5DB",dataLabelFontColor:"#D1D5DB",titleFontFamily:"Inter",subTitleFontColor:"#D1D5DB",subTitleFontFamily:"Inter",firstRangeColor:"#6B7280",secondRangeColor:"#4B5563",thirdRangeColor:"#374151",tabColor:"#22D3EE",rangeStrokes:[{color:"#6B7280"},{color:"#4B5563"},{color:"#374151"}],titleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"},subTitleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#9CA3AF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#9CA3AF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#1F2937",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap5":i={majorTickLineColor:"#CED4DA",minorTickLineColor:"#CED4DA",background:"transparent",labelFontColor:"#212529",categoryFontColor:"#212529",labelFontFamily:"Segoe UI",tooltipFill:"#000000E5",legendLabel:"#212529",tooltipBoldLabel:"#212529",featuredMeasureColor:"#343A40",comparativeMeasureColor:"#343A40",titleFontColor:"#212529",dataLabelFontColor:"#212529",titleFontFamily:"Segoe UI",subTitleFontColor:"#212529",subTitleFontFamily:"Segoe UI",firstRangeColor:"#CED4DA",secondRangeColor:"#DEE2E6",thirdRangeColor:"#E9ECEF",tabColor:"#0D6EFD",rangeStrokes:[{color:"#CED4DA"},{color:"#DEE2E6"},{color:"#E9ECEF"}],titleFont:{color:"#212529",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},subTitleFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap5Dark":i={majorTickLineColor:"#6C757D",minorTickLineColor:"#6C757D",background:"#212529",labelFontColor:"#DEE2E6",categoryFontColor:"#DEE2E6",labelFontFamily:"Segoe UI",tooltipFill:"#FFFFFFE5",legendLabel:"#DEE2E6",tooltipBoldLabel:"#212529",featuredMeasureColor:"#ADB5BD",comparativeMeasureColor:"#ADB5BD",titleFontColor:"#DEE2E6",dataLabelFontColor:"#DEE2E6",titleFontFamily:"Segoe UI",subTitleFontColor:"#DEE2E6",subTitleFontFamily:"Segoe UI",firstRangeColor:"#6C757D",secondRangeColor:"#495057",thirdRangeColor:"#343A40",tabColor:"#0D6EFD",rangeStrokes:[{color:"#6C757D"},{color:"#495057"},{color:"#343A40"}],titleFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},subTitleFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Fluent":i={majorTickLineColor:"#C8C6C4",minorTickLineColor:"#C8C6C4",background:"rgba(255, 255, 255, 0.0001)",labelFontColor:"#3B3A39",categoryFontColor:"#3B3A39",labelFontFamily:"Segoe UI",tooltipFill:"#FFFFFF",legendLabel:"#3B3A39",tooltipBoldLabel:"#323130",featuredMeasureColor:"#A19F9D",comparativeMeasureColor:"#A19F9D",titleFontColor:"#201F1E",dataLabelFontColor:"#3B3A39",titleFontFamily:"Segoe UI",subTitleFontColor:"#201F1E",subTitleFontFamily:"Segoe UI",firstRangeColor:"#C8C6C4",secondRangeColor:"#D2D0CE",thirdRangeColor:"#EDEBE9",tabColor:"#0078D4",rangeStrokes:[{color:"#C8C6C4"},{color:"#D2D0CE"},{color:"#EDEBE9"}],titleFont:{color:"#201F1E",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"500"},subTitleFont:{color:"#323129",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"#49454E",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#3B3A39",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#3B3A39",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#323130",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"FluentDark":i={majorTickLineColor:"#484644",minorTickLineColor:"#484644",background:"transparent",labelFontColor:"#C8C6C4",categoryFontColor:"#C8C6C4",labelFontFamily:"Segoe UI",tooltipFill:"#323130",legendLabel:"#C8C6C4",tooltipBoldLabel:"#F3F2F1",featuredMeasureColor:"#797775",comparativeMeasureColor:"#797775",titleFontColor:"#F3F2F1",dataLabelFontColor:"#C8C6C4",titleFontFamily:"Segoe UI",subTitleFontColor:"#F3F2F1",subTitleFontFamily:"Segoe UI",firstRangeColor:"#484644",secondRangeColor:"#3B3A39",thirdRangeColor:"#292827",tabColor:"#0078D4",rangeStrokes:[{color:"#484644"},{color:"#3B3A39"},{color:"#292827"}],titleFont:{color:"#C8C6C4",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"500"},subTitleFont:{color:"#F3F2F1",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"#D2D0CE",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#C8C6C4",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#D2D0CE",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F3F2F1",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Fluent2":i={majorTickLineColor:"#C8C6C4",minorTickLineColor:"#C8C6C4",background:"transparent",labelFontColor:"#C8C6C4",categoryFontColor:"#616161",labelFontFamily:"Segoe UI",tooltipFill:"#FFFFFF",legendLabel:"#242424",tooltipBoldLabel:"#242424",featuredMeasureColor:"#A19F9D",comparativeMeasureColor:"#A19F9D",titleFontColor:"#242424",dataLabelFontColor:"#424242",titleFontFamily:"Segoe UI",subTitleFontColor:"#616161",subTitleFontFamily:"Segoe UI",firstRangeColor:"#C8C6C4",secondRangeColor:"#D2D0CE",thirdRangeColor:"#EDEBE9",tabColor:"#0078D4",rangeStrokes:[{color:"#C8C6C4"},{color:"#D2D0CE"},{color:"#EDEBE9"}],titleFont:{color:"#242424",fontFamily:"Segoe UI",size:F.isDevice?"16px":"14px",fontStyle:"Normal",fontWeight:"600"},subTitleFont:{color:"#616161",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#616161",fontFamily:"Segoe UI",size:F.isDevice?"14px":"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"}};break;case"Fluent2Dark":i={majorTickLineColor:"#484644",minorTickLineColor:"#484644",background:"transparent",labelFontColor:"#ADADAD",categoryFontColor:"#ADADAD",labelFontFamily:"Segoe UI",tooltipFill:"#292929",legendLabel:"#FFFFFF",tooltipBoldLabel:"#FFFFFF",featuredMeasureColor:"#8A8886",comparativeMeasureColor:"#8A8886",titleFontColor:"#FFFFFF",dataLabelFontColor:"#FFFFFF",titleFontFamily:"Segoe UI",subTitleFontColor:"#ADADAD",subTitleFontFamily:"Segoe UI",firstRangeColor:"#484644",secondRangeColor:"#3B3A39",thirdRangeColor:"#292827",tabColor:"#0078D4",rangeStrokes:[{color:"#484644"},{color:"#3B3A39"},{color:"#292827"}],titleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:F.isDevice?"16px":"14px",fontStyle:"Normal",fontWeight:"600"},subTitleFont:{color:"#ADADAD",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#ADADAD",fontFamily:"Segoe UI",size:F.isDevice?"14px":"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"}};break;case"Fluent2HighContrast":i={majorTickLineColor:"#484644",minorTickLineColor:"#484644",background:"transparent",labelFontColor:"#FFFFFF",categoryFontColor:"#FFFFFF",labelFontFamily:"Segoe UI",tooltipFill:"#000000",legendLabel:"#FFFFFF",tooltipBoldLabel:"#FFFFFF",featuredMeasureColor:"#8A8886",comparativeMeasureColor:"#8A8886",titleFontColor:"#FFFFFF",dataLabelFontColor:"#FFFFFF",titleFontFamily:"Segoe UI",subTitleFontColor:"#FFFFFF",subTitleFontFamily:"Segoe UI",firstRangeColor:"#484644",secondRangeColor:"#3B3A39",thirdRangeColor:"#292827",tabColor:"#0078D4",rangeStrokes:[{color:"#484644"},{color:"#3B3A39"},{color:"#292827"}],titleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:F.isDevice?"16px":"14px",fontStyle:"Normal",fontWeight:"600"},subTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:F.isDevice?"14px":"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"}};break;case"Material3":i={majorTickLineColor:"#C4C7C5",minorTickLineColor:"#C4C7C5",background:"transparent",labelFontColor:"#1E192B",categoryFontColor:"#1E192B",labelFontFamily:"Roboto",tooltipFill:"#313033",legendLabel:"#49454E",tooltipBoldLabel:"#F4EFF4",featuredMeasureColor:"#79747E",comparativeMeasureColor:"#79747E",titleFontColor:"#1C1B1F",dataLabelFontColor:"#49454E",titleFontFamily:"Roboto",subTitleFontColor:"#1C1B1F",subTitleFontFamily:"Roboto",firstRangeColor:"#a6a6a9",secondRangeColor:"#C4C7C5",thirdRangeColor:"#E7E0EC",tabColor:"#49454E",rangeStrokes:[{color:"#a6a6a9"},{color:"#C4C7C5"},{color:"#E7E0EC"}],titleFont:{color:"#1C1B1F",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"500"},subTitleFont:{color:"#49454E",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"#49454E",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#1E192B",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#49454E",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F4EFF4",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"}};break;case"Material3Dark":i={majorTickLineColor:"#444746",minorTickLineColor:"#444746",background:"transparent",labelFontColor:"#E6E1E5",categoryFontColor:"#E6E1E5",labelFontFamily:"Roboto",tooltipFill:"#E6E1E5",legendLabel:"#CAC4D0",tooltipBoldLabel:"#313033",featuredMeasureColor:"#938F99",comparativeMeasureColor:"#938F99",titleFontColor:"#E6E1E5",dataLabelFontColor:"#CAC4D0",titleFontFamily:"Roboto",subTitleFontColor:"#E6E1E5",subTitleFontFamily:"Roboto",firstRangeColor:"rgba(147,143,153,0.4)",secondRangeColor:"#444746",thirdRangeColor:"#49454F",tabColor:"#CAC4D0",rangeStrokes:[{color:"rgba(147,143,153,0.4)"},{color:"#444746"},{color:"#49454F"}],titleFont:{color:"#E6E1E5",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"500"},subTitleFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},dataLabelFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#313033",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"}}}return i}dEe=function(e,t){return(dEe=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])}))(e,t)};var dEe,pEe,WTe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},WTe=(function(e,t){function i(){this.constructor=e}dEe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(cEe,pEe=Ji),cEe.prototype.preRender=function(){this.allowServerDataBinding=!1,this.unWireEvents(),this.initPrivateValues(),this.setCulture(),this.wireEvents()},cEe.prototype.initPrivateValues=function(){var e;this.delayRedraw=!1,this.scale=new VTe(this),this.bulletAxis=new OTe(this),""===this.element.id&&(e=document.getElementsByClassName("e-BulletChart").length,this.element.id="BulletChart_"+this.bulletid+"_"+e)},cEe.prototype.setCulture=function(){this.intl=new Ti},cEe.prototype.render=function(){var e=this,t={bulletChart:this,theme:this.theme,name:"load"};this.trigger("load",t,function(){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:e}),e.allowServerDataBinding=!0,e.renderComplete()})},cEe.prototype.setTheme=function(){this.themeStyle=hEe(this.theme),null!==this.targetColor&&"#191919"!==this.targetColor&&null!=this.valueFill||!(-1<this.theme.indexOf("Fluent")||-1<this.theme.indexOf("Bootstrap5")||-1<this.theme.indexOf("Tailwind3"))||(this.valueFill=this.valueFill||("FluentDark"===this.theme?"#797775":"Bootstrap5"===this.theme?"#343A40":"Tailwind3"===this.theme?"#1F2937":"Tailwind3Dark"===this.theme?"#6B7280":"#A19F9D"),this.targetColor="#191919"===this.targetColor?"FluentDark"===this.theme?"#797775":"Bootstrap5"===this.theme?"#343A40":"Tailwind3"===this.theme?"#1F2937":"Tailwind3Dark"===this.theme?"#6B7280":"#A19F9D":this.targetColor),null!==this.targetColor&&"#191919"!==this.targetColor&&null!=this.valueFill||!(-1<this.theme.indexOf("Material3")||-1<this.theme.indexOf("Bootstrap5"))||(this.valueFill=this.valueFill||("Material3Dark"===this.theme?"#938F99":"Bootstrap5Dark"===this.theme?"#343A40":"#79747E"),this.targetColor="#191919"===this.targetColor?"Material3Dark"===this.theme?"#938F99":"Bootstrap5Dark"===this.theme?"#343A40":"#79747E":this.targetColor)},cEe.prototype.findRange=function(){if(this.minimum||(this.minimum=0),!this.maximum&&this.ranges.length)for(var e=this.maximum=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(je(this.dataSource))this.maximum=10;else for(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))},cEe.prototype.getActualDesiredIntervalsCount=function(e){var e="Horizontal"===this.orientation?e.width:e.height,t=3*("Horizontal"===this.orientation?.533:1);return Math.max(e*(t/100),1)},cEe.prototype.calculateNumericNiceInterval=function(e){for(var t=this.getActualDesiredIntervalsCount(this.availableSize),i=e/t,n=Math.pow(10,Math.floor(Bye(i,10))),o=0,r=this.intervalDivs;o<r.length;o++){var s=n*r[o];if(t<e/s)break;i=s}return i},cEe.prototype.setSecondaryElementPosition=function(){var e,t,i=ie(this.element.id+"_Secondary_Element");i&&(e=this.element.getBoundingClientRect(),t=ie(this.element.id+"_svg").getBoundingClientRect(),i.style.left=Math.max(t.left-e.left,0)+"px",i.style.top=Math.max(t.top-e.top,0)+"px",i.style.position="relative")},cEe.prototype.createSvg=function(e){this.removeSvg(),e.renderer=new fo(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()},cEe.prototype.renderChartBackground=function(){var e=new vve(this.element.id+"_ChartBorder",this.themeStyle.background,{width:this.border.width||0,color:this.border.color||"transparent"},1,new Do(0,0,this.availableSize.width,this.availableSize.height),0,0,"",this.border.dashArray);this.svgObject.appendChild(this.renderer.drawRectangle(e))},cEe.prototype.renderBulletElements=function(){var e=this.renderer.createGroup({id:this.svgObject.id+"_scaleGroup"});this.renderBulletChartTitle(),this.svgObject.appendChild(e),this.rangeCollection=this.scale.drawScaleGroup(e);var t=("Horizontal"===this.orientation?this.initialClipRect.width:this.initialClipRect.height)/((this.maximum-this.minimum)/this.interval),t=(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,this.element.id);"g"!==this.element.tagName&&((e=nve(this.redraw,t+"_Secondary_Element")||this.createElement("div")).id=t+"_Secondary_Element",O0e(!1,this.element,e,this.redraw)),this.tooltip.enable&&O0e(!1,this.svgObject,this.renderer.createGroup({id:t+"_UserInteraction",style:"pointer-events:none;"}),this.redraw),this.bindData(),this.renderDataLabel(),this.renderBulletLegend(),this.element.appendChild(this.svgObject),this.setSecondaryElementPosition()},cEe.prototype.renderBulletLegend=function(){var e;this.bulletChartLegendModule&&this.bulletChartLegendModule.legendCollections.length&&(this.bulletChartLegendModule.calTotalPage=!0,e=this.bulletChartLegendModule.legendBounds,this.bulletChartLegendModule.renderLegend(this,this.legendSettings,e))},cEe.prototype.bulletResize=function(){var e=this,t=(this.animateSeries=!1,{chart:this,name:lfe,currentSize:new Eo(0,0),previousSize:new Eo(this.availableSize.width,this.availableSize.height)});return this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=+setTimeout(function(){e.isDestroyed?clearTimeout(e.resizeTo):(e.createSvg(e),t.currentSize=e.availableSize,e.trigger(lfe,t),e.calculatePosition(),e.renderBulletElements())},500),!1},cEe.prototype.bindData=function(){null!=this.dataSource&&(this.dataCount=this.dataSource.length,this.drawMeasures(this.dataCount))},cEe.prototype.drawMeasures=function(e){this.scale.renderFeatureBar(e),this.scale.renderComparativeSymbol(e)},cEe.prototype.calculatePosition=function(){var e=this.margin,t=0,i=0,n=new Eo(0,0),o=(this.titleCollections=[],this.subTitleCollections=[],0),r=0,s=5;if(this.title){this.titleCollections=hve(this.title,this.titleStyle,this.titleStyle.maximumTitleWidth,this.enableRtl,this.themeStyle.titleFont);for(var t=So(this.title,this.titleStyle,this.themeStyle.titleFont).height*this.titleCollections.length+5,a=0,l=this.titleCollections;a<l.length;a++)o=(n=So(l[a],this.titleStyle,this.themeStyle.titleFont)).width>o?n.width:o,r=n.height>r?n.height:r;if(s+=r,this.subTitleCollections=hve(this.subtitle,this.subtitleStyle,this.titleStyle.maximumTitleWidth,this.enableRtl),this.subtitle){for(var h=0,d=this.subTitleCollections;h<d.length;h++)o=(n=So(d[h],this.subtitleStyle,this.themeStyle.subTitleFont)).width>o?n.width:o,r=n.height>r?n.height:r;i=So(this.subtitle,this.subtitleStyle,this.themeStyle.subTitleFont).height*this.subTitleCollections.length+5,s+=r}}this.maxTitleSize=new Eo(o,"Vertical"===this.orientation?s:r),this.maxLabelSize=this.getMaxLabelWidth(),this.initialClipRect=this.getBulletBounds("Vertical"===this.orientation?s:o,t,i,e),this.bulletChartRect=new Do(this.initialClipRect.x,this.initialClipRect.y,this.initialClipRect.width,this.initialClipRect.height),this.bulletChartLegendModule&&this.bulletChartLegendModule.calculateLegendBounds(this.initialClipRect,this.availableSize,this.maxLabelSize)},cEe.prototype.getBulletBounds=function(e,t,i,n){var o,r=new Do(0,0,0,0),s=this.enableRtl,a=this.labelPosition===this.tickPosition?5:0,l="Inside"===this.tickPosition?0:this.majorTickLines.height,h="Inside"===this.labelPosition?0:5+("Outside"===this.tickPosition?0:So(this.maximum.toString(),this.labelStyle,this.themeStyle.dataLabelFont).height),d=0,p=0,c=0,u=0,g=0,m=0,f=0,y=0,v=e,e=this.bulletAxis.getFormat(this),b=null!==e.match("{value}"),b=(this.bulletAxis.format=this.intl.getNumberFormat({format:b?"":e,useGrouping:this.enableGroupSeparator}),So(this.bulletAxis.formatValue(this.bulletAxis,b,e,this.maximum),this.labelStyle,this.themeStyle.axisLabelFont).width);switch("Horizontal"===this.orientation?(o=this.maxLabelSize.width,d=this.opposedPosition?l+h+a:0,p=this.opposedPosition?0:l+h+a,f=o&&!s?o:0,f+=v&&"Left"===this.titlePosition?15:0,y=o&&s?o:0,y+=v&&"Right"===this.titlePosition?5:0):(o=this.maxLabelSize.height,u=this.opposedPosition?l+a:0,u+=this.opposedPosition&&"Inside"!==this.labelPosition?b:0,c=this.opposedPosition?0:l+a,c+=this.opposedPosition||"Inside"===this.labelPosition?0:b,g=o&&s?o+5:0,m=o&&!s?o+5:0),this.titlePosition){case"Left":r.x=n.left+v+f+c,r.width=this.availableSize.width-n.right-r.x-y-u<0?0:this.availableSize.width-n.right-r.x-y-u,r.y=n.top+d+g,r.height=this.availableSize.height-r.y-n.bottom-p-m<0?0:this.availableSize.height-r.y-n.bottom-p-m;break;case"Right":r.x=n.left+f+c,r.width=this.availableSize.width-u-n.right-r.x-(v+5)-y<0?0:this.availableSize.width-u-n.right-r.x-(v+5)-y,r.y=n.top+d+g,r.height=this.availableSize.height-r.y-n.bottom-p-m<0?0:this.availableSize.height-r.y-n.bottom-p-m;break;case"Top":r.x=n.left+c+f,r.width=this.availableSize.width-n.right-r.x-y-u<0?0:this.availableSize.width-n.right-r.x-y-u,r.y=n.top+(t+i)+d+g,r.height=this.availableSize.height-r.y-n.bottom-p-m<0?0:this.availableSize.height-r.y-n.bottom-p-m;break;case"Bottom":r.x=n.left+c+f,r.y=n.top+d+g,r.width=this.availableSize.width-n.right-r.x-y-u<0?0:this.availableSize.width-n.right-r.x-y-u,r.height=this.availableSize.height-r.y-m-n.bottom-p-(t+i)<0?0:this.availableSize.height-r.y-m-n.bottom-p-(t+i)}return r},cEe.prototype.getMaxLabelWidth=function(){var e;if((this.maxLabelSize=new Eo(0,0),this.categoryField)&&!je(this.dataSource))for(var t=0,i=Object.keys(this.dataSource).length;t<i;t++)(e=So(this.dataSource[t][this.categoryField]||"",this.categoryLabelStyle,this.themeStyle.axisLabelFont)).width>this.maxLabelSize.width&&(this.maxLabelSize.width=e.width),e.height>this.maxLabelSize.height&&(this.maxLabelSize.height=e.height);return this.maxLabelSize},cEe.prototype.calculateVisibleElements=function(){var e,t=this.ranges;this.visibleRanges=[];for(var i=0,n=t.length;i<n;i++)(e=t[i]).index=i,this.visibleRanges.push(e),t[i]=e},cEe.prototype.renderBulletChartTitle=function(){var e=this.margin,t=0,i=0,n="middle",o="",r=this.titleStyle.textAlignment,s=So(this.title,this.titleStyle,this.themeStyle.titleFont),a=this.subtitle?So(this.subtitle,this.subtitleStyle,this.themeStyle.subTitleFont):new Eo(0,0);if(this.title){if("Horizontal"===this.orientation)switch(this.titlePosition){case"Top":t=this.findHorizontalAlignment(e),n="Far"===r?"end":"Near"===r?"start":"middle",i=e.top+s.height/2+5;break;case"Bottom":t=this.findHorizontalAlignment(e),n="Far"===r?"end":"Near"===r?"start":"middle",i=this.availableSize.height-e.bottom-s.height/3+10-(a.height?a.height+5:0);break;case"Left":n="end",t=e.left+this.maxTitleSize.width,i=this.margin.top+this.availableSize.height/2-s.height/3-(a.height||0);break;case"Right":n="start",t=this.availableSize.width-e.right-this.maxTitleSize.width+5,i=this.margin.top+this.availableSize.height/2-s.height/3-(a.height||0)}else{switch(this.titlePosition){case"Top":t=this.availableSize.width/2+10,i=this.margin.top+s.height/2+5;break;case"Bottom":t=this.availableSize.width/2,i=this.availableSize.height-this.margin.bottom-s.height/3+10-(a.height?a.height+5:0);break;case"Left":i=this.findVerticalAlignment(e),n="Far"===r?"start":"Near"===r?"end":"middle",t=e.left;break;case"Right":t=this.availableSize.width-e.right-s.height/3,n="Far"===r?"start":"Near"===r?"end":"middle",i=this.findVerticalAlignment(e)}o="Left"===this.titlePosition?"rotate(-90,"+t+","+i+")":"Right"===this.titlePosition?"rotate(90,"+t+","+i+")":""}o=new ko(this.element.id+"_BulletChartTitle",t,i,n,this.titleCollections,o,"auto"),o=sve(this.renderer,o,this.titleStyle,this.titleStyle.color||this.themeStyle.titleFont.color,this.svgObject,null,null,null,null,null,null,0,null,null,null,this.themeStyle.titleFont);o&&(o.setAttribute("aria-label",this.title+". Syncfusion interactive chart."),o.setAttribute("tabindex","0"),o.style.outline="none",o.setAttribute("role","img")),this.subtitle&&this.renderBulletChartSubTitle(t,i,n)}},cEe.prototype.renderDataLabel=function(){var e,t=0,i=0,n=this.enableRtl,o=this.dataLabel.labelStyle.textAlignment,r=this.labelFormat||"",s=null!==r.match("{value}");if(this.dataLabel.enable)for(var a=0,l=Object.keys(this.dataSource).length;a<l;a++){var h=this.dataSource[a],d=this.scale.featureBarBounds[a],h=h[this.valueField].toString(),p=(this.format=this.intl.getNumberFormat({format:s?"":r,useGrouping:this.enableGroupSeparator}),So(h=s?r.replace("{value}",this.format(h)):h,this.dataLabel.labelStyle,this.themeStyle.axisLabelFont)),c=p.width,p=p.height,d=("Horizontal"===this.orientation?(e="Rect"===this.type||n?"end":"start",(t=this.findTextAlignment(d,c,o))-c<this.initialClipRect.x&&(e="start"),t>this.initialClipRect.width&&(t-=c),i=d.y+d.height/2):(e="middle",t=d.y+d.height/2,(i=this.findTextAlignment(d,c,o))+p/2>this.initialClipRect.height+this.initialClipRect.y&&(i-=p/3)),new ko(this.element.id+"_DataLabel_"+a,t,i,e,h,"","middle"));sve(this.renderer,d,this.dataLabel.labelStyle,this.dataLabel.labelStyle.color||this.themeStyle.dataLabelFont.color,this.svgObject,null,null,null,null,null,null,0,null,null,null,this.themeStyle.dataLabelFont)}},cEe.prototype.findTextAlignment=function(e,t,i){var n=0;switch(i){case"Center":n=e.x+e.width/2;break;case"Near":n=e.x+("Horizontal"===this.orientation?this.enableRtl?e.width-5:5:this.enableRtl?10:e.width);break;case"Far":n=e.x+("Horizontal"===this.orientation?(this.enableRtl?"Rect"===this.type?t+10:-10:e.width)+("Rect"===this.type?-5:5):(this.enableRtl?e.width+("Rect"===this.type?-10:10):0)+("Rect"===this.type?10:-10))}return n},cEe.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},cEe.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},cEe.prototype.renderBulletChartSubTitle=function(e,t,i){var n=this.margin,o="",r=So(this.subtitle,this.subtitleStyle,this.themeStyle.subTitleFont);if("Horizontal"===this.orientation)switch(this.titlePosition){case"Top":t=t+r.height+2.5;break;case"Bottom":t=this.availableSize.height-n.bottom-r.height/3+5;break;case"Left":case"Right":t=t+r.height+2.5}else{switch(this.titlePosition){case"Top":t=t+r.height+2.5;break;case"Bottom":t=this.availableSize.height-n.bottom-r.height/3+5;break;case"Left":e+=r.height+2.5;break;case"Right":e-=r.height+2.5}o="Left"===this.titlePosition?"rotate(-90,"+e+","+t+")":"Right"===this.titlePosition?"rotate(90,"+e+","+t+")":""}i=new ko(this.element.id+"_BulletChartSubTitle",e,t,i,this.subTitleCollections,o,"auto"),o=sve(this.renderer,i,this.subtitleStyle,this.subtitleStyle.color||this.themeStyle.subTitleFont.color,this.svgObject,null,null,null,null,null,null,0,null,null,null,this.themeStyle.subTitleFont);o&&(o.setAttribute("aria-label",this.subtitle),o.setAttribute("tabindex","0"),o.style.outline="none",o.setAttribute("role","img"))},cEe.prototype.calculateAvailableSize=function(e){var t=this.element.clientWidth||this.element.offsetWidth||200,i="Vertical"===this.orientation?450:"Left"===this.titlePosition||"Right"===this.titlePosition?83:126,i=this.element.clientHeight||i;e.availableSize=new Eo(ive(e.width,t)||t,ive(e.height,i)||i)},cEe.prototype.removeSvg=function(){var e=document.getElementById(this.element.id+"_svg");e&&ue(e)},cEe.prototype.getPersistData=function(){return this.addOnPersist(["loaded"])},cEe.prototype.unWireEvents=function(){var e=F.touchStartEvent,t=F.touchMoveEvent,i=F.isPointer?"pointerleave":"mouseleave";E.remove(this.element,e,this.bulletMouseDown),E.remove(this.element,t,this.bulletMouseMove),E.remove(this.element,i,this.bulletMouseLeave),E.remove(this.element,"click",this.bulletChartOnMouseClick),E.remove(this.element,"keyup",this.chartKeyUp),E.remove(this.element,"keydown",this.chartKeyDown),window.removeEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBound)},cEe.prototype.wireEvents=function(){var e=F.isPointer?"pointerleave":"mouseleave";E.add(this.element,F.touchMoveEvent,this.bulletMouseMove,this),E.add(this.element,e,this.bulletMouseLeave,this),E.add(this.element,F.touchStartEvent,this.bulletMouseDown,this),E.add(this.element,"click",this.bulletChartOnMouseClick,this),E.add(this.element,"keyup",this.chartKeyUp,this),E.add(this.element,"keydown",this.chartKeyDown,this),this.resizeBound=this.bulletResize.bind(this),window.addEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBound),this.setStyle(this.element)},cEe.prototype.chartKeyDown=function(e){"Tab"===e.code&&this.removeNavigationStyle()},cEe.prototype.setStyle=function(e){e.style.position="relative",e.style.display="block"},cEe.prototype.bulletMouseMove=function(e){var t,i=e.clientX,n=e.clientY,i=(this.setPointMouseXY(i,n),e.target.id),n=e.target.className.baseVal;if(n===this.svgObject.id+"_FeatureMeasure"&&this.svgObject.id,!je(this.dataSource))for(var o=0;o<Object.keys(this.dataSource).length;o++)document.getElementById(this.svgObject.id+"_FeatureMeasure_"+o).setAttribute("opacity","1"),document.getElementById(this.svgObject.id+"_ComparativeMeasure_"+o).setAttribute("opacity","1");this.isTouchEvent(e)||(t="tooltipDiv"+this.element.id,(t=document.getElementById(t))&&(this.isReact&&this.clearTemplate(),ue(t)),this.bulletTooltipModule&&(this.bulletTooltipModule._elementTooltip(e,n,i,this.mouseX),this.bulletTooltipModule._displayTooltip(e,n,i,this.mouseX,this.mouseY)))},cEe.prototype.setPointMouseXY=function(e,t){var i=ie(this.svgObject.id).getBoundingClientRect(),n=this.element.getBoundingClientRect();this.mouseX=e-n.left-Math.max(i.left-n.left,0),this.mouseY=t-n.top-Math.max(i.top-n.top,0)},cEe.prototype.bulletMouseLeave=function(e){this.isTouchEvent(e)||(e=document.getElementById(".tooltipDiv"+this.element.id))&&(this.isReact&&this.clearTemplate(),ue(e))},cEe.prototype.isTouchEvent=function(e){return"touch"===e.pointerType||-1<e.type.indexOf("touch")},cEe.prototype.bulletMouseDown=function(e){var t,i=("touchstart"===e.type?(this.isTouch=!0,t=e.changedTouches[0].clientX,e.changedTouches[0]):(this.isTouch="touch"===e.pointerType,t=e.clientX,e)).clientY;this.setPointMouseXY(t,i),this.isTouchEvent(e)&&(this.isReact&&this.clearTemplate(),(t=document.getElementById("tooltipDiv"+this.element.id))&&ue(t),i=e.target.id,t=e.target.className.baseVal,this.bulletTooltipModule)&&(this.bulletTooltipModule._elementTooltip(e,t,i,this.mouseX),this.bulletTooltipModule._displayTooltip(e,t,i,this.mouseX,this.mouseY)),this.removeNavigationStyle()},cEe.prototype.bulletChartOnMouseClick=function(e){var t=e.target;return this.trigger(Cfe,{target:t.id,x:this.mouseX,y:this.mouseY}),this.notify("click",e),this.removeNavigationStyle(),!1},cEe.prototype.print=function(e){new zbe(this).print(e)},cEe.prototype.export=function(e,t,i,n,o,r,s){n=n||[this],new E1e(this).export(e,t,i,n,o,r,s)},cEe.prototype.chartKeyUp=function(e){var t,i=e.target.id,n=e.target,o=ie(this.element.id+"_chart_legend_translate_g");return this.removeNavigationStyle(),"Tab"===e.code&&this.setNavigationStyle(i),o&&((t=(o=o.firstElementChild).getAttribute("class"))&&-1===t.indexOf("e-bullet-chart-focused")?t+=" e-bullet-chart-focused":t=t||"e-bullet-chart-focused",o.setAttribute("class",t)),"Tab"===e.code?(""!==this.previousTargetId&&-1<this.previousTargetId.indexOf("_chart_legend_g_")&&-1===i.indexOf("_chart_legend_g_")&&(o=ie(this.element.id+"_chart_legend_translate_g"),this.setTabIndex(o.children[this.currentLegendIndex],o.firstElementChild)),this.previousTargetId=i):-1<e.code.indexOf("Arrow")&&(e.preventDefault(),-1<i.indexOf("_chart_legend_"))&&((t=n.parentElement.children)[this.currentLegendIndex].removeAttribute("tabindex"),this.currentLegendIndex+="ArrowUp"===e.code||"ArrowRight"===e.code?1:-1,this.currentLegendIndex=this.getActualIndex(this.currentLegendIndex,t.length),o=t[this.currentLegendIndex],this.focusChild(o),this.removeNavigationStyle(),this.setNavigationStyle(o.id),i=o.children[1].id),!1},cEe.prototype.setNavigationStyle=function(e){e=document.getElementById(e);e&&e.style.setProperty("outline","1.5px solid "+this.themeStyle.tabColor)},cEe.prototype.removeNavigationStyle=function(){var e=document.querySelectorAll("[id*="+this.element.id+"], [id*=_ChartBorder], text[id*=_title], text[id*=_BulletChartTitle] ,g[id*=_chart_legend]");e&&e.forEach(function(e){(e instanceof HTMLElement||e instanceof SVGElement)&&e.style.setProperty("outline","none")})},cEe.prototype.setTabIndex=function(e,t){e&&e.removeAttribute("tabindex"),t&&t.setAttribute("tabindex","0")},cEe.prototype.getActualIndex=function(e,t){return t-1<e?0:e<0?t-1:e},cEe.prototype.focusChild=function(e){e.setAttribute("tabindex","0");var t=e.getAttribute("class");return e.setAttribute("tabindex","0"),t=t&&-1===t.indexOf("e-bullet-chart-focused")?"e-bullet-chart-focused "+t:t||"e-bullet-chart-focused",e.setAttribute("class",t),e.focus(),e.id},cEe.prototype.onPropertyChanged=function(e){var t=!1,i=!1;if(this.animateSeries=!1,!this.delayRedraw){for(var n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"height":case"width":this.createSvg(this),i=!0;break;case"subtitle":case"title":i=!0;break;case"tickPosition":case"labelPosition":case"titlePosition":t=!0;break;case"minimum":case"maximum":case"interval":i=!0;break;case"majorTickLines":case"minorTickLines":case"type":case"ranges":case"valueFill":case"targetColor":i=!0;break;case"titleStyle":e.titleStyle?i=!0:t=!0;break;case"subtitleStyle":e.subtitleStyle&&(e.subtitleStyle.size||e.subtitleStyle.textOverflow)?i=!0:t=!0;break;case"border":case"opposedPosition":t=!0;break;case"dataSource":this.bindData(),i=!0;break;case"theme":this.animateSeries=!0;break;case"enableRtl":case"locale":case"currencyCode":pEe.prototype.refresh.call(this)}!i&&t&&(this.removeSvg(),this.renderBulletElements(),this.trigger("loaded",{bulletChart:this})),i&&(this.render(),this.trigger("loaded",{bulletChart:this}),this.redraw=!1)}},cEe.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},cEe.prototype.getModuleName=function(){return"bulletChart"},cEe.prototype.destroy=function(){this.unWireEvents(),pEe.prototype.destroy.call(this),this.removeSvg(),this.svgObject=null,this.element.classList.remove("e-BulletChart"),this.element.innerText="";var e=document.getElementById(this.element.id+"Keyboard_bullet_chart_focus");e&&e.remove(),Pye("chartmeasuretext")},WTe([e(null)],cEe.prototype,"width",void 0),WTe([e(null)],cEe.prototype,"height",void 0),WTe([e(null)],cEe.prototype,"locale",void 0),WTe([t({},GTe)],cEe.prototype,"majorTickLines",void 0),WTe([t({},KTe)],cEe.prototype,"minorTickLines",void 0),WTe([e(null)],cEe.prototype,"minimum",void 0),WTe([e(null)],cEe.prototype,"maximum",void 0),WTe([e(null)],cEe.prototype,"interval",void 0),WTe([e(4)],cEe.prototype,"minorTicksPerInterval",void 0),WTe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},$Te)],cEe.prototype,"labelStyle",void 0),WTe([t({fontFamily:null,size:"12px",fontStyle:"Normal",fontWeight:"400",color:null},$Te)],cEe.prototype,"categoryLabelStyle",void 0),WTe([e("")],cEe.prototype,"labelFormat",void 0),WTe([e("")],cEe.prototype,"title",void 0),WTe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},$Te)],cEe.prototype,"titleStyle",void 0),WTe([e("")],cEe.prototype,"subtitle",void 0),WTe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},$Te)],cEe.prototype,"subtitleStyle",void 0),WTe([e("Horizontal")],cEe.prototype,"orientation",void 0),WTe([t({color:"#DDDDDD",width:0},Rge)],cEe.prototype,"border",void 0),WTe([t({},iEe)],cEe.prototype,"tooltip",void 0),WTe([kt([{end:null,opacity:1,color:""},{end:null,opacity:1,color:""},{end:null,opacity:1,color:""}],QTe)],cEe.prototype,"ranges",void 0),WTe([e("Outside")],cEe.prototype,"labelPosition",void 0),WTe([e("Outside")],cEe.prototype,"tickPosition",void 0),WTe([e("Top")],cEe.prototype,"titlePosition",void 0),WTe([e(!1)],cEe.prototype,"opposedPosition",void 0),WTe([e("Material")],cEe.prototype,"theme",void 0),WTe([t({},Qge)],cEe.prototype,"animation",void 0),WTe([t({},rEe)],cEe.prototype,"dataLabel",void 0),WTe([t({},jTe)],cEe.prototype,"legendSettings",void 0),WTe([e(!1)],cEe.prototype,"enableGroupSeparator",void 0),WTe([t({top:15,bottom:10,left:15,right:15},zge)],cEe.prototype,"margin",void 0),WTe([e(5)],cEe.prototype,"targetWidth",void 0),WTe([e("#191919")],cEe.prototype,"targetColor",void 0),WTe([e(6)],cEe.prototype,"valueHeight",void 0),WTe([e(null)],cEe.prototype,"valueFill",void 0),WTe([t({color:"transparent",width:0},Rge)],cEe.prototype,"valueBorder",void 0),WTe([e(null)],cEe.prototype,"dataSource",void 0),WTe([e(null)],cEe.prototype,"query",void 0),WTe([e(null)],cEe.prototype,"categoryField",void 0),WTe([e("Rect")],cEe.prototype,"type",void 0),WTe([e("")],cEe.prototype,"valueField",void 0),WTe([e("")],cEe.prototype,"targetField",void 0),WTe([e(["Rect","Cross","Circle"])],cEe.prototype,"targetTypes",void 0),WTe([e(0)],cEe.prototype,"tabIndex",void 0),WTe([i()],cEe.prototype,"tooltipRender",void 0),WTe([i()],cEe.prototype,"load",void 0),WTe([i()],cEe.prototype,"loaded",void 0),WTe([i()],cEe.prototype,"bulletChartMouseClick",void 0),WTe([i()],cEe.prototype,"legendRender",void 0),WTe([i()],cEe.prototype,"beforePrint",void 0),WTe([Bt],cEe));function cEe(e,t){e=pEe.call(this,e,t)||this;return e.bulletid=57726,e.animateSeries=!0,e.padding=5,e.leftSize=0,e.rightSize=0,e.topSize=0,e.bottomSize=0,e.maxLabelSize=new Eo(0,0),e.maxTitleSize=new Eo(0,0),e.intervalDivs=[10,5,2,1],e.currentLegendIndex=0,e.previousTargetId="",e}gEe.prototype._elementTooltip=function(e,t,i,n){var o=this.control.createElement("div"),r=(o.id="tooltip",o.className="tooltipDiv",e.target),e=e.clientY,s="",a=this.control.tooltip.textStyle.fontStyle||this.control.themeStyle.tooltipLabelFont.fontStyle,l=this.control.tooltip.fill||this.control.themeStyle.tooltipFill,h=this.control.themeStyle.tooltipLabelFont.color||this.control.themeStyle.tooltipBoldLabel;o.style.cssText="left:"+(n+20)+"px;top:"+e+'px;display: block; position: absolute; "z-index": "13000",cursor: default;font-family: Segoe UI;color:'+h+"; font-size: 13px; background-color:"+l+"; border: 1px solid #707070;font-style:"+a+";",t===this.control.svgObject.id+"_Caption"?s=r.textContent===this.control.title?"":this.control.title:t===this.control.svgObject.id+"_SubTitle"&&(s=r.textContent===this.control.subtitle?"":this.control.subtitle),""!==s&&(o.innerHTML="&nbsp"+s+"&nbsp",document.body.insertAdjacentElement("afterbegin",o))},gEe.prototype._displayTooltip=function(e,t,i,n,o){if("undefined"!==t&&this.control.tooltip.enable&&(t===this.control.svgObject.id+"_FeatureMeasure"||t===this.control.svgObject.id+"_ComparativeMeasure")){for(var r=[],s=void 0,a=this.bulletAxis.getFormat(this.control),l=null!==a.match("{value}"),h=i.substring(i.lastIndexOf("_")+1),d=[],p=(this.bulletAxis.format=this.bulletAxis.bulletChart.intl.getNumberFormat({format:l?"":a,useGrouping:this.bulletAxis.bulletChart.enableGroupSeparator}),this.control.dataSource[h][this.control.valueField]),r=r.concat(this.control.dataSource[h][this.control.targetField]),h=this.control.dataSource[h][this.control.categoryField],c=(p&&p.toString(),r?r.toString():""),p=(h&&h.toString(),this.bulletAxis.formatValue(this.bulletAxis,l,a,+p)),u=0;u<r.length;u++)d=d.concat(this.bulletAxis.formatValue(this.bulletAxis,l,a,+r[u]));var g={value:p,target:d,category:h=this.bulletAxis.formatValue(this.bulletAxis,l,a,+h)},p={value:p,target:c,category:h},c="position: absolute; z-index: 13000; display: block;",m=(0===document.getElementsByClassName("tooltipDiv"+this.control.element.id).length&&((s=this.control.createElement("div")).id="tooltipDiv"+this.control.element.id,s.style.cssText=c,document.getElementById(this.control.element.id+"_Secondary_Element").appendChild(s)),{value:g.value,target:g.target,name:Xme});if(""!==this.control.tooltip.template&&null!=this.control.tooltip.template){this.updateTemplateFn();for(var f=this.control.createElement("div",{id:this.control.element.id+"parent_template"}),y=this.templateFn(p,this.control,"template",f.id+"_blazorTemplate","",null,f);y&&0<y.length;)1===y.length?(f.appendChild(y[0]),y=null):f.appendChild(y[0]);m.template=f.innerHTML,this.control.trigger(Xme,m),f.innerHTML=m.template,s.appendChild(f)}else{for(var v="Value : "+m.value,u=0;u<m.target.length;u++)v+="<br/> Target"+(0===u?"":"_"+u)+" : "+m.target[u];m.text=v,this.control.trigger(Xme,m),s.innerHTML=m.text,s.style.font=this.control.tooltip.textStyle.fontStyle||this.control.themeStyle.tooltipLabelFont.fontStyle,s.style.color=this.control.themeStyle.tooltipLabelFont.color||this.control.themeStyle.tooltipBoldLabel,s.style.fontSize=this.control.themeStyle.titleFont.size}var h=this.control.tooltip.fill||this.control.themeStyle.tooltipFill,g="Fabric"===this.control.theme||"Fluent"===this.control.theme&&!this.control.tooltip.border.width?1:this.control.tooltip.border.width,p="Fabric"===this.control.theme||"Fluent"===this.control.theme&&!this.control.tooltip.border.color?"#D2D0CE":this.control.tooltip.border.color,p=this.control.tooltip.border.dashArray?"dashed "+p+"; border-dasharray: "+this.control.tooltip.border.dashArray+";":"Solid "+p+";",b=(b=n)+ive(s.getAttribute("width"),this.control.containerWidth)<window.innerWidth?b:ive(s.getAttribute("width"),this.control.containerWidth),o=o+ive(s.getAttribute("height"),this.control.containerHeight)<window.innerHeight?o:ive(s.getAttribute("height"),this.control.containerHeight);(b=null==b?n:b)+s.clientWidth>this.control.availableSize.width&&(b-=s.clientWidth+20),(o=null==o?e.clientY:o)+s.clientHeight>this.control.availableSize.height&&(o-=s.clientHeight+20),""!==this.control.tooltip.template&&null!=this.control.tooltip.template?s.style.cssText="position: absolute;left:"+(b+20)+"px;top:"+(o+20)+"px;":(n=this.control.tooltip.textStyle.fontFamily||this.control.themeStyle.tooltipLabelFont.fontFamily,e=c+"left:"+(b+20)+"px;top:"+(o+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:"+h+";color:"+(this.control.tooltip.textStyle.color||this.control.themeStyle.tooltipLabelFont.color)+"; border:"+g+"px "+p+"padding-bottom: 7px;font-style:"+this.control.themeStyle.tooltipLabelFont.fontStyle+"; padding-left: 10px; font-family:"+n+"; font-size:"+this.control.tooltip.textStyle.size+"; padding-right: 10px; padding-top: 7px",s.style.cssText=e,-1<this.control.theme.indexOf("Fluent2")&&(b='<filter id="'+(c=this.control.element.id+"_shadow")+'" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="3"/><feOffset dx="-1" dy="3.6" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="0.2"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>',(o=this.control.renderer.createDefs()).setAttribute("id",this.control.element.id+"SVG_tooltip_definition"),s.appendChild(o),o.innerHTML=b,s.style.filter="url(#"+c+")"),t!==this.control.svgObject.id+"_FeatureMeasure"&&t!==this.control.svgObject.id+"_ComparativeMeasure"||document.getElementById(i).setAttribute("opacity","0.6")),this.control.isReact&&this.control.renderReactTemplates()}},gEe.prototype.updateTemplateFn=function(){if(this.control.tooltip.template)try{"function"!=typeof this.control.tooltip.template&&document.querySelectorAll(this.control.tooltip.template).length?this.templateFn=oo(document.querySelector(this.control.tooltip.template).innerHTML.trim()):this.templateFn=oo(this.control.tooltip.template)}catch(e){this.templateFn=oo(this.control.tooltip.template)}},gEe.prototype.getModuleName=function(){return"BulletTooltip"},gEe.prototype.destroy=function(){};var uEe=gEe;function gEe(e){this.control=e,this.elementId=e.element.id,this.bulletAxis=new OTe(this.control)}mEe=function(e,t){return(mEe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}mEe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(vEe,fEe=Gve),vEe.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on("click",this.click,this),this.chart.on(F.touchEndEvent,this.mouseEnd,this),this.chart.on(F.touchMoveEvent,this.bulletMouseMove,this))},vEe.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off("click",this.click),this.chart.off(F.touchEndEvent,this.mouseEnd),this.chart.off(F.touchMoveEvent,this.bulletMouseMove))},vEe.prototype.bulletMouseMove=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},vEe.prototype.mouseEnd=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},vEe.prototype.getLegendOptions=function(e){this.legendCollections=[];for(var t,i=0,n=(this.isRtlEnable=this.chart.enableRtl,this.chart),o=0,r=e;o<r.length;o++){var s=r[o];null!==s.name&&(t=s.color||n.themeStyle.rangeStrokes[s.index].color,this.legendCollections.push(new Rbe(s.name,t,s.shape,this.chart.legendSettings.visible,null,s.legendImageUrl,null,!1,s.index,null)),i++)}if(null!==n.dataSource&&""!==n.valueField&&(t=-1<n.theme.indexOf("Dark")?"white":n.valueFill||"black",a="Vertical"===n.orientation?"TargetRect":"ActualRect",this.legendCollections.push(new Rbe("Actual",t,a,this.chart.legendSettings.visible,null,"",null,!1,i++,null))),null!==n.dataSource&&""!==n.targetField){t=-1<n.theme.indexOf("Dark")?"white":n.targetColor||"black";for(var a="Vertical"===n.orientation?"ActualRect":"TargetRect",l=0;l<Object.keys(n.dataSource).length;l++)if(je(n.dataSource[l][n.targetField].length)||1===n.dataSource[l][n.targetField].length)for(;0===l;){this.legendCollections.push(new Rbe("Target",t,a,this.chart.legendSettings.visible,null,"",null,!1,i++,null));break}else for(var h=n.targetTypes,d=[],p=h.length;0===l;){for(var c=0;c<p;c++)d[c]=h[c%p],d[c]="Rect"===d[c]?"Vertical"===n.orientation?"ActualRect":"TargetRect":d[c],d[c]="Cross"===d[c]?"Multiply":d[c],this.legendCollections.push(new Rbe("Target_"+c,t,d[c],this.chart.legendSettings.visible,null,"",null,!1,i++,null));break}}},vEe.prototype.getLegendBounds=function(e,t,i){for(var n=0,o=i.padding,r=0,s=(this.isVertical?n=e.width/100*5:r=e.height/100*5,t.height+=r,t.width+=n,0),a=0,l=0,h=0,d=i.shapeWidth,p=i.shapePadding,c=(this.maxItemHeight=Math.max(So("MeasureText",i.textStyle,this.chart.themeStyle.legendLabelFont).height,i.shapeHeight),!1),u=0,g=this.legendCollections;u<g.length;u++){var m=g[u],f={fill:m.fill,text:m.text,shape:m.shape,name:Hme,cancel:!1};this.chart.trigger(Hme,f),m.render=!f.cancel,m.text=f.text,m.fill=f.fill,m.shape=f.shape,m.textSize=So(m.text,i.textStyle,this.chart.themeStyle.legendLabelFont),m.render&&""!==m.text&&(c=!0,a+=f=d+p+m.textSize.width+o,t.width<o+a||this.isVertical)&&(s=Math.max(s,a+o-(this.isVertical?0:f)),0===l&&f!==a&&(l=1),a=this.isVertical?0:f,h=++l*(this.maxItemHeight+o)+o)}h=Math.max(h,this.maxItemHeight+o+o),this.isPaging=t.height<h,this.totalPages=l,c?this.setBounds(Math.max(a+o,s),"Bottom"===this.position||"Top"===this.position?Math.min(h,this.chart.initialClipRect.height-(this.legend.border.width+this.legend.margin.bottom+this.legend.margin.top)):h,i,t):this.setBounds(0,0,i,t)},vEe.prototype.getRenderPoint=function(e,t,i,n,o,r,s){var a=i+(this.legend.maximumLabelWidth||n.textSize.width),a=n.location.x+(this.isRtlEnable?-a:a),l=this.legend.padding,o=(a+(e.textSize.width+i)>o.x+o.width+this.legend.shapeWidth/2||this.isVertical?(e.location.x=t.x,e.location.y=r===s?n.location.y:n.location.y+this.maxItemHeight+l):(e.location.x=r===s?n.location.x:a,e.location.y=n.location.y),this.isRtlEnable?e.location.x-i+this.itemPadding+this.legend.shapeWidth/2-this.legendBounds.x:this.legendBounds.x+this.legendBounds.width-(e.location.x+i-this.itemPadding-this.legend.shapeWidth/2));e.text=eve(+o.toFixed(4),e.text,this.legend.textStyle,this.chart.enableRtl,this.chart.themeStyle.legendLabelFont)},vEe.prototype.click=function(e){var t=e.target.id;-1<t.indexOf(this.legendID+"_pagedown")?this.changePage(e,!1):-1<t.indexOf(this.legendID+"_pageup")&&this.changePage(e,!0)},vEe.prototype.getModuleName=function(){return"BulletChartLegend"},vEe.prototype.destroy=function(){this.removeEventListener()};var mEe,fEe,yEe=vEe;function vEe(e){e=fEe.call(this,e)||this;return(e.library=e).addEventListener(),e}bEe=function(e,t){return(bEe=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])}))(e,t)};var bEe,wEe,CEe=function(e,t){function i(){this.constructor=e}bEe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},SEe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},AEe=(CEe(xEe,wEe=n),SEe([e("Segoe UI")],xEe.prototype,"fontFamily",void 0),SEe([e("Normal")],xEe.prototype,"fontStyle",void 0),SEe([e("Regular")],xEe.prototype,"fontWeight",void 0),SEe([e("")],xEe.prototype,"color",void 0),SEe([e("12px")],xEe.prototype,"size",void 0),SEe([e(1)],xEe.prototype,"opacity",void 0),xEe);function xEe(){return null!==wEe&&wEe.apply(this,arguments)||this}CEe(EEe,IEe=n),SEe([e(F.isDevice?5:10)],EEe.prototype,"top",void 0),SEe([e(F.isDevice?5:10)],EEe.prototype,"bottom",void 0),SEe([e(F.isDevice?5:10)],EEe.prototype,"right",void 0),SEe([e(F.isDevice?5:10)],EEe.prototype,"left",void 0);var IEe,TEe=EEe;function EEe(){return null!==IEe&&IEe.apply(this,arguments)||this}CEe(MEe,DEe=n),SEe([e(0)],MEe.prototype,"width",void 0),SEe([e(1)],MEe.prototype,"opacity",void 0),SEe([e("transparent")],MEe.prototype,"color",void 0);var DEe,SEe=MEe;function MEe(){return null!==DEe&&DEe.apply(this,arguments)||this}function kEe(){}function PEe(){}var BEe,FEe=function(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n},LEe=function(){},REe=(CEe(OEe,BEe=kEe),OEe);function OEe(){return null!==BEe&&BEe.apply(this,arguments)||this}CEe(_Ee,NEe=REe);var NEe,VEe=_Ee;function _Ee(){return null!==NEe&&NEe.apply(this,arguments)||this}var HEe,zEe=function(){},jEe=function(){},WEe=function(){},QEe=function(){},UEe=function(e,t,i,n,o){this.id=e,this.fill=t,this.borderColor=i,this.borderWidth=n,this.opacity=o},qEe=function(){},GEe=function(){this.counterclockwise=0,this.clockwise=1},YEe=function(){},XEe=function(){},KEe=function(e,t){this.width=e,this.height=t},JEe=function(){},CEe=(HEe=function(e,t){return(HEe=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])}))(e,t)},function(e,t){function i(){this.constructor=e}HEe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});function ZEe(e){var t,i,n;e.renderer=new fo(e.element.id),i=(t=e).element.clientWidth,n=t.element.clientHeight,t.availableSize=new KEe(iDe(t.width,i)||i||600,iDe(t.height,n)||n||450),e.svgObject=e.renderer.createSvg({id:e.element.id+"_svg",width:e.availableSize.width,height:e.availableSize.height})}function $Ee(e){return document.getElementById(e)}function eDe(e,t,i,n){var o=t;if(e<dDe(t,i,n).width)for(var r=t.length-1;0<=r;--r)if(dDe(o=t.substring(0,r)+"...",i,n).width<=e||o.length<4)return o=o.length<4?" ":o;return o}function tDe(){for(var e=1;1+.5*e!=1;)e*=.5;return e}function iDe(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}var nDe,oDe=function(e,t,i,n,o,r,s){this.id=e,this.opacity=o,this.fill=t,this.stroke=n,this["stroke-width"]=i,this["stroke-dasharray"]=r,this.d=s},rDe=(CEe(sDe,nDe=oDe),sDe);function sDe(e,t,i,n,o){e=nDe.call(this,e,t,i.width,i.color,n)||this;return e.y=o.y,e.x=o.x,e.height=o.height,e.width=o.width,e}CEe(hDe,aDe=oDe);var aDe,lDe=hDe;function hDe(e,t,i,n,o,r,s,a){e=aDe.call(this,e,t,i.width,i.color,n)||this;return e.cy=r,e.cx=o,e.r=s,e["stroke-dasharray"]=a,e}function dDe(e,t,i){var n=document.getElementById("smithchartmeasuretext");return null===n&&(n=Q("text",{id:"smithchartmeasuretext"}),document.body.appendChild(n)),n.innerText=e,n.style.position="absolute",n.style.visibility="hidden",n.style.left="0",n.style.top="-100",n.style.whiteSpace="nowrap",n.style.fontSize=t.size||i.size,n.style.fontWeight=t.fontWeight||i.fontWeight,n.style.fontStyle=t.fontStyle||i.fontStyle,n.style.fontFamily=t.fontFamily||i.fontFamily,n.style.lineHeight="normal",new KEe(n.clientWidth,n.clientHeight)}var pDe=function(e,t,i,n,o){this.id=e,this.x=t,this.y=i,this.anchor=n,this.text=o};function cDe(e){e=document.getElementById(e);e&&ue(e)}function uDe(e,t,i,n){return-i*Math.cos(e/n*(Math.PI/2))+i+t}function gDe(e,t,i,n){return-t*Math.sin(e/n*(Math.PI/2))+i+t}function mDe(e){var t;switch(e){case"Linear":t=uDe;break;case"Reverse":t=gDe}return t}function fDe(e,t,i,n,o){i={id:e.id,x:e.x,y:e.y,fill:i,"font-size":t.size||o.size,"font-style":t.fontStyle||o.fontStyle,"font-family":t.fontFamily||o.fontFamily,"font-weight":t.fontWeight||o.fontWeight,"text-anchor":e.anchor,opacity:t.opacity},o=e.text,t=new fo("").createText(i,o);return n.appendChild(t),t}yDe=function(e,t){return(yDe=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])}))(e,t)};var yDe,vDe,CEe=function(e,t){function i(){this.constructor=e}yDe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},bDe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},wDe=(CEe(CDe,vDe=n),bDe([e(!0)],CDe.prototype,"visible",void 0),bDe([e("")],CDe.prototype,"text",void 0),bDe([e("")],CDe.prototype,"description",void 0),bDe([e("Center")],CDe.prototype,"textAlignment",void 0),bDe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},AEe)],CDe.prototype,"textStyle",void 0),CDe);function CDe(){return null!==vDe&&vDe.apply(this,arguments)||this}CEe(xDe,SDe=n),bDe([e(0)],xDe.prototype,"x",void 0),bDe([e(0)],xDe.prototype,"y",void 0);var SDe,ADe=xDe;function xDe(){return null!==SDe&&SDe.apply(this,arguments)||this}CEe(EDe,IDe=n),bDe([e(1)],EDe.prototype,"width",void 0),bDe([e(null)],EDe.prototype,"color",void 0);var IDe,TDe=EDe;function EDe(){return null!==IDe&&IDe.apply(this,arguments)||this}CEe(kDe,DDe=n),bDe([e(10)],kDe.prototype,"width",void 0),bDe([e(10)],kDe.prototype,"height",void 0),bDe([t({},TDe)],kDe.prototype,"border",void 0);var DDe,MDe=kDe;function kDe(){return null!==DDe&&DDe.apply(this,arguments)||this}CEe(FDe,PDe=n),bDe([e(1)],FDe.prototype,"width",void 0),bDe([e(null)],FDe.prototype,"color",void 0);var PDe,BDe=FDe;function FDe(){return null!==PDe&&PDe.apply(this,arguments)||this}CEe(RDe,LDe=n),bDe([e(!1)],RDe.prototype,"visible",void 0),bDe([e("bottom")],RDe.prototype,"position",void 0),bDe([e("Center")],RDe.prototype,"alignment",void 0),bDe([e(null)],RDe.prototype,"width",void 0),bDe([e(null)],RDe.prototype,"height",void 0),bDe([e("circle")],RDe.prototype,"shape",void 0),bDe([e(null)],RDe.prototype,"rowCount",void 0),bDe([e(null)],RDe.prototype,"columnCount",void 0),bDe([e(8)],RDe.prototype,"itemPadding",void 0),bDe([e(5)],RDe.prototype,"shapePadding",void 0),bDe([e("")],RDe.prototype,"description",void 0),bDe([e(!0)],RDe.prototype,"toggleVisibility",void 0),bDe([t({},wDe)],RDe.prototype,"title",void 0),bDe([t({},ADe)],RDe.prototype,"location",void 0),bDe([t({},MDe)],RDe.prototype,"itemStyle",void 0),bDe([t({},BDe)],RDe.prototype,"border",void 0),bDe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},AEe)],RDe.prototype,"textStyle",void 0);var LDe,CEe=RDe;function RDe(){return null!==LDe&&LDe.apply(this,arguments)||this}ODe=function(e,t){return(ODe=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])}))(e,t)};var ODe,NDe,bDe=function(e,t){function i(){this.constructor=e}ODe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},VDe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},_De=(bDe(HDe,NDe=n),VDe([e(1)],HDe.prototype,"width",void 0),VDe([e("")],HDe.prototype,"dashArray",void 0),VDe([e(!0)],HDe.prototype,"visible",void 0),VDe([e(null)],HDe.prototype,"color",void 0),VDe([e(1)],HDe.prototype,"opacity",void 0),HDe);function HDe(){return null!==NDe&&NDe.apply(this,arguments)||this}bDe(WDe,zDe=n),VDe([e(1)],WDe.prototype,"width",void 0),VDe([e("")],WDe.prototype,"dashArray",void 0),VDe([e(!1)],WDe.prototype,"visible",void 0),VDe([e(null)],WDe.prototype,"color",void 0),VDe([e(8)],WDe.prototype,"count",void 0);var zDe,jDe=WDe;function WDe(){return null!==zDe&&zDe.apply(this,arguments)||this}bDe(qDe,QDe=n),VDe([e(!0)],qDe.prototype,"visible",void 0),VDe([e(1)],qDe.prototype,"width",void 0),VDe([e(null)],qDe.prototype,"color",void 0),VDe([e("")],qDe.prototype,"dashArray",void 0);var QDe,UDe=qDe;function qDe(){return null!==QDe&&QDe.apply(this,arguments)||this}bDe(YDe,GDe=n),VDe([e(!0)],YDe.prototype,"visible",void 0),VDe([e("Outside")],YDe.prototype,"labelPosition",void 0),VDe([e("Hide")],YDe.prototype,"labelIntersectAction",void 0),VDe([t({},_De)],YDe.prototype,"majorGridLines",void 0),VDe([t({},jDe)],YDe.prototype,"minorGridLines",void 0),VDe([t({},UDe)],YDe.prototype,"axisLine",void 0),VDe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},AEe)],YDe.prototype,"labelStyle",void 0);var GDe,bDe=YDe;function YDe(){return null!==GDe&&GDe.apply(this,arguments)||this}XDe=function(e,t){return(XDe=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])}))(e,t)};var XDe,KDe,VDe=function(e,t){function i(){this.constructor=e}XDe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},JDe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},ZDe=(VDe($De,KDe=n),JDe([e(!0)],$De.prototype,"visible",void 0),JDe([e("")],$De.prototype,"text",void 0),JDe([e("")],$De.prototype,"description",void 0),JDe([e("Far")],$De.prototype,"textAlignment",void 0),JDe([e(!0)],$De.prototype,"enableTrim",void 0),JDe([e(null)],$De.prototype,"maximumWidth",void 0),JDe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},AEe)],$De.prototype,"textStyle",void 0),$De);function $De(){return null!==KDe&&KDe.apply(this,arguments)||this}VDe(tMe,eMe=n),JDe([e(!0)],tMe.prototype,"visible",void 0),JDe([e("")],tMe.prototype,"text",void 0),JDe([e("")],tMe.prototype,"description",void 0),JDe([e("Center")],tMe.prototype,"textAlignment",void 0),JDe([e(!0)],tMe.prototype,"enableTrim",void 0),JDe([e(null)],tMe.prototype,"maximumWidth",void 0),JDe([t({},ZDe)],tMe.prototype,"subtitle",void 0),JDe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},AEe)],tMe.prototype,"font",void 0),JDe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},AEe)],tMe.prototype,"textStyle",void 0);var eMe,VDe=tMe;function tMe(){return null!==eMe&&eMe.apply(this,arguments)||this}iMe=function(e,t){return(iMe=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])}))(e,t)};var iMe,nMe,JDe=function(e,t){function i(){this.constructor=e}iMe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},oMe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},rMe=(JDe(sMe,nMe=n),oMe([e(1)],sMe.prototype,"width",void 0),oMe([e(null)],sMe.prototype,"color",void 0),sMe);function sMe(){return null!==nMe&&nMe.apply(this,arguments)||this}JDe(hMe,aMe=n),oMe([e(!1)],hMe.prototype,"visible",void 0),oMe([e(null)],hMe.prototype,"fill",void 0),oMe([e(.75)],hMe.prototype,"opacity",void 0),oMe([e("")],hMe.prototype,"template",void 0),oMe([t({},rMe)],hMe.prototype,"border",void 0);var aMe,lMe=hMe;function hMe(){return null!==aMe&&aMe.apply(this,arguments)||this}JDe(cMe,dMe=n),oMe([e(3)],cMe.prototype,"width",void 0),oMe([e("white")],cMe.prototype,"color",void 0);var dMe,pMe=cMe;function cMe(){return null!==dMe&&dMe.apply(this,arguments)||this}JDe(mMe,uMe=n),oMe([e(.1)],mMe.prototype,"width",void 0),oMe([e("white")],mMe.prototype,"color",void 0);var uMe,gMe=mMe;function mMe(){return null!==uMe&&uMe.apply(this,arguments)||this}JDe(vMe,fMe=n),oMe([e(1)],vMe.prototype,"width",void 0),oMe([e(null)],vMe.prototype,"color",void 0);var fMe,yMe=vMe;function vMe(){return null!==fMe&&fMe.apply(this,arguments)||this}JDe(CMe,bMe=n),oMe([e(!1)],CMe.prototype,"visible",void 0),oMe([e("")],CMe.prototype,"template",void 0),oMe([e(null)],CMe.prototype,"fill",void 0),oMe([e(1)],CMe.prototype,"opacity",void 0),oMe([t({},gMe)],CMe.prototype,"border",void 0),oMe([t({},yMe)],CMe.prototype,"connectorLine",void 0),oMe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},AEe)],CMe.prototype,"textStyle",void 0);var bMe,wMe=CMe;function CMe(){return null!==bMe&&bMe.apply(this,arguments)||this}JDe(xMe,SMe=n),oMe([e(!1)],xMe.prototype,"visible",void 0),oMe([e("circle")],xMe.prototype,"shape",void 0),oMe([e(6)],xMe.prototype,"width",void 0),oMe([e(6)],xMe.prototype,"height",void 0),oMe([e("")],xMe.prototype,"imageUrl",void 0),oMe([e("")],xMe.prototype,"fill",void 0),oMe([e(1)],xMe.prototype,"opacity",void 0),oMe([t({},pMe)],xMe.prototype,"border",void 0),oMe([t({},wMe)],xMe.prototype,"dataLabel",void 0);var SMe,AMe=xMe;function xMe(){return null!==SMe&&SMe.apply(this,arguments)||this}JDe(TMe,IMe=n),oMe([e("visible")],TMe.prototype,"visibility",void 0),oMe([e([])],TMe.prototype,"points",void 0),oMe([e("")],TMe.prototype,"resistance",void 0),oMe([e("")],TMe.prototype,"reactance",void 0),oMe([e("")],TMe.prototype,"tooltipMappingName",void 0),oMe([e(null)],TMe.prototype,"dataSource",void 0),oMe([e("")],TMe.prototype,"name",void 0),oMe([e(null)],TMe.prototype,"fill",void 0),oMe([e(!1)],TMe.prototype,"enableAnimation",void 0),oMe([e("2000ms")],TMe.prototype,"animationDuration",void 0),oMe([e(!1)],TMe.prototype,"enableSmartLabels",void 0),oMe([e(1)],TMe.prototype,"width",void 0),oMe([e(1)],TMe.prototype,"opacity",void 0),oMe([t({},AMe)],TMe.prototype,"marker",void 0),oMe([t({},lMe)],TMe.prototype,"tooltip",void 0);var IMe,JDe=TMe;function TMe(){return null!==IMe&&IMe.apply(this,arguments)||this}DMe.prototype.calculateAreaBounds=function(e,t,i){var n=e.margin,o=e.border,i=this.getLegendSpace(e,i),r=i.leftLegendWidth+n.left+o.width,s=i.rightLegendWidth+n.left+n.right+2*o.width,s=e.availableSize.width-(r+s);return{x:r,y:n.top+2*e.elementSpacing+i.modelTitleHeight+i.modelsubTitleHeight+i.topLegendHeight+o.width,width:s,height:e.availableSize.height-(i.modelTitleHeight+2*e.elementSpacing+i.modelsubTitleHeight+n.top+i.topLegendHeight+i.bottomLegendHeight)}},DMe.prototype.getLegendSpace=function(e,t){var i=e.title,n=e.legendSettings,o=n.position.toLowerCase(),r=e.font,s=n.border.width,a=0,l=0,h=0,d=0;return n.visible&&(s=t.width+5+e.elementSpacing+2*s,a="left"===o?s:0,l="right"===o?s:0,s=n.title.visible?dDe(n.title.text,r,e.themeStyle.legendLabelFont).height:0,h="top"===o?e.elementSpacing+t.height+s:0,d="bottom"===o?e.elementSpacing+t.height+s:0),n=dDe(i.subtitle.text,r,e.themeStyle.legendLabelFont).height,""!==i.text&&i.visible,{leftLegendWidth:a,rightLegendWidth:l,topLegendHeight:h,bottomLegendHeight:d,modelTitleHeight:0,modelsubTitleHeight:""!==i.subtitle.text&&i.subtitle.visible?n:0}};var EMe=DMe;function DMe(){}var MMe="animationComplete",kMe="legendRender",PMe="titleRender",BMe="subtitleRender",FMe="textRender",LMe="seriesRender",RMe="axisLabelRender",OMe=(NMe.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)},NMe.prototype.updateHAxis=function(e){var t=e.horizontalAxis.majorGridLines,i=e.horizontalAxis.minorGridLines,n=e.horizontalAxis.axisLine;t.visible&&this.updateHMajorGridLines(e),i.visible&&this.updateHMinorGridLines(e),n.visible&&this.updateHAxisLine(e)},NMe.prototype.updateRAxis=function(e){var t=e.radialAxis.majorGridLines,i=e.radialAxis.minorGridLines,n=e.radialAxis.axisLine;t.visible&&this.updateRMajorGridLines(e),i.visible&&this.updateRMinorGridLines(e),n.visible&&this.updateRAxisLine(e)},NMe.prototype.measureHorizontalAxis=function(e){var t=e.horizontalAxis.minorGridLines;this.measureHMajorGridLines(e),t.visible&&this.measureHMinorGridLines(e)},NMe.prototype.measureRadialAxis=function(e){var t=e.radialAxis.minorGridLines;this.measureRMajorGridLines(e),t.visible&&this.measureRMinorGridLines(e)},NMe.prototype.calculateChartArea=function(e,t){e.availableSize.width,e.availableSize.height;var i=t.width,n=t.height,o=Math.min(i,n),i=Math.min(i,n),r=t.x+(t.width/2-o/2),t=t.y+(0<(n-i)/2?(n-i)/2:0);e.chartArea={x:r,y:t,width:o,height:i}},NMe.prototype.calculateCircleMargin=function(e,t){var i=e.chartArea.width,n=e.radius,o=this.maximumLabelLength(e),o="Outside"===e.radialAxis.labelPosition?o+10:10,i=(0<i-2*o?i-2*o:0)/2,n=1<n?1:n<.1?.1:n;this.areaRadius=i*n,this.circleLeftX=e.chartArea.x+o+i*(1-n),this.circleTopY=e.chartArea.y+o+i*(1-n),this.circleCenterX=this.circleLeftX+this.areaRadius,this.circleCenterY=t.y+t.height/2},NMe.prototype.maximumLabelLength=function(e){for(var t,i=0,n=e.horizontalAxis.labelStyle,o=0;o<this.radialLabels.length;o++)i<(t=dDe(this.radialLabels[o].toString(),n,e.themeStyle.axisLabelFont)).width&&(i=t.width);return i},NMe.prototype.calculateAxisLabels=function(){for(var e=0,t=0,i=[],n=2*this.areaRadius,o=0;o<2;o+=.1){var r=!1,s=!1,a=n*(1/((o=Math.round(10*o)/10)+1))/2*2;0===e||1===o?(e=a,i[t]=o,t++):(o<1&&(r=this.isOverlap(1,n,a,30)),1<o&&(s=this.isOverlap(2,n,a,30)),r||s||30<=e-a&&(i[t]=o,t++,e=a))}for(var l=[2,3,4,5,10,20,50],h=0;h<l.length;h++)i[t]=l[h],t++;return i},NMe.prototype.isOverlap=function(e,t,i,n){return i-t*(1/(e+1))/2*2<n},NMe.prototype.calculateXAxisRange=function(e){for(var t,i,n=2*this.areaRadius,o=this.calculateAxisLabels(),r=this.circleCenterY,s=this.circleLeftX,a=this.circleLeftX,l=0;l<o.length;l++)i=n*(1/((t=o[l])+1))/2,"Impedance"===e.renderType&&(a=s+n-2*i),this.horizontalLabelCollections.push({centerX:a+i,centerY:r,radius:i,value:t,region:null})},NMe.prototype.calculateRAxisRange=function(e){var t,i,n,o=2*this.areaRadius,r=new WEe;"Impedance"===e.renderType?r.x=this.circleLeftX+o:r.x=this.circleLeftX,r.y=this.circleTopY+this.areaRadius;for(var s=0;s<this.radialLabels.length;s++)n=this.radialLabels[s],i=Math.abs(1/n*o/2),t="Impedance"===e.renderType?0<n?r.y-i:r.y+i:n<0?r.y-i:r.y+i,this.radialLabelCollections.push({centerX:r.x,centerY:t,radius:i,value:n})},NMe.prototype.measureHMajorGridLines=function(e){var t,i,n;this.majorHGridArcPoints=[];for(var o=0;o<this.horizontalLabelCollections.length;o++){new REe;var r=this.horizontalLabelCollections[o],s=this.calculateHMajorArcStartEndPoints(r.value),s="Impedance"===e.renderType?(n=s[0],s[1]):(n=s[1],s[0]),a={width:r.radius,height:r.radius};0!==r.value&&50!==r.value?(t=this.intersectingCirclePoints(n[0].centerX,n[0].centerY,n[0].radius,r.centerX,r.centerY,r.radius,e.renderType),i=this.intersectingCirclePoints(s[0].centerX,s[0].centerY,s[0].radius,r.centerX,r.centerY,r.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:a})):(t={x:r.centerX+r.radius,y:r.centerY},i={x:r.centerX+r.radius,y:r.centerY-.05},this.majorHGridArcPoints.push({startPoint:t,endPoint:i,rotationAngle:2*Math.PI,sweepDirection:this.direction.clockwise,isLargeArc:!0,size:a}))}},NMe.prototype.measureRMajorGridLines=function(e){this.majorRGridArcPoints=[],this.labelCollections=[];for(var t,i,n,o,r,s,a,l=tDe(),h=0;h<this.radialLabelCollections.length;h++)(a=this.radialLabelCollections[h]).radius<=l||(t=a.value,s=(i=this.calculateMajorArcStartEndPoints(a,Math.abs(t),e))[0],i=i[1],n=this.circleXYRadianValue(this.circleCenterX,this.circleCenterY,i.x,i.y)*(180/Math.PI),0!==t?(o={x:s.x,y:s.y},r={x:i.x,y:i.y},s={width:a.radius,height:a.radius},a=0<t?this.direction.clockwise:this.direction.counterclockwise,this.majorRGridArcPoints.push({startPoint:o,endPoint:r,size:s,rotationAngle:2*Math.PI,isLargeArc:!1,sweepDirection:a}),this.labelCollections.push({centerX:i.x,centerY:i.y,angle:n,value:t,radius:this.areaRadius,region:null})):(o={x:this.circleLeftX,y:this.circleCenterY},r={x:this.circleCenterX+this.areaRadius,y:this.circleCenterY},this.majorRGridArcPoints.push({startPoint:o,endPoint:r,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:t,radius:this.areaRadius,region:null})))},NMe.prototype.circleXYRadianValue=function(e,t,i,n){n=Math.atan2(n-t,i-e);return n<0?n+360*Math.PI/180:n},NMe.prototype.calculateMajorArcStartEndPoints=function(e,t,i){var n=[],o=[],r=this.circleCenterX,s=this.circleCenterY;return 10<=t?n[0]="Impedance"===i.renderType?{x:r+this.areaRadius,y:s}:{x:r-this.areaRadius,y:s}:o=3<=t?this.horizontalLabelCollections.filter(function(e){return 10===e.value}):1<=t?this.horizontalLabelCollections.filter(function(e){return 5===e.value}):this.horizontalLabelCollections.filter(function(e){return 3===e.value}),0<o.length&&(n[0]=this.intersectingCirclePoints(e.centerX,e.centerY,e.radius,o[0].centerX,o[0].centerY,o[0].radius,i.renderType)),n[1]=this.intersectingCirclePoints(e.centerX,e.centerY,e.radius,r,s,this.areaRadius,i.renderType),n},NMe.prototype.calculateHMajorArcStartEndPoints=function(e){var t,i=[],n=e<=.3?-(t=2):e<=1?-(t=3):e<=2?-(t=5):e<=5?-(t=10):-(t=50);return i[0]=this.radialLabelCollections.filter(function(e){return e.value===t}),i[1]=this.radialLabelCollections.filter(function(e){return e.value===n}),i},NMe.prototype.calculateMinorArcStartEndPoints=function(e){var t,i=[],n=e<=.1?-(t=1):e<=.2?-(t=.8):e<=.3?-(t=.4):e<=.6?-(t=1):e<=1?-(t=1.5):e<=1.5?-(t=2):e<=2?-(t=1):e<=5?-(t=3):-(t=10);return i[0]=this.radialLabelCollections.filter(function(e){return e.value===t}),i[1]=this.radialLabelCollections.filter(function(e){return e.value===n}),i},NMe.prototype.intersectingCirclePoints=function(e,t,i,n,o,r,s){var a={x:0,y:0},l=e-n,h=t-o,l=Math.sqrt(l*l+h*h),h=l*l,l=(i*i-r*r)/(2*h),d=i*i-r*r,i=Math.sqrt(2*(i*i+r*r)/h-d*d/(h*h)-1),r=(e+n)/2+l*(n-e),d=i*(o-t)/2,h=r+d,r=r-d,d=(t+o)/2+l*(o-t),l=i*(e-n)/2,o=d+l,t=d-l;return"Impedance"===s?r<h?(a.x=r,a.y=t):(a.x=h,a.y=o):r<h?(a.x=h,a.y=o):(a.x=r,a.y=t),{x:a.x,y:a.y}},NMe.prototype.updateHMajorGridLines=function(e){var t=e.horizontalAxis.majorGridLines,i=e.renderer.createGroup({id:e.element.id+"_svg_horizontalAxisMajorGridLines"}),n=(i.setAttribute("aria-hidden","true"),this.calculateGridLinesPath(this.majorHGridArcPoints)),t=new oDe(e.element.id+"_horizontalAxisMajorGridLines","none",t.width,t.color||e.themeStyle.majorGridLine,t.opacity,t.dashArray,n),n=e.renderer.drawPath(t);i.appendChild(n),e.svgObject.appendChild(i)},NMe.prototype.updateRMajorGridLines=function(e){var t=e.radialAxis.majorGridLines,i=e.renderer.createGroup({id:e.element.id+"_svg_radialAxisMajorGridLines"}),n=(i.setAttribute("aria-hidden","true"),this.calculateGridLinesPath(this.majorRGridArcPoints)),t=new oDe(e.element.id+"_radialAxisMajorGridLines","none",t.width,t.color||e.themeStyle.majorGridLine,t.opacity,t.dashArray,n),n=e.renderer.drawPath(t);i.appendChild(n),e.svgObject.appendChild(i)},NMe.prototype.updateHAxisLine=function(e){var t=this.areaRadius,i=e.horizontalAxis.axisLine,n=e.renderer.createGroup({id:e.element.id+"_svg_hAxisLine"});n.setAttribute("aria-hidden","true");var o=this.circleCenterX+t,r=this.circleCenterY,s=this.circleCenterX+t,a=this.circleCenterY-.05,l=t,h=this.direction.clockwise,d=2*Math.PI,i=new oDe(e.element.id+"_horizontalAxisLine","none",i.width,i.color||e.themeStyle.axisLine,1,i.dashArray,"M"+o+" "+r+" A "+l+" "+t+" "+d+" 1 "+h+" "+s+" "+a),o=e.renderer.drawPath(i);n.appendChild(o),e.svgObject.appendChild(n)},NMe.prototype.updateRAxisLine=function(e){var t=this.areaRadius,i=e.radialAxis.axisLine,n=this.circleCenterX-t,o=this.circleCenterY,t=this.circleCenterX+t,r=this.circleCenterY,s=0,a=0,l=this.direction.counterclockwise,i=new oDe(e.element.id+"_radialAxisLine","none",i.width,i.color||e.themeStyle.axisLine,1,i.dashArray,"M "+n+" "+o+" A "+s+" "+a+" 0 0 "+l+" "+t+" "+r),n=e.renderer.createGroup({id:e.element.id+"_svg_rAxisLine"}),o=(n.setAttribute("aria-hidden","true"),e.renderer.drawPath(i));n.appendChild(o),e.svgObject.appendChild(n)},NMe.prototype.drawHAxisLabels=function(o){for(var r,s,a,l,h,d,p,c,u=o.horizontalAxis,g=(o.radialAxis.labelStyle.fontFamily=o.themeStyle.fontFamily||o.radialAxis.labelStyle.fontFamily,o.horizontalAxis.labelStyle),m=o.renderer.createGroup({id:o.element.id+"_HAxisLabels"}),f=(m.setAttribute("aria-hidden","true"),this),e=0;e<this.horizontalLabelCollections.length;e++)!function(i){if(a=f.horizontalLabelCollections[i],r=f.horizontalLabelCollections[i].value.toString(),0!==a.value){if(s="Impedance"===o.renderType?a.centerX-a.radius:a.centerX+a.radius,a=a.centerY,l=dDe(r,g,o.themeStyle.axisLabelFont),s="Impedance"===o.renderType?s-l.width:s,"Outside"===u.labelPosition?a-=l.height/4:a+=l.height,f.horizontalLabelCollections[i].region=f.calculateRegion(r,l,s,a),"Hide"===u.labelIntersectAction){l=f.horizontalLabelCollections[i],l=l.region.bounds,h=l.width,d=l.x;for(var e=1;e<i;e++)c=f.horizontalLabelCollections[e],c=c.region.bounds,p=c.width,c=c.x,"Impedance"===o.renderType&&d<c+p&&(r=""),"Admittance"===o.renderType&&c<d+h&&(r="")}var n={text:r.toString(),x:s,y:a,name:RMe,cancel:!1},t=function(e){var t;e.cancel||(e=new pDe(o.element.id+"_HLabel_"+i,n.x,n.y,"none",n.text),t=g.color||o.themeStyle.axisLabelFont.color,g.fontFamily=g.fontFamily||o.themeStyle.labelFontFamily,e=fDe(e,g,t,m,o.themeStyle.axisLabelFont),m.appendChild(e))};t.bind(f),o.trigger(RMe,n,t)}}(e);o.svgObject.appendChild(m)},NMe.prototype.drawRAxisLabels=function(o){for(var r,s,a,l,h,d,p,c,u,g,m,f,y=2,v=(o.radialAxis.labelStyle.fontFamily=o.themeStyle.fontFamily||o.radialAxis.labelStyle.fontFamily,o.radialAxis.labelStyle),b=new VEe,w=o.radialAxis,C=o.renderer.createGroup({id:o.element.id+"_RAxisLabels"}),e=(C.setAttribute("aria-hidden","true"),function(i){if(b=S.labelCollections[i],r=b.value.toString(),c=dDe(r,v,o.themeStyle.axisLabelFont),a=Math.round(100*b.angle)/100,a="Outside"===w.labelPosition?(s=S.circlePointPosition(S.circleCenterX,S.circleCenterY,b.angle,S.areaRadius+y),S.setLabelsOutsidePosition(a,s.x,s.y,c)):(s=S.circlePointPosition(S.circleCenterX,S.circleCenterY,b.angle,S.areaRadius-y),S.setLabelsInsidePosition(a,s.x,s.y,c)),S.labelCollections[i].region=S.calculateRegion(r,c,a.x,a.y),"Hide"===w.labelIntersectAction){c=S.labelCollections[i],c=c.region.bounds,d=c.width,p=c.height,l=c.x,h=c.y;for(var e=0;e<i;e++)f=S.labelCollections[e],f=f.region.bounds,g=f.width,m=f.height,u=f.x,f=f.y,u<=l+d&&l<=u+g&&f<=h+p&&h<=f+m&&(r=" ")}function t(e){var t;e.cancel||(e=new pDe(o.element.id+"_RLabel_"+i,n.x,n.y,"none",n.text),t=v.color||o.themeStyle.axisLabelFont.color,v.fontFamily=o.themeStyle.labelFontFamily||v.fontFamily,e=fDe(e,v,t,C,o.themeStyle.axisLabelFont),C.appendChild(e))}var n={text:r.toString(),x:a.x,y:a.y,name:RMe,cancel:!1};t.bind(S),o.trigger(RMe,n,t)}),S=this,t=0;t<this.labelCollections.length;t++)e(t);o.svgObject.appendChild(C)},NMe.prototype.calculateRegion=function(e,t,i,n){new LEe;return{bounds:{x:i,y:n,width:t.width,height:t.height},labelText:e}},NMe.prototype.updateHMinorGridLines=function(e){var t=e.horizontalAxis.minorGridLines,i=e.renderer.createGroup({id:e.element.id+"_svg_horizontalAxisMinorGridLines"}),n=this.calculateGridLinesPath(this.minorHGridArcPoints),t=new oDe(e.element.id+"_horizontalAxisMinorGridLines","none",t.width,t.color||e.themeStyle.minorGridLine,t.opacity,t.dashArray,n),n=e.renderer.drawPath(t);i.appendChild(n),e.svgObject.appendChild(i)},NMe.prototype.updateRMinorGridLines=function(e){var t=e.radialAxis.minorGridLines,i=e.renderer.createGroup({id:e.element.id+"_svg_radialAxisMinorGridLines"}),n=this.calculateGridLinesPath(this.minorGridArcPoints),t=new oDe(e.element.id+"_radialAxisMinorGridLines","none",t.width,t.color||e.themeStyle.minorGridLine,t.opacity,t.dashArray,n),n=e.renderer.drawPath(t);i.appendChild(n),e.svgObject.appendChild(i)},NMe.prototype.calculateGridLinesPath=function(e){new JEe;for(var t,i,n,o,r,s="",a=0;a<e.length;a++)t=(r=e[a]).startPoint.x,i=r.startPoint.y,n=r.endPoint.x,o=r.endPoint.y,s=s+"M "+t+" "+i+" A "+(r.size?r.size.width:0)+" "+(r.size?r.size.height:0)+" "+(r.rotationAngle||0)+" "+(r.isLargeArc?1:0)+" "+(r.sweepDirection||0)+" "+n+" "+o+" ";return s.toString()},NMe.prototype.measureHMinorGridLines=function(e){for(var t,i,n,o,r,s,a=e.horizontalAxis.minorGridLines.count,l=(this.minorHGridArcPoints=[],2*this.areaRadius),h=0;h<this.horizontalLabelCollections.length-3;h++)for(var d,p,c=this.horizontalLabelCollections[h],u=this.horizontalLabelCollections[h+1],g=(d=2*(c.radius-u.radius))/(p=Math.floor(a/100*d)),m=0;m<p;m++)s=u.radius+m*g/2,r=("Impedance"===e.renderType?this.circleLeftX+l-2*s:this.circleLeftX)+s,i=5<u.value,o=this.calculateMinorArcStartEndPoints(u.value),o="Impedance"===e.renderType?(t=o[0],o[1]):(t=o[1],o[0]),n=this.intersectingCirclePoints(t[0].centerX,t[0].centerY,t[0].radius,r,c.centerY,s,e.renderType),o=this.intersectingCirclePoints(o[0].centerX,o[0].centerY,o[0].radius,r,c.centerY,s,e.renderType),this.minorHGridArcPoints.push({startPoint:n,endPoint:o,rotationAngle:2*Math.PI,sweepDirection:"Impedance"===e.renderType?this.direction.counterclockwise:this.direction.clockwise,isLargeArc:i,size:{width:s,height:s}})},NMe.prototype.measureRMinorGridLines=function(e){for(var t,i,n=e.radialAxis.minorGridLines.count,o=Math.PI*(2*this.areaRadius),r=t="Impedance"===e.renderType?this.circleCenterX+this.areaRadius:this.circleCenterX-this.areaRadius,s=this.circleCenterY,a=(this.minorGridArcPoints=[],{x:r,y:s}),l=2;l<this.labelCollections.length-3;l++)for(var h,d=this.labelCollections[l],p=this.labelCollections[l+1],c=(u="Impedance"===e.renderType?(i=360===p.angle?0:p.angle,Math.abs(i-d.angle)):(i=360===d.angle?0:d.angle,Math.abs(i-p.angle)))/(h=Math.floor(n/100*(o/360*u))),u=(0<p.value?p:d).value,g=this.minorGridLineArcIntersectCircle(Math.abs(u)),m=1;m<h;m++){var f=c*m+(360===d.angle?i:d.angle),y=this.circlePointPosition(this.circleCenterX,this.circleCenterY,f,this.areaRadius),v=this.arcRadius(a,y,f),f=180<f?this.circleCenterY-v:this.circleCenterY+v,f=this.intersectingCirclePoints(t,f,v,g[0].centerX,g[0].centerY,g[0].radius,e.renderType),f={x:f.x,y:f.y},y={x:y.x,y:y.y},b=0<=d.value?this.direction.clockwise:this.direction.counterclockwise;this.minorGridArcPoints.push({startPoint:f,endPoint:y,rotationAngle:2*Math.PI,sweepDirection:b,isLargeArc:!1,size:{width:v,height:v}})}},NMe.prototype.minorGridLineArcIntersectCircle=function(e){var t=3<=e?20:1.5<=e?10:.6<=e?3:2;return this.horizontalLabelCollections.filter(function(e){return e.value===t})},NMe.prototype.circlePointPosition=function(e,t,i,n){i*=Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}},NMe.prototype.setLabelsInsidePosition=function(e,t,i,n){return 0===e||360===e?(t-=n.width,i-=n.height/2):90===e?(t-=n.width,i+=n.height/8):180===e?i+=n.height:270===e?i+=n.height/2:0<e&&e<=20?t-=n.width:20<e&&e<=60?(t-=n.width+n.width/2,i+=n.height/2):60<e&&e<90?(t-=n.width+n.width/4,i+=n.height/4):90<e&&e<=135?(t-=n.width/2,i+=n.height/16):135<e&&e<=150?(t+=n.width/2,i+=n.height/2):150<e&&e<180?(t+=n.width/2,i+=n.height):180<e&&e<=210?(t+=n.width/6,i+=n.height/6):210<e&&e<240?i+=n.height/4:225<e&&e<270?i+=n.height/3:270<e&&e<=300?(t-=n.width+n.width/4,i+=n.height/4):300<e&&e<=330?(t-=n.width+n.width/3,i+=n.height/4):330<e&&e<=340?(t-=n.width+n.width/2,i+=n.height/4):340<e&&(t-=n.width,i+=n.height/8),{x:t,y:i}},NMe.prototype.setLabelsOutsidePosition=function(e,t,i,n){return 90===e?(t-=n.width/2,i+=n.height):180===e?(t-=n.width+5,i-=n.height/4):270===e?(t-=n.width/2,i-=n.height/4):360===e?(t+=5,i-=n.height/2):0<e&&e<=30?(t+=n.width/4,i+=n.height/8):30<e&&e<=60?(t+=n.width/2,i+=n.height/4):60<e&&e<=90?(t-=n.width/2,i+=n.height):90<e&&e<=135?(t-=n.width,i+=n.height):135<e&&e<=180?(t-=n.width+n.width/4,i+=n.height/4):180<e&&e<=210?(t-=n.width+n.width/4,i-=n.height/4):210<e&&e<=270?(t-=n.width,i-=n.height/4):270<e&&e<=340?i-=n.height/4:340<e&&(i+=n.height/4,t+=n.width/6),{x:t,y:i}},NMe.prototype.arcRadius=function(e,t,i){var i=180<i?90*Math.PI/180:270*Math.PI/180,n=(t.x-e.x)/2,t=(t.y-e.y)/2,n=(t-n*((Math.cos(i)*t-Math.sin(i)*n)/(Math.cos(i)*n+Math.sin(i)*t)))/Math.sin(i),t=e.y+Math.sin(i)*n;return Math.abs(e.y-t)},NMe);function NMe(){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 GEe}_Me.prototype.drawMarker=function(e,t,i,n){if(e.series[t].marker.visible)for(var o=e.series[t].marker,r=e.series[t].points.length-1,s=o.width,a=o.height,l=o.shape,h=e.renderer.createGroup({id:e.element.id+"_svg_series"+t+"_Marker"}),d=(i.appendChild(h),o.border.width),p=o.border.color,c=o.opacity,u=o.fill||e.series[t].fill||e.seriesColors[t%e.seriesColors.length],g=0;g<1+r;g++){var m=n[g].point,f=g,f=new UEe(e.element.id+"_Series"+t+"_Points"+f+"_Marker"+f,u,p,d,c);h.appendChild(this.drawSymbol(l,o.imageUrl,m,new KEe(s,a),f,e))}},_Me.prototype.drawSymbol=function(e,t,i,n,o,r){var s,a,l,e=e.toLowerCase(),h={color:o.borderColor,width:o.borderWidth},d=o.opacity,p=i.x,c=i.y,u=Math.sqrt(n.height*n.height+n.width*n.width)/2;switch(e){case"circle":a=new lDe(o.id,o.fill,h,d,i.x,i.y,u,null),s=r.renderer.drawCircle(a);break;case"rectangle":y="M "+(p+-n.width/2)+" "+(c+-n.height/2)+" L "+(p+n.width/2)+" "+(c+-n.height/2)+" L "+(p+n.width/2)+" "+(c+n.height/2)+" L "+(p+-n.width/2)+" "+(c+n.height/2)+" L "+(p+-n.width/2)+" "+(c+-n.height/2)+"z",l=new oDe(o.id,o.fill,h.width,h.color,d,"",y),s=r.renderer.drawPath(l);break;case"triangle":y="M "+(p+-n.width/2)+" "+(c+n.height/2)+" L "+p+" "+(c+-n.height/2)+" L "+(p+n.width/2)+" "+(c+n.height/2)+" L "+(p+-n.width/2)+" "+(c+n.height/2)+"z",l=new oDe(o.id,o.fill,h.width,h.color,d,"",y),s=r.renderer.drawPath(l);break;case"diamond":y="M "+(p+-n.width/2)+" "+c+" L "+p+" "+(c+-n.height/2)+" L "+(p+n.width/2)+" "+c+" L "+p+" "+(c+n.height/2)+" L "+(p+-n.width/2)+" "+c+"z",l=new oDe(o.id,o.fill,h.width,h.color,d,"",y),s=r.renderer.drawPath(l);break;case"pentagon":for(var g=0;g<=5;g++)var m=u*Math.cos(Math.PI/180*(72*g)),f=u*Math.sin(Math.PI/180*(72*g)),y=0===g?"M "+(p+m)+" "+(c+f)+" ":y.concat("L "+(p+m)+" "+(c+f)+" ");y=y.concat("Z"),l=new oDe(o.id,o.fill,h.width,h.color,d,"",y),s=r.renderer.drawPath(l)}return s.setAttribute("role","img"),s.setAttribute("aria-label","x: "+i.x+", y: "+i.y),r.element.id+"_Series0_Points0_Marker0"===o.id&&s.setAttribute("tabindex","0"),s};var VMe=_Me;function _Me(){}zMe.prototype.drawDataLabel=function(e,t,i,n,o){this.textOptions=[],this.allPoints=[];for(var r,s,a=e.margin,l=e.series[t].marker,h=l.dataLabel,d=h.textStyle,p=n.length,c=0;c<p;c++){var u,g,m=dDe(u=e.series[t].points[c].reactance.toString(),d,e.themeStyle.dataLabelFont),f=(g=n[c].point).x-m.width/2,y=g.y-(m.height+l.height+a.top),v=m.width+a.left/2+a.right/2,m=m.height+a.top/2+a.bottom/2;d.fontFamily=d.fontFamily||e.themeStyle.dataLabelFont.fontFamily,r=c,new qEe,s={textX:f+a.left/2,textY:y+m/2+a.top/2,x:f,y:y},this.textOptions[c]={id:e.element.id+"_Series"+t+"_Points"+r+"_dataLabel_displayText"+c,x:s.textX,y:s.textY,fill:"black",text:u,font:d,xPosition:f,yPosition:y,width:v,height:m,location:g,labelOptions:s,visible:!0,connectorFlag:null}}var b=new XEe;b.textOptions=this.textOptions,this.labelOptions.push(b),this.drawDatalabelSymbol(e,t,h,i,o,n)},zMe.prototype.calculateSmartLabels=function(e,t){for(var i=e.textOptions.length,n=0;n<i;n++)this.allPoints[this.allPoints.length]=e.textOptions[n],this.connectorFlag=!1,this.compareDataLabels(n,e,0,t),this.labelOptions[t].textOptions[n]=e.textOptions[n],this.labelOptions[t].textOptions[n].connectorFlag=this.connectorFlag},zMe.prototype.compareDataLabels=function(e,t,i,n){for(var o,r,s=this.allPoints.length,a=0;a<s;a++)if(r=this.allPoints[a],o=this.allPoints[s-1],this.isCollide(r,o))switch(this.connectorFlag=!0,i){case 0:this.resetValues(o),this.prevLabel=r,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,n);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,n);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,n);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,n);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,n);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,n);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,n);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,n);break;case 8:this.compareDataLabels(e,t,i=0,n)}},zMe.prototype.isCollide=function(e,t){var i=!1;return i=e!==t?!(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},zMe.prototype.resetValues=function(e){e.xPosition=e.labelOptions.x,e.yPosition=e.labelOptions.y,e.x=e.labelOptions.textX,e.y=e.labelOptions.textY},zMe.prototype.drawConnectorLines=function(e,t,i,n,o){var r=n.location,s=r.y>n.y?n.y:n.y-n.height/2,r="M "+r.x+" "+r.y+" L "+n.x+" "+s,n=e.series[t].marker.dataLabel.connectorLine,s=n.color||e.series[t].fill||e.seriesColors[t%e.seriesColors.length],t=new oDe(e.element.id+"_dataLabelConnectorLine_series"+t+"_point"+i,"none",n.width,s,1,"none",r),i=e.renderer.drawPath(t);o.appendChild(i)},zMe.prototype.drawDatalabelSymbol=function(e,t,i,n,o,r){for(var s,a,l,h,d,p,c=0;c<e.series[t].points.length;c++)i.template&&(a=Q("div",{id:e.element.id+"_seriesIndex_"+t+"_Label_Template_Group",className:"template",styles:"position: absolute;"}),document.getElementById(e.element.id+"_Secondary_Element").appendChild(a),s=i.template+"_seriesIndex"+t+"_pointIndex"+c+e.element.id,d={point:e.series[t].points[c].reactance},d=function(e,t,i){for(var n=e[0].outerHTML,o=Object.keys(i),r=RegExp,s=0;s<o.length;s++)n=n.replace(new r("{{:"+o[s]+"}}","g"),i[o[s].toString()]);return(e=Q("div",{id:t,styles:"position: absolute"})).innerText=n,e}(function(t){var i=null;try{i="function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){i=oo(t)}return i}(i.template)(e),s,d),a.appendChild(d),d.style.left=r[c].point.x-d.offsetWidth/2+"px",d.style.top=r[c].point.y-d.offsetHeight-e.series[t].marker.height/2+"px",a=parseInt(d.style.left,10),l=parseInt(d.style.top,10),h=d.offsetWidth,d=d.offsetHeight,p=r[c].point,this.labelOptions[t].textOptions[c]={id:s,x:a,y:l,fill:"black",text:"",font:i.textStyle,xPosition:a,yPosition:l,width:h,height:d,location:p,labelOptions:{textX:a,textY:l,x:a,y:l},visible:!0,connectorFlag:null})};var HMe=zMe;function zMe(){this.textOptions=[],this.labelOptions=[],this.allPoints=[]}WMe.prototype.processData=function(e){var t=e.dataSource,i=e.resistance,n=e.reactance,o=e.tooltipMappingName;e.points=[];for(var r=0;r<t.length;r++)e.points.push({resistance:t[r][i],reactance:t[r][n],tooltip:t[r][o]})},WMe.prototype.draw=function(p,e,t){for(var i,n,o=p.renderer.createGroup({id:p.element.id+"_svg_seriesCollections"}),r=p.series,s=r.length,a=e.areaRadius,l=0;l<s;l++){var h=l;r[l].dataSource&&r[l].resistance&&r[l].reactance&&this.processData(r[l]),this.pointsRegion[l]=[],this.location[l]=[];for(var d=0;d<r[l].points.length;d++)this.xValues[d]=r[l].points[d].resistance,this.yValues[d]=r[l].points[d].reactance;for(var c=e.circleCenterX,u=e.circleCenterY,g=2*e.areaRadius,m=u,f={x:c+("Impedance"===p.renderType?a:-a),y:u}.x,y=0;y<r[l].points.length;y++){var v=this.xValues[y],b=1/(v+1)*g/2,w=this.yValues[y],C=Math.abs(1/w*g/2),S="Impedance"===p.renderType?(i=0<w?u-C:u+C,e.circleLeftX+g-b):(i=w<0?u-C:u+C,e.circleLeftX+b),C=e.intersectingCirclePoints(f,i,C,S,m,b,p.renderType),A=tDe();Math.abs(w)<A&&(C.x="Impedance"===p.renderType?S-b:S+b,C.y=u),this.pointsRegion[l][y]=new jEe,this.pointsRegion[l][y]={point:C,x:v,y:w},this.location[l][y]={x:C.x,y:C.y}}for(var x=0;x<r[l].points.length-1;x++)n=x+1,this.lineSegments[x]=new zEe,this.lineSegments[x]={x1:this.xValues[x],y1:this.yValues[x],x2:this.xValues[n],y2:this.yValues[n]};p.svgObject.appendChild(o),this.drawSeries(p,h,o,t)}for(d=0;d<p.series.length;d++)if(p.series[d].enableSmartLabels&&p.series[d].marker.dataLabel.visible){var I=p.renderer.createGroup({id:p.element.id+"_svg_series"+d+"_Datalabel_connectorLines"});(M=document.getElementById(p.element.id+"_svg_seriesCollection"+d))&&(M.setAttribute("aria-label","Smithchart with "+r[d].points.length+" points"),M.appendChild(I)),this.dataLabel.calculateSmartLabels(this.dataLabel.labelOptions[d],d);for(y=0;y<p.series[d].points.length;y++){var T=this.dataLabel.labelOptions[d].textOptions[y];(T.xPosition+T.width>p.chartArea.x+p.chartArea.width||T.xPosition<p.chartArea.x||T.yPosition<p.chartArea.y||T.yPosition+T.height>p.chartArea.y+p.chartArea.height)&&(this.dataLabel.labelOptions[d].textOptions[y].connectorFlag=!1,this.dataLabel.labelOptions[d].textOptions[y].visible=!1),T.connectorFlag&&this.dataLabel.drawConnectorLines(p,d,y,T,I)}}for(var E=function(l){var h=p.series[l].marker.dataLabel;if(p.series[l].marker.dataLabel.visible)for(var e=document.getElementById(p.element.id+"_svg_seriesCollection"+l),d=p.renderer.createGroup({id:p.element.id+"_svg_series"+l+"_Datalabel"}),t=(d.setAttribute("aria-hidden","true"),e&&e.appendChild(d),0);t<p.series[l].points.length;t++)!function(e){var i,n,t,o,r,s,a=D.dataLabel.labelOptions[l].textOptions[e];!h.template&&a.visible?(i=new YEe,i=D.dataLabel.labelOptions[l].textOptions[e],n=h.textStyle,a=i.xPosition,s=i.yPosition,t=p.element.id+"_Series"+l+"_Points"+e+"_dataLabel_symbol"+e,o=h.fill||p.series[l].fill||p.seriesColors[l%p.seriesColors.length],r=p.series[l].marker.dataLabel.border,t=new rDe(t,o,r,i.opacity,new FEe(a,s,i.width,i.height)),o=p.renderer.drawRectangle(t),d.appendChild(o),r={text:i.text,x:i.x,y:i.y,seriesIndex:l,pointIndex:e,name:FMe,cancel:!1},(a=function(e){var t;e.cancel||(e=new pDe(i.id,e.x,e.y,"start",e.text),t=n.color||p.themeStyle.dataLabelFont.color,e=fDe(e,n,t,d,p.themeStyle.dataLabelFont),d.appendChild(e))}).bind(D),p.trigger(FMe,r,a)):h.template&&((s=document.getElementById(h.template+"_seriesIndex"+l+"_pointIndex"+e+p.element.id)).style.left=D.dataLabel.labelOptions[l].textOptions[e].xPosition+"px",s.style.top=D.dataLabel.labelOptions[l].textOptions[e].yPosition+"px")}(t)},D=this,d=0;d<p.series.length;d++)E(d);for(var M,x=0;x<p.series.length;x++)(p.series[x].enableAnimation&&"Disable"!==Ut||"Enable"===Ut)&&p.animateSeries&&(p.series[x].marker.dataLabel.template&&this.animateDataLabelTemplate(x,p),(M=document.getElementById(p.element.id+"_svg_seriesCollection"+x)).setAttribute("aria-label","Smithchart with "+r[x].points.length+" points"),this.performAnimation(p,M,x))},WMe.prototype.drawSeries=function(i,n,e,o){for(var r,s=this,a=i.renderer.createGroup({id:i.element.id+"_svg_seriesCollection"+n,"clip-path":"url(#"+i.element.id+"_ChartSeriesClipRect_"+n+")"}),t=(i.series[n].marker.visible||(a.setAttribute("tabindex",0===n?"0":""),a.style.outline="none"),a.setAttribute("visibility",i.series[n].visibility),a.setAttribute("role","region"),a.setAttribute("aria-label","Smithchart with "+i.series[n].points.length+" points"),e.appendChild(a),""),l=i.series[n].points.length-1,h=0;h<l;h++)var d=this.pointsRegion[n][h].point,p=this.pointsRegion[n][h+1].point,t=t+("M "+d.x+" "+d.y+" L "+p.x+" "+p.y)+" ";function c(e){var t;e.cancel||(e=new oDe(i.element.id+"_series"+n+"_points","none",i.series[n].width,g.fill,i.series[n].opacity,"none",u),s.clipRectElement=i.renderer.drawClipPath(new rDe(i.element.id+"_ChartSeriesClipRect_"+n,"transparent",{width:1,color:"Gray"},1,{x:o.x,y:o.y,width:i.availableSize.width,height:i.availableSize.height})),a.appendChild(s.clipRectElement),t=i.renderer.createGroup({id:i.element.id+"_svg"+n}),r=i.renderer.drawPath(e),t.appendChild(r),a.appendChild(t))}var u=t.toString(),e=i.series[n].fill||i.seriesColors[n%i.seriesColors.length],g={text:i.series[n].name,fill:e,name:LMe,cancel:!1};c.bind(this),i.trigger(LMe,g,c),(new VMe).drawMarker(i,n,a,this.pointsRegion[n]),this.dataLabel.drawDataLabel(i,n,a,this.pointsRegion[n],o)},WMe.prototype.animateDataLabelTemplate=function(e,t){for(var i=t.series[e].points.length,n=parseFloat(t.series[e].animationDuration),o=0;o<i;o++){var r=document.getElementById(t.series[e].marker.dataLabel.template+"_seriesIndex"+e+"_pointIndex"+o+t.element.id);r.style.visibility="hidden",!function(t,e,i,n,o){var r;new Vt({}).animate(e,{duration:n,delay:i,name:o,progress:function(e){r=(e.timeStamp-e.delay)/e.duration,r=0+r,e.element.style.opacity=r.toString()},end:function(e){e.element.style.opacity=1..toString(),t.trigger("animationComplete",event)}})}(t,r,0,n,"FadeIn")}},WMe.prototype.performAnimation=function(t,e,i){var n,o=new Vt({}),r=e.childNodes[0].childNodes[0].childNodes[0],s=mDe("Linear"),a=mDe("Reverse"),l=+r.getAttribute("width"),h=+r.getAttribute("x");o.animate(r,{duration:0===parseFloat(t.series[i].animationDuration)&&"Enable"===Ut?2e3:parseFloat(t.series[i].animationDuration),progress:function(e){"Impedance"===t.renderType?(n=s(e.timeStamp-e.delay,0,l,e.duration),r.setAttribute("width",n.toString())):(n=a(e.timeStamp-e.delay,l,0,e.duration),r.setAttribute("x",n.toString()))},end:function(){"Impedance"===t.renderType?r.setAttribute("width",l.toString()):r.setAttribute("x",h.toString()),t.trigger(MMe,{cancel:!1,name:MMe,smithchart:t})}})},WMe.prototype.getLocation=function(e,t){return{x:this.location[e][t].x,y:this.location[e][t].y}};var jMe=WMe;function WMe(){this.xValues=[],this.yValues=[],this.pointsRegion=[],this.lineSegments=[],this.location=[],this.dataLabel=new HMe}var QMe="beforePrint",UMe=(qMe.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);e={cancel:!1,htmlContent:this.getHTMLContent(e),name:QMe};this.control.trigger(QMe,e),e.cancel||V(e.htmlContent,this.smithchartPrint)},qMe.prototype.getHTMLContent=function(e){var t=Q("div");return e?e instanceof Array?e.forEach(function(e){t.appendChild($Ee(e).cloneNode(!0))}):e instanceof Element?t.appendChild(e.cloneNode(!0)):t.appendChild($Ee(e).cloneNode(!0)):t.appendChild(this.control.element.cloneNode(!0)),t},qMe.prototype.export=function(i,n,o){var r,s,a=this,l=Q("canvas",{id:"ej2-canvas",attrs:{width:this.control.availableSize.width.toString(),height:this.control.availableSize.height.toString()}}),h=!(-1<F.userAgent.toString().indexOf("HeadlessChrome")),e=(o=je(o)?up.Landscape:o,'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+this.control.svgObject.outerHTML+"</svg>"),d=window.URL.createObjectURL(new Blob("SVG"===i?[e]:[(new XMLSerializer).serializeToString(this.control.svgObject)],{type:"image/svg+xml"}));"SVG"===i?this.triggerDownload(n,i,d,h):(r=new Image,s=l.getContext("2d"),r.onload=function(){var e,t;s.drawImage(r,0,0),window.URL.revokeObjectURL(d),"PDF"===i?(e=new sg,t=l.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream"),e.pageSettings.orientation=o,t=t.slice(t.indexOf(",")+1),e.pages.add().graphics.drawImage(new oc(t),0,0,a.control.availableSize.width-60,a.control.availableSize.height),h&&(e.save(n+".pdf"),e.destroy())):a.triggerDownload(n,i,l.toDataURL("image/png").replace("image/png","image/octet-stream"),h)},r.src=d)},qMe.prototype.triggerDownload=function(e,t,i,n){Q("a",{attrs:{download:e+"."+t.toLocaleLowerCase(),href:i}}).dispatchEvent(new MouseEvent(n?"click":"move",{view:window,bubbles:!1,cancelable:!0}))},qMe);function qMe(e){this.control=e}GMe=function(e,t){return(GMe=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])}))(e,t)};var GMe,YMe,oMe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},oMe=(function(e,t){function i(){this.constructor=e}GMe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(XMe,YMe=Ji),XMe.prototype.getModuleName=function(){return"smithchart"},XMe.prototype.getPersistData=function(){return""},XMe.prototype.createChartSvg=function(){this.removeSvg(),ZEe(this)},XMe.prototype.renderTitle=function(t,i,n){function e(e){e.cancel||(fDe(new pDe(o.element.id+"_Smithchart_"+i,e.x,e.y,"start",e.text),r,r.color||o.themeStyle.smithchartTitleFont.color,n,o.themeStyle.smithchartTitleFont).setAttribute("tabindex","0"),e={x:e.x,y:e.y,textSize:s},o.svgObject.appendChild(n),""!==t.subtitle.text&&t.subtitle.visible&&o.renderSubtitle(t,i,s,o.availableSize,e,n))}var o=this,r=t.textStyle,s=dDe(t.text,r,this.themeStyle.smithchartTitleFont),a=t.textAlignment,l=t.text,h=je(t.maximumWidth)?Math.abs(this.margin.left+this.margin.right-this.availableSize.width):t.maximumWidth,d=s.width>h,a=s.width>this.availableSize.width?this.margin.left+this.border.width:"Center"===a?this.availableSize.width/2-s.width/2:"Near"===a?this.margin.left+this.elementSpacing+this.border.width:this.availableSize.width-s.width-(this.margin.right+this.elementSpacing+this.border.width),p=this.margin.top+s.height/2+this.elementSpacing,d=(t.enableTrim&&d&&(l=eDe(h,t.text,r,this.themeStyle.smithchartTitleFont),s=dDe(l,r,this.themeStyle.smithchartTitleFont)),n=this.renderer.createGroup({id:this.element.id+"_Title_Group"}),{text:l,x:a,y:p,name:PMe,cancel:!1});e.bind(this),this.trigger(PMe,d,e)},XMe.prototype.renderSubtitle=function(e,i,t,n,o,r){function s(e){var t;e.cancel||((t=fDe(new pDe(a.element.id+"_Smithchart_"+i,e.x,e.y,u,e.text),l,l.color||a.themeStyle.smithchartSubtitleFont.color,r,a.themeStyle.smithchartSubtitleFont)).setAttribute("aria-label",h.description||e.text),r.appendChild(t))}var a=this,l=e.subtitle.textStyle,h=e.subtitle,d=dDe(h.text,l,this.themeStyle.smithchartSubtitleFont),p=h.text,c=je(h.maximumWidth)?.75*this.bounds.width:h.maximumWidth,d=(h.enableTrim&&d.width>c&&(p=eDe(c,h.text,l,this.themeStyle.smithchartSubtitleFont)),"Far"===e.subtitle.textAlignment?o.x+o.textSize.width:"Near"===e.subtitle.textAlignment?o.x:o.x+o.textSize.width/2),c=o.y+2*this.elementSpacing,u="Far"===e.subtitle.textAlignment?"end":"Near"===e.subtitle.textAlignment?"start":"middle",o={text:p,x:d,y:c,name:BMe,cancel:!1};s.bind(this),this.trigger(BMe,o,s)},XMe.prototype.renderBorder=function(){var e=this.border,e=(this.background=this.background||this.themeStyle.background,new rDe(this.element.id+"_SmithchartBorder",this.background,e,1,new FEe(e.width/2,e.width/2,this.availableSize.width-e.width,this.availableSize.height-e.width)));this.svgObject.appendChild(this.renderer.drawRectangle(e)).setAttribute("aria-hidden","true")},XMe.prototype.onPropertyChanged=function(e){var t=!1;if(!this.delayRedraw){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"background":case"border":case"series":case"legendSettings":case"radius":case"enableRtl":t=!0;break;case"size":this.createChartSvg(),t=!0;break;case"theme":case"renderType":t=this.animateSeries=!0}t&&this.render()}},XMe.prototype.preRender=function(){this.allowServerDataBinding=!1,this.trigger("load",{smithchart:this}),this.unWireEVents(),this.initPrivateVariable(),this.wireEVents()},XMe.prototype.initPrivateVariable=function(){this.animateSeries=!0,this.delayRedraw=!1,this.element.setAttribute("role","region"),this.element.setAttribute("aria-label",this.title.description||this.title.text+". Syncfusion interactive chart."),this.element.setAttribute("tabindex","0"),this.element.style.outline="none"},XMe.prototype.setNavigationStyle=function(e){e=document.getElementById(e);e&&e.style.setProperty("outline","1.5px solid "+this.themeStyle.tabColor)},XMe.prototype.removeNavigationStyle=function(){var e=document.querySelectorAll("text[id*=_Smithchart_title], g[id*=_svg_Legend], g[id*=_svg_seriesCollection], path[id*=_Points], [id*="+this.element.id+"]");e&&e.forEach(function(e){(e instanceof HTMLElement||e instanceof SVGElement)&&(e.style.setProperty("outline","none"),e.style.setProperty("margin",""))})},XMe.prototype.setTheme=function(){this.themeStyle=function(e){var t,i="MaterialDark"===e?"#383838":"FabricDark"===e?"#242424":"#1b1b1b";switch(e){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",tooltipFontSize:"12px",tabColor:"#FFD939",smithchartTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#FFFFFF",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"MaterialDark":case"BootstrapDark":case"FabricDark":t={axisLabel:"#DADADA",axisLine:" #6F6C6C",majorGridLine:"#414040",minorGridLine:"#514F4F",chartTitle:"#ffffff",legendLabel:"#DADADA",background:i,areaBorder:" #9A9A9A",tooltipFill:"MaterialDark"===e?"#F4F4F4":"BootstrapDark"===e?"#F0F0F0":"#A19F9D",dataLabel:"#DADADA",tooltipBoldLabel:"MaterialDark"===e?"rgba(18, 18, 18, 1)":"BootstrapDark"===e?"#1A1A1A":"#DADADA",tooltipLightLabel:"MaterialDark"===e?"rgba(18, 18, 18, 1)":"BootstrapDark"===e?"#1A1A1A":"#DADADA",tooltipHeaderLine:"#9A9A9A",tooltipFontSize:"12px",tabColor:"MaterialDark"===e?"#00B0FF":"FabricDark"===e?"#0074CC":"#0070F0",smithchartTitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"BootstrapDark"===e?"#FFFFFF":"#DADADA",fontFamily:"MaterialDark"===e?"Roboto":"BootstrapDark"===e?"Helvetica":"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"BootstrapDark"===e?"#676767":"#A19F9D",fontFamily:"MaterialDark"===e?"Roboto":"BootstrapDark"===e?"Helvetica":"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"BootstrapDark"===e?"#FFFFFF":"#DADADA",fontFamily:"MaterialDark"===e?"Roboto":"BootstrapDark"===e?"Helvetica":"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"BootstrapDark"===e?"#676767":"#A19F9D",fontFamily:"MaterialDark"===e?"Roboto":"BootstrapDark"===e?"Helvetica":"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"BootstrapDark"===e?"#CED4DA":"#A19F9D",fontFamily:"MaterialDark"===e?"Roboto":"BootstrapDark"===e?"Helvetica":"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"BootstrapDark"===e?"#FFFFFF":"#DADADA",fontFamily:"MaterialDark"===e?"Roboto":"BootstrapDark"===e?"Helvetica":"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap4":t={axisLabel:"#212529",axisLine:"#ADB5BD",majorGridLine:"#CED4DA",minorGridLine:"#DEE2E6",chartTitle:"#212529",legendLabel:"#212529",background:"#FFFFFF",areaBorder:"#DEE2E6",tooltipFill:"#212529",dataLabel:"#212529",tooltipBoldLabel:"#F9FAFB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#FFFFFF",tooltipFontSize:"12px",tabColor:"#007BFF",fontFamily:"Helvetica",fontSize:"16px",labelFontFamily:"Helvetica",tooltipFillOpacity:1,tooltipTextOpacity:.9,smithchartTitleFont:{color:"#212529",fontFamily:"Helvetica",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#666666",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#212529",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"#495057",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#495057",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#212529",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Tailwind3":t={axisLabel:"#4B5563",axisLine:"#D1D5DB",majorGridLine:"#E5E7EB",minorGridLine:"#D1D5DB",chartTitle:"#6B7280",legendLabel:"#6B7280",background:"#FFFFFF",areaBorder:"#D1D5DB",tooltipFill:"#111827",dataLabel:"#111827",tooltipBoldLabel:"#F9FAFB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#D1D5DB",tooltipFontSize:"12px",tabColor:"#4F46E5",fontFamily:"Inter",fontSize:"12px",labelFontFamily:"inter",tooltipFillOpacity:1,tooltipTextOpacity:1,smithchartTitleFont:{color:"#6B7280",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"},legendLabelFont:{color:"#6B7280",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},legendTitleFont:{color:"#374151",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"500"},dataLabelFont:{color:"#111827",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#4B5563",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#6B7280",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"600"}};break;case"Tailwind3Dark":t={axisLabel:"#D1D5DB",axisLine:"#282F3C",majorGridLine:"#282F3C",minorGridLine:"#374151",chartTitle:"#9CA3AF",legendLabel:"#9CA3AF",background:"rgba(17, 24, 39, 1)",areaBorder:"#374151",tooltipFill:"#F9FAFB",dataLabel:"#FFFFFF",tooltipBoldLabel:"#1F2937",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#374151",tooltipFontSize:"12px",tabColor:"#22D3EE",fontFamily:"Inter",fontSize:"14px",labelFontFamily:"inter",tooltipFillOpacity:1,tooltipTextOpacity:1,smithchartTitleFont:{color:"#9CA3AF",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"},legendLabelFont:{color:"#9CA3AF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},legendTitleFont:{color:"#E5E7EB",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"500"},dataLabelFont:{color:"#FFFFFF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#9CA3AF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"600"}};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",tooltipFontSize:"12px",tabColor:"#4F46E5",fontFamily:"Inter",fontSize:"14px",labelFontFamily:"inter",tooltipFillOpacity:1,tooltipTextOpacity:1,smithchartTitleFont:{color:"#374151",fontFamily:"Inter",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#374151",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"#6B7280",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#6B7280",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"TailwindDark":t={axisLabel:"#9CA3AF",axisLine:"#4B5563",majorGridLine:"#374151",minorGridLine:"#4B5563",chartTitle:"#D1D5DB",legendLabel:"#D1D5DB",background:"#1f2937",areaBorder:"#4B5563",tooltipFill:"#E9ECEF",dataLabel:"#D1D5DB",tooltipBoldLabel:"#1F2937",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#9CA3AF",tooltipFontSize:"12px",tabColor:"#22D3EE",fontFamily:"Inter",fontSize:"14px",labelFontFamily:"inter",tooltipFillOpacity:1,tooltipTextOpacity:1,smithchartTitleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#D1D5DB",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"#9CA3AF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#9CA3AF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap5":t={axisLabel:"#21252980",axisLine:"#DEE2E6",majorGridLine:"#DEE2E6",minorGridLine:"#DEE2E6",chartTitle:"#212529",legendLabel:"#212529BF",background:"#FFFFFF",areaBorder:"#E9ECEF",tooltipFill:"#000000E5",dataLabel:"#212529",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#FFFFFF",tooltipFontSize:"12px",tabColor:"#0D6EFD",fontFamily:"Segoe UI",fontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,smithchartTitleFont:{color:"#212529",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"#212529BF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#21252980",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"}};break;case"Bootstrap5Dark":t={axisLabel:"#DEE2E680",axisLine:"#495057",majorGridLine:"#495057",minorGridLine:"#495057",chartTitle:"#DEE2E6",legendLabel:"#DEE2E6BF",background:"#212529",areaBorder:"#343A40",tooltipFill:"#FFFFFFE5",dataLabel:"#DEE2E6",tooltipBoldLabel:"#212529",tooltipLightLabel:"#212529",tooltipHeaderLine:"#212529",tooltipFontSize:"12px",tabColor:"#0D6EFD",fontFamily:"Segoe UI",fontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,smithchartTitleFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"400"},legendLabelFont:{color:"#DEE2E6BF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"#E9ECEF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#DEE2E680",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"}};break;case"Fluent":t={axisLabel:"#3B3A39",axisLine:"#D2D0CE",majorGridLine:"#D2D0CE",minorGridLine:"#EDEBE9",chartTitle:"#201F1E",legendLabel:"#323130",background:"#FFFFFF",areaBorder:" #D2D0CE",tooltipFill:"#FFFFFF",dataLabel:"#3B3A39",tooltipBoldLabel:"#323130",tooltipLightLabel:"#323130",tooltipHeaderLine:"#D2D0CE",tooltipFontSize:"12px",tabColor:"#0078D4",fontFamily:"Segoe UI",fontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,smithchartTitleFont:{color:"#201F1E",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#49454E",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#201F1E",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"#3B3A39",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#3B3A39",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#323129",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"FluentDark":t={axisLabel:"#C8C6C4",axisLine:"#3B3A39",majorGridLine:"#414040",minorGridLine:"#414040",chartTitle:"#F3F2F1",legendLabel:"#D2D0CE",background:"transparent",areaBorder:"#414040",tooltipFill:"#323130",dataLabel:"#C8C6C4",tooltipBoldLabel:"#F3F2F1",tooltipLightLabel:"#F3F2F2",tooltipHeaderLine:"#3B3A39",tooltipFontSize:"12px",tabColor:"#0078D4",fontFamily:"Segoe UI",fontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,smithchartTitleFont:{color:"#C8C6C4",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#D2D0CE",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#F3F2F1",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"#D2D0CE",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#C8C6C4",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#F3F2F1",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Fluent2":t={axisLabel:"#616161",axisLine:"#D2D0CE",majorGridLine:"#EDEBE9",minorGridLine:"#FAFAFA",chartTitle:"#242424",legendLabel:"#424242",background:"#FFFFFF",areaBorder:"#EDEBE9",tooltipFill:"#FFFFFF",dataLabel:"#242424",tooltipBoldLabel:"#242424",tooltipLightLabel:"#242424",tooltipHeaderLine:"#D2D0CE",tooltipFontSize:"12px",tabColor:"#0078D4",fontFamily:"Segoe UI",fontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,smithchartTitleFont:{color:"#242424",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#424242",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#616161",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#616161",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"}};break;case"Fluent2Dark":t={axisLabel:"#ADADAD",axisLine:"#3B3A39",majorGridLine:"#292827",minorGridLine:"#3B3A39",chartTitle:"#FFFFFF",legendLabel:"#D6D6D6",background:"transparent",areaBorder:"#292827",tooltipFill:"#292929",dataLabel:"#FFFFFF",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#3B3A39",tooltipFontSize:"12px",tabColor:"#0078D4",fontFamily:"Segoe UI",fontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,smithchartTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#D6D6D6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#ADADAD",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#ADADAD",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"}};break;case"Fluent2HighContrast":t={axisLabel:"#FFFFFF",axisLine:"#3B3A39",majorGridLine:"#3B3A39",minorGridLine:"#3B3A39",chartTitle:"#FFFFFF",legendLabel:"#FFFFFF",background:"#1c1b1f",areaBorder:"#292827",tooltipFill:"#000000",dataLabel:"#FFFFFF",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#3B3A39",tooltipFontSize:"12px",tabColor:"#0078D4",fontFamily:"Segoe UI",fontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,smithchartTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#ADADAD",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"}};break;case"Material3":t={axisLine:"#C4C7C5",axisLabel:"#1C1B1F",majorGridLine:"#C4C7C5",minorGridLine:"#C4C7C5",legendLabel:"#1C1B1F",background:"#FFFFFF",chartTitle:"#1C1B1F",areaBorder:" #E7E0EC",dataLabel:"#49454E",tooltipFill:"#313033",tooltipBoldLabel:"#F4EFF4",tooltipLightLabel:"#F4EFF4",tooltipHeaderLine:"#F4EFF4",tooltipFontFamily:"Inter",tooltipFontSize:"12px",tabColor:"#49454E",fontFamily:"Inter",fontSize:"16px",labelFontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:1,smithchartTitleFont:{color:"#1C1B1F",fontFamily:"Roboto",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#49454E",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#1C1B1F",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"#49454E",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#1E192B",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#49454E",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Material3Dark":t={axisLabel:"#E6E1E5",axisLine:"#444746",majorGridLine:"#444746",minorGridLine:"#444746",chartTitle:"#E6E1E5",legendLabel:"#E6E1E5",background:"transparent",areaBorder:" #49454F",tooltipFill:"#E6E1E5",dataLabel:"#CAC4D0",tooltipBoldLabel:"#313033",tooltipLightLabel:"#313033",tooltipHeaderLine:"#313033",tooltipFontFamily:"Roboto",tooltipFontSize:"12px",tabColor:"#CAC4D0",fontFamily:"Roboto",fontSize:"16px",labelFontFamily:"Roboto",tooltipFillOpacity:1,tooltipTextOpacity:1,smithchartTitleFont:{color:"#E6E1E5",fontFamily:"Roboto",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#E6E1E5",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;default:t={axisLabel:"#686868",axisLine:"#b5b5b5",majorGridLine:"#dbdbdb",minorGridLine:"#eaeaea",chartTitle:"#424242",legendLabel:"#353535",background:"#FFFFFF",areaBorder:"Gray",tooltipFill:"Material"===e?"#000816":"Bootstrap"===e?"#212529":"#FFFFFF",dataLabel:"#424242",tooltipBoldLabel:"Material"===e?"rgba(249, 250, 251, 1)":"Bootstrap"===e?"#F9FAFB":"#333333",tooltipLightLabel:"Material"===e?"rgba(249, 250, 251, 1)":"Bootstrap"===e?"#F9FAFB":"#333333",tooltipHeaderLine:"Fabric"===e?"#D2D0CE":"#ffffff",tooltipFontSize:"12px",tabColor:"Material"===e?"#ff4081":"Fabric"===e?"#0078D6":"#317AB9",fontFamily:"Material"===e?"Roboto":"Bootstrap"===e?"Helvetica":"Segoe UI",smithchartTitleFont:{color:"Material"===e?"rgba(0, 0, 0, 1)":"Bootstrap"===e?"#212529":"#333333",fontFamily:"Material"===e?"Roboto":"Bootstrap"===e?"Helvetica":"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"Material"===e?"rgba(97, 97, 97, 1)":"#666666",fontFamily:"Material"===e?"Roboto":"Bootstrap"===e?"Helvetica":"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"Material"===e?"rgba(0, 0, 0, 1)":"Bootstrap"===e?"#212529":"#F3F2F1",fontFamily:"Material"===e?"Roboto":"Bootstrap"===e?"Helvetica":"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},dataLabelFont:{color:"Material"===e?"rgba(97, 97, 97, 1)":"Bootstrap"===e?"#676767":"#666666",fontFamily:"Material"===e?"Roboto":"Bootstrap"===e?"Helvetica":"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},axisLabelFont:{color:"Material"===e?"rgba(97, 97, 97, 1)":"Bootstrap"===e?"#676767":"#666666",fontFamily:"Material"===e?"Roboto":"Bootstrap"===e?"Helvetica":"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},smithchartSubtitleFont:{color:"Material"===e?"rgba(0, 0, 0, 1)":"Bootstrap"===e?"#212529":"#333333",fontFamily:"Material"===e?"Roboto":"Bootstrap"===e?"Helvetica":"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"}}}return t}(this.theme),this.seriesColors=function(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":t=["#79ECE4","#E98272","#DFE6B6","#C6E773","#BA98FF","#FA83C3","#00C27A","#43ACEF","#D681EF","#D8BC6E"];break;case"MaterialDark":t=["#9ECB08","#56AEFF","#C57AFF","#61EAA9","#EBBB3E","#F45C5C","#8A77FF","#63C7FF","#FF84B0","#F7C928"];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"Tailwind3":t=["#2F4074","#03B4B4","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];break;case"Tailwind3Dark":t=["#8029F1","#1ABC9C","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];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;case"Bootstrap5Dark":case"Bootstrap5":t=["#FD7E14","#6610F2","#6F42C1","#D63384","#DC3545","#FFC107","#198754","#0DCAF0"];break;case"Fluent":case"FluentDark":t=["#1AC9E6","#DA4CB2","#EDBB40","#AF4BCF","#FF7266","#1BD565","#EE993D","#5887FF","#EC548D","#7D39C0"];break;case"Fluent2":t=["#6200EE","#09AF74","#0076E5","#CB3587","#E7910F","#0364DE","#66CD15","#F3A93C","#107C10","#C19C00"];break;case"Fluent2Dark":case"Fluent2HighContrast":t=["#9BB449","#2A72D5","#43B786","#3F579A","#584EC6","#E85F9C","#6E7A89","#EA6266","#0B6A0B","#C19C00"];break;case"Material3":t=["#6355C7","#00AEE0","#FFB400","#F7523F","#963C70","#FD7400","#4BE0BC","#2196F5","#DE3D8A","#162F88"];break;case"Material3Dark":t=["#4EAAFF","#FA4EAB","#FFF500","#17EA58","#38FFE7","#FF9E45","#B3F32F","#B93CE4","#FC5664","#9B55FF"];break;default:t=["#00bdae","#404041","#357cd2","#e56590","#f8b883","#70ad47","#dd8abd","#7f84e8","#7bb4eb","#ea7a57"]}return t}(this.theme)},XMe.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.calculateLegendBounds(this));var e=new EMe,e=(this.bounds=e.calculateAreaBounds(this,this.title,this.legendBounds),""!==this.title.text&&this.title.visible&&this.renderTitle(this.title,"title",null),new OMe);e.renderArea(this,this.bounds),this.seriesrender=new jMe,this.seriesrender.draw(this,e,this.bounds),this.smithchartLegendModule&&this.legendSettings.visible&&this.smithchartLegendModule.renderLegend(this),this.renderComplete(),this.allowServerDataBinding=!0,this.trigger("loaded",{smithchart:this})},XMe.prototype.createSecondaryElement=function(){var e,t,i;je(document.getElementById(this.element.id+"_Secondary_Element"))?(e=Q("div",{id:this.element.id+"_Secondary_Element",styles:"z-index:1;"}),this.element.appendChild(e),t=this.element.getBoundingClientRect(),(i=document.getElementById(this.element.id+"_svg"))&&(i=i.getBoundingClientRect(),e.style.left=Math.max(i.left-t.left,0)+"px",e.style.top=Math.max(i.top-t.top,0)+"px")):cDe(this.element.id+"_Secondary_Element")},XMe.prototype.destroy=function(){var e;this.element&&(this.unWireEVents(),YMe.prototype.destroy.call(this),this.element.classList.remove("e-smithchart"),this.removeSvg(),this.svgObject=null,(e=document.getElementById(this.element.id+"Keyboard_smith_chart_focus"))&&e.remove(),cDe("smithchartmeasuretext"))},XMe.prototype.wireEVents=function(){E.add(this.element,"click",this.smithchartOnClick,this),E.add(this.element,F.touchMoveEvent,this.mouseMove,this),E.add(this.element,F.touchEndEvent,this.mouseEnd,this),E.add(this.element,"keyup",this.chartKeyUp,this),E.add(this.element,"keydown",this.chartKeyDown,this),window.addEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.smithchartOnResize.bind(this))},XMe.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)},XMe.prototype.mouseEnd=function(e){var t;"touchend"===e.type?this.isTouch=!0:this.isTouch="touch"===e.pointerType||"2"===e.pointerType,this.tooltipRenderModule&&this.isTouch&&(t=this.tooltipRenderModule.smithchartMouseMove(this,e))&&(this.fadeoutTo=+setTimeout(function(){t.fadeOut()},2e3))},XMe.prototype.smithchartOnClick=function(e){e=e.target,e=(this.isLegendClicked?e.children[1]:e).id,e=document.getElementById(e).parentElement;if("containerlegendItem_Group"===document.getElementById(e.id).parentElement.id&&this.legendSettings.toggleVisibility){for(var t=e.childNodes[1],e=e.childNodes[0],i=t.textContent,n=void 0,o=void 0,r=0;r<this.smithchartLegendModule.legendSeries.length;r++)i===this.smithchartLegendModule.legendSeries[r].text&&(n=this.smithchartLegendModule.legendSeries[r].seriesIndex,o=this.smithchartLegendModule.legendSeries[r].fill);t=document.getElementById(this.element.id+"_svg_seriesCollection"+n);"visible"===t.getAttribute("visibility")?(e.setAttribute("fill","gray"),t.setAttribute("visibility","hidden"),this.series[n].visibility="hidden"):(e.setAttribute("fill",o),t.setAttribute("visibility","visible"),this.series[n].visibility="visible")}this.removeNavigationStyle()},XMe.prototype.unWireEVents=function(){E.remove(this.element,"click",this.smithchartOnClick),E.remove(this.element,F.touchMoveEvent,this.mouseMove),E.remove(this.element,F.touchEndEvent,this.mouseEnd),E.remove(this.element,"keyup",this.chartKeyUp),E.remove(this.element,"keydown",this.chartKeyDown),window.removeEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.smithchartOnResize)},XMe.prototype.print=function(e){new UMe(this).print(e)},XMe.prototype.export=function(e,t,i){new UMe(this).export(e,t,i)},XMe.prototype.chartKeyDown=function(e){var t="";return""!==(t=this.series[this.currentSeriesIndex].tooltip.visible&&("Tab"===e.code&&-1<this.previousTargetId.indexOf("_Series")||"Escape"===e.code)?"ESC":t)&&this.smithchartKeyboardNavigations(e,e.target.id,t),"Tab"===e.code&&this.removeNavigationStyle(),!1},XMe.prototype.chartKeyUp=function(e){var t,i,n="",o=e.target.id,r=e.target,s=ie(this.element.id+"_Smithchart_title"),a=ie(this.element.id+"_svg_seriesCollections"),l=ie(this.element.id+"legendItem_Group");if(this.removeNavigationStyle(),s&&s.setAttribute("class","e-smith-chart-focused"),a&&a.firstElementChild&&a.firstElementChild.children[1].lastElementChild&&((t=(h=a.firstElementChild.children[1].lastElementChild).getAttribute("class"))&&-1===t.indexOf("e-smith-chart-focused")?t+=" e-smith-chart-focused":t=t||"e-smith-chart-focused",h.setAttribute("class",t)),l&&((t=(h=l.firstElementChild).getAttribute("class"))&&-1===t.indexOf("e-smith-chart-focused")?t+=" e-smith-chart-focused":t=t||"e-smith-chart-focused",h.setAttribute("class",t)),"Tab"===e.code)""!==this.previousTargetId&&(-1<this.previousTargetId.indexOf("_Series")&&-1===o.indexOf("_Series")?(i=ie(this.element.id+"_svg_seriesCollections"),s=-1<this.previousTargetId.indexOf("_Marker")?ie(this.element.id+"_svg_series"+this.currentSeriesIndex+"_Marker").children[this.currentPointIndex]:i.children[this.currentSeriesIndex],this.setTabIndex(s,document.getElementById(this.element.id+"_Series0_Points0_Marker0")),this.currentPointIndex=0,this.currentSeriesIndex=0):-1<this.previousTargetId.indexOf("_svg_Legend")&&-1===o.indexOf("_svg_Legend")&&(i=ie(this.element.id+"legendItem_Group"),this.setTabIndex(i.children[this.currentLegendIndex],i.firstElementChild))),this.previousTargetId=o,n=this.series[0].tooltip.visible?"Tab":"";else if(-1<e.code.indexOf("Arrow")){if(e.preventDefault(),-1<(this.previousTargetId=o).indexOf("_svg_Legend")){a=r.parentElement.children,l=(a[this.currentLegendIndex].removeAttribute("tabindex"),this.currentLegendIndex+="ArrowUp"===e.code||"ArrowRight"===e.code?1:-1,this.currentLegendIndex=this.getActualIndex(this.currentLegendIndex,a.length),a[this.currentLegendIndex]);this.focusChild(l),this.removeNavigationStyle(),this.setNavigationStyle(l.id),o=l.children[1].id}else if(-1<o.indexOf("_Series")){i=r.parentElement.parentElement.parentElement;var h=e.target;if(r.removeAttribute("tabindex"),r.blur(),"ArrowRight"===e.code||"ArrowLeft"===e.code){for(var d=[],p=0;p<i.children.length;p++)-1<i.children[p].id.indexOf("_svg_seriesCollection")&&d.push(+i.children[p].id.split("_svg_seriesCollection")[1]);this.currentSeriesIndex=d.indexOf(this.currentSeriesIndex)+("ArrowRight"===e.code?1:-1),this.currentSeriesIndex=d[this.getActualIndex(this.currentSeriesIndex,d.length)]}else this.currentPointIndex+="ArrowUp"===e.code?1:-1;-1<o.indexOf("_Marker")&&(this.currentPointIndex=this.getActualIndex(this.currentPointIndex,ie(this.element.id+"_svg_series"+this.currentSeriesIndex+"_Marker").childElementCount),h=ie(this.element.id+"_Series"+this.currentSeriesIndex+"_Points"+this.currentPointIndex+"_Marker"+this.currentPointIndex)),o=this.focusChild(h),this.removeNavigationStyle(),this.setNavigationStyle(o),n=this.series[this.currentSeriesIndex].tooltip.visible?"ArrowMove":""}}else("Enter"===e.code||"Space"===e.code)&&-1<o.indexOf("_svg_Legend")&&(o=-1<o.indexOf("_svg_Legend")?r.children[1].id:o,n="Enter");return""!==n&&this.smithchartKeyboardNavigations(e,o,n),"Tab"===e.code&&this.setNavigationStyle(o),!1},XMe.prototype.smithchartKeyboardNavigations=function(e,t,i){switch(this.isLegendClicked=!1,i){case"Tab":case"ArrowMove":var n,o;-1<t.indexOf("_Points")&&(n=+t.split("_Series")[1].split("_Points")[0],o=+t.split("_Series")[1].split("_Marker")[0].split("_Points")[1],this.tooltipRenderModule)&&this.series[n].tooltip.visible&&this.tooltipRenderModule.createTooltip(this,e,o,n,this.series[n]);break;case"Enter":case"Space":-1<t.indexOf("_LegendItemText")&&(this.isLegendClicked=!0,this.delayRedraw=!0,this.smithchartOnClick(e),this.focusChild(document.getElementById(t).parentElement),this.setNavigationStyle(document.getElementById(t).parentElement.id));break;case"ESC":this.tooltipRenderModule.tooltipElement.fadeOut()}},XMe.prototype.setTabIndex=function(e,t){e&&e.removeAttribute("tabindex"),t&&t.setAttribute("tabindex","0")},XMe.prototype.getActualIndex=function(e,t){return t-1<e?0:e<0?t-1:e},XMe.prototype.focusChild=function(e){e.setAttribute("tabindex","0");var t=e.getAttribute("class");return e.setAttribute("tabindex","0"),t=t&&-1===t.indexOf("e-smith-chart-focused")?"e-smith-chart-focused "+t:t||"e-smith-chart-focused",e.setAttribute("class",t),e.focus(),e.id},XMe.prototype.smithchartOnResize=function(){var e=this;return this.animateSeries=!1,this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=+setTimeout(function(){e.render()},500),!1},XMe.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},XMe.prototype.removeSvg=function(){cDe(this.element.id+"_Secondary_Element");if(this.svgObject){for(;0<this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&ue(this.svgObject)}},oMe([e("Impedance")],XMe.prototype,"renderType",void 0),oMe([e("")],XMe.prototype,"width",void 0),oMe([e("")],XMe.prototype,"height",void 0),oMe([e("Material")],XMe.prototype,"theme",void 0),oMe([t({},TEe)],XMe.prototype,"margin",void 0),oMe([t({},AEe)],XMe.prototype,"font",void 0),oMe([t({},SEe)],XMe.prototype,"border",void 0),oMe([t({},VDe)],XMe.prototype,"title",void 0),oMe([kt([{}],JDe)],XMe.prototype,"series",void 0),oMe([t({},CEe)],XMe.prototype,"legendSettings",void 0),oMe([t({},bDe)],XMe.prototype,"horizontalAxis",void 0),oMe([t({},bDe)],XMe.prototype,"radialAxis",void 0),oMe([e(null)],XMe.prototype,"background",void 0),oMe([e(10)],XMe.prototype,"elementSpacing",void 0),oMe([e(1)],XMe.prototype,"radius",void 0),oMe([i()],XMe.prototype,"beforePrint",void 0),oMe([i()],XMe.prototype,"animationComplete",void 0),oMe([i()],XMe.prototype,"load",void 0),oMe([i()],XMe.prototype,"loaded",void 0),oMe([i()],XMe.prototype,"legendRender",void 0),oMe([i()],XMe.prototype,"titleRender",void 0),oMe([i()],XMe.prototype,"subtitleRender",void 0),oMe([i()],XMe.prototype,"textRender",void 0),oMe([i()],XMe.prototype,"axisLabelRender",void 0),oMe([i()],XMe.prototype,"seriesRender",void 0),oMe([i()],XMe.prototype,"tooltipRender",void 0),oMe([Bt],XMe));function XMe(e,t){e=YMe.call(this,e,t)||this;return e.isLegendClicked=!1,e.previousTargetId="",e.currentPointIndex=0,e.currentSeriesIndex=0,e.currentLegendIndex=0,e}JMe.prototype.smithchartMouseMove=function(e,t){var i,n;"touchend"===t.type||"touchmove"===t.type?(i=t.changedTouches[0].clientX,n=t.changedTouches[0].clientY,this.tooltipElement=void 0):(n=t.clientY,i=t.clientX),this.setMouseXY(e,i,n);for(var o=0;o<e.series.length;o++){var r,s=e.series[o],a=o;new QEe;if((r=this.closestPointXY(e,this.mouseX,this.mouseY,s,a)).location&&s.tooltip.visible&&"visible"===s.visibility){this.createTooltip(e,t,r.index,a,s);break}this.tooltipElement&&(this.tooltipElement.enable&&!s.tooltip.template&&(this.tooltipElement.enable=!1),this.tooltipElement.fadeOut())}return this.tooltipElement},JMe.prototype.setMouseXY=function(e,t,i){var n=document.getElementById(e.element.id+"_svg");e.element&&n&&(e=e.element.getBoundingClientRect(),n=n.getBoundingClientRect(),this.mouseX=t-e.left-Math.max(n.left-e.left,0),this.mouseY=i-e.top-Math.max(n.top-e.top,0))},JMe.prototype.createTooltip=function(n,e,t,o,r){function i(e){var t=n.series[o].marker.height/2,i=document.getElementById(n.element.id+"_smithchart_tooltip_div");je(i)&&(i=Q("div",{id:n.element.id+"_smithchart_tooltip_div",styles:"pointer-events: none; position: absolute;z-index:1;"}),document.getElementById(n.element.id+"_Secondary_Element").appendChild(i)),s.tooltipElement=new tr({enable:!0,header:e.headerText,content:e.text,border:r.tooltip.border,fill:r.tooltip.fill||n.themeStyle.tooltipFill,opacity:r.tooltip.opacity,data:a,template:e.template,location:{x:s.locationX+n.element.offsetLeft,y:s.locationY-t+n.element.offsetTop},shared:!1,areaBounds:new FEe(n.bounds.x,n.bounds.y,n.bounds.width,n.bounds.height),palette:[r.fill||n.seriesColors[o%n.seriesColors.length]],shapes:["Circle"],availableSize:n.availableSize,theme:n.theme}),s.tooltipElement.opacity=n.themeStyle.tooltipFillOpacity||s.tooltipElement.opacity,s.tooltipElement.textStyle.fontFamily=n.themeStyle.fontFamily||"Roboto, Segoe UI, Noto, Sans-serif",s.tooltipElement.textStyle.size=n.themeStyle.tooltipFontSize||"13px",s.tooltipElement.textStyle.color=n.themeStyle.tooltipBoldLabel||s.tooltipElement.textStyle.color,s.tooltipElement.appendTo(i),(e=document.getElementById(n.element.id+"_smithchart_tooltip_div_Trackball_0"))&&e.setAttribute("role","img")}var s=this,a=r.points[t],t=a.resistance,l=a.reactance,h=a.tooltip?[a.tooltip]:null,t=[t+" : "+(-1<n.theme.indexOf("Tailwind3")?l:"<b>"+l+"</b>")],l={cancel:!1,name:"tooltipRender",text:h||t,headerText:-1<n.theme.indexOf("Tailwind3")?r.name:"<b>"+r.name+"</b>",template:r.tooltip.template,point:a};i.bind(this,n),n.trigger("tooltipRender",l,i)},JMe.prototype.closestPointXY=function(e,t,i,n,o){for(var r,s,a=0;a<n.points.length;a++){r=e.seriesrender.getLocation(o,a),this.locationX=r.x,this.locationY=r.y;var l=a,h=t-r.x,d=i-r.y;if(Math.abs(Math.sqrt(h*h+d*d))<n.marker.width){s=r,l=a;break}}return{location:s,index:l}},JMe.prototype.getModuleName=function(){return"TooltipRender"},JMe.prototype.destroy=function(){};var KMe=JMe;function JMe(){}$Me.prototype.renderLegend=function(e){this._drawLegend(e)},$Me.prototype.calculateLegendBounds=function(e){this.legendSeries=[];var t,i,n=e.legendSettings,o=n.height,r=n.width,s=0<n.itemPadding?n.itemPadding:0,a=n.position.toLowerCase(),l=n.title.textStyle,h=0,d=0,p=0,c=e.availableSize.width-(4*e.elementSpacing-2*n.border.width+2*e.border.width),u=n.rowCount,n=n.columnCount,l=dDe(e.legendSettings.title.text,l,e.themeStyle.legendTitleFont),g=0,m=0,f=0,y=0,v=0,b=e.series.length;if(e.legendSettings.visible&&0!==b){"bottom"===a||"top"===a||"custom"===a?(u&&n&&u<=n||null==u&&null!=n?u=b/n:null==u&&null==n&&(u=1),u&&(t=Math.ceil(b/u))):(u&&n&&u<=n||null!=u&&null==n?n=b/u:null==u&&null==n&&(n=1),n&&(t=n));for(var w=0;w<b;w++){this.legendSeries.push({text:e.series[w].name||"series"+w,seriesIndex:w,shape:e.legendSettings.shape,fill:e.series[w].fill||e.seriesColors[w%e.seriesColors.length],bounds:null});var C=this._getLegendSize(e,this.legendSeries[w]),h=Math.max(C.width,h),d=Math.max(C.height,d);this.legendSeries[w].bounds={width:h,height:d},v+=1,f=f+h+s,y=Math.max(d,y),"top"!==a&&"bottom"!==a&&"custom"!==a||c<f&&(f-=C.width+s,g=Math.max(g,f),f=C.width+s,m=m+y+s),v!==t&&w!==b-1||(g=Math.max(g,f),p=m=m+y+s,f=y=v=0)}i={x:0,y:0,width:l.width>g-s?l.width+20+s:g+20-2*e.border.width,height:p+e.elementSpacing}}return this.legendActualBounds=i,null!=r&&(this.legendActualBounds.width=r),null!=o&&(this.legendActualBounds.height=o),this.legendActualBounds},$Me.prototype._getLegendSize=function(e,t){var i=e.legendSettings,n=i.itemStyle.width,o=i.itemStyle.height,t=dDe(t.text,i.textStyle,e.themeStyle.legendLabelFont);return{width:n+t.width+i.shapePadding,height:Math.max(o,t.height)}},$Me.prototype._drawLegend=function(e){var t,i,n=e.legendSettings,o=n.position.toLowerCase(),r=n.alignment,s=this.legendActualBounds,a=0,l=e.title.font||e.title.textStyle,l=dDe(e.title.text,l,e.themeStyle.legendLabelFont).height,h=dDe(e.title.subtitle.text,e.title.subtitle.textStyle,e.themeStyle.legendLabelFont).height,d=e.elementSpacing,p=l+h+d+e.margin.top,c=0<n.itemPadding?n.itemPadding:0,l=e.availableSize.width,h=e.availableSize.height,u=n.border.width,g=0,m=dDe(n.title.text,n.title.textStyle,e.themeStyle.legendLabelFont).height,f=e.border.width,y=l-2*f,v=h-2*f;if(s.height+=m,"custom"!==o){switch(o){case"bottom":s.y=v-(s.height+u+d);break;case"top":s.y=f+p;break;case"right":s.x=y-s.width-2*d;break;case"left":s.x=f+2*d}if("left"===o||"right"===o)switch(r){case"Center":s.y=v/2-(s.height+2*u)/2+d/2;break;case"Near":s.y=f+2*d+p;break;case"Far":s.y=v-(s.height+u)-2*d}else switch(r){case"Center":s.x=y/2-(s.width+2*u)/2+d/2;break;case"Near":s.x=f+2*d;break;case"Far":s.x=y-(s.width+u)-2*d}}else s.y=n.location.y<v?n.location.y:0,s.x=n.location.x<y?n.location.x:0;if("bottom"===o||"top"===o)for(var b=0;b<this.legendSeries.length;b++)if(y<(g+=this.legendSeries[b].bounds.width+c)){s.x=y/2-(s.width+2*u)/2+d/2;break}var w=e.renderer.createGroup({id:e.element.id+"_legend_group"}),C=(e.svgObject.appendChild(w),this.legendItemGroup=e.renderer.createGroup({id:e.element.id+"legendItem_Group"}),t=d),S=i=d;""!==n.title.text&&n.title.visible&&(w.appendChild(this.drawLegendTitle(e,n,s,w)),S=i=d+m);for(var A=0;A<this.legendSeries.length;A++)!(n.rowCount<n.columnCount||n.rowCount===n.columnCount)||"top"!==o&&"bottom"!==o&&"custom"!==o?(S+this.legendSeries[A].bounds.height+c+m+f>s.height+i&&(S=i,C+=a+c),this.legendGroup=this.drawLegendItem(e,n,this.legendSeries[A],A,C,S),w.appendChild(this.legendGroup),S+=this.legendSeries[A].bounds.height+c,a=Math.max(a,this.legendSeries[A].bounds.width)):(C+this.legendSeries[A].bounds.width>s.width+t&&(C=d,S+=this.legendSeries[A].bounds.height+c),this.legendGroup=this.drawLegendItem(e,n,this.legendSeries[A],A,C,S),w.appendChild(this.legendGroup),C+=this.legendSeries[A].bounds.width+c);w.setAttribute("transform","translate("+s.x.toString()+","+s.y.toString()+")"),this.drawLegendBorder(w,e,n,s)},$Me.prototype.drawLegendBorder=function(e,t,i,n){i=new rDe(t.element.id+"_svg_legendRect","none",i.border,1,new FEe(0,0,n.width,n.height));e.appendChild(t.renderer.drawRectangle(i))},$Me.prototype.drawLegendTitle=function(e,t,i,n){var o=e.elementSpacing,r=dDe(t.title.text,t.title.textStyle,e.themeStyle.legendLabelFont),s=r.width,r=r.height,a=t.title.textAlignment,l=0,h=i.width,i=o+r/2;switch(a){case"Far":l=h-s-l;break;case"Center":l=h/2-s/2}l<0&&(l=0,h=s),h<s+l&&(h=s+l);o=fDe(new pDe(e.element.id+"_LegendTitleText",l,i,"start",t.title.text),t.title.textStyle,t.title.textStyle.color||e.themeStyle.legendTitleFont.color,n,e.themeStyle.legendTitleFont);return o.setAttribute("aria-label",t.title.description||t.title.text),o},$Me.prototype.drawLegendItem=function(i,n,o,r,e,t){function s(e){var t;e.cancel||(t=a.drawLegendShape(i,o,d.x,d.y,r,n,e),p.appendChild(t),t=new pDe(i.element.id+"_LegendItemText"+r.toString(),d.x+l.width/2+n.shapePadding,d.y+h/4,"start",e.text),n.textStyle.fontFamily=n.textStyle.fontFamily||i.themeStyle.legendLabelFont.fontFamily,n.textStyle.size=n.textStyle.size||i.themeStyle.legendLabelFont.size,e=fDe(t,n.textStyle,n.textStyle.color||i.themeStyle.legendLabelFont.color,p,i.themeStyle.legendLabelFont),p.setAttribute("aria-label",n.description||"Show "+t.text),p.setAttribute("role","button"),p.appendChild(e),a.legendItemGroup.appendChild(p))}var a=this,l=n.itemStyle,h=dDe(o.text,n.textStyle,i.themeStyle.legendLabelFont).height,d={x:e+l.width/2,y:t+(h>l.height?h:l.height)/2},p=i.renderer.createGroup({id:i.element.id+"_svg_Legend"+r.toString()}),e=(p.style.cursor=n.toggleVisibility?"pointer":"default",p.setAttribute("tabindex",0===r?"0":""),{text:o.text,fill:o.fill,shape:o.shape,name:kMe,cancel:!1});return s.bind(this),i.trigger(kMe,e,s),this.legendItemGroup},$Me.prototype.drawLegendShape=function(e,t,i,n,o,r,s){var a,l,h,r=r.itemStyle,d=r.width,p=r.height,c=i+-d/2,u={color:r.border.color,width:r.border.width},g="visible"===e.series[o].visibility?s.fill:"grey",r=s.shape.toLowerCase(),m=Math.sqrt(p*p+d*d)/2;switch(r){case"circle":l=new lDe(e.element.id+"_svg_LegendItemShape"+o.toString(),g,u,1,i,n,m,null),a=e.renderer.drawCircle(l);break;case"rectangle":b="M "+c+" "+(n+-p/2)+" L "+(d/2+i)+" "+(n+-p/2)+" L "+(i+d/2)+" "+(n+p/2)+" L "+c+" "+(n+p/2)+" L "+c+" "+(n+-p/2)+" z",h=new oDe(e.element.id+"_svg_LegendItemShape"+o.toString(),g,u.width,u.color,1,"",b),a=e.renderer.drawPath(h);break;case"diamond":b="M "+c+" "+n+" L "+i+" "+(n+-p/2)+" L "+(d/2+i)+" "+n+" L "+i+" "+(n+p/2)+" L "+c+" "+n+" z",h=new oDe(e.element.id+"_svg_LegendItemShape"+o.toString(),g,u.width,u.color,1,"",b),a=e.renderer.drawPath(h);break;case"pentagon":for(var f=0;f<=5;f++)var y=m*Math.cos(Math.PI/180*(72*f)),v=m*Math.sin(Math.PI/180*(72*f)),b=0===f?"M "+(y+i)+" "+(n+v)+" ":b.concat("L "+(i+y)+" "+(n+v)+" ");b=b.concat("Z"),h=new oDe(e.element.id+"_svg_LegendItemShape"+o.toString(),g,u.width,u.color,1,"",b),a=e.renderer.drawPath(h);break;case"triangle":b="M "+c+" "+(p/2+n)+" L "+i+" "+(n+-p/2)+" L "+(i+d/2)+" "+(n+p/2)+" L "+c+" "+(n+p/2)+" Z",h=new oDe(e.element.id+"_svg_LegendItemShape"+o.toString(),g,u.width,u.color,1,"",b),a=e.renderer.drawPath(h)}return a},$Me.prototype.getModuleName=function(){return"SmithchartLegend"},$Me.prototype.destroy=function(){};var ZMe=$Me;function $Me(){this.legendSeries=[]}eke=function(e,t){return(eke=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])}))(e,t)};var eke,tke,ike=function(e,t){function i(){this.constructor=e}eke(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},nke=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},oke=(ike(rke,tke=n),nke([e("")],rke.prototype,"color",void 0),nke([e(0)],rke.prototype,"width",void 0),rke);function rke(){return null!==tke&&tke.apply(this,arguments)||this}ike(lke,ske=n),nke([e(null)],lke.prototype,"size",void 0),nke([e(null)],lke.prototype,"color",void 0),nke([e("Roboto, Segoe UI, Noto, Sans-serif")],lke.prototype,"fontFamily",void 0),nke([e(null)],lke.prototype,"fontWeight",void 0),nke([e(null)],lke.prototype,"fontStyle",void 0),nke([e(1)],lke.prototype,"opacity",void 0);var ske,ake=lke;function lke(){return null!==ske&&ske.apply(this,arguments)||this}ike(pke,hke=n),nke([e(!1)],pke.prototype,"visible",void 0),nke([e(null)],pke.prototype,"color",void 0),nke([e(1)],pke.prototype,"width",void 0);var hke,dke=pke;function pke(){return null!==hke&&hke.apply(this,arguments)||this}ike(gke,cke=n),nke([e(!1)],gke.prototype,"visible",void 0),nke([e("")],gke.prototype,"fill",void 0),nke([e("")],gke.prototype,"template",void 0),nke([e("")],gke.prototype,"format",void 0),nke([t({color:null,width:null},oke)],gke.prototype,"border",void 0),nke([t({size:"12px",fontWeight:null,fontStyle:"Normal",fontFamily:null},ake)],gke.prototype,"textStyle",void 0),nke([t({},dke)],gke.prototype,"trackLineSettings",void 0);var cke,uke=gke;function gke(){return null!==cke&&cke.apply(this,arguments)||this}ike(yke,mke=n),nke([e("transparent")],yke.prototype,"background",void 0),nke([t({},oke)],yke.prototype,"border",void 0);var mke,fke=yke;function yke(){return null!==mke&&mke.apply(this,arguments)||this}ike(wke,vke=n),nke([e(!1)],wke.prototype,"visible",void 0),nke([e(null)],wke.prototype,"color",void 0),nke([e("")],wke.prototype,"dashArray",void 0),nke([e(1)],wke.prototype,"width",void 0),nke([e(1)],wke.prototype,"opacity",void 0);var vke,bke=wke;function wke(){return null!==vke&&vke.apply(this,arguments)||this}ike(Ake,Cke=n),nke([e(null)],Ake.prototype,"startRange",void 0),nke([e(null)],Ake.prototype,"endRange",void 0),nke([e(null)],Ake.prototype,"color",void 0),nke([e(1)],Ake.prototype,"opacity",void 0);var Cke,Ske=Ake;function Ake(){return null!==Cke&&Cke.apply(this,arguments)||this}ike(Tke,xke=n),nke([e(null)],Tke.prototype,"minX",void 0),nke([e(null)],Tke.prototype,"maxX",void 0),nke([e(null)],Tke.prototype,"minY",void 0),nke([e(null)],Tke.prototype,"maxY",void 0),nke([e(0)],Tke.prototype,"value",void 0),nke([t({},bke)],Tke.prototype,"lineSettings",void 0);var xke,Ike=Tke;function Tke(){return null!==xke&&xke.apply(this,arguments)||this}ike(Mke,Eke=n),nke([e(5)],Mke.prototype,"left",void 0),nke([e(5)],Mke.prototype,"right",void 0),nke([e(5)],Mke.prototype,"bottom",void 0),nke([e(5)],Mke.prototype,"top",void 0);var Eke,Dke=Mke;function Mke(){return null!==Eke&&Eke.apply(this,arguments)||this}ike(Bke,kke=n),nke([e([])],Bke.prototype,"visible",void 0),nke([e(1)],Bke.prototype,"opacity",void 0),nke([e(8)],Bke.prototype,"size",void 0),nke([e("#00bdae")],Bke.prototype,"fill",void 0),nke([t({width:1},oke)],Bke.prototype,"border",void 0);var kke,Pke=Bke;function Bke(){return null!==kke&&kke.apply(this,arguments)||this}ike(Rke,Fke=n),nke([e(0)],Rke.prototype,"x",void 0),nke([e(0)],Rke.prototype,"y",void 0);var Fke,Lke=Rke;function Rke(){return null!==Fke&&Fke.apply(this,arguments)||this}ike(Nke,Oke=n),nke([e([])],Nke.prototype,"visible",void 0),nke([e(1)],Nke.prototype,"opacity",void 0),nke([e("transparent")],Nke.prototype,"fill",void 0),nke([e("")],Nke.prototype,"format",void 0),nke([t({color:"transparent",width:0},oke)],Nke.prototype,"border",void 0),nke([t({size:null,fontWeight:null,fontStyle:null,fontFamily:null},ake)],Nke.prototype,"textStyle",void 0),nke([t({},Lke)],Nke.prototype,"offset",void 0),nke([e("None")],Nke.prototype,"edgeLabelMode",void 0);var Oke,ike=Nke;function Nke(){return null!==Oke&&Oke.apply(this,arguments)||this}Vke=function(e,t){return(Vke=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])}))(e,t)};var Vke,nke=function(e,t){function i(){this.constructor=e}Vke(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},_ke=function(e,t){this.width=e,this.height=t};function Hke(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":t=["#79ECE4","#E98272","#DFE6B6","#C6E773","#BA98FF","#FA83C3","#00C27A","#43ACEF","#D681EF","#D8BC6E"];break;case"MaterialDark":t=["#9ECB08","#56AEFF","#C57AFF","#61EAA9","#EBBB3E","#F45C5C","#8A77FF","#63C7FF","#FF84B0","#F7C928"];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"Tailwind3":t=["#2F4074","#03B4B4","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];break;case"Tailwind3Dark":t=["#8029F1","#1ABC9C","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];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;case"Bootstrap5Dark":case"Bootstrap5":t=["#FD7E14","#6610F2","#6F42C1","#D63384","#DC3545","#FFC107","#198754","#0DCAF0"];break;case"FluentDark":case"Fluent":t=["#1AC9E6","#DA4CB2","#EDBB40","#AF4BCF","#FF7266","#1BD565","#EE993D","#5887FF","#EC548D","#7D39C0"];break;case"Fluent2":t=["#6200EE","#09AF74","#0076E5","#CB3587","#E7910F","#0364DE","#66CD15","#F3A93C","#107C10","#C19C00"];break;case"Fluent2Dark":case"Fluent2HighContrast":t=["#9BB449","#2A72D5","#43B786","#3F579A","#584EC6","#E85F9C","#6E7A89","#EA6266","#0B6A0B","#C19C00"];break;case"Material3":t=["#6355C7","#00AEE0","#FFB400","#F7523F","#963C70","#FD7400","#4BE0BC","#2196F5","#DE3D8A","#162F88"];break;case"Material3Dark":t=["#4EAAFF","#FA4EAB","#FFF500","#17EA58","#38FFE7","#FF9E45","#B3F32F","#B93CE4","#FC5664","#9B55FF"];break;default:t=["#00bdae","#404041","#357cd2","#e56590","#f8b883","#70ad47","#dd8abd","#7f84e8","#7bb4eb","#ea7a57"]}return t}function zke(e){var t;switch(e){case"BootstrapDark":case"FabricDark":case"MaterialDark":case"HighContrast":t={axisLineColor:"#ffffff",dataLabelColor:"BootstrapDark"===e?"#676767":"FabricDark"===e?"#A19F9D":"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"#969696",rangeBandColor:"#ffffff",tooltipFill:"BootstrapDark"===e?"#F0F0F0":"FabricDark"===e?"#A19F9D":"MaterialDark"===e?"#F4F4F4":"#FFFFFF",background:"#000000",tooltipFontColor:"BootstrapDark"===e?"#1A1A1A":"FabricDark"===e?"#DADADA":"MaterialDark"===e?"rgba(18, 18, 18, 1)":"#000000",trackerLineColor:"#ffffff",labelFontFamily:"BootstrapDark"===e?"Helvetica":"FabricDark"!==e&&"MaterialDark"===e?"Roboto":"Segoe UI",tooltipFontFamily:"BootstrapDark"===e?"Helvetica":"FabricDark"!==e&&"MaterialDark"===e?"Roboto":"Segoe UI",dataLabelFont:{fontFamily:"BootstrapDark"===e?"Helvetica":"FabricDark"!==e&&"MaterialDark"===e?"Roboto":"Segoe UI",color:"BootstrapDark"===e?"#676767":"FabricDark"===e?"#A19F9D":"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"#969696",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"400",tabColor:"BootstrapDark"===e?"#0070F0":"MaterialDark"===e?"#00B0FF":"FabricDark"===e?"#0074CC":"#FFD939"};break;case"Bootstrap4":t={axisLineColor:"#6C757D",dataLabelColor:"#495057",rangeBandColor:"#212529",tooltipFill:"#212529",background:"#FFFFFF",tooltipFontColor:"#F9FAFB",trackerLineColor:"#212529",fontFamily:"Helvetica",tooltipFillOpacity:1,tooltipTextOpacity:.9,labelFontFamily:"Helvetica",tooltipFontFamily:"Helvetica",dataLabelFont:{fontFamily:"Helvetica",color:"#495057",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"400",tabColor:"#007BFF"};break;case"Tailwind3":t={axisLineColor:"#4B5563",dataLabelColor:"#111827",rangeBandColor:"#1F2937",background:"#FFFFFF",tooltipFill:"#111827",tooltipFontColor:"#F9FAFB",trackerLineColor:"#1F2937",fontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Inter",tooltipFontFamily:"Inter",dataLabelFont:{fontFamily:"Inter",color:"#6B7280",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"500",tabColor:"#4F46E5"};break;case"Tailwind3Dark":t={axisLineColor:"#D1D5DB",dataLabelColor:"#FFFFFF",rangeBandColor:"#6B7280",background:"transparent",tooltipFill:"#F9FAFB",tooltipFontColor:"#1F2937",trackerLineColor:"#6B7280",fontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Inter",tooltipFontFamily:"Inter",dataLabelFont:{fontFamily:"Inter",color:"#FFFFFF",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"500",tabColor:"#22D3EE"};break;case"Tailwind":t={axisLineColor:"#4B5563",dataLabelColor:"#6B7280",rangeBandColor:"#212529",background:"#FFFFFF",tooltipFill:"#111827",tooltipFontColor:"#F9FAFB",trackerLineColor:"#1F2937",fontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Inter",tooltipFontFamily:"Inter",dataLabelFont:{fontFamily:"Inter",color:"#6B7280",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"400",tabColor:"#4F46E5"};break;case"TailwindDark":t={axisLineColor:"#D1D5DB",dataLabelColor:"#9CA3AF",rangeBandColor:"#F9FAFB",background:"transparent",tooltipFill:"#E9ECEF",tooltipFontColor:"#1F2937",trackerLineColor:"#9CA3AF",fontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Inter",tooltipFontFamily:"Inter",dataLabelFont:{fontFamily:"Inter",color:"#9CA3AF",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"400",tabColor:"#22D3EE"};break;case"Bootstrap5":t={axisLineColor:"#343A40",dataLabelColor:"#212529BF",rangeBandColor:"#343A40",background:"rgba(255, 255, 255, 0.0)",tooltipFill:"#000000E5",tooltipFontColor:"#FFFFFF",trackerLineColor:"#343A40",fontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Segoe UI",tooltipFontFamily:"Segoe UI",dataLabelFont:{fontFamily:"Segoe UI",color:"#495057",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"400",tabColor:"#0D6EFD"};break;case"Bootstrap5Dark":t={axisLineColor:"#ADB5BD",dataLabelColor:"#DEE2E6BF",rangeBandColor:"#ADB5BD",background:"rgba(255, 255, 255, 0.0)",tooltipFill:"#FFFFFFE5",tooltipFontColor:"#212529",trackerLineColor:"#ADB5BD",fontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Segoe UI",tooltipFontFamily:"Segoe UI",dataLabelFont:{fontFamily:"Segoe UI",color:"#E9ECEF",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"400",tabColor:"#0D6EFD"};break;case"Fluent":t={axisLineColor:"#D2D0CE;",dataLabelColor:"#3B3A39",rangeBandColor:"#A19F9D",background:"rgba(255, 255, 255, 0.0001)",tooltipFill:"#FFFFFF",tooltipFontColor:"#323130",trackerLineColor:"#A19F9D",fontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Segoe UI",tooltipFontFamily:"Segoe UI",dataLabelFont:{fontFamily:"Segoe UI",color:"#3B3A39",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"400",tabColor:"#0078D4"};break;case"FluentDark":t={axisLineColor:"#3B3A39;",dataLabelColor:"#D2D0CE",rangeBandColor:"#797775",background:"transparent",tooltipFill:"#323130",tooltipFontColor:"#F3F2F1",trackerLineColor:"#797775",fontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Segoe UI",tooltipFontFamily:"Segoe UI",dataLabelFont:{fontFamily:"Segoe UI",color:"#D2D0CE",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"400",tabColor:"#0078D4"};break;case"Fluent2":t={axisLineColor:"#D2D0CE",dataLabelColor:"#424242",rangeBandColor:"#A19F9D",background:"transparent",tooltipFill:"#FFFFFF",tooltipFontColor:"#242424",trackerLineColor:"#D2D0CE",fontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Segoe UI",tooltipFontFamily:"Segoe UI",dataLabelFont:{fontFamily:"Segoe UI",color:"#242424",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"400",tabColor:"#0078D4"};break;case"Fluent2Dark":t={axisLineColor:"#8A8886",dataLabelColor:"#D6D6D6",rangeBandColor:"#8A8886",background:"transparent",tooltipFill:"#292929",tooltipFontColor:"#FFFFFF",trackerLineColor:"#3B3A39",fontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Segoe UI",tooltipFontFamily:"Segoe UI",dataLabelFont:{fontFamily:"Segoe UI",color:"#D6D6D6",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"400",tabColor:"#0078D4"};break;case"Fluent2HighContrast":t={axisLineColor:"#8A8886",dataLabelColor:"#FFFFFF",rangeBandColor:"#8A8886",background:"transparent",tooltipFill:"#000000",tooltipFontColor:"#FFFFFF",trackerLineColor:"#3B3A39",fontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Segoe UI",tooltipFontFamily:"Segoe UI",dataLabelFont:{fontFamily:"Segoe UI",color:"#FFFFFF",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"400",tabColor:"#0078D4"};break;case"Material3":t={axisLineColor:"#C4C7C5",dataLabelColor:"#49454E",rangeBandColor:"rgba(73, 69, 78, 0.3)",background:"rgba(255, 255, 255, 0.0001)",tooltipFill:"#313033",tooltipFontColor:"#F4EFF4",trackerLineColor:"#49454E",fontFamily:"Roboto",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Roboto",tooltipFontFamily:"Roboto",dataLabelFont:{fontFamily:"Roboto",color:"#49454E",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"400",tabColor:"#49454E"};break;case"Material3Dark":t={axisLineColor:"#49454F",dataLabelColor:"#CAC4D0",rangeBandColor:"rgba(202, 196, 208, 0.3)",background:"transparent",tooltipFill:"#E6E1E5",tooltipFontColor:"#313033",trackerLineColor:"#CAC4D0",fontFamily:"Roboto",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Roboto",tooltipFontFamily:"Roboto",dataLabelFont:{fontFamily:"Roboto",color:"#CAC4D0",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"400",tabColor:"#CAC4D0"};break;default:t={axisLineColor:"#000000",dataLabelColor:"Bootstrap"===e?"#676767":"Fabric"===e?"#666666":"rgba(97, 97, 97, 1)",rangeBandColor:"#000000",background:"#FFFFFF",tooltipFill:"Bootstrap"===e?"#212529":"Fabric"===e?"#FFFFFF":"#000816",tooltipFontColor:"Bootstrap"===e?"#F9FAFB":"Fabric"===e?"#333333":"rgba(249, 250, 251, 1)",trackerLineColor:"#000000",labelFontFamily:"Bootstrap"===e?"Helvetica":"Fabric"===e?"Segoe UI":"Roboto",tooltipFontFamily:"Bootstrap"===e?"Helvetica":"Fabric"===e?"Segoe UI":"Roboto",dataLabelFont:{fontFamily:"Bootstrap"===e?"Helvetica":"Fabric"===e?"Segoe UI":"Roboto",color:"Bootstrap"===e?"#676767":"Fabric"===e?"#666666":"rgba(97, 97, 97, 1)",size:"12px",fontWeight:"400",fontStyle:"Medium"},tooltipFontWeight:"400",tabColor:"Material"===e?"#ff4081":"Fabric"===e?"#0078D6":"#317AB9"}}return t}function jke(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function Wke(e){var t,i,n;e.renderer=new fo(e.element.id),i=(t=e).element.clientWidth||(t.element.parentElement?t.element.parentElement.clientWidth||window.innerWidth:100),n=t.element.clientHeight||(t.element.parentElement?t.element.parentElement.clientHeight:50),t.availableSize=new _ke(jke(t.width,i)||i,jke(t.height,n)||n||(t.isDevice?Math.min(window.innerWidth,window.innerHeight):n)),e.svgObject=e.renderer.createSvg({id:e.element.id+"_svg",width:e.availableSize.width,height:e.availableSize.height})}var Qke,Uke=function(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n},qke=function(e,t,i,n,o,r,s){this.id=e,this.fill=t,this.opacity=o,this["stroke-width"]=i,this.stroke=n,this.d=s,this["stroke-dasharray"]=r},Gke=(nke(Yke,Qke=qke),Yke);function Yke(e,t,i,n,o,r,s,a,l){void 0===r&&(r=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===l&&(l=0);e=Qke.call(this,e,t,i.width,i.color,n)||this;return e.rect=o,e.topLeft=r,e.topRight=s,e.bottomLeft=a,e.bottomRight=l,e}nke(Jke,Xke=qke);var Xke,Kke=Jke;function Jke(e,t,i,n,o,r,s,a){e=Xke.call(this,e,t,i.width,i.color,n)||this;return e.cy=r,e.cx=o,e.r=s,e["stroke-dasharray"]=a,e}function Zke(e,t){return t&&t.appendChild(e),e}function $ke(e,t,i){var n,o,r,s,a;return t.d=(n=t.rect,o=t.topLeft,r=t.topRight,s=t.bottomLeft,a=t.bottomRight,"M "+n.x+" "+(o+n.y)+" Q "+n.x+" "+n.y+" "+(n.x+o)+" "+n.y+" L "+(n.x+n.width-r)+" "+n.y+" Q "+(n.x+n.width)+" "+n.y+" "+(n.x+n.width)+" "+(n.y+r)+" L "+(n.x+n.width)+" "+(n.y+n.height-a)+" Q "+(n.x+n.width)+" "+(n.y+n.height)+" "+(n.x+n.width-a)+" "+(n.y+n.height)+" L "+(n.x+s)+" "+(n.y+n.height)+" Q "+n.x+" "+(n.y+n.height)+" "+n.x+" "+(n.y+n.height-s)+" L "+n.x+" "+(o+n.y)+" Z"),Zke(e.renderer.drawPath(t),i)}function ePe(e,t,i){return Zke(e.renderer.drawPath(t),i)}function tPe(e,t,i){var n=document.getElementById("sparklinesmeasuretext");return null===n&&(n=Q("text",{id:"sparklinesmeasuretext"}),document.body.appendChild(n)),n.innerText=e,n.style.fontStyle=t.fontStyle||i.fontStyle,n.style.fontFamily=t.fontFamily||i.fontFamily,n.style.visibility="hidden",n.style.top="-100",n.style.left="0",n.style.position="absolute",n.style.fontSize=t.size||i.size,n.style.fontWeight=t.fontWeight||i.fontWeight,n.style.whiteSpace="nowrap",n.style.lineHeight="normal",new _ke(n.clientWidth,n.clientHeight)}var iPe=function(e,t,i,n,o,r,s){void 0===s&&(s=""),this.transform="",this.baseLine="auto",this.id=e,this.x=t,this.y=i,this.anchor=n,this.text=o,this.transform=s,this.baseLine=r};function nPe(e){e=document.getElementById(e);e&&ue(e)}function oPe(e){return document.getElementById(e)}function rPe(e,t,i){return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height}aPe.prototype.processData=function(){var e=this.sparkline.dataSource;!je(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())},aPe.prototype.processDataManager=function(){var e,t,i=this;this.sparkline.dataSource instanceof me?(e=this.sparkline.dataSource,t=this.sparkline.query instanceof ya?this.sparkline.query:new ya,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()},aPe.prototype.processCategory=function(e,i,n){var o=this,r=(void 0===e&&(e=this.sparkline.dataSource),void 0===i&&(i=this.sparkline.xName),void 0===n&&(n=this.sparkline.yName),[]),s=[];e.forEach(function(e){-1===s.indexOf(e[i])&&s.push(e[i]);var t={};t[o.sparkline.xName]=s.indexOf(e[i]),t[o.sparkline.yName]=e[n],r.push(t)}),this.sparkline.sparklineData=r},aPe.prototype.processDateTime=function(e,i,n){void 0===e&&(e=this.sparkline.dataSource),void 0===i&&(i=this.sparkline.xName),void 0===n&&(n=this.sparkline.yName);var o=[];e.forEach(function(e){var t={};t[i]=e[i].getTime(),t[n]=e[n],o.push(t)}),this.sparkline.sparklineData=o},aPe.prototype.renderSeries=function(){function e(e){if(n.visiblePoints&&!e.cancel){if("Pie"!==o.type&&"WinLoss"!==o.type&&o.rangeBandSettings.length){for(var t=n.sparkline.renderer.createGroup({id:n.sparkline.element.id+"_sparkline_rangeband_g"}),i=0;i<o.rangeBandSettings.length;i++)(o.axisSettings.minY<=o.rangeBandSettings[i].startRange||o.axisSettings.maxY>=o.rangeBandSettings[i].endRange)&&n.rangeBand(o.rangeBandSettings[i],t,i);n.sparkline.svgObject.appendChild(t)}n["render"+o.type](n.visiblePoints,e),n.renderMarker(n.visiblePoints),n.renderLabel(n.visiblePoints)}}var n=this,o=this.sparkline,t=(this.clipId=o.element.id+"_sparkline_clip_path",this.drawAxis(),{name:"seriesRendering",cancel:!1,lineWidth:o.lineWidth,border:o.border,fill:o.fill,sparkline:o});e.bind(this),o.trigger("seriesRendering",t,e)},aPe.prototype.rangeBand=function(e,t,i){var n=this.sparkline,o=n.availableSize.height-2*n.padding.top,r=n.availableSize.width-2*n.padding.left,s=e.startRange,a=e.endRange,s=o-o/this.unitY*(s-this.min)+n.padding.top,a=o-o/this.unitY*(a-this.min)+n.padding.top,l=e.color||this.sparkline.sparkTheme.rangeBandColor,o=(a>o+n.padding.top?a=o+n.padding.top:a<0+n.padding.top&&(a=0+n.padding.top),s>o+n.padding.top?s=o+n.padding.top:s<0+n.padding.top&&(s=0+n.padding.top),"M "+n.padding.left+" "+s+" L "+(r+n.padding.left)+" "+s+" L "+(r+n.padding.left)+" "+a+" L "+n.padding.left+" "+a+" Z "),s={id:n.element.id+"_rangeBand_"+i,fill:l,opacity:e.opacity,stroke:"transparent","stroke-width":n.lineWidth,d:o,"stroke-dasharray":""};ePe(this.sparkline,s,t)},aPe.prototype.renderLine=function(e,t){for(var i=this.sparkline,n=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,t=new qke(i.element.id+"_sparkline_line","transparent",t.lineWidth,o,i.opacity),r="",s=0,a=e.length;s<a;s++)0===s&&(r="M "+e[0].x+" "+e[s].y+" "),r+="L "+e[s].x+" "+e[s].y+" ";t.d=r,t["aria-label"]="Line series with"+e.length+"data points",t.tabindex="0",ePe(this.sparkline,t,n),this.sparkline.svgObject.appendChild(n)},aPe.prototype.renderPie=function(e,t){var i,n,o,r,s=this.sparkline,a=s.availableSize.height-(s.padding.top+s.padding.bottom),l=s.availableSize.width-(s.padding.left+s.padding.right),h=a<=l?a/2:l/2,d=s.availableSize.width/2,p=s.availableSize.height/2,c=0,u=t.border.color,g=s.opacity,m=t.border.width,f=s.palette.length?s.palette:Hke(this.sparkline.theme),y=this.sparkline.renderer.createGroup({id:s.element.id+"_sparkline_g"}),a=Pe([],[],e);(s.highPointColor||s.lowPointColor)&&(l=a.map(function(e){return e.yVal}),o=Math.min.apply(null,l),r=Math.max.apply(null,l)),this.negativePointIndexes=[];for(var v=0,b=90;v<e.length;v++){b+=c,c=360===(c=e[v].degree)?c-.001:c,i=(b-90)*Math.PI/180,n=(b+c-90)*Math.PI/180,e[v].stAng=i,e[v].endAng=n;var w=c<180?"0":"1",C=e[v].coordinates={sX:d+h*Math.cos(i),sY:p+h*Math.sin(i),eX:d+h*Math.cos(n),eY:p+h*Math.sin(n)},w={id:s.element.id+"_sparkline_pie_"+v,opacity:g,fill:f[v%f.length],stroke:u,"stroke-width":m,d:"M "+d+" "+p+" L "+C.eX+" "+C.eY+" A "+h+" "+h+" 0 "+w+",0 "+C.sX+" "+C.sY+" Z","stroke-dasharray":""},C=(this.getPieSpecialPoint(e[v],s,w,v,r,o,e.length),this.triggerPointRender("pointRendering",v,w.fill,{color:u,width:m})),w=(w.fill=C.fill,w.stroke=C.border.color,w["stroke-width"]=C.border.width,C.cancel||((C=ePe(this.sparkline,w,y)).setAttribute("role","img"),C.setAttribute("aria-label",s.dataSource[v][s.xName]+" : "+e[v].yVal),C.setAttribute("tabindex",0===v?"0":"-1"),C.style.outline="none"),n-i),C={x:d+h/2*Math.cos(i+w/2),y:p+h/2*Math.sin(i+w/2)};e[v].location.x=C.x,e[v].location.y=C.y}this.sparkline.svgObject.appendChild(y)},aPe.prototype.getPieSpecialPoint=function(e,t,i,n,o,r,s){e.yVal<0&&t.negativePointColor&&(i.fill=t.negativePointColor,this.negativePointIndexes.push(n)),0===n&&t.startPointColor?(i.fill=t.startPointColor,this.startPointIndex=n):n===s-1&&t.endPointColor&&(i.fill=t.endPointColor,this.endPointIndex=n),e.yVal===o&&t.highPointColor?(i.fill=t.highPointColor,this.highPointIndex=n):e.yVal===r&&t.lowPointColor&&(i.fill=t.lowPointColor,this.lowPointIndex=n)},aPe.prototype.renderArea=function(e,t){for(var i=this.sparkline,n=this.sparkline.renderer.createGroup({id:i.element.id+"_sparkline_g","clip-path":"url(#"+this.clipId+")"}),o=new qke(i.element.id+"_sparkline_area",t.fill,0,"transparent",i.opacity),r="",s="",a=0,l=e.length;a<l;a++)0!==a?s+="L "+e[a].x+" "+e[a].y+" ":(r="M "+e[a].x+" "+this.axisHeight+" ",s="M "+e[a].x+" "+e[a].y+" "),r+="L "+e[a].x+" "+e[a].y+" ",a===l-1&&(r+="L "+e[a].x+" "+this.axisHeight+" Z");o.d=r,o["aria-label"]="Area series with"+e.length+"data points",ePe(this.sparkline,o,n),o=new qke(i.element.id+"_sparkline_area_str","transparent",t.border.width,t.border.color,i.opacity,"",s),ePe(this.sparkline,o,n),this.sparkline.svgObject.appendChild(n)},aPe.prototype.renderColumn=function(n,e){for(var o,r,s,a=this,l=this.sparkline,t=Pe([],[],n),h=this.sparkline.renderer.createGroup({id:l.element.id+"_sparkline_g","clip-path":"url(#"+this.clipId+")"}),d=((this.sparkline.highPointColor||this.sparkline.lowPointColor)&&(t=t.map(function(e){return e.markerPosition}),o=Math.min.apply(null,t),r=Math.max.apply(null,t)),l.element.id+"_sparkline_column_"),p=new Gke(d,"",e.border,l.opacity,null),c=n.length,u=(this.negativePointIndexes=[],l.palette.length?l.palette:Hke(this.sparkline.theme)),g=this,i=0;i<c;i++)!function(t){s=n[t],p.id=d+t,p.fill="#00bdae"!==l.fill?l.fill:u[0],p.rect=new Uke(s.x,s.y,s.width,s.height),g.getSpecialPoint(!0,s,l,p,t,o,r,c),s.location.y=s.markerPosition<=g.axisHeight?s.y:s.y+s.height,s.location.x=s.x+s.width/2,p.stroke=e.border.color||p.fill;var i={name:"pointRendering",cancel:!1,pointIndex:t,fill:p.fill,border:{color:p.stroke,width:e.border.width}};g.sparkline.trigger("pointRendering",i,function(){var e;s=n[t],p.id=d+t,p.rect=new Uke(s.x,s.y,s.width,s.height),a.getSpecialPoint(!0,s,l,p,t,o,r,c),p.fill=i.fill,p.stroke=i.border.color,s.location.y=s.markerPosition<=a.axisHeight?s.y:s.y+s.height,p["stroke-width"]=i.border.width,s.location.x=s.x+s.width/2,i.cancel||((e=$ke(l,p,h)).setAttribute("role","img"),e.setAttribute("aria-label",l.dataSource[t][l.xName]+" : "+n[t].yVal),e.setAttribute("tabindex",0===t?"0":"-1"),e.style.outline="none",h.appendChild(e))})}(i);this.sparkline.svgObject.appendChild(h)},aPe.prototype.renderWinLoss=function(e,t){for(var i=this.sparkline,n=this.sparkline.renderer.createGroup({id:i.element.id+"_sparkline_g","clip-path":"url(#"+this.clipId+")"}),o=i.element.id+"_sparkline_winloss_",r=new Gke(o,"",t.border,i.opacity,null),s=e.length,a=i.palette.length,l=i.palette.length?i.palette:Hke(this.sparkline.theme),h=0;h<s;h++){d=e[h],r.id=o+h,r.fill=a?i.palette[h%a]:d.yVal===this.axisValue?this.sparkline.tiePointColor||"#a216f3":d.yVal>this.axisValue?t.fill||l[h%l.length]:i.negativePointColor||"#e20f07",r.stroke=t.border.color||r.fill,r.rect=new Uke(d.x,d.y,d.width,d.height),d.location.x=d.x+d.width/2,d.location.y=d.yVal>=this.axisValue?d.y:d.y+d.height;var d=this.triggerPointRender("pointRendering",h,r.fill,{color:r.stroke,width:t.border.width});r.fill=d.fill,r.stroke=d.border.color,r["stroke-width"]=d.border.width,d.cancel||((d=$ke(i,r,n)).setAttribute("role","img"),d.setAttribute("aria-label",i.dataSource[h][i.xName]+" : "+e[h].yVal),d.setAttribute("tabindex",0===h?"0":"-1"),d.style.outline="none")}this.sparkline.svgObject.appendChild(n)},aPe.prototype.renderMarker=function(o){var r=this,s=this.sparkline,a=s.markerSettings;if("Pie"!==s.type&&"WinLoss"!==s.type&&a.visible.length){for(var l,h,d,e=Pe([],[],o),p=this.sparkline.renderer.createGroup({id:s.element.id+"_sparkline_marker_g","clip-path":"url(#"+this.clipId+")"}),c=s.element.id+"_sparkline_marker_",u=new Kke("",a.fill,a.border,a.opacity,0,0,a.size/2,""),g=a.visible.join(),t=((-1<g.toLowerCase().indexOf("high")||-1<g.toLowerCase().indexOf("low"))&&(e=e.map(function(e){return e.markerPosition}),h=Math.min.apply(null,e),d=Math.max.apply(null,e)),this.negativePointIndexes=[],function(t,e){l=o[t],u.id=c+t,u.cx=l.location.x,u.cy=l.location.y,u.fill=a.fill;var i=-1<g.toLowerCase().indexOf("all"),i=m.getSpecialPoint(i,l,s,u,t,h,d,e,g.toLowerCase()),n=(u.stroke=a.border.color||u.fill,{name:"markerRendering",cancel:!1,border:{color:u.stroke,width:a.border.width},fill:u.fill,pointIndex:t,sparkline:m.sparkline,x:u.cx,y:u.cy,size:a.size});m.sparkline.trigger("markerRendering",n,function(){var e;i&&!n.cancel&&(u.id=c+t,u.cx=n.x,u.cy=n.y,u.fill=n.fill,u.stroke=n.border.color,u["stroke-width"]=n.border.width,u.r=n.size/2,e=p,(e=Zke(s.renderer.drawCircle(u),e)).setAttribute("role","img"),e.setAttribute("aria-label",s.dataSource[t][s.xName]+" : "+o[t].yVal),(-1<r.sparkline.type.indexOf("Line")||-1<r.sparkline.type.indexOf("Area"))&&(e.setAttribute("tabindex",0===t?"0":"-1"),e.style.outline="none"),p.appendChild(e))})}),m=this,i=0,n=o.length;i<n;i++)t(i,n);this.sparkline.svgObject.appendChild(p)}},aPe.prototype.getSpecialPoint=function(e,t,i,n,o,r,s,a,l){return void 0===l&&(l=""),t.markerPosition>this.axisHeight&&(n.fill=i.negativePointColor||n.fill,this.negativePointIndexes.push(o),e=e||-1<l.indexOf("negative")),0===o?(n.fill=i.startPointColor||n.fill,this.startPointIndex=o,e=e||-1<l.indexOf("start")):o===a-1&&(n.fill=i.endPointColor||n.fill,this.endPointIndex=o,e=e||-1<l.indexOf("end")),t.markerPosition===r?(n.fill=i.highPointColor||n.fill,this.highPointIndex=o,e=e||-1<l.indexOf("high")):t.markerPosition===s&&(n.fill=i.lowPointColor||n.fill,this.lowPointIndex=o,e=e||-1<l.indexOf("low")),e=-1<l.indexOf("none")?!1:e},aPe.prototype.renderLabel=function(e){var l=this,h=this.sparkline,d=h.dataLabelSettings,t=d.textStyle.color||h.sparkTheme.dataLabelColor;if("WinLoss"!==h.type&&d.visible.length){for(var p,c,i=Pe([],[],e),u=h.element.id+"_sparkline_label_",g=this.sparkline.renderer.createGroup({id:h.element.id+"_sparkline_label_g",style:"pointer-events: none;"}),n=(g.setAttribute("aria-hidden","true"),u+"text_"),m=u+"rect_",f=new iPe("",0,0,"middle","","middle"),y=d.textStyle,i=i.map(function(e){return e.markerPosition}),v=Math.min.apply(null,i),b=Math.max.apply(null,i),o=1,w="transparent"!==d.fill||d.border.width?2:0,C=tPe("sparkline_measure_text",y,this.sparkline.sparkTheme.dataLabelFont),S=new Gke("",d.fill,d.border,d.opacity,null),r=function(r,s){p=e[r],f.id=n+r,f.x=p.location.x+d.offset.x,f.y=("Pie"===h.type?p.location.y:p.markerPosition>A.axisHeight?p.location.y+C.height/2+o+2+w:p.location.y-C.height/2-o-w)+d.offset.y,f.text=""!==d.format?A.formatter(d.format,A.sparkline.dataSource[r]):p.yVal.toString();var a={name:"dataLabelRendering",cancel:!1,border:d.border,fill:d.fill,pointIndex:r,sparkline:A.sparkline,x:f.x,y:f.y,text:f.text,color:t};A.sparkline.trigger("dataLabelRendering",a,function(){C=tPe(a.text,y,l.sparkline.sparkTheme.dataLabelFont),f.text=a.text;var e,t,i,n,o=-1<d.visible.join().toLowerCase().indexOf("all"),o=l.getLabelVisible(o,p,r,d,s,v,b);c=l.arrangeLabelPosition(d.edgeLabelMode,o,a.x,r,s,C,w),o&&!a.cancel&&c.render&&(S.id=m+r,S.fill=a.fill,S.stroke=a.border.color,S["stroke-width"]=a.border.width,f.y=a.y,f.x=c.x,S.rect=new Uke(f.x-(C.width/2+w),f.y-w-C.height/1.75,C.width+2*w,C.height+2*w),c=l.sparkline.renderer.createGroup({id:u+"g"+r}),$ke(h,S,c),o=f,e=y,t=a.color,i=c,n=l.sparkline.sparkTheme.dataLabelFont,t={id:o.id,x:o.x,y:o.y,transform:o.transform,opacity:e.opacity,fill:t,"font-family":e.fontFamily||n.fontFamily,"font-weight":e.fontWeight||n.fontWeight,"font-size":e.size||n.size,"font-style":e.fontStyle||n.fontStyle,"text-anchor":o.anchor,"dominant-baseline":o.baseLine},(e=new fo("").createText(t,o.text)).style["user-select"]="none",e.style["-moz-user-select"]="none",e.style["-webkit-touch-callout"]="none",e.style["-webkit-user-select"]="none",e.style["-khtml-user-select"]="none",e.style["-ms-user-select"]="none",e.style["-o-user-select"]="none",i.appendChild(e),g.appendChild(c))})},A=this,s=0,a=e.length;s<a;s++)r(s,a);this.sparkline.svgObject.appendChild(g)}},aPe.prototype.arrangeLabelPosition=function(e,t,i,n,o,r,s){return"None"!==e&&(0===n&&i-r.width/2-s<=0?"Hide"===e?t=!1:i=this.sparkline.padding.left+s+r.width/2:n===o-1&&i+r.width/2+s>=this.sparkline.availableSize.width&&("Hide"===e?t=!1:i-=r.width/2+s)),{x:i,render:t}},aPe.prototype.getLabelVisible=function(e,t,i,n,o,r,s){var a=n.visible.join().toLowerCase();return t.markerPosition>this.axisHeight&&(e=e||-1<a.indexOf("negative")),0===i?e=e||-1<a.indexOf("start"):i===o-1&&(e=e||-1<a.indexOf("end")),t.markerPosition===r?e=e||-1<a.indexOf("high"):t.markerPosition===s&&(e=e||-1<a.indexOf("low")),e=-1<n.visible.join().toLowerCase().indexOf("none")?!1:e},aPe.prototype.formatter=function(e,t){if(je(e))return null;for(var i=0,n=Object.keys(t);i<n.length;i++){var o=n[i];e=e.split("${"+o+"}").join(t[o])}return e},aPe.prototype.axisCalculation=function(){this.findRanges(this.sparkline.sparklineData)},aPe.prototype.getInterval=function(e,i){var t,n=1,o=e[0][i],r=je(e[1])?void 0:e[1][i];return je(o)||je(r)||(o=Pe([],e),t=[],o.forEach(function(e){je(e[i])||t.push(e)}),t.sort(function(e,t){return je(e[i])||je(t[i])?0:e[i]-t[i]}),n=(t=this.sparkline.enableRtl?t.reverse():t)[1][i]-t[0][i]),n},aPe.prototype.getPaddingInterval=function(e,t,i,n){for(var o=this.sparkline.availableSize.height,r=+e.length,s=n/(r=Math.max(o*(r/100),1)),a=0,l=this.sparkline.intervalDivs;a<l.length;a++){var h=+l[a];if(r<n/h)break;s=h}return s},aPe.prototype.findRanges=function(e){var t,i,n,o,r,s,a=this.sparkline,l=e.length,h=0,d=Array.isArray(e)&&"object"!=typeof e[0];if(d)if("Pie"===a.type)for(var p=0;p<l;p++)h+=Math.abs(e[p]);else n=Math.max.apply(null,e),o=Math.min.apply(null,e),t=0,i=l-1;else if("Pie"===a.type)for(p=0;p<l;p++)h+=Math.abs(e[p][a.yName]);else o=je(e[0][a.xName])?(m=e.map(function(e){return e[a.yName]}),n=Math.max.apply(null,m),Math.min.apply(null,m)):(n=(y=(y=Pe([],e)).sort(function(e,t){return e[a.yName]-t[a.yName]}))[y.length-1][a.yName],y[0][a.yName]),je(e[0][a.xName])?(t=0,i=l-1):(y=y.sort(function(e,t){return e[a.xName]-t[a.xName]}),i=(y=this.sparkline.enableRtl?y.reverse():y)[y.length-1][a.xName],t=y[0][a.xName]);var c,u=0,g=a.padding,m=a.axisSettings,f=m.value;if("Pie"!==a.type){this.maxLength=l,r=a.availableSize.height-(g.bottom+g.top),s=a.availableSize.width-(g.left+g.right),i=je(m.maxX)?i:m.maxX,t=je(m.minX)?t:m.minX,n=je(m.maxY)?n:m.maxY,o=je(m.minY)?o:m.minY;var y=m.lineSettings.color||this.sparkline.sparkTheme.axisLineColor,y={name:"axisRendering",cancel:!1,sparkline:a,maxX:i,minX:t,maxY:n,minY:o,value:m.value,lineColor:y,lineWidth:m.lineSettings.width};if(a.trigger("axisRendering",y),y.cancel)return void(this.visiblePoints=[]);i=y.maxX,t=y.minX,n=y.maxY,o=y.minY,f=this.axisValue=y.value,this.axisColor=y.lineColor,this.axisWidth=y.lineWidth}var v,b=i-t,w=0==(w=n-o)?1:w;this.unitX=0==b?1:b,c=r-r/(this.unitY=w)*-(this.min=o),c=o<(u=0)&&n<=0?0:o<0&&0<n?c:r,o<=f&&f<=n&&(c=r-Math.round(r*((f-o)/this.unitY))),this.axisHeight=c+g.top;for(var C=[],m=n-o,S=this.getInterval(e,a.xName),A=this.getPaddingInterval(e,a.xName,a.valueType,m),p=0;p<l;p++){var x,I,T,E,D=je(e[p][a.xName])&&je(e[p][a.yName])&&0!==e[p][a.yName]&&d?e[v=p]:(je(e[p][a.xName])?e[v=p]:(v=e[p][a.xName],e[p]))[a.yName];je(v)||je(D)||("Line"===a.type||"Area"===a.type?(I=o!==n&&1!==l?r-Math.round(r*((D-o)/this.unitY)):g.top,T={x:t!==i?Math.round(s*((v-t)/this.unitX)):s/2,y:I,markerPosition:I}):"Column"===a.type||"WinLoss"===a.type?(x=s/((i-t)/S+1),u=(v-t)/S*(1+--x)+.5,T="WinLoss"===a.type?{x:u,y:I=f<D?r/4:D<f?.5*r:.5*r-r/40,height:D!==f?r/4:r/20,width:x,markerPosition:c<I?c+Math.abs(I-c):I}:(0===p&&"None"!==a.rangePadding&&(o-="Additional"===a.rangePadding?A+g.top:A,w=0==(w=(n+="Additional"===a.rangePadding?A+g.top:A)-o)?1:w,this.unitX=0==(b=i-t)?1:b,this.unitY=w,this.min=o),E=r/this.unitY*(D-o),E=D===o&&f<D?1!==l&&1!==this.unitY?r/this.unitY*(o/2):1|E:D===n&&D<f&&1!==l&&1!==this.unitY?r/this.unitY*(-n/2):E,{x:u,y:c<(I=Math.abs(r-E))?c:I,height:Math.abs(I-c),width:x,markerPosition:c<I?c+Math.abs(I-c):I})):"Pie"===a.type&&(T={percent:Math.abs(D)/h*100,degree:Math.abs(D)/h*360}),"Pie"!==a.type&&(T.x+=g.left,T.y+=g.top),"WinLoss"!==a.type&&(T.markerPosition+=g.top),T.location={x:T.x,y:T.y},T.xVal=v,T.yVal=D,C.push(T))}C.sort(function(e,t){return e.x-t.x}),this.visiblePoints=C},aPe.prototype.drawAxis=function(){var e=this.sparkline,t=this.axisHeight;"WinLoss"!==e.type&&"Pie"!==e.type&&e.axisSettings.lineSettings.visible&&(t={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(t)))},aPe.prototype.triggerPointRender=function(e,t,i,n){n={name:e,cancel:!1,border:n,fill:i,sparkline:this.sparkline,pointIndex:t};return this.sparkline.trigger(e,n),n};var sPe=aPe;function aPe(e){this.sparkline=e}lPe=function(e,t){return(lPe=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])}))(e,t)};var lPe,hPe,nke=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},nke=(function(e,t){function i(){this.constructor=e}lPe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(dPe,hPe=Ji),dPe.prototype.preRender=function(){this.allowServerDataBinding=!1,this.unWireEvents(),this.trigger("load",{sparkline:this}),this.sparkTheme=zke(this.theme),this.sparklineRenderer=new sPe(this),this.setTheme(),this.createSVG(),this.wireEvents(),this.setCulture()},dPe.prototype.render=function(){this.sparklineRenderer.processDataManager(),this.renderComplete(),this.allowServerDataBinding=!0},dPe.prototype.processSparklineData=function(){this.sparklineRenderer.processData(),this.renderSparkline(),this.element.appendChild(this.svgObject),this.setSecondaryElementPosition(),this.trigger("loaded",{sparkline:this})},dPe.prototype.renderSparkline=function(){this.renderBorder(),this.createDiv(),this.sparklineRenderer.renderSeries()},dPe.prototype.createDiv=function(){var e=document.createElement("div");e.id=this.element.id+"_Secondary_Element",e.style.position="relative",this.element.appendChild(e),this.element.setAttribute("tabindex","0"),this.element.style.outline="none",this.element.style.display="block",this.element.style.position="relative"},dPe.prototype.setSecondaryElementPosition=function(){var e,t,i=oPe(this.element.id+"_Secondary_Element");i&&(e=this.element.getBoundingClientRect(),t=oPe(this.element.id+"_svg").getBoundingClientRect(),i.style.left=Math.max(t.left-e.left,0)+"px",i.style.top=Math.max(t.top-e.top,0)+"px")},dPe.prototype.renderBorder=function(){var e,t=this.containerArea.border.width,t=((0<t||"transparent"!==this.containerArea.background)&&(e=new Gke(this.element.id+"_SparklineBorder",this.sparkTheme.background,this.containerArea.border,1,new Uke(t/2,t/2,this.availableSize.width-t,this.availableSize.height-t)),this.svgObject.appendChild($ke(this,e))),this.padding),t=(this.markerSettings.visible.length&&(t.left=0,t.right=0,t.bottom=0,t.top=0),e=new Gke(this.element.id+"_sparkline_clip_rect","transparent",{color:"transparent",width:0},1,new Uke(t.left,t.top,this.availableSize.width-(t.left+t.right),this.availableSize.height-(t.top+t.bottom))),this.renderer.createClipPath({id:this.element.id+"_sparkline_clip_path"}));$ke(this,e,t),this.svgObject.appendChild(t)},dPe.prototype.createSVG=function(){this.removeSvg(),Wke(this)},dPe.prototype.removeSvg=function(){if(this.svgObject){for(;0<this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&ue(this.svgObject)}nPe(this.element.id+"_Secondary_Element"),this.sparklineTooltipModule&&this.sparklineTooltipModule.removeTooltipElements()},dPe.prototype.setCulture=function(){this.intl=new Ti,this.localeObject=new Cn(this.getModuleName(),this.defaultLocalConstants,this.locale)},dPe.prototype.setTheme=function(){this.sparkTheme=zke(this.theme)},dPe.prototype.requiredModules=function(){var e=[];return(this.tooltipSettings.visible||this.tooltipSettings.trackLineSettings.visible)&&e.push({member:"SparklineTooltip",args:[this]}),e},dPe.prototype.unWireEvents=function(){var e=F.isPointer?"pointerleave":"mouseleave";E.remove(this.element,F.touchMoveEvent,this.sparklineMove),E.remove(this.element,e,this.sparklineMouseLeave),E.remove(this.element,F.touchEndEvent,this.sparklineMouseEnd),E.remove(this.element,"keyup",this.chartKeyUp),E.remove(this.element,"keydown",this.chartKeyDown),window.removeEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.sparklineResize)},dPe.prototype.wireEvents=function(){var e=F.isPointer?"pointerleave":"mouseleave";E.add(this.element,F.touchMoveEvent,this.sparklineMove,this),E.add(this.element,"click",this.sparklineClick,this),E.add(this.element,e,this.sparklineMouseLeave,this),E.add(this.element,F.touchEndEvent,this.sparklineMouseEnd,this),E.add(this.element,"keyup",this.chartKeyUp,this),E.add(this.element,"keydown",this.chartKeyDown,this),window.addEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.sparklineResize.bind(this)),new Mn(this.element)},dPe.prototype.sparklineResize=function(){var e=this,t={name:"resize",previousSize:this.availableSize,sparkline:this,currentSize:new _ke(0,0)};return this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=+setTimeout(function(){e.isDestroyed?clearTimeout(e.resizeTo):(e.unWireEvents(),e.createSVG(),e.refreshing=!0,e.wireEvents(),t.currentSize=e.availableSize,e.trigger("resize",t),e.render(),e.refreshing=!1)},500),!1},dPe.prototype.sparklineMove=function(e){this.setSparklineMouseXY(e),this.notify(F.touchMoveEvent,e);var t={name:"sparklineMouseMove",cancel:!1,sparkline:this,event:e},t=(this.trigger(t.name,t),this.isPointRegion(e));return t.isPointRegion&&(e={name:"pointRegionMouseMove",cancel:!1,event:e,sparkline:this,pointIndex:t.pointIndex},this.trigger(e.name,e)),!1},dPe.prototype.sparklineClick=function(e){this.setSparklineMouseXY(e);var t={name:"sparklineMouseClick",cancel:!1,sparkline:this,event:e},t=(this.trigger(t.name,t),this.isPointRegion(e));return t.isPointRegion&&(e={name:"pointRegionMouseClick",cancel:!1,event:e,sparkline:this,pointIndex:t.pointIndex},this.trigger(e.name,e)),this.removeNavigationStyle(),!1},dPe.prototype.isPointRegion=function(e){var i,n=this,t=this.element.id+"_",e=e.target.id.replace(t,"").split("_");return e[1]===this.type.toLowerCase()?(!je(i=parseInt(e[2],10))&&!isNaN(i)||"Line"!==this.type&&"Area"!==this.type||this.sparklineRenderer.visiblePoints.forEach(function(e,t){rPe(n.mouseX,n.mouseY,new Uke(e.x-5,e.y-5,10,10))&&(i=t)}),{isPointRegion:!0,pointIndex:i}):{isPointRegion:!1,pointIndex:null}},dPe.prototype.sparklineMouseEnd=function(e){return this.setSparklineMouseXY(e),this.notify(F.touchEndEvent,e),!1},dPe.prototype.sparklineMouseLeave=function(e){return this.setSparklineMouseXY(e),this.notify(F.isPointer?"pointerleave":"mouseleave",e),!1},dPe.prototype.chartKeyDown=function(e){var t="";return""!==(t=this.tooltipSettings.visible&&("Tab"===e.code&&-1<this.previousTargetId.indexOf("_sparkline_")||"Escape"===e.code)?"ESC":t)&&this.sparklineKeyboardNavigations(e,e.target.id,t),("Tab"===e.code||"Enter"===e.code||-1<e.code.indexOf("Arrow"))&&this.removeNavigationStyle(),!1},dPe.prototype.chartKeyUp=function(e){var t,i="",n=e.target.id,o=e.target,r=ie(this.element.id+"_sparkline_g"),s=ie(this.element.id+"_sparkline_line");return this.removeNavigationStyle(),this.setNavigationStyle(n),s&&s.removeAttribute("tabindex"),r&&r.firstElementChild&&((r=(s=r.firstElementChild).getAttribute("class"))&&-1===r.indexOf("e-sparkline-focused")?r+=" e-sparkline-focused":r=r||"e-sparkline-focused",s.setAttribute("class",r)),"Tab"===e.code?(""!==this.previousTargetId&&-1<this.previousTargetId.indexOf("_sparkline_")&&-1===n.indexOf("_sparkline_")&&(t=ie(this.element.id+"_sparkline_g"),this.setTabIndex(t.children[this.currentPointIndex],t.firstElementChild)),this.previousTargetId=n,i=this.tooltipSettings.visible?"Tab":""):-1<e.code.indexOf("Arrow")&&(e.preventDefault(),-1<(this.previousTargetId=n).indexOf("_sparkline_"))&&(t=o.parentElement,s=e.target,o.removeAttribute("tabindex"),o.blur(),"ArrowUp"!==e.code&&"ArrowDown"!==e.code||(this.currentPointIndex+="ArrowUp"===e.code?1:-1),-1<n.indexOf("_marker")?(this.currentPointIndex=this.getActualIndex(this.currentPointIndex,ie(this.element.id+"_sparkline_marker_g").childElementCount),s=ie(this.element.id+"_sparkline_marker_"+this.currentPointIndex)):-1<n.indexOf("_column")?(this.currentPointIndex=this.getActualIndex(this.currentPointIndex,ie(this.element.id+"_sparkline_g").childElementCount),s=ie(this.element.id+"_sparkline_column_"+this.currentPointIndex)):-1<n.indexOf("_winloss")?(this.currentPointIndex=this.getActualIndex(this.currentPointIndex,ie(this.element.id+"_sparkline_g").childElementCount),s=ie(this.element.id+"_sparkline_winloss_"+this.currentPointIndex)):-1<n.indexOf("_pie")&&(this.currentPointIndex=this.getActualIndex(this.currentPointIndex,ie(this.element.id+"_sparkline_g").childElementCount),s=ie(this.element.id+"_sparkline_pie_"+this.currentPointIndex)),n=this.focusChild(s),i=this.tooltipSettings.visible?"ArrowMove":""),""!==i&&this.sparklineKeyboardNavigations(e,n,i),!1},dPe.prototype.setNavigationStyle=function(e){e=document.getElementById(e);e&&e.style.setProperty("outline","1.5px solid "+this.sparkTheme.tabColor)},dPe.prototype.removeNavigationStyle=function(){var e=document.querySelectorAll("path[id*=_sparkline_], [id*="+this.element.id+"]");e&&e.forEach(function(e){(e instanceof HTMLElement||e instanceof SVGElement)&&(e.style.setProperty("outline","none"),e.style.setProperty("margin",""))})},dPe.prototype.sparklineKeyboardNavigations=function(e,t,i){switch(i){case"Tab":case"ArrowMove":var n;-1<t.indexOf("_sparkline_")&&(n=void 0,n=-1<this.type.indexOf("Line")||-1<this.type.indexOf("Area")?+t.split("_sparkline_")[1].split("marker_")[1]:-1<this.type.indexOf("WinLoss")?+t.split("_sparkline_")[1].split("winloss_")[1]:-1<this.type.indexOf("Pie")?+t.split("_sparkline_")[1].split("pie_")[1]:+t.split("_sparkline_")[1].split("column_")[1],this.sparklineTooltipModule)&&this.sparklineTooltipModule.renderTooltip(this.sparklineRenderer.visiblePoints[n]);break;case"ESC":this.sparklineTooltipModule.removeTooltipElements()}},dPe.prototype.setTabIndex=function(e,t){e&&e.removeAttribute("tabindex"),t&&t.setAttribute("tabindex","0")},dPe.prototype.getActualIndex=function(e,t){return t-1<e?0:e<0?t-1:e},dPe.prototype.focusChild=function(e){e.setAttribute("tabindex","0");var t=e.getAttribute("class");return e.setAttribute("tabindex","0"),t=t&&-1===t.indexOf("e-sparkline-focused")?"e-sparkline-focused "+t:t||"e-sparkline-focused",e.setAttribute("class",t),e.focus(),e.id},dPe.prototype.setSparklineMouseXY=function(e){-1<e.type.indexOf("touch")?(this.isTouch=!0,t=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType,i=e.clientY,t=e.clientX);var t,i,e=this.element.getBoundingClientRect(),n=oPe(this.element.id+"_svg").getBoundingClientRect();this.mouseY=i-e.top-Math.max(n.top-e.top,0),this.mouseX=t-e.left-Math.max(n.left-e.left,0)},dPe.prototype.onPropertyChanged=function(e){for(var t=!1,i=!1,n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"xName":case"yName":case"axisSettings":case"rangeBandSettings":case"type":case"valueType":case"enableRtl":case"dataSource":i=!0;break;case"border":case"markerSettings":case"dataLabelSettings":case"tooltipSettings":case"startPointColor":case"highPointColor":case"lowPointColor":case"endPointColor":case"negativePointColor":case"theme":t=!0}i?(this.createSVG(),this.sparklineRenderer.processData(),this.refreshSparkline()):t&&(this.createSVG(),this.refreshSparkline())},dPe.prototype.refreshSparkline=function(){this.renderSparkline(),this.element.appendChild(this.svgObject),this.setSecondaryElementPosition()},dPe.prototype.getModuleName=function(){return"sparkline"},dPe.prototype.destroy=function(){this.sparklineData=[];var e=document.getElementById(this.element.id+"Keyboard_sparkline_focus");e&&e.remove(),nPe("sparklinesmeasuretext"),this.element&&(this.unWireEvents(),hPe.prototype.destroy.call(this),this.removeSvg(),this.svgObject=null)},dPe.prototype.getPersistData=function(){return""},nke([e(null)],dPe.prototype,"width",void 0),nke([e(null)],dPe.prototype,"height",void 0),nke([t({},oke)],dPe.prototype,"border",void 0),nke([e("Line")],dPe.prototype,"type",void 0),nke([e("None")],dPe.prototype,"rangePadding",void 0),nke([e(null)],dPe.prototype,"dataSource",void 0),nke([e(null)],dPe.prototype,"query",void 0),nke([e("Numeric")],dPe.prototype,"valueType",void 0),nke([e(null)],dPe.prototype,"xName",void 0),nke([e(null)],dPe.prototype,"yName",void 0),nke([e("#00bdae")],dPe.prototype,"fill",void 0),nke([e("")],dPe.prototype,"highPointColor",void 0),nke([e("")],dPe.prototype,"lowPointColor",void 0),nke([e("")],dPe.prototype,"startPointColor",void 0),nke([e("")],dPe.prototype,"endPointColor",void 0),nke([e("")],dPe.prototype,"negativePointColor",void 0),nke([e("")],dPe.prototype,"tiePointColor",void 0),nke([e([])],dPe.prototype,"palette",void 0),nke([e(1)],dPe.prototype,"lineWidth",void 0),nke([e(1)],dPe.prototype,"opacity",void 0),nke([e(null)],dPe.prototype,"format",void 0),nke([e(!1)],dPe.prototype,"useGroupingSeparator",void 0),nke([t({},uke)],dPe.prototype,"tooltipSettings",void 0),nke([t({},fke)],dPe.prototype,"containerArea",void 0),nke([kt([],Ske)],dPe.prototype,"rangeBandSettings",void 0),nke([t({},Ike)],dPe.prototype,"axisSettings",void 0),nke([t({},Pke)],dPe.prototype,"markerSettings",void 0),nke([t({},ike)],dPe.prototype,"dataLabelSettings",void 0),nke([t({},Dke)],dPe.prototype,"padding",void 0),nke([e("Material")],dPe.prototype,"theme",void 0),nke([i()],dPe.prototype,"loaded",void 0),nke([i()],dPe.prototype,"load",void 0),nke([i()],dPe.prototype,"tooltipInitialize",void 0),nke([i()],dPe.prototype,"seriesRendering",void 0),nke([i()],dPe.prototype,"axisRendering",void 0),nke([i()],dPe.prototype,"pointRendering",void 0),nke([i()],dPe.prototype,"pointRegionMouseMove",void 0),nke([i()],dPe.prototype,"pointRegionMouseClick",void 0),nke([i()],dPe.prototype,"sparklineMouseMove",void 0),nke([i()],dPe.prototype,"sparklineMouseClick",void 0),nke([i()],dPe.prototype,"dataLabelRendering",void 0),nke([i()],dPe.prototype,"markerRendering",void 0),nke([i()],dPe.prototype,"resize",void 0),nke([Bt],dPe));function dPe(e,t){e=hPe.call(this,e,t)||this;return e.isDevice=F.isDevice,e.intervalDivs=[10,5,2,1],e.previousTargetId="",e.currentPointIndex=0,e}var pPe=function(e,t){var i={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(i[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&(i[o[n]]=e[o[n]]);return i},cPe=(uPe.prototype.addEventListener=function(){this.sparkline.isDestroyed||(this.sparkline.on(F.isPointer?"pointerleave":"mouseleave",this.mouseLeaveHandler,this),this.sparkline.on(F.touchMoveEvent,this.mouseMoveHandler,this),this.sparkline.on(F.touchEndEvent,this.mouseUpHandler,this))},uPe.prototype.mouseLeaveHandler=function(){this.removeTooltipElements()},uPe.prototype.mouseUpHandler=function(e){this.sparkline.isTouch&&(this.processTooltip(e),this.fadeOut())},uPe.prototype.fadeOut=function(){clearTimeout(this.clearTooltip),this.clearTooltip=+setTimeout(this.removeTooltipElements.bind(this),5e3)},uPe.prototype.removeTooltipElements=function(){this.removeTooltip(),this.removeTracker()},uPe.prototype.mouseMoveHandler=function(e){this.processTooltip(e)},uPe.prototype.processTooltip=function(e){var t=this.sparkline,i=t.sparklineRenderer.visiblePoints,n=t.mouseX,o=t.mouseY;if("Pie"!==t.type)for(var r,s=Pe([],[],i).map(function(e){return e.location.x}),a=1/0,l=0,h=s.length;l<h;l++)(r=Math.abs(n-s[l]))<a&&(a=r,d=l);else var e=e.target.id,d=parseInt(e.split("_pie_")[1],10);isNaN(d)||!rPe(n,o,new Uke(0,0,t.availableSize.width,t.availableSize.height))?(this.removeTracker(),this.removeTooltip()):this.pointIndex!==d&&(this.pointIndex=d,this.renderTrackerLine(i[d]),this.renderTooltip(i[d]))},uPe.prototype.renderTrackerLine=function(e){var t,i,n,o=this.sparkline,r=o.tooltipSettings.trackLineSettings,s=o.sparkTheme.trackerLineColor||r.color;r.visible&&"Pie"!==o.type&&(je(t=oPe(o.element.id+"_sparkline_tracker_g"))&&(t=o.renderer.createGroup({id:o.element.id+"_sparkline_tracker_g"}),o.svgObject.appendChild(t)),i=oPe(o.element.id+"_sparkline_tracker"),e="M "+e.location.x+" "+o.padding.top+" L "+e.location.x+" "+(o.availableSize.height-o.padding.bottom),je(i)?((n=new qke(o.element.id+"_sparkline_tracker",s,r.width,s,1)).d=e,ePe(o,n,t)):(i.setAttribute("d",e),i.setAttribute("stroke-width",r.width.toString()),i.setAttribute("stroke",s)))},uPe.prototype.renderTooltip=function(e){var t,i,n,o,r,s=this,a=this.sparkline,l=a.tooltipSettings;l.visible&&(je(t=oPe(a.element.id+"_sparkline_tooltip_div"))&&(t=Q("div",{id:a.element.id+"_sparkline_tooltip_div",styles:"pointer-events: none; position: absolute;z-index:1;"}),oPe(a.element.id+"_Secondary_Element").appendChild(t)),i=e.xVal.toString(),"Category"===a.valueType?i=a.dataSource[e.xVal][a.xName]:"DateTime"===a.valueType&&(i=new Date(e.xVal).toDateString()),i=this.getFormat(a.tooltipSettings.format,a,i,this.formatValue(e.yVal,a).toString()),n={x:e.location.x,y:e.location.y},n="Pie"===a.type?{x:e.location.x,y:e.location.y}:n,e=l.textStyle.color||a.sparkTheme.tooltipFontColor,o=""===l.fill?a.sparkTheme.tooltipFill:l.fill,r={name:"tooltipInitialize",cancel:!1,text:i,textStyle:{size:l.textStyle.size,opacity:a.sparkTheme.tooltipTextOpacity||l.textStyle.opacity,fontWeight:l.textStyle.fontWeight||a.sparkTheme.tooltipFontWeight,fontStyle:l.textStyle.fontStyle,fontFamily:l.textStyle.fontFamily||a.sparkTheme.tooltipFontFamily,color:e}},a.trigger("tooltipInitialize",r,function(){s.addTooltip(r,a,o,l,n,t)}))},uPe.prototype.addTooltip=function(e,t,i,n,o,r,s){s=je(e)?(s.cancel,s):(e.cancel,pPe(e,["cancel"]),e),e.cancel||((e=new tr({content:s.text,border:n.border,template:n.template,data:t.dataSource[this.pointIndex],fill:i,textStyle:s.textStyle,enableAnimation:!1,location:{x:o.x,y:o.y},shared:!1,availableSize:this.sparkline.availableSize,areaBounds:new Uke(0,0,t.availableSize.width,t.availableSize.height),theme:t.theme})).opacity=t.sparkTheme.tooltipFillOpacity||e.opacity,e.appendTo(r))},uPe.prototype.getFormat=function(e,t,i,n){return je(e)||""===e?[n]:[e.split("${"+t.xName+"}").join(i).split("${"+t.yName+"}").join(n)]},uPe.prototype.formatValue=function(e,t){t=t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(e):e;return t},uPe.prototype.removeTracker=function(){var e=this.sparkline.element.querySelector("#"+this.sparkline.element.id+"_sparkline_tracker_g");return e?ue(e):null},uPe.prototype.removeTooltip=function(){this.pointIndex=null;var e=this.sparkline.element.querySelector("#"+this.sparkline.element.id+"_sparkline_tooltip_div");return e?ue(e):null},uPe.prototype.getModuleName=function(){return"SparklineTooltip"},uPe.prototype.destroy=function(){},uPe);function uPe(e){this.sparkline=e,this.addEventListener()}gPe=function(e,t){return(gPe=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])}))(e,t)};var gPe,mPe,fPe=function(e,t){function i(){this.constructor=e}gPe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},yPe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},vPe=(fPe(bPe,mPe=n),yPe([e("Normal")],bPe.prototype,"fontStyle",void 0),yPe([e("16px")],bPe.prototype,"size",void 0),yPe([e("Normal")],bPe.prototype,"fontWeight",void 0),yPe([e("")],bPe.prototype,"color",void 0),yPe([e("Segoe UI")],bPe.prototype,"fontFamily",void 0),yPe([e(1)],bPe.prototype,"opacity",void 0),bPe);function bPe(){return null!==mPe&&mPe.apply(this,arguments)||this}fPe(SPe,wPe=n),yPe([e("transparent")],SPe.prototype,"color",void 0),yPe([e(0)],SPe.prototype,"width",void 0),yPe([e(.8)],SPe.prototype,"cornerRadius",void 0);var wPe,CPe=SPe;function SPe(){return null!==wPe&&wPe.apply(this,arguments)||this}fPe(xPe,APe=n),yPe([e("Normal")],xPe.prototype,"fontStyle",void 0),yPe([e("15px")],xPe.prototype,"size",void 0),yPe([e("500")],xPe.prototype,"fontWeight",void 0),yPe([e("")],xPe.prototype,"color",void 0),yPe([e("Center")],xPe.prototype,"textAlignment",void 0),yPe([e("Segoe UI")],xPe.prototype,"fontFamily",void 0),yPe([e(1)],xPe.prototype,"opacity",void 0),yPe([e("Wrap")],xPe.prototype,"textOverflow",void 0),yPe([e("Top")],xPe.prototype,"position",void 0),yPe([e(0)],xPe.prototype,"x",void 0),yPe([e(0)],xPe.prototype,"y",void 0),yPe([e("transparent")],xPe.prototype,"background",void 0),yPe([t({},CPe)],xPe.prototype,"border",void 0);var APe,fPe=xPe;function xPe(){return null!==APe&&APe.apply(this,arguments)||this}TPe.prototype.measureAxis=function(e){var t=this.chart;this.seriesClipRect=new Do(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=Hye(this.initialClipRect,new Eve(this.leftSize,this.rightSize,0,0)),this.measureColumnAxis(t,this.initialClipRect),this.initialClipRect=Hye(this.initialClipRect,new Eve(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=Hye(this.seriesClipRect,new Eve(this.leftSize,this.rightSize,0,0)),this.measureColumnAxis(t,this.initialClipRect),this.seriesClipRect=Hye(this.seriesClipRect,new Eve(0,0,this.topSize,this.bottomSize)),this.chart.delayRedraw||(t.refreshAxis(),this.calculateAxisSize(this.seriesClipRect))},TPe.prototype.measureRowAxis=function(e,t){this.calculateRowSize(t);for(var i,n=0,o=e.rows;n<o.length;n++)(i=o[n]).nearSizes=[],i.farSizes=[],this.arrangeAxis(i),this.measureDefinition(i,e,new Eo(e.availableSize.width,i.computedHeight)),this.leftSize<Vye(i.nearSizes)&&(this.leftSize=Vye(i.nearSizes)),this.rightSize<Vye(i.farSizes)&&(this.rightSize=Vye(i.farSizes))},TPe.prototype.measureColumnAxis=function(e,t){this.calculateColumnSize(t);for(var i,n=0,o=e.columns;n<o.length;n++)(i=o[n]).farSizes=[],i.nearSizes=[],this.arrangeAxis(i),this.measureDefinition(i,e,new Eo(i.computedWidth,e.availableSize.height)),this.bottomSize<Vye(i.nearSizes)&&(this.bottomSize=Vye(i.nearSizes)),this.topSize<Vye(i.farSizes)&&(this.topSize=Vye(i.farSizes))},TPe.prototype.measureDefinition=function(e,t,i){for(var n=0,o=e.axes;n<o.length;n++){var r=o[n];r.getModule(t),r.baseModule.calculateRangeAndInterval(i,r),e.computeSize(r,t)}0<e.farSizes.length&&(e.farSizes[e.farSizes.length-1]-=10),0<e.nearSizes.length&&(e.nearSizes[e.nearSizes.length-1]-=10)},TPe.prototype.calculateAxisSize=function(e){var t,i,n,o,r,s=this.chart,a=0,l=0,h=0;this.calculateRowSize(e);for(var d=0,p=s.rows.length;d<p;d++)for(var c,a=0,l=0,u=0,g=(c=s.rows[d]).axes.length;u<g;u++){if(r=(i=c.axes[u]).plotOffset,0===i.rect.height){i.rect.height=c.computedHeight;for(var h=0,m=d+1,f=d+i.span;m<f;m++)h+=(t=s.rows[m]).computedHeight;i.rect.y=c.computedTop-h+(i.plotOffsetTop||r),i.rect.height=i.rect.height+h-this.getAxisOffsetValue(i.plotOffsetTop,i.plotOffsetBottom,i.plotOffset),i.rect.width=0}i.isAxisOpposedPosition?(n=e.x+e.width+Vye(Gye(c.farSizes,l)),i.rect.x=i.rect.x>=n?i.rect.x:n,l++):(n=e.x-Vye(Gye(c.nearSizes,a)),i.rect.x=i.rect.x<=n?i.rect.x:n,a++)}this.calculateColumnSize(e);for(d=0,p=s.columns.length;d<p;d++)for(var y,u=l=a=0,v=(y=s.columns[d]).axes.length;u<v;u++){if(r=(i=y.axes[u]).plotOffset,0===i.rect.width){for(var m=d,b=d+i.span;m<b;m++)t=s.columns[m],i.rect.width+=t.computedWidth;i.rect.x=y.computedLeft+(i.plotOffsetLeft||r),i.rect.width-=this.getAxisOffsetValue(i.plotOffsetLeft,i.plotOffsetRight,i.plotOffset),i.rect.height=0}i.isAxisOpposedPosition?(o=e.y-Vye(Gye(y.farSizes,l)),i.rect.y=i.rect.y<=o?i.rect.y:o,l++):(o=e.y+e.height+Vye(Gye(y.nearSizes,a)),i.rect.y=i.rect.y>=o?i.rect.y:o,a++)}},TPe.prototype.measure=function(){for(var e,t,i,n,o=this.chart,r=0,s=o.axisCollections;r<s.length;r++){var a=s[r];if("Vertical"===a.orientation){o.verticalAxes.push(a),n=this.getActualRow(a),e=o.rows[n],this.pushAxis(e,a);for(var l=n+a.span>o.rows.length?o.rows.length:n+a.span,h=n+1;h<l;h++)(i=o.rows[h]).axes[e.axes.length-1]=a,o.rows[h]=i;o.rows[n]=e}else{o.horizontalAxes.push(a),n=this.getActualColumn(a),t=o.columns[n],this.pushAxis(t,a),l=n+a.span>o.columns.length?o.columns.length:n+a.span;for(h=n+1;h<l;h++)(i=o.columns[h]).axes[t.axes.length-1]=a,o.columns[h]=i;o.columns[n]=t}a.isRTLEnabled=o.enableRtl,a.setIsInversedAndOpposedPosition()}},TPe.prototype.getAxisOffsetValue=function(e,t,i){return e?e+(t||i):t?t+i:2*i},TPe.prototype.pushAxis=function(e,t){for(var i=0,n=e.axes.length;i<=n;i++)if(!e.axes[i]){e.axes[i]=t;break}},TPe.prototype.arrangeAxis=function(e){for(var t=[],i=0,n=e.axes.length;i<=n;i++)e.axes[i]&&t.push(e.axes[i]);e.axes=t},TPe.prototype.getActualColumn=function(e){var t=this.chart.columns.length,e=e.columnIndex;return t<=e?t-1:e<0?0:e},TPe.prototype.getActualRow=function(e){var t=this.chart.rows.length,e=e.rowIndex;return t<=e?t-1:e<0?0:e},TPe.prototype.calculateRowSize=function(e){for(var t,i=this.chart,n=e.y+e.height,o=0,r=Math.max(0,e.height),s=0,a=i.rows.length;s<a;s++)o=-1!==(t=i.rows[s]).height.indexOf("%")?Math.min(r,e.height*parseInt(t.height,10)/100):Math.min(r,parseInt(t.height,10)),n-=t.computedHeight=o=s!==a-1?o:r,t.computedTop=n,r-=o},TPe.prototype.calculateColumnSize=function(e){for(var t,i=this.chart,n=e.x,o=0,r=Math.max(0,e.width),s=0,a=i.columns.length;s<a;s++)o=-1!==(t=i.columns[s]).width.indexOf("%")?Math.min(r,e.width*parseInt(t.width,10)/100):Math.min(r,parseInt(t.width,10)),t.computedWidth=o=s!==a-1?o:r,t.computedLeft=n,n+=o,r-=o};var IPe=TPe;function TPe(e){this.chart=e}function EPe(e){var t;switch(e){case"HighContrastLight":case"HighContrast":t={axisLabel:"#969696",axisTitle:"#969696",majorGridLine:"#BFBFBF",minorGridLine:"#969696",majorTickLine:"#BFBFBF",minorTickLine:"#969696",chartTitle:"#ffffff",legendLabel:"#ffffff",background:"transparent",tooltipFill:"#ffffff",tooltipBoldLabel:"#000000",tooltipLightLabel:"#000000",tooltipHeaderLine:"#969696",tabColor:"#FFD939",backWallColor:"#222222",leftWallColor:"#272727",chartTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#000000",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#000000",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"MaterialDark":case"FabricDark":case"BootstrapDark":t={axisLabel:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"FabricDark"===e?"#A19F9D":"#676767",axisTitle:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"FabricDark"===e?"#A19F9D":"#676767",majorGridLine:"#414040",minorGridLine:"#514F4F",majorTickLine:"#414040",minorTickLine:"#4A4848",chartTitle:"#ffffff",legendLabel:"#DADADA",background:"transparent",tooltipFill:"#F4F4F4",tooltipBoldLabel:"#282727",tooltipLightLabel:"#333232",tooltipHeaderLine:"#9A9A9A",backWallColor:"#222222",leftWallColor:"#272727",tabColor:"MaterialDark"===e?"#00B0FF":"FabricDark"===e?"#0074CC":"#0070F0",chartTitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"FabricDark"===e?"#DADADA":"#FFFFFF",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"FabricDark"===e?"#A19F9D":"#676767",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"FabricDark"===e?"#DADADA":"#FFFFFF",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"FabricDark"===e?"#A19F9D":"#676767",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"MaterialDark"===e?"rgba(18, 18, 18, 1)":"FabricDark"===e?"#DADADA":"#1A1A1A",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"FabricDark"===e?"#A19F9D":"#676767",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"MaterialDark"===e||"FabricDark"===e?"#000000":"#FFFFFF",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"FabricDark"===e?"#DADADA":"#FFFFFF",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap4":t={axisLabel:"#222222",axisTitle:"#212529",majorGridLine:"#CED4DA",minorGridLine:"#DEE2E6",majorTickLine:"#ADB5BD",minorTickLine:"#CED4DA",chartTitle:"#212529",legendLabel:"#212529",background:"transparent",tooltipFill:"#020202",tooltipBoldLabel:"rgba(255,255,255)",tooltipLightLabel:"rgba(255,255,255, 0.9)",tooltipHeaderLine:"rgba(255,255,255, 0.2)",tabColor:"#007BFF",backWallColor:"#F9F9F9",leftWallColor:"#EBEBEB",chartTitleFont:{color:"#212529",fontFamily:"Helvetica",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#222222",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#212529",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#666666",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#212529",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#222222",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#212529",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Tailwind3":t={axisLabel:"#4B5563",axisTitle:"#6B7280",majorGridLine:"#E5E7EB",minorGridLine:"#E5E7EB",majorTickLine:"#D1D5DB",minorTickLine:"#D1D5DB",chartTitle:"#111827",legendLabel:"#6B7280",background:"transparent",tooltipFill:"#111827",tooltipBoldLabel:"#F9FAFB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#D1D5DB",tabColor:"#4F46E5",backWallColor:"rgba(209, 213, 219, 0.03)",leftWallColor:"#EBEBEB",chartTitleFont:{color:"#111827",fontFamily:"Inter",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#4B5563",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#374151",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},legendLabelFont:{color:"#6B7280",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Inter",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#6B7280",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"},datalabelFont:{color:"#111827",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#6B7280",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"}};break;case"Tailwind3Dark":t={axisLabel:"#D1D5DB",axisTitle:"#9CA3AF",majorGridLine:"#374151",minorGridLine:"#374151",majorTickLine:"#4B5563",minorTickLine:"#4B5563",chartTitle:"#FFFFFF",legendLabel:"#9CA3AF",background:"transparent",tooltipFill:"#F9FAFB",tooltipBoldLabel:"#1F2937",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#374151",tabColor:"#22D3EE",backWallColor:"rgb(55,65,81, 0.3)",leftWallColor:"rgb(255,255,255,0.1)",chartTitleFont:{color:"#FFFFFF",fontFamily:"Inter",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#E5E7EB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},legendLabelFont:{color:"#9CA3AF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},tooltipLabelFont:{color:"#1F2937",fontFamily:"Inter",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#9CA3AF",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"},datalabelFont:{color:"#FFFFFF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#9CA3AF",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"}};break;case"Tailwind":t={axisLabel:"#222222",axisTitle:"#374151",majorGridLine:"#E5E7EB",minorGridLine:"#E5E7EB",majorTickLine:"#D1D5DB",minorTickLine:"#D1D5DB",chartTitle:"#374151",legendLabel:"#374151",background:"transparent",tooltipFill:"#111827",tooltipBoldLabel:"#D1D5DB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#6B7280",tabColor:"#4F46E5",backWallColor:"#F9F9F9",leftWallColor:"#EBEBEB",chartTitleFont:{color:"#374151",fontFamily:"Inter",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#222222",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Inter",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#FFFFFF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"TailwindDark":t={axisLabel:"#D1D5DB",axisTitle:"#D1D5DB",majorGridLine:"#374151",minorGridLine:"#374151",majorTickLine:"#4B5563",minorTickLine:"#4B5563",chartTitle:"#D1D5DB",legendLabel:"#D1D5DB",background:"transparent",tooltipFill:"#F9FAFB",tooltipBoldLabel:"#6B7280",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#9CA3AF",tabColor:"#22D3EE",backWallColor:"#222222",leftWallColor:"#272727",chartTitleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#1F2937",fontFamily:"Inter",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#9CA3AF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap5":t={axisLabel:"#212529",axisTitle:"#212529",majorGridLine:"#DEE2E6",minorGridLine:"#DEE2E6",majorTickLine:"#DEE2E6",minorTickLine:"#DEE2E6",chartTitle:"#212529",legendLabel:"#212529",background:"transparent",tooltipFill:"#000000E5",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#FFFFFF",tabColor:"#0D6EFD",backWallColor:"#DEE2E6",leftWallColor:"#DEE2E6",chartTitleFont:{color:"#212529",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#343A40",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#212529",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"700"},datalabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"10px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#21252980",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"}};break;case"Bootstrap5Dark":t={axisLabel:"#DEE2E6",axisTitle:"#DEE2E6",majorGridLine:"#495057",minorGridLine:"#495057",majorTickLine:"#495057",minorTickLine:"#495057",chartTitle:"#DEE2E6",legendLabel:"#DEE2E6",background:"transparent",tooltipFill:"#FFFFFFE5",tooltipBoldLabel:"#212529",tooltipLightLabel:"#212529",tooltipHeaderLine:"#212529",tabColor:"#0D6EFD",backWallColor:"#495057",leftWallColor:"#495057",chartTitleFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#212529",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"700"},datalabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"10px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#DEE2E680",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"}};break;case"Fluent":t={axisLabel:"#222222",axisTitle:"#201F1E",majorGridLine:"#DDDDDD",minorGridLine:"#DDDDDD",majorTickLine:"#DDDDDD",minorTickLine:"#DDDDDD",chartTitle:"#201F1E",legendLabel:"#323130",background:"transparent",tooltipFill:"#FFFFFF",tooltipBoldLabel:"#323130",tooltipLightLabel:"#323130",tooltipHeaderLine:"#D2D0CE",tabColor:"#0078D4",backWallColor:"#F9F9F9",leftWallColor:"#EBEBEB",chartTitleFont:{color:"#201F1E",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#222222",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#201F1E",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#49454E",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#323130",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#201F1E",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#323129",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"FluentDark":t={axisLabel:"#D2D0CE",axisTitle:"#D2D0CE",majorGridLine:"#414040",minorGridLine:"#414040",majorTickLine:"#3B3A39",minorTickLine:"#3B3A39",chartTitle:"#F3F2F1",legendLabel:"#D2D0CE",background:"transparent",tooltipFill:"#252423",tooltipBoldLabel:"#F3F2F1",tooltipLightLabel:"#F3F2F1",tooltipHeaderLine:"#3B3A39",tabColor:"#0078D4",backWallColor:"#222222",leftWallColor:"#272727",chartTitleFont:{color:"#C8C6C4",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#D2D0CE",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#F3F2F1",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#D2D0CE",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F3F2F1",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#F3F2F2",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#000000",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#F3F2F1",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Fluent2":t={axisLabel:"#616161",axisTitle:"#242424",majorGridLine:"#EDEBE9",minorGridLine:"#EDEBE9",majorTickLine:"#D2D0CE",minorTickLine:"#D2D0CE",chartTitle:"#242424",legendLabel:"#242424",background:"transparent",tooltipFill:"#FFFFFF",tooltipBoldLabel:"#242424",tooltipLightLabel:"#242424",tooltipHeaderLine:"#D2D0CE",tabColor:"#0078D4",backWallColor:"#F9F9F9",leftWallColor:"#EBEBEB",chartTitleFont:{color:"#242424",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#616161",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"10px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#616161",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"}};break;case"Fluent2Dark":t={axisLabel:"#FFFFFF",axisTitle:"#FFFFFF",majorGridLine:"#3B3A39",minorGridLine:"#3B3A39",majorTickLine:"#292827",minorTickLine:"#292827",chartTitle:"#FFFFFF",legendLabel:"#FFFFFF",background:"transparent",tooltipFill:"#292929",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#3B3A39",tabColor:"#0078D4",backWallColor:"#222222",leftWallColor:"#272727",chartTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#ADADAD",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"10px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#ADADAD",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"}};break;case"Fluent2HighContrast":t={axisLabel:"#FFFFFF",axisTitle:"#FFFFFF",majorGridLine:"#292827",minorGridLine:"#3B3A39",majorTickLine:"#292827",minorTickLine:"#3B3A39",chartTitle:"#FFFFFF",legendLabel:"#FFFFFF",background:"transparent",tooltipFill:"#000000",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#3B3A39",tabColor:"#0078D4",backWallColor:"#222222",leftWallColor:"#272727",chartTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"10px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"}};break;case"Material3":t={axisLabel:"#222222",axisTitle:"#1C1B1F",majorGridLine:"#DDDDDD",minorGridLine:"#DDDDDD",majorTickLine:"#DDDDDD",minorTickLine:"#DDDDDD",chartTitle:"#1C1B1F",legendLabel:"#49454E",background:"transparent",tooltipFill:"#313033",tooltipBoldLabel:"#F4EFF4",tooltipLightLabel:"#F4EFF4",tooltipHeaderLine:"#F4EFF4",tabColor:"#49454E",backWallColor:"#F9F9F9",leftWallColor:"#EBEBEB",chartTitleFont:{color:"#1C1B1F",fontFamily:"Roboto",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#222222",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#1C1B1F",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#49454E",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F4EFF4",fontFamily:"Roboto",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#1C1B1F",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#FFFFFF",fontFamily:"Roboto",size:"10px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#49454E",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Material3Dark":t={axisLabel:"#CAC4D0",axisTitle:"#CAC4D0",majorGridLine:"#444746",minorGridLine:"#444746",majorTickLine:"#444746",minorTickLine:"#444746",chartTitle:"#E6E1E5",legendLabel:"#CAC4D0",background:"transparent",tooltipFill:"#E6E1E5",tooltipBoldLabel:"#313033",tooltipLightLabel:"#313033",tooltipHeaderLine:"#313033",tabColor:"#CAC4D0",backWallColor:"#222222",leftWallColor:"#272727",chartTitleFont:{color:"#E6E1E5",fontFamily:"Roboto",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"#E6E1E5",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#313033",fontFamily:"Roboto",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"#E6E1E5",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#000000",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;default:t={axisLabel:"#222222",axisTitle:"#424242",majorGridLine:"#dbdbdb",minorGridLine:"#eaeaea",majorTickLine:"#b5b5b5",minorTickLine:"#d6d6d6",chartTitle:"#424242",legendLabel:"#353535",background:"transparent",tooltipFill:"#000816",tooltipBoldLabel:"#ffffff",tooltipLightLabel:"#dbdbdb",tooltipHeaderLine:"#ffffff",backWallColor:"#F9F9F9",leftWallColor:"#EBEBEB",tabColor:"Material"===e?"#ff4081":"Fabric"===e?"#0078D6":"#317AB9",chartTitleFont:{color:"Material"===e?"rgba(0, 0, 0, 1)":"Fabric"===e?"#333333":"#212529",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"16px",fontStyle:"Normal",fontWeight:"600"},axisLabelFont:{color:"#222222",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},legendTitleFont:{color:"Material"===e?"rgba(0, 0, 0, 1)":"Fabric"===e?"#333333":"#212529",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"Material"===e?"rgba(97, 97, 97, 1)":"#666666",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"Material"===e?"rgba(249, 250, 251, 1)":"Fabric"===e?"#333333":"#F9FAFB",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal"},axisTitleFont:{color:"Material"===e?"rgba(0, 0, 0, 1)":"Fabric"===e?"#333333":"#212529",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},datalabelFont:{color:"#FFFFFF",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"Material"===e?"rgba(0, 0, 0, 1)":"Fabric"===e?"#333333":"#212529",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"}}}return t}function DPe(e){var t;switch(e){case"Fabric":t=["#06DCFF","#EF36BB","#ffc000","#70ad47","#5b9bd5","#c1c1c1","#6f6fe2","#e269ae","#9e480e","#997300"];break;case"Bootstrap4":t=["#9B43F4","#F7523F","#55a5c2","#7ddf1e","#ff6ea6","#7953ac","#b99b4f","#407c92","#5ea716","#b91c52"];break;case"Bootstrap":t=["#6355C7","#FFB400","#55a5c2","#7ddf1e","#ff6ea6","#7953ac","#b99b4f","#407c92","#5ea716","#b91c52"];break;case"HighContrastLight":case"HighContrast":t=["#41E4FF","#FF5B5B","#DFE6B6","#C6E773","#BA98FF","#FA83C3","#00C27A","#43ACEF","#D681EF","#D8BC6E"];break;case"MaterialDark":t=["#55C75A","#FFB400","#C57AFF","#61EAA9","#EBBB3E","#F45C5C","#8A77FF","#63C7FF","#FF84B0","#F7C928"];break;case"FabricDark":t=["#41E4FF","#FD7400","#ffc000","#70ad47","#5b9bd5","#c1c1c1","#6f6fe2","#e269ae","#9e480e","#997300"];break;case"BootstrapDark":t=["#BC43F4","#FFC539","#55a5c2","#7ddf1e","#ff6ea6","#7953ac","#b99b4f","#407c92","#5ea716","#b91c52"];break;case"Tailwind3":t=["#2F4074","#03B4B4","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];break;case"Tailwind3Dark":t=["#8029F1","#1ABC9C","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];break;case"Tailwind":t=["#5C43F4","#FFB400","#334155","#14B8A6","#8B5CF6","#0369A1","#F97316","#9333EA","#F59E0B","#15803D"];break;case"TailwindDark":t=["#00C2FF","#FD7400","#F87171","#4ADE80","#E879F9","#FCD34D","#F97316","#2DD4BF","#F472B6","#10B981"];break;case"Bootstrap5Dark":case"Bootstrap5":t=["#FD7E14","#6610F2","#6F42C1","#D63384","#DC3545","#FFC107","#198754","#0DCAF0"];break;case"FluentDark":t=["#41E4FF","#FF7E6F","#EDBB40","#AF4BCF","#FF7266","#1BD565","#EE993D","#5887FF","#EC548D","#7D39C0"];break;case"Fluent":t=["#2196F5","#FC7400","#EDBB40","#AF4BCF","#FF7266","#1BD565","#EE993D","#5887FF","#EC548D","#7D39C0"];break;case"Fluent2":t=["#6200EE","#09AF74","#0076E5","#CB3587","#E7910F","#0364DE","#66CD15","#F3A93C","#107C10","#C19C00"];break;case"Fluent2Dark":case"Fluent2HighContrast":t=["#9BB449","#2A72D5","#43B786","#3F579A","#584EC6","#E85F9C","#6E7A89","#EA6266","#0B6A0B","#C19C00"];break;case"Material3":t=["#6A56FF","#00DBFF","#FFB400","#F7523F","#963C70","#FD7400","#4BE0BC","#2196F5","#DE3D8A","#162F88"];break;case"Material3Dark":t=["#00C2FF","#FFB400","#FFF500","#17EA58","#38FFE7","#FF9E45","#B3F32F","#B93CE4","#FC5664","#9B55FF"];break;default:t=["#6355C7","#00AEE0","#357cd2","#e56590","#f8b883","#70ad47","#dd8abd","#7f84e8","#7bb4eb","#ea7a57"]}return t}var MPe=function(){return(MPe=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},kPe=function(){this.transform=null},PPe=new kPe,BPe=(FPe.prototype.isValid=function(e){return!isNaN(e.x)&&!isNaN(e.y)&&!isNaN(e.z)},FPe.prototype.vector3D=function(e,t,i){return this.x=e,this.y=t,this.z=i,{x:this.x,y:this.y,z:this.z}},FPe.prototype.vector3DMinus=function(e,t){return this.vector3D(e.x-t.x,e.y-t.y,e.z-t.z)},FPe.prototype.vector3DPlus=function(e,t){return this.vector3D(e.x+t.x,e.y+t.y,e.z+t.z)},FPe.prototype.vector3DMultiply=function(e,t){var i=e.y*t.z-t.y*e.z,n=e.z*t.x-t.z*e.x,t=e.x*t.y-t.x*e.y;return this.vector3D(i,n,t)},FPe.prototype.vector3DAdd=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},FPe.prototype.vector3DStarMultiply=function(e,t){var i=e.x*t,n=e.y*t,e=e.z*t;return this.vector3D(i,n,e)},FPe.prototype.getLength=function(e){e=this.vector3DAdd(e,e);return Math.sqrt(e)},FPe.prototype.normalize=function(){var e=this.getLength(this);this.x/=e,this.y/=e,this.z/=e},FPe.prototype.getNormal=function(e,t,i){e=this.vector3DMinus(e,t),i=this.vector3DMinus(i,t),t=this.vector3DMultiply(e,i),e=this.getLength(t);return e<this.epsilon?this.vector3D(0,0,0):this.vector3D(t.x/e,t.y/e,t.z/e)},FPe);function FPe(e,t,i){this.x=0,this.y=0,this.z=0,this.epsilon=1e-5,this.x=e,this.y=t||0,this.z=i||0}RPe.prototype.matrix3D=function(e){for(var t=[],i=0;i<e;i++)t[i]=this.createArray(e);return t},RPe.prototype.isAffine=function(e){return 0===e[0][3]&&0===e[1][3]&&0===e[2][3]&&1===e[3][3]},RPe.prototype.createArray=function(e){for(var t=[],i=0;i<e;++i)t[i]=0;return t},RPe.prototype.getIdentity=function(){for(var e=this.matrix3D(this.matrixSize),t=0;t<this.matrixSize;t++)e[t][t]=1;return e},RPe.prototype.getInterval=function(e){for(var t=this.getIdentity(),i=0;i<this.matrixSize;i++)for(var n=0;n<this.matrixSize;n++)t[i][n]=this.getMinor(e,i,n);return t=this.transposed(t),t=this.getMatrixMultiple(1/this.getDeterminant(e),t)},RPe.prototype.getMatrixMultiple=function(e,t){for(var i=0;i<t.length;i++)for(var n=0;n<t[i].length;n++)t[i][n]=t[i][n]*e;return t},RPe.prototype.getMatrixVectorMultiple=function(e,t){var i=e[0][0]*t.x+e[1][0]*t.y+e[2][0]*t.z+e[3][0],n=e[0][1]*t.x+e[1][1]*t.y+e[2][1]*t.z+e[3][1],o=e[0][2]*t.x+e[1][2]*t.y+e[2][2]*t.z+e[3][2];return this.isAffine(e)||(i*=t=1/(e[0][3]*t.x+e[1][3]*t.y+e[2][3]*t.z+e[3][3]),n*=t,o*=t),{x:i,y:n,z:o}},RPe.prototype.getMatrixVectorAnd=function(e,t){var i=e[0][0]*t.x+e[1][0]*t.y+e[2][0]*t.z,n=e[0][1]*t.x+e[1][1]*t.y+e[2][1]*t.z,e=e[0][2]*t.x+e[1][2]*t.y+e[2][2]*t.z;return new BPe(i,n,e)},RPe.prototype.getMatrixMultiplication=function(e,t){for(var i=this.getIdentity(),n=0;n<this.matrixSize;n++)for(var o=0;o<this.matrixSize;o++){for(var r=0,s=0;s<this.matrixSize;s++)r+=e[s][o]*t[n][s];i[n][o]=r}return i},RPe.prototype.getMinor=function(e,t,i){return((t+i)%2==0?1:-1)*this.getDeterminant(this.getMatrix(e,t,i))},RPe.prototype.getMatrix=function(e,t,i){for(var n=e.length-1,o=this.createArray(n),r=0;r<n;r++){var s=t<=r?r+1:r;o[r]=this.createArray(n);for(var a=0;a<n;a++)o[r][a]=e[s][i<=a?a+1:a]}return o},RPe.prototype.getDeterminant=function(e){var t=e.length,i=0;if(t<2)i=e[0][0];else for(var n=1,o=0;o<t;o++){var r=this.getMatrix(e,o,0);i+=n*e[o][0]*this.getDeterminant(r),n=0<n?-1:1}return i},RPe.prototype.transform=function(e,t,i){var n=this.getIdentity();return n[3][0]=e,n[3][1]=t,n[3][2]=i,n},RPe.prototype.turn=function(e){var t=this.getIdentity();return t[0][0]=Math.cos(e),t[2][0]=-Math.sin(e),t[0][2]=Math.sin(e),t[2][2]=Math.cos(e),t},RPe.prototype.tilt=function(e){var t=this.getIdentity();return t[1][1]=Math.cos(e),t[2][1]=Math.sin(e),t[1][2]=-Math.sin(e),t[2][2]=Math.cos(e),t},RPe.prototype.transposed=function(e){for(var t=this.getIdentity(),i=0;i<this.matrixSize;i++)for(var n=0;n<this.matrixSize;n++)t[i][n]=e[n][i];return t};var LPe=RPe;function RPe(){this.matrixSize=4}NPe.prototype.transform3D=function(e){return{viewingArea:e,rotation:0,tilt:0,depth:0,perspectiveAngle:0,needUpdate:!0,centeredMatrix:this.matrixObj.getIdentity(),perspective:this.matrixObj.getIdentity(),resultMatrix:this.matrixObj.getIdentity(),viewMatrix:this.matrixObj.getIdentity()}},NPe.prototype.transform=function(e){this.setCenter(this.vector.vector3D(e.viewingArea.width/2,e.viewingArea.height/2,e.depth/2),e),this.setViewMatrix(this.matrixObj.transform(0,0,e.depth),e),this.setViewMatrix(this.matrixObj.getMatrixMultiplication(e.viewMatrix,this.matrixObj.turn(-this.toRadial*e.rotation)),e),this.setViewMatrix(this.matrixObj.getMatrixMultiplication(e.viewMatrix,this.matrixObj.tilt(-this.toRadial*e.tilt)),e),this.updatePerspective(e.perspectiveAngle,e),e.needUpdate=!0},NPe.prototype.updatePerspective=function(e,t){e=(t.viewingArea.width+t.viewingArea.height)*Math.tan(this.degreeToRadianConverter((180-Math.abs(e%181))/2))+2*t.depth/2;t.perspective[0][0]=e,t.perspective[1][1]=e,t.perspective[2][3]=1,t.perspective[3][3]=e},NPe.prototype.degreeToRadianConverter=function(e){return e*Math.PI/180},NPe.prototype.toScreen=function(e,t,i){return{x:(e=i?(this.matrixObj=i).getMatrixVectorMultiple(this.result(t,i),e):(t.chartObj=this.matrixObj,this.matrixObj.getMatrixVectorMultiple(this.result(t),e))).x,y:e.y}},NPe.prototype.setViewMatrix=function(e,t){t.viewMatrix!==e&&(t.viewMatrix=e,t.needUpdate=!0)},NPe.prototype.result=function(e,t){var i=(i=e.chartObj||this.matrixObj)||t;return e.needUpdate&&(t=this.matrixObj||t,e.resultMatrix=i.getMatrixMultiplication(t.getInterval(e.centeredMatrix),e.perspective),e.resultMatrix=i.getMatrixMultiplication(e.resultMatrix,e.viewMatrix),e.resultMatrix=i.getMatrixMultiplication(e.resultMatrix,e.centeredMatrix),e.needUpdate=!1),e.resultMatrix},NPe.prototype.setCenter=function(e,t){t.centeredMatrix=this.matrixObj.transform(-e.x,-e.y,-e.z),t.needUpdate=!0};var OPe=NPe;function NPe(){this.toRadial=Math.PI/180,this.vector=new BPe(0,0,0),this.matrixObj=new LPe}_Pe.prototype.addVisual=function(e,t){return null==e||XPe.test()?-1:YPe.add(e,t)},_Pe.prototype.prepareView=function(e,t,i,n,o,r){null==PPe.transform?PPe.transform=r.transform3D.transform3D(o):PPe.transform.viewingArea=o,PPe.tree||(PPe.tree=[]),PPe.transform.rotation=i,PPe.transform.tilt=n,PPe.transform.depth=t,PPe.transform.perspectiveAngle=e,r.transform3D.transform(PPe.transform),PPe.tree[r.chart3D.id]=YPe.build()},_Pe.prototype.view=function(e,t,i,n,o,r,s){var a;2===arguments.length?null!=e&&(a=this.vector.vector3D(0,0,32767),this.drawNode3D(PPe.tree[t.chart3D.id],a,e,t)):null!=e&&(null==PPe.transform?PPe.transform=t.transform3D.transform3D(o):PPe.transform.viewingArea=o,PPe.transform.rotation=i,PPe.transform.tilt=n,PPe.transform.depth=s,PPe.transform.perspectiveAngle=r,t.transform3D.transform(PPe.transform),a=this.vector.vector3D(0,0,32767),this.drawNode3D(PPe.tree[t.chart3D.id],a,e,t))},_Pe.prototype.draw3DElement=function(e,t){e.plane.element?"text"===e.plane.element.tag||"dataLabel"===e.plane.element.tag?XPe.drawText(e.plane,t):"template"===e.plane.element.tag?XPe.drawTemplate(e.plane,t):XPe.drawLine(e.plane,t):XPe.draw(e.plane,t)},_Pe.prototype.drawNode3D=function(e,t,i,n){if(null!==e&&null!=PPe.transform)for(;;){if(qPe.vector3DAdd(XPe.getNormal(n.transform3D.result(PPe.transform),e.plane.vectorPoints),t)>e.plane.d){if(null!=e.front&&this.drawNode3D(e.front,t,i,n),this.draw3DElement(e,n),null!=e.back){e=e.back;continue}}else if(null!=e.back&&this.drawNode3D(e.back,t,i,n),this.draw3DElement(e,n),null!=e.front){e=e.front;continue}break}};var VPe=_Pe;function _Pe(){this.vector=new BPe(0,0,0)}zPe.prototype.add=function(e,t){return(this.chart=t).polygons.push(e),t.polygons.length-1},zPe.prototype.getNext=function(e,t){return t<=e?e-t:e<0?e+t:e},zPe.prototype.vector3DIndexClassification=function(e,t,i){return{index:t,result:i,vector:e,isCuttingBackPoint:!1,cuttingBackPairIndex:null,alreadyCutBack:!1,isCuttingFrontPoint:!1,cuttingFrontPairIndex:null,alreadyCutFront:!1}},zPe.prototype.classifyPoint=function(e,t){var i="OnPlane",e=-t.d-qPe.vector3DAdd(e,t.normal);return e>this.epsilon?i="OnBack":e<-this.epsilon&&(i="OnFront"),i},zPe.prototype.classifyPolygon=function(e,t){var i="Unknown",n=t.points;if(null!=n){for(var o=0,r=0,s=0,a=e.normal,l=e.d,h=0,d=n.length;h<d;h++){var p=-l-qPe.vector3DAdd(n[h],a);if(p>this.epsilon?o++:p<-this.epsilon?r++:s++,0<o&&0<r)break}i=s===n.length?"OnPlane":r+s===n.length?"ToRight":o+s===n.length?"ToLeft":"Unknown"}return i},zPe.prototype.splitPolygon=function(e,t){var i=[],n=[];if(null!=e.points){for(var o=[],r=[],s=[],a=e.points.length,l=0;l<a;l++){var h=e.points[l],d=e.points[this.getNext(l+1,a)],p=this.classifyPoint(h,t),c=this.classifyPoint(d,t),u=this.vector3DIndexClassification(h,o.length,p);if(o.push(u),p!==c&&"OnPlane"!==p&&"OnPlane"!==c){var h=qPe.vector3DMinus(h,d),g=qPe.vector3DMinus(qPe.vector3DStarMultiply(t.normal,-t.d),d),g=qPe.vector3DAdd(g,t.normal)/qPe.vector3DAdd(t.normal,h),d=qPe.vector3DPlus(d,qPe.vector3DStarMultiply(h,g)),h=this.vector3DIndexClassification(d,o.length,"OnPlane");o.push(h),r.push(h),s.push(h)}else if("OnPlane"===p){g=e.points[this.getNext(l-1,a)],d=this.classifyPoint(g,t);if(d!==c)if("OnPlane"!==d&&"OnPlane"!==c)r.push(u),s.push(u);else if("OnPlane"===d)switch(c){case"OnBack":r.push(u);break;case"OnFront":s.push(u)}else if("OnPlane"===c)switch(d){case"OnBack":r.push(u);break;case"OnFront":s.push(u)}}}if(0!==s.length||0!==r.length){for(l=0;l<r.length-1;l+=2){var m=r[l],f=r[l+1];m.cuttingBackPoint=!0,f.cuttingBackPoint=!0,m.alterCuttingBackPairIndex=f.index,f.alterCuttingBackPairIndex=m.index}for(l=0;l<s.length-1;l+=2){var y=s[l],v=s[l+1];y.cuttingFrontPoint=!0,v.cuttingFrontPoint=!0,y.alterCuttingFrontPairIndex=v.index,v.alterCuttingFrontPairIndex=y.index}for(var b,l=0;l<r.length-1;l++)(m=r[l]).alreadyCutBack||2<(b=this.cutOutBackPolygon(o,m)).length&&(b=XPe.polygon3D(b,e),i.push(MPe({},b)));for(var w,l=0;l<s.length-1;l++)(f=s[l]).alreadyCutFront||2<(w=this.cutOutFrontPolygon(o,f)).length&&(w=XPe.polygon3D(w,e),n.push(MPe({},w)))}}else i.push(e),n.push(e);return{backPolygon:i,frontPolygon:n}},zPe.prototype.cutOutFrontPolygon=function(e,t){for(var i=[],n=t;;){n.alreadyCutFront=!0,i.push(n.vector);var o=e[n.alterCuttingFrontPairIndex];if(n.cuttingFrontPoint)if(o.alreadyCutFront){var r=e[this.getNext(n.index-1,e.length)],s=e[this.getNext(n.index+1,e.length)];if("OnFront"!==r.result||r.alreadyCutFront){if("OnFront"!==s.result||s.alreadyCutFront)return i;n=s}else n=r}else n=o;else{r=e[this.getNext(n.index-1,e.length)],s=e[this.getNext(n.index+1,e.length)];if("OnBack"===r.result||r.alreadyCutFront){if("OnBack"===s.result||s.alreadyCutFront)return i;n=s}else n=r}}return null},zPe.prototype.cutOutBackPolygon=function(e,t){for(var i=[],n=t;;){n.alreadyCutBack=!0,i.push(n.vector);var o=e[n.alterCuttingBackPairIndex];if(n.cuttingBackPoint)if(o.alreadyCutBack){var r=e[this.getNext(n.index-1,e.length)],s=e[this.getNext(n.index+1,e.length)];if("OnBack"!==r.result||r.alreadyCutBack){if("OnBack"!==s.result||s.alreadyCutBack)return i;n=s}else n=r}else n=o;else{r=e[this.getNext(n.index-1,e.length)],s=e[this.getNext(n.index+1,e.length)];if("OnFront"===r.result||r.alreadyCutBack){if("OnFront"===s.result||s.alreadyCutBack)return i;n=s}else n=r}}return null},zPe.prototype.build=function(e){if(e){var t=e;if(t.length<1)return null;for(var e={back:null,front:null,plane:null},i=t[0],n=(e.plane=i,[]),o=[],r=1,s=t.length;r<s;r++){var a=t[r];if(a!==i)switch(this.classifyPolygon(i,a)){case"OnPlane":case"ToRight":o.push(a);break;case"ToLeft":n.push(a);break;case"Unknown":if(!a.element||"line"!==a.element.tag&&"text"!==a.element.tag){for(var l=this.splitPolygon(a,i),h=0;h<l.backPolygon.length;h++)l.backPolygon[h].name=l.backPolygon[h].name+"-back",n.push(l.backPolygon[h]);for(var d=0;d<l.frontPolygon.length;d++)l.frontPolygon[d].name=l.frontPolygon[d].name+"-front",o.push(l.frontPolygon[d])}else n.push(a)}}return 0<n.length&&(e.back=this.build(n)),0<o.length&&(e.front=this.build(o)),e}return this.build(this.chart.polygons)};var HPe=zPe;function zPe(e){this.epsilon=5e-4,this.chart=e}WPe.prototype.getStringBuilder=function(){var i=[],t=0;return{append:function(e){return i[t++]=e,this},remove:function(e,t){return i.splice(e,t||1),this},insert:function(e,t){return i.splice(e,0,t),this},toString:function(e){return i.join(e||"")}}},WPe.prototype.hexToValue=function(e){var t;return 0===e.indexOf("rgba(")?(t=e.slice(5,-1).split(","))?{red:parseInt(t[0],10),green:parseInt(t[1],10),blue:parseInt(t[2],10),alpha:parseFloat(t[3])}:null:0===e.indexOf("rgb(")?(t=e.slice(4,-1).split(","))?{red:parseInt(t[0],10),green:parseInt(t[1],10),blue:parseInt(t[2],10)}:null:(t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e))?{red:parseInt(t[1],16),green:parseInt(t[2],16),blue:parseInt(t[3],16)}:null},WPe.prototype.hexColor=function(e){var i,t=e.red,n=e.green,o=e.blue;return e.alpha?"rgba("+t.toString()+","+n.toString()+","+o.toString()+","+e.alpha+")":((i=[t.toString(16),n.toString(16),o.toString(16)]).forEach(function(e,t){1===e.length&&(i[t]="0"+e)}),"#"+i.join("").toUpperCase())},WPe.prototype.checkColorFormat=function(e){if(0===e.indexOf("rgba(")||0===e.indexOf("rgb(")){var t=e.substring(e.indexOf("(")+1,e.lastIndexOf(")")).split(",");if(3===t.length||4===t.length)return t.every(function(e){e=parseFloat(e);return!isNaN(e)&&0<=e&&e<=255})}else if(0===e.indexOf("#"))return(3===(t=e.substring(1)).length||6===t.length)&&/^[0-9A-Fa-f]{3,6}$/.test(t);return!1},WPe.prototype.drawText=function(e,t,i,n){var o=document.getElementById(e.id);if(null===o&&(o=document.createElementNS("http://www.w3.org/2000/svg","text")),1<t.length&&"string"!=typeof t)for(var r=0,s=0;s<t.length;s++){var a=document.createElementNS("http://www.w3.org/2000/svg","tspan");a.textContent=t[s],a.setAttribute("x",String(e.x)),a.setAttribute("dy",String(r)),o.appendChild(a),r=So(t[s],i,n.themeStyle.axisLabelFont).height}else o.textContent=t;return o=n.svgRenderer.setElementAttributes(e,o)},WPe.prototype.transform3DToVisible=function(e,t,i,n){var o,r;return null!=e.xAxis&&null!=e.yAxis?("Logarithmic"===e.xAxis.valueType&&0<t&&(t=Math.log(t)/Math.log(10)),o=e.yAxis.logBase,"Logarithmic"===e.yAxis.valueType&&0<i&&(i=Math.log(i)/Math.log(o)),n.requireInvertedAxis?(r=n.chartAxisLayoutPanel.seriesClipRect.x,o=n.chartAxisLayoutPanel.seriesClipRect.y,{x:r+e.yAxis.rect.width*ZPe(i,e.yAxis),y:o+e.xAxis.rect.height*(1-ZPe(t,e.xAxis))}):(r=e.xAxis.rect.x,n=e.yAxis.rect.y,{x:r+Math.round(e.xAxis.rect.width*ZPe(t,e.xAxis)),y:n+Math.round(e.yAxis.rect.height*(1-ZPe(i,e.yAxis)))})):{x:0,y:0}};var jPe=WPe;function WPe(){}UPe.prototype.polygon3D=function(e,t,i,n,o,r,s,a,l,h){var d;return 3===arguments.length?(this.calculateNormal(e,t,i),null):(2===arguments.length?(this.calculateNormal(e[0],e[1],e[2]),this.vectorPoints=e,this.calculateNormal(this.vectorPoints),(d=t).normal=this.normal,d.points=e,d.vectorPoints=this.vectorPoints,d.isSplit=!0,d.d=this.d):(this.calculateNormal(e[0],e[1],e[2]),this.vectorPoints=e,this.calculateNormal(this.vectorPoints),d={normal:this.normal,points:e,vectorPoints:this.vectorPoints,index:i,tag:t,name:a||null,strokeThickness:o,opacity:r,fill:s,d:this.d,text:h||"",polygonElement:e={tag:"path",parent:l}},1!==arguments.length&&(d.polygonElement=e)),d)},UPe.prototype.createLine=function(e,t,i,n,o,r){var s=e.width,a=[];return a[0]=this.vector.vector3D(t,i,r),a[1]=this.vector.vector3D(t+s,o+s,r),a[2]=this.vector.vector3D(n,o,r),this.line3D(e,a)},UPe.prototype.line3D=function(e,t){t=this.polygon3D(t);return t.element=e,t},UPe.prototype.text3D=function(e,t){t=this.polygon3D(t);return t.element=e,t},UPe.prototype.createCylinder=function(e,t,i,n,o,r,s,a,l,h,d){var p,c,u,g,m=0,f=24,y=360/f,v=Math.PI/180,b=(e.z+t.z)/2,w=[],C=[],S=[],A=[],x=t.y-e.y<t.z-e.z?(t.y-e.y)/2:(t.z-e.z)/2,I=t.x-e.x<t.z-e.z?(t.x-e.x)/2:(t.z-e.z)/2,T=(e.x+t.x)/2,E=(e.y+t.y)/2;switch(o){case"Bar":case"StackingBar":case"StackingBar100":for(f++;f--;)c=E+x*Math.cos(m*y*v),u=b+x*Math.sin(m*y*v),C[m]={Y:c,Z:u},S.push(this.vector.vector3D(e.x,C[m].Y,C[m].Z)),A.push(this.vector.vector3D(t.x,C[m].Y,C[m].Z)),0<m&&(g=[this.vector.vector3D(e.x,C[m-1].Y,C[m-1].Z),this.vector.vector3D(t.x,C[m-1].Y,C[m-1].Z),this.vector.vector3D(t.x,C[m].Y,C[m].Z),this.vector.vector3D(e.x,C[m].Y,C[m].Z)],w[m+1]=this.polygon3D(g,i,n,s,0,l,s,"-"+(m+1).toString()+"-"+h,d),KPe.addVisual(w[m+1],i)),m++;break;case"Column":case"StackingColumn":case"StackingColumn100":for(f++;f--;)p=T+I*Math.cos(m*y*v),u=b+I*Math.sin(m*y*v),C[m]={Y:p,Z:u},S.push(this.vector.vector3D(C[m].Y,e.y,C[m].Z)),A.push(this.vector.vector3D(C[m].Y,t.y,C[m].Z)),0<m&&(g=[this.vector.vector3D(C[m-1].Y,e.y,C[m-1].Z),this.vector.vector3D(C[m-1].Y,t.y,C[m-1].Z),this.vector.vector3D(C[m].Y,t.y,C[m].Z),this.vector.vector3D(C[m].Y,e.y,C[m].Z)],w[m+1]=this.polygon3D(g,i,n,s,0,l,s,"-"+(m+1).toString()+"-"+h,d),KPe.addVisual(w[m+1],i)),m++}return w[0]=this.polygon3D(A,i,n,r,0,l,s,"-0-"+h,d),w[1]=this.polygon3D(S,i,n,r,a,l,s,"-1-"+h,d),KPe.addVisual(w[0],i),KPe.addVisual(w[1],i),w},UPe.prototype.createBox=function(e,t,i,n,o,r,s,a,l,h,d,p){var c=[],u=[this.vector.vector3D(e.x,e.y,e.z),this.vector.vector3D(t.x,e.y,e.z),this.vector.vector3D(t.x,t.y,e.z),this.vector.vector3D(e.x,t.y,e.z)],g=[this.vector.vector3D(e.x,e.y,t.z),this.vector.vector3D(t.x,e.y,t.z),this.vector.vector3D(t.x,t.y,t.z),this.vector.vector3D(e.x,t.y,t.z)],m=[this.vector.vector3D(e.x,e.y,t.z),this.vector.vector3D(t.x,e.y,t.z),this.vector.vector3D(t.x,e.y,e.z),this.vector.vector3D(e.x,e.y,e.z)],f=[this.vector.vector3D(e.x,t.y,t.z),this.vector.vector3D(t.x,t.y,t.z),this.vector.vector3D(t.x,t.y,e.z),this.vector.vector3D(e.x,t.y,e.z)],y=[this.vector.vector3D(e.x,e.y,e.z),this.vector.vector3D(e.x,e.y,t.z),this.vector.vector3D(e.x,t.y,t.z),this.vector.vector3D(e.x,t.y,e.z)],t=[this.vector.vector3D(t.x,e.y,e.z),this.vector.vector3D(t.x,e.y,t.z),this.vector.vector3D(t.x,t.y,t.z),this.vector.vector3D(t.x,t.y,e.z)];return h?(c[0]=this.polygon3D(u,i,n,o,s,a,r,"-0-"+h,d,p),c[1]=this.polygon3D(g,i,n,o,s,a,r,"-1-"+h,d,p),c[2]=this.polygon3D(m,i,n,o,s,a,r,"-2-"+h,d,p),c[3]=this.polygon3D(f,i,n,o,s,a,r,"-3-"+h,d,p),c[4]=this.polygon3D(y,i,n,o,s,a,r,"-4-"+h,d,p),c[5]=this.polygon3D(t,i,n,o,s,a,r,"-5-"+h,d,p)):(c[0]=this.polygon3D(u,i,n,o,s,a,r,"-0-"+n,d,p),c[1]=this.polygon3D(g,i,n,o,s,a,r,"-1-"+n,d,p),c[2]=this.polygon3D(m,i,n,o,s,a,r,"-2-"+n,d,p),c[3]=this.polygon3D(f,i,n,o,s,a,r,"-3-"+n,d,p),c[4]=this.polygon3D(y,i,n,o,s,a,r,"-4-"+n,d,p),c[5]=this.polygon3D(t,i,n,o,s,a,r,"-5-"+n,d,p)),l?(KPe.addVisual(c[0],i),KPe.addVisual(c[1],i),KPe.addVisual(c[2],i),KPe.addVisual(c[3],i),KPe.addVisual(c[4],i),KPe.addVisual(c[5],i)):(KPe.addVisual(c[5],i),KPe.addVisual(c[4],i),KPe.addVisual(c[0],i),KPe.addVisual(c[1],i),KPe.addVisual(c[2],i),KPe.addVisual(c[3],i)),c},UPe.prototype.calculateNormal=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(3<=e.length){var i=e[0],n=e[1],o=e[2],r=this.vector.vector3DMinus(i,n),o=this.vector.vector3DMinus(o,n),n=this.vector.vector3DMultiply(r,o),r=this.vector.getLength(n);r<this.epsilon&&(r=1),this.normal=this.vector.vector3D(n.x/r,n.y/r,n.z/r),this.d=-(this.normal.x*i.x+this.normal.y*i.y+this.normal.z*i.z),e[3]&&(e[3].normal=this.normal,e[3].d=this.d)}else{var s=e[0];this.calculateNormal(s[0],s[1],s[2],e[1]);for(var a=3;a<s.length&&this.test();a++)this.calculateNormal(s[a],s[0],s[a/2])}},UPe.prototype.test=function(){return!this.vector.isValid(this.normal)},UPe.prototype.transform=function(e,t){if(null!=t.points){for(var i=0;i<t.points.length;i++)t.vectorPoints[i]=t.points[i]=GPe.getMatrixVectorMultiple(e,t.points[i]);this.calculateNormal(t.vectorPoints,t)}},UPe.prototype.getNormal=function(e,t){if(null!=t){s=this.vector.getNormal(this.matrixObj.getMatrixVectorMultiple(e,t[0]),GPe.getMatrixVectorMultiple(e,t[1]),this.matrixObj.getMatrixVectorMultiple(e,t[2]));for(var i=3;i<t.length&&!this.vector.isValid(s)&&t[i/2];i++)var n=GPe.getMatrixVectorMultiple(e,t[i]),o=GPe.getMatrixVectorMultiple(e,t[0]),r=GPe.getMatrixVectorMultiple(e,t[i/2]),s=this.vector.getNormal(n,o,r)}else s=GPe.getMatrixVectorAnd(e),this.vector.normalize();return s},UPe.prototype.createTextElement=function(e,t,i,n){var o=[],r=e.x,s=e.y,a=t.width,l=t.height;return o[0]=this.vector.vector3D(r,s,e.z),o[1]=this.vector.vector3D(r+a,s+l+n,e.z),o[2]=this.vector.vector3D(r+a+i,s+l+n,e.z),this.text3D(t,o)},UPe.prototype.drawLine=function(e,t){var i,n=PPe.transform;null!=n&&(i=t.transform3D.toScreen(e.vectorPoints[0],n),n=t.transform3D.toScreen(e.vectorPoints[2],n),i={id:e.element.id,x1:i.x,y1:i.y,x2:n.x,y2:n.y,"stroke-dasharray":"","stroke-width":e.element.width,stroke:e.element.stroke,opacity:e.element.opacity},t.chart3D.appendChild(t.svgRenderer.drawLine(i)),t.previousID&&t.isTouch&&(n=document.getElementById(t.previousID),e=document.getElementById(i.id),n)&&e&&e.parentNode.insertBefore(e,n.nextSibling),t.previousID=i.id)},UPe.prototype.drawTemplate=function(e,t){var i,n=e.element,o=PPe.transform;null!=o&&(i=n.label,e=t.transform3D.toScreen(e.vectorPoints[0],o),t.dataLabel3DModule.createDataLabelTemplate(i.series.dataLabelElement,i.series,i.series.dataLabel,i.series.visiblePoints[i.pointIndex],n.argsData,i.pointIndex,!1,e))},UPe.prototype.drawText=function(e,t){var i,n,o,r,s=e.element,a=PPe.transform;null!=a&&(i=(a=t.transform3D.toScreen(e.vectorPoints[0],a)).x,o=a.y,"text"===s.tag?(i={id:s.id,x:i,y:o,fill:s.font.color||s.fill,"font-size":s.font.size,"font-family":s.font.fontFamily,"font-style":s.font.fontStyle,"font-weight":s.font.fontWeight,opacity:s.font.opacity,"text-anchor":s.textAnchor,cursor:"default",transform:s.angle?"rotate("+s.angle+","+i+","+o+")":""},o=t.svg3DRenderer.drawText(i,s.label.text,e.element.font,t),-1<s.id.indexOf("-axis-title")&&o.setAttribute("aria-hidden","true"),t.chart3D.append(o)):(e=(i=s.series).yAxis&&i.yAxis.labelFormat?i.yAxis.labelFormat:"",o=So(s.point.text||s.point.y+e.substring(e.indexOf("}")+1),i.dataLabel.font,t.themeStyle.datalabelFont),e=i.dataLabel.margin,n=o.width+e.left+e.right,o=o.height+e.top+e.bottom,r=a.x,a=a.y,r=r-e.left/2+e.right/2,a=a-e.top/2-o/e.top+e.bottom/2,e=i.index,this.dataLabelSymbol(e,i,s.pointIndex,r,a,n,o,t)))},UPe.prototype.dataLabelSymbol=function(e,t,i,n,o,r,s,a){e={id:a.element.id+"-svg-data-label-series-"+e+"-point-"+i,fill:t.dataLabel.fill,"stroke-width":t.dataLabel.border.width,"stroke-dasharray":t.dataLabel.border.dashArray,stroke:t.dataLabel.border.color,opacity:t.dataLabel.opacity,visibility:"",d:"M "+(n+-r/2)+" "+(o+-s/2)+" L "+(n+r/2)+" "+(o+-s/2)+" L "+(n+r/2)+" "+(o+s/2)+" L "+(n+-r/2)+" "+(o+s/2)+" L "+(n+-r/2)+" "+(o+-s/2)+" z"},i=a.svgRenderer.drawPath(e);a.chart3D.append(i)},UPe.prototype.draw=function(e,t){if(!(null==e.vectorPoints||e.vectorPoints.length<=0)){var i=PPe.transform,n=t.svg3DRenderer.getStringBuilder(),o=e.fill,r=(t.svg3DRenderer.checkColorFormat(o)||"transparent"!==o&&(o=Y0e(o)),{StartPoint:null});if(null!=i){r.StartPoint=t.transform3D.toScreen(e.vectorPoints[0],i),n.append("M "+r.StartPoint.x+" "+r.StartPoint.y+" ");for(var s=0;s<e.vectorPoints.length;s++){var a=t.transform3D.toScreen(e.vectorPoints[s],i);n.append("L "+a.x+" "+a.y+" ")}}var r=n.toString(),l="Light",h=2*(Math.abs(this.vector.vector3DAdd(e.normal,this.vector.vector3D(0,0,1)))-1),d=2*(Math.abs(this.vector.vector3DAdd(e.normal,this.vector.vector3D(0,1,0)))-1),p=2*(Math.abs(this.vector.vector3DAdd(e.normal,this.vector.vector3D(1,0,0)))-1),p=(!e.name||-1<e.name.indexOf("-wall-brush")||(h==p?(l="ZLight",o=this.applyZLight(o,t)):d==h||0!=h&&d<h?(l="XLight",o=this.applyXLight(o,t)):h<0?(l="ZLight",o=this.applyZLight(o,t)):l="Light"),{id:t.element.id+"-svg"+e.name,name:l,fill:o,stroke:"","stroke-width":e.strokeThickness,opacity:e.opacity,d:r}),d=t.svgRenderer.drawPath(p);e.text&&(d.setAttribute("aria-label",e.text),d.setAttribute("role","img")),e.name&&-1<e.name.indexOf("-wall-brush")&&d.setAttribute("aria-hidden","true"),-1<d.id.indexOf("0-region-series-0-point-0")&&(this.tabIndex||0<(h=e.polygonElement.parent.querySelectorAll('[id*="0-region-series-0-point-0"]')).length&&h[h.length-1].removeAttribute("tabindex"),d.setAttribute("tabindex","0"),this.tabIndex=!1),O0e(!1,e.polygonElement.parent,d,t.redraw,!0,"x","y",null,r),t.previousID&&t.isTouch&&(l=document.getElementById(t.previousID),o=document.getElementById(p.id),l)&&o&&o.parentNode.insertBefore(o,l.nextSibling),t.previousID=p.id}},UPe.prototype.applyXLight=function(e,t){e=t.svg3DRenderer.hexToValue(e);return e.red=parseInt((.7*e.red).toString(),10),e.green=parseInt((.7*e.green).toString(),10),e.blue=parseInt((.7*e.blue).toString(),10),t.svg3DRenderer.hexColor(e)},UPe.prototype.applyZLight=function(e,t){e=t.svg3DRenderer.hexToValue(e);return e.red=parseInt((.9*e.red).toString(),10),e.green=parseInt((.9*e.green).toString(),10),e.blue=parseInt((.9*e.blue).toString(),10),t.svg3DRenderer.hexColor(e)};var QPe=UPe;function UPe(){this.epsilon=1e-5,this.normal={x:0,y:0,z:0},this.vector=new BPe(0,0,0),this.vectorPoints=[],this.matrixObj=new LPe,this.tabIndex=!0}var qPe=new BPe(0,0,0),GPe=new LPe,YPe=new HPe,XPe=new QPe,KPe=new VPe;function JPe(e,t){for(var i,n=Number.MAX_VALUE,o=0;o<t.length;o++){var r=t[o],s=[];if(r.visible&&(e.name===r.xAxisName||"primaryXAxis"===e.name&&null===r.xAxisName))if((s=r.points.map(function(e){return e.xValue})).sort(function(e,t){return e-t}),1===s.length)r="DateTime"===e.valueType&&r.xMin===r.xMax?r.xMin-2592e4:r.xMin,0!==(i=s[0]-(je(r)?e.visibleRange.min:r))&&(n=Math.min(n,i));else for(var a=0;a<s.length;a++){var l=s[a];0<a&&l&&0!==(i=l-s[a-1])&&(n=Math.min(n,i))}}return n=n===Number.MAX_VALUE?1:n}function ZPe(e,t){var i=t.visibleRange,e=(e-i.min)/i.delta;return t.isAxisInverse?1-e:e}eBe.prototype.update3DWall=function(e){this.updateBackWall(e);for(var t=0;t<e.axisCollections.length;t++){var i=e.axisCollections[t],n=i.opposedPosition||i.isAxisOpposedPosition;"vertical"===i.orientation.toLowerCase()?n?this.updateRightWall(e):this.updateLeftWall(e):n?this.updateTopWall(e):this.updateBottomWall(e)}},eBe.prototype.updateTopWall=function(e){for(var t=0,i=e.chartAxisLayoutPanel.seriesClipRect,n=i.y,t=e.wallSize<n?n-e.wallSize:-(e.wallSize-n),n=e.vector.vector3D(i.x+i.width,-e.depth,n-.1),i=e.vector.vector3D(i.x,-.1,t),o=e.polygon.createBox(n,i,e,0,e.wallColor||e.themeStyle.leftWallColor,e.wallColor||e.themeStyle.leftWallColor,0,-1<e.theme.indexOf("Fluent2")?.3:-1<e.theme.indexOf("Bootstrap5")?.1:.5,!1,"top-wall-brush",e.chart3D),r=0;r<o.length;r++)e.polygon.transform(e.matrixObj.tilt(Math.PI/2),o[r])},eBe.prototype.updateRightWall=function(e){for(var t=e.chartAxisLayoutPanel.seriesClipRect,i=t.x+t.width,t={left:-e.depth,top:t.y,bottom:t.height+t.y,right:0},n=e.vector.vector3D(t.left,t.top,i+1.5),t=e.vector.vector3D(t.right,t.bottom,i+e.wallSize),o=e.polygon.createBox(n,t,e,0,e.wallColor||e.themeStyle.leftWallColor,e.wallColor||e.themeStyle.leftWallColor,0,-1<e.theme.indexOf("Fluent2")?.3:-1<e.theme.indexOf("Bootstrap5")?.1:.5,!1,"right-wall-brush",e.chart3D),r=0;r<o.length;r++)e.polygon.transform(e.matrixObj.turn(-Math.PI/2),o[r])},eBe.prototype.updateBackWall=function(e){var t=e.chartAxisLayoutPanel.seriesClipRect,i=e.vector.vector3D(t.x,t.y,0===e.depth?1.5:e.depth+e.wallSize),t=e.vector.vector3D(t.x+t.width,t.y+t.height,0===e.depth?1.5:e.depth);e.polygon.createBox(i,t,e,0,e.wallColor||e.themeStyle.backWallColor,e.wallColor||e.themeStyle.backWallColor,0,-1<e.theme.indexOf("Fluent2")?.3:-1<e.theme.indexOf("Bootstrap5")?.1:.25,!1,"back-wall-brush",e.chart3D)},eBe.prototype.updateLeftWall=function(e){for(var t=e.chartAxisLayoutPanel.seriesClipRect,i={left:-e.depth,top:t.y,bottom:t.height+t.y,right:0},t=t.x,n=e.vector.vector3D(i.left,i.top,t-.1),i=e.vector.vector3D(i.right,i.bottom,t-e.wallSize),o=e.polygon.createBox(n,i,e,0,e.wallColor||e.themeStyle.leftWallColor,e.wallColor||e.themeStyle.leftWallColor,0,-1<e.theme.indexOf("Fluent2")?.3:-1<e.theme.indexOf("Bootstrap5")?.1:.5,!1,"left-wall-brush",e.chart3D),r=0;r<o.length;r++)e.polygon.transform(e.matrixObj.turn(-Math.PI/2),o[r])},eBe.prototype.updateBottomWall=function(e){for(var t=e.chartAxisLayoutPanel.seriesClipRect,i=t.y+t.height,n=e.vector.vector3D(t.x+t.width,-e.depth,e.wallSize+i),t=e.vector.vector3D(t.x,-.1,i+1),o=e.polygon.createBox(t,n,e,0,e.wallColor||e.themeStyle.leftWallColor,e.wallColor||e.themeStyle.leftWallColor,0,-1<e.theme.indexOf("Fluent2")?.3:-1<e.theme.indexOf("Bootstrap5")?.1:.5,!1,"bottom-wall-brush",e.chart3D),r=0;r<o.length;r++)e.polygon.transform(e.matrixObj.tilt(Math.PI/2),o[r])};var $Pe=eBe;function eBe(){}iBe.prototype.drawAxes=function(e,t,i){t.majorGridLines.width&&this.drawGridLines3D(t,i,e),t.visible&&t.internalVisibility&&t.majorTickLines.width&&this.renderTicks3D(t,t.majorTickLines.height,t.majorTickLines.width,i,e),t.visible&&t.internalVisibility&&(this.drawAxisLabel(t,i,e),this.drawAxisTitle(t,i,e))},iBe.prototype.drawAxisTitle=function(e,t,i){var n,o,r,s,a,l,h,d,p;e.title&&(n={size:e.titleStyle.size||t.themeStyle.axisTitleFont.size,fontWeight:e.titleStyle.fontWeight||t.themeStyle.axisTitleFont.fontWeight,fontStyle:e.titleStyle.fontStyle||t.themeStyle.axisTitleFont.fontStyle,fontFamily:e.titleStyle.fontFamily||t.themeStyle.axisTitleFont.fontFamily,color:e.titleStyle.color,opacity:e.titleStyle.opacity},o=e.opposedPosition||e.isAxisOpposedPosition,r={width:t.availableSize.width,height:t.availableSize.height},(l=t.transform3D.transform3D(r)).viewingArea=r,l.rotation=0,l.tilt=0,l.depth=100,l.perspectiveAngle=90,t.transform3D.transform(l),"horizontal"===e.orientation.toLowerCase()?(s=0,r=So(e.title,e.titleStyle,t.themeStyle.axisTitleFont).height/2,s=e.titleRotation?e.titlePadding+10+e.labelPadding+e.titleSize.height/2:e.titlePadding+r+e.labelPadding+10,l=e.maxLabelSize.height+s,a=(h={text:e.title,location:{x:e.rect.width/2,y:l+e.majorTickLines.height+t.wallSize}}).location.x+e.rect.x,d=o?e.rect.y-h.location.y:h.location.y+e.rect.y,(p={width:0,height:0,angle:e.titleRotation||0,label:h,textAnchor:"middle",tag:"text",font:n,id:t.element.id+"-svg-axis-title-"+i,child:t.chart3D}).font.color=p.font.color||t.themeStyle.axisTitle):(r=So(e.title,e.titleStyle,t.themeStyle.axisTitleFont),s=0,s=e.titleRotation?e.labelPadding+e.titlePadding+e.titleSize.width/2:e.titlePadding+e.labelPadding,a=o?e.rect.x+(10+e.maxLabelSize.width+e.majorTickLines.height+t.wallSize+s):e.rect.x-(10+e.maxLabelSize.width+e.majorTickLines.height+t.wallSize+s),l=(null==e.titleRotation?o?90:-90:e.titleRotation)%360,d=(h={text:e.title,location:{x:r.width/2,y:0}}).location.y+(e.rect.y+e.rect.height)+e.rect.height/2*-1,(p={width:r.width,height:r.height,angle:l,label:h,textAnchor:"middle",tag:"text",font:n,id:t.element.id+"-svg-axis-title-"+i,child:t.chart3D}).font.color=p.font.color||t.themeStyle.axisTitle),p.font.fontFamily=p.font.fontFamily||t.themeStyle.axisTitleFont.fontFamily,t.graphics.addVisual(t.polygon.createTextElement(t.vector.vector3D(a,d,0),p,10,10),t))},iBe.prototype.textTrim=function(e,t,i,n){var o,r=t.length;if(So(t,i,n).width>e){for(var s=r-1;0<=s;--s)if(So(o=t.substring(0,s)+"...",i,n).width<=e)return o;return""}return t},iBe.prototype.multipleRows=function(e,t,i,n,o){for(var r,s,a=[],l=e-1;0<=l;l--)s=So((r=n.visibleLabels[l]).text,n.labelStyle,o),t<ZPe(l,n)*n.rect.width+n.rect.x+s.width/2?(r.index=r.index||0,a.push(r.index),i.index=i.index>r.index?i.index:r.index+1):i.index=(-1<a.indexOf(r.index)?i:r).index},iBe.prototype.drawAxisLabel=function(e,t,i){for(var n=[],o=e.visibleLabels.length,r=t.chartAxisLayoutPanel.seriesClipRect,s=e.opposedPosition||e.isAxisOpposedPosition,a=e.angle?5:10,l=r.y+(!s&&r.height),h=r.x+(s&&r.width),d=0;d<o;d++)if(!je(e.visibleLabels[d].text)){var p=0,c=0,u=(e.visibleLabels[d].originalText=e.visibleLabels[d].text,void 0),g=So(e.visibleLabels[d].text,e.labelStyle,t.themeStyle.axisLabelFont),m=(e.visibleLabels[d].value-e.visibleRange.min)/e.visibleRange.delta,m=e.isInversed||e.isAxisInverse?1-m:m,m=(m=isNaN(m)?0:m,u="horizontal"===e.orientation.toLowerCase()?(p=Math.round(e.rect.width*m)+r.x+e.plotOffset,c=s?l-t.wallSize-e.majorTickLines.height-e.labelPadding-a/2:l+t.wallSize+e.majorTickLines.height+a+e.labelPadding,"middle"):(c=Math.round(e.plotOffset+e.rect.y+g.height/4+e.rect.height*(1-m)),m=0,m=90===e.labelRotation||-90===e.labelRotation||270===e.labelRotation||-270===e.labelRotation?2*a:a,p=s?e.rect.x+e.majorTickLines.height+m+e.labelPadding:h-t.wallSize-e.majorTickLines.height-m+e.labelPadding,s?e.isRTLEnabled?"end":"start":e.isRTLEnabled?"start":"end"),n.push({x:p,y:c,size:g}),e.rect.width/e.visibleLabels.length-5),f=n[d];if((f.x>e.rect.x&&0===d||f.x+f.size.width/2>e.rect.x+e.rect.width&&d===e.visibleLabels.length-1)&&"Trim"!==e.labelIntersectAction&&e.labelIntersectAction.indexOf("wrap")<0){if("Hide"===e.edgeLabelPlacement)continue;"Shift"===e.edgeLabelPlacement&&(0===d?f.x=p=e.rect.x+f.size.width/2:d===e.visibleLabels.length-1&&(f.x=p=e.rect.x+e.rect.width-f.size.width/2))}if("horizontal"===e.orientation.toLowerCase())if(e.labelRotation){var y=e.labelRotation;c+=kye(e.labelStyle,e.visibleLabels[d].text,y,t,t.themeStyle.axisLabelFont).height/2}else if("Trim"===e.labelIntersectAction)e.visibleLabels[d].text=this.textTrim(m,e.visibleLabels[d].text,e.labelStyle,t.themeStyle.axisLabelFont);else if(!e.angle||"Rotate45"!==e.labelIntersectAction&&"Rotate90"!==e.labelIntersectAction){if("MultipleRows"===e.labelIntersectAction)y=f.x,y-=g.width/2,this.multipleRows(d,y,e.visibleLabels[d],e,t.themeStyle.axisLabelFont),c=e.visibleLabels[d].index?c+e.visibleLabels[d].index*(g.height+5):c;else if("Hide"===e.labelIntersectAction){for(var v=!1,b=0;b<d;b++)if(n[b].x+n[b].size.width/2>=n[d].x-n[d].size.width/2){v=!0;break}if(v)continue}}else c+=kye(e.labelStyle,e.visibleLabels[d].text,e.angle,t,t.themeStyle.axisLabelFont).height/2;m={size:e.visibleLabels[d].labelStyle.size,fontWeight:e.visibleLabels[d].labelStyle.fontWeight,fontStyle:e.visibleLabels[d].labelStyle.fontStyle,fontFamily:e.visibleLabels[d].labelStyle.fontFamily,color:e.visibleLabels[d].labelStyle.color,opacity:e.visibleLabels[d].labelStyle.opacity},f={width:g.width,height:g.height,label:e.visibleLabels[d],textAnchor:u,tag:"text",font:m,id:t.element.id+"-"+i+"-axis-label-"+d,child:t.chart3D,angle:e.angle};f.font.color=f.font.color||t.themeStyle.axisLabel,f.font.fontFamily=f.font.fontFamily||t.themeStyle.axisLabelFont.fontFamily,t.graphics.addVisual(t.polygon.createTextElement(t.vector.vector3D(p,c,0),f,10,10),t)}},iBe.prototype.renderTicks3D=function(e,t,i,n,o){var r=e.visibleLabels.length,s=n.chartAxisLayoutPanel.seriesClipRect,a="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?.5:0;r+="Category"===e.valueType&&0<r&&"BetweenTicks"===e.labelPlacement?1:0;for(var l=0;l<r;l++){var h=0,d=0,p=0,c=0,u=(("DateTimeCategory"!==e.valueType?e.visibleLabels[l]?e.visibleLabels[l].value-a:e.visibleLabels[l-1].value+e.visibleRange.interval-a:e.visibleLabels[l].value?e.visibleLabels[l].value-a:e.visibleRange.max)-e.visibleRange.min)/e.visibleRange.delta,u=e.isInversed||e.isAxisInverse?1-u:u,g=(u=isNaN(u)?0:u,"horizontal"===e.orientation.toLowerCase()?d=h=Math.round(e.rect.width*u)+s.x+e.plotOffset:p=c=Math.round(e.plotOffset+e.rect.height*(1-u))+e.rect.y,this.calculatePosition3D(e,t,i,h,p,d,c,n)),m={width:e.majorTickLines.width,opacity:1,stroke:e.majorTickLines.color||n.themeStyle.majorTickLine,child:n.chart3D,tag:"line",id:""};if(m.id=n.element.id+"-"+o+"-major-tick-lines-"+l,n.graphics.addVisual(n.polygon.createLine(m,g.x1,g.y1,g.x2,g.y2,0),n),e.minorGridLines.width&&0<e.minorTicksPerInterval&&l<r-1)for(var f=e.visibleRange.interval/(e.minorTicksPerInterval+1),y=0;y<e.minorTicksPerInterval;y++){u=ZPe(e.visibleLabels[l].value+f*(y+1),e),u=isNaN(u)?0:u,"horizontal"===e.orientation.toLowerCase()?h=d=Math.round(e.plotOffset+s.width*u+s.x):p=c=Math.round(e.plotOffset+s.height*(1-u))+e.rect.y;var v=this.calculatePosition3D(e,t,i,h,p,d,c,n),b={width:e.minorTickLines.width,opacity:.6,stroke:e.minorTickLines.color||n.themeStyle.minorTickLine,child:n.chart3D,tag:"line",id:""};b.id=n.element.id+"-"+o+"-minor-tick-lines-"+l+"-"+y,n.graphics.addVisual(n.polygon.createLine(b,v.x1,v.y1,v.x2,v.y2,0),n)}}},iBe.prototype.calculatePosition3D=function(e,t,i,n,o,r,s,a){var l=e.opposedPosition||e.isAxisOpposedPosition,h=a.chartAxisLayoutPanel.seriesClipRect,d=h.y+(!l&&h.height),h=h.x+(l&&h.width);return"horizontal"===e.orientation.toLowerCase()?(o=0,s=l?t:o+t,o+=e=l?d-a.wallSize-t:d+a.wallSize-t/2,s+=e,n=r=n):(n=0,r=l?n+t:t,n+=d=l?h+a.wallSize:h-a.wallSize-t,r+=d,o=s=o),{x1:n,y1:o,x2:r,y2:s}},iBe.prototype.drawGridLines3D=function(e,t,i){if(null!=e){var n=e.visibleLabels.length,o=e.opposedPosition||e.isAxisOpposedPosition,r=e.orientation,s="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?.5:0,a=(n+="Category"===e.valueType&&0<n&&"BetweenTicks"===e.labelPlacement?1:0,t.chartAxisLayoutPanel.seriesClipRect);if("horizontal"===r.toLowerCase()){var l=void 0;for(l=0;l<n;l++){var h=ZPe("DateTimeCategory"!==e.valueType?e.visibleLabels[l]?e.visibleLabels[l].value-s:e.visibleLabels[l-1].value+e.visibleRange.interval-s:e.visibleLabels[l].value?e.visibleLabels[l].value-s:e.visibleRange.max,e),d=(h=isNaN(h)?0:h,f=x=Math.round(e.rect.width*h)+a.x+e.plotOffset,y=a.y,v=a.y+a.height,2<t.depth?t.depth-2:1),p=a.y+(!o&&a.height),c=((w={opacity:1,width:e.majorGridLines.width,stroke:e.majorGridLines.color||t.themeStyle.majorGridLine,child:t.chart3D,tag:"line",id:""}).id=t.element.id+"-"+i+"-grid-lines-"+l,t.graphics.addVisual(t.polygon.createLine(w,x,y,f,v,d),t),{opacity:w.opacity,width:w.width,stroke:w.stroke,child:w.child,tag:w.tag,id:""}),u=(c.id=w.id+"-parallel",c.id=t.element.id+"-"+i+"-parallel-grid-lines-"+l,t.polygon.createLine(c,f,0,f,-d,p));if(t.polygon.transform(t.matrixObj.tilt(Math.PI/2),u),t.graphics.addVisual(u,t),e.minorGridLines.width&&0<e.minorTicksPerInterval&&l<n-1)for(var g=e.visibleRange.interval/(e.minorTicksPerInterval+1),m=0;m<e.minorTicksPerInterval;m++){h=ZPe(e.visibleLabels[l].value+g*(m+1),e),h=isNaN(h)?0:h;var f=x=Math.round(a.width*h)+a.x,y=a.y,v=a.y+a.height,b={opacity:.6,width:e.minorGridLines.width,stroke:e.minorGridLines.color||t.themeStyle.minorGridLine,child:t.chart3D,tag:"line",id:""},b=(b.id=t.element.id+"-"+i+"-minor-grid-lines-"+l+"-"+m,t.graphics.addVisual(t.polygon.createLine(b,x,y,f,v,d),t),{opacity:b.opacity,width:b.width,stroke:b.stroke,child:b.child,tag:b.tag,id:""}),b=(b.id=t.element.id+"-"+i+"-parallel-minor-grid-lines-"+l+"-"+m,t.polygon.createLine(b,f,0,f,-d,p));t.polygon.transform(t.matrixObj.tilt(Math.PI/2),b),t.graphics.addVisual(b,t)}}}else for(l=0;l<n;l++){var w,h=((e.visibleLabels[l]?e.visibleLabels[l].value-s:e.visibleLabels[l-1].value+e.visibleRange.interval-s)-e.visibleRange.min)/e.visibleRange.delta,d=(x=a.x,y=Math.round(e.rect.height*(1-h))+.5,y+=e.rect.y,f=x+a.width,v=y,2<t.depth?t.depth-2:1),C=((w={opacity:1,width:e.majorGridLines.width,stroke:e.majorGridLines.color||t.themeStyle.majorGridLine,axisName:e.name,child:t.chart3D,tag:"line",id:""}).id=t.element.id+"-"+i+"-grid-lines-"+l,t.graphics.addVisual(t.polygon.createLine(w,x,y,f,v,d),t),a.x+(o&&a.width+1)),S={opacity:w.opacity,width:w.width,stroke:w.stroke,child:w.child,tag:w.tag,id:""},u=(S.id=t.element.id+"-"+i+"-parallel-grid-lines-"+l,t.polygon.createLine(S,-d,v,0,v,C));if(t.polygon.transform(t.matrixObj.turn(-Math.PI/2),u),t.graphics.addVisual(u,t),e.minorGridLines.width&&0<e.minorTicksPerInterval&&l<n-1){g=e.visibleRange.interval/(e.minorTicksPerInterval+1);for(m=0;m<e.minorTicksPerInterval;m++){var A=ZPe(e.visibleLabels[l].value+g*(m+1),e),x=a.x,A=(y=Math.round(e.rect.height*(1-A))+.5,y+=e.rect.y,f=x+a.width,v=y,{opacity:.6,width:e.minorGridLines.width,stroke:e.minorGridLines.color||t.themeStyle.minorGridLine,axisName:e.name,child:t.chart3D,tag:"line",id:""}),A=(A.id=t.element.id+"-"+i+"-minor-grid-lines-"+l+"-"+m,t.graphics.addVisual(t.polygon.createLine(A,x,y,f,v,d),t),{opacity:A.opacity,width:A.width,stroke:A.stroke,child:A.child,tag:A.tag,id:""}),A=(A.id=t.element.id+"-"+i+"-parallel-minor-grid-lines-"+l+m,t.polygon.createLine(A,-d,v,0,v,C));t.polygon.transform(t.matrixObj.turn(-Math.PI/2),A),t.graphics.addVisual(A,t)}}}}};var tBe=iBe;function iBe(){}Object.defineProperty(oBe.prototype,"start",{get:function(){return this.mStart},enumerable:!0,configurable:!0}),Object.defineProperty(oBe.prototype,"end",{get:function(){return this.mEnd},enumerable:!0,configurable:!0}),Object.defineProperty(oBe.prototype,"delta",{get:function(){return this.mEnd-this.mStart},enumerable:!0,configurable:!0});var nBe=oBe;function oBe(e,t){e<t?(this.mStart=e,this.mEnd=t):(this.mStart=t,this.mEnd=e)}sBe.prototype.calculateNumericNiceInterval=function(e,t,i){var n=C0e(i,e),o=t/n;if(je(e.desiredIntervals))for(var r=Math.pow(10,Math.floor(Bye(o,10))),s=0,a=e.intervalDivs;s<a.length;s++){var l=r*a[s];if(n<t/l)break;o=l}return o},sBe.prototype.getActualRange=function(e,t){this.initializeDoubleRange(e),!e.startFromZero&&0<this.isColumn?(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&&0<e.doubleRange.start?e.actualRange.min=0:e.actualRange.min=e.doubleRange.start-(this.isStacking?0: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)},sBe.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=-1<e.valueType.indexOf("Category")?this.max:this.min+1),e.doubleRange=new nBe(this.min,this.max),e.actualRange={}},sBe.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t,this.chart)},sBe.prototype.calculateRange=function(e){if(this.min=null,this.max=null,!b0e(e))for(var t=0,i=e.series;t<i.length;t++){var n=i[t];n.visible&&(this.paddingInterval=0,je(n.points)||(e.maxPointLength=n.points.length),e.maxPointLength=n.points.length,!(-1<n.type.indexOf("Column")&&"Horizontal"===e.orientation||-1<n.type.indexOf("Bar")&&"Vertical"===e.orientation)||"Double"!==n.xAxis.valueType&&"DateTime"!==n.xAxis.valueType||"Auto"!==n.xAxis.rangePadding||(this.paddingInterval=.5*JPe(n.xAxis,e.series)),"Horizontal"===e.orientation&&(this.chart.requireInvertedAxis?this.yAxisRange(e,n):this.findMinMax(n.xMin-this.paddingInterval,n.xMax+this.paddingInterval)),"Vertical"===e.orientation)&&(this.isColumn+=-1!==n.type.indexOf("Column")||-1!==n.type.indexOf("Bar")?1:0,this.isStacking=-1!==n.type.indexOf("Stacking"),this.chart.requireInvertedAxis?this.findMinMax(n.xMin-this.paddingInterval,n.xMax+this.paddingInterval):this.yAxisRange(e,n))}},sBe.prototype.yAxisRange=function(e,t){this.findMinMax(t.yMin,t.yMax)},sBe.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)},sBe.prototype.applyRangePadding=function(e,t){var i,n,o=e.actualRange.min,r=e.actualRange.max;b0e(e)||(i=e.actualRange.interval,"Additional"===(n=e.getRangePadding(this.chart))||"Round"===n?this.findAdditional(e,o,r,i,t):"Normal"===n?this.findNormal(e,o,r,i,t):this.updateActualRange(e,o,r,i)),e.actualRange.delta=e.actualRange.max-e.actualRange.min,this.calculateVisibleRange(t,e)},sBe.prototype.updateActualRange=function(e,t,i,n){e.actualRange={min:null!=e.minimum?e.minimum:t,max:null!=e.maximum?e.maximum:i,interval:null!=e.interval?e.interval:n,delta:e.actualRange.delta}},sBe.prototype.findAdditional=function(e,t,i,n,o){t=Math.floor(t/n)*n,i=Math.ceil(i/n)*n;"Additional"===e.rangePadding&&(t-=n,i+=n),je(e.desiredIntervals)||(n=this.calculateNumericNiceInterval(e,i-t,o)),this.updateActualRange(e,t,i,n)},sBe.prototype.findNormal=function(e,t,i,n,o){var r,s=t;t<0?(n+(r=t+.05*t)%n<=.365*n&&(r-=n),r%n<(s=0)&&(r=r-n-r%n)):0<(r=t<5/6*i?0:t-.5*(i-t))%n&&(r-=r%n),n-(t=0<i?i+.05*(i-s):i-.05*(i-s))%n<=.365*n&&(t+=n),e.doubleRange=new nBe(r,t=0<t%n?t+n-t%n:t),(0===r||r<0&&t<0)&&(n=this.calculateNumericNiceInterval(e,e.doubleRange.delta,o),t=Math.ceil(t/n)*n),this.updateActualRange(e,r,t,n)},sBe.prototype.calculateVisibleRange=function(e,t){if(t.visibleRange={max:t.actualRange.max,min:t.actualRange.min,delta:t.actualRange.delta,interval:t.actualRange.interval},t.maximum&&"Vertical"===t.orientation&&"Auto"===t.rangePadding){for(var i=void 0,n=t.visibleRange.min;n<=t.visibleRange.max&&i!==n;n+=t.visibleRange.interval)i=n;i<t.visibleRange.max&&(t.visibleRange.max=i+t.visibleRange.interval)}t.triggerRangeRender(this.chart,t.visibleRange.min,t.visibleRange.max,t.visibleRange.interval)},sBe.prototype.calculateVisibleLabels=function(e,t){e.visibleLabels=[];var i,n,o=e.visibleRange.min,r=this.getFormat(e),s=null!==r.match("{value}"),a=0,l=0;for(e.labelFormat&&-1<e.labelFormat.indexOf("n")&&(l=parseInt(e.labelFormat.substring(1,e.labelFormat.length),10)),e.format=t.intl.getNumberFormat({format:s?"":r,useGrouping:t.useGroupingSeparator}),e.startLabel=e.format(e.visibleRange.min),e.endLabel=e.format(e.visibleRange.max),e.visibleRange.interval&&0<=(e.visibleRange.interval+"").indexOf(".")&&(a=(e.visibleRange.interval+"").split(".")[1].length);o<=e.visibleRange.max&&n!==o;o+=e.visibleRange.interval)n=o,i=Pe({},R("properties",e.labelStyle),null,!0),Rye(o,e.visibleRange)&&v0e(t,o,this.formatValue(e,s,r,o),i,e);o&&0<=(o+"").indexOf(".")&&10<(o+"").split(".")[1].length&&(o=(o+"").split(".")[1].length>(l||a)?+o.toFixed(l||a):o)<=e.visibleRange.max&&v0e(t,o,this.formatValue(e,s,r,o),i,e),e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},sBe.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}%":""},sBe.prototype.formatValue=function(e,t,i,n){var o=n%1?Number(n.toLocaleString().split(",").join("")):n;return t?i.replace("{value}",e.format(o)):i?e.format(n):e.format(o)},sBe.prototype.getModuleName=function(){return"Double3D"};var rBe=sBe;function sBe(e){this.isColumn=0,this.isStacking=!1,this.chart=e}aBe=function(e,t){return(aBe=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])}))(e,t)};var aBe,lBe,yPe=function(e,t){function i(){this.constructor=e}aBe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},hBe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},dBe=(yPe(pBe,lBe=n),pBe.prototype.computeSize=function(e,t){var i=0;e.visible&&e.internalVisibility&&(i+=e.majorTickLines.height+e.findLabelSize(5,t)),(e.isAxisOpposedPosition?this.farSizes:this.nearSizes).push(i)},hBe([e("100%")],pBe.prototype,"height",void 0),pBe);function pBe(){var e=null!==lBe&&lBe.apply(this,arguments)||this;return e.axes=[],e.nearSizes=[],e.farSizes=[],e}yPe(gBe,cBe=n),gBe.prototype.computeSize=function(e,t){var i=0;e.visible&&e.internalVisibility&&(i+=e.majorTickLines.height+e.findLabelSize(5,t)),(e.isAxisOpposedPosition?this.farSizes:this.nearSizes).push(i)},hBe([e("100%")],gBe.prototype,"width",void 0);var cBe,uBe=gBe;function gBe(){var e=null!==cBe&&cBe.apply(this,arguments)||this;return e.axes=[],e.nearSizes=[],e.farSizes=[],e}yPe(yBe,mBe=n),hBe([e(1)],yBe.prototype,"width",void 0),hBe([e(null)],yBe.prototype,"color",void 0);var mBe,fBe=yBe;function yBe(){return null!==mBe&&mBe.apply(this,arguments)||this}yPe(wBe,vBe=n),hBe([e(.7)],wBe.prototype,"width",void 0),hBe([e(null)],wBe.prototype,"color",void 0);var vBe,bBe=wBe;function wBe(){return null!==vBe&&vBe.apply(this,arguments)||this}yPe(ABe,CBe=n),hBe([e(0)],ABe.prototype,"width",void 0),hBe([e(5)],ABe.prototype,"height",void 0),hBe([e(null)],ABe.prototype,"color",void 0);var CBe,SBe=ABe;function ABe(){return null!==CBe&&CBe.apply(this,arguments)||this}yPe(TBe,xBe=n),hBe([e(0)],TBe.prototype,"width",void 0),hBe([e(5)],TBe.prototype,"height",void 0),hBe([e(null)],TBe.prototype,"color",void 0);var xBe,IBe=TBe;function TBe(){return null!==xBe&&xBe.apply(this,arguments)||this}yPe(DBe,EBe=n),DBe.prototype.findLabelSize=function(e,t){var i,n=0,o="Horizontal"===this.orientation;return this.title&&(n=je(i=this.titleRotation)?(this.titleSize=So(this.title,this.titleStyle,t.themeStyle.axisTitleFont),this.titleSize.height+e):(this.titleSize=kye(this.titleStyle,this.title,i,t,t.themeStyle.axisTitleFont),("Vertical"===this.orientation?this.titleSize.width:this.titleSize.height)+e),this.rect.width||this.rect.height)&&(i=o?this.rect.width:this.rect.height,this.titleCollection=hve(this.title,this.titleStyle,i,t.enableRtl,t.themeStyle.axisTitleFont),n*=this.titleCollection.length),n+e+this.titlePadding+this.labelPadding+("Vertical"===this.orientation?this.maxLabelSize.width:this.maxLabelSize.height)},DBe.prototype.triggerRangeRender=function(e,t,i,n){t={cancel:!1,axis:this,minimum:t,maximum:i,interval:n};e.trigger(Gme,t),t.cancel||(this.visibleRange={min:t.minimum,max:t.maximum,interval:t.interval,delta:t.maximum-t.minimum})},DBe.prototype.getRangePadding=function(e){var t=this.rangePadding;if("Auto"===t)switch(this.orientation){case"Horizontal":t=e.requireInvertedAxis?this.isStack100?"Round":"Normal":"None";break;case"Vertical":t=e.requireInvertedAxis?"None":this.isStack100?"Round":"Normal"}return t},DBe.prototype.getMaxLabelWidth=function(e){for(var t,i,n=0,o=!1,r=(this.angle=this.labelRotation,this.maxLabelSize=new Eo(0,0),this.labelIntersectAction),s=0,a=this.visibleLabels.length;s<a;s++){(t=Eye((i=this.visibleLabels[s]).originalText))?(i.size=So(i.originalText.replace(/<br>/g," "),this.labelStyle,e.themeStyle.axisLabelFont),i.breakLabelSize=So(this.enableTrim?i.text.join("<br>"):i.originalText,this.labelStyle,e.themeStyle.axisLabelFont)):i.size=So(i.text,this.labelStyle,e.themeStyle.axisLabelFont);var l=(t?i.breakLabelSize:i.size).width,l=(l>this.maxLabelSize.width&&(this.maxLabelSize.width=l,this.rotatedLabel=i.text),(t?i.breakLabelSize:i.size).height);if(l>this.maxLabelSize.height&&(this.maxLabelSize.height=l),t&&(i.text=this.enableTrim?i.text:i.originalText.split("<br>")),"None"!==r&&"Hide"!==r&&"Trim"!==r&&(("None"!==r||this.angle%360==0)&&"Horizontal"===this.orientation&&0<this.rect.width&&!o)){var h=(t?i.breakLabelSize:i.size).width,d=ZPe(i.value,this)*this.rect.width+this.rect.x;switch(d-=h/2,"Shift"===this.edgeLabelPlacement&&(0===s&&d<this.rect.x&&(d=this.rect.x),s===this.visibleLabels.length-1)&&d+h>this.rect.x+this.rect.width&&(d=this.rect.x+this.rect.width-h),r){case"MultipleRows":0<s&&this.findMultiRows(s,d,i,t);break;case"Rotate45":case"Rotate90":0<s&&(this.isAxisInverse?n<=d+h:d<=n)&&(this.angle="Rotate45"===r?45:90,o=!0);break;default:if(t){for(var p,c,u=[],g=0;g<i.text.length;g++)if(1<(p=pve(i.text[g],this.rect.width/this.visibleLabels.length,this.labelStyle,e.enableRtl,null,null,e.themeStyle.axisLabelFont)).length)for(var m=0;m<p.length;m++)c=p[m],u.push(c);else u.push(p[0]);i.text=u}else i.text=pve(i.text,this.rect.width/this.visibleLabels.length,this.labelStyle,e.enableRtl,null,null,e.themeStyle.axisLabelFont);var f=i.size.height*i.text.length;f>this.maxLabelSize.height&&(this.maxLabelSize.height=f)}n=this.isAxisInverse?d:d+h}}(0!==this.angle&&"Horizontal"===this.orientation||0!==this.angle&&"Vertical"===this.orientation)&&(this.rotatedLabel=je(this.rotatedLabel)?"":this.rotatedLabel,-360!==this.angle&&0!==this.angle&&-180!==this.angle&&180!==this.angle&&360!==this.angle&&Eye(this.rotatedLabel)&&(this.maxLabelSize=new Eo(this.maxLabelSize.height,this.maxLabelSize.width)),this.maxLabelSize=kye(this.labelStyle,this.rotatedLabel,this.angle,e,e.themeStyle.axisLabelFont))},DBe.prototype.findMultiRows=function(e,t,i,n){for(var o,r,s,a=[],l=e-1;0<=l;l--)o=this.visibleLabels[l],s=(n?o.breakLabelSize:o.size).width,r=ZPe(o.value,this)*this.rect.width+this.rect.x,(this.isAxisInverse?t+i.size.width>r-.5*s:t<r+.5*s)?(a.push(o.index),i.index=i.index>o.index?i.index:o.index+1):i.index=(-1<a.indexOf(o.index)?i:o).index;e=(n?i.breakLabelSize:i.size).height*i.index+5*(i.index-1);e>this.maxLabelSize.height&&(this.maxLabelSize.height=e)},DBe.prototype.getModule=function(e){"Double"===this.valueType?this.baseModule=new rBe(e):this.baseModule=e[l0e(this.valueType)+"3DModule"]},DBe.prototype.setIsInversedAndOpposedPosition=function(){this.isAxisOpposedPosition=this.opposedPosition||this.isRTLEnabled&&"Vertical"===this.orientation,this.isAxisInverse=this.isInversed||this.isRTLEnabled&&"Horizontal"===this.orientation},hBe([t({fontFamily:null,size:"12px",fontStyle:"Normal",fontWeight:"400",color:null},vPe)],DBe.prototype,"labelStyle",void 0),hBe([e("")],DBe.prototype,"title",void 0),hBe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},vPe)],DBe.prototype,"titleStyle",void 0),hBe([e("")],DBe.prototype,"labelFormat",void 0),hBe([e("")],DBe.prototype,"skeleton",void 0),hBe([e("DateTime")],DBe.prototype,"skeletonType",void 0),hBe([e(0)],DBe.prototype,"plotOffset",void 0),hBe([e(null)],DBe.prototype,"plotOffsetLeft",void 0),hBe([e(null)],DBe.prototype,"plotOffsetTop",void 0),hBe([e(null)],DBe.prototype,"plotOffsetRight",void 0),hBe([e(null)],DBe.prototype,"plotOffsetBottom",void 0),hBe([e(!1)],DBe.prototype,"isIndexed",void 0),hBe([e(10)],DBe.prototype,"logBase",void 0),hBe([e(0)],DBe.prototype,"columnIndex",void 0),hBe([e(0)],DBe.prototype,"rowIndex",void 0),hBe([e(1)],DBe.prototype,"span",void 0),hBe([e(null)],DBe.prototype,"desiredIntervals",void 0),hBe([e(3)],DBe.prototype,"maximumLabels",void 0),hBe([e(!1)],DBe.prototype,"opposedPosition",void 0),hBe([e("Auto")],DBe.prototype,"rangePadding",void 0),hBe([e("Double")],DBe.prototype,"valueType",void 0),hBe([e("None")],DBe.prototype,"edgeLabelPlacement",void 0),hBe([e("Auto")],DBe.prototype,"intervalType",void 0),hBe([e("OnTicks")],DBe.prototype,"labelPlacement",void 0),hBe([e("")],DBe.prototype,"name",void 0),hBe([e(!0)],DBe.prototype,"visible",void 0),hBe([e(0)],DBe.prototype,"minorTicksPerInterval",void 0),hBe([e(0)],DBe.prototype,"labelRotation",void 0),hBe([e(null)],DBe.prototype,"titleRotation",void 0),hBe([e(null)],DBe.prototype,"minimum",void 0),hBe([e(null)],DBe.prototype,"maximum",void 0),hBe([e(null)],DBe.prototype,"interval",void 0),hBe([e(34)],DBe.prototype,"maximumLabelWidth",void 0),hBe([e(!1)],DBe.prototype,"enableTrim",void 0),hBe([e(5)],DBe.prototype,"labelPadding",void 0),hBe([e(5)],DBe.prototype,"titlePadding",void 0),hBe([t({},SBe)],DBe.prototype,"majorTickLines",void 0),hBe([t({},IBe)],DBe.prototype,"minorTickLines",void 0),hBe([t({},fBe)],DBe.prototype,"majorGridLines",void 0),hBe([t({},bBe)],DBe.prototype,"minorGridLines",void 0),hBe([e(F.isDevice?"Rotate45":"Trim")],DBe.prototype,"labelIntersectAction",void 0),hBe([e(!1)],DBe.prototype,"isInversed",void 0),hBe([e(!0)],DBe.prototype,"startFromZero",void 0);var EBe,yPe=DBe;function DBe(e,t,i,n){e=EBe.call(this,e,t,i,n)||this;return e.visibleLabels=[],e.series=[],e.rect=new Do(void 0,void 0,0,0),e.isStack100=!1,e.updatedRect=null,e.isIntervalInDecimal=!0,e.intervalDivs=[10,5,2,1],e.titleCollection=[],e.titleSize=new Eo(0,0),e.internalVisibility=!0,e.isRTLEnabled=!1,e.angle=e.labelRotation,e}function MBe(e,t,i,n,o,r,s){void 0===o&&(o=new Eo(0,0)),void 0===r&&(r=new Eo(0,0)),void 0===s&&(s=1),this.text=e,this.originalText=n,this.value=t,this.labelStyle=i,this.size=o,this.breakLabelSize=r,this.index=s}kBe=function(e,t){return(kBe=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])}))(e,t)};var kBe,PBe,hBe=function(e,t){function i(){this.constructor=e}kBe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},BBe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},FBe=(hBe(LBe,PBe=n),BBe([e(!1)],LBe.prototype,"visible",void 0),BBe([e(null)],LBe.prototype,"name",void 0),BBe([e("transparent")],LBe.prototype,"fill",void 0),BBe([e(null)],LBe.prototype,"format",void 0),BBe([e(1)],LBe.prototype,"opacity",void 0),BBe([e(0)],LBe.prototype,"angle",void 0),BBe([e(!1)],LBe.prototype,"enableRotation",void 0),BBe([e("Middle")],LBe.prototype,"position",void 0),BBe([t({width:null,color:null},Rge)],LBe.prototype,"border",void 0),BBe([t({left:5,right:5,top:5,bottom:5},zge)],LBe.prototype,"margin",void 0),BBe([t({size:null,color:null,fontStyle:null,fontWeight:null,fontFamily:null},vPe)],LBe.prototype,"font",void 0),BBe([e(null)],LBe.prototype,"template",void 0),LBe);function LBe(){return null!==PBe&&PBe.apply(this,arguments)||this}hBe(NBe,RBe=n),BBe([e(null)],NBe.prototype,"fill",void 0),BBe([e("Gap")],NBe.prototype,"mode",void 0);var RBe,OBe=NBe;function NBe(){return null!==RBe&&RBe.apply(this,arguments)||this}var VBe,_Be=function(){this.symbolLocations=null,this.percentage=null,this.isSelect=!1},HBe=(hBe(zBe,VBe=n),zBe.prototype.processJsonData=function(){var e=0,t=new _Be,i=this.xName,n=this instanceof zBe&&this.dataLabel.name?this.dataLabel.name:"",o=(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,"Category"===this.xAxis.valueType)for(;e<o;)t=this.dataPoint(e,n,i),this.pushCategoryData(t,e,t.x),this.pushData(t,e),this.setEmptyPoint(t,e),e++;else if(-1<this.xAxis.valueType.indexOf("DateTime"))for(var r={skeleton:"full",type:"dateTime"},s=this.chart.intl.getDateParser(r),a=this.chart.intl.getDateFormat(r);e<o;)je((t=this.dataPoint(e,n,i)).x)||""===t.x?t.visible=!1:(t.x=new Date(Sa.parse.parseJson({val:t.x}).val),"DateTime"===this.xAxis.valueType?t.xValue=Date.parse(t.x.toString()):this.pushCategoryData(t,e,Date.parse(s(a(t.x))).toString()),this.pushData(t,e),this.setEmptyPoint(t,e)),e++;else for(;e<o;)(t=this.dataPoint(e,n,i)).xValue=t.x,this.pushData(t,e),this.setEmptyPoint(t,e),e++},zBe.prototype.pushData=function(e,t){e.index=t,e.yValue=e.y,(e.series=this).xMin=Math.min(this.xMin,e.xValue),this.xMax=Math.max(this.xMax,e.xValue),this.xData.push(e.xValue)},zBe.prototype.dataPoint=function(e,t,i){this.points[e]=new _Be;var n=this.points[e],e=this.currentViewData[e],o=this.get3DObjectValue;return n.x=o(i,e),n.interior=o(this.pointColorMapping,e),this instanceof zBe&&(n.y=o(this.yName,e),n.size=o(this.size,e),n.text=o(t,e),n.tooltip=o(this.tooltipMappingName,e)),n},zBe.prototype.get3DObjectValue=function(e,t){return t[e]},zBe.prototype.setEmptyPoint=function(e,t){if(!this.findVisibility(e))return e.visible=!0,null;switch(e.isEmpty=!0,(this instanceof zBe&&this).emptyPointSettings.mode){case"Zero":e.visible=!0,e.y=e.yValue=this.yData[t]=0;break;case"Average":this instanceof zBe&&(e.y=e.yValue=this.yData[t]=this.getAverage(this.yName,t)),e.visible=!0;break;case"Drop":case"Gap":this.yData[t]=null,e.visible=!1}},zBe.prototype.findVisibility=function(e){return this.setXYMinMax(e.yValue),this.yData.push(e.yValue),je(e.x)||je(e.y)||isNaN(+e.y)},zBe.prototype.setXYMinMax=function(e){var t="Logarithmic"===this.yAxis.valueType||"Logarithmic"===this.xAxis.valueType,i=e<0||"None"===this.yAxis.rangePadding,i=b0e(this.yAxis)||t||i?e:0;this.yMin=t?Math.min(this.yMin,je(i)||isNaN(i)||0===i||"0"===i.toString()||""===i.toString()?this.yMin:i):Math.min(this.yMin,je(i)||isNaN(i)?this.yMin:i),this.yMax=Math.max(this.yMax,je(e)||isNaN(e)?this.yMax:e)},zBe.prototype.pushCategoryData=function(e,t,i){if(this.chart.tooltip&&!this.visible)return null;this.xAxis.isIndexed?(this.xAxis.labels[t]?this.xAxis.labels[t]+=", "+i:this.xAxis.labels.push(i),e.xValue=t):(void 0===this.xAxis.indexLabels[i]&&(this.xAxis.indexLabels[i]=this.xAxis.labels.length,this.xAxis.labels.push(i)),e.xValue=this.xAxis.indexLabels[i])},zBe.prototype.getAverage=function(e,t,i){return(((i=void 0===i?this.currentViewData:i)[t-1]&&i[t-1][e]||0)+(i[t+1]&&i[t+1][e]||0))/2},zBe.prototype.refreshDataManager=function(e){var t=this,e=(this.chart=e).isAngular?(Object.keys(this.dataSource).length?this:e).dataSource:this.dataSource||e.dataSource;e instanceof me||!je(this.query)?this.dataModule.getData(this.dataModule.generateQuery().requiresCount()).then(function(e){return t.dataManagerSuccess(e)}):this.dataManagerSuccess({result:e,count:e.length},!1)},zBe.prototype.dataManagerSuccess=function(e,t){void 0===t&&(t=!0),this.currentViewData=e.count?e.result:[],this.chart.allowServerDataBinding=!1,this instanceof zBe&&(e={series:this,data:this.currentViewData,fill:this.interior},this.chart.trigger(Qme,e),this.interior=e.fill,this.currentViewData=e.data),this.processJsonData(),this.refreshChart(t),this.currentViewData=null},zBe.prototype.refreshChart=function(e){var t=this.chart;this instanceof zBe&&(t.visibleSeriesCount+=e?1:0),t.visibleSeries.length===t.visibleSeriesCount&&(t.refreshBound(),t.trigger("loaded",{chart:t})),this instanceof zBe&&(t.visibleSeriesCount+=e?0:1)},zBe.prototype.refreshAxisLabel=function(){if("Category"!==this.xAxis.valueType)return null;this.xAxis.labels=[],this.xAxis.indexLabels={};for(var e=0,t=this.xAxis.series;e<t.length;e++){var i=t[e];if(i.visible){i.xMin=1/0,i.xMax=-1/0;for(var n=0,o=i.points;n<o.length;n++){var r=o[n];i.pushCategoryData(r,r.index,r.x),i.xMin=Math.min(i.xMin,r.xValue),i.xMax=Math.max(i.xMax,r.xValue)}}}},zBe.prototype.findSeriesCollection=function(e,t,i){for(var n=[],o=0,r=t.axes;o<r.length;o++)for(var s=0,a=r[o].series;s<a.length;s++)for(var l=a[s],h=0,d=e.axes;h<d.length;h++)for(var p=0,c=d[h].series;p<c.length;p++){var u=c[p];u===l&&u.visible&&this.rectSeriesInChart(u,i)&&n.push(u)}return n},zBe.prototype.rectSeriesInChart=function(e,t){e=e.type.toLowerCase();return-1!==e.indexOf("column")||-1!==e.indexOf("bar")||t},zBe.prototype.calculateStackedValue=function(e,t){for(var i=0,n=t.columns;i<n.length;i++)for(var o=n[i],r=0,s=t.rows;r<s.length;r++){var a=s[r];this.calculateStackingValues(this.findSeriesCollection(o,a,!0),e)}},zBe.prototype.calculateStackingValues=function(e,t){for(var i,n,o,r,s,a,l=[],h=[],d=[],p=(t&&(d=this.findFrequencies(e)),[]),c=[],u=0;u<e.length;u++)p[(f=e[u]).stackingGroup]?void 0!==p[f.stackingGroup]&&p[f.stackingGroup].push(f):(p[f.stackingGroup]=[],p[f.stackingGroup].push(f));for(var g=Object.keys(p),m=0;m<g.length;m++){for(var f,y=[],v=[],b=0,w=p[g[m]];b<w.length;b++)if(-1!==(f=w[b]).type.indexOf("Stacking")){l[r=f.stackingGroup]||(l[r]=[],h[r]=[]),o=f.yData,i=[],n=[],y.push(f);for(var C=0,S=(c=Dye(f)).length;C<S;C++)a=+o[C],void(s=0)===l[r][c[C].xValue]&&(l[r][c[C].xValue]=0),void 0===h[r][c[C].xValue]&&(h[r][c[C].xValue]=0),t?(a=a/d[r][c[C].xValue]*100,a=isNaN(a)?0:a,c[C].percentage=+a.toFixed(2)):v[C]=v[C]?v[C]+Math.abs(a):Math.abs(a),0<=a?(s=l[r][c[C].xValue],l[r][c[C].xValue]+=a):(s=h[r][c[C].xValue],h[r][c[C].xValue]+=a),i.push(s),n.push(a+s),t&&100<n[C]&&(n[C]=100);f.stackedValues=new yve(i,n);var A="Logarithmic"===f.yAxis.valueType,x=-1!==f.type.indexOf("Column")||-1!==f.type.indexOf("Bar");f.yMin=A&&x&&f.yMin<1?f.yMin:f.yAxis.startFromZero&&-1<f.type.indexOf("100")&&"Auto"===f.yAxis.rangePadding&&0<=f.yMin?0:parseFloat(Math.min.apply(0,t?i:n).toFixed(10)),f.yMax=Math.max.apply(0,n),f.yMin>Math.min.apply(0,n)&&(f.yMin=t?-100:A&&x&&f.yMin<1?f.yMin:Math.min.apply(0,n)),f.yMax<Math.max.apply(0,i)&&(f.yMax=0)}this.findPercentageOfStacking(y,v,t)}},zBe.prototype.findPercentageOfStacking=function(e,t,i){for(var n=0,o=e;n<o.length;n++){var r=o[n];if(i)return null;for(var s=0,a=Dye(r);s<a.length;s++){var l=a[s];l.percentage=Math.abs(+(l.y/t[l.index]*100).toFixed(2))}}},zBe.prototype.findFrequencies=function(e){for(var t,i,n=[],o=0,r=e;o<r.length;o++){var s=r[o];if(s.yAxis.isStack100=-1!==s.type.indexOf("100"),i=this.getVisiblePoints(),-1!==s.type.indexOf("Stacking")){n[t=s.stackingGroup]||(n[t]=[]);for(var a=0,l=i.length;a<l;a++)void 0===n[t][i[a].xValue]&&(n[t][i[a].xValue]=0),0<s.yData[a]?n[t][i[a].xValue]+=s.yData[a]:n[t][i[a].xValue]-=s.yData[a]}}return n},zBe.prototype.renderSeries=function(e){var t=l0e(this.type);e[(t=t.replace("100",""))+"Series3DModule"]&&(this.visiblePoints=this.getVisiblePoints(),e[t+"Series3DModule"].draw(this,e),this.dataLabel.visible)&&this.visible&&e.dataLabel3DModule.render(this,this.chart,this.dataLabel)},zBe.prototype.getVisiblePoints=function(){for(var e,t=Pe([],this.points,null,!0),i=[],n=0,o=0;o<t.length;o++)je((e=t[o]).x)||(e.index=n++,i.push(e));return i},zBe.prototype.setPointColor=function(e,t){return t=e.interior||t,e.isEmpty&&this.emptyPointSettings.fill||t},zBe.prototype.getYValues=function(e){for(var t=[],i=e.length,n=0;n<i;n++)t.push(e[n].yValue);return t},zBe.prototype.getXValues=function(e){for(var t=[],i=e.length,n=0;n<i;n++)t.push(e[n].xValue);return t},zBe.prototype.getSegmentDepth=function(e){var t,i,n,o=this.chart.depth;return o=this.chart.enableSideBySidePlacement?(t=n=o/4,n*("Rectangle"===e.columnFacet?2.5:3)):(i=e.position-1,(t=(n=o/(2*(o=e.rectCount)+o+1))+n*i*3)+n*("Rectangle"===e.columnFacet?1.5:2)),{start:t,end:o,delta:o-t}},zBe.prototype.getSideBySidePositions=function(e){for(var t=e.chart,i=0,n=t.columns;i<n.length;i++)for(var o=n[i],r=0,s=t.rows;r<s.length;r++){var a=s[r];this.findRectPosition(e.findSeriesCollection(o,a,!1))}},zBe.prototype.findRectPosition=function(e){for(var t,i=[],n={rectCount:0,position:null},o=0;o<e.length;o++)-1!==(r=e[o]).type.indexOf("Stacking")||""!==r.groupName?(t=-1!==r.type.indexOf("Stacking")?r.stackingGroup:r.type+r.groupName)?void 0===i[t]?(r.position=n.rectCount,i[t]=n.rectCount++):r.position=i[t]:null===n.position?(n.rectCount++,r.position=n.rectCount,n.position=n.rectCount):r.position=n.position:(n.rectCount++,r.position=n.rectCount);for(var r,o=0;o<e.length;o++)(r=e[o]).rectCount=n.rectCount},zBe.prototype.getDoubleRange=function(e,t){var i,e=t<e?(i=t,e):(i=e,t);return{start:i,end:e,delta:e-i,median:(i+e)/2,isEmpty:isNaN(i)||isNaN(e)}},zBe.prototype.setStyle=function(e){return{interior:e.interior,opacity:e.opacity,dashArray:""}},zBe.prototype.getSideBySideInfo=function(e){var t=JPe((this.chart.currentSeries=e).xAxis,this.chart.visibleSeries),i=e.columnSpacing,n=null===e.columnWidth||isNaN(+e.columnWidth)?.7:Math.min(e.columnWidth,1),o=(this.getSideBySidePositions(e),e.position),r=e.rectCount,t=t*n,n=(o-(""===e.stackingGroup?1:0))/r-.5,o=this.getDoubleRange(n,n+1/r);return this.chart.enableSideBySidePlacement?(o.isEmpty||(e=i*(o=this.getDoubleRange(o.start*t,o.end*t)).delta,o=this.getDoubleRange(o.start+e/2,o.end-e/2)),o):this.getDoubleRange(-t/2,t/2)},BBe([e("")],zBe.prototype,"xName",void 0),BBe([e("")],zBe.prototype,"pointColorMapping",void 0),BBe([e(!0)],zBe.prototype,"visible",void 0),BBe([e(null)],zBe.prototype,"xAxisName",void 0),BBe([e(null)],zBe.prototype,"yAxisName",void 0),BBe([t({duration:2e3},Qge)],zBe.prototype,"animation",void 0),BBe([e(null)],zBe.prototype,"fill",void 0),BBe([e("")],zBe.prototype,"dataSource",void 0),BBe([e()],zBe.prototype,"query",void 0),BBe([t({},FBe)],zBe.prototype,"dataLabel",void 0),BBe([e("")],zBe.prototype,"name",void 0),BBe([e("")],zBe.prototype,"yName",void 0),BBe([e("")],zBe.prototype,"size",void 0),BBe([e("")],zBe.prototype,"stackingGroup",void 0),BBe([e(1)],zBe.prototype,"opacity",void 0),BBe([e("")],zBe.prototype,"groupName",void 0),BBe([e("Column")],zBe.prototype,"type",void 0),BBe([e(!0)],zBe.prototype,"enableTooltip",void 0),BBe([e("")],zBe.prototype,"tooltipFormat",void 0),BBe([e("")],zBe.prototype,"tooltipMappingName",void 0),BBe([e("SeriesType")],zBe.prototype,"legendShape",void 0),BBe([e("")],zBe.prototype,"legendImageUrl",void 0),BBe([t(null,OBe)],zBe.prototype,"emptyPointSettings",void 0),BBe([e(null)],zBe.prototype,"columnWidth",void 0),BBe([e("Rectangle")],zBe.prototype,"columnFacet",void 0),BBe([e(.1)],zBe.prototype,"columnSpacing",void 0),zBe);function zBe(e,t,i,n){e=VBe.call(this,e,t,i,n)||this;return e.currentViewData=[],e.clipRect=new Do(0,0,0,0),e.visibleSeriesCount=0,e.category="Series",e.isRectSeries=!1,e.all=!1,e}jBe=function(e,t){return(jBe=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])}))(e,t)};var jBe,WBe,hBe=function(e,t){function i(){this.constructor=e}jBe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},BBe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},BBe=(hBe(QBe,WBe=n),BBe([e(!1)],QBe.prototype,"enable",void 0),BBe([e(!0)],QBe.prototype,"enableMarker",void 0),BBe([e(null)],QBe.prototype,"fill",void 0),BBe([e(null)],QBe.prototype,"header",void 0),BBe([e(null)],QBe.prototype,"opacity",void 0),BBe([t({fontFamily:null,size:"12px",fontStyle:"Normal",fontWeight:null,color:null},Tge)],QBe.prototype,"textStyle",void 0),BBe([e(null)],QBe.prototype,"format",void 0),BBe([e(null)],QBe.prototype,"template",void 0),BBe([e(!0)],QBe.prototype,"enableAnimation",void 0),BBe([e(300)],QBe.prototype,"duration",void 0),BBe([e(1e3)],QBe.prototype,"fadeOutDuration",void 0),BBe([e("Move")],QBe.prototype,"fadeOutMode",void 0),BBe([e(!1)],QBe.prototype,"enableTextWrap",void 0),BBe([t({color:null,width:null},Rge)],QBe.prototype,"border",void 0),BBe([t({x:null,y:null},yge)],QBe.prototype,"location",void 0),QBe);function QBe(){return null!==WBe&&WBe.apply(this,arguments)||this}hBe(qBe,UBe=MAe),qBe.prototype.addEventListener=function(){var e;this.chart.isDestroyed||(e=F.isPointer?"pointerleave":"mouseleave",this.chart.on(e,this.mouseLeaveHandler,this),this.chart.on("tapHold",this.longPress,this),this.chart.on(F.touchMoveEvent,this.mouseMoveHandler,this),this.chart.on(F.touchEndEvent,this.mouseUpHandler,this))},qBe.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off("pointerleave",this.mouseLeaveHandler),this.chart.off("tapHold",this.longPress),this.chart.off(F.touchMoveEvent,this.mouseLeaveHandler),this.chart.off(F.touchMoveEvent,this.mouseMoveHandler),this.chart.off(F.touchEndEvent,this.mouseUpHandler))},qBe.prototype.mouseUpHandler=function(e){var t=this,i=this.control,n=this.get3dData(e);i.isTouch?(this.tooltip(e),"Move"===i.tooltip.fadeOutMode&&(this.removeTooltip(i.tooltip.fadeOutDuration),clearTimeout(this.timerId),this.timerId=+setTimeout(function(){t.removeBlurEffect()},500)),i.startMove&&"Move"===i.tooltip.fadeOutMode&&(this.removeTooltip(2e3),this.removeBlurEffect())):this.findData(n,this.previousPoints[0])||"Click"!==i.tooltip.fadeOutMode||(this.removeTooltip(0),this.removeBlurEffect())},qBe.prototype.mouseLeaveHandler=function(){this.removeTooltip(this.chart.tooltip.fadeOutDuration),this.removeBlurEffect()},qBe.prototype.mouseMoveHandler=function(e){var t=this.chart3D;t.mouseX=t.mouseX/t.scaleX,t.mouseY=t.mouseY/t.scaleY,t.disableTrackTooltip||t.rotateActivate||t.isTouch&&!t.startMove||this.tooltip(e)},qBe.prototype.longPress=function(){return!1},qBe.prototype.seriesStyles=function(){var e;this.styleAdded||((e=document.createElement("style")).setAttribute("id",this.element.id+"_ej2_chart_tooltip"),e.innerText+=" ."+this.element.id+"_ej2_tooltipDeselected { opacity:0.2;} ",document.body.appendChild(e),this.styleAdded=!0)},qBe.prototype.tooltip=function(e){var t=this.element.id+"_tooltip_svg",t=this.getElement(t),t=t&&0<parseInt(t.getAttribute("opacity"),10),i=this.getTooltipElement(t);this.chart3D.tooltip3DModule&&this.renderSeriesTooltip(this.chart3D,!t,i,e)},qBe.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:""},qBe.prototype.renderSeriesTooltip=function(e,t,i,n){n=this.get3dData(n);this.currentPoints=[],!this.findData(n,this.previousPoints[0])||(!this.previousPoints[0]||this.previousPoints[0].point.index===n.point.index&&this.previousPoints[0].series.index===n.series.index&&this.chart3D.isRemove)&&this.previousPoints[0]?!n.point&&this.chart3D.isRemove&&"Move"===e.tooltip.fadeOutMode&&(this.removeTooltip(this.chart.tooltip.fadeOutDuration),this.removeBlurEffect(),this.chart3D.isRemove=!1):this.pushData(n,t,i,!0)&&this.triggerTooltipRender(n,t,this.getTooltipText(n),this.findHeader(n)),n&&n.point&&this.findMouseValue(n,e)},qBe.prototype.triggerTooltipRender=function(t,i,e,n){function o(e){e.cancel?(r.removeHighlight(),ue(r.getElement(r.element.id+"_tooltip"))):(r.headerText=e.headerText,r.formattedText=r.formattedText.concat(e.text),r.text=r.formattedText,r.createTooltip(r.chart,i,r.getSymbolLocation(t),t.series.clipRect,t.point,r.chart3D.tooltip.enableMarker?["Circle"]:[],0,new Do(s,s,r.chart.availableSize.width-3-2*s,r.chart.availableSize.height-3-2*s),!1,null,r.getTemplateText(t),r.template?e.template:""),r.blurEffect(r.chart3D.visibleSeries,t.series)),r.chart3D.isRemove=!0}var r=this,e={cancel:!1,text:e,headerText:n,template:void 0,textStyle:this.textStyle,data:{pointX:t.point.x,pointY:t.point.y,seriesIndex:t.series.index,seriesName:t.series.name,pointIndex:t.point.index,pointText:t.point.text}},s=this.chart.border.width;o.bind(this,t),this.chart.trigger(Xme,e,o)},qBe.prototype.blurEffect=function(e,t){if(!this.chart3D.highlight3DModule||this.chart3D.legendSettings.enableHighlight&&"None"===this.chart3D.highlightMode){for(var i=[],n=0,o=e;n<o.length;n++){var r=o[n];if(r.visible&&r.index!==t.index)document.querySelectorAll('[id*="region-series-'+r.index+'"]').forEach(function(e){i.push(e)});else if(r.visible)for(var s=document.querySelectorAll('[id*="region-series-'+r.index+'"]'),a=0;a<s.length;a++){var l=s[a];-1<(h=l.getAttribute("class")||"").indexOf(this.element.id+"_ej2_tooltipDeselected")&&l.setAttribute("class",h.replace(this.element.id+"_ej2_tooltipDeselected","")),this.chart3D.stopElementAnimation(l,r.index)}}for(var h,a=0;a<i.length;a++)i[a]&&(h=i[a].getAttribute("class")||"",-1===(h+=""!==h?" ":"").indexOf("_selection_"))&&-1===h.indexOf(this.element.id+"_ej2_tooltipDeselected")&&i[a].setAttribute("class",h+this.element.id+"_ej2_tooltipDeselected")}},qBe.prototype.removeBlurEffect=function(){if(!this.chart3D.highlight3DModule||this.chart3D.legendSettings.enableHighlight&&"None"===this.chart3D.highlightMode)for(var e=document.getElementsByClassName(this.element.id+"_ej2_tooltipDeselected");0<e.length;){var t=e[0],i=t.getAttribute("class")||"";-1<i.indexOf(this.element.id+"_ej2_tooltipDeselected")&&(t.setAttribute("class",i.replace(this.element.id+"_ej2_tooltipDeselected","")),i=parseFloat(t.id.split("-series-")[1].split("-point-")[0]),this.chart3D.highlightAnimation(t,i,700,.2))}},qBe.prototype.getSymbolLocation=function(e){var t,i=document.getElementById(this.element.id+"_svg").getBoundingClientRect(),n="Cylinder"===e.series.columnFacet?document.querySelectorAll('[id*="'+this.element.id+"-svg-"+(-1===e.series.type.indexOf("Column")?"0":"1")+"-region-series-"+e.series.index+"-point-"+e.point.index+'"]'):document.querySelectorAll('[id*="'+this.element.id+"-svg-"+(-1===e.series.type.indexOf("Column")?"5":"2")+"-region-series-"+e.series.index+"-point-"+e.point.index+'"]');if(n){if(1===n.length)t=n[0].getBoundingClientRect();else for(var o=0;o<n.length;o++){var r=n[o];if(-1!==r.id.indexOf("-"+e.point.index+"-back-front")||-1!==r.id.indexOf("-"+e.point.index+"-front-back")){t=r.getBoundingClientRect();break}}0!==n.length&&(t=t||n[0].getBoundingClientRect())}return new Tve(null!==this.chart3D.tooltip.location.x?this.chart3D.tooltip.location.x:t.left-i.left+t.width/2,null!==this.chart3D.tooltip.location.y?this.chart3D.tooltip.location.y:t.top-i.top+t.height/2)},qBe.prototype.getTooltipText=function(e){return this.parseTemplate(e.point,e.series,this.getFormat(this.chart3D,e.series),e.series.xAxis,e.series.yAxis)},qBe.prototype.getTemplateText=function(e){var t;return this.template?((t=Pe({},e.point)).x=this.formatPointValue(e.point,e.series.xAxis,"x",!0,!1),t.y=this.formatPointValue(e.point,e.series.yAxis,"y",!1,!0),t):e.point},qBe.prototype.findMouseValue=function(e,t){t.requireInvertedAxis?(this.valueY=(1-ZPe(e.point.xValue,e.series.xAxis))*e.series.xAxis.rect.height+e.series.xAxis.rect.y,this.valueX=t.mouseX):(this.valueX=ZPe(e.point.xValue,e.series.xAxis)*e.series.xAxis.rect.width+e.series.xAxis.rect.x,this.valueY=t.mouseY)},qBe.prototype.parseTemplate=function(e,t,i,n,o){for(var r,s=RegExp,a=0,l=Object.keys(e);a<l.length;a++){var h=new s("${point."+(d=l[a])+"}","gm");i=i.replace(h.source,this.formatPointValue(e,"${point.x}"===h.source?n:o,d,"${point.x}"===h.source,"${point.y}"===h.source))}for(var d,p=0,c=Object.keys(Object.getPrototypeOf(t));p<c.length;p++)h=new s("${series."+(d=c[p])+"}","gm"),r=t[d],i=i.replace(h.source,r);return i},qBe.prototype.formatPointValue=function(e,t,i,n,o){var r,o="Category"!==t.valueType&&n?(r=t.labelFormat&&null!==t.labelFormat.match("{value}"))?t.labelFormat.replace("{value}",t.format(e[i])):t.format(e[i]):o&&!je(e[i])?(r=t.labelFormat&&null!==t.labelFormat.match("{value}"),n=t.format(e[i]),r?t.labelFormat.replace("{value}",n):n):e[i];return o},qBe.prototype.getFormat=function(e,t){return t.tooltipFormat||(!t.tooltipFormat&&e.tooltip.format?e.tooltip.format:"${point.x} : "+(-1<e.theme.indexOf("Tailwind3")?"${point.y}":"<b>${point.y}</b>"))},qBe.prototype.get3dData=function(e){var t,i,n=this.chart3D,o=null,r=null,s=this.chart3D.mouseX,a=this.chart3D.mouseY,l=this.chart3D.chartAxisLayoutPanel.seriesClipRect,e=e.target;return e&&s>l.x&&s<l.x+l.width&&a>l.y&&a<l.y+l.height&&("shape"===(s=e.nodeName)||"path"===s)&&1<e.id.indexOf("region")&&(a=e.id.match(/(\d+)/g),t=parseInt(a[a.length-1].toString(),10),i=parseInt(a[a.length-2].toString(),10)),(r=je(i)?r:n.visibleSeries[i])&&(o=r.visible?r.points[t]:o),new Pve(o,r)},qBe.prototype.findData=function(e,t){return e.point&&(!t||t.point!==e.point||t.point===e.point)},qBe.prototype.getModuleName=function(){return"Tooltip3D"},qBe.prototype.destroy=function(){this.removeEventListener()};var UBe,hBe=qBe;function qBe(e){var t=UBe.call(this,e)||this;return t.chart3D=e,t.commonXvalues=[],t.addEventListener(),t}GBe=function(e,t){return(GBe=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])}))(e,t)};var GBe,YBe,MAe=function(e,t){function i(){this.constructor=e}GBe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},XBe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},XBe=(MAe(KBe,YBe=n),XBe([e(!0)],KBe.prototype,"visible",void 0),XBe([e(null)],KBe.prototype,"height",void 0),XBe([e(null)],KBe.prototype,"width",void 0),XBe([t({x:0,y:0},yge)],KBe.prototype,"location",void 0),XBe([e("Auto")],KBe.prototype,"position",void 0),XBe([e("Series")],KBe.prototype,"mode",void 0),XBe([e(8)],KBe.prototype,"padding",void 0),XBe([e(null)],KBe.prototype,"itemPadding",void 0),XBe([e("Center")],KBe.prototype,"alignment",void 0),XBe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},Tge)],KBe.prototype,"textStyle",void 0),XBe([e(10)],KBe.prototype,"shapeHeight",void 0),XBe([e(10)],KBe.prototype,"shapeWidth",void 0),XBe([t({},Rge)],KBe.prototype,"border",void 0),XBe([t({left:0,right:0,top:0,bottom:0},zge)],KBe.prototype,"margin",void 0),XBe([t({left:0,right:0,top:0,bottom:0},rme)],KBe.prototype,"containerPadding",void 0),XBe([e(8)],KBe.prototype,"shapePadding",void 0),XBe([e("transparent")],KBe.prototype,"background",void 0),XBe([e(1)],KBe.prototype,"opacity",void 0),XBe([e(!0)],KBe.prototype,"toggleVisibility",void 0),XBe([e(!1)],KBe.prototype,"enableHighlight",void 0),XBe([e(null)],KBe.prototype,"description",void 0),XBe([e(3)],KBe.prototype,"tabIndex",void 0),XBe([e(null)],KBe.prototype,"title",void 0),XBe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},Tge)],KBe.prototype,"titleStyle",void 0),XBe([e("Top")],KBe.prototype,"titlePosition",void 0),XBe([e("Normal")],KBe.prototype,"textWrap",void 0),XBe([e("Ellipsis")],KBe.prototype,"textOverflow",void 0),XBe([e(100)],KBe.prototype,"maximumTitleWidth",void 0),XBe([e(null)],KBe.prototype,"maximumLabelWidth",void 0),XBe([e(!0)],KBe.prototype,"enablePages",void 0),XBe([e(!1)],KBe.prototype,"isInversed",void 0),XBe([e(!1)],KBe.prototype,"reverse",void 0),KBe);function KBe(){return null!==YBe&&YBe.apply(this,arguments)||this}MAe(ZBe,JBe=Gve),ZBe.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on(F.touchMoveEvent,this.mouseMove,this),this.chart.on("click",this.click,this),this.chart.on(F.touchEndEvent,this.mouseEnd,this))},ZBe.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off(F.touchMoveEvent,this.mouseMove),this.chart.off("click",this.click),this.chart.off(F.touchEndEvent,this.mouseEnd))},ZBe.prototype.mouseMove=function(e){if(this.chart.legendSettings.visible&&!this.chart.isTouch&&(this.move(e),this.chart.highlight3DModule)&&("None"!==this.chart.highlightMode||this.chart.legendSettings.enableHighlight))for(var t=[this.legendID+"_text_",this.legendID+"_shape_marker_",this.legendID+"_shape_",this.legendID+"_g_"],i=e.target.id,n=0,o=t;n<o.length;n++){var r=o[n];if(-1<i.indexOf(r)){r=parseInt(i.split(r)[1],10),this.chart.highlight3DModule.legendSelection(this.chart,r,e.target,e.type);break}}},ZBe.prototype.mouseEnd=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},ZBe.prototype.getLegendOptions=function(e,t){var i,n;this.legendCollections=[],this.isRtlEnable=t.enableRtl,this.isReverse=!this.isRtlEnable&&t.legendSettings.reverse,1<e.length&&(this.legend.mode="Series");for(var o=0,r=e;o<r.length;o++){var s=r[o];if("Series"===this.legend.mode)i=s.type,n=s.pointColorMapping&&0<s.points.length&&s.points[0].interior||s.interior,this.legendCollections.push(new Rbe(s.name,n,s.legendShape,s.visible,i,s.legendImageUrl||"","None",!1,null,null));else if("Point"===this.legend.mode)for(var a=this,l=0,h=s.points;l<h.length;l++)!function(t){i=s.type,n=t.interior||s.interior,0===a.legendCollections.filter(function(e){return e.text===t.x.toString()}).length&&a.legendCollections.push(new Rbe(t.x.toString(),n,s.legendShape,t.visible,i,"","None",!1))}(h[l])}this.isReverse&&this.legendCollections.reverse()},ZBe.prototype.get3DLegendBounds=function(e,t,i){this.calculateLegendTitle(i,t),this.isTitle=!!i.title,this.chartRowCount=1,this.rowHeights=[],this.columnHeights=[],this.pageHeights=[];var n,o=i.padding,r=i.titlePosition,s=0,a=0,l=this.arrowWidth,h=this.arrowHeight,d=this.isVertical&&!i.enablePages?h:0,h=this.isTitle&&"Top"===r?this.legendTitleSize.height+this.fivePixel:0,h=this.isTitle&&this.isVertical&&"Top"!==r?this.legendTitleSize.height+this.fivePixel:h,p=(this.isVertical?a=i.width?0:e.width/100*5:s=i.height?0:e.height/100*5,t.height+=s,t.width+=a,i.shapeWidth,i.shapePadding,0),c=0,u=0,g=0,m=0,f=0,y=!1;this.maxItemHeight=Math.max(So("MeasureText",i.textStyle,this.chart.themeStyle.legendLabelFont).height,i.shapeHeight);for(var v=0;v<this.legendCollections.length;v++){var b,w=this.legendCollections[v];yfe.test(w.text)&&(w.text=uve(w.text,yfe)),vfe.test(w.text)&&(w.text=uve(w.text,vfe)),n={fill:w.fill,text:w.text,shape:w.shape,cancel:!1},this.chart.trigger(Hme,n),w.render=!n.cancel,w.text=n.text,w.fill=n.fill,w.shape=n.shape,w.markerShape="None",w.textSize=So(w.text,i.textStyle,this.chart.themeStyle.legendLabelFont),n=w.text?i.shapeWidth:0,b=w.text?i.shapePadding:0,w.render&&w.text&&(y=!0,c+=n=n+b+(i.maximumLabelWidth||w.textSize.width)+(this.isVertical||0===v?o:this.itemPadding),i.enablePages||this.isVertical||(f=this.isTitle&&"Top"!==r?this.legendTitleSize.width+this.fivePixel:0,f+=l),this.getLegendHeight(w,i,t,c,this.maxItemHeight,o),(t.width<o+c+f||this.isVertical)&&(p=Math.max(p,c+o+f-(this.isVertical?0:n)),0===m&&n!==c&&(m=1),c=this.isVertical?0:n,m++,g=0,u=d),this.rowHeights[b=0<m?m-1:0]=Math.max(this.rowHeights[b]||0,w.textSize.height),this.columnHeights[g]=(this.columnHeights[g]||0)+w.textSize.height+(!this.isVertical||0===v?o:this.itemPadding),g++)}u=Math.max.apply(null,this.columnHeights)+o+h,u=Math.max(u,this.maxItemHeight+o+o+h),this.isPaging=t.height<u,this.isPaging&&!i.enablePages&&(this.isVertical?u+=u:u=this.maxItemHeight+o+o+("Top"===r?h:0)),this.totalPages=m,this.isPaging||this.isVertical||(c+=this.isTitle&&"Top"!==r?this.fivePixel+this.legendTitleSize.width+this.fivePixel:0),y?this.setBounds(Math.max(c+o,p),u,i,t):this.setBounds(0,0,i,t)},ZBe.prototype.getLegendHeight=function(e,t,i,n,o,r){var s=e.textSize.width,a=t.shapePadding+2*r+t.shapeWidth;switch(t.textWrap){case"Wrap":case"AnyWhere":s>t.maximumLabelWidth||s+n>i.width?e.textCollection=pve(e.text,t.maximumLabelWidth?Math.min(t.maximumLabelWidth,i.width-a):i.width-a,t.textStyle,this.chart.enableRtl,null,null,this.chart.themeStyle.legendLabelFont):e.textCollection.push(e.text),e.textSize.height=o*e.textCollection.length}},ZBe.prototype.getRenderPoint=function(e,t,i,n,o,r,s){var a=this.legend.padding,l=i+(this.legend.maximumLabelWidth||n.textSize.width),l=n.location.x+(this.isRtlEnable?-l:l),o=(this.isWithinBounds(l,(this.legend.maximumLabelWidth||e.textSize.width)+i-this.itemPadding,o)||this.isVertical?(e.location.x=t.x,r!==s&&this.chartRowCount++,e.location.y=r===s?n.location.y:n.location.y+(this.isVertical?n.textSize.height:this.rowHeights[this.chartRowCount-2])+(this.isVertical?this.itemPadding:a)):(e.location.x=r===s?n.location.x:l,e.location.y=n.location.y),this.isRtlEnable?e.location.x-i+this.itemPadding+this.legend.shapeWidth/2-this.legendBounds.x:this.legendBounds.x+this.legendBounds.width-(e.location.x+i-this.itemPadding-this.legend.shapeWidth/2));this.isVertical||!this.isPaging||this.legend.enablePages||(o=this.legendBounds.width-e.location.x-this.fivePixel),o=this.legend.maximumLabelWidth?Math.min(this.legend.maximumLabelWidth,o):o,"Ellipsis"===this.legend.textOverflow&&"Normal"===this.legend.textWrap&&(e.text=eve(+o.toFixed(4),e.text,this.legend.textStyle,this.chart.enableRtl,this.chart.themeStyle.legendLabelFont))},ZBe.prototype.isWithinBounds=function(e,t,i){return this.isRtlEnable?e-t<i.x-this.legend.shapeWidth/2:e+t>i.x+i.width+this.legend.shapeWidth/2},ZBe.prototype.LegendClick=function(e,t){var i,n=this.chart,o="Series"===n.legendSettings.mode?e:0,r=this.isReverse?this.legendCollections.length-1-e:e,o=n.visibleSeries[o],r=this.legendCollections[r],s="isProtectedOnChange";"Series"===n.legendSettings.mode?(i={legendText:r.text,legendShape:r.shape,series:o,cancel:!1},this.chart.trigger(Nme,i),o.legendShape=i.legendShape,i.cancel||(null!==o.fill&&(n.visibleSeries[e].interior=o.fill),n.legendSettings.toggleVisibility?(o.chart[s]=!0,this.changeSeriesVisiblity(o,o.visible),r.visible=o.visible,this.refreshLegendToggle(n,o)):n.highlight3DModule?n.highlight3DModule.legendSelection(n,e,t.target,t.type):n.selection3DModule&&n.selection3DModule.legendSelection(n,e,t.target,t.type),o.chart[s]=!1)):"Point"===n.legendSettings.mode&&(t=o.points[e],i={legendText:r.text,legendShape:r.shape,series:o,cancel:!1},this.chart.trigger(Nme,i),n.legendSettings.toggleVisibility)&&!i.cancel&&(t.visible=!t.visible,this.legendCollections[e].visible=t.visible,this.refreshLegendToggle(n,o))},ZBe.prototype.refreshLegendToggle=function(e,t){var i=[];if(e.selection3DModule&&(i=Pe([],e.selection3DModule.selectedDataIndexes,null,!0)),0<e.svgObject.childNodes.length){for(;e.svgObject.lastChild;)e.svgObject.removeChild(e.svgObject.lastChild);ue(e.svgObject)}e.animateSeries=!1,Pye(Bo(e.element.id+"_Secondary_Element").querySelectorAll(".ejSVGTooltip")[0]),this.redrawSeriesElements(t,e),e.removeSvg(),e.refreshAxis(),t.refreshAxisLabel(),this.refreshSeries(e.visibleSeries),e.polygons=[],e.refreshBound(),e.trigger("loaded",{chart:e}),0<i.length&&(e.selection3DModule.selectedDataIndexes=i,e.selection3DModule.redrawSelection(e,e.selectionMode)),(e.highlight3DModule&&"None"!==e.highlightMode||e.legendSettings.enableHighlight)&&e.highlight3DModule.redrawSelection(e,e.highlightMode),e.redraw=!1},ZBe.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}))},ZBe.prototype.isSecondaryAxis=function(e){return-1<this.chart.axes.indexOf(e)},ZBe.prototype.redrawSeriesElements=function(e,t){if(!t.redraw)return null;Pye(t.element.id+"_Series_"+(void 0===e.index?e.category:e.index)+"_DataLabelCollections")},ZBe.prototype.refreshSeries=function(e){for(var t=0,i=e;t<i.length;t++)i[t].position=void 0},ZBe.prototype.click=function(e){if(this.chart.legendSettings.visible){for(var t=(-1<e.target.id.indexOf("_chart_legend_g_")?e.target.firstChild:e.target).id,i=0,n=[this.legendID+"_text_",this.legendID+"_shape_marker_",this.legendID+"_shape_"];i<n.length;i++){var o=n[i];if(-1<t.indexOf(o)){o=parseInt(t.split(o)[1],10),this.LegendClick(o,e);break}}-1<t.indexOf(this.legendID+"_pageup")?this.changePage(e,!0):-1<t.indexOf(this.legendID+"_pagedown")&&this.changePage(e,!1)}},ZBe.prototype.getModuleName=function(){return"Legend3D"},ZBe.prototype.destroy=function(){this.removeEventListener()};var JBe,MAe=ZBe;function ZBe(e){e=JBe.call(this,e)||this;return(e.library=e).addEventListener(),e}$Be=function(e,t){return($Be=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])}))(e,t)};var $Be,eFe,tFe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},tFe=(function(e,t){function i(){this.constructor=e}$Be(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(iFe,eFe=Ji),iFe.prototype.isIdHasSpecialCharacter=function(e){var t=/^[A-Za-z ]+$/,i=/^[0-9 ]+$/,n="";if(t.test(e))return e;var o=0;i.test(e[0])&&(n+="\\3"+e[0],o=1);for(var r=o;r<e.length;r++)t.test(e[r])||-1!==e.indexOf("-")||-1!==e.indexOf("_")||-1!==e.indexOf("\\")||i.test(e[r])?n+=e[r]:n+="\\"+e[r];return n},iFe.prototype.preRender=function(){this.element.id=this.isIdHasSpecialCharacter(this.element.id),this.allowServerDataBinding=!1,this.unWireEvents(),this.initPrivateVariable(),this.setCulture(),this.wireEvents(),this.element.setAttribute("dir",this.enableRtl?"rtl":"")},iFe.prototype.initPrivateVariable=function(){var e;this.delayRedraw=!1,this.animateSeries=!0,this.horizontalAxes=[],this.verticalAxes=[],this.polygons=[],this.vector=new BPe(0,0,0),this.wallRender=new $Pe,this.matrixObj=new LPe,this.bspTreeObj=new HPe,this.polygon=new QPe,this.graphics=new VPe,this.transform3D=new OPe,this.svg3DRenderer=new jPe,this.axisRender=new tBe,this.chart3DRender=new kPe,this.chartAxisLayoutPanel=new IPe(this),this.refreshAxis(),this.refreshDefinition(this.rows),this.refreshDefinition(this.columns),this.tooltip3DModule&&(this.tooltip3DModule.previousPoints=[]),this.element.setAttribute("role","region"),this.element.setAttribute("tabindex","0"),this.element.style.outline="none",this.element.setAttribute("aria-label",this.description||this.title+". Syncfusion interactive chart."),this.element.classList.contains("e-chart-focused")||this.element.setAttribute("class",this.element.getAttribute("class")+" e-chart-focused"),""===this.element.id&&(e=document.getElementsByClassName("e-chart").length,this.element.id="chart_"+this.chartId+"_"+e),this.svgId=this.element.id+"_svg"},iFe.prototype.setCulture=function(){this.intl=new Ti,this.localeObject=new Cn(this.getModuleName(),this.defaultLocalConstants,this.locale)},iFe.prototype.render=function(){var e=this,t=(this.svgRenderer=new fo(this.element.id),{chart:this,theme:this.theme,cancel:!1});this.trigger(Vme,t,function(){t.cancel||e.cartesianChartRendering()})},iFe.prototype.cartesianChartRendering=function(){this.setTheme(),this.createChartSvg(),this.calculateVisibleSeries(),this.calculateVisibleAxis(),this.processData(),this.renderComplete(),this.allowServerDataBinding=!0},iFe.prototype.createChartSvg=function(){this.removeSvg(),lve(this)},iFe.prototype.removeSvg=function(){if(this.redraw)return null;Fo(this.element.id+"_Secondary_Element"),this.isReact&&this.clearTemplate();if(this.svgObject){for(;0<this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&ue(this.svgObject)}},iFe.prototype.processData=function(e){void 0===e&&(e=!0);for(var t=this.visibleSeriesCount=0,i=this.visibleSeries;t<i.length;t++){var n=i[t];n.visible||this.legendSettings.visible?this.initializeDataModule(n):this.visibleSeriesCount++}!e||this.visibleSeries.length&&this.visibleSeriesCount!==this.visibleSeries.length||(this.refreshBound(),this.trigger("loaded",{chart:this}))},iFe.prototype.initializeDataModule=function(e){e.xData=[],e.yData=[];var t=this.isAngular?(Object.keys(e.dataSource).length?e:this).dataSource:e.dataSource||this.dataSource;e.dataModule=new Cbe(t,e.query),e.points=[],e.refreshDataManager(this)},iFe.prototype.animate=function(e){this.redraw=!0,this.animated=!0,this.duration=e||1e3},iFe.prototype.refreshBound=function(){this.legend3DModule&&this.legendSettings.visible&&this.legend3DModule.getLegendOptions(this.visibleSeries,this),this.tooltip.enable&&this.tooltip3DModule&&(this.tooltip3DModule.previousPoints=[]),this.calculateStackValues(),this.calculateBounds(),this.renderElements(),Fo("chartmeasuretext"),this.removeSelection()},iFe.prototype.removeSelection=function(){for(var e=0,t=this.visibleSeries;e<t.length;e++){var i=t[e];if(i.visible)for(var n=0,o=i.points;n<o.length;n++)o[n].isSelect=!1}},iFe.prototype.calculateStackValues=function(){for(var e,t=!1,i=0,n=this.visibleSeries.length;i<n;i++)(e=this.visibleSeries[i]).position=e.rectCount=void 0,-1===e.type.indexOf("Stacking")||t||(e.calculateStackedValue(-1<e.type.indexOf("100"),this),t=!0)},iFe.prototype.calculateBounds=function(){var e=this.margin,t=0,i=0,n="Top"===this.titleStyle.position||"Bottom"===this.titleStyle.position?15:5,o=e.left+this.border.width,r=this.availableSize.width-o-e.right-this.border.width,s=0,a=e.top+this.border.width,l=this.availableSize.height-a-this.border.width-e.bottom;if(this.titleCollection=[],this.subTitleCollection=[],this.title){if(this.titleCollection=hve(this.title,this.titleStyle,"Left"===this.titleStyle.position||"Right"===this.titleStyle.position?l:r,this.enableRtl,this.themeStyle.chartTitleFont),t=So(this.title,this.titleStyle,this.themeStyle.chartTitleFont).height*this.titleCollection.length+n,this.subTitle){for(var h=0,d=0,p=this.titleCollection;d<p.length;d++)var c,h=h<(c=So(p[d],this.titleStyle,this.themeStyle.chartSubTitleFont).width)?c:h;this.subTitleCollection=hve(this.subTitle,this.subTitleStyle,h,this.enableRtl,this.themeStyle.chartSubTitleFont),i=So(this.subTitle,this.subTitleStyle,this.themeStyle.chartSubTitleFont).height*this.subTitleCollection.length+n}}else"Top"!==this.legendSettings.position&&this.border.width&&(s=10);var a=e.top+s+this.border.width,l=this.availableSize.height-a-this.border.width-e.bottom,u=i+t+this.titleStyle.border.width+this.subTitleStyle.border.width;switch(this.titleStyle.position){case"Top":a+=u,l-=u;break;case"Bottom":l-=u;break;case"Left":o+=u,r-=u;break;case"Right":o-=this.titleStyle.border.width+this.subTitleStyle.border.width,r-=u}this.initialClipRect=new Do(o,a,r,l),this.legend3DModule&&this.legendSettings.visible&&this.legend3DModule.calculateLegendBounds(this.initialClipRect,this.availableSize,null),this.chartAxisLayoutPanel.measureAxis(this.initialClipRect)},iFe.prototype.renderElements=function(){this.renderBorder(),this.renderTitle(),this.createSeriesElements(),this.render3DChart(),this.renderLegend(),this.performSelection(),this.setSecondaryElementPosition(),this.doAnimation()},iFe.prototype.animateRect=function(t,i,e,n,o,r){var s,a,l,h=i.animation,d=(i.chart.animated?i.chart:h).duration,p=p0e("Linear"),c=t.getAttribute("height")?+t.getAttribute("height"):0,u=t.getAttribute("width")?+t.getAttribute("width"):0,e=e.yValue<0,g=+t.getAttribute("x"),m=+t.getAttribute("y");i.chart.requireInvertedAxis?-1<i.type.indexOf("Stacking")?(s=g,a=m):(a=e?m:m+c,s=e!==i.yAxis.isAxisInverse?g+u:g):(a=e!==i.yAxis.isAxisInverse?m:m+c,s=e?g:g+u),je(t)||(t.style.visibility="hidden",n&&(n.style.visibility="hidden"),o&&(o.style.visibility="hidden"),r&&(r.style.visibility="hidden"),new Vt({}).animate(t,{duration:0===d&&"Enable"===Ut?1e3:d,delay:h.delay,progress:function(e){e.timeStamp>=e.delay&&(t.style.visibility="visible",i.chart.requireInvertedAxis?(u=u||1,l=p(e.timeStamp-e.delay,0,u,e.duration),t.setAttribute("transform","translate("+s+" "+a+") scale("+l/u+", 1) translate("+-s+" "+-a+")")):(c=c||1,l=p(e.timeStamp-e.delay,0,c,e.duration),t.setAttribute("transform","translate("+s+" "+a+") scale(1,"+l/c+") translate("+-s+" "+-a+")")))},end:function(){t.setAttribute("transform","translate(0,0)"),n&&(n.style.visibility="visible"),o&&(o.style.visibility="visible"),r&&(r.style.visibility="visible"),i.chart.trigger("animationComplete",{series:i})}}))},iFe.prototype.doAnimation=function(){for(var l=this,h=this,e=0;e<this.visibleSeries.length;e++)!function(t){var e=h.visibleSeries[t];if(e.visible&&e.animation.enable&&h.animateSeries&&!h.rotateActivate){var i=void 0,n=void 0,o=void 0,r=new vve(h.element.id+"_ChartSeriesClipRect_"+t,"transparent",{width:1,color:"Gray"},1,{x:0,y:0,width:h.availableSize.width,height:h.availableSize.height}),r=y0e(h.redraw,r,h.svgRenderer);O0e(!1,h.chart3D,r.children[0],h.redraw);for(var s=0;e.visiblePoints&&s<e.visiblePoints.length;s++){var a=e.visiblePoints[s];document.querySelectorAll('[id*="region-series-'+t+'"]').forEach(function(e){e.setAttribute("clip-path","url(#"+l.element.id+"_ChartSeriesClipRect_"+t+")")}),e.dataLabel.visible&&(i=ie(h.element.id+"-svg-series-"+e.index+"-point-"+s+"-data-label"),n=ie(h.element.id+"-svg-data-label-series-"+e.index+"-point-"+s),o=ie(h.element.id+"-series-"+e.index+"-data-label-"+s)),h.animateRect(document.getElementById(h.element.id+"_ChartSeriesClipRect_"+t).children[0],e,a,i,n,o)}}}(e)},iFe.prototype.performSelection=function(){var e=[];this.selection3DModule&&(e=Pe([],this.selection3DModule.selectedDataIndexes,null,!0),this.selection3DModule.invokeSelection(this)),this.highlight3DModule&&this.highlight3DModule.invokeHighlight(this),(!this.highlight3DModule||this.legendSettings.enableHighlight&&"None"===this.highlightMode)&&this.tooltip3DModule&&this.tooltip3DModule.seriesStyles(),0<e.length&&(this.selection3DModule.selectedDataIndexes=e,this.selection3DModule.redrawSelection(this,this.selectionMode))},iFe.prototype.renderLegend=function(){var e;this.legend3DModule&&this.legend3DModule.legendCollections.length&&this.legendSettings.visible&&(this.legend3DModule.calTotalPage=!0,e=this.legend3DModule.legendBounds,this.legend3DModule.renderLegend(this,this.legendSettings,e)),this.redraw||this.element.appendChild(this.svgObject)},iFe.prototype.setSecondaryElementPosition=function(){var e,t,i=ie(this.element.id+"_Secondary_Element");i&&(e=this.element.getBoundingClientRect(),t=ie(this.svgId).getBoundingClientRect(),i.style.left=Math.max(t.left-e.left,0)+"px",i.style.top=Math.max(t.top-e.top,0)+"px")},iFe.prototype.initializeModuleElements=function(){this.dataLabelCollections=[];var e=this.element.id;this.series.length&&(this.seriesElements=this.svgRenderer.createGroup({id:e+"SeriesCollection"})),this.dataLabelElements=this.renderer.createGroup({id:e+"DataLabelCollection"})},iFe.prototype.createSeriesElements=function(){this.initializeModuleElements();var e=this.element.id,t=nve(this.redraw,e+"_Secondary_Element")||this.createElement("div");t.id=e+"_Secondary_Element",O0e(!(t.style.cssText="position: relative"),this.element,t,this.redraw),this.tooltip.enable&&O0e(!1,this.svgObject,this.renderer.createGroup({id:e+"_UserInteraction",style:"pointer-events:none;"}),this.redraw)},iFe.prototype.renderTitle=function(){var e=this.margin;if(this.title){var t=Nve(this.titleStyle.textAlignment,this.enableRtl),i=So(this.title,this.titleStyle,this.themeStyle.chartTitleFont),n=new Do(e.left,0,this.availableSize.width-e.left-e.right,0),o=this.titleStyle.border.width,r=this.margin.top+3*i.height/4,s=dve(n,this.titleStyle||this.themeStyle.chartTitleFont)+o,a=void 0,l=this.titleStyle.textAlignment,h=So(this.subTitle,this.subTitleStyle,this.themeStyle.chartSubTitleFont);switch(this.titleStyle.position){case"Top":r+=.5*o,s+="start"===t?.5*o+this.border.width:"end"===t?2*-o-this.border.width:0;break;case"Bottom":s+="start"===t?.5*o+this.border.width:"end"===t?2*-o-this.border.width:0,r=this.availableSize.height-this.margin.bottom-h.height-i.height/2-.5*o-.5*this.subTitleStyle.border.width;break;case"Left":s=this.margin.left+3*i.height/4+.5*o,r="Near"===l?e.bottom+.5*o+this.border.width:"Far"===l?this.availableSize.height-e.bottom-.5*o-this.border.width:this.availableSize.height/2,t="Near"===l?"end":"Far"===l?"start":"middle",t=this.enableRtl?"end"===t?"start":"start"===t?"end":t:t,a="rotate(-90,"+s+","+r+")";break;case"Right":s=this.availableSize.width-this.margin.right-3*i.height/4-.5*o,r="Near"===l?e.bottom+.5*o+this.border.width:"Far"===l?this.availableSize.height-e.bottom-.5*o-this.border.width:this.availableSize.height/2,t="Near"===l?"start":"Far"===l?"end":"middle",t=this.enableRtl?"end"===t?"start":"start"===t?"end":t:t,a="rotate(90,"+s+","+r+")";break;case"Custom":s=this.titleStyle.x,r=this.titleStyle.y,t="middle"}var n={id:this.element.id+"-chart-title-border",x:s-("middle"===t?i.width/2+5:"end"===t?i.width+5:5),y:r-i.height+i.height/4,rx:this.titleStyle.border.cornerRadius,ry:this.titleStyle.border.cornerRadius,width:i.width+10,height:i.height*this.titleCollection.length,fill:this.titleStyle.background,"stroke-width":o,stroke:this.titleStyle.border.color,transform:a||""},n=nve(this.redraw,this.element.id+"-chart-title-border",n,this.renderer)||this.renderer.drawRectangle(n),n=(O0e(!1,this.svgObject,n,this.redraw),new ko(this.element.id+"-chart-title",s,r,t,this.titleCollection,a,"auto")),d=nve(this.redraw,this.element.id+"-chart-title",n,this.renderer)||sve(this.renderer,n,this.titleStyle,this.titleStyle.color||this.themeStyle.chartTitleFont.color,this.svgObject,null,null,null,null,null,null,0,null,!1,null,this.themeStyle.chartTitleFont);d&&(d.setAttribute("tabindex","0"),d.style.outline="none",d.setAttribute("class","e-chart-focused")),this.subTitle&&this.renderSubTitle(n)}},iFe.prototype.renderSubTitle=function(e){for(var t=0,i=this.titleStyle.textAlignment,n=0,o=this.titleCollection;n<o.length;n++)var r,t=t<(r=So(o[n],this.titleStyle,this.themeStyle.chartTitleFont).width)?r:t;var s=So(this.subTitleCollection.reduce(function(e,t){return e.length>t.length?e:t}),this.subTitleStyle,this.themeStyle.chartSubTitleFont),a=Nve(this.subTitleStyle.textAlignment,this.enableRtl),l=new Do("Center"===i?e.x-.5*t:"Far"===i?e.x-t:e.x,0,t,0),i=("Left"===this.titleStyle.position&&(l.x="Center"===i?e.x-.5*t:"Far"===i?this.margin.left+3*s.height/4:e.x-t),So(this.title,this.titleStyle,this.themeStyle.chartTitleFont)),h=e.y*e.text.length+s.height+5+this.titleStyle.border.width+.5*this.subTitleStyle.border.width,i=("Bottom"===this.titleStyle.position&&(h=e.y*e.text.length+5+i.height/2+s.height/2),{id:this.element.id+"-chart-sub-title-border",x:dve(l,this.subTitleStyle)-("middle"===a?s.width/2+5:"end"===a?s.width+5:5),y:h-s.height+s.height/4,rx:this.subTitleStyle.border.cornerRadius,ry:this.subTitleStyle.border.cornerRadius,width:s.width+10,height:s.height*this.subTitleCollection.length,fill:this.subTitleStyle.background,"stroke-width":this.subTitleStyle.border.width,stroke:this.subTitleStyle.border.color,transform:e.transform}),a=nve(this.redraw,this.element.id+"-chart-sub-title-border",i,this.renderer)||this.renderer.drawRectangle(i),s=(O0e(!1,this.svgObject,a,this.redraw),new ko(this.element.id+"-chart-sub-title",dve(l,this.subTitleStyle),h,Nve(this.subTitleStyle.textAlignment,this.enableRtl),this.subTitleCollection,e.transform,"auto"));nve(this.redraw,this.element.id+"-chart-sub-title",s,this.renderer)||sve(this.renderer,s,this.subTitleStyle,this.subTitleStyle.color||this.themeStyle.chartSubTitleFont.color,this.svgObject,null,null,null,null,null,null,0,null,!1,null,this.themeStyle.chartSubTitleFont)},iFe.prototype.renderBorder=function(){var e=this.border.width,t=this.backgroundImage,i=t?"transparent":this.background||this.themeStyle.background,i=new vve(this.element.id+"-chart-border",i,this.border,1,new Do(.5*e+0,.5*e+0,this.availableSize.width-e,this.availableSize.height-e),0,0,"",this.border.dashArray);this.htmlObject=nve(this.redraw,this.element.id+"-chart-border",i,this.renderer)||this.renderer.drawRectangle(i),this.htmlObject.setAttribute("aria-hidden","true"),O0e(!1,this.svgObject,this.htmlObject,this.redraw),t&&(i=new Cve(this.availableSize.height-e,this.availableSize.width-e,t,0,0,this.element.id+"-chart-background","visible","none"),this.htmlObject=nve(this.redraw,this.element.id+"-chart-background",i,this.renderer)||this.renderer.drawImage(i),O0e(!1,this.svgObject,this.htmlObject,this.redraw))},iFe.prototype.requiredModules=function(){var t,i=this,n=[],o=this.series,r=!1;return this.tooltip.enable&&n.push({member:"Tooltip3D",args:[this]}),o.map(function(e){i.isLegend=i.legendSettings.visible&&(""!==e.name||!!i.isLegend),t=-1!==e.type.indexOf("100")?e.type.replace("100","")+"Series3D":e.type+"Series3D",r=e.dataLabel.visible||r,n.some(function(e){return e.member===t})||n.push({member:t,args:[i,o]})}),r&&n.push({member:"DataLabel3D",args:[this,o]}),n=this.findAxisModule(n),this.isLegend&&n.push({member:"Legend3D",args:[this]}),this.enableExport&&n.push({member:"Export3D",args:[this]}),"None"!==this.selectionMode&&n.push({member:"Selection3D",args:[this]}),"None"===this.highlightMode&&!this.legendSettings.enableHighlight||n.push({member:"Highlight3D",args:[this]}),n},iFe.prototype.findAxisModule=function(e){for(var t=[],i=(t.push(this.primaryXAxis),t.push(this.primaryYAxis),!1),n=!1,o=!1,r=!1,s=0,a=t=t.concat(this.axes);s<a.length;s++)var l=a[s],i="DateTime"===l.valueType||i,n="Category"===l.valueType||n,o="Logarithmic"===l.valueType||o,r="DateTimeCategory"===l.valueType||r;return i&&e.push({member:"DateTime3D",args:[this]}),n&&e.push({member:"Category3D",args:[this]}),o&&e.push({member:"Logarithmic3D",args:[this]}),r&&e.push({member:"DateTimeCategory3D",args:[this]}),e},iFe.prototype.setTheme=function(){this.themeStyle=EPe(this.theme)},iFe.prototype.setNavigationStyle=function(e){e=document.getElementById(e);e&&e.style.setProperty("outline","1.5px solid "+this.themeStyle.tabColor)},iFe.prototype.removeNavigationStyle=function(){var e=document.querySelectorAll("[id*=_Point_], [id*="+this.element.id+"], [id*=_ChartBorder], text[id*=_ChartTitle],g[id*=_chart_legend],  text[id*=_ChartSubTitle], div[id*=_Annotation]");e&&e.forEach(function(e){(e instanceof HTMLElement||e instanceof SVGElement)&&e.style.setProperty("outline","none")})},iFe.prototype.render3DChart=function(){this.chart3D=this.svgRenderer.createGroup({id:this.element.id+"-svg-chart-3d"}),this.chart3D.setAttribute("role","region"),this.chart3D.setAttribute("aria-hidden","false"),this.draw3DAxis(),this.wallRender.update3DWall(this),this.renderSeries(),O0e(!1,this.svgObject,this.chart3D,this.redraw);var e=new Eo(this.availableSize.width,this.availableSize.height);this.graphics.prepareView(this.perspectiveAngle,this.depth,this.rotation,this.tilt,e,this),this.graphics.view(this.svgObject,this)},iFe.prototype.draw3DAxis=function(){for(var e=0;e<this.axisCollections.length;e++)this.axisRender.drawAxes(e,this.axisCollections[e],this)},iFe.prototype.renderSeries=function(){for(var e=0,t=this.visibleSeries;e<t.length;e++){var i=t[e];i.visible&&(this.visible++,i.renderSeries(this))}this.visible=0},iFe.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)},iFe.prototype.calculateVisibleAxis=function(){var e,t=(t=[this.primaryXAxis,this.primaryYAxis]).concat(this.axes);this.axisCollections=[];for(var i=0,n=t.length;i<n;i++){(e=t[i]).series=[],e.labels=[],e.indexLabels={},e.orientation=0===i?this.requireInvertedAxis?"Vertical":"Horizontal":1===i?this.requireInvertedAxis?"Horizontal":"Vertical":e.orientation;for(var o=0,r=this.visibleSeries;o<r.length;o++){var s=r[o];this.initAxis(s,e,!0)}null!=e.orientation&&this.axisCollections.push(e)}0<this.rows.length&&0<this.columns.length&&this.chartAxisLayoutPanel.measure()},iFe.prototype.unWireEvents=function(){var e=F.touchStartEvent,t=F.touchMoveEvent,i=F.touchEndEvent,n=F.isPointer?"pointerleave":"mouseleave";E.remove(this.element,e,this.chartOnMouseDown),E.remove(this.element,t,this.mouseMove),E.remove(this.element,i,this.mouseEnd),E.remove(this.element,"click",this.chartOnMouseClick),E.remove(this.element,n,this.mouseLeave),E.remove(this.element,"keydown",this.chartKeyDown),E.remove(document.body,"keydown",this.documentKeyHandler),E.remove(this.element,"keyup",this.chartKeyUp),window.removeEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBound),this.touchObject&&(this.touchObject.destroy(),this.touchObject=null)},iFe.prototype.wireEvents=function(){var e;this.element&&(e=F.isPointer?"pointerleave":"mouseleave",E.add(this.element,F.touchStartEvent,this.chartOnMouseDown,this),E.add(this.element,F.touchMoveEvent,this.mouseMove,this),E.add(this.element,F.touchEndEvent,this.mouseEnd,this),E.add(this.element,"click",this.chartOnMouseClick,this),E.add(this.element,e,this.mouseLeave,this),E.add(this.element,"keydown",this.chartKeyDown,this),E.add(document.body,"keydown",this.documentKeyHandler,this),E.add(this.element,"keyup",this.chartKeyUp,this),this.resizeBound=this.chartResize.bind(this),window.addEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBound),this.longPressBound=this.longPress.bind(this),this.touchObject=new Mn(this.element,{tapHold:this.longPressBound,tapHoldThreshold:500}),this.setStyle(this.element))},iFe.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},iFe.prototype.chartOnMouseClick=function(e){var t=this,i=e.target,n=this,o=(this.clickCount++,400),o=(1===this.clickCount?this.singleClickTimer=+setTimeout(function(){n.clickCount=0,n.trigger("chart3DMouseClick",{target:i.id,x:n.mouseX,y:n.mouseY})},o):2===this.clickCount&&(clearTimeout(this.singleClickTimer),this.clickCount=0),this.isAngular,0);return 1===this.clickCount&&this.pointClick&&(this.singleClickTimer=+setTimeout(function(){t.clickCount=0,t.triggerPointEvent($me,e)},o)),this.removeNavigationStyle(),this.notify("click",e),!1},iFe.prototype.export=function(e,t){this.export3DModule&&(this.export3DModule.export(e,t),this.afterExport)&&this.export3DModule.getDataUrl(this)},iFe.prototype.chartResize=function(){var e=this,t=(this.animateSeries=!1,{chart:this,currentSize:new Eo(0,0),previousSize:new Eo(this.availableSize.width,this.availableSize.height)}),i={cancel:!1};return this.resizeTo&&clearTimeout(this.resizeTo),this.trigger(hfe,i),i.cancel||(this.resizeTo=+setTimeout(function(){e.isDestroyed?clearTimeout(e.resizeTo):(e.createChartSvg(),t.currentSize=e.availableSize,e.trigger(lfe,t),e.polygons=[],e.refreshAxis(),e.refreshBound(),e.trigger("loaded",{chart:e}))},500)),!1},iFe.prototype.triggerPointEvent=function(e,t){var i,n,o,r=null,s=null,t=t.target;t&&(("path"===(o=t.nodeName)||"shape"===o)&&1<t.id.indexOf("-region-")&&(o=t.id.match(/(\d+)/g),i=parseInt(o[o.length-1].toString(),10),n=parseInt(o[o.length-2].toString(),10)),r=je(n)?r:this.visibleSeries[n])&&r.visible&&(s=r.points[i]),r&&s&&this.trigger(e,{series:r,point:s,seriesIndex:n,pointIndex:i,x:this.mouseX,y:this.mouseY})},iFe.prototype.chartOnMouseDown=function(e){var t,i=this.element.getBoundingClientRect(),n=e.target,o=(this.trigger("chart3DMouseDown",{target:n.id,x:this.mouseX,y:this.mouseY}),n=("touchstart"===e.type?(this.isTouch=!0,t=e.changedTouches[0].clientX,e.changedTouches[0]):(this.isTouch="touch"===e.pointerType,t=e.clientX,e)).clientY,ie(this.svgId).getBoundingClientRect());return this.mouseDownX=this.previousMouseMoveX=t-i.left-Math.max(o.left-i.left,0),this.mouseDownY=this.previousMouseMoveY=n-i.top-Math.max(o.top-i.top,0),this.enableRotation&&(this.isTouch&&this.tooltip3DModule&&this.tooltip3DModule.svgTooltip&&this.tooltip3DModule.svgTooltip.fadeOut(),this.rotateActivate=!0,this.previousCoords={x:this.mouseDownX,y:this.mouseDownY}),this.notify(F.touchStartEvent,e),!1},iFe.prototype.mouseMove=function(e){var t,i=("touchmove"===e.type?(this.isTouch=!0,t=e.changedTouches[0].clientX,e.changedTouches[0]):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType||this.isTouch,t=e.clientX,e)).clientY;return ie(this.svgId)&&(this.setMouseXY(t,i),this.chartOnMouseMove(e)),!1},iFe.prototype.mouseLeave=function(e){var t,i=("touchleave"===e.type?(this.isTouch=!0,t=e.changedTouches[0].clientX,e.changedTouches[0]):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType,t=e.clientX,e)).clientY;return this.setMouseXY(t,i),this.chartOnMouseLeave(e),!1},iFe.prototype.mouseEnd=function(e){var t,i;return"touchend"===e.type?(t=(i=e).changedTouches[0].clientX,this.isTouch=!0,i=i.changedTouches[0].clientY):(i=e.clientY,t=e.clientX,this.isTouch="touch"===e.pointerType||"2"===e.pointerType),this.setMouseXY(t,i),this.chartOnMouseUp(e),!1},iFe.prototype.chartOnMouseUp=function(e){var t=e.target;return this.trigger("chart3DMouseUp",{target:t.id,x:this.mouseX,y:this.mouseY}),this.isTouch&&(this.titleTooltip(e,this.mouseX,this.mouseY),this.axisTooltip(e,this.mouseX,this.mouseY,this.isTouch)),this.notify(F.touchEndEvent,e),this.rotateActivate=!1,this.delayRedraw=!1},iFe.prototype.print=function(e){new zbe(this).print(e)},iFe.prototype.chartOnMouseMove=function(e){var t,i=e.target;return this.trigger("chart3DMouseMove",{target:i.id,x:this.mouseX,y:this.mouseY}),this.pointMove&&this.triggerPointEvent(tfe,e),this.isTouch||(this.titleTooltip(e,this.mouseX,this.mouseY),this.axisTooltip(e,this.mouseX,this.mouseY)),this.rotateActivate&&o0e(this.mouseX,this.mouseY,this.chartAxisLayoutPanel.seriesClipRect)&&(i=this.previousCoords.x-this.mouseX,t=this.previousCoords.y-this.mouseY,i||t)&&(this.tilt-=t,this.rotation+=i,this.isTouch?(document.querySelectorAll('[id*="axis-label-"]').forEach(function(e){return e.remove()}),this.delayRedraw=!0):((t=document.getElementById(this.chart3D.id)).innerHTML="",t.remove()),i={width:this.availableSize.width,height:this.availableSize.height},this.graphics.view(this.svgObject,this,this.rotation,this.tilt,i,this.perspectiveAngle,this.depth),O0e(!1,this.svgObject,this.chart3D,this.redraw),this.previousCoords.y=this.mouseY,this.previousCoords.x=this.mouseX,this.isRemove=!1),this.notify(F.touchMoveEvent,e),this.isTouch=!1},iFe.prototype.titleTooltip=function(e,t,i,n){var o=e.target.id,r=o===this.element.id+"-chart-title"||o===this.element.id+"-chart-sub-title"||-1<o.indexOf("-axis-title")||-1<o.indexOf("_legend_title"),s=0;-1<o.indexOf("-axis-title")&&(s=parseInt(o.replace(this.element.id+"-svg","").replace("-axis-title","").split("-")[1],10)),r&&-1<e.target.textContent.indexOf("...")?Fye(o===this.element.id+"-chart-title"?this.title:-1<o.indexOf("-axis-title")?this.axisCollections[s].title:-1<o.indexOf("-chart-sub-title")?this.subTitle:this.legendSettings.title,t,i,this.element.offsetWidth,this.element.id+"-EJ2-title-tooltip",ie(this.element.id+"_Secondary_Element"),n):Fo(this.element.id+"-EJ2-title-tooltip")},iFe.prototype.setMouseXY=function(e,t){var i,n;ie(this.svgId)&&(i=ie(this.svgId).getBoundingClientRect(),n=this.element.getBoundingClientRect(),this.mouseY=t-n.top-Math.max(i.top-n.top,0)/this.scaleX,this.mouseX=e-n.left-Math.max(i.left-n.left,0)/this.scaleY)},iFe.prototype.chartOnMouseLeave=function(e){var t=e.target,i=F.isPointer?"pointerleave":"mouseleave";return this.trigger("chart3DMouseLeave",{target:t.id,x:this.mouseX,y:this.mouseY}),Fo(this.element.id+"-EJ2-axis-label-tooltip"),this.isPointMouseDown=!1,this.notify(i,e),this.rotateActivate=!1,this.delayRedraw=!1},iFe.prototype.chartKeyDown=function(e){var t="";return"Tab"===e.code&&this.removeNavigationStyle(),"Space"===e.code&&e.preventDefault(),this.tooltip.enable&&("Tab"===e.code&&-1<this.previousTargetId.indexOf("-series")||"Escape"===e.code)&&(t="ESC"),"None"!==this.highlightMode&&"Tab"===e.code&&-1<this.previousTargetId.indexOf("_chart_legend_")&&this.highlight3DModule&&this.highlight3DModule.removeLegendHighlightStyles(),e.ctrlKey&&"p"===e.key&&(e.preventDefault(),t="CtrlP"),""!==t&&this.chartKeyboardNavigations(e,e.target.id,t),!1},iFe.prototype.chartKeyUp=function(e){var t="",i=e.target.id,n=e.target,o=ie(this.element.id+"-chart-title"),r=ie(this.element.id+"-svg-0-region-series-0-point-0"),s=ie(this.element.id+"_chart_legend_translate_g"),a=ie(this.element.id+"_chart_legend_pageup");if(this.removeNavigationStyle(),o&&o.setAttribute("class","e-chart-focused"),r&&((l=r.getAttribute("class"))&&-1===l.indexOf("e-chart-focused")?l+=" e-chart-focused":l=l||"e-chart-focused",r.setAttribute("class",l)),s&&((l=(o=s.firstElementChild).getAttribute("class"))&&-1===l.indexOf("e-chart-focused")?l+=" e-chart-focused":l=l||"e-chart-focused",o.setAttribute("class",l)),a&&a.setAttribute("class","e-chart-focused"),"Tab"===e.code)""!==this.previousTargetId&&(-1<this.previousTargetId.indexOf("-series-")&&-1===i.indexOf("-series-")?(s=ie(this.element.id+"-svg-0-region-series-"+this.currentSeriesIndex+"-point-"+this.currentPointIndex),this.setTabIndex(s,r),this.currentPointIndex=0,this.currentSeriesIndex=0):-1<this.previousTargetId.indexOf("_chart_legend_page")&&-1===i.indexOf("_chart_legend_page")&&-1===i.indexOf("_chart_legend_g_")?this.setTabIndex(e.target,ie(this.element.id+"_chart_legend_pageup")):-1<this.previousTargetId.indexOf("_chart_legend_g_")&&-1===i.indexOf("_chart_legend_g_")&&(o=ie(this.element.id+"_chart_legend_translate_g"),this.setTabIndex(o.children[this.currentLegendIndex],o.firstElementChild))),-1<(this.previousTargetId=i).indexOf("-series-")&&(this.currentSeriesIndex=+i.split("-series-")[1].split("-point-")[0],n.removeAttribute("tabindex"),n.blur(),i=this.focusChild(n)),t="None"!==this.highlightMode||this.tooltip.enable?"Tab":"";else if(-1<e.code.indexOf("Arrow")){if(e.preventDefault(),-1<(this.previousTargetId=i).indexOf("_chart_legend_page"))"ArrowLeft"===e.code?(ie(this.element.id+"_chart_legend_pagedown").removeAttribute("tabindex"),this.focusChild(ie(this.element.id+"_chart_legend_pageup"))):"ArrowRight"===e.code&&(ie(this.element.id+"_chart_legend_pageup").removeAttribute("tabindex"),this.focusChild(ie(this.element.id+"_chart_legend_pagedown")));else if(-1<i.indexOf("_chart_legend_")){var l=n.parentElement.children,a=(l[this.currentLegendIndex].removeAttribute("tabindex"),this.currentLegendIndex+="ArrowUp"===e.code||"ArrowRight"===e.code?1:-1,this.currentLegendIndex=this.getActualIndex(this.currentLegendIndex,l.length),l[this.currentLegendIndex]);this.focusChild(a),this.removeNavigationStyle(),this.setNavigationStyle(a.id),i=a.children[1].id,t="None"!==this.highlightMode?"ArrowMove":""}else if(-1<i.indexOf("-series-")){var h=e.target;if(n.removeAttribute("tabindex"),n.blur(),"ArrowRight"===e.code||"ArrowLeft"===e.code?(this.currentSeriesIndex=this.currentSeriesIndex+("ArrowRight"===e.code?1:-1),this.currentSeriesIndex=this.getActualIndex(this.currentSeriesIndex,this.series.length)):this.currentPointIndex+="ArrowUp"===e.code?1:-1,-1<i.indexOf("-point-")){this.currentPointIndex=this.getActualIndex(this.currentPointIndex,this.visibleSeries[this.currentSeriesIndex].points.length?this.currentSeries.points.length:1);for(var d=document.querySelectorAll('[id*="svg-0-region-series-'+this.currentSeriesIndex+"-point-"+this.currentPointIndex+'"]'),p=0;p<d.length;p++)d[p].id.split("-point-")[1].split("-")[0]===this.currentPointIndex.toString()&&(h=d[p])}i=this.focusChild(h),this.removeNavigationStyle(),this.setNavigationStyle(h.id),t=this.tooltip.enable||"None"!==this.highlightMode?"ArrowMove":""}}else"Enter"!==e.code&&"Space"!==e.code||!(-1<i.indexOf("_chart_legend_")||-1<i.indexOf("-point-"))||(i=!(-1<i.indexOf("_chart_legend_page"))&&-1<i.indexOf("_chart_legend_")?n.children[1].id:i,t="Enter");return""!==t&&this.chartKeyboardNavigations(e,i,t),"Tab"===e.code&&this.setNavigationStyle(i),!1},iFe.prototype.setTabIndex=function(e,t){e&&e.removeAttribute("tabindex"),t&&t.setAttribute("tabindex","0")},iFe.prototype.getActualIndex=function(e,t){return t-1<e?0:e<0?t-1:e},iFe.prototype.axisTooltip=function(e,t,i,n){var o=e.target.id;-1<o.indexOf("axis-label")&&-1<e.target.textContent.indexOf("...")?(e=this.legendSettings.visible||""===this.primaryXAxis.title,Fye(this.findAxisLabel(o),t,i,this.element.offsetWidth,this.element.id+"-EJ2-axis-label-tooltip",ie(this.element.id+"_Secondary_Element"),n,e)):Fo(this.element.id+"-EJ2-axis-label-tooltip")},iFe.prototype.findAxisLabel=function(e){e=e.replace(this.element.id+"-","").replace("-axis-label","").split("-");return this.axisCollections[parseInt(e[0],10)].visibleLabels[parseInt(e[1],10)].originalText},iFe.prototype.focusChild=function(e){e.setAttribute("tabindex","0");var t=e.getAttribute("class");return e.setAttribute("tabindex","0"),t=t&&-1===t.indexOf("e-chart-focused")?"e-chart-focused "+t:t||"e-chart-focused",e.setAttribute("class",t),e.focus(),e.id},iFe.prototype.documentKeyHandler=function(e){e.altKey&&74===e.keyCode&&!je(this.element)&&this.element.focus()},iFe.prototype.chartKeyboardNavigations=function(e,t,i){switch(this.isLegendClicked=!1,this.removeNavigationStyle(),this.setNavigationStyle(t),i){case"Tab":case"ArrowMove":var n,o;if(this.highlight3DModule&&this.highlight3DModule.removeLegendHighlightStyles(),-1<t.indexOf("-point-")&&(document.activeElement&&(n=(o=document.activeElement.getBoundingClientRect()).left+o.width/2,o=o.top,n=window.scrollX+n,o=window.scrollY+o,this.mouseX=n,this.mouseY=o),this.highlight3DModule&&(this.highlight3DModule.highlightChart(document.getElementById(t),"mousemove"),this.highlight3DModule.completeSelection()),this.tooltip3DModule)&&(n={series:this.visibleSeries[t.split("-series-")[1].split("-point-")[0]],point:this.visibleSeries[t.split("-series-")[1].split("-point-")[0]].points[t.split("-point-")[1].split("-")[0]]},o=(o=document.getElementById(this.element.id+"_tooltip_svg"))&&0<parseInt(o.getAttribute("opacity"),10),r=this.tooltip3DModule.getTooltipElement(o),this.tooltip3DModule.pushData(n,!o,r,!0))&&this.tooltip3DModule.triggerTooltipRender(n,!o,this.tooltip3DModule.getTooltipText(n),this.tooltip3DModule.findHeader(n)),this.highlight3DModule&&"None"!==this.highlightMode){t=-1<t.indexOf("_chart_legend_g_")?document.getElementById(t).firstChild.id:t;for(var r=this.element.id+"_chart_legend",s=[r+"_text_",r+"_shape_marker_",r+"_shape_"],a=0;a<s.length;a++){var l=s[a];if(-1<t.indexOf(l)){document.getElementById(t).setAttribute("class",""),this.highlight3DModule.legendSelection(this,parseInt(t.split(l)[1],10),document.getElementById(t),"mousemove");break}}}break;case"Enter":case"Space":-1<t.indexOf("_chart_legend_")?(this.isLegendClicked=!0,this.legend3DModule.click(e),this.focusChild(document.getElementById(t).parentElement),this.setNavigationStyle(document.getElementById(t).parentElement.id)):(this.selection3DModule&&this.selection3DModule.calculateSelectedElements(document.getElementById(t),"click"),this.setNavigationStyle(t));break;case"CtrlP":this.print();break;case"ESC":this.tooltip3DModule.removeTooltip(1)}},iFe.prototype.setStyle=function(e){var t="None"!==this.selectionMode||"None"!==this.highlightMode;e.style.touchAction=this.enableRotation||t?"none":"element",e.style.msTouchAction=t?"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",e.style.height=e.style.height||this.height&&-1===this.height.indexOf("%")?e.style.height:"inherit"},iFe.prototype.isSecondaryAxis=function(e){return-1<this.axes.indexOf(e)},iFe.prototype.refreshDefinition=function(e){for(var t=0,i=e;t<i.length;t++)i[t].axes=[]},iFe.prototype.addSeries=function(e){this.animateSeries=!1;for(var t=0,i=e;t<i.length;t++){var n=i[t],n=new HBe(this,"series",n);this.series.push(n)}this.refresh()},iFe.prototype.removeSeries=function(e){this.redraw=!1,this.animateSeries=!1,this.visibleSeries[e]&&(this.visibleSeries[e].xAxis.orientation=null,this.visibleSeries[e].yAxis.orientation=null);for(var t=0;t<this.axes.length;t++)null===this.axes[t].orientation&&this.axes.splice(t,1);this.series.splice(e,1),this.refresh()},iFe.prototype.refreshAxis=function(){var e=this.primaryXAxis;e.rect=new Do(void 0,void 0,0,0),(e=this.primaryYAxis).isStack100=!1,e.rect=new Do(void 0,void 0,0,0);for(var t=0,i=this.axes;t<i.length;t++)(e=i[t]).rect=new Do(void 0,void 0,0,0),e.isStack100=!1},iFe.prototype.axisChange=function(e){return!(!e.name&&!e.valueType||(this.refreshDefinition(this.columns),this.refreshDefinition(this.rows),this.calculateVisibleAxis(),this.processData(),0))},iFe.prototype.getVisibleSeries=function(e,t){for(var i=0,n=e;i<n.length;i++){var o=n[i];if(t===o.index)return o}return null},iFe.prototype.removeStyles=function(){Fo(this.element.id+"_ej2_chart_selection"),Fo(this.element.id+"_ej2_chart_highlight")},iFe.prototype.calculateVisibleSeries=function(){this.visibleSeries=[];var e,t=this.palettes.length?this.palettes:DPe(this.theme),i=t.length,n=this.series,o=this.series[0];o&&(this.requireInvertedAxis=-1!==o.type.indexOf("Bar")&&!this.isTransposed||-1===o.type.indexOf("Bar")&&this.isTransposed);for(var r=0,s=n.length;r<s;r++){switch((e=n[r]).category="Series",e.index=r,e.interior=e.fill||t[r%i],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})),e.type){case"Bar":case"StackingBar":case"StackingBar100":if(-1===n[0].type.indexOf("Bar"))continue;break;default:if(-1<n[0].type.indexOf("Bar"))continue}this.visibleSeries.push(e),n[r]=e}},iFe.prototype.highlightAnimation=function(t,e,i,n){var o=parseFloat(this.visibleSeries[e].opacity.toString());o&&new Vt({}).animate(t,{duration:i,progress:function(e){t.style.animation="";e=e.timeStamp/e.duration,e=n+(o-n)*e;t.setAttribute("opacity",e.toString())},end:function(){t.setAttribute("opacity",o.toString())}})},iFe.prototype.stopElementAnimation=function(e,t){t=parseFloat(this.visibleSeries[t].opacity.toString());e.getAttribute("e-animate")&&Vt.stop(e),e.setAttribute("opacity",t.toString())},iFe.prototype.destroy=function(){this.horizontalAxes=[],this.verticalAxes=[],this.visibleSeries=[],this.axisCollections=[],this.seriesElements=null,this.chartAxisLayoutPanel=null,this.dataLabelElements=null,this.dataLabelCollections=null,Fo(this.element.id+"Keyboard_chart_focus"),Fo(this.element.id+"_ej2_chart_highlight"),Fo("chartmeasuretext");var e=document.getElementById(this.element.id+"_ej2_chart_highlight"),e=(e&&e.remove(),document.getElementById(this.element.id+"_ej2_chart_selection"));e&&e.remove(),this.element&&(this.unWireEvents(),this.isReact&&this.clearTemplate(),eFe.prototype.destroy.call(this),this.polygons=[],(e=document.getElementById(this.chart3D.id))&&(e.innerHTML="",e.remove()),this.removeSvg(),this.svgObject=null)},iFe.prototype.getModuleName=function(){return"chart3d"},iFe.prototype.getPersistData=function(){return this.addOnPersist(["loaded"])},iFe.prototype.onPropertyChanged=function(e,t){var i,n=!1,o=!1,r=this.animateSeries=!1;if(!this.delayRedraw){for(var s=0,a=Object.keys(e);s<a.length;s++)switch(a[s]){case"primaryXAxis":p=e.primaryXAxis,o=this.axisChange(p),e.primaryXAxis.edgeLabelPlacement&&(n=!0),o=!0,je(p.isInversed)&&je(p.opposedPosition)||this.primaryXAxis.setIsInversedAndOpposedPosition();break;case"primaryYAxis":p=e.primaryYAxis,o=this.axisChange(p),e.primaryYAxis.edgeLabelPlacement&&(n=!0),o=!0,je(p.isInversed)&&je(p.opposedPosition)||this.primaryYAxis.setIsInversedAndOpposedPosition();break;case"axes":for(var l=0,h=Object.keys(e.axes);l<h.length;l++){var d=h[l],p=e.axes[d],o=o||this.axisChange(p);o=!0,je(p.isInversed)&&je(p.opposedPosition)||this.axes[d].setIsInversedAndOpposedPosition()}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:n=!0;break;case"subTitleStyle":e.subTitleStyle&&(e.subTitleStyle.size||e.subTitleStyle.textOverflow)?o=!0:n=!0;break;case"border":n=!0;break;case"series":for(var c=this.series.length,u=0;u<c;u++)(i=e.series[u])&&(i.dataSource||i.query||i.xName||i.yName||i.size||i.fill||i.name||i.type)&&(Pe(this.getVisibleSeries(this.visibleSeries,u),i,null,!0),r=!0);this.availableSize&&this.element&&(this.element.style.height=this.element.style.height&&"inherit"!==this.element.style.height?this.element.style.height:this.availableSize.height+"px"),r&&(this.calculateVisibleSeries(),this.refreshDefinition(this.columns),this.refreshDefinition(this.rows),this.calculateVisibleAxis(),this.processData(!1),o=!0);break;case"background":n=!0;break;case"dataSource":this.processData(!1),o=!0;break;case"legendSettings":e.legendSettings.background&&e.legendSettings.opacity||(o=!0),n=!0;break;case"palettes":this.calculateVisibleSeries(),n=!0;break;case"selectedDataIndexes":this.selection3DModule&&(this.selection3DModule.currentMode=this.selectionMode,this.selection3DModule.selectedDataIndexes=this.selectedDataIndexes,this.selection3DModule.styleId=this.element.id+"_ej2_chart_selection",this.selection3DModule.redrawSelection(this,t.selectionMode,!0));break;case"selectionMode":this.selection3DModule&&e.selectionMode&&-1===e.selectionMode.indexOf("Drag")&&(this.selection3DModule.currentMode=this.selectionMode,this.selection3DModule.styleId=this.element.id+"_ej2_chart_selection",this.selection3DModule.redrawSelection(this,t.selectionMode,!0));break;case"isMultiSelect":this.selection3DModule&&!e.isMultiSelect&&1<this.selection3DModule.selectedDataIndexes.length&&(this.selection3DModule.currentMode=this.selectionMode,this.selection3DModule.styleId=this.element.id+"_ej2_chart_selection",this.selection3DModule.redrawSelection(this,t.selectionMode));break;case"highlightMode":case"selectionPattern":case"highlightPattern":this.removeStyles(),n=!0;break;case"theme":this.animateSeries=!0;break;case"enableRtl":case"locale":case"currencyCode":this.refresh();break;case"tooltip":this.tooltip3DModule&&(this.tooltip3DModule.previousPoints=[],this.tooltip.template)&&(this.tooltip3DModule.template=this.tooltip.template);break;case"enableRotation":case"tilt":case"depth":case"wallSize":case"rotation":case"perspectiveAngle":case"enableSideBySidePlacement":n=!0}!o&&n&&(this.removeSvg(),this.polygons=[],this.renderElements(),this.trigger("loaded",{chart:this})),o&&(this.removeSvg(),this.isReact&&this.clearTemplate(),this.polygons=[],this.refreshAxis(),this.refreshBound(),this.trigger("loaded",{chart:this}),this.redraw=!1,this.animated=!1)}},tFe([e("")],iFe.prototype,"title",void 0),tFe([e("")],iFe.prototype,"subTitle",void 0),tFe([e("Bootstrap5")],iFe.prototype,"theme",void 0),tFe([e(null)],iFe.prototype,"description",void 0),tFe([e(null)],iFe.prototype,"width",void 0),tFe([e(null)],iFe.prototype,"backgroundImage",void 0),tFe([e(null)],iFe.prototype,"background",void 0),tFe([e("")],iFe.prototype,"dataSource",void 0),tFe([e(null)],iFe.prototype,"height",void 0),tFe([e(50)],iFe.prototype,"depth",void 0),tFe([e(2)],iFe.prototype,"wallSize",void 0),tFe([e(0)],iFe.prototype,"tilt",void 0),tFe([e(!1)],iFe.prototype,"enableRotation",void 0),tFe([e(0)],iFe.prototype,"rotation",void 0),tFe([e(!0)],iFe.prototype,"enableSideBySidePlacement",void 0),tFe([e(90)],iFe.prototype,"perspectiveAngle",void 0),tFe([e(null)],iFe.prototype,"wallColor",void 0),tFe([e(!1)],iFe.prototype,"isTransposed",void 0),tFe([e("USD")],iFe.prototype,"currencyCode",void 0),tFe([e(!1)],iFe.prototype,"enableExport",void 0),tFe([i()],iFe.prototype,"load",void 0),tFe([i()],iFe.prototype,"loaded",void 0),tFe([i()],iFe.prototype,"pointClick",void 0),tFe([i()],iFe.prototype,"pointMove",void 0),tFe([i()],iFe.prototype,"pointRender",void 0),tFe([i()],iFe.prototype,"legendRender",void 0),tFe([i()],iFe.prototype,"legendClick",void 0),tFe([i()],iFe.prototype,"seriesRender",void 0),tFe([i()],iFe.prototype,"textRender",void 0),tFe([i()],iFe.prototype,"tooltipRender",void 0),tFe([i()],iFe.prototype,"beforeResize",void 0),tFe([i()],iFe.prototype,"resized",void 0),tFe([i()],iFe.prototype,"chart3DMouseMove",void 0),tFe([i()],iFe.prototype,"chart3DMouseClick",void 0),tFe([i()],iFe.prototype,"chart3DMouseDown",void 0),tFe([i()],iFe.prototype,"chart3DMouseLeave",void 0),tFe([i()],iFe.prototype,"chart3DMouseUp",void 0),tFe([i()],iFe.prototype,"axisLabelRender",void 0),tFe([i()],iFe.prototype,"selectionComplete",void 0),tFe([i()],iFe.prototype,"beforeExport",void 0),tFe([i()],iFe.prototype,"afterExport",void 0),tFe([i()],iFe.prototype,"beforePrint",void 0),tFe([t({},zge)],iFe.prototype,"margin",void 0),tFe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},fPe)],iFe.prototype,"titleStyle",void 0),tFe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},fPe)],iFe.prototype,"subTitleStyle",void 0),tFe([t({},XBe)],iFe.prototype,"legendSettings",void 0),tFe([t({color:"#DDDDDD",width:0},Rge)],iFe.prototype,"border",void 0),tFe([t({name:"primaryXAxis"},yPe)],iFe.prototype,"primaryXAxis",void 0),tFe([t({name:"primaryYAxis"},yPe)],iFe.prototype,"primaryYAxis",void 0),tFe([t({},BBe)],iFe.prototype,"tooltip",void 0),tFe([kt([{}],dBe)],iFe.prototype,"rows",void 0),tFe([kt([{}],uBe)],iFe.prototype,"columns",void 0),tFe([kt([{}],yPe)],iFe.prototype,"axes",void 0),tFe([kt([{}],HBe)],iFe.prototype,"series",void 0),tFe([e("")],iFe.prototype,"highlightColor",void 0),tFe([e("None")],iFe.prototype,"selectionMode",void 0),tFe([e("None")],iFe.prototype,"highlightMode",void 0),tFe([e("None")],iFe.prototype,"selectionPattern",void 0),tFe([e("None")],iFe.prototype,"highlightPattern",void 0),tFe([e(!1)],iFe.prototype,"isMultiSelect",void 0),tFe([kt([],$ge)],iFe.prototype,"selectedDataIndexes",void 0),tFe([e(!1)],iFe.prototype,"useGroupingSeparator",void 0),tFe([e([])],iFe.prototype,"palettes",void 0),tFe([Bt],iFe));function iFe(e,t){e=eFe.call(this,e,t)||this;return e.previousTargetId="",e.currentPointIndex=0,e.currentSeriesIndex=0,e.currentLegendIndex=0,e.animated=!1,e.isPointMouseDown=!1,e.visible=0,e.clickCount=0,e.maxPointCount=0,e.singleClickTimer=0,e.isRtlEnabled=!1,e.scaleX=1,e.scaleY=1,e.chartId=57723,e.isLegendClicked=!1,e.rotateActivate=!1,e.isRemove=!1,e.polygons=[],e}nFe=function(e,t){return(nFe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}nFe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(sFe,oFe=rBe),sFe.prototype.calculateDateTimeNiceInterval=function(e,t,i,n){var o,i=new Date(i),n=new Date(n),r=Math.abs((i.getTime()-n.getTime())/864e5);switch(e.actualIntervalType=e.intervalType,e.intervalType){case"Years":o=this.calculateNumericNiceInterval(e,r/365,t);break;case"Months":o=this.calculateNumericNiceInterval(e,r/30,t);break;case"Days":o=this.calculateNumericNiceInterval(e,r,t);break;case"Hours":o=this.calculateNumericNiceInterval(e,24*r,t);break;case"Minutes":o=this.calculateNumericNiceInterval(e,24*r*60,t);break;case"Seconds":o=this.calculateNumericNiceInterval(e,24*r*60*60,t);break;case"Auto":return 1<=(o=this.calculateNumericNiceInterval(e,r/365,t))?e.actualIntervalType="Years":1<=(o=this.calculateNumericNiceInterval(e,r/30,t))?e.actualIntervalType="Months":1<=(o=this.calculateNumericNiceInterval(e,r,t))?e.actualIntervalType="Days":1<=(o=this.calculateNumericNiceInterval(e,24*r,t))?e.actualIntervalType="Hours":1<=(o=this.calculateNumericNiceInterval(e,24*r*60,t))?e.actualIntervalType="Minutes":(o=this.calculateNumericNiceInterval(e,24*r*60*60,t),e.actualIntervalType="Seconds"),o}return o},sFe.prototype.getSkeleton=function(e){var t=e.actualIntervalType;return e.skeleton||("Years"===t?"DateTime"===e.valueType&&e.isIntervalInDecimal?"y":"yMMM":"Months"===t?"MMMd":"Days"===t?"DateTime"===e.valueType?"MMMd":"yMd":"Hours"===t?"DateTime"===e.valueType?"Hm":"EHm":"Hms")},sFe.prototype.findCustomFormats=function(e){var t=e.labelFormat||"";return t=e.skeleton||"Months"!==e.actualIntervalType?t:t||("DateTime"===e.valueType?"MMM yyyy":"yMMM")};var nFe,oFe,rFe=sFe;function sFe(){return null!==oFe&&oFe.apply(this,arguments)||this}aFe=function(e,t){return(aFe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}aFe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(dFe,lFe=rFe),dFe.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t)},dFe.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/C0e(t,e))),e.actualRange.min=e.doubleRange.start,e.actualRange.max=e.doubleRange.end,e.actualRange.delta=e.doubleRange.delta},dFe.prototype.applyRangePadding=function(e,t){e.actualRange.min-=.5,e.actualRange.max+=.5,e.doubleRange=new nBe(e.actualRange.min,e.actualRange.max),e.actualRange.delta=e.doubleRange.delta,this.calculateVisibleRange(t,e)},dFe.prototype.calculateVisibleLabels=function(e){e.visibleLabels=[],e.visibleRange.interval=e.visibleRange.interval<1?1:e.visibleRange.interval;var t,i,n=Math.ceil(e.visibleRange.min);for(e.startLabel=e.labels[Math.round(e.visibleRange.min)],e.endLabel=e.labels[Math.floor(e.visibleRange.max)];n<=e.visibleRange.max;n+=e.visibleRange.interval)t=Pe({},R("properties",e.labelStyle),null,!0),Rye(n,e.visibleRange)&&0<e.labels.length&&(i=Math.round(n),v0e(this.chart,i,(e.labels[i]||i).toString(),t,e));e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},dFe.prototype.getModuleName=function(){return"Category3D"},dFe.prototype.destroy=function(){};var aFe,lFe,hFe=dFe;function dFe(e){return lFe.call(this,e)||this}pFe=function(e,t){return(pFe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}pFe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(gFe,cFe=rFe),gFe.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t,this.chart)},gFe.prototype.getActualRange=function(e,t){var i={skeleton:"full",type:"dateTime"},n=this.chart.intl.getDateParser(i),i=this.chart.intl.getDateFormat(i),n=(null!==e.minimum?this.min=Date.parse(n(i(new Date(Sa.parse.parseJson({val:e.minimum}).val)))):null!==this.min&&this.min!==Number.POSITIVE_INFINITY||(this.min=Date.parse(n(i(new Date(1970,1,1))))),null!==e.maximum?this.max=Date.parse(n(i(new Date(Sa.parse.parseJson({val:e.maximum}).val)))):null!==this.max&&this.max!==Number.NEGATIVE_INFINITY||(this.max=Date.parse(n(i(new Date(1970,5,1))))),this.min===this.max&&(this.max=this.max+2592e6,this.min=this.min-2592e6),e.actualRange={},e.doubleRange=new nBe(this.min,this.max),this.calculateDateTimeNiceInterval(e,t,e.doubleRange.start,e.doubleRange.end));e.interval?e.actualRange.interval=e.interval:e.actualRange.interval=n,e.actualRange.min=e.doubleRange.start,e.actualRange.max=e.doubleRange.end},gFe.prototype.applyRangePadding=function(e,t){this.min=e.actualRange.min,this.max=e.actualRange.max;var i=e.actualRange.interval;if(!b0e(e)){var n=e.getRangePadding(this.chart),o=new Date(this.min),r=new Date(this.max),s=e.actualIntervalType;if("None"===n)this.min=o.getTime(),this.max=r.getTime();else if("Additional"===n||"Round"===n)switch(s){case"Years":this.getYear(o,r,n,i);break;case"Months":this.getMonth(o,r,n,i);break;case"Days":this.getDay(o,r,n,i);break;case"Hours":this.getHour(o,r,n,i);break;case"Minutes":var a=o.getMinutes()/i*i,l=r.getMinutes()+(o.getMinutes()-a);"Round"===n?(this.min=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),a,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),l,59).getTime()):(this.min=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),a-i,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),l+i,0).getTime());break;case"Seconds":a=o.getSeconds()/i*i,l=r.getSeconds()+(o.getSeconds()-a);"Round"===n?(this.min=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),a,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),l,0).getTime()):(this.min=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),a-i,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),l+i,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 nBe(e.actualRange.min,e.actualRange.max),this.calculateVisibleRange(t,e)},gFe.prototype.getYear=function(e,t,i,n){e=e.getFullYear(),t=t.getFullYear();"Additional"===i?(this.min=new Date(e-n,1,1,0,0,0).getTime(),this.max=new Date(t+n,1,1,0,0,0).getTime()):(this.min=new Date(e,0,0,0,0,0).getTime(),this.max=new Date(t,11,30,23,59,59).getTime())},gFe.prototype.getMonth=function(e,t,i,n){var o=e.getMonth(),r=t.getMonth();"Round"===i?(this.min=new Date(e.getFullYear(),o,0,0,0,0).getTime(),this.max=new Date(t.getFullYear(),r,new Date(t.getFullYear(),t.getMonth(),0).getDate(),23,59,59).getTime()):(this.min=new Date(e.getFullYear(),o+-n,1,0,0,0).getTime(),this.max=new Date(t.getFullYear(),r+n,2===r?28:30,0,0,0).getTime())},gFe.prototype.getDay=function(e,t,i,n){var o=e.getDate(),r=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(),r,23,59,59).getTime()):(this.min=new Date(e.getFullYear(),e.getMonth(),o+-n,0,0,0).getTime(),this.max=new Date(t.getFullYear(),t.getMonth(),r+n,0,0,0).getTime())},gFe.prototype.getHour=function(e,t,i,n){var o=e.getHours()/n*n,r=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(),r,59,59).getTime()):(this.min=new Date(e.getFullYear(),e.getMonth(),e.getDate(),o-n,0,0).getTime(),this.max=new Date(t.getFullYear(),t.getMonth(),t.getDate(),r+n,0,0).getTime())},gFe.prototype.calculateVisibleRange=function(e,t){t.visibleRange={min:t.actualRange.min,max:t.actualRange.max,interval:t.actualRange.interval,delta:t.actualRange.delta},t.dateTimeInterval=this.increaseDateTimeInterval(t,t.visibleRange.min,t.visibleRange.interval).getTime()-t.visibleRange.min,t.triggerRangeRender(this.chart,t.visibleRange.min,t.visibleRange.max,t.visibleRange.interval)},gFe.prototype.calculateVisibleLabels=function(e,t){e.visibleLabels=[];var i=e.visibleRange.min;for(b0e(e)||(i=this.alignRangeStart(e,i,e.visibleRange.interval).getTime());i<=e.visibleRange.max;){var n=Pe({},R("properties",e.labelStyle),null,!0);if(e.format=t.intl.getDateFormat({format:this.findCustomFormats(e)||"",type:l0e(e.skeletonType),skeleton:this.getSkeleton(e)}),e.startLabel=e.format(new Date(e.visibleRange.min)),e.endLabel=e.format(new Date(e.visibleRange.max)),Rye(i,e.visibleRange)&&(this.increaseDateTimeInterval(e,i,e.visibleRange.interval).getTime()>e.visibleRange.max&&(e.endLabel=e.format(new Date(i))),v0e(t,i,e.format(new Date(i)),n,e)),i===(i=this.increaseDateTimeInterval(e,i,e.visibleRange.interval).getTime()))break}"Months"!==e.actualIntervalType&&"Days"!==e.actualIntervalType||(e.format=t.intl.getDateFormat({format:e.labelFormat||("Months"!==e.actualIntervalType||e.skeleton?"":"y MMM"),type:l0e(e.skeletonType),skeleton:e.skeleton||("Days"===e.actualIntervalType?"MMMd":"")})),e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},gFe.prototype.increaseDateTimeInterval=function(e,t,i){var n=new Date(t),t=(e.interval?e.isIntervalInDecimal=i%1==0:i=Math.ceil(i),e.visibleRange.interval=i,e.actualIntervalType);if(e.isIntervalInDecimal)switch(t){case"Years":return n.setFullYear(n.getFullYear()+i),n;case"Months":return n.setMonth(n.getMonth()+i),n;case"Days":return n.setDate(n.getDate()+i),n;case"Hours":return n.setHours(n.getHours()+i),n;case"Minutes":return n.setMinutes(n.getMinutes()+i),n;case"Seconds":return n.setSeconds(n.getSeconds()+i),n}return n},gFe.prototype.alignRangeStart=function(e,t,i){var n=new Date(t);switch(e.actualIntervalType){case"Years":var o=Math.floor(Math.floor(n.getFullYear()/i)*i);return n=new Date(o,n.getMonth(),n.getDate(),0,0,0);case"Months":o=Math.floor(Math.floor(n.getMonth()/i)*i);return n=new Date(n.getFullYear(),o,n.getDate(),0,0,0);case"Days":o=Math.floor(Math.floor(n.getDate()/i)*i);return n=new Date(n.getFullYear(),n.getMonth(),o,0,0,0);case"Hours":o=Math.floor(Math.floor(n.getHours()/i)*i);return n=new Date(n.getFullYear(),n.getMonth(),n.getDate(),o,0,0);case"Minutes":o=Math.floor(Math.floor(n.getMinutes()/i)*i);return n=new Date(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),o,0,0);case"Seconds":o=Math.floor(Math.floor(n.getSeconds()/i)*i);return n=new Date(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),o,0)}return n},gFe.prototype.getModuleName=function(){return"DateTime3D"},gFe.prototype.destroy=function(){};var pFe,cFe,uFe=gFe;function gFe(e){return cFe.call(this,e)||this}mFe=function(e,t){return(mFe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}mFe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(vFe,fFe=hFe),vFe.prototype.calculateRangeAndInterval=function(e,t){this.axisSize=e,this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t)},vFe.prototype.calculateVisibleLabels=function(e){e.visibleLabels=[];"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||"",type:l0e(e.skeletonType),skeleton:this.getSkeleton(e)});for(var t,i=0;i<e.labels.length;i++)t=Pe({},R("properties",e.labelStyle),null,!0),this.sameInterval(e.labels.map(Number)[i],e.labels.map(Number)[i-1],e.actualIntervalType,i)&&!e.isIndexed||Rye(+i,e.visibleRange)&&v0e(this.chart,i,e.isIndexed?this.getIndexedAxisLabel(e.labels[i],e.format):e.format(new Date(e.labels.map(Number)[i])),t,e);e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},vFe.prototype.getIndexedAxisLabel=function(e,t){for(var i=e.split(","),n=0;n<i.length;n++)i[n]=t(new Date(parseInt(i[n],10)));return i.join(", ")},vFe.prototype.sameInterval=function(e,t,i,n){var o;if(0===n)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},vFe.prototype.getModuleName=function(){return"DateTimeCategory3D"},vFe.prototype.destroy=function(){};var mFe,fFe,yFe=vFe;function vFe(e){return fFe.call(this,e)||this}bFe=function(e,t){return(bFe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}bFe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(SFe,wFe=rBe),SFe.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.calculateVisibleRange(e,t),this.calculateVisibleLabels(t,this.chart)},SFe.prototype.getActualRange=function(e,t){this.initializeDoubleRange(e),this.min=this.min<0?0:this.min;var i=Bye(this.min,e.logBase),i=isFinite(i)?i:this.min,n=1===this.max?1:Bye(this.max,e.logBase),n=isFinite(i)?n:this.max;this.min=Math.floor(+i),e.series&&e.series.some(function(e){return-1!==e.type.indexOf("Column")||-1!==e.type.indexOf("Bar")})&&(this.min=this.min<=0?+this.min-1:this.min),this.max=Math.ceil(+n),this.max=this.max===this.min?this.max+1:this.max,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},SFe.prototype.calculateVisibleRange=function(e,t){t.visibleRange={interval:t.actualRange.interval,max:t.actualRange.max,min:t.actualRange.min,delta:t.actualRange.delta}},SFe.prototype.calculateLogNiceInterval=function(e,t,i){for(var n=C0e(t,i),o=e,r=Math.pow(i.logBase,Math.floor(Bye(o,10))),s=0,a=i.intervalDivs.length;s<a;s++){var l=r*i.intervalDivs[s];if(n<e/l)break;o=l}return o},SFe.prototype.calculateVisibleLabels=function(e,t){var i,n,o=e.visibleRange.min,r=(e.visibleLabels=[],this.getFormat(e)),s=null!==r.match("{value}"),a=Math.pow(e.logBase,e.visibleRange.min);for(e.format=t.intl.getNumberFormat({format:s?"":r,useGrouping:t.useGroupingSeparator,maximumFractionDigits:a<1?20:3}),e.startLabel=e.format(a<1?+a.toPrecision(1):a),e.endLabel=e.format(Math.pow(e.logBase,e.visibleRange.max));o<=e.visibleRange.max;o+=e.visibleRange.interval)i=Pe({},R("properties",e.labelStyle),null,!0),Rye(o,e.visibleRange)&&(n=Math.pow(e.logBase,o),v0e(this.chart,o,this.formatValue(e,s,r,n<1?+n.toPrecision(1):n),i,e));e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},SFe.prototype.getModuleName=function(){return"Logarithmic3D"},SFe.prototype.destroy=function(){};var bFe,wFe,CFe=SFe;function SFe(e){return wFe.call(this,e)||this}xFe.prototype.draw=function(e,t){this.createSegments(e);for(var i=0;i<e.visiblePoints.length;i++){var n,o=e.visiblePoints[i];o.visible&&(n={cancel:!1,series:e,point:o,fill:e.setPointColor(o,e.interior)},t.trigger(jme,n),o.color=n.fill,o.plans=null,n.cancel?o.symbolLocations=null:this.update(n.series,n.point,i,t))}},xFe.prototype.update=function(e,t,i,n){var o=e.index,r=t.left,s=t.right,a="Logarithmic"===e.yAxis.valueType?Math.pow(e.yAxis.logBase,e.yAxis.visibleRange.min):e.yAxis.visibleRange.min,l="Logarithmic"===e.yAxis.valueType?Math.pow(e.yAxis.logBase,e.yAxis.visibleRange.max):e.yAxis.visibleRange.max,h=e.xAxis.visibleRange.min,d=e.xAxis.visibleRange.max;h<=r&&r<=d&&h<=s&&s<=d&&(r=t.top<0?t.top>a?t.top:a:e.yAxis.valueType&&"logarithmic"===e.yAxis.valueType.toLowerCase()||t.top<l?t.top:l,s=n.svg3DRenderer.transform3DToVisible(e,t.left>h?t.left:h,r,n),l=n.svg3DRenderer.transform3DToVisible(e,d>t.right?t.right:d,a>t.bottom?a:t.bottom,n),h=n.vector.vector3D(Math.min(s.x,l.x),Math.min(s.y,l.y),t.startDepth),r=n.vector.vector3D(Math.max(s.x,l.x),Math.max(s.y,l.y),t.endDepth),d=e.setStyle(e),a="region-series-"+o+"-point-"+i,s=t.x+":"+t.yValue+", "+e.name,"Cylinder"===e.columnFacet?n.polygon.createCylinder(h,r,n,i,e.type,"",t.color,null,d.opacity,a,n.chart3D):"Rectangle"===e.columnFacet&&n.polygon.createBox(h,r,n,i,"",t.color,null,d.opacity,n.requireInvertedAxis,a,n.chart3D,s))},xFe.prototype.createSegments=function(e){var t=e.getXValues(e.visiblePoints),i=e.getYValues(e.visiblePoints);if(null!=t&&null!=i)for(var n=e.getSideBySideInfo(e),o=e.getSegmentDepth(e),r=n.delta/2,s=e.visiblePoints,a=0;a<s.length;a++){var l=t[a]+n.start,h=t[a]+n.end,d=i[a];if(this.setData(l,d,h,0,o.start,o.end,e,s[a]),e.dataLabel.visible)switch(s[a].symbolLocations={x:0,y:0,z:0},e.dataLabel.position){case"Top":s[a].symbolLocations.x=l+r,s[a].symbolLocations.y=d,s[a].symbolLocations.z=o.start;break;case"Bottom":s[a].symbolLocations.x=l+r,s[a].symbolLocations.y=-.2+e.yAxis.visibleRange.min,s[a].symbolLocations.z=o.start+(o.end-o.start)/2;break;default:s[a].symbolLocations.x=l+r,s[a].symbolLocations.y=Math.abs(0-d)/2+e.yAxis.visibleRange.min/2,s[a].symbolLocations.z=o.start}}},xFe.prototype.setData=function(e,t,i,n,o,r,s,a){a.left=e,a.bottom=n,a.top=t,a.right=i,a.startDepth=o,a.endDepth=r,a.xRange=s.getDoubleRange(a.left,a.right),isNaN(a.top)||isNaN(a.bottom)||(a.yRange=s.getDoubleRange(a.top,a.bottom))},xFe.prototype.destroy=function(){},xFe.prototype.getModuleName=function(){return"ColumnSeries3D"};var AFe=xFe;function xFe(){}TFe.prototype.draw=function(e,t){this.createSegments(e);for(var i=0;i<e.visiblePoints.length;i++){var n,o=e.visiblePoints[i];o.visible&&(n={cancel:!1,series:e,point:o,fill:e.setPointColor(o,e.interior)},t.trigger(jme,n),o.color=n.fill,o.plans=null,n.cancel?o.symbolLocations=null:this.update(n.series,n.point,i,t))}},TFe.prototype.update=function(e,t,i,n){var o=e.index,r=t.left,s=t.right,a="Logarithmic"===e.yAxis.valueType?Math.pow(e.yAxis.logBase,e.yAxis.visibleRange.min):e.yAxis.visibleRange.min,l="Logarithmic"===e.yAxis.valueType?Math.pow(e.yAxis.logBase,e.yAxis.visibleRange.max):e.yAxis.visibleRange.max,h=e.xAxis.visibleRange.min,d=e.xAxis.visibleRange.max;h<=r&&r<=d&&h<=s&&s<=d&&(r=t.top<0?t.top>a?t.top:a:e.yAxis.valueType&&"logarithmic"===e.yAxis.valueType.toLowerCase()||t.top<l?t.top:l,s=n.svg3DRenderer.transform3DToVisible(e,t.left>h?t.left:h,r,n),l=n.svg3DRenderer.transform3DToVisible(e,d>t.right?t.right:d,a>t.bottom?a:t.bottom,n),h=n.vector.vector3D(Math.min(s.x,l.x),Math.min(s.y,l.y),t.startDepth),r=n.vector.vector3D(Math.max(s.x,l.x),Math.max(s.y,l.y),t.endDepth),d=e.setStyle(e),a="region-series-"+o+"-point-"+i,"Cylinder"===e.columnFacet?n.polygon.createCylinder(h,r,n,i,e.type,"",t.color,null,d.opacity,a,n.chart3D):"Rectangle"===e.columnFacet&&n.polygon.createBox(h,r,n,i,"",t.color,null,d.opacity,n.requireInvertedAxis,a,n.chart3D))},TFe.prototype.createSegments=function(e){var t=e.getXValues(e.visiblePoints);if(null!=t)for(var i=e.getSideBySideInfo(e),n=e.getSegmentDepth(e),o=i.delta/2,r=e.visiblePoints,s=0;s<r.length;s++){var a=t[s]+i.start,l=t[s]+i.end,h=e.stackedValues.startValues[s],d=e.stackedValues.endValues[s];if(this.setData(a,h,l,d,n.start,n.end,e,r[s]),e.dataLabel.visible)switch(r[s].symbolLocations={x:0,y:0,z:0},e.dataLabel.position){case"Top":r[s].symbolLocations.x=a+o,r[s].symbolLocations.y=h,r[s].symbolLocations.z=n.start+n.delta/2;break;case"Bottom":r[s].symbolLocations.x=a+o,r[s].symbolLocations.y=d-.2,r[s].symbolLocations.z=n.start+(n.end-n.start)/2;break;default:r[s].symbolLocations.x=a+o,r[s].symbolLocations.y=h+(d-h)/2,r[s].symbolLocations.z=n.start}}},TFe.prototype.setData=function(e,t,i,n,o,r,s,a){a.left=e,a.bottom=n,a.top=t,a.right=i,a.startDepth=o,a.endDepth=r,a.xRange=s.getDoubleRange(a.left,a.right),isNaN(a.top)||isNaN(a.bottom)||(a.yRange=s.getDoubleRange(a.top,a.bottom))},TFe.prototype.destroy=function(){},TFe.prototype.getModuleName=function(){return"StackingColumnSeries3D"};var IFe=TFe;function TFe(){}DFe.prototype.draw=function(e,t){this.createSegments(e),e.isRectSeries=!0;for(var i=0;i<e.visiblePoints.length;i++){var n,o=e.visiblePoints[i];o.visible&&(n={cancel:!1,series:e,point:o,fill:e.setPointColor(o,e.interior)},t.trigger(jme,n),o.color=n.fill,o.plans=null,n.cancel?o.symbolLocations=null:this.update(n.series,n.point,i,t))}},DFe.prototype.update=function(e,t,i,n){var o=e.index,r=t.left,s=t.right,a="Logarithmic"===e.yAxis.valueType?Math.pow(e.yAxis.logBase,e.yAxis.visibleRange.min):e.yAxis.visibleRange.min,l="Logarithmic"===e.yAxis.valueType?Math.pow(e.yAxis.logBase,e.yAxis.visibleRange.max):e.yAxis.visibleRange.max,h=e.xAxis.visibleRange.min,d=e.xAxis.visibleRange.max;h<=r&&r<=d&&h<=s&&s<=d&&(r=t.top<0?t.top>a?t.top:a:e.yAxis.valueType&&"logarithmic"===e.yAxis.valueType.toLowerCase()||t.top<l?t.top:l,s=n.svg3DRenderer.transform3DToVisible(e,t.left>h?t.left:h,r,n),l=n.svg3DRenderer.transform3DToVisible(e,d>t.right?t.right:d,a>t.bottom?a:t.bottom,n),h=n.vector.vector3D(Math.min(s.x,l.x),Math.min(s.y,l.y),t.startDepth),r=n.vector.vector3D(Math.max(s.x,l.x),Math.max(s.y,l.y),t.endDepth),d=e.setStyle(e),a="region-series-"+o+"-point-"+i,"Cylinder"===e.columnFacet?n.polygon.createCylinder(h,r,n,i,e.type,"",t.color,null,d.opacity,a,n.chart3D):"Rectangle"===e.columnFacet&&n.polygon.createBox(h,r,n,i,"",t.color,null,d.opacity,n.requireInvertedAxis,a,n.chart3D))},DFe.prototype.createSegments=function(e){var t=e.getXValues(e.visiblePoints);if(null!=t)for(var i=e.getSideBySideInfo(e),n=e.getSegmentDepth(e),o=i.delta/2,r=e.visiblePoints,s=0;s<r.length;s++){var a=t[s]+i.start,l=t[s]+i.end,h=e.stackedValues.startValues[s],d=e.stackedValues.endValues[s];if(this.setData(a,d,l,h,n.start,n.end,e,r[s]),e.dataLabel.visible)switch(r[s].symbolLocations={x:0,y:0,z:0},e.dataLabel.position){case"Top":r[s].symbolLocations.x=a+o,r[s].symbolLocations.y=d,r[s].symbolLocations.z=n.start+n.delta/2;break;case"Bottom":r[s].symbolLocations.x=a+o,r[s].symbolLocations.y=h-.2,r[s].symbolLocations.z=n.start+(n.end-n.start)/2;break;default:r[s].symbolLocations.x=a+o,r[s].symbolLocations.y=d+(h-d)/2,r[s].symbolLocations.z=n.start}}},DFe.prototype.setData=function(e,t,i,n,o,r,s,a){a.left=e,a.bottom=n,a.top=t,a.right=i,a.startDepth=o,a.endDepth=r,a.xRange=s.getDoubleRange(a.left,a.right),isNaN(a.top)||isNaN(a.bottom)||(a.yRange=s.getDoubleRange(a.top,a.bottom))},DFe.prototype.destroy=function(){},DFe.prototype.getModuleName=function(){return"StackingBarSeries3D"};var EFe=DFe;function DFe(){}kFe.prototype.draw=function(e,t){this.createSegments(e);for(var i=0;i<e.visiblePoints.length;i++){var n,o=e.visiblePoints[i];o.visible&&(n={cancel:!1,series:e,point:o,fill:e.setPointColor(o,e.interior)},t.trigger(jme,n),o.color=n.fill,o.plans=null,n.cancel?o.symbolLocations=null:this.update(n.series,n.point,i,t))}},kFe.prototype.update=function(e,t,i,n){var o=n.visibleSeries.indexOf(e),r=t.left,s=t.right,a="Logarithmic"===e.yAxis.valueType?Math.pow(e.yAxis.logBase,e.yAxis.visibleRange.min):e.yAxis.visibleRange.min,l="Logarithmic"===e.yAxis.valueType?Math.pow(e.yAxis.logBase,e.yAxis.visibleRange.max):e.yAxis.visibleRange.max,h=e.xAxis.visibleRange.min,d=e.xAxis.visibleRange.max;(h<=r&&r<=d||h<=s&&s<=d)&&(r=t.top<0?t.top>a?t.top:a:e.yAxis.valueType&&"logarithmic"===e.yAxis.valueType.toLowerCase()||t.top<l?t.top:l,s=n.svg3DRenderer.transform3DToVisible(e,t.left>h?t.left:h,r,n),l=n.svg3DRenderer.transform3DToVisible(e,d>t.right?t.right:d,a>t.bottom?a:t.bottom,n),h=n.vector.vector3D(Math.min(s.x,l.x),Math.min(s.y,l.y),t.startDepth),r=n.vector.vector3D(Math.max(s.x,l.x),Math.max(s.y,l.y),t.endDepth),d=e.setStyle(e),a="region-series-"+o+"-point-"+i,"Cylinder"===e.columnFacet?n.polygon.createCylinder(h,r,n,i,e.type,"",t.color,null,d.opacity,a,n.chart3D):n.polygon.createBox(h,r,n,i,"",t.color,null,d.opacity,n.requireInvertedAxis,a,n.chart3D))},kFe.prototype.createSegments=function(e){var t=e.getXValues(e.visiblePoints),i=e.getYValues(e.visiblePoints);if(null!=t){e.isRectSeries=!0;for(var n=e.getSideBySideInfo(e),o=e.getSegmentDepth(e),r=n.delta/2,s=e.visiblePoints,a=0;a<s.length;a++){var l=t[a]+n.start,h=t[a]+n.end,d=i[a];if(this.setData(l,d,h,0,o.start,o.end,e,s[a]),e.dataLabel.visible)switch(s[a].symbolLocations={x:0,y:0,z:0},e.dataLabel.position){case"Top":s[a].symbolLocations.x=l+r,s[a].symbolLocations.y=d,s[a].symbolLocations.z=o.start;break;case"Bottom":s[a].symbolLocations.x=l+r,s[a].symbolLocations.y=-.2+e.yAxis.visibleRange.min,s[a].symbolLocations.z=o.start+(o.end-o.start)/2;break;default:s[a].symbolLocations.x=l+r,s[a].symbolLocations.y=Math.abs(0-d)/2+e.yAxis.visibleRange.min/2,s[a].symbolLocations.z=o.start}}}},kFe.prototype.setData=function(e,t,i,n,o,r,s,a){a.left=e,a.bottom=n,a.top=t,a.right=i,a.startDepth=o,a.endDepth=r,a.xRange=s.getDoubleRange(a.left,a.right),isNaN(a.top)||isNaN(a.bottom)||(a.yRange=s.getDoubleRange(a.top,a.bottom))},kFe.prototype.destroy=function(){},kFe.prototype.getModuleName=function(){return"BarSeries3D"};var MFe=kFe;function kFe(){}BFe.prototype.render=function(e,t,i){var n,o=t.element.id+"-series-"+e.index+"-data-label-collections";e.dataLabelElement=Q("div",{id:o});for(var r=0;r<e.visiblePoints.length;r++)(n=e.visiblePoints[r]).visible&&this.draw3DDataLabel(e,n.index,n,t,i);e.dataLabel.template&&O0e(!1,document.getElementById(this.chart.element.id+"_Secondary_Element"),e.dataLabelElement,t.redraw,!1,"x","y",null,"",!1,!1,null)},BFe.prototype.draw3DDataLabel=function(e,t,i,n,o){var r={data:null},s=this.getLabelText(i,e,this.chart)[0],a=So(s,o.font,this.chart.themeStyle.datalabelFont),l=n.svg3DRenderer.transform3DToVisible(e,i.symbolLocations.x,i.symbolLocations.y,n),h=l.y,s=(l.x,h="Bottom"===e.dataLabel.position?l.y+0:+l.y,l=l.x+0,r.data={text:s,location:{x:l,y:h},series:e,pointIndex:t},r.data.Text=r.data.text,{cancel:!1,series:e,point:i,text:s,border:o.border,color:o.fill,template:o.template,textStyle:o.font}),o=(n.trigger(zme,s),this.fontBackground=("Middle"===e.dataLabel.position&&"transparent"===s.color?i:s).color,r.data.text=s.text,e.dataLabel.template||""===r.data.Text||s.cancel||(o={tag:"dataLabel",series:e,point:i,pointIndex:t,id:n.svgObject.id+e.index+"-data-label"+t,child:n.chart3D},n.graphics.addVisual(n.polygon.createTextElement(n.vector.vector3D(l,h,i.symbolLocations.z),o,0,-a.height),n)),e.dataLabel&&e.dataLabel.template?"template":"text"),d=G0e(Y0e("transparent"===this.fontBackground?-1<this.chart.theme.indexOf("Dark")||"HighContrast"===this.chart.theme?"#000000":"#FFFFFF":this.fontBackground)),d=Math.round((299*d.r+587*d.g+114*d.b)/1e3),p={size:s.textStyle.size||this.chart.themeStyle.datalabelFont.size,fontWeight:s.textStyle.fontWeight||this.chart.themeStyle.datalabelFont.fontWeight,fontStyle:s.textStyle.fontStyle||n.themeStyle.datalabelFont.fontStyle,fontFamily:s.textStyle.fontFamily||this.chart.themeStyle.datalabelFont.fontFamily,color:s.textStyle.color||("Bootstrap5"===this.chart.theme?"#212529":"Bootstrap5Dark"===this.chart.theme?"#DEE2E6":s.textStyle.color),opacity:s.textStyle.opacity},r={width:a.width,height:a.height,label:r.data,textAnchor:"middle",tag:o,font:p,angle:e.dataLabel.angle,id:n.element.id+"-svg-series-"+e.index+"-point-"+t+"-data-label",child:n.chart3D,argsData:s,fill:128<=d?-1<this.chart.theme.indexOf("Tailwind3")?"#111827":"#000000":"#FFFFFF"};s.cancel||n.graphics.addVisual(n.polygon.createTextElement(n.vector.vector3D(l,h,i.symbolLocations.z),r,0,-a.height),n)},BFe.prototype.getLabelText=function(e,t,i){var n=t.dataLabel.format||t.yAxis.labelFormat,o=[],r=null!==n.match("{value}");if(o.push(e.text||e.yValue.toString()),(n||i.useGroupingSeparator)&&!e.text){t.yAxis.format=i.intl.getNumberFormat({format:r?"":n,useGrouping:i.useGroupingSeparator});for(var s=0;s<o.length;s++)o[s]=r?n.replace("{value}",t.yAxis.format(parseFloat(o[s]))):t.yAxis.format(parseFloat(o[s]))}return o},BFe.prototype.createDataLabelTemplate=function(e,t,i,n,o,r,s,a){this.margin={left:0,right:0,bottom:0,top:0};var l=t.clipRect,o=this.createTemplate(Q("div",{id:this.chart.element.id+"-series-"+t.index+"-data-label-"+r,styles:"position: absolute;background-color:"+o.color+";"+P0e(i.font,this.chart.themeStyle.datalabelFont)+";border:"+o.border.width+"px solid "+o.border.color+";"}),o.template,this.chart,n,t,this.chart.element.id+"-data-label-",r,a);this.calculateTemplateLabelSize(e,o,n,t,i,l,s,a)},BFe.prototype.calculateTemplateLabelSize=function(e,t,i,n,o,r,s,a,l){var h=B0e(t,s,l),d={x:0,y:0,width:0,height:0},a=this.calculateTextPosition(n,i,h,a),p=!1;l&&(p=0===h.width||0===h.height),t.style.left=+a.left+"px",t.style.top=a.top+0+"px";l=G0e(Y0e("transparent"===this.fontBackground?-1<this.chart.theme.indexOf("Dark")?"black":"white":this.fontBackground)),h=n.chart.requireInvertedAxis?n.xAxis:n.yAxis,a=n.chart.requireInvertedAxis?n.yAxis:n.xAxis;t.style.color=o.font.color||"Bootstrap5"===this.chart.theme?"#212529":"Bootstrap5Dark"===this.chart.theme?"#DEE2E6":128<=Math.round((299*l.r+587*l.g+114*l.b)/1e3)?-1<this.chart.theme.indexOf("Tailwind3")?"#111827":"black":-1<this.chart.theme.indexOf("Tailwind3")?"#FFFFFF":"white",t.childElementCount&&!p&&!z0e(d,this.chart.dataLabelCollections,r)&&(void 0===i.yValue||Rye(i.yValue,n.yAxis.visibleRange)||-1<n.type.indexOf("Stacking")||-1<n.type.indexOf("100")&&Rye(n.stackedValues.endValues[i.index],n.yAxis.visibleRange))&&Rye(i.xValue,n.xAxis.visibleRange)&&parseFloat(t.style.top)>=h.rect.y&&parseFloat(t.style.left)>=a.rect.x&&parseFloat(t.style.top)<=h.rect.y+h.rect.height&&parseFloat(t.style.left)<=a.rect.x+a.rect.width&&(this.chart.dataLabelCollections.push(new Do(d.x+r.x,d.y+r.y,d.width,d.height)),O0e(!1,e,t,s,!0,"left","top"))},BFe.prototype.calculateTextPosition=function(e,t,i,n){var o,r=i.width/2,i=i.height,i=(e=-1!==e.type.indexOf("Bar")?(o=n.x-r,n.y-i+e.xAxis.plotOffset):(o=n.x-r,n.y-i),n.x+r);return{left:o,top:e,right:i}},BFe.prototype.chartReactTemplate=function(e,t,i,n,o,r,s){var a=document.getElementById(t.element.id+"-series-"+n.index+"-data-label-collections");a&&(0===i.index&&(t.dataLabelCollections=[]),t.dataLabel3DModule.calculateTemplateLabelSize(a,e,i,n,n.dataLabel,n.clipRect,r,s,!0))},BFe.prototype.createTemplate=function(e,t,i,n,o,r,s,a,l){t=E0e(t);try{var h=t?t({chart:i,series:o,point:n},i,r+"-template",r):[];if(h.length)for(var d,p=(d=Array.prototype.slice.call(h)).length,c=0;c<p;c++)e.appendChild(d[c]);var u;"chart3d"===i.getModuleName()&&(u=n&&o?this.chartReactTemplate.bind(this,e,i,n,o,s,l,a):void 0,i.isReact)&&i.renderReactTemplates(u)}catch(e){}return e},BFe.prototype.getModuleName=function(){return"DataLabel3D"},BFe.prototype.destroy=function(){};var PFe=BFe;function BFe(e){this.chart=e}FFe=function(e,t){return(FFe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}FFe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(OFe,LFe=CAe),OFe.prototype.addEventListener=function(){var e;this.chart.isDestroyed||(e=F.isPointer?"pointerleave":"mouseleave",this.chart.on(F.touchMoveEvent,this.mouseMove,this),this.chart.on(e,this.mouseLeave,this),this.chart.on("click",this.mouseClick,this),this.chart.on(F.touchStartEvent,this.mousedown,this),this.chart.on(F.touchEndEvent,this.mouseLeave,this))},OFe.prototype.mousedown=function(){var e=this.chart;e.isPointMouseDown||e.selectionMode},OFe.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off(F.touchMoveEvent,this.mouseMove),this.chart.off("pointerleave",this.mouseLeave),this.chart.off("click",this.mouseClick),this.chart.off(F.touchStartEvent,this.mousedown),this.chart.off(F.touchEndEvent,this.mouseLeave))},OFe.prototype.initPrivateVariables=function(e){this.styleId=e.element.id+"_ej2_chart_selection",this.unselected=e.element.id+"_ej2_deselected",this.selectedDataIndexes=[],this.isSeriesMode="Series"===e.selectionMode},OFe.prototype.invokeSelection=function(e){this.initPrivateVariables(e),this.series=Pe({},e.visibleSeries,null,!0),this.seriesStyles(),this.currentMode=e.selectionMode,this.selectDataIndex(e,this.concatIndexes(e.selectedDataIndexes,this.selectedDataIndexes))},OFe.prototype.generateStyle=function(e){return e?this.styleId+"_series_"+e.index:"undefined"},OFe.prototype.selectDataIndex=function(e,t){for(var i=0,n=t;i<n.length;i++){var o=n[i];this.performSelection(o,e,this.getElementByIndex(e,o)[0])}},OFe.prototype.getElementByIndex=function(e,t){var i=[];return document.querySelectorAll('[id*="-region-series-'+t.series+"-point-"+t.point+'"]').forEach(function(e){i.push(e)}),i},OFe.prototype.getClusterElements=function(e,t){for(var i=[],n=0,o=e.visibleSeries;n<o.length;n++){var r=o[n];if(r.visible){t=new kme(r.index,t.point);for(var s=this.getElementByIndex(e,t),a=0;a<s.length;a++)i.push(s[a])}}return i},OFe.prototype.findElements=function(e,t,i){return this.isSeriesMode?this.getSeriesElements(t):"Cluster"===this.currentMode?this.getClusterElements(e,i):this.getElementByIndex(e,i)},OFe.prototype.isAlreadySelected=function(e,i,n){if("click"===i?(this.currentMode=this.chart.selectionMode,this.styleId=this.chart.element.id+"_ej2_chart_selection"):"mousemove"!==i&&"pointermove"!==i||(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"===i)return!1;if(("None"!==this.chart.highlightMode||this.chart.legendSettings.enableHighlight)&&this.previousSelectedEle&&this.previousSelectedEle[0])for(var o=void 0,t=e.nodeName,r=(e.parentNode&&(o=("path"===t||"shape"===t)&&1<e.id.indexOf("region")),this),s=0;s<this.previousSelectedEle.length;s++)!function(e){var t;r.previousSelectedEle[e].hasAttribute("class")&&(-1<r.previousSelectedEle[e].getAttribute("class").indexOf("highlight")&&(o||"click"===i)?(r.previousSelectedEle[e].classList.forEach(function(e){-1<e.indexOf("selection")&&(t=e)}),r.previousSelectedEle[e].removeAttribute("class"),t&&r.addSvgClass(r.previousSelectedEle[e],t),r.previousSelectedEle[e].classList.remove(r.styleId+"_series_"+n.series),""===r.chart.highlightColor||je(r.chart.highlightColor)||"None"!==r.chart.highlightPattern||r.previousSelectedEle[e].setAttribute("fill",r.control.visibleSeries[r.indexFinder(r.previousSelectedEle[e].id).series].interior),r.addOrRemoveIndex(r.highlightDataIndexes,r.indexFinder(r.previousSelectedEle[e].id))):!o&&-1<r.previousSelectedEle[e].getAttribute("class").indexOf("highlight")&&r.performSelection(r.indexFinder(r.previousSelectedEle[e].id),r.chart,r.previousSelectedEle[e]))}(s);return!0},OFe.prototype.mouseClick=function(e){this.chart.rotateActivate||this.calculateSelectedElements(e.target,e.type)},OFe.prototype.calculateSelectedElements=function(e,t){je(e)||"None"===this.chart.selectionMode&&"None"===this.chart.highlightMode||e.id&&-1===e.id.indexOf(this.chart.element.id+"-")||("mousemove"===t||"pointermove"===t)&&e.hasAttribute("class")&&(-1<e.getAttribute("class").indexOf("highlight")||-1<e.getAttribute("class").indexOf("selection"))||(this.isAlreadySelected(e,t,this.indexFinder(e.id)),e.id&&-1<e.id.indexOf("-series-")&&-1===e.id.indexOf("_Text_")&&this.performSelection(this.indexFinder(e.id),this.chart,e))},OFe.prototype.performSelection=function(e,t,i){switch(this.isSeriesMode="Series"===this.currentMode,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,this.getElementByIndex(t,e)),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))}},OFe.prototype.selectionComplete=function(e,t,i){var n,o,r=[];if("Cluster"===i){for(var s=0,a=e.visibleSeries;s<a.length;s++)if((d=a[s]).visible)for(var l=0;l<this.selectedDataIndexes.length;l++)p=(e.isMultiSelect?this.selectedDataIndexes[l]:t).point,c=d.index,u=d.points,isNaN(p)||(n=u[p].yValue,o=u[p].xValue,"Category"===e.primaryXAxis.valueType?o=u[p].x.toLocaleString():"DateTime"===e.primaryXAxis.valueType&&(o=new Date(u[p].xValue)),r.push({x:o,y:n,seriesIndex:c,pointIndex:p}))}else if("Series"===i)if(e.isMultiSelect)for(l=0;l<this.selectedDataIndexes.length;l++)c=this.selectedDataIndexes[l].series,0<this.selectedDataIndexes.length&&r.push({seriesIndex:c});else c=0<this.selectedDataIndexes.length?this.selectedDataIndexes[0].series:this.highlightDataIndexes&&0<this.highlightDataIndexes.length?this.highlightDataIndexes[0].series:0,(0<this.selectedDataIndexes.length||this.highlightDataIndexes&&0<this.highlightDataIndexes.length)&&r.push({seriesIndex:c});else if("Point"===i)for(var h=[],h=-1<this.styleId.indexOf("highlight")?this.highlightDataIndexes:this.selectedDataIndexes,l=0;l<h.length;l++){var d,p=h[l].point,c=h[l].series,u=(d=e.series[c]).points;isNaN(p)||(o=u[p].xValue,n=u[p].yValue,"Category"===e.primaryXAxis.valueType?o=u[p].x.toLocaleString():"DateTime"===e.primaryXAxis.valueType&&(o=new Date(u[p].xValue)),r.push({x:o,y:n,seriesIndex:c,pointIndex:p}))}e.trigger(afe,{selectedDataValues:r,cancel:!1,chart:e})},OFe.prototype.selection=function(e,t,i){e.isMultiSelect||-1!==this.styleId.indexOf("highlight")||"None"===e.selectionMode||this.removeMultiSelectElements(e,this.selectedDataIndexes,t,e.series);var n,o=t.series;je(i[0])||(e.visibleSeries[o].isRectSeries&&i[0].id&&document.getElementById(i[0].id+"_Symbol")&&i.push(ie(i[0].id+"_Symbol")),o=void 0,n=i[0]&&(i[0].getAttribute("class")||""),i[0]&&-1<n.indexOf(this.getSelectionClass(i[0].id))?this.removeStyles(i):(this.previousSelectedEle="None"!==e.highlightMode||e.legendSettings.enableHighlight?i:[],this.chart.selection3DModule&&(this.chart.selection3DModule.previousSelectedEle=i),this.applyStyles(i),o=!0),0<this.styleId.indexOf("highlight")&&("None"!==e.highlightMode||e.legendSettings.enableHighlight)?this.addOrRemoveIndex(this.highlightDataIndexes,t,o):this.addOrRemoveIndex(this.selectedDataIndexes,t,o))},OFe.prototype.clusterSelection=function(e,t){this.selection(e,t,this.getClusterElements(e,new kme(t.series,t.point)))},OFe.prototype.removeMultiSelectElements=function(e,t,i,n){for(var o,r=0;r<t.length;r++)o=n[t[r].series],(this.isSeriesMode&&!this.toEquals(t[r],i,this.isSeriesMode)||"Cluster"===this.currentMode&&!this.toEquals(t[r],i,!1)||!this.isSeriesMode&&this.toEquals(t[r],i,!0)&&!this.toEquals(t[r],i,!1))&&(this.removeStyles(this.findElements(e,o,t[r])),t.splice(r,1),r--)},OFe.prototype.blurEffect=function(o,e){for(var r=this.checkVisibility(this.highlightDataIndexes,this.chart)||this.checkVisibility(this.selectedDataIndexes,this.chart),s=this,t=0,i=e;t<i.length;t++)!function(e){var t=e.index,i=s.chart.visibleSeries[e.index].interior,n=[];e.visible&&(document.querySelectorAll('[id*="region-series-'+e.index+'"]').forEach(function(e){n.push(e)}),s.checkSelectionElements(n,s.generateStyle(e),r,t,i),je(ie(o+"SymbolGroup"+e.index))||s.checkSelectionElements(n,s.generateStyle(e),r,t,i))}(i[t])},OFe.prototype.checkSelectionElements=function(e,t,i,n,o){void 0===n&&(n=0),void 0===o&&(o="#D3D3D3");for(var r,s,a=this.isSeriesMode?e||[e]:e,l=("None"===this.chart.selectionMode||"None"===this.chart.highlightMode&&!this.chart.legendSettings.enableHighlight||(a=e),e),h=0;h<a.length;h++)r=a[h].getAttribute("class")||"",s=a[h].parentNode.getAttribute("class")||"","None"===this.chart.selectionMode||"None"===this.chart.highlightMode&&!this.chart.legendSettings.enableHighlight||(t=0<r.indexOf("selection")||0<r.indexOf("highlight")?r:t),-1===r.indexOf(t)&&-1===s.indexOf(t)&&i?this.addSvgClass(a[h],this.unselected):(l=a[h],-1!==r.indexOf(this.unselected)&&this.chart.tooltip3DModule&&0<t.indexOf("highlight")&&this.chart.highlightAnimation(a[h],n,700,.3),this.removeSvgClass(a[h],this.unselected),this.removeSvgClass(a[h].parentNode,this.unselected));this.control.legend3DModule&&this.control.legendSettings.visible&&(e=ie(this.control.element.id+"_chart_legend_shape_"+n))&&(e.hasAttribute("class")&&(this.removeSvgClass(e,e.getAttribute("class")),je(this.chart.highlightColor&&""!==this.chart.highlightColor)||this.chart.legendSettings.enableHighlight||(e.setAttribute("stroke",o),"None"===this.chart.highlightPattern&&e.setAttribute("fill",o))),0<l.length?(r=l[0].getAttribute("class"),s=l[0].parentNode.getAttribute("class")||""):l&&(r=l.getAttribute("class")||"",s=l.parentNode.getAttribute("class")||""),-1===r.indexOf(t)&&-1===s.indexOf(t)&&i?(this.addSvgClass(e,"None"===this.chart.highlightMode&&this.chart.legendSettings.enableHighlight?t:this.unselected),this.removeSvgClass(e,t),""===this.chart.highlightColor||je(this.chart.highlightColor)||(e.setAttribute("stroke",this.control.visibleSeries[n].interior),"None"===this.chart.highlightPattern&&e.setAttribute("fill",this.control.visibleSeries[n].interior))):(this.removeSvgClass(e,this.unselected),je(this.chart.highlightColor)||""===this.chart.highlightColor||(e.setAttribute("stroke",this.control.visibleSeries[n].interior),"None"===this.chart.highlightPattern&&e.setAttribute("fill",this.control.visibleSeries[n].interior)),""===r&&""===s||"EJ2-Trackball"===r.trim()?this.removeSvgClass(e,t):(this.addSvgClass(e,t),0<t.indexOf("highlight")&&""!==this.chart.highlightColor&&"transparent"!==this.chart.highlightColor&&!je(this.chart.highlightColor)&&(e.setAttribute("stroke",this.chart.highlightColor),0<this.styleId.indexOf("highlight"))&&"None"===this.chart.highlightPattern&&e.setAttribute("fill",this.chart.highlightColor))))},OFe.prototype.applyStyles=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];if(n){if(this.removeSvgClass(n.parentNode,this.unselected),this.removeSvgClass(n,this.unselected),"fill"===this.chart.series[0].pointColorMapping){var o=this.getSelectionClass(n.id),r=-1<o.indexOf("highlight")?parseInt(o.split(this.chart.element.id+"_ej2_chart_highlight_series_")[1],10):parseInt(o.split(this.chart.element.id+"_ej2_chart_selection_series_")[1],10),s=0<this.styleId.indexOf("highlight")?this.chart.highlightPattern:this.chart.selectionPattern,a=void 0;if((-1<o.indexOf("highlight")||-1<o.indexOf("selection"))&&(a=document.getElementById(this.chart.element.id+"_"+s+"_Selection_"+r)),-1===n.id.indexOf("legend")&&-1===n.id.indexOf("Group")&&null!=a)for(var l=1;l<a.children.length;l++)a.children[l].setAttribute("fill",n.getAttribute("fill")),a.children[l].setAttribute("stroke",n.getAttribute("fill"))}this.addSvgClass(n,this.getSelectionClass(n.id)),this.chart.tooltip3DModule&&0<this.getSelectionClass(n.id).indexOf("highlight")&&(r=parseFloat(n.id.split("-series-")[1].split("-point-")[0]),this.chart.stopElementAnimation(n,r)),0<this.styleId.indexOf("highlight")&&""!==this.chart.highlightColor&&!je(this.chart.highlightColor)&&"None"===this.chart.highlightPattern&&"transparent"!==this.chart.highlightColor&&n.setAttribute("fill",this.chart.highlightColor)}}},OFe.prototype.getSelectionClass=function(e){return this.generateStyle(this.control.visibleSeries[this.indexFinder(e).series])},OFe.prototype.removeStyles=function(e){for(var t=0,i=e;t<i.length;t++){var n,o=i[t];o&&(this.removeSvgClass(o,this.getSelectionClass(o.id)),"None"!==this.chart.highlightPattern||""===this.chart.highlightColor||je(this.chart.highlightColor)||"transparent"===this.chart.highlightColor||(n=this.control.visibleSeries[this.indexFinder(o.id).series].interior,"ZLight"===o.getAttribute("name")&&(n=this.chart.polygon.applyZLight(n,this.control)),"XLight"===o.getAttribute("name")&&(n=this.chart.polygon.applyXLight(n,this.control)),o.setAttribute("fill",n)))}},OFe.prototype.addOrRemoveIndex=function(e,t,i){for(var n=0;n<e.length;n++)this.toEquals(e[n],t,this.isSeriesMode)&&(e.splice(n,1),n--);i&&e.push(t)},OFe.prototype.toEquals=function(e,t,i){return(e.series===t.series||"Cluster"===this.currentMode&&!i)&&(i||e.point===t.point)},OFe.prototype.redrawSelection=function(e,t,i){this.isSeriesMode="Series"===t,je(t)||(e.isRedrawSelection=!i);t=Pe([],this.selectedDataIndexes,null,!0),i=Pe([],this.highlightDataIndexes,null,!0);0<this.styleId.indexOf("highlight")&&0<i.length?(this.removeSelectedElements(e,this.highlightDataIndexes,e.series),t=i):this.removeSelectedElements(e,this.selectedDataIndexes,e.series),this.blurEffect(e.element.id,e.visibleSeries),this.selectDataIndex(e,t)},OFe.prototype.legendSelection=function(e,t,i,n){if("mousemove"===n){if((i=1<(i=1<(i=1<i.id.indexOf("text")?ie(i.id.replace("text","shape")):i).id.indexOf("marker")?ie(i.id.replace("_marker","")):i).id.indexOf("g")?ie(i.id.replace("_g_","_shape_")):i).hasAttribute("class")&&(-1<i.getAttribute("class").indexOf("highlight")||-1<i.getAttribute("class").indexOf("selection")))return;this.currentMode=this.chart.highlightMode}else"click"===n&&1<(i=1<i.id.indexOf("text")?ie(i.id.replace("text","shape")):i).id.indexOf("g")&&(i=ie(i.id.replace("_g_","_shape_")));var o=this.indexFinder(i.id);if(this.isAlreadySelected(i,n,o)){var r=this.generateStyle(e.visibleSeries[t]),s=document.querySelectorAll("."+r);this.isSeriesMode="Series"===this.currentMode;if(0<s.length)this.removeSelection(e,t,s,r,!0);else{for(var a=0,l=e.visibleSeries;a<l.length;a++){var h=l[a];h.index===t||e.isMultiSelect||(r=this.generateStyle(e.visibleSeries[h.index]),s=document.querySelectorAll("."+r),this.removeSelection(e,t,s,r,!0))}i=[];0<(i="Point"===this.chart.legendSettings.mode?this.getElementByIndex(e,o):this.getSeriesElements(e.visibleSeries[t])).length&&(this.checkSelectionElements(i,r,!1,t,""),this.isSeriesMode=!0,this.selection(e,new kme(o.series,NaN),i),this.isSeriesMode="Series"===e.selectionMode,this.blurEffect(e.element.id,e.visibleSeries))}}},OFe.prototype.removeSelection=function(e,t,i,n,o){if(0<i.length){for(var r=[],s=0;s<i.length;s++)r.push(i[s]);this.removeStyles(r),this.isSeriesMode=!0,this.addOrRemoveIndex(this.selectedDataIndexes,new kme(t,NaN));for(var a=0,l=e.visibleSeries;a<l.length;a++){var h=l[a];if(n=this.generateStyle(h),0<document.querySelectorAll("."+n).length){for(var d=0,p=r;d<p.length;d++)this.checkSelectionElements(p[d],n,!0,t,"");o=!1;break}}o&&(this.isSeriesMode="Series"===e.selectionMode,this.blurEffect(e.element.id,e.visibleSeries))}},OFe.prototype.getSeriesElements=function(e){var t=[];return e.visible&&document.querySelectorAll('[id*="region-series-'+e.index+'"]').forEach(function(e){t.push(e)}),t},OFe.prototype.indexFinder=function(e){var t=["NaN","NaN"];return-1<e.indexOf("-point-")?t=e.split("-series-")[1].split("-point-"):-1<e.indexOf("-border-")?t[0]=e.split("-border-")[1]:-1<e.indexOf("-series-")?t[0]=e.split("-series-")[1]:-1<e.indexOf("_chart_legend_shape_")&&((t=e.split("_chart_legend_shape_"))[0]=t[1]),new kme(parseInt(t[0],10),parseInt(t[1],10))},OFe.prototype.removeSelectedElements=function(e,t,i){t=e.isRedrawSelection?t:t.splice(0,t.length);for(var n=0,o=i;n<o.length;n++){var r=o[n];if(r.visible){r=this.getSeriesElements(r),this.removeStyles(r);for(var s=0,a=r;s<a.length;s++){var l=a[s];this.removeStyles(this.getChildren(l))}}}},OFe.prototype.mouseLeave=function(){this.completeSelection()},OFe.prototype.completeSelection=function(){var e=this.chart;"None"!==e.selectionMode&&(this.currentMode=e.selectionMode)},OFe.prototype.mouseMove=function(e){var t=this.chart,i=e.target,n=e.type;this.highlightChart(i,n),"None"!==t.selectionMode&&"touchmove"===n&&(F.isIos||F.isIos7)&&e.preventDefault&&e.preventDefault()},OFe.prototype.highlightChart=function(e,t){if(!this.chart.rotateActivate&&("None"!==this.chart.highlightMode||this.chart.legendSettings.enableHighlight)&&!je(e)){if((e=1<e.id.indexOf("_legend_text")?ie(e.id.replace("text","shape")):e).hasAttribute("class")&&(-1<e.getAttribute("class").indexOf("highlight")||-1<e.getAttribute("class").indexOf("selection")))return;this.calculateSelectedElements(e,t),this.chart.highlight3DModule.highlightDataIndexes&&0<this.chart.highlight3DModule.highlightDataIndexes.length&&-1===e.id.indexOf("_chart_legend_")&&-1===e.id.indexOf("-series-")&&this.removeLegendHighlightStyles()}},OFe.prototype.removeLegendHighlightStyles=function(){var e;this.chart.highlight3DModule.highlightDataIndexes=[];for(var t,i,n=0;n<this.chart.visibleSeries.length;n++)if(e=document.getElementsByClassName(this.generateStyle(this.chart.visibleSeries[n])),0===this.selectedDataIndexes.length){for(e=document.getElementsByClassName(this.generateStyle(this.chart.visibleSeries[n]));0<e.length;)(i=e[0])&&(this.removeSvgClass(i,i.getAttribute("class")),"None"!==this.chart.highlightPattern||""===this.chart.highlightColor||je(this.chart.highlightColor)||"transparent"===this.chart.highlightColor||(t=this.control.visibleSeries[n].interior,"ZLight"===i.getAttribute("name")&&(t=this.chart.polygon.applyZLight(t,this.control)),"XLight"===i.getAttribute("name")&&(t=this.chart.polygon.applyXLight(t,this.control)),-1!==i.id.indexOf("_chart_legend_shape")&&i.getAttribute("stroke")&&i.setAttribute("stroke",t),i.setAttribute("fill",t)));for(e=document.getElementsByClassName(this.unselected);0<e.length;)(i=e[0])&&(this.removeSvgClass(i,i.getAttribute("class")),this.chart.tooltip3DModule)&&-1<this.generateStyle(this.chart.visibleSeries[n]).indexOf("highlight")&&this.chart.highlightAnimation(i,n,700,.3)}else for(e=document.getElementsByClassName(this.generateStyle(this.chart.visibleSeries[n]));0<e.length;)(i=e[0])&&(this.removeSvgClass(i,i.getAttribute("class")),this.addSvgClass(i,this.unselected))},OFe.prototype.getModuleName=function(){return"Selection3D"},OFe.prototype.destroy=function(){this.removeEventListener()};var FFe,LFe,RFe=OFe;function OFe(e){var t=LFe.call(this,e)||this;return t.seriesIndex=0,t.chart=e,t.addEventListener(),t}NFe=function(e,t){return(NFe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}NFe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(HFe,VFe=RFe),HFe.prototype.wireEvents=function(){this.chart.isDestroyed||this.chart.on(F.touchMoveEvent,this.mouseMove,this)},HFe.prototype.unWireEvents=function(){this.chart.isDestroyed||this.chart.off(F.touchMoveEvent,this.mouseMove)},HFe.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},HFe.prototype.invokeHighlight=function(e){this.declarePrivateVariables(e),this.series=Pe({},e.visibleSeries,null,!0),this.seriesStyles(),this.currentMode=e.highlightMode},HFe.prototype.getModuleName=function(){return"Highlight3D"},HFe.prototype.destroy=function(){this.unWireEvents()};var NFe,VFe,_Fe=HFe;function HFe(e){var t=VFe.call(this,e)||this;return t.chart=e,t.wireEvents(),t}jFe.prototype.export=function(e,t){var i=new E1e(this.chart),n={cancel:!1,width:null,height:null};this.chart.trigger(bfe,n),n.cancel||i.export(e,t,void 0,[this.chart])},jFe.prototype.pdfExport=function(e,t,i,n,o,r,s,a,l){var h=new E1e(this.chart),d=(i=i||[this.chart],{cancel:!1,width:n,height:o});this.chart.trigger(bfe,d),d.cancel||h.export("PDF",e,t,i,n=d.width,o=d.height,r,s,a,l)},jFe.prototype.getDataUrl=function(e){return new E1e(e).getDataUrl(e)},jFe.prototype.getModuleName=function(){return"Export3D"},jFe.prototype.destroy=function(){};var zFe=jFe;function jFe(e){this.chart=e}WFe=function(e,t){return(WFe=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])}))(e,t)};var WFe,QFe,UFe=function(e,t){function i(){this.constructor=e}WFe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},qFe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},GFe=(UFe(YFe,QFe=n),qFe([e("Normal")],YFe.prototype,"fontStyle",void 0),qFe([e("16px")],YFe.prototype,"size",void 0),qFe([e("Normal")],YFe.prototype,"fontWeight",void 0),qFe([e("")],YFe.prototype,"color",void 0),qFe([e("Segoe UI")],YFe.prototype,"fontFamily",void 0),qFe([e(1)],YFe.prototype,"opacity",void 0),YFe);function YFe(){return null!==QFe&&QFe.apply(this,arguments)||this}UFe(JFe,XFe=n),qFe([e(null)],JFe.prototype,"color",void 0),qFe([e(1)],JFe.prototype,"width",void 0),qFe([e(null)],JFe.prototype,"length",void 0),qFe([e("")],JFe.prototype,"dashArray",void 0);var XFe,KFe=JFe;function JFe(){return null!==XFe&&XFe.apply(this,arguments)||this}UFe($Fe,ZFe=n),qFe([e(!1)],$Fe.prototype,"visible",void 0),qFe([e(null)],$Fe.prototype,"name",void 0),qFe([e("transparent")],$Fe.prototype,"fill",void 0),qFe([e("Inside")],$Fe.prototype,"position",void 0),qFe([e(0)],$Fe.prototype,"angle",void 0),qFe([e(!1)],$Fe.prototype,"enableRotation",void 0),qFe([t({width:null,color:null},Rge)],$Fe.prototype,"border",void 0),qFe([t({fontFamily:null,size:"12px",fontStyle:"Normal",fontWeight:"400",color:null},GFe)],$Fe.prototype,"font",void 0),qFe([t({},KFe)],$Fe.prototype,"connectorStyle",void 0),qFe([e(null)],$Fe.prototype,"template",void 0),qFe([e("")],$Fe.prototype,"format",void 0);var ZFe,qFe=$Fe;function $Fe(){return null!==ZFe&&ZFe.apply(this,arguments)||this}UFe(tLe,eLe=n),tLe.prototype.renderDataLabel=function(e,t){var i=t.element.id+"-series-"+e.index+"-data-label-collections";e.labelBound=je(e.labelBound)?new Do(1/0,1/0,-1/0,-1/0):e.labelBound,e.dataLabelElement=Q("div",{id:i});for(var n=0;n<e.points.length;n++){var o=e.points[n],r=this.getDatalabelText(e.dataLabel.format,t,o.text||(je(o.y)?"":o.y.toString())),s={width:e.dataLabel.border.width,color:e.dataLabel.border.color,dashArray:e.dataLabel.border.dashArray},a=Pe({},R("properties",e.dataLabel.font),null,!0),r={cancel:!1,name:zme,series:e,point:o,text:r,border:s,color:e.dataLabel.fill,template:e.dataLabel.template,font:a};t.trigger(zme,r),o.argsData=r,!o.visible||r.cancel||je(o.y)||this.draw3DDataLabel(e,o.index,o,t)}e.dataLabel.template&&O0e(!1,document.getElementById(t.element.id+"_Secondary_Element"),e.dataLabelElement,t.redraw,!1,"x","y",null,"",!1,!1,null)},tLe.prototype.createDataLabelTemplate=function(e,t,i,n,o,r,s,a,l){r=this.createTemplate(Q("div",{id:l.element.id+"-series-"+t.index+"-data-label-"+r,styles:"position: absolute;background-color:"+o.color+";"+P0e(i.font,l.themeStyle.datalabelFont)+";border:"+o.border.width+"px solid "+o.border.color+";"}),o.template,l,n,t,l.element.id+"-data-label-");this.calculateTemplateLabelSize(e,r,n,t,i,s,a)},tLe.prototype.calculateTemplateLabelSize=function(e,t,i,n,o,r,s,a){a=B0e(t,r,a);t.style.left=s.x-a.width/2+"px",t.style.top=s.y-a.height+"px",O0e(!1,e,t,r,!0,"left","top")},tLe.prototype.createTemplate=function(e,t,i,n,o,r){t=E0e(t);try{var s=t?t({chart:i,series:o,point:n},i,r+"-template",r):[];if(s.length)for(var a,l=(a=Array.prototype.slice.call(s)).length,h=0;h<l;h++)e.appendChild(a[h]);i.isReact&&i.renderReactTemplates(void 0)}catch(e){}return e},tLe.prototype.draw3DDataLabel=function(e,t,i,n){var o,r=e.dataLabel.connectorStyle.length&&parseFloat(e.dataLabel.connectorStyle.length),s={data:null},a={x:0,y:0},l=e.index,h=i.symbolLocation.center,d=i.symbolLocation.radius*e.coefficient,p=(je(r)&&(r=So(i.argsData.text,e.dataLabel.font,n.themeStyle.datalabelFont).height),null!=e&&"Inside"!==e.dataLabel.position?p=i.symbolLocation.radius+r:null!=e&&(p=d+(i.symbolLocation.radius-d)/2),d=a.x=h.x+parseFloat(i.argsData.font.size)/3+p*Math.cos(i.symbolLocation.angle),h=a.y=h.y+parseFloat(i.argsData.font.size)/3+p*Math.sin(i.symbolLocation.angle),s.data={text:i.argsData.text,location:{x:d,y:h},series:e,pointIndex:t,seriesIndex:l},s.data.Text=s.data.text,So(i.argsData.text,e.dataLabel.font,n.themeStyle.datalabelFont)),d=a.x=s.data.location.x,h=a.y=s.data.location.y,c=e.dataLabel.template?"template":"text",u=this.getSaturatedColor(i,i.argsData.color,n),u={width:p.width,height:p.height,fill:u,label:s.data,textAnchor:"middle",tag:c,font:i.argsData.font,angle:0,id:n.element.id+"-svg-data-label-text-"+t,child:n.groupElement};if(n.circularChartLegend3DModule&&n.legendSettings.visible&&i.visible&&"Outside"===e.dataLabel.position){var c=n.circularChartLegend3DModule.legendBounds,g=n.legendSettings.border.width/2,c=new Do(c.x-g,c.y-g,c.width+2*g,c.height+2*g),g=new Do(u.label.location.x+p.width/2+20,u.label.location.y+2.5,u.width,u.height);if(j0e(g,c)&&("Right"===n.circularChartLegend3DModule.position?u.width=c.x-g.x:"Left"===n.circularChartLegend3DModule.position&&(u.width=g.x-(c.x+c.width),u.width<0)&&(u.width+=g.width,u.label.location.x=c.x+c.width-p.width/2+20),g&&u.width<g.width&&(u.label.text=eve(u.width,u.label.text,e.dataLabel.font,n.enableRtl,n.themeStyle.datalabelFont)),3===u.label.text.length)&&-1<u.label.text.indexOf("..."))return}"Inside"!==e.dataLabel.position&&(m=this.updateConnectorLine(i,t,e,r,n)),e.dataLabel.template&&"Inside"!==e.dataLabel.position&&(p=So(this.createTemplate(Q("div",{id:n.element.id+"-series-data-label-0",styles:"position: absolute;background-color:"+i.argsData.color+";"+P0e(i.argsData.font,n.themeStyle.datalabelFont)+";border:"+i.argsData.border.width+"px solid "+i.argsData.border.color+";"}),i.argsData.template,n,i,e,n.element.id+"-data-label-").textContent,e.dataLabel.font,n.themeStyle.datalabelFont)),n.circularChartLegend3DModule&&n.legendSettings.visible&&"Outside"===e.dataLabel.position&&n.visibleSeries[0].findMaxBounds(n.visibleSeries[0].labelBound,{x:d,y:h,width:p.width,height:p.height});var m,c=0,g=0,r=i.symbolLocation.angle,l=("Inside"!==e.dataLabel.position&&((1.5<r&&r<1.8||1.3<r&&r<1.5||4.5<r&&r<4.8||4.3<r&&r<4.5)&&(a.x=m.x,a.y=m.y,r=m.angle),g=(c=r<Math.PI/2||r>=Math.PI/2+Math.PI?p.width/2+20:-(p.width/2+("transparent"!==i.argsData.color||i.argsData.border.color?25:20)),2.5)),i.argsData.template||""===s.data.text||(m={tag:"dataLabel",series:e,point:i,pointIndex:t,id:n.element.id+"-svg-"+l+"-data-label-"+t,child:n.groupElement},r=void 0,s="",e.dataLabel.enableRotation&&(0===(r=o=e.dataLabel.angle)?(l=i.symbolLocation.angle*(180/Math.PI),"Outside"===e.dataLabel.position?o=0:90<=l&&l<=260?(o=180+l,a.x=a.x-parseFloat(i.argsData.font.size)/2):o=l):o=360<r?r-360:r<-360?r+360:r,s="rotate("+o+","+a.x+","+a.y+")"),m.transform=s,t=n.polygon.createTextElement(n.vector.vector3D(d+c,h+g,i.symbolLocation.z||0),m,0,-p.height),n.circular3DPolygon.push(t)),u.angle=e.dataLabel.enableRotation?0!==e.dataLabel.angle?e.dataLabel.angle:o:0,n.polygon.createTextElement(n.vector.vector3D(a.x+c,a.y+g,-1),u,0,-p.height));n.circular3DPolygon.push(l)},tLe.prototype.getSaturatedColor=function(e,t,i){e="transparent"===t?this.getLabelBackground(e,i):t,t=G0e(Y0e("transparent"===e?-1<i.theme.indexOf("Dark")||-1<i.theme.indexOf("HighContrast")?"black":"white":e)),e=Math.round((299*t.r+587*t.g+114*t.b)/1e3);return"Bootstrap5"===i.theme?"#212529":"Bootstrap5Dark"===i.theme?"#DEE2E6":128<=e?-1<i.theme.indexOf("Tailwind3")?"#4B5563":"black":-1<i.theme.indexOf("Tailwind3")?"#D1D5DB":"white"},tLe.prototype.getLabelBackground=function(e,t){return"Outside"===e.argsData.series.dataLabel.position?t.background||t.themeStyle.background:e.y?e.color:t.theme.indexOf("dark")?"white":"black"},tLe.prototype.getDatalabelText=function(e,t,i){var n;return Number(i)&&(n=null!==e.match("{value}"),t=t.intl.getNumberFormat({format:n?"":e,useGrouping:t.useGroupingSeparator}),i=n?e.replace("{value}",t(parseFloat(i))):t(parseFloat(i))),i},tLe.prototype.updateConnectorLine=function(e,t,i,n,o){var r=[],e=e.symbolLocation,s=e.center.x+Math.cos(e.angle)*e.radius,a=e.center.y+Math.sin(e.angle)*e.radius,n=(r.push({x:s,y:a}),e.radius+n),l=e.angle,s=e.center.x+Math.cos(l)*n,a=e.center.y+Math.sin(l)*n;return r.push({x:s,y:a}),e=l<Math.PI/2||l>=Math.PI/2+Math.PI?10:-10,r.push({x:s+e,y:a}),this.drawLineSegment(r,t,i,o),{x:s,y:a,angle:l}},tLe.prototype.drawLineSegment=function(e,t,i,n){for(var o=[],r=0;r<e.length;r++)o.push(n.vector.vector3D(e[r].x,e[r].y,0));var s=i.index,a=i.points[t].color,a=i.dataLabel.connectorStyle.color||a,a={width:i.dataLabel.connectorStyle.width,stroke:a,child:n.groupElement,tag:"polyline",dashArray:i.dataLabel.connectorStyle.dashArray,id:n.element.id+"-datalabel-series-"+s+"-connector-"+t},i=n.polygon.createPolyline(o,a);n.circular3DPolygon.push(i)},tLe.prototype.getModuleName=function(){return"CircularChartDataLabel3D"},tLe.prototype.destroy=function(){};var eLe,UFe=tLe;function tLe(){return null!==eLe&&eLe.apply(this,arguments)||this}iLe=function(e,t){return(iLe=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])}))(e,t)};var iLe,nLe,oLe=function(e,t){function i(){this.constructor=e}iLe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},rLe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},sLe=function(){this.visible=!0,this.isExplode=!1,this.argsData=null},aLe=(oLe(lLe,nLe=n),rLe([e(null)],lLe.prototype,"fill",void 0),rLe([e("Gap")],lLe.prototype,"mode",void 0),lLe);function lLe(){return null!==nLe&&nLe.apply(this,arguments)||this}oLe(dLe,hLe=n),dLe.prototype.refreshDataManager=function(t,e){var i=this,n=this.dataSource||t.dataSource;n instanceof me||!je(this.query)?this.dataModule.getData(this.dataModule.generateQuery().requiresCount()).then(function(e){return i.dataManagerSuccess(e,t)}):this.dataManagerSuccess({result:n,count:n.length},t,e)},dLe.prototype.dataManagerSuccess=function(e,t,i){void 0===i&&(i=!0);var n={name:Qme,series:this,data:e.result};t.allowServerDataBinding=!1,t.trigger(Qme,n),this.resultData=""!==e.result?e.result:[],i||this.getPoints(this.resultData,t),++t.seriesCounts===t.visibleSeries.length&&i&&(this.getPoints(this.resultData,t),t.refreshChart())},dLe.prototype.getPoints=function(e,t){var i,n=Object.keys(e).length;if((this.sumOfPoints=0)===n)return this.points=[],null;this.findSumOfPoints(e),this.points=[];for(var o=this.palettes.length?this.palettes:function(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":t=["#79ECE4","#E98272","#DFE6B6","#C6E773","#BA98FF","#FA83C3","#00C27A","#43ACEF","#D681EF","#D8BC6E"];break;case"MaterialDark":t=["#9ECB08","#56AEFF","#C57AFF","#61EAA9","#EBBB3E","#F45C5C","#8A77FF","#63C7FF","#FF84B0","#F7C928"];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"Tailwind3":t=["#2F4074","#03B4B4","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];break;case"Tailwind3Dark":t=["#8029F1","#1ABC9C","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];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;case"Bootstrap5Dark":case"Bootstrap5":t=["#FD7E14","#6610F2","#6F42C1","#D63384","#DC3545","#FFC107","#198754","#0DCAF0"];break;case"FluentDark":case"Fluent":t=["#1AC9E6","#DA4CB2","#EDBB40","#AF4BCF","#FF7266","#1BD565","#EE993D","#5887FF","#EC548D","#7D39C0"];break;case"Fluent2":t=["#6200EE","#09AF74","#0076E5","#CB3587","#E7910F","#0364DE","#66CD15","#F3A93C","#107C10","#C19C00"];break;case"Fluent2Dark":case"Fluent2HighContrast":t=["#9BB449","#2A72D5","#43B786","#3F579A","#584EC6","#E85F9C","#6E7A89","#EA6266","#0B6A0B","#C19C00"];break;case"Material3":t=["#6355C7","#00AEE0","#FFB400","#F7523F","#963C70","#FD7400","#4BE0BC","#2196F5","#DE3D8A","#162F88"];break;case"Material3Dark":t=["#4EAAFF","#FA4EAB","#FFF500","#17EA58","#38FFE7","#FF9E45","#B3F32F","#B93CE4","#FC5664","#9B55FF"];break;default:t=["#00bdae","#404041","#357cd2","#e56590","#f8b883","#70ad47","#dd8abd","#7f84e8","#7bb4eb","#ea7a57"]}return t}(t.theme),r=0;r<n;r++)je((i=this.setPoints(e,r,t)).y)&&(i.visible=!1),this.pushPoints(i,o,t)},dLe.prototype.pushPoints=function(e,t,i){e.index=this.points.length,e.isExplode=this.explodeAll||e.index===this.explodeIndex,e.color=e.color||t[e.index%t.length];t={cancel:!1,name:jme,series:this,point:e,fill:e.color};i.trigger(jme,t),e.color=t.fill,e.visible=!t.cancel,this.points.push(e)},dLe.prototype.findSumOfPoints=function(e){for(var t=Object.keys(e).length,i=0;i<t;i++)je(e[i])||je(e[i][this.yName])||isNaN(e[i][this.yName])||(this.sumOfPoints+=Math.abs(e[i][this.yName]))},dLe.prototype.setPoints=function(e,t,i){var n=new sLe;return n.x=R(this.xName,e[t]),n.y=R(this.yName,e[t]),n.percentage=+(n.y/this.sumOfPoints*100).toFixed(2),n.legendImageUrl=R(this.legendImageUrl,e[t]),n.color=R(this.pointColorMapping,e[t]),n.text=n.originalText=R(this.dataLabel.name||"",e[t]),n.tooltip=R(this.tooltipMappingName||"",e[t]),n.sliceRadius=R(this.radius||"80%",e[t]),n.sliceRadius=je(n.sliceRadius)?"80%":n.sliceRadius,n.separatorY=i.intl.formatNumber(n.y,{useGrouping:i.useGroupingSeparator}),this.setEmptyPoint(n,t,e,i),n},dLe.prototype.draw=function(e,t){var i=t.visibleSeries.indexOf(e),n=(this.calculateSize(t,e),e.radius||(F.isDevice&&"Outside"===e.dataLabel.position?"40%":"80%")),o=parseInt(n,10),o=((-1===n.indexOf("%")&&"number"!=typeof o||isNaN(o))&&(this.isRadiusMapped=!0),e.size=this.isRadiusMapped?.8:parseInt(n,10)/100,e.coefficient=parseInt(e.innerRadius,10)/100,t.circularRadius[i]=.97*Math.min(e.actualWidth/2-(t.legendSettings.visible&&t.circularChartLegend3DModule&&("Right"===t.legendSettings.position||"Left"===t.legendSettings.position)?t.circularChartLegend3DModule.legendBounds.width:0),e.actualHeight/2)*e.size,t.innerRadius[i]=e.coefficient*t.circularRadius[i],this.createPolygons(e,t),this.dataLabel.visible&&t.circularChartDataLabel3DModule.renderDataLabel(e,t),O0e(!1,t.svgObject,t.groupElement,t.redraw),new Eo(t.availableSize.width,t.availableSize.height));t.graphics.prepareView(0,t.depth,t.rotation,t.tilt,o,t),t.graphics.view(t.svgObject,t)},dLe.prototype.calculateSize=function(e,t){var i,n=e.legendSettings,o=0,r=0,s=e.circularChartLegend3DModule?e.circularChartLegend3DModule.position:"Auto",a=e.title,l=e.subTitle,h=e.titleLocation,d=e.subTitleLocation,p=e.titleStyle.textOverflow,c=e.subTitleStyle.textOverflow,p=!(!a||"Wrap"!==p),l=!(!l||"Wrap"!==c),c=(n.visible&&e.circularChartLegend3DModule&&"Custom"!==s&&("Right"===s||"Left"===s?o="right"===s.toLowerCase()?e.margin.right:e.margin.left+e.circularChartLegend3DModule.legendBounds.width:r="Top"===s?e.margin.top:"Bottom"===s?e.margin.bottom+e.circularChartLegend3DModule.legendBounds.height:0),t.actualWidth=e.availableSize.width-o,.5*t.actualWidth+("Left"===s?o:0));return p||l?(i=h.size.height+(l?d.size.height:0)+r,t.actualHeight=e.svgObject.height.baseVal.value-i,{centerX:c,centerY:.5*t.actualHeight+(h.size.height+(l?d.size.height:0))}):(i=(a?h.y:0)+r,t.actualHeight=e.svgObject.height.baseVal.value-i,{centerX:c,centerY:.5*t.actualHeight+("Top"===s?i:a?h.y:0)})},dLe.prototype.createPolygons=function(e,t){for(var i,n,o,r=[],s=[],a=(r=0===e.segments.length?this.createPoints(e,t):e.segments).length,l=0;l<a;l++)if((i=r[l]).visible&&(n=r[l].pointIndex,n={opacity:e.opacity,interior:e.points[n].color},null!==(o=this.createSector(i,t,n,e.index))))for(var h=0;h<o.length;h++)if(s[h]||(s[h]=[]),null!==o[h])for(var d=0;d<o[h].length;d++)s[h].push(o[h][d]);for(l=0;l<s.length;l++)for(h=0;h<s[l].length;h++){var p=s[l][h];t.circular3DPolygon.push(p)}return null},dLe.prototype.createSector=function(e,t,i,n){var o=Math.ceil(e.actualEndValue/6),r=Math.PI/180,s=0,a=t.depth;if(o<1)return null;for(var l=[],h=e.actualEndValue/o,d=[],p=[],c=0;c<o+1;c++){var u=e.center.x+e.radius*Math.cos((e.actualStartValue+c*h)*r),g=e.center.y+e.radius*Math.sin((e.actualStartValue+c*h)*r),u=(d[c]={x:u,y:g},e.center.x+e.inSideRadius*Math.cos((e.actualStartValue+c*h)*r)),g=e.center.y+e.inSideRadius*Math.sin((e.actualStartValue+c*h)*r);p[c]={x:u,y:g}}for(var m=[],f=[],c=0;c<o;c++)f=[this.vector(d[c].x,d[c].y,0),this.vector(d[c].x,d[c].y,a),this.vector(d[c+1].x,d[c+1].y,a),this.vector(d[c+1].x,d[c+1].y,0)],m[c]=t.polygon.polygon3D(f,null,e.index,null,null,i.opacity,i.interior,s.toString()+"-region-series-"+n+"-point-"+e.index,t.groupElement,e.accessibilityText),s++;if(l[1]=m,0<e.inSideRadius){for(var y=[],c=0;c<o;c++)f=[this.vector(p[c].x,p[c].y,0),this.vector(p[c].x,p[c].y,a),this.vector(p[c+1].x,p[c+1].y,a),this.vector(p[c+1].x,p[c+1].y,0)],y[c]=t.polygon.polygon3D(f,null,e.index,null,null,i.opacity,i.interior,s.toString()+"-region-series-"+n+"-point-"+e.index,t.groupElement,e.accessibilityText),s++;l[3]=y}for(var v,b,w=[],C=[],c=0;c<o+1;c++)w.push(this.vector(d[c].x,d[c].y,0)),C.push(this.vector(d[c].x,d[c].y,a));if(0<e.inSideRadius)for(c=o;-1<c;c--)w.push(this.vector(p[c].x,p[c].y,0)),C.push(this.vector(p[c].x,p[c].y,a));else w.push(e.center),C.push(this.vector(e.center.x,e.center.y,a));return l[0]=[],l[0].push(t.polygon.polygon3D(w,null,e.index,null,null,i.opacity,i.interior,s.toString()+"-region-series-"+n+"-point-"+e.index,t.groupElement,e.accessibilityText)),l[0].push(t.polygon.polygon3D(C,null,e.index,null,null,i.opacity,i.interior,(++s).toString()+"-region-series-"+n+"-point-"+e.index,t.groupElement,e.accessibilityText)),s++,b=0<e.inSideRadius?(v=[this.vector(d[0].x,d[0].y,0),this.vector(d[0].x,d[0].y,a),this.vector(p[0].x,p[0].y,a),this.vector(p[0].x,p[0].y,0)],[this.vector(d[o].x,d[o].y,0),this.vector(d[o].x,d[o].y,a),this.vector(p[o].x,p[o].y,a),this.vector(p[o].x,p[o].y,0)]):(v=[this.vector(d[0].x,d[0].y,0),this.vector(d[0].x,d[0].y,a),this.vector(e.center.x,e.center.y,a),this.vector(e.center.x,e.center.y,0)],[this.vector(d[o].x,d[o].y,0),this.vector(d[o].x,d[o].y,a),this.vector(e.center.x,e.center.y,a),this.vector(e.center.x,e.center.y,0)]),l[2]=[],l[2].push(t.polygon.polygon3D(v,null,e.index,null,null,i.opacity,i.interior,s.toString()+"-region-series-"+n+"-point-"+e.index,t.groupElement,e.accessibilityText)),l[2].push(t.polygon.polygon3D(b,null,e.index,null,null,i.opacity,i.interior,(++s).toString()+"-region-series-"+n+"-point-"+e.index,t.groupElement,e.accessibilityText)),s++,l},dLe.prototype.createPoints=function(e,t){e.segments=[];for(var i=this.calculateSize(t,e),n=0,o=e.points,r=o.length,s=0;s<r;s++)o[s].visible&&!je(o[s].y)&&(n+=o[s].y);for(var a,l,h,d,p,c,u=360/(n=0!==n?n:1),g=e.index,m=t.innerRadius[g],f=this.getYValues(e.points),y=t.depth,v=0,b=0,w=new Do(0,0,0,0),C={X:0,Y:0},S=0,A=t.circularRadius[g],x=0;x<r;x++)e.points[x].visible&&!je(f[x])&&(d=e.points[x].index,h=Math.abs(f[x]),l=Math.abs(h)*(2*Math.PI/n),w.x=0,w.y=0,p=e.points[x],e.isRadiusMapped?-1!==e.points[x].sliceRadius.indexOf("%")?p.radius=ive(e.points[x].sliceRadius,this.size/2):p.radius=parseInt(e.points[x].sliceRadius,10):p.radius=A,c=p.x+":"+p.y+", "+e.name,je(h)||(e.explode&&(e.explodeIndex===p.index||!e.isExploded&&e.explodeAll)&&(C.X=Math.cos(2*Math.PI*(b+h/2)/n),C.Y=Math.sin(2*Math.PI*(b+h/2)/n),w.x=.01*p.radius*C.X*ive(e.explodeOffset,100),w.y=.01*p.radius*C.Y*ive(e.explodeOffset,100)),a=this.vector(w.x+i.centerX,w.y+i.centerY,0),d=this.createSegment(a,u*b,u*h,y,p.radius,x,h,m,d,e,c),e.segments.push(d)),this.addPieDataLabel(S,f[x],v,v+l,p.radius,this.isChartRotated(t)?t.depth+5:0,a,e.points[x]),S++,v+=l,b+=h);return e.segments},dLe.prototype.addPieDataLabel=function(e,t,i,n,o,r,s,a){i=(i+n)/2;a.symbolLocation={x:0,y:0,radius:0,angle:0},a.symbolLocation.x=e,a.symbolLocation.y=t,a.symbolLocation.radius=o,a.symbolLocation.angle=i,a.symbolLocation.center=s,a.startDepth=r},dLe.prototype.isChartRotated=function(e){var t=Math.abs(e.tilt%360),e=Math.abs(e.rotation%360);return(90<t&&t<270)!=(90<e&&e<270)},dLe.prototype.createSegment=function(e,t,i,n,o,r,s,a,l,h,d){return{startValue:t,endValue:i,depth:n,radius:o,index:r,yData:s,center:e,inSideRadius:a,actualEndValue:i,actualStartValue:t,pointIndex:l,series:h,visible:!0,accessibilityText:d}},dLe.prototype.vector=function(e,t,i){return{x:e,y:t,z:i}},dLe.prototype.getYValues=function(e){for(var t=[],i=e.length,n=0;n<i;n++)t.push(e[n].y);return t},dLe.prototype.findMaxBounds=function(e,t){e.x=(t.x<e.x?t:e).x,e.y=(t.y<e.y?t: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},dLe.prototype.setEmptyPoint=function(e,t,i,n){if(!je(e.y)&&!isNaN(e.y))return null;var o,r;switch(e.color=this.emptyPointSettings.fill||e.color,this.emptyPointSettings.mode){case"Zero":e.y=0,e.visible=!0;break;case"Average":o=i[t-1]&&i[t-1][this.yName]||0,r=i[t+1]&&i[t+1][this.yName]||0,e.y=(Math.abs(o)+Math.abs(r))/2,e.separatorY=n.intl.formatNumber(e.y,{useGrouping:n.useGroupingSeparator}),this.sumOfPoints+=e.y,e.visible=!0;break;default:e.visible=!1}},rLe([e("")],dLe.prototype,"dataSource",void 0),rLe([e()],dLe.prototype,"query",void 0),rLe([e("")],dLe.prototype,"xName",void 0),rLe([e("")],dLe.prototype,"name",void 0),rLe([e("")],dLe.prototype,"tooltipMappingName",void 0),rLe([e("")],dLe.prototype,"yName",void 0),rLe([e(!0)],dLe.prototype,"visible",void 0),rLe([t(null,Qge)],dLe.prototype,"animation",void 0),rLe([e("SeriesType")],dLe.prototype,"legendShape",void 0),rLe([e("")],dLe.prototype,"legendImageUrl",void 0),rLe([e("")],dLe.prototype,"pointColorMapping",void 0),rLe([t({},qFe)],dLe.prototype,"dataLabel",void 0),rLe([e([])],dLe.prototype,"palettes",void 0),rLe([e(null)],dLe.prototype,"radius",void 0),rLe([e("0")],dLe.prototype,"innerRadius",void 0),rLe([e(!0)],dLe.prototype,"enableTooltip",void 0),rLe([e(!1)],dLe.prototype,"explode",void 0),rLe([e("30%")],dLe.prototype,"explodeOffset",void 0),rLe([e(!1)],dLe.prototype,"explodeAll",void 0),rLe([e(null)],dLe.prototype,"explodeIndex",void 0),rLe([t({mode:"Drop"},aLe)],dLe.prototype,"emptyPointSettings",void 0),rLe([e(1)],dLe.prototype,"opacity",void 0);var hLe,rLe=dLe;function dLe(){var e=null!==hLe&&hLe.apply(this,arguments)||this;return e.points=[],e.sumOfPoints=0,e.isRectSeries=!0,e.clipRect=new Do(0,0,0,0),e.category="Series",e.rightSidePoints=[],e.leftSidePoints=[],e.segments=[],e.isExploded=!1,e}oLe(cLe,pLe=rLe),cLe.prototype.getModuleName=function(){return"PieSeries3D"},cLe.prototype.destroy=function(){};var pLe,oLe=cLe;function cLe(){return null!==pLe&&pLe.apply(this,arguments)||this}var uLe=function(){return(uLe=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},gLe=new function(){this.transform=null},mLe=(fLe.prototype.isValid=function(e){return!isNaN(e.x)&&!isNaN(e.y)&&!isNaN(e.z)},fLe.prototype.vector3D=function(e,t,i){return this.x=e,this.y=t,this.z=i,{x:this.x,y:this.y,z:this.z}},fLe.prototype.vector3DMinus=function(e,t){return this.vector3D(e.x-t.x,e.y-t.y,e.z-t.z)},fLe.prototype.vector3DPlus=function(e,t){return this.vector3D(e.x+t.x,e.y+t.y,e.z+t.z)},fLe.prototype.vector3DMultiply=function(e,t){var i=e.y*t.z-t.y*e.z,n=e.z*t.x-t.z*e.x,t=e.x*t.y-t.x*e.y;return this.vector3D(i,n,t)},fLe.prototype.vector3DAdd=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},fLe.prototype.vector3DStarMultiply=function(e,t){var i=e.x*t,n=e.y*t,e=e.z*t;return this.vector3D(i,n,e)},fLe.prototype.getLength=function(e){e=this.vector3DAdd(e,e);return Math.sqrt(e)},fLe.prototype.getNormal=function(e,t,i){e=this.vector3DMinus(e,t),i=this.vector3DMinus(i,t),t=this.vector3DMultiply(e,i),e=this.getLength(t);return e<this.epsilon?this.vector3D(0,0,0):this.vector3D(t.x/e,t.y/e,t.z/e)},fLe);function fLe(e,t,i){this.x=0,this.y=0,this.z=0,this.epsilon=1e-5,this.x=e,this.y=t||0,this.z=i||0}vLe.prototype.matrix3D=function(e){for(var t=[],i=0;i<e;i++)t[i]=this.createArray(e);return t},vLe.prototype.isAffine=function(e){return 0===e[0][3]&&0===e[1][3]&&0===e[2][3]&&1===e[3][3]},vLe.prototype.createArray=function(e){for(var t=[],i=0;i<e;++i)t[i]=0;return t},vLe.prototype.getIdentity=function(){for(var e=this.matrix3D(this.matrixSize),t=0;t<this.matrixSize;t++)e[t][t]=1;return e},vLe.prototype.getInterval=function(e){for(var t=this.getIdentity(),i=0;i<this.matrixSize;i++)for(var n=0;n<this.matrixSize;n++)t[i][n]=this.getMinor(e,i,n);return t=this.transposed(t),t=this.getMatrixMultiple(1/this.getDeterminant(e),t)},vLe.prototype.getMatrixMultiple=function(e,t){for(var i=0;i<t.length;i++)for(var n=0;n<t[i].length;n++)t[i][n]=t[i][n]*e;return t},vLe.prototype.getMatrixVectorMultiple=function(e,t){var i=e[0][0]*t.x+e[1][0]*t.y+e[2][0]*t.z+e[3][0],n=e[0][1]*t.x+e[1][1]*t.y+e[2][1]*t.z+e[3][1],o=e[0][2]*t.x+e[1][2]*t.y+e[2][2]*t.z+e[3][2];return this.isAffine(e)||(i*=t=1/(e[0][3]*t.x+e[1][3]*t.y+e[2][3]*t.z+e[3][3]),n*=t,o*=t),{x:i,y:n,z:o}},vLe.prototype.getMatrixMultiplication=function(e,t){for(var i=this.getIdentity(),n=0;n<this.matrixSize;n++)for(var o=0;o<this.matrixSize;o++){for(var r=0,s=0;s<this.matrixSize;s++)r+=e[s][o]*t[n][s];i[n][o]=r}return i},vLe.prototype.getMinor=function(e,t,i){return((t+i)%2==0?1:-1)*this.getDeterminant(this.getMatrix(e,t,i))},vLe.prototype.getMatrix=function(e,t,i){for(var n=e.length-1,o=this.createArray(n),r=0;r<n;r++){var s=t<=r?r+1:r;o[r]=this.createArray(n);for(var a=0;a<n;a++)o[r][a]=e[s][i<=a?a+1:a]}return o},vLe.prototype.getDeterminant=function(e){var t=e.length,i=0;if(t<2)i=e[0][0];else for(var n=1,o=0;o<t;o++){var r=this.getMatrix(e,o,0);i+=n*e[o][0]*this.getDeterminant(r),n=0<n?-1:1}return i},vLe.prototype.transform=function(e,t,i){var n=this.getIdentity();return n[3][0]=e,n[3][1]=t,n[3][2]=i,n},vLe.prototype.turn=function(e){var t=this.getIdentity();return t[0][0]=Math.cos(e),t[2][0]=-Math.sin(e),t[0][2]=Math.sin(e),t[2][2]=Math.cos(e),t},vLe.prototype.tilt=function(e){var t=this.getIdentity();return t[1][1]=Math.cos(e),t[2][1]=Math.sin(e),t[1][2]=-Math.sin(e),t[2][2]=Math.cos(e),t},vLe.prototype.transposed=function(e){for(var t=this.getIdentity(),i=0;i<this.matrixSize;i++)for(var n=0;n<this.matrixSize;n++)t[i][n]=e[n][i];return t};var yLe=vLe;function vLe(){this.matrixSize=4}wLe.prototype.transform3D=function(e){return{viewingArea:e,rotation:0,tilt:0,depth:0,perspectiveAngle:0,needUpdate:!0,centeredMatrix:this.matrixObj.getIdentity(),perspective:this.matrixObj.getIdentity(),resultMatrix:this.matrixObj.getIdentity(),viewMatrix:this.matrixObj.getIdentity()}},wLe.prototype.transform=function(e){this.setCenter(this.vector.vector3D(e.viewingArea.width/2,e.viewingArea.height/2,e.depth/2),e),this.setViewMatrix(this.matrixObj.transform(0,0,e.depth),e),this.setViewMatrix(this.matrixObj.getMatrixMultiplication(e.viewMatrix,this.matrixObj.turn(-this.toRadial*e.rotation)),e),this.setViewMatrix(this.matrixObj.getMatrixMultiplication(e.viewMatrix,this.matrixObj.tilt(-this.toRadial*e.tilt)),e),this.updatePerspective(e.perspectiveAngle,e),e.needUpdate=!0},wLe.prototype.updatePerspective=function(e,t){e=(t.viewingArea.width+t.viewingArea.height)*Math.tan(this.degreeToRadianConverter((180-Math.abs(e%181))/2))+2*t.depth/2;t.perspective[0][0]=e,t.perspective[1][1]=e,t.perspective[2][3]=1,t.perspective[3][3]=e},wLe.prototype.degreeToRadianConverter=function(e){return e*Math.PI/180},wLe.prototype.toScreen=function(e,t,i){return{x:(e=i?(this.matrixObj=i).getMatrixVectorMultiple(this.result(t,i),e):(t.chartObj=this.matrixObj,this.matrixObj.getMatrixVectorMultiple(this.result(t),e))).x,y:e.y}},wLe.prototype.setViewMatrix=function(e,t){t.viewMatrix!==e&&(t.viewMatrix=e,t.needUpdate=!0)},wLe.prototype.result=function(e,t){var i=(i=e.chartObj||this.matrixObj)||t;return e.needUpdate&&(t=this.matrixObj,e.resultMatrix=i.getMatrixMultiplication(t.getInterval(e.centeredMatrix),e.perspective),e.resultMatrix=i.getMatrixMultiplication(e.resultMatrix,e.viewMatrix),e.resultMatrix=i.getMatrixMultiplication(e.resultMatrix,e.centeredMatrix),e.needUpdate=!1),e.resultMatrix},wLe.prototype.setCenter=function(e,t){t.centeredMatrix=this.matrixObj.transform(-e.x,-e.y,-e.z),t.needUpdate=!0};var bLe=wLe;function wLe(){this.toRadial=Math.PI/180,this.vector=new mLe(0,0,0),this.matrixObj=new yLe}SLe.prototype.prepareView=function(e,t,i,n,o,r){0===arguments.length?FLe.build(null,r):(null==gLe.transform?gLe.transform=r.transform3D.transform3D(o):gLe.transform.viewingArea=o,gLe.tree||(gLe.tree=[]),gLe.transform.rotation=i,gLe.transform.tilt=n,gLe.transform.depth=t,gLe.transform.perspectiveAngle=e,r.transform3D.transform(gLe.transform),gLe.tree[r.groupElement.id]=FLe.build(null,r))},SLe.prototype.view=function(e,t,i,n,o,r,s){var a;2===arguments.length?null!=e&&(a=this.vector.vector3D(0,0,32767),this.drawNode3D(gLe.tree[t.groupElement.id],a,e,t)):null!=e&&(null==gLe.transform?gLe.transform=t.transform3D.transform3D(o):gLe.transform.viewingArea=o,gLe.transform.rotation=i,gLe.transform.tilt=n,gLe.transform.depth=s,gLe.transform.perspectiveAngle=r,t.transform3D.transform(gLe.transform),a=this.vector.vector3D(0,0,32767),this.drawNode3D(gLe.tree[t.groupElement.id],a,e,t))},SLe.prototype.draw3DElement=function(e,t){e.plane.element?"text"===e.plane.element.tag||"dataLabel"===e.plane.element.tag?LLe.drawText(e.plane,t):"polyline"===e.plane.element.tag?LLe.drawPolyLine(e.plane,t):"template"===e.plane.element.tag&&LLe.drawTemplate(e.plane,t):LLe.draw(e.plane,t)},SLe.prototype.drawNode3D=function(e,t,i,n){if(null!==e&&null!=gLe.transform){for(;;){if(PLe.vector3DAdd(LLe.getNormal(n.transform3D.result(gLe.transform),e.plane.vectorPoints),t)>e.plane.d){if(null!=e.front&&this.drawNode3D(e.front,t,i,n),this.draw3DElement(e,n),null!=e.back){e=e.back;continue}}else if(null!=e.back&&this.drawNode3D(e.back,t,i,n),this.draw3DElement(e,n),null!=e.front){e=e.front;continue}break}return null}};var CLe=SLe;function SLe(){this.vector=new mLe(0,0,0)}xLe.prototype.getNext=function(e,t){return t<=e?e-t:e<0?e+t:e},xLe.prototype.vector3DIndexClassification=function(e,t,i){return{index:t,result:i,vector:e,isCuttingBackPoint:!1,cuttingBackPairIndex:null,alreadyCutBack:!1,isCuttingFrontPoint:!1,cuttingFrontPairIndex:null,alreadyCutFront:!1}},xLe.prototype.classifyPoint=function(e,t){var i="OnPlane",e=-t.d-PLe.vector3DAdd(e,t.normal);return e>this.epsilon?i="OnBack":e<-this.epsilon&&(i="OnFront"),i},xLe.prototype.classifyPolygon=function(e,t){var i="Unknown",n=t.points;if(null!=n){for(var o=0,r=0,s=0,a=e.normal,l=e.d,h=0,d=n.length;h<d;h++){var p=-l-PLe.vector3DAdd(n[h],a);if(p>this.epsilon?o++:p<-this.epsilon?r++:s++,0<o&&0<r)break}i=s===n.length?"OnPlane":r+s===n.length?"ToRight":o+s===n.length?"ToLeft":"Unknown"}return i},xLe.prototype.splitPolygon=function(e,t){var i=[],n=[];if(null!=e.points){for(var o=[],r=[],s=[],a=e.points.length,l=0;l<a;l++){var h=e.points[l],d=e.points[this.getNext(l+1,a)],p=this.classifyPoint(h,t),c=this.classifyPoint(d,t),u=this.vector3DIndexClassification(h,o.length,p);o.push(u),p!==c&&"OnPlane"!==p&&"OnPlane"!==c&&(u=PLe.vector3DMinus(h,d),p=PLe.vector3DMinus(PLe.vector3DStarMultiply(t.normal,-t.d),d),c=PLe.vector3DAdd(p,t.normal)/PLe.vector3DAdd(t.normal,u),h=PLe.vector3DPlus(d,PLe.vector3DStarMultiply(u,c)),p=this.vector3DIndexClassification(h,o.length,"OnPlane"),o.push(p),r.push(p),s.push(p))}if(0!==s.length||0!==r.length){for(l=0;l<r.length-1;l+=2){var g=r[l],m=r[l+1];g.cuttingBackPoint=!0,m.cuttingBackPoint=!0,g.alterCuttingBackPairIndex=m.index,m.alterCuttingBackPairIndex=g.index}for(l=0;l<s.length-1;l+=2){var f=s[l],y=s[l+1];f.cuttingFrontPoint=!0,y.cuttingFrontPoint=!0,f.alterCuttingFrontPairIndex=y.index,y.alterCuttingFrontPairIndex=f.index}for(var v,l=0;l<r.length-1;l++)(g=r[l]).alreadyCutBack||2<(v=this.cutOutBackPolygon(o,g)).length&&(v=LLe.polygon3D(v,e),i.push(uLe({},v)));for(var b,l=0;l<s.length-1;l++)(m=s[l]).alreadyCutFront||2<(b=this.cutOutFrontPolygon(o,m)).length&&(b=LLe.polygon3D(b,e),n.push(uLe({},b)))}}else i.push(e),n.push(e);return{backPolygon:i,frontPolygon:n}},xLe.prototype.cutOutFrontPolygon=function(e,t){for(var i=[],n=t;;){n.alreadyCutFront=!0,i.push(n.vector);var o=e[n.alterCuttingFrontPairIndex];if(n.cuttingFrontPoint)if(o.alreadyCutFront){var r=e[this.getNext(n.index-1,e.length)],s=e[this.getNext(n.index+1,e.length)];if("OnFront"!==r.result||r.alreadyCutFront){if("OnFront"!==s.result||s.alreadyCutFront)return i;n=s}else n=r}else n=o;else{r=e[this.getNext(n.index-1,e.length)],s=e[this.getNext(n.index+1,e.length)];if("OnBack"===r.result||r.alreadyCutFront){if("OnBack"===s.result||s.alreadyCutFront)return i;n=s}else n=r}}return null},xLe.prototype.cutOutBackPolygon=function(e,t){for(var i=[],n=t;;){n.alreadyCutBack=!0,i.push(n.vector);var o=e[n.alterCuttingBackPairIndex];if(n.cuttingBackPoint)if(o.alreadyCutBack){var r=e[this.getNext(n.index-1,e.length)],s=e[this.getNext(n.index+1,e.length)];if("OnBack"!==r.result||r.alreadyCutBack){if("OnBack"!==s.result||s.alreadyCutBack)return i;n=s}else n=r}else n=o;else{r=e[this.getNext(n.index-1,e.length)],s=e[this.getNext(n.index+1,e.length)];if("OnFront"===r.result||r.alreadyCutBack){if("OnFront"===s.result||s.alreadyCutBack)return i;n=s}else n=r}}return null},xLe.prototype.build=function(e,t){if(e){var i=e;if(i.length<1)return null;for(var e={back:null,front:null,plane:null},n=i[0],o=(e.plane=n,[]),r=[],s=1,a=i.length;s<a;s++){var l=i[s];if(l!==n)switch(this.classifyPolygon(n,l)){case"OnPlane":case"ToRight":r.push(l);break;case"ToLeft":o.push(l);break;case"Unknown":if(l.element)o.push(l);else{for(var h=this.splitPolygon(l,n),d=0;d<h.backPolygon.length;d++)h.backPolygon[d].name=h.backPolygon[d].name+"-back",o.push(h.backPolygon[d]);for(var p=0;p<h.frontPolygon.length;p++)h.frontPolygon[p].name=h.frontPolygon[p].name+"-front",r.push(h.frontPolygon[p])}}}return 0<o.length&&(e.back=this.build(o)),0<r.length&&(e.front=this.build(r)),e}return this.build(t.circular3DPolygon)};var ALe=xLe;function xLe(e){this.epsilon=5e-4,this.chart=e}TLe.prototype.getStringBuilder=function(){var t=[],i=0;return{append:function(e){return t[i++]=e,this},toString:function(e){return t.join(e||"")}}},TLe.prototype.hexToValue=function(e){var t;return 0===e.indexOf("rgba(")?(t=e.slice(5,-1).split(","))?{red:parseInt(t[0],10),green:parseInt(t[1],10),blue:parseInt(t[2],10),alpha:parseFloat(t[3])}:null:0===e.indexOf("rgb(")?(t=e.slice(4,-1).split(","))?{red:parseInt(t[0],10),green:parseInt(t[1],10),blue:parseInt(t[2],10)}:null:(t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e))?{red:parseInt(t[1],16),green:parseInt(t[2],16),blue:parseInt(t[3],16)}:null},TLe.prototype.drawText=function(e,t,i,n){var o=document.getElementById(e.id)||n.groupElement.querySelector("#"+e.id);return(o=null===o?document.createElementNS("http://www.w3.org/2000/svg","text"):o).textContent=t,o=n.renderer.setElementAttributes(e,o)},TLe.prototype.hexColor=function(e){var i,t=e.red,n=e.green,o=e.blue;return e.alpha?"rgba("+t.toString()+","+n.toString()+","+o.toString()+","+e.alpha+")":((i=[t.toString(16),n.toString(16),o.toString(16)]).forEach(function(e,t){1===e.length&&(i[t]="0"+e)}),"#"+i.join("").toUpperCase())},TLe.prototype.checkColorFormat=function(e){if(0===e.indexOf("rgba(")||0===e.indexOf("rgb(")){var t=e.substring(e.indexOf("(")+1,e.lastIndexOf(")")).split(",");if(3===t.length||4===t.length)return t.every(function(e){e=parseFloat(e);return!isNaN(e)&&0<=e&&e<=255})}else if(0===e.indexOf("#"))return(3===(t=e.substring(1)).length||6===t.length)&&/^[0-9A-Fa-f]{3,6}$/.test(t);return!1};var ILe=TLe;function TLe(){}DLe.prototype.polygon3D=function(e,t,i,n,o,r,s,a,l,h){var d;return 2===arguments.length?(this.calculateNormal(e[0],e[1],e[2]),this.vectorPoints=e,this.calculateNormal(this.vectorPoints),(d=t).normal=this.normal,d.points=e,d.vectorPoints=this.vectorPoints,d.isSplit=!0,d.d=this.d):(this.calculateNormal(e[0],e[1],e[2]),this.vectorPoints=e,this.calculateNormal(this.vectorPoints),d={normal:this.normal,points:e,vectorPoints:this.vectorPoints,index:i,tag:t,name:a||null,strokeThickness:o,opacity:r,fill:s,d:this.d,text:h||"",polygonElement:e={tag:"path",parent:l}},1!==arguments.length&&(d.polygonElement=e)),d},DLe.prototype.calculateNormal=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(3<=e.length){var i=e[0],n=e[1],o=e[2],r=this.vector.vector3DMinus(i,n),o=this.vector.vector3DMinus(o,n),n=this.vector.vector3DMultiply(r,o),r=this.vector.getLength(n);r<this.epsilon&&(r=1),this.normal=this.vector.vector3D(n.x/r,n.y/r,n.z/r),this.d=-(this.normal.x*i.x+this.normal.y*i.y+this.normal.z*i.z),e[3]&&(e[3].normal=this.normal,e[3].d=this.d)}else{var s=e[0];this.calculateNormal(s[0],s[1],s[2],e[1]);for(var a=3;a<s.length&&this.test();a++)this.calculateNormal(s[a],s[0],s[a/2])}},DLe.prototype.test=function(){return!this.vector.isValid(this.normal)},DLe.prototype.getNormal=function(e,t){if(null!=t){s=this.vector.getNormal(this.matrixObj.getMatrixVectorMultiple(e,t[0]),BLe.getMatrixVectorMultiple(e,t[1]),this.matrixObj.getMatrixVectorMultiple(e,t[2]));for(var i=3;i<t.length&&!this.vector.isValid(s)&&t[i/2];i++)var n=BLe.getMatrixVectorMultiple(e,t[i]),o=BLe.getMatrixVectorMultiple(e,t[0]),r=BLe.getMatrixVectorMultiple(e,t[i/2]),s=this.vector.getNormal(n,o,r)}return s},DLe.prototype.createTextElement=function(e,t,i,n){var o=[],r=e.x,s=e.y,a=t.width,l=t.height;return o[0]=this.vector.vector3D(r,s,e.z),o[1]=this.vector.vector3D(r+a,s+l+n,e.z),o[2]=this.vector.vector3D(r+a+i,s+l+n,e.z),this.text3D(t,o)},DLe.prototype.createPolyline=function(e,t){var i;return 2===e.length&&(i=e[1],e.push({x:i.x,y:i.y,z:i.z})),this.polyLine3D(t,e)},DLe.prototype.polyLine3D=function(e,t){t=this.polygon3D(t);return t.element=e,t},DLe.prototype.text3D=function(e,t){t=this.polygon3D(t);return t.element=e,t},DLe.prototype.drawPolyLine=function(e,t){var i=gLe.transform,n=t.svg3DRenderer.getStringBuilder(),o=t.transform3D.toScreen(e.vectorPoints[0],i),o=(n.append("M "+o.x+" "+o.y+" "),t.transform3D.toScreen(e.vectorPoints[1],i)),o=(n.append("L "+o.x+" "+o.y+" "),n.append("M "+o.x+" "+o.y+" "),t.transform3D.toScreen(e.vectorPoints[2],i)),i=(n.append("L "+o.x+" "+o.y+" "),n.toString()),o={id:e.element.id,"stroke-dasharray":e.element.dashArray,"stroke-width":e.element.width,stroke:e.element.stroke,d:i},n=t.renderer.drawPath(o);O0e(!1,t.groupElement,n,t.redraw,!0,"x","y",null,i)},DLe.prototype.drawText=function(e,t){var i,n,o,r,s=e.element,a=gLe.transform;null!=a&&(n=(a=t.transform3D.toScreen(e.vectorPoints[0],a)).x,i=a.y,"text"===s.tag?(n={id:s.id,x:n,y:i,fill:s.font.color||s.fill,"font-size":s.font.size,"font-family":s.font.fontFamily||t.themeStyle.datalabelFont.fontFamily,"font-style":s.font.fontStyle,"font-weight":s.font.fontWeight,opacity:s.font.opacity,"text-anchor":s.textAnchor,cursor:"default",transform:s.angle?"rotate("+s.angle+","+n+","+i+")":""},i=t.svg3DRenderer.drawText(n,s.label.text,e.element.font,t),-1<s.id.indexOf("text")&&i.setAttribute("aria-hidden","true"),t.groupElement.append(i),t.previousID&&t.isTouch&&(e=document.getElementById(t.previousID),i=document.getElementById(n.id),e)&&i&&i.parentNode.insertBefore(i,e.nextSibling),t.previousID=n.id):(i=s.series,n=(e=So(s.point.argsData.text,s.point.argsData.font,t.themeStyle.datalabelFont)).width+10+10,e=e.height+10+10,o=a.x,a=a.y,r=i.index,this.dataLabelSymbol(r,i,s,o-5+5,a-5-e/10+5,n,e,t)))},DLe.prototype.dataLabelSymbol=function(e,t,i,n,o,r,s,a){var l,h="",t=(t.dataLabel.enableRotation&&(h="rotate("+(0===(l=t.dataLabel.angle)?(d=i.point.symbolLocation.angle*(180/Math.PI),"Outside"===t.dataLabel.position?0:90<=d&&d<=260?180+d:d):360<l?l-360:l<-360?l+360:l)+","+n+","+o+")"),{id:a.element.id+"-svg-data-label-series-"+e+"-shape-"+i.pointIndex,fill:i.point.argsData.color,"stroke-width":i.point.argsData.border.width,stroke:i.point.argsData.border.color,"stroke-dasharray":i.point.argsData.border.dashArray,opacity:1,visibility:"",transform:h,d:"M "+(n+-r/2)+" "+(o+-s/2)+" L "+(n+r/2)+" "+(o+-s/2)+" L "+(n+r/2)+" "+(o+s/2)+" L "+(n+-r/2)+" "+(o+s/2)+" L "+(n+-r/2)+" "+(o+-s/2)+" z"}),d=a.renderer.drawPath(t);a.groupElement.append(d),a.previousID&&a.isTouch&&(l=document.getElementById(a.previousID),e=document.getElementById(t.id),l)&&e&&e.parentNode.insertBefore(e,l.nextSibling),a.previousID=t.id},DLe.prototype.draw=function(e,t){if(!(null==e.vectorPoints||e.vectorPoints.length<=0)){var i=gLe.transform,n=t.svg3DRenderer.getStringBuilder(),o=e.fill,r=(t.svg3DRenderer.checkColorFormat(o)||(o=Y0e(o)),{StartPoint:null});if(null!=i){r.StartPoint=t.transform3D.toScreen(e.vectorPoints[0],i),n.append("M "+r.StartPoint.x+" "+r.StartPoint.y+" ");for(var s=0;s<e.vectorPoints.length;s++){var a=t.transform3D.toScreen(e.vectorPoints[s],i);n.append("L "+a.x+" "+a.y+" ")}}var r=n.toString(),l="Light",h=2*(Math.abs(this.vector.vector3DAdd(e.normal,this.vector.vector3D(0,0,1)))-1),d=2*(Math.abs(this.vector.vector3DAdd(e.normal,this.vector.vector3D(0,1,0)))-1),p=2*(Math.abs(this.vector.vector3DAdd(e.normal,this.vector.vector3D(1,0,0)))-1),p=(!e.name||-1<e.name.indexOf("-wall-brush")||(h==p?(l="ZLight",o=this.applyZLight(o,t)):d==h||0!=h&&d<h?(l="XLight",o=this.applyXLight(o,t)):h<0?(l="ZLight",o=this.applyZLight(o,t)):l="Light"),{id:t.element.id+"-svg-"+e.name,name:l,fill:o,stroke:"","stroke-width":e.strokeThickness,opacity:e.opacity,d:r}),d=t.renderer.drawPath(p);e.text&&(d.setAttribute("aria-label",e.text),d.setAttribute("role","img")),O0e(!1,e.polygonElement.parent,d,t.redraw,!0,"x","y",null,r),t.previousID&&t.isTouch&&(h=document.getElementById(t.previousID),l=document.getElementById(p.id),h)&&l&&l.parentNode.insertBefore(l,h.nextSibling),t.previousID=p.id}},DLe.prototype.drawTemplate=function(e,t){var i=e.element,n=gLe.transform;null!=n&&(i=i.label,e=t.transform3D.toScreen(e.vectorPoints[0],n),t.circularChartDataLabel3DModule.createDataLabelTemplate(i.series.dataLabelElement,i.series,i.series.dataLabel,i.series.points[i.pointIndex],i.series.points[i.pointIndex].argsData,i.pointIndex,!1,e,t))},DLe.prototype.applyXLight=function(e,t){e=t.svg3DRenderer.hexToValue(e);return e.red=parseInt((.7*e.red).toString(),10),e.green=parseInt((.7*e.green).toString(),10),e.blue=parseInt((.7*e.blue).toString(),10),t.svg3DRenderer.hexColor(e)},DLe.prototype.applyZLight=function(e,t){e=t.svg3DRenderer.hexToValue(e);return e.red=parseInt((.9*e.red).toString(),10),e.green=parseInt((.9*e.green).toString(),10),e.blue=parseInt((.9*e.blue).toString(),10),t.svg3DRenderer.hexColor(e)};var ELe=DLe;function DLe(){this.epsilon=1e-5,this.normal={x:0,y:0,z:0},this.vector=new mLe(0,0,0),this.vectorPoints=[],this.matrixObj=new yLe}var MLe,kLe,PLe=new mLe(0,0,0),BLe=new yLe,FLe=new ALe,LLe=new ELe,RLe=(MLe=function(e,t){return(MLe=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])}))(e,t)},function(e,t){function i(){this.constructor=e}MLe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),OLe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},OLe=(RLe(NLe,kLe=n),OLe([e(!0)],NLe.prototype,"visible",void 0),OLe([e(null)],NLe.prototype,"height",void 0),OLe([e(null)],NLe.prototype,"width",void 0),OLe([t({x:0,y:0},yge)],NLe.prototype,"location",void 0),OLe([e("Auto")],NLe.prototype,"position",void 0),OLe([e(8)],NLe.prototype,"padding",void 0),OLe([e(null)],NLe.prototype,"itemPadding",void 0),OLe([e("Center")],NLe.prototype,"alignment",void 0),OLe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},Tge)],NLe.prototype,"textStyle",void 0),OLe([e(10)],NLe.prototype,"shapeHeight",void 0),OLe([e(10)],NLe.prototype,"shapeWidth",void 0),OLe([t({},Rge)],NLe.prototype,"border",void 0),OLe([t({left:0,right:0,top:0,bottom:0},zge)],NLe.prototype,"margin",void 0),OLe([t({left:0,right:0,top:0,bottom:0},rme)],NLe.prototype,"containerPadding",void 0),OLe([e(8)],NLe.prototype,"shapePadding",void 0),OLe([e("transparent")],NLe.prototype,"background",void 0),OLe([e(1)],NLe.prototype,"opacity",void 0),OLe([e(!0)],NLe.prototype,"toggleVisibility",void 0),OLe([e(!1)],NLe.prototype,"enableHighlight",void 0),OLe([e(null)],NLe.prototype,"description",void 0),OLe([e(3)],NLe.prototype,"tabIndex",void 0),OLe([e(null)],NLe.prototype,"title",void 0),OLe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},Tge)],NLe.prototype,"titleStyle",void 0),OLe([e("Top")],NLe.prototype,"titlePosition",void 0),OLe([e("Normal")],NLe.prototype,"textWrap",void 0),OLe([e("Ellipsis")],NLe.prototype,"textOverflow",void 0),OLe([e(100)],NLe.prototype,"maximumTitleWidth",void 0),OLe([e(null)],NLe.prototype,"maximumLabelWidth",void 0),OLe([e(!0)],NLe.prototype,"enablePages",void 0),OLe([e(!1)],NLe.prototype,"isInversed",void 0),OLe([e(!1)],NLe.prototype,"reverse",void 0),NLe);function NLe(){return null!==kLe&&kLe.apply(this,arguments)||this}RLe(_Le,VLe=Gve),_Le.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on(F.touchMoveEvent,this.mouseMove,this),this.chart.on(F.touchEndEvent,this.mouseEnd,this),this.chart.on("click",this.click,this))},_Le.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off(F.touchMoveEvent,this.mouseMove),this.chart.off("click",this.click),this.chart.off(F.touchEndEvent,this.mouseEnd))},_Le.prototype.mouseMove=function(e){if(this.chart.legendSettings.visible&&!this.chart.isTouch&&(this.move(e),this.chart.circularChartHighlight3DModule)&&("None"!==this.chart.highlightMode||this.chart.legendSettings.enableHighlight))for(var t=[this.legendID+"_text_",this.legendID+"_shape_marker_",this.legendID+"_shape_",this.legendID+"_g_"],i=e.target.id,n=0,o=t;n<o.length;n++)if(-1<i.indexOf(o[n])){this.chart.circularChartSelection3DModule?this.chart.circularChartSelection3DModule.legendSelection(this.chart,e.target,e.type):this.chart.circularChartHighlight3DModule&&this.chart.circularChartHighlight3DModule.legendSelection(this.chart,e.target,e.type);break}},_Le.prototype.mouseEnd=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},_Le.prototype.getLegendOptions=function(e,t){this.legendCollections=[],this.isRtlEnable=e.enableRtl,this.isReverse=!this.isRtlEnable&&e.legendSettings.reverse;for(var i=0;i<1;i++){for(var n=0,o=t[i].points;n<o.length;n++){var r=o[n];je(r.x)||je(r.y)||this.legendCollections.push(new Rbe(r.x.toString(),r.color,t[i].legendShape,r.visible,"Pie",t[0].legendImageUrl,null,null,r.index,t[i].index))}this.isReverse&&this.legendCollections.reverse()}},_Le.prototype.getLegendBounds=function(e,t,i){this.calculateLegendTitle(i,t),this.isTitle=!!i.title;for(var n=0,o=0,r=(this.chartRowCount=1,this.rowHeights=[],this.columnHeights=[],this.pageHeights=[],i.padding),s=i.titlePosition,a=0,l=this.arrowWidth,h=i.enablePages?0:this.arrowHeight,d=(this.isVertical?n=i.width?0:e.width/100*5:o=i.height?0:e.height/100*5,t.width+=n,t.height+=o,i.shapePadding),p=i.maximumLabelWidth||0,c=i.shapeWidth,u=0,g=0,m=0,f=[],y=[],v=0,b=0,w=0,C=(this.maxItemHeight=Math.max(So("MeasureText",i.textStyle,this.chart.themeStyle.legendLabelFont).height,i.shapeHeight),!1),S=0;S<this.legendCollections.length;S++){var A,x={fill:(A=this.legendCollections[S]).fill,text:A.text,shape:A.shape,name:"legendRender",cancel:!1};this.chart.trigger("legendRender",x),A.render=!x.cancel,A.text=-1<x.text.indexOf("&")?this.convertHtmlEntities(x.text):x.text,A.fill=x.fill,A.shape=x.shape,A.textSize=So(A.text,i.textStyle,this.chart.themeStyle.legendLabelFont),A.render&&""!==A.text&&(C=!0,w=c+d+(i.maximumLabelWidth||A.textSize.width)+(this.isVertical||0===S?r:this.itemPadding),this.getLegendHeight(A,i,t,u,this.maxItemHeight,r),this.isVertical?((b+=A.textSize.height+(0===S?r:this.itemPadding))+this.itemPadding+h/this.pageButtonSize>t.height&&(u+=p,x=this.getPageWidth(y),this.totalPages=Math.max(m,this.totalPages||1),u-x+w>t.width?(y.push(u-x),v=m=this.rowHeights.length):m=v,f.push(p),p=0,b=A.textSize.height+r,g++),this.columnHeights[g]=(this.columnHeights[g]||0)+A.textSize.height+(0===S?r:this.itemPadding),p=Math.max(w,p),this.rowHeights[m]=Math.max(this.rowHeights[m]||0,A.textSize.height),m++):(i.enablePages||(a=this.isTitle&&"Top"!==s?this.legendTitleSize.width+this.fivePixel:0,a+=l),u+=w,t.width<r+u+a&&(p=Math.max(p,u+r+a-w),0===m&&w!==u&&(m=1),u=w,m++,g=0),this.rowHeights[x=m&&m-1]=Math.max(this.rowHeights[x]||0,A.textSize.height),this.columnHeights[g]=(this.columnHeights[g]||0)+A.textSize.height+r,g++))}e="Top"===s?this.legendTitleSize.height:0,this.isVertical?(this.isPaging=t.width<(u+=p)+r,b=Math.max.apply(null,this.columnHeights)+r+h+e,b=Math.max(b,(this.totalPages||1)*(this.maxItemHeight+r)+r+h),this.isPaging=this.isPaging&&1<this.totalPages,f.push(p)):(this.totalPages=m,b=Math.max.apply(null,this.columnHeights)+r+h+e,this.isPaging=t.height<b,b=!i.enablePages&&this.isPaging?this.maxItemHeight+r+r+e:b,b=Math.max(b,this.maxItemHeight+r+r+e),this.isPaging||(u+=this.isTitle&&"Top"!==s?this.fivePixel+this.legendTitleSize.width+this.fivePixel:0)),this.maxColumns=0;n=this.isVertical?this.getMaxColumn(f,t.width,r,u+r):Math.max(u+r,p);C?this.setBounds(n,b,i,t):this.setBounds(0,0,i,t)},_Le.prototype.getPageWidth=function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i];return t},_Le.prototype.getLegendHeight=function(e,t,i,n,o,r){var s=e.textSize.width,a=t.shapePadding+2*r+t.shapeWidth;switch(t.textWrap){case"Wrap":case"AnyWhere":s>t.maximumLabelWidth||s+n>i.width?e.textCollection=pve(e.text,t.maximumLabelWidth?Math.min(t.maximumLabelWidth,i.width-a):i.width-a,t.textStyle,this.chart.enableRtl,null,null,this.chart.themeStyle.legendLabelFont):e.textCollection.push(e.text),e.textSize.height=o*e.textCollection.length}},_Le.prototype.convertHtmlEntities=function(e){return e.replace("&amp;","&").replace("&lt;","<").replace("&gt;",">").replace("&quot;",'"').replace("&nbsp;"," ").replace("&cent;","¢").replace("&pound;","£").replace("&yen;","¥").replace("&euro;","€").replace("&copy;","©").replace("&reg;","®").replace("&#38;","&").replace("&#60;","<").replace("&#62;",">").replace("&#34;",'"').replace("&#160;"," ").replace("&#162;","¢").replace("&#163;","£").replace("&#165;","¥").replace("&#8364;","€").replace("&#169;","©").replace("&#174;","®")},_Le.prototype.getMaxColumn=function(e,t,i,n){var o=i;this.maxColumnWidth=Math.max.apply(null,e);for(var r=0;r<e.length;r++)if(o+=this.maxColumnWidth,this.maxColumns++,t<o+i){o-=this.maxColumnWidth,this.maxColumns--;break}this.isPaging=o<n&&1<this.totalPages,o===i&&(o=t),this.maxColumns=Math.max(1,this.maxColumns),this.maxWidth=o;var s=this.maxColumnWidth+i,a=0,l=this.columnHeights.length;if(this.isPaging&&this.isVertical){for(r=1;r<l;r++)t<(s+=this.maxColumnWidth+i)&&(this.pageHeights.push(a!==r-1?Math.max.apply(null,this.columnHeights.slice(a,r-1)):this.columnHeights[a]),s=this.maxColumnWidth+i,a=r);this.pageHeights.push(a!==l-1?Math.max.apply(null,this.columnHeights.slice(a,l-1)):this.columnHeights[a]),this.totalPages=this.pageHeights.length}return o},_Le.prototype.getAvailWidth=function(e,t){if(this.isVertical)t=this.maxWidth;else if(!this.isVertical&&this.isPaging&&!this.legend.enablePages)return t-e-this.fivePixel;return t-(2*this.legend.padding+this.legend.shapeWidth+this.legend.shapePadding)},_Le.prototype.getRenderPoint=function(e,t,i,n,o,r,s){var a=this.legend.padding,l=n.location.y+this.maxItemHeight/4+(0<n.textCollection.length?(n.textCollection.length-1)*this.maxItemHeight:0),i=(this.isVertical?r===s||l+e.textSize.height+a>o.y+o.height?(e.location.x=n.location.x+(r===s?0:this.isRtlEnable?-this.maxColumnWidth:this.maxColumnWidth),e.location.y=t.y,l=this.legend.shapeWidth/2+a,this.pageXCollections.push(e.location.x+(this.isRtlEnable?l:-l))):(e.location.x=n.location.x,e.location.y=n.location.y+n.textSize.height+this.itemPadding):(l=i+(this.legend.maximumLabelWidth||n.textSize.width),l=n.location.x+(this.isRtlEnable?-l:l),this.isWithinBounds(l,(this.legend.maximumLabelWidth||e.textSize.width)+i-this.itemPadding,o,this.legend.shapeWidth/2)?(r!==s&&this.chartRowCount++,e.location.y=r===s?n.location.y:n.location.y+this.rowHeights[this.chartRowCount-2]+a,e.location.x=t.x):(e.location.y=n.location.y,e.location.x=r===s?n.location.x:l)),this.getAvailWidth(e.location.x,this.legendBounds.width)),i=this.legend.maximumLabelWidth?Math.min(this.legend.maximumLabelWidth,i):i;"Ellipsis"===this.legend.textOverflow&&"Normal"===this.legend.textWrap&&(e.text=eve(+i.toFixed(4),e.text,this.legend.textStyle,this.chart.enableRtl,this.chart.themeStyle.legendLabelFont))},_Le.prototype.isWithinBounds=function(e,t,i,n){return this.isRtlEnable?e-t<i.x-n:e+t>i.x+i.width+n},_Le.prototype.getSmartLegendLocation=function(e,t,i){var n;switch(this.position){case"Left":n=(e.x-t.width-i.left)/2,t.x=e.x-t.width<i.left?t.x:e.x-t.width-n;break;case"Right":n=(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+n;break;case"Top":this.getTitleRect(this.chart),n=(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-n;break;case"Bottom":n=(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+n}},_Le.prototype.getTitleRect=function(e){if(!e.title)return null;var t=So(e.title,e.titleStyle,this.chart.themeStyle.legendTitleFont);this.titleRect=new Do(e.availableSize.width/2-t.width/2,e.margin.top,t.width,t.height)},_Le.prototype.legendByIndex=function(e,t){for(var i=0,n=t;i<n.length;i++){var o=n[i];if(o.pointIndex===e)return o}return null},_Le.prototype.click=function(e){var t=(-1<e.target.id.indexOf("_chart_legend_g_")?e.target.firstChild:e.target).id,i=this.chart,n=[this.legendID+"_text_",this.legendID+"_shape_",this.legendID+"_shape_marker_"];this.chart.animateSeries=!1;for(var o=0,r=n;o<r.length;o++){var s=r[o];if(-1<t.indexOf(s)){s=parseInt(t.split(s)[1],10);if(this.chart.legendSettings.toggleVisibility&&!isNaN(s)){var a=this.chart.visibleSeries[0],l=a.points[s],h=this.legendByIndex(s,this.legendCollections),d={legendText:h.text,legendShape:h.shape,chart:i,series:a,point:l,name:Nme,cancel:!1};if(this.chart.trigger(Nme,d),!d.cancel){l.visible=!l.visible,h.visible=l.visible,a.sumOfPoints+=l.visible?l.y:-l.y,i.redraw=i.enableAnimation,this.sliceVisibility(s,l.visible),i.removeSeriesElements(i),i.removeSvg();var p=document.getElementById(this.chart.element.id+"-svg-chart-3d");if(p)for(;0<p.childNodes.length;)p.removeChild(p.firstChild);this.chart.circular3DPolygon=[],this.chart.visibleSeries[0].segments=[],this.chart.animateSeries=!1,this.chart.calculateBounds(),this.chart.renderElements(),i.circularChartHighlight3DModule&&("None"!==i.highlightMode||i.legendSettings.enableHighlight)&&i.circularChartHighlight3DModule.redrawSelection(i)}}else this.chart.circularChartSelection3DModule&&!isNaN(s)?this.chart.circularChartSelection3DModule.legendSelection(this.chart,e.target,e.type):this.chart.circularChartHighlight3DModule&&!isNaN(s)&&this.chart.circularChartHighlight3DModule.legendSelection(this.chart,e.target,e.type)}}-1<t.indexOf(this.legendID+"_pageup")?this.changePage(e,!0):-1<t.indexOf(this.legendID+"_pagedown")&&this.changePage(e,!1),i.redraw=!1},_Le.prototype.sliceVisibility=function(e,t){var i;this.chart.element.id;this.chart.visibleSeries[0].dataLabel.visible&&(i=this.chart.element.id+"_datalabel_Series_0_",this.sliceAnimate(ie(i+"g_"+e),t))},_Le.prototype.sliceAnimate=function(e,t){if(!e)return null;new Vt({}).animate(e,{duration:300,delay:0,name:t?"FadeIn":"FadeOut",end:function(e){e.element.style.visibility=t?"visible":"hidden"}})},_Le.prototype.getModuleName=function(){return"CircularChartLegend3D"},_Le.prototype.destroy=function(){this.removeEventListener()};var VLe,RLe=_Le;function _Le(e){var t=VLe.call(this,e)||this;return(t.library=t).titleRect=new Do(0,e.margin.top,0,0),t.addEventListener(),t}HLe=function(e,t){return(HLe=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])}))(e,t)};var HLe,zLe,Gve=function(e,t){function i(){this.constructor=e}HLe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},jLe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},WLe=function(e,t,i){void 0===i&&(i=0),this.point=e,this.series=t,this.index=i},jLe=(Gve(QLe,zLe=n),jLe([e(!1)],QLe.prototype,"enable",void 0),jLe([e(!0)],QLe.prototype,"enableMarker",void 0),jLe([e(null)],QLe.prototype,"fill",void 0),jLe([e(null)],QLe.prototype,"header",void 0),jLe([e(null)],QLe.prototype,"opacity",void 0),jLe([t({fontFamily:null,size:"12px",fontStyle:"Normal",fontWeight:null,color:null},Tge)],QLe.prototype,"textStyle",void 0),jLe([e(null)],QLe.prototype,"format",void 0),jLe([e(null)],QLe.prototype,"template",void 0),jLe([e(!1)],QLe.prototype,"enableAnimation",void 0),jLe([e(300)],QLe.prototype,"duration",void 0),jLe([e(700)],QLe.prototype,"fadeOutDuration",void 0),jLe([e(!1)],QLe.prototype,"enableTextWrap",void 0),jLe([t({color:null,width:null},Rge)],QLe.prototype,"border",void 0),jLe([t({x:null,y:null},yge)],QLe.prototype,"location",void 0),QLe);function QLe(){return null!==zLe&&zLe.apply(this,arguments)||this}Gve(qLe,ULe=n),qLe.prototype.mouseLeaveHandler=function(){this.removeTooltip(this.control.tooltip.fadeOutDuration)},qLe.prototype.mouseUpHandler=function(e,t){this.control=t,this.element=t.element;var i=Math.abs(t.mouseX-t.cachedX)<10&&Math.abs(t.mouseY-t.cachedY)<10;this.control.tooltip.enable&&!t.rotateActivate&&i&&o0e(this.control.mouseX,this.control.mouseY,this.control.initialClipRect)&&this.control.isTouch?(this.tooltip(e),this.removeTooltip(2e3),this.tooltipRendered=!0):this.control.isTouch&&this.removeTooltip(0)},qLe.prototype.mouseMoveHandler=function(e,t){this.control=t,this.element=t.element,this.tooltipRendered||(this.control.tooltip.enable&&!t.rotateActivate&&o0e(this.control.mouseX,this.control.mouseY,this.control.initialClipRect)?this.tooltip(e):this.removeTooltip(0)),this.tooltipRendered=!1},qLe.prototype.tooltip=function(e){this.renderSeriesTooltip(this.control,this.getPieData(e,this.control))},qLe.prototype.getElement=function(e){return document.getElementById(e)},qLe.prototype.getTooltipElement=function(e){this.header=null===this.control.tooltip.header?"${series.name}":this.control.tooltip.header,this.formattedText=[];var t=document.getElementById(this.control.element.id+"_tooltip");return e||t?null:this.createElement()},qLe.prototype.createElement=function(){var e=document.createElement("div");return e.id=this.element.id+"_tooltip",e.className="ejSVGTooltip",e.style.pointerEvents="none",e.style.position="absolute",e.style.zIndex="1",e},qLe.prototype.renderSeriesTooltip=function(e,t){var i=this.getElement(this.element.id+"_tooltip_svg"),i=i&&0<parseInt(i.getAttribute("opacity"),10),n=this.getTooltipElement(i),i=!i;this.template=e.tooltip.template,this.currentPoints=[],t.point?this.pushData(t,n)&&this.triggerTooltipRender(t,i,this.getTooltipText(t,e.tooltip),this.findHeader(t)):!t.point&&this.isRemove&&(this.removeTooltip(this.control.tooltip.fadeOutDuration),this.isRemove=!1)},qLe.prototype.removeTooltip=function(e){var t=this,i=this.getElement(this.element.id+"_tooltip");this.stopAnimation(),i&&0<this.previousPoints.length&&(this.tooltipInterval=+setTimeout(function(){t.svgTooltip&&t.svgTooltip.fadeOut()},e))},qLe.prototype.stopAnimation=function(){H0e(this.tooltipInterval)},qLe.prototype.pushData=function(e,t){return!!e.series.enableTooltip&&(this.currentPoints.push(e),this.stopAnimation(),t&&!document.getElementById(t.id)&&document.getElementById(this.element.id+"_Secondary_Element").appendChild(t),!0)},qLe.prototype.triggerTooltipRender=function(i,n,e,t){function o(e){var t;e.cancel?(r.removeHighlight(),ue(r.getElement(r.element.id+"_tooltip"))):(r.formattedText=r.formattedText.concat(e.text),r.text=r.formattedText,r.headerText=e.headerText,t={x:null!==s.location.x?s.location.x:r.control.mouseX,y:null!==s.location.y?s.location.y:r.control.mouseY-10},r.createTooltip(r.control,n,t,i.series.clipRect,i.point,0,r.control.initialClipRect,null,i.point,r.template?e.template:"")),r.isRemove=!0}var r=this,s=this.control.tooltip,e={cancel:!1,text:e,point:i.point,textStyle:s.textStyle,series:i.series,headerText:t,template:this.template,data:{pointX:i.point.x,pointY:i.point.y,seriesIndex:i.series.index,pointIndex:i.point.index,pointText:i.point.text,seriesName:i.series.name}};o.bind(this,i),this.control.trigger(Xme,e,o)},qLe.prototype.getPieData=function(e,t){var i,n,t=t.visibleSeries[0],e=e.target;return-1<e.id.indexOf("point")&&-1<e.id.indexOf("series")?(i=parseInt(e.id.split("point-")[1],10),i=t.points[i]):-1<e.id.indexOf("-data-label-text")&&"Inside"===t.dataLabel.position?(n=parseInt(e.id.split("data-label-text-")[1],10),i=t.points[n]):-1<e.id.indexOf("data-label-series")&&"Inside"===t.dataLabel.position&&(n=parseInt(e.id.split("data-label-series-0-shape-")[1],10),i=t.points[n]),i?{point:i,series:t,index:i.index}:new WLe(null,null)},qLe.prototype.getTooltipText=function(e,t){var i=e.series,t=t.format||(-1<this.control.theme.indexOf("Tailwind3")?"${point.x} : ${point.y}":"${point.x} : <b>${point.y}</b>"),t=this.control.useGroupingSeparator?t.replace("${point.y}","${point.separatorY}"):t;return this.parseTemplate(e.point,i,t)},qLe.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:""},qLe.prototype.parseTemplate=function(e,t,i){for(var n,o=RegExp,r=0,s=Object.keys(e);r<s.length;r++){var a=new o("${point."+(l=s[r])+"}","gm");i=i.replace(a.source,e[l])}for(var l,h=0,d=Object.keys(Object.getPrototypeOf(t));h<d.length;h++)a=new o("${series."+(l=d[h])+"}","gm"),n=t[l],i=i.replace(a.source,n);return i},qLe.prototype.createTooltip=function(e,t,i,n,o,r,s,a,l,h){void 0===a&&(a=null),void 0===l&&(l=null);var d=e.circularChartTooltip3DModule;d&&null!==i?(t?(this.svgTooltip=new tr({opacity:e.tooltip.opacity||("Material3"===this.control.theme||"Material3Dark"===this.control.theme||-1<this.control.theme.indexOf("Bootstrap5")?1:.75),header:this.headerText,content:this.text,fill:e.tooltip.fill,border:e.tooltip.border,enableAnimation:e.tooltip.enableAnimation,location:i,shared:!1,crosshair:!1,shapes:e.tooltip.enableMarker?["Circle"]:[],clipBounds:n,areaBounds:s,palette:this.findPalette(),template:h||this.template,data:l,theme:e.theme,offset:r,textStyle:e.tooltip.textStyle,isNegative:!1,inverted:!1,arrowPadding:0,availableSize:e.availableSize,duration:this.control.tooltip.duration,isCanvas:!1,isFixed:null!==this.control.tooltip.location.x||null!==this.control.tooltip.location.y,isTextWrap:e.tooltip.enableTextWrap,blazorTemplate:{name:"Template",parent:this.control.tooltip},controlInstance:this.control,enableRTL:e.enableRtl,controlName:"Chart",allowHighlight:!1,tooltipRender:function(){d.removeHighlight(),d.highlightPoints(),d.updatePreviousPoint(a)},animationComplete:function(e){e.tooltip.fadeOuted&&d.fadeOut()}}),this.svgTooltip.appendTo(this.getElement(this.element.id+"_tooltip"))):this.svgTooltip&&(this.svgTooltip.location=i,this.svgTooltip.content=this.text,this.svgTooltip.header=this.headerText,this.svgTooltip.offset=r,this.svgTooltip.palette=this.findPalette(),this.svgTooltip.shapes=e.tooltip.enableMarker?["Circle"]:[],this.svgTooltip.data=l,this.svgTooltip.template=this.template,this.svgTooltip.controlName="Chart",this.svgTooltip.crosshair=!1,this.svgTooltip.textStyle=e.tooltip.textStyle,this.svgTooltip.isNegative=!1,this.svgTooltip.clipBounds=n,this.svgTooltip.arrowPadding=0,this.svgTooltip.allowHighlight=!1,this.svgTooltip.dataBind()),this.control.isReact&&this.control.renderReactTemplates()):Pye(this.control.element.id+"_tooltip")},qLe.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)}},qLe.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)},qLe.prototype.highlightPoint=function(t,i,e){var n=this;if(this.control.circularChartHighlight3DModule&&"None"===this.control.highlightMode||!this.control.circularChartHighlight3DModule){var o=document.querySelectorAll('[id*="region-series-0-point-'+i+'"]'),r=[],o=(o.forEach(function(e){parseInt(e.id.split("point-")[1],10)===i&&r.push(e)}),document.getElementById(this.control.element.id+"-svg-data-label-text-"+i)),s=document.getElementById(this.control.element.id+"-datalabel-series-0-connector-"+i),a=document.getElementById(this.control.element.id+"-svg-data-label-series-0-shape-"+i),o=(o&&r.push(o),s&&r.push(s),a&&r.push(a),document.getElementById(this.element.id+"-svg-chart-3d").children);if(o)for(var l=0,h=o;l<h.length;l++){var d,p=h[l];p.parentElement.id===this.control.groupElement.id&&(d=!p.hasAttribute("class")||-1===p.getAttribute("class").indexOf("_selection_"),p.setAttribute("opacity",(e&&"transparent"!==this.control.highlightColor&&d?.2:t.opacity).toString()))}r&&r.forEach(function(e){e.parentElement.id===n.control.groupElement.id&&e.setAttribute("opacity",t.opacity.toString())})}},qLe.prototype.fadeOut=function(){var e=this.getElement(this.element.id+"_tooltip_svg");e&&0<parseInt(e.getAttribute("opacity"),10)||(this.currentPoints=[],this.removeHighlight(),this.previousPoints=[],this.svgTooltip=null,this.control.trigger("animationComplete",{}))},qLe.prototype.updatePreviousPoint=function(e){e&&(this.currentPoints=this.currentPoints.concat(e)),this.previousPoints=Pe([],this.currentPoints,null,!0)},qLe.prototype.findPalette=function(){for(var e=[],t=0,i=this.currentPoints;t<i.length;t++){var n=i[t];e.push(n.point.color)}return e},qLe.prototype.getModuleName=function(){return"CircularChartTooltip3D"},qLe.prototype.destroy=function(){};var ULe,Gve=qLe;function qLe(){var e=null!==ULe&&ULe.apply(this,arguments)||this;return e.currentPoints=[],e.previousPoints=[],e.tooltipRendered=!1,e}GLe=function(e,t){return(GLe=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])}))(e,t)};var GLe,YLe,XLe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},XLe=(function(e,t){function i(){this.constructor=e}GLe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(KLe,YLe=Ji),Object.defineProperty(KLe.prototype,"type",{get:function(){return"Pie"},enumerable:!0,configurable:!0}),KLe.prototype.preRender=function(){var e;this.allowServerDataBinding=!1,this.unWireEvents(),this.titleLocation={x:0,y:0,size:new Eo(0,0)},this.subTitleLocation={x:0,y:0,size:new Eo(0,0)},this.circularRadius=[],this.innerRadius=[],this.matrixObj=new yLe,this.bspTreeObj=new ALe,this.polygon=new ELe,this.vector=new mLe(null,null,null),this.graphics=new CLe,this.transform3D=new bLe,this.svg3DRenderer=new ILe,this.circular3DPolygon=[],this.explodeDistance=0,this.setCulture(),this.animateSeries=!0,""===this.element.id&&(e=document.getElementsByClassName("e-circular3dchart").length,this.element.id="acc_chart_"+this.chartId+"_"+e),this.wireEvents(),this.element.setAttribute("dir",this.enableRtl?"rtl":""),this.element.style.outline="none"},KLe.prototype.unWireEvents=function(){var e=F.isPointer,t=F.touchStartEvent,i=F.touchMoveEvent,n=F.touchEndEvent,e=e?"pointerleave":"mouseleave";E.remove(this.element,i,this.chartOnMouseMove),E.remove(this.element,n,this.chartMouseUp),E.remove(this.element,t,this.chartMouseDown),E.remove(this.element,"click",this.chartOnMouseClick),E.remove(this.element,e,this.chartMouseLeave),E.remove(this.element,"keydown",this.circular3DChartKeyDown),E.remove(this.element,"keyup",this.circular3DChartKeyUp),window.removeEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.chartResizeBound)},KLe.prototype.chartOnMouseClick=function(e){var t,i,n;return this.setMouseXY(e),this.circularChartLegend3DModule&&this.legendSettings.visible&&this.circularChartLegend3DModule.click(e),"None"!==this.selectionMode&&this.circularChartSelection3DModule&&this.circularChartSelection3DModule.calculateSelectedElements(this,e.target,e.type),this.visibleSeries[0].explode&&(n=i=void 0,-1<(t=e.target.id).indexOf("-point-"))&&(i=t.split("-series-")[1].split("-point-"),n=parseInt(i[1],10),this.visibleSeries[0].explodeIndex===n||this.visibleSeries[0].points[n].isExplode?(this.visibleSeries[0].explodeIndex=null,this.visibleSeries[0].isExploded=!0,this.visibleSeries[0].points.forEach(function(e){e.isExplode=!1})):this.visibleSeries[0].explodeIndex=n,this.removeSeriesElements(this),this.visibleSeries[0].segments=[],this.circular3DPolygon=[],this.renderSeries(),this.processSelection(),this.delayRedraw=!0),this.trigger("circularChart3DMouseClick",{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.pointClick&&this.triggerPointEvent($me,e.target,e),this.removeNavigationStyle(),!1},KLe.prototype.triggerPointEvent=function(e,t,i){var n,o=this.visibleSeries[0];-1<t.id.indexOf("point")&&-1<t.id.indexOf("series")&&(t=parseInt(t.id.split("point-")[1],10),n=o.points[t]),n&&this.trigger(e,{series:o,point:n,seriesIndex:o.index,pointIndex:n.index,x:this.mouseX,y:this.mouseY,pageX:i.pageX,pageY:i.pageY})},KLe.prototype.chartOnMouseMove=function(e){var t,i;return ie(this.element.id+"_svg")&&(this.setMouseXY(e),this.trigger("circularChart3DMouseMove",{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.rotateActivate&&(i=this.previousCoords.x-this.mouseX,t=this.previousCoords.y-this.mouseY,i||t)&&(this.tilt-=t,this.rotation+=i,this.isTouch||((t=document.getElementById(this.groupElement.id)).innerHTML="",t.remove()),i={width:this.availableSize.width,height:this.availableSize.height},this.graphics.view(this.svgObject,this,this.rotation,this.tilt,i,0,this.depth),O0e(!1,this.svgObject,this.groupElement,this.redraw),this.setSeriesTabIndex(),this.previousCoords.y=this.mouseY,this.previousCoords.x=this.mouseX,this.circularChartHighlight3DModule&&"None"!==this.highlightMode&&(this.circularChartHighlight3DModule.calculateSelectedElements(this,document.getElementById(this.element.id+"-border"),"mousemove"),this.circularChartHighlight3DModule.previousSelectedElement=[]),this.processSelection()),this.pointMove&&this.triggerPointEvent(tfe,e.target,e),this.tooltip.enable&&this.circularChartTooltip3DModule&&this.circularChartTooltip3DModule.mouseMoveHandler(e,this),this.isTouch||this.titleTooltip(e,this.mouseX,this.mouseY),this.notify(F.touchMoveEvent,e)),!1},KLe.prototype.titleTooltip=function(e,t,i,n){var o=e.target.id,r=o===this.element.id+"-title"||o===this.element.id+"-sub-title"||o===this.element.id+"_chart_legend_title";-1<e.target.textContent.indexOf("...")&&r?Fye(o===this.element.id+"-title"?this.title:o===this.element.id+"-sub-title"?this.subTitle:this.legendSettings.title,t,i,this.element.offsetWidth,this.element.id+"_EJ2_Title_Tooltip",ie(this.element.id+"_Secondary_Element"),n):Pye(this.element.id+"_EJ2_Title_Tooltip")},KLe.prototype.setMouseXY=function(e){var t,i,n,o=ie(this.element.id+"_svg");o&&this.element&&(o=o.getBoundingClientRect(),t=this.element.getBoundingClientRect(),-1<e.type.indexOf("touch")?(this.isTouch=!0,i=e.changedTouches[0].clientY,n=e.changedTouches[0].clientX):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType,n=e.clientX,i=e.clientY),this.mouseY=i-t.top-Math.max(o.top-t.top,0),this.mouseX=n-t.left-Math.max(o.left-t.left,0))},KLe.prototype.wireEvents=function(){var e,t,i,n;this.element&&(n=F.isPointer,e=F.touchStartEvent,t=F.touchEndEvent,i=F.touchMoveEvent,n=n?"pointerleave":"mouseleave",E.add(this.element,i,this.chartOnMouseMove,this),E.add(this.element,t,this.chartMouseUp,this),E.add(this.element,e,this.chartMouseDown,this),E.add(this.element,"click",this.chartOnMouseClick,this),E.add(this.element,n,this.chartMouseLeave,this),E.add(this.element,"keydown",this.circular3DChartKeyDown,this),E.add(this.element,"keyup",this.circular3DChartKeyUp,this),this.chartResizeBound=this.chartResize.bind(this),window.addEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.chartResizeBound),this.setStyle(this.element))},KLe.prototype.chartMouseLeave=function(e){return this.setMouseXY(e),this.trigger("circularChart3DMouseLeave",{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.tooltip.enable&&this.circularChartTooltip3DModule&&this.circularChartTooltip3DModule.mouseLeaveHandler(),this.notify(F.isPointer?"pointerleave":"mouseleave",e),this.rotateActivate=!1},KLe.prototype.chartMouseUp=function(e){return this.setMouseXY(e),this.trigger("circularChart3DMouseUp",{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.isTouch&&this.titleTooltip(e,this.mouseX,this.mouseY,this.isTouch),this.rotateActivate=!1,this.tooltip.enable&&this.circularChartTooltip3DModule&&this.circularChartTooltip3DModule.mouseUpHandler(e,this),this.notify(F.touchEndEvent,e),!1},KLe.prototype.chartMouseDown=function(e){this.setMouseXY(e),this.trigger("circularChart3DMouseDown",{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.cachedX=this.mouseX,this.cachedY=this.mouseY;var e=ie(this.element.id+"_svg").getBoundingClientRect(),t=document.getElementById(this.element.id+"-svg-chart-3d").getBoundingClientRect(),e={x:t.left-e.left,y:t.top-e.top,width:t.width,height:t.height};return this.enableRotation&&o0e(this.mouseX,this.mouseY,e)&&(this.rotateActivate=!0,this.previousCoords={x:this.mouseX,y:this.mouseY}),!1},KLe.prototype.setStyle=function(e){e.style.touchAction=this.enableRotation?"none":"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",e.style.height=e.style.height||this.height&&-1===this.height.indexOf("%")?e.style.height:"inherit"},KLe.prototype.setCulture=function(){this.intl=new Ti},KLe.prototype.render=function(){var e=this,t=(-1===this.element.className.indexOf("e-circular3dchart")&&this.element.classList.add("e-circular3dchart"),this.element.setAttribute("role","region"),this.element.setAttribute("tabindex","0"),this.element.setAttribute("aria-label",this.title+". Syncfusion interactive chart."),this.element.setAttribute("class",this.element.getAttribute("class")+" e-circular3dchart-focused"),{chart:this,theme:this.theme,name:Vme,cancel:!1});this.trigger(Vme,t,function(){t.cancel||(e.setTheme(),e.calculateVisibleSeries(),e.processData(),e.renderComplete(),e.allowServerDataBinding=!0)})},KLe.prototype.setTheme=function(){this.themeStyle=function(e){var t;switch(e){case"HighContrastLight":case"HighContrast":t={chartTitle:"#ffffff",legendLabel:"#ffffff",background:"transparent",tooltipFill:"#ffffff",tooltipBoldLabel:"#000000",tooltipLightLabel:"#000000",tooltipHeaderLine:"#969696",tabColor:"#FFD939",chartTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#000000",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#969696",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"MaterialDark":case"FabricDark":case"BootstrapDark":t={chartTitle:"#ffffff",legendLabel:"#DADADA",background:"transparent",tooltipFill:"#F4F4F4",tooltipBoldLabel:"#282727",tooltipLightLabel:"#333232",tooltipHeaderLine:"#9A9A9A",tabColor:"MaterialDark"===e?"#00B0FF":"FabricDark"===e?"#0074CC":"#0070F0",chartTitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"FabricDark"===e?"#DADADA":"#FFFFFF",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"FabricDark"===e?"#DADADA":"#FFFFFF",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"FabricDark"===e?"#A19F9D":"#676767",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"MaterialDark"===e?"rgba(18, 18, 18, 1)":"FabricDark"===e?"#DADADA":"#1A1A1A",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.6)":"FabricDark"===e?"#A19F9D":"#676767",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"MaterialDark"===e?"rgba(255, 255, 255, 0.87)":"FabricDark"===e?"#DADADA":"#FFFFFF",fontFamily:"MaterialDark"===e?"Roboto":"FabricDark"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap4":t={chartTitle:"#212529",legendLabel:"#212529",background:"transparent",tooltipFill:"#020202",tooltipBoldLabel:"rgba(255,255,255)",tooltipLightLabel:"rgba(255,255,255, 0.9)",tooltipHeaderLine:"rgba(255,255,255, 0.2)",tabColor:"#007BFF",chartTitleFont:{color:"#212529",fontFamily:"Helvetica",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#212529",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#666666",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#495057",fontFamily:"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#212529",fontFamily:"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Tailwind3":t={chartTitle:"#111827",legendLabel:"#6B7280",background:"transparent",tooltipFill:"#111827",tooltipBoldLabel:"#F9FAFB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#D1D5DB",tabColor:"#4F46E5",chartTitleFont:{color:"#111827",fontFamily:"Inter",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#374151",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},legendLabelFont:{color:"#6B7280",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Inter",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#4B5563",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#6B7280",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"}};break;case"Tailwind3Dark":t={chartTitle:"#FFFFFF",legendLabel:"#9CA3AF",background:"transparent",tooltipFill:"#F9FAFB",tooltipBoldLabel:"#1F2937",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#374151",tabColor:"#22D3EE",chartTitleFont:{color:"#FFFFFF",fontFamily:"Inter",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#E5E7EB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},legendLabelFont:{color:"#9CA3AF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"500"},tooltipLabelFont:{color:"#1F2937",fontFamily:"Inter",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#9CA3AF",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"500"}};break;case"Tailwind":t={chartTitle:"#374151",legendLabel:"#374151",background:"transparent",tooltipFill:"#111827",tooltipBoldLabel:"#D1D5DB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#6B7280",tabColor:"#4F46E5",chartTitleFont:{color:"#374151",fontFamily:"Inter",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Inter",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#6B7280",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#374151",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"TailwindDark":t={chartTitle:"#D1D5DB",legendLabel:"#D1D5DB",background:"transparent",tooltipFill:"#F9FAFB",tooltipBoldLabel:"#6B7280",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#9CA3AF",tabColor:"#22D3EE",chartTitleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#1F2937",fontFamily:"Inter",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#9CA3AF",fontFamily:"Inter",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#D1D5DB",fontFamily:"Inter",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Bootstrap5":t={chartTitle:"#212529",legendLabel:"#212529",background:"transparent",tooltipFill:"#000000E5",tooltipBoldLabel:"#F9FAFB",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#FFFFFF",tabColor:"#0D6EFD",chartTitleFont:{color:"#212529",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#21252980",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"}};break;case"Bootstrap5Dark":t={chartTitle:"#DEE2E6",legendLabel:"#DEE2E6",background:"transparent",tooltipFill:"#E9ECEF",tooltipBoldLabel:"#212529",tooltipLightLabel:"#212529",tooltipHeaderLine:"#212529",tabColor:"#0D6EFD",chartTitleFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#212529",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#DEE2E6",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#DEE2E680",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"}};break;case"Fluent":t={chartTitle:"#201F1E",legendLabel:"#323130",background:"transparent",tooltipFill:"#FFFFFF",tooltipBoldLabel:"#323130",tooltipLightLabel:"#323130",tooltipHeaderLine:"#D2D0CE",tabColor:"#0078D4",chartTitleFont:{color:"#201F1E",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#201F1E",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#49454E",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#323130",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#3B3A39",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#323129",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"FluentDark":t={chartTitle:"#F3F2F1",legendLabel:"#D2D0CE",background:"transparent",tooltipFill:"#252423",tooltipBoldLabel:"#F3F2F1",tooltipLightLabel:"#F3F2F1",tooltipHeaderLine:"#3B3A39",tabColor:"#0078D4",chartTitleFont:{color:"#C8C6C4",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#F3F2F1",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#D2D0CE",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F3F2F1",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#D2D0CE",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#F3F2F1",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Fluent2":t={chartTitle:"#242424",legendLabel:"#242424",background:"transparent",tooltipFill:"#FFFFFF",tooltipBoldLabel:"#242424",tooltipLightLabel:"#242424",tooltipHeaderLine:"#D2D0CE",tabColor:"#0078D4",chartTitleFont:{color:"#242424",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#242424",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#616161",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"}};break;case"Fluent2Dark":t={chartTitle:"#FFFFFF",legendLabel:"#FFFFFF",background:"transparent",tooltipFill:"#292929",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#3B3A39",tabColor:"#0078D4",chartTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#ADADAD",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"}};break;case"Fluent2HighContrast":t={chartTitle:"#FFFFFF",legendLabel:"#FFFFFF",background:"transparent",tooltipFill:"#000000",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#3B3A39",tabColor:"#0078D4",chartTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#FFFFFF",fontFamily:"Segoe UI",size:"14px",fontStyle:"Normal",fontWeight:"600"}};break;case"Material3":t={chartTitle:"#1C1B1F",legendLabel:"#49454E",background:"transparent",tooltipFill:"#313033",tooltipBoldLabel:"#F4EFF4",tooltipLightLabel:"#F4EFF4",tooltipHeaderLine:"#F4EFF4",tabColor:"#49454E",chartTitleFont:{color:"#1C1B1F",fontFamily:"Roboto",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#1C1B1F",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#49454E",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#F4EFF4",fontFamily:"Roboto",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#49454E",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#49454E",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;case"Material3Dark":t={chartTitle:"#E6E1E5",legendLabel:"#CAC4D0",background:"transparent",tooltipFill:"#E6E1E5",tooltipBoldLabel:"#313033",tooltipLightLabel:"#313033",tooltipHeaderLine:"#313033",tabColor:"#CAC4D0",chartTitleFont:{color:"#E6E1E5",fontFamily:"Roboto",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"#E6E1E5",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"#313033",fontFamily:"Roboto",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"#CAC4D0",fontFamily:"Roboto",size:"14px",fontStyle:"Normal",fontWeight:"400"}};break;default:t={chartTitle:"#424242",legendLabel:"#353535",background:"transparent",tooltipFill:"#000816",tooltipBoldLabel:"#ffffff",tooltipLightLabel:"#dbdbdb",tooltipHeaderLine:"#ffffff",tabColor:"Material"===e?"#ff4081":"Fabric"===e?"#0078D6":"#317AB9",chartTitleFont:{color:"Material"===e?"rgba(0, 0, 0, 1)":"Fabric"===e?"#333333":"#212529",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"16px",fontStyle:"Normal",fontWeight:"600"},legendTitleFont:{color:"Material"===e?"rgba(0, 0, 0, 1)":"Fabric"===e?"#333333":"#212529",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"600"},legendLabelFont:{color:"Material"===e?"rgba(97, 97, 97, 1)":"#666666",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"},tooltipLabelFont:{color:"Material"===e?"rgba(249, 250, 251, 1)":"Fabric"===e?"#333333":"#F9FAFB",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal"},datalabelFont:{color:"Material"===e?"rgba(97, 97, 97, 1)":"Fabric"===e?"#666666":"#676767",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"12px",fontStyle:"Normal",fontWeight:"400"},chartSubTitleFont:{color:"Material"===e?"rgba(0, 0, 0, 1)":"Fabric"===e?"#333333":"#212529",fontFamily:"Material"===e?"Roboto":"Fabric"===e?"Segoe UI":"Helvetica",size:"14px",fontStyle:"Normal",fontWeight:"400"}}}return t}(this.theme)},KLe.prototype.processData=function(e){void 0===e&&(e=!0);for(var t=this.seriesCounts=0,i=this.visibleSeries;t<i.length;t++){var n=i[t];n.dataModule=new Cbe(n.dataSource||this.dataSource,n.query),n.refreshDataManager(this,e)}},KLe.prototype.refreshChart=function(){this.createPieSvg(),this.calculateBounds(),this.circular3DPolygon=[],this.visibleSeries[0].segments=[],this.groupElement=this.renderer.createGroup({id:this.element.id+"-svg-chart-3d"}),this.groupElement.setAttribute("role","region"),this.groupElement.setAttribute("aria-hidden","false"),this.renderElements(),Pye("chartmeasuretext")},KLe.prototype.renderElements=function(){this.renderBorder(),this.createSecondaryElement(),this.renderTitle(),this.renderSeries(),this.renderLegend(),O0e(!1,this.element,this.svgObject,this.redraw),this.processSelection(),this.setSecondaryElementPosition(),this.trigger("loaded",{chart:this}),this.setSeriesTabIndex(),this.doAnimation(),this.animateSeries=!1},KLe.prototype.setSeriesTabIndex=function(){for(var e,t=0;t<this.visibleSeries[0].points.length;t++)if(this.visibleSeries[0].points[t].visible){e=document.querySelectorAll('[id*="region-series-0-point-'+this.visibleSeries[0].points[t].index+'"]');break}e&&0<e.length&&e[e.length-1].setAttribute("tabindex","0")},KLe.prototype.processSelection=function(){var e=[];this.circularChartSelection3DModule&&"None"!==this.selectionMode&&(e=Pe([],this.circularChartSelection3DModule.selectedDataIndexes,null,!0),this.circularChartSelection3DModule.invokeSelection(this)),this.circularChartHighlight3DModule&&this.circularChartHighlight3DModule.invokeHighlight(this),0<e.length&&(this.circularChartSelection3DModule.selectedDataIndexes=e,this.circularChartSelection3DModule.redrawSelection(this))},KLe.prototype.highlightAnimation=function(t,e,i){var n=parseFloat(this.visibleSeries[0].opacity.toString());n&&new Vt({}).animate(t,{duration:e,progress:function(e){t.style.animation="";e=e.timeStamp/e.duration,e=i+(n-i)*e;t.setAttribute("opacity",e.toString())},end:function(){t.setAttribute("opacity",n.toString())}})},KLe.prototype.stopElementAnimation=function(e){var t=parseFloat(this.visibleSeries[0].opacity.toString());e.getAttribute("e-animate")&&Vt.stop(e),e.setAttribute("opacity",t.toString())},KLe.prototype.doAnimation=function(){var t,e,i,n,o=this.visibleSeries[0];o.animation.enable&&this.animateSeries&&(t=this.renderer.createClipPath({id:this.element.id+"SeriesGroup0_clipPath"}),e=new No(this.element.id+"SeriesGroup0_slice","transparent",1,"transparent",1,"",""),e=this.renderer.drawPath(e),t.appendChild(e),this.svgObject.appendChild(t),i=this.element.id,n=this.groupElement.id,document.querySelectorAll('[id*="region-series-"]').forEach(function(e){e.parentElement.id===n&&(e.style.cssText="clip-path:url(#"+t.id+"); -webkit-clip-path:url(#"+t.id+");",e.setAttribute("clip-path","url(#"+i+"SeriesGroup0_clipPath)"))}),o.segments[0])&&this.animationRect(e,o)},KLe.prototype.renderLegend=function(){if(!this.circularChartLegend3DModule||!this.legendSettings.visible)return null;this.circularChartLegend3DModule.legendCollections.length&&this.visibleSeries[0].labelBound&&this.circularChartLegend3DModule.getSmartLegendLocation(this.visibleSeries[0].labelBound,this.circularChartLegend3DModule.legendBounds,this.margin),this.circularChartLegend3DModule.renderLegend(this,this.legendSettings,this.circularChartLegend3DModule.legendBounds,this.redraw)},KLe.prototype.animationRect=function(i,n){for(var t,o=this,e=n.animation.duration,r=.75*Math.max(this.availableSize.height,this.availableSize.width),s=(r+=.414*r,p0e("Linear")),a={x:n.segments[0].center.x-this.rotation/2,y:n.segments[0].center.y+this.tilt/2},l=0;l<n.points.length;l++){var h=ie(this.element.id+"-svg-data-label-text-"+l),h=(h&&(h.style.visibility="hidden"),ie(this.element.id+"-svg-data-label-series-0-shape-"+l)),h=(h&&(h.style.visibility="hidden"),ie(this.element.id+"-series-"+n.index+"-data-label-"+l)),h=(h&&(h.style.visibility="hidden"),ie(this.element.id+"-datalabel-series-0-connector-"+l));h&&(h.style.visibility="hidden")}je(i)||new Vt({}).animate(i,{duration:0===e&&"Enable"===Ut?1e3:e,delay:n.animation.delay,progress:function(e){t=s(e.timeStamp,-90,359.99999,e.duration),i.setAttribute("d",o.getPathArc(a,-90,t,r))},end:function(){i.setAttribute("d",o.getPathArc(a,0,359.99999,r)),o.trigger(_me,{series:n,chart:o});for(var e=0;e<n.points.length;e++){var t=ie(o.element.id+"-svg-data-label-text-"+e),t=(t&&(t.style.visibility="visible"),ie(o.element.id+"-svg-data-label-series-0-shape-"+e)),t=(t&&(t.style.visibility="visible"),ie(o.element.id+"-series-"+n.index+"-data-label-"+e)),t=(t&&(t.style.visibility="visible"),ie(o.element.id+"-datalabel-series-0-connector-"+e));t&&(t.style.visibility="visible")}}})},KLe.prototype.getPathArc=function(e,t,i,n){var o=i-t,o=(o<0?360+o:o)<180?0:1;return this.getPiePath(e,jye(t,n,e),jye(i,n,e),n,o)},KLe.prototype.getPiePath=function(e,t,i,n,o){return"M "+e.x+" "+e.y+" L "+t.x+" "+t.y+" A "+n+" "+n+" 0 "+o+" 1 "+i.x+" "+i.y+" Z"},KLe.prototype.renderBorder=function(){var e=this.border.width,t=new vve(this.element.id+"-border",this.background||this.themeStyle.background,this.border,1,new Do(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e)),t=this.renderer.drawRectangle(t),t=(t.setAttribute("aria-hidden","true"),O0e(!1,this.svgObject,t,this.redraw),this.backgroundImage);t&&(e=new Cve(this.availableSize.height-e,this.availableSize.width-e,t,0,0,this.element.id+"-background","visible","none"),O0e(!1,this.svgObject,this.renderer.drawImage(e),this.redraw))},KLe.prototype.createSecondaryElement=function(){var e=nve(this.redraw,this.element.id+"_Secondary_Element")||this.createElement("div",{id:this.element.id+"_Secondary_Element",styles:"position: relative"});O0e(!1,this.element,e,this.redraw)},KLe.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.pieSeries3DModule&&(i.draw(i,this),this.defaultLabelBound(i))}},KLe.prototype.defaultLabelBound=function(e){var t;0<e.segments.length&&e.dataLabel.visible&&(t=this.getSeriesBound(e),e.dataLabel.visible&&"Inside"===e.dataLabel.position&&(e.labelBound=new Do(t.x,t.y,t.width+t.x,t.height+t.y)),e.findMaxBounds(e.labelBound,t),this.circularChartLegend3DModule)&&(e.labelBound.x-=this.explodeDistance,e.labelBound.y-=this.explodeDistance,e.labelBound.height+=this.explodeDistance-e.labelBound.y,e.labelBound.width+=this.explodeDistance-e.labelBound.x)},KLe.prototype.getSeriesBound=function(e){var t=new Do(1/0,1/0,-1/0,-1/0),i=(e.findMaxBounds(t,this.getRectFromAngle(0)),e.findMaxBounds(t,this.getRectFromAngle(360)),e.findMaxBounds(t,new Do(e.segments[0].center.x,e.segments[0].center.y,0,0)),(90*Math.floor(0)+90)%360),n=0==(n=90*Math.floor(4)%360)?360:n;e.findMaxBounds(t,this.getRectFromAngle(i)),e.findMaxBounds(t,this.getRectFromAngle(n)),e.findMaxBounds(t,this.getRectFromAngle(0));for(var o=i===n?0:Math.floor(4),r=1;r<o;r++)e.findMaxBounds(t,this.getRectFromAngle(i+=90));return t.width-=t.x,t.height-=t.y,t},KLe.prototype.getRectFromAngle=function(e){e=jye(e,this.circularRadius[0],this.visibleSeries[0].segments[0].center);return new Do(e.x,e.y,0,0)},KLe.prototype.renderTitle=function(){var e=this.margin;if(!this.title)return null;var t=this.getTextAnchor(this.titleStyle.textAlignment,this.enableRtl),i=So(this.title,this.titleStyle,this.themeStyle.chartTitleFont),n=this.margin.top+3*i.height/4,e=new Do(e.left,0,this.availableSize.width-e.left-e.right,0),e=new ko(this.element.id+"-title",dve(e,this.titleStyle),n,t,this.titleCollection,"","auto"),n=(this.titleLocation={x:e.x,y:e.y,size:i},sve(this.renderer,e,this.titleStyle,this.titleStyle.color||this.themeStyle.chartTitleFont.color,this.svgObject,!1,this.redraw,null,null,null,null,0,null,null,null,this.themeStyle.chartTitleFont));n&&(n.setAttribute("tabindex","0"),n.style.outline="none",n.parentNode.insertBefore(n,this.svgObject.children&&this.svgObject.children[1])),this.subTitle&&this.renderSubTitle(e)},KLe.prototype.getTextAnchor=function(e,t){switch(e){case"Near":return t?"end":"start";case"Far":return t?"start":"end";default:return"middle"}},KLe.prototype.renderSubTitle=function(e){for(var t=0,i=this.titleStyle.textAlignment,n=So(this.subTitle,this.subTitleStyle,this.themeStyle.chartSubTitleFont),o=0,r=this.titleCollection;o<r.length;o++)var s,t=t<(s=So(r[o],this.titleStyle,this.themeStyle.chartTitleFont).width)?s:t;i=new Do("Center"===i?e.x-t/2:"Far"===i?e.x-t:e.x,0,t,0),i=new ko(this.element.id+"-sub-title",dve(i,this.subTitleStyle),e.y*e.text.length+3*n.height/4+10,this.getTextAnchor(this.subTitleStyle.textAlignment,this.enableRtl),this.subTitleCollection,"","auto");this.subTitleLocation={x:i.x,y:i.y,size:n},sve(this.renderer,i,this.subTitleStyle,this.subTitleStyle.color||this.themeStyle.chartSubTitleFont.color,this.svgObject,!1,this.redraw,null,null,null,null,0,null,null,null,this.themeStyle.chartSubTitleFont)},KLe.prototype.setSecondaryElementPosition=function(){var e,t,i=ie(this.element.id+"_Secondary_Element");i&&(e=this.element.getBoundingClientRect(),t=ie(this.element.id+"_svg").getBoundingClientRect(),i.style.left=Math.max(t.left-e.left,0)+"px",i.style.top=Math.max(t.top-e.top,0)+"px")},KLe.prototype.createPieSvg=function(){this.removeSvg(),lve(this)},KLe.prototype.removeSvg=function(){if(this.redraw)return null;if(Pye(this.element.id+"_Secondary_Element"),this.svgObject){for(;0<this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&ue(this.svgObject)}Pye("EJ2_legend_tooltip"),Pye("EJ2_datalabel_tooltip"),Pye(this.element.id+"PointHover_Border")},KLe.prototype.calculateVisibleSeries=function(){this.visibleSeries=[],this.series[0].index=0,this.visibleSeries.push(this.series[0])},KLe.prototype.calculateBounds=function(){this.initialClipRect=new Do(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height),this.titleCollection=[],this.subTitleCollection=[];var e,t=0,i=0;if(this.title&&(this.titleCollection=hve(this.title,this.titleStyle,this.initialClipRect.width,this.enableRtl,this.themeStyle.chartTitleFont)),e=this.title?So(this.title,this.titleStyle,this.themeStyle.chartTitleFont).height*this.titleCollection.length:0,this.subTitle){for(var n=0,o=this.titleCollection;n<o.length;n++)var r,i=i<(r=So(o[n],this.titleStyle,this.themeStyle.chartTitleFont).width)?r:i;this.subTitleCollection=hve(this.subTitle,this.subTitleStyle,i,this.enableRtl,this.themeStyle.chartSubTitleFont),t=So(this.subTitle,this.subTitleStyle,this.themeStyle.chartSubTitleFont).height*this.subTitleCollection.length}zye(this.initialClipRect,new Do(0,t+e,this.margin.right+this.margin.left,this.margin.bottom+this.margin.top)),this.calculateLegendBounds()},KLe.prototype.calculateLegendBounds=function(){if(!this.circularChartLegend3DModule||!this.legendSettings.visible)return null;this.circularChartLegend3DModule.getLegendOptions(this,this.visibleSeries),this.circularChartLegend3DModule.calculateLegendBounds(this.initialClipRect,this.availableSize,null)},KLe.prototype.print=function(e){new zbe(this).print(e)},KLe.prototype.export=function(e,t){this.circularChartExport3DModule&&(this.circularChartExport3DModule.export(e,t),this.afterExport)&&this.circularChartExport3DModule.getDataUrl(this)},KLe.prototype.pdfExport=function(e,t,i,n,o,r,s,a,l){this.circularChartExport3DModule&&this.circularChartExport3DModule.pdfExport(e,t,i,n,o,r,s,a,l)},KLe.prototype.requiredModules=function(){var e=[];return e.push({member:this.type+"Series3D",args:[this]}),this.legendSettings.visible&&e.push({member:"CircularChartLegend3D",args:[this]}),this.series[0].dataLabel.visible&&e.push({member:"CircularChartDataLabel3D",args:[this]}),this.tooltip.enable&&e.push({member:"CircularChartTooltip3D",args:[this]}),"None"!==this.selectionMode&&e.push({member:"CircularChartSelection3D",args:[this]}),"None"===this.highlightMode&&!this.legendSettings.enableHighlight||e.push({member:"CircularChartHighlight3D",args:[this]}),this.enableExport&&e.push({member:"CircularChartExport3D",args:[this]}),e},KLe.prototype.setNavigationStyle=function(e){var t="";switch(this.theme){case"HighContrastLight":case"HighContrast":t="#969696";break;case"MaterialDark":case"FabricDark":case"Bootstrap":case"Bootstrap4":t="#66afe9";break;case"Tailwind":case"TailwindDark":t="#4f46e5";break;case"Bootstrap5":case"Bootstrap5Dark":t="#0d6efd";break;case"Fluent":case"FluentDark":t="#9e9e9e";break;case"Fluent2":case"Fluent2Dark":case"Fluent2HighContrast":t="#0078D4";break;default:t="#9e9e9e"}e=document.getElementById(e);e&&e.style.setProperty("outline","1.5px solid "+t)},KLe.prototype.removeNavigationStyle=function(){var e=document.querySelectorAll("path[id*=_Series_0_Point_], [id*="+this.element.id+"], [id*=_ChartBorder], text[id*=_title],g[id*=_chart_legend]");e&&e.forEach(function(e){(e instanceof HTMLElement||e instanceof SVGElement)&&e.style.setProperty("outline","none")})},KLe.prototype.circular3DChartKeyDown=function(e){var t="";return this.tooltip.enable&&("Tab"===e.code&&-1<this.previousTargetId.indexOf("series")||-1<this.previousTargetId.indexOf("legend")||"Escape"===e.code)&&(t="ESC"),-1<e.code.indexOf("Arrow")&&e.preventDefault(),e.ctrlKey&&"p"===e.key&&(e.preventDefault(),t="CtrlP"),""!==t&&this.chartKeyboardNavigations(e,e.target.id,t),"Tab"===e.code&&this.removeNavigationStyle(),!1},KLe.prototype.chartKeyboardNavigations=function(e,t,i){switch(this.isLegendClicked=!1,i){case"Tab":case"ArrowMove":var n,o,r;if(-1<t.indexOf("-point-")&&(n=parseInt(t.split("point-")[1],10),s=(o=this.visibleSeries[0].points[n]).symbolLocation.center,r=(r=o.symbolLocation.radius*this.visibleSeries[0].coefficient)+(o.symbolLocation.radius-r)/2,this.mouseX=s.x+r*Math.cos(o.symbolLocation.angle),this.mouseY=s.y+r*Math.sin(o.symbolLocation.angle),this.circularChartHighlight3DModule&&!je(s=ie(t))&&(1<s.id.indexOf("text")&&(s=ie(s.id.replace("text","shape"))),(this.circularChartSelection3DModule||this.circularChartHighlight3DModule).calculateSelectedElements(this,s,"mousemove")),this.circularChartTooltip3DModule)&&(r=void 0,(o=this.visibleSeries[0]).enableTooltip&&(r=new WLe(o.points[n],o)),this.circularChartTooltip3DModule.element=this.element,(this.circularChartTooltip3DModule.control=this).circularChartTooltip3DModule.renderSeriesTooltip(this,r)),this.circularChartHighlight3DModule&&"None"!==this.highlightMode){t=-1<t.indexOf("_chart_legend_g_")?document.getElementById(t).firstChild.id:t;for(var s=this.element.id+"_chart_legend",a=[s+"_text_",s+"_shape_marker_",s+"_shape_"],l=0;l<a.length;l++)if(-1<t.indexOf(a[l])){document.getElementById(t).setAttribute("class",""),(this.circularChartSelection3DModule||this.circularChartHighlight3DModule).legendSelection(this,ie(t),"mousemove");break}}break;case"Enter":case"Space":-1<t.indexOf("_chart_legend_")&&this.circularChartLegend3DModule?(this.isLegendClicked=!0,this.circularChartLegend3DModule.click(e),this.focusChild(document.getElementById(t).parentElement),this.setNavigationStyle(document.getElementById(t).parentElement.id)):(this.circularChartSelection3DModule&&this.circularChartSelection3DModule.calculateSelectedElements(this,document.getElementById(t),"click"),this.setNavigationStyle(t));break;case"CtrlP":this.print();break;case"ESC":this.circularChartTooltip3DModule&&this.circularChartTooltip3DModule.removeTooltip(1),this.circularChartSelection3DModule?this.circularChartSelection3DModule.calculateSelectedElements(this,document.getElementById(this.element.id+"-border"),"mousemove"):this.circularChartHighlight3DModule&&"None"!==this.highlightMode&&this.circularChartHighlight3DModule.calculateSelectedElements(this,document.getElementById(this.element.id+"-border"),"mousemove")}},KLe.prototype.focusChild=function(e){e.setAttribute("tabindex","0");var t=e.getAttribute("class");return e.setAttribute("tabindex","0"),t=t&&-1===t.indexOf("e-circular3dchart-focused")?"e-circular3dchart-focused "+t:t||"e-circular3dchart-focused",e.setAttribute("class",t),e.focus(),e.id},KLe.prototype.circular3DChartKeyUp=function(e){var t="",i=e.target.id,n=ie(this.element.id+"_chart_legend_translate_g"),o=ie(this.element.id+"_chart_legend_pageup");if(n&&((h=(r=n.firstElementChild).getAttribute("class"))&&-1===h.indexOf("e-circular3dchart-focused")?h+=" e-circular3dchart-focused":h=h||"e-circular3dchart-focused",r.setAttribute("class",h)),o&&o.setAttribute("class","e-circular3dchart-focused"),this.removeNavigationStyle(),"Tab"===e.code)""!==this.previousTargetId&&(-1<this.previousTargetId.indexOf("-point-")&&-1===i.indexOf("-point-")?this.currentPointIndex=0:-1<this.previousTargetId.indexOf("_chart_legend_page")&&-1===i.indexOf("_chart_legend_page")&&-1===i.indexOf("_chart_legend_g_")?this.setTabIndex(e.target,o):-1<this.previousTargetId.indexOf("_chart_legend_g_")&&-1===i.indexOf("chart_legend_g_")?this.setTabIndex(n.children[this.currentLegendIndex],n.firstElementChild):-1<this.previousTargetId.indexOf("-title")&&-1<i.indexOf("-point-")&&(this.currentPointIndex=parseInt(i.split("point-")[1],10))),-1<(this.previousTargetId=i).indexOf("_chart_legend_g_")&&"None"!==this.highlightMode?(i=e.target.lastElementChild.id,t="Tab"):-1<i.indexOf("-point-")&&("None"!==this.highlightMode||this.tooltip.enable)&&(t="Tab");else if(-1<e.code.indexOf("Arrow")){if(e.preventDefault(),-1<i.indexOf("_chart_legend_page"))e.target.removeAttribute("tabindex"),this.previousTargetId=i=this.element.id+"_chart_legend_page"+("ArrowRight"===e.code?"up":"down"),this.focusTarget(ie(i));else if(-1<i.indexOf("_chart_legend_")){e.target.removeAttribute("tabindex"),this.currentLegendIndex+="ArrowUp"===e.code||"ArrowRight"===e.code?1:-1,this.currentLegendIndex=this.getActualIndex(this.currentLegendIndex,n.children.length);var r=n.children[this.currentLegendIndex];this.focusTarget(r),this.removeNavigationStyle(),this.setNavigationStyle(r.id),this.previousTargetId=i=r.lastElementChild.id,t="None"!==this.highlightMode?"ArrowMove":""}else if(-1<i.indexOf("-point-")){e.target.setAttribute("tabindex","-1");for(var s=0,a=[],l=0;l<this.visibleSeries[0].points.length;l++){s=this.visibleSeries[0].points[l].visible?s+1:s;this.visibleSeries[0].points[l].visible&&a.push(this.visibleSeries[0].points[l].index)}this.currentPointIndex=a.indexOf(this.currentPointIndex)+("ArrowUp"===e.code||"ArrowRight"===e.code?1:-1),this.currentPointIndex=a[this.getActualIndex(this.currentPointIndex,a.length)];var h=document.querySelectorAll('[id*="region-series-0-point-'+this.currentPointIndex+'"]'),o=void 0,i=(o=0<h.length?h[h.length-1]:o)?o.id:"";this.focusTarget(ie(i)),this.removeNavigationStyle(),this.setNavigationStyle(i),t=this.tooltip.enable||this.circularChartHighlight3DModule?"ArrowMove":""}}else"Enter"!==e.code&&"Space"!==e.code||!(-1<i.indexOf("_chart_legend_")||-1<i.indexOf("-point-"))||(i=-1<i.indexOf("_chart_legend_g")?e.target.lastElementChild.id:i,t="Enter");return""!==t&&this.chartKeyboardNavigations(e,i,t),"Tab"===e.code&&this.setNavigationStyle(i),!1},KLe.prototype.getActualIndex=function(e,t){return t-1<e?0:e<0?t-1:e},KLe.prototype.focusTarget=function(e){var t=e.getAttribute("class");return e.setAttribute("tabindex","0"),t&&-1===t.indexOf("e-circular3dchart-focused")?t+=" e-circular3dchart-focused":t=t||"e-circular3dchart-focused",e.setAttribute("tabindex","0"),e.setAttribute("class",t),e.focus(),e.id},KLe.prototype.setTabIndex=function(e,t){e&&e.removeAttribute("tabindex"),t&&t.setAttribute("tabindex","0")},KLe.prototype.getPersistData=function(){return""},KLe.prototype.getModuleName=function(){return"circularchart3d"},KLe.prototype.destroy=function(){var e;this.element&&(this.unWireEvents(),this.circular3DPolygon=[],this.visibleSeries[0].segments=[],YLe.prototype.destroy.call(this),this.element.classList.remove("e-circular3dchart"),this.element.classList.remove("e-circular3dchart-focused"),(e=document.getElementById(this.element.id+"Keyboard_circular3dchart_focus"))&&e.remove(),(e=document.getElementById(this.element.id+"_ej2_chart_highlight"))&&e.remove(),(e=document.getElementById(this.element.id+"_ej2_chart_selection"))&&e.remove(),Pye("chartmeasuretext"),this.removeSvg(),this.svgObject=null)},KLe.prototype.chartResize=function(){var e=this,t=(this.animateSeries=!1,{previousSize:new Eo(this.availableSize.width,this.availableSize.height),currentSize:new Eo(0,0),chart:this}),i={cancel:!1};return this.resizeTo&&clearTimeout(this.resizeTo),this.trigger(hfe,i),i.cancel||(this.resizeTo=+setTimeout(function(){e.isDestroyed?clearTimeout(e.resizeTo):(ave(e),t.currentSize=e.availableSize,e.trigger(lfe,t),e.refreshChart())},500)),!1},KLe.prototype.changeVisibleSeries=function(e,t){for(var i=0,n=e;i<n.length;i++){var o=n[i];if(t===o.index)return o}return null},KLe.prototype.removeSeriesElements=function(t){document.querySelectorAll('[id*="region-series-"]').forEach(function(e){if(e.parentElement.id===t.groupElement.id)return e.remove()}),document.querySelectorAll('[id*="data-label-text-"]').forEach(function(e){if(e.parentElement.id===t.groupElement.id)return e.remove()}),document.querySelectorAll('[id*="data-label-series-0-shape-"]').forEach(function(e){if(e.parentElement.id===t.groupElement.id)return e.remove()}),document.querySelectorAll('[id*="datalabel-series-0-connector-"]').forEach(function(e){if(e.parentElement.id===t.groupElement.id)return e.remove()})},KLe.prototype.onPropertyChanged=function(e,t){for(var i={refreshElements:!1,refreshBounds:!1},n=0,o=Object.keys(e);n<o.length;n++){switch(o[n]){case"theme":this.animateSeries=!0;break;case"title":case"subTitle":case"height":case"width":case"margin":case"enableRotation":case"depth":i.refreshBounds=!0;break;case"tilt":case"rotation":this.rotateActivate||(this.animateSeries=!(i.refreshBounds=!0));break;case"titleStyle":e.titleStyle&&(e.titleStyle.size||e.titleStyle.textOverflow)?i.refreshBounds=!0:i.refreshElements=!0;break;case"subTitleStyle":e.subTitleStyle&&(e.subTitleStyle.size||e.subTitleStyle.textOverflow)?i.refreshBounds=!0:i.refreshElements=!0;break;case"legendSettings":i.refreshBounds=!0,i.refreshElements=!0;break;case"dataSource":this.processData(!1),i.refreshBounds=!0;break;case"series":if(!this.delayRedraw){for(var r,s=!1,a=void 0,l=0;l<this.series.length;l++)((r=e.series[l]).explodeOffset||r.radius||r.innerRadius||r.emptyPointSettings)&&(a=!0),e.series[l]&&(e.series[l].dataSource||e.series[l].yName||e.series[l].xName||e.series[l].dataLabel||a)&&(Pe(this.changeVisibleSeries(this.visibleSeries,l),r,null,!0),s=!0),e.series[l]&&!je(e.series[l].explodeIndex)&&0<=e.series[l].explodeIndex&&e.series[l].explodeIndex!==t.series[l].explodeIndex&&(s=!0,this.removeSeriesElements(this));s&&(this.processData(!1),i.refreshBounds=!0)}this.delayRedraw=!1,this.redraw=!1;break;case"enableRtl":case"locale":this.circularChartHighlight3DModule&&Pye(this.circularChartHighlight3DModule.styleId),this.circularChartSelection3DModule&&Pye(this.circularChartSelection3DModule.styleId),YLe.prototype.refresh.call(this);break;case"background":case"border":i.refreshElements=!0;break;case"isMultiSelect":case"selectedDataIndexes":case"selectionMode":this.circularChartSelection3DModule&&(je(this.circularChartSelection3DModule.selectedDataIndexes)?this.circularChartSelection3DModule.invokeSelection(this):(this.circularChartSelection3DModule.selectedDataIndexes=this.selectedDataIndexes,this.circularChartSelection3DModule.redrawSelection(this)));break;case"tooltip":this.circularChartTooltip3DModule&&(this.circularChartTooltip3DModule.previousPoints=[],this.tooltip.template)&&(this.circularChartTooltip3DModule.template=this.tooltip.template)}!i.refreshBounds&&i.refreshElements?(this.removeSeriesElements(this),this.createPieSvg(),this.circular3DPolygon=[],this.visibleSeries[0].segments=[],this.renderElements()):i.refreshBounds&&(this.removeSeriesElements(this),this.createPieSvg(),this.circular3DPolygon=[],this.visibleSeries[0].segments=[],this.calculateBounds(),this.renderElements())}},XLe([e(null)],KLe.prototype,"width",void 0),XLe([e(null)],KLe.prototype,"height",void 0),XLe([e(null)],KLe.prototype,"title",void 0),XLe([e(null)],KLe.prototype,"backgroundImage",void 0),XLe([e("")],KLe.prototype,"dataSource",void 0),XLe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},Tge)],KLe.prototype,"titleStyle",void 0),XLe([e(null)],KLe.prototype,"subTitle",void 0),XLe([t({fontFamily:null,size:null,fontStyle:null,fontWeight:null,color:null},Tge)],KLe.prototype,"subTitleStyle",void 0),XLe([e("None")],KLe.prototype,"selectionMode",void 0),XLe([e("None")],KLe.prototype,"highlightMode",void 0),XLe([kt([{}],rLe)],KLe.prototype,"series",void 0),XLe([t({},OLe)],KLe.prototype,"legendSettings",void 0),XLe([e("")],KLe.prototype,"highlightColor",void 0),XLe([e("None")],KLe.prototype,"selectionPattern",void 0),XLe([e("None")],KLe.prototype,"highlightPattern",void 0),XLe([e(!1)],KLe.prototype,"isMultiSelect",void 0),XLe([e(!0)],KLe.prototype,"enableAnimation",void 0),XLe([e("Material")],KLe.prototype,"theme",void 0),XLe([kt([],$ge)],KLe.prototype,"selectedDataIndexes",void 0),XLe([t({},zge)],KLe.prototype,"margin",void 0),XLe([t({color:"#DDDDDD",width:0},Rge)],KLe.prototype,"border",void 0),XLe([t({},jLe)],KLe.prototype,"tooltip",void 0),XLe([e(null)],KLe.prototype,"background",void 0),XLe([e(!1)],KLe.prototype,"useGroupingSeparator",void 0),XLe([e(50)],KLe.prototype,"depth",void 0),XLe([e(0)],KLe.prototype,"tilt",void 0),XLe([e(!1)],KLe.prototype,"enableRotation",void 0),XLe([e(0)],KLe.prototype,"rotation",void 0),XLe([e(!1)],KLe.prototype,"enableExport",void 0),XLe([i()],KLe.prototype,"load",void 0),XLe([i()],KLe.prototype,"loaded",void 0),XLe([i()],KLe.prototype,"legendRender",void 0),XLe([i()],KLe.prototype,"legendClick",void 0),XLe([i()],KLe.prototype,"selectionComplete",void 0),XLe([i()],KLe.prototype,"pointRender",void 0),XLe([i()],KLe.prototype,"seriesRender",void 0),XLe([i()],KLe.prototype,"textRender",void 0),XLe([i()],KLe.prototype,"beforeExport",void 0),XLe([i()],KLe.prototype,"afterExport",void 0),XLe([i()],KLe.prototype,"beforePrint",void 0),XLe([i()],KLe.prototype,"beforeResize",void 0),XLe([i()],KLe.prototype,"resized",void 0),XLe([i()],KLe.prototype,"circularChart3DMouseMove",void 0),XLe([i()],KLe.prototype,"circularChart3DMouseClick",void 0),XLe([i()],KLe.prototype,"circularChart3DMouseDown",void 0),XLe([i()],KLe.prototype,"circularChart3DMouseLeave",void 0),XLe([i()],KLe.prototype,"circularChart3DMouseUp",void 0),XLe([i()],KLe.prototype,"pointClick",void 0),XLe([i()],KLe.prototype,"pointMove",void 0),XLe([i()],KLe.prototype,"tooltipRender",void 0),XLe([Bt],KLe));function KLe(e,t){e=YLe.call(this,e,t)||this;return e.chartId=57724,e.explodeDistance=0,e.rotateActivate=!1,e.previousTargetId="",e.currentPointIndex=0,e.currentLegendIndex=0,e.isLegendClicked=!1,e.delayRedraw=!1,e}ZLe.prototype.export=function(e,t){var i=new E1e(this.chart),n={cancel:!1,width:null,height:null};this.chart.trigger(bfe,n),n.cancel||i.export(e,t,void 0,[this.chart])},ZLe.prototype.pdfExport=function(e,t,i,n,o,r,s,a,l){var h=new E1e(this.chart),d=(i=i||[this.chart],{cancel:!1,width:n,height:o});this.chart.trigger(bfe,d),d.cancel||h.export("PDF",e,t,i,n=d.width,o=d.height,r,s,a,l)},ZLe.prototype.getDataUrl=function(e){return new E1e(e).getDataUrl(e)},ZLe.prototype.getModuleName=function(){return"CircularChartExport3D"},ZLe.prototype.destroy=function(){};var JLe=ZLe;function ZLe(e){this.chart=e}$Le=function(e,t){return($Le=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}$Le(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(iRe,eRe=CAe),iRe.prototype.addEventListener=function(){this.circular3D.isDestroyed||(this.circular3D.on(F.touchMoveEvent,this.mouseMove,this),this.circular3D.on("click",this.mouseClick,this))},iRe.prototype.removeEventListener=function(){this.circular3D.isDestroyed||(this.circular3D.off(F.touchMoveEvent,this.mouseMove),this.circular3D.off("click",this.mouseClick))},iRe.prototype.initPrivateVariables=function(e){this.styleId=e.element.id+"_ej2_chart_selection",this.unselected=e.element.id+"_ej2_deselected",this.selectedDataIndexes=[],this.rectPoints=null},iRe.prototype.invokeSelection=function(e){this.initPrivateVariables(e),this.series=Pe({},e.visibleSeries,null,!0),this.seriesStyles(),this.currentMode=e.selectionMode,this.selectDataIndex(this.concatIndexes(e.selectedDataIndexes,this.selectedDataIndexes),e)},iRe.prototype.generateStyle=function(e,t){return this.styleId+"_series_"+e.index+"_point_"+t},iRe.prototype.getElementByIndex=function(t){var i=this,n=[],e=(document.querySelectorAll('[id*="-region-series-'+t.series+"-point-"+t.point+'"]').forEach(function(e){-1<e.id.indexOf(i.circular3D.element.id+"-")&&i.indexFinder(e.id).point===t.point&&n.push(e)}),document.getElementById(this.control.element.id+"-svg-data-label-text-"+t.point)),o=document.getElementById(this.control.element.id+"-datalabel-series-0-connector-"+t.point),r=document.getElementById(this.control.element.id+"-svg-data-label-series-0-shape-"+t.point);return e&&n.push(e),o&&n.push(o),r&&n.push(r),n},iRe.prototype.isAlreadySelected=function(e,i,n){if("mousemove"===i?(this.currentMode=this.circular3D.highlightMode,this.highlightDataIndexes=[],this.styleId=this.circular3D.element.id+"_ej2_chart_highlight"):"click"!==i&&"keyup"!==i||(this.currentMode=this.circular3D.selectionMode,this.styleId=this.circular3D.element.id+"_ej2_chart_selection"),"None"!==this.circular3D.highlightMode&&"None"===this.circular3D.selectionMode&&"click"===i)return!1;if(("None"!==this.circular3D.highlightMode||this.circular3D.legendSettings.enableHighlight)&&this.previousSelectedElement&&this.previousSelectedElement[0])for(var o=void 0,t=e.nodeName,r=(e.parentNode&&(o=("path"===t||"shape"===t)&&1<e.id.indexOf("region")),this),s=0;s<this.previousSelectedElement.length;s++)!function(e){var t;r.previousSelectedElement[e].hasAttribute("class")&&(-1<r.previousSelectedElement[e].getAttribute("class").indexOf("highlight")&&(o||"click"===i||"keyup"===i)?(r.previousSelectedElement[e].classList.forEach(function(e){-1<e.indexOf("selection")&&(t=e)}),r.previousSelectedElement[e].removeAttribute("class"),t&&r.addSvgClass(r.previousSelectedElement[e],t),r.previousSelectedElement[e].classList.remove(r.styleId+"_series_"+n.series),r.addOrRemoveIndex(r.highlightDataIndexes,r.indexFinder(r.previousSelectedElement[e].id))):!o&&-1<r.previousSelectedElement[e].getAttribute("class").indexOf("highlight")&&r.performSelection(r.indexFinder(r.previousSelectedElement[e].id),r.circular3D,r.previousSelectedElement[e]))}(s);return!0},iRe.prototype.mouseClick=function(e,t){this.calculateSelectedElements(e,t.target,t.type)},iRe.prototype.calculateSelectedElements=function(e,t,i){je(t)||"None"===e.selectionMode&&"None"===e.highlightMode||t.id&&-1===t.id.indexOf(e.element.id+"-")||-1<t.getAttribute("id").indexOf("_connector_")||(this.isAlreadySelected(t,i,this.indexFinder(t.id)),(-1<t.id.indexOf("-series-")||-1<t.id.indexOf("-data-label-"))&&this.performSelection(this.indexFinder(t.id),e,t))},iRe.prototype.indexFinder=function(e){var t=["NaN","NaN"];return-1<e.indexOf("-point-")?t=e.split("-series-")[1].split("-point-"):-1<e.indexOf("-border-")?t[0]=e.split("-border-")[1]:-1<e.indexOf("data-label-series-0-shape-")&&"Inside"===this.control.series[0].dataLabel.position?(t[0]="0",t[1]=e.split("-shape-")[1]):-1<e.indexOf("-series-")?t[0]=e.split("-series-")[1]:-1<e.indexOf("_chart_legend_shape_")?(t=e.split("_chart_legend_shape_"))[0]="0":-1<e.indexOf("_chart_legend_g_")?(t=e.split("_chart_legend_g_"))[0]="0":-1<e.indexOf("-data-label-")?(t[0]="0",t[1]=e.split("-data-label-text-")[1]):-1<e.indexOf("-connector-")&&(t[0]="0",t[1]=e.split("-connector-")[1]),new kme(parseInt(t[0],10),parseInt(t[1],10))},iRe.prototype.performSelection=function(e,t,i){!isNaN(e.point)&&"Point"===this.currentMode&&i&&0<this.getElementByIndex(e).length&&(this.selection(t,e,this.getElementByIndex(e)),this.selectionComplete(t,t.series[0]),this.blurEffect(t.element.id,t.visibleSeries))},iRe.prototype.selectionComplete=function(e,t){for(var i,n=[],o=0;o<this.selectedDataIndexes.length;o++)i=this.selectedDataIndexes[o].point,isNaN(i)||n.push({x:t.dataSource[i][t.xName],y:t.points[i].y,seriesIndex:this.selectedDataIndexes[o].series,pointIndex:i});e.trigger(afe,{name:afe,selectedDataValues:n,cancel:!1})},iRe.prototype.selection=function(e,t,i){e.isMultiSelect||-1!==this.styleId.indexOf("highlight")||"None"===e.selectionMode||this.removeMultiSelectElements(e,this.selectedDataIndexes,t);var n=i[0]&&(i[0].getAttribute("class")||"");i[0]&&-1<n.indexOf(this.getSelectionClass(i[0].id))?(this.removeStyles(i),0<this.styleId.indexOf("highlight")&&("None"!==e.highlightMode||e.legendSettings.enableHighlight)?this.addOrRemoveIndex(this.highlightDataIndexes,t):this.addOrRemoveIndex(this.selectedDataIndexes,t)):(this.previousSelectedElement="None"!==e.highlightMode?i:[],n.indexOf("selection")<0&&this.applyStyles(i,t),0<this.styleId.indexOf("highlight")&&("None"!==e.highlightMode||e.legendSettings.enableHighlight)?this.addOrRemoveIndex(this.highlightDataIndexes,t,!0):this.addOrRemoveIndex(this.selectedDataIndexes,t,!0))},iRe.prototype.redrawSelection=function(e){var t=Pe([],this.selectedDataIndexes,null,!0),i=Pe([],this.highlightDataIndexes,null,!0);0<this.styleId.indexOf("highlight")&&0<i.length?(this.removeSelectedElements(e,this.highlightDataIndexes),t=i):this.removeSelectedElements(e,this.selectedDataIndexes),this.blurEffect(e.element.id,e.visibleSeries),this.selectDataIndex(t,e)},iRe.prototype.removeSelectedElements=function(e,t){for(var i=0,n=t;i<n.length;i++){var o=n[i];this.removeStyles(this.getElementByIndex(o))}for(var r=e.visibleSeries[0].points,s=0;s<r.length;s++){o=new kme(0,r[s].index);this.removeStyles(0===this.getElementByIndex(o).length?[document.getElementById(this.control.element.id+"_chart_legend_shape_"+o.point)]:this.getElementByIndex(o))}},iRe.prototype.legendSelection=function(e,t,i){if("mousemove"===i){if((t=1<(t=1<(t=1<t.id.indexOf("text")?ie(t.id.replace("text","shape")):t).id.indexOf("marker")?ie(t.id.replace("_marker","")):t).id.indexOf("g")?ie(t.id.replace("_g_","_shape_")):t).hasAttribute("class")&&(-1<t.getAttribute("class").indexOf("highlight")||-1<t.getAttribute("class").indexOf("selection")))return;this.currentMode=this.circular3D.highlightMode}else"click"===i&&1<(t=1<t.id.indexOf("text")?ie(t.id.replace("text","shape")):t).id.indexOf("g")&&(t=ie(t.id.replace("_g_","_shape_")));var n=this.indexFinder(t.id);if(this.isAlreadySelected(t,i,n)){var o=this.generateStyle(e.visibleSeries[n.series],n.point),r=document.querySelectorAll("."+o);if(0<r.length)this.removeSelection(e,n.series,r,o,!0,n);else{for(var s=0,a=e.visibleSeries[0].points;s<a.length;s++){var l=a[s];l.index!==n.point&&(!e.isMultiSelect||0<o.indexOf("highlight"))&&(o=this.generateStyle(e.visibleSeries[n.series],l.index),r=document.querySelectorAll("."+o),this.removeSelection(e,n.series,r,o,!0,n))}0<(t=this.getElementByIndex(n)).length&&(this.checkSelectionElements(t,o,!1,n.point),this.selection(e,n,t),this.blurEffect(e.element.id,e.visibleSeries))}}},iRe.prototype.selectDataIndex=function(e,t){for(var i=0,n=e;i<n.length;i++){var o,r=n[i];(o=this.getElementByIndex(r)[0])&&this.performSelection(r,t,o)}},iRe.prototype.removeMultiSelectElements=function(e,t,i){for(var n=0;n<t.length;n++)this.checkEquals(t[n],i)||(this.removeStyles(this.getElementByIndex(t[n])),t.splice(n,1),n--)},iRe.prototype.blurEffect=function(e,t){for(var i=this.checkVisibility(this.highlightDataIndexes)||this.checkVisibility(this.selectedDataIndexes),n=0,o=t[0].points;n<o.length;n++){var r,s=o[n];s.visible&&(r=this.getElementByIndex({series:0,point:s.index}),this.checkSelectionElements(r,this.generateStyle(t[0],s.index),i,s.index))}},iRe.prototype.checkSelectionElements=function(e,t,i,n){void 0===n&&(n=0);for(var o,r=e,s=("None"===this.circular3D.selectionMode||"None"===this.circular3D.highlightMode&&!this.circular3D.legendSettings.enableHighlight||(r=e),e),a=0;a<r.length;a++)if(o=r[a].getAttribute("class")||"","None"===this.circular3D.selectionMode||"None"===this.circular3D.highlightMode&&!this.circular3D.legendSettings.enableHighlight||(t=0<o.indexOf("selection")||0<o.indexOf("highlight")?o:t),-1===o.indexOf(t)&&i?this.addSvgClass(r[a],this.unselected):(s=r[a],-1!==o.indexOf(this.unselected)&&0<t.indexOf("highlight")&&this.circular3D.highlightAnimation(r[a],700,.3),this.removeSvgClass(r[a],this.unselected),this.removeSvgClass(r[a].parentNode,this.unselected)),(-1!==r[a].id.indexOf("-data-label-text-")||-1!==r[a].id.indexOf("-connector-")||-1!==r[a].id.indexOf("-data-label-series-0-shape-"))&&(this.highlightDataIndexes&&this.highlightDataIndexes[0]&&n===this.highlightDataIndexes[0].point&&this.removeSvgClass(r[a],this.unselected),this.selectedDataIndexes))for(var l=0;l<this.selectedDataIndexes.length;l++)n===this.selectedDataIndexes[l].point&&this.removeSvgClass(r[a],this.unselected);this.control.circularChartLegend3DModule&&this.control.legendSettings.visible&&(e=ie(this.control.element.id+"_chart_legend_shape_"+n))&&(e.hasAttribute("class")&&this.removeSvgClass(e,e.getAttribute("class")),0<s.length?o=s[0].getAttribute("class"):s&&(o=s.getAttribute("class")||""),-1===o.indexOf(t)&&i?this.addSvgClass(e,this.unselected):(this.removeSvgClass(e,this.unselected),""===o?this.removeSvgClass(e,t):this.addSvgClass(e,t)))},iRe.prototype.applyStyles=function(e,t){for(var i=this.control.circularChartTooltip3DModule,n=0,o=e;n<o.length;n++){var r,s=o[n];s&&(this.removeSvgClass(s.parentNode,this.unselected),this.removeSvgClass(s,this.unselected),r=(i&&0<i.previousPoints.length&&i.previousPoints[0].point.index!==t.point?i.svgTooltip:this.series[t.series]).opacity,s.setAttribute("opacity",r.toString()),-1===s.id.indexOf("-data-label-text-")&&-1===s.id.indexOf("-connector-")&&-1===s.id.indexOf("-data-label-series-0-shape-")&&this.addSvgClass(s,this.getSelectionClass(s.id)),0<this.getSelectionClass(s.id).indexOf("highlight"))&&this.circular3D.stopElementAnimation(s)}this.control.circularChartLegend3DModule&&this.control.legendSettings.visible&&(e=document.getElementById(this.control.element.id+"_chart_legend_shape_"+t.point),this.removeSvgClass(e,e.getAttribute("class")),this.addSvgClass(e,this.getSelectionClass(e.id)))},iRe.prototype.getSelectionClass=function(e){return this.generateStyle(this.control.series[this.indexFinder(e).series],this.indexFinder(e).point)},iRe.prototype.removeSelection=function(e,t,i,n,o,r){if(0<i.length){for(var s=[],a=0;a<i.length;a++)s.push(i[a]);this.removeStyles(s),this.addOrRemoveIndex(this.selectedDataIndexes,new kme(t,r.point));for(var l=0,h=e.visibleSeries[0].points;l<h.length;l++){var d=h[l];if(n=this.generateStyle(e.visibleSeries[0],d.index),0<document.querySelectorAll("."+n).length){for(var p=0,c=s;p<c.length;p++)this.checkSelectionElements(c[p],n,!0,r.point);o=!1;break}}o&&this.blurEffect(e.element.id,e.visibleSeries)}},iRe.prototype.removeStyles=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];n&&this.removeSvgClass(n,this.getSelectionClass(n.id))}},iRe.prototype.addOrRemoveIndex=function(e,t,i){for(var n=0;n<e.length;n++)this.checkEquals(e[n],t)&&(e.splice(n,1),n--);i&&e.push(t)},iRe.prototype.checkEquals=function(e,t){return e.point===t.point&&e.series===t.series},iRe.prototype.mouseMove=function(e){var t=this.circular3D,i=e.target;if(!t.rotateActivate&&t.circularChartHighlight3DModule&&("None"!==t.highlightMode||t.legendSettings.enableHighlight)&&!je(i))return(i=1<e.target.id.indexOf("text")&&-1<e.target.id.indexOf("legend")?ie(e.target.id.replace("text","shape")):i).hasAttribute("class")&&(-1<i.getAttribute("class").indexOf("highlight")||-1<i.getAttribute("class").indexOf("selection"))?void 0:(this.calculateSelectedElements(t,e.target,e.type),void(this.highlightDataIndexes&&(-1===i.id.indexOf("_chart_legend_")||-1!==i.id.indexOf("_legend_element"))&&0<this.highlightDataIndexes.length&&-1===i.id.indexOf("-series-")&&-1===i.id.indexOf("-data-label-")&&this.removeLegendHighlightStyles()));t.selectionMode},iRe.prototype.removeLegendHighlightStyles=function(){var e;this.circular3D.circularChartHighlight3DModule.highlightDataIndexes=[];for(var t,i=0;i<this.circular3D.visibleSeries[0].points.length;i++)if(e=document.getElementsByClassName(this.generateStyle(this.circular3D.visibleSeries[0],i)),0===this.selectedDataIndexes.length){for(e=document.getElementsByClassName(this.generateStyle(this.circular3D.visibleSeries[0],i));0<e.length;)(t=e[0])&&this.removeSvgClass(t,t.getAttribute("class"));for(e=document.getElementsByClassName(this.unselected);0<e.length;)(t=e[0])&&(this.removeSvgClass(t,t.getAttribute("class")),-1<this.generateStyle(this.circular3D.visibleSeries[0],i).indexOf("highlight"))&&this.circular3D.highlightAnimation(t,700,.3)}else for(e=document.getElementsByClassName(this.generateStyle(this.circular3D.visibleSeries[0],i));0<e.length;)(t=e[0])&&(this.removeSvgClass(t,t.getAttribute("class")),this.addSvgClass(t,this.unselected))},iRe.prototype.getModuleName=function(){return"CircularChartSelection3D"},iRe.prototype.destroy=function(){this.removeEventListener()};var $Le,eRe,tRe=iRe;function iRe(e){var t=eRe.call(this,e)||this;return t.circular3D=e,t.renderer=e.renderer,t.addEventListener(),t}nRe=function(e,t){return(nRe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}nRe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(sRe,oRe=tRe),sRe.prototype.wireEvents=function(){this.circular3D.isDestroyed||this.circular3D.on(F.touchMoveEvent,this.mouseMove,this)},sRe.prototype.unWireEvents=function(){this.circular3D.isDestroyed||this.circular3D.off(F.touchMoveEvent,this.mouseMove)},sRe.prototype.declarePrivateVariables=function(e){this.styleId=e.element.id+"_ej2_chart_highlight",this.unselected=e.element.id+"_ej2_deselected",this.selectedDataIndexes=[],this.highlightDataIndexes=[]},sRe.prototype.invokeHighlight=function(e){this.declarePrivateVariables(e),this.series=Pe({},e.visibleSeries,null,!0),this.seriesStyles(),this.currentMode=e.highlightMode},sRe.prototype.getModuleName=function(){return"CircularChartHighlight3D"},sRe.prototype.destroy=function(){this.unWireEvents()};var nRe,oRe,rRe=sRe;function sRe(e){var t=oRe.call(this,e)||this;return t.circular3D=e,t.renderer=e.renderer,t.wireEvents(),t}twe.Inject(Fwe,Ewe,Uwe,zwe,gCe,LCe,aCe,OCe),twe.Inject(TCe,pwe,JAe,FAe,UAe),oxe.Inject(exe,Exe,Axe,bxe);lRe.prototype.addEventListener=function(){this.parent.on(Une,this.initiateChartHandler,this),this.parent.on(Mle,this.refreshChartCellObj,this),this.parent.on(kle,this.refreshChartCellModel,this),this.parent.on(Aoe,this.refreshChartCellObj,this),this.parent.on(Dle,this.deleteChart,this),this.parent.on(Lle,this.clearBorder,this),this.parent.on(Rle,this.insertChartHandler,this),this.parent.on(Ole,this.chartRangeHandler,this),this.parent.on(_le,this.chartDesignTabHandler,this),this.parent.on(Hle,this.updateChartElement,this),this.parent.on(zle,this.undoRedoForChartDesign,this),this.parent.on(Gne,this.refreshChartData,this)},lRe.prototype.insertChartHandler=function(e){var t=this,i="Column",n=!1;switch(e.id){case"clusteredColumn":i="Column";break;case"stackedColumn":i="StackingColumn";break;case"stackedColumn100":i="StackingColumn100";break;case"clusteredBar":i="Bar";break;case"stackedBar":i="StackingBar";break;case"stackedBar100":i="StackingBar100";break;case"area":i="Area";break;case"stackedArea":i="StackingArea";break;case"stackedArea100":i="StackingArea100";break;case"line":i="Line";break;case"lineMarker":i="Line",n=!0;break;case"stackedLine":i="StackingLine";break;case"stackedLineMarker":i="StackingLine",n=!0;break;case"stackedLine100":i="StackingLine100";break;case"stackedLine100Marker":i="StackingLine100",n=!0;break;case"pie":i="Pie";break;case"doughnut":i="Doughnut";break;case"scatter":i="Scatter"}e.isChart?(this.parent.notify(Qne,{chart:[{type:i,markerSettings:{visible:n,isFilled:!0}}]}),cpe(function(){sce(t.parent.element)})):this.parent.notify(_le,{chartType:i,triggerEvent:!0,markerVisible:n})},lRe.prototype.chartRangeHandler=function(){var e=document.querySelector(".e-datavisualization-chart.e-ss-overlay-active");if(e)for(var t=e.getElementsByClassName("e-control")[0].id,i=this.parent.chartColl,n=i.length,o=0;o<n;o++){var r=document.getElementById(i[o].id);e&&r&&i[o].id===t&&this.initiateChartHandler({option:i[o],isRefresh:!0})}},lRe.prototype.refreshChartData=function(e){if(this.parent.chartColl&&this.parent.chartColl.length)for(var t,i,n,o,r,s=0,a=this.parent.chartColl.length;s<a;s++){if((t=this.parent.chartColl[s]).range.includes("!")){if(o=t.range.substring(0,t.range.lastIndexOf("!")),this.parent.activeSheetIndex!==Bre(this.parent,o))continue;i=t.range.substring(t.range.lastIndexOf("!")+1)}else i=t.range;if(e.viewportIndexes){for(var l=0;l<e.viewportIndexes.length;l++)if($oe([e.viewportIndexes[l]],i)){n=!0;break}}else n=e.range?$oe([e.range],i):e.showHide?this.inRowColumnRange(rte(i),e.rIdx,e.showHide):Ooe(rte(i),e.rIdx,e.cIdx);(n||e.isSelectAll&&!e.isRefreshChart)&&(o=this.parent.element.querySelector("."+t.id))&&(r=At(o,"chart")||At(o,"accumulationchart"))&&(r.series=this.initiateChartHandler({option:t,isRefresh:!0}),r.refresh())}},lRe.prototype.inRowColumnRange=function(e,t,i){return"rows"===i?t>=e[0]&&t<=e[2]:t>=e[1]&&t<=e[3]},lRe.prototype.refreshChartCellModel=function(e){for(var t=0,i=e.prevChartIndexes.length;t<i;t++){var n=e.prevChartIndexes[t].chart,o=e.prevChartIndexes[t].chartRowIdx,r=e.prevChartIndexes[t].chartColIdx,s=e.currentChartIndexes[t].chartRowIdx,a=e.currentChartIndexes[t].chartColIdx,o={prevTop:n.top,prevLeft:n.left,prevRowIdx:o,prevColIdx:r,prevHeight:n.height,prevWidth:n.width,currentTop:n.top,currentLeft:n.left,currentRowIdx:s,currentColIdx:a,currentHeight:n.height,currentWidth:n.width,id:n.id,requestType:"chartRefreshOnFilter"};this.parent.notify(Mle,o)}},lRe.prototype.refreshChartCellObj=function(e){var t,i,n=ee(e.sheetIdx)?this.parent.activeSheetIndex:e.sheetIdx,o=_re(this.parent,n),r=Kre(e.prevRowIdx,e.prevColIdx,o),s=Kre(e.currentRowIdx,e.currentColIdx,o),a=r?r.chart:[],l=a&&a.length?a.length:0;if(l){for(var h=0;h<l;h++)if(a[h].id===e.id.split("_overlay")[0]){(t=a[h]).height=e.currentHeight,t.width=e.currentWidth,t.top=e.currentTop,t.left=e.currentLeft,a.splice(h,1),h--,l--;for(var d=0,p=this.parent.chartColl.length;d<p;d++)t.id===this.parent.chartColl[d].id&&(t.height=e.currentHeight,this.parent.chartColl[d].width=e.currentWidth,this.parent.chartColl[d].top=e.currentTop,this.parent.chartColl[d].left=e.currentLeft)}s&&s.chart&&(i=s.chart,t)&&i.push(t),Jre(e.currentRowIdx,e.currentColIdx,o,i?{chart:i}:{chart:[t]},!0),"chartRefresh"!==e.requestType||e.isUndoRedo||(r={requestType:"chartRefresh",currentRowIdx:e.currentRowIdx,currentColIdx:e.currentColIdx,currentWidth:e.currentWidth,prevHeight:e.prevHeight,prevWidth:e.prevWidth,prevRowIdx:e.prevRowIdx,prevColIdx:e.prevColIdx,prevTop:e.prevTop,prevLeft:e.prevLeft,currentTop:e.currentTop,currentLeft:e.currentLeft,currentHeight:e.currentHeight,id:e.id,sheetIdx:n},this.parent.notify("actionComplete",{eventArgs:r,action:"chartRefresh"}))}},lRe.prototype.processChartRange=function(e,s,t){function i(e,t,i,n){var o,r=Kre(e,t,f);return!r||(r.formula&&je(r.value)&&h.parent.notify(xie,{cell:r,rowIdx:e,colIdx:t,sheetIndex:s}),o=void 0,je(o=r.format?(e={value:r.value,format:r.format,formattedText:r.value,cell:r,rowIndex:e,colIndex:t},h.parent.notify(Aie,e),(t=mre(r.value))&&!ise(r.format,!0,null,!0)?Number(r.value):(n&&t?a=!0:i&&t&&(l=!0),e.formattedText&&e.formattedText.toString())):(y(r),r.value)))?"":o}var n,o,r,a,l,h=this,d=e[0],p=e[1],c=!1,u=e[2],e=e[3],g=d===u,m=p===e,f=_re(this.parent,s),y=ore(this.parent),v=f?i(d,e,!1,!0):"",b=f?i(u,p,!0):"",w=f?i(d,p,!0):"";return mre(b)&&w||(c=!0),!je(w)&&("Scatter"!==t.type||t.isSeriesInRows)||g||m?je(b)||!c||g||m||a?(o=[d,p,u,e],je(v)||mre(v)||a?(g||m)&&je(w)&&(r=[d,p,d,e],g?(o[1]=o[1]+1,r[3]=r[1]):o[0]=o[0]+1):(r=[d,p,d,e],g||(o[0]=o[0]+1))):je(v)||mre(v)&&w?(n=[d,p,u,p],o=[d,p+1,u,e]):(n=[d+1,p,u,p],o=[d+1,p+1,u,e],r=[d,p+1,d,e]):(n=[d+1,p,u,p],o=[d+1,p+1,u,e],r=[d,p+1,d,e]),{xRange:n,yRange:o,lRange:r,isStringSeries:c,isDateTime:l}},lRe.prototype.getRangeData=function(e){for(var t,i,n,o,r=e.sheet,s=(e.range?"string"==typeof e.range&&(e.range=rte(e.range)):e.range=rte(r.selectedRange),[]),a=e.range[0],l=e.isYvalue&&ore(this.parent);a<=e.range[2];){if(zde(r,a));else for(i=e.range[1];i<=e.range[3];)epe(r,i)?i++:((o=Kre(a,i,r,!1,!0)).formula&&je(o.value)&&this.parent.notify(xie,{cell:o,rowIdx:a,colIdx:i,sheetIndex:e.sheetIdx}),e.isYvalue&&l(o),t={value:o.value||(0===o.value?0:null)},o.format?(n={formattedText:o.value,value:o.value,format:o.format,cell:o,skipFormatCheck:!0},this.parent.notify(Aie,n),e.isYvalue?mre(o.value)?(t.value=Number(o.value),t.displayText=n.formattedText?n.formattedText.toString():""):(t.displayText=null===t.value?"":this.parent.getDisplayText({format:o.format,value:"0"}),t.value=0):e.isScatter&&!e.isDateTime&&mre(o.value)?t.value=Number(o.value):t.value=n.formattedText?n.formattedText.toString():null):e.isYvalue&&(mre(t.value)?(t.displayText=t.value.toString(),t.value=Number(t.value)):(t.displayText=null===t.value?"":"0",t.value=0)),s.push(t),i++);a++}return s},lRe.prototype.toArrayData=function(e){for(var t,i=0,n=[],o=e.length;i<o;)t=e[i],Object.keys(t).length?"value"in t&&n.push(t.value):n.push(""),i++;return n},lRe.prototype.getVirtualXValues=function(e){for(var t=1,i=[];t<e;)i.push(t.toString()),t++;return i},lRe.prototype.processChartSeries=function(e,t,i,n,o,r){var s,a,l,h,d,p,c,u={name:"displayText"},g={},m=0,f=0,y=this.parent.isPrintingProcessing,v=[],b=(t=je(t)?this.parent.activeSheetIndex:t,_re(this.parent,t)),w=(e=e||{})&&"Scatter"===e.type,C=this.getRangeData({range:n,sheet:b,isYvalue:!0,sheetIdx:t}),t=n[2]-n[0]+1-this.parent.hiddenCount(n[0],n[2],"rows",b),S=n[3]-n[1]+1-this.parent.hiddenCount(n[1],n[3],"columns",b),A=e.isSeriesInRows?(s=o?this.toArrayData(this.getRangeData({range:o,sheet:b,isScatter:w,isDateTime:r})):this.getVirtualXValues(1+S),i&&(a=this.toArrayData(this.getRangeData({range:i,sheet:b}))),t):(s=i?this.toArrayData(this.getRangeData({range:i,sheet:b,isScatter:w,isDateTime:r})):this.getVirtualXValues(1+t),o&&(a=this.toArrayData(this.getRangeData({range:o,sheet:b}))),S),x=s.length,I=e.isSeriesInRows?1:A;for(je(e.dataLabelSettings)||(u.visible=e.dataLabelSettings.visible,u.position=e.dataLabelSettings.position);m<A;){for(h=0,l=[],f=e.isSeriesInRows?f:m;h<x;)je(s[h])&&(s[h]=D("spread-chart-empty-label-")),l.push({x:s[h],y:C[f].value,displayText:C[f].displayText}),f+=I,h++;p=je(p=a&&0<a.length?a[m]:"Scatter"===e.type?"series"+(m+1):"series"+m)?"":p.toString(),e.type&&(g="Line"===(d=e.type)||"StackingLine"===d||"StackingLine100"===d?{dataSource:l,type:e.type,xName:"x",yName:"y",name:p,animation:{enable:!y},tooltipMappingName:"displayText",marker:e.markerSettings?{visible:e.markerSettings.visible,width:e.markerSettings.size,height:e.markerSettings.size,shape:e.markerSettings.shape,dataLabel:u,isFilled:e.markerSettings.isFilled,border:e.markerSettings.border,fill:e.markerSettings.isFilled?e.markerSettings.fill:null}:{dataLabel:u}}:"Scatter"===d?{dataSource:l,type:e.type,xName:"x",yName:"y",name:p,tooltipMappingName:"displayText",animation:{enable:!y},marker:{visible:!1,width:12,height:12,shape:"Circle",dataLabel:u}}:"Pie"===d||"Doughnut"===d?{dataSource:l,radius:"100%",xName:"x",yName:"y",innerRadius:"Pie"===e.type?"0%":"40%",dataLabel:{visible:!!u.visible,position:"Outer"===u.position?"Outside":"Inside",name:"displayText",font:{fontWeight:"600"}},animation:{enable:!y},tooltipMappingName:"displayText"}:{dataSource:l,type:e.type,xName:"x",yName:"y",animation:{enable:!y},name:p,marker:{dataLabel:u},tooltipMappingName:"displayText"}),v.push(g),m++}return c=e.type?{series:v,xRange:e.isSeriesInRows?o:i,yRange:n,lRange:e.isSeriesInRows?i:o}:c},lRe.prototype.getAxisFormat=function(e){var t="";return je(e)||(e=Kre(e[0],e[1],this.parent.getActiveSheet()))&&e.format&&(t=e.format),t},lRe.prototype.focusChartRange=function(e,t,i){var n,o=["e-rcborderright","e-rcborderbottom","e-vcborderright","e-vcborderbottom","e-bcborderright","e-bcborderbottom"],r=(this.clearBorder(),this.parent.getActiveSheet()),r=!(!r.frozenRows&&!r.frozenColumns);i&&(r?n=i:this.parent.notify(Fle,{startcell:{rowIndex:i[0],colIndex:i[1]},endcell:{rowIndex:i[2],colIndex:i[3]},classes:[o[0],o[1]]})),e&&(r?n?(n[0]=Math.min(i[0],e[0]),n[1]=Math.min(i[1],e[1]),n[2]=Math.max(i[2],e[2]),n[3]=Math.max(i[3],e[3])):n=e:this.parent.notify(Fle,{startcell:{rowIndex:e[0],colIndex:e[1]},endcell:{rowIndex:e[2],colIndex:e[3]},classes:[o[2],o[3]]})),r&&n?this.parent.notify(Fle,{startcell:{rowIndex:Math.min(n[0],t[0]),colIndex:Math.min(n[1],t[1])},endcell:{rowIndex:Math.max(n[2],t[2]),colIndex:Math.max(n[3],t[3])},classes:[o[4],o[5]]}):this.parent.notify(Fle,{startcell:{rowIndex:t[0],colIndex:t[1]},endcell:{rowIndex:t[2],colIndex:t[3]},classes:[o[4],o[5]]})},lRe.prototype.clearBorder=function(){var e=this.parent.getActiveSheet();if(e.frozenColumns||e.frozenRows)[].slice.call(this.parent.element.getElementsByClassName("e-chart-range")).forEach(function(e){G(e)});else for(var t=this.parent.getMainContent(),i=["e-rcborderright","e-rcborderbottom","e-vcborderright","e-vcborderbottom","e-bcborderright","e-bcborderbottom"],n=0,o=i.length;n<o;n++)for(var r=t.querySelectorAll("."+i[n]),s=0,a=r.length;s<a;s++)r[s].classList.remove(i[n])},lRe.prototype.initiateChartHandler=function(e){var t,i=this,n=e.option,o=!!je(e.isInitCell)||!e.isInitCell,r=(e.triggerEvent=!!je(e.triggerEvent)||e.triggerEvent,e.isRefresh=!je(e.isRefresh)&&e.isRefresh,n.range&&0<n.range.lastIndexOf("!")?Bre(this.parent,n.range.substring(0,n.range.lastIndexOf("!"))):this.parent.activeSheetIndex),s=_re(this.parent,r),a=rte(d=n.range||this.parent.getActiveSheet().selectedRange),l={};if(this.parent.allowChart||!s.isProtected){var h={sheetIndex:r,reqType:"shape",type:"actionBegin",shapeType:"chart",action:"create",options:n,range:d,operation:"create"},l=h.options,d=h.range,p=(0<a.length&&!e.isRefresh&&o&&a[2]-a[0]<a[3]-a[1]&&(c=!0),(l=l||{}).isSeriesInRows=!!c||l.isSeriesInRows||!1,e.dataSheetIdx=je(e.dataSheetIdx)?r:e.dataSheetIdx,this.processChartRange(a,e.dataSheetIdx,l)),h=p.xRange,c=p.yRange,a=p.lRange;if(r===this.parent.activeSheetIndex&&o&&this.focusChartRange(h,c,a),e.triggerEvent&&!e.isRefresh){if(t={type:n.type,theme:n.theme,isSeriesInRows:n.isSeriesInRows,range:n.range,markerSettings:l.markerSettings,dataLabelSettings:l.dataLabelSettings,title:l.title,legendSettings:l.legendSettings,primaryXAxis:l.primaryXAxis,primaryYAxis:l.primaryYAxis,id:n.id,height:n.height,width:n.width,posRange:e.range,isInitCell:e.isInitCell,cancel:!1,top:n.top,left:n.left},this.parent.notify(fie,{eventArgs:t,action:"beforeInsertChart"}),t.cancel)return[];n.type=t.type,n.theme=t.theme,n.isSeriesInRows=t.isSeriesInRows,n.markerSettings=t.markerSettings,n.range=t.range,n.id=t.id,n.height=t.height,n.width=t.width}r=this.processChartSeries(l,e.dataSheetIdx,h,c,a,p.isDateTime),o={majorGridLines:n.primaryXAxis&&n.primaryXAxis.majorGridLines&&!je(n.primaryXAxis.majorGridLines.width)?{width:n.primaryXAxis.majorGridLines.width}:{width:0},minorGridLines:n.primaryXAxis&&n.primaryXAxis.minorGridLines&&!je(n.primaryXAxis.minorGridLines.width)?{width:n.primaryXAxis.minorGridLines.width}:{width:0},minorTicksPerInterval:n.primaryXAxis&&n.primaryXAxis.minorGridLines&&0<n.primaryXAxis.minorGridLines.width?5:0,lineStyle:{width:0},valueType:"Scatter"!==n.type||p.isStringSeries||n.isSeriesInRows?"Category":"Double",rangePadding:"Scatter"!==n.type||p.isStringSeries||n.isSeriesInRows?"Auto":"Round",visible:!n.primaryXAxis||n.primaryXAxis.visible,title:n.primaryXAxis?n.primaryXAxis.title:"",edgeLabelPlacement:"Shift"},l={lineStyle:{width:0},majorGridLines:n.primaryYAxis&&n.primaryYAxis.majorGridLines&&!je(n.primaryYAxis.majorGridLines.width)?{width:n.primaryYAxis.majorGridLines.width}:{width:1},minorGridLines:n.primaryYAxis&&n.primaryYAxis.minorGridLines&&!je(n.primaryYAxis.minorGridLines.width)?{width:n.primaryYAxis.minorGridLines.width}:{width:0},minorTicksPerInterval:n.primaryYAxis&&n.primaryYAxis.minorGridLines&&0<n.primaryYAxis.minorGridLines.width?5:0,visible:!n.primaryYAxis||n.primaryYAxis.visible,title:n.primaryYAxis?n.primaryYAxis.title:"",edgeLabelPlacement:"Shift"};if(e.isRefresh)return e.isSwitchRowColumn&&"Scatter"===n.type&&(a=this.parent.element.querySelector("."+n.id))&&(At(a,"chart").primaryXAxis.valueType=p.isStringSeries||n.isSeriesInRows?"Category":"Double"),r.series;var a=n.id+"_overlay",u=this.parent.serviceLocator.getService(ape),d=!je(e.isInitCell)&&e.isInitCell?e.range:d,a=u.insertOverlayElement(a,d,e.isChangeChartType?this.parent.activeSheetIndex:mte(this.parent,d)),s=(a.element.classList.add("e-datavisualization-chart"),a.element.style.width=n.width+"px",a.element.style.height=n.height+"px",s&&(s.frozenRows||s.frozenColumns)?u.adjustFreezePaneSize(n,a.element,d):(je(n.top)?n.top=a.top:a.element.style.top=Number(cce(n.top).toFixed(2))+"px",je(n.left)?n.left=a.left:a.element.style.left=Number(cce(n.left).toFixed(2))+"px"),this.parent.notify(Xle,{height:n.height,width:n.width}),"Pie"===n.type||"Doughnut"===n.type?{position:"Bottom",visible:!0}:{}),u=(je(n.legendSettings)||(s.visible=n.legendSettings.visible,s.position=n.legendSettings.position),this.parent.createElement("div",{id:n.id,className:n.id})),d=n.theme||"Material",g=this.getAxisFormat(c),m=this.getAxisFormat(h),c=2*Math.round(parseFloat(getComputedStyle(a.element).borderWidth)),h=parseFloat(a.element.style.height)-(isNaN(c)?0:c)+"px";"Pie"!==n.type&&"Doughnut"!==n.type?this.chart=new twe({primaryXAxis:o,primaryYAxis:l,background:this.getThemeBgColor(d),chartArea:{border:{width:0}},title:n.title,legendSettings:s,theme:d,series:r.series,tooltip:{enable:!0,format:"${point.x} : <b>${point.tooltip}</b>"},width:a.element.style.width,height:h,enableRtl:this.parent.enableRtl,load:function(e){e.chart.theme=n.theme||"Material"},beforeResize:function(e){e.cancelResizedEvent=!0},axisLabelRender:function(e){"primaryYAxis"===e.axis.name&&g&&!n.type.includes("100")&&!je(e.value)&&i.parent?e.text=i.parent.getDisplayText({format:g,value:e.value.toString()}):"primaryXAxis"===e.axis.name&&e.text.startsWith("spread-chart-empty-label-")&&(e.text=""),"primaryXAxis"!==e.axis.name||"Scatter"!==n.type||p.isDateTime||(0<e.axis.labels.length&&!mre(e.text)?e.text=(e.axis.labels.indexOf(e.text)+1).toString():m&&!je(e.value)&&(e.text=i.parent.getDisplayText({format:m,value:e.value.toString()})))}}):this.chart=new oxe({title:n.title,legendSettings:s,theme:d,background:this.getThemeBgColor(d),series:r.series,width:a.element.style.width,height:h,center:{x:"50%",y:"50%"},tooltip:{enable:!0,format:"${point.x} : <b>${point.tooltip}</b>"},enableSmartLabels:!0,enableAnimation:!0,enableRtl:this.parent.enableRtl,load:function(e){e.chart.theme=n.theme||"Material"},beforeResize:function(e){e.cancelResizedEvent=!0}}),this.chart.appendTo(u),a.element.appendChild(u),a.element.classList.contains("e-ss-overlay-active")&&!this.parent.isPrintingProcessing&&this.parent.notify(Nle,{id:a.element.id}),e.triggerEvent&&this.parent.notify(Vae,{eventArgs:t,action:"insertChart"})}},lRe.prototype.deleteChart=function(e){this.clearBorder();var t=null,i=this.parent.getActiveSheet();if(je(e.id)?(t=document.querySelector(".e-datavisualization-chart.e-ss-overlay-active"),e.id=t?t.getElementsByClassName("e-control")[0].id:null):(e.id=e.id.includes("overlay")?e.id:e.id+"_overlay",t=document.getElementById(e.id)),!je(e.id)){e.id=e.id.includes("overlay")?e.id:e.id+"_overlay";for(var n,o,r=!1,s=0,a=this.parent.chartColl.length;s<a;s++)if(this.parent.chartColl[s].id===e.id.split("_overlay")[0]){o=this.parent.chartColl[s];break}for(var l,h,d,p={id:o.id,range:o.range,type:o.type,markerSettings:o.markerSettings,dataLabelSettings:o.dataLabelSettings,title:o.title,legendSettings:o.legendSettings,primaryXAxis:o.primaryXAxis,primaryYAxis:o.primaryYAxis,theme:o.theme,height:o.height,width:o.width,isSeriesInRows:o.isSeriesInRows,isInitCell:!0,posRange:null,top:o.top,left:o.left,cancel:!1},t=(i=t?(l=d=void 0,i.frozenRows||i.frozenColumns?(d={clientY:(h=t.getBoundingClientRect()).top},l={clientX:h.left},h.top<this.parent.getColumnHeaderContent().getBoundingClientRect().bottom&&(d.target=this.parent.getColumnHeaderContent()),h.left<this.parent.getRowHeaderContent().getBoundingClientRect().right&&(l.target=this.parent.getRowHeaderTable())):(d={clientY:parseFloat(t.style.top),isImage:!0},l={clientX:parseFloat(t.style.left),isImage:!0}),this.parent.notify(Xne,{id:e.id}),this.parent.notify(xle,d),this.parent.notify(Ile,l),r=!0,h=d.clientY,d=l.clientX,this.parent.sheets[this.parent.activeSheetIndex]):(this.parent.notify(Xne,{id:e.id}),t=e.range?e.range.lastIndexOf("!"):0,l=e.range&&0<t?Bre(this.parent,e.range.substring(0,t)):this.parent.activeSheetIndex,h=(t=rte(e.range?0<t?e.range.substring(t+1):e.range:this.parent.getActiveSheet().selectedRange))[0],d=t[1],this.parent.sheets[l]),Kre(h,d,i)),c=(n=t?t.chart:n)?n.length:null,s=0;s<c;s++)e.id===n[s].id+"_overlay"&&(n.splice(s,1),c=n.length);r&&(document.getElementById(e.id).remove(),this.parent.notify(Vle,{})),Jre(h,d,i,{chart:n},!0),p.posRange=i.name+"!"+lte(h,d),e.isUndoRedo||this.parent.notify(Vae,{eventArgs:p,action:"deleteChart",isClearAction:e.clearAction})}},lRe.prototype.updateChartModel=function(e,t,i,n,o){var r=t,s=this.parent.chartColl[n].id;if(!(o&&-1<["PHAxes","PVAxes","PHAxisTitle","PVAxisTitle","GLMajorHorizontal","GLMajorVertical","GLMinorHorizontal","GLMinorVertical"].indexOf(e)))for(var a,l=0,h=i.chart.length;l<h;l++)if(i.chart[l].id===s)switch(e){case"PHAxes":case"PHAxisTitle":je(i.chart[l].primaryXAxis)&&(i.chart[l].primaryXAxis={},this.parent.chartColl[n].primaryXAxis={}),"PHAxes"===e?(i.chart[l].primaryXAxis.visible=t.primaryXAxis.visible,this.parent.chartColl[n].primaryXAxis.visible=t.primaryXAxis.visible):"PHAxisTitle"===e&&(i.chart[l].primaryXAxis.title=t.primaryXAxis.title,this.parent.chartColl[n].primaryXAxis.title=t.primaryXAxis.title);break;case"PVAxes":case"PVAxisTitle":je(i.chart[l].primaryYAxis)&&(i.chart[l].primaryYAxis={},this.parent.chartColl[n].primaryYAxis={}),"PVAxes"===e?(i.chart[l].primaryYAxis.visible=t.primaryYAxis.visible,this.parent.chartColl[n].primaryYAxis.visible=t.primaryYAxis.visible):"PVAxisTitle"===e&&(i.chart[l].primaryYAxis.title=t.primaryYAxis.title,this.parent.chartColl[n].primaryYAxis.title=t.primaryYAxis.title);break;case"ChartTitleNone":case"ChartTitleAbove":i.chart[l].title=t.title,this.parent.chartColl[n].title=t.title;break;case"DLNone":case"DLCenter":case"DLInsideend":case"DLInsidebase":case"DLOutsideend":je(i.chart[l].dataLabelSettings)&&(i.chart[l].dataLabelSettings={},this.parent.chartColl[n].dataLabelSettings={}),"DLNone"===e?(i.chart[l].dataLabelSettings.visible=!1,this.parent.chartColl[n].dataLabelSettings.visible=!1):(i.chart[l].dataLabelSettings.visible=!0,this.parent.chartColl[n].dataLabelSettings.visible=!0,a=void 0,a=o?"Outside"===r.series[0].dataLabel.position?"Outer":"Middle":t.series[0].marker.dataLabel.position,i.chart[l].dataLabelSettings.position=a,this.parent.chartColl[n].dataLabelSettings.position=a);break;case"GLMajorHorizontal":je(i.chart[l].primaryYAxis)&&(i.chart[l].primaryYAxis={},this.parent.chartColl[n].primaryYAxis={}),je(i.chart[l].primaryYAxis.majorGridLines)&&(i.chart[l].primaryYAxis.majorGridLines={},this.parent.chartColl[n].primaryYAxis.majorGridLines={}),i.chart[l].primaryYAxis.majorGridLines.width=t.primaryYAxis.majorGridLines.width,this.parent.chartColl[n].primaryYAxis.majorGridLines.width=t.primaryYAxis.majorGridLines.width;break;case"GLMajorVertical":je(i.chart[l].primaryXAxis)&&(i.chart[l].primaryXAxis={},this.parent.chartColl[n].primaryXAxis={}),je(i.chart[l].primaryXAxis.majorGridLines)&&(i.chart[l].primaryXAxis.majorGridLines={},this.parent.chartColl[n].primaryXAxis.majorGridLines={}),i.chart[l].primaryXAxis.majorGridLines.width=t.primaryXAxis.majorGridLines.width,this.parent.chartColl[n].primaryXAxis.majorGridLines.width=t.primaryXAxis.majorGridLines.width;break;case"GLMinorHorizontal":je(i.chart[l].primaryYAxis)&&(i.chart[l].primaryYAxis={},this.parent.chartColl[n].primaryYAxis={}),je(i.chart[l].primaryYAxis.minorGridLines)&&(i.chart[l].primaryYAxis.minorGridLines={},this.parent.chartColl[n].primaryYAxis.minorGridLines={}),i.chart[l].primaryYAxis.minorGridLines.width=t.primaryYAxis.minorGridLines.width,this.parent.chartColl[n].primaryYAxis.minorGridLines.width=t.primaryYAxis.minorGridLines.width;break;case"GLMinorVertical":je(i.chart[l].primaryXAxis)&&(i.chart[l].primaryXAxis={},this.parent.chartColl[n].primaryXAxis={}),je(i.chart[l].primaryXAxis.minorGridLines)&&(i.chart[l].primaryXAxis.minorGridLines={},this.parent.chartColl[n].primaryXAxis.minorGridLines={}),i.chart[l].primaryXAxis.minorGridLines.width=t.primaryXAxis.minorGridLines.width,this.parent.chartColl[n].primaryXAxis.minorGridLines.width=t.primaryXAxis.minorGridLines.width;break;case"LegendNone":case"LegendsRight":case"LegendsLeft":case"LegendsBottom":case"LegendsTop":je(i.chart[l].legendSettings)&&(i.chart[l].legendSettings={},this.parent.chartColl[n].legendSettings={}),i.chart[l].legendSettings.visible=t.legendSettings.visible,this.parent.chartColl[n].legendSettings.visible=t.legendSettings.visible,"LegendNone"!==e&&(i.chart[l].legendSettings.position=t.legendSettings.position,this.parent.chartColl[n].legendSettings.position=t.legendSettings.position)}},lRe.prototype.updateChartElement=function(e,t,i,n,o,r,s,a){if(!(r&&-1<["PHAxes","PVAxes","PHAxisTitle","PVAxisTitle","GLMajorHorizontal","GLMajorVertical","GLMinorHorizontal","GLMinorVertical"].indexOf(e))){var l;switch(e){case"PHAxes":t.primaryXAxis.visible=!t.primaryXAxis.visible;break;case"PVAxes":t.primaryYAxis.visible=!t.primaryYAxis.visible;break;case"PHAxisTitle":t.primaryXAxis.title=o;break;case"PVAxisTitle":t.primaryYAxis.title=o;break;case"ChartTitleNone":t.title="";break;case"ChartTitleAbove":t.title=o;break;case"DLNone":case"DLCenter":case"DLInsideend":case"DLInsidebase":case"DLOutsideend":if(l=t.series,"DLNone"===e)for(var h=0,d=l.length;h<d;h++)r?l[h].dataLabel.visible=!1:l[h].marker.dataLabel.visible=!1;else for(var p,h=0,d=l.length;h<d;h++)r?(p="DLOutsideend"===e?"Outside":"Inside",l[h].dataLabel.visible=!0,l[h].dataLabel.position=p):(p="DLCenter"===e?"Middle":"DLInsideend"===e?"Top":"DLInsidebase"===e?"Bottom":"DLOutsideend"===e?"Outer":l[0].marker.dataLabel.position,l[h].marker.dataLabel.visible=!0,l[h].marker.dataLabel.position=p);t.series=l,r&&t.refresh();break;case"GLMajorHorizontal":t.primaryYAxis.majorGridLines.width=0===t.primaryYAxis.majorGridLines.width?1:0;break;case"GLMajorVertical":t.primaryXAxis.majorGridLines.width=0===t.primaryXAxis.majorGridLines.width?1:0;break;case"GLMinorHorizontal":t.primaryYAxis.minorTicksPerInterval=0===t.primaryYAxis.minorGridLines.width?5:0,t.primaryYAxis.minorGridLines.width=0===t.primaryYAxis.minorGridLines.width?1:0;break;case"GLMinorVertical":t.primaryXAxis.minorTicksPerInterval=0===t.primaryXAxis.minorGridLines.width?5:0,t.primaryXAxis.minorGridLines.width=0===t.primaryXAxis.minorGridLines.width?1:0;break;case"LegendNone":t.legendSettings.visible=!1;break;case"LegendsRight":case"LegendsLeft":case"LegendsBottom":case"LegendsTop":t.legendSettings.visible=!0,t.legendSettings.position="LegendsRight"===e?"Right":"LegendsLeft"===e?"Left":"LegendsBottom"===e?"Bottom":"LegendsTop"===e?"Top":t.legendSettings.position}this.updateChartModel(e,t,i,n,r),a&&(i={addChartEle:e,id:t.element.id+"_overlay",title:o,address:s},this.parent.notify(Vae,{action:"chartDesign",eventArgs:i}))}},lRe.prototype.undoRedoForChartDesign=function(e){var t=document.getElementById(e.id);if(t){for(var i,n=this.getChartElement(t),t=At(n,"chart"),o=(je(t)&&(t=At(n,"accumulationchart")),this.parent.getAddressInfo(e.address)),o=Kre(o.indices[0],o.indices[1],_re(this.parent,o.sheetIndex)),r=this.getChartCollectionId(n.id),s=e.addChartEle,a=e.title,l=0;l<e.beforeActionData.cellDetails[0].chart.length;l++)if(n.id===e.beforeActionData.cellDetails[0].chart[l].id){i=e.beforeActionData.cellDetails[0].chart[l];break}var h=!je(i.markerSettings)&&i.markerSettings.visible;if(e.switchRowColumn)this.switchRowColumn(r,n.id,t,o);else if(e.chartTheme)this.switchChartTheme(r,n.id,e.isUndo?i.theme:e.chartTheme,t,o);else if(e.chartType)this.switchChartType(r,n.id,e.isUndo?i.type:e.chartType,t,o,!1,e.isUndo?h:e.chartMarker,"undoRedo");else if(e.addChartEle){if(e.isUndo){var d=void 0;switch(s){case"DLNone":case"DLCenter":case"DLInsideend":case"DLInsidebase":case"DLOutsideend":s="Middle"===(d=i.dataLabelSettings&&i.dataLabelSettings.position)?"DLCenter":"Top"===d?"DLInsideend":"Bottom"===d?"DLInsidebase":"Outer"===d?"DLOutsideend":"DLNone";break;case"LegendNone":case"LegendsRight":case"LegendsLeft":case"LegendsBottom":case"LegendsTop":i.legendSettings&&!i.legendSettings.visible?d="LegendNone":s="Right"===(d=i.legendSettings&&i.legendSettings.position)?"LegendsRight":"Left"===d?"LegendsLeft":"Bottom"!==d&&"Top"===d?"LegendsTop":"LegendsBottom";break;case"PVAxisTitle":a=i.primaryYAxis&&i.primaryYAxis.title;break;case"PHAxisTitle":a=i.primaryXAxis&&i.primaryXAxis.title;break;case"ChartTitleNone":case"ChartTitleAbove":a=i.title}}this.updateChartElement(s,t,o,r,a,null,e.address)}}},lRe.prototype.chartDesignTabHandler=function(e){var t=!1,i=this.parent.sheets[this.parent.activeSheetIndex],n=e.switchRowColumn,o=e.chartType,r=e.chartTheme,s=e.addChartEle,a=null,l=e.id?document.getElementById(e.id):document.querySelector(".e-datavisualization-chart.e-ss-overlay-active");if(l){var h="ChartTitleAbove"===s||"PHAxisTitle"===s||"PVAxisTitle"===s,d=(i.frozenRows||i.frozenColumns?(c={clientY:(d=l.getBoundingClientRect()).top},u={clientX:d.left},d.top<this.parent.getColumnHeaderContent().getBoundingClientRect().bottom&&(c.target=this.parent.getColumnHeaderContent()),d.left<this.parent.getRowHeaderContent().getBoundingClientRect().right&&(u.target=this.parent.getRowHeaderTable())):(c={clientY:l.offsetTop,isImage:!0},u={clientX:l.offsetLeft,isImage:!0}),this.parent.notify(xle,c),this.parent.notify(Ile,u),Kre(c.clientY,u.clientX,i)),i=i.name+"!"+lte(c.clientY,u.clientX);if(e.triggerEvent){var p={switchRowColumn:e.switchRowColumn,chartType:e.chartType,chartTheme:e.chartTheme,addChartEle:e.addChartEle,id:l.id,address:i,cancel:!1};if(this.parent.notify(fie,{action:"chartDesign",eventArgs:p}),p.cancel)return}var c=this.getChartElement(l),u=c.getAttribute("id"),g=this.getChartCollectionId(u);if(c&&je(a=At(c,"chart"))&&(a=At(c,"accumulationchart"),t=!0),n&&this.switchRowColumn(g,u,a,d),o&&this.switchChartType(g,u,o,a,d,e.markerVisible),r&&this.switchChartTheme(g,u,r,a,d),s)if(h&&!e.title){if(0<this.parent.element.getElementsByClassName("e-title-dlg").length)return;this.titleDlgHandler(s,a,d,g,t,i,e.triggerEvent)}else this.updateChartElement(s,a,d,g,e.title,t);e.triggerEvent&&!h&&(p={switchRowColumn:e.switchRowColumn,chartType:e.chartType,chartMarker:e.markerVisible,chartTheme:e.chartTheme,addChartEle:e.addChartEle,id:l.id,address:i},this.parent.notify(Vae,{action:"chartDesign",eventArgs:p}))}},lRe.prototype.switchRowColumn=function(e,t,i,n){var o=this.parent.chartColl[e];o.isSeriesInRows=!!je(o.isSeriesInRows)||!o.isSeriesInRows;for(var r=0,s=n.chart.length;r<s;r++)n.chart[r].id===t&&(n.chart[r].isSeriesInRows=o.isSeriesInRows);e=this.initiateChartHandler({option:o,isRefresh:!0,isSwitchRowColumn:!0});i.series=e},lRe.prototype.switchChartTheme=function(e,t,i,n,o){this.parent.chartColl[e].theme=i;for(var r=0,s=o.chart.length;r<s;r++)o.chart[r].id===t&&(o.chart[r].theme=i);n.setProperties({theme:i,background:this.getThemeBgColor(i)},!0),n.refresh()},lRe.prototype.getThemeBgColor=function(e){var t;if(e.includes("Dark"))switch(e){case"MaterialDark":t="#383838";break;case"FabricDark":t="#242424";break;case"BootstrapDark":t="#1b1b1b";break;case"Bootstrap5Dark":t="#212529";break;case"TailwindDark":t="#1f2937";break;case"Tailwind3Dark":t="#111827";break;case"FluentDark":t="#1b1a19";break;case"Fluent2Dark":t="#292929";break;case"Material3Dark":t="#1C1B1F"}else t=e.includes("HighContrast")?"#000000":"#FFFFFF";return t},lRe.prototype.switchChartType=function(e,t,i,n,o,r,s,a){var l=this.parent.chartColl[e].type;this.parent.chartColl[e].type=i;for(var h,d=0,p=o.chart.length;d<p;d++)o.chart[d].id===t&&(o.chart[d].type=i,je(o.chart[d].markerSettings)||(o.chart[d].markerSettings.visible=r));if("Pie"!==i&&"Doughnut"!==i)if("Pie"===l||"Doughnut"===l)je(this.parent.chartColl[e].markerSettings)?!r||"Line"!==i&&"StackingLine"!==i&&"StackingLine100"!==i||(this.parent.chartColl[e].markerSettings={shape:"Circle",visible:!0,isFilled:!1}):this.parent.chartColl[e].markerSettings.visible=r||"undoRedo"===a&&s,this.changeCharType(e);else{l!==i&&("Scatter"===i?(h=n.primaryXAxis.labels)&&0<h.length&&mre(h[h.length-1])&&(n.primaryXAxis.valueType="Double"):"Double"===n.primaryXAxis.valueType&&(n.primaryXAxis.valueType="Category"));for(var c="Line"===i||"StackingLine"===i||"StackingLine100"===i,d=0,u=(g=n.series).length;d<u;d++)g[d].type=i,c?(g[d].marker.visible=r,g[d].marker.shape=je(g[d].marker.shape)?"Circle":g[d].marker.shape,"undoRedo"===a&&(g[d].marker.visible=s)):g[d].marker.visible=!1;n.series=g,n.refresh()}else if("Pie"===l||"Doughnut"===l){for(var g,d=0,u=(g=n.series).length;d<u;d++)g[d].innerRadius="Pie"===i?"0%":"40%";n.series=g,n.refresh()}else this.changeCharType(e)},lRe.prototype.getChartElement=function(e){var t=e.querySelector(".e-chart");return t=je(t)?e.querySelector(".e-accumulationchart"):t},lRe.prototype.getChartCollectionId=function(e){for(var t,i=0,n=this.parent.chartColl.length;i<n;i++)e===this.parent.chartColl[i].id&&(t=i);return t},lRe.prototype.changeCharType=function(e){var t=z(document.getElementById(this.parent.chartColl[e].id),".e-datavisualization-chart");t.remove(),this.initiateChartHandler({option:this.parent.chartColl[e],isInitCell:!1,triggerEvent:!1,isPaste:!1,isChangeChartType:!0}),(t=z(document.getElementById(this.parent.chartColl[e].id),".e-datavisualization-chart")).classList.contains("e-ss-overlay-active")||t.classList.add("e-ss-overlay-active")},lRe.prototype.titleDlgHandler=function(t,i,n,o,e,r,s){var a,l,h=this;e&&("PHAxisTitle"===t||"PVAxisTitle"===t)||(e=this.parent.serviceLocator.getService(ope),(l=this.parent.serviceLocator.getService(rpe)).show({width:375,showCloseIcon:!0,isModal:!0,cssClass:"e-title-dlg",header:"chart_abovechart"===t?e.getConstant("ChartTitle"):"PHAxisTitle"===t?e.getConstant("HorizontalAxisTitle"):e.getConstant("VerticalAxisTitle"),beforeOpen:function(){l.dialogInstance.content=h.titleDlgContent(t,i),l.dialogInstance.dataBind(),h.parent.element.focus()},buttons:[{buttonModel:{content:e.getConstant("Ok"),isPrimary:!0,cssClass:"e-btn e-clearall-btn e-flat"},click:function(){var e=h.parent.element.querySelector(".e-title-dlg").getElementsByClassName("e-title-dlg-content")[0];a=e.getElementsByTagName("input")[0].value,l.hide(),h.updateChartElement(t,i,n,o,a,null,r,s)}}]}),l.dialogInstance.refresh())},lRe.prototype.titleDlgContent=function(e,t){var i=this.parent.serviceLocator.getService(ope),n=this.parent.createElement("div",{className:"e-title-dlg-content"}),o=this.parent.createElement("span",{className:"e-header e-top-header"}),i=(o.innerText=i.getConstant("EnterTitle"),this.parent.createElement("input",{className:"e-input",id:"titleInput",attrs:{type:"text"}}));return n.appendChild(o),n.appendChild(i),t&&(i.value="PHAxisTitle"===e?t.primaryXAxis.title||i.value:"PVAxisTitle"===e?t.primaryYAxis.title||i.value:t.title||i.value),n},lRe.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Une,this.initiateChartHandler),this.parent.off(Mle,this.refreshChartCellObj),this.parent.off(Aoe,this.refreshChartCellModel),this.parent.off(kle,this.refreshChartCellModel),this.parent.off(Dle,this.deleteChart),this.parent.off(Lle,this.clearBorder),this.parent.off(Rle,this.insertChartHandler),this.parent.off(Ole,this.chartRangeHandler),this.parent.off(_le,this.chartDesignTabHandler),this.parent.off(Hle,this.updateChartElement),this.parent.off(zle,this.undoRedoForChartDesign),this.parent.off(Gne,this.refreshChartData))},lRe.prototype.destroy=function(){this.removeEventListener();var e=this.parent=null;this.chart&&(e=this.chart.element,this.chart.destroy()),e&&G(e),this.chart=null},lRe.prototype.getModuleName=function(){return"spreadsheetChart"};var aRe=lRe;function lRe(e){this.parent=e,this.addEventListener()}dRe.prototype.print=function(e,t){var i=this;if(e.isPrintingProcessing=!0,this.multipleCanvasDataURL=[],this.chartElements=[],"ActiveSheet"===t.type){var n=e.sheets[e.activeSheetIndex];this.activeSheetPrint(e,n,t,e.activeSheetIndex)}else{this.totalSheetCount=[],this.workbookActiveSheetCount=1;for(var o,r=0;r<e.sheets.length;r++)"Visible"===e.sheets[r].state&&(this.totalSheetCount.push(r),1<this.totalSheetCount.length)&&0<this.parent.sheets[r].ranges.length&&this.parent.sheets[r].ranges.some(function(e){return!je(e.dataSource)})&&(this.allowTimer=!0,n=e.sheets[r],o=pte(lte(0,0)+":"+lte(n.rowCount-1,n.colCount-1)),this.parent.notify(die,{sheet:n,indexes:o}));this.allowTimer?(this.allowTimer=!1,setTimeout(function(){i.activeSheetPrint(e,e.sheets[i.totalSheetCount[0]],t,i.totalSheetCount[0])},2e3)):this.activeSheetPrint(e,e.sheets[this.totalSheetCount[0]],t,this.totalSheetCount[0])}},dRe.prototype.updateChartRowAndColumnIndices=function(e,t){var i=e.sheets[t];if(this.rowIndex=i.usedRange.rowIndex,this.columnIndex=i.usedRange.colIndex,0<e.chartColl.length)for(var n=0;n<e.chartColl.length;n++){var o,r=e.chartColl[n];t===Bre(e,r.range.substring(0,r.range.lastIndexOf("!")))&&(o={clientX:r.left,isImage:!0},r={clientY:r.top,isImage:!0},e.notify(xle,r),e.notify(Ile,o),r.clientY>i.usedRange.rowIndex&&(this.rowIndex=Math.max(this.rowIndex,r.clientY)),o.clientX>i.usedRange.colIndex)&&(this.columnIndex=Math.max(this.columnIndex,o.clientX))}},dRe.prototype.activeSheetPrint=function(e,t,i,n){this.updateChartRowAndColumnIndices(e,n),this.pageCounts=this.calculatePageCount(t,1e3,i.allowRowColumnHeader),this.initialRowCount=0,this.parent.currentPrintSheetIndex=n,this.endRow=this.rowIndex+1,this.processCell(0,0,this.endRow,2,[],void 0,void 0,t,this,0,0,!0,n,i)},dRe.prototype.processCell=function(p,e,c,x,I,T,E,D,M,k,P,t,B,F){for(var L=this,R=(void 0===k&&(k=0),void 0===P&&(P=0),void 0===t&&(t=!0),0),O=F.allowRowColumnHeader,N=37,V=0,X=(this.chartHeight=0,!1),_=p;_<this.pageCounts.length;_++){this.chartLoadedCount=0,this.totalCharts=0,this.imageLoadedCount=0,this.totalImages=0,k+=0===_?0:1100,E=document.createElement("canvas"),T=E.getContext("2d"),E.width=1e3,E.height=1100,T.font="11pt Calibri",T.textBaseline="bottom",T.index=_,T.width=1e3,!t&&(this.isImageLoaded||this.isChartLoaded)||(I=[],P=x=0);for(var H=e;H<this.endRow;H++){var z=!(t=!0),j=(this.isColumn=this.isColumn||0===H,{borderBottom:"1px solid black"}),W=D.rows[H]&&D.rows[H].height||this.defaultCellHeight,Q=(this.initialRowCount=H,x=R,0===_?0:this.pageCounts[_-1]+1),U=this.pageCounts[_],q=(P+=je(D.rows[H])?this.defaultCellHeight:W+(0===H&&O?this.defaultCellHeight:0),!je(D.rows[H])&&D.rows[H]&&D.rows[H].height||this.defaultCellHeight);if(1080<P){if(this.startNewPageCount=H,V=O?W+(0===H&&O?this.defaultCellHeight:0):0,z=!1,this.isColumn=!0,this.isImageLoaded||this.isChartLoaded)break;k+=1100,t&&this.multipleCanvasDataURL.push(E.toDataURL()),t=!0,E=document.createElement("canvas"),T=E.getContext("2d"),E.width=1e3,E.height=1100,T.font="11pt Calibri",T.textBaseline="bottom",T.index=_,T.width=1e3;for(var i=0;i<I.length;i++)void 0!==I[i]&&(I[i]-=P-q);P=O||F.allowGridLines?W+(O?this.defaultCellHeight:0):W}var G={borderBottom:"1px solid black",borderTop:"1px solid black",borderLeft:"1px solid black",borderRight:"1px solid black"},K={borderRight:"1px solid black"};if(O&&this.isColumn)for(var n=Q;n<=U;n++){var o=dte(n+1),r=n===Q?2:1;T.font="11pt Calibri";for(i=0;i<r;i++){var s,a,l=0===i&&2==r?N:D.columns[n]&&D.columns[n].hidden?0:D.columns[n]&&D.columns[n].width||this.defaultCellWidth;0!==(l=1e3<x+l?l-1-(x+l-1e3):l)?(s=T.measureText(o).width,s=M.calculateTextPosition(s,l,x,"Center"),a=this.defaultCellHeight,T.fillText(n===Q&&0===i?"":o,s,a),M.drawBorder(T,G,x,0,l,this.defaultCellHeight),x+=l,I[n]=this.defaultCellHeight,n===U&&(2==r?1===i:0===i)&&(this.isColumn=!(n===U),x=0)):n===U&&(this.isColumn=!1,x=0)}}if(je(D.rows[H])||!je(D.rows[H].hidden)&&D.rows[H].hidden){if(je(D.rows[H])){var h={borderBottom:"1px solid black",borderTop:"1px solid black",borderLeft:"1px solid black",borderRight:"1px solid black"};z=1080<P+q+(0===H&&O?this.defaultCellHeight:0)||H===D.rows.length-1||H===this.endRow-1;for(n=Q;n<=U;n++){var d=D.rows[H]&&!je(D.rows[H].cells)&&D.rows[H].cells[n],d=(je(d)||je(d.style)||(h=this.setBorderStyle(d,h)),O&&n===Q&&(M.rowHeaderText((H+1).toString(),T,M,N,x,h,I[n],this.defaultCellHeight),x+=N),D.columns[n]&&D.columns[n].width||this.defaultCellWidth),d=1e3<x+d?d-1-(x+d-1e3):d;I[n]=isNaN(I[n])?R:I[n],F.allowGridLines?M.drawBorder(T,h,x,I[n],d,q):O&&!F.allowGridLines&&n===U&&M.drawBorder(T,{borderRight:"1px solid black"},x,I[n],d,q),x+=d,n===U&&O&&z&&(M.drawBorder(T,j,0,I[n],x,q),z=!1),I[n]+=q}}}else for(var J,z=this.endRow===D.rows.length&&(1080<P+(D.rows[H+1]&&D.rows[H+1].height||this.defaultCellHeight)+(0===H&&O?this.defaultCellHeight:0)||H===D.rows.length-1),Y=this,n=Q;n<=U;n++)!function(e){var n=D.rows[H]&&!je(D.rows[H].cells)&&D.rows[H].cells[e];if(je(n)||je(n.style)||(G=Y.setBorderStyle(n,G)),je(D.columns[e])||je(D.columns[e].hidden)||!D.columns[e].hidden){var o,t=!je(D.rows[H].cells)&&!je(D.rows[H].cells[e])&&!isNaN(D.rows[H].cells[e].colSpan)&&Q>e+D.rows[H].cells[e].colSpan,i=!(je(D.rows[H].cells)||je(D.rows[H].cells[e])||isNaN(D.rows[H].cells[e].rowSpan)||H+D.rows[H].cells[e].rowSpan>Y.startNewPageCount||0===Y.startNewPageCount),r="",s=je(n)||isNaN(n.rowSpan)||t||i?1:Math.max(n.rowSpan,0);if(I[e]=isNaN(I[e])?R:I[e],O&&e===Q){T.font="11pt Calibri";var a=I[e];if(0<s)for(var l=0;l<(0===s?1:s);l++)a+=(x=0)===l?0:D.rows[H+l]&&D.rows[H+l-1].height||Y.defaultCellHeight,M.rowHeaderText((H+1+l).toString(),T,M,N,x,G,a,D.rows[H+l].height||Y.defaultCellHeight),x+=N;else x=0,x+=N}if(!je(n)&&n){var h,i=n.style&&n.style.fontSize||"11pt",d=n.style&&n.style.color||"#000000";if(!isNaN(D.rows[H].cells[e].rowSpan)&&1<D.rows[H].cells[e].rowSpan&&isNaN(D.rows[H+1].cells[e].rowSpan)&&Y.parent.merge(""+dte(e+1)+(H+1)+":"+dte(e+1)+(H+D.rows[H].cells[e].rowSpan-1)),!isNaN(D.rows[H].cells[e].colSpan)&&1<D.rows[H].cells[e].colSpan)if(!je(D.rows[H+1])&&!je(D.rows[H+1].cells)&&0<D.rows[H+1].cells.length&&!je(D.rows[H+1].cells[e])&&isNaN(D.rows[H+1].cells[e].colSpan))Y.parent.merge(""+dte(e+1)+(H+1)+":"+dte(e+1+D.rows[H].cells[e].colSpan-1)+(H+1));else if(je(D.rows[H].cells[e+1].colSpan))for(var p=1;p<D.rows[H].cells[e].colSpan;p++)D.rows[H].cells[e+p].colSpan=-p;h=isNaN(D.rows[H].cells[e].colSpan)||t?1:Math.max(D.rows[H].cells[e].colSpan,0),D.rows[H].cells[e].rowSpan&&!t&&D.rows[H].cells[e].rowSpan<0&&(t=D.rows[H+D.rows[H].cells[e].rowSpan].cells[e].colSpan,h=t||h),(e===Q||0<e&&D.columns&&D.columns[e-1]&&D.columns[e-1].hidden&&D.rows[H].cells[e-1]&&1<D.rows[H].cells[e-1].colSpan)&&h<=0&&(h=1);var t=n.style&&n.style.backgroundColor||"#ffffff",c=n.style?n.style.textAlign:"",u=(T.font=i,T.fillStyle=d,[]);if(1<h){for(var g=D.columns.slice(e,e+h),l=0;l<g.length;l++)u.push(g.hidden?0:g[l]&&g[l].width||Y.defaultCellWidth);0===u.length?u.push(Y.defaultCellWidth*h):u.length!==h&&(u=u.map(function(e){return e+L.defaultCellWidth*(h-1-u.length)}))}o=1<h?u.reduce(function(e,t){return e+t},0):1===h?D.columns[e]&&D.columns[e].width||Y.defaultCellWidth:0,o=1e3<x+o?o-1-(x+o-1e3):o,q=1<s?D.rows.slice(H,H+s).map(function(e){return e.height||L.defaultCellHeight}).reduce(function(e,t){return e+(t||L.defaultCellHeight)},0):1===s?W:0;var m,f,y,v,b,w,C,i=(n.style&&n.style.verticalAlign||"Bottom").toLowerCase();!je(n.image)&&0<n.image.length&&Y.processImages(_,H,n,E,T,P,Y.endRow,W,V,O,F,D,M,x,I,k,B),!je(n.chart)&&0<n.chart.length&&Y.handleCharts(_,H,n,T,E,P,Y.endRow,Y.initialRowCount,V,W,O,F,D,M,Y.multipleCanvasDataURL,x,I,k,B),je(n.value)&&je(n.formula)&&je(n.hyperlink)?M.rowHeaderRect(T,x,I[e],o,q,t):(m=n.formula&&n.format?("Automatic"===Y.parent.calculationMode&&Y.parent.notify(Pie,{action:"refreshCalculate",rowIndex:H,colIndex:e,value:n.formula,isFormula:Poe(n.formula),sheetIndex:B}),w={value:n.value,format:n.format,rowIndex:H,colIndex:e,sheetIndex:Y.parent.activeSheetIndex,cell:n,refresh:!0},r=Y.parent.workbookNumberFormatModule.getFormattedCell(w),""+(c||(w.isRightAlign?"Right":"Left"))):n.format?(w={value:n.value,format:n.format,rowIndex:H,colIndex:e,sheetIndex:Y.parent.activeSheetIndex,cell:n,refresh:!0},r=Y.parent.workbookNumberFormatModule.getFormattedCell(w),""+(c||(w.isRightAlign?"Right":"Left"))):n.formula?("Automatic"===Y.parent.calculationMode&&Y.parent.notify(Pie,{action:"refreshCalculate",rowIndex:H,colIndex:e,value:n.formula,isFormula:Poe(n.formula),sheetIndex:B}),r=n.value,""+(c||"Left")):(je(n.hyperlink)||(je(n.value)?n.value=(je(n.hyperlink)||"object"!=typeof n.hyperlink)&&n.hyperlink||n.hyperlink.address:!je(n.value)&&""!==n.value||(n.value="object"==typeof n.hyperlink?n.hyperlink.address:n.hyperlink),d=n.style&&n.style.color||"#00e"),r=n.value,w=!je(n.value)&&""!==n.value&&new RegExp("^[^\\p{L}]*$","u").test(n.value),""+(c||(w?"Right":"Left"))),c=n.style&&n.style.fontSize||"11pt",w=n.style&&n.style.fontFamily||"Calibri",S=n.style&&n.style.fontStyle||"",C=n.style&&n.style.fontWeight||"normal",T.font=S+" "+C+" "+c+" "+w,f=T.measureText(r),y=f.width,S=f.actualBoundingBoxAscent+f.actualBoundingBoxDescent,n.wrap?(v=Y.defaultCellHeight<q?parseInt(c.replace("pt",""),10)/72*96:q,C=1<n.colSpan?e+n.colSpan-1:e,w=Hpe($de(D,e,C)-(4+(ece(H,e,D)||1)),!0),C=1===(c=Y.wrapText(r,w,n.style,Y.parent.cellStyle)).length?q:c.length*v!==q&&c.length*v<q?q-(c.length-1)*v:v,b=I[e]+("top"===i?v:"middle"===i&&v+C/4<C?v+C/4:C),T.save(),T.beginPath(),T.rect(x,I[e],o,q),T.clip(),T.fillStyle=t,T.fillRect(x,I[e],o,q+("top"===i?v:0)),c.forEach(function(e,t){T.fillStyle=d,f=T.measureText(e),y=f.width;var i=M.calculateTextPosition(y,o,x,m,!0),t=b+t*v;"right"===m.toLowerCase()?(T.textAlign="right",T.fillText(e.trim(),i,t)):T.fillText(e,i,t),M.textDecoration(n,T,i,t,d,f,r,o)}),T.restore()):(T.save(),T.beginPath(),T.rect(x,I[e],o,q),T.clip(),T.fillStyle=t,T.fillRect(x,I[e],o,q),T.fillStyle=d,w=M.calculateTextPosition(y,o,x,m),C=I[e],c=q/2+S/2,"top"===i?T.textBaseline="top":C+="middle"===i&&c<q?c:q,je(n.style)||(C=!je(n.style.borderBottom)&&-1<n.style.borderBottom.indexOf("double")||!je(n.style.borderTop)&&-1<n.style.borderTop.indexOf("double")?C-2:C,w=!je(n.style.borderLeft)&&-1<n.style.borderLeft.indexOf("double")||!je(n.style.borderRight)&&-1<n.style.borderRight.indexOf("double")?w+("Left"===m?2:-3):w),T.fillText(r,w,C),T.restore(),M.textDecoration(n,T,w,C,d,f,r,o))),n.style&&(0<o||0<q)&&(n.style.borderBottom||n.style.borderTop||n.style.borderLeft||n.style.borderRight&&(je(n.rowSpan)&&je(n.colSpan)||!je(n.rowSpan)&&0<n.rowSpan||!je(n.colSpan)&&0<n.colSpan))&&M.drawBorder(T,n.style,x,I[e]<=0?2:I[e],o,q)}var t=h<=0?o:o||D.columns[e]&&D.columns[e].width||Y.defaultCellWidth,S=(F.allowGridLines&&(G.borderRight=e===U&&O?void 0:"1px solid black",M.drawBorder(T,G,x,I[e],t,q)),x+=t,0);if(1<s){for(S=I[e],p=e;p<e+h;p++){var A=D.rows[H]&&!je(D.rows[H].cells)&&D.rows[H].cells[p];A&&!je(A.image)?Y.processImages(_,H,A,E,T,P,Y.endRow,W,V,O,F,D,M,x,I,k,B):A&&!je(A.chart)&&Y.handleCharts(_,H,A,T,E,P,Y.endRow,Y.initialRowCount,V,W,O,F,D,M,Y.multipleCanvasDataURL,x,I,k,B),A.style&&p===e&&0<q&&(A.style.borderBottom||A.style.borderTop||A.style.borderLeft||A.style.borderRight)&&M.drawBorder(T,A.style,x,I[e],2,q),I[p]=(isNaN(I[p])?R:I[p])+q}e+=h-1}e===U&&O&&M.drawBorder(T,K,x-2,I[e]-S,2,q),e===U&&O&&z&&!X&&(M.drawBorder(T,j,0,I[e]-S,x,q),z=!1),s<=1&&(I[e]+=q)}else if(O&&e===Q){s=je(n)||isNaN(D.rows[H].cells[e].rowSpan)?1:Math.max(D.rows[H].cells[e].rowSpan,0),a=(I[e]=isNaN(I[e])?R:I[e],I[e]);T.font="11pt Calibri";for(l=0;l<s;l++)a+=(x=0)===l?0:D.rows[H+l]&&D.rows[H+l-1].height||Y.defaultCellHeight,M.rowHeaderText((H+1+l).toString(),T,M,N,x,G,a,D.rows[H+l].height||Y.defaultCellHeight),x+=N;I[e]+=q}J=e}(n),n=J}if(this.isImageLoaded||this.isChartLoaded){if(this.isImageLoaded||this.isChartLoaded)break}else t&&0<this.endRow&&this.multipleCanvasDataURL.push(E.toDataURL()),e=0,this.pageCounts.length-1===_&&M.canvasPrint(this.parent,B,F)}},dRe.prototype.setBorderStyle=function(e,t){return t.borderBottom=(je(e.style.borderBottom)?t:e.style).borderBottom,t.borderTop=(je(e.style.borderTop)?t:e.style).borderTop,t.borderRight=(je(e.style.borderRight)?t:e.style).borderRight,t.borderLeft=(je(e.style.borderLeft)?t:e.style).borderLeft,t},dRe.prototype.setToDefault=function(){this.parent.currentPrintSheetIndex=0,this.initialRowCount=0,this.chartHeight=0,this.totalCharts=0,this.totalImages=0,this.chartLoadedCount=0,this.imageLoadedCount=0,this.endRow=0,this.pageCounts=[],this.multipleCanvasDataURL=[],this.chartElements=[],this.isChartLoaded=!1,this.isImageLoaded=!1,this.startNewPageCount=0},dRe.prototype.handleCharts=function(s,i,e,a,l,h,t,n,d,p,c,u,g,m,f,y,v,b,w){var C=this;if(!je(e.chart))for(var S=this,o=0,r=e.chart;o<r.length;o++)!function(o){S.totalCharts+=1;var e,r=new Image,t=(o.left=je(o.left)?0:o.left,o.top=je(o.top)?0:o.top,document.getElementById(o.id));je(t)&&(S.parent.insertChart([o]),t=document.getElementById(o.id),S.chartElements.push(o.id+"_overlay")),je(t)||(S.chartHeight=o.height,S.initialRowCount+Math.ceil(o.height/19)>S.endRow&&(u.allowRowColumnHeader||u.allowGridLines)&&g.rows.length-1===i&&(e=p+(c?S.defaultCellHeight:0),l.height>h+(S.chartHeight-e)?S.endRow+=Math.ceil((S.chartHeight-e)/19):S.endRow+=Math.ceil((l.height-(h+e))/19)),e=t.cloneNode(!0),t=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(e.childNodes[1])],{type:"image/svg+xml"})),r.onload=function(){var e=Math.ceil(o.left/1e3)-1,t=Math.ceil(o.top/1080)-1,i=o.left+(c?37:0),n=o.top+(c?19:0)+(0<t?d:0);a.drawImage(r,e<=0?i:i-1e3*e,t<=0?n:n-1160*t,o.width,o.height),C.chartLoadedCount++,C.chartLoadedCount===C.totalCharts&&(y+=o.width,C.isChartLoaded=!1,C.isImageLoaded||(f.push(l.toDataURL()),i=C.initialRowCount===g.rows.length-1&&h<1080?g.rows.length:C.initialRowCount,e=C.endRow,C.processCell(s,i+1===e?e:i,e,y,v,a,l,g,m,b,h,!1,w,u)))},r.src=t,S.isChartLoaded=!0)}(r[o])},dRe.prototype.processImages=function(s,t,e,a,l,h,i,n,d,p,c,u,g,m,f,y,v){var b=this;if(!je(e.image)){for(var w=this,o=0,r=e.image;o<r.length;o++)!function(o){w.totalImages+=1;var e,r=new Image;r.src=o.src,o.left=je(o.left)?0:o.left,o.top=je(o.top)?0:o.top,w.chartHeight=o.height,w.initialRowCount+Math.ceil(o.height/19)>w.endRow&&(c.allowRowColumnHeader||c.allowGridLines)&&t===u.rows.length-1&&(e=n+(p?w.defaultCellHeight:0),a.height>h+(w.chartHeight-e)?w.endRow+=Math.ceil((w.chartHeight-e)/19):w.endRow+=Math.ceil((a.height-(h+e))/19)),r.onload=function(){var e=Math.ceil(o.left/1e3)-1,t=Math.ceil(o.top/1080)-1,i=o.left+(p?37:0),n=o.top+(p?19:0)+(0<t?d:0);l.drawImage(r,e<=0?i:i-1e3*e,t<=0?n:n-1160*t,o.width,o.height),b.imageLoadedCount++,b.imageLoadedCount===b.totalImages&&(b.isImageLoaded=!1,m+=o.width,b.isChartLoaded||(b.multipleCanvasDataURL.push(a.toDataURL()),i=b.initialRowCount===u.rows.length-1&&h<1080?u.rows.length:b.initialRowCount,e=b.endRow,b.processCell(s,i+1===e?e:i,e,m,f,l,a,u,g,y,h,!1,v,c)))},r.onerror=function(){var e,t;b.imageLoadedCount++,b.imageLoadedCount===b.totalImages&&(b.isImageLoaded=!1,b.isChartLoaded||(b.multipleCanvasDataURL.push(a.toDataURL()),e=b.initialRowCount===u.rows.length-1&&h<1080?u.rows.length:b.initialRowCount,t=b.endRow,b.processCell(s,e+1===t?t:e,t,m,f,l,a,u,g,y,h,!1,v,c)))}}(r[o]);this.isImageLoaded=!0}},dRe.prototype.textDecoration=function(e,t,i,n,o,r,s,a){""!==s&&(!je(e.style)&&!je(e.style.textDecoration)&&-1<e.style.textDecoration.toLowerCase().indexOf("underline")||!je(e.hyperlink))&&(t.beginPath(),t.moveTo(i,n-3),t.lineTo(i+(r.width>a?a:r.width),n-3),t.strokeStyle=o,t.lineWidth=1,t.stroke())},dRe.prototype.rowHeaderRect=function(e,t,i,n,o,r){void 0===r&&(r="#ffffff"),e.save(),e.beginPath(),e.rect(t,i,n,o),e.clip(),e.fillStyle=r,e.fillRect(t,i,n,o),e.restore()},dRe.prototype.rowHeaderText=function(e,t,i,n,o,r,s,a){var l=t.measureText(e).width,l=i.calculateTextPosition(l,n,o,"Center"),h=s;t.save(),t.beginPath(),t.rect(o,s,n,a),t.clip(),t.fillStyle="#000000",t.fillText(e,l,h+a),i.drawBorder(t,r,o,s||0,n,a),t.restore()},dRe.prototype.canvasPrint=function(r,e,t){var s=this;if("Workbook"===t.type&&this.totalSheetCount.length-1>=this.workbookActiveSheetCount){var i=this.totalSheetCount[this.workbookActiveSheetCount],n=r.sheets[i];this.workbookActiveSheetCount++,this.activeSheetPrint(r,n,t,i)}else{for(var a,o=0;o<this.chartElements.length;o++){var l=document.getElementById(this.chartElements[o]);je(l)||l.remove()}0<this.multipleCanvasDataURL.length&&(n=navigator.userAgent,(a=window.open(" ","_blank","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no")).document.write("<html><head><title></title></head><body>"),-1!==n.indexOf("Chrome")||-1!==n.indexOf("Safari")||-1!==n.indexOf("Firefox")?(a.document.write("<!DOCTYPE html>"),a.document.write("<html><head><style>html, body {  } img { height: 100%; width: 100%; display: block; }@media print { body {  } img { width:100%; width:100%; box-sizing: border-box; }br, button { display: none; } div{ page-break-inside: avoid; }} @page{ size:"+1e3.toString()+"px "+1400..toString()+"px; }</style></head><body>")):(a.document.write("<!DOCTYPE html>"),a.document.write("<html><head><style>html, body {  } img { height: 100%; width: 100%; }@media print { body {  }img { width:100%; width:100%; box-sizing: border-box; }br, button { display: none; } div{ page-break-inside: avoid; }} @page{ size:"+1e3.toString()+"px "+1400..toString()+"px; }</style></head><body>")),this.multipleCanvasDataURL.forEach(function(e,t){var i=a.document.createElement("canvas"),n=(i.width=1e3,i.height=1400,i.getContext("2d")),o=new Image;o.onload=function(){n.drawImage(o,0,0,1e3,1400),t===s.multipleCanvasDataURL.length-1&&(r.isPrintingProcessing=!1,a.print(),a.document.close(),a.close(),r.printModule.setToDefault())},o.src=e,a.document.body.appendChild(i)}))}},dRe.prototype.drawBorder=function(e,t,i,n,o,r){var s=t.borderBottom,a=t.borderLeft,l=t.borderRight,h=t.borderTop,d=t.borderColor;e.strokeStyle=d||"black",je(s)||-1!==s.indexOf("#FFFFFF")||(e.strokeStyle=s.split(" ")[2],this.drawPath(i,(2===n?-2:n)+r,i+o,(2===n?-2:n)+r,e,s,!1,t,"bottom")),je(a)||-1!==a.indexOf("#FFFFFF")||(e.strokeStyle=a.split(" ")[2],this.drawPath(i,n,i,(2===n?-2:n)+r,e,a,!0,t,"left")),je(l)||-1!==l.indexOf("#FFFFFF")||(e.strokeStyle=l.split(" ")[2],this.drawPath(i+o,n,i+o,(2===n?-2:n)+r,e,l,!1,t,"right")),je(h)||-1!==h.indexOf("#FFFFFF")||(e.strokeStyle=h.split(" ")[2],this.drawPath(i,n,i+o,n,e,h,!0,t,"top"))},dRe.prototype.drawPath=function(e,t,i,n,o,r,s,a,l){if(o.beginPath(),-1<r.indexOf("dashed"))o.setLineDash([3,2]);else if(-1<r.indexOf("dotted"))o.setLineDash([1,1]);else{var h,d,p,c,u,g,m,f;if(-1<r.indexOf("double"))return o.setLineDash([]),h=!(je(a.borderBottom)||je(a.borderLeft)||je(a.borderRight)||je(a.borderTop)),d=!je(a.borderBottom)&&!je(a.borderLeft)&&je(a.borderRight)&&je(a.borderTop),p=je(a.borderBottom)&&!je(a.borderLeft)&&je(a.borderRight)&&!je(a.borderTop),c=!je(a.borderBottom)&&!je(a.borderLeft)&&je(a.borderRight)&&!je(a.borderTop),u=!je(a.borderBottom)&&je(a.borderLeft)&&!je(a.borderRight)&&je(a.borderTop),g=je(a.borderBottom)&&je(a.borderLeft)&&!je(a.borderRight)&&!je(a.borderTop),m=!je(a.borderBottom)&&je(a.borderLeft)&&!je(a.borderRight)&&!je(a.borderTop),f=je(a.borderBottom)&&!je(a.borderLeft)&&!je(a.borderRight)&&!je(a.borderTop),a=!je(a.borderBottom)&&!je(a.borderLeft)&&!je(a.borderRight)&&je(a.borderTop),o.lineWidth=1,h?e===i?s?this.drawDoubleBorder(o,e,t,i,n,e+3,t+3,i+3,n-2):this.drawDoubleBorder(o,e,t,i,n,e-3,t+3,i-3,n-2):t===n&&(s?this.drawDoubleBorder(o,e,t,i,n,e+2,t+3,i-2,n+3):this.drawDoubleBorder(o,e,t,i,n,e+2,t-3,i-2,n-3)):d?"left"===l?this.drawDoubleBorder(o,e,t,i,n,e+3,t,i+3,n-2):this.drawDoubleBorder(o,e,t,i,n,e+2,t-3,i,n-3):p?"left"===l?this.drawDoubleBorder(o,e,t,i,n,e+3,t+2,i+3,n):this.drawDoubleBorder(o,e,t,i,n,e+2,t+3,i,n+3):c?"left"===l?this.drawDoubleBorder(o,e,t,i,n,e+3,t+3,i+3,n-2):"top"===l?this.drawDoubleBorder(o,e,t,i,n,e+2,t+3,i,n+3):this.drawDoubleBorder(o,e,t,i,n,e+2,t-3,i,n-3):u?"right"===l?this.drawDoubleBorder(o,e,t,i,n,e-3,t,i-3,n-2):this.drawDoubleBorder(o,e,t,i,n,e,t-3,i-2,n-3):g?"right"===l?this.drawDoubleBorder(o,e,t,i,n,e-3,t+3,i-3,n):this.drawDoubleBorder(o,e,t,i,n,e,t+3,i-2,n+3):m?"right"===l?this.drawDoubleBorder(o,e,t,i,n,e-3,t+3,i-3,n-2):"top"===l?this.drawDoubleBorder(o,e,t,i,n,e,t+3,i-2,n+3):this.drawDoubleBorder(o,e,t,i,n,e,t-3,i-2,n-3):f?"right"===l?this.drawDoubleBorder(o,e,t,i,n,e-3,t+3,i-3,n):"top"===l?this.drawDoubleBorder(o,e,t,i,n,e+3,t+3,i-2,n+3):this.drawDoubleBorder(o,e,t,i,n,e+3,t+3,i+3,n):a?"right"===l?this.drawDoubleBorder(o,e,t,i,n,e-3,t,i-3,n-2):"bottom"===l?this.drawDoubleBorder(o,e,t,i,n,e+2,t-3,i-2,n-3):this.drawDoubleBorder(o,e,t,i,n,e+3,t,i+3,n-2):e===i?this.drawDoubleBorder(o,e,t,i,n,e+("left"===l?3:-3),t,i+("left"===l?3:-3),n):t===n&&this.drawDoubleBorder(o,e,t,i,n,e,t+("top"===l?3:-3),i,n+("top"===l?3:-3)),void o.stroke();o.setLineDash([])}o.lineWidth=r.split(" ")[0].split("")[0],o.moveTo(e,t),o.lineTo(i,n),o.stroke()},dRe.prototype.drawDoubleBorder=function(e,t,i,n,o,r,s,a,l){e.moveTo(t,i),e.lineTo(n,o),e.moveTo(r,s),e.lineTo(a,l)},dRe.prototype.calculateTextPosition=function(e,t,i,n,o){var r,s=t;if(e<=s)switch(n.toLowerCase()){case"left":r=i+3;break;case"center":r=i+(s-e)/2;break;case"right":r=o?i+(s-3):i+(s-3)-e}else r=!(e<t)||"left"===n.toLowerCase()?i+3:"center"===n.toLowerCase()?i+(t-e)/2:i+t-e;return r},dRe.prototype.calculatePageCount=function(e,t,i){var n=i,o=this.columnIndex;if(0===e.columns.length)return i=Math.floor(t/this.defaultCellWidth)-(n?1:0),Array(Math.max(1,Math.ceil(o/i))).fill(i);for(var r=0,s=[],a=0;a<=o;a++){var l=e.columns&&e.columns[a],l=(n?27:0)+(l&&l.hidden?0:l&&!je(l.width)?l.width:this.defaultCellWidth),n=!1;t<(r+=l)&&(s.push(a-1),n=!0,r=l)}return(0===s.length||s[s.length-1]<o)&&s.push(o),s},dRe.prototype.wrapText=function(e,r,s,a){var t,l,h,d,p,c,u,g,i,m,f,y,n,v;return je(e)?[""]:(t=[],u=0,g=e.toString().split(" "),i=Zpe(" ",s,a,!0),f="",e=0,y=function(e){u&&t.push(f),1<Hpe(l/r,!0)&&(e.split("").forEach(function(e){p=Zpe(e,s,a,!0),c+=e,Hpe(d+=p,!0)>r&&(t.push(c),d=p,c=e)}),l=d,e=c),f=e,u=l},n=g.length-1,v=function(e,t){1<=Hpe(e+i,!0)/r?l+=0:(l+=i,t!==n&&(f+=" "))},g.forEach(function(i,n){var o;p=d=0,l=Zpe(i,s,a,!(c="")),1<Hpe(u+l,!0)/r?1<(h=i.split("-")).length?(o=h.length-1,h.forEach(function(e,t){p=d=0,c="",m=m||Zpe("-",s,a,!0),l=Zpe(e,s,a,!0),t<o&&(l+=m,e+="-"),1<Hpe(u+l,!0)/r?(y(e),t===o&&v(l,n)):(f+=e,t===o&&g[g.length-1]!==i&&v(u+l,n),u+=l)})):(y(i),v(l,n)):(f+=i,v(u+l,n),u+=l)}),u&&(e=Hpe(u-i,!0)/r,parseFloat(e.toString().split(".")[0]),t.push(f)),t)},dRe.prototype.getModuleName=function(){return"print"},dRe.prototype.destroy=function(){this.setToDefault(),this.totalSheetCount=[],this.parent=null};var hRe=dRe;function dRe(e){this.totalSheetCount=[],this.workbookActiveSheetCount=0,this.defaultCellWidth=64,this.defaultCellHeight=19,this.pageCounts=[],this.initialRowCount=0,this.chartHeight=0,this.columnIndex=0,this.rowIndex=0,this.multipleCanvasDataURL=[],this.chartElements=[],this.totalCharts=0,this.isChartLoaded=!1,this.chartLoadedCount=0,this.isImageLoaded=!1,this.totalImages=0,this.imageLoadedCount=0,this.endRow=0,this.isColumn=!0,this.startNewPageCount=0,this.allowTimer=!1,this.parent=e}pRe=function(e,t){return(pRe=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])}))(e,t)};var pRe,cRe,uRe,gRe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},gRe=(function(e,t){function i(){this.constructor=e}pRe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(mRe,cRe=yJ),(uRe=mRe).prototype.getCell=function(e,t,i){var n;return this.insideViewport(e,t)&&(i=i||this.getRow(e,null,t),t=this.getViewportIndex(t,!0),n=i&&i.cells[t]),n},mRe.prototype.getRow=function(e,t,i){var n,o;return t||(o=this.getActiveSheet(),n=this.frozenRowCount(o),o=this.frozenColCount(o),t=je(i)||n-1<e&&o-1<i?this.getContentTable():e<n&&i<o?this.sheetModule.getSelectAllTable():e<n?this.getColHeaderTable():this.getRowHeaderTable()),e=this.getViewportIndex(e),t?t.rows[e]:null},mRe.prototype.hiddenCount=function(e,t,i,n){void 0===i&&(i="rows"),void 0===n&&(n=this.getActiveSheet());for(var o,r=0,s=e;s<=t;s++)(o=n[""+i][s])&&o.hidden&&r++;return r},mRe.prototype.getViewportIndex=function(e,t){var i=this.getActiveSheet(),n=this.frozenColCount(i),o=this.frozenRowCount(i);if(t){if(n)return t=ste(i.topLeftCell)[1],e<n?(e=e-this.hiddenCount(t,e,"columns")-t)+1:(e-=this.hiddenCount(this.viewport.leftIndex+n,e,"columns"))-(this.viewport.leftIndex+n);e=(e-=this.hiddenCount(this.viewport.leftIndex,e,"columns"))-this.viewport.leftIndex}else{if(o)return t=ste(i.topLeftCell)[0],e<o?(e=e-this.hiddenCount(t,e)-t)+1:(e-=this.hiddenCount(this.viewport.topIndex+o,e))-(this.viewport.topIndex+o);e=(e-=this.hiddenCount(this.viewport.topIndex,e))-this.viewport.topIndex}return e},mRe.prototype.preRender=function(){cRe.prototype.preRender.call(this),this.serviceLocator=new Ede,this.initServices()},mRe.prototype.initServices=function(){this.serviceLocator.register(ope,new Cn(this.getModuleName(),ppe,this.locale)),this.serviceLocator.register(rpe,new Iue(this)),this.serviceLocator.register(spe,new Eue(this)),this.serviceLocator.register(ape,new Mue(this))},mRe.prototype.render=function(){var e;cRe.prototype.render.call(this),this.element.setAttribute("tabindex","0"),this.renderModule=new kce(this),this.renderSpreadsheet(),this.wireEvents(),this.created&&!this.refreshing&&(this.created.observers?0<this.created.observers.length&&(e={observers:this.created.observers},this.isAngular&&(e={observers:this.created.observers,currentObservers:this.created.observers},this.created.currentObservers=[]),this.createdHandler=e,this.created.observers=[]):(this.createdHandler=this.created,this.setProperties({created:void 0},!0)))},mRe.prototype.renderSpreadsheet=function(){this.cssClass&&U([this.element],this.cssClass.split(" ")),this.setHeight(),this.setWidth(),mA({target:this.element},this.createElement),this.cssClass&&-1===this.cssClass.indexOf("e-mobile-view")&&this.isMobileView()&&this.element.classList.add("e-mobile-view"),F.isDevice&&this.element.classList.add("e-device"),this.sheetModule=this.serviceLocator.getService("sheet"),this.allowScrolling&&(this.scrollModule=new Hce(this)),this.scrollSettings.enableVirtualization&&new jce(this),this.renderModule.render(),new Zce(this)},mRe.prototype.showSpinner=function(){kA(this.element)},mRe.prototype.hideSpinner=function(){BA(this.element)},mRe.prototype.protectSheet=function(e,t,i){cRe.prototype.protectSheet.call(this,e,t,i)},mRe.prototype.unprotectSheet=function(e){cRe.prototype.unprotectSheet.call(this,e)},mRe.prototype.find=function(e){var t=this.getActiveSheet().activeCell;if(cRe.prototype.findHandler.call(this,e),!e.isAction)return t!==this.getActiveSheet().activeCell?this.getActiveSheet().name+"!"+this.getActiveSheet().activeCell:null},mRe.prototype.replace=function(e){e={value:e.value,mode:e.mode||"Sheet",isCSen:e.isCSen||!1,isEMatch:e.isEMatch||!1,searchBy:e.searchBy||"By Row",replaceValue:e.replaceValue,replaceBy:e.replaceBy,sheetIndex:ee(e.sheetIndex)?this.activeSheetIndex:e.sheetIndex,findOpt:e.findOpt||""},cRe.prototype.replaceHandler.call(this,e)},mRe.prototype.findAll=function(e,t,i,n,o){o=o<this.sheets.length?o:this.activeSheetIndex;var r=[];return this.notify(Eie,{value:e,mode:t=t||"Sheet",sheetIndex:o,isCSen:i=i||!1,isEMatch:n=n||!1,findCollection:r}),r},mRe.prototype.goTo=function(e){if(e.includes("!")){var t,i,n,o,r=Bre(this,Lre(e));if(void 0===r)return;if(r!==this.activeSheetIndex)return d=(i=e.substring(e.lastIndexOf("!")+1)).split(":")[0],t=this.sheets[r],this.setSheetPropertyOnMute(t,"activeCell",d),this.setSheetPropertyOnMute(t,"selectedRange",i),i=ste(d),t.frozenColumns||t.frozenRows?(d=ste(t.topLeftCell),t.frozenRows&&i[0]<d[0]||t.frozenColumns&&i[1]<d[1]||(s=this.frozenRowCount(t),p=this.frozenColCount(t),n=[],o=[],A=ste(t.paneTopLeftCell),s?(n.push(d[0]),i[0]>=s?o.push(i[0]):o.push(A[0])):(n.push(i[0]),o.push(i[0])),p?(n.push(d[1]),i[1]>=p?o.push(i[1]):o.push(A[1])):(n.push(i[1]),o.push(i[1])),this.setSheetPropertyOnMute(t,"topLeftCell",lte(n[0],n[1])),this.setSheetPropertyOnMute(t,"paneTopLeftCell",lte(o[0],o[1])))):(i[0]<this.viewport.rowCount&&(i[0]=0),i[1]<this.viewport.colCount&&(i[1]=0),this.updateTopLeftCell(i[0],i[1],null,t)),this.activeSheetIndex=r,void this.dataBind()}var s=rte(e),a=this.getActiveSheet(),l=this.frozenRowCount(a),h=this.frozenColCount(a),d=this.insideViewport(s[0],s[1]);if(d){this.selectRange(e);var p=ste(a.paneTopLeftCell),c=this.viewport.height,u=(this.allowScrolling&&(c-=this.getScrollElement().parentElement.getBoundingClientRect().height),0),g=0;if(l)for(var m=ste(a.topLeftCell)[0];m<l;m++)if(c<(u+=Wde(a,m))){g=m;break}if(0===g)for(m=p[0];m<=this.viewport.bottomIndex;m++){if(c<(u+=Wde(a,m))){g=m;break}m===this.viewport.bottomIndex&&(g=this.viewport.bottomIndex)}p[2]=g;var f=0,u=0,c=this.viewport.width-this.sheetModule.getScrollSize();if(h)for(m=ste(a.topLeftCell)[1];m<h;m++)if(c<(u+=Zde(a,m))){f=m;break}if(0===f)for(m=p[1];m<=this.viewport.rightIndex;m++){if(c<(u+=Zde(a,m))){f=m;break}m===this.viewport.rightIndex&&(f=this.viewport.rightIndex)}if(p[3]=f,s[0]>=p[0]&&s[0]<p[2]&&s[1]>=p[1]&&s[1]<p[3])return;if(l||h){if(p=[].concat(ste(a.topLeftCell),[l,p[3]]),s[0]>=p[0]&&s[0]<p[2]&&s[1]>=p[1]&&s[1]<p[3])return;if(p[2]=g,p[3]=h,s[0]>=p[0]&&s[0]<p[2]&&s[1]>=p[1]&&s[1]<p[3])return}}var y,v,b,w,C,S,A=this.getMainContent().parentElement;s[0]===l?b=0:(b=Ude(a,l,s[0]-1,!0),this.scrollSettings.enableVirtualization&&(S=b+this.getContentTable().getBoundingClientRect().height,(C=parseFloat(A.querySelector(".e-virtualtrack").style.height))<S)&&(S+=10,(y=A.querySelector(".e-virtualtrack")).style.height=S+"px",cpe(function(){y.style.height=C+"px"}))),A.scrollTop=b,A=this.element.getElementsByClassName("e-scroller")[0],s[1]===h?b=0:(b=$de(a,h,s[1]-1,!0),this.scrollSettings.enableVirtualization&&(S=b+this.getContentTable().getBoundingClientRect().width,(w=parseFloat(A.querySelector(".e-virtualtrack").style.width))<S)&&(S+=10,(y=A.querySelector(".e-virtualtrack")).style.width=S+"px",(v=this.getColumnHeaderContent().querySelector(".e-virtualtrack")).style.width=S+"px",(y=this.getMainContent().querySelector(".e-virtualtrack")).style.width=S+"px",cpe(function(){y.style.width=w+"px",v.style.width=w+"px"}))),A.scrollLeft=b,d||this.selectRange(e)},mRe.prototype.insideViewport=function(e,t){var i,n,o=this.getActiveSheet();return o.frozenRows||o.frozenColumns?(i=this.frozenRowCount(o),n=this.frozenColCount(o),(e>=(o=ste(o.topLeftCell))[0]&&e<i||e>=this.viewport.topIndex+i&&e<=this.viewport.bottomIndex)&&(t>=o[1]&&t<n||t>=this.viewport.leftIndex+n&&t<=this.viewport.rightIndex)):e>=this.viewport.topIndex&&e<=this.viewport.bottomIndex&&t>=this.viewport.leftIndex&&t<=this.viewport.rightIndex},mRe.prototype.resize=function(){this.renderModule.setSheetPanelSize(),this.scrollSettings.enableVirtualization&&this.renderModule.refreshSheet(!1,!0)},mRe.prototype.cut=function(e){var t=new Promise(function(e){e(void 0)});return this.notify(Vse,e?{range:pte(e),sId:(this.sheets[Bre(this,Lre(e))]?this.sheets[Bre(this,Lre(e))]:this.getActiveSheet()).id,promise:t,invokeCopy:!0,isPublic:!0}:{promise:t,invokeCopy:!0,isPublic:!0}),t},mRe.prototype.copy=function(e){var t=new Promise(function(e){e(void 0)});return this.notify(_se,e?{range:pte(e),sId:(this.sheets[Bre(this,Lre(e))]?this.sheets[Bre(this,Lre(e))]:this.getActiveSheet()).id,promise:t,invokeCopy:!0,isPublic:!0}:{promise:t,invokeCopy:!0,isPublic:!0}),t},mRe.prototype.paste=function(e,t){this.notify(Hse,{range:e&&pte(e),sIdx:e&&Bre(this,Lre(e)),type:t,isAction:!0,isInternal:!0})},mRe.prototype.updateAction=function(e){Gpe(e,this)},mRe.prototype.setHeight=function(){this.height&&(-1<this.height.toString().indexOf("%")&&(this.element.style.minHeight="400px"),this.element.style.height=T(this.height))},mRe.prototype.setWidth=function(){this.width&&((-1<this.width.toString().indexOf("%")||"auto"===this.width)&&(this.element.style.minWidth="300px"),this.element.style.width=T(this.width))},mRe.prototype.setColWidth=function(e,t,i){void 0===e&&(e=64),void 0===t&&(t=0);var n,o,r,s=je(i)?this.getActiveSheet():this.sheets[i];!s||s.isProtected&&!s.protectSettings.formatColumns||(o="number"==typeof e?e+"px":e,t=je(n=t)?ste(s.activeCell)[1]:t,i=function(){Kde(s,n).width=0<parseInt(o,10)?parseInt(o,10):0,s.columns[n].customWidth=!0},e=this.frozenColCount(s),s.id===this.getActiveSheet().id?(t>=this.viewport.leftIndex+e&&t<=this.viewport.rightIndex||e&&t<e?(t=this.getViewportIndex(t,!0),e=Zde(s,n,null,!0),(r=Hpe(parseInt(o,10))-e)<0&&e<-r&&(r=-e),i(),this.notify(nae,{threshold:r,colIdx:n,checkWrapCell:!0}),Qpe(n,t,o,!0,this)):(e=Zde(s,t),r=void 0,r=0<parseInt(o,10)?-(e-parseInt(o,10)):-e,i(),this.notify(nae,{threshold:r,colIdx:t})),this.notify(Jle,null)):i())},mRe.prototype.setRowHeight=function(e,t,i,n,o){void 0===e&&(e=20),void 0===t&&(t=0);var r,s,a,l=je(i)?this.getActiveSheet():this.sheets[i];l&&(t=je(r=t)?ste(l.activeCell)[0]:t,o&&l.rows[t]&&l.rows[t].customHeight||(s="number"==typeof e?e+"px":e,i=function(){Qde(l,r,0<parseInt(s,10)?parseInt(s,10):0),l.rows[r].customHeight=!0},l.id===this.getActiveSheet().id?(o=this.frozenRowCount(l),t>=this.viewport.topIndex+o&&t<=this.viewport.bottomIndex||o&&t<o?(t=this.getViewportIndex(r),e=Wde(l,r,!0),(a=Hpe(parseInt(s,10))-e)<0&&e<-a&&(a=-e),i(),this.notify(iae,{threshold:a,rowIdx:r,isCustomHgt:!0}),(n=je(n)?!1:n)||(Qpe(r,t,s,!1,this),n=!1)):(o=Wde(l,t),a=void 0,a=0<parseInt(s,10)?-(o-parseInt(s,10)):-o,i(),this.notify(iae,{threshold:a,rowIdx:r})),this.notify(Jle,null)):i()))},mRe.prototype.setRowsHeight=function(e,t,i){void 0===e&&(e=20),t=t||["1:"+(this.getActiveSheet().usedRange.rowIndex+1)],this.setSize(e,t,function(e){return Number(e)-1},this.setRowHeight.bind(this),i)},mRe.prototype.setColumnsWidth=function(e,t){void 0===e&&(e=64),t=t||["A:"+dte(this.getActiveSheet().usedRange.colIndex+1)],this.setSize(e,t,ate,this.setColWidth.bind(this))},mRe.prototype.setSize=function(i,e,n,o,r){var s,a,l,h,d=this;e.forEach(function(e){e.includes("!")?(a=e.substring(0,e.lastIndexOf("!")),s=Bre(d,a),e=e.substring(e.lastIndexOf("!")+1)):s=d.activeSheetIndex,e.includes(":")?(a=e.split(":"),l=n(a[0]),h=n(a[1])):l=h=n(e);for(var t=l;t<=h;t++)o(i,t,s,!1,r)})},mRe.prototype.autoFit=function(e){-1!==e.indexOf("!")&&(t=Bre(this,e.substring(0,e.lastIndexOf("!"))),e=e.substring(e.lastIndexOf("!")+1));var t,e=this.getIndexes(e),i=e.startIdx,n=e.endIdx,o=e.isCol,e=o?ate("XFD"):1048576;if(i<=e)for(e<n&&(n=e);i<=n;i++)this.notify(zae,{idx:i,isCol:o,sheetIdx:t})},mRe.prototype.getIndexes=function(e){o=-1!==e.indexOf(":")?(n=(o=e.split(":"))[0],o[1]):n=e,je(n)||(n=(e=this.getAddress(n)).address,t=e.isCol),je(o)||(o=(e=this.getAddress(o)).address,i=e.isCol);var t,i,n,o,e=!0===t&&!0===i;return{startIdx:e?ate(n.toUpperCase()):parseInt(n,10),endIdx:e?ate(o.toUpperCase()):parseInt(o,10),isCol:e}},mRe.prototype.getAddress=function(e){var t;return e.substring(0,1).match(/\D/g)?(t=!0,{address:e=e.replace(/[0-9]/g,""),isCol:t}):e.substring(0,1).match(/[0-9]/g)&&e.match(/\D/g)?{address:"",isCol:!1}:{address:e=(parseInt(e,10)-1).toString(),isCol:t}},mRe.prototype.addHyperlink=function(e,t,i){this.insertHyperlink(e,t,i,!0)},mRe.prototype.removeHyperlink=function(e){this.notify(Sae,{range:e,preventEventTrigger:!0})},mRe.prototype.insertHyperlink=function(e,t,i,n){if(this.allowHyperlink){var o,r=void 0,s=this.getActiveSheet();if(are(this,o=rte(t=t||s.name+"!"+s.activeCell)))this.notify(ele,null);else{for(var a=this.getCell(o[0],o[1]),l=[],h=0;a&&h<a.classList.length;h++)l.push(a.classList[h]);var d={hyperlink:e,address:t,displayText:i,cancel:!1},p={hyperlink:e,address:t,displayText:i};if(n||(this.trigger($ie,d),this.notify(fie,{action:"hyperlink",eventArgs:d})),!d.cancel){if(this.notify(nne,{hyperlink:e=d.hyperlink,cell:t=d.address,displayText:i,triggerEvt:!n}),t&&-1!==t.lastIndexOf("!")){for(var e=t.lastIndexOf("!"),c=t.substring(0,e),u=this.sheets,g=0;g<u.length;g++)u[g].name===c&&(r=g);s=this.sheets[r],t=t.substring(e+1)}if(s&&(o=rte(t=t||this.getActiveSheet().activeCell),n||(this.trigger(ene,p),this.notify(Vae,{action:"hyperlink",eventArgs:d})),s===this.getActiveSheet())){this.serviceLocator.getService("cell").refreshRange(o,!1,!1,!1,!0,nre(this));for(h=0;h<l.length;h++)this.getCell(o[0],o[1]).classList.contains(l[h])||this.getCell(o[0],o[1]).classList.add(l[h]);this.notify(qne,null)}}}}},mRe.prototype.addDataValidation=function(e,t){cRe.prototype.addDataValidation.call(this,e,t)},mRe.prototype.removeDataValidation=function(e){cRe.prototype.removeDataValidation.call(this,e)},mRe.prototype.addInvalidHighlight=function(e){cRe.prototype.addInvalidHighlight.call(this,e)},mRe.prototype.removeInvalidHighlight=function(e){cRe.prototype.removeInvalidHighlight.call(this,e)},mRe.prototype.conditionalFormat=function(e){cRe.prototype.conditionalFormat.call(this,e)},mRe.prototype.clearConditionalFormat=function(e){e=e||this.getActiveSheet().selectedRange,cRe.prototype.clearConditionalFormat.call(this,e)},mRe.prototype.setPanelSize=function(){var e;"auto"!==this.height&&((e=document.getElementById(this.element.id+"_sheet_panel")).style.height=this.element.getBoundingClientRect().height*this.viewport.scaleY-vpe(e,null,this.viewport.scaleY)+"px")},mRe.prototype.open=function(e){this.isOpen=!0,cRe.prototype.open.call(this,e),this.isOpen&&this.showSpinner()},mRe.prototype.hideRow=function(e,t,i){void 0===t&&(t=e),void 0===i&&(i=!0),this.renderModule?this.notify(Nne,{startIndex:e,endIndex:t,hide:i,actionUpdate:!1}):cRe.prototype.hideRow.call(this,e,t,i)},mRe.prototype.hideColumn=function(e,t,i){void 0===t&&(t=e),void 0===i&&(i=!0),this.renderModule?this.notify(Nne,{startIndex:e,endIndex:t,hide:i,isCol:!0,actionUpdate:!1}):cRe.prototype.hideColumn.call(this,e,t,i)},mRe.prototype.clear=function(e){this.notify(ule,{options:e})},mRe.prototype.refresh=function(e){var t,i=this;this.isReact&&this.clearTemplate(),e?(this.notify(zse,null),this.sheets.length=0,this.sheetNameCount=1,this.notify(zie,{}),this.notify(kae,null),this.createSheet(),this.activeSheetIndex=this.sheets.length-1,this.notify(dse,null),this.notify(Pie,{action:"initSheetInfo"}),this.renderModule.refreshSheet()):this.createdHandler?(t=function(){i.off(Zae,t),i.refresh()},this.on(Zae,t,this)):(this.notify(rae,{}),cRe.prototype.refresh.call(this))},mRe.prototype.insertImage=function(e,t){for(var i=0;i<e.length;i++)this.notify(Tle,{options:e[i],range:t||this.getActiveSheet().selectedRange,isPublic:!0})},mRe.prototype.deleteImage=function(e,t){this.notify(Ele,{id:e,range:t||this.getActiveSheet().selectedRange})},mRe.prototype.getRowHeaderContent=function(){return this.sheetModule.getRowHeaderPanel()},mRe.prototype.getColumnHeaderContent=function(){return this.sheetModule.getColHeaderPanel()},mRe.prototype.getMainContent=function(){return this.sheetModule.getContentPanel()},mRe.prototype.getSelectAllContent=function(){return this.sheetModule.getSelectAllContent()},mRe.prototype.getScrollElement=function(){return this.sheetModule.getScrollElement()},mRe.prototype.getContentTable=function(){return this.sheetModule.getContentTable()},mRe.prototype.getRowHeaderTable=function(){return this.sheetModule.getRowHeaderTable()},mRe.prototype.getColHeaderTable=function(){return this.sheetModule.getColHeaderTable()},mRe.prototype.getThreshold=function(e){e=Math.round((this.viewport[e+"Count"]+1)/2);return e<15?15:e},mRe.prototype.isMobileView=function(){return!je(this.cssClass)&&(-1<this.cssClass.indexOf("e-mobile-view")||F.isDevice)&&-1===this.cssClass.indexOf("e-desktop-view")&&!1},mRe.prototype.getValueRowCol=function(e,t,i,n,o,r,s){return cRe.prototype.getValueRowCol.call(this,e,t,i,n,o,r,s)},mRe.prototype.updateCell=function(e,t,i){je(i)&&(i=!0),this.updateCellInfo(e,t,i,void 0,void 0,!0)},mRe.prototype.updateCellInfo=function(e,t,i,n,o,r){var s;t=t||this.getActiveSheet().activeCell,are(this,rte(t))||(s=this.scrollSettings.isFinite,cRe.prototype.updateCellDetails.call(this,e,t,n,o,i,s,r))},mRe.prototype.getRowData=function(e,t){return cRe.prototype.getRowData.call(this,e,t)},mRe.prototype.sort=function(e,t){var i=this;if(!this.allowSorting)return Promise.reject();var n=[];if(this.sortCollection)for(var o=this.sortCollection.length-1;0<=o;o--)this.sortCollection[o]&&this.sortCollection[o].sheetIndex===this.activeSheetIndex&&(n.push(this.sortCollection[o]),this.sortCollection.splice(o,1));return this.notify(Doe,{sortOptions:e}),cRe.prototype.sort.call(this,e,t,n).then(function(e){return i.notify(Zie,e),Promise.resolve(e)})},mRe.prototype.setValueRowCol=function(e,t,i,n,o,r){if(this.isEdit||"#CIRCULARREF!"!==t||(s={action:"isCircularReference",argValue:t,address:(a=_re(this,Fre(this,e))).name+"!"+dte(n)+i},this.notify(fse,s),t=s.argValue),cRe.prototype.setValueRowCol.call(this,e,t,i,n,o,r),this.allowEditing)this.notify(mse,{action:"refreshDependentCellValue",rowIdx:i,colIdx:n,sheetIdx:Fre(this,e)});else{var s=Fre(this,e);if(i--,n--,this.activeSheetIndex===s){var a,t=void 0;if(t=zde(a=_re(this,s),i)||epe(a,n)?t:this.getCell(i,n)){if(t.parentElement){o=t.parentElement.getAttribute("aria-rowindex");if(o&&Number(o)-1!==i)return}r=Kre(i,n,a),e={value:r.value,format:r.format,onLoad:!0,formattedText:r.value,isRightAlign:!1,type:"General",cell:r,rowIndex:i,colIndex:n,isRowFill:!1};this.notify(Aie,e),this.refreshNode(t,e)}}}},mRe.prototype.getModuleName=function(){return"spreadsheet"},mRe.prototype.calculateNow=function(e,t){return cRe.prototype.calculateNow.call(this,e,t)},mRe.prototype.refreshNode=function(e,t){var i;if(e){if(t){t.result=je(t.formattedText)?je(t.result)?"":t.result:t.formattedText.toString(),!t.isRowFill&&((a=e.querySelector(".e-fill-before"))&&G(a),(a=ge(".e-fill",e))&&(G(a),e.style.display="table-cell"),a=ge(".e-fill-sec",e))&&G(a);var n,o,r,s,a=ge("#"+this.element.id+"_currency",e);if(a&&G(a),"Accounting"===t.type&&mre(t.value)&&t.result.includes(t.curSymbol))return n=o=a=void 0,o=t.result.trim().endsWith(t.curSymbol)?t.result:(a=t.result.includes(" "+t.curSymbol)?" "+t.curSymbol:t.curSymbol,t.result.split(a).join("")),d=e.querySelector(".e-databar-value"),s=e.querySelector(".e-iconsetspan"),r=void 0,0<(l=e).children.length&&-1<e.children[e.childElementCount-1].className.indexOf("e-addNoteIndicator")&&(r=document.getElementsByClassName("e-addNoteIndicator")[0]),d?(this.refreshNode(d,{result:o}),l=e.querySelector(".e-cf-databar")||e):e.querySelector("a")?e.querySelector("a").textContent=o:(n=!0,e.innerText=""),s&&e.insertBefore(s,e.firstElementChild),a&&((d=this.createElement("span",{id:this.element.id+"_currency",styles:"float: left"})).innerText=a,l.appendChild(d),je(r)||l.appendChild(r)),n&&(e.innerHTML+=o),void e.classList.add("e-right-align");s=void 0,!t.result||"true"!==t.result.toLowerCase()&&"false"!==t.result.toLowerCase()?s="e-right-align":(t.result=t.result.toUpperCase(),s="e-center-align",t.isRightAlign=!0),i=t.result,this.allowWrap||i.toString().includes("\n")&&(i=i.replace(/\n/g,"")),t.isRightAlign?e.classList.add(s):e.classList.remove(s)}i=je(i)?"":i,je(t.rowIndex)||je(t.colIndex)||pt(e,{"aria-label":(i?i+" ":"")+lte(t.rowIndex,t.colIndex)});var l,h=e.lastChild,a=(h&&"SPAN"===h.nodeName&&h.classList.contains("e-iconsetspan")&&(h=null),e.querySelector(".e-addNoteIndicator")),d=(a&&(h=a.previousSibling),e.querySelector(".e-databar-value")&&(h=e.querySelector(".e-databar-value").lastChild),e.querySelector(".e-hyperlink")&&(t.cell&&t.cell.wrap&&i&&i.toString().indexOf("\n")&&(e.querySelector(".e-hyperlink").textContent=i),h=e.querySelector(".e-hyperlink").lastChild),e.querySelector(".e-wrap-content"));!d||e.querySelector(".e-hyperlink")||e.querySelector(".e-databar-value")||(d.lastChild||d.appendChild(document.createTextNode("")),h=d.lastChild),(this.isAngular||this.isVue)&&e.classList.contains("e-cell-template")&&h&&(8===h.nodeType||3===h.nodeType)?3!==h.nodeType&&""===i||(l=function(){e.childElementCount||(3===h.nodeType?t.isRowFill||(h.nodeValue=i):e.appendChild(document.createTextNode(i)))},this.isAngular?cpe(l):l()):!h||3!==h.nodeType&&1!==h.nodeType?e.appendChild(document.createTextNode(i)):t.isRowFill||(!je(h.className)&&-1<h.className.indexOf("e-addNoteIndicator")?(h=e.lastChild).nodeValue=i:h.nodeValue=i)}},mRe.prototype.calculateHeight=function(e,t,i){void 0===t&&(t=1),void 0===i&&(i=1);var n=e&&e.fontSize||this.cellStyle.fontSize,e="Arial Black"===e.fontFamily?1.44:1.24;return(-1<n.indexOf("pt")?1.33*parseInt(n,10):parseInt(n,10))*e*t+i*e},mRe.prototype.skipHidden=function(e,t,i,n){void 0===i&&(i="rows"),void 0===n&&(n=this.scrollSettings.isFinite);var o,r=this.getActiveSheet();this.scrollSettings.isFinite&&(o=("rows"===i?r.rowCount:r.colCount)-1);for(var s=e;s<=t;s++)if(r[""+i][s]&&r[""+i][s].hidden){if(e===s&&e++,t++,n&&o<t){t=o;break}}else if(!n&&this.scrollSettings.isFinite&&o<t&&r[""+i][s-1]&&r[""+i][s-1].hidden){t--;break}return[e,t]},mRe.prototype.updateActiveBorder=function(e,t){t=ge((t=void 0===t?".e-ribbon":t)+" .e-tab-header .e-indicator",this.element);t.style.display="none",gt(t,{left:"",right:""}),gt(t,{left:e.offsetLeft+"px",right:e.parentElement.offsetWidth-(e.offsetLeft+e.offsetWidth)+"px"}),t.style.display=""},mRe.prototype.undo=function(){this.notify(Tae,{isUndo:!0,isPublic:!0})},mRe.prototype.redo=function(){this.notify(Tae,{isUndo:!1,isPublic:!0})},mRe.prototype.updateUndoRedoCollection=function(e){this.notify(Eae,{args:e,isPublic:!0})},mRe.prototype.addDefinedName=function(e){e={action:"addDefinedName",isAdded:!1,definedName:e};return this.notify(fse,e),e.isAdded},mRe.prototype.removeDefinedName=function(e,t){return cRe.prototype.removeDefinedName.call(this,e,t)},mRe.prototype.mouseClickHandler=function(e){this.notify(vse,e)},mRe.prototype.mouseDownHandler=function(e){this.notify(use,e)},mRe.prototype.keyUpHandler=function(e){z(e.target,".e-find-dlg")?this.notify(wne,e):this.notify(bse,e)},mRe.prototype.keyDownHandler=function(e){var t,i,n=z(e.target,".e-findtool-dlg");n?9===e.keyCode&&(t=e.target,e.shiftKey?t.classList.contains("e-text-findNext-short")&&(i=n.querySelector(".e-findRib-close .e-tbar-btn"))&&(e.preventDefault(),i.focus()):t.classList.contains("e-tbar-btn")&&t.parentElement.classList.contains("e-findRib-close")&&sce(n)):(this.notify(wse,e),i=z(e.target,".e-dialog"),this.enableKeyboardNavigation||!document.activeElement.classList.contains("e-cell")&&!i||-1<[38,40,33,34,35,36,9].indexOf(e.keyCode)&&e.preventDefault())},mRe.prototype.freeze=function(e){if(!(!this.allowFreezePane||e.row<0||e.column<0)){if(e.triggerEvent){var t={row:e.row,column:e.column,cancel:!1,sheetIndex:this.activeSheetIndex};if(this.notify(fie,{eventArgs:t,action:"freezePanes"}),t.cancel)return}this.on(cse,this.freezePaneUpdated,this),this.freezePanes(e.row,e.column),this.notify(qne,null)}},mRe.prototype.freezePaneUpdated=function(){this.off(cse,this.freezePaneUpdated);var e=this.getActiveSheet();sce(this.element),this.notify(Vae,{eventArgs:{row:e.frozenRows,column:e.frozenColumns,sheetIndex:this.activeSheetIndex},action:"freezePanes"})},mRe.prototype.wireEvents=function(){E.add(this.element,"click",this.mouseClickHandler,this),E.add(this.element,Tpe(),this.mouseDownHandler,this),E.add(this.element,"keyup",this.keyUpHandler,this),E.add(this.element,"keydown",this.keyDownHandler,this),this.on(Yle,this.freeze,this),this.on(coe,this.refreshInsertDelete,this)},mRe.prototype.destroy=function(){this.isReact&&this.clearTemplate(),this.unwireEvents(),this.notify(gse,null),cRe.prototype.destroy.call(this),this.element.innerHTML="",this.element.removeAttribute("tabindex"),this.element.removeAttribute("role"),this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("min-height"),this.element.style.removeProperty("min-width"),this.sheetModule&&this.sheetModule.destroy()},mRe.prototype.unwireEvents=function(){E.remove(this.element,"click",this.mouseClickHandler),E.remove(this.element,Tpe(),this.mouseDownHandler),E.remove(this.element,"keyup",this.keyUpHandler),E.remove(this.element,"keydown",this.keyDownHandler),this.off(Yle,this.freeze),this.off(coe,this.refreshInsertDelete)},mRe.prototype.refreshInsertDelete=function(t){var i,n=this;"Sheet"!==t.modelType&&(t.sheet.ranges.forEach(function(e){e.template&&e.address&&(i=rte(e.address),n.updateRangeOnInsertDelete(t,i))&&(e.address=hte(i))}),this.setSheetPropertyOnMute(t.sheet,"ranges",t.sheet.ranges))},mRe.prototype.addContextMenuItems=function(e,t,i,n){this.notify(Qse,{items:e,text:t,insertAfter:i=void 0===i?!0:i,isUniqueId:n})},mRe.prototype.removeContextMenuItems=function(e,t){this.notify(Use,{items:e,isUniqueId:t})},mRe.prototype.enableContextMenuItems=function(e,t,i){this.notify(qse,{items:e,enable:t=void 0===t?!0:t,isUniqueId:i})},mRe.prototype.enableFileMenuItems=function(e,t,i){this.notify(Gse,{items:e,enable:t=void 0===t?!0:t,isUniqueId:i})},mRe.prototype.hideFileMenuItems=function(e,t,i){this.notify(Yse,{items:e,hide:t=void 0===t?!0:t,isUniqueId:i})},mRe.prototype.addFileMenuItems=function(e,t,i,n){this.notify(Xse,{items:e,text:t,insertAfter:i=void 0===i?!0:i,isUniqueId:n})},mRe.prototype.hideRibbonTabs=function(e,t){this.notify(Kse,{tabs:e,hide:t=void 0===t?!0:t})},mRe.prototype.enableRibbonTabs=function(e,t){this.notify(Jse,{tabs:e,enable:t=void 0===t?!0:t})},mRe.prototype.addRibbonTabs=function(e,t){this.notify(Zse,{items:e,insertBefore:t})},mRe.prototype.enableToolbarItems=function(e,t,i){this.notify(Lse,[{tab:e,items:t,enable:void 0===i||i}])},mRe.prototype.hideToolbarItems=function(e,t,i){this.notify(eae,{tab:e,indexes:t,hide:i=void 0===i?!0:i})},mRe.prototype.addToolbarItems=function(e,t,i){this.notify($se,{tab:e,items:t,index:i})},mRe.prototype.selectRange=function(e){this.isEdit&&this.notify(mse,{action:"endEdit"}),this.notify(Ose,{address:e})},mRe.prototype.selectChart=function(e){this.selectOverlay(e,!0)},mRe.prototype.selectImage=function(e){this.selectOverlay(e)},mRe.prototype.selectOverlay=function(e,t){var i,n,o=this.getActiveSheet();!o.isProtected&&this.allowEditing&&(e||(n=Kre((n=ste(o.activeCell))[0],n[1],o,!1,!0),t?n.chart&&n.chart.length&&(e=n.chart[n.chart.length-1].id):n.image&&n.image.length&&(e=n.image[n.image.length-1].id)),e?(i=this.element.querySelector("#"+e)).classList.contains("e-ss-overlay")||(i=i.parentElement):i=this.element.querySelector(".e-ss-overlay"+(t?".e-datavisualization-chart":":not(.e-datavisualization-chart)")),i)&&(o=void 0,(n=this.element.getElementsByClassName("e-ss-overlay-active")[0])&&(n.classList.remove("e-ss-overlay-active"),o=n.classList.contains("e-datavisualization-chart"))&&this.notify(Lle,null),i.classList.add("e-ss-overlay-active"),i.classList.contains("e-datavisualization-chart")?(this.notify(Kne,{id:i.id}),o||this.notify(Nle,{id:i.id})):o&&this.notify(Vle,null))},mRe.prototype.deselectChart=function(){this.notify(Sle,{selector:".e-datavisualization-chart"})},mRe.prototype.deselectImage=function(){this.notify(Sle,{selector:":not(.e-datavisualization-chart)"})},mRe.prototype.startEdit=function(){this.notify(mse,{action:"startEdit",isNewValueEdit:!1})},mRe.prototype.closeEdit=function(){this.notify(mse,{action:"cancelEdit"})},mRe.prototype.endEdit=function(){this.notify(mse,{action:"endEdit",isPublic:!0})},mRe.prototype.print=function(e){void 0===e&&(e={type:"ActiveSheet",allowRowColumnHeader:!1,allowGridLines:!1}),this.allowPrint&&!je(this.printModule)&&this.printModule.print(this,e)},mRe.prototype.onPropertyChanged=function(c,u){var g,m=this;cRe.prototype.onPropertyChanged.call(this,c,u);for(var e=0,t=Object.keys(c);e<t.length;e++){var i,n,o=t[e],r=void 0,s=void 0,a=this.getActiveSheet(),l=this.getScrollElement();switch(o){case"enableRtl":if(!c.locale&&!c.currencyCode&&(r=(r=this.getColumnHeaderContent())&&r.parentElement)){if(c.enableRtl?(r.style.marginRight="",document.getElementById(this.element.id+"_sheet_panel").classList.add("e-rtl")):(r.style.marginLeft="",document.getElementById(this.element.id+"_sheet_panel").classList.remove("e-rtl")),this.allowScrolling&&this.scrollModule.setPadding(!0),this.allowAutoFill&&(i=this.element.querySelector(".e-dragfill-ddb"))&&(i=At(i,"dropdown-btn"))&&(i.enableRtl=c.enableRtl,i.dataBind()),this.sheetModule.setPanelWidth(a,this.getRowHeaderContent(),!0),this.allowImage||this.allowChart)for(var h,d=this.element.getElementsByClassName("e-ss-overlay"),p=void 0,f=void 0,y=0,v=d.length-1;y<=v;y++)(f=d[0]).classList.contains("e-datavisualization-chart")&&(p=(h=f.querySelector(".e-accumulationchart"))?At(h,"accumulationchart"):(h=f.querySelector(".e-chart"))&&At(h,"chart"))&&p.destroy(),G(f),y===v&&this.notify(doe,{});l&&(l.scrollLeft=0),this.selectRange(a.selectedRange)}break;case"cssClass":u.cssClass&&q([this.element],u.cssClass.split(" ")),c.cssClass&&U([this.element],c.cssClass.split(" "));break;case"activeSheetIndex":this.renderModule.refreshSheet(),this.notify(sae,{idx:c.activeSheetIndex});break;case"width":this.setWidth(),this.resize();break;case"height":this.setHeight(),this.resize();break;case"showRibbon":this.notify(ase,{prop:"showRibbon",onPropertyChange:!0});break;case"showFormulaBar":this.notify(lse,{uiUpdate:!0});break;case"showSheetTabs":this.notify(hse,null);break;case"cellStyle":this.renderModule.refreshSheet();break;case"allowEditing":this.allowEditing?(this.notify(mse,{action:"renderEditor"}),this.enableKeyboardNavigation&&(this.enableKeyboardNavigation=!1,this.dataBind(),this.enableKeyboardNavigation=!0,this.dataBind(),"None"!==(i=this.selectionSettings.mode))&&(this.selectionSettings.mode="None",this.dataBind(),this.selectionSettings.mode=i,this.dataBind())):this.notify(Sle,null);break;case"allowInsert":(s=this.element.getElementsByClassName("e-add-sheet-tab")[0])&&(s.disabled=!this.allowInsert,this.allowInsert?s.classList.contains("e-disabled")&&s.classList.remove("e-disabled"):s.classList.contains("e-disabled")||s.classList.add("e-disabled"));break;case"sheets":c.sheets===this.sheets?(this.renderModule.refreshSheet(),this.notify(dse,null),this.notify(Pie,{action:"initSheetInfo"})):Object.keys(c.sheets).forEach(function(e,t){var i,n,o,r,s,a,l,h=Number(e),d=c.sheets[h],p=_re(m,h);d.ranges&&Object.keys(d.ranges).length?((e=Object.keys(d.ranges)).forEach(function(e,t){d.ranges[Number(e)].info||(i=t)}),e.forEach(function(e,t){(ee(i)||i===t)&&(n=Number(e),o=d.ranges[n],r=p.ranges[n],s=o.dataSource,s=o.fieldsOrder&&r.info&&!s&&r.dataSource?r.dataSource:s)&&m.notify(pie,{sheetIdx:h,rangeIdx:n,changedData:s})})):d.paneTopLeftCell&&u.sheets&&u.sheets[""+h]&&u.sheets[""+h].paneTopLeftCell?m.activeSheetIndex===Number(h)&&(e=ste(d.paneTopLeftCell),a=ste(u.sheets[""+h].paneTopLeftCell),e[0]!==a[0]&&(l=m.frozenRowCount(m.getActiveSheet()),l=e[0]>l?Ude(m.getActiveSheet(),l,e[0]-1):0,m.notify(Kle,{top:l})),e[1]!==a[1])&&(l=m.frozenColCount(m.getActiveSheet()),a=e[1]>l?$de(m.getActiveSheet(),l,e[1]-1):0,m.notify(Kle,{left:a})):(0===t&&m.renderModule.refreshSheet(),m.showSheetTabs&&d.name&&!g&&(l=ge(".e-sheet-tabs-items",m.element),e=Number(h),l.children[e+1]?m.notify(xae,{items:l,value:d.name,idx:e}):(m.notify(dse,null),g=!0)))});break;case"locale":this.refresh();break;case"currencyCode":c.locale||this.refresh();break;case"password":0<this.password.length&&this.showSheetTabs&&(this.element.querySelector(".e-add-sheet-tab").setAttribute("disabled","true"),this.element.querySelector(".e-add-sheet-tab").classList.add("e-disabled"));break;case"isProtected":this.isProtected&&(n=this.element.getElementsByClassName("e-add-sheet-tab")[0])&&(n.disabled=this.isProtected,this.isProtected?n.classList.contains("e-disabled")&&n.classList.add("e-disabled"):n.classList.contains("e-disabled")||n.classList.remove("e-disabled"));break;case"allowFreezePane":this.notify(ase,{prop:"allowFreezePane",onPropertyChange:!0});break;case"allowImage":case"allowChart":this.renderModule.refreshSheet(),this.notify(ase,{prop:o,onPropertyChange:!0});break;case"calculationMode":"Manual"===u.calculationMode&&this.notify(Pie,{action:"ClearDependentCellCollection"}),this.notify(ase,{prop:o,onPropertyChange:!0});break;case"allowResizing":c.allowResizing&&this.notify(dhe,{propertyName:o});break;case"enableNotes":c.enableNotes&&this.notify(doe,{});break;case"allowNumberFormatting":case"allowWrap":case"allowCellFormatting":this.notify(ase,{prop:o,onPropertyChange:!0}),this.notify(doe,{});break;case"showAggregate":this.notify(hle,{remove:!this.showAggregate})}}},mRe.prototype.requiredModules=function(){return ipe(this)},mRe.prototype.appendTo=function(e){cRe.prototype.appendTo.call(this,e)},mRe.prototype.filter=function(e,t){return this.allowFiltering?(t=t||this.getActiveSheet().selectedRange,cRe.prototype.filter.call(this,e,t)):Promise.reject()},mRe.prototype.clearFilter=function(e,t){this.notify(Oae,{field:e,sheetIndex:t})},mRe.prototype.applyFilter=function(e,t){var i,n,o,r=this;return this.allowFiltering?(i=new Promise(function(e){e(void 0)}),e&&e.length&&e.forEach(function(e){n={instance:{options:{type:e.type,format:"date"===e.type&&"yMd"}},arg3:e.value,arg2:e.operator},r.notify(jI,n),e.value=n.arg3}),o=t?mte(this,t):this.activeSheetIndex,this.notify(Pae,e={predicates:e,range:t,isInternal:!0,promise:i,sIdx:o}),e.promise):Promise.reject()},mRe.prototype.addCustomFunction=function(e,t,i){cRe.prototype.addCustomFunction.call(this,e,t,i),this.notify(jae,null)},mRe.prototype.setRangeReadOnly=function(e,t,i){t=t||this.getActiveSheet().selectedRange;var i=i||this.activeSheetIndex,n=fte(rte(t)),o=_re(this,i);if(!je(o)){if(this.notify("actionBegin",{action:"readonly",eventArgs:{readOnly:e,range:t,sheetIdx:i}}),gce(t)||0===n[0]&&n[2]===o.rowCount-1)for(var r,s=n[1];s<=n[3];s++)e?Jde(o,s,{isReadOnly:e}):(r=Kde(o,s))&&r.isReadOnly&&delete r.isReadOnly;else if(mce(t)||0===n[1]&&n[3]===o.colCount-1)for(var a,l=n[0];l<=n[2];l++)e?Hde(o,l,{isReadOnly:e}):(a=_de(o,l))&&a.isReadOnly&&delete a.isReadOnly;else for(var h=n[1];h<=n[3];h++)for(var d=n[0];d<=n[2];d++)e?Jre(d,h,o,{isReadOnly:e},!0):(u=Kre(d,h,o))&&u.isReadOnly&&delete u.isReadOnly;for(var p=n[1];p<=n[3];p++)for(var c=n[0];c<=n[2];c++){var u=this.getCell(c,p);!e&&u&&u.classList.contains("e-readonly")?u.classList.remove("e-readonly"):u&&!u.classList.contains("e-readonly")&&(u.className+=" e-readonly")}this.notify("actionComplete",{action:"readonly",eventArgs:{readOnly:e,range:t,sheetIdx:i}})}},gRe([e("")],mRe.prototype,"cssClass",void 0),gRe([e(!0)],mRe.prototype,"allowScrolling",void 0),gRe([e(!0)],mRe.prototype,"allowResizing",void 0),gRe([e(!0)],mRe.prototype,"showAggregate",void 0),gRe([e(!0)],mRe.prototype,"enableClipboard",void 0),gRe([e(!0)],mRe.prototype,"enableContextMenu",void 0),gRe([e(!0)],mRe.prototype,"enableKeyboardNavigation",void 0),gRe([e(!0)],mRe.prototype,"enableKeyboardShortcut",void 0),gRe([e(!0)],mRe.prototype,"allowUndoRedo",void 0),gRe([e(!0)],mRe.prototype,"allowWrap",void 0),gRe([t({},Ode)],mRe.prototype,"selectionSettings",void 0),gRe([t({},wce)],mRe.prototype,"scrollSettings",void 0),gRe([i()],mRe.prototype,"beforeCellRender",void 0),gRe([i()],mRe.prototype,"beforeSelect",void 0),gRe([i()],mRe.prototype,"select",void 0),gRe([i()],mRe.prototype,"contextMenuBeforeOpen",void 0),gRe([i()],mRe.prototype,"fileMenuBeforeOpen",void 0),gRe([i()],mRe.prototype,"contextMenuBeforeClose",void 0),gRe([i()],mRe.prototype,"dialogBeforeOpen",void 0),gRe([i()],mRe.prototype,"fileMenuBeforeClose",void 0),gRe([i()],mRe.prototype,"contextMenuItemSelect",void 0),gRe([i()],mRe.prototype,"fileMenuItemSelect",void 0),gRe([i()],mRe.prototype,"beforeDataBound",void 0),gRe([i()],mRe.prototype,"dataBound",void 0),gRe([i()],mRe.prototype,"dataSourceChanged",void 0),gRe([i()],mRe.prototype,"cellEdit",void 0),gRe([i()],mRe.prototype,"cellEditing",void 0),gRe([i()],mRe.prototype,"cellEdited",void 0),gRe([i()],mRe.prototype,"cellSave",void 0),gRe([i()],mRe.prototype,"beforeCellSave",void 0),gRe([i()],mRe.prototype,"created",void 0),gRe([i()],mRe.prototype,"beforeSort",void 0),gRe([i()],mRe.prototype,"beforeHyperlinkCreate",void 0),gRe([i()],mRe.prototype,"afterHyperlinkCreate",void 0),gRe([i()],mRe.prototype,"beforeHyperlinkClick",void 0),gRe([i()],mRe.prototype,"afterHyperlinkClick",void 0),gRe([i()],mRe.prototype,"beforeConditionalFormat",void 0),gRe([i()],mRe.prototype,"actionBegin",void 0),gRe([i()],mRe.prototype,"actionComplete",void 0),gRe([i()],mRe.prototype,"openComplete",void 0),gRe([i()],mRe.prototype,"sortComplete",void 0),gRe([e("USD")],mRe.prototype,"currencyCode",void 0),uRe=gRe([Bt],mRe));function mRe(e,t){e=cRe.call(this,e)||this;return e.viewport={rowCount:0,colCount:0,height:0,topIndex:0,leftIndex:0,width:0,bottomIndex:0,rightIndex:0,beforeFreezeHeight:0,beforeFreezeWidth:0,scaleX:1,scaleY:1},e.needsID=!0,uRe.Inject(Uue,Gue,Jue,Vce,Oce,Qce,qce,Lce,rse,$ue,nge,tge,rge,Yce,Xue,rue,sde,che,Che,ode,Uhe,zhe,age,Khe,Kce,nue,Zhe,hge,eue,lde,aue,hue,dde,cde,pue,gde,hRe,uue,bde,mue,yde,yue,Cde,pge,bue,ede,Ade,aRe,ide,Cue,Ide,Aue),t&&e.appendTo(t),e}gRe.Inject(Lce,Oce,Qce,qce,Vce,nge,Gue,Uue,tge,$ue,Jue,rse,Yce,rge,Xue);var yJ=Object.freeze({__proto__:null,Workbook:yJ,Range:Zo,UsedRange:M$,Sheet:kre,getSheetIndex:Bre,getSheetIndexFromId:Fre,getSheetNameFromAddress:Lre,getSheetIndexByName:Rre,updateSelectedRange:Ore,getSelectedRange:Nre,getSingleSelectedRange:Vre,getSheet:_re,getSheetNameCount:Hre,getMaxSheetId:zre,initSheet:jre,getSheetName:Wre,moveSheet:Qre,duplicateSheet:Ure,Row:Nde,getRow:_de,setRow:Hde,isHiddenRow:zde,isFilterHidden:jde,getRowHeight:Wde,setRowHeight:Qde,getRowsHeight:Ude,Column:Yde,getColumn:Kde,setColumn:Jde,getColumnWidth:Zde,getColumnsWidth:$de,isHiddenCol:epe,checkColumnValidation:tpe,Cell:Yre,getCell:Kre,setCell:Jre,skipDefaultValue:Zre,wrap:$re,getColorCode:ese,getCustomColors:tse,isCustomDateTime:ise,OpenSettings:Xo,getData:Cre,getValueFromFormat:Sre,getModel:function(e,t){var i,n,o;if(ee(e[t])||!e[t]||e[t].index!==t)for(var r=0;r<=t;r++)if(e&&e[r]){if(0<(i=e[r].index-r)){for(e.forEach(function(e,t){e&&e.index&&(o=e.index,n=1),e&&!e.index&&0!==t&&(e.index=o+n),n++});i--;)e.splice(r,0,null);r+=i}}else e?e[r]=null:e=[];return e[t]},processIdx:Are,getRangeIndexes:rte,getCellIndexes:ste,getColIndex:ate,getCellAddress:lte,getRangeAddress:hte,getColumnHeaderText:dte,getIndexesFromAddress:pte,getRangeFromAddress:cte,getAddressFromSelectedRange:ute,getAddressInfo:gte,getSheetIndexFromAddress:mte,getSwapRange:fte,isSingleCell:vte,executeTaskAsync:bte,getWorkbookRequiredModules:Ste,CellStyle:mJ,FilterCollection:x$,SortCollection:d$,DefineName:Pte,ProtectSettings:g$,Hyperlink:k$,Validation:D$,Format:z$,ConditionalFormat:_$,LegendSettings:$$,DataLabelSettings:H$,Border:pJ,MarkerSettings:fJ,MajorGridLines:Oee,MinorGridLines:Vee,Axis:jee,Chart:tte,Image:nte,AutoFillSettings:Wo,workbookDestroyed:hie,updateSheetFromDataSource:die,dataSourceChanged:pie,dataChanged:cie,triggerDataChange:uie,workbookOpen:gie,beginSave:mie,beginAction:fie,sortImport:yie,findToolDlg:vie,exportDialog:bie,setFilteredCollection:wie,saveCompleted:Cie,applyNumberFormatting:Sie,getFormattedCellObject:Aie,calculateFormula:xie,refreshCellElement:Iie,setCellFormat:Tie,findAllValues:Eie,textDecorationUpdate:Die,applyCellFormat:Mie,updateUsedRange:"updateUsedRange",updateRowColCount:kie,workbookFormulaOperation:Pie,workbookEditOperation:Bie,checkDateFormat:Fie,checkNumberFormat:Lie,parseDecimalNumber:Rie,getFormattedBarText:Oie,activeCellChanged:Nie,openSuccess:Vie,openFailure:_ie,sheetCreated:Hie,sheetsDestroyed:zie,aggregateComputation:jie,getUniqueRange:Wie,removeUniquecol:Qie,checkUniqueRange:Uie,reApplyFormula:qie,clearFormulaDependentCells:Gie,formulaInValidation:Yie,beforeSort:Xie,initiateSort:Kie,updateSortedDataOnCell:Jie,sortComplete:Zie,sortRangeAlert:"sortRangeAlert",initiatelink:"initiatelink",beforeHyperlinkCreate:$ie,afterHyperlinkCreate:ene,beforeHyperlinkClick:tne,afterHyperlinkClick:ine,addHyperlink:"addHyperlink",setLinkModel:nne,beforeFilter:"beforeFilter",initiateFilter:one,filterComplete:"filterComplete",filterRangeAlert:rne,clearAllFilter:"clearAllFilter",wrapEvent:sne,onSave:ane,insert:lne,deleteAction:hne,insertModel:dne,deleteModel:pne,isValidation:cne,cellValidation:une,addHighlight:gne,dataValidate:"dataValidate",find:mne,goto:fne,findWorkbookHandler:"findHandler",replace:yne,replaceAll:vne,showFindAlert:bne,findKeyUp:wne,removeHighlight:Cne,queryCellInfo:Sne,count:Ane,findCount:"findCount",protectSheetWorkBook:xne,updateToggle:Ine,protectsheetHandler:Tne,replaceAllDialog:Ene,unprotectsheetHandler:Dne,workBookeditAlert:Mne,workbookReadonlyAlert:kne,setLockCells:Pne,applyLockCells:"applyLockCells",setMerge:Bne,applyMerge:Fne,mergedRange:Lne,activeCellMergedRange:Rne,insertMerge:One,hideShow:Nne,setCFRule:Vne,applyCF:_ne,clearCFRule:Hne,clear:zne,clearCF:jne,setImage:Wne,setChart:Qne,initiateChart:Une,refreshRibbonIcons:qne,refreshChart:Gne,refreshChartSize:Yne,deleteChartColl:Xne,initiateChartModel:"initiateChartModel",focusChartBorder:Kne,saveError:Jne,updateHighlight:Zne,beforeInsert:$ne,beforeDelete:eoe,deleteHyperlink:toe,moveOrDuplicateSheet:ioe,setAutoFill:noe,refreshCell:ooe,getFillInfo:roe,getautofillDDB:soe,rowFillHandler:aoe,getTextSpace:loe,refreshClipboard:hoe,updateView:doe,selectionComplete:poe,refreshInsertDelete:coe,getUpdatedFormulaOnInsertDelete:uoe,beforeCellUpdate:goe,duplicateSheetFilterHandler:moe,unMerge:foe,checkFormulaRef:yoe,parseFormulaArgument:voe,getCellRefValue:boe,commputeFormulaValue:woe,getChartRowIdxFromClientY:Coe,getChartColIdxFromClientX:Soe,refreshChartCellOnInit:Aoe,localizedFormatAction:xoe,moveSheetHandler:Ioe,addListValidationDropdown:Toe,sheetRenameUpdate:Eoe,updateSortCollection:Doe,checkIsFormula:Poe,isCellReference:Boe,isChar:Foe,isRowSelected:Loe,isColumnSelected:Roe,inRange:Ooe,isInMultipleRange:Noe,isInRange:Voe,getSplittedAddressForColumn:_oe,isLocked:Hoe,isValidCellReference:zoe,columnIndex:joe,skipHiddenIdx:Woe,isHeightCheckNeeded:Qoe,getUpdatedFormula:Uoe,getLeadingSpaces:qoe,getTrailingSpaces:Goe,updateCell:Yoe,getDataRange:Xoe,insertFormatRange:Koe,deleteFormatRange:Joe,updateCFModel:Zoe,checkRange:$oe,parseLocaleNumber:ere,getViewportIndexes:tre,setVisibleMergeIndex:ire,isImported:nre,getAutoDetectFormatParser:ore,applyPredicates:rre,isReadOnly:sre,isReadOnlyCells:are,getUpdatedRange:lre,updateMergeBorder:hre,toFraction:dre,getGcd:pre,intToDate:cre,dateToInt:ure,isDateTime:gre,isNumber:mre,evaluate:fre,toDate:yre,parseIntValue:vre,workbookLocale:bre,localeData:wre,DataBind:rse,WorkbookOpen:che,WorkbookSave:Che,WorkbookFormula:zhe,WorkbookNumberFormat:Uhe,getFormatFromType:Ghe,getTypeFromFormat:Yhe,convertToDefaultFormat:Xhe,configureLocalizedFormat:function(e,t,i){(i=void 0===i?!0:i)&&Whe&&(Whe.clear(),Whe=null),t&&t.length&&(Whe=Whe||new Map,t.forEach(function(e){Whe.set(e.id,e.code)})),e&&e.notify(xoe,{action:"mapNumberFormatId"})},WorkbookSort:Khe,WorkbookFilter:Zhe,WorkbookImage:ede,WorkbookChart:ide,WorkbookCellFormat:ode,WorkbookEdit:sde,WorkbookHyperlink:lde,WorkbookInsert:dde,WorkbookDelete:cde,WorkbookDataValidation:gde,WorkbookFindAndReplace:yde,WorkbookProtectSheet:bde,WorkbookMerge:Cde,WorkbookConditionalFormat:Ade,WorkbookAutoFill:Ide,getRequiredModules:ipe,ribbon:ase,formulaBar:lse,sheetTabs:hse,refreshSheetTabs:dse,isFormulaBarEdit:pse,contentLoaded:cse,mouseDown:use,spreadsheetDestroyed:gse,editOperation:mse,formulaOperation:fse,formulaBarOperation:yse,click:vse,keyUp:bse,keyDown:wse,formulaKeyUp:"formulaKeyUp",formulaBarUpdate:"formulaBarUpdate",onVerticalScroll:Cse,onHorizontalScroll:Sse,focusRenameInput:Ase,beforeContentLoaded:xse,beforeVirtualContentLoaded:Ise,virtualContentLoaded:Tse,contextMenuOpen:"contextMenuOpen",cellNavigate:Ese,mouseUpAfterSelection:Dse,cMenuBeforeOpen:Mse,insertSheetTab:kse,removeSheetTab:Pse,renameSheetTab:Bse,ribbonClick:Fse,refreshRibbon:"ribbonRefresh",enableToolbarItems:Lse,tabSwitch:Rse,selectRange:Ose,rangeSelectionByKeydown:Nse,cut:Vse,copy:_se,paste:Hse,clearCopy:zse,dataBound:jse,beforeDataBound:Wse,addContextMenuItems:Qse,removeContextMenuItems:Use,enableContextMenuItems:qse,enableFileMenuItems:Gse,hideFileMenuItems:Yse,addFileMenuItems:Xse,hideRibbonTabs:Kse,enableRibbonTabs:Jse,addRibbonTabs:Zse,addToolbarItems:$se,hideToolbarItems:eae,beforeRibbonCreate:tae,rowHeightChanged:iae,colWidthChanged:nae,onContentScroll:oae,deInitProperties:rae,activeSheetChanged:sae,initiateCustomSort:aae,applySort:lae,collaborativeUpdate:"collaborativeUpdate",autoFit:hae,refreshFilterCellsOnResize:dae,updateToggleItem:pae,initiateHyperlink:cae,editHyperlink:uae,openHyperlink:gae,addNote:mae,editNote:fae,deleteNote:yae,showNote:vae,createNoteIndicator:bae,updateNoteContainer:wae,removeNoteContainer:Cae,removeHyperlink:Sae,createHyperlinkElement:Aae,sheetNameUpdate:xae,hideSheet:Iae,performUndoRedo:Tae,updateUndoRedoCollection:Eae,setActionData:Dae,getBeforeActionData:Mae,clearUndoRedoCollection:kae,initiateFilterUI:Pae,renderFilterCell:Bae,refreshFilterRange:Fae,reapplyFilter:Lae,filterByCellValue:Rae,clearFilter:Oae,getFilteredColumn:Nae,completeAction:Vae,filterCellKeyDown:_ae,getFilterRange:Hae,setAutoFit:zae,refreshFormulaDatasource:jae,initiateDataValidation:Wae,validationError:"validationError",startEdit:"startEdit",invalidData:Qae,clearInvalid:"clearInvalid",protectSheet:Uae,applyProtect:qae,unprotectSheet:"unprotectSheet",protectCellFormat:Gae,gotoDlg:Yae,findDlg:Xae,findHandler:Kae,created:Jae,spreadsheetCreated:Zae,editAlert:$ae,readonlyAlert:ele,finiteAlert:tle,setUndoRedo:ile,enableFormulaInput:nle,protectSelection:ole,hiddenMerge:rle,checkPrevMerge:sle,checkMerge:ale,removeDataValidation:lle,showAggregate:hle,goToSheet:dle,showSheet:ple,renderCFDlg:cle,clearViewer:ule,initiateFormulaReference:gle,initiateCur:mle,clearCellRef:fle,editValue:yle,addressHandle:vle,initiateEdit:ble,forRefSelRender:wle,insertImage:Cle,refreshOverlayElem:Sle,refreshImgCellObj:Ale,getRowIdxFromClientY:xle,getColIdxFromClientX:Ile,createImageElement:Tle,deleteImage:Ele,deleteChart:Dle,refreshChartCellObj:Mle,refreshChartCellModel:kle,refreshImagePosition:Ple,updateTableWidth:Ble,focusBorder:Fle,clearChartBorder:Lle,insertChart:Rle,chartRangeSelection:Ole,insertDesignChart:Nle,removeDesignChart:Vle,chartDesignTab:_le,addChartEle:Hle,undoRedoForChartDesign:zle,protectWorkbook:jle,unProtectWorkbook:Wle,setProtectWorkbook:Qle,removeWorkbookProtection:Ule,importProtectWorkbook:qle,selectionStatus:Gle,freeze:Yle,overlayEleSize:Xle,updateScroll:Kle,positionAutoFillElement:Jle,hideAutoFillOptions:Zle,performAutoFill:$le,selectAutoFillRange:ehe,autoFill:"autoFill",hideAutoFillElement:the,unProtectSheetPassword:ihe,updateTranslate:nhe,getUpdatedScrollPosition:ohe,updateScrollValue:rhe,beforeCheckboxRender:she,refreshCheckbox:ahe,renderInsertDlg:lhe,toggleProtect:hhe,propertyChange:dhe,updateWrapCell:phe,getUpdateUsingRaf:cpe,removeAllChildren:upe,getColGroupWidth:gpe,getScrollBarWidth:ype,getSiblingsHeight:vpe,inView:wpe,getCellPosition:Cpe,setPosition:Spe,removeRangeEle:Ape,locateElem:xpe,setStyleAttribute:Ipe,getStartEvent:Tpe,getMoveEvent:Epe,getEndEvent:Dpe,isTouchStart:Mpe,isTouchMove:kpe,isTouchEnd:Ppe,isMouseDown:Bpe,isMouseMove:Fpe,isMouseUp:Lpe,isNavigationKey:Rpe,getClientX:Ope,getClientY:Npe,getPageX:Vpe,getPageY:_pe,getDPRValue:Hpe,setAriaOptions:jpe,destroyComponent:Wpe,setResize:Qpe,setWidthAndHeight:Upe,setTextLineHeight:function(e){fpe=e},findMaxValue:qpe,updateAction:Gpe,hasTemplate:Ype,setRowEleHeight:Xpe,getTextHeight:Kpe,getLineHeight:Jpe,getTextWidth:Zpe,getLines:$pe,getBorderWidth:ece,getBorderHeight:tce,getExcludedColumnWidth:ice,getTextHeightWithBorder:nce,setMaxHgt:oce,getMaxHgt:rce,focus:sce,isLockedCells:ace,isDiscontinuousRange:lce,clearRange:hce,getBottomOffset:dce,getRightIdx:pce,setColMinWidth:function(e,t){e.renderModule.setSheetPanelSize(t)},addDPRValue:cce,getSheetProperties:function(e,t){var i,n,o,r,s=[],a=(t?((i=(a=Object.getPrototypeOf(new Yre(e,"cells",{},!0)).constructor.prototype.propList).colPropNames.concat(a.complexPropNames).concat(a.propNames)).push("formattedText"),n=(a=Object.getPrototypeOf(new Nde(e,"rows",{},!0)).constructor.prototype.propList).colPropNames.concat(a.complexPropNames).concat(a.propNames),o=(a=Object.getPrototypeOf(new Yde(e,"columns",{},!0)).constructor.prototype.propList).colPropNames.concat(a.complexPropNames).concat(a.propNames),(a=(a=Object.getPrototypeOf(new kre(e,"sheets",{},!0)).constructor.prototype.propList).colPropNames.concat(a.complexPropNames).concat(a.propNames)).splice(a.indexOf("rows"),1),a.splice(a.indexOf("columns"),1),a.splice(a.indexOf("cells"),1),n.splice(n.indexOf("cells"),1),s.push.apply(s,a),-1===t.indexOf("rows")&&s.push.apply(s,n),-1===t.indexOf("columns")&&s.push.apply(s,o),-1===t.indexOf("cells")&&s.push.apply(s,i),t.forEach(function(e){r=s.indexOf(e),-1<s.indexOf(e)&&s.splice(r,1)})):s.push("ranges"),{skipProps:s});return e.notify("getStringifyObject",a),a.model},getChartsIndexes:uce,isColumnRange:gce,isRowRange:mce,setStandardHeight:function(e,t,i){(t=e.sheets[t])&&(t.standardHeight=i,e.dataBind())},getStandardHeight:function(e,t){return e.sheets[t].standardHeight},removeElements:fce,ScrollSettings:wce,SelectionSettings:Ode,DISABLED:"e-disabled",WRAPTEXT:npe,locale:ope,dialog:rpe,actionEvents:spe,overlay:ape,fontColor:lpe,fillColor:hpe,keyCodes:dpe,defaultLocale:ppe,Spreadsheet:gRe,Clipboard:Lce,Edit:Oce,Selection:Vce,Scroll:Hce,VirtualScroll:jce,KeyboardNavigation:Qce,KeyboardShortcut:qce,CellFormat:Yce,Resize:Kce,ShowHide:Zce,SpreadsheetHyperlink:eue,UndoRedo:nue,WrapText:rue,Insert:aue,Delete:hue,DataValidation:pue,ProtectSheet:uue,FindAndReplace:mue,Merge:yue,ConditionalFormatting:bue,AutoFill:Cue,SpreadsheetNote:Aue,Ribbon:Uue,FormulaBar:Gue,Formula:Xue,SheetTabs:Jue,Open:$ue,Save:tge,ContextMenu:nge,NumberFormat:rge,Sort:age,Filter:hge,SpreadsheetImage:pge,SpreadsheetChart:aRe,Render:kce,SheetRender:xce,RowRenderer:Tce,CellRenderer:Dce,Calculate:Fhe,FormulaError:Rhe,FormulaInfo:Ohe,CalcSheetFamilyItem:Vhe,getAlphalabel:_he,ValueChangedArgs:Hhe,Parser:Dhe,CalculateCommon:qo,isUndefined:function(e){return void 0===e},getSkeletonVal:xhe,isExternalFileLink:Ihe,get CommonErrors(){return yhe},get FormulasErrorsStrings(){return vhe},get ExcelFileFormats(){return bhe},BasicFormulas:The}),Zo=Object.freeze({__proto__:null,getModel:KN,upDownKeyHandler:JN,setBlankIconStyle:ZN,Item:e2,DropDownMenuAnimationSettings:d2,DropDownButton:u2,SplitButton:b2,Deferred:C2,createButtonGroup:function(e,t,i){void 0===t&&(t={}),je(i)&&(i=Q);var n,o,r,s,a=document.querySelector(e),l=(U([a],["e-btn-group","e-css"]),a.setAttribute("role","group"),a.children);t.buttons=t.buttons||[];for(var h=0,d=0;d<l.length;h++,d++)n=l[d],null!==(s=t.buttons[h])&&("BUTTON"===n.tagName?o=n:(o=i("label"),(r=l[d+1])?a.insertBefore(o,r):a.appendChild(o),n.id&&o.setAttribute("for",n.id),s&&s.disabled&&(n.disabled=!0),d++),t.cssClass&&s&&!s.cssClass&&(s.cssClass=t.cssClass),new zv(s||{},o));return a},SpinSettings:D2,AnimationSettings:P2,ProgressButton:aN}),fRe="cellClick",yRe="cellDoubleClick",vRe="moreEventsClick",bRe="select",wRe="actionBegin",CRe="actionComplete",SRe="actionFailure",ARe="navigating",xRe="renderCell",IRe="eventClick",TRe="eventDoubleClick",ERe="eventRendered",DRe="dataBinding",MRe="popupOpen",kRe="popupClose",PRe="resizeStart",BRe="resizeStop",FRe="inlineClick",LRe="cellSelect",RRe="virtualScrollStart",ORe="virtualScrollStop",NRe="noEvents",VRe="agendaCells",_Re="resourceHeader",HRe="dateHeader",zRe="beforePaste",jRe="beforePrint",WRe="excelExport",QRe="tooltipOpen",URe="print",qRe="data-ready",GRe="events-loaded",YRe="content-ready",XRe="scroll",KRe="virtual-scroll",JRe="scroll-ui-update",ZRe="ui-update",$Re="document-click",eOe="document-paste",tOe="cell-mouse-down",iOe=864e5;function nOe(e,t,i){t=Q("div",{className:t}).cloneNode();return t.style.visibility="hidden",t.style.position="absolute",e.appendChild(t),e=NOe(t,i),ue(t),e}function oOe(e,t,i){t=Q("div",{className:t}).cloneNode();return t.style.visibility="hidden",t.style.position="absolute",e.appendChild(t),e=OOe(t,i),ue(t),e}function rOe(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m42:0}function sOe(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m41:0}function aOe(e,t){e=new Date(e.getTime());return t=(t-e.getDay()-7)%7,new Date(e.setDate(e.getDate()+(isNaN(t)?0:t)))}function lOe(e,t){e=aOe(e,t),t=new Date(e.getFullYear(),e.getMonth(),e.getDate()+6);return new Date(t.getTime())}function hOe(e){return new Date(e.getFullYear(),e.getMonth(),1)}function dOe(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function pOe(e){var t=new Date(e.getFullYear(),0,1).valueOf(),e=new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf();return Math.ceil((e-t+iOe)/iOe/7)}function cOe(e,t){return new Date(t.valueOf()-(t.valueOf()-e.valueOf())/2)}function uOe(e,t){var i=e.getTimezoneOffset(),t=new Date(e.getTime()+t),i=t.getTimezoneOffset()-i;return e.setTime(t.getTime()+6e4*i),e}function gOe(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function mOe(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTimezoneOffset(),t=e.getTimezoneOffset()-t;return e.getTime()-new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTime()-60*t*1e3}function fOe(e,t){return Math.ceil((t.getTime()-e.getTime())/iOe)}function yOe(e,t){return e=new Date(""+e),new Date(e.setDate(e.getDate()+t))}function vOe(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,COe(e))),e}function bOe(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,COe(e))),e}function wOe(e,t,i){var n=new Date(e.getTime()),t=(n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds()),new Date(e.getTime()));return 0===i.getHours()?t=yOe(t,1):(t.setHours(i.getHours()),t.setMinutes(i.getMinutes()),t.setSeconds(i.getSeconds())),{startHour:n,endHour:t}}function COe(e){return dOe(e).getDate()}function SOe(e,t){e=gOe(new Date(e)),t=gOe(new Date(t));return Math.round((t.getTime()-e.getTime())/iOe)}function AOe(e){return-1!==e.indexOf("Date")?new Date(parseInt(e.match(/\d+/g).toString(),10)):-1!==e.indexOf("T")?new Date(e):new Date(e.replace(/-/g,"/"))}var xOe=null,IOe=null;function TOe(){if(null!==xOe)return xOe;null===IOe&&(IOe=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth);var e=Q("div"),t=(e.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e),devicePixelRatio?"1.10"===devicePixelRatio.toFixed(2)||devicePixelRatio<=1?Math.ceil(devicePixelRatio%1):Math.floor(devicePixelRatio%1):0),t=e.offsetWidth-e.clientWidth-t|0;return document.body.removeChild(e),xOe=t}function EOe(){var e=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth;IOe&&IOe!==e&&(xOe=null,IOe=e)}function DOe(e,t,i,n,o){for(var r=0,s=e.length;r<s;r++)if(e[parseInt(r.toString(),10)][""+t]===i){if(!n)return r;var a=o.slice(-2)[0].field;if((n[""+a]instanceof Array?n[""+a]:[n[""+a]]).join(",").includes(e[parseInt(r.toString(),10)][o.slice(-1)[0].groupIDField]))return r}return-1}function MOe(e){var t=getComputedStyle(e);return e.offsetHeight+(parseInt(t.marginTop,10)||0)+(parseInt(t.marginBottom,10)||0)}function kOe(e){for(var t=0,i=[].slice.call(e.children);t<i.length;t++){var n=i[t];e.removeChild(n)}}function POe(e){var t=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1);return e.getTimezoneOffset()<Math.max(t.getTimezoneOffset(),i.getTimezoneOffset())}function BOe(e){var t=e.getFullYear(),i=e.getMonth(),n=e.getDate(),o=e.getHours(),r=e.getMinutes(),s=e.getSeconds(),e=e.getMilliseconds();return Date.UTC(t,i,n,o,r,s,e)}function FOe(){return-1<window.navigator.userAgent.toLowerCase().indexOf("mobi")}function LOe(){return-1<window.navigator.userAgent.toLowerCase().indexOf("ipad")}function ROe(e,t){return"multiple"===t?e=e.split(" ").map(function(e){return e.charAt(0).toLocaleUpperCase()+e.substring(1)}).join(" "):"single"===t&&(e=(e="0"<=e[0]&&e[0]<="9"?je(t=e.match(/[a-zA-Z]/))?e:e.slice(0,t.index)+e[t.index].toLocaleUpperCase()+e.slice(t.index+1):e)[0].toLocaleUpperCase()+e.slice(1)),e}function OOe(e,t){return t?e.offsetWidth:e.getBoundingClientRect().width}function NOe(e,t){return t?e.offsetHeight:e.getBoundingClientRect().height}function VOe(e,t){return t?e.offsetTop:e.getBoundingClientRect().top}var _Oe="e-schedule",HOe="e-device",zOe="e-adaptive",jOe="e-multi-drag",WOe="e-icons",QOe="e-enable",UOe="e-disable",qOe="e-table-container",GOe="e-schedule-table",YOe="e-all-day-cells",XOe="e-all-day-row",KOe="e-content-table",JOe="e-work-cells",ZOe="e-work-hours",$Oe="e-popup-open",eNe="e-date-header-wrap",tNe="e-date-header-container",iNe="e-header-cells",nNe="e-work-days",oNe="e-other-month",rNe="e-current-day",sNe="e-current-date",aNe="e-current-panel",lNe="e-previous-panel",hNe="e-next-panel",dNe="e-translate",pNe="e-left-indent",cNe="e-left-indent-wrap",uNe="e-event-table",gNe="e-resource-group-cells",mNe="e-resource-text",fNe="e-resource-column-wrap",yNe="e-resource-column-table",vNe="e-child-node",bNe="e-parent-node",wNe="e-resource-expand",CNe="e-resource-collapse",SNe="e-resource-tree-icon",ANe="e-resource-cells",xNe="e-time-cells-wrap",INe="e-time-cells",TNe="e-time-slots",ENe="e-alternate-cells",DNe="e-current-time",MNe="e-current-timeline",kNe="e-previous-timeline",PNe="e-hide-childs",BNe="e-scroll-container",FNe="e-timeline-wrapper",LNe="e-appointment-wrapper",RNe="e-appointment-wrapper-hidden",ONe="e-day-wrapper",NNe="e-schedule-resource-toolbar-container",VNe="e-schedule-toolbar",_Ne="e-schedule-resource-toolbar",HNe="e-selected-cell",zNe="e-week-number-wrapper",jNe="e-week-number",WNe="e-appointment-wrap",QNe="e-wrapper-container",UNe="e-appointment-container",qNe="e-appointment",GNe="e-block-appointment",YNe="e-block-indicator",XNe="e-appointment-border",KNe="e-appointment-details",JNe="e-subject-wrap",ZNe="e-resource-name",$Ne="e-time",e2e="e-table-wrap",t2e="e-outer-table",i2e="e-content-wrap",n2e="e-virtual-track",o2e="e-agenda-cells",r2e="e-current-day",s2e="e-active-appointment-agenda",a2e="e-month-header",l2e="e-day-date-header",h2e="e-date-column",d2e="e-navigate",p2e="e-date-header",c2e="e-day-border",u2e="e-date-time",g2e="e-no-event",m2e="e-appointment-indicator",f2e="e-indicator",y2e="e-left-icon",v2e="e-right-icon",b2e="e-event-action",w2e="e-new-event",C2e="e-schedule-event-clone",S2e="e-clone-time-indicator",A2e="e-drag-clone",x2e="e-event-resize",I2e="e-resize-clone",T2e="e-left-handler",E2e="e-right-handler",D2e="e-top-handler",M2e="e-bottom-handler",k2e="e-recurrence-icon",P2e="e-recurrence-edit-icon",B2e="e-header-row",F2e="e-all-day-appointment-wrapper",L2e="e-all-day-appointment",R2e="e-appointment-hide",O2e="e-row-count-wrapper",N2e="e-all-day-appointment-section",V2e="e-appointment-expand",_2e="e-appointment-collapse",H2e="e-more-indicator",z2e="e-cell-popup",j2e="e-event-popup",W2e="e-popup-header",Q2e="e-header-icon-wrapper",U2e="e-popup-footer",q2e="e-date-time-details",G2e="e-event-details",Y2e="e-event-create",X2e="e-event-edit",K2e="e-event-delete",J2e="e-text-ellipsis",Z2e="e-more-popup-wrapper",$2e="e-more-event-popup",eVe="e-more-event-date-header",tVe="e-header-day",iVe="e-header-date",nVe="e-more-event-close",oVe="e-more-event-content",rVe="e-more-appointment-wrapper",sVe="e-quick-dialog-occurrence-event",aVe="e-quick-dialog-series-event",lVe="e-quick-dialog-following-events",hVe="e-following-events-dialog",dVe="e-quick-dialog-delete",pVe="e-quick-dialog-cancel",cVe="e-quick-alertok",uVe="e-quick-alertcancel",gVe="e-quick-alertfollowing",mVe="e-quick-dialog-alert-btn",fVe="e-schedule-dialog",yVe="e-schedule-form",vVe="e-all-day",bVe="e-time-zone",wVe="e-repeat",CVe="e-subject",SVe="e-location",AVe="e-location-details",xVe="e-start",IVe="e-end",TVe="e-description",EVe="e-description-details",DVe="e-time-zone-row",MVe="e-start-time-zone",kVe="e-end-time-zone",PVe="e-save-icon",BVe="e-event-cancel",FVe="e-event-save",LVe="e-title-text",RVe="e-icon-disable",OVe="e-edit",NVe="e-edit-icon",VVe="e-delete",_Ve="e-delete-icon",HVe="e-close",zVe="e-close-icon",jVe="e-schedule-error",WVe="e-tooltip-hidden",QVe="e-animate",UVe="e-hidden",qVe="e-disable-dates",GVe="e-quick-popup-wrapper",YVe="e-resource-menu",XVe="e-icon-menu",KVe="e-resource-level-title",JVe="e-resource-tree-popup-overlay",ZVe="e-resource-tree-popup",$Ve="e-resource",e_e="e-resource-icon",t_e="e-resource-details",i_e="e-date-time-icon",n_e="e-virtual-scroll",o_e="e-icon-disable",r_e="e-auto-height",s_e="e-ignore-whitespace",a_e="e-read-only",l_e="e-month-header-wrapper",h_e="e-inline-subject",d_e="e-inline-appointment",p_e="e-scroll-hidden",c_e="e-all-day-scroll",u_e="e-all-day-auto",g_e=function(){return(g_e=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},m_e=(f_e.prototype.addEventListener=function(){this.parent.on($Re,this.closeHeaderPopup,this)},f_e.prototype.removeEventListener=function(){this.parent.off($Re,this.closeHeaderPopup)},f_e.prototype.closeHeaderPopup=function(e){var t,i,n=z(e.event.target,".e-date-range,.e-header-popup,.e-day,.e-selected"),e=z(e.event.target,".e-hor-nav,.e-toolbar-pop"),o=this.parent.element.querySelector("."+i2e);this.parent.isAdaptive&&(je(e)||!e.classList.contains("e-toolbar-pop")&&!e.classList.contains("e-hor-nav")||e.classList.contains("e-hor-nav")&&this.element.querySelector(".e-toolbar-pop").classList.contains($Oe)?(q([o],p_e),je(t=this.element.querySelector(".e-toolbar-pop"))||!(i=t.ej2_instances[0])||!je(e)&&e.classList.contains("e-hor-nav")&&t.classList.contains($Oe)||i.hide()):U([o],p_e)),je(n)&&this.hideHeaderPopup()},f_e.prototype.hideHeaderPopup=function(){this.headerPopup&&this.headerPopup.hide()},f_e.prototype.renderHeader=function(){this.element=Q("div",{className:"e-schedule-toolbar-container"});var e=Q("div",{className:VNe});this.element.appendChild(e),this.parent.element.insertBefore(this.element,this.parent.element.firstElementChild),this.renderToolbar()},f_e.prototype.renderToolbar=function(){var t=this,e=this.parent.toolbarItems&&0<this.parent.toolbarItems.length?this.getToolbarItems():this.getItems();this.parent.trigger(wRe,{requestType:"toolbarItemRendering",items:e},function(e){t.toolbarObj=new U3({items:e.items,overflowMode:"Popup",clicked:t.toolbarClickHandler.bind(t),created:t.toolbarCreateHandler.bind(t),enableRtl:t.parent.enableRtl,enableHtmlSanitizer:t.parent.enableHtmlSanitizer,locale:t.parent.locale}),t.toolbarObj.isStringTemplate=!0,t.toolbarObj.root=t.parent.root||t.parent,t.toolbarObj.appendTo(t.parent.element.querySelector("."+VNe)),t.toolbarObj.element.setAttribute("aria-label","Scheduler");e=t.toolbarObj.element.querySelector(".e-prev"),e&&e.firstElementChild.setAttribute("title",t.l10n.getConstant("previous")),e=t.toolbarObj.element.querySelector(".e-next");e&&e.firstElementChild.setAttribute("title",t.l10n.getConstant("next")),t.updateAddIcon(),t.updateActiveView(),t.parent.trigger(CRe,{requestType:"toolBarItemRendered",items:t.toolbarObj.items})})},f_e.prototype.updateItems=function(){var e,t=this;this.toolbarObj&&(e=this.getItems(),this.parent.trigger(wRe,{requestType:"toolbarItemRendering",items:e},function(e){t.toolbarObj.items=e.items,t.toolbarObj.dataBind(),t.parent.trigger(CRe,{requestType:"toolBarItemRendered",items:t.toolbarObj.items})}))},f_e.prototype.getPopUpRelativeElement=function(){return this.parent.isAdaptive?this.toolbarObj.element:this.element.querySelector(".e-date-range")},f_e.prototype.setDayOfWeek=function(e){this.headerCalendar&&(this.headerCalendar.firstDayOfWeek=e,this.headerCalendar.dataBind())},f_e.prototype.setCalendarDate=function(e){this.headerCalendar&&(this.headerCalendar.value=e,this.headerCalendar.dataBind())},f_e.prototype.setCalendarMinMaxDate=function(){this.headerCalendar&&(this.headerCalendar.min=this.parent.minDate,this.headerCalendar.max=this.parent.maxDate,this.headerCalendar.dataBind())},f_e.prototype.getCalendarView=function(){return-1<["Month","MonthAgenda","TimelineMonth"].indexOf(this.parent.currentView)?"Year":-1<["Year","TimelineYear"].indexOf(this.parent.currentView)?"Decade":"Month"},f_e.prototype.setCalendarView=function(){var e;this.headerCalendar&&(e=this.getCalendarView(),this.headerCalendar.depth=e,this.headerCalendar.start=e,this.headerCalendar.refresh())},f_e.prototype.updateActiveView=function(){var e=[].slice.call(this.toolbarObj.element.querySelectorAll(".e-views"));q(e,["e-active-view"]),0<e.length&&e[this.parent.viewIndex]&&U([e[this.parent.viewIndex]],["e-active-view"])},f_e.prototype.updateDateRange=function(e){var t,i,n,o=this.toolbarObj.element.querySelector(".e-date-range");o&&(o.firstElementChild.setAttribute("aria-haspopup","true"),t=o.querySelector(".e-tbar-btn-text"),this.parent.activeViewOptions.dateRangeTemplate?(t.textContent="",n={startDate:this.parent.activeView.getStartDate(),endDate:this.parent.activeView.getEndDate(),currentView:this.parent.currentView},i=this.parent.activeViewOptions.dateRangeTemplateName,i=this.parent.element.id+"_"+i+"dateRangeTemplate",ht([].slice.call(this.parent.getDateRangeTemplate()(n,this.parent,"dateRangeTemplate",i,!1,void 0,void 0,this.parent.root)),t)):(n=this.parent.activeView.getDateRangeText(e),o.firstElementChild.setAttribute("aria-label",n),t.textContent=n),this.refresh())},f_e.prototype.refresh=function(){this.toolbarObj&&this.toolbarObj.refreshOverflow()},f_e.prototype.updateAddIcon=function(){var e=this.toolbarObj.element.querySelector(".e-add");e&&(this.parent.eventSettings.allowAdding?q:U)([e],UVe)},f_e.prototype.getDateRangeText=function(){return ROe(this.parent.globalize.formatDate(this.parent.selectedDate,{format:"MMMM y",calendar:this.parent.getCalendarMode()}),"single")},f_e.prototype.getItemModel=function(e){var t={};return e.id&&(t.id=e.id),e.text&&(t.text=e.text),e.tooltipText&&(t.tooltipText=e.tooltipText),e.prefixIcon&&(t.prefixIcon=e.prefixIcon),e.cssClass&&(t.cssClass=e.cssClass),"Both"!==e.showTextOn&&(t.showTextOn=e.showTextOn),e.template&&(t.template=e.template),e.disabled&&(t.disabled=e.disabled),"auto"!==e.width&&(t.width=e.width),e.suffixIcon&&(t.suffixIcon=e.suffixIcon),"Left"!==e.align&&(t.align=e.align),"None"!==e.overflow&&(t.overflow=e.overflow),e.htmlAttributes&&(t.htmlAttributes=e.htmlAttributes),"Button"!==e.type&&(t.type=e.type),!0!==e.visible&&(t.visible=e.visible),e.showAlwaysInPopup&&(t.showAlwaysInPopup=e.showAlwaysInPopup),-1!==e.tabIndex&&(t.tabIndex=e.tabIndex),t},f_e.prototype.getToolbarItems=function(){for(var e=[],t=0,i=this.parent.toolbarItems;t<i.length;t++){var n=i[t],o=this.getItemModel(n),r=void 0;if(n.name)switch(n.name){case"Today":(r={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}).align=o.align||n.align,e.push(g_e({},r,o));break;case"Previous":(r={prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev",htmlAttributes:{role:"navigation"}}).align=o.align||n.align,e.push(g_e({},r,o));break;case"Next":(r={prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next",htmlAttributes:{role:"navigation"}}).align=o.align||n.align,e.push(g_e({},r,o));break;case"DateRangeText":(r={text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive",role:"navigation"}}).align=o.align||n.align,e.push(g_e({},r,o));break;case"NewEvent":(r={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}).align=o.align||n.align,e.push(g_e({},r,o));break;case"Views":if(!je(this.parent.views)&&1<this.parent.views.length)for(var s=0,a=this.parent.views;s<a.length;s++){var l=a[s];(r=this.getItemObject(l)).align=o.align||n.align,e.push(g_e({},r,o))}break;case"Custom":e.push(n)}else e.push(n)}return e},f_e.prototype.getItems=function(){var e=[];if(e.push({align:"Left",prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev"}),e.push({align:"Left",prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next"}),e.push({align:"Left",text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive"}}),this.parent.isAdaptive||this.parent.enableAdaptiveUI?(e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}),e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"})):(e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}),!je(this.parent.views)&&1<this.parent.views.length&&e.push({align:"Right",type:"Separator",cssClass:"e-schedule-seperator"})),!je(this.parent.views)&&1<this.parent.views.length)for(var t=0,i=this.parent.views;t<i.length;t++){var n=i[t];e.push(this.getItemObject(n))}return e},f_e.prototype.getItemObject=function(e){var t,i,n="string"==typeof e?(t=e.toLowerCase(),null):(t=e.option.toLowerCase(),e.displayName),o=this.parent.isAdaptive||this.parent.enableAdaptiveUI;switch(t){case"day":i={align:"Right",showAlwaysInPopup:o,prefixIcon:"e-icon-day",text:n||this.l10n.getConstant("day"),cssClass:"e-views e-day"};break;case"week":i={align:"Right",showAlwaysInPopup:o,prefixIcon:"e-icon-week",text:n||this.l10n.getConstant("week"),cssClass:"e-views e-week"};break;case"workweek":i={align:"Right",showAlwaysInPopup:o,prefixIcon:"e-icon-workweek",text:n||this.l10n.getConstant("workWeek"),cssClass:"e-views e-work-week"};break;case"month":i={align:"Right",showAlwaysInPopup:o,prefixIcon:"e-icon-month",text:n||this.l10n.getConstant("month"),cssClass:"e-views e-month"};break;case"year":i={align:"Right",showAlwaysInPopup:o,prefixIcon:"e-icon-year",text:n||this.l10n.getConstant("year"),cssClass:"e-views e-year"};break;case"agenda":i={align:"Right",showAlwaysInPopup:o,prefixIcon:"e-icon-agenda",text:n||this.l10n.getConstant("agenda"),cssClass:"e-views e-agenda"};break;case"monthagenda":i={align:"Right",showAlwaysInPopup:o,prefixIcon:"e-icon-month-agenda",text:n||this.l10n.getConstant("monthAgenda"),cssClass:"e-views e-month-agenda"};break;case"timelineday":i={align:"Right",showAlwaysInPopup:o,prefixIcon:"e-icon-timeline-day",text:n||this.l10n.getConstant("timelineDay"),cssClass:"e-views e-timeline-day"};break;case"timelineweek":i={align:"Right",showAlwaysInPopup:o,prefixIcon:"e-icon-timeline-week",text:n||this.l10n.getConstant("timelineWeek"),cssClass:"e-views e-timeline-week"};break;case"timelineworkweek":i={align:"Right",showAlwaysInPopup:o,prefixIcon:"e-icon-timeline-workweek",text:n||this.l10n.getConstant("timelineWorkWeek"),cssClass:"e-views e-timeline-work-week"};break;case"timelinemonth":i={align:"Right",showAlwaysInPopup:o,prefixIcon:"e-icon-timeline-month",text:n||this.l10n.getConstant("timelineMonth"),cssClass:"e-views e-timeline-month"};break;case"timelineyear":i={align:"Right",showAlwaysInPopup:o,prefixIcon:"e-icon-timeline-year-"+("Vertical"===e.orientation?"vertical":"horizontal"),text:n||this.l10n.getConstant("timelineYear"),cssClass:"e-views e-timeline-year"}}return i},f_e.prototype.renderHeaderPopup=function(){var e=Q("div",{className:"e-header-popup"}),t=Q("div",{className:"e-header-calendar"}),e=(e.appendChild(t),this.element.appendChild(e),this.headerPopup=new Sv(e,{actionOnScroll:"hide",targetType:"relative",relateTo:this.getPopUpRelativeElement(),position:{X:"left",Y:"bottom"},collision:{X:"fit"},viewPortElement:this.element,enableRtl:this.parent.enableRtl}),this.getCalendarView()),i="Month"===this.parent.currentView&&!je(this.parent.activeViewOptions.displayDate)&&!this.hasSelectedDate();this.headerCalendar=new V7({value:i?this.parent.activeViewOptions.displayDate:this.parent.selectedDate,min:this.parent.minDate,max:this.parent.maxDate,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,weekNumber:this.parent.activeViewOptions.showWeekNumber,enableRtl:this.parent.enableRtl,locale:this.parent.locale,depth:e,start:e,calendarMode:this.parent.calendarMode,change:this.calendarChange.bind(this)}),this.setCalendarTimezone(),this.headerCalendar.appendTo(t),this.headerPopup.hide()},f_e.prototype.calendarChange=function(e){e.value.getTime()!==this.parent.selectedDate.getTime()&&(e=gOe(new Date(e.value)),this.parent.changeDate(e)),this.headerPopup.hide()},f_e.prototype.setCalendarTimezone=function(){this.headerCalendar&&(this.headerCalendar.timezone=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName())},f_e.prototype.calculateViewIndex=function(e){e=z(e.originalEvent.target,".e-views");return[].slice.call(this.element.querySelectorAll(".e-views")).indexOf(e)},f_e.prototype.toolbarCreateHandler=function(){this.parent&&this.parent.portals&&this.toolbarObj&&this.toolbarObj.portals&&(this.parent.portals=this.parent.portals.concat(this.toolbarObj.portals),this.parent.renderReactTemplates())},f_e.prototype.toolbarClickHandler=function(e){if(e.item){var t;switch(e.item.cssClass.replace("e-views ","")){case"e-date-range":this.headerPopup||this.renderHeaderPopup(),this.headerPopup.element.classList.contains($Oe)?this.headerPopup.hide():this.headerPopup.show();break;case"e-day":this.parent.changeView("Day",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-week":this.parent.changeView("Week",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-work-week":this.parent.changeView("WorkWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-month":this.parent.changeView("Month",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-year":this.parent.changeView("Year",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-agenda":this.parent.changeView("Agenda",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-month-agenda":this.parent.changeView("MonthAgenda",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-day":this.parent.changeView("TimelineDay",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-week":this.parent.changeView("TimelineWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-work-week":this.parent.changeView("TimelineWorkWeek",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-month":this.parent.changeView("TimelineMonth",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-timeline-year":this.parent.changeView("TimelineYear",e.originalEvent,void 0,this.calculateViewIndex(e));break;case"e-today":o=gOe(this.parent.getCurrentTime()),("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView||!this.parent.isSelectedDate(o)||"Month"===this.parent.currentView&&this.parent.activeViewOptions.displayDate&&!this.hasSelectedDate()&&gOe(this.parent.activeViewOptions.displayDate)!==o||"Month"===this.parent.currentView&&0<this.parent.activeViewOptions.numberOfWeeks&&!this.hasSelectedDate()&&gOe(hOe(this.parent.selectedDate))!==o)&&this.parent.changeDate(o,e.originalEvent);break;case"e-prev":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e.originalEvent);break;case"e-next":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e.originalEvent);break;case"e-add":var i,n,o=this.parent.activeCellsData.startTime.getTime()===this.parent.activeCellsData.endTime.getTime();o=this.parent.activeCellsData&&!o?this.parent.activeCellsData:(o=6e4*this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,i=new Date(this.parent.selectedDate.getTime()),n=this.parent.getCurrentTime(),i.setHours(n.getHours(),Math.round(i.getMinutes()/o)*o,0),n=new Date(new Date(i.getTime()).setMilliseconds(i.getMilliseconds()+o)),{startTime:i,endTime:n,isAllDay:!1}),this.parent.eventWindow.openEditor(Pe(o,{cancel:!1,event:e.originalEvent}),"Add")}je(this.toolbarObj)||(t=this.toolbarObj.element.querySelector(".e-toolbar-pop"))&&"Input"!==e.item.type&&t.ej2_instances[0].hide({name:"SlideUp",duration:100})}},f_e.prototype.hasSelectedDate=function(){var e=gOe(this.parent.selectedDate).getTime();return e>=this.parent.activeView.getStartDate().getTime()&&e<=this.parent.activeView.getEndDate().getTime()},f_e.prototype.getHeaderElement=function(){return this.toolbarObj.element},f_e.prototype.updateHeaderItems=function(e){var t=this.toolbarObj.element.querySelector(".e-prev"),i=this.toolbarObj.element.querySelector(".e-next"),n=this.toolbarObj.element.querySelector(".e-date-range");t&&("add"===e?U:q)([t],UVe),i&&("add"===e?U:q)([i],UVe),n&&("add"===e?U:q)([n],J2e)},f_e.prototype.previousNextIconHandler=function(){var e,t="Agenda"===this.parent.currentView?[this.parent.getCurrentViewDates()[0]]:this.parent.getCurrentViewDates(),i=this.toolbarObj.element.querySelector(".e-prev"),n=this.toolbarObj.element.querySelector(".e-next"),o=new Date(t[0].getTime()),t=new Date(t[t.length-1].getTime());"WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView?t=yOe(o=aOe(gOe(this.parent.selectedDate),this.parent.activeViewOptions.firstDayOfWeek),7*this.parent.activeViewOptions.interval):"Month"===this.parent.currentView&&(o=(e=!je(this.parent.activeViewOptions.displayDate)||0<this.parent.activeViewOptions.numberOfWeeks)?this.parent.activeView.getStartDate():hOe(this.parent.selectedDate),t=e?this.parent.activeView.getEndDate():dOe(vOe(o,this.parent.activeViewOptions.interval-1))),je(i)||this.toolbarObj.enableItems(i,o>gOe(this.parent.minDate)),je(n)||this.toolbarObj.enableItems(n,t<gOe(this.parent.maxDate)),this.setCalendarMinMaxDate()},f_e.prototype.getModuleName=function(){return"headerbar"},f_e.prototype.destroy=function(){this.headerPopup&&!this.headerPopup.isDestroyed&&(this.headerPopup.destroy(),this.headerPopup=null),this.headerCalendar&&!this.headerCalendar.isDestroyed&&(this.headerCalendar.destroy(),this.headerCalendar=null),this.toolbarObj&&!this.toolbarObj.isDestroyed&&(this.toolbarObj.destroy(),this.removeEventListener(),ue(this.element),this.toolbarObj=null),this.element=null,this.parent=null,this.l10n=null},f_e);function f_e(e){this.parent=e,this.l10n=this.parent.localeObj,this.renderHeader(),this.addEventListener()}v_e.prototype.getModuleName=function(){return"scroll"},v_e.prototype.setWidth=function(){this.parent.element.style.width=T(this.parent.width)},v_e.prototype.setHeight=function(){this.parent.element.style.height=T(this.parent.height)},v_e.prototype.addEventListener=function(){this.parent.on(YRe,this.setDimensions,this),this.parent.on(ZRe,this.onPropertyChanged,this)},v_e.prototype.removeEventListener=function(){this.parent.off(YRe,this.setDimensions),this.parent.off(ZRe,this.onPropertyChanged)},v_e.prototype.setDimensions=function(){this.setWidth(),this.setHeight();var e={cssProperties:this.parent.getCssProperties(),module:this.getModuleName()};this.parent.notify(JRe,e)},v_e.prototype.onPropertyChanged=function(){this.setDimensions()},v_e.prototype.destroy=function(){this.removeEventListener()};var y_e=v_e;function v_e(e){this.parent=e,this.addEventListener()}w_e.prototype.scrollHandler=function(e){je(this.parent.eventTooltip)||this.parent.eventTooltip.close();var t,i=!this.parent.isAdaptive&&e.originalEvent&&e.originalEvent.target&&!je(z(e.originalEvent.target,"."+qNe));if(this.parent.uiStateValues.isTouchScroll=i&&"touchmove"===e.originalEvent.type&&!this.parent.uiStateValues.action,!i&&"Agenda"!==this.parent.currentView&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold){if(this.parent.uiStateValues.isSwipeScroll=!0,this.timeStampStart||(this.timeStampStart=Date.now()),this.element.classList.contains(dNe)&&this.onTransitionEnd(),"Left"===e.scrollDirection||"Right"===e.scrollDirection){var i={requestType:"dateNavigate",cancel:!1,event:e.originalEvent};if(this.parent.trigger(wRe,i),i.cancel)return;i=this.element.querySelector("."+i2e);if(i&&i.scrollWidth>i.clientWidth)return;this.isScrollTriggered=!0,e.originalEvent.preventDefault(),e.originalEvent.stopPropagation()}e.scrollDirection===this.touchLeftDirection?(this.nextPanel||(this.renderPanel(hNe,"Next"),this.nextPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.nextPanel.element)),t=this.parent.enableRtl?e.distanceX:-e.distanceX,this.element.style.transform="translatex("+(this.getTranslateX(this.element)+t)+"px)"):e.scrollDirection===this.touchRightDirection&&(i=0,this.previousPanel||(this.renderPanel(lNe,"Previous"),this.previousPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.previousPanel.element),i=this.previousPanel.element.offsetWidth),t=this.parent.enableRtl?i-e.distanceX:-i+e.distanceX,this.element.style.transform="translatex("+(this.getTranslateX(this.element)+t)+"px)")}},w_e.prototype.swipeHandler=function(e){var t,i;this.isScrollTriggered&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold&&(this.isScrollTriggered=!1,t=("Left"===e.swipeDirection?this.parent.activeView.renderDates:this.parent.activeView.renderDates.slice(-1))[0],"Left"===e.swipeDirection&&t<this.parent.maxDate||"Right"===e.swipeDirection&&t>=this.parent.minDate?((t=Date.now()-this.timeStampStart)<(i=e.distanceX*(F.isDevice?6:1.66))||e.distanceX>this.parent.element.offsetWidth/2?(this.swapPanels(e.swipeDirection),t<i&&e.distanceX>this.parent.element.offsetWidth/2&&(this.element.style.transitionDuration=(F.isDevice?e.distanceX:i)/t/10+"s"),this.confirmSwipe(e.swipeDirection)):this.cancelSwipe(),i={requestType:"dateNavigate",cancel:!1,event:e.originalEvent},this.parent.trigger(CRe,i)):this.cancelSwipe(),this.timeStampStart=null)},w_e.prototype.tapHoldHandler=function(e){var t=z(e.originalEvent.target,"."+qNe);je(t)||(this.parent.uiStateValues.isTapHold=!0,this.parent.isAdaptive?(F.isIos&&E.add(this.element,"touchend",this.preventEventClick,this),this.parent.quickPopup.tapHoldEventPopup(e.originalEvent),this.triggerResizeStart(e.originalEvent)):["Agenda","MonthAgenda","Year"].indexOf(this.parent.currentView)<0&&(this.parent.selectedElements=[],this.parent.eventBase.getSelectedEventElements(t),this.triggerResizeStart(e.originalEvent)))},w_e.prototype.triggerResizeStart=function(e){this.parent.resizeModule&&z(e.target,"."+x2e)&&this.parent.resizeModule.resizeStart(e)},w_e.prototype.preventEventClick=function(e){e.preventDefault(),E.remove(this.element,"touchend",this.preventEventClick)},w_e.prototype.renderPanel=function(e,t){this.currentPanel?this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0):(this.currentPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.currentPanel.element)),this.parent.setProperties({selectedDate:this.parent.activeView.getNextPreviousDate(t)},!0),this.parent.headerModule&&this.parent.headerModule.setCalendarDate(this.parent.selectedDate),this.parent.activeView.getRenderDates(),this.parent.activeView.renderLayout(e)},w_e.prototype.swapPanels=function(e){var t;e===this.touchLeftDirection?(t=this.nextPanel,this.nextPanel=this.currentPanel):(t=this.previousPanel,this.previousPanel=this.currentPanel),this.currentPanel=t},w_e.prototype.confirmSwipe=function(t){var i=this,e={action:"date",cancel:!1,previousDate:(t===this.touchLeftDirection?this.nextPanel:this.previousPanel).selectedDate,currentDate:this.currentPanel.selectedDate};this.parent.trigger(ARe,e,function(e){e.cancel?(i.swapPanels(t),i.cancelSwipe()):(i.parent.activeView.setPanel(i.currentPanel.element),i.parent.setProperties({selectedDate:i.currentPanel.selectedDate},!0),e=void 0,e=i.parent.enableRtl?t===i.touchLeftDirection?i.previousPanel?i.previousPanel.element.offsetLeft:i.currentPanel.element.offsetWidth:0:t===i.touchLeftDirection?-i.currentPanel.element.offsetLeft:0,i.parent.activeView.renderDates=i.currentPanel.renderDates,i.parent.activeView.colLevels=i.currentPanel.colLevels,U([i.element],dNe),i.element.style.transform="translatex("+e+"px)",i.parent.headerModule&&i.parent.headerModule.updateDateRange(),i.parent.renderTemplates(),i.parent.crudModule.refreshDataManager())})},w_e.prototype.cancelSwipe=function(){this.parent.activeView.setPanel(this.currentPanel.element),this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0),this.parent.activeView.renderDates=this.currentPanel.renderDates,this.parent.activeView.colLevels=this.currentPanel.colLevels,U([this.element],dNe);var e=this.previousPanel?this.previousPanel.element.offsetWidth:0;this.element.style.transform="translatex("+(this.parent.enableRtl?e:-this.currentPanel.element.offsetLeft)+"px)"},w_e.prototype.onTransitionEnd=function(){(je(this.element)||this.element.classList.contains(dNe))&&(this.parent.uiStateValues.isSwipeScroll=!1,q([this.element],dNe),this.element.style.transitionDuration="",this.element.style.transform="",this.previousPanel&&(ue(this.previousPanel.element),this.previousPanel=null,q([this.currentPanel.element],lNe),U([this.currentPanel.element],aNe)),this.nextPanel&&(ue(this.nextPanel.element),this.nextPanel=null,q([this.currentPanel.element],hNe),U([this.currentPanel.element],aNe)),this.currentPanel=null,this.parent.activeView.getPanel().style.width="")},w_e.prototype.getTranslateX=function(e){e=window.getComputedStyle(e);return new WebKitCSSMatrix(e.webkitTransform).m41},w_e.prototype.setDimensions=function(e){e.style.width=this.parent.element.clientWidth+"px"},w_e.prototype.resetValues=function(){this.currentPanel=null,this.previousPanel=null,this.nextPanel=null,this.timeStampStart=null,this.element.style.transform="",this.element.style.transitionDuration="",kOe(this.element),q([this.element],dNe)},w_e.prototype.destroy=function(){this.touchObj&&(this.touchObj.destroy(),this.touchObj=null),E.remove(this.element,"transitionend",this.onTransitionEnd),this.resetValues()};var b_e=w_e;function w_e(e){this.parent=e,this.element=this.parent.element.querySelector("."+qOe),this.touchObj=new Mn(this.element,{scroll:this.scrollHandler.bind(this),swipe:this.swipeHandler.bind(this),tapHold:this.tapHoldHandler.bind(this),swipeSettings:{swipeThresholdDistance:1}}),E.add(this.element,"transitionend",this.onTransitionEnd,this),this.touchLeftDirection=this.parent.enableRtl?"Right":"Left",this.touchRightDirection=this.parent.enableRtl?"Left":"Right"}var C_e=function(){return(C_e=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},S_e=(A_e.prototype.keyActionHandler=function(e){switch(e.action){case"downArrow":case"shiftDownArrow":this.processDown(e,e.shiftKey);break;case"upArrow":case"shiftUpArrow":this.processUp(e,e.shiftKey);break;case"leftArrow":case"shiftLeftArrow":this.processLeft(e,e.shiftKey);break;case"rightArrow":case"shiftRightArrow":this.processRight(e,e.shiftKey);break;case"ctrlLeftArrow":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-prev button").focus();break;case"ctrlRightArrow":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-next button").focus();break;case"altOne":case"altTwo":case"altThree":case"altFour":case"altFive":case"altSix":case"altSeven":case"altEight":case"altNine":this.processViewNavigation(e);break;case"enter":this.processEnter(e);break;case"home":this.focusFirstCell();break;case"tab":case"shiftTab":this.processTab(e,e.shiftKey);break;case"delete":case"backspace":this.processDelete(e);break;case"ctrlShiftUpArrow":case"ctrlShiftDownArrow":case"ctrlShiftLeftArrow":case"ctrlShiftRightArrow":this.processCtrlShiftNavigationArrows(e);break;case"escape":this.processEscape(e);break;case"fTwelve":this.parent.allowInline&&this.parent.inlineModule&&(e.preventDefault(),this.processFTwelve(e));break;case"shiftAltY":this.parent.changeDate(new Date,e);break;case"shiftAltN":"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView&&"Year"!==this.parent.currentView&&this.processShiftAltN(e);break;case"cut":case"cmdCut":this.processClipboardAction(!0,void 0,e);break;case"copy":case"cmdCopy":this.processClipboardAction(!1,void 0,e)}},A_e.prototype.processShiftAltN=function(e){var t=this.parent.getSelectedCells(),i=e.target,n=Pe({},null,!0),i=(0<t.length&&(z(i,"."+JOe)||z(i,"."+YOe)||z(i,"."+iNe))?n=this.getSelectedElements(i):z(i,"."+qNe)&&!je(this.parent.activeEventData.event)?(t=this.parent.activeEventData.event,n.startTime=t.StartTime,n.endTime=t.EndTime,n.isAllDay=t.IsAllDay):(i=this.parent.getStartEndTime(this.parent.workHours.start),t=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,n.startTime=new Date(this.parent.selectedDate),n.startTime.setHours(i.getHours(),i.getMinutes(),0,0),n.endTime=new Date(n.startTime.getTime()+6e4*t)),Pe(n,{cancel:!1,event:e}));null!=i&&this.parent.eventWindow.openEditor(i,"Add")},A_e.prototype.processFTwelve=function(e){var t=e.target;(t.classList.contains(JOe)||t.classList.contains(YOe))&&(this.parent.activeCellsData=this.getSelectedElements(t),e={element:(e=Pe(this.parent.activeCellsData,{cancel:!1,event:e})).element,groupIndex:e.groupIndex,type:"Cell"},this.parent.notify(FRe,e)),t.classList.contains(qNe)&&t.click()},A_e.prototype.addEventListener=function(){this.parent.on(tOe,this.onCellMouseDown,this),this.parent.allowClipboard&&this.parent.on(eOe,this.pasteHandler,this)},A_e.prototype.removeEventListener=function(){this.parent.off(tOe,this.onCellMouseDown),this.parent.off(eOe,this.pasteHandler)},A_e.prototype.onCellMouseDown=function(e){e.event.shiftKey||(this.initialTarget=this.getClosestCell(e.event),!this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView&&this.initialTarget&&(e.event.target.classList.contains(JOe)&&3!==e.event.which&&(this.parent.removeSelectedClass(),E.add(this.parent.getContentTable(),"mousemove",this.onMouseSelection,this),E.add(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp,this)),e.event.target.classList.contains(YOe))&&3!==e.event.which&&(this.parent.removeSelectedClass(),e=this.parent.getAllDayRow(),E.add(e,"mousemove",this.onMouseSelection,this),E.add(e,"mouseup mouseleave",this.onMoveUp,this)))},A_e.prototype.onMouseSelection=function(e){U([].slice.call(this.parent.element.querySelectorAll("."+qNe)),"e-allow-select");var t,i,n=this.parent.boundaryValidation(e.pageY,e.pageX),o=((n.bottom||n.top||n.left||n.right)&&(o=(t=this.parent.element.querySelector("."+i2e)).offsetHeight<=t.scrollHeight&&0<=t.scrollTop&&t.scrollTop+t.offsetHeight<=t.scrollHeight,i=t.offsetWidth<=t.scrollWidth&&0<=t.scrollLeft&&t.scrollLeft+t.offsetWidth<=t.scrollWidth,o&&(n.top||n.bottom)&&(t.scrollTop+=n.top?-e.target.offsetHeight:e.target.offsetHeight),i)&&(n.left||n.right)&&(t.scrollLeft+=n.left?-e.target.offsetWidth:e.target.offsetWidth),this.getClosestCell(e));o&&this.selectCells(!0,o)},A_e.prototype.getClosestCell=function(e){return z(e.target,"."+JOe+",."+YOe)},A_e.prototype.onMoveUp=function(t){var i,e,n=this;q([].slice.call(this.parent.element.querySelectorAll("."+qNe)),"e-allow-select"),E.remove(this.parent.getContentTable(),"mousemove",this.onMouseSelection),E.remove(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp),t.target.classList.contains(YOe)&&(e=this.parent.getAllDayRow(),E.remove(e,"mousemove",this.onMouseSelection),E.remove(e,"mouseup mouseleave",this.onMoveUp)),this.isPreventAction(t)||(e=z(t.target,".e-work-cells,.e-all-day-cells,.e-header-cells"),0<(i=this.parent.getSelectedCells()).length&&-1===i.indexOf(e)&&(e=i[i.length-1]),"TimelineYear"===this.parent.currentView&&e.classList.contains(oNe))||(this.parent.activeCellsData=this.getSelectedElements(e),e={},this.parent.eventWindow&&this.parent.eventWindow.convertToEventData(this.parent.activeCellsData,e),e={data:e,element:this.parent.activeCellsData.element,event:t,requestType:LRe,showQuickPopup:!1},this.parent.trigger(bRe,e,function(e){(e.showQuickPopup||n.parent.quickInfoOnSelectionEnd)&&1<i.length&&(e=Pe(n.parent.activeCellsData,{cancel:!1,event:t,name:"cellClick"}),n.parent.notify(fRe,e))}))},A_e.prototype.processEnter=function(e){var t,i,n;this.parent.activeViewOptions.readonly&&!e.target.classList.contains(qNe)||this.isPreventAction(e)||"TimelineYear"===this.parent.currentView&&e.target.classList.contains(oNe)||(z(t=e.target,"."+GVe)?t.classList.contains(G2e)||t.classList.contains(Y2e)||t.classList.contains(X2e)||t.classList.contains(K2e)||t.classList.contains(HVe)?(t.click(),e.preventDefault()):t.classList.contains(CVe)&&(this.parent.element.querySelector("."+Y2e).click(),e.preventDefault()):t.classList.contains(ANe)&&t.classList.contains(bNe)?(i=t.querySelector("."+SNe))&&i.click():t.classList.contains(JOe)||t.classList.contains(YOe)?(this.parent.activeCellsData=this.getSelectedElements(t),i=Pe(this.parent.activeCellsData,{cancel:!1,event:e}),this.parent.allowInline?(n={element:i.element,groupIndex:i.groupIndex,type:"Cell"},this.parent.notify(FRe,n)):"Year"===this.parent.currentView?t.click():this.parent.notify(fRe,i)):t.classList.contains(h_e)&&this.parent.inlineModule?this.parent.inlineModule.inlineCrudActions(t):t.classList.contains(qNe)||t.classList.contains(nVe)||t.classList.contains(N2e)||t.classList.contains(H2e)?t.click():t.classList.contains(iVe)&&(this.parent.setProperties({selectedDate:this.parent.getDateFromElement(t)},!0),this.parent.changeView(this.parent.getNavigateView(),e),this.processEscape(e)))},A_e.prototype.getSelectedElements=function(e){var t,i=1<this.selectedCells.length&&e.classList.contains(HNe)?(t=this.parent.getCellDetails(this.selectedCells[0]),i=this.parent.getCellDetails(this.selectedCells.slice(-1)[0]),t.endTime=i.endTime,t.element=e,t):this.parent.getCellDetails(e);return i},A_e.prototype.getCells=function(e,t,i){var n=this.parent.getContentTable(),o="TimelineYear"===this.parent.currentView,r=[].slice.call(n.querySelectorAll(o&&!e?"."+JOe+":not(."+oNe+")":"td")),s=n.rows.length,a=n.rows[0].cells.length,n=(t&&t.classList.contains(YOe)&&(n=this.parent.getAllDayRow(),r=[].slice.call(n.cells),s=1,a=n.cells.length),r.indexOf(t)),l=r.indexOf(i),h=[];if(e){for(var d=0;d<a;d++)for(var p=0;p<s;p++){var c=r[a*p+d];o&&c.classList.contains(oNe)||h.push(c)}n=h.indexOf(t),l=h.indexOf(i)}return l<n&&(t=n,n=l,l=t),(e?h:r).slice(n,l+1)},A_e.prototype.focusFirstCell=function(){var e;"Agenda"===this.parent.currentView?((e=this.parent.getContentTable().querySelector("."+o2e)).setAttribute("tabindex","0"),e.focus()):(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView?(e=this.parent.element.querySelector("."+KOe+" tr:not(."+UVe+") ."+JOe+":not(."+gNe+")"),this.selectCells(!1,e)):-1<this.parent.currentView.indexOf("Year")?(e="."+JOe+":not(."+oNe+"):not(."+gNe+")",e+="TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation?'[data-date="'+this.parent.activeView.startDate().getTime()+'"]':"",this.selectCells(!1,this.parent.element.querySelector(e))):this.selectCells(!1,this.parent.getWorkCellElements()[0]))},A_e.prototype.isInverseTableSelect=function(){return this.parent.activeView.isInverseTableSelect},A_e.prototype.selectCells=function(e,t){var h,d,i,p=this,c=(this.parent.removeSelectedClass(),t instanceof Array?t.slice(-1)[0]:t);e?(d=["Day","Week","WorkWeek","TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth","TimelineYear"],i={element:t,requestType:"mousemove",allowMultipleRow:!0},this.parent.inlineModule.removeInlineAppointmentElement(),this.parent.trigger(bRe,i,function(e){e.allowMultipleRow&&p.parent.allowMultiRowSelection||((e="TimelineYear"===p.parent.currentView)&&"Horizontal"===p.parent.activeViewOptions.orientation||"Month"===p.parent.currentView?(e=e&&0<p.parent.activeViewOptions.group.resources.length,c=e?p.initialTarget:p.initialTarget.parentElement.children[c.cellIndex]):-1<d.indexOf(p.parent.currentView)&&(c=c.parentElement.children[p.initialTarget.cellIndex]));e=p.getCells(p.isInverseTableSelect(),p.initialTarget,c);if(0<p.parent.activeViewOptions.group.resources.length){h=p.initialTarget.getAttribute("data-group-index");for(var t=[],i=0,n=e;i<n.length;i++)(r=n[i]).getAttribute("data-group-index")===h&&t.push(r);e=t}if(p.parent.allowMultiCellSelection||(e=[p.initialTarget]),2<(p.selectedCells=e).length&&!c.classList.contains(YOe)){var o=p.getAllDayCells(e);if(0<p.parent.activeViewOptions.group.resources.length){for(var r,s=[],a=0,l=o;a<l.length;a++)(r=l[a]).getAttribute("data-group-index")===h&&s.push(r);o=s}e=e.concat(o)}c.getAttribute("data-group-index")!==h&&0<p.parent.activeViewOptions.group.resources.length&&(c=p.selectedCells[p.selectedCells.length-1]),p.parent.addSelectedClass(e,c)})):(i={element:c,requestType:LRe},this.parent.trigger(bRe,i,function(){p.initialTarget=c,p.selectedCells=[c],p.parent.addSelectedClass([c],c)}))},A_e.prototype.selectAppointment=function(e,t){var i=this.getAppointmentElements();i.length<0||(this.parent.eventBase.removeSelectedAppointmentClass(),(t=t.classList.contains(qNe)?(t=i.indexOf(t),i[e?t-1:t+1]):e?i[i.length-1]:i[0])&&(this.parent.eventBase.addSelectedAppointments([t],!0),t.focus(),U([t],s2e)))},A_e.prototype.selectAppointmentElementFromWorkCell=function(t,e){var i,n,o,r=this;this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.removeSelectedClass(),(e.classList.contains(JOe)||e.classList.contains(YOe))&&(i=this.getUniqueAppointmentElements(),n=[],o=this.parent.getDateFromElement(e).getTime(),this.parent.eventsProcessed.filter(function(e){return t?e[r.parent.eventFields.startTime].getTime()<=o:e[r.parent.eventFields.startTime].getTime()>=o}).filter(function(t){i.filter(function(e){JSON.stringify(t.Guid)===JSON.stringify(e.getAttribute("data-guid"))&&n.push(e)})}),0<n.length)&&(e=this.getAppointmentElementsByGuid((t?n[n.length-1]:n[0]).getAttribute("data-guid")),this.parent.eventBase.addSelectedAppointments(e,!0),e[e.length-1].focus())},A_e.prototype.getAllDayCells=function(e){var t,i,n=this.parent.getAllDayRow();return n&&(t=e[0],e=e[e.length-1],i=this.parent.getCellDetails(t),this.parent.getCellDetails(e).endTime.getTime()-i.startTime.getTime()>=iOe)?[].slice.call(n.cells).slice(t.cellIndex,e.cellIndex+1):[]},A_e.prototype.getAppointmentElements=function(){return[].slice.call(this.parent.element.querySelectorAll("."+qNe))},A_e.prototype.getAppointmentElementsByGuid=function(e){return[].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+e+'"]'))},A_e.prototype.getUniqueAppointmentElements=function(){var n=this.getAppointmentElements(),o=[];return n.map(function(e){return e.getAttribute("data-guid")}).filter(function(e,t,i){i.indexOf(e)===t&&o.push(n[parseInt(t.toString(),10)])}),o},A_e.prototype.getWorkCellFromAppointmentElement=function(e){e=this.parent.eventBase.getEventByGuid(e.getAttribute("data-guid"));return this.parent.eventBase.selectWorkCellByTime([e])},A_e.prototype.processViewNavigation=function(e){var t,i;je(e.code)||(t=parseInt(e.code.slice(e.code.length-1),10)-1,!isNaN(t)&&!je(this.parent.views)&&t<this.parent.views.length&&(i=this.parent.viewCollections[parseInt(t.toString(),10)].option,this.parent.changeView(i,e,void 0,t),this.parent.headerModule)&&this.parent.headerModule.element.querySelector(".e-active-view button").focus())},A_e.prototype.isCalendarTarget=function(e){e=e.currentTarget||e.target;return!(!e||je(e.querySelector(".e-header-popup.e-popup-open")))},A_e.prototype.cancelUpDownAction=function(e){var t=e&&"Vertical"===this.parent.activeViewOptions.orientation,i=0<this.parent.activeViewOptions.group.resources.length;return!!(t&&i||e&&this.initialTarget.classList.contains(oNe))||!((!this.parent.activeView.isTimelineView()||e)&&"MonthAgenda"!==this.parent.currentView)},A_e.prototype.processUp=function(e,t){var i="TimelineYear"===this.parent.currentView;if(!(t&&this.cancelUpDownAction(i)||this.isCalendarTarget(e))){var n=e.target,o=this.parent.getSelectedCells(),r=this.parent.eventBase.getSelectedAppointments(),s=this.parent.element.querySelector("."+Z2e),a=this.getQuickPopupElement();if(0<o.length&&!e.target.classList.contains(JOe)&&(n=o[o.length-1]),0<r.length&&!s.classList.contains($Oe)&&!a.classList.contains($Oe)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(r[r.length-1]),this.parent.eventBase.removeSelectedAppointmentClass()),n)if(n.classList.contains(JOe)&&!this.parent.element.querySelector("."+$Oe)){o=this.parent.getTableRows(),s=o.indexOf(n.parentElement),a=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(a=this.isInverseTableSelect()?this.getVerticalUpDownCell(o,n,s,!0):this.getHorizontalUpDownCell(o,n,s,!0)),(0<s||a)&&s<o.length){if(a=a||o[s-1].cells[n.cellIndex],"Year"===this.parent.currentView&&a.classList.contains(oNe)){if(!(this.parent.activeView.getStartDate().getTime()<+a.getAttribute("data-date")))return;a=this.getYearUpDownCell(o,s-1,n.cellIndex,!0)}e.preventDefault(),this.selectCells(t,a)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!0,n)}},A_e.prototype.processDown=function(e,t){var i="TimelineYear"===this.parent.currentView;if(!(t&&this.cancelUpDownAction(i)||this.isCalendarTarget(e))){var n=e.target,o=this.parent.getSelectedCells(),r=this.parent.eventBase.getSelectedAppointments(),s=this.parent.element.querySelector("."+Z2e),a=this.getQuickPopupElement(),o=(0<o.length&&!e.target.classList.contains(JOe)&&(n=o[o.length-1]),0<r.length&&!s.classList.contains($Oe)&&!a.classList.contains($Oe)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(r[r.length-1]),this.parent.eventBase.removeSelectedAppointmentClass()),this.parent.getTableRows());if(n)if(n.classList.contains(JOe)&&!this.parent.element.querySelector("."+$Oe)){s=o.indexOf(n.parentElement),a=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(a=this.isInverseTableSelect()?this.getVerticalUpDownCell(o,n,s,!1):this.getHorizontalUpDownCell(o,n,s,!1)),0<=s&&(s<o.length-1||a)){if(a=a||o[s+1].cells[n.cellIndex],"Year"===this.parent.currentView&&a.classList.contains(oNe)){if(!(this.parent.activeView.getEndDate().getTime()>+a.getAttribute("data-date")))return;a=this.getYearUpDownCell(o,s+1,n.cellIndex,!1)}e.preventDefault(),this.selectCells(t,a)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!1,n)}},A_e.prototype.getYearUpDownCell=function(e,t,i,n){for(;e[parseInt(t.toString(),10)]&&e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)].classList.contains(oNe);)t+=n?-1:1;return e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)]},A_e.prototype.getHorizontalUpDownCell=function(e,t,i,n){e=e[i+(n?-1:1)],i=e?e.cells[t.cellIndex]:t;return i.classList.contains(oNe)&&(n=e.querySelector("."+JOe+":not(."+oNe+")"),t=new Date(+n.getAttribute("data-date")),t='[data-date="'+new Date(t.getFullYear(),t.getMonth()+1,0).getTime()+'"]',i=i.cellIndex<n.cellIndex?n:e.querySelector(t)),i},A_e.prototype.getVerticalUpDownCell=function(e,t,i,n){var o=n&&0<i||!n&&i<e.length-1?e[i+(n?-1:1)].cells[t.cellIndex]:void 0;if(!o||o.classList.contains(oNe)){if(e[parseInt(i.toString(),10)].cells[t.cellIndex-(n?1:-1)])return e=+t.getAttribute("data-date")-(n?iOe:-iOe),this.parent.getContentTable().querySelector("."+JOe+'[data-date="'+e+'"]');o=t}return o},A_e.prototype.processLeftRight=function(e){var t="Year"===this.parent.currentView?e.closest("tbody"):this.parent.getContentTable(),i=e.parentNode.sectionRowIndex;return{element:t,rowIndex:i,columnIndex:e.cellIndex,maxIndex:t.rows[parseInt(i.toString(),10)].cells.length}},A_e.prototype.getQuickPopupElement=function(){return(this.parent.isAdaptive?document.body:this.parent.element).querySelector("."+GVe)},A_e.prototype.isCancelLeftRightAction=function(e,t,i){var i="MonthAgenda"===this.parent.currentView||i&&this.initialTarget.classList.contains(oNe);return!!("Agenda"===this.parent.currentView||t&&i)||!!(this.isPreventAction(e)&&t||(i=this.parent.element.querySelector("."+Z2e),e=this.getQuickPopupElement(),i.classList.contains($Oe))||e.classList.contains($Oe))},A_e.prototype.processRight=function(e,t){var i,n,o,r,s,a="TimelineYear"===this.parent.currentView;this.isCancelLeftRightAction(e,t,a)||this.isCalendarTarget(e)||(o=this.parent.getSelectedCells(),n=this.parent.eventBase.getSelectedAppointments(),i=e.target,0<o.length&&!i.classList.contains(JOe)&&!i.classList.contains(YOe)&&(i=o[o.length-1]),0<n.length&&(i=this.getWorkCellFromAppointmentElement(n[n.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!i))||(i.classList.contains(JOe)&&e.target.classList.contains(JOe)?(o=this.processLeftRight(i),n=new Date(+i.getAttribute("data-date")),r="Year"===this.parent.currentView&&n.getTime()===dOe(n).getTime(),0<=o.columnIndex&&o.columnIndex<o.maxIndex-1&&!r?(s=this.calculateNextPrevDate(i,o.element.rows[o.rowIndex].cells[i.cellIndex+1],"right"),je(s=a&&t&&s.classList.contains(oNe)?this.getTimelineYearTargetCell(o,i,!0):s)||this.selectCells(t,s)):o.columnIndex!==o.maxIndex-1&&!r||(!this.isInverseTableSelect()&&o.rowIndex<o.element.rows.length-1&&!r?(s=this.calculateNextPrevDate(i,o.element.rows[o.rowIndex+1].cells[0],"right"),je(s=a&&t&&s.classList.contains(oNe)?this.getHorizontalLeftRightCell(o,i,!0):s)||this.selectCells(t,s)):t||(r&&n.getTime()!==this.parent.activeView.getEndDate().getTime()?this.selectCells(t,this.parent.element.querySelector(":not(."+oNe+')[data-date="'+(n.getTime()+iOe)+'"]')):(a=this.isInverseTableSelect()?o.rowIndex:0,this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e),s=this.parent.getContentTable(),n=r?s.rows[parseInt(a.toString(),10)].querySelector("."+JOe+":not(."+oNe+")"):s.rows[parseInt(a.toString(),10)].cells[0],this.selectCells(!1,n))))):i.classList.contains(YOe)&&(o=i.cellIndex,s=(r=this.parent.getAllDayRow()).cells.length,0<=o&&o<s-1?this.selectCells(t,r.cells[o+1]):o!==s-1||t||(this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e),a=this.parent.getAllDayRow(),this.selectCells(!1,a.cells[0]))))},A_e.prototype.processLeft=function(e,t){var i,n,o,r,s,a="TimelineYear"===this.parent.currentView;this.isCancelLeftRightAction(e,t,a)||this.isCalendarTarget(e)||(i=e.target,0<(r=this.parent.getSelectedCells()).length&&!i.classList.contains(JOe)&&!i.classList.contains(YOe)&&(i=r[r.length-1]),0<(r=this.parent.eventBase.getSelectedAppointments()).length&&(i=this.getWorkCellFromAppointmentElement(r[r.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!i))||(e.target.classList.contains(JOe)&&i.classList.contains(JOe)?(r=this.processLeftRight(i),n=new Date(+i.getAttribute("data-date")),s="Year"===this.parent.currentView&&n.getTime()===hOe(n).getTime(),0<r.columnIndex&&r.columnIndex<r.maxIndex&&!s?(o=this.calculateNextPrevDate(i,r.element.rows[r.rowIndex].cells[i.cellIndex-1],"left"),je(o=a&&t&&o.classList.contains(oNe)?this.getTimelineYearTargetCell(r,i,!1):o)||this.selectCells(t,o)):0!==r.columnIndex&&!s||(!this.isInverseTableSelect()&&0<r.rowIndex?(o=this.calculateNextPrevDate(i,r.element.rows[r.rowIndex-1].cells[r.maxIndex-1],"left"),je(o=a&&t&&o.classList.contains(oNe)?this.getHorizontalLeftRightCell(r,i,!1):o)||this.selectCells(t,o)):t||(s&&n.getTime()!==this.parent.activeView.getStartDate().getTime()?this.selectCells(t,this.parent.element.querySelector('[data-date="'+(n.getTime()-iOe)+'"]')):(this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e),a=this.parent.getContentTable(),o=this.isInverseTableSelect()?r.rowIndex:a.rows.length-1,n=a.rows[parseInt(o.toString(),10)].cells[r.maxIndex-1],s&&(n=(a=this.parent.element.querySelectorAll("."+KOe+" tbody")).item(a.length-1).querySelector(":not(."+oNe+')[data-date="'+this.parent.activeView.getEndDate().getTime()+'"]')),this.selectCells(!1,n))))):i.classList.contains(YOe)&&(o=i.cellIndex,s=(r=this.parent.getAllDayRow()).cells.length,0<o&&o<s?this.selectCells(t,r.cells[o-1]):0!==o||t||(this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e),a=this.parent.getAllDayRow(),this.selectCells(!1,a.cells[s-1]))))},A_e.prototype.getTimelineYearTargetCell=function(e,t,i){return this.isInverseTableSelect()?this.getVerticalLeftRightCell(t,i):this.getHorizontalLeftRightCell(e,t,i)},A_e.prototype.getHorizontalLeftRightCell=function(e,t,i){e=e.element.rows[t.parentNode.sectionRowIndex+(i?1:-1)];return e?(i=i?"."+JOe+":not(."+oNe+")":'[data-date="'+(+t.getAttribute("data-date")-iOe)+'"]',e.querySelector(i)):t},A_e.prototype.getVerticalLeftRightCell=function(e,t){var i=new Date(+e.getAttribute("data-date")),i=new Date(i.getFullYear(),i.getMonth()+(t?1:-1),1),t=this.parent.getContentTable(),n=t.querySelector('[data-date="'+i.getTime()+'"]');return n.parentNode.sectionRowIndex>e.parentNode.sectionRowIndex?n:t.querySelector('[data-date="'+new Date(i.getFullYear(),i.getMonth()+1,0).getTime()+'"]')},A_e.prototype.calculateNextPrevDate=function(e,t,i){var n=this.initialTarget.getAttribute("data-group-index");return 0<this.parent.activeViewOptions.group.resources.length&&"Month"===this.parent.currentView&&e&&t&&t.getAttribute("data-group-index")!==n&&(e=this.parent.getDateFromElement(e),i="right"===i?new Date(e.setDate(e.getDate()+1)):new Date(e.setDate(e.getDate()-1)),t=[].slice.call(this.parent.element.querySelectorAll('td[data-date="'+i.getTime().toString()+'"][data-group-index="'+n+'"]'))[0]),t},A_e.prototype.getFocusableElements=function(e){return[].slice.call(e.querySelectorAll('a[href]:not([tabindex="-1"]),input:not([disabled]):not([tabindex="-1"]),textarea:not([disabled]):not([tabindex="-1"]),button:not([disabled]):not([tabindex="-1"]),select:not([disabled]):not([tabindex="-1"]),[tabindex]:not([tabindex="-1"]),[contentEditable=true]:not([tabindex="-1"])'))},A_e.prototype.processTabOnPopup=function(e,t){var i=this,t=this.getFocusableElements(t),n=(t=t.filter(function(e){var t=i.parent.element.querySelector("."+U2e);return t&&t.offsetParent?!(e.classList.contains(OVe)||e.classList.contains(VVe)):!(e.classList.contains(X2e)||e.classList.contains(K2e))}))[0],t=t[t.length-1];je(t)||document.activeElement!==t||e.shiftKey||(e.preventDefault(),n.focus()),!je(n)&&document.activeElement===n&&e.shiftKey&&(e.preventDefault(),t.focus())},A_e.prototype.processTab=function(e,t){var i=e.target;if(i.classList.contains(h_e)&&this.parent.inlineModule&&(i=i.closest(".e-appointment"),this.parent.inlineModule.inlineCrudActions(e.target)),"TimelineYear"===this.parent.currentView&&i.classList.contains(oNe))i.classList.contains(HNe)&&this.parent.removeSelectedClass();else{var n=z(i,"."+GVe+",."+Z2e);if(n&&n.classList.contains($Oe))n.classList.contains(Z2e)&&this.parent.eventBase.removeSelectedAppointmentClass(),this.processTabOnPopup(e,n);else if(i.classList.contains(_Oe))this.parent.eventBase.removeSelectedAppointmentClass();else if(i.classList.contains(ANe)&&this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length)r=parseInt(i.getAttribute("data-group-index"),10),0<(o=[].slice.call(this.parent.element.querySelectorAll("."+qNe+'[data-group-index="'+(t?r-1:r)+'"]'))).length?(this.parent.eventBase.removeSelectedAppointmentClass(),n=(t?o.slice(-1):o)[0],this.parent.eventBase.addSelectedAppointments([n],!0),n.focus(),e.preventDefault()):r+1===this.parent.resourceBase.lastResourceLevel.length?(this.parent.element.focus(),e.preventDefault()):this.parent.virtualScrollModule?(n=this.parent.element.querySelector("."+n2e),n=Math.round(n.offsetHeight/this.parent.resourceBase.expandedResources.length),this.parent.element.querySelector(".e-content-wrap").scrollTop=(t?r-1:r+1)*n,this.parent.virtualScrollModule.virtualScrolling()):this.setScrollPosition(r);else{if(i.classList.contains(qNe)){var o=[].slice.call(this.parent.element.querySelectorAll("."+qNe)),n="TimelineYear"===this.parent.currentView;if((this.parent.activeView.isTimelineView()&&!n||n&&"Vertical"===this.parent.activeViewOptions.orientation)&&0<this.parent.activeViewOptions.group.resources.length){var r=parseInt(i.getAttribute("data-group-index"),10),n=(o=[].slice.call(this.parent.element.querySelectorAll("."+qNe+'[data-group-index="'+r+'"]')),"."+ANe+'[data-group-index="'+(t?r:r+1)+'"]'),n=this.parent.element.querySelector(n);if(n&&(t&&i.getAttribute("data-guid")===o[0].getAttribute("data-guid")||!t&&i.getAttribute("data-guid")===o.slice(-1)[0].getAttribute("data-guid")))return this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.virtualScrollModule?n.focus({preventScroll:!0}):n.focus(),this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&je(this.parent.virtualScrollModule)&&this.setScrollPosition(r),void e.preventDefault()}n=this.parent.eventBase.getSelectedAppointments();return(0<n.length&&(i=n[n.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!t&&i.getAttribute("data-guid")===o[o.length-1].getAttribute("data-guid")||t&&i.getAttribute("data-guid")===o[0].getAttribute("data-guid"))?void 0:void("Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||(this.selectAppointment(t,i),e.preventDefault()))}r=this.parent.getSelectedCells();0<r.length&&!i.classList.contains(qNe)?(i=r[r.length-1],this.selectAppointmentElementFromWorkCell(t,i),e.preventDefault()):i&&!i.classList.contains(ANe)&&this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&this.processTabOnResourceCells(i,t)}}},A_e.prototype.processDelete=function(e){var t,i=document.activeElement;(i="MonthAgenda"===this.parent.currentView?(t=this.parent.eventBase.getSelectedEvents().element)&&je(t.length)?t:t[0]:i)&&i.classList.contains(qNe)&&(U([i],XNe),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),this.parent.activeViewOptions.readonly||i.classList.contains(a_e)||!this.parent.eventSettings.allowDeleting||this.parent.quickPopup.deleteClick(e))},A_e.prototype.processCtrlShiftNavigationArrows=function(e){if(0<this.parent.activeViewOptions.group.resources.length&&document.activeElement.classList.contains(qNe)){for(var t=parseInt(document.activeElement.getAttribute("data-group-index"),10),i=(n=(n="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?t-1:t+1)<0?0:n>this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.lastResourceLevel.length:n,[]);0===i.length&&0<=n&&n<=this.parent.resourceBase.lastResourceLevel.length;)i=[].slice.call(this.parent.element.querySelectorAll("."+qNe+'[data-group-index="'+n+'"]')),n="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?n-1:n+1;t=i[0];t&&(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.eventBase.addSelectedAppointments([t],!0),t.focus())}else{var n;0<this.parent.activeViewOptions.group.resources.length&&!document.activeElement.classList.contains(qNe)&&(n=this.parent.resourceBase.renderedResources[0].groupIndex,0<(t=[].slice.call(this.parent.element.querySelectorAll("."+qNe+'[data-group-index="'+n+'"]'))).length)&&(this.parent.eventBase.removeSelectedAppointmentClass(),t=t[0],this.parent.eventBase.addSelectedAppointments([t],!0),t.focus(),e.preventDefault())}},A_e.prototype.processEscape=function(e){this.parent.quickPopup.onClosePopup(e),this.parent.quickPopup.morePopup.hide(),this.parent.headerModule&&this.parent.headerModule.hideHeaderPopup(),this.parent.inlineModule&&this.parent.inlineModule.removeInlineAppointmentElement()},A_e.prototype.isPreventAction=function(e){e=z(e.target,"."+gNe);return!(!this.parent.activeView.isTimelineView()||je(e))},A_e.prototype.processTabOnResourceCells=function(e,t){var i,n=[].slice.call(this.parent.element.querySelectorAll('[tabIndex="0"]')),e=n.indexOf(e),t=t?n[e-1]:n[e+1];t&&t.classList.contains(ANe)&&(n=parseInt(t.getAttribute("data-group-index"),10),this.parent.virtualScrollModule?(i=this.parent.element.querySelector("."+fNe),[].slice.call(this.parent.element.querySelectorAll("."+ANe)).forEach(function(e){e.getBoundingClientRect().top<i.getBoundingClientRect().top&&e.setAttribute("tabindex","-1")})):this.setScrollPosition(n))},A_e.prototype.setScrollPosition=function(e){e=this.parent.element.querySelector("."+JOe+'[data-group-index="'+e+'"]');e&&(this.parent.element.querySelector("."+i2e).scrollTop=e.offsetTop)},A_e.prototype.createClipboardElement=function(){this.parent.allowClipboard&&(this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",attrs:{tabindex:"-1"}}),this.parent.element.appendChild(this.clipBoardTextArea))},A_e.prototype.setCopy=function(e,t){var i=this;if(""===window.getSelection().toString()){this.clipBoardTextArea.value="";var n={elements:[],eventDatas:[]};if(e){e=this.filterReadOnlyEvent(e);n.eventDatas=e}else{if(!this.parent||!this.parent.eventBase)return;e=this.parent.eventBase.getSelectedEvents();e.event=e&&e.event?Array.isArray(e.event)?this.filterReadOnlyEvent(e.event):this.filterReadOnlyEvent([e.event]):void 0,e.element&&e.event?n={elements:e.element,eventDatas:e.event}:(n.element=[t.target],n.eventDatas=[this.parent.getEventDetails(t.target)])}this.clipBoardTextArea.value=JSON.stringify(n.eventDatas,void 0,2),/ipad|ipod|iphone/i.test(F.userAgent)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),je(navigator.clipboard)||navigator.clipboard.writeText(this.clipBoardTextArea.value).then(function(){var e;i.clipBoardTextArea.blur(),window.getSelection().removeAllRanges(),t&&(e=t.target.closest("."+qNe))&&e.focus()}).catch(function(e){throw e})}},A_e.prototype.filterReadOnlyEvent=function(e){var t=this;return e.filter(function(e){return!e[t.parent.eventFields.isReadonly]})},A_e.prototype.processClipboardAction=function(e,t,i){this.parent.allowClipboard&&(this.isCutAction=e,this.isCutContentPasted=!1,this.parent.closeQuickInfoPopup(),this.setCopy(t||void 0,i))},A_e.prototype.pasteHandler=function(t,i){var n=this;if(this.parent.allowClipboard&&!this.isCutContentPasted){var e=0<this.parent.getSelectedCells().length?this.parent.getSelectedCells():i?[i]:[];if(0!==e.length&&!this.parent.eventWindow.dialogObject.visible&&!this.parent.quickPopup.quickPopup.element.classList.contains($Oe)){var o,t=(t.clipboardData||t.event.clipboardData||window.clipboardData).getData("text");if("[]"!==t&&""!==t){try{o=JSON.parse(t)}catch(e){o=t}this.parent.trigger(zRe,{cancel:!1,data:o,element:e},function(e){e.cancel?n.parent.closeQuickInfoPopup():Array.isArray(e.data)&&e.data.every(function(e){return"object"==typeof e})?(n.processPaste(e.data,i),n.isCutAction&&(n.isCutContentPasted=!0)):n.clipBoardTextArea.value=""})}}}},A_e.prototype.processPaste=function(e,t){var i,n,o,r;this.parent&&this.parent.eventWindow&&this.parent.eventBase&&e&&e.length&&(t=this.getTargetElements(t),r=this.parent.getCellDetails(t),this.parent.eventWindow.convertToEventData(r,i={}),o=this.isAllDayEvent(t),n=this.parent.getResourcesByIndex(r.groupIndex),e=this.processEventData(e,o,r,n),o=this.parent.eventBase.sortByDateTime(e),r=this.prepareEventData(o,i),q(t,HNe),0<r.length)&&(this.isCutAction?this.parent.saveEvent(r):this.parent.addEvent(r))},A_e.prototype.getTargetElements=function(e){return 0<this.parent.getSelectedCells().length?this.parent.getSelectedCells():e?[e]:[]},A_e.prototype.isAllDayEvent=function(e){return!e.some(function(e){return e.classList.contains(JOe)})},A_e.prototype.processEventData=function(e,i,n,o){var r=this;return e.map(function(e){var t=C_e({},e,((t={})[r.parent.eventFields.startTime]=new Date(e[r.parent.eventFields.startTime]),t[r.parent.eventFields.endTime]=new Date(e[r.parent.eventFields.endTime]),t[r.parent.eventFields.recurrenceID]=null,t[r.parent.eventFields.isAllDay]=i,t));return r.adjustEventTime(t,i,e.IsAllDay,n),o&&o.groupData&&Object.assign(t,o.groupData),t})},A_e.prototype.adjustEventTime=function(e,t,i,n){var o=this.parent.activeViewOptions.timeScale.enable;-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)&&o?t?(e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime]),e[this.parent.eventFields.endTime].setDate(e[this.parent.eventFields.startTime].getDate()+1)):i&&(e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].setHours(0,0,0,0)),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+(n.endTime.getTime()-n.startTime.getTime()))):i&&(e[this.parent.eventFields.isAllDay]=!0,e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].setHours(0,0,0,0)),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+(e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime())))},A_e.prototype.prepareEventData=function(e,n){var o=this,r=new Date(e[0][this.parent.eventFields.startTime]),s=this.parent.getEventMaxID();return e.map(function(e){var t=o.calculateTotalDuration(e,n,r),i=o.isCutAction?e:C_e({},e);return e[o.parent.eventFields.recurrenceRule]||(i[o.parent.eventFields.startTime]=new Date(new Date(i[o.parent.eventFields.startTime]).setMilliseconds(t)),i[o.parent.eventFields.endTime]=new Date(new Date(i[o.parent.eventFields.endTime]).setMilliseconds(t))),o.isCutAction||(i[o.parent.eventFields.id]=s++),i})},A_e.prototype.calculateTotalDuration=function(e,t,i){return-1===["Month","TimelineMonth","TimelineYear"].indexOf(this.parent.currentView)&&this.parent.activeViewOptions.timeScale.enable?t[this.parent.eventFields.startTime].getTime()-i.getTime():(e=new Date(e[this.parent.eventFields.startTime]),t[this.parent.eventFields.startTime].getTime()-i.getTime()+(36e5*e.getHours()+6e4*e.getMinutes()+1e3*e.getSeconds()))},A_e.prototype.getModuleName=function(){return"keyboard"},A_e.prototype.destroy=function(){this.removeEventListener(),this.selectedCells=[],this.clipBoardTextArea=null,this.keyboardModule.destroy()},A_e);function A_e(e){this.selectedCells=[],this.isCutContentPasted=!1,this.isCutAction=!1,this.keyConfigs={downArrow:"downarrow",upArrow:"uparrow",rightArrow:"rightarrow",leftArrow:"leftarrow",shiftDownArrow:"shift+downarrow",shiftUpArrow:"shift+uparrow",shiftRightArrow:"shift+rightarrow",shiftLeftArrow:"shift+leftarrow",ctrlLeftArrow:"ctrl+leftarrow",ctrlRightArrow:"ctrl+rightarrow",altOne:"alt+1",altTwo:"alt+2",altThree:"alt+3",altFour:"alt+4",altFive:"alt+5",altSix:"alt+6",altSeven:"alt+7",altEight:"alt+8",altNine:"alt+9",enter:"enter",escape:"escape",delete:"delete",backspace:"backspace",home:"home",pageUp:"pageup",pageDown:"pagedown",tab:"tab",shiftTab:"shift+tab",ctrlShiftUpArrow:"ctrl+shift+uparrow",ctrlShiftDownArrow:"ctrl+shift+downarrow",ctrlShiftLeftArrow:"ctrl+shift+leftarrow",ctrlShiftRightArrow:"ctrl+shift+rightarrow",shiftAltY:"shift+alt+y",shiftAltN:"shift+alt+n",cut:"ctrl+x",copy:"ctrl+c",cmdCut:"cmd+x",cmdCopy:"cmd+c"},this.parent=e,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.keyboardModule=new bn(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.addEventListener(),this.createClipboardElement()}I_e.prototype.initDataManager=function(e,t){this.dataManager=e instanceof me?e:new me(e),this.query=t instanceof ya?t:new ya},I_e.prototype.generateQuery=function(e,t){var n,i,o,r=this.query.clone();if(this.parent&&e&&t){if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&!je(this.parent.activeViewOptions.group.resources)&&0<this.parent.activeViewOptions.group.resources.length&&this.parent.resourceBase&&0<this.parent.resourceBase.resourceCollection.length&&0<this.parent.resourceBase.renderedResources.length&&(n=[],this.parent.resourceBase.resourceCollection.forEach(function(){return n.push([])}),this.parent.resourceBase.renderedResources.forEach(function(i){n.forEach(function(e,t){t=i.groupOrder[parseInt(t.toString(),10)];t&&e.indexOf(t)<0&&e.push(t)})}),this.parent.resourceBase.resourceCollection.forEach(function(e,t){r.addParams(e.field,n[parseInt(t.toString(),10)].toString())})),this.parent.timezone&&(e=this.parent.tzModule.remove(new Date(+e.getTime()),this.parent.timezone),t=this.parent.tzModule.remove(new Date(+t.getTime()),this.parent.timezone)),this.parent.eventSettings.includeFiltersInQuery)return i=this.getStartEndQuery(e,t),o=new ba(this.parent.eventFields.recurrenceRule,"notequal",null).and(new ba(this.parent.eventFields.recurrenceRule,"notequal","")),r.where(i.or(o));r.addParams("StartDate",e.toISOString()),r.addParams("EndDate",t.toISOString())}return r},I_e.prototype.getStartEndQuery=function(e,t){var i=this.parent.eventFields;return new ba(i.startTime,"greaterthanorequal",e).and(new ba(i.endTime,"greaterthanorequal",e)).and(new ba(i.startTime,"lessthan",t)).or(new ba(i.startTime,"lessthanorequal",e).and(new ba(i.endTime,"greaterthan",e)))},I_e.prototype.getData=function(e){return this.dataManager.executeQuery(e)},I_e.prototype.destroy=function(){this.dataManager=null,this.query=null};var x_e=I_e;function I_e(e,t,i){this.parent=e,this.initDataManager(t,i)}E_e.prototype.firstDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth())},E_e.prototype.lastDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth()+1,0)},E_e.prototype.isMonthStart=function(e){return 1===e.getDate()},E_e.prototype.getLeapYearDaysCount=function(){return 366},E_e.prototype.getYearDaysCount=function(e,t){return(e.getFullYear()+t)%4==0?366:365},E_e.prototype.getDate=function(e){return e.getDate()},E_e.prototype.getMonth=function(e){return e.getMonth()+1},E_e.prototype.getFullYear=function(e){return e.getFullYear()},E_e.prototype.getYearLastDate=function(e,t){return new Date(e.getFullYear()+t,0,0)},E_e.prototype.getMonthDaysCount=function(e){return this.lastDateOfMonth(e).getDate()},E_e.prototype.getMonthStartDate=function(e){return new Date(e.getFullYear(),e.getMonth(),1,e.getHours(),e.getMinutes())},E_e.prototype.getMonthEndDate=function(e){return e.setDate(1),new Date(e.setMonth(e.getMonth()+1))},E_e.prototype.getExpectedDays=function(e,t){return t},E_e.prototype.setDate=function(e,t){e.setDate(t)},E_e.prototype.setValidDate=function(e,t,i,n,o){je(o)?e.setMonth(e.getMonth()+t,i):e.setMonth((o?n:e.getMonth())+t)},E_e.prototype.setMonth=function(e,t,i){e.setDate(1),e.setFullYear(e.getFullYear()),e.setMonth(t-1);t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();e.setDate(Math.min(i,t))},E_e.prototype.addYears=function(e,t){e.setFullYear(e.getFullYear()+t)},E_e.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()},E_e.prototype.checkMonth=function(e,t){return-1===t.indexOf(e.getMonth()+1)},E_e.prototype.compareMonth=function(e,t){return e.getMonth()>t.getMonth()},E_e.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},E_e.prototype.isLastMonth=function(e){return 11===e.getMonth()},E_e.prototype.isLeapYear=function(e,t){return(e+t)%4==0};var T_e=E_e;function E_e(){}M_e.prototype.firstDateOfMonth=function(e){e=this.getHijriDate(e);return Jt.toGregorian(e.year,e.month,1)},M_e.prototype.lastDateOfMonth=function(e){var e=this.getHijriDate(e),t=this.getDaysInMonth(e.month,e.year),t=Jt.toGregorian(e.year,e.month,t),i=new Date(t.getTime()),i=new Date(i.setDate(i.getDate()+1)),n=this.getHijriDate(i);return e.month===n.month?i:(n=this.getHijriDate(t),e.month===n.month?t:new Date(t.setDate(t.getDate()-1)))},M_e.prototype.isMonthStart=function(e){return 1===this.getHijriDate(e).date},M_e.prototype.getLeapYearDaysCount=function(){return 355},M_e.prototype.getYearDaysCount=function(e,t){e=this.getHijriDate(e);return this.isLeapYear(e.year,t)?355:354},M_e.prototype.getDate=function(e){return this.getHijriDate(e).date},M_e.prototype.getMonth=function(e){return this.getHijriDate(e).month},M_e.prototype.getFullYear=function(e){return this.getHijriDate(e).year},M_e.prototype.getYearLastDate=function(e,t){e=this.getHijriDate(e);return Jt.toGregorian(e.year+t,1,0)},M_e.prototype.getMonthDaysCount=function(e){e=this.lastDateOfMonth(e);return this.getHijriDate(e).date},M_e.prototype.getMonthStartDate=function(e){var t=this.firstDateOfMonth(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes())},M_e.prototype.getMonthEndDate=function(e){e=this.lastDateOfMonth(e);return e.setDate(e.getDate()+1),new Date(e.setMonth(e.getMonth()))},M_e.prototype.getExpectedDays=function(e,t){for(var i=this.getHijriDate(e),n=[],o=0;o<t.length;o++){var r=Jt.toGregorian(i.year,i.month,t[parseInt(o.toString(),10)]);n.push(r.getDate())}return n},M_e.prototype.setDate=function(e,t){var i=this.getHijriDate(e),i=Jt.toGregorian(i.year,i.month,t);this.updateDateObj(e,i)},M_e.prototype.setValidDate=function(e,t,i,n,o){o=je(o)?e:this.firstDateOfMonth(o),o=this.getHijriDate(o),o=Jt.toGregorian(o.year,o.month+t,i);this.updateDateObj(e,o)},M_e.prototype.setMonth=function(e,t,i){var n=this.getHijriDate(e),n=Jt.toGregorian(n.year,t,i);this.updateDateObj(e,n)},M_e.prototype.addYears=function(e,t,i){var n=this.getHijriDate(e),n=Jt.toGregorian(n.year+t,i,1);this.updateDateObj(e,n)},M_e.prototype.isSameMonth=function(e,t){e=this.getHijriDate(e),t=this.getHijriDate(t);return e.month===t.month},M_e.prototype.checkMonth=function(e,t){e=this.getHijriDate(e);return-1===t.indexOf(e.month)},M_e.prototype.compareMonth=function(e,t){e=this.getHijriDate(e),t=this.getHijriDate(t);return e.month>t.month},M_e.prototype.isSameYear=function(e,t){e=this.getHijriDate(e),t=this.getHijriDate(t);return e.year===t.year},M_e.prototype.isLastMonth=function(e){return 12===this.getHijriDate(e).month},M_e.prototype.updateDateObj=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate())},M_e.prototype.isLeapYear=function(e,t){return(14+11*(e+t))%30<11},M_e.prototype.getDaysInMonth=function(e,t){var i=0,i=29+(e+1)%2;return 11===e&&this.isLeapYear(t,0)&&i++,i},M_e.prototype.getHijriDate=function(e){return Jt.getHijriDate(e)};var D_e=M_e;function M_e(){}P_e.prototype.offset=function(e,t){var i=e.getTimezoneOffset();try{var n=new Date(e.toLocaleString("en-US",{timeZone:t}));return isNaN(n.getTime())?0:(e.getTime()-n.getTime())/6e4+i}catch(e){return 0}},P_e.prototype.convert=function(e,t,i){"string"==typeof t&&(t=this.offset(e,t)),"string"==typeof i&&(i=this.offset(e,i));var n=e.getTimezoneOffset(),t=(e=new Date(e.getTime()+6e4*(t-i))).getTimezoneOffset();return new Date(e.getTime()+6e4*(t-n))},P_e.prototype.add=function(e,t){return this.convert(e,e.getTimezoneOffset(),t)},P_e.prototype.remove=function(e,t){return this.convert(e,t,e.getTimezoneOffset())},P_e.prototype.removeLocalOffset=function(e){return new Date(e.getTime()-6e4*e.getTimezoneOffset())},P_e.prototype.getLocalTimezoneName=function(){return window.Intl&&Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"},P_e.prototype.getTimezoneData=function(){return B_e};var k_e=P_e;function P_e(){this.timezoneData=[],this.timezoneData=this.getTimezoneData()}var B_e=[{Value:"Pacific/Niue",Text:"(UTC-11:00) Niue"},{Value:"Pacific/Pago_Pago",Text:"(UTC-11:00) Pago Pago"},{Value:"Pacific/Honolulu",Text:"(UTC-10:00) Hawaii Time"},{Value:"Pacific/Rarotonga",Text:"(UTC-10:00) Rarotonga"},{Value:"Pacific/Tahiti",Text:"(UTC-10:00) Tahiti"},{Value:"Pacific/Marquesas",Text:"(UTC-09:30) Marquesas"},{Value:"America/Anchorage",Text:"(UTC-09:00) Alaska Time"},{Value:"Pacific/Gambier",Text:"(UTC-09:00) Gambier"},{Value:"America/Los_Angeles",Text:"(UTC-08:00) Pacific Time"},{Value:"America/Tijuana",Text:"(UTC-08:00) Pacific Time - Tijuana"},{Value:"America/Vancouver",Text:"(UTC-08:00) Pacific Time - Vancouver"},{Value:"America/Whitehorse",Text:"(UTC-08:00) Pacific Time - Whitehorse"},{Value:"Pacific/Pitcairn",Text:"(UTC-08:00) Pitcairn"},{Value:"America/Denver",Text:"(UTC-07:00) Mountain Time"},{Value:"America/Phoenix",Text:"(UTC-07:00) Mountain Time - Arizona"},{Value:"America/Mazatlan",Text:"(UTC-07:00) Mountain Time - Chihuahua, Mazatlan"},{Value:"America/Dawson_Creek",Text:"(UTC-07:00) Mountain Time - Dawson Creek"},{Value:"America/Edmonton",Text:"(UTC-07:00) Mountain Time - Edmonton"},{Value:"America/Hermosillo",Text:"(UTC-07:00) Mountain Time - Hermosillo"},{Value:"America/Yellowknife",Text:"(UTC-07:00) Mountain Time - Yellowknife"},{Value:"America/Belize",Text:"(UTC-06:00) Belize"},{Value:"America/Chicago",Text:"(UTC-06:00) Central Time"},{Value:"America/Mexico_City",Text:"(UTC-06:00) Central Time - Mexico City"},{Value:"America/Regina",Text:"(UTC-06:00) Central Time - Regina"},{Value:"America/Tegucigalpa",Text:"(UTC-06:00) Central Time - Tegucigalpa"},{Value:"America/Winnipeg",Text:"(UTC-06:00) Central Time - Winnipeg"},{Value:"America/Costa_Rica",Text:"(UTC-06:00) Costa Rica"},{Value:"America/El_Salvador",Text:"(UTC-06:00) El Salvador"},{Value:"Pacific/Galapagos",Text:"(UTC-06:00) Galapagos"},{Value:"America/Guatemala",Text:"(UTC-06:00) Guatemala"},{Value:"America/Managua",Text:"(UTC-06:00) Managua"},{Value:"America/Cancun",Text:"(UTC-05:00) America Cancun"},{Value:"America/Bogota",Text:"(UTC-05:00) Bogota"},{Value:"Pacific/Easter",Text:"(UTC-05:00) Easter Island"},{Value:"America/New_York",Text:"(UTC-05:00) Eastern Time"},{Value:"America/Iqaluit",Text:"(UTC-05:00) Eastern Time - Iqaluit"},{Value:"America/Toronto",Text:"(UTC-05:00) Eastern Time - Toronto"},{Value:"America/Guayaquil",Text:"(UTC-05:00) Guayaquil"},{Value:"America/Havana",Text:"(UTC-05:00) Havana"},{Value:"America/Jamaica",Text:"(UTC-05:00) Jamaica"},{Value:"America/Lima",Text:"(UTC-05:00) Lima"},{Value:"America/Nassau",Text:"(UTC-05:00) Nassau"},{Value:"America/Panama",Text:"(UTC-05:00) Panama"},{Value:"America/Port-au-Prince",Text:"(UTC-05:00) Port-au-Prince"},{Value:"America/Rio_Branco",Text:"(UTC-05:00) Rio Branco"},{Value:"America/Halifax",Text:"(UTC-04:00) Atlantic Time - Halifax"},{Value:"America/Barbados",Text:"(UTC-04:00) Barbados"},{Value:"Atlantic/Bermuda",Text:"(UTC-04:00) Bermuda"},{Value:"America/Boa_Vista",Text:"(UTC-04:00) Boa Vista"},{Value:"America/Caracas",Text:"(UTC-04:00) Caracas"},{Value:"America/Curacao",Text:"(UTC-04:00) Curacao"},{Value:"America/Grand_Turk",Text:"(UTC-04:00) Grand Turk"},{Value:"America/Guyana",Text:"(UTC-04:00) Guyana"},{Value:"America/La_Paz",Text:"(UTC-04:00) La Paz"},{Value:"America/Manaus",Text:"(UTC-04:00) Manaus"},{Value:"America/Martinique",Text:"(UTC-04:00) Martinique"},{Value:"America/Port_of_Spain",Text:"(UTC-04:00) Port of Spain"},{Value:"America/Porto_Velho",Text:"(UTC-04:00) Porto Velho"},{Value:"America/Puerto_Rico",Text:"(UTC-04:00) Puerto Rico"},{Value:"America/Santo_Domingo",Text:"(UTC-04:00) Santo Domingo"},{Value:"America/Thule",Text:"(UTC-04:00) Thule"},{Value:"America/St_Johns",Text:"(UTC-03:30) Newfoundland Time - St. Johns"},{Value:"America/Araguaina",Text:"(UTC-03:00) Araguaina"},{Value:"America/Asuncion",Text:"(UTC-03:00) Asuncion"},{Value:"America/Belem",Text:"(UTC-03:00) Belem"},{Value:"America/Argentina/Buenos_Aires",Text:"(UTC-03:00) Buenos Aires"},{Value:"America/Campo_Grande",Text:"(UTC-03:00) Campo Grande"},{Value:"America/Cayenne",Text:"(UTC-03:00) Cayenne"},{Value:"America/Cuiaba",Text:"(UTC-03:00) Cuiaba"},{Value:"America/Fortaleza",Text:"(UTC-03:00) Fortaleza"},{Value:"America/Godthab",Text:"(UTC-03:00) Godthab"},{Value:"America/Maceio",Text:"(UTC-03:00) Maceio"},{Value:"America/Miquelon",Text:"(UTC-03:00) Miquelon"},{Value:"America/Montevideo",Text:"(UTC-03:00) Montevideo"},{Value:"Antarctica/Palmer",Text:"(UTC-03:00) Palmer"},{Value:"America/Paramaribo",Text:"(UTC-03:00) Paramaribo"},{Value:"America/Punta_Arenas",Text:"(UTC-03:00) Punta Arenas"},{Value:"America/Recife",Text:"(UTC-03:00) Recife"},{Value:"Antarctica/Rothera",Text:"(UTC-03:00) Rothera"},{Value:"America/Bahia",Text:"(UTC-03:00) Salvador"},{Value:"America/Santiago",Text:"(UTC-03:00) Santiago"},{Value:"Atlantic/Stanley",Text:"(UTC-03:00) Stanley"},{Value:"America/Noronha",Text:"(UTC-02:00) Noronha"},{Value:"America/Sao_Paulo",Text:"(UTC-02:00) Sao Paulo"},{Value:"Atlantic/South_Georgia",Text:"(UTC-02:00) South Georgia"},{Value:"Atlantic/Azores",Text:"(UTC-01:00) Azores"},{Value:"Atlantic/Cape_Verde",Text:"(UTC-01:00) Cape Verde"},{Value:"America/Scoresbysund",Text:"(UTC-01:00) Scoresbysund"},{Value:"Africa/Abidjan",Text:"(UTC+00:00) Abidjan"},{Value:"Africa/Accra",Text:"(UTC+00:00) Accra"},{Value:"Africa/Bissau",Text:"(UTC+00:00) Bissau"},{Value:"Atlantic/Canary",Text:"(UTC+00:00) Canary Islands"},{Value:"Africa/Casablanca",Text:"(UTC+00:00) Casablanca"},{Value:"America/Danmarkshavn",Text:"(UTC+00:00) Danmarkshavn"},{Value:"Europe/Dublin",Text:"(UTC+00:00) Dublin"},{Value:"Africa/El_Aaiun",Text:"(UTC+00:00) El Aaiun"},{Value:"Atlantic/Faroe",Text:"(UTC+00:00) Faeroe"},{Value:"Etc/UTC",Text:"(UTC+00:00) UTC (no daylight saving)"},{Value:"Europe/Lisbon",Text:"(UTC+00:00) Lisbon"},{Value:"Europe/London",Text:"(UTC+00:00) London"},{Value:"Africa/Monrovia",Text:"(UTC+00:00) Monrovia"},{Value:"Atlantic/Reykjavik",Text:"(UTC+00:00) Reykjavik"},{Value:"UTC",Text:"UTC"},{Value:"Africa/Algiers",Text:"(UTC+01:00) Algiers"},{Value:"Europe/Amsterdam",Text:"(UTC+01:00) Amsterdam"},{Value:"Europe/Andorra",Text:"(UTC+01:00) Andorra"},{Value:"Europe/Berlin",Text:"(UTC+01:00) Berlin"},{Value:"Europe/Brussels",Text:"(UTC+01:00) Brussels"},{Value:"Europe/Budapest",Text:"(UTC+01:00) Budapest"},{Value:"Europe/Belgrade",Text:"(UTC+01:00) Central European Time - Belgrade"},{Value:"Europe/Prague",Text:"(UTC+01:00) Central European Time - Prague"},{Value:"Africa/Ceuta",Text:"(UTC+01:00) Ceuta"},{Value:"Europe/Copenhagen",Text:"(UTC+01:00) Copenhagen"},{Value:"Europe/Gibraltar",Text:"(UTC+01:00) Gibraltar"},{Value:"Africa/Lagos",Text:"(UTC+01:00) Lagos"},{Value:"Europe/Luxembourg",Text:"(UTC+01:00) Luxembourg"},{Value:"Europe/Madrid",Text:"(UTC+01:00) Madrid"},{Value:"Europe/Malta",Text:"(UTC+01:00) Malta"},{Value:"Europe/Monaco",Text:"(UTC+01:00) Monaco"},{Value:"Africa/Ndjamena",Text:"(UTC+01:00) Ndjamena"},{Value:"Europe/Oslo",Text:"(UTC+01:00) Oslo"},{Value:"Europe/Paris",Text:"(UTC+01:00) Paris"},{Value:"Europe/Rome",Text:"(UTC+01:00) Rome"},{Value:"Europe/Stockholm",Text:"(UTC+01:00) Stockholm"},{Value:"Europe/Tirane",Text:"(UTC+01:00) Tirane"},{Value:"Africa/Tunis",Text:"(UTC+01:00) Tunis"},{Value:"Europe/Vienna",Text:"(UTC+01:00) Vienna"},{Value:"Europe/Warsaw",Text:"(UTC+01:00) Warsaw"},{Value:"Europe/Zurich",Text:"(UTC+01:00) Zurich"},{Value:"Asia/Amman",Text:"(UTC+02:00) Amman"},{Value:"Europe/Athens",Text:"(UTC+02:00) Athens"},{Value:"Asia/Beirut",Text:"(UTC+02:00) Beirut"},{Value:"Europe/Bucharest",Text:"(UTC+02:00) Bucharest"},{Value:"Africa/Cairo",Text:"(UTC+02:00) Cairo"},{Value:"Europe/Chisinau",Text:"(UTC+02:00) Chisinau"},{Value:"Asia/Damascus",Text:"(UTC+02:00) Damascus"},{Value:"Asia/Gaza",Text:"(UTC+02:00) Gaza"},{Value:"Europe/Helsinki",Text:"(UTC+02:00) Helsinki"},{Value:"Asia/Jerusalem",Text:"(UTC+02:00) Jerusalem"},{Value:"Africa/Johannesburg",Text:"(UTC+02:00) Johannesburg"},{Value:"Africa/Khartoum",Text:"(UTC+02:00) Khartoum"},{Value:"Europe/Kiev",Text:"(UTC+02:00) Kiev"},{Value:"Africa/Maputo",Text:"(UTC+02:00) Maputo"},{Value:"Europe/Kaliningrad",Text:"(UTC+02:00) Moscow-01 - Kaliningrad"},{Value:"Asia/Nicosia",Text:"(UTC+02:00) Nicosia"},{Value:"Europe/Riga",Text:"(UTC+02:00) Riga"},{Value:"Europe/Sofia",Text:"(UTC+02:00) Sofia"},{Value:"Europe/Tallinn",Text:"(UTC+02:00) Tallinn"},{Value:"Africa/Tripoli",Text:"(UTC+02:00) Tripoli"},{Value:"Europe/Vilnius",Text:"(UTC+02:00) Vilnius"},{Value:"Africa/Windhoek",Text:"(UTC+02:00) Windhoek"},{Value:"Asia/Baghdad",Text:"(UTC+03:00) Baghdad"},{Value:"Europe/Istanbul",Text:"(UTC+03:00) Istanbul"},{Value:"Europe/Minsk",Text:"(UTC+03:00) Minsk"},{Value:"Europe/Moscow",Text:"(UTC+03:00) Moscow+00 - Moscow"},{Value:"Africa/Nairobi",Text:"(UTC+03:00) Nairobi"},{Value:"Asia/Qatar",Text:"(UTC+03:00) Qatar"},{Value:"Asia/Riyadh",Text:"(UTC+03:00) Riyadh"},{Value:"Antarctica/Syowa",Text:"(UTC+03:00) Syowa"},{Value:"Asia/Tehran",Text:"(UTC+03:30) Tehran"},{Value:"Asia/Baku",Text:"(UTC+04:00) Baku"},{Value:"Asia/Dubai",Text:"(UTC+04:00) Dubai"},{Value:"Indian/Mahe",Text:"(UTC+04:00) Mahe"},{Value:"Indian/Mauritius",Text:"(UTC+04:00) Mauritius"},{Value:"Europe/Samara",Text:"(UTC+04:00) Moscow+01 - Samara"},{Value:"Indian/Reunion",Text:"(UTC+04:00) Reunion"},{Value:"Asia/Tbilisi",Text:"(UTC+04:00) Tbilisi"},{Value:"Asia/Yerevan",Text:"(UTC+04:00) Yerevan"},{Value:"Asia/Kabul",Text:"(UTC+04:30) Kabul"},{Value:"Asia/Aqtau",Text:"(UTC+05:00) Aqtau"},{Value:"Asia/Aqtobe",Text:"(UTC+05:00) Aqtobe"},{Value:"Asia/Ashgabat",Text:"(UTC+05:00) Ashgabat"},{Value:"Asia/Dushanbe",Text:"(UTC+05:00) Dushanbe"},{Value:"Asia/Karachi",Text:"(UTC+05:00) Karachi"},{Value:"Indian/Kerguelen",Text:"(UTC+05:00) Kerguelen"},{Value:"Indian/Maldives",Text:"(UTC+05:00) Maldives"},{Value:"Antarctica/Mawson",Text:"(UTC+05:00) Mawson"},{Value:"Asia/Yekaterinburg",Text:"(UTC+05:00) Moscow+02 - Yekaterinburg"},{Value:"Asia/Tashkent",Text:"(UTC+05:00) Tashkent"},{Value:"Asia/Colombo",Text:"(UTC+05:30) Colombo"},{Value:"Asia/Kolkata",Text:"(UTC+05:30) India Standard Time"},{Value:"Asia/Katmandu",Text:"(UTC+05:45) Katmandu"},{Value:"Asia/Almaty",Text:"(UTC+06:00) Almaty"},{Value:"Asia/Bishkek",Text:"(UTC+06:00) Bishkek"},{Value:"Indian/Chagos",Text:"(UTC+06:00) Chagos"},{Value:"Asia/Dhaka",Text:"(UTC+06:00) Dhaka"},{Value:"Asia/Omsk",Text:"(UTC+06:00) Moscow+03 - Omsk"},{Value:"Asia/Thimphu",Text:"(UTC+06:00) Thimphu"},{Value:"Antarctica/Vostok",Text:"(UTC+06:00) Vostok"},{Value:"Indian/Cocos",Text:"(UTC+06:30) Cocos"},{Value:"Asia/Yangon",Text:"(UTC+06:30) Rangoon"},{Value:"Asia/Bangkok",Text:"(UTC+07:00) Bangkok"},{Value:"Indian/Christmas",Text:"(UTC+07:00) Christmas"},{Value:"Antarctica/Davis",Text:"(UTC+07:00) Davis"},{Value:"Asia/Saigon",Text:"(UTC+07:00) Hanoi"},{Value:"Asia/Hovd",Text:"(UTC+07:00) Hovd"},{Value:"Asia/Jakarta",Text:"(UTC+07:00) Jakarta"},{Value:"Asia/Krasnoyarsk",Text:"(UTC+07:00) Moscow+04 - Krasnoyarsk"},{Value:"Asia/Brunei",Text:"(UTC+08:00) Brunei"},{Value:"Asia/Shanghai",Text:"(UTC+08:00) China Time - Beijing"},{Value:"Asia/Choibalsan",Text:"(UTC+08:00) Choibalsan"},{Value:"Asia/Hong_Kong",Text:"(UTC+08:00) Hong Kong"},{Value:"Asia/Kuala_Lumpur",Text:"(UTC+08:00) Kuala Lumpur"},{Value:"Asia/Macau",Text:"(UTC+08:00) Macau"},{Value:"Asia/Makassar",Text:"(UTC+08:00) Makassar"},{Value:"Asia/Manila",Text:"(UTC+08:00) Manila"},{Value:"Asia/Irkutsk",Text:"(UTC+08:00) Moscow+05 - Irkutsk"},{Value:"Asia/Singapore",Text:"(UTC+08:00) Singapore"},{Value:"Asia/Taipei",Text:"(UTC+08:00) Taipei"},{Value:"Asia/Ulaanbaatar",Text:"(UTC+08:00) Ulaanbaatar"},{Value:"Australia/Perth",Text:"(UTC+08:00) Western Time - Perth"},{Value:"Asia/Pyongyang",Text:"(UTC+08:30) Pyongyang"},{Value:"Asia/Dili",Text:"(UTC+09:00) Dili"},{Value:"Asia/Jayapura",Text:"(UTC+09:00) Jayapura"},{Value:"Asia/Yakutsk",Text:"(UTC+09:00) Moscow+06 - Yakutsk"},{Value:"Pacific/Palau",Text:"(UTC+09:00) Palau"},{Value:"Asia/Seoul",Text:"(UTC+09:00) Seoul"},{Value:"Asia/Tokyo",Text:"(UTC+09:00) Tokyo"},{Value:"Australia/Darwin",Text:"(UTC+09:30) Central Time - Darwin"},{Value:"Antarctica/DumontDUrville",Text:'(UTC+10:00) Dumont D"Urville'},{Value:"Australia/Brisbane",Text:"(UTC+10:00) Eastern Time - Brisbane"},{Value:"Pacific/Guam",Text:"(UTC+10:00) Guam"},{Value:"Asia/Vladivostok",Text:"(UTC+10:00) Moscow+07 - Vladivostok"},{Value:"Pacific/Port_Moresby",Text:"(UTC+10:00) Port Moresby"},{Value:"Pacific / Chuuk",Text:"(UTC+10:00) Truk"},{Value:"Australia/Adelaide",Text:"(UTC+10:30) Central Time - Adelaide"},{Value:"Antarctica/Casey",Text:"(UTC+11:00) Casey"},{Value:"Australia/Hobart",Text:"(UTC+11:00) Eastern Time - Hobart"},{Value:"Australia/Sydney",Text:"(UTC+11:00) Eastern Time - Melbourne, Sydney"},{Value:"Pacific/Efate",Text:"(UTC+11:00) Efate"},{Value:"Pacific/Guadalcanal",Text:"(UTC+11:00) Guadalcanal"},{Value:"Pacific/Kosrae",Text:"(UTC+11:00) Kosrae"},{Value:"Asia/Magadan",Text:"(UTC+11:00) Moscow+08 - Magadan"},{Value:"Pacific / Norfolk",Text:"(UTC+11:00) Norfolk"},{Value:"Pacific/Noumea",Text:"(UTC+11:00) Noumea"},{Value:"Pacific/Pohnpei",Text:"(UTC+11:00) Ponape"},{Value:"Pacific/Funafuti",Text:"(UTC+12:00) Funafuti"},{Value:"Pacific/Kwajalein",Text:"(UTC+12:00) Kwajalein"},{Value:"Pacific/Majuro",Text:"(UTC+12:00) Majuro"},{Value:"Asia/Kamchatka",Text:"(UTC+12:00) Moscow+09 - Petropavlovsk - Kamchatskiy"},{Value:"Pacific / Nauru",Text:"(UTC+12:00) Nauru"},{Value:"Pacific/Tarawa",Text:"(UTC+12:00) Tarawa"},{Value:"Pacific/Wake",Text:"(UTC+12:00) Wake"},{Value:"Pacific/Wallis",Text:"(UTC+12:00) Wallis"},{Value:"Pacific/Auckland",Text:"(UTC+13:00) Auckland"},{Value:"Pacific/Enderbury",Text:"(UTC+13:00) Enderbury"},{Value:"Pacific/Fakaofo",Text:"(UTC+13:00) Fakaofo"},{Value:"Pacific/Fiji",Text:"(UTC+13:00) Fiji"},{Value:"Pacific/Tongatapu",Text:"(UTC+13:00) Tongatapu"},{Value:"Pacific/Apia",Text:"(UTC+14:00) Apia"},{Value:"Pacific/Kiritimati",Text:"(UTC+14:00) Kiritimati"}];function F_e(e,t,i,n){void 0===n&&(n="Gregorian");var o,r,s,a=iHe(e),l=t.getConstant("every")+" ",e=n.toLowerCase();switch(r="en"===i||"en-US"===i?(s="days.stand-alone.abbreviated",o=R("months.stand-alone.abbreviated",Pi(e)),R(s,Pi(e))):(s="main."+i+".dates.calendars."+e+".days.stand-alone.abbreviated",o=R("main."+i+".dates.calendars."+e+".months.stand-alone.abbreviated",Ai),R(s,Ai)),1<a.interval&&(l+=a.interval+" "),a.freq){case"DAILY":l+=t.getConstant("summaryDay");break;case"WEEKLY":l+=t.getConstant("summaryWeek")+" "+t.getConstant(gHe)+" ",a.day.forEach(function(e,t){l=(l+=ROe(R(mHe[""+e],r),"single"))+(a.day.length-1===t?"":", ")});break;case"MONTHLY":l=(l+=t.getConstant("summaryMonth")+" "+t.getConstant(gHe)+" ")+L_e(a,r,t);break;case"YEARLY":l=(l=(l+=t.getConstant("summaryYear")+" "+t.getConstant(gHe)+" ")+(ROe(R(a.month[0].toString(),o),"single")+" "))+L_e(a,r,t)}return a.count?l+=", "+a.count+" "+t.getConstant("summaryTimes"):a.until&&(n=a.until,l+=", "+t.getConstant("summaryUntil")+" "+n.getDate()+" "+ROe(R((n.getMonth()+1).toString(),o),"single")+" "+n.getFullYear()),l}function L_e(e,t,i){var n,o="";return e.monthDay.length?o+=e.monthDay[0]:e.day&&(n=e.setPosition-1,o+=i.getConstant(uHe[-1<n?n:uHe.length-1])+" "+ROe(R(mHe[e.day[0]],t),"single")),o}function R_e(e,t,i,n,o,r,s,a){void 0===o&&(o=43),void 0===r&&(r=null),void 0===s&&(s="Gregorian"),void 0===a&&(a=null);var l=iHe(t),h=(hHe=rHe(s),[]),d=new Date(e.getTime()),t=(sHe=[],je(i)?[]:i.split(",")),O=new k_e;if(t.forEach(function(e){e=O_e(e);a&&(e=O.add(new Date(e.getTime()),a)),sHe.push(new Date(e.getTime()).setHours(0,0,0,0))}),l.recExceptionCount=je(l.count)?0:sHe.length,lHe=r&&e<r&&!l.count?new Date(new Date(r.getTime()).setHours(0,0,0)):null,!l.until&&lHe&&((s=new Date(lHe.getTime())).setDate(lHe.getDate()+o*l.interval),l.until=s),!(l.until&&e>l.until)){aHe=o,n=n||0;for(var N=cHe[parseInt(n.toString(),10)];pHe[0]!==N;){p=void 0;c=void 0;var p=pHe;var c=p.shift();p.push(c)}switch(l.until&&(i=gOe(l.until),l.until=new Date(i.getFullYear(),i.getMonth(),i.getDate(),23,59,59)),l.freq){case"DAILY":for(var u=d,V=l.until,g=h,m=l,f=new Date(u.getTime()),_=m.interval,y=V_e(u,m),v=m.day;$_e(f,V)&&!(oHe(f,m)&&(-1<v.indexOf(cHe[f.getDay()])||0===v.length)&&(N_e(g,f.getTime()),y)&&g.length+m.recExceptionCount>=y);)f.setDate(f.getDate()+_),f.getHours()!==u.getHours()&&f.setHours(u.getHours());break;case"WEEKLY":var b=d,w=l.until,C=h,S=l,H=n,A=new Date(b.getTime());S.day.length||S.day.push(cHe[b.getDay()]);var x,I=S.interval,T=S.day,E=V_e(b,S),z=!0,D=[];if(1<T.length)for(!je(S.wkst)&&""!==S.wkst||(S.wkst=pHe[0]),x=cHe.indexOf(S.wkst);$_e(A,w);){var M=cHe.indexOf(cHe[A.getDay()])-x,M=yOe(A,-(M=-1==M?6:M)),k=yOe(M,6),P=new Date(A.getTime());for(k=gOe(k),P=gOe(P);P<=k&&(-1<T.indexOf(cHe[A.getDay()])&&D.push([A.getTime()]),!(E&&C.length+S.recExceptionCount>=E));)A.setDate(A.getDate()+1),A.getHours()!==b.getHours()&&A.setHours(b.getHours()),P=gOe(P=new Date(A.getTime()));if(A.setDate(A.getDate()-1),E&&C.length+S.recExceptionCount>=E)break;A.setDate(A.getDate()+1+7*(I-1)),q_e(D,0,b,w,C,S),D=[]}else{for(A=tHe(b,S.day),1<I&&pHe.indexOf(S.day[0])<b.getDay()-H&&A.setDate(A.getDate()+7*(I-1));$_e(A,w)&&((z=oHe(A,S))&&-1<T.indexOf(cHe[A.getDay()])&&N_e(C,A.getTime()),!(E&&C.length+S.recExceptionCount>=E));)A.setDate(A.getDate()+7*I);q_e(D,0,b,w,C,S),D=[]}break;case"MONTHLY":__e(d,l.until,h,l);break;case"YEARLY":var B=d,F=l.until,L=h,R=l;switch(function(e){{if(e.yearDay.length)return"YEARDAY";if(e.weekNo.length)return"WEEKNO"}return"MONTH"}(R)){case"MONTH":__e(B,F,L,R);break;case"WEEKNO":!function(e,t,i,n){var o,r,s,a,l,h,d=hHe.getYearLastDate(e,0),p=V_e(e,n),c=n.weekNo,u=[],g=n.day;for(;$_e(d,t);){r=pHe.indexOf(cHe[d.getDay()]),s=6-r+1;for(var m=0;m<c.length;m++)for(a=c[parseInt(m.toString(),10)],l=1===(a=0<a?a:53+a+1)?s:s+7*(a-1),h=1===a?s-7:s+7*(a-2);h<l;)o=new Date(d.getTime()+iOe*h),(0===g.length||-1<g.indexOf(cHe[o.getDay()]))&&(je(n.setPosition)?K_e(0,e,t,i,n,o.getTime()):u.push([o.getTime()])),h++;if(je(n.setPosition)||Z_e(u,0,e,t,i,n),p&&i.length+n.recExceptionCount>=p)return;d=hHe.getYearLastDate(o,n.interval),u=[]}}(B,F,L,R);break;case"YEARDAY":!function(e,t,i,n){var o,r,s=hHe.getYearLastDate(e,0),a=V_e(e,n),l=[],h=n.day;for(;$_e(s,t);){for(var d=0;d<n.yearDay.length;d++)r=n.yearDay[parseInt(d.toString(),10)],o=new Date(s.getTime()),r!==hHe.getLeapYearDaysCount()&&r!==-hHe.getLeapYearDaysCount()||hHe.isLeapYear(hHe.getFullYear(o),1)?(o.setDate(o.getDate()+(r<0?hHe.getYearDaysCount(o,1)+1+r:r)),(0===h.length||-1<h.indexOf(cHe[o.getDay()]))&&(null==n.setPosition?K_e(0,e,t,i,n,o.getTime()):l.push([o.getTime()]))):o.setDate(o.getDate()+1);if(je(n.setPosition)||Z_e(l,0,e,t,i,n),a&&i.length+n.recExceptionCount>=a)return;s=hHe.getYearLastDate(o,n.interval),l=[]}}(B,F,L,R)}}}return h}function O_e(e){return new Date(e.substr(0,4)+"-"+e.substr(4,2)+"-"+e.substr(6,5)+":"+e.substr(11,2)+":"+e.substr(13))}function N_e(e,t){var i=new Date(t).setHours(0,0,0,0);-1===sHe.indexOf(i)&&(!lHe||i>=lHe.getTime())&&e.push(t)}function V_e(e,t){var i=aHe;return t.count?i=t.count:t.until&&("DAILY"===t.freq||"WEEKLY"===t.freq?i=Math.floor((t.until.getTime()-e.getTime())/iOe)+1:"MONTHLY"!==t.freq&&"YEARLY"!==t.freq||(i=Math.floor((t.until.getMonth()+12*t.until.getFullYear()-(e.getMonth()+12*e.getFullYear()))/t.interval)+(1<t.day.length?Math.floor((t.until.getTime()-e.getTime())/iOe)+1:1),"YEARLY"===t.freq&&(i=1<t.month.length?i*t.month.length:i))),i}function __e(e,t,i,n){switch(n.month.length||n.day.length||n.monthDay.length?0<n.month.length&&!n.day.length&&!n.monthDay.length&&n.monthDay.push(e.getDate()):(n.monthDay.push(e.getDate()),"YEARLY"===n.freq&&n.month.push(e.getMonth()+1)),function(e){{if(e.monthDay.length&&!e.day.length)return"date";if(!e.monthDay.length&&e.day.length)return"day"}return"both"}(n)){case"day":switch(n.freq){case"MONTHLY":U_e(e,t,i,n);break;case"YEARLY":!function(e,t,i,n){var o=n.day,r=o.map(function(e){return fHe.test(e)});if(1<o.length&&-1<r.indexOf(!0)){var s,a,l,h=e,d=t,p=i,c=n,u=c.day,g=V_e(h,c),m=new Date(h.getTime()),f=c.interval,y=[],v=[],b=0,w=(m=hHe.getMonthStartDate(m),[]);for(c.month.length&&hHe.setMonth(m,c.month[0],1),m=tHe(m,c.day);$_e(m,d);){a=new Date(m.getTime());for(var C=0;C<=c.month.length;C++)for(var S=0;S<=u.length-1;S++){for(m=tHe(m=hHe.getMonthStartDate(m),c.day),y=[];hHe.isSameYear(a,m)&&g&&p.length+c.recExceptionCount<=g;)for(;hHe.isSameYear(a,m);){if(a=new Date(m.getTime()),0===c.month.length||0<c.month.length&&c.month[parseInt(C.toString(),10)]===hHe.getMonth(a)){var A=u[parseInt(S.toString(),10)].match(vHe),x=parseInt(A[0],10);for(l=new Date(m.getTime());hHe.isSameYear(l,m)&&hHe.isSameMonth(l,m);)A[A.length-1]===cHe[l.getDay()]&&y.push([l.getTime()]),l.setDate(l.getDate()+1);l.setDate(l.getDate()-1),s=-1<A[0].indexOf("-")?y.length- -1*x:x-1,s=isNaN(s)?0:s}b=W_e(m,c,b,void 0,1),m=tHe(m,c.day)}if(m=0===S&&l?new Date(l.getTime()):new Date(a.getTime()),0<y.length&&(je(c.setPosition)?Z_e(y,0,h,d,p,c,s):v=[X_e(y,s,w)]),g&&p.length+c.recExceptionCount>=g)return}je(c.setPosition)||(J_e(v,0,h,d,p,c),w=[]),hHe.isLastMonth(m)?(hHe.setValidDate(m,1,1),m.setFullYear(m.getFullYear()+f-1)):m.setFullYear(m.getFullYear()+f),m=tHe(m,c.day),c.month.length&&hHe.setMonth(m,c.month[0],m.getDate())}}else if(n.month.length&&1===o.length&&-1<r.indexOf(!0))U_e(e,t,i,n);else{var I,T=new Date(e.getTime()),E=V_e(e,n),D=n.interval,M=[];for(n.month.length&&hHe.setMonth(T,n.month[0],T.getDate()),je(n.setPosition)&&0===n.month.length&&0===n.weekNo.length&&T.setFullYear(e.getFullYear(),0,1),T=tHe(T=hHe.getMonthStartDate(T),n.day);$_e(T,t);){for(I=new Date(T.getTime());hHe.isSameYear(I,T)&&E&&i.length+n.recExceptionCount<=E;)for(I=new Date(T.getTime());hHe.isSameYear(I,T);){if(!(0===n.month.length||0<n.month.length&&!hHe.checkMonth(T,n.month))){hHe.setValidDate(T,1,1),T=tHe(T,n.day);break}if(1<o.length){if(hHe.compareMonth(I,T)){hHe.setValidDate(T,1,1),T=tHe(T,n.day);break}-1<o.indexOf(cHe[I.getDay()])&&M.push([I.getTime()]),I.setDate(I.getDate()+1)}else{if(I.getFullYear()>T.getFullYear()){hHe.setValidDate(T,1,1),T=tHe(T,n.day);break}var k=eHe(o[0]);cHe[I.getDay()]===k&&new Date(I.getFullYear(),I.getMonth(),0)>new Date(e.getFullYear())&&M.push([I.getTime()]),I.setDate(I.getDate()+7)}}if(T.setFullYear(I.getFullYear(),I.getMonth(),I.getDate()),Y_e(M,e,t,i,n),hHe.isLastMonth(T)&&(hHe.setValidDate(T,1,1),T=tHe(T,n.day)),T.setFullYear(T.getFullYear()+D-1),E&&i.length+n.recExceptionCount>=E)return;T=tHe(T,n.day),M=[]}}}(e,t,i,n)}break;case"both":case"date":switch(n.freq){case"MONTHLY":z_e(e,t,i,n);break;case"YEARLY":!function(e,t,i,n){if(n.month.length)z_e(e,t,i,n);else{var o,r=H_e(e,n);for(r.tempDate=r.mainDate=hHe.getMonthStartDate(r.tempDate);$_e(r.tempDate,t);){for(o=new Date(r.tempDate.getTime());hHe.isSameYear(o,r.tempDate)&&r.expectedCount&&i.length+n.recExceptionCount<=r.expectedCount;){if(!(0===n.month.length||0<n.month.length&&!hHe.checkMonth(r.tempDate,n.month))){hHe.setValidDate(r.tempDate,1,1),r.tempDate=tHe(r.tempDate,n.day);break}j_e(n,r,t,!1),r.beginDate=new Date(r.tempDate.getTime()),r.monthInit=W_e(r.tempDate,n,r.monthInit,r.beginDate)}if(r.tempDate.setFullYear(o.getFullYear(),o.getMonth(),o.getDate()),q_e(r.dateCollection,r.state,e,t,i,n),hHe.isLastMonth(r.tempDate)&&(hHe.setValidDate(r.tempDate,1,1),r.tempDate=tHe(r.tempDate,n.day)),r.expectedCount&&i.length+n.recExceptionCount>=r.expectedCount)return;r.tempDate.setFullYear(r.tempDate.getFullYear()+n.interval-1),r.tempDate=tHe(r.tempDate,n.day),r.monthInit=W_e(r.tempDate,n,r.monthInit,r.beginDate),r.dateCollection=[]}}}(e,t,i,n)}}}function H_e(e,t){e={monthCollection:[],index:0,tempDate:new Date(e.getTime()),mainDate:new Date(e.getTime()),expectedCount:V_e(e,t),monthInit:0,dateCollection:[]};return t.month.length&&hHe.setMonth(e.tempDate,t.month[0],e.tempDate.getDate()),e}function z_e(e,t,i,n){var o=H_e(e,n);if(o.tempDate=o.mainDate=hHe.getMonthStartDate(o.tempDate),!(("MONTHLY"===n.freq&&12===n.interval||"YEARLY"===n.freq)&&hHe.getMonthDaysCount(e)<n.monthDay[0]))for(;$_e(o.tempDate,t);){if(o.beginDate=new Date(o.tempDate.getTime()),j_e(n,o,t,!0,e,i),je(n.setPosition)||Z_e(o.dateCollection,o.state,e,t,i,n),o.expectedCount&&i.length+n.recExceptionCount>=o.expectedCount)return;o.monthInit=W_e(o.tempDate,n,o.monthInit,o.beginDate),o.dateCollection=[]}}function j_e(e,t,i,n,o,r){for(var s,a,l,h=0;h<e.monthDay.length;h++){t.date=e.monthDay[parseInt(h.toString(),10)],t.tempDate=hHe.getMonthStartDate(t.tempDate);var d=hHe.getMonthDaysCount(t.tempDate);if(t.date=0<t.date?t.date:d+t.date+1,d=t.tempDate,s=t.date,a=t.mainDate,l=void 0,l=hHe.getMonthDaysCount(d),s<=l&&a<=d&&0<t.date){if(hHe.setDate(t.tempDate,t.date),i&&t.tempDate>i)return;(0===e.day.length||-1<e.day.indexOf(cHe[t.tempDate.getDay()]))&&(n&&je(e.setPosition)&&t.expectedCount&&r.length+e.recExceptionCount<t.expectedCount?K_e(t.state,o,i,r,e,t.tempDate.getTime()):t.dateCollection.push([t.tempDate.getTime()]))}}}function W_e(e,t,i,n,o){var r=(n=void 0===n?null:n)?n.getMonth():0,s=hHe.getMonthStartDate(e);return o=je(o)?t.interval:o,e.setFullYear(s.getFullYear()),e.setMonth(s.getMonth()),e.setDate(s.getDate()),t.month.length?(i++,i%=t.month.length,hHe.setMonth(e,t.month[parseInt(i.toString(),10)],1),0===i&&hHe.addYears(e,o,t.month[0])):(n&&n.getFullYear()<e.getFullYear()&&(r=e.getMonth()-1),hHe.setValidDate(e,o,1,r,n)),i}function Q_e(e,t,i,n){var o=n.day,r=new Date(e.getTime()),s=(r=hHe.getMonthStartDate(r),[]),a=[],l=[],h=V_e(e,n),d=0;for(n.month.length&&hHe.setMonth(r,n.month[0],1),r=tHe(r,n.day);$_e(r,t)&&h&&i.length+n.recExceptionCount<h;){var p=new Date(r.getTime());if(-1<o.map(function(e){return fHe.test(e)}).indexOf(!0)){for(var c=0;c<=o.length-1;c++){var u=o[parseInt(c.toString(),10)].match(vHe),g=parseInt(u[0],10),r=new Date(r.getTime());for(r=tHe(r=hHe.getMonthStartDate(r),o),p.setFullYear(r.getFullYear(),r.getMonth(),r.getDate());hHe.isSameYear(p,r)&&hHe.isSameMonth(p,r);)u[u.length-1]===cHe[p.getDay()]&&s.push([p.getTime()]),p.setDate(p.getDate()+1);if(p.setDate(p.getDate()-1),b=-1<u[0].indexOf("-")?s.length- -1*g:g-1,b=isNaN(b)?0:b,0<s.length&&(je(n.setPosition)?Z_e(s,0,e,t,i,n,b):a=[X_e(s,b,l)]),h&&i.length+n.recExceptionCount>=h)return;s=[]}je(n.setPosition)||(J_e(a,0,e,t,i,n),l=[])}else{for(var m=[],f=function(o){var r={};return o.forEach(function(e,t){if(t===o.length-1){for(var i=pHe.indexOf(e),n=i;n%7!==pHe.indexOf(o[0]);)n++;r[""+e]=n-i}else r[""+e]=pHe.indexOf(o[t+1])-pHe.indexOf(e)}),r}(o),y=(p.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),new Date(r.getTime())),v=new Date(r.getTime());hHe.isSameMonth(y,r);)m.push(r.getTime()),-1<o.indexOf(cHe[r.getDay()])&&(s.push(m),m=[]),r.setDate(r.getDate()+f[cHe[r.getDay()]]);if(b=n.setPosition<1?s.length+n.setPosition:n.setPosition-1,je(n.setPosition)){for(var b=0,w=[],C=0;C<s.length;C++)for(var S=0;S<s[parseInt(C.toString(),10)].length;S++)w.push(s[parseInt(C.toString(),10)][parseInt(S.toString(),10)]);s=[w]}if(0<s.length&&Z_e(s,0,e,t,i,n,b),h&&i.length+n.recExceptionCount>=h)return}d=W_e(r,n,d,v),r=tHe(r,n.day),s=[]}}function U_e(e,t,i,n){if(1<n.day.length)Q_e(e,t,i,n);else{var o=new Date(e.getTime()),r=V_e(e,n),s=[],a=0,o=hHe.getMonthStartDate(o);for(n.month.length&&hHe.setMonth(o,n.month[0],1),o=tHe(o,n.day);$_e(o,t)&&r&&i.length+n.recExceptionCount<r;){for(var l=new Date(o.getTime()),h=new Date(o.getTime());hHe.isSameMonth(o,h);)s.push([h.getTime()]),h.setDate(h.getDate()+7);Y_e(s,e,t,i,n),a=W_e(o,n,a,l),o=tHe(o,n.day),s=[]}}}function q_e(e,t,i,n,o,r){var s=r.setPosition<1?e.length+r.setPosition:r.setPosition-1;je(r.setPosition)&&(s=0,e=G_e(e)),0<e.length&&Z_e(e,0,i,n,o,r,s)}function G_e(e){for(var t=[],i=0;i<e.length;i++)for(var n=0;n<e[parseInt(i.toString(),10)].length;n++)t.push(new Date(e[parseInt(i.toString(),10)][parseInt(n.toString(),10)]).getTime());return e=0<t.length?[t]:[]}function Y_e(e,t,i,n,o){var r,s,a,l=o.day,l=(r=e,a={monthCollection:[],index:0},1===(l=l).length&&(h=void 0,1<(l=l[0].match(vHe)).length)?s=(h=parseInt(l[0],10))<1?r.length+h:h-1:(s=0,r=G_e(r)),a.monthCollection=r,a.index=s,a),h=(e=l.monthCollection,l.index);null!=o.setPosition?J_e([X_e(e,h,[])],0,t,i,n,o):0<e.length&&Z_e(e,0,t,i,n,o,h)}function X_e(e,t,i){for(var n=0;n<e[parseInt(t.toString(),10)].length;n++)i.push(e[parseInt(t.toString(),10)][parseInt(n.toString(),10)]);return i}function K_e(e,t,i,n,o,r){var s=V_e(t,o),a=new Date(r);e=oHe(a,o),t<=a&&$_e(a,i)&&e&&s&&n.length+o.recExceptionCount<s&&N_e(n,r)}function J_e(e,t,i,n,o,r){if(0<e.length)for(var s=0;s<e.length;s++){e[parseInt(s.toString(),10)].sort();var a=r.day.map(function(e){return fHe.test(e)}),a="YEARLY"===r.freq&&-1<r.validRules.indexOf("BYMONTH")&&!(-1<a.indexOf(!0))?(a=new Date(e[0][0]).getFullYear(),l=e,d=s,p=r,c=void(h=0),h=h||0,c=new Date(a,p.month[0]-1,1),a=new Date(a,p.month[0],0).getDate(),c=(c.getDay()-h+7)%7,h=Math.ceil((c+a)/7)-1,c=l[parseInt(d.toString(),10)][parseInt(h.toString(),10)],oHe(new Date(c),p)?h:h-1):e[parseInt(s.toString(),10)].length+r.setPosition,l=r.setPosition<1?a:r.setPosition-1;K_e(0,i,n,o,r,e[parseInt(s.toString(),10)][parseInt(l.toString(),10)])}var h,l,d,p,c}function Z_e(e,t,i,n,o,r,s){if(0<e.length){s=je(s)?r.setPosition<1?e.length+r.setPosition:r.setPosition-1:s,e[parseInt(s.toString(),10)].sort();for(var a=0;a<e[parseInt(s.toString(),10)].length;a++)K_e(0,i,n,o,r,e[parseInt(s.toString(),10)][parseInt(a.toString(),10)])}}function $_e(e,t){return!t||e<=t}function eHe(e){return e.replace(yHe,"")}function tHe(e,t){var i,n=new Date(e.getTime());if(0<t.length){for(var o=[],r=0;r<=t.length-1;r++)i=eHe(t[parseInt(r.toString(),10)]),o.push(i);if(-1===o.indexOf(cHe[n.getDay()]))for(;n.setDate(n.getDate()+1),-1===o.indexOf(cHe[n.getDay()]););}return n}function iHe(e){var t,i={freq:null,interval:1,count:null,until:null,day:[],wkst:null,month:[],weekNo:[],monthDay:[],yearDay:[],setPosition:null,validRules:[]},e=e.split(";"),n=[];return e.forEach(function(e){switch((n=e.split("="))[0]){case"UNTIL":t=n[1],i.until=O_e(t);break;case"BYDAY":i.day=n[1].split(","),i.validRules.push(n[0]);break;case"BYMONTHDAY":i.monthDay=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYMONTH":i.month=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYYEARDAY":i.yearDay=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYWEEKNO":i.weekNo=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"INTERVAL":i.interval=parseInt(n[1],10);break;case"COUNT":i.count=parseInt(n[1],10);break;case"BYSETPOS":i.setPosition=4<parseInt(n[1],10)?-1:parseInt(n[1],10);break;case"FREQ":i.freq=n[1];break;case"WKST":i.wkst=n[1]}}),"MONTHLY"===i.freq&&0===i.monthDay.length&&(e=i.validRules.indexOf("BYDAY"),i.validRules.splice(e,1)),i}function nHe(e,t){for(var i,n=t.slice(0),o=(t=e,dHe[hHe.getFullYear(t)]||(dHe[hHe.getFullYear(t)]=hHe.getYearLastDate(t,0)),i=dHe[hHe.getFullYear(t)],t=t.getTime()-i.getTime(),Math.ceil(t/iOe)),r=n.shift();r;){if((r=r<0?r+hHe.getYearDaysCount(e,0)+1:r)===o)return;r=n.shift()}return 1}function oHe(n,e){var o=!0,r=e.day,s=e.month,a=hHe.getExpectedDays(n,e.monthDay),l=e.yearDay;return e.validRules.forEach(function(e){switch(e){case"BYDAY":t=n.getDay(),i=[],r.forEach(function(e){e=e.match(vHe);2===e.length?i.push(e[1]):i.push(e[0])}),-1===i.indexOf(cHe[parseInt(t.toString(),10)])&&(o=!1);break;case"BYMONTH":hHe.checkMonth(n,s)&&(o=!1);break;case"BYMONTHDAY":!function(e,t){for(var i=t.slice(0),n=hHe.getMonthDaysCount(e),o=i.shift();o;){if((o=o<0?o+n+1:o)===e.getDate())return;o=i.shift()}return 1}(n,a)||(o=!1);break;case"BYYEARDAY":nHe(n,l)&&(o=!1)}var t,i}),o}function rHe(e){return new("Islamic"===e?D_e:T_e)}var sHe,aHe,lHe,hHe,dHe={},pHe=["SU","MO","TU","WE","TH","FR","SA"],cHe=["SU","MO","TU","WE","TH","FR","SA"],uHe=["first","second","third","fourth","last"],gHe="summaryOn",mHe={SU:"sun",MO:"mon",TU:"tue",WE:"wed",TH:"thu",FR:"fri",SA:"sat"},fHe=/\d/,yHe=/[^A-Z]+/,vHe=/[a-z]+|[^a-z]+/gi;function bHe(e){return[e.getUTCFullYear(),wHe(e.getUTCMonth()+1),wHe(e.getUTCDate()),"T",wHe(e.getUTCHours()),wHe(e.getUTCMinutes()),wHe(e.getUTCSeconds()),"Z"].join("")}function wHe(e){return("0"+e).slice(-2)}SHe.prototype.processData=function(e,r,s){for(var a=this,t=this.parent.activeView.startDate(),i=this.parent.activeView.endDate(),l=this.parent.eventFields,h=[],d=1,p=!1,c=this.parent.resourceBase?this.parent.resourceBase.resourceCollection:[],n=(0<e.length&&je(e[0][l.id])&&(p=!0),function(t){p&&(t[l.id]=d++),t=u.updateEventDateTime(t),r?u.processTimezoneChange(t,s):u.parent.isPrinting||u.parent.uiStateValues.isPreventTimezone||(t=u.processTimezone(t));for(var e=0;e<c.length;e++)null!==t[c[parseInt(e.toString(),10)].field]&&0!==t[c[parseInt(e.toString(),10)].field]||(t[c[parseInt(e.toString(),10)].field]=void 0);if(je(t[l.recurrenceRule])||""!==t[l.recurrenceRule]||(t[l.recurrenceRule]=null),je(t[l.recurrenceRule])||!je(t[l.recurrenceID])||u.parent.crudModule&&u.parent.crudModule.crudObj.isCrudAction)if(u.parent.crudModule&&u.parent.crudModule.crudObj.isCrudAction)if(!je(t[l.recurrenceRule])&&je(t[l.recurrenceID]))for(var i=0,n=u.generateOccurrence(t,null,!0);i<n.length;i++)!function(t){var e=u.parent.eventsProcessed.filter(function(e){return e[l.startTime].getTime()-t[l.startTime].getTime()==0&&e[l.id]===t[l.id]});t.Guid=0<e.length?e[0].Guid:u.generateGuid(),h.push(t)}(n[i]);else{var o=u.parent.eventsProcessed.filter(function(e){return e[a.parent.eventFields.id]===t[a.parent.eventFields.id]});t.Guid=0<o.length?o[0].Guid:u.generateGuid(),h.push(t)}else t.Guid=u.generateGuid(),h.push(t);else h=h.concat(u.generateOccurrence(t,null,!0))}),u=this,o=0,g=e;o<g.length;o++)n(g[o]);this.parent.eventsProcessed=[];e=h.filter(function(e){return!e[a.parent.eventFields.isBlock]});if(this.parent.eventsProcessed=this.filterEvents(t,i,e),!this.parent.activeViewOptions.allowOverlap&&0<this.parent.eventsProcessed.length){this.processedData=this.parent.eventsProcessed;for(var m=[],f=this.parent.eventFields,y=0,v=this.parent.eventsProcessed;y<v.length;y++){var b,w=v[y],C=this.findOverlappingData(w,m);C?!this.parent.eventSettings.sortComparer&&(b=new Date(w[f.endTime]).getTime()-new Date(w[f.startTime]).getTime(),new Date(C[f.endTime]).getTime()-new Date(C[f.startTime]).getTime()<b&&w[f.startTime]===C[f.startTime]||!0===w[f.isAllDay])&&(-1!==(b=m.indexOf(C))&&m.splice(b,1),m.push(w)):m.push(w)}this.parent.eventsProcessed=m}for(var t=h.filter(function(e){return e[a.parent.eventFields.isBlock]}),S=0,A=t;S<A.length;S++){var x=A[S];!x[l.isAllDay]||gOe(new Date(x[l.startTime].getTime()))<gOe(new Date(x[l.endTime].getTime()))||(x[l.startTime]=gOe(x[l.startTime]),x[l.endTime]=yOe(gOe(x[l.endTime]),1))}return this.parent.blockProcessed=t,e},SHe.prototype.findOverlappingData=function(e,t){for(var i=0<this.parent.activeViewOptions.group.resources.length,n=i?this.parent.resourceBase.resourceCollection:[],o=i?n[n.length-1].field:null,r=this.parent.eventFields,s=new Date(e[r.startTime]),a=new Date(e[r.endTime]),l=0,h=t;l<h.length;l++){var d=h[l];if(s<d[r.endTime]&&a>d[r.startTime]&&d[r.id]!==e[r.id]&&(!i||je(o)||this.compareResourceValues(d[""+o],e[""+o])))return d}},SHe.prototype.isOverlapRange=function(e,t){for(var i=this,n=(void 0===t&&(t=null),0<this.parent.activeViewOptions.group.resources.length),o=n?this.parent.resourceBase.resourceCollection:[],r=n?o[o.length-1].field:null,o=Array.isArray(e)?e:[e],s=this.parent.eventFields,a=[],l=!1,h=0,d=o;h<d.length;h++)for(var p=d[h],c=0,u=je(p[s.recurrenceRule])||!je(p[s.recurrenceID])&&p[s.recurrenceID]!==p[s.id]||!je(p[s.recurrenceID])&&"EditSeries"!==t?[p]:this.generateOccurrence(p);c<u.length;c++){var g=u[c],m=function(t){return i.processedData.filter(function(e){return t[s.startTime]<e[s.endTime]&&t[s.endTime]>e[s.startTime]&&e[s.id]!==t[s.id]&&(!n||je(r)||i.compareResourceValues(e[""+r],t[""+r]))})}(g);0<m.length&&a.push.apply(a,m),this.findOverlappingData(g,this.parent.eventsProcessed)&&(l=!0)}return this.parent.overlapAppointments=a,l},SHe.prototype.compareResourceValues=function(e,t){function i(e){return Array.isArray(e)?e[0]:e}return i(e)===i(t)},SHe.prototype.checkOverlap=function(e){return!(this.parent.activeViewOptions.allowOverlap||!this.isOverlapRange(e)||(this.parent.quickPopup.openValidationError("overlapAlert",e),0))},SHe.prototype.updateEventDateTime=function(e){return"string"==typeof e[this.parent.eventFields.startTime]&&(e[this.parent.eventFields.startTime]=AOe(e[this.parent.eventFields.startTime])),"string"==typeof e[this.parent.eventFields.endTime]&&(e[this.parent.eventFields.endTime]=AOe(e[this.parent.eventFields.endTime])),e},SHe.prototype.getProcessedEvents=function(e){for(var t=[],i=0,n=e=void 0===e?this.parent.eventsData:e;i<n.length;i++){var o=n[i];!je(o[this.parent.eventFields.recurrenceRule])&&je(o[this.parent.eventFields.recurrenceID])?t=t.concat(this.generateOccurrence(o)):t.push(o)}return t},SHe.prototype.timezonePropertyChange=function(e){var t=this.parent.eventsData.concat(this.parent.blockData),t=this.processData(t,!0,e);this.parent.notify(qRe,{processedData:t})},SHe.prototype.timezoneConvert=function(e){var t,i,n=this.parent.eventFields;e[n.startTimezone]=e[n.startTimezone]||e[n.endTimezone],e[n.endTimezone]=e[n.endTimezone]||e[n.startTimezone],this.parent.timezone&&(t=e[n.startTimezone],i=e[n.endTimezone],e[n.startTime]=this.parent.tzModule.convert(e[n.startTime],this.parent.timezone,t),e[n.endTime]=this.parent.tzModule.convert(e[n.endTime],this.parent.timezone,i))},SHe.prototype.processTimezoneChange=function(e,t){var i=this.parent.eventFields;e[i.isAllDay]||(t&&this.parent.timezone?(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],t,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],t,this.parent.timezone)):!t&&this.parent.timezone?(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],this.parent.timezone)):t&&!this.parent.timezone&&(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],t),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],t)))},SHe.prototype.processTimezone=function(e,t){void 0===t&&(t=!1);var i,n,o=this.parent.eventFields;return e[o.isAllDay]||(e[o.startTimezone]||e[o.endTimezone]?(i=e[o.startTimezone]||e[o.endTimezone],n=e[o.endTimezone]||e[o.startTimezone],t?this.parent.timezone?(e[o.startTime]=this.parent.tzModule.convert(e[o.startTime],i,this.parent.timezone),e[o.endTime]=this.parent.tzModule.convert(e[o.endTime],n,this.parent.timezone),e[o.startTime]=this.parent.tzModule.remove(e[o.startTime],this.parent.timezone),e[o.endTime]=this.parent.tzModule.remove(e[o.endTime],this.parent.timezone)):(e[o.startTime]=this.parent.tzModule.remove(e[o.startTime],i),e[o.endTime]=this.parent.tzModule.remove(e[o.endTime],n)):(e[o.startTime]=this.parent.tzModule.add(e[o.startTime],i),e[o.endTime]=this.parent.tzModule.add(e[o.endTime],n),this.parent.timezone&&(e[o.startTime]=this.parent.tzModule.convert(e[o.startTime],i,this.parent.timezone),e[o.endTime]=this.parent.tzModule.convert(e[o.endTime],n,this.parent.timezone)))):this.parent.timezone&&(t?(e[o.startTime]=this.parent.tzModule.remove(e[o.startTime],this.parent.timezone),e[o.endTime]=this.parent.tzModule.remove(e[o.endTime],this.parent.timezone)):(e[o.startTime]=this.parent.tzModule.add(e[o.startTime],this.parent.timezone),e[o.endTime]=this.parent.tzModule.add(e[o.endTime],this.parent.timezone)))),e},SHe.prototype.filterBlockEvents=function(e){for(var t,i=this.parent.eventFields,n=e[i.startTime],o=e[i.endTime],e=(0<this.parent.activeViewOptions.group.resources.length&&(e=this.getGroupIndexFromEvent(e),t=this.parent.resourceBase.lastResourceLevel[parseInt(e.toString(),10)]),Pe([],this.parent.blockProcessed,null,!0)),r=0,s=e;r<s.length;r++){var a=s[r];a[i.isAllDay]&&a[i.endTime].getTime()>gOe(new Date(a[i.endTime].getTime())).getTime()&&(a[i.startTime]=gOe(a[i.startTime]),a[i.endTime]=yOe(gOe(a[i.endTime]),1))}return this.filterEvents(n,o,e,t)},SHe.prototype.filterEvents=function(e,t,i,n){void 0===i&&(i=this.parent.eventsProcessed);e=this.parent.dataModule.getStartEndQuery(e,t),t=new me({json:i}).executeLocal((new ya).where(e));return n&&(t=this.filterEventsByResource(n,t)),this.sortByTime(t)},SHe.prototype.filterEventsByRange=function(e,t,i){var n=this,o=[],o=t&&i?this.filterEvents(t,i,e):t&&!i?e.filter(function(e){return e[n.parent.eventFields.startTime]>=t}):!t&&i?e.filter(function(e){return e[n.parent.eventFields.endTime]<=i}):e;return this.sortByTime(o)},SHe.prototype.filterEventsByResource=function(e,t){void 0===t&&(t=this.parent.eventsProcessed);for(var i={},n=this.parent.resourceBase.resourceCollection,o=0;o<n.length;o++)i[n[parseInt(o.toString(),10)].field]=e.groupOrder[parseInt(o.toString(),10)];var r=Object.keys(i);return t.filter(function(t){return r.every(function(e){return t[""+e]instanceof Array?-1<t[""+e].indexOf(i[""+e]):t[""+e]===i[""+e]})})},SHe.prototype.sortByTime=function(e){var i;return!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer?(i=this.parent.eventFields,e.sort(function(e,t){e=e[i.startTime],t=t[i.startTime];return e.getTime()-t.getTime()})):e=this.customSorting(e),e},SHe.prototype.sortByDateTime=function(e){var o;return!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer?(o=this.parent.eventFields,e.sort(function(e,t){var i=e[o.startTime],n=t[o.startTime],e=e[o.endTime],t=t[o.endTime],e=e.getTime()-i.getTime(),t=t.getTime()-n.getTime();return i.getTime()-n.getTime()||t-e})):e=this.customSorting(e),e},SHe.prototype.customSorting=function(e){if("function"==typeof this.parent.eventSettings.sortComparer)return this.parent.eventSettings.sortComparer.call(this.parent,e);if("string"==typeof this.parent.eventSettings.sortComparer){var t=this.parent.eventSettings.sortComparer.split("."),i=void 0;if(i=je(window)?i:window[t[t.length-1]])return i(e)}return e},SHe.prototype.getSmallestMissingNumber=function(e){for(var t=Math.max.apply(Math,e),i=0;i<t;i++)if(-1===e.indexOf(i))return i;return t+1},SHe.prototype.splitEventByDay=function(e){var t=this.parent.eventFields,i=[],n=e[t.startTime],o=e[t.endTime];if(gOe(new Date(n.getTime()))<gOe(new Date(o.getTime())))for(var r=new Date(n.getTime()),s=yOe(gOe(new Date(n.getTime())),1),a=0===o.getHours()&&0===o.getMinutes()?o:yOe(o,1),l=1,h=SOe(n.getTime(),a.getTime());s<=o&&r.getTime()!==s.getTime();){var d=Pe({},e);d[t.startTime]=r,d[t.endTime]=s,d.data={index:l,count:h},d.Guid=this.generateGuid(),d.isSpanned=!0,i.push(d),r=s,s=gOe(new Date(r.getTime())).getTime()===gOe(new Date(o.getTime())).getTime()&&s.getTime()!==o.getTime()?(s=new Date(r.getTime()),new Date(s.setHours(o.getHours(),o.getMinutes(),o.getSeconds()))):yOe(gOe(new Date(r.getTime())),1),l++}else i.push(e);return i},SHe.prototype.splitEvent=function(e,t){var i=this.parent.eventFields,n=gOe(e[i.startTime]).getTime(),o=gOe(e[i.endTime]).getTime(),r=n,s=o=mOe(e[i.endTime])<=0?(d=yOe(gOe(e[i.endTime]),-1).getTime())<n?n:d:o,a=[];if(n!==o){n<t[0].getTime()&&(n=t[0].getTime()),o>t[t.length-1].getTime()&&(o=t[t.length-1].getTime());for(var l=n,h=0;h<this.slots.length;h++){var d,p=this.slots[parseInt(h.toString(),10)];if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView||this.parent.activeViewOptions.group.byDate||this.parent.activeViewOptions.showWeekend){for(var c=[],u=0,g=p;u<g.length;u++){var m=g[u];c.push(new Date(m))}var f=this.getRenderedDates(c);if(!je(f)&&0<f.length)for(var p=[],y=0,v=f;y<v.length;y++){var b=v[y];p.push(b.getTime())}}"number"==typeof p&&(d=p,(p=[]).push(d));f=p[0];if(o<(l=l<=f&&f<=o?f:l)||o<f)break;if(!this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.showWeekend&&"WorkWeek"!==this.parent.currentView&&"TimelineWorkWeek"!==this.parent.currentView){var w=p.indexOf(l);if(-1!==w){var C=p.indexOf(o),S=-1!==C,A=(C=S?C:p.length-1)-w+1,x=p[parseInt(w.toString(),10)]!==r,I=p[parseInt(C.toString(),10)]!==s;if(a.push(this.cloneEventObject(e,p[parseInt(w.toString(),10)],p[parseInt(C.toString(),10)],A,x,I)),S)break}}else if(this.dateInRange(l,p[0],p[p.length-1])){for(var T=[],E=0;E<p.length;E++)this.dateInRange(p[parseInt(E.toString(),10)],r,s)&&T.push(p[parseInt(E.toString(),10)]);if(0<T.length)if(this.parent.activeViewOptions.group.byDate)for(var D=0,M=T;D<M.length;D++){var k=M[D];a.push(this.cloneEventObject(e,k,k,1,k!==r,k!==s))}else{x=T[0]!==r,I=T[T.length-1]!==s;a.push(this.cloneEventObject(e,T[0],T[T.length-1],T.length,x,I))}}}}else a.push(this.cloneEventObject(e,n,o,1,!1,!1));return a},SHe.prototype.cloneEventObject=function(e,t,i,n,o,r){var s=this.parent.eventFields,a=Pe({},e,null,!0),n={count:n,isLeft:o,isRight:r};return n[s.startTime]=e[s.startTime],n[s.endTime]=e[s.endTime],a.data=n,a[s.startTime]=new Date(t),a[s.endTime]=new Date(i),a},SHe.prototype.dateInRange=function(e,t,i){return t<=e&&e<=i},SHe.prototype.getSelectedEventElements=function(t){if(this.removeSelectedAppointmentClass(),this.parent.selectedElements.length<=0)this.parent.selectedElements.push(t);else if(this.parent.selectedElements.filter(function(e){return e.getAttribute("data-guid")===t.getAttribute("data-guid")}).length<=0)for(var e='div[data-guid="'+t.getAttribute("data-guid")+'"]',i=0,n=[].slice.call(this.parent.element.querySelectorAll(e));i<n.length;i++){var o=n[i];this.parent.selectedElements.push(o)}else{e=this.parent.selectedElements.filter(function(e){return e.getAttribute("data-guid")!==t.getAttribute("data-guid")});this.parent.selectedElements=e}return t&&0<this.parent.selectedElements.length&&this.addSelectedAppointments(this.parent.selectedElements,!1),this.parent.selectedElements},SHe.prototype.getSelectedEvents=function(){var e=this,i=[],n=[];return[].slice.call(this.parent.element.querySelectorAll("."+XNe)).filter(function(t){0===i.filter(function(e){return e.Guid===t.getAttribute("data-guid")}).length&&i.push(e.getEventByGuid(t.getAttribute("data-guid"))),n.push(t)}),{event:1<i.length?i:i[0],element:1<n.length?n:n[0]}},SHe.prototype.removeSelectedAppointmentClass=function(){var e=this.getSelectedAppointments();q(e,XNe),"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||q(e,s2e)},SHe.prototype.addSelectedAppointments=function(e,t){"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass(),U(e,XNe),0<e.length&&!t&&e[e.length-1].focus()},SHe.prototype.getSelectedAppointments=function(){return[].slice.call(this.parent.element.querySelectorAll("."+XNe+",."+qNe+":focus"))},SHe.prototype.focusElement=function(e){var t,i;this.parent.eventWindow.dialogObject&&this.parent.eventWindow.dialogObject.visible||(i=document.activeElement,0<(t=this.parent.getSelectedCells()).length&&(i&&(this.parent.element.contains(i)||-1!==t.indexOf(i))||e)?this.parent.keyboardInteractionModule&&(i=!je(this.parent.activeCellsData)&&this.parent.activeCellsData.element||t[t.length-1],this.parent.keyboardInteractionModule.selectCells(i instanceof Array,i)):0<(e=this.getSelectedAppointments()).length&&(this.parent.activeEventData&&this.parent.activeEventData.element&&-1<e.indexOf(this.parent.activeEventData.element)?this.parent.activeEventData.element:e[e.length-1]).focus())},SHe.prototype.selectWorkCellByTime=function(e){if("Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView&&0<e.length){var e=e[e.length-1],t=e[this.parent.eventFields.startTime],i=void 0,n=this.isAllDayAppointment(e),i="Month"===this.parent.currentView||n||!this.parent.activeViewOptions.timeScale.enable?new Date(+t).setHours(0,0,0,0):this.findNearestSlot(t),t=void 0,t=n&&-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)?this.parent.getAllDayRow():this.parent.getContentTable(),n='[data-date="'+new Date(i).getTime()+'"]';if(!je(this.parent.activeViewOptions.group.resources)&&0<this.parent.activeViewOptions.group.resources.length&&(n+='[data-group-index="'+this.getGroupIndexFromEvent(e)+'"]'),i=t.querySelector(n))this.parent.activeCellsData=this.parent.getCellDetails(i),this.parent.keyboardInteractionModule&&this.parent.keyboardInteractionModule.selectCells(!1,i)}return i},SHe.prototype.findNearestSlot=function(n){var i=6e4*this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,e=Math.round(iOe/i),o=new Date(n);o.setHours(0,0,0,0);e=Array.from({length:e},function(e,t){return new Date(o.getTime()+t*i)}).reduce(function(e,t){var i=Math.abs(n.getTime()-t.getTime());return!e||i<Math.abs(n.getTime()-e.getTime())?t:e},null);return 1e3*Math.trunc(e.getTime()/1e3)},SHe.prototype.getGroupIndexFromEvent=function(e){for(var i,t,n,o,r=this.parent.resourceBase.resourceCollection.length-1;0<=r;r--)if(!je(e[this.parent.resourceBase.resourceCollection[parseInt(r.toString(),10)].field])){t=this.parent.resourceBase.resourceCollection[parseInt(r.toString(),10)],i=r,n=t.name,o=t.field;break}je(n)&&je(i)&&(n=this.parent.resourceCollection.slice(-1)[0].name,i=this.parent.resourceCollection.length-1,o=this.parent.resourceCollection.slice(-1)[0].field,t=this.parent.resourceCollection.filter(function(e,t){return e.name===n?(i=t,e):null})[0]);var s,a=e[""+o]instanceof Array?e[""+o][0]:e[""+o];return 0<i?(s=this.parent.resourceCollection[i-1].field,this.parent.resourceBase.getIndexFromResourceId(a,n,t,e,s)):this.parent.resourceBase.getIndexFromResourceId(a,n,t)},SHe.prototype.isAllDayAppointment=function(e){var t=this.parent.eventFields,i=e[t.isAllDay],e=1<=(BOe(e[t.endTime])-BOe(e[t.startTime]))/iOe;return!!(i||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement&&e)},SHe.prototype.addEventListener=function(){this.parent.on($Re,this.appointmentBorderRemove,this)},SHe.prototype.removeEventListener=function(){this.parent.off($Re,this.appointmentBorderRemove)},SHe.prototype.appointmentBorderRemove=function(e){e=e.event.target;z(e,"."+qNe)?"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass():z(e,"."+$Oe)||this.parent.uiStateValues.isTapHold&&z(e,"."+JOe+",."+YOe)||(this.parent.uiStateValues.isTapHold=!1,this.removeSelectedAppointmentClass(),this.parent.selectedElements=[])},SHe.prototype.wireAppointmentEvents=function(e,t,i){void 0===i&&(i=!1);t=!je(t)&&t[this.parent.eventFields.isReadonly];E.add(e,"click",this.eventClick,this),this.parent.isAdaptive||this.parent.activeViewOptions.readonly||t||(E.add(e,"touchend",this.eventTouchClick,this),E.add(e,"dblclick",this.eventDoubleClick,this)),this.parent.activeViewOptions.readonly||t||i||(this.parent.resizeModule&&this.parent.resizeModule.wireResizeEvent(e),this.parent.dragAndDropModule&&this.parent.dragAndDropModule.wireDragEvent(e))},SHe.prototype.eventTouchClick=function(e){var t=this;this.parent.uiStateValues.isTouchScroll||this.parent.uiStateValues.isTapHold||this.parent.uiStateValues.action?this.parent.uiStateValues.isTouchScroll=this.parent.uiStateValues.isTapHold=!1:(setTimeout(function(){return t.isDoubleTapped=!1},250),e.preventDefault(),this.isDoubleTapped?this.eventDoubleClick(e):this.isDoubleTapped||(this.isDoubleTapped=!0,this.eventClick(e)))},SHe.prototype.renderResizeHandler=function(e,t,i){if(this.parent.resizeModule&&this.parent.allowResizing&&!this.parent.activeViewOptions.readonly&&!i)for(var n=0,o=Object.keys(t);n<o.length;n++){var r=o[n],s=Q("div",{className:x2e});switch(r){case"isLeft":t.isLeft||(s.appendChild(Q("div",{className:"e-left-right-resize"})),U([s],this.parent.enableRtl?E2e:T2e),lt([s],e));break;case"isRight":t.isRight||(s.appendChild(Q("div",{className:"e-left-right-resize"})),U([s],this.parent.enableRtl?T2e:E2e),ht([s],e));break;case"isTop":t.isTop||(s.appendChild(Q("div",{className:"e-top-bottom-resize"})),U([s],D2e),lt([s],e));break;case"isBottom":t.isBottom||(s.appendChild(Q("div",{className:"e-top-bottom-resize"})),U([s],M2e),ht([s],e))}}},SHe.prototype.eventClick=function(e){var t,i=this,n=e.target;n.classList.contains(A2e)||n.classList.contains(I2e)||n.classList.contains(h_e)||((e.ctrlKey||e.metaKey)&&1===e.which&&this.parent.keyboardInteractionModule?(this.parent.quickPopup.quickPopup.hide(),this.parent.selectedElements=[].slice.call(this.parent.element.querySelectorAll("."+XNe)),n=z(e.target,"."+qNe),this.getSelectedEventElements(n),this.activeEventData(e,!1),n={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"},this.parent.trigger(bRe,n),t=Pe(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(IRe,t)):(this.removeSelectedAppointmentClass(),this.activeEventData(e,!0),n={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"},this.parent.trigger(bRe,n),t=Pe(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(IRe,t,function(e){var t;e.cancel?(i.removeSelectedAppointmentClass(),i.parent.selectedElements=[],i.parent.quickPopup&&i.parent.quickPopup.quickPopupHide()):("Agenda"!==i.parent.currentView&&"MonthAgenda"!==i.parent.currentView||U([i.parent.activeEventData.element],s2e),i.parent.allowInline?(t={data:e.event,element:e.element,type:"Event"},i.parent.notify(FRe,t)):i.parent.notify(IRe,e))})))},SHe.prototype.eventDoubleClick=function(e){var t=this;this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),"touchend"===e.type&&this.activeEventData(e,!0),this.removeSelectedAppointmentClass(),this.parent.selectedElements=[],this.parent.activeEventData.element.classList.contains(d_e)||this.parent.activeEventData.element.querySelector("."+h_e)||(e=Pe(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(TRe,e,function(e){e.cancel||(!je(t.parent.activeEventData.event)&&je(t.parent.activeEventData.event[t.parent.eventFields.recurrenceID])?t.parent.eventWindow.openEditor(t.parent.activeEventData.event,"Save"):(t.parent.currentAction="EditOccurrence",t.parent.quickPopup.openRecurrenceAlert()))}))},SHe.prototype.getEventByGuid=function(t){return this.parent.eventsProcessed.filter(function(e){return e.Guid===t})[0]},SHe.prototype.getEventById=function(t){var i=this;return this.parent.eventsData.filter(function(e){return e[i.parent.eventFields.id]===t})[0]},SHe.prototype.generateGuid=function(){return"xyxxxxyx-xxxy-yxxx-xyxx-xxyxxxxyyxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},SHe.prototype.getEventIDType=function(){return 0!==this.parent.eventsData.length?typeof this.parent.eventsData[0][this.parent.eventFields.id]:0!==this.parent.blockData.length?typeof this.parent.blockData[0][this.parent.eventFields.id]:"string"},SHe.prototype.getEventMaxID=function(e){var t,i,n=this;return this.parent.eventsData.length<1&&this.parent.blockData.length<1?1:("string"===(t=this.getEventIDType())&&(i=this.generateGuid()),"number"===t&&(t=this.parent.eventsData.concat(this.parent.blockData).map(function(e){return e[n.parent.eventFields.id]}).reduce(function(e,t){return Math.max(e,t)}),i=(t=je(e)?t:t+e)+1),i)},SHe.prototype.activeEventData=function(e,t){var i=this,e=z(e.target,"."+qNe),n=e.getAttribute("data-guid"),o=(t&&(this.addSelectedAppointments([].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+n+'"]')),!0),e.focus()),this.getEventByGuid(n));o&&o.isSpanned&&(o=this.parent.eventsData.filter(function(e){return e[i.parent.eventFields.id]===o[i.parent.eventFields.id]})[0]),this.parent.activeEventData={event:o,element:e}},SHe.prototype.generateOccurrence=function(t,e,i){for(var n,o=this,r=t[this.parent.eventFields.startTime],s=t[this.parent.eventFields.endTime],a=t[this.parent.eventFields.recurrenceRule],l=s.getTimezoneOffset()-r.getTimezoneOffset(),h=s.getTime()-r.getTime()-6e4*l,s=(e=new Date((e||this.parent.activeView.startDate()).getTime()-h),t[this.parent.eventFields.recurrenceException]),l=("Agenda"!==this.parent.currentView&&i&&(n=fOe(e,this.parent.activeView.endDate())+1),this.parent.timezone||this.parent.tzModule.getLocalTimezoneName()),i=this.parent.activeViewOptions.firstDayOfWeek,d=this.parent.calendarMode,r=R_e(r=t[this.parent.eventFields.recurrenceRule]&&this.isDayBasedRecurrence(t)&&this.parent.timezone&&t[this.parent.eventFields.startTimezone]&&t[this.parent.eventFields.endTimezone]?this.parent.tzModule.convert(t[this.parent.eventFields.startTime],this.parent.timezone,t[this.parent.eventFields.startTimezone]):r,a,s,i,n,e,d,l),p=("Agenda"===this.parent.currentView&&-1===a.indexOf("COUNT")&&-1===a.indexOf("UNTIL")&&(je(t.generatedDates)?t.generatedDates={start:new Date(r[0]),end:new Date(r[r.length-1])}:(r[0]<t.generatedDates.start.getTime()&&(t.generatedDates.start=new Date(r[0])),r[r.length-1]>t.generatedDates.end.getTime()&&(t.generatedDates.end=new Date(r[r.length-1])))),!1),s=[],c=(t[this.parent.eventFields.recurrenceRule]&&this.isDayBasedRecurrence(t)&&this.parent.timezone&&t[this.parent.eventFields.startTimezone]&&t[this.parent.eventFields.endTimezone]&&(p=!0,s.push.apply(s,r.map(function(e){return o.parent.tzModule.convert(new Date(e),t[o.parent.eventFields.startTimezone],o.parent.timezone).getTime()}))),[]),u=0,g=s=0<s.length?s:r;u<g.length;u++){var m=g[u],f=Pe({},t,null,!0),m=p?m:this.getDSTAdjustedTime(m,f);f[this.parent.eventFields.startTime]=new Date(m),f[this.parent.eventFields.endTime]=new Date(new Date(m).setMilliseconds(h)),f[this.parent.eventFields.recurrenceID]=f[this.parent.eventFields.id],delete f[this.parent.eventFields.recurrenceException],delete f[this.parent.eventFields.followingID],f.Guid=this.generateGuid(),c.push(f)}return c},SHe.prototype.isDayBasedRecurrence=function(e){return e[this.parent.eventFields.recurrenceRule].includes("BYMONTHDAY")||e[this.parent.eventFields.recurrenceRule].includes("BYDAY")},SHe.prototype.getDSTAdjustedTime=function(e,t){var i,n=e;return this.parent.timezone&&(t[this.parent.eventFields.startTimezone]||t[this.parent.eventFields.endTimezone])&&(i=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),t[this.parent.eventFields.startTimezone]),t=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),this.parent.timezone),n=new Date(e).getTime()-6e4*(i-t)),n},SHe.prototype.getDSTDiff=function(e,t,i){return this.parent.tzModule.offset(new Date(e),i)-this.parent.tzModule.offset(new Date(t),i)},SHe.prototype.getParentEvent=function(e,t){var i,n,o;for(void 0===t&&(t=!1);(e=this.getFollowingEvent(e))&&(i=Pe({},e,null,!0)),e&&t;);return t&&i&&(o=(n=this.getEventCollections(i)).follow.slice(-1)[0],o=0<n.occurrence.length&&!i[this.parent.eventFields.recurrenceException]?n.occurrence.slice(-1)[0]:o)&&(i[this.parent.eventFields.recurrenceRule]=o[this.parent.eventFields.recurrenceRule]),i},SHe.prototype.getEventCollections=function(e,t){for(var i=[],n=[],o=e;(o=this.getFollowingEvent(o,!0))&&i.push(o),n=n.concat(this.getOccurrenceEvent(o||e)),o;);var r;return t?(r=this.parent.eventFields,{follow:i.filter(function(e){return e[r.startTime]>=t[r.startTime]}),occurrence:n.filter(function(e){return e[r.startTime]>=t[r.startTime]})}):{follow:i,occurrence:n}},SHe.prototype.getFollowingEvent=function(e,t){var i=this.parent.eventFields,n=t?e[i.id]:e[i.recurrenceID]||e[i.followingID];return this.parent.eventsData.filter(function(e){return e[t?i.followingID:i.id]===n}).shift()},SHe.prototype.isFollowingEvent=function(e,t){e=e[this.parent.eventFields.startTime],t=t[this.parent.eventFields.startTime];return e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()&&e.getSeconds()===t.getSeconds()},SHe.prototype.getOccurrenceEvent=function(t,e,i){void 0===i&&(i=!1);var n=(e=void 0===e?!1:e)?"Guid":i?this.parent.eventFields.followingID:this.parent.eventFields.recurrenceID,o=e?"Guid":this.parent.eventFields.id;return(e?this.parent.eventsProcessed:this.parent.eventsData).filter(function(e){return e[""+n]===t[""+o]})},SHe.prototype.getOccurrencesByID=function(t){for(var i=this.parent.eventFields,e=[],n=0,o=this.parent.eventsData.filter(function(e){return e[i.id]===t});n<o.length;n++){var r=o[n];je(r[i.recurrenceRule])||(e=e.concat(this.generateOccurrence(r)))}return e},SHe.prototype.getOccurrencesByRange=function(t,i){for(var n=this.parent.eventFields,e=[],o=0,r=this.parent.eventsData;o<r.length;o++){var s=r[o];je(s[n.recurrenceRule])||(e=e.concat(this.generateOccurrence(s)))}return e.filter(function(e){return e[n.startTime]>=t&&e[n.endTime]<=i&&!je(e[n.recurrenceID])})},SHe.prototype.getDeletedOccurrences=function(r){var s=this.parent.eventFields,a=[],l="string"==typeof r||"number"==typeof r?this.parent.eventsData.filter(function(e){return e[s.id]===r})[0]:Pe({},r,null,!0);if(l[s.recurrenceException])for(var h=l[s.recurrenceException].split(","),d=this,e=0,t=h.length;e<t;e++)!function(t){var e,i,n,o;0===d.parent.eventsData.filter(function(e){return e[s.recurrenceID]===l[s.id]&&e[s.recurrenceException]===h[parseInt(t.toString(),10)]}).length&&(i=O_e(h[parseInt(t.toString(),10)]),(e=Pe({},r,null,!0))[s.recurrenceID]=l[s.id],delete e[s.followingID],e[s.recurrenceException]=h[parseInt(t.toString(),10)],i=new Date(i.getTime()),n=l[s.endTime].getTime()-l[s.startTime].getTime(),(o=new Date(i.getTime())).setMilliseconds(n),e[s.startTime]=new Date(i.getTime()),e[s.endTime]=new Date(o.getTime()),a.push(e))}(e);return a},SHe.prototype.applyResourceColor=function(e,t,i,n,o){this.parent.resourceBase&&(t=this.parent.resourceBase.getResourceColor(t,n))&&(e.style[i]=je(o)?t:(n=o,e=(e=t).replace("#",""),"rgba("+parseInt(e.substring(0,e.length/3),16)+", "+parseInt(e.substring(e.length/3,2*e.length/3),16)+", "+parseInt(e.substring(2*e.length/3,3*e.length/3),16)+", "+n+")"))},SHe.prototype.createBlockAppointmentElement=function(e,t,i){var n,o=e[this.parent.eventFields.subject]||this.parent.eventSettings.fields.subject.default,r=Q("div",{className:GNe,attrs:{"data-id":"Appointment_"+e[this.parent.eventFields.id],"aria-disabled":"true"}});return ht(je(this.parent.activeViewOptions.eventTemplate)?(n=Q("div",{className:CVe}),this.parent.sanitize(o,n),[n]):(o=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",n=i&&-1===this.parent.currentView.indexOf("Year")?this.parent.getEventTemplateName(t):"eventTemplate",this.parent.getAppointmentTemplate()(e,this.parent,n,o,!1,void 0,void 0,this.parent.root)),r),this.setWrapperAttributes(r,t),r},SHe.prototype.setWrapperAttributes=function(e,t){je(this.cssClass)||U([e],this.cssClass),0<this.parent.activeViewOptions.group.resources.length&&e.setAttribute("data-group-index",t.toString())},SHe.prototype.getReadonlyAttribute=function(e){return(e[this.parent.eventFields.isReadonly]||this.parent.readonly).toString()},SHe.prototype.isBlockRange=function(e){for(var e=e instanceof Array?e:[e],t=!1,i=this.parent.eventFields,n=0,o=e;n<o.length;n++){var r=o[n],s=[];je(r[i.recurrenceRule])||!je(r[i.recurrenceID])&&r[i.id]!==r[i.recurrenceID]?s.push(r):s=this.generateOccurrence(r);for(var a=0,l=s;a<l.length;a++){var h=l[a];if(0<this.filterBlockEvents(h).length){t=!0;break}}}return this.parent.uiStateValues.isBlock=t},SHe.prototype.getFilterEventsList=function(e,t){return new me(e).executeLocal((new ya).where(t))},SHe.prototype.getSeriesEvents=function(e,t){for(var i,n,o=this.parent.eventFields,r=(t=je(t)?e[o.startTime]:t,[]),s=e[o.id],a=e[o.followingID],l="EditSeries"===this.parent.currentAction?"greaterthan":"greaterthanorequal";n=new ba(o.followingID,"equal",s).and(new ba(o.startTime,l,t)),a=je(i=(n=this.getFilterEventsList(this.parent.eventsData,n)).slice(-1)[0])||i[o.id]===a?null:(r.push(i),s=i[o.id],i[o.followingID]),1===n.length&&!je(i[o.followingID]););return r},SHe.prototype.getEditedOccurrences=function(e,t){for(var i=this.parent.eventFields,n=[],o=0,r=e;o<r.length;o++){var s=r[o],s=new ba(i.recurrenceID,"equal",s[i.id]).or(new ba(i.recurrenceID,"equal",s[i.followingID]).and(new ba(i.recurrenceID,"notequal",void 0)).and(new ba(i.recurrenceID,"notequal",null)));"EditFollowingEvents"!==this.parent.currentAction&&"DeleteFollowingEvents"!==this.parent.currentAction||(s=s.and(new ba(i.startTime,"greaterthanorequal",t))),s=this.getFilterEventsList(this.parent.eventsData,s),n=n.concat(s)}return n},SHe.prototype.getRenderedDates=function(t){var e,i=0,n=t.length,o=je(this.parent.maxDate)?new Date(2099,11,31):this.parent.maxDate,r=je(this.parent.minDate)?new Date(1900,0,1):this.parent.minDate;if(t[0]<r&&t[t.length-1]>o){for(var s=0;s<t.length;s++)gOe(t[parseInt(s.toString(),10)]).getTime()===gOe(new Date(r)).getTime()&&(i=s),gOe(t[parseInt(s.toString(),10)]).getTime()===gOe(new Date(o)).getTime()&&(n=s);e=t.filter(function(e){return e>=t[parseInt(i.toString(),10)]&&e<=t[parseInt(n.toString(),10)]})}return e},SHe.prototype.isValidEvent=function(e,t,i,n){var o=i.getTime()>n.startHour.getTime()&&t.getTime()<n.endHour.getTime(),e=n.startHour.getTime()<=t.getTime()&&e[this.parent.eventFields.startTime].getTime()>=n.startHour.getTime()&&e[this.parent.eventFields.endTime].getTime()<n.endHour.getTime()&&t.getTime()===i.getTime();return o||e},SHe.prototype.allDayExpandScroll=function(e){var t=0;[].slice.call(this.parent.element.querySelectorAll("."+B2e)).forEach(function(e){[].slice.call(e.children).forEach(function(e){e.style.top=t+"px"}),t+=e.offsetHeight}),t=e.offsetHeight-t,this.parent.element.querySelector("."+YOe).style.height=t/12+"em",(this.parent.uiStateValues.expand?U:q)([e],c_e)},SHe.prototype.updateEventMinimumDuration=function(e,t,i){var n;return(t.getTime()<i.getTime()||t.getTime()===i.getTime()&&e.startHour.getTime()<i.getTime()&&e.endHour.getTime()>t.getTime()&&-1===this.parent.currentView.indexOf("Timeline"))&&(BOe(i)-BOe(t))/6e4<this.parent.eventSettings.minimumEventDuration&&((n=new Date(t)).setMinutes(n.getMinutes()+this.parent.eventSettings.minimumEventDuration),(i=n).getTime()>e.endHour.getTime())&&((n=new Date(e.endHour.getTime())).setMinutes(n.getMinutes()-this.parent.eventSettings.minimumEventDuration),t=n,i=e.endHour),{startDate:t,endDate:i}},SHe.prototype.createEventWrapper=function(e,t){void 0===e&&(e=""),void 0===t&&(t=0);for(var i=Q("tr"),n=this.parent.activeView.colLevels.slice(-1)[0],o=this.parent.isReact&&this.parent.activeViewOptions.eventTemplate?" "+RNe:"",r=0,s=n.length;r<s;r++){var a=n[parseInt(r.toString(),10)],l=Q("td",{className:"allDay"===e?F2e+o:"timeIndicator"===e?FNe:ONe+o,attrs:{"data-date":a.date.getTime().toString()}});je(a.groupIndex)||l.setAttribute("data-group-index",a.groupIndex.toString()),""===e&&(a=Q("div",{id:LNe+"-"+t.toString(),className:LNe}),l.appendChild(a)),i.appendChild(l),t+=1}return i},SHe.prototype.getPageCoordinates=function(e){var t;return je(e)?e:(t=e.event)&&t.changedTouches?t.changedTouches[0]:e.changedTouches?e.changedTouches[0]:t||e},SHe.prototype.renderSpannedIcon=function(e,t){var i,n=Q("div",{className:f2e+" "+WOe});t.isLeft&&(U([i=n.cloneNode()],y2e),lt([i],e)),t.isRight&&(U([i=n.cloneNode()],v2e),ht([i],e)),t.isTop&&(U([i=n.cloneNode()],"e-up-icon"),lt([i],e)),t.isBottom&&(U([i=n.cloneNode()],"e-down-icon"),ht([i],e))},SHe.prototype.addCellHeight=function(e,t,i,n,o,r){if(void 0===r&&(r=!0),this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.rowAutoHeight){for(var s=[].slice.call(this.parent.element.querySelectorAll(e)),a=this.parent.showWeekNumber?[].slice.call(this.parent.element.querySelectorAll("."+zNe+" tbody tr")):[],l=0,h=s;l<h.length;l++){var d=h[l],p=this.parent.activeViewOptions.maxEventsPerRow*(t+("Month"===this.parent.currentView?i:2))+n+o;0<a.length&&gt(a[s.indexOf(d)].firstElementChild,{height:p+"px"}),gt(d.firstElementChild,{height:p+"px"})}this.parent.enablePersistence||this.parent.activeViewOptions.allowVirtualScrolling||!r||this.parent.notify(YRe,{})}},SHe.prototype.unWireEvents=function(){for(var e=0,t=[].slice.call(this.parent.element.querySelectorAll("."+qNe));e<t.length;e++){var i=t[e];E.clearEvents(i)}},SHe.prototype.destroy=function(){this.unWireEvents(),this.parent=null};var CHe=SHe;function SHe(e){this.slots=[],this.processedData=[],this.isDoubleTapped=!1,this.parent=e}AHe=function(e,t){return(AHe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}AHe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(THe,xHe=CHe),THe.prototype.renderAppointments=function(){var t=this;if(!je(this.parent)){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();for(var e=[].slice.call(this.parent.element.querySelectorAll("."+GNe+",."+qNe+",."+O2e)),i=!(!this.parent.crudModule||!this.parent.crudModule.crudObj.isCrudAction),n=function(e){t.parent.isReact&&!je(t.parent.activeViewOptions.eventTemplate)&&(e=z(e,"."+ONe+",."+F2e))&&!e.classList.contains(RNe)&&U([e],RNe)},o=0,r=e;o<r.length;o++){var s=r[o];if(!i||s.classList.contains(L2e)||s.classList.contains(O2e))n(s),ue(s);else for(var a=parseInt(s.getAttribute("data-group-index"),10),l=0,h=this.parent.crudModule.crudObj.sourceEvent.length;l<h;l++)a!==this.parent.crudModule.crudObj.sourceEvent[parseInt(l.toString(),10)].groupIndex&&a!==this.parent.crudModule.crudObj.targetEvent[parseInt(l.toString(),10)].groupIndex||(n(s),ue(s))}this.element.querySelector("."+JOe)&&(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell(),this.allDayElement=[].slice.call(this.element.querySelectorAll("."+YOe)),this.setAllDayRowHeight(0),0===this.parent.eventsProcessed.length&&0===this.parent.blockProcessed.length||(e=this.element.querySelector("."+N2e),E.remove(e,"click",this.rowExpandCollapse),E.add(e,"click",this.rowExpandCollapse,this),this.renderedEvents=[],this.renderedAllDayEvents=[],this.initializeValues(),this.processBlockEvents(),this.renderEvents("normalEvents"),0<this.allDayEvents.length&&(this.allDayEvents=this.allDayEvents.filter(function(e,t,i){return t===i.map(function(e){return e.Guid}).indexOf(e.Guid)}),q(this.allDayElement,QVe),this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),this.renderEvents("allDayEvents"),this.animation.animate(this.allDayElement[0])),this.parent.notify(YRe,{}),U(this.allDayElement,QVe),i&&(this.parent.crudModule.crudObj.isCrudAction=!1),this.parent.renderTemplates(function(){t.parent&&t.parent.isReact&&t.parent.activeViewOptions.eventTemplate&&q([].slice.call(t.parent.element.querySelectorAll("."+RNe)),RNe)})))}},THe.prototype.initializeValues=function(){if(this.resources=0<this.parent.activeViewOptions.group.resources.length?this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.lastResourceLevel:[],0<this.resources.length&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.virtualScrollModule&&(this.resources=this.parent.resourceBase.renderedResources),this.cellHeight=parseFloat(this.parent.getElementHeight(this.parent.element.querySelector(".e-content-wrap tbody tr")).toFixed(2)),this.dateRender[0]=this.parent.activeView.renderDates,0<this.parent.activeViewOptions.group.resources.length)for(var e=0,t=this.resources.length;e<t;e++)this.dateRender[parseInt(e.toString(),10)]=this.resources[parseInt(e.toString(),10)].renderDates},THe.prototype.getHeight=function(e,t){t=(BOe(t)-BOe(e))/6e4*(this.cellHeight*this.slotCount)/this.interval;return t<=0?this.cellHeight:t},THe.prototype.appendEvent=function(e,t,i,n){var o=this.element.querySelector("."+LNe+'[id="'+LNe+"-"+i+'"]'),i=(this.parent.enableRtl?gt(t,{right:n}):gt(t,{left:n}),t.classList.contains(GNe)?"blockEvent":"event"),n={data:Pe({},e,null,!0),element:t,cancel:!1,type:i};this.parent.trigger(ERe,n,function(e){e.cancel||o.appendChild(t)})},THe.prototype.processBlockEvents=function(){for(var e=this.getResourceList(),t=this.getStartCount(),i=0,n=e;i<n.length;i++)for(var o=n[i],r=this.dateRender[parseInt(o.toString(),10)],s=0,a=r.length;s<a;s++){for(var l=new Date(r[parseInt(s.toString(),10)].getTime()),h=gOe(yOe(r[parseInt(s.toString(),10)],1)),d=0,p=this.filterEvents(l,h,this.parent.blockProcessed,this.resources[parseInt(o.toString(),10)]);d<p.length;d++){var c=p[d];this.parent.resourceBase&&this.setValues(c,o),this.renderBlockEvents(c,s,o,t),this.cssClass=null,this.groupOrder=null}t+=1}},THe.prototype.renderBlockEvents=function(e,t,i,n){var o,r=this.isSpannedEvent(e,t,i),s=r[this.fields.startTime],a=r[this.fields.endTime],l=wOe(gOe(new Date(this.dateRender[parseInt(i.toString(),10)][parseInt(t.toString(),10)].getTime())),this.startHour,this.endHour);s<=a&&this.isValidEvent(e,s,a,l)&&this.isWorkDayAvailable(i,s)&&(o=l=void 0,l=r[this.fields.isAllDay]?(o=T(this.parent.element.querySelector("."+i2e+" table").offsetHeight),T(0)):(o=T(this.getHeight(s,a)),T(this.getTopValue(s))),gt(r=this.createBlockAppointmentElement(e,i,this.isResourceEventTemplate),{width:"100%",height:o,top:l}),a=this.getDayIndex(t,i,n),this.appendEvent(e,r,a,"0px"))},THe.prototype.renderEvents=function(u){q(this.allDayElement,QVe);for(var g,m="allDayEvents"===u?this.sortByDateTime(this.allDayEvents):void 0,e=this.getResourceList(),f=this.getStartCount(),y="allDayEvents"===u?this.parent.getElementHeightFromClass(this.element.querySelector("."+F2e),qNe):0,v="allDayEvents"===u&&0<this.allDayElement.length?this.allDayElement[0].offsetTop:0,b=this,t=0,i=e;t<i.length;t++)!function(t){g=!0,b.parent.crudModule&&b.parent.crudModule.crudObj.isCrudAction&&"allDayEvents"!==u&&!b.parent.uiStateValues.isGroupAdaptive&&0===b.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===t}).length&&0===b.parent.crudModule.crudObj.targetEvent.filter(function(e){return e.groupIndex===t}).length&&(g=!1),b.slots=[];var e=b.dateRender[parseInt(t.toString(),10)],i=b.getRenderedDates(e)||e;b.slots.push(e.map(function(e){return+e}));for(var n=0,o=e.length;n<o&&e[parseInt(n.toString(),10)]<=i[i.length-1];n++){b.renderedEvents=[];var r=new Date(e[parseInt(n.toString(),10)].getTime()),s=gOe(yOe(e[parseInt(n.toString(),10)],1)),r=b.filterEvents(r,s,m,b.resources[parseInt(t.toString(),10)]);if(g)for(var a=0,l=r;a<l.length;a++){var h=l[a];if(b.parent.resourceBase&&b.setValues(h,t),"allDayEvents"===u)b.renderAllDayEvents(h,n,t,f,!1,v,y);else if(b.isAllDayAppointment(h))b.allDayEvents.push(Pe({},h,null,!0));else{if(b.parent.eventSettings.enableMaxHeight&&0<b.getOverlapIndex(h,n,!1,t))continue;b.renderNormalEvents(h,n,t,f)}b.cssClass=null,b.groupOrder=null}else for(var d=0,p=r;d<p.length;d++){var c=p[d];b.isAllDayAppointment(c)&&b.allDayEvents.push(Pe({},c,null,!0))}f+=1}}(i[t])},THe.prototype.getStartCount=function(){return this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.timeScale.enable?parseInt(this.element.querySelector("."+LNe).getAttribute("id").split("-").slice(-1)[0],10):0},THe.prototype.getDayIndex=function(e,t,i){var n=this;if(!this.parent.activeViewOptions.group.byDate)return i;if(this.parent.activeViewOptions.group.byDate&&!this.parent.activeViewOptions.group.hideNonWorkingDays)return i=this.parent.resourceBase.lastResourceLevel[0].renderDates.indexOf(this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)]),this.resources.length*i+t;for(var o=0,r=this.parent.activeView.colLevels[0],s=this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)].getTime(),a=[],l=0;l<r.length&&(a=this.parent.resourceBase.resourceDateTree[parseInt(l.toString(),10)],s!==r[parseInt(l.toString(),10)].date.getTime());l++)o+=r[parseInt(l.toString(),10)].colSpan;i=a.findIndex(function(e){return e.groupOrder.toString()===n.resources[parseInt(t.toString(),10)].groupOrder.toString()});return i<0?o:o+i},THe.prototype.setValues=function(e,t){0<this.parent.activeViewOptions.group.resources.length?(this.cssClass=this.resources[parseInt(t.toString(),10)].cssClass,this.groupOrder=this.resources[parseInt(t.toString(),10)].groupOrder):this.cssClass=this.parent.resourceBase.getCssClass(e)},THe.prototype.getResourceList=function(){return Array.apply(null,{length:0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.resources.length:1}).map(function(e,t){return t})},THe.prototype.createAppointmentElement=function(e,t,i,n){var o,r,s=this.parent.eventFields,a=e[s.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),l=Q("div",{className:qNe,attrs:{"data-id":"Appointment_"+e[s.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(e)}}),h=(e[this.fields.isReadonly]&&U([l],"e-read-only"),Q("div",{className:KNe})),d=(l.appendChild(h),0<this.parent.activeViewOptions.group.resources.length&&(d=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:n,l.setAttribute("data-group-index",d.toString())),i);return je(this.parent.activeViewOptions.eventTemplate)?(i=Q("div",{className:CVe}),this.parent.sanitize(a,i),t?e[s.isAllDay]?o=[i]:(o=[],a=Q("div",{className:$Ne+(this.parent.isAdaptive?" "+UOe:""),innerHTML:this.parent.getTimeString(e[s.startTime])}),r=Q("div",{className:$Ne+(this.parent.isAdaptive?" "+UOe:""),innerHTML:this.parent.getTimeString(e[s.endTime])}),U([i],"e-text-center"),d.isLeft||o.push(a),o.push(i),d.isRight||o.push(r)):(a=this.parent.getTimeString(e[s.startTime])+" - "+this.parent.getTimeString(e[s.endTime]),r=Q("div",{className:$Ne+(this.parent.isAdaptive?" "+UOe:""),innerHTML:a}),a=Q("div",{className:SVe}),this.parent.sanitize(e[s.location]||this.parent.eventSettings.fields.location.default||"",a),o=[i,r,a])):(i=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",r=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:n,a=this.isResourceEventTemplate?this.parent.getEventTemplateName(r):"eventTemplate",o=this.parent.getAppointmentTemplate()(e,this.parent,a,i,!1,void 0,void 0,this.parent.root)),ht(o,h),this.parent.isAdaptive||je(e[s.recurrenceRule])&&je(e[s.recurrenceID])||(n=e[s.id]===e[s.recurrenceID]?k2e:P2e,r=Q("div",{className:WOe+" "+n}),(t?h:l).appendChild(r)),this.parent.eventBase.renderSpannedIcon(t?h:l,d),je(this.cssClass)||U([l],this.cssClass),this.applyResourceColor(l,e,"backgroundColor",this.groupOrder),this.renderResizeHandler(l,d,e[this.fields.isReadonly]),l},THe.prototype.createMoreIndicator=function(e,t,i){var i=i+t,t=e[parseInt(i.toString(),10)];t.childElementCount<=0?(e=Q("div",{className:O2e,id:O2e+"-"+i.toString()}),i=Q("div",{className:H2e,attrs:{tabindex:"0","data-index":i.toString(),"data-count":"1"},innerHTML:"+1&nbsp;"+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))}),e.appendChild(i),t.appendChild(e),E.add(i,"click",this.rowExpandCollapse,this)):(e=t.querySelector("."+H2e),i=parseInt(e.getAttribute("data-count"),10)+1,e.setAttribute("data-count",i.toString()),e.innerHTML="+"+this.parent.globalize.formatNumber(i)+"&nbsp;"+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more")))},THe.prototype.isSpannedEvent=function(e,t,i){var n=gOe(this.dateRender[parseInt(i.toString(),10)][parseInt(t.toString(),10)]),i=this.getRenderedDates(this.dateRender[parseInt(i.toString(),10)])||[n],i=(0===i.filter(function(e){return e.getDay()===t}).length&&(n=gOe(i[0])),this.parent.eventFields),n=wOe(n,this.startHour,this.endHour),o=Pe({},e,null,!0),e=(o.isSpanned={isBottom:!1,isTop:!1,isSameDuration:o[i.startTime].getTime()===o[i.endTime].getTime()},e[i.startTime].getTime()<n.startHour.getTime()&&(o[i.startTime]=n.startHour,o.isSpanned.isTop=!0),e[i.endTime].getTime()>n.endHour.getTime()&&(o[i.endTime]=n.endHour,o.isSpanned.isBottom=!0),this.updateEventMinimumDuration(n,o[i.startTime],o[i.endTime]));return o[i.startTime]=e.startDate,o[i.endTime]=e.endDate,o},THe.prototype.isWorkDayAvailable=function(e,t){return!(this.parent.activeViewOptions.group.hideNonWorkingDays&&0<this.resources.length)||(e=this.resources[parseInt(e.toString(),10)].resourceData[this.resources[parseInt(e.toString(),10)].resource.workDaysField]||this.parent.activeViewOptions.workDays)&&0<=e.indexOf(t.getDay())},THe.prototype.renderAllDayEvents=function(n,t,e,i,o,r,s){var a,l,h,d,p,c,u=this,g=this.getRenderedDates(this.dateRender[parseInt(e.toString(),10)])||this.dateRender[parseInt(e.toString(),10)],m=(this.parent.activeViewOptions.group.byDate&&(this.slots[0]=[this.dateRender[parseInt(e.toString(),10)][parseInt(t.toString(),10)].getTime()],g=[this.dateRender[parseInt(e.toString(),10)][parseInt(t.toString(),10)]]),this.splitEvent(n,g)[0]),f=new Date(m[this.parent.eventFields.startTime].getTime()),y=new Date(m[this.parent.eventFields.endTime].getTime()),v=0,b=1,w=g[0].getTime()<=f.getTime()&&yOe(g.slice(-1)[0],1).getTime()>=f.getTime();f<=y&&w&&this.isWorkDayAvailable(e,f)&&(y=[],0===(y=this.renderedAllDayEvents[parseInt(e.toString(),10)]&&(y=this.renderedAllDayEvents[parseInt(e.toString(),10)].filter(function(e){return e.Guid===n.Guid}),this.parent.activeViewOptions.group.byDate)?y.filter(function(e){return e[u.parent.eventFields.startTime]>=g[parseInt(t.toString(),10)]&&e[u.parent.eventFields.endTime]<=yOe(new Date(+g[parseInt(t.toString(),10)]),1)}):y).length)&&(a=m.data.count,l=this.getOverlapIndex(m,t,!0,e),m.Index=l,this.allDayLevel=this.allDayLevel<l?l:this.allDayLevel,w=m.data.isRight?0:"Day"===this.parent.currentView?4:7,0<=a&&(v=100*a-(this.parent.activeViewOptions.allowOverlap?w:0)),je(this.renderedAllDayEvents[parseInt(e.toString(),10)])&&(this.renderedAllDayEvents[parseInt(e.toString(),10)]=[]),this.renderedAllDayEvents[parseInt(e.toString(),10)].push(Pe({},m,null,!0)),h=[].slice.call(this.element.querySelector("."+XOe).children),d=this.getDayIndex(t,e,i),p=this.element.querySelector("."+F2e+":nth-child("+(d+1)+")"),U([c=o?this.parent.inlineModule.createInlineAppointmentElement(n):this.createAppointmentElement(n,!0,m.data,e)],L2e),f=Pe({},m.data,null,!0),n.data=f,y={data:n,element:c,cancel:!1},this.parent.trigger(ERe,y,function(e){if(!e.cancel){if(p.appendChild(c),gt(c,{width:v+"%",top:T(b+=(0===l?r:r+l*s)+1)}),1<l){u.moreEvents.push(c);for(var t=0,i=a;t<i;t++)u.createMoreIndicator(h,t,d)}u.allDayElement[0].setAttribute("data-count",u.allDayLevel.toString());e=4+(!u.parent.uiStateValues.expand&&2<u.allDayLevel?3*s:(u.allDayLevel+1)*s);u.setAllDayRowHeight(e),u.addOrRemoveClass(),u.wireAppointmentEvents(c,n)}}))},THe.prototype.renderNormalEvents=function(e,t,i,n,o){var r=this.isSpannedEvent(e,t,i),s=r[this.fields.startTime],a=r[this.fields.endTime],l=0,h=wOe(gOe(new Date(this.dateRender[parseInt(i.toString(),10)][parseInt(t.toString(),10)].getTime())),this.startHour,this.endHour),d=this.isValidEvent(e,s,a,h);s.getTime()<this.parent.minDate.getTime()||a.getTime()>this.parent.maxDate.getTime()||s<=a&&d&&this.isWorkDayAvailable(i,s)&&(d=r.isSpanned.isSameDuration?this.cellHeight:this.getHeight(s,a),s.getTime()>=h.startHour.getTime()&&(l=this.getTopValue(s)),a=this.getOverlapIndex(r,t,!1,i),r.Index=a,this.overlapList.push(r),1<this.overlapList.length?(je(this.overlapEvents[parseInt(a.toString(),10)])&&(this.overlapEvents[parseInt(a.toString(),10)]=[]),this.overlapEvents[parseInt(a.toString(),10)].push(r)):(this.overlapEvents=[],this.overlapEvents.push([r])),h={index:a,left:"0%",width:this.getEventWidth(),day:n,dayIndex:t,record:r,resource:i},(s=this.adjustOverlapElements(h)).appWidth,je(this.renderedEvents[parseInt(i.toString(),10)])&&(this.renderedEvents[parseInt(i.toString(),10)]=[]),a=void this.renderedEvents[parseInt(i.toString(),10)].push(Pe({},r,null,!0)),gt(a=o?this.parent.inlineModule.createInlineAppointmentElement(e):this.createAppointmentElement(e,!1,r.isSpanned,i),{width:this.parent.eventSettings.enableMaxHeight||!this.parent.activeViewOptions.allowOverlap?"100%":s.appWidth,height:d+"px",top:l+"px"}),h=d-40-15*a.querySelectorAll("."+f2e).length,o=a.querySelector("."+CVe),!this.parent.isAdaptive&&o&&(o.style.maxHeight=T(h)),l=this.getDayIndex(t,i,n),(d={})[this.fields.startTime]=e[this.fields.startTime],d[this.fields.endTime]=e[this.fields.endTime],r.data=d,this.appendEvent(r,a,l,s.appLeft),this.wireAppointmentEvents(a,e))},THe.prototype.getEventWidth=function(){var e=(("Day"===this.parent.currentView?97:94)-this.overlapEvents.length)/this.overlapEvents.length;return(e<0?0:e)+"%"},THe.prototype.getEventLeft=function(e,t){e=(parseFloat(e)+1)*t;return(99<e?99:e)+"%"},THe.prototype.getStartEndHours=function(e){var t;return je(e)||""===e?null:(t=new Date(2e3,0,0,0),2===(e=e.split(":")).length&&t.setHours(parseInt(e[0],10),parseInt(e[1],10),0),t)},THe.prototype.getTopValue=function(e){var t=this.getStartEndHours(this.parent.activeViewOptions.startHour),e=60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes());return this.parent.activeViewOptions.timeScale.enable?e*this.cellHeight*this.slotCount/this.interval:0},THe.prototype.getOverlapIndex=function(t,e,i,o){var n,r=this,s=this.parent.eventFields,a=[],l=-1;if(this.overlapEvents=[],i)je(this.renderedAllDayEvents[parseInt(o.toString(),10)])||(n=gOe(new Date(this.dateRender[parseInt(o.toString(),10)][parseInt(e.toString(),10)].getTime())),a=this.renderedAllDayEvents[parseInt(o.toString(),10)].filter(function(e){return gOe(e[s.startTime]).getTime()<=n.getTime()&&gOe(e[s.endTime]).getTime()>=n.getTime()}),0<this.parent.activeViewOptions.group.resources.length&&(a=this.filterEventsByResource(this.resources[parseInt(o.toString(),10)],a)));else{var h=je(this.renderedEvents[parseInt(o.toString(),10)])?[]:this.renderedEvents[parseInt(o.toString(),10)],d=[],p=t[s.startTime],c=t[s.endTime],u=(this.overlapList=h.filter(function(e){return e[s.endTime]>p&&e[s.startTime]<=c||e[s.startTime]>=c&&e[s.endTime]<=p||e[s.endTime].getTime()===e[s.startTime].getTime()&&e[s.startTime].getTime()===p.getTime()&&e[s.endTime]<c}),0<this.parent.activeViewOptions.group.resources.length&&(this.overlapList=this.filterEventsByResource(this.resources[parseInt(o.toString(),10)],this.overlapList)),[]);this.overlapList.forEach(function(e){u.push(e);for(var i=[],n=new Set;0<u.length&&"break"!==function(){var t=u.shift();if(h.filter(function(e){return e[s.endTime]>t[s.startTime]&&e[s.startTime]<=t[s.endTime]&&!n.has(e[s.id])}).forEach(function(e){i.push(e),n.add(e[s.id]),u.push(e)}),n.size<h.length-1)return"break"}(););e=(i=0<r.parent.activeViewOptions.group.resources.length?r.filterEventsByResource(r.resources[parseInt(o.toString(),10)],i):i).filter(function(e){return-1===r.overlapList.indexOf(e)});0<e.length&&(d=d.concat(e))});for(var g=0;g<d.length-1;g++)for(var m=g+1;m<d.length;m++)d[parseInt(g.toString(),10)][s.id]===d[parseInt(m.toString(),10)][s.id]&&(d.splice(m,1),m--);this.overlapList=this.overlapList.concat(d);for(var f=0,y=a=this.overlapList;f<y.length;f++){var v=y[f],b=v.Index;je(this.overlapEvents[parseInt(b.toString(),10)])?this.overlapEvents[parseInt(b.toString(),10)]=[v]:this.overlapEvents[parseInt(b.toString(),10)].push(v)}}return-1===(l=0<(a=i?a:a.filter(function(e){return e[s.startTime]===t[s.startTime]&&e[s.endTime]>t[s.endTime]||e[s.endTime]>t[s.startTime]&&e[s.startTime]<t[s.endTime]||e[s.endTime]===t[s.startTime]&&e[s.startTime]===t[s.endTime]||e[s.startTime].getTime()===t[s.startTime].getTime()&&e[s.endTime].getTime()===t[s.endTime].getTime()||e[s.startTime].getTime()===t[s.startTime].getTime()&&e[s.endTime].getTime()<t[s.endTime].getTime()||e[s.endTime].getTime()>t[s.endTime].getTime()})).length?0<(e=a.map(function(e){return e.Index})).length?this.getSmallestMissingNumber(e):0:l)?0:l},THe.prototype.adjustOverlapElements=function(e){for(var t={appWidth:e.width,appLeft:e.left},i=0,n=this.overlapEvents.length;i<n;i++)if(!je(this.overlapEvents[parseInt(i.toString(),10)]))for(var o=0,r=this.overlapEvents[parseInt(i.toString(),10)].length;o<r;o++){var s,a=this.getDayIndex(e.dayIndex,e.resource,e.day),a=this.element.querySelector("#e-appointment-wrapper-"+a);a&&0<a.childElementCount&&(s=this.overlapEvents[parseInt(i.toString(),10)][parseInt(o.toString(),10)].Guid,0<a.querySelectorAll('div[data-guid="'+s+'"]').length&&s!==e.record.Guid?(a=a.querySelector('div[data-guid="'+s+'"]'),parseFloat(e.width)<=parseFloat(a.style.width)&&(this.parent.enableRtl?a.style.right=this.getEventLeft(e.width,i):a.style.left=this.getEventLeft(e.width,i),a.style.width=parseFloat(e.width)+"%"),t.appWidth=a.style.width):(s=e.width,je(this.overlapEvents[i-1])&&(s=this.getEventWidth()),t.appWidth=s,t.appLeft=this.getEventLeft(s,e.index)))}return t},THe.prototype.setAllDayRowHeight=function(e){var t=this.parent.element.querySelector("."+eNe),i=("auto"!==this.parent.height&&this.parent.enableAllDayScroll||U([t],u_e),this.parent.element.querySelector("."+XOe));if(i.style.height="",this.parent.uiStateValues.expand&&"auto"!==this.parent.height&&this.parent.enableAllDayScroll)i.style.height=e/12+"em",this.parent.eventBase.allDayExpandScroll(t);else{for(var n=0,o=this.allDayElement;n<o.length;n++)o[n].style.height=e/12+"em";q([t],c_e)}},THe.prototype.addOrRemoveClass=function(){var t=this,e=(this.moreEvents.filter(function(e){!t.parent.uiStateValues.expand&&2<t.allDayLevel?(U([e],R2e),e.setAttribute("tabindex","-1")):(q([e],R2e),e.setAttribute("tabindex","0"))}),this.element.querySelector("."+N2e));this.parent.uiStateValues.expand?(q([e],V2e),U([e],_2e)):(q([e],_2e),U([e],V2e)),(2<this.allDayLevel?q:U)([e],UOe),[].slice.call(this.element.querySelectorAll("."+O2e)).forEach(function(e){(!t.parent.uiStateValues.expand&&2<t.allDayLevel?q:U)([e],UOe)})},THe.prototype.getEventHeight=function(){var e=Q("div",{className:qNe,styles:"visibility:hidden"}),t=(this.element.querySelector("."+F2e+":first-child").appendChild(e),e.offsetHeight);return ue(e),t},THe.prototype.rowExpandCollapse=function(){var e,t=this.element.querySelector("."+N2e);this.parent.uiStateValues.expand=t.classList.contains(V2e),this.parent.uiStateValues.expand?(t.setAttribute("title",this.parent.localeObj.getConstant("collapseAllDaySection")),t.setAttribute("aria-label",this.parent.localeObj.getConstant("collapseAllDaySection")),e=(this.allDayLevel+1)*this.getEventHeight()+4):(t.setAttribute("title",this.parent.localeObj.getConstant("expandAllDaySection")),t.setAttribute("aria-label",this.parent.localeObj.getConstant("expandAllDaySection")),e=3*this.getEventHeight()+4,this.parent.element.querySelector("."+eNe).scrollTop=0),this.setAllDayRowHeight(e),this.animation.animate(this.allDayElement[0]),this.addOrRemoveClass(),this.animation.animate(t)},THe.prototype.animationUiUpdate=function(){this.parent.notify(YRe,{})},THe.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.removeEventListener(),this.allDayElement=null,this.renderedAllDayEvents=null,this.renderedEvents=null,this.slotCount=null,this.interval=null,this.startHour=null,this.endHour=null,this.element=null,this.fields=null,this.animation=null,xHe.prototype.destroy.call(this))};var AHe,xHe,IHe=THe;function THe(e){e=xHe.call(this,e)||this;return e.dateRender=[],e.renderedEvents=[],e.renderedAllDayEvents=[],e.overlapEvents=[],e.moreEvents=[],e.overlapList=[],e.allDayEvents=[],e.slotCount=e.parent.activeViewOptions.timeScale.slotCount,e.interval=e.parent.activeViewOptions.timeScale.interval,e.allDayLevel=0,e.startHour=e.getStartEndHours(e.parent.activeViewOptions.startHour),e.endHour=e.getStartEndHours(e.parent.activeViewOptions.endHour),e.element=e.parent.activeView.getPanel(),e.fields=e.parent.eventFields,e.animation=new Vt({progress:e.animationUiUpdate.bind(e)}),e.addEventListener(),e}EHe=function(e,t){return(EHe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}EHe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(kHe,DHe=CHe),kHe.prototype.removeEventWrapper=function(e){if(0<e.length)for(var t=0,i=e="Month"===this.parent.currentView||!this.parent.activeView.isTimelineView()&&!this.parent.activeViewOptions.timeScale.enable?e:[e[0]];t<i.length;t++){var n=i[t];n.parentElement&&n.parentElement.parentNode&&ue(n.parentElement)}},kHe.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();var e,i,t=this.parent.element.querySelector("."+i2e),n=(this.parent.rowAutoHeight&&(this.parent.uiStateValues.top=t.scrollTop,this.parent.uiStateValues.left=t.scrollLeft),[].slice.call(this.element.querySelectorAll("."+LNe)));if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction)for(var o=0,r=this.parent.crudModule.crudObj.sourceEvent.length;o<r;o++){var s=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.sourceEvent[parseInt(o.toString(),10)].groupIndex+'"]'));this.removeEventWrapper(s),this.parent.crudModule.crudObj.targetEvent[parseInt(o.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(o.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(o.toString(),10)].groupIndex&&(s=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.targetEvent[parseInt(o.toString(),10)].groupIndex+'"]')),this.removeEventWrapper(s))}else for(var a=0,l=n;a<l.length;a++)ue(l[a]);this.removeHeightProperty(KOe),this.element.querySelector("."+JOe)&&("Month"===this.parent.currentView&&(n=Q("div",{className:LNe}),(e=this.parent.element.querySelector("."+JOe)).appendChild(n),this.monthHeaderHeight=n.offsetTop-e.offsetTop,e.removeChild(n)),this.eventHeight=this.parent.getElementHeightFromClass(this.element,qNe),this.addCellHeight(".e-content-table tbody tr",this.eventHeight,"Month"===this.parent.currentView?0:2,this.monthHeaderHeight,this.moreIndicatorHeight),e=t.scrollTop,this.parent.rowAutoHeight&&this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&!je(this.parent.currentAction)&&(t.scrollTop=t.scrollTop-1),0<this.parent.activeViewOptions.group.resources.length?(this.renderResourceEvents(),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell()):this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays),this.parent.rowAutoHeight&&(this.updateBlockElements(),n={cssProperties:this.parent.getCssProperties(),module:this.parent.getModuleName(),isPreventScrollUpdate:!0,scrollPosition:{left:this.parent.uiStateValues.left,top:this.parent.uiStateValues.top}},this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&(this.parent.currentAction?(t.scrollTop=e,this.parent.currentAction=null):this.parent.virtualScrollModule.updateVirtualScrollHeight()),this.parent.enablePersistence||this.parent.notify(YRe,{}),this.parent.notify(JRe,n),"Month"===this.parent.currentView)&&this.parent.showWeekNumber&&(i=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child")),[].slice.call(this.parent.element.querySelectorAll("."+jNe)).forEach(function(e,t){gt(e,{height:i[parseInt(t.toString(),10)].offsetHeight+"px"})}),this.parent.element.querySelector("."+zNe).scrollTop=this.parent.element.querySelector("."+i2e).scrollTop),this.parent.renderTemplates())},kHe.prototype.renderEventsHandler=function(e,t,i){this.renderedEvents=[];for(var n,o,r,s=0,a=(i?(s=i.groupIndex,this.cssClass=i.cssClass,this.groupOrder=i.groupOrder,n=this.parent.eventBase.filterEventsByResource(i,this.parent.eventsProcessed),o=this.parent.eventBase.filterEventsByResource(i,this.parent.blockProcessed),this.workCells=[].slice.call(this.element.querySelectorAll("."+JOe+'[data-group-index="'+s+'"]'))):(n=this.parent.eventsProcessed,o=this.parent.blockProcessed,this.workCells=[].slice.call(this.element.querySelectorAll("."+JOe))),this.sortByDateTime(n),this.sortByDateTime(o),"Month"===this.parent.currentView&&this.parent.rowAutoHeight&&0===this.parent.activeViewOptions.group.resources.length&&(a=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child")),r=this.parent.element.querySelector("."+KOe).clientHeight/a.length,a.forEach(function(e){gt(e,{height:r+"px"})})),this.workCells[this.parent.activeView.isTimelineView()?0:this.workCells.length-1]),l=(this.cellWidth=this.parent.getElementWidth(a),this.cellHeight=this.parent.getElementHeight(a),this.dateRender=e,this.getRenderedDates(e)),h=(this.getSlotDates(t||this.parent.activeViewOptions.workDays),this.processBlockEvents(o,s,i),[]),d=0,p=n;d<p.length;d++){var c=p[d];this.parent.resourceBase&&!i&&(this.cssClass=this.parent.resourceBase.getCssClass(c)),h=h.concat(this.splitEvent(c,l||this.dateRender))}for(var u=0;u<this.slots.length;u++){this.renderedEvents=[];for(var g=this.slots[parseInt(u.toString(),10)],m=yOe(new Date(g[g.length-1]),1),f=0,y=this.filterEvents(new Date(g[0]),m,h);f<y.length;f++){var v=y[f];if(this.maxHeight){var b="Month"===this.parent.currentView?v[this.fields.startTime]:this.getStartTime(v,v.data);if(0<this.getIndex(b))continue}this.updateIndicatorIcon(v),this.renderEvents(v,s,n)}}this.cssClass=null,this.groupOrder=null},kHe.prototype.processBlockEvents=function(e,t,i){for(var n=0,o=e;n<o.length;n++){var r,s,a,l=o[n],h=(this.parent.resourceBase&&!i&&(this.cssClass=this.parent.resourceBase.getCssClass(l)),[]);"day"!==this.renderType||l[this.fields.isAllDay]?h.push(l):(r=Pe({},l,null,!0),s=this.isSameDate(r[this.fields.startTime],r[this.fields.endTime]),!(r.isBlockIcon=s)&&0<mOe(r[this.fields.startTime])&&((a=Pe({},l,null,!0))[this.fields.endTime]=yOe(gOe(new Date(l[this.fields.startTime]+"")),1),a.isBlockIcon=!0,r[this.fields.startTime]=a[this.fields.endTime],h.push(a)),!(s=this.isSameDate(r[this.fields.startTime],r[this.fields.endTime]))&&0<mOe(r[this.fields.endTime])&&((a=Pe({},l,null,!0))[this.fields.startTime]=gOe(new Date(l[this.fields.endTime]+"")),a.isBlockIcon=!0,h.push(a),r[this.fields.endTime]=a[this.fields.startTime]),h.push(r));for(var d=0,p=h;d<p.length;d++)for(var c=p[d],u=0,g=this.splitEvent(c,this.dateRender);u<g.length;u++){var m=g[u];this.renderBlockEvents(m,t,!!c.isBlockIcon)}}},kHe.prototype.isSameDate=function(e,t){return new Date(+e).setHours(0,0,0,0)===new Date(+t).setHours(0,0,0,0)},kHe.prototype.renderBlockEvents=function(e,t,i){var n,o=e.data,r=this.getStartTime(e,o),s=this.getEndTime(e,o),a=this.parent.getIndexOfDate(this.dateRender,gOe(new Date(r.getTime())));a<0||s<r||(n=this.getCellTd(a),a=this.getPosition(r,s,e[this.fields.isAllDay],a),i?this.renderBlockIndicator(n,a,t):(i=o.count,o=(o=this.getEventWidth(r,s,e[this.fields.isAllDay],i))<=0?this.cellWidth:o,r=this.parent.enableRtl?0:a,s=this.parent.enableRtl?a:0,i=this.cellHeight-this.monthHeaderHeight,a=this.getRowTop(t),gt(t=this.createBlockAppointmentElement(e,t,this.isResourceEventTemplate),{width:o+"px",height:i+"px",left:r+"px",right:s+"px",top:a+"px"}),this.renderEventElement(e,t,n)))},kHe.prototype.renderBlockIndicator=function(e,t,i){var n=Q("div",{className:"e-icons "+YNe});je(e.querySelector("."+YNe))&&e.appendChild(n)},kHe.prototype.getStartTime=function(e,t){return e[this.fields.startTime]},kHe.prototype.getEndTime=function(e,t){return e[this.fields.endTime]},kHe.prototype.getCellTd=function(e){return this.workCells[parseInt(e.toString(),10)]},kHe.prototype.getEventWidth=function(e,t,i,n){return n*this.cellWidth-1},kHe.prototype.getPosition=function(e,t,i,n){return 0},kHe.prototype.getRowTop=function(e){return 0},kHe.prototype.updateIndicatorIcon=function(e){var t,i,n,o,r,s;-1===this.parent.currentView.indexOf("Timeline")||"TimelineMonth"===this.parent.currentView||e[this.fields.isAllDay]||(t=e.data,n=this.parent.activeView.getStartHour(),o=this.parent.activeView.getEndHour(),i=wOe(e[this.fields.startTime],n,o),e=wOe(e[this.fields.endTime],n,o),n=t[this.fields.startTime],o=t[this.fields.endTime],t.isLeft=t.isLeft||n.getTime()<i.startHour.getTime(),t.isRight=t.isRight||o.getTime()>e.endHour.getTime(),gOe(n).getTime()!==gOe(o).getTime()&&(r=i.startHour,e=e.endHour,(s=new Date(gOe(n))).setHours(e.getHours(),e.getMinutes(),e.getSeconds()),t.isLeft=t.isLeft||n.getTime()>=(r.getDate()===i.endHour.getDate()?s:yOe(s,1)).getTime(),o.getTime()!==gOe(o).getTime())&&(e=new Date(gOe(o)),t.isRight=t.isRight||o.getTime()<=e.setHours(r.getHours(),r.getMinutes(),r.getSeconds())))},kHe.prototype.renderResourceEvents=function(){var e=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.renderedResources;if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction){for(var t=0,i=this.parent.crudModule.crudObj.sourceEvent.length;t<i;t++){var n=this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)];(!this.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===n.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(n.renderDates,n.workDays,n),this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)].groupIndex&&(n=this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)],this.renderEventsHandler(n.renderDates,n.workDays,n))}this.parent.crudModule.crudObj.isCrudAction=!1}else for(var o=0,r=e;o<r.length;o++){var s=r[o];this.renderEventsHandler(s.renderDates,s.workDays,s)}},kHe.prototype.getSlotDates=function(e){this.slots=[];for(var t=this.dateRender.map(function(e){return+e}),i=!this.parent.activeViewOptions.showWeekend||this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays?e.length:7;0<t.length;)this.slots.push(t.splice(0,i))},kHe.prototype.createAppointmentElement=function(e,t,i){void 0===i&&(i=!1);var n,o,r,s,a=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),l=Pe({},e,e.data,!0),l={"data-id":"Appointment_"+e[this.fields.id],role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(l,a)},i=(i||(l["data-guid"]=e.Guid),0<this.parent.activeViewOptions.group.resources.length&&(l["data-group-index"]=t.toString()),Q("div",{className:qNe,attrs:l})),l=(je(this.cssClass)||U([i],this.cssClass),e[this.fields.isReadonly]&&U([i],"e-read-only"),Q("div",{className:KNe})),h=(i.appendChild(l),e.data),d=this.getEventData(e);return je(this.parent.activeViewOptions.eventTemplate)?(o=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",r=Q("div",{className:CVe}),this.parent.sanitize(a+(o?"; "+o:""),r),a=Q("div",{className:$Ne+(this.parent.isAdaptive?" "+UOe:""),innerHTML:this.parent.getTimeString(h[this.fields.startTime])}),n=Q("div",{className:$Ne+(this.parent.isAdaptive?" "+UOe:""),innerHTML:this.parent.getTimeString(h[this.fields.endTime])}),"Month"===this.parent.currentView?e[this.fields.isAllDay]?(s=[r],U([r],"e-text-center")):h.count<=1&&!h.isLeft&&!h.isRight?s=[a,r]:(s=[],U([r],"e-text-center"),h.isLeft||s.push(a),s.push(r),h.isRight||s.push(n)):(ht(e[this.fields.isAllDay]?[r,Q("div",{className:$Ne,innerHTML:this.parent.localeObj.getConstant("allDay")})]:(a=this.parent.getTimeString(h[this.fields.startTime])+" - "+this.parent.getTimeString(h[this.fields.endTime]),n=Q("div",{className:$Ne+(this.parent.isAdaptive?" "+UOe:""),innerHTML:a}),h=Q("div",{className:SVe}),this.parent.sanitize(o,h),[r,n,h]),a=Q("div",{className:"e-inner-wrap"})),s=[a])):(o=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",r=this.isResourceEventTemplate?this.parent.getEventTemplateName(t):"eventTemplate",s=this.parent.getAppointmentTemplate()(d,this.parent,r,o,!1,void 0,void 0,this.parent.root)),ht(s,l),this.appendEventIcons(e,l),this.renderResizeHandler(i,e.data,e[this.fields.isReadonly]),i},kHe.prototype.appendEventIcons=function(e,t){var i=e.data;je(e[this.fields.recurrenceRule])&&je(e[this.fields.recurrenceID])||(e=e[this.fields.id]===e[this.fields.recurrenceID]?k2e:P2e,t.appendChild(Q("div",{className:WOe+" "+e+(this.parent.isAdaptive?" "+UOe:"")}))),i.isLeft&&lt([Q("div",{className:f2e+" "+WOe+" "+y2e})],t),i.isRight&&ht([Q("div",{className:f2e+" "+WOe+" "+v2e})],t)},kHe.prototype.renderEvents=function(e,t,i){var n=e[this.fields.startTime],o=e[this.fields.endTime],r=this.parent.getIndexOfDate(this.dateRender,gOe(n));if(!(r<0||n.getTime()<this.parent.minDate.getTime()||o.getTime()>this.parent.maxDate.getTime())){var s=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,a=this.getIndex(n),l=(e.Index=a,e.data.count);if(n.getTime()<=o.getTime()){var n=l*this.cellWidth-5,o=this.workCells[parseInt(r.toString(),10)],h=a*(this.eventHeight+0),d=this.monthHeaderHeight+(a+1)*(this.eventHeight+0)+this.moreIndicatorHeight,a=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?a<1:this.cellHeight>d:a<s;if(this.parent.rowAutoHeight||a){this.renderedEvents.push(Pe({},e,null,!0));s=void 0,s=this.inlineValue?this.parent.inlineModule.createInlineAppointmentElement():this.createAppointmentElement(e,t);this.applyResourceColor(s,e,"backgroundColor",this.groupOrder),this.wireAppointmentEvents(s,e),gt(s,{width:n+"px",top:h+"px"}),this.renderEventElement(e,s,o),this.parent.rowAutoHeight&&(a=this.parent.element.querySelector("."+i2e),t=this.parent.getElementWidth(a),n=a.offsetHeight===a.clientHeight&&a.offsetWidth===a.clientWidth,h=o.parentElement.firstElementChild,this.updateCellHeight(h,d),n)&&(a.offsetWidth>a.clientWidth||t!==this.parent.getElementWidth(a))&&this.adjustAppointments(t)}else for(var p,c,u,g=0;g<l;g++)this.workCells[r+g]&&((u=this.workCells[r+g].querySelector("."+H2e))?(p=parseInt(u.getAttribute("data-count"),10)+1,u.setAttribute("data-count",p.toString()),u.setAttribute("aria-label",p+" "+this.parent.localeObj.getConstant("moreEvents")),u.innerHTML=this.getMoreIndicatorText(p)):(u=new Date(this.dateRender[r+g].getTime()),p=yOe(this.dateRender[r+g],1),c=this.workCells[r+g].getAttribute("data-group-index"),u=this.getMoreIndicatorElement(1,u,p),je(c)||u.setAttribute("data-group-index",c),u.style.top=this.cellHeight-this.monthHeaderHeight-this.moreIndicatorHeight+"px",u.style.width=this.cellWidth-2+"px",this.renderElement(this.workCells[r+g],u),E.add(u,"click",this.moreIndicatorClick,this)))}}},kHe.prototype.adjustAppointments=function(e){var t=this,i=this.parent.element.querySelector("."+KOe+" tbody tr"),n=this.parent.getElementWidth(this.workCells[0]),o=(this.cellWidth=n/+(this.workCells[0].getAttribute("colspan")||1),n*i.children.length/(e/100));[].slice.call(this.parent.element.querySelectorAll("."+qNe)).forEach(function(e){t.parent.enableRtl&&"0px"!==e.style.right?e.style.right=parseFloat(e.style.right)/100*o+"px":"0px"!==e.style.left&&(e.style.left=parseFloat(e.style.left)/100*o+"px"),e.style.width=parseFloat(e.style.width)/100*o+"px"})},kHe.prototype.updateCellHeight=function(e,t){t>e.offsetHeight&&gt(e,{height:t+"px"})},kHe.prototype.updateBlockElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+GNe));e<t.length;e++){var i=t[e],n=z(i,"tr"),n=(this.monthHeaderHeight=i.offsetParent.offsetTop-n.offsetTop,i.style.height=n.offsetHeight-1-this.monthHeaderHeight+"px",n.firstElementChild),o=Math.round(i.offsetWidth/n.offsetWidth);i.style.width=n.offsetWidth*o+"px"}},kHe.prototype.getFilteredEvents=function(e,t,i,n){return je(i)?this.filterEvents(e,t):(i=this.parent.resourceBase.lastResourceLevel[parseInt(i,10)],this.filterEvents(e,t,je(n)?void 0:n,i))},kHe.prototype.getOverlapEvents=function(e,t){for(var i=[],n=gOe(e).getTime(),o=0,r=t;o<r.length;o++){var s=r[o];gOe(s[this.fields.startTime]).getTime()<=n&&gOe(s[this.fields.endTime]).getTime()>=n&&i.push(s)}return i},kHe.prototype.getIndex=function(e){var t=-1,i=this.renderedEvents;return-1===(t=0<i.length?0<(e=this.getOverlapEvents(e,i).map(function(e){return e.Index})).length?this.getSmallestMissingNumber(e):0:t)?0:t},kHe.prototype.moreIndicatorClick=function(i){var n=this,e=z(i.target,"."+H2e),o=new Date(parseInt(e.getAttribute("data-start-date"),10)),r=new Date(parseInt(e.getAttribute("data-end-date"),10)),s=e.getAttribute("data-group-index"),e={cancel:!1,event:i,element:e,isPopupOpen:!0,startTime:o,endTime:r,viewName:this.parent.getNavigateView()};s&&(e.groupIndex=parseInt(s,10)),this.parent.trigger(vRe,e,function(e){var t;e.cancel||(e.isPopupOpen?(t=n.getFilteredEvents(o,r,s),t={date:o,event:t,element:i.target},n.parent.quickPopup.moreEventClick(t,r,s)):(n.parent.setProperties({selectedDate:o},!0),n.parent.changeView(e.viewName,i)))})},kHe.prototype.renderEventElement=function(e,t,i){var n=this,o=t.classList.contains(GNe)?"blockEvent":"event",r=t.classList.contains(qNe),e="Month"===this.parent.currentView?this.getSpannedTime(e):this.getEventData(e);this.parent.trigger(ERe,{data:e,element:t,cancel:!1,type:o},function(e){e.cancel?n.renderedEvents.pop():n.renderElement(i,t,r)})},kHe.prototype.getSpannedTime=function(e){e=Pe({},e,null,!0);return e[this.fields.startTime].getDate()===e.data[this.fields.startTime].getDate()&&(e[this.fields.startTime]=e.data[this.fields.startTime]),e[this.fields.endTime].getDate()===e.data[this.fields.endTime].getDate()&&(e[this.fields.endTime]=e.data[this.fields.endTime]),e},kHe.prototype.getEventData=function(e){var t=Pe({},e,null,!0);return t[this.fields.startTime]=e.data[this.fields.startTime],t[this.fields.endTime]=e.data[this.fields.endTime],t},kHe.prototype.renderElement=function(e,t,i){void 0===i&&(i=!1),this.maxOrIndicator&&i&&this.setMaxEventHeight(t,e);var i=e.querySelector("."+LNe);i?i.appendChild(t):((i=Q("div",{className:LNe})).appendChild(t),e.appendChild(i))},kHe.prototype.getMoreIndicatorElement=function(e,t,i){return Q("div",{className:H2e,innerHTML:this.getMoreIndicatorText(e),attrs:{role:"button",tabindex:"0","aria-label":this.parent.globalize.formatNumber(e)+" "+this.parent.localeObj.getConstant("moreEvents"),"data-count":e.toString(),"data-start-date":t.getTime().toString(),"data-end-date":i.getTime().toString()}})},kHe.prototype.getMoreIndicatorText=function(e){return"+"+this.parent.globalize.formatNumber(e)+"&nbsp;"+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))},kHe.prototype.removeHeightProperty=function(e){for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+e+" tbody tr"));t<i.length;t++)i[t].firstElementChild.style.height=""},kHe.prototype.setMaxEventHeight=function(e,t){var i=MOe(t.querySelector("."+p2e));gt(e,{height:t.offsetHeight-i-(this.maxHeight?0:this.moreIndicatorHeight)+"px","align-items":"center"})},kHe.prototype.destroy=function(){this.element=null,this.fields=null,this.maxHeight=null,this.withIndicator=null,this.maxOrIndicator=null,this.moreIndicatorHeight=null,this.removeEventListener(),DHe.prototype.destroy.call(this)};var EHe,DHe,MHe=kHe;function kHe(e){e=DHe.call(this,e)||this;return e.renderedEvents=[],e.monthHeaderHeight=0,e.moreIndicatorHeight=19,e.renderType="day",e.element=e.parent.activeView.getPanel(),e.fields=e.parent.eventFields,e.maxHeight=e.parent.eventSettings.enableMaxHeight&&!e.parent.eventSettings.enableIndicator&&!e.parent.rowAutoHeight,e.withIndicator=e.parent.eventSettings.enableMaxHeight&&e.parent.eventSettings.enableIndicator&&!e.parent.rowAutoHeight,e.maxOrIndicator=e.maxHeight||e.withIndicator,e.moreIndicatorHeight=e.parent.rowAutoHeight&&e.parent.eventSettings.ignoreWhitespace?0:e.moreIndicatorHeight,e.addEventListener(),e}PHe=function(e,t){return(PHe=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}PHe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(LHe,BHe=MHe),LHe.prototype.getSlotDates=function(){var e;this.slots=[],this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),0<this.parent.activeViewOptions.headerRows.length&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option?(this.renderType="day",e=this.content.querySelector("."+JOe),this.cellWidth=this.parent.getElementWidth(e)/+(e.getAttribute("colspan")||1),this.slotsPerDay=1):this.slotsPerDay=this.dayLength/this.dateRender.length},LHe.prototype.getOverlapEvents=function(e,t){var i=[];if("day"===this.renderType)for(var n=0,o=t;n<o.length;n++)gOe((a=o[n])[this.fields.startTime]).getTime()<=gOe(new Date(e.getTime())).getTime()&&gOe(a[this.fields.endTime]).getTime()>=gOe(new Date(e.getTime())).getTime()&&i.push(a);else for(var r=0,s=t;r<s.length;r++){var a,l=(a=s[r]).data;(l.trimStartTime.getTime()<=e.getTime()&&l.trimEndTime.getTime()>e.getTime()||l.trimStartTime.getTime()===e.getTime()&&l.trimEndTime.getTime()===e.getTime())&&i.push(a)}return i},LHe.prototype.getSortComparerIndex=function(e,t){var i=-1,n=this.renderedEvents;return-1===(i=0<n.length?0<(e=this.getOverlapSortComparerEvents(e,t,n).map(function(e){return e.Index})).length?this.getSmallestMissingNumber(e):0:i)?0:i},LHe.prototype.getOverlapSortComparerEvents=function(s,a,e){for(var l=[],t=function(e){var t,i,n,o,r;"day"===h.renderType?(t=gOe(s).getTime(),i=gOe(a).getTime(),n=gOe(e[h.fields.startTime]).getTime(),o=gOe(e[h.fields.endTime]).getTime(),(n<=t&&t<=o||(r=(r=i-(mOe(a)<=0?iOe:0))<t?t:r)<=o&&n<=r||t<n&&o<i)&&l.push(e)):((r=e.data).trimStartTime.getTime()<=s.getTime()&&s.getTime()<r.trimEndTime.getTime()||s.getTime()<=r.trimStartTime.getTime()&&r.trimStartTime.getTime()<a.getTime())&&l.push(e)},h=this,i=0,n=e;i<n.length;i++)t(n[i]);return l},LHe.prototype.renderResourceEvents=function(){this.removeHeightProperty(yNe);this.addCellHeight(".e-resource-column-table tbody tr",this.eventHeight,2,this.moreIndicatorHeight,0,!1);var e=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.renderedResources;if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction){for(var t=0,i=this.parent.crudModule.crudObj.sourceEvent.length;t<i;t++){var n=this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)];this.rowIndex=n.groupIndex,(!this.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===n.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,n),this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)].groupIndex&&(n=this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)],this.rowIndex=n.groupIndex,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,n))}this.parent.crudModule.crudObj.isCrudAction=!1}else for(t=0;t<e.length;t++)this.rowIndex=t,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,e[parseInt(t.toString(),10)])},LHe.prototype.renderEvents=function(e,t,i){var n=e[this.fields.startTime],o=e[this.fields.endTime];if(!(n.getTime()<this.parent.minDate.getTime()||o.getTime()>this.parent.maxDate.getTime())){var r=e.data,n=this.getStartTime(e,r),o=this.getEndTime(e,r),s=wOe(e[this.fields.startTime],this.startHour,this.endHour),s=this.updateEventMinimumDuration(s,n,o);if(n=s.startDate,o=s.endDate,this.day=this.parent.getIndexOfDate(this.dateRender,gOe(new Date(n.getTime()))),!(this.day<0)){var a=this.getCellTd(),s=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,l=je(this.parent.eventSettings.sortComparer)?this.getIndex(n):this.getSortComparerIndex(n,o),h=(e.Index=l,this.eventHeight),d=r.count,p=Pe({},e,null,!0);p[this.fields.startTime]=r[this.fields.startTime],p[this.fields.endTime]=r[this.fields.endTime];var r=wOe(gOe(new Date(this.dateRender[this.day].getTime())),this.startHour,this.endHour),c=!0,c=!(!this.isDayProcess()&&!p[this.fields.isAllDay])||this.isValidEvent(p,n,o,r);if(n<=o&&c){var p=this.getEventWidth(n,o,e[this.fields.isAllDay],d),p="day"===this.renderType?p-2:p,r=this.getPosition(n,o,e[this.fields.isAllDay],this.day),u=(p=p<=0?this.cellWidth:p,this.renderedEvents.push(Pe({},e,null,!0)),je(this.cellTops[parseInt(t.toString(),10)])&&(this.cellTops[parseInt(t.toString(),10)]=this.getRowTop(t)),this.cellTops[parseInt(t.toString(),10)]),c=u+(this.maxHeight?0:2)+l*(h+2),g=this.parent.enableRtl?0:r,m=this.parent.enableRtl?r:0,r=(l+1)*(h+2)+this.moreIndicatorHeight,l=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?l<1:this.cellHeight>r:l<s;if(this.parent.rowAutoHeight||l){var f,s=void 0,s=je(this.inlineValue)?this.createAppointmentElement(e,t):this.parent.inlineModule.createInlineAppointmentElement();this.applyResourceColor(s,e,"backgroundColor",this.groupOrder),gt(s,{width:p+"px",left:g+"px",right:m+"px",top:c+"px"}),this.wireAppointmentEvents(s,e),this.parent.rowAutoHeight?(l=this.parent.element.querySelector("."+i2e),p=this.parent.getElementWidth(l),c=l.offsetHeight===l.clientHeight&&l.offsetWidth===l.clientWidth,this.renderEventElement(e,s,a),f=this.getFirstChild(t),this.updateCellHeight(f,r),c&&(l.offsetWidth>l.clientWidth||p!==this.parent.getElementWidth(l))&&this.adjustAppointments(p)):this.renderEventElement(e,s,a)}else for(var y=0;y<d;y++){var v=a.querySelector("."+H2e),b=this.parent.enableRtl?m:g,b=Math.floor(b/this.cellWidth)*this.cellWidth,w=this.interval/this.slotCount,C="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType||0!==y?new Date(this.dateRender[this.day+y].getTime()):new Date(n),S=yOe(this.dateRender[this.day+y],1);if("TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType){var A=this.getPosition(C,S,e[this.fields.isAllDay],this.day+y);this.renderTimelineMoreIndicator(n,C,S,h,w,t,i,u,g,m,a,v,b,A)}else for(var x=(BOe(o)-BOe(n))/6e4*this.slotCount/this.interval,I=0;I<x&&(C=0===I?new Date(C.getTime()):new Date(C.getTime()+6e4*w),x<1&&(C=this.adjustToNearestTimeSlot(C,w)),S=new Date(C.getTime()+6e4*w),!(1<=x&&S.getTime()>o.getTime()));I++){var T=this.getPosition(C,S,!1,this.day+y);if(T<b)break;this.renderTimelineMoreIndicator(n,C,S,h,w,t,i,u,g,m,a,v,b=T,T)}}}this.parent.renderTemplates()}}},LHe.prototype.adjustToNearestTimeSlot=function(e,t){var e=new Date(e),i=60*e.getHours()*60*1e3+60*e.getMinutes()*1e3,i=Math.floor(i/(60*t*1e3))*(60*t*1e3),t=new Date(e.getTime());return t.setHours(i/36e5%24),t.setMinutes(i%36e5/6e4),t},LHe.prototype.renderTimelineMoreIndicator=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u){l=this.parent.enableRtl?h=u:u,c=this.parent.enableRtl?h:l,c=Math.floor(c/this.cellWidth)*this.cellWidth,(d&&je(p)||!this.isAlreadyAvail(c,d))&&(u="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType?new Date(+e):t,p=new Date(u.setMinutes(Math.floor(u.getMinutes()/o)*o)),c=new Date(p.getTime()+6e4*o),e=void 0,0<this.parent.activeViewOptions.group.resources.length&&!je(r)&&(e=r.toString()),u=this.getFilterEvents(t,i,p,c,e,s),o=this.cellHeight-this.moreIndicatorHeight,n=this.withIndicator?o-2:n,r=Math.floor(o/(n+2)),s=this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.eventSettings.enableIndicator?u.length-this.parent.activeViewOptions.maxEventsPerRow:u.length-r<=0?1:u.length-r,n=void 0,n="day"===this.renderType?this.getMoreIndicatorElement(s,t,i):this.getMoreIndicatorElement(s,p,c),je(e)||n.setAttribute("data-group-index",e),n.style.top=a+o+"px",n.style.width=this.cellWidth+"px",n.style.left=Math.floor(l/this.cellWidth)*this.cellWidth+"px",n.style.right=Math.floor(h/this.cellWidth)*this.cellWidth+"px",this.renderElement(d,n),E.add(n,"click",this.moreIndicatorClick,this))},LHe.prototype.updateCellHeight=function(e,t){var i;(""===e.style.height?this.cellHeight:parseInt(e.style.height,10))<t&&(gt(e,{height:t+"px"}),0<this.parent.activeViewOptions.group.resources.length&&(i=this.parent.element.querySelector("."+yNe+' tbody td[data-group-index="'+e.getAttribute("data-group-index")+'"]'))&&gt(i,{height:t+"px"}),i=this.parent.element.querySelector(".e-month-header-wrapper table tr:nth-child("+(e.parentElement.rowIndex+1)+") td"))&&gt(i,{height:t+"px"})},LHe.prototype.getFirstChild=function(e){var t="";return 0<this.parent.activeViewOptions.group.resources.length&&(t='[data-group-index="'+e.toString()+'"]'),this.parent.element.querySelector(".e-content-table tbody td"+t)},LHe.prototype.updateBlockElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+GNe));e<t.length;e++){var i=t[e],n=parseInt(i.getAttribute("data-group-index"),10),o=this.getFirstChild(n),r=(i.style.height=o.offsetHeight+"px",i.offsetWidth/o.offsetWidth);i.style.width=o.offsetWidth*r+"px"}for(var s=0,a=[].slice.call(this.element.querySelectorAll("."+YNe));s<a.length;s++){i=a[s],n=parseInt(i.getAttribute("data-group-index"),10);i.style.top=this.getRowTop(n)+this.getFirstChild(n).offsetHeight-18+"px"}},LHe.prototype.getStartTime=function(e,t){var i=wOe(n=e[this.fields.startTime],this.startHour,this.endHour),n=this.isDayProcess()?e[this.fields.startTime]:i.startHour.getTime()>=t[this.fields.startTime]?i.startHour:i.endHour.getTime()<=t[this.fields.startTime]?this.getNextDay(i.startHour,t):t[this.fields.startTime];return t.trimStartTime=e[this.fields.isAllDay]?i.startHour:t[this.fields.startTime],n},LHe.prototype.getNextDay=function(e,t){for(var i,n=1;n<=this.dateRender.length;n++)if(i=yOe(e,n),-1!==this.parent.getIndexOfDate(this.dateRender,gOe(new Date(e.getTime()))))return t.count=t.count-1,i;return i},LHe.prototype.getEndTime=function(e,t){var i=e[this.fields.endTime],n=wOe(i,this.startHour,this.endHour);return this.isDayProcess()?i=t[this.fields.endTime]:(i=t[this.fields.endTime],(n.endHour.getTime()<=t[this.fields.endTime]||e[this.fields.isAllDay])&&(i=n.endHour),n.startHour.getTime()>=t[this.fields.endTime].getTime()&&!e[this.fields.isAllDay]&&(i=this.getPreviousDay(n.startHour,n.endHour,t))),t.trimEndTime=e[this.fields.isAllDay]?n.endHour:t[this.fields.endTime],i},LHe.prototype.getPreviousDay=function(e,t,i){for(var n=1;n<=this.dateRender.length;n++){var o,r,s=yOe(t,-n);if(-1!==this.parent.getIndexOfDate(this.dateRender,gOe(new Date(e.getTime()))))return(s=gOe(new Date(s.getTime()))).setHours(t.getHours(),t.getMinutes(),t.getSeconds()),o=i.count,r=i[this.fields.endTime],i.count=0!==r.getHours()||0!==r.getMinutes()?o-1:o,s}return i[this.fields.endTime]},LHe.prototype.getEventWidth=function(e,t,i,n){return"day"===this.renderType||i?n*this.slotsPerDay*this.cellWidth:this.isSameDay(e,t)?this.getSameDayEventsWidth(e,t):this.getSpannedEventsWidth(e,t,n)},LHe.prototype.getSameDayEventsWidth=function(e,t){return(BOe(t)-BOe(e))/6e4*(this.cellWidth*this.slotCount)/this.getIntervalInMinutes(e)},LHe.prototype.getSpannedEventsWidth=function(e,t,i){var n,o,i=i*this.slotsPerDay*this.cellWidth,r=wOe(gOe(new Date(e.getTime())),this.startHour,this.endHour),r=this.getSameDayEventsWidth(r.startHour,e),t=r+(o=-1===this.parent.getIndexOfDate(this.dateRender,gOe(new Date(t.getTime())))||(n=(e=wOe(gOe(new Date(t.getTime())),this.startHour,this.endHour)).startHour,e=e.endHour,o=this.interval/this.slotCount,n=this.getEndTimeOfLastSlot(n,e,o),o=this.getSameDayEventsWidth(t,e<n?e:n),this.slotsPerDay*this.cellWidth===o)?0:o);return t<i?i-t:i-r},LHe.prototype.getEndTimeOfLastSlot=function(e,t,i){t=(t.getTime()-e.getTime())/6e4,t=Math.floor(t/i)*i,i=new Date(e);return i.setMinutes(t),i},LHe.prototype.isSameDay=function(e,t){return this.parent.getIndexOfDate(this.dateRender,gOe(new Date(e.getTime())))===this.parent.getIndexOfDate(this.dateRender,gOe(new Date(t.getTime())))},LHe.prototype.getAppointmentLeft=function(e,t,i){t=this.isSameDay(t,e.startHour)?(BOe(t)-BOe(e.startHour))/(6e4*this.getIntervalInMinutes(t))*this.slotCount:0;return 0===i?t:Math.round((BOe(e.endHour)-BOe(e.startHour))/this.interval/6e4*this.slotCount)*i+t},LHe.prototype.getPosition=function(e,t,i,n){return"day"===this.renderType||i?n*this.slotsPerDay*this.cellWidth:((i=wOe(gOe(new Date(this.dateRender[parseInt(n.toString(),10)].getTime())),this.startHour,this.endHour)).endHour.getTime()<=t.getTime()&&i.startHour.getTime()>=e.getTime()||!(i.endHour.getTime()<=t.getTime())&&i.startHour.getTime()>=e.getTime()?this.getAppointmentLeft(i,i.startHour,n):this.getAppointmentLeft(i,e,n))*this.cellWidth},LHe.prototype.getFilterEvents=function(e,t,i,n,o,r){return"day"===this.renderType?this.getFilteredEvents(e,t,o,r):this.getFilteredEvents(i,n,o,r)},LHe.prototype.getIntervalInMinutes=function(e){return 1!==this.slotsPerDay?this.interval:((e=wOe(gOe(new Date(e.getTime())),this.startHour,this.endHour)).endHour.getTime()-e.startHour.getTime())/6e4},LHe.prototype.isAlreadyAvail=function(e,t){for(var i=[].slice.call(t.querySelectorAll("."+H2e)),n=0;n<i.length;n++){var o=void 0;if(i&&(o=this.parent.enableRtl?i[parseInt(n.toString(),10)].style.right:i[parseInt(n.toString(),10)].style.left),parseInt(o,10)===Math.floor(e))return!0}return!1},LHe.prototype.getRowTop=function(e){return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.element.querySelector("."+i2e+' tbody td[data-group-index="'+e.toString()+'"]').offsetTop:0},LHe.prototype.getCellTd=function(){var e=this.parent.uiStateValues.isGroupAdaptive?0:this.rowIndex;return this.eventContainers[parseInt(e.toString(),10)]},LHe.prototype.renderBlockIndicator=function(e,t,i){var n;0<this.parent.headerRows.length&&("Hour"!==this.parent.headerRows[this.parent.headerRows.length-1].option||"Date"!==this.parent.headerRows[this.parent.headerRows.length-1].option)||(t=Math.floor(t/this.cellWidth)*this.cellWidth+this.cellWidth-22,this.isAlreadyAvail(t,e))||(n=Q("div",{className:"e-icons "+YNe}),0<this.parent.activeViewOptions.group.resources.length&&n.setAttribute("data-group-index",i.toString()),this.parent.enableRtl?n.style.right=t+"px":n.style.left=t+"px",n.style.top=this.getRowTop(i)+this.cellHeight-18+"px",this.renderElement(e,n))},LHe.prototype.setMaxEventHeight=function(e,t){gt(e,{height:this.cellHeight-(this.maxHeight?0:2)-(this.maxHeight?0:this.moreIndicatorHeight)+"px"})},LHe.prototype.isDayProcess=function(){return"TimelineMonth"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable||0<this.parent.activeViewOptions.headerRows.length&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option},LHe.prototype.destroy=function(){this.renderType=null,this.eventContainers=null,this.dayLength=null,this.content=null,BHe.prototype.destroy.call(this),this.parent=null};var PHe,BHe,FHe=LHe;function LHe(e,t){e=BHe.call(this,e)||this,e.startHour=e.parent.activeView.getStartHour(),e.endHour=e.parent.activeView.getEndHour(),e.slotCount=e.parent.activeViewOptions.timeScale.slotCount,e.interval=e.parent.activeViewOptions.timeScale.interval,e.day=0,e.rowIndex=0,e.cellTops=[],e.renderType=t,e.eventContainers=[].slice.call(e.element.querySelectorAll("."+UNe)),t=[].slice.call(e.element.querySelectorAll("."+KOe+" tbody tr"));return e.dayLength=0===t.length?0:t[0].children.length,e.content=e.parent.element.querySelector("."+GOe+"."+KOe),e}OHe.prototype.inlineEdit=function(e){var t;this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),"Cell"===e.type?((t=this.parent.element.querySelector("."+Z2e))&&t.classList.contains($Oe)&&this.parent.quickPopup.morePopup.hide(),this.removeInlineAppointmentElement(),this.cellEdit(e)):(this.parent.element.querySelector("."+h_e)!==e.element.querySelector("."+h_e)&&this.removeInlineAppointmentElement(),this.eventEdit(e))},OHe.prototype.cellEdit=function(e){var t=this.generateEventData(),i=e.element.cellIndex,n=this.getEventDaysCount(t),n=(1<n&&(n=Math.round(n),i-=--n),gOe(new Date(""+t[this.parent.eventFields.startTime])).getTime()),o=gOe(new Date(""+t[this.parent.eventFields.endTime])).getTime(),e=e.groupIndex||0,r="Day"===this.parent.currentView||"Week"===this.parent.currentView||"WorkWeek"===this.parent.currentView,s=(this.parent.activeViewOptions.timeScale.enable&&r?(s=t[this.parent.eventFields.startTime].getDay(),this.createVerticalViewInline(t,s,e,i)):"Month"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable&&r?this.createMonthViewInline(t,e,n,o):this.createTimelineViewInline(t,n,o,e),this.parent.element.querySelector("."+h_e));s&&s.focus()},OHe.prototype.eventEdit=function(e){var t,i,n=e.element.querySelector("."+h_e);n?i=n.value:(i=je(t=e.element.querySelector("."+CVe))?e.data[this.parent.eventFields.subject]:(U([t],UOe),t.innerText),n=this.inlineInputEle=Q("input",{className:h_e,attrs:{value:i}}),z(e.element,"."+Z2e)?e.element.insertBefore(n,t):-1<["Agenda","MonthAgenda"].indexOf(this.parent.currentView)?(je(t=e.element.querySelector("."+JNe))&&(t=Q("div",{className:JNe}),e.element.prepend(t)),t.insertBefore(n,t.firstChild)):(t=-1<["TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth"].indexOf(this.parent.currentView)?".e-inner-wrap":".e-appointment-details",(je(t=e.element.querySelector(t))?e.element.querySelector(".e-appointment-details"):t).prepend(n)),n.focus()),n.setSelectionRange(i.length,i.length)},OHe.prototype.createVerticalViewInline=function(e,t,i,n){var o,r=this.getEventDaysCount(e),s=new IHe(this.parent),t=(s.initializeValues(),s.dateRender[parseInt(i.toString(),10)].map(function(e){return e.getDay()}).indexOf(t));1<=r?(s.allDayElement=[].slice.call(this.parent.element.querySelectorAll("."+YOe)),(r=s.slots).push.apply(r,this.parent.activeView.renderDates.map(function(e){return+e})),(r=0)<(o=[].slice.call(this.parent.element.querySelectorAll("."+L2e))).length&&(r=Math.floor(this.parent.getElementHeight(this.parent.element.querySelector("."+XOe))/o[0].offsetHeight)-1),s.allDayLevel=r,o=this.parent.getElementHeightFromClass(this.parent.element.querySelector("."+F2e),qNe),r=0<s.allDayElement.length?s.allDayElement[0].offsetTop:0,s.renderAllDayEvents(e,t,i,n,this.parent.allowInline,r,o)):s.renderNormalEvents(e,t,i,n,this.parent.allowInline)},OHe.prototype.createMonthViewInline=function(e,t,i,n){for(var o=this.getEventDaysCount(e),e=this.parent.eventBase.cloneEventObject(e,i,n,o,!1,!1),r=new MHe(this.parent),i=(r.dateRender=this.parent.activeView.renderDates,r.inlineValue=this.parent.allowInline,this.parent.activeView.renderDates),n=this.parent.activeViewOptions.workDays,o="."+JOe,s=(0<this.parent.activeViewOptions.group.resources.length&&(o+='[data-group-index="'+t+'"]',i=(s=this.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)]).renderDates,n=s.workDays),r.dateRender=i,r.workCells=[].slice.call(this.parent.element.querySelectorAll(o)),r.cellWidth=r.workCells[0].offsetWidth,r.cellHeight=r.workCells[0].offsetHeight,r.eventHeight=this.parent.getElementHeightFromClass(this.parent.monthModule.element||r.element,qNe),r.getSlotDates(n),r.getRenderedDates(i)),a=0,l=r.splitEvent(e,s||i);a<l.length;a++){var h=l[a];r.renderEvents(h,t)}this.parent.element.querySelector("."+h_e).focus()},OHe.prototype.createTimelineViewInline=function(e,t,i,n){var o=this.getEventDaysCount(e),e=this.parent.eventBase.cloneEventObject(e,t,i,o,!1,!1),t=new FHe(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day"),i=(t.dateRender=this.parent.activeView.renderDates,t.eventContainers=[].slice.call(this.parent.element.querySelectorAll("."+UNe)),this.parent.element.querySelector("."+JOe)),o=(t.inlineValue=this.parent.allowInline,t.cellWidth=i.offsetWidth,t.cellHeight=i.offsetHeight,0===this.parent.element.querySelectorAll("."+KOe+" tbody tr").length?0:this.parent.element.querySelectorAll("."+KOe+" tbody tr")[0].children.length);t.slotsPerDay=o/t.dateRender.length,t.eventHeight=this.parent.getElementHeightFromClass(t.element,qNe),t.renderEvents(e,n)},OHe.prototype.getEventDaysCount=function(e){var t=e[this.parent.eventFields.startTime],e=e[this.parent.eventFields.endTime];return Math.abs(e.getTime()-t.getTime())/iOe},OHe.prototype.generateEventData=function(e){var t=this.parent.element.querySelector("."+h_e),t=t?t.value:e?e.innerHTML:"",e={};return e[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),e[this.parent.eventFields.subject]=t,e[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,e[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,e[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.eventWindow.setDefaultValueToObject(e),this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(e,this.parent.activeCellsData.groupIndex),e},OHe.prototype.documentClick=function(e){e&&""!==e.value?this.inlineCrudActions(e):this.removeInlineAppointmentElement()},OHe.prototype.inlineCrudActions=function(e){var t;z(e,"."+d_e)?(t=this.generateEventData(e),this.parent.addEvent(t)):(t=z(e,"."+qNe),e=void((t=this.parent.getEventDetails(t))[this.parent.eventFields.subject]=e.value),t[this.parent.eventFields.id]===t[this.parent.eventFields.recurrenceID]&&(e="EditOccurrence",t[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID()),this.parent.saveEvent(t,e)),this.removeInlineAppointmentElement()},OHe.prototype.createInlineAppointmentElement=function(e){var t=Q("div",{className:qNe+" "+d_e}),i=Q("div",{className:KNe}),n=(t.appendChild(i),this.inlineInputEle=Q("input",{className:h_e}));return i.appendChild(n),e&&this.parent.eventBase.applyResourceColor(t,e,"backgroundColor"),t},OHe.prototype.removeInlineAppointmentElement=function(){var e,t=[].slice.call(this.parent.element.querySelectorAll("."+d_e)),t=(0<t.length&&t.forEach(function(e){var t=e.querySelector("."+h_e);je(t)||t.blur(),ue(e)}),this.getInlineElement());t&&(je(e=z(t,"."+qNe).querySelector("."+CVe))||q([e],UOe),ue(t)),this.inlineInputEle=null},OHe.prototype.getInlineElement=function(){return this.inlineInputEle},OHe.prototype.destroy=function(){this.inlineInputEle=null,this.parent.off(FRe,this.inlineEdit)};var RHe=OHe;function OHe(e){this.parent=e,this.parent.on(FRe,this.inlineEdit,this)}VHe.prototype.renderFormValidator=function(e,t,i,n){var o=this;this.element=i,this.formObj=new nN(e,{locale:n,customPlacement:function(e,t){o.errorPlacement(e,t)},rules:t,validationComplete:function(e){o.validationComplete(e)},focusout:function(e){o.focusOut(e)}})},VHe.prototype.focusOut=function(e){e=e.relatedTarget;e&&(e.classList.contains("e-dlg-closeicon-btn")||e.classList.contains("e-close")||e.classList.contains(YOe)||e.classList.contains(iNe)||e.classList.contains(G2e)||e.classList.contains(JOe)||e.classList.contains(BVe))?this.ignoreError=!0:this.ignoreError=!1},VHe.prototype.validationComplete=function(e){var t=this.element.querySelector("#"+e.inputName+"_Error");t&&(t.style.display="failure"===e.status?"":"none")},VHe.prototype.errorPlacement=function(e,t){var i=t.getAttribute("for"),n=this.element.querySelector("#"+i+"_Error");n||this.ignoreError||this.createTooltip(e,t,i,""),je(n)||(n.querySelector(".e-error").innerHTML=t.innerHTML)},VHe.prototype.createTooltip=function(e,t,i,n){var o,e=e.getBoundingClientRect(),r=(this.element.classList.contains(GVe)?(o=this.element,this.element):o=this.element.querySelector(".e-schedule-dialog .e-dlg-content")).getBoundingClientRect(),i=Q("div",{className:"e-tooltip-wrap e-popup "+jVe,id:i+"_Error",styles:"display:"+n+";top:"+(e.bottom-r.top+o.scrollTop+9)+"px;left:"+(e.left-r.left+o.scrollLeft+e.width/2)+"px;"}),n=Q("div",{className:"e-tip-content"}),r=(n.appendChild(t),Q("div",{className:"e-arrow-tip e-tip-top"}));r.appendChild(Q("div",{className:"e-arrow-tip-outer e-tip-top"})),r.appendChild(Q("div",{className:"e-arrow-tip-inner e-tip-top"})),i.appendChild(n),i.appendChild(r),o.appendChild(i),i.style.left=parseInt(i.style.left,10)-i.offsetWidth/2+"px"},VHe.prototype.destroyToolTip=function(){if(this.element)for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+jVe));e<t.length;e++)ue(t[e]);this.formObj&&this.formObj.element&&this.formObj.reset()},VHe.prototype.destroy=function(){this.formObj&&this.formObj.element&&!this.formObj.isDestroyed&&this.formObj.destroy(),this.formObj=null,this.element=null};var NHe=VHe;function VHe(){}HHe.prototype.render=function(){this.renderQuickPopup(),this.renderMorePopup(),this.renderQuickDialog()},HHe.prototype.renderQuickPopup=function(){var e=Q("div",{className:GVe+" e-popup-close",attrs:{role:"dialog"}});this.parent.isAdaptive?(document.body.appendChild(e),U([e],HOe)):this.parent.element.appendChild(e),this.quickPopup=new Sv(e,{targetType:this.parent.isAdaptive?"container":"relative",enableRtl:this.parent.enableRtl,open:this.quickPopupOpen.bind(this),close:this.quickPopupClose.bind(this),hideAnimation:this.parent.isAdaptive?{name:"ZoomOut"}:{name:"FadeOut",duration:150},showAnimation:this.parent.isAdaptive?{name:"ZoomIn"}:{name:"FadeIn",duration:150},collision:this.parent.isAdaptive?{X:"fit",Y:"fit"}:this.parent.enableRtl?{X:"flip",Y:"fit"}:{X:"none",Y:"fit"},position:this.parent.isAdaptive||this.parent.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"},viewPortElement:this.parent.isAdaptive?document.body:this.parent.element,zIndex:this.parent.isAdaptive?1004:3})},HHe.prototype.renderMorePopup=function(){var e='<div class="'+$2e+'"><div class="e-more-event-header"><div class="'+nVe+'" title="'+this.l10n.getConstant("close")+'" tabindex="0" role="button"></div><div class="'+eVe+'"><div class="'+tVe+'" id="'+this.parent.element.id+'_more_popup"></div><div class="'+iVe+" "+d2e+'" tabindex="0" role="link"></div></div></div></div>',e=Q("div",{className:Z2e+" e-popup-close",innerHTML:e}),e=(this.parent.isAdaptive?(document.body.appendChild(e),U([e],HOe)):this.parent.element.appendChild(e),this.morePopup=new Sv(e,{targetType:this.parent.isAdaptive?"container":"relative",enableRtl:this.parent.enableRtl,hideAnimation:{name:"ZoomOut",duration:300},showAnimation:{name:"ZoomIn",duration:300},open:this.morePopupOpen.bind(this),close:this.morePopupClose.bind(this),collision:this.parent.isAdaptive?{X:"fit",Y:"fit"}:this.parent.enableRtl?{X:"flip",Y:"fit"}:{X:"flip",Y:"flip"},viewPortElement:this.parent.isAdaptive?document.body:this.parent.element,zIndex:this.parent.isAdaptive?1002:2}),this.morePopup.element.setAttribute("role","dialog"),this.morePopup.element.setAttribute("aria-labelledby",this.parent.element.id+"_more_popup"),this.morePopup.element.querySelector("."+nVe));this.renderButton("e-round",WOe+" "+zVe,!1,e,this.closeClick),E.add(this.morePopup.element.querySelector("."+iVe),"click",this.navigationClick,this)},HHe.prototype.renderQuickDialog=function(){var e=[{buttonModel:{cssClass:"e-quick-alertok e-flat",isPrimary:!0},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-quick-alertcancel e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-quick-dialog-cancel e-disable e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)}],t=(this.parent.eventSettings.editFollowingEvents&&(t={buttonModel:{cssClass:"e-quick-alertfollowing e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)},e.splice(1,0,t)),this.quickDialog=new pS({animationSettings:{effect:"Zoom"},buttons:e,cssClass:"e-quick-dialog",closeOnEscape:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeClose:this.beforeQuickDialogClose.bind(this),isModal:!0,position:{X:"center",Y:"center"},showCloseIcon:!0,target:document.body,visible:!1,width:"auto"}),Q("div",{id:this.parent.element.id+"QuickDialog"})),e=(this.parent.element.appendChild(t),this.quickDialog.appendTo(t),this.quickDialog.element.querySelector("."+cVe)),t=(e&&(e.setAttribute("aria-label",this.l10n.getConstant("occurrence")),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.element.querySelector("."+uVe));t&&(t.setAttribute("aria-label",this.l10n.getConstant("series")),t.setAttribute("aria-label",t.innerHTML)),this.quickDialog.element.querySelector(".e-dlg-closeicon-btn")&&this.quickDialog.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close"))},HHe.prototype.renderButton=function(e,t,i,n,o){new zv({cssClass:e,disabled:i,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,iconCss:t}).appendTo(n),E.add(n,"click",o,this),q([n],WOe)},HHe.prototype.quickDialogClass=function(e){var t=[sVe,aVe,dVe,pVe,mVe,UOe],i=this.quickDialog.element.querySelector("."+cVe),n=this.quickDialog.element.querySelector("."+uVe),o=this.quickDialog.element.querySelector("."+gVe);switch(q([i,n],t),U([this.quickDialog.element.querySelector("."+pVe)],UOe),this.parent.eventSettings.editFollowingEvents&&(U([o],UOe),q([this.quickDialog.element],hVe)),e){case"Recurrence":U([i],sVe),U([n],aVe),this.parent.eventSettings.editFollowingEvents&&(q([o],UOe),U([this.quickDialog.element],hVe),U([o],lVe));break;case"Delete":U([i],dVe),U([n],pVe);break;case"Alert":U([i],[cVe,mVe]),U([n],[uVe,UOe])}},HHe.prototype.applyFormValidation=function(){var e=this.quickPopup.element.querySelector("."+yVe),t={};t[this.parent.eventSettings.fields.subject.name]=this.parent.eventSettings.fields.subject.validation,this.fieldValidator.renderFormValidator(e,t,this.quickPopup.element,this.parent.locale)},HHe.prototype.openRecurrenceAlert=function(){var e=this.quickDialog.element.querySelector("."+cVe),e=(e&&(e.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteEvent":"editEvent"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.element.querySelector("."+gVe)),e=(e&&(e.innerHTML=this.l10n.getConstant("editFollowingEvent"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.element.querySelector("."+uVe));e&&(e.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteSeries":"editSeries"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.content=this.l10n.getConstant("editContent"),this.quickDialog.header=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteTitle":"editTitle"),this.quickDialogClass("Recurrence"),this.showQuickDialog("RecurrenceAlert")},HHe.prototype.openRecurrenceValidationAlert=function(e){this.quickDialogClass("Alert");var t,i=this.quickDialog.element.querySelector("."+cVe),n=(i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML),this.quickDialog.element.querySelector("."+uVe));switch(n.innerHTML=this.l10n.getConstant("cancel"),n.setAttribute("aria-label",n.innerHTML),this.quickDialog.header=this.l10n.getConstant("alert"),e){case"wrongPattern":U([n],UOe),this.quickDialog.content=this.l10n.getConstant("wrongPattern");break;case"createError":U([n],UOe),this.quickDialog.content=this.l10n.getConstant("createError");break;case"sameDayAlert":U([n],UOe),this.quickDialog.content=this.l10n.getConstant("sameDayAlert");break;case"seriesChangeAlert":q([n,t=this.quickDialog.element.querySelector("."+pVe)],UOe),this.quickDialog.content=this.l10n.getConstant("seriesChangeAlert"),i.innerHTML=this.l10n.getConstant("yes"),n.innerHTML=this.l10n.getConstant("no"),t.innerHTML=this.l10n.getConstant("cancel");break;case"occurrenceAlert":U([n],UOe),this.quickDialog.content=this.l10n.getConstant("occurenceAlert")}(!this.parent.enableRecurrenceValidation&&"wrongPattern"===e||this.parent.enableRecurrenceValidation)&&this.showQuickDialog("RecurrenceValidationAlert")},HHe.prototype.openDeleteAlert=function(){var e;this.parent.activeViewOptions.readonly||((e=this.quickDialog.element.querySelector("."+cVe))&&(e.innerHTML=this.l10n.getConstant("delete"),e.setAttribute("aria-label",e.innerHTML)),(e=this.quickDialog.element.querySelector("."+uVe))&&(e.innerHTML=this.l10n.getConstant("cancel"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.content=1<this.parent.activeEventData.event.length?this.l10n.getConstant("deleteMultipleContent"):this.l10n.getConstant("deleteContent"),this.quickDialog.header=1<this.parent.activeEventData.event.length?this.l10n.getConstant("deleteMultipleEvent"):this.l10n.getConstant("deleteEvent"),this.quickDialogClass("Delete"),this.showQuickDialog("DeleteAlert"))},HHe.prototype.openValidationError=function(e,t){this.quickDialog.header=this.l10n.getConstant("alert"),this.quickDialog.content=this.l10n.getConstant(e);var i=this.quickDialog.element.querySelector("."+cVe),n=(i&&(i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML)),this.quickDialog.element.querySelector("."+uVe));n&&(n.innerHTML=this.l10n.getConstant("cancel"),i.setAttribute("aria-label",n.innerHTML)),this.quickDialogClass("Alert"),this.showQuickDialog("overlapAlert"===e?"OverlapAlert":"ValidationAlert",t)},HHe.prototype.showQuickDialog=function(e,t){var i=this,e=(this.quickDialog.dataBind(),{type:e,cancel:!1,element:this.quickDialog.element,data:Pe({},t||this.parent.activeEventData.event,null,!0)});this.parent.activeViewOptions.allowOverlap||(e.overlapEvents=this.parent.overlapAppointments),this.parent.trigger(MRe,e,function(e){e.cancel||i.quickDialog.show()})},HHe.prototype.createMoreEventList=function(e,n,o){var r=this,s=this.parent.eventFields,t=Q("div",{className:oVe}),a=Q("div",{className:rVe});if(0===e.length)a=Q("div",{className:oVe,innerHTML:this.l10n.getConstant("emptyContainer")});else for(var l=this,i=0,h=e;i<h.length;i++)!function(t){var e=t[s.subject]||l.parent.eventSettings.fields.subject.default||l.parent.localeObj.getConstant("addTitle"),i=Q("div",{className:qNe,attrs:{"data-id":""+t[s.id],"data-guid":t.Guid,role:"button",tabindex:"0","aria-disabled":l.parent.eventBase.getReadonlyAttribute(t),"aria-label":l.parent.getAnnouncementString(t)}}),e=(t[s.isReadonly]&&U([i],"e-read-only"),je(l.parent.activeViewOptions.eventTemplate)?(i.appendChild(Q("div",{className:CVe})),l.parent.sanitize(e,i.firstElementChild)):(e=l.parent.element.id+"_"+l.parent.activeViewOptions.eventTemplateName+"eventTemplate",ht(l.parent.getAppointmentTemplate()(t,l.parent,"eventTemplate",e,!1,void 0,void 0,l.parent.root),i)),je(o)||i.setAttribute("data-group-index",o),je(t[s.recurrenceRule])||(e=t[s.id]===t[s.recurrenceID]?k2e:P2e,i.appendChild(Q("div",{className:WOe+" "+e}))),{data:Pe({},t,null,!0),element:i,cancel:!1});l.parent.trigger(ERe,e,function(e){e.cancel||(a.appendChild(i),e=r.parent.isAdaptive||"Year"===r.parent.currentView,r.parent.eventBase.wireAppointmentEvents(i,t,e),r.parent.eventBase.applyResourceColor(i,t,"backgroundColor",n))})}(h[i]);return t.appendChild(a),t},HHe.prototype.tapHoldEventPopup=function(e){var t,i,n=z(e.target,"."+qNe),o=(this.parent.selectedElements=[],this.isMultipleEventSelect=!0,this.parent.eventBase.getSelectedEventElements(n),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),n.getAttribute("data-guid")),o=this.parent.eventBase.getEventByGuid(o);je(o)||(t=o[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"),t='<div class="e-multiple-event-popup"><div class="'+W2e+'"><button class="e-close" title="'+this.l10n.getConstant("close")+'"></button><div class="'+CVe+'">'+t+'</div><button class="e-edit" title="'+this.l10n.getConstant("edit")+'"></button><button class="'+VVe+'" title="'+this.l10n.getConstant("delete")+'"></button></div></div>',this.quickPopup.element.innerHTML=t,t=this.quickPopup.element.querySelector("."+HVe),this.renderButton("e-flat e-round e-small",WOe+" "+zVe,!1,t,this.closeClick),t=this.parent.activeViewOptions.readonly||o[this.parent.eventFields.isReadonly],o=!this.parent.eventSettings.allowEditing||t,t=!this.parent.eventSettings.allowDeleting||t,(i=this.quickPopup.element.querySelector("."+OVe))&&this.renderButton("e-flat e-round e-small",WOe+" "+NVe,o,i,this.editClick),(o=this.quickPopup.element.querySelector("."+VVe))&&this.renderButton("e-flat e-round e-small",WOe+" "+_Ve,t,o,this.deleteClick),this.beforeQuickPopupOpen(n,this.parent.eventBase.getPageCoordinates(e)))},HHe.prototype.isCellBlocked=function(e){var t={};return t[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,t[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,t[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,0<this.parent.activeViewOptions.group.resources.length&&(e=e.element instanceof Array?e.element[0]:e.element,e=parseInt(e.getAttribute("data-group-index"),10),this.parent.resourceBase.setResourceValues(t,isNaN(e)?null:e)),this.parent.eventBase.isBlockRange(t)},HHe.prototype.cellClick=function(e){var t,i,n=new Date(e.startTime.getTime());this.parent.showQuickInfo&&this.parent.eventSettings.allowAdding&&"MonthAgenda"!==this.parent.currentView&&!this.isCellBlocked(e)&&this.parent.isMinMaxDate(new Date(n.setHours(0,0,0,0)))?(n=je(e.event)?e.element:e.event.target,this.parent.isAdaptive?(this.quickPopupHide(),je(i=this.parent.element.querySelector("."+w2e))&&(i=Q("div",{className:w2e,innerHTML:'<div class="e-title">+ '+this.l10n.getConstant("newEvent")+"</div>"})),(t=z(n,"."+JOe+",."+YOe))&&t.appendChild(i)):je(t=z(n,"."+JOe+",."+YOe+",."+iNe))||n.classList.contains(H2e)||(this.quickPopup.relateTo===t&&this.quickPopup.element.classList.contains($Oe)?(i=this.quickPopup.element.querySelector("."+CVe))&&i.focus():(this.quickPopup.element&&this.destroyPopupButtons("quickPopup"),(n={})[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,n[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,n[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,(i=Q("div",{className:z2e})).appendChild(this.getPopupHeader("Cell",n)),i.appendChild(this.getPopupContent("Cell",e,n)),i.appendChild(this.getPopupFooter("Cell",n)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("newEvent")),(n=i.querySelector("."+CVe))&&HF.createInput({element:n,properties:{placeholder:this.l10n.getConstant("addTitle")}}),je(this.parent.eventSettings.fields.subject.default)||(n.value=this.parent.eventSettings.fields.subject.default),(n=i.querySelector("."+HVe))&&this.renderButton("e-flat e-round e-small",WOe+" "+zVe,!1,n,this.popupClose),(n=i.querySelector("."+G2e))&&this.renderButton("e-flat","",!1,n,this.detailsClick),(n=i.querySelector("."+Y2e))&&this.renderButton("e-flat e-primary","",this.parent.activeViewOptions.readonly,n,this.saveClick),this.morePopup&&this.morePopup.hide(),this.quickPopup.content=i,this.quickPopup.relateTo=t,this.quickPopup.dataBind(),this.beforeQuickPopupOpen(t,this.parent.eventBase.getPageCoordinates(e.event))))):this.quickPopupHide()},HHe.prototype.isSameEventClick=function(e){return!(this.quickPopup.relateTo!==z(e.element,"."+qNe)||!this.quickPopup.element.classList.contains($Oe)||((e=this.quickPopup.element.querySelector("."+OVe))&&e.focus(),this.parent.isAdaptive||(e=this.quickPopup.element.querySelector("."+X2e))&&e.focus(),0))},HHe.prototype.isQuickTemplate=function(e){return"Both"===this.parent.quickInfoTemplates.templateType||this.parent.quickInfoTemplates.templateType===e},HHe.prototype.eventClick=function(e){var t,i,n,o,r;this.parent.eventTooltip&&this.parent.eventTooltip.close(),this.parent.showQuickInfo&&(this.parent.isAdaptive&&this.isMultipleEventSelect?this.updateTapHoldEventPopup(z(e.element,"."+qNe)):(n=this.isSameEventClick(e),this.parent.selectedElements=[],n||(this.quickPopup.element&&this.destroyPopupButtons("quickPopup"),n=e.event,(t=Q("div",{className:j2e})).appendChild(this.getPopupHeader("Event",n)),t.appendChild(this.getPopupContent("Event",e,n)),t.appendChild(this.getPopupFooter("Event",n)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("editEvent")),n=this.parent.activeViewOptions.readonly||n[this.parent.eventFields.isReadonly],i=!this.parent.eventSettings.allowEditing||n,n=!this.parent.eventSettings.allowDeleting||n,o="e-flat e-round e-small",(r=t.querySelector("."+OVe))&&this.renderButton(o,WOe+" "+NVe,i,r,this.editClick),(r=t.querySelector("."+VVe))&&this.renderButton(o,WOe+" "+_Ve,n,r,this.deleteClick),(r=t.querySelector("."+HVe))&&this.renderButton(o,WOe+" "+zVe,!1,r,this.popupClose),(o=t.querySelector("."+X2e))&&this.renderButton("e-flat e-primary","",i,o,this.editClick),(r=t.querySelector("."+K2e))&&this.renderButton("e-flat","",n,r,this.deleteClick),this.morePopup&&!z(e.element,"."+rVe)&&this.morePopup.hide(),this.quickPopup.content=t,this.quickPopup.relateTo=this.parent.isAdaptive?document.body:z(e.element,"."+qNe),this.quickPopup.dataBind(),this.beforeQuickPopupOpen(e.element,this.parent.eventBase.getPageCoordinates(e.originalEvent)))))},HHe.prototype.getPopupHeader=function(e,t){var i=Q("div",{className:W2e});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.header){var n=Pe({},t,{elementType:e.toLowerCase()},!0),o=this.parent.element.id,n=[].slice.call(this.parent.getQuickInfoTemplatesHeader()(n,this.parent,"header",o+"_headerTemplate",!1));ht([].slice.call(n),i)}else{var r=void 0,s=void 0;switch(e){case"Cell":r='<div class="'+Q2e+'"><button class="'+HVe+'" title="'+this.l10n.getConstant("close")+'"></button></div>';break;case"Event":s=this.getFormattedString(t),r='<div class="'+Q2e+'"><button class="e-edit e-icons" title="'+this.l10n.getConstant("edit")+'"></button><button class="'+VVe+" "+WOe+'" title="'+this.l10n.getConstant("delete")+'"></button><button class="e-close" title="'+this.l10n.getConstant("close")+'"></button></div><div class="'+JNe+'"><div class="'+CVe+" "+J2e+'" title="'+(s.eventSubject&&s.eventSubject.replaceAll('"',"'"))+'"></div></div >'}o=Q("div",{innerHTML:r});"Event"===e&&(n=o.querySelector("."+CVe),this.parent.sanitize(s.eventSubject,n)),ht([].slice.call(o.childNodes),i)}return i},HHe.prototype.getPopupContent=function(e,t,i){var n=Q("div",{className:"e-popup-content"});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.content){var o=Pe({},i,{elementType:e.toLowerCase()},!0),r=this.parent.element.id,o=[].slice.call(this.parent.getQuickInfoTemplatesContent()(o,this.parent,"content",r+"_contentTemplate",!1));ht([].slice.call(o),n)}else{var s,a=void 0,r=this.getResourceText(t,e.toLowerCase());switch(e){case"Cell":s=this.getFormattedString(i),a='<table class="e-popup-table"><tbody><tr><td><form class="'+yVe+'" onsubmit="return false;"><input class="'+CVe+' e-field" type="text" name="'+this.parent.eventFields.subject+'" /></form></td></tr><tr><td><div class="'+u2e+'"><div class="'+i_e+" "+WOe+'"></div><div class="'+q2e+" "+J2e+'">'+s.details+"</div></div>"+(0<this.parent.activeViewOptions.group.resources.length?'<div class="'+$Ve+'"><div class="'+e_e+" "+WOe+' "></div><div class="'+t_e+" "+J2e+'"></div></div>':"")+"</td></tr></tbody></table>";break;case"Event":s=this.getFormattedString(i),a='<div class="'+u2e+'"><div class="'+i_e+" "+WOe+'"></div><div class="e-date-time-wrapper '+J2e+'"><div class="'+q2e+" "+J2e+'">'+s.details+"</div>",i[this.parent.eventFields.recurrenceRule]&&(a+='<div class="e-recurrence-summary '+J2e+'">'+this.getRecurrenceSummary(i)+"</div>"),a+="</div></div>",i[this.parent.eventFields.location]&&(a+='<div class="'+SVe+'"><div class="e-location-icon '+WOe+'"></div><div class="'+AVe+" "+J2e+'"></div></div>'),(i[this.parent.eventFields.startTimezone]||i[this.parent.eventFields.endTimezone])&&(a+='<div class="'+bVe+'"><div class="e-time-zone-icon '+WOe+'"></div><div class="e-time-zone-details '+J2e+'">'+this.getTimezone(i)+"</div></div>"),i[this.parent.eventFields.description]&&(a+='<div class="'+TVe+'"><div class="e-description-icon '+WOe+'"></div><div class="'+EVe+" "+J2e+'"></div></div>'),0<this.parent.resourceCollection.length&&(a+='<div class="'+$Ve+'"><div class="'+e_e+" "+WOe+'"></div><div class="'+t_e+" "+J2e+'"></div></div>')}o=Q("div",{innerHTML:a});!i[this.parent.eventFields.location]||je(t=o.querySelector("."+AVe))||this.parent.sanitize(i[this.parent.eventFields.location],t),!i[this.parent.eventFields.description]||je(e=o.querySelector("."+EVe))||this.parent.sanitize(i[this.parent.eventFields.description],e),!r||je(t=o.querySelector("."+t_e))||this.parent.sanitize(r,t),ht([].slice.call(o.childNodes),n)}return n},HHe.prototype.getPopupFooter=function(e,t){var i=Q("div",{className:U2e});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.footer){var t=Pe({},t,{elementType:e.toLowerCase()},!0),n=this.parent.element.id,t=[].slice.call(this.parent.getQuickInfoTemplatesFooter()(t,this.parent,"footer",n+"_footerTemplate",!1));ht([].slice.call(t),i)}else{var o=void 0;switch(e){case"Cell":o='<button class="'+G2e+" "+J2e+'" title="'+this.l10n.getConstant("moreDetails")+'">'+this.l10n.getConstant("moreDetails")+'</button><button class="'+Y2e+" "+J2e+'" title="'+this.l10n.getConstant("save")+'">'+this.l10n.getConstant("save")+"</button>";break;case"Event":o=this.parent.isAdaptive?"":'<button class="'+X2e+" "+J2e+'" title="'+this.l10n.getConstant("edit")+'">'+this.l10n.getConstant("edit")+'</button><button class="'+K2e+" "+J2e+'" title="'+this.l10n.getConstant("delete")+'">'+this.l10n.getConstant("delete")+"</button>"}n=Q("div",{innerHTML:o});ht([].slice.call(n.childNodes),i)}return i},HHe.prototype.getResourceText=function(e,t){if(0===this.parent.resourceCollection.length)return null;var o="";if(0===this.parent.activeViewOptions.group.resources.length){var r=this.parent.resourceBase.resourceCollection.slice(-1)[0],s=r.dataSource;if("event"===t)for(var a=e.event,i=0,n=s;i<n.length;i++)!function(e){var t,i,n=a[r.field];n instanceof Array?-1<n.indexOf(e[r.idField])&&(t=n[n.indexOf(e[r.idField])],i=s.filter(function(e){return e[r.idField]===t})[0],o+=""===o?i[r.textField]:", "+i[r.textField]):e[r.idField]===n&&(o=e[r.textField].toString())}(n[i]);else o=s[0][r.textField].toString()}else if("event"===t){for(var l,a=e.event,s=void 0,h=this.parent.resourceBase.resourceCollection.length-1;0<=h;h--)if(!je(s=a[this.parent.resourceBase.resourceCollection[parseInt(h.toString(),10)].field])){l=this.parent.resourceBase.resourceCollection[parseInt(h.toString(),10)];break}Array.isArray(s)||(s=[s]);var d=[],p=l.dataSource;s.forEach(function(e){var t,e=DOe(p,l.idField,e);(t=-1<e?p[parseInt(e.toString(),10)][l.textField]:t)&&d.push(t)}),o=d.join(", ")}else t=je(e.groupIndex)?0:e.groupIndex,e=this.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)],o=e.resourceData[e.resource.textField];return o},HHe.prototype.getFormattedString=function(e){var t=this.parent.eventFields,i=e[t.subject]||this.l10n.getConstant("noTitle"),n=e[t.startTime],o=e[t.endTime],r=this.getDateFormat(n,"long"),s=e[t.isAllDay]&&0===o.getHours()&&0===o.getMinutes()?this.getDateFormat(yOe(new Date(o.getTime()),-1),"long"):this.getDateFormat(o,"long"),a=this.parent.getTimeString(n),l=this.parent.getTimeString(o),h="",d=o.getDate()!==n.getDate()&&(o.getTime()-n.getTime())/36e5<24?1:0;return e[t.isAllDay]?(h=r+" ("+this.l10n.getConstant("allDay")+")",1<(BOe(o)-BOe(n))/iOe&&(h+="&nbsp;-&nbsp;"+s+" ("+this.l10n.getConstant("allDay")+")")):h=1<=(BOe(o)-BOe(n))/iOe||0<d?r+" ("+a+")&nbsp;-&nbsp;"+s+" ("+l+")":r+" ("+a+"&nbsp;-&nbsp;"+l+")",{eventSubject:i,details:h}},HHe.prototype.moreEventClick=function(t,e,i){var n,o=this,r=(this.quickPopupHide(!0),this.morePopup.element.querySelector("."+oVe)),r=(r&&ue(r),t.date.getTime().toString()),s=z(t.element,"."+H2e+",."+JOe),a=this.parent.globalize.formatDate(t.date,{format:"E",calendar:this.parent.getCalendarMode()}),a=(this.morePopup.element.querySelector("."+tVe).innerHTML=ROe(a,"single"),this.morePopup.element.querySelector("."+iVe)),r=(a.innerHTML=this.getDateFormat(t.date,"d"),a.setAttribute("data-date",r),a.setAttribute("data-end-date",e.getTime().toString()),je(i)||(a.setAttribute("data-group-index",i),n=this.parent.resourceBase.lastResourceLevel[parseInt(i,10)].groupOrder),this.createMoreEventList(t.event,n,i));if(this.morePopup.element.querySelector("."+$2e).appendChild(r),q(this.morePopup.element.querySelector("."+eVe).childNodes,sNe),gOe(t.date).getTime()===gOe(this.parent.getCurrentTime()).getTime()&&U(this.morePopup.element.querySelector("."+eVe).childNodes,sNe),!this.parent.isAdaptive)if(-1!==this.parent.currentView.indexOf("Timeline")){var e=s.getAttribute("data-group-index"),a=new Date(parseInt(s.getAttribute("data-start-date"),10)),l=(a.setHours(a.getHours(),a.getMinutes(),0),a.getTime().toString());if(je(e))this.morePopup.relateTo=this.parent.element.querySelector("."+i2e+' tbody tr td[data-date="'+l+'"]');else if(this.morePopup.relateTo=this.parent.element.querySelector("."+i2e+' tbody tr td[data-group-index="'+e+'"][data-date="'+l+'"]'),je(this.morePopup.relateTo))for(var h=[].slice.call(this.parent.element.querySelectorAll("."+i2e+' tbody tr td[data-group-index="'+e+'"]')),d=0;d<h.length;d++)h[parseInt(d.toString(),10)].getAttribute("data-date")<l&&(this.morePopup.relateTo=h[parseInt(d.toString(),10)])}else this.morePopup.relateTo=z(s,"."+JOe);this.parent.renderTemplates(function(){var e={type:"EventContainer",cancel:!1,element:o.morePopup.element,data:t};o.parent.trigger(MRe,e,function(e){e.cancel||o.morePopup.show()})})},HHe.prototype.saveClick=function(e){this.applyFormValidation(),this.dialogEvent=e,this.isCrudAction=!0,this.quickPopupHide()},HHe.prototype.detailsClick=function(e){var t=this.quickPopup.element.querySelector("."+CVe);t&&""!==t.value&&Pe(this.parent.activeCellsData,{subject:t.value}),this.dialogEvent=e,this.isCrudAction=!1,this.fieldValidator.destroyToolTip(),this.quickPopupHide(),this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add")},HHe.prototype.editClick=function(e){this.dialogEvent=e,this.quickPopupHide(!0);e=this.parent.activeEventData.event;this.parent.currentAction="EditSeries",je(e[this.parent.eventFields.recurrenceRule])?this.parent.eventWindow.openEditor(e,this.parent.currentAction):(this.parent.currentAction="EditOccurrence",this.openRecurrenceAlert())},HHe.prototype.deleteClick=function(e){this.dialogEvent=e,this.quickPopupHide(!0),this.parent.currentAction="Delete",this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule]?this.openRecurrenceAlert():this.openDeleteAlert()},HHe.prototype.updateMoreEventContent=function(){var e,t,i,n,o;this.morePopup.element.classList.contains("e-popup-close")||((e=this.morePopup.element.querySelector("."+oVe))&&ue(e),e=this.morePopup.element.querySelector("."+iVe),n=new Date(parseInt(e.getAttribute("data-date"),10)),o=new Date(parseInt(e.getAttribute("data-end-date"),10)),je(e=e.getAttribute("data-group-index"))||(i=(t=this.parent.resourceBase.lastResourceLevel[parseInt(e,10)]).groupOrder),n=this.parent.eventBase.filterEvents(n,o,this.parent.eventsProcessed,t),o=this.createMoreEventList(n,i,e),this.morePopup.element.querySelector("."+$2e).appendChild(o))},HHe.prototype.closeClick=function(e){this.dialogEvent=e,"Year"===this.parent.currentView&&this.parent.activeCellsData&&this.parent.activeCellsData.element&&this.parent.selectCell(this.parent.activeCellsData.element),this.quickPopupHide(),this.morePopup.hide()},HHe.prototype.dialogButtonClick=function(e){this.dialogEvent=e,this.quickDialog.hide();var t=e.target,i=this.quickDialog.element.querySelector("."+uVe),n=this.parent.activeEventData.event;if(t.classList.contains(sVe))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteOccurrence":"EditOccurrence",this.parent.currentAction){case"EditOccurrence":this.parent.eventWindow.openEditor(n,this.parent.currentAction);break;case"DeleteOccurrence":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else if(t.classList.contains(lVe))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteFollowingEvents":"EditFollowingEvents",this.parent.currentAction){case"EditFollowingEvents":this.parent.eventWindow.openEditor(n,this.parent.currentAction);break;case"DeleteFollowingEvents":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else if(t.classList.contains(aVe))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteSeries":"EditSeries",this.parent.currentAction){case"EditSeries":this.parent.eventWindow.openEditor(this.parent.eventBase.getParentEvent(n,!0),this.parent.currentAction);break;case"DeleteSeries":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else t.classList.contains(dVe)?this.parent.crudModule.deleteEvent(n,this.parent.currentAction):!i.classList.contains(UOe)&&(t.classList.contains(cVe)||t.classList.contains(uVe)&&!i.classList.contains(pVe))&&(this.parent.uiStateValues.isIgnoreOccurrence=t.classList.contains(uVe),this.parent.eventWindow.eventSave(e,this.l10n.getConstant("ok")))},HHe.prototype.updateTapHoldEventPopup=function(e){var t,e=this.parent.eventBase.getSelectedEventElements(e);this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),0<e.length?(t=this.parent.eventBase.getEventByGuid(e[0].getAttribute("data-guid")),t=1===e.length?t[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"):"("+e.length+")&nbsp;"+this.l10n.getConstant("selectedItems"),this.quickPopup.element.querySelector("."+CVe).innerHTML=t,(1<e.length?U:q)([this.quickPopup.element.querySelector("."+NVe)],UVe)):(this.parent.selectedElements=[],this.quickPopupHide())},HHe.prototype.getTimezone=function(e){var t="";return(t+=e[this.parent.eventFields.startTimezone]||"")+(t?" - ":"")+(e[this.parent.eventFields.endTimezone]||"")},HHe.prototype.getRecurrenceSummary=function(e){var t=this.parent.eventWindow.getRecurrenceEditorInstance();return t?(t=t.getRuleSummary(e[this.parent.eventFields.recurrenceRule])).charAt(0).toUpperCase()+t.slice(1):""},HHe.prototype.getDateFormat=function(e,t){return ROe(this.parent.globalize.formatDate(e,{skeleton:t,calendar:this.parent.getCalendarMode()}),"single")},HHe.prototype.getDataFromTarget=function(e){var t;return e.classList.contains(qNe)?this.parent.activeEventData.event:(e={startTime:this.parent.activeCellsData.startTime,endTime:this.parent.activeCellsData.endTime,isAllDay:this.parent.activeCellsData.isAllDay,groupIndex:this.parent.activeCellsData.groupIndex},t=this.parent.activeCellsData,this.parent.eventWindow.convertToEventData(t,e),e)},HHe.prototype.beforeQuickDialogClose=function(e){var t=this,e={event:e.event||this.dialogEvent,type:je(this.parent.activeEventData.event)?"ValidationAlert":je(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])?"DeleteAlert":"RecurrenceAlert",cancel:!1,data:this.parent.activeEventData.event,element:this.quickDialog.element};this.parent.trigger(kRe,e,function(e){e.cancel||t.parent.eventBase.focusElement(!0)})},HHe.prototype.beforeQuickPopupOpen=function(h,d){var p=this;this.parent.renderTemplates(function(){var a=p.quickPopup.element.querySelector("."+j2e),l=p.parent.isAdaptive?a?"ViewEventInfo":"EditEventInfo":"QuickInfo",e={type:l,cancel:!1,data:Pe({},p.getDataFromTarget(h),null,!0),target:h,element:p.quickPopup.element};p.parent.trigger(MRe,e,function(e){var t,i,n,o,r,s;e.cancel?(p.quickPopupHide(),p.destroyPopupButtons("quickPopup"),e.element.classList.contains($Oe)&&p.quickPopupClose(),kOe(p.quickPopup.element),p.isMultipleEventSelect=!1):(e=p.quickPopup.element.style.display,p.quickPopup.element.style.display="block",p.parent.isAdaptive?(p.quickPopup.element.removeAttribute("style"),p.quickPopup.element.style.display="block",p.quickPopup.element.style.height=T("EditEventInfo"==l?65:window.innerHeight)):(i=p.parent.virtualScrollModule&&p.parent.virtualScrollModule.isHorizontalScroll&&!je(z(h,"."+KOe)),t=p.parent.element.querySelector("."+i2e+" table"),p.quickPopup.offsetX=i&&!p.parent.enableRtl?sOe(t)+10:10,p.quickPopup.offsetY=p.parent.virtualScrollModule&&!p.parent.virtualScrollModule.isHorizontalScroll?p.quickPopup.offsetY:0,p.quickPopup.collision={X:p.parent.enableRtl?"flip":"none",Y:"fit"},p.quickPopup.position={X:p.parent.enableRtl?"left":"right",Y:p.parent.enableRtl?"bottom":"top"},p.quickPopup.dataBind(),p.quickPopup.refreshPosition(null,!0),-1<(s=Y0(p.quickPopup.element,p.parent.element)).indexOf(p.parent.enableRtl?"left":"right")&&(p.quickPopup.offsetX=-h.offsetWidth-10-p.quickPopup.element.offsetWidth,i&&!p.parent.enableRtl&&(p.quickPopup.offsetX=sOe(t)+p.quickPopup.offsetX),p.quickPopup.dataBind(),p.quickPopup.refreshPosition(null,!0),-1<Y0(p.quickPopup.element,p.parent.element).indexOf("left"))&&(p.quickPopup.position={X:"center",Y:"center"},p.quickPopup.collision={X:"fit",Y:"fit"},p.quickPopup.offsetX=-p.quickPopup.element.offsetWidth/2,p.quickPopup.dataBind()),p.parent.virtualScrollModule&&!p.parent.virtualScrollModule.isHorizontalScroll&&(-1<s.indexOf("top")||-1<s.indexOf("bottom"))&&(i=rOe(t),p.quickPopup.offsetY=i,p.quickPopup.dataBind(),p.quickPopup.refreshPosition(null,!0)),"center"===p.quickPopup.position.X&&"center"===p.quickPopup.position.Y&&!je(d)&&d.clientX&&d.clientY&&(s=d.clientX,t=d.clientY,i=h.getBoundingClientRect(),i=d.offsetY||Math.ceil(t-i.y),n=p.quickPopup.offsetY,o=Y0(p.quickPopup.element,h),r=p.quickPopup.element.getBoundingClientRect(),s=document.elementFromPoint(s,t),-1<o.indexOf("top")||-1<o.indexOf("bottom")||z(s,"."+GVe))&&(r.top<=t&&t<=r.top+r.height?(p.quickPopup.offsetY=n-r.height-10,p.quickPopup.dataBind(),-1<(o=Y0(p.quickPopup.element,p.parent.element)).indexOf("top")&&(p.quickPopup.offsetY=n+i+10,p.quickPopup.dataBind())):-1<Y0(p.quickPopup.element,p.parent.element).indexOf("bottom")&&(p.quickPopup.offsetY=n-i-Math.ceil(r.height)-10,p.quickPopup.dataBind()))),a&&p.applyEventColor(),p.quickPopup.element.style.display=e,p.quickPopup.dataBind(),p.quickPopup.show())})})},HHe.prototype.applyEventColor=function(){var e,t,i="",i="Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView?this.parent.enableRtl?"border-right-color":"border-left-color":"background-color",i=this.parent.activeEventData.element.style[i];""!==i&&(e=this.quickPopup.element.querySelector("."+W2e),(t=this.quickPopup.element.querySelector("."+U2e))&&t.offsetParent&&(e=this.quickPopup.element.querySelector("."+CVe))&&(i="rgba("+(e.style.borderLeftColor=i).match(/\d+/g).join()+",0.3)"),e)&&(e.style.backgroundColor=i)},HHe.prototype.quickPopupOpen=function(){var e;this.parent.isAdaptive?this.quickPopup.element.style.top="0px":this.quickPopup.element.querySelector("."+z2e)?(e=this.quickPopup.element.querySelector("."+CVe))&&e.focus():((e=this.quickPopup.element.querySelector("."+X2e))&&e.focus(),(e=this.quickPopup.element.querySelector("."+OVe))&&e.focus())},HHe.prototype.quickPopupClose=function(){this.parent.eventBase.focusElement(),this.quickPopup.relateTo="."+JOe,this.fieldValidator.destroyToolTip(),this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.destroyPopupButtons("quickPopup"),kOe(this.quickPopup.element)},HHe.prototype.morePopupOpen=function(){this.parent.isAdaptive?(this.morePopup.element.style.top="0px",this.morePopup.element.style.left="0px",this.morePopup.element.style.height=T(window.innerHeight)):(this.morePopup.element.querySelector("."+iVe).focus(),this.morePopup.refreshPosition())},HHe.prototype.morePopupClose=function(){var e=this.parent.element.querySelector("."+rVe);e&&ue(e)},HHe.prototype.popupClose=function(e){this.dialogEvent=e,this.isCrudAction=!1,this.quickPopupHide(!0)},HHe.prototype.quickPopupHide=function(t){var i=this;if(this.quickPopup.element.classList.contains($Oe)){var n=this.quickPopup.element.querySelector("."+z2e);if(n){var e=this.quickPopup.element.querySelector(".e-formvalidator");if(this.isCrudAction&&e&&!e.ej2_instances[0].validate())return;var e=this.parent.eventFields,o=this.parent.eventWindow.getObjectFromFormData(GVe);this.parent.eventWindow.setDefaultValueToObject(o),o[e.id]=this.parent.eventBase.getEventMaxID(),o[e.startTime]=this.parent.activeCellsData.startTime,o[e.endTime]=this.parent.activeCellsData.endTime,o[e.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(o),e=o}else e=this.parent.activeEventData.event;o=this.quickPopup.element.querySelector("."+j2e),o={event:this.dialogEvent,type:this.parent.isAdaptive?o?"ViewEventInfo":"EditEventInfo":"QuickInfo",cancel:!1,data:e,element:this.quickPopup.element,target:(n?this.parent.activeCellsData:this.parent.activeEventData).element};this.parent.trigger(kRe,o,function(e){e.cancel||i.quickPopup.element.classList.contains("e-popup-open")&&(n&&i.isCrudAction&&(i.parent.currentAction="Add",i.parent.crudModule.addEvent(e.data)),t?(e=i.quickPopup.hideAnimation,i.quickPopup.hideAnimation=null,i.quickPopup.hide(),i.quickPopup.hideAnimation=e):i.quickPopup.hide(),i.isMultipleEventSelect=!1,i.isCrudAction=!1)})}},HHe.prototype.navigationClick=function(e){var t;je(z(e.target,"."+d2e))||je(t=this.parent.getDateFromElement(e.currentTarget))||(this.closeClick(e),this.parent.setProperties({selectedDate:t},!0),this.parent.changeView(this.parent.getNavigateView(),e))},HHe.prototype.documentClick=function(e){var e=e.event.target,t=!!z(e,".e-dialog"),i="."+GVe+",."+iNe+",."+YOe+",."+JOe+",."+qNe,t=(t||(i+=",.e-popup"),this.parent.element.querySelector("."+GVe)),t=((t&&0<t.childElementCount&&!z(e,i)||!z(e,i))&&(this.quickPopupHide(),this.parent.removeNewEventElement()),this.parent.allowInline?this.parent.inlineModule.getInlineElement():null);t&&t!==e&&this.parent.inlineModule.documentClick(t),z(e,"."+qNe+",."+iNe)&&this.parent.removeNewEventElement(),z(e,"."+Z2e)||!e.classList||e.classList.contains(H2e)||z(e,"."+Z2e+"."+$Oe)||z(e,"."+JOe)||this.morePopup.hide()},HHe.prototype.onClosePopup=function(e){je(e)||(this.dialogEvent=e),this.quickPopupHide(),(je(e)||!je(e)&&"escape"!==e.action||this.parent.inlineModule&&this.parent.element.querySelector("."+d_e))&&this.parent.eventBase.focusElement()},HHe.prototype.addEventListener=function(){this.parent.on(fRe,this.cellClick,this),this.parent.on(IRe,this.eventClick,this),this.parent.on($Re,this.documentClick,this),this.parent.on(qRe,this.updateMoreEventContent,this)},HHe.prototype.removeEventListener=function(){this.parent.off(fRe,this.cellClick),this.parent.off(IRe,this.eventClick),this.parent.off($Re,this.documentClick),this.parent.off(qRe,this.updateMoreEventContent)},HHe.prototype.destroyPopupButtons=function(e){for(var t="quickPopup"===e?this.quickPopup:this.morePopup,i=0,n=[].slice.call(t.element.querySelectorAll(".e-control.e-btn"));i<n.length;i++){var o=n[i].ej2_instances[0];o&&o.destroy()}"quickPopup"===e&&((e=t.element.querySelector("input."+CVe))&&e.remove(),(t=this.quickPopup.element.querySelector("form."+yVe))&&(kOe(t),t.remove()),this.parent.resetTemplates(["content","header","footer"]))},HHe.prototype.refreshQuickDialog=function(){this.destroyQuickDialog(),this.renderQuickDialog()},HHe.prototype.refreshQuickPopup=function(){this.destroyQuickPopup(),this.renderQuickPopup()},HHe.prototype.refreshMorePopup=function(){this.destroyMorePopup(),this.renderMorePopup()},HHe.prototype.destroyQuickDialog=function(){this.quickDialog.element&&(this.quickDialog.destroy(),ue(this.quickDialog.element),this.quickDialog=null)},HHe.prototype.destroyQuickPopup=function(){this.quickPopup.element&&(this.destroyPopupButtons("quickPopup"),this.quickPopup.destroy(),ue(this.quickPopup.element),this.quickPopup=null)},HHe.prototype.destroyMorePopup=function(){this.morePopup.element&&(this.destroyPopupButtons("morePopup"),this.morePopup.destroy(),ue(this.morePopup.element),this.morePopup=null)},HHe.prototype.destroy=function(){this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.removeEventListener(),this.destroyQuickPopup(),this.destroyMorePopup(),this.destroyQuickDialog(),this.dialogEvent=null,this.parent=null,this.l10n=null,this.isCrudAction=null,this.fieldValidator=null,this.isMultipleEventSelect=null};var _He=HHe;function HHe(e){this.isMultipleEventSelect=!1,this.isCrudAction=!1,this.parent=e,this.l10n=this.parent.localeObj,this.fieldValidator=new NHe,this.render(),this.addEventListener()}jHe.prototype.getTargets=function(){var e=[];return this.parent.activeViewOptions.group.headerTooltipTemplate&&e.push("."+ANe),this.parent.eventSettings.enableTooltip&&e.push("."+qNe),e.join(",")},jHe.prototype.onBeforeRender=function(e){var t,i,n,o,r,s,a,l,h,d,p,c,u,g,m,f=this;this.parent.uiStateValues.isSwipeScroll?e.cancel=!0:je(e.target.getAttribute("data-tooltip-id"))&&(e.target.classList.contains(ANe)&&0<this.parent.activeViewOptions.group.resources.length?(m=void 0,t={resource:(m=this.parent.activeView.isTimelineView()?(t=parseInt(e.target.getAttribute("data-group-index"),10),this.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)]):(t=e.target.parentNode.sectionRowIndex,g=e.target.cellIndex,this.parent.activeView.getColumnLevels()[parseInt(t.toString(),10)][parseInt(g.toString(),10)])).resource,resourceData:m.resourceData},g=Q("div"),m=this.parent.element.id+"_headerTooltipTemplate",ht([].slice.call(this.parent.getHeaderTooltipTemplate()(t,this.parent,"headerTooltipTemplate",m,!1)),g),this.setContent(g),this.parent.renderTemplates()):je(t=this.parent.eventBase.getEventByGuid(e.target.getAttribute("data-guid")))||(je(this.parent.eventSettings.tooltipTemplate)?(e=this.parent.globalize,i=this.parent.eventFields,n=new Date(""+t[i.startTime]),c=(c=new Date(""+t[i.endTime])).getTime()-n.getTime()!=0&&0===c.getHours()&&0===c.getMinutes()?new Date(c.setMilliseconds(-1e3)):c,o=gOe(new Date(""+n)),r=gOe(new Date(""+c)),s=t[i.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),a=je(t[i.location])?"":t[i.location],d=h=l="",l=e.formatDate(n,{type:"date",skeleton:"MMMd",calendar:this.parent.getCalendarMode()}),h=e.formatDate(n,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),d=e.formatDate(c,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),l=ROe(l,"single"),h=ROe(h,"single"),d=ROe(d,"single"),p=this.parent.getTimeString(n),c=this.parent.getTimeString(c),u='<div><div class="e-subject">'+s+'</div><div class="e-location">'+a+'</div><div class="e-details">'+(o.getTime()===r.getTime()?ROe(e.formatDate(n,{type:"date",skeleton:"long",calendar:this.parent.getCalendarMode()}),"single"):o.getFullYear()===r.getFullYear()?l+" - "+d:h+" - "+d)+'</div><div class="e-all-day">'+(t[i.isAllDay]?this.parent.localeObj.getConstant("allDay"):p+" - "+c)+"</div></div>",this.setContent(ao(function(){return u}))):(g=Q("div"),m=this.parent.element.id+"_tooltipTemplate",ht([].slice.call(this.parent.getEventTooltipTemplate()(t,this.parent,"tooltipTemplate",m,!1)),g),this.setContent(g)),this.parent.renderTemplates(function(){var e;f.parent&&f.parent.isReact&&!je(f.parent.eventSettings.tooltipTemplate)&&(e=document.querySelector("."+WVe))&&q([e],WVe)})))},jHe.prototype.onTooltipOpen=function(t){t.element&&this.parent.isReact&&!je(this.parent.eventSettings.tooltipTemplate)&&U([t.element],WVe);var e=this.parent.eventBase.getEventByGuid(t.target.getAttribute("data-guid"));je(e)||(e={cancel:!1,data:e,content:t.element,target:t.target},this.parent.trigger(QRe,e,function(e){e.cancel?t.cancel=!0:t.element=e.content}))},jHe.prototype.onTooltipClose=function(e){e.element&&(q([e.element],$Oe),U([e.element],"e-popup-close")),this.parent.isReact&&this.parent.eventWindow.dialogObject&&this.parent.eventWindow.dialogObject.visible||this.parent.resetTemplates(["tooltipTemplate","headerTooltipTemplate"])},jHe.prototype.setContent=function(e){this.tooltipObj.setProperties({content:e,windowCollision:!0},!0)},jHe.prototype.close=function(){this.tooltipObj.close()},jHe.prototype.destroy=function(){this.tooltipObj.destroy(),U([this.parent.element],"e-control"),this.tooltipObj=null,this.parent=null};var zHe=jHe;function jHe(e){this.parent=e,this.tooltipObj=new NS({animation:{close:{effect:"FadeOut"}},content:"No title",position:"BottomRight",offsetY:10,mouseTrail:!this.parent.isAdaptive,showTipPointer:!1,cssClass:this.parent.cssClass+" e-schedule-event-tooltip",target:this.getTargets(),beforeRender:this.onBeforeRender.bind(this),beforeClose:this.onTooltipClose.bind(this),beforeOpen:this.onTooltipOpen.bind(this),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.parent.element)}WHe=function(e,t){return(WHe=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])}))(e,t)};var WHe,QHe,M$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},UHe="e-input-wrapper",qHe="e-input-wrapper-side",GHe="e-repeat-element",YHe="e-repeat-interval",XHe="e-interval",KHe="e-days",JHe="e-non-week",ZHe="e-year-expander",$He="e-year-expander-element",eze="e-month-expander",tze="e-month-expander-element",ize="e-month-expander-checkbox-wrapper",nze="e-form-left",oze="e-form-right",rze="e-month-day",sze="e-month-expander-wrapper",aze="e-month-pos",lze="e-month-week",hze="e-end-on",dze="e-end-on-element",pze="e-end-on-date",cze="e-until-date",uze="e-end-on-count",gze="e-recurrence-count",mze="e-hide-recurrence-element",fze="e-primary",yze="e-recurrence-table",vze="e-repeat-content",bze="none",wze="daily",Cze="weekly",Sze="monthly",Aze="yearly",xze="until",Ize="count",Tze="text",Eze="value",Dze={none:"",daily:"days",weekly:"weeks",monthly:"months",yearly:"years"},Mze={sun:"SU",mon:"MO",tue:"TU",wed:"WE",thu:"TH",fri:"FR",sat:"SA"},kze=[KHe,JHe,hze,XHe,ZHe,eze],Pze=[JHe],Bze=[KHe,ZHe],Fze=[KHe],Lze=[KHe,JHe,ZHe,eze],Rze=[pze,uze],Oze=[pze],Nze=[uze],Vze=(function(e,t){function i(){this.constructor=e}WHe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(_ze,QHe=Ji),_ze.prototype.startState=function(e,t,i){this.showFormElement(),this.updateForm(e),this.freshOnEndForm(),this.updateEndOnForm(t),this.selectMonthDay(i),this.updateUntilDate(i),this.onMonthDay.setProperties({checked:!0})},_ze.prototype.preRender=function(){this.localeObj=new Cn(this.getModuleName(),this.defaultLocale,this.locale),this.calendarUtil=rHe(this.calendarMode)},_ze.prototype.applyCustomClass=function(e){e&&U([this.element],e.split(" "))},_ze.prototype.initialize=function(){U([this.element],"e-"+this.getModuleName()),this.renderComponent(),je(this.value)||""===this.value?(je(this.repeatType.value)||(this.startState(this.repeatType.value.toString().toUpperCase(),this.endTypes[0],this.startDate),this.updateForm(this.repeatType.value.toString())),0<this.selectedType&&this.setProperties({value:this.getRecurrenceRule()},!1)):this.setRecurrenceRule(this.value),this.applyCustomClass(this.cssClass)},_ze.prototype.triggerChangeEvent=function(){var e,t=this;this.renderStatus&&(e=this.getRecurrenceRule(),this.trigger("change",{value:e},function(e){return t.setProperties({value:e.value},!1)}))},_ze.prototype.resetDayButton=function(){[].slice.call(this.element.querySelectorAll(".e-days button")).forEach(function(e){return q([e],["e-active",fze])})},_ze.prototype.daySelection=function(e){this.resetDayButton();var t=[0,1,2,3,4,5,6],t=(this.rotateArray(t,this.firstDayOfWeek),this.element.querySelector('.e-days button[data-index="'+t.indexOf(e)+'"]'));t&&U([t],["e-active",fze])},_ze.prototype.rtlClass=function(e){(e?U:q)([this.element],"e-rtl")},_ze.prototype.updateUntilDate=function(e){e=new Date(e.getTime());e.setDate(e.getDate()+60),this.untilDateObj.setProperties({value:e})},_ze.prototype.selectMonthDay=function(e){var t=["sun","mon","tue","wed","thu","fri","sat"];this.monthDate.setProperties({value:this.calendarUtil.getDate(e)}),this.monthWeekDays.setProperties({value:Mze[t[e.getDay()]]}),this.monthValue.setProperties({value:""+this.calendarUtil.getMonth(e)}),this.monthWeekPos.setProperties({value:this.getDayPosition(e)}),this.daySelection(e.getDay())},_ze.prototype.updateForm=function(e){var t=this,i=(this.repeatType.setProperties({value:e}),this.element.querySelector("."+hze));switch(e===wze?mt(i,[nze],[oze]):mt(i,[oze],[nze]),e){case bze:kze.forEach(function(e){return U([t.element.querySelector("."+e)],mze)});break;case Cze:Pze.forEach(function(e){return U([t.element.querySelector("."+e)],mze)});break;case Sze:Bze.forEach(function(e){return U([t.element.querySelector("."+e)],mze)});break;case Aze:Fze.forEach(function(e){return U([t.element.querySelector("."+e)],mze)});break;case wze:Lze.forEach(function(e){return U([t.element.querySelector("."+e)],mze)})}},_ze.prototype.updateEndOnForm=function(e){var t=this;switch(this.endType.setProperties({value:e}),e){case"never":Rze.forEach(function(e){return U([t.element.querySelector("."+e)],mze)});break;case xze:Nze.forEach(function(e){return U([t.element.querySelector("."+e)],mze)});break;case Ize:Oze.forEach(function(e){return U([t.element.querySelector("."+e)],mze)})}},_ze.prototype.freshOnEndForm=function(){var t=this;Rze.forEach(function(e){e=t.element.querySelector("."+e);e&&q([e],mze)})},_ze.prototype.showFormElement=function(){var t=this;kze.forEach(function(e){e=t.element.querySelector("."+e);e&&q([e],mze)})},_ze.prototype.renderDropdowns=function(){function e(e){return new qz({dataSource:e,popupWidth:t.getPopupWidth(),enableRtl:t.enableRtl,fields:{text:Tze,value:Eze},index:1,change:function(e){i.onWeekDay.setProperties({checked:!0}),i.resetFormValues(),i.triggerChangeEvent()}})}var t=this,i=this;this.repeatType=new qz({dataSource:this.getRepeatData(),floatLabelType:"Always",enableRtl:this.enableRtl,index:this.selectedType,fields:{text:Tze,value:Eze},placeholder:this.localeObj.getConstant("repeat"),htmlAttributes:{title:this.localeObj.getConstant("repeat")},change:function(e){i.setProperties({selectedType:t.frequencies.indexOf(e.value)},!1),i.element.querySelector("."+vze).innerHTML=i.localeObj.getConstant(Dze[e.value]),i.showFormElement(),i.updateForm(e.value),i.resetFormValues(),i.triggerChangeEvent()}}),this.repeatType.appendTo(this.element.querySelector("."+GHe)),this.endType=new qz({dataSource:this.getEndData(),popupWidth:this.getPopupWidth(),floatLabelType:"Always",placeholder:this.localeObj.getConstant("end"),enableRtl:this.enableRtl,index:1,fields:{text:Tze,value:Eze},change:function(e){i.freshOnEndForm(),i.updateEndOnForm(e.value),i.resetFormValues(),i.triggerChangeEvent()}}),this.endType.appendTo(this.element.querySelector("."+dze));this.monthWeekPos=e(this.getMonthPosData()),this.monthWeekPos.appendTo(this.element.querySelector("."+aze)),this.monthWeekDays=e(this.getDayData("wide")),this.monthWeekDays.appendTo(this.element.querySelector("."+lze)),this.monthValue=new qz({dataSource:this.getMonthData(),fields:{text:Tze,value:Eze},enableRtl:this.enableRtl,index:7,change:function(e){i.resetFormValues(),i.triggerChangeEvent()}}),this.monthValue.appendTo(this.element.querySelector("."+$He))},_ze.prototype.setDefaultValue=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-control .e-numerictextbox"));e<t.length;e++){var i=t[e].ej2_instances[0];i.element.classList.contains(YHe)?(i.value=1,i.dataBind()):i.element.classList.contains(gze)&&(i.value=10,i.dataBind())}},_ze.prototype.resetFormValues=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll('.e-control [type="text"]'));e<t.length;e++){var i,n=t[e],o=void 0;n.classList.contains("e-datepicker")?(o=n.ej2_instances[0]).value?(o.value=o.value,o.dataBind()):this.updateUntilDate(this.startDate):n.classList.contains("e-dropdownlist")?((o=n.ej2_instances[0]).index=o.index||0,o.dataBind()):n.classList.contains("e-numerictextbox")&&(i=void 0,i=(o=n.ej2_instances[0]).element.classList.contains(YHe)?1:o.element.classList.contains(gze)?10:this.startDate.getDate(),o.value=o.value||i,o.dataBind())}},_ze.prototype.getPopupWidth=function(){return F.isDevice?"100%":"auto"},_ze.prototype.renderDatePickers=function(){var t=this;this.untilDateObj=new o9({firstDayOfWeek:this.firstDayOfWeek,enableRtl:this.enableRtl,locale:this.locale,min:this.minDate,max:this.maxDate,format:je(this.dateFormat)?this.getFormat("dateFormats"):this.dateFormat,change:function(e){e.value&&t.triggerChangeEvent()}}),this.untilDateObj.appendTo(this.element.querySelector("."+cze))},_ze.prototype.getFormat=function(e){e="en"===this.locale||"en-US"===this.locale?R(e+".short",Pi(this.getCalendarMode())):R("main."+this.locale+".dates.calendars."+this.getCalendarMode()+"."+e+".short",Ai);return e},_ze.prototype.dayButtonRender=function(){for(var i=this,e=[].slice.call(this.element.querySelectorAll(".e-days button")),n=this,t=0,o=e;t<o.length;t++){var r=o[t],s=new zv({isToggle:!0,enableRtl:this.enableRtl},r);this.dayButtons.push(s),E.add(r,"click",function(e){var t=[].slice.call(i.element.querySelectorAll(".e-days button."+fze)),e=e.target;e.classList.contains(fze)?1<t.length&&(q([e],fze),n.triggerChangeEvent()):(U([e],fze),n.triggerChangeEvent())})}},_ze.prototype.radioButtonRender=function(){var e=this;this.onMonthDay=new cb({label:this.localeObj.getConstant("onDay"),enableRtl:this.enableRtl,name:"monthType",value:"day",change:function(){e.resetFormValues(),e.triggerChangeEvent()}}),this.onMonthDay.appendTo(this.element.querySelector("."+tze)),this.monthButtons.push(this.onMonthDay),this.onWeekDay=new cb({label:this.localeObj.getConstant("monthExpander"),cssClass:"e-month-type",name:"monthType",enableRtl:this.enableRtl,value:"daypos",change:function(){e.resetFormValues(),e.triggerChangeEvent()}}),this.onWeekDay.appendTo(this.element.querySelector("."+sze)),this.monthButtons.push(this.onWeekDay)},_ze.prototype.numericTextboxRender=function(){var e=this;this.recurrenceCount=new NL({value:10,format:"#",enableRtl:this.enableRtl,min:1,max:999,change:function(){e.triggerChangeEvent()}}),this.recurrenceCount.appendTo(this.element.querySelector("."+gze)),this.monthDate=new NL({value:1,format:"#",enableRtl:this.enableRtl,min:1,max:31,change:function(){e.onMonthDay.setProperties({checked:!0}),e.triggerChangeEvent()}}),this.monthDate.appendTo(this.element.querySelector("."+rze)),this.repeatInterval=new NL({value:1,format:"#",min:1,max:999,enableRtl:this.enableRtl,floatLabelType:"Always",placeholder:this.localeObj.getConstant("repeatEvery"),change:function(){e.triggerChangeEvent()}}),this.repeatInterval.appendTo(this.element.querySelector("."+YHe))},_ze.prototype.renderComponent=function(){this.setTemplate(),this.renderDropdowns(),this.renderDatePickers(),this.dayButtonRender(),this.radioButtonRender(),this.numericTextboxRender()},_ze.prototype.rotateArray=function(e,t){for(var i,n=0;n<t;n++)i=e.shift(),e.push(i)},_ze.prototype.getEndData=function(){var t=this,i=[];return this.endTypes.forEach(function(e){i.push({text:t.localeObj.getConstant(e),value:e})}),i},_ze.prototype.getDayPosition=function(e){for(var t=new Date(e.getTime()),i=new Date(e.getTime()),n=e.getDay(),o=[],t=this.calendarUtil.getMonthStartDate(t),i=this.calendarUtil.getMonthEndDate(i);t<i;)t.getDay()===n&&o.push(t.getTime()),t.setDate(t.getDate()+1);return o.indexOf(e.getTime())===o.length-1?-1:o.indexOf(e.getTime())+1},_ze.prototype.getRepeatData=function(){var t=[],i=this;return this.frequencies.forEach(function(e){t.push({text:i.localeObj.getConstant(e===bze?"never":e),value:e})}),t},_ze.prototype.getMonthPosData=function(){var t={first:1,second:2,third:3,fourth:4,last:-1},i=this,n=[];return["first","second","third","fourth","last"].forEach(function(e){n.push({text:i.localeObj.getConstant(e),value:t[""+e]})}),n},_ze.prototype.getDayData=function(e){var t,i=["sun","mon","tue","wed","thu","fri","sat"],n=[];this.rotateArray(i,this.firstDayOfWeek),t="en"===this.locale||"en-US"===this.locale?R("days.stand-alone."+e,Pi(this.getCalendarMode())):R("main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.stand-alone."+e,Ai);for(var o=0,r=i;o<r.length;o++){var s=r[o],a=R(s,t);n.push({text:"narrow"===e?a:ROe(a,"single"),value:Mze[""+s]})}return n},_ze.prototype.getMonthData=function(){var e,t=[];e="en"===this.locale||"en-US"===this.locale?R("months.stand-alone.wide",Pi(this.getCalendarMode())):R("main."+this.locale+".dates.calendars."+this.getCalendarMode()+".months.stand-alone.wide",Ai);for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];t.push({text:ROe(R(o,e),"single"),value:o})}return t},_ze.prototype.setTemplate=function(){var e=this.getDayData("narrow"),t=this.getDayData("wide");this.element.innerHTML='<div class="e-editor"><div class="'+UHe+" "+nze+'"><input type="text" tabindex="0" class="'+GHe+'"label="'+GHe.substr(2)+'" /></div><div class="'+UHe+" "+XHe+" "+oze+'"><table  class="'+yze+' e-repeat-content-wrapper"  role="none"><tr><td><input type="text" tabindex="0" id="'+this.element.id+"_"+YHe+'" class="'+YHe+'"title="'+this.localeObj.getConstant("repeatEvery")+'" /></td><td><span class="'+vze+'"></span></td></tr></table></div><div class="'+qHe+" "+KHe+" "+nze+'"><div class=e-week-expander-label>'+this.localeObj.getConstant("on")+'</div><button type="button" class="e-round" data-index="0" title="'+t[0].text+'">'+e[0].text+'</button><button type="button" class="e-round" data-index="1" title="'+t[1].text+'">'+e[1].text+'</button><button type="button" class="e-round" data-index="2" title="'+t[2].text+'">'+e[2].text+'</button><button type="button" class="e-round" data-index="3" title="'+t[3].text+'">'+e[3].text+'</button><button type="button" class="e-round" data-index="4" title="'+t[4].text+'">'+e[4].text+'</button><button type="button" class="e-round" data-index="5" title="'+t[5].text+'">'+e[5].text+'</button><button type="button" class="e-round" data-index="6" title="'+t[6].text+'">'+e[6].text+'</button></div><div class="'+qHe+" "+JHe+" "+nze+'"><div class=e-month-expander-label>'+this.localeObj.getConstant("on")+'</div><div class="'+ZHe+'"><input class="'+$He+'" type="text" tabindex="0" title="'+this.localeObj.getConstant("yearExpander")+'"/></div><div class="'+eze+'"><table class="'+yze+' e-month-expand-wrapper" role="none"><tr><td><div class="'+UHe+" "+ize+'"><input class="'+tze+'"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td colspan="2"><div class="'+UHe+' e-monthday-element"><input type="text" tabindex="0" id="'+this.element.id+"_"+rze+'" class="'+rze+'"title="'+this.localeObj.getConstant("on")+'" /></div></td></tr><tr><td><div class="'+UHe+" "+ize+' e-repeat-on-week-selector"><input class="'+sze+'"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td><div class="'+UHe+' e-week-position" ><input type="text" tabindex="0" class="'+aze+'"title="'+this.localeObj.getConstant("monthPosition")+'" /></div></td><td><div class="'+UHe+' e-day-position"><input type="text" tabindex="0" class="'+lze+'"title="'+this.localeObj.getConstant("monthWeek")+'" /></div></td></tr></table></div></div><div class="'+qHe+" "+hze+" "+oze+'"><div class="'+UHe+' e-end-on-left"><input type="text" tabindex="0" class="'+dze+'"title="'+this.localeObj.getConstant("end")+'" /></div><div class="'+UHe+" "+pze+'" ><input type="text" tabindex="0" class="'+cze+'"title="'+this.localeObj.getConstant(xze)+'" /></div><div class="'+UHe+" "+uze+'"><input type="text" tabindex="0" id="'+this.element.id+"_"+gze+'" class="'+gze+'"title="'+this.localeObj.getConstant(Ize)+'" /></div></div></div></div>'},_ze.prototype.getSelectedDaysData=function(){var e="BYDAY=",t=[].slice.call(this.element.querySelectorAll(".e-days button."+fze)),i=["SU","MO","TU","WE","TH","FR","SA"];this.rotateArray(i,this.firstDayOfWeek);for(var n=0;n<t.length;n++)e+=i[parseInt(t[parseInt(n.toString(),10)].getAttribute("data-index"),10)]+(n===t.length-1?"":",");return e+";"},_ze.prototype.getSelectedMonthData=function(){var e=this.onWeekDay.checked?"BYDAY="+this.monthWeekDays.value+";BYSETPOS="+this.monthWeekPos.value+";":"BYMONTHDAY="+this.monthDate.value+";";return e},_ze.prototype.getIntervalData=function(){return"INTERVAL="+this.repeatInterval.value+";"},_ze.prototype.getEndOnCount=function(){return"COUNT="+this.recurrenceCount.value+";"},_ze.prototype.getYearMonthRuleData=function(){return"BYMONTH="+this.monthValue.value+";"},_ze.prototype.updateWeekButton=function(e){var t=["SU","MO","TU","WE","TH","FR","SA"];this.rotateArray(t,this.firstDayOfWeek);for(var i=0,n=this.dayButtons;i<n.length;i++){var o=n[i],r=parseInt(o.element.getAttribute("data-index"),10);-1!==e.indexOf(t[parseInt(r.toString(),10)])?o.setProperties({isPrimary:!0}):o.setProperties({isPrimary:!1})}},_ze.prototype.updateMonthUI=function(){if(this.ruleObject.monthDay.length)this.monthDate.setProperties({value:this.ruleObject.monthDay[0]}),this.onMonthDay.setProperties({checked:!0});else{this.onWeekDay.setProperties({checked:!0}),this.monthWeekPos.setProperties({value:this.ruleObject.setPosition});for(var e=0,t=Object.keys(Mze);e<t.length;e++){var i=t[e];if(Mze[""+i]===this.ruleObject.day[0]){this.monthWeekDays.setProperties({value:this.ruleObject.day[0]});break}}}},_ze.prototype.updateUI=function(e,t){switch(this.repeatInterval.setProperties({value:this.ruleObject.interval}),t){case xze:this.untilDateObj.setProperties({value:this.ruleObject.until});break;case Ize:this.recurrenceCount.setProperties({value:this.ruleObject.count})}switch(e){case Cze:this.updateWeekButton(this.ruleObject.day);break;case Aze:this.monthValue.setProperties({index:this.ruleObject.month[0]-1}),this.updateMonthUI();break;case Sze:this.updateMonthUI()}},_ze.prototype.getUntilData=function(){return this.untilDateObj.value?"UNTIL="+bHe(this.untilDateObj.value)+";":""},_ze.prototype.destroyComponents=function(){this.recurrenceCount.isDestroyed||(this.recurrenceCount.destroy(),this.recurrenceCount=null),this.monthDate.isDestroyed||(this.monthDate.destroy(),this.monthDate=null),this.repeatInterval.isDestroyed||(this.repeatInterval.destroy(),this.repeatInterval=null),this.untilDateObj.isDestroyed||(this.untilDateObj.destroy(),this.untilDateObj=null),this.repeatType.isDestroyed||(this.repeatType.destroy(),this.repeatType=null),this.endType.isDestroyed||(this.endType.destroy(),this.endType=null),this.monthWeekPos.isDestroyed||(this.monthWeekPos.destroy(),this.monthWeekPos=null),this.monthWeekDays.isDestroyed||(this.monthWeekDays.destroy(),this.monthWeekDays=null),this.monthValue.isDestroyed||(this.monthValue.destroy(),this.monthValue=null),this.onMonthDay.isDestroyed||(this.onMonthDay.destroy(),this.onMonthDay=null),this.onWeekDay.isDestroyed||(this.onWeekDay.destroy(),this.onWeekDay=null),this.dayButtons.forEach(function(e){e.isDestroyed||e.destroy()}),this.dayButtons=[],this.monthButtons.forEach(function(e){e.isDestroyed||e.destroy()}),this.monthButtons=[]},_ze.prototype.resetFields=function(){this.startState(bze,this.endTypes[0],this.startDate),this.setDefaultValue()},_ze.prototype.updateRuleUntilDate=function(e){var t;this.untilDateObj.value&&e&&(t=this.untilDateObj.value,t=new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes(),e.getMilliseconds()),this.untilDateObj.setProperties({value:t}))},_ze.prototype.getCalendarMode=function(){return je(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},_ze.prototype.getRuleSummary=function(e){return F_e(e=void 0===e?this.getRecurrenceRule():e,this.localeObj,this.locale,this.calendarMode)},_ze.prototype.getRecurrenceDates=function(e,t,i,n,o){return o=je(o)?this.startDate:o,R_e(e,t,i,this.firstDayOfWeek,n,o,this.calendarMode)},_ze.prototype.getRecurrenceRule=function(){var e="FREQ=";switch(this.repeatType.value){case wze:e+="DAILY;";break;case Cze:e+="WEEKLY;"+this.getSelectedDaysData();break;case Sze:e+="MONTHLY;"+this.getSelectedMonthData();break;case Aze:e+="YEARLY;"+this.getSelectedMonthData()+this.getYearMonthRuleData();break;case bze:return""}switch(e+=this.getIntervalData(),this.endType.value){case xze:e+=this.getUntilData();break;case Ize:e+=this.getEndOnCount()}return e},_ze.prototype.setRecurrenceRule=function(e,t){if(void 0===t&&(t=this.startDate),e){this.renderStatus=!1,this.ruleObject=iHe(e);var i=this.ruleObject.count?Ize:this.ruleObject.until?xze:"never";switch(this.ruleObject.freq){case"DAILY":this.startState(wze,i,t),this.updateUI(wze,i);break;case"WEEKLY":this.startState(Cze,i,t),this.updateUI(Cze,i);break;case"MONTHLY":this.startState(Sze,i,t),this.updateUI(Sze,i);break;case"YEARLY":this.startState(Aze,i,t),this.updateUI(Aze,i)}this.renderStatus=!0,this.triggerChangeEvent()}else this.repeatType.setProperties({value:bze})},_ze.prototype.detachInputs=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("input"));e<t.length;e++)G(t[e])},_ze.prototype.destroy=function(){if(!this.isDestroyed){this.destroyComponents(),QHe.prototype.destroy.call(this);var e=["e-"+this.getModuleName()];for(this.cssClass&&(e=e.concat(this.cssClass.split(" "))),q([this.element],e),this.detachInputs();this.element.firstElementChild;)this.element.removeChild(this.element.firstElementChild)}},_ze.prototype.getModuleName=function(){return"recurrenceeditor"},_ze.prototype.getPersistData=function(){return this.addOnPersist([])},_ze.prototype.render=function(){this.initialize(),this.rtlClass(this.enableRtl),this.renderStatus=!0,this.renderComplete()},_ze.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"startDate":this.selectMonthDay(e.startDate),this.updateUntilDate(e.startDate),this.endType.setProperties({index:0});break;case"enableRtl":this.rtlClass(e.enableRtl);break;case"cssClass":t.cssClass&&q([this.element],t.cssClass.split(" ")),e.cssClass&&U([this.element],e.cssClass.split(" "));break;case"selectedType":this.repeatType.setProperties({index:this.selectedType});break;case"minDate":this.untilDateObj.setProperties({min:this.minDate});break;case"maxDate":this.untilDateObj.setProperties({max:this.maxDate});break;case"value":this.getRecurrenceRule()!==this.value&&this.setRecurrenceRule(this.value);break;case"calendarMode":this.calendarMode=e.calendarMode,this.calendarUtil=rHe(e.calendarMode);break;case"locale":case"frequencies":case"firstDayOfWeek":case"endTypes":this.refresh();break;case"dateFormat":this.untilDateObj.setProperties({format:e.dateFormat})}},M$([e(["none","daily","weekly","monthly","yearly"])],_ze.prototype,"frequencies",void 0),M$([e(["never","until","count"])],_ze.prototype,"endTypes",void 0),M$([e(0)],_ze.prototype,"firstDayOfWeek",void 0),M$([e(new Date)],_ze.prototype,"startDate",void 0),M$([e()],_ze.prototype,"dateFormat",void 0),M$([e("Gregorian")],_ze.prototype,"calendarMode",void 0),M$([e()],_ze.prototype,"cssClass",void 0),M$([e()],_ze.prototype,"value",void 0),M$([e(new Date(1900,0,1))],_ze.prototype,"minDate",void 0),M$([e(new Date(2099,11,31))],_ze.prototype,"maxDate",void 0),M$([e(0)],_ze.prototype,"selectedType",void 0),M$([i()],_ze.prototype,"change",void 0),M$([i()],_ze.prototype,"created",void 0),M$([i()],_ze.prototype,"destroyed",void 0),M$([Bt],_ze));function _ze(e,t){e=QHe.call(this,e,t)||this;return e.defaultLocale={none:"None",daily:"Daily",weekly:"Weekly",monthly:"Monthly",month:"Month",yearly:"Yearly",never:"Never",until:"Until",count:"Count",first:"First",second:"Second",third:"Third",fourth:"Fourth",last:"Last",repeat:"Repeat",repeatEvery:"Repeat every",on:"Repeat On",end:"End",onDay:"Day",days:"Day(s)",weeks:"Week(s)",months:"Month(s)",years:"Year(s)",every:"every",summaryTimes:"time(s)",summaryOn:"on",summaryUntil:"until",summaryRepeat:"Repeats",summaryDay:"day(s)",summaryWeek:"week(s)",summaryMonth:"month(s)",summaryYear:"year(s)",monthWeek:"Month Week",monthPosition:"Month Position",monthExpander:"Month Expander",yearExpander:"Year Expander",repeatInterval:"Repeat Interval"},e.renderStatus=!1,e.dayButtons=[],e.monthButtons=[],e}var Hze="e-field",zze="e-recurrence-container",jze="e-hide",Wze=(Qze.prototype.renderEventWindow=function(){this.element=Q("div",{id:this.parent.element.id+"_dialog_wrapper"}),this.parent.element.appendChild(this.element);var e={animationSettings:{effect:"Zoom"},content:this.getEventWindowContent(),cssClass:fVe,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,height:this.parent.isAdaptive?"100%":"auto",minHeight:"300px",isModal:!0,showCloseIcon:!this.parent.isAdaptive,target:document.body,visible:!1,width:"500px",beforeOpen:this.onBeforeOpen.bind(this),beforeClose:this.onBeforeClose.bind(this)};this.parent.isAdaptive?(e.cssClass=fVe+" "+HOe,this.parent.editorHeaderTemplate||(e.header='<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">'+this.l10n.getConstant("newEvent")+'</div><div class="e-save-icon e-icons"></div></div>')):(this.parent.editorFooterTemplate||this.renderDialogButtons(e),this.parent.editorHeaderTemplate||(e.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>")),this.dialogObject=new pS(e,this.element),this.dialogObject.element.querySelector(".e-dlg-closeicon-btn")&&this.dialogObject.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close")),this.addEventHandlers(),U([this.element.parentElement],fVe+"-container"),E.add(this.dialogObject.element,"keydown",this.preventEventSave,this),this.applyFormValidation()},Qze.prototype.renderDialogButtons=function(e){e.buttons=[{buttonModel:{content:this.l10n.getConstant("deleteButton"),cssClass:K2e,disabled:!this.parent.eventSettings.allowDeleting||this.parent.readonly},click:this.eventDelete.bind(this)},{buttonModel:{content:this.l10n.getConstant("saveButton"),cssClass:"e-primary "+FVe,isPrimary:!0,disabled:!this.parent.eventSettings.allowAdding||this.parent.readonly},click:this.eventSave.bind(this)},{buttonModel:{cssClass:BVe,content:this.l10n.getConstant("cancelButton")},click:this.dialogClose.bind(this)}]},Qze.prototype.addEventHandlers=function(){var e=this.element.querySelector(".e-back-icon"),t=this.element.querySelector("."+PVe);!this.parent.isAdaptive||je(e)||je(t)||(E.add(e,"click",this.dialogClose,this),E.add(t,"click",this.eventSave,this))},Qze.prototype.refresh=function(){this.destroy(!0),this.renderEventWindow()},Qze.prototype.refreshRecurrenceEditor=function(){var e;this.recurrenceEditor&&(e=this.recurrenceEditor.element,this.recurrenceEditor.destroy(),this.createRecurrenceEditor(e))},Qze.prototype.setRecurrenceEditor=function(e){this.parent.editorTemplate&&(this.recurrenceEditor=e)},Qze.prototype.openEditor=function(e,t,i,n){var o;this.parent.currentAction=t,this.parent.removeNewEventElement(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),this.parent.inlineModule.removeInlineAppointmentElement(),"Add"===t&&(o={},this.cellClickAction=!i,i=this.parent.activeCellsData=e,this.cellClickAction?this.convertToEventData(i,o):(this.parent.activeCellsData={startTime:i.startTime||i[this.fields.startTime],endTime:i.endTime||i[this.fields.endTime],isAllDay:i.isAllDay||i[this.fields.isAllDay],element:i.element,groupIndex:i.groupIndex},o=i),e=o),je(this.parent.editorHeaderTemplate)||(this.parent.resetTemplates(["editorHeaderTemplate"]),this.parent.isAdaptive&&!this.parent.editorFooterTemplate?this.dialogObject.header=this.createAdaptiveHeaderElement(e):this.dialogObject.header=this.getDialogHeader(e)),je(this.parent.editorFooterTemplate)||(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter(e)),je(this.parent.editorHeaderTemplate)&&je(this.parent.editorFooterTemplate)||(this.dialogObject.dataBind(),this.addEventHandlers()),je(this.parent.editorTemplate)?this.setEditorContent(e,t,n):this.renderFormElements(this.element.querySelector(".e-schedule-form"),e,t,n)},Qze.prototype.setEditorContent=function(e,t,i){switch(!this.parent.isAdaptive&&je(this.parent.editorTemplate)&&q([this.dialogObject.element.querySelector(".e-recurrenceeditor")],UOe),this.recurrenceEditor&&(this.recurrenceEditor.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek),t){case"Add":this.onCellDetailsUpdate(e,i);break;case"Save":case"EditOccurrence":case"EditSeries":case"EditFollowingEvents":"EditOccurrence"===t&&!this.parent.isAdaptive&&je(this.parent.editorTemplate)&&U([this.dialogObject.element.querySelector(".e-recurrenceeditor")],UOe),this.cellClickAction=!1,this.onEventDetailsUpdate(e)}},Qze.prototype.setDialogContent=function(){this.dialogObject.content=this.getEventWindowContent(),this.dialogObject.dataBind(),this.applyFormValidation()},Qze.prototype.setDialogHeader=function(){je(this.parent.editorHeaderTemplate)?this.parent.isAdaptive?this.dialogObject.header='<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">'+this.l10n.getConstant("newEvent")+'</div><div class="e-save-icon e-icons"></div></div>':this.dialogObject.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>":(this.parent.resetTemplates(["editorHeaderTemplate"]),this.parent.isAdaptive&&!this.parent.editorFooterTemplate?this.dialogObject.header=this.createAdaptiveHeaderElement():this.dialogObject.header=this.getDialogHeader()),this.dialogObject.dataBind(),this.addEventHandlers()},Qze.prototype.setDialogFooter=function(){je(this.parent.editorFooterTemplate)?!this.parent.isAdaptive&&je(this.parent.editorFooterTemplate)?this.renderDialogButtons(this.dialogObject):this.parent.isAdaptive&&je(this.parent.editorFooterTemplate)&&(this.dialogObject.footerTemplate=null):(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter()),this.dialogObject.dataBind()},Qze.prototype.createAdaptiveHeaderElement=function(e){var t=Q("div",{className:"e-title-header"}),i=Q("div",{className:"e-back-icon e-icons"}),i=(t.appendChild(i),this.getDialogHeader(e)),e=(t.appendChild(i),Q("div",{className:"e-save-icon e-icons"}));return t.appendChild(e),t},Qze.prototype.getDialogHeader=function(e){var t=this.parent.element.id+"_editorHeaderTemplate",i=document.createElement("div");return ht([].slice.call(this.parent.getEditorHeaderTemplate()(e||{},this.parent,"editorHeaderTemplate",t,!1)),i),i},Qze.prototype.getDialogFooter=function(e){var t=this.parent.element.id+"_editorFooterTemplate",i=document.createElement("div");return ht([].slice.call(this.parent.getEditorFooterTemplate()(e||{},this.parent,"editorFooterTemplate",t,!1)),i),i},Qze.prototype.preventEventSave=function(e){this.parent&&!this.parent.allowKeyboardInteraction&&"Enter"===e.code&&(this.isEnterKey=!0)},Qze.prototype.onBeforeOpen=function(n){var o=this,r=this.eventData[this.fields.endTime].getTime(),e={type:"Editor",data:this.eventData,cancel:!1,element:this.element,target:(this.cellClickAction?this.parent.activeCellsData:this.parent.activeEventData).element},t=(this.cellClickAction&&(e.duration=this.getSlotDuration()),this.getInstance(FVe)),t=(t&&(t.disabled=!(this.cellClickAction?this.parent.eventSettings.allowAdding:this.parent.eventSettings.allowEditing),t.dataBind()),this.getInstance(K2e)),s=(t&&(t.disabled=!this.parent.eventSettings.allowDeleting,t.dataBind()),new ll);return this.parent.trigger(MRe,e,function(e){var t,i;n.cancel=e.cancel,n.maxHeight=o.parent.isAdaptive?"max-content":n.maxHeight,o.duration=o.cellClickAction?e.duration:null,o.eventData[o.fields.endTime].getTime()!==r||o.cellClickAction||0!==o.eventData[o.fields.endTime].getHours()||0!==o.eventData[o.fields.endTime].getMinutes()||(o.eventData=Pe({},o.eventData,null,!0),o.trimAllDay(o.eventData)),o.refreshDateTimePicker(o.duration),o.cellClickAction&&e.duration!==o.getSlotDuration()&&je(o.parent.editorTemplate)&&(t=o.getInstance(xVe),(i=o.getInstance(IVe)).value=new Date(t.value.getTime()+6e4*e.duration),i.dataBind()),o.parent.editorTemplate&&o.element.querySelector(".e-recurrenceeditor")&&!o.recurrenceEditor&&(o.recurrenceEditor=o.getInstance("e-recurrenceeditor")),s.resolve(n)}),s},Qze.prototype.onBeforeClose=function(t){var i=this,e=(t.isInteracted&&(this.isCrudAction=!1),{type:"Editor",event:t.event||this.dialogEvent,data:this.eventCrudData,cancel:!1,element:this.element,target:(this.cellClickAction?this.parent.activeCellsData:this.parent.activeEventData).element}),n=new ll;return this.parent.trigger(kRe,e,function(e){t.cancel=e.cancel,e.cancel||(i.isCrudAction&&(t.cancel=i.processCrudActions(e.data),i.isCrudAction=t.cancel),i.isCrudAction)||(i.resetForm(),i.parent.eventBase.focusElement(!0),i.eventCrudData=null),n.resolve(t)}),n},Qze.prototype.getEventWindowContent=function(){var e=Q("div",{className:"e-form-container"}),t=Q("form",{id:this.parent.element.id+"EditForm",className:yVe,attrs:{onsubmit:"return false;"}});return this.renderFormElements(t),e.appendChild(t),e},Qze.prototype.renderFormElements=function(e,t,i,n){var o=this;if(je(this.parent.editorTemplate))e.appendChild(this.getDefaultEventWindowContent()),t&&this.setEditorContent(t,i,n);else{if(t&&(this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),this.recurrenceEditor=null),this.destroyComponents(),this.parent.resetTemplates(["editorTemplate"]),E.clearEvents(e),!this.parent.isReact))for(var r=0,s=[].slice.call(e.children);r<s.length;r++)ue(s[r]);var a=this.parent.element.id+"_editorTemplate";ht([].slice.call(this.parent.getEditorTemplate()(t||{},this.parent,"editorTemplate",a,!1)),e),this.parent.renderTemplates(function(){o.element&&(o.applyFormValidation(),t)&&o.setEditorContent(t,i,n)})}},Qze.prototype.getDefaultEventWindowContent=function(){var e=this.createDivElement("e-dialog-parent"),t=this.createDivElement("e-title-location-row"),t=(e.appendChild(t),t.appendChild(this.renderTextBox(CVe)),t.appendChild(this.renderTextBox(SVe)),this.createDivElement("e-start-end-row")),t=(e.appendChild(t),t.appendChild(this.renderDateTimePicker(xVe,this.onTimeChange.bind(this))),t.appendChild(this.renderDateTimePicker(IVe)),this.createDivElement("e-all-day-time-zone-row")),t=(e.appendChild(t),t.appendChild(this.renderCheckBox(vVe)),t.appendChild(this.renderCheckBox(bVe)),this.createDivElement(DVe)),t=(e.appendChild(t),t.appendChild(this.renderDropDown(MVe)),t.appendChild(this.renderDropDown(kVe)),this.createDivElement("e-repeat-parent-row")),i=(e.appendChild(t),this.renderCheckBox(wVe)),n=Q("span",{className:zze}),o=Q("button",{className:"e-recurrence-edit-button",attrs:{type:"button",title:this.l10n.getConstant("editRecurrence")}});if(this.buttonObj=new zv({iconCss:"e-recurrence-edit e-icons",cssClass:"e-medium "+this.parent.cssClass}),n.appendChild(o),this.buttonObj.appendTo(o),i.appendChild(n),t.appendChild(i),this.parent.isAdaptive?E.add(o,"click",this.loadRecurrenceEditor,this):this.createRecurrenceEditor(e),0<this.parent.resourceCollection.length){for(var r=this.createDivElement("e-resources-row"),s=0,a=this.parent.resourceBase.resourceCollection;s<a.length;s++){var l=a[s];r.appendChild(this.renderResourceDetails(l))}e.appendChild(r)}n=this.createDivElement(TVe+"-row"),n.appendChild(this.renderTextBox(TVe)),e.appendChild(n),t=Q("button",{attrs:{type:"hidden",title:"submit"}});return t.style.display="none",e.appendChild(t),e},Qze.prototype.createRecurrenceEditor=function(e){var t=Q("div",{id:this.parent.element.id+"_recurrence_editor"});e.appendChild(t),this.recurrenceEditor=this.renderRecurrenceEditor(),this.recurrenceEditor.appendTo(t),this.updateMinMaxDateToEditor()},Qze.prototype.createDivElement=function(e){return Q("div",{className:e})},Qze.prototype.createInputElement=function(e,t,i){return Q(i||"input",{className:e,attrs:{type:"text",name:t,value:"",id:t}})},Qze.prototype.getSlotDuration=function(){return this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount},Qze.prototype.renderDateTimePicker=function(e,t){var i=this.createDivElement(e+"-container"),n=this.getFieldName(e),n=this.createInputElement(e+" "+Hze,n);return i.appendChild(n),new jq({change:t,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,calendarMode:this.parent.calendarMode,min:this.parent.minDate,max:new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,locale:this.parent.locale,floatLabelType:"Always",strictMode:!0,timeFormat:this.parent.activeViewOptions.timeFormat,format:(je(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat)+" "+this.parent.activeViewOptions.timeFormat,placeholder:this.getFieldLabel(e),step:this.getSlotDuration(),width:"100%"}).appendTo(n),i},Qze.prototype.refreshDateTimePicker=function(e){for(var t=0,i=[].slice.call(this.element.querySelectorAll(".e-start,.e-end"));t<i.length;t++){var n=i[t].ej2_instances[0];n.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek,n.timeFormat=this.parent.activeViewOptions.timeFormat,n.step=e||this.getSlotDuration(),n.dataBind()}},Qze.prototype.onTimeChange=function(){var e,t,i=this.getInstance(xVe);i.element.parentElement.classList.contains("e-input-focus")&&(e=this.getInstance(IVe),t=0,this.cellClickAction?(t=6e4*this.duration,this.eventWindowTime.startTime=i.value):t=this.eventData[this.fields.endTime].getTime()-this.eventData[this.fields.startTime].getTime(),i=je(i.value)?null:new Date(i.value.getTime()+t),this.cellClickAction&&(this.eventWindowTime.endTime=i),e.value=i,e.dataBind()),this.recurrenceEditor&&this.recurrenceEditor.updateRuleUntilDate(this.eventWindowTime.startTime)},Qze.prototype.renderResourceDetails=function(t){function e(e){return go.sanitize('<div class="e-resource-template">\n                <div class="e-resource-color" data-resource-color="'+e[t.colorField]+'"></div>\n                <div class="e-resource-text">'+e[t.textField]+"</div></div>")}var i=this,n=t.field,o="e-"+n,r=t.title,s=this.createDivElement(o+"-container e-resources"),o=this.createInputElement(o+" "+Hze,n);s.appendChild(o);return ao(e,t),(t.allowMultiple?new zU({enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass||"",dataSource:t.dataSource,change:this.onMultiselectResourceChange.bind(this),itemTemplate:e,fields:{text:t.textField,value:t.idField},htmlAttributes:{name:n},floatLabelType:"Always",placeholder:r,popupHeight:"230px",popupWidth:"447px",mode:"Box",open:function(e){Promise.resolve().then(function(){i.applyStylesAfterRender(e)})}}):new qz({cssClass:this.parent.cssClass||"",change:this.onDropdownResourceChange.bind(this),dataSource:t.dataSource,enableRtl:this.parent.enableRtl,fields:{text:t.textField,value:t.idField},htmlAttributes:{name:n},floatLabelType:"Always",placeholder:r,popupHeight:"230px",popupWidth:"447px",itemTemplate:e,open:function(e){Promise.resolve().then(function(){i.applyStylesAfterRender(e)})}})).appendTo(o),s},Qze.prototype.applyStylesAfterRender=function(e){e.popup&&e.popup.element&&e.popup.element.querySelectorAll(".e-resource-color[data-resource-color]").forEach(function(e){var t=e.getAttribute("data-resource-color");t&&(e.style.backgroundColor=t)})},Qze.prototype.renderDropDown=function(e){var i=this,t=this.getFieldName(e),n=this.createDivElement(e+"-container"),o=this.createInputElement(e+" "+Hze,t);return n.appendChild(o),new qz({allowFiltering:!0,change:this.onTimezoneChange.bind(this),cssClass:this.parent.cssClass||"",dataSource:this.parent.timezoneDataSource,enableRtl:this.parent.enableRtl,fields:{text:"Text",value:"Value"},filterBarPlaceholder:this.parent.localeObj.getConstant("searchTimezone"),noRecordsTemplate:this.parent.localeObj.getConstant("noRecords"),filtering:function(e){var t=new ya,t=""!==e.text?t.where("Text","contains",e.text,!0):t;e.updateData(i.parent.timezoneDataSource,t)},htmlAttributes:{title:this.getFieldLabel(e),name:t},floatLabelType:"Always",placeholder:this.getFieldLabel(e),popupHeight:"230px"}).appendTo(o),n},Qze.prototype.onMultiselectResourceChange=function(n){if(n.value&&this.parent.activeViewOptions.group.byGroupID&&!(this.parent.resourceCollection.length<=1))for(var o=this.parent.resourceBase.resourceCollection,e=n.element.getAttribute("name")||this.getColumnName(n.element),r=0;r<o.length;r++)if(o[parseInt(r.toString(),10)].field===e&&r<o.length-1){for(var t=this.createInstance(r),s=[],a=this,i=0;i<n.value.length;i++)!function(t){var i=o[r+1],e=i.dataSource.filter(function(e){return e[i.groupIDField]===n.value[parseInt(t.toString(),10)]})[0],e=je(e)?null:e[o[r+1].groupIDField],e=a.filterDatasource(r,e);s=s.concat(e)}(i);t.dataSource=s,t.dataBind()}},Qze.prototype.createInstance=function(e){e=this.parent.resourceBase.resourceCollection[e+1],e=this.element.querySelector(".e-"+e.field).ej2_instances[0];return e.clear(),e},Qze.prototype.onDropdownResourceChange=function(e){if(e.value&&!(this.parent.resourceCollection.length<=1)&&this.parent.activeViewOptions.group.byGroupID)for(var t,i,n=e.element.getAttribute("name")||this.getColumnName(e.element),o=this.parent.resourceBase.resourceCollection,r=0;r<o.length;r++)r<o.length-1&&o[parseInt(r.toString(),10)].field===n&&(t=this.createInstance(r),i=e.itemData[o[parseInt(r.toString(),10)].idField],t.dataSource=this.filterDatasource(r,i),t.dataBind(),i=0<t.dataSource.length?t.dataSource[0][o[r+1].idField]:null,t.value=o[r+1].allowMultiple?[i]:i,t.dataBind())},Qze.prototype.filterDatasource=function(e,t){var i=this.parent.resourceBase.resourceCollection[e+1];return i.dataSource.filter(function(e){return e[i.groupIDField]===t})},Qze.prototype.onTimezoneChange=function(e){var t;(e.element.getAttribute("name")||this.getColumnName(e.element))===this.parent.eventFields.startTimezone&&(e=this.getInstance(MVe),(t=this.getInstance(kVe)).value=e.value,t.dataBind())},Qze.prototype.renderCheckBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),n=this.createInputElement(e+" "+Hze,i),e=(t.appendChild(n),new ib({change:this.onChange.bind(this),cssClass:e+" "+this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,label:this.getFieldLabel(e)}));return e.appendTo(n),n.setAttribute("name",i),"Repeat"===i&&(this.repeatStatus=e),t},Qze.prototype.renderTextBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),i=this.createInputElement(e+" "+Hze,i,e===TVe?"textarea":"input");return t.appendChild(i),HF.createInput({element:i,floatLabelType:"Always",properties:{enableRtl:this.parent.enableRtl,placeholder:this.getFieldLabel(e)}}),t},Qze.prototype.getFieldName=function(e){var t="";switch(e){case CVe:t=this.fields.subject;break;case SVe:t=this.fields.location;break;case xVe:t=this.fields.startTime;break;case IVe:t=this.fields.endTime;break;case TVe:t=this.fields.description;break;case vVe:t=this.fields.isAllDay;break;case MVe:t=this.fields.startTimezone;break;case kVe:t=this.fields.endTimezone;break;case bVe:t="Timezone";break;case wVe:t="Repeat"}return t},Qze.prototype.getFieldLabel=function(e){var t="";switch(e){case CVe:t=this.parent.editorTitles.subject;break;case SVe:t=this.parent.editorTitles.location;break;case TVe:t=this.parent.editorTitles.description;break;case xVe:t=this.parent.editorTitles.startTime;break;case IVe:t=this.parent.editorTitles.endTime;break;case MVe:t=this.parent.editorTitles.startTimezone;break;case kVe:t=this.parent.editorTitles.endTimezone;break;case wVe:t=this.parent.editorTitles.recurrenceRule;break;case vVe:t=this.parent.editorTitles.isAllDay;break;case bVe:t=this.l10n.getConstant("timezone")}return t},Qze.prototype.onChange=function(e){var t;e.event&&e.event.target&&((t=z(e.event.target,".e-all-day,.e-time-zone,.e-repeat")).classList.contains(vVe)?this.onAllDayChange(e.checked):t.classList.contains(bVe)?this.timezoneChangeStyle(e.checked):t.classList.contains(wVe)&&this.onRepeatChange(e.checked))},Qze.prototype.renderRepeatDialog=function(){var e=Q("div");this.repeatDialogObject=new pS({header:this.l10n.getConstant("recurrence"),visible:!1,content:'<div class="e-rec-editor"></div>',closeOnEscape:!0,width:"90%",buttons:[{click:this.repeatSaveDialog.bind(this),buttonModel:{content:this.l10n.getConstant("save"),cssClass:"e-save",isPrimary:!0}},{click:this.repeatCancelDialog.bind(this),buttonModel:{cssClass:"e-cancel",content:this.l10n.getConstant("cancel")}}],target:this.element,animationSettings:{effect:"Zoom"},enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,isModal:!0,cssClass:"e-recurrence-dialog",open:this.repeatOpenDialog.bind(this)}),this.element.appendChild(e),this.repeatDialogObject.appendTo(e),this.createRecurrenceEditor(this.repeatDialogObject.element.querySelector(".e-rec-editor"))},Qze.prototype.loadRecurrenceEditor=function(){this.repeatDialogObject.show(),this.recurrenceEditor&&this.repeatRule&&this.recurrenceEditor.setRecurrenceRule(this.repeatRule)},Qze.prototype.onRepeatChange=function(e){e?(this.repeatDialogObject||this.renderRepeatDialog(),this.recurrenceEditor.setProperties({startDate:this.repeatStartDate,selectedType:0}),this.loadRecurrenceEditor()):(this.repeatDialogObject&&this.repeatDialogObject.hide(),this.repeatRule="",this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(this.repeatRule),this.updateRepeatLabel(this.repeatRule)),U([this.element.querySelector("."+zze)],jze))},Qze.prototype.repeatSaveDialog=function(){this.repeatRule=this.recurrenceEditor.getRecurrenceRule();var e=this.element.querySelector("."+zze);this.recurrenceEditor.getRecurrenceRule()?q([e],jze):(U([e],jze),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule),this.closeRepeatDialog()},Qze.prototype.closeRepeatDialog=function(){this.repeatDialogObject.hide()},Qze.prototype.repeatCancelDialog=function(){this.closeRepeatDialog(),this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(this.repeatTempRule),this.repeatTempRule||this.repeatStatus.setProperties({checked:!1})},Qze.prototype.repeatOpenDialog=function(){this.repeatTempRule=this.recurrenceEditor.getRecurrenceRule()},Qze.prototype.onCellDetailsUpdate=function(e,t){var i;this.parent.eventSettings.allowAdding&&(this.parent.isAdaptive&&t&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.element.querySelector("."+yVe).removeAttribute("data-id"),je(this.parent.editorHeaderTemplate)&&(this.element.querySelector("."+LVe).innerHTML=this.l10n.getConstant("newEvent")),e.Timezone=!1,this.repeatStartDate=e[this.fields.startTime],this.repeatRule="",je(this.parent.eventSettings.fields.subject.default)||(e[this.fields.subject]=this.parent.eventSettings.fields.subject.default),je(this.parent.eventSettings.fields.location.default)||(e[this.fields.location]=this.parent.eventSettings.fields.location.default),je(this.parent.eventSettings.fields.description.default)||(e[this.fields.description]=this.parent.eventSettings.fields.description.default),this.showDetails(e),e[this.fields.recurrenceRule]&&this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]),this.repeatRule=e[this.fields.recurrenceRule]),(i=this.element.querySelector("."+K2e))&&U([i],UOe),this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:e[this.fields.startTime],selectedType:je(t)?je(e[this.fields.recurrenceRule])?0:this.recurrenceEditor.selectedType:t}),this.repeatRule=this.recurrenceEditor.value),this.parent.isAdaptive&&je(this.parent.editorTemplate)?(i=this.element.querySelector("."+zze),e[this.fields.recurrenceRule]||t?(q([i],jze),this.repeatStatus.setProperties({checked:!0})):(U([i],jze),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)):(e=this.element.querySelector("."+FVe),this.disableButton(e,!1)),this.dialogObject.show())},Qze.prototype.convertToEventData=function(e,t){e.subject&&(t[this.fields.subject]=e.subject),t[this.fields.startTime]=e.startTime,t[this.fields.endTime]=e.endTime,t[this.fields.isAllDay]=e.isAllDay,e.RecurrenceRule&&(t[this.fields.recurrenceRule]=e.RecurrenceRule),(0<this.parent.resourceCollection.length||0<this.parent.activeViewOptions.group.resources.length)&&this.parent.resourceBase.setResourceValues(t)},Qze.prototype.applyFormValidation=function(){var e,t,i,n=this.element.querySelector("."+yVe);n&&(t={},je(i=(e=function(e){return e&&0<Object.keys(e).length?e:void 0})(this.parent.eventSettings.fields.subject.validation))||(t[this.parent.eventSettings.fields.subject.name]=i),je(i=e(this.parent.eventSettings.fields.location.validation))||(t[this.parent.eventSettings.fields.location.name]=i),je(i=e(this.parent.eventSettings.fields.startTime.validation))||(t[this.parent.eventSettings.fields.startTime.name]=i),je(i=e(this.parent.eventSettings.fields.endTime.validation))||(t[this.parent.eventSettings.fields.endTime.name]=i),je(i=e(this.parent.eventSettings.fields.description.validation))||(t[this.parent.eventSettings.fields.description.name]=i),this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.fieldValidator=new NHe,this.fieldValidator.renderFormValidator(n,t,this.element,this.parent.locale))},Qze.prototype.showDetails=function(e){for(var t=Pe({},this.eventData=e,null,!0),e=this.getFormElements(fVe),i=(this.cellClickAction&&(!this.cellClickAction||je(this.parent.editorTemplate))||0!==t[this.fields.endTime].getHours()||0!==t[this.fields.endTime].getMinutes()||this.trimAllDay(t),Object.keys(t)),n=0,o=e;n<o.length;n++){var r=o[n],s=r.name||this.getColumnName(r);je(s)||""===s||(-1!==i.indexOf(s)?this.setValueToElement(r,t[""+s]):this.setDefaultValueToElement(r))}je(this.parent.editorTemplate)&&(this.onAllDayChange(t[this.fields.isAllDay]),e=this.getInstance(bVe+"."+Hze),je(t[this.fields.startTimezone])&&je(t[this.fields.endTimezone])||(e.checked=!0,e.dataBind()),this.timezoneChangeStyle(e.checked),delete t.Timezone)},Qze.prototype.getColumnName=function(e){var t,i,n=e.getAttribute("data-name")||"";return n=""===n&&(i=!1,t="",e.classList.contains("e-dropdownlist")?(t="e-ddl",i=!0):e.classList.contains("e-multiselect")?(t="e-multiselect",i=!0):e.classList.contains("e-datetimepicker")?t="e-datetimepicker":e.classList.contains("e-datepicker")?t="e-datepicker":e.classList.contains("e-checkbox")?t="e-checkbox":e.classList.contains("e-numerictextbox")&&(t="e-numerictextbox"),i=z(e,i?"."+t+":not(.e-control)":"."+t)||e.querySelector("."+t))&&(e=i.querySelector("[name]"))?e.name:n},Qze.prototype.onAllDayChange=function(e){var t,i=this.getInstance(xVe),n=this.getInstance(IVe),o=this.element.querySelector(".e-time-zone-container");e?(t=je(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat,U(this.element.querySelectorAll(".e-time-icon"),RVe),U([o],UOe),this.element.querySelector("."+DVe)&&q([this.element.querySelector("."+DVe)],QOe)):(t=je(this.parent.dateFormat)?this.getFormat("dateFormats")+" "+this.parent.activeViewOptions.timeFormat:this.parent.dateFormat+" "+this.parent.activeViewOptions.timeFormat,q(this.element.querySelectorAll(".e-time-icon"),RVe),q([o],UOe),this.element.querySelector(".e-checkbox-wrapper .e-time-zone").checked&&U([this.element.querySelector("."+DVe)],QOe)),i.format=n.format=t,this.cellClickAction&&this.updateDateTime(e,i,n),i.dataBind(),n.dataBind(),je(this.recurrenceEditor)||this.recurrenceEditor.updateRuleUntilDate(i.value)},Qze.prototype.updateDateTime=function(e,t,i){var n,o;e?(o=gOe(new Date(this.eventWindowTime.startTime.getTime())),n=this.parent.activeCellsData.isAllDay?(e=yOe(new Date(this.eventWindowTime.endTime.getTime()),-1).getTime(),+this.eventWindowTime.startTime>e?this.eventWindowTime.endTime:new Date(e)):gOe(new Date(this.eventWindowTime.endTime.getTime()))):(e=this.parent.activeCellsData.startTime,(o=new Date(this.eventWindowTime.startTime.getTime())).setHours(e.getHours(),e.getMinutes(),e.getSeconds()),this.parent.activeCellsData.isAllDay?(e=this.parent.getStartEndTime(this.parent.workHours.start),o.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),(n=new Date(o.getTime())).setMilliseconds(6e4*this.getSlotDuration())):(n=new Date(o.getTime())).setMilliseconds(this.parent.activeCellsData.endTime.getTime()-this.parent.activeCellsData.startTime.getTime())),this.eventWindowTime={startTime:new Date(o.getTime()),endTime:new Date(n.getTime())},t.value=o,i.value=n,t.dataBind(),i.dataBind()},Qze.prototype.getFormat=function(e){e=je(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?R(e+".short",Pi(this.parent.getCalendarMode())):R("main."+this.parent.locale+".dates.calendars."+this.parent.getCalendarMode()+"."+e+".short",Ai);return e},Qze.prototype.onEventDetailsUpdate=function(e){var t,i;this.parent.eventSettings.allowEditing&&(!this.parent.isAdaptive&&je(this.parent.editorFooterTemplate)&&q([this.element.querySelector("."+K2e)],UOe),je(this.parent.editorHeaderTemplate)&&(this.element.querySelector("."+LVe).innerHTML=this.l10n.getConstant("editEvent")),this.element.querySelector("."+yVe).setAttribute("data-id",e[this.fields.id].toString()),je(this.parent.editorTemplate)&&(e=Pe({},e,null,!0),t=this.getInstance(bVe+"."+Hze),i=void 0,e[this.fields.startTimezone]||e[this.fields.endTimezone]?(i=!0,this.parent.eventBase.timezoneConvert(e)):i=!1,e.Timezone=i,t.checked=i,t.dataBind()),this.showDetails(e),e[this.fields.recurrenceRule]&&this.recurrenceEditor?this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]):!this.parent.isAdaptive&&this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:e[this.fields.startTime]}),this.recurrenceEditor.setRecurrenceRule("")),this.repeatStartDate=e[this.fields.startTime],this.repeatRule="",e[this.fields.recurrenceRule]&&(this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]),this.repeatRule=e[this.fields.recurrenceRule]),this.parent.isAdaptive&&je(this.parent.editorTemplate)&&(i=this.element.querySelector("."+zze),e[this.fields.recurrenceRule]?(q([i],jze),this.repeatStatus.setProperties({checked:!0})):(U([i],jze),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)),t=this.parent.readonly||e[this.fields.isReadonly],this.parent.isAdaptive?(i=this.element.querySelector("."+PVe))&&(t?U:q)([i],o_e):(e=this.element.querySelector("."+FVe),i=this.element.querySelector("."+K2e),this.disableButton(e,t),this.disableButton(i,t)),this.dialogObject.show())},Qze.prototype.disableButton=function(e,t){e&&(e.ej2_instances[0].disabled=t)},Qze.prototype.renderRecurrenceEditor=function(){return new Vze({calendarMode:this.parent.calendarMode,cssClass:this.parent.cssClass,dateFormat:this.parent.dateFormat,enableRtl:this.parent.enableRtl,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,locale:this.parent.locale})},Qze.prototype.updateMinMaxDateToEditor=function(){var e=this.element.querySelector(".e-start"),t=this.element.querySelector(".e-end");e&&t&&(e=e.ej2_instances[0],t=t.ej2_instances[0],e.min=this.parent.minDate,e.max=this.parent.maxDate,t.min=this.parent.minDate,t.max=this.parent.maxDate,e.dataBind(),t.dataBind()),this.recurrenceEditor&&(e=this.recurrenceEditor.element.querySelector(".e-until-date"))&&((t=e.ej2_instances[0]).min=this.parent.minDate,t.max=this.parent.maxDate,t.dataBind())},Qze.prototype.updateRepeatLabel=function(e){this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog();e=e?this.l10n.getConstant("repeats")+" "+this.recurrenceEditor.getRuleSummary(e):this.l10n.getConstant("repeat");this.repeatStatus.setProperties({label:e})},Qze.prototype.dialogClose=function(e){this.isEnterKey?this.isEnterKey=!1:(this.dialogEvent=e,this.isCrudAction=!1,this.parent.activeEventData={event:void 0,element:void 0},this.parent.currentAction=null,this.dialogObject.hide())},Qze.prototype.resetForm=function(){this.fieldValidator.destroyToolTip(),this.resetFormFields(),this.parent.isAdaptive||!this.recurrenceEditor||this.recurrenceEditor.isDestroyed||this.recurrenceEditor.resetFields()},Qze.prototype.timezoneChangeStyle=function(e){var t,i,n=this.element.querySelector("."+DVe),o=this.parent.tzModule.getLocalTimezoneName();e?(U([n],QOe),e=this.getInstance(MVe),t=this.getInstance(kVe),i=e.dataSource,e.value&&this.parent.timezone||i.some(function(e){return e.Value===o})||(i.push({Value:o,Text:o}),e.dataSource=i,t.dataSource=i,e.dataBind(),t.dataBind()),e.value=e.value||this.parent.timezone||o,t.value=t.value||this.parent.timezone||o,e.dataBind(),t.dataBind()):q([n],QOe)},Qze.prototype.resetFormFields=function(){for(var e=0,t=this.getFormElements(fVe);e<t.length;e++){var i=t[e],n=i.name||this.getColumnName(i);je(n)||""===n||this.setDefaultValueToElement(i)}},Qze.prototype.eventSave=function(e,t){var i;this.isEnterKey?this.isEnterKey=!1:(i=this.element.querySelector("."+yVe))&&i.classList.contains("e-formvalidator")&&!i.ej2_instances[0].validate()||(i=this.getEventDataFromEditor(),this.processEventValidation(i.tempData,t))||(this.eventCrudData=i.eventData,this.dialogEvent=e,this.isCrudAction=!0,this.dialogObject.hide())},Qze.prototype.getEventDataFromEditor=function(){var e=Pe({},this.getObjectFromFormData(fVe)),t=(e.Timezone||(e[this.fields.startTimezone]=null,e[this.fields.endTimezone]=null),delete e.Timezone,delete e.Repeat,this.setDefaultValueToObject(e),e[this.fields.recurrenceRule]=this.recurrenceEditor?this.recurrenceEditor.getRecurrenceRule()||null:void 0,Pe({},e,null,!0));return e[this.fields.isAllDay]&&(e[this.fields.startTime]=je(e[this.fields.startTime])?null:gOe(new Date(e[this.fields.startTime].getTime())),e[this.fields.endTime]=je(e[this.fields.endTime])?null:yOe(gOe(new Date(e[this.fields.endTime].getTime())),1)),{eventData:e,tempData:t}},Qze.prototype.processEventValidation=function(e,t){var i;if(je(this.parent.editorTemplate)){if(!e[this.fields.startTime]||!e[this.fields.endTime])return this.parent.quickPopup.openValidationError("invalidDateError"),!0;if(e[this.fields.startTime]>e[this.fields.endTime])return this.parent.quickPopup.openValidationError("startEndError"),!0}if(this.recurrenceEditor&&this.recurrenceEditor.value&&""!==this.recurrenceEditor.value){var n=!0;if("seriesChangeAlert"===(i="EditOccurrence"!==this.parent.currentAction?this.recurrenceValidation(e[this.fields.startTime],e[this.fields.endTime],t):i)&&this.parent.uiStateValues.isIgnoreOccurrence&&(n=!1),!je(i)&&n&&(!this.parent.enableRecurrenceValidation&&"wrongPattern"===i||this.parent.enableRecurrenceValidation))return this.parent.quickPopup.openRecurrenceValidationAlert(i),!0}return!1},Qze.prototype.processCrudActions=function(e){var t=this,i=(this.parent.uiStateValues.isBlock=!1,this.getResourceData(e)),i=(0<this.parent.activeViewOptions.group.resources.length||0<this.parent.resourceCollection.length)&&!this.parent.activeViewOptions.group.allowGroupEdit&&!je(i),n=this.getEventIdFromForm();if(je(n)){if(this.parent.currentAction="Add",this.parent.eventBase.checkOverlap(e))return!0;i?this.resourceSaveEvent(e,this.parent.currentAction):(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),this.parent.addEvent(e))}else{var o="string"===this.parent.eventBase.getEventIDType()?n:parseInt(n,10),n=this.parent.eventsData.filter(function(e){return e[t.fields.id]===o})[0];if((e=Pe({},n=je(n)?this.parent.blockData.filter(function(e){return e[t.fields.id]===o})[0]:n,e))[this.fields.isReadonly])return!1;if(this.parent.eventBase.checkOverlap(e))return!0;var r=void 0;if(!je(n[this.fields.recurrenceRule])){if(r=this.parent.currentAction,e.Guid=this.parent.activeEventData.event.Guid,"EditOccurrence"===this.parent.currentAction&&(e[this.fields.recurrenceID]?(o=e[this.fields.recurrenceID],r=null):(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),e.Guid=this.parent.activeEventData.event.Guid),this.parent.enableRecurrenceValidation)&&this.editOccurrenceValidation(o,e))return!0;"EditSeries"===this.parent.currentAction||e[this.fields.id]!==n[this.fields.id]?e[this.fields.recurrenceID]=n[this.fields.id]:"EditFollowingEvents"===this.parent.currentAction&&(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),e[this.fields.followingID]=n[this.fields.id])}i?this.resourceSaveEvent(e,"Save",r):this.parent.saveEvent(e,r)}return this.parent.uiStateValues.isBlock},Qze.prototype.getResourceData=function(e){var t=null;return t=!je(this.parent.resourceBase)&&!je(this.parent.resourceBase.resourceCollection)&&0<this.parent.resourceBase.resourceCollection.length?e[this.parent.resourceBase.resourceCollection.slice(-1)[0].field]:t},Qze.prototype.getObjectFromFormData=function(e){for(var t={},i=0,n=this.getFormElements(e);i<n.length;i++){var o=n[i],r=o.name||this.getColumnName(o);je(r)||""===r||(t[""+r]=this.getValueFromElement(o))}return t},Qze.prototype.setDefaultValueToObject=function(e){je(e[this.fields.subject])||(e[this.fields.subject]=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.l10n.getConstant("addTitle")),je(e[this.fields.location])||(e[this.fields.location]=e[this.fields.location]||this.parent.eventSettings.fields.location.default),je(e[this.fields.description])||(e[this.fields.description]=e[this.fields.description]||this.parent.eventSettings.fields.description.default)},Qze.prototype.recurrenceValidation=function(e,t,i){var n,o=this.recurrenceEditor,r=this.getInstance("e-repeat-interval.e-numerictextbox").value;if(i!==this.l10n.getConstant("ok")){var s,a,i=this.parent.activeEventData.event,l=[];if("EditSeries"!==this.parent.currentAction&&"EditFollowingEvents"!==this.parent.currentAction||je(i)||(s=i[this.parent.eventFields.startTime],l=0<(a=this.parent.eventBase.getSeriesEvents(this.eventData,s)).length?this.parent.eventBase.getEditedOccurrences(a,s):(a=this.parent.eventBase.getEventById(i[this.parent.eventFields.id]),this.parent.eventBase.getEditedOccurrences([a],s)),"EditSeries"!==this.parent.currentAction)||je(this.eventData[this.parent.eventFields.recurrenceException])||l.push(this.eventData),0<l.length&&(n="seriesChangeAlert"),je(n="until"===this.getInstance("e-end-on-left .e-ddl .e-dropdownlist").value&&this.getInstance("e-end-on-date .e-datepicker").value<e?"wrongPattern":n)){o.value.split(";")[1].split("=")[1].split(",");var h={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6},d=[],p=[];switch(o.value.split(";")[0].split("=")[1]){case"DAILY":(t.getTime()-e.getTime())/36e5>24*r&&(n="createError");break;case"WEEKLY":for(var c=o.value.split(";")[1].split("=")[1].split(","),u=0;u<c.length*(r+1);u++)d[parseInt(u.toString(),10)]=c.length>u?h[c[parseInt(u.toString(),10)]]:d[u-c.length]+7*r;for(var g=d.sort(function(e,t){return e-t}),u=1;u<g.length;u++)p.push(g[parseInt(u.toString(),10)]-g[u-1]);((t.getTime()-e.getTime())/36e5>=24*Math.min.apply(Math,p)||je(r))&&(n="createError");break;case"MONTHLY":t.getTime()>=new Date(+e).setMonth(e.getMonth()+r)&&(n="createError");break;case"YEARLY":t.getTime()>=new Date(+e).setFullYear(e.getFullYear()+r)&&(n="createError")}}}else je(n=t.getTime()>=new Date(+e).setMonth(e.getMonth()+r)?"createError":n)&&this.parent.quickPopup.quickDialog.hide();return n=je(r)?"createError":n},Qze.prototype.getRecurrenceIndex=function(e,t){for(var i,n=0;n<e.length;n++)if(t[this.fields.startTime].valueOf()===e[parseInt(n.toString(),10)][this.fields.startTime].valueOf()){i=n;break}return i},Qze.prototype.trimAllDay=function(e){var t;e[this.fields.isAllDay]&&(t=yOe(new Date(+e[this.fields.endTime]),-1).getTime(),e[this.fields.endTime]=+e[this.fields.startTime]>t?e[this.fields.endTime]:new Date(t))},Qze.prototype.editOccurrenceValidation=function(t,e,i){var n=this,o=(void 0===i&&(i=this.eventData),this.parent.getOccurrencesByID(t));this.parent.eventsData.filter(function(e){return e[n.fields.recurrenceID]===t}).map(function(e){return o.push(Pe({},e))}),e=Pe({},e),this.trimAllDay(e);for(var r=0,s=o;r<s.length;r++){var a=s[r];this.trimAllDay(a)}this.parent.eventBase.sortByTime(o);i=this.getRecurrenceIndex(o,i);if(!je(i)){var l,h,d=new Date(+e[this.fields.startTime]),e=new Date(+e[this.fields.endTime]),p=(i!==o.length-1&&(l=new Date(+o[i+1][this.fields.startTime]),h=new Date(+o[i+1][this.fields.endTime])),new Date(+o[o.length-1][this.fields.endTime]));if(0===i){if(!je(o[i+1])){if(!(l.getTime()>=e.getTime())&&gOe(p).getTime()>=gOe(d).getTime()||gOe(p).getTime()<gOe(d).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(gOe(d).getTime()<gOe(l).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}}else{var c=new Date(+o[i-1][this.fields.startTime]),u=new Date(+o[i-1][this.fields.endTime]);if(i===o.length-1){if(gOe(new Date(+o[o.length-1-i][this.fields.startTime])).getTime()>gOe(d).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(u.getTime()<=d.getTime()&&gOe(d).getTime()>gOe(c).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}else{if(!(gOe(c).getTime()<gOe(d).getTime()||gOe(new Date(+o[0][this.fields.startTime])).getTime()>gOe(d).getTime())||!(gOe(l).getTime()>gOe(d).getTime()||p.getTime()<d.getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0;if(!(u.getTime()<=d.getTime()&&l.getTime()>=e.getTime())||gOe(h).getTime()<gOe(d).getTime()||gOe(c).getTime()>gOe(e).getTime()||!(gOe(d).getTime()<gOe(l).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0}}}return!1},Qze.prototype.resourceSaveEvent=function(g,m,f){for(var y=this,v=this.parent.resourceBase.resourceCollection.slice(-1)[0],b=((b=g[v.field])instanceof Array?b:[b]).reverse(),w=this.parent.resourceBase.lastResourceLevel,C=[],e=function(i){function e(){if("Save"===m&&i===b.length-1)if(0<o.length){o[0][y.fields.id]=g[y.fields.id];for(var e=1;e<o.length;e++)o[parseInt(e.toString(),10)][y.fields.id]=y.parent.eventBase.getEventMaxID(i),C.push(o[parseInt(e.toString(),10)]),y.parent.saveEvent(o[0],f)}else n[y.fields.id]=g[y.fields.id],y.parent.saveEvent(n,f);else if(0<o.length)for(var t=0;t<o.length;t++)o[parseInt(t.toString(),10)][y.fields.id]=y.parent.eventBase.getEventMaxID(t),C.push(o[parseInt(t.toString(),10)]);else n[y.fields.id]=y.parent.eventBase.getEventMaxID(i),C.push(n)}var n=Pe({},g,null,!0),o=(n[S.fields.id]=S.parent.eventBase.getEventMaxID(),[]);if(S.parent.activeViewOptions.group.byGroupID&&!je(w)){var t=v.dataSource,r=S.parent.resourceCollection,s=void 0;if((s=1<r.length?DOe(t,v.idField,b[parseInt(i.toString(),10)],n,r):DOe(t,v.idField,b[parseInt(i.toString(),10)]))<0)return{value:void 0};for(var a=t[parseInt(s.toString(),10)][v.groupIDField],l=w.filter(function(e){return e.resourceData[v.idField]===b[parseInt(i.toString(),10)]}).filter(function(e){return e.resourceData[v.groupIDField]===a})[0].groupOrder,h=0;h<S.parent.resourceBase.resourceCollection.length;h++){var d=S.parent.resourceBase.resourceCollection[parseInt(h.toString(),10)].field;n[""+d]=l[parseInt(h.toString(),10)]instanceof Array?l[parseInt(h.toString(),10)][0]:l[parseInt(h.toString(),10)]}}else{for(s=0;s<S.parent.resourceBase.resourceCollection.length-1;s++){d=S.parent.resourceBase.resourceCollection[parseInt(s.toString(),10)].field;if(n[""+d]instanceof Array&&1<n[""+d].length)for(var p=0;p<n[""+d].length;p++){var c=Pe({},n,null,!0);c[""+d]=g[""+d][parseInt(p.toString(),10)],c[v.field]=b[parseInt(i.toString(),10)],o.push(c)}else if(0===o.length)n[""+d]=g[""+d]instanceof Array?g[""+d][0]:g[""+d],n[v.field]=b[parseInt(i.toString(),10)];else for(var u=0;u<o.length;u++)o[parseInt(u.toString(),10)][""+d]=g[""+d]instanceof Array?g[""+d][0]:g[""+d]}n[v.field]=b[parseInt(i.toString(),10)]}e()},S=this,t=0;t<b.length;t++){var i=e(t);if("object"==typeof i)return i.value}if(0<C.length){for(var n=0,o=C;n<o.length;n++){var r=o[n];r[this.fields.recurrenceException]=null,r[this.fields.recurrenceID]=null}this.parent.addEvent(C)}},Qze.prototype.getEventIdFromForm=function(){return this.element.querySelector("."+yVe).getAttribute("data-id")},Qze.prototype.getFormElements=function(e){return e===fVe?[].slice.call(this.element.querySelectorAll("."+Hze)):[].slice.call(this.parent.element.querySelectorAll("."+e+" ."+Hze))},Qze.prototype.getValueFromElement=function(e){e=e.classList.contains("e-datepicker")||e.classList.contains("e-datetimepicker")||e.classList.contains("e-dropdownlist")||e.classList.contains("e-multiselect")?e.ej2_instances[0].value:e.classList.contains("e-checkbox")?e.ej2_instances[0].checked:e.classList.contains("e-numerictextbox")?e.ej2_instances[0].value:"checkbox"===e.type?e.checked:this.parent.enableHtmlSanitizer?go.sanitize(e.value):e.value;return e},Qze.prototype.setValueToElement=function(e,t){var i;e.classList.contains("e-datepicker")?((i=e.ej2_instances[0]).value=t,i.dataBind()):e.classList.contains("e-datetimepicker")?((i=e.ej2_instances[0]).element.classList.contains(xVe)?this.eventWindowTime.startTime=new Date(""+t):this.eventWindowTime.endTime=new Date(""+t),i.value=t,i.dataBind()):e.classList.contains("e-dropdownlist")?((i=e.ej2_instances[0]).value=t,i.dataBind()):e.classList.contains("e-multiselect")?((i=e.ej2_instances[0]).value=[],i.value=t instanceof Array?t:[t],i.dataBind()):e.classList.contains("e-checkbox")?((i=e.ej2_instances[0]).checked=t,i.dataBind()):e.classList.contains("e-numerictextbox")?((i=e.ej2_instances[0]).value=t,i.dataBind()):"checkbox"!==e.type?e.value=t||"":e.checked=t},Qze.prototype.setDefaultValueToElement=function(e){var t,i;e.classList.contains("e-datepicker")?((i=e.ej2_instances[0]).value=this.parent.getCurrentTime(),i.dataBind()):e.classList.contains("e-datetimepicker")?(i=e.ej2_instances[0],t=this.parent.getCurrentTime(),this.eventWindowTime={startTime:t,endTime:t},i.value=t,i.dataBind()):e.classList.contains("e-dropdownlist")?((i=e.ej2_instances[0]).value=null,i.dataBind()):e.classList.contains("e-multiselect")?((i=e.ej2_instances[0]).value=[],i.dataBind()):e.classList.contains("e-checkbox")?((i=e.ej2_instances[0]).checked=!1,i.dataBind()):e.classList.contains("e-numerictextbox")?((i=e.ej2_instances[0]).value=null,i.dataBind()):"checkbox"===e.type?e.checked=!1:e.value=""},Qze.prototype.getInstance=function(e){e=this.element.querySelector("."+e);return e?e.ej2_instances[0]:null},Qze.prototype.eventDelete=function(e){if(this.isEnterKey)this.isEnterKey=!1;else{switch(this.parent.currentAction){case"EditOccurrence":je(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])?this.parent.currentAction="Delete":this.parent.currentAction="DeleteOccurrence";break;case"EditSeries":this.parent.currentAction="DeleteSeries";break;case"Save":this.parent.currentAction="Delete";break;case"EditFollowingEvents":je(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])||(this.parent.currentAction="DeleteFollowingEvents")}this.dialogEvent=e,this.isCrudAction=!1,this.dialogObject.hide(),this.parent.quickPopup.openDeleteAlert()}},Qze.prototype.getRecurrenceEditorInstance=function(){return this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.recurrenceEditor},Qze.prototype.destroyComponents=function(){for(var e=0,t=this.getFormElements(fVe);e<t.length;e++){var i=t[e],n=void 0;(n=i.classList.contains("e-datetimepicker")||i.classList.contains("e-datepicker")||i.classList.contains("e-checkbox")||i.classList.contains("e-dropdownlist")||i.classList.contains("e-multiselect")||i.classList.contains("e-numerictextbox")?i.ej2_instances:n)&&n[0]&&n[0].destroy()}this.buttonObj&&this.buttonObj.destroy()},Qze.prototype.detachComponents=function(){for(var e=0,t=this.getFormElements(fVe);e<t.length;e++)G(t[e])},Qze.prototype.destroy=function(e){var t;this.parent&&!this.parent.isDestroyed&&this.parent.resetTemplates(["editorTemplate","editorHeaderTemplate","editorFooterTemplate"]),this.destroyComponents(),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),G(this.recurrenceEditor.element),this.recurrenceEditor=null),this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.repeatDialogObject&&(this.repeatDialogObject.destroy(),this.repeatDialogObject=null),this.detachComponents(),this.dialogObject&&(this.dialogObject.element&&(kOe(t=this.dialogObject.element.querySelector("form")),G(t),E.remove(this.dialogObject.element,"keydown",this.preventEventSave)),this.dialogObject.destroy(),this.dialogObject=null),this.element&&(ue(this.element),this.element=null),e||(this.l10n=null,this.parent=null,this.fields=null,this.buttonObj=null,this.repeatStatus=null,this.eventWindowTime=null,this.dialogEvent=null)},Qze);function Qze(e){this.parent=e,this.l10n=this.parent.localeObj,this.fields=this.parent.eventFields,this.eventWindowTime={startTime:new Date,endTime:new Date},this.renderEventWindow()}qze.prototype.addEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.on(KRe,this.virtualScrolling,this)},qze.prototype.removeEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.off(KRe,this.virtualScrolling)},qze.prototype.getRenderedCount=function(){this.setItemSize();var e=this.isHorizontalScroll?this.parent.element.clientWidth:this.parent.element.clientHeight;return this.renderedLength=Math.ceil(e/this.itemSize)+this.bufferCount,this.renderedLength},qze.prototype.renderVirtualTrack=function(e){var t,i=Q("div",{className:n2e});this.isHorizontalScroll?(t=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1].length,i.style.width=t*this.itemSize+"px"):i.style.height=this.parent.resourceBase.expandedResources.length*this.itemSize+"px",e.appendChild(i)},qze.prototype.updateVirtualScrollHeight=function(){var e=this.parent.element.querySelector("."+n2e),t=this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex;this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex!==t?(t=this.parent.element.querySelector("."+KOe),this.renderedLength=t.querySelector("tbody").children.length,e.style.height=t.offsetHeight+(this.parent.resourceBase.expandedResources.length-this.renderedLength)*t.offsetHeight/this.renderedLength+"px",(t=this.parent.element.querySelector("."+i2e)).scrollHeight-t.scrollTop<t.offsetHeight*this.bufferCount&&(e.style.height=parseInt(e.style.height,10)+t.offsetHeight*this.bufferCount+"px")):e.style.height="",this.averageRowHeight=e.offsetHeight/this.parent.resourceBase.expandedResources.length},qze.prototype.updateVirtualTrackHeight=function(e){var t,i,n,o=this.parent.resourceBase.renderedResources.length;o!==this.getRenderedCount()?(e.style.height=this.parent.element.querySelector(".e-content-wrap").clientHeight+"px",i=this.parent.element.querySelector("."+fNe),n=this.parent.element.querySelector("."+i2e),t=this.parent.element.querySelector("."+uNe),this.translateY=0,this.setTranslate(i,n,t)):(i=this.parent.resourceBase.renderedResources[o-1].groupIndex,n=(n=o+(this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex-i))>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length:n,e.style.height=n*this.itemSize+"px")},qze.prototype.setItemSize=function(){this.isHorizontalScroll?this.itemSize=oOe(this.parent.activeView.element,JOe,this.parent.uiStateValues.isTransformed)||this.itemSize:this.itemSize=this.parent.getElementHeightFromClass(this.parent.activeView.element,JOe)||this.itemSize},qze.prototype.refreshLayout=function(){var e,t,i,n=this.parent.uiStateValues.scheduleHeight,o=(this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight,this.renderedLength);this.parent.uiStateValues.scheduleHeight!==n&&(o<this.getRenderedCount()&&(this.isRemoteRefresh=!0),n=this.parent.element.querySelector("."+fNe),o=this.parent.element.querySelector("."+i2e),e=this.parent.element.querySelector("."+uNe),this.parent.rowAutoHeight||(this.enableTransition=!1,q([o,n],"e-transition")),i=(i=(t=(i=parseInt(n.querySelector("tbody td").getAttribute("data-group-index"),10))+this.renderedLength)>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length-this.renderedLength:i)<0?0:i,this.existingDataCollection=this.parent.resourceBase.renderedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources.slice(i,t),0<this.parent.resourceBase.renderedResources.length)&&this.updateContent(n,o,e,this.parent.resourceBase.renderedResources)},qze.prototype.renderEvents=function(){this.setTabIndex();var e=this.triggerScrollEvent(ORe);if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&this.parent.crudModule)return 0<e.length?(this.parent.crudModule.refreshProcessedData(!0,e),void this.parent.hideSpinner()):void this.parent.crudModule.refreshDataManager();this.parent.crudModule&&this.parent.crudModule.refreshProcessedData(!0),"Month"!==this.parent.currentView&&this.parent.notify(YRe,{}),this.parent.hideSpinner()},qze.prototype.virtualScrolling=function(){var e,t,i,n,o,r,s=this,a=(this.parent.quickPopup&&(this.parent.quickPopup.quickPopupHide(),this.parent.quickPopup.morePopup.hide()),this.parent.element.querySelector("."+i2e));this.isHorizontalScroll?this.horizontalScrolling(a):(e=this.parent.element.querySelector("."+fNe),t=this.parent.element.querySelector("."+uNe),i=this.parent.element.querySelector("."+MNe),r=this.parent.element.querySelector("."+KOe),this.parent.rowAutoHeight||U([a,e],"e-transition"),this.renderedLength=e.querySelector("tbody").children.length,n=parseInt(e.querySelector("tbody td").getAttribute("data-group-index"),10),r=this.parent.rowAutoHeight?r.offsetHeight-a.offsetHeight:this.bufferCount*this.itemSize,o=[],this.existingDataCollection=this.parent.resourceBase.renderedResources,a.scrollTop-this.translateY<0?o=this.upScroll(a,n):a.scrollTop-this.translateY>r&&(o=this.downScroll(a,n)),!je(o)&&0<o.length&&(this.triggerScrollEvent(RRe),r=this.parent.getSelectedCells(),this.focusedEle=r[r.length-1]||this.focusedEle,this.updateContent(e,a,t,o),this.setTranslate(e,a,t,i),this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper(),window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout(function(){s.renderEvents()},250)))},qze.prototype.horizontalScrolling=function(e){var t=this,i=[],n=this.bufferCount*this.itemSize;Math.abs(e.scrollLeft)-Math.abs(this.translateY)<0?i=this.leftScroll(e):Math.abs(e.scrollLeft)-Math.abs(this.translateY)>n&&(i=this.rightScroll(e)),!je(i)&&0<i.length&&(this.parent.resourceBase.expandedResources.length===i.length&&this.parent.resourceBase.expandedResources[0]===i[0]&&this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1]===i[i.length-1]||(this.triggerScrollEvent(RRe),n=this.parent.activeView.colLevels.slice(0),this.updateHorizontalContent(e,i),gt(e.querySelector("table"),{transform:"translateX("+this.translateY+"px)"}),this.parent.activeView.colLevels=n,this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper()),window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout(function(){t.renderEvents()},250))},qze.prototype.triggerScrollEvent=function(t){var e,i=this,n=[];return this.parent.activeView&&(e={startDate:this.parent.activeView.startDate(),endDate:this.parent.activeView.endDate(),startIndex:this.parent.resourceBase.renderedResources[0].groupIndex,endIndex:this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex,resourceData:this.parent.resourceBase.renderedResources.map(function(e){return e.resourceData}),name:t},this.parent.trigger(t,e,function(e){t===RRe?i.parent.showSpinner():t===ORe&&!je(e.eventData)&&0<e.eventData.length&&(n=e.eventData)})),n},qze.prototype.upScroll=function(e,t){var i=0,i=~~(e.scrollTop/this.itemSize)+Math.ceil(e.clientHeight/this.itemSize)-this.renderedLength,i=(this.parent.rowAutoHeight&&(i=t<i?t-this.bufferCount:i),this.getBufferCollection(i=0<i?i:0,i+this.renderedLength));return this.parent.resourceBase.renderedResources=i,0===t?this.translateY=e.scrollTop:(t=0<(t=this.parent.rowAutoHeight?this.averageRowHeight:this.itemSize)?t:this.itemSize,this.translateY=0<e.scrollTop-this.bufferCount*t?e.scrollTop-this.bufferCount*t:0),i},qze.prototype.downScroll=function(e,t){var i;return this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex?null:(i=0,i=~~(e.scrollTop/this.itemSize),t=(t=(i=this.parent.rowAutoHeight?(i=~~((e.scrollTop-this.translateY)/this.averageRowHeight)+t)>t+this.bufferCount?i:t+this.bufferCount:i)+this.renderedLength)>this.parent.resourceBase.expandedResources.length?i+(this.parent.resourceBase.expandedResources.length-i):t,i=this.getBufferCollection(t-this.renderedLength,t),this.translateY=e.scrollTop,i)},qze.prototype.leftScroll=function(e){e=~~(Math.abs(e.scrollLeft)/this.itemSize)+Math.ceil(e.clientWidth/this.itemSize)-this.renderedLength;return this.getCollection(e=0<e?e:0,e+this.renderedLength)},qze.prototype.rightScroll=function(e){var t=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1],e=(e=~~(Math.abs(e.scrollLeft)/this.itemSize)+this.renderedLength)>t.length-1?t.length-1:e;return this.getCollection(e-this.renderedLength,e)},qze.prototype.getCollection=function(e,t){this.translateY=e*this.itemSize;e=this.getResCollection(e=e<0?0:e,t);return this.parent.enableRtl&&(this.translateY=-this.translateY),e},qze.prototype.getResCollection=function(e,t){var i=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1],n=(t=t>i.length?i.length-1:t,[]),o={startIndex:0,endIndex:0};if(this.parent.activeViewOptions.group.byDate){if(i[parseInt(e.toString(),10)].date.getTime()===this.parent.resourceBase.expandedResources[0].date.getTime()&&i[parseInt(t.toString(),10)].date.getTime()===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].date.getTime())return this.parent.resourceBase.expandedResources;n=this.getByDateCollection(i[parseInt(e.toString(),10)],i[parseInt(t.toString(),10)],o),this.setRenderedDates(n)}else{if(i[parseInt(e.toString(),10)].groupIndex===this.parent.resourceBase.expandedResources[0].groupIndex&&i[parseInt(t.toString(),10)].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex)return this.parent.resourceBase.expandedResources;n=this.getByIdCollection(i[parseInt(e.toString(),10)],i[parseInt(t.toString(),10)],o)}return"Month"!==this.parent.currentView&&(this.startIndex=o.startIndex,n=i.slice(o.startIndex,o.endIndex)),this.translateY=o.startIndex*this.itemSize,n},qze.prototype.getByDateCollection=function(t,i,e){var n=this.parent.activeView.colLevels[0].filter(function(e){return t.date.getTime()<=e.date.getTime()&&e.date.getTime()<=i.date.getTime()});return this.setStartEndIndex(this.parent.activeView.colLevels[0],n[0],n[n.length-1],e),n},qze.prototype.getByIdCollection=function(t,i,e){var n=this.parent.resourceBase.lastResourceLevel.filter(function(e){return t.groupIndex<=e.groupIndex&&e.groupIndex<=i.groupIndex});return this.parent.resourceBase.renderedResources=n,this.setStartEndIndex(this.parent.resourceBase.lastResourceLevel,n[0],n[n.length-1],e),n},qze.prototype.setStartEndIndex=function(e,t,i,n){var o=0;e.filter(function(e){t===e?n.startIndex=o:i===e&&(n.endIndex=o+e.colSpan),o+=e.colSpan}),t===i&&(n.endIndex=n.startIndex+i.colSpan)},qze.prototype.updateContent=function(e,t,i,n){var o=e.querySelector("tbody").children.length;document.activeElement&&document.activeElement.classList.contains(ANe)&&(this.isResourceCell=!0,this.parent.element.focus());for(var r=0;r<o;r++)ue(i.querySelector("div"));this.parent.resourceBase.renderedResources=n;for(var s=this.parent.activeView.getGroupIndices(n),a=this.parent.activeView.getGroupIndices(this.existingDataCollection),l=s.filter(function(e){return a.indexOf(e)<0}),h=Array.from(e.querySelectorAll("tbody tr")),d=Array.from(t.querySelectorAll("tbody tr")),p=e.querySelector("tbody"),c=t.querySelector("tbody"),u=(this.removeObsoleteRows(h,s),this.removeObsoleteRows(d,s),this.parent.resourceBase.getContentRows(n,!0)),g=this.parent.activeView.getContentRows(),e=this.parent.activeView.getEventRows(n.length),r=0;r<l.length;r++){var m=s.indexOf(l[parseInt(r.toString(),10)]);0===m?(lt([u[parseInt(r.toString(),10)]],p),lt([g[parseInt(r.toString(),10)]],c)):p&&c&&p.children[parseInt(m.toString(),10)]&&c.children[parseInt(m.toString(),10)]?(p.insertBefore(u[parseInt(r.toString(),10)],p.children[parseInt(m.toString(),10)]),c.insertBefore(g[parseInt(r.toString(),10)],c.children[parseInt(m.toString(),10)])):(ht([u[parseInt(r.toString(),10)]],p),ht([g[parseInt(r.toString(),10)]],c))}ht(e,i)},qze.prototype.removeObsoleteRows=function(e,i){e.forEach(function(e){var t=parseInt(e.firstElementChild.getAttribute("data-group-index"),10);i.indexOf(t)<0&&ue(e)})},qze.prototype.updateHorizontalContent=function(e,t){this.existingDataCollection=this.parent.resourceBase.expandedResources,this.parent.resourceBase.expandedResources=t;var i=this.parent.getSelectedCells(),i=(this.focusedEle=i[i.length-1]||this.focusedEle,e.querySelector("tbody")),i=Array.from(i.querySelectorAll("tr"));"Month"===this.parent.currentView?this.updateMonthViewContent(e,t):this.updateOtherViewContent(e,t,i)},qze.prototype.updateMonthViewContent=function(e,t){for(var i=e.querySelectorAll(" tr").length,n=0;n<i;n++)ue(e.querySelector("tbody tr"));this.parent.activeViewOptions.group.byDate?this.parent.activeView.colLevels[0]=t:this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-2]=t,ht(this.parent.activeView.getContentRows(),e.querySelector("tbody"))},qze.prototype.updateOtherViewContent=function(e,t,i){for(var n=e.querySelector("tbody"),o=e.querySelector("colgroup"),r=e.querySelector("thead"),s=e.querySelector("table"),a=(this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1]=t,new Set(t.map(function(e){return e.groupIndex}))),l=(i.forEach(function(e){e.querySelectorAll("td").forEach(function(e){var t=parseInt(e.getAttribute("data-group-index"),10);a.has(t)||e.remove()})}),[].slice.call(e.querySelector("colgroup").children)),h=0;h<l.length;h++)ue(l[parseInt(h.toString(),10)]);t.forEach(function(){return o.appendChild(Q("col"))});for(var d=[].slice.call(e.querySelector("thead").children),h=0;h<d.length;h++)ue(d[parseInt(h.toString(),10)]);r.appendChild(this.parent.eventBase.createEventWrapper("",0<this.startIndex?this.startIndex:0)),this.parent.activeViewOptions.timeScale.enable&&r.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),lt([r],s);i=this.parent.activeView.getContentRows();this.mergeNewTdData(n,i)},qze.prototype.mergeNewTdData=function(e,t){Array.from(e.querySelectorAll("tr")).forEach(function(s,e){var a;e<t.length&&(e=t[parseInt(e.toString(),10)],a=Array.from(s.querySelectorAll("td")),Array.from(e.querySelectorAll("td")).forEach(function(e){for(var t=parseInt(e.getAttribute("data-group-index").toString(),10),i=!1,n=0,o=a;n<o.length;n++){var r=o[n];if(t<parseInt(r.getAttribute("data-group-index").toString(),10)){s.insertBefore(e,r),i=!0;break}}i||s.appendChild(e)}))})},qze.prototype.getBufferCollection=function(e,t){return this.parent.resourceBase.expandedResources.slice(e,t)},qze.prototype.setTranslate=function(e,t,i,n){gt(e.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),gt(t.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),gt(i,{transform:"translateY("+this.translateY+"px)"}),je(n)||gt(n,{transform:"translateY("+this.translateY+"px)"})},qze.prototype.updateFocusedWorkCell=function(){var e,t;this.focusedEle&&(t=parseInt(this.focusedEle.getAttribute("data-date"),10),e=parseInt(this.focusedEle.getAttribute("data-group-index"),10),(t=this.parent.element.querySelector("."+JOe+'[data-date="'+t+'"][data-group-index="'+e+'"]'))&&this.parent.addSelectedClass([t],t,!0),this.focusedEle=null)},qze.prototype.setRenderedDates=function(e){var t,i,n;"Month"!==this.parent.currentView?(t=e.map(function(e){return e.date}),this.parent.resourceBase.renderedResources.forEach(function(e){return e.renderDates=t})):(i=e.map(function(e){return e.date.getDay()}),n=this.parent.activeView.renderDates.filter(function(e){return 0<=i.indexOf(e.getDay())}),this.parent.resourceBase.renderedResources.forEach(function(e){return e.renderDates=n}))},qze.prototype.setTabIndex=function(){var t=this.parent.element.querySelector("."+fNe),e=[].slice.call(this.parent.element.querySelectorAll("."+ANe)),e=(e&&t&&e.forEach(function(e){e.getBoundingClientRect().top>=t.getBoundingClientRect().top&&e.setAttribute("tabindex","0")}),this.parent.element.querySelector("."+ANe+'[tabindex="0"]'));this.isResourceCell&&e&&(e.focus(),this.isResourceCell=!1)},qze.prototype.destroy=function(){this.removeEventListener(),this.focusedEle=null};var Uze=qze;function qze(e){this.translateY=0,this.itemSize=60,this.renderedLength=0,this.averageRowHeight=0,this.startIndex=0,this.existingDataCollection=[],this.enableTransition=!0,this.parent=e,this.bufferCount=e.activeViewOptions.overscanCount<3?3:e.activeViewOptions.overscanCount,this.addEventListener()}Yze.prototype.render=function(e,t){void 0===t&&(t=!0),this.initializeLayout(e),this.parent.activeView&&t&&this.parent.crudModule.refreshDataManager()},Yze.prototype.initializeLayout=function(e){switch(this.parent.activeView&&(t=["cellTemplate","tooltipTemplate","majorSlotTemplate","minorSlotTemplate","headerTooltipTemplate","dateHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","headerIndentTemplate","resourceHeaderTemplate","cellHeaderTemplate","dateRangeTemplate"],0<this.parent.activeEventTemplates.length?(t=t.concat(this.parent.activeEventTemplates),this.parent.activeEventTemplates=[]):t.push("eventTemplate"),this.parent.resetTemplates(t),this.parent.activeView.removeEventListener(),this.parent.activeView.destroy()),e){case"Day":this.parent.activeView=this.parent.dayModule;break;case"Week":this.parent.activeView=this.parent.weekModule;break;case"WorkWeek":this.parent.activeView=this.parent.workWeekModule;break;case"Month":this.parent.activeView=this.parent.monthModule;break;case"Year":this.parent.activeView=this.parent.yearModule;break;case"Agenda":this.parent.activeView=this.parent.agendaModule;break;case"MonthAgenda":this.parent.activeView=this.parent.monthAgendaModule;break;case"TimelineDay":this.parent.activeView=this.parent.timelineViewsModule,je(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-day-view");break;case"TimelineWorkWeek":this.parent.activeView=this.parent.timelineViewsModule,je(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-work-week-view");break;case"TimelineWeek":this.parent.activeView=this.parent.timelineViewsModule,je(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-week-view");break;case"TimelineMonth":this.parent.activeView=this.parent.timelineMonthModule;break;case"TimelineYear":this.parent.activeView=this.parent.timelineYearModule}if(je(this.parent.activeView)){var t=this.parent.viewCollections[0].option;if(t)return this.parent.setProperties({currentView:t},!0),this.parent.headerModule&&(this.parent.headerModule.updateActiveView(),this.parent.headerModule.setCalendarView()),console.warn('[WARNING] :: Module "'+e+'" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),this.initializeLayout(t);throw Error("Inject required modules")}this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight,this.parent.activeView.viewIndex=this.parent.viewIndex,this.updateLabelText(e),this.parent.activeView.addEventListener(),this.parent.activeView.getRenderDates(),this.parent.uiStateValues.isGroupAdaptive=0<this.parent.activeViewOptions.group.resources.length&&(this.parent.enableAdaptiveUI&&!this.parent.isAdaptive||this.parent.isAdaptive&&this.parent.activeViewOptions.group.enableCompactView),this.parent.virtualScrollModule&&(this.parent.virtualScrollModule.destroy(),this.parent.virtualScrollModule=null),(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView)||"TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation)&&this.parent.activeViewOptions.allowVirtualScrolling&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.virtualScrollModule=new Uze(this.parent),this.parent.activeView.isTimelineView()?this.parent.uiStateValues.top=0:(this.parent.virtualScrollModule.isHorizontalScroll=!0,this.parent.uiStateValues.left=0)),this.updateHeader(),this.parent.currentTimezoneDate=this.parent.getCurrentTime(),this.parent.activeView.renderLayout(aNe),this.parent.renderTemplates(),this.parent.eventTooltip&&(this.parent.eventTooltip.destroy(),this.parent.eventTooltip=null),(this.parent.eventSettings.enableTooltip||0<this.parent.activeViewOptions.group.resources.length&&this.parent.activeViewOptions.group.headerTooltipTemplate)&&(this.parent.eventTooltip=new zHe(this.parent))},Yze.prototype.updateHeader=function(){this.parent.headerModule&&(this.parent.headerModule.setDayOfWeek(this.parent.activeViewOptions.firstDayOfWeek),this.parent.activeViewOptions.readonly?U([this.parent.element],a_e):this.parent.element.classList.contains(a_e)&&q([this.parent.element],a_e),this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))},Yze.prototype.updateLabelText=function(e){this.parent.element.setAttribute("role","application"),this.parent.element.removeAttribute("aria-labelledby"),this.parent.element.removeAttribute("aria-label"),"Year"===e?this.parent.element.setAttribute("aria-label",this.parent.activeView.getLabelText(e)):this.parent.element.setAttribute("aria-labelledby",this.parent.element.id+"_table")};var Gze=Yze;function Yze(e){this.parent=e}Xze=function(e,t){return(Xze=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])}))(e,t)};var Xze,Kze,Xo=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},mJ=(function(e,t){function i(){this.constructor=e}Xze(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Jze,Kze=n),Xo([e(!0)],Jze.prototype,"highlight",void 0),Xo([e("09:00")],Jze.prototype,"start",void 0),Xo([e("18:00")],Jze.prototype,"end",void 0),Jze);function Jze(){return null!==Kze&&Kze.apply(this,arguments)||this}Zze=function(e,t){return(Zze=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])}))(e,t)};var Zze,$ze,x$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},d$=(function(e,t){function i(){this.constructor=e}Zze(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(eje,$ze=n),x$([e(!0)],eje.prototype,"enable",void 0),x$([e(60)],eje.prototype,"interval",void 0),x$([e(2)],eje.prototype,"slotCount",void 0),x$([e()],eje.prototype,"minorSlotTemplate",void 0),x$([e()],eje.prototype,"majorSlotTemplate",void 0),eje);function eje(){return null!==$ze&&$ze.apply(this,arguments)||this}tje=function(e,t){return(tje=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])}))(e,t)};var tje,ije,g$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},k$=(function(e,t){function i(){this.constructor=e}tje(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(nje,ije=n),g$([e("Both")],nje.prototype,"templateType",void 0),g$([e()],nje.prototype,"header",void 0),g$([e()],nje.prototype,"content",void 0),g$([e()],nje.prototype,"footer",void 0),nje);function nje(){return null!==ije&&ije.apply(this,arguments)||this}oje=function(e,t){return(oje=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])}))(e,t)};var oje,rje,D$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},z$=(function(e,t){function i(){this.constructor=e}oje(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(sje,rje=n),D$([e()],sje.prototype,"option",void 0),D$([e()],sje.prototype,"template",void 0),sje);function sje(){return null!==rje&&rje.apply(this,arguments)||this}lje.prototype.getQuery=function(){var e=this.parent.activeView.startDate(),t=this.parent.activeView.endDate();return this.parent.dataModule.generateQuery(e,t)},lje.prototype.getTable=function(){return this.parent.eventSettings.query?this.parent.eventSettings.query.clone().fromTable:null},lje.prototype.refreshDataManager=function(){var e,t,i=this;this.parent.activeView&&(this.parent.uiStateValues&&this.parent.uiStateValues.isPreventEventRefresh?(this.parent.uiStateValues.isPreventEventRefresh=!1,this.parent.refreshEvents(!1),this.parent.hideSpinner()):(e=this.parent.activeView.startDate(),t=this.parent.activeView.endDate(),this.parent.dataModule.getData(this.parent.dataModule.generateQuery(e,t)).then(function(e){return i.dataManagerSuccess(e)}).catch(function(e){return i.dataManagerFailure(e)})))},lje.prototype.dataManagerSuccess=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(DRe,e,function(e){e.cancel||(e=Pe([],e.result,null,!0),t.parent.eventsData=e.filter(function(e){return!e[t.parent.eventFields.isBlock]}),t.parent.blockData=e.filter(function(e){return e[t.parent.eventFields.isBlock]}),t.refreshProcessedData(),t.parent.dragAndDropModule&&"drag"===t.parent.dragAndDropModule.actionObj.action&&t.parent.dragAndDropModule.navigationWrapper(),t.parent.trigger("dataBound",null,function(){t.parent.hideSpinner(),t.parent.isPrinting&&setTimeout(function(){t.parent.notify(URe,{})},100)}))})},lje.prototype.dataManagerFailure=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(SRe,{error:e},function(){return t.parent.hideSpinner()})},lje.prototype.refreshProcessedData=function(e,t){if(void 0===e&&(e=!1),this.parent.dragAndDropModule&&(this.parent.dragAndDropModule.actionObj.action="",q([this.parent.element],"e-event-action")),this.parent.activeViewOptions&&this.parent.activeViewOptions.eventTemplate){var i=["eventTemplate"];if(this.crudObj.isCrudAction&&-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView))for(var i=[],n=0,o=this.crudObj.sourceEvent.length;n<o;n++)i.push("eventTemplate_"+this.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex),this.crudObj.targetEvent[parseInt(n.toString(),10)]&&this.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex!==this.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex&&i.push("eventTemplate_"+this.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex);0<i.length&&this.parent.resetTemplates(i)}e?this.parent.notify(qRe,{processedData:t?this.parent.eventBase.processData(t):this.parent.eventsProcessed}):(e=this.parent.eventsData||[],t=this.parent.blockData||[],e=e.concat(t),this.parent.notify(qRe,{processedData:this.parent.eventBase?this.parent.eventBase.processData(e):[]}))},lje.prototype.refreshData=function(i){var t=this,e={requestType:i.requestType,cancel:!1,data:i.data,addedRecords:i.editParams.addedRecords,changedRecords:i.editParams.changedRecords,deletedRecords:i.editParams.deletedRecords};if(this.parent.dragAndDropModule&&this.parent.dragAndDropModule.actionObj&&this.parent.dragAndDropModule.actionObj.element&&this.parent.dragAndDropModule.actionObj.action&&(this.parent.dragAndDropModule.actionObj.element.style.display="none"),this.parent.resizeModule&&this.parent.resizeModule.actionObj&&this.parent.resizeModule.actionObj.element&&this.parent.resizeModule.actionObj.action&&(this.parent.resizeModule.actionObj.element.style.display="none"),this.parent.isSpecificResourceEvents()&&("eventCreated"===i.requestType||"eventRemoved"===i.requestType)){this.crudObj.isCrudAction=!0,this.crudObj.sourceEvent=[];for(var n=i.data instanceof Array?0===i.data.length&&"eventRemoved"===i.requestType?i.editParams.deletedRecords:i.data:"string"!=typeof i.data&&"number"!=typeof i.data||"eventRemoved"!==i.requestType?[i.data]:i.editParams.deletedRecords,o=this,r=0,s=n;r<s.length;r++)!function(e){o.crudObj.isCrudAction=!("eventRemoved"===i.requestType&&!je(e.parent));var t=o.parent.eventBase.getGroupIndexFromEvent(e);-1<t&&0===o.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===t}).length&&o.crudObj.isCrudAction&&o.crudObj.sourceEvent.push(o.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)])}(s[r]);this.crudObj.targetEvent=this.crudObj.sourceEvent}this.parent.dataModule.dataManager.dataSource.offline?this.parent.trigger(CRe,e,function(e){e.cancel||t.refreshDataManager()}):i.promise.then(function(){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger(CRe,e,function(e){e.cancel||t.refreshDataManager()})}).catch(function(e){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger(SRe,{error:e})})},lje.prototype.processAddEvent=function(e){var t,i=this.parent.eventFields,n={addedRecords:[],changedRecords:[],deletedRecords:[]};if(e.addedRecords instanceof Array){for(var o=0,r=e.addedRecords;o<r.length;o++){var s=r[o],s=this.parent.eventBase.updateEventDateTime(s),s=Pe({},this.parent.eventBase.processTimezone(s,!0),null,!0);n.addedRecords.push(s)}t=this.parent.dataModule.dataManager.saveChanges(n,i.id,this.getTable(),this.getQuery())}else{i=this.parent.eventBase.processTimezone(e.addedRecords,!0);n.addedRecords.push(i),t=this.parent.dataModule.dataManager.insert(i,this.getTable(),this.getQuery())}i={requestType:"eventCreated",cancel:!1,data:e.addedRecords,promise:t,editParams:n};this.refreshData(i)},lje.prototype.processSaveEvent=function(e){var t,i=this.parent.eventFields,n={addedRecords:[],changedRecords:[],deletedRecords:[]};if(e.changedRecords instanceof Array){for(var o=0,r=e.changedRecords;o<r.length;o++){var s=r[o],s=this.parent.eventBase.updateEventDateTime(s),s=Pe({},this.parent.eventBase.processTimezone(s,!0),null,!0);n.changedRecords.push(s)}t=this.parent.dataModule.dataManager.saveChanges(n,i.id,this.getTable(),this.getQuery())}else{var a=this.parent.eventBase.processTimezone(e.changedRecords,!0);n.changedRecords.push(a),t=this.parent.dataModule.dataManager.update(i.id,a,this.getTable(),this.getQuery())}i=Pe({},e.changedRecords[e.changedRecords.length-1],null,!0),this.parent.eventBase.selectWorkCellByTime([this.parent.eventBase.processTimezone(i)]),a={requestType:"eventChanged",cancel:!1,data:e.changedRecords,promise:t,editParams:n};this.refreshData(a)},lje.prototype.processDeleteEvent=function(e){var t=this.parent.eventFields,i={addedRecords:[],changedRecords:[],deletedRecords:[]},t=1<e.deletedRecords.length?(i.deletedRecords=i.deletedRecords.concat(e.deletedRecords),this.parent.dataModule.dataManager.saveChanges(i,t.id,this.getTable(),this.getQuery())):(i.deletedRecords.push(e.deletedRecords[0]),this.parent.dataModule.dataManager.remove(t.id,e.deletedRecords[0],this.getTable(),this.getQuery())),e=(this.parent.eventBase.selectWorkCellByTime(e.deletedRecords),{requestType:"eventRemoved",cancel:!1,data:e.deletedRecords,promise:t,editParams:i});this.refreshData(e)},lje.prototype.addEvent=function(e){var i=this;this.parent.eventSettings.allowAdding&&!this.parent.activeViewOptions.readonly&&(!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e)?this.parent.quickPopup.openValidationError("blockAlert",e):this.parent.eventBase.checkOverlap(e)||0!==(e=e instanceof Array?e:[e]).length&&this.parent.trigger(wRe,{requestType:"eventCreate",cancel:!1,data:e,addedRecords:e,changedRecords:[],deletedRecords:[]},function(t){t.cancel||(t.promise?t.promise.then(function(e){!i.parent||i.parent&&i.parent.isDestroyed||e&&i.processAddEvent(t)}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(SRe,{error:e})}):i.processAddEvent(t))}))},lje.prototype.saveEvent=function(e,t){var i=this;if(this.parent.eventSettings.allowEditing&&!this.parent.activeViewOptions.readonly)if("EditFollowingEvents"!==this.parent.currentAction&&!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e))this.parent.quickPopup.openValidationError("blockAlert",e),this.parent.crudModule.crudObj.isCrudAction=!1;else{var n=e instanceof Array?e:[e];if(0!==n.length)if(this.parent.currentAction=t)switch(t){case"Save":this.processSave(e);break;case"EditOccurrence":this.processOccurrences(e,t);break;case"EditFollowingEvents":this.processFollowSeries(e,t);break;case"EditSeries":this.processEntireSeries(e,t)}else this.parent.eventBase.checkOverlap(e)||this.parent.trigger(wRe,{requestType:"eventChange",cancel:!1,data:e,addedRecords:[],changedRecords:n,deletedRecords:[]},function(t){t.cancel||(t.promise?t.promise.then(function(e){!i.parent||i.parent&&i.parent.isDestroyed||e&&i.processSaveEvent(t)}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(SRe,{error:e})}):i.processSaveEvent(t))})}},lje.prototype.deleteEvent=function(t,e){var i=this;if(this.parent.eventSettings.allowDeleting&&!this.parent.activeViewOptions.readonly){this.parent.currentAction=e;var n=[],n="string"==typeof t||"number"==typeof t?this.parent.eventsData.filter(function(e){return e[i.parent.eventFields.id]===t}):t instanceof Array?t:[t];if(0!==n.length)if(e)switch(e){case"Delete":this.processDelete(n);break;case"DeleteOccurrence":this.processOccurrences(n,e);break;case"DeleteFollowingEvents":this.processFollowSeries(n,e);break;case"DeleteSeries":this.processEntireSeries(n,e)}else this.parent.trigger(wRe,{requestType:"eventRemove",cancel:!1,data:t,addedRecords:[],changedRecords:[],deletedRecords:n},function(t){t.cancel||(t.promise?t.promise.then(function(e){!i.parent||i.parent&&i.parent.isDestroyed||e&&i.processDeleteEvent(t)}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(SRe,{error:e})}):i.processDeleteEvent(t))})}},lje.prototype.processOccurrences=function(e,d){var p=this,o=[],c=!1;if(e instanceof Array)for(var t=0,i=e;t<i.length;t++){var n=i[t];o.push({occurrence:n,parent:this.getParentEvent(n)})}else o={occurrence:e,parent:this.getParentEvent(e)};e=e instanceof Array?e:[e],e={requestType:"EditOccurrence"===d?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:e,deletedRecords:[]};e.data=o,this.parent.trigger(wRe,e,function(s){if(!s.cancel){for(var a=p.parent.eventFields,l={addedRecords:[],changedRecords:[],deletedRecords:[]},h=o instanceof Array?o:[o],e=0,t=s.changedRecords.length;e<t;e++)!function(e){var t,i,n=s.changedRecords[parseInt(e.toString(),10)],o=h[parseInt(e.toString(),10)].parent,r=o[a.recurrenceException];switch(d){case"EditOccurrence":t=p.parent.eventsProcessed.filter(function(e){return e.Guid===n.Guid})[0],((i=p.excludeDateCheck(t[a.startTime],r))!==o[a.recurrenceException]?(o[a.recurrenceException]=i,n[a.recurrenceException]=bHe(t[a.startTime]),n[a.recurrenceID]=o[a.id],n[a.followingID]=null,l.changedRecords.push(p.parent.eventBase.processTimezone(o,!0)),l.addedRecords):l.changedRecords).push(p.parent.eventBase.processTimezone(n,!0));break;case"DeleteOccurrence":n[a.recurrenceException]||(o[a.recurrenceException]=p.excludeDateCheck(n[a.startTime],r),l.changedRecords.push(p.parent.eventBase.processTimezone(o,!0))),n[a.id]!==o[a.id]&&(l.deletedRecords.push(p.parent.eventBase.processTimezone(n,!0)),c=!0)}}(e);var i=p.parent.dataModule.dataManager.saveChanges(l,a.id,p.getTable(),p.getQuery()),n=Pe({},s.changedRecords[s.changedRecords.length-1],null,!0),n=(p.parent.eventBase.selectWorkCellByTime("EditOccurrence"===d?[p.parent.eventBase.processTimezone(n)]:[n]),{requestType:"EditOccurrence"===d?"eventChanged":"eventRemoved",cancel:!1,data:c?s.deletedRecords:s.changedRecords,promise:i,editParams:l});p.refreshData(n)}})},lje.prototype.processFollowSeries=function(e,d){var p=this,o=[];if(e instanceof Array)for(var t=0,i=e;t<i.length;t++){var n=i[t];o.push({occurrence:n,parent:this.getParentEvent(n)})}else o={occurrence:e,parent:this.getParentEvent(e)};e=e instanceof Array?e:[e],e={requestType:"EditFollowingEvents"===d?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:e,deletedRecords:[]};e.data=o,this.parent.trigger(wRe,e,function(s){if(!s.cancel){for(var a=p.parent.eventFields,l={addedRecords:[],changedRecords:[],deletedRecords:[]},h=o instanceof Array?o:[o],e=0,t=s.changedRecords.length;e<t;e++)!function(e){var t,i,n=s.changedRecords[parseInt(e.toString(),10)],o=h[parseInt(e.toString(),10)].parent,r=p.parent.eventBase.getEventCollections(o,n);switch(d){case"EditFollowingEvents":p.processRecurrenceRule(o,n),t=!p.parent.eventBase.isFollowingEvent(o,n),n[a.followingID]=t?null:o[a.id],n[a.recurrenceID]=null,l.addedRecords.push(p.parent.eventBase.processTimezone(n,!0)),l.changedRecords.push(p.parent.eventBase.processTimezone(o,!0)),p.parent.uiStateValues.isIgnoreOccurrence||(n[a.recurrenceException]=null,0<r.occurrence.length&&-1===(i=r.occurrence.slice(-1)[0][a.recurrenceRule]).indexOf("COUNT")&&(n[a.recurrenceRule]=i),0<r.follow.length&&(n[a.recurrenceRule]=r.follow.slice(-1)[0][a.recurrenceRule],l.deletedRecords=l.deletedRecords.concat(r.follow)),t&&(r.occurrence=r.occurrence.filter(function(e){return e[a.recurrenceID]===o[a.id]})),l.deletedRecords=l.deletedRecords.concat(r.occurrence));break;case"DeleteFollowingEvents":p.processRecurrenceRule(o,n[a.startTime]),l.changedRecords.push(p.parent.eventBase.processTimezone(o,!0)),l.deletedRecords=l.deletedRecords.concat(r.occurrence).concat(r.follow)}}(e);var i=p.parent.dataModule.dataManager.saveChanges(l,a.id,p.getTable(),p.getQuery()),n=Pe({},s.changedRecords[s.changedRecords.length-1],null,!0),n=(p.parent.eventBase.selectWorkCellByTime("EditFollowingEvents"===d?[p.parent.eventBase.processTimezone(n)]:[n]),{requestType:"EditFollowingEvents"===d?"eventChanged":"eventRemoved",cancel:!1,data:s.changedRecords,promise:i,editParams:l});p.refreshData(n)}})},lje.prototype.processEntireSeries=function(e,h){var d=this,p=[],c=!1;if(e instanceof Array)for(var t=0,i=e;t<i.length;t++){var n=i[t];p.push(this.getParentEvent(n,!0))}else p=this.getParentEvent(e,!0);var e=e instanceof Array?e:[e],o={requestType:"EditSeries"===h?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:[]};if(o.data=p,"EditSeries"===h?o.changedRecords=e:o.deletedRecords=e,"EditSeries"===h&&!this.parent.uiStateValues.isIgnoreOccurrence)for(var r=p instanceof Array?p:[p],s=0,a=o.changedRecords.length;s<a;s++){var l=r[parseInt(s.toString(),10)],l=this.parent.eventBase.getEventCollections(l),l=l.follow.concat(l.occurrence);o.deletedRecords=o.deletedRecords.concat(l)}this.parent.trigger(wRe,o,function(e){if(!e.cancel){for(var r=d.parent.eventFields,s={addedRecords:[],changedRecords:[],deletedRecords:[]},a=p instanceof Array?p:[p],l="EditSeries"===h?e.changedRecords:e.deletedRecords,t=0,i=l.length;t<i;t++)!function(e){var t,i=l[parseInt(e.toString(),10)],n=a[parseInt(e.toString(),10)],e=d.parent.eventBase.getEventCollections(n),o=e.follow.concat(e.occurrence);switch(h){case"EditSeries":i[r.id]=n[r.id],i[r.recurrenceID]=null,i[r.followingID]=null,d.parent.uiStateValues.isIgnoreOccurrence&&i[r.recurrenceException]?0<(t=d.parent.eventsData.filter(function(e){return e[r.id]===i[r.id]})).length&&(i[r.recurrenceRule]=t[0][r.recurrenceRule]):(i[r.recurrenceException]=null,s.deletedRecords=s.deletedRecords.concat(o)),s.changedRecords.push(d.parent.eventBase.processTimezone(i,!0)),d.parent.uiStateValues.isIgnoreOccurrence=!1;break;case"DeleteSeries":s.deletedRecords=s.deletedRecords.concat(o.concat(d.parent.eventBase.processTimezone(n,!0))),c=!0}}(t);var n=d.parent.dataModule.dataManager.saveChanges(s,r.id,d.getTable(),d.getQuery()),o=Pe({},l[l.length-1],null,!0),o=(d.parent.eventBase.selectWorkCellByTime("EditSeries"===h?[d.parent.eventBase.processTimezone(o)]:[o]),{requestType:"EditSeries"===h?"eventChanged":"eventRemoved",cancel:!1,data:c?e.deletedRecords:e.changedRecords,promise:n,editParams:s});d.refreshData(o)}})},lje.prototype.processDelete=function(e){for(var c=this,u=[],t=0,i=e;t<i.length;t++){var n=i[t];n[this.parent.eventFields.recurrenceRule]?u.push({occurrence:n,parent:this.getParentEvent(n)}):u.push(n)}e={requestType:"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:e};e.data=u,this.parent.trigger(wRe,e,function(h){if(!h.cancel){for(var d=c.parent.eventFields,p={addedRecords:[],changedRecords:[],deletedRecords:[]},e=0,t=h.deletedRecords.length;e<t;e++)!function(e){var t,i,n,o,r=je(h.deletedRecords[parseInt(e.toString(),10)][c.parent.eventFields.recurrenceRule]);if(r||(t=u[parseInt(e.toString(),10)].parent,i=p.changedRecords.filter(function(e){return e[d.id]===t[d.id]}),n=h.deletedRecords[parseInt(e.toString(),10)][d.startTime],0<i.length?(o=i[0])[d.recurrenceException]=c.excludeDateCheck(n,o[d.recurrenceException]):t[d.recurrenceException]=c.excludeDateCheck(n,t[d.recurrenceException]),0===i.length&&p.changedRecords.push(c.parent.eventBase.processTimezone(t,!0)),r=h.deletedRecords[parseInt(e.toString(),10)][d.id]!==t[d.id]),r){if(h.deletedRecords instanceof Array)for(var s=0,a=h.deletedRecords;s<a.length;s++){var l=a[s];c.parent.eventBase.processTimezone(l,!0)}p.deletedRecords.push(h.deletedRecords[parseInt(e.toString(),10)])}}(e);var i=c.parent.dataModule.dataManager.saveChanges(p,d.id,c.getTable(),c.getQuery()),n=Pe({},h.deletedRecords[h.deletedRecords.length-1],null,!0),n=(c.parent.eventBase.selectWorkCellByTime([c.parent.eventBase.processTimezone(n)]),{requestType:"eventRemoved",cancel:!1,data:h.deletedRecords,promise:i,editParams:p});c.refreshData(n)}})},lje.prototype.processSave=function(e){for(var d=this,e=e instanceof Array?e:[e],t=[],i=0,n=e;i<n.length;i++){var o=n[i];o[this.parent.eventFields.recurrenceRule]?t.push({occurrence:o,parent:this.getParentEvent(o)}):t.push(o)}e={requestType:"eventChange",cancel:!1,addedRecords:[],changedRecords:e,deletedRecords:[]};e.data=t,this.parent.trigger(wRe,e,function(e){if(!e.cancel){for(var t=d.parent.eventFields,i={addedRecords:[],changedRecords:[],deletedRecords:[]},n=0,o=e.changedRecords;n<o.length;n++){var r,s,a=o[n];!je(a[t.recurrenceRule])&&je(a[t.recurrenceException])?(r=bHe(a[t.startTime]),(s=d.getParentEvent(a))[t.recurrenceException]=je(s[t.recurrenceException])?r:s[t.recurrenceException].concat(","+r),a[t.id]=d.parent.getEventMaxID(),a[t.recurrenceException]=r,i.addedRecords.push(d.parent.eventBase.processTimezone(a,!0)),i.changedRecords.push(d.parent.eventBase.processTimezone(s,!0))):i.changedRecords.push(d.parent.eventBase.processTimezone(a,!0))}var l=d.parent.dataModule.dataManager.saveChanges(i,t.id,d.getTable(),d.getQuery()),h=Pe({},e.changedRecords[e.changedRecords.length-1],null,!0),h=(d.parent.eventBase.selectWorkCellByTime([d.parent.eventBase.processTimezone(h)]),{requestType:"eventChanged",cancel:!1,data:e.changedRecords,promise:l,editParams:i});d.refreshData(h)}})},lje.prototype.getParentEvent=function(e,t){t=this.parent.eventBase.getParentEvent(e,t=void 0===t?!1:t)||e;return(t[this.parent.eventFields.startTimezone]||t[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(t),t},lje.prototype.excludeDateCheck=function(e,t){var i=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),i=bHe(e=i?this.parent.tzModule.remove(new Date(+e.getTime()),i):e);return je(t)?t=i:-1===t.indexOf(i)&&(t=je(t)?i:t+","+i),t},lje.prototype.processRecurrenceRule=function(e,t){var i,n,o,r,s=this.parent.eventFields,a=e[s.recurrenceRule];t instanceof Date?i=new Date(+t):(i=new Date(+t[s.startTime]),(n=t[s.recurrenceRule])&&(r=R_e(o=e[s.startTime],n,"DeleteFollowingEvents"===this.parent.currentAction?t[s.recurrenceException]:null,this.parent.activeViewOptions.firstDayOfWeek),(r=new Date(r.slice(-1)[0])).setHours(i.getHours(),i.getMinutes(),i.getSeconds()),i.setHours(o.getHours(),o.getMinutes(),o.getSeconds()),t[s.recurrenceRule]=this.getUpdatedRecurrenceRule(n,new Date(+r),!1))),e[s.recurrenceRule]=this.getUpdatedRecurrenceRule(a,yOe(new Date(i.getTime()),-1),!0)},lje.prototype.getUpdatedRecurrenceRule=function(e,t,i){for(var n="",o=0,r=e.split(";");o<r.length;o++){var s,a,l=r[o];""!==l&&(s=l.split("=")[0],a=l.split("=")[1],"COUNT"!==s&&"UNTIL"!==s||(a=bHe(t),l=l.replace(l,"UNTIL="+a)),n+=l+";")}return i&&-1===n.indexOf("UNTIL")&&(n+="UNTIL="+bHe(t)),n},lje.prototype.isBlockEvent=function(e){for(var t=!1,i=0,n=e instanceof Array?e:[e];i<n.length;i++)t=n[i][this.parent.eventFields.isBlock]||!1;return t},lje.prototype.destroy=function(){this.crudObj=null,this.parent=null};var aje=lje;function lje(e){this.parent=e,this.crudObj={sourceEvent:null,targetEvent:null,isCrudAction:!1}}dje.prototype.cellMouseDown=function(e){this.isPreventAction(e)||this.parent.notify(tOe,{event:e})},dje.prototype.cellClick=function(e){var i,n,t,o,r,s=this;this.isPreventAction(e)||je(i=z(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells"))||(je(z(e.target,"."+w2e))?(n=i.classList.contains(JOe)||i.classList.contains(YOe),this.parent.uiStateValues.isTapHold&&!this.parent.uiStateValues.action&&n&&(this.parent.uiStateValues.isTapHold=!1,this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.selectedElements=[]),o=z(e.target,"."+d2e),t=this.parent.getNavigateView(),r=this.parent.currentView===t,je(o)||r||je(this.parent.viewOptions[t.charAt(0).toLowerCase()+t.slice(1)])?this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView?this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide():this.parent.isAdaptive&&(e.target.classList.contains(H2e)||z(e.target,"."+H2e))||(n&&e.shiftKey&&1===e.which&&this.parent.keyboardInteractionModule?this.parent.keyboardInteractionModule.onMouseSelection(e):(this.parent.activeCellsData=this.parent.getCellDetails(i),o=Pe(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"}),this.parent.trigger(fRe,o,function(e){var t;e.cancel?s.parent.quickPopup&&s.parent.quickPopup.quickPopupHide():(n&&s.parent.selectCell(i),s.parent.allowInline?(t={element:e.element,groupIndex:e.groupIndex,type:"Cell"},s.parent.notify(FRe,t)):s.parent.notify(fRe,e))}))):!je(r=this.parent.getDateFromElement(i))&&this.parent.isMinMaxDate(r)&&(this.parent.setProperties({selectedDate:r},!0),this.parent.changeView(this.parent.getNavigateView(),e))):this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add"))},dje.prototype.cellDblClick=function(e){var i=this,t=z(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells");this.parent.activeViewOptions.readonly||this.isPreventAction(e)||je(t)||(t=Pe(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellDoubleClick"}),this.parent.trigger(yRe,t,function(e){var t=new Date(e.startTime.getTime());i.parent.isMinMaxDate(new Date(t.setHours(0,0,0,0)))&&!e.cancel&&i.parent.eventWindow.openEditor(i.parent.activeCellsData,"Add")}))},dje.prototype.onHover=function(e){var t=z(e.target,".e-work-cells,.e-time-slots,.e-all-day-cells,.e-header-cells,.e-resource-cells,.e-appointment,.e-week-number,.e-month-header");t&&this.parent.trigger("hover",{element:t,event:e})},dje.prototype.isPreventAction=function(e){return!(z(e.target,"."+d2e)||(!z(e.target,"."+LNe)||z(e.target,"."+H2e))&&je(z(e.target,"."+qNe+",."+gNe))&&(e=z(e.target,"."+iNe),!this.parent.activeView||!this.parent.activeView.isTimelineView()||je(e)))},dje.prototype.destroy=function(){E.remove(this.parent.element,"mouseover",this.onHover)};var hje=dje;function dje(e){this.parent=e,E.add(this.parent.element,"mouseover",this.onHover,this)}pje=function(e,t){return(pje=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])}))(e,t)};var pje,cje,_$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},$$=(function(e,t){function i(){this.constructor=e}pje(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(uje,cje=n),_$([e()],uje.prototype,"name",void 0),_$([e()],uje.prototype,"default",void 0),_$([e()],uje.prototype,"title",void 0),_$([e({})],uje.prototype,"validation",void 0),uje);function uje(){return null!==cje&&cje.apply(this,arguments)||this}gje=function(e,t){return(gje=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])}))(e,t)};var gje,mje,H$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},pJ=(function(e,t){function i(){this.constructor=e}gje(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(fje,mje=n),H$([e("Id")],fje.prototype,"id",void 0),H$([e("IsBlock")],fje.prototype,"isBlock",void 0),H$([t({name:"Subject"},$$)],fje.prototype,"subject",void 0),H$([t({name:"StartTime"},$$)],fje.prototype,"startTime",void 0),H$([t({name:"EndTime"},$$)],fje.prototype,"endTime",void 0),H$([t({name:"StartTimezone"},$$)],fje.prototype,"startTimezone",void 0),H$([t({name:"EndTimezone"},$$)],fje.prototype,"endTimezone",void 0),H$([t({name:"Location"},$$)],fje.prototype,"location",void 0),H$([t({name:"Description"},$$)],fje.prototype,"description",void 0),H$([t({name:"IsAllDay"},$$)],fje.prototype,"isAllDay",void 0),H$([t({name:"RecurrenceID"},$$)],fje.prototype,"recurrenceID",void 0),H$([t({name:"RecurrenceRule"},$$)],fje.prototype,"recurrenceRule",void 0),H$([t({name:"RecurrenceException"},$$)],fje.prototype,"recurrenceException",void 0),H$([e("IsReadonly")],fje.prototype,"isReadonly",void 0),H$([e("FollowingID")],fje.prototype,"followingID",void 0),fje);function fje(){return null!==mje&&mje.apply(this,arguments)||this}yje=function(e,t){return(yje=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])}))(e,t)};var yje,vje,fJ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Oee=(function(e,t){function i(){this.constructor=e}yje(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(bje,vje=n),fJ([e()],bje.prototype,"template",void 0),fJ([e([])],bje.prototype,"dataSource",void 0),fJ([e()],bje.prototype,"query",void 0),fJ([t({},pJ)],bje.prototype,"fields",void 0),fJ([e(!1)],bje.prototype,"enableTooltip",void 0),fJ([e("AllDayRow")],bje.prototype,"spannedEventPlacement",void 0),fJ([e(1)],bje.prototype,"minimumEventDuration",void 0),fJ([e()],bje.prototype,"tooltipTemplate",void 0),fJ([e()],bje.prototype,"resourceColorField",void 0),fJ([e(!1)],bje.prototype,"editFollowingEvents",void 0),fJ([e(!0)],bje.prototype,"allowAdding",void 0),fJ([e(!0)],bje.prototype,"allowEditing",void 0),fJ([e(!0)],bje.prototype,"allowDeleting",void 0),fJ([e(!1)],bje.prototype,"enableMaxHeight",void 0),fJ([e(!1)],bje.prototype,"enableIndicator",void 0),fJ([e(!1)],bje.prototype,"ignoreWhitespace",void 0),fJ([e()],bje.prototype,"sortComparer",void 0),fJ([e()],bje.prototype,"includeFiltersInQuery",void 0),bje);function bje(){return null!==vje&&vje.apply(this,arguments)||this}wje=function(e,t){return(wje=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])}))(e,t)};var wje,Cje,Vee=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},jee=(function(e,t){function i(){this.constructor=e}wje(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Sje,Cje=n),Vee([e(!1)],Sje.prototype,"byDate",void 0),Vee([e(!0)],Sje.prototype,"byGroupID",void 0),Vee([e(!1)],Sje.prototype,"allowGroupEdit",void 0),Vee([e([])],Sje.prototype,"resources",void 0),Vee([e(!0)],Sje.prototype,"enableCompactView",void 0),Vee([e()],Sje.prototype,"headerTooltipTemplate",void 0),Vee([e(!1)],Sje.prototype,"hideNonWorkingDays",void 0),Sje);function Sje(){return null!==Cje&&Cje.apply(this,arguments)||this}Aje=function(e,t){return(Aje=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])}))(e,t)};var Aje,xje,tte=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},nte=(function(e,t){function i(){this.constructor=e}Aje(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Ije,xje=n),tte([e()],Ije.prototype,"field",void 0),tte([e()],Ije.prototype,"title",void 0),tte([e()],Ije.prototype,"name",void 0),tte([e(!1)],Ije.prototype,"allowMultiple",void 0),tte([e([])],Ije.prototype,"dataSource",void 0),tte([e()],Ije.prototype,"query",void 0),tte([e("Id")],Ije.prototype,"idField",void 0),tte([e("Text")],Ije.prototype,"textField",void 0),tte([e("Expanded")],Ije.prototype,"expandedField",void 0),tte([e("GroupID")],Ije.prototype,"groupIDField",void 0),tte([e("Color")],Ije.prototype,"colorField",void 0),tte([e("StartHour")],Ije.prototype,"startHourField",void 0),tte([e("EndHour")],Ije.prototype,"endHourField",void 0),tte([e("WorkDays")],Ije.prototype,"workDaysField",void 0),tte([e("CssClass")],Ije.prototype,"cssClassField",void 0),Ije);function Ije(){return null!==xje&&xje.apply(this,arguments)||this}Eje.prototype.renderResourceHeaderIndent=function(e){var t=Q("td",{className:"e-resource-left-td"}),i=Q("div",{className:mNe}),n=(this.parent.activeViewOptions.headerIndentTemplate?(n={className:[t.className],type:"emptyCells"},this.parent.renderHeaderIndentTemplate(n,t)):t.appendChild(i),{elementType:"emptyCells",element:t});this.parent.trigger(xRe,n),e.appendChild(t)},Eje.prototype.hideResourceRows=function(e){if(!(this.resourceCollection.length<=1||this.parent.virtualScrollModule))for(var t=this.lastResourceLevel.length,i=0;i<t;i++){var n=this.lastResourceLevel[parseInt(i.toString(),10)].resourceData,o=this.lastResourceLevel[parseInt(i.toString(),10)].resource;n.ClassName!==bNe||n[o.expandedField]||je(n[o.expandedField])||U([].slice.call(e.children).slice(i+1,i+(parseInt(n.Count,10)+1)),UVe)}},Eje.prototype.createResourceColumn=function(){var e=this.resourceCollection,t=Q("div",{className:fNe}),i=this.parent.activeView.createTableLayout(yNe),n=(!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&U([i],r_e),i.querySelector("tbody")),o=this.generateTreeData(!0);return this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel,this.parent.virtualScrollModule&&(e=this.parent.virtualScrollModule.getRenderedCount(),this.setExpandedResources(),o=this.expandedResources.slice(0,e),this.renderedResources=o),ht(this.getContentRows(o),n),this.hideResourceRows(n),i.appendChild(n),t.appendChild(i),t},Eje.prototype.setRenderedResources=function(){var e=this.resourceCollection;this.generateTreeData(!0);this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel},Eje.prototype.setExpandedResources=function(){for(var e=[],t=0;t<this.lastResourceLevel.length;t++){var i=this.lastResourceLevel[parseInt(t.toString(),10)].resourceData,n=i.Count,i=(e.push(this.lastResourceLevel[parseInt(t.toString(),10)]),i[this.lastResourceLevel[parseInt(t.toString(),10)].resource.expandedField]);!je(i)&&!i&&0<n&&(t+=n)}this.expandedResources=e},Eje.prototype.getContentRows=function(e,t){for(var i,n,o,r,s=[],a=this.resourceCollection,l=Q("tr"),h=Q("td",{attrs:{tabindex:t?"-1":"0"}}),d=this.parent.activeView.getGroupIndices(),p=0;p<e.length;p++)0<d.length&&-1<d.indexOf(e[parseInt(p.toString(),10)].groupIndex)||(n=h.cloneNode(),(r=DOe(a,"name",e[parseInt(p.toString(),10)].resource.name))===a.length-1?(Pe(e[parseInt(p.toString(),10)].resourceData,{ClassName:vNe}),this.renderedResources[parseInt(p.toString(),10)].className=[vNe]):(Pe(e[parseInt(p.toString(),10)].resourceData,{ClassName:bNe}),this.renderedResources[parseInt(p.toString(),10)].className=[bNe]),i=r*this.leftPixel+"px",e[parseInt(p.toString(),10)].resourceData.ClassName===bNe&&!je(e[parseInt(p.toString(),10)].resourceData.Count)&&0<e[parseInt(p.toString(),10)].resourceData.Count&&(o=void 0,o=e[parseInt(p.toString(),10)].resourceData[a[parseInt(r.toString(),10)].expandedField]||je(e[parseInt(p.toString(),10)].resourceData[a[parseInt(r.toString(),10)].expandedField])?CNe:wNe,U([r=Q("div")],[SNe,o]),this.setMargin(r,i),n.appendChild(r),1<this.resourceCollection.length)&&E.add(r,"click",this.onTreeIconClick,this),this.parent.activeView.setResourceHeaderContent(n,e[parseInt(p.toString(),10)],mNe),n.setAttribute("data-group-index",e[parseInt(p.toString(),10)].groupIndex.toString()),n.setAttribute("aria-label",e[parseInt(p.toString(),10)].resourceData[e[parseInt(p.toString(),10)].resource.textField]+" resource"),this.parent.activeViewOptions.resourceHeaderTemplate||this.setMargin(n.querySelector("."+mNe),i),U([n],[ANe,e[parseInt(p.toString(),10)].resourceData.ClassName]),o={elementType:"resourceHeader",element:n,groupIndex:e[parseInt(p.toString(),10)].groupIndex},this.parent.trigger(xRe,o),(r=l.cloneNode()).appendChild(n),s.push(r));return s},Eje.prototype.setMargin=function(e,t){this.parent.enableRtl?e.style.marginRight=t:e.style.marginLeft=t},Eje.prototype.countCalculation=function(e,t){for(var i=0;i<e.length;i++){for(var n=e[e.length-(i+1)].dataSource,o=0;o<n.length;o++){var r,s,a=0;s=this.parent.activeViewOptions.group.byGroupID?(r=(new ya).where(t[t.length-1].groupIDField,"equal",n[parseInt(o.toString(),10)][e[e.length-(i+1)].idField]),new me(t[t.length-1].dataSource).executeLocal(r)):t[t.length-1].dataSource;for(var l=0;l<s.length;l++)a+=parseInt(s[parseInt(l.toString(),10)].Count,10);a+=parseInt(n[parseInt(o.toString(),10)].Count,10),Pe(n[parseInt(o.toString(),10)],{Count:a})}t=t.slice(0,-1)}},Eje.prototype.onTreeIconClick=function(n){var o,r=this,s=(this.parent.eventTooltip&&this.parent.eventTooltip.close(),n.target),e=z(s,"."+bNe).parentElement,a=parseInt(e.children[0].getAttribute("data-group-index"),10),l={cancel:!1,event:n,groupIndex:a,requestType:s.classList.contains(CNe)?"resourceCollapse":"resourceExpand"};this.parent.trigger(wRe,l,function(e){if(!e.cancel){o=s.classList.contains(CNe)?(mt(s,[wNe],[CNe]),!0):(mt(s,[CNe],[wNe]),!1);for(var t=0,i=[].slice.call(r.parent.element.querySelectorAll("."+qNe+",."+H2e));t<i.length;t++)ue(i[t]);r.parent.virtualScrollModule?r.updateVirtualContent(a,o,n,s):r.updateContent(a,o);e={cssProperties:r.parent.getCssProperties(),module:"scroll"};r.parent.notify(JRe,e),l={cancel:!1,event:n,groupIndex:a,requestType:s.classList.contains(CNe)?"resourceExpanded":"resourceCollapsed"},r.parent.refreshEvents(!1),r.parent.trigger(CRe,l)}})},Eje.prototype.updateContent=function(e,t){for(var i=[],n=[],o=[],r=this.lastResourceLevel[parseInt(e.toString(),10)].resourceData,s=[].slice.call(this.parent.element.querySelectorAll("."+fNe+" tr")),a=[].slice.call(this.parent.element.querySelectorAll("."+i2e+" tbody tr")),l=[].slice.call(this.parent.element.querySelectorAll("."+i2e+" ."+UNe)),h=0;h<r.Count;h++)i.push(s[e+h+1]),n.push(a[e+h+1]),o.push(l[e+h+1]);for(var d=this.lastResourceLevel,p=0;p<i.length;p++){var c,u=!0,g=i[parseInt(p.toString(),10)].children[0].classList.contains(bNe);d[parseInt(e.toString(),10)].resourceData[d[parseInt(e.toString(),10)].resource.expandedField]=!t,t?(g&&(c=i[parseInt(p.toString(),10)].querySelector("."+SNe))&&mt(c,[wNe],[CNe]),i[parseInt(p.toString(),10)].classList.contains(UVe)||U([i[parseInt(p.toString(),10)],n[parseInt(p.toString(),10)],o[parseInt(p.toString(),10)]],UVe)):(g&&(g=i[parseInt(p.toString(),10)].rowIndex,d[parseInt(g.toString(),10)].resourceData[d[parseInt(g.toString(),10)].resource.expandedField]||je(d[parseInt(g.toString(),10)].resourceData[d[parseInt(g.toString(),10)].resource.expandedField])||(i.splice(p+1,parseInt(d[parseInt(g.toString(),10)].resourceData.Count,10)),n.splice(p+1,parseInt(d[parseInt(g.toString(),10)].resourceData.Count,10)),o.splice(p+1,parseInt(d[parseInt(g.toString(),10)].resourceData.Count,10)),u=!1),u)&&(c=i[parseInt(p.toString(),10)].querySelector("."+SNe))&&mt(c,[CNe],[wNe]),i[parseInt(p.toString(),10)].classList.contains(UVe)&&q([i[parseInt(p.toString(),10)],n[parseInt(p.toString(),10)],o[parseInt(p.toString(),10)]],UVe))}},Eje.prototype.updateVirtualContent=function(e,t,i,n){this.lastResourceLevel[parseInt(e.toString(),10)].resourceData[this.lastResourceLevel[parseInt(e.toString(),10)].resource.expandedField]=!t,this.setExpandedResources();var e=this.parent.virtualScrollModule.getRenderedCount(),t=this.expandedResources.indexOf(this.renderedResources[0]),e=(this.parent.virtualScrollModule.existingDataCollection=this.renderedResources,this.renderedResources=this.expandedResources.slice(t,t+e),this.renderedResources.length<e&&(t=this.expandedResources.length-e,this.renderedResources=this.expandedResources.slice(t=0<t?t:0,this.expandedResources.length)),this.parent.element.querySelector("."+n2e)),t=(this.parent.virtualScrollModule.updateVirtualTrackHeight(e),this.parent.element.querySelector("."+fNe+" table")),e=this.parent.element.querySelector("."+i2e+" table"),o=this.parent.element.querySelector("."+uNe),t=(this.parent.virtualScrollModule.updateContent(t,e,o,this.renderedResources),this.parent.element.querySelector("."+MNe));je(t)||(t.style.height=this.parent.element.querySelector("."+KOe).offsetHeight+"px")},Eje.prototype.renderResourceHeader=function(){var e,t=Q("div",{className:NNe});t.innerHTML='<div class="'+_Ne+'"><div class="'+YVe+'"><div class="e-icons '+XVe+'"></div></div><div class="'+KVe+'"></div></div>',"MonthAgenda"===this.parent.currentView?(e=this.parent.activeView.getPanel().querySelector("."+i2e)).insertBefore(t,e.querySelector("."+QNe)):this.parent.element.insertBefore(t,this.parent.element.querySelector("."+qOe)),this.renderResourceHeaderText(),E.add(t.querySelector("."+XVe),"click",this.menuClick,this)},Eje.prototype.renderResourceTree=function(){this.popupOverlay=Q("div",{className:JVe});var e=Q("div",{className:ZVe+" e-popup-close"}),t=(("MonthAgenda"===this.parent.currentView?((t=this.parent.activeView.getPanel().querySelector("."+QNe)).insertBefore(e,t.children[0]),t):(this.parent.element.querySelector("."+qOe).appendChild(e),this.parent.element.querySelector("."+qOe))).appendChild(this.popupOverlay),Q("div",{className:"e-resource-tree"}));e.appendChild(t),this.treeViewObj=new PW({cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,fields:{dataSource:[].slice.call(this.generateTreeData()),id:"resourceId",text:"resourceName",child:"resourceChild"},nodeTemplate:this.parent.resourceHeaderTemplate,nodeClicked:this.resourceClick.bind(this),created:this.resourceTreeCreated.bind(this)}),this.treeViewObj.root=this.parent.root||this.parent,this.treeViewObj.appendTo(t),this.treeViewObj.expandAll(),this.treePopup=new Sv(e,{targetType:"relative",actionOnScroll:"none",content:this.treeViewObj.element,relateTo:this.parent.element.querySelector("."+qOe),enableRtl:this.parent.enableRtl,hideAnimation:{name:"SlideLeftOut",duration:500},showAnimation:{name:"SlideLeftIn",duration:500},viewPortElement:this.parent.element.querySelector("."+("MonthAgenda"===this.parent.currentView?QNe:qOe))}),this.parent.on($Re,this.documentClick,this)},Eje.prototype.resourceTreeCreated=function(){this.parent.activeViewOptions.resourceHeaderTemplate&&this.parent.portals&&this.treeViewObj.portals&&(this.parent.portals=this.parent.portals.concat(this.treeViewObj.portals),this.parent.renderTemplates())},Eje.prototype.generateTreeData=function(p){for(var c=this,i=[],u=[],g=0,e=function(e,t){function d(e,t,i){for(var n,o,r=c.resourceCollection[parseInt(t.toString(),10)],s=(p?(o={type:"resourceHeader",resource:e.resource,resourceData:e.resourceData,groupIndex:g,groupOrder:e.groupOrder},u.push(o),g++):n={resourceId:i,resourceName:e.resourceData[r.textField],resource:e.resource,resourceData:e.resourceData},0<e.child.length&&!p&&(n.resourceChild=[]),1),a=0,l=e.child;a<l.length;a++){var h=l[a];p?d(h,t+1,i+"-"+s):n.resourceChild.push(d(h,t+1,i+"-"+s)),s+=1}return p&&Pe(o.resourceData,{Count:s-1}),n}p?d(n.resourceTreeLevel[parseInt(e.toString(),10)],0,(e+1).toString()):i.push(d(n.resourceTreeLevel[parseInt(e.toString(),10)],0,(e+1).toString()))},n=this,t=0,o=this.resourceTreeLevel.length;t<o;t++)e(t);return p?this.lastResourceLevel=u:i},Eje.prototype.renderResourceHeaderText=function(){for(var o=this.lastResourceLevel[this.parent.uiStateValues.groupIndex],r=[],s=this,e=0,t=o.groupOrder.length;e<t;e++)!function(t){var i=s.resourceCollection[parseInt(t.toString(),10)],e=i.dataSource.filter(function(e){return e[i.idField]===o.groupOrder[parseInt(t.toString(),10)]}),n=Q("div",{className:ZNe}),e=(s.parent.sanitize(e[0][i.textField],n),r.push(n),Q("div",{className:"e-icons e-icon-next"}));r.push(e)}(e);r.pop();var i=("MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element).querySelector("."+KVe);kOe(i);for(var n=0,a=r;n<a.length;n++)i.appendChild(a[n]);1===this.lastResourceLevel.length&&U([this.parent.element.querySelector("."+YVe)],UOe)},Eje.prototype.menuClick=function(e){var t;(this.parent.element.querySelector("."+ZVe).classList.contains($Oe)?(this.treePopup.hide(),q):(q(t=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)")),"e-active"),U([t[this.parent.uiStateValues.groupIndex]],"e-active"),this.treePopup.show(),U))([this.popupOverlay],QOe)},Eje.prototype.selectResourceByIndex=function(e){this.lastResourceLevel&&-1<e&&e<this.lastResourceLevel.length&&this.triggerEvents(e)},Eje.prototype.resourceClick=function(e){var t;e.node.classList.contains("e-has-child")||(this.treePopup.hide(),q([this.popupOverlay],QOe),t=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)")).indexOf(e.node),this.triggerEvents(t,e),e.event.preventDefault())},Eje.prototype.triggerEvents=function(e,t){var i=this,n={cancel:!1,event:t?t.event:null,groupIndex:e,requestType:"resourceChange"};this.parent.trigger(wRe,n,function(e){e.cancel||(i.parent.uiStateValues.groupIndex=e.groupIndex,i.parent.renderModule.render(i.parent.currentView),n={cancel:!1,event:t?t.event:null,groupIndex:i.parent.uiStateValues.groupIndex,requestType:"resourceChanged"},i.parent.adaptiveGroupIndex=i.parent.uiStateValues.groupIndex,i.parent.trigger(CRe,n))})},Eje.prototype.documentClick=function(e){z(e.event.target,"."+ZVe)||(e=this.parent.element.querySelector("."+ZVe))&&e.classList.contains($Oe)&&(this.treePopup.hide(),q([this.popupOverlay],QOe))},Eje.prototype.bindResourcesData=function(t){for(var i=this,e=(this.parent.showSpinner(),[]),n=0,o=this.parent.resources;n<o.length;n++){var r=o[n],r=new x_e(this.parent,r.dataSource,r.query);e.push(r.getData(r.generateQuery()))}Promise.all(e).then(function(e){return i.dataManagerSuccess(e,t)}).catch(function(e){return i.parent.crudModule.dataManagerFailure(e)})},Eje.prototype.dataManagerSuccess=function(e,t){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.parent.resourceCollection=[];for(var i=0,n=e.length;i<n;i++){var o=this.parent.resources[parseInt(i.toString(),10)],o=this.getResourceModel(o,e[parseInt(i.toString(),10)].result);this.parent.resourceCollection.push(o)}this.refreshLayout(t)}},Eje.prototype.getResourceModel=function(e,t){return{field:e.field,title:e.title,name:e.name,allowMultiple:e.allowMultiple,dataSource:t||e.dataSource,idField:e.idField,textField:e.textField,groupIDField:e.groupIDField,colorField:e.colorField,startHourField:e.startHourField,endHourField:e.endHourField,workDaysField:e.workDaysField,expandedField:e.expandedField,cssClassField:e.cssClassField}},Eje.prototype.refreshLayout=function(e){!je(this.parent.uiStateValues.groupIndex)&&this.parent.enablePersistence||(this.parent.uiStateValues.groupIndex=0),this.parent.renderElements(e)},Eje.prototype.setResourceCollection=function(){var e=[];if(this.resourceCollection=[],this.colorIndex=null,0<this.parent.activeViewOptions.group.resources.length)for(var t=0,i=this.parent.activeViewOptions.group.resources;t<i.length;t++){var n=i[t],o=DOe(this.parent.resourceCollection,"name",n);0<=o&&e.push(this.parent.resourceCollection[parseInt(o.toString(),10)])}else 0<this.parent.resourceCollection.length&&(e=this.parent.resourceCollection);for(var r=0,s=0,a=e;s<a.length;s++){var n=a[s],l=this.getResourceModel(n);n.name===this.parent.eventSettings.resourceColorField&&(this.colorIndex=r),r++,this.resourceCollection.push(l)}je(this.colorIndex)&&(this.colorIndex=this.resourceCollection.length-1)},Eje.prototype.generateResourceLevels=function(v,e){function b(e,t,i,n,o){var r=[],s=e[0];if(s){var a,l=void 0;l=n&&w.parent.activeViewOptions.group.byGroupID?(a=n[i.idField],s.dataSource.filter(function(e){return e[s.groupIDField]===a})):s.dataSource;for(var h=0;h<l.length;h++){var d,p,c,u,g,m,f=[],y=((f=o&&0<o.length?f.concat(o):f).push(l[parseInt(h.toString(),10)][s.idField]),b(e.slice(1),t+1,s,l[parseInt(h.toString(),10)],f));0===t&&0===y.length&&1<w.resourceCollection.length||(c=[],d=w.parent.activeView.renderDates,p=void 0,w.parent.activeViewOptions.group.byDate||t+1!==w.resourceCollection.length||(u=l[parseInt(h.toString(),10)][s.workDaysField],g=l[parseInt(h.toString(),10)][s.startHourField],m=l[parseInt(h.toString(),10)][s.endHourField],c=u&&0<u.length?(d=w.parent.activeView.getRenderDates(u),w.parent.activeView.getDateSlots(d,p=u)):(p=w.parent.activeViewOptions.workDays,v),u=w.generateCustomHours(c,g,m,f),S=S.concat(u)),g=l[parseInt(h.toString(),10)][s.cssClassField],m={type:"resourceHeader",className:["e-resource-cells"],resourceLevelIndex:t,groupOrder:f,resource:s,resourceData:l[parseInt(h.toString(),10)],colSpan:w.parent.activeViewOptions.group.byDate?1:c.length,renderDates:d,workDays:p,cssClass:g,child:y},r.push(m))}return C[parseInt(t.toString(),10)]||(C[parseInt(t.toString(),10)]=[]),0<r.length&&C[parseInt(t.toString(),10)].push(r),r}return[]}var w=this,t=this.resourceCollection,C=[],S=[];return this.resourceTreeLevel=b(t,0),e?[]:this.generateHeaderLevels(C,S,v)},Eje.prototype.generateCustomHours=function(e,t,i,n){for(var e=Pe([],e,null,!0),o=0,r=e;o<r.length;o++){var s=r[o];t&&(s.startHour=this.parent.getStartEndTime(t)),i&&(s.endHour=this.parent.getStartEndTime(i)),n&&(s.groupOrder=n)}return e},Eje.prototype.generateHeaderLevels=function(e,t,i){for(var n=[],o=e.length-1;0<=o;o--)for(var r=0,s=0,a=e[parseInt(o.toString(),10)];s<a.length;s++)for(var l=0,h=a[s];l<h.length;l++){var d=h[l];if(e[o+1]&&0<e[o+1].length){var p=e[parseInt((o+1).toString(),10)][parseInt(r.toString(),10)];if(!p)continue;for(var c=0,u=0,g=p;u<g.length;u++){var m=g[u];(!this.parent.activeViewOptions.group.byGroupID||this.parent.activeViewOptions.group.byGroupID&&m.resourceData[m.resource.groupIDField]===d.resourceData[d.resource.idField])&&(c+=m.colSpan)}d.colSpan=c}d.groupIndex=r,r++,n[d.resourceLevelIndex]=n[d.resourceLevelIndex]||[],n[d.resourceLevelIndex].push(d)}if(this.lastResourceLevel=n.slice(-1)[0]||[],!this.parent.activeViewOptions.group.byDate){for(var f=0,y=0,v=this.lastResourceLevel;y<v.length;y++)for(var b=v[y],o=0;o<b.colSpan;o++)t[parseInt(f.toString(),10)].groupIndex=b.groupIndex,f++;return n.push(t),n}var w=[],C=Pe([],n,null,!0),S=[];if(this.parent.activeViewOptions.group.hideNonWorkingDays){for(var A=[],x=0,O=function(r){I.resourceDateTree[parseInt(x.toString(),10)]=[];for(var s=[],e=function(n){var e=I.lastResourceLevel[parseInt(n.toString(),10)].resourceData[I.lastResourceLevel[parseInt(n.toString(),10)].resource.workDaysField];if(-1!==(e=e||I.parent.activeViewOptions.workDays).indexOf(r.date.getDay()))for(var o=Pe({},I.lastResourceLevel[parseInt(n.toString(),10)],null,!0),t=(o.date=r.date,I.lastResourceLevel[parseInt(n.toString(),10)].workDays=e,o.startHour=I.parent.getStartEndTime(o.resourceData[o.resource.startHourField])||r.startHour,o.endHour=I.parent.getStartEndTime(o.resourceData[o.resource.endHourField])||r.endHour,I.resourceDateTree[parseInt(x.toString(),10)].push(o),0);t<o.groupOrder.length;t++)!function(t){if(s[parseInt(t.toString(),10)]||(s[parseInt(t.toString(),10)]=[]),t===o.groupOrder.length-1)return A[parseInt(n.toString(),10)]||(A[parseInt(n.toString(),10)]=[]),i=o.renderDates.filter(function(e){return e.getDay()===r.date.getDay()}),A[parseInt(n.toString(),10)]=A[parseInt(n.toString(),10)].concat(i),s[parseInt(t.toString(),10)].push(o);var e,i=C[parseInt(t.toString(),10)].filter(function(e){return e.resourceData[e.resource.idField]===o.groupOrder[parseInt(t.toString(),10)]});i&&0<i.length&&((e=s[parseInt(t.toString(),10)].filter(function(e){return e.resourceData[e.resource.idField]===o.groupOrder[parseInt(t.toString(),10)]}))&&0<e.length?e[0].colSpan+=1:((e=Pe({},i[0],null,!0)).colSpan=1,s[parseInt(t.toString(),10)].push(e)))}(t)},t=0;t<I.lastResourceLevel.length;t++)e(t);if(0<s.length){for(var i=0;i<C.length;i++)w[parseInt(i.toString(),10)]||(w[parseInt(i.toString(),10)]=[]),w[parseInt(i.toString(),10)]=w[parseInt(i.toString(),10)].concat(s[parseInt(i.toString(),10)]);r.colSpan=s[s.length-1].length,S.push(r)}x++},I=this,T=0,E=i;T<E.length;T++)O(P=E[T]);this.resourceDateTree=this.resourceDateTree.filter(function(e){return 0<e.length}),this.lastResourceLevel.forEach(function(e,t){A[parseInt(t.toString(),10)]&&(e.renderDates=A[parseInt(t.toString(),10)].sort(function(e,t){return e.getTime()-t.getTime()}))})}else{for(var D=0,M=0,N=C[0];M<N.length;M++)D+=N[M].colSpan;for(var k=0,V=i;k<V.length;k++){(P=V[k]).colSpan=D,S.push(P);for(var P,B=Pe([],C,null,!0),F=0,_=B.length;F<_;F++){if(F===B.length-1)for(var L=0,H=B[parseInt(F.toString(),10)];L<H.length;L++){var R=H[L];R.date=P.date,R.workDays=P.workDays,R.startHour=this.parent.getStartEndTime(R.resourceData[R.resource.startHourField])||P.startHour,R.endHour=this.parent.getStartEndTime(R.resourceData[R.resource.endHourField])||P.endHour}w[parseInt(F.toString(),10)]||(w[parseInt(F.toString(),10)]=[]),w[parseInt(F.toString(),10)]=w[parseInt(F.toString(),10)].concat(B[parseInt(F.toString(),10)])}}}return w.unshift(S),w},Eje.prototype.setResourceValues=function(n,e){function t(e,t,i){o.resourceCollection[parseInt(e.toString(),10)].allowMultiple&&o.parent.activeViewOptions.group.allowGroupEdit?n[""+t]=[i]:n[""+t]=i}var o=this;if(void 0===e&&(e=(this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues:this.parent.activeCellsData).groupIndex),0<this.parent.activeViewOptions.group.resources.length&&!je(e))for(var i=this.lastResourceLevel[parseInt(e.toString(),10)].groupOrder,r=0;r<this.resourceCollection.length;r++)t(r,this.resourceCollection[parseInt(r.toString(),10)].field,i[parseInt(r.toString(),10)]);else if(0<this.parent.resourceCollection.length)for(r=0;r<this.resourceCollection.length;r++){var s=this.resourceCollection[parseInt(r.toString(),10)].dataSource[0];s&&t(r,this.resourceCollection[parseInt(r.toString(),10)].field,s[this.resourceCollection[parseInt(r.toString(),10)].idField])}},Eje.prototype.getResourceColor=function(e,t){var i=!je(t)&&this.colorIndex>t.length-1?t.length-1:this.colorIndex,n=this.resourceCollection[parseInt(i.toString(),10)];if(!(je(t)&&this.parent.activeViewOptions.group.allowGroupEdit&&n.allowMultiple))return e=je(t)?e[n.field]:t[parseInt(i.toString(),10)],0<(t=this.filterData(n.dataSource,n.idField,e)).length?t[0][n.colorField]:void 0},Eje.prototype.getCssClass=function(e){var t=this.resourceCollection.slice(-1)[0];return(!this.parent.activeViewOptions.group.allowGroupEdit||!t.allowMultiple)&&0<(e=this.filterData(t.dataSource,t.idField,e[t.field])).length?e[0][t.cssClassField]:void 0},Eje.prototype.getResourceRenderDates=function(){var e=[].concat.apply([],this.lastResourceLevel.map(function(e){return e.renderDates})),i=e.map(function(e){return e.getTime()}),e=e.filter(function(e,t){return i.indexOf(e.getTime())===t});return e.sort(function(e,t){return e.getTime()-t.getTime()}),e},Eje.prototype.filterData=function(e,t,i){return e.filter(function(e){return e[""+t]===i})},Eje.prototype.getResourceData=function(e,t,i){if(this.parent.activeViewOptions.group.allowGroupEdit){for(var n={},o=0,r=i;o<r.length;o++)for(var s=r[o],a=this.lastResourceLevel[parseInt(s.toString(),10)].groupOrder,l=0,h=a.length;l<h;l++){var d=this.resourceCollection[parseInt(l.toString(),10)].field;je(n[""+d])&&(n[""+d]=[]),n[""+d].push(a[parseInt(l.toString(),10)])}Pe(e,n)}else for(var l=0,p=this.resourceCollection.length;l<p;l++)this.lastResourceLevel[parseInt(t.toString(),10)]&&(e[this.resourceCollection[parseInt(l.toString(),10)].field]=this.lastResourceLevel[parseInt(t.toString(),10)].groupOrder[parseInt(l.toString(),10)])},Eje.prototype.addResource=function(e,t,n){for(var o=e instanceof Array?e:[e],i=0,r=this.parent.resourceCollection;i<r.length&&"break"!==function(i){if(i.name===t)return o.forEach(function(e,t){return new me({json:i.dataSource}).insert(e,null,null,n+t)}),"break"}(r[i]);i++);this.refreshLayout(!0)},Eje.prototype.removeResource=function(e,i){for(var n=e instanceof Array?e:[e],t=0,o=this.parent.resourceCollection;t<o.length&&"break"!==function(t){if(t.name===i)return n.forEach(function(e){return new me({json:t.dataSource}).remove(t.idField,e)}),"break"}(o[t]);t++);this.refreshLayout(!0)},Eje.prototype.getIndexFromResourceId=function(t,i,n,o,r){var e;return i=i||this.parent.resourceCollection.slice(-1)[0].name,je(n)&&je(n=this.resourceCollection.filter(function(e){return e.name===i})[0])?null:(e=n.dataSource.filter(function(e){return!o||e[n.idField]!==t||e[n.groupIDField]===o[""+r]?e[n.idField]===t:null})[0],this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(e))},Eje.prototype.resourceExpand=function(t,i,e){var n=this.parent.resourceCollection.filter(function(e){return e.name===i?e:null})[0],o=0,r=n.dataSource.filter(function(e){return e[n.idField]===t})[0],o=this.parent.activeViewOptions.group.byGroupID?this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(r):this.getIndexFromResourceId(t,i,n),r=this.parent.element.querySelector("."+fNe+' [data-group-index="'+o+'"] .'+SNe);r&&(r.classList.contains(wNe)&&!e||r.classList.contains(CNe)&&e)&&r.click()},Eje.prototype.resourceScroll=function(t,e){var i,n,o,r,s,a;this.parent.isAdaptive||-1<["Agenda","MonthAgenda"].indexOf(this.parent.currentView)||(i=e||this.parent.resourceCollection.slice(-1)[0].name,n=this.parent.resourceCollection.length-1,o=this.parent.resourceCollection.filter(function(e,t){return e.name===i?(n=t,e):null})[0],e=this.parent.element.querySelector("."+i2e),r=0,this.parent.activeView.isTimelineView()?(r=this.parent.activeViewOptions.group.byGroupID?(s=o.dataSource.filter(function(e){return e[o.idField]===t})[0],this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(s)):this.getIndexFromResourceId(t,i,o),this.parent.virtualScrollModule?(s=this.parent.element.querySelector("."+n2e),s=Math.round(s.offsetHeight/this.expandedResources.length),this.parent.rowAutoHeight&&(e.scrollTop=0,this.parent.virtualScrollModule.virtualScrolling()),e.scrollTop=r*s-(this.parent.virtualScrollModule.bufferCount-1)*s,this.parent.virtualScrollModule.virtualScrolling(),this.parent.rowAutoHeight?(a=this.parent.element.querySelector("."+JOe+'[data-group-index="'+r+'"]'))&&!a.parentElement.classList.contains(UVe)&&(e.scrollTop=e.scrollTop<a.offsetTop?a.offsetTop:e.scrollTop+a.offsetTop):e.scrollTop=r*s):(a=this.parent.element.querySelector("."+JOe+'[data-group-index="'+r+'"]'))&&!a.parentElement.classList.contains(UVe)&&(e.scrollTop=a.offsetTop)):(r=this.parent.activeViewOptions.group.byGroupID?(i===this.parent.resourceCollection.slice(-1)[0].name?this.lastResourceLevel.map(function(e){return e.resourceData[o.idField]}):o.dataSource.map(function(e){return e[o.idField]})).indexOf(t):this.getIndexFromResourceId(t,i,o),s="Month"===this.parent.currentView?this.parent.element.querySelector("."+eNe+" tbody tr:nth-child("+(n+1)+")"):this.parent.element.querySelector("."+B2e+":nth-child("+(n+1)+")"),a=[].slice.call(s.children).map(function(e){return e.offsetLeft}),e.scrollLeft=a[parseInt(r.toString(),10)]))},Eje.prototype.destroy=function(){this.parent.off($Re,this.documentClick),this.treeViewObj&&(this.treeViewObj.portals&&0<this.treeViewObj.portals.length&&0<(e=this.treeViewObj.portals.map(function(e){return e.propName})).length&&this.parent.resetTemplates(e),this.treeViewObj.destroy(),this.treeViewObj=null),this.treePopup&&(this.treePopup.destroy(),this.treePopup=null,ue(this.parent.element.querySelector("."+ZVe)),ue(this.parent.element.querySelector("."+JVe)));var e=this.parent.element.querySelector("."+NNe);e&&ue(e)};var Tje=Eje;function Eje(e){this.resourceCollection=[],this.leftPixel=25,this.resourceDateTree=[],this.parent=e}Dje=function(e,t){return(Dje=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])}))(e,t)};var Dje,Mje,Wo=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},wce=(function(e,t){function i(){this.constructor=e}Dje(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(kje,Mje=n),Wo([e("")],kje.prototype,"id",void 0),Wo([e("")],kje.prototype,"text",void 0),Wo([e("auto")],kje.prototype,"width",void 0),Wo([e("")],kje.prototype,"cssClass",void 0),Wo([e(!1)],kje.prototype,"showAlwaysInPopup",void 0),Wo([e(!1)],kje.prototype,"disabled",void 0),Wo([e("")],kje.prototype,"prefixIcon",void 0),Wo([e("")],kje.prototype,"suffixIcon",void 0),Wo([e(!0)],kje.prototype,"visible",void 0),Wo([e("None")],kje.prototype,"overflow",void 0),Wo([e("")],kje.prototype,"template",void 0),Wo([e("Button")],kje.prototype,"type",void 0),Wo([e("Both")],kje.prototype,"showTextOn",void 0),Wo([e(null)],kje.prototype,"htmlAttributes",void 0),Wo([e("")],kje.prototype,"tooltipText",void 0),Wo([e("Left")],kje.prototype,"align",void 0),Wo([e(-1)],kje.prototype,"tabIndex",void 0),Wo([e("Custom")],kje.prototype,"name",void 0),Wo([i()],kje.prototype,"click",void 0),kje);function kje(){return null!==Mje&&Mje.apply(this,arguments)||this}Pje=function(e,t){return(Pje=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])}))(e,t)};var Pje,Bje,Ode=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Fje=(function(e,t){function i(){this.constructor=e}Pje(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Lje,Bje=Ji),Lje.prototype.render=function(){var e=[],t=[];if(e.push(_Oe),(this.enableRtl?e:t).push("e-rtl"),(this.isAdaptive?e:t).push(HOe),(this.enableAdaptiveUI?e:t).push(zOe),(this.allowMultiDrag?e:t).push(jOe),this.cssClass)for(var i=0,n=this.cssClass.split(" ");i<n.length;i++){var o=n[i];e.push(o)}mt(this.element,e,t),this.validateDate(),mA({target:this.element}),this.scrollModule=new y_e(this),this.scrollModule.setWidth(),this.scrollModule.setHeight(),this.renderModule=new Gze(this),this.eventBase=new CHe(this),this.workCellAction=new hje(this),this.allowKeyboardInteraction&&(this.keyboardInteractionModule=new S_e(this)),this.inlineModule=new RHe(this),this.initializeDataModule(),this.renderTableContainer(),this.activeViewOptions=this.getActiveViewOptions(),this.initializeResources(),this.wireEvents()},Lje.prototype.renderTableContainer=function(){this.element.querySelector("."+qOe)||this.element.appendChild(this.createElement("div",{className:qOe}))},Lje.prototype.getEventTemplateName=function(e){e="eventTemplate_"+e;return this.activeEventTemplates.indexOf(e)<0&&this.activeEventTemplates.push(e),e},Lje.prototype.getElementWidth=function(e){return OOe(e,this.uiStateValues.isTransformed)},Lje.prototype.getElementHeight=function(e){return NOe(e,this.uiStateValues.isTransformed)},Lje.prototype.getElementHeightFromClass=function(e,t){return nOe(e,t,this.uiStateValues.isTransformed)},Lje.prototype.renderTemplates=function(e){this.isReact?this.renderReactTemplates(e):e&&e()},Lje.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},Lje.prototype.sanitize=function(e,t){this.enableHtmlSanitizer?t.innerText=go.sanitize(e):t.innerHTML=e},Lje.prototype.initializeResources=function(e){void 0===e&&(e=!1),0<this.resources.length?(this.resourceBase=new Tje(this),this.resourceBase.bindResourcesData(e)):(this.resourceBase=null,this.resourceCollection=[],this.renderElements(e))},Lje.prototype.destroyEditorWindow=function(){this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null),this.eventWindow=new Wze(this)},Lje.prototype.renderElements=function(e){e?(this.initializeView(this.currentView),this.eventWindow.refresh()):(this.destroyHeaderModule(),this.showHeaderBar&&(this.headerModule=new m_e(this)),this.renderTableContainer(),this.uiStateValues.isTransformed=Math.round(this.element.getBoundingClientRect().width)!==this.element.offsetWidth,(F.isDevice||F.isTouch)&&(this.scheduleTouchModule=new b_e(this)),this.initializeView(this.currentView),this.destroyPopups(),this.isPrinting||this.initializePopups())},Lje.prototype.validateDate=function(e){var e=(e=void 0===e?this.selectedDate:e)instanceof Date?new Date(e.getTime()):new Date(e),t=je(this.minDate)?new Date(1900,0,1):this.minDate instanceof Date?new Date(this.minDate.getTime()):new Date(this.minDate),i=je(this.maxDate)?new Date(2099,11,31):this.maxDate instanceof Date?new Date(this.maxDate.getTime()):new Date(this.maxDate);if(!(t<=i))throw Error("minDate should be equal or less than maxDate");i<(e=e<t?t:e)&&(e=i),this.setProperties({selectedDate:new Date(""+e),minDate:new Date(""+t),maxDate:new Date(""+i)},!0),this.eventWindow&&this.eventWindow.updateMinMaxDateToEditor()},Lje.prototype.getViewIndex=function(e){for(var t=0;t<this.viewCollections.length;t++)if(this.viewCollections[parseInt(t.toString(),10)].option===e)return t;return-1},Lje.prototype.setViewOptions=function(e){if(void 0===e&&(e=!1),!je(this.views)&&0!==this.views.length){this.viewOptions={},this.viewCollections=[];var t,i,n=this.viewIndex,o=0;this.viewIndex=-1;for(var r=0,s=this.views;r<s.length;r++){var a=s[r],l="string"!=typeof a,l=("string"==typeof a?this.currentView===(t=a)&&(i=t,this.viewIndex=o):(t=a.option,a.isSelected&&(i=t,this.viewIndex=o)),Pe({option:t},l?a:{})),a=t.charAt(0).toLowerCase()+t.slice(1);l.cellHeaderTemplateName=l.cellHeaderTemplate?l.option:"",l.dateHeaderTemplateName=l.dateHeaderTemplate?l.option:"",l.dateRangeTemplateName=l.dateRangeTemplate?l.option:"",l.cellTemplateName=l.cellTemplate?l.option:"",l.dayHeaderTemplateName=l.dayHeaderTemplate?l.option:"",l.monthHeaderTemplateName=l.monthHeaderTemplate?l.option:"",l.resourceHeaderTemplateName=l.resourceHeaderTemplate?l.option:"",l.headerIndentTemplateName=l.headerIndentTemplate?l.option:"",l.eventTemplateName=l.eventTemplate?l.option:"",je(l.firstDayOfWeek)||0!==l.firstDayOfWeek||delete l.firstDayOfWeek,je(l.interval)||1!==l.interval||delete l.interval,this.viewCollections.push(l),je(this.viewOptions[""+a])?this.viewOptions[""+a]=[l]:this.viewOptions[""+a].push(l),o++}!e&&i&&this.setProperties({currentView:i},!0),-1===this.viewIndex&&(e=this.getViewIndex(this.currentView),this.viewIndex="string"==typeof this.views[0]||je(n)||-1===n?-1===e?0:e:n)}},Lje.prototype.getActiveViewOptions=function(){var e={enable:this.timeScale.enable,interval:this.timeScale.interval,slotCount:this.timeScale.slotCount,majorSlotTemplate:this.timeScale.majorSlotTemplate,minorSlotTemplate:this.timeScale.minorSlotTemplate},t={byDate:!(-1<this.viewCollections[this.viewIndex].option.indexOf("Year"))&&this.group.byDate,byGroupID:this.group.byGroupID,allowGroupEdit:this.group.allowGroupEdit,resources:je(this.group.resources)?[]:this.group.resources,headerTooltipTemplate:this.group.headerTooltipTemplate,enableCompactView:this.group.enableCompactView,hideNonWorkingDays:-1<["Day","Week","WorkWeek","Month"].indexOf(this.currentView)&&this.group.hideNonWorkingDays},i=this.viewCollections[this.viewIndex].workDays?[]:this.workDays,i={dateFormat:this.dateFormat,endHour:this.endHour,isSelected:!1,option:null,readonly:this.readonly,startHour:this.startHour,allowVirtualScrolling:!1,allowOverlap:this.allowOverlap,overscanCount:this.overscanCount,cellHeaderTemplate:this.cellHeaderTemplate,dayHeaderTemplate:this.dayHeaderTemplate,monthHeaderTemplate:this.monthHeaderTemplate,cellTemplate:this.cellTemplate,eventTemplate:this.eventSettings.template,dateHeaderTemplate:this.dateHeaderTemplate,dateRangeTemplate:this.dateRangeTemplate,resourceHeaderTemplate:this.resourceHeaderTemplate,headerIndentTemplate:this.headerIndentTemplate,firstMonthOfYear:this.firstMonthOfYear,firstDayOfWeek:this.firstDayOfWeek,workDays:i,monthsCount:this.monthsCount,showWeekend:this.showWeekend,showWeekNumber:this.showWeekNumber,displayName:null,interval:1,timeScale:e,timeFormat:this.internalTimeFormat,group:t,headerRows:this.headerRows,orientation:"Horizontal",numberOfWeeks:0,displayDate:null,enableLazyLoading:!1},e=this.viewCollections[this.viewIndex],t=Pe(i,e,void 0,!0);return 0!==this.firstDayOfWeek&&e.firstDayOfWeek&&this.firstDayOfWeek!==e.firstDayOfWeek&&(t.firstDayOfWeek=this.firstDayOfWeek),t.displayDate&&(t.displayDate=t.displayDate instanceof Date?new Date(t.displayDate.getTime()):new Date(t.displayDate)),t.enableLazyLoading&&!je(t.group.resources)&&0<t.group.resources.length&&(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(t.option)||"TimelineYear"===t.option&&"Vertical"===t.orientation)&&(t.allowVirtualScrolling=!0),t},Lje.prototype.initializeDataModule=function(){this.eventFields={id:this.eventSettings.fields.id,isBlock:this.eventSettings.fields.isBlock,subject:this.eventSettings.fields.subject.name,startTime:this.eventSettings.fields.startTime.name,endTime:this.eventSettings.fields.endTime.name,startTimezone:this.eventSettings.fields.startTimezone.name,endTimezone:this.eventSettings.fields.endTimezone.name,location:this.eventSettings.fields.location.name,description:this.eventSettings.fields.description.name,isAllDay:this.eventSettings.fields.isAllDay.name,recurrenceID:this.eventSettings.fields.recurrenceID.name,recurrenceRule:this.eventSettings.fields.recurrenceRule.name,recurrenceException:this.eventSettings.fields.recurrenceException.name,isReadonly:this.eventSettings.fields.isReadonly,followingID:this.eventSettings.fields.followingID},this.setEditorTitles(),this.dataModule=new x_e(this,this.eventSettings.dataSource,this.eventSettings.query),this.crudModule=new aje(this)},Lje.prototype.setEditorTitles=function(){this.editorTitles={subject:this.eventSettings.fields.subject.title||this.localeObj.getConstant("title"),startTime:this.eventSettings.fields.startTime.title||this.localeObj.getConstant("start"),endTime:this.eventSettings.fields.endTime.title||this.localeObj.getConstant("end"),isAllDay:this.eventSettings.fields.isAllDay.title||this.localeObj.getConstant("allDay"),startTimezone:this.eventSettings.fields.startTimezone.title||this.localeObj.getConstant("startTimezone"),endTimezone:this.eventSettings.fields.endTimezone.title||this.localeObj.getConstant("endTimezone"),location:this.eventSettings.fields.location.title||this.localeObj.getConstant("location"),description:this.eventSettings.fields.description.title||this.localeObj.getConstant("description"),recurrenceRule:this.eventSettings.fields.recurrenceRule.title||this.localeObj.getConstant("repeat")}},Lje.prototype.initializeView=function(e){this.showSpinner(),this.activeViewOptions=this.getActiveViewOptions(),this.resourceBase&&this.resourceBase.setResourceCollection(),this.initializeTemplates(),this.renderModule.render(e)},Lje.prototype.initializeTemplates=function(){this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),this.dayHeaderTemplateFn=this.templateParser(this.activeViewOptions.dayHeaderTemplate),this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.majorSlotTemplateFn=this.templateParser(this.activeViewOptions.timeScale.majorSlotTemplate),this.minorSlotTemplateFn=this.templateParser(this.activeViewOptions.timeScale.minorSlotTemplate),this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.editorTemplateFn=this.templateParser(this.editorTemplate),this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate),this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer)},Lje.prototype.initializePopups=function(){this.eventWindow=new Wze(this),this.quickPopup=new _He(this)},Lje.prototype.getDayNames=function(e){for(var t=[],i=je(this.locale)||"en"===this.locale||"en-US"===this.locale?R("days.stand-alone."+e,Pi(this.getCalendarMode())):R("main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.format."+e,Ai),n=0,o=Object.keys(i);n<o.length;n++){var r=o[n];t.push(R(r,i))}return t},Lje.prototype.setCldrTimeFormat=function(){je(this.timeFormat)?je(this.locale)||"en"===this.locale||"en-US"===this.locale?this.internalTimeFormat=R("timeFormats.short",Pi(this.getCalendarMode())):this.internalTimeFormat=R("main."+this.locale+".dates.calendars."+this.getCalendarMode()+".timeFormats.short",Ai):this.internalTimeFormat=this.timeFormat},Lje.prototype.getCalendarMode=function(){return je(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},Lje.prototype.getTimeString=function(e){return this.globalize.formatDate(e,{format:this.activeViewOptions.timeFormat,type:"time",calendar:this.getCalendarMode()}).toLocaleUpperCase()},Lje.prototype.getDateTime=function(e){return e instanceof Date?new Date(e.getTime()):new Date(e)},Lje.prototype.setCalendarMode=function(){"Islamic"===this.calendarMode?this.calendarUtil=new D_e:this.calendarUtil=new T_e},Lje.prototype.changeView=function(i,n,e,t){var o,r,s=this;je(t)&&(t=this.getViewIndex(i)),!e&&t===this.viewIndex&&this.currentView===i||t<0||(o=this.activeViewOptions?this.activeViewOptions.option:this.currentView,this.trigger(wRe,{requestType:"viewNavigate",cancel:!1,event:n},function(e){e.cancel?s.currentView=o:(e={action:"view",cancel:!1,currentDate:s.selectedDate,previousView:o,currentView:i,viewIndex:t},s.trigger(ARe,e,function(e){var t;e.cancel?s.currentView=o:(t=-1<["Day","Week","WorkWeek"].indexOf(i)&&["Day","Week","WorkWeek"].indexOf(o)<0,s.uiStateValues.isInitial=t||-1<i.indexOf("Timeline")||-1<i.indexOf("Year"),s.uiStateValues.top=-1<i.indexOf("Timeline")&&o.indexOf("Timeline")<0?0:s.uiStateValues.top,s.viewIndex=e.viewIndex,s.setProperties({currentView:i},!0),s.headerModule&&(s.headerModule.updateActiveView(),s.headerModule.setCalendarDate(s.selectedDate),s.headerModule.setCalendarView()),s.initializeView(s.currentView),s.animateLayout(),r={requestType:"viewNavigate",cancel:!1,event:n},s.trigger(CRe,r))}))}))},Lje.prototype.changeDate=function(t,i){var n,o=this;this.trigger(wRe,{requestType:"dateNavigate",cancel:!1,event:i},function(e){e.cancel||(e={action:"date",cancel:!1,previousDate:o.selectedDate,currentDate:t},o.trigger(ARe,e,function(e){e.cancel||(o.uiStateValues.isInitial=o.activeView.isTimelineView()&&"TimelineYear"!==o.currentView,o.validateDate(e.currentDate),o.headerModule&&o.headerModule.setCalendarDate(e.currentDate),"MonthAgenda"===o.currentView&&o.monthAgendaModule&&(o.monthAgendaModule.monthAgendaDate=new Date(""+o.selectedDate)),o.initializeView(o.currentView),o.animateLayout(),n={requestType:"dateNavigate",cancel:!1,event:i},o.trigger(CRe,n))}))})},Lje.prototype.isMinMaxDate=function(e){void 0===e&&(e=this.selectedDate);var t=je(this.maxDate)?new Date(2099,11,31):this.maxDate,i=je(this.minDate)?new Date(1900,0,1):this.minDate;return e.getTime()>=i.getTime()&&e.getTime()<=t.getTime()},Lje.prototype.isSelectedDate=function(e){return e.setHours(0,0,0,0)===new Date(""+this.selectedDate).setHours(0,0,0,0)},Lje.prototype.getCurrentTime=function(e){return void 0===e&&(e=new Date),this.timezone?this.tzModule.convert(e,this.tzModule.getLocalTimezoneName(),this.timezone):e},Lje.prototype.getNavigateView=function(){return this.activeView.isTimelineView()?"TimelineMonth"===this.currentView||"TimelineYear"===this.currentView?"TimelineDay":"Agenda":"Day"},Lje.prototype.animateLayout=function(){this.activeView.element&&new Vt({duration:600,name:"FadeIn",timingFunction:"easeIn"}).animate(this.activeView.element)},Lje.prototype.requiredModules=function(){var e=[];this.setViewOptions(!0);for(var t=0,i=Object.keys(this.viewOptions);t<i.length;t++){var n=i[t];e.push({member:"timelineDay"===n||"timelineWeek"===n||"timelineWorkWeek"===n?"timelineViews":n,args:[this]})}return this.allowDragAndDrop&&e.push({member:"dragAndDrop",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),e.push({member:"excelExport",args:[this]}),e.push({member:"iCalendarExport",args:[this]}),e.push({member:"iCalendarImport",args:[this]}),e.push({member:"print",args:[this]}),e},Lje.prototype.preRender=function(){this.isAdaptive=F.isDevice||LOe(),this.globalize=new Ti(this.locale),this.tzModule=new k_e,(this&&je(this.uiStateValues)||!this.enablePersistence)&&(this.uiStateValues={expand:!1,isInitial:!0,left:0,top:0,isGroupAdaptive:!1,isIgnoreOccurrence:!1,groupIndex:this.adaptiveGroupIndex,action:!1,isBlock:!1,isCustomMonth:!0,isPreventTimezone:!1,isTransformed:!1}),this.currentTimezoneDate=this.getCurrentTime(),this.activeCellsData={startTime:new Date(this.currentTimezoneDate),endTime:new Date(this.currentTimezoneDate),isAllDay:!1},this.activeEventData={event:void 0,element:void 0},this.getDefaultLocale(),this.localeObj=new Cn(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),this.eventsData=[],this.eventsProcessed=[],this.blockData=[],this.blockProcessed=[],this.resourceCollection=[],this.currentAction=null,this.selectedElements=[],this.activeEventTemplates=[],this.setViewOptions()},Lje.prototype.getDefaultLocale=function(){this.defaultLocale={day:"Day",week:"Week",workWeek:"Work Week",month:"Month",year:"Year",agenda:"Agenda",weekAgenda:"Week Agenda",workWeekAgenda:"Work Week Agenda",monthAgenda:"Month Agenda",today:"Today",noEvents:"No events",emptyContainer:"There are no events scheduled on this day.",allDay:"All day",start:"Start",end:"End",more:"more",close:"Close",cancel:"Cancel",noTitle:"(No Title)",delete:"Delete",deleteEvent:"Delete Event",deleteMultipleEvent:"Delete Multiple Events",selectedItems:"Items selected",deleteSeries:"Entire Series",edit:"Edit",editSeries:"Entire Series",editEvent:"Edit Event",createEvent:"Create",subject:"Subject",addTitle:"Add title",moreDetails:"More Details",moreEvents:"More Events",save:"Save",editContent:"How would you like to change the appointment in the series?",deleteContent:"Are you sure you want to delete this event?",deleteMultipleContent:"Are you sure you want to delete the selected events?",newEvent:"New Event",title:"Title",location:"Location",description:"Description",timezone:"Timezone",startTimezone:"Start Timezone",endTimezone:"End Timezone",repeat:"Repeat",saveButton:"Save",cancelButton:"Cancel",deleteButton:"Delete",recurrence:"Recurrence",wrongPattern:"The recurrence pattern is not valid.",seriesChangeAlert:"Do you want to cancel the changes made to specific instances of this series and match it to the whole series again?",createError:"The duration of the event must be shorter than how frequently it occurs. Shorten the duration, or change the recurrence pattern in the recurrence event editor.",sameDayAlert:"Two occurrences of the same event cannot occur on the same day.",occurenceAlert:"Cannot reschedule an occurrence of the recurring appointment if it skips over a later occurrence of the same appointment.",editRecurrence:"Edit Recurrence",recurringEvent:"Recurring Event",repeats:"Repeats",alert:"Alert",startEndError:"The selected end date occurs before the start date.",invalidDateError:"The entered date value is invalid.",blockAlert:"Events cannot be scheduled within the blocked time range.",overlapAlert:"Events cannot be scheduled during the chosen time as it overlaps with another event.",ok:"Ok",yes:"Yes",no:"No",of:"of",occurrence:"Occurrence",series:"Series",previous:"Previous",next:"Next",timelineDay:"Timeline Day",timelineWeek:"Timeline Week",timelineWorkWeek:"Timeline Work Week",timelineMonth:"Timeline Month",timelineYear:"Timeline Year",editFollowingEvent:"Following Events",deleteTitle:"Delete Event",editTitle:"Edit Event",beginFrom:"Begin From",endAt:"Ends At",expandAllDaySection:"Expand-all-day-section",collapseAllDaySection:"Collapse-all-day-section",searchTimezone:"Search Timezone",noRecords:"No records found"}},Lje.prototype.wireEvents=function(){E.add(window,"resize",this.onScheduleResize,this),E.add(window,"orientationchange",this.onScheduleResize,this),E.add(document,F.touchStartEvent,this.onDocumentClick,this),this.allowClipboard&&E.add(document,"paste",this.onDocumentPaste,this)},Lje.prototype.removeSelectedClass=function(){for(var e=this.getSelectedCells(),t=0,i=e;t<i.length;t++)i[t].removeAttribute("tabindex");q(e,HNe),this.keyboardInteractionModule&&0<this.keyboardInteractionModule.selectedCells.length&&(this.keyboardInteractionModule.selectedCells=[])},Lje.prototype.addSelectedClass=function(e,t,i){U(e,HNe),t&&(t.setAttribute("tabindex","0"),t.focus({preventScroll:i||!1}))},Lje.prototype.selectCell=function(e){this.removeSelectedClass(),this.addSelectedClass([e],e)},Lje.prototype.getAllDayRow=function(){return this.element.querySelector("."+XOe)},Lje.prototype.getContentTable=function(){return this.activeView.element.querySelector("."+KOe+" tbody")},Lje.prototype.getTableRows=function(){return[].slice.call(this.element.querySelectorAll("."+KOe+" tbody tr:not(."+UVe+")"))},Lje.prototype.getWorkCellElements=function(){return[].slice.call(this.element.querySelectorAll("."+JOe))},Lje.prototype.getIndexOfDate=function(e,t){return e.map(Number).indexOf(+t)},Lje.prototype.isAllDayCell=function(e){return!(!(-1<["Month","TimelineMonth","TimelineYear","MonthAgenda"].indexOf(this.currentView)||e.classList.contains(YOe)||e.classList.contains(iNe))&&this.activeViewOptions.timeScale.enable&&!(this.activeView.isTimelineView()&&0<this.activeViewOptions.headerRows.length&&"Hour"!==this.activeViewOptions.headerRows.slice(-1)[0].option))},Lje.prototype.getDateFromElement=function(e){var t;if(je(e)||(t=e.getAttribute("data-date")),!je(t))return e=parseInt(t,10),new Date(e)},Lje.prototype.getTargetElement=function(e,t,i){var n,t=document.elementFromPoint(t,i);return(n=t?t.closest(e):n)?[n]:null},Lje.prototype.getCellHeaderTemplate=function(){return this.cellHeaderTemplateFn},Lje.prototype.getDayHeaderTemplate=function(){return this.dayHeaderTemplateFn},Lje.prototype.getMonthHeaderTemplate=function(){return this.monthHeaderTemplateFn},Lje.prototype.getCellTemplate=function(){return this.cellTemplateFn},Lje.prototype.getDateHeaderTemplate=function(){return this.dateHeaderTemplateFn},Lje.prototype.getDateRangeTemplate=function(){return this.dateRangeTemplateFn},Lje.prototype.getMajorSlotTemplate=function(){return this.majorSlotTemplateFn},Lje.prototype.getMinorSlotTemplate=function(){return this.minorSlotTemplateFn},Lje.prototype.getAppointmentTemplate=function(){return this.appointmentTemplateFn},Lje.prototype.getEventTooltipTemplate=function(){return this.eventTooltipTemplateFn},Lje.prototype.getHeaderTooltipTemplate=function(){return this.headerTooltipTemplateFn},Lje.prototype.getEditorTemplate=function(){return this.editorTemplateFn},Lje.prototype.getEditorHeaderTemplate=function(){return this.editorHeaderTemplateFn},Lje.prototype.getEditorFooterTemplate=function(){return this.editorFooterTemplateFn},Lje.prototype.getQuickInfoTemplatesHeader=function(){return this.quickInfoTemplatesHeaderFn},Lje.prototype.getQuickInfoTemplatesContent=function(){return this.quickInfoTemplatesContentFn},Lje.prototype.getQuickInfoTemplatesFooter=function(){return this.quickInfoTemplatesFooterFn},Lje.prototype.getResourceHeaderTemplate=function(){return this.resourceHeaderTemplateFn},Lje.prototype.getHeaderIndentTemplate=function(){return this.headerIndentTemplateFn},Lje.prototype.getCssProperties=function(){return{border:this.enableRtl?"borderLeftWidth":"borderRightWidth",padding:this.enableRtl?"paddingLeft":"paddingRight",rtlBorder:this.enableRtl?"borderRightWidth":"borderLeftWidth",rtlPadding:this.enableRtl?"paddingRight":"paddingLeft"}},Lje.prototype.removeNewEventElement=function(){var e=this.element.querySelector("."+w2e);je(e)||ue(e)},Lje.prototype.getStartEndTime=function(e){var t;return je(e)||""===e?null:(t=gOe(new Date(this.currentTimezoneDate)||this.getCurrentTime()),2===(e=e.split(":")).length&&t.setHours(parseInt(e[0],10),parseInt(e[1],10),0),t)},Lje.prototype.onDocumentClick=function(e){this.notify($Re,{event:e})},Lje.prototype.onDocumentPaste=function(e){this.notify(eOe,{event:e})},Lje.prototype.onScheduleResize=function(){var e,t;je(this.activeView)||(this.isAdaptive||FOe())&&document.activeElement&&(document.activeElement.classList.contains(CVe)||document.activeElement.classList.contains(h_e))||this.uiStateValues.isTapHold||(this.virtualScrollModule&&this.activeView.isTimelineView()&&this.virtualScrollModule.refreshLayout(),this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime(),this.quickPopup&&this.quickPopup.onClosePopup(),EOe(),"Month"===this.currentView||"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView&&!this.activeViewOptions.timeScale.enable||this.activeView.isTimelineView()?(this.activeView.resetColWidth(),this.notify(JRe,{cssProperties:this.getCssProperties(),isPreventScrollUpdate:!0}),e=!1,this.activeViewOptions.enableLazyLoading&&this.virtualScrollModule&&this.virtualScrollModule.isRemoteRefresh&&(e=this.virtualScrollModule.isRemoteRefresh,this.virtualScrollModule.isRemoteRefresh=!1),this.refreshEvents(e),this.virtualScrollModule&&!this.virtualScrollModule.enableTransition&&(e=this.element.querySelector("."+fNe),t=this.element.querySelector("."+i2e),this.virtualScrollModule.enableTransition=!0,U([t,e],"e-transition"))):this.notify(YRe,{}))},Lje.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){return oo(t)}},Lje.prototype.getSelectedCells=function(){return[].slice.call(this.element.querySelectorAll("."+HNe))},Lje.prototype.getAnnouncementString=function(e,t){this.quickPopup&&0<this.activeViewOptions.group.resources.length&&(i=this.quickPopup.getResourceText({event:e},"event")+'"s event - ');var i,t=t||e[this.eventFields.subject]||this.eventSettings.fields.subject.default,n=e[this.eventFields.location]||this.eventSettings.fields.location.default,o=this.globalize.formatDate(e[this.eventFields.startTime],{type:"dateTime",skeleton:"full",calendar:this.getCalendarMode()}),r=this.globalize.formatDate(e[this.eventFields.endTime],{type:"dateTime",skeleton:"full",calendar:this.getCalendarMode()}),t=t+" "+this.localeObj.getConstant("beginFrom")+" "+o+" "+this.localeObj.getConstant("endAt")+" "+r;return i&&(t=i+" "+t),n&&""!==n&&(t=t+" "+this.localeObj.getConstant("location")+" "+n),t=e[this.eventFields.recurrenceRule]&&""!==e[this.eventFields.recurrenceRule]&&e[this.eventFields.id]===e[this.eventFields.recurrenceID]?t+" "+this.localeObj.getConstant("recurringEvent"):t},Lje.prototype.boundaryValidation=function(e,t){var i={left:!1,right:!1,top:!1,bottom:!1},n=this.element.querySelector("."+i2e).getBoundingClientRect();return e<n.top+30+window.pageYOffset&&e>n.top+window.pageYOffset&&(i.top=!0),e>n.bottom-30+window.pageYOffset&&e<n.bottom+window.pageYOffset&&(i.bottom=!0),t<n.left+30+window.pageXOffset&&t>n.left+window.pageXOffset&&(i.left=!0),t>n.right-30+window.pageXOffset&&t<n.right+window.pageXOffset&&(i.right=!0),i},Lje.prototype.getWeekNumberContent=function(e){var t,i,n;return"FirstDay"===this.weekRule?(t=lOe(e.slice(-1)[0],this.firstDayOfWeek),t=this.globalize.formatNumber(pOe(t))):"FirstFourDayWeek"===this.weekRule?(i=cOe(n=aOe(e.slice(-1)[0],this.firstDayOfWeek),lOe(e.slice(-1)[0],this.firstDayOfWeek)),t=this.globalize.formatNumber(pOe(i))):"FirstFullWeek"===this.weekRule&&(n=aOe(e.slice(-1)[0],this.firstDayOfWeek),t=this.globalize.formatNumber(pOe(n))),t},Lje.prototype.renderHeaderIndentTemplate=function(e,t){var i;this.activeViewOptions.headerIndentTemplate&&(i=this.element.id+"_"+this.activeViewOptions.headerIndentTemplateName+"headerIndentTemplate",ht([].slice.call(this.getHeaderIndentTemplate()(e,this,"headerIndentTemplate",i,!1,void 0,void 0,this.root)),t))},Lje.prototype.isSpecificResourceEvents=function(){return 0<this.activeViewOptions.group.resources.length&&!this.activeViewOptions.group.allowGroupEdit&&!this.rowAutoHeight&&!this.virtualScrollModule&&this.activeViewOptions.group.byGroupID},Lje.prototype.unWireEvents=function(){E.remove(window,"resize",this.onScheduleResize),E.remove(window,"orientationchange",this.onScheduleResize),E.remove(document,F.touchStartEvent,this.onDocumentClick),E.remove(document,"paste",this.onDocumentPaste)},Lje.prototype.getModuleName=function(){return"schedule"},Lje.prototype.getPersistData=function(){return this.addOnPersist(["currentView","selectedDate","scrollTop","scrollLeft","adaptiveGroupIndex"])},Lje.prototype.onPropertyChanged=function(e,t){if(!this.isReact||!je(this.activeView)){for(var i={isRefresh:!1,isResource:!1,isDate:!1,isView:!1,isLayout:!1,isDataManager:!1},n=0,o=Object.keys(e);n<o.length;n++){var r=o[n];switch(r){case"views":this.setViewOptions(),this.headerModule&&this.headerModule.updateItems(),i.isView=!0;break;case"currentView":i.isView=!0;break;case"minDate":case"maxDate":case"selectedDate":i.isDate=!0;break;case"dateFormat":this.activeViewOptions=this.getActiveViewOptions(),this.headerModule&&this.headerModule.updateDateRange();break;case"showHeaderBar":case"toolbarItems":this.destroyHeaderModule(),e.showHeaderBar&&(this.headerModule=new m_e(this),this.headerModule.updateDateRange()),this.notify(JRe,{cssProperties:this.getCssProperties()}),this.activeView.isTimelineView()&&this.refreshEvents(!1);break;case"workDays":JSON.stringify(t.workDays)!==JSON.stringify(e.workDays)&&(i.isLayout=!0);break;case"showWeekend":case"startHour":case"endHour":case"workHours":case"readonly":case"headerRows":case"showWeekNumber":case"rowAutoHeight":i.isLayout=!0;break;case"locale":case"calendarMode":this.globalize=new Ti(this.locale),this.localeObj=new Cn(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),i.isRefresh=!0;break;case"firstDayOfWeek":this.activeViewOptions.firstDayOfWeek=e.firstDayOfWeek,this.eventWindow&&this.eventWindow.refreshRecurrenceEditor(),i.isLayout=!0;break;case"showTimeIndicator":this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime();break;case"cellHeaderTemplate":this.activeViewOptions.cellHeaderTemplate=e.cellHeaderTemplate,this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),i.isLayout=!0;break;case"cellTemplate":this.activeViewOptions.cellTemplate=e.cellTemplate,this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),i.isLayout=!0;break;case"dateHeaderTemplate":this.activeViewOptions.dateHeaderTemplate=e.dateHeaderTemplate,this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),i.isLayout=!0;break;case"dateRangeTemplate":this.activeViewOptions.dateRangeTemplate=e.dateRangeTemplate,this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.headerModule&&this.headerModule.updateDateRange();break;case"dayHeaderTemplate":this.activeViewOptions.dayHeaderTemplate=e.dayHeaderTemplate,this.dayHeaderTemplateFn=this.templateParser(this.activeViewOptions.dayHeaderTemplate),i.isLayout=!0;break;case"monthHeaderTemplate":this.activeViewOptions.monthHeaderTemplate=e.monthHeaderTemplate,this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),i.isLayout=!0;break;case"resourceHeaderTemplate":this.activeViewOptions.resourceHeaderTemplate=e.resourceHeaderTemplate,this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),i.isLayout=!0;break;case"timezone":this.eventBase.timezonePropertyChange(t.timezone),this.headerModule&&this.headerModule.setCalendarTimezone();break;case"enableRtl":this.setRtlClass(),i.isRefresh=!0;break;default:this.extendedPropertyChange(r,e,t,i)}}this.propertyChangeAction(i)}},Lje.prototype.propertyChangeAction=function(e){e.isRefresh?this.refresh():e.isResource?this.initializeResources(!0):e.isView?this.changeView(this.currentView,null,!0):e.isDate?(je(this.selectedDate)&&this.setProperties({selectedDate:this.getCurrentTime()},!0),this.changeDate(this.selectedDate)):e.isLayout?(this.activeCellsData=null,this.initializeView(this.currentView)):e.isDataManager&&this.crudModule&&(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",q([this.element],b2e)),this.crudModule.refreshDataManager())},Lje.prototype.allDayRowScrollUpdate=function(){var e=this.element.querySelector("."+eNe),t=this.element.querySelector("."+XOe);"auto"!==this.height&&this.enableAllDayScroll?(e.classList.contains(u_e)&&q([e],u_e),this.eventBase.allDayExpandScroll(e)):(U([e],u_e),e.classList.contains(c_e)&&q([e],c_e),this.uiStateValues.expand&&((e=[].slice.call(this.element.querySelectorAll("."+YOe)))[0].style.height=t.style.height||e[1].style.height)),this.uiStateValues.expand||(t.style.height="")},Lje.prototype.extendedPropertyChange=function(e,t,i,n){switch(e){case"width":case"height":case"enableAllDayScroll":-1<["Day","Week","WorkWeek"].indexOf(this.currentView)&&this.allDayRowScrollUpdate(),this.notify(ZRe,{module:"scroll",properties:{width:t.width,height:t.height}});break;case"cssClass":i.cssClass&&q([this.element],i.cssClass.split(" ")),t.cssClass&&U([this.element],t.cssClass.split(" "));break;case"hideEmptyAgendaDays":case"agendaDaysCount":this.activeViewOptions=this.getActiveViewOptions(),n.isView=!0;break;case"eventSettings":this.onEventSettingsPropertyChanged(t.eventSettings,i.eventSettings,n);break;case"allowKeyboardInteraction":case"allowClipboard":this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),(t.allowKeyboardInteraction||t.allowClipboard)&&(this.keyboardInteractionModule=new S_e(this));break;case"timezoneDataSource":this.eventWindow&&this.eventWindow.refresh();break;case"editorTemplate":je(this.editorTemplate)||(this.editorTemplateFn=this.templateParser(this.editorTemplate)),this.eventWindow&&this.eventWindow.setDialogContent();break;case"editorHeaderTemplate":je(this.editorHeaderTemplate)||(this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate)),this.eventWindow&&this.eventWindow.setDialogHeader();break;case"editorFooterTemplate":je(this.editorFooterTemplate)||(this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate)),this.eventWindow&&this.eventWindow.setDialogFooter();break;case"quickInfoTemplates":this.quickInfoTemplates.header&&(this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header)),this.quickInfoTemplates.content&&(this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content)),this.quickInfoTemplates.footer&&(this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer));break;case"group":this.onGroupSettingsPropertyChanged(t.group,i.group,n);break;case"resources":n.isResource=!0;break;case"timeScale":this.activeViewOptions.timeScale.interval=t.timeScale.interval||this.activeViewOptions.timeScale.interval,this.activeViewOptions.timeScale.slotCount=t.timeScale.slotCount||this.activeViewOptions.timeScale.slotCount,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),n.isLayout=!0;break;case"allowDragAndDrop":case"allowResizing":case"eventDragArea":case"allowOverlap":this.refreshEvents(!1);break;case"weekRule":n.isLayout=!0;break;case"firstMonthOfYear":this.activeViewOptions.firstMonthOfYear=t.firstMonthOfYear,this.viewIndex=this.activeView.viewIndex,n.isLayout=!0;break;case"monthsCount":this.activeViewOptions.monthsCount=t.monthsCount,this.viewIndex=this.activeView.viewIndex,n.isLayout=!0;break;case"timeFormat":this.internalTimeFormat=t.timeFormat||this.activeViewOptions.timeFormat,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),n.isLayout=!0;break;case"enableAdaptiveUI":this.showHeaderBar&&this.headerModule&&(this.destroyHeaderModule(),this.headerModule=new m_e(this),this.headerModule.updateDateRange()),n.isLayout=!0;break;case"headerIndentTemplate":this.activeViewOptions.headerIndentTemplate=t.headerIndentTemplate,this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),n.isLayout=!0}},Lje.prototype.setRtlClass=function(){(this.enableRtl?U:q)([this.element],"e-rtl")},Lje.prototype.onGroupSettingsPropertyChanged=function(e,t,i){for(var n=0,o=Object.keys(e);n<o.length;n++)"headerTooltipTemplate"===o[n]?this.headerTooltipTemplateFn=this.templateParser(e.headerTooltipTemplate):(i.isLayout=!0,this.eventWindow&&this.eventWindow.refresh())},Lje.prototype.onEventSettingsPropertyChanged=function(e,t,i){for(var n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"dataSource":case"query":case"fields":case"includeFiltersInQuery":this.initializeDataModule(),i.isDataManager=!0;break;case"template":this.activeViewOptions.eventTemplate=e.template,this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),i.isDataManager=!0;break;case"enableTooltip":this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),e.enableTooltip&&(this.eventTooltip=new zHe(this));break;case"tooltipTemplate":this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate);break;case"resourceColorField":this.resourceBase&&this.resourceBase.setResourceCollection(),i.isDataManager=!0;break;case"editFollowingEvents":this.quickPopup&&this.quickPopup.refreshQuickDialog();break;case"allowAdding":case"allowEditing":case"allowDeleting":this.showHeaderBar&&this.headerModule&&this.headerModule.updateAddIcon(),this.eventWindow&&this.eventWindow.refresh();break;case"spannedEventPlacement":case"minimumEventDuration":case"enableMaxHeight":case"enableIndicator":this.refreshEvents(!1);break;case"ignoreWhitespace":i.isLayout=!0}},Lje.prototype.destroyHeaderModule=function(){this.headerModule&&(this.headerModule.destroy(),this.headerModule=null)},Lje.prototype.destroyPopups=function(){this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null)},Lje.prototype.showSpinner=function(){kA(this.element)},Lje.prototype.hideSpinner=function(){BA(this.element)},Lje.prototype.setWorkHours=function(e,t,i,n){U(this.getWorkHourCells(e,t,i,n),ZOe)},Lje.prototype.resetWorkHours=function(e,t,i,n){q((e=void 0===e?this.activeView.renderDates:e)&&t&&i?this.getWorkHourCells(e,t,i,n):[].slice.call(this.element.querySelectorAll("."+ZOe)),ZOe)},Lje.prototype.getWorkHourCells=function(e,t,i,n){if(-1<["Agenda","MonthAgenda","Month","TimelineMonth"].indexOf(this.currentView))return[];var t=this.getStartEndTime(t),i=this.getStartEndTime(i),o=this.getContentTable();if(je(t)||je(i)||!o)return[];t.setMilliseconds(0),i.setMilliseconds(0);var r=this.activeView.getStartHour(),s=(t<r&&(t=r),this.activeView.getEndHour());s<i&&(i=s);for(var a=6e4*this.activeViewOptions.timeScale.interval/this.activeViewOptions.timeScale.slotCount,l=6e4*(r.getTimezoneOffset()-t.getTimezoneOffset()),h=Math.abs(6e4*(r.getTimezoneOffset()-i.getTimezoneOffset())),d=m=Math.round((t.getTime()-r.getTime()+l)/a),p=f=Math.ceil((i.getTime()-r.getTime()-h)/a),c=[],u=0,g=e;u<g.length;u++){var m,f,y=g[u],v=(gOe(y=this.getDateTime(y)),this.activeView.renderDates),b=(je(n)||!this.resourceBase||this.activeView.isTimelineView()||(v=this.resourceBase.lastResourceLevel[parseInt(n.toString(),10)].renderDates),this.getIndexOfDate(v,y));if(0<=b){this.activeView.isTimelineView()&&(m=d+b*(v=Math.round((s.getTime()-r.getTime())/a)),f=p+b*v);for(var w,C,S=m;S<f;S++)this.activeView.isTimelineView()?(w=je(n)?0:n,c.push(o.rows[parseInt(w.toString(),10)].cells[parseInt(S.toString(),10)])):je(n)?c.push(o.rows[parseInt(S.toString(),10)].cells[parseInt(b.toString(),10)]):(w="."+JOe+'[data-group-index="'+n+'"]',C=[].slice.call(o.rows[parseInt(S.toString(),10)].querySelectorAll(w)),c.push(C[parseInt(b.toString(),10)]))}}return c},Lje.prototype.getCellDetails=function(e){var t,i,n=e instanceof Array?e:[e],o=H(n[0]),n=H(n.slice(-1)[0]),r=this.getDateFromElement(o),s=this.getDateFromElement(n);if(!je(r)&&!je(s))return t=(i=this.activeView.isTimelineView()&&!je(n.getAttribute("colSpan"))&&0<this.headerRows.length)?parseInt(n.getAttribute("colSpan"),10):1,r={startTime:r,endTime:s=!this.activeViewOptions.timeScale.enable||i||n.classList.contains(YOe)||n.classList.contains(iNe)?yOe(new Date(s.getTime()),t):this.activeView.getEndDateFromStartDate(s),isAllDay:this.isAllDayCell(o),element:e},je(i=o.getAttribute("data-group-index"))||(r.groupIndex=parseInt(i,10)),r},Lje.prototype.getSelectedElements=function(){return this.keyboardInteractionModule&&0<this.keyboardInteractionModule.selectedCells.length?this.keyboardInteractionModule.selectedCells:this.getSelectedCells()},Lje.prototype.getResourceCollections=function(){return this.resourceCollection},Lje.prototype.setResourceCollections=function(e,t){!(t=void 0===t?!0:t)&&this.uiStateValues&&(this.uiStateValues.isPreventEventRefresh=!0),this.setProperties({resources:e},!1)},Lje.prototype.changeCurrentView=function(e,t){var i=this.getViewIndex(e),n=e.charAt(0).toLowerCase()+e.slice(1),n=this.viewOptions[""+n];-1!==(i=n?this.viewCollections.indexOf(n[t||0]):i)&&i!==this.viewIndex&&this.changeView(e,null,null,i)},Lje.prototype.getCurrentViewIndex=function(){return this.viewIndex},Lje.prototype.getResourcesByIndex=function(e){var t,i;return!this.resourceBase||!this.resourceBase.lastResourceLevel||e<0||e>=this.resourceBase.lastResourceLevel.length?void 0:(t=this.resourceBase.lastResourceLevel[parseInt(e.toString(),10)],this.resourceBase.setResourceValues(i={},e),{resource:t.resource,resourceData:t.resourceData,groupData:i})},Lje.prototype.expandResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&1<this.resourceCollection.length&&this.resourceBase.resourceExpand(e,t,!1)},Lje.prototype.collapseResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&1<this.resourceCollection.length&&this.resourceBase.resourceExpand(e,t,!0)},Lje.prototype.scrollTo=function(e,t){this.currentView.indexOf("Agenda")<0&&je(this.element.querySelector(".e-work-cells"))||(this.activeView.scrollToDate&&je(e)&&t?this.activeView.scrollToDate(t):this.activeView.scrollToHour&&this.activeView.scrollToHour(e,t))},Lje.prototype.scrollToResource=function(e,t){this.resourceBase&&this.resourceBase.lastResourceLevel&&this.resourceBase.resourceScroll(e,t)},Lje.prototype.exportToICalendar=function(e,t){if(!this.iCalendarExportModule)throw console.warn('[WARNING] :: Module "ICalendarExport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ICalendarExport module");this.iCalendarExportModule.initializeCalendarExport(e,t)},Lje.prototype.importICalendar=function(e){if(!this.iCalendarImportModule)throw console.warn('[WARNING] :: Module "ICalendarImport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ICalendarImport module");this.iCalendarImportModule.initializeCalendarImport(e)},Lje.prototype.addEvent=function(e){this.crudModule.addEvent(e)},Lje.prototype.generateEventOccurrences=function(e,t){return this.eventBase?this.eventBase.generateOccurrence(e,t):[]},Lje.prototype.exportToExcel=function(e){if(!this.excelExportModule)throw console.warn('[WARNING] :: Module "ExcelExport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ExcelExport module");this.excelExportModule.initializeExcelExport(e)},Lje.prototype.print=function(e){if(!this.printModule)throw console.warn('[WARNING] :: Module "Print" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject Print module");this.printModule.print(e)},Lje.prototype.saveEvent=function(e,t){this.crudModule.saveEvent(e,t)},Lje.prototype.deleteEvent=function(e,t){this.crudModule.deleteEvent(e,t)},Lje.prototype.getEvents=function(e,t,i){var n=[],n=i?this.eventBase.getProcessedEvents():this.eventsData;return e=e&&this.getDateTime(e),t=t&&this.getDateTime(t),n=this.eventBase.filterEventsByRange(n,e,t)},Lje.prototype.getBlockEvents=function(e,t,i){var n=[],n=i?this.eventBase.getProcessedEvents(this.blockData):this.blockData;return e=e&&this.getDateTime(e),t=t&&this.getDateTime(t),n=this.eventBase.filterEventsByRange(n,e,t)},Lje.prototype.getOccurrencesByID=function(e){return this.eventBase.getOccurrencesByID(e)},Lje.prototype.getOccurrencesByRange=function(e,t){return e=this.getDateTime(e),t=this.getDateTime(t),this.eventBase.getOccurrencesByRange(e,t)},Lje.prototype.getCurrentViewDates=function(){return this.activeView?this.activeView.renderDates:[]},Lje.prototype.setRecurrenceEditor=function(e){this.eventWindow.setRecurrenceEditor(e)},Lje.prototype.getEventMaxID=function(){return this.eventBase.getEventMaxID()},Lje.prototype.getDeletedOccurrences=function(e){return this.eventBase.getDeletedOccurrences(e)},Lje.prototype.getCurrentViewEvents=function(){return this.eventsProcessed},Lje.prototype.refreshEvents=function(e){(e=void 0===e?!0:e)?(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",q([this.element],b2e)),this.crudModule.refreshDataManager()):(this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!0),this.crudModule&&this.crudModule.refreshProcessedData(),this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!1))},Lje.prototype.refreshTemplates=function(e){switch(e?this.resetTemplates([e]):this.resetTemplates(),e){case"eventTemplate":this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),this.refreshEvents(!1);break;case"dateHeaderTemplate":this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),this.activeView.refreshHeader();break;case"dateRangeTemplate":this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.headerModule&&this.headerModule.refresh();break;case"resourceHeaderTemplate":this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),this.activeView.isTimelineView()?this.activeView.refreshResourceHeader():this.activeView.refreshHeader();break;case"quickInfoTemplates":this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.quickPopup=new _He(this),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer);break;case"editorTemplate":this.destroyEditorWindow(),this.editorTemplateFn=this.templateParser(this.editorTemplate);break;case"editorHeaderTemplate":this.destroyEditorWindow(),this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate);break;case"editorFooterTemplate":this.destroyEditorWindow(),this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate);break;case"tooltipTemplate":case"headerTooltipTemplate":this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.eventTooltip=new zHe(this),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate);break;default:this.initializeView(this.currentView)}},Lje.prototype.refreshLayout=function(){this.onScheduleResize(),this.headerModule&&this.headerModule.refresh(),this.eventWindow&&this.eventWindow.refresh()},Lje.prototype.getEventDetails=function(e){e=(e=H(e)).getAttribute("data-guid");return e?this.eventBase.getEventByGuid(e):{}},Lje.prototype.isSlotAvailable=function(e,t,i){var n,o,r=this,s=this.activeEventData.event;return e instanceof Date||"string"==typeof e?(n=e,o=t):(n=(s=e)[this.eventFields.startTime],o=e[this.eventFields.endTime],this.resourceBase&&(i=this.eventBase.getGroupIndexFromEvent(e))),!(!je(n)&&!je(o)&&(n=this.getDateTime(n),o=this.getDateTime(o),t=this.eventBase.filterEvents(n,o),!je(i)&&this.resourceBase&&0<this.resourceBase.lastResourceLevel.length&&(t=this.eventBase.filterEventsByResource(this.resourceBase.lastResourceLevel[parseInt(i.toString(),10)],t)),0<(t=s?s.Guid?t.filter(function(e){return e.Guid!==s.Guid}):t.filter(function(e){return e[r.eventFields.id]!==s[r.eventFields.id]}):t).length))},Lje.prototype.copy=function(e){this.processCutCopyActions(e,!1)},Lje.prototype.cut=function(e){this.processCutCopyActions(e,!0)},Lje.prototype.paste=function(t){var i,n=this;this.allowClipboard&&this.allowKeyboardInteraction&&(t.classList.contains("e-work-cells")||t.classList.contains("e-all-day-cells"))&&(i=new DataTransfer,je(navigator.clipboard)||navigator.clipboard.readText().then(function(e){i.setData("text/plain",e);e=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0});Object.defineProperty(e,"clipboardData",{value:i}),n.keyboardInteractionModule.pasteHandler(e,t)}).catch(function(e){throw e}))},Lje.prototype.processCutCopyActions=function(e,t){var i,n=this;e&&this.allowClipboard&&this.allowKeyboardInteraction&&(i=[],e.forEach(function(e){e.classList.contains(qNe)&&(e=n.getEventDetails(e))&&i.push(e)}),0<i.length)&&this.keyboardInteractionModule.processClipboardAction(t,i)},Lje.prototype.openEditor=function(e,t,i,n){"Add"!==t||i?(e[this.eventFields.startTime]=this.getDateTime(e[this.eventFields.startTime]),e[this.eventFields.endTime]=this.getDateTime(e[this.eventFields.endTime])):(e.startTime=this.getDateTime(e.startTime),e.endTime=this.getDateTime(e.endTime),je(e.element)||(e.element=H(e.element))),"Add"!==(this.currentAction=t)&&(this.activeEventData.event=e),this.eventWindow.openEditor(e,t,i,n)},Lje.prototype.closeEditor=function(){this.eventWindow&&this.eventWindow.dialogClose()},Lje.prototype.openQuickInfoPopup=function(t){var e,i,n,o=this;"Year"===this.currentView||je(t)||(je(t[this.eventFields.id])?"Agenda"===this.currentView||"MonthAgenda"===this.currentView||je(this.activeView)||(i={startTime:this.activeCellsData.startTime=this.getDateTime(t[this.eventFields.startTime]),endTime:this.activeCellsData.endTime=this.getDateTime(t[this.eventFields.endTime]),isAllDay:this.activeCellsData.isAllDay=!je(t[this.eventFields.isAllDay])&&t[this.eventFields.isAllDay]},(e=this.activeView.getAdjustedDate(new Date(i.startTime)))&&(n="."+JOe+'[data-date="'+e.getTime()+'"]',0<this.activeViewOptions.group.resources.length&&!this.uiStateValues.isGroupAdaptive&&this.resourceBase&&this.eventBase&&(i.groupIndex=this.eventBase.getGroupIndexFromEvent(t),n="."+JOe+'[data-date="'+e.getTime()+'"][data-group-index="'+i.groupIndex+'"]'),e=this.element.querySelector(n))&&(e.focus(),i.element=e,this.notify(fRe,i))):(n=this.getCurrentViewEvents().filter(function(e){return t[o.eventFields.id]===e[o.eventFields.id]})).length<=0||(e=n[0],t[this.eventFields.recurrenceRule]&&0<(i=n.filter(function(e){return e[o.eventFields.startTime].getTime()===t[o.eventFields.startTime].getTime()})).length&&(e=i[0]),(n=this.element.querySelector('div[data-guid="'+e.Guid+'"]'))&&(this.eventBase.removeSelectedAppointmentClass(),this.eventBase.addSelectedAppointments([n],!1),this.activeEventData={event:e,element:n},"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView||U([this.activeEventData.element],s2e),this.notify(IRe,this.activeEventData))))},Lje.prototype.closeQuickInfoPopup=function(){this.quickPopup&&this.quickPopup.quickPopupHide(!0)},Lje.prototype.openOverlapAlert=function(t){var e,i=this;this.quickPopup&&(e={type:"OverlapAlert",cancel:!1,element:this.quickPopup.quickDialog.element,data:t.data,overlapEvents:t.overlapEvents},this.trigger(MRe,e,function(e){e.cancel||i.quickPopup.openValidationError("overlapAlert",t.data)}))},Lje.prototype.closeOverlapAlert=function(){var e,t=this;this.quickPopup&&(e={type:"OverlapAlert",cancel:!1,data:this.activeEventData.event,element:this.quickPopup.quickDialog.element},this.trigger(kRe,e,function(e){e.cancel||t.quickPopup.quickDialog.hide()}))},Lje.prototype.closeTooltip=function(){this.eventTooltip&&this.eventTooltip.close()},Lje.prototype.getDateRangeText=function(e){return je(e)&&0===e.length||!this.activeView?"":this.activeView.getDateRangeText(e[0],e)},Lje.prototype.getViewDates=function(e){if(!this.activeView)return[];switch(e=void 0===e?"Current":e){case"Previous":case"Next":return this.activeView.getRenderDates(void 0,this.activeView.getNextPreviousDate(e));case"Current":return this.getCurrentViewDates()}},Lje.prototype.selectResourceByIndex=function(e){this.resourceBase&&this.uiStateValues.isGroupAdaptive&&this.resourceBase.selectResourceByIndex(e)},Lje.prototype.getIndexFromResourceId=function(e,t){return this.resourceBase?this.resourceBase.getIndexFromResourceId(e,t):null},Lje.prototype.addResource=function(e,t,i){this.resourceBase.addResource(e,t,i)},Lje.prototype.removeResource=function(e,t){this.resourceBase.removeResource(e,t)},Lje.prototype.destroy=function(){this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.destroyPopups(),this.hideSpinner(),this.unWireEvents(),this.destroyHeaderModule(),this.eventBase&&(this.eventBase.destroy(),this.eventBase=null),this.workCellAction&&(this.workCellAction.destroy(),this.workCellAction=null),this.inlineModule&&(this.inlineModule.destroy(),this.inlineModule=null),this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null),this.printModule&&this.printModule.destroy(),this.activeView&&(this.resetTemplates(),this.activeView.removeEventListener(),this.activeView.destroy(),this.activeView=null),this.scheduleTouchModule&&(this.scheduleTouchModule.destroy(),this.scheduleTouchModule=null),this.crudModule&&(this.crudModule.destroy(),this.crudModule=null),this.dataModule&&(this.dataModule.destroy(),this.dataModule=null),Bje.prototype.destroy.call(this);for(var e=0,t=["dayModule","weekModule","workWeekModule","monthModule","monthAgendaModule","yearModule","agendaModule","timelineViewsModule","timelineMonthModule","timelineYearModule","resizeModule","dragAndDropModule","excelExportModule","printModule","iCalendarExportModule","iCalendarImportModule","tzModule","eventsData","eventsProcessed","blockData","blockProcessed","uiStateValues","viewCollections","viewOptions","defaultLocale","localeObj","selectedElements","resourceCollection","editorTitles","eventFields","activeViewOptions","activeEventData","activeCellsData","renderModule"];e<t.length;e++)this[""+t[e]]=null;kOe(this.element);var i=[_Oe,"e-rtl",HOe,jOe];this.cssClass&&(i=i.concat(this.cssClass.split(" "))),q([this.element],i)},Ode([e("auto")],Lje.prototype,"width",void 0),Ode([e("auto")],Lje.prototype,"height",void 0),Ode([e(!0)],Lje.prototype,"showHeaderBar",void 0),Ode([e(!0)],Lje.prototype,"showTimeIndicator",void 0),Ode([e(!0)],Lje.prototype,"allowSwiping",void 0),Ode([e(!0)],Lje.prototype,"allowOverlap",void 0),Ode([e(3)],Lje.prototype,"overscanCount",void 0),Ode([kt([],wce)],Lje.prototype,"toolbarItems",void 0),Ode([e("Week")],Lje.prototype,"currentView",void 0),Ode([e(["Day","Week","WorkWeek","Month","Agenda"])],Lje.prototype,"views",void 0),Ode([e(new Date)],Lje.prototype,"selectedDate",void 0),Ode([e(new Date(1900,0,1))],Lje.prototype,"minDate",void 0),Ode([e(new Date(2099,11,31))],Lje.prototype,"maxDate",void 0),Ode([e()],Lje.prototype,"dateFormat",void 0),Ode([e("Gregorian")],Lje.prototype,"calendarMode",void 0),Ode([e(!0)],Lje.prototype,"showWeekend",void 0),Ode([e(0)],Lje.prototype,"firstDayOfWeek",void 0),Ode([e("FirstDay")],Lje.prototype,"weekRule",void 0),Ode([e([1,2,3,4,5])],Lje.prototype,"workDays",void 0),Ode([e(12)],Lje.prototype,"monthsCount",void 0),Ode([e("00:00")],Lje.prototype,"startHour",void 0),Ode([e("24:00")],Lje.prototype,"endHour",void 0),Ode([e(null)],Lje.prototype,"timeFormat",void 0),Ode([e(!0)],Lje.prototype,"enableHtmlSanitizer",void 0),Ode([e(!1)],Lje.prototype,"enableAllDayScroll",void 0),Ode([e(!1)],Lje.prototype,"enableAdaptiveUI",void 0),Ode([e(!0)],Lje.prototype,"allowResizing",void 0),Ode([t({},mJ)],Lje.prototype,"workHours",void 0),Ode([t({},d$)],Lje.prototype,"timeScale",void 0),Ode([e(!0)],Lje.prototype,"allowKeyboardInteraction",void 0),Ode([e(!0)],Lje.prototype,"allowDragAndDrop",void 0),Ode([e()],Lje.prototype,"dateHeaderTemplate",void 0),Ode([e()],Lje.prototype,"dateRangeTemplate",void 0),Ode([e()],Lje.prototype,"cellHeaderTemplate",void 0),Ode([e()],Lje.prototype,"dayHeaderTemplate",void 0),Ode([e()],Lje.prototype,"monthHeaderTemplate",void 0),Ode([e()],Lje.prototype,"cellTemplate",void 0),Ode([e(!1)],Lje.prototype,"readonly",void 0),Ode([e(!0)],Lje.prototype,"showQuickInfo",void 0),Ode([e(!1)],Lje.prototype,"allowInline",void 0),Ode([e(!0)],Lje.prototype,"allowMultiCellSelection",void 0),Ode([e(!0)],Lje.prototype,"allowMultiRowSelection",void 0),Ode([e(!1)],Lje.prototype,"quickInfoOnSelectionEnd",void 0),Ode([e(!1)],Lje.prototype,"showWeekNumber",void 0),Ode([e(!1)],Lje.prototype,"rowAutoHeight",void 0),Ode([e(!1)],Lje.prototype,"allowMultiDrag",void 0),Ode([e(0)],Lje.prototype,"firstMonthOfYear",void 0),Ode([e()],Lje.prototype,"editorTemplate",void 0),Ode([e()],Lje.prototype,"editorHeaderTemplate",void 0),Ode([e()],Lje.prototype,"editorFooterTemplate",void 0),Ode([t({},k$)],Lje.prototype,"quickInfoTemplates",void 0),Ode([e(7)],Lje.prototype,"agendaDaysCount",void 0),Ode([e(!0)],Lje.prototype,"hideEmptyAgendaDays",void 0),Ode([e(!0)],Lje.prototype,"enableRecurrenceValidation",void 0),Ode([e()],Lje.prototype,"timezone",void 0),Ode([t({},Oee)],Lje.prototype,"eventSettings",void 0),Ode([e(B_e)],Lje.prototype,"timezoneDataSource",void 0),Ode([e()],Lje.prototype,"resourceHeaderTemplate",void 0),Ode([e()],Lje.prototype,"headerIndentTemplate",void 0),Ode([t({},jee)],Lje.prototype,"group",void 0),Ode([kt([],nte)],Lje.prototype,"resources",void 0),Ode([kt([],z$)],Lje.prototype,"headerRows",void 0),Ode([e()],Lje.prototype,"cssClass",void 0),Ode([e(!1)],Lje.prototype,"allowClipboard",void 0),Ode([e()],Lje.prototype,"eventDragArea",void 0),Ode([i()],Lje.prototype,"created",void 0),Ode([i()],Lje.prototype,"destroyed",void 0),Ode([i()],Lje.prototype,"cellClick",void 0),Ode([i()],Lje.prototype,"cellDoubleClick",void 0),Ode([i()],Lje.prototype,"moreEventsClick",void 0),Ode([i()],Lje.prototype,"hover",void 0),Ode([i()],Lje.prototype,"select",void 0),Ode([i()],Lje.prototype,"actionBegin",void 0),Ode([i()],Lje.prototype,"actionComplete",void 0),Ode([i()],Lje.prototype,"actionFailure",void 0),Ode([i()],Lje.prototype,"navigating",void 0),Ode([i()],Lje.prototype,"renderCell",void 0),Ode([i()],Lje.prototype,"eventClick",void 0),Ode([i()],Lje.prototype,"eventDoubleClick",void 0),Ode([i()],Lje.prototype,"eventRendered",void 0),Ode([i()],Lje.prototype,"dataBinding",void 0),Ode([i()],Lje.prototype,"popupOpen",void 0),Ode([i()],Lje.prototype,"popupClose",void 0),Ode([i()],Lje.prototype,"dragStart",void 0),Ode([i()],Lje.prototype,"drag",void 0),Ode([i()],Lje.prototype,"dragStop",void 0),Ode([i()],Lje.prototype,"resizeStart",void 0),Ode([i()],Lje.prototype,"resizing",void 0),Ode([i()],Lje.prototype,"resizeStop",void 0),Ode([i()],Lje.prototype,"virtualScrollStart",void 0),Ode([i()],Lje.prototype,"virtualScrollStop",void 0),Ode([i()],Lje.prototype,"dataBound",void 0),Ode([i()],Lje.prototype,"beforePaste",void 0),Ode([i()],Lje.prototype,"beforePrint",void 0),Ode([i()],Lje.prototype,"excelExport",void 0),Ode([i()],Lje.prototype,"tooltipOpen",void 0),Ode([Bt],Lje));function Lje(e,t){e=Bje.call(this,e,t)||this;return e.adaptiveGroupIndex=0,e}Rje.prototype.getChangedData=function(e){var t,i,n,o=this,r=Pe({},this.actionObj.event,null,!0);return r[this.parent.eventFields.startTime]=this.actionObj.start,r[this.parent.eventFields.endTime]=this.actionObj.end,je(this.actionObj.isAllDay)||(r[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay),0<this.parent.activeViewOptions.group.resources.length&&(t=this.getOriginalElement(this.actionObj.element))&&(-1===(n=t.map(function(e){return parseInt(e.getAttribute("data-group-index"),10)})).indexOf(this.actionObj.groupIndex)||!je(e)&&0<e.length)&&(i=parseInt(this.actionObj.clone.getAttribute("data-group-index"),10),(n=n.filter(function(e){return e!==i})).push(this.actionObj.groupIndex),e&&0<e.length?e.forEach(function(e){o.parent.resourceBase.getResourceData(e,o.actionObj.groupIndex,n)}):this.parent.resourceBase.getResourceData(r,this.actionObj.groupIndex,n)),r},Rje.prototype.saveChangedData=function(e,t){void 0===t&&(t=!1),this.parent.activeEventData.event=this.actionObj.event,this.parent.currentAction="Save";for(var i,n=[e.data],o=0,r=n=t?e.selectedData:n;o<r.length;o++){var s=r[o],a=!(0<this.parent.activeViewOptions.group.resources.length)||parseInt(this.actionObj.element.getAttribute("data-group-index"),10)===this.actionObj.groupIndex;if(+s[this.parent.eventFields.startTime]==+this.actionObj.event[this.parent.eventFields.startTime]&&+s[this.parent.eventFields.endTime]==+this.actionObj.event[this.parent.eventFields.endTime]&&a)return void(this.parent.crudModule.crudObj.isCrudAction=!1);if(s[this.parent.eventFields.recurrenceRule]){a=s[this.parent.eventFields.recurrenceID]||s[this.parent.eventFields.id];if(s[this.parent.eventFields.id]===s[this.parent.eventFields.recurrenceID]&&(s[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),i="EditOccurrence"),this.parent.enableRecurrenceValidation&&this.parent.eventWindow.editOccurrenceValidation(a,s,this.actionObj.event))return}else i=null;(s[this.parent.eventFields.startTimezone]||s[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(s),this.parent.crudModule.saveEvent(s,i)}},Rje.prototype.calculateIntervalTime=function(e){var t=gOe(e).getTime(),i=this.parent.activeView.getStartHour(),n=6e4*this.actionObj.interval,t=(t+=6e4*(60*i.getHours()+i.getMinutes())+1e3*i.getSeconds())+Math.floor((e.getTime()-t)/n)*n;return new Date(t)},Rje.prototype.getContentAreaDimension=function(){var e=this.parent.element.querySelector("."+i2e),t=[].slice.call(e.querySelector("tr").children),i=(t=this.parent.activeView.isTimelineView()||!(0<this.parent.activeViewOptions.group.resources.length)||this.parent.isAdaptive||this.parent.enableAdaptiveUI||this.parent.virtualScrollModule?t:this.getResourceElements(t))[0].getBoundingClientRect(),t=t.slice(-1)[0].getBoundingClientRect();return{bottom:e.scrollHeight-5,left:(this.parent.enableRtl?t:i).left,right:(this.parent.enableRtl?i:t).right,top:0,leftOffset:(this.parent.enableRtl?t:i).right,rightOffset:(this.parent.enableRtl?i:t).left}},Rje.prototype.getIndex=function(e){var t=[].slice.call(this.parent.getContentTable().querySelector("tr").children),i={minIndex:0,maxIndex:t.length-1};return"resize"===this.actionObj.action&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&!this.parent.activeView.isTimelineView()&&(t=this.getResourceElements(t),i.minIndex=t[0].cellIndex,i.maxIndex=t.slice(-1)[0].cellIndex),e=i.maxIndex<(e=e<i.minIndex?i.minIndex:e)?i.maxIndex:e},Rje.prototype.updateTimePosition=function(e,t){for(var i,n,o=0,r=0,s=this.actionObj.cloneElement;r<s.length;r++){var a,l,h=s[r].querySelector("."+$Ne);h&&(a=this.actionObj.start,l=this.actionObj.end,t&&0<t.length&&(a=t[parseInt(o.toString(),10)][this.parent.eventFields.startTime],l=t[parseInt(o.toString(),10)][this.parent.eventFields.endTime]),h.innerHTML=this.parent.getTimeString(a)+" - "+this.parent.getTimeString(l)),o++}this.parent.activeViewOptions.timeScale.enable&&this.parent.isAdaptive&&"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView&&((i=this.parent.element.querySelector("."+S2e))||(i=Q("div",{className:S2e}),n=this.parent.activeView.isTimelineView()?eNe:xNe,this.parent.element.querySelector("."+n).appendChild(i)),i.innerHTML=this.parent.getTimeString(e),n=0,this.parent.activeView.isTimelineView()?this.parent.enableRtl?(e=parseInt(this.actionObj.clone.style.right,10),n="drag"===this.actionObj.action||this.resizeEdges.left?e+this.actionObj.clone.offsetWidth:e,i.style.right=T(n)):(e=parseInt(this.actionObj.clone.style.left,10),n="drag"===this.actionObj.action||this.resizeEdges.left?e:e+this.actionObj.clone.offsetWidth,i.style.left=T(n)):(n="drag"===this.actionObj.action||this.resizeEdges.top?this.actionObj.clone.offsetTop:this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight,i.style.top=T(n)))},Rje.prototype.getResourceElements=function(e){var t=this;return e.filter(function(e){return parseInt(e.getAttribute("data-group-index"),10)===t.actionObj.groupIndex})},Rje.prototype.getOriginalElement=function(e){var t,i=e.getAttribute("data-guid");return e.offsetParent&&e.offsetParent.classList.contains($2e)||this.parent.activeView.isTimelineView()||"resize"!==this.actionObj.action&&this.parent.virtualScrollModule?t=[].slice.call(this.parent.element.querySelectorAll('[data-guid="'+i+'"]')):(e=z(e,"tr"))&&(t=[].slice.call(e.querySelectorAll('[data-guid="'+i+'"]'))),t},Rje.prototype.createCloneElement=function(e){var t=document.createElement("div"),t=(t.appendChild(e.cloneNode(!0)),t.children[0]),i=[C2e],i=(i.push("drag"===this.actionObj.action?A2e:I2e),"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView||i.push("e-month-event"),U([t],i),U([e],b2e),je(e.parentElement)||e.parentElement.appendChild(t),t.style.width=T(t.offsetWidth-2),document.querySelector(this.parent.eventDragArea));return this.parent.eventDragArea&&"drag"===this.actionObj.action&&i&&i.appendChild(t),gt(t,{border:"0px"}),t},Rje.prototype.removeCloneElementClasses=function(){var e=this.actionObj.originalElement;q(e="Month"!==this.parent.currentView&&"TimelineYear"!==this.parent.currentView&&"Day"!==this.parent.currentView&&"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView?e:[].slice.call(this.parent.element.querySelectorAll("."+b2e)),b2e)},Rje.prototype.removeCloneElement=function(){this.actionObj.originalElement=[];for(var e=0,t=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));e<t.length;e++)ue(t[e]);for(var i=0,n=this.actionObj.cloneElement;i<n.length;i++){var o=n[i];je(o.parentNode)||ue(o)}this.actionObj.cloneElement=[];var r=this.parent.element.querySelector("."+S2e);r&&ue(r)},Rje.prototype.getCursorElement=function(e){e=this.parent.eventBase.getPageCoordinates(e);return document.elementFromPoint(e.clientX,e.clientY)},Rje.prototype.autoScroll=function(){var e,t=this.parent.element.querySelector("."+i2e),i=t.offsetHeight<=t.scrollHeight,n=t.offsetWidth<=t.scrollWidth,i=i&&0<=t.scrollTop&&t.scrollTop+t.offsetHeight<=t.scrollHeight,n=n&&0<=t.scrollLeft&&t.scrollLeft+t.offsetWidth<=t.scrollWidth;"resize"===this.actionObj.action&&this.scrollEdges.right&&t.scrollLeft+t.offsetWidth>t.scrollWidth&&(e=[].slice.call(this.parent.getContentTable().querySelector("tr").children).length-1,n=Math.ceil((this.actionObj.clone.offsetLeft+this.actionObj.clone.offsetWidth)/this.actionObj.cellWidth)===e),i&&(this.scrollEdges.top||this.scrollEdges.bottom)&&(t.scrollTop+=this.scrollEdges.top?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action)&&t.scrollHeight!==t.offsetHeight+t.scrollTop&&0<t.scrollTop&&(this.actionObj.Y+=this.scrollEdges.top?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy),n&&(this.scrollEdges.left||this.scrollEdges.right)&&(t.scrollLeft+=this.scrollEdges.left?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action)&&t.scrollWidth!==t.offsetWidth+t.scrollLeft&&0<t.scrollLeft&&(this.actionObj.X+=this.scrollEdges.left?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy)},Rje.prototype.autoScrollValidation=function(){var e;return!!this.actionObj.scroll.enable&&(e=this.parent.boundaryValidation(this.actionObj.pageY,this.actionObj.pageX),(this.scrollEdges=e).bottom||e.top||e.left||e.right)},Rje.prototype.actionClass=function(e){("addClass"===e?U:q)([this.parent.element],b2e)},Rje.prototype.updateScrollPosition=function(e){var t=this;this.scrollEventArgs=e,this.actionObj.scroll.enable&&je(this.actionObj.scrollInterval)&&(this.actionObj.scrollInterval=window.setInterval(function(){!t.autoScrollValidation()||t.actionObj.clone.classList.contains(L2e)||t.parent.activeView.isTimelineView()&&0<t.parent.activeViewOptions.group.resources.length&&t.actionObj.groupIndex<0||(t.autoScroll(),"drag"===t.actionObj.action?t.parent.dragAndDropModule.updateDraggingDateTime(t.scrollEventArgs):t.parent.resizeModule.updateResizingDirection(t.scrollEventArgs))},this.actionObj.scroll.timeDelay))},Rje.prototype.updateOriginalElement=function(e){var t='[data-id="'+e.getAttribute("data-id")+'"]';0<this.parent.activeViewOptions.group.resources.length&&(t=t.concat('[data-group-index = "'+e.getAttribute("data-group-index")+'"]')),U([].slice.call(this.parent.element.querySelectorAll(t)),b2e),q([].slice.call(this.parent.element.querySelectorAll("."+C2e)),b2e)},Rje.prototype.getUpdatedEvent=function(e,t,i){i=JSON.parse(JSON.stringify(i));return i[this.parent.eventFields.startTime]=e,i[this.parent.eventFields.endTime]=t,i},Rje.prototype.dynamicYearlyEventsRendering=function(e,t){var i,n,o;void 0===t&&(t=!1),je(this.parent.eventDragArea)&&(n=this.actionObj.cellWidth-7,t&&(this.resizeEdges.left||this.resizeEdges.right)&&(n=this.actionObj.cellWidth*e.count),t||"Horizontal"!==this.parent.activeViewOptions.orientation||0!==this.parent.activeViewOptions.group.resources.length||((i=this.yearEvent.isSpannedEvent(e,e[this.parent.eventFields.startTime]))[this.parent.eventFields.startTime].getTime()===i[this.parent.eventFields.endTime].getTime()&&(i.isSpanned.count=1),n=i.isSpanned.count*this.actionObj.cellWidth),t||"Vertical"!==this.parent.activeViewOptions.orientation||0===this.parent.activeViewOptions.group.resources.length||(n=(i=this.yearEvent.isSpannedEvent(e,e[this.parent.eventFields.startTime])).isSpanned.count*this.actionObj.cellWidth),(i=this.createAppointmentElement(this.actionObj.groupIndex,e[this.parent.eventFields.subject])).setAttribute("drag","true"),U([i],C2e),gt(i,{width:n+"px",border:"0px","pointer-events":"none",position:"absolute",overflow:"hidden",padding:"3px"}),""!==this.actionObj.clone.style.backgroundColor&&gt(i,{backgroundColor:this.actionObj.clone.style.backgroundColor}),n=gOe(e[this.parent.eventFields.startTime]).getTime(),o="."+JOe+'[data-date="'+n+'"]',0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(o="."+JOe+'[data-date="'+n+'"][data-group-index="'+this.actionObj.groupIndex+'"]'),je(n=this.parent.element.querySelector(o))||(t&&(o=n.querySelector("."+p2e),t=this.actionObj.cellHeight*e.count-(o?o.offsetHeight:0)-7,gt(i,{height:(t=this.resizeEdges.right||this.resizeEdges.left?parseInt(this.actionObj.clone.style.height,10):t)+"px"})),this.renderDynamicElement(n,i,!0),this.actionObj.cloneElement.push(i)))},Rje.prototype.renderDynamicElement=function(e,t,i){var n;e.querySelector("."+LNe)?e.querySelector("."+LNe).appendChild(t):((n=Q("div",{className:LNe})).appendChild(t),e.appendChild(n))},Rje.prototype.createAppointmentElement=function(e,t){t=Q("div",{className:qNe,innerHTML:t});return 0<this.parent.activeViewOptions.group.resources.length&&t.setAttribute("data-group-index",e.toString()),t},Rje.prototype.dynamicEventsRendering=function(e){var t=this;if(je(this.parent.eventDragArea)){var i,n,o,r=this.parent.activeView.renderDates,s=[].slice.call(this.parent.element.querySelectorAll("."+JOe)),a=this.parent.activeViewOptions.workDays;if(0<this.parent.activeViewOptions.group.resources.length&&(r=(i=(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.isHorizontalScroll?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel).filter(function(e){return e.groupIndex===t.actionObj.groupIndex}))[0].renderDates,n="."+JOe+'[data-group-index="'+this.actionObj.groupIndex+'"]',s=[].slice.call(this.parent.element.querySelectorAll(n)),a=i[0].workDays,o=i[0].groupOrder),this.monthEvent.dateRender=r,this.monthEvent.getSlotDates(a),this.resizeEdges.left||this.resizeEdges.right)for(var l=0,h=[].slice.call(this.parent.element.querySelectorAll("."+C2e));l<h.length;l++)ue(h[l]);for(var d=0,p=this.monthEvent.splitEvent(e,r);d<p.length;d++){var c=p[d],u=this.parent.getIndexOfDate(r,gOe(c[this.monthEvent.fields.startTime])),g=c.data.count*this.actionObj.cellWidth-7,m=this.monthEvent.createAppointmentElement(c,this.actionObj.groupIndex,!0),c=(m.setAttribute("drag","true"),U([m],C2e),this.monthEvent.applyResourceColor(m,c,"backgroundColor",o),gt(m,{width:g+"px",border:"0px","pointer-events":"none"}),s[parseInt(u.toString(),10)]);c&&(this.monthEvent.renderElement(c,m,!0),this.actionObj.cloneElement.push(m))}}},Rje.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.actionObj={},this.scrollArgs={},this.resizeEdges={left:!1,right:!1,top:!1,bottom:!1},this.scrollEdges={left:!1,right:!1,top:!1,bottom:!1})};gRe=Rje;function Rje(e){this.daysVariation=0,this.parent=e,this.actionObj={X:0,Y:0,groupIndex:0,cellWidth:0,cellHeight:0,slotInterval:0,interval:0,actionIndex:0,cloneElement:[],originalElement:[],action:null,isAllDay:null,excludeSelectors:null,index:0,navigationInterval:null,scrollInterval:null},this.scrollArgs={element:null,width:0,height:0},this.resizeEdges={left:!1,right:!1,top:!1,bottom:!1},this.scrollEdges={left:!1,right:!1,top:!1,bottom:!1}}Oje=function(e,t){return(Oje=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Oje(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Vje,Nje=gRe),Vje.prototype.wireResizeEvent=function(e){for(var t=0,i=[].slice.call(e.querySelectorAll("."+x2e));t<i.length;t++){var n=i[t];E.add(n,F.touchStartEvent,this.resizeStart,this)}},Vje.prototype.resizeHelper=function(){if(0<this.parent.activeViewOptions.group.resources.length&&this.parent.activeViewOptions.group.allowGroupEdit)for(var e=0,t=this.actionObj.originalElement.length;e<t;e++){var i=this.createCloneElement(this.actionObj.originalElement[parseInt(e.toString(),10)]);this.actionObj.cloneElement[parseInt(e.toString(),10)]=i,this.actionObj.element===this.actionObj.originalElement[parseInt(e.toString(),10)]&&(this.actionObj.clone=i)}else this.actionObj.element&&(this.actionObj.clone=this.createCloneElement(this.actionObj.element)),this.actionObj.cloneElement=[this.actionObj.clone],this.actionObj.originalElement=[this.actionObj.element]},Vje.prototype.resizeStart=function(s){var a,l,e,h=this;(!s||"touchstart"!==s.type||this.parent.uiStateValues.isTapHold&&z(s.target,"."+XNe))&&(this.parent.eventBase.removeSelectedAppointmentClass(),this.actionObj.action="resize",this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval,a=z(s.target,"."+x2e),this.actionObj.element=z(a,"."+qNe),this.actionObj.event=this.parent.eventBase.getEventByGuid(this.actionObj.element.getAttribute("data-guid")),e={cancel:!1,data:l=Pe({},this.actionObj.event,null,!0),element:this.actionObj.element,event:s,interval:this.actionObj.interval,scroll:{enable:!0,scrollBy:30,timeDelay:100}},this.parent.trigger(PRe,e,function(e){if(!e.cancel){h.actionClass("addClass"),h.parent.uiStateValues.action=!0,h.resizeEdges={left:a.classList.contains(T2e),right:a.classList.contains(E2e),top:a.classList.contains(D2e),bottom:a.classList.contains(M2e)},h.actionObj.groupIndex=h.parent.uiStateValues.isGroupAdaptive?h.parent.uiStateValues.groupIndex:0;var t=h.parent.element.querySelector("."+JOe),t=(h.actionObj.cellWidth=h.parent.getElementWidth(t),h.actionObj.cellHeight=h.parent.getElementHeight(t),h.parent.activeViewOptions.headerRows.map(function(e){return e.option}));if(h.parent.activeView.isTimelineView()&&0<t.length&&["Date","Hour"].indexOf(t.slice(-1)[0])<0){for(var t=h.parent.getContentTable().querySelector("tr"),i=0,n=0,o=[].slice.call(t.children);n<o.length;n++){var r=o[n];i+=parseInt(r.getAttribute("colspan"),10)}t=t.getBoundingClientRect();h.actionObj.cellWidth=t.width/i,h.actionObj.cellHeight=t.height}t=h.parent.eventBase.getPageCoordinates(s),t=(h.actionObj.X=t.pageX,h.actionObj.Y=t.pageY,h.actionObj.groupIndex=parseInt(h.actionObj.element.getAttribute("data-group-index")||"0",10),h.actionObj.interval=e.interval,h.actionObj.scroll=e.scroll,h.actionObj.start=new Date(l[h.parent.eventFields.startTime].getTime()),h.actionObj.end=new Date(l[h.parent.eventFields.endTime].getTime()),h.actionObj.originalElement=h.getOriginalElement(h.actionObj.element),"Month"===h.parent.currentView&&(h.daysVariation=-1,h.monthEvent=new MHe(h.parent)),h.parent.element.querySelector("."+i2e));h.scrollArgs={element:t,width:t.scrollWidth,height:t.scrollHeight},["Month","TimelineYear"].indexOf(h.parent.currentView)<0&&(e=Math.round(h.scrollArgs.width/h.actionObj.cellWidth)*h.actionObj.cellWidth,h.scrollArgs.width=h.scrollArgs.width<e?e:h.scrollArgs.width),E.add(document,F.touchMoveEvent,h.resizing,h),E.add(document,F.touchEndEvent,h.resizeStop,h)}}))},Vje.prototype.resizing=function(e){var t,i,n;e&&"touchmove"===e.type&&e.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),0===this.parent.element.querySelectorAll("."+I2e).length&&this.resizeHelper(),!je(e.target)&&e.target.classList.contains(qVe)||(t=this.parent.eventBase.getPageCoordinates(e),"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView?(i=document.documentElement,n=(window.pageXOffset||i.scrollLeft)-(i.clientLeft||0),i=(window.pageYOffset||i.scrollTop)-(i.clientTop||0),this.actionObj.pageX=t.pageX-n,this.actionObj.pageY=t.pageY-i):(this.actionObj.pageX=t.pageX,this.actionObj.pageY=t.pageY),this.updateScrollPosition(e),this.updateResizingDirection(e),n={cancel:!1,data:Pe({},this.actionObj.event,null,!0),element:this.actionObj.element,event:e,startTime:this.actionObj.start,endTime:this.actionObj.end},0<this.parent.group.resources.length&&(n.groupIndex=this.actionObj.groupIndex),this.parent.trigger("resizing",n))},Vje.prototype.updateResizingDirection=function(e){if("Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView)this.monthResizing();else{var t=this.resizeValidation(e);if(this.resizeEdges.left){if(t){var i=this.getLeftRightStyles(e,!0);if(parseInt(i.width,10)<1)return;for(var n=0,o=this.actionObj.cloneElement;n<o.length;n++)gt(c=o[n],i),U([c],T2e)}this.horizontalResizing(!this.parent.enableRtl)}if(this.resizeEdges.right){if(t){var r=this.getLeftRightStyles(e,!1);if(parseInt(r.width,10)<1)return;for(var s=0,a=this.actionObj.cloneElement;s<a.length;s++)gt(c=a[s],r),U([c],E2e)}this.horizontalResizing(this.parent.enableRtl)}if(this.resizeEdges.top){if(t){var l=this.getTopBottomStyles(e,!0);if(parseInt(l.height,10)<1)return;for(var h=0,d=this.actionObj.cloneElement;h<d.length;h++)gt(c=d[h],l),U([c],D2e)}this.verticalResizing(!0)}if(this.resizeEdges.bottom){if(t){var p=this.getTopBottomStyles(e,!1);if(parseInt(p.height,10)<1)return;for(var c,u=0,g=this.actionObj.cloneElement;u<g.length;u++)gt(c=g[u],p),U([c],M2e)}this.verticalResizing(!1)}}},Vje.prototype.monthResizing=function(){var e,t,i,n;this.removeCloneElement(),je(this.actionObj.pageX)||je(this.actionObj.pageY)||je(e=document.elementFromPoint(this.actionObj.pageX,this.actionObj.pageY))||(n=this.parent.getDateFromElement(e),e=!(0<this.parent.activeViewOptions.group.resources.length)||parseInt(e.getAttribute("data-group-index"),10)===this.actionObj.groupIndex,t=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),i=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime()),!this.parent.enableRtl&&this.resizeEdges.left||this.parent.enableRtl&&this.resizeEdges.right||this.resizeEdges.top?t=n:(!this.parent.enableRtl&&this.resizeEdges.right||this.parent.enableRtl&&this.resizeEdges.left||this.resizeEdges.bottom)&&(i=yOe(n,1)),e&&t<i&&(this.actionObj.start=t,this.actionObj.end=i,n=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event),"TimelineYear"===this.parent.currentView?this.yearEventsRendering(n):this.dynamicEventsRendering(n),this.updateOriginalElement(this.actionObj.clone)))},Vje.prototype.yearEventsRendering=function(e){for(var t=0,i=[].slice.call(this.parent.element.querySelectorAll("."+C2e));t<i.length;t++)ue(i[t]);var n=new Date(e[this.parent.eventFields.endTime]),o=0;0===this.parent.activeViewOptions.group.resources.length&&(o=this.getMonthDiff(e[this.parent.eventFields.startTime],yOe(n,-1)));for(var r=0;r<=o;r++){var s=void 0;0===this.parent.activeViewOptions.group.resources.length?s=this.getEventCount(e,this.actionObj.start.getMonth()+r):(s=Pe({},e,null,!0),n=this.resizeEdges.left||this.resizeEdges.right?yOe(n,-1):n,s.count=this.getMonthDiff(e[this.parent.eventFields.startTime],n)+1),this.dynamicYearlyEventsRendering(s,!0)}},Vje.prototype.getMonthDiff=function(e,t){var i=12*(t.getFullYear()-e.getFullYear());return(i=(i-=e.getMonth())+t.getMonth())<=0?0:i},Vje.prototype.getEventCount=function(e,t){var e=Pe({},e,null,!0),i=e[this.parent.eventFields.startTime],n=e[this.parent.eventFields.endTime],o=new Date(this.parent.selectedDate.getFullYear(),t,1),t=yOe(new Date(this.parent.selectedDate.getFullYear(),t+1,0),1),r=1;return i.getTime()<o.getTime()&&(e[this.parent.eventFields.startTime]=o),n.getTime()>t.getTime()&&(e[this.parent.eventFields.endTime]=t),0===this.parent.activeViewOptions.group.resources.length&&(r=Math.ceil((e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime())/iOe)),e.count=r,e},Vje.prototype.resizeStop=function(e){var t=this,e=(E.remove(document,F.touchMoveEvent,this.resizing),E.remove(document,F.touchEndEvent,this.resizeStop),clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionObj.action=null,this.removeCloneElementClasses(),this.removeCloneElement(),this.actionClass("removeClass"),{cancel:this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1,data:this.getChangedData(),element:this.actionObj.element,event:e});this.parent.trigger(BRe,e,function(e){e.cancel||t.parent.eventBase.checkOverlap(e.data)||(t.parent.isSpecificResourceEvents()&&(t.parent.crudModule.crudObj.sourceEvent=[t.parent.resourceBase.lastResourceLevel[parseInt(e.element.getAttribute("data-group-index"),10)]],t.parent.crudModule.crudObj.targetEvent=t.parent.crudModule.crudObj.sourceEvent,t.parent.crudModule.crudObj.isCrudAction=!0),t.saveChangedData(e))})},Vje.prototype.verticalResizing=function(e){var t=this.actionObj.clone.offsetTop,t=(e||(t+=this.actionObj.clone.offsetHeight),t/this.actionObj.cellHeight*this.actionObj.slotInterval),i=this.actionObj.clone.offsetParent;je(i)||((i=gOe(this.parent.getDateFromElement(i))).setHours(this.parent.activeView.getStartHour().getHours()),i.setMinutes(t+this.parent.activeView.getStartHour().getMinutes()),e?this.actionObj.start=this.calculateIntervalTime(i):this.actionObj.end=this.calculateIntervalTime(i),this.updateTimePosition(i))},Vje.prototype.horizontalResizing=function(e){var t=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),i=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime()),n=this.parent.currentView,o="TimelineMonth"===this.parent.currentView;if(this.parent.activeView.isTimelineView()){var r=this.parent.getContentTable().querySelector("tr"),s=(0<this.parent.activeViewOptions.headerRows.length&&(n=(m=this.parent.activeViewOptions.headerRows.map(function(e){return e.option})).slice(-1)[0],o)&&"Hour"===n&&(n=m.slice(-2)[0]||"Month"),m=e?t:i,0),a=[].slice.call(r.children),l=!1,h=this.actionObj.cellWidth/(this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount),d=parseFloat(this.parent.enableRtl?this.actionObj.clone.style.right:this.actionObj.clone.style.left),d=Math.round(d/h)*h;if(-1!==["Year","Month","Week","Date"].indexOf(n)){for(var p=0,c=0,u=a;c<u.length;c++){var g=u[c];p+=parseInt(g.getAttribute("colspan"),10)}h=this.parent.enableRtl?parseInt(this.actionObj.clone.style.right,10):parseInt(this.actionObj.clone.style.left,10),h=Math.round(h/this.actionObj.cellWidth)*this.actionObj.cellWidth;e||(h+=this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth),s=o?Math.floor(h/Math.floor(this.parent.getElementWidth(r)/p)):Math.round(h/(this.parent.getElementWidth(r)/p)),l=(s=!e&&o?s+1:s)===a.length,s=s<0?0:p<=s?p-1:s}else{h=this.actionObj.cellWidth;s=e?Math.round(d/this.actionObj.cellWidth):Math.ceil((d+(this.parent.getElementWidth(this.actionObj.clone)-h))/this.actionObj.cellWidth),this.parent.enableRtl&&(o=Math.round(d/this.actionObj.cellWidth)*this.actionObj.cellWidth+(e?0:this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth),s=Math.floor(o/this.actionObj.cellWidth)),l=s===a.length,s=this.getIndex(s)}var m,h=void 0,h=-1!==["Year","Month","Week","Date"].indexOf(n)?new Date(this.parent.activeView.renderDates[parseInt(s.toString(),10)].getTime()):this.parent.getDateFromElement(r.children[parseInt(s.toString(),10)]);-1===["TimelineMonth","Year","Month","Week","Date"].indexOf(n)&&this.parent.activeViewOptions.timeScale.enable?(e||(d+=this.parent.getElementWidth(this.actionObj.clone)),o=Math.floor(this.actionObj.slotInterval/this.actionObj.cellWidth*(d-Math.floor(d/this.actionObj.cellWidth)*this.actionObj.cellWidth)),o=l||!e&&0===o?this.actionObj.slotInterval:o,m=new Date(h.getTime()),m=new Date(h.getTime()+6e4*o),this.updateTimePosition(m)):m=new Date(h.setHours(m.getHours(),m.getMinutes(),m.getSeconds()))}else{a=z(this.actionObj.clone,"td").cellIndex,s=Math.ceil((e?this.parent.getElementWidth(this.actionObj.element):0)/this.actionObj.cellWidth)*this.actionObj.cellWidth,p=Math.ceil((this.parent.getElementWidth(this.actionObj.clone)-s)/this.actionObj.cellWidth),r=z(this.actionObj.clone,"tr"),d=e?a-p:a+p-1,d=this.getIndex(d);m=this.parent.getDateFromElement(r.children[parseInt(d.toString(),10)]),e?m.setHours(t.getHours(),t.getMinutes(),t.getSeconds()):m.setHours(i.getHours(),i.getMinutes(),i.getSeconds())}l=-1!==["TimelineMonth","Year","Month","Week","WorkWeek","Date","Day"].indexOf(n)||!this.parent.activeViewOptions.timeScale.enable;e?(i.getTime()-m.getTime()<=0&&(m=l?gOe(i):t),this.actionObj.start=l?m:this.calculateIntervalTime(m)):(o=l&&0===m.getHours()&&0===m.getMinutes()?yOe(m,1):m,l&&o.getTime()-t.getTime()<=0&&(o=yOe(gOe(t),1)),this.actionObj.end=l?o:this.calculateIntervalTime(o))},Vje.prototype.getTopBottomStyles=function(e,t){var i=this.parent.element.querySelector("."+i2e),n=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,o=t?this.actionObj.element.offsetHeight+(this.actionObj.Y-this.actionObj.pageY):this.actionObj.element.offsetHeight+(this.actionObj.pageY-this.actionObj.Y),o=(r=t?this.actionObj.element.offsetTop-(this.actionObj.Y-this.actionObj.pageY):this.actionObj.clone.offsetTop)<0||this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight>this.scrollArgs.height?this.actionObj.clone.offsetHeight:o,r=r<0?0:r;return o=(r=t?Math.floor(r/n)*n:r)+o>=i.scrollHeight?i.scrollHeight-r:Math.ceil(o/n)*n,{height:T((o=!t&&this.actionObj.clone.offsetTop+o>=this.parent.getContentTable().offsetHeight?this.parent.getContentTable().offsetHeight-this.actionObj.clone.offsetTop:o)<this.actionObj.cellHeight?Math.floor(o/n)*n:o),top:T(o<this.actionObj.cellHeight&&t?Math.ceil(r/n)*n:r),left:"0px",right:"0px",width:"100%"}},Vje.prototype.getLeftRightStyles=function(e,t){var i,n={},o=this.parent.activeView.isTimelineView(),r=-1<["TimelineDay","TimelineWeek","TimelineWorkWeek"].indexOf(this.parent.currentView)&&this.parent.activeViewOptions.timeScale.enable,s=this.actionObj.cellWidth/this.actionObj.slotInterval*this.actionObj.interval,a=t?this.actionObj.X-this.actionObj.pageX:this.actionObj.pageX-this.actionObj.X,l=o?Math.round(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth:"Month"===this.parent.currentView?this.parent.getElementWidth(this.actionObj.element):Math.ceil(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth,h=l+Math.ceil(a/this.actionObj.cellWidth)*this.actionObj.cellWidth,d=this.parent.enableRtl?parseInt(this.actionObj.element.style.right,10):this.actionObj.clone.offsetLeft,d=Math.round(d/s)*s,a=(r&&(h=l+Math.ceil(a/s)*s,t||(a=(+parseFloat(this.actionObj.element.style[this.parent.enableRtl?"right":"left"])).toFixed(1),i=Math.round(l/s)*s,a===d.toFixed(1)&&i===l)||(h=Math.round((d+h)/s)*s-d),this.actionObj.event[this.parent.eventFields.isAllDay]=!1),!t&&h+this.actionObj.clone.offsetLeft>this.scrollArgs.width?this.parent.getElementWidth(this.actionObj.clone):(this.actionObj.cellWidth,h));return this.parent.enableRtl?(i=o?parseInt(this.actionObj.element.style.right,10):-(h-this.actionObj.cellWidth),i=!o&&(t||0<i)?0:i,o&&!t&&(i=Math.round(i/s)*s,(i-=Math.ceil((this.actionObj.pageX-this.actionObj.X)/s)*s)<0)&&(i=parseInt(this.actionObj.clone.style.right,10),a=parseInt(this.actionObj.clone.style.width,10)),i=i>=this.scrollArgs.width?this.scrollArgs.width-this.actionObj.cellWidth:i,n.right=T(i),a=a+i>this.scrollArgs.width?this.parent.getElementWidth(this.actionObj.clone):a):(d=t?this.actionObj.element.offsetLeft-(this.actionObj.X-this.actionObj.pageX):this.parent.enableRtl?this.actionObj.element.offsetLeft:0,o&&(d=t?d:parseInt(this.actionObj.clone.style.left,10),d=this.parent.enableRtl?!t&&this.actionObj.pageX<this.actionObj.X-this.parent.getElementWidth(this.actionObj.clone)?parseInt(this.actionObj.clone.style.right,10):d:t&&this.actionObj.pageX>this.actionObj.X+this.parent.getElementWidth(this.actionObj.clone)&&this.parent.getElementWidth(this.actionObj.clone)===this.actionObj.cellWidth?parseInt(this.actionObj.clone.style.left,10):d),h=d,(d=o?r?t?this.actionObj.element.offsetLeft-Math.ceil((this.actionObj.element.offsetLeft-d)/s)*s:d:Math.floor(d/this.actionObj.cellWidth)*this.actionObj.cellWidth:Math.ceil(Math.abs(d)/this.actionObj.cellWidth)*this.actionObj.cellWidth)<0&&(a=o&&t&&d%s?(d=parseInt(this.actionObj.clone.style.left,10),parseInt(this.actionObj.clone.style.width,10)):(d=0,this.parent.getElementWidth(this.actionObj.clone))),i=Math.ceil(this.parent.getElementWidth(this.actionObj.clone)/this.actionObj.cellWidth)*this.actionObj.cellWidth,t&&(n.left=T(!o&&t?h<0?-d:Math.ceil((l-i)/this.actionObj.cellWidth)*this.actionObj.cellWidth:d))),n.width=T(a),n},Vje.prototype.resizeValidation=function(e){var e=this.parent.eventBase.getPageCoordinates(e),t=this.getContentAreaDimension(),i=this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.timeScale.enable,n=this.actionObj.cellWidth,o=!1;return this.resizeEdges.left&&(e.pageX<t.leftOffset&&e.pageX>=t.left&&i&&(n=0),o=e.pageX-n>=t.left),this.resizeEdges.right&&(e.pageX>t.rightOffset&&e.pageX<=t.right&&i&&(n=0),o=e.pageX+n<=t.right),this.resizeEdges.top&&(o=this.actionObj.clone.offsetTop>=t.top),o=this.resizeEdges.bottom?this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight<=this.scrollArgs.height:o},Vje.prototype.getModuleName=function(){return"resize"};var Oje,Nje,qo=Vje;function Vje(){return null!==Nje&&Nje.apply(this,arguments)||this}_je=function(e,t){return(_je=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}_je(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(jje,Hje=FHe),jje.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.fields=this.parent.eventFields;for(var e="Year"===this.parent.currentView?"."+JOe+" ."+qNe:"."+LNe+",."+H2e,t=0,i=[].slice.call(this.parent.element.querySelectorAll(e));t<i.length;t++)ue(i[t]);this.renderedEvents=[],"Year"===this.parent.currentView?this.yearViewEvents():(this.removeCellHeight(),0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(this.isResource=!0,this.timelineResourceEvents()):this.timelineYearViewEvents()),this.parent.renderTemplates(),this.parent.notify(YRe,{})},jje.prototype.yearViewEvents=function(){for(var e=this.getMonths(),t=0,i=e;t<i.length;t++)for(var n=i[t],o=".e-month-calendar:nth-child("+(e.indexOf(n)+1)+") td.e-work-cells",r=[].slice.call(this.parent.element.querySelectorAll(o)),o=new Date(this.parent.selectedDate.getFullYear(),n,1),n=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),o=this.parent.calendarUtil.getMonthEndDate(new Date(o.getTime())),s=aOe(n,this.parent.activeViewOptions.firstDayOfWeek),a=yOe(lOe(o,this.parent.activeViewOptions.firstDayOfWeek),1),l=0;s.getTime()<a.getTime();l++){var h=gOe(new Date(s.getTime())),d=yOe(new Date(h.getTime()),1),s=yOe(new Date(s.getTime()),1);this.parent.isMinMaxDate(h)&&0<this.parent.eventBase.filterEvents(h,d).length&&(h=r[parseInt(l.toString(),10)])&&h.appendChild(Q("div",{className:qNe}))}},jje.prototype.timelineYearViewEvents=function(){for(var n,o=this,e=this.parent.element.querySelector("."+JOe+":not(."+oNe+")"),e=(this.cellWidth=this.parent.getElementWidth(e),this.cellHeader=MOe(e.querySelector("."+p2e)),this.parent.element.querySelector("."+uNe)),t=(this.eventHeight=this.parent.getElementHeightFromClass(e,qNe),this.addCellHeight(".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,.e-content-table tbody tr",this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight),[].slice.call(this.parent.element.querySelectorAll("."+UNe))),i=this.getMonths(),l=0<this.parent.activeViewOptions.group.resources.length&&this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:void 0,h=0;h<i.length;h++){var r=t[parseInt(h.toString(),10)],s=h+1,d=Q("div",{className:LNe}),p=(r.appendChild(d),new Date(this.parent.selectedDate.getFullYear(),i[parseInt(h.toString(),10)],1)),a=new Date(p.getFullYear(),p.getMonth()+1,0),c=p.getDay(),u=[];for("Horizontal"===this.parent.activeViewOptions.orientation&&(this.renderedEvents=[]);p.getTime()<=a.getTime();){for(var g=void 0,m=void 0,f=("Vertical"===this.parent.activeViewOptions.orientation?(b=t[parseInt(c.toString(),10)],s=c+1,(d=b.querySelector("."+LNe))||(d=Q("div",{className:LNe}),b.appendChild(d)),this.parent.enableRtl?m=h*this.cellWidth:g=h*this.cellWidth):this.parent.enableRtl?m=(c+p.getDate()-1)*this.cellWidth:g=(c+p.getDate()-1)*this.cellWidth,this.parent.element.querySelector(".e-content-wrap tr:nth-child("+s+") td")),y=(this.cellHeight=f.offsetHeight,gOe(new Date(p.getTime()))),v=yOe(new Date(y.getTime()),1),b=void 0,w=(this.parent.uiStateValues.isGroupAdaptive&&(b=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]),this.parent.eventBase.filterEvents(y,v,void 0,b)),w=this.parent.eventBase.sortByDateTime(w),C=this,S=0,A=w.length;S<A;S++)!function(e,t){var i=Pe({},w[parseInt(e.toString(),10)],null,!0),e=(C.updateSpannedEvents(i,y,v),C.getIndex(y)),n=(i.Index=e,C.cellHeader+C.eventHeight*(e+1)+2+C.moreIndicatorHeight),o=C.cellHeight-C.cellHeader-C.moreIndicatorHeight,o=Math.floor(o/(C.eventHeight+2)),r=C.parent.rowAutoHeight?1:C.parent.activeViewOptions.maxEventsPerRow,t=C.parent.activeViewOptions.maxEventsPerRow?t-r:t-o<=0?1:t-o;if("Horizontal"===C.parent.activeViewOptions.orientation){var o=C.renderedEvents.filter(function(e){return e.Guid===i.Guid}),s=u.filter(function(e){return e.Guid===i.Guid});if(0<o.length&&o[0].MoreIndicator||0<s.length&&s[0].MoreIndicator)return a="Horizontal"===C.parent.activeViewOptions.orientation?h:c,C.renderMoreIndicator(d,t,y,a,g,m,l);if(0<o.length||0<s.length)return}var a,o=C.maxOrIndicator||e<r||C.cellHeight>n;C.parent.rowAutoHeight||o||C.cellHeight>n?(C.renderEvent(d,i,h,g,m,p,c),(C.parent.rowAutoHeight||C.cellHeight>n)&&C.updateCellHeight(f,n),u.push(i)):(a="Horizontal"===C.parent.activeViewOptions.orientation?h:c,C.renderMoreIndicator(d,t,y,a,g,m,l),"Horizontal"===C.parent.activeViewOptions.orientation&&(i.MoreIndicator=!0,C.renderedEvents.push(i),u.push(i)))}(S,A);p=yOe(new Date(p.getTime()),1),"Vertical"===this.parent.activeViewOptions.orientation&&(c++,this.renderedEvents=[])}}this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation&&(e=[].slice.call(this.parent.element.querySelectorAll("."+UNe)),n=[].slice.call(this.parent.element.querySelectorAll("."+KOe+" tbody tr")),e.forEach(function(e,t){var e=[].slice.call(e.querySelectorAll("."+qNe)),i=n[parseInt(t.toString(),10)].offsetTop+o.cellHeader+2;e.forEach(function(e){var t=parseInt(e.getAttribute("data-index"),10);e.style.top=i+t*o.eventHeight+"px",e.removeAttribute("data-index")})}))},jje.prototype.updateSpannedEvents=function(e,t,i){var n=this.isResource&&"Vertical"===this.parent.activeViewOptions.orientation||!this.isResource&&"Horizontal"===this.parent.activeViewOptions.orientation,o={isLeft:!0,isRight:!0,isBottom:!0,isTop:!0};t.getTime()<=e[this.fields.startTime].getTime()&&(n?o.isLeft=!1:o.isTop=!1),(i.getTime()>=e[this.fields.endTime].getTime()||n&&!this.isResource&&yOe(i,-1).getMonth()===e[this.fields.endTime].getMonth()||n&&this.isResource&&i.getTime()<=e[this.fields.endTime].getTime())&&(n?o.isRight=!1:o.isBottom=!1),e.data=o},jje.prototype.timelineResourceEvents=function(){var s,i,a=this,e=this.parent.element.querySelector("."+i2e),t=e.offsetWidth>e.clientWidth,n=this.parent.element.querySelector("."+JOe),n=(this.cellWidth=this.parent.getElementWidth(n),this.cellHeader=0,this.parent.element.querySelector("."+uNe)),o=(this.eventHeight=this.parent.getElementHeightFromClass(n,qNe),this.addCellHeight(".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,.e-content-table tbody tr",this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight),[].slice.call(this.parent.element.querySelectorAll("."+UNe))),r=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.activeViewOptions.allowVirtualScrolling?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel,l=this.getMonths();if("Horizontal"===this.parent.activeViewOptions.orientation)for(var h=0;h<l.length;h++)for(var d=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(h.toString(),10)],1),p=0,c=r.length;p<c;p++)this.renderedEvents=[],this.renderResourceEvent(o[parseInt(h.toString(),10)],r[parseInt(p.toString(),10)],h,p,d);else for(p=0,c=r.length;p<c;p++){this.renderedEvents=[];for(h=0;h<l.length;h++){d=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(h.toString(),10)],1);this.renderResourceEvent(o[parseInt(p.toString(),10)],r[parseInt(p.toString(),10)],h,p,d)}}this.parent.rowAutoHeight&&!t&&e.offsetWidth>e.clientWidth&&([].slice.call(this.parent.element.querySelectorAll("."+qNe)).forEach(function(e){e.style.removeProperty("left"),e.style.removeProperty("right")}),n=[].slice.call(this.parent.element.querySelectorAll("."+UNe)),s=this.parent.element.querySelector("."+KOe),i=[].slice.call(s.querySelectorAll("tbody tr")),n.forEach(function(e,t){var e=[].slice.call(e.children),r=i[parseInt(t.toString(),10)];e.forEach(function(e,t){var i,t=r.querySelector("td:nth-child("+(t+1)+")"),e=[].slice.call(e.children),n=a.parent.getElementWidth(t),o=t.offsetLeft;a.parent.enableRtl?(i=s.offsetWidth-o-t.offsetWidth,e.forEach(function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/n)*n+"px",e.style.right=i+"px"})):e.forEach(function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/n)*n+"px",e.style.left=o+"px"})})}))},jje.prototype.renderResourceEvent=function(e,t,l,h,d){for(var p=Q("div",{className:LNe}),e=(e.appendChild(p),yOe(dOe(new Date(d.getTime())),1)),c=this.parent.eventBase.filterEvents(d,e,void 0,t),e="Vertical"===this.parent.activeViewOptions.orientation?h:l,u=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(e+1)+") td"),g=(this.cellHeight=u.offsetHeight,this.groupOrder=t.groupOrder,[]),m=this,i=0;i<c.length;i++){var n=function(e){var t=void 0,i=Pe({},c[parseInt(e.toString(),10)],null,!0),n=(t=0<m.parent.activeViewOptions.group.resources.length?(n=m.isSpannedEvent(i,d),m.getIndex(n[m.fields.startTime])):m.getIndex(i[m.fields.startTime]),i.Index=t,m.cellHeader+m.eventHeight*(e+1)+2+m.moreIndicatorHeight),o="Vertical"===m.parent.activeViewOptions.orientation?l*m.cellWidth:h*m.cellWidth;if(!m.parent.isMinMaxDate(i[m.fields.startTime]))return{value:void 0};if("Vertical"===m.parent.activeViewOptions.orientation&&0<m.parent.activeViewOptions.group.resources.length){var r=m.renderedEvents.filter(function(e){return e.Guid===i.Guid}),s=g.filter(function(e){return e.Guid===i.Guid});if(0<r.length||0<s.length)return"continue"}if(!(m.parent.rowAutoHeight||m.cellHeight>n)){r="Horizontal"===m.parent.activeViewOptions.orientation?l:h;if(m.renderMoreIndicator(p,c.length-e,d,r,o,o,h),"Horizontal"===m.parent.activeViewOptions.orientation)for(var a=h;a<c.length;a++)m.renderedEvents.push(Pe({},c[parseInt(a.toString(),10)],{Index:t+a},!0));return"break"}m.renderEvent(p,i,l,o,o,d,h),m.updateCellHeight(u,n),g.push(i)}(i);if("object"==typeof n)return n.value;if("break"===n)break}},jje.prototype.renderEvent=function(t,e,i,n,o,r,s){var a,l=this,h=this.isSpannedEvent(e,r),d=this.createEventElement(h);1===h.isSpanned.count&&(e=yOe(h[this.fields.endTime],-1),h[this.fields.endTime]=e>h[this.fields.startTime]?e:h[this.fields.endTime]),h[this.fields.startTime]>h[this.fields.endTime]||(r="Horizontal"===this.parent.activeViewOptions.orientation?(a=i+1,h[this.fields.startTime].getTime()===h[this.fields.endTime].getTime()&&(h.isSpanned.count=1),h.isSpanned.count*this.cellWidth):(a=s+1,this.isResource?h.isSpanned.count*this.cellWidth:this.cellWidth),e=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+a+") td").offsetTop+this.cellHeader+this.eventHeight*h.Index+2,gt(d,{width:r+"px",height:this.eventHeight+"px",left:n+"px",right:o+"px",top:e+"px"}),!this.isResource&&this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation&&d.setAttribute("data-index",h.Index.toString()),this.parent.trigger(ERe,{data:h,element:d,cancel:!1,type:"event"},function(e){!e.cancel&&(t.appendChild(d),l.wireAppointmentEvents(d,h),0<l.parent.activeViewOptions.group.resources.length||"Vertical"===l.parent.activeViewOptions.orientation||(h.isSpanned.isRight||h.isSpanned.isLeft)&&"Horizontal"===l.parent.activeViewOptions.orientation||!h.isSpanned.isRight)&&l.renderedEvents.push(Pe({},h,null,!0))}))},jje.prototype.renderMoreIndicator=function(e,t,i,n,o,r,s){var a;0===this.parent.activeViewOptions.group.resources.length&&e.querySelector('[data-start-date="'+i.getTime()+'"]')||(a=0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?yOe(dOe(new Date(i.getTime())),1):yOe(new Date(i.getTime()),1),t=this.getMoreIndicatorElement(t,i,a),i=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(n+1)+")").offsetTop+(this.cellHeight-this.moreIndicatorHeight),o=Math.floor(o/this.cellWidth)*this.cellWidth,r=Math.floor(r/this.cellWidth)*this.cellWidth,gt(t,{width:this.cellWidth+"px",left:o+"px",right:r+"px",top:i+"px"}),je(s)||t.setAttribute("data-group-index",s.toString()),e.appendChild(t),E.add(t,"click",this.moreIndicatorClick,this))},jje.prototype.createEventElement=function(e){var t,i=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),n=Q("div",{className:qNe,attrs:{"data-id":"Appointment_"+e[this.fields.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(e)}}),o=(this.cssClass&&U([n],this.cssClass),e[this.fields.isReadonly]&&U([n],a_e),0<this.parent.activeViewOptions.group.resources.length&&(o=this.getGroupIndexFromEvent(e),n.setAttribute("data-group-index",o.toString())),[]),r=Pe({},e,null,!0),s=(this.parent.activeViewOptions.eventTemplate?(s=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",o=this.parent.getAppointmentTemplate()(r,this.parent,"eventTemplate",s,!1,void 0,void 0,this.parent.root)):(s=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",i=Q("div",{className:CVe,innerHTML:i+(s?";&nbsp"+s:"")}),s=Q("div",{className:$Ne+(this.parent.isAdaptive?" "+UOe:""),innerHTML:this.parent.getTimeString(r[this.fields.startTime])}),t=Q("div",{className:$Ne+(this.parent.isAdaptive?" "+UOe:""),innerHTML:this.parent.getTimeString(r[this.fields.endTime])}),U([i],"e-text-center"),e[this.fields.isAllDay]?o=[i]:r.isLeft||r.isRight?(r.isLeft||o.push(s),o.push(i),r.isRight||o.push(t)):o=[s,i,t]),Q("div",{className:KNe}));return ht(o,s),n.appendChild(s),this.parent.eventBase.renderSpannedIcon(n,e.isSpanned),this.renderResizeHandler(n,e.data,e[this.fields.isReadonly]),this.applyResourceColor(n,r,"backgroundColor",this.groupOrder),n},jje.prototype.isSpannedEvent=function(e,t){var i=new Date(t.getFullYear(),t.getMonth(),1),t=yOe(new Date(t.getFullYear(),t.getMonth()+1,0),1),n=Pe({},e,null,!0),o=n[this.fields.startTime],r=n[this.fields.endTime],s={isLeft:!1,isRight:!1,count:1},a=new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear,1),l=vOe(a,this.parent.monthsCount);return this.isResource&&this.updateSpannedEvents(e,i,t),"Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length?(this.updateSpannedEventDetails(o,r,a,l,n,s),a=n[this.fields.startTime],l=new Date(n[this.fields.endTime]-1),s.count=l.getMonth()-a.getMonth()+this.parent.monthsCount*(l.getFullYear()-a.getFullYear())+1):(this.updateSpannedEventDetails(o,r,i,t,n,s),0!==this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive||(l=gOe(n[this.fields.endTime]).getTime(),a=gOe(n[this.fields.startTime]).getTime(),(e[this.fields.isAllDay]&&l===e[this.fields.endTime].getTime()||s.isRight)&&(l=yOe(new Date(l),-1).getTime()),s.count=Math.round((l-a)/iOe)+1)),n.isSpanned=s,gOe(o).getTime()<gOe(this.parent.minDate).getTime()&&(n[this.fields.startTime]=this.parent.minDate),gOe(r).getTime()>gOe(this.parent.maxDate).getTime()&&(n[this.fields.endTime]=this.parent.maxDate),n},jje.prototype.updateSpannedEventDetails=function(e,t,i,n,o,r){e.getTime()<i.getTime()&&(o[this.fields.startTime]=i,r.isLeft=!0),t.getTime()>n.getTime()&&(o[this.fields.endTime]=n,r.isRight=!0)},jje.prototype.getOverlapEvents=function(e,t){var i,n,o,r,s=[];0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(i=this.parent.calendarUtil.getMonthStartDate(new Date(e.getTime())),n=yOe(this.parent.calendarUtil.getMonthEndDate(new Date(e.getTime())),-1),o=gOe(new Date(i.getTime())).getTime(),r=gOe(new Date(n.getTime())).getTime()):this.parent.rowAutoHeight?(o=gOe(new Date(e.getTime())).getTime(),r=yOe(gOe(new Date(e.getTime())),1).getTime()):o=r=gOe(new Date(e.getTime())).getTime();for(var a=0,l=t;a<l.length;a++){var h=l[a],d=new Date(h[this.fields.startTime].getTime()),p=new Date(h[this.fields.endTime].getTime()),c=h[this.fields.isAllDay]?gOe(p).getTime()>o:gOe(p).getTime()>=o;(gOe(d).getTime()<=o&&c||gOe(d).getTime()>=o&&gOe(p).getTime()<=r||"Vertical"===this.parent.activeViewOptions.orientation&&gOe(d).getTime()>=o&&gOe(p).getTime()>=r)&&s.push(h)}return s},jje.prototype.getMonths=function(){var i=this;return Array.apply(null,{length:this.parent.monthsCount}).map(function(e,t){return i.parent.firstMonthOfYear+t})},jje.prototype.removeCellHeight=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,.e-content-table tbody tr"));e<t.length;e++)t[e].firstElementChild.style.height=""},jje.prototype.destroy=function(){Hje.prototype.destroy.call(this),this.parent=null};var _je,Hje,zje=jje;function jje(e){e=Hje.call(this,e,"day")||this;return e.isResource=!1,e}Wje=function(e,t){return(Wje=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Wje(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Uje,Qje=gRe),Uje.prototype.wireDragEvent=function(e){new hn(e,{abort:"."+x2e,clone:!0,isDragScroll:!0,enableTailMode:!!this.parent.eventDragArea,cursorAt:this.parent.eventDragArea?{left:-20,top:-20}:{left:0,top:0},dragArea:this.dragArea,dragStart:this.dragStart.bind(this),drag:this.drag.bind(this),dragStop:this.dragStop.bind(this),enableAutoScroll:!1,helper:this.dragHelper.bind(this),queryPositionInfo:this.dragPosition.bind(this)})},Uje.prototype.setDragArea=function(){var e=document.querySelector(this.parent.eventDragArea);this.dragArea=this.parent.eventDragArea&&e?e:this.parent.element.querySelector("."+KOe)},Uje.prototype.dragHelper=function(e){var i=this;if(e.sender&&"touchmove"===e.sender.type&&(!this.parent.uiStateValues.isTapHold||!e.element.classList.contains(XNe)))return null;this.setDragActionDefaultValues(),this.actionObj.element=e.element,e.sender&&-1<["Day","Week","WorkWeek"].indexOf(this.parent.currentView)&&(t=this.parent.eventBase.getPageCoordinates(e.sender),this.distanceUptoCursor=t.clientY-this.actionObj.element.getBoundingClientRect().top,this.eleTop=parseFloat(this.actionObj.element.style.top),this.slotsUptoCursor=-1),this.actionObj.action="drag";var t=[];return!this.parent.allowMultiDrag||je(this.parent.selectedElements)||0===this.parent.selectedElements.length||0<this.parent.selectedElements.length&&-1===this.parent.selectedElements.indexOf(this.actionObj.element)?t=[e.element]:(t=this.parent.selectedElements,this.isMultiSelect=!0),t.forEach(function(e){var t=i.createCloneElement(e);e.getAttribute("data-guid")===i.actionObj.element.getAttribute("data-guid")&&(i.actionObj.clone=t,i.parent.eventDragArea||"Month"===i.parent.currentView||!i.parent.activeViewOptions.timeScale.enable||i.parent.activeView.isTimelineView()||i.actionObj.element.classList.contains(L2e)||gt(i.actionObj.clone,{cursor:"move",left:"0%",right:"0%",width:"100%"}),i.actionObj.clone.style.top=T(i.actionObj.element.offsetTop)),i.actionObj.cloneElement.push(t),i.actionObj.originalElement.push(e)}),this.actionObj.clone},Uje.prototype.dragPosition=function(e){var t,i,n,o,r;return this.parent.eventDragArea?{left:e.left,top:e.top}:(t=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,i=T(0),"Month"===this.parent.currentView&&(i=e.left),n=this.isStepDragging?Math.ceil(this.actionObj.clone.getBoundingClientRect().right)+this.actionObj.interval:this.actionObj.clone.getBoundingClientRect().right,r=this.parent.element.querySelector("."+i2e).getBoundingClientRect().right,!(this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView&&!this.parent.enableRtl&&this.actionObj.pageX>n)||this.isMorePopupOpened||this.actionObj.pageX>r||(this.isCursorAhead=!0),this.parent.activeView.isTimelineView()&&(i=T(this.actionObj.clone.offsetLeft)),this.parent.activeView.isTimelineView()||!this.parent.timeScale.enable||!je(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains($2e)?o=T(this.actionObj.clone.offsetTop):"Month"===this.parent.currentView?o=T(0):this.actionObj.clone.classList.contains(L2e)?(o=T(this.parent.element.querySelector("."+XOe).offsetTop),gt(this.actionObj.clone,{width:T(Math.ceil(this.actionObj.clone.offsetWidth/this.actionObj.cellWidth)*this.actionObj.cellWidth),right:this.parent.enableRtl&&T(0)})):(this.actionObj.element.classList.contains(L2e)&&!this.actionObj.clone.classList.contains(L2e)&&gt(this.actionObj.clone,{height:T(this.actionObj.cellHeight),width:T(this.actionObj.cellWidth-1),pointerEvents:"none"}),n=(n=parseInt(e.top,10))<0?0:n,this.slotsUptoCursor<0&&(r=Math.floor((this.eleTop+this.distanceUptoCursor)/t),e=Math.floor(this.eleTop/t),this.slotsUptoCursor=r-e),o=T((n=(Math.floor((n+this.distanceUptoCursor+1)/t)-this.slotsUptoCursor)*t)<0?0:n),(r=this.parent.element.querySelector(".e-content-wrap").scrollHeight)<(e=parseInt(o,10)+this.actionObj.clone.offsetHeight)&&(o=parseInt(o,10)-(e-r)+"px"),this.isPreventMultiDrag&&(o=T(this.actionObj.clone.offsetTop))),{left:i,top:o})},Uje.prototype.setDragActionDefaultValues=function(){this.actionObj.action="drag",this.actionObj.isAllDay=null,this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval;var e=this.parent.element.querySelector("."+JOe);this.actionObj.cellWidth=e.offsetWidth,this.actionObj.cellHeight=e.offsetHeight},Uje.prototype.dragStart=function(i){var n=this,e=this.actionObj.element.getAttribute("data-guid"),o=(this.actionObj.event=this.parent.eventBase.getEventByGuid(e),Pe({},this.actionObj.event,null,!0)),r=(je(o)||(this.startTime=o[this.parent.eventFields.startTime].getTime()),this.parent.allowMultiDrag||this.parent.eventBase.removeSelectedAppointmentClass(),{cancel:!1,data:o,selectedData:this.getSelectedData(),event:i,excludeSelectors:null,element:this.actionObj.element,interval:this.actionObj.interval,navigation:{enable:!1,timeDelay:2e3},scroll:{enable:!0,scrollBy:30,timeDelay:100}});this.parent.trigger("dragStart",r,function(e){var t;e.cancel||!je(n.actionObj.element)&&je(n.actionObj.element.parentElement)?(je(t=n.actionObj.element.ej2_instances[0])||t.intDestroy(i.event),n.actionObj.action="",n.removeCloneElementClasses(),n.removeCloneElement()):(n.actionClass("addClass"),n.parent.uiStateValues.action=!0,n.actionObj.start=o[n.parent.eventFields.startTime],n.actionObj.end=o[n.parent.eventFields.endTime],n.actionObj.groupIndex=parseInt(n.actionObj.element.getAttribute("data-group-index")||"0",10),n.actionObj.interval=e.interval,n.actionObj.navigation=e.navigation,n.actionObj.scroll=e.scroll,n.enableCurrentViewDrag=r.dragWithinRange&&!r.navigation.enable&&n.parent.allowMultiDrag,n.actionObj.excludeSelectors=e.excludeSelectors,t=n.parent.element.querySelector("."+i2e),n.scrollArgs={element:t,width:t.scrollWidth,height:t.scrollHeight},n.widthPerMinute=n.actionObj.cellWidth/n.actionObj.slotInterval*n.actionObj.interval,n.heightPerMinute=n.actionObj.cellHeight/n.actionObj.slotInterval*n.actionObj.interval,n.widthUptoCursorPoint=0,n.heightUptoCursorPoint=0,n.cursorPointIndex=-1,n.isHeaderRows=!1,n.isTimelineDayProcess=!1,n.minDiff=0,n.isMorePopupOpened=!1,n.daysVariation=-1,n.isAllDayTarget=n.actionObj.clone.classList.contains(L2e),!n.parent.activeView.isTimelineView()&&n.parent.timeScale.enable||"TimelineYear"===n.parent.currentView||(!je(n.actionObj.clone.offsetParent)&&n.actionObj.clone.offsetParent.classList.contains($2e)&&(n.isMorePopupOpened=!0),n.actionObj.pageX=i.event.pageX,e=n.parent.activeViewOptions.headerRows,n.isHeaderRows=0<e.length&&"Hour"!==e[e.length-1].option&&"Date"!==e[e.length-1].option,n.isTimelineDayProcess=!n.parent.activeViewOptions.timeScale.enable||n.isHeaderRows||"TimelineMonth"===n.parent.currentView||0<e.length&&"Date"===e[e.length-1].option,n.isAllDayDrag=!n.isTimelineDayProcess&&o[n.parent.eventFields.isAllDay],n.isStepDragging=!n.isTimelineDayProcess&&!n.isAllDayDrag&&n.actionObj.slotInterval!==n.actionObj.interval,n.isTimelineDayProcess?n.timelineEventModule=new FHe(n.parent,"day"):n.timelineEventModule=new FHe(n.parent,"hour")),"TimelineYear"===n.parent.currentView&&(n.yearEvent=new zje(n.parent)),"Month"===n.parent.currentView&&(n.startTime=gOe(new Date(n.startTime)).getTime(),n.updateOriginalElement(n.actionObj.clone),n.monthEvent=new MHe(n.parent)),"Day"!==n.parent.currentView&&"Week"!==n.parent.currentView&&"WorkWeek"!==n.parent.currentView||(n.verticalEvent=new IHe(n.parent),n.verticalEvent.initializeValues(),n.splitEvent(n.actionObj.event).forEach(function(e){var e='.e-day-wrapper[data-date="'+gOe(e[n.parent.eventFields.startTime]).getTime()+'"]',e=(0<n.parent.activeViewOptions.group.resources.length&&(e=e.concat('[data-group-index = "'+n.actionObj.groupIndex+'"]')),n.parent.element.querySelector(e));e&&(e=e.querySelector('[data-id="'+n.actionObj.clone.getAttribute("data-id")+'"]'))&&U([e],b2e)})))})},Uje.prototype.getSelectedData=function(){if(this.isMultiSelect&&0===this.multiData.length&&0<this.parent.selectedElements.length)for(var e=0,t=this.parent.selectedElements;e<t.length;e++){var i=t[e].getAttribute("data-guid"),i=this.parent.eventBase.getEventByGuid(i);this.multiData.push(Pe({},i,null,!0))}return this.multiData},Uje.prototype.drag=function(e){var t,i,n,o;e.event&&"touchmove"===e.event.type&&e.event.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),!je(e.target)&&e.target.classList&&e.target.classList.contains(qVe)||(t=Pe({},this.actionObj.event,null,!0),i=this.parent.eventBase.getPageCoordinates(e),this.actionObj.Y=this.actionObj.pageY=i.pageY,this.actionObj.X=this.actionObj.pageX=i.pageX,this.actionObj.target=e.target,this.widthUptoCursorPoint=0===this.widthUptoCursorPoint?Math.ceil(Math.abs(this.actionObj.clone.getBoundingClientRect().left-this.actionObj.X)/this.widthPerMinute)*this.widthPerMinute:this.widthUptoCursorPoint,this.widthUptoCursorPoint=this.isMorePopupOpened?this.actionObj.cellWidth:this.widthUptoCursorPoint,this.heightUptoCursorPoint=0===this.heightUptoCursorPoint?Math.ceil(Math.abs(this.actionObj.clone.getBoundingClientRect().top-this.actionObj.Y)/this.heightPerMinute)*this.heightPerMinute:this.heightUptoCursorPoint,-1<["Day","Week","WorkWeek"].indexOf(this.parent.currentView)&&(this.isAllDayDrag=this.parent.activeViewOptions.timeScale.enable?this.actionObj.clone.classList.contains(L2e):this.actionObj.event[this.parent.eventFields.isAllDay]),this.isStepDragging&&0===this.minDiff&&this.calculateMinutesDiff(t),"Month"!==this.parent.currentView&&!this.isAllDayDrag||!(this.daysVariation<0)||je(n=this.parent.getDateFromElement(this.actionObj.target))?this.daysVariation=0:(n=gOe(n),o=gOe(new Date(t[this.parent.eventFields.startTime].getTime())),this.daysVariation=(n.getTime()-o.getTime())/iOe),this.parent.eventDragArea&&(n=i.target,this.actionObj.clone.style.top=T(n.offsetTop),this.actionObj.clone.style.left=T(n.offsetLeft),z(n,"."+_Oe)?"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView&&"Day"!==this.parent.currentView&&(this.actionObj.clone.style.width=T(this.actionObj.element.offsetWidth)):(this.actionObj.clone.style.height="",this.actionObj.clone.style.width="")),this.updateScrollPosition(e),this.updateNavigatingPosition(e),this.updateDraggingDateTime(e),o={data:t,event:e,element:this.actionObj.element,startTime:this.actionObj.start,endTime:this.actionObj.end,selectedData:this.updatedData},0<this.parent.group.resources.length&&(o.groupIndex=this.actionObj.groupIndex),this.parent.trigger("drag",o))},Uje.prototype.calculateMinutesDiff=function(e){this.parent.enableRtl?this.minDiff=(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint)/this.widthPerMinute*this.actionObj.interval:this.minDiff=this.widthUptoCursorPoint/this.widthPerMinute*this.actionObj.interval;var e=e[this.parent.eventFields.startTime],t=wOe(this.parent.activeView.renderDates[0],this.parent.activeView.getStartHour(),this.parent.activeView.getEndHour());t.startHour.getTime()>e.getTime()&&(this.minDiff=this.minDiff+(t.startHour.getTime()-e.getTime())/6e4)},Uje.prototype.dragStop=function(e){var t,i,n=this;this.isCursorAhead=!1,this.isPreventMultiDrag=!1,this.removeCloneElementClasses(),this.removeCloneElement(),clearInterval(this.actionObj.navigationInterval),this.actionObj.navigationInterval=null,clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionClass("removeClass"),this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1,this.isAllowDrop(e)||(t=e.target.classList&&!e.target.classList.contains("e-work-cells")&&this.parent.cellTemplate?z(e.target,".e-work-cells"):e.target,i={cancel:!1,data:this.getChangedData(this.updatedData),selectedData:this.updatedData,event:e,element:this.actionObj.element,target:t},this.actionObj.action=null,this.parent.trigger("dragStop",i,function(e){var t;e.cancel||n.parent.eventBase.checkOverlap(e.data)||(n.parent.isSpecificResourceEvents()&&(n.parent.crudModule.crudObj.isCrudAction=!0,n.parent.crudModule.crudObj.sourceEvent=[n.parent.resourceBase.lastResourceLevel[parseInt(i.element.getAttribute("data-group-index"),10)]],t=parseInt(i.target.getAttribute("data-group-index"),10)||n.actionObj.groupIndex,n.parent.crudModule.crudObj.targetEvent=[n.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)]]),n.saveChangedData(e,n.isMultiSelect))}),this.updatedData=[],this.multiData=[],this.isMultiSelect=!1,this.parent.selectedElements=[])},Uje.prototype.updateNavigatingPosition=function(i){var n,o=this;this.actionObj.navigation.enable&&(n=this.parent.getCurrentTime(),je(this.actionObj.navigationInterval))&&(this.actionObj.navigationInterval=window.setInterval(function(){var e,t;n&&(e=o.parent.getCurrentTime().getSeconds(),(t=60<=(t=n.getSeconds()+o.actionObj.navigation.timeDelay/1e3)?t-60:t)===e)&&(n=o.parent.getCurrentTime(),o.viewNavigation(i),o.updateDraggingDateTime(i))},this.actionObj.navigation.timeDelay))},Uje.prototype.updateDraggingDateTime=function(e){!je(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains($2e)?this.morePopupEventDragging(e):this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView?(this.timelineEventModule.dateRender=this.parent.activeView.renderDates,this.timelineEventModule.cellWidth=this.actionObj.cellWidth,this.timelineEventModule.getSlotDates(),this.actionObj.cellWidth=this.isHeaderRows?this.timelineEventModule.cellWidth:this.parent.getElementWidth(this.parent.element.querySelector("."+JOe)),this.calculateTimelineTime(e)):"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView?this.calculateVerticalDate(e):this.calculateVerticalTime(e)},Uje.prototype.navigationWrapper=function(){if(this.parent.activeView.isTimelineView()){var t,e=void 0;je(e=0<this.parent.activeViewOptions.group.resources.length?this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(this.actionObj.index):this.parent.element.querySelector("."+UNe))||((t=e.querySelector("."+LNe))||(t=Q("div",{className:LNe}),e.appendChild(t)),this.actionObj.cloneElement.forEach(function(e){t.appendChild(e)}))}else if("Month"!==this.parent.currentView&&this.parent.timeScale.enable){e=this.actionObj.clone.classList.contains(L2e)?"."+F2e:"."+LNe;if(this.parent.element.querySelectorAll(e).item(this.actionObj.index).appendChild(this.actionObj.clone),e=="."+F2e){var i=this.getAllDayEventHeight(),e=[].slice.call(this.parent.element.querySelectorAll("."+YOe+":first-child"));if(e[0].offsetHeight<i)for(var n=0,o=e;n<o.length;n++)o[n].style.height=(i+2)/12+"em";this.actionObj.clone.style.height=T(i)}this.actionObj.height=parseInt(this.actionObj.clone.style.height,10)}else{var e=[].slice.call(this.parent.element.querySelectorAll("."+JOe)),r=(this.actionObj.index=this.parent.activeView.renderDates.length<this.actionObj.index?this.parent.activeView.renderDates.length-1:this.actionObj.index,e[this.actionObj.index].querySelector("."+LNe));r||(r=Q("div",{className:LNe}),e[this.actionObj.index].appendChild(r)),r.appendChild(this.actionObj.clone)}},Uje.prototype.viewNavigation=function(e){var t,i=this.parent.element.querySelector("."+i2e);i&&(!this.scrollEdges.top&&!this.scrollEdges.bottom||z(this.actionObj.clone,"."+F2e))&&(0===i.scrollLeft&&Math.round(this.actionObj.X)<=Math.round(i.getBoundingClientRect().left+this.actionObj.cellWidth+window.pageXOffset)?t=this.parent.enableRtl?"Next":"Previous":Math.round(i.scrollLeft)+i.clientWidth===i.scrollWidth&&Math.round(this.actionObj.X)>=Math.round(i.getBoundingClientRect().right-this.actionObj.cellWidth+window.pageXOffset)&&(t=this.parent.enableRtl?"Previous":"Next"),t)&&this.parent.changeDate(this.parent.activeView.getNextPreviousDate(t))},Uje.prototype.morePopupEventDragging=function(e){var t,i,n;je(e.target)||e.target&&je(z(e.target,"td"))||(n=(n=Pe({},this.actionObj.event,null,!0))[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime(),e=z(e.target,"td"),("TimelineYear"!==this.parent.currentView||e.classList.contains(JOe)&&!e.classList.contains(oNe))&&(i=this.parent.getDateFromElement(e),(t=new Date(i.getTime())).setMilliseconds(n),0<this.parent.activeViewOptions.group.resources.length&&(this.actionObj.groupIndex=parseInt(e.getAttribute("data-group-index"),10)),this.actionObj.start=new Date(i.getTime()),this.actionObj.end=new Date(t.getTime()),this.actionObj.clone.style.top=T(e.offsetParent.offsetTop),this.actionObj.clone.style.left=T(e.offsetLeft),this.actionObj.clone.style.width=T(e.offsetWidth),n=e,this.parent.activeView.isTimelineView()&&(i=z(e,"tr").rowIndex,n=this.parent.element.querySelectorAll(".e-appointment-container").item(i)),(t=n.querySelector("."+LNe))||(t=Q("div",{className:LNe}),n.appendChild(t)),this.appendCloneElement(t)))},Uje.prototype.calculateVerticalTime=function(e){var i=this;if(!(je(this.actionObj.target)||this.actionObj.target&&je(z(this.actionObj.target,"tr")))&&(je(z(this.actionObj.target,"td"))||z(this.actionObj.target,"td").classList.contains(JOe)||z(this.actionObj.target,"td").classList.contains(YOe))){this.parent.activeViewOptions.timeScale.enable&&this.swapDragging(e);var e=this.parent.element.querySelector("."+i2e),t=Pe({},this.actionObj.event,null,!0),n=t[this.parent.eventFields.startTime],t=BOe(t[this.parent.eventFields.endTime])-BOe(n),o=(o=Math.floor(parseInt(this.actionObj.clone.style.top,10)/this.actionObj.cellHeight)*this.actionObj.cellHeight)<0?0:o,e=((this.scrollEdges.top||this.scrollEdges.bottom)&&(o=this.scrollEdges.top?e.scrollTop-this.heightUptoCursorPoint+this.actionObj.cellHeight+window.pageYOffset:e.scrollTop+e.offsetHeight-this.actionObj.clone.offsetHeight+window.pageYOffset+(this.actionObj.clone.offsetHeight-this.heightUptoCursorPoint),o=Math.round(o/this.actionObj.cellHeight)*this.actionObj.cellHeight,0<e.scrollTop)&&o<e.scrollHeight&&(this.actionObj.clone.style.top=T(o)),this.parent.activeViewOptions.timeScale.enable?o/this.actionObj.cellHeight:0),r=this.actionObj.cellHeight/this.actionObj.slotInterval,o=parseInt(this.actionObj.clone.style.top,10)-o,s=(e=this.isAllDayDrag?this.parent.element.querySelector("."+XOe):[].slice.call(this.parent.getContentTable().querySelectorAll("tr"))[parseInt(e.toString(),10)],je(z(this.actionObj.target,"td"))||!z(this.actionObj.target,"td").classList.contains(JOe)&&!z(this.actionObj.target,"td").classList.contains(YOe)||(s=z(this.actionObj.target,"td").cellIndex),je(s)?z(this.actionObj.clone,"td").cellIndex:s);if(this.actionObj.index=s,!je(e)){for(var a,l,e=e.children[parseInt(s.toString(),10)],r=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(this.actionObj.groupIndex=parseInt(e.getAttribute("data-group-index"),10)),this.parent.activeViewOptions.timeScale.enable&&!this.isAllDayDrag?(this.enableCurrentViewDrag&&0!==this.multiData.length||this.appendCloneElement(this.getEventWrapper(s)),(a=this.parent.getDateFromElement(e)).setMinutes(a.getMinutes()+o/r),l=new Date(a.getTime()),this.actionObj.element.classList.contains(L2e)?l.setMinutes(l.getMinutes()+this.actionObj.slotInterval):l.setMilliseconds(t)):((a=this.parent.getDateFromElement(e)).setDate(a.getDate()-this.daysVariation),a.setHours(n.getHours(),n.getMinutes(),n.getSeconds()),(l=new Date(a.getTime())).setMilliseconds(t),!this.actionObj.element.classList.contains(L2e)&&this.actionObj.clone.classList.contains(L2e)&&(l=yOe(gOe(l),1)),o=this.parent.activeViewOptions.group.byDate||this.parent.virtualScrollModule&&!this.parent.activeViewOptions.timeScale.enable?s:void 0,this.updateAllDayEvents(a,l,o)),this.actionObj.start=new Date(+a),this.actionObj.end=new Date(+l),this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event)),h=0,d=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));h<d.length;h++)ue(v=d[h]);if(0<this.multiData.length){this.isAllDayTarget&&this.isAllDayDrag&&!je(this.actionObj.isAllDay)&&!this.actionObj.isAllDay&&(p=parseInt(z(this.actionObj.target,"td").getAttribute("data-date"),10),this.multiData.forEach(function(e){var t;i.swagData.push(Pe({},e,null,!0)),e[i.parent.eventFields.isAllDay]&&(e[i.parent.eventFields.startTime]=new Date(e[i.parent.eventFields.startTime].getTime()+(p-i.startTime)),t=new Date(e[i.parent.eventFields.startTime]),t=new Date(t.setMinutes(t.getMinutes()+i.actionObj.slotInterval)),e[i.parent.eventFields.endTime]=t,e[i.parent.eventFields.isAllDay]=!1)}),this.startTime=p),this.isAllDayTarget&&this.isAllDayDrag&&!je(this.actionObj.isAllDay)&&this.actionObj.isAllDay&&0<this.swagData.length&&(this.multiData=this.swagData,this.swagData=[],e=Pe({},this.actionObj.event,null,!0),this.startTime=e[this.parent.eventFields.startTime].getTime());var p,c=r[this.parent.eventFields.startTime].getTime()-this.startTime;if(this.enableCurrentViewDrag)for(var u=this.getRenderedDates(),g=0;g<this.multiData.length;g++){var m=Pe({},this.multiData[parseInt(g.toString(),10)],null,!0),m=new Date(m[this.parent.eventFields.startTime].getTime()+c);if((f=this.parent.getIndexOfDate(u,gOe(m)))<0){this.isPreventMultiDrag=!0;break}this.isPreventMultiDrag=!1}if(!this.isPreventMultiDrag)for(var f,y,v,b=0;b<this.multiData.length;b++)this.updatedData[parseInt(b.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(b.toString(),10)],c),0<=(f=this.getDayIndex(this.updatedData[parseInt(b.toString(),10)]))?(y=this.updatedData[parseInt(b.toString(),10)][this.parent.eventFields.isAllDay],v=this.getEventWrapper(f,y),this.appendCloneElement(v,this.actionObj.cloneElement[parseInt(b.toString(),10)]),this.updateEventHeight(this.updatedData[parseInt(b.toString(),10)],b,f)):je(this.actionObj.cloneElement[parseInt(b.toString(),10)].parentNode)||ue(this.actionObj.cloneElement[parseInt(b.toString(),10)])}else this.updateEventHeight(r);this.updateTimePosition(this.actionObj.start,this.updatedData)}}},Uje.prototype.splitEvent=function(e){var t=this.parent.eventFields,i=[],n=e[t.startTime],o=e[t.endTime];if(gOe(new Date(n.getTime()))<gOe(new Date(o.getTime()))){for(var r=gOe(new Date(n.getTime())),s=new Date(r.getTime());r<new Date(o.getTime());0){var s=new Date(s.setDate(r.getDate()+1)),a=Pe({},e,null,!0);a[t.startTime]=new Date(r),a[t.endTime]=new Date(s),r=new Date(r.setDate(r.getDate()+1)),i.push(a)}var l=i.length-1;i[0][t.startTime]=n,i[parseInt(l.toString(),10)][t.endTime]=o}else i.push(e);return i},Uje.prototype.updateMultipleData=function(e,t){var i,n,o,e=Pe({},e,null,!0),r=(!je(this.actionObj.isAllDay)&&this.parent.activeViewOptions.timeScale.enable&&(this.isAllDayTarget&&e[this.parent.eventFields.isAllDay]||!this.isAllDayTarget&&!e[this.parent.eventFields.isAllDay])&&(e[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay),e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime());return e[this.parent.eventFields.isAllDay]?(i=Math.ceil(t/864e5),n=Math.ceil(r/864e5),o=new Date(e[this.parent.eventFields.startTime]),e[this.parent.eventFields.startTime]=gOe(new Date(o.setDate(o.getDate()+i))),e[this.parent.eventFields.endTime]=yOe(e[this.parent.eventFields.startTime],n)):(e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].getTime()+t),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+r)),e},Uje.prototype.getDayIndex=function(e){var e=Pe({},e,null,!0),t=gOe(e[this.parent.eventFields.startTime]),i=(this.parent.activeViewOptions.timeScale.enable&&!e[this.parent.eventFields.isAllDay]&&(i=this.parent.activeView.getStartHour(),t.setMilliseconds(i.getTime()-gOe(i).getTime())),t.getTime()),t="",t="."+(this.parent.activeViewOptions.timeScale.enable&&e[this.parent.eventFields.isAllDay]?F2e:JOe)+'[data-date="'+i+'"]';return 0<this.parent.activeViewOptions.group.resources.length&&(t=t+'[data-group-index="'+this.actionObj.groupIndex+'"]'),this.targetTd=this.parent.element.querySelector(t),je(this.targetTd)?-1:this.targetTd.cellIndex},Uje.prototype.updateEventHeight=function(e,t,i){this.verticalEvent.initializeValues();var n=this.verticalEvent.getStartCount();if(!this.parent.uiStateValues.isGroupAdaptive)for(var o=0;o<this.actionObj.groupIndex;o++)this.verticalEvent.dateRender[parseInt(o.toString(),10)]&&(n+=this.verticalEvent.dateRender[parseInt(o.toString(),10)].length);var r=this.parent.uiStateValues.isGroupAdaptive?n:this.actionObj.groupIndex;if(!(!this.parent.activeViewOptions.group.byDate||je(this.parent.getDateFromElement(this.actionObj.target)))||!this.parent.activeViewOptions.group.byDate)for(var s,a,l,h,d,p=-1,c=this.parent.activeViewOptions.group.byDate?this.parent.getIndexOfDate(this.verticalEvent.dateRender[parseInt(r.toString(),10)],gOe(this.parent.getDateFromElement(je(t)?this.actionObj.target:this.targetTd))):je(t)?this.actionObj.index-n:i-n,i=this.splitEvent(e),u=this.parent.eventBase.isAllDayAppointment(e)||2<i.length||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement?[e]:i,o=0;o<u.length;o++)0<o&&(s='.e-day-wrapper[data-date="'+gOe(u[parseInt(o.toString(),10)][this.parent.eventFields.startTime]).getTime()+'"]',0<this.parent.activeViewOptions.group.resources.length&&(s=s.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]')),(s=this.parent.element.querySelector(s))?(c+=1,p=s.cellIndex):c=-1),0<=c&&(l=(s=this.verticalEvent.isSpannedEvent(u[parseInt(o.toString(),10)],c,r))[this.verticalEvent.fields.startTime],h=s[this.verticalEvent.fields.endTime],h=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getHeight(l,h):this.actionObj.element.offsetHeight,l=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getTopValue(l):this.actionObj.element.offsetTop,je(t)?0===o?(this.actionObj.clone.style.top=T(l),this.actionObj.clone.style.height=T(h)):this.renderSpannedEvents(s,p,l,h):(a=this.actionObj.cellWidth,e[this.parent.eventFields.isAllDay]&&(l=this.parent.element.querySelector("."+XOe).offsetTop,h=this.getAllDayEventHeight(),d=e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime(),0<=(d=Math.ceil(d/864e5)))&&(a=d*this.actionObj.cellWidth),this.actionObj.cloneElement[parseInt(t.toString(),10)]&&(0===o?(this.actionObj.cloneElement[parseInt(t.toString(),10)].style.top=T(l),this.actionObj.cloneElement[parseInt(t.toString(),10)].style.height=T(h),this.actionObj.cloneElement[parseInt(t.toString(),10)].style.width=T(a),this.actionObj.cloneElement[parseInt(t.toString(),10)].style.left=T(0)):this.renderSpannedEvents(s,p,l,h))))},Uje.prototype.renderSpannedEvents=function(e,t,i,n){e[this.parent.eventFields.startTime].getTime()!==e[this.parent.eventFields.endTime].getTime()&&(U([e=this.verticalEvent.createAppointmentElement(e,!1,e.isSpanned,this.actionObj.groupIndex)],[C2e,"e-dynamic-clone"]),gt(e,{width:"100%",height:n+"px",top:i+"px",border:"0px"}),[].slice.call(this.parent.element.querySelectorAll("."+LNe))[parseInt(t.toString(),10)].appendChild(e))},Uje.prototype.getRenderedDates=function(){var e,t=this,i=this.parent.activeView.renderDates;return(e=this.parent.eventBase.slots).push.apply(e,this.parent.activeView.renderDates.map(function(e){return+e})),0<this.parent.activeViewOptions.group.resources.length&&(this.parent.eventBase.slots=[],i=this.parent.resourceBase.lastResourceLevel.filter(function(e){return e.groupIndex===t.actionObj.groupIndex})[0].renderDates,(e=this.parent.eventBase.slots).push.apply(e,i.map(function(e){return+e}))),i},Uje.prototype.updateAllDayEvents=function(e,t,i){this.parent.eventBase.slots=[];var e=this.getUpdatedEvent(e,t,this.actionObj.event),t=this.getRenderedDates(),e=this.parent.eventBase.splitEvent(e,t),t='.e-all-day-cells[data-date="'+e[0][this.parent.eventFields.startTime].getTime()+'"]',t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(t=t.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]')),[].slice.call(this.parent.element.querySelectorAll(t)));(0<t.length||!je(i))&&(t=je(i)?t[0].cellIndex:i,this.appendCloneElement(this.getEventWrapper(t)),this.actionObj.clone.style.width=T(e[0].data.count*this.actionObj.cellWidth))},Uje.prototype.swapDragging=function(e){if(!this.isPreventMultiDrag){var t=!je(z(this.actionObj.target,"td"))&&z(this.actionObj.target,"td").cellIndex;if(z(this.actionObj.target,"."+eNe)&&!z(this.actionObj.clone,"."+F2e)){U([this.actionObj.clone],L2e),this.appendCloneElement(this.getEventWrapper(t)),this.actionObj.isAllDay=!0;var i=this.getAllDayEventHeight(),n=[].slice.call(this.parent.element.querySelectorAll("."+YOe+":first-child"));if(n[0].offsetHeight<i)for(var o=0,r=n;o<r.length;o++)r[o].style.height=(i+2)/12+"em";gt(this.actionObj.clone,{width:T(this.actionObj.cellWidth),height:T(i),top:T(this.parent.element.querySelector("."+XOe).offsetTop)})}z(this.actionObj.target,"."+JOe)&&!z(this.actionObj.clone,"."+ONe)&&(q([this.actionObj.clone],L2e),this.appendCloneElement(this.getEventWrapper(t)),this.actionObj.isAllDay=!1,n=0===this.actionObj.element.offsetHeight?this.actionObj.height:this.actionObj.element.offsetHeight,gt(this.actionObj.clone,{left:T(0),height:T(n),width:T(this.actionObj.cellWidth)}))}},Uje.prototype.calculateVerticalDate=function(e){if(!(je(e.target)||e.target&&je(z(e.target,"tr"))||e.target&&"DIV"===e.target.tagName)){var t,e=Pe({},this.actionObj.event,null,!0),i=(je(this.parent.eventDragArea)&&this.removeCloneElement(),BOe(e[this.parent.eventFields.endTime])-BOe(e[this.parent.eventFields.startTime])),n=z(this.actionObj.target,"td"),e=(je(n)||(t=n.parentElement,this.actionObj.index=t.rowIndex*t.children.length+n.cellIndex,n=[].slice.call(this.parent.element.querySelectorAll("."+JOe))[this.actionObj.index],je(t=this.parent.getDateFromElement(n)))||(0<this.parent.activeViewOptions.group.resources.length&&(this.actionObj.groupIndex=parseInt(n.getAttribute("data-group-index"),10)),n=new Date(t.setDate(t.getDate()-this.daysVariation)),t=new Date(n.getTime()),s=BOe(e[this.parent.eventFields.startTime])-BOe(gOe(new Date(+e[this.parent.eventFields.startTime]))),t.setMilliseconds(s),(n=new Date(t.getTime())).setMilliseconds(i),this.actionObj.start=new Date(t.getTime()),this.actionObj.end=new Date(n.getTime())),this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event));if(je(this.parent.eventDragArea))for(var o=0,r=[].slice.call(this.parent.element.querySelectorAll("."+C2e));o<r.length;o++)ue(r[o]);if(this.multiData&&0<this.multiData.length){var i=gOe(new Date(e[this.parent.eventFields.startTime])),s=i.getTime()-this.startTime;"TimelineYear"===this.parent.currentView&&0<this.parent.group.resources.length&&(s=12*(i.getFullYear()-new Date(this.startTime).getFullYear()),s=(s-=new Date(this.startTime).getMonth())+i.getMonth());for(var a=0;a<this.multiData.length;a++)this.updatedData[parseInt(a.toString(),10)]=this.updateMultipleVerticalDate(this.multiData[parseInt(a.toString(),10)],s),"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(this.updatedData[parseInt(a.toString(),10)]):this.dynamicEventsRendering(this.updatedData[parseInt(a.toString(),10)])}else"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(e):this.dynamicEventsRendering(e)}},Uje.prototype.updateMultipleVerticalDate=function(e,t){var e=Pe({},e,null,!0),i=e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime(),n=new Date(e[this.parent.eventFields.startTime]);return"TimelineYear"===this.parent.currentView&&0<this.parent.group.resources.length?e[this.parent.eventFields.startTime]=new Date(n.setMonth(n.getMonth()+t)):(t=Math.ceil(t/iOe),e[this.parent.eventFields.startTime]=new Date(n.setDate(n.getDate()+t))),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+i),e},Uje.prototype.calculateTimelineTime=function(e){var t,i=Pe({},this.actionObj.event,null,!0),n=BOe(i[this.parent.eventFields.endTime])-BOe(i[this.parent.eventFields.startTime]),o=this.parent.enableRtl?Math.abs(this.actionObj.clone.offsetLeft)-this.actionObj.clone.offsetWidth:parseInt(this.actionObj.clone.style.left,10),o=Math.round(o/this.actionObj.cellWidth)*this.actionObj.cellWidth,r=(this.parent.enableRtl&&(r=Math.abs(parseInt(this.actionObj.clone.style.right,10)),this.actionObj.clone.style.right=T(r)),o=this.getOffsetValue(o,r),this.getColumnIndex(o)),s=this.parent.element.querySelector("."+i2e),a=s.getBoundingClientRect().right,a=this.parent.activeView.isTimelineView()&&!this.parent.enableRtl&&this.actionObj.pageX>this.actionObj.clone.getBoundingClientRect().right&&!this.isMorePopupOpened&&!(this.actionObj.pageX>a),s=this.parent.eventDragArea?s.scrollLeft-s.offsetLeft:0,s=(!this.isCursorAhead&&!a||this.isStepDragging||(this.isCursorAhead=!0),Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().left+s)/this.actionObj.cellWidth)),o=(this.parent.enableRtl&&(s=Math.abs(Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().right)/this.actionObj.cellWidth))-1),this.cursorPointIndex<0&&this.cursorIndex(e,i,o,s),this.parent.getContentTable().querySelector("tr")),r=(r=this.getCursorCurrentIndex(r,s,o))<0?0:r,l=this.isHeaderRows?new Date(this.timelineEventModule.dateRender[parseInt(r.toString(),10)].getTime()):this.parent.getDateFromElement(o.children[parseInt(r.toString(),10)]),h=(l=this.isAllDayDrag?gOe(l):l,this.isStepDragging?0!==(s=this.getWidthDiff(o,r))?(o=Math.ceil(s/this.widthPerMinute),l.setMinutes(l.getMinutes()+o*this.actionObj.interval),this.isCursorAhead||a?l.setMilliseconds(-n):(l.setMinutes(l.getMinutes()-this.minDiff),r=6e4*this.actionObj.interval,o=Math.abs(l.getTime()-this.actionObj.start.getTime())/r,(s=Math.trunc(o))!==o&&(o=s*r*(l>this.actionObj.start?1:-1),l=new Date(this.actionObj.start.getTime()+o)))):l=this.actionObj.start:!this.isCursorAhead&&!a||this.isAllDayDrag?l.setMinutes(l.getMinutes()-this.cursorPointIndex*(this.isTimelineDayProcess||this.isAllDayDrag?1440:this.actionObj.slotInterval)):(s=this.isTimelineDayProcess||this.isAllDayDrag?1440:this.actionObj.slotInterval,l.setMinutes(l.getMinutes()+s),l.setMilliseconds(-n),l.getTime()===gOe(l).getTime()&&0===l.getMinutes()&&0==n&&l.setMinutes(-s)),this.isStepDragging||(l=this.calculateIntervalTime(l)),(this.isTimelineDayProcess||this.isAllDayDrag)&&(t=i[this.parent.eventFields.startTime],l.setHours(t.getHours(),t.getMinutes(),t.getSeconds())),!this.parent.eventDragArea||je(r=this.parent.getDateFromElement(e.target))||(l=this.parent.activeViewOptions.timeScale.enable&&"TimelineMonth"!==this.parent.currentView?r:(t=i[this.parent.eventFields.startTime],new Date(r.setHours(t.getHours(),t.getMinutes(),t.getSeconds())))),new Date(l.getTime())),d=(h.setMilliseconds(n),[this.getUpdatedEvent(l,h,this.actionObj.event)]);if(0<this.multiData.length){for(var p=d[0][this.parent.eventFields.startTime].getTime()-this.startTime,c=0;c<this.multiData.length;c++)this.updatedData[parseInt(c.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(c.toString(),10)],p);d=this.updatedData}for(var u=0;u<d.length;u++){var g,m,f,y,v=0<this.multiData.length?this.actionObj.cloneElement[parseInt(u.toString(),10)]:this.actionObj.clone;je(this.parent.eventDragArea)&&(m=(g=this.timelineEventModule.splitEvent(d[parseInt(u.toString(),10)],this.timelineEventModule.dateRender))[0].data,y=this.timelineEventModule.getStartTime(g[0],m),g=this.timelineEventModule.getEndTime(g[0],m),m=this.timelineEventModule.getEventWidth(y,g,i[this.parent.eventFields.isAllDay],m.count),f=this.parent.getIndexOfDate(this.timelineEventModule.dateRender,gOe(new Date(y.getTime()))),y=this.timelineEventModule.getPosition(y,g,i[this.parent.eventFields.isAllDay],f=f<0?0:f),this.parent.enableRtl?v.style.right=T(y):v.style.left=T(y),this.isMorePopupOpened||(v.style.width=T(m))),0<this.parent.activeViewOptions.group.resources.length&&this.calculateResourceGroupingPosition(e,v),this.actionObj.start=new Date(l.getTime()),this.actionObj.end=new Date(h.getTime()),this.updateTimePosition(this.actionObj.start,this.updatedData)}},Uje.prototype.getOffsetValue=function(e,t){var i;return(this.scrollEdges.left||this.scrollEdges.right)&&(i=this.parent.element.querySelector("."+i2e),this.parent.enableRtl?(t=i.offsetWidth-i.scrollLeft,this.scrollEdges.right?t=t-i.offsetWidth+this.actionObj.clone.offsetWidth-(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint):(t+=this.widthUptoCursorPoint)-this.widthUptoCursorPoint>=i.scrollWidth&&(this.actionObj.clone.style.width=T(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint+this.actionObj.cellWidth),t=i.scrollLeft-i.scrollWidth),je(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=T(t))):(this.scrollEdges.left?(e=i.scrollLeft-this.widthUptoCursorPoint+this.actionObj.cellWidth,i.scrollLeft+i.offsetWidth>=i.offsetWidth?i.scrollLeft=i.scrollLeft-1:0===this.actionObj.clone.offsetLeft&&(e=i.scrollLeft)):e=i.scrollLeft+i.offsetWidth-this.actionObj.clone.offsetWidth+(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint),e=e<0?0:e,je(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=T(e)))),e},Uje.prototype.getWidthDiff=function(e,t){var i=this.scrollArgs.element.getBoundingClientRect();return i.left<=this.actionObj.pageX&&i.right>=this.actionObj.pageX?(e=e.children[parseInt(t.toString(),10)].offsetLeft,t=this.actionObj.pageX-i.left,this.parent.enableRtl?e+this.actionObj.cellWidth-(this.scrollArgs.element.scrollLeft+t):this.scrollArgs.element.scrollLeft+t-e):0},Uje.prototype.getColumnIndex=function(e){e=Math.round(e/this.actionObj.cellWidth);return this.isHeaderRows?e:this.getIndex(e)},Uje.prototype.getCursorCurrentIndex=function(e,t,i){e+=t;return this.isHeaderRows?(t=Math.floor(i.offsetWidth/this.actionObj.cellWidth))-1<e?t-1:e:e>i.children.length-1?i.children.length-1:e},Uje.prototype.cursorIndex=function(e,t,i,n){var e=z(e.target,".e-work-cells");je(e)||this.isMorePopupOpened?this.cursorPointIndex=0:(e=this.parent.getDateFromElement(e),e=this.isAllDayDrag?gOe(e):e,this.isHeaderRows&&(i=Math.floor(i/this.actionObj.cellWidth),e=new Date(this.timelineEventModule.dateRender[i+n].getTime())),i=e.getTime()-t[this.parent.eventFields.startTime].getTime(),this.isTimelineDayProcess||this.isAllDayDrag?this.cursorPointIndex=Math.abs(Math.ceil(i/iOe)):(n=Math.floor(i/6e4/(this.actionObj.slotInterval/this.actionObj.cellWidth)),this.cursorPointIndex=Math.floor(n/this.actionObj.cellWidth),this.cursorPointIndex=this.cursorPointIndex<0?0:this.cursorPointIndex))},Uje.prototype.calculateResourceGroupingPosition=function(e,t){var i=this.parent.element.querySelector("."+i2e),n=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap .e-content-table tr:not(.e-hidden)")),o=je(o=rOe(i.querySelector("table")))?0:o,r=this.parent.rowAutoHeight?~~(i.querySelector("table").offsetHeight/n.length):this.actionObj.cellHeight,o=(o=Math.floor(Math.floor(this.actionObj.Y+(i.scrollTop-o-(window.scrollY||window.pageYOffset))-VOe(i,this.parent.uiStateValues.isTransformed))/r))<0?0:o>n.length-1?n.length-1:o,i=(this.actionObj.index=o,this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(o)),r=i.querySelector("."+LNe),i=(r||(r=Q("div",{className:LNe}),i.appendChild(r)),this.appendCloneElement(r,t),z(this.actionObj.target,"td"));this.actionObj.groupIndex=i&&!isNaN(parseInt(i.getAttribute("data-group-index"),10))?parseInt(i.getAttribute("data-group-index"),10):this.actionObj.groupIndex,je(this.parent.eventDragArea)&&(r=this.parent.getElementHeight(n[parseInt(o.toString(),10)])*o,this.parent.rowAutoHeight&&(i=this.getCursorElement(e))&&(r=i.classList.contains(JOe)?i.offsetTop:i.offsetParent&&i.offsetParent.classList.contains(qNe)?i.offsetParent.offsetTop:r),t.style.top=T(r))},Uje.prototype.appendCloneElement=function(e,t){t=je(t=void 0===t?null:t)?this.actionObj.clone:t;var i=document.querySelector(this.parent.eventDragArea);(this.parent.eventDragArea&&i?i:e).appendChild(t)},Uje.prototype.getEventWrapper=function(e,t){var i;return je(t)&&(t=this.actionObj.clone.classList.contains(L2e)),this.parent.activeViewOptions.timeScale.enable?i=this.parent.element.querySelectorAll(t?"."+F2e:"."+LNe).item(e):(i=(t=this.parent.element.querySelectorAll("."+JOe).item(e)).querySelector("."+LNe))||(i=Q("div",{className:LNe}),t.appendChild(i)),i},Uje.prototype.getAllDayEventHeight=function(){var e=Q("div",{className:qNe}),t=(this.parent.element.querySelector("."+F2e).appendChild(e),e.offsetHeight);return ue(e),t},Uje.prototype.isAllowDrop=function(e){if(!this.actionObj.excludeSelectors)return!1;for(var t=!1,i=0,n=this.actionObj.excludeSelectors.split(",");i<n.length;i++){var o=n[i];if(e.target.classList.contains(o)){t=!0;break}}return t},Uje.prototype.getModuleName=function(){return"dragAndDrop"};var Wje,Qje,d2=Uje;function Uje(){var e=null!==Qje&&Qje.apply(this,arguments)||this;return e.widthUptoCursorPoint=0,e.heightUptoCursorPoint=0,e.cursorPointIndex=0,e.isHeaderRows=!1,e.isTimelineDayProcess=!1,e.widthPerMinute=0,e.heightPerMinute=0,e.minDiff=0,e.isStepDragging=!1,e.isMorePopupOpened=!1,e.isAllDayDrag=!1,e.isMultiSelect=!1,e.multiData=[],e.updatedData=[],e.swagData=[],e.startTime=0,e.isAllDayTarget=!1,e.targetTd=null,e.isCursorAhead=!1,e.enableCurrentViewDrag=!1,e.isPreventMultiDrag=!1,e.slotsUptoCursor=-1,e.eleTop=0,e.distanceUptoCursor=0,e}qje.prototype.isTimelineView=function(){return-1!==this.parent.currentView.indexOf("Timeline")},qje.prototype.getContentRows=function(){return[]},qje.prototype.refreshHeader=function(){},qje.prototype.refreshResourceHeader=function(){var e=this.element.querySelector("."+yNe),t=Array.from(e.querySelectorAll("."+ANe)),i=(t.forEach(function(e){Array.from(e.children).forEach(function(e){e.classList.contains(wNe)||e.classList.contains(CNe)||ue(e)})}),this.parent.resourceBase.renderedResources);if(!je(i)&&0<i.length)for(var n=0;n<t.length;n++){var o=t[parseInt(n.toString(),10)],r=i[parseInt(n.toString(),10)];!this.parent.activeView||je(o)||je(r)||parseInt(o.getAttribute("data-group-index"),10)!==r.groupIndex||this.parent.activeView.setResourceHeaderContent(o,r,mNe)}this.parent.renderTemplates(),this.parent.notify(YRe,{})},qje.prototype.getDayName=function(e){return this.parent.getDayNames("abbreviated")[e.getDay()]},qje.prototype.getDate=function(e){return this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})},qje.prototype.getTime=function(e){return this.parent.isAdaptive?"HH:mm"===this.parent.activeViewOptions.timeFormat||"HH.mm"===this.parent.activeViewOptions.timeFormat?this.parent.globalize.formatDate(e,{format:"H",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e,{skeleton:"h",calendar:this.parent.getCalendarMode()}):this.parent.getTimeString(e)},qje.prototype.getTimelineDate=function(e){return ROe(this.parent.globalize.formatDate(e,{skeleton:"MMMd",calendar:this.parent.getCalendarMode()})+", "+this.parent.getDayNames("wide")[e.getDay()],"multiple")},qje.prototype.createEventTable=function(e){var t=Q("div",{className:uNe});return ht(this.getEventRows(e),t),t},qje.prototype.getEventRows=function(e){for(var t,i=[],n=0;n<e;n++)t=Q("div",{className:UNe}),this.parent.resourceBase&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderedResources&&t.setAttribute("data-group-index",this.parent.resourceBase.renderedResources[parseInt(n.toString(),10)].groupIndex.toString()),i.push(t);return i},qje.prototype.collapseRows=function(e){0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.resourceBase.hideResourceRows(e.querySelector("tbody")),this.parent.resourceBase.hideResourceRows(e.querySelector("."+uNe)))},qje.prototype.createTableLayout=function(e){var e=Q("table",{className:GOe+" "+(e||"")}),t=Q("tbody");return e.appendChild(t),e},qje.prototype.setAriaAttributes=function(e){e.setAttribute("role","grid"),"Year"!==this.parent.currentView&&e.setAttribute("id",this.parent.element.id+"_table"),e.setAttribute("aria-label",this.getLabelText(this.parent.currentView))},qje.prototype.createColGroup=function(e,t){if(!je(t)){for(var i=t.length,n=(t[0]&&t[0].colSpan&&(i=t.map(function(e){return e.colSpan}).reduce(function(e,t){return e+t})),Q("colgroup")),o=0;o<i;o++)n.appendChild(Q("col"));lt([n],e)}},qje.prototype.getScrollXIndent=function(e){return 0<e.offsetHeight-e.clientHeight?TOe():0},qje.prototype.scrollTopPanel=function(e){this.getDatesHeaderElement().firstElementChild.scrollLeft=e.scrollLeft},qje.prototype.scrollHeaderLabels=function(e){for(var t=this.element.querySelector(".e-date-header-wrap table"),i=t.offsetWidth/t.querySelectorAll("colgroup col").length,n=0,o=[".e-header-year-cell",".e-header-month-cell",".e-header-week-cell",".e-header-cells"];n<o.length;n++){var r=[].slice.call(this.element.querySelectorAll(o[n]));if(0<r.length){for(var s=0,a=r;s<a.length;s++)a[s].children[0].style[this.parent.enableRtl?"right":"left"]="";m=g=u=c=p=d=l=void 0;for(var l,h=this.parent.enableRtl,d=0,p=0,c=h?-e.scrollLeft:e.scrollLeft,u=0,g=r;u<g.length;u++){var m=g[u];if((p+=parseInt(m.getAttribute("colSpan"),10))>Math.floor(c/i)){l=m;break}d+=m.offsetWidth}je(l)||(l.children[0].style[h?"right":"left"]=c-d+"px")}}},qje.prototype.addAttributes=function(e,t){e.template&&ht(e.template,t),e.colSpan&&t.setAttribute("colspan",e.colSpan.toString()),e.className&&U([t],e.className)},qje.prototype.getHeaderBarHeight=function(){var e,t=2;return this.parent.headerModule&&(t+=MOe(this.parent.headerModule.getHeaderElement())),this.parent.uiStateValues.isGroupAdaptive&&(e=this.parent.element.querySelector("."+_Ne))&&(t+=e.offsetHeight),t},qje.prototype.renderPanel=function(e){e===lNe?lt([this.element],this.parent.element.querySelector("."+qOe)):this.parent.element.querySelector("."+qOe).appendChild(this.element)},qje.prototype.setPanel=function(e){this.element=e},qje.prototype.getPanel=function(){return this.element},qje.prototype.getDatesHeaderElement=function(){return this.element.querySelector("."+tNe)},qje.prototype.getDateSlots=function(e,t){return[]},qje.prototype.generateColumnLevels=function(){return[]},qje.prototype.getColumnLevels=function(){return this.colLevels},qje.prototype.highlightCurrentTime=function(){},qje.prototype.getStartDate=function(){return this.renderDates[0]},qje.prototype.getEndDate=function(){return this.renderDates[this.renderDates.length-1]},qje.prototype.startDate=function(){return this.renderDates[0]},qje.prototype.endDate=function(){return yOe(this.renderDates[this.renderDates.length-1],1)},qje.prototype.getStartHour=function(){var e=this.parent.getStartEndTime(this.parent.activeViewOptions.startHour);return e=je(e)?new Date(2e3,0,0,0):e},qje.prototype.getEndHour=function(){var e=this.parent.getStartEndTime(this.parent.activeViewOptions.endHour);return e=je(e)?new Date(2e3,0,0,0):e},qje.prototype.isCurrentDate=function(e){return e.setHours(0,0,0,0)===new Date(this.parent.currentTimezoneDate).setHours(0,0,0,0)},qje.prototype.isCurrentMonth=function(e){return this.parent.activeViewOptions.displayDate||0<this.parent.activeViewOptions.numberOfWeeks?this.parent.activeView.getStartDate().getTime()<=this.parent.getCurrentTime().getTime()&&this.parent.activeView.getEndDate().getTime()>=this.parent.getCurrentTime().getTime():e.getFullYear()===this.parent.getCurrentTime().getFullYear()&&e.getMonth()===this.parent.getCurrentTime().getMonth()},qje.prototype.isWorkDay=function(e,t){return!je(t=void 0===t?this.parent.activeViewOptions.workDays:t)&&0<=t.indexOf(e.getDay())},qje.prototype.isWorkHour=function(e,t,i,n){return!(je(t)||je(i)||(t.setMilliseconds(0),i.setMilliseconds(0),gOe(e).getTime()!==gOe(t).getTime()&&(t=new Date(2e3,0,0,t.getHours(),t.getMinutes(),t.getMilliseconds()),i=new Date(2e3,0,0,i.getHours(),i.getMinutes(),i.getMilliseconds())),mOe(e)<mOe(t))||mOe(e)>=mOe(i)||!this.isWorkDay(e,n))},qje.prototype.getRenderDates=function(e,t){void 0===t&&(t=this.parent.selectedDate);var i=[];if("Week"===this.parent.currentView||"TimelineWeek"===this.parent.currentView)for(var n=aOe(gOe(t),this.parent.activeViewOptions.firstDayOfWeek),o=0,r=7*this.parent.activeViewOptions.interval;o<r;o++)(this.parent.activeViewOptions.showWeekend||this.isWorkDay(n,e))&&i.push(n),n=yOe(n,1);else if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView)for(var n=aOe(gOe(t),this.parent.activeViewOptions.firstDayOfWeek),o=0,s=7*this.parent.activeViewOptions.interval;o<s;o++)this.isWorkDay(n,e)&&i.push(n),n=yOe(n,1);else for(var a="Agenda"===this.parent.currentView?this.parent.agendaDaysCount:this.parent.activeViewOptions.interval,n=gOe(t);(this.parent.activeViewOptions.showWeekend||this.isWorkDay(n,e))&&i.push(n),n=yOe(n,1),a!==i.length;);return e||(this.renderDates=i),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),i},qje.prototype.getNextPreviousDate=function(e){if(this.previousNextAction=e,"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView){var t;if(this.parent.activeViewOptions.showWeekend)return t=this.parent.activeViewOptions.interval,yOe(this.parent.selectedDate,"Next"===e?t:-t);var i=void 0;if("Next"===e)for(i=yOe(this.renderDates.slice(-1)[0],1);!this.isWorkDay(i);)i=yOe(i,1);else for(var i=yOe(this.renderDates[0],-1),n=0;this.isWorkDay(i)&&(n+=1),this.parent.activeViewOptions.interval!==n&&(i=yOe(i,-1)),this.parent.activeViewOptions.interval!==n;);return i}return yOe(this.parent.selectedDate,("Next"===e?7:-7)*this.parent.activeViewOptions.interval)},qje.prototype.formatViewLabel=function(e,t,i){var n={type:"date",skeleton:"full",calendar:this.parent.getCalendarMode()};return this.parent.localeObj.getConstant(e)+" "+this.parent.localeObj.getConstant("start")+" "+this.parent.globalize.formatDate(t,n)+" "+this.parent.localeObj.getConstant("endAt")+" "+this.parent.globalize.formatDate(i,n)},qje.prototype.getLabelText=function(e){var t=e.charAt(0).toLowerCase()+e.substring(1);return"Year"===e||"TimelineYear"===e?this.formatViewLabel(t,this.parent.activeView.getStartDate(),this.parent.activeView.getEndDate()):0<this.renderDates.length?"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView?this.parent.localeObj.getConstant(t)+" of "+ROe(this.parent.globalize.formatDate(this.parent.selectedDate,{type:"date",skeleton:"full",calendar:this.parent.getCalendarMode()}),"single"):this.formatViewLabel(t,this.renderDates[0],this.renderDates[this.renderDates.length-1]):""},qje.prototype.getDateRangeText=function(e,t){var i;return void 0===e&&(e=this.renderDates[0]),void 0===t&&(t=this.renderDates),this.parent.isAdaptive?(i=this.parent.activeViewOptions.dateFormat||"MMMM y",ROe(this.parent.globalize.formatDate(this.parent.selectedDate,{format:i,calendar:this.parent.getCalendarMode()}),"single")):this.formatDateRange(e,t[t.length-1])},qje.prototype.formatDateRange=function(e,t){var i,n,o=this.parent.globalize,r=this.parent.getCalendarMode();return e===t&&(t=null),je(this.parent.activeViewOptions.dateFormat)?(n=je(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?R("dateFormats.long",Pi(r)):R("main."+this.parent.locale+".dates.calendars."+r+".dateFormats.long",Ai),t?ROe("d"===(i=n.trim().toLocaleLowerCase()).substr(0,1)?e.getFullYear()===t.getFullYear()?e.getMonth()===t.getMonth()?o.formatDate(e,{format:"dd",calendar:r})+" - "+o.formatDate(t,{format:"dd MMMM yyyy",calendar:r}):o.formatDate(e,{format:"dd MMM",calendar:r})+" - "+o.formatDate(t,{format:"dd MMM yyyy",calendar:r}):o.formatDate(e,{format:"dd MMM yyyy",calendar:r})+" - "+o.formatDate(t,{format:"dd MMM yyyy",calendar:r}):"m"===i.substr(0,1)?e.getFullYear()===t.getFullYear()?e.getMonth()===t.getMonth()?o.formatDate(e,{format:"MMMM dd",calendar:r})+" - "+o.formatDate(t,{format:"dd, yyyy",calendar:r}):o.formatDate(e,{format:"MMM dd",calendar:r})+" - "+o.formatDate(t,{format:"MMM dd, yyyy",calendar:r}):o.formatDate(e,{format:"MMM dd, yyyy",calendar:r})+" - "+o.formatDate(t,{format:"MMM dd, yyyy",calendar:r}):o.formatDate(e,{format:n,calendar:r})+" - "+o.formatDate(t,{format:n,calendar:r}),"multiple"):ROe(o.formatDate(e,{format:n,calendar:r}),"single")):ROe(t?o.formatDate(e,{format:this.parent.activeViewOptions.dateFormat,calendar:r})+" - "+o.formatDate(t,{format:this.parent.activeViewOptions.dateFormat,calendar:r}):o.formatDate(e,{format:this.parent.activeViewOptions.dateFormat,calendar:r}),"multiple")},qje.prototype.getMobileDateElement=function(e,t){return Q("div",{className:t,innerHTML:'<div class="e-m-date">'+this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})+'</div><div class="e-m-day">'+ROe(this.parent.globalize.formatDate(e,{format:"E",calendar:this.parent.getCalendarMode()}),"single")+"</div>"})},qje.prototype.setResourceHeaderContent=function(e,t,i){var n,o;void 0===i&&(i=J2e),this.parent.activeViewOptions.resourceHeaderTemplate?(o={resource:t.resource,resourceData:t.resourceData},n=this.parent.element.id+"_"+this.parent.activeViewOptions.resourceHeaderTemplateName+"resourceHeaderTemplate",ht([].slice.call(this.parent.getResourceHeaderTemplate()(o,this.parent,"resourceHeaderTemplate",n,!1,void 0,void 0,this.parent.root)),e)):(o=Q("div",{className:i}),this.parent.sanitize(t.resourceData[t.resource.textField],o),e.appendChild(o))},qje.prototype.renderResourceMobileLayout=function(){this.parent.resourceBase.lastResourceLevel&&this.parent.resourceBase.lastResourceLevel.length<=0||(this.parent.resourceBase.renderResourceHeader(),this.parent.resourceBase.renderResourceTree())},qje.prototype.addAutoHeightClass=function(e){!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&U([e],r_e)},qje.prototype.getColElements=function(){return[].slice.call(this.element.querySelectorAll("."+i2e+" col, ."+eNe+" col"))},qje.prototype.setColWidth=function(e){var t,i,n;this.isTimelineView()&&(t=this.getColElements(),n=this.element.querySelector("."+KOe+" tbody"),i=this.parent.getElementWidth(n)/(t.length/2),e.offsetHeight===e.clientHeight||je(n=this.parent.element.querySelector("."+fNe))||n.offsetHeight===e.clientHeight||gt(n,{height:T(e.clientHeight)}),[].slice.call(this.element.querySelectorAll(".e-header-cells,.e-time-slots,.e-header-week-cell,.e-header-month-cell,.e-header-year-cell")).forEach(function(e){var t=je(e.getAttribute("colspan"))?"1":e.getAttribute("colspan"),t=parseInt(t,10);gt(e,{width:T(i*t)})}))},qje.prototype.resetColWidth=function(){for(var e=0,t=this.getColElements();e<t.length;e++)t[e].style.width=""},qje.prototype.getContentAreaElement=function(){return this.element.querySelector("."+i2e)},qje.prototype.wireExpandCollapseIconEvents=function(){if(this.parent.resourceBase&&1<this.parent.resourceBase.resourceCollection.length)for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+SNe));e<t.length;e++){var i=t[e];E.clearEvents(i),E.add(i,"click",this.parent.resourceBase.onTreeIconClick,this.parent.resourceBase)}},qje.prototype.scrollToDate=function(e){var t;-1===["Month","TimelineMonth"].indexOf(this.parent.currentView)||je(e)||(t=this.getContentAreaElement(),e=new Date(gOe(new Date(+e)).getTime()).getTime(),e=t.querySelector("."+JOe+'[data-date="'+e+'"]'),"Month"===this.parent.currentView&&e&&(t.scrollWidth>t.clientWidth&&(this.parent.enableRtl?t.scrollLeft=-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):t.scrollLeft=e.offsetLeft),t.scrollTop=e.offsetTop),"TimelineMonth"===this.parent.currentView&&e&&(this.parent.enableRtl?t.scrollLeft=-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):t.scrollLeft=e.offsetLeft))},qje.prototype.setPersistence=function(){var e;this.parent.enablePersistence&&!je(e=this.element.querySelector(".e-content-wrap"))&&(this.parent.scrollLeft=e.scrollLeft,this.parent.scrollTop=e.scrollTop)},qje.prototype.retainScrollPosition=function(){var e;!this.parent.enablePersistence||je(e=this.parent.element.querySelector(".e-content-wrap"))||je(this.parent.scrollLeft)||je(this.parent.scrollTop)||(e.scrollTop=this.parent.scrollTop,e.scrollLeft=this.parent.scrollLeft)},qje.prototype.getViewStartDate=function(){var e=this.renderDates[0];return e=0<this.parent.activeViewOptions.group.resources.length&&0<this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.getResourceRenderDates()[0]:e},qje.prototype.getViewEndDate=function(){var e=yOe(this.renderDates[this.renderDates.length-1],1);return e=0<this.parent.activeViewOptions.group.resources.length&&0<this.parent.resourceBase.lastResourceLevel.length?yOe(this.parent.resourceBase.getResourceRenderDates().slice(-1)[0],1):e},qje.prototype.getAdjustedDate=function(e){return!this.parent.activeViewOptions.timeScale.enable||"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView&&0===this.parent.activeViewOptions.group.resources.length?new Date(e.setHours(0,0,0,0)):"TimelineYear"===this.parent.currentView&&0<this.parent.activeViewOptions.group.resources.length?(e.setHours(0,0,0,0),new Date(e.setDate(1))):null},qje.prototype.resetColLevels=function(){this.parent.resourceBase.expandedResources=[];for(var e=this.parent.virtualScrollModule.getRenderedCount(),t=this.parent.activeViewOptions.group.byDate?this.colLevels[0]:this.parent.resourceBase.renderedResources,i=0,n=0;n<t.length&&!(e<=i);n++)i+=t[parseInt(n.toString(),10)].colSpan,this.parent.resourceBase.expandedResources.push(t[parseInt(n.toString(),10)]);this.parent.activeViewOptions.group.byDate?(this.colLevels[0]=this.parent.resourceBase.expandedResources,this.parent.virtualScrollModule.setRenderedDates(this.parent.resourceBase.expandedResources)):(this.colLevels[this.colLevels.length-2]=this.parent.resourceBase.expandedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources),"Month"!==this.parent.currentView&&(this.colLevels[this.colLevels.length-1]=this.colLevels[this.colLevels.length-1].slice(0,i),this.parent.resourceBase.expandedResources=this.colLevels[this.colLevels.length-1])},qje.prototype.getGroupIndices=function(e){var t=[];return t=this.parent.virtualScrollModule&&0<this.parent.activeViewOptions.group.resources.length&&(e||0<this.parent.virtualScrollModule.existingDataCollection.length)&&!this.parent.uiStateValues.isGroupAdaptive?(e=je(e)?this.parent.virtualScrollModule.existingDataCollection:e).map(function(e){return e.groupIndex}):t},qje.prototype.destroy=function(){this.element&&this.element.parentNode&&ue(this.element),this.element=null,this.renderDates=null,this.colLevels=null};D2=qje;function qje(e){this.previousNextAction="Next",this.parent=e}Gje=function(e,t){return(Gje=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Gje(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Xje,Yje=D2),Xje.prototype.getModuleName=function(){return"verticalView"},Xje.prototype.addEventListener=function(){this.parent.on(JRe,this.scrollUiUpdate,this),this.parent.on(qRe,this.renderEvents,this)},Xje.prototype.removeEventListener=function(){this.parent&&(this.parent.off(JRe,this.scrollUiUpdate),this.parent.off(qRe,this.renderEvents))},Xje.prototype.renderEvents=function(){this.appointment=new(this.parent.activeViewOptions.timeScale.enable?IHe:MHe)(this.parent),this.appointment.renderAppointments(),this.parent.notify(GRe,{})},Xje.prototype.onContentScroll=function(e){this.parent.removeNewEventElement();var t=e.target;this.parent.notify(KRe,e),this.scrollLeftPanel(t),this.scrollTopPanel(t),this.parent.isAdaptive||(this.parent.uiStateValues.top=t.scrollTop),this.parent.uiStateValues.left=t.scrollLeft,je(this.parent.quickPopup)||this.parent.uiStateValues.isTapHold||this.parent.quickPopup.quickPopupHide(),this.setPersistence()},Xje.prototype.onAdaptiveMove=function(e){this.parent.uiStateValues.action&&e.preventDefault()},Xje.prototype.onAdaptiveScroll=function(e){this.parent&&!this.parent.isDestroyed&&(this.parent.removeNewEventElement(),this.parent.uiStateValues.top=e.target.scrollTop)},Xje.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();je(t)||(t.scrollTop=e.scrollTop)},Xje.prototype.scrollUiUpdate=function(e){var t,i,n,o,r;this.parent&&(r=this.parent.element.querySelector("."+eNe),o=this.getHeaderBarHeight(),t=this.getLeftPanelElement(),i=this.getScrollableElement(),n=this.getDatesHeaderElement(),o=this.parent.element.offsetHeight-o-n.offsetHeight,this.setContentHeight(i,t,o),this.setColWidth(i),o=TOe(),n.firstElementChild.style[e.cssProperties.rtlBorder]="",n.style[e.cssProperties.rtlPadding]="",r=!this.parent.enableAllDayScroll||!(i.offsetWidth-i.clientWidth<=r.offsetWidth-r.clientWidth&&r.classList.contains("e-all-day-scroll")),0<i.offsetWidth-i.clientWidth&&r?(n.firstElementChild.style[e.cssProperties.border]=0<o?"1px":"0px",n.style[e.cssProperties.padding]=0<o?o-1+"px":"0px"):(n.firstElementChild.style[e.cssProperties.border]="",n.style[e.cssProperties.padding]=""),e.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(-1<this.parent.currentView.indexOf("Timeline")&&(i.scrollTop=this.parent.uiStateValues.top),this.scrollToWorkHour(),this.parent.uiStateValues.isInitial=!1):(t&&(t.scrollTop=this.parent.uiStateValues.top),i.scrollTop=this.parent.uiStateValues.top,i.scrollLeft=this.parent.uiStateValues.left)),this.parent.activeViewOptions.timeScale.enable&&this.highlightCurrentTime(),this.retainScrollPosition(),je(t)||je(i)||t.scrollTop===i.scrollTop||(t.scrollTop=i.scrollTop))},Xje.prototype.setContentHeight=function(e,t,i){this.parent.isAdaptive&&!this.isTimelineView()||je(t)||(t.style.height="auto"===this.parent.height?"auto":T(i-this.getScrollXIndent(e))),e.style.height="auto"===this.parent.height?"auto":T(i)},Xje.prototype.scrollToWorkHour=function(){var e;this.parent.workHours.highlight&&(e=this.element.querySelector("."+ZOe))&&(this.getScrollableElement().scrollTop=e.offsetTop,this.parent.uiStateValues.top=e.offsetTop,this.parent.uiStateValues.left=0)},Xje.prototype.scrollToHour=function(e,t){var i,e=this.parent.getStartEndTime(e);je(t)||(t=this.element.querySelector("."+iNe+'[data-date="'+new Date(gOe(t)).getTime()+'"]'))&&(this.parent.enableRtl?(i=this.element.querySelector("."+KOe),this.getScrollableElement().scrollLeft=-(i.offsetWidth-t.offsetLeft-t.offsetWidth)):this.getScrollableElement().scrollLeft=t.offsetLeft),je(e)||(this.getScrollableElement().scrollTop=this.getTopFromDateTime(e))},Xje.prototype.scrollToDate=function(e){this.scrollToHour(null,e)},Xje.prototype.generateColumnLevels=function(){var e,t,i,n=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),o=[];if(0<this.parent.activeViewOptions.group.resources.length){if(o=this.parent.resourceBase.generateResourceLevels(n),this.parent.activeViewOptions.group.hideNonWorkingDays)for(;0===o[0].length;)this.parent.setProperties({selectedDate:this.parent.activeView.getNextPreviousDate(this.previousNextAction)},!0),this.parent.activeView.getRenderDates(),this.parent.headerModule&&(this.parent.headerModule.setCalendarDate(this.parent.selectedDate),this.parent.headerModule.updateDateRange()),n=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),o=this.parent.resourceBase.generateResourceLevels(n);this.parent.uiStateValues.isGroupAdaptive&&0<this.parent.resourceBase.lastResourceLevel.length&&(t=(e=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]).resourceData[e.resource.startHourField],i=e.resourceData[e.resource.endHourField],o=[this.getDateSlots(e.renderDates,e.workDays,t,i)])}else o.push(n);return this.colLevels=o},Xje.prototype.getDateSlots=function(e,t,i,n){void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end);for(var o=[],r=this.parent.getStartEndTime(i),s=this.parent.getStartEndTime(n),a=0,l=e;a<l.length;a++){var h=l[a],d=[iNe];this.isCurrentDate(h)&&d.push(rNe),o.push({date:h,type:"dateHeader",className:d,colSpan:1,workDays:t,startHour:new Date(+r),endHour:new Date(+s)})}return o},Xje.prototype.isWorkHourRange=function(e){return this.getStartHour().getTime()<=e.getTime()&&this.getEndHour().getTime()>=e.getTime()},Xje.prototype.highlightCurrentTime=function(){var e,t=this;0<this.parent.activeViewOptions.headerRows.length&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option||(e=this.parent.getCurrentTime(),this.parent.showTimeIndicator&&this.isWorkHourRange(e)&&0<this.getCurrentTimeIndicatorIndex().length&&!je(this.element.querySelector("."+JOe))?(this.changeCurrentTimePosition(),je(this.currentTimeIndicatorTimer)&&((e=6e4-(1e3*e.getSeconds()+e.getMilliseconds()))<=59e3&&window.setTimeout(function(){je(t.currentTimeIndicatorTimer)||(t.clearCurrentTimeIndicatorTimer(),t.changeCurrentTimePosition(),t.updateCurrentTimeIndicatorTimer())},e),this.updateCurrentTimeIndicatorTimer())):this.clearCurrentTimeIndicatorTimer())},Xje.prototype.getCurrentTimeIndicatorIndex=function(){var e=[];if(!je(this.parent.resourceBase)&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive){var t=0,i=gOe(this.parent.getCurrentTime());if(this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.activeViewOptions.group.byDate)for(var n=0,o=this.parent.resourceBase.expandedResources;n<o.length;n++)gOe((l=o[n]).date).getTime()===i.getTime()&&e.push(t),t+=1;else for(var r=0,s=this.parent.resourceBase.renderedResources;r<s.length;r++){var a,l=s[r];0<=(h=this.parent.getIndexOfDate(l.renderDates,i))&&(a=this.parent.activeViewOptions.group.byDate?this.parent.resourceBase.lastResourceLevel.length*h+t:t+h,e.push(a)),t+=this.parent.activeViewOptions.group.byDate?1:l.renderDates.length}}else{var h,d=(this.parent.uiStateValues.isGroupAdaptive&&0<this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]:this).renderDates;0<=(h=this.parent.getIndexOfDate(d,gOe(this.parent.getCurrentTime())))&&e.push(h)}return e},Xje.prototype.clearCurrentTimeIndicatorTimer=function(){je(this.currentTimeIndicatorTimer)||(window.clearInterval(this.currentTimeIndicatorTimer),this.currentTimeIndicatorTimer=null,this.removeCurrentTimeIndicatorElements())},Xje.prototype.updateCurrentTimeIndicatorTimer=function(){var e=this;this.currentTimeIndicatorTimer=window.setInterval(function(){e.changeCurrentTimePosition()},6e4)},Xje.prototype.removeCurrentTimeIndicatorElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-previous-timeline,.e-current-timeline,.e-current-time"));e<t.length;e++)ue(t[e])},Xje.prototype.changeCurrentTimePosition=function(){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.removeCurrentTimeIndicatorElements();var e=this.getCurrentTimeIndicatorIndex(),t=this.parent.getContentTable().rows[0],i=this.getTopFromDateTime(this.parent.getCurrentTime()),n=T(i),i=Math.floor(i/t.cells[0].offsetHeight),t=this.getLeftPanelElement(),o=[].slice.call(t.querySelectorAll("tr"));if(!je(i)&&!isNaN(i)&&i!==o.length){for(var r=[].slice.call(this.element.querySelectorAll("."+FNe)),s=0,a=e[0];s<a;s++)r[parseInt(s.toString(),10)].appendChild(Q("div",{className:kNe,styles:"top:"+n}));for(var l=0,h=e;l<h.length;l++){var d=h[l];r.length>d&&r[parseInt(d.toString(),10)].appendChild(Q("div",{className:MNe,styles:"top:"+n}))}e=Q("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:DNe,styles:"top:"+n});i<=o.length&&(q(t.querySelectorAll("."+PNe),PNe),o[parseInt(i.toString(),10)]&&U([o[parseInt(i.toString(),10)].lastElementChild],PNe),lt([e],t),e.style.top=T(e.offsetTop-e.offsetHeight/2))}}},Xje.prototype.getTopFromDateTime=function(e){var t=this.getStartEndHours(this.parent.activeViewOptions.startHour),i=this.getStartEndHours(this.parent.activeViewOptions.endHour),n=60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes()),e=wOe(gOe(new Date(e.getTime())),t,i),e=(e.endHour.getTime()-e.startHour.getTime())/6e4,o=this.parent.activeViewOptions.timeScale.interval,r=0,r=(0!==t.getHours()||0!==t.getMinutes()||0!==i.getHours()||0!==i.getMinutes())&&1===this.parent.activeViewOptions.timeScale.slotCount&&e<o?e:o;return n*this.getWorkCellHeight()*this.parent.activeViewOptions.timeScale.slotCount/r},Xje.prototype.getWorkCellHeight=function(){return parseFloat(this.parent.getElementHeight(this.element.querySelector("."+JOe)).toFixed(2))},Xje.prototype.getTdContent=function(e,t,i){var n,o,r,s=Q("div"),a="",l=this.parent.element.id+"_";switch(t){case"dateHeader":n=this.parent.activeViewOptions.dateHeaderTemplate?(a="dateHeaderTemplate",r={date:e,type:t},o=this.parent.activeViewOptions.dateHeaderTemplateName,[].slice.call(this.parent.getDateHeaderTemplate()(r,this.parent,a,l+o+a,!1,void 0,void 0,this.parent.root))):(s.innerHTML=this.parent.activeView.isTimelineView()?'<span class="e-header-date e-navigate">'+this.getTimelineDate(e)+"</span>":'<div class="e-header-day">'+ROe(this.getDayName(e),"single")+'</div><div class="e-header-date e-navigate" role="link">'+this.getDate(e)+"</div>",[].slice.call(s.childNodes));break;case"majorSlot":n=this.parent.activeViewOptions.timeScale.majorSlotTemplate?(a="majorSlotTemplate",r={date:e,type:t},[].slice.call(this.parent.getMajorSlotTemplate()(r,this.parent,a,l+a,!1,void 0,void 0,this.parent.root))):(s.innerHTML="<span>"+this.getTime(e)+"</span>",[].slice.call(s.childNodes));break;case"minorSlot":n=this.parent.activeViewOptions.timeScale.minorSlotTemplate?(a="minorSlotTemplate",r={date:e,type:t},[].slice.call(this.parent.getMinorSlotTemplate()(r,this.parent,a,l+a,!1,void 0,void 0,this.parent.root))):[].slice.call(s.childNodes);break;case"alldayCells":this.parent.activeViewOptions.cellTemplate&&(o=this.parent.activeViewOptions.cellTemplateName,a="cellTemplate",r={date:e,type:t,groupIndex:i},n=[].slice.call(this.parent.getCellTemplate()(r,this.parent,a,l+o+a,!1,void 0,void 0,this.parent.root)))}return n},Xje.prototype.refreshHeader=function(){ue(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(YRe,{});var e=this.element.querySelector("."+eNe);e&&(e.scrollLeft=this.parent.uiStateValues.left)},Xje.prototype.renderLayout=function(e){this.setPanel(Q("div",{className:e2e}));var t=[this.baseCssClass,this.viewClass];t.push(e),this.parent.activeViewOptions.group.byDate&&t.push("e-by-date"),this.parent.activeViewOptions.timeScale.enable||U([this.element],["e-timescale-disable",this.viewClass]),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&t.push(n_e),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&t.push(s_e),this.renderPanel(e),U([this.element],t),this.element.appendChild(this.createTableLayout(t2e)),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent(),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+NNe)&&this.renderResourceMobileLayout(),this.parent.notify(YRe,{})},Xje.prototype.renderHeader=function(){var e,t=Q("tr"),i=Q("td");i.appendChild(this.renderDatesHeader()),this.parent.activeViewOptions.timeScale.enable&&((e=Q("td",{className:pNe})).appendChild(this.renderLeftIndent()),t.appendChild(e)),t.appendChild(i),lt([t],this.element.querySelector("tbody"))},Xje.prototype.renderContent=function(){0<this.parent.activeViewOptions.group.resources.length&&(this.parent.resourceBase.renderedResources=Pe([],this.parent.resourceBase.lastResourceLevel,null,!0));var e,t,i,n=Q("tr"),o=Q("td");this.parent.isAdaptive?(o.setAttribute("colspan",this.parent.activeViewOptions.timeScale.enable?"2":"1"),e=Q("div",{className:BNe}),this.parent.activeViewOptions.timeScale.enable&&e.appendChild(this.renderTimeCells()),e.appendChild(this.renderContentArea()),o.appendChild(e),E.add(e,"scroll",this.onAdaptiveScroll,this),E.add(e,F.touchMoveEvent,this.onAdaptiveMove,this),n.appendChild(o)):(e=this.colLevels.slice(0),this.parent.virtualScrollModule&&this.resetColLevels(),t=this.renderContentArea(),o.appendChild(t),this.parent.activeViewOptions.timeScale.enable&&((i=Q("td")).appendChild(this.renderTimeCells()),n.appendChild(i)),n.appendChild(o),this.parent.virtualScrollModule&&(this.colLevels=e,this.parent.virtualScrollModule.renderVirtualTrack(t))),this.element.querySelector("tbody").appendChild(n)},Xje.prototype.renderLeftIndent=function(){for(var e=Q("div",{className:cNe}),t=this.createTableLayout(),i=Q("tr"),n=this.colLevels.length,o=0;o<n;o++){var r,s=i.cloneNode(),a={className:[this.colLevels[parseInt(o.toString(),10)][0]&&this.colLevels[parseInt(o.toString(),10)][0].className[0]],type:"emptyCells"};this.parent.activeViewOptions.showWeekNumber&&-1!==a.className.indexOf(iNe)&&(a.className.push(jNe),r=this.parent.getWeekNumberContent(this.renderDates),a.template=[Q("span",{innerHTML:""+r,attrs:{title:this.parent.localeObj.getConstant("week")+" "+r}})]),l=this.createTd(a),this.parent.renderHeaderIndentTemplate(a,l),s.appendChild(l),t.querySelector("tbody").appendChild(s)}var l,h=i.cloneNode(),d=Q("div",{attrs:{tabindex:"0",role:"button",title:this.parent.localeObj.getConstant("expandAllDaySection"),"aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("expandAllDaySection")},className:N2e+" "+V2e+" "+WOe+" "+UOe}),p={className:[YOe],type:"emptyCells"};return(l=this.createTd(p)).appendChild(d),this.parent.renderHeaderIndentTemplate(p,l),h.appendChild(l),t.querySelector("tbody").appendChild(h),e.appendChild(t),e},Xje.prototype.renderDatesHeader=function(){for(var e=Q("div",{className:tNe}),t=Q("div",{className:eNe}),i=(e.appendChild(t),this.createTableLayout()),n=Q("tr",{className:B2e}),o=this.colLevels.length,r=this.colLevels[o-1],s=0;s<o;s++){for(var a=n.cloneNode(),l=this.colLevels[parseInt(s.toString(),10)],h=0;h<l.length;h++)a.appendChild(this.createTd(l[parseInt(h.toString(),10)]));i.querySelector("tbody").appendChild(a)}return this.createAllDayRow(i,r),this.createColGroup(i,r),t.appendChild(i),e},Xje.prototype.createAllDayRow=function(e,t){for(var i=Q("tr",{className:XOe}),n=0;n<t.length;n++){var o=Pe({},t[parseInt(n.toString(),10)]),r=(o.className=[YOe],o.type="alldayCells",this.createTd(o));r.setAttribute("data-date",o.date.getTime().toString()),je(o.groupIndex)?this.parent.uiStateValues.isGroupAdaptive&&r.setAttribute("data-group-index",""+this.parent.uiStateValues.groupIndex):r.setAttribute("data-group-index",""+o.groupIndex),this.wireCellEvents(r),i.appendChild(r)}e.querySelector("tbody").appendChild(i);var s=Q("thead");s.appendChild(this.parent.eventBase.createEventWrapper("allDay")),lt([s],e)},Xje.prototype.createTd=function(e){var t=Q("td"),i=(this.addAttributes(e,t),e.date&&e.type&&(i=this.getTdContent(e.date,e.type,e.groupIndex))&&i.length&&ht(i,t),this.parent.isMinMaxDate(gOe(new Date(""+e.date)))||U([t],qVe),"resourceHeader"===e.type&&this.setResourceHeaderContent(t,e),"dateHeader"===e.type&&0<=e.className.indexOf(iNe)&&(t.setAttribute("data-date",e.date.getTime().toString()),je(e.groupIndex)||t.setAttribute("data-group-index",""+e.groupIndex),this.wireMouseEvents(t)),{elementType:e.type,element:t,date:e.date,groupIndex:e.groupIndex});return this.parent.trigger(xRe,i),t},Xje.prototype.wireCellEvents=function(e){E.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),this.wireMouseEvents(e)},Xje.prototype.wireMouseEvents=function(e){E.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||E.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},Xje.prototype.renderTimeCells=function(){var n=this,e=Q("div",{className:xNe}),o=this.createTableLayout(),r=Q("tr");return this.getTimeSlotRows(function(e){e.type=e.first?"majorSlot":"minorSlot",e.className=e.last?[INe,TNe]:[TNe];var t=r.cloneNode(),i={date:e.date,type:e.type,className:e.className};return t.appendChild(n.createTd(i)),o.querySelector("tbody").appendChild(t),e}),e.appendChild(o),e},Xje.prototype.renderContentArea=function(){var e=Q("div",{className:i2e}),t=this.createTableLayout(KOe);return this.setAriaAttributes(t),this.addAutoHeightClass(t),this.renderContentTable(t),this.createColGroup(t,this.colLevels.slice(-1)[0]),e.appendChild(t),this.wireCellEvents(t.querySelector("tbody")),E.add(e,"scroll",this.onContentScroll,this),E.add(e,F.touchMoveEvent,this.onAdaptiveMove,this),e},Xje.prototype.renderContentTable=function(e){var t=e.querySelector("tbody");ht(this.getContentRows(),t),this.renderContentTableHeader(e)},Xje.prototype.getContentRows=function(){var s=this,a=[],l=Q("tr"),h=Q("td"),d=this.getGroupIndices();return this.getTimeSlotRows(function(e){for(var t=l.cloneNode(),i=0,n=s.colLevels[s.colLevels.length-1];i<n.length;i++){var o=n[i],r=!0;(r=s.parent.virtualScrollModule&&0<s.parent.activeViewOptions.group.resources.length&&-1<d.indexOf(o.groupIndex)?!1:r)&&(r=s.createContentTd(o,e,h),t.appendChild(r))}return a.push(t),e}),a},Xje.prototype.createContentTd=function(e,t,i){var n,i=i.cloneNode(),o=(e.colSpan&&i.setAttribute("colspan",e.colSpan.toString()),this.getContentTdClass(t)),r=gOe(e.date),t=(this.parent.isMinMaxDate(r)||o.push(qVe),r=new Date(r.setHours(t.date.getHours(),t.date.getMinutes(),t.date.getSeconds(),t.date.getMilliseconds())),"workCells"),o=(-1!==e.className.indexOf(bNe)&&(o.push(gNe),t="resourceGroupCells"),this.parent.workHours.highlight&&(this.parent.activeViewOptions.timeScale.enable&&this.isWorkHour(r,e.startHour,e.endHour,e.workDays)||!this.parent.activeViewOptions.timeScale.enable&&this.isWorkDay(r,e.workDays))&&o.push(ZOe),U([i],o),this.parent.activeViewOptions.cellTemplate&&(o={date:r,type:t,groupIndex:e.groupIndex},n=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",ht([].slice.call(this.parent.getCellTemplate()(o,this.parent,"cellTemplate",n,!1,void 0,void 0,this.parent.root)),i)),i.setAttribute("data-date",r.getTime().toString()),this.parent.activeViewOptions.timeScale.enable?(o=this.parent.globalize.formatDate(r,{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),n=this.parent.globalize.formatDate(this.getEndDateFromStartDate(r),{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),i.setAttribute("aria-label",o+" "+this.parent.localeObj.getConstant("endAt")+" "+n)):(o=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()}),i.setAttribute("aria-label",o)),je(e.groupIndex)&&!this.parent.uiStateValues.isGroupAdaptive||(n=(this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues:e).groupIndex,i.setAttribute("data-group-index",""+n)),{elementType:t,element:i,date:r,groupIndex:e.groupIndex});return this.parent.trigger(xRe,o),i},Xje.prototype.getContentTdClass=function(e){return e.last?[JOe]:[JOe,ENe]},Xje.prototype.renderContentTableHeader=function(e){var t=Q("thead");t.appendChild(this.parent.eventBase.createEventWrapper()),this.parent.activeViewOptions.timeScale.enable&&t.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),lt([t],e)},Xje.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector("."+BNe):this.getContentAreaElement()},Xje.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+xNe)},Xje.prototype.getEndDateFromStartDate=function(e){var t=6e4*this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,e=new Date(e.getTime());return e.setMilliseconds(e.getMilliseconds()+t),e},Xje.prototype.getStartEndHours=function(e){var t;return je(e)||""===e?new Date(2e3,0,0,0):(t=new Date(2e3,0,0,0),2===(e=e.split(":")).length&&t.setHours(parseInt(e[0],10),parseInt(e[1],10),0),t)},Xje.prototype.getTimeSlotRows=function(e){for(var t=[],i=this.getStartEndHours(this.parent.activeViewOptions.startHour),n=this.getStartEndHours(this.parent.activeViewOptions.endHour),o=6e4*this.parent.activeViewOptions.timeScale.interval,r=o/this.parent.activeViewOptions.timeScale.slotCount,s=Math.round(iOe/r),a=i.getTime(),l=n.getTime(),h=(a!==l&&(i=i.getTimezoneOffset()!==n.getTimezoneOffset()?l-a-36e5:l-a,s=Math.round(i/r)),this.parent.activeViewOptions.timeScale.enable||(s=1),this.parent.getStartEndTime(this.parent.workHours.start)),d=this.parent.getStartEndTime(this.parent.workHours.end),p=0;p<s;p++){var c=new Date(a+r*p),u=(!POe(c)&&new Date(a).getTimezoneOffset()===c.getTimezoneOffset()||(u=new Date(a).getTimezoneOffset()-c.getTimezoneOffset(),c=new Date(c.getTime()-6e4*u)),p%(o/r)),c={date:new Date(""+c),startHour:h,endHour:d,first:0==u,middle:u<this.parent.activeViewOptions.timeScale.slotCount-1,last:u==this.parent.activeViewOptions.timeScale.slotCount-1,type:""};e&&e(c),t.push(c)}return t},Xje.prototype.getAdjustedDate=function(e){if(!this.parent.activeViewOptions.timeScale.enable)return new Date(e.setHours(0,0,0,0));for(var t=this.getTimeSlotRows(),i=new Date(new Date(t[0].date.getTime()).setHours(e.getHours(),e.getMinutes(),e.getMilliseconds())),n=0;n<t.length;n++)if(t[parseInt(n.toString(),10)].date.getTime()>i.getTime())return e.setHours(t[n-1].date.getHours(),t[n-1].date.getMinutes(),t[n-1].date.getMilliseconds()),new Date(e);return null},Xje.prototype.destroy=function(){var e;!this.parent||this.parent&&this.parent.isDestroyed||(this.clearCurrentTimeIndicatorTimer(),this.element&&(this.appointment&&(this.appointment.destroy(),this.appointment=null),(e=this.getContentAreaElement())&&(E.remove(e,"scroll",this.onContentScroll),E.remove(e,F.touchMoveEvent,this.onAdaptiveMove)),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),Yje.prototype.destroy.call(this)))};var Gje,Yje,P2=Xje;function Xje(e){e=Yje.call(this,e)||this;return e.viewClass="e-day-view",e.isInverseTableSelect=!0,e.baseCssClass="e-vertical-view",e.appointment=null,e}Kje=function(e,t){return(Kje=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Kje(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})($je,Jje=P2),$je.prototype.getModuleName=function(){return"day"};var Kje,Jje,Zje=$je;function $je(e){e=Jje.call(this,e)||this;return e.viewClass="e-day-view",e}e3e=function(e,t){return(e3e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}e3e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(n3e,t3e=P2),n3e.prototype.startDate=function(){return this.getViewStartDate()},n3e.prototype.endDate=function(){return this.getViewEndDate()},n3e.prototype.getModuleName=function(){return"week"};var e3e,t3e,i3e=n3e;function n3e(e){e=t3e.call(this,e)||this;return e.viewClass="e-week-view",e}o3e=function(e,t){return(o3e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}o3e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(a3e,r3e=P2),a3e.prototype.startDate=function(){return this.getViewStartDate()},a3e.prototype.endDate=function(){return this.getViewEndDate()},a3e.prototype.getModuleName=function(){return"workWeek"};var o3e,r3e,s3e=a3e;function a3e(e){e=r3e.call(this,e)||this;return e.viewClass="e-work-week-view",e}l3e=function(e,t){return(l3e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}l3e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(p3e,h3e=D2),p3e.prototype.addEventListener=function(){this.parent.on(JRe,this.onScrollUIUpdate,this),this.parent.on(qRe,this.onDataReady,this),this.parent.on(fRe,this.onCellClick,this)},p3e.prototype.removeEventListener=function(){this.parent&&(this.parent.off(JRe,this.onScrollUIUpdate),this.parent.off(qRe,this.onDataReady),this.parent.off(fRe,this.onCellClick))},p3e.prototype.onDataReady=function(e){this.monthEvent=new MHe(this.parent),this.monthEvent.renderAppointments(),this.parent.notify(GRe,{})},p3e.prototype.onCellClick=function(e){},p3e.prototype.onContentScroll=function(e){this.parent.removeNewEventElement(),this.parent.notify(KRe,e),this.scrollTopPanel(e.target),this.scrollLeftPanel(e.target),this.parent.uiStateValues.top=e.target.scrollTop,this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence()},p3e.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();t&&(t.scrollTop=e.scrollTop)},p3e.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+zNe)},p3e.prototype.onScrollUIUpdate=function(e){var t=this.getHeaderBarHeight(),i=this.getDatesHeaderElement(),n=this.getContentAreaElement(),t=this.parent.element.offsetHeight-t-i.offsetHeight,o=this.getLeftPanelElement(),t=("auto"!==this.parent.height&&this.setContentHeight(n,o,t),TOe());i.firstElementChild.style[e.cssProperties.rtlBorder]="",i.style[e.cssProperties.rtlPadding]="",0<n.offsetWidth-n.clientWidth?(i.firstElementChild.style[e.cssProperties.border]=0<t?"1px":"0px",i.style[e.cssProperties.padding]=0<t?t-1+"px":"0px"):(i.firstElementChild.style[e.cssProperties.border]="",i.style[e.cssProperties.padding]=""),this.setColWidth(n),(e.scrollPosition||!e.isPreventScrollUpdate&&"TimelineMonth"===this.parent.currentView)&&(t=("TimelineMonth"===this.parent.currentView?this.parent.uiStateValues:e.scrollPosition).top,o&&(o.scrollTop=t),n.scrollTop=t,this.parent.uiStateValues.isInitial?(this.scrollToSelectedDate(),this.parent.uiStateValues.isInitial=!1):n.scrollLeft=("TimelineMonth"===this.parent.currentView?this.parent.uiStateValues:e.scrollPosition).left),this.retainScrollPosition()},p3e.prototype.scrollToSelectedDate=function(){var e=new Date(this.parent.selectedDate),e=(e.setHours(0,0,0,0),this.element.querySelector("."+iNe+'[data-date="'+e.getTime().toString()+'"]')),t=this.getContentAreaElement();je(e)?t.scrollLeft=0:t.scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):e.offsetLeft,0===t.scrollLeft&&this.parent.uiStateValues.isInitial&&(this.parent.uiStateValues.left=0)},p3e.prototype.setContentHeight=function(e,t,i){e.style.height="auto","Month"===this.parent.currentView&&(e.style.height=T(i)),t&&("MonthAgenda"===this.parent.currentView&&(i=(1<this.parent.activeViewOptions.interval?this.getContentAreaElement().firstElementChild:this.element.querySelector("."+KOe)).offsetHeight),t.style.height="auto",t.style.height=T(i-this.getScrollXIndent(e)))},p3e.prototype.generateColumnLevels=function(){var e,i,t=[],n=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);return 0<this.parent.activeViewOptions.group.resources.length?(t=this.parent.resourceBase.generateResourceLevels(n),"MonthAgenda"===this.parent.currentView&&(t=[n]),this.parent.uiStateValues.isGroupAdaptive&&0<this.parent.resourceBase.lastResourceLevel.length&&(e=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],i=this.getDateSlots(e.renderDates,e.workDays),t=[i=this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays?-1<(e=i.findIndex(function(e,t){return 0!==t&&e.date.getDay()===i[0].date.getDay()}))?i.slice(0,e):i:i])):t.push(n),this.colLevels=t},p3e.prototype.getDateSlots=function(e,t){for(var i=this.parent.activeViewOptions.showWeekend?7:t.length,n=[],o=this.isCurrentMonth(this.parent.selectedDate),r=0;r<i;r++){var s=[iNe],a=e.slice(0,i).map(function(e){return e.getDay()});o&&a.indexOf(this.parent.currentTimezoneDate.getDay())===r&&s.push(rNe),n.push({date:e[parseInt(r.toString(),10)],type:"monthDay",className:s,colSpan:1,workDays:t})}return n},p3e.prototype.getDayNameFormat=function(){return this.parent.isAdaptive||0<this.parent.activeViewOptions.group.resources.length?"abbreviated":"wide"},p3e.prototype.renderLayout=function(e){this.dayNameFormat=this.getDayNameFormat(),this.setPanel(Q("div",{className:e2e}));var t=[this.viewClass],t=(t.push(e),this.parent.activeViewOptions.group.byDate&&(t.push("e-by-date"),"Month"!==this.parent.currentView)&&(this.parent.activeViewOptions.group.hideNonWorkingDays=!1),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&t.push(n_e),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&t.push(s_e),U([this.element],t),this.renderPanel(e),this.element.appendChild(this.createTableLayout(t2e)),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent(),"MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element);this.parent.uiStateValues.isGroupAdaptive&&!t.querySelector("."+NNe)&&this.renderResourceMobileLayout(),this.parent.notify(YRe,{}),this.parent.uiStateValues.isCustomMonth&&(this.parent.uiStateValues.isCustomMonth=!1)},p3e.prototype.refreshHeader=function(){ue(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(YRe,{});var e=this.element.querySelector("."+eNe),t=this.element.querySelector("."+i2e);e&&(e.scrollLeft=this.parent.uiStateValues.left),t&&(t.scrollLeft=this.parent.uiStateValues.left)},p3e.prototype.wireCellEvents=function(e){E.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),E.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||E.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},p3e.prototype.renderHeader=function(){var e=Q("tr"),t=(this.renderLeftIndent(e),Q("td"));t.appendChild(this.renderDatesHeader()),e.appendChild(t),lt([e],this.element.querySelector("tbody"))},p3e.prototype.renderLeftIndent=function(e){this.parent.activeViewOptions.showWeekNumber&&e.appendChild(Q("td",{className:"e-left-indent"}))},p3e.prototype.renderContent=function(){0<this.parent.activeViewOptions.group.resources.length&&(this.parent.resourceBase.renderedResources=Pe([],this.parent.resourceBase.lastResourceLevel,null,!0));var e,t=Q("tr"),i=(this.parent.activeViewOptions.showWeekNumber&&t.appendChild(this.renderWeekNumberContent()),Q("td")),n=this.colLevels.slice(0),o=(this.parent.virtualScrollModule&&this.resetColLevels(),Q("div",{className:i2e})),r=this.renderContentArea();"Month"===this.parent.currentView?o.appendChild(r):((e=Q("div",{className:qOe})).appendChild(r),o.appendChild(e)),E.add(o,"scroll",this.onContentScroll,this),i.appendChild(o),t.appendChild(i),this.parent.virtualScrollModule&&(this.colLevels=n,this.parent.virtualScrollModule.renderVirtualTrack(o)),this.element.querySelector("tbody").appendChild(t),this.renderAppointmentContainer()},p3e.prototype.renderWeekNumberContent=function(){for(var e=this.renderDates.map(function(e){return new Date(+e)}),t=Q("td"),i=Q("div",{className:zNe}),n=(t.appendChild(i),this.createTableLayout()),o=(i.appendChild(n),this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length),r=0,s=this.renderDates.length/o;r<s;r++){var a=e.splice(0,o),a=this.parent.getWeekNumberContent(a);n.querySelector("tbody").appendChild(this.createWeekNumberElement(a))}return t},p3e.prototype.renderAppointmentContainer=function(){},p3e.prototype.renderDatesHeader=function(){for(var e,t=Q("div",{className:tNe}),i=Q("div",{className:eNe}),n=(t.appendChild(i),this.createTableLayout()),o=("Month"===this.parent.currentView&&((e=Q("thead")).appendChild(Q("tr")),lt([e],n)),this.createColGroup(n,this.colLevels[this.colLevels.length-1]),Q("tr")),r=0;r<this.colLevels.length;r++){for(var s=this.colLevels[parseInt(r.toString(),10)],a=o.cloneNode(),l=0;l<s.length;l++){var h=s[parseInt(l.toString(),10)];a.appendChild(this.createHeaderCell(h))}n.querySelector("tbody").appendChild(a)}return i.appendChild(n),t},p3e.prototype.createHeaderCell=function(e){var t,i,n=Q("td"),o=(this.addAttributes(e,n),"monthDay"===e.type&&(t=Q("span",{innerHTML:ROe(this.parent.getDayNames(this.dayNameFormat)[e.date.getDay()],"single")}),n.appendChild(t)),"resourceHeader"===e.type&&this.setResourceHeaderContent(n,e),"dateHeader"===e.type&&(U([n],p2e),n.setAttribute("data-date",e.date.getTime().toString()),this.parent.activeViewOptions.dateHeaderTemplate?(i={date:e.date,type:e.type},o=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",(i=[].slice.call(this.parent.getDateHeaderTemplate()(i,this.parent,"dateHeaderTemplate",o,!1,void 0,void 0,this.parent.root)))&&i.length&&ht(i,n)):(t=Q("span",{className:d2e}),o=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()}),t.setAttribute("title",ROe(o,"multiple")),i=!this.parent.calendarUtil.isMonthStart(e.date)||this.isCurrentDate(e.date)||this.parent.isAdaptive?this.parent.globalize.formatDate(e.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e.date,{format:"MMM d",calendar:this.parent.getCalendarMode()}),t.innerHTML=ROe(i,"single"),n.appendChild(t)),this.wireCellEvents(n)),{elementType:e.type,element:n,date:e.date,groupIndex:e.groupIndex});return this.parent.trigger(xRe,o),n},p3e.prototype.getContentSlots=function(){if(!this.colLevels[this.colLevels.length-1]||!this.colLevels[this.colLevels.length-1][0])return[];var o=[],a=function(e,t,i,n){t={date:new Date(+t),groupIndex:i.groupIndex,workDays:i.workDays,type:"monthCells",className:n||[JOe]};o[parseInt(e.toString(),10)]||(o[parseInt(e.toString(),10)]=[]),o[parseInt(e.toString(),10)].push(t)},l="MonthAgenda"!==this.parent.currentView&&0<this.parent.activeViewOptions.group.resources.length;if(!l||this.parent.uiStateValues.isGroupAdaptive||this.parent.activeViewOptions.group.byDate)for(var e=this.renderDates.map(function(e){return new Date(+e)}),h=this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length,t=this.colLevels.slice(0,1)[0],i=this.renderDates.map(Number).indexOf(+t[0].date),d=0;d<this.renderDates.length/h;d++)for(var p,c=e.splice(0,h),u=i,g=this,n=i;n<this.colLevels[0].length+i&&n<c.length;n++)!function(e){var t=c[parseInt(u.toString(),10)];if(u++,l){var i=g.colLevels[g.colLevels.length-1],n=i.length/h,o=i.slice(0,n);if(g.parent.activeViewOptions.group.hideNonWorkingDays&&0===(o=i.filter(function(e){return e.date.getDay()===t.getDay()})).length)return p=e-=1;for(var r=0;r<o.length;r++){var s=0!==r?[JOe,"e-disable-date"]:void 0;a(d,t,o[parseInt(r.toString(),10)],s)}}else a(d,t,g.colLevels[g.colLevels.length-1][0]);p=e}(n),n=p;else for(var r=0,s=this.colLevels[this.colLevels.length-2];r<s.length;r++)for(var m=s[r],e=m.renderDates.map(function(e){return new Date(+e)}),h=this.parent.activeViewOptions.showWeekend?7:m.workDays.length,d=0;d<m.renderDates.length/h;d++)for(var c,f=0,y=c=e.splice(0,h);f<y.length;f++){var v=y[f];a(d,v,m)}return o},p3e.prototype.updateClassList=function(e){!this.isCustomMonth()&&this.isOtherMonth(e.date)&&e.className.push(oNe),this.parent.isMinMaxDate(e.date)||e.className.push(qVe),this.updateSelectedCellClass(e)},p3e.prototype.updateSelectedCellClass=function(e){},p3e.prototype.isOtherMonth=function(e){return e.getTime()<this.monthDates.start.getTime()||e.getTime()>this.monthDates.end.getTime()},p3e.prototype.renderContentArea=function(){var e=this.createTableLayout(KOe),t=(this.setAriaAttributes(e),this.addAutoHeightClass(e),"TimelineMonth"===this.parent.currentView&&this.createColGroup(e,this.colLevels[this.colLevels.length-1]),new Date(this.parent.selectedDate.getTime())),t=(this.monthDates={start:this.parent.calendarUtil.firstDateOfMonth(t),end:this.parent.calendarUtil.lastDateOfMonth(vOe(t,this.parent.activeViewOptions.interval-1))},e.querySelector("tbody"));return ht(this.getContentRows(),t),this.wireCellEvents(t),e},p3e.prototype.getContentRows=function(){for(var e=[],t=Q("tr"),i=Q("td"),n=this.getContentSlots(),o="TimelineMonth"===this.parent.currentView?this.getGroupIndices():[],r=0;r<n.length;r++)if(!(0<o.length&&-1<o.indexOf(n[parseInt(r.toString(),10)][0].groupIndex))){for(var s=t.cloneNode(),a=0;a<n[parseInt(r.toString(),10)].length;a++){var l=this.createContentTd(n[parseInt(r.toString(),10)][parseInt(a.toString(),10)],i);s.appendChild(l)}e.push(s)}return e},p3e.prototype.createContentTd=function(e,t){var i,t=t.cloneNode(),n=(e.colSpan&&t.setAttribute("colspan",e.colSpan.toString()),this.updateClassList(e),e.type),o=(-1!==e.className.indexOf(bNe)&&(e.className.push(gNe),n="resourceGroupCells"),this.parent.workHours.highlight&&this.isWorkDay(e.date,e.workDays)&&e.className.push(nNe),this.isCurrentDate(e.date)&&e.className.push(sNe),U([t],e.className),t.setAttribute("data-date",e.date.getTime().toString()),je(e.groupIndex)&&!this.parent.uiStateValues.isGroupAdaptive||(o=(this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues:e).groupIndex,t.setAttribute("data-group-index",""+o)),this.renderDateHeaderElement(e,t),this.parent.activeViewOptions.cellTemplate&&(o={date:e.date,type:n,groupIndex:e.groupIndex},i=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",ht([].slice.call(this.parent.getCellTemplate()(o,this.parent,"cellTemplate",i,!1,void 0,void 0,this.parent.root)),t)),{elementType:n,element:t,date:e.date,groupIndex:e.groupIndex});return this.parent.trigger(xRe,o),t},p3e.prototype.renderDateHeaderElement=function(e,t){var i,n,o;"TimelineMonth"!==this.parent.currentView&&(i=Q("div",{className:p2e}),this.parent.activeViewOptions.cellHeaderTemplate?(n={date:e.date,type:e.type,groupIndex:e.groupIndex},o=this.parent.element.id+"_"+this.parent.activeViewOptions.cellHeaderTemplateName+"cellHeaderTemplate",ht([].slice.call(this.parent.getCellHeaderTemplate()(n,this.parent,"cellHeaderTemplate",o,!1,void 0,void 0,this.parent.root)),i)):(n=!this.parent.calendarUtil.isMonthStart(e.date)||this.isCurrentDate(e.date)||this.parent.isAdaptive?this.parent.globalize.formatDate(e.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e.date,{format:"MMM d",calendar:this.parent.getCalendarMode()}),i.innerHTML=ROe(n,"single")),t.appendChild(i),"month"===this.getModuleName())&&(U([i],d2e),o=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()}),t.setAttribute("aria-label",o))},p3e.prototype.getMonthStart=function(e){e=aOe("Month"===this.parent.currentView&&!je(this.parent.activeViewOptions.displayDate)&&!this.parent.uiStateValues.isSwipeScroll&&(this.parent.uiStateValues.isCustomMonth||this.isCustomRange())?this.parent.activeViewOptions.displayDate:this.parent.uiStateValues.isCustomMonth||!this.parent.uiStateValues.isSwipeScroll&&this.isCustomRange()||!this.isCustomMonth()?this.parent.calendarUtil.firstDateOfMonth(e):e,this.parent.activeViewOptions.firstDayOfWeek);return new Date(e.getFullYear(),e.getMonth(),e.getDate())},p3e.prototype.getMonthEnd=function(e){return this.isCustomMonth()?yOe(this.getMonthStart(e),7*(0<this.parent.activeViewOptions.numberOfWeeks?this.parent.activeViewOptions.numberOfWeeks:6)-1):(e=vOe(e,this.parent.activeViewOptions.interval-1),yOe(aOe(this.parent.calendarUtil.lastDateOfMonth(e),this.parent.activeViewOptions.firstDayOfWeek),6))},p3e.prototype.isCustomRange=function(){var e,t,i=this.parent.getCurrentViewDates();return!(!(i&&0<i.length)||(e=gOe(this.parent.selectedDate).getTime(),t=aOe(i[i.length-1],this.parent.activeViewOptions.firstDayOfWeek),e>=aOe(i[0],this.parent.activeViewOptions.firstDayOfWeek).getTime()&&e<=yOe(t,6).getTime()))},p3e.prototype.getRenderDates=function(e,t){void 0===t&&(t=this.parent.selectedDate);for(var i=[],t=gOe(t),n=this.getMonthStart(t),o=this.getMonthEnd(t);(this.parent.activeViewOptions.showWeekend||this.isWorkDay(n,e))&&i.push(n),(n=0<(n=yOe(n,1)).getHours()?gOe(n):n).getTime()<=o.getTime(););return e||(this.renderDates=i),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),i},p3e.prototype.getNextPreviousDate=function(e){var t;return this.isCustomMonth()?(t=this.parent.getCurrentViewDates(),yOe(aOe("Next"===e?t[t.length-1]:t[0],this.parent.activeViewOptions.firstDayOfWeek),"Next"===e?7:7*-(0<this.parent.activeViewOptions.numberOfWeeks?this.parent.activeViewOptions.numberOfWeeks:6))):vOe(this.parent.selectedDate,("Next"===e?1:-1)*this.parent.activeViewOptions.interval)},p3e.prototype.getStartDate=function(){return this.getMonthStart(this.parent.selectedDate)},p3e.prototype.getEndDate=function(){return this.getMonthEnd(this.parent.selectedDate)},p3e.prototype.getEndDateFromStartDate=function(e){return yOe(new Date(e.getTime()),1)},p3e.prototype.getDateRangeText=function(e,t){var i,n,o;return void 0===e&&(e=this.parent.selectedDate),void 0===t&&(t=null),this.parent.isAdaptive||je(this.parent.activeViewOptions.dateFormat)?(n=void(e=!je(t)&&6<t.length?t[6]:e),i=!7,this.isCustomMonth()&&(i=(o=!je(t)&&0<t.length?t:this.parent.getCurrentViewDates())[0].getMonth()!==o[o.length-1].getMonth()||o[0].getFullYear()!==o[o.length-1].getFullYear())&&(e=o[0],n=o[o.length-1]),o="Month"!==this.parent.currentView||!this.isCustomMonth(),1<this.parent.activeViewOptions.interval&&o||i?(n=n||vOe(dOe(e),this.parent.activeViewOptions.interval-1),e.getFullYear()===n.getFullYear()?ROe(this.parent.globalize.formatDate(e,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" - "+this.parent.globalize.formatDate(n,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(n,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single"):ROe(this.parent.globalize.formatDate(e,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" "+e.getFullYear()+" - "+this.parent.globalize.formatDate(n,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(n,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single")):(o=this.parent.activeViewOptions.dateFormat||"MMMM y",ROe(this.parent.globalize.formatDate(e,{format:o,calendar:this.parent.getCalendarMode()}),"single"))):this.formatDateRange(!je(t)&&0<t.length?t[0]:this.parent.selectedDate)},p3e.prototype.getLabelText=function(e){e=e.charAt(0).toLowerCase()+e.substring(1);return this.formatViewLabel(e,this.getStartDate(),this.getEndDate())},p3e.prototype.createWeekNumberElement=function(e){var t=Q("tr"),e=Q("td",{className:jNe,attrs:{title:e?this.parent.localeObj.getConstant("week")+" "+e:""},innerHTML:e||""});return t.appendChild(e),this.parent.trigger(xRe,{elementType:"weekNumberCell",element:e}),t},p3e.prototype.unWireEvents=function(){var e=this.element.querySelector("."+i2e);e&&E.remove(e,"scroll",this.onContentScroll)},p3e.prototype.isCustomMonth=function(){return"Month"===this.parent.currentView&&(!je(this.parent.activeViewOptions.displayDate)||0<this.parent.activeViewOptions.numberOfWeeks)},p3e.prototype.getModuleName=function(){return"month"},p3e.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.element&&(this.monthEvent&&(this.monthEvent.destroy(),this.monthEvent=null),this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),h3e.prototype.destroy.call(this))};var l3e,h3e,d3e=p3e;function p3e(e){e=h3e.call(this,e)||this;return e.dayNameFormat="wide",e.viewClass="e-month-view",e.isInverseTableSelect=!1,e.monthEvent=null,e.monthDates={},e}c3e=function(e,t){return(c3e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}c3e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(m3e,u3e=D2),m3e.prototype.getModuleName=function(){return"year"},m3e.prototype.renderLayout=function(e){this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.setPanel(Q("div",{className:e2e}));var t="Horizontal"===this.parent.activeViewOptions.orientation?"e-horizontal":"e-vertical",t=(U([this.element],[this.viewClass,t,e]),this.renderPanel(e),this.parent.activeViewOptions.allowVirtualScrolling&&U([this.element],[n_e]),this.createTableLayout(t2e)),e=(this.element.appendChild(t),this.element.querySelector("table").setAttribute("role","presentation"),t.querySelector("tbody"));this.rowCount=this.getRowColumnCount("row"),this.columnCount=this.getRowColumnCount("column"),this.renderHeader(e),this.renderContent(e),"Year"!==this.parent.currentView&&this.parent.uiStateValues.isGroupAdaptive&&(this.generateColumnLevels(),this.renderResourceMobileLayout()),E.add(this.element.querySelector("."+i2e),"scroll",this.onContentScroll,this),this.parent.notify(YRe,{})},m3e.prototype.renderHeader=function(e){},m3e.prototype.renderContent=function(e){var t=Q("tr"),e=(e.appendChild(t),Q("td")),t=(t.appendChild(e),this.element.querySelector("tbody").appendChild(t),Q("div",{className:i2e})),e=(e.appendChild(t),this.createTableLayout("e-calendar-table")),t=(t.appendChild(e),Q("tr")),e=(e.querySelector("tbody").appendChild(t),Q("td")),i=(t.appendChild(e),Q("div",{className:"e-calendar-wrapper"}));e.appendChild(i);for(var n=0,o=this.getMonths();n<o.length;n++){var r=o[n],r=new Date(this.parent.selectedDate.getFullYear(),r,1),s=Q("div",{className:"e-month-calendar e-calendar",attrs:{"data-role":"calendar"}});s.appendChild(this.renderCalendarHeader(r)),s.appendChild(this.renderCalendarContent(r)),i.appendChild(s)}this.renderDates.splice(0,1)},m3e.prototype.renderCalendarHeader=function(e){var t,i=Q("div",{className:"e-header e-month"}),n=Q("div",{className:"e-day e-title"});return this.parent.activeViewOptions.monthHeaderTemplate?(t={date:e,type:"monthHeader"},this.renderTemplates(this.parent.getMonthHeaderTemplate(),t,"monthHeaderTemplate",this.parent.activeViewOptions.monthHeaderTemplateName,n)):n.innerHTML=this.getMonthName(e),i.appendChild(n),this.parent.trigger(xRe,{elementType:"headerCells",element:n,date:e}),i},m3e.prototype.renderCalendarContent=function(e){var t=this.getMonthDates(e),i=Q("div",{className:"e-content e-month"}),n=this.createTableLayout("e-calendar-table "+KOe),o=(i.appendChild(n),this.setAriaAttributes(n),Q("thead",{className:"e-week-header"})),r=Q("tr"),s=aOe(hOe(e),this.parent.activeViewOptions.firstDayOfWeek);this.parent.activeViewOptions.showWeekNumber&&r.appendChild(Q("th"));for(var a=0;a<7;a++){this.parent.activeViewOptions.dayHeaderTemplate?(l=Q("th"),m={date:s,type:"dayHeader"},this.renderTemplates(this.parent.getDayHeaderTemplate(),m,"dayHeaderTemplate",this.parent.activeViewOptions.dayHeaderTemplateName,l),r.appendChild(l)):r.appendChild(Q("th",{innerHTML:this.parent.getDayNames("narrow")[s.getDay()]}));var l=new Date(s.getTime()+iOe),s=l.getDate()===s.getDate()?yOe(l,1):l}o.appendChild(r),lt([o],n);for(var h=n.querySelector("tbody");0<t.length;){var d,p=t.splice(0,7),c=Q("tr");this.parent.activeViewOptions.showWeekNumber&&(d=this.parent.getWeekNumberContent(p),y=Q("td",{className:"e-week-number",attrs:{title:this.parent.localeObj.getConstant("week")+" "+d},innerHTML:d}),c.appendChild(y),this.parent.trigger(xRe,{elementType:"weekNumberCells",element:y}));for(var u=0,g=p;u<g.length;u++){var m,f=g[u],y=Q("td",{className:"e-cell "+JOe,attrs:{"data-date":f.getTime().toString()}}),v=(this.parent.activeViewOptions.cellHeaderTemplate?(m={date:f,type:"monthCells"},this.renderTemplates(this.parent.getCellHeaderTemplate(),m,"cellHeaderTemplate",this.parent.activeViewOptions.cellHeaderTemplateName,y)):(v=Q("span",{className:"e-day",innerHTML:this.parent.globalize.formatDate(f,{skeleton:"d",calendar:this.parent.getCalendarMode()}),attrs:{title:this.parent.globalize.formatDate(f,{type:"date",skeleton:"full"})}}),y.appendChild(v)),this.parent.activeViewOptions.cellTemplate&&(m={date:f,type:"monthCells"},this.renderTemplates(this.parent.getCellTemplate(),m,"cellTemplate",this.parent.activeViewOptions.cellTemplateName,y)),[]);e.getMonth()!==f.getMonth()&&(v.push(oNe),y.firstElementChild)&&!this.parent.activeViewOptions.cellTemplate&&y.firstElementChild.setAttribute("aria-disabled","true"),0<(v=this.isCurrentDate(f)&&e.getMonth()===f.getMonth()?v.concat(["e-today","e-selected"]):v).length&&U([y],v),c.appendChild(y),e.getMonth()===f.getMonth()&&this.renderDates.push(new Date(f)),this.parent.isMinMaxDate(f)?(E.add(y,"click",this.onCellClick,this),this.parent.isAdaptive||E.add(y,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)):U([y],qVe),this.parent.trigger(xRe,{elementType:"workCells",element:y,date:f})}h.appendChild(c)}return i},m3e.prototype.createTableColGroup=function(e){for(var t=Q("colgroup"),i=0;i<e;i++)t.appendChild(Q("col"));return t},m3e.prototype.getMonthName=function(e){return ROe(this.parent.globalize.formatDate(e,{format:this.parent.activeViewOptions.dateFormat||"MMMM y",calendar:this.parent.getCalendarMode()}),"multiple")},m3e.prototype.generateColumnLevels=function(){var e,t=[],i=this.getDateSlots([this.parent.selectedDate],this.parent.activeViewOptions.workDays);return 0<this.parent.activeViewOptions.group.resources.length?(t=this.parent.resourceBase.generateResourceLevels(i),this.parent.uiStateValues.isGroupAdaptive&&(e=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],t=[this.getDateSlots([this.parent.selectedDate],e.workDays)])):t.push(i),t.pop(),this.colLevels=t},m3e.prototype.getDateSlots=function(e,t,i,n){return void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end),[{date:e[0],type:"dateHeader",className:[iNe],colSpan:1,workDays:t,startHour:new Date(+this.parent.globalize.parseDate(i,{skeleton:"Hm"})),endHour:new Date(+this.parent.globalize.parseDate(n,{skeleton:"Hm"}))}]},m3e.prototype.getMonthDates=function(e){for(var e=aOe(hOe(e),this.parent.activeViewOptions.firstDayOfWeek),t=yOe(new Date(+e),42),i=[],n=e;n.getTime()<t.getTime();n=yOe(n,1))i.push(gOe(new Date(n)));return i},m3e.prototype.getRowColumnCount=function(e){for(var t=this.getMonths(),i=this.parent.selectedDate.getFullYear(),n=[],o=0,r=t;o<r.length;o++){var s=r[o];n.push(new Date(i,s,1).getDay()+new Date(i,s+1,0).getDate())}var a=Math.max.apply(Math,n),e="row"===e?"Horizontal"===this.parent.activeViewOptions.orientation?t.length:a:"Horizontal"===this.parent.activeViewOptions.orientation?a:t.length;return e},m3e.prototype.isCurrentDate=function(e){return gOe(new Date).getTime()===gOe(new Date(e.getTime())).getTime()},m3e.prototype.getMonths=function(){var i=this;return Array.apply(null,{length:this.parent.activeViewOptions.monthsCount}).map(function(e,t){return i.parent.firstMonthOfYear+t})},m3e.prototype.renderTemplates=function(e,t,i,n,o){n=this.parent.element.id+"_"+n+i;ht([].slice.call(e(t,this.parent,i,n,!1,void 0,void 0,this.parent.root)),o)},m3e.prototype.onCellClick=function(e){var t,i=z(e.target,"."+JOe),n=this.parent.getDateFromElement(i),o=(this.parent.activeCellsData=this.parent.getCellDetails(i),n.getTime()<this.getStartDate().getTime());o||n.getTime()>this.getEndDate().getTime()?(this.parent.changeDate(this.parent.activeView.getNextPreviousDate(o?"Previous":"Next"),e),t=(t=this.parent.activeCellsData.startTime.getTime())>=this.getStartDate().getTime()&&t<=this.getEndDate().getTime()?t:(o?this.getEndDate():this.getStartDate()).getTime(),o=this.parent.element.querySelector(":not(."+oNe+')[data-date="'+t+'"]'),this.parent.selectCell(o),this.parent.activeCellsData=this.parent.getCellDetails(o)):(t=yOe(new Date(n.getTime()),1),o={date:n,event:this.parent.eventBase.filterEvents(n,t),element:e.target},i.classList.contains(oNe)&&(i=this.parent.element.querySelector(":not(."+oNe+')[data-date="'+i.getAttribute("data-date")+'"]')),this.parent.activeCellsData=this.parent.getCellDetails(i),n=Pe(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"}),this.parent.trigger(fRe,n),this.parent.quickPopup.moreEventClick(o,t))},m3e.prototype.onContentScroll=function(e){var t=e.target,i=this.getDatesHeaderElement(),i=(this.parent.notify(KRe,e),i&&(i.firstElementChild.scrollLeft=t.scrollLeft),this.element.querySelector(".e-month-header-wrapper,.e-resource-column-wrap"));i&&(i.scrollTop=t.scrollTop),this.parent.isAdaptive||(this.parent.uiStateValues.top=e.target.scrollTop),this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence()},m3e.prototype.onScrollUiUpdate=function(e){var t=this.parent.element.offsetHeight-this.getHeaderBarHeight(),i=this.element.querySelector("."+tNe),n=(i&&(t-=i.offsetHeight),this.element.querySelector("."+i2e)),o=(n&&(n.style.height=T(t)),!this.parent.isAdaptive&&i&&(o=TOe(),0<n.offsetWidth-n.clientWidth?(i.firstElementChild.style[e.cssProperties.border]=0<o?"1px":"0px",i.style[e.cssProperties.padding]=0<o?o-1+"px":"0px"):(i.firstElementChild.style[e.cssProperties.border]="",i.style[e.cssProperties.padding]="")),this.setColWidth(this.getContentAreaElement()),this.element.querySelector(".e-month-header-wrapper,.e-resource-column-wrap"));o&&(i=n.scrollWidth>n.clientWidth,o.style.height=T(t-(i?17:0))),e.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(this.parent.uiStateValues.isInitial=!1,this.parent.uiStateValues.top=this.parent.uiStateValues.left=0):(o&&(o.scrollTop=this.parent.uiStateValues.top),n.scrollTop=this.parent.uiStateValues.top,n.scrollLeft=this.parent.uiStateValues.left)),this.retainScrollPosition()},m3e.prototype.getStartDate=function(){return new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear%12,1)},m3e.prototype.getEndDate=function(){return yOe(vOe(this.getStartDate(),this.parent.monthsCount),-1)},m3e.prototype.startDate=function(){return"Year"===this.parent.currentView?aOe(this.getStartDate(),this.parent.activeViewOptions.firstDayOfWeek):this.getStartDate()},m3e.prototype.endDate=function(){return"Year"===this.parent.currentView?yOe(lOe(this.getEndDate(),this.parent.activeViewOptions.firstDayOfWeek),1):yOe(this.getEndDate(),1)},m3e.prototype.getEndDateFromStartDate=function(e){e=new Date(e.getTime());return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(e=dOe(e)),yOe(new Date(e.getTime()),1)},m3e.prototype.getNextPreviousDate=function(e){return bOe(this.parent.selectedDate,"Next"===e?1:-1)},m3e.prototype.getDateRangeText=function(e,t){void 0===e&&(e=this.parent.selectedDate);var i=!je(t=void 0===t?null:t)&&0<t.length,n=i?t[0]:this.getStartDate(),o=i?t[t.length-1]:this.getEndDate();return n.getFullYear()!==o.getFullYear()?this.parent.globalize.formatDate(n,{skeleton:"yMMM"})+" - "+this.parent.globalize.formatDate(o,{skeleton:"yMMM"}):this.parent.globalize.formatDate(i?t[0]:e,{skeleton:"y"})},m3e.prototype.addEventListener=function(){this.parent.on(JRe,this.onScrollUiUpdate,this),this.parent.on(qRe,this.onDataReady,this)},m3e.prototype.removeEventListener=function(){this.parent&&(this.parent.off(JRe,this.onScrollUiUpdate),this.parent.off(qRe,this.onDataReady))},m3e.prototype.onDataReady=function(e){this.yearEventModule=new zje(this.parent),this.yearEventModule.renderAppointments(),this.parent.notify(GRe,e)},m3e.prototype.scrollToDate=function(e){e=+new Date(gOe(e)),e=this.element.querySelector("."+JOe+":not(."+oNe+')[data-date="'+e+'"]');e&&(e=z(e,".e-month-calendar"),this.getContentAreaElement().scrollTop=e.offsetTop)},m3e.prototype.destroy=function(){var e;!this.parent||this.parent&&this.parent.isDestroyed||this.element&&((e=this.element.querySelector("."+i2e))&&E.remove(e,"scroll",this.onContentScroll),this.yearEventModule&&(this.yearEventModule.destroy(),this.yearEventModule=null),this.parent.resourceBase&&this.parent.resourceBase.destroy(),u3e.prototype.destroy.call(this))};var c3e,u3e,g3e=m3e;function m3e(e){e=u3e.call(this,e)||this;return e.viewClass="e-year-view",e.isInverseTableSelect=!1,e.yearEventModule=null,e}f3e=function(e,t){return(f3e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}f3e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(b3e,y3e=D2),b3e.prototype.createAgendaContentElement=function(e,r,t,s,a){var i,l=this,h=this.parent.eventFields;return"noEvents"===e?(e=[{subject:this.parent.localeObj.getConstant("noEvents")}],0===(i=X_.createList(this.parent.createElement,e,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass,template:'<div class="'+g2e+'">'+this.parent.localeObj.getConstant("noEvents")+"</div>"})).querySelector(".e-agenda-item").children.length&&i.firstElementChild.appendChild(Q("div",{className:g2e,innerHTML:this.parent.localeObj.getConstant("noEvents")}))):(i=X_.createList(this.parent.createElement,r,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass}),[].slice.call(i.children).forEach(function(t,e){var i,n=Q("div",{className:qNe,attrs:{"data-id":"Appointment_"+r[parseInt(e.toString(),10)][""+l.parent.eventFields.id],"data-guid":r[parseInt(e.toString(),10)].Guid,role:"button",tabindex:"0","aria-disabled":l.parent.eventBase.getReadonlyAttribute(r[parseInt(e.toString(),10)]),"aria-label":l.parent.getAnnouncementString(r[parseInt(e.toString(),10)])}}),o=(je(a)||n.setAttribute("data-group-index",a.toString()),l.parent.eventBase.applyResourceColor(n,r[parseInt(e.toString(),10)],"borderColor",s),je(l.parent.activeViewOptions.eventTemplate)?i=l.createAppointment(r[parseInt(e.toString(),10)]):(U([n],"e-template"),o=l.parent.element.id+"_"+l.parent.activeViewOptions.eventTemplateName+"eventTemplate",i=l.parent.getAppointmentTemplate()(r[parseInt(e.toString(),10)],l.parent,"eventTemplate",o,!1,void 0,void 0,l.parent.root),je(r[parseInt(e.toString(),10)][h.recurrenceRule])||(o=r[parseInt(e.toString(),10)][h.id]===r[parseInt(e.toString(),10)][h.recurrenceID]?k2e:P2e,n.appendChild(Q("div",{className:WOe+" "+o})))),ht([].slice.call(i),n),kOe(t),t.appendChild(n),{data:Pe({},r[parseInt(e.toString(),10)],null,!0),element:t,cancel:!1});l.parent.trigger(ERe,o,function(e){e.cancel&&ue(t)})})),t.appendChild(i),("MonthAgenda"===this.parent.currentView&&0<this.parent.activeViewOptions.group.resources.length||"Agenda"===this.parent.currentView)&&U([t],c2e),this.parent.renderTemplates(),t},b3e.prototype.createAppointment=function(e){var t=this.parent.eventFields,i=e[t.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),n=e[t.location]||this.parent.eventSettings.fields.location.default,o=Q("div",{className:JNe}),r=(je(n)||""===n||(i+=","),Q("div",{className:CVe})),n=(this.parent.sanitize(i,r),o.appendChild(r),je(n)||""===n||(i=Q("div",{className:SVe}),this.parent.sanitize(n,i),o.appendChild(i)),je(e[t.recurrenceRule])||(r=e[t.id]===e[t.recurrenceID]?k2e:P2e,o.appendChild(Q("div",{className:WOe+" "+r}))),e[t.startTime]),i=e[t.endTime],r=e[t.isAllDay],t=this.parent.localeObj.getConstant("allDay"),s=this.parent.getTimeString(n)+" - "+this.parent.getTimeString(i),i=(je(e.data)||(t=(1<=(i.getTimezoneOffset()!==n.getTimezoneOffset()?i.getTime()-n.getTime()+36e5:i.getTime()-n.getTime())/iOe?t:s)+" ("+this.parent.localeObj.getConstant("day")+" "+e.data.index+"/"+e.data.count+")"),!je(e.data)||r?t:s);return[o,Q("div",{className:u2e,innerHTML:i})]},b3e.prototype.processAgendaEvents=function(e){var t=[];if(!je(e))for(var i=0,n=e;i<n.length;i++)var o=n[i],r=this.parent.eventBase.splitEventByDay(o),t=t.concat(1<r.length?r:o);return t},b3e.prototype.wireEventActions=function(){for(var e=0,t=[].slice.call(this.parent.element.querySelectorAll("."+qNe));e<t.length;e++){var i=t[e];this.parent.eventBase.wireAppointmentEvents(i,this.parent.getEventDetails(i),!0)}for(var n=0,o=[].slice.call(this.parent.element.querySelectorAll(".e-m-date"));n<o.length;n++){i=o[n];E.add(i,"click",this.parent.agendaModule.dayNavigationClick,this)}},b3e.prototype.calculateResourceTableElement=function(e,t,i,n){void 0===n&&(n=null),je(this.parent.resourceBase.lastResourceLevel)&&(l=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),this.parent.resourceBase.generateResourceLevels(l));for(var o=yOe(new Date(i.getTime()),t),r=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?t:1,s=this.parent.resourceBase.resourceCollection,a=this.parent.resourceBase.lastResourceLevel,l=i,h=i,d=this.parent.activeViewOptions.showWeekend,p=0;p<r;p++){var c,u=[],g=[],m=0,f=yOe(h,p);if("Agenda"===this.parent.currentView&&this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.allowVirtualScrolling&&!d&&!this.isWorkDay(f)){do{if(n<=(f=yOe(f,1)))break}while(!this.isWorkDay(f)||this.parent.eventBase.filterEvents(f,yOe(f,1)).length<1);if(n<=f)break;h=yOe(f,-p),o=yOe(f,1)}var y=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?yOe(f,1):o,v=this.parent.eventBase.filterEvents(f,y);if(0<v.length||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView){for(var b=0;b<a.length;b++){t=this.parent.activeViewOptions.group.byDate&&"MonthAgenda"!==this.parent.currentView?1:t;var w=[],C=(i=f,this.parent.eventBase.filterEvents(i,o,v,a[parseInt(b.toString(),10)]));if(0<C.length||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView)for(var S=0;S<t;S++){var A=this.parent.eventBase.filterEvents(i,yOe(i,1),C,void 0);if(((d||!d&&(this.parent.group.byDate?this.isWorkDay(i):this.isWorkDay(i,a[parseInt(b.toString(),10)].workDays)))&&(0<A.length||!this.parent.hideEmptyAgendaDays)||"MonthAgenda"===this.parent.currentView)&&(w.push(A[0]),A={rowSpan:1,type:"eventColumn",resource:s[s.length-1],groupIndex:a[parseInt(b.toString(),10)].groupIndex,groupOrder:a[parseInt(b.toString(),10)].groupOrder,resourceData:a[parseInt(b.toString(),10)].resourceData,eventData:A,date:i},c={rowSpan:1,type:"dateColumn",resource:s[parseInt((s.length-1).toString(),10)],groupOrder:a[parseInt(b.toString(),10)].groupOrder,resourceData:a[parseInt(b.toString(),10)].resourceData,date:i},u[parseInt(m.toString(),10)]||(u[parseInt(m.toString(),10)]=[]),u[parseInt(m.toString(),10)].push(A),u[parseInt(m.toString(),10)].push(c),m++),(i=yOe(i,1)).getTime()>=o.getTime()||this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){0<w.length&&(u[u.length-1][1].cssClass=c2e,A={rowSpan:w.length,type:"resourceColumn",resource:s[parseInt((s.length-1).toString(),10)],groupOrder:a[parseInt(b.toString(),10)].groupOrder.slice(0,-1),resourceData:a[parseInt(b.toString(),10)].resourceData,groupIndex:u.length-w.length,className:[ZNe],date:i},u[parseInt((u.length-w.length).toString(),10)].push(A),g.push(Pe({},A,null,!0)));break}}}for(var x=s.slice(0,-1),I=[],T=0,E=0;E<x.length;E++)for(var w=x[x.length-(E+1)].dataSource,D=0;D<w.length;D++)for(var M=0,k=0;k<g.length;k++)g[parseInt(k.toString(),10)].groupOrder[x.length-(E+1)]===w[parseInt(D.toString(),10)][x[x.length-(E+1)].idField]&&(T+=g[parseInt(k.toString(),10)].rowSpan,I.push(Pe({},g[parseInt(k.toString(),10)],null,!0))),++M===g.length&&0<I.length&&(I[0].rowSpan=T,I[0].type="parentColumnLevel_"+(E+1),I[0].resource=x[x.length-(E+1)],I[0].resourceData=w[parseInt(D.toString(),10)],I[0].date=i,u[I[0].groupIndex].push(I[0]),I=[],T=0);this.createResourceTableRow(u,e)}}0===this.parent.eventBase.filterEvents(l,o).length&&!this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&this.renderEmptyContent(e,l)},b3e.prototype.createResourceTableRow=function(e,t){var i,n=Q("tr"),o=Q("td"),r=0;if(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){for(var s=[],a=this.parent.resourceBase.resourceCollection.slice(0,-1),l=0;l<e.length;l++)s=s.concat(e[parseInt(l.toString(),10)]);for(var h=0<a.length?"parentColumnLevel_"+a.length:"resourceColumn",d=s.filter(function(e){return e.type===h}),p=0;p<d.length;p++)r+=d[parseInt(p.toString(),10)].rowSpan}for(var c=0;c<e.length;c++){for(var u=n.cloneNode(),g=e[parseInt(c.toString(),10)].length-1;0<=g;g--){var m=e[parseInt(c.toString(),10)][parseInt(g.toString(),10)],f=o.cloneNode();if("dateColumn"===m.type)this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?i=e[parseInt(c.toString(),10)][parseInt(g.toString(),10)]:(f.setAttribute("data-date",m.date.getTime().toString()),f.appendChild(this.createDateHeaderElement(m.date)),y=[o2e,h2e],m.cssClass&&y.push(m.cssClass),U([f],y),this.isCurrentDate(new Date(m.date.getTime()))&&U(f.childNodes,r2e),u.appendChild(f));else if("eventColumn"===m.type){for(var y=0===m.eventData.length?"noEvents":"data",v=0;v<u.childNodes.length;v++){var b=u.childNodes.item(v),w=b.classList.contains("e-resource-column")?_Re:HRe;this.parent.trigger(xRe,{elementType:w,element:b,date:m.date,groupIndex:m.groupIndex})}(f=this.createAgendaContentElement(y,m.eventData,f,m.groupOrder,m.groupIndex)).setAttribute("data-date",m.date.getTime().toString()),!this.parent.activeViewOptions.group.byDate&&"MonthAgenda"!==this.parent.currentView||U([f],[o2e,"e-day-padding"]),u.appendChild(f);var C=0===m.eventData.length?NRe:VRe;this.parent.trigger(xRe,{elementType:C,element:f,date:m.date,groupIndex:m.groupIndex})}else f.setAttribute("rowspan",m.rowSpan.toString()),U([f],"e-resource-column"),this.setResourceHeaderContent(f,m,m.className[0]),u.appendChild(f)}if(this.parent.activeViewOptions.group.byDate&&0===c&&"MonthAgenda"!==this.parent.currentView){(f=o.cloneNode()).setAttribute("data-date",i.date.getTime().toString()),f.setAttribute("rowspan",r.toString()),f.appendChild(this.createDateHeaderElement(i.date)),U([f],[o2e,h2e,"e-date-border"]);var S=SOe(this.parent.selectedDate.getTime(),i.date.getTime());if(u.setAttribute("data-row-index",S.toString()),this.parent.element.querySelector('.e-agenda-view tr[data-row-index="'+S+'"]'))break;u.insertBefore(f,u.childNodes[0])}t.appendChild(u)}},b3e.prototype.createDateHeaderElement=function(e){var t,i,n;return this.parent.activeViewOptions.dateHeaderTemplate?(t=Q("div",{className:l2e}),i={date:e,type:"dateHeader"},n=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",ht([].slice.call(this.parent.getDateHeaderTemplate()(i,this.parent,"dateHeaderTemplate",n,!1,void 0,void 0,this.parent.root)),t)):t=this.getMobileDateElement(e,l2e),t},b3e.prototype.renderEmptyContent=function(e,t,i){var n=this.createTableRowElement(t,"noEvents"),o=n.children[0],r=Q("div",{className:"e-empty-event",innerHTML:this.parent.localeObj.getConstant("noEvents")});o.appendChild(r),e.appendChild(n),i&&this.parent.trigger(xRe,{elementType:NRe,element:o,date:t})},b3e.prototype.createTableRowElement=function(e,t){var i=SOe(this.parent.selectedDate.getTime(),e.getTime()),n=Q("tr",{attrs:{"data-row-index":i.toString()}}),i=Q("td",{attrs:{class:"monthHeader"===t?a2e:o2e,"aria-selected":"false","data-column-index":i.toString(),"data-date":e.getTime().toString()}}),e=i.cloneNode(),i=i.cloneNode();return n.appendChild(e),"noEvents"!==t&&n.appendChild(i),n},b3e.prototype.destroy=function(){y3e.prototype.destroy.call(this)};var f3e,y3e,v3e=b3e;function b3e(e){return y3e.call(this,e)||this}w3e=function(e,t){return(w3e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}w3e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(A3e,C3e=v3e),A3e.prototype.getModuleName=function(){return"agenda"},A3e.prototype.renderLayout=function(){this.agendaDates={},this.element=Q("div",{className:e2e}),U([this.element],this.viewClass),this.element.appendChild(this.createTableLayout(t2e)),this.element.querySelector("table").setAttribute("role","presentation"),this.parent.element.querySelector("."+qOe).appendChild(this.element);var e=Q("tr"),t=(this.element.querySelector("tbody").appendChild(e),Q("td")),e=(e.appendChild(t),Q("div",{className:i2e})),t=(t.appendChild(e),this.createTableLayout(KOe)),e=(this.setAriaAttributes(t),e.appendChild(t),t.querySelector("tbody")),t=gOe(this.parent.selectedDate);this.renderEmptyContent(e,t),this.wireEvents(),this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+NNe)&&this.renderResourceMobileLayout(),this.parent.notify(YRe,{})},A3e.prototype.eventLoad=function(e){this.dataSource=Pe([],this.parent.eventsData,null,!0);for(var t=0,i=this.parent.eventsData;t<i.length;t++)delete i[t].generatedDates;var e=this.parent.activeViewOptions.allowVirtualScrolling?e.processedData:this.parent.eventsProcessed,n=(this.parent.uiStateValues.isGroupAdaptive&&(n=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],this.dataSource=this.parent.eventBase.filterEventsByResource(n,this.dataSource),e=this.parent.eventBase.filterEventsByResource(n,e)),this.parent.eventsProcessed=this.processAgendaEvents(e),gOe(this.parent.selectedDate)),e=this.element.querySelector("."+KOe+" tbody");kOe(e),this.renderInitialContent(e,n),this.wireEventActions(),z(e,"."+i2e).scrollTop=1,this.parent.notify(GRe,{}),this.parent.activeViewOptions.allowVirtualScrolling||this.retainScrollPosition()},A3e.prototype.refreshEvent=function(e){for(var t=[],i=this.parent.eventFields,n=0,o=this.dataSource;n<o.length;n++){var r=o[n];je(r[i.recurrenceID])&&!je(r[i.recurrenceRule])&&!je(r.generatedDates)&&e>=r.generatedDates.end&&(t=t.concat(this.parent.eventBase.generateOccurrence(r,e)))}this.parent.eventsProcessed=this.parent.eventsProcessed.concat(this.processAgendaEvents(t))},A3e.prototype.refreshHeader=function(){var e=this.element.querySelector("."+KOe+" tbody"),t=(this.parent.activeViewOptions.group.byDate?kOe(e):ue(e.firstElementChild),gOe(this.parent.selectedDate)),i=Q("tbody"),t=new Date(t.getTime()),n=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(t):yOe(t,this.parent.agendaDaysCount);this.renderContent(i,t,n),ht([].slice.call(i.childNodes),e)},A3e.prototype.renderInitialContent=function(e,t){var i=Q("tbody"),n=new Date(t.getTime()),o=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(n):yOe(n,this.parent.agendaDaysCount);if(this.renderContent(i,n,o),ht([].slice.call(i.childNodes),e),this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&0<this.parent.eventsData.length)for(var r=this.getContentAreaElement(),s=r.querySelector(".e-content-table");r.offsetWidth<=r.clientWidth&&!(this.parent.isAdaptive&&s.offsetHeight>=r.clientHeight);){var a=Q("tbody"),n=yOe(o=n,-this.parent.agendaDaysCount);if(this.renderContent(a,n,o),lt([].slice.call(a.childNodes),e),n<=this.parent.minDate)break}e.childNodes.length<=0&&this.renderEmptyContent(e,t,!0)},A3e.prototype.renderContent=function(e,t,i){var n,o=this.parent.eventFields,r=new Date(t.getTime()),s=this.appointmentFiltering(r,i);if(0<s.length&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays)if(this.parent.activeViewOptions.showWeekend||this.isAgendaWorkDay(s[0][o.startTime]))t=new Date(new Date(s[0][o.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(s[0][o.startTime]);else for(var a=0,l=s;a<l.length;a++){var h=l[a];if(this.isAgendaWorkDay(h[o.startTime])){t=new Date(new Date(h[o.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(h[o.startTime]);break}}if(!this.parent.hideEmptyAgendaDays||0<this.parent.agendaDaysCount&&0<s.length){if(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive){s=t;this.parent.activeViewOptions.group.byDate||(this.parent.activeViewOptions.allowVirtualScrolling=!1,s=r,this.parent.headerModule&&(this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))),this.calculateResourceTableElement(e,this.parent.agendaDaysCount,s,i)}else for(var d=0;d<this.parent.agendaDaysCount;d++){var p=this.createTableRowElement(t,"data"),c=this.element.querySelector('tr[data-row-index="'+ +p.dataset.rowIndex+'"]');if(c||!this.parent.activeViewOptions.showWeekend&&!this.isAgendaWorkDay(t)){if(t=yOe(t,1),!c&&this.parent.activeViewOptions.allowVirtualScrolling&&d--,t.getTime()>i.getTime())break}else{var u,c=p.children[0],g=p.children[1],m=this.appointmentFiltering(t);if(0<m.length||!this.parent.hideEmptyAgendaDays&&0===m.length?(u=this.parent.hideEmptyAgendaDays||0!==m.length?"data":"noEvents",c.appendChild(this.createDateHeaderElement(t)),p.appendChild(c),this.parent.trigger(xRe,{elementType:HRe,element:c,date:t}),u=this.createAgendaContentElement(u,m,g),p.appendChild(u),0<u.querySelectorAll("li").length&&e.appendChild(p),g=this.parent.hideEmptyAgendaDays||0!==m.length?VRe:NRe,this.parent.trigger(xRe,{elementType:g,element:u,date:t})):this.parent.activeViewOptions.allowVirtualScrolling&&d--,this.isCurrentDate(new Date(t.getTime()))&&U(c.childNodes,r2e),(t=yOe(t,1)).getTime()>i.getTime())break}}n=new Date(t.getTime()-iOe)}this.agendaDates={start:r,end:n}},A3e.prototype.isAgendaWorkDay=function(e){return this.parent.uiStateValues.isGroupAdaptive&&!this.parent.group.byDate?this.isWorkDay(e,this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].workDays):this.isWorkDay(e)},A3e.prototype.agendaScrolling=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),this.parent.activeViewOptions.allowVirtualScrolling&&this.virtualScrolling(e),this.parent.activeViewOptions.allowVirtualScrolling||this.setPersistence()},A3e.prototype.virtualScrolling=function(e){var t,i=e.target,n=i.scrollTop,o=i.scrollHeight,r=n+i.clientHeight,s=this.virtualScrollTop<n?"next":"previous",a=i.querySelector("tbody"),l=Q("tbody"),h=this.getElementFromScrollerPosition(e),e=this.parent.getDateFromElement(h);if(0===n){if(t=this.getPreviousNextDate(yOe(e,-1),s),0<this.appointmentFiltering(t.start,t.end).length||!this.parent.hideEmptyAgendaDays){this.renderContent(l,t.start,t.end),lt([].slice.call(l.childNodes),a),this.wireEventActions();for(var d=0,p=a.children;d<p.length;d++)if(p[parseInt(d.toString(),10)].getAttribute("data-row-index")===h.getAttribute("data-column-index")){var c=p[parseInt(d.toString(),10)].offsetTop-this.element.querySelector(".e-agenda-item").offsetHeight;i.scrollTop=c;break}this.updateHeaderText(e)}}else o-5<=r?(t=this.getPreviousNextDate(yOe(e,1),s),(0<this.appointmentFiltering(t.start,t.end).length||!this.parent.hideEmptyAgendaDays)&&(this.renderContent(l,t.start,t.end),ht([].slice.call(l.childNodes),a),this.wireEventActions(),this.updateHeaderText(e))):this.updateHeaderText(e);this.virtualScrollTop=n;o=this.parent.eventBase.getSelectedAppointments();0<o.length&&o[o.length-1].focus()},A3e.prototype.getElementFromScrollerPosition=function(e){var t,i,e=e.target,n=e.scrollTop,o=e.scrollHeight,r=n+e.clientHeight,s=[].slice.call(e.querySelectorAll(".e-agenda-item"));if(0<s.length)if(0===n)t=z(i=s[0],"."+o2e);else if(r===o)t=z(i=s[s.length-1],"."+o2e);else for(var a=0,l=s.length;a<l;a++)if(0<=(i=s[parseInt(a.toString(),10)]).getBoundingClientRect().top){t=z(i,"."+o2e);break}return t},A3e.prototype.updateHeaderText=function(e){this.parent.showHeaderBar&&this.parent.headerModule.updateDateRange(e)},A3e.prototype.getPreviousNextDate=function(e,t){var i=new Date(e.getTime()),n=this.getStartDateFromEndDate(e),o=this.getEndDateFromStartDate(e),r=0;do{}while(((this.parent.activeViewOptions.showWeekend||!this.parent.activeViewOptions.showWeekend&&this.isAgendaWorkDay(i))&&(0<this.appointmentFiltering(i).length||!this.parent.hideEmptyAgendaDays)&&r++,!((i=yOe(i,"next"===t?1:-1))<n||o<i))&&r!==this.parent.agendaDaysCount);var s=yOe(i,"next"===t?-1:1);return"next"===t?{start:e,end:yOe(s,1)}:{start:s,end:yOe(e,1)}},A3e.prototype.appointmentFiltering=function(e,t){var i,t=!je(e)&&je(t)?(i=gOe(new Date(e.getTime())),uOe(new Date(i.getTime()),iOe)):(i=new Date(e.getTime()),new Date(t.getTime())),n=this.parent.eventBase.filterEvents(i,t);return 0===n.length&&(this.refreshEvent(e),n=this.parent.eventBase.filterEvents(i,t)),n},A3e.prototype.getStartDateFromEndDate=function(e){var t,i=this.parent.eventFields;return gOe(0<this.parent.eventsProcessed.length?(t=Math.min.apply(Math,this.parent.eventsProcessed.map(function(e){return e[i.startTime].getTime()})),this.parent.hideEmptyAgendaDays?new Date(t):this.parent.minDate):this.parent.hideEmptyAgendaDays?vOe(e,-1):this.parent.minDate)},A3e.prototype.getEndDateFromStartDate=function(e){var t,i=this.parent.eventFields;return gOe(yOe(0<this.parent.eventsProcessed.length?(t=Math.max.apply(Math,this.parent.eventsProcessed.map(function(e){return e[i.endTime].getTime()})),this.parent.hideEmptyAgendaDays?new Date(t):this.parent.maxDate):this.parent.hideEmptyAgendaDays?vOe(e,1):this.parent.maxDate,1))},A3e.prototype.getNextPreviousDate=function(e){return yOe(this.parent.selectedDate,"Next"===e?1:-1)},A3e.prototype.startDate=function(){return gOe(this.parent.selectedDate)},A3e.prototype.endDate=function(){return this.parent.activeViewOptions.allowVirtualScrolling?this.getEndDateFromStartDate(this.startDate()):yOe(this.startDate(),this.parent.agendaDaysCount)},A3e.prototype.getDateRangeText=function(e){var t=this.parent.activeViewOptions.dateFormat||"MMMM y";return this.parent.activeViewOptions.allowVirtualScrolling||this.parent.isAdaptive?(e=je(e)?this.parent.selectedDate:e,ROe(this.parent.globalize.formatDate(e,{format:t,calendar:this.parent.getCalendarMode()}),"multiple")):(t=yOe(e=this.parent.selectedDate,this.parent.agendaDaysCount-1),this.formatDateRange(e,t))},A3e.prototype.dayNavigationClick=function(e){var t=z(e.currentTarget,"."+o2e),t=this.parent.getDateFromElement(t);je(t)||this.parent.isAdaptive||!this.parent.isMinMaxDate(t)||(this.parent.setProperties({selectedDate:t},!0),this.parent.changeView("Day",e))},A3e.prototype.wireEvents=function(){E.add(this.element.querySelector("."+i2e),XRe,this.agendaScrolling,this)},A3e.prototype.unWireEvents=function(){E.remove(this.element.querySelector("."+i2e),XRe,this.agendaScrolling);for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-m-date"));e<t.length;e++){var i=t[e];E.remove(i,"click",this.dayNavigationClick)}},A3e.prototype.addEventListener=function(){this.parent.on(JRe,this.onAgendaScrollUiUpdate,this),this.parent.on(qRe,this.eventLoad,this)},A3e.prototype.removeEventListener=function(){this.parent&&(this.parent.off(JRe,this.onAgendaScrollUiUpdate),this.parent.off(qRe,this.eventLoad))},A3e.prototype.onAgendaScrollUiUpdate=function(){var e=this.getHeaderBarHeight(),t=(this.parent.headerModule&&(this.parent.activeViewOptions.allowVirtualScrolling?this.parent.headerModule.updateHeaderItems("add"):this.parent.headerModule.updateHeaderItems("remove")),this.element.querySelector("."+i2e));"auto"!==this.parent.height&&(t.style.height=T(this.parent.element.offsetHeight-e))},A3e.prototype.scrollToDate=function(e){var e=new Date(+gOe(e));this.parent.activeViewOptions.allowVirtualScrolling?(!this.parent.hideEmptyAgendaDays||0<this.parent.getEvents(e,yOe(e,1),!0).length)&&this.parent.changeDate(e):(e=this.element.querySelector("."+o2e+'[data-date="'+e.getTime()+'"]'))&&(this.getContentAreaElement().scrollTop=e.offsetTop)},A3e.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.element&&(this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.headerModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.headerModule.updateHeaderItems("remove"),C3e.prototype.destroy.call(this))};var w3e,C3e,S3e=A3e;function A3e(e){e=C3e.call(this,e)||this;return e.viewClass="e-agenda-view",e.isInverseTableSelect=!1,e.agendaDates={},e.virtualScrollTop=1,e}x3e=function(e,t){return(x3e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}x3e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(E3e,I3e=d3e),E3e.prototype.getModuleName=function(){return"monthAgenda"},E3e.prototype.renderAppointmentContainer=function(){var e=this.getContentAreaElement(),t=Q("div",{className:QNe}),e=(e.appendChild(t),Q("div",{className:WNe}));t.appendChild(e),this.appendAppContainer(e),this.setEventWrapperHeight()},E3e.prototype.getDayNameFormat=function(){return this.parent.isAdaptive?"narrow":"abbreviated"},E3e.prototype.updateSelectedCellClass=function(e){gOe(e.date).getTime()===gOe(new Date(""+this.parent.selectedDate)).getTime()&&e.className.push(HNe)},E3e.prototype.setEventWrapperHeight=function(){var e=(this.parent.headerModule?this.parent.headerModule.getHeaderElement().offsetHeight:0)+2,t=this.parent.element.querySelector("."+_Ne),t=(t&&(e+=t.offsetHeight),this.getContentAreaElement().firstElementChild),i=this.element.querySelector("."+eNe),e=this.parent.element.offsetHeight-e-i.offsetHeight,i=1<this.parent.activeViewOptions.interval?Math.round(.8*e):t.offsetHeight,e=e-i,n=this.element.querySelector("."+QNe),o=this.element.querySelector("."+WNe);"auto"!==this.parent.height&&(1<this.parent.activeViewOptions.interval&&(t.style.height=T(i),E.add(t,"scroll",this.onContentScroll,this)),n.style.height=o.style.height=T(e))},E3e.prototype.onDataReady=function(e){this.setEventWrapperHeight(),this.clearElements();for(var t,e=e.processedData,i=(this.parent.uiStateValues.isGroupAdaptive&&(t=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],e=this.parent.eventBase.filterEventsByResource(t,e)),this.agendaBase=this.getAgendaBase(),this.parent.eventsProcessed=this.agendaBase.processAgendaEvents(e),0),n=0,o=this.renderDates;n<o.length;n++){var r=o[n],s=this.appointmentFiltering(r),a=this.element.querySelectorAll("."+JOe)[parseInt(i.toString(),10)];0<s.length&&(a.querySelector("."+m2e)||a.appendChild(Q("div",{className:m2e})),r.getTime()===gOe(new Date(this.monthAgendaDate.getTime())).getTime())&&this.onEventRender(s,r),i++}this.parent.notify(GRe,{})},E3e.prototype.onCellClick=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide();var t=this.appointmentFiltering(e.startTime);this.onEventRender(t,e.startTime),this.parent.notify(GRe,{}),this.monthAgendaDate=new Date(""+e.startTime),this.parent.setProperties({selectedDate:this.monthAgendaDate},!0)},E3e.prototype.onEventRender=function(e,t){this.agendaBase=this.getAgendaBase();var i,n=this.element.querySelector("."+WNe);kOe(n),0===this.parent.activeViewOptions.group.resources.length||this.parent.uiStateValues.isGroupAdaptive?0<e.length?(i=Q("div",{className:UNe}),n.appendChild(this.agendaBase.createAgendaContentElement("data",e,i))):this.appendAppContainer(n):0<e.length?(e=(i=this.createTableLayout()).querySelector("tbody"),this.agendaBase.calculateResourceTableElement(e,1,t),i.appendChild(e),n.appendChild(i)):this.appendAppContainer(n),this.agendaBase.wireEventActions()},E3e.prototype.appointmentFiltering=function(e){var e=gOe(new Date(e.getTime())),t=uOe(new Date(e.getTime()),iOe);return this.parent.eventBase.filterEvents(e,t)},E3e.prototype.clearElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+m2e));e<t.length;e++)ue(t[e]);this.appendAppContainer(this.element.querySelector("."+WNe))},E3e.prototype.appendAppContainer=function(e){var t=Q("div",{className:UNe});U([t],g2e),t.innerHTML=this.parent.localeObj.getConstant("noEvents"),kOe(e),e.appendChild(t)},E3e.prototype.getNextPreviousDate=function(e){var t=this.parent.selectedDate,i="Next"===e?this.parent.activeViewOptions.interval:-this.parent.activeViewOptions.interval,i=vOe(this.parent.selectedDate,i),e="Next"===e?2:0,t=new Date(t.getFullYear(),t.getMonth()+e,0).getDate(),e=t>=this.monthAgendaDate.getDate()?this.monthAgendaDate.getDate():t;return this.monthAgendaDate=new Date(i.getFullYear(),i.getMonth(),e),this.monthAgendaDate},E3e.prototype.getAgendaBase=function(){return this.agendaBase||new v3e(this.parent)},E3e.prototype.destroy=function(){this.agendaBase&&(this.agendaBase.destroy(),this.agendaBase=null),I3e.prototype.destroy.call(this)};var x3e,I3e,T3e=E3e;function E3e(e){var t=I3e.call(this,e)||this;return t.dayNameFormat="narrow",t.viewClass="e-month-agenda-view",t.monthAgendaDate=new Date(""+e.selectedDate),t}M3e.prototype.groupByYear=function(e){for(var t={},i=0,n=e;i<n.length;i++){var o=n[i],r=o.getFullYear();t[parseInt(r.toString(),10)]=t[parseInt(r.toString(),10)]||[],t[parseInt(r.toString(),10)].push(o)}return t},M3e.prototype.groupByMonth=function(e){for(var t={},i=0,n=e;i<n.length;i++){var o=n[i],r=12*(o.getFullYear()-1970)+o.getMonth();t[parseInt(r.toString(),10)]=t[parseInt(r.toString(),10)]||[],t[parseInt(r.toString(),10)].push(o)}return t},M3e.prototype.groupByWeek=function(e){for(var t={},i=0,n=e;i<n.length;i++){var o=n[i],r=+new Date(1970,0,1),s=o.getTimezoneOffset()-new Date(1970,0,1).getTimezoneOffset(),s=Math.ceil(((+o-r-60*s*1e3)/iOe+new Date(r).getDay()+1)/7);this.parent.activeViewOptions.firstDayOfWeek&&this.parent.activeViewOptions.firstDayOfWeek>new Date(+o).getDay()&&(s-=1),t[parseInt(s.toString(),10)]=t[parseInt(s.toString(),10)]||[],t[parseInt(s.toString(),10)].push(o)}return t},M3e.prototype.generateSlots=function(e,t,i,n,o){for(var r=this,s=function(e,t){return r.parent.globalize.formatDate(e,{format:t,calendar:r.parent.getCalendarMode()})},a=[],l=Object.keys(e),h=0;h<l.length;h++){var d=e[l[parseInt(h.toString(),10)]],p=void 0;if(i.template)var c={date:d[0],type:o},u=this.parent.element.id+"_headerRowTemplate",p=[].slice.call(this.parent.templateParser(i.template)(c,this.parent,"template",u,!1));else{var g=void 0;switch(i.option){case"Year":g='<span class="e-header-year">'+s(d[0],"y")+"</span>";break;case"Month":g='<span class="e-header-month">'+ROe(s(d[0],"MMMM"),"single")+"</span>";break;case"Week":g='<span class="e-header-week">'+this.parent.getWeekNumberContent(d)+"</span>"}c=Q("div",{innerHTML:g});p=[].slice.call(c.childNodes)}a.push({date:d[0],type:o,className:[n],colSpan:d.length*t,template:p})}return a},M3e.prototype.generateColumnLevels=function(e,t){for(var i,n,o=[],r=this.parent.activeViewOptions.headerRows,s=1,a=("Hour"===r[r.length-1].option&&0<t.length&&(s=t.length/e.length),[]),l=0,h=r;l<h.length;l++){var d=h[l];switch(d.option){case"Year":i=this.groupByYear(this.renderDates),a=this.generateSlots(i,s,d,"e-header-year-cell","yearHeader"),o.push(a);break;case"Month":i=this.groupByMonth(this.renderDates),a=this.generateSlots(i,s,d,"e-header-month-cell","monthHeader"),o.push(a);break;case"Week":n=this.groupByWeek(this.renderDates),a=this.generateSlots(n,s,d,"e-header-week-cell","weekHeader"),o.push(a);break;case"Date":a=(a=e).map(function(e){return e.colSpan=s,e}),o.push(a);break;case"Hour":0<t.length&&o.push(t)}}return o};var D3e=M3e;function M3e(e,t){this.parent=e,this.renderDates=t}k3e=function(e,t){return(k3e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}k3e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(F3e,P3e=P2),F3e.prototype.getModuleName=function(){return"timelineViews"},F3e.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+fNe)},F3e.prototype.scrollTopPanel=function(e){P3e.prototype.scrollTopPanel.call(this,e),this.scrollHeaderLabels(e)},F3e.prototype.scrollToWorkHour=function(){var e=this.parent.getStartEndTime(this.parent.workHours.start),e=this.isWorkDay(this.parent.selectedDate)&&this.parent.workHours.highlight&&!je(e)?new Date(+this.parent.selectedDate).setHours(e.getHours(),e.getMinutes(),0,0):new Date(+this.parent.selectedDate).setHours(0,0,0,0),e='[data-date="'+new Date(e).getTime().toString()+'"]',e=this.element.querySelector(e);e&&(this.getContentAreaElement().scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):e.offsetLeft)},F3e.prototype.scrollToHour=function(e,t){var i,n,o;t&&0<=(n=this.parent.getIndexOfDate(this.renderDates,gOe(t)))&&(i=t,je(e)||2===(o=e.split(":")).length&&(i=new Date(t.setHours(parseInt(o[0],10),parseInt(o[1],10),0)))),i=je(t)?this.parent.getStartEndTime(e):i,je(i)||(o=je(e)||!this.parent.activeViewOptions.timeScale.enable?n*this.parent.getElementWidth(this.element.querySelector(".e-work-cells")):je(t)?this.getLeftFromDateTime(null,i):this.getLeftFromDateTime([n],i),this.getScrollableElement().scrollLeft=this.parent.enableRtl?-o:o)},F3e.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),i=(e.push(t),0<this.parent.activeViewOptions.group.resources.length&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive),[]);return this.parent.activeViewOptions.timeScale.enable&&(i=this.generateTimeSlots(e[e.length-1]),e.push(i)),e=0<this.parent.activeViewOptions.headerRows.length?new D3e(this.parent,this.renderDates).generateColumnLevels(t,i):e},F3e.prototype.generateTimeSlots=function(e){for(var t=this,i=this.getTimeSlotRows(function(e){return e.type=e.first?"majorSlot":"minorSlot",e.className=e.first?[TNe]:[TNe,INe],e.workDays=t.parent.activeViewOptions.workDays,e}),n=[],o=0,r=e;o<r.length;o++){var s=r[o];s.colSpan=i.length;for(var a=0,l=Pe([],i,null,!0);a<l.length;a++){var h=l[a],d=gOe(new Date(""+s.date));h.date=uOe(d,mOe(h.date)),n.push(h)}}return n},F3e.prototype.changeCurrentTimePosition=function(){var e,t,i;!this.parent||this.parent&&this.parent.isDestroyed||(this.removeCurrentTimeIndicatorElements(),e=this.getCurrentTimeIndicatorIndex(),e=this.getLeftFromDateTime(e,this.parent.getCurrentTime()),i=this.element.querySelector("."+KOe).offsetHeight,t=this.element.querySelector("."+eNe),this.element.querySelector("."+i2e).appendChild(Q("div",{className:MNe,styles:(this.parent.enableRtl?"right":"left")+":"+T(e)+"; height:"+T(i)})),this.parent.virtualScrollModule&&gt(this.parent.element.querySelector("."+MNe),{transform:this.parent.element.querySelector("."+i2e+" table").style.transform}),i=Q("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:DNe}),t.appendChild(i),i.style[this.parent.enableRtl?"right":"left"]=T(e-i.offsetWidth/2))},F3e.prototype.getLeftFromDateTime=function(e,t){var i=this.getStartHour(),n=this.getEndHour(),o=0,r=60*(t.getHours()-i.getHours())+(t.getMinutes()-i.getMinutes()),t=wOe(gOe(new Date(t.getTime())),i,n),t=(t.endHour.getTime()-t.startHour.getTime())/6e4,s=this.parent.activeViewOptions.timeScale.interval,a=0,a=(0!==i.getHours()||0!==i.getMinutes()||0!==n.getHours()||0!==n.getMinutes())&&1===this.parent.activeViewOptions.timeScale.slotCount&&t<s?t:s;return je(e)||0!==e[0]&&(n=this.parent.activeView.colLevels.findIndex(function(e){return"dateHeader"===e[0].type}),this.parent.activeView.colLevels[parseInt(n.toString(),10)]&&this.parent.activeView.colLevels[parseInt(n.toString(),10)][0].colSpan?o=e[0]*this.parent.activeView.colLevels[parseInt(n.toString(),10)][0].colSpan*this.parent.getElementWidth(this.element.querySelector(".e-work-cells")):(s=0===(t=this.getEndHour()).getHours()?24:t.getHours(),r+=e[0]*(60*(s-i.getHours())+(t.getMinutes()-i.getMinutes())))),o+r*this.parent.getElementWidth(this.element.querySelector(".e-work-cells"))*this.parent.activeViewOptions.timeScale.slotCount/a},F3e.prototype.renderHeader=function(){var e=Q("tr"),t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e),Q("td"));t.appendChild(this.renderDatesHeader()),e.appendChild(t),lt([e],this.element.querySelector("tbody"))},F3e.prototype.createAllDayRow=function(e,t){},F3e.prototype.getCurrentTimeIndicatorIndex=function(){var e=[],t=this.parent.getIndexOfDate(this.renderDates,gOe(this.parent.getCurrentTime()));return 0<=t&&e.push(t),e},F3e.prototype.renderContent=function(){var e=Q("tr"),t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&((t=Q("td")).appendChild(this.parent.resourceBase.createResourceColumn()),e.appendChild(t)),Q("td")),i=this.renderContentArea();i.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(i),t.appendChild(i),e.appendChild(t),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(i),this.element.querySelector("tbody").appendChild(e)},F3e.prototype.getRowCount=function(){return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},F3e.prototype.getResourceTdData=function(e,t){var e=this.parent.resourceBase.renderedResources[parseInt(e.toString(),10)],i=e.resourceData[e.resource.startHourField]||this.parent.workHours.start,n=e.resourceData[e.resource.endHourField]||this.parent.workHours.end;return t.startHour=this.parent.getStartEndTime(i),t.endHour=this.parent.getStartEndTime(n),t.workDays=e.resourceData[e.resource.workDaysField]||this.parent.workDays,t.className=e.className,t.groupIndex=e.groupIndex,t.groupOrder=e.groupOrder,t},F3e.prototype.renderContentTable=function(e){e=e.querySelector("tbody");ht(this.getContentRows(),e)},F3e.prototype.getContentRows=function(){for(var e=[],t=Q("tr"),i=Q("td"),n=this.getRowCount(),o=this.getGroupIndices(),r=0;r<n;r++)if(!(0<o.length&&-1<o.indexOf(this.parent.resourceBase.renderedResources[parseInt(r.toString(),10)].groupIndex))){for(var s=t.cloneNode(),a=0,l=this.colLevels[this.colLevels.length-1];a<l.length;a++){var h=l[a],h=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(h=this.getResourceTdData(r,h)),this.createContentTd(h,h,i));s.appendChild(h)}e.push(s)}return e},F3e.prototype.getContentTdClass=function(e){return e.first||!this.parent.activeViewOptions.timeScale.enable?[JOe]:[JOe,ENe]},F3e.prototype.renderEvents=function(){this.timelineAppointment=new FHe(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day"),this.timelineAppointment.renderAppointments(),this.parent.notify(GRe,{})},F3e.prototype.getAdjustedDate=function(e){if(!this.parent.activeViewOptions.timeScale.enable)return new Date(e.setHours(0,0,0,0));for(var t=this.colLevels[this.colLevels.length-1],i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].date.getTime()>e.getTime())return t[i-1].date;return null},F3e.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.timelineAppointment&&(this.timelineAppointment.destroy(),this.timelineAppointment=null),P3e.prototype.destroy.call(this))};var k3e,P3e,B3e=F3e;function F3e(e){e=P3e.call(this,e)||this;return e.timelineAppointment=null,e.baseCssClass="e-timeline-view",e}L3e=function(e,t){return(L3e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}L3e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(N3e,R3e=d3e),N3e.prototype.getModuleName=function(){return"timelineMonth"},N3e.prototype.onDataReady=function(){this.appointment=new FHe(this.parent,"day"),this.appointment.renderAppointments(),this.parent.notify(GRe,{})},N3e.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+fNe)},N3e.prototype.scrollTopPanel=function(e){R3e.prototype.scrollTopPanel.call(this,e),this.scrollHeaderLabels(e)},N3e.prototype.setContentHeight=function(e,t,i){t&&(t.style.height=T(i-this.getScrollXIndent(e))),e.style.height=T(i)},N3e.prototype.getDateSlots=function(e,t){for(var i=[],n=0,o=e;n<o.length;n++){var r=o[n],s=[iNe];this.isCurrentDate(r)&&s.push(rNe),i.push({date:r,type:"dateHeader",className:s,colSpan:1,workDays:t})}return i},N3e.prototype.renderLeftIndent=function(e){0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e)},N3e.prototype.renderContent=function(){var e=Q("tr"),t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&((t=Q("td")).appendChild(this.parent.resourceBase.createResourceColumn()),e.appendChild(t)),Q("td")),i=(this.element.querySelector("tbody").appendChild(e),Q("div",{className:i2e}));i.appendChild(this.renderContentArea()),i.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(i),E.add(i,"scroll",this.onContentScroll,this),t.appendChild(i),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(i),e.appendChild(t)},N3e.prototype.getRowCount=function(){return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},N3e.prototype.getContentSlots=function(){for(var e=[],t=0;t<this.getRowCount();t++)for(var i=0,n=this.colLevels[this.colLevels.length-1];i<n.length;i++){var o=n[i],r=(o.className=[JOe],0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(r=this.parent.resourceBase.renderedResources[parseInt(t.toString(),10)],o.workDays=r.resourceData[r.resource.workDaysField]||this.parent.workDays,o.className=o.className.concat(r.className),o.groupIndex=r.groupIndex,o.groupOrder=r.groupOrder),{date:new Date(+o.date),colSpan:o.colSpan,groupIndex:o.groupIndex,workDays:o.workDays,type:"monthCells",className:o.className});e[parseInt(t.toString(),10)]||(e[parseInt(t.toString(),10)]=[]),e[parseInt(t.toString(),10)].push(r)}return e},N3e.prototype.updateClassList=function(e){this.parent.isMinMaxDate(e.date)||e.className.push(qVe)},N3e.prototype.unWireEvents=function(){E.remove(this.getContentAreaElement(),"scroll",this.onContentScroll)},N3e.prototype.getMonthStart=function(e){e=this.parent.calendarUtil.firstDateOfMonth(gOe(e));return new Date(e.getFullYear(),e.getMonth(),e.getDate())},N3e.prototype.getMonthEnd=function(e){e=this.parent.calendarUtil.firstDateOfMonth(gOe(e));return this.parent.calendarUtil.lastDateOfMonth(vOe(new Date(+e),this.parent.activeViewOptions.interval-1))},N3e.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);e.push(t),0<this.parent.activeViewOptions.group.resources.length&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive);return 0<this.parent.activeViewOptions.headerRows.length&&(e=new D3e(this.parent,this.renderDates).generateColumnLevels(t,[])),this.colLevels=e},N3e.prototype.getAdjustedDate=function(e){for(var t=this.colLevels[this.colLevels.length-1],i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].date.getTime()>e.getTime())return t[i-1].date;return null},N3e.prototype.destroy=function(){var e;!this.parent||this.parent&&this.parent.isDestroyed||(this.element&&(e=this.element.querySelector("."+i2e))&&E.remove(e,"scroll",this.onContentScroll),this.appointment&&(this.appointment.destroy(),this.appointment=null),R3e.prototype.destroy.call(this))};var L3e,R3e,O3e=N3e;function N3e(e){e=R3e.call(this,e)||this;return e.viewClass="e-timeline-month-view",e.isInverseTableSelect=!0,e.appointment=null,e}V3e=function(e,t){return(V3e=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}V3e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(z3e,_3e=g3e),z3e.prototype.getModuleName=function(){return"timelineYear"},z3e.prototype.renderHeader=function(e){var t=Q("tr"),e=(e.appendChild(t),"Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderResourceHeaderIndent(t):(e=Q("td",{className:pNe}),t.appendChild(e),e.appendChild(this.renderResourceHeader(cNe))),"Horizontal"===this.parent.activeViewOptions.orientation),i=0<this.parent.activeViewOptions.group.resources.length,e=(this.isInverseTableSelect=!e||i,Q("td")),i=(t.appendChild(e),Q("div",{className:tNe}));if(e.appendChild(i),"Horizontal"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive)i.appendChild(this.renderResourceHeader(eNe)),this.columnCount=this.colLevels.slice(-1)[0].length;else for(var t=Q("div",{className:eNe}),e=(i.appendChild(t),this.createTableLayout()),n=(t.appendChild(e),e.appendChild(this.createTableColGroup(this.columnCount)),Q("tr")),o=(e.querySelector("tbody").appendChild(n),this.getMonths()),r=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),o[0],1)),s=0;s<this.columnCount;s++){var a=new Date(this.parent.selectedDate.getFullYear(),o[parseInt(s.toString(),10)],1),l=Q("td",{className:iNe});"Horizontal"===this.parent.activeViewOptions.orientation?this.parent.dayHeaderTemplate?ht(this.renderDayMonthHeaderTemplate(r[parseInt(s.toString(),10)],s,"dayHeaderTemplate"),l):l.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[s%7]+"</span>":(this.parent.monthHeaderTemplate?ht(this.renderDayMonthHeaderTemplate(a,o[parseInt(s.toString(),10)],"monthHeaderTemplate"),l):l.innerHTML="<span>"+this.getMonthName(a)+"</span>",l.setAttribute("data-date",a.getTime().toString())),n.appendChild(l),this.parent.trigger(xRe,{elementType:"headerCells",element:l})}},z3e.prototype.renderResourceHeader=function(e){var t=Q("div",{className:e}),i=this.createTableLayout(),n=(t.appendChild(i),Q("tr"));0<this.parent.activeViewOptions.group.resources.length?this.colLevels=this.generateColumnLevels():this.colLevels=[[{className:[iNe],type:"headerCell"}]];for(var o=0,r=this.colLevels;o<r.length;o++){for(var s=r[o],a=n.cloneNode(),l=0,h=e===eNe?s:[s[0]];l<h.length;l++){var d=h[l],p=Q("td"),d=(d.className&&U([p],d.className),e===eNe&&(d.template&&ht(d.template,p),d.colSpan&&p.setAttribute("colspan",d.colSpan.toString()),-1<d.groupIndex&&p.setAttribute("data-group-index",d.groupIndex.toString()),this.setResourceHeaderContent(p,d)),e===cNe&&this.parent.renderHeaderIndentTemplate(d,p),{elementType:d.type,element:p,date:d.date,groupIndex:d.groupIndex});this.parent.trigger(xRe,d),a.appendChild(p)}i.querySelector("tbody").appendChild(a)}return e===eNe&&i.appendChild(this.createTableColGroup(this.colLevels.slice(-1)[0].length)),t},z3e.prototype.renderContent=function(e){var t,i,n=Q("tr"),e=(e.appendChild(n),Q("td")),o=Q("td"),r=[],e=("Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(r.push(e),e.appendChild(this.parent.resourceBase.createResourceColumn()),this.rowCount=this.parent.resourceBase.renderedResources.length):(r.push(e),t=Q("div",{className:l_e}),e.appendChild(t),t.appendChild(this.createTableLayout()),t=t.querySelector("tbody")),r.push(o),ht(r,n),Q("div",{className:i2e})),r=(o.appendChild(e),this.createTableLayout(KOe)),n=(this.setAriaAttributes(r),e.appendChild(r),Q("div",{className:uNe})),o=(e.appendChild(n),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(e),r.querySelector("tbody"));this.parent.rowAutoHeight&&(e=[r],(i=this.parent.element.querySelector("."+l_e+" ."+GOe))&&e.push(i),U(e,r_e)),0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(i="Horizontal"===this.parent.activeViewOptions.orientation?this.colLevels.slice(-1)[0].length:this.columnCount,r.appendChild(this.createTableColGroup(i)),this.renderResourceContent(n,t,o)):(r.appendChild(this.createTableColGroup(this.columnCount)),this.renderDefaultContent(n,t,o))},z3e.prototype.renderDefaultContent=function(e,t,i){for(var n=this.getMonths(),o=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),n[0],1)),r=0;r<this.rowCount;r++){e.appendChild(Q("div",{className:UNe}));for(var s=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(r.toString(),10)],1),a=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),l=this.parent.calendarUtil.getMonthEndDate(new Date(s.getTime())),h=Q("tr"),d=h.cloneNode(),p=(t.appendChild(d),h.cloneNode()),h=(i.appendChild(p),Q("td",{className:a2e})),c=("Horizontal"===this.parent.activeViewOptions.orientation?(this.parent.monthHeaderTemplate?ht(this.renderDayMonthHeaderTemplate(a,r,"monthHeaderTemplate"),h):h.innerHTML="<span>"+this.getMonthName(s)+"</span>",h.setAttribute("data-date",s.getTime().toString())):this.parent.dayHeaderTemplate?ht(this.renderDayMonthHeaderTemplate(o[parseInt(r.toString(),10)],r,"dayHeaderTemplate"),h):h.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[r%7]+"</span>",d.appendChild(h),this.parent.trigger(xRe,{elementType:"leftHeaderCells",element:h}),new Date(a.getTime())),u=0;u<this.columnCount;u++){var g,m,f=void 0,y=(f="Vertical"===this.parent.activeViewOptions.orientation?(s=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(u.toString(),10)],1),a=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),l=this.parent.calendarUtil.getMonthEndDate(new Date(s.getTime())),y=r-a.getDay()+1,c=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(u.toString(),10)],y),0<y&&c.getTime()<l.getTime()):u>=a.getDay()&&c.getTime()<l.getTime(),this.parent.globalize.formatDate(c,{skeleton:"full",calendar:this.parent.getCalendarMode()})),v=Q("td",{className:JOe,attrs:{"aria-label":y}}),b=(p.appendChild(v),Q("div",{className:p2e+" "+d2e,innerHTML:f?this.parent.globalize.formatDate(c,{skeleton:"d",calendar:this.parent.getCalendarMode()}):""}));f?(g=[v],m=[],-1<this.parent.activeViewOptions.workDays.indexOf(c.getDay())&&m.push(nNe),this.parent.isMinMaxDate(c)||U([v],qVe),this.isCurrentDate(c)&&(m.push(rNe),"Horizontal"===this.parent.activeViewOptions.orientation?g.push(this.element.querySelector("."+iNe+":nth-child("+(u+1)+")")):g.push(this.element.querySelectorAll("."+a2e).item(r))),0<m.length&&U(g,m)):(U([v],oNe),this.parent.isMinMaxDate(c)||U([v],qVe)),v.classList.contains(oNe)||(this.renderDates.push(new Date(c)),v.appendChild(b),f&&(v.setAttribute("data-date",c.getTime().toString()),this.wireEvents(v)),this.renderCellTemplate({date:c,type:"workCells"},v),this.parent.trigger(xRe,{elementType:"workCells",element:v,date:c}),f&&"Horizontal"===this.parent.activeViewOptions.orientation&&(c=yOe(new Date(c.getTime()),1)))}}this.renderDates.splice(0,1)},z3e.prototype.getContentRows=function(){for(var e=[],t=this.getMonths(),i=this.getGroupIndices(),n=0;n<this.parent.resourceBase.renderedResources.length;n++){var o=void 0;if(!(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(o=this.parent.resourceBase.renderedResources[parseInt(n.toString(),10)],0<i.length)&&-1<i.indexOf(o.groupIndex)))for(var r=Q("tr"),s=(e.push(r),new Date(this.parent.selectedDate.getFullYear(),t[parseInt(n.toString(),10)],1)),a=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),l=0;l<this.columnCount;l++){var h=[],d=o.groupIndex,s=(-1<(h=h.concat(o.className)).indexOf(bNe)?h.push(gNe):h.push(nNe),new Date(this.parent.selectedDate.getFullYear(),t[parseInt(l.toString(),10)],1)),a=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),p=Q("td",{className:JOe,attrs:{"aria-selected":"false","data-date":a.getTime().toString()}});U([p],h),p.setAttribute("data-group-index",d.toString()),this.renderCellTemplate({date:a,type:"resourceGroupCells",groupIndex:d},p),this.wireEvents(p),this.parent.trigger(xRe,{elementType:"resourceGroupCells",element:p,date:a}),r.appendChild(p)}}return e},z3e.prototype.renderResourceContent=function(e,t,i){for(var n=this.getMonths(),o=0;o<this.rowCount;o++){e.appendChild(Q("div",{className:UNe}));var r,s,a=Q("tr"),l=(i.appendChild(a),void 0),h=("Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(l=this.parent.resourceBase.renderedResources[parseInt(o.toString(),10)]),new Date(this.parent.selectedDate.getFullYear(),n[parseInt(o.toString(),10)],1)),d=this.parent.calendarUtil.getMonthStartDate(new Date(h.getTime()));"Horizontal"===this.parent.activeViewOptions.orientation&&(r=a.cloneNode(),t.appendChild(r),s=Q("td",{className:a2e,attrs:{"data-date":d.getTime().toString()}}),this.parent.monthHeaderTemplate?ht(this.renderDayMonthHeaderTemplate(h,o,"monthHeaderTemplate"),s):s.innerHTML="<span>"+this.getMonthName(h)+"</span>",r.appendChild(s));for(var p=0;p<this.columnCount;p++){var c=[],u=void 0,g=("Vertical"===this.parent.activeViewOptions.orientation?(u=l.groupIndex,-1<(c=c.concat(l.className)).indexOf(bNe)?c.push(gNe):c.push(nNe),h=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(p.toString(),10)],1),d=this.parent.calendarUtil.getMonthStartDate(new Date(h.getTime()))):(u=this.colLevels.slice(-1)[0][parseInt(p.toString(),10)].groupIndex,c.push(nNe)),this.parent.globalize.formatDate(d,{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()})),m=this.parent.globalize.formatDate(this.parent.calendarUtil.getMonthEndDate(new Date(h.getTime())),{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),g=Q("td",{className:JOe,attrs:{"aria-selected":"false","data-date":d.getTime().toString(),"aria-label":g+" "+this.parent.localeObj.getConstant("endAt")+" "+m}});U([g],c),g.setAttribute("data-group-index",u.toString()),this.renderCellTemplate({date:d,type:"resourceGroupCells",groupIndex:u},g),this.wireEvents(g),a.appendChild(g),this.parent.trigger(xRe,{elementType:"resourceGroupCells",element:g,date:d})}}"Vertical"===this.parent.activeViewOptions.orientation&&this.collapseRows(this.parent.element.querySelector("."+i2e))},z3e.prototype.renderDayMonthHeaderTemplate=function(e,t,i){var e={date:e,type:"dayHeaderTemplate"===i?"dayHeader":"monthHeader"},n="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"dayHeaderTemplate",o="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"monthHeaderTemplate";return"dayHeaderTemplate"===i?(e.day=this.parent.getDayNames("wide")[t%7],[].slice.call(this.parent.getDayHeaderTemplate()(e,this.parent,"dayHeaderTemplate",n,!1,void 0,void 0,this.parent.root))):[].slice.call(this.parent.getMonthHeaderTemplate()(e,this.parent,"monthHeaderTemplate",o,!1,void 0,void 0,this.parent.root))},z3e.prototype.renderCellTemplate=function(e,t){var i;this.parent.activeViewOptions.cellTemplate&&!t.classList.contains(oNe)&&(i={date:e.date,type:e.type},e.groupIndex&&(i.groupIndex=e.groupIndex),e=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",ht([].slice.call(this.parent.getCellTemplate()(i,this.parent,"cellTemplate",e,!1,void 0,void 0,this.parent.root)),t))},z3e.prototype.scrollToDate=function(e){var t,i,e=null!==this.parent.activeViewOptions.group.resources&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?+new Date(gOe(hOe(e))):+new Date(gOe(e)),e=this.element.querySelector('[data-date="'+e+'"]');e&&(t=this.getScrollableElement(),this.parent.enableRtl?(i=this.element.querySelector("."+KOe),t.scrollLeft=-(i.offsetWidth-e.offsetLeft-e.offsetWidth)):t.scrollLeft=e.offsetLeft,t.scrollTop=e.offsetTop)},z3e.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector("."+BNe):this.getContentAreaElement()},z3e.prototype.wireEvents=function(e){E.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),E.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||E.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)};var V3e,_3e,H3e=z3e;function z3e(e){e=_3e.call(this,e)||this;return e.viewClass="e-timeline-year-view",e.isInverseTableSelect=!0,e}j3e.prototype.initializeCalendarExport=function(e,t){t=this.getCalendarString(e,t);this.download(t,e)},j3e.prototype.getCalendarString=function(e,t){var h=this,d=t||Pe([],this.parent.eventsData,null,!0),d=this.parent.eventBase.sortByTime(d),p=-1!==navigator.appVersion.indexOf("Win")?"\r\n":"\n",c=[],u=[],g=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),m=this.parent.eventFields;return d.forEach(function(t){var e=t[m.id]||t.Guid||h.parent.eventBase.generateGuid(),i=[],n=(t[m.recurrenceID]&&(e=0<(n=h.filterEvents(u,m.id,t[m.recurrenceID])).length?n[0].UID:e),!t[m.recurrenceID]&&t[m.recurrenceRule]&&t[m.recurrenceException]&&(a=t[m.recurrenceException].split(","),h.filterEvents(d,m.recurrenceID,t[m.id]).forEach(function(e){i.push(bHe(e[m.startTime]))}),n=a.filter(function(e){return-1===i.indexOf(e)}),t[m.recurrenceException]=0<n.length?n.join(",")+",":""),t[m.startTimezone]||g),o=t[m.endTimezone]||g,r=t[m.isReadonly]||!1,s=["BEGIN:VEVENT","LOCATION:"+(t[m.location]||""),"SUMMARY:"+(t[m.subject]||""),"UID:"+e,"DESCRIPTION:"+(t[m.description]||""),"ISREADONLY:"+r,"END:VEVENT"];if(t[m.isAllDay]?(s.splice(4,0,"DTEND;VALUE=DATE:"+h.convertDateToString(t[m.endTime],!0)),s.splice(4,0,"DTSTART;VALUE=DATE:"+h.convertDateToString(t[m.startTime],!0))):t[m.isAllDay]||t[m.recurrenceRule]?(s.splice(4,0,'DTEND;TZID="'+o+'":'+h.convertDateToString(t[m.endTime])),s.splice(4,0,'DTSTART;TZID="'+n+'":'+h.convertDateToString(t[m.startTime]))):(s.splice(4,0,"DTEND:"+h.convertDateToString(t[m.endTime])),s.splice(4,0,"DTSTART:"+h.convertDateToString(t[m.startTime]))),t[m.recurrenceRule]&&s.splice(4,0,"RRULE:"+t[m.recurrenceRule]),t[m.recurrenceException])for(var a=t[m.recurrenceException].split(","),l=0;l<a.length-1;l++)s.splice(5,0,"EXDATE:"+h.convertDateToString(O_e(a[parseInt(l.toString(),10)]),t[m.isAllDay]));t[m.recurrenceID]&&s.splice(4,0,'RECURRENCE-ID;TZID="'+n+'":'+h.convertDateToString(t[m.startTime],t[m.isAllDay]));r=h.customFieldFilter(t,m),0<r.length&&r.forEach(function(e){return s.splice(4,0,e+":"+(t[""+e]||""))}),o=Pe({},t);o.UID=e,u.push(o),c.push(s.join(p))}),["BEGIN:VCALENDAR","PRODID:-//Syncfusion Inc//Scheduler//EN","VERSION:2.0","CALSCALE:GREGORIAN","METHOD:PUBLISH","X-WR-CALNAME:"+(e||"Calendar"),"X-WR-TIMEZONE:"+g].join(p)+p+c.join(p)+p+"END:VCALENDAR"},j3e.prototype.customFieldFilter=function(e,t){var i=Object.keys(t).map(function(e){return t[""+e]});return Object.keys(e).filter(function(e){return-1===i.indexOf(e)&&"Guid"!==e})},j3e.prototype.convertDateToString=function(e,t){var i=("0000"+e.getFullYear().toString()).slice(-4),n=("00"+(e.getMonth()+1).toString()).slice(-2),o=("00"+e.getDate().toString()).slice(-2),r=("00"+e.getHours().toString()).slice(-2),s=("00"+e.getMinutes().toString()).slice(-2),e=("00"+e.getSeconds().toString()).slice(-2);return t?i+n+o:i+n+o+"T"+r+s+e},j3e.prototype.download=function(e,t){var i,e=new Blob([e],{type:"data:text/calendar;charset=utf8"});t=(t||"Calendar")+".ics",navigator.msSaveBlob?navigator.msSaveBlob(e,t):((i=document.createElementNS("http://www.w3.org/1999/xhtml","a")).download=t,i.href=URL.createObjectURL(e),(t=document.createEvent("MouseEvent")).initEvent("click",!0,!0),i.dispatchEvent(t),setTimeout(function(){URL.revokeObjectURL(i.href),i.href=void 0}))},j3e.prototype.filterEvents=function(e,t,i){return e.filter(function(e){return e[""+t]===i})},j3e.prototype.getModuleName=function(){return"iCalendarExport"},j3e.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.parent=null)};aN=j3e;function j3e(e){this.parent=e}W3e.prototype.initializeCalendarImport=function(e){var t,i=this;e&&e instanceof Blob?((t=new FileReader).onload=function(){var e=t.result;i.iCalendarParser(e)},t.readAsText(e,"UTF-8")):e&&"string"==typeof e&&this.iCalendarParser(e)},W3e.prototype.iCalendarParser=function(e){var t={isEvent:!1,curEvent:null,id:this.parent.eventBase.getEventMaxID(),count:0,events:[],key:null},i=e.length,n=e.search(/[^ \t]/),o=n;do{var r=0===(o=e.indexOf("\n",n)+1)?(o=i,0):1<o&&"\r"===e[o-2]?2:1,s=e.charAt(n)}while(" "===s||"\n"===s||"\t"===s?a+=e.slice(n+1,o-r):(a&&(t=this.updateEventData(a,t)),a=e.slice(n,o-r)),(n=o)!==i);var a,l=Pe([],(t=(a=a.trim()).length?this.updateEventData(a,t):t).events,null,!0);this.parent.addEvent(this.processOccurrence(l,t.id))},W3e.prototype.updateEventData=function(e,t){var i=this.parent.eventFields,n=t.id,o=t.events,r=t.isEvent,s=t.count,a=t.curEvent,t=t.key;if(r||"BEGIN:VEVENT"!==e||(r=!0,a={}),r&&"END:VEVENT"===e&&(r=!1,o.push(a),a=null),r){var l,h=e.indexOf(":"),d=e.substring(0,h).replace(/^\s\s*/,"").replace(/\s\s*$/,""),p=e.substring(h+1,e.length).replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(-1!==e.indexOf("SUMMARY")&&(d="SUMMARY"),-1!==e.indexOf("DTSTART"))a[i.startTime]=this.dateParsing(e),a[i.isAllDay]=this.allDay,this.allDay=!1;else if(-1!==e.indexOf("DTEND"))a[i.endTime]=this.dateParsing(e);else if(-1!==e.indexOf("EXDATE"))p=bHe(this.dateParsing(e)),a[i.recurrenceException]=je(a[i.recurrenceException])?p:a[i.recurrenceException]+","+p;else if(-1!==e.indexOf("RECURRENCE-ID"))p=bHe(this.dateParsing(e)),a[i.recurrenceException]=p,a[i.recurrenceID]=p;else switch(t=d||t){case"BEGIN":break;case"UID":a[""+d]=p,"number"==typeof n?(a[i.id]=parseInt(p,10),isNaN(a[i.id])&&(a[i.id]=n+s,s++)):a[i.id]=p;break;case"SUMMARY":a[i.subject]=this.getFormattedString(p);break;case"LOCATION":a[i.location]=this.getFormattedString(p);break;case"DESCRIPTION":a[i.description]?a[i.description]=this.getFormattedString(a[i.description]+"\r\n"+p):a[i.description]=this.getFormattedString(p);break;case"ISREADONLY":a[i.isReadonly]=-1<p.indexOf("true");break;case"RRULE":a[i.recurrenceRule]=p;break;default:0<this.parent.resourceCollection.length?(l=this.parent.resourceCollection.filter(function(e){return e.field===d}),a[""+d]=0<l.length&&"number"==typeof l[0].dataSource[0][l[0].idField]?parseInt(p,10):p):a[""+d]=p}}return{isEvent:r,curEvent:a,id:n,count:s,events:o,key:t}},W3e.prototype.processOccurrence=function(s,a){var l=this,h=[],d=this.parent.eventFields,p=[];return this.parent.eventsData.forEach(function(e){p.push(e[d.id])}),s.forEach(function(t){var e;if(t.hasOwnProperty(d.recurrenceID)||(o=(e=t)[d.id]),p.indexOf(t[d.id])<0){var i=s.filter(function(e){return e.UID===t.UID});if(1<i.length&&je(t[d.recurrenceID])){for(var n,o="number"==typeof a?a++:o,r=0;r<i.length;r++)i[parseInt(r.toString(),10)].hasOwnProperty(d.recurrenceID)&&(n=i[parseInt(r.toString(),10)][d.recurrenceID],i[parseInt(r.toString(),10)][d.id]="number"==typeof a?a++:l.parent.eventBase.generateGuid(),i[parseInt(r.toString(),10)][d.recurrenceID]=o,i[parseInt(r.toString(),10)][d.recurrenceException]=null,e[d.recurrenceException]=l.getExcludeDateString(e[d.recurrenceException],n),delete i[parseInt(r.toString(),10)].UID,h.push(i[parseInt(r.toString(),10)]));delete e.UID,e[d.id]=o,h.push(e)}else t.hasOwnProperty(d.recurrenceID)||(delete t.UID,t[d.id]="number"==typeof a?a++:o,h.push(t))}}),h},W3e.prototype.getExcludeDateString=function(e,t){var i,n;return je(e)?t:je(t)||(i=e.split(",").map(function(e){return e.split("T")[0]}),n=t.split(",").map(function(e){return e.split("T")[0]}),0<i.filter(function(e){return-1<n.indexOf(e)}).length)?e:e+","+t},W3e.prototype.getFormattedString=function(e){return(e=e||"").replace(/\\\,/g,",").replace(/\\\;/g,";").replace(/\\[nN]/g,"\n").replace(/\\\\/g,"\\")},W3e.prototype.dateParsing=function(e){var t=e.split(":"),t=t[t.length-1],i=new Date(this.getFormattedString(t)),n=(e&&(-1<e.indexOf("VALUE=DATE")||-1<e.indexOf("RECURRENCE-ID;TZID"))&&(null!==(n=/^(\d{4})(\d{2})(\d{2})$/.exec(t))&&(i=new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10))),-1<e.indexOf("DTSTART"))&&(this.allDay=!0),/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(Z)?$/.exec(t));return i=null!==n?"Z"===n[7]?new Date(Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10))):new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)):i},W3e.prototype.getModuleName=function(){return"iCalendarImport"},W3e.prototype.destroy=function(){this.parent&&this.parent&&this.parent.isDestroyed};M$=W3e;function W3e(e){this.allDay=!1,this.parent=e}Q3e.prototype.initializeExcelExport=function(e){var t,i=this.getExportColumns(e=void 0===e?{}:e),n=e.fileName||"Schedule",o=e.exportType||"xlsx",r=e.includeOccurrences||!1;je(e.separator)||","===e.separator||(t=e.separator),e=e.customData?r?this.parent.eventBase.getProcessedEvents(e.customData):e.customData:r?this.parent.eventsProcessed:this.parent.eventsData,this.processWorkbook(i,n,o,e,t)},Q3e.prototype.processWorkbook=function(t,i,n,e,o){var r=this,s=[],a=[],l=[],h=(t.forEach(function(e,t){s.push({index:t+1,width:"Id"===e.name?50:150})}),{fontSize:12,borders:{color:"#E0E0E0"},bold:!0}),e=(t.forEach(function(e,t){l.push({index:t+1,value:e.text,style:h})}),a.push({index:1,cells:l}),e.forEach(function(i,e){var n=[];t.forEach(function(e,t){t={index:t+1,value:i[e.name]||""};e.name!==r.parent.eventFields.startTime&&e.name!==r.parent.eventFields.endTime||(t=Pe({},t,{style:{fontSize:12,numberFormat:"m/d/yyyy h:mm a"}},!0)),n.push(t)}),a.push({index:e+2,cells:n})}),[{columns:s,rows:a}]);this.parent.trigger(WRe,{cancel:!1,worksheets:e},function(e){e.cancel||new oK({worksheets:e.worksheets},n,r.parent.locale,void 0,o).save(i+"."+n)})},Q3e.prototype.getExportColumns=function(e){var t=this,i=e.fieldsInfo||[];return 0===i.length&&(e.fields||Object.keys(this.parent.eventFields).map(function(e){return t.parent.eventFields[""+e]})).forEach(function(e){i.push({name:e,text:e})}),i},Q3e.prototype.getModuleName=function(){return"excelExport"},Q3e.prototype.destroy=function(){this.parent=null};Xo=Q3e;function Q3e(e){this.parent=e}U3e.prototype.print=function(e){je(e)?this.printScheduler():this.printSchedulerWithModel(e)},U3e.prototype.printScheduler=function(){var l=this,h=this.parent.element.cloneNode(!0);h.id=this.parent.element.id+"_print",this.parent.trigger(jRe,{cancel:!1,printElement:h},function(e){if(!e.cancel){document.body.appendChild(h);for(var t="MonthAgenda"===l.parent.currentView?".e-appointment-wrap":".e-content-wrap",i=l.parent.element.querySelector(t),n="",o=0,r=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("link, style"));o<r.length;o++)n+=r[o].outerHTML;var e=Q("div"),s=(h.style.width=l.parent.element.offsetWidth+"px",100*Math.round(parseInt(h.style.width,10)/100)),a=(e.appendChild(h),window.open("","print","height=550,width="+s+",tabbar=no"));a.document.write("<!DOCTYPE html><html><head>"+n+"</head><body>"+e.innerHTML+"<script>(function() { window.ready = true; })();<\/script></body></html>"),a.document.close(),a.focus(),setTimeout(function(){var e;a.ready&&i&&(i.scrollLeft=i.scrollLeft,i.scrollTop=i.scrollTop,(e=a.document.querySelector(".e-date-header-wrap"))&&(e.scrollLeft=i.scrollLeft),(e=a.document.querySelector(".e-time-cells-wrap"))&&(e.scrollTop=i.scrollTop),(e=a.document.querySelector(t))&&(e.scrollLeft=i.scrollLeft,e.scrollTop=i.scrollTop),a.print(),a.close())},500)}})},U3e.prototype.printSchedulerWithModel=function(e){var t=this,i=Q("div",{id:this.parent.element.id+"_print",className:"e-print-schedule"}),e=(document.body.appendChild(i),Fje.Inject(Zje,i3e,s3e,d3e,S3e,T3e,B3e,O3e,g3e,H3e),this.printInstance=new Fje(this.getPrintScheduleModel(e)),this.printInstance.isPrinting=!0,this.printInstance.registeredTemplate=this.parent.registeredTemplate,this.printInstance.root=this.parent.root||this.parent,this.printInstance.appendTo(i),{cancel:!1,printElement:i});this.parent.trigger(jRe,e,function(e){e.cancel?t.printCleanup():(t.printInstance.on(URe,t.contentReady,t),t.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),t.printWindow.moveTo(0,0),t.printWindow.resizeTo(screen.availWidth,screen.availHeight))})},U3e.prototype.getPrintScheduleModel=function(e){for(var t,i,n={},o=["cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","dateHeaderTemplate","dateRangeTemplate","eventTemplate","resourceHeaderTemplate","headerIndentTemplate"],r=["actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"],s=0,a=["agendaDaysCount","calendarMode","cssClass","currentView","dateFormat","enableRtl","endHour","eventSettings","firstDayOfWeek","firstMonthOfYear","group","height","locale","maxDate","minDate","readonly","resources","rowAutoHeight","selectedDate","showHeaderBar","showTimeIndicator","showWeekNumber","showWeekend","startHour","timeFormat","timeScale","timezone","views","width","workDays","workHours","dateHeaderTemplate","dateRangeTemplate","cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","resourceHeaderTemplate","headerIndentTemplate","actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"];s<a.length;s++){var l=a[s];switch(l){case"eventSettings":(t=Object.assign({},this.parent.eventSettings.properties)).dataSource=this.parent.eventsData;var h=(je(e.eventSettings)||je(e.eventSettings.template)?t:e.eventSettings).template;t.template=this.parent.isAngular||"function"!=typeof h?h:null,n.eventSettings=t;break;case"group":(h=(je(e.group)?this.parent:e).group).headerTooltipTemplate=null,n.group=h;break;case"timeScale":t=(je(e.timeScale)?this.parent:e).timeScale,this.parent.isAngular||(t.majorSlotTemplate="function"==typeof t.majorSlotTemplate?null:t.majorSlotTemplate,t.minorSlotTemplate="function"==typeof t.minorSlotTemplate?null:t.minorSlotTemplate),n.timeScale=t;break;case"views":if(i=(je(e.views)?this.parent:e).views,!this.parent.isAngular&&i&&0<i.length&&"object"==typeof i[0])for(var d=0,p=i;d<p.length;d++)!function(t){o.forEach(function(e){je(t[""+e])||(t[""+e]="function"==typeof t[""+e]?null:t[""+e])})}(p[d]);n.views=i;break;default:-1<o.indexOf(l)?n[""+l]=je(e[""+l])?this.parent.isAngular||"function"!=typeof this.parent[""+l]?this.parent[""+l]:null:this.parent.isAngular||"function"!=typeof e[""+l]?e[""+l]:null:-1<r.indexOf(l)?n[""+l]=e[""+l]:n[""+l]=(je(e[""+l])?this.parent:e)[""+l]}}return n},U3e.prototype.contentReady=function(){var e=this;this.printWindow=V(this.printInstance.element,this.printWindow),this.closePrintWindow(this.printWindow,!0),this.printWindow.onbeforeunload=function(){e.printCleanup()}},U3e.prototype.closePrintWindow=function(e,t){var i,n=this;F.isIos&&(i=setInterval(function(){e.opener?e.close():je(e.opener)&&(t&&n.printCleanup(),clearInterval(i))},500))},U3e.prototype.printCleanup=function(){this.printInstance&&(this.printInstance.off(URe,this.contentReady),this.printInstance.element.remove(),this.printInstance.destroy(),this.printInstance=null),this.printWindow&&(this.printWindow.onbeforeunload=null,this.printWindow=null)},U3e.prototype.getModuleName=function(){return"print"},U3e.prototype.destroy=function(){this.parent=null};x$=U3e;function U3e(e){this.parent=e}Fje.Inject(Zje,i3e,s3e,d3e,g3e,S3e,T3e,B3e,O3e,H3e,qo,d2,Xo,aN,M$,x$);var q3e,G3e,Y3e,X3e,g$=Object.freeze({__proto__:null,Schedule:Fje,cellClick:fRe,cellDoubleClick:yRe,moreEventsClick:vRe,select:bRe,hover:"hover",actionBegin:wRe,actionComplete:CRe,actionFailure:SRe,navigating:ARe,renderCell:xRe,eventClick:IRe,eventDoubleClick:TRe,eventRendered:ERe,dataBinding:DRe,dataBound:"dataBound",popupOpen:MRe,popupClose:kRe,dragStart:"dragStart",drag:"drag",dragStop:"dragStop",resizeStart:PRe,resizing:"resizing",resizeStop:BRe,inlineClick:FRe,cellSelect:LRe,virtualScrollStart:RRe,virtualScrollStop:ORe,noEvents:NRe,agendaCells:VRe,resourceHeader:_Re,dateHeader:HRe,beforePaste:zRe,beforePrint:jRe,excelExport:WRe,tooltipOpen:QRe,initialLoad:"initial-load",initialEnd:"initial-end",print:URe,dataReady:qRe,eventsLoaded:GRe,contentReady:YRe,scroll:XRe,virtualScroll:KRe,scrollUiUpdate:JRe,uiUpdate:ZRe,documentClick:$Re,documentPaste:eOe,cellMouseDown:tOe,WEEK_LENGTH:7,DEFAULT_WEEKS:6,MS_PER_DAY:iOe,MS_PER_MINUTE:6e4,getElementHeightFromClass:nOe,getElementWidthFromClass:oOe,getTranslateY:rOe,getTranslateX:sOe,getWeekFirstDate:aOe,getWeekLastDate:lOe,firstDateOfMonth:hOe,lastDateOfMonth:dOe,getWeekNumber:pOe,getWeekMiddleDate:cOe,setTime:uOe,resetTime:gOe,getDateInMs:mOe,getDateCount:fOe,addDays:yOe,addMonths:vOe,addYears:bOe,getStartEndHours:wOe,getMaxDays:COe,getDaysCount:SOe,getDateFromString:AOe,getScrollBarWidth:TOe,resetScrollbarWidth:EOe,findIndexInData:DOe,getOuterHeight:MOe,removeChildren:kOe,isDaylightSavingTime:POe,getUniversalTime:BOe,isMobile:FOe,isIPadDevice:LOe,capitalizeFirstWord:ROe,getElementWidth:OOe,getElementHeight:NOe,getElementTop:VOe,Resize:qo,DragAndDrop:d2,HeaderRenderer:m_e,ViewBase:D2,Day:Zje,Week:i3e,WorkWeek:s3e,Month:d3e,Year:g3e,Agenda:S3e,MonthAgenda:T3e,TimelineViews:B3e,TimelineMonth:O3e,TimelineYear:H3e,Timezone:k_e,timezoneData:B_e,ICalendarExport:aN,ICalendarImport:M$,ExcelExport:Xo,Print:x$,RecurrenceEditor:Vze,generateSummary:F_e,generate:R_e,getDateFromRecurrenceDateString:O_e,extractObjectFromRule:iHe,getCalendarUtil:rHe,getRecurrenceStringFromDate:bHe,Gregorian:T_e,Islamic:D_e}),K3e="tableclass",J3e="initial-load",Z3e="content-changed",$3e="initial-end",e4e="iframe-click",t4e="destroy",i4e="toolbarClick",n4e="toolbar-refresh",o4e="slash-menu-opening",r4e="refresh-begin",s4e="toolbar-updated",a4e="bind-on-end",l4e="html-toolbar-click",h4e="markdown-toolbar-click",d4e="model-changed",p4e="tableModulekeyUp",c4e="keyUp",u4e="keyDown",g4e="onImport",m4e="onExport",f4e="mouseUp",y4e="toolbarCreated",v4e="toolbarRenderComplete",b4e="enableFullScreen",w4e="disableFullScreen",C4e="dropDownSelect",S4e="beforeDropDownItemRender",A4e="execCommandCallBack",x4e="image-toolbar-action",I4e="audio-toolbar-action",T4e="video-toolbar-action",E4e="link-toolbar-action",D4e="resize",M4e="resizeStart",k4e="resizing",P4e="resizeStop",B4e="insertLink",F4e="unLink",L4e="editLink",R4e="openLink",O4e="actionBegin",N4e="actionComplete",V4e="updatedToolbarStatus",_4e="updateToolbarItem",H4e="insertImage",z4e="insertAudio",j4e="insertVideo",W4e="insertCompleted",Q4e="insertImgLink",U4e="imgAltText",q4e="delete",G4e="delete",Y4e="delete",X4e="caption",K4e="imageSize",J4e="videoSize",Z4e="sourceCode",$4e="updateSource",e5e="beforeDropDownOpen",t5e="selection-save",i5e="selection-restore",n5e="count",o5e="mouseDown",r5e="sourceCodeMouseDown",s5e="editAreaClick",a5e="scroll",l5e="contentscroll",h5e="colorPickerChanged",d5e="focusChange",p5e="selectAll",c5e="selectRange",u5e="getSelectedHtml",g5e="renderInlineToolbar",m5e="paste-content",f5e="rtl-mode",y5e="createTable",v5e="docClick",b5e="table-toolbar-action",w5e="checkUndoStack",C5e="readOnlyMode",S5e="pasteClean",A5e="enterHandler",x5e="beforeDialogOpen",I5e="clearDialogObj",T5e="hideTableQuickToolbar",E5e="dialogOpen",D5e="beforeDialogClose",M5e="dialogClose",k5e="beforeQuickToolbarOpen",P5e="quickToolbarOpen",B5e="quickToolbarClose",F5e="imageSelected",L5e="imageUploading",R5e="imageUploadSuccess",O5e="imageUploadFailed",N5e="imageRemoving",V5e="fileSelected",_5e="fileUploading",H5e="fileUploadSuccess",z5e="fileUploadFailed",j5e="fileRemoving",W5e="afterImageDelete",Q5e="afterMediaDelete",U5e="drop",q5e="renderQuickToolbar",G5e="xhtmlValidation",Y5e="beforeImageUpload",X5e="beforeFileUpload",K5e="resizeInitialized",J5e="renderFileManager",Z5e="beforeImageDrop",$5e="dynamicModule",eWe="beforePasteCleanup",tWe="afterPasteCleanup",iWe="updateTbItemsStatus",nWe="showLinkDialog",oWe="closeLinkDialog",rWe="showImageDialog",sWe="showAudioDialog",aWe="showVideoDialog",lWe="closeImageDialog",hWe="closeAudioDialog",dWe="closeVideoDialog",pWe="showTableDialog",cWe="closeTableDialog",uWe="bindCssClass",gWe="formatPainterClick",mWe="formatPainterDoubleClick",fWe="emojiPicker",yWe="destroyTooltip",vWe="hidePopup",bWe="cleanupResizeElements",wWe="afterKeyDown",CWe="updateValueOnIdle",SWe="documentClickClosedBy",AWe="showColorPicker",xWe="closeTooltip",IWe="autoResize",TWe="address:empty, article:empty, aside:empty, blockquote:empty,\n details:empty, dd:empty, div:empty, dl:empty, dt:empty, fieldset:empty, footer:empty,form:empty, h1:empty,\n h2:empty, h3:empty, h4:empty, h5:empty, h6:empty, header:empty, hgroup:empty, li:empty, main:empty, nav:empty,\n noscript:empty, output:empty, p:empty, pre:empty, section:empty, td:empty, th:empty",EWe="a:empty, abbr:empty, acronym:empty, b:empty, bdi:empty, bdo:empty, big:empty, button:empty,\ncanvas:empty, cite:empty, code:empty, data:empty, datalist:empty, del:empty, dfn:empty, em:empty, font:empty, i:empty, iframe:empty,\nins:empty, kbd:empty, label:empty, map:empty, mark:empty, meter:empty, noscript:empty, object:empty, output:empty, picture:empty, progress:empty,\nq:empty, ruby:empty, s:empty, samp:empty, script:empty, select:empty, slot:empty, small:empty, span:empty, strong:empty, strike:empty, sub:empty, sup:empty, svg:empty,\ntemplate:empty, textarea:empty, time:empty, u:empty, tt:empty, var:empty, wbr:empty",DWe=["px","em","rem","pt","cm","mm","in","pc","vw","vh","vmin","vmax"],MWe={px:{px:1,em:.0625,rem:.0625,pt:.75,cm:.0264583,mm:.0026458,in:.0104167,pc:.0625,vw:.00625,vh:.00625,vmin:.00625,vmax:.00625},em:{px:16,em:1,rem:1,pt:12,cm:.423333,mm:.0423333,in:.166667,pc:.0625,vw:1,vh:1,vmin:1,vmax:1},rem:{px:16,em:1,rem:1,pt:12,cm:.423333,mm:.0423333,in:.166667,pc:.0625,vw:1,vh:1,vmin:1,vmax:1},pt:{px:1.33333,em:.0833333,rem:.0833333,pt:1,cm:.0352778,mm:.0035278,in:.0138889,pc:.0416667,vw:.00416667,vh:.00416667,vmin:.00416667,vmax:.00416667},cm:{px:37.7953,em:2.3622,rem:2.3622,pt:28.3465,cm:1,mm:.1,in:.393701,pc:.148148,vw:.0377953,vh:.0377953,vmin:.0377953,vmax:.0377953},mm:{px:3.77953,em:.23622,rem:.23622,pt:2.83465,cm:10,mm:1,in:.0393701,pc:.0148148,vw:.00377953,vh:.00377953,vmin:.00377953,vmax:.00377953},in:{px:96,em:6,rem:6,pt:72,cm:2.54,mm:25.4,in:1,pc:.375,vw:.09375,vh:.09375,vmin:.09375,vmax:.09375},pc:{px:16,em:1,rem:1,pt:12,cm:.423333,mm:.0423333,in:.166667,pc:1,vw:.0625,vh:.0625,vmin:.0625,vmax:.0625},vw:{px:160,em:10,rem:10,pt:120,cm:4.23333,mm:.423333,in:1.66667,pc:.625,vw:1,vh:1,vmin:1,vmax:1},vh:{px:160,em:10,rem:10,pt:120,cm:4.23333,mm:.423333,in:1.66667,pc:.625,vw:1,vh:1,vmin:1,vmax:1},vmin:{px:160,em:10,rem:10,pt:120,cm:4.23333,mm:.423333,in:1.66667,pc:.625,vw:1,vh:1,vmin:1,vmax:1},vmax:{px:160,em:10,rem:10,pt:120,cm:4.23333,mm:.423333,in:1.66667,pc:.625,vw:1,vh:1,vmin:1,vmax:1}},kWe="onHandleFontsizeChange",PWe="preventQuickToolbarClose",BWe="e-richtexteditor",FWe="e-rtl",LWe="e-disabled",RWe="rte-iframe-script-sheet",OWe="rte-iframe-style-sheet",NWe="e-rte-container",VWe="e-rte-toolbar",_We="e-rte-tb-fixed",HWe="e-rte-tb-float",zWe="e-rte-inline",jWe="e-rte-tb-expand",WWe="e-rte-full-screen",QWe="e-rte-quick-toolbar",UWe="e-rte-text-quicktoolbar",qWe="e-rte-pop",GWe="e-tb-static",YWe="e-rte-quick-popup",XWe="e-quick-dropdown",KWe="e-rte-image-popup",JWe="e-rte-text-popup",ZWe="e-rte-inline-popup",$We="e-rte-inline-dropdown",e8e="e-rte-dropdown-popup",t8e="e-rte-dropdown-icons",i8e="e-rte-dropdown-items",n8e="e-rte-dropdown-btn",o8e="e-rte-content",r8e="e-toolbar-item",s8e="e-toolbar-wrapper",a8e="e-show",l8e="e-hide",h8e="e-visible",d8e="e-focused",p8e="e-remove-white-space",c8e="e-imgright",u8e="e-imgleft",g8e="e-imgcenter",m8e="e-imgbreak",f8e="e-audio-break",y8e="e-clickelem",v8e="e-video-clickelem",b8e="e-audio-wrap",w8e="e-video-wrap",C8e="e-video-break",S8e="e-img-caption",A8e="e-rte-img-caption",x8e="e-caption-inline",I8e="e-imginline",T8e="e-audio-inline",E8e="e-video-inline",D8e="e-rte-character-count",M8e="e-warning",k8e="e-error",P8e="e-icons",B8e="e-active",F8e="e-expand-open",L8e="e-rte-elements",R8e="e-tbar-btn",O8e="e-rte-horizontal-separator",N8e="e-tbar-ios-fixed",V8e="e-rte-list-primary-content",_8e="e-rte-numberformatlist-dropdown",H8e="e-rte-bulletformatlist-dropdown",z8e="e-formats-tbar-btn",j8e="e-font-name-tbar-btn",W8e="e-font-size-tbar-btn",Q8e="e-alignment-tbar-btn",U8e="e-rte-fontcolor-element",q8e="e-rte-backgroundcolor-element",G8e="e-rte-color-content",Y8e="e-rte-fontcolor-dropdown",X8e="e-rte-backgroundcolor-dropdown",K8e="e-rte-square-palette",J8e="e-rte-fontcolor-colorpicker",Z8e="e-rte-backgroundcolor-colorpicker",$8e="e-rte-readonly",eQe="e-cell-select",tQe="e-cell-select-end",iQe="e-multi-cells-select",nQe="e-dashed-border",oQe="e-alternate-border",rQe="e-column-resize",sQe="e-row-resize",aQe="e-table-box",lQe="e-rte-hidden",hQe="e-rte-keepformat",dQe="e-rte-removeformat",pQe="e-rte-plainformat",cQe="e-rte-pasteok",uQe="e-rte-pastecancel",gQe="e-rte-dialog-minheight",mQe="e-resize-handle",fQe="e-south-east",yQe="e-rte-image",vQe="e-resize",bQe="e-img-focus",wQe="e-audio-focus",CQe="e-video-focus",SQe="e-rte-drag-image",AQe="e-rte-upload-popup",xQe="e-popup-open",IQe="e-img-resize",TQe="e-droparea",EQe="e-img-inner",DQe="e-upload-files",MQe="e-rte-dialog-upload",kQe="e-rte-resize",PQe="e-custom-tile",BQe="e-nocolor-item",FQe="e-rte-table-border",LQe="e-rte-table-resize",RQe="e-rte-fixed-tb-expand",OQe="e-rte-toolbar-enabled",NQe="e-south-west",VQe="e-rte-srctextarea",_Qe=["Enter","ArrowRight","ArrowLeft"],HQe=((D$=q3e=q3e||{})[D$.Toolbar=0]="Toolbar",D$[D$.Content=1]="Content",D$[D$.Popup=2]="Popup",D$[D$.LinkToolbar=3]="LinkToolbar",D$[D$.TextToolbar=4]="TextToolbar",D$[D$.ImageToolbar=5]="ImageToolbar",D$[D$.AudioToolbar=6]="AudioToolbar",D$[D$.VideoToolbar=7]="VideoToolbar",D$[D$.InlineToolbar=8]="InlineToolbar",D$[D$.TableToolbar=9]="TableToolbar",(_$=G3e=G3e||{}).Expand="Expand",_$.MultiRow="MultiRow",_$.Scrollable="Scrollable",($$=Y3e=Y3e||{}).InsertLink="InsertLink",$$.InsertImage="InsertImage",$$.InsertAudio="InsertAudio",$$.InsertVideo="InsertVideo",$$.InsertTable="InsertTable",(H$=X3e=X3e||{}).Uploaded="Uploaded",H$.Dropped="Dropped",H$.Pasted="Pasted",["alignments","formats","fontname","fontsize","fontcolor","backgroundcolor","align","display","audiolayoutoption","videolayoutoption","videoalign","tablerows","tablecolumns","tablecell","tablecellhorizontalalign","tablecellverticalalign","styles","numberformatlist","bulletformatlist"]),zQe={alignments:{id:"Alignments",icon:"e-alignments",tooltip:"Alignments",command:"Alignments",subCommand:"Alignments"},justifyleft:{id:"JustifyLeft",icon:"e-justify-left",tooltip:"JustifyLeft",command:"Alignments",subCommand:"JustifyLeft"},justifycenter:{id:"JustifyCenter",icon:"e-justify-center",tooltip:"JustifyCenter",command:"Alignments",subCommand:"JustifyCenter"},justifyright:{id:"JustifyRight",icon:"e-justify-right",tooltip:"JustifyRight",command:"Alignments",subCommand:"JustifyRight"},justifyfull:{id:"JustifyFull",icon:"e-justify-full",tooltip:"JustifyFull",command:"Alignments",subCommand:"JustifyFull"},fontname:{id:"FontName",icon:"e-font-name",tooltip:"Font Name",command:"Font",subCommand:"FontName"},fontsize:{id:"FontSize",icon:"e-font-size",tooltip:"Font Size",command:"Font",subCommand:"FontSize"},fontcolor:{id:"FontColor",icon:"e-rte-font-color",tooltip:"Font Color",command:"Font",subCommand:"FontColor",value:"#ff0000ff"},backgroundcolor:{id:"BackgroundColor",icon:"e-background-color",tooltip:"Background Color",command:"Font",subCommand:"BackgroundColor",value:"#ffff00ff"},importword:{id:"ImportWord",icon:"e-rte-import-doc",tooltip:"Import from Word",command:"Import",subCommand:"ImportWord"},exportword:{id:"ExportWord",icon:"e-rte-export-doc",tooltip:"Export to Word",command:"Export",subCommand:"ExportWord"},exportpdf:{id:"ExportPdf",icon:"e-rte-export-pdf",tooltip:"Export to PDF",command:"Export",subCommand:"ExportPdf"},bold:{id:"Bold",icon:"e-bold",tooltip:"Bold",command:"Style",subCommand:"Bold"},italic:{id:"Italic",icon:"e-italic",tooltip:"Italic",command:"Style",subCommand:"Italic"},underline:{id:"Underline",icon:"e-underline",tooltip:"Underline",command:"Style",subCommand:"Underline"},strikethrough:{id:"StrikeThrough",icon:"e-strike-through",tooltip:"StrikeThrough",command:"Style",subCommand:"StrikeThrough"},clearformat:{id:"ClearFormat",icon:"e-clear-format",tooltip:"Clear Format",command:"Clear",subCommand:"ClearFormat"},clearall:{id:"ClearAll",icon:"e-clear-all",tooltip:"Clear All",command:"Clear",subCommand:"ClearAll"},cut:{id:"Cut",icon:"e-cut",tooltip:"Cut",command:"ClipBoard",subCommand:"Cut"},copy:{id:"Copy",icon:"e-copy",tooltip:"Copy",command:"ClipBoard",subCommand:"Copy"},paste:{id:"Paste",icon:"e-paste",tooltip:"Paste",command:"ClipBoard",subCommand:"Paste"},unorderedlist:{id:"UnorderedList",icon:"e-unorder-list",tooltip:"Bulleted List",command:"Lists",subCommand:"UL"},orderedlist:{id:"OrderedList",icon:"e-order-list",tooltip:"Numbered List",command:"Lists",subCommand:"OL"},numberformatlist:{id:"NumberFormatList",icon:"e-order-list",tooltip:"Number Format List",command:"NumberFormatList",subCommand:"NumberFormatList"},bulletformatlist:{id:"BulletFormatList",icon:"e-unorder-list",tooltip:"Bullet Format List",command:"BulletFormatList",subCommand:"BulletFormatList"},indent:{id:"Indent",icon:"e-indent",tooltip:"Increase Indent",command:"Indents",subCommand:"Indent"},outdent:{id:"Outdent",icon:"e-outdent",tooltip:"Decrease Indent",command:"Indents",subCommand:"Outdent"},undo:{id:"Undo",icon:"e-undo",tooltip:"Undo",command:"Actions",subCommand:"Undo"},redo:{id:"Redo",icon:"e-redo",tooltip:"Redo",command:"Actions",subCommand:"Redo"},superscript:{id:"SuperScript",icon:"e-super-script",tooltip:"Superscript",command:"Effects",subCommand:"SuperScript"},subscript:{id:"SubScript",icon:"e-sub-script",tooltip:"Subscript",command:"Effects",subCommand:"SubScript"},createlink:{id:"CreateLink",icon:"e-create-link",tooltip:"Insert Hyperlink",command:"Links",subCommand:"CreateLink"},openlink:{id:"OpenLink",icon:"e-open-link",tooltip:"Open Link",command:"Links",subCommand:"OpenLink"},editlink:{id:"EditLink",icon:"e-edit-link",tooltip:"Edit Link",command:"Links",subCommand:"EditLink"},removelink:{id:"RemoveLink",icon:"e-remove-link",tooltip:"Remove Link",command:"Links",subCommand:"RemoveLink"},image:{id:"Image",icon:"e-image",tooltip:"Insert Image",command:"Images",subCommand:"Image"},audio:{id:"Audio",icon:"e-audio",tooltip:"Insert Audio",command:"Audios",subCommand:"Audio"},video:{id:"Video",icon:"e-video",tooltip:"Insert Video",command:"Videos",subCommand:"Video"},filemanager:{id:"FileManager",icon:"e-rte-file-manager",tooltip:"File Manager",command:"Files",subCommand:"File"},createtable:{id:"CreateTable",icon:"e-create-table",tooltip:"Create Table",command:"Table",subCommand:"CreateTable"},removetable:{id:"removeTable",icon:"e-remove-table",tooltip:"Remove Table",command:"removeTable",subCommand:"removeTable"},replace:{id:"Replace",icon:"e-replace",tooltip:"Replace",command:"Images",subCommand:"Replace"},audioreplace:{id:"AudioReplace",icon:"e-audio-replace",tooltip:"Audio Replace",command:"Audios",subCommand:"AudioReplace"},audioremove:{id:"AudioRemove",icon:"e-audio-remove",tooltip:"Audio Remove",command:"Audios",subCommand:"AudioRemove"},audiolayoutoption:{id:"AudioLayoutOption",icon:"e-audio-display",tooltip:"Audio LayoutOption",command:"Audios",subCommand:"AudioLayoutOption"},videoreplace:{id:"VideoReplace",icon:"e-video-replace",tooltip:"Video Replace",command:"Videos",subCommand:"VideoReplace"},videoalign:{id:"VideoAlign",icon:"e-video-align",tooltip:"Video Align",command:"Videos",subCommand:"VideoAlign"},videoremove:{id:"VideoRemove",icon:"e-video-remove",tooltip:"Video Remove",command:"Videos",subCommand:"VideoRemove"},videolayoutoption:{id:"VideoLayoutOption",icon:"e-video-display",tooltip:"Video LayoutOption",command:"Videos",subCommand:"VideoLayoutOption"},videodimension:{id:"VideoDimension",icon:"e-video-dimension",tooltip:"Video Dimension",command:"Videos",subCommand:"VideoDimension"},align:{id:"Align",icon:"e-align",tooltip:"Align",command:"Images",subCommand:"Align"},caption:{id:"Caption",icon:"e-caption",tooltip:"Image Caption",command:"Images",subCommand:"Caption"},remove:{id:"Remove",icon:"e-remove",tooltip:"Remove",command:"Images",subCommand:"Remove"},openimagelink:{id:"OpenImageLink",icon:"e-open-link",tooltip:"Open Link",command:"Images",subCommand:"OpenImageLink"},editimagelink:{id:"EditImageLink",icon:"e-edit-link",tooltip:"Edit Link",command:"Images",subCommand:"EditImageLink"},removeimagelink:{id:"RemoveImageLink",icon:"e-remove-link",tooltip:"Remove Link",command:"Images",subCommand:"RemoveImageLink"},insertlink:{id:"InsertLink",icon:"e-insert-link",tooltip:"Insert Link",command:"Images",subCommand:"InsertLink"},display:{id:"Display",icon:"e-display",tooltip:"Display",command:"Images",subCommand:"Display"},alttext:{id:"AltText",icon:"e-alt-text",tooltip:"Alternative Text",command:"Images",subCommand:"AltText"},dimension:{id:"Dimension",icon:"e-img-dimension",tooltip:"Change Size",command:"Images",subCommand:"Dimension"},fullscreen:{id:"Maximize",icon:"e-maximize",tooltip:"Maximize",command:"View",subCommand:"Maximize"},maximize:{id:"Maximize",icon:"e-maximize",tooltip:"Maximize",command:"FullScreen",subCommand:"Maximize"},minimize:{id:"Minimize",icon:"e-minimize",tooltip:"Minimize",command:"FullScreen",subCommand:"Minimize"},lowercase:{id:"LowerCase",icon:"e-lower-case",tooltip:"Lower Case",command:"Casing",subCommand:"LowerCase"},uppercase:{id:"UpperCase",icon:"e-upper-case",tooltip:"Upper Case",command:"Casing",subCommand:"UpperCase"},print:{id:"Print",icon:"e-print",tooltip:"Print",command:"Print",subCommand:"Print"},formats:{id:"Formats",icon:"e-formats",tooltip:"Formats",command:"Formats",subCommand:"Formats"},sourcecode:{id:"SourceCode",icon:"e-source-code",tooltip:"Code View (Ctrl+Shift+H)",command:"SourceCode",subCommand:"SourceCode"},preview:{id:"Preview",icon:"e-preview",tooltip:"Preview (Ctrl+Shift+H)",command:"Preview",subCommand:"Preview"},viewside:{id:"ViewSide",icon:"e-view-side",tooltip:"ViewSide",command:"ViewSide",subCommand:"ViewSide"},insertcode:{id:"InsertCode",icon:"e-preformat-code",tooltip:"Insert Code",command:"Formats",subCommand:"Pre"},blockquote:{id:"Blockquote",icon:"e-blockquote",tooltip:"Blockquote",command:"Formats",subCommand:"blockquote"},tableheader:{id:"TableHeader",icon:"e-table-header",tooltip:"Table Header",command:"Table",subCommand:"TableHeader"},tableremove:{id:"TableRemove",icon:"e-table-remove",tooltip:"Table Remove",command:"Table",subCommand:"TableRemove"},tablerows:{id:"TableRows",icon:"e-table-rows",tooltip:"Table Rows",command:"Table",subCommand:"TableRows"},tablecolumns:{id:"TableColumns",icon:"e-table-columns",tooltip:"Table Columns",command:"Table",subCommand:"TableColumns"},tablecell:{id:"TableCell",icon:"e-table-cell",tooltip:"Table Cell",command:"Table",subCommand:"TableCell"},tablecellbackground:{id:"TableCellBackground",icon:"e-table-cell-background",tooltip:"Table Cell Background",command:"Table",subCommand:"TableCellBackground"},tablecellhorizontalalign:{id:"TableCellHorizontalAlign",icon:"e-table-cell-horizontalAlign",tooltip:"Table Cell HorizontalAlign",command:"Table",subCommand:"TableCellHorizontalAlign"},tablecellverticalalign:{id:"TableCellVerticalAlign",icon:"e-table-cell-verticalAlign",tooltip:"Table Cell VerticalAlign",command:"Table",subCommand:"TableCellVerticalAlign"},tableeditproperties:{id:"TableEditProperties",icon:"e-table-edit-properties",tooltip:"Table Edit Properties",command:"Table",subCommand:"TableEditProperties"},styles:{id:"Styles",icon:"e-table-styles",tooltip:"Styles",command:"Table",subCommand:"Styles"},formatpainter:{id:"FormatPainter",icon:"e-rte-format-painter",tooltip:"Format Painter",command:"FormatPainter",subCommand:"FormatPainter"},emojipicker:{id:"EmojiPicker",icon:"e-emoji",tooltip:"Emoji Icon",command:"EmojiPicker",subCommand:"EmojiPicker"},inlinecode:{id:"inlineCode",icon:"e-inline-code",tooltip:"inlineCode",command:"Style",subCommand:"InlineCode"}},jQe=[{locale:"alignmentsDropDownLeft",value:"JustifyLeft"},{locale:"alignmentsDropDownCenter",value:"JustifyCenter"},{locale:"alignmentsDropDownRight",value:"JustifyRight"},{locale:"alignmentsDropDownJustify",value:"JustifyFull"}],WQe=[{iconCss:"e-icons e-justify-left",text:"Align Left",command:"Alignments",subCommand:"JustifyLeft"},{iconCss:"e-icons e-justify-center",text:"Align Center",command:"Alignments",subCommand:"JustifyCenter"},{iconCss:"e-icons e-justify-right",text:"Align Right",command:"Alignments",subCommand:"JustifyRight"},{iconCss:"e-icons e-justify-full",text:"Align Justify",command:"Alignments",subCommand:"JustifyFull"}],QQe=[{iconCss:"e-icons e-justify-left",command:"Images",subCommand:"JustifyLeft"},{iconCss:"e-icons e-justify-center",command:"Images",subCommand:"JustifyCenter"},{iconCss:"e-icons e-justify-right",command:"Images",subCommand:"JustifyRight"}],UQe=[{iconCss:"e-icons e-justify-left",command:"Videos",subCommand:"JustifyLeft"},{iconCss:"e-icons e-justify-center",command:"Videos",subCommand:"JustifyCenter"},{iconCss:"e-icons e-justify-right",command:"Videos",subCommand:"JustifyRight"}],qQe=[{locale:"imageDisplayDropDownInline",value:"Inline"},{locale:"imageDisplayDropDownBreak",value:"Break"}],GQe=[{locale:"audioLayoutOptionDropDownInline",value:"Inline"},{locale:"audioLayoutOptionDropDownBreak",value:"Break"}],YQe=[{locale:"videoLayoutOptionDropDownInline",value:"Inline"},{locale:"videoLayoutOptionDropDownBreak",value:"Break"}],XQe=[{text:"Inline",cssClass:"e-inline",command:"Images",subCommand:"Inline"},{text:"Break",cssClass:"e-break",command:"Images",subCommand:"Break"}],KQe=[{text:"Inline",cssClass:"e-audio-inline",command:"Audios",subCommand:"Inline"},{text:"Break",cssClass:"e-audio-break",command:"Audios",subCommand:"Break"}],JQe=[{text:"Inline",cssClass:"e-video-inline",command:"Videos",subCommand:"Inline"},{text:"Break",cssClass:"e-video-break",command:"Videos",subCommand:"Break"}],ZQe=[{iconCss:"e-icons e-cell-merge",text:"Merge cells",command:"Table",subCommand:"Merge"},{iconCss:"e-icons e-cell-horizontal-split",text:"Horizontal split",command:"Table",subCommand:"HorizontalSplit"},{iconCss:"e-icons e-cell-vertical-split",text:"Vertical split",command:"Table",subCommand:"VerticalSplit"}],$Qe=[{locale:"tableInsertRowDropDownBefore",value:"InsertRowBefore"},{locale:"tableInsertRowDropDownAfter",value:"InsertRowAfter"},{locale:"tableInsertRowDropDownDelete",value:"DeleteRow"}],e6e=[{iconCss:"e-icons e-insert-row-before",text:"Insert row before",command:"Table",subCommand:"InsertRowBefore"},{iconCss:"e-icons e-insert-row-after",text:"Insert row after",command:"Table",subCommand:"InsertRowAfter"},{iconCss:"e-icons e-delete-row",text:"Delete row",command:"Table",subCommand:"DeleteRow"}],t6e=[{locale:"tableInsertColumnDropDownLeft",value:"InsertColumnLeft"},{locale:"tableInsertColumnDropDownRight",value:"InsertColumnRight"},{locale:"tableInsertColumnDropDownDelete",value:"DeleteColumn"}],i6e=[{iconCss:"e-icons e-insert-column-left",text:"Insert column left",command:"Table",subCommand:"InsertColumnLeft"},{iconCss:"e-icons e-insert-column-right",text:"Insert column right",command:"Table",subCommand:"InsertColumnRight"},{iconCss:"e-icons e-delete-column",text:"Delete column",command:"Table",subCommand:"DeleteColumn"}],n6e=[{locale:"tableVerticalAlignDropDownTop",value:"AlignTop"},{locale:"tableVerticalAlignDropDownMiddle",value:"AlignMiddle"},{locale:"tableVerticalAlignDropDownBottom",value:"AlignBottom"}],o6e=[{iconCss:"e-icons e-align-top",text:"Align Top",command:"Table",subCommand:"AlignTop"},{iconCss:"e-icons e-align-middle",text:"Align Middle",command:"Table",subCommand:"AlignMiddle"},{iconCss:"e-icons e-align-bottom",text:"Align Bottom",command:"Table",subCommand:"AlignBottom"}],r6e=[{locale:"tableStylesDropDownDashedBorder",value:"Dashed"},{locale:"tableStylesDropDownAlternateRows",value:"Alternate"}],s6e=[{text:"Dashed Borders",cssClass:"e-dashed-borders",command:"Table",subCommand:"Dashed"},{text:"Alternate Rows",cssClass:"e-alternate-rows",command:"Table",subCommand:"Alternate"}],pJ=["Bold","Italic","Underline","|","Formats","Alignments","Blockquote","OrderedList","UnorderedList","|","CreateLink","Image","|","SourceCode","Undo","Redo"],a6e=[{cssClass:"e-default",text:"Default",command:"Font",subCommand:"FontName",value:""},{cssClass:"e-segoe-ui",text:"Segoe UI",command:"Font",subCommand:"FontName",value:"Segoe UI"},{cssClass:"e-arial",text:"Arial",command:"Font",subCommand:"FontName",value:"Arial,Helvetica,sans-serif"},{cssClass:"e-georgia",text:"Georgia",command:"Font",subCommand:"FontName",value:"Georgia,serif"},{cssClass:"e-impact",text:"Impact",command:"Font",subCommand:"FontName",value:"Impact,Charcoal,sans-serif"},{cssClass:"e-tahoma",text:"Tahoma",command:"Font",subCommand:"FontName",value:"Tahoma,Geneva,sans-serif"},{cssClass:"e-times-new-roman",text:"Times New Roman",command:"Font",subCommand:"FontName",value:"Times New Roman,Times,serif"},{cssClass:"e-verdana",text:"Verdana",command:"Font",subCommand:"FontName",value:"Verdana,Geneva,sans-serif"}],fJ=[{text:"Default",value:""},{text:"8 pt",value:"8pt"},{text:"10 pt",value:"10pt"},{text:"12 pt",value:"12pt"},{text:"14 pt",value:"14pt"},{text:"18 pt",value:"18pt"},{text:"24 pt",value:"24pt"},{text:"36 pt",value:"36pt"}],l6e=[{cssClass:"e-paragraph",text:"Paragraph",command:"Formats",subCommand:"P",value:"P"},{cssClass:"e-h1",text:"Heading 1",command:"Formats",subCommand:"H1",value:"H1"},{cssClass:"e-h2",text:"Heading 2",command:"Formats",subCommand:"H2",value:"H2"},{cssClass:"e-h3",text:"Heading 3",command:"Formats",subCommand:"H3",value:"H3"},{cssClass:"e-h4",text:"Heading 4",command:"Formats",subCommand:"H4",value:"H4"},{cssClass:"e-code",text:"preformatted",command:"Formats",subCommand:"Pre",value:"Pre"}],Vee={Custom:["","#000000","#e7e6e6","#44546a","#4472c4","#ed7d31","#a5a5a5","#ffc000","#70ad47","#ff0000","#f2f2f2","#808080","#cfcdcd","#d5dce4","#d9e2f3","#fbe4d5","#ededed","#fff2cc","#e2efd9","#ffcccc","#d9d9d9","#595959","#aeaaaa","#acb9ca","#b4c6e7","#f7caac","#dbdbdb","#ffe599","#c5e0b3","#ff8080","#bfbfbf","#404040","#747070","#8496b0","#8eaadb","#f4b083","#c9c9c9","#ffd966","#a8d08d","#ff3333","#a6a6a6","#262626","#3b3838","#323e4f","#2f5496","#c45911","#7b7b7b","#bf8f00","#538135","#b30000","#7f7f7f","#0d0d0d","#161616","#212934","#1f3763","#823b0b","#525252","#7f5f00","#375623","#660000"]},tte={Custom:["","#000000","#ffff00","#00ff00","#00ffff","#0000ff","#ff0000","#000080","#800080","#996633","#f2f2f2","#808080","#ffffcc","#b3ffb3","#ccffff","#ccccff","#ffcccc","#ccccff","#ff80ff","#f2e6d9","#d9d9d9","#595959","#ffff80","#80ff80","#b3ffff","#8080ff","#ff8080","#8080ff","#ff00ff","#dfbf9f","#bfbfbf","#404040","#ffff33","#33ff33","#33ffff","#3333ff","#ff3333","#0000b3","#b300b3","#c68c53","#a6a6a6","#262626","#e6e600","#00b300","#009999","#000099","#b30000","#000066","#660066","#86592d","#7f7f7f","#0d0d0d","#999900","#006600","#006666","#000066","#660000","#00004d","#4d004d","#734d26"]},h6e=[{text:"None",command:"Lists",subCommand:"NumberFormatList",value:"none"},{text:"Number",command:"Lists",subCommand:"NumberFormatList",value:"decimal"},{text:"Lower Greek",command:"Lists",subCommand:"NumberFormatList",value:"lowerGreek"},{text:"Lower Roman",command:"Lists",subCommand:"NumberFormatList",value:"lowerRoman"},{text:"Upper Alpha",command:"Lists",subCommand:"NumberFormatList",value:"upperAlpha"},{text:"Lower Alpha",command:"Lists",subCommand:"NumberFormatList",value:"lowerAlpha"},{text:"Upper Roman",command:"Lists",subCommand:"NumberFormatList",value:"upperRoman"}],d6e=[{text:"None",command:"Lists",subCommand:"BulletFormatList",value:"none"},{text:"Disc",command:"Lists",subCommand:"BulletFormatList",value:"disc"},{text:"Circle",command:"Lists",subCommand:"BulletFormatList",value:"circle"},{text:"Square",command:"Lists",subCommand:"BulletFormatList",value:"square"}];function p6e(e,t,i){for(var n=0;t.length>n;n++)if(t[n].value===i.subCommand)return e.localeObj.getConstant(t[n].locale);return i.text}var c6e={CreateLink:"Ctrl+K",Image:"Ctrl+Shift+I",CreateTable:"Ctrl+Shift+E",Undo:"Ctrl+Z",Redo:"Ctrl+Y",Copy:"Ctrl+C",Cut:"Ctrl+X",Paste:"Ctrl+V",Bold:"Ctrl+B",Italic:"Ctrl+I",Underline:"Ctrl+U",StrikeThrough:"Ctrl+Shift+S",UpperCase:"Ctrl+Shift+U",LowerCase:"Ctrl+Shift+L",SuperScript:"Ctrl+Shift+=",SubScript:"Ctrl+=",SourceCode:"Ctrl+Shift+H",Maximize:"Ctrl+Shift+F",Minimize:"Esc",ClearFormat:"Ctrl+Shift+R",OL:"Ctrl+Shift+O",UL:"Ctrl+Alt+O",NumberFormatList:"Ctrl+Shift+O",BulletFormatList:"Ctrl+Alt+O",Audio:"Ctrl+Shift+A",Video:"Ctrl+Alt+V",Indent:"Ctrl+]",Outdent:"Ctrl+[","Decrease Fontsize":"Ctrl+Shift+<","Increase Fontsize":"Ctrl+Shift+>",JustifyCenter:"Ctrl+E",JustifyFull:"Ctrl+J",JustifyLeft:"Ctrl+L",JustifyRight:"Ctrl+R",FormatPainter:"Alt+Shift+C, Alt+Shift+V",InlineCode:"Ctrl+`"},Wo=[{name:"Smilies & People",code:"1F600",iconCss:"e-emoji",icons:[{code:"1F600",desc:"Grinning face"},{code:"1F603",desc:"Grinning face with big eyes"},{code:"1F604",desc:"Grinning face with smiling eyes"},{code:"1F606",desc:"Grinning squinting face"},{code:"1F605",desc:"Grinning face with sweat"},{code:"1F602",desc:"Face with tears of joy"},{code:"1F923",desc:"Rolling on the floor laughing"},{code:"1F60A",desc:"Smiling face with smiling eyes"},{code:"1F607",desc:"Smiling face with halo"},{code:"1F642",desc:"Slightly smiling face"},{code:"1F643",desc:"Upside-down face"},{code:"1F60D",desc:"Smiling face with heart-eyes"},{code:"1F618",desc:"Face blowing a kiss"},{code:"1F61B",desc:"Face with tongue"},{code:"1F61C",desc:"Winking face with tongue"},{code:"1F604",desc:"Grinning face with smiling eyes"},{code:"1F469",desc:"Woman"},{code:"1F468",desc:"Man"},{code:"1F467",desc:"Girl"},{code:"1F466",desc:"Boy"},{code:"1F476",desc:"Baby"},{code:"1F475",desc:"Old woman"},{code:"1F474",desc:"Old man"},{code:"1F46E",desc:"Police officer"},{code:"1F477",desc:"Construction worker"},{code:"1F482",desc:"Guard"},{code:"1F575",desc:"Detective"},{code:"1F9D1",desc:"Cook"}]},{name:"Animals & Nature",code:"1F435",iconCss:"e-animals",icons:[{code:"1F436",desc:"Dog face"},{code:"1F431",desc:"Cat face"},{code:"1F42D",desc:"Mouse face"},{code:"1F439",desc:"Hamster face"},{code:"1F430",desc:"Rabbit face"},{code:"1F98A",desc:"Fox face"},{code:"1F43B",desc:"Bear face"},{code:"1F43C",desc:"Panda face"},{code:"1F428",desc:"Koala"},{code:"1F42F",desc:"Tiger face"},{code:"1F981",desc:"Lion face"},{code:"1F42E",desc:"Cow face"},{code:"1F437",desc:"Pig face"},{code:"1F43D",desc:"Pig nose"},{code:"1F438",desc:"Frog face"},{code:"1F435",desc:"Monkey face"},{code:"1F649",desc:"Hear-no-evil monkey"},{code:"1F64A",desc:"Speak-no-evil monkey"},{code:"1F412",desc:"Monkey"},{code:"1F414",desc:"Chicken"},{code:"1F427",desc:"Penguin"},{code:"1F426",desc:"Bird"},{code:"1F424",desc:"Baby chick"},{code:"1F986",desc:"Duck"},{code:"1F985",desc:"Eagle"}]},{name:"Food & Drink",code:"1F347",iconCss:"e-food-and-drinks",icons:[{code:"1F34E",desc:"Red apple"},{code:"1F34C",desc:"Banana"},{code:"1F347",desc:"Grapes"},{code:"1F353",desc:"Strawberry"},{code:"1F35E",desc:"Bread"},{code:"1F950",desc:"Croissant"},{code:"1F955",desc:"Carrot"},{code:"1F354",desc:"Hamburger"},{code:"1F355",desc:"Pizza"},{code:"1F32D",desc:"Hot dog"},{code:"1F35F",desc:"French fries"},{code:"1F37F",desc:"Popcorn"},{code:"1F366",desc:"Soft ice cream"},{code:"1F367",desc:"Shaved ice"},{code:"1F36A",desc:"Cookie"},{code:"1F382",desc:"Birthday cake"},{code:"1F370",desc:"Shortcake"},{code:"1F36B",desc:"Chocolate bar"},{code:"1F369",desc:"Donut"},{code:"1F36E",desc:"Custard"},{code:"1F36D",desc:"Lollipop"},{code:"1F36C",desc:"Candy"},{code:"1F377",desc:"Wine glass"},{code:"1F37A",desc:"Beer mug"},{code:"1F37E",desc:"Bottle with popping cork"}]},{name:"Activities",code:"1F383",iconCss:"e-activities",icons:[{code:"26BD",desc:"Soccer ball"},{code:"1F3C0",desc:"Basketball"},{code:"1F3C8",desc:"American football"},{code:"26BE",desc:"Baseball"},{code:"1F3BE",desc:"Tennis"},{code:"1F3D0",desc:"Volleyball"},{code:"1F3C9",desc:"Rugby football"},{code:"1F3B1",desc:"Pool 8 ball"},{code:"1F3D3",desc:"Ping pong"},{code:"1F3F8",desc:"Badminton"},{code:"1F94A",desc:"Boxing glove"},{code:"1F3CA",desc:"Swimmer"},{code:"1F3CB",desc:"Weightlifter"},{code:"1F6B4",desc:"Bicyclist"},{code:"1F6F9",desc:"Skateboard"},{code:"1F3AE",desc:"Video game"},{code:"1F579",desc:"Joystick"},{code:"1F3CF",desc:"Cricket"},{code:"1F3C7",desc:"Horse racing"},{code:"1F3AF",desc:"Direct hit"},{code:"1F3D1",desc:"Field hockey"},{code:"1F3B0",desc:"Slot machine"},{code:"1F3B3",desc:"Bowling"},{code:"1F3B2",desc:"Game die"},{code:"265F",desc:"Chess pawn"}]},{name:"Travel & Places",code:"1F30D",iconCss:"e-travel-and-places",icons:[{code:"2708",desc:"Airplane"},{code:"1F697",desc:"Automobile"},{code:"1F695",desc:"Taxi"},{code:"1F6B2",desc:"Bicycle"},{code:"1F68C",desc:"Bus"},{code:"1F682",desc:"Locomotive"},{code:"1F6F3",desc:"Passenger ship"},{code:"1F680",desc:"Rocket"},{code:"1F681",desc:"Helicopter"},{code:"1F6A2",desc:"Ship"},{code:"1F3DF",desc:"Stadium"},{code:"1F54C",desc:"Mosque"},{code:"26EA",desc:"Church"},{code:"1F6D5",desc:"Hindu Temple"},{code:"1F3D4",desc:"Snow-capped mountain"},{code:"1F3EB",desc:"School"},{code:"1F30B",desc:"Volcano"},{code:"1F3D6",desc:"Beach with umbrella"},{code:"1F3DD",desc:"Desert island"},{code:"1F3DE",desc:"National park"},{code:"1F3F0",desc:"Castle"},{code:"1F5FC",desc:"Tokyo tower"},{code:"1F5FD",desc:"Statue of liberty"},{code:"26E9",desc:"Shinto shrine"},{code:"1F3EF",desc:"Japanese castle"},{code:"1F3A2",desc:"Roller coaster"}]},{name:"Objects",code:"1F507",iconCss:"e-objects",icons:[{code:"1F4A1",desc:"Light bulb"},{code:"1F526",desc:"Flashlight"},{code:"1F4BB",desc:"Laptop computer"},{code:"1F5A5",desc:"Desktop computer"},{code:"1F5A8",desc:"Printer"},{code:"1F4F7",desc:"Camera"},{code:"1F4F8",desc:"Camera with flash"},{code:"1F4FD",desc:"Film projector"},{code:"1F3A5",desc:"Movie camera"},{code:"1F4FA",desc:"Television"},{code:"1F4FB",desc:"Radio"},{code:"1F50B",desc:"Battery"},{code:"231A",desc:"Watch"},{code:"1F4F1",desc:"Mobile phone"},{code:"260E",desc:"Telephone"},{code:"1F4BE",desc:"Floppy disk"},{code:"1F4BF",desc:"Optical disk"},{code:"1F4C0",desc:"Digital versatile disc"},{code:"1F4BD",desc:"Computer disk"},{code:"1F3A7",desc:"Headphone"},{code:"1F3A4",desc:"Microphone"},{code:"1F3B6",desc:"Multiple musical notes"},{code:"1F4DA",desc:"Books"}]},{name:"Symbols",code:"1F3E7",iconCss:"e-symbols",icons:[{code:"274C",desc:"Cross mark"},{code:"2714",desc:"Check mark"},{code:"26A0",desc:"Warning sign"},{code:"1F6AB",desc:"Prohibited"},{code:"2139",desc:"Information"},{code:"267B",desc:"Recycling symbol"},{code:"1F6AD",desc:"No smoking"},{code:"1F4F5",desc:"No mobile phones"},{code:"1F6AF",desc:"No littering"},{code:"1F6B3",desc:"No bicycles"},{code:"1F6B7",desc:"No pedestrians"},{code:"2795",desc:"Plus"},{code:"2796",desc:"Minus"},{code:"2797",desc:"Divide"},{code:"2716",desc:"Multiplication"},{code:"1F4B2",desc:"Dollar banknote"},{code:"1F4AC",desc:"Speech balloon"},{code:"2755",desc:"White exclamation mark"},{code:"2754",desc:"White question mark"},{code:"2764",desc:"Heart"}]}],u6e={alignments:"Alignments",justifyLeft:"Align Left",justifyCenter:"Align Center",justifyRight:"Align Right",justifyFull:"Align Justify",fontName:"Font Name",fontSize:"Font Size",fontColor:"Font Color",backgroundColor:"Background Color",importWord:"Import from Word",exportWord:"Export to Word",exportPdf:"Export to PDF",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",clearFormat:"Clear Format",clearAll:"Clear All",cut:"Cut",copy:"Copy",paste:"Paste",unorderedList:"Bulleted List",orderedList:"Numbered List",indent:"Increase Indent",outdent:"Decrease Indent",undo:"Undo",redo:"Redo",superscript:"Superscript",subscript:"Subscript",createLink:"Insert Link",openLink:"Open Link",editLink:"Edit Link",removeLink:"Remove Link",image:"Insert Image",audio:"Insert Audio",video:"Insert Video",replace:"Replace",numberFormatList:"Number Format List",bulletFormatList:"Bullet Format List",audioReplace:"Replace",videoReplace:"Replace",videoAlign:"Align",videoDimension:"Dimension",audioRemove:"Remove",videoRemove:"Remove",audioLayoutOption:"Layout option",videoLayoutOption:"Layout option",align:"Align",caption:"Caption",remove:"Remove",insertLink:"Insert Link",display:"Display",altText:"Alternative text",dimension:"Change Size",fullscreen:"Maximize",maximize:"Maximize",minimize:"Minimize",lowerCase:"Lower Case",upperCase:"Upper Case",print:"Print",formats:"Formats",sourcecode:"Code View",preview:"Preview",viewside:"ViewSide",insertCode:"Insert Code",blockquote:"Blockquote",linkText:"Display text",linkTooltipLabel:"Title",linkWebUrl:"Web address",linkTitle:"Enter a title",linkurl:"https://example.com",linkOpenInNewWindow:"Open link in new window",linkHeader:"Insert Link",dialogInsert:"Insert",dialogCancel:"Cancel",dialogUpdate:"Update",imageHeader:"Insert Image",audioHeader:"Insert Audio",videoHeader:"Insert Video",imageLinkHeader:"You can also provide a link from the web",audioLinkHeader:"You can also provide a link from the web",videoLinkHeader:"Web URL",embedVideoLinkHeader:"Media Embed URL",mdimageLink:"Please provide a URL for your image",imageUploadMessage:"Drop image here or browse to upload",audioUploadMessage:"Drop an audio file or browse to upload",videoUploadMessage:"Drop a video file or browse to upload",imageDeviceUploadMessage:"Click here to upload",audioDeviceUploadMessage:"Click here to upload",videoDeviceUploadMessage:"Click here to upload",imageAlternateText:"Alternate Text",alternateHeader:"Alternative Text",browse:"Browse",imageUrl:"https://example.com/image.png",audioUrl:"https://example.com/audio.mp3",videoUrl:"https://example.com/video.mp4",webUrl:"Web URL",embedUrl:"Embed Code",imageCaption:"Caption",imageSizeHeader:"Image Size",videoSizeHeader:"Video Size",imageHeight:"Height",imageWidth:"Width",videoHeight:"Height",videoWidth:"Width",textPlaceholder:"Enter text",inserttablebtn:"Insert Table",tabledialogHeader:"Insert Table",tableWidth:"Width",cellpadding:"Cell Padding",cellspacing:"Cell Spacing",columns:"Number of columns",rows:"Number of rows",tableRows:"Row",tableColumns:"Column",tableCellHorizontalAlign:"Table Cell Horizontal Align",tableCellVerticalAlign:"Vertical Align",createTable:"Create Table",removeTable:"Remove Table",tableHeader:"Header Row",tableRemove:"Delete Table",tableCellBackground:"Table Cell Background",tableEditProperties:"Table Edit Properties",styles:"Styles",insertColumnLeft:"Insert Column Left",insertColumnRight:"Insert Column Right",deleteColumn:"Delete Column",insertRowBefore:"Insert Row Before",insertRowAfter:"Insert Row After",deleteRow:"Delete Row",tableEditHeader:"Edit Table",TableHeadingText:"Heading",TableColText:"Col",imageInsertLinkHeader:"Insert Link",editImageHeader:"Edit Image",editAudioHeader:"Edit Audio",editVideoHeader:"Edit Video",alignmentsDropDownLeft:"Align Left",alignmentsDropDownCenter:"Align Center",alignmentsDropDownRight:"Align Right",alignmentsDropDownJustify:"Align Justify",imageDisplayDropDownInline:"Inline",imageDisplayDropDownBreak:"Break",audioLayoutOptionDropDownInline:"Inline",audioLayoutOptionDropDownBreak:"Break",videoLayoutOptionDropDownInline:"Inline",videoLayoutOptionDropDownBreak:"Break",tableInsertRowDropDownBefore:"Insert row before",tableInsertRowDropDownAfter:"Insert row after",tableInsertRowDropDownDelete:"Delete row",tableInsertColumnDropDownLeft:"Insert column left",tableInsertColumnDropDownRight:"Insert column right",tableInsertColumnDropDownDelete:"Delete column",tableVerticalAlignDropDownTop:"Align Top",tableVerticalAlignDropDownMiddle:"Align Middle",tableVerticalAlignDropDownBottom:"Align Bottom",tableStylesDropDownDashedBorder:"Dashed Borders",tableStylesDropDownAlternateRows:"Alternate Rows",pasteFormat:"Paste Format",pasteFormatContent:"Choose the formatting action",plainText:"Plain Text",cleanFormat:"Clean",keepFormat:"Keep",pasteDialogOk:"OK",pasteDialogCancel:"Cancel",fileManager:"File Manager",fileDialogHeader:"File Browser",formatsDropDownParagraph:"Paragraph",formatsDropDownCode:"Preformatted",formatsDropDownQuotation:"Blockquote",formatsDropDownHeading1:"Heading 1",formatsDropDownHeading2:"Heading 2",formatsDropDownHeading3:"Heading 3",formatsDropDownHeading4:"Heading 4",fontNameSegoeUI:"Segoe UI",fontNameArial:"Arial",fontNameGeorgia:"Georgia",fontNameImpact:"Impact",fontNameTahoma:"Tahoma",fontNameTimesNewRoman:"Times New Roman",fontNameVerdana:"Verdana",numberFormatListNumber:"Number",numberFormatListLowerAlpha:"Lower Alpha",numberFormatListUpperAlpha:"Upper Alpha",numberFormatListLowerRoman:"Lower Roman",numberFormatListUpperRoman:"Upper Roman",numberFormatListLowerGreek:"Lower Greek",bulletFormatListDisc:"Disc",bulletFormatListCircle:"Circle",bulletFormatListSquare:"Square",numberFormatListNone:"None",bulletFormatListNone:"None",formatPainter:"Format Painter",emojiPicker:"Emoji Picker",embeddedCode:"Embedded code",pasteEmbeddedCodeHere:"Paste embedded code here",emojiPickerTypeToFind:"Type to find",emojiPickerNoResultFound:"No results found",emojiPickerTrySomethingElse:"Try something else",linkAriaLabel:"Open in new window",imageLinkAriaLabel:"Open in new window",unsupportedImage:"Unsupported file format",mergecells:"Merge cells",verticalsplit:"Vertical split",horizontalsplit:"Horizontal split",inlinecode:"Inline Code",slashMenuItemHeadingOneText:"Heading 1",slashMenuItemHeadingOneDescription:"Use this for a top level heading or title.",slashMenuItemHeadingTwoText:"Heading 2",slashMenuItemHeadingTwoDescription:"Use this for key sections.",slashMenuItemHeadingThreeText:"Heading 3",slashMenuItemHeadingThreeDescription:"Use this for sub sections and group headings.",slashMenuItemHeadingFourText:"Heading 4",slashMenuItemHeadingFourDescription:"Use this for the key points of the sub topics.",slashMenuItemParagraphText:"Paragraph",slashMenuItemParagraphDescription:"Writing with paragraphs.",slashMenuItemBlockquoteText:"Blockquote",slashMenuItemBlockquoteDescription:"Create a quote or citation.",slashMenuItemOrderedListText:"Ordered List",slashMenuItemOrderedListDescription:"Create an ordered list.",slashMenuItemUnorderedListText:"Unordered List",slashMenuItemUnorderedListDescription:"Create an unordered list.",slashMenuItemCodeText:"CodeBlock",slashMenuItemCodeDescription:"Create a preformatted code block.",slashMenuItemTableText:"Table",slashMenuItemTableDescription:"Insert a table.",slashMenuItemLinkText:"Link",slashMenuItemLinkDescription:"Insert a link.",slashMenuItemImageText:"Image",slashMenuItemImageDescription:"Insert an image.",slashMenuItemAudioText:"Audio",slashMenuItemAudioDescription:"Insert an audio.",slashMenuItemVideoText:"Video",slashMenuItemVideoDescription:"Insert a video.",slashMenuItemEmojiText:"Emojipicker",slashMenuItemEmojiDescription:"Use emojis to express ideas and emoticons."},g6e={alignments:"alignments",justifyleft:"justifyLeft",justifycenter:"justifyCenter",justifyright:"justifyRight",justifyfull:"justifyFull",fontname:"fontName",fontsize:"fontSize",fontcolor:"fontColor",backgroundcolor:"backgroundColor",importword:"importWord",exportword:"exportWord",exportpdf:"exportPdf",bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikethrough",clearformat:"clearFormat",clearall:"clearAll",cut:"cut",copy:"copy",paste:"paste",unorderedlist:"unorderedList",orderedlist:"orderedList",indent:"indent",outdent:"outdent",numberformatlist:"numberFormatList",bulletformatlist:"bulletFormatList",undo:"undo",redo:"redo",filemanager:"fileManager",superscript:"superscript",subscript:"subscript",createlink:"createLink",openlink:"openLink",editlink:"editLink",removelink:"removeLink",openimagelink:"openLink",editimagelink:"editLink",removeimagelink:"removeLink",image:"image",audio:"audio",video:"video",replace:"replace",audioreplace:"audioReplace",videoreplace:"videoReplace",videoalign:"videoAlign",videodimension:"videoDimension",audioremove:"audioRemove",videoremove:"videoRemove",audiolayoutoption:"audioLayoutOption",videolayoutoption:"videoLayoutOption",align:"align",caption:"caption",remove:"remove",insertlink:"insertLink",display:"display",alttext:"imageAlternateText",dimension:"dimension",fullscreen:"fullscreen",maximize:"maximize",minimize:"minimize",lowercase:"lowerCase",uppercase:"upperCase",print:"print",formats:"formats",sourcecode:"sourcecode",preview:"preview",viewside:"viewside",insertcode:"insertCode",blockquote:"blockquote",tablerows:"tableRows",tablecolumns:"tableColumns",tablecellhorizontalalign:"tableCellHorizontalAlign",tablecellverticalalign:"tableCellVerticalAlign",createtable:"createTable",removetable:"removeTable",tableheader:"tableHeader",tableremove:"tableRemove",tablecellbackground:"tableCellBackground",tableeditproperties:"tableEditProperties",styles:"styles",insertcolumnleft:"insertColumnLeft",insertcolumnright:"insertColumnRight",deletecolumn:"deleteColumn",aligntop:"AlignTop",alignmiddle:"AlignMiddle",alignbottom:"AlignBottom",insertrowbefore:"insertRowBefore",insertrowafter:"insertRowAfter",deleterow:"deleteRow",formatpainter:"formatPainter",emojipicker:"emojiPicker",embeddedCode:"Embedded code",pasteEmbeddedCodeHere:"Paste embedded code here",emojiPickerTypeToFind:"Type to find",emojiPickerNoResultFound:"No results found",emojiPickerTrySomethingElse:"Try something else",inlinecode:"inlinecode"},m6e=[{locale:"fontNameSegoeUI",value:"Segoe UI"},{locale:"fontNameArial",value:"Arial,Helvetica,sans-serif"},{locale:"fontNameGeorgia",value:"Georgia,serif"},{locale:"fontNameImpact",value:"Impact,Charcoal,sans-serif"},{locale:"fontNameTahoma",value:"Tahoma,Geneva,sans-serif"},{locale:"fontNameTimesNewRoman",value:"Times New Roman,Times,serif"},{locale:"fontNameVerdana",value:"Verdana,Geneva,sans-serif"}],f6e=[{locale:"formatsDropDownParagraph",value:"P"},{locale:"formatsDropDownCode",value:"Pre"},{locale:"formatsDropDownHeading1",value:"H1"},{locale:"formatsDropDownHeading2",value:"H2"},{locale:"formatsDropDownHeading3",value:"H3"},{locale:"formatsDropDownHeading4",value:"H4"}],y6e=[{locale:"numberFormatListNone",value:"none"},{locale:"numberFormatListNumber",value:"decimal"},{locale:"numberFormatListLowerAlpha",value:"lowerAlpha"},{locale:"numberFormatListUpperAlpha",value:"upperAlpha"},{locale:"numberFormatListLowerRoman",value:"lowerRoman"},{locale:"numberFormatListUpperRoman",value:"upperRoman"},{locale:"numberFormatListLowerGreek",value:"lowerGreek"}],v6e=[{locale:"bulletFormatListNone",value:"none"},{locale:"bulletFormatListDisc",value:"disc"},{locale:"bulletFormatListCircle",value:"circle"},{locale:"bulletFormatListSquare",value:"square"}],b6e=new Map([["Heading 1",{text:"slashMenuItemHeadingOneText",description:"slashMenuItemHeadingOneDescription"}],["Heading 2",{text:"slashMenuItemHeadingTwoText",description:"slashMenuItemHeadingTwoDescription"}],["Heading 3",{text:"slashMenuItemHeadingThreeText",description:"slashMenuItemHeadingThreeDescription"}],["Heading 4",{text:"slashMenuItemHeadingFourText",description:"slashMenuItemHeadingFourDescription"}],["Paragraph",{text:"slashMenuItemParagraphText",description:"slashMenuItemParagraphDescription"}],["Blockquote",{text:"slashMenuItemBlockquoteText",description:"slashMenuItemBlockquoteDescription"}],["OrderedList",{text:"slashMenuItemOrderedListText",description:"slashMenuItemOrderedListDescription"}],["UnorderedList",{text:"slashMenuItemUnorderedListText",description:"slashMenuItemUnorderedListDescription"}],["CodeBlock",{text:"slashMenuItemCodeText",description:"slashMenuItemCodeDescription"}],["Table",{text:"slashMenuItemTableText",description:"slashMenuItemTableDescription"}],["Link",{text:"slashMenuItemLinkText",description:"slashMenuItemLinkDescription"}],["Image",{text:"slashMenuItemImageText",description:"slashMenuItemImageDescription"}],["Audio",{text:"slashMenuItemAudioText",description:"slashMenuItemAudioDescription"}],["Video",{text:"slashMenuItemVideoText",description:"slashMenuItemVideoDescription"}],["Emojipicker",{text:"slashMenuItemEmojiText",description:"slashMenuItemEmojiDescription"}]]),w6e=["Undo","Redo"],C6e=["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","font","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","strike","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"];function S6e(i,e){var n=-1;return e.some(function(e,t){return"string"==typeof e&&i===e.toLocaleLowerCase()&&(n=t,!0)}),n}function A6e(e,t){var i=!1;return i=e.classList.contains(t)?!0:i}function x6e(e,t,i,n){var o,r;if(0===e.length&&"FontSize"===t)return"Font Size";for(var s=0;s<e.length;s++){if("value"===i&&e[s].value.toLocaleLowerCase()===t.toLocaleLowerCase()){o=e[s];break}if("text"===i&&e[s].text.toLocaleLowerCase()===t.toLocaleLowerCase()){o=e[s];break}if("subCommand"===i&&e[s].subCommand.toLocaleLowerCase()===t.toLocaleLowerCase()){o=e[s];break}}if(!je(o))switch(n){case"text":r=o.text;break;case"value":r=o.value;break;case"iconCss":r=o.iconCss}return r}function I6e(){var e=!1;return e=F.isDevice&&F.isIos?!0:e}function T6e(e){return je(e)?"":e}function E6e(e,t,i){return i?window.pageYOffset+t.getBoundingClientRect().top+e.clientY:e.pageY}function D6e(e,t){return t.getService("rteLocale").getConstant(g6e[""+e])}function M6e(e,t,i){K6e(i);for(var n=e.dropDownModule,o=e.args,r=0,s=Object.keys(e.args);r<s.length;r++)for(var a=s[r],l=0;l<e.tbItems.length;l++){var h=e.tbItems[l].subCommand,d=h&&h.toLocaleLowerCase();if(h&&d===a||"UL"===h&&"unorderedlist"===a||"OL"===h&&"orderedlist"===a||"pre"===d&&"insertcode"===a||"NumberFormatList"===h&&"numberFormatList"===a||"BulletFormatList"===h&&"bulletFormatList"===a)if("boolean"==typeof o[""+a])(!0===o[""+a]?U:q)([e.tbElements[l]],[B8e]);else if(("string"==typeof o[""+a]||null===o[""+a])&&-1<=S6e(a,e.parent.toolbarSettings.items)){var p,c,u,g,m,f=o[""+a]||"",y="";switch(a){case"formats":je(n.formatDropDown)||t||!je(n.formatDropDown)&&n.formatDropDown.isDestroyed||(p=e.parent.format.types,c=je(e.parent.format.default)?p[0].text:e.parent.format.default,y="empty"===f?"":x6e(p,f,"subCommand","text"),n.formatDropDown.content='<span style="display: inline-flex;width:'+e.parent.format.width+'" ><span class="e-rte-dropdown-btn-text'+(je(e.parent.cssClass)?"":" "+e.parent.cssClass)+'">'+(je(y)?c:y)+"</span></span>",n.formatDropDown.dataBind());break;case"alignments":je(n.alignDropDown)||!je(n.alignDropDown)&&n.alignDropDown.isDestroyed||(y=x6e(WQe,f,"subCommand","iconCss"),n.alignDropDown.iconCss=je(y)?"e-icons e-justify-left":y,n.alignDropDown.dataBind());break;case"fontname":je(n.fontNameDropDown)||t||!je(n.fontNameDropDown)&&n.fontNameDropDown.isDestroyed||(p=e.parent.fontFamily.items,y="empty"===f?"":x6e(p,f,"value","text"),c=je(e.parent.fontFamily.default)?0===p.length?i.serviceLocator.getService("rteLocale").getConstant("fontName"):p[0].text:e.parent.fontFamily.default,m="Default"===(je(y)?c:y)?i.serviceLocator.getService("rteLocale").getConstant("fontName"):je(y)?c:y,m='<span style="display: inline-flex;width:'+e.parent.fontFamily.width+'" ><span class="e-rte-dropdown-btn-text'+(je(e.parent.cssClass)?"":" "+e.parent.cssClass)+'">'+m+"</span></span>",P6e(n.fontNameDropDown,m));break;case"fontsize":je(n.fontSizeDropDown)||!je(n.fontSizeDropDown)&&n.fontSizeDropDown.isDestroyed||(u=e.parent.fontSize.items,g=je(e.parent.fontSize.default)?0===u.length?i.serviceLocator.getService("rteLocale").getConstant("fontSize"):u[0].text:e.parent.fontSize.default,g=x6e(u,""===f?g.replace(/\s/g,""):f,0<u.length&&u[0]&&g.replace(/\s/g,"")===u[0].text&&""===f?"text":"value","text"),y="empty"===f?"":"Default"===g?i.serviceLocator.getService("rteLocale").getConstant("fontSize"):g,m='<span style="display: inline-flex;width:'+e.parent.fontSize.width+'" ><span class="e-rte-dropdown-btn-text'+(je(e.parent.cssClass)?"":" "+e.parent.cssClass)+'">'+T6e(y)+"</span></span>",P6e(n.fontSizeDropDown,m));break;case"bulletFormatList":case"numberFormatList":(""!==f?U:q)([e.tbElements[l]],[B8e])}}}}function k6e(e){return"object"==typeof e?e:[e]}function P6e(e,t){var i=t.match(/style="([^"]*)"/),n="",i=(i&&(n=i[1]),t.replace(/ style="([^"]*)"/,""));e.content=i,e.dataBind(),e.element.firstChild&&(e.element.firstChild.style.cssText=n)}function B6e(e,t){for(var i=[],n=0;n<e.length;n++)for(var o=0;o<t.length;o++)if("Separator"!==t[o].type){if(("OrderedList"===e[n]||"NumberFormatList"===e[n])&&"OL"===t[o].subCommand){i.push(o);break}if(("UnorderedList"===e[n]||"BulletFormatList"===e[n])&&"UL"===t[o].subCommand){i.push(o);break}if("InsertCode"===e[n]&&"Pre"===t[o].subCommand){i.push(o);break}if("Blockquote"===e[n]&&"blockquote"===t[o].subCommand){i.push(o);break}if("FileManager"===e[n]&&"File"===t[o].subCommand){i.push(o);break}if("object"==typeof e[n]&&"Custom"===e[n].command){i.push(n);break}if(e[n]===t[o].subCommand){i.push(o);break}}return i}function F6e(e,t){for(var i=0,n=B6e(k6e(w6e),e.toolbarObj.items),o=ct("."+r8e,e.toolbarObj.element),r=0,s=Object.keys(t);r<s.length;r++){var a=s[r],l=o[n[i]];l&&e.toolbarObj.enableItems(l,t[""+a]),i++}}function L6e(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e.dispatchEvent(i)}function R6e(e){var t=Q("template");return t.innerHTML=e,t.content instanceof DocumentFragment?t.content:document.createRange().createContextualFragment(e)}function O6e(e,t){var i=[];for(t=t.firstChild;t;t=t.nextSibling)3===t.nodeType?i.push(t):i=i.concat(O6e(e,t));return i}function N6e(e){for(var t={},i=Object.keys(e),n=0;n<Object.keys(e).length;n++)t[i[n].toLocaleLowerCase()]=e[i[n]];return t}function V6e(e,t){var i;return null!==e&&""!==e?(i=t.enableHtmlEncode?_6e(j6e(e),t):_6e(e,t),t.setProperties({value:i},!0)):i="DIV"===t.enterKey?t.enableHtmlEncode?"&lt;div&gt;&lt;br/&gt;&lt;/div&gt;":"<div><br/></div>":"BR"===t.enterKey?t.enableHtmlEncode?"&lt;br/&gt;":"<br/>":t.enableHtmlEncode?"&lt;p&gt;&lt;br/&gt;&lt;/p&gt;":"<p><br/></p>",i}function _6e(e,t){var i=document.createElement("div"),n=document.createElement("div"),o=i.childNodes;if(i.innerHTML=e,i.setAttribute("class","tempDiv"),0<o.length){for(var r=void 0,s=void 0,a=void 0;i.firstChild;){for(var l=i.querySelectorAll(TWe),h=0;h<l.length;h++)l[h].innerHTML="<br>";for(var d=i.querySelectorAll("p"),h=0;h<d.length;h++)0===d[h].textContent.trim().length&&1===d[h].childNodes.length&&"#text"===d[h].childNodes[0].nodeName&&je(d[h].childNodes[0].textContent.match(/\u00a0/g))&&(d[h].innerHTML="<br>");for(var p=i.querySelectorAll(EWe),h=0;h<p.length;h++)p[h].innerHTML="&ZeroWidthSpace;";"BR"!==t.enterKey&&("#text"===i.firstChild.nodeName&&(i.firstChild.textContent.indexOf("\n")<0||""!==i.firstChild.textContent.trim())||0<=C6e.indexOf(i.firstChild.nodeName.toLocaleLowerCase()))?((r?s:(a="DIV"===t.enterKey?Q("div"):Q("p"),n.appendChild(a),a)).appendChild(i.firstChild),s=a,r=!0):"#text"===i.firstChild.nodeName&&("\n"===i.firstChild.textContent||0<=i.firstChild.textContent.indexOf("\n")&&""===i.firstChild.textContent.trim())?G(i.firstChild):(n.appendChild(i.firstChild),r=!1)}for(var c=n.querySelectorAll("img"),h=0;h<c.length;h++)c[h].classList.contains("e-rte-image-unsupported")||(c[h].classList.contains(yQe)||c[h].classList.add(yQe),c[h].classList.contains(I8e))||c[h].classList.contains(m8e)||c[h].classList.contains("e-imgleft")||c[h].classList.contains("e-imgright")||c[h].classList.contains("e-imgcenter")||c[h].classList.add(I8e)}return n.innerHTML}function H6e(e){e="DIV"===e.enterKey?e.enableHtmlEncode?"&lt;div&gt;&lt;br/&gt;&lt;/div&gt;":"<div><br/></div>":"BR"===e.enterKey?e.enableHtmlEncode?"&lt;br/&gt;":"<br/>":e.enableHtmlEncode?"&lt;p&gt;&lt;br/&gt;&lt;/p&gt;":"<p><br/></p>";return e}function z6e(e){return"<p><br></p>"===e||"&lt;p&gt;&lt;br&gt;&lt;/p&gt;"===e||"<div><br></div>"===e||"&lt;div&gt;&lt;br&gt;&lt;/div&gt;"===e||"<br>"===e||"&lt;br&gt;"===e||""===e}function j6e(e){return e.replace(/&amp;/g,"&").replace(/&amp;lt;/g,"<").replace(/&lt;/g,"<").replace(/&amp;gt;/g,">").replace(/&gt;/g,">").replace(/&nbsp;/g," ").replace(/&amp;nbsp;/g," ").replace(/&quot;/g,"")}function W6e(e,t){var i;return t.enableHtmlSanitizer&&((i=go.beforeSanitize()).selectors.tags[2]&&-1<i.selectors.tags[2].indexOf("iframe")&&(i.selectors.tags[2]="iframe:not(.e-rte-embed-url)"),Pe(i,i,{cancel:!1,helper:null}),t.trigger("beforeSanitizeHtml",i),i.cancel&&!je(i.helper)?e=i.helper(e):i.cancel||(e=go.serializeValue(i,e))),e=Q6e(e)}function Q6e(e){var t=Q("div");e=e.replace(/&(times|divide|ne)/g,"&amp;amp;$1"),t.innerHTML=e;t.querySelectorAll("font").forEach(function(e){var t=document.createElement("span"),n=(e.getAttribute("style")||"").replace(/style:/gi,"").trim();je(n)||""===n.trim()||n.endsWith(";")||(n+=";"),Array.from(e.attributes).forEach(function(e){var t=e.name.toLowerCase(),i=e.value;switch(t){case"size":n+="font-size:"+i+";";break;case"face":n+="font-family:"+i+";";break;case"bgcolor":n+="background-color:"+i+";";break;case"style":break;default:n+=t+":"+i+";"}}),je(n)||""===n.trim()||(n=n.replace(/;;+/g,";"),t.style.cssText=n),t.innerHTML=e.innerHTML,je(e.parentNode)||e.parentNode.replaceChild(t,e)});e=t.innerHTML;return t.remove(),e}function U6e(e){for(var e=e.split(","),t=e[0].match(/:(.*?);/)[1],i=atob(e[1]),n=i.length,o=new Uint8Array(n);n--;)o[n]=i.charCodeAt(n);return new Blob([o],{type:t})}function q6e(e,t,i){for(var n=0;t.length>n;n++)if(t[n].value===i.value||t[n].value===i.subCommand)return e.localeObj.getConstant(t[n].locale);return i.text}function G6e(e,t){return t&&"HTML"===t&&e&&((t=document.createElement("div")).innerHTML=e,t.querySelectorAll(".e-img-inner").forEach(function(e){e.setAttribute("contenteditable","true")}),e=t.innerHTML,t.remove()),e}function Y6e(e,t){if(e&&t){var i=document.createElement("div");if("HTML"===t){i.innerHTML=e,i.querySelectorAll(".e-img-inner").forEach(function(e){e.setAttribute("contenteditable","false")});var n=i.querySelectorAll(".e-column-resize, .e-row-resize, .e-table-box, .e-table-rhelper, .e-img-resize, .e-vid-resize");if(0<n.length)for(var o=0;o<n.length;o++)G(n[o]);X6e(i)}else i.textContent=e;return"Markdown"===t?i.textContent.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&"):i.innerHTML}return e}function X6e(e){for(var t=[bQe,eQe,iQe,tQe,CQe,wQe,vQe,SQe],i=0;i<t.length;i++){var n=e.querySelectorAll("."+t[i]);if(q(n,t[i]),0!==n.length)for(var o=0;o<n.length;o++)0===n[o].classList.length&&n[o].removeAttribute("class"),"IMG"!==n[o].nodeName&&"VIDEO"!==n[o].nodeName||""===n[o].style.outline||(n[o].style.outline="")}e.querySelectorAll('[class=""]').forEach(function(e){e.removeAttribute("class")})}function K6e(i){a6e.forEach(function(e,t){a6e[t].text=q6e(i,m6e,a6e[t])}),l6e.forEach(function(e,t){l6e[t].text=q6e(i,f6e,l6e[t])}),h6e.forEach(function(e,t){h6e[t].text=q6e(i,y6e,h6e[t])}),d6e.forEach(function(e,t){d6e[t].text=q6e(i,v6e,d6e[t])})}Z6e.prototype.renderPanel=function(){var e=this.parent,t=this.parent.createElement("div",{className:"e-rte-content",id:this.parent.getID()+"rte-view"}),i=V6e(e.value,e);this.editableElement=this.parent.createElement("div",{className:"e-content",id:this.parent.getID()+"_rte-edit-view",attrs:{contenteditable:"true"}}),je(this.parent.fontFamily.default)||(this.editableElement.style.fontFamily=this.parent.fontFamily.default),je(this.parent.fontSize.default)||(this.editableElement.style.fontSize=this.parent.fontSize.default),this.editableElement.innerHTML=i,t.appendChild(this.editableElement),this.setPanel(t),e.rootContainer.appendChild(t)},Z6e.prototype.getPanel=function(){return this.contentPanel},Z6e.prototype.getEditPanel=function(){return this.editableElement},Z6e.prototype.getText=function(){var e=this.getEditPanel().innerText;return"\n"===e?"":e},Z6e.prototype.setPanel=function(e){this.contentPanel=e},Z6e.prototype.getDocument=function(){return this.getEditPanel().ownerDocument};var J6e=Z6e;function Z6e(e){this.parent=e}eUe.prototype.render=function(){this.parent;this.contentRenderer=this.renderer.getRenderer(q3e.Content),this.contentRenderer.renderPanel()},eUe.prototype.refresh=function(e){this.parent.notify((e=void 0===e?{requestType:"refresh"}:e).requestType+"-begin",e)},eUe.prototype.destroy=function(){je(this.parent)||(this.removeEventListener(),this.locator.destroy(),this.renderer.destroy())},eUe.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(d4e,this.refresh,this),this.parent.on(c4e,this.keyUp,this))},eUe.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(d4e,this.refresh),this.parent.off(c4e,this.keyUp))},eUe.prototype.keyUp=function(e){if("HTML"===this.parent.editorMode)switch(e.args.which){case 46:case 8:var t=this.parent.contentModule.getEditPanel().childNodes;0!==t.length&&(1!==t.length||0!==t[0].childNodes.length||"BR"!==t[0].tagName&&("P"!==t[0].tagName&&"DIV"!==t[0].tagName||""!==t[0].textContent))||(t=this.parent.contentModule.getEditPanel(),"DIV"===this.parent.enterKey?t.innerHTML="<div><br/></div>":"BR"===this.parent.enterKey?t.innerHTML="<br/>":t.innerHTML="<p><br/></p>",this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),t.childNodes[0],0))}};var $6e=eUe;function eUe(e,t){this.parent=e,this.locator=t,this.renderer=this.locator.getService("rendererFactory"),this.addEventListener()}iUe.prototype.getFormattedNode=function(e,t,i){e=this.getFormatParent(e,t,i);return null!==e&&e!==i?e:null},iUe.prototype.getFormatParent=function(e,t,i){for(;(e=e.parentNode)&&e!==i&&!this.isFormattedNode(e,t););return e},iUe.prototype.isFormattedNode=function(e,t){switch(t){case"bold":return iUe.isBold(e);case"italic":return iUe.isItalic(e);case"underline":return iUe.isUnderline(e);case"strikethrough":return iUe.isStrikethrough(e);case"superscript":return iUe.isSuperscript(e);case"subscript":return iUe.isSubscript(e);case"fontcolor":return this.isFontColor(e);case"fontname":return this.isFontName(e);case"fontsize":return this.isFontSize(e);case"backgroundcolor":return this.isBackgroundColor(e);case"inlinecode":return iUe.isCode(e);default:return!1}},iUe.isBold=function(e){return-1!==["strong","b"].indexOf(e.nodeName.toLowerCase())||!(-1===this.inlineTags.indexOf(e.nodeName.toLowerCase())||!e.style||"bold"!==e.style.fontWeight)},iUe.isItalic=function(e){return-1!==["em","i"].indexOf(e.nodeName.toLowerCase())||!(-1===this.inlineTags.indexOf(e.nodeName.toLowerCase())||!e.style||"italic"!==e.style.fontStyle)},iUe.isUnderline=function(e){return-1!==["u"].indexOf(e.nodeName.toLowerCase())||!(-1===this.inlineTags.indexOf(e.nodeName.toLowerCase())||!e.style||"underline"!==e.style.textDecoration&&"underline"!==e.style.textDecorationLine)},iUe.isStrikethrough=function(e){return-1!==["del","strike","s"].indexOf(e.nodeName.toLowerCase())||!(-1===this.inlineTags.indexOf(e.nodeName.toLowerCase())||!e.style||"line-through"!==e.style.textDecoration&&"line-through"!==e.style.textDecorationLine)},iUe.isSuperscript=function(e){return-1!==["sup"].indexOf(e.nodeName.toLowerCase())},iUe.isSubscript=function(e){return-1!==["sub"].indexOf(e.nodeName.toLowerCase())},iUe.prototype.isFontColor=function(e){var t=e.style&&e.style.color;return-1!==iUe.inlineTags.indexOf(e.nodeName.toLowerCase())&&null!==t&&""!==t&&void 0!==t},iUe.prototype.isBackgroundColor=function(e){var t=e.style&&e.style.backgroundColor;return-1!==iUe.inlineTags.indexOf(e.nodeName.toLowerCase())&&null!==t&&""!==t&&void 0!==t},iUe.prototype.isFontSize=function(e){var t=e.style&&e.style.fontSize;return-1!==iUe.inlineTags.indexOf(e.nodeName.toLowerCase())&&null!==t&&""!==t&&void 0!==t},iUe.prototype.isFontName=function(e){var t=e.style&&e.style.fontFamily;return-1!==iUe.inlineTags.indexOf(e.nodeName.toLowerCase())&&null!==t&&""!==t&&void 0!==t},iUe.isCode=function(e){return-1!==["code"].indexOf(e.nodeName.toLowerCase())},iUe.inlineTags=["a","abbr","acronym","b","bdo","big","cite","code","dfn","em","font","i","kbd","label","q","samp","small","span","strong","sub","sup","tt","u","var","del"];var tUe=iUe;function iUe(){}var nUe="INSERT-IMAGE",oUe="INSERT-AUDIO",rUe="INSERT-VIDEO",sUe="INSERT-TABLE",aUe="INSERT-LINK",lUe="INSERT-ROW",hUe="INSERT-COLUMN",dUe="DELETE-ROW",pUe="DELETE-COLUMN",cUe="REMOVE-TABLE",uUe="TABLE-HEADER",gUe="TABLE_VERTICAL_ALIGN",mUe="TABLE_MERGE",fUe="TABLE_VERTICAL_SPLIT",yUe="TABLE_HORIZONTAL_SPLIT",vUe="TABLE_DASHED",bUe="TABLE_ALTERNATE",wUe="TABLE_BACKGROUND_COLOR",CUe="TABLE_MOVE",SUe="alignment-type",AUe="indent-type",xUe=["address","article","aside","audio","blockquote","canvas","details","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","noscript","ol","output","p","pre","section","table","tbody","td","tfoot","th","thead","tr","ul","video","body"],IUe=["td","th"],TUe=["table","tbody","td","tfoot","th","thead","tr"],EUe="selection-type",DUe="inserthtml-type",MUe="insert-text-type",kUe="clear-type",PUe=["area","base","br","embed","hr","img","input","param","source","track","wbr","iframe","td","table"],BUe=["word","excel","onenote"],FUe=["article","aside","blockquote","body","canvas","details","div","fieldset","figure","footer","form","header","li","main","nav","noscript","section"],LUe={h6:"###### ",h5:"##### ",h4:"#### ",h3:"### ",h2:"## ",h1:"# ",blockquote:"> ",pre:"```\n",p:""},RUe={Bold:"**",Italic:"*",StrikeThrough:"~~",InlineCode:"`",SubScript:"<sub>",SuperScript:"<sup>",UpperCase:"A-Z",LowerCase:"a-z"},OUe={OL:"1. ",UL:"- "},NUe={"toolbar-focus":"alt+f10",escape:"escape",backspace:"backspace","insert-link":"ctrl+k","insert-image":"ctrl+shift+i","insert-audio":"ctrl+shift+a","insert-video":"ctrl+alt+v","insert-table":"ctrl+shift+e",undo:"ctrl+z",redo:"ctrl+y",copy:"ctrl+c",cut:"ctrl+x",paste:"ctrl+v",bold:"ctrl+b",italic:"ctrl+i",underline:"ctrl+u",strikethrough:"ctrl+shift+s",uppercase:"ctrl+shift+u",lowercase:"ctrl+shift+l",superscript:"ctrl+shift+=",subscript:"ctrl+=",indents:"ctrl+]",outdents:"ctrl+[","html-source":"ctrl+shift+h","full-screen":"ctrl+shift+f","decrease-fontsize":"ctrl+shift+<","increase-fontsize":"ctrl+shift+>","justify-center":"ctrl+e","justify-full":"ctrl+j","justify-left":"ctrl+l","justify-right":"ctrl+r","clear-format":"ctrl+shift+r","ordered-list":"ctrl+shift+o","unordered-list":"ctrl+alt+o",space:"space",enter:"enter",tab:"tab",delete:"delete","format-copy":"alt+shift+c","format-paste":"alt+shift+v",inlinecode:"ctrl+`"},VUe={"toolbar-focus":"alt+f10",escape:"27","insert-link":"ctrl+k","insert-image":"ctrl+shift+i","insert-table":"ctrl+shift+e",undo:"ctrl+z",redo:"ctrl+y",copy:"ctrl+c",cut:"ctrl+x",paste:"ctrl+v",bold:"ctrl+b",italic:"ctrl+i",strikethrough:"ctrl+shift+s",uppercase:"ctrl+shift+u",lowercase:"ctrl+shift+l",superscript:"ctrl+shift+=",subscript:"ctrl+=","full-screen":"ctrl+shift+f","ordered-list":"ctrl+shift+o","unordered-list":"ctrl+alt+o"},_Ue={b:["strong"],strong:["b"],i:["emp","cite"],emp:["i","cite"],cite:["i","emp"]},HUe=["BR","IMG"],zUe={topLeft:[-1,-1],topRight:[1,-1],botRight:[1,1],botLeft:[-1,1]},jUe=["ArrowUp","ArrowDown","Enter","Tab","Escape"];function WUe(){var e=!1;return e=F.isDevice&&F.isIos?!0:e}function QUe(e,t){"BODY"!==e.nodeName||je(t)||je(e=top.window.document.querySelector(t))||e.contentWindow.focus()}function UUe(){return{bold:!1,italic:!1,subscript:!1,superscript:!1,strikethrough:!1,orderedlist:!1,unorderedlist:!1,numberFormatList:!1,bulletFormatList:!1,underline:!1,alignments:null,backgroundcolor:null,fontcolor:null,fontname:null,fontsize:null,formats:null,createlink:!1,insertcode:!1,blockquote:!1,inlinecode:!1}}function qUe(e,t){var i,n,o,r,s=("BODY"===t.nodeName?t.ownerDocument.defaultView.frameElement:t).closest(".e-richtexteditor"),a=s.style.height;0===e.getSelection().rangeCount||(r=(i=(e="#text"===(e=e.getSelection().getRangeAt(0)).startContainer.nodeName?e.startContainer.parentElement:e.startContainer).getBoundingClientRect()).top,i=i.bottom,n=s.getBoundingClientRect(),o=0<s.querySelectorAll(".e-count-enabled, .e-resize-enabled").length,"BODY"===t.nodeName?"auto"===a?window.innerHeight<r&&e.scrollIntoView(!1):(r>t.getBoundingClientRect().height||i>n.bottom)&&e.scrollIntoView({block:"nearest",inline:"nearest"}):"auto"===a?window.innerHeight<r&&e.scrollIntoView({block:"end",inline:"nearest"}):i>n.bottom&&(s.querySelector(".e-rte-content").scrollTop+=i-n.bottom+(o?20:0)),je(a=t.closest('div[style*="overflow-y: scroll"]')))||i>(r=a.getBoundingClientRect()).bottom&&(a.scrollTop+=i-r.bottom)}function GUe(e,t,i){for(var n=0;n<t.length;n++)0===n?e.splice(i+n,1,t[n]):e.splice(i+n,0,t[n])}function YUe(e,t){q(e,t);for(var i=0;i<e.length;i++)0===e[i].classList.length&&e[i].getAttribute("class")&&e[i].removeAttribute("class")}KUe.prototype.getBlockNodes=function(){var e=[];if(!je(this.root.querySelector(".e-cell-select"))){var t=this.root.querySelector(".e-cell-select").closest("table").querySelectorAll(".e-cell-select");if(!(je(t)||t.length<2)){for(var i=0;i<t.length;i++)this.addBlockNodes(t[i],e);this.wrapParagraphNodes(e)}}return e},KUe.prototype.addBlockNodes=function(e,t){var i=e.childNodes;if(0===i.length)t.push(e);else for(var n=0;n<i.length;n++){var o=i[n];0<=t.indexOf(o.parentElement)||(!o.parentElement||"TD"!==o.parentElement.nodeName&&"TH"!==o.parentElement.nodeName||1!==o.parentElement.childNodes.length||"BR"!==o.nodeName&&(o.nodeType,Node.TEXT_NODE),t.push(o.parentElement))}},KUe.prototype.getTextNodes=function(){var e=[];if(!je(this.root.querySelector(".e-cell-select"))){var t=this.root.querySelector(".e-cell-select").closest("table").querySelectorAll(".e-cell-select");if(!(je(t)||t.length<2))for(var i=0;i<t.length;i++)this.addTextNodes(t[i],e)}return e},KUe.prototype.addTextNodes=function(e,t){var i,n=e.childNodes;if(0!==n.length||"TD"!==e.nodeName&&"TH"!==e.nodeName)if(1!==n.length||"TD"!==e.nodeName&&"TH"!==e.nodeName||"BR"!==n[0].nodeName)for(var o=0;o<n.length;o++){var r=n[o];r.nodeType===Node.TEXT_NODE?t.push(r):r.nodeType===Node.ELEMENT_NODE&&this.addTextNodes(r,t)}else i=this.currentDocument.createTextNode("​"),e.insertBefore(i,n[0]),t.push(i);else i=this.currentDocument.createTextNode("​"),e.appendChild(i),t.push(i)},KUe.prototype.wrapParagraphNodes=function(e){for(var t=Array.from(e),i=0;i<t.length;i++){var n,o,r=t[i];"TD"!==r.nodeName&&"TH"!==r.nodeName||(1!==r.childNodes.length||"BR"!==r.childNodes[0].nodeName&&r.childNodes[0].nodeType!==Node.TEXT_NODE?(n=e.indexOf(r),this.wrapInlineNodes(r,e,n)):(n=r.childNodes[0],o=Q("p"),n.parentElement.insertBefore(o,n),o.appendChild(n),r=e.indexOf(r),e[r]=o))}for(i=0;i<e.length;i++){var s,a=e[i];"LI"===a.nodeName&&1===a.childNodes.length&&(s=a.childNodes[0]).nodeType===Node.ELEMENT_NODE&&0<=this.BASIC_FORMATS.indexOf(s.nodeName.toLocaleLowerCase())&&s.textContent===a.textContent&&(e[i]=s)}},KUe.prototype.wrapInlineNodes=function(e,t,i){var n,o=e.childNodes[0],r=Q("p"),s=[];if(je(o))e.appendChild(r),s.push(r);else for(;o;)if("BR"===o.nodeName)o.parentNode.insertBefore(r,o),r.appendChild(o),0<r.childNodes.length&&s.indexOf(r)<0&&s.push(r),o=r.nextSibling,r=Q("p");else if(0<=this.BLOCK_TAGS.indexOf(o.nodeName.toLocaleLowerCase()))if(s.push(o),0<r.childNodes.length)o=r.nextSibling;else{if(o&&"LI"===o.nodeName&&0<o.querySelectorAll("li").length)for(var a=o.querySelectorAll("li"),l=0;l<a.length;l++)s.push(a[l]);o=("LI"===o.nodeName&&je(o.nextSibling)?o.parentElement:o).nextSibling}else if(o.nodeType===Node.TEXT_NODE)""===o.textContent.trim()&&o.textContent.indexOf("​")<0?(n=o.nextSibling,G(o),o=n):(o.parentNode.insertBefore(r,o),n=o,r.appendChild(n),0<r.childNodes.length&&s.indexOf(r)<0&&s.push(r),o=r.nextSibling);else if("TABLE"===o.nodeName||"UL"===o.nodeName||"OL"===o.nodeName)if("TABLE"===o.nodeName){for(var h=[],d=o.querySelectorAll("td, th"),l=0;l<d.length;l++)this.addBlockNodes(d[l],h);this.wrapParagraphNodes(h);for(l=0;l<h.length;l++)s.push(h[l]);o=o.nextSibling}else o=o.firstElementChild;else this.BLOCK_TAGS.indexOf(o.nodeName.toLocaleLowerCase())<0&&(o.parentNode.insertBefore(r,o),r.appendChild(o),0<r.childNodes.length&&s.indexOf(r)<0&&s.push(r),o=r.nextSibling);GUe(t,s,i)};var XUe=KUe;function KUe(e,t){this.BLOCK_TAGS=["p","h1","h2","h3","h4","h5","h6","blockquote","li","pre","td","th","div","hr","section","figure"],this.BASIC_FORMATS=["p","h1","h2","h3","h4","h5","h6","blockquote","pre"],this.root=e,this.currentDocument=t}var JUe={startSelection:"e-editor-select-start",endSelection:"e-editor-select-end"},ZUe=($Ue.prototype.contents=function(e){return e&&"IFRAME"!==e.tagName?Array.prototype.slice.call(e.childNodes||[]):[]},$Ue.prototype.isBlockNode=function(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&0<=xUe.indexOf(e.tagName.toLowerCase())},$Ue.prototype.isLink=function(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&"a"===e.tagName.toLowerCase()},$Ue.prototype.blockParentNode=function(e){for(;e&&e.parentNode!==this.parent&&(!e.parentNode||!this.hasClass(e.parentNode,"e-node-inner"));)if(e=e.parentNode,this.isBlockNode(e))return e;return e},$Ue.prototype.rawAttributes=function(e){var t={},i=e.attributes;if(0<i.length)for(var n=0;n<i.length;n++){var o=i[n];t[o.nodeName]=o.value}return t},$Ue.prototype.attributes=function(e){if(!e)return"";for(var t="",i=this.rawAttributes(e),n=Object.keys(i).sort(),o=0;o<n.length;o++){var r=n[o],s=i[""+r];s.indexOf("'")<0&&0<=s.indexOf('"')?t+=" "+r+"='"+s+"'":0<=s.indexOf('"')&&0<=s.indexOf("'")?t+=" "+r+'="'+(s=s.replace(/"/g,"&quot;"))+'"':t+=" "+r+'="'+s+'"'}return t},$Ue.prototype.clearAttributes=function(e){for(var t=e.attributes,i=t.length-1;0<=i;i--){var n=t[i];e.removeAttribute(n.nodeName)}},$Ue.prototype.openTagString=function(e){return"<"+e.tagName.toLowerCase()+this.attributes(e)+">"},$Ue.prototype.closeTagString=function(e){return"</"+e.tagName.toLowerCase()+">"},$Ue.prototype.createTagString=function(e,t,i){return"<"+e.toLowerCase()+this.attributes(t)+">"+i+"</"+e.toLowerCase()+">"},$Ue.prototype.isList=function(e){return!!e&&0<=["UL","OL"].indexOf(e.tagName)},$Ue.prototype.isElement=function(e){return e===this.parent},$Ue.prototype.isEditable=function(e){return(!e.getAttribute||"true"===e.getAttribute("contenteditable"))&&["STYLE","SCRIPT"].indexOf(e.tagName)<0},$Ue.prototype.hasClass=function(e,t){return e&&e.classList&&e.classList.contains(t)},$Ue.prototype.replaceWith=function(e,t){e.parentNode.insertBefore(this.parseHTMLFragment(t),e),G(e)},$Ue.prototype.parseHTMLFragment=function(e){var t=Q("template");return t.innerHTML=e,t.content instanceof DocumentFragment?t.content:document.createRange().createContextualFragment(e)},$Ue.prototype.wrap=function(e,t){return e.parentNode.insertBefore(t,e),(t=e.previousSibling).appendChild(e),t},$Ue.prototype.insertAfter=function(e,t){t.parentNode.insertBefore(e,t.nextSibling)},$Ue.prototype.wrapInner=function(e,t){for(e.appendChild(t),(t=e.querySelector(".e-rte-wrap-inner")).classList.remove("e-rte-wrap-inner"),0===t.classList.length&&t.removeAttribute("class");e.firstChild!==t;)t.appendChild(e.firstChild);return t},$Ue.prototype.unWrap=function(e){var t=e&&e.parentNode;if(!t)return[];for(var i=[];e.firstChild&&" "!==e.textContent;)i.push(e.firstChild),t.insertBefore(e.firstChild,e);return i=0<i.length?i:[e.parentNode],t.removeChild(e),i},$Ue.prototype.getSelectedNode=function(e,t){return e.nodeType===Node.ELEMENT_NODE&&0<e.childNodes.length&&e.childNodes[t-1]&&e.childNodes[t-1].nodeType===Node.ELEMENT_NODE&&(e.childNodes[t-1].classList.contains(JUe.startSelection)||e.childNodes[t-1].classList.contains(JUe.endSelection))?e=e.childNodes[t-1]:e.nodeType===Node.ELEMENT_NODE&&0<e.childNodes.length&&e.childNodes[t]&&(e=e.childNodes[t]),e=e.nodeType===Node.TEXT_NODE?e.parentNode:e},$Ue.prototype.nodeFinds=function(e,t){for(var i=[],n=0;n<t.length;n++)e.contains(t[n])&&e!==t[n]&&i.push(t[n]);return i},$Ue.prototype.isEditorArea=function(){for(var e=this.getRangePoint(0).commonAncestorContainer;e&&!this.isElement(e);)e=e.parentNode;return!!this.isElement(e)},$Ue.prototype.getRangePoint=function(e){var t=this.getSelection(),i=[];if(t&&t.getRangeAt&&t.rangeCount)for(var i=[],n=0;n<t.rangeCount;n++)i.push(t.getRangeAt(n));else i=[this.currentDocument.createRange()];return void 0!==e?i[e]:i},$Ue.prototype.getSelection=function(){return this.nodeSelection.get(this.currentDocument)},$Ue.prototype.getPreviousNode=function(e){for(e=e.previousElementSibling;e&&"\n"===e.textContent;)e=e.previousElementSibling;return e},$Ue.prototype.encode=function(e){var t=document.createElement("div");return t.innerText=e,t.innerHTML.replace(/<br\s*[\/]?>/gi,"\n")},$Ue.prototype.saveMarker=function(e){var t=this.parent.querySelector("."+JUe.startSelection),i=this.parent.querySelector("."+JUe.endSelection),t=(this.hasClass(t,JUe.startSelection)&&1<t.classList.length?(n=this.createTagString("p",t,this.encode(t.textContent)),this.replaceWith(t,n),(t=this.parent.querySelector("."+JUe.startSelection)).classList.remove(JUe.startSelection),t.childNodes):this.unWrap(t))[0],n=this.hasClass(i,JUe.endSelection)&&1<i.classList.length?(n=this.createTagString("p",i,this.encode(i.textContent)),this.replaceWith(i,n),(i=this.parent.querySelector("."+JUe.endSelection)).classList.remove(JUe.endSelection),i.childNodes[0]):i?this.unWrap(i)[0]:t;return e.startContainer=e.getNodeArray(t,!0),e.endContainer=e.getNodeArray(n,!1),e},$Ue.prototype.marker=function(e,t){return'<span class="'+e+'">'+t+"</span>"},$Ue.prototype.setMarker=function(e){var e=e.range,t=e.startContainer.childNodes,i=1<t.length&&"TABLE"===t[0].nodeName&&0===e.startOffset,n=1<t.length&&"IMAGE"===t[0].nodeName&&1===e.endOffset&&"#text"===e.endContainer.nodeName&&0===e.endContainer.textContent.length,i=(i?function(e){for(var t=e;0<(t=0<t.childNodes.length?t.childNodes[0]:t).childNodes.length;);return t}(t[e.startOffset+1]):t[0<e.startOffset?e.startOffset-1:e.startOffset])||e.startContainer,t=e.endContainer.childNodes[!(0<e.endOffset)||n?e.endOffset:e.endOffset-1]||e.endContainer;if(i.nodeType===Node.ELEMENT_NODE&&t.nodeType===Node.ELEMENT_NODE&&(i.contains(t)||t.contains(i))){var o=i.contains(t)?i:t;if(o.nodeType!==Node.TEXT_NODE){for(var r=[],s=[],a=o;o.contains(a);)r.indexOf(a)<0&&a.childNodes&&a.childNodes.length?(r.push(a),a=a.childNodes[0]):a.nextSibling?a=a.nextSibling:a.parentNode&&(a=a.parentNode,r.push(a)),s.indexOf(a)<0&&(a.nodeType===Node.TEXT_NODE||0<=IUe.indexOf(a.parentNode.tagName.toLocaleLowerCase())&&("BR"===a.tagName||"IMG"===a.tagName))&&s.push(a);s.length&&(i=i.contains(t)?s[0]:i,t=s[s.length-1])}}i!==t?(i.nodeType!==Node.TEXT_NODE&&("BR"===i.tagName&&0<=IUe.indexOf(i.parentNode.tagName.toLocaleLowerCase())||"IMG"===i.tagName)?(this.replaceWith(i,this.marker(JUe.startSelection,this.encode(i.textContent))),e.startContainer.querySelector("."+JUe.startSelection).appendChild(i)):3!==i.nodeType&&"#text"!==i.nodeName&&"BR"!==i.nodeName?(n=this.marker(JUe.startSelection,""),ht([this.parseHTMLFragment(n)],i)):this.replaceWith(i,this.marker(JUe.startSelection,this.encode(i.textContent))),t.nodeType!==Node.TEXT_NODE&&"BR"===t.tagName&&0<=IUe.indexOf(t.parentNode.tagName.toLocaleLowerCase())?(this.replaceWith(t,this.marker(JUe.endSelection,this.encode(t.textContent))),e.endContainer.querySelector("."+JUe.endSelection).appendChild(t)):this.ensureSelfClosingTag(t,JUe.endSelection,e)):this.ensureSelfClosingTag(i,JUe.startSelection,e)},$Ue.prototype.ensureSelfClosingTag=function(e,t,i){var n=!1;if(3===e.nodeType)this.replaceWith(e,this.marker(t,this.encode(e.textContent)));else if("BR"===e.tagName){this.replaceWith(e,this.marker(t,this.encode(e.textContent)));var o=i.startContainer.querySelector("."+t);o&&o.parentElement.appendChild(e)}else{var o=je(e.parentElement)?"":e.parentElement.tagName.toLocaleLowerCase();if("IMG"===e.tagName&&"p"!==o&&"div"!==o&&(o=document.createElement("p"),e.parentElement.insertBefore(o,e),o.appendChild(e),e=o.children[0]),"TABLE"===e.tagName)if(n=!0,""===e.textContent){o=e.querySelectorAll("td");e=je((e=o[o.length-1]).childNodes[0])?e:e.childNodes[0]}else{for(var r=e.lastChild;3!==r.nodeType&&"#text"!==r.nodeName&&"BR"!==r.nodeName;)r=r.lastChild;e=r}for(var s=0;s<HUe.length;s++)e=e.tagName!==HUe[s]||n?e:e.parentNode;3===e.nodeType&&"#text"===e.nodeName?this.replaceWith(e,this.marker(t,this.encode(e.textContent))):"BR"===e.nodeName?(this.replaceWith(e,this.marker(JUe.endSelection,this.encode(e.textContent))),i.endContainer.querySelector("."+JUe.endSelection).appendChild(e)):(o=this.marker(t,""),ht([this.parseHTMLFragment(o)],e))}},$Ue.prototype.createTempNode=function(e){var t,i,n=e.textContent;return"BR"===e.tagName?(t="<p></p>",i=e.parentNode,0<=IUe.indexOf(i.tagName.toLocaleLowerCase())&&(e=this.wrap(e,this.parseHTMLFragment(t)))):(e.nodeType!==Node.TEXT_NODE&&(e.classList.contains(JUe.startSelection)||e.classList.contains(JUe.endSelection))||0<n.replace(/\n/g,"").replace(/(^ *)|( *$)/g,"").length||n.length&&n.indexOf("\n")<0)&&(i=e,e=this.wrap(e,this.parseHTMLFragment(t="<p></p>")),i.nodeType!==Node.ELEMENT_NODE||!i.firstChild||"BR"!==i.firstChild.nodeName||!i.classList.contains(JUe.startSelection)&&!i.classList.contains(JUe.endSelection))&&e.nextElementSibling&&"BR"===e.nextElementSibling.tagName&&e.appendChild(e.nextElementSibling),e},$Ue.prototype.getImageTagInSelection=function(){var e=this.getSelection();return this.isEditorArea()&&e.rangeCount?e.focusNode.querySelectorAll("img"):null},$Ue.prototype.gatherElementsAround=function(e,t){for(var i=Q(t),n=e.previousSibling,t=e.parentElement,o=("e-editor-select-start"===t.className?t.parentNode.insertBefore(i,t):t&&t.insertBefore(i,e),0);null!==n&&"BR"!==n.nodeName&&!this.isBlockNode(n);){var r=n.previousSibling;3!==n.nodeType&&1!==n.nodeType||(0===o?i.appendChild(n):i.insertBefore(n,i.firstChild)),n=r,o++}for(i.appendChild(e),n=i.nextSibling||i.parentElement.nextSibling;null!==n&&"BR"!==n.nodeName&&!this.isBlockNode(n);){var s=n.nextSibling||n.parentElement.nextSibling;3!==n.nodeType&&1!==n.nodeType||i.appendChild(n),n=s}return i},$Ue.prototype.convertToBlockNodes=function(e,t){if(1<e.length)for(var i,n=0,o=e[0];!je(o);)"BR"===o.nodeName&&(i=o.nextSibling,G(o),o=i),je(o)||(e[n]=t?"LI"===o.nodeName||this.isBlockNode(o)?o:this.gatherElementsAround(o,t?"p":"div"):this.isBlockNode(e[n])?e[n]:this.gatherElementsAround(o,t?"p":"div"),null!==(o=je(("#text"===(i="LI"===e[n].nodeName?e[n].parentElement:e[n]).nodeName?i.parentElement:i).querySelector(".e-editor-select-end"))&&je(z(o,".e-editor-select-end"))?i.nextSibling:null))||je(i.nextSibling)||"BR"!==i.nextSibling.nodeName||G(i.nextSibling),n++;else this.isBlockNode(e[0])||(e[0]=this.gatherElementsAround(e[0],t?"p":"div"),je(e[0].nextSibling))||"BR"!==e[0].nextSibling.nodeName||G(e[0].nextSibling);return e},$Ue.prototype.blockNodes=function(l){var h=[],e=this.getSelection(),t=this.tableSelection.getBlockNodes();if(0<t.length)return t;if(this.isEditorArea()&&e.rangeCount)for(var d=this.getRangePoint(),p=this,i=0;i<d.length;i++)!function(e){for(var t,i=void 0,n=d[e],e=p.getSelectedNode(n.startContainer,n.startOffset),o=p.getSelectedNode(n.endContainer,n.endOffset),r=(p.isBlockNode(e)&&h.indexOf(e)<0&&h.push(e),i=p.blockParentNode(e),p.blockParentNode(o)),s=(i&&h.indexOf(i)<0&&(!je(l)&&l?(t=["TD","TH"],[n.commonAncestorContainer,i,r].some(function(e){return-1!==t.indexOf(e.nodeName)})?1<(r=p.getPreBlockNodeCollection(n)).length?p.wrapWithBlockNode(r,h):0<r.length&&(e!==o&&"BR"!==e.nodeName||e===o&&"SPAN"===e.nodeName&&(e.classList.contains(JUe.startSelection)||e.classList.contains(JUe.endSelection)))&&h.push(p.createTempNode(e)):h.push(i)):0<=IUe.indexOf(i.tagName.toLocaleLowerCase())&&("BR"===e.tagName||e.nodeType===Node.TEXT_NODE||e.classList.contains(JUe.startSelection)||e.classList.contains(JUe.endSelection))?(r=e.previousSibling&&e.previousSibling.nodeType===Node.TEXT_NODE?e.previousSibling:e,e.nextSibling||e.previousSibling||"BR"!==e.tagName?h.push(p.createTempNode(r)):h.push(r)):h.push(i)),[]),a=e;a!==o&&a!==p.parent;)s.indexOf(a)<0&&a.childNodes&&a.childNodes.length?(s.push(a),a=a.childNodes[0]):a&&8!==a.nodeType&&("BR"===a.tagName||a.nodeType===Node.TEXT_NODE&&""!==a.textContent.trim()||a.nodeType!==Node.TEXT_NODE&&(a.classList.contains(JUe.startSelection)||a.classList.contains(JUe.endSelection)))&&0<=IUe.indexOf(a.parentNode.tagName.toLocaleLowerCase())?a=p.createTempNode(a):a.nextSibling&&8!==a.nextSibling.nodeType&&("BR"===a.nextSibling.tagName||a.nextSibling.nodeType===Node.TEXT_NODE||a.nextSibling.classList.contains(JUe.startSelection)||a.nextSibling.classList.contains(JUe.endSelection))&&0<=IUe.indexOf(a.nextSibling.parentNode.tagName.toLocaleLowerCase())?a=p.createTempNode(a.nextSibling):a.nextSibling?a=a.nextSibling:a.parentNode&&(a=a.parentNode,s.push(a)),h.indexOf(a)<0&&a.nodeType===Node.ELEMENT_NODE&&0<=IUe.indexOf(a.parentNode.tagName.toLocaleLowerCase())&&(a.classList.contains(JUe.startSelection)||a.classList.contains(JUe.endSelection))&&h.push(p.createTempNode(a)),p.isBlockNode(a)&&p.ignoreTableTag(a)&&s.indexOf(a)<0&&h.indexOf(a)<0&&(a!==o||0<n.endOffset)&&h.push(a),"IMG"===a.nodeName&&"true"===a.parentElement.contentEditable&&h.push(a);(i=p.blockParentNode(o))&&p.ignoreTableTag(i)&&h.indexOf(i)<0&&!je(i.previousElementSibling)&&"IMG"!==i.previousElementSibling.tagName&&h.push(i)}(i);for(var n,o=h.length-1;0<o;o--)this.nodeFinds(h[o],h).length&&(n=h[o].querySelectorAll("ul, ol"),"LI"===h[o].tagName&&0<n.length||h.splice(o,1));return h},$Ue.prototype.ignoreTableTag=function(e){return!(0<=TUe.indexOf(e.tagName.toLocaleLowerCase()))},$Ue.prototype.getPreBlockNodeCollection=function(e){var t=this.getSelectedNode(e.startContainer,e.startOffset),e=this.getSelectedNode(e.endContainer,e.endOffset),i=[],n=t.closest("td, th");if(!je(n))for(var o=Array.from(n.childNodes),r=!0,s=this.getClosestInlineParent(t,n,!0),a=this.getClosestInlineParent(e,n,!1),l=0;l<o.length;l++){var h=o[l];s===a&&h===s?(i.push(h),r=!0):h===s?r=!1:h===a&&(i.push(h),r=!0),r||i.push(h)}return i},$Ue.prototype.getClosestInlineParent=function(e,t,i){if(e.nodeType===Node.TEXT_NODE)return e;if(this.isBlockNode(e))return e;for(var n=e,o=!1;n;){var r=n;if(o){if(this.isBlockNode(n))return r;if(i&&n.previousSibling){if(this.isBlockNode(n.previousSibling)||"BR"===n.previousSibling.nodeName)return r;n=n.previousSibling}else{if(i||!n.nextSibling)return n;if(this.isBlockNode(n.nextSibling)||"BR"===n.nextSibling.nodeName)return r;n=n.nextSibling}}else(n=n.parentElement)===t&&(n=r,o=!0)}return null},$Ue.prototype.wrapWithBlockNode=function(e,t){for(var i=Q("p"),n=0;n<e.length;n++){var o=e[n];if("BR"===o.nodeName)o.parentNode.insertBefore(i,o),i.appendChild(o),0<i.childNodes.length&&t.push(i),i=Q("p");else{if(this.isBlockNode(o))t.push(o);else{if("#text"===o.nodeName&&""===o.textContent.trim())continue;0===i.childElementCount&&o.parentNode.insertBefore(i,o),i.appendChild(o)}n===e.length-1&&i.nextElementSibling&&0===i.querySelectorAll("br").length&&"BR"===i.nextElementSibling.nodeName&&i.appendChild(i.nextElementSibling)}}0<i.childNodes.length&&t.indexOf(i)<0&&t.push(i)},$Ue.prototype.getImmediateBlockNode=function(e){for(;e&&xUe.indexOf(e.nodeName.toLocaleLowerCase())<0;)e=e.parentNode;return e},$Ue);function $Ue(e,t){this.parent=e,this.nodeSelection=new _9e(e),this.currentDocument=t,this.tableSelection=new XUe(e,t)}var e7e="keydown",t7e="action",i7e="format-type",n7e="keydown-handler",o7e="list-type",r7e="keyup-handler",s7e="keyup",a7e="model_changed_plugin",l7e="model_changed",h7e="ms_word_cleanup_plugin",d7e="ms_word_cleanup",p7e="onBegin",c7e="actionBegin",u7e="format_painter_actions",g7e="blockquote_list_handled",m7e="emoji_picker_actions",f7e="mouseDown",y7e="destroy",v7e="internal_destroy",b7e=(w7e.WrapBefore=function(e,t,i){return t.innerText=e.textContent,i?this.AppendBefore(t,e,!0):this.AppendBefore(t,e),e.parentNode&&e.parentNode.removeChild(e),t.childNodes[0]},w7e.Wrap=function(e,t){return this.AppendBefore(t,e),t.appendChild(e),e},w7e.unwrap=function(e){for(var t=e.parentNode,i=[];e.firstChild;)i.push(t.insertBefore(e.firstChild,e));return t.removeChild(e),i},w7e.AppendBefore=function(e,t,i){return t.parentNode?i?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.insertBefore(e,t):t},w7e);function w7e(){}S7e.prototype.GetSpliceNode=function(e,t){return t=this.SplitNode(e,t,!0),t=this.SplitNode(e,t,!1)},S7e.prototype.SplitNode=function(e,t,i){var n,o,r;return t?(e=e.cloneRange(),n=t.parentNode,o=this.nodeSelection.getIndex(t),e.collapse(i),i?e.setStartBefore(t):e.setEndAfter(t),e=e.extractContents(),i?(t=n.childNodes[o],(e=this.spliceEmptyNode(e,!1))&&0<e.childNodes.length&&(!(1!==e.childNodes.length||"IMG"===e.childNodes[0].nodeName||0<e.querySelectorAll("img").length||!this.isRteElm(e)||""!==e.textContent.trim()||32===e.textContent.charCodeAt(0)||160===e.textContent.charCodeAt(0))||(t?b7e.AppendBefore(e,t):(n.appendChild(e),(r=document.createElement("div")).innerHTML="&#65279;&#65279;",t=r.firstChild,n.appendChild(t))))):(t=1<n.childNodes.length?n.childNodes[o]:n.childNodes[0],(e=this.spliceEmptyNode(e,!0))&&0<e.childNodes.length&&(!(1!==e.childNodes.length||"IMG"===e.childNodes[0].nodeName||!this.isRteElm(e)||""!==e.textContent.trim()||32===e.textContent.charCodeAt(0)||160===e.textContent.charCodeAt(0))||(t?b7e.AppendBefore(e,t,!0):t=1<n.childNodes.length&&n.childNodes.length!==o?(t=n.childNodes[n.childNodes.length-1],b7e.AppendBefore(e,t,!0),t.nextSibling):(n.appendChild(e),(r=document.createElement("div")).innerHTML="&#65279;&#65279;",n.insertBefore(r.firstChild,n.firstChild),n.firstChild)))),t):null},S7e.prototype.isRteElm=function(e){var t=!0;if(1===e.childNodes.length&&"IMG"!==e.childNodes[0].nodeName)for(var i=e.childNodes[0],n=0;!je(i.childNodes)&&n<i.childNodes.length;n++)("IMG"===i.childNodes[n].nodeName||"SPAN"===i.childNodes[n].nodeName&&(i.childNodes[n].classList.contains("e-video-wrap")||i.childNodes[n].classList.contains("e-embed-video-wrap")||i.childNodes[n].classList.contains("e-audio-wrap"))||"TABLE"===i.childNodes[n].nodeName)&&(t=!1);else t=!0;return t},S7e.prototype.spliceEmptyNode=function(e,t){var i=1===e.childNodes.length&&"#text"===e.childNodes[0].nodeName&&""===e.childNodes[0].textContent||""===e.textContent?-1:e.childNodes.length-1;return-1<i&&!t?this.spliceEmptyNode(e.childNodes[i],t):-1<i?this.spliceEmptyNode(e.childNodes[0],t):3===e.nodeType||11===e.nodeType||"IMG"===e.nodeName||0<e.querySelectorAll("img").length||e.classList.contains("e-video-wrap")||e.classList.contains("e-audio-wrap")||e.parentNode.removeChild(e),e},S7e.prototype.GetCursorStart=function(e,t,i){for(var n=(e=i?e:e.reverse())[0],o=0;o<e.length&&(i?e[o]<t:e[o]>=t);o++)n=e[o];return n},S7e.prototype.GetCursorRange=function(e,t,i){for(var e=e.createRange(),n=[],o=(n.push(0),this.TrimLineBreak(i.data)),r=o.indexOf(" ",0);-1!==r;)n.indexOf(r)<0&&n.push(r),new RegExp("\\s").test(o[r-1])&&n.indexOf(r-1)<0&&n.push(r-1),new RegExp("\\s").test(o[r+1])&&n.push(r+1),r=o.indexOf(" ",r+1);return n.push(o.length),0<=n.indexOf(t.startOffset)||0<=n.indexOf(t.startOffset-1)&&(1!==t.startOffset||1===t.startOffset&&new RegExp("\\s").test(o[0]))||n[n.length-1]-1===t.startOffset&&t.endOffset!==o.length-1&&!new RegExp("\\s").test(o[0])?(e=t,this.position=1):(0!==(i=this.GetCursorStart(n,t.startOffset,!0))&&o[i]&&" "===o[i]&&(i+=1),this.position=t.startOffset-i,e.setStart(t.startContainer,i),e.setEnd(t.startContainer,this.GetCursorStart(n,t.startOffset,!1))),e},S7e.prototype.GetCursorNode=function(e,t,i){return this.GetSpliceNode(this.GetCursorRange(e,t,i),i)},S7e.prototype.TrimLineBreak=function(e){return e.replace(/(\r\n\t|\n|\r\t)/gm," ")};var C7e=S7e;function S7e(){this.enterAction="P",this.position=-1,this.nodeSelection=new _9e}x7e.Insert=function(e,t,i,n,o){r="string"==typeof t?((r=document.createElement("div")).innerHTML=t.replace(/&(times|divide|ne)(;?)/g,"&amp;$1$2"),n?r:r.firstChild):n&&(je(t)||je(t.classList)||!t.classList.contains("pasteContent"))?((r=document.createElement("div")).appendChild(t),r):t;var r,s,a=je(i)?0:i.scrollHeight,l=new _9e(i),h=new C7e,d=l.getRange(e),p=(d.startContainer!==i||d.startContainer!==d.endContainer||0!==d.startOffset||d.startOffset!==d.endOffset||0!==i.textContent.length||"P"!==i.children[0].tagName&&"DIV"!==i.children[0].tagName&&"BR"!==i.children[0].tagName||(l.setSelectionText(e,d.startContainer.children[0],d.startContainer.children[0],0,0),d=l.getRange(e)),d.startContainer===i&&d.startContainer===d.endContainer&&0===d.startOffset&&d.startOffset===d.endOffset&&0<i.textContent.trim().length&&(je(p=this.findFirstTextNode(d.startContainer))||(l.setSelectionText(e,p,p,0,0),d=l.getRange(e))),"BR"===d.startContainer.nodeName&&0===d.startOffset&&d.startOffset===d.endOffset&&d.startContainer===d.endContainer&&(p=Array.prototype.slice.call(d.startContainer.parentElement.childNodes).indexOf(d.startContainer),l.setSelectionText(e,d.startContainer.parentElement,d.startContainer.parentElement,p,p),d=l.getRange(e)),d.startOffset===d.endOffset&&0===d.startOffset&&d.startContainer===d.endContainer),c=d.collapsed,u=this.getNodeCollection(d,l,r),g="table"===r.nodeName.toLowerCase()?je(u[0])?d.startContainer:this.closestEle(u[0].parentNode,i):u[0];if((g=g&&"BR"===g.nodeName?g.parentNode:g)&&"LI"===g.nodeName&&"table"===r.nodeName.toLowerCase())0!==u.length||"TABLE"!==(m=l.processedTableImageCursor(d)).startName&&"TABLE"!==m.endName||(m=m.start?m.startNode:m.endNode,u.push(m)),m=this.closestEle(u[u.length-1].parentNode,i),this.insertTableInList(d,r,g,u[0],h,m,i);else if(!p||""!==d.startContainer.textContent||"BR"===d.startContainer.nodeName||"BR"===o||"#text"===r.nodeName||je(r.children[0])||je(r.children[0].tagName)||"IMG"!==r.children[0].tagName||1!==r.children.length||(d.startContainer.innerHTML=""),n||!je(r)&&!je(r.classList)&&r.classList.contains("pasteContent"))this.pasteInsertHTML(u,r,d,l,h,e,c,g,i,o);else{if(i!==d.startContainer&&(!c&&(g.nodeType!==Node.ELEMENT_NODE||-1===TUe.indexOf(g.tagName.toLocaleLowerCase()))||"table"===r.nodeName.toLowerCase()&&g&&-1===TUe.indexOf(g.tagName.toLocaleLowerCase()))){var m=h.GetSpliceNode(d,g),n=m.previousSibling,f=m.parentNode;if(1===u.length||"table"===r.nodeName.toLowerCase()&&0===m.childElementCount?(l.setSelectionContents(e,m),d=l.getRange(e)):f&&"LI"!==f.nodeName&&(o=je(o=h.GetSpliceNode(d,u[u.length-1].parentElement))?m:o,l.setSelectionText(e,m,o,0,(3===o.nodeType?o.textContent:o.childNodes).length),d=l.getRange(e)),null!==d.startContainer.parentElement.closest("ol,ul")&&null!==d.endContainer.parentElement.closest("ol,ul")?(s=f,null!==(c=d).startContainer.parentElement.closest("ol,ul")&&null!==c.endContainer.parentElement.closest("ol,ul")&&(c.extractContents(),0<(c=("#text"===c.startContainer.nodeName?c.startContainer.parentElement:c.startContainer).querySelectorAll("li")).length)&&c.forEach(function(e){je(e.firstChild)||"OL"!==e.firstChild.nodeName&&"UL"!==e.firstChild.nodeName||(e.style.listStyleType="none"),""===e.innerHTML.trim()&&e!==s&&e.remove()})):d.extractContents(),"TABLE"===t.tagName){var y=z(d.startContainer,"blockquote");if(!je(y)&&0<y.childNodes.length)for(var v=y.childNodes.length-1;0<=v;v--){var b=y.childNodes[v];je(b)||""!==b.innerText.trim()||G(b)}this.removeEmptyElements(i,!1,y)}for(var w=0;w<u.length;w++)3!==u[w].nodeType&&null!=u[w].parentNode&&"IMG"!==u[w].nodeName&&u[w].parentNode.removeChild(u[w]);if(je(n)||je(n.parentNode)){for(var C=null;f!==i&&f.firstChild&&""===f.textContent.trim()&&"LI"!==f.nodeName;)C=f,f=f.parentNode;(f=null!==C?C:f).firstChild&&(f!==i||"TABLE"===r.nodeName&&p&&f===d.startContainer&&f===d.endContainer)?""===f.textContent.trim()&&f!==i&&"LI"===f.nodeName?f.appendChild(r):""===f.textContent.trim()&&f!==i?(b7e.AppendBefore(r,f,!1),G(f)):b7e.AppendBefore(r,f.firstChild,!1):je(m.previousSibling)&&"TABLE"===t.tagName?f.prepend(r):f.appendChild(r)}else e.contains(n)?b7e.AppendBefore(r,n,!0):d.insertNode(r);"IMG"===r.nodeName?this.imageFocus(r,l,e):3!==r.nodeType?l.setSelectionText(e,r,r,0,r.childNodes.length):l.setSelectionText(e,r,r,0,r.textContent.length)}else{h=je(g)?null:z(g,"li");je(g)||"TD"!==g.nodeName&&"TH"!==g.nodeName||je(h)||p?(d.deleteContents(),p&&""===d.startContainer.textContent&&"BR"!==d.startContainer.nodeName&&(d.startContainer.innerHTML=""),F.isIE?((o=e.createDocumentFragment()).appendChild(r),d.insertNode(o)):1===d.startContainer.nodeType&&"hr"===d.startContainer.nodeName.toLowerCase()&&"hr"===d.endContainer.nodeName.toLowerCase()?(c=d.startContainer.nextElementSibling)&&(c.querySelector("br")&&G(c.querySelector("br")),c.appendChild(r)):"BR"===d.startContainer.nodeName?d.startContainer.parentElement.insertBefore(r,d.startContainer):d.insertNode(r)):(d.extractContents(),h.appendChild(r),this.removeEmptyNextLI(h)),3!==r.nodeType&&0<r.childNodes.length?l.setSelectionText(e,r,r,1,1):"IMG"===r.nodeName?this.imageFocus(r,l,e):3!==r.nodeType?l.setSelectionContents(e,r):l.setSelectionText(e,r,r,r.textContent.length,r.textContent.length)}je(i)||!(a<i.scrollHeight)||1!==r.nodeType||"IMG"!==r.nodeName&&je(r.querySelector("img"))||qUe(e,i)}},x7e.removeEmptyNextLI=function(e){for(var t=z(e,"ul,ol");t&&t.parentElement&&"LI"===t.parentElement.nodeName;)t=z(t.parentElement,"ul,ol");t&&(e=t.querySelectorAll("li"),e.forEach(function(e){var t;""!==(t=e).textContent.trim()||t.querySelector("audio,video,img,table,br")||G(e)}))},x7e.findFirstTextNode=function(e){if(e.nodeType===Node.TEXT_NODE)return e;for(var t=0;t<e.childNodes.length;t++){var i=this.findFirstTextNode(e.childNodes[t]);if(!je(i))return i}return null},x7e.pasteInsertHTML=function(e,t,i,n,o,r,s,a,l,h){for(var d,p,c,u=i.startOffset===i.endOffset&&i.startContainer===i.endContainer,g=(u&&i.startContainer===l&&""===l.textContent&&0===i.startOffset&&0===i.endOffset&&(I=this.getImmediateBlockNode(e[e.length-1],l),n.setSelectionText(r,I,I,0,0),i=n.getRange(r)),l===i.startContainer||(s||a.nodeType===Node.ELEMENT_NODE&&-1!==TUe.indexOf(a.tagName.toLocaleLowerCase()))&&("table"!==t.nodeName.toLowerCase()||!a||-1!==TUe.indexOf(a.tagName.toLocaleLowerCase()))||je(I=o.GetSpliceNode(i,a))||(p=(je(I.previousSibling)?I.parentNode:I).previousSibling,c=1===e.length?(n.setSelectionContents(r,I),i=n.getRange(r),!0):(d=je(d=o.GetSpliceNode(i,e[e.length-1].parentElement))?I:d,n.setSelectionText(r,I,d,0,(3===d.nodeType?d.textContent:d.childNodes).length),i=n.getRange(r),!1)),!1),m=(this.removingComments(t),t.childNodes),f=0;f<m.length;f++)if(0<=xUe.indexOf(m[f].nodeName.toLocaleLowerCase())){g=!0;break}var y=document.createDocumentFragment();if(g){for(var v=i.startContainer;!je(v)&&"PRE"!==v.nodeName&&v!==l;)v=v.parentElement;if(je(t)||je(v)||"PRE"!==v.nodeName){this.insertTempNode(i,t,e,o,l);var b,w,C=!0,S=void 0,A=void 0,x=void 0;for(this.contentsDeleted||(s||0!==i.startContainer.parentElement.textContent.length||"BR"!==i.startContainer.nodeName||"P"!==i.startContainer.parentElement.nodeName||l.removeChild(i.startContainer.parentElement),i.deleteContents());t.firstChild;)"#text"===t.firstChild.nodeName&&""===t.firstChild.textContent.trim()?G(t.firstChild):"#text"===t.firstChild.nodeName&&C||0<=this.inlineNode.indexOf(t.firstChild.nodeName.toLocaleLowerCase())&&C?(w=t.firstChild,je(t.previousElementSibling)&&(b=Q("DIV"===h?"div":"p"),t.parentElement.insertBefore(b,t)),"BR"===t.previousElementSibling.nodeName?t.parentElement.insertBefore(t.firstChild,t):t.previousElementSibling.appendChild(t.firstChild)):(w=t.firstChild,S="#text"===t.firstChild.nodeName||0<=this.inlineNode.indexOf(t.firstChild.nodeName.toLocaleLowerCase())?(S?(x.appendChild(t.firstChild),y.appendChild(x)):((A=Q("DIV"===h?"div":"p")).appendChild(t.firstChild),y.appendChild(A)),x=A,!0):(y.appendChild(t.firstChild),!1),C=!1);t.parentNode.replaceChild(y,t)}else i.insertNode(t),w=t.lastChild}else if(u){var a=Q("span",{className:"tempSpan"}),I=z(i.startContainer.parentElement,"a");for(3===i.startContainer.nodeType&&I&&z(I,"span")?(0<(o=this.getImmediateBlockNode(i.startContainer,l)).querySelectorAll("br").length&&G(o.querySelector("br")),z(I,"span").appendChild(a)):e[0]&&"#text"===e[0].nodeName&&e[0].nodeValue.includes("​")&&!je(e[0].parentElement)&&!je(e[0].parentElement.previousElementSibling)&&e[0].parentElement.previousElementSibling.classList.contains("e-mention-chip")?i.startContainer.parentElement.insertAdjacentElement("afterend",a):i.insertNode(a);t.firstChild;)w=t.firstChild,y.appendChild(t.firstChild);var s=this.getClosestMatchingElement(a.parentNode,y);1===y.childNodes.length&&y.firstChild&&s?(u=document.createElement("div"),o=y.firstChild.textContent||"",u.innerHTML=y.firstChild.innerHTML||"",(I=w=u.firstChild)&&(s.replaceChild(I,a),s.parentNode)&&I.nodeType===Node.TEXT_NODE&&(I.previousSibling&&I.previousSibling.nodeType===Node.TEXT_NODE||I.nextSibling&&I.nextSibling.nodeType===Node.TEXT_NODE)&&(s.parentNode.normalize(),e=i.startOffset+o.length,n.setCursorPoint(r,s.firstChild,e),w=null),u.remove()):a.parentNode.replaceChild(y,a)}else{for(;t.firstChild;)w=t.firstChild,y.appendChild(t.firstChild);c?(i.deleteContents(),this.removeEmptyElements(l,!0),i.insertNode(y)):(I=l===i.startContainer?i.startContainer:i.startContainer.parentNode,o=Array.prototype.indexOf.call(I.childNodes,-1!==F.userAgent.indexOf("Firefox")&&l===i.startContainer?i.startContainer.firstChild:i.startContainer),i.deleteContents(),-1!==o&&(i.setStart(I,o),i.setEnd(I,o)),je(d)||d===l||(G(d),this.removeEmptyElements(l,!0)),je(p)?i.insertNode(y):(p.parentNode===l?p:p.parentNode).appendChild(y))}if(w instanceof Element&&"GOOGLE-SHEETS-HTML-ORIGIN"===w.nodeName){var T=w.querySelector("table"),E=T.querySelector("colgroup");if(E)for(f=0;f<T.rows.length;f++)for(var D,M=0;M<T.rows[f].cells.length;M++)E.querySelectorAll("col")[M].hasAttribute("width")&&(D=E.querySelectorAll("col")[M].getAttribute("width"),T.rows[f].cells[M].style.width=D+"px")}w&&"TABLE"===w.nodeName&&((s=Q("p")).appendChild(Q("br")),w.parentElement.insertBefore(s,w.nextSibling),w=s),w&&"#text"===w.nodeName?this.placeCursorEnd(w,t,n,r,l):w&&"HR"===w.nodeName?(e=w.nextSibling||null,(u=Q("DIV"===h?"div":"p")).appendChild(Q("br")),w=je(e)||"HR"!==e.nodeName?je(e)?(w.parentNode.appendChild(u),w.parentNode.insertBefore(w,u),u):e:(w.parentNode.insertBefore(u,e),u),n.setSelectionText(r,w,w,0,0)):w&&this.cursorPos(w,t,n,r,l),this.alignCheck(l),this.listCleanUp(n,r)},x7e.compareParentElements=function(e,t){return!(!e||!t)&&e.tagName===t.tagName&&this.getFilteredAttributes(e)===this.getFilteredAttributes(t)},x7e.getFilteredAttributes=function(e){return Array.from(e.attributes).map(function(e){var t;return"class"===e.name?(t=e.value.split(" ").filter(function(e){return"pasteContent_RTE"!==e}).join(" "))?"class='"+t+"'":"":e.name+"='"+e.value+"'"}).filter(function(e){return 0<e.length}).sort().join(" ")},x7e.getClosestMatchingElement=function(e,t){for(var i=e;i;){if(this.findMatchingChild(t,i))return i;i=i.parentElement}return null},x7e.findMatchingChild=function(e,t){for(var i=0,n=Array.from(e.children);i<n.length;i++){var o=n[i];if(this.compareParentElements(o,t))return o;o=this.findMatchingChild(o,t);if(o)return o}return null},x7e.listCleanUp=function(e,t){var e=e.getRange(t),t=e.startContainer,i=e.startOffset,n=e.startContainer.parentElement,o=e.endContainer.parentElement;je(n)||je(o)||(n=n.closest("ol, ul"),o=o.closest("ol, ul"),!je(n)&&!je(o)&&(o=this.cleanUpListItems(n),n=this.cleanUpListContainer(n),o||n)&&(e.setStart(t,i),e.setEnd(t,i)))},x7e.cleanUpListItems=function(e){var a,t,l=this,h=!1;return je(e.closest("ol, ul"))||(t=e.closest("ol, ul").querySelectorAll("li")),!je(t)&&0!==t.length&&(a=null,t.forEach(function(e){var t=e.parentElement;if(!je(t)&&"OL"!==t.nodeName&&"UL"!==t.nodeName&&(je(a)&&(a=t.closest("li")),!je(a))){var i=e.nextSibling;if(!je(i)&&"LI"!==i.nodeName){for(var n=Array.prototype.indexOf.call(t.childNodes,i),o=t.cloneNode(!1),r=t.childNodes.length,s=n;s<r;s++)o.appendChild(t.childNodes[n]);0<o.childNodes.length?((i=document.createElement("li")).appendChild(o),a.insertAdjacentElement("afterend",i)):o.remove()}i=t.closest("ol, ul");a.insertAdjacentElement("afterend",e),a=a.nextSibling,je(i)||l.removeEmptyElements(i),h=!0}}),t=this.cleanUpFlattenListContainer(e),h=t||h)},x7e.cleanUpFlattenListContainer=function(e){var t,i=!1;return je(e.closest("ol, ul"))||(t=e.closest("ol, ul").querySelectorAll("li")),!je(t)&&0!==t.length&&(t.forEach(function(e){je(e.firstChild)||"OL"!==e.firstChild.nodeName&&"UL"!==e.firstChild.nodeName||(e.style.listStyleType="none");var t=Array.from(e.children).find(function(e){return"LI"===e.tagName&&e.parentElement&&"OL"!==e.parentElement.tagName&&"UL"!==e.parentElement.tagName});je(t)||je(e.parentNode)||(e.parentNode.replaceChild(t,e),!je(t.textContent)&&""!==t.textContent.trim()||t.remove(),i=!0)}),i)},x7e.cleanUpListContainer=function(i){var n=!1,t=[],o=[];return je(i)||(i.childNodes.forEach(function(e){"LI"!==e.nodeName.toLocaleUpperCase()&&t.push(e),("LI"===e.nodeName.toLocaleUpperCase()||i.lastChild===e)&&0<t.length&&(o.push({elements:t.slice()}),t=[])}),o.forEach(function(e){var e=e.elements,t=document.createElement("li");e[0].parentNode.replaceChild(t,e[0]),e.forEach(function(e){return t.appendChild(e)}),t.textContent&&""===t.textContent.trim()&&!t.querySelector("img")&&i.removeChild(t),n=!0})),n},x7e.placeCursorEnd=function(e,t,i,n,o){for(e="BR"===e.nodeName?je(e.previousSibling)?e.parentNode:e.previousSibling:e;!je(e)&&"#text"!==e.nodeName&&"IMG"!==e.nodeName&&"BR"!==e.nodeName&&"HR"!==e.nodeName;){var r;je(e.lastChild)||"P"!==e.lastChild.nodeName||""!==e.lastChild.innerHTML||(r=Q("br"),e.lastChild.appendChild(r)),e=e.lastChild}"IMG"===(e=je(e)?t:e).nodeName?this.imageFocus(e,i,n):i.setSelectionText(n,e,e,e.textContent.length,e.textContent.length),this.removeEmptyElements(o)},x7e.getNodeCollection=function(e,t,i){var n=[];return e.startOffset===e.endOffset&&e.startContainer===e.endContainer&&"BR"!==e.startContainer.nodeName&&0<e.startContainer.childNodes.length&&("TD"===e.startContainer.nodeName||3!==e.startContainer.nodeType&&i.classList&&i.classList.contains("pasteContent"))?n.push(e.startContainer.childNodes[e.endOffset]):n=t.getInsertNodeCollection(e),n},x7e.insertTempNode=function(e,t,i,n,o){if(e.startContainer!==o||je(e.startContainer.childNodes[e.endOffset-1])||"TABLE"!==e.startContainer.childNodes[e.endOffset-1].nodeName)if(e.startContainer!==o||je(e.startContainer.childNodes[e.endOffset])||"TABLE"!==e.startContainer.childNodes[e.endOffset].nodeName)if(e.startContainer===e.endContainer&&3!==e.startContainer.nodeType&&"HR"===t.firstChild.nodeName)e.startContainer.classList.contains("e-content")||"BODY"===e.startContainer.nodeName?e.startContainer.appendChild(t):e.startContainer.parentNode.insertBefore(t,e.startContainer);else{var r=this.getImmediateBlockNode(i[i.length-1],o);if((je(r)||je(r.parentElement))&&3!==e.endContainer.nodeType&&(r=e.endContainer,e.setEnd(r,e.endContainer.textContent.length)),(r=r&&"BODY"===r.nodeName||"DIV"===r.nodeName&&e.startContainer===e.endContainer&&1===e.startContainer.nodeType?e.startContainer:r)&&"#text"!==r.nodeName&&r.closest("LI")&&o.contains(r.closest("LI"))&&"TD"!==r.nodeName&&"TH"!==r.nodeName&&"TR"!==r.nodeName&&t&&t.firstElementChild&&("OL"===t.firstElementChild.tagName||"UL"===t.firstElementChild.tagName))for(var s=void 0;t.firstElementChild.lastElementChild&&"LI"===t.firstElementChild.lastElementChild.tagName;)(s=t.firstElementChild.lastElementChild).style.removeProperty("margin-left"),s.style.removeProperty("margin-top"),s.style.removeProperty("margin-bottom"),t.firstElementChild.insertAdjacentElement("afterend",s);if(r&&"TD"===r.nodeName||"TH"===r.nodeName||"TR"===r.nodeName){for(var a=e.startContainer;!je(a)&&a.parentElement!==r;)a=a.parentElement;e.deleteContents(),(h=n.GetSpliceNode(e,a))?h.parentNode.replaceChild(t,h):e.insertNode(t),this.contentsDeleted=!0}else{var l,i=new _9e(o),i=this.getNodeCollection(e,i,t)[this.getNodeCollection(e,i,t).length-1],h=void 0;if(!i||"BR"!==i.nodeName&&"HR"!==i.nodeName&&("#text"!==i.nodeName||je(i.parentElement)||"LI"!==i.parentElement.nodeName)||je(i.parentElement)||0!==i.parentElement.textContent.trim().length){if(i&&("#text"===i.nodeName||"BR"===i.nodeName)&&!je(i.parentElement)&&("LI"===i.parentElement.nodeName||i.parentElement.closest("LI")||r===o&&i.parentElement===r)&&0<i.parentElement.textContent.trim().length)return"LI"!==(h=i).parentElement.nodeName||je(i.nextSibling)||"BR"!==i.nextSibling.nodeName||G(i.nextSibling),e.collapsed||(o=e.startContainer,l=e.startOffset,this.removeListfromPaste(e),e.setStart(o,l),e.setEnd(o,l)),e.insertNode(t),void(this.contentsDeleted=!0);h=n.GetSpliceNode(e,r)}else if("LI"!==(h=i).parentElement.nodeName||je(i.nextSibling)||"BR"!==i.nextSibling.nodeName||G(i.nextSibling),"LI"===i.parentElement.nodeName&&""===i.parentElement.textContent)return this.removeListfromPaste(e),1===i.parentElement.childNodes.length&&"BR"===i.nodeName&&G(i),e.insertNode(t),void(this.contentsDeleted=!0);h.parentNode.replaceChild(t,h)}}else e.startContainer.appendChild(t);else je(e.startContainer.childNodes[e.endOffset-1].nextSibling)?e.startContainer.appendChild(t):e.startContainer.insertBefore(t,e.startContainer.childNodes[e.endOffset-1].nextSibling)},x7e.cursorPos=function(e,t,i,n,o){e.classList.add("lastNode"),o.innerHTML=function(e){for(var t=document.createElement("div"),i=(t.innerHTML=e,t.querySelectorAll("table")),n=0;n<i.length;n++)if(0<i[n].classList.length&&!i[n].classList.contains("e-rte-table")&&!i[n].classList.contains("e-rte-custom-table"))if(i[n].classList.add("e-rte-paste-table"),i[n].classList.contains("e-rte-paste-word-table"))i[n].classList.remove("e-rte-paste-word-table");else if(i[n].classList.contains("e-rte-paste-excel-table")){i[n].classList.remove("e-rte-paste-excel-table"),"0"===i[n].getAttribute("border")&&i[n].removeAttribute("border");for(var o=i[n].querySelectorAll("td"),r=0;r<o.length;r++)"none"===o[r].style.borderLeft&&o[r].style.removeProperty("border-left"),"none"===o[r].style.borderRight&&o[r].style.removeProperty("border-right"),"none"===o[r].style.borderBottom&&o[r].style.removeProperty("border-bottom"),"none"===o[r].style.borderTop&&o[r].style.removeProperty("border-top"),"none"===o[r].style.border&&o[r].style.removeProperty("border")}else i[n].classList.contains("e-rte-paste-onenote-table")?i[n].classList.remove("e-rte-paste-onenote-table"):i[n].classList.contains("e-rte-paste-html-table")&&i[n].classList.remove("e-rte-paste-html-table");for(var s=t.querySelectorAll("img"),n=0;n<s.length;n++)s[n].classList.contains("e-rte-image-unsupported")||(s[n].classList.contains("e-rte-image")||s[n].classList.add("e-rte-image"),s[n].classList.contains("e-imginline"))||s[n].classList.contains("e-imgbreak")||s[n].classList.add("e-imginline");return t.innerHTML}(o.innerHTML),je(e=o.querySelector(".lastNode"))||(this.placeCursorEnd(e,t,i,n,o),e.classList.remove("lastNode"),0===e.classList.length&&e.removeAttribute("class"))},x7e.imageFocus=function(e,t,i){var n,o,r=document.createTextNode(" ");e.parentNode&&"A"===e.parentNode.nodeName?((o=(n=e.parentNode).parentNode).insertBefore(r,n.nextSibling),o.insertBefore(e,r)):e.parentNode.insertBefore(r,e.nextSibling),t.setSelectionText(i,e.nextSibling,e.nextSibling,0,0)},x7e.getImmediateBlockNode=function(e,t){for(;e&&xUe.indexOf(e.nodeName.toLocaleLowerCase())<0;)e=e.parentNode;return e},x7e.removingComments=function(e){var t=(t=e.innerHTML).replace(/<!--[\s\S]*?-->/g,"");e.innerHTML=t},x7e.findDetachEmptyElem=function(e,t){return void 0===t&&(t=!1),je(e.parentElement)?null:!(0<e.parentElement.textContent.length&&e.parentElement.textContent.match(/\u00a0/g)&&0<e.parentElement.textContent.match(/\u00a0/g).length)&&""===e.parentElement.textContent.trim()&&"true"!==e.parentElement.contentEditable&&je(e.parentElement.querySelector("img"))&&"TD"!==e.parentElement.nodeName&&"TH"!==e.parentElement.nodeName?t&&-1!==xUe.indexOf(e.parentElement.tagName.toLowerCase())?e:this.findDetachEmptyElem(e.parentElement,t):t&&-1!==xUe.indexOf(e.tagName.toLowerCase())?null:e},x7e.removeEmptyElements=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=null);for(var e=e.querySelectorAll(":empty"),n=Array.from(e).filter(function(e){var t=e.tagName.toLowerCase();return!(e.closest("svg")||e.closest("canvas")||-1<["td","th","textarea","input","img","video","audio","br","hr","iframe"].indexOf(t))}),o=0;o<n.length;o++){var r,s=!0,a=n[o];"DIV"===a.tagName&&(s="none"===a.style.borderBottom||""===a.style.borderBottom),"COL"===a.nodeName?G(a.parentElement):(r=!je(i)&&a===i,PUe.indexOf(a.tagName.toLowerCase())<0&&s&&!r&&(je(s=this.findDetachEmptyElem(a,t))||s.nodeType===Node.ELEMENT_NODE&&"TEXTAREA"===s.nodeName.toUpperCase()||G(s)))}},x7e.closestEle=function(e,t){var i=e;if(z(i,"li"))return z(i,"li");for(;i&&1===i.nodeType;){if(i.parentNode===t||!je(i.parentNode.tagName)&&(-1!==IUe.indexOf(i.parentNode.tagName.toLocaleLowerCase())||-1!==FUe.indexOf(i.parentNode.tagName.toLocaleLowerCase())))return i;i=i.parentNode}return null},x7e.insertTableInList=function(e,t,i,n,o,r,s){var a=je(z(i,"ul,ol"))?0:z(i,"ul,ol").querySelectorAll("li").length,o=o.SplitNode(e,i,!0),l=o.previousElementSibling,h=je(r)?null:z(r,"li"),d=je(h)?null:h.innerHTML;!je(l)&&!je(z(l,"ol,ul"))&&z(l,"ol,ul").querySelectorAll("li").length>a?(l.appendChild(t),e.deleteContents(),0<o.childNodes.length&&this.moveChildNodes(o,l),i===r||je(d)||d===h.innerHTML||this.moveChildNodes(h,l)):(e.deleteContents(),o.insertBefore(t,o.firstChild),i!==r&&this.moveChildNodes(r,i)),this.removeEmptyNextLI(z(t,"li")),t.classList.add("ignore-table")},x7e.moveChildNodes=function(e,t){for(;!je(e)&&!je(e.firstChild);)t.appendChild(e.firstChild)},x7e.alignCheck=function(e){for(var t=e.querySelectorAll('span[style*="text-align"]'),i=0;i<t.length;i++){var n=t[i];if(n){var o=this.getImmediateBlockNode(n,null);if(o){for(var r="",s=0;s<t.length;s++){var a=t[s];o.contains(a)&&(r+=a.textContent)}o.textContent.trim()===r.trim()&&(o.style.textAlign=n.style.textAlign)}}}},x7e.removeListfromPaste=function(e){e.deleteContents();var t=e.startContainer;je(t)||"LI"!==t.nodeName||je(t.parentElement)||"OL"!==t.parentElement.nodeName&&"UL"!==t.parentElement.nodeName||""!==t.textContent.trim()||t.parentElement.querySelectorAll("li").forEach(function(e){""===e.textContent.trim()&&e!==t&&e.remove()})},x7e.inlineNode=["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","font","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"],x7e.contentsDeleted=!1;var A7e=x7e;function x7e(){}T7e.prototype.getBlockNode=function(){var t=this,e=[],i=this.currentDocument.getSelection().getRangeAt(0);if(i.startContainer===this.editableElement&&i.startContainer===i.endContainer&&"#text"!==i.startContainer.nodeName){if(i.startOffset===i.endOffset?this.editableElement.childNodes[i.startOffset]&&-1<this.directRangeElems.indexOf(this.editableElement.childNodes[i.startOffset].nodeName)&&e.push(this.editableElement.childNodes[i.startOffset]):i.endOffset===i.startOffset+1&&e.push(this.editableElement.childNodes[i.startOffset]),0<e.length);}else{var n=i.startContainer.nodeType===Node.TEXT_NODE?i.startContainer.parentElement:i.startContainer,o=i.endContainer.nodeType===Node.TEXT_NODE?i.endContainer.parentElement:i.endContainer,r=this.isBlockNode(o)?o:this.getParentBlockNode(o),s=this.currentDocument.createTreeWalker(this.editableElement,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return i.intersectsNode(e)?t.isBlockNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP:NodeFilter.FILTER_REJECT}});for(s.currentNode=n;s.currentNode;)if(this.isBlockNode(s.currentNode)?(this.addToBlockCollection(e,s,i),s.nextNode()):s.previousNode(),s.currentNode===o||s.currentNode===r){this.addToBlockCollection(e,s,i);break}}return e},T7e.prototype.addToBlockCollection=function(e,t,i){var n=t.currentNode;!t.currentNode||-1!==e.indexOf(t.currentNode)||"LI"===n.nodeName&&n.parentNode.closest("li")&&("OL"!==(n=i.commonAncestorContainer).nodeName&&"UL"!==n.nodeName||!n.closest("li"))||e.push(t.currentNode)},T7e.prototype.getTextNodes=function(e){for(var t=[],i=this.currentDocument.getSelection().getRangeAt(0),n=this.currentDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:function(e){return i.intersectsNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),o=n.nextNode();o;)t.push(o),o=n.nextNode();return t},T7e.prototype.isBlockNode=function(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&0<=this.BLOCK_TAGS.indexOf(e.tagName.toLowerCase())},T7e.prototype.getLastTextNode=function(e){for(var t=this.currentDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),i=null,n=t.nextNode();n;)i=n,n=t.nextNode();return i},T7e.prototype.getFirstTextNode=function(e){return this.currentDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT,null).nextNode()},T7e.prototype.getParentBlockNode=function(e){var t=this,i=this.currentDocument.createTreeWalker(this.editableElement,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return t.isBlockNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return i.currentNode=e,i.parentNode()},T7e.prototype.getTopMostNode=function(e){if(this.isBlockNode(e.parentNode))return e;for(var t=e.parentNode;t;){if(this.isBlockNode(t.parentNode)||e.textContent!==t.textContent)return t;t=t.parentNode}return t};var I7e=T7e;function T7e(e){this.directRangeElems=["IMG","TABLE","AUDIO","VIDEO","HR"],this.BLOCK_TAGS=["address","article","aside","audio","blockquote","canvas","details","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","noscript","output","p","pre","section","td","tfoot","th","video","body"],this.editableElement=e,this.currentDocument=e.ownerDocument}D7e.prototype.addEventListener=function(){this.parent.observer.on(o7e,this.applyListsHandler,this),this.parent.observer.on(r7e,this.onKeyUp,this),this.parent.observer.on(n7e,this.keyDownHandler,this),this.parent.observer.on(c7e,this.spaceKeyAction,this),this.parent.observer.on(v7e,this.destroy,this)},D7e.prototype.removeEventListener=function(){this.parent.observer.off(o7e,this.applyListsHandler),this.parent.observer.off(r7e,this.onKeyUp),this.parent.observer.off(n7e,this.keyDownHandler),this.parent.observer.off(c7e,this.spaceKeyAction),this.parent.observer.off(v7e,this.destroy)},D7e.prototype.testList=function(e){var t=[/^[\d]+[.]+$/,/^(?=[MDCLXVI])M*(C[MD]|D?C{0,3})(X[CL]|L?X{0,3})(I[XV]|V?I{0,3})[.]$/gi,/^[a-zA-Z][.]+$/],i=je(e)?null:e.innerText.trim().split(".")[0]+".";if(!je(i))for(var n=0;n<t.length;n++)if(t[n].test(i))return!0;return!1},D7e.prototype.testCurrentList=function(e){var t=[/^[1]+[.]+$/,/^[i]+[.]+$/,/^[a]+[.]+$/];if(!je(e.startContainer.textContent.slice(0,e.startOffset)))for(var i=e.startContainer.textContent.replace(/\u200B/g,"").slice(0,e.startOffset).trim(),n=0;n<t.length;n++)if(t[n].test(i)&&2===i.length)return!0;return!1},D7e.prototype.createAutoList=function(e,t){var i={BR:{BR:!0,P:!0,DIV:!0},P:{BR:!1,P:!0,DIV:!0},DIV:{BR:!1,P:!0,DIV:!0}};return!(!i[e]||void 0===i[e][t])&&i[e][t]},D7e.prototype.isInsideSameListType=function(e,t){return!!e&&!!(e=e.closest("li"))&&!!(e=e.closest("ul, ol"))&&("OL"===e.tagName&&t||"UL"===e.tagName&&!t)},D7e.prototype.spaceList=function(e){var t=this.parent.nodeSelection.getRange(this.parent.currentDocument),i=(this.saveSelection=this.parent.nodeSelection.save(t,this.parent.currentDocument),this.parent.domNode.getSelectedNode(t.startContainer,t.startOffset)),n=(this.parent.domNode.getSelectedNode(t.endContainer,t.endOffset),i.previousElementSibling),o=i.nextElementSibling,r=je(n)?null:n.innerText.trim().substring(0,1),s=je(o)?null:o.innerText.trim().substring(0,1),a=this.testCurrentList(t),n=this.testList(n),o=this.testList(o),i=this.isInsideSameListType(i,a),l=t.startContainer.previousElementSibling&&"BR"===t.startContainer.previousElementSibling.tagName;i||n||o||"*"===r||"*"===s||!this.createAutoList(e.enterKey,e.shiftEnterKey)&&l||(i=Q("br"),a?(t.startContainer.textContent=t.startContainer.textContent.slice(t.startOffset,t.startContainer.textContent.length),"#text"===t.startContainer.nodeName&&0===t.startContainer.textContent.length&&this.parent.domNode.insertAfter(i,t.startContainer),this.applyListsHandler({subCommand:"OL",callBack:e.callBack}),e.event.preventDefault()):"*"!==t.startContainer.textContent.replace(/\u200B/g,"").slice(0,t.startOffset).trim()&&"-"!==t.startContainer.textContent.replace(/\u200B/g,"").slice(0,t.startOffset).trim()||(t.startContainer.textContent=t.startContainer.textContent.slice(t.startOffset,t.startContainer.textContent.length),"#text"===t.startContainer.nodeName&&0===t.startContainer.textContent.length&&this.parent.domNode.insertAfter(i,t.startContainer),this.applyListsHandler({subCommand:"UL",callBack:e.callBack}),e.event.preventDefault()))},D7e.prototype.enterList=function(e){var t,i,n=this.parent.nodeSelection.getRange(this.parent.currentDocument),o="LI"===n.startContainer.nodeName?n.startContainer:n.startContainer.parentElement.closest("LI"),r="LI"===n.endContainer.nodeName?n.endContainer:n.endContainer.parentElement.closest("LI"),s=!1,a=(je(o)||(a=0<(a=o.querySelectorAll(".e-video-clickelem")).length&&"IFRAME"===a[0].childNodes[0].nodeName,s=0<o.querySelectorAll("IMG").length||0<o.querySelectorAll("AUDIO").length||0<o.querySelectorAll("VIDEO").length||a),o&&(t=o.parentElement)&&(i=t.parentElement),je(o)?null:o.querySelector("TABLE"));if(!je(o)&&!je(r)&&o===r&&"LI"===o.tagName&&""===o.textContent.trim()&&!s&&je(a)){if(0<=o.innerHTML.indexOf("&nbsp;"))return;65279===o.textContent.charCodeAt(0)&&(o.textContent=""),je(i.closest("UL"))&&je(i.closest("OL"))&&(s=void(je(o.nextElementSibling)||(r=this.parent.domNode.blockParentNode(o),this.parent.nodeCutter.GetSpliceNode(n,r))),"DIV"===e.enterAction?(s=Q("div")).innerHTML="<br>":"P"===e.enterAction?(s=Q("p")).innerHTML="<br>":s=Q("br"),a=this.domNode.getImmediateBlockNode(n.startContainer),n=(r=this.applyFormattingFromRange(s,n,a,e.enterAction)).formattedElement,a=r.cursorTarget,s=n,je(i)||"BLOCKQUOTE"!==i.nodeName||this.parent.observer.notify("blockquote_list_handled",{}),this.parent.domNode.insertAfter(s,t),e.event.preventDefault(),this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,a,0),""===t.textContent&&0===t.querySelectorAll("audio,video,table").length?G(t):G(o)),je(i)||je(i.closest("UL"))&&je(i.closest("OL"))||"LI"!==i.nodeName||"none"!==i.style.listStyleType||""!==i.textContent||""!==o.textContent||o!==t.firstElementChild||!je(o.nextSibling)||(G(t),i.style.removeProperty("list-style-type"),e.event.preventDefault())}this.handleNestedEnterKeyForLists(e,i,o,t)},D7e.prototype.applyFormattingFromRange=function(e,t,i,n){var o=e,r=[];if(i){for(var s,a=t.startContainer,l=["div","p","h1","h2","h3","h4","h5","h6","li","ul","ol","table","tr","td","th"];a&&a!==i;){var h=a.nodeName.toLowerCase();-1===l.indexOf(h)&&a.nodeType===Node.ELEMENT_NODE&&r.push({tag:h,element:a}),a=a.parentNode}0<r.length&&((e="BR"===n?Q("DIV"):e).innerHTML="",s=e,r.reverse().forEach(function(e){var t=Q(e.tag);Array.from(e.element.attributes).forEach(function(e){t.setAttribute(e.name,e.value)}),s.appendChild(t),s=t}),t=Q("br"),s.appendChild(t),o=s)}return{formattedElement:"BR"===n&&0<r.length?e.firstChild:e,cursorTarget:o}},D7e.prototype.handleNestedEnterKeyForLists=function(e,t,i,n){var o=!1;!je(i)&&0<i.querySelectorAll("audio,video,table,img").length&&(o=!0),je(t)||je(t.closest("UL"))&&je(t.closest("OL"))&&"UL"!==n.nodeName&&"OL"!==n.nodeName||"LI"!==t.nodeName&&"LI"!==i.nodeName||"none"!==t.style.listStyleType&&""!==t.style.listStyleType||""===t.textContent||je(i.lastElementChild)||""===i.lastElementChild.textContent||!i.firstElementChild||""!==i.firstElementChild.textContent||o||i!==n.firstElementChild&&"LI"!==i.nodeName||(t=this.parent.nodeSelection.getRange(this.parent.currentDocument),this.saveSelection=this.parent.nodeSelection.save(t,this.parent.currentDocument),this.domNode.setMarker(this.saveSelection),e.event.preventDefault(),o=[],i===n.firstElementChild?o.push(n.firstElementChild):"LI"===i.nodeName&&o.push(i),this.revertList(o,e),this.revertClean(),this.saveSelection=this.domNode.saveMarker(this.saveSelection),this.saveSelection.restore())},D7e.prototype.backspaceList=function(e){var t,i=this.parent.nodeSelection.getRange(this.parent.currentDocument),n=this.parent.domNode.getSelectedNode(i.startContainer,i.startOffset),o=this.parent.domNode.getSelectedNode(i.endContainer,i.endOffset),n="BR"===n.nodeName?n.parentElement:n,o="BR"===o.nodeName?o.parentElement:o;if(!je(n)&&n.closest("li")){var r=this.getListCursorInfo(i),s=null===n.previousElementSibling,a=this.parent.domNode.blockNodes(),l=this.isAllListNodesSelected(n.closest("li").parentElement),h="StartNested"===r.position&&n&&n.parentElement&&n.parentElement.closest("li")&&n.parentElement.closest("li").getAttribute("style")&&-1!==n.parentElement.closest("li").getAttribute("style").indexOf("list-style-type: none;");if(s&&(-1<["StartParent"].indexOf(r.position)||h))return e.event.preventDefault(),s=this.parent.nodeSelection.save(i,this.parent.currentDocument),this.domNode.setMarker(s),this.revertList([a[0]],e),this.revertClean(),void(s=this.domNode.saveMarker(s)).restore();if(-1<["SingleFull","MultipleFull"].indexOf(r.selectionState)&&l){if(e.event.preventDefault(),a[0].innerHTML="",i.deleteContents(),1<a.length)for(var d=0;d<a.length;d++)0!==d&&G(a[d]);return void this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,a[0],0)}}if(n===o&&!je(z(n,"li"))&&(""===n.textContent.trim()&&65279===n.textContent.charCodeAt(0)||1===n.textContent.length&&8203===n.textContent.charCodeAt(0))&&(n.textContent=""),n===o&&"LI"===n.tagName&&0===n.textContent.length&&je(n.previousElementSibling)&&n.removeAttribute("style"),n===o&&""===n.textContent){if("LI"===n.parentElement.tagName&&"LI"===o.parentElement.tagName)G(n);else if(n.closest("ul")||n.closest("ol"))if((t=je(n.closest("ul"))?n.closest("ol"):n.closest("ul")).firstElementChild===n&&!je(t.children[1])&&("OL"===t.children[1].tagName||"UL"===t.children[1].tagName))if(t.tagName===t.children[1].tagName){for(;t.children[1].lastChild;)this.parent.domNode.insertAfter(t.children[1].lastChild,t.children[1]);G(t.children[1])}else t.parentElement.insertBefore(t.children[1],t)}else if(!(je(n.firstChild)||"BR"!==n.firstChild.nodeName||je(n.childNodes[1])||"UL"!==n.childNodes[1].nodeName&&"OL"!==n.childNodes[1].nodeName))if((t=je(n.closest("ul"))?n.closest("ol"):n.closest("ul")).tagName===n.childNodes[1].nodeName){for(;n.childNodes[1].lastChild;)this.parent.domNode.insertAfter(n.children[1].lastChild,n);G(n.childNodes[1])}else t.parentElement.insertBefore(n.children[1],t);n===o&&"LI"===n.tagName&&this.isAtListStart(n,i)&&!je(n.closest("ul, ol"))&&(s=(h=n.closest("ul, ol")).parentElement,r=n.previousElementSibling,l=n.querySelector("ol, ul"),(je(s)||"LI"!==s.tagName||je(h.previousSibling))&&(je(r)||"LI"!==r.nodeName)||je(l)||!je(r)&&je(r)||(e.event.preventDefault(),this.handleNestedListRearrangement(n,h,s,r,l))),this.removeList(i,e),this.firstListBackSpace(i,e)},D7e.prototype.handleNestedListRearrangement=function(e,t,i,n,o){for(var r=this.parent.nodeSelection.findLastTextPosition(je(n)?t.previousSibling:n),s=Array.from(e.childNodes),a=0;a<s.length;a++){var l=s[a];if(l===o&&o)for(;o.firstChild;)t.insertBefore(o.firstChild,e),e.querySelector("OL:empty,UL:empty")&&e.remove();else je(n)?i.insertBefore(l,t):r.node.parentElement.closest("li").appendChild(l)}this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,r.node,r.offset)},D7e.prototype.findPreviousElementForCursor=function(e){var t=null;return e.previousElementSibling?t=e.previousElementSibling:e.parentElement&&e.parentElement!==this.parent.editableElement&&(t=e.parentElement),t},D7e.prototype.handleCursorPositioningAfterListRemoval=function(e){var t;e&&this.parent.userAgentData.isSafari()&&((t=this.parent.nodeSelection.findLastTextPosition(e))?this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,t.node,t.offset):this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,e,e.childNodes.length))},D7e.prototype.removeList=function(e,t){var i,n,o=this,r=this.parent.domNode.getSelectedNode(e.startContainer,e.startOffset),s=!je(e.endContainer.parentElement.closest("li"))&&1<e.endContainer.parentElement.closest("li").childElementCount&&"#text"===e.endContainer.nodeName?e.endContainer:this.parent.domNode.getSelectedNode(e.endContainer,e.endOffset),a=("#text"===e.startContainer.nodeName?e.startContainer.parentElement:e.startContainer).closest("li"),l=("#text"===e.endContainer.nodeName?e.endContainer.parentElement:e.endContainer).closest("li"),h="";if(je(a)||je(a.firstChild)||a.childNodes.forEach(function(e){h+=e.textContent}),r="BR"===r.nodeName?r.parentElement:r,s="BR"===s.nodeName?s.parentElement:s,r="LI"===r.nodeName||je(r.closest("LI"))?r:r.closest("LI"),s="LI"===s.nodeName||"#text"===s.nodeName||je(s.closest("LI"))?s:s.closest("LI"),(("OL"===e.commonAncestorContainer.nodeName||"UL"===e.commonAncestorContainer.nodeName||"LI"===e.commonAncestorContainer.nodeName)&&je(s.nextElementSibling)&&s.textContent.length===e.endOffset&&je(r.previousElementSibling)&&0===e.startOffset||-1!==F.userAgent.indexOf("Firefox")&&e.startContainer===e.endContainer&&e.startContainer===this.parent.editableElement&&0===e.startOffset&&1===e.endOffset)&&(-1!==F.userAgent.indexOf("Firefox")?(i=this.findPreviousElementForCursor(e.commonAncestorContainer.childNodes[0]),G(e.commonAncestorContainer.childNodes[0])):"LI"===e.commonAncestorContainer.nodeName?(i=this.findPreviousElementForCursor(e.commonAncestorContainer.parentElement),G(e.commonAncestorContainer.parentElement)):(i=this.findPreviousElementForCursor(e.commonAncestorContainer),G(e.commonAncestorContainer)),t.event.preventDefault(),this.handleCursorPositioningAfterListRemoval(i),a=("#text"===e.startContainer.nodeName?e.startContainer.parentElement:e.startContainer).closest("li")),!je(l)&&e.commonAncestorContainer===this.parent.editableElement||!je(a)&&(!e.collapsed||""===a.textContent.trim()&&je(a.previousElementSibling)&&je(a.nextElementSibling))&&a.textContent===h){e.deleteContents();for(var d=this.parent.editableElement.querySelectorAll("li"),p=this,c=0;c<d.length;c++)!function(t){je(d[t].childNodes)||d[t].childNodes.forEach(function(e){"A"===e.nodeName&&""===e.textContent&&d[t].removeChild(e)}),d[t].firstChild&&""!==d[t].textContent.trim()||d[t]!==r&&d[t]!==s||(n=p.findPreviousElementForCursor(d[t]),d[t].parentNode.removeChild(d[t]))}(c);this.parent.editableElement.querySelectorAll("ol").forEach(function(e){e.firstChild&&""!==e.textContent.trim()||(n=o.findPreviousElementForCursor(e),e.parentNode.removeChild(e))}),this.parent.editableElement.querySelectorAll("ul").forEach(function(e){e.firstChild&&""!==e.textContent.trim()||(n=o.findPreviousElementForCursor(e),e.parentNode.removeChild(e))}),t.event.preventDefault(),this.handleCursorPositioningAfterListRemoval(n)}},D7e.prototype.onKeyUp=function(e){if(!je(this.commonLIParent)&&!je(this.commonLIParent.querySelector(".removeList"))){for(var t=this.commonLIParent.querySelector(".removeList");!je(t.firstChild);)this.parent.domNode.insertAfter(t.firstChild,t);G(t)}if(13===e.event.keyCode)for(var i=this.parent.editableElement.querySelectorAll("UL, OL"),n=0;n<i.length;n++)je(i[n])||je(i[n].parentElement)||je(i[n].previousElementSibling)||"UL"!==i[n].parentElement.nodeName&&"OL"!==i[n].parentElement.nodeName||i[n].previousElementSibling.appendChild(i[n])},D7e.prototype.firstListBackSpace=function(e,t){var i=this.parent.domNode.getSelectedNode(e.startContainer,e.startOffset),n=i.closest("LI");(je(n)||this.isAtListStart(n,e))&&(je(i.closest("OL"))?je(i.closest("UL"))||(this.commonLIParent=i.closest("UL")):this.commonLIParent=i.closest("OL"),!je(n))&&0===e.startOffset&&0===e.endOffset&&je(i.previousSibling)&&!je(this.commonLIParent)&&je(this.commonLIParent.previousSibling)&&je(this.commonLIParent.parentElement.closest("OL"))&&je(this.commonLIParent.parentElement.closest("UL"))&&je(this.commonLIParent.parentElement.closest("LI"))&&((n=Q("P")).innerHTML="&#8203;",i.classList.add("removeList"),this.commonLIParent.parentElement.insertBefore(n,this.commonLIParent))},D7e.prototype.isAtListStart=function(e,t){return"LI"===e.nodeName&&this.getFirstTextNode(e)===t.startContainer&&0===t.startOffset},D7e.prototype.getFirstTextNode=function(e){if(e.nodeType===Node.TEXT_NODE)return e;for(var t=0;t<e.childNodes.length;t++){var i=this.getFirstTextNode(e.childNodes[t]);if(i)return i}return null},D7e.prototype.keyDownHandler=function(e){if(13===e.event.which&&this.enterList(e),32===e.event.which&&this.spaceList(e),8===e.event.which&&this.backspaceList(e),46===e.event.which&&"delete"===e.event.action&&(s=(t=this.parent.nodeSelection.getRange(this.parent.currentDocument)).commonAncestorContainer,n=t.startContainer,o=t.endContainer,n=3===n.nodeType?this.domNode.blockParentNode(n):n,o=3===o.nodeType?this.domNode.blockParentNode(o):o,"UL"!==s.nodeName&&"OL"!==s.nodeName||n===o||je(z(n,"ul"))&&je(z(n,"ol"))||je(z(o,"ul"))&&je(z(o,"ol"))||s.lastElementChild!==z(o,"li")||s.lastChild===o||t.collapsed||this.areAllListItemsSelected(s,t)&&G(s),this.removeList(t,e)),9===e.event.which){var t=this.parent.nodeSelection.getRange(this.parent.currentDocument),i=(e.event.action&&"indent"===e.event.action||(this.saveSelection=this.parent.nodeSelection.save(t,this.parent.currentDocument)),e.enableTabKey&&this.handleListIndentation(),void 0),n=(t.startOffset,t.endOffset,this.parent.domNode.getSelectedNode(t.startContainer,t.startOffset)),o=this.parent.domNode.getSelectedNode(t.endContainer,t.endOffset);if(n!==o||"BR"!==n.nodeName&&"#text"!==n.nodeName||!(0<=IUe.indexOf(n.parentNode.tagName.toLocaleLowerCase()))){e.event.action&&"indent"===e.event.action||this.listTabIndentation||this.domNode.setMarker(this.saveSelection);for(var i=this.domNode.blockNodes(),r=[],s=!0,a=0;a<i.length;a++)"LI"===i[a].parentNode.tagName?r.push(i[a].parentNode):z(i[a],"OL")||z(i[a],"UL")||!z(i[a],"LI")?"LI"===i[a].tagName&&"P"!==i[a].childNodes[0].tagName&&"OL"!==i[a].childNodes[0].tagName&&"UL"!==i[a].childNodes[0].tagName&&r.push(i[a]):r.push(z(i[a],"LI"));1<r.length||1===r.length?(e.event.preventDefault(),e.event.stopPropagation(),this.currentAction=this.getAction(r[0]),e.event.shiftKey&&(!e.enableTabKey||e.enableTabKey&&!this.listTabIndentation)?(this.revertList(r,e),this.revertClean()):e.enableTabKey&&(!e.enableTabKey||this.listTabIndentation)||(s=this.nestedList(r)),s&&(this.cleanNode(),this.parent.editableElement.focus({preventScroll:!0})),e.event.action&&"indent"===e.event.action||this.listTabIndentation||(this.saveSelection=this.domNode.saveMarker(this.saveSelection),this.saveSelection.restore(),e.callBack&&e.callBack({requestType:this.currentAction,editorMode:"HTML",range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.domNode.blockNodes(),event:e.event}))):e.event.action&&"indent"===e.event.action||this.listTabIndentation||(e.event&&e.event.shiftKey&&"Tab"===e.event.key&&(e.event.action="tab"),this.saveSelection=this.domNode.saveMarker(this.saveSelection),this.saveSelection.restore()),this.listTabIndentation=!1}}else switch(e.event.action){case"ordered-list":this.applyListsHandler({subCommand:"OL",callBack:e.callBack}),e.event.preventDefault();break;case"unordered-list":this.applyListsHandler({subCommand:"UL",callBack:e.callBack}),e.event.preventDefault()}},D7e.prototype.handleListIndentation=function(){var e=this.parent.nodeSelection.getRange(this.parent.currentDocument),t=this.saveSelection.getParentNodeCollection(e);if(("LI"===t[0].nodeName||z(t[0],"li"))&&!this.isCursorAtStartOfLI(e)){var i=t[t.length-1],n=t[0],t=e.startContainer;if(i&&n){if(e.deleteContents(),i!==n){for(var o=t;o.parentElement;){if(this.parent.domNode.isBlockNode(o.parentElement)){o=o.parentElement;break}o=o.parentElement}var e=void 0,r=(this.parent.domNode.isBlockNode(i.lastChild)?(t.nodeValue+="    ",e=t.nodeValue.length):i.innerHTML+='&nbsp;&nbsp;&nbsp;&nbsp;<span class="rte-tab-space"></span>',n.firstChild);if(r&&this.parent.domNode.isBlockNode(r)){for(;r.firstChild;)o.appendChild(r.firstChild);r.remove()}for(;n.firstChild;)this.parent.domNode.isBlockNode(n.firstChild)?this.parent.domNode.insertAfter(n.firstChild,o):i.appendChild(n.firstChild);n.remove();var s=i.querySelector(".rte-tab-space");s&&s.previousSibling?(this.saveSelection.setCursorPoint(this.parent.currentDocument,s.previousSibling,s.previousSibling.textContent.length),s.parentNode.removeChild(s)):this.saveSelection.setCursorPoint(this.parent.currentDocument,t,e)}else A7e.Insert(this.parent.currentDocument,"&nbsp;&nbsp;&nbsp;&nbsp;");this.listTabIndentation=!0}}},D7e.prototype.isCursorAtStartOfLI=function(e){for(var t,i=e.startContainer;i&&"LI"!==i.nodeName;)i=i.parentNode;return!!i&&((t=e.cloneRange()).selectNodeContents(i),t.setEnd(e.startContainer,e.startOffset),""===t.toString().trim())},D7e.prototype.spaceKeyAction=function(e){32===e.event.which&&this.spaceList(e)},D7e.prototype.getAction=function(e){return"OL"===e.parentNode.nodeName?"OL":"UL"},D7e.prototype.revertClean=function(){for(var e=this.parent.editableElement.querySelectorAll("ul, ol"),t=0;t<e.length;t++){var i=e[t].querySelectorAll("ul, ol");if(0<i.length)for(var n=0;n<i.length;n++){var o=i[n].previousSibling;o&&"LI"===o.tagName&&o.appendChild(i[n])}}},D7e.prototype.noPreviousElement=function(e){var t,i,n=e.querySelectorAll("ol, ul"),o=e.querySelectorAll("li"),r=this.domNode.contents(o[0])[0];if(0<o.length&&(n.length<=1||1<n[0].childNodes.length)&&("OL"===r.nodeName||"UL"===r.nodeName)?t=o[0]:i=n[0],t)for(var s=this.domNode.contents(e)[0];s&&!this.domNode.isList(s);){var a=s.nextSibling;lt([s],t),gt(e,{"list-style-type":"none"}),gt(t,{"list-style-type":""}),s=a}else if(i){lt([h=Q("li")],i);for(s=this.domNode.contents(e)[0];s&&!this.domNode.isList(s);){a=s.nextSibling;h.appendChild(s),s=a}lt([i],e.parentNode),G(e),lt([l=Q("li",{styles:"list-style-type: none;"})],i.parentNode),ht([i],l)}else{lt([l=Q("li",{styles:"list-style-type: none;"})],e.parentNode);var l,h=Q(e.parentNode.tagName);lt([h],l),ht([e],h)}},D7e.prototype.nestedList=function(e){for(var t=!1,i=0;i<e.length;i++){var n=this.domNode.getPreviousNode(e[i]);if(n){var o,t=!0,r=void 0,s=void 0,a=e[i].querySelectorAll("ol, ul"),l=e[i].querySelectorAll("li"),h=this.domNode.contents(l[0])[0];if(0<l.length&&(a.length<=1||1<a[0].childNodes.length)&&("OL"===h.nodeName||"UL"===h.nodeName)?s=l[0]:r=a[0],r){lt([o=Q("li")],r);for(var d=this.domNode.contents(e[i])[0];d&&!this.domNode.isList(d);){var p=d.nextSibling;o.appendChild(d),d=p}ht([r],n),G(e[i])}else if(s){if("LI"===n.tagName){for(d=this.domNode.contents(e[i])[0];d&&!this.domNode.isList(d);){p=d.nextSibling;lt([d],s),gt(e[i],{"list-style-type":"none"}),gt(s,{"list-style-type":""}),d=p}ht([s.parentNode],n),G(e[i])}}else"LI"===n.tagName?((o=Q(e[i].parentNode.tagName)).style.listStyleType=e[i].parentNode.style.listStyleType,ht([o],n),ht([e[i]],o)):"OL"!==n.tagName&&"UL"!==n.tagName||ht([e[i]],n)}else{h=e[i];t=!0,this.noPreviousElement(h)}}return t},D7e.prototype.isCursorBeforeTable=function(e){return e.startOffset===e.endOffset&&0<e.startContainer.childNodes.length&&!je(e.startContainer.childNodes[e.startOffset])&&"TABLE"===e.startContainer.childNodes[e.startOffset].nodeName},D7e.prototype.isCursorAtEndOfTable=function(e){return e.startOffset===e.endOffset&&0<e.startContainer.childNodes.length&&!je(e.startContainer.childNodes[e.startOffset-1])&&"TABLE"===e.startContainer.childNodes[e.startOffset-1].nodeName},D7e.prototype.isListItemWithTableChild=function(e){return"LI"===e.nodeName&&!je(e.firstChild)&&"TABLE"===e.firstChild.nodeName},D7e.prototype.applyListsHandler=function(e){var t=this.parent.nodeSelection.getRange(this.parent.currentDocument);if(-1!==F.userAgent.indexOf("Firefox")&&t.startContainer===t.endContainer&&t.startContainer===this.parent.editableElement){for(var i=t.startContainer.childNodes[0<t.startOffset?t.startOffset-1:t.startOffset]||t.startContainer,n=t.endContainer.childNodes[0<t.endOffset?t.endOffset-1:t.endOffset]||t.endContainer,o="BR"===n.lastChild.nodeName?je(n.lastChild.previousSibling)?n:n.lastChild.previousSibling:n.lastChild;!je(o)&&"#text"!==o.nodeName&&"IMG"!==o.nodeName&&"BR"!==o.nodeName&&"HR"!==o.nodeName;)o=o.lastChild;this.parent.nodeSelection.setSelectionText(this.parent.currentDocument,i,o,0,o.textContent.length),t=this.parent.nodeSelection.getRange(this.parent.currentDocument)}t.startContainer===t.endContainer&&t.startContainer===this.parent.editableElement&&t.startOffset===t.endOffset&&0===t.startOffset&&0===this.parent.editableElement.textContent.length&&"TABLE"!==this.parent.editableElement.childNodes[0].nodeName&&"IMG"!==this.parent.editableElement.childNodes[0].nodeName&&(n=t.startContainer.childNodes[0],this.parent.nodeSelection.setSelectionText(this.parent.currentDocument,n,n,0,0),t=this.parent.nodeSelection.getRange(this.parent.currentDocument)),this.saveSelection=this.parent.nodeSelection.save(t,this.parent.currentDocument),this.currentAction=e.subCommand,this.currentAction=e.subCommand="NumberFormatList"===this.currentAction?"OL":"BulletFormatList"===this.currentAction?"UL":this.currentAction,this.domNode.setMarker(this.saveSelection);var r=this.domNode.blockNodes(!0);"BR"===e.enterAction&&(this.isCursorBeforeTable(t)?r=[t.startContainer.childNodes[t.startOffset]]:this.isCursorAtEndOfTable(t)?r=[t.startContainer.childNodes[t.startOffset-1]]:1===r.length&&this.isListItemWithTableChild(r[0])?r[0]=r[0].firstChild:(this.setSelectionBRConfig(),this.parent.domNode.convertToBlockNodes(this.parent.domNode.blockNodes(),!0),this.setSelectionBRConfig(),r=this.parent.domNode.blockNodes()));for(var s=0;s<r.length;s++)"TABLE"!==r[s].tagName||t.collapsed||r.splice(s,1),0<r.length&&"LI"!==r[s].tagName&&"LI"===r[s].parentNode.tagName&&(r[s]=r[s].parentNode);this.applyLists(r,this.currentAction,e.selector,e.item,e),e.callBack&&e.callBack({requestType:this.currentAction,event:e.event,editorMode:"HTML",range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.domNode.blockNodes()})},D7e.prototype.setSelectionBRConfig=function(){var e=this.parent.editableElement.querySelector("."+JUe.startSelection),t=this.parent.editableElement.querySelector("."+JUe.endSelection);je(t)?this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,e,0):this.parent.nodeSelection.setSelectionText(this.parent.currentDocument,e,t,0,0)},D7e.prototype.applyLists=function(e,t,i,n,o){if(this.isRevert(e,t,n)&&je(n))this.revertList(e,o),this.removeEmptyListElements();else{this.checkLists(e,t,n);var r="";""!==e[0].style.marginLeft&&(r=' style = "margin-left: '+e[0].style.marginLeft+';"');for(var s=0;s<e.length;s++){je(n)||je(n.listStyle)||("listImage"===n.listStyle?gt(e[s],{"list-style-image":n.listImage}):(gt(e[s],{"list-style-image":"none"}),gt(e[s],{"list-style-type":n.listStyle.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}))),e[s].style.removeProperty("margin-left");var a,l,h,d,p,c,u,g="IMG"===e[s].tagName||e[s].classList.contains("e-editor-select-start")?"":this.domNode.attributes(e[s]);"true"===e[s].getAttribute("contenteditable")&&1===e[s].childNodes.length&&"TABLE"===e[s].childNodes[0].nodeName?((a=document.createElement(t)).innerHTML="<li><br/></li>",e[s].appendChild(a)):"LI"!==e[s].tagName&&je(n)&&"BLOCKQUOTE"===e[s].nodeName?(h="</"+t+">",p=e[s].innerHTML,u=(l="<"+t+r+">")+(c=this.domNode.createTagString(d="li"+g,null,p))+h,e[s].innerHTML=u):"LI"!==e[s].tagName&&je(n)?(l="<"+t+r+">",h="</"+t+">",d="li"+g,p="p"===e[s].tagName.toLowerCase()?e[s].innerHTML:e[s].outerHTML,c=this.domNode.createTagString(d,null,p),u=l+(c=this.setStyle(c))+h,this.domNode.replaceWith(e[s],u)):je(n)||"LI"===e[s].tagName||(l="<"+t+("IMG"===e[s].tagName?"":this.domNode.attributes(e[s]))+">",h="</"+t+">",d="li",p="p"===e[s].tagName.toLowerCase()?e[s].innerHTML:e[s].outerHTML,u=l+(c=this.domNode.createTagString(d,null,p))+h,this.domNode.replaceWith(e[s],u))}}this.cleanNode(),"BR"===o.enterAction&&document.querySelectorAll("span#removeSpan").forEach(function(e){for(var t=document.createDocumentFragment();e.firstChild;)t.appendChild(e.firstChild);e.parentNode.replaceChild(t,e)}),this.parent.editableElement.focus({preventScroll:!0}),WUe()&&QUe(this.parent.editableElement,i),this.saveSelection=this.domNode.saveMarker(this.saveSelection),this.saveSelection.restore()},D7e.prototype.setStyle=function(e){var t=document.createElement("div"),n=(t.innerHTML=e.trim(),t.querySelector("li")),o=n;if(n&&1===n.children.length){for(;n&&1===n.children.length&&n.firstChild&&n.firstChild.nodeType!==Node.TEXT_NODE;)!function(){var t,e,i=n.firstChild;i&&(i.style.cssText||"B"===i.tagName.toUpperCase()||"STRONG"===i.tagName.toUpperCase()||"I"===i.tagName.toUpperCase()||"EM"===i.tagName.toUpperCase())&&(t=["font-size","font-family","color","font-weight"],(e=i.style.cssText.split(";").map(function(e){return e.trim()}).filter(function(e){e=je(e.split(":")[0])?"":e.split(":")[0].trim();return e&&-1!==t.indexOf(e)}).join(";"))?o.style.cssText+=(o.style.cssText?";":"")+e:"B"===i.tagName.toUpperCase()||"STRONG"===i.tagName.toUpperCase()?o.style.cssText+=(o.style.cssText?";":"")+(e="font-weight: bold;"):"I"!==i.tagName.toUpperCase()&&"EM"!==i.tagName.toUpperCase()||(o.style.cssText+=(o.style.cssText?";":"")+(e="font-style: italic;"))),n=i}();e=t.innerHTML}return e},D7e.prototype.removeEmptyListElements=function(){for(var e=this.parent.editableElement.querySelectorAll("ol, ul"),t=0;t<e.length;t++)""===e[t].textContent.trim()&&G(e[t])},D7e.prototype.isRevert=function(e,t,i){for(var n=!0,o=0;o<e.length;o++){if("LI"!==e[o].tagName)return!1;(e[o].parentNode.tagName!==t||je(i)&&""!==e[o].parentNode.style.listStyleType)&&(n=!1),e[o].parentNode.tagName===t&&""!==e[o].parentNode.style.listStyleType&&(n=!0)}return n},D7e.prototype.checkLists=function(e,t,i){for(var n=[],o=0;o<e.length;o++){var r=e[o].parentNode;je(i)||"LI"!==e[o].tagName||je(i.listStyle)||("listImage"===i.listStyle?gt(r,{"list-style-image":i.listImage}):(gt(r,{"list-style-image":"none"}),gt(r,{"list-style-type":i.listStyle.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}))),("LI"===e[o].tagName&&r.tagName!==t&&n.indexOf(r)<0||"LI"===e[o].tagName&&r.tagName===t&&n.indexOf(r)<0&&null!==i)&&n.push(r),je(i)&&(r.tagName===t||("UL"===r.tagName||"OL"===r.tagName)&&r.hasAttribute("style"))&&r.hasAttribute("style")&&r.removeAttribute("style")}for(var s=n.length-1;0<=s;s--){var a=n[s],a="<"+t.toLowerCase()+" "+this.domNode.attributes(a)+">"+a.innerHTML+"</"+t.toLowerCase()+">";this.domNode.replaceWith(n[s],a)}},D7e.prototype.cleanNode=function(){for(var e=this.parent.editableElement.querySelectorAll("ol + ol, ul + ul"),t=0;t<e.length;t++){for(var i,n,o=e[t],r=o;r.parentElement&&(!r.parentElement||"LI"===r.parentElement.tagName||"OL"===r.parentElement.tagName||"UL"===r.parentElement.tagName);)r=r.parentElement;if("OL"!==e[t].parentElement.parentElement.nodeName&&"UL"!==e[t].parentElement.parentElement.nodeName||(i=e[t].parentElement.parentElement.style.listStyleType,n=o.previousElementSibling),this.domNode.isList(o.previousElementSibling)&&this.domNode.openTagString(o)===this.domNode.openTagString(o.previousElementSibling)){for(var s=this.domNode.contents(o),a=0;a<s.length;a++)o.previousElementSibling.appendChild(s[a]);o.parentNode.removeChild(o)}else if(je(o.getAttribute("level"))){if(this.domNode.isList(o.previousElementSibling)&&r.contains(o.previousElementSibling)&&("OL"===o.tagName||"UL"===o.tagName)&&("OL"===o.previousElementSibling.nodeName||"UL"===o.previousElementSibling.nodeName)){for(s=this.domNode.contents(o),a=0;a<s.length;a++)o.previousElementSibling.appendChild(s[a]);o.parentNode.removeChild(o)}}else o.tagName===o.previousElementSibling.tagName&&o.previousElementSibling.lastChild.append(o)}if(n){n.style.listStyleType=i;for(var l=this.parent.nodeSelection.getRange(this.parent.currentDocument),h=[],h="UL"===l.commonAncestorContainer.nodeName||"OL"===l.commonAncestorContainer.nodeName?(l.commonAncestorContainer instanceof Element&&h.push(l.commonAncestorContainer),h.concat(Array.from(l.commonAncestorContainer.querySelectorAll("ol, ul")))):Array.from(l.commonAncestorContainer.querySelectorAll("ol, ul")),d=0;d<h.length;d++)for(var p=void 0,c=h[d];c;)"OL"!==c.nodeName&&"OL"!==c.nodeName||(""!==c.style.listStyleType&&"none"!==c.style.listStyleType&&"LI"!==c.nodeName?p=c.style.listStyleType:je(p)||""!==c.style.listStyleType&&"none"!==c.style.listStyleType||"LI"===c.nodeName||"UL"!==c.nodeName&&"OL"!==c.nodeName||(c.style.listStyleType=p)),c=c.querySelector("UL,OL")}},D7e.prototype.findUnSelected=function(e,t){if(0<(e=e.slice().reverse()).length){for(var i=[],n=[],o=[],r=[],o=t[t.length-1].childNodes,s=0;s<o.length;s++)if("OL"===o[s].tagName||"UL"===o[s].tagName){var a=o[s].querySelectorAll("li");if(0<a.length)for(var l=0;l<a.length;l++)r.push(a[l])}for(var h=0;h<r.length;h++){for(var d=0,p=0;p<e.length;p++)r[h].contains(e[p])||(d+=1);d===e.length&&n.push(r[h])}if(0<n.length)for(var c=0;c<n.length;c++)"OL"!==this.domNode.contents(n[c])[0].nodeName&&"UL"!==this.domNode.contents(n[c])[0].nodeName&&i.push(n[c]);0<i.length&&this.nestedList(i)}},D7e.prototype.revertList=function(e,t){for(var i=[],n=e.length-1;0<=n;n--)for(var o=n-1;0<=o;o--)if(e[o].contains(e[n])||e[o]===e[n]){i.push(e[n]),e.splice(n,1);break}this.findUnSelected(i,e);for(var r=[],n=0;n<e.length;n++){var s=e[n],a=(3===this.domNode.contents(s)[0].nodeType&&0===this.domNode.contents(s)[0].textContent.trim().length&&G(this.domNode.contents(s)[0]),e[n].parentNode),l=s.getAttribute("class");if(0===i.length&&(d=e[n].querySelectorAll("ul, ol")[0])&&d.querySelectorAll("li")&&(ht([h=Q(d.tagName)],d.parentNode),ht([p=Q("li",{styles:"list-style-type: none;"})],h),ht([d],p)),s.parentNode.insertBefore(this.closeTag(a.tagName),s),"LI"===a.parentNode.tagName||"OL"===a.parentNode.tagName||"UL"===a.parentNode.tagName)s.parentNode.insertBefore(this.closeTag("LI"),s);else{var h=this.getClosestListParentMargin(s);if(0===s.querySelectorAll(xUe.join(", ")).length){var d=je(l)?' class="e-rte-wrap-inner"':' class="'+l+' e-rte-wrap-inner"',p=a,c=(e.length===p.querySelectorAll("li").length&&(je(p.style.listStyleType)||a.style.removeProperty("list-style-type"),je(p.style.listStyleImage)||a.style.removeProperty("list-style-image"),0===p.style.length)&&a.removeAttribute("style"),je(t.enterAction)?"p":t.enterAction),c="<"+c+d+this.domNode.attributes(s)+"></"+c+">",u=document.createElement("div");u.innerHTML=c,""!==h&&(u.firstElementChild.style.marginLeft=h),"BR"!==t.enterAction?this.domNode.wrapInner(s,this.domNode.parseHTMLFragment(u.innerHTML)):(c=document.createElement("br"),this.domNode.wrapInner(s,this.domNode.parseHTMLFragment("<span class=e-rte-wrap-inner id=removeSpan></span>")),s.appendChild(c))}else if(3===this.domNode.contents(s)[0].nodeType){var g=this.domNode.createTagString("p",a,this.parent.domNode.encode(this.domNode.contents(s)[0].textContent));this.domNode.replaceWith(this.domNode.contents(s)[0],g)}else if(this.domNode.contents(s)[0].classList.contains(JUe.startSelection)||this.domNode.contents(s)[0].classList.contains(JUe.endSelection)){g=this.domNode.createTagString("p",a,"<br>"+this.domNode.contents(s)[0].outerHTML);g=this.domNode.contents(s)[1]&&"BR"===this.domNode.contents(s)[1].tagName?(this.domNode.contents(s)[1].remove(),this.domNode.createTagString("p",a,"<br>"+this.domNode.contents(s)[0].outerHTML)):this.domNode.createTagString("p",a,this.domNode.contents(s)[0].outerHTML),this.domNode.replaceWith(this.domNode.contents(s)[0],g)}else{var m=s.firstChild;if(m){var f=s.parentElement.attributes;if(0<f.length)for(var y=0;y<f.length;y++){var v=f[y],b=function(e){return e?e.split(";").filter(function(e){return!/list-style-(image|type):/.test(e.trim())}).join(";").trim():""},w=b(m.getAttribute(v.nodeName)),b=b(s.parentElement.getAttribute(v.nodeName));w&&w!==b?m.setAttribute(v.nodeName,w?b+" "+w:b):m.setAttribute(v.nodeName,b),0===m.style.length&&m.removeAttribute("style")}}(l=m.getAttribute("class"))&&m.getAttribute("class")&&l!==m.getAttribute("class")&&pt(m,{class:l+" "+m.getAttribute("class")})}ht([this.openTag("LI")],s),lt([this.closeTag("LI")],s)}this.domNode.insertAfter(this.openTag(a.tagName),s),"LI"===a.parentNode.tagName&&(a=a.parentNode.parentNode),r.indexOf(a)<0&&r.push(a)}for(n=0;n<r.length;n++){var C=r[n],S=C.innerHTML;S=(S=S.replace(/<span class="e-rte-list-close-([a-z]*)"><\/span>/g,"</$1>")).replace(/<span class="e-rte-list-open-([a-z]*)"><\/span>/g,"<$1 "+this.domNode.attributes(C)+">"),this.domNode.replaceWith(C,this.domNode.openTagString(C)+S.trim()+this.domNode.closeTagString(C))}for(var A=this.parent.editableElement.querySelectorAll("ul:empty, ol:empty"),n=0;n<A.length;n++)G(A[n]);for(var x=this.parent.editableElement.querySelectorAll("li:empty"),n=0;n<x.length;n++)G(x[n])},D7e.prototype.getClosestListParentMargin=function(e){for(var t=e;t&&t!==this.parent.editableElement;){if("UL"===t.nodeName||"OL"===t.nodeName)return t.style.marginLeft;t=t.parentElement}return""},D7e.prototype.openTag=function(e){return this.domNode.parseHTMLFragment('<span class="e-rte-list-open-'+e.toLowerCase()+'"></span>')},D7e.prototype.closeTag=function(e){return this.domNode.parseHTMLFragment('<span class="e-rte-list-close-'+e.toLowerCase()+'"></span>')},D7e.prototype.destroy=function(){this.removeEventListener(),this.domNode&&(this.domNode=null)},D7e.prototype.areAllListItemsSelected=function(e,t){for(var i=e.querySelectorAll("li"),n=0;n<i.length;n++){var o=i[n];if(this.parent.currentDocument.createRange().selectNodeContents(o),!t.intersectsNode(o))return!1}return!0},D7e.prototype.getListCursorInfo=function(e){var t,i,n=new I7e(this.parent.editableElement),o=e.startContainer.nodeType===Node.TEXT_NODE?n.getTopMostNode(e.startContainer):e.startContainer,n=e.endContainer.nodeType===Node.TEXT_NODE?n.getTopMostNode(e.endContainer):e.endContainer,r=!e.collapsed,s=(o.nodeType===Node.TEXT_NODE?o.parentElement:o).closest("li"),n=(n.nodeType===Node.TEXT_NODE?n.parentElement:n).closest("li"),a=!(!s||!s.closest("ol, ul"))&&this.checkIsNestedList(s.closest("ol, ul")),n=!(!n||!n.closest("ol, ul"))&&this.checkIsNestedList(n.closest("ol, ul")),l=this.parent.domNode.blockNodes(),h=l.length,n=this.getListSelectionType(a?"Nested":"Parent",n?"Nested":"Parent");return r?(i=1===l.length?0===e.startOffset&&e.endOffset===s.textContent.length?"SingleFull":"SinglePartial":0===e.startOffset&&e.endOffset===l[h-1].textContent.length?"MultipleFull":"MultiplePartial",t="None"):(t=0===e.startOffset&&null===o.previousSibling?a?"StartNested":"StartParent":e.startOffset===s.textContent.length&&null===o.nextSibling?a?"EndNested":"EndParent":a?"MiddleNested":"MiddleParent",i="None"),{position:t,selectionState:i,itemType:n}},D7e.prototype.checkIsNestedList=function(e){return e.parentElement!==this.parent.editableElement&&!!e.closest("li")},D7e.prototype.getListSelectionType=function(e,t){return"Nested"===e&&"Nested"===t?"Nested":"Parent"===e&&"Parent"===t?"Parent":"Mixed"},D7e.prototype.isAllListNodesSelected=function(e){for(var t=this.parent.currentDocument.getSelection(),i=!1,n=e.querySelectorAll("li"),o=0;o<n.length;o++){if(!t.containsNode(n[o],!1)){i=!1;break}i=!0}return i};var E7e=D7e;function D7e(e){this.listTabIndentation=!1,this.parent=e,this.domNode=this.parent.domNode,this.addEventListener()}k7e.prototype.addEventListener=function(){this.parent.observer.on(i7e,this.applyFormats,this),this.parent.observer.on(r7e,this.onKeyUp,this),this.parent.observer.on(n7e,this.onKeyDown,this),this.parent.observer.on(g7e,this.blockQuotesHandled,this),this.parent.observer.on(v7e,this.destroy,this)},k7e.prototype.removeEventListener=function(){this.parent.observer.off(i7e,this.applyFormats),this.parent.observer.off(r7e,this.onKeyUp),this.parent.observer.off(n7e,this.onKeyDown),this.parent.observer.off(v7e,this.destroy)},k7e.prototype.getParentNode=function(e){for(var t=e,i=["DIV","SECTION","ARTICLE","ASIDE","FOOTER","HEADER","NAV","MAIN"];e.parentNode&&e.parentNode!==this.parent.editableElement;)e=e.parentNode;if(-1!==i.indexOf(e.nodeName.toUpperCase()))for(e=t;-1===i.indexOf(e.nodeName.toUpperCase())&&-1===i.indexOf(e.parentNode.nodeName.toUpperCase());)e=e.parentNode;return e},k7e.prototype.blockQuotesHandled=function(){this.blockquotePrevent=!0},k7e.prototype.onKeyUp=function(e){var t,i=this.parent.nodeSelection.getRange(this.parent.currentDocument),n=i.endContainer,o=n.lastChild;13===e.event.which&&i.startContainer===n&&3!==n.nodeType&&((t=Q("p")).innerHTML="<br>",!je(o)&&o&&"BR"===o.nodeName&&o.previousSibling&&"TABLE"===o.previousSibling.nodeName?(n.replaceChild(t,o),this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,t,0)):!je(o=this.parent.nodeSelection.getSelectionNodeCollectionBr(i)[0])&&"BR"===o.nodeName&&o.previousSibling&&"TABLE"===o.previousSibling.nodeName&&(n.replaceChild(t,o),this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,t,0))),"BR"!==e.enterAction&&!je(i.startContainer)&&!je(i.startContainer.parentElement)&&i.startContainer===i.endContainer&&"#text"===i.startContainer.nodeName&&i.startContainer.parentElement.classList.contains("e-content")&&i.startContainer.parentElement.isContentEditable&&(t=Q(e.enterAction),i.startContainer.parentElement.insertBefore(t,i.startContainer),t.appendChild(i.startContainer),this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,t,1))},k7e.prototype.getBlockParent=function(e,t){for(var i=e;e!==t;)e=(i=e).parentElement;return i},k7e.prototype.onKeyDown=function(e){if(13===e.event.which&&!this.blockquotePrevent){var t=0===(s=this.parent.nodeSelection.getRange(this.parent.currentDocument)).startContainer.textContent.length||"PRE"===s.startContainer.nodeName?s.startContainer:s.startContainer.parentElement,i=0===s.endContainer.textContent.length||"PRE"===s.endContainer.nodeName?s.endContainer:s.endContainer.parentElement,n=z(t,"pre"),o=z(i,"pre"),t=z(t,"blockquote"),r=z(i,"blockquote");if(!je(n)&&!je(n.parentElement)&&"LI"===n.parentElement.tagName)return;if((je(n)&&!je(o)||!je(n)&&je(o))&&(e.event.preventDefault(),this.deleteContent(s),this.removeCodeContent(s),s=this.parent.nodeSelection.getRange(this.parent.currentDocument),this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,i,0)),13===e.event.which&&(!je(t)&&!je(r)||!je(t)&&je(r))&&(8203===(a=this.getBlockParent(s.startContainer,t)).textContent.charCodeAt(0)&&1===a.textContent.length||0===a.textContent.length&&0===a.querySelectorAll("img").length&&0===a.querySelectorAll("table").length)&&(e.event.preventDefault(),je(a.nextElementSibling)||(new C7e).SplitNode(s,a.parentElement,!1).cloneNode(!0),this.paraFocus(a.parentElement===this.parent.editableElement?a:a.parentElement)),13===e.event.which&&!je(n)&&!je(o)){e.event.preventDefault(),this.deleteContent(s),this.removeCodeContent(s);var s,i=(s=this.parent.nodeSelection.getRange(this.parent.currentDocument)).startContainer.childNodes[s.endOffset],r=s.startContainer.childNodes[s.endOffset-1],a=s.startContainer;if(je(i)||je(r)||!je(i.nextSibling)||"BR"!==i.nodeName||"BR"!==r.nodeName)if(8203===a.textContent.charCodeAt(0)&&1===a.textContent.length||0===a.textContent.length){for(;"PRE"!==a.parentElement.nodeName&&(1===a.textContent.length||0===a.textContent.length);)a=a.parentElement;!je(a.previousSibling)&&"BR"===a.previousSibling.nodeName&&je(a.nextSibling)?this.paraFocus(a.parentElement):this.isNotEndCursor(n,s)}else this.isNotEndCursor(n,s);else this.paraFocus(s.startContainer,e.enterAction)}}this.blockquotePrevent=!1},k7e.prototype.removeCodeContent=function(e){var t,i=new RegExp("\ufeff","g");je(e.endContainer.textContent.match(i))||(t=65279===e.endContainer.textContent.charCodeAt(e.endOffset-1)?e.endOffset-2:e.endOffset,e.endContainer.textContent=e.endContainer.textContent.replace(i,""),""===e.endContainer.textContent?this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,e.endContainer.parentElement,0):this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,e.endContainer,t))},k7e.prototype.deleteContent=function(e){e.startContainer===e.endContainer&&e.startOffset===e.endOffset||e.deleteContents()},k7e.prototype.paraFocus=function(e,t){var i;"DIV"===t?(i=Q("div")).innerHTML="<br>":"BR"===t?i=Q("br"):(i=Q("p")).innerHTML="<br>",this.parent.domNode.insertAfter(i,e),this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,i,0),G(e.lastChild)},k7e.prototype.isNotEndCursor=function(e,t){var i,n=new C7e,o=t.startOffset===e.lastChild.textContent.length&&e.lastChild.textContent===t.startContainer.textContent;0===e.textContent.indexOf(t.startContainer.textContent)&&(0===t.startOffset&&0===t.endOffset||"PRE"===t.startContainer.nodeName)?(this.insertMarker(e,t),i=Q("br"),e.childNodes[t.endOffset].parentElement.insertBefore(i,e.childNodes[t.endOffset])):(i=n.SplitNode(t,e,!0),this.insertMarker(e,t),"PRE"===(n=e.previousElementSibling).tagName&&(n.insertAdjacentHTML("beforeend","<br>"+i.innerHTML),G(e))),this.setCursorPosition(o,e)},k7e.prototype.setCursorPosition=function(e,t){var i=!1,n=this.parent.editableElement.querySelector(".tempSpan"),o=n.parentElement;""===n.parentNode.textContent?i=!0:this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,n,0),e?i?o===t?(this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,n,0),G(n)):this.focusSelectionParent(n,o):(e=Q("br"),this.parent.domNode.insertAfter(e,n),this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,n,0),G(n)):i?this.focusSelectionParent(n,o):G(n)},k7e.prototype.focusSelectionParent=function(e,t){G(e),t.innerHTML="​",this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,t,0)},k7e.prototype.insertMarker=function(e,t){var i=Q("span",{className:"tempSpan"});"PRE"===t.startContainer.nodeName?e.childNodes[t.endOffset].parentElement.insertBefore(i,e.childNodes[t.endOffset]):t.startContainer.parentElement.insertBefore(i,t.startContainer)},k7e.prototype.applyFormats=function(e){var t=this.parent.nodeSelection.getRange(this.parent.currentDocument),i=this.parent.nodeSelection.processedTableImageCursor(t);if((i.start||i.end)&&"blockquote"!==e.subCommand.toLowerCase()&&("TABLE"===i.startName||"TABLE"===i.endName))return n=i.start?i.startNode:i.endNode,void this.applyTableSidesFormat(e,i.start,n);var n=!1,t=(this.parent.editableElement!==t.endContainer||je(this.parent.editableElement.children[t.endOffset-1])||"TABLE"!==this.parent.editableElement.children[t.endOffset-1].tagName||t.collapsed||(n=!0),this.parent.nodeSelection.save(t,this.parent.currentDocument)),o=(this.parent.domNode.setMarker(t),this.parent.domNode.blockNodes(!0));if("BR"===e.enterAction){this.setSelectionBRConfig();var r=this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument),s=this.parent.nodeSelection.getSelectionNodes(r),a=[];0===s.length&&s.push(o[0]);for(var l=0;l<s.length;l++){for(var h=s[l],d=void 0;!this.parent.domNode.isBlockNode(h)&&h!==this.parent.editableElement;)h=(d=h).parentElement;this.parent.domNode.isBlockNode(h)&&h===this.parent.editableElement&&a.push(d)}for(l=0;l<a.length;l++)if(!this.parent.domNode.isBlockNode(a[l])){for(var p=h=a[l];h===this.parent.editableElement;)h=(p=h).parentElement;for(var c=void 0,u=(this.parent.domNode.isBlockNode(p.parentElement)&&p.parentElement===this.parent.editableElement?(c=Q("div"),p.parentElement.insertBefore(c,p),c.appendChild(p),0===p.textContent.length&&p.appendChild(Q("br"))):c=p,c.previousSibling);!je(u)&&"BR"!==u.nodeName&&!this.parent.domNode.isBlockNode(u);)c.firstChild.parentElement.insertBefore(u,c.firstChild),u=c.previousSibling;je(u)||"BR"!==u.nodeName||G(u);for(var g=c.nextSibling;!je(g)&&"BR"!==g.nodeName&&!this.parent.domNode.isBlockNode(g);)c.appendChild(g),g=c.nextSibling;je(g)||"BR"!==g.nodeName||G(g)}this.setSelectionBRConfig(),o=this.parent.domNode.blockNodes()}for(var m=!1,f=!1,l=0;l<o.length;l++)(je(z(o[0],"blockquote"))||je(z(o[o.length-1],"blockquote")))&&(f=!0);for(var y=!1,l=0;l<o.length;l++){var v,b,w,C,S,A=void 0,x=void 0,x="blockquote"===e.subCommand.toLowerCase()?(A=this.getParentNode(o[l]),"BR"===e.enterAction?A.innerHTML:(!je(z(o[l],"table"))&&this.parent.editableElement.contains(z(o[l],"table"))?je(z(o[l],"blockquote"))?o[l]:z(o[l],"blockquote"):A).outerHTML):(A=o[l]).innerHTML;"blockquote"===e.subCommand.toLowerCase()&&e.subCommand.toLowerCase()===A.tagName.toLowerCase()&&f||e.subCommand.toLowerCase()===A.tagName.toLowerCase()&&("pre"!==e.subCommand.toLowerCase()&&"blockquote"!==e.subCommand.toLowerCase()||!je(e.exeValue)&&"dropDownSelect"===e.exeValue.name)||je(A.parentNode)||"TABLE"===A.tagName&&"pre"===e.subCommand.toLowerCase()||(this.cleanFormats(A,e.subCommand),v="pre"===e.subCommand.toLowerCase()&&"pre"===A.tagName.toLowerCase()?"p":e.subCommand,S=e.subCommand.toLowerCase()===A.tagName.toLowerCase()&&"blockquote"===e.subCommand.toLowerCase()&&!je(z(o[l],"li")),b="TABLE"!==A.tagName||je(z(o[l],"blockquote"))?A:z(o[l],"blockquote"),y=e.subCommand.toLowerCase()===b.tagName.toLowerCase()&&"blockquote"===e.subCommand.toLowerCase(),b=void 0,w=this.getNode(o[l]),C=this.getNode(o[o.length-1]),(je(z(o[l],"table"))||je(z(o[l],"td"))&&je(z(o[l],"th"))?y&&A.firstChild===w&&A.lastChild===C:this.hasOnlyBlockquotes(z(o[l],"td")||z(o[l],"th")))?b=x.replace(/<blockquote[^>]*>|<\/blockquote>/g,""):S?(m=!0,0===l&&this.createBlockquoteSpan("e-rte-blockquote-close",w,"before"),l===o.length-1&&this.createBlockquoteSpan("e-rte-blockquote-open",C,"after")):y&&z(o[0],"blockquote")&&z(o[o.length-1],"blockquote")?(m=!0,0===l&&this.createBlockquoteSpan("e-rte-blockquote-close",o[l],"before"),l===o.length-1&&this.createBlockquoteSpan("e-rte-blockquote-open",o[l],"after")):b=this.parent.domNode.createTagString(v,"blockquote"===e.subCommand.toLowerCase()?null:A,x.replace(/>\s+</g,"><")),"LI"===A.tagName?(A.innerHTML="",A.insertAdjacentHTML("beforeend",b)):m||(S=!je(z(o[l],"table"))&&this.parent.editableElement.contains(z(o[l],"table"))?je(z(o[l],"blockquote"))?o[l]:z(o[l],"blockquote"):A,this.parent.domNode.replaceWith(S,b)))}if(m)for(var I=this.parent.editableElement.querySelectorAll(".e-rte-blockquote-open, .e-rte-blockquote-close"),l=0;l<I.length;l++){var T=I[l].parentElement,E=T.innerHTML;if(E=(E=E.replace(/<span class="e-rte-blockquote-open"><\/span>/g,"<blockquote>")).replace(/<span class="e-rte-blockquote-close"><\/span>/g,"</blockquote>"),I[0].parentElement===I[1].parentElement){this.parent.domNode.replaceWith(T,this.parent.domNode.openTagString(T)+E.trim()+this.parent.domNode.closeTagString(T));break}l!==I.length-1||je(I[l])||je(I[l-1])||I[l].parentElement===I[l-1].parentElement?this.parent.domNode.replaceWith(T,this.parent.domNode.openTagString(T)+E.trim()+this.parent.domNode.closeTagString(T)):this.parent.domNode.replaceWith(T,E.trim())}this.preFormatMerge(),this.blockquotesFormatMerge(e.enterAction);var r=this.parent.editableElement.querySelector("."+JUe.startSelection),D=this.parent.editableElement.querySelector("."+JUe.endSelection);je(r)||je(D)||(r=r.lastChild,D=D.lastChild),t=this.parent.domNode.saveMarker(t),WUe()&&QUe(this.parent.editableElement,e.selector),n?this.parent.nodeSelection.setSelectionText(this.parent.currentDocument,r,D,0,D.textContent.length):i.start&&"blockquote"===e.subCommand.toLowerCase()?(n=t.range.startContainer.childNodes[y?t.range.startOffset-1:t.range.startOffset],y?(r=n.parentElement,D=Array.prototype.indexOf.call(r.childNodes,n),this.parent.nodeSelection.setSelectionText(this.parent.currentDocument,r,r,D,D)):this.parent.nodeSelection.setSelectionText(this.parent.currentDocument,n,n,0,0)):t.restore(),e.callBack&&e.callBack({requestType:e.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.domNode.blockNodes()})},k7e.prototype.hasOnlyBlockquotes=function(e){for(var t=!1,i=0;i<e.childNodes.length;i++){var n=e.childNodes[i];if(n.nodeType===Node.TEXT_NODE){if(""!==n.textContent.replace(/[\u200B\u200C\u200D]/g,"").trim())return!1}else if(n.nodeType===Node.ELEMENT_NODE){if("BLOCKQUOTE"!==n.tagName)return!1;t=!0}}return t},k7e.prototype.getNode=function(e){if("BLOCKQUOTE"===e.nodeName)return e=e.firstChild;for(;e.parentNode&&"BLOCKQUOTE"!==e.parentNode.nodeName;)e=e.parentNode;return e},k7e.prototype.createBlockquoteSpan=function(e,t,i){var n=Q("span");return n.classList.add(e),"before"===i?t.parentNode.insertBefore(n,t):this.parent.domNode.insertAfter(n,t),n},k7e.prototype.setSelectionBRConfig=function(){var e=this.parent.editableElement.querySelector("."+JUe.startSelection),t=this.parent.editableElement.querySelector("."+JUe.endSelection);je(t)?this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,e,0):this.parent.nodeSelection.setSelectionText(this.parent.currentDocument,e,t,0,0)},k7e.prototype.preFormatMerge=function(){var e=this.parent.editableElement.querySelectorAll("PRE");if(!je(e))for(var t=0;t<e.length;t++){var i=e[t].previousElementSibling;je(i)||"PRE"!==i.tagName||(i.insertAdjacentHTML("beforeend","<br>"+e[t].innerHTML),G(e[t]))}},k7e.prototype.blockquotesFormatMerge=function(e){var t=this.parent.editableElement.querySelectorAll("BLOCKQUOTE");if(!je(t))for(var i=0;i<t.length;i++){""===t[i].innerHTML.trim()&&G(t[i]);var n=t[i].previousElementSibling;je(n)||"BLOCKQUOTE"!==n.tagName||(n.insertAdjacentHTML("beforeend",("BR"===e?"<br>":"")+t[i].innerHTML),G(t[i]))}},k7e.prototype.cleanFormats=function(e,t){var i=["display","font-size","margin-top","margin-bottom","margin-left","margin-right","font-weight"];t=t.toLowerCase();for(var n=0;n<i.length&&"p"!==t&&"blockquote"!==t&&"pre"!==t;n++)e.style.removeProperty(i[n])},k7e.prototype.applyTableSidesFormat=function(e,t,i){var n=Q(e.subCommand);"BR"!==e.enterAction&&n.appendChild(Q("br")),i.insertAdjacentElement(t?"beforebegin":"afterend",n),this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,n,0),e.callBack&&e.callBack({requestType:e.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.domNode.blockNodes()})},k7e.prototype.destroy=function(){this.removeEventListener()};var M7e=k7e;function k7e(e){this.blockquotePrevent=!1,this.parent=e,this.addEventListener()}B7e.prototype.addEventListener=function(){this.parent.observer.on(aUe,this.linkCommand,this),this.parent.observer.on(v7e,this.destroy,this);var e=this.parent.editableElement;e&&(E.add(e,"drop",this.drop),E.add(e,"dragenter",this.enter),E.add(e,"dragover",this.start))},B7e.prototype.removeEventListener=function(){this.parent.observer.off(aUe,this.linkCommand),this.parent.observer.off(v7e,this.destroy);var e=this.parent.editableElement;e&&(E.remove(e,"drop",this.drop),E.remove(e,"dragenter",this.enter),E.remove(e,"dragover",this.start)),this.drop=null,this.enter=null,this.start=null},B7e.prototype.linkCommand=function(e){switch(e.value.toString().toLocaleLowerCase()){case"createlink":case"editlink":this.createLink(e);break;case"openlink":this.openLink(e);break;case"removelink":this.removeLink(e)}},B7e.prototype.dragStart=function(e){var t,i,n,o,r,s=this.parent.nodeSelection.getRange(this.parent.currentDocument);s&&(t=s.startContainer,i=s.endContainer,o=n=null,t.nodeType===Node.ELEMENT_NODE?n=t.closest("a"):(r=t.parentElement)&&(n=r.closest("a")),i.nodeType===Node.ELEMENT_NODE?o=i.closest("a"):(r=i.parentElement)&&(o=r.closest("a")),"A"===e.target.nodeName||n||o)&&(this.dragSelectionRange=s.cloneRange())},B7e.prototype.dragEnter=function(e){e.dataTransfer.dropEffect="copy",e.preventDefault()},B7e.prototype.dragDrop=function(e){var t,i,n;this.dragSelectionRange&&(e.preventDefault(),t=void 0,this.parent.currentDocument.caretRangeFromPoint?t=this.parent.currentDocument.caretRangeFromPoint(e.clientX,e.clientY):e.rangeParent&&(t=this.parent.currentDocument.createRange()).setStart(e.rangeParent,e.rangeOffset),e=e.dataTransfer.getData("text/html"))&&(i=null,t.startContainer&&t.startContainer.nodeType===Node.TEXT_NODE?i=t.startContainer.parentNode:t.startContainer instanceof HTMLAnchorElement&&(i=t.startContainer),i?"A"!==i.nodeName&&(i=i.closest("a")):t.collapsed&&(n=t.startContainer)&&(n=n.closest("a"))&&(i=n),i&&((n=Q("div",{innerHTML:e})).querySelectorAll("a").forEach(function(e){for(;e.firstChild;)e.parentNode.insertBefore(e.firstChild,e);e.remove()}),e=n.innerHTML),t.deleteContents(),(n=t.createContextualFragment(e)).querySelectorAll("a").forEach(function(e){e.style.textDecoration=""}),this.dragSelectionRange&&(this.dragSelectionRange.deleteContents(),this.normalizeEmptyLinks(),this.dragSelectionRange=null),this.parent.nodeSelection.setRange(this.parent.currentDocument,t),A7e.Insert(this.parent.currentDocument,n,this.parent.editableElement,!0),i)&&i.normalize()},B7e.prototype.normalizeEmptyLinks=function(){var e;this.dragSelectionRange&&(e=(e=(e=this.dragSelectionRange.commonAncestorContainer).nodeType===Node.TEXT_NODE?e.parentElement:e)&&-1===xUe.indexOf(e.nodeName.toLocaleLowerCase())?this.parent.domNode.getImmediateBlockNode(e):e)&&e.querySelectorAll("a:empty").forEach(function(e){""!==e.textContent.trim()||e.querySelector("img")||e.querySelector("video")||e.parentNode&&e.parentNode.removeChild(e)})},B7e.prototype.createLink=function(e){var t,i,n,o=!je(e.item.selectParent)&&1===e.item.selectParent.length&&z(e.item.selectParent[0],"a"),o=je(o)?je(e.item.selectParent)||1!==e.item.selectParent.length?null:e.item.selectParent[0]:o;je(o)||"A"!==o.tagName?("#text"!==(i=(t=new _9e(this.parent.editableElement)).getRange(this.parent.currentDocument)).endContainer.nodeName||i.startContainer.textContent.length!==i.endOffset+1||" "!==i.endContainer.textContent.charAt(i.endOffset)||je(i.endContainer.nextSibling)||"A"!==i.endContainer.nextSibling.nodeName||(t.setSelectionText(this.parent.currentDocument,i.startContainer,i.endContainer,i.startOffset,i.endOffset+1),i=t.getRange(this.parent.currentDocument)),t=!!je(e.item.text)||e.item.text.replace(/ /g,"").localeCompare(i.toString().replace(/\n/g," ").replace(/ /g,""))<0,e.event&&"keydown"===e.event.type&&(32===e.event.keyCode||13===e.event.keyCode)||"Paste"===e.item.action||i.collapsed||t?((i=this.createAchorNode(e)).innerText=""===e.item.text?e.item.url:e.item.text,t=i.innerText.replace(/  +/g,function(e){return" ".repeat(e.length)}),i.innerText=t,e.item.selection.restore(),A7e.Insert(this.parent.currentDocument,i,this.parent.editableElement),je(i.parentElement)||"LI"!==i.parentElement.nodeName||je(i.parentNode.childNodes)||""!==i.parentNode.childNodes[0].textContent||i.parentNode.removeChild(i.parentNode.childNodes[0]),e.event&&"keydown"===e.event.type&&(32===e.event.keyCode||13===e.event.keyCode||/[^\w\s\\/\\.\\:]/g.test(e.event.key))?(t=e.item.selection.range.startContainer).textContent=this.removeText(t.textContent,e.item.text):(n="Paste"===e.item.action?i.childNodes[0].textContent.length:0,e.item.selection.setSelectionText(this.parent.currentDocument,i.childNodes[0],i.childNodes[0],n,i.childNodes[0].textContent.length))):this.handleLinkFormat(e)):(t=o,i="",je(e.item.url)||t.setAttribute("href",e.item.url),je(e.item.title)||t.setAttribute("title",e.item.title),je(e.item.text)||""===e.item.text||(i=t.innerText,t.innerText=e.item.text),je(e.item.target)?(t.removeAttribute("target"),t.removeAttribute("aria-label")):(t.setAttribute("target",e.item.target),t.setAttribute("aria-label",e.item.ariaLabel)),i===e.item.text?(e.item.selection.setSelectionText(this.parent.currentDocument,t,t,1,1),e.item.selection.restore()):(n="Paste"===e.item.action?t.childNodes[0].textContent.length:0,o=("#text"===t.firstChild.nodeName?t.childNodes[0].textContent:t.childNodes).length,e.item.selection.setSelectionText(this.parent.currentDocument,t.childNodes[0],t.childNodes[0],n,o))),e.callBack&&e.callBack({requestType:"Links",editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},B7e.prototype.createAchorNode=function(e){var t=Q("a",{className:"e-rte-anchor",attrs:{href:e.item.url,title:je(e.item.title)||""===e.item.title?e.item.url:e.item.title}});return je(e.item.target)||t.setAttribute("target",e.item.target),je(e.item.ariaLabel)||t.setAttribute("aria-label",e.item.ariaLabel),t},B7e.prototype.removeText=function(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]===t&&(i.splice(n,1),n--);return i.join(" ")+" "},B7e.prototype.openLink=function(e){document.defaultView.open(e.item.url,e.item.target),this.callBack(e)},B7e.prototype.removeLink=function(e){var t=this.parent.domNode.blockNodes();if(t.length<2){this.parent.domNode.setMarker(e.item.selection);for(var i=z(e.item.selectParent[0],"a"),n=i||e.item.selectParent[0],o=n.parentNode,r=[];n.firstChild&&o;)r.push(o.insertBefore(n.firstChild,n));o.removeChild(n),r&&1===r.length&&(e.item.selection.startContainer=e.item.selection.getNodeArray(r[r.length-1],!0),e.item.selection.endContainer=e.item.selection.startContainer,e.item.selection.startOffset=0,e.item.selection.endOffset=r[r.length-1].textContent.length),e.item.selection=this.parent.domNode.saveMarker(e.item.selection)}else for(var s=0;s<t.length;s++)for(var a=t[s].querySelectorAll("a"),l=0;l<a.length;l++)this.parent.currentDocument.getSelection().containsNode(a[l],!0)&&(a[l].outerHTML=a[l].innerHTML);e.item.selection.restore(),this.callBack(e)},B7e.prototype.callBack=function(e){e.callBack&&e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},B7e.prototype.destroy=function(){this.removeEventListener()},B7e.prototype.handleLinkFormat=function(e){var t=this.parent.editableElement,i=this.parent.nodeSelection.getRange(t.ownerDocument),n=this.parent.currentDocument.getSelection();if(n&&0!==n.rangeCount){for(var o,r,s,n=new I7e(t),a="BR"===e.enterAction?[this.parent.editableElement]:n.getBlockNode(),l=[],t=["IMG","AUDIO","VIDEO"],n=(1===i.startContainer.nodeType&&(o=(s=i.startContainer.childNodes[i.startOffset])&&-1<t.indexOf(s.nodeName)?s:null),1===i.endContainer.nodeType&&(r=(s=i.endContainer.childNodes[1<i.endContainer.childNodes.length?i.endOffset-1:i.endOffset])&&-1<t.indexOf(s.nodeName)?s:null),{startContainer:i.startContainer,endContainer:i.endContainer,endOffset:i.endOffset,startOffset:i.startOffset,collapsed:i.collapsed}),h=0;h<a.length;h++){var d=a[h];this.unwrapLink(d),d.normalize(),this.applyLinkToBlockNode(d,e,l)}0!==l.length&&(o||r?(t=o?o.parentElement:n.startContainer,s=r?r.parentElement:n.endContainer,this.parent.nodeSelection.setSelectionText(this.parent.currentDocument,t,s,o?0:n.startOffset,n.endOffset)):1===l.length?this.parent.nodeSelection.setSelectionContents(this.parent.currentDocument,l[0]):this.parent.nodeSelection.setSelectionText(this.parent.currentDocument,l[0],l[l.length-1],0,l[l.length-1].textContent.length))}},B7e.prototype.applyLinkToBlockNode=function(e,t,i){for(var n=new I7e(this.parent.editableElement),o=n.getTextNodes(e),r=e.querySelectorAll("*"),s=this.parent.nodeSelection.getRange(this.parent.currentDocument),a=[],l=0===r.length,h=0;h<o.length;h++){var d,p=void 0,c=o[h],u=(new tUe).getFormattedNode(c,"fontcolor",e);l?(p=this.getSplitNode(c,s),i.push(b7e.Wrap(p,this.createAchorNode(t)))):u?(0<a.length&&this.replaceElementsWithAnchor(a,this.createAchorNode(t),t.enterAction),p=this.getSplitNode(u,s),s.intersectsNode(u)&&(b7e.Wrap(u.firstChild,this.createAchorNode(t)),i.push(c))):(u="#text"===s.startContainer.nodeName&&s.startContainer===c&&0!==s.startOffset,d="#text"===s.endContainer.nodeName&&s.endContainer===c&&s.endOffset!==s.startContainer.textContent.length,0<h&&("BR"===t.enterAction?this.parent.editableElement:n.getParentBlockNode(c))!==e&&this.replaceElementsWithAnchor(a,this.createAchorNode(t),t.enterAction),(u||d)&&(u=n.getTopMostNode(c),p=this.getSplitNode(u,s)),i.push(c),a.push(c),h===o.length-1&&this.replaceElementsWithAnchor(a,this.createAchorNode(t),t.enterAction))}},B7e.prototype.unwrapLink=function(e){var t=e.querySelectorAll("a");if(0!==t.length){for(var i,n=this.parent.nodeSelection.getRange(this.parent.currentDocument),e=n.startContainer,o=n.endContainer,r=n.startOffset,s=n.endOffset,a=(this.parent.nodeSelection.save(n,this.parent.currentDocument),this.parent.nodeSelection.get(this.parent.currentDocument)),l=0;l<t.length;l++)n.intersectsNode(t[l])&&(a.containsNode(t[l],!1)?b7e.unwrap(t[l]):((i=t[l]&&t[l].textContent)&&n.startContainer.textContent&&-1!==i.indexOf(n.startContainer.textContent)&&(r=0),i=this.getSplitNode(t[l],n),b7e.unwrap(i)));n.setStart(e,r),n.setEnd(o,s)}},B7e.prototype.replaceElementsWithAnchor=function(e,t,i){for(var n=new I7e(this.parent.editableElement),o=[],r=0;r<e.length;r++){var s=e[r];o.push(n.getTopMostNode(s))}var a,l=o[e.length=0],h=t.cloneNode(!0);l.parentElement.insertBefore(t,l);for(var d=0;d<o.length;d++){var p,c,u,g,m,f=o[d];"BR"!==i||0===d?t.appendChild(f):je(a)||(p=f.nextSibling&&"BR"===f.nextSibling.nodeName||n.isBlockNode(f.nextSibling),c=f.previousSibling&&"BR"===f.previousSibling.nodeName||n.isBlockNode(f.previousSibling),u=this.parent.editableElement.lastChild===f,g=n.isBlockNode(f.parentElement),p&&c)?(m=h.cloneNode(!0),f.parentElement.insertBefore(m,f),m.appendChild(f),a=m):u?(m=h.cloneNode(!0),f.parentElement.insertBefore(m,f),m.appendChild(f)):g?(m=h.cloneNode(!0),f.parentElement.insertBefore(m,f),m.appendChild(f),a=m):a.appendChild(f)}},B7e.prototype.getSplitNode=function(e,t){var i=new C7e,i=t.collapsed?i.SplitNode(t,e,!0):i.GetSpliceNode(t,e);return i};var P7e=B7e;function B7e(e){this.parent=e,this.drop=this.dragDrop.bind(this),this.enter=this.dragEnter.bind(this),this.start=this.dragStart.bind(this),this.addEventListener()}L7e.prototype.addEventListener=function(){this.parent.observer.on(SUe,this.applyAlignment,this),this.parent.observer.on(n7e,this.onKeyDown,this),this.parent.observer.on(v7e,this.destroy,this)},L7e.prototype.removeEventListener=function(){this.parent.observer.off(SUe,this.applyAlignment),this.parent.observer.off(n7e,this.onKeyDown),this.parent.observer.off(v7e,this.destroy)},L7e.prototype.onKeyDown=function(e){switch(e.event.action){case"justify-center":this.applyAlignment({subCommand:"JustifyCenter",callBack:e.callBack}),e.event.preventDefault();break;case"justify-full":this.applyAlignment({subCommand:"JustifyFull",callBack:e.callBack}),e.event.preventDefault();break;case"justify-left":this.applyAlignment({subCommand:"JustifyLeft",callBack:e.callBack}),e.event.preventDefault();break;case"justify-right":this.applyAlignment({subCommand:"JustifyRight",callBack:e.callBack}),e.event.preventDefault()}},L7e.prototype.getTableNode=function(e){return[z(e.startContainer.nodeType===Node.ELEMENT_NODE?e.startContainer:e.startContainer.parentNode,"td,th")]},L7e.prototype.applyAlignment=function(e){var t="Table"===e.value,i=this.parent.nodeSelection.getRange(this.parent.currentDocument),n=this.parent.nodeSelection.save(i,this.parent.currentDocument);if(t)gt(this.getTableNode(i)[0],{"text-align":this.alignments[e.subCommand]});else{this.parent.domNode.setMarker(n);var o=this.parent.domNode.blockNodes();"BR"===e.enterAction&&(o=this.parent.domNode.convertToBlockNodes(o,!1));for(var r=0;r<o.length;r++)gt(o[r],{"text-align":this.alignments[e.subCommand]});for(var s=this.parent.domNode.getImageTagInSelection(),r=0;r<s.length;r++){var a=[];a.push(s[r]),this.parent.imgObj.imageCommand({item:{selectNode:a},subCommand:e.subCommand,value:e.subCommand,callBack:e.callBack,selector:e.selector})}this.parent.editableElement.focus({preventScroll:!0}),n=this.parent.domNode.saveMarker(n),WUe()&&QUe(this.parent.editableElement,e.selector),n.restore()}e.callBack&&e.callBack({requestType:e.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:t?this.getTableNode(i):this.parent.domNode.blockNodes()})},L7e.prototype.destroy=function(){this.removeEventListener()};var F7e=L7e;function L7e(e){this.alignments={JustifyLeft:"left",JustifyCenter:"center",JustifyRight:"right",JustifyFull:"justify"},this.parent=e,this.addEventListener()}O7e.prototype.addEventListener=function(){this.parent.observer.on(AUe,this.applyIndents,this),this.parent.observer.on(n7e,this.onKeyDown,this),this.parent.observer.on(v7e,this.destroy,this)},O7e.prototype.removeEventListener=function(){this.parent.observer.off(AUe,this.applyIndents),this.parent.observer.off(n7e,this.onKeyDown),this.parent.observer.off(v7e,this.destroy)},O7e.prototype.onKeyDown=function(e){switch(e.event.action){case"indents":this.applyIndents({subCommand:"Indent",callBack:e.callBack}),e.event.preventDefault();break;case"outdents":this.applyIndents({subCommand:"Outdent",callBack:e.callBack}),e.event.preventDefault()}},O7e.prototype.applyIndents=function(e){for(var t=this.parent.editableElement,i=t.classList.contains("e-rtl"),n=this.parent.nodeSelection.getRange(this.parent.currentDocument),n=this.parent.nodeSelection.save(n,this.parent.currentDocument),o=(this.parent.domNode.setMarker(n),this.parent.domNode.blockNodes()),r=(o="BR"===e.enterAction?this.parent.domNode.convertToBlockNodes(o,!1):o).slice(),s=[],a=0;a<r.length;a++)"LI"!==r[a].tagName&&"LI"===r[a].parentNode.tagName?(o.splice(o.indexOf(r[a]),1),s.push(r[a].parentNode)):"LI"===r[a].tagName&&(o.splice(o.indexOf(r[a]),1),s.push(r[a]));0<s.length&&this.parent.observer.notify(n7e,{event:{preventDefault:function(){},stopPropagation:function(){},shiftKey:"Indent"!==e.subCommand,which:9,action:"indent"}});for(a=0;a<o.length;a++){var l=o[a],h=i?l.style.marginRight:l.style.marginLeft,d=void 0,d="Indent"===e.subCommand?""===h?this.indentValue+"px":parseInt(h,null)+this.indentValue+"px":""===h||"0px"===h||"0in"===h?"":parseInt(h,null)-this.indentValue<0?"0px":parseInt(h,null)-this.indentValue+"px";i?l.style.marginRight=d:l.style.marginLeft=d}t.focus({preventScroll:!0}),WUe()&&QUe(t,e.selector),(0===o.length||o[0]&&"TABLE"!==o[0].nodeName)&&(n=this.parent.domNode.saveMarker(n)).restore(),e.callBack&&e.callBack({requestType:e.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.domNode.blockNodes()})},O7e.prototype.destroy=function(){this.removeEventListener()};var R7e=O7e;function O7e(e){this.indentValue=20,this.parent=e,this.addEventListener()}var N7e="e-imgright",V7e="e-imgleft",_7e="e-imgcenter",H7e="e-video-right",z7e="e-video-left",j7e="e-video-center",W7e="e-imgbreak",Q7e="e-audio-break",U7e="e-video-break",q7e="e-img-caption",G7e="e-caption-inline",Y7e="e-imginline",X7e="e-audio-inline",K7e="e-clickelem",J7e="e-video-clickelem",Z7e="e-rte-audio",$7e="e-rte-video",e9e="e-audio-wrap",t9e="e-video-wrap",i9e="e-embed-video-wrap",n9e="e-audio-focus",o9e="e-video-focus",r9e="e-video-inline",s9e=(a9e.prototype.addEventListener=function(){this.parent.observer.on(nUe,this.imageCommand,this),this.parent.observer.on(v7e,this.destroy,this)},a9e.prototype.removeEventListener=function(){this.parent.observer.off(nUe,this.imageCommand),this.parent.observer.off(v7e,this.destroy)},a9e.prototype.imageCommand=function(e){switch(e.value.toString().toLowerCase()){case"image":case"replace":this.createImage(e);break;case"insertlink":this.insertImageLink(e);break;case"openimagelink":this.openImageLink(e);break;case"editimagelink":this.editImageLink(e);break;case"removeimagelink":this.removeImageLink(e);break;case"remove":this.removeImage(e);break;case"alttext":this.insertAltTextImage(e);break;case"dimension":this.imageDimension(e);break;case"caption":this.imageCaption(e);break;case"justifyleft":this.imageJustifyLeft(e);break;case"justifycenter":this.imageJustifyCenter(e);break;case"justifyright":this.imageJustifyRight(e);break;case"inline":this.imageInline(e);break;case"break":this.imageBreak(e)}},a9e.prototype.createImage=function(i){var e,n,o,r=this,t=!1;i.item.url=je(i.item.url)||"undefined"===i.item.url?i.item.src:i.item.url,je(i.item.selectParent)||"IMG"!==i.item.selectParent[0].tagName?(e=Q("img"),this.setStyle(e,i),je(i.item.selection)||i.item.selection.restore(),je(i.selector)||"pasteCleanupModule"!==i.selector?A7e.Insert(this.parent.currentDocument,e,this.parent.editableElement):je(this.parent.currentDocument)||i.callBack({requestType:"Images",editorMode:"HTML",event:i.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:[e]})):(e=i.item.selectParent[0],this.setStyle(e,i,t=!0)),i.callBack&&(je(i.selector)||!je(i.selector)&&"pasteCleanupModule"!==i.selector)&&(e=this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)[0],n="Replace"===i.value||t?i.item.selectParent[0]:F.isIE?e.previousSibling:e.previousElementSibling,o=function(){var e,t;je(r.parent.currentDocument)||(r.parent.userAgentData.isSafari()&&qUe(r.parent.currentDocument,r.parent.editableElement),e=n.getAttribute("width"),t=n.getAttribute("height"),!je(e)&&"auto"!==e||n.setAttribute("width",n.offsetWidth.toString()),!je(t)&&"auto"!==t||n.setAttribute("height",n.offsetHeight.toString()),i.callBack({requestType:"Replace"===i.value?i.item.subCommand="Replace":"Images",editorMode:"HTML",event:i.event,range:r.parent.nodeSelection.getRange(r.parent.currentDocument),elements:[n]})),n.removeEventListener("load",o)},n.addEventListener("load",o))},a9e.prototype.setStyle=function(e,t,i){var n;if(je(t.item.url)||e.setAttribute("src",t.item.url),i)for(var o={"e-imgcenter":"e-imgcenter","e-imgright":"e-imgright","e-imgleft":"e-imgleft"},r=e.classList,s=0;s<r.length;s++)je(o[r[s]])||(n=o[r[s]]);e.setAttribute("class","e-rte-image"+(je(t.item.cssClass)?"":" "+t.item.cssClass)+(je(n)?"":" "+n)),je(t.item.altText)||e.setAttribute("alt",t.item.altText.replace(/\.[a-zA-Z0-9]+$/,"")),je(t.item.width)||je(t.item.width.width)||e.setAttribute("width",this.calculateStyleValue(t.item.width.width)),je(t.item.height)||je(t.item.height.height)||e.setAttribute("height",this.calculateStyleValue(t.item.height.height)),je(t.item.width)||je(t.item.width.minWidth)||(e.style.minWidth=this.calculateStyleValue(t.item.width.minWidth)),je(t.item.width)||je(t.item.width.maxWidth)||(e.style.maxWidth=this.calculateStyleValue(t.item.width.maxWidth)),je(t.item.height)||je(t.item.height.minHeight)||(e.style.minHeight=this.calculateStyleValue(t.item.height.minHeight)),je(t.item.height)||je(t.item.height.maxHeight)||(e.style.maxHeight=this.calculateStyleValue(t.item.height.maxHeight))},a9e.prototype.calculateStyleValue=function(e){e="string"==typeof e&&(e.indexOf("px")||e.indexOf("%")||e.indexOf("auto"))?e:e+"px";return e},a9e.prototype.insertImageLink=function(e){var t=Q("a",{attrs:{href:e.item.url}});e.item.selectNode[0].parentElement.classList.contains("e-img-wrap")&&(e.item.selection.restore(),t.setAttribute("contenteditable","true")),t.appendChild(e.item.selectNode[0]),je(e.item.target)||t.setAttribute("target",e.item.target),je(e.item.ariaLabel)||t.setAttribute("aria-label",e.item.ariaLabel),A7e.Insert(this.parent.currentDocument,t,this.parent.editableElement),this.callBack(e)},a9e.prototype.openImageLink=function(e){document.defaultView.open(e.item.url,e.item.target),this.callBack(e)},a9e.prototype.removeImageLink=function(e){var t,i,n,o=e.item.selectParent[0];o.classList.contains("e-img-caption")?(t=ge(".e-img-wrap",o),n=(i=ge(".e-img-inner",o)).cloneNode(!0),G(ge("a",o)),G(i),t.appendChild(e.item.insertElement),t.appendChild(n)):(G(o),F.isIE&&e.item.selection&&e.item.selection.restore(),A7e.Insert(this.parent.currentDocument,e.item.insertElement,this.parent.editableElement)),this.callBack(e)},a9e.prototype.editImageLink=function(e){e.item.selectNode[0].parentElement.href=e.item.url,je(e.item.target)?(e.item.selectNode[0].parentElement.removeAttribute("target"),e.item.selectNode[0].parentElement.removeAttribute("aria-label")):(e.item.selectNode[0].parentElement.target=e.item.target,e.item.selectNode[0].parentElement.setAttribute("aria-label",e.item.ariaLabel)),this.callBack(e)},a9e.prototype.removeImage=function(e){z(e.item.selectNode[0],"a")&&("A"!==e.item.selectNode[0].parentElement.nodeName||je(e.item.selectNode[0].parentElement.innerText))?G(z(e.item.selectNode[0],"a")):je(z(e.item.selectNode[0],"."+q7e))?G(e.item.selectNode[0]):G(z(e.item.selectNode[0],"."+q7e)),this.callBack(e)},a9e.prototype.insertAltTextImage=function(e){e.item.selectNode[0].setAttribute("alt",e.item.altText),this.callBack(e)},a9e.prototype.imageDimension=function(e){var t=e.item.selectNode[0];t.style.height="",t.style.width="","auto"!==e.item.width?t.style.width=T(e.item.width):t.removeAttribute("width"),"auto"!==e.item.height?t.style.height=T(e.item.height):t.removeAttribute("height"),this.callBack(e)},a9e.prototype.imageCaption=function(e){A7e.Insert(this.parent.currentDocument,e.item.insertElement,this.parent.editableElement),this.callBack(e)},a9e.prototype.imageJustifyLeft=function(e){var t=e.item.selectNode[0];je(t)||(t.removeAttribute("class"),U([t],"e-rte-image"),je(z(t,"."+q7e))||(q([z(t,"."+q7e)],N7e),U([z(t,"."+q7e)],V7e)),"A"===t.parentElement.nodeName?(q([t.parentElement],N7e),U([t.parentElement],V7e),U([t],V7e)):null!=t.parentElement.nextElementSibling?(U([t],V7e),t.parentElement.nextElementSibling.style.clear="left"):U([t],V7e),this.callBack(e))},a9e.prototype.imageJustifyCenter=function(e){var t=e.item.selectNode[0];je(t)||(t.removeAttribute("class"),U([t],"e-rte-image"),je(z(t,"."+q7e))||(q([z(t,"."+q7e)],V7e),q([z(t,"."+q7e)],N7e),U([z(t,"."+q7e)],_7e)),"A"===t.parentElement.nodeName&&(q([t.parentElement],V7e),q([t.parentElement],N7e),U([t.parentElement],_7e)),U([t],_7e),this.callBack(e))},a9e.prototype.imageJustifyRight=function(e){var t=e.item.selectNode[0];je(t)||(t.removeAttribute("class"),U([t],"e-rte-image"),je(z(t,"."+q7e))||(q([z(t,"."+q7e)],V7e),U([z(t,"."+q7e)],N7e)),"A"===t.parentElement.nodeName?(q([t.parentElement],V7e),U([t.parentElement],N7e),U([t],N7e)):null!=t.parentElement.nextElementSibling?(U([t],N7e),t.parentElement.nextElementSibling.style.clear="right"):U([t],N7e),this.callBack(e))},a9e.prototype.imageInline=function(e){var t=e.item.selectNode[0];t.removeAttribute("class"),U([t],"e-rte-image"),U([t],Y7e),je(z(t,"."+q7e))||(q([z(t,"."+q7e)],W7e),q([z(t,"."+q7e)],_7e),q([z(t,"."+q7e)],V7e),q([z(t,"."+q7e)],N7e),U([z(t,"."+q7e)],G7e)),this.callBack(e)},a9e.prototype.imageBreak=function(e){var t=e.item.selectNode[0];t.removeAttribute("class"),U([t],W7e),U([t],"e-rte-image"),je(z(t,"."+q7e))||(q([z(t,"."+q7e)],G7e),q([z(t,"."+q7e)],_7e),q([z(t,"."+q7e)],V7e),q([z(t,"."+q7e)],N7e),U([z(t,"."+q7e)],W7e)),this.callBack(e)},a9e.prototype.callBack=function(e){e.callBack&&e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},a9e.prototype.destroy=function(){this.removeEventListener()},a9e);function a9e(e){this.parent=e,this.addEventListener()}h9e.prototype.addEventListener=function(){this.parent.observer.on(oUe,this.audioCommand,this),this.parent.observer.on(v7e,this.destroy,this)},h9e.prototype.removeEventListener=function(){this.parent.observer.off(oUe,this.audioCommand),this.parent.observer.off(v7e,this.destroy)},h9e.prototype.audioCommand=function(e){var t,i,n=e.value.toString().toLowerCase();switch("inline"!==n&&"break"!==n&&"audioremove"!==n||(i=(t=e.item.selectNode[0]).closest("."+e9e)),n){case"audio":case"audioreplace":this.createAudio(e);break;case"inline":t.removeAttribute("class"),i.style.display="inline-block",U([t],[Z7e,X7e,n9e]),this.callBack(e);break;case"break":t.removeAttribute("class"),i.style.display="block",U([t],[Q7e,Z7e,n9e]),this.callBack(e);break;case"audioremove":G(i||t),this.callBack(e)}},h9e.prototype.createAudio=function(e){var t,i,n,o,r,s=this,a=!1;!je(e.item.selectParent)&&e.item.selectParent[0].classList&&(e.item.selectParent[0].classList.contains(K7e)||e.item.selectParent[0].classList.contains(e9e)||"AUDIO"===e.item.selectParent[0].tagName)?(o=e.item.selectParent[0].querySelector("source"),this.setStyle(o,e),a=!0):(o=Q("span",{className:e9e,attrs:{contentEditable:"false",title:je(e.item.title)?je(e.item.fileName)?"":e.item.fileName:e.item.title}}),i=Q("audio",{className:Z7e+" "+X7e,attrs:{controls:""}}),t=Q("source"),n=Q("span",{className:K7e}),this.setStyle(t,e),i.appendChild(t),n.appendChild(i),o.appendChild(n),je(e.item.selection)||e.item.selection.restore(),A7e.Insert(this.parent.currentDocument,o,this.parent.editableElement),je(e.item.selection)||(t=e.item.selection.getRange(this.parent.currentDocument),i=document.createTextNode(" "),n=this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)[0],o.parentNode.insertBefore(i,n.nextSibling),e.item.selection.save(t,this.parent.currentDocument))),e.callBack&&(je(e.selector)||!je(e.selector)&&"pasteCleanupModule"!==e.selector)&&(o=this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)[0],(r="AudioReplace"===e.value||a?"audio"===e.item.selectParent[0].tagName.toLowerCase()?e.item.selectParent[0]:e.item.selectParent[0].querySelector("audio"):F.isIE?o:o.querySelector("audio")).addEventListener("loadeddata",function(){"AudioReplace"===e.value&&a||je(s.parent.currentDocument)||(s.parent.userAgentData.isSafari()&&qUe(s.parent.currentDocument,s.parent.editableElement),e.callBack({requestType:"Audios",editorMode:"HTML",event:e.event,range:s.parent.nodeSelection.getRange(s.parent.currentDocument),elements:[r]}))}),a)&&r.load()},h9e.prototype.setStyle=function(e,t){je(t.item.url)||e.setAttribute("src",t.item.url);var i=t.item.fileName?t.item.fileName.split(".").pop().toLowerCase():t.item.url?t.item.url.split(".").pop().toLowerCase():"";e.type="opus"===i?"audio/ogg":"m4a"===i?"audio/mp4":t.item.fileName&&0<t.item.fileName.split(".").length?"audio/"+t.item.fileName.split(".")[t.item.fileName.split(".").length-1]:t.item.url&&0<t.item.url.split(".").length?"audio/"+t.item.url.split(".")[t.item.url.split(".").length-1]:""},h9e.prototype.callBack=function(e){e.callBack&&e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},h9e.prototype.destroy=function(){this.removeEventListener()};var l9e=h9e;function h9e(e){this.parent=e,this.addEventListener()}p9e.prototype.addEventListener=function(){this.parent.observer.on(rUe,this.videoCommand,this),this.parent.observer.on(v7e,this.destroy,this)},p9e.prototype.removeEventListener=function(){this.parent.observer.off(rUe,this.videoCommand),this.parent.observer.off(v7e,this.destroy)},p9e.prototype.videoCommand=function(e){var t,i,n,o="",r=e.value.toString().toLowerCase();switch("video"!==r&&"videoreplace"!==r&&(i=(t=e.item.selectNode[0]).closest("."+i9e),n=t.closest("."+J7e)),t&&(o=t.classList.contains("e-rte-embed-url")?"e-rte-embed-url":""),r){case"video":case"videoreplace":this.createVideo(e);break;case"videodimension":this.videoDimension(e);break;case"inline":t.removeAttribute("class"),i&&(i.style.display="inline-block"),n&&(t.parentElement.style.cssFloat=""),U([t],[$7e,r9e,o9e]),this.callBack(e);break;case"break":t.removeAttribute("class"),i&&(i.style.display="block"),n&&(t.parentElement.style.cssFloat=""),U([t],[U7e,$7e,o9e]),this.callBack(e);break;case"justifyleft":t.removeAttribute("class"),i&&(i.style.display="block"),n?t.parentElement.style.cssFloat="left":null!=t.parentElement.nextElementSibling?(U([t],""===o?[$7e,z7e]:[$7e,z7e,o]),t.parentElement.nextElementSibling.style.clear="left"):U([t],""===o?[$7e,z7e]:[$7e,z7e,o]),this.callBack(e);break;case"justifycenter":t.removeAttribute("class"),i&&(i.style.display="block"),n&&(t.parentElement.style.cssFloat=""),U([t],""===o?[$7e,j7e]:[$7e,j7e,o]),this.callBack(e);break;case"justifyright":t.removeAttribute("class"),i&&(i.style.display="block"),n?t.parentElement.style.cssFloat="right":null!=t.parentElement.nextElementSibling?(U([t],""===o?[$7e,H7e]:[$7e,z7e,o]),t.parentElement.nextElementSibling.style.clear="right"):U([t],""===o?[$7e,H7e]:[$7e,H7e,o]),this.callBack(e);break;case"videoremove":G(t.parentElement),this.callBack(e)}},p9e.prototype.wrapVideo=function(e){var t,i,n;return e.item.isEmbedUrl?(t=Q("span",{className:i9e,attrs:{contentEditable:"false"}}),i=Q("span",{className:J7e}),(n=Q("template")).innerHTML=e.item.fileName,i.appendChild(n.content),this.vidElement=n=i.firstElementChild,this.setStyle(n,e,this.vidElement),t.style.display=e.item.cssClass===r9e?"inline-block":"block",t.appendChild(i)):(t=Q("span",{className:t9e,attrs:{contentEditable:"false",title:je(e.item.title)?je(e.item.fileName)?"":e.item.fileName:e.item.title}}),this.vidElement=Q("video",{className:$7e+" "+r9e,attrs:{controls:""}}),n=Q("source"),this.setStyle(n,e,this.vidElement),this.vidElement.appendChild(n),t.appendChild(this.vidElement)),t},p9e.prototype.createVideo=function(e){var t,i,n,o,r,s,a=this,l=!1;"VideoReplace"!==e.value||je(e.item.selectParent)||"VIDEO"!==e.item.selectParent[0].tagName?"VideoReplace"===e.value&&!je(e.item.selectParent)&&je(e.item.selectParent[0].querySelector("iframe"))&&e.item.selectParent[0].classList&&e.item.selectParent[0].classList.contains(J7e)?(e.item.selectParent[0].innerHTML=e.item.fileName,this.setStyle(e.item.selectParent[0].firstElementChild,e,e.item.selectParent[0].firstElementChild)):"VideoReplace"!==e.value||je(e.item.selectParent)||je(e.item.selectParent[0].querySelector("iframe"))||e.item.isEmbedUrl?(i=(e.item.isEmbedUrl||"VideoReplace"!==e.value||je(i=e.item.selection.range.startContainer.closest(".e-embed-video-wrap"))||i.remove(),this.wrapVideo(e)),je(e.item.selection)||e.item.selection.restore(),A7e.Insert(this.parent.currentDocument,i,this.parent.editableElement),je(e.item.selection)||(t=e.item.selection.getRange(this.parent.currentDocument),o=document.createTextNode(" "),r=this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)[0],i.parentNode.insertBefore(o,r.nextSibling),e.item.selection.save(t,this.parent.currentDocument))):(i=this.wrapVideo(e),(n=e.item.selection.range.startContainer).parentNode.replaceChild(i,n)):e.item.isEmbedUrl?(i=this.wrapVideo(e),(n=e.item.selection.range.startContainer).parentNode.replaceChild(i,n)):(o=e.item.selectParent[0].querySelector("source"),this.setStyle(o,e,o),l=!0),e.callBack&&(je(e.selector)||!je(e.selector)&&"pasteCleanupModule"!==e.selector)&&(r=this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)[0],"VideoReplace"===e.value||l?e.item.isEmbedUrl?e.item.isEmbedUrl?je(i)||(s=i.querySelector("iframe")):s=e.item.selectParent[0].querySelector("iframe"):s=e.item.selectParent[0]:s=e.item.isEmbedUrl?r.querySelector("iframe"):"VIDEO"===r.tagName?r:r.lastElementChild,s.addEventListener("IFRAME"!==s.tagName?"loadeddata":"load",function(){"VideoReplace"===e.value&&l||(e.item.isEmbedUrl&&s&&s.classList.add("e-rte-embed-url"),je(a.parent.currentDocument))||(a.parent.userAgentData.isSafari()&&qUe(a.parent.currentDocument,a.parent.editableElement),e.callBack({requestType:"Videos",editorMode:"HTML",event:e.event,range:a.parent.nodeSelection.getRange(a.parent.currentDocument),elements:[s]}))}),l&&s.load(),-1!==F.userAgent.indexOf("Firefox"))&&(this.vidElement.addEventListener("play",function(){a.editAreaVideoClick(e)}),this.vidElement.addEventListener("pause",function(){a.editAreaVideoClick(e)}))},p9e.prototype.editAreaVideoClick=function(e){e.callBack({requestType:"VideosPlayPause",editorMode:"HTML",event:e.event})},p9e.prototype.setStyle=function(e,t,i){""!==t.item.url&&!je(t.item.url)&&je(e)||"iframe"===e.nodeName.toLowerCase()||e.setAttribute("src",t.item.url),t.item.isEmbedUrl||(e.type=t.item.fileName&&0<t.item.fileName.split(".").length?"video/"+t.item.fileName.split(".")[t.item.fileName.split(".").length-1]:t.item.url&&0<t.item.url.split(".").length?"video/"+t.item.url.split(".")[t.item.url.split(".").length-1]:""),je(t.item.width)||je(t.item.width.width)||i.setAttribute("width",T(t.item.width.width)),je(t.item.height)||je(t.item.height.height)||i.setAttribute("height",T(t.item.height.height)),je(t.item.width)||je(t.item.width.minWidth)||(i.style.minWidth=T(t.item.width.minWidth)),je(t.item.width)||je(t.item.width.maxWidth)||(i.style.maxWidth=T(t.item.width.maxWidth)),je(t.item.height)||je(t.item.height.minHeight)||(i.style.minHeight=T(t.item.height.minHeight)),je(t.item.height)||je(t.item.height.maxHeight)||(i.style.maxHeight=T(t.item.height.maxHeight)),je(t.item.cssClass)||(t.item.cssClass===U7e?(U([i],[U7e]),q([i],[r9e])):(U([i],[r9e]),q([i],[U7e])))},p9e.prototype.videoDimension=function(e){var t=e.item.selectNode[0].classList.contains(J7e)?e.item.selectNode[0].querySelector("iframe"):e.item.selectNode[0];t.style.height="",t.style.width="","auto"!==e.item.width&&(t.style.width=T(e.item.width)),"auto"!==e.item.height&&(t.style.height=T(e.item.height)),this.callBack(e)},p9e.prototype.callBack=function(e){e.callBack&&e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},p9e.prototype.destroy=function(){this.removeEventListener()};var d9e=p9e;function p9e(e){this.parent=e,this.addEventListener()}u9e.prototype.addEventListener=function(){this.parent.observer.on(sUe,this.createTable,this),this.parent.observer.on(lUe,this.insertRow,this),this.parent.observer.on(hUe,this.insertColumn,this),this.parent.observer.on(dUe,this.deleteRow,this),this.parent.observer.on(pUe,this.deleteColumn,this),this.parent.observer.on(cUe,this.removeTable,this),this.parent.observer.on(uUe,this.tableHeader,this),this.parent.observer.on(gUe,this.tableVerticalAlign,this),this.parent.observer.on(mUe,this.cellMerge,this),this.parent.observer.on(yUe,this.HorizontalSplit,this),this.parent.observer.on(fUe,this.VerticalSplit,this),this.parent.observer.on(vUe,this.tableStyle,this),this.parent.observer.on(wUe,this.setBGColor,this),this.parent.observer.on(bUe,this.tableStyle,this),this.parent.observer.on(CUe,this.tableMove,this),this.parent.observer.on(v7e,this.destroy,this)},u9e.prototype.removeEventListener=function(){this.parent.observer.off(sUe,this.createTable),this.parent.observer.off(lUe,this.insertRow),this.parent.observer.off(hUe,this.insertColumn),this.parent.observer.off(dUe,this.deleteRow),this.parent.observer.off(pUe,this.deleteColumn),this.parent.observer.off(cUe,this.removeTable),this.parent.observer.off(uUe,this.tableHeader),this.parent.observer.off(gUe,this.tableVerticalAlign),this.parent.observer.off(mUe,this.cellMerge),this.parent.observer.off(yUe,this.HorizontalSplit),this.parent.observer.off(fUe,this.VerticalSplit),this.parent.observer.off(vUe,this.tableStyle),this.parent.observer.off(bUe,this.tableStyle),this.parent.observer.off(wUe,this.setBGColor),this.parent.observer.off(CUe,this.tableMove),this.parent.observer.off(v7e,this.destroy)},u9e.prototype.createTable=function(e){for(var t,i=Q("table",{className:"e-rte-table"}),n=Q("tbody"),o=(je(e.item.width.width)||(i.style.width=this.calculateStyleValue(e.item.width.width)),je(e.item.width.minWidth)||(i.style.minWidth=this.calculateStyleValue(e.item.width.minWidth)),je(e.item.width.maxWidth)||(i.style.maxWidth=this.calculateStyleValue(e.item.width.maxWidth)),100<parseInt(e.item.width.width,10)?100/e.item.columns:parseInt(e.item.width.width,10)/e.item.columns),r=0;r<e.item.rows;r++){for(var s=Q("tr"),a=0;a<e.item.columns;a++){var l=Q("td");l.appendChild(Q("br")),l.style.width=o+"%",s.appendChild(l)}n.appendChild(s)}return i.appendChild(n),e.item.selection.restore(),A7e.Insert(this.parent.currentDocument,i,this.parent.editableElement),e.item.selection.setSelectionText(this.parent.currentDocument,i.querySelector("td"),i.querySelector("td"),0,0),null!==i.nextElementSibling||i.classList.contains("ignore-table")||(t=void 0,"DIV"===e.enterAction?(t=Q("div")).appendChild(Q("br")):"BR"===e.enterAction?t=Q("br"):(t=Q("p")).appendChild(Q("br")),this.insertAfter(t,i)),i.classList.contains("ignore-table")&&YUe([i],["ignore-table"]),i.querySelector("td").classList.add("e-cell-select"),e.callBack&&e.callBack({requestType:"Table",editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:[i]}),i},u9e.prototype.calculateStyleValue=function(e){e="string"==typeof e&&(0<=e.indexOf("px")||0<=e.indexOf("%")||0<=e.indexOf("auto"))?e:e+"px";return e},u9e.prototype.insertAfter=function(e,t){t.parentNode.insertBefore(e,t.nextSibling)},u9e.prototype.getSelectedCellMinMaxIndex=function(e){for(var t=this.curTable.querySelectorAll(".e-cell-select"),i=0,n=e.length,o=0,r=e[0].length,s=0;i<t.length;i++)var a=this.getCorrespondingIndex(t[i],e),l=this.FindIndex(a[0],a[1],e),n=Math.min(a[0],n),o=Math.max(l[0],o),r=Math.min(a[1],r),s=Math.max(l[1],s);return{startRow:n,endRow:o,startColumn:r,endColumn:s}},u9e.prototype.insertRow=function(e){var t="InsertRowBefore"!==e.item.subCommand,i=e.item.selection.range.startContainer;if("TH"!==i.nodeName&&"TD"!==i.nodeName&&z(i.parentElement,"td,th"),this.curTable=z(this.parent.nodeSelection.range.startContainer.parentElement,"table"),0===this.curTable.querySelectorAll(".e-cell-select").length){var i=this.curTable.rows[this.curTable.rows.length-1],n=i.cloneNode(!0);n.removeAttribute("rowspan"),this.insertAfter(n,i)}else{for(var o,r,s=this.getCorrespondingColumns(),n=this.getSelectedCellMinMaxIndex(s),a=t?n.endRow:n.startRow,l=Q("tr"),h=0<this.curTable.querySelectorAll("th.e-cell-select").length,d=0;d<s[a].length;d++)t&&a<s.length-1&&s[a][d]===s[a+1][d]||!t&&0<a&&s[a][d]===s[a-1][d]?(0===d||0<d&&s[a][d]!==s[a][d-1])&&s[a][d].setAttribute("rowspan",(parseInt(s[a][d].getAttribute("rowspan"),10)+1).toString()):((o=Q("td")).appendChild(Q("br")),l.appendChild(o),(r=s[h&&t&&s[a+1]?a+1:a][d].getAttribute("style"))&&(r=this.cellStyleCleanup(r),o.style.cssText=r));i=void 0,i=h&&t?this.curTable.querySelector("tbody").childNodes[0]:this.curTable.rows[a];"InsertRowBefore"===e.item.subCommand||h?i.parentElement.insertBefore(l,i):this.insertAfter(l,i)}e.item.selection.setSelectionText(this.parent.currentDocument,e.item.selection.range.startContainer,e.item.selection.range.startContainer,0,0),e.callBack&&e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},u9e.prototype.insertColumn=function(e){for(var t=e.item.selection.range.startContainer,i=("TH"!==t.nodeName&&"TD"!==t.nodeName&&(t=z(t.parentElement,"td,th")),z(t,"tr")),n=z(i,"table").rows,o=Array.prototype.slice.call(i.querySelectorAll(":scope > td, :scope > th")).indexOf(t),r=parseInt(e.item.width,10)/i.querySelectorAll(":scope > td, :scope > th").length,s=parseInt(e.item.width,10)/(i.querySelectorAll(":scope > td, :scope > th").length+1),a=z(i,"table"),l=z(i,"table").querySelectorAll("th,td"),h=0;h<l.length;h++)l[h].dataset.oldWidth=l[h].offsetWidth/a.offsetWidth*100+"%";!je(a.style.width)&&""!==a.style.width||(a.style.width=a.offsetWidth+"px");for(h=0;h<n.length;h++){var d,p=(d=n[h].querySelectorAll(":scope > td, :scope > th")[o]).cloneNode(!0),c=p.getAttribute("style");c&&(c=this.cellStyleCleanup(c),p.style.cssText=c),p.innerHTML="",p.appendChild(Q("br")),p.removeAttribute("class"),p.removeAttribute("colspan"),p.removeAttribute("rowspan"),"InsertColumnLeft"===e.item.subCommand?d.parentElement.insertBefore(p,d):this.insertAfter(p,d),p.style.width=s.toFixed(4)+"%",delete p.dataset.oldWidth}for(h=0;h<l.length;h++)l[h].style.width=(Number(l[h].dataset.oldWidth.split("%")[0])*s/r).toFixed(4)+"%",delete l[h].dataset.oldWidth;e.item.selection.setSelectionText(this.parent.currentDocument,t,t,0,0),e.callBack&&e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},u9e.prototype.setBGColor=function(e){for(var t=this.parent.nodeSelection.getRange(this.parent.currentDocument),t=3===t.startContainer.nodeType?t.startContainer.parentNode:t.startContainer,i=(this.curTable=t.closest("table"),this.curTable.querySelectorAll(".e-cell-select")),n=0;n<i.length;n++)i[n].style.backgroundColor=e.value.toString();this.parent.undoRedoManager.saveData(),e.callBack&&e.callBack({requestType:e.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},u9e.prototype.deleteColumn=function(e){var t=e.item.selection.range.startContainer,i=(3===t.nodeType&&(t=z(t.parentElement,"td,th")),z(t,"TH"===t.tagName?"thead":"tbody")),n=i&&Array.prototype.indexOf.call(i.childNodes,t.parentNode);if(this.curTable=z(t,"table"),1===z(t,"tr").querySelectorAll("th,td").length)e.item.selection.restore(),G(z(t.parentElement,"table"));else{for(var o=void 0,r=this.getCorrespondingColumns(),t=this.getSelectedCellMinMaxIndex(r),s=t.startColumn,a=t.endColumn,l=0;l<r.length;l++)for(var h=r[l],d=0;d<h.length;d++){var p=h[d],c=this.getCorrespondingIndex(p,r),u=parseInt(p.getAttribute("colspan"),10)||1;c[1]+(u-1)>=s&&c[1]<=a&&(1<u?p.setAttribute("colspan",(u-1).toString()):(G(p),o=d,F.isIE&&(e.item.selection.setSelectionText(this.parent.currentDocument,this.curTable.querySelector("td"),this.curTable.querySelector("td"),0,0),this.curTable.querySelector("td, th").classList.add("e-cell-select"))))}-1<o&&(i=(t=i.children[n])&&t.children[o<=t.children.length-1?o:o-1])&&(e.item.selection.setSelectionText(this.parent.currentDocument,i,i,0,0),i.classList.add("e-cell-select"))}e.callBack&&("TD"!==(n=this.parent.nodeSelection.getRange(this.parent.currentDocument).startContainer).nodeName&&(t=this.parent.nodeSelection.getRange(this.parent.currentDocument).startOffset,i=n.children[t])&&this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,i,0),e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)}))},u9e.prototype.deleteRow=function(e){var t,i,n,o,r,s=e.item.selection.range.startContainer,a=(3===s.nodeType&&(s=z(s.parentElement,"td,th")),Array.prototype.indexOf.call(s.parentNode.childNodes,s)),l=(this.curTable=z(s,"table"),this.getCorrespondingColumns()),h=this.getSelectedCellMinMaxIndex(l);if(1===this.curTable.rows.length)e.item.selection.restore(),G(z(s.parentElement,"table"));else for(t=h.endRow;t>=h.startRow;t--){for(c=this.curTable.rows[t],i=0;i<l[t].length;i++)if(0!==i&&l[t][i]===l[t][i-1]||1<parseInt(l[t][i].getAttribute("rowspan"),10)&&(1===(n=parseInt(l[t][i].getAttribute("rowspan"),10)-1)?(l[t][i].removeAttribute("rowspan"),(o=this.getMergedRow(this.getCorrespondingColumns())[i])&&((r=o.cloneNode(!0)).innerHTML="<br>",o.parentElement)&&o.parentElement.insertBefore(r,o)):l[t][i].setAttribute("rowspan",n.toString())),t<l.length-1&&l[t][i]===l[t+1][i]&&(0===t||l[t][i]!==l[t-1][i]))for(var d=l[t][i],p=void 0,p=i;0<p&&l[t][p]===l[t][p-1];p--)0===p?this.curTable.rows[t+1].prepend(d):l[t+1][p-1].insertAdjacentElement("afterend",d);var c=c.rowIndex,c=(this.curTable.deleteRow(c),je(this.curTable.rows[c])?this.curTable.querySelectorAll("tbody tr")[c-1]:this.curTable.querySelectorAll("tbody tr")[c]),c=c&&c.querySelectorAll("td")[a];(c?(e.item.selection.setSelectionText(this.parent.currentDocument,c,c,0,0),c):(e.item.selection.setSelectionText(this.parent.currentDocument,this.curTable.querySelector("td"),this.curTable.querySelector("td"),0,0),this.curTable.querySelector("td, th"))).classList.add("e-cell-select")}e.callBack&&e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},u9e.prototype.getMergedRow=function(e){for(var t,i=0;i<e.length;i++)e[i].length!==this.curTable.rows[0].childNodes.length&&(t=e[i]);return t},u9e.prototype.removeTable=function(e){var t=e.item.selection.range.startContainer,t=z((3===t.nodeType?t.parentNode:t).parentElement,"table");t&&(G(t),e.item.selection.restore()),e.callBack&&e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},u9e.prototype.tableHeader=function(e){var t=!1,i=e.item.selection.range.startContainer,n=z((3===i.nodeType?i.parentNode:i).parentElement,"table");if([].slice.call(n.childNodes).forEach(function(e){"THEAD"===e.nodeName&&(t=!0)}),n&&!t){for(var o=n.querySelector("tr").childElementCount,r=0,s=0;s<o;s++)r+=parseInt(n.querySelector("tr").children[s].getAttribute("colspan"),10)||1;for(var a=n.createTHead().insertRow(0),l=0;l<r;l++){var h=Q("th");h.appendChild(Q("br")),a.appendChild(h)}}else n.deleteTHead();e.callBack&&e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},u9e.prototype.tableVerticalAlign=function(e){var t="";switch(e.item.subCommand){case"AlignTop":t="top";break;case"AlignMiddle":t="middle";break;case"AlignBottom":t="bottom"}(e.item.tableCell.style.verticalAlign=t)&&""!==t&&e.item.tableCell.getAttribute("valign")&&e.item.tableCell.removeAttribute("valign"),e.callBack&&e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},u9e.prototype.cellMerge=function(e){je(this.curTable)&&(this.curTable=z(this.parent.nodeSelection.range.startContainer.parentElement,"table"));var t=this.curTable.querySelectorAll(".e-cell-select");if(!(t.length<2)){this.mergeCellContent();for(var i=this.getSelectedMinMaxIndexes(this.getCorrespondingColumns()),n=t[0],o=n.parentElement.querySelectorAll(".e-cell-select"),r=0,s=0;s<o.length;s++){var a=o[s].offsetHeight;r<a&&(r=a)}i.startColumn<i.endColumn&&n.setAttribute("colspan",(i.endColumn-i.startColumn+1).toString()),i.startRow<i.endRow&&n.setAttribute("rowspan",(i.endRow-i.startRow+1).toString());for(var l,h,d=0,s=o.length-1;0<=s;s--)je(o[s].style.width)||""===o[s].style.width?(d+=o[s].offsetWidth/this.curTable.offsetWidth*100,h="%"):(h||(h=(l=o[s].style.width.match(/^([\d.]+)([a-z%]+)$/i))?l[2]:"%"),d+=parseFloat(o[s].style.width));n.style.width=d+h,n.style.height=r+"px";for(var p=1;p<=t.length-1;p++)G(t[p]);for(p=0;p<this.curTable.rows.length;p++)""===this.curTable.rows[p].innerHTML.trim()&&G(this.curTable.rows[p]);YUe(this.curTable.querySelectorAll("table td, table th"),"e-multi-cells-select"),YUe(this.curTable.querySelectorAll("table td, table th"),"e-cell-select-end"),this.updateRowSpanStyle(i.startRow,i.endRow,this.getCorrespondingColumns()),this.updateColSpanStyle(i.startColumn,i.endColumn,this.getCorrespondingColumns()),e.item.selection.setSelectionText(this.parent.currentDocument,e.item.selection.range.startContainer,e.item.selection.range.startContainer,0,0),this.parent.nodeSelection&&n&&this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,n,0),e.callBack&&e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})}},u9e.prototype.updateColSpanStyle=function(e,t,i){var n,o,r,s,a,l=0,h=i;if(e<(t=Math.min(t,h[0].length-1))){for(o=e;o<=t;o++)if(s=Math.min(parseInt(h[0][o].getAttribute("colspan"),10)||1,t-e+1),!(e<o&&h[0][o]===h[0][o-1])&&1<s&&h[0][o]===h[0][o+1])for(l=s-1,n=1;n<h.length;n++){if(h[n][o]!==h[n-1][o])for(r=o;r<o+s;r++)if(1<(a=parseInt(h[n][r].getAttribute("colspan"),10)||1)&&h[n][r]===h[n][r+1])r+=l=Math.min(l,a-1);else if(0===(l=Math.max(0,l-1)))break;if(!l)break}l&&this.updateCellAttribute(h,l,"colspan",0,h.length-1,e,t)}},u9e.prototype.updateRowSpanStyle=function(e,t,i){var n,o,r,s,a=0,l=0,h=i;if(e<(t=Math.min(t,h.length-1))){for(n=e;n<=t;n++)if(!(e<n&&h[n][0]===h[n-1][0])&&h[n][0]&&1<(a=Math.min(parseInt(h[n][0].getAttribute("rowspan"),10)||1,t-e+1))&&h[n][0]===h[n+1][0])for(l=a-1,o=1;o<h[0].length;o++)if(h[n][o]!==h[n][o-1]){for(r=n;r<n+a;r++)if(1<(s=parseInt(h[r][o].getAttribute("rowspan"),10)||1)&&h[r][o]===h[r+1][o])r+=l=Math.min(l,s-1);else if(!(l=Math.max(0,l-1)))break;if(!l)break}l&&this.updateCellAttribute(h,l,"rowspan",e,t,0,h[0].length-1)}},u9e.prototype.updateCellAttribute=function(e,t,i,n,o,r,s){for(var a,l,h=n;h<=o;h++)for(a=r;a<=s;a++)l=parseInt(e[h][a].getAttribute(i),10)||1,(n<h&&e[h][a]===e[h-1][a]||r<a&&e[h][a]===e[h][a-1]||1<l)&&(1<l-t?e[h][a].setAttribute(i,(l-t).toString()):e[h][a].removeAttribute(i))},u9e.prototype.mergeCellContent=function(){for(var e=this.curTable.querySelectorAll(".e-cell-select"),t="<br>"===e[0].innerHTML?"":e[0].innerHTML,i=1;i<e.length;i++)"<br>"!==e[i].innerHTML&&(t=t?t+"<br>"+e[i].innerHTML:t+e[i].innerHTML);e[0].innerHTML=t},u9e.prototype.getSelectedMinMaxIndexes=function(e){var t=this.curTable.querySelectorAll(".e-cell-select");if(0<t.length){for(var i=e.length,n=0,o=e[0].length,r=0,s=0;s<t.length;s++)var a=this.getCorrespondingIndex(t[s],e),l=this.FindIndex(a[0],a[1],e),i=Math.min(a[0],i),n=Math.max(l[0],n),o=Math.min(a[1],o),r=Math.max(l[1],r);return{startRow:i,endRow:n,startColumn:o,endColumn:r}}return null},u9e.prototype.HorizontalSplit=function(e){var t=e.item.selection.range.startContainer;if(this.curTable=z(t.parentElement,"table"),!(1<this.curTable.querySelectorAll(".e-cell-select").length)){this.activeCell=this.curTable.querySelector(".e-cell-select");var t=this.activeCell.cloneNode(!0),i=(t.removeAttribute("class"),t.innerHTML="</br>",this.getCorrespondingIndex(this.activeCell,this.getCorrespondingColumns())),n=this.getCorrespondingColumns(),o=this.activeCell.getAttribute("rowspan")?parseInt(this.activeCell.getAttribute("rowspan"),10):1;if(1<o){for(var r=Math.ceil(o/2),s=(1<r?this.activeCell.setAttribute("rowspan",r.toString()):this.activeCell.removeAttribute("rowspan"),1<o-r?t.setAttribute("rowspan",(o-r).toString()):t.removeAttribute("rowspan"),void 0),a=i[0]+Math.ceil(o/2),s=0===i[1]?i[1]:i[1]-1;0<=s&&(n[a][s]===n[a][s-1]||0<a&&n[a][s]===n[a-1][s]);)s--;-1===s?this.curTable.rows[a].firstChild?this.curTable.rows[a].prepend(t):this.curTable.appendChild(t):n[a][s].insertAdjacentElement("afterend",t)}else{for(var r=Q("tr"),l=(r.appendChild(t),n[i[0]]),h=0;h<=l.length-1;h++)l[h]!==l[h-1]&&l[h]!==this.activeCell&&l[h].setAttribute("rowspan",((parseInt(l[h].getAttribute("rowspan"),10)?parseInt(l[h].getAttribute("rowspan"),10):1)+1).toString());this.activeCell.parentNode.insertAdjacentElement("afterend",r)}e.callBack&&e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})}},u9e.prototype.VerticalSplit=function(e){var t=e.item.selection.range.startContainer;if(this.curTable=z(t.parentElement,"table"),!(1<this.curTable.querySelectorAll(".e-cell-select").length)){this.activeCell=this.curTable.querySelector(".e-cell-select");var i=this.curTable.rows,t=this.activeCell.cloneNode(!0),n=(t.removeAttribute("class"),t.innerHTML="</br>",this.getCorrespondingIndex(this.activeCell,this.getCorrespondingColumns())),o=this.getCorrespondingColumns(),r=parseInt(this.activeCell.getAttribute("colspan"),10)||1;if(1<r){var s=Math.ceil(r/2),a=this.getColSizes(this.curTable),l=this.getSplitColWidth(n[1],n[1]+s-1,a),a=this.getSplitColWidth(n[1]+s,n[1]+r-1,a),h=this.convertPixelToPercentage(this.activeCell.offsetWidth,this.curTable.offsetWidth),a=h-l<a?h-l:a;1<s?this.activeCell.setAttribute("colspan",s.toString()):this.activeCell.removeAttribute("colspan"),1<r-s?t.setAttribute("colspan",(r-s).toString()):t.removeAttribute("colspan"),this.activeCell.style.width=l+"%",t.style.width=a+"%"}else{for(var d,h=parseFloat(this.activeCell.style.width)/2,p=0;p<=i.length-1;p++)0!==p&&o[p][n[1]]===o[p-1][n[1]]||(d=o[p][n[1]])!==this.activeCell&&d.setAttribute("colspan",((parseInt(d.getAttribute("colspan"),10)?parseInt(d.getAttribute("colspan"),10):1)+1).toString());this.activeCell.style.width=h+"%",t.style.width=h+"%"}this.activeCell.parentNode.insertBefore(t,this.activeCell.nextSibling),e.callBack&&e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})}},u9e.prototype.getSplitColWidth=function(e,t,i){for(var n=0,o=e;o<=t;o++)n+=i[o];return this.convertPixelToPercentage(n,this.curTable.offsetWidth)},u9e.prototype.getColSizes=function(e){for(var t=e.rows[0].cells,i=0,n=0;n<t.length;n++)i+=t[n].colSpan;for(var o=new Array(i),r=new Map,s=0;s<e.rows.length;s++)for(var a=0,l=0;l<e.rows[s].cells.length;l++){for(var h=1;h<e.rows[s].cells[l].rowSpan;h++)r.set(""+(s+h)+a,e.rows[s].cells[l]);var d=this.getCellIndex(r,s,l),d=(a<d&&(a=d),e.rows[s].cells[l].offsetWidth);(!o[a]||d<o[a])&&(o[a]=d),a+=1+e.rows[s].cells[l].colSpan-1}return o},u9e.prototype.getCellIndex=function(e,t,i){var n=e.get(""+t+i);return n?this.getCellIndex(e,t,i+n.colSpan):i},u9e.prototype.convertPixelToPercentage=function(e,t){return e/t*100},u9e.prototype.getCorrespondingColumns=function(){for(var e=[],t=this.curTable.rows,i=0;i<=t.length-1;i++)for(var n=t[i],o=0,r=0;r<=n.children.length-1;r++){for(var s=n.children[r],a=s,l=parseInt(a.getAttribute("colspan"),10)||1,h=parseInt(a.getAttribute("rowspan"),10)||1,d=i;d<i+h;d++)for(var p=o;p<o+l;p++)e[d]||(e[d]=[]),e[d][p]?o++:e[d][p]=s;o+=0}return e},u9e.prototype.FindIndex=function(e,t,i){for(var n=e+1,o=t+1;n<i.length;){if(i[n][t]!==i[e][t]){n--;break}n++}for(n===i.length&&n--;o<i[e].length;){if(i[e][o]!==i[e][t]){o--;break}o++}return o===i[e].length&&o--,[n,o]},u9e.prototype.getCorrespondingIndex=function(e,t){for(var i=0;i<t.length;i++)for(var n=0;n<t[i].length;n++)if(t[i][n]===e)return[i,n];return[]},u9e.prototype.highlightCells=function(e,t,i,n,o){for(var r,s,a,l=e,h=t,d=i,p=n,c=new g9e,u=l;u<=h;u++){for(s=this.getCorrespondingIndex(o[u][d],o),a=this.FindIndex(s[0],s[1],o),((1<(parseInt(o[u][d].getAttribute("rowspan"),10)||1)||1<(parseInt(o[u][d].getAttribute("colspan"),10)||1))&&a||(1<(parseInt(o[u][p].getAttribute("rowspan"),10)||1)||1<(parseInt(o[u][p].getAttribute("colspan"),10)||1))&&(s=this.getCorrespondingIndex(o[u][p],o),a=this.FindIndex(s[0],s[1],o)))&&(l=Math.min(s[0],l),h=Math.max(a[0],h),d=Math.min(s[1],d),p=Math.max(a[1],p)),r=d;r<=p;r++)s=this.getCorrespondingIndex(o[l][r],o),a=this.FindIndex(s[0],s[1],o),((1<(parseInt(o[l][r].getAttribute("rowspan"),10)||1)||1<(parseInt(o[l][r].getAttribute("colspan"),10)||1))&&a||(1<(parseInt(o[h][r].getAttribute("rowspan"),10)||1)||1<(parseInt(o[h][r].getAttribute("colspan"),10)||1))&&(s=this.getCorrespondingIndex(o[h][r],o),a=this.FindIndex(s[0],s[1],o)))&&(l=Math.min(s[0],l),h=Math.max(a[0],h),d=Math.min(s[1],d),p=Math.max(a[1],p));c=l===e&&h===t&&d===i&&p===n?{startRow:e,endRow:t,startColumn:i,endColumn:n}:this.highlightCells(l,h,d,p,o)}return c},u9e.prototype.restoreRange=function(e){this.parent.userAgentData.isSafari()?this.parent.nodeSelection.Clear(this.parent.currentDocument):!this.parent.currentDocument.getSelection().rangeCount||"TD"!==e.nodeName&&"TH"!==e.nodeName||this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,e,0)},u9e.prototype.tableStyle=function(e){e.callBack&&e.callBack({requestType:e.item.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},u9e.prototype.tableMove=function(e){this.activeCell=e.selectNode[0];var t=e.event.target,i=this.activeCell.tagName,n=t.tagName;if(this.curTable=z(t,"table"),"TD"===t.tagName||"TH"===t.tagName||i===n){i=z(this.activeCell,"table");if(!je(this.curTable)&&!je(i)&&i===this.curTable){for(var o=this.getCorrespondingColumns(),n=this.getCorrespondingIndex(this.activeCell,o),i=this.getCorrespondingIndex(t,o),r=this.curTable.querySelectorAll(".e-cell-select, .e-multi-cells-select, .e-cell-select-end"),s=r.length-1;0<=s;s--)this.activeCell!==r[s]&&YUe([r[s]],["e-cell-select"]),YUe([r[s]],["e-multi-cells-select"]),YUe([r[s]],["e-cell-select-end"]);if(n[0]===i[0]&&n[1]===i[1])1<r.length&&this.restoreRange(t);else{for(var a=this.highlightCells(Math.min(n[0],i[0]),Math.max(n[0],i[0]),Math.min(n[1],i[1]),Math.max(n[1],i[1]),o),l=a.startRow;l<=a.endRow;l++)for(var h=a.startColumn;h<=a.endColumn;h++)o[l][h].classList.add("e-cell-select"),o[l][h].classList.add("e-multi-cells-select");t.classList.add("e-cell-select-end"),e.event.type&&e.event.preventDefault(),this.restoreRange(t)}}}},u9e.prototype.destroy=function(){this.removeEventListener()},u9e.prototype.cellStyleCleanup=function(e){for(var t=e.split(";"),i=[],n=["background-color","vertical-align","text-align"],o=0;o<t.length;o++){for(var r=t[o],s=!0,a=0;a<n.length;a++)-1<r.indexOf(n[a])&&(s=!1);s&&i.push(r)}return i.join(";")};var c9e=u9e;function u9e(e){this.parent=e,this.addEventListener()}var g9e=function(){},m9e=(f9e.prototype.getPlatform=function(){return!this.isTesting&&window.navigator.userAgentData?window.navigator.userAgentData.platform:/windows/i.test(this.userAgent)?"Windows":/macintosh|mac os/i.test(this.userAgent)&&!/iphone|ipad|ipod/i.test(this.userAgent)?"macOS":/linux/i.test(this.userAgent)&&!/android/i.test(this.userAgent)?"Linux":/iphone|ipad|ipod/i.test(this.userAgent)?"iOS":/android/i.test(this.userAgent)?"Android":"Unknown"},f9e.prototype.getBrowser=function(){if(!this.isTesting&&window.navigator.userAgentData)for(var e=0,t=window.navigator.userAgentData.brands;e<t.length;e++){var i=t[e];if("Google Chrome"===i.brand)return"Chrome";if("Microsoft Edge"===i.brand)return"Edge"}return/chrome|chromium|crios/i.test(this.userAgent)&&!/edg/i.test(this.userAgent)?"Chrome":/firefox|fxios/i.test(this.userAgent)&&!/edg/i.test(this.userAgent)?"Firefox":/safari/i.test(this.userAgent)&&!/chrome|chromium|crios/i.test(this.userAgent)?"Safari":/edg/i.test(this.userAgent)?"Edge":"Unknown"},f9e.prototype.isMobileDevice=function(){return!this.isTesting&&window.navigator.userAgentData?window.navigator.userAgentData.mobile:/(iphone|ipod|ipad|android|blackberry|bb|playbook|windows phone|webos|opera mini|mobile)/i.test(this.userAgent)},f9e.prototype.isSafari=function(){var e=this.getPlatform();return"Safari"===this.getBrowser()&&("macOS"===e||"iOS"===e)},f9e);function f9e(e,t){this.userAgent=e,this.isTesting=t}v9e.applyFormat=function(e,t,i,n,o,r,s,a){this.enterAction=n;if(-1<["bold","italic","underline","strikethrough","superscript","subscript","uppercase","lowercase","fontcolor","fontname","fontsize","backgroundcolor","inlinecode"].indexOf(t)||"formatPainter"===r){"backgroundcolor"===t&&""===r&&(r="transparent");var l=new _9e(i),h=new ZUe(i,e),d=new C7e,p=new tUe,c=l.getRange(e),u=0,g=c.startContainer.parentElement;if(!c.collapsed||je(g)||"A"!==g.tagName||c.startOffset!==g.textContent.length&&0!==c.startOffset||(m=document.createTextNode(""),0===c.startOffset?g.parentNode.insertBefore(m,g):je(g.nextSibling)?g.parentNode.appendChild(m):g.parentElement.insertBefore(m,g.nextSibling),g=e.createRange(),c.setStart(m,0),c.setEnd(m,0),c.collapse(!0),l.setRange(e,g)),-1!==F.userAgent.indexOf("Firefox")&&c.startContainer===c.endContainer&&!je(i)&&c.startContainer===i){for(var m=c.startContainer.childNodes[0<c.startOffset?c.startOffset-1:c.startOffset]||c.startContainer,g=c.endContainer.childNodes[0<c.endOffset?c.endOffset-1:c.endOffset]||c.endContainer,f="BR"===g.lastChild.nodeName?je(g.lastChild.previousSibling)?g:g.lastChild.previousSibling:g.firstChild;!je(f)&&"#text"!==f.nodeName&&"IMG"!==f.nodeName&&"BR"!==f.nodeName&&"HR"!==f.nodeName;)f=f.lastChild;l.setSelectionText(e,m,f,0,0),c=l.getRange(e)}for(var y,v,b,g=l.save(c,e),w=void 0,C=!1,S=((w=i&&o&&"#text"!==i.nodeName?o.getTextNodes():w)&&0<w.length?C=!0:w=c.collapsed?l.getSelectionNodeCollection(c):l.getSelectionNodeCollectionBr(c),!1),A=!1,m=!1,x=-1<["fontcolor","fontname","fontsize","backgroundcolor"].indexOf(t),I=!1,T=(v9e.userAgentData.isSafari()&&(I="None"!==v9e.isMentionStartOrEnd(i,w[0],w[w.length-1])),!C&&c.collapsed&&(b=je(v=p.getFormattedNode(c.startContainer,t,i))?null:null===v.getAttribute("style")?v.nodeName:v.nodeName+"[style='"+v.getAttribute("style")+"']",0<w.length?(S=!0,c=d.GetCursorRange(e,c,w[0])):3===c.startContainer.nodeType&&(0<c.startContainer.parentElement.childElementCount&&0<c.startOffset&&"br"!==c.startContainer.parentElement.firstElementChild.tagName.toLowerCase()||!je(v)&&v===c.startContainer.parentElement.closest(b)&&0!==c.startContainer.parentElement.closest(b).textContent.replace(new RegExp("​","g"),"").trim().length)?(S=!0,c=d.GetCursorRange(e,c,c.startContainer),w.push(c.startContainer)):(v=this.insertCursorNode(e,l,c,p,d,t,r,i),l.endContainer=l.startContainer=l.getNodeArray(v,!0),je(b="BR"===v.nodeName&&v.parentNode.childNodes)||1!==b.length||"BR"!==b[0].nodeName||0!==w.length?l.endOffset=l.startOffset=1:(l.setSelectionText(e,c.startContainer,c.endContainer,0,0),m=!0),"BR"===v.nodeName&&0===v.parentNode.textContent.length&&(m=!0))),y=!C&&c.collapsed,!1),E=!1,D=0;D<w.length;D++){var M=p.getFormattedNode(w[D],t,i);null===M&&("subscript"===t?T=null!==(M=p.getFormattedNode(w[D],"superscript",i)):"superscript"===t&&(T=null!==(M=p.getFormattedNode(w[D],"subscript",i))),E=!1),0===D&&null===M&&(A=!0),null===M||A&&!x||(w[D]=this.removeFormat(w,D,M,y,C,A,x,c,d,t,r,l,i,h),E=!0),E||null!==M||(w[D]=this.insertFormat(e,w,D,M,y,C,A,x,c,d,t,r,a,h,i),u++),w.length===u&&(this.isWrapped=!0),C||I||(l=this.applySelection(w,l,d,D,S))}WUe()&&QUe(i,s),m||C||g.restore(),T&&this.applyFormat(e,t,i,n,o)}},v9e.insertCursorNode=function(e,t,i,n,o,r,s,a){var l=t.getNodeCollection(i),h=new ZUe(a,e),n=0<l.length?1<l.length&&i.startContainer===i.endContainer?this.getCursorFormat(n,l,r,a):""===s&&"fontsize"===r&&null==n.getFormattedNode(l[0],r,a)&&"SPAN"===l[0].parentElement.nodeName?l[0].parentElement:n.getFormattedNode(l[0],r,a):null,d=null;if(n){if(d=l[0],8203===n.firstChild.textContent.charCodeAt(0)&&3===n.firstChild.nodeType){var a=new RegExp("​","g"),p=void 0;if("#text"!==d.nodeName)for(var c=0;c<l.length;c++)l[c].nodeType===Node.TEXT_NODE&&(d=l[c]);0===(p=n.firstChild===d?(d.textContent=n.parentElement&&(h.isBlockNode(n.parentElement)&&n.parentElement.textContent.length<=1?1<n.parentElement.childElementCount:0===n.childElementCount)&&(1<n.parentElement.textContent.length||n.parentElement.firstChild&&1===n.parentElement.firstChild.nodeType)?d.textContent:d.textContent.replace(a,""),d):(n.firstChild.textContent=n.firstChild.textContent.replace(a,""),n.firstChild)).textContent.length&&(je(p.previousSibling)?je(p.parentElement)||0!==p.parentElement.textContent.length||(a=document.createElement("BR"),p.parentElement.appendChild(a),G(p),t.setCursorPoint(e,(d=a).parentElement,0)):(d=p.previousSibling,a=p.textContent.length-1,t.setCursorPoint(e,p,a)))}-1<["fontcolor","fontname","fontsize","backgroundcolor"].indexOf(r)?("fontcolor"===r?n.style.color=s:"fontname"===r?n.style.fontFamily=s:"fontsize"===r?n.style.fontSize=s:n.style.backgroundColor=s,d=n):(b7e.unwrap(n),t.setCursorPoint(e,d,0))}else{if(1<l.length&&0<i.startOffset&&l[0].firstElementChild&&"br"===l[0].firstElementChild.tagName.toLowerCase()&&(l[0].innerHTML=""),1!==l.length||0!==i.startOffset||"BR"!==l[0].nodeName&&(je(l[0].nextSibling)||"BR"!==l[0].nextSibling.nodeName)||G("#text"===l[0].nodeName?l[0].nextSibling:l[0]),!je(l[0]&&l[0].parentElement)&&-1!==tUe.inlineTags.indexOf(l[0].parentElement.tagName.toLowerCase())&&l[0].textContent.includes("​")){p=this.GetFormatNode(r,s),a=l[0];if("fontsize"===r)for(var u=l[0];u;){var g=u.parentElement.textContent.trim()===l[0].textContent.trim(),m=u.parentElement;if(h.isBlockNode(m)||!g||"SPAN"===m.nodeName&&m.classList.contains("e-img-inner"))break;l[0]=u=m}return this.applyStyles(l,0,p),a}d=this.getInsertNode(e,i,r,s).firstChild}return d},v9e.getCursorFormat=function(e,t,i,n){for(var o,r=0;r<t.length;r++)o=t[r].lastElementChild||t[r];return"fontsize"===i&&null==e.getFormattedNode(o,i,n)&&"SPAN"===o.parentElement.nodeName?o.parentElement:e.getFormattedNode(o,i,n)},v9e.removeFormat=function(e,t,i,n,o,O,r,s,a,l,h,d,p,c){var u,g,m=null,f="#text"===s.startContainer.nodeName?s.startContainer.textContent.substring(s.startOffset,s.startContainer.textContent.length):s.startContainer.textContent,N=e[t].textContent,y=e[0].parentElement.nodeName===e[0].parentElement.parentElement.nodeName;if(s.startContainer!==s.endContainer||0!==s.startOffset||s.endOffset!==s.startContainer.length||s.startContainer.textContent!==i.textContent&&!y){for(var v=[],b=e[t],y=b;v.push(d.getIndex(b)),(b=b.parentNode)&&b!==i;);if("BR"!==e[t].nodeName&&("#text"===y.nodeName&&y.textContent.includes("​")&&y.remove(),o||(b=m=n&&i.textContent.length-1===s.startOffset?a.SplitNode(s,i,!0):a.GetSpliceNode(s,i))),n){for(var w=m;null!==w.firstChild&&3!==w.firstChild.nodeType;)w=w.firstChild;w.innerHTML="&#8203;",e[t]=w.firstChild}else{for(;b&&0<b.childNodes.length&&0<=v.length-1&&b.childNodes.length>v[v.length-1];){if(1<b.childNodes.length&&1<v.length){b=b.childNodes[v[v.length-2]];break}b=b.childNodes[v[v.length-1]],v.pop()}if("BR"!==e[t].nodeName){for(;1===b.nodeType&&0<b.childNodes.length;)b=b.childNodes[0];3!==b.nodeType||n&&""===b.nodeValue?((y=document.createElement("div")).innerHTML="&#8203;",3!==b.nodeType?(b.insertBefore(y.firstChild,b.firstChild),e[t]=b.firstChild):(b.parentNode.insertBefore(y.firstChild,b),e[t]=b.previousSibling,b.parentNode.removeChild(b))):e[t]=b}}}else if(r&&!e[t].contains(i)&&3===e[t].nodeType&&e[t].textContent!==i.textContent){for(var o=e[t].textContent===e[t].wholeText,C=e[t],m=this.GetFormatNode(l,h);C&&C.textContent===C.parentElement.textContent;)C=C.parentElement;if(o&&i.textContent!==C.textContent)return n=[],(y=this.getPriorityFormatNode(C,p))&&y.textContent===C.textContent&&(C=y),n.push(C),this.applyStyles(n,0,m),e[t]}"backgroundcolor"===l&&(u=i.style.fontSize),"fontsize"!==l||je(o=z(e[t].parentElement,"span[style*=background-color]"))||(g=o.style.backgroundColor);var S,A=i.getAttribute("style"),x=i.tagName;if("A"===x&&"underline"===l?(i.style.textDecoration="none",S=[i]):-1!==tUe.inlineTags.indexOf(x.toLowerCase())&&r&&"span"!==x.toLocaleLowerCase()?((y=i.style).color&&"fontcolor"===l?"A"===i.nodeName?y.color=h:y.color="":y.backgroundColor&&"backgroundcolor"===l?y.backgroundColor="":y.fontSize&&"fontsize"===l?y.fontSize="":y.fontFamily&&"fontname"===l&&(y.fontFamily=""),""===i.getAttribute("style")&&i.removeAttribute("style"),S=[i]):(S=b7e.unwrap(i),0===t&&(this.isUnwrapped=!0),je(E=e[t].parentElement)||"li"===E.tagName.toLowerCase()||(E=z(E,"li")),je(E)||"li"!==E.tagName.toLowerCase()||E.textContent.trim()!==e[t].textContent.trim()&&E.innerText.split("\n")[0]!==e[t].textContent.trim()?je(E)||"li"!==E.tagName.toLowerCase()||E.textContent.trim()===e[t].textContent.trim()||("bold"===l?E.style.fontWeight="":"italic"===l&&(E.style.fontStyle=""),v9e.conCatenateTextNode(E,l,"","normal",h)):"bold"===l?E.style.fontWeight="":"italic"===l?E.style.fontStyle="":"fontsize"===l&&(E.style.fontSize="")),S[0]&&!r)for(var I=C=S[t]||S[0];C&&C.parentElement&&C.parentElement!==p;){var V=void 0,V="SPAN"===i.nodeName?C.parentElement.tagName.toLocaleLowerCase()===i.tagName.toLocaleLowerCase()&&C.parentElement.getAttribute("style")===A:C.parentElement.tagName.toLocaleLowerCase()===i.tagName.toLocaleLowerCase();C=!(C.parentElement&&V&&(1<C.parentElement.childElementCount||1<s.startOffset))||(I.parentElement&&I.parentElement.tagName.toLocaleLowerCase()===i.tagName.toLocaleLowerCase()&&s.startOffset===s.endOffset&&1!==I.nodeType&&!je(I.textContent)&&1<I.parentElement.childElementCount&&(s.setStart(I,0),s.setEnd(I,I.textContent.length),a.SplitNode(s,I.parentElement,!1)),"span"===C.parentElement.tagName.toLocaleLowerCase()&&"underline"===i.style.textDecoration&&"underline"!==C.parentElement.style.textDecoration)||(b7e.unwrap(C.parentElement),je(C.parentElement))||c.isBlockNode(C.parentElement)?C.parentElement:I}if(0<S.length&&r){for(var T=0;T<S.length;T++)(3!==S[T].nodeType||S[T].textContent&&0<S[T].textContent.trim().length)&&(""!==h&&"transparent"!==h&&(S[T]=b7e.Wrap(S[T],this.GetFormatNode(l,h,x,A))),je(E=e[t].parentElement)||"li"===E.tagName.toLowerCase()||(E=z(E,"li")),je(E)||"li"!==E.tagName.toLowerCase()||E.textContent.trim()!==e[t].textContent.trim()||"fontname"===l&&(E.style.fontFamily=h),je(E)||"li"!==E.tagName.toLowerCase()||E.textContent.trim()===e[t].textContent.trim()||E.removeAttribute("style"),S[T].textContent===f)&&("#text"===s.startContainer.nodeName||"#text"!==s.startContainer.nodeName&&s.startContainer.classList&&!s.startContainer.classList.contains("e-multi-cells-select"))&&(0===T?s.setStartBefore(S[T]):T===S.length-1&&s.setEndAfter(S[T]));n=e[t].parentElement;if(je(u)||""===u||(n.style.fontSize=u),je(g)||""===g||(n.style.backgroundColor=g),"fontsize"===l||"fontcolor"===l||"fontname"===l){for(var E=e[t].parentElement,D=e[t].parentElement;!je(D)&&"li"!==D.tagName.toLowerCase();)E=D=D.parentElement;for(var T=t,M="";0<=T&&!je(E)&&"li"===E.tagName.toLowerCase()&&E.contains(e[T])&&E.textContent.replace("/​/g","").trim().includes(e[T].textContent.trim());)M=e[T].textContent+M,T--;var k=!1,P=0,B=!1;if(!je(E)&&E.childNodes)for(var F=0;F<E.childNodes.length;F++)"OL"!==E.childNodes[F].nodeName&&"UL"!==E.childNodes[F].nodeName||(P++,k=!0);if(je(E)||"li"!==E.tagName.toLowerCase()||E.textContent.split("​").join("").trim()!==M.split("​").join("").trim()){if(!je(E)&&"li"===E.tagName.toLowerCase()&&k){if(k&&0<P)for(var L=0;L<E.childNodes.length;L++)e[t].textContent===E.childNodes[L].textContent&&e[t].textContent===N&&E.textContent.replace("/​/g","").trim().includes(M.split("​").join("").trim())&&(B=!0);if(B){for(var R=0;R<E.childNodes.length;R++)"OL"!==E.childNodes[R].nodeName&&"UL"!==E.childNodes[R].nodeName||E.childNodes[R].removeAttribute("style");"fontsize"===l?E.style.fontSize=h:"fontname"===l?E.removeAttribute("style"):(E.style.color=h,E.style.textDecoration="inherit")}}}else"fontsize"===l?E.style.fontSize=h:"fontname"===l?E.removeAttribute("style"):(E.style.color=h,E.style.textDecoration="inherit")}}return e[t]},v9e.insertFormat=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u,g){if(o)"uppercase"!==d&&"lowercase"!==d?(m=this.getInsertNode(e,l,d,p),t[i]=m.firstChild,h.position=1):h.position=l.startOffset;else if(null===n&&s||a){if(r||"BR"===t[i].nodeName||(t[i]=h.GetSpliceNode(l,t[i]),t[i].textContent=h.TrimLineBreak(t[i].textContent)),"uppercase"===d||"lowercase"===d)t[i].textContent="uppercase"===d?t[i].textContent.toLocaleUpperCase():t[i].textContent.toLocaleLowerCase();else if(!0!==a||""!==p){var m=this.GetFormatNode(d,p);if("formatPainter"===p||a){for(var f=t[i].parentElement,y=t[i].parentElement;!je(y)&&"li"!==y.tagName.toLowerCase();)f=y=y.parentElement;if("fontcolor"===d||"fontname"===d||"fontsize"===d){var v=t[i].parentElement;if(!je(v)&&v.childNodes)for(var b=0;b<v.childNodes.length;b++){if(this.concatenateTextExcludingList(t,i)===t[i].textContent){var w=void 0;if("LI"===v.tagName?w=v:v.closest("li")&&(w=v.closest("li")),!je(w))switch(d){case"fontcolor":w.style.color=p;break;case"fontname":w.style.fontFamily=p;break;case"fontsize":w.style.fontSize=p}}var C=v.childNodes[b];if("OL"===C.tagName||"UL"===C.tagName)switch(d){case"fontcolor":C.style.color="initial";break;case"fontname":C.style.fontFamily="initial";break;case"fontsize":C.style.fontSize="initial"}}}if(je(f)||"li"!==f.tagName.toLowerCase()||f.textContent.trim()!==t[i].textContent.trim()||("fontsize"===d?f.style.fontSize=p:"fontcolor"===d?(f.style.color=p,f.style.textDecoration="inherit"):"fontname"===d&&(f.style.fontFamily=p)),"formatPainter"===p)return this.insertFormatPainterElem(t,i,l,h,c,u);o=t[i],e=this.getPriorityFormatNode(o,g);if(!je(e)||a){var S=je(e)?o:e,S=je(e)||""===e.style.fontSize?S:S.firstChild;if(je(e)||"fontsize"===d)for(;S;){var A=S.parentElement.textContent.trim()===t[i].textContent.trim(),x=S.parentElement;if(u.isBlockNode(x)||!A||"SPAN"===x.nodeName&&x.classList.contains("e-img-inner"))break;S=x}n=[];"fontcolor"!==d||je(s=z(t[i].parentElement,"A"))||s.firstChild.textContent.trim()!==t[i].textContent.trim()||(S=t[i]),t[i].textContent.trim()!==S.textContent.trim()&&(S=t[i]),n[0]=S,this.applyStyles(n,0,m),je(f)||"li"!==f.tagName.toLowerCase()||f.textContent.trim()===t[i].textContent.trim()||v9e.conCatenateTextNode(f,d,f.textContent,d,p)}else t[i]=this.applyStyles(t,i,m)}else{f=t[i].parentElement;t[i]=this.applyStyles(t,i,m),je(f)||"li"===f.tagName.toLowerCase()||(f=z(f,"li")),je(f)||"li"!==f.tagName.toLowerCase()||f.textContent.trim()!==t[i].textContent.trim()&&f.innerText.split("\n")[0]!==t[i].textContent.trim()?je(f)||"li"!==f.tagName.toLowerCase()||f.textContent.trim()===t[i].textContent.trim()||v9e.conCatenateTextNode(f,d,f.textContent,d):"bold"===d?f.style.fontWeight="bold":"italic"===d&&(f.style.fontStyle="italic")}}}else!r&&t[i].isConnected&&(t[i]=h.GetSpliceNode(l,t[i]));return t[i]},v9e.applyStyles=function(e,t,i){return"BR"===e[t].nodeName&&"BR"===this.enterAction||(e[t]=t===e.length-1||"BR"===e[t].nodeName?b7e.Wrap(e[t],i):b7e.WrapBefore(e[t],i,!0),e[t]=this.getChildNode(e[t],i)),e[t]},v9e.getPriorityFormatNode=function(e,t){var i,n,o=new tUe,r=o.getFormattedNode(e,"fontsize",t);return je(r)?je(i=o.getFormattedNode(e,"backgroundcolor",t))?je(n=o.getFormattedNode(e,"fontname",t))?je(o=o.getFormattedNode(e,"fontcolor",t))?null:o:n:i:r},v9e.getInsertNode=function(e,t,i,n){i=this.GetFormatNode(i,n);return i.innerHTML="&#8203;",F.isIE?((n=e.createDocumentFragment()).appendChild(i),t.insertNode(n)):t.insertNode(i),i},v9e.getChildNode=function(e,t){return null==e&&(t.innerHTML="&#8203;",e=t.firstChild),e},v9e.applySelection=function(e,t,i,n,o){return 1!==e.length||o?1===e.length&&o?(t.startContainer=t.getNodeArray(e[n],!0),t.endContainer=t.startContainer,t.startOffset=i.position,t.endOffset=i.position):0===n?(t.startContainer=t.getNodeArray(e[n],!0),t.startOffset=0):n===e.length-1&&(t.endContainer=t.getNodeArray(e[n],!1),t.endOffset=e[n].textContent.length):(t.startContainer=t.getNodeArray(e[n],!0),t.endContainer=t.startContainer,t.startOffset=0,t.endOffset=e[n].textContent.length),t},v9e.GetFormatNode=function(e,t,i,n){var o;switch(e){case"bold":return document.createElement("strong");case"italic":return document.createElement("em");case"underline":return o=document.createElement("span"),this.updateStyles(o,i,n),o.style.textDecoration="underline",o;case"strikethrough":return o=document.createElement("span"),this.updateStyles(o,i,n),o.style.textDecoration="line-through",o;case"superscript":return document.createElement("sup");case"subscript":return document.createElement("sub");case"fontcolor":return o=document.createElement("span"),this.updateStyles(o,i,n),o.style.color=t,o.style.textDecoration="inherit",o;case"fontname":return o=document.createElement("span"),this.updateStyles(o,i,n),o.style.fontFamily=t,o;case"fontsize":return o=document.createElement("span"),this.updateStyles(o,i,n),o.style.fontSize=t,o;case"inlinecode":return document.createElement("code");default:return o=document.createElement("span"),this.updateStyles(o,i,n),o.style.backgroundColor=t,o}},v9e.updateStyles=function(e,t,i){null!==i&&"SPAN"===t&&(e.style.cssText=i)},v9e.insertFormatPainterElem=function(e,t,i,n,o,r){var s=r.isBlockNode(e[t].parentElement)?e[t]:e[t].parentElement;if(!r.isBlockNode(s))for(;s.textContent.trim()===s.parentElement.textContent.trim()&&!r.isBlockNode(s.parentElement);)s=s.parentElement;je(s)||1!==s.nodeType||s.classList.contains("e-rte-img-caption")||s.classList.contains("e-img-inner")||this.formatPainterCleanup(t,e,s,i,n,r);var a,i=o.element;return je(i)||(0<(a=(i=i.cloneNode(!(n=void 0))).querySelectorAll(o.lastChild.nodeName)).length?n=a[a.length-1]:je(i)||i.nodeName!==o.lastChild.nodeName||(n=i),n.textContent=e[t].textContent,a=n.childNodes[0],e[t]=b7e.Wrap(e[t],i),e[t].textContent="",e[t]=a),e[t]},v9e.formatPainterCleanup=function(e,t,i,n,o,r){var s=["A","AUDIO","IMG","VIDEO","IFRAME"];if(0===e&&i.textContent.trim()!==t[e].textContent.trim()){o.SplitNode(n,i,!0);for(var a=t[e].parentElement.childNodes,l=0;l<a.length;l++)if(a[l].textContent.trim()===t[l].textContent.trim()){i.parentNode.insertBefore(a[l],i);break}for(var h=i.parentElement.childNodes,d=0;d<h.length;d++)""!==h[d].textContent.trim()&&0!==h[d].textContent.length||160===h[d].textContent.charCodeAt(0)||G(h[d])}else if(i.textContent.trim()!==t[e].textContent.trim())i.parentElement.insertBefore(t[e],i);else for(;!je(i)&&3!==i.nodeType&&!r.isBlockNode(i);){for(var p=void 0,l=0;l<i.childNodes.length;l++){var c=i.childNodes[l];0!==c.textContent.trim().length&&3!==c.nodeType&&(p=i.childNodes[l])}-1===s.indexOf(i.tagName)&&b7e.unwrap(i),i=p}},v9e.concatenateTextExcludingList=function(e,t){var i="",n="#text"===e[t].nodeName?z(e[t].parentElement,"li"):z(e[t],"li");if(!je(n))for(var o=0;o<n.childNodes.length;o++){var r=n.childNodes[o];(3===r.nodeType||1===r.nodeType&&"OL"!==r.tagName&&"UL"!==r.tagName)&&(i+=r.textContent)}return i},v9e.conCatenateTextNode=function(e,t,i,n,o){var r,s="";switch(t){case"bold":e.querySelectorAll("strong").forEach(function(e){s+=e.textContent}),s===i&&(e.style.fontWeight=n);break;case"italic":e.querySelectorAll("em").forEach(function(e){s+=e.textContent}),s===i&&(e.style.fontStyle=n);break;case"fontcolor":e.querySelectorAll("span").forEach(function(e){r=e.style.color,v9e.hasColorsEqual(r,o)&&(s+=e.textContent)}),je(s)||je(i)||""===s||""===i||s.replace(/\s+/g,"")!==i.replace(/\s+/g,"")||(e.style.color=o,e.style.textDecoration="inherit");break;case"fontsize":e.querySelectorAll("span").forEach(function(e){e.style.getPropertyValue("font-size")===o&&(s+=e.textContent)}),je(s)||je(i)||""===s||""===i||s.replace(/\s+/g,"")!==i.replace(/\s+/g,"")||(e.style.fontSize=o);break;case"fontname":e.querySelectorAll("span").forEach(function(e){e.style.getPropertyValue("font-family").replace(/ /g,"")===o&&(s+=e.textContent)}),je(s)||je(i)||""===s||""===i||s.replace(/\s+/g,"")!==i.replace(/\s+/g,"")||(e.style.fontFamily=o)}},v9e.hasColorsEqual=function(e,t){return je(e)||je(t)||""===e.trim()||""===t.trim()?e===t:(e.startsWith("rgb(")&&(e=e.replace("rgb(","rgba(").slice(0,-1)+",1)"),t.startsWith("rgb(")&&(t=t.replace("rgb(","rgba(").slice(0,-1)+",1)"),e.replace(/\s+/g,"")===t.replace(/\s+/g,""))},v9e.isMentionStartOrEnd=function(e,t,i){var n="None",e=new I7e(e),t=e.getTopMostNode(t),e=e.getTopMostNode(i);return t.nodeType!==Node.ELEMENT_NODE||t.isContentEditable||e.nodeType!==Node.ELEMENT_NODE||e.isContentEditable||(n="Both"),t.nodeType!==Node.ELEMENT_NODE||t.isContentEditable||(n="Start"),n=e.nodeType!==Node.ELEMENT_NODE||e.isContentEditable?n:"End"},v9e.enterAction="P",v9e.isUnwrapped=!1,v9e.isWrapped=!1,v9e.userAgentData=new m9e(F.userAgent,!1);var y9e=v9e;function v9e(){}w9e.prototype.addEventListener=function(){this.parent.observer.on(EUe,this.applySelection,this),this.parent.observer.on(n7e,this.keyDownHandler,this),this.parent.observer.on(v7e,this.destroy,this)},w9e.prototype.removeEventListener=function(){this.parent.observer.off(EUe,this.applySelection),this.parent.observer.off(n7e,this.keyDownHandler),this.parent.observer.off(v7e,this.destroy)},w9e.prototype.keyDownHandler=function(e){(e.event.ctrlKey||e.event.metaKey)&&-1<["bold","italic","underline","strikethrough","superscript","subscript","uppercase","lowercase","inlinecode"].indexOf(e.event.action)&&(e.event.preventDefault(),y9e.applyFormat(this.parent.currentDocument,e.event.action,this.parent.editableElement,e.enterAction,this.parent.tableCellSelection),this.callBack(e,e.event.action))},w9e.prototype.applySelection=function(e){y9e.applyFormat(this.parent.currentDocument,e.subCommand.toLocaleLowerCase(),this.parent.editableElement,e.enterAction,this.parent.tableCellSelection,e.value,e.selector),this.callBack(e,e.subCommand)},w9e.prototype.callBack=function(e,t){e.callBack&&e.callBack({requestType:t,event:e.event,editorMode:"HTML",range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},w9e.prototype.destroy=function(){this.removeEventListener()};var b9e=w9e;function w9e(e){this.parent=e,this.addEventListener()}S9e.prototype.addEventListener=function(){this.parent.observer.on(DUe,this.applyHtml,this),this.parent.observer.on(v7e,this.destroy,this)},S9e.prototype.removeEventListener=function(){this.parent.observer.off(DUe,this.applyHtml),this.parent.observer.off(v7e,this.destroy)},S9e.prototype.applyHtml=function(e){var t,i;A7e.Insert(this.parent.currentDocument,e.value,this.parent.editableElement,!0,e.enterAction),"pasteCleanup"===e.subCommand?(t=this.parent.editableElement.querySelectorAll(".pasteContent_RTE"),t=[].slice.call(t),i=this.parent.editableElement.querySelectorAll(".pasteContent_Img"),i=[].slice.call(i),e.callBack({requestType:e.subCommand,editorMode:"HTML",elements:t,imgElem:i})):e.callBack&&e.callBack({requestType:e.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},S9e.prototype.destroy=function(){this.removeEventListener()};var C9e=S9e;function S9e(e){this.parent=e,this.addEventListener()}x9e.clear=function(e,t,i,n,o){this.domNode=new ZUe(t,e),this.defaultTag="P"===i?"p":"div";var i=new _9e(t),r=new C7e,s=i.getRange(e),a=s.collapsed?i.getSelectionNodeCollection(s):i.getSelectionNodeCollectionBr(s),l=i.save(s,e),h=!1;if(s.collapsed&&"ClearFormat"!==o&&(h=!0,s=r.GetCursorRange(e,s,a[0])),!s.collapsed){o=void 0,o=0<a.length&&"BR"===a[0].nodeName&&z(a[0],"table")?r.GetSpliceNode(s,z(a[0],"table")):r.GetSpliceNode(s,a[1<a.length&&"IMG"===a[0].nodeName?1:0]);if(1===a.length)i.setSelectionContents(e,o),s=i.getRange(e);else if(1<a.length){for(var d=1,p=a[a.length-d];a.length<=d&&"BR"===a[a.length-d].nodeName;)p=a[a.length-++d];var c=r.GetSpliceNode(s,p);c&&i.setSelectionText(e,o,c,0,(3===c.nodeType?c.textContent:c.childNodes).length),s=i.getRange(e)}o=i.getNodeCollection(s),c=o.slice(),c=(this.clearInlines(i.getSelectionNodes(c),c,i.getRange(e),r,t),this.reSelection(e,l,o),s=i.getRange(e),(o=i.getNodeCollection(s)).slice());this.clearBlocks(e,c,t,r,i),WUe()&&QUe(t,n),this.reSelection(e,l,o)}h&&i.setCursorPoint(e,s.endContainer,s.endOffset)},x9e.reSelection=function(e,t,i){i=t.getInsertNodes(i),t.startContainer=t.getNodeArray(i[0],!0,e),t.startOffset=0,t.endContainer=t.getNodeArray(i[i.length-1],!1,e),e=i[i.length-1];t.endOffset=(3===e.nodeType?e.textContent:e.childNodes).length,t.restore()},x9e.clearBlocks=function(e,t,i,n,o){for(var r=[],s=0;s<t.length;s++)-1<this.BLOCK_TAGS.indexOf(t[s].nodeName.toLocaleLowerCase())&&-1===r.indexOf(t[s])?r.push(t[s]):-1<this.BLOCK_TAGS.indexOf(t[s].parentNode.nodeName.toLocaleLowerCase())&&-1===r.indexOf(t[s].parentNode)&&i!==t[s].parentNode&&r.push(t[s].parentNode);r=this.spliceParent(r,t)[0],r=this.removeParent(r),this.unWrap(e,r,n,o)},x9e.spliceParent=function(e,t){for(var i=0;i<e.length;i++)for(var n=e[i].childNodes.length,o=0;o<n;o++)if((t=0<t.indexOf(e[i].childNodes[o])&&0<e[i].childNodes[o].childNodes.length?this.spliceParent([e[i].childNodes[o]],t)[1]:t).indexOf(e[i].childNodes[o])<=-1&&""!==e[i].childNodes[o].textContent.trim()){for(var r=0;r<n;r++)-1<t.indexOf(e[i].childNodes[r])&&t.splice(t.indexOf(e[i].childNodes[r]),1);var o=e[i].childNodes.length,s=e.indexOf(e[i].parentNode),a=t.indexOf(e[i].parentNode),s=(-1<s&&e.splice(s,1),-1<a&&t.splice(a,1),t.indexOf(e[i]));-1<s&&t.splice(s,1),e.splice(i,1),i--}return[e,t]},x9e.removeChild=function(e,t){var i=t.childNodes.length;if(0<i)for(var n=0;n<i;n++)-1<e.indexOf(t.childNodes[n])&&(e=this.removeChild(e,t.childNodes[n])).splice(e.indexOf(t.childNodes[n]),1);return e},x9e.removeParent=function(e){for(var t=0;t<e.length;t++)-1<e.indexOf(e[t].parentNode)&&((e=this.removeChild(e,e[t])).splice(t,1),t--);return e},x9e.unWrap=function(e,t,i,n){for(var o=0;o<t.length;o++){t[o]=z(t[o],"li")&&"UL"!==t[o].nodeName&&"OL"!==t[o].nodeName?z(t[o],"li"):t[o],-1<this.NONVALID_TAGS.indexOf(t[o].nodeName.toLowerCase())&&t[o].parentNode&&-1<this.NONVALID_PARENT_TAGS.indexOf(t[o].parentNode.nodeName.toLowerCase())&&(n.setSelectionText(e,t[o],t[o],0,t[o].childNodes.length),b7e.unwrap(i.GetSpliceNode(n.getRange(e),t[o].parentNode)));var r=z(t[o],"blockquote");if("blockquote"===t[o].nodeName.toLocaleLowerCase()||je(r)||r.textContent!==t[o].textContent||(a=this.removeParent([r]),this.unWrap(e,a,i,n)),"p"!==t[o].nodeName.toLocaleLowerCase()){!(this.NONVALID_PARENT_TAGS.indexOf(t[o].nodeName.toLowerCase())<0)||("blockquote"===t[o].nodeName.toLocaleLowerCase()||"li"===t[o].nodeName.toLocaleLowerCase())&&-1<this.IGNORE_PARENT_TAGS.indexOf(t[o].childNodes[0].nodeName.toLocaleLowerCase())||1===t[o].childNodes.length&&"p"===t[o].childNodes[0].nodeName.toLocaleLowerCase()||b7e.Wrap(t[o],e.createElement(this.defaultTag));var s=b7e.unwrap(t[o]);1===s.length&&"p"===s[0].parentNode.nodeName.toLocaleLowerCase()&&(b7e.Wrap(t[o],e.createElement(this.defaultTag)),b7e.unwrap(t[o]));for(var a,l=0;l<s.length;l++)-1<this.NONVALID_TAGS.indexOf(s[l].nodeName.toLowerCase())?this.unWrap(e,[s[l]],i,n):-1<this.BLOCK_TAGS.indexOf(s[l].nodeName.toLocaleLowerCase())&&"p"!==s[l].nodeName.toLocaleLowerCase()?(a=this.removeParent([s[l]]),this.unWrap(e,a,i,n)):-1<this.BLOCK_TAGS.indexOf(s[l].nodeName.toLocaleLowerCase())&&"p"===s[l].nodeName.toLocaleLowerCase()?("p"===s[l].parentNode.nodeName.toLocaleLowerCase()&&b7e.unwrap(s[l].parentNode),b7e.Wrap(s[l],e.createElement(this.defaultTag)),b7e.unwrap(s[l])):-1<this.BLOCK_TAGS.indexOf(s[l].nodeName.toLocaleLowerCase())&&s[l].parentNode.nodeName.toLocaleLowerCase()===s[l].nodeName.toLocaleLowerCase()&&b7e.unwrap(s[l])}else b7e.Wrap(t[o],e.createElement(this.defaultTag)),b7e.unwrap(t[o])}},x9e.clearInlines=function(e,t,i,n,o){for(var r=0;r<e.length;r++){for(var s=e[r],a=void 0;!this.domNode.isBlockNode(s)&&s.parentElement&&!s.parentElement.classList.contains("e-img-inner");)s=(a=s).parentElement;a&&-1<tUe.inlineTags.indexOf(a.nodeName.toLocaleLowerCase())&&(n.GetSpliceNode(i,a),this.removeInlineParent(a))}},x9e.removeInlineParent=function(e){for(var t=b7e.unwrap(e),i=0;i<t.length;i++)1===t[i].parentNode.childNodes.length&&!t[i].parentNode.classList.contains("e-img-inner")&&-1<tUe.inlineTags.indexOf(t[i].parentNode.nodeName.toLocaleLowerCase())?this.removeInlineParent(t[i].parentNode):-1<tUe.inlineTags.indexOf(t[i].nodeName.toLocaleLowerCase())&&this.removeInlineParent(t[i])},x9e.BLOCK_TAGS=["address","article","aside","blockquote","details","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","li","main","nav","noscript","ol","p","pre","section","ul"],x9e.NONVALID_PARENT_TAGS=["thead","tbody","ul","ol","table","tfoot","tr"],x9e.IGNORE_PARENT_TAGS=["ul","ol","table"],x9e.NONVALID_TAGS=["thead","tbody","figcaption","td","tr","th","tfoot","figcaption","li"],x9e.defaultTag="p";var A9e=x9e;function x9e(){}T9e.prototype.addEventListener=function(){this.parent.observer.on(kUe,this.applyClear,this),this.parent.observer.on(n7e,this.onKeyDown,this),this.parent.observer.on(v7e,this.destroy,this)},T9e.prototype.removeEventListener=function(){this.parent.observer.off(kUe,this.applyClear),this.parent.observer.off(n7e,this.onKeyDown),this.parent.observer.off(v7e,this.destroy)},T9e.prototype.onKeyDown=function(e){"clear-format"===e.event.action&&(this.applyClear({subCommand:"ClearFormat",callBack:e.callBack,enterAction:e.enterAction}),e.event.preventDefault())},T9e.prototype.applyClear=function(e){"ClearFormat"===e.subCommand&&(A9e.clear(this.parent.currentDocument,this.parent.editableElement,e.enterAction,e.selector,e.subCommand),e.callBack)&&e.callBack({requestType:e.subCommand,event:e.event,editorMode:"HTML",range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},T9e.prototype.destroy=function(){this.removeEventListener()};var I9e=T9e;function T9e(e){this.parent=e,this.addEventListener()}D9e.prototype.addEventListener=function(){this.debounceListener=P(this.keyUp,this.undoRedoTimer),this.parent.observer.on(r7e,this.debounceListener,this),this.parent.observer.on(n7e,this.keyDown,this),this.parent.observer.on(t7e,this.onAction,this),this.parent.observer.on(a7e,this.onPropertyChanged,this),this.parent.observer.on(v7e,this.destroy,this)},D9e.prototype.onPropertyChanged=function(e){for(var t=0,i=Object.keys(e.newProp);t<i.length;t++)switch(i[t]){case"undoRedoSteps":this.undoRedoSteps=e.newProp.undoRedoSteps;break;case"undoRedoTimer":this.undoRedoTimer=e.newProp.undoRedoTimer}},D9e.prototype.removeEventListener=function(){this.parent.observer.off(r7e,this.keyUp),this.parent.observer.off(n7e,this.keyDown),this.parent.observer.off(t7e,this.onAction),this.parent.observer.off(a7e,this.onPropertyChanged),this.parent.observer.off(v7e,this.destroy),this.debounceListener=null},D9e.prototype.onAction=function(e){"Undo"===e.subCommand?this.undo(e):this.redo(e)},D9e.prototype.destroy=function(){this.removeEventListener(),this.element=null,this.steps=null,this.undoRedoStack=[],this.undoRedoSteps=null,this.undoRedoTimer=null},D9e.prototype.keyDown=function(e){var t=e.event;switch(t.action){case"undo":t.preventDefault(),this.undo(e);break;case"redo":t.preventDefault(),this.redo(e)}},D9e.prototype.keyUp=function(e){17===e.event.keyCode||e.event.ctrlKey||this.saveData(e)},D9e.prototype.getTextContentFromFragment=function(e){for(var t="",i=0;i<e.childNodes.length;i++){var n=e.childNodes[i];n.nodeType===Node.TEXT_NODE?t+=n.textContent:n.nodeType===Node.ELEMENT_NODE&&(t+=this.getTextContentFromFragment(n))}return t},D9e.prototype.isElementStructureEqual=function(e,t){if(e.childNodes.length!==t.childNodes.length)return!1;for(var i=0;i<e.childNodes.length;i++){var n=e.childNodes[i],o=t.childNodes[i];if(!n||!o)return!1;if(n.nodeType!==o.nodeType)return!1;if(n.outerHTML!==o.outerHTML)return!1}return!0},D9e.prototype.saveData=function(e){if(this.parent.currentDocument){for(var t=new _9e(this.parent.editableElement).getRange(this.parent.currentDocument),i=this.parent.editableElement===t.startContainer.parentElement?t.startContainer.parentElement:t.startContainer,n=i.childNodes.length-1;0<=n;n--)!je(i.childNodes[n])&&"#text"===i.childNodes[n].nodeName&&0===i.childNodes[n].textContent.length&&"IMG"!==i.childNodes[n].nodeName&&"BR"!==i.childNodes[n].nodeName&&i.childNodes[n].nodeName&&G(i.childNodes[n]);for(var t=new _9e(this.parent.editableElement).getRange(this.parent.currentDocument),o=new _9e(this.parent.editableElement).save(t,this.parent.currentDocument),r=this.parent.editableElement.cloneNode(!0),s=document.createDocumentFragment();r.firstChild;)s.appendChild(r.firstChild);var a={text:s,range:o};this.undoRedoStack.length>=this.steps&&(this.undoRedoStack=this.undoRedoStack.slice(0,this.steps+1)),1<this.undoRedoStack.length&&this.undoRedoStack[this.undoRedoStack.length-1].range.range.collapsed===t.collapsed&&this.undoRedoStack[this.undoRedoStack.length-1].range.startOffset===o.range.startOffset&&this.undoRedoStack[this.undoRedoStack.length-1].range.endOffset===o.range.endOffset&&this.undoRedoStack[this.undoRedoStack.length-1].range.range.startContainer===o.range.startContainer&&this.getTextContentFromFragment(this.undoRedoStack[this.undoRedoStack.length-1].text).trim()===this.getTextContentFromFragment(a.text).trim()&&this.isElementStructureEqual(this.undoRedoStack[this.undoRedoStack.length-1].text,a.text)||(this.undoRedoStack.push(a),this.steps=this.undoRedoStack.length-1,this.steps>this.undoRedoSteps&&(this.undoRedoStack.shift(),this.steps--),e&&e.callBack&&e.callBack())}},D9e.prototype.undo=function(e){var t,i;0<this.steps&&(t=this.undoRedoStack[this.steps-1].range,i=this.undoRedoStack[this.steps-1].text,this.parent.editableElement.innerHTML="",this.parent.editableElement.appendChild(i.cloneNode(!0)),this.parent.editableElement.focus(),qUe(this.parent.currentDocument,this.parent.editableElement),WUe()&&QUe(this.parent.editableElement,e.selector),t.restore(),this.steps--,e.callBack)&&e.callBack({requestType:"Undo",editorMode:"HTML",range:t,elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument),event:e.event})},D9e.prototype.redo=function(e){var t,i;null!=this.undoRedoStack[this.steps+1]&&(t=this.undoRedoStack[this.steps+1].range,i=this.undoRedoStack[this.steps+1].text,this.parent.editableElement.innerHTML="",this.parent.editableElement.appendChild(i.cloneNode(!0)),this.parent.editableElement.focus(),qUe(this.parent.currentDocument,this.parent.editableElement),WUe()&&QUe(this.parent.editableElement,e.selector),t.restore(),this.steps++,e.callBack)&&e.callBack({requestType:"Redo",editorMode:"HTML",range:t,elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument),event:e.event})},D9e.prototype.getUndoStatus=function(){var e={undo:!1,redo:!1};return 0<this.steps&&(e.undo=!0),null!=this.undoRedoStack[this.steps+1]&&(e.redo=!0),e},D9e.prototype.getCurrentStackIndex=function(){return this.steps};var E9e=D9e;function D9e(e,t){this.undoRedoStack=[],this.parent=e,this.undoRedoSteps=je(t)?30:t.undoRedoSteps,this.undoRedoTimer=je(t)?300:t.undoRedoTimer,this.addEventListener()}k9e.prototype.addEventListener=function(){this.parent.observer.on(h7e,this.wordCleanup,this),this.parent.observer.on(v7e,this.destroy,this)},k9e.prototype.removeEventListener=function(){this.parent.observer.off(h7e,this.wordCleanup),this.parent.observer.off(v7e,this.destroy)},k9e.prototype.wordCleanup=function(e){var t=je(e.allowedStylePropertiesArray)?[]:e.allowedStylePropertiesArray,i=[],n=e.args.clipboardData.getData("text/HTML"),o=e.args.clipboardData.getData("text/rtf"),r=Q("p"),s=(r.setAttribute("id","MSWord-Content"),r.innerHTML=n,this.addDoubleBr(r),/style='mso-width-source:/i),a=this.findSource(r);/class='?Mso|style='[^ ]*\bmso-/i.test(n)||/class="?Mso|style="[^ ]*\bmso-/i.test(n)||/(class="?Mso|class='?Mso|class="?Xl|class='?Xl|class=Xl|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument)/gi.test(n)||s.test(n)?(n=n.replace(/<img[^>]+>/i,""),this.addListClass(r),je((i=this.cleanUp(r,i))[0])||"UL"===i[0].parentElement.tagName||"OL"===i[0].parentElement.tagName||this.listConverter(i),this.imageConversion(r,o),this.cleanList(r,"UL"),this.cleanList(r,"OL"),this.styleCorrection(r,t),this.removingComments(r),this.removeUnwantedElements(r),this.removeEmptyElements(r),this.removeEmptyAnchorTag(r),this.breakLineAddition(r),this.processMargin(r),this.removeClassName(r),s.test(n)&&this.addTableBorderClass(r),e.callBack(r.innerHTML,this.cropImageDimensions,a)):(a===BUe[2]&&this.handleOneNoteContent(r),this.removeEmptyMetaTags(r),e.callBack(r.innerHTML,null,a))},k9e.prototype.addDoubleBr=function(e){var t=e.querySelector(".Apple-interchange-newline");if(!je(t)&&-1!==F.userAgent.indexOf("Chrome")&&"P"===t.parentElement.nodeName&&e!==t.parentElement)for(var i=0;i<e.childNodes.length;i++){var n=e.childNodes[i];if(n.nodeType===Node.COMMENT_NODE&&n.nodeValue.includes("StartFragment")){var o=document.createElement("p"),r=(o.innerHTML="<br>",t.parentElement.style.cssText),s=o.getAttribute("style")||"";o.style.cssText=s+r,e.insertBefore(o,n.nextSibling),G(t);break}}},k9e.prototype.cleanList=function(e,t){for(var i=e.querySelectorAll(t+" div"),n=i.length-1;0<=n;n--){for(var o=i[n].parentNode;i[n].firstChild;)o.insertBefore(i[n].firstChild,i[n]);var r=this.findClosestListElem(i[n]);r&&this.insertAfter(i[n],r)}},k9e.prototype.insertAfter=function(e,t){t.parentNode.insertBefore(e,t.nextSibling)},k9e.prototype.findClosestListElem=function(e){for(var t;!je(e);)e=je(e.closest("ul"))||"UL"===e.tagName?"OL"!==e.tagName?e.closest("ol"):null:e.closest("ul"),t=je(e)?t:e;return t},k9e.prototype.addListClass=function(e){for(var t=e.querySelectorAll("*"),i=0;i<t.length;i++)!je(t[i].getAttribute("style"))&&0<=t[i].getAttribute("style").replace(/ /g,"").replace("\n","").indexOf("mso-list:l")&&-1===t[i].className.toLowerCase().indexOf("msolistparagraph")&&"H"!==t[i].tagName.charAt(0)&&"LI"!==t[i].tagName&&"OL"!==t[i].tagName&&"UL"!==t[i].tagName&&t[i].classList.add("msolistparagraph")},k9e.prototype.addTableBorderClass=function(e){for(var t=e.querySelectorAll("table"),i=!1,n=0;n<t.length;n++){for(var o=0;o<this.borderStyle.length;o++)if(0<=t[n].innerHTML.indexOf(this.borderStyle[o])){i=!0;break}i&&(t[n].classList.add("e-rte-table-border"),i=!1)}},k9e.prototype.imageConversion=function(e,t){this.checkVShape(e);for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++)!je(i[n].getAttribute("v:shapes"))&&i[n].getAttribute("v:shapes").indexOf("Picture")<0&&i[n].getAttribute("v:shapes").indexOf("Chart")<0&&i[n].getAttribute("v:shapes").indexOf("圖片")<0&&i[n].getAttribute("v:shapes").indexOf("Grafik")<0&&i[n].getAttribute("v:shapes").toLowerCase().indexOf("image")<0&&i[n].getAttribute("v:shapes").indexOf("Graphic")<0&&i[n].getAttribute("v:shapes").indexOf("_x0000_s")<0&&i[n].getAttribute("v:shapes").indexOf("_x0000_i")<0&&i[n].getAttribute("v:shapes").indexOf("img1")<0&&i[n].getAttribute("v:shapes").indexOf("Immagine")<0&&i[n].classList.add("e-rte-image-unsupported"),i[n].removeAttribute("v:shapes");i=e.querySelectorAll("img");var o=[],r=[],s=[],a=new RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.)|(blob\:))(\S+))/gi);if(0<i.length){for(var l,n=0;n<i.length;n++)i[n].classList.contains("e-rte-image-unsupported")||(o.push(i[n].getAttribute("src")),l=i[n].getAttribute("src").split("/")[i[n].getAttribute("src").split("/").length-1].split(".")[0]+n,s.push(l));for(var h=this.hexConversion(t),n=0;n<h.length;n++)r.push({base64Data:je(h[n].hex)?null:this.convertToBase64(h[n]),isCroppedImage:h[n].isCroppedImage}),h[n].isCroppedImage&&this.cropImageDimensions.push({goalWidth:h[n].goalWidth,goalHeight:h[n].goalHeight,cropLength:h[n].cropLength,cropTop:h[n].cropTop,cropR:h[n].cropR,cropB:h[n].cropB});for(i=e.querySelectorAll("img:not(.e-rte-image-unsupported"),n=0;n<i.length;n++)o[n].match(a)?i[n].setAttribute("src",o[n]):(je(r[n])||je(r[n].base64Data)?(i[n].removeAttribute("src"),i[n].classList.add("e-rte-image-unsupported")):i[n].setAttribute("src",r[n].base64Data),!je(r[n])&&r[n].isCroppedImage&&i[n].classList.add("e-img-cropped")),i[n].setAttribute("id","msWordImg-"+s[n]);i=e.querySelectorAll(".e-rte-image-unsupported");for(n=0;n<i.length;n++)i[n].removeAttribute("src")}},k9e.prototype.checkVShape=function(e){for(var t,i,n=e.querySelectorAll("*"),o=0;o<n.length;o++)switch(n[o].nodeName){case"V:SHAPETYPE":G(n[o]);break;case"V:SHAPE":"V:IMAGEDATA"===n[o].firstElementChild.nodeName&&(t=n[o].firstElementChild.getAttribute("src"),(i=Q("img")).setAttribute("src",t),n[o].parentElement.insertBefore(i,n[o]),G(n[o]))}},k9e.prototype.convertToBase64=function(e){var t=this.conHexStringToBytes(e.hex),t=this.conBytesToBase64(t);return e.type?"data:"+e.type+";base64,"+t:null},k9e.prototype.conBytesToBase64=function(e){for(var t="",i=e.length,n=0;n<i;n+=3){var o=e.slice(n,n+3),r=o.length,s=[];if(r<3)for(var a=r;a<3;a++)o[a]=0;s[0]=(252&o[0])>>2,s[1]=(3&o[0])<<4|o[1]>>4,s[2]=(15&o[1])<<2|(192&o[2])>>6,s[3]=63&o[2];for(a=0;a<4;a++)t+=a<=r?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(s[a]):"="}return t},k9e.prototype.conHexStringToBytes=function(e){for(var t=[],i=e.length/2,n=0;n<i;n++)t.push(parseInt(e.substr(2*n,2),16));return t},k9e.prototype.hexConversion=function(e){var t,i=RegExp,n=new i("\\{\\\\pict[\\s\\S]+?\\\\bliptag-?\\d+(\\\\blipupi-?\\d+)?(\\{\\\\\\*\\\\blipuid\\s?[\\da-fA-F]+)?[\\s\\}]*?"),i=new i("(?:("+n.source+"))([\\da-fA-F\\s]+)\\}","g"),o=e.match(i),r=[];if(!je(o))for(var s=0;s<o.length;s++)if(-1===o[s].indexOf("fIsBullet")||-1!==o[s].indexOf("wzName")){var a,l=0,h=0,d=0,p=0,c=0,u=0;if(n.test(o[s])){if(-1!==o[s].indexOf("\\pngblip"))t="image/png";else if(-1!==o[s].indexOf("\\jpegblip"))t="image/jpeg";else{if(-1===o[s].indexOf("\\emfblip"))continue;t=null}(a=!!(0<this.extractCropValue("cropl",o[s])&&0<this.extractCropValue("cropt",o[s])||0<this.extractCropValue("cropr",o[s])||this.extractCropValue("cropb",o[s])))&&(l=this.extractCropValue("wgoal",o[s]),h=this.extractCropValue("hgoal",o[s]),d=this.extractCropValue("cropl",o[s]),p=this.extractCropValue("cropt",o[s]),c=this.extractCropValue("cropr",o[s]),u=this.extractCropValue("cropb",o[s])),r.push({hex:t?o[s].replace(n,"").replace(/[^\da-fA-F]/g,""):null,type:t,isCroppedImage:a,goalWidth:l,goalHeight:h,cropLength:d,cropTop:p,cropR:c,cropB:u})}}return r},k9e.prototype.extractCropValue=function(e,t){e=new RegExp("\\\\pic"+e+"(\\-?\\d+)\\\\").exec(t.replace(/\r\n\\/g,"\\").replace(/\n/g,"\\"))[1];return parseInt(e,10)},k9e.prototype.removeClassName=function(e){for(var t=e.querySelectorAll("*[class]:not(.e-img-cropped):not(.e-rte-image-unsupported)"),i=0;i<t.length;i++)t[i].removeAttribute("class")},k9e.prototype.breakLineAddition=function(e){for(var t,i,n=e.querySelectorAll("*"),o=0;o<n.length;o++)0!==n[o].children.length||"&nbsp;"!==n[o].innerHTML||"&nbsp;"!==n[o].innerHTML||n[o].closest("li")||n[o].closest("td")||!("SPAN"!==n[o].nodeName||"SPAN"===n[o].nodeName&&je(n[o].previousElementSibling)&&je(n[o].nextElementSibling))||(t=this.findDetachElem(n[o]),i=Q("br"),0<t.textContent.length&&t.textContent.match(/\u00a0/g)&&0<t.textContent.match(/\u00a0/g).length)||je(t.parentElement)||(t.parentElement.insertBefore(i,t),G(t))},k9e.prototype.findDetachElem=function(e){e=!je(e.parentElement)&&""===e.parentElement.textContent.trim()&&"TD"!==e.parentElement.tagName&&je(e.parentElement.querySelector("img"))?this.findDetachElem(e.parentElement):e;return e},k9e.prototype.removeUnwantedElements=function(e){for(var t=e.querySelector("style"),i=(je(t)||G(t),e.innerHTML),n=0;n<this.removableElements.length;n++){var o=RegExp,r=new o("<"+this.removableElements[n]+"\\s*[^>]*>","g"),o=new o("</"+this.removableElements[n]+">","g");i=(i=i.replace(r,"")).replace(o,"")}e.innerHTML=i,e.querySelectorAll(":empty")},k9e.prototype.findDetachEmptyElem=function(e){return je(e.parentElement)?null:0<e.parentElement.textContent.length&&e.parentElement.textContent.match(/\u00a0/g)&&0<e.parentElement.textContent.match(/\u00a0/g).length||""!==e.parentElement.textContent.trim()||"MSWord-Content"===e.parentElement.getAttribute("id")||this.hasParentWithClass(e,"MsoListParagraph")||!je(e.parentElement.querySelector("img"))?e:this.findDetachEmptyElem(e.parentElement)},k9e.prototype.hasParentWithClass=function(e,t){for(var i=e.parentElement;!je(i);){if(i.classList.contains(t))return!0;i=i.parentElement}return!1},k9e.prototype.removeEmptyElements=function(e){for(var t=e.querySelectorAll(":empty"),i=0;i<t.length;i++){je(t[i].closest("td"))||je(t[i].closest("td").querySelector(".MsoNormal"))||(t[i].innerHTML="-");var n=!0;"DIV"===t[i].tagName&&(n="none"===t[i].style.borderBottom||""===t[i].style.borderBottom),"IMG"===t[i].tagName||"BR"===t[i].tagName||"IFRAME"===t[i].tagName||"TD"===t[i].tagName||"HR"===t[i].tagName||!n||je(n=this.findDetachEmptyElem(t[i]))||G(n)}},k9e.prototype.removeEmptyMetaTags=function(e){for(var t=e.querySelectorAll("meta:empty"),i=t.length-1;0<=i;i--){var n=t[i];""===n.textContent&&G(n)}},k9e.prototype.styleCorrection=function(e,t){var i=e.querySelectorAll("style"),n=[];if(0<i.length){je(i[0].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi))?1<i.length&&(n=i[1].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi)):n=i[0].innerHTML.match(/[\S ]+\s+{[\s\S]+?}/gi);var o=je(n)?null:this.findStyleObject(n);if(!je(o)){var r=Object.keys(o),s=r.map(function(e){return o[""+e]}),s=this.removeUnwantedStyle(s,t);this.filterStyles(e,t);for(var a=void 0,l=!1,h=/^(p|div|li)\.(1|10|11)$/,d=0;d<r.length;d++){if(""===r[d].split(".")[0])a=e.getElementsByClassName(r[d].split(".")[1]),l=!0;else{if(1===r[d].split(".").length&&0<=r[d].split(".")[0].indexOf("@")||h.test(r[d]))continue;a=1===r[d].split(".").length&&r[d].split(".")[0].indexOf("@")<0?e.getElementsByTagName(r[d]):e.querySelectorAll(r[d])}for(var p=0;p<a.length;p++)if(!a[p].closest("li")||"p"!==r[d])if(je(v=a[p].getAttribute("style"))||""===v.trim())s[d]=s[d].replace(/text-indent:-.*?;?/g,"").replace(/border:\s*none;?/g,"").trim(),a[p].style.cssText=s[d];else{for(var c=s[d].split(";"),u=0;u<c.length;u++)"border"===c[u].split(":")[0]&&"none"===c[u].split(":")[1]&&(c.splice(u,1),u--);if(!l)for(var g=0;g<c.length;g++){var m=c[g].split(":")[0];v.includes(m+":")&&(c.splice(g,1),g--)}var f=c.join(";")+";"+v;a[p].style.cssText=f}l=!1}for(var y=["MsoListParagraphCxSpFirst","MsoListParagraphCxSpMiddle","MsoListParagraphCxSpLast"],d=0;d<y.length;d++)if(-1<r.indexOf("li."+y[d]))for(var v,b=e.querySelectorAll("ol."+y[d]+", ul."+y[d]),p=0;p<b.length;p++)if(!je(v=b[p].getAttribute("style"))&&""!==v.trim()&&""!==b[p].style.marginLeft)for(var w,C,c=s[r.indexOf("li."+y[d])].split(";"),g=0;g<c.length;g++)0<="margin-left".indexOf(c[g].split(":")[0])&&!je(c[g].split(":")[1])&&0<=c[g].split(":")[1].indexOf("in")&&0<=b[p].style.marginLeft.indexOf("in")&&(w=parseFloat(c[g].split(":")[1].split("in")[0]),C=parseFloat(b[p].style.marginLeft.split("in")[0]),b[p].style.marginLeft=C-w+"in")}}},k9e.prototype.filterStyles=function(e,t){for(var i=e.querySelectorAll("*[style]"),n=0;n<i.length;n++){for(var o=i[n].getAttribute("style").split(";"),r="",s=0;s<o.length;s++)0<=t.indexOf(o[s].split(":")[0].trim())&&(r+=o[s]+";");i[n].style.cssText=r}},k9e.prototype.removeUnwantedStyle=function(e,t){for(var i=0;i<e.length;i++){var n=e[i].split(";");e[i]="";for(var o=0;o<n.length;o++)0<=t.indexOf(n[o].split(":")[0])&&(e[i]+=n[o]+";")}return e},k9e.prototype.findStyleObject=function(e){for(var t={},i=0;i<e.length;i++){var n=e[i],o=n.replace(/([\S ]+\s+){[\s\S]+?}/gi,"$1"),r=n.replace(/[\S ]+\s+{([\s\S]+?)}/gi,"$1"),o=o.replace(/^[\s]|[\s]$/gm,""),r=r.replace(/^[\s]|[\s]$/gm,"");o=o.replace(/\n|\r|\n\r/g,""),r=r.replace(/\n|\r|\n\r/g,"");for(var s=o.split(", "),a=0;a<s.length;a++)t[s[a]]=r}return t},k9e.prototype.removingComments=function(e){var t=(t=e.innerHTML).replace(/<!--[\s\S]*?-->/g,"");e.innerHTML=t},k9e.prototype.cleanUp=function(e,t){for(var i,n=[],o=e.querySelectorAll("*"),r=0;r<o.length;r++)-1===this.ignorableNodes.indexOf(o[r].nodeName)||3===o[r].nodeType&&""===o[r].textContent.trim()?n.push(o[r]):(o[r].className&&-1!==o[r].className.toLowerCase().indexOf("msolistparagraph")&&!je(o[r].getAttribute("style"))&&0<=o[r].getAttribute("style").indexOf("mso-list:")&&(0<=o[r].className.indexOf("MsoListParagraphCxSpFirst")&&0<t.length&&null!==t[t.length-1]&&t.push(null),t.push(o[r])),!i||-1===this.blockNode.indexOf(o[r].nodeName.toLowerCase())||o[r].className&&-1!==o[r].className.toLowerCase().indexOf("msolistparagraph")&&!je(o[r].getAttribute("style"))&&0<=o[r].getAttribute("style").indexOf("mso-list:")||t.push(null),-1!==this.blockNode.indexOf(o[r].nodeName.toLowerCase())&&(i=!!(o[r].className&&-1!==o[r].className.toLowerCase().indexOf("msolistparagraph")&&!je(o[r].getAttribute("style"))&&0<=o[r].getAttribute("style").indexOf("mso-list:"))));return t.length&&null!==t[t.length-1]&&t.push(null),t},k9e.prototype.listConverter=function(e){for(var t,i,n=[],o=[],r="",s="",a=0;a<e.length;a++)if(null===e[a])n.push({content:this.makeConversion(o),node:e[a-1]}),o=[];else{e[a].getAttribute("style")&&-1!==e[a].getAttribute("style").indexOf("mso-outline-level")&&(e[a].style.cssText=e[a].getAttribute("style").replace("mso-outline-level","mso-outline")),t=(r=e[a].getAttribute("style"))&&-1!==r.indexOf("level")?parseInt(r.charAt(r.indexOf("level")+5),null):1,r&&-1!==r.indexOf("mso-list:")&&(l=void 0,l=!r.match(/mso-list:[^;]+;?/)||je(l=r.replace(new RegExp("\\n","g"),"").split(" ").join("").match(/mso-list:[^;]+;?/)[0].split(":l"))?null:parseInt(l[1].split("level")[0],10)),this.listContents=[],this.getListContent(e[a]);var l,h=void 0,d=void 0;if(!je(this.listContents[0])){var p=1<this.listContents[0].trim().length?"ol":"ul",c=this.getlistStyleType(this.listContents[0],p);"ol"!=p||0!==a&&null!==e[a-1]||(m=this.listContents[0].split(".")[0],-1===["A","a","I","i","α","1","01","1-"].indexOf(m)&&("decimal"===c||"decimal-leading-zero"===c?isNaN(parseInt(m,10))||(h=parseInt(m,10)):"upper-alpha"===c?h=m.split(".")[0].charCodeAt(0)-64:"lower-alpha"===c?h=m.split(".")[0].charCodeAt(0)-96:"upper-roman"===c?h=this.upperRomanNumber.indexOf(this.listContents[0].split(".")[0])+1:"lower-roman"===c?h=this.lowerRomanNumber.indexOf(this.listContents[0].split(".")[0])+1:"lower-greek"===c&&(h=this.lowerGreekNumber.indexOf(this.listContents[0].split(".")[0])+1))),""!==e[a].style.marginLeft&&(d=e[a].style.marginLeft);for(var u=[],g=1;g<this.listContents.length;g++)u.push(this.listContents[g]);var m=void 0;je(e[a].className)||(m=e[a].className),je(e[a].getAttribute("style"))||(e[a].style.cssText=e[a].getAttribute("style").replace("text-align:start;",""),e[a].style.textIndent="",s=e[a].getAttribute("style")),o.push({listType:p,content:u,nestedLevel:t,listFormatOverride:l,class:m,listStyle:s,listStyleTypeName:c,start:h,styleMarginLeft:d})}}for(i=e.shift();i;){for(var f=[],y=0;y<n.length;y++)if(n[y].node===i){for(var v=0;v<n[y].content.childNodes.length;v++)f.push(n[y].content.childNodes[v]);for(v=0;v<f.length;v++)i.parentElement.insertBefore(f[v],i);break}i.remove(),i=(i=e.shift())||e.shift()}},k9e.prototype.getlistStyleType=function(e,t){var i;if("ol"===t){t=e.split(".")[0].charCodeAt(0);switch(!0){case-1<this.upperRomanNumber.indexOf(e.split(".")[0]):i="upper-roman";break;case-1<this.lowerRomanNumber.indexOf(e.split(".")[0]):i="lower-roman";break;case-1<this.lowerGreekNumber.indexOf(e.split(".")[0]):i="lower-greek";break;case 64<t&&t<91:i="upper-alpha";break;case 96<t&&t<123:i="lower-alpha";break;case 1<e.split(".")[0].length&&"0"===e.split(".")[0][0]&&!isNaN(Number(e.split(".")[0])):i="decimal-leading-zero";break;default:i="decimal"}}else switch(e.split(".")[0]){case"o":i="circle";break;case"§":i="square";break;default:i="disc"}return i},k9e.prototype.makeConversion=function(e){for(var t,i,n=Q("div"),o=1,r=0,s=e[0].listFormatOverride,a=0;a<e.length;a++){for(var l=["MsoListParagraphCxSpFirst","MsoListParagraphCxSpMiddle","MsoListParagraphCxSpLast"],h=!1,d=0;d<l.length;d++)if(0<=l[d].indexOf(e[a].class)){h=!0;break}je(u)||0===a||e[a-1].listType===e[a].listType||h||(u=null);var p=Q("p",{className:"MsoNoSpacing"});if(p.innerHTML=e[a].content.join(" "),1!==e[a].nestedLevel||0!==r&&s===e[a].listFormatOverride||!e[a].content){if(e[a].nestedLevel===o&&s===e[a].listFormatOverride)je(u)||je(u.parentElement)||u.parentElement.tagName.toLowerCase()!==e[a].listType?je(u)?((t=Q(e[a].listType)).style.listStyleType=e[a].listStyleTypeName,(u=Q("li")).appendChild(p),t.appendChild(u),t.setAttribute("level",e[a].nestedLevel.toString()),n.appendChild(t)):((t=Q(e[a].listType)).style.listStyleType=e[a].listStyleTypeName,u.parentElement.parentElement.appendChild(t),(u=Q("li")).appendChild(p),t.appendChild(u),t.setAttribute("level",e[a].nestedLevel.toString())):(u.parentElement.appendChild(u=Q("li")),u.appendChild(p));else if(e[a].nestedLevel>o){if(je(u))if(e[a].nestedLevel>o&&h){var c=Q(e[a].listType),u=Q("li");c.appendChild(u),c.style.listStyleType="none";for(g=0;g<e[a].nestedLevel-1;g++)u.appendChild(t=Q(e[a].listType)),u=Q("li"),t.appendChild(u),t.style.listStyleType="none";u.appendChild(p),n.appendChild(c),t.setAttribute("level",e[a].nestedLevel.toString())}else n.appendChild(t=Q(e[a].listType)),(u=Q("li")).appendChild(p),t.appendChild(u),t.setAttribute("level",e[a].nestedLevel.toString()),"msolistparagraph"!==e[a].class?t.style.marginLeft=e[a].styleMarginLeft:U([t],"marginLeftIgnore");else{for(var g=0;g<e[a].nestedLevel-o;g++)u.appendChild(t=Q(e[a].listType)),u=Q("li"),g!==e[a].nestedLevel-o-1&&1<e[a].nestedLevel-o&&(u.style.listStyleType="none"),t.appendChild(u);u.appendChild(p),t.setAttribute("level",e[a].nestedLevel.toString())}t.style.listStyleType=e[a].listStyleTypeName}else if(1===e[a].nestedLevel)n.lastChild.tagName.toLowerCase()===e[a].listType?t=n.lastChild:(n.appendChild(t=Q(e[a].listType)),t.style.listStyleType=e[a].listStyleTypeName),(u=Q("li")).appendChild(p),t.appendChild(u),t.setAttribute("level",e[a].nestedLevel.toString());else for(i=u;i.parentElement;)if((i=i.parentElement).attributes.getNamedItem("level")){if(parseInt(i.attributes.getNamedItem("level").textContent,10)===e[a].nestedLevel&&s===e[a].listFormatOverride){(u=Q("li")).appendChild(p),i.appendChild(u);break}if(parseInt(i.attributes.getNamedItem("level").textContent,null)===e[a].nestedLevel&&s!==e[a].listFormatOverride){if(t=Q(e[a].listType),u=Q("li"),t.appendChild(u),1<e[a].nestedLevel)for(var m=0;m<e[a].nestedLevel-1;m++)u.appendChild(t=Q(e[a].listType)),u=Q("li"),t.appendChild(u),t.style.listStyleType="none";u.appendChild(p),i.appendChild(t),t.setAttribute("level",e[a].nestedLevel.toString()),t.style.listStyleType=e[a].listStyleTypeName;break}if(e[a].nestedLevel>parseInt(i.attributes.getNamedItem("level").textContent,10)){i.appendChild(t=Q(e[a].listType)),(u=Q("li")).appendChild(p),t.appendChild(u),t.setAttribute("level",e[a].nestedLevel.toString()),t.style.listStyleType=e[a].listStyleTypeName;break}}}else n.appendChild(t=Q(e[a].listType,{className:e[a].class})),(u=Q("li")).appendChild(p),t.appendChild(u),t.setAttribute("level",e[a].nestedLevel.toString()),"msolistparagraph"!==e[a].class?t.style.marginLeft=e[a].styleMarginLeft:U([t],"marginLeftIgnore"),t.style.listStyleType=e[a].listStyleTypeName;u.setAttribute("class",e[a].class),u.style.cssText=je(e[a].listStyle)?"":e[a].listStyle,o=e[a].nestedLevel,s=e[a].listFormatOverride,r++,je(e[a].start&&1!==e[a].start&&"ol"===e[a].listType)||t.setAttribute("start",e[a].start.toString())}return n},k9e.prototype.getListContent=function(e){var t=e.firstElementChild;if(""!==t.textContent.trim()||je(t.firstElementChild)||"IMG"!==t.firstElementChild.nodeName){if(0<t.childNodes.length){for(var i=t.querySelectorAll('[style*="mso-list"]'),n=0;n<i.length;n++)i[n].setAttribute("style",i[n].getAttribute("style").replace(/\n/g,""));var o,r=t.querySelector('span[style*="mso-list"]'),r=(r&&(s=r.getAttribute("style"))&&(s=s.replace(/\s*:\s*/g,":"),r.setAttribute("style",s)),t.querySelector('span[style="mso-list:Ignore"]')),s=je(r);je(r=s?t:r)||(t=r.textContent.trim(),s&&(je(o=t.match(/^(\d{1,2}|[a-zA-Z]|[*#~•○■])(\.|\)|-)\s*/))||(t=o[0].trim(),r.textContent=r.textContent.trim().substring(t.length).trim())),this.listContents.push(t),s||G(r),this.removingComments(e),this.removeUnwantedElements(e))}}else o=e.innerHTML.trim(),this.listContents.push(""),this.listContents.push(o);this.listContents.push(e.innerHTML)},k9e.prototype.processMargin=function(e){var t=e.querySelectorAll("li");if(0<t.length)for(var i=0;i<t.length;i++)je(t[i].style.marginLeft)||t[i].parentElement.classList.contains("marginLeftIgnore")||(t[i].style.marginLeft="");var n=e.querySelectorAll("table");if(0<n.length)for(i=0;i<n.length;i++)!je(n[i].style.marginLeft)&&0<=n[i].style.marginLeft.indexOf("-")&&(n[i].style.marginLeft="");var o=e.querySelectorAll(".marginLeftIgnore li");if(0<o.length)for(var r,i=0;i<o.length;i++)je(o[i].style.marginLeft)||""===o[i].style.marginLeft||(r=o[i].style.marginLeft,r=parseFloat(r.split("in")[0])-.5,o[i].style.marginLeft=r.toString()+"in")},k9e.prototype.removeEmptyAnchorTag=function(e){for(var t=e.querySelectorAll("a:not([href])"),i=t.length-1;0<=i;i--){for(var n=t[i].parentNode;t[i].firstChild;)n.insertBefore(t[i].firstChild,t[i]);n.removeChild(t[i])}},k9e.prototype.findSource=function(e){for(var t=e.querySelectorAll("meta"),i=0;i<t.length;i++){var n=t[i],o=n.getAttribute("content"),n=n.getAttribute("name");if(n&&0<=n.toLowerCase().indexOf("generator")&&o&&0<=o.toLowerCase().indexOf("microsoft"))for(var r=0;r<BUe.length;r++)if(0<=o.toLowerCase().indexOf(BUe[r]))return BUe[r]}return"html"},k9e.prototype.handleOneNoteContent=function(e){var t=e.querySelectorAll("ul, ol");if(0<t.length)for(var i=0;i<t.length;i++){var n=t[i];0===n.querySelectorAll("li").length&&0<n.childNodes.length&&b7e.unwrap(n)}},k9e.prototype.destroy=function(){this.removeEventListener()};var M9e=k9e;function k9e(e){this.olData=["decimal","decimal-leading-zero","lower-alpha","lower-roman","upper-alpha","upper-roman","lower-greek"],this.ulData=["disc","square","circle","disc","square","circle"],this.ignorableNodes=["A","APPLET","B","BLOCKQUOTE","BR","BUTTON","CENTER","CODE","COL","COLGROUP","DD","DEL","DFN","DIR","DIV","DL","DT","EM","FIELDSET","FONT","FORM","FRAME","FRAMESET","H1","H2","H3","H4","H5","H6","HR","I","IMG","IFRAME","INPUT","INS","LABEL","LI","OL","OPTION","P","PARAM","PRE","Q","S","SELECT","SPAN","STRIKE","STRONG","SUB","SUP","TABLE","TBODY","TD","TEXTAREA","TFOOT","TH","THEAD","TITLE","TR","TT","U","UL"],this.blockNode=["div","p","h1","h2","h3","h4","h5","h6","address","blockquote","button","center","dd","dir","dl","dt","fieldset","frameset","hr","iframe","isindex","li","map","menu","noframes","noscript","object","ol","pre","table","tbody","td","tfoot","th","thead","tr","ul","header","article","nav","footer","section","aside","main","figure","figcaption"],this.borderStyle=["border-top","border-right","border-bottom","border-left"],this.upperRomanNumber=["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI","XVII","XVIII","XIX","XX"],this.lowerRomanNumber=["i","ii","iii","iv","v","vi","vii","viii","ix","x","xi","xii","xiii","xiv","xv","xvi","xvii","xviii","xix","xx"],this.lowerGreekNumber=["α","β","γ","δ","ε","ζ","η","θ","ι","κ","λ","μ","ν","ξ","ο","π","ρ","σ","τ","υ","φ","χ","ψ","ω"],this.removableElements=["o:p","style","w:sdt"],this.listContents=[],this.cropImageDimensions=[],this.parent=e,this.addEventListener()}B9e.prototype.addEventListener=function(){this.parent.observer.on(MUe,this.insertText,this),this.parent.observer.on(v7e,this.destroy,this)},B9e.prototype.removeEventListener=function(){this.parent.observer.off(MUe,this.insertText),this.parent.observer.off(v7e,this.destroy)},B9e.prototype.insertText=function(e){var t=document.createTextNode(e.value);A7e.Insert(this.parent.currentDocument,t,this.parent.editableElement),e.callBack&&e.callBack({requestType:e.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},B9e.prototype.destroy=function(){this.removeEventListener()};var P9e=B9e;function B9e(e){this.parent=e,this.addEventListener()}L9e.prototype.addEventListener=function(){this.parent.observer.on(m7e,this.emojiInsert,this),this.parent.observer.on(v7e,this.destroy,this)},L9e.prototype.removeEventListener=function(){this.parent.observer.off(m7e,this.emojiInsert),this.parent.observer.off(v7e,this.destroy)},L9e.prototype.emojiInsert=function(e){for(var t=document.createTextNode(e.value),i=this.parent.currentDocument.getSelection(),n=i.getRangeAt(0).startOffset,o=n-1;n-15<=o;o--){var r=i.focusNode.textContent.substring(o-1,o);if(/:$/.test(r)){this.beforeApplyFormat(!0);break}}var s=/:$/.test(i.focusNode.textContent.charAt(n-1)),a=i.focusNode.textContent.charAt(n-2),a=/\s/.test(a),s=(s&&(a||1===i.focusOffset)&&this.beforeApplyFormat(!0),i.focusNode),a=z("#text"===s.nodeName?s.parentNode:s,"a");a?0===n?a.parentNode.insertBefore(t,a):n===s.textContent.length&&(a.parentNode.insertBefore(t,a.nextSibling),new _9e(a).setCursorPoint(this.parent.currentDocument,a.nextSibling,a.nextSibling.textContent.length)):A7e.Insert(this.parent.currentDocument,t,this.parent.editableElement),e.callBack&&e.callBack({requestType:e.subCommand,editorMode:"HTML",event:e.event,range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},L9e.prototype.beforeApplyFormat=function(e){var t=this.parent.nodeSelection.getRange(this.parent.currentDocument),i=this.parent.nodeSelection.getNodeCollection(t)[0],n=!(":"===i.parentElement.innerHTML.replace(/&nbsp;|<br>/g,"").trim()||0===i.textContent.trim().indexOf("/")),o=i;if(n&&e)for(;o!==this.parent.editableElement;)o=o.parentElement;for(var r=t.startOffset;-1===this.parent.nodeSelection.getRange(this.parent.editableElement.ownerDocument).toString().indexOf(":");)this.parent.nodeSelection.setSelectionText(this.parent.editableElement.ownerDocument,i,i,r,t.endOffset),r--;n=this.parent.nodeSelection.getRange(this.parent.currentDocument),e=this.parent.nodeCutter.GetSpliceNode(n,i);e.parentNode.removeChild(e)},L9e.prototype.destroy=function(){this.removeEventListener()};var F9e=L9e;function L9e(e){this.parent=e,this.addEventListener()}O9e.prototype.addEventListener=function(){this.parent.observer.on(u7e,this.actionHandler,this),this.parent.observer.on(a7e,this.onPropertyChanged,this),this.parent.observer.on(v7e,this.destroy,this)},O9e.prototype.onPropertyChanged=function(e){e&&"formatPainter"===e.module&&(je(e.newProp.formatPainterSettings.allowedFormats)||(this.settings.allowedFormats=e.newProp.formatPainterSettings.allowedFormats),je(e.newProp.formatPainterSettings.deniedFormats)||(this.settings.deniedFormats=e.newProp.formatPainterSettings.deniedFormats,this.setDeniedFormats()))},O9e.prototype.removeEventListener=function(){this.parent.observer.off(u7e,this.actionHandler),this.parent.observer.off(a7e,this.onPropertyChanged),this.parent.observer.off(v7e,this.destroy)},O9e.prototype.destroy=function(){this.removeEventListener(),this.INVALID_TAGS=null,this.copyCollection=null,this.deniedFormatsCollection=null,this.newElem=null,this.newElemLastChild=null,this.settings=null,this.parent=null},O9e.prototype.actionHandler=function(e){if(this.settings.allowedContext=["Text","List","Table"],!je(e)&&!je(e.item)&&!je(e.item.formatPainterAction)){switch(e.item.formatPainterAction){case"format-copy":this.copyAction();break;case"format-paste":this.pasteAction();break;case"escape":this.escapeAction()}this.callBack(e)}},O9e.prototype.callBack=function(e){e.callBack&&e.callBack({requestType:"FormatPainter",action:e.item.formatPainterAction,event:e.event,editorMode:"HTML",range:this.parent.nodeSelection.getRange(this.parent.currentDocument),elements:this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)})},O9e.prototype.generateElement=function(){for(var e,t=this.copyCollection.slice(),i=(t.reverse(),t.length),n=Q("div",{className:"e-format-paste-wrapper"}),o=0;o<i;o++){var r=t[o],s=r.attrs,a=r.className,l=r.styles,h=Q(r.tagName);""!==a&&(h.className=a);for(var d=0;d<s.length;d++){var p=s[d].name,c=s[d].value;h.setAttribute(p,c)}for(var u=0;u<l.length;u++){var p=l[u].property,c=l[u].value,g=l[u].priority;h.style.setProperty(p,c,g)}e=((0===n.childElementCount?n:e).append(h),h)}for(var m=this.removeDeniedFormats(n),f=m;f;)f=null===f.firstChild?void(e=f):f.firstChild;this.newElem=m,this.newElemLastChild=e},O9e.prototype.pasteAction=function(){je(this.copyCollection)||0===this.copyCollection.length?this.paintPlainTextFormat():this.insertFormatNode(this.newElem,this.newElemLastChild)},O9e.prototype.removeDeniedFormats=function(e){if(!je(this.deniedFormatsCollection)&&0<this.deniedFormatsCollection.length)for(var t=this.deniedFormatsCollection,i=t.length,n=0;n<i;n++){var o=t[n].tag;if(t[n].tag)for(var r=e.querySelectorAll(o),s=0;s<r.length;s++){if(0<t[n].classes.length){for(var a=t[n].classes,l=a.length,h=0;h<l;h++)r[s].classList.contains(a[h])&&q([r[s]],a[h].trim());0===r[s].classList.length&&r[s].removeAttribute("class")}if(0<t[n].styles.length){for(var d=t[n].styles,p=d.length,h=0;h<p;h++)r[s].style.removeProperty(d[h].trim());0===r[s].style.length&&r[s].removeAttribute("style")}if(0<t[n].attributes.length)for(var c=t[n].attributes,u=c.length,h=0;h<u;h++)r[s].removeAttribute(c[h].trim())}}return e.firstElementChild},O9e.prototype.copyAction=function(){var e=[],t=this.parent.nodeSelection.getRange(this.parent.currentDocument),i=this.parent.nodeSelection,n=t.collapsed?i.getSelectionNodeCollection(t):i.getSelectionNodeCollectionBr(t);if(0!==n.length||0!==i.getSelectionNodeCollectionBr(t).length){for(var o=(n=0===n.length?i.getSelectionNodeCollectionBr(t):n)[0].parentElement,i=this.findCurrentContext(o),r=-1<this.settings.allowedFormats.indexOf(";")?this.settings.allowedFormats.split(";"):[this.settings.allowedFormats],s=0;s<r.length;s++)r[s]=r[s].trim();var n=this.getRangeParentElem(i,o),a=n[0],n=n[1];if(!je(i=null===i?n:i)&&-1<this.settings.allowedContext.indexOf(i)){var l=o="#text"===t.startContainer.nodeName?t.startContainer.parentElement:o;do{if(-1<r.indexOf(o.nodeName.toLowerCase())){for(var h=o.attributes,d=[],s=0;s<h.length;s++)"class"!==h[s].name&&"style"!==h[s].name&&d.push(h[s]);for(var p=o.className,c=o.style,u=[],s=0;s<c.length;s++){var g=c[s],m=c.getPropertyValue(g),f=c.getPropertyPriority(g);u.push({property:g,value:m,priority:f})}e.push({attrs:d,className:p,styles:u,tagName:o.nodeName})}}while((a===o?o=void 0:je(o.parentElement)||(o=o.parentElement),l!==o)&&(!je(o)||o===this.parent.editableElement));this.copyCollection=e}this.generateElement()}},O9e.prototype.getRangeParentElem=function(e,t){var i,n=t;switch(3===n.nodeType&&(n=n.parentElement),e){case"Table":je(i=z(n,"td"))&&(i=z(n,"th"));break;case"List":i=z(n,"li");break;case"Text":i=z(n,"p")}return je(i)&&!je(t=this.getNearestBlockParentElement(t))&&"UL"!==t&&"OL"!==t&&"LI"!==t&&(i=z(n,t),e="Text"),[i="List"===e?i.parentElement:i,e]},O9e.prototype.getNearestBlockParentElement=function(e){var t=e;for(3===t.nodeType&&(t=t.parentNode);t&&t!==this.parent.editableElement;){if(!je(t)&&this.isBlockElement(t))return t.nodeName;t=t.parentNode}return null},O9e.prototype.isBlockElement=function(e){return-1<["P","DIV","UL","OL","LI","H1","H2","H3","H4","H5","H6","ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","FIGCAPTION","FIGURE","FOOTER","HEADER","HR","MAIN","NAV","SECTION","SUMMARY","PRE"].indexOf(e.nodeName)},O9e.prototype.escapeAction=function(){this.copyCollection=[]},O9e.prototype.paintPlainTextFormat=function(){var e,t=this.parent.nodeSelection.getRange(this.parent.currentDocument),i=this.parent.nodeSelection,n=t.collapsed?i.getSelectionNodeCollection(t):i.getSelectionNodeCollectionBr(t);if(1<n.length)for(var o=0;o<n.length;o++)e=this.validateELementTag(n[o]);else e=this.validateELementTag(t.startContainer)&&this.validateELementTag(t.endContainer);e||this.parent.execCommand("Clear","ClearFormat",null,null)},O9e.prototype.validateELementTag=function(e){return 3===e.nodeType&&(e=e.parentElement),-1<this.INVALID_TAGS.indexOf(e.tagName)},O9e.prototype.findCurrentContext=function(e){var t=z(e,"p"),i=z(e,"li");return t&&!i?"Text":z(e,"li")?je(t)||je(i)||t.textContent.trim()===i.textContent.trim()?"List":"Text":z(e,"td")||z(e,"tr")||z(e,"th")?"Table":null},O9e.prototype.insertFormatNode=function(e,t){for(var i,n=e.cloneNode(!0),e=(this.isBlockElement(e)||((o=Q("P")).appendChild(e),n=o.cloneNode(!0)),this.parent.editableElement),o=this.parent.currentDocument,r=n.firstChild;r;){if(!this.isBlockElement(r)){i=r.parentNode.removeChild(r);break}r=r.firstChild}y9e.applyFormat(o,null,e,"P",null,"formatPainter",null,{element:i,lastChild:t});var e=this.parent.nodeSelection.getRange(o),t=e.collapsed,s=this.parent.domNode.blockNodes();if(this.isListCopied())for(var a=0;a<s.length;a++)z(s[a],"li")&&(s[a]=z(s[a],"li"));var l=!1;1===s.length&&(l=s[0].textContent.trim()===e.toString().trim()),(this.isBlockElement(n)&&t||1<s.length||l)&&this.insertBlockNode(n,e,o,s)},O9e.prototype.isListCopied=function(){for(var e=!1,t=0;t<this.copyCollection.length;t++)if("OL"===this.copyCollection[t].tagName||"UL"===this.copyCollection[t].tagName){e=!0;break}return e},O9e.prototype.insertBlockNode=function(e,t,i,n){for(var o,r,i=this.parent.nodeSelection.save(t,i),s=(this.parent.domNode.setMarker(i),!1),a=("UL"!==e.nodeName&&"OL"!==e.nodeName||(o=(r=e.cloneNode(!0)).firstChild),je(r)?e:e.firstChild),l=0;l<n.length;l++)if(!(-1<this.INVALID_TAGS.indexOf(n[l].nodeName)||0<n[l].querySelectorAll("img,audio,video,iframe").length)){for(var h=a.cloneNode(!1);n[l].firstChild;)0!==n[l].textContent.trim().length?h.appendChild(n[l].firstChild):n[l].removeChild(n[l].firstChild);if("TD"===n[l].nodeName||"TH"===n[l].nodeName)(je(r)||0!==l||je(r)?n[l]:(n[l].appendChild(r),r)).appendChild(h);else if(je(r)||(s=this.isSameListType(e,n[l])),"LI"!==h.nodeName||s?s?this.insertSameList(n,l,r,h):n[l].parentNode.replaceChild(h,n[l]):this.insertNewList(t,n,l,r,h),"LI"!==h.nodeName&&("OL"===h.parentElement.nodeName||"UL"===h.parentElement.nodeName)){var d=h.parentElement;if(this.parent.nodeCutter.SplitNode(t,d,!0),je(d.previousElementSibling))d.parentElement.prepend(h);else if(d.previousElementSibling.after(h),1<h.childNodes.length)for(var p=0;p<h.childNodes.length;p++){var c=h.childNodes[p];"OL"!==c.nodeName&&"UL"!==c.nodeName||h.after(c)}}}je(o)||G(o),this.cleanEmptyLists(),this.parent.domNode.saveMarker(i).restore()},O9e.prototype.insertNewList=function(e,t,i,n,o){if(0===i){var r,s=t[i].nodeName,s=(t[i]=t[i].parentNode.replaceChild(n,t[i]),"LI"===s?n.parentElement:n);if(this.parent.nodeCutter.SplitNode(e,s,!0),"LI"!==t[i].nodeName||je(s))if(je(s))n.append(o);else if(je(s.previousElementSibling)||s.previousElementSibling.nodeName!==n.nodeName)if(je(s.nextElementSibling)||s.nextElementSibling.nodeName!==n.nodeName)n.append(o);else for((r=s.nextElementSibling).prepend(o);r.firstChild;)n.append(r.firstChild);else for((r=s.previousElementSibling).append(o);r.firstChild;)n.append(r.firstChild);else n.append(o),je(s.parentNode)||s.parentNode.insertBefore(n,s)}else n.append(o);this.detachEmptyBlockNodes(t[i])},O9e.prototype.insertSameList=function(e,t,i,n){if(0===t){if(!je(e[t].parentNode)&&("UL"===e[t].parentNode.nodeName||"OL"===e[t].parentNode.nodeName)){if(1===e.length){for(;n.firstChild;)e[t].append(n.firstChild);for(var o=0;o<e[t].parentNode.childNodes.length;o++){var r=e[t].parentNode.childNodes[o];i.append(r.cloneNode(!0))}}else i.append(n);e[t].parentNode.parentNode.replaceChild(i,e[t].parentNode)}}else i.append(n);this.detachEmptyBlockNodes(e[t])},O9e.prototype.isSameListType=function(e,t){var i=!1,t=z(t,"ol, ul");return i=!je(t)&&0<t.querySelectorAll("li").length?t.nodeName===e.nodeName:i},O9e.prototype.cleanEmptyLists=function(){for(var e=this.parent.editableElement.querySelectorAll("ol, ul"),t=0;t<e.length;t++)""===e[t].textContent.trim()&&G(e[t])},O9e.prototype.setDeniedFormats=function(){var e=[];if(!je(this.settings)&&!je(this.settings.deniedFormats)){for(var t=-1<this.settings.deniedFormats.indexOf(";")?this.settings.deniedFormats.split(";"):[this.settings.deniedFormats],i=t.length,n=0;n<i;n++){var o=t[n];""!==o&&(o.trim(),je(o=this.makeDeniedFormatsCollection(o))||e.push(o))}this.deniedFormatsCollection=e}},O9e.prototype.detachEmptyBlockNodes=function(e){je(e)||""!==e.textContent.trim()||G(e)},O9e.prototype.makeDeniedFormatsCollection=function(e){var t,i=e.indexOf("("),n=e.indexOf(")"),o=e.indexOf("["),r=e.indexOf("]"),s=e.indexOf("{"),a=e.indexOf("}"),l=[],h=[],d=[],n=(-1<i&&-1<n&&(l=e.substring(i+1,n).split(" ")[0].split(")")[0].split(",")),-1<o&&-1<r&&(h=e.substring(o+1,r).split(",")),-1<s&&-1<a&&(d=e.substring(s+1,a).split(",")),[i,o,s]),r=(n=n.filter(function(e){return-1<e})).length;return 1===r?t=n[0]:2===r?t=Math.min(n[0],n[1]):3===r&&(t=Math.min(n[0],n[1],n[2])),{tag:e.substring(0,t).trim(),styles:d,classes:l,attributes:h}};var R9e=O9e;function O9e(e,t){this.INVALID_TAGS=["A","AUDIO","IMG","VIDEO","IFRAME"],this.parent=e,this.settings=t,this.addEventListener(),this.setDeniedFormats()}V9e.prototype.wireEvents=function(){this.observer.on(e7e,this.editorKeyDown,this),this.observer.on(s7e,this.editorKeyUp,this),this.observer.on(s7e,this.editorKeyUp,this),this.observer.on(l7e,this.onPropertyChanged,this),this.observer.on(d7e,this.onWordPaste,this),this.observer.on(p7e,this.onBegin,this),this.observer.on(f7e,this.editorMouseDown,this),this.observer.on(y7e,this.destroy,this)},V9e.prototype.unwireEvents=function(){this.observer.off(e7e,this.editorKeyDown),this.observer.off(s7e,this.editorKeyUp),this.observer.off(s7e,this.editorKeyUp),this.observer.off(l7e,this.onPropertyChanged),this.observer.off(d7e,this.onWordPaste),this.observer.off(p7e,this.onBegin),this.observer.off(f7e,this.editorMouseDown),this.observer.off(y7e,this.destroy)},V9e.prototype.onWordPaste=function(e){this.observer.notify(h7e,e)},V9e.prototype.onPropertyChanged=function(e){this.observer.notify(a7e,e)},V9e.prototype.editorKeyDown=function(e){this.observer.notify(n7e,e)},V9e.prototype.editorKeyUp=function(e){this.observer.notify(r7e,e)},V9e.prototype.onBegin=function(e){this.observer.notify(c7e,e)},V9e.prototype.execCommand=function(e,t,i,n,o,r,s,a){switch(e.toLowerCase()){case"lists":this.observer.notify(o7e,{subCommand:t,event:i,callBack:n,selector:s,item:r,enterAction:a});break;case"formats":this.observer.notify(i7e,{subCommand:t,event:i,callBack:n,selector:s,exeValue:r,enterAction:a});break;case"alignments":this.observer.notify(SUe,{subCommand:t,event:i,callBack:n,selector:s,value:r,enterAction:a});break;case"indents":this.observer.notify(AUe,{subCommand:t,event:i,callBack:n,selector:s,enterAction:a});break;case"links":this.observer.notify(aUe,{command:e,value:t,item:r,event:i,callBack:n,enterAction:a});break;case"files":this.observer.notify(nUe,{command:e,value:"Image",item:r,event:i,callBack:n,selector:s});break;case"images":this.observer.notify(nUe,{command:e,value:t,item:r,event:i,callBack:n,selector:s});break;case"audios":this.observer.notify(oUe,{command:e,value:t,item:r,event:i,callBack:n,selector:s});break;case"videos":this.observer.notify(rUe,{command:e,value:t,item:r,event:i,callBack:n,selector:s});break;case"table":switch(t.toString().toLocaleLowerCase()){case"createtable":this.observer.notify(sUe,{item:r,event:i,callBack:n,enterAction:a});break;case"insertrowbefore":case"insertrowafter":this.observer.notify(lUe,{item:r,event:i,callBack:n});break;case"insertcolumnleft":case"insertcolumnright":this.observer.notify(hUe,{item:r,event:i,callBack:n});break;case"deleterow":this.observer.notify(dUe,{item:r,event:i,callBack:n});break;case"deletecolumn":this.observer.notify(pUe,{item:r,event:i,callBack:n});break;case"tableremove":this.observer.notify(cUe,{item:r,event:i,callBack:n});break;case"tableheader":this.observer.notify(uUe,{item:r,event:i,callBack:n});break;case"aligntop":case"alignmiddle":case"alignbottom":this.observer.notify(gUe,{item:r,event:i,callBack:n});break;case"merge":this.observer.notify(mUe,{item:r,event:i,callBack:n});break;case"horizontalsplit":this.observer.notify(yUe,{item:r,event:i,callBack:n});break;case"verticalsplit":this.observer.notify(fUe,{item:r,event:i,callBack:n});break;case"dashed":this.observer.notify(vUe,{item:r,event:i,callBack:n});break;case"alternate":this.observer.notify(bUe,{item:r,event:i,callBack:n});break;case"backgroundcolor":this.observer.notify(wUe,{subCommand:t,value:r,event:i,callBack:n})}break;case"font":case"style":case"effects":case"casing":this.observer.notify(EUe,{subCommand:t,event:i,callBack:n,value:o,selector:s,enterAction:a});break;case"inserthtml":this.observer.notify(DUe,{subCommand:t,callBack:n,value:o,enterAction:a});break;case"inserttext":this.observer.notify(MUe,{subCommand:t,callBack:n,value:o});break;case"clear":this.observer.notify(kUe,{subCommand:t,event:i,callBack:n,selector:s,enterAction:a});break;case"actions":this.observer.notify(t7e,{subCommand:t,event:i,callBack:n,selector:s});break;case"formatpainter":this.observer.notify(u7e,{item:r,subCommand:t,event:i,callBack:n});break;case"emojipicker":this.observer.notify(m7e,{item:r,subCommand:t,value:o,event:i,callBack:n})}},V9e.prototype.editorMouseDown=function(e){var t;3===e.args.detail&&this.tripleClickSelection(e.args),-1!==F.userAgent.indexOf("Safari")&&(500<(t=(new Date).getTime())-this.lastClickTime&&(this.clickCount=0),this.clickCount++,this.lastClickTime=t,3===this.clickCount)&&(this.tripleClickSelection(e.args),this.clickCount=0)},V9e.prototype.tripleClickSelection=function(e){var t,i=this.nodeSelection.getRange(this.currentDocument),n=this.nodeSelection.get(this.currentDocument),o=new I7e(this.editableElement);0<n.rangeCount&&""!==n.toString()&&(n=this.getParentBlockNode(i.startContainer),i=this.getParentBlockNode(i.endContainer),n)&&i&&n===i&&(t=this.currentDocument.createRange(),n=o.getFirstTextNode(n),o=o.getLastTextNode(i),n)&&o&&(t.setStart(n,0),t.setEnd(o,o.textContent.length),this.nodeSelection.setRange(this.currentDocument,t),e.preventDefault())},V9e.prototype.getParentBlockNode=function(e){var t=this.currentDocument.createTreeWalker(this.editableElement,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return window.getComputedStyle(e).display.indexOf("inline")<0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t.currentNode=e,t.parentNode()},V9e.prototype.destroy=function(){this.isDestroyed||(this.unwireEvents(),this.observer.notify(v7e),this.editableElement&&(this.editableElement=null),this.currentDocument=null,this.nodeCutter&&(this.nodeCutter=null),this.domNode&&(this.domNode=null),this.listObj&&(this.listObj=null),this.formatObj&&(this.formatObj=null),this.alignmentObj&&(this.alignmentObj=null),this.indentsObj&&(this.indentsObj=null),this.linkObj&&(this.linkObj=null),this.imgObj&&(this.imgObj=null),this.audioObj&&(this.audioObj=null),this.videoObj&&(this.videoObj=null),this.selectionObj&&(this.selectionObj=null),this.inserthtmlObj&&(this.inserthtmlObj=null),this.insertTextObj&&(this.insertTextObj=null),this.clearObj&&(this.clearObj=null),this.tableObj&&(this.tableObj=null),this.msWordPaste&&(this.msWordPaste=null),this.formatPainterEditor&&(this.formatPainterEditor=null),this.emojiPickerObj&&(this.emojiPickerObj=null),this.tableCellSelection&&(this.tableCellSelection=null),this.userAgentData=null,this.isDestroyed=!0)},V9e.prototype.beforeSlashMenuApplyFormat=function(){for(var e=this.nodeSelection.getRange(this.currentDocument),t=this.nodeSelection.getNodeCollection(e)[0],i=e.startOffset;-1===this.nodeSelection.getRange(document).toString().indexOf("/");)this.nodeSelection.setSelectionText(document,t,t,i,e.endOffset),i--;var n=this.nodeSelection.getRange(this.currentDocument),n=this.nodeCutter.GetSpliceNode(n,t),o=n.previousSibling;n.parentElement&&1===n.parentElement.innerHTML.length&&n.parentElement.appendChild(document.createElement("br")),n.parentNode.removeChild(n),o&&this.nodeSelection.setCursorPoint(document,o,o.textContent.length)};var N9e=V9e;function V9e(e){this.clickCount=0,this.lastClickTime=0,this.currentDocument=e.document,this.editableElement=e.editableElement,this.nodeSelection=new _9e(this.editableElement),this.nodeCutter=new C7e,this.domNode=new ZUe(this.editableElement,this.currentDocument),this.observer=new yt(this),this.listObj=new E7e(this),this.formatObj=new M7e(this),this.alignmentObj=new F7e(this),this.indentsObj=new R7e(this),this.linkObj=new P7e(this),this.imgObj=new s9e(this),this.audioObj=new l9e(this),this.videoObj=new d9e(this),this.selectionObj=new b9e(this),this.inserthtmlObj=new C9e(this),this.insertTextObj=new P9e(this),this.clearObj=new I9e(this),this.tableObj=new c9e(this),this.undoRedoManager=new E9e(this,e.options),this.msWordPaste=new M9e(this),this.formatPainterEditor=new R9e(this,e.formatPainterSettings),this.emojiPickerObj=new F9e(this),this.tableCellSelection=new XUe(this.editableElement,this.currentDocument),this.userAgentData=new m9e(F.userAgent,!1),this.wireEvents(),this.isDestroyed=!1}H9e.prototype.saveInstance=function(e,t){return this.range=e.cloneRange(),this.rootNode=this.documentFromRange(e),this.body=t,this.startContainer=this.getNodeArray(e.startContainer,!0),this.endContainer=this.getNodeArray(e.endContainer,!1),this.startOffset=e.startOffset,this.endOffset=e.endOffset,this.html=this.body.innerHTML,this},H9e.prototype.documentFromRange=function(e){return 9===e.startContainer.nodeType?e.startContainer:e.startContainer.ownerDocument},H9e.prototype.getRange=function(e){var t=this.get(e),t=t&&0<t.rangeCount?t.getRangeAt(t.rangeCount-1):e.createRange();return t.startContainer!==e||t.endContainer!==e||t.startOffset||t.endOffset||(t.setStart(e.body,0),t.collapse(!0)),t},H9e.prototype.get=function(e){return e.defaultView.getSelection()},H9e.prototype.save=function(e,t){return e=e?e.cloneRange():this.getRange(t),this.saveInstance(e,t.body)},H9e.prototype.getIndex=function(e){var t=0;if(e=e.previousSibling||"BR"!==e.tagName?e.previousSibling:e)for(e.nodeType;e;)t++,e.nodeType,e=e.previousSibling;return t},H9e.prototype.isChildNode=function(e,t){for(var i=0;i<t.childNodes.length;i++)if(-1<e.indexOf(t.childNodes[i]))return!0;return!1},H9e.prototype.getNode=function(e,t,i){return this.editableElement&&(!this.editableElement.contains(e)||this.editableElement===e)||t===e&&(3===e.nodeType||!e.firstChild||-1!==i.indexOf(e.firstChild)||this.isChildNode(i,e))||3===e.nodeType&&e.previousSibling===t&&"IMG"===t.nodeName?null:-1===i.indexOf(e.firstChild)&&e.firstChild&&!this.isChildNode(i,e)?e.firstChild:e.nextSibling||e.parentNode||null},H9e.prototype.getNodeCollection=function(e){var t=e.startContainer.childNodes[e.startOffset]||e.startContainer,i=e.endContainer.childNodes[0<e.endOffset?e.endOffset-1:e.endOffset]||e.endContainer,n=this.processedTableImageCursor(e);if((n.start||n.end)&&("TABLE"===n.startName||"TABLE"===n.endName))return[n.start?n.startNode:n.endNode];if((t===i||"BR"===t.nodeName&&t===e.endContainer.childNodes[e.endOffset])&&0===t.childNodes.length)return[t];if(e.startOffset===e.endOffset&&0!==e.startOffset&&"PRE"===e.startContainer.nodeName)return["BR"===t.nodeName||"#text"===t.nodeName?t:t.childNodes[0]];for(var o=[];-1===o.indexOf(t)&&o.push(t),t=this.getNode(t,i,o););return o},H9e.prototype.getParentNodeCollection=function(e){return this.getParentNodes(this.getNodeCollection(e),e)},H9e.prototype.getParentNodes=function(e,t){e=e.reverse();for(var i=0;i<e.length;i++)-1!==e.indexOf(e[i].parentNode)||3===e[i].nodeType&&t.startContainer!==t.endContainer&&t.startContainer.parentNode!==t.endContainer.parentNode&&t.startContainer.parentNode.tagName&&t.endContainer.parentNode.tagName&&-1!==xUe.indexOf(t.startContainer.parentNode.tagName.toLowerCase())&&-1!==xUe.indexOf(t.endContainer.parentNode.tagName.toLowerCase())?(e.splice(i,1),i--):3===e[i].nodeType&&(e[i]=e[i].parentNode);return e},H9e.prototype.getSelectionNodeCollection=function(e){return this.getSelectionNodes(this.getNodeCollection(e))},H9e.prototype.getSelectionNodeCollectionBr=function(e){return this.getSelectionNodesBr(this.getNodeCollection(e))},H9e.prototype.getSelectionNodes=function(e){e=e.reverse();for(var t=new RegExp("​","g"),i=0;i<e.length;i++)(3!==e[i].nodeType||""===e[i].textContent.trim()||1===e[i].textContent.length&&e[i].textContent.match(t))&&(e.splice(i,1),i--);return e.reverse()},H9e.prototype.getSelectionNodesBr=function(e){e=e.reverse();for(var t=new RegExp("​","g"),i=0;i<e.length;i++)"BR"!==e[i].nodeName&&(3!==e[i].nodeType||""===e[i].textContent.trim()||1===e[i].textContent.length&&e[i].textContent.match(t))&&(e.splice(i,1),i--);return e.reverse()},H9e.prototype.getInsertNodeCollection=function(e){return this.getInsertNodes(this.getNodeCollection(e))},H9e.prototype.getInsertNodes=function(e){e=e.reverse();for(var t=0;t<e.length;t++)(0!==e[t].childNodes.length&&3!==e[t].nodeType||3===e[t].nodeType&&""===e[t].textContent)&&(e.splice(t,1),t--);return e.reverse()},H9e.prototype.getNodeArray=function(e,t,i){var n=[];for(t?this.startNodeName=[]:this.endNodeName=[];e!==(i||this.rootNode)&&!je(e);)(t?this.startNodeName:this.endNodeName).push(e.nodeName.toLowerCase()),n.push(this.getIndex(e)),e=e.parentNode;return n},H9e.prototype.setRangePoint=function(e,t,i,n){for(var o=this.rootNode,r=i.length;r--;)o=o&&o.childNodes[i[r]];return o&&0<=n&&"html"!==o.nodeName&&(3===o.nodeType&&"&nbsp;"===o.nodeValue.replace(/\u00a0/g,"&nbsp;")&&(n=o.textContent.length),e[t?"setStart":"setEnd"](o,n)),e},H9e.prototype.restore=function(){var e=this.range.cloneRange(),e=this.setRangePoint(e,!0,this.startContainer,this.startOffset);return e=this.setRangePoint(e,!1,this.endContainer,this.endOffset),this.selectRange(this.rootNode,e),e},H9e.prototype.selectRange=function(e,t){this.setRange(e,t),this.save(t,e)},H9e.prototype.setRange=function(e,t){e=this.get(e);e.removeAllRanges(),e.addRange(t)},H9e.prototype.setSelectionText=function(e,t,i,n,o){var r=e.createRange();r.setStart(t,n),r.setEnd(i,o),this.setRange(e,r)},H9e.prototype.setSelectionContents=function(e,t){var i=e.createRange();i.selectNode(t),this.setRange(e,i)},H9e.prototype.setSelectionNode=function(e,t){var i=e.createRange();i.selectNodeContents(t),this.setRange(e,i)},H9e.prototype.getSelectedNodes=function(e){return this.getNodeCollection(this.getRange(e))},H9e.prototype.Clear=function(e){this.get(e).removeAllRanges()},H9e.prototype.insertParentNode=function(e,t,i){i.surroundContents(t),this.selectRange(e,i)},H9e.prototype.setCursorPoint=function(e,t,i){var n=e.createRange(),e=e.defaultView.getSelection();n.setStart(t,i),n.collapse(!0),e.removeAllRanges(),e.addRange(n)},H9e.prototype.isTableOrImageStart=function(e){var t=e.startContainer,i=e.startOffset,i=t.childNodes[i],e=e.collapsed&&1===t.nodeType&&t.isContentEditable&&i&&-1<["TABLE"].indexOf(i.nodeName);return e?{start:e,startNodeName:i.nodeName,startNode:i}:{start:!1,startNodeName:"",startNode:void 0}},H9e.prototype.isTableOrImageEnd=function(e){var t=e.startContainer,i=e.startOffset,i=t.childNodes[i-1],e=e.collapsed&&1===t.nodeType&&t.isContentEditable&&i&&-1<["TABLE"].indexOf(i.nodeName);return e?{end:e,endNodeName:i.nodeName,endNode:i}:{end:!1,endNodeName:"",endNode:void 0}},H9e.prototype.processedTableImageCursor=function(e){var t=this.isTableOrImageStart(e),i=t.start,n=t.startNodeName,t=t.startNode,e=this.isTableOrImageEnd(e);return{start:i,startName:n,end:e.end,endName:e.endNodeName,startNode:t,endNode:e.endNode}},H9e.prototype.findLastTextPosition=function(e){if(e.nodeType===Node.TEXT_NODE)return{node:e,offset:e.textContent?e.textContent.length:0};for(var t=e.childNodes.length-1;0<=t;t--){var i=this.findLastTextPosition(e.childNodes[t]);if(i)return i}return null};var _9e=H9e;function H9e(e){this.startNodeName=[],this.endNodeName=[],this.editableElement=e}var z9e=UUe(),j9e=(W9e.get=function(e,t,i,n,o,r){for(var s=JSON.parse(JSON.stringify(z9e)),a=JSON.parse(JSON.stringify(z9e)),l=new _9e(t),h=l.getRange(e),d=r?[r]:h.collapsed?l.getNodeCollection(h):l.getSelectionNodeCollectionBr(h),p=d.length,c=!1,u=0;u<d.length;u++){for(;3===d[u].nodeType&&3===h.startContainer.nodeType&&d[u].parentNode&&d[u].parentNode.lastElementChild&&"BR"!==d[u].parentNode.lastElementChild.nodeName&&this.getImmediateBlockNode(d[u].parentNode)&&0===this.getImmediateBlockNode(d[u].parentNode).textContent.replace(/\u200B/g,"").length&&0===h.startContainer.textContent.replace(/\u200B/g,"").length&&0===l.get(e).toString().replace(/\u200B/g,"").length;)d[u]=d[u].parentNode.lastElementChild.firstChild,c=!0;c&&d[u]&&(l.setCursorPoint(e,d[u],d[u].textContent.length),c=!1),("BR"!==d[u].nodeName&&3!==d[u].nodeType||1<p&&3===d[u].nodeType&&""===d[u].textContent.trim())&&(d.splice(u,1),u--)}for(u=0;u<d.length;u++)s=this.getFormatParent(e,s,d[u],t,i,n,o),(0===u&&s.bold||!s.bold)&&(a.bold=s.bold),(0===u&&s.insertcode||!s.insertcode)&&(a.insertcode=s.insertcode),(0===u&&s.blockquote||!s.blockquote)&&(a.blockquote=s.blockquote),(0===u&&s.italic||!s.italic)&&(a.italic=s.italic),(0===u&&s.underline||!s.underline)&&(a.underline=s.underline),(0===u&&s.strikethrough||!s.strikethrough)&&(a.strikethrough=s.strikethrough),(0===u&&s.superscript||!s.superscript)&&(a.superscript=s.superscript),(0===u&&s.subscript||!s.subscript)&&(a.subscript=s.subscript),(0===u&&s.fontcolor||!s.fontcolor)&&(a.fontcolor=s.fontcolor),0===u&&s.fontname?a.fontname=s.fontname:a.fontname=s.fontname===a.fontname?s.fontname:"empty",0===u&&s.fontsize?a.fontsize=s.fontsize:a.fontsize=s.fontsize===a.fontsize?s.fontsize:"empty",(0===u&&s.backgroundcolor||!s.backgroundcolor)&&(a.backgroundcolor=s.backgroundcolor),(0===u&&s.orderedlist||!s.orderedlist)&&(a.orderedlist=s.orderedlist),(0===u&&s.unorderedlist||!s.unorderedlist)&&(a.unorderedlist=s.unorderedlist),(0===u&&s.alignments||!s.alignments)&&(a.alignments=s.alignments),0===u&&s.formats?a.formats=s.formats:a.formats=s.formats===a.formats?s.formats:"empty",(0===u&&s.createlink||!s.createlink)&&(a.createlink=s.createlink),(0===u&&s.numberFormatList||!s.numberFormatList)&&(a.numberFormatList=s.numberFormatList),(0===u&&s.bulletFormatList||!s.bulletFormatList)&&(a.bulletFormatList=s.bulletFormatList),(0===u&&s.inlinecode||!s.inlinecode)&&(a.inlinecode=s.inlinecode),s=JSON.parse(JSON.stringify(z9e));return a},W9e.getImmediateBlockNode=function(e){for(;(e=e.parentNode)&&xUe.indexOf(e.nodeName.toLocaleLowerCase())<0;);return e},W9e.getFormatParent=function(e,t,i,n,o,r,s){var a=!1,l=!1;if(n.contains(i)||3===i.nodeType&&3!==n.nodeType&&n.contains(i.parentNode))for(;((t=this.isFormattedNode(e,t,i,a,l,o,r,s)).orderedlist||t.unorderedlist)&&(a=!0),(t.bulletFormatList||t.numberFormatList)&&(l=!0),(i=i.parentNode)&&i!==n;);return t},W9e.isFormattedNode=function(e,t,i,n,o,r,s,a){if(t.bold||(t.bold=tUe.isBold(i)),t.italic||(t.italic=tUe.isItalic(i)),t.underline||(t.underline=tUe.isUnderline(i)),t.strikethrough||(t.strikethrough=tUe.isStrikethrough(i)),t.superscript||(t.superscript=tUe.isSuperscript(i)),t.subscript||(t.subscript=tUe.isSubscript(i)),t.fontcolor||(t.fontcolor=this.isFontColor(e,i)),t.fontname||(t.fontname=this.isFontName(e,i,a)),t.fontsize||(t.fontsize=this.isFontSize(e,i,s)),t.backgroundcolor||(t.backgroundcolor=this.isBackgroundColor(i)),t.orderedlist||n||(t.orderedlist=this.isOrderedList(i)),t.unorderedlist||n||(t.unorderedlist=this.isUnorderedList(i)),t.alignments||(t.alignments=this.isAlignment(i)),t.formats||(t.formats=this.isFormats(i,r),"pre"===t.formats&&(t.insertcode=!0)),!t.blockquote){a=void 0;if(!je(r))if(-1<r.indexOf("blockquote"))t.formats=this.isFormats(i,r),a=t.formats;else{r.push("blockquote");for(var a=this.isFormats(i,r),l=r.length-1;0<=l;l--)"blockquote"===r[l]&&r.splice(l,1)}"blockquote"===a&&(t.blockquote=!0)}return t.createlink||(t.createlink=this.isLink(i)),t.numberFormatList||o||(t.numberFormatList=this.isNumberFormatList(i)),t.bulletFormatList||o||(t.bulletFormatList=this.isBulletFormatList(i)),t.inlinecode||(t.inlinecode=tUe.isCode(i)),t},W9e.isFontColor=function(e,t){var i=t.style&&t.style.color;return null!==(i=null!=i&&""!==i||3===t.nodeType?i:this.getComputedStyle(e,t,"color"))&&""!==i&&void 0!==i?i:null},W9e.isLink=function(e){return"a"===e.nodeName.toLocaleLowerCase()},W9e.isBackgroundColor=function(e){e=e.style&&e.style.backgroundColor;return null!==e&&""!==e&&void 0!==e?e:null},W9e.isFontSize=function(e,t,i){var n=t.style&&t.style.fontSize;return null!==(n=null!=n&&""!==n||3===t.nodeType||!t.parentElement.classList.contains("e-content")?n:this.getComputedStyle(e,t,"font-size"))&&""!==n&&void 0!==n&&(null==i||-1<i.indexOf(n))?n:null},W9e.isFontName=function(e,t,i){var n=t.style&&t.style.fontFamily,o=(null!=n&&""!==n||3===t.nodeType||(n=this.getComputedStyle(e,t,"font-family")),null);return null!==n&&""!==n&&void 0!==n&&(null==i||i.filter(function(e,t){var i=new RegExp(n,"i");(e.replace(/"/g,"").replace(/ /g,"").toLowerCase()===n.replace(/"/g,"").replace(/ /g,"").toLowerCase()||e.split(",")[0]&&!je(e.split(",")[0].trim().match(i))&&e.split(",")[0].trim()===e.split(",")[0].trim().match(i)[0])&&(o=t)})&&null!==o)?null!==o?i[o]:n.replace(/"/g,""):null},W9e.isOrderedList=function(e){return"ol"===e.nodeName.toLocaleLowerCase()},W9e.isUnorderedList=function(e){return"ul"===e.nodeName.toLocaleLowerCase()},W9e.isAlignment=function(e){e=e.style&&e.style.textAlign;return"left"===e?"justifyleft":"center"===e?"justifycenter":"right"===e?"justifyright":"justify"===e?"justifyfull":null},W9e.isFormats=function(e,t){return null==t&&-1<xUe.indexOf(e.nodeName.toLocaleLowerCase())||null!=t&&-1<t.indexOf(e.nodeName.toLocaleLowerCase())?e.nodeName.toLocaleLowerCase():null},W9e.getComputedStyle=function(e,t,i){return e.defaultView.getComputedStyle(t,null).getPropertyValue(i)},W9e.isNumberFormatList=function(e){var t=e.style&&e.style.listStyleType;return"lower-alpha"===t?"Lower Alpha":"number"===t?"Number":"upper-alpha"===t?"Upper Alpha":"lower-roman"===t?"Lower Roman":"upper-roman"===t?"Upper Roman":"lower-greek"===t?"Lower Greek":"none"===t&&this.isOrderedList(e)?"None":!!this.isOrderedList(e)||null},W9e.isBulletFormatList=function(e){var t=e.style&&e.style.listStyleType;return"circle"===t?"Circle":"square"===t?"Square":"none"===t&&this.isUnorderedList(e)?"None":"disc"===t?"Disc":!!this.isUnorderedList(e)||null},W9e);function W9e(){}var Q9e=function(){return(Q9e=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},U9e=(q9e.prototype.wireEvent=function(){this.parent.on(t4e,this.destroy,this),this.parent.on(yWe,this.destroyTooltip,this),this.parent.on(xWe,this.closeTooltip,this)},q9e.prototype.destroyTooltip=function(){var e,t=this.parent.iframeSettings.enable?this.parent.contentModule.getPanel().ownerDocument:this.parent.contentModule.getDocument();je(t.querySelector(".e-tooltip-wrap"))||je(t.querySelector("[data-tooltip-id]"))||(t=t.querySelector("[data-tooltip-id]"),e=new MouseEvent("mouseleave",{bubbles:!0,cancelable:!0}),t.dispatchEvent(e))},q9e.prototype.unWireEvent=function(){this.parent.off(t4e,this.destroy),this.parent.off(yWe,this.destroyTooltip),this.parent.off(xWe,this.closeTooltip)},q9e.prototype.toolbarBeforeCreate=function(e){"Extended"===this.mode&&(e.enableCollision=!1)},q9e.prototype.toolbarCreated=function(){var e;this.parent.notify(y4e,this),"Extended"===this.mode&&(e=this.toolbarPanel.querySelector("#"+CSS.escape(this.parent.element.id)+"_toolbar_nav"))&&E.add(e,"mousedown",this.extendedToolbarMouseDownHandler,this)},q9e.prototype.extendedToolbarMouseDownHandler=function(){this.parent.userAgentData.isSafari()&&this.parent.notify(t5e,{})},q9e.prototype.toolbarClicked=function(t){var e,i=this;this.parent.enabled&&(e={item:t.item,originalEvent:t.originalEvent,cancel:!1},this.parent.trigger("toolbarClick",e,function(e){i.parent.readonly&&!je(t.item)||e.cancel||i.parent.notify(i4e,e)}))},q9e.prototype.dropDownSelected=function(e){this.parent.notify(C4e,{element:e.element,item:e.item,originalEvent:e.event}),this.destroyTooltip()},q9e.prototype.beforeDropDownItemRender=function(e){!this.parent.readonly&&this.parent.enabled&&this.parent.notify(S4e,e)},q9e.prototype.tooltipBeforeRender=function(e){if(!je(e.target.getAttribute("title"))){var t=void 0;switch(e.target.getAttribute("title")){case"Minimize":t=this.l10n.getConstant("minimize"),e.target.setAttribute("title",t+" (Esc)");break;case"Maximize":t=this.l10n.getConstant("maximize"),e.target.setAttribute("title",t+" (Ctrl+Shift+F)")}}e.target.querySelector(".e-active")&&(e.cancel=!0,je(e.target.getAttribute("title"))||this.closeTooltip({target:e.target,isTitle:!0}))},q9e.prototype.dropDownOpen=function(e){var t,i;-1<e.element.parentElement.getAttribute("id").indexOf("TableCell")&&!je(e.element.parentElement.querySelector(".e-cell-merge"))&&(t=e.element.querySelectorAll("li"),1===(i=this.parent.inputElement.querySelectorAll(".e-cell-select")).length?(U([t[0]],"e-disabled"),q([t[1],t[2]],"e-disabled")):1<i.length&&((Array.from(i).every(function(e){return e.tagName.toLowerCase()===i[0].tagName.toLowerCase()})?q:U)([t[0]],"e-disabled"),U([t[1],t[2]],"e-disabled"))),this.parent.notify(t5e,e)},q9e.prototype.dropDownClose=function(e){this.isEscapeKey||this.parent.notify(i5e,e),this.isEscapeKey=!1},q9e.prototype.dropDownBeforeClose=function(e){je(e.event)||"Escape"!==e.event.key||27!==e.event.keyCode||(this.isEscapeKey=!0,this.parent.notify(PWe,e))},q9e.prototype.renderToolbar=function(e){this.setPanel(e.target),this.renderPanel(),this.mode=e.overflowMode,e.rteToolbarObj.toolbarObj=new U3({items:e.items,width:"100%",overflowMode:e.overflowMode,beforeCreate:this.toolbarBeforeCreate.bind(this),created:this.toolbarCreated.bind(this),clicked:this.toolbarClicked.bind(this),enablePersistence:e.enablePersistence,enableRtl:e.enableRtl,cssClass:e.cssClass}),e.rteToolbarObj.toolbarObj.isStringTemplate=!0,e.rteToolbarObj.toolbarObj.createElement=this.parent.createElement,e.rteToolbarObj.toolbarObj.appendTo(e.target),this.parent.showTooltip&&"toolbar"===e.type&&(this.tooltip=new NS({target:"#"+this.parent.getID()+"_toolbar_wrapper [title]",showTipPointer:!0,openDelay:400,opensOn:"Hover",beforeRender:this.tooltipBeforeRender.bind(this),beforeOpen:this.tooltipBeforeOpen.bind(this),cssClass:this.parent.getCssClass(),windowCollision:!0,position:"BottomCenter"}),this.tooltip.appendTo(e.target.parentElement))},q9e.prototype.tooltipBeforeOpen=function(e){e.element&&e.element.setAttribute("data-rte-id",this.parent.getID())},q9e.prototype.renderDropDownButton=function(e){var t,y=this,v=e.activeElement,b=(e.element.classList.add(n8e),t=e.cssClass+" "+L8e+" "+R8e,this.parent.inlineMode.enable&&F.isDevice&&(t=t+" "+$We),this),w=new u2({items:e.items,iconCss:e.iconCss,cssClass:t,content:e.content,enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,select:this.dropDownSelected.bind(this),beforeOpen:function(e){if(b.parent.readonly||!b.parent.enabled)e.cancel=!0;else{if(y.parent.userAgentData.isSafari()&&"keydown"===e.event.type&&y.parent.formatter.editorManager.nodeSelection&&!y.parent.inputElement.contains(y.parent.getRange().startContainer)&&y.parent.notify(i5e,e),"Markdown"!==b.parent.editorMode){var t=b.parent.getRange().startContainer.parentElement,i=t.closest("table"),n=t.closest("tr");if(!je(i)&&i.classList.contains("e-dashed-border"))for(var o=0;o<e.element.childNodes.length;o++)e.element.childNodes[o].classList.contains("e-dashed-borders")&&U([e.element.childNodes[o]],"e-active");if(!je(i)&&i.classList.contains("e-alternate-rows")&&""!==window.getComputedStyle(n).backgroundColor)for(o=0;o<e.element.childNodes.length;o++)e.element.childNodes[o].classList.contains("e-alternate-rows")&&U([e.element.childNodes[o]],"e-active");for(var r=b.parent.getRange().startContainer;r!==b.parent.inputElement&&!je(r.parentElement);){"#text"===r.nodeName&&(r=r.parentElement);var s=window.getComputedStyle(r).textAlign;if(!je(e.items[0])&&"Alignments"===e.items[0].command){if("Align Left"===e.items[0].text&&"left"===s||"start"===s){U([e.element.childNodes[0]],"e-active");break}if("Align Center"===e.items[1].text&&"center"===s){U([e.element.childNodes[1]],"e-active");break}if("Align Right"===e.items[2].text&&"right"===s){U([e.element.childNodes[2]],"e-active");break}if("Align Justify"===e.items[3].text&&"justify"===s){U([e.element.childNodes[3]],"e-active");break}}r=r.parentElement}i=t.closest("img"),n=i||v||t.querySelector("img"),i=(je(e.items[0])||"Images"!==e.items[0].command||je(n)||(o=void 0,n.classList.contains("e-imgleft")||n.classList.contains("e-imginline")?o=0:n.classList.contains("e-imgcenter")||n.classList.contains("e-imgbreak")?o=1:n.classList.contains("e-imgright")&&(o=2),je(e.element.childNodes[o]))||U([e.element.childNodes[o]],"e-active"),t.closest(".e-video-wrap")),n=i||v||t.querySelector("video");if(je(e.items[0])||"Videos"!==e.items[0].command||je(n)||(o=void 0,n.classList.contains("e-video-left")||n.classList.contains("e-video-inline")?o=0:n.classList.contains("e-video-center")||n.classList.contains("e-video-break")?o=1:n.classList.contains("e-video-right")&&(o=2),je(e.element.childNodes[o]))||U([e.element.childNodes[o]],"e-active"),!je(e.items[0])&&("Formats"===e.items[0].command||"Font"===e.items[0].command))for(var a=[],l=[],h=!1,d=(y.parent.format.types.forEach(function(e){l.push(e.value.toLocaleLowerCase())}),y.parent.fontFamily.items.forEach(function(e){a.push(e.value)}),j9e.get(y.parent.contentModule.getDocument(),y.parent.contentModule.getEditPanel(),l,null,a)),o=0;o<e.element.childNodes.length;o++){var p=w.content.trim(),c=p.match(/style="([^"]*)"/),u="",c=(c&&(u=c[1]),p.replace(/ style="([^"]*)"/,""));(g=y.parent.createElement("div")).innerHTML=c,g.querySelector("span").style.cssText=u,!h&&(""!==g.textContent.trim()&&e.element.childNodes[o].textContent.trim()===g.textContent.trim()||"Formats"===e.items[0].command&&!je(d.formats)&&y.parent.format.types[o].value.toLowerCase()===d.formats.toLowerCase()&&e.element.childNodes[o].classList.contains(y.parent.format.types[o].cssClass)||"FontName"===e.items[0].subCommand&&"Font"===e.items[0].command&&!je(d.fontname)&&!je(y.parent.fontFamily.items[o])&&y.parent.fontFamily.items[o].value.toLowerCase()===d.fontname.toLowerCase()&&e.element.childNodes[o].classList.contains(y.parent.fontFamily.items[o].cssClass)||"FontName"===e.items[0].subCommand&&""===y.parent.fontFamily.items[o].value&&je(d.fontname)&&e.element.childNodes[o].classList.contains(y.parent.fontFamily.items[o].cssClass)||"FontSize"===e.items[0].subCommand&&"Default"===e.element.childNodes[o].textContent&&"Font Size"===g.textContent&&""===y.parent.fontSize.items[o].value&&!je(d.fontsize))?e.element.childNodes[o].classList.contains("e-active")||(U([e.element.childNodes[o]],"e-active"),h=!0):q([e.element.childNodes[o]],"e-active")}}else if("Markdown"===b.parent.editorMode&&"Formats"===e.items[0].command)for(var g,m=[],h=!1,f=(y.parent.format.types.forEach(function(e){m.push(e.value.toLocaleLowerCase())}),e.element.childNodes),o=0;o<f.length;o++)(g=y.parent.createElement("div")).innerHTML=w.content.trim(),h||""===g.textContent.trim()||f[o].textContent.trim()!==g.textContent.trim()?q([f[o]],"e-active"):f[o].classList.contains("e-active")||(U([f[o]],"e-active"),h=!0);b.parent.notify(e5e,e)}},close:this.dropDownClose.bind(this),beforeClose:this.dropDownBeforeClose.bind(this),open:this.dropDownOpen.bind(this),beforeItemRender:this.beforeDropDownItemRender.bind(this)});return w.isStringTemplate=!0,w.createElement=b.parent.createElement,w.appendTo(e.element),e.element.tabIndex=-1,document.getElementById(w.element.id+"-popup").setAttribute("aria-owns",this.parent.getID()),w},q9e.prototype.mouseOutHandler=function(){var e;je(this.tooltipTargetEle)&&(e=this.parent.iframeSettings.enable?this.parent.contentModule.getPanel().ownerDocument:this.parent.contentModule.getDocument(),this.tooltipTargetEle=e.querySelector("[data-title]")),this.tooltipTargetEle.setAttribute("title",this.tooltipTargetEle.getAttribute("data-title")),this.tooltipTargetEle.removeAttribute("data-title"),E.remove(this.tooltipTargetEle,"mouseout",this.mouseOutHandler)},q9e.prototype.closeTooltip=function(e){var t;e.isTitle?(this.tooltipTargetEle=e.target,this.tooltipTargetEle.setAttribute("data-title",this.tooltipTargetEle.getAttribute("title")),this.tooltipTargetEle.removeAttribute("title"),E.add(this.tooltipTargetEle,"mouseout",this.mouseOutHandler,this)):(t=this.parent.iframeSettings.enable?this.parent.contentModule.getPanel().ownerDocument:this.parent.contentModule.getDocument(),this.tooltipTargetEle=z(e.target,"[data-tooltip-id]"),je(this.tooltipTargetEle)||!this.parent.showTooltip||je(t.querySelector(".e-tooltip-wrap"))||(this.destroyTooltip(),this.tooltipTargetEle.setAttribute("data-title",this.tooltipTargetEle.getAttribute("title")),this.tooltipTargetEle.removeAttribute("title"),E.add(this.tooltipTargetEle,"mouseout",this.mouseOutHandler,this)))},q9e.prototype.renderListDropDown=function(e){var s=this,a=this,t=L8e+" "+R8e+(this.parent.inlineMode?" "+$We:""),i=(t+=" "+("NumberFormatList"===e.itemName?_8e:H8e),a.parent.createElement("span",{className:V8e})),n=a.parent.createElement("span",{className:e.cssClass}),l=(i.appendChild(n),new u2({items:e.items,cssClass:t,content:e.content,enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,select:this.dropDownSelected.bind(this),beforeOpen:function(e){if("safari"!==F.info.name||a.parent.inputElement.contains(a.parent.getRange().startContainer)||a.parent.notify(i5e,{}),"Markdown"!==a.parent.editorMode){var t=a.parent.getRange().startContainer.parentElement.closest("LI"),t=je(t)?null:t.parentElement,i=e.items[0].subCommand;if(!je(t)){var n="NumberFormatList"===i&&"OL"===t.nodeName,i="BulletFormatList"===i&&"UL"===t.nodeName;if(n||i)for(var o="decimal"===(o=t.style.listStyleType.split("-").join("").toLocaleLowerCase())?"number":o,r=0;r<e.element.childNodes.length;r++){if(o===e.element.childNodes[r].innerHTML.split(" ").join("").toLocaleLowerCase()){U([e.element.childNodes[r]],"e-active");break}if(""===o&&"None"!==e.element.childNodes[r].innerHTML){U([e.element.childNodes[r]],"e-active");break}}}}s.closeTooltip({target:e.event.target}),a.parent.readonly||!a.parent.enabled||(n=e.event?e.event.target:null,a.currentElement=l.element,a.currentDropdown=l,e.event&&"click"===e.event.type&&(n.classList.contains(V8e)||n.parentElement.classList.contains(V8e)))?e.cancel=!0:a.parent.notify(e5e,e)},close:this.dropDownClose.bind(this),open:this.dropDownOpen.bind(this),beforeItemRender:this.beforeDropDownItemRender.bind(this)}));return l.isStringTemplate=!0,l.createElement=a.parent.createElement,l.appendTo(e.element),e.element.tabIndex=-1,e.element.setAttribute("role","button"),document.getElementById(l.element.id+"-popup").setAttribute("aria-owns",this.parent.getID()),1===e.element.childElementCount&&l.element.insertBefore(i,l.element.querySelector(".e-caret")),e.element.tabIndex=-1,l.element.removeAttribute("type"),l.element.onmousedown=function(){"safari"===F.info.name&&a.parent.notify(t5e,{})},l.element.onkeydown=function(){"safari"===F.info.name&&a.parent.notify(t5e,{})},l},q9e.prototype.paletteSelection=function(e,t){var e=e.element.querySelector(".e-control.e-colorpicker"),e=[].slice.call(ct(".e-tile",e.parentElement)),i=(q(e,"e-selected"),t.querySelector("."+L8e).style.borderBottomColor);e.filter(function(e){e.style.backgroundColor===i&&U([e],"e-selected")})},q9e.prototype.renderColorPickerDropDown=function(r,e,i,t,s){var a,l=this,h=this,n=L8e+" "+R8e+(this.parent.inlineMode?" "+$We:""),o=(n=(n+=" "+("backgroundcolor"===e?X8e:Y8e))+this.parent.getCssClass(!0),h.parent.createElement("span",{className:G8e})),d=h.parent.createElement("span",{className:r.cssClass}),t=je(t)?h.parent.backgroundColor.default:t,p=(d.style.borderBottomColor="backgroundcolor"===e?t:h.parent.fontColor.default,o.appendChild(d),new u2({target:i.element.parentElement,cssClass:n,enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,beforeOpen:function(e){var t,i,n,o;h.parent.readonly||!h.parent.enabled?e.cancel=!0:(t=e.event?e.event.target:null,h.currentElement=p.element,h.currentDropdown=p,h.paletteSelection(e,h.currentElement),e.event&&"click"===e.event.type&&(t.classList.contains(G8e)||t.parentElement.classList.contains(G8e))?(e.cancel=!0,t=(t.classList.contains(L8e)?t:t.querySelector("."+L8e)).style.borderBottomColor,h.parent.notify(i5e,{}),n=(a=h.parent.formatter.editorManager.nodeSelection.getRange(h.parent.contentModule.getDocument())).startContainer.parentNode,i=z(a.startContainer.parentNode,"table"),o="macOS"===l.parent.userAgentData.getPlatform()&&!a.collapsed||a.collapsed,("TD"===a.startContainer.nodeName||"TH"===a.startContainer.nodeName||z(a.startContainer.parentNode,"td,th")||h.parent.iframeSettings.enable&&!A6e(n.ownerDocument.querySelector("body"),"e-lib"))&&o&&"BackgroundColor"===r.subCommand&&(z(i,"."+BWe)||h.parent.iframeSettings.enable)&&"quick"===s?(n=Q9e({name:"tableColorPickerChanged",item:{command:"Table",subCommand:"BackgroundColor",value:t}},r),h.parent.formatter.process(l.parent,n,null,t),h.parent.notify(T5e,{})):h.parent.notify(h5e,{item:{command:r.command,subCommand:r.subCommand,value:t}})):((o=K(e.element.querySelector(".e-control.e-colorpicker"),cV)).showButtons=!e.element.querySelector(".e-color-palette"),o.dataBind(),e.element.onclick=function(e){e.target.classList.contains("e-cancel")&&p.toggle()}))},open:function(e){l.setColorPickerContentWidth(i);var t=e.element.querySelector(".e-control.e-colorpicker"),t=e.element.querySelector(".e-color-palette")?t.parentElement.querySelector(".e-palette"):t.parentElement.querySelector("e-handler");t&&t.focus(),l.pickerRefresh(e)},beforeClose:function(e){var t=e.event?e.event.target:null;l.dropDownBeforeClose(e),e.event&&"click"===e.event.type&&(t.classList.contains(G8e)||t.parentElement.classList.contains(G8e))&&(e=(t.classList.contains(L8e)?t:t.querySelector("."+L8e)).style.borderBottomColor,("TD"===(a=h.parent.formatter.editorManager.nodeSelection.getRange(h.parent.contentModule.getDocument())).startContainer.nodeName||"TH"===a.startContainer.nodeName||z(a.startContainer.parentNode,"td,th"))&&a.collapsed&&"quick"===s?(t=Q9e({name:"tableColorPickerChanged",item:{command:"Table",subCommand:"BackgroundColor",value:e}},r),h.parent.formatter.process(l.parent,t,null,e),h.parent.notify(T5e,{})):h.parent.notify(h5e,{item:{command:r.command,subCommand:r.subCommand,value:e}}))},close:function(){l.isEscapeKey||h.parent.notify(i5e,{})}}));return p.isStringTemplate=!0,p.createElement=h.parent.createElement,r.element.setAttribute("role","button"),p.appendTo(r.element),document.getElementById(p.element.id+"-popup").setAttribute("aria-owns",this.parent.getID()),r.element.setAttribute("aria-label","backgroundcolor"===e?u6e.backgroundColor:u6e.fontColor),p.element.insertBefore(o,p.element.querySelector(".e-caret")),r.element.tabIndex=-1,p.element.removeAttribute("type"),p.element.onmousedown=function(){h.parent.notify(t5e,{})},p.element.onkeydown=function(){(!l.parent.userAgentData.isSafari()||l.parent.userAgentData.isSafari()&&h.parent.inputElement.contains(h.parent.getRange().startContainer))&&h.parent.notify(t5e,{})},p},q9e.prototype.pickerRefresh=function(e){"Picker"===this.parent.backgroundColor.mode&&((e=e.element.parentElement).style.width=(e.offsetWidth+5).toString()+"px",K(e,Sv).refreshPosition(e),e.style.width=(e.offsetWidth-5).toString()+"px")},q9e.prototype.setColorPickerContentWidth=function(e){var t,e=e.element.nextSibling;"0px"===e.style.width&&(e.style.width="",t=parseInt(getComputedStyle(e).borderBottomWidth,10),e.style.width=T(e.children[0].offsetWidth+t+t))},q9e.prototype.renderColorPicker=function(n,t,o){var r=this,s=this,i=new cV({enableRtl:this.parent.enableRtl,inline:!0,value:null,cssClass:("backgroundcolor"===t?Z8e:J8e)+" "+n.cssClass,created:function(){var e=("backgroundcolor"===t?s.parent.backgroundColor:s.parent.fontColor).default;i.setProperties({value:e})},mode:("backgroundcolor"===t?s.parent.backgroundColor:s.parent.fontColor).mode,modeSwitcher:("backgroundcolor"===t?s.parent.backgroundColor:s.parent.fontColor).modeSwitcher,presetColors:("backgroundcolor"===t?this.parent.backgroundColor:this.parent.fontColor).colorCode,columns:("backgroundcolor"===t?this.parent.backgroundColor:this.parent.fontColor).columns,beforeTileRender:function(e){if(e.element.classList.add(K8e),e.element.classList.add(PQe),!je(r.parent.cssClass))for(var t=r.parent.getCssClass().split(" "),i=0;i<t.length;i++)""!==t[i].trim()&&e.element.classList.add(t[i]);""===e.value&&e.element.classList.add(BQe)},change:function(e){var t=e.currentValue.rgba,t=(e.item={command:n.command,subCommand:n.subCommand,value:t},s.parent.notify(i5e,{}),s.currentElement&&(s.currentElement.querySelector("."+L8e).style.borderBottomColor=t),s.parent.formatter.editorManager.nodeSelection.getRange(s.parent.contentModule.getDocument())),i=z(t.startContainer.parentNode,"table");("TD"===t.startContainer.nodeName||"TH"===t.startContainer.nodeName||"BODY"===t.startContainer.nodeName||t.startContainer.parentNode&&z(t.startContainer.parentNode,"td,th"))&&t.collapsed&&"BackgroundColor"===n.subCommand&&(i&&z(i,"."+BWe)||s.parent.iframeSettings.enable)&&"quick"===o?(e.name="tableColorPickerChanged",e.item.command="Table",s.parent.formatter.process(r.parent,e,e.event,e.item.value),s.parent.notify(T5e,{})):s.parent.notify(h5e,e),s.currentDropdown&&s.currentDropdown.toggle()},beforeModeSwitch:function(e){""===i.value&&i.setProperties({value:"Picker"===e.mode?"#008000ff":""},!0),i.showButtons="Palette"!==e.mode}});return i.isStringTemplate=!0,i.createElement=this.parent.createElement,i.appendTo(document.getElementById(n.target)),i},q9e.prototype.renderPanel=function(){this.getPanel().classList.add(VWe)},q9e.prototype.getPanel=function(){return this.toolbarPanel},q9e.prototype.setPanel=function(e){this.toolbarPanel=e},q9e.prototype.destroy=function(){if(!this.isDestroyed){if(this.tooltip&&!this.tooltip.isDestroyed){this.tooltip.destroy();for(var e=document.querySelectorAll('[data-rte-id="'+this.parent.getID()+'"]'),t=0;t<e.length;t++){var i=e[t];this.parent.getID()===i.getAttribute("data-rte-id")&&G(i)}}this.unWireEvent(),this.mode=null,this.toolbarPanel=null,this.currentElement=null,this.currentDropdown=null,this.tooltip=null,this.tooltipTargetEle=null,this.isDestroyed=!0}},q9e);function q9e(e,t){this.isEscapeKey=!1,this.parent=e,this.isDestroyed=!1,t&&(this.l10n=t.getService("rteLocale")),this.wireEvent()}Y9e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(B4e,this.linkDialog,this),this.parent.on(nWe,this.showDialog,this),this.parent.on(oWe,this.closeDialog,this),this.parent.on(u4e,this.onKeyDown,this),this.parent.on(W4e,this.showLinkQuickToolbar,this),this.parent.on(I5e,this.clearDialogObj,this),this.parent.on(E4e,this.onToolbarAction,this),this.parent.on(e4e,this.onIframeMouseDown,this),this.parent.on(F4e,this.removeLink,this),this.parent.on(L4e,this.editLink,this),this.parent.on(R4e,this.openLink,this),this.parent.on(s5e,this.editAreaClickHandler,this),this.parent.on(uWe,this.setCssClass,this),this.parent.on(t4e,this.destroy,this))},Y9e.prototype.onToolbarAction=function(e){switch(e.args.item.subCommand){case"OpenLink":this.parent.notify(R4e,e);break;case"EditLink":this.parent.notify(L4e,e);break;case"RemoveLink":this.parent.notify(F4e,e)}},Y9e.prototype.removeEventListener=function(){this.parent.off(B4e,this.linkDialog),this.parent.off(nWe,this.showDialog),this.parent.off(oWe,this.closeDialog),this.parent.off(u4e,this.onKeyDown),this.parent.off(W4e,this.showLinkQuickToolbar),this.parent.off(I5e,this.clearDialogObj),this.parent.off(E4e,this.onToolbarAction),this.parent.off(F4e,this.removeLink),this.parent.off(e4e,this.onIframeMouseDown),this.parent.off(L4e,this.editLink),this.parent.off(R4e,this.openLink),this.parent.off(s5e,this.editAreaClickHandler),this.parent.off(uWe,this.setCssClass),this.parent.off(t4e,this.destroy),je(this.contentModule)||(this.parent.element.ownerDocument.removeEventListener("mousedown",this.mouseDown),this.mouseDown=null)},Y9e.prototype.onIframeMouseDown=function(){this.dialogObj&&this.dialogObj.hide({returnValue:!0})},Y9e.prototype.updateCss=function(e,t){e&&t.cssClass&&(je(t.oldCssClass)?e.setProperties({cssClass:(e.cssClass+" "+t.cssClass).trim()}):e.setProperties({cssClass:(e.cssClass.replace(t.oldCssClass,"").trim()+" "+t.cssClass).trim()}))},Y9e.prototype.setCssClass=function(e){this.updateCss(this.checkBoxObj,e),this.updateCss(this.dialogObj,e)},Y9e.prototype.showLinkQuickToolbar=function(e){var t,i,n,o,r,s,a,l,h,d,p=this;je(e.args)||"enter"===e.args.action||"space"===e.args.action||"Links"!==e.type||je(this.parent.quickToolbarModule)||je(this.parent.quickToolbarModule.linkQTBar)||(this.quickToolObj=this.parent.quickToolbarModule,t=this.parent.element.getBoundingClientRect().top,i=this.parent.element.getBoundingClientRect().left,n=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),[].forEach.call(e.elements,function(e,t){0===t&&(o="#text"===e.nodeName?e.parentNode:e)}),e.isNotify?(a=this.parent.toolbarModule.getToolbarElement(),r=o.getBoundingClientRect().top,d=o.getBoundingClientRect().left,s=r-t,a=a?a.offsetHeight+this.parent.toolbarModule.getExpandTBarPopHeight():0,l=this.parent.iframeSettings.enable?i+d:o.getBoundingClientRect().left,h=window.pageYOffset+(this.parent.iframeSettings.enable?t+a+r:t+s),this.linkQTPopupTime=setTimeout(function(){p.showLinkPopup(l,h,n)},400)):(d=void 0,d=e.args.touches?e.args.changedTouches[0]:e.args,l=this.parent.iframeSettings.enable?window.pageXOffset+i+d.clientX:d.pageX,h=this.parent.iframeSettings.enable?window.pageYOffset+t+d.clientY:d.pageY,this.showLinkPopup(l,h,n)),this.quickToolObj.linkQTBar&&this.quickToolObj.linkQTBar.showPopup(l,h,n.endContainer,"link"))},Y9e.prototype.showLinkPopup=function(e,t,i){this.quickToolObj.linkQTBar&&this.quickToolObj.linkQTBar.showPopup(e,t,i.endContainer,"link")},Y9e.prototype.hideLinkQuickToolbar=function(){this.quickToolObj&&this.quickToolObj.linkQTBar&&document.body.contains(this.quickToolObj.linkQTBar.element)&&this.quickToolObj.linkQTBar.hidePopup()},Y9e.prototype.editAreaClickHandler=function(e){var t,i,n,o;this.parent.readonly?this.hideLinkQuickToolbar():(t=e.args,i=this.parent.quickToolbarSettings.showOnRightClick,n=this.parent.userAgentData.isSafari()&&3===t.which,2===t.which||i&&1===t.which||!i&&3===t.which||"HTML"===this.parent.editorMode&&this.parent.quickToolbarModule&&this.parent.quickToolbarModule.linkQTBar&&(this.quickToolObj=this.parent.quickToolbarModule,i=t.target,i=this.getAnchorNode([i]),this.contentModule=this.rendererFactory.getRenderer(q3e.Content),o=this.quickToolObj.linkQTBar.element.classList.contains("e-rte-pop"),"A"===i.nodeName&&0<i.childNodes.length&&"IMG"!==i.childNodes[0].nodeName&&"IMG"!==e.args.target.nodeName&&!je(z(this.parent.getRange().startContainer.parentElement,"A"))&&(!je(z(this.parent.getRange().endContainer.parentElement,"A"))||n)?o||(!1===e.args.ctrlKey?this.showLinkQuickToolbar({args:t,isNotify:!1,type:"Links",elements:[t.target]}):(n=(i=this.parent.formatter.editorManager.nodeSelection).getRange(this.parent.contentModule.getDocument()),o={args:{item:{subCommand:"OpenLink",command:"Links",name:""},originalEvent:e.args},selectNode:i.getNodeCollection(n),selectParent:i.getParentNodeCollection(n),selection:i.save(n,this.parent.contentModule.getDocument())},this.parent.notify(R4e,o))):this.hideLinkQuickToolbar()))},Y9e.prototype.onKeyDown=function(e){var t=e.args;switch(t.action){case"escape":je(this.dialogObj)||this.dialogObj.close();break;case"insert-link":this.openDialog(!0,e),t.preventDefault()}},Y9e.prototype.openDialog=function(e,t){var i,n,o;e||this.parent.contentModule.getEditPanel().focus(),"HTML"===this.parent.editorMode?(n=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),i=this.parent.formatter.editorManager.nodeSelection.save(n,this.parent.contentModule.getDocument()),o=this.parent.formatter.editorManager.nodeSelection.getNodeCollection(n),n=this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(n),e={args:t?t.args:{item:{command:"Links",subCommand:"CreateLink"},originalEvent:void 0,name:e?null:"showDialog"},selectNode:o,selection:i,selectParent:n},this.linkDialog(e)):(o=this.parent.contentModule.getEditPanel(),this.parent.formatter.editorManager.markdownSelection.save(o.selectionStart,o.selectionEnd),this.linkDialog({args:{item:{command:"Links",subCommand:"Link"},originalEvent:t&&t.args},member:"link",text:this.parent.formatter.editorManager.markdownSelection.getSelectedText(this.parent.contentModule.getEditPanel()),module:"Markdown",name:"insertLink"}))},Y9e.prototype.showDialog=function(){this.openDialog(!1),this.setCssClass({cssClass:this.parent.getCssClass()})},Y9e.prototype.closeDialog=function(){this.dialogObj&&this.dialogObj.hide({returnValue:!0})},Y9e.prototype.clearDialogObj=function(){this.dialogObj&&(this.dialogObj.destroy(),G(this.dialogObj.element),this.dialogObj=null)},Y9e.prototype.linkDialog=function(e,t){var i,n,o,r,s,a,l,h,d,p,c=this;this.dialogObj?this.dialogObj.hide({returnValue:!0}):(i="HTML"===this.parent.editorMode?e.selection.getRange(this.parent.contentModule.getDocument()).toString():e.text,!je(t)&&(!je(e.selectParent)&&1<e.selectParent.length||!je(e.selectNode)&&1<e.selectNode.length)&&(t.text=i),"HTML"===this.parent.editorMode&&(this.hasAnchorNodePresent(e.selectParent)||this.hasAnchorNodePresent(e.selectNode))&&je(t)?this.editLink(e):(d=this.i10n.getConstant("linkWebUrl"),r=this.i10n.getConstant("linkText"),l=this.i10n.getConstant("linkTooltipLabel"),o=this.i10n.getConstant("linkurl"),s=this.i10n.getConstant("textPlaceholder"),a=this.i10n.getConstant("linkTitle"),n=this.parent.createElement("div",{className:"e-rte-link-dialog"+this.parent.getCssClass(!0),id:this.rteID+"_rtelink"}),this.parent.rootContainer.appendChild(n),p=this.parent.createElement("div",{className:"e-rte-linkcontent"+this.parent.getCssClass(!0),id:this.rteID+"_linkContent"}),l="HTML"===this.parent.editorMode?"<label>"+l+'</label></div><div class="e-rte-field'+this.parent.getCssClass(!0)+'"><input type="text" data-role ="none" spellcheck="false" placeholder = "'+a+'"aria-label="'+this.i10n.getConstant("linkTitle")+'" class="e-input e-rte-linkTitle'+this.parent.getCssClass(!0)+'"></div><div class="e-rte-label'+this.parent.getCssClass(!0)+'"></div><div class="e-rte-field'+this.parent.getCssClass(!0)+'"><input type="checkbox" class="e-rte-linkTarget'+this.parent.getCssClass(!0)+'"  data-role ="none"></div>':"",a=R6e('<div class="e-rte-label'+this.parent.getCssClass(!0)+'"><label>'+d+'</label></div><div class="e-rte-field'+this.parent.getCssClass(!0)+'"><input type="text" data-role ="none" spellcheck="false" placeholder="'+o+'"aria-label="'+this.i10n.getConstant("linkWebUrl")+'" class="e-input e-rte-linkurl'+this.parent.getCssClass(!0)+'"/></div><div class="e-rte-label'+this.parent.getCssClass(!0)+'"><label>'+r+'</label></div><div class="e-rte-field'+this.parent.getCssClass(!0)+'"> <input type="text" data-role ="none" spellcheck="false" class="e-input e-rte-linkText'+this.parent.getCssClass(!0)+'"aria-label="'+this.i10n.getConstant("linkText")+'" placeholder="'+s+'"></div><div class="e-rte-label'+this.parent.getCssClass(!0)+'">'+l),p.appendChild(a),d=p.querySelector(".e-rte-linkTarget"),o=p.querySelector(".e-rte-linkurl"),r=p.querySelector(".e-rte-linkText"),s=p.querySelector(".e-rte-linkTitle"),l=this.i10n.getConstant("linkOpenInNewWindow"),this.checkBoxObj=new ib({label:l,checked:!0,enableRtl:this.parent.enableRtl,cssClass:this.parent.getCssClass()}),this.checkBoxObj.isStringTemplate=!0,this.checkBoxObj.createElement=this.parent.createElement,this.checkBoxObj.appendTo(d),a=this.i10n.getConstant("dialogInsert"),l=this.i10n.getConstant("dialogCancel"),h=e.selection,d={selfLink:this,selection:e.selection,selectParent:e.selectParent,args:e.args},p={header:this.i10n.getConstant("linkHeader"),content:p,cssClass:L8e+this.parent.getCssClass(!0),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showCloseIcon:!0,closeOnEscape:!0,width:F.isDevice?"290px":"310px",isModal:F.isDevice,buttons:[{click:this.insertlink.bind(d),buttonModel:{content:a,cssClass:"e-flat e-insertLink"+this.parent.getCssClass(!0),isPrimary:!0}},{click:this.cancelDialog.bind(d),buttonModel:{cssClass:"e-flat"+this.parent.getCssClass(!0),content:l}}],target:F.isDevice?document.body:this.parent.element,animationSettings:{effect:"None"},close:function(e){c.parent.isBlur=!1,e&&e.event.returnValue&&("HTML"===c.parent.editorMode?h.restore():c.parent.formatter.editorManager.markdownSelection.restore(c.parent.contentModule.getEditPanel())),c.dialogObj.element&&c.dialogObj.element.querySelector(".e-rte-linkurl")&&null!==c.dialogObj.element.querySelector(".e-rte-linkurl")&&E.remove(c.dialogObj.element.querySelector(".e-rte-linkurl"),"input",c.handleKeyDown),c.dialogObj.destroy(),G(c.dialogObj.element);e=c.dialogObj;c.dialogRenderObj.close(e),c.dialogObj=null}},this.dialogObj=this.dialogRenderObj.render(p),this.dialogObj.createElement=this.parent.createElement,this.dialogObj.appendTo(n),n.style.maxHeight="inherit",je(this.dialogObj)||(je(t)||(o.value=t.url,r.value=t.text,s.value=t.title,t.target?this.checkBoxObj.checked=!0:this.checkBoxObj.checked=!1,this.dialogObj.header=t.header,this.dialogObj.element.querySelector(".e-insertLink").textContent=t.btnText),this.checkUrl(!1),("HTML"===this.parent.editorMode&&je(t)&&(!je(i)&&""!==i&&0===e.selection.range.startOffset||e.selection.range.startOffset!==e.selection.range.endOffset)||"Markdown"===e.module)&&(r.value=i),this.parent.element.ownerDocument.addEventListener("mousedown",this.mouseDown),this.quickToolObj&&(this.hideLinkQuickToolbar(),this.quickToolObj.inlineQTBar&&document.body.contains(this.quickToolObj.inlineQTBar.element)&&this.quickToolObj.inlineQTBar.hidePopup(),this.quickToolObj.textQTBar)&&this.parent.element.ownerDocument.body.contains(this.quickToolObj.textQTBar.element)&&this.quickToolObj.textQTBar.hidePopup())))},Y9e.prototype.hasAnchorNodePresent=function(e){return!je(e)&&0<e.length&&e.some(function(e){return e&&e.classList&&e.classList.contains("e-rte-anchor")})},Y9e.prototype.insertlink=function(e){var t,i,n,o=this.selfLink.dialogObj.element,r=o.querySelector(".e-rte-linkurl").value.trim(),s=o.querySelector(".e-rte-linkText").value,o=("HTML"===this.selfLink.parent.editorMode&&(t=o.querySelector(".e-rte-linkTitle").value),this.selfLink.checkBoxObj.checked?"_blank":null),a=this.selfLink.checkBoxObj.checked?this.selfLink.i10n.getConstant("linkAriaLabel"):null;""===(r="Markdown"===this.selfLink.parent.editorMode&&""===r?"https://":r)?this.selfLink.checkUrl(!0):(s="Markdown"===this.selfLink.parent.editorMode?""!==s.trim()?s:"":""===s.trim()?r:s,this.selfLink.isUrl(r)?this.selfLink.checkUrl(!1):this.selfLink.parent.enableAutoUrl||(r=-1<r.indexOf("https")?r:"https://"+r),"HTML"===(i=this.selfLink).parent.editorMode&&je(z(this.selection.range.startContainer.parentNode,"[id='"+i.parent.contentModule.getPanel().id+"']"))&&(i.parent.contentModule.getEditPanel().focus(),F.isIE&&i.parent.iframeSettings.enable&&this.selection.restore(),n=i.parent.formatter.editorManager.nodeSelection.getRange(i.parent.contentModule.getDocument()),this.selection=i.parent.formatter.editorManager.nodeSelection.save(n,i.parent.contentModule.getDocument()),this.selectParent=i.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(n)),n={url:r,text:s,title:t,target:o,ariaLabel:a,selection:this.selection,selectParent:this.selectParent},document.body.contains(i.dialogObj.element)&&this.selfLink.dialogObj.hide({returnValue:!1}),null===this.selfLink.dialogObj&&(WUe()&&i.parent.iframeSettings.enable&&ge("iframe",i.parent.element).contentWindow.focus(),"HTML"===i.parent.editorMode&&this.selection.restore(),0===i.parent.formatter.getUndoRedoStack().length&&i.parent.formatter.saveData(),s=je(this.args)||"KeyK"!==this.args.code?this.args:(r=this.args,Pe(this.args,{item:{command:"Links",subCommand:"CreateLink"},originalEvent:r},!0),{item:{command:"Links",subCommand:"CreateLink"},originalEvent:r}),this.selfLink.parent.formatter.process(this.selfLink.parent,s,!je(this.args)&&this.args.originalEvent,n),this.selfLink.parent.contentModule.getEditPanel().focus()))},Y9e.prototype.isUrl=function(e){return new RegExp("(ftp|http|https)://(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(/|/([\\w#!:.?+=&%@\\-\\/]))?","gi").test(e)},Y9e.prototype.handleKeyDown=function(){var e=this.parent.element.querySelector("#"+this.rteID+"_rtelink_dialog-content").querySelector(".e-rte-linkurl");e.classList.contains("e-error")&&1<=e.value.length&&" "!==e.value.trim()&&q([e],"e-error")},Y9e.prototype.checkUrl=function(e){var t=this.dialogObj.element.querySelector(".e-rte-linkurl");e?(U([t],"e-error"),t.setSelectionRange(0,t.value.length),t.focus(),E.add(t,"input",this.handleKeyDown,this)):(q([t],"e-error"),E.remove(t,"input",this.handleKeyDown))},Y9e.prototype.removeLink=function(e){0===this.parent.formatter.getUndoRedoStack().length&&this.parent.formatter.saveData();var t=this.getAnchorNode(e.selectParent);this.parent.formatter.process(this.parent,e.args,e.args,{selectNode:e.selectNode,selectParent:e.selectParent,selection:e.selection,text:t.innerText,subCommand:e.args.item.subCommand}),(WUe()&&this.parent.iframeSettings.enable?ge("iframe",this.parent.element).contentWindow:this.parent.contentModule.getEditPanel()).focus(),this.hideLinkQuickToolbar()},Y9e.prototype.openLink=function(e){var t,i,n=this.getAnchorNode(e.selectParent);!n.classList.contains("e-rte-anchor")&&"A"!==n.tagName||(t=this.parent.htmlEditorModule.sanitizeHelper(n.outerHTML),(i=document.createElement("div")).innerHTML=t,this.parent.formatter.process(this.parent,e.args,e.args,{url:i.firstChild.href,text:n.innerText,target:""===n.target?"_self":"_blank",selectNode:e.selectNode,subCommand:e.args.item.subCommand}),i.remove())},Y9e.prototype.getAnchorNode=function(e){for(var t=0,i=e;t<i.length;t++){var n=z(i[t],"a");if(n)return n}return e[0]},Y9e.prototype.editLink=function(e){var t=this.getAnchorNode(e.selectNode),i=this.getAnchorNode(e.selectParent);!(i="A"===t.nodeName?t:i).classList.contains("e-rte-anchor")&&"A"!==i.tagName||(t=this.i10n.getConstant("dialogUpdate"),i={url:i.getAttribute("href"),text:i.innerText,title:i.title,target:i.target,header:this.i10n.getConstant("editLink"),btnText:t},this.linkDialog(e,i))},Y9e.prototype.cancelDialog=function(e){var t,i;this.selfLink.parent.isBlur=!1,this.selfLink.dialogObj.hide({returnValue:!0}),WUe()?this.selection.restore():(t=window.scrollX,i=window.scrollY,this.selfLink.parent.contentModule.getEditPanel().focus(),window.scrollTo(t,i))},Y9e.prototype.onDocumentClick=function(e){var t=e.target;!je(this.dialogObj)&&(!z(t,"[id='"+this.dialogObj.element.id+"']")&&this.parent.toolbarSettings.enable&&this.parent.getToolbarElement()&&!this.parent.getToolbarElement().contains(e.target)||(this.parent.getToolbarElement()&&this.parent.getToolbarElement().contains(e.target)||this.parent.inlineMode.enable&&!z(t,"#"+this.dialogObj.element.id))&&!z(t,"#"+this.parent.getID()+"_toolbar_CreateLink")&&!t.querySelector("#"+this.parent.getID()+"_toolbar_CreateLink"))&&(this.parent.notify(SWe,{closedBy:"outside click"}),this.dialogObj.hide({returnValue:!0}),this.parent.isBlur=!0,L6e(this.parent.element,"focusout"))},Y9e.prototype.destroy=function(){this.isDestroyed||(je(this.linkQTPopupTime)||(clearTimeout(this.linkQTPopupTime),this.linkQTPopupTime=null),this.removeEventListener(),this.isDestroyed=!0)},Y9e.prototype.getModuleName=function(){return"link"};var G9e=Y9e;function Y9e(e,t){this.parent=e,this.rteID=e.element.id,this.i10n=t.getService("rteLocale"),this.addEventListener(),this.serviceLocator=t,this.rendererFactory=t.getService("rendererFactory"),this.dialogRenderObj=t.getService("dialogRenderObject"),this.isDestroyed=!1,this.mouseDown=this.onDocumentClick.bind(this)}K9e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(u4e,this.onKeyDown,this),this.parent.on(c4e,this.onKeyUp,this),this.parent.on(H4e,this.insertImage,this),this.parent.on(rWe,this.showDialog,this),this.parent.on(lWe,this.closeDialog,this),this.parent.on(D4e,this.onWindowResize,this),this.parent.on(W4e,this.showImageQuickToolbar,this),this.parent.on(I5e,this.clearDialogObj,this),this.parent.on(x4e,this.onToolbarAction,this),this.parent.on(X4e,this.caption,this),this.parent.on(q4e,this.deleteImg,this),this.parent.on(Q4e,this.insertImgLink,this),this.parent.on(U4e,this.insertAltText,this),this.parent.on(s5e,this.editAreaClickHandler,this),this.parent.on(e4e,this.onIframeMouseDown,this),this.parent.on(K4e,this.imageSize,this),this.parent.on(C4e,this.alignmentSelect,this),this.parent.on($3e,this.afterRender,this),this.parent.on($5e,this.afterRender,this),this.parent.on(m5e,this.imagePaste,this),this.parent.on(uWe,this.setCssClass,this),this.parent.on(t4e,this.destroy,this))},K9e.prototype.removeEventListener=function(){var e;this.parent.isDestroyed||(this.parent.off(u4e,this.onKeyDown),this.parent.off(c4e,this.onKeyUp),this.parent.off(D4e,this.onWindowResize),this.parent.off(H4e,this.insertImage),this.parent.off(rWe,this.showDialog),this.parent.off(lWe,this.closeDialog),this.parent.off(W4e,this.showImageQuickToolbar),this.parent.off(I5e,this.clearDialogObj),this.parent.off(X4e,this.caption),this.parent.off(x4e,this.onToolbarAction),this.parent.off(q4e,this.deleteImg),this.parent.off(Q4e,this.insertImgLink),this.parent.off(U4e,this.insertAltText),this.parent.off(s5e,this.editAreaClickHandler),this.parent.off(e4e,this.onIframeMouseDown),this.parent.off(K4e,this.imageSize),this.parent.off(C4e,this.alignmentSelect),this.parent.off($3e,this.afterRender),this.parent.off($5e,this.afterRender),this.parent.off(m5e,this.imagePaste),this.parent.off(uWe,this.setCssClass),this.parent.off(t4e,this.destroy),(e=this.parent.iframeSettings.enable?this.parent.inputElement.ownerDocument:this.parent.inputElement).removeEventListener("drop",this.drop,!0),e.removeEventListener("dragstart",this.drag,!0),e.removeEventListener("dragenter",this.enter,!0),e.removeEventListener("dragover",this.start,!0),this.drop=null,this.drag=null,this.enter=null,this.start=null,je(this.contentModule))||(E.remove(this.contentModule.getEditPanel(),F.touchEndEvent,this.imageClick),this.parent.formatter.editorManager.observer.off(w5e,this.undoStack),this.parent.insertImageSettings.resize&&(E.remove(this.parent.contentModule.getEditPanel(),F.touchStartEvent,this.resizeStart),this.parent.element.ownerDocument.removeEventListener("mousedown",this.docClick),this.docClick=null,E.remove(this.contentModule.getEditPanel(),"cut",this.onCutHandler),E.remove(this.contentModule.getDocument(),F.touchMoveEvent,this.resizing)))},K9e.prototype.updateCss=function(e,t){e&&t.cssClass&&(je(t.oldCssClass)?e.setProperties({cssClass:(e.cssClass+" "+t.cssClass).trim()}):e.setProperties({cssClass:(e.cssClass.replace(t.oldCssClass,"").trim()+" "+t.cssClass).trim()}))},K9e.prototype.setCssClass=function(e){this.popupObj&&e.cssClass&&(je(e.oldCssClass)||q([this.popupObj.element],e.oldCssClass),U([this.popupObj.element],e.cssClass)),this.updateCss(this.checkBoxObj,e),this.updateCss(this.widthNum,e),this.updateCss(this.heightNum,e),this.updateCss(this.uploadObj,e),this.updateCss(this.dialogObj,e)},K9e.prototype.onIframeMouseDown=function(e){e=e.target;this.dialogObj&&this.dialogObj.hide({returnValue:!0}),(je(this.parent.currentTarget)||"IMG"!==this.parent.currentTarget.nodeName)&&this.imgEle&&this.imgResizeDiv&&this.contentModule.getEditPanel().contains(this.imgResizeDiv)&&this.cancelResizeAction(),this.contentModule.getEditPanel().querySelector(".e-img-resize")&&"IMG"===this.parent.currentTarget.nodeName&&!je(this.prevSelectedImgEle)&&this.prevSelectedImgEle!==e&&(this.prevSelectedImgEle.style.outline="")},K9e.prototype.afterRender=function(){this.contentModule=this.rendererFactory.getRenderer(q3e.Content),E.add(this.contentModule.getEditPanel(),F.touchEndEvent,this.imageClick,this),this.parent.insertImageSettings.resize&&(E.add(this.parent.contentModule.getEditPanel(),F.touchStartEvent,this.resizeStart,this),this.parent.element.ownerDocument.addEventListener("mousedown",this.docClick),E.add(this.contentModule.getEditPanel(),"cut",this.onCutHandler,this));var e=this.parent.iframeSettings.enable?this.parent.inputElement.ownerDocument:this.parent.inputElement;e.addEventListener("drop",this.drop,!0),e.addEventListener("dragstart",this.drag,!0),e.addEventListener("dragenter",this.enter,!0),e.addEventListener("dragover",this.start,!0)},K9e.prototype.undoStack=function(e){if(("undo"===e.subCommand.toLowerCase()||"redo"===e.subCommand.toLowerCase())&&"HTML"===this.parent.editorMode)for(var t=0;t<this.parent.formatter.getUndoRedoStack().length;t++){var i=this.parent.createElement("div"),n=this.parent.formatter.getUndoRedoStack()[t].text,o=(i.appendChild(n.cloneNode(!0)),i.querySelectorAll("img"));if(i.querySelector(".e-img-resize")&&0<o.length){for(var r=0;r<o.length;r++)o[r].style.outline="";G(i.querySelector(".e-img-resize"));for(var s=i.cloneNode(!0),a=document.createDocumentFragment();s.firstChild;)a.appendChild(s.firstChild);this.parent.formatter.getUndoRedoStack()[t].text=a}}},K9e.prototype.resizeEnd=function(e){this.resizeBtnInit(),this.imgEle.parentElement&&(this.imgEle.parentElement.style.cursor="auto"),F.isDevice&&q([e.target.parentElement],"e-mob-span"),this.parent.trigger(P4e,{event:e,requestType:"images"}),this.parent.formatter.editorManager.observer.on(w5e,this.undoStack,this),this.parent.formatter.saveData(),E.remove(this.contentModule.getDocument(),F.touchMoveEvent,this.resizing),E.remove(this.contentModule.getDocument(),F.touchEndEvent,this.resizeEnd)},K9e.prototype.resizeStart=function(e,t){var i=this;if(!this.parent.readonly){var n=t||e.target;if(this.prevSelectedImgEle=this.imgEle,"IMG"===n.tagName&&(this.parent.preventDefaultResize(e),t=n,this.imgResizeDiv&&this.contentModule.getEditPanel().contains(this.imgResizeDiv)&&G(this.imgResizeDiv),this.imageResize(t)),n.classList.contains("e-rte-imageboxmark")){0===this.parent.formatter.getUndoRedoStack().length&&this.parent.formatter.saveData(),this.pageX=this.getPointX(e),this.pageY=this.getPointY(e),e.preventDefault(),e.stopImmediatePropagation(),this.resizeBtnInit(),this.quickToolObj&&this.quickToolObj.imageQTBar.hidePopup();for(var o=["topLeft","topRight","botLeft","botRight"],r=0;r<o.length;r++){var s=o[r];if(n.classList.contains("e-rte-"+s)){this.resizeBtnStat[s]=!0,this.currentResizeHandler=s,this.aspectRatio=this.findAspectRatio(this.imgEle);break}}F.isDevice&&this.contentModule.getEditPanel().contains(this.imgResizeDiv)&&!this.imgResizeDiv.classList.contains("e-mob-span")?U([this.imgResizeDiv],"e-mob-span"):this.parent.trigger(M4e,{event:e,requestType:"images"},function(e){e.cancel&&i.cancelResizeAction()}),E.add(this.contentModule.getDocument(),F.touchMoveEvent,this.resizing,this),E.add(this.contentModule.getDocument(),F.touchEndEvent,this.resizeEnd,this)}}},K9e.prototype.imageClick=function(e){F.isDevice&&("IMG"===e.target.tagName&&"A"===e.target.parentElement.tagName||"IMG"===e.target.tagName?(this.contentModule.getEditPanel().setAttribute("contenteditable","false"),e.target.focus()):this.parent.readonly||this.contentModule.getEditPanel().setAttribute("contenteditable","true")),"IMG"===e.target.tagName&&"A"===e.target.parentElement.tagName&&e.preventDefault()},K9e.prototype.onCutHandler=function(){this.imgResizeDiv&&this.contentModule.getEditPanel().contains(this.imgResizeDiv)&&this.cancelResizeAction()},K9e.prototype.imageResize=function(e){this.resizeBtnInit(),this.imgEle=e,U([this.imgEle],"e-resize"),this.imgResizeDiv=this.parent.createElement("span",{className:"e-img-resize"+this.parent.getCssClass(!0),id:this.rteID+"_imgResize"}),this.imgResizeDiv.appendChild(this.parent.createElement("span",{className:"e-rte-imageboxmark e-rte-topLeft"+this.parent.getCssClass(!0),styles:"cursor: nwse-resize"})),this.imgResizeDiv.appendChild(this.parent.createElement("span",{className:"e-rte-imageboxmark e-rte-topRight"+this.parent.getCssClass(!0),styles:"cursor: nesw-resize"})),this.imgResizeDiv.appendChild(this.parent.createElement("span",{className:"e-rte-imageboxmark e-rte-botLeft"+this.parent.getCssClass(!0),styles:"cursor: nesw-resize"})),this.imgResizeDiv.appendChild(this.parent.createElement("span",{className:"e-rte-imageboxmark e-rte-botRight"+this.parent.getCssClass(!0),styles:"cursor: nwse-resize"})),F.isDevice&&U([this.imgResizeDiv],"e-mob-rte"),e.style.outline="2px solid #4a90e2",this.imgResizePos(e,this.imgResizeDiv),this.resizeImgDupPos(e),this.contentModule.getEditPanel().appendChild(this.imgResizeDiv),"auto"===this.parent.element.style.height&&this.imgResizePos(e,this.imgResizeDiv)},K9e.prototype.getPointX=function(e){return this.parent.iframeSettings.enable?(e.touches&&e.touches.length?e.touches[0]:e).screenX:(e.touches&&e.touches.length?e.touches[0]:e).pageX},K9e.prototype.getPointY=function(e){return this.parent.iframeSettings.enable?(e.touches&&e.touches.length?e.touches[0]:e).screenY:(e.touches&&e.touches.length?e.touches[0]:e).pageY},K9e.prototype.imgResizePos=function(e,t){var i=this.calcPos(e),n=i.top,i=i.left,o=e.getBoundingClientRect().width,r=e.getBoundingClientRect().height,e=F.isDevice?4*parseInt(e.style.outline.slice(-3),10)+2:2*parseInt(e.style.outline.slice(-3),10)+2,s=F.isDevice?0:2;t.querySelector(".e-rte-botLeft").style.left=i-e+"px",t.querySelector(".e-rte-botLeft").style.top=r-e+n+"px",t.querySelector(".e-rte-botRight").style.left=o-(e-s)+i+"px",t.querySelector(".e-rte-botRight").style.top=r-e+n+"px",t.querySelector(".e-rte-topRight").style.left=o-(e-s)+i+"px",t.querySelector(".e-rte-topRight").style.top=n-e+"px",t.querySelector(".e-rte-topLeft").style.left=i-e+"px",t.querySelector(".e-rte-topLeft").style.top=n-e+"px"},K9e.prototype.calcPos=function(e){for(var t,i={top:0,left:0},n=e.ownerDocument,o=(e.offsetParent&&(e.offsetParent.classList.contains("e-img-caption")||-1<["TD","TH","TABLE","A"].indexOf(e.offsetParent.tagName))?z(e,"#"+this.parent.getID()+"_rte-edit-view"):e.offsetParent)||n.documentElement;o&&(o===n.body||o===n.documentElement)&&"static"===o.style.position;)o=o.parentNode;return o&&o!==e&&1===o.nodeType&&(i=o.getBoundingClientRect()),e.offsetParent&&e.offsetParent.classList.contains("e-img-caption")?{top:(t=e.getBoundingClientRect()).top-i.top,left:t.left-i.left}:{top:e.offsetTop,left:e.offsetLeft}},K9e.prototype.setAspectRatio=function(e,t,i){var n,o,r,s;je(e.width)||(n=e.width,o=e.height,r=this.parent.insertImageSettings.resizeByPercent?"%":"px",s=""===e.style.width&&""===e.style.height,n===o||s?(this.setImageWidth(e,t,r),this.parent.insertImageSettings.resizeByPercent?this.removeImageHeight(e):this.setImageHeight(e,i,r)):""!==e.style.width&&""!==e.style.height?this.parent.insertImageSettings.resizeByPercent?(this.setImageWidth(e,t,r),this.removeImageHeight(e)):(this.setImageWidth(e,t,r),this.setImageHeight(e,i,r)):""!==e.style.width?this.parent.insertImageSettings.resizeByPercent?(this.setImageWidth(e,t,r),this.removeImageHeight(e)):this.setImageWidth(e,t,r):""!==e.style.height&&(this.parent.insertImageSettings.resizeByPercent?(this.setImageWidth(e,t,r),this.removeImageHeight(e)):this.setImageHeight(e,i,r)))},K9e.prototype.setImageWidth=function(e,t,i){e.style.width=this.getImageDimension(t,e)+i,this.parent.insertImageSettings.resizeByPercent||e.setAttribute("width",t.toString())},K9e.prototype.setImageHeight=function(e,t,i){e.style.height=this.getImageDimension(t,e)+i,this.parent.insertImageSettings.resizeByPercent||e.setAttribute("height",t.toString())},K9e.prototype.removeImageHeight=function(e){e.style.height="",e.removeAttribute("height")},K9e.prototype.getImageDimension=function(e,t){return this.parent.insertImageSettings.resizeByPercent?(t=t.parentElement,this.pixToPerc(e,t)):e},K9e.prototype.adjustDimensionsByAspectRatio=function(e,t,i){return t=Math.round(e/i),{width:e=Math.round(t*i),height:t}},K9e.prototype.pixToPerc=function(e,t){return e/parseFloat(getComputedStyle(t).width)*100},K9e.prototype.imgDupMouseMove=function(t,i,e){var n=this;this.parent.trigger(k4e,{event:e,requestType:"images"},function(e){e.cancel?n.cancelResizeAction():parseInt(n.parent.insertImageSettings.minWidth,10)>=parseInt(t,10)||parseInt(n.parent.getInsertImgMaxWidth(),10)<=parseInt(t,10)&&je(n.imgEle.style.width)||!n.parent.insertImageSettings.resizeByPercent&&(parseInt(n.parent.insertImageSettings.minHeight,10)>=parseInt(i,10)||parseInt(n.parent.insertImageSettings.maxHeight,10)<=parseInt(i,10))||(n.imgEle.parentElement.style.cursor="pointer",n.setAspectRatio(n.imgEle,parseInt(t,10),parseInt(i,10)),n.resizeImgDupPos(n.imgEle),n.imgResizePos(n.imgEle,n.imgResizeDiv))})},K9e.prototype.resizing=function(e){var t,i,n,o,r,s,a,l,h,d;this.parent?(this.resizeBtnStat.botRight||this.resizeBtnStat.botLeft||this.resizeBtnStat.topRight||this.resizeBtnStat.topLeft)&&(this.parent.iframeSettings.enable?(n=this.getResizeFactor(this.currentResizeHandler),i=this.getPointX(e),o=this.getPointY(e),s=this.imgEle.clientWidth,a=this.imgEle.clientHeight,d=i-this.pageX,t=o-this.pageY,l=d*n[0]+s,h=t*n[1]+a,d=this.adjustDimensions(l,h,d,t,this.aspectRatio),this.pageX=i,this.pageY=o,this.imgDupMouseMove(d.width+"px",d.height+"px",e),this.parent.autoResize()):(t=this.getPointX(e),i=this.getPointY(e),n=this.getResizeFactor(this.currentResizeHandler),o=t-this.pageX,r=i-this.pageY,s=this.imgEle.clientWidth,a=this.imgEle.clientHeight,l=o*n[0]+s,h=r*n[1]+a,d=this.adjustDimensions(l,h,o,r,this.aspectRatio),this.pageX=t,this.pageY=i,this.imgDupMouseMove(d.width+"px",d.height+"px",e))):this.cancelResizeAction()},K9e.prototype.adjustDimensions=function(e,t,i,n,o){return this.adjustDimensionsByAspectRatio(e=e<16?16:e,t=t<16?16:t,o)},K9e.prototype.getResizeFactor=function(e){return zUe[e]},K9e.prototype.findAspectRatio=function(e){return e.clientWidth/e.clientHeight},K9e.prototype.cancelResizeAction=function(){E.remove(this.contentModule.getDocument(),F.touchMoveEvent,this.resizing),E.remove(this.contentModule.getDocument(),F.touchEndEvent,this.resizeEnd),this.imgEle&&this.imgResizeDiv&&this.contentModule.getEditPanel().contains(this.imgResizeDiv)&&(G(this.imgResizeDiv),this.imgEle.style.outline="",this.imgResizeDiv=null,this.pageX=null,this.pageY=null,this.currentResizeHandler=null,this.aspectRatio=null)},K9e.prototype.resizeImgDupPos=function(e){this.imgDupPos={width:""!==e.style.width&&this.parent.insertImageSettings&&!this.parent.insertImageSettings.resizeByPercent?this.imgEle.style.width:e.width+"px",height:""!==e.style.height?this.imgEle.style.height:e.height+"px"}},K9e.prototype.resizeBtnInit=function(){return this.aspectRatio=null,this.currentResizeHandler=null,this.resizeBtnStat={botLeft:!1,botRight:!1,topRight:!1,topLeft:!1}},K9e.prototype.onToolbarAction=function(e){switch(WUe()&&this.parent.notify(i5e,{}),e.args.item.subCommand){case"Replace":this.parent.fileManagerSettings.enable?this.parent.notify(J5e,e):this.parent.notify(H4e,e);break;case"Caption":this.parent.notify(X4e,e);break;case"InsertLink":this.parent.notify(Q4e,e);break;case"AltText":this.parent.notify(U4e,e);break;case"Remove":this.parent.notify(q4e,e);break;case"Dimension":this.parent.notify(K4e,e);break;case"OpenImageLink":this.openImgLink(e);break;case"EditImageLink":this.editImgLink(e);break;case"RemoveImageLink":this.removeImgLink(e)}},K9e.prototype.openImgLink=function(e){var t=this.parent.htmlEditorModule.sanitizeHelper(e.selectParent[0].parentNode.outerHTML),i=document.createElement("div"),t=(i.innerHTML=t,""===e.selectParent[0].parentNode.target?"_self":"_blank");this.parent.formatter.process(this.parent,e.args,e.args,{url:i.firstChild.href,target:t,selectNode:e.selectNode,subCommand:e.args.item.subCommand}),i.remove()},K9e.prototype.editImgLink=function(e){var t=e.selectParent[0].parentNode,i=this.i10n.getConstant("dialogUpdate"),t={url:t.href,target:t.target,header:"Edit Link",btnText:i};this.insertImgLink(e,t)},K9e.prototype.removeImgLink=function(e){F.isIE&&this.contentModule.getEditPanel().focus(),e.selection.restore();var t=!(!this.contentModule.getEditPanel().contains(this.captionEle)||!ge("a",this.captionEle)),i=t?[this.captionEle]:[e.selectNode[0].parentElement];this.parent.formatter.process(this.parent,e.args,e.args,{insertElement:e.selectNode[0],selectParent:i,selection:e.selection,subCommand:e.args.item.subCommand}),this.quickToolObj&&document.body.contains(this.quickToolObj.imageQTBar.element)&&(this.quickToolObj.imageQTBar.hidePopup(),je(e.selectParent)||q([e.selectParent[0]],"e-img-focus")),t&&ge(".e-img-inner",this.captionEle).focus()},K9e.prototype.onKeyDown=function(e){var t,i,n,o,r,s,a,l=e.args;this.deletedImg=[];if(!(r="HTML"===this.parent.editorMode?(t=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument())).startContainer===t.endContainer&&t.startOffset===t.endOffset:r)&&"HTML"===this.parent.editorMode&&[27,112,113,114,115,116,117,118,119,120,121,122,123,44,45,9,16,17,18,19,20,33,34,35,36,37,38,39,40,91,92,93,144,145,182,183].indexOf(l.which)<0)for(var h=this.parent.formatter.editorManager.nodeSelection.getNodeCollection(t),d=0;d<h.length;d++)"IMG"===h[d].nodeName&&this.deletedImg.push(h[d]);switch("HTML"===this.parent.editorMode&&(8===l.which&&"Backspace"===l.code||46===l.which&&"Delete"===l.code)&&(e=t.startContainer===t.endContainer&&t.startOffset===t.endOffset,8===l.which&&"Backspace"===l.code&&e?this.checkImageBack(t):46===l.which&&"Delete"===l.code&&e&&this.checkImageDel(t)),je(this.parent.formatter.editorManager.nodeSelection)||"KeyK"===l.code||(t=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),n=this.parent.formatter.editorManager.nodeSelection.getNodeCollection(t),o=this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(t),l.ctrlKey)||!l.key||1!==l.key.length&&"enter"!==l.action||je(o[0])||"IMG"!==o[0].tagName||!o[0].parentElement||(this.contentModule.getEditPanel().querySelector(".e-img-resize")&&this.removeResizeEle(),q([o[0]],"e-img-focus"),this.quickToolObj&&this.quickToolObj.imageQTBar&&this.quickToolObj.imageQTBar.hidePopup()),!l.ctrlKey||89!==l.keyCode&&90!==l.keyCode||"Markdown"!==this.parent.editorMode&&this.undoStack({subCommand:90===l.keyCode?"undo":"redo"}),8!==l.keyCode&&46!==l.keyCode||(n&&n[0]&&"IMG"===n[0].nodeName&&n.length<1&&(je(this.parent.formatter.editorManager.nodeSelection)||(i=this.parent.formatter.editorManager.nodeSelection.save(t,this.parent.contentModule.getDocument())),l.preventDefault(),this.deleteImg({selectNode:n,selection:i,selectParent:o,args:{item:{command:"Images",subCommand:"Remove"},originalEvent:l}},l.keyCode)),this.parent.contentModule.getEditPanel().querySelector(".e-img-resize")&&this.removeResizeEle()),"Backspace"===l.code&&(l.action="backspace"),l.action){case"escape":je(this.dialogObj)||this.dialogObj.close();break;case"backspace":case"delete":"Markdown"!==this.parent.editorMode&&(3===t.startContainer.nodeType?"Backspace"===l.code?t.startContainer.previousElementSibling&&0===t.startOffset&&t.startContainer.previousElementSibling.classList.contains(S8e)&&t.startContainer.previousElementSibling.classList.contains(x8e)&&G(t.startContainer.previousElementSibling):t.startContainer.nextElementSibling&&t.endContainer.textContent.length===t.endOffset&&t.startContainer.nextElementSibling.classList.contains(S8e)&&t.startContainer.nextElementSibling.classList.contains(x8e)&&G(t.startContainer.nextElementSibling):1===t.startContainer.nodeType&&(t.startContainer.querySelector("."+S8e+"."+x8e)?G(t.startContainer.querySelector("."+S8e+"."+x8e)):t.startContainer.querySelector("."+S8e+"."+m8e)?G(t.startContainer.querySelector("."+S8e+"."+m8e)):t.startContainer.classList.contains("e-img-wrap")&&z(t.startContainer,"."+S8e)&&(s=t.startContainer.parentElement.parentElement,G(z(t.startContainer,"."+S8e)),s)&&""===s.textContent.trim()&&((a=this.parent.createElement("br")).classList.add("e-rte-image-remove-focus"),s.appendChild(a))));break;case"insert-image":je(this.parent.formatter.editorManager.nodeSelection)||(i=this.parent.formatter.editorManager.nodeSelection.save(t,this.parent.contentModule.getDocument())),this.openDialog(!0,l,i,n,o),l.preventDefault()}l.ctrlKey&&"a"===l.key&&this.handleSelectAll()},K9e.prototype.handleSelectAll=function(){this.cancelResizeAction(),q(this.parent.inputElement.querySelectorAll("."+bQe),bQe)},K9e.prototype.openDialog=function(e,t,i,n,o){var r,s,n=e||je(this.parent.formatter.editorManager.nodeSelection)?(r=i,s=n,o):(i=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),r=this.parent.formatter.editorManager.nodeSelection.save(i,this.parent.contentModule.getDocument()),s=this.parent.formatter.editorManager.nodeSelection.getNodeCollection(i),this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(i));"HTML"===this.parent.editorMode?this.insertImage({args:{item:{command:"Images",subCommand:"Image"},originalEvent:t,name:e?null:"showDialog"},selectNode:s,selection:r,selectParent:n}):this.insertImage({args:{item:{command:"Images",subCommand:"Image"},originalEvent:t,name:e?null:"showDialog"},member:"image",text:this.parent.formatter.editorManager.markdownSelection.getSelectedText(this.parent.contentModule.getEditPanel()),module:"Markdown",name:"insertImage"})},K9e.prototype.showDialog=function(e){je(e.originalEvent)?this.openDialog(!1):this.openDialog(!1,e.originalEvent),this.setCssClass({cssClass:this.parent.getCssClass()})},K9e.prototype.closeDialog=function(){this.dialogObj&&this.dialogObj.hide({returnValue:!0})},K9e.prototype.onKeyUp=function(){if(!je(this.deletedImg)&&0<this.deletedImg.length)for(var e=Array.from(this.deletedImg).length-1;0<=e;e--){var t={element:this.deletedImg[e],src:this.deletedImg[e].getAttribute("src")};this.parent.trigger(W5e,t),this.deletedImg.splice(e,1)}},K9e.prototype.checkImageBack=function(e){"#text"!==e.startContainer.nodeName||0!==e.startOffset||je(e.startContainer.previousSibling)||"IMG"!==e.startContainer.previousSibling.nodeName?"#text"===e.startContainer.nodeName||je(e.startContainer.childNodes[e.startOffset-1])||"IMG"!==e.startContainer.childNodes[e.startOffset-1].nodeName||this.deletedImg.push(e.startContainer.childNodes[e.startOffset-1]):this.deletedImg.push(e.startContainer.previousSibling)},K9e.prototype.checkImageDel=function(e){"#text"!==e.startContainer.nodeName||e.startOffset!==e.startContainer.textContent.length||je(e.startContainer.nextSibling)||"IMG"!==e.startContainer.nextSibling.nodeName?"#text"===e.startContainer.nodeName||je(e.startContainer.childNodes[e.startOffset])||"IMG"!==e.startContainer.childNodes[e.startOffset].nodeName||this.deletedImg.push(e.startContainer.childNodes[e.startOffset]):this.deletedImg.push(e.startContainer.nextSibling)},K9e.prototype.alignmentSelect=function(e){var t=e.item;if(document.body.contains(document.body.querySelector(".e-rte-quick-toolbar"))&&"Images"===t.command){var i=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),i=this.parent.formatter.editorManager.nodeSelection.getNodeCollection(i),n={args:e,selectNode:i="IMG"===i[0].nodeName?i:[this.imgEle]};switch(0===this.parent.formatter.getUndoRedoStack().length&&this.parent.formatter.saveData(),t.subCommand){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":this.alignImage(n);break;case"Inline":this.inline(n);break;case"Break":this.break(n)}this.quickToolObj&&document.body.contains(this.quickToolObj.imageQTBar.element)&&(this.quickToolObj.imageQTBar.hidePopup(),q([i[0]],"e-img-focus")),this.cancelResizeAction()}},K9e.prototype.imageWithLinkQTBarItemUpdate=function(){for(var e=this.quickToolObj.imageQTBar.toolbarElement.querySelectorAll(".e-toolbar-item"),t=0;t<e.length;t++)e[t].getAttribute("title")===this.i10n.getConstant("openLink")||e[t].getAttribute("title")===this.i10n.getConstant("editLink")||e[t].getAttribute("title")===this.i10n.getConstant("removeLink")?(U([e[t]],"e-link-groups"),e[t].style.display="none"):"Insert Link"===e[t].getAttribute("title")?e[t].style.display="":e[t].classList.contains("e-rte-horizontal-separator")&&G(e[t]);var i=this.quickToolObj.imageQTBar.toolbarElement.querySelectorAll(".e-toolbar-item:not(.e-link-groups)");this.quickToolObj.imageQTBar.addQTBarItem(["-"],Math.round(i.length/2))},K9e.prototype.showImageQuickToolbar=function(e){var t,i,n,o,r=this;"Images"!==e.type&&"Replace"!==e.type||je(this.parent.quickToolbarModule)||je(this.parent.quickToolbarModule.imageQTBar)||je(e.args)||(this.quickToolObj=this.parent.quickToolbarModule,t=e.args,i=e.elements,[].forEach.call(e.elements,function(e,t){0===t&&(i=e)}),i&&!z(i,"a")&&this.imageWithLinkQTBarItemUpdate(),"IMG"===i.nodeName&&U([i],["e-img-focus"]),n=this.parent.iframeSettings.enable?window.pageYOffset+this.parent.element.getBoundingClientRect().top+t.clientY:t.pageY,this.parent.quickToolbarModule.imageQTBar&&(e.isNotify?this.imageQTPopupTime=setTimeout(function(){r.parent.formatter.editorManager.nodeSelection.Clear(r.contentModule.getDocument()),r.parent.formatter.editorManager.nodeSelection.setSelectionContents(r.contentModule.getDocument(),i),r.quickToolObj.imageQTBar.showPopup(t.pageX,n,i),!0===r.parent.insertImageSettings.resize&&r.resizeStart(e.args,i)},400):(o=i.getBoundingClientRect(),this.quickToolObj.imageQTBar.showPopup(o.left,o.top,i,"Image"))))},K9e.prototype.hideImageQuickToolbar=function(){je(this.contentModule.getEditPanel().querySelector(".e-img-focus"))||(q([this.contentModule.getEditPanel().querySelector(".e-img-focus")],"e-img-focus"),this.quickToolObj&&this.quickToolObj.imageQTBar&&document.body.contains(this.quickToolObj.imageQTBar.element)&&this.quickToolObj.imageQTBar.hidePopup())},K9e.prototype.editAreaClickHandler=function(e){if(this.parent.readonly)this.hideImageQuickToolbar();else{var t=e.args,i=this.parent.quickToolbarSettings.showOnRightClick;if(2===t.which||i&&1===t.which||!i&&3===t.which)i&&1===t.which&&!je(t.target)&&"IMG"===t.target.tagName&&(this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument()),this.parent.formatter.editorManager.nodeSelection.setSelectionContents(this.contentModule.getDocument(),t.target));else if("HTML"===this.parent.editorMode&&this.parent.quickToolbarModule&&this.parent.quickToolbarModule.imageQTBar){this.quickToolObj=this.parent.quickToolbarModule;var i=t.target,n=(this.contentModule=this.rendererFactory.getRenderer(q3e.Content),this.quickToolObj.imageQTBar.element.classList.contains("e-rte-pop"));if("IMG"===i.nodeName&&this.parent.quickToolbarModule){if(!n){this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument()),this.parent.formatter.editorManager.nodeSelection.setSelectionContents(this.contentModule.getDocument(),i),WUe()&&this.parent.notify(t5e,e),U([i],"e-img-focus");var o=this.quickToolObj.imageQTBar.toolbarElement.querySelectorAll(".e-toolbar-item");if(z(i,"a")){for(var r=0;r<o.length;r++)o[r].getAttribute("title")===this.i10n.getConstant("openLink")||o[r].getAttribute("title")===this.i10n.getConstant("editLink")||o[r].getAttribute("title")===this.i10n.getConstant("removeLink")?(o[r].style.display="",q([o[r]],"e-link-groups")):"Insert Link"===o[r].getAttribute("title")?o[r].style.display="none":o[r].classList.contains("e-rte-horizontal-separator")&&(o[r],G(o[r]));n=this.quickToolObj.imageQTBar.toolbarElement.querySelectorAll(".e-toolbar-item:not(.e-link-groups)");this.quickToolObj.imageQTBar.addQTBarItem(["-"],Math.round(n.length/2))}else z(i,"a")||this.imageWithLinkQTBarItemUpdate();this.showImageQuickToolbar({args:t,type:"Images",elements:[t.target]})}}else this.hideImageQuickToolbar()}}},K9e.prototype.insertImgLink=function(e,t){var i,n,o,r,s,a,l=this;"IMG"!==e.selectNode[0].nodeName||(this.imagDialog(e),je(this.dialogObj))||(i=this.parent.createElement("div",{className:"e-img-linkwrap"+this.parent.getCssClass(!0)}),s=this.i10n.getConstant("linkurl"),s=R6e('<div class="e-rte-field'+this.parent.getCssClass(!0)+'"><input type="text" data-role ="none" class="e-input e-img-link'+this.parent.getCssClass(!0)+'" spellcheck="false" placeholder="'+s+'"/></div><div class="e-rte-label"></div><div class="e-rte-field"><input type="checkbox" class="e-rte-linkTarget'+this.parent.getCssClass(!0)+'"  data-role ="none"></div>'),i.appendChild(s),s=i.querySelector(".e-rte-linkTarget"),n=i.querySelector(".e-img-link"),r=this.i10n.getConstant("linkOpenInNewWindow"),this.checkBoxObj=new ib({label:r,checked:!0,enableRtl:this.parent.enableRtl,cssClass:this.parent.getCssClass(),change:function(e){o=e.checked?"_blank":null}}),this.checkBoxObj.isStringTemplate=!0,this.checkBoxObj.createElement=this.parent.createElement,this.checkBoxObj.appendTo(s),o="_blank",r=this.i10n.getConstant("imageLinkAriaLabel"),s=this.i10n.getConstant("dialogUpdate"),a={args:e.args,selfImage:this,selection:e.selection,selectNode:e.selectNode,selectParent:e.selectParent,link:n,target:o,ariaLabel:r},this.dialogObj.setProperties({width:"290px",header:this.parent.localeObj.getConstant("imageInsertLinkHeader"),content:i,buttons:[{click:function(e){l.insertlink(a)},buttonModel:{content:s,cssClass:"e-flat e-update-link"+this.parent.getCssClass(!0),isPrimary:!0}}],cssClass:this.dialogObj.cssClass+" e-rte-img-link-dialog"}),je(this.parent.cssClass)||this.dialogObj.setProperties({cssClass:this.parent.cssClass}),je(t)||(n.value=t.url,this.checkBoxObj.checked=!!t.target,this.dialogObj.header=t.header),this.dialogObj.element.style.maxHeight="inherit",this.dialogObj.content.querySelector("input").focus())},K9e.prototype.insertAltText=function(e){var t,i,n,o,r,s,a=this;"IMG"!==e.selectNode[0].nodeName||(this.imagDialog(e),o=this.i10n.getConstant("altText"),je(this.dialogObj))||(t=this.parent.createElement("div",{className:"e-img-altwrap"+this.parent.getCssClass(!0)}),i=this.i10n.getConstant("alternateHeader"),n=this.i10n.getConstant("dialogUpdate"),r=null===e.selectNode[0].getAttribute("alt")?"":e.selectNode[0].getAttribute("alt"),(o=R6e('<div class="e-rte-field'+this.parent.getCssClass(!0)+'"><input type="text" spellcheck="false"  class="e-input e-img-alt'+this.parent.getCssClass(!0)+'" placeholder="'+o+'"/></div>')).querySelector("input").setAttribute("value",r),t.appendChild(o),r=t.querySelector(".e-img-alt"),s={args:e.args,selfImage:this,selection:e.selection,selectNode:e.selectNode,alt:r},this.dialogObj.setProperties({width:"290px",header:i,content:t,buttons:[{click:function(e){a.insertAlt(s)},buttonModel:{content:n,cssClass:"e-flat e-update-alt"+this.parent.getCssClass(!0),isPrimary:!0}}],cssClass:this.dialogObj.cssClass+" e-rte-img-alt-dialog"}),je(this.parent.cssClass)||this.dialogObj.setProperties({cssClass:this.parent.cssClass}),this.dialogObj.element.style.maxHeight="inherit",this.dialogObj.content.querySelector("input").focus())},K9e.prototype.insertAlt=function(e){var t;je(e.alt)||(e.selection.restore(),0===this.parent.formatter.getUndoRedoStack().length&&this.parent.formatter.saveData(),t=e.alt.value,this.parent.formatter.process(this.parent,e.args,e.args,{altText:t,selectNode:e.selectNode,subCommand:e.args.item.subCommand}),this.dialogObj.hide({returnValue:!1}),(this.parent.iframeSettings.enable?this.parent.inputElement:e.selectNode[0]).focus({preventScroll:!0}),e.selection.restore())},K9e.prototype.handleKeyDown=function(){var e=this.parent.element.querySelector("#"+this.rteID+"_image_dialog-content").querySelector(".e-img-link");e.classList.contains("e-error")&&1<=e.value.length&&" "!==e.value.trim()&&q([e],"e-error")},K9e.prototype.insertlink=function(e){var t,i;"IMG"===e.selectNode[0].nodeName&&(""===(i=e.link.value).trim()?(U([e.link],"e-error"),e.link.setSelectionRange(0,i.length),e.link.focus(),E.add(e.link,"input",this.handleKeyDown,this)):(E.remove(e.link,"input",this.handleKeyDown),q([e.link],"e-error"),this.isUrl(i)?q([e.link],"e-error"):this.parent.enableAutoUrl||(i=-1<i.indexOf("http")?i:"http://"+i),"HTML"===(t=e.selfImage).parent.editorMode&&e.selection.restore(),0===t.parent.formatter.getUndoRedoStack().length&&t.parent.formatter.saveData(),"A"===e.selectNode[0].parentElement.nodeName?(t.parent.formatter.process(t.parent,e.args,e.args,{url:i,target:t.checkBoxObj.checked?"_blank":null,ariaLabel:t.checkBoxObj.checked?this.i10n.getConstant("imageLinkAriaLabel"):null,selectNode:e.selectNode,subCommand:e.args.item.subCommand}),t.dialogObj.hide({returnValue:!0})):(t.parent.formatter.process(t.parent,e.args,e.args,{url:i,target:t.checkBoxObj.checked?"_blank":null,ariaLabel:t.checkBoxObj.checked?this.i10n.getConstant("imageLinkAriaLabel"):null,selectNode:e.selectNode,subCommand:e.args.item.subCommand,selection:e.selection}),(i=z(e.selectNode[0],".e-img-caption"))&&(e=ge("."+EQe,i),i)&&e.focus(),t.dialogObj.hide({returnValue:!1}))))},K9e.prototype.isUrl=function(e){return new RegExp("(ftp|http|https)://(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(/|/([\\w#!:.?+=&%@\\-\\/]))?","gi").test(e)},K9e.prototype.deleteImg=function(e,t){if("IMG"===e.selectNode[0].nodeName){var i={element:e.selectNode[0],src:e.selectNode[0].getAttribute("src")},n=(0===this.parent.formatter.getUndoRedoStack().length&&this.parent.formatter.saveData(),e.selection.range.startContainer);if("SPAN"===e.selection.range.startContainer.nodeName&&n.classList.contains("e-img-wrap")&&n.parentElement.classList.contains("e-img-caption"))if(je((n=n.parentElement).previousSibling)){if(!je(n.nextSibling)){for(var o=n.nextSibling;"#text"!==o.nodeName&&"BR"!==o.nodeName;)o=o.firstChild;this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(),o,0)}}else{for(var r=n.previousSibling;"#text"!==r.nodeName&&"BR"!==r.nodeName;)r=r.lastChild;this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(),r,"BR"!==r.nodeName?r.textContent.length:0)}else e.selection.restore();this.contentModule.getEditPanel().querySelector(".e-img-resize")&&this.removeResizeEle(),this.parent.formatter.process(this.parent,e.args,e.args,{selectNode:e.selectNode,captionClass:S8e,subCommand:e.args.item.subCommand}),this.quickToolObj&&document.body.contains(this.quickToolObj.imageQTBar.element)&&this.quickToolObj.imageQTBar.hidePopup(),this.cancelResizeAction(),je(t)&&this.parent.trigger(W5e,i)}},K9e.prototype.caption=function(e){var t,i,n,o,r=e.selectNode[0];"IMG"===r.nodeName&&(e.selection.restore(),0===this.parent.formatter.getUndoRedoStack().length&&this.parent.formatter.saveData(),this.cancelResizeAction(),U([r],"e-rte-image"),t=e.args.item?e.args.item.subCommand:"Caption",je(z(r,"."+S8e))?(this.captionEle=this.parent.createElement("span",{className:S8e+" "+A8e+this.parent.getCssClass(!0),attrs:{contenteditable:"false",draggable:"false",style:"width:"+this.parent.insertImageSettings.width}}),i=this.parent.createElement("span",{className:"e-img-wrap"+this.parent.getCssClass(!0)}),n=this.parent.createElement("span",{className:"e-img-inner"+this.parent.getCssClass(!0),attrs:{contenteditable:"true"}}),"A"===(o=e.selectNode[0].parentElement).tagName&&o.setAttribute("contenteditable","true"),i.appendChild("A"===o.tagName?o:e.selectNode[0]),i.appendChild(n),o=this.i10n.getConstant("imageCaption"),n.innerHTML=o,this.captionEle.appendChild(i),r.classList.contains(I8e)&&U([this.captionEle],x8e),r.classList.contains(m8e)&&U([this.captionEle],m8e),r.classList.contains(u8e)&&U([this.captionEle],u8e),r.classList.contains(c8e)&&U([this.captionEle],c8e),r.classList.contains(g8e)&&U([this.captionEle],g8e),this.parent.formatter.process(this.parent,e.args,e.args,{insertElement:this.captionEle,selectNode:e.selectNode,subCommand:t}),this.parent.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(),n.childNodes[0],n.childNodes[0],0,n.childNodes[0].textContent.length)):(G(z(r,"."+S8e)),F.isIE&&(this.contentModule.getEditPanel().focus(),e.selection.restore()),"A"===r.parentElement.tagName?this.parent.formatter.process(this.parent,e.args,e.args,{insertElement:r.parentElement,selectNode:e.selectNode,subCommand:t}):this.parent.formatter.process(this.parent,e.args,e.args,{insertElement:r,selectNode:e.selectNode,subCommand:t})),this.quickToolObj)&&document.body.contains(this.quickToolObj.imageQTBar.element)&&(this.quickToolObj.imageQTBar.hidePopup(),q([r],"e-img-focus"))},K9e.prototype.imageSize=function(e){var t,i,n,o,r=this;"IMG"!==e.selectNode[0].nodeName||(this.imagDialog(e),je(this.dialogObj))||(t=this.i10n.getConstant("imageSizeHeader"),i=this.i10n.getConstant("dialogUpdate"),this.changedHeightValue=null,this.changedWidthValue=null,n=this.imgsizeInput(e),o={args:e.args,selfImage:this,selection:e.selection,selectNode:e.selectNode},this.dialogObj.setProperties({width:"290px",header:t,content:n,buttons:[{click:function(e){r.insertSize(o)},buttonModel:{content:i,cssClass:"e-flat e-update-size"+this.parent.getCssClass(!0),isPrimary:!0}}],cssClass:this.dialogObj.cssClass+" e-rte-img-size-dialog"}),je(this.parent.cssClass)||this.dialogObj.setProperties({cssClass:this.parent.cssClass}),this.dialogObj.element.style.maxHeight="inherit",this.dialogObj.content.querySelector("input").focus())},K9e.prototype.break=function(e){var t;"IMG"===e.selectNode[0].nodeName&&(t=e.args.item.subCommand,this.parent.formatter.process(this.parent,e.args,e.args,{selectNode:e.selectNode,subCommand:t}))},K9e.prototype.inline=function(e){var t;"IMG"===e.selectNode[0].nodeName&&(t=e.args.item.subCommand,this.parent.formatter.process(this.parent,e.args,e.args,{selectNode:e.selectNode,subCommand:t}))},K9e.prototype.alignImage=function(e){var t=e.args.item.subCommand;this.parent.formatter.process(this.parent,e.args,e.args,{selectNode:e.selectNode,subCommand:t})},K9e.prototype.clearDialogObj=function(){this.uploadObj&&!this.uploadObj.isDestroyed&&(this.uploadObj.destroy(),G(this.uploadObj.element),this.uploadObj=null),this.checkBoxObj&&!this.checkBoxObj.isDestroyed&&(this.checkBoxObj.destroy(),G(this.checkBoxObj.element),this.checkBoxObj=null),this.popupObj&&!this.popupObj.isDestroyed&&(this.popupObj.destroy(),G(this.popupObj.element),this.popupObj=null),this.widthNum&&!this.widthNum.isDestroyed&&(this.widthNum.destroy(),G(this.widthNum.element),this.widthNum=null),this.heightNum&&!this.heightNum.isDestroyed&&(this.heightNum.destroy(),G(this.heightNum.element),this.heightNum=null),this.browseButton&&!this.browseButton.isDestroyed&&(this.browseButton.destroy(),G(this.browseButton.element),this.browseButton=null),this.dialogObj&&!this.dialogObj.isDestroyed&&(this.dialogObj.element&&this.dialogObj.element.querySelector(".e-img-link")&&null!==this.dialogObj.element.querySelector(".e-img-link")&&E.remove(this.dialogObj.element.querySelector(".e-img-link"),"input",this.handleKeyDown),this.dialogObj.destroy(),G(this.dialogObj.element),this.dialogObj=null)},K9e.prototype.imagDialog=function(e){var t,i,n,o,r,s,a=this;this.dialogObj?this.dialogObj.hide({returnValue:!0}):(t=this.parent.createElement("div",{className:"e-rte-img-dialog"+this.parent.getCssClass(!0),id:this.rteID+"_image"}),this.parent.rootContainer.appendChild(t),r=this.i10n.getConstant("dialogInsert"),s=this.i10n.getConstant("dialogCancel"),n=this.i10n.getConstant("imageHeader"),i=e.selection,o={selfImage:this,selection:e.selection,args:e.args,selectParent:e.selectParent},n={header:n,cssClass:L8e+this.parent.getCssClass(!0),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showCloseIcon:!0,closeOnEscape:!0,width:F.isDevice?"290px":"340px",isModal:F.isDevice,buttons:[{click:this.insertImageUrl.bind(o),buttonModel:{content:r,cssClass:"e-flat e-insertImage"+this.parent.getCssClass(!0),isPrimary:!0,disabled:"Markdown"!==this.parent.editorMode}},{click:this.cancelDialog.bind(this),buttonModel:{cssClass:"e-flat e-cancel"+this.parent.getCssClass(!0),content:s}}],target:F.isDevice?document.body:this.parent.element,animationSettings:{effect:"None"},close:function(e){e&&"user action"!==e.closedBy&&a.uploadObj&&0<a.uploadObj.filesData.length&&a.uploadObj.remove(),a.parent.isBlur=!1,e&&!je(e.event)&&e.event.returnValue&&("HTML"===a.parent.editorMode?i.restore():a.parent.formatter.editorManager.markdownSelection.restore(a.parent.contentModule.getEditPanel())),a.clearDialogObj(),a.dialogRenderObj.close(e)}},o=this.parent.createElement("div",{className:"e-img-content"+this.parent.getCssClass(!0)}),(je(this.parent.insertImageSettings.path)||"Markdown"!==this.parent.editorMode)&&"HTML"!==this.parent.editorMode||o.appendChild(this.imgUpload(e)),r=this.parent.createElement("div",{className:"e-linkheader"+this.parent.getCssClass(!0)}),s=this.i10n.getConstant("imageLinkHeader"),"HTML"===this.parent.editorMode?r.innerHTML=s:r.innerHTML=this.i10n.getConstant("mdimageLink"),o.appendChild(r),o.appendChild(this.imageUrlPopup(e)),e.selectNode&&"IMG"===e.selectNode[0].nodeName?(n.header=this.parent.localeObj.getConstant("editImageHeader"),n.content=o,n.buttons[0].buttonModel.cssClass=n.buttons[0].buttonModel.cssClass+" e-updateImage"):n.content=o,this.dialogObj=this.dialogRenderObj.render(n),this.dialogObj.createElement=this.parent.createElement,this.dialogObj.appendTo(t),je(this.dialogObj)||(e.selectNode&&"IMG"===e.selectNode[0].nodeName&&"insertImage"===e.name&&(this.dialogObj.element.querySelector(".e-insertImage").textContent=this.parent.localeObj.getConstant("dialogUpdate")),t.style.maxHeight="inherit",this.quickToolObj&&(this.quickToolObj.imageQTBar&&document.body.contains(this.quickToolObj.imageQTBar.element)&&(this.quickToolObj.imageQTBar.hidePopup(),je(e.selectParent)||q([e.selectParent[0]],"e-img-focus")),this.quickToolObj.inlineQTBar&&document.body.contains(this.quickToolObj.inlineQTBar.element)&&this.quickToolObj.inlineQTBar.hidePopup(),this.quickToolObj.textQTBar)&&this.parent.element.ownerDocument.body.contains(this.quickToolObj.textQTBar.element)&&this.quickToolObj.textQTBar.hidePopup()))},K9e.prototype.cancelDialog=function(){this.parent.isBlur=!1,!je(this.uploadObj)&&0<this.uploadObj.filesData.length&&this.uploadObj.remove(),this.dialogObj.hide({returnValue:!0})},K9e.prototype.onDocumentClick=function(e){var t=e.target;if(!je(this.contentModule.getEditPanel())&&("IMG"===t.nodeName&&(this.imgEle=t),this.parent)){if("#document"!==t.nodeName&&(this.parent.currentTarget=e.target),je(this.dialogObj)||!(!z(t,"[id='"+this.dialogObj.element.id+"']")&&this.parent.toolbarSettings.enable&&this.parent.getToolbarElement()&&!this.parent.getToolbarElement().contains(e.target)||this.parent.getToolbarElement()&&this.parent.getToolbarElement().contains(e.target)&&!z(t,"#"+this.parent.getID()+"_toolbar_Image")&&!t.querySelector("#"+this.parent.getID()+"_toolbar_Image"))||e.offsetX>e.target.clientWidth||e.offsetY>e.target.clientHeight||(this.parent.notify(SWe,{closedBy:"outside click"}),this.dialogObj.hide({returnValue:!0}),this.parent.isBlur=!0,L6e(this.parent.element,"focusout")),this.parent.iframeSettings.enable&&!je(this.parent.currentTarget)&&"IMG"===this.parent.currentTarget.nodeName||"IMG"===e.target.tagName||!this.imgResizeDiv||this.quickToolObj&&this.quickToolObj.imageQTBar&&this.quickToolObj.imageQTBar.element.contains(e.target)||!this.contentModule.getEditPanel().contains(this.imgResizeDiv)||this.cancelResizeAction(),!this.contentModule.getEditPanel().querySelector(".e-img-resize")||this.parent.iframeSettings.enable&&"IMG"===this.parent.currentTarget.nodeName||("IMG"!==t.tagName&&this.removeResizeEle(),"IMG"===t.tagName||je(this.imgEle)?je(this.prevSelectedImgEle)||this.prevSelectedImgEle===t||(this.prevSelectedImgEle.style.outline=""):this.imgEle.style.outline=""),"IMG"!==t.tagName)for(var i=this.contentModule.getEditPanel().querySelectorAll("img"),n=0;n<i.length;n++)q([i[n]],"e-img-focus"),q([i[n]],"e-resize");this.parent.inlineMode.enable&&t&&this.dialogObj&&!z(t,"#"+this.dialogObj.element.id)&&this.dialogObj.hide()}},K9e.prototype.removeResizeEle=function(){E.remove(this.contentModule.getDocument(),F.touchMoveEvent,this.resizing),E.remove(this.contentModule.getDocument(),F.touchEndEvent,this.resizeEnd),G(this.contentModule.getEditPanel().querySelector(".e-img-resize"))},K9e.prototype.onWindowResize=function(){je(this.contentModule)||je(this.contentModule.getEditPanel().querySelector(".e-img-resize"))||this.cancelResizeAction()},K9e.prototype.imageUrlPopup=function(e){var t=this,i=this.parent.createElement("div",{className:"imgUrl"+this.parent.getCssClass(!0)}),n=this.i10n.getConstant("imageUrl");return this.inputUrl=this.parent.createElement("input",{className:"e-input e-img-url"+this.parent.getCssClass(!0),attrs:{placeholder:n,spellcheck:"false","aria-label":this.i10n.getConstant("imageLinkHeader")}}),this.inputUrl.addEventListener("input",function(){je(t.inputUrl)||(0===t.inputUrl.value.length?t.dialogObj.getButtons(0).element.disabled=!0:t.dialogObj.getButtons(0).element.removeAttribute("disabled"))}),e.selectNode&&"IMG"===e.selectNode[0].nodeName&&(n=new RegExp(/([^\S]|^)(((https?:\/\/)|(www\.))(\S+))/gi),this.inputUrl.value=e.selectNode[0].src.match(n)?e.selectNode[0].src:""),i.appendChild(this.inputUrl),i},K9e.prototype.insertImageUrl=function(e){var t=this.selfImage,i=(t.isImgUploaded=!1,t.inputUrl.value),n=(e.target&&"BUTTON"===e.target.nodeName&&e.target.classList.contains("e-updateImage")&&(n=this.selectNode&&this.selectNode[0]&&"IMG"===this.selectNode[0].nodeName?this.selectNode[0]:null,t.parent.trigger(W5e,{element:n,src:i})),"Markdown"===t.parent.editorMode&&""===i&&(i="http://"),0===t.parent.formatter.getUndoRedoStack().length&&t.parent.formatter.saveData(),this.args.item.subCommand);if(this.args.item.subCommand="Update"===e.target.innerHTML?"Replace":this.args.item.subCommand,je(t.uploadUrl)||""===t.uploadUrl.url){if(""!==i){"HTML"===t.parent.editorMode&&je(z(this.selection.range.startContainer.parentNode,"[id='"+t.contentModule.getPanel().id+"']"))&&("IFRAME"===t.contentModule.getPanel().tagName&&"Replace"===this.args.item.subCommand?t.contentModule.getPanel():t.contentModule.getEditPanel(),e=t.parent.formatter.editorManager.nodeSelection.getRange(t.contentModule.getDocument()),this.selection=t.parent.formatter.editorManager.nodeSelection.save(e,t.contentModule.getDocument()),this.selectParent=t.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(e));e=/[\w-]+.(jpg|png|jpeg|gif)/g,e=je(i.match(e))||"HTML"!==t.parent.editorMode?"":i.match(e)[0],i={cssClass:!(this.selectParent&&this.selectParent[0].classList&&!0===this.selectParent[0].classList.contains("e-imgbreak")||"inline"!==t.parent.insertImageSettings.display)?I8e:m8e,url:i,selection:this.selection,altText:e,selectParent:this.selectParent,width:{width:t.parent.insertImageSettings.width,minWidth:t.parent.insertImageSettings.minWidth,maxWidth:t.parent.getInsertImgMaxWidth()},height:{height:t.parent.insertImageSettings.height,minHeight:t.parent.insertImageSettings.minHeight,maxHeight:t.parent.insertImageSettings.maxHeight}};if(t.dialogObj.hide({returnValue:!1}),null!==t.dialogObj)return;t.parent.formatter.process(t.parent,this.args,this.args.originalEvent,i)}}else{if(t.uploadUrl.cssClass=!(this.selectParent&&this.selectParent[0].classList&&!0===this.selectParent[0].classList.contains("e-imgbreak")||"inline"!==t.parent.insertImageSettings.display)?I8e:m8e,t.dialogObj.hide({returnValue:!1}),null!==t.dialogObj)return;t.parent.formatter.process(t.parent,this.args,this.args.originalEvent,t.uploadUrl),t.uploadUrl.url="",t.contentModule.getEditPanel().querySelector(".e-img-resize")&&(t.imgEle.style.outline="",t.removeResizeEle())}this.args.item.subCommand=n},K9e.prototype.imgsizeInput=function(e){var t=this,e=e.selectNode[0],i=this.i10n.getConstant("imageHeight"),n=this.i10n.getConstant("imageWidth"),o=this.parent.createElement("div",{className:"e-img-sizewrap"+this.parent.getCssClass(!0)}),r=!je(this.changedWidthValue)||"auto"!==e.style.width.toString()&&""===e.style.width?je(this.changedWidthValue)?parseInt(e.getClientRects()[0].width.toString(),10).toString():this.changedWidthValue:e.style.width,s=!je(this.changedHeightValue)||"auto"!==e.style.height.toString()&&""===e.style.height?je(this.changedHeightValue)?parseInt(e.getClientRects()[0].height.toString(),10).toString():this.changedHeightValue:e.style.height;""===e.style.width&&(r="auto"),""===e.style.height&&(s="auto"),this.changedWidthValue=null,this.changedHeightValue=null;e=R6e('<div class="e-rte-label'+this.parent.getCssClass(!0)+'"><label>'+n+'</label></div><div class="e-rte-field'+this.parent.getCssClass(!0)+'"><input type="text" id="imgwidth" class="e-img-width'+this.parent.getCssClass(!0)+'"/></div><div class="e-rte-label'+this.parent.getCssClass(!0)+'"><label>'+i+'</label></div><div class="e-rte-field'+this.parent.getCssClass(!0)+'"> <input type="text" id="imgheight" class="e-img-height'+this.parent.getCssClass(!0)+'"/></div>');return e.getElementById("imgwidth").setAttribute("value",r),e.getElementById("imgheight").setAttribute("value",s),o.appendChild(e),this.widthNum=new fV({value:T(r),enableRtl:this.parent.enableRtl,cssClass:this.parent.getCssClass(),input:function(e){t.inputWidthValue=T(t.inputValue(e.value))}}),this.widthNum.createElement=this.parent.createElement,this.widthNum.appendTo(o.querySelector("#imgwidth")),this.heightNum=new fV({value:T(s),enableRtl:this.parent.enableRtl,cssClass:this.parent.getCssClass(),input:function(e){t.inputHeightValue=T(t.inputValue(e.value))}}),this.heightNum.createElement=this.parent.createElement,this.heightNum.appendTo(o.querySelector("#imgheight")),o},K9e.prototype.inputValue=function(e){return"auto"===e||-1!==e.indexOf("%")||-1!==e.indexOf("px")||e.match(/(\d+)/)?e:"auto"},K9e.prototype.insertSize=function(e){e.selection.restore();var t=e.selfImage,i=(0===t.parent.formatter.getUndoRedoStack().length&&t.parent.formatter.saveData(),t.dialogObj.element),n=(this.changedWidthValue=this.inputWidthValue,this.changedHeightValue=this.inputHeightValue,i.querySelector(".e-img-width").value),i=i.parentElement.querySelector(".e-img-height").value;t.parent.formatter.process(this.parent,e.args,e.args,{width:n,height:i,selectNode:e.selectNode,subCommand:e.args.item.subCommand}),this.imgResizeDiv&&t.imgResizePos(e.selectNode[0],this.imgResizeDiv),t.dialogObj.hide({returnValue:!0}),t.parent.inputElement.focus({preventScroll:!0})},K9e.prototype.insertImage=function(e){this.imagDialog(e),je(this.dialogObj)||(this.dialogObj.element.style.maxHeight="inherit",e=this.dialogObj.element.querySelector(".e-img-content"),(!je(this.parent.insertImageSettings.path)&&"Markdown"===this.parent.editorMode||"HTML"===this.parent.editorMode?document.getElementById(this.rteID+"_insertImage"):e.querySelector(".e-img-url")).focus())},K9e.prototype.imgUpload=function(e){var o,r,s,a=this,l=this,t=l.parent.iframeSettings.enable,t=(r="HTML"===l.parent.editorMode&&(!t&&je(z(e.selection.range.startContainer.parentNode,"[id='"+this.parent.contentModule.getPanel().id+"']"))||t&&!A6e(e.selection.range.startContainer.parentNode.ownerDocument.querySelector("body"),"e-lib"))?(this.contentModule.getEditPanel().focus(),t=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),o=this.parent.formatter.editorManager.nodeSelection.save(t,this.parent.contentModule.getDocument()),this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(t)):(o=e.selection,e.selectParent),this.parent.createElement("div",{className:"e-img-uploadwrap e-droparea"+this.parent.getCssClass(!0)})),e=this.i10n.getConstant("imageDeviceUploadMessage"),i=this.i10n.getConstant("imageUploadMessage"),n=this.parent.createElement("span",{className:"e-droptext"+this.parent.getCssClass(!0)}),e=this.parent.createElement("span",{className:"e-rte-upload-text"+this.parent.getCssClass(!0),innerHTML:F.isDevice?e:i}),i=(n.appendChild(e),this.parent.createElement("button",{className:"e-browsebtn"+this.parent.getCssClass(!0),id:this.rteID+"_insertImage",attrs:{autofocus:"true",type:"button"}})),e=(n.appendChild(i),t.appendChild(n),this.i10n.getConstant("browse")),e=(this.browseButton=new zv({content:e,enableRtl:this.parent.enableRtl}),this.browseButton.isStringTemplate=!0,this.browseButton.createElement=this.parent.createElement,this.browseButton.appendTo(i),F.isDevice?n:i),i=(E.add(e,"click",this.fileSelect,this),this.parent.createElement("input",{id:this.rteID+"_upload",attrs:{type:"File",name:"UploadFiles"},className:this.parent.getCssClass()})),h=(t.appendChild(i),null);return this.uploadObj=new GN({asyncSettings:{saveUrl:this.parent.insertImageSettings.saveUrl,removeUrl:this.parent.insertImageSettings.removeUrl},dropArea:n,multiple:!1,enableRtl:this.parent.enableRtl,cssClass:this.parent.getCssClass(),allowedExtensions:this.parent.insertImageSettings.allowedTypes.toString(),selected:function(e){l.isImgUploaded=!0,e.filesData,a.parent.trigger(F5e,e,function(i){var n;i.cancel||je(i.filesData[0])||(a.checkExtension(i.filesData[0]),s=i.filesData[0].name.replace(/\.[a-zA-Z0-9]+$/,""),"HTML"===a.parent.editorMode&&je(a.parent.insertImageSettings.path)&&((n=new FileReader).addEventListener("load",function(e){var t="Base64"===a.parent.insertImageSettings.saveFormat?n.result:URL.createObjectURL(U6e(n.result));l.uploadUrl={url:t,selection:o,altText:s,selectParent:r,width:{width:l.parent.insertImageSettings.width,minWidth:l.parent.insertImageSettings.minWidth,maxWidth:l.parent.getInsertImgMaxWidth()},height:{height:l.parent.insertImageSettings.height,minHeight:l.parent.insertImageSettings.minHeight,maxHeight:l.parent.insertImageSettings.maxHeight}},l.inputUrl.setAttribute("disabled","true"),je(a.dialogObj)||je(t=a.dialogObj.getButtons(0))||(je(l.parent.insertImageSettings.saveUrl)&&a.isAllowedTypes&&i.filesData[0].size<=a.uploadObj.maxFileSize?t.element.removeAttribute("disabled"):t.element.setAttribute("disabled","true"))}),n.readAsDataURL(i.filesData[0].rawFile)))})},beforeUpload:function(e){a.parent.trigger(Y5e,e)},uploading:function(e){a.parent.isServerRendered||a.parent.trigger(L5e,e)},success:function(e){e.detectImageSource=X3e.Uploaded,a.parent.trigger(R5e,e,function(e){var t=!1;je(h)||h.name===e.file.name||"remove"!==e.operation.toLocaleLowerCase()||(t=!0),je(a.parent.insertImageSettings.path)||t||(t=a.parent.insertImageSettings.path+e.file.name,je(h)||"upload"!==e.operation||a.uploadObj.remove(h),l.uploadUrl={url:t,selection:o,altText:s,selectParent:r,width:{width:l.parent.insertImageSettings.width,minWidth:l.parent.insertImageSettings.minWidth,maxWidth:l.parent.getInsertImgMaxWidth()},height:{height:l.parent.insertImageSettings.height,minHeight:l.parent.insertImageSettings.minHeight,maxHeight:l.parent.insertImageSettings.maxHeight}},e&&e.operation&&"REMOVE"!==e.operation.toLocaleUpperCase()&&l.inputUrl.setAttribute("disabled","true"),h=e.file),"upload"!==e.operation||je(a.dialogObj)||a.dialogObj.getButtons(0).element.removeAttribute("disabled")})},failure:function(e){a.parent.trigger(O5e,e)},removing:function(e){a.parent.trigger(N5e,e,function(e){l.isImgUploaded=!1,a.dialogObj.getButtons(0).element.disabled=!0,l.inputUrl.removeAttribute("disabled"),l.uploadUrl&&(l.uploadUrl.url="")})}}),this.uploadObj.isStringTemplate=!0,this.uploadObj.createElement=this.parent.createElement,this.uploadObj.appendTo(i),t},K9e.prototype.checkExtension=function(e){this.uploadObj.allowedExtensions&&e.type&&(-1===this.uploadObj.allowedExtensions.toLocaleLowerCase().indexOf(("."+e.type).toLocaleLowerCase())?(this.dialogObj.getButtons(0).element.setAttribute("disabled","disabled"),this.isAllowedTypes=!1):this.isAllowedTypes=!0)},K9e.prototype.fileSelect=function(){return this.dialogObj.element.getElementsByClassName("e-file-select-wrap")[0].querySelector("button").click(),!1},K9e.prototype.dragStart=function(e){if("IMG"!==e.target.nodeName)return!0;e.dataTransfer.effectAllowed="copyMove",e.target.classList.add(SQe)},K9e.prototype.dragEnter=function(e){e.dataTransfer.dropEffect="copy",e.preventDefault()},K9e.prototype.dragOver=function(e){if(!("edge"===F.info.name&&-1<e.dataTransfer.items[0].type.split("/")[0].indexOf("image")||F.isIE&&"Files"===e.dataTransfer.types[0]))return!0;e.preventDefault()},K9e.prototype.dragDrop=function(e){var n=this;this.parent.trigger(Z5e,e,function(e){var t,i=n.parent.inputElement.ownerDocument.querySelector("."+SQe),i=i&&"IMG"===i.tagName||0<e.dataTransfer.files.length;!e.cancel&&i?z(e.target,"#"+n.parent.getID()+"_toolbar")||"false"===n.parent.inputElement.contentEditable?e.preventDefault():(n.parent.element.querySelector("."+IQe)&&G(n.imgResizeDiv),e.preventDefault(),t=void 0,n.contentModule.getDocument().caretRangeFromPoint?t=n.contentModule.getDocument().caretRangeFromPoint(e.clientX,e.clientY):e.rangeParent?(t=n.contentModule.getDocument().createRange()).setStart(e.rangeParent,e.rangeOffset):t=n.getDropRange(e.clientX,e.clientY),n.parent.notify(c5e,{range:t}),n.parent.element.querySelector("."+TQe)||n.insertDragImage(e)):i&&e.preventDefault()})},K9e.prototype.getDropRange=function(e,t){var i=this.contentModule.getDocument().createRange(),t=(this.parent.formatter.editorManager.nodeSelection.setRange(this.contentModule.getDocument(),i),this.contentModule.getDocument().elementFromPoint(e,t)),n=0<t.childNodes.length?t.childNodes[0]:t,o=0;if("<br>"===this.parent.inputElement.firstChild.innerHTML)i.setStart(n,o),i.setEnd(n,o);else for(;i.setStart(n,++o),i.setEnd(n,o+1),i.getBoundingClientRect().left<e&&o<n.length-1;);return i},K9e.prototype.insertDragImage=function(o){var r=this,e=(o.preventDefault(),this.parent.element.querySelector(xQe)),s=(this.parent.notify(U5e,{args:o}),e&&e.classList.add(l8e),this.parent.inputElement.ownerDocument.querySelector("."+SQe)),t={requestType:"Images",name:"ImageDragAndDrop",cancel:!1,originalEvent:o};if(0<o.dataTransfer.files.length&&null===s){if(!(1<o.dataTransfer.files.length))for(var i=o.dataTransfer.files,e=i[0].name,n=e.substring(e.lastIndexOf(".")),a=this.parent.insertImageSettings.allowedTypes,l=0;l<a.length;l++)n.toLocaleLowerCase()===a[l].toLowerCase()&&(this.parent.insertImageSettings.saveUrl?this.onSelect(o):this.parent.trigger(O4e,t,function(e){e.cancel?e.originalEvent.preventDefault():(e={args:o,text:"",file:i[0]},o.preventDefault(),r.imagePaste(e))}))}else this.parent.trigger(O4e,t,function(e){var t,i,n;e.cancel?e.originalEvent.preventDefault():(e=r.parent.formatter.editorManager.nodeSelection.getRange(r.parent.contentModule.getDocument()),s&&"IMG"===s.tagName&&(je(t=s.closest(".e-rte-img-caption"))?(i=s.closest("a"))&&"A"===i.tagName&&r.hasOnlyImage(i)?e.insertNode(i):e.insertNode(s):e.insertNode(t),s.classList.remove(SQe),n={elements:[s]},s.addEventListener("load",function(){r.parent.trigger(N4e,n)}),r.parent.formatter.editorManager.nodeSelection.Clear(r.contentModule.getDocument()),r.parent.insertImageSettings.resize&&r.resizeStart(o,s),r.hideImageQuickToolbar()))})},K9e.prototype.hasOnlyImage=function(e){for(var t=!1,i=0;i<e.childNodes.length;i++){var n=e.childNodes[i];if(n.nodeType===Node.TEXT_NODE){if(""!==n.textContent.replace(/[\u200B\u200C\u200D]/g,"").trim())return!1}else if(n.nodeType===Node.ELEMENT_NODE){if("IMG"!==n.tagName)return!1;if(t)return!1;t=!0}}return t},K9e.prototype.onSelect=function(i){var n=this,t=this,o=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),r=this.parent.createElement("ul",{className:DQe}),e=(this.parent.rootContainer.appendChild(r),{name:i.dataTransfer.files[0].name,size:i.dataTransfer.files[0].size,status:"",statusCode:"",type:i.dataTransfer.files[0].type,rawFile:i.dataTransfer.files[0],validationMessages:{}}),s=this.parent.createElement("IMG"),e=(s.style.opacity="0.5",s.classList.add(yQe),s.classList.add(I8e),s.classList.add(vQe),e.rawFile),a=new FileReader,l=(a.addEventListener("load",function(){var e=URL.createObjectURL(U6e(a.result));s.src="Blob"===t.parent.insertImageSettings.saveFormat?e:a.result}),e&&a.readAsDataURL(e),this.parent.formatter.editorManager.nodeSelection.save(o,this.parent.contentModule.getDocument())),l={cssClass:"inline"===this.parent.insertImageSettings.display?I8e:m8e,url:this.parent.insertImageSettings.path+e.name,selection:l,altText:e.name.replace(/\.[a-zA-Z0-9]+$/,""),width:{width:this.parent.insertImageSettings.width,minWidth:this.parent.insertImageSettings.minWidth,maxWidth:this.parent.getInsertImgMaxWidth()},height:{height:this.parent.insertImageSettings.height,minHeight:this.parent.insertImageSettings.minHeight,maxHeight:this.parent.insertImageSettings.maxHeight}};this.parent.trigger(O4e,{requestType:"Image",name:"ImageDragAndDrop",cancel:!1,originalEvent:i,itemCollection:l},function(e){var t;e.cancel?e.originalEvent.preventDefault():(e=e.itemCollection,(t=Q("img",{className:e.cssClass,attrs:{src:e.url,alt:e.altText}})).style.opacity="0.5",t.classList.add(yQe),t.classList.add(I8e),t.classList.add(vQe),o.insertNode(t),n.uploadMethod(i,t),t.addEventListener("load",function(e){n.parent.trigger(N4e,{requestType:"Image",name:"InsertDropImage",elements:[t],event:e,editorMode:"HTML"})}),G(r))})},K9e.prototype.uploadMethod=function(i,n){var o=this,r=!1,e=this,t=this.parent.createElement("div"),s=(this.parent.rootContainer.appendChild(t),this.parent.createElement("input",{id:this.rteID+"_upload",attrs:{type:"File",name:"UploadFiles"}})),a=this.parent.iframeSettings.enable?-50:-90,t=(this.popupObj=new Sv(t,{relateTo:n,height:"85px",width:"300px",offsetY:a,content:s,viewPortElement:this.parent.element,position:{X:"center",Y:"top"},enableRtl:this.parent.enableRtl,zIndex:10001,close:function(e){o.parent.isBlur=!1,o.popupObj.destroy(),G(o.popupObj.element),o.popupObj=null,o.parent.inlineMode.enable||o.parent.toolbarModule.baseToolbar.toolbarObj.disable(!1)}}),this.popupObj.element.style.display="none",U([this.popupObj.element],xQe),U([this.popupObj.element],AQe),je(this.parent.cssClass)||U([this.popupObj.element],this.parent.cssClass.replace(/\s+/g," ").trim().split(" ")),this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument())),a=1e6<i.dataTransfer.files[0].size?300:100;this.imageDragPopupTime=setTimeout(function(){e.refreshPopup(n)},a),this.uploadObj=new GN({asyncSettings:{saveUrl:this.parent.insertImageSettings.saveUrl,removeUrl:this.parent.insertImageSettings.removeUrl},cssClass:MQe+this.parent.getCssClass(!0),dropArea:this.parent.element,allowedExtensions:this.parent.insertImageSettings.allowedTypes.toString(),removing:function(){o.parent.inputElement.contentEditable="true",r=!1,G(n),o.popupObj.close()},canceling:function(){o.parent.inputElement.contentEditable="true",r=!1,G(n),o.popupObj.close(),o.quickToolObj.imageQTBar.hidePopup(),o.uploadCancelTime=setTimeout(function(){o.uploadObj.destroy()},900)},beforeUpload:function(e){o.parent.trigger(Y5e,e),o.parent.inlineMode.enable||o.parent.toolbarModule.baseToolbar.toolbarObj.disable(!0)},uploading:function(e){o.parent.isServerRendered||(r=!0,o.parent.trigger(L5e,e,function(e){e.cancel?(je(n)||G(n),je(o.popupObj.element)||G(o.popupObj.element)):o.parent.inputElement.contentEditable="false"}))},selected:function(e){r&&(e.cancel=!0)},failure:function(e){r=!1,o.parent.inputElement.contentEditable="true";var t={args:i,type:"Images",isNotify:void 0,elements:n};o.uploadFailureTime=setTimeout(function(){o.uploadFailure(n,t,e)},900)},success:function(e){var t;"cancel"!==e.operation&&(r=!1,o.parent.inputElement.contentEditable="true",t={args:i,type:"Images",isNotify:void 0,elements:n},o.uploadSuccessTime=setTimeout(function(){o.uploadSuccess(n,i,t,e)},900))}}),this.uploadObj.appendTo(this.popupObj.element.childNodes[0]),this.popupObj.element.querySelector(".e-rte-dialog-upload .e-file-select-wrap").style.display="none",t.selectNodeContents(n),this.parent.formatter.editorManager.nodeSelection.setRange(this.contentModule.getDocument(),t)},K9e.prototype.refreshPopup=function(e){var t=this.parent.iframeSettings.enable?this.parent.element.offsetTop+e.offsetTop:e.offsetTop;this.parent.element.offsetTop+this.parent.element.offsetHeight<t?(this.popupObj.relateTo=this.parent.inputElement,this.popupObj.offsetY=this.parent.iframeSettings.enable?-30:-65,this.popupObj.element.style.display="block"):this.popupObj&&(this.popupObj.refreshPosition(e),this.popupObj.element.style.display="block")},K9e.prototype.uploadFailure=function(e,t,i){G(e),this.popupObj&&this.popupObj.close(),this.parent.trigger(O5e,i),this.uploadObj.destroy()},K9e.prototype.uploadSuccess=function(i,e,t,n){var o=this;i.style.opacity="1",i.classList.add(bQe),n.element=i,n.detectImageSource=X3e.Dropped,this.parent.trigger(R5e,n,function(e){var t;je(o.parent.insertImageSettings.path)||(t=o.parent.insertImageSettings.path+e.file.name,i.src=t,i.setAttribute("alt",e.file.name))}),this.popupObj&&(this.popupObj.close(),this.uploadObj.destroy()),this.showImageQuickToolbar(t),this.resizeStart(e,i)},K9e.prototype.imagePaste=function(i){var n,o,r=this;0!==i.text.length||je(i.file)||(n=this,o=new FileReader,i.args.preventDefault(),o.addEventListener("load",function(e){var t={cssClass:"inline"===n.parent.insertImageSettings.display?I8e:m8e,url:"Base64"!==r.parent.insertImageSettings.saveFormat&&je(i.callBack)?URL.createObjectURL(U6e(o.result)):o.result,width:{width:n.parent.insertImageSettings.width,minWidth:n.parent.insertImageSettings.minWidth,maxWidth:n.parent.getInsertImgMaxWidth()},height:{height:n.parent.insertImageSettings.height,minHeight:n.parent.insertImageSettings.minHeight,maxHeight:n.parent.insertImageSettings.maxHeight}};je(i.callBack)?(n.parent.formatter.process(n.parent,{item:{command:"Images",subCommand:"Image"}},i.args,t),r.showPopupToolBar(i,t)):i.callBack(t)}),o.readAsDataURL(i.file))},K9e.prototype.showPopupToolBar=function(e,t){var i=this,t='img[src="'+t.url+'"]',n=this.parent.inputElement.querySelector(t),o=(this.parent.quickToolbarModule.createQTBar("Image","MultiRow",this.parent.quickToolbarSettings.image,q3e.ImageToolbar),{args:e.args,type:"Images",isNotify:void 0,elements:n});n&&(this.showImageQTbarTime=setTimeout(function(){i.showImageQuickToolbar(o),i.parent.insertImageSettings.resize&&i.resizeStart(e.args,n)},0))},K9e.prototype.destroy=function(){this.isDestroyed||(this.prevSelectedImgEle=void 0,je(this.imageQTPopupTime)||(clearTimeout(this.imageQTPopupTime),this.imageQTPopupTime=null),je(this.imageDragPopupTime)||(clearTimeout(this.imageDragPopupTime),this.imageDragPopupTime=null),je(this.uploadCancelTime)||(clearTimeout(this.uploadCancelTime),this.uploadCancelTime=null),je(this.uploadFailureTime)||(clearTimeout(this.uploadFailureTime),this.uploadFailureTime=null),je(this.showImageQTbarTime)||(clearTimeout(this.showImageQTbarTime),this.showImageQTbarTime=null),je(this.uploadSuccessTime)||(clearTimeout(this.uploadSuccessTime),this.uploadSuccessTime=null),this.removeEventListener(),this.clearDialogObj(),this.cancelResizeAction(),this.isDestroyed=!0)},K9e.prototype.getModuleName=function(){return"image"};var X9e=K9e;function K9e(e,t){this.isImgUploaded=!1,this.isAllowedTypes=!0,this.pageX=null,this.pageY=null,this.deletedImg=[],this.parent=e,this.rteID=e.element.id,this.i10n=t.getService("rteLocale"),this.rendererFactory=t.getService("rendererFactory"),this.dialogRenderObj=t.getService("dialogRenderObject"),this.addEventListener(),this.drop=this.dragDrop.bind(this),this.drag=this.dragOver.bind(this),this.enter=this.dragEnter.bind(this),this.start=this.dragStart.bind(this),this.docClick=this.onDocumentClick.bind(this),this.isDestroyed=!1}Z9e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(u4e,this.onKeyDown,this),this.parent.on(c4e,this.onKeyUp,this),this.parent.on(z4e,this.insertingAudio,this),this.parent.on($3e,this.afterRender,this),this.parent.on($5e,this.afterRender,this),this.parent.on(sWe,this.showDialog,this),this.parent.on(hWe,this.closeDialog,this),this.parent.on(I4e,this.onToolbarAction,this),this.parent.on(C4e,this.alignmentSelect,this),this.parent.on(G4e,this.deleteAudio,this),this.parent.on(s5e,this.editAreaClickHandler,this),this.parent.on(W4e,this.showAudioQuickToolbar,this),this.parent.on(t4e,this.destroy,this),this.parent.on(e4e,this.closeDialog,this))},Z9e.prototype.removeEventListener=function(){this.parent.off(u4e,this.onKeyDown),this.parent.off(c4e,this.onKeyUp),this.parent.off(z4e,this.insertingAudio),this.parent.off($3e,this.afterRender),this.parent.off($5e,this.afterRender),this.parent.off(sWe,this.showDialog),this.parent.off(hWe,this.closeDialog),this.parent.off(I4e,this.onToolbarAction),this.parent.off(C4e,this.alignmentSelect),this.parent.off(G4e,this.deleteAudio),this.parent.off(s5e,this.editAreaClickHandler),this.parent.off(W4e,this.showAudioQuickToolbar),this.parent.off(t4e,this.destroy),this.parent.off(e4e,this.closeDialog),je(this.contentModule)||(E.remove(this.parent.contentModule.getEditPanel(),F.touchStartEvent,this.touchStart),E.remove(this.contentModule.getEditPanel(),F.touchEndEvent,this.audioClick),this.parent.element.ownerDocument.removeEventListener("mousedown",this.docClick),this.docClick=null)},Z9e.prototype.afterRender=function(){this.contentModule=this.rendererFactory.getRenderer(q3e.Content),E.add(this.parent.contentModule.getEditPanel(),F.touchStartEvent,this.touchStart,this),E.add(this.contentModule.getEditPanel(),F.touchEndEvent,this.audioClick,this),this.parent.element.ownerDocument.addEventListener("mousedown",this.docClick)},Z9e.prototype.checkAudioBack=function(e){"#text"===e.startContainer.nodeName&&0===e.startOffset&&!je(e.startContainer.previousSibling)&&this.isAudioElem(e.startContainer.previousSibling)?this.deletedAudio.push(e.startContainer.previousSibling):"#text"!==e.startContainer.nodeName&&!je(e.startContainer.childNodes[e.startOffset-1])&&this.isAudioElem(e.startContainer.childNodes[e.startOffset-1])&&this.deletedAudio.push(e.startContainer.childNodes[e.startOffset-1])},Z9e.prototype.checkAudioDel=function(e){"#text"!==e.startContainer.nodeName||e.startOffset!==e.startContainer.textContent.length||je(e.startContainer.nextSibling)||"AUDIO"!==e.startContainer.nextSibling.nodeName?"#text"!==e.startContainer.nodeName&&!je(e.startContainer.childNodes[e.startOffset])&&this.isAudioElem(e.startContainer.childNodes[e.startOffset])&&this.deletedAudio.push(e.startContainer.childNodes[e.startOffset]):this.deletedAudio.push(e.startContainer.nextSibling)},Z9e.prototype.undoStack=function(e){if(("undo"===e.subCommand.toLowerCase()||"redo"===e.subCommand.toLowerCase())&&"HTML"===this.parent.editorMode)for(var t=0;t<this.parent.formatter.getUndoRedoStack().length;t++){var i=this.parent.createElement("div"),n=this.parent.formatter.getUndoRedoStack()[t].text;i.appendChild(n.cloneNode(!0))}},Z9e.prototype.touchStart=function(e,t){this.parent.readonly||(this.prevSelectedAudEle=this.audEle)},Z9e.prototype.onToolbarAction=function(e){switch(WUe()&&this.parent.notify(i5e,{}),e.args.item.subCommand){case"AudioReplace":this.parent.notify(z4e,e);break;case"AudioRemove":this.parent.notify(G4e,e)}},Z9e.prototype.onKeyUp=function(e){if(!je(this.deletedAudio)&&0<this.deletedAudio.length)for(var t=0;t<this.deletedAudio.length;t++){var i=this.deletedAudio[t],i="SOURCE"===i.tagName?i:i.querySelector("source"),i={element:this.deletedAudio[t].querySelector("audio"),src:i.getAttribute("src")};this.parent.trigger(Q5e,i)}},Z9e.prototype.onKeyDown=function(e){var t,i,n,o,r,s=e.args;this.deletedAudio=[];if(!(i="HTML"===this.parent.editorMode?(n=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument())).startContainer===n.endContainer&&n.startOffset===n.endOffset:i)&&"HTML"===this.parent.editorMode&&[27,112,113,114,115,116,117,118,119,120,121,122,123,44,45,9,16,17,18,19,20,33,34,35,36,37,38,39,40,91,92,93,144,145,182,183].indexOf(s.which)<0)for(var a=this.parent.formatter.editorManager.nodeSelection.getNodeCollection(n),l=0;l<a.length;l++)this.isAudioElem(a[l])&&this.deletedAudio.push(a[l]);switch("HTML"===this.parent.editorMode&&(8===s.which&&"Backspace"===s.code||46===s.which&&"Delete"===s.code)&&(e=n.startContainer===n.endContainer&&n.startOffset===n.endOffset,8===s.which&&"Backspace"===s.code&&e?this.checkAudioBack(n):46===s.which&&"Delete"===s.code&&e&&this.checkAudioDel(n)),je(this.parent.formatter.editorManager.nodeSelection)||"KeyK"===s.code||(n=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),o=this.parent.formatter.editorManager.nodeSelection.getNodeCollection(n),r=this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(n),!s.ctrlKey&&s.key&&(1===s.key.length||"enter"===s.action)&&this.isAudioElem(r[0])&&r[0].parentElement&&(i=r[0].parentElement.childNodes[0],this.parent.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(),i,i,i.textContent.length,i.textContent.length),q([r[0]],wQe),this.quickToolObj.audioQTBar.hidePopup())),!s.ctrlKey||89!==s.keyCode&&90!==s.keyCode||this.undoStack({subCommand:90===s.keyCode?"undo":"redo"}),8!==s.keyCode&&46!==s.keyCode||o&&(this.isAudioElem(o[0])||46===s.keyCode&&o[0].nextSibling&&this.isAudioElem(o[0].nextSibling)||8===s.keyCode&&o[0].previousSibling&&this.isAudioElem(o[0].previousSibling))&&o.length<=2&&(je(this.parent.formatter.editorManager.nodeSelection)||(t=this.parent.formatter.editorManager.nodeSelection.save(n,this.parent.contentModule.getDocument())),s.preventDefault(),this.deleteAudio({selectNode:o,selection:t,selectParent:r,args:{item:{command:"Audios",subCommand:"AudioRemove"},originalEvent:s}},s.keyCode)),s.action){case"escape":je(this.dialogObj)||this.dialogObj.close();break;case"backspace":case"delete":for(l=0;l<this.deletedAudio.length;l++){var h=this.deletedAudio[l].src;this.audioRemovePost(h)}"Markdown"!==this.parent.editorMode&&(3===n.startContainer.nodeType?"Backspace"===s.code?n.startContainer.previousElementSibling&&0===n.startOffset&&n.startContainer.previousElementSibling.classList.contains(b8e)&&G(n.startContainer.previousElementSibling):n.startContainer.nextElementSibling&&n.endContainer.textContent.length===n.endOffset&&n.startContainer.nextElementSibling.classList.contains(b8e)&&G(n.startContainer.nextElementSibling):1===n.startContainer.nodeType&&n.startContainer.classList&&(n.startContainer.classList.contains(b8e)||n.startContainer.classList.contains(y8e)||n.startContainer.classList.contains(v8e))&&G(n.startContainer));break;case"insert-audio":je(this.parent.formatter.editorManager.nodeSelection)||(t=this.parent.formatter.editorManager.nodeSelection.save(n,this.parent.contentModule.getDocument())),this.openDialog(!0,s,t,o,r),s.preventDefault()}s.ctrlKey&&"a"===s.key&&this.handleSelectAll()},Z9e.prototype.handleSelectAll=function(){q(this.parent.inputElement.querySelectorAll("."+wQe),wQe)},Z9e.prototype.openDialog=function(e,t,i,n,o){var r,s,n=e||je(this.parent.formatter.editorManager.nodeSelection)?(r=i,s=n,o):(i=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),r=this.parent.formatter.editorManager.nodeSelection.save(i,this.parent.contentModule.getDocument()),s=this.parent.formatter.editorManager.nodeSelection.getNodeCollection(i),this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(i));"HTML"===this.parent.editorMode&&this.insertAudio({args:{item:{command:"Audios",subCommand:"Audio"},originalEvent:t,name:e?null:"showDialog"},selectNode:s,selection:r,selectParent:n})},Z9e.prototype.showDialog=function(e){je(e.originalEvent)?this.openDialog(!1):this.openDialog(!1,e.originalEvent)},Z9e.prototype.closeDialog=function(){this.dialogObj&&this.dialogObj.hide({returnValue:!0})},Z9e.prototype.deleteAudio=function(e,t){var i;this.isAudioElem(e.selectNode[0])&&(this.audEle&&(3===e.selectNode[0].nodeType?e.selectNode[0]=this.audEle:this.isAudioElem(e.selectNode[0])&&(e.selectNode[0]=e.selectNode[0].classList.contains(b8e)?e.selectNode[0]:e.selectNode[0].parentElement)),i={element:e.selectNode[0].querySelector("audio"),src:e.selectNode[0].querySelector("source").getAttribute("src")},0===this.parent.formatter.getUndoRedoStack().length&&this.parent.formatter.saveData(),e.selection.restore(),this.parent.formatter.process(this.parent,e.args,e.args.originalEvent,{selectNode:e.selectNode,subCommand:e.args.item.subCommand}),this.audioRemovePost(i.src),this.quickToolObj&&document.body.contains(this.quickToolObj.audioQTBar.element)&&this.quickToolObj.audioQTBar.hidePopup(),je(t))&&this.parent.trigger(Q5e,i)},Z9e.prototype.audioRemovePost=function(e){var t=this,i="";je(this.parent.insertAudioSettings.removeUrl)||""===this.parent.insertAudioSettings.removeUrl||(i=-1<e.indexOf("http://")||-1<e.indexOf("https://")?e:new URL(e,document.baseURI).href,this.removingAudioName=i.replace(/^.*[\\/]/,""),(e=new XMLHttpRequest).addEventListener("readystatechange",function(){4===this.readyState&&200===this.status&&t.triggerPost(this.response)}),e.open("GET",i),e.responseType="blob",e.send())},Z9e.prototype.triggerPost=function(e){var t,i=this.parent.insertAudioSettings.removeUrl;je(i)||""===i||(e=new File([e],this.removingAudioName),i=new ze(i,"POST",!0,null),(t=new FormData).append("UploadFiles",e),i.send(t))},Z9e.prototype.audioClick=function(e){F.isDevice&&(this.isAudioElem(e.target)?(this.contentModule.getEditPanel().setAttribute("contenteditable","false"),e.target.focus()):this.parent.readonly||this.contentModule.getEditPanel().setAttribute("contenteditable","true")),this.isAudioElem(e.target)&&!this.parent.userAgentData.isSafari()&&(this.audEle=e.target.querySelector("audio"),e.preventDefault())},Z9e.prototype.onDocumentClick=function(e){var t=e.target;je(this.contentModule.getEditPanel())||(this.isAudioElem(t)&&(this.audEle=t.querySelector("audio")),je(this.dialogObj)||!(!z(t,"[id='"+this.dialogObj.element.id+"']")&&this.parent.toolbarSettings.enable&&this.parent.getToolbarElement()&&!this.parent.getToolbarElement().contains(e.target)||this.parent.getToolbarElement()&&this.parent.getToolbarElement().contains(e.target)&&!z(t,"#"+this.parent.getID()+"_toolbar_Audio")&&!t.querySelector("#"+this.parent.getID()+"_toolbar_Audio"))||e.offsetX>e.target.clientWidth||e.offsetY>e.target.clientHeight||(this.parent.notify(SWe,{closedBy:"outside click"}),this.dialogObj.hide({returnValue:!0}),this.parent.isBlur=!0,L6e(this.parent.element,"focusout")),this.contentModule.getEditPanel().querySelector("."+wQe)&&(this.isAudioElem(e.target)||je(this.audEle)?je(this.prevSelectedAudEle)||this.prevSelectedAudEle===t||(this.prevSelectedAudEle.style.outline=""):this.audEle.style.outline=""),this.parent.inlineMode.enable&&t&&this.dialogObj&&!z(t,"#"+this.dialogObj.element.id)&&this.dialogObj.hide())},Z9e.prototype.alignmentSelect=function(e){var t=e.item;if(document.body.contains(document.body.querySelector(".e-rte-quick-toolbar"))&&"Audios"===t.command){var i=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),i=this.parent.formatter.editorManager.nodeSelection.getNodeCollection(i),n={args:e,selectNode:i=this.audEle?[this.audEle]:i};switch(0===this.parent.formatter.getUndoRedoStack().length&&this.parent.formatter.saveData(),t.subCommand){case"Inline":this.inline(n);break;case"Break":this.break(n)}this.quickToolObj&&document.body.contains(this.quickToolObj.audioQTBar.element)&&(this.quickToolObj.audioQTBar.hidePopup(),q([i[0]],wQe))}},Z9e.prototype.break=function(e){var t;"AUDIO"===e.selectNode[0].nodeName&&(t=e.args.item&&e.args.item.subCommand?e.args.item.subCommand:"Break",this.parent.formatter.process(this.parent,e.args,e.args.originalEvent,{selectNode:e.selectNode,subCommand:t}))},Z9e.prototype.inline=function(e){var t;"AUDIO"===e.selectNode[0].nodeName&&(t=e.args.item&&e.args.item.subCommand?e.args.item.subCommand:"Inline",this.parent.formatter.process(this.parent,e.args,e.args.originalEvent,{selectNode:e.selectNode,subCommand:t}))},Z9e.prototype.editAreaClickHandler=function(e){var t,i,n;this.parent.readonly?this.hideAudioQuickToolbar():(t=e.args,i=this.parent.quickToolbarSettings.showOnRightClick,2===t.which||i&&1===t.which||!i&&3===t.which?i&&1===t.which&&!je(t.target)&&this.isAudioElem(t.target)&&(this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument()),this.parent.formatter.editorManager.nodeSelection.setSelectionContents(this.contentModule.getDocument(),t.target)):"HTML"===this.parent.editorMode&&this.parent.quickToolbarModule&&this.parent.quickToolbarModule.audioQTBar&&(this.quickToolObj=this.parent.quickToolbarModule,i=t.target,this.contentModule=this.rendererFactory.getRenderer(q3e.Content),n=this.quickToolObj.audioQTBar.element.classList.contains("e-rte-pop"),this.isAudioElem(i)&&this.parent.quickToolbarModule?n||(this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument()),this.parent.formatter.editorManager.nodeSelection.setSelectionContents(this.contentModule.getDocument(),i),WUe()&&this.parent.notify(t5e,e),i.querySelector("audio")&&(i.querySelector("audio").style.outline="2px solid #4a90e2"),this.showAudioQuickToolbar({args:t,type:"Audios",elements:[t.target]})):this.hideAudioQuickToolbar()))},Z9e.prototype.isAudioElem=function(e){return!!(e&&3!==e.nodeType&&"BR"!==e.nodeName&&e.classList&&(e.classList.contains(b8e)||e.classList.contains("e-rte-audio")||e.classList.contains(y8e)))},Z9e.prototype.showAudioQuickToolbar=function(e){var t,i,n,o=this;"Audios"!==e.type||je(this.parent.quickToolbarModule)||je(this.parent.quickToolbarModule.audioQTBar)||je(e.args)||(this.quickToolObj=this.parent.quickToolbarModule,t=e.args,i=e.elements,[].forEach.call(e.elements,function(e,t){0===t&&(i=e)}),this.isAudioElem(i)&&(U([n="AUDIO"===i.tagName?i:i.querySelector("audio")],[wQe]),n.style.outline="2px solid #4a90e2"),this.parent.quickToolbarModule.audioQTBar&&(e.isNotify?this.showPopupTime=setTimeout(function(){o.parent.formatter.editorManager.nodeSelection.Clear(o.contentModule.getDocument()),o.parent.formatter.editorManager.nodeSelection.setSelectionContents(o.contentModule.getDocument(),i),o.quickToolObj.audioQTBar.showPopup(t.pageX-50,i.getBoundingClientRect().top+34,i)},400):this.quickToolObj.audioQTBar.showPopup(t.pageX-50,i.getBoundingClientRect().top+34,i)))},Z9e.prototype.hideAudioQuickToolbar=function(){je(this.contentModule.getEditPanel().querySelector("."+wQe))||(q([this.contentModule.getEditPanel().querySelector("."+wQe)],wQe),je(this.audEle)||(this.audEle.style.outline=""),this.quickToolObj&&this.quickToolObj.audioQTBar&&document.body.contains(this.quickToolObj.audioQTBar.element)&&this.quickToolObj.audioQTBar.hidePopup())},Z9e.prototype.insertingAudio=function(e){this.insertAudio(e),je(this.dialogObj)||(this.dialogObj.element.style.maxHeight="inherit",e=this.dialogObj.element.querySelector(".e-audio-content"),(je(this.parent.insertAudioSettings.path)&&"HTML"!==this.parent.editorMode?e.querySelector(".e-audio-url"):document.getElementById(this.rteID+"_insertAudio")).focus())},Z9e.prototype.clearDialogObj=function(){this.uploadObj&&!this.uploadObj.isDestroyed&&(this.uploadObj.destroy(),G(this.uploadObj.element),this.uploadObj=null),this.button&&!this.button.isDestroyed&&(this.button.destroy(),G(this.button.element),this.button=null),this.dialogObj&&!this.dialogObj.isDestroyed&&(this.dialogObj.destroy(),G(this.dialogObj.element),this.dialogObj=null)},Z9e.prototype.insertAudio=function(e){var t,i,n,o,r,s,a=this;this.dialogObj?this.dialogObj.hide({returnValue:!0}):(t=this.parent.createElement("div",{className:"e-rte-audio-dialog",id:this.rteID+"_audio"}),this.parent.rootContainer.appendChild(t),r=this.i10n.getConstant("dialogInsert"),s=this.i10n.getConstant("dialogCancel"),n=this.i10n.getConstant("audioHeader"),i=e.selection,o={selfAudio:this,selection:e.selection,args:e.args,selectParent:e.selectParent},n={header:n,cssClass:L8e,enableRtl:this.parent.enableRtl,locale:this.parent.locale,showCloseIcon:!0,closeOnEscape:!0,width:F.isDevice?"290px":"340px",isModal:F.isDevice,buttons:[{click:this.insertAudioUrl.bind(o),buttonModel:{content:r,cssClass:"e-flat e-insertAudio",isPrimary:!0,disabled:!0}},{click:function(e){a.cancelDialog(e)},buttonModel:{cssClass:"e-flat e-cancel",content:s}}],target:F.isDevice?document.body:this.parent.element,animationSettings:{effect:"None"},close:function(e){a.isAudioUploaded&&(a.dialogObj.element.querySelector(".e-file-abort-btn")?a.dialogObj.element.querySelector(".e-file-abort-btn").click():a.uploadObj.remove()),a.parent.isBlur=!1,e&&!je(e.event)&&e.event.returnValue&&"HTML"===a.parent.editorMode&&i.restore(),a.clearDialogObj(),a.dialogRenderObj.close(e)}},o=this.parent.createElement("div",{className:"e-audio-content"}),je(this.parent.insertAudioSettings.path)&&"HTML"!==this.parent.editorMode||o.appendChild(this.audioUpload(e)),r=this.parent.createElement("div",{className:"e-audioheader"}),s=this.i10n.getConstant("audioLinkHeader"),"HTML"===this.parent.editorMode&&(r.innerHTML=s),o.appendChild(r),o.appendChild(this.audioUrlPopup(e)),e.selectNode&&1===e.selectNode[0].nodeType&&this.isAudioElem(e.selectNode[0])&&(n.header=this.parent.localeObj.getConstant("editAudioHeader")),n.content=o,this.dialogObj=this.dialogRenderObj.render(n),this.dialogObj.createElement=this.parent.createElement,this.dialogObj.appendTo(t),e.selectNode&&1===e.selectNode[0].nodeType&&this.isAudioElem(e.selectNode[0])&&"insertAudio"===e.name&&(this.dialogObj.element.querySelector(".e-insertAudio").textContent=this.parent.localeObj.getConstant("dialogUpdate")),t.style.maxHeight="inherit",this.quickToolObj&&(this.quickToolObj.audioQTBar&&document.body.contains(this.quickToolObj.audioQTBar.element)&&this.quickToolObj.audioQTBar.hidePopup(),this.quickToolObj.inlineQTBar&&document.body.contains(this.quickToolObj.inlineQTBar.element)&&this.quickToolObj.inlineQTBar.hidePopup(),this.quickToolObj.textQTBar)&&this.parent.element.ownerDocument.body.contains(this.quickToolObj.textQTBar.element)&&this.quickToolObj.textQTBar.hidePopup())},Z9e.prototype.audioUrlPopup=function(e){var t=this,i=this.parent.createElement("div",{className:"audioUrl"}),n=this.i10n.getConstant("audioUrl");return this.inputUrl=this.parent.createElement("input",{className:"e-input e-audio-url",attrs:{placeholder:n,spellcheck:"false","aria-label":this.i10n.getConstant("audioLinkHeader")}}),this.inputUrl.addEventListener("input",function(){je(t.inputUrl)||(0===t.inputUrl.value.length?t.dialogObj.getButtons(0).element.disabled=!0:t.dialogObj.getButtons(0).element.removeAttribute("disabled"))}),e.selectNode&&this.isAudioElem(e.selectNode[0])&&(n=new RegExp(/([^\S]|^)(((https?:\/\/)|(www\.))(\S+))/gi),e=e.selectNode[0].querySelector("source"),this.inputUrl.value=e.src.match(n)?e.src:""),i.appendChild(this.inputUrl),i},Z9e.prototype.audioUpload=function(e){var n,o,r,s=this,a=this,t=a.parent.iframeSettings.enable,t=(o="HTML"===a.parent.editorMode&&(!t&&je(z(e.selection.range.startContainer.parentNode,"[id='"+this.parent.contentModule.getPanel().id+"']"))||t&&!A6e(e.selection.range.startContainer.parentNode.ownerDocument.querySelector("body"),"e-lib"))?(this.contentModule.getEditPanel().focus(),t=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),n=this.parent.formatter.editorManager.nodeSelection.save(t,this.parent.contentModule.getDocument()),this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(t)):(n=e.selection,e.selectParent),this.parent.createElement("div",{className:"e-aud-uploadwrap e-droparea"})),i=this.i10n.getConstant("audioDeviceUploadMessage"),l=this.i10n.getConstant("audioUploadMessage"),h=this.parent.createElement("span",{className:"e-droptext"}),i=this.parent.createElement("span",{className:"e-rte-upload-text",innerHTML:F.isDevice?i:l}),l=(h.appendChild(i),this.parent.createElement("button",{className:"e-browsebtn",id:this.rteID+"_insertAudio",attrs:{autofocus:"true",type:"button"}})),i=(h.appendChild(l),t.appendChild(h),this.i10n.getConstant("browse")),i=(this.button=new zv({content:i,enableRtl:this.parent.enableRtl}),this.button.isStringTemplate=!0,this.button.createElement=this.parent.createElement,this.button.appendTo(l),F.isDevice?h:l),l=(E.add(i,"click",this.fileSelect,this),this.parent.createElement("input",{id:this.rteID+"_upload",attrs:{type:"File",name:"UploadFiles"}}));return t.appendChild(l),this.uploadObj=new GN({asyncSettings:{saveUrl:this.parent.insertAudioSettings.saveUrl,removeUrl:this.parent.insertAudioSettings.removeUrl},dropArea:h,multiple:!1,enableRtl:this.parent.enableRtl,allowedExtensions:this.parent.insertAudioSettings.allowedTypes.toString(),selected:function(e){a.isAudioUploaded=!0,e.filesData,s.parent.trigger(V5e,e,function(e){var i;e.cancel||je(e.filesData[0])||(s.checkExtension(e.filesData[0]),r=e.filesData[0].name,"HTML"===s.parent.editorMode&&je(s.parent.insertAudioSettings.path)&&((i=new FileReader).addEventListener("load",function(e){var t="Base64"===s.parent.insertAudioSettings.saveFormat?i.result:URL.createObjectURL(U6e(i.result));a.uploadUrl={url:t,selection:n,fileName:r,selectParent:o},a.inputUrl.setAttribute("disabled","true"),je(a.parent.insertAudioSettings.saveUrl)&&s.isAllowedTypes&&!je(s.dialogObj)&&s.dialogObj.getButtons(0).element.removeAttribute("disabled")}),i.readAsDataURL(e.filesData[0].rawFile)))})},beforeUpload:function(e){s.parent.trigger(X5e,e)},uploading:function(e){s.parent.isServerRendered||s.parent.trigger(_5e,e)},success:function(e){s.parent.trigger(H5e,e,function(e){var t;je(s.parent.insertAudioSettings.path)||(t=s.parent.insertAudioSettings.path+e.file.name,a.uploadUrl={url:t,selection:n,fileName:r,selectParent:o},a.inputUrl.setAttribute("disabled","true")),"upload"!==e.operation||je(s.dialogObj)||s.dialogObj.getButtons(0).element.removeAttribute("disabled")})},failure:function(e){s.parent.trigger(z5e,e)},removing:function(){s.parent.trigger(j5e,e,function(e){a.isAudioUploaded=!1,s.dialogObj.getButtons(0).element.disabled=!0,a.inputUrl.removeAttribute("disabled"),a.uploadUrl&&(a.uploadUrl.url="")})}}),this.uploadObj.isStringTemplate=!0,this.uploadObj.createElement=this.parent.createElement,this.uploadObj.appendTo(l),t},Z9e.prototype.checkExtension=function(e){this.uploadObj.allowedExtensions&&(-1===this.uploadObj.allowedExtensions.toLocaleLowerCase().indexOf(("."+e.type).toLocaleLowerCase())?(this.dialogObj.getButtons(0).element.setAttribute("disabled","disabled"),this.isAllowedTypes=!1):this.isAllowedTypes=!0)},Z9e.prototype.fileSelect=function(){return this.dialogObj.element.getElementsByClassName("e-file-select-wrap")[0].querySelector("button").click(),!1},Z9e.prototype.cancelDialog=function(e){this.parent.isBlur=!1,this.dialogObj.hide({returnValue:!0}),this.isAudioUploaded&&this.uploadObj.removing()},Z9e.prototype.insertAudioUrl=function(e){var t,i=this.selfAudio,n=(i.isAudioUploaded=!1,i.inputUrl.value);0===i.parent.formatter.getUndoRedoStack().length&&i.parent.formatter.saveData(),je(i.uploadUrl)||""===i.uploadUrl.url?""!==n&&("HTML"===i.parent.editorMode&&je(z(this.selection.range.startContainer.parentNode,"[id='"+i.contentModule.getPanel().id+"']"))&&!i.parent.iframeSettings.enable&&(i.contentModule.getEditPanel().focus(),t=i.parent.formatter.editorManager.nodeSelection.getRange(i.contentModule.getDocument()),this.selection=i.parent.formatter.editorManager.nodeSelection.save(t,i.contentModule.getDocument()),this.selectParent=i.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(t)),t="HTML"===i.parent.editorMode?n.split("/")[n.split("/").length-1]:"",n={cssClass:"Inline"===i.parent.insertAudioSettings.layoutOption?T8e:f8e,url:n,selection:this.selection,fileName:t,selectParent:this.selectParent},i.dialogObj.hide({returnValue:!1}),null===i.dialogObj)&&i.parent.formatter.process(i.parent,this.args,this.args.originalEvent,n):(i.uploadUrl.cssClass="Inline"===i.parent.insertAudioSettings.layoutOption?T8e:f8e,i.dialogObj.hide({returnValue:!1}),null===i.dialogObj&&(i.parent.formatter.process(i.parent,this.args,this.args.originalEvent,i.uploadUrl),i.uploadUrl.url=""))},Z9e.prototype.destroy=function(){this.isDestroyed||(this.prevSelectedAudEle=void 0,this.showPopupTime&&(clearTimeout(this.showPopupTime),this.showPopupTime=null),this.removeEventListener(),this.clearDialogObj(),this.isDestroyed=!0)},Z9e.prototype.getModuleName=function(){return"audio"};var J9e=Z9e;function Z9e(e,t){this.isAudioUploaded=!1,this.isAllowedTypes=!0,this.deletedAudio=[],this.parent=e,this.rteID=e.element.id,this.i10n=t.getService("rteLocale"),this.rendererFactory=t.getService("rendererFactory"),this.dialogRenderObj=t.getService("dialogRenderObject"),this.addEventListener(),this.docClick=this.onDocumentClick.bind(this),this.isDestroyed=!1}eqe.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(u4e,this.onKeyDown,this),this.parent.on(c4e,this.onKeyUp,this),this.parent.on(j4e,this.insertingVideo,this),this.parent.on($3e,this.afterRender,this),this.parent.on($5e,this.afterRender,this),this.parent.on(D4e,this.onWindowResize,this),this.parent.on(aWe,this.showDialog,this),this.parent.on(dWe,this.closeDialog,this),this.parent.on(C4e,this.alignmentSelect,this),this.parent.on(Y4e,this.deleteVideo,this),this.parent.on(T4e,this.onToolbarAction,this),this.parent.on(s5e,this.editAreaClickHandler,this),this.parent.on(e4e,this.onIframeMouseDown,this),this.parent.on(J4e,this.videoSize,this),this.parent.on(W4e,this.showVideoQuickToolbar,this),this.parent.on(I5e,this.clearDialogObj,this),this.parent.on(t4e,this.destroy,this))},eqe.prototype.removeEventListener=function(){this.parent.off(u4e,this.onKeyDown),this.parent.off(c4e,this.onKeyUp),this.parent.off(j4e,this.insertingVideo),this.parent.off(D4e,this.onWindowResize),this.parent.off($3e,this.afterRender),this.parent.off($5e,this.afterRender),this.parent.off(aWe,this.showDialog),this.parent.off(dWe,this.closeDialog),this.parent.off(C4e,this.alignmentSelect),this.parent.off(Y4e,this.deleteVideo),this.parent.off(T4e,this.onToolbarAction),this.parent.off(s5e,this.editAreaClickHandler),this.parent.off(e4e,this.onIframeMouseDown),this.parent.off(J4e,this.videoSize),this.parent.off(W4e,this.showVideoQuickToolbar),this.parent.off(I5e,this.clearDialogObj),this.parent.off(t4e,this.destroy),je(this.contentModule)||(E.remove(this.contentModule.getEditPanel(),F.touchEndEvent,this.videoClick),this.parent.formatter.editorManager.observer.off(w5e,this.undoStack),this.parent.insertVideoSettings.resize&&(E.remove(this.parent.contentModule.getEditPanel(),F.touchStartEvent,this.resizeStart),this.parent.element.ownerDocument.removeEventListener("mousedown",this.docClick),this.docClick=null,E.remove(this.contentModule.getEditPanel(),"cut",this.onCutHandler),E.remove(this.contentModule.getDocument(),F.touchMoveEvent,this.resizing)))},eqe.prototype.afterRender=function(){this.contentModule=this.rendererFactory.getRenderer(q3e.Content),E.add(this.contentModule.getEditPanel(),F.touchEndEvent,this.videoClick,this),this.parent.insertVideoSettings.resize&&(E.add(this.parent.contentModule.getEditPanel(),F.touchStartEvent,this.resizeStart,this),this.parent.element.ownerDocument.addEventListener("mousedown",this.docClick),E.add(this.contentModule.getEditPanel(),"cut",this.onCutHandler,this))},eqe.prototype.clearDialogObj=function(){this.uploadObj&&!this.uploadObj.isDestroyed&&(this.uploadObj.destroy(),G(this.uploadObj.element),this.uploadObj=null),this.webUrlBtn&&!this.webUrlBtn.isDestroyed&&(this.webUrlBtn.destroy(),G(this.webUrlBtn.element),this.webUrlBtn=null),this.embedUrlBtn&&!this.embedUrlBtn.isDestroyed&&(this.embedUrlBtn.destroy(),G(this.embedUrlBtn.element),this.embedUrlBtn=null),this.widthNum&&!this.widthNum.isDestroyed&&(this.widthNum.destroy(),G(this.widthNum.element),this.widthNum=null),this.heightNum&&!this.heightNum.isDestroyed&&(this.heightNum.destroy(),G(this.heightNum.element),this.heightNum=null),this.button&&!this.button.isDestroyed&&(this.button.destroy(),G(this.button.element),this.heightNum=null),this.dialogObj&&this.dialogObj.element&&(this.dialogObj.destroy(),G(this.dialogObj.element),this.dialogObj=null)},eqe.prototype.onKeyUp=function(e){if(!je(this.deletedVid)&&0<this.deletedVid.length)for(var t=0;t<this.deletedVid.length;t++){var i={element:this.deletedVid[t],src:"IFRAME"!==this.deletedVid[t].tagName?this.deletedVid[t].querySelector("source").getAttribute("src"):this.deletedVid[t].src};this.parent.trigger(Q5e,i)}},eqe.prototype.undoStack=function(e){if(("undo"===e.subCommand.toLowerCase()||"redo"===e.subCommand.toLowerCase())&&"HTML"===this.parent.editorMode)for(var t=0;t<this.parent.formatter.getUndoRedoStack().length;t++){var i=this.parent.createElement("div"),n=this.parent.formatter.getUndoRedoStack()[t].text,o=(i.appendChild(n.cloneNode(!0)),i.querySelectorAll("video"));if(i.querySelector(".e-vid-resize")&&0<o.length){for(var r=0;r<o.length;r++)o[r].style.outline="";G(i.querySelector(".e-vid-resize"));for(var s=i.cloneNode(!0),a=document.createDocumentFragment();s.firstChild;)a.appendChild(s.firstChild);this.parent.formatter.getUndoRedoStack()[t].text=a}}},eqe.prototype.onIframeMouseDown=function(e){e=e.target;this.dialogObj&&this.dialogObj.hide({returnValue:!0}),(je(this.parent.currentTarget)||"VIDEO"!==this.parent.currentTarget.nodeName)&&this.videoEle&&this.vidResizeDiv&&this.contentModule.getEditPanel().contains(this.vidResizeDiv)&&this.cancelResizeAction(),this.contentModule.getEditPanel().querySelector(".e-vid-resize")&&"VIDEO"===this.parent.currentTarget.nodeName&&!je(this.prevSelectedVidEle)&&this.prevSelectedVidEle!==("IFRAME"===e.tagName||"VIDEO"===e.tagName?e:e.querySelector("iframe"))&&(this.prevSelectedVidEle.style.outline="")},eqe.prototype.videoSize=function(e){var t,i,n,o,r=this;"VIDEO"!==e.selectNode[0].nodeName&&!this.isEmbedVidElem(e.selectNode[0])||(this.insertVideo(e),je(this.dialogObj))||(t=this.i10n.getConstant("videoSizeHeader"),i=this.i10n.getConstant("dialogUpdate"),n=this.vidsizeInput(e),o={args:e.args,selfVideo:this,selection:e.selection,selectNode:e.selectNode},this.dialogObj.setProperties({width:"290px",header:t,content:n,buttons:[{click:function(e){r.insertSize(o)},buttonModel:{content:i,cssClass:"e-flat e-update-size",isPrimary:!0}}]}),this.dialogObj.element.style.maxHeight="inherit",this.dialogObj.content.querySelector("input").focus())},eqe.prototype.vidsizeInput=function(e){var t=this,e=e.selectNode[0],i=this.i10n.getConstant("videoHeight"),n=this.i10n.getConstant("videoWidth"),o=this.parent.createElement("div",{className:"e-video-sizewrap"}),r=!je(this.changedWidthValue)||"auto"!==e.style.width.toString()&&""===e.style.width?je(this.changedWidthValue)?parseInt(e.getClientRects()[0].width.toString(),10).toString():this.changedWidthValue:e.style.width,s=!je(this.changedHeightValue)||"auto"!==e.style.height.toString()&&""===e.style.height?je(this.changedHeightValue)?parseInt(e.getClientRects()[0].height.toString(),10).toString():this.changedHeightValue:e.style.height;""===e.style.width&&je(this.changedWidthValue)&&(r="auto"),""===e.style.height&&je(this.changedHeightValue)&&(s="auto"),this.changedWidthValue=null,this.changedHeightValue=null;e=R6e('<div class="e-rte-label"><label>'+n+'</label></div><div class="e-rte-field"><input type="text" id="vidwidth" class="e-vid-width" value='+r+' /></div><div class="e-rte-label"><label>'+i+'</label></div><div class="e-rte-field"> <input type="text" id="vidheight" class="e-vid-height" value='+s+" /></div>");return o.appendChild(e),this.widthNum=new fV({value:T(r),enableRtl:this.parent.enableRtl,input:function(e){t.inputWidthValue=T(e.value)}}),this.widthNum.createElement=this.parent.createElement,this.widthNum.appendTo(o.querySelector("#vidwidth")),this.heightNum=new fV({value:T(s),enableRtl:this.parent.enableRtl,input:function(e){t.inputHeightValue=T(e.value)}}),this.heightNum.createElement=this.parent.createElement,this.heightNum.appendTo(o.querySelector("#vidheight")),o},eqe.prototype.insertSize=function(e){e.selection.restore();var t=e.selfVideo,i=(0===t.parent.formatter.getUndoRedoStack().length&&t.parent.formatter.saveData(),t.dialogObj.element),n=(this.changedWidthValue="px"===this.inputWidthValue?null:this.inputWidthValue,this.changedHeightValue="px"===this.inputHeightValue?null:this.inputHeightValue,i.querySelector(".e-vid-width").value),i=i.parentElement.querySelector(".e-vid-height").value;t.parent.formatter.process(this.parent,e.args,e.args,{width:n,height:i,selectNode:e.selectNode,subCommand:e.args.item.subCommand}),this.vidResizeDiv&&(e.selectNode[0]="VIDEO"===e.selectNode[0].tagName||"IFRAME"===e.selectNode[0].tagName?e.selectNode[0]:e.selectNode[0].querySelector("iframe"),t.vidResizePos(e.selectNode[0],this.vidResizeDiv)),t.dialogObj.hide({returnValue:!0})},eqe.prototype.resizeEnd=function(e){this.resizeBtnInit(),this.videoEle.parentElement.style.cursor="auto",F.isDevice&&q([e.target.parentElement],"e-mob-span");this.parent.trigger(P4e,{event:e,requestType:"videos"}),this.getPointX(e),this.parent.iframeSettings.enable?(window.pageYOffset,this.parent.element.getBoundingClientRect().top,e.clientY):e.pageY;this.parent.formatter.editorManager.observer.on(w5e,this.undoStack,this),this.parent.formatter.saveData()},eqe.prototype.resizeStart=function(e,t){var i,n=this;this.parent.readonly||je(t=t||(this.isEmbedVidElem(e.target)?e.target.querySelector("iframe"):e.target))||(this.prevSelectedVidEle=this.videoEle,"VIDEO"!==t.tagName&&"IFRAME"!==t.tagName||(this.parent.preventDefaultResize(e),i=t,this.vidResizeDiv&&this.contentModule.getEditPanel().contains(this.vidResizeDiv)&&G(this.vidResizeDiv),this.videoResize(i)),t.classList.contains("e-rte-videoboxmark")&&(0===this.parent.formatter.getUndoRedoStack().length&&this.parent.formatter.saveData(),this.pageX=this.getPointX(e),this.pageY=this.getPointY(e),e.preventDefault(),e.stopImmediatePropagation(),this.resizeBtnInit(),this.quickToolObj&&this.quickToolObj.videoQTBar.hidePopup(),t.classList.contains("e-rte-topLeft")&&(this.resizeBtnStat.topLeft=!0),t.classList.contains("e-rte-topRight")&&(this.resizeBtnStat.topRight=!0),t.classList.contains("e-rte-botLeft")&&(this.resizeBtnStat.botLeft=!0),t.classList.contains("e-rte-botRight")&&(this.resizeBtnStat.botRight=!0),F.isDevice&&this.contentModule.getEditPanel().contains(this.vidResizeDiv)&&!this.vidResizeDiv.classList.contains("e-mob-span")?U([this.vidResizeDiv],"e-mob-span"):this.parent.trigger(M4e,{event:e,requestType:"videos"},function(e){e.cancel&&n.cancelResizeAction()}),this.isResizeBind)&&(E.add(this.contentModule.getDocument(),F.touchMoveEvent,this.resizing,this),E.add(this.contentModule.getDocument(),F.touchEndEvent,this.resizeEnd,this),this.isResizeBind=!1))},eqe.prototype.videoClick=function(e){F.isDevice&&("VIDEO"===e.target.tagName||this.isEmbedVidElem(e.target)?(this.contentModule.getEditPanel().setAttribute("contenteditable","false"),e.target.focus()):this.parent.readonly||this.contentModule.getEditPanel().setAttribute("contenteditable","true")),("VIDEO"===e.target.tagName||this.isEmbedVidElem(e.target)&&!this.parent.userAgentData.isSafari())&&e.preventDefault()},eqe.prototype.onCutHandler=function(){this.vidResizeDiv&&this.contentModule.getEditPanel().contains(this.vidResizeDiv)&&this.cancelResizeAction()},eqe.prototype.videoResize=function(e){this.resizeBtnInit(),this.videoEle=e,U([this.videoEle],"e-resize"),this.vidResizeDiv=this.parent.createElement("span",{className:"e-vid-resize",id:this.rteID+"_vidResize"}),this.vidResizeDiv.appendChild(this.parent.createElement("span",{className:"e-rte-videoboxmark e-rte-topLeft",styles:"cursor: nwse-resize"})),this.vidResizeDiv.appendChild(this.parent.createElement("span",{className:"e-rte-videoboxmark e-rte-topRight",styles:"cursor: nesw-resize"})),this.vidResizeDiv.appendChild(this.parent.createElement("span",{className:"e-rte-videoboxmark e-rte-botLeft",styles:"cursor: nesw-resize"})),this.vidResizeDiv.appendChild(this.parent.createElement("span",{className:"e-rte-videoboxmark e-rte-botRight",styles:"cursor: nwse-resize"})),F.isDevice&&U([this.vidResizeDiv],"e-mob-rte"),e.style.outline="2px solid #4a90e2",this.vidResizePos(e,this.vidResizeDiv),this.resizeVidDupPos(e),this.contentModule.getEditPanel().appendChild(this.vidResizeDiv),"auto"===this.parent.element.style.height&&this.vidResizePos(e,this.vidResizeDiv)},eqe.prototype.getPointX=function(e){return(e.touches&&e.touches.length?e.touches[0]:e).pageX},eqe.prototype.getPointY=function(e){return(e.touches&&e.touches.length?e.touches[0]:e).pageY},eqe.prototype.vidResizePos=function(e,t){var i,n,o,r,s;je(t)||(i=(n=this.calcPos(e)).top,n=n.left,o=(0!==e.width&&"auto"!==e.width&&"NaN"!==e.width?e:e.getBoundingClientRect()).width,r=(0!==e.height&&"auto"!==e.height&&"NaN"!==e.height?e:e.getBoundingClientRect()).height,e=F.isDevice?4*parseInt(e.style.outline.slice(-3),10)+2:2*parseInt(e.style.outline.slice(-3),10)+2,s=F.isDevice?0:2,t.querySelector(".e-rte-botLeft").style.left=n-e+"px",t.querySelector(".e-rte-botLeft").style.top=parseInt(r.toString(),10)-e+i+"px",t.querySelector(".e-rte-botRight").style.left=parseInt(o.toString(),10)-(e-s)+n+"px",t.querySelector(".e-rte-botRight").style.top=parseInt(r.toString(),10)-e+i+"px",t.querySelector(".e-rte-topRight").style.left=parseInt(o.toString(),10)-(e-s)+n+"px",t.querySelector(".e-rte-topRight").style.top=i-e+"px",t.querySelector(".e-rte-topLeft").style.left=n-e+"px",t.querySelector(".e-rte-topLeft").style.top=i-e+"px")},eqe.prototype.calcPos=function(e){for(var t,i={top:0,left:0},n=e.ownerDocument,o=(e.offsetParent&&(e.offsetParent.classList.contains("e-video-clickelem")||-1<["TD","TH","TABLE","A"].indexOf(e.offsetParent.tagName))?z(e,"#"+this.parent.getID()+"_rte-edit-view"):e.offsetParent)||n.documentElement;o&&(o===n.body||o===n.documentElement)&&"static"===o.style.position;)o=o.parentNode;return o&&o!==e&&1===o.nodeType&&(i=o.getBoundingClientRect()),e&&1===e.nodeType&&"IFRAME"===e.tagName?{top:(t=e.getBoundingClientRect()).top-i.top,left:t.left-i.left}:{top:e.offsetTop,left:e.offsetLeft}},eqe.prototype.setAspectRatio=function(e,t,i,n){var o,r,s,a,l=getComputedStyle(e);je(l)||(o=RegExp,s=""!==l.width?l.width.match(new o("^\\d+(\\.\\d*)?%$","g"))?parseFloat(l.width):parseInt(l.width,10):(""!==e.style.width?e.style:e).width,a=""!==l.height?parseInt(l.height,10):(""!==e.style.height?e.style:e).height,s=s.toString().match(new o("\\b\\d+(\\.\\d*)?(%|$)\\b","g"))?parseFloat(s.toString()):parseInt(s.toString(),10),(a=a.toString().match(new o("\\b\\d+(\\.\\d*)?(%|$)\\b","g"))?parseFloat(a.toString()):parseInt(a.toString(),10))<s?(e.style.minWidth=0===this.parent.insertVideoSettings.minWidth?"200px":T(this.parent.insertVideoSettings.minWidth),e.style.minHeight=0===this.parent.insertVideoSettings.minHeight?"90px":T(this.parent.insertVideoSettings.minHeight),this.parent.insertVideoSettings.resizeByPercent?this.updateVidEleWidth(e,s,a,t,i):""===e.style.width&&""!==e.style.height||""===l.width&&""!==l.height?e.style.height=i+"px":""!==e.style.width&&""===e.style.height||""!==l.width&&""===l.height?(r=s/a*i+s/a<this.parent.inputElement.getBoundingClientRect().right-32?s/a*i+s/a:this.parent.inputElement.getBoundingClientRect().right-32,e.style.width=r.toString()+"px"):""!==e.style.width||""!==l.width?(r=s/a*i<this.parent.inputElement.getBoundingClientRect().right-32?s/a*i:this.parent.inputElement.getBoundingClientRect().right-32,e.style.width=r+"px",e.style.height=i+"px"):e.setAttribute("width",parseInt((s/a*i+s/a).toString(),10).toString())):s<a?this.parent.insertVideoSettings.resizeByPercent?this.updateVidEleWidth(e,s,a,t,i):""!==l.width||""!==e.style.width?(e.style.width=t+"px",e.style.height=a/s*t+"px"):e.setAttribute("width",(this.resizeBtnStat.botRight?this.getPointX(n.event)-e.getBoundingClientRect().left:t).toString()):this.parent.insertVideoSettings.resizeByPercent?(e.style.width=this.pixToPerc(t,e.previousElementSibling||e.parentElement)+"%",e.style.height=null,e.removeAttribute("height")):(e.style.width=t+"px",e.style.height=t+"px"))},eqe.prototype.updateVidEleWidth=function(e,t,i,n,o){var r;0!==parseInt(""+e.getBoundingClientRect().width,10)&&0!==parseInt(""+t,10)?(r=(e.offsetWidth+this.mouseX)/e.offsetWidth*("NaN"===parseFloat(e.style.width).toString()?e.offsetWidth/parseFloat(getComputedStyle(this.parent.element).width)*100:parseFloat(e.style.width)),e.style.width=(3<r?r:3)+"%"):e.style.width=i<t?this.pixToPerc(t/i*o,e.previousElementSibling||e.parentElement)+"%":this.pixToPerc(n/i*o,e.previousElementSibling||e.parentElement)+"%",e.style.height=null,e.removeAttribute("height")},eqe.prototype.pixToPerc=function(e,t){return e/parseFloat(getComputedStyle(t).width)*100},eqe.prototype.vidDupMouseMove=function(t,i,e){var n=this,o={event:e,requestType:"videos"};this.parent.trigger(k4e,o,function(e){e.cancel?n.cancelResizeAction():parseInt(n.parent.insertVideoSettings.minWidth,10)>=parseInt(t,10)||parseInt(n.parent.getInsertVidMaxWidth(),10)<=parseInt(t,10)&&je(n.videoEle.style.width)||!n.parent.insertVideoSettings.resizeByPercent&&(parseInt(n.parent.insertVideoSettings.minHeight,10)>=parseInt(i,10)||parseInt(n.parent.insertVideoSettings.maxHeight,10)<=parseInt(i,10))||(n.videoEle.parentElement.style.cursor="pointer",n.setAspectRatio(n.videoEle,parseInt(t,10),parseInt(i,10),o),n.resizeVidDupPos(n.videoEle),n.vidResizePos(n.videoEle,n.vidResizeDiv))})},eqe.prototype.resizing=function(e){this.videoEle.offsetWidth>=this.parent.getInsertVidMaxWidth()&&(this.videoEle.style.maxHeight=this.videoEle.offsetHeight+"px");var t=this.getPointX(e),i=this.getPointY(e),n=this.resizeBtnStat.botLeft||this.resizeBtnStat.topLeft?-(t-this.pageX):t-this.pageX,o=this.resizeBtnStat.topLeft||this.resizeBtnStat.topRight?-(i-this.pageY):i-this.pageY,r=parseInt(this.vidDupPos.width,10)+n,o=parseInt(this.vidDupPos.height,10)+o;this.pageX=t,this.pageY=i,this.mouseX=n,(this.resizeBtnStat.botRight||this.resizeBtnStat.botLeft||this.resizeBtnStat.topRight||this.resizeBtnStat.topLeft)&&this.vidDupMouseMove(r+"px",o+"px",e)},eqe.prototype.cancelResizeAction=function(){this.isResizeBind=!0,E.remove(this.contentModule.getDocument(),F.touchMoveEvent,this.resizing),E.remove(this.contentModule.getDocument(),F.touchEndEvent,this.resizeEnd),this.videoEle&&this.vidResizeDiv&&this.contentModule.getEditPanel().contains(this.vidResizeDiv)&&(G(this.vidResizeDiv),this.videoEle.style.outline="",this.vidResizeDiv=null,this.pageX=null,this.pageY=null)},eqe.prototype.resizeVidDupPos=function(e){this.vidDupPos={width:""!==e.style.width&&this.parent.insertVideoSettings&&!this.parent.insertVideoSettings.resizeByPercent?this.videoEle.style.width:"auto"!==e.width&&0!==e.width&&"NaN"!==e.width?e.width+"px":parseInt(getComputedStyle(e).width,10)+"px",height:""!==e.style.height?this.videoEle.style.height:"auto"!==e.height&&0!==e.height&&"NaN"!==e.height?e.height+"px":parseInt(getComputedStyle(e).height,10)+"px"}},eqe.prototype.resizeBtnInit=function(){return this.resizeBtnStat={botLeft:!1,botRight:!1,topRight:!1,topLeft:!1}},eqe.prototype.onToolbarAction=function(e){switch(WUe()&&this.parent.notify(i5e,{}),e.args.item.subCommand){case"VideoReplace":this.parent.notify(j4e,e);break;case"VideoRemove":this.parent.notify(Y4e,e);break;case"VideoDimension":this.parent.notify(J4e,e)}},eqe.prototype.onKeyDown=function(e){var t,i,n,o,r,s=e.args;this.deletedVid=[];if(!(i="HTML"===this.parent.editorMode?(n=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument())).startContainer===n.endContainer&&n.startOffset===n.endOffset:i)&&"HTML"===this.parent.editorMode&&[27,112,113,114,115,116,117,118,119,120,121,122,123,44,45,9,16,17,18,19,20,33,34,35,36,37,38,39,40,91,92,93,144,145,182,183].indexOf(s.which)<0)for(var a=this.parent.formatter.editorManager.nodeSelection.getNodeCollection(n),l=0;l<a.length;l++)"VIDEO"!==a[l].nodeName&&"IFRAME"!==a[l].nodeName||this.deletedVid.push(a[l]);switch("HTML"===this.parent.editorMode&&(8===s.which&&"Backspace"===s.code||46===s.which&&"Delete"===s.code)&&(e=n.startContainer===n.endContainer&&n.startOffset===n.endOffset,8===s.which&&"Backspace"===s.code&&e?this.checkVideoBack(n):46===s.which&&"Delete"===s.code&&e&&this.checkVideoDel(n)),je(this.parent.formatter.editorManager.nodeSelection)||"KeyK"===s.code||(n=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),o=this.parent.formatter.editorManager.nodeSelection.getNodeCollection(n),r=this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(n),s.ctrlKey)||!s.key||1!==s.key.length&&"enter"!==s.action||(je(r[0])||"VIDEO"!==r[0].tagName)&&!this.isEmbedVidElem(r[0])||!r[0].parentElement||(r[0].parentElement,this.contentModule.getEditPanel().querySelector(".e-vid-resize")&&this.removeResizeEle(),q([r[0]],CQe),this.quickToolObj&&this.quickToolObj.videoQTBar&&this.quickToolObj.videoQTBar.hidePopup()),!s.ctrlKey||89!==s.keyCode&&90!==s.keyCode||this.undoStack({subCommand:90===s.keyCode?"undo":"redo"}),8!==s.keyCode&&46!==s.keyCode||(o&&o[0]&&("VIDEO"===o[0].nodeName||this.isEmbedVidElem(o[0])||46===s.keyCode&&o[0].nextSibling&&("e-video-wrap"===o[0].nextSibling.className||this.isEmbedVidElem(o[0].nextSibling))||8===s.keyCode&&o[0].previousSibling&&("e-video-wrap"===o[0].previousSibling.className||this.isEmbedVidElem(o[0].previousSibling)))&&o.length<=2&&(je(this.parent.formatter.editorManager.nodeSelection)||(t=this.parent.formatter.editorManager.nodeSelection.save(n,this.parent.contentModule.getDocument())),s.preventDefault(),this.deleteVideo({selectNode:o,selection:t,selectParent:r,args:{item:{command:"Videos",subCommand:"VideoRemove"},originalEvent:s}},s.keyCode)),this.parent.contentModule.getEditPanel().querySelector(".e-vid-resize")&&this.removeResizeEle()),"Backspace"===s.code&&(s.action="backspace"),s.action){case"escape":je(this.dialogObj)||this.dialogObj.close();break;case"backspace":case"delete":for(l=0;l<this.deletedVid.length;l++){var h=this.deletedVid[l].src;this.videoRemovePost(h)}"Markdown"!==this.parent.editorMode&&(3===n.startContainer.nodeType?"Backspace"===s.code?n.startContainer.previousElementSibling&&0===n.startOffset&&n.startContainer.previousElementSibling.classList.contains(w8e)&&G(n.startContainer.previousElementSibling):n.startContainer.nextElementSibling&&n.endContainer.textContent.length===n.endOffset&&n.startContainer.nextElementSibling.classList.contains(w8e)&&G(n.startContainer.nextElementSibling):1===n.startContainer.nodeType&&n.startContainer.classList&&n.startContainer.classList.contains(w8e)?G(n.startContainer):1!==n.startContainer.nodeType||je(n.startContainer.querySelector(".e-video-wrap"))||"Delete"!==s.code||G(n.startContainer.querySelector(".e-video-wrap")));break;case"insert-video":je(this.parent.formatter.editorManager.nodeSelection)||(t=this.parent.formatter.editorManager.nodeSelection.save(n,this.parent.contentModule.getDocument())),this.openDialog(!0,s,t,o,r),s.preventDefault()}s.ctrlKey&&"a"===s.key&&this.handleSelectAll()},eqe.prototype.handleSelectAll=function(){this.cancelResizeAction(),q(this.parent.inputElement.querySelectorAll("."+CQe),CQe)},eqe.prototype.openDialog=function(e,t,i,n,o){var r,s,n=e||je(this.parent.formatter.editorManager.nodeSelection)?(r=i,s=n,o):(i=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),r=this.parent.formatter.editorManager.nodeSelection.save(i,this.parent.contentModule.getDocument()),s=this.parent.formatter.editorManager.nodeSelection.getNodeCollection(i),this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(i));"HTML"===this.parent.editorMode&&this.insertVideo({args:{item:{command:"Videos",subCommand:"Video"},originalEvent:t,name:e?null:"showDialog"},selectNode:s,selection:r,selectParent:n})},eqe.prototype.showDialog=function(e){je(e.originalEvent)?this.openDialog(!1):this.openDialog(!1,e.originalEvent)},eqe.prototype.closeDialog=function(){this.dialogObj&&this.dialogObj.hide({returnValue:!0})},eqe.prototype.checkVideoBack=function(e){"#text"!==e.startContainer.nodeName||0!==e.startOffset||je(e.startContainer.previousSibling)||"VIDEO"!==e.startContainer.previousSibling.nodeName&&!this.isEmbedVidElem(e.startContainer.previousSibling)?"#text"===e.startContainer.nodeName||je(e.startContainer.childNodes[e.startOffset-1])||"VIDEO"!==e.startContainer.childNodes[e.startOffset-1].nodeName&&!this.isEmbedVidElem(e.startContainer.childNodes[e.startOffset-1])||this.deletedVid.push(e.startContainer.childNodes[e.startOffset-1]):this.deletedVid.push(e.startContainer.previousSibling)},eqe.prototype.checkVideoDel=function(e){"#text"!==e.startContainer.nodeName||e.startOffset!==e.startContainer.textContent.length||je(e.startContainer.nextSibling)||"VIDEO"!==e.startContainer.nextSibling.nodeName&&!this.isEmbedVidElem(e.startContainer.nextSibling)?"#text"===e.startContainer.nodeName||je(e.startContainer.childNodes[e.startOffset])||"VIDEO"!==e.startContainer.childNodes[e.startOffset].nodeName&&!this.isEmbedVidElem(e.startContainer.childNodes[e.startOffset])||this.deletedVid.push(e.startContainer.childNodes[e.startOffset]):this.deletedVid.push(e.startContainer.nextSibling)},eqe.prototype.alignmentSelect=function(e){var t=e.item;if(document.body.contains(document.body.querySelector(".e-rte-quick-toolbar"))&&"Videos"===t.command){var i=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),i=this.parent.formatter.editorManager.nodeSelection.getNodeCollection(i),n={args:e,selectNode:i="VIDEO"===i[0].nodeName?i:[this.videoEle]};switch(0===this.parent.formatter.getUndoRedoStack().length&&this.parent.formatter.saveData(),t.subCommand){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":this.alignVideo(n,t.subCommand);break;case"Inline":this.inline(n);break;case"Break":this.break(n)}this.quickToolObj&&document.body.contains(this.quickToolObj.videoQTBar.element)&&(this.quickToolObj.videoQTBar.hidePopup(),q([i[0]],CQe)),this.cancelResizeAction()}},eqe.prototype.deleteVideo=function(e,t){var i;("VIDEO"===e.selectNode[0].nodeName||this.isEmbedVidElem(e.selectNode[0]))&&(this.isEmbedVidElem(e.selectNode[0])&&(e.selectNode[0]=e.selectNode[0].classList.contains(v8e)?e.selectNode[0]:e.selectNode[0].parentElement),i={element:this.isEmbedVidElem(e.selectNode[0])?e.selectNode[0]:e.selectNode[0].querySelector("iframe"),src:(this.isEmbedVidElem(e.selectNode[0])?e.selectNode[0].querySelector("iframe"):e.selectNode[0].querySelector("source")).getAttribute("src")},0===this.parent.formatter.getUndoRedoStack().length&&this.parent.formatter.saveData(),e.selection.restore(),this.parent.formatter.process(this.parent,e.args,e.args.originalEvent,{selectNode:e.selectNode,subCommand:e.args.item.subCommand}),this.videoRemovePost(i.src),this.quickToolObj&&document.body.contains(this.quickToolObj.videoQTBar.element)&&this.quickToolObj.videoQTBar.hidePopup(),this.cancelResizeAction(),je(t))&&this.parent.trigger(Q5e,i)},eqe.prototype.videoRemovePost=function(e){var t=this,i="";je(this.parent.insertVideoSettings.removeUrl)||""===this.parent.insertVideoSettings.removeUrl||(i=-1<e.indexOf("http://")||-1<e.indexOf("https://")?e:new URL(e,document.baseURI).href,this.removingVideoName=i.replace(/^.*[\\\/]/,""),(e=new XMLHttpRequest).addEventListener("readystatechange",function(){4===this.readyState&&200===this.status&&t.triggerPost(this.response)}),e.open("GET",i),e.responseType="blob",e.send())},eqe.prototype.triggerPost=function(e){var t,i=this.parent.insertVideoSettings.removeUrl;je(i)||""===i||(e=new File([e],this.removingVideoName),i=new ze(i,"POST",!0,null),(t=new FormData).append("UploadFiles",e),i.send(t))},eqe.prototype.onDocumentClick=function(e){var t=e.target;je(this.contentModule.getEditPanel())||("VIDEO"!==t.nodeName&&!this.isEmbedVidElem(t)||(this.videoEle=this.isEmbedVidElem(t)?t.querySelector("iframe"):t),je(this.dialogObj)||!(!z(t,"[id='"+this.dialogObj.element.id+"']")&&this.parent.toolbarSettings.enable&&this.parent.getToolbarElement()&&!this.parent.getToolbarElement().contains(e.target)||this.parent.getToolbarElement()&&this.parent.getToolbarElement().contains(e.target)&&!z(t,"#"+this.parent.getID()+"_toolbar_Video")&&!t.querySelector("#"+this.parent.getID()+"_toolbar_Video"))||e.offsetX>e.target.clientWidth||e.offsetY>e.target.clientHeight||(this.parent.notify(SWe,{closedBy:"outside click"}),this.dialogObj.hide({returnValue:!0}),this.parent.isBlur=!0,L6e(this.parent.element,"focusout")),this.contentModule.getEditPanel().querySelector(".e-vid-resize")&&("VIDEO"===t.tagName||this.isEmbedVidElem(t)||this.removeResizeEle(),"VIDEO"===t.tagName||this.isEmbedVidElem(t)||je(this.videoEle)?je(this.prevSelectedVidEle)||this.prevSelectedVidEle===("IFRAME"===t.tagName||"VIDEO"===t.tagName?t:t.querySelector("iframe"))||(this.prevSelectedVidEle.style.outline=""):this.videoEle.style.outline=""),this.parent.inlineMode.enable&&t&&this.dialogObj&&!z(t,"#"+this.dialogObj.element.id)&&this.dialogObj.hide())},eqe.prototype.removeResizeEle=function(){this.isResizeBind=!0,E.remove(this.contentModule.getDocument(),F.touchMoveEvent,this.resizing),E.remove(this.contentModule.getDocument(),F.touchEndEvent,this.resizeEnd),G(this.contentModule.getEditPanel().querySelector(".e-vid-resize"))},eqe.prototype.onWindowResize=function(){je(this.contentModule)||je(this.contentModule.getEditPanel().querySelector(".e-vid-resize"))||this.cancelResizeAction()},eqe.prototype.break=function(e){var t;"VIDEO"!==e.selectNode[0].nodeName&&!this.isEmbedVidElem(e.selectNode[0])||(t=e.args.item?e.args.item.subCommand:"Break",this.parent.formatter.process(this.parent,e.args,e.args.originalEvent,{selectNode:e.selectNode,subCommand:t}))},eqe.prototype.inline=function(e){var t;"VIDEO"!==e.selectNode[0].nodeName&&!this.isEmbedVidElem(e.selectNode[0])||(t=e.args.item?e.args.item.subCommand:"Inline",this.parent.formatter.process(this.parent,e.args,e.args.originalEvent,{selectNode:e.selectNode,subCommand:t}))},eqe.prototype.alignVideo=function(e,t){t=e.args.item?e.args.item.subCommand:t;this.parent.formatter.process(this.parent,e.args,e.args.originalEvent,{selectNode:e.selectNode,subCommand:t})},eqe.prototype.editAreaClickHandler=function(e){var t,i,n;this.parent.readonly?this.hideVideoQuickToolbar():(t=e.args,i=this.parent.quickToolbarSettings.showOnRightClick,2===t.which||i&&1===t.which||!i&&3===t.which?!i||1!==t.which||je(t.target)||"VIDEO"!==t.target.tagName&&!this.isEmbedVidElem(t.target)||(this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument()),this.parent.formatter.editorManager.nodeSelection.setSelectionContents(this.contentModule.getDocument(),t.target)):"HTML"===this.parent.editorMode&&this.parent.quickToolbarModule&&this.parent.quickToolbarModule.videoQTBar&&(this.quickToolObj=this.parent.quickToolbarModule,i=t.target,this.contentModule=this.rendererFactory.getRenderer(q3e.Content),n=this.quickToolObj.videoQTBar.element.classList.contains("e-rte-pop"),("VIDEO"===i.nodeName||this.isEmbedVidElem(i))&&this.parent.quickToolbarModule?n||(this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument()),this.parent.formatter.editorManager.nodeSelection.setSelectionContents(this.contentModule.getDocument(),i),WUe()&&this.parent.notify(t5e,e),U([this.isEmbedVidElem(i)?i.querySelector("iframe"):i],CQe),this.showVideoQuickToolbar({args:t,type:"Videos",elements:[t.target]})):this.hideVideoQuickToolbar()))},eqe.prototype.showVideoQuickToolbar=function(e){var t,i,n,o=this;"Videos"!==e.type||!je(e.args)&&2===e.args.detail||je(this.parent.quickToolbarModule)||je(this.parent.quickToolbarModule.videoQTBar)||je(e.args)||(this.quickToolObj=this.parent.quickToolbarModule,t=e.args,i=e.elements,[].forEach.call(e.elements,function(e,t){0===t&&(i=e)}),"VIDEO"!==i.tagName&&!this.isEmbedVidElem(i)||U([this.isEmbedVidElem(i)&&"IFRAME"!==i.tagName?i.querySelector("iframe"):i],[CQe]),n=this.parent.iframeSettings.enable?window.pageYOffset+this.parent.element.getBoundingClientRect().top+t.clientY:t.pageY,this.parent.quickToolbarModule.videoQTBar&&(e.isNotify?this.showPopupTime=setTimeout(function(){o.parent.formatter.editorManager.nodeSelection.Clear(o.contentModule.getDocument()),o.parent.formatter.editorManager.nodeSelection.setSelectionContents(o.contentModule.getDocument(),i),o.quickToolObj.videoQTBar.showPopup(t.pageX-50,n+i.getBoundingClientRect().height/2-i.offsetTop,i),!0===o.parent.insertVideoSettings.resize&&o.resizeStart(e.args,i)},400):this.quickToolObj.videoQTBar.showPopup(t.pageX-50,n+i.getBoundingClientRect().height/2-i.offsetTop,i)))},eqe.prototype.hideVideoQuickToolbar=function(){je(this.contentModule.getEditPanel().querySelector("."+CQe))||(q([this.contentModule.getEditPanel().querySelector("."+CQe)],CQe),je(this.videoEle)||(this.videoEle.style.outline=""),je(this.contentModule.getEditPanel().querySelector(".e-vid-resize"))||G(this.contentModule.getEditPanel().querySelector(".e-vid-resize")),this.quickToolObj&&this.quickToolObj.videoQTBar&&document.body.contains(this.quickToolObj.videoQTBar.element)&&this.quickToolObj.videoQTBar.hidePopup())},eqe.prototype.isEmbedVidElem=function(e){return!!(e&&3!==e.nodeType&&"BR"!==e.nodeName&&e.classList&&(e.classList.contains(w8e)||e.classList.contains(v8e)||e.classList.contains("e-embed-video-wrap"))||e&&"IFRAME"===e.nodeName)},eqe.prototype.insertingVideo=function(e){this.insertVideo(e),je(this.dialogObj)||(this.dialogObj.element.style.maxHeight="inherit",e=this.dialogObj.element.querySelector(".e-video-content"),(je(this.parent.insertVideoSettings.path)&&"HTML"!==this.parent.editorMode?e.querySelector(".e-video-url"):document.getElementById(this.rteID+"_insertVideo")).focus())},eqe.prototype.insertVideo=function(e){var t,i,n,o,r,s,a,l,h=this;this.dialogObj?this.dialogObj.hide({returnValue:!0}):(t=this.parent.createElement("div",{className:"e-rte-video-dialog",id:this.rteID+"_video"}),this.parent.rootContainer.appendChild(t),r=this.i10n.getConstant("dialogInsert"),s=this.i10n.getConstant("dialogCancel"),n=this.i10n.getConstant("videoHeader"),i=e.selection,o={selfVideo:this,selection:e.selection,args:e.args,selectParent:e.selectParent},n={header:n,cssClass:L8e,enableRtl:this.parent.enableRtl,locale:this.parent.locale,showCloseIcon:!0,closeOnEscape:!0,width:F.isDevice?"290px":"340px",isModal:F.isDevice,buttons:[{click:this.insertVideoUrl.bind(o),buttonModel:{content:r,cssClass:"e-flat e-insertVideo",isPrimary:!0,disabled:!0}},{click:function(e){h.cancelDialog(e)},buttonModel:{cssClass:"e-flat e-cancel",content:s}}],target:F.isDevice?document.body:this.parent.element,animationSettings:{effect:"None"},close:function(e){h.isVideoUploaded&&(h.dialogObj.element.querySelector(".e-file-abort-btn")?h.dialogObj.element.querySelector(".e-file-abort-btn").click():h.uploadObj.remove()),h.parent.isBlur=!1,e&&!je(e.event)&&e.event.returnValue&&"HTML"===h.parent.editorMode&&i.restore(),h.clearDialogObj(),h.dialogRenderObj.close(e)}},o=this.parent.createElement("div",{className:"e-video-content"}),je(this.parent.insertVideoSettings.path)&&"HTML"!==this.parent.editorMode||o.appendChild(this.videoUpload(e)),r=this.parent.createElement("div",{className:"e-videoheader"}),s=this.parent.createElement("div",{className:"e-embed-videoheader"}),a=this.i10n.getConstant("videoLinkHeader"),l=this.i10n.getConstant("embedVideoLinkHeader"),"HTML"===this.parent.editorMode&&(r.innerHTML=a,s.innerHTML=l),o.appendChild(this.urlPopup(e)),e.selectNode&&1===e.selectNode[0].nodeType&&("VIDEO"===e.selectNode[0].tagName||this.isEmbedVidElem(e.selectNode[0]))&&(n.header=this.parent.localeObj.getConstant("editVideoHeader")),n.content=o,this.dialogObj=this.dialogRenderObj.render(n),this.dialogObj.createElement=this.parent.createElement,this.dialogObj.appendTo(t),e.selectNode&&1===e.selectNode[0].nodeType&&("VIDEO"===e.selectNode[0].tagName||this.isEmbedVidElem(e.selectNode[0]))&&"insertVideo"===e.name&&(this.dialogObj.element.querySelector(".e-insertVideo").textContent=this.parent.localeObj.getConstant("dialogUpdate")),t.style.maxHeight="inherit",this.quickToolObj&&(this.quickToolObj.videoQTBar&&document.body.contains(this.quickToolObj.videoQTBar.element)&&(this.quickToolObj.videoQTBar.hidePopup(),je(e.selectParent)||q([e.selectParent[0]],CQe)),this.quickToolObj.inlineQTBar&&document.body.contains(this.quickToolObj.inlineQTBar.element)&&this.quickToolObj.inlineQTBar.hidePopup(),this.quickToolObj.textQTBar)&&this.parent.element.ownerDocument.body.contains(this.quickToolObj.textQTBar.element)&&this.quickToolObj.textQTBar.hidePopup())},eqe.prototype.urlPopup=function(e){var t=this,i=this.parent.createElement("div",{className:"e-video-url-wrap"}),n=this.parent.createElement("div",{id:"urlcontent"}),o=this.i10n.getConstant("videoUrl"),r=R6e('<input id="embedURL" type="radio"><input id="webURL" type="radio" >'),s=(i.appendChild(r),i.appendChild(n),this.embedInputUrl=this.parent.createElement("textarea",{className:"e-input e-embed-video-url",attrs:{placeholder:this.i10n.getConstant("pasteEmbeddedCodeHere"),type:"text",tabindex:"-1","aria-label":this.i10n.getConstant("embedVideoLinkHeader")}}),this.embedInputUrl.addEventListener("input",function(){je(t.embedInputUrl)||(0===t.embedInputUrl.value.length?t.dialogObj.getButtons(0).element.disabled=!0:t.dialogObj.getButtons(0).element.removeAttribute("disabled"))}),this.inputUrl=this.parent.createElement("input",{className:"e-input e-video-url",attrs:{placeholder:o,spellcheck:"false"}}),this.inputUrl.addEventListener("input",function(){je(t.inputUrl)||(0===t.inputUrl.value.length?t.dialogObj.getButtons(0).element.disabled=!0:t.dialogObj.getButtons(0).element.removeAttribute("disabled"))}),e.selectNode&&e.selectNode[0]&&("VIDEO"===e.selectNode[0].nodeName||this.isEmbedVidElem(e.selectNode[0]))&&("VIDEO"===e.selectNode[0].nodeName||e.selectNode[0].classList.contains("e-video-wrap")?(r=new RegExp(/([^\S]|^)(((https?:\/\/)|(www\.))(\S+))/gi),o=e.selectNode[0].querySelector("source"),this.inputUrl.value=o&&o.src&&o.src.match(r)?o.src:""):this.embedInputUrl.value=("IFRAME"===e.selectNode[0].nodeName?e.selectNode[0]:e.selectNode[0].querySelector("iframe")).outerHTML),!!this.inputUrl.value);return this.embedUrlBtn=new cb({label:this.i10n.getConstant("embeddedCode"),checked:!s,name:"URL",created:function(){s||n.appendChild(t.embedInputUrl)},change:function(){n.innerHTML="",n.appendChild(t.embedInputUrl)}}),this.embedUrlBtn.appendTo(i.querySelector("#embedURL")),this.webUrlBtn=new cb({label:this.i10n.getConstant("webUrl"),checked:s,name:"URL",created:function(){s&&n.appendChild(t.inputUrl)},change:function(){n.innerHTML="",n.appendChild(t.inputUrl)}}),this.webUrlBtn.appendTo(i.querySelector("#webURL")),i},eqe.prototype.videoUpload=function(e){var n,o,r,s=this,a=this,t=a.parent.iframeSettings.enable,t=(o="HTML"===a.parent.editorMode&&(!t&&je(z(e.selection.range.startContainer.parentNode,"[id='"+this.parent.contentModule.getPanel().id+"']"))||t&&!A6e(e.selection.range.startContainer.parentNode.ownerDocument.querySelector("body"),"e-lib"))?(this.contentModule.getEditPanel().focus(),t=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),n=this.parent.formatter.editorManager.nodeSelection.save(t,this.parent.contentModule.getDocument()),this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(t)):(n=e.selection,e.selectParent),this.parent.createElement("div",{className:"e-vid-uploadwrap e-droparea"})),i=this.i10n.getConstant("videoDeviceUploadMessage"),l=this.i10n.getConstant("videoUploadMessage"),h=this.parent.createElement("span",{className:"e-droptext"}),i=this.parent.createElement("span",{className:"e-rte-upload-text",innerHTML:F.isDevice?i:l}),l=(h.appendChild(i),this.parent.createElement("button",{className:"e-browsebtn",id:this.rteID+"_insertVideo",attrs:{autofocus:"true",type:"button"}})),i=(h.appendChild(l),t.appendChild(h),this.i10n.getConstant("browse")),i=(this.button=new zv({content:i,enableRtl:this.parent.enableRtl}),this.button.isStringTemplate=!0,this.button.createElement=this.parent.createElement,this.button.appendTo(l),F.isDevice?h:l),l=(E.add(i,"click",this.fileSelect,this),this.parent.createElement("input",{id:this.rteID+"_upload",attrs:{type:"File",name:"UploadFiles"}}));return t.appendChild(l),this.uploadObj=new GN({asyncSettings:{saveUrl:this.parent.insertVideoSettings.saveUrl,removeUrl:this.parent.insertVideoSettings.removeUrl},dropArea:h,multiple:!1,enableRtl:this.parent.enableRtl,allowedExtensions:this.parent.insertVideoSettings.allowedTypes.toString(),selected:function(e){a.isVideoUploaded=!0,e.filesData,s.parent.trigger(V5e,e,function(e){var i;e.cancel||je(e.filesData[0])||(s.checkExtension(e.filesData[0]),r=e.filesData[0].name,"HTML"===s.parent.editorMode&&je(s.parent.insertVideoSettings.path)&&((i=new FileReader).addEventListener("load",function(e){var t="Base64"===s.parent.insertVideoSettings.saveFormat?i.result:URL.createObjectURL(U6e(i.result));a.uploadUrl={url:t,selection:n,fileName:r,selectParent:o},a.inputUrl.setAttribute("disabled","true"),a.embedInputUrl.setAttribute("disabled","true"),je(a.parent.insertVideoSettings.saveUrl)&&s.isAllowedTypes&&!je(s.dialogObj)&&s.dialogObj.getButtons(0).element.removeAttribute("disabled")}),i.readAsDataURL(e.filesData[0].rawFile)))})},beforeUpload:function(e){s.parent.trigger(X5e,e)},uploading:function(e){s.parent.isServerRendered||s.parent.trigger(_5e,e)},success:function(e){s.parent.trigger(H5e,e,function(e){var t;je(s.parent.insertVideoSettings.path)||(t=s.parent.insertVideoSettings.path+e.file.name,a.uploadUrl={url:t,selection:n,fileName:r,selectParent:o,width:{width:a.parent.insertVideoSettings.width,minWidth:a.parent.insertVideoSettings.minWidth,maxWidth:a.parent.getInsertImgMaxWidth()},height:{height:a.parent.insertVideoSettings.height,minHeight:a.parent.insertVideoSettings.minHeight,maxHeight:a.parent.insertVideoSettings.maxHeight}},a.embedInputUrl.setAttribute("disabled","true")),"upload"!==e.operation||je(s.dialogObj)||s.dialogObj.getButtons(0).element.removeAttribute("disabled")})},failure:function(e){s.parent.trigger(z5e,e)},removing:function(){s.parent.trigger(j5e,e,function(e){a.isVideoUploaded=!1,s.dialogObj.getButtons(0).element.disabled=!0,a.inputUrl.getAttribute("disabled")&&a.inputUrl.removeAttribute("disabled"),a.embedInputUrl.getAttribute("disabled")&&a.embedInputUrl.removeAttribute("disabled"),a.uploadUrl&&(a.uploadUrl.url="")})}}),this.uploadObj.isStringTemplate=!0,this.uploadObj.createElement=this.parent.createElement,this.uploadObj.appendTo(l),t},eqe.prototype.checkExtension=function(e){this.uploadObj.allowedExtensions&&(-1===this.uploadObj.allowedExtensions.toLocaleLowerCase().indexOf(("."+e.type).toLocaleLowerCase())?(this.dialogObj.getButtons(0).element.setAttribute("disabled","disabled"),this.isAllowedTypes=!1):this.isAllowedTypes=!0)},eqe.prototype.fileSelect=function(){return this.dialogObj.element.getElementsByClassName("e-file-select-wrap")[0].querySelector("button").click(),!1},eqe.prototype.cancelDialog=function(e){this.parent.isBlur=!1,this.dialogObj.hide({returnValue:!0}),this.isVideoUploaded&&this.uploadObj.removing()},eqe.prototype.insertVideoUrl=function(e){var t,i=this.selfVideo,n=(i.isVideoUploaded=!1,i.inputUrl.value),o=i.embedInputUrl.value;0===i.parent.formatter.getUndoRedoStack().length&&i.parent.formatter.saveData(),je(i.uploadUrl)||""===i.uploadUrl.url?"HTML"!==i.parent.editorMode||""===n&&""===o||(o=(t=document.getElementById("webURL")).checked?n.split("/")[n.split("/").length-1]:o,n={cssClass:"Inline"===i.parent.insertVideoSettings.layoutOption?E8e:C8e,url:n,selection:this.selection,fileName:o,isEmbedUrl:!t.checked,selectParent:this.selectParent,width:{width:i.parent.insertVideoSettings.width,minWidth:i.parent.insertVideoSettings.minWidth,maxWidth:i.parent.getInsertImgMaxWidth()},height:{height:i.parent.insertVideoSettings.height,minHeight:i.parent.insertVideoSettings.minHeight,maxHeight:i.parent.insertVideoSettings.maxHeight}},i.dialogObj.hide({returnValue:!1}),null===i.dialogObj&&i.parent.formatter.process(i.parent,this.args,this.args.originalEvent,n)):(i.uploadUrl.cssClass="Inline"===i.parent.insertVideoSettings.layoutOption?E8e:C8e,i.uploadUrl.width={width:i.parent.insertVideoSettings.width,minWidth:i.parent.insertVideoSettings.minWidth,maxWidth:i.parent.getInsertImgMaxWidth()},i.uploadUrl.height={height:i.parent.insertVideoSettings.height,minHeight:i.parent.insertVideoSettings.minHeight,maxHeight:i.parent.insertVideoSettings.maxHeight},i.dialogObj.hide({returnValue:!1}),null===i.dialogObj&&(i.parent.formatter.process(i.parent,this.args,this.args.originalEvent,i.uploadUrl),i.uploadUrl.url=""))},eqe.prototype.destroy=function(){this.isDestroyed||(this.prevSelectedVidEle=void 0,this.removeEventListener(),this.showPopupTime&&(clearTimeout(this.showPopupTime),this.showPopupTime=null),this.clearDialogObj(),this.isDestroyed=!0)},eqe.prototype.getModuleName=function(){return"video"};var $9e=eqe;function eqe(e,t){this.isVideoUploaded=!1,this.isAllowedTypes=!0,this.pageX=null,this.pageY=null,this.mouseX=null,this.deletedVid=[],this.isResizeBind=!0,this.parent=e,this.rteID=e.element.id,this.i10n=t.getService("rteLocale"),this.rendererFactory=t.getService("rendererFactory"),this.dialogRenderObj=t.getService("dialogRenderObject"),this.addEventListener(),this.isDestroyed=!1,this.docClick=this.onDocumentClick.bind(this)}tqe=function(e,t){return(tqe=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])}))(e,t)};var tqe,iqe,nqe,wce=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},oqe={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,"]":221,"[":219,"=":187,"<":188,">":190,"`":192},rqe=(function(e,t){function i(){this.constructor=e}tqe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(sqe,iqe=Ct),(nqe=sqe).prototype.destroy=function(){this.unwireEvents(),iqe.prototype.destroy.call(this)},sqe.prototype.onPropertyChanged=function(e,t){},sqe.prototype.bind=function(){this.wireEvents()},sqe.prototype.getModuleName=function(){return"keyboard"},sqe.prototype.wireEvents=function(){this.element.addEventListener(this.eventName,this.keyPressHandler)},sqe.prototype.unwireEvents=function(){this.element.removeEventListener(this.eventName,this.keyPressHandler)},sqe.getKeyConfigData=function(e){var t,i;return e in this.configCache?this.configCache[""+e]:(i={altKey:-1!==(t=e.toLowerCase().split("+")).indexOf("alt"),ctrlKey:-1!==t.indexOf("ctrl"),shiftKey:-1!==t.indexOf("shift"),keyCode:null},1<t[t.length-1].length&&Number(t[t.length-1])?i.keyCode=Number(t[t.length-1]):i.keyCode=nqe.getKeyCode(t[t.length-1]),nqe.configCache[""+e]=i)},sqe.getKeyCode=function(e){return oqe[""+e]||e.toUpperCase().charCodeAt(0)},sqe.configCache={},wce([e({})],sqe.prototype,"keyConfigs",void 0),wce([e("keyup")],sqe.prototype,"eventName",void 0),wce([i()],sqe.prototype,"keyAction",void 0),nqe=wce([Bt],sqe));function sqe(e,t){var c=iqe.call(this,t,e)||this;return c.keyPressHandler=function(e){for(var t=e.altKey,i=e.ctrlKey,n=e.shiftKey,o=e.metaKey,r=e.which,s=0,a=Object.keys(c.keyConfigs);s<a.length;s++)for(var l=a[s],h=0,d=c.keyConfigs[""+l].split(",");h<d.length;h++){var p=d[h],p=nqe.getKeyConfigData(p.trim());t!==p.altKey||i!==p.ctrlKey&&!o||n!==p.shiftKey||r!==p.keyCode||(e.action=l)}c.keyAction&&c.keyAction(e)},c.bind(),c}lqe.prototype.addEventListener=function(){this.parent.on(Z4e,this.sourceCode,this),this.parent.on($3e,this.onInitialEnd,this),this.parent.on($4e,this.updateSourceCode,this),this.parent.on(t4e,this.destroy,this)},lqe.prototype.onInitialEnd=function(){this.parent.formatter.editorManager.observer.on(n7e,this.onKeyDown,this)},lqe.prototype.removeEventListener=function(){this.unWireEvent(),this.parent.off(Z4e,this.sourceCode),this.parent.off($4e,this.updateSourceCode),this.parent.off($3e,this.onInitialEnd),this.parent.off(t4e,this.destroy),this.parent.formatter.editorManager.observer.off(n7e,this.onKeyDown)},lqe.prototype.getSourceCode=function(){return this.parent.createElement("textarea",{className:VQe+this.parent.getCssClass(!0)})},lqe.prototype.wireEvent=function(e){this.keyboardModule=new rqe(e,{keyAction:this.previewKeyDown.bind(this),keyConfigs:this.parent.formatter.keyConfig,eventName:"keydown"}),E.add(this.previewElement,"mousedown",this.mouseDownHandler,this)},lqe.prototype.unWireEvent=function(){this.previewElement&&E.remove(this.previewElement,"mousedown",this.mouseDownHandler),this.keyboardModule&&!this.keyboardModule.isDestroyed&&this.keyboardModule.destroy()},lqe.prototype.wireBaseKeyDown=function(){this.parent.keyboardModule=new rqe(this.contentModule.getEditPanel(),{keyAction:this.parent.keyDown.bind(this.parent),keyConfigs:this.parent.formatter.keyConfig,eventName:"keydown"})},lqe.prototype.unWireBaseKeyDown=function(){this.parent.keyboardModule.destroy()},lqe.prototype.mouseDownHandler=function(e){this.parent.notify(r5e,{args:e})},lqe.prototype.previewKeyDown=function(e){switch(e.action){case"html-source":this.updateSourceCode(e),e.preventDefault();break;case"toolbar-focus":var t;this.parent.toolbarSettings.enable&&this.parent.getToolbarElement()&&((t=this.parent.getToolbarElement().querySelector(".e-toolbar-item:not(.e-overlay)[title]")).firstElementChild.removeAttribute("tabindex"),t.firstElementChild.focus())}},lqe.prototype.onKeyDown=function(e){"html-source"===e.event.action&&(e.event.preventDefault(),this.sourceCode(e),e.callBack({requestType:"SourceCode",editorMode:"HTML",event:e.event}))},lqe.prototype.sourceCode=function(n){var o=this;this.parent.notify(vWe,{}),this.parent.isBlur=!1,this.parent.trigger(O4e,{requestType:"SourceCode",targetItem:"SourceCode",args:n,cancel:!1},function(e){var t,i;e.cancel||(e=ct("."+r8e,o.parent.element),o.contentModule=o.rendererFactory.getRenderer(q3e.Content),t=o.parent.inputElement.getBoundingClientRect().height,o.parent.rootContainer.classList.add("e-source-code-enabled"),o.parent.notify(_4e,{targetItem:"SourceCode",updateItem:"Preview",baseToolbar:o.parent.getBaseToolbarObject()}),je(o.previewElement)&&(o.previewElement=o.getSourceCode()),o.parent.inputElement.innerHTML=Y6e(o.replaceAmpersand(o.parent.inputElement.innerHTML),o.parent.editorMode),i=void o.parent.updateValueData(),je(o.parent.element.querySelector("#"+o.parent.getID()+"_source-view"))?i=o.parent.createElement("div",{className:"e-source-content",id:o.parent.getID()+"_source-view",attrs:{style:"height:"+t+"px"}}):(i=o.parent.element.querySelector("#"+o.parent.getID()+"_source-view")).style.height=t+"px",i.appendChild(o.previewElement),o.parent.rootContainer.appendChild(i),o.getPanel().value=Y6e(o.getTextAreaValue(),o.parent.editorMode),o.parent.isBlur=!1,o.parent.disableToolbarItem(o.parent.toolbarSettings.items),o.parent.enableToolbarItem("SourceCode"),o.parent.getToolbar()&&q([o.parent.getToolbar()],[F8e]),q(e,[B8e]),o.wireEvent(o.previewElement),o.unWireBaseKeyDown(),o.previewElement.focus(),o.parent.inputElement.innerHTML=Y6e(o.replaceAmpersand(o.parent.inputElement.innerHTML),o.parent.editorMode),o.parent.updateValue(),o.parent.trigger(N4e,{requestType:"SourceCode",targetItem:"SourceCode",args:n}),o.parent.invokeChangeEvent(),!je(o.parent.saveInterval)&&0<o.parent.saveInterval&&o.parent.autoSaveOnIdle&&(o.codeViewTimeInterval=setInterval(function(){o.parent.notify(CWe,{})},o.parent.saveInterval)))})},lqe.prototype.updateSourceCode=function(i){var n=this;this.parent.isBlur=!1,this.parent.trigger(O4e,{requestType:"Preview",targetItem:"Preview",args:i,cancel:!1},function(e){var t;e.cancel||(n.parent.rootContainer.classList.remove("e-source-code-enabled"),e=n.getPanel(),n.parent.notify(_4e,{targetItem:"Preview",updateItem:"SourceCode",baseToolbar:n.parent.getBaseToolbarObject()}),je(e)||(e.value=G6e(n.replaceAmpersand(e.value),n.parent.editorMode)),t=void 0,t=null===(e=n.parent.serializeValue(e.value))||""===e?"DIV"===n.parent.enterKey?"<div><br/></div>":"BR"===n.parent.enterKey?"<br/>":"<p><br/></p>":e,n.contentModule.getEditPanel().innerHTML=G6e(n.replaceAmpersand(t),n.parent.editorMode),n.parent.isBlur=!1,n.parent.enableToolbarItem(n.parent.toolbarSettings.items),n.parent.getToolbar()&&q([n.parent.getToolbar()],[F8e]),n.unWireEvent(),n.wireBaseKeyDown(),n.contentModule.getEditPanel().focus(),n.parent.updateValue(),n.parent.trigger(N4e,{requestType:"Preview",targetItem:"Preview",args:i}),n.parent.formatter.enableUndo(n.parent),n.parent.addAudioVideoWrapper(),clearTimeout(n.codeViewTimeInterval),n.parent.invokeChangeEvent(),n.parent.notify(K3e,{}))})},lqe.prototype.replaceAmpersand=function(n){var o=this;return"HTML"===this.parent.editorMode&&["times","divide","ne"].forEach(function(e){var t,i=new RegExp("&(amp;)*("+e+")","g");n=o.parent.enableHtmlSanitizer?(t=o.parent.enableHtmlEncode?"&amp;amp;amp;amp;"+e:"&amp;amp;"+e,n.replace(i,t)):n.replace(i,"&amp;"+e)}),n},lqe.prototype.getTextAreaValue=function(){return"<p><br></p>"===this.contentModule.getEditPanel().innerHTML||"<div><br></div>"===this.contentModule.getEditPanel().innerHTML||"<br>"===this.contentModule.getEditPanel().innerHTML||1===this.contentModule.getEditPanel().childNodes.length&&"P"===this.contentModule.getEditPanel().childNodes[0].tagName&&7===this.contentModule.getEditPanel().innerHTML.length||"DIV"===this.contentModule.getEditPanel().childNodes[0].tagName&&11===this.contentModule.getEditPanel().innerHTML.length?"":this.parent.value},lqe.prototype.getPanel=function(){return this.parent.element&&this.parent.element.querySelector(".e-rte-srctextarea")},lqe.prototype.destroy=function(){je(this.parent)||this.removeEventListener()};var aqe=lqe;function lqe(e,t){this.parent=e;e=t;this.rendererFactory=e.getService("rendererFactory"),this.addEventListener()}dqe.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(y5e,this.renderDlgContent,this),this.parent.on($3e,this.afterRender,this),this.parent.on($5e,this.afterRender,this),this.parent.on(pWe,this.showDialog,this),this.parent.on(cWe,this.closeDialog,this),this.parent.on(v5e,this.docClick,this),this.parent.on(e4e,this.onIframeMouseDown,this),this.parent.on(s5e,this.editAreaClickHandler,this),this.parent.on(I5e,this.clearDialogObj,this),this.parent.on(b5e,this.onToolbarAction,this),this.parent.on(C4e,this.dropdownSelect,this),this.parent.on(u4e,this.keyDown,this),this.parent.on(p4e,this.tableModulekeyUp,this),this.parent.on(uWe,this.setCssClass,this),this.parent.on(t4e,this.destroy,this),this.parent.on(wWe,this.afterKeyDown,this),this.parent.on(T5e,this.hideTableQuickToolbar,this))},dqe.prototype.removeEventListener=function(){this.parent.off(y5e,this.renderDlgContent),this.parent.off($3e,this.afterRender),this.parent.off($5e,this.afterRender),this.parent.off(v5e,this.docClick),this.parent.off(e4e,this.onIframeMouseDown),this.parent.off(pWe,this.showDialog),this.parent.off(cWe,this.closeDialog),this.parent.off(s5e,this.editAreaClickHandler),this.parent.off(I5e,this.clearDialogObj),this.parent.off(b5e,this.onToolbarAction),this.parent.off(C4e,this.dropdownSelect),this.parent.off(o5e,this.cellSelect),this.parent.off(T5e,this.hideTableQuickToolbar),this.parent.off(u4e,this.keyDown),this.parent.off(p4e,this.tableModulekeyUp),this.parent.off(uWe,this.setCssClass),this.parent.off(t4e,this.destroy),this.parent.off(wWe,this.afterKeyDown),!F.isDevice&&this.parent.tableSettings.resize&&(E.remove(this.contentModule.getEditPanel(),"mouseover",this.resizeHelper),E.remove(this.contentModule.getEditPanel(),F.touchStartEvent,this.resizeStart))},dqe.prototype.updateCss=function(e,t){e&&t.cssClass&&(je(t.oldCssClass)?e.setProperties({cssClass:(e.cssClass+" "+t.cssClass).trim()}):e.setProperties({cssClass:(e.cssClass.replace(t.oldCssClass,"").trim()+" "+t.cssClass).trim()}))},dqe.prototype.setCssClass=function(e){this.popupObj&&e.cssClass&&(je(e.oldCssClass)||YUe([this.popupObj.element],e.oldCssClass),U([this.popupObj.element],e.cssClass)),this.updateCss(this.createTableButton,e),this.updateCss(this.editdlgObj,e);for(var t=[this.columnTextBox,this.rowTextBox,this.tableWidthNum,this.tableCellPadding,this.tableCellSpacing],i=0;i<t.length;i++)this.updateCss(t[i],e)},dqe.prototype.afterRender=function(){je(this.contentModule)&&(this.contentModule=this.rendererFactory.getRenderer(q3e.Content),this.parent.on(o5e,this.cellSelect,this),this.parent.tableSettings.resize&&E.add(this.parent.contentModule.getEditPanel(),F.touchStartEvent,this.resizeStart,this),!F.isDevice)&&this.parent.tableSettings.resize&&E.add(this.contentModule.getEditPanel(),"mouseover",this.resizeHelper,this)},dqe.prototype.dropdownSelect=function(e){var t=e.item;if(document.body.contains(document.body.querySelector(".e-rte-quick-toolbar"))&&"Table"===t.command){var i=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),n={args:e,selection:this.parent.formatter.editorManager.nodeSelection.save(i,this.contentModule.getDocument()),selectParent:this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(i)};switch(t.subCommand){case"InsertRowBefore":case"InsertRowAfter":this.addRow(n.selection,e);break;case"InsertColumnLeft":case"InsertColumnRight":this.addColumn(n.selection,e);break;case"DeleteColumn":case"DeleteRow":this.removeRowColumn(n.selection,e);break;case"AlignTop":case"AlignMiddle":case"AlignBottom":this.verticalAlign(n,e);break;case"Dashed":case"Alternate":case"Custom":this.tableStyles(n,e);break;case"Merge":case"VerticalSplit":case"HorizontalSplit":this.UpdateCells(n.selection,e)}}},dqe.prototype.UpdateCells=function(e,t){this.parent.formatter.process(this.parent,t,t,{selection:e,subCommand:t.item.subCommand}),this.hideTableQuickToolbar()},dqe.prototype.keyDown=function(e){var t,i=e.args;switch(i.action){case"escape":break;case"insert-table":"HTML"===this.parent.editorMode?this.openDialog(!0,e):"Markdown"===this.parent.editorMode&&this.parent.formatter.process(this.parent,null,i),i.preventDefault()}if(!je(this.parent.formatter.editorManager.nodeSelection)&&this.contentModule&&"KeyK"!==i.code){var n=void 0,o=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),r=this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(o)[0];if(r=r&&"TD"!==r.tagName&&"TH"!==r.tagName?r.parentElement:r,(8===i.keyCode||46===i.keyCode||i.ctrlKey&&88===i.keyCode)&&(r&&"TBODY"===r.tagName?(!je(this.parent.formatter.editorManager.nodeSelection)&&this.contentModule&&(n=this.parent.formatter.editorManager.nodeSelection.save(o,this.contentModule.getDocument())),i.preventDefault(),this.removeTable(n,i,!0)):r&&0<r.querySelectorAll("table").length&&(this.removeResizeElement(),this.hideTableQuickToolbar())),(r=r&&"TD"!==r.tagName&&"TH"!==r.tagName?!je(s=z(r,"td"))&&this.parent.inputElement.contains(s)?s:r:r)&&("TD"===r.tagName||"TH"===r.tagName)){var s=this.contentModule.getEditPanel().querySelectorAll(".e-cell-select-end");if(!je(this.activeCell)&&this.activeCell===r||je(s)||0!==s.length||(this.activeCell=r),!je(this.parent.formatter.editorManager.nodeSelection)&&this.contentModule&&(n=this.parent.formatter.editorManager.nodeSelection.save(o,this.contentModule.getDocument())),!i.shiftKey||i.shiftKey&&9===i.keyCode)switch(i.keyCode){case 9:case 37:case 39:this.tabSelection(i,n,r);break;case 40:case 38:this.tableArrowNavigation(i,n,r)}}}!i.shiftKey||39!==i.keyCode&&37!==i.keyCode&&38!==i.keyCode&&40!==i.keyCode||(this.keyDownEventInstance=i,E.add(this.parent.contentModule.getDocument(),"selectionchange",this.tableCellsKeyboardSelection,this)),i.ctrlKey&&"a"===i.key&&this.handleSelectAll(),("Delete"===i.code&&46===i.which||"Backspace"===i.code&&8===i.which)&&"HTML"===this.parent.editorMode?(o=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument())).startContainer.nodeType===Node.ELEMENT_NODE&&"DIV"===o.startContainer.nodeName&&o.startContainer.classList.contains("e-table-fake-selection")?(this.deleteTable(),i.preventDefault()):(t="Delete"===i.code&&46===i.which?this.getAdjacentTableElement(o,!0):this.getAdjacentTableElement(o,!1))&&(this.updateTableSelection(t),i.preventDefault()):(s=i.shiftKey&&"Enter"===i.key,o=-1!==_Qe.indexOf(i.key),(s||o||i.key&&1===i.key.length)&&((t=this.parent.contentModule.getEditPanel().querySelector("table.e-cell-select"))&&(39===i.keyCode||37===i.keyCode?this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(),t,0):(s=t.querySelector("tr").cells[0],this.parent.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(),s,s,0,0))),this.removeTableSelection()))},dqe.prototype.tableCellsKeyboardSelection=function(e){E.remove(this.parent.contentModule.getDocument(),"selectionchange",this.tableCellsKeyboardSelection);var t,i,n,o=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),r=this.keyDownEventInstance,o=!(je(o)||je(o.commonAncestorContainer)||o.commonAncestorContainer.nodeType!==Node.ELEMENT_NODE||"TR"!==o.commonAncestorContainer.tagName&&"TBODY"!==o.commonAncestorContainer.tagName||je(this.activeCell)),s=this.contentModule.getEditPanel().querySelectorAll(".e-cell-select-end");!je(s)&&0<s.length&&(this.parent.formatter.editorManager.nodeSelection.Clear(this.parent.contentModule.getDocument()),this.parent.formatter.editorManager.nodeSelection.setSelectionText(this.parent.contentModule.getDocument(),s[0],s[0],0,0),this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),s[0],0)),(o||!je(s)&&0<s.length)&&(o=this.getCorrespondingColumns(),i=!je(s)&&0<s.length?s[0]:this.activeCell,t=(i=this.getCorrespondingIndex(i,o))[0],i=i[1],n=void 0,39===r.keyCode?i<o[0].length-1?n=o[t][i+1]:t<o.length-1?(n=o[t+1][i],0===s.length&&t<o.length-1&&(this.activeCell=o[t][0])):this.resetTableSelection():37===r.keyCode?0<i?n=o[t][i-1]:0<t?(n=o[t-1][i],0===s.length&&0<t&&(this.activeCell=o[t][o[t].length-1])):this.resetTableSelection():38===r.keyCode?0<t?n=o[t-1][i]:this.resetTableSelection():40===r.keyCode&&(t<o.length-1?n=o[t+1][i]:this.resetTableSelection()),n)&&this.parent.formatter.editorManager.observer.notify("TABLE_MOVE",{event:{target:n},selectNode:[this.activeCell]}),0<s.length&&(r.preventDefault(),e.preventDefault())},dqe.prototype.resetTableSelection=function(){var e=this.contentModule.getEditPanel().querySelectorAll(".e-cell-select-end");!je(e)&&0<e.length&&this.parent.formatter.editorManager.nodeSelection.setSelectionNode(this.parent.contentModule.getDocument(),this.curTable),this.activeCell=null,this.removeCellSelectClasses(),this.removeTableSelection()},dqe.prototype.getCorrespondingColumns=function(){for(var e=[],t=this.curTable.rows,i=0;i<=t.length-1;i++)for(var n=t[i],o=0,r=0;r<=n.children.length-1;r++){for(var s=n.children[r],a=s,l=parseInt(a.getAttribute("colspan"),10)||1,h=parseInt(a.getAttribute("rowspan"),10)||1,d=i;d<i+h;d++)for(var p=o;p<o+l;p++)e[d]||(e[d]=[]),e[d][p]?o++:e[d][p]=s;o+=0}return e},dqe.prototype.getCorrespondingIndex=function(e,t){for(var i=0;i<t.length;i++)for(var n=0;n<t[i].length;n++)if(t[i][n]===e)return[i,n];return[]},dqe.prototype.getAdjacentTableElement=function(e,t){if(!e.collapsed||!t&&this.quickToolObj&&this.quickToolObj.tableQTBar&&document.body.contains(this.quickToolObj.tableQTBar.element))return null;var i=this.getNodeCollection(e),n=e.collapsed&&this.parent.contentModule.getEditPanel()===e.startContainer&&i&&0<i.length&&i[0]?i[0]:e.startContainer,o=this.getSelectedTableEle(i),i=this.getBrElement(e,i);if(n&&n.nodeType===Node.ELEMENT_NODE&&("IMG"===n.tagName||n.querySelector("img")||"AUDIO"===n.tagName||n.querySelector("audio")||"VIDEO"===n.tagName||n.querySelector("video")||n.querySelector(".e-video-clickelem"))){var r=this.contentModule.getDocument().createRange(),s=(r.collapse(!0),r.selectNodeContents(n),this.parent.formatter.editorManager.nodeSelection.getIndex(n));if(t&&r.startOffset>=e.startOffset||!t&&("IMG"!==n.tagName&&r.startOffset!==e.startOffset||"IMG"===n.tagName&&s!==e.startOffset))return null}if(n&&n.nodeType===Node.TEXT_NODE)if(t){if(e.endOffset!==e.endContainer.textContent.length&&e.endOffset!==e.endContainer.textContent.trim().length)return null}else if(0!==e.startOffset)return null;return(o=n&&n.nodeType===Node.ELEMENT_NODE&&"TABLE"===n.tagName?n:o)&&(r=this.parent.formatter.editorManager.nodeSelection.getIndex(o),e.startOffset===r&&t||e.startOffset!==r&&!t||(o=null)),(o=!o&&n?this.getAdjacentElementFromDom(n,i,t):o)&&o.nodeType===Node.ELEMENT_NODE&&"TABLE"===o.tagName?(this.setSelection(o,i),o):null},dqe.prototype.getAdjacentElementFromDom=function(e,t,i){for(var n,o=t||e.parentNode,r=e;o&&!n&&o.parentNode;){var s=Array.from(o.childNodes),a=s.indexOf(r);if(-1!==a&&(i&&a<s.length-1||!i&&0<a)?n=s[i?a+1:a-1]:(n=i?o.nextSibling:o.previousSibling,r=o),!t&&e.nodeType===Node.TEXT_NODE&&n&&n.tagName&&"BR"===n.tagName.toUpperCase()&&(t=r=o=n,n=null),t||!n||n.nodeType===Node.ELEMENT_NODE&&"TABLE"===n.tagName||je(n.textContent)||n.textContent.trim()||(r=o=n.parentNode,n=null),n&&n.tagName&&-1!==["UL","OL","LI"].indexOf(n.tagName.toUpperCase())&&!(n=this.getAdjacentElementFromList(n,i)))return null;o&&o.tagName&&"LI"===o.tagName.toUpperCase()&&!i&&(n=o),o=o.parentNode}return n},dqe.prototype.getAdjacentElementFromList=function(e,t){for(;e;){if(e.tagName&&-1===["UL","OL","LI"].indexOf(e.tagName.toUpperCase())){e.nodeType===Node.ELEMENT_NODE&&"TABLE"===e.tagName||(e=t?e.firstChild:e.lastChild);break}e=t?e.firstChild:e.lastChild}return e},dqe.prototype.getNodeCollection=function(e){var t,i=[];return e.collapsed&&this.parent.contentModule.getEditPanel()===e.startContainer&&0<e.startContainer.childNodes.length?(t=Math.max(0,Math.min(e.startContainer.childNodes.length-1,e.endOffset-1)),i.push(e.startContainer.childNodes[t])):i=this.parent.formatter.editorManager.nodeSelection.getNodeCollection(e),i},dqe.prototype.getSelectedTableEle=function(e){if(e&&0<e.length)for(var t=0,i=Array.from(e);t<i.length;t++){var n=i[t];if(n&&"TABLE"===n.tagName)return n}return null},dqe.prototype.getBrElement=function(e,t){return"BR"===e.endContainer.tagName?e.endContainer:1===t.length&&t[0]&&"BR"===t[0].tagName?t[0]:null},dqe.prototype.setSelection=function(e,t){e.classList.contains("e-cell-select")||(this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument()),t&&(t.parentNode&&1===t.parentNode.childNodes.length&&"BR"===t.parentNode.firstChild.nodeName?G(t.parentNode):G(t)),(e=this.parent.createElement("div",{className:"e-table-fake-selection"})).setAttribute("contenteditable","false"),this.contentModule.getEditPanel().appendChild(e),this.parent.formatter.editorManager.nodeSelection.setSelectionNode(this.contentModule.getDocument(),e))},dqe.prototype.removeAllFakeSelectionEles=function(){var e=this.parent.contentModule.getEditPanel().querySelectorAll(".e-table-fake-selection");e&&0<e.length&&e.forEach(function(e){G(e)})},dqe.prototype.deleteTable=function(){var e,t,i=this.parent.contentModule.getEditPanel().querySelector("table.e-cell-select");this.removeResizeElement(),i&&(t=e=document.createElement("br"),"DIV"===this.parent.enterKey?(t=document.createElement("div")).appendChild(e):"P"===this.parent.enterKey&&(t=document.createElement("p")).appendChild(e),i.parentNode.replaceChild(t,i),this.parent.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(),t,t,0,0),this.removeTableSelection())},dqe.prototype.removeTableSelection=function(){var e=this.parent.contentModule.getEditPanel().querySelector("table.e-cell-select");e&&YUe([e],eQe),this.removeAllFakeSelectionEles()},dqe.prototype.updateTableSelection=function(e){U([e],"e-cell-select")},dqe.prototype.handleSelectAll=function(){this.cancelResizeAction(),YUe(this.parent.inputElement.querySelectorAll("."+eQe),eQe),this.removeTableSelection()},dqe.prototype.tableModulekeyUp=function(e){var t,i;!je(this.parent.formatter.editorManager.nodeSelection)&&this.contentModule&&(t=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),((t=(t=(t=this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(t)[0])&&"TD"!==t.tagName&&"TH"!==t.tagName?t.parentElement:t)&&"TD"!==t.tagName&&"TH"!==t.tagName?!je(i=z(t,"td"))&&this.parent.inputElement.contains(i)?i:t:t)&&"TD"===t.tagName||"TH"===t.tagName)&&!t.classList.contains(eQe)&&t.classList.add(eQe),i=e.args,this.previousTableElement===t||je(this.previousTableElement)||i.shiftKey||39!==i.keyCode&&37!==i.keyCode&&38!==i.keyCode&&40!==i.keyCode||(YUe([this.previousTableElement],eQe),this.removeTableSelection()))},dqe.prototype.openDialog=function(e,t){var i,n;e||this.parent.contentModule.getEditPanel().focus(),"HTML"===this.parent.editorMode&&(n=this.parent.contentModule.getDocument(),i=this.parent.formatter.editorManager.nodeSelection.getRange(n),i=this.parent.formatter.editorManager.nodeSelection.save(i,n),n={originalEvent:t?t.args:{action:"insert-table"},item:{command:"Table",subCommand:"CreateTable"},name:e?null:"showDialog"},this.insertTableDialog({self:this,args:n,selection:i}))},dqe.prototype.showDialog=function(){this.openDialog(!1),this.setCssClass({cssClass:this.parent.getCssClass()})},dqe.prototype.closeDialog=function(){this.editdlgObj&&this.editdlgObj.hide({returnValue:!0})},dqe.prototype.onToolbarAction=function(e){switch(e.args.item.subCommand){case"TableHeader":this.tableHeader(e.selection,e.args);break;case"TableRemove":this.removeTable(e.selection,e.args);break;case"TableEditProperties":this.editTable(e)}},dqe.prototype.verticalAlign=function(e,t){e=z(e.selectParent[0],"th")||z(e.selectParent[0],"td");e&&this.parent.formatter.process(this.parent,t,t,{tableCell:e,subCommand:t.item.subCommand})},dqe.prototype.tableStyles=function(e,t){var i=t.item.subCommand,n=z(e.selectParent[0],"table");if("Dashed"===i&&(this.parent.element.classList.contains(nQe)?YUe([this.parent.element],nQe):this.parent.element.classList.add(nQe),n.classList.contains(nQe)?YUe([n],nQe):n.classList.add(nQe)),"Alternate"===i&&(this.parent.element.classList.contains(oQe)?YUe([this.parent.element],oQe):this.parent.element.classList.add(oQe),n.classList.contains(oQe)?YUe([n],oQe):n.classList.add(oQe)),e.args&&e.args.item.cssClass)for(var o=e.args.item.cssClass.split(" "),r=0;r<o.length;r++)n.classList.contains(o[r])?YUe([n],o[r]):n.classList.add(o[r]);this.parent.formatter.process(this.parent,t,t,{subCommand:t.item.subCommand}),this.parent.formatter.saveData(),this.hideTableQuickToolbar(),this.parent.formatter.editorManager.nodeSelection.restore()},dqe.prototype.insideList=function(e){for(var t=this.getBlockNodesInSelection(e),i=[],n=0;n<t.length;n++)"LI"===t[n].parentNode.tagName?i.push(t[n].parentNode):"LI"===t[n].tagName&&"P"!==t[n].childNodes[0].tagName&&"OL"!==t[n].childNodes[0].tagName&&"UL"!==t[n].childNodes[0].tagName&&i.push(t[n]);return 1<i.length||i.length&&0===e.startOffset&&0===e.endOffset?this.ensureInsideTableList=!0:this.ensureInsideTableList=!1},dqe.prototype.getBlockNodesInSelection=function(t){var e,i=["DIV","SECTION","HEADER","FOOTER","ARTICLE","NAV","P","H1","H2","H3","BLOCKQUOTE","LI","PRE","TD","TH","FORM","FIELDSET","LEGEND","LABEL","TEXTAREA"],n=new Set,o=this.contentModule.getDocument().createTreeWalker(t.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:function(e){return t.intersectsNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});if(t.collapsed)(e=this.getImmediateBlockNode(t.startContainer,i))&&n.add(e);else for(;o.nextNode();)(e=this.getImmediateBlockNode(o.currentNode,i))&&n.add(e);return Array.from(n)},dqe.prototype.getImmediateBlockNode=function(e,t){for(var i=e.nodeType===Node.TEXT_NODE?e.parentNode:e;i&&i.nodeType===Node.ELEMENT_NODE;){var n=i;if(-1<t.indexOf(n.tagName))return n;i=i.parentNode}return null},dqe.prototype.removeEmptyTextNodes=function(e){for(var t=e.childNodes,i=t.length-1;0<=i;i--){var n=t[i];n.nodeType===Node.TEXT_NODE&&""===n.nodeValue.trim()&&e.removeChild(n)}},dqe.prototype.tabSelection=function(e,t,i){for(var n=i.closest("table").querySelectorAll("thead, tbody, tr"),o=0;o<n.length;o++)this.removeEmptyTextNodes(n[o]);this.previousTableElement=i;var r=this.insideList(t.range);if(37!==e.keyCode&&39!==e.keyCode&&!r)if(e.preventDefault(),YUe([i],eQe),this.removeTableSelection(),e.shiftKey||37===e.keyCode){r=je(i.previousSibling)?je(z(i,"tr").previousSibling)?!je(z(i,"table").previousSibling)&&"td"===z(i,"table").previousSibling.nodeName.toLowerCase()?z(i,"table").previousSibling:i:z(i,"tr").previousSibling.childNodes[z(i,"tr").previousSibling.childNodes.length-1]:i.previousSibling;if(i===r&&0===i.cellIndex&&z(i,"table").tHead&&"TH"!==i.nodeName&&(r=(a=z(i,"table")).rows[0].cells[a.rows[0].cells.length-1]),!je(r=37===e.keyCode&&i===r?z(i,"table").previousSibling:r)&&"TABLE"===r.firstChild.nodeName){for(var s=r;!je(s.firstChild)&&"TABLE"===s.firstChild.nodeName&&0<s.firstChild.rows.length&&0<s.firstChild.rows[0].cells.length;)s=s.firstChild.rows[0].cells[0];r=s}r&&(""!==r.textContent.trim()&&z(r,"td")?t.setSelectionNode(this.contentModule.getDocument(),r):t.setSelectionText(this.contentModule.getDocument(),r,r,0,0))}else{var a=je(i.nextSibling)?je(z(i,"tr").nextSibling)?!je(z(i,"table").nextSibling)&&"td"===z(i,"table").nextSibling.nodeName.toLowerCase()?z(i,"table").nextSibling:i:z(i,"tr").nextSibling.childNodes[0]:i.nextSibling;i===a&&"TH"===i.nodeName&&(a=z(i,"table").rows[1].cells[0]),(a=39===e.keyCode&&i===a?z(i,"table").nextSibling:a)&&(""!==a.textContent.trim()&&z(a,"td")?t.setSelectionNode(this.contentModule.getDocument(),a):t.setSelectionText(this.contentModule.getDocument(),a,a,0,0)),i===a&&39!==e.keyCode&&a&&(i.classList.add(eQe),this.addRow(t,e,!0),YUe([i],eQe),this.removeTableSelection(),""!==(a=(a.parentElement.nextSibling||a.parentElement).firstChild).textContent.trim()&&z(a,"td")?t.setSelectionNode(this.contentModule.getDocument(),a):t.setSelectionText(this.contentModule.getDocument(),a,a,0,0))}},dqe.prototype.tableArrowNavigation=function(e,t,i){var n=t.range.startContainer;this.previousTableElement=i,40===e.keyCode&&3===n.nodeType&&(n.nextSibling&&"BR"===n.nextSibling.nodeName||n.parentNode&&"TD"!==n.parentNode.nodeName)||38===e.keyCode&&3===n.nodeType&&(n.previousSibling&&"BR"===n.previousSibling.nodeName||n.parentNode&&"TD"!==n.parentNode.nodeName)||(e.preventDefault(),YUe([i],eQe),this.removeTableSelection(),(i=40===e.keyCode?je(z(i,"tr").nextElementSibling)?z(i,"table").tHead&&"TH"===i.nodeName?z(i,"table").rows[1].cells[i.cellIndex]:je(z(i,"table").nextSibling)?i:z(i,"table").nextSibling:z(i,"tr").nextElementSibling.children[i.cellIndex]:je(z(i,"tr").previousElementSibling)?z(i,"table").tHead&&"TH"!==i.nodeName?z(i,"table").tHead.rows[0].cells[i.cellIndex]:je(z(i,"table").previousSibling)?i:z(i,"table").previousSibling:z(i,"tr").previousElementSibling.children[i.cellIndex])&&t.setSelectionText(this.contentModule.getDocument(),i,i,0,0))},dqe.prototype.hideTableQuickToolbar=function(){this.quickToolObj&&this.quickToolObj.tableQTBar&&document.body.contains(this.quickToolObj.tableQTBar.element)&&this.quickToolObj.tableQTBar.hidePopup()},dqe.prototype.tableHeader=function(e,t){this.parent.formatter.process(this.parent,t,t.originalEvent,{selection:e,subCommand:t.item.subCommand})},dqe.prototype.getAnchorNode=function(e){var t=z(e,"a");return t||e},dqe.prototype.editAreaClickHandler=function(e){var t,i,n,o,r,s,a,l,h;this.parent.readonly||!je(z(e.args.target,".e-img-caption"))||(t=e.args,i=this.parent.quickToolbarSettings.showOnRightClick,2===t.which)||i&&1===t.which||!i&&3===t.which||"HTML"===this.parent.editorMode&&this.parent.quickToolbarModule&&this.parent.quickToolbarModule.tableQTBar&&(this.quickToolObj=this.parent.quickToolbarModule,i=t.target,this.contentModule=this.rendererFactory.getRenderer(q3e.Content),this.quickToolObj.tableQTBar.element.classList.contains("e-rte-pop")||(n=this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument()),o=z(i,"table"),l=this.parent.getRange().startContainer.parentElement,h=this.parent.getRange().endContainer.parentElement,a=this.getAnchorNode(i),r=(new Date).getTime(),s="macOS"===this.parent.userAgentData.getPlatform()&&3===t.which,!(i&&"A"!==i.nodeName&&"A"!==a.nodeName&&"IMG"!==i.nodeName&&"VIDEO"!==i.nodeName&&!i.classList.contains(y8e)&&"AUDIO"!==i.nodeName&&(l===h||s)&&("TD"===i.nodeName||"TH"===i.nodeName||"TABLE"===i.nodeName||o&&this.parent.contentModule.getEditPanel().contains(o))&&(3!==n.startContainer.nodeType||n.collapsed||s)&&100<r-this.resizeEndTime)||s&&n.collapsed&&0!==n.startOffset||s&&"#text"===n.endContainer.nodeName?this.hideTableQuickToolbar():(a=this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument()),this.parent.formatter.editorManager.nodeSelection.save(a,this.contentModule.getDocument()),l=void this.parent.formatter.editorManager.nodeSelection.Clear(this.contentModule.getDocument()),h=void 0,h=F.isDevice&&e.args.touches?(l=this.parent.iframeSettings.enable?window.pageXOffset+this.parent.element.getBoundingClientRect().left+e.args.changedTouches[0].clientX:e.args.changedTouches[0].pageX,this.parent.iframeSettings.enable?window.pageYOffset+this.parent.element.getBoundingClientRect().top+(this.parent.inlineMode.enable?0:this.parent.toolbarModule.getToolbarHeight())+e.args.changedTouches[0].clientY:e.args.changedTouches[0].pageY):(l=this.parent.iframeSettings.enable?window.pageXOffset+this.parent.element.getBoundingClientRect().left+t.clientX:t.pageX,this.parent.iframeSettings.enable?window.pageYOffset+this.parent.element.getBoundingClientRect().top+this.parent.toolbarModule.getToolbarHeight()+t.clientY:t.pageY),this.quickToolObj.tableQTBar.showPopup(l,h,i),this.parent.formatter.editorManager.nodeSelection.restore())))},dqe.prototype.tableCellSelect=function(e){var e=e.target,n=Array.prototype.slice.call(e.parentElement.parentElement.children).indexOf(e.parentElement),o=Array.prototype.slice.call(e.parentElement.children).indexOf(e),e=this.dlgDiv.querySelectorAll(".e-rte-tablecell");Array.prototype.forEach.call(e,function(e){var t=Array.prototype.slice.call(e.parentElement.parentElement.children).indexOf(e.parentElement),i=Array.prototype.slice.call(e.parentElement.children).indexOf(e);YUe([e],"e-active"),t<=n&&i<=o&&U([e],"e-active")}),this.tblHeader.innerHTML=o+1+"x"+(n+1)},dqe.prototype.tableMouseUp=function(){this.unwireTableSelectionEvents(),this.isTableMoveActive=!1},dqe.prototype.tableMouseLeave=function(){F.isDevice||(this.unwireTableSelectionEvents(),this.isTableMoveActive=!1,this.resetTableSelection())},dqe.prototype.tableCellLeave=function(e){YUe(this.dlgDiv.querySelectorAll(".e-rte-tablecell"),"e-active"),U([this.dlgDiv.querySelector(".e-rte-tablecell")],"e-active"),this.tblHeader.innerHTML="1x1"},dqe.prototype.tableCellClick=function(e){var t=e.target,i=Array.prototype.slice.call(t.parentElement.parentElement.children).indexOf(t.parentElement)+1,t=Array.prototype.slice.call(t.parentElement.children).indexOf(t)+1;this.self.tableInsert(i,t,e,this)},dqe.prototype.tableInsert=function(e,t,i,n){var o=n.self||this,r=n.selection.range.startContainer,r=("P"!==r.nodeName||""!==r.textContent.trim()||0<r.childNodes.length||(r.innerHTML="<br />"),r.parentNode),r=("HTML"===o.parent.editorMode&&(o.parent.iframeSettings.enable&&!A6e(r.ownerDocument.querySelector("body"),"e-lib")||!o.parent.iframeSettings.enable&&je(z(r,"[id='"+o.contentModule.getPanel().id+"']")))&&(o.contentModule.getEditPanel().focus(),r=o.parent.formatter.editorManager.nodeSelection.getRange(o.contentModule.getDocument()),n.selection=o.parent.formatter.editorManager.nodeSelection.save(r,o.contentModule.getDocument())),{rows:e,columns:t,width:{minWidth:o.parent.tableSettings.minWidth,maxWidth:o.parent.tableSettings.maxWidth,width:o.parent.tableSettings.width},selection:n.selection});if(o.popupObj){for(var s=Array.prototype.slice.call(i.target.parentElement.parentElement.children),a=0;a<s.length;a++){E.remove(s[a],"mouseleave",this.tableCellLeave);for(var l=Array.prototype.slice.call(s[a].children),h=0;h<l.length;h++)E.remove(l[h],"mousemove",this.tableCellSelect),E.remove(l[h],"mouseup",this.tableCellClick)}o.popupObj.hide()}o.editdlgObj&&o.editdlgObj.hide();e=window.scrollX,t=window.scrollY,o.parent.formatter.process(o.parent,n.args,n.args.originalEvent,r),o.contentModule.getEditPanel().focus(),window.scrollTo(e,t),o.parent.on(o5e,o.cellSelect,o),i=o.parent.formatter.editorManager.nodeSelection.get(o.contentModule.getDocument());je(i)||je(i.anchorNode)||i.anchorNode.nodeType!==Node.ELEMENT_NODE||"TD"!==i.anchorNode.tagName&&"TH"!==i.anchorNode.tagName||(o.curTable=z(i.anchorNode,"table"),o.activeCell=i.anchorNode)},dqe.prototype.cellSelect=function(e){var t=z(i=e.args.target,"td,th"),i="TD"!==i.nodeName&&t&&this.parent.contentModule.getEditPanel().contains(t)?t:i;je(this.activeCell)||!e.args.shiftKey||je(i)||je(i.tagName)||"TD"!==i.tagName&&"TH"!==i.tagName||this.activeCell===i?(this.parent.quickToolbarSettings.showOnRightClick&&3===e.args.which&&i.classList.contains(eQe)||(this.isTableMoveActive&&(this.unwireTableSelectionEvents(),this.isTableMoveActive=!1),this.activeCell=null,this.heightcheck(),this.removeCellSelectClasses(),this.removeTableSelection()),!i||"TD"!==i.tagName&&"TH"!==i.tagName||(U([i],eQe),this.activeCell=i,this.curTable=this.curTable||z(i,"table"),this.wireTableSelectionEvents(),this.isTableMoveActive=!0,this.removeResizeElement(),this.helper&&this.contentModule.getEditPanel().contains(this.helper)&&G(this.helper))):(this.parent.formatter.editorManager.observer.notify("TABLE_MOVE",{event:e.args,selectNode:[this.activeCell]}),e.args.preventDefault())},dqe.prototype.heightcheck=function(){var e=this.parent.contentModule.getEditPanel().querySelector("td.e-cell-select");e&&e.querySelector("img")&&e.querySelector("img").style.height.includes("%")&&(e.style.height="inherit")},dqe.prototype.wireTableSelectionEvents=function(){E.add(this.curTable,"mousemove",this.tableMove,this),E.add(this.curTable,"mouseup",this.tableMouseUp,this),E.add(this.curTable,"mouseleave",this.tableMouseLeave,this)},dqe.prototype.unwireTableSelectionEvents=function(){E.remove(this.curTable,"mousemove",this.tableMove),E.remove(this.curTable,"mouseup",this.tableMouseUp),E.remove(this.curTable,"mouseleave",this.tableMouseLeave)},dqe.prototype.removeCellSelectClasses=function(){YUe(this.contentModule.getEditPanel().querySelectorAll("table td, table th"),tQe),YUe(this.contentModule.getEditPanel().querySelectorAll("table td, table th"),iQe),YUe(this.contentModule.getEditPanel().querySelectorAll("table td, table th"),eQe)},dqe.prototype.tableMove=function(e){this.parent.formatter.editorManager.observer.notify("TABLE_MOVE",{event:e,selectNode:[this.activeCell]})},dqe.prototype.resizeHelper=function(e){var t,i,n;this.parent.readonly||this.isTableMoveActive||e&&e.buttons&&0<e.buttons||(i=z(t=e.target||e.targetTouches[0].target,"table.e-rte-table, table.e-rte-paste-table, table.e-rte-custom-table"),(n=0<this.parent.contentModule.getEditPanel().querySelectorAll(".e-table-box.e-rbox-select, .e-table-rhelper.e-column-helper, .e-table-rhelper.e-row-helper").length)||je(this.curTable)||je(i)||i===this.curTable||!this.parent.contentModule.getEditPanel().contains(i)||(this.removeResizeElement(),this.removeHelper(e),this.cancelResizeAction()),n)||"TABLE"!==t.nodeName&&"TD"!==t.nodeName&&"TH"!==t.nodeName||(this.curTable=i&&this.parent.contentModule.getEditPanel().contains(i)&&("TD"===t.nodeName||"TH"===t.nodeName)?i:t,this.removeResizeElement(),this.tableResizeEleCreation(this.curTable,e))},dqe.prototype.tableResizeEleCreation=function(e,t){this.parent.preventDefaultResize(t);for(var i=this.calMaxCol(this.curTable),n=[],o=0;o<e.rows.length;o++)for(var r=0;r<e.rows[o].cells.length;r++)if(!e.rows[o].cells[r].hasAttribute("rowspan")){n.push(Array.prototype.slice.call(e.rows[o].cells,0,e.rows[o].cells.length)[r]);break}for(var s=parseInt(getComputedStyle(e).height,10),a=parseInt(getComputedStyle(e).width,10),l=this.calcPos(e),o=0;i.length>=o;o++){var h=this.parent.createElement("span",{attrs:{"data-col":o.toString(),unselectable:"on",contenteditable:"false"}});h.classList.add(LQe,rQe),i.length===o?h.style.cssText="height: "+s+"px; width: 4px; top: "+l.top+"px; left:"+((i[o-1].classList.contains("e-multi-cells-select")?0:l.left)+this.calcPos(i[o-1]).left+i[o-1].offsetWidth-2)+"px;":h.style.cssText="height: "+s+"px; width: 4px; top: "+l.top+"px; left:"+((i[o].classList.contains("e-multi-cells-select")?0:l.left)+this.calcPos(i[o]).left-2)+"px;",this.contentModule.getEditPanel().appendChild(h)}for(o=0;o<n.length;o++){var d=this.parent.createElement("span",{attrs:{"data-row":o.toString(),unselectable:"on",contenteditable:"false"}}),p=(d.classList.add(LQe,sQe),je(e.getAttribute("cellspacing"))&&""===e.getAttribute("cellspacing")?this.calcPos(n[o]).left:0);d.style.cssText="width: "+a+"px; height: 4px; top: "+(this.calcPos(n[o]).top+(n[o].classList.contains("e-multi-cells-select")?0:l.top)+n[o].offsetHeight-2)+"px; left:"+(p+l.left)+"px;",this.contentModule.getEditPanel().appendChild(d)}t=this.parent.createElement("span",{className:aQe+this.parent.getCssClass(!0),attrs:{"data-col":i.length.toString(),unselectable:"on",contenteditable:"false"}});t.style.cssText="top: "+(l.top+s-4)+"px; left:"+(l.left+a-4)+"px;",F.isDevice&&t.classList.add("e-rmob"),this.contentModule.getEditPanel().appendChild(t)},dqe.prototype.removeResizeElement=function(){var e=this.parent.contentModule.getEditPanel().querySelectorAll(".e-column-resize, .e-row-resize, .e-table-box");if(0<e.length)for(var t=0;t<e.length;t++)G(e[t])},dqe.prototype.calcPos=function(e){for(var t={top:0,left:0},i=e.getBoundingClientRect(),n=e.ownerDocument,o=e.offsetParent||n.documentElement,r=!1;o&&(o===n.body||o===n.documentElement)&&"static"===o.style.position;)o=o.parentNode;return"TD"===o.nodeName&&"TABLE"===e.nodeName&&(o=z(o,".e-rte-content"),r=!0),o&&o!==e&&1===o.nodeType&&(t=o.getBoundingClientRect()),r?(r=!1,{top:this.parent.inputElement&&0<this.parent.inputElement.scrollTop?this.parent.inputElement.scrollTop+i.top-t.top:i.top-t.top,left:this.parent.inputElement&&0<this.parent.inputElement.scrollLeft?this.parent.inputElement.scrollLeft+i.left-t.left:i.left-t.left}):{top:e.offsetTop,left:e.offsetLeft}},dqe.prototype.getPointX=function(e){return(e.touches&&e.touches.length?e.touches[0]:e).pageX},dqe.prototype.getPointY=function(e){return(e.touches&&e.touches.length?e.touches[0]:e).pageY},dqe.prototype.resizeStart=function(e){var t=this;if(!this.parent.readonly){F.isDevice&&this.resizeHelper(e);var i=e.target;if(i.classList.contains(rQe)||i.classList.contains(sQe)||i.classList.contains(aQe)){if(this.resetResizeHelper(this.curTable),e.preventDefault(),this.parent.preventDefaultResize(e),YUe(this.curTable.querySelectorAll("td,th"),eQe),this.removeTableSelection(),this.pageX=this.getPointX(e),this.pageY=this.getPointY(e),this.resizeBtnInit(),this.hideTableQuickToolbar(),i.classList.contains(rQe)){if(this.resizeBtnStat.column=!0,parseInt(i.getAttribute("data-col"),10)===this.calMaxCol(this.curTable).length)this.currentColumnResize="last",this.colIndex=parseInt(i.getAttribute("data-col"),10)-1;else{if(0===parseInt(i.getAttribute("data-col"),10))this.currentColumnResize="first";else{this.currentColumnResize="middle";for(var n=this.curTable.rows[0].cells,o=0,r=0;r<n.length;r++)o+=n[r].colSpan;for(var s=new Array(o),a=Q("colgroup"),l=new Map,h=0;h<this.curTable.rows.length;h++)for(var d=0,p=0;p<this.curTable.rows[h].cells.length;p++){for(var c=1;c<this.curTable.rows[h].cells[p].rowSpan;c++)l.set(""+(h+c)+d,this.curTable.rows[h].cells[p]);var u=this.getCellIndex(l,h,p),u=(d<u&&(d=u),this.curTable.rows[h].cells[p].offsetWidth);(!s[d]||u<s[d])&&(s[d]=u),d+=1+this.curTable.rows[h].cells[p].colSpan-1}for(var g=0;g<s.length;g++)(r=Q("col")).appendChild(Q("br")),r.style.width=this.convertPixelToPercentage(s[g],parseInt(getComputedStyle(this.curTable).width,10))+"%",a.appendChild(r);this.curTable.insertBefore(a,this.curTable.firstChild);for(h=0;h<this.curTable.rows.length;h++)for(p=0;p<this.curTable.rows[h].cells.length;p++)this.curTable.rows[h].cells[p].style.width=""}this.colIndex=parseInt(i.getAttribute("data-col"),10)}this.columnEle=this.calMaxCol(this.curTable)[this.colIndex],this.moveEle=e.target,this.appendHelper()}i.classList.contains(sQe)&&(this.rowEle=this.curTable.rows[parseInt(i.getAttribute("data-row"),10)],this.resizeBtnStat.row=!0,this.appendHelper()),i.classList.contains(aQe)&&(this.resizeBtnStat.tableBox=!0),F.isDevice&&this.helper&&!this.helper.classList.contains("e-reicon")?(this.helper.classList.add("e-reicon"),E.add(document,F.touchStartEvent,this.removeHelper,this),E.add(this.helper,F.touchStartEvent,this.resizeStart,this)):this.parent.trigger(M4e,{event:e,requestType:"Table"},function(e){e.cancel&&t.cancelResizeAction()}),this.isResizeBind&&(E.add(this.contentModule.getDocument(),F.touchMoveEvent,this.resizing,this),E.add(this.contentModule.getDocument(),F.touchEndEvent,this.resizeEnd,this),this.isResizeBind=!1)}}},dqe.prototype.getCellIndex=function(e,t,i){var n=e.get(""+t+i);return n?this.getCellIndex(e,t,i+n.colSpan):i},dqe.prototype.removeHelper=function(e){!e.target.classList.contains("e-reicon")&&this.helper&&(E.remove(document,F.touchStartEvent,this.removeHelper),E.remove(this.helper,F.touchStartEvent,this.resizeStart),this.helper&&this.contentModule.getEditPanel().contains(this.helper)&&G(this.helper),this.pageX=null,this.helper=null)},dqe.prototype.appendHelper=function(){this.helper=this.parent.createElement("div",{className:"e-table-rhelper"+this.parent.getCssClass(!0)}),F.isDevice&&this.helper.classList.add("e-reicon"),this.contentModule.getEditPanel().appendChild(this.helper),this.setHelperHeight()},dqe.prototype.setHelperHeight=function(){var e=this.calcPos(this.curTable);this.resizeBtnStat.column?(this.helper.classList.add("e-column-helper"),this.helper.style.cssText="height: "+getComputedStyle(this.curTable).height+"; top: "+e.top+"px; left:"+(e.left+this.calcPos(this.columnEle).left+("last"===this.currentColumnResize?this.columnEle.offsetWidth:0)-1)+"px;"):(this.helper.classList.add("e-row-helper"),this.helper.style.cssText="width: "+getComputedStyle(this.curTable).width+"; top: "+(this.calcPos(this.rowEle).top+e.top+this.rowEle.offsetHeight-1)+"px; left:"+(this.calcPos(this.rowEle).left+e.left)+"px;")},dqe.prototype.updateHelper=function(){var e,t=this.calcPos(this.curTable);this.resizeBtnStat.column?(e=t.left+this.calcPos(this.columnEle).left+("last"===this.currentColumnResize?this.columnEle.offsetWidth:0)-1,this.helper.style.left=e+"px",this.helper.style.height=this.curTable.offsetHeight+"px"):(e=this.calcPos(this.rowEle).top+t.top+this.rowEle.offsetHeight-1,this.helper.style.top=e+"px")},dqe.prototype.calMaxCol=function(e){for(var t=e.rows[0].cells,i=0,n=0;n<t.length;n++)i+=t[n].colSpan;for(var o=new Array(i),r=new Map,s=0;s<e.rows.length;s++)for(var a=0,l=0;l<e.rows[s].cells.length;l++){for(var h=1;h<e.rows[s].cells[l].rowSpan;h++)r.set(""+(s+h)+a,e.rows[s].cells[l]);var d=this.getCellIndex(r,s,l),d=(a<d&&(a=d),e.rows[s].cells[l].offsetWidth);(!o[a]||d<o[a].offsetWidth)&&(o[a]=e.rows[s].cells[l]),a+=1+e.rows[s].cells[l].colSpan-1}return o},dqe.prototype.resizing=function(v){var b,w=this,e=this.getPointX(v),t=this.getPointY(v),C=this.parent.enableRtl?-(e-this.pageX):e-this.pageX,S=this.parent.enableRtl?-(t-this.pageY):t-this.pageY,A=(this.pageX=e,this.pageY=t,this.curTable.closest("td"));this.parent.trigger(k4e,{event:v,requestType:"table"},function(e){if(e.cancel)w.cancelResizeAction();else{var e=w.contentModule.getEditPanel().querySelector(".e-table-box"),t=parseInt(getComputedStyle(w.curTable).width,10),i=isNaN(parseInt(w.curTable.style.height,10))?parseInt(getComputedStyle(w.curTable).height,10):parseInt(w.curTable.style.height,10),n=+getComputedStyle(w.contentModule.getEditPanel()).paddingRight.match(/\d/g).join(""),n=w.contentModule.getEditPanel().offsetWidth-(w.contentModule.getEditPanel().offsetWidth-w.contentModule.getEditPanel().clientWidth)-2*n,o=void 0;if(o=je(w.curTable.parentElement.closest("table"))||je(w.curTable.closest("td"))||!w.contentModule.getEditPanel().contains(w.curTable.closest("td"))?n:(r=w.curTable.closest("td"),s=+getComputedStyle(r).paddingRight.match(/\d/g).join(""),r.offsetWidth-(r.offsetWidth-r.clientWidth)-2*s),w.resizeBtnStat.column){w.curTable.closest("li")&&(o=w.curTable.closest("li").offsetWidth);var r=w.curTable.querySelectorAll("colgroup > col"),s=void 0,s=""!==w.curTable.style.width&&w.curTable.style.width.includes("%")?parseFloat(w.curTable.style.width.split("%")[0]):w.getCurrentTableWidth(w.curTable.offsetWidth,w.parent.inputElement.offsetWidth),a=w.calMaxCol(w.curTable)[w.colIndex],a=w.getCurrentColWidth(a,t);if("first"===w.currentColumnResize){if(C-=.75,w.removeResizeElement(),A&&(b=w.curTable.getBoundingClientRect().right-w.calcPos(A).left,w.curTable.style.maxWidth=b+"px"),(0!==C&&5<a||C<0)&&s<=100&&w.convertPixelToPercentage(t-C,o)<=100){var l,h=w.findFirstLastColCells(w.curTable,!0),d=(w.curTable.style.width=100<w.convertPixelToPercentage(t-C,o)?"100%":w.convertPixelToPercentage(t-C,o)+"%",s-w.convertPixelToPercentage(t-C,o)),p=0;if(!(l=-1<w.curTable.style.width.indexOf("%"))&&w.curTable.offsetWidth>w.contentModule.getEditPanel().offsetWidth)return void(w.curTable.style.width=n+"px");if(l&&100<parseFloat(w.curTable.style.width.split("%")[0]))return void(w.curTable.style.width="100%");var c=(p=je(w.curTable.style.marginLeft)||""===w.curTable.style.marginLeft||je(c=w.curTable.style.marginLeft.match(/[-+]?\d*\.\d+|\d+/))?p:parseFloat(c[0]))+d;if(c&&100<c&&(c=100-parseFloat(w.curTable.style.width)),!w.curTable.classList.contains("e-rte-paste-table")&&c&&c<1)return w.curTable.style.marginLeft=null,void(w.curTable.style.width="100%");w.curTable.style.marginLeft="calc("+("100%"===w.curTable.style.width?0:c)+"%)";for(var u=0;u<h.length;u++){var g=w.getCurrentColWidth(h[u],t);h[u].style.width=g-d+"%"}}}else if("last"===w.currentColumnResize){if(C+=.75,w.removeResizeElement(),A&&(b=A.getBoundingClientRect().right-w.curTable.getBoundingClientRect().left,w.curTable.style.maxWidth=b+"px"),(0!==C&&5<a||0<C)&&s<=100&&w.convertPixelToPercentage(t+C,o)<=100)for(var m=w.findFirstLastColCells(w.curTable,!1),d=(w.curTable.style.width=100<w.convertPixelToPercentage(t+C,o)?"100%":w.convertPixelToPercentage(t+C,o)+"%",s-w.convertPixelToPercentage(t+C,o)),u=0;u<m.length;u++){g=w.getCurrentColWidth(m[u],t);m[u].style.width=g-d+"%"}}else{p=r[w.colIndex].offsetWidth-C,c=r[w.colIndex].offsetWidth+r[w.colIndex-1].offsetWidth;20<c-p&&20<p&&(r[w.colIndex-1].style.width=w.convertPixelToPercentage(c-(a=p),t)+"%",r[w.colIndex].style.width=w.convertPixelToPercentage(a,t)+"%")}w.updateHelper()}else if(w.resizeBtnStat.row){w.parent.preventDefaultResize(v);for(var f=[],y=w.curTable.querySelectorAll("tr"),u=0;u<y.length;u++)w.rowEle!==y[u]&&(f[u]=parseFloat(y[u].clientHeight.toString()));w.curTable.style.height=parseFloat(w.curTable.clientHeight.toString())+(0<S?0:S)+"px";for(u=0;u<y.length;u++)w.rowEle===y[u]?y[u].style.height=parseFloat(y[u].clientHeight.toString())+S+"px":y[u].style.height=f[u]+"px";je(e)||(e.style.cssText="top: "+(w.calcPos(w.curTable).top+i-4)+"px; left:"+(w.calcPos(w.curTable).left+t-4)+"px;"),w.updateHelper()}else w.resizeBtnStat.tableBox&&(A&&(s=w.curTable.getBoundingClientRect().left-A.getBoundingClientRect().left,b=Math.abs(s-A.getBoundingClientRect().width)-5,w.curTable.style.maxWidth=b+"px"),w.curTable.style.height=i+S+"px",je(e)||(e.classList.add("e-rbox-select"),e.style.cssText="top: "+(w.calcPos(w.curTable).top+parseInt(getComputedStyle(w.curTable).height,10)-4)+"px; left:"+(w.calcPos(w.curTable).left+t-4)+"px;"),w.curTable.closest("li")&&(o=w.curTable.closest("li").offsetWidth),(l=-1<w.curTable.style.width.indexOf("%"))&&100<parseFloat(w.curTable.style.width.split("%")[0])?w.curTable.style.width="100%":!l&&w.curTable.offsetWidth>w.contentModule.getEditPanel().offsetWidth?w.curTable.style.width=n+"px":w.curTable.style.width=l?w.convertPixelToPercentage(t+C,o)+"%":t+C+"px")}})},dqe.prototype.getCurrentColWidth=function(e,t){return""!==e.style.width&&e.style.width.includes("%")?parseFloat(e.style.width.split("%")[0]):this.convertPixelToPercentage(e.offsetWidth,t)},dqe.prototype.getCurrentTableWidth=function(e,t){return e/t*100},dqe.prototype.findFirstLastColCells=function(e,r){for(var s=[],a=e.rows,l=[],t=0;t<a.length;t++)!function(t){for(var e=r?0:a[t].cells.length-1,i=a[t].cells[e],n=1;n<i.rowSpan;n++)l.push(t+n+"-"+e);var o=t+"-"+e;(0===l.length||r&&-1===l.indexOf(o)||!r&&-1===l.indexOf(o)&&l.every(function(e){return e.split("-")[0]!==t.toString()}))&&s.push(i)}(t);return s},dqe.prototype.convertPixelToPercentage=function(e,t){return e/t*100},dqe.prototype.cancelResizeAction=function(){this.isResizeBind=!0,E.remove(this.contentModule.getDocument(),F.touchMoveEvent,this.resizing),E.remove(this.contentModule.getDocument(),F.touchEndEvent,this.resizeEnd),this.removeResizeElement()},dqe.prototype.resizeEnd=function(e){this.resizeBtnInit(),this.isResizeBind=!0,E.remove(this.contentModule.getDocument(),F.touchMoveEvent,this.resizing),E.remove(this.contentModule.getDocument(),F.touchEndEvent,this.resizeEnd),this.contentModule.getEditPanel().querySelector(".e-table-box")&&this.contentModule.getEditPanel().contains(this.contentModule.getEditPanel().querySelector(".e-table-box"))&&this.removeResizeElement(),this.helper&&this.contentModule.getEditPanel().contains(this.helper)&&(G(this.helper),this.helper=null),this.resetResizeHelper(this.curTable),this.pageX=null,this.pageY=null,this.moveEle=null;for(var t=this.curTable.querySelectorAll("tr"),i=[],n=0;n<t.length;n++){var o=parseFloat(t[n].clientHeight.toString())/parseFloat(this.curTable.clientHeight.toString())*100;i[n]=o}for(n=0;n<t.length;n++)"THEAD"===t[n].parentElement.nodeName&&(t[n].parentElement.style.height=i[n]+"%"),t[n].style.height=i[n]+"%";this.parent.trigger(P4e,{event:e,requestType:"table"}),this.parent.formatter.saveData(),this.resizeEndTime=(new Date).getTime()},dqe.prototype.resetResizeHelper=function(e){var t=this.parent.element.querySelectorAll(".e-table-rhelper.e-column-helper"),t=(Array.from(t).forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),this.parent.element.querySelectorAll(".e-table-rhelper.e-row-helper")),t=(Array.from(t).forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),0===parseInt(e.style.width,10)&&(e.style.width=e.offsetWidth+"px"),e.querySelector("colgroup"));if(t){for(var i=0;i<e.rows.length;i++)for(var n=0;n<e.rows[i].cells.length;n++){var o=this.convertPixelToPercentage(e.rows[i].cells[n].offsetWidth,parseInt(getComputedStyle(e).width,10))+"%";e.rows[i].cells[n].style.width=o}e.removeChild(t)}},dqe.prototype.resizeBtnInit=function(){return this.resizeBtnStat={column:!1,row:!1,tableBox:!1}},dqe.prototype.addRow=function(e,t,i){i&&(n={item:{command:"Table",subCommand:"InsertRowAfter"}});var n,e={selection:e,subCommand:(i?n:t).item.subCommand};this.parent.formatter.process(this.parent,i?n:t,t,e)},dqe.prototype.addColumn=function(e,t){this.parent.formatter.process(this.parent,t,t,{selection:e,width:this.parent.tableSettings.width,subCommand:t.item.subCommand})},dqe.prototype.removeRowColumn=function(e,t){this.parent.formatter.process(this.parent,t,t,{selection:e,subCommand:t.item.subCommand}),this.hideTableQuickToolbar()},dqe.prototype.removeTable=function(e,t,i){i&&(n={item:{command:"Table",subCommand:"TableRemove"}});var n,e={selection:e,subCommand:(i?n:t).item.subCommand};this.parent.formatter.process(this.parent,i?n:t,t.originalEvent,e),this.contentModule.getEditPanel().focus(),null!==this.parent.inputElement.innerHTML&&""!==this.parent.inputElement.innerHTML||("DIV"===this.parent.enterKey?this.contentModule.getEditPanel().innerHTML="<div><br/></div>":"BR"===this.parent.enterKey?this.contentModule.getEditPanel().innerHTML="<br/>":this.contentModule.getEditPanel().innerHTML="<p><br/></p>"),this.removeResizeElement(),this.hideTableQuickToolbar()},dqe.prototype.renderDlgContent=function(e){var t,i,n=this,o=e.args.originalEvent.target;F.isDevice||this.parent.inlineMode.enable||!je(z(o,".e-rte-text-popup"))?this.insertTableDialog(e):this.popupObj?this.popupObj.hide():(this.hideTableQuickToolbar(),o=this.l10n.getConstant("inserttablebtn"),this.dlgDiv=this.parent.createElement("div",{className:"e-rte-table-popup"+this.parent.getCssClass(!0),id:this.rteID+"_table"}),this.createTablePopupBoundFn=this.createTablePopupKeyDown.bind(this),this.dlgDiv.addEventListener("keydown",this.createTablePopupBoundFn),this.tblHeader=this.parent.createElement("div",{className:"e-rte-popup-header"+this.parent.getCssClass(!0)}),this.tblHeader.innerHTML="1X1",this.dlgDiv.appendChild(this.tblHeader),i=this.parent.createElement("div",{className:"e-rte-table-span"+this.parent.getCssClass(!0)}),this.drawTable(i,e),this.dlgDiv.appendChild(i),this.dlgDiv.appendChild(this.parent.createElement("span",{className:"e-span-border"+this.parent.getCssClass(!0)})),t=this.parent.createElement("button",{className:"e-insert-table-btn"+this.parent.getCssClass(!0),id:this.rteID+"_insertTable",attrs:{type:"button",tabindex:"0"}}),je(this.parent.getToolbarElement().querySelector(".e-expended-nav"))||this.parent.getToolbarElement().querySelector(".e-expended-nav").setAttribute("tabindex","1"),this.dlgDiv.appendChild(t),this.createTableButton=new zv({iconCss:"e-icons e-create-table",content:o,cssClass:"e-flat"+this.parent.getCssClass(!0),enableRtl:this.parent.enableRtl,locale:this.parent.locale}),this.createTableButton.isStringTemplate=!0,this.createTableButton.appendTo(t),E.add(t,"click",this.insertTableDialog,{self:this,args:e.args,selection:e.selection}),this.parent.getToolbar().parentElement.appendChild(this.dlgDiv),i=(i=e.args.originalEvent.target).classList.contains("e-toolbar-item")?i.firstChild:i.parentElement,this.popupObj=new Sv(this.dlgDiv,{targetType:"relative",relateTo:i,collision:{X:"fit",Y:"none"},offsetY:8,viewPortElement:this.parent.element,position:{X:"left",Y:"bottom"},enableRtl:this.parent.enableRtl,zIndex:10001,close:function(e){E.remove(t,"click",n.insertTableDialog),n.dlgDiv.removeEventListener("keydown",n.createTablePopupBoundFn),G(t),n.createTableButton&&!n.createTableButton.isDestroyed&&(n.createTableButton.destroy(),n.createTableButton.element=null,n.createTableButton=null),n.parent.isBlur=!1,n.popupObj.element.parentElement.style.zIndex="",n.popupObj.destroy(),G(n.popupObj.element),n.popupObj=null}}),U([this.popupObj.element],"e-popup-open"),this.popupObj.element.parentElement.style.zIndex="11",je(this.parent.cssClass)||U([this.popupObj.element],this.parent.getCssClass()),t.focus(),this.popupObj.refreshPosition(i))},dqe.prototype.onIframeMouseDown=function(){this.popupObj&&this.popupObj.hide(),this.parent.inlineMode.enable&&this.editdlgObj&&this.editdlgObj.hide(),je(this.parent)||je(this.parent.contentModule)||je(this.parent.contentModule.getEditPanel())||this.removeResizeElement()},dqe.prototype.docClick=function(e){var e=e.args.target,t=(e&&e.classList&&(this.popupObj&&!z(e,"[id='"+this.popupObj.element.id+"']")||this.editdlgObj&&!z(e,"#"+this.editdlgObj.element.id))&&!e.classList.contains("e-create-table")&&e.offsetParent&&!e.offsetParent.classList.contains("e-rte-backgroundcolor-dropdown")&&(this.popupObj&&this.popupObj.hide(),this.editdlgObj&&(this.parent.notify(SWe,{closedBy:"outside click"}),this.editdlgObj.hide()),this.parent.isBlur=!0,L6e(this.parent.element,"focusout")),z(e,"td")),t=!(!t||!this.parent.contentModule.getEditPanel().contains(t));!e||"TD"===e.tagName||"TH"===e.tagName||t||null!==z(e,".e-rte-quick-popup")||!e.offsetParent||e.offsetParent.classList.contains("e-quick-dropdown")||e.offsetParent.classList.contains("e-rte-backgroundcolor-dropdown")||z(e,".e-rte-dropdown-popup")||z(e,".e-rte-elements")||(e&&e.closest(".e-toolbar")||this.removeCellSelectClasses(),this.removeTableSelection(),F.isIE)||this.hideTableQuickToolbar(),!e||!e.classList||e.classList.contains(rQe)||e.classList.contains(sQe)||e.classList.contains(aQe)||this.removeResizeElement()},dqe.prototype.drawTable=function(e,t){for(var i,n,o=0;o<3;o++){i=this.parent.createElement("div",{className:"e-rte-table-row"+this.parent.getCssClass(!0),attrs:{"data-column":""+o}}),E.add(i,"mouseleave",this.tableCellLeave,this);for(var r=0;r<10;r++)n=this.parent.createElement("div",{className:"e-rte-tablecell e-default"+this.parent.getCssClass(!0),attrs:{"data-cell":""+r}}),i.appendChild(n),n.style.display="inline-block",0===r&&0===o&&U([n],"e-active"),E.add(n,"mousemove",this.tableCellSelect,this),E.add(n,"mouseup",this.tableCellClick,{self:this,args:t.args,selection:t.selection});e.appendChild(i)}},dqe.prototype.editTable=function(e){var t=this,i=(this.createDialog(e),this.tableDlgContent(e)),n=this.l10n.getConstant("dialogUpdate"),o=this.l10n.getConstant("dialogCancel"),r=this.l10n.getConstant("tableEditHeader");this.editdlgObj.setProperties({height:"initial",width:"290px",content:i,header:r,buttons:[{click:this.applyProperties.bind(this,e),buttonModel:{content:n,cssClass:"e-flat e-size-update"+this.parent.getCssClass(!0),isPrimary:!0}},{click:function(e){t.cancelDialog(e)},buttonModel:{cssClass:"e-flat e-cancel"+this.parent.getCssClass(!0),content:o}}],cssClass:this.editdlgObj.cssClass+" e-rte-edit-table-prop-dialog"}),this.editdlgObj.element.style.maxHeight="none",this.editdlgObj.content.querySelector("input").focus(),this.hideTableQuickToolbar()},dqe.prototype.insertTableDialog=function(e){var t=this.self||this,i=(t.popupObj&&t.popupObj.hide(),t.createDialog(e),t.tableCellDlgContent()),n=t.l10n.getConstant("dialogInsert"),o=t.l10n.getConstant("dialogCancel");je(t.editdlgObj)||(t.editdlgObj.setProperties({height:"initial",width:"290px",content:i,buttons:[{click:t.customTable.bind(this,e),buttonModel:{content:n,cssClass:"e-flat e-insert-table "+t.parent.cssClass,isPrimary:!0}},{click:function(e){t.cancelDialog(e)},buttonModel:{cssClass:"e-flat e-cancel "+t.parent.cssClass,content:o}}]}),je(t.parent.cssClass)||t.editdlgObj.setProperties({cssClass:t.parent.cssClass}),t.editdlgObj.element.style.maxHeight="none",t.editdlgObj.content.querySelector("input").focus())},dqe.prototype.tableCellDlgContent=function(){var e=this.l10n.getConstant("columns"),t=this.l10n.getConstant("rows"),i=this.parent.createElement("div",{className:"e-cell-wrap"+this.parent.getCssClass(!0)}),n=R6e('<div class="e-rte-field'+this.parent.getCssClass(!0)+'"><input type="text"  data-role ="none" id="tableColumn" class="e-table-column'+this.parent.getCssClass(!0)+'"/></div><div class="e-rte-field'+this.parent.getCssClass(!0)+'"><input type="text" data-role ="none" id="tableRow" class="e-table-row'+this.parent.getCssClass(!0)+'" /></div>');return i.appendChild(n),this.columnTextBox=new NL({format:"n0",min:1,value:3,placeholder:e,floatLabelType:"Auto",max:50,enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:this.parent.getCssClass()}),this.columnTextBox.isStringTemplate=!0,this.columnTextBox.appendTo(i.querySelector("#tableColumn")),this.rowTextBox=new NL({format:"n0",min:1,value:3,placeholder:t,floatLabelType:"Auto",max:1e3,enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:this.parent.getCssClass()}),this.rowTextBox.isStringTemplate=!0,this.rowTextBox.appendTo(i.querySelector("#tableRow")),i},dqe.prototype.clearDialogObj=function(){this.editdlgObj&&(this.editdlgObj.destroy(),G(this.editdlgObj.element),this.editdlgObj=null)},dqe.prototype.createDialog=function(e){var t,i,n,o=this;this.editdlgObj?this.editdlgObj.hide({returnValue:!0}):(t=this.parent.createElement("div",{className:"e-rte-edit-table"+this.parent.getCssClass(!0),id:this.rteID+"_tabledialog"}),this.parent.rootContainer.appendChild(t),n=this.l10n.getConstant("dialogInsert"),i=this.l10n.getConstant("dialogCancel"),n={header:this.l10n.getConstant("tabledialogHeader"),cssClass:L8e+this.parent.getCssClass(!0),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showCloseIcon:!0,closeOnEscape:!0,width:F.isDevice?"290px":"340px",height:"initial",position:{X:"center",Y:F.isDevice?"center":"top"},isModal:F.isDevice,buttons:[{buttonModel:{content:n,cssClass:"e-flat e-insert-table"+this.parent.getCssClass(!0),isPrimary:!0}},{click:function(e){o.cancelDialog(e)},buttonModel:{cssClass:"e-flat e-cancel"+this.parent.getCssClass(!0),content:i}}],target:F.isDevice?document.body:this.parent.element,animationSettings:{effect:"None"},close:function(e){o.parent.isBlur=!1,o.editdlgObj.destroy(),G(o.editdlgObj.element),o.dialogRenderObj.close(e),o.editdlgObj=null}},this.editdlgObj=this.dialogRenderObj.render(n),this.editdlgObj.appendTo(t),this.quickToolObj&&this.quickToolObj.inlineQTBar&&document.body.contains(this.quickToolObj.inlineQTBar.element)&&this.quickToolObj.inlineQTBar.hidePopup(),this.quickToolObj&&this.quickToolObj.textQTBar&&this.parent.element.ownerDocument.body.contains(this.quickToolObj.textQTBar.element)&&this.quickToolObj.textQTBar.hidePopup())},dqe.prototype.customTable=function(e,t){var i=this.self||this;i&&i.rowTextBox&&i.rowTextBox.value&&i.columnTextBox&&i.columnTextBox.value&&(e=F.isDevice||!je(e.args)&&!je(e.args.originalEvent)&&"insert-table"===e.args.originalEvent.action||i.parent.inlineMode.enable||!je(i.parent.quickToolbarSettings.text)&&!(e instanceof PointerEvent)?e:this,i.tableInsert(i.rowTextBox.value,i.columnTextBox.value,t,e))},dqe.prototype.cancelDialog=function(e){this.parent.isBlur=!1,this.editdlgObj.hide({returnValue:!0})},dqe.prototype.applyProperties=function(e,t){var i=this.editdlgObj.element;if(i&&e&&0<e.selectNode.length&&e.selectNode[0]){e=e.selectNode[0]&&3===e.selectNode[0].nodeType?e.selectNode[0].parentNode:e.selectNode[0],e=e?z(e,"table"):null;if(e){if(e.style.width=i.querySelector(".e-table-width")?i.querySelector(".e-table-width").value+"px":e.style.width,i.querySelector(".e-cell-padding")&&""!==i.querySelector(".e-cell-padding").value)for(var n=e.querySelectorAll("td"),o=0;o<n.length;o++){var r="",r=""===n[o].style.padding?n[o].getAttribute("style")+" padding:"+i.querySelector(".e-cell-padding").value+"px;":(n[o].style.padding=i.querySelector(".e-cell-padding").value+"px",n[o].getAttribute("style"));n[o].style.cssText=r}e.cellSpacing=i.querySelector(".e-cell-spacing")?i.querySelector(".e-cell-spacing").value:e.cellSpacing,(je(e.cellSpacing)||"0"===e.cellSpacing?YUe:U)([e],FQe),this.parent.formatter.saveData(),this.editdlgObj.hide({returnValue:!0})}}},dqe.prototype.tableDlgContent=function(e){var e=e.selectParent[0],t=this.l10n.getConstant("tableWidth"),i=this.l10n.getConstant("cellpadding"),n=this.l10n.getConstant("cellspacing"),o=this.parent.createElement("div",{className:"e-table-sizewrap"+this.parent.getCssClass(!0)}),r=z(e,"table").getClientRects()[0].width,s=z(e,"td").style.padding,e=z(e,"table").getAttribute("cellspacing"),a=R6e('<div class="e-rte-field'+this.parent.getCssClass(!0)+'"><input type="text" data-role ="none" id="tableWidth" class="e-table-width'+this.parent.getCssClass(!0)+'"  /></div><div class="e-rte-field'+this.parent.getCssClass(!0)+'"><input type="text" data-role ="none" id="cellPadding" class="e-cell-padding'+this.parent.getCssClass(!0)+'" /> </div><div class="e-rte-field'+this.parent.getCssClass(!0)+'"><input type="text" data-role ="none" id="cellSpacing" class="e-cell-spacing'+this.parent.getCssClass(!0)+'" /></div>');return o.appendChild(a),this.tableWidthNum=new NL({format:"n0",min:0,value:r,placeholder:t,floatLabelType:"Auto",enableRtl:this.parent.enableRtl,locale:this.parent.locale}),this.tableWidthNum.isStringTemplate=!0,this.tableWidthNum.appendTo(o.querySelector("#tableWidth")),this.tableCellPadding=new NL({format:"n0",min:0,value:""!==s?parseInt(s,null):0,placeholder:i,floatLabelType:"Auto",enableRtl:this.parent.enableRtl,locale:this.parent.locale}),this.tableCellPadding.isStringTemplate=!0,this.tableCellPadding.appendTo(o.querySelector("#cellPadding")),this.tableCellSpacing=new NL({format:"n0",min:0,value:""===e||je(e)?0:parseInt(e,null),placeholder:n,floatLabelType:"Auto",enableRtl:this.parent.enableRtl,locale:this.parent.locale}),this.tableCellSpacing.isStringTemplate=!0,this.tableCellSpacing.appendTo(o.querySelector("#cellSpacing")),o},dqe.prototype.destroy=function(){this.isDestroyed||(this.resizeIconPositionTime&&(clearTimeout(this.resizeIconPositionTime),this.resizeIconPositionTime=null),this.removeEventListener(),E.remove(this.parent.contentModule.getDocument(),"selectionchange",this.tableCellsKeyboardSelection),this.curTable&&E.remove(this.curTable,"mouseleave",this.tableMouseLeave),this.tableCellSpacing&&!this.tableCellSpacing.isDestroyed&&(this.tableCellSpacing.destroy(),this.tableCellSpacing=null),this.tableCellPadding&&!this.tableCellPadding.isDestroyed&&(this.tableCellPadding.destroy(),this.tableCellPadding=null),this.tableWidthNum&&!this.tableWidthNum.isDestroyed&&(this.tableWidthNum.destroy(),this.tableWidthNum=null),this.rowTextBox&&!this.rowTextBox.isDestroyed&&(this.rowTextBox.destroy(),this.rowTextBox=null),this.columnTextBox&&!this.columnTextBox.isDestroyed&&(this.columnTextBox.destroy(),this.columnTextBox=null),this.createTableButton&&!this.createTableButton.isDestroyed&&(this.createTableButton.destroy(),this.createTableButton=null),this.createTablePopupBoundFn=null,this.isDestroyed=!0)},dqe.prototype.getModuleName=function(){return"table"},dqe.prototype.afterKeyDown=function(){var e=this;this.curTable&&(this.resizeIconPositionTime=setTimeout(function(){e.updateResizeIconPosition()},1))},dqe.prototype.updateResizeIconPosition=function(){var e,t=this.parent.contentModule.getEditPanel().querySelector(".e-table-box");je(t)||(e=this.calcPos(this.curTable),t.style.cssText="top: "+(e.top+parseInt(getComputedStyle(this.curTable).height,10)-4)+"px; left:"+(e.left+parseInt(getComputedStyle(this.curTable).width,10)-4)+"px;")},dqe.prototype.createTablePopupKeyDown=function(e){var t;"Escape"===e.key&&(t=(e=At(e.target.closest(".e-rte-table-popup"),"popup")).relateTo,e.hide(),t.focus({preventScroll:!0}))};var hqe=dqe;function dqe(e,t){this.ensureInsideTableList=!0,this.pageX=null,this.pageY=null,this.moveEle=null,this.currentColumnResize="",this.resizeEndTime=0,this.isTableMoveActive=!1,this.isResizeBind=!0,this.parent=e,this.rteID=e.element.id,this.l10n=t.getService("rteLocale"),this.rendererFactory=t.getService("rendererFactory"),this.dialogRenderObj=t.getService("dialogRenderObject"),this.addEventListener(),this.isDestroyed=!1}cqe.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(t4e,this.removeEventListener,this),this.parent.on(SWe,this.documentClickClosedBy,this))},cqe.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(t4e,this.removeEventListener),this.parent.off(SWe,this.documentClickClosedBy))},cqe.prototype.render=function(e){return e.beforeOpen=this.beforeOpen.bind(this),e.open=this.open.bind(this),e.position={X:"center",Y:"string"===e.target||"BODY"!==e.target.nodeName||je(e.position)?this.getDialogPosition():e.position.Y},je(e.close)&&(e.close=this.close.bind(this)),e.beforeClose=this.beforeClose.bind(this),(e=new pS(e)).isStringTemplate=!0,e},cqe.prototype.beforeOpen=function(e){e.element.classList.contains("e-dialog")&&!je(z(e.target,"form"))&&(this.dialogEle=e.element,this.dialogEle.addEventListener("keydown",this.handleEnterKeyDown)),this.parent.trigger(x5e,e,this.beforeOpenCallback.bind(this,e))},cqe.prototype.handleEnterKeyDown=function(e){"Enter"===e.key&&e.preventDefault()},cqe.prototype.beforeOpenCallback=function(e){e.cancel&&this.parent.notify(I5e,null)},cqe.prototype.open=function(e){je(e.container.querySelector(".e-rte-file-manager-dialog"))||(e.preventFocus=!0),this.parent.trigger(E5e,e)},cqe.prototype.documentClickClosedBy=function(e){this.outsideClickClosedBy=e.closedBy},cqe.prototype.beforeClose=function(e){this.dialogEle&&this.dialogEle.removeEventListener("keydown",this.handleEnterKeyDown),e.closedBy="outside click"===this.outsideClickClosedBy?this.outsideClickClosedBy:e.closedBy,this.parent.trigger(D5e,e,function(e){e.cancel||e.container.classList.contains("e-popup-close")&&(e.cancel=!0)}),this.outsideClickClosedBy=""},cqe.prototype.getDialogPosition=function(){var e=this.parent.element.getBoundingClientRect().top;if(e<0){for(var t=0,i=this.parent.element;"BODY"!==i.nodeName;){var n=i.getBoundingClientRect().top;0<n&&(t=n),i=i.parentElement}return(e=Math.abs(e)+t).toString()}return"top"},cqe.prototype.close=function(e){this.parent.trigger(M5e,e)};var pqe=cqe;function cqe(e){this.parent=e,this.addEventListener()}uqe=function(e,t){return(uqe=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])}))(e,t)};var uqe,gqe,mJ=function(e,t){function i(){this.constructor=e}uqe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},mqe="\n    <!DOCTYPE html> \n    <html>\n         <head>\n            <meta charset='utf-8' /> \n            <style>"+'\n@charset "UTF-8";\n\n* {\n    box-sizing: border-box;\n}\n\nhtml {\n    height: auto;\n}\n\nhtml, body {\n    margin: 0;\n}\n\nbody {\n    color: #333;\n    word-wrap: break-word;\n}\n\n.e-content {\n    background: unset;\n    min-height: 100px;\n    outline: 0 solid transparent;\n    padding: 16px;\n    position: relative;\n    overflow-x: auto;\n    font-weight: normal;\n    line-height: 1.5;\n    font-size: 14px;\n    text-align: inherit;\n    font-family: "Roboto", "Segoe UI", "GeezaPro", "DejaVu Serif", "sans-serif", "-apple-system", "BlinkMacSystemFont";\n}\n\n.e-content p {\n    margin: 0 0 10px;\n    margin-bottom: 10px;\n}\n\n.e-content h1 {\n    font-size: 2.857em;\n    font-weight: 600;\n    line-height: 1.2;\n    margin: 10px 0;\n}\n\n.e-content h2 {\n    font-size: 2.285em;\n    font-weight: 600;\n    line-height: 1.2;\n    margin: 10px 0;\n}\n\n.e-content h3 {\n    font-size: 2em;\n    font-weight: 600;\n    line-height: 1.2;\n    margin: 10px 0;\n}\n\n.e-content h4 {\n    font-size: 1.714em;\n    font-weight: 600;\n    line-height: 1.2;\n    margin: 10px 0;\n}\n\n.e-content h5 {\n    font-size: 1.428em;\n    font-weight: 600;\n    line-height: 1.2;\n    margin: 10px 0;\n}\n\n.e-content h6 {\n    font-size: 1.142em;\n    font-weight: 600;\n    line-height: 1.5;\n    margin: 10px 0;\n}\n\n.e-content blockquote {\n    margin: 10px 0;\n    padding-left: 12px;\n    border-left: 2px solid #5c5c5c;\n}\n\n.e-rtl.e-content blockquote {\n    padding-left: 0;\n    padding-right: 12px;\n}\n\n.e-content pre {\n    border: 0;\n    border-radius: 0;\n    color: #333;\n    font-size: inherit;\n    line-height: inherit;\n    margin: 0 0 10px;\n    overflow: visible;\n    padding: 0;\n    white-space: pre-wrap;\n    word-break: inherit;\n    word-wrap: break-word;\n}\n\n.e-content code {\n    background: #9d9d9d26;\n    color: #ed484c;\n}\n\n.e-content strong,\n.e-content b {\n    font-weight: bold;\n}\n\n.e-content a {\n    text-decoration: none;\n    user-select: auto;\n}\n\n.e-content a:hover {\n    text-decoration: underline;\n}\n\n.e-content li {\n    margin-bottom: 10px;\n}\n\n.e-content li ol,\n.e-content li ul {\n    margin-block-start: 10px;\n}\n\n.e-content ul {\n    list-style-type: disc;\n}\n\n.e-content ul ul,\n.e-content ol ul {\n    list-style-type: circle;\n}\n\n.e-content ul ul ul,\n.e-content ol ul ul,\n.e-content ul ol ul,\n.e-content ol ol ul {\n    list-style-type: square;\n}\n\n.e-content p:last-child,\n.e-content pre:last-child,\n.e-content blockquote:last-child {\n    margin-bottom: 0;\n}\n\n.e-content h3 + h4,\n.e-content h4 + h5,\n.e-content h5 + h6 {\n    margin-top: 0.6em;\n}\n\n.e-content ul:last-child {\n    margin-bottom: 0;\n}\n\n.e-content table {\n    margin-bottom: 10px;\n    border-collapse: collapse;\n    empty-cells: show;\n}\n\n.e-content table.e-cell-select {\n    position: relative;\n}\n\n.e-content table.e-cell-select::after {\n    content: \'\';\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    border: 2px solid #4a90e2;\n    pointer-events: none;\n}\n\ntable .e-cell-select {\n    border: 1px double #4a90e2 !important;\n}\n\n.e-content table.e-rte-table th {\n    background-color: rgba(157, 157, 157, .15);\n}\n\n.e-rte-table td,\n.e-rte-table th {\n    border: 1px solid #BDBDBD;\n    height: 20px;\n    min-width: 20px;\n    padding: 2px 5px;\n}\n\n.e-rte-table td.e-cell-select.e-multi-cells-select,\n.e-rte-table th.e-cell-select.e-multi-cells-select {\n    position: relative;\n}\n\n.e-rte-table td.e-cell-select.e-multi-cells-select::after,\n.e-rte-table th.e-cell-select.e-multi-cells-select::after {\n    background-color: rgba(13, 110, 253, 0.08);\n    content: "";\n    position: absolute;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 100%;\n    bottom: 0;\n    pointer-events: none;\n    right: 0;\n}\n\ntable td.e-multi-cells-select ::selection,\ntable th.e-multi-cells-select ::selection {\n    background-color: transparent;\n}\n\ntd.e-multi-cells-select,\nth.e-multi-cells-select {\n    user-select: none !important;\n}\n\n.e-rte-table.e-dashed-border > tbody > tr > td,\n.e-rte-table.e-dashed-border > tbody > tr > th {\n    border-style: dashed;\n}\n\n.e-rte-table.e-alternate-border tbody tr:nth-child(2n) {\n    background-color: #F5F5F5;\n}\n\n.e-rte-image,\n.e-rte-audio,\n.e-rte-video  {\n    border: 0;\n    cursor: pointer;\n    display: block;\n    float: none;\n    margin: auto;\n    max-width: 100%;\n    position: relative;\n}\n\n.e-rte-image.e-imginline,\n.e-rte-audio.e-audio-inline,\n.e-rte-video.e-video-inline {\n    margin-left: 5px;\n    margin-right: 5px;\n    display: inline-block;\n    float: none;\n    max-width: 100%;\n    padding: 1px;\n    vertical-align: bottom;\n}\n\n.e-rte-image.e-imgcenter,\n.e-rte-video.e-video-center {\n    cursor: pointer;\n    display: block;\n    float: none;\n    margin: 5px auto;\n    max-width: 100%;\n    position: relative;\n}\n\n.e-rte-image.e-imgright,\n.e-rte-video.e-video-right {\n    float: right;\n    margin: 0 auto;\n    margin-left: 5px;\n    text-align: right;\n}\n\n.e-rte-image.e-imgleft,\n.e-rte-video.e-video-left {\n    float: left;\n    margin: 0 auto;\n    margin-right: 5px;\n    text-align: left;\n}\n\n.e-rte-img-caption {\n    display: inline-block;\n    margin: 5px auto;\n    max-width: 100%;\n    position: relative;\n}\n\n.e-rte-img-caption.e-caption-inline {\n    display: inline-block;\n    margin: 5px auto;\n    margin-left: 5px;\n    margin-right: 5px;\n    max-width: calc(100% - (2 * 5px));\n    position: relative;\n    text-align: center;\n    vertical-align: bottom;\n}\n\n.e-rte-img-caption.e-imgcenter {\n    display: contents;\n    margin-left: auto;\n    margin-right: auto;\n}\n\n.e-rte-img-caption.e-imgright {\n    display: contents;\n    margin-left: auto;\n    margin-right: 0;\n}\n\n.e-rte-img-caption.e-imgleft {\n    display: contents;\n    margin-left: 0;\n    margin-right: auto;\n}\n\n.e-img-caption.e-rte-img-caption.e-imgbreak {\n    display: contents;\n}\n\n.e-rte-img-caption .e-img-inner {\n    display: block;\n    font-size: 16px;\n    font-weight: initial;\n    margin: auto;\n    opacity: .9;\n    position: relative;\n    text-align: center;\n    width: 100%;\n}\n\n.e-img-wrap {\n    display: inline-block;\n    margin: auto;\n    padding: 0;\n    text-align: center;\n    width: 100%;\n}\n\n.e-imgleft,\n.e-video-left {\n    float: left;\n    margin: 0 5px 0 0;\n    text-align: left;\n}\n\n.e-imgright,\n.e-video-right {\n    float: right;\n    margin: 0 0 0 5px;\n    text-align: right;\n}\n\n.e-imgcenter,\n.e-video-center {\n    cursor: pointer;\n    display: block;\n    float: none;\n    height: auto;\n    margin: 5px auto;\n    max-width: 100%;\n    position: relative;\n}\n\n.e-control img:not(.e-resize) {\n    border: 2px solid transparent;\n    z-index: 1000\n}\n\n.e-imginline,\n.e-audio-inline,\n.e-video-inline {\n    display: inline-block;\n    float: none;\n    margin-left: 5px;\n    margin-right: 5px;\n    vertical-align: bottom;\n}\n\n.e-imgbreak,\n.e-audio-break,\n.e-video-break {\n    border: 0;\n    cursor: pointer;\n    display: block;\n    float: none;\n    margin: 5px auto;\n    max-width: 100%;\n    position: relative;\n}\n\n.e-rte-image.e-img-focus:not(.e-resize),\n.e-audio-focus:not(.e-resize),\n.e-video-focus:not(.e-resize) {\n    border: solid 2px #4a90e2;\n}\n\nimg.e-img-focus::selection,\naudio.e-audio-focus::selection,\n.e-video-focus::selection {\n    background: transparent;\n    color: transparent;\n}\n\nspan.e-rte-imageboxmark,\nspan.e-rte-videoboxmark {\n    width: 10px;\n    height: 10px;\n    position: absolute;\n    display: block;\n    background: #4a90e2;\n    border: 1px solid #fff;\n    z-index: 1000;\n}\n\n.e-mob-rte.e-mob-span span.e-rte-imageboxmark,\n.e-mob-rte.e-mob-span span.e-rte-videoboxmark {\n    background: #4a90e2;\n    border: 1px solid #fff;\n}\n\n.e-mob-rte span.e-rte-imageboxmark,\n.e-mob-rte span.e-rte-videoboxmark {\n    background: #fff;\n    border: 1px solid #4a90e2;\n    border-radius: 15px;\n    height: 20px;\n    width: 20px;\n}\n\n.e-mob-rte.e-mob-span span.e-rte-imageboxmark,\n.e-mob-rte.e-mob-span span.e-rte-videoboxmark {\n    background: #4a90e2;\n    border: 1px solid #fff;\n}\n\n.e-content img.e-resize,\n.e-content video.e-resize {\n    z-index: 1000;\n}\n\n.e-img-caption .e-img-inner {\n    outline: 0;\n}\n\n.e-rte-img-caption.e-imgleft .e-img-inner {\n    float: left;\n    text-align: left;\n}\n\n.e-rte-img-caption.e-imgright .e-img-inner {\n    float: right;\n    text-align: right;\n}\n\n.e-rte-img-caption.e-imgleft .e-img-wrap,\n.e-rte-img-caption.e-imgright .e-img-wrap {\n    display: contents;\n}\n\n.e-img-caption a:focus-visible {\n    outline: none;\n}\n\n.e-rte-img-caption .e-rte-image.e-imgright {\n    margin-left: auto;\n    margin-right: 0;\n}\n\n.e-rte-img-caption .e-rte-image.e-imgleft {\n    margin: 0;\n}\n\nspan.e-table-box {\n    cursor: nwse-resize;\n    display: block;\n    height: 10px;\n    position: absolute;\n    width: 10px;\n    background-color: #ffffff;\n    border: 1px solid #BDBDBD;\n}\n\nspan.e-table-box.e-rmob {\n    height: 14px;\n    width: 14px;\n    background-color: #BDBDBD;\n    border: 1px solid #BDBDBD;\n}\n\n.e-row-resize,\n.e-column-resize {\n    background-color: transparent;\n    background-repeat: repeat;\n    bottom: 0;\n    cursor: col-resize;\n    height: 1px;\n    overflow: visible;\n    position: absolute;\n    width: 1px;\n}\n\n.e-row-resize {\n    cursor: row-resize;\n    height: 1px;\n}\n\n.e-table-rhelper {\n    cursor: col-resize;\n    opacity: .87;\n    position: absolute;\n}\n\n.e-table-rhelper.e-column-helper {\n    width: 1px;\n}\n\n.e-table-rhelper.e-row-helper {\n    height: 1px;\n}\n\n.e-reicon::before {\n    border-bottom: 6px solid transparent;\n    border-right: 6px solid;\n    border-top: 6px solid transparent;\n    content: \'\';\n    display: block;\n    height: 0;\n    position: absolute;\n    right: 4px;\n    top: 4px;\n    width: 20px;\n}\n\n.e-reicon::after {\n    border-bottom: 6px solid transparent;\n    border-left: 6px solid;\n    border-top: 6px solid transparent;\n    content: \'\';\n    display: block;\n    height: 0;\n    left: 4px;\n    position: absolute;\n    top: 4px;\n    width: 20px;\n    z-index: 3;\n}\n\n.e-row-helper.e-reicon::after {\n    top: 10px;\n    transform: rotate(90deg);\n}\n\n.e-row-helper.e-reicon::before {\n    left: 4px;\n    top: -20px;\n    transform: rotate(90deg);\n}\n\n\n.e-table-rhelper {\n    background-color: #4a90e2;\n}\n\n.e-rtl {\n    direction: rtl;\n}\n\n.e-rte-placeholder::before {\n    content: attr(placeholder);\n    opacity: 0.54;\n    overflow: hidden;\n    padding-top: 16px;\n    position: absolute;\n    text-align: start;\n    top: 0;\n    z-index: 1;\n}\n\n.e-resize-enabled,\n.e-count-enabled {\n    padding-bottom: 0px;\n}\n'.replace(/[\n\t]/g,"")+"\n            </style>\n        </head>\n",fqe=(mJ(yqe,gqe=J6e),yqe.prototype.renderPanel=function(){var n,e=this.parent,t=V6e(e.value,e),t=mqe+('<body contenteditable="true">'+t+"</body></html>"),i=this.parent.createElement("iframe",{id:this.parent.getID()+"_rte-view",className:"e-rte-content",attrs:{srcdoc:t}}),o=(i.setAttribute("role","none"),this.setPanel(i),je(this.parent.iframeSettings.sandbox)||((o=this.parent.iframeSettings.sandbox.map(function(e){return e.toLocaleLowerCase().trim()}).join(" ")).includes("allow-same-origin")||(o+=" allow-same-origin"),i.setAttribute("sandbox",o.trim())),e.rootContainer.appendChild(i),i.contentDocument.body.setAttribute("aria-owns",this.parent.getID()),i.contentDocument.open(),t=this.setThemeColor(t,{color:"#333"}),i.contentDocument.write(t),i.contentDocument.close(),i.contentDocument.body);o.className="e-content","auto"===this.parent.height&&(o.style.overflowY="hidden"),je(this.parent.fontFamily.default)||(o.style.fontFamily=this.parent.fontFamily.default),je(this.parent.fontSize.default)||(o.style.fontSize=this.parent.fontSize.default),o.id=this.parent.getID()+"_rte-edit-view",e.enableRtl&&this.contentPanel.contentDocument.body.setAttribute("class","e-rtl"),!je(i.contentDocument.head)&&0<this.parent.iframeSettings.metaTags.length&&(n=i.contentDocument.head,this.parent.iframeSettings.metaTags.forEach(function(e){var t,i=document.createElement("meta");for(t in e)je(e[t])||i.setAttribute("httpEquiv"===t?"http-equiv":t,e[t]);n.appendChild(i)}))},yqe.prototype.setThemeColor=function(e,t){var i=getComputedStyle(this.parent.element,".e-richtexteditor").getPropertyValue("color");return e.replace(t.color,i)},yqe.prototype.getEditPanel=function(){var e=je(this.contentPanel.contentDocument)?this.parent.inputElement:this.contentPanel.contentDocument.body;return e},yqe.prototype.getDocument=function(){return this.getEditPanel().ownerDocument},yqe);function yqe(){return null!==gqe&&gqe.apply(this,arguments)||this}bqe.prototype.renderPanel=function(){var e=this.parent,t=this.parent.createElement("div",{id:this.parent.getID()+"_view",className:"e-rte-content"});this.editableElement=this.parent.createElement("textarea",{className:"e-content",id:this.parent.getID()+"_editable-content",attrs:{"aria-labelledby":this.parent.getID()+"_view"}}),t.appendChild(this.editableElement),this.setPanel(t),e.rootContainer.appendChild(t)},bqe.prototype.getPanel=function(){return this.contentPanel},bqe.prototype.getEditPanel=function(){return this.editableElement},bqe.prototype.getText=function(){return this.getEditPanel().value},bqe.prototype.setPanel=function(e){this.contentPanel=e},bqe.prototype.getDocument=function(){return this.getEditPanel().ownerDocument};var vqe=bqe;function bqe(e){this.parent=e}Cqe.prototype.quickToolbarOpen=function(){var e=this.popupObj;this.parent.trigger(P5e,e)},Cqe.prototype.renderPopup=function(e){this.setPanel(e.element),this.renderPanel(),e.popupObj=new Sv(e.element,{targetType:"relative",relateTo:this.parent.element,open:this.quickToolbarOpen.bind(this)}),this.popupObj=e.popupObj,e.popupObj.hide()},Cqe.prototype.renderPanel=function(){this.getPanel().classList.add(YWe)},Cqe.prototype.getPanel=function(){return this.popupPanel},Cqe.prototype.setPanel=function(e){this.popupPanel=e};var wqe=Cqe;function Cqe(e){this.parent=e}var Sqe={bold:{command:"Style",subCommand:"Bold",value:"strong"},italic:{command:"Style",subCommand:"Italic",value:"em"},underline:{command:"Style",subCommand:"Underline",value:"span"},strikeThrough:{command:"Style",subCommand:"StrikeThrough",value:"span"},insertCode:{command:"Formats",subCommand:"Pre",value:"pre"},superscript:{command:"Effects",subCommand:"SuperScript",value:"sup"},subscript:{command:"Effects",subCommand:"SubScript",value:"sub"},uppercase:{command:"Casing",subCommand:"UpperCase"},lowercase:{command:"Casing",subCommand:"LowerCase"},fontColor:{command:"font",subCommand:"fontcolor",value:"#ff0000"},fontName:{command:"font",subCommand:"fontname",value:"Segoe UI"},fontSize:{command:"font",subCommand:"fontsize",value:"10pt"},backColor:{command:"font",subCommand:"backgroundcolor",value:"#ffff00"},justifyCenter:{command:"Alignments",subCommand:"JustifyCenter"},justifyFull:{command:"Alignments",subCommand:"JustifyFull"},justifyLeft:{command:"Alignments",subCommand:"JustifyLeft"},justifyRight:{command:"Alignments",subCommand:"JustifyRight"},undo:{command:"Actions",subCommand:"Undo"},redo:{command:"Actions",subCommand:"Redo"},createLink:{command:"Links",subCommand:"createLink"},editLink:{command:"Links",subCommand:"createLink"},createImage:{command:"Images",subCommand:"Images"},formatBlock:{command:"Formats",value:"P"},heading:{command:"Formats",value:"H1"},indent:{command:"Indents",subCommand:"Indent"},outdent:{command:"Indents",subCommand:"Outdent"},insertHTML:{command:"InsertHTML",subCommand:"InsertHTML",value:""},insertText:{command:"InsertText",subCommand:"InsertText",value:""},insertHorizontalRule:{command:"InsertHTML",subCommand:"InsertHTML",value:"<hr/>"},insertImage:{command:"Images",subCommand:"Image"},insertAudio:{command:"Audios",subCommand:"Audio"},insertVideo:{command:"Videos",subCommand:"Video"},editImage:{command:"Images",subCommand:"Image"},insertTable:{command:"Table",subCommand:"CreateTable"},insertBrOnReturn:{command:"InsertHTML",subCommand:"InsertHTML",value:"<br/>"},insertOrderedList:{command:"Lists",value:"OL"},insertUnorderedList:{command:"Lists",value:"UL"},insertParagraph:{command:"Formats",value:"P"},removeFormat:{command:"Clear",subCommand:"ClearFormat"},copyFormatPainter:{command:"FormatPainter",value:"format-copy"},applyFormatPainter:{command:"FormatPainter",value:"format-paste"},escapeFormatPainter:{command:"FormatPainter",value:"escape"},InlineCode:{command:"Style",subCommand:"inlinecode",value:"inlinecode"}},Aqe=(xqe.prototype.register=function(e,t){je(this.services[""+e])&&(this.services[""+e]=t)},xqe.prototype.getService=function(e){if(je(this.services[""+e]))throw"The service "+e+" is not registered";return this.services[""+e]},xqe.prototype.destroy=function(){this.services={}},xqe);function xqe(){this.services={}}Tqe.prototype.addRenderer=function(e,t){e=M(q3e,e);je(this.rendererMap[""+e])&&(this.rendererMap[""+e]=t)},Tqe.prototype.getRenderer=function(e){e=M(q3e,e);if(je(this.rendererMap[""+e]))throw"The renderer "+e+" is not found";return this.rendererMap[""+e]},Tqe.prototype.destroy=function(){this.rendererMap={}};var Iqe=Tqe;function Tqe(){this.rendererMap={}}Dqe.prototype.addEventListener=function(){this.parent.on(A4e,this.commandCallBack,this),this.parent.on(t4e,this.removeEventListener,this)},Dqe.prototype.commandCallBack=function(e){var t=!je(e.requestType)&&"FormatPainter"===e.requestType&&"format-copy"===e.action;je(e)||je(e.requestType)||"Undo"===e.requestType||"Redo"===e.requestType||t||this.parent.formatter.saveData(),this.parent.notify(n4e,{args:e}),this.parent.notify(n5e,{})},Dqe.prototype.removeEventListener=function(){this.parent.off(A4e,this.commandCallBack),this.parent.off(t4e,this.removeEventListener)};var Eqe=Dqe;function Dqe(e){this.parent=e,this.addEventListener()}Mqe=function(e,t){return(Mqe=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])}))(e,t)};var Mqe,kqe,d$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},k$=(function(e,t){function i(){this.constructor=e}Mqe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Pqe,kqe=n),d$([e(null)],Pqe.prototype,"downloadUrl",void 0),d$([e(null)],Pqe.prototype,"getImageUrl",void 0),d$([e(null)],Pqe.prototype,"uploadUrl",void 0),d$([e(null)],Pqe.prototype,"url",void 0),Pqe);function Pqe(){return null!==kqe&&kqe.apply(this,arguments)||this}Bqe=function(e,t){return(Bqe=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])}))(e,t)};var Bqe,Fqe,Oee=function(e,t){function i(){this.constructor=e}Bqe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},jee=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},nte=["NewFolder","Upload","Cut","Copy","Paste","Delete","Download","Rename","SortBy","Refresh","Selection","View","Details"],z$=(Oee(Lqe,Fqe=n),jee([e(nte)],Lqe.prototype,"items",void 0),jee([e(!0)],Lqe.prototype,"visible",void 0),Lqe);function Lqe(){return null!==Fqe&&Fqe.apply(this,arguments)||this}Oee(Oqe,Rqe=n),jee([e("")],Oqe.prototype,"id",void 0),jee([e("")],Oqe.prototype,"text",void 0),jee([e("auto")],Oqe.prototype,"width",void 0),jee([e("")],Oqe.prototype,"cssClass",void 0),jee([e(!1)],Oqe.prototype,"showAlwaysInPopup",void 0),jee([e(!1)],Oqe.prototype,"disabled",void 0),jee([e("")],Oqe.prototype,"prefixIcon",void 0),jee([e("")],Oqe.prototype,"suffixIcon",void 0),jee([e(!0)],Oqe.prototype,"visible",void 0),jee([e("None")],Oqe.prototype,"overflow",void 0),jee([e("")],Oqe.prototype,"template",void 0),jee([e("Button")],Oqe.prototype,"type",void 0),jee([e("Both")],Oqe.prototype,"showTextOn",void 0),jee([e(null)],Oqe.prototype,"htmlAttributes",void 0),jee([e("")],Oqe.prototype,"tooltipText",void 0),jee([e("Left")],Oqe.prototype,"align",void 0),jee([e(-1)],Oqe.prototype,"tabIndex",void 0),jee([e()],Oqe.prototype,"name",void 0);var Rqe,Ode=Oqe;function Oqe(){return null!==Rqe&&Rqe.apply(this,arguments)||this}Nqe=function(e,t){return(Nqe=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])}))(e,t)};var Nqe,Vqe,gRe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},P2=(function(e,t){function i(){this.constructor=e}Nqe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(_qe,Vqe=n),gRe([e(!0)],_qe.prototype,"allowSearchOnTyping",void 0),gRe([e("contains")],_qe.prototype,"filterType",void 0),gRe([e(!0)],_qe.prototype,"ignoreCase",void 0),gRe([e(null)],_qe.prototype,"placeholder",void 0),_qe);function _qe(){return null!==Vqe&&Vqe.apply(this,arguments)||this}Hqe=function(e,t){return(Hqe=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])}))(e,t)};var Hqe,zqe,qo=function(e,t){function i(){this.constructor=e}Hqe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},d2=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},D2=[{field:"name",headerText:"Name",minWidth:120,template:'<span class="e-fe-text">${name}</span>',customAttributes:{class:"e-fe-grid-name"}},{field:"_fm_modified",headerText:"DateModified",type:"dateTime",format:"MMMM dd, yyyy HH:mm",minWidth:120,width:"190"},{field:"size",headerText:"Size",minWidth:90,width:"110",template:ao(function(e){return'<span class="e-fe-size">'+e.size+"</span>"}),format:"n2"}],aN=(qo(jqe,zqe=n),d2([e(!0)],jqe.prototype,"columnResizing",void 0),d2([e(D2)],jqe.prototype,"columns",void 0),jqe);function jqe(){return null!==zqe&&zqe.apply(this,arguments)||this}Wqe=function(e,t){return(Wqe=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])}))(e,t)};var Wqe,Qqe,M$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Xo=["Open","|","Cut","Copy","|","Delete","Download","Rename","|","Details"],x$=["Open","|","Cut","Copy","Paste","|","Delete","Rename","Download","|","Details"],D$=["SortBy","View","Refresh","|","Paste","|","NewFolder","Upload","|","Details","|","SelectAll"],_$=(function(e,t){function i(){this.constructor=e}Wqe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Uqe,Qqe=n),M$([e(Xo)],Uqe.prototype,"file",void 0),M$([e(x$)],Uqe.prototype,"folder",void 0),M$([e(D$)],Uqe.prototype,"layout",void 0),M$([e(!0)],Uqe.prototype,"visible",void 0),Uqe);function Uqe(){return null!==Qqe&&Qqe.apply(this,arguments)||this}qqe=function(e,t){return(qqe=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])}))(e,t)};var qqe,Gqe,$$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},H$=(function(e,t){function i(){this.constructor=e}qqe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Yqe,Gqe=n),$$([e("650px")],Yqe.prototype,"maxWidth",void 0),$$([e("240px")],Yqe.prototype,"minWidth",void 0),$$([e(!0)],Yqe.prototype,"visible",void 0),$$([e("None")],Yqe.prototype,"sortOrder",void 0),Yqe);function Yqe(){return null!==Gqe&&Gqe.apply(this,arguments)||this}Xqe=function(e,t){return(Xqe=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])}))(e,t)};var Xqe,Kqe,wce=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},mJ=(function(e,t){function i(){this.constructor=e}Xqe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Jqe,Kqe=n),wce([e("")],Jqe.prototype,"allowedExtensions",void 0),wce([e(!0)],Jqe.prototype,"autoUpload",void 0),wce([e(!1)],Jqe.prototype,"autoClose",void 0),wce([e(!1)],Jqe.prototype,"directoryUpload",void 0),wce([e(0)],Jqe.prototype,"minFileSize",void 0),wce([e(3e7)],Jqe.prototype,"maxFileSize",void 0),wce([e(0)],Jqe.prototype,"chunkSize",void 0),Jqe);function Jqe(){return null!==Kqe&&Kqe.apply(this,arguments)||this}Zqe=function(e,t){return(Zqe=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])}))(e,t)};var Zqe,$qe,d$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Oee=(function(e,t){function i(){this.constructor=e}Zqe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(eGe,$qe=n),d$([e("")],eGe.prototype,"field",void 0),d$([e("")],eGe.prototype,"headerText",void 0),d$([e("")],eGe.prototype,"width",void 0),d$([e("")],eGe.prototype,"minWidth",void 0),d$([e("")],eGe.prototype,"maxWidth",void 0),d$([e("Left")],eGe.prototype,"textAlign",void 0),d$([e(null)],eGe.prototype,"headerTextAlign",void 0),d$([e(null)],eGe.prototype,"type",void 0),d$([e(null)],eGe.prototype,"format",void 0),d$([e(null)],eGe.prototype,"template",void 0),d$([e(null)],eGe.prototype,"sortComparer",void 0),d$([e(null)],eGe.prototype,"headerTemplate",void 0),d$([e(!0)],eGe.prototype,"allowSorting",void 0),d$([e(!0)],eGe.prototype,"allowResizing",void 0),d$([e(null)],eGe.prototype,"customAttributes",void 0),d$([e("")],eGe.prototype,"hideAtMedia",void 0),d$([e(null)],eGe.prototype,"customFormat",void 0),d$([e(!1)],eGe.prototype,"isPrimaryKey",void 0),eGe);function eGe(){return null!==$qe&&$qe.apply(this,arguments)||this}var tGe,iGe,nGe="_toolbar",oGe="_layout",rGe="_navigation",sGe="_tree",aGe="_grid",lGe="_largeicons",hGe="_dialog",dGe="_img_dialog",pGe="_extn_dialog",cGe="_upload_dialog",uGe="_contextmenu",gGe="_content",mGe="_breadcrumbbar",fGe="_upload",yGe="_search",vGe="e-filemanager",bGe="e-control",wGe="e-fe-cb-select",CGe="e-fe-popup",SGe="e-fe-mobile",AGe="e-fe-popup e-fe-mobile",xGe="e-fe-m-select",IGe="e-fe-m-filter",TGe="e-navigation",EGe="e-layout-content",DGe="e-large-icons",MGe="e-toolbar-item",kGe="e-list-item",PGe="e-list-text",BGe="e-list-parent",FGe="e-icons e-fe-tick",LGe="e-icons e-fe-dot",RGe="e-blur",OGe="e-active",NGe="e-hover",VGe="e-focus",_Ge="e-focused",HGe="e-check",zGe="e-frame",jGe="e-checkbox-wrapper",WGe="e-row",QGe="e-empty",UGe="e-empty-content",qGe="e-empty-inner-content",GGe="e-fe-clone",YGe="e-fe-drop-folder",XGe="e-fe-drop-file",KGe="e-fe-folder",JGe="e-fe-image",ZGe="e-fe-music",$Ge="e-fe-video",eYe="e-large-icon",tYe="e-empty-icon e-fe-folder",iYe="e-gridheader",nYe="e-treeview",oYe="e-menu-item",rYe="e-menu-icon",sYe="e-caret",aYe="e-content",lYe="e-gridcontent",hYe="e-list-parent",dYe="e-icons e-fe-open",pYe="e-icons e-fe-upload",cYe="e-icons e-fe-cut",uYe="e-icons e-fe-copy",gYe="e-icons e-fe-paste",mYe="e-icons e-fe-delete",fYe="e-icons e-fe-rename",yYe="e-icons e-fe-newfolder",vYe="e-icons e-fe-details",bYe="e-icons e-fe-sort",wYe="e-icons e-fe-refresh",CYe="e-icons e-fe-select",SYe="e-icons e-fe-download",AYe="e-icons e-fe-grid",xYe="e-icons e-fe-large",IYe="e-icons e-fe-breadcrumb",TYe="e-icons e-fe-clear",EYe="e-icons",DYe="e-fe-errorcontent",MYe="e-rtl",kYe="e-display-none",PYe="e-fullrow",BYe="e-split-bar",FYe="e-headercheck",LYe="e-fe-overlay",RYe="e-fe-value",OYe="model-changed",NYe="initial-end",VYe="finalize-end",_Ye="create-end",HYe="filter-end",zYe="path-drag",jYe="delete-init",WYe="delete-end",QYe="refresh-end",UYe="resize-end",qYe="splitter-resize",GYe="path-changed",YYe="destroy",XYe="before-request",KYe="skip-upload",JYe="after-request",ZYe="layout-refresh",$Ye="actionFailure",eXe="search",tXe="open-init",iXe="open-end",nXe="selection-changed",oXe="select-all-init",rXe="clear-all-init",sXe="clear-path-init",aXe="layout-change",lXe="sort-by-change",hXe="node-expand",dXe="details-init",pXe="menu-item-data",cXe="rename-init",uXe="rename-end-parent",gXe="rename-end",mXe="show-paste",fXe="hide-paste",yXe="selected-data",vXe="cut-copy-init",bXe="paste-init",wXe="paste-end",CXe="cut-end",SXe="hide-layout",AXe="update-tree-selection",xXe="sort-column",IXe="path-column",TXe="search-change",EXe="download-init",DXe="drop-init",MXe="drag-end",kXe="drop-path",PXe="dragging",BXe="update-selection-data",FXe="method-call",LXe="read",RXe="write",OXe="writeContents",NXe="upload",VXe="download",jee=(tGe=function(e,t){return(tGe=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])}))(e,t)},function(e,t){function i(){this.constructor=e}tGe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),gRe=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},_Xe="e-splitter",HXe="e-splitter-horizontal",zXe="e-splitter-vertical",jXe="e-pane",WXe="e-pane-horizontal",QXe="e-pane-vertical",UXe="e-split-bar",qXe="e-split-bar-horizontal",GXe="e-split-bar-vertical",YXe="e-static-pane",XXe="e-scrollable",KXe="e-resize-handler",JXe="e-resizable-split-bar",ZXe="e-split-bar-hover",$Xe="e-split-bar-active",eKe="e-hide-handler",tKe="e-disabled",iKe="e-collapsible",nKe="e-navigate-arrow",oKe="e-arrow-right",rKe="e-arrow-left",sKe="e-arrow-up",aKe="e-arrow-down",lKe="e-icon-hidden",hKe="e-expanded",dKe="e-collapsed",pKe="e-pane-hidden",cKe="e-resizable",uKe="e-last-bar",qo=(jee(gKe,iGe=n),gRe([e()],gKe.prototype,"size",void 0),gRe([e(!1)],gKe.prototype,"collapsible",void 0),gRe([e(!1)],gKe.prototype,"collapsed",void 0),gRe([e(!0)],gKe.prototype,"resizable",void 0),gRe([e(null)],gKe.prototype,"min",void 0),gRe([e(null)],gKe.prototype,"max",void 0),gRe([e()],gKe.prototype,"content",void 0),gRe([e("")],gKe.prototype,"cssClass",void 0),gKe);function gKe(){return null!==iGe&&iGe.apply(this,arguments)||this}jee(yKe,mKe=Ji),yKe.prototype.onPropertyChanged=function(t,e){if(this.element.classList.contains(_Xe))for(var i=0,n=Object.keys(t);i<n.length;i++)switch(n[i]){case"height":this.setSplitterSize(this.element,t.height,"height");break;case"width":this.setSplitterSize(this.element,t.width,"width");break;case"cssClass":this.setCssClass(this.element,t.cssClass);break;case"enabled":this.isEnabled(this.enabled);break;case"enableReversePanes":this.setReversePane();break;case"separatorSize":this.setSeparatorSize(t.separatorSize);break;case"orientation":this.changeOrientation(t.orientation);break;case"paneSettings":if(t.paneSettings instanceof Array&&e.paneSettings instanceof Array)this.clearTemplate(),this.destroyPaneSettings(),this.allBars=[],this.allPanes=[],this.createSplitPane(this.element),this.addSeparator(this.element),this.getPanesDimensions(),this.setRTL(this.enableRtl),this.isCollapsed();else{var o=Object.keys(t.paneSettings),r=o.some(function(e){return!je(t.paneSettings[e].content)});if(this.isReact&&r){for(var s=0,a=0;a<this.paneSettings.length;a++)"function"==typeof this.paneSettings[a].content&&(s+=1);s===this.paneSettings.length&&this.clearTemplate()}for(var l=0;l<o.length;l++)for(var h=parseInt(Object.keys(t.paneSettings)[l],10),d=Object.keys(t.paneSettings[h]).length,p=0;p<d;p++){var c=Object.keys(t.paneSettings[h])[p];switch(c){case"content":var u=Object(t.paneSettings[h])[""+c];je(u)||(this.allPanes[h].innerHTML="",this.setTemplate(u,this.allPanes[h]));break;case"resizable":u=Object(t.paneSettings[h])[""+c];this.resizableModel(h,u);break;case"collapsible":this.collapsibleModelUpdate(h);break;case"collapsed":t.paneSettings[h].collapsed?this.isCollapsed(h):this.collapsedOnchange(h);break;case"cssClass":this.setCssClass(this.allPanes[h],t.paneSettings[h].cssClass);break;case"size":var g=Object(t.paneSettings[h])[""+c];""===g||je(g)||this.updatePaneSize(g,h)}}}break;case"enableRtl":this.setRTL(t.enableRtl)}},yKe.prototype.updatePaneSize=function(e,t){this.allPanes[t].style.flexBasis=e;for(var i=[],n=0,o=0;o<this.allPanes.length;o++)this.paneSettings[o].size||""===this.allPanes[o].innerText?this.paneSettings[o].size&&(r="Horizontal"===this.orientation?this.allPanes[t].offsetWidth:this.allPanes[t].offsetHeight):(i[n]=o,n++);for(var r="Horizontal"===this.orientation?this.allBars[0].offsetWidth*this.allBars.length+r:this.allBars[0].offsetHeight*this.allBars.length+r,s=(("Horizontal"===this.orientation?this.element.offsetWidth:this.element.offsetHeight)-r-2*this.border)/i.length,a=0;a<i.length;a++)""!==this.allPanes[i[a]].style.flexBasis&&(this.allPanes[i[a]].style.flexBasis=s+"px");this.allPanes[t].classList.add(YXe)},yKe.prototype.initializeValues=function(){this.allPanes=[],this.paneOrder=[],this.separatorOrder=[],this.allBars=[],this.previousCoordinates={},this.currentCoordinates={},this.updatePrePaneInPercentage=!1,this.updateNextPaneInPercentage=!1,this.panesDimensions=[],this.border=0,this.validDataAttributes=["data-size","data-min","data-max","data-collapsible","data-resizable","data-content","data-collapsed"],this.validElementAttributes=["data-orientation","data-width","data-height"],this.iconsDelay=300,this.templateElement=[],this.collapseFlag=!1,this.expandFlag=!0},yKe.prototype.preRender=function(){this.initializeValues(),this.onReportWindowSize=this.reportWindowSize.bind(this),this.onMouseMoveHandler=this.onMouseMove.bind(this),this.onMouseUpHandler=this.onMouseUp.bind(this),this.onTouchMoveHandler=this.onMouseMove.bind(this),this.onTouchEndHandler=this.onMouseUp.bind(this),this.wrapper=this.element.cloneNode(!0),this.wrapperParent=this.element.parentElement,q([this.wrapper],["e-control","e-lib",_Xe]);var e="Horizontal"===this.orientation?HXe:zXe,e=(U([this.element],e),F.info.name);this.setCssClass(this.element,"msie"===e?"e-ie":""),F.isDevice&&U([this.element],"e-splitter-touch")},yKe.prototype.getPersistData=function(){return this.addOnPersist(["paneSettings"])},yKe.prototype.getModuleName=function(){return"splitter"},yKe.prototype.render=function(){this.checkDataAttributes(),this.setCssClass(this.element,this.cssClass),this.isEnabled(this.enabled),this.setDimension(this.getHeight(this.element),this.getWidth(this.element)),this.createSplitPane(this.element),this.addSeparator(this.element),this.getPanesDimensions(),this.setPaneSettings(),this.setRTL(this.enableRtl),this.enableReversePanes&&this.setReversePane(),this.collapseFlag=!0,this.isCollapsed(),this.collapseFlag=!1,E.add(document,"touchstart click",this.onDocumentClick,this),this.renderComplete(),this.element.ownerDocument.defaultView.addEventListener("resize",this.onReportWindowSize,!0),E.add(this.element,"keydown",this.onMove,this)},yKe.prototype.onDocumentClick=function(e){e.target.classList.contains(UXe)||je(this.currentSeparator)||(this.currentSeparator.classList.remove(ZXe),this.currentSeparator.classList.remove($Xe))},yKe.prototype.checkPaneSize=function(e){var t,i,n="Horizontal"===this.orientation?this.previousPane.offsetWidth:this.previousPane.offsetHeight,o="Horizontal"===this.orientation?this.nextPane.offsetWidth:this.nextPane.offsetHeight,r=je(this.separatorSize)?1:this.separatorSize;0<this.previousPane.style.flexBasis.indexOf("%")||0<this.previousPane.style.flexBasis.indexOf("p")||0<this.nextPane.style.flexBasis.indexOf("%")?(t=this.updatePaneFlexBasis(this.previousPane),i=this.updatePaneFlexBasis(this.nextPane),this.totalPercent=t+i,this.totalWidth=this.convertPercentageToPixel(this.totalPercent+"%"),"keydown"!==e.type||je(e.keyCode)||((39===e.keyCode||40===e.keyCode)&&0<o&&this.getMinInPixel(this.paneSettings[this.nextPaneIndex].min)<this.convertPercentageToPixel(i-1+"%")?(this.previousPane.style.flexBasis=t+1+"%",this.nextPane.style.flexBasis=i-1+"%"):(37===e.keyCode||38===e.keyCode)&&0<n&&this.getMinInPixel(this.paneSettings[this.prevPaneIndex].min)<this.convertPercentageToPixel(t-1+"%")&&(this.previousPane.style.flexBasis=t-1+"%",this.nextPane.style.flexBasis=i+1+"%"))):(this.totalWidth="Horizontal"===this.orientation?this.previousPane.offsetWidth+this.nextPane.offsetWidth:this.previousPane.offsetHeight+this.nextPane.offsetHeight,"keydown"!==e.type||je(e.keyCode)||((39===e.keyCode||40===e.keyCode)&&0<o&&this.getMinInPixel(this.paneSettings[this.nextPaneIndex].min)<o+r?(this.addStaticPaneClass(),this.previousPane.style.flexBasis=n+r+"px",this.nextPane.style.flexBasis=o<r?"0px":o-r+"px"):(37===e.keyCode||38===e.keyCode)&&0<n&&this.getMinInPixel(this.paneSettings[this.prevPaneIndex].min)<n-r&&(this.addStaticPaneClass(),this.previousPane.style.flexBasis=n<r?"0px":n-r+"px",this.nextPane.style.flexBasis=o+r+"px")))},yKe.prototype.onMove=function(e){var t,i,n,o;1<this.allPanes.length&&(t=this.getSeparatorIndex(this.currentSeparator),i=this.previousPane.classList.contains(dKe),n=this.previousPane.classList.contains(hKe),o=this.nextPane.classList.contains(dKe),("Horizontal"!==this.orientation&&38===e.keyCode||"Horizontal"===this.orientation&&39===e.keyCode||"Horizontal"===this.orientation&&37===e.keyCode||"Horizontal"!==this.orientation&&40===e.keyCode)&&(!n&&!o&&!i||n&&!o)&&document.activeElement.classList.contains(UXe)&&this.paneSettings[t].resizable&&this.paneSettings[t+1].resizable?(e.preventDefault(),this.checkPaneSize(e),this.triggerResizing(e)):13===e.keyCode&&this.paneSettings[t].collapsible&&document.activeElement.classList.contains(UXe)&&this.currentSeparator.classList.contains($Xe)&&(this.previousPane.classList.contains(dKe)?this.expand(t):this.collapse(t),U([this.currentSeparator],$Xe)))},yKe.prototype.getMinInPixel=function(e){var t;return je(e)?0:(t=this.convertPixelToNumber(e.toString()),0<e.indexOf("%")&&(t=this.convertPercentageToPixel(e)),this.convertPixelToNumber(t.toString()))},yKe.prototype.sanitizeHelper=function(e){var t;return this.enableHtmlSanitizer&&(Pe(t=go.beforeSanitize(),t,{cancel:!1,helper:null}),this.trigger("beforeSanitizeHtml",t),t.cancel&&!je(t.helper)?e=t.helper(e):t.cancel||(e=go.serializeValue(t,e))),e},yKe.prototype.checkDataAttributes=function(){for(var e,t=0;t<this.validElementAttributes.length;t++)je(o=this.element.getAttribute(this.validElementAttributes[t]))||(e=this.removeDataPrefix(this.validElementAttributes[t]),this[e]=o);for(var i=0;i<this.element.children.length;i++)for(var n,o,r=0;r<this.validDataAttributes.length;r++)!je(o=this.element.children[i].getAttribute(this.validDataAttributes[r]))&&(o="collapsible"===(e=this.removeDataPrefix(this.validDataAttributes[r]))||"resizable"===e?"true"===o:o,je(this.paneSettings[i])&&(this.paneSettings[i]={size:"",min:null,max:null,content:"",resizable:!0,collapsible:!1,collapsed:!1}),n=this.paneSettings[i][e],"resizable"!==e&&"collapsible"!==e&&"collapsed"!==e||(this.paneSettings[i][e]=o),je(n)||""===n)&&(this.paneSettings[i][e]=o)},yKe.prototype.destroyPaneSettings=function(){[].slice.call(this.element.children).forEach(function(e){G(e)}),this.restoreElem()},yKe.prototype.setPaneSettings=function(){for(var e=this.allPanes.length,t=[],i={size:"",min:null,max:null,content:"",resizable:!0,collapsed:!1,collapsible:!1,cssClass:""},n=0;n<e;n++)je(this.paneSettings[n])?t[n]=i:t[n]=this.paneSettings[n];this.setProperties({paneSettings:t},!0)},yKe.prototype.checkArrow=function(e,t){return this.allBars[e].querySelector("."+nKe+"."+t)},yKe.prototype.removeDataPrefix=function(e){return e.slice(e.lastIndexOf("-")+1)},yKe.prototype.setRTL=function(e){(e?U:q)([this.element],"e-rtl")},yKe.prototype.setReversePane=function(){this.allPanes=this.allPanes.reverse(),this.allBars=this.allBars.reverse(),U([this.allBars[this.allBars.length-1]],uKe),q([this.allBars[0]],uKe),this.setProperties({paneSettings:this.paneSettings.reverse()},!0),this.enableReversePanes?this.element.setAttribute("dir","rtl"):this.element.removeAttribute("dir")},yKe.prototype.setSplitterSize=function(e,t,i){gt(e,"width"===i?{width:T(t)}:{height:T(t)})},yKe.prototype.getPanesDimensions=function(){for(var e=0;e<this.allPanes.length;e++)"Horizontal"===this.orientation?this.panesDimensions.push(this.allPanes[e].getBoundingClientRect().width):this.panesDimensions.push(this.allPanes[e].getBoundingClientRect().height)},yKe.prototype.setCssClass=function(e,t){t&&U([e],t.split(-1<t.indexOf(",")?",":" "))},yKe.prototype.hideResizer=function(e){U([ge("."+KXe,e)],eKe)},yKe.prototype.showResizer=function(e){!je(this.previousPane)&&this.previousPane.classList.contains(cKe)&&!je(this.nextPane)&&this.nextPane.classList.contains(cKe)&&q([ge("."+KXe,e)],eKe)},yKe.prototype.resizableModel=function(e,t){var i=e===this.allBars.length?e-1:e,n=e;E.remove(this.allBars[i],"mousedown",this.onMouseDown),t?(E.add(this.allBars[i],"mousedown",this.onMouseDown,this),this.isResizable()&&(this.showResizer(this.allBars[i]),q([ge("."+KXe,this.allBars[i])],eKe),this.allBars[i].classList.add(JXe),(e===this.allBars.length?this.allPanes[e]:this.allPanes[i]).classList.add(cKe),this.updateResizablePanes(n))):(this.updateResizablePanes(n),this.hideResizer(this.allBars[i]),this.allBars[i].classList.remove(JXe),(e===this.allBars.length?this.allPanes[e]:this.allPanes[i]).classList.remove(cKe))},yKe.prototype.collapsibleModelUpdate=function(e){var t=e===this.allBars.length?e-1:e,i="Horizontal"===this.orientation?this.checkArrow(t,rKe):this.checkArrow(t,sKe),n="Horizontal"===this.orientation?this.checkArrow(t,oKe):this.checkArrow(t,aKe);this.paneCollapsible(this.allPanes[e],e),this.updateCollapseIcons(t,n,i)},yKe.prototype.collapseArrow=function(e,t){return ct("."+t,this.allBars[e])[0]},yKe.prototype.updateIsCollapsed=function(e,t,i){var n,o;je(e)||(o=(n=e===this.allBars.length)?e-1:e,(!n&&this.allPanes[e+1].classList.contains(dKe)&&0!==e?this.collapseArrow(o-1,i):n?this.collapseArrow(o,i):this.collapseArrow(o,t)).click())},yKe.prototype.isCollapsed=function(r){var s=this;if(je(r)||!this.paneSettings[r].collapsed||!je(this.allPanes[r].classList.contains(dKe))){if(this.expandFlag=!1,je(r)){for(var e=0;e<this.allPanes.length;e++)!je(this.paneSettings[e])&&this.paneSettings[e].collapsed&&this.updateIsCollapsed(e,this.targetArrows().collapseArrow,this.targetArrows().lastBarArrow);for(var t,e=this.allPanes.length-1;0<=e;e--)je(this.paneSettings[e])||!this.paneSettings[e].collapsed||this.allPanes[e].classList.contains(dKe)||(t="Horizontal"===this.orientation?oKe:aKe,0!==e&&this.collapseArrow(e-1,t).click(),this.nextPane.classList.contains(dKe))||this.collapseArrow(e-1,t).click()}else{this.collapseFlag=!0;var i=r===this.allBars.length,n=i?r-1:r,a={target:!i&&this.allPanes[r+1].classList.contains(dKe)&&0!==r?this.collapseArrow(n-1,this.targetArrows().lastBarArrow):i?this.collapseArrow(n,this.targetArrows().lastBarArrow):this.collapseArrow(n,this.targetArrows().collapseArrow)},i=this.beforeAction(a);this.trigger("beforeCollapse",i,function(e){if(!e.cancel){for(var t=[],i=(t[0]=r,1),n=0;n<s.allPanes.length;n++)s.allPanes[n].classList.contains(dKe)&&(t[i]=n,i++);t=t.sort(),s.updateIsCollapsed(r,s.targetArrows().collapseArrow,s.targetArrows().lastBarArrow);for(n=0;n<t.length;n++)s.allPanes[t[n]].classList.contains(dKe)||s.updateIsCollapsed(t[n],s.targetArrows().collapseArrow,s.targetArrows().lastBarArrow);for(var o,n=t.length;0<n;n--)s.allPanes[t[n-1]].classList.contains(dKe)||(o=s.targetArrows(),s.updateIsCollapsed(t[n-1],o.collapseArrow,o.lastBarArrow));e=s.afterAction(a);s.trigger("collapsed",e),s.collapseFlag=!1}})}this.expandFlag=!0}},yKe.prototype.targetArrows=function(){return this.splitterProperty(),{collapseArrow:"Horizontal"===this.orientation?rKe:sKe,lastBarArrow:"Vertical"===this.orientation?aKe:oKe}},yKe.prototype.collapsedOnchange=function(e){je(this.paneSettings[e])||je(this.paneSettings[e].collapsed)||!this.allPanes[e].classList.contains(dKe)||this.updateIsCollapsed(e,this.targetArrows().lastBarArrow,this.targetArrows().collapseArrow)},yKe.prototype.isEnabled=function(e){(e?q:U)([this.element],tKe)},yKe.prototype.setSeparatorSize=function(e){for(var t=je(e)?"auto":e+"px",i="Horizontal"===this.orientation?qXe:GXe,n=0;n<this.allBars.length;n++){var o=ct("."+i,this.element)[n],r=ct("."+KXe,o)[0];"Horizontal"===this.orientation?(o.style.width=t,je(r)||(r.style.width=t)):(o.style.height=t,je(r)||(r.style.height=t))}},yKe.prototype.changeOrientation=function(e){var t="Vertical"===e;this.element.classList.remove(t?HXe:zXe),this.element.classList.add(t?zXe:HXe);for(var i=0;i<this.allPanes.length;i++)this.allPanes[i].classList.remove(t?WXe:QXe),this.allPanes[i].classList.add(t?QXe:WXe);for(i=0;i<this.allBars.length;i++)G(this.allBars[i]);this.allBars=[],this.addSeparator(this.element)},yKe.prototype.checkSplitPane=function(e,t){return this.collectPanes(e.parentElement.children)[t]},yKe.prototype.collectPanes=function(e){for(var t=[],i=0;i<e.length;i++)e[i].classList.contains(jXe)&&t.push(e[i]);return t},yKe.prototype.getPrevPane=function(e){return this.enableReversePanes?this.getOrderPane(e+1):this.getOrderPane(e-1)},yKe.prototype.getNextPane=function(e){return this.enableReversePanes?this.getOrderPane(e-1):this.getOrderPane(e+1)},yKe.prototype.getOrderPane=function(e){for(var t,i=0;i<this.element.children.length;i++)parseInt(this.element.children[i].style.order,10)===e&&(t=this.element.children[i]);return t},yKe.prototype.getOrderIndex=function(e,t){for(var i,n="pane"===t?this.allPanes:this.allBars,o=0;o<n.length;o++)parseInt(n[o].style.order,10)===e&&(i=o);return i},yKe.prototype.updateSeparatorSize=function(e){var t=je(this.separatorSize)?"1px":this.separatorSize+"px";"Horizontal"===this.orientation?e.style.width=t:e.style.height=t},yKe.prototype.addResizeHandler=function(e){var t=this.createElement("div");U([t],[KXe,"e-icons"]),this.updateSeparatorSize(t),e.appendChild(t)},yKe.prototype.getHeight=function(e){this.height;return(""!==e.style.height&&"100%"===this.height?e.style:this).height},yKe.prototype.getWidth=function(e){this.width;return(""!==e.style.width&&"100%"===this.width?e.style:this).width},yKe.prototype.setDimension=function(e,t){gt(this.element,{height:e,width:t})},yKe.prototype.updateCollapseIcons=function(e,t,i){je(this.paneSettings[e])||je(this.paneSettings[e].collapsible)||((this.paneSettings[e].collapsible?q:U)([i],[lKe]),je(this.paneSettings[e+1])||(this.paneSettings[e+1].collapsible?q:U)([t],[lKe]),je(this.paneSettings[e+1]))||this.paneSettings[e+1].collapsible&&(this.paneSettings[e+1].collapsible?q:U)([t],[lKe])},yKe.prototype.updateIconClass=function(){"Horizontal"===this.orientation?(this.leftArrow=rKe,this.rightArrow=oKe):(this.leftArrow=sKe,this.rightArrow=aKe)},yKe.prototype.createSeparator=function(e){var t=this.createElement("div"),i=(this.allBars.push(t),this.createElement("button")),n=this.createElement("button"),o=(i.setAttribute("tabindex","-1"),n.setAttribute("tabindex","-1"),i.setAttribute("aria-label","Toggle navigation"),n.setAttribute("aria-label","Toggle navigation"),i.setAttribute("type","button"),n.setAttribute("type","button"),je(this.separatorSize)?"1px":this.separatorSize+"px"),r=this;return"Horizontal"===this.orientation?(this.updateIconClass(),U([n],[nKe,rKe,lKe]),U([i],[nKe,oKe,lKe]),U([t],[UXe,qXe]),t.style.width=o):(U([i],[nKe,aKe,lKe]),U([n],[nKe,sKe,lKe]),U([t],[UXe,GXe]),this.updateIconClass(),t.style.height=o),this.addMouseActions(t),t.appendChild(n),this.addResizeHandler(t),t.appendChild(i),this.updateCollapseIcons(e,i,n),t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"),this.enableReversePanes?t.setAttribute("dir","ltr"):t.removeAttribute("dir"),t.addEventListener("focus",function(){t.classList.add($Xe),r.currentSeparator=t,r.getPaneDetails()}),t.addEventListener("blur",function(){t.classList.remove($Xe)}),t},yKe.prototype.updateResizablePanes=function(e){this.getPaneDetails(),this.isResizable()?this.allPanes[e].classList.add(cKe):this.allPanes[e].classList.remove(cKe)},yKe.prototype.addSeparator=function(e){for(var t,i,n=this.allPanes.length,o=e.children,r=0;r<n;r++)r<n-1?(gt(i=this.createSeparator(r),{order:2*r+1}),this.separatorOrder.push(2*r+1),o[r].parentNode.appendChild(i),(this.currentSeparator=i).setAttribute("role","separator"),i.setAttribute("aria-valuenow",r.toString()),je(this.orientation)||i.setAttribute("aria-orientation",this.orientation.toLowerCase()),this.wireClickEvents(),je(i)||(this.isResizable()?(E.add(i,"mousedown",this.onMouseDown,this),t="msie"===F.info.name?"pointerdown":"touchstart",E.add(i,t,this.onMouseDown,this),i.classList.add(JXe),this.updateResizablePanes(r)):U([ge("."+KXe,i)],eKe))):(i&&U([i],uKe),1<n&&this.updateResizablePanes(r));if("msie"===F.info.name)for(var s=this.element.querySelectorAll(".e-splitter .e-resize-handler"),r=0;r<s.length;r++){var a=je(this.separatorSize)?1:this.separatorSize;s[r].style.paddingLeft=a/2+"px",s[r].style.paddingRight=a/2+"px"}},yKe.prototype.isResizable=function(){var e=!1;return e=!je(this.paneSettings[this.getPreviousPaneIndex()])&&this.paneSettings[this.getPreviousPaneIndex()].resizable&&!je(this.paneSettings[this.getNextPaneIndex()])&&this.paneSettings[this.getNextPaneIndex()].resizable||je(this.paneSettings[this.getNextPaneIndex()])?!0:e},yKe.prototype.addMouseActions=function(e){var t,i,n=this;e.addEventListener("mouseenter",function(){t=setTimeout(function(){U([e],[ZXe])},n.iconsDelay)}),e.addEventListener("mouseleave",function(){clearTimeout(t),q([e],[ZXe])}),e.addEventListener("mouseout",function(){clearTimeout(i)}),e.addEventListener("mouseover",function(){i=setTimeout(function(){U([e],[ZXe])})})},yKe.prototype.getEventType=function(e){return-1<e.indexOf("mouse")?"mouse":"touch"},yKe.prototype.updateCurrentSeparator=function(e){this.currentSeparator=this.isSeparator(e)?e.parentElement:e},yKe.prototype.isSeparator=function(e){return!e.classList.contains(UXe)},yKe.prototype.isMouseEvent=function(e){var t=!1;return t="mouse"!==this.getEventType(e.type)&&(je(e.pointerType)||"mouse"!==this.getEventType(e.pointerType))?t:!0},yKe.prototype.updateCursorPosition=function(e,t){this.isMouseEvent(e)?this.changeCoordinates({x:e.pageX,y:e.pageY},t):(e="msie"!==F.info.name?e.touches[0]:e,this.changeCoordinates({x:e.pageX,y:e.pageY},t))},yKe.prototype.changeCoordinates=function(e,t){"previous"===t?this.previousCoordinates=e:this.currentCoordinates=e},yKe.prototype.reportWindowSize=function(){var e=this,t=this.allPanes.length;if(document.body.contains(this.element)){for(var i=0;i<t;i++)je(this.paneSettings[i].size)&&this.allPanes[i].classList.remove(YXe),t-1===i&&this.element.querySelectorAll("."+YXe).length===t&&""===this.allPanes[i].style.flexBasis&&q([this.allPanes[i]],YXe);0<t&&setTimeout(function(){e.updateSplitterSize(!0)},200)}else document.defaultView.removeEventListener("resize",this.onReportWindowSize)},yKe.prototype.updateSplitterSize=function(e){for(var t=0,i=[],n=0,o=this.element.children,r=0,s=o.length;r<s;r++)t+="Horizontal"===this.orientation?o[r].offsetWidth:o[r].offsetHeight;for(var a=0,s=this.allBars.length;a<s;a++)t+="Horizontal"===this.orientation?parseInt(getComputedStyle(this.allBars[a]).marginLeft,10)+parseInt(getComputedStyle(this.allBars[a]).marginLeft,10):parseInt(getComputedStyle(this.allBars[a]).marginTop,10)+parseInt(getComputedStyle(this.allBars[a]).marginBottom,10);for(var l="Horizontal"===this.orientation?this.element.offsetWidth-(2*this.border+t):this.element.offsetHeight-(2*this.border+t),r=0,s=this.allPanes.length;r<s;r++)(""===this.allPanes[r].innerText?this.paneSettings[r].size&&""===this.allPanes[r].innerText:this.paneSettings[r].size||""===this.allPanes[r].innerText)||(i[n]=r,n++);for(var h=l/i.length,a=0,s=i.length;a<s;a++)""!==this.allPanes[i[a]].style.flexBasis&&(this.allPanes[i[a]].style.flexBasis="Horizontal"===this.orientation?this.allPanes[i[a]].offsetWidth+h+"px":this.allPanes[i[a]].offsetHeight+h+"px");if(2===this.allPanes.length&&e)for(var d,p,c,u=this.allPanes.length,g=void 0,m=void 0,f=void 0,r=0;r<u;r++)je(this.paneSettings[r].min)||(g=this.convertPixelToNumber(this.paneSettings[r].min.toString()),0<this.paneSettings[r].min.indexOf("%")&&(g=this.convertPercentageToPixel(this.paneSettings[r].min)),d=this.convertPixelToNumber(g.toString()),("Horizontal"===this.orientation?this.allPanes[r].offsetWidth:this.allPanes[r].offsetHeight)<d&&(f=0===r?(m=this.allPanes[r],this.allPanes[r+1]):(m=this.allPanes[r],this.allPanes[r-1]),d=d-("Horizontal"===this.orientation?this.allPanes[r].offsetWidth:this.allPanes[r].offsetHeight),c=-1<m.style.flexBasis.indexOf("%"),p="Horizontal"===this.orientation?m.offsetWidth:m.offsetHeight,!je(m)&&""!==m.style.flexBasis&&m.classList.contains(YXe)&&(m.style.flexBasis=c?this.convertPixelToPercentage(p+d)+"%":p+d+"px"),c="Horizontal"===this.orientation?f.offsetWidth:f.offsetHeight,je(f)||""===f.style.flexBasis||f.classList.contains(YXe)||(f.style.flexBasis=-1<f.style.flexBasis.indexOf("%")?this.convertPixelToPercentage(c-d)+"%":c-d+"px")))},yKe.prototype.wireResizeEvents=function(){document.addEventListener("mousemove",this.onMouseMoveHandler,!0),document.addEventListener("mouseup",this.onMouseUpHandler,!0);var e="msie"===F.info.name?"pointermove":"touchmove",t="msie"===F.info.name?"pointerup":"touchend";document.addEventListener(e,this.onTouchMoveHandler,!0),document.addEventListener(t,this.onTouchEndHandler,!0)},yKe.prototype.unwireResizeEvents=function(){this.element.ownerDocument.defaultView.removeEventListener("resize",this.onReportWindowSize);var e="msie"===F.info.name?"pointermove":"touchmove",t="msie"===F.info.name?"pointerup":"touchend";document.removeEventListener("mousemove",this.onMouseMoveHandler,!0),document.removeEventListener("mouseup",this.onMouseUpHandler,!0),document.removeEventListener(e,this.onTouchMoveHandler,!0),document.removeEventListener(t,this.onTouchEndHandler,!0)},yKe.prototype.wireClickEvents=function(){E.add(this.currentSeparator,"touchstart click",this.clickHandler,this)},yKe.prototype.clickHandler=function(e){e.target.classList.contains(nKe)||(0<(t=ct("."+_Xe+" > ."+UXe+"."+ZXe)).length&&q(t,ZXe),e.target.classList.add(ZXe)),this.splitterDetails(e);var t=e.target;(t.classList.contains(rKe)||t.classList.contains(oKe)||t.classList.contains(aKe)||t.classList.contains(sKe))&&(this.nextPane.classList.contains(pKe)||this.previousPane.classList.contains(pKe)?this.expandAction(e):this.collapseAction(e),this.updateSplitterSize())},yKe.prototype.expandAction=function(t){var i=this,e=this.beforeAction(t);this.expandFlag?this.trigger("beforeExpand",e,function(e){e.cancel||i.expandPane(t);e=i.afterAction(t);i.trigger("expanded",e)}):this.expandPane(t)},yKe.prototype.getIcon=function(e){return e.target.className.split(" ").filter(function(e){return e!==nKe&&e!==lKe})[0]},yKe.prototype.expandPane=function(e){this.removeStaticPanes();var t=this.element.querySelectorAll("."+dKe).length,t=!this.previousPane.classList.contains(dKe)&&this.previousPane.classList.contains(YXe)&&!this.nextPane.classList.contains(dKe)&&!this.nextPane.classList.contains(hKe)&&this.nextPane.nextElementSibling.classList.contains(jXe)&&!this.nextPane.nextElementSibling.classList.contains(YXe)&&!(t===this.allPanes.length-2),i=[dKe,pKe],n=this.getIcon(e),o=n===rKe||n===sKe,r=o?this.nextPane:this.previousPane,s=o?this.previousPane:this.nextPane,o=o?this.nextPaneIndex:this.prevPaneIndex,i=(q([r],i),r.setAttribute("aria-hidden","false"),this.element.querySelectorAll("."+dKe).length);if(0<i)s.classList.contains(dKe)||(U([s],hKe),s.setAttribute("aria-expanded","true"));else if(0===i)for(var a=0;a<this.allPanes.length;a++)this.allPanes[a].classList.contains(dKe)||(q([this.allPanes[a]],hKe),this.allPanes[a].setAttribute("aria-expanded","false"));this.expandFlag&&this.updatePaneSettings(o,!1),this.updateIconsOnExpand(e,n),this.updateFlexGrow(),t&&(this.previousPane.classList.remove(hKe),this.previousPane.setAttribute("aria-expanded","false"),this.previousPane.style.flexGrow="")},yKe.prototype.updateFlexGrow=function(){for(var e=0,t=0;t<this.element.children.length;t++)this.element.children[t].classList.contains(dKe)&&(e+=1);for(var i=e===this.allPanes.length-2,n=this.allPanes,o=0;o<n.length;o++)n[o].style.flexGrow="",i&&this.allPanes[o].classList.contains(dKe)&&this.paneSettings[o].size&&o!==this.allPanes.length-1&&(n[o].style.flexGrow=""),n[o].classList.contains(hKe)?n[o].style.flexGrow="1":n[o].classList.contains(dKe)&&(n[o].style.flexGrow="0")},yKe.prototype.hideTargetBarIcon=function(e,t){U([ge("."+t,e)],lKe)},yKe.prototype.showTargetBarIcon=function(e,t){q([ge("."+t,e)],lKe)},yKe.prototype.updateIconsOnCollapse=function(e,t){this.splitterProperty();var i,n,o=this.arrow,r=this.currentBarIndex===this.allBars.length-1?this.prevBar:this.nextBar,s=this.currentBarIndex===this.allBars.length-1?this.currentBarIndex-1:this.currentBarIndex+1;e.target.classList.contains(lKe)?(this.resizableModel(this.currentBarIndex,!1),je(r)||this.resizableModel(s,!0),this.paneSettings[this.prevPaneIndex].collapsible&&this.paneSettings[this.nextPaneIndex].collapsible?(je(r)||this.hideTargetBarIcon(r,o),this.showTargetBarIcon(this.currentSeparator,o)):(je(r)||this.hideTargetBarIcon(r,t),this.hideTargetBarIcon(this.currentSeparator,o))):(this.splitInstance.prevPaneCollapsed||this.splitInstance.nextPaneCollapsed)&&(this.paneSettings[this.prevPaneIndex].collapsible&&this.paneSettings[this.nextPaneIndex].collapsible?(this.resizableModel(this.currentBarIndex,!1),this.hideTargetBarIcon(this.currentSeparator,t),je(r)||(n=this.getCollapseCount(e=s,i=s+1),this.paneSettings[e].collapsible&&this.paneSettings[i].collapsible&&(1===n?(this.hideTargetBarIcon(r,o),this.resizableModel(s,!1)):2===n&&(this.hideBarIcons(r),this.resizableModel(s,!1)),this.paneSettings[e].collapsible&&this.paneSettings[i].collapsible||this.hideTargetBarIcon(r,t)))):(this.showTargetBarIcon(this.currentSeparator,o),this.hideTargetBarIcon(this.currentSeparator,t),this.resizableModel(this.currentBarIndex,!1)))},yKe.prototype.collapseAction=function(t){var i=this,e=this.beforeAction(t);this.collapseFlag?this.collapsePane(t):this.trigger("beforeCollapse",e,function(e){e.cancel||(i.collapsePane(t),e=i.afterAction(t),i.trigger("collapsed",e))})},yKe.prototype.collapsePane=function(e){this.removeStaticPanes();var t=this.element.querySelectorAll("."+dKe).length,t=this.previousPane.classList.contains(YXe)&&!this.previousPane.classList.contains(dKe)&&!this.nextPane.classList.contains(dKe)&&this.nextPane.nextElementSibling.classList.contains(jXe)&&!this.nextPane.nextElementSibling.classList.contains(YXe)&&!this.nextPane.nextElementSibling.classList.contains(dKe)&&!(t===this.allPanes.length-2)||this.nextPane.classList.contains(dKe)&&!this.previousPane.classList.contains(YXe)&&this.nextPane.classList.contains(YXe),i=[dKe,pKe],n=this.getIcon(e),o=n===rKe||n===sKe,r=o?this.previousPane:this.nextPane,s=o?this.nextPane:this.previousPane,o=o?this.prevPaneIndex:this.nextPaneIndex;if(q([r],hKe),r.setAttribute("aria-expanded","false"),U([r],i),r.setAttribute("aria-hidden","true"),""===r.style.flexBasis)U([s],hKe),s.setAttribute("aria-expanded","true");else{for(var a=!0,l=0;l<this.allPanes.length;l++)if(!this.allPanes[l].classList.contains(dKe)&&""===this.allPanes[l].style.flexBasis&&!this.allPanes[l].classList.contains(dKe)&&!this.allPanes[l].classList.contains(hKe)){U([this.allPanes[l]],hKe),this.allPanes[l].setAttribute("aria-expanded","true"),a=!1;break}a&&(U([s],hKe),s.setAttribute("aria-expanded","true"))}this.collapseFlag||this.updatePaneSettings(o,!0),this.updateIconsOnCollapse(e,n),this.updateFlexGrow(),t&&(this.nextPane.classList.remove(hKe),this.nextPane.style.flexGrow="")},yKe.prototype.removeStaticPanes=function(){for(var e=0;e<this.allPanes.length;e++)je(this.paneSettings[e].size)&&this.allPanes[e].classList.remove(YXe)},yKe.prototype.beforeAction=function(e){return{element:this.element,event:e,pane:[this.previousPane,this.nextPane],index:[this.prevPaneIndex,this.nextPaneIndex],separator:this.currentSeparator,cancel:!1}},yKe.prototype.updatePaneSettings=function(e,t){var i=this.paneSettings;i[e].collapsed=t,this.setProperties({paneSettings:i},!0)},yKe.prototype.splitterProperty=function(){this.splitInstance={currentBarIndex:this.currentBarIndex,nextPaneCollapsible:this.nextPane.classList.contains(iKe),prevPaneCollapsible:this.previousPane.classList.contains(iKe),prevPaneExpanded:this.previousPane.classList.contains(hKe),nextPaneExpanded:this.nextPane.classList.contains(hKe),nextPaneCollapsed:this.nextPane.classList.contains(dKe),prevPaneCollapsed:this.previousPane.classList.contains(dKe),nextPaneIndex:this.getNextPaneIndex(),prevPaneIndex:this.getPreviousPaneIndex(),nextPaneNextEle:this.nextPane.nextElementSibling,prevPanePreEle:this.previousPane.previousElementSibling}},yKe.prototype.showCurrentBarIcons=function(){q([ge("."+this.arrow,this.currentSeparator)],lKe)},yKe.prototype.hideBarIcons=function(e){U([ge("."+this.arrow,e)],lKe)},yKe.prototype.getCollapseCount=function(e,t){var i=0;return this.allPanes[e].classList.contains(dKe)&&(i+=1),this.allPanes[t].classList.contains(dKe)&&(i+=1),i},yKe.prototype.checkResizableProp=function(e,t){return!(!this.paneSettings[e].resizable||!this.paneSettings[t].resizable)},yKe.prototype.updateIconsOnExpand=function(e,t){this.splitterProperty();var i,n,o=this.arrow,r=this.currentBarIndex===this.allBars.length-1?this.prevBar:this.nextBar,s=this.currentBarIndex===this.allBars.length-1?this.currentBarIndex-1:this.currentBarIndex+1;e.target.classList.contains(lKe)?this.paneSettings[this.prevPaneIndex].collapsible||this.paneSettings[this.nextPaneIndex].collapsible||this.checkResizableProp(this.prevPaneIndex,this.nextPaneIndex)&&this.resizableModel(this.currentBarIndex,!0):this.splitInstance.prevPaneCollapsed||this.splitInstance.nextPaneCollapsed||(this.paneSettings[this.prevPaneIndex].collapsible&&this.paneSettings[this.nextPaneIndex].collapsible?(this.showCurrentBarIcons(),this.checkResizableProp(this.prevPaneIndex,this.nextPaneIndex)?this.resizableModel(this.currentBarIndex,!0):this.resizableModel(this.currentBarIndex,!1),je(r)||(n=this.getCollapseCount(e=s,i=s+1),this.paneSettings[e].collapsible&&this.paneSettings[i].collapsible&&(0===n?(this.showTargetBarIcon(r,t),this.showTargetBarIcon(r,o),this.checkResizableProp(e,i)&&this.resizableModel(s,!0)):1===n&&(this.hideBarIcons(r),this.allPanes[e].classList.contains(hKe)||this.allPanes[i].classList.contains(hKe)?this.showTargetBarIcon(r,o):this.showTargetBarIcon(r,t),this.resizableModel(s,!1))))):(this.hideTargetBarIcon(this.currentSeparator,t),this.showTargetBarIcon(this.currentSeparator,o),this.splitInstance.prevPaneCollapsed||this.splitInstance.nextPaneCollapsed?this.resizableModel(this.currentBarIndex,!1):this.checkResizableProp(this.prevPaneIndex,this.nextPaneIndex)&&this.resizableModel(this.currentBarIndex,!0)))},yKe.prototype.afterAction=function(e){return{element:this.element,event:e,pane:[this.previousPane,this.nextPane],index:[this.prevPaneIndex,this.nextPaneIndex],separator:this.currentSeparator}},yKe.prototype.currentIndex=function(e){this.currentBarIndex=this.getOrderIndex(parseInt(e.target.parentElement.style.order,10),"splitbar")},yKe.prototype.getSeparatorIndex=function(e){var t=[].slice.call(this.allBars);return(t=this.enableReversePanes?t.reverse():t).indexOf(e)},yKe.prototype.getPrevBar=function(e){return this.allBars[e-1]},yKe.prototype.getNextBar=function(e){return this.allBars[e+1]},yKe.prototype.updateBars=function(e){this.prevBar=this.getPrevBar(e),this.nextBar=this.getNextBar(e)},yKe.prototype.splitterDetails=function(e){"Horizontal"===this.orientation?this.arrow=e.target.classList.contains(rKe)?oKe:rKe:this.arrow=e.target.classList.contains(sKe)?aKe:sKe,this.updateCurrentSeparator(e.target),this.currentIndex(e),this.updateBars(this.currentBarIndex),this.getPaneDetails()},yKe.prototype.triggerResizing=function(e){e={element:this.element,event:e,pane:[this.previousPane,this.nextPane],index:[this.prevPaneIndex,this.nextPaneIndex],paneSize:[this.prePaneDimenson,this.nextPaneDimension],separator:this.currentSeparator};this.trigger("resizing",e)},yKe.prototype.onMouseDown=function(t){var i=this,e=(t.preventDefault(),t.target);if(!e.classList.contains(nKe)){this.updateCurrentSeparator(e),U([this.currentSeparator],$Xe),this.updateCursorPosition(t,"previous"),this.getPaneDetails();for(var e={element:this.element,event:t,pane:[this.previousPane,this.nextPane],index:[this.getPreviousPaneIndex(),this.getNextPaneIndex()],separator:this.currentSeparator,cancel:!1},n=0;n<this.element.querySelectorAll("iframe").length;n++)this.element.querySelectorAll("iframe")[n].style.pointerEvents="none";this.trigger("resizeStart",e,function(e){e.cancel||(i.wireResizeEvents(),i.checkPaneSize(t))})}},yKe.prototype.updatePaneFlexBasis=function(e){return 0<e.style.flexBasis.indexOf("%")?this.removePercentageUnit(e.style.flexBasis):""!==e.style.flexBasis?this.convertPixelToPercentage(this.convertPixelToNumber(e.style.flexBasis)):(e="Horizontal"===this.orientation?e.offsetWidth:e.offsetHeight,this.convertPixelToPercentage(e))},yKe.prototype.removePercentageUnit=function(e){return parseFloat(e.slice(0,e.indexOf("%")))},yKe.prototype.convertPercentageToPixel=function(e,t){var i,n,e=e.toString();return i=-1<e.indexOf("%")?(i=parseFloat(e.slice(0,e.indexOf("%"))),n=void 0,n=je(t)?"Horizontal"===this.orientation?this.element.offsetWidth:this.element.offsetHeight:this.panesDimensions[this.allPanes.indexOf(t)],Math.ceil(n*(i/100))):parseInt(e,10)},yKe.prototype.convertPixelToPercentage=function(e){return e/("Horizontal"===this.orientation?this.element.offsetWidth:this.element.offsetHeight)*100},yKe.prototype.convertPixelToNumber=function(e){return-1<(e=e.toString()).indexOf("p")?parseFloat(e.slice(0,e.indexOf("p"))):parseFloat(e)},yKe.prototype.calcDragPosition=function(e,t){e=("Horizontal"===this.orientation?this.currentCoordinates.x-e:this.currentCoordinates.y-e)/t;return(1<e?1:e<0?0:e)*t},yKe.prototype.getSeparatorPosition=function(e){this.updateCursorPosition(e,"current");var e="Horizontal"===this.orientation?this.element.getBoundingClientRect().left+window.scrollX:this.element.getBoundingClientRect().top+window.scrollY,t="Horizontal"===this.orientation?this.element.offsetWidth:this.element.offsetHeight;return this.calcDragPosition(e,t)},yKe.prototype.getMinMax=function(e,t,i){var n="min"===i?0:null,o=null;return"min"===i?je(this.paneSettings[e])||je(this.paneSettings[e].min)||(o=this.paneSettings[e].min):je(this.paneSettings[e])||je(this.paneSettings[e].max)||(o=this.paneSettings[e].max),0<this.paneSettings.length&&!je(this.paneSettings[e])&&!je(o)?(0<o.indexOf("%")&&(o=this.convertPercentageToPixel(o).toString()),this.convertPixelToNumber(o)):n},yKe.prototype.getPreviousPaneIndex=function(){var e=this.enableReversePanes?parseInt(this.currentSeparator.style.order,10)+1:parseInt(this.currentSeparator.style.order,10)-1;return this.getOrderIndex(e,"pane")},yKe.prototype.getNextPaneIndex=function(){var e=this.enableReversePanes?parseInt(this.currentSeparator.style.order,10)-1:parseInt(this.currentSeparator.style.order,10)+1;return this.getOrderIndex(e,"pane")},yKe.prototype.getPaneDetails=function(){var e=null,t=null;this.order=parseInt(this.currentSeparator.style.order,10),1<this.allPanes.length&&(e=this.getPrevPane(this.order),t=this.getNextPane(this.order)),e&&t&&(this.previousPane=e,this.nextPane=t,this.prevPaneIndex=this.getPreviousPaneIndex(),this.nextPaneIndex=this.getNextPaneIndex())},yKe.prototype.getPaneHeight=function(e){return("Horizontal"===this.orientation?e.offsetWidth:e.offsetHeight).toString()},yKe.prototype.isValidSize=function(e){var t=!1;return t=!je(this.paneSettings[e])&&!je(this.paneSettings[e].size)&&-1<this.paneSettings[e].size.indexOf("%")?!0:t},yKe.prototype.getPaneDimensions=function(){this.previousPaneHeightWidth=""===this.previousPane.style.flexBasis?this.getPaneHeight(this.previousPane):this.previousPane.style.flexBasis,this.nextPaneHeightWidth=""===this.nextPane.style.flexBasis?this.getPaneHeight(this.nextPane):this.nextPane.style.flexBasis,this.isValidSize(this.prevPaneIndex)&&(this.previousPaneHeightWidth=this.convertPercentageToPixel(this.previousPaneHeightWidth).toString(),this.updatePrePaneInPercentage=!0),this.isValidSize(this.nextPaneIndex)&&(this.nextPaneHeightWidth=this.convertPercentageToPixel(this.nextPaneHeightWidth).toString(),this.updateNextPaneInPercentage=!0),this.prePaneDimenson=this.convertPixelToNumber(this.previousPaneHeightWidth.toString()),this.nextPaneDimension=this.convertPixelToNumber(this.nextPaneHeightWidth.toString())},yKe.prototype.checkCoordinates=function(e,t){var i=!0;return i=e===this.previousCoordinates.x&&t===this.previousCoordinates.y?!1:i},yKe.prototype.isCursorMoved=function(e){return"mouse"!==this.getEventType(e.type)&&(je(e.pointerType)||"mouse"!==this.getEventType(e.pointerType))&&"msie"!==F.info.name?this.checkCoordinates(e.touches[0].pageX,e.touches[0].pageY):this.checkCoordinates(e.pageX,e.pageY)},yKe.prototype.getBorder=function(){this.border=0;var e="Horizontal"===this.orientation?(this.element.offsetWidth-this.element.clientWidth)/2:(this.element.offsetHeight-this.element.clientHeight)/2;this.border="chrome"!==F.info.name?this.border:e},yKe.prototype.onMouseMove=function(e){if(this.isCursorMoved(e)){this.getPaneDetails(),this.getPaneDimensions(),this.triggerResizing(e);for(var e=this.validateDraggedPosition(this.getSeparatorPosition(e),this.prePaneDimenson,this.nextPaneDimension),t=(this.getBorder(),e="Horizontal"===this.orientation?this.element.getBoundingClientRect().left+e-this.currentSeparator.getBoundingClientRect().left+this.border:this.element.getBoundingClientRect().top+e-this.currentSeparator.getBoundingClientRect().top+this.border,this.nextPaneHeightWidth="string"==typeof this.nextPaneHeightWidth&&-1<this.nextPaneHeightWidth.indexOf("p")?this.convertPixelToNumber(this.nextPaneHeightWidth):parseInt(this.nextPaneHeightWidth,10),this.previousPaneHeightWidth="string"==typeof this.previousPaneHeightWidth&&-1<this.previousPaneHeightWidth.indexOf("p")?this.convertPixelToNumber(this.previousPaneHeightWidth):parseInt(this.previousPaneHeightWidth,10),this.prevPaneCurrentWidth=e+this.previousPaneHeightWidth,this.nextPaneCurrentWidth=this.nextPaneHeightWidth-e,this.validateMinMaxValues(),this.nextPaneCurrentWidth<0&&(this.nextPaneCurrentWidth=0),this.prevPaneCurrentWidth<0&&(this.prevPaneCurrentWidth=0),this.nextPaneCurrentWidth+this.prevPaneCurrentWidth>this.totalWidth&&(this.nextPaneCurrentWidth<this.prevPaneCurrentWidth?this.prevPaneCurrentWidth=this.prevPaneCurrentWidth-(this.nextPaneCurrentWidth+this.prevPaneCurrentWidth-this.totalWidth):this.nextPaneCurrentWidth=this.nextPaneCurrentWidth-(this.nextPaneCurrentWidth+this.prevPaneCurrentWidth-this.totalWidth)),this.nextPaneCurrentWidth+this.prevPaneCurrentWidth<this.totalWidth&&(e=this.totalWidth-(this.nextPaneCurrentWidth+this.prevPaneCurrentWidth),this.nextPaneCurrentWidth=this.nextPaneCurrentWidth+e),this.calculateCurrentDimensions(),this.addStaticPaneClass(),0),i=0;i<this.paneSettings.length;i++)""===this.paneSettings[i].size?t+=1:""!==this.allPanes[i].style.flexBasis&&(this.paneSettings[i].size=this.allPanes[i].style.flexBasis);e=t===this.allPanes.length,e=(""!==this.previousPane.style.flexBasis||""!==this.nextPane.style.flexBasis||e?e?(this.previousPane.style.flexBasis=this.prevPaneCurrentWidth,U([this.previousPane],YXe),this.nextPane.style.flexBasis=this.nextPaneCurrentWidth,U([this.nextPane],YXe)):(""!==this.previousPane.style.flexBasis&&this.previousPane.classList.contains(YXe)&&(this.previousPane.style.flexBasis=this.prevPaneCurrentWidth),""!==this.nextPane.style.flexBasis&&this.nextPane.classList.contains(YXe)&&(this.nextPane.style.flexBasis=this.nextPaneCurrentWidth)):(e=this.allPanes.length%this.allBars.length,this.prevPaneIndex!==e&&this.nextPaneIndex===e?(this.previousPane.style.flexBasis=this.prevPaneCurrentWidth,U([this.previousPane],YXe)):(this.nextPane.style.flexBasis=this.nextPaneCurrentWidth,U([this.nextPane],YXe))),""!==this.previousPane.style.flexBasis&&""!==this.nextPane.style.flexBasis);2<this.allPanes.length||!e||this.updateSplitterSize()}},yKe.prototype.validateMinRange=function(e,t){var i,n=null;return je(this.paneSettings[e])||je(this.paneSettings[e].min)||(n=this.paneSettings[e].min.toString()),je(n)||(0<n.indexOf("%")&&(n=this.convertPercentageToPixel(n).toString()),t<(e=this.convertPixelToNumber(n))&&(this.totalWidth=this.totalWidth-(t-e<=0?0:t-e),this.totalPercent=this.convertPixelToPercentage(this.totalWidth),i=e)),je(i)?t:i},yKe.prototype.validateMaxRange=function(e,t){var i,n=null;return je(this.paneSettings[e])||je(this.paneSettings[e].max)||(n=this.paneSettings[e].max.toString()),je(n)||(0<n.indexOf("%")&&(n=this.convertPercentageToPixel(n).toString()),(e=this.convertPixelToNumber(n))<t&&(this.totalWidth=this.totalWidth-(t-e),this.totalPercent=this.convertPixelToPercentage(this.totalWidth),i=e)),je(i)?t:i},yKe.prototype.validateMinMaxValues=function(){this.prevPaneCurrentWidth=this.validateMinRange(this.prevPaneIndex,this.prevPaneCurrentWidth),this.nextPaneCurrentWidth=this.validateMinRange(this.nextPaneIndex,this.nextPaneCurrentWidth),this.prevPaneCurrentWidth=this.validateMaxRange(this.prevPaneIndex,this.prevPaneCurrentWidth),this.nextPaneCurrentWidth=this.validateMaxRange(this.nextPaneIndex,this.nextPaneCurrentWidth)},yKe.prototype.equatePaneWidths=function(){var e;this.prevPaneCurrentWidth+this.nextPaneCurrentWidth>this.totalPercent&&(e=this.prevPaneCurrentWidth+this.nextPaneCurrentWidth-this.totalPercent,this.prevPaneCurrentWidth=this.prevPaneCurrentWidth-e/2+"%",this.nextPaneCurrentWidth=this.nextPaneCurrentWidth-e/2+"%"),this.prevPaneCurrentWidth+this.nextPaneCurrentWidth<this.totalPercent&&(e=this.totalPercent-(this.prevPaneCurrentWidth+this.nextPaneCurrentWidth),this.prevPaneCurrentWidth=this.prevPaneCurrentWidth+e/2+"%",this.nextPaneCurrentWidth=this.nextPaneCurrentWidth+e/2+"%")},yKe.prototype.calculateCurrentDimensions=function(){this.updatePrePaneInPercentage||this.updateNextPaneInPercentage?(this.prevPaneCurrentWidth=Math.round(Number(Math.round(10*this.convertPixelToPercentage(this.prevPaneCurrentWidth))/10)),this.nextPaneCurrentWidth=Math.round(Number(Math.round(10*this.convertPixelToPercentage(this.nextPaneCurrentWidth))/10)),0===this.prevPaneCurrentWidth&&(this.nextPaneCurrentWidth=this.totalPercent),0===this.nextPaneCurrentWidth&&(this.prevPaneCurrentWidth=this.totalPercent),this.prevPaneCurrentWidth+this.nextPaneCurrentWidth!==this.totalPercent?this.equatePaneWidths():(this.prevPaneCurrentWidth=this.prevPaneCurrentWidth+"%",this.nextPaneCurrentWidth=this.nextPaneCurrentWidth+"%"),this.prevPaneCurrentWidth=this.updatePrePaneInPercentage?this.prevPaneCurrentWidth:this.convertPercentageToPixel(this.prevPaneCurrentWidth)+"px",this.nextPaneCurrentWidth=this.updateNextPaneInPercentage?this.nextPaneCurrentWidth:this.convertPercentageToPixel(this.nextPaneCurrentWidth)+"px",this.updatePrePaneInPercentage=!1,this.updateNextPaneInPercentage=!1):(this.prevPaneCurrentWidth=this.prevPaneCurrentWidth+"px",this.nextPaneCurrentWidth=this.nextPaneCurrentWidth+"px")},yKe.prototype.addStaticPaneClass=function(){this.previousPane.classList.contains(YXe)||""===this.previousPane.style.flexBasis||this.previousPane.classList.contains(hKe)||this.previousPane.classList.add(YXe),this.nextPane.classList.contains(YXe)||""===this.nextPane.style.flexBasis||this.nextPane.classList.contains(hKe)||this.nextPane.classList.add(YXe)},yKe.prototype.validateDraggedPosition=function(e,t,i){var n="Horizontal"===this.orientation?this.currentSeparator.offsetLeft:this.currentSeparator.offsetTop,t=n-t,i=i+n,n=this.getMinMax(this.prevPaneIndex,this.previousPane,"min"),o=this.getMinMax(this.nextPaneIndex,this.nextPane,"min"),r=this.getMinMax(this.prevPaneIndex,this.previousPane,"max"),s=this.getMinMax(this.nextPaneIndex,this.nextPane,"max"),a=e;return i-o<e?a=i-o:e<t+n&&(a=t+n),je(r)?je(s)||e<i-s&&(a=i-s):t+r<e&&(a=t+r),a},yKe.prototype.onMouseUp=function(e){q([this.currentSeparator],$Xe),this.unwireResizeEvents();for(var e={event:e,element:this.element,pane:[this.previousPane,this.nextPane],index:[this.prevPaneIndex,this.nextPaneIndex],separator:this.currentSeparator,paneSize:[this.prePaneDimenson,this.nextPaneDimension]},t=0;t<this.element.querySelectorAll("iframe").length;t++)this.element.querySelectorAll("iframe")[t].style.pointerEvents="auto";this.trigger("resizeStop",e),this.enablePersistence&&((e=this.paneSettings)[this.getPreviousPaneIndex()].size=this.allPanes[this.getPreviousPaneIndex()].style.flexBasis,e[this.getNextPaneIndex()].size=this.allPanes[this.getNextPaneIndex()].style.flexBasis,this.setProperties({paneSettings:e},!0))},yKe.prototype.panesDimension=function(e,t){var i,n=t.length;parseInt(this.getHeight(this.element),10),je(this.paneSettings[e])?gt(t[e],{order:2*e}):je(this.paneSettings[e].size)?(this.sizeFlag=!0,gt(t[e],{order:2*e})):(i=this.paneSettings[e].size,e<n&&(gt(t[e],{"flex-basis":i,order:2*e}),e<n-1&&""!==this.paneSettings[e].size?U([t[e]],YXe):this.sizeFlag||(t[e].style.flexBasis=null),e===n-1)&&this.sizeFlag&&""!==this.paneSettings[e].size&&U([t[e]],YXe)),this.paneOrder.push(2*e)},yKe.prototype.setTemplate=function(e,t){t.innerHTML="",e="string"==typeof e?this.sanitizeHelper(e):e,this.templateCompile(t,e),this.isReact&&this.renderReactTemplates()},yKe.prototype.templateCompile=function(t,e){var i=this.createElement("div");this.compileElement(i,e,"content"),0!==i.childNodes.length&&[].slice.call(i.childNodes).forEach(function(e){t.appendChild(e)})},yKe.prototype.compileElement=function(t,e,i){if("string"==typeof e){if("."===e[0]||"#"===e[0]){var n=document.querySelector(e);if(!je(n))return this.templateElement.push(n),"none"===n.style.display&&n.style.removeProperty("display"),""===n.getAttribute("style")&&n.removeAttribute("style"),void t.appendChild(n)}e=e.trim()}var o,n=je(e.outerHTML)?oo(e):oo(e.outerHTML);je(n)||(o=n({},this,i,this.element.id+"content"+this.allPanes.length.toString(),!0)),!je(n)&&o&&0<o.length&&[].slice.call(o).forEach(function(e){t.appendChild(e)})},yKe.prototype.paneCollapsible=function(e,t){(this.paneSettings[t].collapsible?U:q)([e],iKe)},yKe.prototype.createSplitPane=function(e){for(var t,i=e.children.length,n=0;n<this.paneSettings.length;n++)i<this.paneSettings.length&&(t=this.createElement("div"),this.element.appendChild(t),i+=1);var i=e.children.length,o=[].slice.call(e.children);if(this.sizeFlag=!1,0<i)for(n=0;n<i;n++)"DIV"!==o[n].nodeName&&"SPAN"!==o[n].nodeName||(this.allPanes.push(o[n]),"Horizontal"===this.orientation?U([o[n]],[jXe,WXe,XXe]):U([o[n]],[jXe,QXe,XXe]),this.panesDimension(n,o),je(this.paneSettings[n])||je(this.paneSettings[n].content)||this.setTemplate(this.paneSettings[n].content,o[n]),!je(this.paneSettings[n])&&this.paneSettings[n].cssClass&&this.setCssClass(o[n],this.paneSettings[n].cssClass),je(this.paneSettings[n]))||this.paneCollapsible(o[n],n)},yKe.prototype.expand=function(e){this.collapsedOnchange(e),this.updatePaneSettings(e,!1)},yKe.prototype.collapse=function(e){this.isCollapsed(e),this.updatePaneSettings(e,!0)},yKe.prototype.destroy=function(){if(!this.isDestroyed){for(mKe.prototype.destroy.call(this),E.remove(document,"touchstart click",this.onDocumentClick),E.remove(this.element,"keydown",this.onMove),this.element.ownerDocument.defaultView.removeEventListener("resize",this.onReportWindowSize,!0);0<this.element.attributes.length;)this.element.removeAttribute(this.element.attributes[0].name);for(var e=0;e<this.wrapper.attributes.length;e++)this.element.setAttribute(this.wrapper.attributes[e].name,this.wrapper.attributes[e].value);this.refreshing&&(U([this.element],["e-control","e-lib",_Xe]),this.allBars=[],this.allPanes=[]),this.restoreElem(),this.isReact&&this.clearTemplate();var t=this.element.querySelectorAll(".e-split-bar");if(0<t.length)for(e=0;e<t.length;e++)E.remove(t[e],"touchstart",this.clickHandler),E.remove(t[e],"touchstart",this.onMouseDown),E.remove(t[e],"click",this.clickHandler),E.remove(t[e],"mousedown",this.onMouseDown),t[e].parentNode.removeChild(t[e]);var i=this.element.querySelectorAll(".e-pane");if(0<i.length)for(e=0;e<i.length;e++)for(i[e].classList.remove(WXe,QXe,YXe,XXe,jXe,cKe,eKe,iKe,hKe,pKe);0<i[e].attributes.length;)i[e].removeAttribute(i[e].attributes[0].name);this.allBars=[],this.allBars=null,this.allPanes=[],this.allPanes=null,this.previousPane=null,this.nextPane=null,this.currentSeparator=null,this.wrapper=null,this.prevBar=null,this.nextBar=null,this.templateElement=null}},yKe.prototype.restoreElem=function(){if(0<this.templateElement.length)for(var e=0;e<this.templateElement.length;e++)this.templateElement[e].style.display="none",document.body.appendChild(this.templateElement[e])},yKe.prototype.addPaneClass=function(e){return"Horizontal"===this.orientation?U([e],[jXe,WXe,XXe]):U([e],[jXe,QXe,XXe]),e},yKe.prototype.removePaneOrders=function(e){for(var t=this.element.childNodes,i=[],n=0;t.length<0;n++)t[n].classList.contains(e)&&i.push(t[n]);for(n=0;n<i.length;n++)i[n].style.removeProperty("order")},yKe.prototype.setPaneOrder=function(){for(var e=0;e<this.allPanes.length;e++)this.panesDimension(e,this.allPanes)},yKe.prototype.removeSeparator=function(){for(var e=0;e<this.allBars.length;e++)G(this.allBars[e]);this.allBars=[]},yKe.prototype.updatePanes=function(){this.setPaneOrder(),this.removeSeparator(),this.addSeparator(this.element)},yKe.prototype.addPane=function(e,t){var i=this.createElement("div"),i=this.addPaneClass(i),n=(t=t>this.allPanes.length+1?this.allPanes.length:t,{size:je(e.size)?"":e.size,min:je(e.min)?null:e.min,max:je(e.max)?null:e.max,content:je(e.content)?"":e.content,resizable:!!je(e.resizable)||e.resizable,collapsible:!je(e.collapsible)&&e.collapsible,collapsed:!je(e.collapsed)&&e.collapsed,cssClass:je(e.cssClass)?"":e.cssClass});this.paneSettings.splice(t,0,n),this.setProperties({paneSettings:this.paneSettings},!0),"Horizontal"===this.orientation?(this.element.insertBefore(i,this.element.querySelectorAll("."+WXe)[t]),this.removePaneOrders(WXe)):(this.element.insertBefore(i,this.element.querySelectorAll("."+QXe)[t]),this.removePaneOrders(QXe)),this.allPanes.splice(t,0,i),this.updatePanes(),this.setTemplate(this.paneSettings[t].content,i),this.setCssClass(this.allPanes[t],e.cssClass),this.allPanes[this.allPanes.length-1].classList.remove(YXe)},yKe.prototype.removePane=function(e){e=e>this.allPanes.length+1?this.allPanes.length:e;var t="Horizontal"===this.orientation?WXe:QXe;je(this.element.querySelectorAll("."+t)[e])||(G(this.element.querySelectorAll("."+t)[e]),this.allPanes.splice(e,1),this.removePaneOrders(t),this.updatePanes(),this.paneSettings.splice(e,1),this.setProperties({paneSettings:this.paneSettings},!0),0<this.allPanes.length&&this.allPanes[this.allPanes.length-1].classList.remove(YXe))},gRe([e("100%")],yKe.prototype,"height",void 0),gRe([e(!1)],yKe.prototype,"enableReversePanes",void 0),gRe([e("100%")],yKe.prototype,"width",void 0),gRe([e(!1)],yKe.prototype,"enablePersistence",void 0),gRe([kt([],qo)],yKe.prototype,"paneSettings",void 0),gRe([e("Horizontal")],yKe.prototype,"orientation",void 0),gRe([e("")],yKe.prototype,"cssClass",void 0),gRe([e(!0)],yKe.prototype,"enabled",void 0),gRe([e(!0)],yKe.prototype,"enableHtmlSanitizer",void 0),gRe([e(null)],yKe.prototype,"separatorSize",void 0),gRe([i()],yKe.prototype,"beforeSanitizeHtml",void 0),gRe([i()],yKe.prototype,"created",void 0),gRe([i()],yKe.prototype,"resizeStart",void 0),gRe([i()],yKe.prototype,"resizing",void 0),gRe([i()],yKe.prototype,"resizeStop",void 0),gRe([i()],yKe.prototype,"beforeCollapse",void 0),gRe([i()],yKe.prototype,"beforeExpand",void 0),gRe([i()],yKe.prototype,"collapsed",void 0),gRe([i()],yKe.prototype,"expanded",void 0);var mKe,fKe=gRe([Bt],yKe);function yKe(e,t){e=mKe.call(this,e,t)||this;return e.needsID=!0,e}vKe=function(e,t){return(vKe=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])}))(e,t)};var vKe,bKe,d2=function(e,t){function i(){this.constructor=e}vKe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},M$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},wKe="e-prevent",CKe="e-dragging",SKe="e-drag",AKe="e-responsive",xKe="e-panel-content",IKe="e-panel-container",TKe="e-panel-header",EKe=(d2(DKe,bKe=n),M$([e("")],DKe.prototype,"id",void 0),M$([e("")],DKe.prototype,"cssClass",void 0),M$([e("")],DKe.prototype,"header",void 0),M$([e("")],DKe.prototype,"content",void 0),M$([e(!0)],DKe.prototype,"enabled",void 0),M$([e(0)],DKe.prototype,"row",void 0),M$([e(0)],DKe.prototype,"col",void 0),M$([e(1)],DKe.prototype,"sizeX",void 0),M$([e(1)],DKe.prototype,"sizeY",void 0),M$([e(1)],DKe.prototype,"minSizeY",void 0),M$([e(1)],DKe.prototype,"minSizeX",void 0),M$([e(null)],DKe.prototype,"maxSizeY",void 0),M$([e(null)],DKe.prototype,"maxSizeX",void 0),M$([e(1e3)],DKe.prototype,"zIndex",void 0),DKe);function DKe(){return null!==bKe&&bKe.apply(this,arguments)||this}d2(kKe,MKe=Ji),kKe.prototype.preRender=function(){this.panelCollection=[],this.sortedArray=[],this.gridPanelCollection=[],this.overlapElement=[],this.overlapElementClone=[],this.overlapSubElementClone=[],this.collisionChecker={},this.dragCollection=[],this.elementRef={top:"",left:"",height:"",width:""},this.dimensions=[],this.allItems=[],this.oldRowCol={},this.availableClasses=[],this.setOldRowCol(),this.calculateCellSize(),this.contentTemplateChild=[].slice.call(this.element.children)},kKe.prototype.setOldRowCol=function(){for(var e=0;e<this.panels.length;e++)this.panels[e].id||(this.panelPropertyChange(this.panels[e],{id:"layout_"+this.panelID.toString()}),this.panelID=this.panelID+1),this.oldRowCol[this.panels[e].id]={row:this.panels[e].row,col:this.panels[e].col}},kKe.prototype.createPanelElement=function(e,t){var i=this.createElement("div");return e&&0<e.length&&U([i],e),t&&i.setAttribute("id",t),i},kKe.prototype.render=function(){this.element.setAttribute("role","list"),this.initialize(),this.isRenderComplete=!0,this.showGridLines&&!this.checkMediaQuery()&&this.initGridLines(),this.updateDragArea(),this.renderComplete(),this.renderReactTemplates()},kKe.prototype.initGridLines=function(){this.table=document.createElement("table");var e=document.createElement("tbody");this.table.classList.add("e-dashboard-gridline-table"),this.table.setAttribute("role","presentation");for(var t=0;t<this.maxRow();t++){for(var i=document.createElement("tr"),n=0;n<this.columns;n++){var o=document.createElement("td");o.classList.add("e-dashboard-gridline"),this.setAttributes({value:{row:t.toString(),col:n.toString(),sizeX:"1",sizeY:"1"}},o),this.setPanelPosition(o,t,n),this.setHeightAndWidth(o,{row:t,col:n,sizeX:1,sizeY:1}),i.appendChild(o)}e.appendChild(i)}this.table.appendChild(e),this.element.appendChild(this.table),this.renderReactTemplates()},kKe.prototype.initialize=function(){if(this.updateRowHeight(),0<this.element.childElementCount&&0<this.element.querySelectorAll(".e-panel").length){var e=[];this.setProperties({panels:[]},!0),this.isInlineRendering=!0;for(var t=0;t<this.element.querySelectorAll(".e-panel").length;t++)e.push(this.element.querySelectorAll(".e-panel")[t]);for(t=0;t<e.length;t++){var i=e[t];this.enableRtl&&U([i],"e-rtl"),this.getInlinePanels(i),this.maxCol(),this.maxRow()}for(t=0;t<this.panels.length;t++){var i=this.element.querySelector("#"+this.panels[t].id),n=(this.setMinMaxValues(this.panels[t]),(this.maxColumnValue<this.panels[t].col||this.maxColumnValue<this.panels[t].col+this.panels[t].sizeX)&&(n=this.maxColumnValue-this.panels[t].sizeX,this.panelPropertyChange(this.panels[t],{col:n<0?0:n})),this.setXYAttributes(i,this.panels[t]),this.renderPanels(i,this.panels[t],this.panels[t].id,!1));this.panelCollection.push(n),this.setHeightAndWidth(i,this.panels[t]),(this.tempObject=this).mediaQuery&&!window.matchMedia("("+this.mediaQuery+")").matches&&(this.setPanelPosition(i,this.panels[t].row,this.panels[t].col),this.mainElement=i,this.updatePanelLayout(i,this.panels[t]),this.mainElement=null),this.setClasses([i])}this.updateOldRowColumn(),this.checkMediaQuery()&&this.checkMediaQuerySizing()}else this.renderDashBoardCells(this.panels);!this.allowDragging||this.mediaQuery&&window.matchMedia("("+this.mediaQuery+")").matches||this.enableDraggingContent(this.panelCollection),this.sortedPanel(),this.bindEvents(),this.updatePanels(),this.updateCloneArrayObject(),this.checkColumnValue=this.maxColumnValue,this.checkMediaQuery()||this.panelResponsiveUpdate(),this.setEnableRtl()},kKe.prototype.checkMediaQuery=function(){return this.mediaQuery&&window.matchMedia("("+this.mediaQuery+")").matches},kKe.prototype.calculateCellSize=function(){this.cellSize=[],this.checkMediaQuery()?this.cellSize[1]=this.element.parentElement&&this.element.parentElement.offsetWidth/this.cellAspectRatio:(this.cellSize[0]=this.element.parentElement&&this.element.parentElement.offsetWidth,je(this.cellSpacing)||(this.cellSize[0]=this.element.parentElement&&(this.element.parentElement.offsetWidth-(this.maxCol()-1)*this.cellSpacing[0])/this.maxCol()),this.cellSize[1]=this.cellSize[0]/this.cellAspectRatio)},kKe.prototype.maxRow=function(e){var t=1;if(1<this.rows&&je(e))return t=this.rows;for(var i=0;i<this.panels.length;i++)this.panels[i].sizeY+this.panels[i].row>t&&(t=this.panels[i].sizeY+this.panels[i].row);return t=0===this.panels.length?this.columns:t},kKe.prototype.maxCol=function(){var e=this.columns;return this.maxColumnValue=e},kKe.prototype.updateOldRowColumn=function(){for(var e=0;e<this.panels.length;e++){var t,i=this.panels[e].id;this.element.querySelector("[id='"+i+"']")&&(t=parseInt(this.element.querySelector("[id='"+i+"']").getAttribute("data-row"),10),i=parseInt(this.element.querySelector("[id='"+i+"']").getAttribute("data-col"),10),this.oldRowCol[this.panels[e].id]={row:t,col:i})}},kKe.prototype.createSubElement=function(e,t,i){var n=this.createElement("div");return i&&U([n],[i]),e&&0<e.length&&U([n],e),t&&n.setAttribute("id",t),n},kKe.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){var i=go.sanitize(t);return oo(this.enableHtmlSanitizer&&"string"==typeof t?i:t)}},kKe.prototype.renderTemplate=function(e,t,i,n,o){var r=this.templateParser(e),s=[];if("."!==e[0]&&"#"!==e[0]||"SCRIPT"===document.querySelector(e).tagName){r=r({},this,o,i,n,null,t);if(r){for(var a=0,l=r;a<l.length;a++){var h=l[a];s.push(h)}ht([].slice.call(s),t)}}else{o=document.querySelector(e);je(o)?e.trim():("none"===o.style.display&&o.style.removeProperty("display"),""===o.getAttribute("style")&&o.removeAttribute("style"),t.appendChild(o))}},kKe.prototype.renderPanels=function(e,t,i,n){U([e],["e-panel","e-panel-transition"]),e.setAttribute("role","listitem"),this.allowDragging&&e.setAttribute("aria-grabbed","false");var o,r=t.cssClass?t.cssClass.split(" "):null;return this.panelContent=e.querySelector(".e-panel-container")?e.querySelector(".e-panel-container"):this.createSubElement(r,e.id+"_content",IKe),e.appendChild(this.panelContent),t.enabled||this.disablePanel(e),t.header&&(U([r=e.querySelector(".e-panel-header")?e.querySelector(".e-panel-header"):this.createSubElement([],e.id+"template","")],[TKe]),e.querySelector(".e-panel-header")||(o=this.element.id+"HeaderTemplate"+i,this.renderTemplate(t.header,r,o,n,"header"),this.panelContent.appendChild(r),this.renderReactTemplates())),t.content&&(r=t.cssClass?t.cssClass.split(" "):null,this.panelBody=e.querySelector(".e-panel-content")?e.querySelector(".e-panel-content"):this.createSubElement(r,e.id+"_body",xKe),r=this.panelContent.querySelector(".e-panel-header")?window.getComputedStyle(this.panelContent.querySelector(".e-panel-header")).height:"0px",gt(this.panelBody,{height:"calc( 100% - "+r+")"}),e.querySelector(".e-panel-content")||(o=this.element.id+"ContentTemplate"+i,this.renderTemplate(t.content,this.panelBody,o,n,"content"),this.panelContent.appendChild(this.panelBody),this.renderReactTemplates())),e},kKe.prototype.disablePanel=function(e){U([e],["e-disabled"])},kKe.prototype.getInlinePanels=function(e){var t={sizeX:e.hasAttribute("data-sizex")?parseInt(e.getAttribute("data-sizex"),10):1,sizeY:e.hasAttribute("data-sizey")?parseInt(e.getAttribute("data-sizey"),10):1,minSizeX:e.hasAttribute("data-minsizex")?parseInt(e.getAttribute("data-minsizex"),10):1,minSizeY:e.hasAttribute("data-minsizey")?parseInt(e.getAttribute("data-minsizey"),10):1,maxSizeX:e.hasAttribute("data-maxsizex")?parseInt(e.getAttribute("data-maxsizex"),10):null,maxSizeY:e.hasAttribute("data-maxsizey")?parseInt(e.getAttribute("data-maxsizey"),10):null,row:e.hasAttribute("data-row")?parseInt(e.getAttribute("data-row"),10):0,col:e.hasAttribute("data-col")?parseInt(e.getAttribute("data-col"),10):0,id:e.getAttribute("id"),zIndex:e.hasAttribute("data-zindex")?parseInt(e.getAttribute("data-zIndex"),10):1e3,header:e.querySelector(".e-panel-header")&&".e-panel-header",content:e.querySelector(".e-panel-content")&&".e-panel-content"},e=(t.id||(t.id="layout_"+this.panelID.toString(),e.setAttribute("id",t.id),this.panelID=this.panelID+1),ee(t.enabled)&&(t.enabled=!0),e.style.zIndex=""+t.zIndex,new EKe(this,"panels",t,!0));this.panels.push(e),this.oldRowCol[t.id]={row:t.row,col:t.col}},kKe.prototype.resizeEvents=function(){if(this.allowResizing)for(var e=this.element.querySelectorAll(".e-panel .e-panel-container .e-resize"),t=0;t<e.length;t++){var i="msie"===F.info.name?"mousedown pointerdown":"mousedown";E.add(e[t],i,this.downResizeHandler,this),"msie"!==F.info.name&&E.add(e[t],"touchstart",this.touchDownResizeHandler,this)}},kKe.prototype.bindEvents=function(){this.refreshListener=this.refresh.bind(this),E.add(window,"resize",this.refreshListener),this.resizeEvents()},kKe.prototype.downResizeHandler=function(e){for(var t,i,n=z(e.currentTarget,".e-panel"),o=0;this.panels.length>o;o++)this.panels[o].enabled&&this.panels[o].id===n.id&&(this.downHandler(e),this.lastMouseX=e.pageX,this.lastMouseY=e.pageY,t="msie"===F.info.name?"mousemove pointermove":"mousemove",i="msie"===F.info.name?"mouseup pointerup":"mouseup",this.isMouseMoveBound||(E.add(document,t,this.moveResizeHandler,this),this.isMouseMoveBound=!0),this.isMouseUpBound||(E.add(document,i,this.upResizeHandler,this),this.isMouseUpBound=!0))},kKe.prototype.downHandler=function(e){this.resizeCalled=!1,this.panelsInitialModel=this.cloneModels(this.panels);var t=z(e.currentTarget,".e-panel");this.trigger("resizeStart",{event:e,element:t,isInteracted:!0}),this.downTarget=e.currentTarget,this.shadowEle=document.createElement("div"),this.shadowEle.classList.add("e-holder"),U([this.element],[wKe]),this.element.appendChild(this.shadowEle),this.renderReactTemplates(),this.elementX=parseFloat(t.style.left),this.elementY=parseFloat(t.style.top),this.elementWidth=t.offsetWidth,this.elementHeight=t.offsetHeight,this.originalWidth=this.getCellInstance(t.id).sizeX,this.originalHeight=this.getCellInstance(t.id).sizeY,this.previousRow=this.getCellInstance(t.id).row},kKe.prototype.touchDownResizeHandler=function(e){this.downHandler(e),this.lastMouseX=e.changedTouches[0].pageX,this.lastMouseY=e.changedTouches[0].pageY,this.isMouseMoveBound||(E.add(document,"touchmove",this.touchMoveResizeHandler,this),this.isMouseMoveBound=!0),this.isMouseUpBound||(E.add(document,"touchend",this.upResizeHandler,this),this.isMouseUpBound=!0)},kKe.prototype.getCellSize=function(){return[this.cellSize[0],this.cellSize[1]]},kKe.prototype.updateMaxTopLeft=function(e){this.moveTarget=this.downTarget;var t=z(this.moveTarget,".e-panel");this.trigger("resize",{event:e,element:t,isInteracted:!0})},kKe.prototype.updateResizeElement=function(e){this.maxLeft=this.element.offsetWidth-1,this.maxTop=this.cellSize[1]*this.maxRows-1,q([e],"e-panel-transition"),U([e],[CKe]);for(var t=["e-east","e-west","e-north","e-south","e-south-east","e-north-east","e-north-west","e-south-west"],i=0;i<this.moveTarget.classList.length;i++)-1!==t.indexOf(this.moveTarget.classList[i])&&(this.handleClass=this.moveTarget.classList[i])},kKe.prototype.moveResizeHandler=function(e){this.updateMaxTopLeft(e);var t,i,n=z(this.moveTarget,".e-panel");this.lastMouseX!==e.pageX&&this.lastMouseY!==e.pageY&&(this.updateResizeElement(n),t=this.getCellInstance(n.getAttribute("id")),this.mouseX=e.pageX,this.mouseY=e.pageY,e=this.mouseY-this.lastMouseY+this.mOffY,i=this.mouseX-this.lastMouseX+this.mOffX,this.mOffX=this.mOffY=0,this.lastMouseY=this.mouseY,this.lastMouseX=this.mouseX,this.resizingPanel(n,t,i,e))},kKe.prototype.touchMoveResizeHandler=function(e){this.updateMaxTopLeft(e);var t,i,n=z(this.moveTarget,".e-panel");this.lastMouseX!==e.changedTouches[0].pageX&&this.lastMouseY!==e.changedTouches[0].pageY&&(this.updateResizeElement(n),t=this.getCellInstance(n.getAttribute("id")),this.mouseX=e.changedTouches[0].pageX,this.mouseY=e.changedTouches[0].pageY,e=this.mouseX-this.lastMouseX+this.mOffX,i=this.mouseY-this.lastMouseY+this.mOffY,this.mOffX=this.mOffY=0,this.lastMouseX=this.mouseX,this.lastMouseY=this.mouseY,this.resizingPanel(n,t,e,i))},kKe.prototype.resizingPanel=function(e,t,i,n){var o=this.getCellInstance(e.id).sizeX,r=this.getCellInstance(e.id).sizeY,s=n,a=i,a=(0<=this.handleClass.indexOf("north")&&(this.elementHeight-s<this.getMinHeight(t)?(n=this.elementHeight-this.getMinHeight(t),this.mOffY=s-n):t.maxSizeY&&this.elementHeight-s>this.getMaxHeight(t)?(n=this.elementHeight-this.getMaxHeight(t),this.mOffY=s-n):this.elementY+s<this.minTop&&(n=this.minTop-this.elementY,this.mOffY=s-n),this.elementY+=n,this.elementHeight-=n),0<=this.handleClass.indexOf("south")&&(this.elementHeight+s<this.getMinHeight(t)?(n=this.getMinHeight(t)-this.elementHeight,this.mOffY=s-n):t.maxSizeY&&this.elementHeight+s>this.getMaxHeight(t)&&(n=this.getMaxHeight(t)-this.elementHeight,this.mOffY=s-n),this.elementHeight+=n),0<=this.handleClass.indexOf("west")&&(this.elementWidth-a<this.getMinWidth(t)?(i=this.elementWidth-this.getMinWidth(t),this.mOffX=a-i):t.maxSizeX&&this.elementWidth-a>this.getMaxWidth(t)?(i=this.elementWidth-this.getMaxWidth(t),this.mOffX=a-i):this.elementX+a<this.minLeft&&(i=this.minLeft-this.elementX,this.mOffX=a-i),this.elementX+=i,this.elementWidth-=i),0<=this.handleClass.indexOf("east")&&(this.elementWidth+a<this.getMinWidth(t)?(i=this.getMinWidth(t)-this.elementWidth,this.mOffX=a-i):t.maxSizeX&&this.elementWidth+a>this.getMaxWidth(t)&&(i=this.getMaxWidth(t)-this.elementWidth,this.mOffX=a-i),s=this.elementWidth,this.elementWidth+=i,n=this.pixelsToColumns(this.elementWidth-t.sizeX*this.cellSpacing[1],!0),this.columns<t.col+n)&&(this.elementWidth=s),e.style.top=this.elementY+"px",e.style.left=this.elementX+"px",e.style.width=this.elementWidth+"px",e.style.height=this.elementHeight+"px",this.getResizeRowColumn(t));a.col+a.sizeX>this.columns&&this.panelPropertyChange(a,{sizeX:a.sizeX-1}),this.shadowEle.style.top=a.row*this.getCellSize()[1]+a.row*this.cellSpacing[1]+"px",0<=this.handleClass.indexOf("west")?this.shadowEle.style.left=a.col*this.getCellSize()[0]+(a.col-1)*this.cellSpacing[0]+"px":this.shadowEle.style.left=a.col*this.getCellSize()[0]+a.col*this.cellSpacing[0]+"px",this.shadowEle.style.height=a.sizeY*(this.getCellSize()[1]+this.cellSpacing[1])+"px",this.shadowEle.style.width=a.sizeX*(this.getCellSize()[0]+this.cellSpacing[0])+"px",o===a.sizeX&&r===a.sizeY||(o=a.sizeX,r=a.sizeY,n={attributes:{row:(i=this.getCellInstance(e.id)).row.toString(),col:i.col.toString(),sizeX:i.sizeX.toString(),sizeY:i.sizeY.toString()}},this.setAttributes(n,e),this.mainElement=e,this.checkCollision=[],this.updatePanelLayout(e,this.getCellInstance(e.id)),this.updateOldRowColumn(),this.sortedPanel())},kKe.prototype.upResizeHandler=function(e){var t,i,n;je(this.downTarget)||(this.upTarget=this.downTarget,t={event:e,element:e=z(this.upTarget,".e-panel"),isInteracted:!0},e&&(U([e],"e-panel-transition"),n="msie"===F.info.name?"mousemove pointermove":"mousemove",i="msie"===F.info.name?"mouseup pointerup":"mouseup",E.remove(document,n,this.moveResizeHandler),E.remove(document,i,this.upResizeHandler),"msie"!==F.info.name&&(E.remove(document,"touchmove",this.touchMoveResizeHandler),E.remove(document,"touchend",this.upResizeHandler)),this.isMouseUpBound=!1,this.isMouseMoveBound=!1,this.shadowEle&&G(this.shadowEle),this.shadowEle=null,n=this.getCellInstance(e.getAttribute("id")),this.setPanelPosition(e,n.row,n.col),this.setHeightAndWidth(e,n)),q([e],[CKe]),this.trigger("resizeStop",t),this.resizeCalled=!1,this.lastMouseX=this.lastMouseY=void 0,this.mOffX=this.mOffY=0,this.mainElement=null,this.allowFloating&&this.moveItemsUpwards(),this.updatePanels(),this.updateCloneArrayObject(),this.checkForChanges(!0))},kKe.prototype.getResizeRowColumn=function(e){var t=!1,i=e.col,n=(-1!==["e-west","e-south-west"].indexOf(this.handleClass)&&(i=this.pixelsToColumns(this.elementX,!1)),e.row),o=(-1!==["e-north"].indexOf(this.handleClass)&&(n=this.pixelsToRows(this.elementY,!1),this.previousRow!==n)&&(this.previousRow=n,t=!0),e.sizeX),r=(-1===["e-north","e-south"].indexOf(this.handleClass)&&(o=this.pixelsToColumns(this.elementWidth-o*this.cellSpacing[1],!0)),e.sizeY);return-1!==["e-east","e-west"].indexOf(this.handleClass)||"e-north"===this.handleClass&&!t||(r=this.pixelsToRows(this.elementHeight-r*this.cellSpacing[0],!0)),e.col+o>this.columns&&(e.sizeX=o-1),(-1<n&&-1<i&&o+i<=this.maxCol()&&r+n<=this.maxRow()&&0===this.collisions(n,i,o,r,this.getPanelBase(e.id)).length||!1!==this.allowPushing)&&this.panelPropertyChange(e,{row:n,col:i,sizeX:o,sizeY:r}),e},kKe.prototype.pixelsToColumns=function(e,t){return t?Math.ceil(e/this.cellSize[0]):Math.floor(e/(this.cellSize[0]+this.cellSpacing[0]))},kKe.prototype.pixelsToRows=function(e,t){return t?Math.round(e/this.cellSize[1]):Math.round(e/(this.cellSize[1]+this.cellSpacing[0]))},kKe.prototype.getMinWidth=function(e){return e.minSizeX*this.getCellSize()[0]+(e.minSizeX-1)*this.cellSpacing[0]},kKe.prototype.getMaxWidth=function(e){return e.maxSizeX*this.getCellSize()[0]},kKe.prototype.getMinHeight=function(e){return e.minSizeY*this.getCellSize()[1]+(e.minSizeY-1)*this.cellSpacing[1]},kKe.prototype.getMaxHeight=function(e){return e.maxSizeY*this.getCellSize()[1]},kKe.prototype.sortedPanel=function(){this.sortedArray=[];for(var e=0,t=this.panelCollection.length;e<t;++e)this.sortItem(this.panelCollection[e])},kKe.prototype.moveItemsUpwards=function(){if(!1!==this.allowFloating){for(var e=0,t=this.sortedArray.length;e<t;++e){var i=this.sortedArray[e];if(i)for(var n=0,o=i.length;n<o;++n){var r=i[n];r&&this.moveItemUpwards(r)}}this.updateGridLines()}},kKe.prototype.moveItemUpwards=function(e){if(!1!==this.allowFloating&&e!==this.mainElement){for(var t=this.getCellInstance(e.id).col,i=parseInt(e.getAttribute("data-sizeY"),10),n=parseInt(e.getAttribute("data-sizeX"),10),o=null,r=null,s=parseInt(e.getAttribute("data-row"),10)-1;-1<s;){if(0!==this.collisions(s,t,n,i,e).length)break;o=s,r=t,--s}null!==o&&this.sortItem(e,o,r)}},kKe.prototype.sortItem=function(e,t,i){this.overlapElement=[];var n,o=parseInt(e.getAttribute("data-col"),10),r=parseInt(e.getAttribute("data-row"),10);this.sortedArray[r]||(this.sortedArray[r]=[]),void 0!==(this.sortedArray[r][o]=e)&&void 0!==t&&void 0!==i&&(void 0!==this.oldRowCol[e.id]&&null!==this.oldRowCol[e.id].row&&void 0!==this.oldRowCol[e.id].col&&(n=this.sortedArray[this.oldRowCol[e.id].row],this.oldRowCol[e.id])&&n[this.oldRowCol[e.id].col]===e&&(delete n[this.oldRowCol[e.id].col],this.updateOldRowColumn(),this.sortedPanel()),this.oldRowCol[e.id].row=t,this.oldRowCol[e.id].row=i,this.sortedArray[r]||(this.sortedArray[r]=[]),this.sortedArray[r][o]=e,-1===this.allItems.indexOf(e)&&this.allItems.push(e),this.panelPropertyChange(this.getCellInstance(e.id),{row:t,col:i}),n=this.getCellInstance(e.id),this.setAttributes({value:{col:n.col.toString(),row:n.row.toString()}},e),this.updateLayout(e,this.getCellInstance(e.id)))},kKe.prototype.updateLayout=function(e,t){this.setPanelPosition(e,t.row,t.col),this.setHeightAndWidth(e,t),this.updateRowHeight(),this.sortedPanel()},kKe.prototype.refresh=function(){if(this.panelsSizeY=0,this.updateDragArea(),this.checkMediaQuery())this.checkMediaQuerySizing();else{if(this.element.classList.contains(AKe)){q([this.element],[AKe]);for(var e=this.element.querySelectorAll((this.element.id?"#"+this.element.id+" > ":"")+".e-panel"),t=0;t<e.length;t++){var i=e[t],n=this.getCellInstance(i.id),o=parseInt(i.getAttribute("data-row"),10),r=parseInt(i.getAttribute("data-col"),10);this.panelPropertyChange(n,{row:o,col:r}),this.setHeightAndWidth(i,this.getCellInstance(i.id)),this.setPanelPosition(i,o,r),this.updateRowHeight()}}this.panelResponsiveUpdate(),this.updateGridLines()}je(this.panelCollection)||(this.removeResizeClasses(this.panelCollection),this.setClasses(this.panelCollection)),this.resizeEvents(),je(this.panelCollection)||this.checkDragging(this.dragCollection)},kKe.prototype.updateGridLines=function(){this.element.querySelector(".e-dashboard-gridline-table")&&(this.table&&G(this.table),this.initGridLines())},kKe.prototype.checkDragging=function(e){if(this.checkMediaQuery()||!this.allowDragging)for(var t=0;t<e.length;t++)e[t].destroy();else{for(t=0;t<e.length;t++)e[t].destroy();this.enableDraggingContent(this.panelCollection)}},kKe.prototype.sortPanels=function(){for(var n=[],e=function(i){for(var e=0;e<o.columns;e++)!function(t){o.panels.filter(function(e){e.row===i&&e.col===t&&n.push(e)})}(e)},o=this,t=0;t<=this.rows;t++)e(t);return n},kKe.prototype.checkMediaQuerySizing=function(){var e;U([this.element],[AKe]),e=this.isPanelRemoved&&this.panels?this.panels:this.sortPanels(),this.updatedRows=e.length;for(var t=0;t<e.length;t++){var i,n=document.getElementById(e[t].id);n&&(gt(n,{width:"100%"}),n.style.height=" "+(this.element.parentElement&&this.element.parentElement.offsetWidth/this.cellAspectRatio)*e[t].sizeY+"px",1<e[t].sizeY&&(i=(this.element.parentElement&&this.element.parentElement.offsetWidth/this.cellAspectRatio)*e[t].sizeY+parseInt((Math.round(e[t].sizeY/2)*this.cellSpacing[1]).toString(),10),n.style.height=i+"px"),this.resizeHeight=!0,this.panelPropertyChange(e[t],{row:t,col:0}),this.setPanelPosition(n,e[t].row,e[t].col),this.panelsSizeY=this.panelsSizeY+e[t].sizeY,je(this.panelCollection)||(this.setClasses(this.panelCollection),this.removeResizeClasses(this.panelCollection)),je(this.dragCollection)||this.checkDragging(this.dragCollection))}this.updateRowHeight()},kKe.prototype.panelResponsiveUpdate=function(){this.element.classList.add("e-responsive"),this.calculateCellSize();for(var e=0;e<this.element.querySelectorAll(".e-panel").length;e++){var t=this.element.querySelectorAll(".e-panel")[e],i=this.getCellInstance(t.id);this.setHeightAndWidth(t,i)}for(e=0;e<this.panels.length;e++)this.setPanelPosition(document.getElementById(this.panels[e].id),this.panels[e].row,this.panels[e].col);this.updateRowHeight()},kKe.prototype.updateRowHeight=function(){this.getRowColumn(),this.setHeightWidth()},kKe.prototype.setHeightWidth=function(){if(!(je(this.cellSpacing)||0===this.panels.length&&this.panelCollection&&0===this.panelCollection.length)){if(this.checkMediaQuery()){for(var e=0,t=0;t<this.panels.length;t++)this.panels[t].sizeY&&(e+=this.panels[t].sizeY);i=e*(this.element.parentElement&&this.element.parentElement.offsetWidth/this.cellAspectRatio)+(e-1)*this.cellSpacing[1]+"px"}else i=this.maxRow()*(this.cellSize[0]/this.cellAspectRatio)+(this.maxRow()-1)*this.cellSpacing[1]+"px";gt(this.element,{height:i});var i=window.getComputedStyle(this.element).width;gt(this.element,{width:i})}},kKe.prototype.setEmptyLayoutHeight=function(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width")},kKe.prototype.setHeightAndWidth=function(e,t){gt(e,{height:T(this.setXYDimensions(t)[0])}),gt(e,{width:T(this.setXYDimensions(t)[1])})},kKe.prototype.renderCell=function(e,t,i){this.dimensions=this.setXYDimensions(e),ee(e.enabled)&&(e.enabled=!0),0<this.contentTemplateChild.length&&!je(i)?(n=this.contentTemplateChild[i],e.cssClass&&U([n],[e.cssClass]),e.id&&n.setAttribute("id",e.id)):n=this.createPanelElement(e.cssClass?e.cssClass.split(" "):null,e.id),n.style.zIndex=""+e.zIndex,this.element.appendChild(n),this.renderReactTemplates();var n,i=this.renderPanels(n,e,e.id,t);return this.panelCollection.push(i),this.setXYAttributes(n,e),this.setHeightAndWidth(n,e),n},kKe.prototype.setPanelPosition=function(e,t,i){var n,o;e&&(this.checkMediaQuery()&&this.calculateCellSize(),n=this.getCellSize()[1],o=this.getCellSize()[0],i=0===i?0:i*(o+this.cellSpacing[0]),o=0===t?0:t*(n+this.cellSpacing[1]),gt(e,{left:i+"px",top:(o=this.checkMediaQuery()?0===t?0:this.panelsSizeY*(n+this.cellSpacing[1]):o)+"px"}))},kKe.prototype.getRowColumn=function(){if(this.rows=null,0<this.element.querySelectorAll(".e-panel").length&&!this.updatedRows)for(var e=this.element.querySelectorAll(".e-panel"),t=0;t<e.length;t++){var i=e[t],n=parseInt(i.getAttribute("data-row"),10),i=parseInt(i.getAttribute("data-sizeY"),10);this.rows=Math.max(this.rows,n+i)}else{this.updatedRows&&(this.rows=this.updatedRows,this.updatedRows=null);for(t=0;t<this.panels.length;t++)this.rows=Math.max(this.rows,this.panels[t].row)}},kKe.prototype.setMinMaxValues=function(e){!e.sizeX||e.sizeX<e.minSizeX?this.panelPropertyChange(e,{sizeX:e.minSizeX}):e.maxSizeX&&e.sizeX>e.maxSizeX?this.panelPropertyChange(e,{sizeX:e.maxSizeX}):e.sizeX>this.columns?this.panelPropertyChange(e,{sizeX:this.columns}):this.panelPropertyChange(e,{sizeX:e.sizeX}),!e.sizeY||e.sizeY<e.minSizeY?this.panelPropertyChange(e,{sizeY:e.minSizeY}):e.maxSizeY&&e.sizeY>e.maxSizeY?this.panelPropertyChange(e,{sizeY:e.maxSizeY}):this.panelPropertyChange(e,{sizeY:e.sizeY})},kKe.prototype.checkMinMaxValues=function(e){e.col+e.sizeX>this.columns&&this.panelPropertyChange(e,{sizeX:e.sizeX+(this.columns-(e.col+e.sizeX))})},kKe.prototype.panelPropertyChange=function(e,t){e.setProperties(t,!0)},kKe.prototype.renderDashBoardCells=function(e){if(0<this.element.querySelectorAll(".e-panel").length||0<this.panels.length)for(var t=0;t<e.length;t++){this.gridPanelCollection.push(e[t]),this.setMinMaxValues(e[t]),(this.maxColumnValue<e[t].col||this.maxColumnValue<e[t].col+e[t].sizeX)&&this.panelPropertyChange(e[t],{col:this.maxColumnValue-e[t].sizeX});var i=this.renderCell(e[t],!1,t);this.enableRtl&&U([i],"e-rtl"),this.element.appendChild(i),this.renderReactTemplates(),this.checkMediaQuery()&&t===e.length-1?this.checkMediaQuerySizing():(this.setPanelPosition(i,e[t].row,e[t].col),this.mainElement=i,this.updatePanelLayout(i,e[t]),this.mainElement=null)}this.setClasses(this.panelCollection)},kKe.prototype.collisions=function(e,t,i,n,o){var r,s=[];i&&n||(i=n=1),!o||o instanceof Array||(o=[o]);for(var a=0;a<n;++a)for(var l=0;l<i;++l)!(r=this.getPanel(e+a,t+l,o))||o&&-1!==o.indexOf(this.element.querySelector("[id='"+r.id+"']"))||-1!==s.indexOf(this.element.querySelector("[id='"+r.id+"']"))||s.push(this.element.querySelector("[id='"+r.id+"']"));return s},kKe.prototype.rightWardsSpaceChecking=function(e,o,t){var r=this,s=[],i=[];if(e.forEach(function(e){var t=parseInt(e.getAttribute("data-col"),10),i=parseInt(e.getAttribute("data-sizeX"),10);if(o<r.columns&&o<=t)if(1<i)for(var n=t;n<t+i;n++)s.push(n);else s.push(t)}),0<s.length)for(var n=o+1;n<=this.columns-1;n++)-1===s.indexOf(n)&&n!==o&&-1===i.indexOf(n)&&i.push(n);var a=this.getOccupiedColumns(t);return a.forEach(function(e){o<e&&-1!==i.indexOf(e)&&i.splice(i.indexOf(e),1)}),this.getOccupiedColumns(this.checkingElement).forEach(function(e){e>parseInt(t.getAttribute("data-col"),10)&&-1===a.indexOf(e)&&-1===i.indexOf(e)&&i.push(e)}),i=i.sort(function(e,t){return e-t})},kKe.prototype.getOccupiedColumns=function(e){for(var t=[],i=parseInt(e.getAttribute("data-sizeX"),10),n=parseInt(e.getAttribute("data-col"),10),o=n;o<n+i&&o<=this.columns;o++)t.push(o);return t},kKe.prototype.leftWardsSpaceChecking=function(e,o,t){var r=this,i=[],s=[];if(e.forEach(function(e){var t=parseInt(e.getAttribute("data-col"),10),i=parseInt(e.getAttribute("data-sizeX"),10);if(o<=r.columns&&t<=o)if(1<i)for(var n=t;n<t+i;n++)s.push(n);else s.push(t)}),0<s.length)for(var n=0;n<=o;n++)-1===s.indexOf(n)&&n!==o&&-1===i.indexOf(n)&&i.push(n);var a=this.getOccupiedColumns(t);return a.forEach(function(e){e<o&&-1!==i.indexOf(e)&&i.splice(i.indexOf(e),1)}),this.getOccupiedColumns(this.checkingElement).forEach(function(e){e<parseInt(t.getAttribute("data-col"),10)&&-1===a.indexOf(e)&&-1===i.indexOf(e)&&i.push(e)}),i=(i=i.sort(function(e,t){return e-t})).reverse()},kKe.prototype.adjustmentAvailable=function(e,t,i,n,o){this.leftAdjustable=void 0,this.rightAdjustable=void 0;var r,s=!1,a=[],l=(this.topAdjustable=void 0,parseInt(o.getAttribute("data-sizeX"),10)),h=parseInt(o.getAttribute("data-col"),10),d=(-1===(a=this.getRowElements(this.collisions(e,0,this.columns,i,[]))).indexOf(o)&&a.push(o),this.leftWardsSpaceChecking(a,t,o));if(0<d.length?(this.leftAdjustable=this.isLeftAdjustable(d,o,e,t,n,i),this.spacedColumnValue!==h-this.getCellInstance(this.checkingElement.id).sizeX&&(this.leftAdjustable=!1),!this.leftAdjustable&&(this.leftAdjustable=!1,r=this.rightWardsSpaceChecking(a,t,o),this.rightAdjustable=0<r.length&&this.isRightAdjustable(r,o,e,t,n,i),this.spacedColumnValue!==l+h&&(this.rightAdjustable=!1),this.rightAdjustable)||(this.rightAdjustable=!1)):(r=this.rightWardsSpaceChecking(a,t,o),this.rightAdjustable=0<r.length&&this.isRightAdjustable(r,o,e,t,n,i),this.spacedColumnValue!==l+h&&(this.rightAdjustable=!1),this.rightAdjustable&&(this.leftAdjustable=!1)),!this.rightAdjustable&&!this.leftAdjustable&&0<e){var p=this.getCellInstance(o.id).row,c=!1;this.startRow!==p&&(c=!0);for(var u=e;0<=u;u--){var g=1<this.getCellInstance(o.id).sizeY&&c?this.checkingElement:o;u!==p&&u===p-i&&0===this.collisions(u,t,n,i,g).length&&(this.topAdjustable=!(c=!1),this.spacedRowValue=je(this.spacedRowValue)?u:this.spacedRowValue,this.spacedColumnValue=t)}}return(this.rightAdjustable||this.leftAdjustable||this.topAdjustable)&&(s=!0,je(this.spacedRowValue))&&(this.spacedRowValue=e),s},kKe.prototype.isXSpacingAvailable=function(e,t){for(var i=!1,n=[],o=0;o<e.length;o++)if(e[o+1]-e[o]!=1&&e[o+1]-e[o]!=-1)n=[];else if(n.push(e[o]),2===t&&n.push(e[o+1]),o===e.length-2&&(n.push(e[o+1]),n.length>t)&&n.splice(-1),n.length===t)return i=!0,this.spacedColumnValue=n.sort(function(e,t){return e-t})[0],this.spacedColumnValue<0&&(this.spacedColumnValue=1),i;return i},kKe.prototype.getRowElements=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},kKe.prototype.isLeftAdjustable=function(e,t,i,n,o,r){var s;if(1===o&&1===r&&0<e.length)this.spacedColumnValue=e[0],s=!0;else if(1<o&&1===r)s=this.isXSpacingAvailable(e,o);else if(1<r)if(1===o){var a=void 0;if(a=1<=e.length?!0:a)for(var l=0;l<e.length;l++){if(0===this.collisions(i,e[l],o,r,this.checkingElement).length)return this.spacedColumnValue=e[l],s=!0;s=!1}}else s=this.replacable(e,o,i,r,t);return s},kKe.prototype.isRightAdjustable=function(e,t,i,n,o,r){var s;if(1===o&&1===r&&0<e.length)this.spacedColumnValue=e[0],s=!0;else if(1<o&&1===r)s=this.isXSpacingAvailable(e,o);else if(1<r)if(1===o){var a=void 0;if(a=1<=e.length?!0:a)for(var l=0;l<e.length;l++){for(var h=this.collisions(i,e[l],o,r,this.checkingElement),d=0;d<h.length;d++)parseInt(t.getAttribute("data-col"),10)!==e[l]&&h.splice(h.indexOf(h[d]),1);if(0===h.length)return s=!0,this.spacedColumnValue=e[l],s;s=!1}}else s=this.replacable(e,o,i,r,t);return s},kKe.prototype.replacable=function(e,t,i,n,o){for(var r,s=[],a=0;a<e.length;a++)if(this.isXSpacingAvailable(e,t)){var l=[];if(l.push(this.checkingElement),l.push(o),0===s.length)return r=!0;r=!1}return r},kKe.prototype.sortCollisionItems=function(i){for(var n,o=[],e=function(t){n=[],i.forEach(function(e){e&&e.getAttribute("data-row")===t.toString()&&n.push(e)});for(var e=r.columns-1;0<=e;e--)!function(t){n.forEach(function(e){e&&e.getAttribute("data-col")===t.toString()&&o.push(e)})}(e)},r=this,t=this.rows-1;0<=t;t--)e(t);return o},kKe.prototype.updatedModels=function(o,r,s){var a=this,l=[];return this.mainElement||this.sortedPanel(),o.forEach(function(e){a.checkingElement=e;var t=a.getCellInstance(e.id),i=!a.adjustmentAvailable(t.row,t.col,t.sizeY,t.sizeX,s);if(1<t.sizeX&&i)for(var n=t.row;n<r.row+r.sizeY;n++)a.collisions(n,t.col,t.sizeX,t.sizeY,e).forEach(function(e){0<=o.indexOf(e)&&-1===l.indexOf(e)&&l.push(e)})}),l.forEach(function(e){0<=l.indexOf(e)&&o.splice(o.indexOf(e),1)}),o},kKe.prototype.resetLayout=function(e){var t=this.collisions(e.row,e.col,e.sizeX,e.sizeY,this.mainElement);if(this.mainElement&&!this.addPanelCalled&&!this.resizeCalled&&!this.movePanelCalled){if(this.mainElement&&this.oldRowCol!==this.cloneObject)for(var i=0;i<this.panels.length;i++){var n,o,r=this.element.querySelector("[id='"+this.panels[i].id+"']");r!==this.mainElement&&(n=this.cloneObject[r.id].row,o=this.cloneObject[r.id].col,this.setPanelPosition(r,n,o),this.panelPropertyChange(this.getCellInstance(r.id),{row:n,col:o}),this.setAttributes({value:{col:o.toString(),row:n.toString()}},r),this.updateOldRowColumn())}this.sortedArray=this.cloneArray,t=this.collisions(e.row,e.col,e.sizeX,e.sizeY,this.mainElement),this.sortedPanel(),this.updateOldRowColumn(),this.checkCollision&&0<this.checkCollision.length&&-1===t.indexOf(this.checkCollision[0])&&this.cloneObject[this.checkCollision[0].id].row===e.row&&t.push(this.checkCollision[0])}return t},kKe.prototype.swapAvailability=function(e,t){for(var i=!0,n=this.getCellInstance(t.id),o=0;o<e.length;o++)for(var r=this.getCellInstance(e[o].id),s=1;s<n.sizeY;s++){var a=[];if(a.push(t),a.push(e[o]),0<this.collisions(n.row+s,r.col,r.sizeX,r.sizeY,a).length)return i=!1}return i},kKe.prototype.checkForSwapping=function(e,t){if(!this.mainElement||0===e.length)return!1;var i,n=parseInt(e[0].getAttribute("data-row"),10);if(this.startRow<n?i=1:this.startRow>n&&(i=0),!this.swapAvailability(e,t))return!1;for(var o=!1,r=0;r<e.length;r++)if(1<=e.length&&this.cloneObject[this.mainElement.id]&&this.cloneObject[this.mainElement.id].row===this.oldRowCol[this.mainElement.id].row)return!1;for(var s=0===i?this.getCellInstance(this.mainElement.id).row+this.getCellInstance(this.mainElement.id).sizeY:this.startRow,a=0;a<e.length;a++){var l=this.getCellInstance(e[a].id),h=this.getCellInstance(t.id),d=[];if(1===l.sizeY&&-1===d.indexOf(e[a]))d.push(e[a]);else if(1<l.sizeY&&-1===d.indexOf(e[a])){if(!(1===i&&h.row===this.cloneObject[l.id].row+l.sizeY-1||0===i&&h.row===this.cloneObject[l.id].row))return!1;d.push(e[a])}if(l.sizeY<=h.sizeY&&-1===d.indexOf(e[a])&&d.push(e[a]),d.push(this.mainElement),0<this.collisions(s,l.col,l.sizeX,l.sizeY,d).length)return o=!1;a===e.length-1&&(o=!0)}return o},kKe.prototype.swapItems=function(e,t,i){var n,o,r=this,s=[],a=(s.push(t),parseInt(e[0].getAttribute("data-row"),10)),l=(this.startRow<a?n=1:this.startRow>a&&(n=0),0===n?a+i.sizeY:this.startRow);this.movePanelCalled||(o=this.getCellInstance(e[0].id),this.panelPropertyChange(i,{row:0===n?a:l+o.sizeY}));for(var h=0;h<e.length;h++)s.push(e[h]),this.setPanelPosition(e[h],l,this.getCellInstance(e[h].id).col),this.panelPropertyChange(this.getCellInstance(e[h].id),{row:l}),e[h].setAttribute("data-row",l.toString());t.setAttribute("data-row",i.row.toString()),this.setPanelPosition(this.shadowEle,i.row,i.col);for(var d=0;d<this.panels.length;d++)this.oldRowCol[this.panels[d].id]={row:this.panels[d].row,col:this.panels[d].col};this.startRow=i.row,this.updateOldRowColumn(),s.forEach(function(e){r.cloneObject[e.id]=r.oldRowCol[e.id];for(var t=r.getCellInstance(e.id),i=0;i<r.sortedArray.length;i++)if(r.sortedArray[i])for(var n=0;n<r.sortedArray[i].length;n++)r.sortedArray[i][n]===e&&(r.sortedArray[i][n]=void 0);r.sortedArray[t.row]||(r.sortedArray[t.row]=[]),r.sortedArray[t.row][t.col]=e,r.cloneArray=r.sortedArray})},kKe.prototype.updatePanelLayout=function(e,t){var i=this,n=(this.collisionChecker={},[]),o=[];if(0<(n=this.mainElement&&this.isRenderComplete?this.resetLayout(t):this.collisions(t.row,t.col,t.sizeX,t.sizeY,e)).length)if(n=this.sortCollisionItems(n),n=this.updatedModels(n,t,e),!je(this.startRow)&&this.checkForSwapping(n,e))this.swapItems(n,e,t);else for(var r=0;r<n.length;r++){var s,a=this.getCellInstance(n[r].id);this.checkingElement=n[r],this.spacedRowValue=null,this.spacedColumnValue=null,this.adjustmentAvailable(a.row,a.col,a.sizeY,a.sizeX,e)&&!je(this.spacedColumnValue)?(this.setPanelPosition(n[r],this.spacedRowValue,this.spacedColumnValue),this.oldRowCol[n[r].id]={row:this.spacedRowValue,col:this.spacedColumnValue},s={attributes:{row:this.spacedRowValue.toString(),col:this.spacedColumnValue.toString()}},this.setAttributes(s,n[r]),this.panelPropertyChange(a,{col:this.spacedColumnValue,row:this.spacedRowValue}),this.topAdjustable&&this.allowFloating&&(this.updatePanels(),this.updateCloneArrayObject()),this.spacedRowValue=null,n.length):o.push(n[r])}0<o.length&&(o.forEach(function(e){-1===i.overlapElement.indexOf(e)&&i.overlapElement.push(e)}),this.overlapElement&&-1!==this.overlapElement.indexOf(e)&&this.overlapElement.splice(this.overlapElement.indexOf(e),1),0<o.length)&&(this.updateRowColumn(t.row,this.overlapElement,e),this.checkForCompletePushing()),this.isSubValue||this.sortedPanel(),this.updateRowHeight(),this.updateGridLines()},kKe.prototype.checkForCompletePushing=function(){for(var e,t=0;t<this.panels.length;t++)this.collisionChecker[this.panels[t].id]&&null!==this.collisionChecker[this.panels[t].id]&&(this.overlapElement=[this.collisionChecker[this.panels[t].id].ele],e=this.panels[t].id,this.updateRowColumn(this.collisionChecker[""+e].row,this.overlapElement,this.collisionChecker[""+e].srcEle))},kKe.prototype.updateCollisionChecked=function(e){for(var t=0;t<Object.keys(this.collisionChecker).length;t++)this.collisionChecker[e.id]=null},kKe.prototype.updateRowColumn=function(e,t,i){if(i){var n=parseInt(i.getAttribute("data-sizeY"),10),o=parseInt(i.getAttribute("data-row"),10);this.overlapElementClone=(this.overlapElement&&this.shouldRestrict,this.overlapElement);for(var r=0;r<this.overlapElementClone.length;r++){if(0===this.overlapElementClone.length)return;for(var s=0;s<this.overlapElementClone.length;s++)this.collisionChecker[this.overlapElementClone[s].id]={ele:this.overlapElementClone[s],row:e,srcEle:i};var a=o+n,l=parseInt(this.overlapElementClone[r].getAttribute("data-sizeY"),10),h=parseInt(this.overlapElementClone[r].getAttribute("data-col"),10),d=parseInt(this.overlapElementClone[r].getAttribute("data-sizeX"),10),p=void 0,c=void 0;if(-1===this.overlapSubElementClone.indexOf(i)&&this.overlapSubElementClone.push(i),-1===this.overlapSubElementClone.indexOf(this.overlapElementClone[r])&&this.overlapSubElementClone.push(this.overlapElementClone[r]),1<l||1<d){for(var u=this.getCellInstance(this.overlapElementClone[r].id),p=u.col,g=document.getElementById(u.id),m=u.row;m<o+n;m++){this.isSubValue=!0,this.panelPropertyChange(u,{row:u.row+1}),g.setAttribute("data-row",u.row.toString()),this.setPanelPosition(g,u.row,p),this.updateCollisionChecked(g),this.oldRowCol[g.id]={row:u.row,col:p};var f=this.getCellInstance(g.id),y=(this.panelPropertyChange(f,{col:p,row:u.row}),parseInt(g.getAttribute("data-row"),10)),v=parseInt(g.getAttribute("data-col"),10),b=parseInt(g.getAttribute("data-sizeX"),10),w=parseInt(g.getAttribute("data-sizeY"),10),C=[];C.push(g),C.push(i),c=this.collisions(y,v,b,w,C),this.mainElement&&-1!==c.indexOf(this.mainElement)&&c.splice(c.indexOf(this.mainElement),1),this.collisionPanel(c,v,y,g)}this.isSubValue=!1}else{this.addPanelCalled&&(this.addPanelCalled=!1),this.overlapElementClone[r].setAttribute("data-row",a.toString());var S=[],f=(S.push(this.overlapElementClone[r]),S.push(i),c=this.collisions(a,h,d,l,S),this.mainElement&&-1!==c.indexOf(this.mainElement)&&c.splice(c.indexOf(this.mainElement),1),p=parseInt(this.overlapElementClone[r].getAttribute("data-col"),10),this.setPanelPosition(this.overlapElementClone[r],a,p),this.updateCollisionChecked(this.overlapElementClone[r]),this.oldRowCol[this.overlapElementClone[r].id]={row:a,col:p},this.getCellInstance(this.overlapElementClone[r].id));this.panelPropertyChange(f,{col:p,row:a}),this.collisionPanel(c,p,a,this.overlapElementClone[r])}}}},kKe.prototype.collisionPanel=function(e,t,i,n){var o=this,r=this.getCellInstance(n.id);if(this.panelPropertyChange(r,{row:i,col:t}),0<e.length){this.overlapElement=[],this.shouldRestrict=!0,e.forEach(function(e){o.overlapElement.push(e)});for(var s=parseInt(n.getAttribute("data-row"),10),a=0;a<this.overlapElement.length;a++)this.updateRowColumn(s,this.overlapElement,n);this.shouldRestrict=!1}else{if(this.addPanelCalled||this.sortedPanel(),0<this.overlapSubElementClone.length)for(var l=0;l<this.overlapSubElementClone.length;l++){var h=parseInt(this.overlapSubElementClone[l].getAttribute("data-row"),10),d=parseInt(this.overlapSubElementClone[l].getAttribute("data-col"),10),p=parseInt(this.overlapSubElementClone[l].getAttribute("data-sizeX"),10),c=parseInt(this.overlapSubElementClone[l].getAttribute("data-sizeY"),10),d=this.collisions(h,d,p,c,this.overlapSubElementClone);this.mainElement&&-1!==d.indexOf(this.mainElement)&&d.splice(d.indexOf(this.mainElement),1),d.forEach(function(e){o.overlapElement.push(e)}),0<d.length&&this.updateRowColumn(h,this.overlapElement,this.overlapSubElementClone[l])}this.overlapSubElementClone=[]}},kKe.prototype.removeResizeClasses=function(e){for(var t=0;t<e.length;t++)for(var i=e[t].querySelectorAll(".e-resize"),n=0;n<i.length;n++)G(i[n])},kKe.prototype.ensureDrag=function(){this.checkDragging(this.dragCollection),q(this.element.querySelectorAll("."+SKe),[SKe]),this.setClasses(this.panelCollection)},kKe.prototype.setClasses=function(e){for(var t=0;t<e.length;t++){var i=e[t],n=e[t].querySelector(".e-panel-container");this.allowDragging&&(this.draggableHandle&&i.querySelectorAll(this.draggableHandle)[0]?U([i.querySelectorAll(this.draggableHandle)[0]],[SKe]):U([i],[SKe])),this.allowResizing&&this.mediaQuery&&!this.checkMediaQuery()&&this.setResizingClass(i,n)}},kKe.prototype.setResizingClass=function(e,t){if(this.availableClasses=this.resizableHandles,!e.querySelector(".e-resize"))for(var i=0;i<this.availableClasses.length;i++){var n=this.createElement("span");t.appendChild(n),U([n],["e-east"===this.availableClasses[i]||"e-west"===this.availableClasses[i]||"e-north"===this.availableClasses[i]||"e-south"===this.availableClasses[i]?"e-single":"e-double",this.availableClasses[i],"e-resize","e-dl-icon"])}},kKe.prototype.setXYAttributes=function(e,t){t={value:{sizeX:je(t.sizeX)?void 0:t.sizeX.toString(),sizeY:je(t.sizeY)?void 0:t.sizeY.toString(),minSizeX:je(t.minSizeX)?void 0:t.minSizeX.toString(),minSizeY:je(t.minSizeY)?void 0:t.minSizeY.toString(),maxSizeX:je(t.maxSizeX)?void 0:t.maxSizeX.toString(),maxSizeY:je(t.maxSizeY)?void 0:t.maxSizeY.toString(),row:je(t.row)?void 0:t.row.toString(),col:je(t.col)?void 0:t.col.toString()}};this.setAttributes(t,e)},kKe.prototype.setXYDimensions=function(e){var t=this.getCellSize()[1],i=this.getCellSize()[0],i=e&&"number"==typeof i&&"number"==typeof e.sizeX&&1<e.sizeX?e.sizeX*i+(e.sizeX-1)*this.cellSpacing[0]:i,e=e&&"number"==typeof t&&1<e.sizeY&&"number"==typeof e.sizeY?e.sizeY*t+(e.sizeY-1)*this.cellSpacing[1]:T(t);return[e,i]},kKe.prototype.getRowColumnDragValues=function(e){var t=parseFloat(e.element.style.top),e=parseFloat(e.element.style.left);return[Math.round(t/(this.getCellSize()[1]+this.cellSpacing[1])),Math.round(e/(this.getCellSize()[0]+ +this.cellSpacing[0]))]},kKe.prototype.checkForChanges=function(e,t,i){var n=[];if(this.removeAllCalled)n=[];else for(var o=0;o<this.panels.length;o++)!je(i)&&this.panels[o].id===i[0].id||this.panels[o].row===this.panelsInitialModel[o].row&&this.panels[o].col===this.panelsInitialModel[o].col||n.push(this.panels[o]);(0<n.length||this.removeAllCalled)&&(e={changedPanels:n,isInteracted:e,addedPanels:je(t)?[]:t,removedPanels:je(i)?[]:i},this.trigger("change",e))},kKe.prototype.enableDraggingContent=function(t){for(var i,a=this,n=this,e=0;e<t.length;e++)!function(s){var e=t[s];n.dragobj=new hn(e,{preventDefault:!1,clone:!1,dragArea:n.element,isDragScroll:!0,handle:n.draggableHandle||".e-panel",abort:[".e-resize",".e-drag-restrict"],dragStart:n.onDraggingStart.bind(n),dragStop:function(e){if(a.trigger("dragStop",e),je(e.cancel)&&(e.cancel=!1),e.cancel){var t=a.getCellInstance(a.mainElement.id);for(s=0;s<a.panels.length;s++)a.panels[s].id===t.id&&(e.element.setAttribute("data-col",a.panelsInitialModel[s].col.toString()),e.element.setAttribute("data-row",a.panelsInitialModel[s].row.toString()),t.col=a.panelsInitialModel[s].col,t.row=a.panelsInitialModel[s].row,a.setPanelPosition(a.mainElement,a.panelsInitialModel[s].row,a.panelsInitialModel[s].col),a.updatePanelLayout(a.mainElement,t));a.shadowEle&&G(a.shadowEle)}else{var i=a.getCellInstance(a.mainElement.id),i=(a.allowPushing&&0<a.collisions(i.row,i.col,i.sizeX,i.sizeY,a.mainElement).length?(a.setHolderPosition(e),a.setPanelPosition(a.mainElement,i.row,i.col),a.updatePanelLayout(a.mainElement,i)):a.setPanelPosition(a.mainElement,i.row,i.col),a.mainElement=null,a.getPanelBase(e)),n=(a.shadowEle&&G(a.shadowEle),q([a.element],[wKe]),q([e.element],[CKe]),a.shadowEle=null,e.element.classList.remove("e-dragging"),a.getRowColumnDragValues(e)[0]),o=a.getRowColumnDragValues(e)[1],r=a.getCellInstance(e.element.id),r=(a.allowPushing&&0===a.collisions(n,o,r.sizeX,r.sizeY,document.getElementById(i.id)).length?(a.panelPropertyChange(a.getCellInstance(e.element.id),{row:n,col:o}),a.oldRowCol[e.element.id].row=n,a.oldRowCol[e.element.id].col=o,a.setAttributes({value:{col:o.toString(),row:n.toString()}},e.element)):(a.panelPropertyChange(a.getCellInstance(e.element.id),{row:a.oldRowCol[e.element.id].row,col:a.oldRowCol[e.element.id].col}),e.element.setAttribute("data-col",a.getCellInstance(e.element.id).col.toString()),e.element.setAttribute("data-row",a.getCellInstance(e.element.id).row.toString())),a.sortedPanel(),a.getCellInstance(e.element.id));a.setPanelPosition(e.element,r.row,r.col),a.updatePanels(),a.updateCloneArrayObject(),a.checkForChanges(!0),a.dragStopEventArgs={event:e.event,element:e.element},a.resizeEvents(),a.rows=a.maxRow(!0),a.setHeightWidth(),a.updateDragArea()}},drag:function(e){a.draggedEventArgs={event:e.event,element:e.element,target:z(e.target,".e-panel")},a.trigger("drag",a.draggedEventArgs),a.onDragStart(e)}}),-1===n.dragCollection.indexOf(n.dragobj)&&n.dragCollection.push(n.dragobj),i=s}(e),e=i},kKe.prototype.updatePanels=function(){this.moveItemsUpwards(),this.updateOldRowColumn(),this.sortedPanel()},kKe.prototype.updateDragArea=function(){this.dragCollection.forEach(function(e){e.setDragArea()})},kKe.prototype.refreshDraggableHandle=function(){if(this.dragCollection&&0<this.dragCollection.length){for(var e=0;e<this.dragCollection.length;e++)this.dragCollection[e].destroy(),E.clearEvents(this.dragCollection[e].element);this.ensureDrag()}},kKe.prototype.updateRowsHeight=function(e,t,i){e+t>=this.rows&&(this.rows=this.rows+i,this.setHeightWidth())},kKe.prototype.onDraggingStart=function(e){var t,i;this.trigger("dragStart",e,function(){je(e.cancel)&&(e.cancel=!1)}),this.eventVar=e.cancel,e.cancel?(q([this.element],[wKe]),q([e.element],[CKe])):(this.panelsInitialModel=this.cloneModels(this.panels),this.mainElement=e.element,this.cloneObject=JSON.parse(JSON.stringify(this.cloneObject)),i=this.startRow=parseInt(e.element.getAttribute("data-row"),10),this.startCol=parseInt(e.element.getAttribute("data-col"),10),t=parseInt(e.element.getAttribute("data-sizeY"),10),this.updateRowsHeight(i,t,t),this.updateDragArea(),this.shadowEle=document.createElement("div"),this.shadowEle.classList.add("e-holder","e-holder-transition"),gt(this.shadowEle,{position:"absolute"}),U([this.element],[wKe]),U([e.element],[CKe]),this.element.appendChild(this.shadowEle),this.renderReactTemplates(),this.shadowEle=document.querySelector(".e-holder"),i=this.getCellInstance(e.element.id),t=this.calculateShadowElementSize(i.sizeX,i.sizeY),this.shadowEle.style.height=t.height,this.shadowEle.style.width=t.width,i=this.getCellInstance(e.element.id),this.setPanelPosition(this.shadowEle,i.row,i.col))},kKe.prototype.cloneModels=function(e,t){void 0===t&&(t=[]);for(var i=0;i<e.length;i++)for(var n in t[i]||(t[i]={}),e[i])t[i][""+n]=e[i][""+n];return t},kKe.prototype.onDragStart=function(e){var t,i,n,o,r,s;this.eventVar?(this.dragobj.intDestroy(e.event),q([this.element],[wKe]),q([e.element],[CKe])):(o=n=this.getRowColumnDragValues(e)[1],r=this.getRowColumnDragValues(e)[0],o<0||r<0||(this.panelPropertyChange(this.getCellInstance(e.element.id),{row:r,col:o}),s=this.getCellInstance(e.element.id),this.updateRowsHeight(s.row,s.sizeY,1),this.updateDragArea(),this.allowPushing&&(this.setAttributes({value:{col:o.toString(),row:r.toString()}},e.element),this.panelPropertyChange(this.getCellInstance(e.element.id),{row:r,col:o}),t=this.oldRowCol[e.element.id].col,i=this.oldRowCol[e.element.id].row,this.oldRowCol[e.element.id]={row:r,col:o},this.updateOldRowColumn(),this.startCol===t&&this.startRow===i||(this.setHolderPosition(e),this.startCol!==t&&(this.startRow=i),this.startRow!==i&&(this.startCol=t),this.allowPushing&&(this.mainElement=e.element,this.checkCollision=this.collisions(s.row,s.col,s.sizeX,s.sizeY,e.element),(0<=s.col||s.col>=this.checkColumnValue)&&(this.checkCollision=[]),this.updatePanelLayout(e.element,s),this.moveItemsUpwards()))),!1!==this.allowPushing&&this.panelPropertyChange(this.getCellInstance(e.element.id),{row:r,col:o}),this.oldRowCol[e.element.id].row===r&&this.oldRowCol[e.element.id].col===o||(this.panelPropertyChange(this.getCellInstance(e.element.id),{row:r,col:o}),this.setAttributes({value:{col:o.toString(),row:r.toString()}},e.element)),this.startCol!==n&&(this.startCol=t,this.moveItemsUpwards()),this.allowPushing||this.setHolderPosition(e),this.removeResizeClasses(this.panelCollection),this.setClasses(this.panelCollection),this.allowPushing))},kKe.prototype.getPanelBase=function(e){for(var t,i=0;i<this.panelCollection.length;i++)this.panelCollection[i].id===(e.element&&e.element.id||e)&&(t=this.panelCollection[i]);return t},kKe.prototype.getPanel=function(e,t,i){!i||i instanceof Array||(i=[i]);for(var n=1;-1<e;){for(var o=1,r=t;-1<r;){var s=this.sortedArray[e];if(s){s=s[r];if(s&&(!i||-1===i.indexOf(s))&&parseInt(s.getAttribute("data-sizeX"),10)>=o&&parseInt(s.getAttribute("data-sizeY"),10)>=n)return s}++o,--r}--e,++n}return null},kKe.prototype.setHolderPosition=function(e){var t=parseInt(e.element.getAttribute("data-sizeY"),10),i=parseInt(e.element.getAttribute("data-col"),10),n=parseInt(e.element.getAttribute("data-row"),10),e=parseInt(e.element.getAttribute("data-sizeX"),10),o=this.getCellSize()[0],r=this.getCellSize()[1],n=0===n?0:n*(r+this.cellSpacing[1]),r=0===i?0:i*(o+this.cellSpacing[0]),i=(this.elementRef.top=this.shadowEle.style.top=n+"px",this.elementRef.left=this.shadowEle.style.left=r+"px",this.calculateShadowElementSize(e,t));this.elementRef.height=this.shadowEle.style.height=i.height,this.elementRef.width=this.shadowEle.style.width=i.width},kKe.prototype.calculateShadowElementSize=function(e,t){return{width:e*this.cellSize[0]+(e-1)*this.cellSpacing[0]+"px",height:t*this.cellSize[1]+(t-1)*this.cellSpacing[1]+"px"}},kKe.prototype.getCellInstance=function(e){for(var t,i=0;i<this.panels.length;i++)this.panels[i].id===e&&(t=this.panels[i]);return t},kKe.prototype.addPanel=function(e){this.panelsSizeY=0,this.maxCol(),e.minSizeX||(e.minSizeX=1),e.minSizeY||(e.minSizeY=1),e.id||(e.id="layout_"+this.panelID.toString(),this.panelID=this.panelID+1);var e=new EKe(this,"panels",e,!0),t=(this.panels.push(e),this.panelsInitialModel=this.cloneModels(this.panels),this.setMinMaxValues(e),(this.maxColumnValue<e.col||this.maxColumnValue<e.col+e.sizeX)&&this.panelPropertyChange(e,{col:this.maxColumnValue-e.sizeX}),this.renderCell(e,!0,null));if(this.oldRowCol[e.id]={row:e.row,col:e.col},this.cloneObject[e.id]={row:e.row,col:e.col},this.updateOldRowColumn(),this.element.insertAdjacentElement("afterbegin",t),this.addPanelCalled=!0,this.checkMediaQuery()?(this.checkMediaQuerySizing(),this.removeResizeClasses(this.panelCollection)):(this.mainElement=t,this.checkCollision||(this.checkCollision=[]),this.setPanelPosition(t,e.row,e.col),this.addPanelCalled=!1,this.updatePanelLayout(t,e)),this.addPanelCalled&&(this.addPanelCalled=!1),this.allowDragging&&this.mediaQuery&&!this.checkMediaQuery()&&this.enableDraggingContent([document.getElementById(e.id)]),this.setClasses([t]),this.allowFloating&&(this.mainElement=null,this.moveItemsUpwards()),this.updateOldRowColumn(),this.sortedPanel(),this.updateCloneArrayObject(),this.allowResizing)for(var i=0;i<t.querySelectorAll(".e-resize").length;i++){var n="msie"===F.info.name?"mousedown pointerdown":"mousedown";E.add(t.querySelectorAll(".e-resize")[i],n,this.downResizeHandler,this),"msie"!==F.info.name&&E.add(t.querySelectorAll(".e-resize")[i],"touchstart",this.touchDownResizeHandler,this)}this.checkForChanges(!1,[e])},kKe.prototype.updatePanel=function(e){var t,i,n;this.panelsSizeY=0,e.id&&(t=this.getCellInstance(e.id))&&(this.maxCol(),e.col=e.col<1?0:e.col>this.columns?this.columns-1:e.col,je(e.col)&&(e.col=t.col),this.panelPropertyChange(t,e),this.setMinMaxValues(t),e=document.getElementById(e.id),this.mainElement=e,i=t.cssClass?t.cssClass.split(" "):null,this.panelContent=e.querySelector(".e-panel-container")?e.querySelector(".e-panel-container"):this.createSubElement(i,e.id+"_content",IKe),e.appendChild(this.panelContent),t.header?(U([i=e.querySelector(".e-panel-header")?e.querySelector(".e-panel-header"):this.createSubElement([],e.id+"template","")],[TKe]),i.innerHTML="",n=this.element.id+"HeaderTemplate"+t.id,this.renderTemplate(t.header,i,n,!0,"header"),this.panelContent.appendChild(i),this.renderReactTemplates()):e.querySelector(".e-panel-header")&&G(e.querySelector(".e-panel-header")),t.content?(i=t.cssClass?t.cssClass.split(" "):null,this.panelBody=e.querySelector(".e-panel-content")?e.querySelector(".e-panel-content"):this.createSubElement(i,e.id+"_body",xKe),this.panelBody.innerHTML="",i=this.panelContent.querySelector(".e-panel-header")?window.getComputedStyle(this.panelContent.querySelector(".e-panel-header")).height:"0px",gt(this.panelBody,{height:"calc( 100% - "+i+")"}),n=this.element.id+"ContentTemplate"+t.id,this.renderTemplate(t.content,this.panelBody,n,!0,"content"),this.panelContent.appendChild(this.panelBody),this.renderReactTemplates()):e.querySelector(".e-panel-content")&&G(e.querySelector(".e-panel-content")),this.setXYAttributes(e,t),this.setHeightAndWidth(e,t),this.setPanelPosition(e,t.row,t.col),this.updatePanelLayout(e,t),this.checkMediaQuery()&&this.checkMediaQuerySizing(),this.mainElement=null,this.updatePanels(),this.updateCloneArrayObject())},kKe.prototype.updateCloneArrayObject=function(){this.cloneArray=this.sortedArray,this.cloneObject=JSON.parse(JSON.stringify(this.oldRowCol))},kKe.prototype.serialize=function(){for(var e=this.cloneModels(this.panels),t=[],i=0;i<e.length;i++)t.push({id:e[i].id,row:e[i].row,col:e[i].col,sizeX:e[i].sizeX,sizeY:e[i].sizeY,minSizeX:e[i].minSizeX,minSizeY:e[i].minSizeY,maxSizeX:e[i].maxSizeX,maxSizeY:e[i].maxSizeY});return t},kKe.prototype.removeAll=function(){this.removeAllCalled=!0;for(var e=0;e<this.panelCollection.length;e++)G(this.panelCollection[e]),this.clearTemplate();this.removeAllPanel(),this.rows=0,this.gridPanelCollection=[],this.setHeightWidth(),this.sortedPanel(),this.sortedArray=[],this.overlapElementClone=[],this.overlapElement=[],this.overlapSubElementClone=[],this.panelCollection=[],this.oldRowCol={},this.cloneObject={};var t=this.cloneModels(this.panels);this.setProperties({panels:[]},!0),this.updatePanels(),this.updateCloneArrayObject(),this.checkForChanges(!1,null,t),this.removeAllCalled=!1,this.setEmptyLayoutHeight()},kKe.prototype.removePanel=function(t){var e,i=this;this.panelsSizeY=0,this.panelsInitialModel=this.cloneModels(this.panels);for(var n=0;n<this.panelCollection.length;n++)this.panelCollection[n].id===t&&(G(this.panelCollection[n]),this.panelCollection.splice(n,1)),this.panels[n].id===t&&(e=this.panels[n],this.panels.splice(n,1),this.panelsInitialModel.splice(n,1),this.updateOldRowColumn(),this.sortedPanel());this.updatePanels(),this.checkMediaQuery()&&(this.isPanelRemoved=!0,this.checkMediaQuerySizing(),this.isPanelRemoved=!1),this.gridPanelCollection.forEach(function(e){e.id===t&&i.gridPanelCollection.splice(i.gridPanelCollection.indexOf(e),1)}),this.updateCloneArrayObject(),this.checkForChanges(!1,null,[e]),0===this.panels.length&&0===this.panelCollection.length&&this.setEmptyLayoutHeight()},kKe.prototype.movePanel=function(e,t,i){this.movePanelCalled=!0,this.panelsInitialModel=this.cloneModels(this.panels);var n=this.getCellInstance(e);isNaN(t)||null===t||isNaN(i)||null===i||!n||(i<0?i=0:i>this.columns&&(i=this.columns-n.sizeX),this.panelPropertyChange(n,{row:t,col:i}),e=document.getElementById(e),this.mainElement=e,this.startRow=parseInt(e.getAttribute("data-row"),10),this.startCol=parseInt(e.getAttribute("data-col"),10),this.setAttributes({value:{col:i.toString(),row:t.toString()}},e),this.updateOldRowColumn(),this.setPanelPosition(e,t,i),this.updatePanelLayout(e,n),this.updateRowHeight(),this.updatePanels(),this.updateCloneArrayObject(),this.mainElement=null,this.allowFloating&&this.moveItemsUpwards(),this.movePanelCalled=!1,this.checkForChanges(!1))},kKe.prototype.setAttributes=function(e,t){for(var i=0;i<Object.keys(e).length;i++)Object.keys(e)&&(e[Object.keys(e)[i]].col&&t.setAttribute("data-col",e[Object.keys(e)[i]].col.toString()),e[Object.keys(e)[i]].row&&t.setAttribute("data-row",e[Object.keys(e)[i]].row.toString()),e[Object.keys(e)[i]].sizeX&&t.setAttribute("data-sizeX",e[Object.keys(e)[i]].sizeX.toString()),e[Object.keys(e)[i]].sizeY&&t.setAttribute("data-sizeY",e[Object.keys(e)[i]].sizeY.toString()),e[Object.keys(e)[i]].minSizeX&&t.setAttribute("data-minSizeX",e[Object.keys(e)[i]].minSizeX.toString()),e[Object.keys(e)[i]].minSizeY&&t.setAttribute("data-minSizeY",e[Object.keys(e)[i]].minSizeY.toString()),e[Object.keys(e)[i]].maxSizeX&&t.setAttribute("data-maxSizeY",e[Object.keys(e)[i]].maxSizeX.toString()),e[Object.keys(e)[i]].maxSizeY)&&t.setAttribute("data-maxSizeY",e[Object.keys(e)[i]].maxSizeY.toString())},kKe.prototype.resizePanel=function(e,t,i){this.panelsInitialModel=this.cloneModels(this.panels);var n=this.getCellInstance(e),e=(this.resizeCalled=!0,document.getElementById(e)),o={event:null,element:e,isInteracted:!1};this.trigger("resizeStart",o),this.panelPropertyChange(n,{sizeX:t,sizeY:i}),this.setMinMaxValues(n),this.checkMinMaxValues(n),this.mainElement=e,this.setAttributes({value:{sizeX:n.sizeX.toString(),sizeY:n.sizeY.toString()}},e),this.setHeightAndWidth(e,n),this.updatePanelLayout(e,n),this.updatePanels(),this.updateRowHeight(),this.resizeCalled=!1,this.trigger("resizeStop",o),this.checkForChanges(!1)},kKe.prototype.destroy=function(){E.remove(window,"resize",this.refreshListener),q([this.element],["e-dashboardlayout","e-lib","e-responsive","e-control"]),this.element.removeAttribute("style");for(var e=0;e<this.dragCollection.length;e++)this.dragCollection[e].destroy();this.removeAllPanel(),this.panelCollection=null,this.checkCollision=null,this.mainElement=null,this.dragobj=null,this.dragStartArgs=null,this.dragStopEventArgs=null,this.draggedEventArgs=null,this.sortedArray=null,this.cloneArray=null,this.overlapElement=null,this.overlapElementClone=null,this.dragCollection=[],this.allItems=null,this.moveTarget=null,this.upTarget=null,this.downTarget=null,this.checkingElement=null,this.panelHeaderElement=null,this.panelContent=null,this.panelBody=null,this.table=null,MKe.prototype.destroy.call(this),this.clearTemplate(),this.renderReactTemplates()},kKe.prototype.removeAllPanel=function(){for(;this.element.firstElementChild;)G(this.element.firstElementChild),this.clearTemplate()},kKe.prototype.setEnableRtl=function(){(!0===this.enableRtl?U:q)([this.element],"e-rtl")},kKe.prototype.updateCellSizeAndSpacing=function(){this.panelResponsiveUpdate(),this.setHeightWidth(),this.getRowColumn();for(var e=0;e<this.element.querySelectorAll(".e-panel").length;e++){var t=this.element.querySelectorAll(".e-panel")[e],i=this.getCellInstance(t.id);this.setHeightAndWidth(t,i),this.setPanelPosition(t,i.row,i.col)}},kKe.prototype.updatePanelsDynamically=function(e){this.removeAll(),this.setProperties({panels:e},!0),this.setOldRowCol(),this.table&&this.table.remove(),this.initialize(),this.checkMediaQuery()&&this.refresh(),this.showGridLines&&this.initGridLines()},kKe.prototype.checkForIDValues=function(e){var t=this;!je(e)&&0<e.length?(this.panelID=0,e.forEach(function(e){e.id||(t.panelPropertyChange(e,{id:"layout_"+t.panelID.toString()}),t.panelID=t.panelID+1)})):this.restrictDynamicUpdate=!0},kKe.prototype.onPropertyChanged=function(e){var i=this;e.panels&&0<e.panels.length&&e.panels[0]instanceof EKe&&this.checkForIDValues(e.panels);for(var t=0,n=Object.keys(e);t<n.length;t++)switch(n[t]){case"enableRtl":this.setProperties({enableRtl:e.enableRtl},!0),this.setEnableRtl();break;case"mediaQuery":this.setProperties({mediaQuery:e.mediaQuery},!0),this.checkMediaQuery()&&this.checkMediaQuerySizing();break;case"allowDragging":this.setProperties({allowDragging:e.allowDragging},!0),this.ensureDrag();break;case"allowResizing":if(this.setProperties({allowResizing:e.allowResizing},!0),this.allowResizing)this.setClasses(this.panelCollection),this.resizeEvents();else{for(var o=this.element.querySelectorAll(".e-panel .e-panel-container .e-resize"),r=0;r<o.length;r++){var s="msie"===F.info.name?"mousedown pointerdown":"mousedown",a=o[r];E.remove(a,s,this.downResizeHandler),"msie"!==F.info.name&&E.remove(a,"touchstart",this.touchDownResizeHandler)}this.removeResizeClasses(this.panelCollection)}break;case"cellSpacing":this.setProperties({cellSpacing:e.cellSpacing},!0),this.checkMediaQuery()||(this.updateCellSizeAndSpacing(),this.updateGridLines());break;case"draggableHandle":this.setProperties({draggableHandle:e.draggableHandle},!0),this.ensureDrag();break;case"allowFloating":this.setProperties({allowFloating:e.allowFloating},!0),this.moveItemsUpwards();break;case"showGridLines":this.showGridLines?(this.setProperties({showGridLines:e.showGridLines},!0),this.initGridLines()):this.table&&G(this.table);break;case"allowPushing":this.setProperties({allowPushing:e.allowPushing},!0);break;case"panels":!e.columns&&!this.restrictDynamicUpdate&&e.panels[0]&&0<e.panels.length?(this.isRenderComplete=!1,this.updatePanelsDynamically(e.panels),this.isRenderComplete=!0):e.panels[0]&&e.panels.length?this.restrictDynamicUpdate=!1:(this.isRenderComplete=!1,this.updatePanelsDynamically(this.panels),this.isRenderComplete=!0);break;case"columns":this.isRenderComplete=!1,e.panels&&this.updatePanelsDynamically(e.panels),this.setProperties({columns:e.columns},!0),this.panelCollection=[],this.maxColumnValue=this.columns,this.calculateCellSize(),this.panels.forEach(function(e){var t;i.setMinMaxValues(e),(i.maxColumnValue<e.col||i.maxColumnValue<e.col+e.sizeX)&&(t=i.maxColumnValue-e.sizeX,i.panelPropertyChange(e,{col:t<0?0:t}),i.setXYAttributes(document.getElementById(e.id),e)),i.setHeightAndWidth(document.getElementById(e.id),e),i.panelCollection.push(document.getElementById(e.id)),i.setPanelPosition(document.getElementById(e.id),e.row,e.col),i.mainElement=document.getElementById(e.id),i.updatePanelLayout(document.getElementById(e.id),e),i.mainElement=null}),this.updatePanels(),this.updateCloneArrayObject(),this.isRenderComplete=!0,this.updateGridLines()}},kKe.prototype.getPersistData=function(){return this.addOnPersist(["panels"])},kKe.prototype.mergePersistPanelData=function(e){var t=window.localStorage.getItem(this.getModuleName()+this.element.id);if(!je(t)&&""!==t||!je(e)){var i=je(e)?JSON.parse(t):e,t=Object.keys(i);this.isProtectedOnChange=!0;for(var n=0,o=t;n<o.length;n++){var r=o[n];"object"!=typeof R(r,this)||je(R(r,this))||Array.isArray(R(r,this))&&"panels"===r&&(this.mergePanels(i[r],this[r]),this[r]=i[r])}this.isProtectedOnChange=!1}},kKe.prototype.mergePanels=function(e,i){for(var n=e,o=this,t=0;t<n.length;t++)!function(t){o.checkForIDValues(i);var e=i.filter(function(e){return e.id===n[t].id})[0];je(e)||(n[t]=Pe(e,n[t],{},!0))}(t)},kKe.prototype.getModuleName=function(){return"DashboardLayout"},M$([e(!0)],kKe.prototype,"allowDragging",void 0),M$([e(!1)],kKe.prototype,"allowResizing",void 0),M$([e(!0)],kKe.prototype,"allowPushing",void 0),M$([e(!0)],kKe.prototype,"enableHtmlSanitizer",void 0),M$([e(!0)],kKe.prototype,"allowFloating",void 0),M$([e(1)],kKe.prototype,"cellAspectRatio",void 0),M$([e([5,5])],kKe.prototype,"cellSpacing",void 0),M$([e(1)],kKe.prototype,"columns",void 0),M$([e(!1)],kKe.prototype,"showGridLines",void 0),M$([e(null)],kKe.prototype,"draggableHandle",void 0),M$([e("en-US")],kKe.prototype,"locale",void 0),M$([e("max-width: 600px")],kKe.prototype,"mediaQuery",void 0),M$([kt([],EKe)],kKe.prototype,"panels",void 0),M$([e(["e-south-east"])],kKe.prototype,"resizableHandles",void 0),M$([i()],kKe.prototype,"change",void 0),M$([i()],kKe.prototype,"dragStart",void 0),M$([i()],kKe.prototype,"drag",void 0),M$([i()],kKe.prototype,"dragStop",void 0),M$([i()],kKe.prototype,"resizeStart",void 0),M$([i()],kKe.prototype,"resize",void 0),M$([i()],kKe.prototype,"resizeStop",void 0),M$([i()],kKe.prototype,"created",void 0),M$([i()],kKe.prototype,"destroyed",void 0);var MKe,$$=M$([Bt],kKe);function kKe(e,t){e=MKe.call(this,e,t)||this;return e.rows=1,e.panelID=0,e.movePanelCalled=!1,e.resizeCalled=!1,e.mOffX=0,e.mOffY=0,e.maxTop=9999,e.maxRows=100,e.mouseX=0,e.mouseY=0,e.minTop=0,e.minLeft=0,e.isInlineRendering=!1,e.removeAllCalled=!1,e.isPanelRemoved=!1,e.panelsSizeY=0,e.resizeHeight=!1,e.eventVar=!1,x("mergePersistData",e.mergePersistPanelData,e),e}PKe=function(e,t){return(PKe=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])}))(e,t)};var PKe,BKe,FKe,LKe,wce=function(e,t){function i(){this.constructor=e}PKe(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},d$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},RKe="e-opposite-content",OKe="e-vertical",NKe="e-horizontal",VKe="e-timeline-reverse",_Ke="e-item-disabled",HKe="e-item-template",d2=((jee=BKe=BKe||{}).Horizontal="Horizontal",jee.Vertical="Vertical",(gRe=FKe=FKe||{}).Before="Before",gRe.After="After",gRe.Alternate="Alternate",gRe.AlternateReverse="AlternateReverse",wce(zKe,LKe=n),d$([e("")],zKe.prototype,"dotCss",void 0),d$([e("")],zKe.prototype,"content",void 0),d$([e("")],zKe.prototype,"oppositeContent",void 0),d$([e(!1)],zKe.prototype,"disabled",void 0),d$([e("")],zKe.prototype,"cssClass",void 0),zKe);function zKe(){return null!==LKe&&LKe.apply(this,arguments)||this}wce(WKe,jKe=Ji),WKe.prototype.preRender=function(){this.element.id||(this.element.id=D("e-"+this.getModuleName()))},WKe.prototype.getModuleName=function(){return"timeline"},WKe.prototype.getPersistData=function(){return this.addOnPersist([])},WKe.prototype.render=function(){pt(this.element,{role:"navigation","aria-label":this.element.id}),this.timelineListEle=this.createElement("ol",{className:"e-timeline-items"}),this.updateOrientation(),this.updateCssClass(this.cssClass),this.updateAlign(),this.updateReverse(),this.updateRtl(),this.updateTemplateFunction(),this.renderItems(),this.element.appendChild(this.timelineListEle)},WKe.prototype.updateOrientation=function(){var e;je(this.orientation)||"horizontal"!==(e=this.orientation.toLowerCase())&&"vertical"!==e||(this.element.classList.remove(NKe,OKe),this.element.classList.add("e-"+e))},WKe.prototype.updateCssClass=function(e,t){var i;(t=void 0===t?"":t)&&(i=t.trim().split(" "),(t=this.element.classList).remove.apply(t,i)),e&&(i=e.trim().split(" "),(t=this.element.classList).add.apply(t,i))},WKe.prototype.updateRtl=function(){this.element.classList[this.enableRtl?"add":"remove"]("e-rtl")},WKe.prototype.updateAlign=function(){var e;je(this.align)||"before"!==(e=this.align.toLowerCase())&&"after"!==e&&"alternate"!==e&&"alternatereverse"!==e||(this.element.classList.remove("e-align-before","e-align-after","e-align-alternate","e-align-alternatereverse"),this.element.classList.add("e-align-"+e))},WKe.prototype.updateReverse=function(){this.element.classList[this.reverse?"add":"remove"](VKe)},WKe.prototype.renderItems=function(){var t=this;this.haveOneSidecontent();for(var e=0;e<this.items.length;e++){var i,n=this.items[parseInt(e.toString(),10)],o=this.createElement("li",{className:"e-timeline-item e-connector"}),r=(this.template?this.renderItemContent(e,!1,o):(i=this.createElement("div",{className:RKe}),n.oppositeContent&&this.updateItemContent(!1,n,e,i),o.appendChild(i),i=this.createElement("div",{className:"e-dot-item"}),r=n.dotCss?"e-dot "+n.dotCss.trim():"e-dot",r=this.createElement("div",{className:r}),i.appendChild(r),o.appendChild(i),r=this.createElement("div",{className:"e-content"}),n.content&&this.updateItemContent(!0,n,e,r),o.appendChild(r),n.cssClass&&(i=o.classList).add.apply(i,n.cssClass.trim().split(" ")),n.disabled&&o.classList.add(_Ke)),{element:o,index:e});this.trigger("beforeItemRender",r,function(e){t.timelineListEle.appendChild(e.element)})}},WKe.prototype.haveOneSidecontent=function(){for(var e=!1,t=!1,i=0;i<this.items.length;i++)var n=this.items[parseInt(i.toString(),10)],e=e||0<n.content.length||!je(n.content),t=t||0<n.oppositeContent.length||!je(n.content);this.element.classList.remove("e-content-only","e-opposite-content-only"),e&&!t&&this.element.classList.add("e-content-only"),t&&!e&&this.element.classList.add("e-opposite-content-only")},WKe.prototype.updateItemContent=function(e,t,i,n){var o=!(this.isReact||this.isVue),e=this.getTemplateFunction(e?t.content:t.oppositeContent,o);"string"==typeof e?n.innerText=e:ht(e({item:t,itemIndex:i},this),n)},WKe.prototype.updateTemplateFunction=function(){this.templateFunction=this.template?this.getTemplateFunction(this.template,!1):null},WKe.prototype.renderItemContent=function(e,t,i){var n,o=this.timelineListEle.querySelectorAll("li");t&&this.removeItemContent(o[parseInt(e.toString(),10)]),this.template&&((t?o[parseInt(e.toString(),10)]:i).classList.add(HKe),n=this.items[parseInt(e.toString(),10)],ht(this.templateFunction({item:n,itemIndex:e},this,"timelineTemplate",this.element.id+"_timelineTemplate",this.isStringTemplate),t?o[parseInt(e.toString(),10)]:i)),this.renderReactTemplates()},WKe.prototype.removeItemContent=function(e){e.classList.remove(HKe);for(var t=e.firstElementChild,i=0;i<e.childElementCount;i++)t.remove()},WKe.prototype.getTemplateFunction=function(t,e){if(void 0===e&&(e=!0),"string"!=typeof t)return oo(t);var i="";try{var n=ge(t);n?(i="SCRIPT"===n.tagName?n.innerHTML:n.outerHTML,e=!1):i=t}catch(e){i=t}return e?i:oo(i)},WKe.prototype.removeItemElements=function(){for(var e=this.timelineListEle.querySelectorAll("li"),t=0;t<e.length;t++)ue(e[parseInt(t.toString(),10)])},WKe.prototype.updateElementClassArray=function(){q([this.element],["e-rtl","e-align-before","e-align-after","e-outline","e-fill","e-align-alternate","e-align-alternatereverse",VKe,NKe,OKe])},WKe.prototype.updateContent=function(){this.isReact&&this.clearTemplate(["timelineTemplate"]);for(var e=0;e<this.items.length;e++)this.renderItemContent(e,!0)},WKe.prototype.destroy=function(){jKe.prototype.destroy.call(this),this.removeItemElements(),this.element.removeAttribute("role"),this.element.removeAttribute("aria-label"),this.clearTemplate(),this.timelineListEle&&ue(this.timelineListEle),this.timelineListEle=null,this.updateElementClassArray()},WKe.prototype.updateItems=function(e,t,i,n){var o,r,s=this.timelineListEle.querySelectorAll("li");switch(e){case"dotCss":o=s[parseInt(i.toString(),10)].querySelector(".e-dot"),""!==t.dotCss&&(r=o.classList).remove.apply(r,t.dotCss.trim().split(" ")),""!==n.dotCss&&(r=o.classList).add.apply(r,this.items[parseInt(i.toString(),10)].dotCss.trim().split(" "));break;case"content":(o=s[parseInt(i.toString(),10)].querySelector(".e-content")).innerText="",this.updateItemContent(!0,n,i,o),this.haveOneSidecontent();break;case"oppositeContent":(r=s[parseInt(i.toString(),10)].querySelector("."+RKe)).innerText="",this.updateItemContent(!1,n,i,r),this.haveOneSidecontent();break;case"disabled":s[parseInt(i.toString(),10)].classList[this.items[parseInt(i.toString(),10)].disabled?"add":"remove"](_Ke);break;case"cssClass":""!==t.cssClass&&(o=s[parseInt(i.toString(),10)].classList).remove.apply(o,t.cssClass.trim().split(" ")),""!==n.cssClass&&(r=s[parseInt(i.toString(),10)].classList).add.apply(r,n.cssClass.trim().split(" "))}},WKe.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"items":if(Array.isArray(e.items))this.removeItemElements(),this.renderItems();else for(var o=Object.keys(e.items).length,r=0;r<o;r++)for(var s=parseInt(Object.keys(e.items)[r],10),a=0;a<Object.keys(e.items[s]).length;a++){var l=Object.keys(e.items[s])[a];this.updateItems(l,t.items[s],s,e.items[s])}break;case"orientation":this.updateOrientation();break;case"align":this.updateAlign();break;case"enableRtl":this.updateRtl();break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass);break;case"reverse":this.element.classList[this.reverse?"add":"remove"](VKe);break;case"template":this.updateTemplateFunction(),this.updateContent()}},d$([e(BKe.Vertical)],WKe.prototype,"orientation",void 0),d$([e(FKe.After)],WKe.prototype,"align",void 0),d$([kt([],d2)],WKe.prototype,"items",void 0),d$([e("")],WKe.prototype,"cssClass",void 0),d$([e(!1)],WKe.prototype,"reverse",void 0),d$([e("")],WKe.prototype,"template",void 0),d$([i()],WKe.prototype,"created",void 0),d$([i()],WKe.prototype,"beforeItemRender",void 0);var jKe,M$=d$([Bt],WKe);function WKe(e,t){return jKe.call(this,e,t)||this}function QKe(e,t,i){var t=R("name",t),n=e.getAttribute("data-id"),n=je(n)?t:n;i.setProperties({path:UKe(e,n,i.hasId)},!0),i.pathId=qKe(e),i.pathNames=GKe(e,t)}function UKe(e,t,i){for(var n=YKe(e,t,!1,i),o="/",r=n.length-2;0<=r;r--)o+=n[r]+"/";return o}function qKe(e){for(var t=YKe(e,e.getAttribute("data-uid"),!0),i=[],n=t.length-1;0<=n;n--)i.push(t[n]);return i}function GKe(e,t){for(var i=YKe(e,t,!1),n=[],o=i.length-1;0<=o;o--)n.push(i[o]);return n}function YKe(e,t,i,n){for(var o,r=[t],s=e.parentNode;!je(s)&&(ft(s,"."+kGe)&&(o=i?s.getAttribute("data-uid"):n?s.getAttribute("data-id"):ge("."+PGe,s).textContent,r.push(o)),!(s=s.parentNode).classList.contains(nYe)););return r}function XKe(e){for(var t=e.hasId?"id":"name",i="/",n=1;n<e.pathId.length;n++){var o=R(e.pathId[parseInt(n.toString(),10)],e.feParent);i+=R(t,o)+"/"}e.setProperties({path:i},!0)}function KKe(e){e.isCut&&($Ke(e),e.selectedNodes=[],e.actionRecords=[],e.enablePaste=!1,e.notify(fXe,{}))}function JKe(e,t){if(t.isSearchCut=!1,t.actionRecords=[],t.activeElements=[],t.notify(vXe,{}),0===t.activeElements.length)return!1;$Ke(t);var i=t.activeElements,n=("navigationpane"!==t.activeModule?t.targetPath=t.path:t.targetPath=MJe(t.path),0);if(i&&(eJe(t,i[0]),"cut"===e))for(;n<i.length;)ZKe(i[n]),n++;for(n=0,t.selectedNodes=[],t.enablePaste=!0,t.notify(mXe,{});n<t.activeRecords.length;)t.actionRecords.push(t.activeRecords[n]),t.selectedNodes.push(R("name",t.activeRecords[n])),n++;if((""!==t.breadcrumbbarModule.searchObj.element.value||t.isFiltered)&&"navigationpane"!==t.activeModule){t.selectedNodes=[],t.isSearchCut=!0;for(var o=0;o<t.selectedItems.length;)t.selectedNodes.push(t.selectedItems[o]),o++}return!0}function ZKe(e){e.classList.add(RGe)}function $Ke(e,t){for(var i=t?e.element.querySelectorAll("."+NGe):e.element.querySelectorAll("."+RGe),n=0;n<i.length;)i[n].classList.remove(t?NGe:RGe),n++}function eJe(e,t){t&&(t.classList.contains(WGe)?e.activeModule="detailsview":z(t,"."+eYe)?e.activeModule="largeiconsview":e.activeModule="navigationpane")}function tJe(t,i){var e=t.fileSystemData.filter(function(e){return String(e.parentId)===String(i)}),n=e.slice();return e.forEach(function(e){e=e.id;n=n.concat(tJe(t,e))}),n}function iJe(e,t,i){var n,o;0!==t.length||e.isFiltered||e.notify(IXe,{args:e}),gZe(e)?""===t?(e.itemData=e.fileSystemData,aZe(e,i?aXe:eXe,e.path)):(e.searchSettings.filterType=je(e.searchSettings.filterType)?"contains":e.searchSettings.filterType,o=R(e.pathId[e.pathId.length-1],e.feParent),o=tJe(e,R("id",o)),o=new me(o).executeLocal((new ya).where("name",e.searchSettings.filterType,t,e.searchSettings.ignoreCase)),n=e.searchSettings.ignoreCase?t.toLowerCase():t,e.itemData=o,OZe(e,i?aXe:eXe,e.path,n,e.showHiddenItems,!e.searchSettings.ignoreCase)):(o="startsWith"===e.searchSettings.filterType?t+"*":"endsWith"===e.searchSettings.filterType?"*"+t:"*"+t+"*",e.searchWord=o,e.itemData=[aJe(e)],0<t.length?(n=e.searchSettings.ignoreCase,t=e.showHiddenItems,OZe(e,i?aXe:eXe,e.path,o,t,!n)):e.isFiltered?hZe(e,aXe):e.isSortByClicked?(e.notify(aXe,{files:"Details"===e.oldView?e.detailsviewModule.gridObj.dataSource:e.largeiconsviewModule.allItems}),e.isSortByClicked=!1):aZe(e,i?aXe:eXe,e.path))}function nJe(e,t){e.oldView=e.view,e.setProperties({view:t},!0),""===e.breadcrumbbarModule.searchObj.element.value&&!e.isFiltered||(e.layoutSelectedItems=e.selectedItems);t="";e.breadcrumbbarModule.searchObj.element.value&&(t=e.breadcrumbbarModule.searchObj.element.value),e.isLayoutChange=!0,iJe(e,t,!0)}function oJe(e,t){var i="";t&&(i=z(t,"."+vGe+"."+bGe+" ."+lYe)?"detailsview":z(t,"."+DGe)?"largeiconsview":t.classList.contains("e-fullrow")||t.classList.contains("e-icon-expandable")?"navigationpane":z(t,".e-address-list-item")?"breadcrumbbar":""),e.targetModule=i}function rJe(e){e.itemData=[aJe(e)],JJe(e.itemData[0])?aZe(e,QYe,e.path):XJe(e,e.itemData[0],LXe)}function sJe(e){aZe(e,iXe,e.path)}function aJe(e){return R(e.pathId[e.pathId.length-1],e.feParent)}function lJe(e){JKe("copy",e)&&(e.fileAction="copy")}function hJe(e){JKe("cut",e)&&(e.isCut=!0,e.fileAction="move")}function dJe(e){return R("isFile",e)?(-1!==(e=(e=R("type",e)).toLowerCase()).indexOf(".")&&(e=e.split(".").join("")),-1!==["bmp","dib","jpg","jpeg","jpe","jfif","gif","tif","tiff","png","ico"].indexOf(e)?JGe:-1!==["mp3","wav","aac","ogg","wma","aif","fla","m4a"].indexOf(e)?ZGe:-1!==["webm","mkv","flv","vob","ogv","ogg","avi","wmv","mp4","3gp"].indexOf(e)?$Ge:-1!==["css","exe","html","js","msi","pdf","pptx","ppt","rar","zip","txt","docx","doc","xlsx","xls","xml","rtf","php"].indexOf(e)?"e-fe-"+e:"e-fe-unknown e-fe-"+e):KGe}function pJe(e,t){var i,n,o,r,s=gZe(e)?R("imageUrl",t):"";return(gZe(e)?(e.trigger("beforeImageLoad",i={fileDetails:[t],imageUrl:s}),i):(n=-1!==(i=e.ajaxSettings.getImageUrl||e.ajaxSettings.url).indexOf("?")?"&path=":"?path=",o=encodeURIComponent(R("name",t)),r=R("filterPath",t),t={fileDetails:[t],imageUrl:s=(s=e.hasId?(t=R("id",t),i+n+e.path+"&id="+t):je(r)?i+n+e.path+o:i+n+encodeURIComponent(r.replace(/\\/g,"/"))+o)+"&time="+(new Date).getTime().toString()},e.trigger("beforeImageLoad",t),t)).imageUrl}function cJe(e,t,i){var n=R(e.hasId?"id":"name",t)+"/",e=R(e.hasId?"filterId":"filterPath",t);return je(e)?i+n:e.replace(/\\/g,"/").replace(/^.*?(?=\/)/,"")+n}function uJe(e,t){var i=R("name",t),t=R("filterPath",t);return i=""===e.breadcrumbbarModule.searchObj.element.value&&!e.isFiltered||je(t)?i:(t=t.replace(/\\/g,"/")).replace(e.path,"")+i}function gJe(e,t){return 0===t.length?t:(e=("None"===e.sortOrder||je(e.sortOrder)?new ya:(new ya).sortBy(e.sortBy,e.sortOrder.toLowerCase(),!0)).group("isFile"),R("records",new me(t).executeLocal(e)))}function mJe(e,t,i){e=R(e.pathId[e.pathId.length-1],e.feFiles).filter(function(e){return e[t].toString()===i});return 0<e.length?e[0]:null}function fJe(e,t,i){var n,o,r=ge("#"+e.element.id+oGe,e.element),s=ge("#"+e.element.id+mGe,r).offsetHeight,s=r.offsetHeight-s,a=("Details"===e.view&&(s-=ge("."+iYe,r).offsetHeight),je(t.querySelector("."+QGe))&&(r=Q("div",{className:QGe}),a=Q("div",{className:tYe}),n=Q("div",{className:UGe}),o=Q("div",{className:qGe}),("Details"===e.view?t.querySelector("."+aYe):t).appendChild(r),r.appendChild(a),r.appendChild(n),r.appendChild(o)),t.querySelector("."+QGe)&&(je(i.error)?e.isFiltered?(t.querySelector("."+UGe).innerHTML=wJe(e,"Filter-Empty"),t.querySelector("."+qGe).innerHTML=wJe(e,"Filter-Key")):""!==e.breadcrumbbarModule.searchObj.element.value?(t.querySelector("."+UGe).innerHTML=wJe(e,"Search-Empty"),t.querySelector("."+qGe).innerHTML=wJe(e,"Search-Key")):(t.querySelector("."+UGe).innerHTML=wJe(e,"Folder-Empty"),t.querySelector("."+qGe).innerHTML=wJe(e,"File-Upload")):(t.querySelector("."+UGe).innerHTML=wJe(e,"Access-Denied"),t.querySelector("."+qGe).innerHTML=wJe(e,"Access-Details"))),ge("."+QGe,t));s=(s-a.offsetHeight)/2,a.style.marginTop=s+"px"}function yJe(e){return new me(e).executeLocal((new ya).where("isFile","equal",!1,!1))}function vJe(e,t){for(var i=yJe(e.files),n=0,o=i.length;n<o;n++)x("_fm_id",t+"_"+n,i[n])}function bJe(e){for(var t=0;t<e.length;t++){var i=new Date(R("dateCreated",e[t])),n=new Date(R("dateModified",e[t]));x("_fm_created",i,e[t]),x("_fm_modified",n,e[t])}}function wJe(e,t){e=e.localeObj.getConstant(t);return""===e?t:e}function CJe(e,t){e=e.cssClass;return je(e)||""===e?t:e+" "+t}function SJe(e,t){e.isSortByClicked=!0,-1!==t.item.id.indexOf("ascending")||-1!==t.item.id.indexOf("descending")||-1!==t.item.id.indexOf("none")?e.sortOrder=AJe(t.item.id):e.sortBy=AJe(t.item.id,e),e.itemData=[aJe(e)],"Details"===e.view&&(e.isMobile?nJe(e,"Details"):(e.notify(xXe,{module:"detailsview"}),e.isSortByClicked=!1)),"LargeIcons"===e.view&&nJe(e,"LargeIcons"),e.notify(lXe,{})}function AJe(e,t){var i,e=e.substring(e.lastIndexOf("_")+1),n=e;switch(t&&(i=t.detailsViewSettings.columns),e){case"date":for(var o=0,r=i.length;o<r;o++){if("dateModified"===i[o].field||"dateCreated"===i[o].field){n=i[o].field;break}n="_fm_modified"}break;case"ascending":n="Ascending";break;case"descending":n="Descending";break;case"none":n="None"}return n}function xJe(e,t){for(var t=t.split("/"),i=e.originalPath.split("/"),n=R(e.pathId[0],e.feParent),o=je(R("id",n))?"name":"id",r=t.length-1,s=i.length-1;r<s;r++){var a,l=""===i[r+1]?VYe:NYe,h=""===i[r]?"/":e.path+i[r]+"/",d=mJe(e,o,i[parseInt(r.toString(),10)]);je(d)?e.originalPath=h:(a=R("_fm_id",d),e.setProperties({path:h},!0),e.pathId.push(a),e.itemData=[d],e.pathNames.push(R("name",d))),aZe(e,l,e.path);break}}function IJe(e,t){e.originalPath=cJe(e,t,e.path);var i=R(e.pathId[0],e.feParent),n=e.feParent[R("_fm_id",e.itemData[0])],n=je(n)||"fe_tree"===R("_fm_id",n),i=mJe(e,je(R("id",i))?"name":"id",gZe(e)?R("id",t):R("name",t));if(je(i)){if(n)return void xJe(e,e.path);e.notify(sXe,{selectedNode:e.pathId[e.pathId.length-1]})}else{t=R("_fm_id",i);e.setProperties({path:e.originalPath},!0),e.pathId.push(t),e.itemData=[i],e.pathNames.push(R("name",i))}aZe(e,e.path!==e.originalPath?NYe:VYe,e.path)}function TJe(e){var t;e.isDragDrop=!1,0!==e.selectedNodes.length&&e.enablePaste&&(t=""===e.folderPath?e.path:e.folderPath,"navigationpane"!==e.activeModule||e.selectedNodes[0].includes("/")||(e.targetPath=rZe(e,e.actionRecords[0])),EJe(e,e.actionRecords,t,e.path)||("move"===e.fileAction&&e.targetPath!==t||"copy"===e.fileAction?(e.notify(bXe,{}),pZe(e,e.targetPath,e.selectedNodes,t,e.fileAction,[],e.actionRecords)):(e.enablePaste=!1,e.notify(fXe,{}),$Ke(e),HZe(e,"Error",{files:null,error:{code:"402",message:wJe(e,"Same-Folder-Error"),fileExists:null}}))))}function EJe(e,t,i,n){for(var o=!1,r=0;r<t.length;r++)if(R("isFile",t[r])){var s=e.dragData[r]?e.dragData[r].name:null,s=gZe(e)?s:e.dragNodes[r],a=0,l="";if((l=0<(a=s?s.lastIndexOf("/"):a)?n+s.substring(0,a+1):l)===i){HZe(e,"Error",{files:null,error:{code:"402",message:wJe(e,"Same-Folder-Error"),fileExists:null}}),o=!0;break}}else{s=cJe(e,t[r],n);if(0===i.indexOf(s)){HZe(e,"Error",{files:null,error:{code:"402",message:wJe(e,"Sub-Folder-Error"),fileExists:null}}),o=!0;break}}return o}function DJe(e){e.isDragDrop=!0,0!==e.dragData.length&&(e.dragPath=e.dragPath.replace(/\\/g,"/"),e.dropPath=e.dropPath.replace(/\\/g,"/"),EJe(e,e.dragData,e.dropPath,e.dragPath)||e.dragPath===e.dropPath||(e.itemData=[e.dropData],pZe(e,e.dragPath,e.dragNodes,e.dropPath,"move",[],e.dragData),e.notify(bXe,{})))}function MJe(e){for(var t=e.split("/"),i=t[0]+"/",n=1;n<t.length-2;n++)i+=t[n]+"/";return i}function kJe(e,t){var i=R(e.hasId?"id":"name",t.cwd)+"/",t=R(e.hasId&&!je(e.ajaxSettings.url)?"filterId":"filterPath",t.cwd);return je(t)?gZe(e)?i:e.path+i:""===t?"/":t.replace(/\\/g,"/").replace(/^.*?(?=\/)/,"")+i}function PJe(e,t,i){"move"===t&&(e.isDragDrop?e.notify(MXe,i):(e.enablePaste=!1,e.notify(fXe,{}),e.notify(CXe,i))),0===e.duplicateItems.length&&(e.pasteNodes=[]);for(var n=0;n<i.files.length;n++)e.pasteNodes.push(i.files[n][e.hasId?"id":"name"]),e.isDragDrop&&e.droppedObjects.push(i.files[n]);e.duplicateItems=[],e.duplicateRecords=[],e.isDragDrop&&!e.isPasteError?e.isDropEnd=!0:e.isDropEnd=!1,e.trigger("success",{action:t,result:i}),!e.isDragDrop||e.path===e.dragPath||e.path===e.dropPath||e.isSearchDrag?(e.isPathDrag=!1,aZe(e,wXe,e.path)):BJe(e)}function BJe(e){var t=R("_fm_id",e.dropData);e.expandedId=t,e.itemData=[e.dropData],e.isPathDrag?e.notify(zYe,e.itemData):(e.navigationpaneModule&&QKe(ge('[data-uid="'+t+'"]',e.navigationpaneModule.treeObj.element)||ge('[data-uid="'+document.querySelector('[data-id = "'+R("id",e.dropData)+'"]').getAttribute("data-uid")+'"]',e.navigationpaneModule.treeObj.element),e.dropData,e),aZe(e,kXe,e.dropPath))}function FJe(e,t){for(var i=null,n=e.isDragDrop?e.dragData:e.actionRecords,o=0;o<n.length;o++)if(R("name",n[o])===t){i=n[o];break}return i}function LJe(e){if(e.isSearchDrag=!1,""!==e.breadcrumbbarModule.searchObj.element.value&&(e.isSearchDrag=!0),"navigationpane"!==e.activeModule){e.dragNodes=[];for(var t=0;t<e.selectedItems.length;)e.dragNodes.push(e.selectedItems[t]),t++;0===e.selectedItems.length&&e.dragData&&1===e.dragData.length&&e.dragNodes.push(WJe(e,e.dragData[0]))}var i=e.createElement("div",{className:"e-fe-icon "+dJe(e.dragData[0])}),n=e.createElement("div",{className:"e-fe-name",innerHTML:e.dragData[0].name}),o=e.createElement("div",{className:"e-fe-content"}),i=(o.appendChild(i),o.appendChild(n),e.createElement("div",{className:GGe}));i.appendChild(o),1<e.dragNodes.length&&(n=e.createElement("span",{className:"e-fe-count",innerHTML:e.dragNodes.length.toString(10)}),i.appendChild(n)),e.virtualDragElement=i,e.element.appendChild(e.virtualDragElement)}function RJe(t,e){var i=e,n=(i.cancel=!1,null!=t.treeExpandTimer&&(window.clearTimeout(t.treeExpandTimer),t.treeExpandTimer=null),VJe(t),t.element.classList.remove("e-fe-drop","e-no-drop"),$Ke(t),t.uploadObj.dropArea=ge("#"+t.element.id+gGe,t.element),ge("."+GGe,t.element));n&&G(n),oJe(t,e.target),t.notify(DXe,e),$Ke(t,"hover"),i.fileDetails=t.dragData,t.trigger("fileDragStop",i,function(e){!e.cancel&&!je(t.targetModule)&&""!==t.targetModule&&2<t.dragCount&&DJe(t),t.dragCount=0})}function OJe(t,i,n){var e=i;if(e.cancel=!1,e.fileDetails=t.dragData,t.dragCount=0,t.droppedObjects=[],t.allowDragAndDrop&&("navigationpane"!==t.activeModule||z(i.element,"li").getAttribute("data-uid")!==t.pathId[0])||(e.cancel=!0),"navigationpane"===t.activeModule&&-1!==t.pathId.indexOf(z(i.element,"li").getAttribute("data-uid"))?t.isPathDrag=!0:t.isPathDrag=!1,$Ke(t),e.cancel)n.intDestroy(i.event),NJe(t);else if(!e.cancel){for(var o=0;o<t.activeElements.length;)ZKe(t.activeElements[o]),o++;t.trigger("fileDragStart",e,function(e){e.cancel?(n.intDestroy(i.event),NJe(t)):t.uploadObj.dropArea=null})}}function NJe(e){$Ke(e);e=ge("."+GGe,e.element);e&&G(e)}function VJe(e){_Je(e,YGe),_Je(e,XGe)}function _Je(e,t){for(var i=e.element.querySelectorAll("."+t),n=0;n<i.length;n++)i[n].classList.remove(t)}function HJe(e,t,i,n){var o,r=e.getBoundingClientRect(),i=ge("."+i,e);n>=r.top+e.clientHeight-30&&!je(i)&&(o="navigationpane"===t.targetModule||"detailsview"===t.targetModule?i.offsetHeight/2.5:i.offsetHeight/4.5,e.scrollBy(0,o)),!je(i)&&n<=r.top+30&&(o="navigationpane"===t.targetModule||"detailsview"===t.targetModule?i.offsetHeight/2.5:i.offsetHeight/4.5,e.scrollBy(0,-o))}function zJe(e,t){var i=t,n=(i.fileDetails=e.dragData,!1),o=(oJe(e,t.target),VJe(e),null!=e.treeExpandTimer&&(window.clearTimeout(e.treeExpandTimer),e.treeExpandTimer=null),$Ke(e,"hover"),null);"navigationpane"===e.targetModule?((o=z(t.target,"li")).classList.add(NGe,YGe),n=!0,e.treeExpandTimer=window.setTimeout(function(){e.notify(PXe,t)},800),HJe(e.navigationpaneModule.treeObj.element.parentElement,e,"e-level-2",t.event.y)):"detailsview"===e.targetModule?((o=z(t.target,"tr"))&&o.querySelector("."+KGe)&&!o.classList.contains(RGe)?o.classList.add(YGe):!o||o.querySelector("."+KGe)||o.classList.contains(RGe)||o.classList.add(XGe),n=!0,HJe(e.detailsviewModule.gridObj.element.querySelector(".e-content"),e,"e-row",t.event.y)):"largeiconsview"===e.targetModule?((o=z(t.target,"li"))&&o.querySelector("."+KGe)&&!o.classList.contains(RGe)&&o.classList.add(NGe,YGe),n=!0,HJe(e.largeiconsviewModule.element.firstElementChild,e,"e-large-icon",t.event.y)):"breadcrumbbar"===e.targetModule&&(n=!0),e.element.classList.remove("e-fe-drop","e-no-drop"),e.element.classList.add(n?"e-fe-drop":"e-no-drop"),e.dragCount=e.dragCount+1,e.trigger("fileDragging",i)}function jJe(e){for(var t="",i=Object.keys(e),n=0;n<i.length;n++)"message"!==i[n]&&(t+=(0===n?"":", ")+i[n]+": "+R(i[n],e));return t}function WJe(e,t){return e.hasId?R("id",t):uJe(e,t)}function QJe(e,t){e.itemData=[t],e.currentItemText=R("name",t),e.isFile=R("isFile",t),e.filterPath=R("filterPath",t)}function UJe(e){ZJe(e.itemData[0])?HZe(e,"Rename"):XJe(e,e.itemData[0],RXe)}function qJe(e){for(var t=e.itemData,i=0;i<t.length;i++)if(!tZe(t[i]))return void XJe(e,t[i],VXe);0<e.selectedItems.length&&VZe(e,e.path,e.selectedItems)}function GJe(e,t,i){for(var n=0;n<t.length;n++)if(!ZJe(t[n]))return void XJe(e,t[n],RXe);e.itemData=t,cZe(e,i,e.path,"delete")}function YJe(e,t,i){for(var n=0;n<t.length;n++)if(!tZe(t[n]))return void XJe(e,t[n],VXe);e.itemData=t,0<i.length&&VZe(e,e.path,i)}function XJe(e,t,i){var n=R("message",R("permission",t));HZe(e,"Error",{error:{code:"401",fileExists:null,message:n=""===n?wJe(e,"Access-Message").replace("{0}",R("name",t)).replace("{1}",i):n}})}function KJe(e){return JJe(e)?"e-fe-locked":"e-fe-locked e-fe-hidden"}function JJe(e){e=R("permission",e);return!(e&&!R("read",e))}function ZJe(e){e=R("permission",e);return!e||R("read",e)&&R("write",e)}function $Je(e){e=R("permission",e);return!e||R("read",e)&&R("writeContents",e)}function eZe(e){e=R("permission",e);return!e||R("read",e)&&R("upload",e)}function tZe(e){e=R("permission",e);return!e||R("read",e)&&R("download",e)}function iZe(e){var t=e.itemData[0];$Je(t)?HZe(e,"NewFolder"):XJe(e,t,OXe)}function nZe(e){var t,i=e.itemData[0];eZe(i)?(t="#"+e.element.id+fGe,document.querySelector(t).click()):XJe(e,i,NXe)}function oZe(e){je(e.dialogObj)||e.dialogObj.hide()}function rZe(e,t){return e.hasId&&!je(R("filterId",t))?R("filterId",t).replace(/\\/g,"/").replace(/^[^/]+\//,"/"):R("filterPath",t).replace(/\\/g,"/")}function sZe(e,t,i,n){for(var o="",r=0;r<t.length;r++){var s,a=R("permission",t[r]);if(null==a&&(a=void 0),n?!a||R("read",a)&&R("writeContents",a)||""===(o=R("message",R("permission",t[r])))&&(o=wJe(e,"Access-Message").replace("{0}",R("name",t[r])).replace("{1}","writeContents")):(s=R("copy"===i?"copy":"write",a),!a||R("read",a)&&s||""===(o=R("message",R("permission",t[r])))&&(o=wJe(e,"Access-Message").replace("{0}",R("name",t[r])).replace("{1}",i))),""!==o){e.responseData={cwd:null,details:null,error:{code:"401",message:o,fileExists:null},files:null};break}}return o}function aZe(e,t,i){for(var n=e.itemData,o=0;o<n.length;o++)je(R("hasChild",n[o]))&&x("hasChild",!1,n[o]);AZe(e,{action:"read",path:i,showHiddenItems:e.showHiddenItems,data:n},DZe,t)}function lZe(e,t){AZe(e,{action:"create",path:e.path,name:t,data:e.itemData},kZe,t)}function hZe(e,t){var i={action:"filter",path:e.path,showHiddenItems:e.showHiddenItems,data:[aJe(e)]},i=e.filterData?Pe(void 0,i,e.filterData):i;AZe(e,i,MZe,t,R("action",i))}function dZe(e,t,i){var n,o;o=""===e.breadcrumbbarModule.searchObj.element.value&&!e.isFiltered||(o=e.filterPath,e.hasId)?(n=e.currentItemText,i):(n=(o=o.replace(/\\/g,"/")).replace(t,"")+e.currentItemText,o.replace(t,"")+i),AZe(e,{action:"rename",path:t,name:n,newName:o,data:e.itemData,showFileExtension:e.showFileExtension},PZe,t)}function pZe(e,t,i,n,o,r,s){i={action:o,path:t,targetData:e.itemData[0],targetPath:n,names:i,renameFiles:r,data:s};e.destinationPath=n,AZe(e,i,BZe,t,o,n)}function cZe(e,t,i,n){AZe(e,{action:n,path:i,names:t,data:e.itemData},FZe,i)}function uZe(e,t,i,n){AZe(e,{action:n,path:i,names:t,data:e.itemData},LZe,i,n)}function gZe(e){return 0<=e.fileSystemData.length&&je(e.ajaxSettings.url)}function mZe(e,t){return e.some(function(e){return e.name===t})}function fZe(e,t){return e.fileSystemData.findIndex(function(e){return!je(e)&&String(e.id)===String(t)})}function yZe(e,t){return e.fileSystemData.filter(function(e){return String(e.id)===String(t)})[0]}function vZe(e,t){return e.fileSystemData.filter(function(e){return String(e.parentId)===String(t)})}function bZe(e,t,i,n){var o,r={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=null);var s=new Date,a=String(t.id)===String(0)||je(t.parentId)?"\\":t.filterPath+t.name+"\\";return Object.assign(r,{dateCreated:s,dateModified:s,filterPath:a,hasChild:!!n&&e.hasChild,id:$P(null===i?e.name:i),isFile:!!n&&e.isFile,name:null===i?e.name:i,parentId:t.id,size:n?e.size:0,type:n?e.type:""}),r}function wZe(e,t,i,n){e.responseData={cwd:null,details:null,error:{code:i,message:t,fileExists:null!=n?n:null},files:null}}function CZe(n,e,o){e={cancel:!1,newName:R("newName",e),itemData:R("data",e),path:R("path",e)};n.trigger("beforeRename",e,function(e){var t,i;e.cancel?o.cancel=!0:gZe(n)&&(mZe(n.fileSystemData,e.newName)?(t="Cannot rename"+e.itemData[0].name+"to"+e.newName+": destination already exists.",wZe(n,t,"400",null)):(i=(t=yZe(n,e.itemData[0].id)).name,t.name=e.newName,function i(n,o,r,s){n.fileSystemData.forEach(function(e){var t;String(e.parentId)===String(o)&&(t=e.filterPath,t=t.replace(r+"\\",s+"\\"),e.filterPath=t,i(n,e.id,r,s))})}(n,t.id,i,e.newName)))})}function SZe(e,t,i){switch(R("action",t)){case"create":h=e,p=i,d={folderName:R("name",d=t),cancel:!1,path:R("path",d),parentFolder:R("data",d)},h.trigger("beforeFolderCreate",d,function(e){var t;e.cancel?p.cancel=!0:gZe(h)&&(mZe(h.fileSystemData,e.folderName)?(t="A file or folder with the name "+e.folderName+" already exists.",wZe(h,t,"400",null)):(t=bZe(t=e.parentFolder[0],t,e.folderName,!1),h.fileSystemData.push(t)))});break;case"delete":a=e,l=i,d={cancel:!1,itemData:R("data",d=t),path:R("path",d)},a.trigger("beforeDelete",d,function(e){e.cancel?l.cancel=!0:gZe(a)&&e.itemData.forEach(function(t){var e=fZe(a,t.id);-1!==e&&a.fileSystemData.splice(e,1),t.isFile||a.fileSystemData.filter(function(e){return e.filterPath.includes(t.name)}).forEach(function(e){e=fZe(a,e.id);-1!==e&&a.fileSystemData.splice(e,1)})})});break;case"rename":CZe(e,t,i);break;case"move":case"copy":u=e,m=i,s={cancel:!1,itemData:R("data",g=t),isCopy:"copy"===R("action",g),path:R("path",g),targetData:R("targetData",g),targetPath:R("targetPath",g)},u.trigger("beforeMove",s,function(i){if(i.cancel)m.cancel=!0;else if(gZe(u)){var n,e="File Already Exists",t=R("action",g),o=sZe(u,i.itemData,t,!1),t=sZe(u,[i.targetData],t,!0),r=[];if(u.pasteNodes=[],""===o&&""===t){if(i.isCopy)n=vZe(u,i.targetData.id),i.itemData.forEach(function(e){var t;!mZe(n,e.name)||0<R("renameFiles",g).length?0<R("renameFiles",g).length?(t=e.name.split("."),t=e.name.includes(".")?t[0]+"("+u.existingFileCount+")."+t[1]:t[0]+"("+u.existingFileCount+")",TZe(u,e,i.targetData,t),u.responseData.error=null,u.existingFileCount++):TZe(u,e,i.targetData,null):r.push(e.name)});else for(var s=i.targetData,a=vZe(u,s.id),l=0;l<i.itemData.length;l++){var h,d,p,c=i.itemData[l];!mZe(a,c.name)||0<R("renameFiles",g).length?(s.hasChild||(s.hasChild=!c.isFile,0<(h=u.fileSystemData.filter(function(e){return String(e.id)===String(s.id)})).length&&(h[0].hasChild=s.hasChild)),c.isFile||(h=0!==c.parentId?vZe(u,c.parentId):[],yZe(u,c.parentId).hasChild=1<h.length),d=yZe(u,c.id),0<R("renameFiles",g).length&&(p=c.name.split("."),c.name=c.name.includes(".")?p[0]+"("+u.existingFileCount+")."+p[1]:p[0]+"("+u.existingFileCount+")",d.name=c.name,u.responseData.error=null,u.existingFileCount++,u.dropData=s,u.dropPath=i.path,p=i.targetPath.replace(/^\/|\/$/g,"").split("/"),s=yZe(u,p[p.length-1])),d.parentId=s.id,d.filterPath=0===s.id?"\\":s.filterPath+s.name+"\\"):r.push(c.name)}0<r.length&&wZe(u,e,"400",r)}}});break;case"search":s=e,o=i,r={searchResults:R("data",n=t),cancel:!1,path:R("path",n),searchText:R("searchString",n),caseSensitive:R("caseSensitive",n),showHiddenItems:R("showHiddenItems",n)},s.trigger("search",r,function(e){x("data",e.searchResults,n),e.cancel&&(o.cancel=!0)})}var n,o,r,u,g,m,s,a,l,h,d,p}function AZe(s,a,l,h,d,p){var e={url:s.ajaxSettings.url,type:"POST",mode:!0,dataType:"json",contentType:"application/json",data:JSON.stringify(a),onSuccess:null,onFailure:null,beforeSend:null},e={action:R("action",a),ajaxSettings:e,cancel:!1};SZe(s,a,e),s.trigger("beforeSend",e,function(i){var e,t,n,o,r;i.cancel||(s.notify(XYe,{}),gZe(s)?(t=("node-expand"===h||"finalize-end"===h||"rename-end-parent"===h?R("path",a):s.path).replace(/^\/|\/$/g,"").split("/"),t="rename-end-parent"===h||"path-changed"===h&&0!==R("data",a).length&&je(s.renamedItem)?R("data",a)[0].id:t[t.length-1],n=("move"===(o=R("action",a))||"rename"===o||"copy"===o||"delete"===o||"search"===o)&&"rename-end"!==h,"read"===o||"create"===o||"rename-end"===h?(e=0<s.fileSystemData.filter(function(e){return je(e.parentId)}).length?s.fileSystemData.filter(function(e){return je(e.parentId)})[0].id:0,s.responseData={cwd:yZe(s,"/"===s.path&&"node-expand"!==h&&"rename-end-parent"!==h?e:t),details:null,error:null,files:vZe(s,"/"===s.path&&"node-expand"!==h&&"rename-end-parent"!==h?e:t)},je(s.responseData.cwd)&&wZe(s,"Cannot load empty data within the File Manager.","400",null)):n&&null===s.responseData.error?(0===(r="search"===o||"delete"===o?R("data",a):[]).length&&(r="copy"===o?s.pasteNodes.map(function(e){return yZe(s,e)}):R("data",a).map(function(e){return yZe(s,e.id)})),s.responseData={cwd:null,details:null,error:null,files:r}):"details"===R("action",a)&&(e=(r=R("data",a))[0],t=1<r.length,n=r.map(function(e){return e.name}),o=xZe(t?r.reduce(function(e,t){return e+(t.size||0)},0):e.size),r=s.pathNames.includes(e.name)||t?s.pathNames.join("/"):s.pathNames.join("/")+"/"+e.name,s.responseData.details=Object.assign({location:r,multipleFiles:t,name:n.join(", "),size:o},t?{}:{created:e.dateCreated,isFile:e.isFile,modified:e.dateModified,permission:e.permission})),IZe(s,s.responseData,l,a,h,d,p,i)):new ze({url:R("url",i.ajaxSettings),type:R("type",i.ajaxSettings),mode:R("mode",i.ajaxSettings),dataType:R("dataType",i.ajaxSettings),contentType:R("contentType",i.ajaxSettings),data:R("data",i.ajaxSettings),beforeSend:R("beforeSend",i.ajaxSettings),onSuccess:function(e){var t;je(e)?(t={error:{fileExists:null,message:wJe(s,"Server-Error")+" "+s.ajaxSettings.url,code:"406"},files:null},EZe(s,i,l,t,h,d,p)):("string"==typeof e&&(e=JSON.parse(e)),IZe(s,e,l,a,h,d,p,i))},onFailure:function(){var e={files:null,error:{code:"404",message:wJe(s,"Network-Error")+" "+s.ajaxSettings.url,fileExists:null}};EZe(s,i,l,e,h,d,p)}}).send())})}function xZe(e){e=e<1024?e+" B":e<1048576?(e/1024).toFixed(2)+" KB":e<1073741824?(e/1024/1024).toFixed(2)+" MB":(e/1024/1024/1024).toFixed(2)+" GB";return e}function IZe(e,t,i,n,o,r,s,a){e.notify(JYe,{action:"success"});var l,h=e.expandedId||e.pathId[e.pathId.length-1];if(je(t.cwd)||"read"!==R("action",n)||(t.cwd.name=1===e.pathId.length&&e.rootAliasName||t.cwd.name,x("_fm_id",h,t.cwd),x(h,t.cwd,e.feParent),je(t.files)&&"401"!==t.error.code)||("finalize-end"!==o&&"initial-end"!==o||0!==e.pathNames.length||(l=R(e.pathId[0],e.feParent),e.pathNames[0]=R("name",l),e.hasId=!je(R("id",l))),"finalize-end"===o&&XKe(e)),!je(t.files)){bJe(t.files);for(var d=0,p=t.files.length;d<p;d++){var c=t.files[d];x("_fm_iconClass",dJe(c),c)}"read"===R("action",n)&&(vJe(t,h),x(h,t.files,e.feFiles))}je(t.details)||je(e.rootAliasName)||(l=e.rootAliasName||R("name",t.details),h=R("location",t.details).replace(new RegExp("/","g"),"\\"),h=("/"===R("path",n)||e.hasId&&1===R("path",n).match(/[/]/g).length)&&(0===R("names",n).length&&x("name",l,t.details),-1===h.indexOf("\\"))?l:h.replace(h.substring(0,h.indexOf("\\")),l),x("location",h,t.details)),i(e,t,o,r,s),je(t.files)||"path-changed"!==o&&"finalize-end"!==o&&"open-end"!==o&&"drop-path"!==o||e.notify(TXe,t),"function"==typeof R("onSuccess",a.ajaxSettings)&&R("onSuccess",a.ajaxSettings)()}function TZe(e,t,i,n){for(var o=bZe(t,i,n,!0),r=(e.fileSystemData.push(o),e.pasteNodes.push(o.id),vZe(e,t.id)),s=0;s<r.length;s++)TZe(e,r[s],o,null)}function EZe(e,t,i,n,o,r,s){e.notify(JYe,{action:"failure"}),i(e,n,o,r,s),"function"==typeof R("onFailure",t.ajaxSettings)&&R("onFailure",t.ajaxSettings)()}function DZe(t,e,i){try{je(e.files)?(je(e.error)||"401"!==e.error.code||(e.files=[],t.notify(i,e),t.notify(nXe,{})),RZe(t,e,"read"),t.setProperties({path:t.oldPath},!0),t.pathNames.pop()):(t.notify(i,e),t.notify(nXe,{}),n={action:"read",result:e},t.trigger("success",n))}catch(e){_Ze(t,e,"read"),t.setProperties({path:t.oldPath},!0),t.pathNames.pop()}var n;t.isDragDrop&&t.isDropEnd&&(0!==t.droppedObjects.length&&(n={fileDetails:t.droppedObjects},t.trigger("fileDropped",n)),t.isDropEnd=t.isDragDrop=!1)}function MZe(t,e,i,n){try{var o;je(e.files)?RZe(t,e,n):(t.notify(i,e),o={action:n,result:e},t.trigger("success",o))}catch(e){_Ze(t,e,n)}}function kZe(e,t,i){try{var n,o,r,s;je(t.files)?"400"===t.error.code?(e.dialogObj&&e.dialogObj.visible?(n=ge("#newname",e.dialogObj.element),o=wJe(e,"Validation-NewFolder-Exists").replace("{0}",'"'+n.value+'"'),n.parentElement.nextElementSibling.innerHTML=o):HZe(e,"Error",{files:null,error:{code:"400",message:wJe(e,"Validation-NewFolder-Exists").replace("{0}",'"'+i+'"'),fileExists:null}}),s={action:"create",error:t.error},e.trigger("failure",s)):(e.dialogObj&&e.dialogObj.visible&&e.dialogObj.hide(),RZe(e,t,"create")):(e.dialogObj&&e.dialogObj.visible&&e.dialogObj.hide(),e.createdItem=gZe(e)?t.files[t.files.length-1]:t.files[0],e.breadcrumbbarModule.searchObj.value="",r={folderName:i,path:e.path,parentFolder:e.itemData},e.trigger("folderCreate",r),s={action:"create",result:t},e.trigger("success",s),e.itemData=[aJe(e)],aZe(e,_Ye,e.path))}catch(o){e.dialogObj&&e.dialogObj.visible&&e.dialogObj.hide(),_Ze(e,o,"create")}}function PZe(e,t){try{var i,n,o,r,s,a,l;je(t.files)?"400"===t.error.code&&e.dialogObj&&e.dialogObj.visible?(i=ge("#rename",e.dialogObj.element),n=(n=wJe(e,"Validation-Rename-Exists").replace("{0}",'"'+e.currentItemText+'"')).replace("{1}",'"'+i.value+'"'),i.parentElement.nextElementSibling.innerHTML=n,o={action:"rename",error:t.error},e.trigger("failure",o)):(je(e.dialogObj)||e.dialogObj.hide(),RZe(e,t,"rename")):(je(e.dialogObj)||e.dialogObj.hide(),o={action:"rename",result:t},e.trigger("success",o),e.renamedItem=Array.isArray(t.files)?t.files[0]:t.files,r={newName:e.renamedItem.name,itemData:[e.renamedItem],path:e.path},e.trigger("rename",r),"navigationpane"===e.activeModule?(s=aJe(e),a=e.pathId[e.pathId.length-1].split("_").length-2,e.pathId.pop(),e.itemData=[R(e.pathId[e.pathId.length-1],e.feParent)],l=rZe(e,e.renamedItem),aZe(e,uXe,l),!je(s)&&1<e.pathNames.length&&a<=e.pathNames.length-1&&(e.pathNames[a]=e.renameText,e.hasId||e.setProperties({path:"/"+e.pathNames.slice(1).join("/")+"/"},!0)),e.itemData=0<e.navigationpaneModule.previousSelected.length?e.navigationpaneModule.treeObj.getTreeData(e.navigationpaneModule.previousSelected[0]):e.itemData,aZe(e,GYe,e.path),e.itemData[0]=e.renamedItem,e.renamedItem=null):(e.itemData=[aJe(e)],""!==e.breadcrumbbarModule.searchObj.value?OZe(e,gXe,e.path,e.searchWord,e.showHiddenItems,!e.searchSettings.ignoreCase):e.isFiltered?hZe(e,gXe):aZe(e,gXe,e.path)))}catch(n){je(e.dialogObj)||e.dialogObj.hide(),_Ze(e,n,"rename")}}function BZe(t,e,i,n){try{var o={itemData:e.files,isCopy:"copy"===n,path:i,targetData:t.itemData[0],targetPath:t.path};t.trigger("move",o),e.error&&e.error.fileExists?(t.fileLength=0,je(e.files)||(t.isPasteError=!0,PJe(t,n,e)),zZe(t,"DuplicateItems",e.error.fileExists),"404"===e.error.code&&HZe(t,"Error",e)):e.error||je(e.files)?e.error&&!je(e.files)?(t.isPasteError=!0,PJe(t,n,e),HZe(t,"Error",e)):RZe(t,e,n):(t.isPasteError=!1,PJe(t,n,e))}catch(e){_Ze(t,e,n)}}function FZe(t,e,i){try{var n,o={itemData:e.files,path:i};t.trigger("delete",o),je(e.files)||(t.setProperties({path:i},!0),t.itemData=[aJe(t)],aZe(t,WYe,t.path),e.error)?RZe(t,e,"delete"):(n={action:"delete",result:e},t.trigger("success",n))}catch(e){_Ze(t,e,"delete")}}function LZe(t,e,i,n){try{var o;je(e.details)?RZe(t,e,"details"):(HZe(t,n,null,e.details),o={action:"details",result:e},t.trigger("success",o))}catch(e){_Ze(t,e,"details")}}function RZe(e,t,i){HZe(e,"Error",t);i={action:i,error:t.error};e.trigger("failure",i)}function OZe(e,t,i,n,o,r){AZe(e,{action:"search",path:i,searchString:n,showHiddenItems:o,caseSensitive:r,data:e.itemData},NZe,t)}function NZe(t,e,i){try{var n;je(e.files)?RZe(t,e,"search"):(t.notify(i,e),n={action:"search",result:e},t.trigger("success",n))}catch(e){_Ze(t,e,"search")}}function VZe(r,e,t){var s=r.ajaxSettings.downloadUrl||r.ajaxSettings.url,e={action:"download",path:e,names:t,data:r.itemData},t={url:s,type:"POST",contentType:"application/json",responseType:"blob",data:JSON.stringify(e),onSuccess:null,onFailure:null,beforeSend:null};r.trigger("beforeDownload",{data:e,cancel:!1,useFormPost:!0,ajaxSettings:t},function(i){if(!i.cancel)if(i.useFormPost){var e=Q("form",{id:r.element.id+"_downloadForm",attrs:{action:s,method:"post",name:"downloadForm",download:""}}),t=Q("input",{id:r.element.id+"_hiddenForm",attrs:{name:"downloadInput",value:JSON.stringify(i.data),type:"hidden"}});e.appendChild(t),r.element.appendChild(e),document.forms.namedItem("downloadForm").submit(),r.element.removeChild(e)}else try{var n,o;new Qe({url:R("url",i.ajaxSettings),type:R("type",i.ajaxSettings),contentType:R("contentType",i.ajaxSettings),responseType:R("responseType",i.ajaxSettings),beforeSend:R("beforeSend",i.ajaxSettings),onLoad:function(e){n=e.headers.get("Content-Disposition"),o=n?(e=(e=n.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/))&&e[1])?e.replace(/['"]/g,""):o:1<r.itemData.length?"files.zip":R("isFile",r.itemData[0])?R("name",r.itemData[0]):R("name",r.itemData[0])+".zip"},onSuccess:function(e){r.trigger("success",i);var e=URL.createObjectURL(e),t=document.createElement("a");t.href=e,t.download=o,document.body.appendChild(t),t.click(),document.body.removeChild(t)},onFailure:function(e){e={error:{code:e.status.toString(),message:wJe(r,"Network-Error")+" "+r.ajaxSettings.downloadUrl}};HZe(r,"Error",e),r.trigger("failure",i)}}).send(JSON.stringify(i.data))}catch(e){_Ze(r,e,"download")}})}function _Ze(e,t,i){RZe(e,{files:null,error:{message:t.message,fileExists:null}},i)}function HZe(t,e,i,n){var o=function(t,e,i,n){var o,r,s,a={header:"",content:"",buttons:[],dialogName:"",open:function(){QZe(t,t.dialogObj,a.dialogName)},close:function(){UZe(t,t.dialogObj,a.dialogName)}};switch(e=n&&!0===n.multipleFiles?"MultipleFileDetails":e){case"NewFolder":a.dialogName="Create Folder",a.header=wJe(t,"Header-NewFolder"),a.content='<input type="text" value="New folder" id="newname"><div class="e-fe-error"></div>',a.buttons=[{buttonModel:{isPrimary:!0,content:wJe(t,"Button-Create")},click:function(e){"keydown"!==e.type&&ZZe(t)}}],a.open=function(t){var e=ge("#newname",t.dialogObj.element);e.parentElement.classList.contains("e-control-wrapper")||YZe(e,wJe(t,"Content-NewFolder"));e.parentElement.nextElementSibling.innerHTML="",e.oninput=function(){e$e(t,e)},e.onkeyup=function(e){13===n$e(e)&&ZZe(t)},function(e){var e=ge("#newname",e.dialogObj.element),t=(e.focus(),e.value="",e.value.length);e.setSelectionRange(0,t)}(t),QZe(t,t.dialogObj,"Create Folder")}.bind(this,t);break;case"Delete":a.dialogName="Delete",1<t.selectedItems.length?(a.content=("<div>"+wJe(t,"Content-Multiple-Delete")+"</div>").replace("{0}",t.selectedItems.length.toString()),a.header=wJe(t,"Header-Multiple-Delete")):(a.content="<div>"+wJe(t,t.isFile?"Content-Delete":"Content-Folder-Delete")+"</div>",a.header=wJe(t,t.isFile?"Header-Delete":"Header-Folder-Delete")),a.buttons=[{buttonModel:{isPrimary:!0,content:wJe(t,"Button-Yes")},click:function(){var e;(e=t).dialogObj.hide(),e.notify(jYe,{})}},{buttonModel:{content:wJe(t,"Button-No")},click:function(){t.dialogObj.hide()}}];break;case"Rename":a.dialogName="Rename",a.header=wJe(t,"Header-Rename"),a.content='<input type="text" class="e-input" id="rename"><div class="e-fe-error"></div>',a.buttons=[{buttonModel:{isPrimary:!0,content:wJe(t,"Button-Save")},click:function(e){"keydown"!==e.type&&$Ze(t)}}],a.open=function(t){var e=ge("#rename",t.dialogObj.element);e.parentElement.classList.contains("e-control-wrapper")||YZe(e,wJe(t,"Content-Rename"));e.parentElement.nextElementSibling.innerHTML="",e.oninput=function(){e$e(t,e)},e.onkeyup=function(e){13===n$e(e)&&$Ze(t)},function(e,t){t.focus();var i="";{var n;i=!e.isFile||e.showFileExtension||(n=e.currentItemText.lastIndexOf("."),-1===n)?e.currentItemText:e.currentItemText.substring(0,n)}t.value=i,e.isFile&&e.showFileExtension&&-1!==t.value.indexOf(".")?t.setSelectionRange(0,t.value.lastIndexOf(".")):t.setSelectionRange(0,t.value.length)}(t,e),QZe(t,t.dialogObj,"Rename")}.bind(this,t);break;case"details":a.dialogName="File Details",r=new Ti(t.locale),r=r.formatDate(new Date(n.modified),{format:"MMMM dd, yyyy HH:mm:ss"}),o="",je(n.permission)||(o="<tr><td>"+wJe(t,"Permission")+'</td><td class="'+RYe+'" >'+jJe(n.permission)+"</td></tr>"),a.header=n.name,a.content="<table><tr><td>"+wJe(t,"Type")+'</td><td class="'+RYe+'" title="'+(n.isFile?"File":"Folder")+'">'+(n.isFile?"File":"Folder")+"</td></tr><tr><td>"+wJe(t,"Size")+'</td><td><span class="'+RYe+'" title ="'+n.size+'">'+n.size+"</span></td></tr><tr><td>"+wJe(t,"Location")+'</td><td class="'+RYe+'" title="'+n.location+'">'+n.location+"</td></tr><tr><td>"+wJe(t,"Modified")+'</td><td class="'+RYe+'" >'+r+"</td></tr>"+o+"</table>",a.buttons=[{buttonModel:{isPrimary:!0,content:wJe(t,"Button-Ok")},click:function(){t.dialogObj.hide()}}];break;case"MultipleFileDetails":a.dialogName="File Details",void 0===(r=t.itemData.map(function(e){return 0!==(s=e.name.indexOf(".")+1)||e.isFile?0!==s?e.name.substr(s).replace(" ",""):"undetermined":"Folder"}))[0]&&(r=n.name.split(",").map(function(e){return 0===(s=e.indexOf(".")+1)?"Folder":e.substr(s).replace(" ","")})),o=r.every(function(e,t,i){return e===i[0]})?"Folder"===r[0]?"Folder":r[0].toLocaleUpperCase()+" Type":"Multiple Types",r=n.location,a.header=n.name,a.content="<table><tr><td>"+wJe(t,"Type")+':</td><td class="'+RYe+'">'+o+"</td></tr><tr><td>"+wJe(t,"Size")+":</td><td>"+n.size+'<span class="'+RYe+'" title ="'+n.size+'"></span></td></tr><tr><td>'+wJe(t,"Location")+':</td><td class="'+RYe+'" title="'+r+'">'+r+"</td></tr></table>",a.buttons=[{buttonModel:{isPrimary:!0,content:wJe(t,"Button-Ok")},click:function(e){"keydown"!==e.type&&t.dialogObj.hide()}}];break;case"Error":t.notify($Ye,{}),a.dialogName="Error","401"===i.error.code?a.header='<span class="e-fe-icon e-fe-access-error"></span><div class="e-fe-access-header">'+wJe(t,"Access-Denied")+"</div>":a.header=wJe(t,"Error"),a.content='<div class="'+DYe+'">'+i.error.message+"</div>",a.buttons=[{buttonModel:{isPrimary:!0,content:wJe(t,"Button-Ok")},click:function(){t.dialogObj.hide()}}]}return a}(t,e,i,n);je(t.dialogObj)?(t.dialogObj=new pS({beforeOpen:XZe.bind(this,t,o.dialogName),beforeClose:function(e){WZe(t,t.dialogObj,e,o.dialogName)},header:o.header,content:o.content,buttons:o.buttons,animationSettings:{effect:"None"},showCloseIcon:!0,closeOnEscape:!0,visible:!0,allowDragging:!0,isModal:!0,target:t.popupTarget||"#"+t.element.id,cssClass:CJe(t,t.isMobile?AGe:CGe),width:"350px",open:o.open,close:o.close,enableRtl:t.enableRtl,enableHtmlSanitizer:t.enableHtmlSanitizer,locale:t.locale}),t.dialogObj.isStringTemplate=!0,t.dialogObj.appendTo("#"+t.element.id+hGe)):function(t,i){t.dialogObj.header=i.header,t.dialogObj.content=i.content,t.dialogObj.buttons=i.buttons,t.dialogObj.enableRtl=t.enableRtl,t.dialogObj.open=i.open,t.dialogObj.close=i.close,t.dialogObj.beforeOpen=XZe.bind(this,t,i.dialogName),t.dialogObj.beforeClose=function(e){WZe(t,t.dialogObj,e,i.dialogName)},t.dialogObj.dataBind(),t.dialogObj.show()}(t,o)}function zZe(t,e,i,n){var o=function(n,e,o,t){var r,i,s,a={header:"",content:"",buttons:[],dialogName:"",open:function(){QZe(n,n.extDialogObj,a.dialogName)},close:function(){UZe(n,n.extDialogObj,a.dialogName)}};switch(e){case"Extension":a.header=wJe(n,"Header-Rename-Confirmation"),a.content="<div>"+wJe(n,"Content-Rename-Confirmation")+"</div>",a.buttons=[{buttonModel:{isPrimary:!0,content:wJe(n,"Button-Yes")},click:function(){n.extDialogObj.hide(),dZe(n,t,n.renameText)}},{buttonModel:{content:wJe(n,"Button-No")},click:function(){n.extDialogObj.hide(),n.dialogObj.hide()}}],a.dialogName="Extension Change";break;case"DuplicateItems":a.dialogName="Duplicate Items",n.replaceItems=o,i=n.replaceItems[n.fileLength],i=-1===(s=i.lastIndexOf("/"))?i:i.substring(s),a.header=wJe(n,"Header-Duplicate"),r="<div>"+wJe(n,"Content-Duplicate")+"</div>",a.content=r.replace("{0}",i),a.close=function(){var e;n.isDropEnd||0!==n.duplicateItems.length||(e={fileDetails:n.droppedObjects},n.trigger("fileDropped",e),n.isDropEnd=n.isDragDrop=!1),UZe(n,n.extDialogObj,a.dialogName)},a.buttons=[{buttonModel:{isPrimary:!0,content:wJe(n,"Button-Yes")},click:function(){var e,t,i;n.duplicateItems.push(n.replaceItems[n.fileLength]),n.duplicateRecords.push(FJe(n,n.replaceItems[n.fileLength])),n.fileLength++,o[n.fileLength]?(t=-1===(e=(t=n.replaceItems[n.fileLength]).lastIndexOf("/"))?t:t.substring(e),n.extDialogObj.content=r.replace("{0}",t),n.extDialogObj.show()):(n.extDialogObj.hide(),e=n.isDragDrop?n.dragPath:n.targetPath,t=n.isDragDrop?n.dropPath:""===n.folderPath?n.path:n.folderPath,i=n.isDragDrop?"move":n.fileAction,pZe(n,e,n.duplicateItems,t,i,n.duplicateItems,n.duplicateRecords))}},{buttonModel:{content:wJe(n,"Button-No")},click:function(){var e,t,i;n.fileLength++,o[n.fileLength]?(t=-1===(e=(t=n.replaceItems[n.fileLength]).lastIndexOf("/"))?t:t.substring(e),n.extDialogObj.content=r.replace("{0}",t),n.extDialogObj.show()):(n.extDialogObj.hide(),0!==n.duplicateItems.length&&(e=n.isDragDrop?"move":n.fileAction,t=n.isDragDrop?n.dragPath:n.targetPath,i=n.isDragDrop?n.dropPath:""===n.folderPath?n.path:n.folderPath,pZe(n,t,n.duplicateItems,i,e,n.duplicateItems,n.duplicateRecords)))}}];break;case"UploadRetry":a.dialogName="Retry Upload",a.header=wJe(n,"Header-Retry"),a.content=n.retryFiles[0].name+'<div class="e-fe-retrycontent">'+wJe(n,"Content-Retry")+"</div>",a.open=function(t,e){t.isRetryOpened=!0;var e=ge(".e-dlg-content",R("element",e)),i=t.createElement("div",{className:"e-dlg-checkbox"}),n=t.createElement("input",{id:t.element.id+"_applyall"});i.appendChild(n),e.appendChild(i),new ib({label:wJe(t,"ApplyAll-Label"),change:function(e){t.isApplySame=e.checked}}).appendTo("#"+t.element.id+"_applyall"),QZe(t,t.extDialogObj,"Retry Upload")}.bind(this,n),a.close=function(){n.isRetryOpened=!1,GZe(n),UZe(n,n.extDialogObj,a.dialogName)},a.buttons=[{buttonModel:{isPrimary:!0,content:wJe(n,"Button-Keep-Both")},click:function(){qZe(n,!0)}},{buttonModel:{isPrimary:!0,content:wJe(n,"Button-Replace")},click:function(){qZe(n,!1)}},{buttonModel:{isPrimary:!0,content:wJe(n,"Button-Skip")},click:function(){var e=0;n.isApplySame?(e=n.retryFiles.length,n.retryFiles=[],GZe(n)):(n.retryFiles.splice(0,e=1),0!==n.retryFiles.length?zZe(n,"UploadRetry"):GZe(n)),n.notify(KYe,{count:e})}}]}return a}(t,e,i,n);t.isApplySame=!1,je(t.extDialogObj)?(t.extDialogObj=new pS({beforeOpen:KZe.bind(this,t,o.dialogName),beforeClose:function(e){WZe(t,t.extDialogObj,e,o.dialogName)},content:o.content,header:o.header,closeOnEscape:!0,allowDragging:!0,animationSettings:{effect:"None"},target:t.popupTarget||"#"+t.element.id,cssClass:CJe(t,t.isMobile?AGe:CGe),enableRtl:t.enableRtl,showCloseIcon:!0,isModal:!0,width:350,buttons:o.buttons,open:o.open,close:o.close,enableHtmlSanitizer:t.enableHtmlSanitizer,locale:t.locale}),t.extDialogObj.isStringTemplate=!0,t.extDialogObj.appendTo("#"+t.element.id+pGe)):(t.extDialogObj.header=o.header,t.extDialogObj.close=o.close,t.extDialogObj.open=o.open,t.extDialogObj.close=o.close,t.extDialogObj.content=o.content,t.extDialogObj.buttons=o.buttons,t.extDialogObj.enableRtl=t.enableRtl,t.extDialogObj.locale=t.locale,t.extDialogObj.beforeOpen=KZe.bind(this,t,o.dialogName),t.extDialogObj.beforeClose=function(e){WZe(t,t.extDialogObj,e,o.dialogName)},t.extDialogObj.dataBind(),t.extDialogObj.show())}function jZe(e,t,i,n){n={cancel:i.cancel,popupName:n,popupModule:t};e.trigger("beforePopupOpen",n,function(e){i.cancel=e.cancel})}function WZe(t,e,i,n){e={cancel:i.cancel,popupModule:e,popupName:n};t.trigger("beforePopupClose",e,function(e){i.cancel=e.cancel,i.cancel||!i.isInteracted||"Rename"!==n&&"Create Folder"!==n||t.trigger($Ye,{})})}function QZe(e,t,i){t={popupModule:t,element:t.element,popupName:i};e.trigger("popupOpen",t)}function UZe(e,t,i){t={popupModule:t,element:t.element,popupName:i};e.trigger("popupClose",t)}function qZe(e,t){if(e.isApplySame){if(t)for(var i=e;0!==i.retryFiles.length;)i.retryArgs.push({action:"keepboth",file:i.retryFiles[0]}),i.uploadObj.retry(i.retryFiles[0]),i.retryFiles.splice(0,1);else for(var n=e;0!==n.retryFiles.length;)n.retryArgs.push({action:"replace",file:n.retryFiles[0]}),n.uploadObj.retry(n.retryFiles[0]),n.retryFiles.splice(0,1);GZe(e)}else e.retryArgs.push({action:t?"keepboth":"replace",file:e.retryFiles[0]}),e.uploadObj.retry(e.retryFiles[0]),e.retryFiles.splice(0,1),0!==e.retryFiles.length?zZe(e,"UploadRetry"):GZe(e)}function GZe(e){var t=!0,i=(e.isRetryOpened?e.isRetryOpened=!1:t=!1,ge(".e-dlg-checkbox",e.extDialogObj.element));i&&ue(i),t?e.extDialogObj.hide():e.retryFiles=[]}function YZe(e,t){HF.createInput({element:e,properties:{placeholder:t}})}function XZe(e,t,i){JZe(ct(".e-btn",e.dialogObj.element)),jZe(e,e.dialogObj,i,t)}function KZe(e,t,i){JZe(ct(".e-btn",e.extDialogObj.element)),jZe(e,e.extDialogObj,i,t)}function JZe(i){for(var e=0;e<i.length;e++)!function(t){i[t].onkeydown=function(e){13===e.keyCode&&e.preventDefault()},i[t].onkeyup=function(e){13===e.keyCode&&i[t].click()}}(e)}function ZZe(e){var t=ge("#newname",e.dialogObj.element);t$e(e,t),""===t.parentElement.nextElementSibling.innerHTML&&lZe(e,t.value)}function $Ze(e){var t,i,n,o=ge("#rename",e.dialogObj.element);t$e(e,o),""===o.parentElement.nextElementSibling.innerHTML&&(o=o.value,t=e.currentItemText.lastIndexOf("."),e.isFile&&!e.showFileExtension&&(o+=-1===t?"":e.currentItemText.substr(t)),e.renameText=o,e.currentItemText===o?e.dialogObj.hide():(n="",n="navigationpane"===e.activeModule?rZe(e,e.itemData[0]):e.path,e.renamedId=R("id",e.itemData[0]),e.isFile&&(t=-1===t?"":e.currentItemText.substr(t),i=-1===(i=o.lastIndexOf("."))?"":o.substr(i),e.showFileExtension)&&t!==i?zZe(e,"Extension",null,n):dZe(e,n,o)))}function e$e(e,t){/[/\\|*?"<>:]/.test(t.value)?i$e(e,t):""===t.value?t.parentElement.nextElementSibling.innerHTML=wJe(e,"Validation-Empty"):t.parentElement.nextElementSibling.innerHTML=""}function t$e(e,t){e$e(e,t);var i=t.value.length-1;""===t.value||t.value.lastIndexOf(".")!==i&&t.value.lastIndexOf(" ")!==i||!e.showFileExtension&&-1!==t.value.lastIndexOf(".")&&0!==t.value.substring(t.value.indexOf(".")+1).length||i$e(e,t)}function i$e(e,t){var i=wJe(e,"Validation-Invalid").replace("{0}",'"'+t.value+'"');e.enableHtmlSanitizer?t.parentElement.nextElementSibling.textContent=i:t.parentElement.nextElementSibling.innerHTML=i}function n$e(e){e=e.keyCode||e.which||e.charCode;return e}function o$e(t,e,i){var n=Q("div",{className:"e-image-wrap"}),i=Q("img",{className:"e-image",attrs:{src:i,alt:e}});n.appendChild(i),je(t.viewerObj)?(t.viewerObj=new pS({header:e,content:n,animationSettings:{effect:"None"},showCloseIcon:!0,closeOnEscape:!0,visible:!0,isModal:!0,width:"350px",height:"350px",target:t.popupTarget||"#"+t.element.id,cssClass:CJe(t,t.isMobile?AGe:CGe),locale:t.locale,enableResize:!0,allowDragging:!0,enableHtmlSanitizer:t.enableHtmlSanitizer,position:{X:"center",Y:"center"},enableRtl:t.enableRtl,open:function(e){setTimeout(function(){e.viewerObj&&e.viewerObj.element.focus()}),r$e(e),QZe(e,e.viewerObj,"Image Preview")}.bind(this,t),close:function(){UZe(t,t.viewerObj,"Image Preview")},beforeOpen:function(e){jZe(t,t.viewerObj,e,"Image Preview")},beforeClose:function(e){WZe(t,t.viewerObj,e,"Image Preview")},resizing:r$e.bind(this,t),resizeStop:r$e.bind(this,t)}),t.viewerObj.isStringTemplate=!0,t.viewerObj.appendTo("#"+t.element.id+dGe)):(t.viewerObj.refresh(),t.viewerObj.header=e,t.viewerObj.content=n,t.viewerObj.enableRtl=t.enableRtl,t.viewerObj.dataBind(),t.viewerObj.show())}function r$e(e){var t=ge(".e-dlg-content",e.viewerObj.element),e=ge(".e-image-wrap",e.viewerObj.element),i=window.getComputedStyle(t,null),n=i?2*parseFloat(i.paddingRight):36,i=i?2*parseFloat(i.paddingBottom):20;e.style.width=t.offsetWidth-n+"px",e.style.height=t.offsetHeight-i+"px"}a$e.prototype.render=function(e){if(this.parent.visitedItem=null,this.startItem=null,kA(this.parent.element),"LargeIcons"===this.parent.view){this.resetMultiSelect(),this.element.setAttribute("tabindex","0"),this.listObj&&(this.unWireEvents(),this.removeEventListener()),this.parent.notify(SXe,{});var t=ge("#"+this.parent.element.id+lGe,this.parent.element),i=ge("ul",t),n=(i&&ue(i),this.listObj={ariaAttributes:{itemRole:"option",listRole:"listbox",itemText:"",groupItemRole:"group",wrapperRole:""},showIcon:!0,fields:{text:"name",iconCss:"_fm_icon",imageUrl:"_fm_imageUrl",htmlAttributes:"_fm_htmlAttr"},sortOrder:this.parent.sortOrder,itemCreated:this.onItemCreated.bind(this),enableHtmlSanitizer:this.parent.enableHtmlSanitizer},this.items=[],this.items=this.renderList(e),this.parent.sortComparer&&"None"!==this.parent.sortBy?this.items=this.allItems=Sa.sort(this.items,this.parent.sortBy,this.comparer.bind(this)):this.items=this.allItems=gJe(this.parent,this.items),t.classList.remove(kYe),this.parent.enableVirtualization&&0<this.allItems.length&&!je(this.parent.virtualizationModule)&&this.parent.virtualizationModule.setUIVirtualization(),this.listElements=X_.createListFromJson(Q,this.items,this.listObj),this.itemList=Array.prototype.slice.call(ct("."+kGe,this.listElements)),this.element.appendChild(this.listElements),this.listElements.setAttribute("aria-label","listbox"),this.preventImgDrag(),this.createDragObj(),0===this.itemList.length?(i=this.element.querySelector("."+BGe),this.element.removeChild(i),fJe(this.parent,this.element,e)):0!==this.itemList.length&&this.element.querySelector("."+QGe)&&this.element.removeChild(this.element.querySelector("."+QGe)),!0===this.isPasteOperation&&(this.selectItems(this.parent.pasteNodes),this.isPasteOperation=!1),!0===this.uploadOperation&&(this.selectItems(this.parent.uploadItem),this.parent.setProperties({selectedItems:[]},!0),this.count++,this.count===this.parent.uploadItem.length)&&(this.uploadOperation=!1,this.parent.uploadItem=[]),this.element.querySelectorAll("."+OGe));0!==n.length&&(this.parent.activeModule="largeiconsview");for(var o=0;o<n.length;o++)n[o].setAttribute("aria-selected","true");this.element.style.maxHeight="100%",this.getItemCount(),this.addEventListener(),this.wireEvents(),this.parent.enableVirtualization&&0<this.allItems.length&&!je(this.parent.virtualizationModule)&&(this.parent.virtualizationModule.setUlElementHeight(),this.parent.virtualizationModule.wireScrollEvent(!1)),this.isRendered=!0,BA(this.parent.element),this.parent.selectedItems.length&&this.checkItem()}},a$e.prototype.comparer=function(e,t){var i;return"Descending"===this.parent.sortOrder&&(i=e,e=t,t=i),this.parent.sortComparer(e,t)},a$e.prototype.preventImgDrag=function(){for(var e=0;e<this.itemList.length;)this.itemList[e].querySelector("img")&&(this.itemList[e].ondragstart=function(){return!1}),e++},a$e.prototype.createDragObj=function(){var t=this;this.listObj&&(this.parent.allowDragAndDrop?(this.dragObj&&this.dragObj.destroy(),this.dragObj=new hn(this.listElements,{enableTailMode:!0,distance:5,enableAutoScroll:!1,dragTarget:"."+eYe,helper:this.dragHelper.bind(this),cursorAt:this.parent.dragCursorPosition,dragArea:this.parent.element,dragStop:RJe.bind(this,this.parent),drag:zJe.bind(this,this.parent),clone:!0,dragStart:function(e){OJe(t.parent,e,t.dragObj)}})):this.dragObj&&!this.parent.allowDragAndDrop&&this.dragObj.destroy())},a$e.prototype.dragHelper=function(e){e=z(e.sender.target,".e-list-item");if(!e)return null;e&&!e.classList.contains("e-active")&&this.setFocus(e);var t=this.element.querySelectorAll("."+OGe);this.parent.activeElements=[],this.parent.dragData=[];for(var i=0;i<t.length;i++)this.parent.dragData.push(this.getItemObject(t[parseInt(i.toString(),10)])),this.parent.activeElements.push(t[i]);return eJe(this.parent,e),this.parent.dragPath=this.parent.path,LJe(this.parent),this.parent.virtualDragElement},a$e.prototype.onDropInit=function(e){var t;this.parent.targetModule===this.getModuleName()&&(e=z(e.target,".e-list-item"),t=R(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent),e?(e=this.getItemObject(e),this.parent.dropPath=e.isFile?this.parent.path:cJe(this.parent,e,this.parent.path),this.parent.dropData=e.isFile?t:e):(this.parent.dropPath=this.parent.path,this.parent.dropData=t))},a$e.prototype.getModuleName=function(){return"largeiconsview"},a$e.prototype.onItemCreated=function(e){e.item.removeAttribute("aria-level"),!this.parent.showFileExtension&&R("isFile",e.curData)&&(n=e.item.querySelector("."+PGe),t=R("name",e.curData),i=R("type",e.curData),-1!==t.indexOf(i))&&(n.innerHTML=t.substr(0,t.length-i.length)),this.renderCheckbox(e);var t,i,n={element:e.item,fileDetails:e.curData,module:"LargeIconsView"};this.parent.trigger("fileLoad",n)},a$e.prototype.renderCheckbox=function(e){var t;this.parent.showItemCheckBoxes&&((t=kv(Q,!1,{checked:!1,cssClass:"e-small"})).setAttribute("role","checkbox"),t.setAttribute("aria-checked","false"),t.setAttribute("aria-label","checkbox"),e.item.firstElementChild.insertBefore(t,e.item.firstElementChild.childNodes[0]))},a$e.prototype.onLayoutChange=function(e){if("LargeIcons"===this.parent.view){if(this.destroy(),this.parent.enableVirtualization&&this.parent.setProperties({selectedItems:[]},!0),this.render(e),"layout-change"===R("name",e)&&"move"===this.parent.fileAction&&this.parent.isCut&&this.parent.selectedNodes&&0!==this.parent.selectedNodes.length)for(var t=this.getIndexes(this.parent.selectedNodes),i=0;i<t.length;)ZKe(this.itemList[t[i]]),i++;0!==this.element.querySelectorAll("."+OGe).length&&this.element.focus(),this.checkItem(),this.parent.isLayoutChange=!1}else this.element.setAttribute("tabindex","-1")},a$e.prototype.checkItem=function(){var e=this.element.querySelectorAll("."+OGe);if(e)for(var t=0;t<e.length;)this.checkState(e[t],!0),t++},a$e.prototype.renderList=function(e){for(var t=0,i=JSON.parse(JSON.stringify(e.files));t<i.length;){var n=dJe(i[t]),o=R("name",i[t]),r=WJe(this.parent,i[t]),r=this.parent.selectedItems&&-1!==this.parent.selectedItems.indexOf(r)?eYe+" e-active":eYe;ZJe(i[t])||(r+=" "+KJe(i[t])),n===JGe&&this.parent.showThumbnail&&JJe(i[t])?(x("_fm_imageUrl",pJe(this.parent,i[t]),i[t]),x("_fm_imageAttr",{alt:o},i[t])):x("_fm_icon",n,i[t]),x("_fm_htmlAttr",{class:r,title:o},i[t]),t++}return i},a$e.prototype.onFinalizeEnd=function(e){this.render(e)},a$e.prototype.onCreateEnd=function(e){"LargeIcons"===this.parent.view&&(this.onLayoutChange(e),this.clearSelect(),this.selectItems([R(this.parent.hasId?"id":"name",this.parent.createdItem)]),this.parent.createdItem=null,this.parent.largeiconsviewModule.element.focus(),this.parent.activeModule="largeiconsview")},a$e.prototype.onSelectedData=function(){"largeiconsview"===this.parent.activeModule&&this.updateSelectedData()},a$e.prototype.onDeleteInit=function(){"largeiconsview"===this.parent.activeModule&&cZe(this.parent,this.parent.selectedItems,this.parent.path,"delete")},a$e.prototype.onDeleteEnd=function(e){"LargeIcons"===this.parent.view&&(this.onLayoutChange(e),this.parent.setProperties({selectedItems:[]},!0),this.clearSelect())},a$e.prototype.onRefreshEnd=function(e){"LargeIcons"===this.parent.view&&this.onLayoutChange(e)},a$e.prototype.onRenameInit=function(){"largeiconsview"===this.parent.activeModule&&1===this.parent.selectedItems.length&&this.updateRenameData()},a$e.prototype.onPathChanged=function(e){this.parent.isCut=!1,""===this.parent.breadcrumbbarModule.searchObj.element.value&&(this.parent.searchedItems=[]),"LargeIcons"===this.parent.view&&($Ke(this.parent),this.parent.setProperties({selectedItems:[]},!0),this.onLayoutChange(e),this.parent.renamedItem)&&"largeiconsview"===this.parent.activeModule&&(this.clearSelect(),this.addSelection(this.parent.renamedItem))},a$e.prototype.onOpenInit=function(e){"largeiconsview"===this.parent.activeModule&&this.doOpenAction(e.target)},a$e.prototype.onHideLayout=function(){"LargeIcons"!==this.parent.view&&this.element&&this.element.classList.add(kYe)},a$e.prototype.onSelectAllInit=function(){var e;"LargeIcons"===this.parent.view&&(this.startItem=this.getFirstItem(),e=this.getLastItem(),this.doSelection(e,{ctrlKey:!0,shiftKey:!0}),this.isInteraction=!0,this.isInteracted=!0)},a$e.prototype.onClearAllInit=function(){"LargeIcons"===this.parent.view&&(this.clearSelection(),this.isInteraction=!0,this.isInteracted=!0)},a$e.prototype.onBeforeRequest=function(){this.isRendered=!1},a$e.prototype.onAfterRequest=function(){this.isRendered=!0},a$e.prototype.onSearch=function(e){"LargeIcons"===this.parent.view&&(this.parent.setProperties({selectedItems:[]},!0),this.parent.notify(nXe,{}),this.parent.searchedItems=e.files,this.onLayoutChange(e))},a$e.prototype.onLayoutRefresh=function(){this.parent.view},a$e.prototype.onUpdateSelectionData=function(){"LargeIcons"===this.parent.view&&this.updateSelectedData()},a$e.prototype.onPathColumn=function(){"LargeIcons"!==this.parent.view||je(this.listObj)||""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered||"filterPath"!==this.parent.sortBy||(this.parent.sortBy="name",this.parent.notify(lXe,{}))},a$e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(IXe,this.onPathColumn),this.parent.off(VYe,this.onFinalizeEnd),this.parent.off(_Ye,this.onCreateEnd),this.parent.off(yXe,this.onSelectedData),this.parent.off(jYe,this.onDeleteInit),this.parent.off(WYe,this.onDeleteEnd),this.parent.off(QYe,this.onRefreshEnd),this.parent.off(GYe,this.onPathChanged),this.parent.off(aXe,this.onLayoutChange),this.parent.off(eXe,this.onSearch),this.parent.off(tXe,this.onOpenInit),this.parent.off(iXe,this.onPathChanged),this.parent.off(OYe,this.onPropertyChanged),this.parent.off(FXe,this.onMethodCall),this.parent.off($Ye,this.onActionFailure),this.parent.off(cXe,this.onRenameInit),this.parent.off(gXe,this.onPathChanged),this.parent.off(SXe,this.onHideLayout),this.parent.off(oXe,this.onSelectAllInit),this.parent.off(rXe,this.onClearAllInit),this.parent.off(pXe,this.onMenuItemData),this.parent.off(XYe,this.onBeforeRequest),this.parent.off(JYe,this.onAfterRequest),this.parent.off(qYe,this.splitterResizeHandler),this.parent.off(UYe,this.resizeHandler),this.parent.off(bXe,this.onpasteInit),this.parent.off(wXe,this.onpasteEnd),this.parent.off(vXe,this.oncutCopyInit),this.parent.off(DXe,this.onDropInit),this.parent.off(dXe,this.onDetailsInit),this.parent.off(ZYe,this.onLayoutRefresh),this.parent.off(kXe,this.onDropPath),this.parent.off(BXe,this.onUpdateSelectionData),this.parent.off(HYe,this.onPathChanged))},a$e.prototype.addEventListener=function(){this.parent.on(IXe,this.onPathColumn,this),this.parent.on(VYe,this.onFinalizeEnd,this),this.parent.on(_Ye,this.onCreateEnd,this),this.parent.on(QYe,this.onRefreshEnd,this),this.parent.on(yXe,this.onSelectedData,this),this.parent.on(GYe,this.onPathChanged,this),this.parent.on(jYe,this.onDeleteInit,this),this.parent.on(bXe,this.onpasteInit,this),this.parent.on(WYe,this.onDeleteEnd,this),this.parent.on(aXe,this.onLayoutChange,this),this.parent.on(eXe,this.onSearch,this),this.parent.on(tXe,this.onOpenInit,this),this.parent.on(cXe,this.onRenameInit,this),this.parent.on(gXe,this.onPathChanged,this),this.parent.on(iXe,this.onPathChanged,this),this.parent.on(OYe,this.onPropertyChanged,this),this.parent.on(FXe,this.onMethodCall,this),this.parent.on($Ye,this.onActionFailure,this),this.parent.on(SXe,this.onHideLayout,this),this.parent.on(oXe,this.onSelectAllInit,this),this.parent.on(rXe,this.onClearAllInit,this),this.parent.on(pXe,this.onMenuItemData,this),this.parent.on(XYe,this.onBeforeRequest,this),this.parent.on(JYe,this.onAfterRequest,this),this.parent.on(DXe,this.onDropInit,this),this.parent.on(dXe,this.onDetailsInit,this),this.parent.on(qYe,this.splitterResizeHandler,this),this.parent.on(UYe,this.resizeHandler,this),this.parent.on(wXe,this.onpasteEnd,this),this.parent.on(vXe,this.oncutCopyInit,this),this.parent.on(ZYe,this.onLayoutRefresh,this),this.parent.on(kXe,this.onDropPath,this),this.parent.on(BXe,this.onUpdateSelectionData,this),this.parent.on(HYe,this.onPathChanged,this)},a$e.prototype.onActionFailure=function(){this.isInteraction=!0,this.isInteracted=!0},a$e.prototype.onMenuItemData=function(e){this.parent.activeModule===this.getModuleName()&&(e=z(e.target,"li"),this.parent.itemData=[this.getItemObject(e)])},a$e.prototype.onDetailsInit=function(){this.parent.activeModule===this.getModuleName()&&(0!==this.parent.selectedItems.length?this.updateSelectedData():this.parent.itemData=[R(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent)])},a$e.prototype.onpasteInit=function(){this.parent.activeModule===this.getModuleName()&&(this.parent.itemData=""===this.parent.folderPath?[aJe(this.parent)]:[this.getItemObject(ge(".e-active",this.element))])},a$e.prototype.oncutCopyInit=function(){if(this.parent.activeModule===this.getModuleName()){var e=this.element.querySelectorAll("."+OGe);this.parent.activeRecords=[],this.parent.activeElements=[];for(var t=0;t<e.length;t++)this.parent.activeElements.push(e[t]),this.parent.activeRecords.push(this.getItemObject(e[t]))}},a$e.prototype.onpasteEnd=function(e){"LargeIcons"===this.parent.view&&(this.isPasteOperation=!0,this.parent.path!==this.parent.destinationPath&&this.parent.path!==kJe(this.parent,e)&&!this.parent.hasId||this.onPathChanged(e))},a$e.prototype.onDropPath=function(e){"LargeIcons"===this.parent.view&&(this.isPasteOperation=!0,this.onPathChanged(e))},a$e.prototype.onPropertyChanged=function(e){var t;if(e.module===this.getModuleName()||"common"===e.module)for(var i=0,n=Object.keys(e.newProp);i<n.length;i++)switch(n[i]){case"allowDragAndDrop":this.createDragObj();break;case"selectedItems":this.isInteraction=!1,this.isInteracted=!1,t=je(this.parent.selectedItems)?[]:this.parent.selectedItems.slice(0),t=this.parent.allowMultiSelection?t:t.slice(t.length-1),this.parent.setProperties({selectedItems:[]},!0),this.onClearAllInit(),t.length&&this.selectItems(t),this.parent.setProperties({selectedItems:this.parent.selectedItems},!0),this.isInteraction=!0,this.isInteracted=!0;break;case"showThumbnail":rJe(this.parent);break;case"showFileExtension":case"showHiddenItems":aZe(this.parent,GYe,this.parent.path);break;case"allowMultiSelection":case"showItemCheckBoxes":"LargeIcons"===this.parent.view&&rJe(this.parent);break;case"view":nJe(this.parent,"LargeIcons")}},a$e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.listObj&&this.unWireEvents(),this.startItem=null,this.listElements=null)},a$e.prototype.wireEvents=function(){this.wireClickEvent(!0),this.keyboardModule=new bn(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keyup"}),this.keyboardDownModule=new bn(this.element,{keyAction:this.keydownActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),E.add(this.element,"mouseover",this.onMouseOver,this)},a$e.prototype.unWireEvents=function(){this.wireClickEvent(!1),E.remove(this.element,"mouseover",this.onMouseOver),this.keyboardModule.destroy(),this.keyboardDownModule.destroy()},a$e.prototype.onMouseOver=function(e){e=z(e.target,".e-list-item");$Ke(this.parent,"hover"),null!==e&&e.classList.add(NGe)},a$e.prototype.wireClickEvent=function(e){var t=this;e?this.clickObj=new Mn(this.element,{tap:function(e){t.parent.isDevice?(t.tapCount=e.tapCount,t.tapEvent=e,setTimeout(function(){0<t.tapCount&&t.doTapAction(t.tapEvent),t.tapCount=0},350)):2===e.tapCount&&3!==e.originalEvent.which?t.dblClickHandler(e):t.clickHandler(e)},tapHold:function(e){t.parent.isDevice&&(t.multiSelect=!!t.parent.allowMultiSelection,t.parent.allowMultiSelection&&U([t.parent.element],xGe),t.clickHandler(e))}}):this.clickObj&&this.clickObj.destroy()},a$e.prototype.doTapAction=function(e){var t=e.originalEvent.target,i=z(t,"."+kGe);this.multiSelect||t.classList.contains(BGe)||je(i)?this.clickHandler(e):(this.parent.isFile=!1,this.updateType(i),this.parent.isFile?2===e.tapCount?(this.clickHandler(e),this.dblClickHandler(e)):this.clickHandler(e):this.dblClickHandler(e))},a$e.prototype.clickHandler=function(e){var t=e.originalEvent.target;$Ke(this.parent,"hover"),this.doSelection(t,e.originalEvent),this.parent.activeModule="largeiconsview"},a$e.prototype.doSelection=function(e,t){var i=this.parent.isMac?t.metaKey:t.ctrlKey,n=this.parent.isMac&&t.ctrlKey&&t.shiftKey,o=z(e,"."+kGe),r=e.classList,s=(this.parent.isFile=!1,"select");if(3!==t.which&&!n||je(o)||!o.classList.contains(OGe)){if(je(o))this.parent.selectedItems.length===this.itemList.length&&(this.isSelectAllCalled=!0),this.clearSelection();else if(this.parent.allowMultiSelection&&o.classList.contains(OGe)&&(i||e.classList.contains(HGe))&&(s="unselect"),i&&t.shiftKey&&!n&&(this.isSelectAllCalled=!0),!0!==this.triggerSelection(s,o).cancel){if(this.parent.allowMultiSelection&&(this.multiSelect||!t||i)||r.contains(zGe)||(this.updateType(o),this.clearSelect()),this.parent.allowMultiSelection&&t.shiftKey&&!n){t&&i||this.clearSelect(),this.startItem||(this.startItem=o);var e=this.itemList.indexOf(this.startItem),a=this.itemList.indexOf(o);if(a<e)for(var l=e;a<=l;l--)this.addActive(this.itemList[l]);else for(l=e;l<=a;l++)this.addActive(this.itemList[l]);this.addFocus(this.itemList[a])}else this.startItem=o,this.parent.allowMultiSelection&&o.classList.contains(OGe)?this.removeActive(o):this.addActive(o),this.addFocus(o);0===this.parent.selectedItems.length&&this.resetMultiSelect(),this.parent.notify(nXe,{}),this.triggerSelect(s,o)}je(o)||(this.isSelectAllCalled=!1,this.updateType(o))}else this.addActive(o),this.updateType(o)},a$e.prototype.dblClickHandler=function(e){this.parent.activeModule="largeiconsview";e=e.originalEvent.target;this.doOpenAction(e)},a$e.prototype.clearSelection=function(){this.clearSelect(),this.resetMultiSelect(),this.parent.notify(nXe,{})},a$e.prototype.resetMultiSelect=function(){this.multiSelect=!1,q([this.parent.element],xGe)},a$e.prototype.doOpenAction=function(e){var i,n=this;je(e)||(e=z(e,"."+kGe),this.parent.isFile=!1,je(e))||(this.updateType(e),JJe(i=this.getItemObject(e))?this.parent.trigger("fileOpen",{cancel:!1,fileDetails:i,module:"LargeIconsView"},function(e){var t;e.cancel||(e=R("name",i),n.parent.isFile?dJe(i)===JGe&&(t=pJe(n.parent,i),o$e(n.parent,e,t)):(""!==n.parent.breadcrumbbarModule.searchObj.element.value||n.parent.isFiltered?IJe(n.parent,i):(t=R("id",i),n.parent.oldPath=n.parent.path,t=n.parent.path+(je(t)?e:t)+"/",n.parent.setProperties({path:t},!0),n.parent.pathNames.push(e),n.parent.pathId.push(R("_fm_id",i)),n.parent.itemData=[i],sJe(n.parent)),n.parent.isFiltered=!1,n.parent.setProperties({selectedItems:[]},!0)))}):XJe(this.parent,i,LXe))},a$e.prototype.updateType=function(e){e=ge("."+KGe,e);this.parent.isFile=!!je(e)},a$e.prototype.keydownActionHandler=function(e){if(this.isRendered)switch(e.action){case"end":case"home":case"moveDown":case"moveLeft":case"moveRight":case"moveUp":case"ctrlEnd":case"shiftEnd":case"csEnd":case"ctrlHome":case"shiftHome":case"csHome":case"ctrlDown":case"shiftDown":case"csDown":case"ctrlLeft":case"shiftLeft":case"csLeft":case"ctrlRight":case"shiftRight":case"csRight":case"space":case"ctrlSpace":case"shiftSpace":case"csSpace":case"ctrlA":case"enter":case"altEnter":case"esc":case"del":case"shiftdel":case"ctrlC":case"ctrlV":case"ctrlX":case"f2":case"ctrlD":e.preventDefault()}},a$e.prototype.keyActionHandler=function(e){var t=this;if(this.isRendered){var i=this.getFocusedItem(),n=this.getFirstItem(),o=this.getLastItem();switch(e.action){case"end":this.parent.enableVirtualization?(this.clearSelect(),this.element.firstElementChild.scrollTo(0,this.element.firstElementChild.scrollHeight),setTimeout(function(){t.navigateItem(t.itemList[t.itemList.length-1])},10)):this.navigateItem(o);break;case"home":this.parent.enableVirtualization?(this.clearSelect(),this.element.firstElementChild.scrollTop=0,setTimeout(function(){t.navigateItem(t.itemList[0])},10)):this.navigateItem(n);break;case"tab":je(i)?je(n)||this.addFocus(n):this.addFocus(i);break;case"moveDown":this.navigateDown(i,!0);break;case"moveLeft":this.navigateRight(i,!1);break;case"moveRight":this.navigateRight(i,!0);break;case"moveUp":this.navigateDown(i,!1);break;case"ctrlEnd":case"shiftEnd":case"csEnd":this.csEndKey(o,e);break;case"ctrlHome":case"shiftHome":case"csHome":this.csHomeKey(n,e);break;case"ctrlDown":case"shiftDown":case"csDown":this.csDownKey(i,e);break;case"ctrlLeft":case"shiftLeft":case"csLeft":this.csLeftKey(i,e);break;case"ctrlRight":case"shiftRight":case"csRight":this.csRightKey(i,e);break;case"ctrlUp":case"shiftUp":case"csUp":this.csUpKey(i,e);break;case"space":this.spaceKey(i);break;case"ctrlSpace":case"shiftSpace":case"csSpace":je(i)||this.doSelection(i,e);break;case"ctrlA":this.ctrlAKey(n,o);break;case"enter":this.doOpenAction(this.parent.visitedItem||this.getVisitedItem());break;case"altEnter":this.parent.notify(dXe,{}),uZe(this.parent,this.parent.selectedItems,this.parent.path,"details");break;case"esc":KKe(this.parent);break;case"del":case"shiftdel":this.performDelete();break;case"ctrlC":lJe(this.parent);break;case"ctrlV":this.parent.folderPath="",TJe(this.parent);break;case"ctrlX":hJe(this.parent);break;case"f2":this.performRename();break;case"ctrlD":this.doDownload();break;case"back":this.parent.traverseBackward()}}},a$e.prototype.doDownload=function(){this.updateSelectedData(),qJe(this.parent)},a$e.prototype.performDelete=function(){if(this.parent.selectedItems&&0<this.parent.selectedItems.length){this.updateSelectedData();for(var e=this.parent.itemData,t=0;t<e.length;t++)if(!ZJe(e[t]))return void XJe(this.parent,e[t],RXe);HZe(this.parent,"Delete")}},a$e.prototype.performRename=function(){1===this.parent.selectedItems.length&&(this.updateRenameData(),UJe(this.parent))},a$e.prototype.updateRenameData=function(){var e=ge("."+kGe+"."+OGe,this.element),e=this.getItemObject(e);QJe(this.parent,e)},a$e.prototype.getVisitedItem=function(){var e=this.parent.selectedItems[this.parent.selectedItems.length-1],e=this.getIndexes([e],this.parent.hasId);return this.itemList[e[0]]},a$e.prototype.getFocusedItem=function(){return ge("."+kGe+"."+VGe,this.element)},a$e.prototype.getActiveItem=function(){return ge("."+kGe+"."+OGe,this.element)},a$e.prototype.getFirstItem=function(){return this.itemList[0]},a$e.prototype.getLastItem=function(){return this.itemList[this.itemList.length-1]},a$e.prototype.navigateItem=function(e){this.setFocus(e)},a$e.prototype.navigateDown=function(e,t){e=this.getNextItem(e,t,this.perRow);this.setFocus(e)},a$e.prototype.navigateRight=function(e,t){e=this.getNextItem(e,t);this.setFocus(e)},a$e.prototype.getNextItem=function(e,t,i){if(je(e))return this.getFocusedItem()||this.getActiveItem()||this.getFirstItem();var n=this.itemList.indexOf(e);do{var o,n=t?i?n+i:n+1:i?n-i:n-1,r=this.itemList[n];if(this.parent.enableVirtualization&&je(r)&&(o=parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue("margin-top"),10)+parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue("margin-bottom"),10),o=this.itemList[0].getBoundingClientRect().height+o,this.element.firstElementChild.scrollTo(this.element.firstElementChild.scrollTop,this.element.firstElementChild.scrollTop+o)),je(r))return e}while(!at(r));return r},a$e.prototype.setFocus=function(e){je(e)||!0!==this.triggerSelection("select",e).cancel&&(this.startItem=e,this.clearSelect(),this.addActive(e),this.addFocus(e),this.parent.notify(nXe,{}),this.triggerSelect("select",e))},a$e.prototype.spaceKey=function(e){je(e)||e.classList.contains(OGe)||!0!==this.triggerSelection("select",e).cancel&&(this.addActive(e),this.parent.notify(nXe,{}),this.triggerSelect("select",e))},a$e.prototype.ctrlAKey=function(e,t){var i,n;this.parent.allowMultiSelection&&!je(e)&&(this.startItem=e,i=(e=this.element.querySelector("."+BGe)).scrollTop,n=this.getFocusedItem(),this.doSelection(t,{ctrlKey:!0,shiftKey:!0}),e.scrollTop=i,je(n)||this.addFocus(n))},a$e.prototype.csEndKey=function(e,t){this.parent.allowMultiSelection?je(e)||("ctrlEnd"===t.action?this.addFocus(e):this.doSelection(e,t)):this.navigateItem(e)},a$e.prototype.csHomeKey=function(e,t){this.parent.allowMultiSelection?je(e)||("ctrlHome"===t.action?this.addFocus(e):this.doSelection(e,t)):this.navigateItem(e)},a$e.prototype.csDownKey=function(e,t){var i;this.parent.allowMultiSelection?je(i=this.getNextItem(e,!0,this.perRow))||("ctrlDown"===t.action?this.addFocus(i):this.doSelection(i,t)):this.navigateDown(e,!0)},a$e.prototype.csLeftKey=function(e,t){var i;this.parent.allowMultiSelection?je(i=this.getNextItem(e,!1))||("ctrlLeft"===t.action?this.addFocus(i):this.doSelection(i,t)):this.navigateRight(e,!1)},a$e.prototype.csRightKey=function(e,t){var i;this.parent.allowMultiSelection?je(i=this.getNextItem(e,!0))||("ctrlRight"===t.action?this.addFocus(i):this.doSelection(i,t)):this.navigateRight(e,!0)},a$e.prototype.csUpKey=function(e,t){var i;this.parent.allowMultiSelection?je(i=this.getNextItem(e,!1,this.perRow))||("ctrlUp"===t.action?this.addFocus(i):this.doSelection(i,t)):this.navigateDown(e,!1)},a$e.prototype.addActive=function(e){je(e)||(e.classList.contains(OGe)||(this.parent.selectedItems.push(this.getDataName(e)),this.parent.setProperties({selectedItems:this.parent.selectedItems},!0),U([e],[OGe]),e.setAttribute("aria-selected","true"),this.checkState(e,!0)),this.parent.visitedItem=e)},a$e.prototype.removeActive=function(e){je(e)||(q([e],[OGe]),this.parent.allowMultiSelection?e.setAttribute("aria-selected","false"):e.removeAttribute("aria-selected"),this.checkState(e,!1),-1<(e=this.parent.selectedItems.indexOf(this.getDataName(e)))&&(this.parent.selectedItems.splice(e,1),this.parent.setProperties({selectedItems:this.parent.selectedItems},!0)),this.parent.visitedItem=null)},a$e.prototype.getDataName=function(e){e=this.getItemObject(e);return WJe(this.parent,e)},a$e.prototype.addFocus=function(e){this.element.setAttribute("tabindex","-1");var t=this.getFocusedItem();t&&(t.removeAttribute("tabindex"),q([t],[VGe])),U([e],[VGe]),e.setAttribute("tabindex","0"),e.focus()},a$e.prototype.checkState=function(e,t){!this.parent.showItemCheckBoxes||je(e=ge("."+zGe,e))||(t?e.classList.contains(HGe)||(U([e],HGe),z(e,"."+jGe).setAttribute("aria-checked","true")):e.classList.contains(HGe)&&(q([e],HGe),z(e,"."+jGe).setAttribute("aria-checked","false")))},a$e.prototype.clearSelect=function(){var e=Array.prototype.slice.call(ct("."+OGe,this.listElements));if(0!==e.length){if(!0!==this.triggerSelection("unselect",e[0]).cancel)for(var t=0,i=e.length;t<i;t++)this.removeActive(e[t]);this.triggerSelect("unselect",e[0])}},a$e.prototype.resizeHandler=function(){this.getItemCount()},a$e.prototype.splitterResizeHandler=function(){this.getItemCount()},a$e.prototype.getItemCount=function(){var e=1;if(this.itemList)for(var t=0,i=this.itemList.length-1;t<i&&this.itemList[t].getBoundingClientRect().top===this.itemList[t+1].getBoundingClientRect().top;t++)e++;this.perRow=e},a$e.prototype.triggerSelection=function(e,t){var i=[];if(this.isSelectAllCalled)for(var n=0,o=this.itemList.length;n<o;n++)i[n]=this.getItemObject(this.itemList[n]);else i[0]=this.getItemObject(t);e={action:e,fileDetails:1<i.length?i:i[0],isInteracted:this.isInteraction,cancel:!1,target:this.isSelectAllCalled?null:t};return this.parent.trigger("fileSelection",e),this.isInteraction=!0,e},a$e.prototype.triggerSelect=function(e,t){var i=[];if(this.isSelectAllCalled){for(var n=0,o=this.itemList.length;n<o;n++)i[n]=this.getItemObject(this.itemList[n]);this.isSelectAllCalled=!1}else i[0]=this.getItemObject(t);this.parent.visitedData=1<i.length?i[i.length-1]:i[0];t={action:e,fileDetails:1<i.length?i:i[0],isInteracted:this.isInteracted};this.parent.trigger("fileSelect",t),this.isInteracted=!0},a$e.prototype.selectItems=function(e){for(var t=this.getIndexes(e,this.parent.hasId),i=0,n=t.length;i<n;i++)this.doSelection(this.itemList[t[i]],{ctrlKey:!0,shiftKey:!1})},a$e.prototype.getIndexes=function(e,t){for(var i=[],n=t?"id":"name",o=0,r=this.items.length;o<r;o++)-1!==e.indexOf(R(n,this.items[o]))&&i.push(o);return i},a$e.prototype.getItemObject=function(e){e=this.itemList.indexOf(e);return this.items[e]},a$e.prototype.addSelection=function(e){var t=[];this.parent.hasId?t=new me(this.items).executeLocal((new ya).where("id","equal",this.parent.renamedId,!1)):0<(e=new me(this.items).executeLocal((new ya).where("name","equal",R("name",e),!1))).length&&(t=new me(e).executeLocal((new ya).where("filterPath","equal",this.parent.filterPath,!1))),0<t.length&&(e=this.items.indexOf(t[0]),this.doSelection(this.itemList[e],{ctrlKey:!0,shiftKey:!1}))},a$e.prototype.updateSelectedData=function(){for(var e=[],t=ct("."+kGe+"."+OGe,this.element),i=0;i<t.length;i++)e[i]=this.getItemObject(t[i]);this.parent.itemData=e},a$e.prototype.onMethodCall=function(e){if("LargeIcons"===this.parent.view)switch(R("action",e)){case"deleteFiles":this.deleteFiles(R("ids",e));break;case"downloadFiles":this.downloadFiles(R("ids",e));break;case"openFile":this.openFile(R("id",e));break;case"renameFile":this.isInteraction=!1,this.isInteracted=!1,this.renameFile(R("id",e),R("newName",e));break;case"createFolder":this.isInteraction=!1,this.isInteracted=!1;break;case"clearSelection":this.isInteraction=!1,this.isInteracted=!1,this.onClearAllInit();break;case"selectAll":this.isInteraction=!1,this.isInteracted=!1,this.onSelectAllInit()}},a$e.prototype.getItemsIndex=function(e){var t=[],i=!(""===this.parent.breadcrumbbarModule.searchObj.element.value&&!this.parent.isFiltered),n=this.parent.hasId?"id":"name";if(this.parent.hasId||!i)for(var o=0,r=this.items.length;o<r;o++)-1!==e.indexOf(R(n,this.items[o]))&&t.push(o);else for(o=0,r=this.items.length;o<r;o++){var s=R("filterPath",this.items[o])+R("name",this.items[o]);-1===e.indexOf(s)&&-1===e.indexOf(R(n,this.items[o]))||t.push(o)}return t},a$e.prototype.deleteFiles=function(e){if(this.parent.activeModule="largeiconsview",je(e))this.performDelete();else{var t=this.getItemsIndex(e);if(0!==t.length){for(var i=[],n=[],o=0;o<t.length;o++)i[o]=this.items[t[o]],n[o]=WJe(this.parent,i[o]);GJe(this.parent,i,n)}}},a$e.prototype.downloadFiles=function(e){if(je(e))this.doDownload();else{var t=this.getItemsIndex(e);if(0!==t.length){for(var i=[],n=[],o=0;o<t.length;o++)i[o]=this.items[t[o]],n[o]=WJe(this.parent,i[o]);YJe(this.parent,i,n)}}},a$e.prototype.openFile=function(e){je(e)||0<(e=this.getItemsIndex([e])).length&&this.doOpenAction(this.itemList[e[0]])},a$e.prototype.renameFile=function(e,t){this.parent.activeModule="largeiconsview",je(e)?this.performRename():0<(e=this.getItemsIndex([e])).length&&(QJe(this.parent,this.items[e[0]]),je(t)?UJe(this.parent):ZJe(this.parent.itemData[0])?dZe(this.parent,this.parent.path,t):XJe(this.parent,this.parent.itemData[0],RXe))};var s$e=a$e;function a$e(e){this.isInteraction=!0,this.uploadOperation=!1,this.count=0,this.isRendered=!0,this.tapCount=0,this.isSelectAllCalled=!1,this.isPasteOperation=!1,this.isInteracted=!0,this.parent=e,this.element=ge("#"+this.parent.element.id+lGe,this.parent.element),U([this.element],DGe),this.addEventListener(),this.keyConfigs={end:"end",home:"home",tab:"tab",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlEnd:"ctrl+end",ctrlHome:"ctrl+home",ctrlDown:"ctrl+downarrow",ctrlLeft:"ctrl+leftarrow",ctrlRight:"ctrl+rightarrow",ctrlUp:"ctrl+uparrow",shiftEnd:"shift+end",shiftHome:"shift+home",shiftDown:"shift+downarrow",shiftLeft:"shift+leftarrow",shiftRight:"shift+rightarrow",shiftUp:"shift+uparrow",csEnd:"ctrl+shift+end",csHome:"ctrl+shift+home",csDown:"ctrl+shift+downarrow",csLeft:"ctrl+shift+leftarrow",csRight:"ctrl+shift+rightarrow",csUp:"ctrl+shift+uparrow",space:"space",ctrlSpace:"ctrl+space",shiftSpace:"shift+space",csSpace:"ctrl+shift+space",ctrlA:"ctrl+a",enter:"enter",altEnter:"alt+enter",esc:"escape",del:"delete",ctrlX:this.parent.isMac?"cmd+x":"ctrl+x",ctrlC:this.parent.isMac?"cmd+c":"ctrl+c",ctrlV:this.parent.isMac?"cmd+v":"ctrl+v",f2:"f2",shiftdel:"shift+delete",back:"backspace",ctrlD:"ctrl+d"}}h$e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var t=0,i=Object.keys(e.newProp);t<i.length;t++){var n=i[t],o=e.newProp.searchSettings;"searchSettings"===n&&(je(o.allowSearchOnTyping)||this.searchEventBind(o.allowSearchOnTyping),!this.parent.breadcrumbbarModule.searchObj.value||""===this.parent.breadcrumbbarModule.searchObj.value||!je(o.allowSearchOnTyping)&&je(o.filterType)&&je(o.ignoreCase)||iJe(this.parent,this.parent.breadcrumbbarModule.searchObj.value,!1))}},h$e.prototype.render=function(){this.addEventListener()},h$e.prototype.onPathChange=function(){var e=this.parent.pathNames,t=this.parent.path.split("/"),i=this.parent.createElement("ul",{className:"e-addressbar-ul"}),n=null,o=e.length;if(0<e.length){for(var r="",s=0;s<o;s++){for(var a,l=null,n=this.parent.createElement("li",{className:"e-address-list-item"}),h=0;h<=s;h++)r=r+t[h]+"/";n.setAttribute("data-utext",r),0!==s&&(a=Q("span",{className:EYe}),n.appendChild(a)),o-s!=1?(l=Q("a",{className:PGe}),n.setAttribute("tabindex","0")):l=Q("span",{className:PGe}),r="",l.innerText=e[s],n.appendChild(l),i.appendChild(n)}var d=this.parent.breadCrumbBarNavigation.querySelector(".e-addressbar-ul"),d=(je(d)||(je(this.subMenuObj)||this.subMenuObj.destroy(),ue(d)),this.parent.breadCrumbBarNavigation.querySelector(".e-search-wrap"));d?this.parent.breadCrumbBarNavigation.appendChild(i):this.parent.breadCrumbBarNavigation.insertBefore(i,d),this.updateBreadCrumbBar(i)}},h$e.prototype.updateBreadCrumbBar=function(e){for(var t=e.querySelectorAll("li"),i=this.parent.breadCrumbBarNavigation.querySelector(".e-addressbar-ul"),n=window.getComputedStyle(i,null),o=parseFloat(n.getPropertyValue("padding-right")),n=parseFloat(n.getPropertyValue("padding-left")),r=i.offsetWidth-o-n,s=this.parent.createElement("ul",{className:"e-addressbar-ul"}),a=0,l=[],h=0;h<t.length;h++){var d=t[h].clientWidth;l.push(d),a+=d}je(i)||ue(i);o=this.parent.createElement("div");o.setAttribute("class","e-search-wrap");n=Q("input",{id:this.parent.element.id+yGe,attrs:{autocomplete:"off","aria-label":wJe(this.parent,"Search")}});o.appendChild(n);je(this.parent.breadCrumbBarNavigation.querySelector(".e-search-wrap .e-input"))&&(this.parent.breadCrumbBarNavigation.appendChild(o),i=Q("span",{className:"e-icons e-fe-search"}),E.add(i,"click",this.onShowInput,this),n.parentElement.insertBefore(i,n),this.searchObj=new fV({value:"",showClearButton:!0,placeholder:wJe(this.parent,"Search"),focus:this.onFocus.bind(this),blur:this.onBlur.bind(this)}),this.searchObj.appendTo("#"+this.parent.element.id+yGe),this.searchEventBind(this.parent.searchSettings.allowSearchOnTyping),o=this.searchObj.element.nextElementSibling,E.add(o,"mousedown",this.searchChangeHandler.bind(this),this),E.add(this.searchObj.element,"keyup",this.onKeyUp.bind(this),this));i=this.parent.breadCrumbBarNavigation.querySelector(".e-search-wrap");if((r-=this.searchWrapWidth||i.offsetWidth)<a){for(h=t.length;h--;){var p=r-l[h];if(!(40<p)){for(var c=[],u=0;u<=h;u++){var g=t[u];c.push({text:g.innerText,utext:g.getAttribute("data-utext")})}var m=this.parent.createElement("li",{className:"e-breadcrumb-menu"}),f=this.parent.createElement("button",{className:"e-breadcrumb-submenu"});m.appendChild(f),s.insertBefore(m,s.querySelector("li")),this.subMenuObj=new u2({items:c,cssClass:"e-caret-hide e-submenu",iconCss:IYe,iconPosition:"Top",enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeItemRender:this.addSubMenuAttributes.bind(this),select:this.subMenuSelectOperations.bind(this)}),this.subMenuObj.isStringTemplate=!0,this.subMenuObj.appendTo(f);break}s.insertBefore(t[h],s.querySelector("li")),r=p}this.parent.breadCrumbBarNavigation.insertBefore(s,i)}else this.parent.breadCrumbBarNavigation.insertBefore(e,i)},h$e.prototype.onFocus=function(){z(this.searchObj.element,".e-search-wrap").classList.add("e-focus")},h$e.prototype.onKeyUp=function(){this.parent.notify(IXe,{args:this.parent})},h$e.prototype.onBlur=function(){z(this.searchObj.element,".e-search-wrap").classList.remove("e-focus")},h$e.prototype.subMenuSelectOperations=function(e){e={target:e.element};this.addressPathClickHandler(e)},h$e.prototype.addSubMenuAttributes=function(e){e.element.setAttribute("data-utext",R("utext",e.item));var t=this.parent.createElement("a",{className:"e-list-text"});e.element.appendChild(t)},h$e.prototype.searchEventBind=function(e){e?(this.searchObj.input=this.searchChangeHandler.bind(this),this.searchObj.change=null):(this.searchObj.change=this.searchChangeHandler.bind(this),this.searchObj.input=null)},h$e.prototype.searchChangeHandler=function(e){var t=this;je(e.value)||(this.parent.isFiltered=!1,this.parent.searchSettings.allowSearchOnTyping?(window.clearTimeout(this.searchTimer),this.searchTimer=window.setTimeout(function(){iJe(t.parent,e.value,!1)},300)):iJe(this.parent,e.value,!1))},h$e.prototype.addressPathClickHandler=function(e){var e=e.target;"LI"!==e.nodeName&&"A"!==e.nodeName||je(e="LI"===e.nodeName?e.children[0]:e)||(this.parent.isFiltered=!1,e=this.updatePath(e),this.parent.itemData=[R(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent)],this.triggerFileOpen(this.parent.itemData[0]),aZe(this.parent,GYe,e),e=this.parent.pathId[this.parent.pathId.length-1],this.parent.notify(AXe,{module:"treeview",selectedNode:e}))},h$e.prototype.triggerFileOpen=function(e){e={cancel:!1,fileDetails:e,module:"BreadCrumbBar"};delete e.cancel,this.parent.trigger("fileOpen",e)},h$e.prototype.onShowInput=function(){var e;this.parent.isMobile&&(this.parent.element.classList.contains(IGe)?(q([this.parent.element],IGe),this.searchWrapWidth=null):(e=this.parent.breadCrumbBarNavigation.querySelector(".e-search-wrap"),this.searchWrapWidth=e.offsetWidth,U([this.parent.element],IGe),this.searchObj.element.focus()))},h$e.prototype.updatePath=function(e){for(var e=z(e,"li").getAttribute("data-utext"),t=(this.addressBarLink=e,this.addressBarLink.split("/")),i=this.parent.pathId,n=this.parent.pathNames,o=(this.parent.pathId=[],this.parent.pathNames=[],""),r=0,s=t.length-1;r<s;r++)this.parent.pathId.push(i[r]),this.parent.pathNames.push(n[r]),o+=t[r]+"/";return this.parent.setProperties({path:o},!0),o},h$e.prototype.onUpdatePath=function(){this.onPathChange(),this.removeSearchValue()},h$e.prototype.onCreateEnd=function(){this.onPathChange()},h$e.prototype.onRenameEnd=function(){this.onPathChange()},h$e.prototype.onDeleteEnd=function(){this.onUpdatePath()},h$e.prototype.removeSearchValue=function(){this.parent.isFiltered=!1,!this.searchObj||""===this.searchObj.value&&""===this.searchObj.element.value||(this.searchObj.value="",this.searchObj.element.value="",this.searchObj.dataBind())},h$e.prototype.onResize=function(){this.onPathChange()},h$e.prototype.onPasteEnd=function(){this.onPathChange()},h$e.prototype.addEventListener=function(){this.keyboardModule=new bn(this.parent.breadCrumbBarNavigation,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.parent.on(OYe,this.onPropertyChanged,this),E.add(this.parent.breadCrumbBarNavigation,"click",this.addressPathClickHandler,this),this.parent.on(YYe,this.destroy,this),this.parent.on(GYe,this.onUpdatePath,this),this.parent.on(VYe,this.onUpdatePath,this),this.parent.on(QYe,this.onUpdatePath,this),this.parent.on(iXe,this.onUpdatePath,this),this.parent.on(_Ye,this.onCreateEnd,this),this.parent.on(gXe,this.onRenameEnd,this),this.parent.on(WYe,this.onDeleteEnd,this),this.parent.on(qYe,this.onResize,this),this.parent.on(wXe,this.onPasteEnd,this),this.parent.on(UYe,this.onResize,this),this.parent.on(TXe,this.onSearchTextChange,this),this.parent.on(DXe,this.onDropInit,this),this.parent.on(ZYe,this.onResize,this),this.parent.on(kXe,this.onPathChange,this)},h$e.prototype.keyActionHandler=function(e){"enter"===e.action&&this.addressPathClickHandler(e)},h$e.prototype.removeEventListener=function(){this.keyboardModule.destroy(),this.parent.off(GYe,this.onUpdatePath),this.parent.off(VYe,this.onUpdatePath),this.parent.off(QYe,this.onUpdatePath),this.parent.off(iXe,this.onUpdatePath),this.parent.off(wXe,this.onPasteEnd),this.parent.off(_Ye,this.onCreateEnd),this.parent.off(gXe,this.onRenameEnd),this.parent.off(WYe,this.onDeleteEnd),this.parent.off(qYe,this.onResize),this.parent.off(UYe,this.onResize),this.parent.off(TXe,this.onSearchTextChange),this.parent.off(DXe,this.onDropInit),this.parent.off(ZYe,this.onResize),this.parent.off(kXe,this.onPathChange)},h$e.prototype.onDropInit=function(e){this.parent.targetModule===this.getModuleName()&&(e=e.target.closest("li"),this.parent.dropPath=this.updatePath(e.children[0]),this.parent.dropData=R(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent),this.triggerFileOpen(this.parent.dropData),e=this.parent.pathId[this.parent.pathId.length-1],this.parent.notify(AXe,{module:"treeview",selectedNode:e}))},h$e.prototype.getModuleName=function(){return"breadcrumbbar"},h$e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),je(this.subMenuObj)||this.subMenuObj.destroy(),je(this.searchObj))||this.searchObj.destroy()},h$e.prototype.onSearchTextChange=function(e){this.searchObj.element.placeholder=null!=this.parent.searchSettings.placeholder?this.parent.searchSettings.placeholder:wJe(this.parent,"Search")+" "+wJe(this.parent,e.cwd.name.toString())};var l$e=h$e;function h$e(e){this.addressPath="",this.addressBarLink="",this.searchTimer=null,this.searchWrapWidth=null,this.parent=e,this.keyConfigs={enter:"enter"},this.render()}p$e.prototype.render=function(){this.keyConfigs={downarrow:"downarrow",uparrow:"uparrown"},this.contextMenu=new D4({enableRtl:this.parent.enableRtl,locale:this.parent.locale,target:"#"+this.parent.element.id,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeItemRender:this.onBeforeItemRender.bind(this),select:this.onSelect.bind(this),beforeOpen:this.onBeforeOpen.bind(this),beforeClose:this.onBeforeClose.bind(this),cssClass:CJe(this.parent,CGe)}),this.contextMenu.isStringTemplate=!0,this.contextMenu.appendTo("#"+this.parent.element.id+uGe),this.addEventListener()},p$e.prototype.onBeforeItemRender=function(e){var t,i;e.item.id===this.getMenuId("largeiconsview")&&(t=Q("span"),(i=e.element).insertBefore(t,"LargeIcons"===this.parent.view?i.childNodes[1]:i.childNodes[0]),t.setAttribute("class",xYe+" "+rYe)),e.item.id===this.getMenuId("detailsview")&&(t=Q("span"),(i=e.element).insertBefore(t,"Details"===this.parent.view?i.childNodes[1]:i.childNodes[0]),t.setAttribute("class",AYe+" "+rYe))},p$e.prototype.onBeforeClose=function(t){var e={cancel:!1,element:t.element,event:t.event,isFocused:t.isFocused,fileDetails:[this.menuItemData],items:t.items,parentItem:t.parentItem,menuType:this.menuType};if(this.parent.trigger("menuClose",e,function(e){e.cancel&&(t.cancel=e.cancel)}),this.menuTarget=null,!this.isMenuItemClicked&&1<this.parent.pathId.length&&"navigationpane"===this.parent.activeModule){this.parent.pathId.pop();for(var i=[],n=0,o=Object.keys(this.parent.feParent);n<o.length;n++){var r=R(o[n],this.parent.feParent);-1!==this.parent.pathNames.indexOf(r.name)&&i.push(r._fm_id)}this.parent.pathId.push(i[i.length-1]),this.parent.navigationpaneModule.treeObj.setProperties({selectedNodes:[this.parent.pathId[this.parent.pathId.length-1]]})}this.isMenuItemClicked=!1},p$e.prototype.onBeforeOpen=function(t){var e,i=this,n=!1,o=!1,r=t.event.target,s=(this.menuTarget=this.targetNodeElement=r,this.currentElement=t.element,r.classList.contains("e-spinner-pane")&&(r=this.parent.navigationpaneModule.activeNode.getElementsByClassName(PYe)[0],this.menuTarget=this.targetNodeElement=r),this.targetElement="Details"===this.parent.view?z(r,"tr.e-row"):r,this.parent.enableVirtualization&&(r.classList.contains("e-virtual-bottom")||r.classList.contains("e-virtualtable"))&&(r=r.parentElement.closest("div")),this.getTargetView(r));if(this.updateActiveModule(),r.classList.contains(nYe)||z(r,"th")||z(r,"#"+this.parent.element.id+mGe)||z(r,"#"+this.parent.element.id+nGe))t.cancel=!0;else if("LargeIcons"!==this.parent.view&&this.targetElement&&this.targetElement.classList.contains("e-emptyrow"))this.setLayoutItem(r);else if(z(r,"."+QGe))this.setLayoutItem(r);else if(!r.classList.contains(oYe)&&!r.classList.contains(rYe)&&!r.classList.contains(sYe))if("LargeIcons"!==this.parent.view||je(z(r,"li"))||z(r,"#"+this.parent.element.id+sGe)?je(z(r,"tr.e-row"))?z(r,"#"+this.parent.element.id+sGe)&&(je(e=z(r,"li").getAttribute("data-uid"))||(this.navUid=e),o=!0):(e=this.targetElement.getAttribute("data-uid"),d=this.parent.detailsviewModule.gridObj.getRowObjectFromUID(e).data,je(this.targetElement.getAttribute("aria-selected"))&&this.parent.detailsviewModule.gridObj.selectRows([parseInt(this.targetElement.getAttribute("aria-rowindex"),10)-1]),n=!0):(z(r,"li").classList.contains("e-active")||this.parent.largeiconsviewModule.doSelection(r,{ctrlKey:!0,shiftKey:!0}),d=this.parent.visitedData,n=!0),n)!0===R("isFile",d)?this.setFileItem():this.setFolderItem(!1);else if(o)if(this.setFolderItem(!0),e===this.parent.pathId[0])this.disabledItems.push("Delete","Rename","Cut","Copy");else for(var a=["Delete","Rename","Cut","Copy"],l=0;l<this.disabledItems.length;l++){var h=this.disabledItems[l];-1!==a.indexOf(h)&&(this.disabledItems.splice(l,1),l--)}else"TreeView"===s||"GridView"===s||"LargeIcon"===s?this.setLayoutItem(r):t.cancel=!0;var d,p,n=ge("#"+this.getMenuId("Paste"),this.contextMenu.element);t.cancel||this.parent.enablePaste||!n||n.classList.contains("e-disabled")?-1!==(d=this.disabledItems.indexOf("Paste"))&&this.disabledItems.splice(d,1):-1===this.disabledItems.indexOf("Paste")&&this.disabledItems.push("Paste"),t.cancel?this.menuTarget=this.currentElement=null:(this.contextMenu.dataBind(),p=!1,(r.classList.contains(oYe)||r.classList.contains(rYe)||r.classList.contains(sYe))&&(p=!0),this.menuItemData=p?this.menuItemData:this.getMenuItemData(),o={fileDetails:[this.menuItemData],element:t.element,target:r,items:(p?t:this.contextMenu).items,menuModule:this.contextMenu,cancel:!1,menuType:this.menuType,isSubMenu:p},this.currentItems=o.items,this.parent.trigger("menuOpen",o,function(e){p||(i.contextMenu.dataBind(),i.contextMenu.items=e.items,i.contextMenu.dataBind()),i.enableItems(i.disabledItems,!1,!0),t.cancel=e.cancel,e.cancel&&(i.menuTarget=i.targetNodeElement=i.currentElement=null)}))},p$e.prototype.updateActiveModule=function(){this.parent.activeModule=z(this.menuTarget,"#"+this.parent.element.id+sGe)?"navigationpane":z(this.menuTarget,"#"+this.parent.element.id+aGe)?"detailsview":z(this.menuTarget,"#"+this.parent.element.id+lGe)?"largeiconsview":this.parent.activeModule},p$e.prototype.getTargetView=function(e){return e.classList.contains(nYe)?"TreeView":e.classList.contains(aYe)?"GridView":e.classList.contains(hYe)||e.classList.contains(DGe)?"LargeIcon":""},p$e.prototype.getItemIndex=function(e){for(var t=this.getMenuId(e),i=0;i<this.currentItems.length;i++)if(this.currentItems[i].id===t||this.currentItems[i].id===e)return i;return-1},p$e.prototype.disableItem=function(e){0!==e.length&&(this.disabledItems=this.disabledItems.concat(e))},p$e.prototype.enableItems=function(t,e,i){e&&(this.disabledItems=this.disabledItems.filter(function(e){return-1===t.indexOf(e)}));for(var n=0;n<t.length;n++){var o=this.checkValidItem(t[n]);1===o?this.contextMenu.enableItems([this.getMenuId(t[n])],e,i):2===o&&this.contextMenu.enableItems([t[n]],e,i)}},p$e.prototype.setFolderItem=function(e){var t;this.menuType="folder",this.contextMenu.items=this.getItemData(this.parent.contextMenuSettings.folder.map(function(e){return e.trim()})),this.contextMenu.dataBind(),e?(je(e=ge('[data-uid="'+this.navUid+'"]',this.parent.navigationpaneModule.treeObj.element))||this.parent.pathNames[this.parent.pathNames.length-1]!==e.querySelector(".e-list-text").innerHTML||"navigationpane"!==this.parent.activeModule?-1!==(e=this.disabledItems.indexOf("Open"))&&this.disabledItems.splice(e,1):this.disabledItems.push("Open"),0===this.parent.selectedItems.length&&-1!==(t=this.disabledItems.indexOf("Rename"))&&this.disabledItems.splice(t,1)):"navigationpane"!==this.parent.activeModule&&(1===this.parent.selectedItems.length?-1!==(t=this.disabledItems.indexOf("Rename"))&&this.disabledItems.splice(t,1):this.disabledItems.push("Rename","Paste"))},p$e.prototype.setFileItem=function(){var e;this.menuType="file",this.contextMenu.items=this.getItemData(this.parent.contextMenuSettings.file.map(function(e){return e.trim()})),this.contextMenu.dataBind(),1===this.parent.selectedItems.length?-1!==(e=this.disabledItems.indexOf("Rename"))&&this.disabledItems.splice(e,1):this.disabledItems.push("Rename")},p$e.prototype.setLayoutItem=function(e){this.menuType="layout",this.contextMenu.items=this.getItemData(this.parent.contextMenuSettings.layout.map(function(e){return e.trim()})),this.contextMenu.dataBind(),!this.parent.allowMultiSelection||"LargeIcons"===this.parent.view&&0!==z(e,"#"+this.parent.element.id+lGe).getElementsByClassName(QGe).length||"Details"===this.parent.view&&0!==z(e,"#"+this.parent.element.id+aGe).getElementsByClassName(QGe).length?this.disabledItems.push("SelectAll"):this.disabledItems=this.disabledItems.filter(function(e){return"SelectAll"!==e}),0===this.parent.selectedNodes.length&&-1===this.disabledItems.indexOf("Paste")&&this.disabledItems.push("Paste"),this.contextMenu.dataBind()},p$e.prototype.checkValidItem=function(e){if(!je(this.currentElement)){if(!je(ge("#"+this.getMenuId(e),this.currentElement)))return 1;if(!je(ge("#"+e,this.currentElement)))return 2}return-1},p$e.prototype.getMenuItemData=function(){var e;return"layout"===this.menuType?aJe(this.parent):(e={target:this.menuTarget},this.parent.notify(pXe,e),this.parent.itemData[0])},p$e.prototype.onSelect=function(o){var r,s,e,a=this;!je(o.item)&&o.item.id&&("refresh"===(r=o.item.id.substr((this.parent.element.id+"_cm_").length))||"newfolder"===r||"upload"===r?(s=[aJe(this.parent)],this.parent.itemData=s):(this.parent.notify(yXe,{}),s="navigationpane"===this.parent.activeModule&&"open"===r?[this.menuItemData]:this.parent.itemData),e={cancel:!1,element:o.element,fileDetails:s,item:o.item},this.parent.trigger("menuClick",e,function(e){var t;if(!e.cancel)switch("cut"!==r&&"copy"!==r&&(a.isMenuItemClicked=!0),r){case"cut":hJe(a.parent);break;case"copy":lJe(a.parent);break;case"paste":"folder"===a.menuType?"navigationpane"===a.parent.activeModule?(a.parent.navigationpaneModule.openFileOnContextMenuClick(z(a.targetNodeElement,"li")),a.parent.folderPath=a.parent.path):a.parent.folderPath=cJe(a.parent,a.menuItemData,a.parent.path):a.parent.folderPath="",TJe(a.parent);break;case"delete":for(var i=0;i<s.length;i++)if(!ZJe(s[i]))return void XJe(a.parent,s[i],RXe);HZe(a.parent,"Delete");break;case"download":for(var n=0;n<s.length;n++)if(!tZe(s[n]))return void XJe(a.parent,s[n],VXe);"navigationpane"===a.parent.activeModule?a.parent.notify(EXe,{}):0<a.parent.selectedItems.length&&VZe(a.parent,a.parent.path,a.parent.selectedItems);break;case"rename":ZJe(s[0])?(a.parent.notify(cXe,{}),HZe(a.parent,"Rename")):XJe(a.parent,s[0],RXe);break;case"selectall":a.parent.notify(oXe,{});break;case"refresh":rJe(a.parent);break;case"open":a.parent.visitedItem&&"navigationpane"!==a.parent.activeModule?a.parent.notify(tXe,{target:a.parent.visitedItem}):"navigationpane"===a.parent.activeModule&&(a.parent.visitedItem&&a.parent.notify(tXe,{target:a.parent.visitedItem}),a.parent.navigationpaneModule.openFileOnContextMenuClick(z(a.targetNodeElement,"li")));break;case"details":a.parent.notify(dXe,{}),t=a.parent.selectedItems,"navigationpane"===a.parent.activeModule&&(t=[],a.parent.navigationpaneModule.openFileOnContextMenuClick(z(a.targetNodeElement,"li"))),uZe(a.parent,t,a.parent.path,"details");break;case"newfolder":iZe(a.parent);break;case"upload":nZe(a.parent);break;case"name":case"size":case"date":case"ascending":case"descending":case"none":SJe(a.parent,o);break;case"largeiconsview":nJe(a.parent,"LargeIcons");break;case"detailsview":nJe(a.parent,"Details")}}))},p$e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var t=0,i=Object.keys(e.newProp);t<i.length;t++)"cssClass"===i[t]&&(this.contextMenu.cssClass=CJe(this.parent,CGe))},p$e.prototype.addEventListener=function(){this.parent.on(YYe,this.destroy,this),this.parent.on(OYe,this.onPropertyChanged,this),this.keyboardModule=new bn(this.contextMenu.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},p$e.prototype.removeEventListener=function(){this.parent.off(YYe,this.destroy),this.parent.off(OYe,this.onPropertyChanged),this.keyboardModule.destroy()},p$e.prototype.keyActionHandler=function(e){switch(e.action){case"uparrow":case"downarrow":e.preventDefault()}},p$e.prototype.getModuleName=function(){return"contextmenu"},p$e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.contextMenu.destroy(),this.targetElement=null)},p$e.prototype.getItemData=function(e){for(var t=[],i=0;i<e.length;i++){var n=void 0,o=this.getMenuId(e[i]),r=wJe(this.parent,e[i]);switch(e[i]){case"|":n={separator:!0};break;case"Open":n={id:o,text:r,iconCss:dYe};break;case"Upload":n={id:o,text:r,iconCss:pYe};break;case"Cut":n={id:o,text:r,iconCss:cYe};break;case"Copy":n={id:o,text:r,iconCss:uYe};break;case"Paste":n={id:o,text:r,iconCss:gYe};break;case"Delete":n={id:o,text:r,iconCss:mYe};break;case"Rename":n={id:o,text:r,iconCss:fYe};break;case"NewFolder":n={id:o,text:r,iconCss:yYe};break;case"Details":n={id:o,text:r,iconCss:vYe};break;case"SortBy":n={id:o,text:r,iconCss:bYe,items:[{id:this.getMenuId("Name"),text:wJe(this.parent,"Name"),iconCss:"name"===this.parent.sortBy?LGe:null},{id:this.getMenuId("Size"),text:wJe(this.parent,"Size"),iconCss:"size"===this.parent.sortBy?LGe:null},{id:this.getMenuId("Date"),text:wJe(this.parent,"DateModified"),iconCss:"_fm_modified"===this.parent.sortBy?LGe:null},{separator:!0},{id:this.getMenuId("Ascending"),text:wJe(this.parent,"Ascending"),iconCss:"Ascending"===this.parent.sortOrder?FGe:null},{id:this.getMenuId("Descending"),text:wJe(this.parent,"Descending"),iconCss:"Descending"===this.parent.sortOrder?FGe:null},{id:this.getMenuId("None"),text:wJe(this.parent,"None"),iconCss:"None"===this.parent.sortOrder?FGe:null}]};break;case"View":n={id:o,text:r,iconCss:"Details"===this.parent.view?AYe:xYe,items:[{id:this.getMenuId("largeiconsview"),text:wJe(this.parent,"View-LargeIcons"),iconCss:"Details"===this.parent.view?null:FGe},{id:this.getMenuId("detailsview"),text:wJe(this.parent,"View-Details"),iconCss:"Details"===this.parent.view?FGe:null}]};break;case"Refresh":n={id:o,text:r,iconCss:wYe};break;case"SelectAll":n={id:o,text:r,iconCss:CYe};break;case"Download":n={id:o,text:r,iconCss:SYe};break;default:n={id:o,text:r}}t.push(n)}return t},p$e.prototype.getMenuId=function(e){return this.parent.element.id+"_cm_"+e.split(" ").join("").toLowerCase()};var d$e=p$e;function p$e(e){this.isMenuItemClicked=!1,this.currentItems=[],this.currentElement=null,this.disabledItems=[],this.parent=e,this.render()}var c$e={NewFolder:"New folder",Upload:"Upload",Delete:"Delete",Rename:"Rename",Download:"Download",Cut:"Cut",Copy:"Copy",Paste:"Paste",SortBy:"Sort by",Refresh:"Refresh","Item-Selection":"item selected","Items-Selection":"items selected",View:"View",Details:"Details",SelectAll:"Select all",Open:"Open","Tooltip-NewFolder":"New folder","Tooltip-Upload":"Upload","Tooltip-Delete":"Delete","Tooltip-Rename":"Rename","Tooltip-Download":"Download","Tooltip-Cut":"Cut","Tooltip-Copy":"Copy","Tooltip-Paste":"Paste","Tooltip-SortBy":"Sort by","Tooltip-Refresh":"Refresh","Tooltip-Selection":"Clear selection","Tooltip-View":"View","Tooltip-Details":"Details","Tooltip-SelectAll":"Select all",Name:"Name",Size:"Size",DateModified:"Modified",DateCreated:"Date created",Path:"Path",Modified:"Modified",Created:"Created",Location:"Location",Type:"Type",Permission:"Permission",Ascending:"Ascending",Descending:"Descending",None:"None","View-LargeIcons":"Large icons","View-Details":"Details",Search:"Search","Button-Ok":"OK","Button-Cancel":"Cancel","Button-Yes":"Yes","Button-No":"No","Button-Create":"Create","Button-Save":"Save","Header-NewFolder":"Folder","Content-NewFolder":"Enter your folder name","Header-Rename":"Rename","Content-Rename":"Enter your new name","Header-Rename-Confirmation":"Rename Confirmation","Content-Rename-Confirmation":"If you change a file name extension, the file might become unstable. Are you sure you want to change it?","Header-Delete":"Delete File","Content-Delete":"Are you sure you want to delete this file?","Header-Folder-Delete":"Delete Folder","Content-Folder-Delete":"Are you sure you want to delete this folder?","Header-Multiple-Delete":"Delete Multiple Items","Content-Multiple-Delete":"Are you sure you want to delete these {0} items?","Header-Duplicate":"File/Folder exists","Content-Duplicate":"{0} already exists. Do you want to rename and paste?","Header-Upload":"Upload Files",Error:"Error","Validation-Empty":"The file or folder name cannot be empty.","Validation-Invalid":'The file or folder name {0} contains invalid characters. Please use a different name. Valid file or folder names cannot end with a dot or space, and cannot contain any of the following characters: \\/:*?"<>|',"Validation-NewFolder-Exists":"A file or folder with the name {0} already exists.","Validation-Rename-Exists":"Cannot rename {0} to {1}: destination already exists.","Folder-Empty":"This folder is empty","File-Upload":"Drag files here to upload","Search-Empty":"No results found","Search-Key":"Try with different keywords","Filter-Empty":"No results found","Filter-Key":"Try with different filter","Sub-Folder-Error":"The destination folder is the subfolder of the source folder.","Same-Folder-Error":"The destination folder is the same as the source folder.","Access-Denied":"Access Denied","Access-Details":'You don"t have permission to access this folder.',"Header-Retry":"File Already Exists","Content-Retry":"A file with this name already exists in this folder. What would you like to do?","Button-Keep-Both":"Keep both","Button-Replace":"Replace","Button-Skip":"Skip","ApplyAll-Label":"Do this for all current items",KB:"KB","Access-Message":"{0} is not accessible. You need permission to perform the {1} action.","Network-Error":"NetworkError: Failed to send on XMLHTTPRequest: Failed to load","Server-Error":"ServerError: Invalid response from"};u$e=function(e,t){return(u$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])}))(e,t)};var u$e,g$e,m$e,jee=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},f$e=(function(e,t){function i(){this.constructor=e}u$e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(y$e,g$e=Ji),(m$e=y$e).prototype.getModuleName=function(){return"filemanager"},y$e.prototype.preRender=function(){!je(this.element.id)&&""!==this.element.id||this.element.setAttribute("id",D("filemanager")),this.ensurePath(),this.feParent=[],this.feFiles=[],gt(this.element,{width:T(this.width),height:T(this.height)}),this.isDevice=F.isDevice,this.isMobile=this.checkMobile(),this.isMobile&&this.setProperties({navigationPaneSettings:{visible:!1}},!0);var e=z(this.element,".e-bigger");this.isBigger=!!e,this.activeModule="LargeIcons"===this.view?"largeiconsview":"detailsview",mA({target:this.element},Q),this.addWrapper(),this.keyConfigs={altN:"alt+n",f5:"f5",ctrlShift1:"ctrl+shift+1",ctrlShift2:"ctrl+shift+2",ctrlU:"ctrl+u"},this.localeObj=new Cn(this.getModuleName(),c$e,this.locale)},y$e.prototype.getPersistData=function(){return this.addOnPersist(["view","path","selectedItems"])},y$e.prototype.requiredModules=function(){var e=[];return e.push({member:"breadcrumbbar",args:[this]}),e.push({member:"largeiconsview",args:[this]}),this.toolbarSettings.visible&&e.push({member:"toolbar",args:[this],name:"Toolbar"}),this.navigationPaneSettings.visible&&e.push({member:"navigationpane",args:[this],name:"NavigationPane"}),this.view&&e.push({member:"detailsview",args:[this],name:"DetailsView"}),this.contextMenuSettings.visible&&!this.isDevice&&e.push({member:"contextmenu",args:[this],name:"ContextMenu"}),this.enableVirtualization&&e.push({member:"virtualization",args:[this],name:"Virtualization"}),e},y$e.prototype.render=function(){this.initialize();var e=je(this.selectedItems)?[]:this.allowMultiSelection?this.selectedItems:this.selectedItems.slice(this.selectedItems.length-1);this.setProperties({selectedItems:e},!0),this.fileView=this.view,this.isMac=0<=navigator.platform.toUpperCase().indexOf("MAC"),this.setRtl(this.enableRtl),this.addEventListeners(),aZe(this,this.path!==this.originalPath?NYe:VYe,this.path),"Details"===this.fileView&&this.largeiconsviewModule.element.classList.add(kYe),this.adjustHeight(),je(this.navigationpaneModule)&&(this.splitterObj.collapse(this.enableRtl?1:0),ge("."+BYe,this.element).classList.add(kYe)),this.wireEvents(),this.renderComplete()},y$e.prototype.ensurePath=function(){var e=this.path,e=((e=je(e)?"/":e).lastIndexOf("/")!==e.length-1&&(e+="/"),(this.originalPath=e).split("/"));this.setProperties({path:e[0]+"/"},!0),this.pathNames=[],this.pathId=["fe_tree"],this.itemData=[]},y$e.prototype.initialize=function(){this.isMobile&&U([this.element],SGe),this.allowMultiSelection&&U([this.element],wGe),this.addCssClass(null,this.cssClass),this.renderFileUpload()},y$e.prototype.addWrapper=function(){var e=this.createElement("div",{id:this.element.id+nGe}),e=(this.element.appendChild(e),this.createElement("div",{id:this.element.id+oGe,className:"e-layout"})),t=(this.element.appendChild(e),this.createElement("div",{id:this.element.id+rGe,className:TGe})),i=this.createElement("div",{id:this.element.id+sGe}),i=(t.appendChild(i),this.createElement("div",{id:this.element.id+gGe,className:EGe})),n=(this.breadCrumbBarNavigation=this.createElement("div",{id:this.element.id+mGe,className:"e-address"}),i.appendChild(this.breadCrumbBarNavigation),this.createElement("div",{id:this.element.id+aGe})),n=(i.appendChild(n),this.createElement("div",{id:this.element.id+lGe,className:DGe,attrs:{role:"group"}})),n=(i.appendChild(n),this.createElement("span",{className:LYe})),t=(i.appendChild(n),n=this.enableRtl?(e.appendChild(i),e.appendChild(t),[{size:"75%",min:"270px"},{size:"25%",min:this.navigationPaneSettings.minWidth.toString(),max:this.navigationPaneSettings.maxWidth.toString()}]):(e.appendChild(t),e.appendChild(i),[{size:"25%",min:this.navigationPaneSettings.minWidth.toString(),max:this.navigationPaneSettings.maxWidth.toString()},{size:"75%",min:"270px"}]),this.splitterObj=new fKe({paneSettings:n,width:"100%",enableRtl:!1,enableHtmlSanitizer:this.enableHtmlSanitizer,resizing:this.splitterResize.bind(this)}),this.splitterObj.isStringTemplate=!0,this.splitterObj.appendTo(e),this.createElement("div",{id:this.element.id+hGe})),i=(this.element.appendChild(t),this.createElement("ul",{id:this.element.id+uGe})),n=(this.element.appendChild(i),this.createElement("div",{id:this.element.id+dGe})),e=(this.element.appendChild(n),this.createElement("div",{id:this.element.id+pGe})),t=(this.element.appendChild(e),this.createElement("div",{id:this.element.id+cGe}));this.element.appendChild(t)},y$e.prototype.adjustHeight=function(){var e=ge("#"+this.element.id+nGe,this.element),e=e?e.offsetHeight:0;this.splitterObj&&(this.splitterObj.height=(this.element.clientHeight-e).toString(),this.splitterObj.dataBind())},y$e.prototype.splitterResize=function(){this.notify(qYe,{})},y$e.prototype.splitterAdjust=function(){var e=ge("."+BYe,this.element);this.navigationPaneSettings.visible?(this.splitterObj.expand(this.enableRtl?1:0),e.classList.remove(kYe)):(this.splitterObj.collapse(this.enableRtl?1:0),e.classList.add(kYe))},y$e.prototype.addCssClass=function(e,t){je(e)||""===e||q([this.element],e.split(" ")),je(t)||""===t||U([this.element],t.split(" "))},y$e.prototype.showSpinner=function(){kA(this.element)},y$e.prototype.hideSpinner=function(){BA(this.element)},y$e.prototype.onContextMenu=function(e){e.preventDefault()},y$e.prototype.checkMobile=function(){return/iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile/i.test(F.userAgent.toLowerCase())&&/mobile/i.test(F.userAgent.toLowerCase())},y$e.prototype.renderFileUpload=function(){var e=this.element.id+fGe,e=this.createElement("input",{id:e,attrs:{name:"uploadFiles",type:"file"}});this.element.appendChild(e),this.uploadDialogObj=new pS({header:wJe(this,"Header-Upload"),content:e,animationSettings:{effect:"None"},showCloseIcon:!0,closeOnEscape:!0,visible:!1,isModal:!0,width:"350px",target:this.popupTarget||"#"+this.element.id,cssClass:CJe(this,this.isMobile?AGe:CGe),locale:this.locale,allowDragging:!0,position:{X:"center",Y:"center"},enableRtl:this.enableRtl,enableHtmlSanitizer:this.enableHtmlSanitizer,open:this.onOpen.bind(this),close:this.onClose.bind(this),beforeOpen:this.onBeforeOpen.bind(this),beforeClose:this.onBeforeClose.bind(this)}),this.uploadDialogObj.appendTo("#"+this.element.id+cGe),this.renderUploadBox()},y$e.prototype.renderUploadBox=function(){var e=this.ajaxSettings.uploadUrl||this.ajaxSettings.url;this.uploadObj=new GN({dropArea:ge("#"+this.element.id+gGe,this.element),asyncSettings:{saveUrl:e,removeUrl:e,chunkSize:this.uploadSettings.chunkSize,retryCount:0},locale:this.locale,enableRtl:this.enableRtl,uploading:this.onUploading.bind(this),chunkUploading:this.onChunkUploading.bind(this),removing:this.onRemoving.bind(this),canceling:this.onCancel.bind(this),clearing:this.onClearing.bind(this),selected:this.onSelected.bind(this),success:this.onUploadSuccess.bind(this),failure:this.onUploadFailure.bind(this),autoUpload:this.uploadSettings.autoUpload,minFileSize:this.uploadSettings.minFileSize,maxFileSize:this.uploadSettings.maxFileSize,allowedExtensions:this.uploadSettings.allowedExtensions,directoryUpload:this.uploadSettings.directoryUpload,fileListRendering:this.onFileListRender.bind(this)}),this.uploadObj.appendTo("#"+this.element.id+fGe)},y$e.prototype.onFileListRender=function(e){this.trigger("uploadListCreate",e)},y$e.prototype.updateUploader=function(){this.uploadObj.autoUpload=this.uploadSettings.autoUpload,this.uploadObj.minFileSize=this.uploadSettings.minFileSize,this.uploadObj.maxFileSize=this.uploadSettings.maxFileSize,this.uploadObj.allowedExtensions=this.uploadSettings.allowedExtensions,this.uploadObj.directoryUpload=this.uploadSettings.directoryUpload,this.uploadObj.dataBind()},y$e.prototype.onBeforeOpen=function(t){var e={cancel:t.cancel,popupName:"Upload",popupModule:this.uploadDialogObj};this.trigger("beforePopupOpen",e,function(e){t.cancel=e.cancel})},y$e.prototype.onBeforeClose=function(t){var e={cancel:t.cancel,popupName:"Upload",popupModule:this.uploadDialogObj};this.trigger("beforePopupClose",e,function(e){t.cancel=e.cancel})},y$e.prototype.onOpen=function(){this.isOpened=!0,this.uploadDialogObj.element.focus();var e={popupModule:this.uploadDialogObj,popupName:"Upload",element:this.uploadDialogObj.element};this.trigger("popupOpen",e)},y$e.prototype.onClose=function(){this.isOpened=!1,this.uploadObj.clearAll();var e={popupModule:this.uploadDialogObj,popupName:"Upload",element:this.uploadDialogObj.element};this.trigger("popupClose",e)},y$e.prototype.onChunkUploading=function(e){var t="save";if(0!==this.retryArgs.length)for(var i=0;i<this.retryArgs.length;i++)e.fileData.name===this.retryArgs[i].file.name&&(t=this.retryArgs[i].action);var n=JSON.stringify(R(this.pathId[this.pathId.length-1],this.feParent));e.customFormData=[{path:this.path},{size:e.fileData.size},{action:t},{data:n},{filename:e.fileData.name}]},y$e.prototype.onUploading=function(i){var e="save";if(0!==this.retryArgs.length)for(var t=0;t<this.retryArgs.length;t++)i.fileData.name===this.retryArgs[t].file.name&&(e=this.retryArgs[t].action,0===this.uploadSettings.chunkSize)&&(this.retryArgs.splice(t,1),t=this.retryArgs.length);var n=JSON.stringify(R(this.pathId[this.pathId.length-1],this.feParent));i.customFormData=[{path:this.path},{size:i.fileData.size},{action:e},{data:n},{filename:i.fileData.name}];n={url:this.ajaxSettings.uploadUrl||this.ajaxSettings.url,type:"POST",mode:!0,dataType:null,contentType:null,data:JSON.stringify(i.customFormData),onSuccess:null,onFailure:null,beforeSend:null};this.uploadEventArgs={action:"Upload",ajaxSettings:n,cancel:!1},this.trigger("beforeSend",this.uploadEventArgs,function(e){i.customFormData=JSON.parse(R("data",e.ajaxSettings)),i.cancel=e.cancel;var t={cancel:!1,httpRequest:i.currentRequest};"function"==typeof R("beforeSend",e.ajaxSettings)&&(R("beforeSend",e.ajaxSettings)(t),R("cancel",t))&&(i.cancel=R("cancel",t))})},y$e.prototype.onRemoving=function(){this.onFileUploadSuccess({count:1}),1===this.uploadObj.getFilesData().length&&this.uploadDialogObj.hide()},y$e.prototype.onCancel=function(e){var t=JSON.stringify(R(this.pathId[this.pathId.length-1],this.feParent));e.customFormData=[{path:this.path},{action:"remove"},{data:t}]},y$e.prototype.onClearing=function(){this.isOpened&&this.uploadDialogObj.hide()},y$e.prototype.onSelected=function(e){var t;0!==e.filesData.length&&(this.uploadingCount=e.filesData.length,this.uploadedCount=0,eZe(t=aJe(this))?this.uploadDialogObj.show():(e.cancel=!0,XJe(this,t,NXe)))},y$e.prototype.onFileUploadSuccess=function(e){this.uploadedCount=this.uploadedCount+e.count,this.uploadSettings.autoClose&&this.uploadingCount===this.uploadedCount&&this.uploadDialogObj.hide()},y$e.prototype.onChunkUploadComplete=function(e){if(0!==this.retryArgs.length)for(var t=0;t<this.retryArgs.length;t++)(je(e)?"":R("file",e).name)===this.retryArgs[t].file.name&&(this.retryArgs.splice(t,1),t=this.retryArgs.length)},y$e.prototype.onUploadSuccess=function(e){0<this.uploadSettings.chunkSize&&this.onChunkUploadComplete(e),this.trigger("success",{action:"Upload",result:e}),this.itemData=[R(this.pathId[this.pathId.length-1],this.feParent)],aZe(this,GYe,this.path),this.onFileUploadSuccess({count:1}),"function"==typeof R("onSuccess",this.uploadEventArgs.ajaxSettings)&&R("onSuccess",this.uploadEventArgs.ajaxSettings)()},y$e.prototype.onUploadFailure=function(e){0<this.uploadSettings.chunkSize&&this.onChunkUploadComplete(e);var t=R("response",e),i=R("statusText",t);""!==i&&x("statusText",i,e),this.trigger("failure",{action:"Upload",error:e}),400===R("statusCode",t)&&(this.retryFiles.push(R("file",e)),this.isRetryOpened||zZe(this,"UploadRetry")),"function"==typeof R("onFailure",this.uploadEventArgs.ajaxSettings)&&R("onFailure",this.uploadEventArgs.ajaxSettings)()},y$e.prototype.onInitialEnd=function(){xJe(this,this.path)},y$e.prototype.addEventListeners=function(){this.on(XYe,this.showSpinner,this),this.on(JYe,this.hideSpinner,this),this.on(NYe,this.onInitialEnd,this),this.on(dXe,this.onDetailsInit,this),this.on(KYe,this.onFileUploadSuccess,this),E.add(this.element,"contextmenu",this.onContextMenu,this)},y$e.prototype.removeEventListeners=function(){this.isDestroyed||(this.off(XYe,this.showSpinner),this.off(JYe,this.hideSpinner),this.off(NYe,this.onInitialEnd),this.off(dXe,this.onDetailsInit),this.off(KYe,this.onFileUploadSuccess),E.remove(this.element,"contextmenu",this.onContextMenu))},y$e.prototype.onDetailsInit=function(){je(this.activeModule)&&(this.itemData=[R(this.pathId[this.pathId.length-1],this.feParent)])},y$e.prototype.resizeHandler=function(){this.adjustHeight(),this.notify(UYe,{})},y$e.prototype.keyActionHandler=function(e){switch(e.action){case"altN":e.preventDefault(),this.itemData=[aJe(this)],$Je(this.itemData[0])?HZe(this,"NewFolder"):XJe(this,this.itemData[0],OXe);break;case"f5":e.preventDefault(),rJe(this);break;case"ctrlShift1":e.preventDefault(),this.fileView="Details",this.setProperties({view:"Details"},!0),kA(this.element),nJe(this,"Details");break;case"ctrlShift2":e.preventDefault(),this.fileView="LargeIcons",this.setProperties({view:"LargeIcons"},!0),kA(this.element),nJe(this,"LargeIcons");break;case"ctrlU":e.preventDefault(),-1!==this.toolbarSettings.items.indexOf("Upload")&&ge("#"+this.element.id+fGe,this.element).click()}},y$e.prototype.wireSelectOnDragEvent=function(e){je(this.view)||(e&&(this.viewElem="LargeIcons"===this.view?this.largeiconsviewModule.element:this.element.querySelector(".e-gridcontent")),this.viewElem&&(e?this.allowMultiSelection&&(E.add(this.viewElem,"mousedown",this.onDragStart,this),this.on(aXe,this.onLayoutChange,this),this.on(nXe,this.onLayoutChange,this)):(E.remove(this.viewElem,"mousedown",this.onDragStart),this.off(aXe,this.onLayoutChange),this.off(nXe,this.onLayoutChange))))},y$e.prototype.wireEvents=function(){this.enableRangeSelection&&this.wireSelectOnDragEvent(!0),E.add(window,"resize",this.resizeHandler,this),this.contextMenuSettings.visible&&this.element.addEventListener("scroll",this.onScrollHandler,!0),this.keyboardModule=new bn(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},y$e.prototype.unWireEvents=function(){this.wireSelectOnDragEvent(!1),E.remove(window,"resize",this.resizeHandler),this.contextMenuSettings.visible&&this.element.removeEventListener("scroll",this.onScrollHandler,!0),this.keyboardModule.destroy()},y$e.prototype.onDragStart=function(e){if(this.viewElem){if(this.allowDragAndDrop)if(z(e.target,this.viewElem.classList.contains("e-large-icons")?".e-list-item":".e-fe-text"))return;e.preventDefault(),this.dragX=e.pageX,this.dragY=e.pageY,this.dragSelectElement||(this.dragSelectElement=Q("div",{id:this.element.id+"_drag",className:"e-filemanager e-drag-select",styles:"left: "+this.dragX+"px;top: "+this.dragY+"px;"}),document.body.append(this.dragSelectElement)),E.add(document,"mouseup",this.onDragStop,this),E.add(this.viewElem,"mousemove",this.onDrag,this),E.add(this.dragSelectElement,"mousemove",this.onDrag,this)}},y$e.prototype.onDrag=function(e){var t;e.stopPropagation(),this.dragSelectElement?(t=e.pageX-this.dragX,e=e.pageY-this.dragY,gt(this.dragSelectElement,{left:t<0?this.dragX+t+"px":this.dragX+"px",top:e<0?this.dragY+e+"px":this.dragY+"px",height:Math.abs(e)+"px",width:Math.abs(t)+"px"}),this.selectItems()):E.remove(this.viewElem,"mousemove",this.onDrag)},y$e.prototype.onDragStop=function(){this.viewElem&&(E.remove(document,"mouseup",this.onDragStop),E.remove(this.viewElem,"mousemove",this.onDrag)),this.dragSelectElement&&(E.remove(this.dragSelectElement,"mousemove",this.onDrag),0<this.dragSelectElement.clientHeight&&0<this.dragSelectElement.clientWidth&&this.setProperties({selectedItems:this.dragSelectedItems}),this.dragSelectedItems=[],G(this.dragSelectElement),this.dragSelectElement=null)},y$e.prototype.selectItems=function(){var e=this.dragSelectElement.getBoundingClientRect();0<e.height&&0<e.width&&(this.dragSelectedItems=[],q(ct(".e-active",this.viewElem),["e-active","e-focus"]),q(ct(".e-check",this.viewElem),["e-check"]));for(var t=0,i=ct(this.viewElem.classList.contains("e-large-icons")?".e-list-item":".e-row",this.viewElem);t<i.length;t++){var n=i[t],o=n.getBoundingClientRect();!(e.right<o.left||e.left>o.right||e.bottom<o.top||e.top>o.bottom)&&0<e.height&&0<e.width&&(this.viewElem.classList.contains("e-large-icons")?(n.classList.add("e-active"),this.dragSelectedItems.push(n.getAttribute("title"))):(U(ct(".e-rowcell",n),["e-active"]),this.dragSelectedItems.push(n.querySelector(".e-drag-text").textContent)),n.querySelector(".e-frame").classList.add("e-check"))}},y$e.prototype.onLayoutChange=function(){this.enableRangeSelection&&(this.unWireEvents(),this.wireEvents())},y$e.prototype.setPath=function(){this.setProperties({selectedItems:[]},!0),this.ensurePath(),this.notify(sXe,{selectedNode:this.pathId[0]}),aZe(this,this.path!==this.originalPath?NYe:VYe,this.path)},y$e.prototype.onPropertyChanged=function(e,t){for(var i=this,n=!1,o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"ajaxSettings":this.ajaxSettingSetModel(e);break;case"allowDragAndDrop":this.allowDragAndDrop=e.allowDragAndDrop,this.notify(OYe,{module:"common",newProp:e,oldProp:t});break;case"showItemCheckBoxes":this.showItemCheckBoxes=e.showItemCheckBoxes,this.notify(OYe,{module:"common",newProp:e,oldProp:t});break;case"enableVirtualization":this.enableVirtualization=e.enableVirtualization,n=!0;break;case"allowMultiSelection":(this.allowMultiSelection?U:(1<this.selectedItems.length&&this.setProperties({selectedItems:this.selectedItems.slice(this.selectedItems.length-1)},!0),q))([this.element],wGe),this.notify(OYe,{module:"common",newProp:e,oldProp:t});break;case"cssClass":this.addCssClass(t.cssClass,e.cssClass),this.notify(OYe,{module:"common",newProp:e,oldProp:t});break;case"detailsViewSettings":this.notify(OYe,{module:"detailsview",newProp:e,oldProp:t});break;case"enableRangeSelection":this.wireSelectOnDragEvent(!1),e.enableRangeSelection&&this.wireSelectOnDragEvent(!0);break;case"enableRtl":this.enableRtl=e.enableRtl,n=!0;break;case"rootAliasName":this.rootAliasName=e.rootAliasName,n=!0;break;case"height":s=je(e.height)?e.height:T(e.height),gt(this.element,{height:s}),this.adjustHeight(),this.notify(OYe,{module:"common",newProp:e,oldProp:t});break;case"locale":je(e.enableRtl)||this.setProperties({enableRtl:e.enableRtl},!0),this.localeSetModelOption(e);break;case"navigationPaneSettings":this.splitterAdjust(),this.notify(OYe,{module:"navigationpane",newProp:e,oldProp:t});break;case"path":this.setPath();break;case"searchSettings":je(e.searchSettings.allowSearchOnTyping)||this.setProperties({searchSettings:{allowSearchOnTyping:e.searchSettings.allowSearchOnTyping}},!0),je(e.searchSettings.ignoreCase)&&this.setProperties({searchSettings:{ignoreCase:e.searchSettings.ignoreCase}},!0),je(e.searchSettings.filterType)&&this.setProperties({searchSettings:{filterType:e.searchSettings.filterType}},!0),this.notify(OYe,{module:"breadcrumbbar",newProp:e,oldProp:t});break;case"selectedItems":"Details"===this.view?this.notify(OYe,{module:"detailsview",newProp:e,oldProp:t}):"LargeIcons"===this.view&&this.notify(OYe,{module:"largeiconsview",newProp:e,oldProp:t});break;case"showFileExtension":case"showHiddenItems":this.notify(OYe,{module:"common",newProp:e,oldProp:t});break;case"showThumbnail":this.notify(OYe,{module:"largeiconsview",newProp:e,oldProp:t});break;case"toolbarSettings":case"toolbarItems":this.adjustHeight(),this.notify(OYe,{module:"toolbar",newProp:e,oldProp:t});break;case"uploadSettings":this.updateUploader();break;case"view":"Details"===e.view?this.notify(OYe,{module:"detailsview",newProp:e,oldProp:t}):"LargeIcons"===e.view&&this.notify(OYe,{module:"largeiconsview",newProp:e,oldProp:t});break;case"width":gt(this.element,{width:je(e.width)?e.width:T(e.width)}),this.notify(OYe,{module:"common",newProp:e,oldProp:t});break;case"sortOrder":rJe(this),this.notify(lXe,{});break;case"sortBy":if("Details"===this.view){var s=this.detailsViewSettings.columns;if(!(!je(s)&&-1!==s.findIndex(function(e){return e.field===i.sortBy})))return;rJe(this),this.notify(lXe,{}),this.notify(xXe,{})}else rJe(this),this.notify(lXe,{});break;case"popupTarget":this.uploadDialogObj&&(this.uploadDialogObj.target=e.popupTarget),this.dialogObj&&(this.dialogObj.target=e.popupTarget),this.extDialogObj&&(this.extDialogObj.target=e.popupTarget),this.viewerObj&&(this.viewerObj.target=e.popupTarget);break;case"fileSystemData":this.fileSystemData=e.fileSystemData,n=!0}n&&this.refresh()},y$e.prototype.ajaxSettingSetModel=function(e){je(e.ajaxSettings.url)||this.setProperties({ajaxSettings:{url:e.ajaxSettings.url}},!0),je(e.ajaxSettings.uploadUrl)||this.setProperties({ajaxSettings:{uploadUrl:e.ajaxSettings.uploadUrl}},!0),je(e.ajaxSettings.downloadUrl)||this.setProperties({ajaxSettings:{downloadUrl:e.ajaxSettings.downloadUrl}},!0),je(e.ajaxSettings.getImageUrl)||this.setProperties({ajaxSettings:{getImageUrl:e.ajaxSettings.getImageUrl}},!0),this.setProperties({path:"/"},!0),this.setProperties({selectedItems:[]},!0),g$e.prototype.refresh.call(this)},y$e.prototype.localeSetModelOption=function(e){this.uploadObj.locale=e.locale,g$e.prototype.refresh.call(this)},y$e.prototype.destroy=function(){this.isDestroyed||(this.refreshing||this.notify(YYe,{}),this.uploadObj.destroy(),this.uploadObj=null,this.uploadDialogObj.destroy(),this.uploadDialogObj=null,this.splitterObj.destroy(),this.splitterObj=null,this.dialogObj&&(this.dialogObj.destroy(),this.dialogObj=null),this.viewerObj&&(this.viewerObj.destroy(),this.viewerObj=null),this.extDialogObj&&(this.extDialogObj.destroy(),this.extDialogObj=null),this.element.removeAttribute("style"),this.element.removeAttribute("tabindex"),this.removeEventListeners(),this.unWireEvents(),this.addCssClass(this.cssClass,null),q([this.element],[MYe,SGe,wGe]),this.element.innerHTML="",this.breadCrumbBarNavigation=null,this.activeElements=null,this.virtualDragElement=null,this.visitedItem=null,g$e.prototype.destroy.call(this),this.virtualizationModule=null,this.navigationpaneModule=null,this.toolbarModule=null,this.contextmenuModule=null,this.largeiconsviewModule=null,this.detailsviewModule=null,this.breadcrumbbarModule=null,this.viewElem=null,this.dragSelectElement=null,this.dragSelectedItems=null)},y$e.prototype.createFolder=function(e){this.notify(FXe,{action:"createFolder"});var t=[aJe(this)];this.itemData=t,e?/[/\\|*?"<>:]/.test(e)?HZe(this,"Error",{files:null,error:{code:"402",message:wJe(this,"Validation-Invalid").replace("{0}",'"'+e+'"'),fileExists:null}}):$Je(t[0])?lZe(this,e):XJe(this,t[0],OXe):iZe(this)},y$e.prototype.deleteFiles=function(e){this.notify(FXe,{action:"deleteFiles",ids:e})},y$e.prototype.disableToolbarItems=function(e){!je(e)&&this.toolbarModule&&this.toolbarModule.enableItems(e,!1)},y$e.prototype.downloadFiles=function(e){this.notify(FXe,{action:"downloadFiles",ids:e})},y$e.prototype.enableToolbarItems=function(e){!je(e)&&this.toolbarModule&&this.toolbarModule.enableItems(e,!0)},y$e.prototype.enableMenuItems=function(e){je(e)||je(this.contextmenuModule)||je(this.contextmenuModule.contextMenu)||this.contextmenuModule.enableItems(e,!0,!0)},y$e.prototype.disableMenuItems=function(e){je(e)||je(this.contextmenuModule)||je(this.contextmenuModule.contextMenu)||this.contextmenuModule.disableItem(e)},y$e.prototype.getMenuItemIndex=function(e){return this.contextmenuModule?this.contextmenuModule.getItemIndex(e):-1},y$e.prototype.getToolbarItemIndex=function(e){return this.toolbarModule?this.toolbarModule.getItemIndex(e):-1},y$e.prototype.filterFiles=function(e){this.filterData=e||null,this.setProperties({selectedItems:[]},!0),this.notify(nXe,{}),this.isFiltered=!0,""!==this.breadcrumbbarModule.searchObj.element.value&&(this.breadcrumbbarModule.searchObj.element.value=""),hZe(this,HYe)},y$e.prototype.getSelectedFiles=function(){return this.notify(BXe,{}),this.itemData},y$e.prototype.openFile=function(e){this.notify(FXe,{action:"openFile",id:e})},y$e.prototype.refreshFiles=function(){rJe(this)},y$e.prototype.refreshLayout=function(){this.adjustHeight(),this.notify(ZYe,{})},y$e.prototype.selectAll=function(){this.notify(FXe,{action:"selectAll"})},y$e.prototype.traverseBackward=function(){var e;1<this.pathNames.length&&""===this.breadcrumbbarModule.searchObj.element.value&&!this.isFiltered&&(this.pathId.pop(),this.pathNames.pop(),e=this.pathNames.slice(1).join("/"),this.setProperties({path:e=""===e?"/":"/"+e+"/"},!0),aZe(this,GYe,this.path),e=this.pathId[this.pathId.length-1],this.notify(AXe,{module:"treeview",selectedNode:e}))},y$e.prototype.clearSelection=function(){this.notify(FXe,{action:"clearSelection"})},y$e.prototype.renameFile=function(e,t){this.notify(FXe,{action:"renameFile",id:e,newName:t})},y$e.prototype.uploadFiles=function(){var e=[aJe(this)];this.itemData=e,nZe(this)},y$e.prototype.closeDialog=function(){oZe(this)},y$e.prototype.setRtl=function(e){e?this.addCssClass(null,MYe):this.addCssClass(MYe,null),this.uploadObj&&(this.uploadDialogObj.enableRtl=e,this.uploadObj.enableRtl=e)},jee([t({},k$)],y$e.prototype,"ajaxSettings",void 0),jee([e([])],y$e.prototype,"fileSystemData",void 0),jee([e(!1)],y$e.prototype,"allowDragAndDrop",void 0),jee([e(!0)],y$e.prototype,"allowMultiSelection",void 0),jee([e(!0)],y$e.prototype,"showItemCheckBoxes",void 0),jee([t({},_$)],y$e.prototype,"contextMenuSettings",void 0),jee([e("")],y$e.prototype,"cssClass",void 0),jee([t({},aN)],y$e.prototype,"detailsViewSettings",void 0),jee([e(!0)],y$e.prototype,"enableHtmlSanitizer",void 0),jee([e(!1)],y$e.prototype,"enablePersistence",void 0),jee([e(!1)],y$e.prototype,"enableVirtualization",void 0),jee([e("400px")],y$e.prototype,"height",void 0),jee([e("LargeIcons")],y$e.prototype,"view",void 0),jee([t({},H$)],y$e.prototype,"navigationPaneSettings",void 0),jee([e("/")],y$e.prototype,"path",void 0),jee([e(null)],y$e.prototype,"popupTarget",void 0),jee([t({},P2)],y$e.prototype,"searchSettings",void 0),jee([e()],y$e.prototype,"selectedItems",void 0),jee([e(!0)],y$e.prototype,"showFileExtension",void 0),jee([e(null)],y$e.prototype,"rootAliasName",void 0),jee([e(!1)],y$e.prototype,"showHiddenItems",void 0),jee([e(!0)],y$e.prototype,"showThumbnail",void 0),jee([e("Ascending")],y$e.prototype,"sortOrder",void 0),jee([e("name")],y$e.prototype,"sortBy",void 0),jee([e(null)],y$e.prototype,"sortComparer",void 0),jee([e(!1)],y$e.prototype,"enableRangeSelection",void 0),jee([t({},z$)],y$e.prototype,"toolbarSettings",void 0),jee([kt([],Ode)],y$e.prototype,"toolbarItems",void 0),jee([t({},mJ)],y$e.prototype,"uploadSettings",void 0),jee([e("100%")],y$e.prototype,"width",void 0),jee([i()],y$e.prototype,"fileLoad",void 0),jee([i()],y$e.prototype,"fileOpen",void 0),jee([i()],y$e.prototype,"beforeDownload",void 0),jee([i()],y$e.prototype,"beforeImageLoad",void 0),jee([i()],y$e.prototype,"beforePopupClose",void 0),jee([i()],y$e.prototype,"beforePopupOpen",void 0),jee([i()],y$e.prototype,"beforeSend",void 0),jee([i()],y$e.prototype,"created",void 0),jee([i()],y$e.prototype,"beforeFolderCreate",void 0),jee([i()],y$e.prototype,"folderCreate",void 0),jee([i()],y$e.prototype,"destroyed",void 0),jee([i()],y$e.prototype,"beforeDelete",void 0),jee([i()],y$e.prototype,"delete",void 0),jee([i()],y$e.prototype,"beforeRename",void 0),jee([i()],y$e.prototype,"rename",void 0),jee([i()],y$e.prototype,"beforeMove",void 0),jee([i()],y$e.prototype,"move",void 0),jee([i()],y$e.prototype,"search",void 0),jee([i()],y$e.prototype,"fileDragStart",void 0),jee([i()],y$e.prototype,"fileDragging",void 0),jee([i()],y$e.prototype,"fileDragStop",void 0),jee([i()],y$e.prototype,"fileDropped",void 0),jee([i()],y$e.prototype,"fileSelection",void 0),jee([i()],y$e.prototype,"fileSelect",void 0),jee([i()],y$e.prototype,"menuClick",void 0),jee([i()],y$e.prototype,"menuOpen",void 0),jee([i()],y$e.prototype,"menuClose",void 0),jee([i()],y$e.prototype,"failure",void 0),jee([i()],y$e.prototype,"popupClose",void 0),jee([i()],y$e.prototype,"popupOpen",void 0),jee([i()],y$e.prototype,"success",void 0),jee([i()],y$e.prototype,"toolbarClick",void 0),jee([i()],y$e.prototype,"toolbarCreate",void 0),jee([i()],y$e.prototype,"uploadListCreate",void 0),m$e=jee([Bt],y$e));function y$e(e,t){var i=g$e.call(this,e,t)||this;return i.filterData=null,i.selectedNodes=[],i.duplicateItems=[],i.duplicateRecords=[],i.previousPath=[],i.nextPath=[],i.existingFileCount=0,i.isLayoutChange=!1,i.layoutSelectedItems=[],i.renamedId=null,i.uploadItem=[],i.deleteRecords=[],i.isFile=!1,i.isCut=!1,i.isSearchCut=!1,i.isSearchDrag=!1,i.isPasteError=!1,i.folderPath="",i.isSameAction=!1,i.isFiltered=!1,i.isSortByClicked=!1,i.enablePaste=!1,i.persistData=!1,i.retryArgs=[],i.isOpened=!1,i.isRetryOpened=!1,i.isPathDrag=!1,i.searchedItems=[],i.retryFiles=[],i.isApplySame=!1,i.dragData=[],i.dragNodes=[],i.dragPath="",i.dropPath="",i.isDragDrop=!1,i.treeExpandTimer=null,i.dragCursorPosition={left:44,top:18},i.isDropEnd=!1,i.dragCount=0,i.droppedObjects=[],i.uploadingCount=0,i.uploadedCount=0,i.isMac=!1,i.dragSelectedItems=[],i.onScrollHandler=function(){je(i.contextmenuModule)||je(i.contextmenuModule.contextMenu)||i.contextmenuModule.contextMenu.close()},m$e.Inject(l$e,s$e,d$e),i}b$e.prototype.render=function(){var t=this,e=(this.items=this.toolbarItemData(this.getItems(this.parent.toolbarSettings.items.map(function(e){return e.trim()}))),{items:this.items});this.parent.trigger("toolbarCreate",e,function(e){t.items=e.items,t.toolbarObj=new U3({items:t.items,created:t.toolbarCreateHandler.bind(t),overflowMode:"Popup",clicked:t.onClicked.bind(t),enableHtmlSanitizer:t.parent.enableHtmlSanitizer,enableRtl:t.parent.enableRtl}),t.toolbarObj.isStringTemplate=!0,t.toolbarObj.root=t.parent.root||t.parent,t.toolbarObj.appendTo("#"+t.parent.element.id+nGe)})},b$e.prototype.getItemIndex=function(e){for(var t=this.getId(e),i=0;i<this.items.length;i++)if(this.items[i].id===t)return i;return-1},b$e.prototype.getItems=function(e){e=e.slice();return this.parent.isDevice&&this.parent.allowMultiSelection&&e.push("SelectAll"),e=0<this.parent.toolbarItems.length?this.parent.toolbarItems.map(function(e){return e.name}):e},b$e.prototype.onClicked=function(n){var o,r,e,s=this;!je(n.item)&&n.item.id&&("refresh"===(o=n.item.id.substr((this.parent.element.id+"_tb_").length))||"newfolder"===o||"upload"===o?(r=[aJe(this.parent)],this.parent.itemData=r):(this.parent.notify(yXe,{}),r=this.parent.itemData),e={cancel:!1,fileDetails:r,item:n.item},this.parent.trigger("toolbarClick",e,function(e){var t;if(!e.cancel)switch(o){case"sortby":(t=z(n.originalEvent.target,"."+MGe))&&t.classList.contains("e-toolbar-popup")&&(n.cancel=!0);break;case"newfolder":iZe(s.parent);break;case"cut":hJe(s.parent);break;case"copy":lJe(s.parent);break;case"delete":for(var i=0;i<r.length;i++)if(!ZJe(r[i]))return void XJe(s.parent,r[i],RXe);HZe(s.parent,"Delete");break;case"details":s.parent.notify(dXe,{}),t=s.parent.selectedItems,"navigationpane"===s.parent.activeModule&&(t=[]),uZe(s.parent,t,s.parent.path,"details");break;case"paste":s.parent.folderPath="",TJe(s.parent);break;case"refresh":rJe(s.parent);break;case"download":qJe(s.parent);break;case"rename":ZJe(r[0])?(s.parent.notify(cXe,{}),HZe(s.parent,"Rename")):XJe(s.parent,r[0],RXe);break;case"upload":nZe(s.parent);break;case"selectall":s.parent.notify(oXe,{});break;case"selection":s.parent.notify(rXe,{})}}))},b$e.prototype.toolbarCreateHandler=function(){for(var e,n=this,i=(je(ge("#"+this.getId("SortBy"),this.parent.element))||(e=[{id:this.getPupupId("name"),text:wJe(this.parent,"Name"),iconCss:"name"===this.parent.sortBy?LGe:""},{id:this.getPupupId("size"),text:wJe(this.parent,"Size"),iconCss:"size"===this.parent.sortBy?LGe:""},{id:this.getPupupId("date"),text:wJe(this.parent,"DateModified"),iconCss:"_fm_modified"===this.parent.sortBy?LGe:""},{separator:!0},{id:this.getPupupId("ascending"),text:wJe(this.parent,"Ascending"),iconCss:"Ascending"===this.parent.sortOrder?FGe:""},{id:this.getPupupId("descending"),text:wJe(this.parent,"Descending"),iconCss:"Descending"===this.parent.sortOrder?FGe:""},{id:this.getPupupId("none"),text:wJe(this.parent,"None"),iconCss:"None"===this.parent.sortOrder?FGe:""}],this.buttonObj=new u2({items:e,cssClass:CJe(this.parent,CGe),select:SJe.bind(this,this.parent),enableHtmlSanitizer:this.parent.enableHtmlSanitizer,enableRtl:this.parent.enableRtl,iconCss:bYe}),this.buttonObj.isStringTemplate=!0,this.buttonObj.appendTo("#"+this.getId("SortBy"))),je(ge("#"+this.getId("View"),this.parent.element))||(e=[{id:this.getPupupId("large"),text:wJe(this.parent,"View-LargeIcons"),iconCss:"Details"===this.parent.view?"":FGe},{id:this.getPupupId("details"),text:wJe(this.parent,"View-Details"),iconCss:"Details"===this.parent.view?FGe:""}],this.layoutBtnObj=new u2({iconCss:"Details"===this.parent.view?AYe:xYe,cssClass:CJe(this.parent,"e-caret-hide "+CGe),items:e,select:this.layoutChange.bind(this),enableRtl:this.parent.enableRtl,content:'<span class="e-tbar-btn-text">'+wJe(this.parent,"View")+"</span>",beforeItemRender:function(e){var t=e.item.iconCss,i=e.item.text===wJe(n.parent,"View-LargeIcons"),t=(e.element.innerHTML='<span class="'+(t?" e-menu-icon "+t:"")+'"></span>'+(i?'<span class="e-icons e-fe-large e-menu-icon"></span>':'<span class="e-icons e-fe-grid e-menu-icon"></span>')+e.item.text,e.element.firstChild);t&&""===t.className&&e.element.removeChild(t)}}),this.layoutBtnObj.isStringTemplate=!0,this.layoutBtnObj.appendTo("#"+this.getId("View"))),this.hideItems(this.default,!0),this.hideStatus(),this.parent.portals&&this.toolbarObj.portals&&(this.parent.portals=this.parent.portals.concat(this.toolbarObj.portals),this.parent.renderReactTemplates()),ct(".e-btn",this.toolbarObj.element)),t=0;t<i.length;t++)!function(t){i[t].onkeydown=function(e){13!==e.keyCode||e.target.classList.contains("e-fe-popup")||e.preventDefault()},i[t].onkeyup=function(e){13!==e.keyCode||e.target.classList.contains("e-fe-popup")||i[t].click()}}(t);this.parent.refreshLayout()},b$e.prototype.updateSortByButton=function(){if(this.buttonObj)for(var e=this.buttonObj.items,t=0;t<e.length;t++)e[t].id===this.getPupupId("name")?e[t].iconCss="name"===this.parent.sortBy?LGe:"":e[t].id===this.getPupupId("size")?e[t].iconCss="size"===this.parent.sortBy?LGe:"":e[t].id===this.getPupupId("date")?"dateModified"===this.parent.sortBy||"dateCreated"===this.parent.sortBy?e[t].iconCss=this.parent.sortBy==this.parent.sortBy?LGe:"":e[t].iconCss="_fm_modified"===this.parent.sortBy?LGe:"":e[t].id===this.getPupupId("ascending")?e[t].iconCss="Ascending"===this.parent.sortOrder?FGe:"":e[t].id===this.getPupupId("descending")?e[t].iconCss="Descending"===this.parent.sortOrder?FGe:"":e[t].id===this.getPupupId("none")&&(e[t].iconCss="None"===this.parent.sortOrder?FGe:"")},b$e.prototype.getPupupId=function(e){return this.parent.element.id+"_ddl_"+e.toLowerCase()},b$e.prototype.layoutChange=function(e){"Details"===this.parent.view?e.item.id===this.getPupupId("large")&&nJe(this.parent,"LargeIcons"):e.item.id===this.getPupupId("details")&&nJe(this.parent,"Details")},b$e.prototype.toolbarItemData=function(e){var t=[],i="Both";this.parent.isMobile&&(i="Overflow");for(var n=0;n<e.length;n++){var o,r=void 0,s=void 0,a=(0<this.parent.toolbarItems.length&&(s=this.getItemModel(this.parent.toolbarItems[parseInt(n.toString(),10)])),this.getId(e[n])),l=wJe(this.parent,e[n]),h=wJe(this.parent,"Tooltip-"+e[n]);switch(e[n]){case"|":r={type:"Separator"};break;case"Upload":r={id:a,text:l,tooltipText:h,prefixIcon:pYe,showTextOn:i};break;case"SortBy":var d='<span class="e-tbar-btn-text e-tbar-ddb-text">'+l+"</span>",r={id:a,tooltipText:h,template:'<button id="'+a+'" class="e-tbar-btn e-tbtn-txt" tabindex="-1">'+(d=s&&s.text?'<span class="e-tbar-btn-text e-tbar-ddb-text">'+s.text+"</span>":d)+"</button>"};break;case"Refresh":r={id:a,text:l,tooltipText:h,prefixIcon:wYe,showTextOn:i};break;case"Selection":r={id:a,text:l,tooltipText:h,suffixIcon:TYe,overflow:"Show",align:"Right"};break;case"View":d=void 0,d=s&&s.text?s.text:wJe(this.parent,"View");r={id:a,tooltipText:h,prefixIcon:"Details"===this.parent.view?AYe:xYe,overflow:"Show",align:"Right",text:l,showTextOn:"Overflow",template:'<button id="'+a+'" class="e-tbar-btn e-tbtn-txt" tabindex="-1" aria-label='+d+"></button>"};break;case"Details":r={id:a,tooltipText:h,prefixIcon:vYe,overflow:"Show",align:"Right",text:l,showTextOn:"Overflow"};break;case"NewFolder":r={id:a,text:l,tooltipText:h,prefixIcon:yYe,showTextOn:i};break;case"Cut":r={id:a,text:l,tooltipText:h,prefixIcon:cYe,showTextOn:i};break;case"Copy":r={id:a,text:l,tooltipText:h,prefixIcon:uYe,showTextOn:i};break;case"Paste":r={id:a,text:l,tooltipText:h,prefixIcon:gYe,showTextOn:i};break;case"Delete":r={id:a,text:l,tooltipText:h,prefixIcon:mYe,showTextOn:i};break;case"Rename":r={id:a,text:l,tooltipText:h,prefixIcon:fYe,showTextOn:i};break;case"Download":r={id:a,text:l,tooltipText:h,prefixIcon:SYe,showTextOn:i};break;case"SelectAll":r={id:a,text:l,tooltipText:h,prefixIcon:CYe,showTextOn:i};break;default:r={id:a,text:l,tooltipText:h,template:""}}0<this.parent.toolbarItems.length&&s?(o=Object.assign({},r,s),t.push(o)):t.push(r)}return t},b$e.prototype.getItemModel=function(e){var t={};return e.id&&(t.id=e.id),e.text&&(t.text=e.text),e.tooltipText&&(t.tooltipText=e.tooltipText),e.prefixIcon&&(t.prefixIcon=e.prefixIcon),e.cssClass&&(t.cssClass=e.cssClass),"Both"!==e.showTextOn&&(t.showTextOn=e.showTextOn),e.template&&(t.template=e.template),e.disabled&&(t.disabled=e.disabled),"auto"!==e.width&&(t.width=e.width),e.suffixIcon&&(t.suffixIcon=e.suffixIcon),"Left"!==e.align&&(t.align=e.align),"None"!==e.overflow&&(t.overflow=e.overflow),e.htmlAttributes&&(t.htmlAttributes=e.htmlAttributes),"Button"!==e.type&&(t.type=e.type),!0!==e.visible&&(t.visible=e.visible),e.showAlwaysInPopup&&(t.showAlwaysInPopup=e.showAlwaysInPopup),-1!==e.tabIndex&&(t.tabIndex=e.tabIndex),t},b$e.prototype.getId=function(e){return this.parent.element.id+"_tb_"+e.toLowerCase()},b$e.prototype.addEventListener=function(){this.parent.on(OYe,this.onPropertyChanged,this),this.parent.on(nXe,this.onSelectionChanged,this),this.parent.on(aXe,this.onLayoutChange,this),this.parent.on(mXe,this.showPaste,this),this.parent.on(fXe,this.hidePaste,this),this.parent.on(YYe,this.destroy,this),this.parent.on(lXe,this.updateSortByButton,this)},b$e.prototype.reRenderToolbar=function(e){var t=this,i=[];0<this.parent.toolbarItems.length?i=this.parent.toolbarItems.map(function(e){return e.name}):void 0!==e.newProp.toolbarSettings.items&&(i=e.newProp.toolbarSettings.items.map(function(e){return e.trim()})),0<i.length&&(this.items=this.toolbarItemData(this.getItems(i)),e={items:this.items},this.parent.trigger("toolbarCreate",e,function(e){t.buttonObj&&t.buttonObj.destroy(),t.layoutBtnObj&&t.layoutBtnObj.destroy(),t.items=e.items,t.toolbarObj.items=t.items,t.toolbarObj.dataBind(),t.toolbarCreateHandler()}))},b$e.prototype.onSelectionChanged=function(){this.hideStatus(),this.hideItems(this.single,!0),this.hideItems(this.selection,!1),1===this.parent.selectedItems.length?(this.hideItems(this.single,!1),this.hideItems(this.selection,!0)):1<this.parent.selectedItems.length&&(this.hideItems(this.multiple,!1),this.hideItems(this.selection,!0));var e,t=ge("#"+this.getId("Selection"),this.toolbarObj.element);0<this.parent.selectedItems.length&&t&&!this.parent.enableVirtualization&&(e=void 0,e=1===this.parent.selectedItems.length?this.parent.selectedItems.length+" "+wJe(this.parent,"Item-Selection"):this.parent.selectedItems.length+" "+wJe(this.parent,"Items-Selection"),ge(".e-tbar-btn-text",t).textContent=e,this.toolbarObj.hideItem(t.parentElement,!1))},b$e.prototype.hideItems=function(e,t){for(var i=0;i<e.length;i++){var n=ge("#"+this.getId(e[i]),this.parent.element);n&&this.toolbarObj.hideItem(n.parentElement,t)}},b$e.prototype.hideStatus=function(){var e=ge("#"+this.getId("Selection"),this.toolbarObj.element);e&&this.toolbarObj.hideItem(e.parentElement,!0)},b$e.prototype.showPaste=function(){this.hideItems(["Paste"],!1)},b$e.prototype.hidePaste=function(){this.hideItems(["Paste"],!0)},b$e.prototype.onLayoutChange=function(){if(this.layoutBtnObj){this.layoutBtnObj.iconCss="Details"===this.parent.view?AYe:xYe;for(var e=this.layoutBtnObj.items,t=0;t<e.length;t++)e[t].id===this.getPupupId("large")?e[t].iconCss="LargeIcons"===this.parent.view?FGe:"":e[t].id===this.getPupupId("details")&&(e[t].iconCss="Details"===this.parent.view?FGe:"")}},b$e.prototype.removeEventListener=function(){this.parent.off(OYe,this.onPropertyChanged),this.parent.off(nXe,this.onSelectionChanged),this.parent.off(aXe,this.onLayoutChange),this.parent.off(mXe,this.showPaste),this.parent.off(fXe,this.hidePaste),this.parent.off(YYe,this.destroy),this.parent.off(lXe,this.updateSortByButton)},b$e.prototype.getModuleName=function(){return"toolbar"},b$e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var t=0,i=Object.keys(e.newProp);t<i.length;t++)switch(i[t]){case"cssClass":this.buttonObj&&(this.buttonObj.cssClass=CJe(this.parent,CGe)),this.layoutBtnObj&&(this.layoutBtnObj.cssClass=CJe(this.parent,"e-caret-hide "+CGe));break;case"height":case"width":this.toolbarObj.refreshOverflow();break;case"toolbarSettings":case"toolbarItems":this.reRenderToolbar(e)}},b$e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.buttonObj&&this.buttonObj.destroy(),this.layoutBtnObj&&this.layoutBtnObj.destroy(),this.toolbarObj.destroy(),this.parent.refreshLayout())},b$e.prototype.enableItems=function(e,t){for(var i=0;i<e.length;i++){var n=ge("#"+this.getId(e[i]),this.parent.element);n&&this.toolbarObj.enableItems(n.parentElement,t)}};var v$e=b$e;function b$e(e){this.default=["Delete","Rename","Download","Cut","Copy","Paste"],this.single=["Delete","Rename","Download","Cut","Copy"],this.multiple=["Delete","Download","Cut","Copy","Refresh"],this.selection=["NewFolder","Upload","SortBy","Refresh"],this.parent=e,this.render(),this.addEventListener()}w$e.prototype.setUIVirtualization=function(){var e=this.largeIconInstance.items,t=e.slice(0,1),t=X_.createListFromJson(Q,t,this.largeIconInstance.listObj);this.itemList=Array.prototype.slice.call(ct("."+kGe,t)),this.largeIconInstance.element.appendChild(t),0!==this.itemList.length&&this.largeIconInstance.element.querySelector("."+QGe)&&this.largeIconInstance.element.removeChild(this.largeIconInstance.element.querySelector("."+QGe)),this.itemCount=this.getItemCount(Object.keys(this.largeIconInstance.allItems).length),this.largeIconInstance.element.firstChild.remove(),this.largeIconInstance.items=e.slice(0,this.itemCount)},w$e.prototype.setUlElementHeight=function(){this.lastRowCount=(this.largeIconInstance.allItems.length-this.itemCount)%this.rowItemCount?(this.largeIconInstance.allItems.length-this.itemCount)%this.rowItemCount:this.rowItemCount,this.topElement=this.filemanagerInstance.createElement("div"),this.topElement.classList.add("e-virtual-top"),this.largeIconInstance.element.firstElementChild.insertBefore(this.topElement,this.largeIconInstance.element.firstElementChild.firstChild),this.bottomElement=this.filemanagerInstance.createElement("div"),this.bottomElement.classList.add("e-virtual-bottom"),this.largeIconInstance.element.firstElementChild.insertBefore(this.bottomElement,null);var e=parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue("margin-top"),10)+parseInt(window.getComputedStyle(this.largeIconInstance.itemList[0]).getPropertyValue("margin-bottom"),10);this.listItemHeight=this.largeIconInstance.itemList[0].getBoundingClientRect().height+e,this.totalHeight=Object.keys(this.largeIconInstance.allItems).length/this.rowItemCount*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.renderedCount=this.itemCount},w$e.prototype.getItemCount=function(e){var t=parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue("margin-right"),10)+parseInt(window.getComputedStyle(this.itemList[0]).getPropertyValue("margin-left"),10),t=(this.rowItemCount=Math.floor(parseFloat(T(this.largeIconInstance.element.firstElementChild.clientWidth))/(this.itemList[0].offsetWidth+t)),this.rowItemCount*Math.round(parseFloat(T(this.largeIconInstance.element.clientHeight))/this.itemList[0].offsetHeight));return t=e<t||0===t?e:t},w$e.prototype.wireScrollEvent=function(e){e?E.remove(this.largeIconInstance.element.firstElementChild,"scroll",this.onVirtualUiScroll):E.add(this.largeIconInstance.element.firstElementChild,"scroll",this.onVirtualUiScroll,this)},w$e.prototype.onVirtualUiScroll=function(){this.scrollPosition=je(this.scrollPosition)?0:this.scrollPosition;var e,t,i=this.getscrollerHeight(0);this.topElementHeight=this.listItemHeight*Math.floor(i/this.listItemHeight),this.bottomElementHeight=this.totalHeight-this.topElementHeight,e=i<=this.totalHeight?[this.topElementHeight,this.bottomElementHeight]:[this.totalHeight,0],this.topElementHeight=e[0],this.bottomElementHeight=e[1],this.topElementHeight!==parseFloat(this.topElement.style.height)&&(this.topElement.style.height=this.topElementHeight+"px",this.bottomElement.style.height=this.bottomElementHeight+"px",i>this.scrollPosition?(t=Math.round(this.topElementHeight/this.listItemHeight-this.listDiff),this.onNormalScroll(t,!0)):(t=Math.round(this.listDiff-this.topElementHeight/this.listItemHeight),this.onNormalScroll(t,!1))),this.listDiff=Math.round(this.topElementHeight/this.listItemHeight),this.scrollPosition=i,this.largeIconInstance.itemList=Array.prototype.slice.call(ct("."+kGe,this.largeIconInstance.element)),this.itemCount=this.itemCount!==this.largeIconInstance.itemList.length?this.largeIconInstance.itemList.length:this.itemCount,this.largeIconInstance.items=this.largeIconInstance.allItems.slice(this.renderedCount-this.itemCount,this.renderedCount)},w$e.prototype.getscrollerHeight=function(e){return this.largeIconInstance.element.firstElementChild.scrollTop-e<=0?0:this.largeIconInstance.element.firstElementChild.scrollTop-e},w$e.prototype.onNormalScroll=function(e,t){for(var i=0;i<e;i++)this.updateUI(t)},w$e.prototype.updateUI=function(e){var t=this;if(e){if(this.items=this.largeIconInstance.allItems.slice(this.renderedCount,this.renderedCount+this.rowItemCount),0<this.items.length){var i=X_.createListFromJson(Q,this.items,this.largeIconInstance.listObj);this.itemList=Array.prototype.slice.call(ct("."+kGe,i)),this.itemList.forEach(function(e){t.largeIconInstance.element.firstElementChild.insertBefore(e,t.bottomElement)}),this.renderedCount=this.largeIconInstance.allItems.length>=this.renderedCount+this.rowItemCount?this.renderedCount+this.rowItemCount:this.renderedCount+this.lastRowCount;for(var n=0;n<this.rowItemCount;n++)G(this.topElement.nextElementSibling)}}else{var e=void 0,o=void 0,r=(this.renderedCount===this.largeIconInstance.allItems.length?(e=this.renderedCount-(this.itemCount-this.rowItemCount+this.lastRowCount),this.renderedCount=this.renderedCount-this.lastRowCount<this.itemCount?this.itemCount:this.renderedCount-this.lastRowCount,o=!0):(e=this.renderedCount-this.itemCount,this.renderedCount=this.renderedCount-this.rowItemCount<this.itemCount?this.itemCount:this.renderedCount-this.rowItemCount),0<e-this.rowItemCount?e-this.rowItemCount:0);if(this.items=this.largeIconInstance.allItems.slice(r,e),0<this.items.length){i=X_.createListFromJson(Q,this.items,this.largeIconInstance.listObj);this.itemList=Array.prototype.slice.call(ct("."+kGe,i));for(var s=this.itemList.length;0<s;s--)this.largeIconInstance.element.firstElementChild.insertBefore(this.itemList[s-1],this.topElement.nextElementSibling);for(n=0;n<(o?this.lastRowCount:this.rowItemCount);n++)G(this.bottomElement.previousElementSibling)}}},w$e.prototype.getModuleName=function(){return"virtualization"},w$e.prototype.destroy=function(){this.filemanagerInstance.isDestroyed||je(this.largeIconInstance.element.firstElementChild)||this.wireScrollEvent(!0)};gRe=w$e;function w$e(e){this.filemanagerInstance=e,this.largeIconInstance=e.largeiconsviewModule}S$e.prototype.onInit=function(){var e,t,i;je(this.treeObj)&&(x("_fm_icon","e-fe-folder",e=R(this.parent.pathId[0],this.parent.feParent)),t={},je(i=R("id",e))||x("data-id",i,t),ZJe(e)||x("class",KJe(e),t),je(t)||x("_fm_htmlAttr",t,e),this.treeObj=new PW({fields:{dataSource:[e],id:"_fm_id",parentID:"_fm_pId",expanded:"_fm_expanded",selected:"_fm_selected",text:"name",hasChildren:"hasChild",iconCss:"_fm_icon",htmlAttributes:"_fm_htmlAttr",tooltip:"name"},enableHtmlSanitizer:this.parent.enableHtmlSanitizer,sortOrder:this.parent.navigationPaneSettings.sortOrder,nodeSelecting:this.onNodeSelecting.bind(this),nodeSelected:this.onNodeSelected.bind(this),nodeExpanding:this.onNodeExpand.bind(this),nodeClicked:this.onNodeClicked.bind(this),allowEditing:!0,nodeEditing:this.onNodeEditing.bind(this),drawNode:this.onDrowNode.bind(this),enableRtl:this.parent.enableRtl,dataBound:this.addDragDrop.bind(this)}),this.treeObj.isStringTemplate=!0,this.treeObj.appendTo("#"+this.parent.element.id+sGe),this.wireEvents())},S$e.prototype.addDragDrop=function(){var t=this;!this.parent.isMobile&&this.treeObj&&(this.parent.allowDragAndDrop&&je(this.dragObj)?this.dragObj=new hn(this.treeObj.element,{cursorAt:this.parent.dragCursorPosition,dragTarget:"."+PYe,distance:5,dragArea:this.parent.element,drag:zJe.bind(this,this.parent),dragStart:function(e){OJe(t.parent,e,t.dragObj)},dragStop:RJe.bind(this,this.parent),enableTailMode:!0,enableAutoScroll:!1,helper:this.dragHelper.bind(this)}):!this.parent.allowDragAndDrop&&this.dragObj&&(this.dragObj.destroy(),this.dragObj=null))},S$e.prototype.dragHelper=function(e){var e=e.sender.target;return e.classList.contains(PYe)?(e=z(e,"li"),this.parent.dragPath="",this.parent.dragData=[],this.parent.activeElements=[],this.parent.activeElements=[e],this.parent.dragNodes=[],eJe(this.parent,e),this.parent.dragData=this.getTreeData(e),this.parent.dragPath=this.getDragPath(e,this.parent.dragData[0].name),this.parent.dragNodes.push(this.parent.dragData[0].name),LJe(this.parent),this.parent.virtualDragElement):null},S$e.prototype.getDragPath=function(e,t){return MJe(this.getDropPath(e,t))},S$e.prototype.getDropPath=function(e,t){var i=e.getAttribute("data-id");return UKe(e,this.parent.hasId?i:t,this.parent.hasId)},S$e.prototype.onDrowNode=function(e){e={element:e.node,fileDetails:e.nodeData,module:"NavigationPane"};this.parent.trigger("fileLoad",e)},S$e.prototype.addChild=function(e,t,i){var n=yJe(e),e=this.getTreeData(t);if(0<n.length&&0<e.length&&(null==n[0].filterPath||je(e[0])&&null==e[0].filterPath||n[0].filterPath!==e[0].filterPath)){for(var o=0,r=n;o<n.length;){r[parseInt(o.toString(),10)]._fm_icon="e-fe-folder";var s={},a=R("id",r[o]);je(a)||x("data-id",a,s),ZJe(r[o])||x("class",KJe(r[o]),s),je(s)||x("_fm_htmlAttr",s,r[o]),o++}e=ge('[data-uid="'+t+'"]',this.treeObj.element);je(ge("ul",e))&&this.treeObj.addNodes(n,t,null,i)}},S$e.prototype.onNodeSelecting=function(e){var t,i,n;(e.isInteracted||this.isRightClick||this.isSameNodeClicked||this.isPathDragged||this.isRenameParent)&&!this.restrictSelecting?this.renameParent||(this.parent.activeModule="navigationpane",t=this.getTreeData(R("id",e.nodeData)),e.node.getAttribute("data-uid")!==this.parent.pathId[this.parent.pathId.length-1]&&!this.isRightClick&&!this.isNodeClickCalled||this.isSameNodeClicked||this.isPathDragged?(this.isNodeClickCalled=!1,this.isSameNodeClicked||(this.isSameNodeClicked=!0,n={action:e.action,fileDetails:t[0],isInteracted:e.isInteracted},this.parent.trigger("fileSelect",n)),this.isRightClick||(i={cancel:!1,fileDetails:t[0],module:"NavigationPane"},this.parent.trigger("fileOpen",i),e.cancel=i.cancel),e.cancel&&(this.restrictSelecting=!!this.isNodeClickCalled&&this.previousSelected[0]!==e.node.getAttribute("data-uid"),this.isNodeClickCalled=!0,this.isSameNodeClicked=!1,this.isPathDragged=!1,this.previousSelected=this.treeObj.selectedNodes,this.treeObj.setProperties({selectedNodes:[e.node.getAttribute("data-uid")]}))):this.previousSelected[0]!==e.node.getAttribute("data-uid")&&(n={action:e.action,fileDetails:t[0],isInteracted:this.isNodeClickCalled},this.parent.trigger("fileSelect",n))):(this.restrictSelecting=!1,this.isNodeClickCalled=!1)},S$e.prototype.openFileOnContextMenuClick=function(e){var t=this.treeObj.getTreeData(e),t=(this.parent.selectedItems=[],this.parent.itemData=t,this.activeNode=e,{cancel:!(this.parent.activeModule="navigationpane"),fileDetails:t[0],module:"NavigationPane"});this.parent.trigger("fileOpen",t),this.isNodeClickCalled=!0,t.cancel||(QKe(e,this.parent.itemData[0],this.parent),aZe(this.parent,this.isPathDragged?wXe:GYe,this.parent.path),this.parent.visitedItem=e,this.isPathDragged=this.isRenameParent=this.isRightClick=!1,this.treeObj.setProperties({selectedNodes:[e.getAttribute("data-uid")]}))},S$e.prototype.onNodeSelected=function(e){var t;this.parent.breadcrumbbarModule&&this.parent.breadcrumbbarModule.searchObj&&!this.renameParent&&(this.parent.breadcrumbbarModule.searchObj.element.value="",this.parent.isFiltered=!1,this.isNodeClickCalled=!1),this.parent.searchedItems=[],e.isInteracted||this.isRightClick||this.isSameNodeClicked||this.isPathDragged||this.isRenameParent?(this.activeNode=e.node,this.parent.activeModule="navigationpane",t=this.getTreeData(R("id",e.nodeData)),this.parent.selectedItems=[],this.parent.itemData=t,t=this.parent.path,!this.isRightClick&&this.isSameNodeClicked?QKe(e.node,this.parent.itemData[0],this.parent):(this.parent.pathId=qKe(e.node),this.parent.visitedItem=e.node),e.node.querySelector("."+EYe)&&null===e.node.querySelector("."+kGe)&&(this.expandNodeTarget="add"),t!==this.parent.path&&(!this.isRightClick&&this.isSameNodeClicked&&aZe(this.parent,this.isPathDragged?wXe:GYe,this.parent.path),this.parent.visitedItem=e.node),this.isPathDragged=this.isRenameParent=this.isRightClick=this.isSameNodeClicked=!1):this.parent.pathId=qKe(e.node)},S$e.prototype.onPathDrag=function(e){this.isPathDragged=!0,this.selectResultNode(e[0])},S$e.prototype.onNodeExpand=function(e){var t,i,n;(e.isInteracted||this.isDrag)&&null===e.node.querySelector("."+kGe)&&(this.isNodeExpandCalled=!0,i=R("text",e.nodeData),t=!je(n=e.node.getAttribute("data-id")),i=je(n)?i:n,n=UKe(e.node,i,t),this.expandNodeTarget=e.node.getAttribute("data-uid"),this.parent.expandedId=this.expandNodeTarget,this.parent.itemData=this.getTreeData(R("id",e.nodeData)),this.parent.pathId.push(R("id",e.nodeData)),aZe(this.parent,hXe,n))},S$e.prototype.onNodeExpanded=function(e){this.addChild(e.files,this.expandNodeTarget,!1),this.parent.expandedId=null,this.isNodeExpandCalled=!1},S$e.prototype.onNodeClicked=function(e){var t;this.parent.activeModule="navigationpane",this.previousSelected=this.treeObj.selectedNodes,this.activeNode=e.node,3===e.event.which&&e.node.getAttribute("data-uid")!==this.treeObj.selectedNodes[0]?(this.isRightClick=!0,this.isNodeClickCalled=!0,this.treeObj.setProperties({selectedNodes:[e.node.getAttribute("data-uid")]})):e.node.getAttribute("data-uid")===this.treeObj.selectedNodes[0]&&0!==this.parent.selectedItems.length?(this.parent.setProperties({selectedItems:[]},!0),t="LargeIcons"===this.parent.view?"largeiconsview":"detailsview",this.parent.notify(OYe,{module:t,newProp:{selectedItems:[]}})):e.node.getAttribute("data-uid")!==this.treeObj.selectedNodes[0]||this.isNodeClickCalled||this.isNodeExpandCalled||(3===e.event.which&&(this.isRightClick=!0),this.isSameNodeClicked=!0,this.isNodeClickCalled=!0)},S$e.prototype.onNodeEditing=function(e){je(e.innerHtml)||(e.cancel=!0)},S$e.prototype.onPathChanged=function(e){this.parent.isCut=!1;var t,i=R(this.parent.pathId[this.parent.pathId.length-1],this.parent.feFiles);"add"===this.expandNodeTarget&&(t=je(t=ge('[data-uid="'+this.treeObj.selectedNodes[0]+'"]',this.treeObj.element))?null:ge("."+BGe,t),je(t)&&this.addChild(e.files,this.treeObj.selectedNodes[0],!0),this.expandNodeTarget=""),je(i)&&x(this.parent.pathId[this.parent.pathId.length-1],e.files,this.parent.feFiles),this.parent.uploadObj.directoryUpload&&!this.parent.hasId&&this.updateTree(e)},S$e.prototype.updateTree=function(e){var t;this.treeObj&&(t=this.treeObj.selectedNodes[0],this.updateTreeNode(e,t))},S$e.prototype.updateTreeNode=function(e,t){var i=-1!==this.treeObj.expandedNodes.indexOf(t);this.removeChildNodes(t),this.addChild(e.files,t,!i)},S$e.prototype.removeChildNodes=function(e){e=ge('[data-uid="'+e+'"]',this.treeObj.element),e=ge("."+BGe,e),e=e?Array.prototype.slice.call(e.children):null;e&&this.treeObj.removeNodes(e)},S$e.prototype.onOpenEnd=function(e){var t=this.parent.pathId[this.parent.pathId.length-1];this.treeObj.expandAll(this.treeObj.selectedNodes),this.treeObj.setProperties({selectedNodes:[t]}),this.expandNodeTarget="add",this.onPathChanged(e)},S$e.prototype.onOpenInit=function(e){"navigationpane"===this.parent.activeModule&&e.target.querySelector("."+EYe)&&this.treeObj.expandAll(this.treeObj.selectedNodes)},S$e.prototype.onInitialEnd=function(e){this.onInit(),this.addChild(e.files,R("_fm_id",e.cwd),!1)},S$e.prototype.onFinalizeEnd=function(e){this.onInit();var t=R("_fm_id",e.cwd);this.addChild(e.files,t,!1),this.treeObj.setProperties({selectedNodes:[this.parent.pathId[this.parent.pathId.length-1]]})},S$e.prototype.onCreateEnd=function(e){this.updateTree(e)},S$e.prototype.onSelectedData=function(){"navigationpane"===this.parent.activeModule&&this.updateItemData()},S$e.prototype.onDeleteInit=function(){var e;"navigationpane"===this.parent.activeModule&&(this.updateActionData(),e=R("name",this.parent.itemData[0]),cZe(this.parent,[e],this.parent.path,"delete"))},S$e.prototype.onDeleteEnd=function(e){var t;"navigationpane"===this.parent.activeModule&&(t=z(ge('[data-uid="'+this.treeObj.selectedNodes[0]+'"]',this.treeObj.element),"."+BGe).parentElement,this.treeObj.selectedNodes=[t.getAttribute("data-uid")],this.treeObj.dataBind()),this.updateTree(e)},S$e.prototype.onRefreshEnd=function(e){this.updateTree(e)},S$e.prototype.onRenameInit=function(){"navigationpane"===this.parent.activeModule&&this.updateRenameData()},S$e.prototype.onRenameEndParent=function(e){var t,i=this.renameParent||this.parent.pathId[this.parent.pathId.length-1];this.updateTreeNode(e,i),this.parent.expandedId=null,this.renameParent?this.renameParent=null:(e=[],this.parent.hasId?e=new me(this.treeObj.getTreeData()).executeLocal((new ya).where("id","equal",this.parent.renamedId,!1)):0<(t=new me(this.treeObj.getTreeData()).executeLocal((new ya).where(this.treeObj.fields.text,"equal",this.parent.renameText,!1))).length&&(e=new me(t).executeLocal((new ya).where("_fm_pId","equal",i,!1))),0<e.length&&(t=0<this.previousSelected.length&&0!==this.treeObj.getTreeData(this.previousSelected[0]).length?this.previousSelected[0]:R(this.treeObj.fields.id,e[0]),this.treeObj.selectedNodes=[t],this.treeObj.dataBind(),this.updateItemData()))},S$e.prototype.onRenameEnd=function(e){var t,i;""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered?(i=this.treeObj.getTreeData(),t=[],this.parent.hasId?t=new me(i).executeLocal((new ya).where("id","equal",this.parent.renamedId,!1)):0<(i=new me(i).executeLocal((new ya).where(this.treeObj.fields.text,"equal",this.parent.currentItemText,!1))).length&&(t=new me(i).executeLocal((new ya).where("filterPath","equal",this.parent.filterPath,!1))),0<t.length&&(this.renameParent=R(this.treeObj.fields.parentID,t[0]),this.parent.expandedId=this.renameParent,this.parent.itemData=this.getTreeData(this.renameParent),aZe(this.parent,uXe,this.parent.filterPath.replace(/\\/g,"/")))):this.updateTree(e)},S$e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var t=0,i=Object.keys(e.newProp);t<i.length;t++)switch(i[t]){case"allowDragAndDrop":this.addDragDrop();break;case"navigationPaneSettings":aZe(this.parent,VYe,this.parent.path),e.oldProp.navigationPaneSettings.sortOrder!==e.newProp.navigationPaneSettings.sortOrder&&(this.treeObj.sortOrder=e.newProp.navigationPaneSettings.sortOrder)}},S$e.prototype.onDownLoadInit=function(){this.doDownload()},S$e.prototype.onSelectionChanged=function(e){this.treeObj.setProperties({selectedNodes:[e.selectedNode]})},S$e.prototype.onClearPathInit=function(e){this.removeChildNodes(e.selectedNode)},S$e.prototype.onDragEnd=function(e){if(gZe(this.parent)){this.moveNames=[];for(var t=this.parent.dragData,i=0;i<t.length;i++)!1===R("isFile",t[i])&&this.moveNames.push(R("_fm_id",t[i]))}var n=[],n=this.parent.isPasteError||this.parent.isSearchDrag?this.getMoveNames(e.files,this.parent.isSearchDrag,this.parent.dragPath):this.moveNames;this.treeObj.removeNodes(n)},S$e.prototype.getMoveNames=function(e,t,i){for(var n=[],o=0;o<e.length;o++)if(!e[o].isFile&&!this.parent.hasId)for(var r,s=e[o].previousName,a=(t&&(r=(i+=e[o].previousName).lastIndexOf("/"),s=i.substring(r+1),i=i.substring(0,r+1)),new me(this.treeObj.getTreeData()).executeLocal((new ya).where(this.treeObj.fields.text,"equal",s,!1))),l=0;l<a.length;l++)if(R("filterPath",a[l]).replace(/\\/g,"/")===i){n.push(R(this.treeObj.fields.id,a[l]));break}return n},S$e.prototype.onCutEnd=function(e){var t=[];this.parent.isPasteError||this.parent.isSearchCut?this.moveNames=this.getMoveNames(e.files,this.parent.isSearchCut,this.parent.targetPath):t=this.moveNames,this.treeObj.removeNodes(t)},S$e.prototype.selectResultNode=function(t){var e,i;this.parent.hasId?(i=this.treeObj.getTreeData().filter(function(e){return e.name===t.name})[0],this.treeObj.selectedNodes=[R("_fm_id",i)],this.treeObj.dataBind()):(i=R("filterPath",t),e=R("name",t),0<(e=new me(this.treeObj.getTreeData()).executeLocal((new ya).where(this.treeObj.fields.text,"equal",e,!1))).length&&0<(e=new me(e).executeLocal((new ya).where("filterPath","equal",i,!1))).length&&(i=R(this.treeObj.fields.id,e[0]),this.treeObj.selectedNodes=[i],this.treeObj.dataBind()))},S$e.prototype.onDropPath=function(e){this.onpasteEnd(e),this.selectResultNode(this.parent.dropData),this.parent.isDropEnd=!this.parent.isPasteError},S$e.prototype.onpasteEnd=function(e){var t,i=[];this.parent.hasId?i=new me(this.treeObj.getTreeData()).executeLocal((new ya).where("id","equal",R("id",e.cwd),!1)):0<(t=new me(this.treeObj.getTreeData()).executeLocal((new ya).where(this.treeObj.fields.text,"equal",R("name",e.cwd),!1))).length&&(i=new me(t).executeLocal((new ya).where("filterPath","equal",R("filterPath",e.cwd),!1))),0<i.length&&(t=R(this.treeObj.fields.id,i[0]),i=-1===this.treeObj.expandedNodes.indexOf(t),this.removeChildNodes(t),this.addChild(e.files,t,i)),this.parent.expandedId=null,this.onPathChanged(e),this.parent.isDragDrop&&this.checkDropPath(e)},S$e.prototype.checkDropPath=function(e){gZe(this.parent)&&(this.parent.path===this.parent.dropPath||"navigationpane"===this.parent.targetModule)||(-1===this.parent.dropPath.indexOf(kJe(this.parent,e))?(this.parent.isDropEnd=!1,BJe(this.parent)):this.parent.isDropEnd=!this.parent.isPasteError)},S$e.prototype.onpasteInit=function(){this.parent.activeModule===this.getModuleName()&&this.updateItemData(),this.moveNames=[];for(var e=this.parent.isDragDrop?this.parent.dragData:this.parent.actionRecords,t=0;t<e.length;t++)!1===R("isFile",e[t])&&this.moveNames.push(R("_fm_id",e[t]))},S$e.prototype.oncutCopyInit=function(){this.parent.activeModule===this.getModuleName()&&(this.parent.activeRecords=this.getTreeData(this.treeObj.selectedNodes[0]),this.parent.activeElements=[this.activeNode])},S$e.prototype.addEventListener=function(){this.parent.on(OYe,this.onPropertyChanged,this),this.parent.on(EXe,this.onDownLoadInit,this),this.parent.on(NYe,this.onInitialEnd,this),this.parent.on(VYe,this.onFinalizeEnd,this),this.parent.on(GYe,this.onPathChanged,this),this.parent.on(wXe,this.onpasteEnd,this),this.parent.on(CXe,this.onCutEnd,this),this.parent.on(bXe,this.onpasteInit,this),this.parent.on(hXe,this.onNodeExpanded,this),this.parent.on(_Ye,this.onCreateEnd,this),this.parent.on(yXe,this.onSelectedData,this),this.parent.on(jYe,this.onDeleteInit,this),this.parent.on(WYe,this.onDeleteEnd,this),this.parent.on(QYe,this.onRefreshEnd,this),this.parent.on(AXe,this.onSelectionChanged,this),this.parent.on(tXe,this.onOpenInit,this),this.parent.on(iXe,this.onOpenEnd,this),this.parent.on(YYe,this.destroy,this),this.parent.on(cXe,this.onRenameInit,this),this.parent.on(gXe,this.onRenameEnd,this),this.parent.on(uXe,this.onRenameEndParent,this),this.parent.on(sXe,this.onClearPathInit,this),this.parent.on(vXe,this.oncutCopyInit,this),this.parent.on(DXe,this.onDropInit,this),this.parent.on(pXe,this.onMenuItemData,this),this.parent.on(MXe,this.onDragEnd,this),this.parent.on(PXe,this.onDragging,this),this.parent.on(kXe,this.onDropPath,this),this.parent.on(dXe,this.onDetailsInit,this),this.parent.on(zYe,this.onPathDrag,this)},S$e.prototype.removeEventListener=function(){this.parent.off(NYe,this.onInitialEnd),this.parent.off(EXe,this.onDownLoadInit),this.parent.off(VYe,this.onFinalizeEnd),this.parent.off(yXe,this.onSelectedData),this.parent.off(OYe,this.onPropertyChanged),this.parent.off(GYe,this.onPathChanged),this.parent.off(wXe,this.onpasteEnd),this.parent.off(CXe,this.onCutEnd),this.parent.off(bXe,this.onpasteInit),this.parent.off(AXe,this.onSelectionChanged),this.parent.off(hXe,this.onNodeExpanded),this.parent.off(_Ye,this.onCreateEnd),this.parent.off(QYe,this.onRefreshEnd),this.parent.off(tXe,this.onOpenInit),this.parent.off(iXe,this.onOpenEnd),this.parent.off(YYe,this.destroy),this.parent.off(cXe,this.onRenameInit),this.parent.off(gXe,this.onRenameEnd),this.parent.off(uXe,this.onRenameEndParent),this.parent.off(sXe,this.onClearPathInit),this.parent.off(jYe,this.onDeleteInit),this.parent.off(WYe,this.onDeleteEnd),this.parent.off(vXe,this.oncutCopyInit),this.parent.off(DXe,this.onDropInit),this.parent.off(MXe,this.onDragEnd),this.parent.off(PXe,this.onDragging),this.parent.off(kXe,this.onDropPath),this.parent.off(dXe,this.onDetailsInit),this.parent.off(pXe,this.onMenuItemData),this.parent.off(zYe,this.onPathDrag)},S$e.prototype.onDetailsInit=function(){var e;this.parent.activeModule===this.getModuleName()&&(e=this.getTreeData(this.treeObj.selectedNodes[0]),this.parent.itemData=e)},S$e.prototype.onMenuItemData=function(e){this.parent.activeModule===this.getModuleName()&&(e=z(e.target,"li"),this.parent.itemData=this.getTreeData(e.getAttribute("data-uid")))},S$e.prototype.onDragging=function(e){var t,e=z(e.target,"li");e.classList.contains("e-node-collapsed")&&(this.isDrag=!0,t=parseInt(e.getAttribute("aria-level"),10),this.treeObj.expandAll([e.getAttribute("data-uid")],t+1),this.isDrag=!1)},S$e.prototype.onDropInit=function(e){this.parent.targetModule===this.getModuleName()&&(e=z(e.target,"li"),this.parent.dropData=this.getTreeData(e)[0],this.parent.dropPath=this.getDropPath(e,R("name",this.parent.dropData)))},S$e.prototype.getModuleName=function(){return"navigationpane"},S$e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.treeObj&&(this.unWireEvents(),this.treeObj.destroy()))},S$e.prototype.wireEvents=function(){this.keyboardModule=new bn(this.treeObj.element,{keyAction:this.keyDown.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},S$e.prototype.unWireEvents=function(){this.keyboardModule.destroy()},S$e.prototype.keyDown=function(e){var t;switch(e.action){case"altEnter":this.parent.notify(dXe,{}),uZe(this.parent,[],this.parent.path,"details");break;case"esc":KKe(this.parent);break;case"del":this.parent.pathId[0]!==this.activeNode.getAttribute("data-uid")&&(this.updateItemData(),ZJe(this.parent.itemData[0])?(this.removeNodes=[],HZe(this.parent,"Delete")):XJe(this.parent,this.parent.itemData[0],RXe));break;case"ctrlC":lJe(this.parent);break;case"ctrlV":this.parent.folderPath="",TJe(this.parent);break;case"ctrlX":hJe(this.parent);break;case"shiftF10":this.updateItemData(),tZe(this.parent.itemData[0])?0!==this.parent.selectedItems.length&&this.doDownload():XJe(this.parent,this.parent.itemData[0],VXe);break;case"f2":0===this.parent.selectedItems.length&&(ZJe(t=this.getTreeData(this.treeObj.selectedNodes[0])[0])?(this.updateRenameData(),HZe(this.parent,"Rename")):XJe(this.parent,t,RXe))}},S$e.prototype.getTreeData=function(e){for(var t=this.treeObj.getTreeData(e),i=0;i<t.length;i++)je(R("hasChild",t[i]))&&x("hasChild",!1,t[i]);return t},S$e.prototype.updateRenameData=function(){this.updateItemData(),this.parent.currentItemText=R("name",this.parent.itemData[0])},S$e.prototype.updateItemData=function(){var e=this.getTreeData(this.treeObj.selectedNodes[0])[0];this.parent.itemData=[e],this.parent.isFile=!1},S$e.prototype.updateActionData=function(){this.updateItemData();QKe(ge('[data-uid="'+this.parent.pathId[this.parent.pathId.length-1]+'"]',this.treeObj.element),this.parent.itemData[0],this.parent);var e=MJe(this.parent.path);this.parent.setProperties({path:e},!0),this.parent.pathId.pop(),this.parent.pathNames.pop()},S$e.prototype.doDownload=function(){var e=MJe(this.parent.path),t=this.treeObj.selectedNodes[0]===this.parent.pathId[0]?"":R("name",this.parent.itemData[0]);VZe(this.parent,e,[t])};var C$e=S$e;function S$e(e){this.removeNodes=[],this.moveNames=[],this.previousSelected=[],this.isDrag=!1,this.isPathDragged=!1,this.isRenameParent=!1,this.isRightClick=!1,this.isSameNodeClicked=!1,this.isNodeExpandCalled=!1,this.renameParent=null,this.isNodeClickCalled=!1,this.restrictSelecting=!1,this.parent=e,this.addEventListener(),this.keyConfigs={altEnter:"alt+enter",esc:"escape",del:"delete",ctrlX:this.parent.isMac?"cmd+x":"ctrl+x",ctrlC:this.parent.isMac?"cmd+c":"ctrl+c",ctrlV:this.parent.isMac?"cmd+v":"ctrl+v",ctrlShiftN:"ctrl+shift+n",shiftF10:"shift+F10",f2:"f2"}}x$e.prototype.render=function(e){var t,i,n,o,r=this;this.parent.enablePersistence&&!je(t=window.localStorage.getItem("grid"+this.parent.element.id+"_grid"))&&!je(t=JSON.parse(t))&&0<Object.keys(t).length&&"sortSettings"in t&&(delete t.sortSettings,window.localStorage.setItem("grid"+this.parent.element.id+"_grid",JSON.stringify(t))),kA(this.parent.element),"Details"===this.parent.view&&(q([this.parent.element],xGe),t=gJe(this.parent,e.files),this.checkNameWidth(),n=void 0,o=!je(i=this.getColumns())&&-1!==i.findIndex(function(e){return e.field===r.parent.sortBy}),this.parent.isMobile||!o?n=[]:"None"!==this.parent.sortOrder&&(n=[{direction:this.parent.sortOrder,field:this.parent.sortBy}]),this.gridObj=new IP({dataSource:t,allowSorting:!0,rowSelecting:this.onSelection.bind(this,"select"),rowDeselecting:this.onSelection.bind(this,"unselect"),rowSelected:this.onSelected.bind(this),rowDeselected:this.onDeSelection.bind(this),allowResizing:this.parent.detailsViewSettings.columnResizing,selectionSettings:{type:this.parent.allowMultiSelection?"Multiple":"Single",checkboxMode:"ResetOnRowClick"},enableRtl:this.parent.enableRtl,pageSettings:{pageSize:20},enableVirtualization:this.parent.enableVirtualization,enablePersistence:this.parent.enablePersistence,enableVirtualMaskRow:!0,sortSettings:{allowUnsort:!1,columns:n},columns:i,recordDoubleClick:this.DblClickEvents.bind(this),beforeDataBound:this.onBeforeDataBound.bind(this),dataBound:this.onDataBound.bind(this),rowDataBound:this.onRowDataBound.bind(this),actionBegin:this.onActionBegin.bind(this),headerCellInfo:this.onHeaderCellInfo.bind(this),width:"100%",height:this.parent.enableVirtualization?this.getGridHeight():"auto",beforeCopy:function(e){e.cancel=!0},load:function(){this.focusModule.destroy()},locale:this.parent.locale}),this.parent.isReact&&(this.gridObj.isReact=!0,this.gridObj.portals=[],this.gridObj.on("reactTemplateRender",this.reactTemplateRender,this)),this.gridObj.isStringTemplate=!0,this.gridObj.appendTo("#"+this.parent.element.id+aGe),0!==this.parent.selectedItems.length&&this.parent.enableVirtualization&&this.parent.enablePersistence&&(this.isLoaded=!0),this.wireEvents(),this.adjustHeight(),this.emptyArgs=e)},x$e.prototype.reactTemplateRender=function(e){this.parent.portals=e,this.parent.portals&&this.parent.toolbarModule&&this.parent.toolbarModule.toolbarObj&&this.parent.toolbarModule.toolbarObj.portals&&(this.parent.portals=this.parent.portals.concat(this.parent.toolbarModule.toolbarObj.portals)),this.parent.notify("renderReactTemplate",this.parent.portals),this.parent.renderReactTemplates()},x$e.prototype.getGridHeight=function(){var e=ge("#"+this.parent.element.id+gGe,this.parent.element),t=ge("#"+this.parent.element.id+mGe,this.parent.element);return e.offsetHeight-t.offsetHeight-36},x$e.prototype.checkNameWidth=function(){var e=this.parent.detailsViewSettings.columns;this.isNameWidth=!1;for(var t=0;t<e.length;t++)if("name"===e[t].field)return void(this.isNameWidth=!je(e[t].width))},x$e.prototype.adjustWidth=function(e,t){if(!this.isNameWidth||"name"!==t)for(var i,n=0;n<e.length;n++)e[n].field===t&&(i=void 0,i=""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered?this.element.clientWidth<=680?"name"===t?"120px":"180px":"auto":this.element.clientWidth<=500?"120px":"auto",e[n].width=i)},x$e.prototype.getColumns=function(){var i,n=this.parent.enableHtmlSanitizer;if(this.parent.isMobile)i=[{field:"name",headerText:wJe(this.parent,"Name"),width:"auto",minWidth:120,headerTextAlign:"Left",template:ao(function(e){return'<div class="e-fe-text">'+(n?go.sanitize(e.name):e.name)+'</div><div class="e-fe-date">'+e._fm_modified+'</div><span class="e-fe-size">'+e.size+"</span>"})}];else{i=Pe([],this.parent.detailsViewSettings.columns,null,!0),this.adjustWidth(i,"name");for(var o=this,e=0,t=i.length;e<t;e++)!function(e){var t;i[e].headerText=wJe(o.parent,i[e].headerText),"name"!==i[e].field||je(i[e].template)||"function"==typeof i[e].template||(t=i[e].template,i[e].template=ao(function(e){e=n?go.sanitize(e.name):e.name;return t.replace(/\${name}/g,e)}))}(e)}var r=this.parent.isMobile||this.parent.isBigger?"54":"46",r={field:"type",width:r,minWidth:r,template:ao(function(e){return'<span class="e-fe-icon '+e._fm_iconClass+'"></span>'}),allowResizing:!1,allowSorting:!0,customAttributes:{class:"e-fe-grid-icon"},headerTemplate:ao(function(){return"<span class='e-fe-icon e-fe-folder'></span>"})};i.unshift(r),this.parent.showItemCheckBoxes&&(r={type:"checkbox",width:r=this.parent.isBigger?"36":"26",minWidth:r,customAttributes:{class:"e-fe-checkbox"},allowResizing:!1,allowSorting:!1},this.parent.isMobile?i.push(r):i.unshift(r));for(e=0,t=i.length;e<t;e++)i[e].disableHtmlEncode=!this.parent.enableHtmlSanitizer;return this.parent.enableRangeSelection&&i.push({field:"name",visible:!1,customAttributes:{class:"e-drag-text"}}),i},x$e.prototype.adjustHeight=function(){var e,t,i;this.gridObj&&(i=ge("#"+this.parent.element.id+gGe,this.parent.element),e=ge("#"+this.parent.element.id+mGe,this.parent.element),t=ge("."+iYe,this.parent.element),i=i.offsetHeight-e.offsetHeight-t.offsetHeight,this.gridObj.height=i,this.gridObj.dataBind())},x$e.prototype.renderCheckBox=function(){this.gridObj.columns=this.getColumns(),this.isColumnRefresh=!0,this.gridObj.refreshColumns()},x$e.prototype.onRowDataBound=function(e){var t=ge(".e-fe-grid-name",e.row);if(!t)for(var i=this.parent.detailsViewSettings.columns,n=0;n<i.length;n++)if("name"===i[n].field){t=e.row.children[this.parent.allowMultiSelection?n+2:n+1];break}if(t&&t.setAttribute("title",R("name",e.data)),this.parent.isLayoutChange&&this.parent.isCut&&"move"===this.parent.fileAction&&this.parent.selectedNodes&&0!==this.parent.selectedNodes.length&&-1!==this.parent.selectedNodes.indexOf(R("name",e.data))&&ZKe(e.row),!this.parent.showFileExtension&&R("isFile",e.data)&&(o=R("name",e.data),o=e.row.querySelector('[title= "'+o+'"]'))&&(r=R("name",e.data),s=R("type",e.data),-1!==r.indexOf(s))&&(o.innerHTML=r.substr(0,r.length-s.length)),void 0!==R("size",e.data)&&e.row.querySelector(".e-fe-size")){var o=e.row.querySelector(".e-fe-size"),r=void 0;if(R("isFile",e.data)){for(var s=R("size",e.data),a=new Ti(this.parent.locale),l=void 0,i=this.parent.detailsViewSettings.columns,n=0;n<i.length;n++)if("size"===i[n].field){l=je(i[n].format)?"n":i[n].format.toString();break}r=a.formatNumber(s/1024,{format:l})+" "+wJe(this.parent,"KB")}else r="";o.innerHTML=r}if(this.parent.isMobile&&void 0!==R("_fm_modified",e.data)&&e.row.querySelector(".e-fe-date")){for(var s=e.row.querySelector(".e-fe-date"),a=new Ti(this.parent.locale),i=this.parent.detailsViewSettings.columns,h=void 0,n=0;n<i.length;n++)if("dateModified"===i[n].field){h=i[n].format;break}o=a.formatDate(new Date(R("_fm_modified",e.data)),h);s.innerHTML=o}r=e.row.querySelector("."+jGe),r&&r.classList.add("e-small"),ZJe(e.data)||(e.row.className+=" "+KJe(e.data)),a={element:e.row,fileDetails:e.data,module:"DetailsView"};this.parent.trigger("fileLoad",a)},x$e.prototype.onActionBegin=function(e){if("sorting"===e.requestType){if(this.parent.setProperties({sortOrder:e.direction},!0),this.parent.setProperties({sortBy:e.columnName},!0),0!==this.parent.selectedItems.length){this.sortItem=!0;var t=this.gridObj.getSelectedRowIndexes(),i=t.length;for(this.sortSelectedNodes=[];0<i;){var n=this.gridObj.getRowsObject()[t[i-1]].data;this.sortSelectedNodes.push(R(this.parent.hasId?"id":"name",n)),i--}}this.parent.notify(lXe,{})}},x$e.prototype.onHeaderCellInfo=function(e){e=e.node.querySelector("."+jGe);e&&e.classList.add("e-small")},x$e.prototype.onBeforeDataBound=function(e){var t=this,i=(kA(this.parent.element),this.parent.detailsViewSettings.columns.find(function(e){return e.field===t.parent.sortBy}));!i||"sortComparer"in i||(i=gJe(this.parent,this.parent.enableVirtualization?e.result:this.gridObj.dataSource),e.result=i)},x$e.prototype.onDataBound=function(){var e,t;this.createDragObj(),(0!==this.parent.selectedItems.length&&!this.parent.enableVirtualization||this.isLoaded)&&this.selectRecords(this.parent.selectedItems),!0===this.isPasteOperation&&!je(this.gridObj.getDataRows())&&0<this.gridObj.getDataRows().length&&(this.isColumnRefresh?this.isColumnRefresh=!1:(this.selectRecords(this.parent.pasteNodes),this.isPasteOperation=!1)),this.parent.createdItem&&(this.selectRecords([R(this.parent.hasId?"id":"name",this.parent.createdItem)]),this.parent.createdItem=null),this.parent.layoutSelectedItems.length&&this.selectRecords(this.parent.layoutSelectedItems),this.parent.renamedItem&&(this.addSelection(this.parent.renamedItem),this.parent.renamedItem=null),!0===this.sortItem&&(this.selectRecords(this.sortSelectedNodes),this.sortItem=!1),this.isSelectionUpdate&&(this.isColumnRefresh?this.isColumnRefresh=!1:(this.selectRecords(this.currentSelectedItem),this.isSelectionUpdate=!1)),!0===this.uploadOperation&&(this.count++,this.selectRecords(this.parent.uploadItem),this.count===this.parent.uploadItem.length)&&(this.uploadOperation=!1,this.parent.uploadItem=[]),this.gridObj.currentViewData.length*this.gridObj.getRowHeight()<this.gridObj.height?((e=this.gridObj.getHeaderContent()).style.paddingRight="",e.style.paddingLeft="",ge(".e-headercontent",e).style.borderRightWidth="0",(t=this.gridObj.getContent().querySelector(".e-content")).style.overflowY="",t.classList.add("e-scrollShow")):(e=this.gridObj.getHeaderContent(),this.parent.enableRtl?e.style.paddingLeft="16px":e.style.paddingRight="16px",(t=this.gridObj.getContent().querySelector(".e-content")).classList.remove("e-scrollShow")),this.isRendered=!0,this.parent.isLayoutChange=!1,BA(this.parent.element),this.checkEmptyDiv(this.emptyArgs),this.isInteracted=!!this.isLoaded||this.isInteracted,this.isLoaded=!1},x$e.prototype.selectRecords=function(e){for(var t=this.gridObj.getCurrentViewRecords(),i=[],n=0,o=t.length;n<o;n++){var r=this.parent.hasId?R("id",t[n]):uJe(this.parent,t[n]);-1!==e.indexOf(r)?i.push(n):this.parent.showFileExtension||this.parent.hasId||!r.includes(".")||(r=r.split(".").slice(0,-1).join("."),-1!==e.indexOf(r)&&i.push(n))}0!==i.length&&(this.gridObj.selectRows(i),this.addFocus(this.gridObj.selectedRowIndex))},x$e.prototype.addSelection=function(e){var t=this.gridObj.getCurrentViewRecords(),i=[];this.parent.hasId?i=new me(t).executeLocal((new ya).where("id","equal",this.parent.renamedId,!1)):0<(e=new me(t).executeLocal((new ya).where("name","equal",R("name",e),!1))).length&&(i=new me(e).executeLocal((new ya).where("filterPath","equal",this.parent.filterPath,!1))),0<i.length&&(e=t.indexOf(i[0]),this.gridObj.selectRows([e]))},x$e.prototype.onSortColumn=function(){"None"!==this.parent.sortOrder?this.gridObj.sortModule.sortColumn(this.parent.sortBy,this.parent.sortOrder):this.gridObj.dataSource=gJe(this.parent,this.gridObj.dataSource),0!==this.element.querySelector(".e-content").scrollTop&&this.gridObj.freezeRefresh()},x$e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()||"common"===e.module)for(var t,i=0,n=Object.keys(e.newProp);i<n.length;i++)switch(n[i]){case"allowDragAndDrop":this.createDragObj();break;case"height":this.adjustHeight();break;case"detailsViewSettings":je(this.gridObj)||(this.checkNameWidth(),t=this.getColumns(),this.gridObj.columns=t,this.gridObj.allowResizing=this.parent.detailsViewSettings.columnResizing,this.gridObj.dataBind(),this.gridObj.refreshColumns());break;case"selectedItems":this.interaction=!1,0!==this.parent.selectedItems.length?(this.parent.allowMultiSelection||(t=this.parent.selectedItems.slice(this.parent.selectedItems.length-1),this.parent.setProperties({selectedItems:t},!0)),this.selectRecords(this.parent.selectedItems),this.parent.setProperties({selectedItems:this.parent.selectedItems},!0)):je(this.gridObj)||(this.gridObj.clearSelection(),this.interaction=!0);break;case"showFileExtension":case"showHiddenItems":aZe(this.parent,GYe,this.parent.path);break;case"showItemCheckBoxes":case"allowMultiSelection":je(this.gridObj)||(this.currentSelectedItem=this.parent.selectedItems,this.gridObj.selectionSettings.type=e.newProp.allowMultiSelection?"Multiple":"Single",this.isSelectionUpdate=!0,this.renderCheckBox());break;case"view":nJe(this.parent,"Details");break;case"width":this.onDetailsResize()}},x$e.prototype.onPathChanged=function(e){this.parent.isCut=!1;var t=this.parent.detailsViewSettings.columns.find(function(e){return"filterPath"===e.field});(""===this.parent.breadcrumbbarModule.searchObj.element.value.trim()&&this.gridObj||!je(t)&&!je(t.hideAtMedia)&&""!==t.hideAtMedia)&&(this.parent.searchedItems=[],this.parent.isFiltered?this.updatePathColumn():this.removePathColumn(!1)),$Ke(this.parent),"Details"===this.parent.view&&(this.isInteracted=!1,kA(this.parent.element),this.parent.setProperties({selectedItems:[]},!0),this.gridObj.dataSource=gJe(this.parent,e.files),this.gridObj.freezeRefresh(),this.parent.isReact&&this.gridObj.on("reactTemplateRender",this.reactTemplateRender,this),this.wireClickEvent(!0)),this.emptyArgs=e},x$e.prototype.updatePathColumn=function(){var e=this.gridObj.columns.length,t=JSON.parse(JSON.stringify(this.gridObj.columns));t[e-1].field&&"filterPath"!==t[e-1].field&&!this.parent.isMobile&&(t={field:"filterPath",headerText:wJe(this.parent,"Path"),minWidth:180,width:"auto"},this.gridObj.columns.push(t),this.adjustWidth(this.gridObj.columns,"filterPath"),this.adjustWidth(this.gridObj.columns,"name"),this.isColumnRefresh=!0,this.gridObj.refreshColumns())},x$e.prototype.checkEmptyDiv=function(e){var t=gJe(this.parent,e.files);0!==t.length||je(this.element.querySelector("."+aYe))?0!==t.length&&this.element.querySelector("."+QGe)&&(this.element.querySelector("."+aYe).querySelector("."+QGe)?(t=this.element.querySelector("."+aYe).querySelector("."+QGe),this.element.querySelector("."+aYe).removeChild(t)):this.element.removeChild(this.element.querySelector("."+QGe))):fJe(this.parent,this.element,e)},x$e.prototype.onOpenInit=function(){var e;"detailsview"===this.parent.activeModule&&(e=this.gridObj.getSelectedRecords()[0],this.openContent(e))},x$e.prototype.DblClickEvents=function(e){this.gridObj.selectRows([e.rowIndex]),e.rowData&&(e=JSON.parse(JSON.stringify(e.rowData)),this.openContent(e))},x$e.prototype.openContent=function(i){var n=this;JJe(i)?this.parent.trigger("fileOpen",{cancel:!1,fileDetails:i,module:"DetailsView"},function(e){var t;e.cancel||(e=R("name",i),R("isFile",i)?dJe(i)===JGe&&(t=pJe(n.parent,i),o$e(n.parent,e,t)):(""!==n.parent.breadcrumbbarModule.searchObj.element.value||n.parent.isFiltered?IJe(n.parent,i):(t=R("id",i),n.parent.oldPath=n.parent.path,t=n.parent.path+(je(t)?e:t)+"/",n.parent.setProperties({path:t},!0),n.parent.pathNames.push(e),n.parent.pathId.push(R("_fm_id",i)),n.parent.itemData=[i],sJe(n.parent)),n.parent.isFiltered=!1),n.element.focus(),n.parent.enableVirtualization&&n.parent.element.querySelector("#"+n.parent.element.id+dGe).focus())}):XJe(this.parent,i,LXe)},x$e.prototype.onLayoutChange=function(e){"Details"===this.parent.view&&(this.parent.enableVirtualization&&this.parent.setProperties({selectedItems:[]},!0),this.gridObj?this.isLoaded=!0:this.render(e),this.parent.isFiltered&&(this.updatePathColumn(),this.parent.setProperties({selectedItems:[]},!0)),this.gridObj.dataSource=gJe(this.parent,e.files),this.parent.notify(SXe,{}),this.gridObj.element.classList.remove(kYe),this.isInteracted=!1,this.gridObj.clearSelection(),""!==this.parent.breadcrumbbarModule.searchObj.element.value.trim()&&this.onSearchFiles(e),this.adjustHeight(),0<this.gridObj.sortSettings.columns.length)&&this.gridObj.sortSettings.columns[0].field!==this.parent.sortBy&&"None"!==this.parent.sortOrder&&this.gridObj.sortColumn(this.parent.sortBy,this.parent.sortOrder)},x$e.prototype.onSearchFiles=function(e){"Details"===this.parent.view&&(this.parent.setProperties({selectedItems:[]},!0),this.parent.notify(nXe,{}),this.parent.isLayoutChange||(this.parent.layoutSelectedItems=[]),this.updatePathColumn(),this.parent.searchedItems=e.files,this.onPathChanged(e))},x$e.prototype.removePathColumn=function(e){var t=this.gridObj.columns.length,i=JSON.parse(JSON.stringify(this.gridObj.columns)),n=this.parent.detailsViewSettings.columns.some(function(e){return"filterPath"===e.field});i[t-1].field&&"filterPath"===i[t-1].field&&!n&&(je(this.gridObj.sortSettings.columns[0])||"filterPath"!==this.gridObj.sortSettings.columns[0].field||("None"!==this.parent.sortOrder?this.gridObj.sortColumn("name",this.parent.sortOrder):this.gridObj.dataSource=gJe(this.parent,this.gridObj.dataSource),this.parent.notify(lXe,{})),this.gridObj.columns.pop(),e||(this.isColumnRefresh=!0,this.gridObj.refreshColumns()))},x$e.prototype.onFinalizeEnd=function(e){"Details"===this.parent.view&&(this.gridObj?this.onPathChanged(e):this.render(e))},x$e.prototype.onCreateEnd=function(e){"Details"===this.parent.view&&this.onPathChanged(e)},x$e.prototype.onRenameInit=function(){"detailsview"===this.parent.activeModule&&1===this.parent.selectedItems.length&&this.updateRenameData()},x$e.prototype.onSelectedData=function(){"detailsview"===this.parent.activeModule&&(this.parent.itemData=this.gridObj.getSelectedRecords())},x$e.prototype.onDeleteInit=function(){"detailsview"===this.parent.activeModule&&cZe(this.parent,this.parent.selectedItems,this.parent.path,"delete")},x$e.prototype.onDeleteEnd=function(e){"Details"===this.parent.view&&(this.onPathChanged(e),this.parent.setProperties({selectedItems:[]},!0))},x$e.prototype.onRefreshEnd=function(e){"Details"===this.parent.view&&(this.isInteracted=!1,this.removePathColumn(!1),this.gridObj.dataSource=gJe(this.parent,e.files),this.emptyArgs=e)},x$e.prototype.onHideLayout=function(){"Details"!==this.parent.view&&this.gridObj&&this.gridObj.element.classList.add(kYe)},x$e.prototype.onSelectAllInit=function(){"Details"===this.parent.view&&(this.isInteracted=!1,this.parent.allowMultiSelection?this.gridObj.selectionModule.selectRowsByRange(0,this.gridObj.getRows().length):this.gridObj.selectRow(this.gridObj.getRows().length-1),this.isInteracted=!0,this.interaction=!0)},x$e.prototype.onClearAllInit=function(){"Details"===this.parent.view&&(this.removeSelection(),this.interaction=!0)},x$e.prototype.onSelectionChanged=function(){q([this.element],FYe),0<this.parent.selectedItems.length&&U([this.element],FYe)},x$e.prototype.onLayoutRefresh=function(){"Details"===this.parent.view&&this.adjustHeight()},x$e.prototype.onBeforeRequest=function(){this.isRendered=!1},x$e.prototype.onAfterRequest=function(){this.isRendered=!0},x$e.prototype.onUpdateSelectionData=function(){"Details"===this.parent.view&&(this.parent.itemData=this.gridObj.getSelectedRecords())},x$e.prototype.addEventListener=function(){this.parent.on(VYe,this.onFinalizeEnd,this),this.parent.on(YYe,this.destroy,this),this.parent.on(aXe,this.onLayoutChange,this),this.parent.on(GYe,this.onPathChanged,this),this.parent.on(_Ye,this.onCreateEnd,this),this.parent.on(DXe,this.onDropInit,this),this.parent.on(dXe,this.onDetailsInit,this),this.parent.on(QYe,this.onRefreshEnd,this),this.parent.on(eXe,this.onSearchFiles,this),this.parent.on(FXe,this.onMethodCall,this),this.parent.on($Ye,this.onActionFailure,this),this.parent.on(OYe,this.onPropertyChanged,this),this.parent.on(jYe,this.onDeleteInit,this),this.parent.on(WYe,this.onDeleteEnd,this),this.parent.on(yXe,this.onSelectedData,this),this.parent.on(cXe,this.onRenameInit,this),this.parent.on(gXe,this.onPathChanged,this),this.parent.on(tXe,this.onOpenInit,this),this.parent.on(xXe,this.onSortColumn,this),this.parent.on(iXe,this.onPathChanged,this),this.parent.on(HYe,this.onPathChanged,this),this.parent.on(bXe,this.onPasteInit,this),this.parent.on(SXe,this.onHideLayout,this),this.parent.on(oXe,this.onSelectAllInit,this),this.parent.on(rXe,this.onClearAllInit,this),this.parent.on(IXe,this.onPathColumn,this),this.parent.on(nXe,this.onSelectionChanged,this),this.parent.on(XYe,this.onBeforeRequest,this),this.parent.on(JYe,this.onAfterRequest,this),this.parent.on(wXe,this.onpasteEnd,this),this.parent.on(vXe,this.oncutCopyInit,this),this.parent.on(pXe,this.onMenuItemData,this),this.parent.on(UYe,this.onDetailsResizeHandler,this),this.parent.on(qYe,this.onDetailsResize,this),this.parent.on(ZYe,this.onLayoutRefresh,this),this.parent.on(kXe,this.onDropPath,this),this.parent.on(BXe,this.onUpdateSelectionData,this)},x$e.prototype.removeEventListener=function(){this.parent.off(VYe,this.onFinalizeEnd),this.parent.off(YYe,this.destroy),this.parent.off(aXe,this.onLayoutChange),this.parent.off(GYe,this.onPathChanged),this.parent.off(bXe,this.onPasteInit),this.parent.off(_Ye,this.onCreateEnd),this.parent.off(QYe,this.onRefreshEnd),this.parent.off(eXe,this.onSearchFiles),this.parent.off(FXe,this.onMethodCall),this.parent.off($Ye,this.onActionFailure),this.parent.off(OYe,this.onPropertyChanged),this.parent.off(cXe,this.onRenameInit),this.parent.off(gXe,this.onPathChanged),this.parent.off(HYe,this.onPathChanged),this.parent.off(tXe,this.onOpenInit),this.parent.off(xXe,this.onSortColumn),this.parent.off(iXe,this.onPathChanged),this.parent.off(SXe,this.onHideLayout),this.parent.off(oXe,this.onSelectAllInit),this.parent.off(rXe,this.onClearAllInit),this.parent.off(jYe,this.onDeleteInit),this.parent.off(WYe,this.onDeleteEnd),this.parent.off(IXe,this.onPathColumn),this.parent.off(nXe,this.onSelectionChanged),this.parent.off(XYe,this.onBeforeRequest),this.parent.off(JYe,this.onAfterRequest),this.parent.off(wXe,this.onpasteEnd),this.parent.off(vXe,this.oncutCopyInit),this.parent.off(DXe,this.onDropInit),this.parent.off(yXe,this.onSelectedData),this.parent.off(dXe,this.onDetailsInit),this.parent.off(pXe,this.onMenuItemData),this.parent.off(UYe,this.onDetailsResizeHandler),this.parent.off(qYe,this.onDetailsResize),this.parent.off(ZYe,this.onLayoutRefresh),this.parent.off(kXe,this.onDropPath),this.parent.off(BXe,this.onUpdateSelectionData)},x$e.prototype.onActionFailure=function(){this.interaction=!0},x$e.prototype.onMenuItemData=function(e){this.parent.activeModule===this.getModuleName()&&(this.parent.itemData=[this.gridObj.getRowInfo(e.target).rowData])},x$e.prototype.onPasteInit=function(){this.parent.activeModule===this.getModuleName()&&(this.parent.itemData=""!==this.parent.folderPath?this.gridObj.getSelectedRecords():[aJe(this.parent)])},x$e.prototype.onDetailsInit=function(){this.parent.activeModule===this.getModuleName()&&(0!==this.parent.selectedItems.length?this.parent.itemData=this.gridObj.getSelectedRecords():this.parent.itemData=[R(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent)])},x$e.prototype.dragHelper=function(e){var t,i,e=e.sender.target.closest("tr.e-row");return e?(e.getElementsByClassName("e-fe-text")[0]?t=this.parent.hasId?this.gridObj.getRowInfo(e).rowData.id:e.getElementsByClassName("e-fe-text")[0].innerText:e.getElementsByClassName("e-rowcell e-templatecell")[0].nextElementSibling&&(t=this.parent.hasId?this.gridObj.getRowInfo(e).rowData.id:e.getElementsByClassName("e-rowcell e-templatecell")[0].nextElementSibling.innerText),e&&!e.querySelector(".e-active")&&this.selectRecords([t]),eJe(this.parent,e),this.parent.activeElements=[],this.parent.dragData=[],this.parent.dragData=this.gridObj.getSelectedRecords(),(i=0===this.parent.dragData.length&&e?this.gridObj.getRowInfo(e):i)&&this.parent.dragData.push(i.rowData),this.parent.dragPath=this.parent.path,this.parent.activeElements=this.gridObj.getSelectedRows(),LJe(this.parent),this.parent.virtualDragElement):null},x$e.prototype.onDetailsResize=function(){if("Details"===this.parent.view&&!this.parent.isMobile&&!je(this.gridObj))for(var e=this.gridObj.getHeaderContent().querySelector(".e-headercontent").firstChild.childNodes[0],t=this.gridObj.getContent().querySelector(".e-content .e-table").children[0],i=this.gridObj.getColumns(),n=0;n<i.length;n++)(this.isNameWidth||"name"!==i[n].field)&&"filterPath"!==i[n].field||(""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered?this.element.clientWidth<=680?"name"===i[n].field?(e.children[n].style.width="120px",t.children[n].style.width="120px"):(e.children[n].style.width="180px",t.children[n].style.width="180px"):680<this.element.clientWidth&&(e.children[n].style.width="auto",t.children[n].style.width="auto"):this.element.clientWidth<=500?(e.children[n].style.width="120px",t.children[n].style.width="120px"):500<this.element.clientWidth&&(e.children[n].style.width="auto",t.children[n].style.width="auto"))},x$e.prototype.onDetailsResizeHandler=function(){this.onDetailsResize(),"Details"!==this.parent.view||this.parent.isMobile||je(this.gridObj)||this.adjustHeight()},x$e.prototype.createDragObj=function(){var t=this;this.gridObj&&(this.parent.allowDragAndDrop&&je(this.dragObj)?this.dragObj=new hn(this.gridObj.element,{cursorAt:this.parent.dragCursorPosition,distance:5,enableTailMode:!0,dragArea:this.parent.element,dragTarget:"."+WGe,drag:zJe.bind(this,this.parent),dragStart:function(e){OJe(t.parent,e,t.dragObj)},dragStop:RJe.bind(this,this.parent),enableAutoScroll:!1,helper:this.dragHelper.bind(this)}):!this.parent.allowDragAndDrop&&this.dragObj&&(this.dragObj.destroy(),this.dragObj=null))},x$e.prototype.onDropInit=function(e){var t,i;this.parent.targetModule===this.getModuleName()&&(t=R(this.parent.pathId[this.parent.pathId.length-1],this.parent.feParent),e.target.closest("tr")?(i=null,i=this.gridObj.getRowInfo(e.target).rowData,this.parent.dropPath=i.isFile?this.parent.path:cJe(this.parent,i,this.parent.path),this.parent.dropData=i.isFile?t:i):(this.parent.dropPath=this.parent.path,this.parent.dropData=t))},x$e.prototype.oncutCopyInit=function(){this.parent.activeModule===this.getModuleName()&&(this.parent.activeRecords=this.gridObj.getSelectedRecords(),this.parent.activeElements=this.gridObj.getSelectedRows())},x$e.prototype.onpasteEnd=function(e){"Details"===this.parent.view&&(this.isPasteOperation=!0,this.parent.path!==this.parent.destinationPath&&this.parent.path!==kJe(this.parent,e)&&!this.parent.hasId||this.onPathChanged(e))},x$e.prototype.onDropPath=function(e){"Details"===this.parent.view&&(this.isPasteOperation=!0,this.onPathChanged(e))},x$e.prototype.getModuleName=function(){return"detailsview"},x$e.prototype.destroy=function(){this.parent.isDestroyed||(this.removeEventListener(),this.gridObj&&(this.parent.isReact&&this.gridObj.off("reactTemplateRender",this.reactTemplateRender),this.unWireEvents(),this.gridObj.destroy()))},x$e.prototype.updateType=function(e){e=ge("."+KGe,e);this.parent.isFile=!!je(e)},x$e.prototype.onSelection=function(e,t){var e={action:e,fileDetails:t.data,isInteracted:this.interaction,cancel:!1,target:t.target};this.parent.trigger("fileSelection",e),t.cancel=e.cancel,this.isMultiSelect||(this.isMultiSelect=!0,(t.isShiftPressed||t.isCtrlPressed)&&!this.parent.allowMultiSelection&&t.target&&t.target.parentElement&&!t.target.parentElement.classList.contains("e-checkbox-wrapper")&&(t.cancel=!0,e=t&&t.rowIndexes?t.rowIndexes[t.rowIndexes.length-1]:t.rowIndex,this.gridObj.selectRow(e)),this.isMultiSelect=!1)},x$e.prototype.onSelected=function(e){this.parent.activeModule="detailsview",this.parent.isLayoutChange&&!this.parent.isFiltered||this.selectedRecords(),this.parent.notify(nXe,{}),1===this.gridObj.getSelectedRowIndexes().length&&(this.firstItemIndex=this.gridObj.selectedRowIndex),this.gridObj.element.setAttribute("tabindex","-1"),this.triggerSelect("select",e);var t=this.gridObj.getRowByIndex(this.gridObj.selectedRowIndex),i=(this.updateType(t),je(t)||je(t.querySelector(".e-checkselect"))||(1!==this.gridObj.getSelectedRowIndexes().length&&(o=this.gridObj.getSelectedRowIndexes()[this.gridObj.getSelectedRowIndexes().length-2],je(o=this.gridObj.getRowByIndex(o))||o.querySelector(".e-checkselect").setAttribute("tabindex","-1")),t.querySelector(".e-rowcell.e-fe-checkbox").removeAttribute("tabindex")),je(this.gridObj)||je(this.gridObj.element.querySelector(".e-checkselectall"))||this.gridObj.element.querySelector(".e-checkselectall").setAttribute("tabindex","-1"),this.gridObj.getSelectedRowIndexes());if(!this.parent.allowMultiSelection)for(var n=0;n<i.length;n++)i[n]===this.gridObj.selectedRowIndex?this.gridObj.getRowByIndex(i[n]).setAttribute("tabindex","0"):this.gridObj.getRowByIndex(i[n]).removeAttribute("tabindex");var o=i.length,o=(this.parent.enableVirtualization?this.parent.currentItemText=R("name",e.data):0<o&&(t=this.gridObj.getRowsObject()[i[o-1]].data,this.parent.currentItemText=R("name",t)),R("rowIndexes",e)),t=R("enableSelectMultiTouch",this.gridObj.selectionModule);this.parent.isDevice&&je(o)&&e.target&&!t&&!e.target.closest(".e-headercell")&&(this.parent.isFile=R("isFile",e.data),this.parent.isFile||this.openContent(e.data)),this.parent.visitedItem=e.row,this.parent.enableVirtualization&&e.isHeaderCheckboxClicked||this.addFocus(this.gridObj.selectedRowIndex),this.parent.isLayoutChange||(this.isInteracted=!0)},x$e.prototype.onPathColumn=function(){"Details"!==this.parent.view||je(this.gridObj)||""!==this.parent.breadcrumbbarModule.searchObj.element.value||this.parent.isFiltered||this.removePathColumn(!1)},x$e.prototype.selectedRecords=function(){this.parent.setProperties({selectedItems:[]},!0);for(var e=this.gridSelectNodes(),t=0;t<e.length;){var i=e[t],i=WJe(this.parent,i);this.parent.selectedItems.push(i),t++}this.parent.setProperties({selectedItems:this.parent.selectedItems},!0)},x$e.prototype.onDeSelection=function(e){var t;!this.parent.allowMultiSelection&&je(e.data)?je(t=this.gridObj.getRowByIndex(e.rowIndex))||t.removeAttribute("tabindex"):1<this.gridObj.getSelectedRowIndexes().length&&(t=this.gridObj.getSelectedRowIndexes()[this.gridObj.getSelectedRowIndexes().length-2],je(t=this.gridObj.getRowByIndex(t))||t.querySelector(".e-checkselect").removeAttribute("tabindex")),-1===this.gridObj.selectedRowIndex&&this.gridObj.element.setAttribute("tabindex","0"),this.isInteracted?(this.selectedRecords(),0===this.parent.selectedItems.length&&(x("enableSelectMultiTouch",!1,this.gridObj.selectionModule),q([this.parent.element],xGe)),this.parent.notify(nXe,{}),this.triggerSelect("unselect",e),this.parent.visitedItem=null):this.isInteracted=!0},x$e.prototype.triggerSelect=function(e,t){e={action:e,fileDetails:t.data,isInteracted:this.interaction};this.parent.trigger("fileSelect",e),this.interaction=!0},x$e.prototype.wireEvents=function(){this.wireClickEvent(!0),this.keyboardModule=new bn(this.gridObj.element,{keyAction:this.keyupHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keyup"}),this.keyboardDownModule=new bn(this.element,{keyAction:this.keydownHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),E.add(this.gridObj.element,"blur",this.removeFocus,this),E.add(this.parent.element,"focusout",this.onBlur,this)},x$e.prototype.unWireEvents=function(){this.wireClickEvent(!1),this.keyboardModule.destroy(),this.keyboardDownModule.destroy(),E.remove(this.gridObj.element,"blur",this.removeFocus),E.remove(this.parent.element,"focusout",this.onBlur)},x$e.prototype.wireClickEvent=function(e){var t=this;e?(e=this.gridObj.getContent(),this.clickObj=new Mn(e,{tap:function(e){1===e.tapCount&&e.originalEvent.target.classList.contains("e-content")&&t.onClearAllInit()},tapHold:function(e){t.parent.isDevice&&(e.originalEvent.preventDefault(),t.parent.allowMultiSelection&&(x("enableSelectMultiTouch",t.parent.allowMultiSelection,t.gridObj.selectionModule),U([t.parent.element],xGe)),e=e.originalEvent.target)&&(e=z(e,"."+WGe),e=t.gridObj.getRows().indexOf(e),t.gridObj.selectRow(e))}})):this.clickObj&&this.clickObj.destroy()},x$e.prototype.removeSelection=function(){q([this.parent.element],xGe),this.gridObj.clearSelection(),this.parent.setProperties({selectedItems:[]},!0),this.parent.notify(nXe,{}),-1===this.gridObj.selectedRowIndex&&(this.startIndex=null),this.isInteracted=!0},x$e.prototype.removeFocus=function(){this.addFocus(null)},x$e.prototype.onBlur=function(e){if((null===e.relatedTarget||z(e.relatedTarget,".e-grid")===e.relatedTarget)&&!je(this.gridObj.element))for(var t=this.gridObj.element.querySelectorAll("th"),i=0;i<t.length;i++)t[i].classList.contains("e-focus")&&this.addFocus(null)},x$e.prototype.getFocusedItemIndex=function(){return je(this.getFocusedItem())?null:parseInt(this.getFocusedItem().getAttribute("aria-rowindex"),10)-1},x$e.prototype.keydownHandler=function(e){if(this.isRendered)switch(e.action){case"end":case"home":case"space":case"ctrlSpace":case"shiftSpace":case"csSpace":case"ctrlA":case"enter":case"altEnter":case"ctrlEnd":case"shiftEnd":case"csEnd":case"ctrlHome":case"shiftHome":case"csHome":case"ctrlDown":case"shiftDown":case"csDown":case"ctrlLeft":case"shiftLeft":case"csLeft":case"esc":case"del":case"shiftdel":case"ctrlC":case"ctrlV":case"ctrlX":case"f2":case"moveDown":case"moveUp":case"ctrlD":e.preventDefault()}},x$e.prototype.keyupHandler=function(e){if(this.isRendered){e.preventDefault();var t,i,n,o=e.action,r=gJe(this.parent,this.gridObj.dataSource),s=r.length,a=this.getFocusedItemIndex(),l=this.gridObj.selectedRowIndex,h=this.gridObj.getSelectedRowIndexes();switch(o){case"altEnter":this.parent.notify(dXe,{}),uZe(this.parent,this.parent.selectedItems,this.parent.path,"details");break;case"esc":KKe(this.parent);break;case"del":case"shiftdel":this.performDelete();break;case"enter":-1===this.gridObj.selectedRowIndex&&!0===this.gridObj.allowSorting?e.target.classList.contains("e-fe-grid-icon")||(i=e.target.getElementsByClassName("e-ascending").length?"Descending":"Ascending",t=this.gridObj.getColumnByUid(e.target.querySelector(".e-headercelldiv").getAttribute("e-mappinguid")).field,this.gridObj.sortColumn(t,i),je(this.getFocusedItem().nextSibling))||this.getFocusedItem().nextSibling.setAttribute("tabindex","0"):(t=this.gridObj.getRowsObject()[this.gridObj.selectedRowIndex].data)&&(i=JSON.parse(JSON.stringify(t)),this.openContent(i));break;case"ctrlC":lJe(this.parent);break;case"ctrlV":this.parent.folderPath="",TJe(this.parent);break;case"ctrlX":hJe(this.parent);break;case"ctrlD":this.doDownload();break;case"f2":this.performRename();break;case"ctrlA":!je(r[0])&&this.parent.allowMultiSelection&&(i=(t=this.gridObj.getContent().querySelector(".e-content")).scrollTop,n=this.gridObj.selectedRowIndex,this.gridObj.selectionModule.selectRowsByRange(0,r.length-1),t.scrollTop=i,-1!==n)&&this.addFocus(n);break;case"ctrlHome":case"tab":if(!je(r[0]))if(this.parent.allowMultiSelection||"ctrlHome"!==e.action){if(-1!==this.gridObj.selectedRowIndex&&"tab"===e.action)return;this.addHeaderFocus(e)}else this.gridObj.selectRow(0);break;case"ctrlEnd":je(r[0])||(this.parent.allowMultiSelection?this.addFocus(s-1):this.gridObj.selectRow(s-1));break;case"shiftHome":case"shiftEnd":case"csHome":case"csEnd":this.parent.allowMultiSelection?je(r[0])||(je(l)||-1===l?"csHome"===e.action||"shiftHome"===e.action?this.gridObj.selectRow(0):this.gridObj.selectionModule.selectRowsByRange(0,r.length-1):this.checkRowsKey(r,l,null,e)):this.gridObj.selectRow("shiftHome"===e.action||"csHome"===e.action?0:r.length-1);break;case"space":case"csSpace":case"shiftSpace":case"ctrlSpace":this.spaceSelection(h,a,l,e);break;case"csUp":case"csDown":case"shiftUp":case"shiftDown":this.shiftMoveMethod(r,l,a,h,e);break;case"ctrlUp":case"ctrlDown":this.parent.allowMultiSelection?this.ctrlMoveFunction(r,e,l):this.moveFunction(r,e,l);break;case"home":t=[R(this.parent.hasId?"id":"name",r[0])],this.parent.setProperties({selectedItems:t},!0),this.selectRecords(t);break;case"moveUp":case"moveDown":this.moveFunction(r,e,l);break;case"end":i=[R(this.parent.hasId?"id":"name",r[s-1])],this.parent.setProperties({selectedItems:i},!0),this.selectRecords(i);break;case"back":this.parent.traverseBackward()}}},x$e.prototype.gridSelectNodes=function(){return this.gridObj.getSelectedRecords()},x$e.prototype.doDownload=function(){if(0!==this.parent.selectedItems.length){this.parent.itemData=this.gridObj.getSelectedRecords();for(var e=this.parent.itemData,t=0;t<e.length;t++)if(!tZe(e[t]))return void XJe(this.parent,e[t],VXe);VZe(this.parent,this.parent.path,this.parent.selectedItems)}},x$e.prototype.performDelete=function(){if(this.parent.selectedItems&&0<this.parent.selectedItems.length){this.parent.itemData=this.gridObj.getSelectedRecords();for(var e=this.parent.itemData,t=0;t<e.length;t++)if(!ZJe(e[t]))return void XJe(this.parent,e[t],RXe);HZe(this.parent,"Delete")}},x$e.prototype.performRename=function(){1===this.parent.selectedItems.length&&(this.updateRenameData(),UJe(this.parent))},x$e.prototype.updateRenameData=function(){var e=this.gridSelectNodes()[0];QJe(this.parent,e)},x$e.prototype.shiftMoveMethod=function(e,t,i,n,o){this.parent.allowMultiSelection?-1!==t||"csUp"!==o.action&&"csDown"!==o.action?-1===t||i===t||("csUp"===o.action||"csDown"===o.action)&&this.isSelected(n,i)?this.shiftSelectedItem(t,n,e,o):this.shiftSelectFocusItem(t,i,n,o):this.ctrlMoveFunction(e,o,t):this.moveFunction(e,o,t)},x$e.prototype.moveFunction=function(e,t,i){!je(this.getFocusedItem())&&this.parent.allowMultiSelection?"moveDown"===t.action?this.gridObj.selectRow(this.getFocusedItemIndex()+1):this.gridObj.selectRow(this.getFocusedItemIndex()-1):je(i)||-1===i?je(e[0])||this.gridObj.selectRow(0):"moveDown"===t.action||"ctrlDown"===t.action||"shiftDown"===t.action||"csDown"===t.action?this.gridObj.selectRow(i+(i!==e.length-1?1:0)):this.gridObj.selectRow(i-(0!==i?1:0))},x$e.prototype.spaceSelection=function(e,t,i,n){var o;this.isSelected(e,t)||-1===i||"shiftSpace"!==n.action&&"csSpace"!==n.action?je(this.getFocusedItem())||t===i?-1!==i&&"ctrlSpace"===n.action&&this.parent.allowMultiSelection?(o=i,e.pop(),this.gridObj.selectRows(e),this.addFocus(o)):"shiftSpace"===n.action&&this.gridObj.selectRow(i):(e.push(this.getFocusedItemIndex()),this.gridObj.selectRows(e)):t<i?this.gridObj.selectionModule.selectRowsByRange(t,i):this.gridObj.selectionModule.selectRowsByRange(i,t)},x$e.prototype.ctrlMoveFunction=function(e,t,i){var n;je(this.getFocusedItem())?je(i)||-1===i?je(e[0])||(n=0):n="ctrlDown"===t.action||"csDown"===t.action?i+(i<e.length?1:0):i-(i<1?0:1):(i=this.getFocusedItemIndex(),n="ctrlDown"===t.action||"csDown"===t.action?i+(i<e.length-1?1:0):i-(i<1?0:1)),this.addFocus(n)},x$e.prototype.checkRowsKey=function(e,t,i,n){"Uncheck"===this.gridObj.checkAllRows||"Intermediate"===this.gridObj.checkAllRows?"csHome"!==n.action&&"csEnd"!==n.action?(je(this.startIndex)&&this.firstItemIndex!==t&&(this.firstItemIndex=t),"shiftEnd"===n.action?this.gridObj.selectionModule.selectRowsByRange(this.firstItemIndex,e.length-1):this.gridObj.selectionModule.selectRowsByRange(0,this.firstItemIndex),this.startIndex=t):"csEnd"===n.action?this.gridObj.selectRows(this.InnerItems(je(t)?0:t,je(i)?e.length-1:i,n)):je(t)?this.gridObj.selectRow(0):this.gridObj.selectRows(this.InnerItems(je(i)?0:i,t,n)):this.gridObj.selectionModule.selectRow("shiftHome"===n.action||"csHome"===n.action?0:e.length-1)},x$e.prototype.InnerItems=function(e,t,i){var n=this.gridObj.getSelectedRowIndexes();if("csEnd"===i.action)for(var o=e+1;o<=t;o++)n.push(o);else for(o=t-1;e<=o;o--)n.push(o);return n},x$e.prototype.shiftSelectFocusItem=function(e,t,i,n){t+="shiftDown"===n.action||"csDown"===n.action?1:-1,e=je(this.startIndex)?e:i[0];e===t?this.gridObj.selectRow(e):e<t?"shiftDown"===n.action||"csDown"===n.action?this.gridObj.selectionModule.selectRowsByRange(e,t):this.gridObj.selectionModule.selectRowsByRange(t,e):"shiftDown"===n.action||"csDown"===n.action?this.gridObj.selectionModule.selectRowsByRange(t,e):this.gridObj.selectionModule.selectRowsByRange(e,t),this.startIndex=this.gridObj.selectedRowIndex},x$e.prototype.addFocus=function(e){var t=this.getFocusedItem(),e=this.gridObj.getRowByIndex(e);t&&(t.removeAttribute("tabindex"),q([t],[VGe,_Ge])),je(e)||(this.gridObj.element.setAttribute("tabindex","-1"),e.setAttribute("tabindex","0"),e.focus(),U([e],[VGe,_Ge]))},x$e.prototype.addHeaderFocus=function(e){var t,i=ge(".e-row",this.element);this.gridObj.element.setAttribute("tabindex","-1"),!je(e.target)&&e.target.classList.contains("e-defaultcursor")?(this.addFocus(0),t=e.target.nextElementSibling):je(this.gridObj.element.querySelector(".e-focus"))||"TH"!==this.gridObj.element.querySelector(".e-focus").tagName?t=ge("th.e-fe-grid-icon",this.element):(t=this.gridObj.element.querySelector(".e-focus").nextElementSibling,this.addFocus(0)),je(t)||(t.setAttribute("tabindex","0"),t.focus(),U([t],[VGe,_Ge]),i.setAttribute("tabindex","0"),0===i.tabIndex&&0===t.tabIndex&&q([i],[VGe,_Ge]))},x$e.prototype.getFocusedItem=function(){return ge("."+_Ge,this.element)},x$e.prototype.isSelected=function(e,t){for(var i=!1,n=0;n<=e.length-1;n++)if(e[n]===t){i=!0;break}return i},x$e.prototype.shiftSelectedItem=function(e,t,i,n){-1===e?this.gridObj.selectRow(0):je(this.startIndex)&&n.shiftKey?(this.startIndex=this.gridObj.selectedRowIndex,this.gridObj.selectRows([e,"shiftDown"===n.action||"csDown"===n.action?e+(e!==i.length-1?1:0):e-(0!==e?1:0)])):"shiftDown"===n.action||"shiftUp"===n.action?("shiftDown"===n.action&&-1===t.indexOf(e+1)?e!==i.length-1&&t.push(e+1):"shiftUp"===n.action&&-1===t.indexOf(e-1)?0!==e&&t.push(e-1):t.pop(),this.gridObj.selectRows(t)):"csDown"===n.action?this.isSelected(t,this.getFocusedItemIndex()+1)?this.addFocus(this.getFocusedItemIndex()+1):(t.push(this.getFocusedItemIndex()+1),this.gridObj.selectRows(t)):this.isSelected(t,this.getFocusedItemIndex()-1)?this.addFocus(this.getFocusedItemIndex()-1):(t.push(this.getFocusedItemIndex()-1),this.gridObj.selectRows(t))},x$e.prototype.onMethodCall=function(e){if("Details"===this.parent.view)switch(R("action",e)){case"deleteFiles":this.deleteFiles(R("ids",e));break;case"downloadFiles":this.downloadFiles(R("ids",e));break;case"openFile":this.openFile(R("id",e));break;case"createFolder":this.interaction=!1;break;case"renameFile":this.interaction=!1,this.renameFile(R("id",e),R("newName",e));break;case"selectAll":this.interaction=!1,this.onSelectAllInit();break;case"clearSelection":this.interaction=!1,this.onClearAllInit()}},x$e.prototype.getRecords=function(e){var t=this.gridObj.getCurrentViewRecords(),i=[],n=!(""===this.parent.breadcrumbbarModule.searchObj.element.value&&!this.parent.isFiltered),o=this.parent.hasId?"id":"name";if(this.parent.hasId||!n)for(var r=0,s=t.length;r<s;r++)-1!==e.indexOf(R(o,t[r]))&&i.push(t[r]);else for(r=0,s=t.length;r<s;r++){var a=R("filterPath",t[r])+R("name",t[r]);-1!==e.indexOf(a)&&i.push(t[r])}return i},x$e.prototype.deleteFiles=function(e){if(this.parent.activeModule="detailsview",je(e))this.performDelete();else{var t=this.getRecords(e);if(0!==t.length){for(var i=[],n=[],o=0;o<t.length;o++)i[o]=t[o],n[o]=WJe(this.parent,i[o]);GJe(this.parent,i,n)}}},x$e.prototype.downloadFiles=function(e){if(je(e))this.doDownload();else{var t=this.getRecords(e);if(0!==t.length){for(var i=[],n=[],o=0;o<t.length;o++)i[o]=t[o],n[o]=WJe(this.parent,i[o]);YJe(this.parent,i,n)}}},x$e.prototype.openFile=function(e){je(e)||0<(e=this.getRecords([e])).length&&this.openContent(e[0])},x$e.prototype.renameFile=function(e,t){this.parent.activeModule="detailsview",je(e)?this.performRename():0<(e=this.getRecords([e])).length&&(QJe(this.parent,e[0]),je(t)?UJe(this.parent):ZJe(this.parent.itemData[0])?dZe(this.parent,this.parent.path,t):XJe(this.parent,this.parent.itemData[0],RXe))};var A$e=x$e;function x$e(e){this.isInteracted=!0,this.interaction=!0,this.isPasteOperation=!1,this.isColumnRefresh=!1,this.dragObj=null,this.startIndex=null,this.firstItemIndex=null,this.isSelectionUpdate=!1,this.currentSelectedItem=[],this.count=0,this.isRendered=!0,this.isLoaded=!1,this.isNameWidth=!1,this.isMultiSelect=!1,this.pasteOperation=!1,this.uploadOperation=!1,IP.Inject(jG,SK,eG,xY),this.parent=e,this.element=ge("#"+this.parent.element.id+aGe,this.parent.element),this.addEventListener(),this.keyConfigs={altEnter:"alt+enter",esc:"escape",tab:"tab",moveDown:"downarrow",ctrlEnd:"ctrl+end",ctrlHome:"ctrl+home",ctrlDown:"ctrl+downarrow",ctrlLeft:"ctrl+leftarrow",ctrlRight:"ctrl+rightarrow",shiftEnd:"shift+end",shiftHome:"shift+home",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",ctrlUp:"ctrl+uparrow",csEnd:"ctrl+shift+end",csHome:"ctrl+shift+home",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",space:"space",ctrlSpace:"ctrl+space",shiftSpace:"shift+space",csSpace:"ctrl+shift+space",end:"end",home:"home",moveUp:"uparrow",del:"delete",ctrlX:this.parent.isMac?"cmd+x":"ctrl+x",ctrlC:this.parent.isMac?"cmd+c":"ctrl+c",ctrlV:this.parent.isMac?"cmd+v":"ctrl+v",ctrlShiftN:"ctrl+shift+n",shiftdel:"shift+delete",ctrlD:"ctrl+d",f2:"f2",ctrlA:"ctrl+a",enter:"enter",back:"backspace"}}I$e=function(e,t){return(I$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])}))(e,t)};var I$e,T$e,wce=function(e,t){function i(){this.constructor=e}I$e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},d$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},jee=(wce(E$e,T$e=n),d$([e(!0)],E$e.prototype,"enable",void 0),d$([e(!0)],E$e.prototype,"enableFloating",void 0),d$([e(G3e.Expand)],E$e.prototype,"type",void 0),d$([e(pJ)],E$e.prototype,"items",void 0),d$([e({})],E$e.prototype,"itemConfigs",void 0),E$e);function E$e(){return null!==T$e&&T$e.apply(this,arguments)||this}wce(M$e,D$e=n),d$([e(null)],M$e.prototype,"serviceUrl",void 0);var D$e,pJ=M$e;function M$e(){return null!==D$e&&D$e.apply(this,arguments)||this}wce(B$e,k$e=n),d$([e(null)],B$e.prototype,"serviceUrl",void 0),d$([e("Sample.docx")],B$e.prototype,"fileName",void 0),d$([e(null)],B$e.prototype,"stylesheet",void 0);var k$e,P$e=B$e;function B$e(){return null!==k$e&&k$e.apply(this,arguments)||this}wce(R$e,F$e=n),d$([e(null)],R$e.prototype,"serviceUrl",void 0),d$([e("Sample.pdf")],R$e.prototype,"fileName",void 0),d$([e(null)],R$e.prototype,"stylesheet",void 0);var F$e,L$e=R$e;function R$e(){return null!==F$e&&F$e.apply(this,arguments)||this}wce(V$e,O$e=n),d$([e([".jpeg",".jpg",".png"])],V$e.prototype,"allowedTypes",void 0),d$([e("inline")],V$e.prototype,"display",void 0),d$([e("Blob")],V$e.prototype,"saveFormat",void 0),d$([e("auto")],V$e.prototype,"width",void 0),d$([e("auto")],V$e.prototype,"height",void 0),d$([e(null)],V$e.prototype,"saveUrl",void 0),d$([e(null)],V$e.prototype,"path",void 0),d$([e(!0)],V$e.prototype,"resize",void 0),d$([e(null)],V$e.prototype,"removeUrl",void 0),d$([e(0)],V$e.prototype,"minWidth",void 0),d$([e(null)],V$e.prototype,"maxWidth",void 0),d$([e(0)],V$e.prototype,"minHeight",void 0),d$([e(null)],V$e.prototype,"maxHeight",void 0),d$([e(!1)],V$e.prototype,"resizeByPercent",void 0);var O$e,N$e=V$e;function V$e(){return null!==O$e&&O$e.apply(this,arguments)||this}wce(z$e,_$e=n),d$([e([".wav",".mp3",".m4a",".wma"])],z$e.prototype,"allowedTypes",void 0),d$([e("Inline")],z$e.prototype,"layoutOption",void 0),d$([e("Blob")],z$e.prototype,"saveFormat",void 0),d$([e(null)],z$e.prototype,"saveUrl",void 0),d$([e(null)],z$e.prototype,"removeUrl",void 0),d$([e(null)],z$e.prototype,"path",void 0);var _$e,H$e=z$e;function z$e(){return null!==_$e&&_$e.apply(this,arguments)||this}wce(Q$e,j$e=n),d$([e([".mp4",".mov",".wmv",".avi"])],Q$e.prototype,"allowedTypes",void 0),d$([e("Inline")],Q$e.prototype,"layoutOption",void 0),d$([e("Blob")],Q$e.prototype,"saveFormat",void 0),d$([e("auto")],Q$e.prototype,"width",void 0),d$([e("auto")],Q$e.prototype,"height",void 0),d$([e(null)],Q$e.prototype,"saveUrl",void 0),d$([e(null)],Q$e.prototype,"path",void 0),d$([e(!0)],Q$e.prototype,"resize",void 0),d$([e(null)],Q$e.prototype,"removeUrl",void 0),d$([e(0)],Q$e.prototype,"minWidth",void 0),d$([e(null)],Q$e.prototype,"maxWidth",void 0),d$([e(0)],Q$e.prototype,"minHeight",void 0),d$([e(null)],Q$e.prototype,"maxHeight",void 0),d$([e(!1)],Q$e.prototype,"resizeByPercent",void 0);var j$e,W$e=Q$e;function Q$e(){return null!==j$e&&j$e.apply(this,arguments)||this}wce(G$e,U$e=n),d$([i()],G$e.prototype,"beforeSend",void 0),d$([t({getImageUrl:null,url:null,uploadUrl:null},k$)],G$e.prototype,"ajaxSettings",void 0),d$([e(!1)],G$e.prototype,"allowDragAndDrop",void 0),d$([t({visible:!0,file:["Open","|","Cut","Copy","|","Delete","Rename","|","Details"],folder:["Open","|","Cut","Copy","Paste","|","Delete","Rename","|","Details"],layout:["SortBy","View","Refresh","|","Paste","|","NewFolder","Upload","|","Details","|","SelectAll"]},_$)],G$e.prototype,"contextMenuSettings",void 0),d$([e("")],G$e.prototype,"cssClass",void 0),d$([t({},aN)],G$e.prototype,"detailsViewSettings",void 0),d$([e(!1)],G$e.prototype,"enable",void 0),d$([t({maxWidth:"650px",minWidth:"240px",visible:!0},H$)],G$e.prototype,"navigationPaneSettings",void 0),d$([e("/")],G$e.prototype,"path",void 0),d$([e(null)],G$e.prototype,"rootAliasName",void 0),d$([t({},P2)],G$e.prototype,"searchSettings",void 0),d$([e(!0)],G$e.prototype,"showFileExtension",void 0),d$([e(!1)],G$e.prototype,"showHiddenItems",void 0),d$([e(!0)],G$e.prototype,"showThumbnail",void 0),d$([e("Ascending")],G$e.prototype,"sortOrder",void 0),d$([t({visible:!0,items:["NewFolder","Upload","Cut","Copy","Paste","Delete","Download","Rename","SortBy","Refresh","Selection","View","Details"]},z$)],G$e.prototype,"toolbarSettings",void 0),d$([t({autoUpload:!0,minFileSize:0,maxFileSize:3e7,allowedExtensions:"",autoClose:!1},mJ)],G$e.prototype,"uploadSettings",void 0),d$([e("LargeIcons")],G$e.prototype,"view",void 0);var U$e,q$e=G$e;function G$e(){return null!==U$e&&U$e.apply(this,arguments)||this}wce(K$e,Y$e=n),d$([e("100%")],K$e.prototype,"width",void 0),d$([e(s6e)],K$e.prototype,"styles",void 0),d$([e(!0)],K$e.prototype,"resize",void 0),d$([e(0)],K$e.prototype,"minWidth",void 0),d$([e(null)],K$e.prototype,"maxWidth",void 0);var Y$e,X$e=K$e;function K$e(){return null!==Y$e&&Y$e.apply(this,arguments)||this}wce($$e,J$e=n),d$([e(!0)],$$e.prototype,"enable",void 0),d$([e(!1)],$$e.prototype,"showOnRightClick",void 0),d$([e("hide")],$$e.prototype,"actionOnScroll",void 0),d$([e(["Open","Edit","UnLink"])],$$e.prototype,"link",void 0),d$([e(["Replace","Align","Caption","Remove","-","InsertLink","OpenImageLink","EditImageLink","RemoveImageLink","Display","AltText","Dimension"])],$$e.prototype,"image",void 0),d$([e(["AudioReplace","AudioRemove","AudioLayoutOption"])],$$e.prototype,"audio",void 0),d$([e(["VideoReplace","VideoAlign","VideoRemove","VideoLayoutOption","VideoDimension"])],$$e.prototype,"video",void 0),d$([e(null)],$$e.prototype,"text",void 0),d$([e(["TableHeader","TableRows","TableColumns","BackgroundColor","-","TableRemove","Alignments","TableCellVerticalAlign","Styles"])],$$e.prototype,"table",void 0);var J$e,Z$e=$$e;function $$e(){return null!==J$e&&J$e.apply(this,arguments)||this}wce(iet,eet=n),d$([e("b; em; font; sub; sup; kbd; i; s; u; code; strong; span; p; div; h1; h2; h3; h4; h5; h6; blockquote; ol; ul; li; pre;")],iet.prototype,"allowedFormats",void 0),d$([e(null)],iet.prototype,"deniedFormats",void 0);var eet,tet=iet;function iet(){return null!==eet&&eet.apply(this,arguments)||this}wce(oet,net=n),d$([e(Wo)],oet.prototype,"iconsSet",void 0),d$([e(!0)],oet.prototype,"showSearchBox",void 0);var net,Wo=oet;function oet(){return null!==net&&net.apply(this,arguments)||this}wce(aet,ret=n),d$([e(!1)],aet.prototype,"prompt",void 0),d$([e(null)],aet.prototype,"deniedAttrs",void 0),d$([e(["background","background-color","border","border-bottom","border-left","border-radius","border-right","border-style","border-top","border-width","clear","color","cursor","direction","display","float","font","font-family","font-size","font-weight","font-style","height","left","line-height","list-style-type","margin","margin-top","margin-left","margin-right","margin-bottom","max-height","max-width","min-height","min-width","overflow","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","position","right","table-layout","text-align","text-decoration","text-transform","text-indent","top","vertical-align","visibility","white-space","width","flex-direction"])],aet.prototype,"allowedStyleProps",void 0),d$([e(null)],aet.prototype,"deniedTags",void 0),d$([e(!0)],aet.prototype,"keepFormat",void 0),d$([e(!1)],aet.prototype,"plainText",void 0);var ret,set=aet;function aet(){return null!==ret&&ret.apply(this,arguments)||this}wce(pet,het=n),d$([e(null)],pet.prototype,"default",void 0),d$([e("72px")],pet.prototype,"width",void 0),d$([e(a6e)],pet.prototype,"items",void 0);var het,det=pet;function pet(){return null!==het&&het.apply(this,arguments)||this}wce(uet,cet=n),d$([e(null)],uet.prototype,"default",void 0),d$([e("60px")],uet.prototype,"width",void 0),d$([e(fJ)],uet.prototype,"items",void 0);var cet,fJ=uet;function uet(){return null!==cet&&cet.apply(this,arguments)||this}wce(met,get=n),d$([e(null)],met.prototype,"default",void 0),d$([e("65px")],met.prototype,"width",void 0),d$([e(l6e)],met.prototype,"types",void 0);var get,h=met;function met(){return null!==get&&get.apply(this,arguments)||this}wce(yet,fet=n),d$([e("#ff0000")],yet.prototype,"default",void 0),d$([e("Palette")],yet.prototype,"mode",void 0),d$([e(10)],yet.prototype,"columns",void 0),d$([e(Vee)],yet.prototype,"colorCode",void 0),d$([e(!1)],yet.prototype,"modeSwitcher",void 0);var fet,Vee=yet;function yet(){return null!==fet&&fet.apply(this,arguments)||this}wce(bet,vet=n),d$([e("#ffff00")],bet.prototype,"default",void 0),d$([e("Palette")],bet.prototype,"mode",void 0),d$([e(10)],bet.prototype,"columns",void 0),d$([e(tte)],bet.prototype,"colorCode",void 0),d$([e(!1)],bet.prototype,"modeSwitcher",void 0);var vet,tte=bet;function bet(){return null!==vet&&vet.apply(this,arguments)||this}wce(Aet,wet=n),d$([e(h6e)],Aet.prototype,"types",void 0);var wet,Cet=Aet;function Aet(){return null!==wet&&wet.apply(this,arguments)||this}wce(Iet,xet=n),d$([e(d6e)],Iet.prototype,"types",void 0);var xet,wce=Iet;function Iet(){return null!==xet&&xet.apply(this,arguments)||this}Tet=function(e,t){return(Tet=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])}))(e,t)};var Tet,Eet,d$=function(e,t){function i(){this.constructor=e}Tet(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Det=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Met=(d$(ket,Eet=n),Det([e([])],ket.prototype,"styles",void 0),Det([e([])],ket.prototype,"scripts",void 0),ket);function ket(){return null!==Eet&&Eet.apply(this,arguments)||this}d$(Bet,Pet=n),Det([e(!1)],Bet.prototype,"enable",void 0),Det([e(null)],Bet.prototype,"attributes",void 0),Det([t({},Met)],Bet.prototype,"resources",void 0),Det([e([])],Bet.prototype,"metaTags",void 0),Det([e(null)],Bet.prototype,"sandbox",void 0);var Pet,d$=Bet;function Bet(){return null!==Pet&&Pet.apply(this,arguments)||this}Fet=function(e,t){return(Fet=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])}))(e,t)};var Fet,Let,Met=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Det=(function(e,t){function i(){this.constructor=e}Fet(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Ret,Let=n),Met([e(!1)],Ret.prototype,"enable",void 0),Met([e(!0)],Ret.prototype,"onSelection",void 0),Ret);function Ret(){return null!==Let&&Let.apply(this,arguments)||this}function Oet(e,t,i,n){var o;if(o=i?t.contentModule.getDocument().querySelector("body"):t.element,Object.keys(e).length)for(var r=0,s=Object.keys(e);r<s.length;r++){var a=s[r];"class"===a?o.classList.add(e[""+a]):"disabled"===a&&"disabled"===e[""+a]?(t.enabled=!1,t.setEnable()):"readonly"===a&&"readonly"===e[""+a]?(t.readonly=!0,t.setReadOnly(n)):"style"===a?o.style.cssText=e[""+a]:"tabindex"===a?t.inputElement.setAttribute("tabindex",e[""+a]):"placeholder"===a?(t.placeholder=e[""+a],t.setPlaceHolder()):(-1<["name","required"].indexOf(a)?t.valueContainer:o).setAttribute(a,e[""+a])}}Vet.prototype.showFullScreen=function(t){var i=this;!0!==this.parent.toolbarSettings.enable||"Markdown"===this.parent.editorMode||je(this.parent.quickToolbarModule)||this.parent.quickToolbarModule.hideQuickToolbars(),this.parent.showTooltip&&!je(document.querySelector(".e-tooltip-wrap"))&&this.parent.notify(yWe,{args:t}),this.scrollableParent=xv(this.parent.element),this.parent.element.classList.contains(WWe)||this.parent.trigger(O4e,{cancel:!1,requestType:"Maximize",targetItem:"Maximize",args:t},function(e){e.cancel||(i.parent.toolbarSettings.enableFloating&&!i.parent.inlineMode.enable&&i.parent.toolbarSettings.enable&&(i.parent.getToolbarElement().style.width="100%",i.parent.getToolbarElement().style.top="0px"),i.parent.element.classList.add(WWe),i.toggleParentOverflow(!0),i.parent.toolbarModule&&(i.parent.getBaseToolbarObject().toolbarObj.items[0].properties||i.parent.getBaseToolbarObject().toolbarObj.removeItems(0),F.isDevice&&i.parent.toolbarModule.removeFixedTBarClass(),i.parent.toolbarModule.updateItem({targetItem:"Maximize",updateItem:"Minimize",baseToolbar:i.parent.getBaseToolbarObject()})),i.parent.refreshUI(),i.parent.trigger(N4e,{requestType:"Maximize",targetItem:"Maximize",args:t}))})},Vet.prototype.hideFullScreen=function(n){var o=this;!0!==this.parent.toolbarSettings.enable||"Markdown"===this.parent.editorMode||je(this.parent.quickToolbarModule)||this.parent.quickToolbarModule.hideQuickToolbars(),this.parent.showTooltip&&!je(document.querySelector(".e-tooltip-wrap"))&&this.parent.notify(yWe,{args:n}),this.parent.element.classList.contains(WWe)&&this.parent.trigger(O4e,{cancel:!1,requestType:"Minimize",targetItem:"Minimize",args:n},function(e){if(!e.cancel){o.parent.element.classList.remove(WWe);for(var t=document.querySelectorAll(".e-rte-overflow"),i=0;i<t.length;i++)q([t[i]],["e-rte-overflow"]);o.parent.toolbarModule&&(o.parent.getBaseToolbarObject().toolbarObj.items[0].properties||o.parent.getBaseToolbarObject().toolbarObj.removeItems(0),o.parent.toolbarModule.updateItem({targetItem:"Minimize",updateItem:"Maximize",baseToolbar:o.parent.getBaseToolbarObject()}),F.isDevice)&&o.parent.inlineMode.enable&&o.parent.toolbarModule.addFixedTBarClass(),o.parent.refreshUI(),o.parent.trigger(N4e,{requestType:"Minimize",targetItem:"Minimize",args:n})}})},Vet.prototype.toggleParentOverflow=function(e){if(!je(this.scrollableParent))for(var t=0;t<this.scrollableParent.length;t++)"#document"===this.scrollableParent[t].nodeName?U([document.querySelector("body")],["e-rte-overflow"]):U([this.scrollableParent[t]],["e-rte-overflow"])},Vet.prototype.onKeyDown=function(e){var t=e.args;switch(t.action){case"full-screen":this.showFullScreen(e.args),t.preventDefault();break;case"escape":this.hideFullScreen(e.args),t.preventDefault()}},Vet.prototype.addEventListener=function(){this.parent.on(u4e,this.onKeyDown,this),this.parent.on(t4e,this.destroy,this)},Vet.prototype.removeEventListener=function(){this.parent.off(u4e,this.onKeyDown),this.parent.off(t4e,this.destroy)},Vet.prototype.destroy=function(){if(!je(this.parent)){this.parent.element.classList.contains(WWe)&&this.toggleParentOverflow(!1);for(var e=document.querySelectorAll(".e-rte-overflow"),t=0;t<e.length;t++)q([e[t]],["e-rte-overflow"]);this.removeEventListener()}};var Net=Vet;function Vet(e){this.parent=e,this.addEventListener()}Het.prototype.addEventListener=function(){this.parent.on(A5e,this.enterHandler,this),this.parent.on(t4e,this.destroy,this)},Het.prototype.destroy=function(){je(this.parent)||this.removeEventListener()},Het.prototype.removeEventListener=function(){this.parent.off(A5e,this.enterHandler),this.parent.off(t4e,this.destroy)},Het.prototype.getRangeNode=function(){this.range=this.parent.getRange(),this.startNode="#text"===this.range.startContainer.nodeName?this.range.startContainer.parentElement:this.range.startContainer,this.endNode="#text"===this.range.endContainer.nodeName?this.range.endContainer.parentElement:this.range.endContainer},Het.prototype.enterHandler=function(A){var x=this,I=(this.getRangeNode(),!0),e=(this.formatTags=["h1","h2","h3","h4","h5","h6","blockquote"],this.processedTableImageCursor());if(!e.start&&!e.end||"TABLE"!==e.startName&&"TABLE"!==e.endName)if(!e.start&&!e.end&&"IMG"!==this.range.startContainer.nodeName||"BR"!==this.parent.enterKey||"IMG"!==e.startName&&"IMG"!==e.endName&&"IMG"!==this.range.startContainer.nodeName){if(!je(this.startNode.closest("TABLE"))&&!je(this.endNode.closest("TABLE"))){for(var I=!1,t=this.startNode,i=t;!this.parent.formatter.editorManager.domNode.isBlockNode(t);)i=t=t.parentElement;I="TH"!==i.tagName&&"TD"!==i.tagName&&"TBODY"!==i.tagName}var T,n=A.args;13!==n.which||n.ctrlKey||(F.isDevice?"Enter"!==n.key:"Enter"!==n.code&&"NumpadEnter"!==n.code)||je(this.startNode.closest("LI, UL, OL"))&&je(this.endNode.closest("LI, UL, OL"))&&je(this.startNode.closest(".e-img-inner"))&&I&&je(this.startNode.closest("PRE"))&&je(this.endNode.closest("PRE"))&&je(this.startNode.closest("BLOCKQUOTE"))&&je(this.endNode.closest("BLOCKQUOTE"))&&(T=A.args.shiftKey,n={cancel:!1,name:O4e,requestType:T?"ShiftEnterAction":"EnterAction",originalEvent:A.args},this.parent.trigger(O4e,n,function(e){if(!e.cancel){if(0===x.parent.formatter.getUndoRedoStack().length&&x.parent.formatter.saveData(),x.range.startOffset!==x.range.endOffset||x.range.startContainer!==x.range.endContainer)if(x.range.startContainer.nodeType!==Node.TEXT_NODE&&("IMG"===x.range.startContainer.nodeName||x.range.startContainer.querySelector("img")||"SPAN"===x.range.startContainer.nodeName&&(x.range.startContainer.classList.contains("e-video-wrap")||x.range.startContainer.classList.contains("e-audio-wrap")))||x.range.deleteContents(),"#text"===x.range.startContainer.nodeName&&0===x.range.startContainer.textContent.length&&x.range.startContainer.parentElement!==x.parent.inputElement)"BR"===x.parent.enterKey?x.range.startContainer.parentElement.innerHTML="&#8203;":x.range.startContainer.parentElement.innerHTML="<br>";else if(x.range.startContainer===x.parent.inputElement&&""===x.range.startContainer.innerHTML){"P"===x.parent.enterKey?x.range.startContainer.innerHTML="<p><br></p>":"DIV"===x.parent.enterKey?x.range.startContainer.innerHTML="<div><br></div>":x.range.startContainer.innerHTML="<br>";var t=x.range.startContainer.childNodes[x.range.startOffset];x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),t,0)}else if(x.parent.inputElement===x.range.startContainer){if("#text"===(t=x.range.startContainer.childNodes[x.range.startOffset]).nodeName&&0===t.textContent.length)x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),t,0===t.textContent.length?0:t.previousSibling.textContent.length);else if(x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),t,0<=t.textContent.length?0:1),0===t.previousSibling.textContent.length){if(G(t.previousSibling),!T){for(var i=je(t.lastChild)?t:t.lastChild;!je(i)&&"#text"!==i.nodeName&&"BR"!==i.nodeName;)i=i.lastChild;"BR"!==i.nodeName&&0===i.parentElement.textContent.length&&0===i.parentElement.innerHTML.length&&"BR"!==i.parentElement.nodeName&&i.parentElement.appendChild(x.parent.createElement("BR")),x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),"BR"===i.nodeName?i:i.parentElement,0<=i.parentElement.textContent.length||"BR"===i.nodeName?0:1)}}else if(0===t.textContent.length){for(i="#text"===t.previousSibling.nodeName?t.previousSibling:t.previousSibling.lastChild;!je(i)&&"#text"!==i.nodeName;)i=i.lastChild;x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),i,i.textContent.length),G(t)}else if("BR"!==x.parent.enterKey&&0!==t.previousSibling.textContent.length&&0!==t.textContent.length)return void A.args.preventDefault();x.getRangeNode()}if(x.range.startContainer===x.range.endContainer&&x.range.startOffset===x.range.endOffset&&x.range.startContainer===x.parent.inputElement){if(1!==x.parent.inputElement.childNodes.length||"TABLE"!==x.parent.inputElement.childNodes[0].nodeName)if(je(x.range.startContainer.childNodes[x.range.startOffset])){for(var n=x.range.startContainer.childNodes[x.range.startOffset-1];null!==n.lastChild&&"#text"!==n.nodeName;)n=n.lastChild;x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),n,"BR"===n.nodeName?0:n.textContent.length)}else x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),x.range.startContainer.childNodes[x.range.startOffset],0);x.getRangeNode()}if("P"===x.parent.enterKey&&!T||"DIV"===x.parent.enterKey&&!T||"P"===x.parent.shiftEnterKey&&T||"DIV"===x.parent.shiftEnterKey&&T){if(1===x.range.startOffset&&1===x.parent.inputElement.childNodes.length&&"TABLE"===x.parent.inputElement.childNodes[0].nodeName)(m=x.createInsertElement(T)).appendChild(x.parent.createElement("BR")),x.parent.inputElement.appendChild(m),x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),m,0);else{var e=void 0,e=I&&x.parent.formatter.editorManager.domNode.isBlockNode(x.startNode)?"#text"!==x.range.startContainer.nodeName||je(x.range.startContainer.previousSibling)||"HR"!==x.range.startContainer.previousSibling.nodeName?x.startNode:x.range.startContainer.nextSibling:x.parent.formatter.editorManager.domNode.blockParentNode(x.startNode),o=!1,r=!1,s=!1,a=!1,l=((C=x.range.startContainer.parentElement)&&(s="pre-wrap"===(p=x.parent.contentModule.getDocument().defaultView.getComputedStyle(C)).getPropertyValue("white-space"),a="nowrap"===p.getPropertyValue("text-wrap")),0===x.range.startOffset||0===x.range.endOffset||x.range.startContainer!==x.range.endContainer||!je(e.childNodes[0])&&("IMG"===e.childNodes[0].nodeName||0<e.querySelectorAll("img, audio, video").length)?0===x.range.startOffset&&0===x.range.endOffset&&(r=!0):(l=(h=(p=x.range.startContainer.textContent).substring(0,x.range.startOffset)).charCodeAt(x.range.startOffset-1),h=0===h.trim().length,p=0!==p.slice(x.range.startOffset).trim().length,(160!==l&&h&&!s&&!a||32===l&&(s||a)&&h&&p)&&!x.range.startContainer.previousSibling&&(r=!0)),x.removeBRElement(e),-1!==F.userAgent.indexOf("Firefox")&&0===x.range.startOffset&&x.range.startContainer===x.range.endContainer&&"#text"===x.range.startContainer.nodeName&&!je(x.range.startContainer.previousSibling)&&!x.parent.formatter.editorManager.domNode.isBlockNode(x.range.startContainer.previousSibling)&&x.range.startContainer.parentElement===x.range.startContainer.previousSibling.parentElement),s="#text"===x.range.startContainer.nodeName&&x.range.startContainer.textContent.includes("​")&&"​"===x.range.startContainer.textContent.trim()||"#text"===x.range.startContainer.nodeName&&!je(x.range.startContainer.textContent[x.range.startOffset])&&x.range.startContainer.textContent[x.range.startOffset].includes("​")&&"​"===x.range.startContainer.textContent[x.range.startOffset]&&"​"!==x.parent.inputElement.textContent[0];if(("#text"===x.range.startContainer.nodeName||"BR"===x.range.startContainer.nodeName)&&0===x.range.startOffset&&0===x.range.endOffset&&x.range.startContainer.parentElement===x.parent.inputElement&&"BR"===x.parent.enterKey&&T||s||l||!(0===x.range.startOffset&&0===x.range.endOffset||r)||!(je(x.range.startContainer.previousSibling)||"IMG"!==x.range.startContainer.previousSibling.nodeName&&"BR"!==x.range.startContainer.previousSibling.nodeName))if(e===x.parent.inputElement||0!==e.textContent.length||(!je(e.childNodes[0])&&"IMG"===e.childNodes[0].nodeName||0<e.querySelectorAll("video").length||0<e.querySelectorAll("audio").length||0<e.querySelectorAll("img").length)){if(x.range.startContainer===x.range.endContainer&&x.range.startContainer.nodeType!==Node.TEXT_NODE&&("IMG"===x.range.startContainer.nodeName||x.range.startContainer.querySelector("img")||"SPAN"===x.range.startContainer.nodeName&&(x.range.startContainer.classList.contains("e-video-wrap")||x.range.startContainer.classList.contains("e-audio-wrap")))){if(0<e.textContent.trim().length){var a=je((m=x.parent.formatter.editorManager.nodeCutter.SplitNode(x.range,e,!0)).previousSibling.querySelector(".e-video-wrap"))?m.previousSibling.querySelector(".e-audio-wrap"):m.previousSibling.querySelector(".e-video-wrap"),h=!1;if(!je(a)){for(var d=a.previousSibling;!je(d)&&"#text"!==d.nodeName;)d=d.lastChild;je(d)&&(u=x.parent.createElement("br"),a.parentElement.appendChild(u),h=!0),h?x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),a.parentElement,0):x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),d,d.textContent.length),G(a)}}else{var t=(m=x.parent.formatter.editorManager.nodeCutter.SplitNode(x.range,e,!0)).hasChildNodes()?m.previousSibling:m,p=je(m.querySelector("img"))?null:m.querySelector("img"),c=x.createInsertElement(T);for(je(p)?je(p)&&t.querySelector("img")&&(t=m):t=r?(m.parentElement.insertBefore(c,m),m.previousSibling):(x.parent.formatter.editorManager.domNode.insertAfter(c,m),m.nextSibling);!je(t.firstChild);)G(t.firstChild);var u=x.parent.createElement("br");t.appendChild(u),x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),t,0)}je(x.parent.audioModule)||x.parent.audioModule.hideAudioQuickToolbar(),je(x.parent.videoModule)||x.parent.videoModule.hideVideoQuickToolbar()}else if("BR"===x.parent.enterKey&&T&&x.range.startContainer.nodeType===Node.TEXT_NODE&&x.range.startContainer.parentElement&&x.range.startContainer.parentElement===x.parent.inputElement){var s=x.range,l=s.startContainer,h=s.startOffset,a=x.parent.createElement(x.parent.shiftEnterKey);l.nodeType===Node.TEXT_NODE&&0!==s.endOffset&&0!==s.startOffset?(h<(p=l).length?(r=p.splitText(h),a.appendChild(r)):a.innerHTML="<br>",p.parentNode.insertBefore(a,p.nextSibling),x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),a,0)):0===h&&0===s.endOffset&&(a.innerHTML="<br>",s.endOffset===l.textContent.length&&(r=x.parent.createElement("br"),l.parentNode.insertBefore(r,l)),l.parentNode.insertBefore(a,l),p=s.endOffset===l.textContent.length?a:a.nextSibling,l.parentNode.insertBefore(a,l),x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),p,0))}else if(je((m=x.parent.formatter.editorManager.nodeCutter.SplitNode(x.range,e,!0)).childNodes[0])||"#text"!==m.childNodes[0].nodeName||0!==m.childNodes[0].textContent.length||G(m.childNodes[0]),(0===m.textContent.trim().length||m.childNodes[0].textContent.trim().includes("​")&&"​"===m.childNodes[0].textContent.trim())&&(u=x.parent.createElement("br"),"A"===x.startNode.nodeName||x.startNode.closest("a")?(x.startNode="A"===x.startNode.nodeName?x.startNode:x.startNode.closest("a"),h=x.startNode.parentElement,x.startNode.parentElement.insertBefore(u,x.startNode),G(x.startNode),x.startNode=h):"BR"!==x.startNode.nodeName&&x.startNode.appendChild(u),"\n"===m.childNodes[0].textContent&&G(m.childNodes[0]),m.childNodes[0].textContent.trim().includes("​")&&"​"===m.childNodes[0].textContent.trim()&&G(m.childNodes[0]),x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),x.startNode,0)),("P"===x.parent.enterKey||"DIV"===x.parent.enterKey)&&!T||("DIV"===x.parent.shiftEnterKey||"P"===x.parent.shiftEnterKey)&&T){r=x.formatTags.indexOf(m.nodeName.toLocaleLowerCase());if(r<0||0<=r&&0===m.textContent.trim().length){for(var g=x.createInsertElement(T);m.firstChild;)g.appendChild(m.firstChild);x.parent.formatter.editorManager.domNode.insertAfter(g,m),G(m);s=x.parent.formatter.editorManager.domNode.isBlockNode(x.startNode)?g:x.startNode,a=0;s&&("A"===s.nodeName||s.closest("a"))&&(s="A"===s.nodeName?s:s.closest("a"),(s=x.getFirstTextNode(s)).nodeValue="​"+s.nodeValue,a=1),x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),s,a)}}}else je(e.children[0])||"BR"===e.children[0].tagName?((c=x.createInsertElement(T)).innerHTML="<br>",x.parent.formatter.editorManager.domNode.insertAfter(c,e),x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),c,0)):(m=x.parent.formatter.editorManager.nodeCutter.SplitNode(x.range,e,!1).cloneNode(!0),x.parent.formatter.editorManager.domNode.insertAfter(m,e),x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),m,0<=m.textContent.length?0:1));else{var l=void 0,m=void 0,l=je(x.range.startContainer.childNodes)||0!==x.range.startContainer.textContent.length&&("#text"===x.range.startContainer.nodeName||je(x.range.startContainer.querySelector(".e-video-clickelem"))||0!==x.range.startContainer.querySelector(".e-video-clickelem").textContent.length)||!(0<x.range.startContainer.querySelectorAll("img, audio, video").length)&&je(x.range.startContainer.querySelector(".e-video-clickelem"))&&"IMG"!==x.range.startContainer.nodeName&&"TABLE"!==x.range.startContainer.nodeName?0!==e.textContent.trim().length||!je(e.childNodes[0])&&"IMG"===e.childNodes[0].nodeName||""===e.textContent.trim()&&0<e.querySelectorAll("img, audio, video").length?(x.range.startOffset===x.range.endOffset&&0!==x.range.startOffset?m=x.parent.formatter.editorManager.nodeCutter.SplitNode(x.range,e,!1).cloneNode(!0):(m=x.parent.formatter.editorManager.nodeCutter.SplitNode(x.range,e,!0).cloneNode(!0),o=!0),!1):(m=x.parent.formatter.editorManager.nodeCutter.SplitNode(x.range,e,!0).cloneNode(!0),!0):(m=x.createInsertElement(T),!(o=!0)),c=void 0;for(c=x.formatTags.indexOf(m.nodeName.toLocaleLowerCase())<0?x.createInsertElement(T):x.parent.createElement(m.nodeName);m.firstChild;)c.appendChild(m.firstChild);var p=!(x.range.startContainer===e||!(e.querySelector(".e-video-wrap")||e.querySelector(".e-audio-wrap")&&x.range.startContainer.classList.contains("e-clickelem"))),f=!(x.range.startContainer===e||!e.querySelector("img"));if(p?x.parent.formatter.editorManager.domNode.insertAfter(c,e):e.parentElement.insertBefore(c,e),!l){var i=c,y=void 0;if(x.range.startOffset===x.range.endOffset&&0!==x.range.startOffset)for(;!je(i)&&"#text"!==i.nodeName&&"BR"!==i.nodeName;)i=(y=i).lastChild;else y=i;y.innerHTML="<br>",o||G(e)}p||f?x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),c,0):x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),c.nextElementSibling,0)}}A.args.preventDefault()}if("BR"===x.parent.enterKey&&!T||"BR"===x.parent.shiftEnterKey&&T){h=void 0;if(x.parent.formatter.editorManager.domNode.isBlockNode(x.startNode))h=x.startNode;else{for(var v=x.startNode,b=v;!x.parent.formatter.editorManager.domNode.isBlockNode(v);)v=(b=v).parentElement;h=v===x.parent.inputElement?b:v}for(var u=window.getComputedStyle(h),w=(x.removeBRElement(h),h.lastChild);!je(w)&&"#text"!==w.nodeName&&"BR"!==w.nodeName&&"IMG"!==w.nodeName;)w=w.lastChild;r=(x.range.startContainer===w?x.range.startContainer:h).textContent.length,f="IMG"===x.range.startContainer.nodeName||0<x.range.startContainer.childNodes.length&&!je(x.range.startContainer.childNodes[x.range.startOffset])&&"IMG"===x.range.startContainer.childNodes[x.range.startOffset].nodeName||1===x.range.startContainer.nodeType&&null!==x.range.startContainer.querySelector("img");if(h!==x.parent.inputElement&&x.parent.formatter.editorManager.domNode.isBlockNode(h)&&x.range.startOffset===x.range.endOffset&&(x.range.startOffset===r||0===h.textContent.trim().length&&f)){var C,s=x.parent.createElement("br");0===x.range.startOffset&&"TABLE"===x.range.startContainer.nodeName?x.range.startContainer.parentElement.insertBefore(s,x.range.startContainer):"BR"===w.nodeName&&0===h.textContent.length?x.parent.formatter.editorManager.domNode.insertAfter(s,w):0===x.range.startOffset&&0===x.range.endOffset&&f?(a="IMG"===x.range.startContainer.nodeName?x.range.startContainer:x.range.startContainer.childNodes[x.range.startOffset],h.insertBefore(s,a)):(l=x.parent.createElement("br"),o=void 0,(C=x.range.startContainer.parentElement)&&"A"===C.nodeName&&C.textContent.length===x.range.startOffset?o=C:C&&(o=C.closest("a")||x.range.startContainer),x.parent.formatter.editorManager.domNode.insertAfter(s,o),x.parent.formatter.editorManager.domNode.insertAfter(l,o),p=je(e=o.nextElementSibling)?null:e.nextElementSibling,je(e)||je(p)||je(p.nextElementSibling)||"BR"!==e.nodeName||"BR"!==p.nodeName||"BR"!==p.nextElementSibling.nodeName||p.nextElementSibling.remove()),x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),s,0)}else if(je(h)||h===x.parent.inputElement||"BR"===h.nodeName)x.insertBRElement();else if(0===h.textContent.trim().length||1===h.textContent.trim().length&&8203===h.textContent.charCodeAt(0))0<h.childElementCount&&"IMG"===h.lastElementChild.nodeName||h.lastElementChild&&"BR"===h.lastElementChild.nodeName||!je(h.firstElementChild)&&(h.querySelector(".e-video-wrap")||h.querySelector(".e-audio-wrap"))?x.insertBRElement():(m=x.parent.formatter.editorManager.nodeCutter.SplitNode(x.range,h,!0).cloneNode(!0),x.parent.formatter.editorManager.domNode.insertAfter(m,h),S=x.parent.createElement("br"),m.parentElement.insertBefore(S,m),x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),m,0));else{var m=void 0,S=x.parent.createElement("br");if(0!==x.range.startOffset||0!==x.range.endOffset||je(h.previousSibling)||"BR"!==h.previousSibling.nodeName||"P"===h.nodeName||"DIV"===h.nodeName)h===x.parent.inputElement||"inline"!==u.display&&"inline-block"!==u.display?"A"===x.startNode.nodeName||x.startNode.closest("A")?(x.startNode="A"===x.startNode.nodeName?x.startNode:x.startNode.closest("A"),x.parent.formatter.editorManager.nodeCutter.SplitNode(x.range,x.startNode,!0).cloneNode(!0),x.startNode.parentElement.insertBefore(S,x.startNode),(r=x.getFirstTextNode(x.startNode)).nodeValue="​"+r.nodeValue,x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),r,1)):x.insertBRElement():(m=x.parent.formatter.editorManager.nodeCutter.SplitNode(x.range,h,!0).cloneNode(!0),h.parentElement.insertBefore(S,h),x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),h,0),x.insertFocusContent());else{m=x.parent.formatter.editorManager.nodeCutter.SplitNode(x.range,h,!1).cloneNode(!0),x.parent.formatter.editorManager.domNode.insertAfter(S,h),x.insertFocusContent();for(i=S.nextSibling;!je(i)&&"#text"!==i.nodeName;)i=i.lastChild;x.parent.formatter.editorManager.nodeSelection.setCursorPoint(x.parent.contentModule.getDocument(),i,0)}}A.args.preventDefault()}x.triggerActionComplete(A,T),x.parent.inputElement.dispatchEvent(new Event("input"))}}))}else this.handleEnterKeyAtImageSide(A,e.start,e.end);else this.handleCursorAtTableSide(A,e.start,e.end)},Het.prototype.getFirstTextNode=function(e){return this.parent.contentModule.getDocument().createTreeWalker(e,NodeFilter.SHOW_TEXT,null).nextNode()},Het.prototype.removeBRElement=function(e){-1!==F.userAgent.indexOf("Firefox")&&this.range.endOffset===e.textContent.length&&(0!==e.textContent.length||1<e.querySelectorAll("BR").length)&&!je(e.lastChild)&&"BR"===e.lastChild.nodeName&&G(e.lastChild)},Het.prototype.insertBRElement=function(){for(var e=!1,t=!0,i=!1,n=(0===this.range.endContainer.textContent.length&&"BR"===this.range.startContainer.nodeName&&(t=!1),this.parent.createElement("br")),o=this.startNode;o.lastChild;)o=o.lastChild;var r="A"===this.startNode.nodeName&&"A"===this.endNode.nodeName&&!je(this.range.startContainer.parentElement)&&this.range.startOffset===this.range.endOffset&&this.range.startContainer.textContent.trim().length===o.textContent.trim().length,s=("BR"===this.startNode.nodeName&&"BR"===this.endNode.nodeName&&0===this.range.startOffset&&this.range.startOffset===this.range.endOffset?(this.parent.formatter.editorManager.domNode.insertAfter(n,this.startNode),e=!0):(this.startNode!==this.parent.inputElement||je(this.range.startContainer.previousSibling)||"BR"!==this.range.startContainer.previousSibling.nodeName||0!==this.range.startContainer.textContent.length||(e=!0),r?this.parent.formatter.editorManager.domNode.insertAfter(n,this.startNode):"SPAN"===this.startNode.tagName&&(this.startNode.classList.contains("e-video-wrap")||this.startNode.classList.contains("e-audio-wrap"))?(this.startNode.parentElement.insertBefore(n,this.startNode),s=this.parent.formatter.editorManager.domNode.blockParentNode(this.startNode),G(this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range,s,!0).previousSibling.childNodes[1]),e=!0):this.startNode.nodeType===Node.ELEMENT_NODE&&0<this.startNode.childElementCount&&"IMG"===this.startNode.lastElementChild.nodeName?(this.startNode.parentElement.insertBefore(n,this.startNode),i=e=!0):(this.range.insertNode(n),e=!0)),!je(n.nextSibling)&&(0<n.nextSibling.textContent.length||"#text"!==n.nextSibling.nodeName&&0<n.nextSibling.querySelectorAll("audio,video,table,img").length)||!je(n.nextElementSibling)&&"BR"===n.nextElementSibling.tagName||"BR"===this.range.startContainer.nodeName),a=!je(n.nextSibling)&&!je(n.nextSibling.classList)&&(n.nextSibling.classList.contains("e-video-wrap")||n.nextSibling.classList.contains("e-audio-wrap"));s&&(e||!je(n.nextSibling)&&"#text"===n.nextSibling.nodeName&&0===n.nextSibling.textContent.trim().length&&!je(n.nextSibling.nextSibling)&&0<n.nextSibling.nextSibling.textContent.trim().length)?this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),je(n.nextSibling)||!t||i||a?n:n.nextSibling,0):(s=this.parent.createElement("br"),r?this.parent.formatter.editorManager.domNode.insertAfter(s,this.startNode):this.range.insertNode(s),this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),n,0))},Het.prototype.insertFocusContent=function(){0===this.range.startContainer.textContent.length&&("#text"===this.range.startContainer.nodeName?this.range.startContainer.parentElement.innerHTML="&#8203;":this.range.startContainer.innerHTML="&#8203;")},Het.prototype.createInsertElement=function(e){"DIV"===this.parent.enterKey&&!e||"DIV"===this.parent.shiftEnterKey&&e?t=this.parent.createElement("div"):("P"===this.parent.enterKey&&!e||"P"===this.parent.shiftEnterKey&&e)&&(t=this.parent.createElement("p"));var t,e=this.parent.formatter.editorManager.domNode.blockNodes()[0].previousSibling,i=this.parent.formatter.editorManager.domNode.blockNodes()[0].nextSibling;return!je(e)&&"#text"!==e.nodeName&&e.hasAttribute("style")&&"TABLE"!==e.nodeName&&(t.style.cssText=e.getAttribute("style")),je(e)&&!je(i)&&"#text"!==i.nodeName&&i.hasAttribute("style")&&"TABLE"!==i.nodeName&&(t.style.cssText=i.getAttribute("style")),t},Het.prototype.triggerActionComplete=function(e,t){this.parent.trigger(N4e,{requestType:t?"ShiftEnterAction":"EnterAction",args:e.args})},Het.prototype.handleCursorAtTableSide=function(i,n,o){var r,e,s=this;"BR"!==this.parent.enterKey&&(r=i.args.shiftKey,e={cancel:!1,name:O4e,requestType:r?"ShiftEnterAction":"EnterAction",originalEvent:i.args},this.parent.trigger(O4e,e,function(e){var t;e.cancel||(t=void((e=s.parent.createElement(s.parent.enterKey)).innerHTML="<br>"),n&&(t=s.range.startContainer.childNodes[s.range.startOffset]).parentElement.insertBefore(e,t),o&&(je((t=s.range.startContainer.childNodes[s.range.startOffset-1]).nextSibling)?je(t.nextSibling)&&t.parentElement.appendChild(e):t.parentElement.insertBefore(e,t.nextSibling)),s.parent.formatter.editorManager.nodeSelection.setCursorPoint(s.parent.contentModule.getDocument(),e,0),i.args.preventDefault(),s.triggerActionComplete(i,r))}))},Het.prototype.handleEnterKeyAtImageSide=function(n,o,r){var s=this,e={cancel:!1,name:O4e,requestType:n.args.shiftKey?"ShiftEnterAction":"EnterAction",originalEvent:n.args},a=!1;"IMG"===this.range.startContainer.nodeName&&0===this.range.startOffset&&(a=!0),this.parent.trigger(O4e,e,function(e){var t,i;e.cancel||"BR"===s.parent.enterKey&&(e=s.parent.createElement("BR"),i=void 0,a&&((i=s.range.startContainer).parentElement.insertBefore(e,i),s.parent.formatter.editorManager.nodeSelection.setCursorPoint(s.parent.contentModule.getDocument(),i,0)),o&&((i=s.range.startContainer.childNodes[s.range.startOffset]).parentElement.insertBefore(e,i),s.parent.formatter.editorManager.nodeSelection.setCursorPoint(s.parent.contentModule.getDocument(),i,0)),r&&(je((i=s.range.startContainer.childNodes[s.range.startOffset-1]).nextSibling)?je(i.nextSibling)&&(i.parentElement.appendChild(e),t=s.parent.createElement("BR"),i.parentElement.appendChild(t),s.parent.formatter.editorManager.nodeSelection.setCursorPoint(s.parent.contentModule.getDocument(),t,0)):(i.parentElement.insertBefore(e,i.nextSibling),s.parent.formatter.editorManager.nodeSelection.setCursorPoint(s.parent.contentModule.getDocument(),e.nextSibling,0))),n.args.preventDefault(),s.triggerActionComplete(n,n.args.shiftKey))})},Het.prototype.isTableOrImageStart=function(){var e=this.range.startContainer,t=this.range.startOffset,i=this.range.collapsed&&1===e.nodeType&&e.isContentEditable&&e.childNodes[t]&&-1<["IMG","TABLE"].indexOf(e.childNodes[t].nodeName);return i?{start:i,startNodeName:e.childNodes[t].nodeName}:{start:!1,startNodeName:""}},Het.prototype.isTableOrImageEnd=function(){var e=this.range.startContainer,t=this.range.startOffset,i=this.range.collapsed&&1===e.nodeType&&e.isContentEditable&&e.childNodes[t-1]&&-1<["IMG","TABLE"].indexOf(e.childNodes[t-1].nodeName);return i?{end:i,endNodeName:e.childNodes[t-1].nodeName}:{end:!1,endNodeName:""}},Het.prototype.processedTableImageCursor=function(){var e=this.isTableOrImageStart(),t=e.start,e=e.startNodeName,i=this.isTableOrImageEnd();return{start:t,startName:e,end:i.end,endName:i.endNodeName}};var _et=Het;function Het(e){this.parent=e,this.addEventListener()}zet=function(e,t){return(zet=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])}))(e,t)};var zet,jet,Met=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Met=(function(e,t){function i(){this.constructor=e}zet(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Wet,jet=n),Met([e(!1)],Wet.prototype,"enable",void 0),Met([e(["Paragraph","Heading 1","Heading 2","Heading 3","Heading 4","OrderedList","UnorderedList","CodeBlock","Blockquote"])],Wet.prototype,"items",void 0),Met([e("300px")],Wet.prototype,"popupWidth",void 0),Met([e("320px")],Wet.prototype,"popupHeight",void 0),Wet);function Wet(){return null!==jet&&jet.apply(this,arguments)||this}var Qet=[{command:"Paragraph",subCommand:"p",type:"Basic Block",iconCss:"e-rte-paragraph"},{command:"Heading 1",subCommand:"h1",type:"Basic Block",iconCss:"e-rte-h1"},{command:"Heading 2",subCommand:"h2",type:"Basic Block",iconCss:"e-rte-h2"},{command:"Heading 3",subCommand:"h3",type:"Basic Block",iconCss:"e-rte-h3"},{command:"Heading 4",subCommand:"h4",type:"Basic Block",iconCss:"e-rte-h4"},{command:"OrderedList",subCommand:"insertOrderedList",type:"Basic Block",iconCss:"e-list-ordered e-icons"},{command:"UnorderedList",subCommand:"insertUnorderedList",type:"Basic Block",iconCss:"e-list-unordered e-icons"},{command:"Blockquote",subCommand:"blockquote",type:"Basic Block",iconCss:"e-blockquote e-icons"},{command:"CodeBlock",subCommand:"pre",type:"Basic Block",iconCss:"e-code-view e-icons"}],Uet=[{command:"Image",subCommand:Y3e.InsertImage,type:"Media",module:"Image",iconCss:"e-icons e-image"},{command:"Audio",subCommand:Y3e.InsertAudio,type:"Media",module:"Audio",iconCss:"e-icons e-audio"},{command:"Video",subCommand:Y3e.InsertVideo,type:"Media",module:"Video",iconCss:"e-icons e-video"},{command:"Link",subCommand:Y3e.InsertLink,type:"Inline",module:"Link",iconCss:"e-icons e-link"},{command:"Table",subCommand:Y3e.InsertTable,type:"Basic Block",module:"Table",iconCss:"e-icons e-table"},{command:"Emojipicker",subCommand:null,type:"Inline",module:"EmojiPicker",iconCss:"e-icons e-emoji"}];qet=function(e,t){return(qet=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])}))(e,t)};var qet,Get,Yet=function(){return(Yet=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Xet=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Ket=(function(e,t){function i(){this.constructor=e}qet(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Jet,Get=Ji),Jet.prototype.requiredModules=function(){var e=[];return this.toolbarSettings.enable&&(e.push({member:"toolbar",args:[this,this.serviceLocator]}),e.push({member:"link",args:[this,this.serviceLocator]}),e.push({member:"table",args:[this,this.serviceLocator]}),e.push({member:"image",args:[this,this.serviceLocator]}),e.push({member:"audio",args:[this,this.serviceLocator]}),e.push({member:"video",args:[this,this.serviceLocator]}),this.quickToolbarSettings.enable)&&e.push({member:"quickToolbar",args:[this,this.serviceLocator]}),"HTML"===this.editorMode&&this.slashMenuSettings.enable&&e.push({member:"slashMenu",args:[this,this.serviceLocator]}),this.showCharCount&&e.push({member:"count",args:[this,this.serviceLocator]}),"Markdown"===this.editorMode&&e.push({member:"markdownEditor",args:[this,this.serviceLocator]}),"HTML"===this.editorMode&&(e.push({member:"htmlEditor",args:[this,this.serviceLocator]}),e.push({member:"pasteCleanup",args:[this,this.serviceLocator]}),e.push({member:"importExport",args:[this,this.serviceLocator]}),e.push({member:"formatPainter",args:[this]}),e.push({member:"emojiPicker",args:[this,this.serviceLocator]})),this.fileManagerSettings.enable&&e.push({member:"fileManager",args:[this,this.serviceLocator]}),this.enableResize&&e.push({member:"resize",args:[this]}),e},Jet.prototype.updateEnable=function(){this.enabled?(q([this.element],LWe),this.element.setAttribute("aria-disabled","false"),je(this.htmlAttributes.tabindex)?this.inputElement.setAttribute("tabindex","0"):this.inputElement.setAttribute("tabindex",this.htmlAttributes.tabindex)):(this.getToolbar()&&(q(this.getToolbar().querySelectorAll("."+B8e),B8e),q([this.getToolbar().parentElement],[HWe])),U([this.element],LWe),this.element.tabIndex=-1,this.element.setAttribute("aria-disabled","true"),this.inputElement.setAttribute("tabindex","-1"))},Jet.prototype.setEnable=function(){this.updateEnable(),this.enabled?this.eventInitializer():this.unWireEvents()},Jet.prototype.initializeValue=function(){this.isFocusOut=!1,this.isRTE=!1,this.isBlur=!0,this.defaultResetValue=null,this.isResizeInitialized=!1},Jet.prototype.preRender=function(){this.initializeValue(),this.clickPoints={clientX:0,clientY:0},this.initialValue=this.value,this.serviceLocator=new Aqe,this.initializeServices(),this.setContainer(),this.persistData(),gt(this.element,{width:T(this.width)}),pt(this.element,{role:"application","aria-label":"Rich Text Editor"}),this.beforeRenderClassValue=this.element.getAttribute("class")},Jet.prototype.persistData=function(){var e;this.enablePersistence&&"TEXTAREA"===this.originalElement.tagName&&(this.element.id=this.originalElement.id+"_wrapper",je(e=window.localStorage.getItem(this.getModuleName()+this.element.id))||""===e||this.setProperties(JSON.parse(e),!0))},Jet.prototype.setContainer=function(){this.originalElement=this.element.cloneNode(!0),null!==this.value&&null===this.valueTemplate||this.setValue(),this.element.hasAttribute("tabindex")&&(this.htmlAttributes={tabindex:this.element.getAttribute("tabindex")},this.element.removeAttribute("tabindex")),this.element.innerHTML="";for(var e,t=["class","style","id","ejs-for"],i={},n=0;n<this.element.attributes.length;n++)-1!==t.indexOf(this.element.attributes[n].name)||/^data-val/.test(this.element.attributes[n].name)||(i[this.element.attributes[n].name]=this.element.getAttribute(this.element.attributes[n].name));if(Pe(i,this.htmlAttributes,i),this.setProperties({htmlAttributes:i},!0),je(this.htmlAttributes.id)||(this.element.id=this.htmlAttributes.id),this.internalID=this.element.id,"TEXTAREA"===this.element.tagName?(e=this.createElement("div",{className:this.element.getAttribute("class")}),this.element.innerHTML="",this.element.parentElement.insertBefore(e,this.element),this.valueContainer=this.element,q([this.valueContainer],this.element.getAttribute("class").split(" ")),this.element=e):this.valueContainer=this.createElement("textarea",{id:this.getID()+"-value",attrs:{"aria-labelledby":this.getID()}}),this.valueContainer.name=this.getID(),U([this.valueContainer],lQe),!je(this.cssClass))for(var o=this.cssClass.split(" "),r=0;r<o.length;r++)U([this.valueContainer],o[r]);this.rootContainer=this.createElement("div",{className:NWe,attrs:{role:"presentation"}}),this.element.appendChild(this.rootContainer),this.rootContainer.appendChild(this.valueContainer)},Jet.prototype.getPersistData=function(){return this.addOnPersist(["value"])},Jet.prototype.focusIn=function(){this.enabled&&(this.inputElement.focus(),this.focusHandler({}))},Jet.prototype.focusOut=function(){this.enabled&&(this.inputElement.blur(),this.blurHandler({}))},Jet.prototype.selectAll=function(){this.notify(p5e,{})},Jet.prototype.selectRange=function(e){this.notify(c5e,{range:e})},Jet.prototype.getSelection=function(){var t="";return this.notify(u5e,{callBack:function(e){t=e}}),t},Jet.prototype.showEmojiPicker=function(e,t){this.readonly||this.notify(fWe,{x:e,y:t})},Jet.prototype.executeCommand=function(e,t,i){if("importWord"===e){for(var n=this.createElement("div"),o=(n.innerHTML=t,n.querySelectorAll("table:not(.e-rte-table):not(.e-rte-paste-table)")),r=0;r<o.length;r++)o[r].classList.add("e-rte-paste-table");t=n.innerHTML,n.remove(),e="insertHTML"}t=this.htmlPurifier(e,t),"HTML"===this.editorMode&&(n=this.getRange(),this.iframeSettings.enable&&this.formatter.editorManager.nodeSelection.Clear(this.element.ownerDocument),this.iframeSettings.enable&&n.startContainer===this.inputElement||!this.inputElement.contains(n.startContainer))&&this.focusIn();n=Sqe[""+e];if(i&&i.undo&&i.undo&&0===this.formatter.getUndoRedoStack().length&&this.formatter.saveData(),-1!==this.maxLength&&!je(n.command)){var e=0,s=("Links"===n.command&&(e=(0===t.text.length?t.url:t.text).length),"Images"!==n.command&&"Table"!==n.command&&"Files"!==n.command||(e=1),"InsertHTML"===n.command&&(je(t)?je(n.value)||"<hr/>"!==n.value&&"<br/>"!==n.value||(e=1):((s=this.createElement("div")).innerHTML=t,e=s.textContent.length)),"InsertText"===n.command&&(e=t.length),this.getText().trim().replace(/(\r\n|\n|\r|\t)/gm,"").replace(/\u200B/g,"").length),a=this.getSelection().length;if(!(-1===this.maxLength||s-a+e<=this.maxLength))return}s=t,"FormatPainter"===n.command&&(je(t)||(this.formatPainterSettings=t),s={formatPainterAction:n.value}),this.formatter.editorManager.execCommand(n.command,n.subCommand||s||n.value,null,null,s||n.value,s||("UL"===n.value||"OL"===n.value?null:n.value),null,this.enterKey),qUe(this.contentModule.getDocument(),this.inputElement),i&&i.undo&&(this.formatter.saveData(),this.formatter.enableUndo(this)),this.setPlaceHolder(),this.notify(Z3e,{})},Jet.prototype.htmlPurifier=function(e,t){if("HTML"===this.editorMode)switch(e){case"insertHTML":this.enableHtmlSanitizer&&(t="string"==typeof t?(t=t.replace(/&(times|divide|ne)/g,"&amp;amp;$1"),this.htmlEditorModule.sanitizeHelper(t)):this.htmlEditorModule.sanitizeHelper(t.outerHTML));break;case"insertTable":je(t.width)&&(t.width={minWidth:this.tableSettings.minWidth,maxWidth:this.tableSettings.maxWidth,width:this.tableSettings.width});break;case"insertImage":var i=(o=this.createElement("img",{attrs:{src:t.url}})).outerHTML;i=je(i=""!==(i=this.enableHtmlSanitizer?this.htmlEditorModule.sanitizeHelper(o.outerHTML):i)&&this.createElement("div",{innerHTML:i}).firstElementChild.getAttribute("src")||null)?"":i,t.url=i,je(t.width)&&(t.width={minWidth:this.insertImageSettings.minWidth,maxWidth:this.insertImageSettings.maxWidth,width:this.insertImageSettings.width}),je(t.height)&&(t.height={minHeight:this.insertImageSettings.minHeight,maxHeight:this.insertImageSettings.maxHeight,height:this.insertImageSettings.height});break;case"insertAudio":var n=this.createElement("audio",{attrs:{controls:""}}),o=this.createElement("source",{attrs:{src:t.url,type:t.url&&0<t.url.split(".").length?"audio/"+t.url.split(".")[t.url.split(".").length-1]:""}}),r=(n.appendChild(o),n.outerHTML);i=je(i=""!==(r=this.enableHtmlSanitizer?this.htmlEditorModule.sanitizeHelper(n.outerHTML):r)&&this.createElement("div",{innerHTML:r}).firstElementChild.firstElementChild.getAttribute("src")||null)?"":i,t.url=i;break;case"insertVideo":n=this.createElement("video",{attrs:{controls:""}}),o=this.createElement("source",{attrs:{src:t.url,type:t.url&&0<t.url.split(".").length?"video/"+t.url.split(".")[t.url.split(".").length-1]:""}}),r=(n.appendChild(o),n.outerHTML);i=je(i=""!==(r=this.enableHtmlSanitizer?this.htmlEditorModule.sanitizeHelper(o.outerHTML):r)&&this.createElement("div",{innerHTML:r}).firstElementChild.getAttribute("src")||null)?"":i,t.url=i,je(t.width)&&(t.width={minWidth:this.insertVideoSettings.minWidth,maxWidth:this.insertVideoSettings.maxWidth,width:this.insertVideoSettings.width}),je(t.height)&&(t.height={minHeight:this.insertVideoSettings.minHeight,maxHeight:this.insertVideoSettings.maxHeight,height:this.insertVideoSettings.height});break;case"createLink":n=this.createElement("a",{attrs:{href:t.url}}),o=n.outerHTML,r=je(r=""!==(o=this.enableHtmlSanitizer?this.htmlEditorModule.sanitizeHelper(n.outerHTML):o)&&this.createElement("div",{innerHTML:o}).firstElementChild.getAttribute("href")||null)?"":r;t.url=r}return t},Jet.prototype.encode=function(e){var t=this.createElement("div");return t.innerText=e.trim(),t.innerHTML.replace(/<br\s*[\/]?>/gi,"\n")},Jet.prototype.render=function(){this.setProperties({value:this.replaceEntities(this.value)},!0),this.value&&!this.valueTemplate&&this.setProperties({value:this.serializeValue(this.value)},!0),this.value="Markdown"===this.editorMode||je(this.value)?this.value:this.addAnchorAriaLabel(this.value),this.renderModule=new $6e(this,this.serviceLocator),this.sourceCodeModule=new aqe(this,this.serviceLocator),this.notify(J3e,{}),this.trigger("load"),this.RTERender();new Eqe(this);this.userAgentData=new m9e(F.userAgent,!1),this.notify($3e,{}),this.enableXhtml&&this.setProperties({value:this.getXhtml()},!0),this.toolbarSettings.enable&&("Expand"===this.toolbarSettings.type||"MultiRow"===this.toolbarSettings.type||"Scrollable"===this.toolbarSettings.type)&&!je(this.getToolbar())&&-1<this.toolbarSettings.items.indexOf("Undo")&&-1<this.toolbarSettings.items.indexOf("Redo")&&this.disableToolbarItem(["Undo","Redo"]),null!==this.value&&(this.valueContainer.defaultValue=this.value),this.enabled&&!this.readonly?this.eventInitializer():this.unWireEvents(),this.notify(uWe,{cssClass:this.getCssClass()}),this.addAudioVideoWrapper(),this.notify(K3e,{}),this.autoResize(),this.renderComplete()},Jet.prototype.addAudioVideoWrapper=function(){for(var e,t,i,n=this,o=this.element.querySelectorAll("audio"),r=0;r<o.length;r++)o[r].classList.contains("e-rte-audio")||(o[r].classList.add("e-rte-audio"),o[r].classList.add(T8e)),o[r].parentElement.classList.contains(y8e)||o[r].parentElement.classList.contains(b8e)||(rt(t=this.createElement("span",{className:b8e}),"width:300px; margin:0 auto;"),t.contentEditable="false",i=this.createElement("span",{className:y8e}),t.appendChild(i),o[r].parentNode.insertBefore(t,o[r].nextSibling),i.appendChild(o[r]),null===t.nextElementSibling&&(e=this.createElement("br"),t.parentNode.insertBefore(e,t.nextSibling)));for(var s,a=this.element.querySelectorAll("video"),r=0;r<a.length;r++)a[r].classList.contains("e-rte-video")||(a[r].classList.add("e-rte-video"),a[r].classList.add(E8e)),a[r].parentElement.classList.contains(y8e)||a[r].parentElement.classList.contains(w8e)||((s=this.createElement("span",{className:w8e})).contentEditable="false",a[r].parentNode.insertBefore(s,a[r].nextSibling),s.appendChild(a[r]),null===s.nextElementSibling&&(e=this.createElement("br"),s.parentNode.insertBefore(e,s.nextSibling))),-1!==F.userAgent.indexOf("Firefox")&&(a[r].addEventListener("play",function(e){n.notify(o5e,{args:e}),n.notify("editAreaClick",{args:e})}),a[r].addEventListener("pause",function(e){n.notify(o5e,{args:e}),n.notify("editAreaClick",{args:e})}))},Jet.prototype.eventInitializer=function(){this.wireEvents()},Jet.prototype.cleanList=function(e){var t=this.getRange(),i=t.startContainer,n=t.endContainer,o=t.startOffset,r=i===n,s=(n.textContent.length,"#text"===t.endContainer.nodeName?t.endContainer.parentElement:t.endContainer),a=z(s,"LI"),l=!1,h=t.endOffset;if(n.nodeType===Node.TEXT_NODE&&"\ufeff"===n.textContent.charAt(h-1)&&h--,!je(a)&&s.textContent.trim().length===h&&!t.collapsed&&je(s.nextElementSibling)&&!s.classList.contains(EQe)){for(var d=0;d<a.childNodes.length;d++)"#text"===a.childNodes[d].nodeName&&0===a.childNodes[d].textContent.trim().length&&(G(a.childNodes[d]),l=!0,d--);for(var p=a;null!==p.lastChild&&"#text"!==p.nodeName;)p=p.lastChild;l&&(n="BR"!==p.nodeName||je(p.previousSibling)?p:p.previousSibling,this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(),r?n:i,n,o,"BR"===n.nodeName?0:n.textContent.length))}},Jet.prototype.keyDown=function(e){var t="macOS"===this.userAgentData.getPlatform();if(((e.ctrlKey||e.metaKey&&t)&&e.shiftKey&&86===e.keyCode||e.metaKey&&t&&e.altKey&&e.shiftKey&&86===e.keyCode)&&(this.isPlainPaste=!0),this.inputElement.classList.contains("e-mention")){var t=this.element.ownerDocument.getElementById(this.inputElement.id+"_popup"),i=this.element.ownerDocument.getElementById(this.inputElement.id+"_slash_menu_popup"),n=-1!==jUe.indexOf(e.key),t=t&&t.classList.contains("e-popup-open"),i=i&&i.classList.contains("e-popup-open");if(n&&(t||i))return}if(this.enableTabKey&&(this.quickToolbarModule&&!e.altKey&&"F10"!==e.key&&"toolbar-focus"!==e.action&&this.quickToolbarModule.hideQuickToolbars(),n=!(!this.imageModule||!this.imageModule.imgResizeDiv),t=!(!this.videoModule||!this.videoModule.vidResizeDiv),n&&this.imageModule.cancelResizeAction(),t)&&this.videoModule.cancelResizeAction(),this.notify(u4e,{member:"keydown",args:e}),this.restrict(e),"HTML"===this.editorMode&&this.cleanList(e),"HTML"===this.editorMode&&(8===e.which&&"Backspace"===e.code||46===e.which&&"Delete"===e.code))if(z("#text"===(h=this.getRange()).startContainer.nodeName?h.startContainer.parentElement:h.startContainer,"pre")&&8===e.which&&8203===h.startContainer.textContent.charCodeAt(h.startOffset-1)||46===e.which&&8203===h.startContainer.textContent.charCodeAt(h.startOffset)){i=new RegExp("​","g"),n=8===e.which?h.startOffset-1:h.startOffset;h.startContainer.textContent=h.startContainer.textContent.replace(i,""),this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(),h.startContainer,n)}else if("Backspace"===e.code&&8===e.which&&8203===h.startContainer.textContent.charCodeAt(0)&&h.collapsed){for(var o=h.startContainer.parentElement,r=void 0,s=void 0,s=0;s<o.childNodes.length;s++)o.childNodes[s]===h.startContainer&&(r=s);var a=!0,l=[];for(s=r;0<=s;s--)3===o.childNodes[s].nodeType&&8203===o.childNodes[s].textContent.charCodeAt(0)&&a?l.push(s):a=!1;if(0<l.length)for(s=l.length-1;0<s;s--)o.childNodes[l[s]].textContent="";this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(),h.startContainer,h.startOffset)}var h,t=!!je(e.action)||"format-copy"!==e.action,i=(0===this.formatter.getUndoRedoStack().length&&t&&!(e.altKey||e.shiftKey&&16===e.which||e.altKey&&e.shiftKey&&67===e.which)&&this.formatter.saveData(),!1);"HTML"===this.editorMode&&(i=!je((h=this.getRange()).startContainer)&&h.startContainer===h.endContainer&&1<h.endContainer.childNodes.length&&!je(h.startContainer.childNodes[h.startOffset-1])&&"#text"===h.startContainer.childNodes[h.startOffset-1].nodeName&&!je(h.startContainer.childNodes[h.startOffset-1].previousSibling)&&32===h.startContainer.childNodes[h.startOffset-1].textContent.charCodeAt(0)&&h.startContainer.childNodes[h.startOffset-1].previousSibling.classList.contains("e-mention-chip"));if(-1===["insert-link","format-copy","format-paste","insert-image","insert-table","insert-audio","insert-video"].indexOf(e.action)&&(!e.target||!e.target.classList.contains("e-mention")||je(document.querySelector("#"+e.target.id+"_popup.e-popup-open"))||"Tab"!==e.code)&&(e.action&&"paste"!==e.action&&"space"!==e.action||9===e.which||"Backspace"===e.code&&8===e.which)&&!i){var d,p,c,n=!1;switch((n=je(this.formatPainterModule)?n:"escape"===this.formatPainterModule.previousAction)||("HTML"!==this.editorMode||"increase-fontsize"!==e.action&&"decrease-fontsize"!==e.action?this.formatter.process(this,null,e):this.notify(kWe,{member:"onHandleFontsizeChange",args:e})),e.action){case"toolbar-focus":this.toolbarSettings.enable&&this.getToolbarElement()&&(this.userAgentData.isSafari()&&"keydown"===e.type&&this.formatter.editorManager.nodeSelection&&0<this.formatter.editorManager.nodeSelection.get(this.contentModule.getDocument()).rangeCount&&this.inputElement.contains(this.getRange().startContainer)&&this.notify(t5e,{}),d="toolbar",p=this.getToolbarElement().querySelector(".e-toolbar-item:not(.e-overlay)[title]"),(c=this.getRenderedQuickToolbarElem())&&(p=c.querySelector(".e-toolbar-item:not(.e-overlay)[title]"),d="quickToolbar"),p)&&((c=p.firstElementChild).removeAttribute("tabindex"),c.focus(),!this.userAgentData.isSafari()||"toolbar"!==d&&"quickToolbar"!==d||this.inputElement.ownerDocument.getSelection().removeAllRanges());break;case"escape":this.contentModule.getEditPanel().focus()}}this.notify(wWe,{member:"afterKeyDown",args:e}),this.autoResize(),je(this.placeholder)||this.setPlaceHolder(),je(e)||je(e.code)||"Backspace"!==e.code&&"Delete"!==e.code||(h=this.contentModule.getDocument().getSelection().getRangeAt(0),(t=document.createElement("div")).appendChild(h.cloneContents()),t.innerHTML===this.inputElement.innerHTML&&(this.isCopyAll=!0)),e.metaKey&&"Backspace"===e.key&&this.autoSaveOnIdle&&this.keyUp(e)},Jet.prototype.keyUp=function(e){var t;"HTML"===this.editorMode&&(o=this.getRange(),je(e)||je(e.code)||"Backspace"!==e.code&&"Delete"!==e.code||(n=this.getRange(),i=(this.iframeSettings.enable?this.contentModule.getPanel().ownerDocument:this.contentModule.getDocument()).getSelection(),this.isCopyAll&&(t=this.createElement("br"),r="BR"===this.enterKey?t:this.createElement(this.enterKey).appendChild(t).parentElement,this.inputElement.innerHTML="",this.inputElement.appendChild(r),this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(),t,0),this.isCopyAll=!1),0<i.rangeCount&&"INPUT"!==this.contentModule.getDocument().activeElement.tagName&&this.inputElement.contains(this.contentModule.getDocument().activeElement)&&"<br>"===o.startContainer.innerHTML&&""===o.startContainer.textContent&&(i.removeAllRanges(),i.addRange(n))),-1!==F.userAgent.indexOf("Firefox"))&&"#text"===o.startContainer.nodeName&&o.startContainer.parentElement===this.inputElement&&"BR"!==this.enterKey&&(r=this.getRange(),t=this.createElement(this.enterKey),r.startContainer.parentElement.insertBefore(t,r.startContainer),t.appendChild(r.startContainer),this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(),t.childNodes[0],t.childNodes[0],t.childNodes[0].textContent.length,t.childNodes[0].textContent.length));0===this.formatter.getCurrentStackIndex()&&this.updateUndoRedoStack(e),this.notify(c4e,{member:"keyup",args:e}),this.notify(p4e,{member:"tableModulekeyUp",args:e}),"KeyX"!==e.code||88!==e.which||88!==e.keyCode||!e.ctrlKey||""!==this.inputElement.innerHTML&&"<br>"!==this.inputElement.innerHTML||(this.inputElement.innerHTML=G6e(V6e(H6e(this),this),this.editorMode));var i=this.inputElement.classList.contains("e-mention"),n=32===e.which||13===e.which||8===e.which||46===e.which||9===e.which&&i,o="C"===e.key&&e.altKey&&e.shiftKey,r="V"===e.key&&e.altKey&&e.shiftKey;(!o&&!r&&("shift"!==e.key&&!e.ctrlKey&&e.key&&1===e.key.length||n)||"Markdown"===this.editorMode&&("shift"!==e.key&&!e.ctrlKey&&e.key&&1===e.key.length||n)||this.autoSaveOnIdle&&F.isDevice&&!this.inlineMode.enable)&&this.formatter.onKeyHandler(this,e),(this.inputElement&&0!==this.inputElement.textContent.length||0<this.element.querySelectorAll(".e-toolbar-item.e-active").length||0<this.formatter.getUndoRedoStack().length)&&this.notify(n4e,{args:e}),this.setPlaceHolder()},Jet.prototype.serializeValue=function(e){return e="HTML"!==this.editorMode||je(e)?e:this.enableHtmlEncode?(e=this.htmlEditorModule.sanitizeHelper(j6e(e)),this.encode(e)):(e=this.htmlEditorModule.sanitizeHelper(e),this.enableXhtml?this.htmlEditorModule.xhtmlValidation.selfEncloseValidation(e):e)},Jet.prototype.sanitizeHtml=function(e){return this.serializeValue(e)},Jet.prototype.updateValue=function(e){var t;je(e)?(t=this.inputElement.innerHTML,this.setProperties({value:z6e(t)?null:t})):this.setProperties({value:e})},Jet.prototype.triggerEditArea=function(e){var t;I6e()&&(t=e.touches?e.changedTouches[0]:e,this.clickPoints.clientX!==t.clientX||this.clickPoints.clientY!==t.clientY)||this.notify(s5e,{member:"editAreaClick",args:e})},Jet.prototype.notifyMouseUp=function(e){var t=e.touches?e.changedTouches[0]:e;this.notify(f4e,{member:"mouseUp",args:e,touchData:{prevClientX:this.clickPoints.clientX,prevClientY:this.clickPoints.clientY,clientX:t.clientX,clientY:t.clientY}}),(this.inputElement&&("HTML"===this.editorMode&&(0!==this.inputElement.textContent.length||e.target&&!je(e.target.querySelector("li")))||"Markdown"===this.editorMode&&0!==this.inputElement.value.length)||e.target&&!je(z(e.target,"table"))||e.target&&!je(e.target.querySelector("img"))||e.target&&("VIDEO"===e.target.nodeName||0<e.target.querySelectorAll("."+w8e).length)||e.target&&"BR"!==e.target.nodeName&&(e.target.classList.contains(b8e)||e.target.classList.contains(y8e)||e.target.classList.contains(v8e)))&&this.notify(n4e,{args:e}),this.triggerEditArea(e)},Jet.prototype.updateUndoRedoStack=function(e){var t,i=this.formatter.getUndoRedoStack(),n=this.formatter.getCurrentStackIndex(),o=-1!==["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].indexOf(e.key),e="keyup"!==e.type||o;0!==i.length&&0!==n||(0===i.length?this.formatter.saveData():0===n&&"HTML"===this.editorMode&&e?(o=i[0],t=new _9e(this.inputElement).save(this.getRange(),this.contentModule.getDocument()),o.range=t):0===n&&"Markdown"===this.editorMode&&e&&(o=i[0],t=this.inputElement.selectionStart,n=this.inputElement.selectionEnd,o.start=t,o.end=n))},Jet.prototype.mouseUp=function(e){if(this.quickToolbarSettings.showOnRightClick&&F.isDevice){var t=e.target,i=z(t,"table");if(t&&"A"===t.nodeName||"IMG"===t.nodeName||"TD"===t.nodeName||"TH"===t.nodeName||"TABLE"===t.nodeName||i&&this.contentModule.getEditPanel().contains(i))return}this.notifyMouseUp(e),this.setPlaceHolder(),this.autoResize(),this.updateUndoRedoStack(e)},Jet.prototype.ensureModuleInjected=function(e){return 0<=this.getInjectedModules().indexOf(e)},Jet.prototype.onCopy=function(){this.contentModule.getDocument().execCommand("copy",!1,null)},Jet.prototype.onCut=function(){this.contentModule.getDocument().execCommand("cut",!1,null)},Jet.prototype.onPaste=function(s){var a=this,e={originalEvent:s,cancel:!1,requestType:"Paste"};this.isPlainPaste=s&&s.clipboardData&&s.clipboardData.items&&s.clipboardData.items.length&&1===s.clipboardData.items.length&&"text/plain"===s.clipboardData.items[0].type,this.trigger(O4e,e,function(e){var t,i,n,o,r=a.getText().replace(/\u200B/g,"").replace("HTML"===a.editorMode?/(\r\n|\n|\r|\t)/gm:"","").length-a.getSelection().length+(je(s)||je(s.clipboardData)?0:s.clipboardData.getData("text/plain").replace(/(\r\n|\n|\r|\t)/gm,"").replace(/\u200B/g,"").length);"Markdown"===a.editorMode?(t={requestType:"Paste",editorMode:a.editorMode,event:s},setTimeout(function(){a.formatter.onSuccess(a,t)},0),-1===a.maxLength||r<=a.maxLength||s.preventDefault()):!e.cancel&&"true"===a.inputElement.contentEditable&&(-1===a.maxLength||r<=a.maxLength)?(e=a.contentModule.getDocument().querySelector(".e-rte-img-dialog"),je(a.pasteCleanupModule)?a.isPlainPaste||(console.warn('[WARNING] :: Module "pasteCleanup" is not available in RichTextEditor component! You either misspelled the module name or forgot to load it.'),r=null,n=!(i={requestType:"Paste",editorMode:a.editorMode,event:s}),s&&!je(s.clipboardData)&&(r=s.clipboardData.getData("text/plain"),n=0<s.clipboardData.getData("text/html").indexOf("MsoNormal")),o=s&&s.clipboardData&&0<s.clipboardData.items.length?s.clipboardData.items[0].getAsFile():null,null!==r&&a.notify(m5e,{file:o,args:s,text:r,isWordPaste:n}),setTimeout(function(){a.formatter.onSuccess(a,i)},0)):je(e)&&a.notify(S5e,{args:s,isPlainPaste:a.isPlainPaste})):s.preventDefault()}),this.isPlainPaste=!1},Jet.prototype.clipboardAction=function(e,t){switch(e.toLowerCase()){case"cut":this.onCut(),this.formatter.onSuccess(this,{requestType:"Cut",editorMode:this.editorMode,event:t});break;case"copy":this.onCopy(),this.formatter.onSuccess(this,{requestType:"Copy",editorMode:this.editorMode,event:t});break;case"paste":this.onPaste(t)}},Jet.prototype.destroy=function(){if(!this.isDestroyed&&this.isRendered){if(this.element.className=this.beforeRenderClassValue,this.removeHtmlAttributes(),this.removeAttributes(),this.beforeRenderClassValue=null,je(this.timeInterval)||(clearInterval(this.timeInterval),this.timeInterval=null),je(this.autoSaveTimeOut)||(clearTimeout(this.autoSaveTimeOut),this.autoSaveTimeOut=null),je(this.idleInterval)||(clearTimeout(this.idleInterval),this.idleInterval=null),this.notify(t4e,{}),this.destroyDependentModules(),this.unWireEvents(),"TEXTAREA"===this.originalElement.tagName){this.element.parentElement.insertBefore(this.valueContainer,this.element),this.valueContainer.id=this.getID(),this.valueContainer.removeAttribute("name"),G(this.element),""!==this.originalElement.innerHTML.trim()?(this.valueContainer.value=this.originalElement.innerHTML.trim(),this.setProperties({value:je(this.initialValue)?null:this.initialValue},!0)):this.valueContainer.value=this.valueContainer.defaultValue,this.element=this.valueContainer;for(var e=0;e<this.originalElement.classList.length;e++)U([this.element],this.originalElement.classList[e]);if(!je(this.cssClass))for(var t=this.cssClass.split(" "),e=0;e<t.length;e++)U([this.element],t[e]);q([this.element],lQe)}else""!==this.originalElement.innerHTML.trim()?(this.element.innerHTML=this.originalElement.innerHTML.trim(),this.setProperties({value:je(this.initialValue)?null:this.initialValue},!0)):this.element.innerHTML="";var i=document.querySelector(".e-dialog.e-rte-elements");if(i&&G(i),this.placeholder&&this.placeHolderWrapper&&(this.placeHolderWrapper=null),!je(this.cssClass))for(var n=this.cssClass.split(" "),e=0;e<n.length;e++)""!==n[e].trim()&&q([this.element],n[e]);this.rootContainer&&(this.rootContainer=null),this.valueContainer&&(this.valueContainer=null),this.originalElement&&(this.originalElement=null),this.currentTarget=null,this.scrollParentElements=[],this.userAgentData=null,this.isRendered=!1,Get.prototype.destroy.call(this)}},Jet.prototype.removeHtmlAttributes=function(){if(this.htmlAttributes)for(var e=Object.keys(this.htmlAttributes),t=0;t<e.length&&this.element.hasAttribute(e[t]);t++)this.element.removeAttribute(e[t])},Jet.prototype.removeAttributes=function(){this.enabled||q([this.element],LWe),this.enableRtl&&q([this.element],FWe),this.readonly&&q([this.element],$8e),""!==this.element.style.width&&""===this.originalElement.style.width&&this.element.style.removeProperty("width"),""!==this.element.style.height&&""===this.originalElement.style.height&&this.element.style.removeProperty("height"),this.element.removeAttribute("aria-disabled"),this.element.removeAttribute("role"),this.element.removeAttribute("tabindex"),this.element.removeAttribute("aria-label")},Jet.prototype.destroyDependentModules=function(){this.renderModule.destroy(),this.formatter.editorManager.destroy()},Jet.prototype.getContent=function(){return this.contentModule.getPanel()},Jet.prototype.getText=function(){return this.contentModule.getText()},Jet.prototype.getSelectedHtml=function(){var e=this.createElement("div"),t=this.contentModule.getDocument().getSelection();return 0<t.rangeCount&&(t=t.getRangeAt(0).cloneContents(),e.appendChild(t)),e.innerHTML},Jet.prototype.showInlineToolbar=function(){var e,t,i;this.inlineMode.enable&&(e="#text"===(t=this.getRange()).endContainer.nodeName?t.endContainer.parentElement:t.endContainer,0<(i=0===(i=Array.from(t.getClientRects(),function(e){return e})).length?[t.startContainer.getBoundingClientRect()]:i).length)&&(t=i[0].left,i=i[0].top,this.quickToolbarModule.showInlineQTBar(t,i,e))},Jet.prototype.hideInlineToolbar=function(){this.quickToolbarModule.hideInlineQTBar()},Jet.prototype.getModuleName=function(){return"richtexteditor"},Jet.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];switch(o){case"enterKey":case"value":var r=void 0,r="enterKey"===o?null===this.value||"<div><br></div>"===this.value||"<p><br></p>"===this.value||"<br>"===this.value?null:this.value:e[o],s=(r="HTML"===this.editorMode?this.replaceEntities(r):r,r=this.serializeValue(r),"HTML"===this.editorMode?V6e(r,this):r);(je(r)||""===r)&&"enterKey"!==o||this.setProperties({value:this.enableHtmlEncode?this.encode(j6e(s)):s},!0),this.updatePanelValue(),this.inputElement&&this.notify(K3e,{}),this.setPlaceHolder(),this.notify(G5e,{module:"XhtmlValidation",newProp:e,oldProp:t}),this.enableXhtml&&this.setProperties({value:this.getXhtml()},!0),this.showCharCount&&this.countModule.refresh(),this.addAudioVideoWrapper();break;case"valueTemplate":this.setValue(!0),this.showCharCount&&this.countModule.refresh();break;case"width":this.setWidth(e[o]),this.toolbarSettings.enable&&!this.inlineMode.enable&&(this.toolbarModule.refreshToolbarOverflow(),this.resizeHandler());break;case"height":this.setHeight(e[o]),this.autoResize();break;case"readonly":this.setReadOnly(!1);break;case"cssClass":this.element.classList.remove(t[o]),this.setCssClass(e[o]),this.notify(uWe,{cssClass:e[o],oldCssClass:t[o]});break;case"enabled":this.setEnable();break;case"enableRtl":this.updateRTL();break;case"placeholder":this.placeholder=e[o],this.setPlaceHolder();break;case"htmlAttributes":Oet(this.htmlAttributes,this,!1,!1);break;case"iframeSettings":var a,r=t[o];r.resources&&(s=this.contentModule.getDocument().querySelector("head"),a=void 0,r.resources.scripts&&(a=s.querySelectorAll("."+RWe),this.removeSheets(a)),r.resources.styles)&&(a=s.querySelectorAll("."+OWe),this.removeSheets(a)),this.setIframeSettings();break;case"locale":Get.prototype.refresh.call(this);break;case"inlineMode":this.notify(d4e,{module:"quickToolbar",newProp:e,oldProp:t});break;case"toolbarSettings":this.notify(d4e,{module:"toolbar",newProp:e,oldProp:t});break;case"maxLength":this.showCharCount&&this.countModule.refresh();break;case"showCharCount":e[o]&&this.countModule?this.countModule.renderCount():!1===e[o]&&this.countModule&&this.countModule.destroy();break;case"enableHtmlEncode":this.updateValueData(),this.updatePanelValue(),this.setPlaceHolder(),this.showCharCount&&this.countModule.refresh();break;case"undoRedoSteps":case"undoRedoTimer":this.formatter.editorManager.observer.notify(l7e,{newProp:e,oldProp:t});break;case"enableXhtml":this.notify(G5e,{module:"XhtmlValidation",newProp:e,oldProp:t});break;case"quickToolbarSettings":e.quickToolbarSettings.showOnRightClick?this.wireContextEvent():this.unWireContextEvent(),this.notify(d4e,{newProp:e,oldProp:t});break;case"formatPainterSettings":this.formatter.editorManager.observer.notify(l7e,{module:"formatPainter",newProp:e});break;default:this.notify(d4e,{newProp:e,oldProp:t})}this.autoResize()}},Jet.prototype.updateValueData=function(){this.enableHtmlEncode?this.setProperties({value:this.encode(j6e(this.inputElement.innerHTML))},!0):this.setProperties({value:/<[a-z][\s\S]*>/i.test(this.inputElement.innerHTML)?this.inputElement.innerHTML:j6e(this.inputElement.innerHTML)})},Jet.prototype.removeSheets=function(e){for(var t=0;t<e.length;t++)G(e[t])},Jet.prototype.replaceEntities=function(e){var i=this;if("HTML"===this.editorMode&&!je(e)&&/&(amp;)*((times)|(divide)|(ne))/.test(e))for(var n=this.enableHtmlEncode||this.enableHtmlSanitizer,t=0,o=["times","divide","ne"].map(function(e){var t=!i.enableHtmlEncode&&i.enableHtmlSanitizer?"&("+e+")":"&(amp;)*("+e+")";return[n?"&amp;amp;"+e:"&amp;"+e,new RegExp(t,"g")]});t<o.length;t++){var r=o[t],s=r[0],r=r[1];r.test(e)&&(e=e.replace(r,s))}return e},Jet.prototype.updatePanelValue=function(){this.setProperties({value:this.replaceEntities(this.value)},!0);var e="HTML"===this.editorMode?this.listOrderCorrection(this.value):this.value,e=this.enableHtmlEncode&&this.value?j6e(e):e,t=this.element.querySelector("."+VQe);e?(!je(t)&&this.rootContainer.classList.contains("e-source-code-enabled")&&(t.value=this.value),this.valueContainer&&(this.valueContainer.value=this.enableHtmlEncode?this.value:e),"HTML"===this.editorMode&&this.inputElement&&this.inputElement.innerHTML.trim()!==e.trim()?this.inputElement.innerHTML=G6e(e,this.editorMode):"Markdown"===this.editorMode&&this.inputElement&&this.inputElement.value.trim()!==e.trim()&&(this.inputElement.value=e)):(!je(t)&&this.rootContainer.classList.contains("e-source-code-enabled")&&(t.value=""),"HTML"===this.editorMode?(this.inputElement.innerHTML="",e=this.createElement("br"),"DIV"===this.enterKey?((t=this.createElement("DIV")).appendChild(e),this.inputElement.appendChild(t)):"BR"===this.enterKey?this.inputElement.appendChild(e):((t=this.createElement("P")).appendChild(e),this.inputElement.appendChild(t)),this.formatter&&this.formatter.editorManager&&this.formatter.editorManager.nodeSelection&&this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(),e,0)):this.inputElement.value="",this.valueContainer&&(this.valueContainer.value="")),this.showCharCount&&this.countModule.refresh()},Jet.prototype.listOrderCorrection=function(e){for(var t=this.createElement("div"),i=(t.innerHTML=e,t.querySelectorAll("UL, OL")),n=0;n<i.length;n++)je(i[n])||je(i[n].parentElement)||je(i[n].previousElementSibling)||"UL"!==i[n].parentElement.nodeName&&"OL"!==i[n].parentElement.nodeName||i[n].previousElementSibling.appendChild(i[n]);return t.innerHTML},Jet.prototype.setHeight=function(e){this.element.style.height="auto"!==e?T(e):"auto","Expand"===this.toolbarSettings.type&&("string"==typeof this.height&&-1<this.height.indexOf("px")||"number"==typeof this.height)?this.element.classList.add(RQe):this.element.classList.remove(RQe)},Jet.prototype.setPlaceHolder=function(){this.inputElement&&this.placeholder&&!0!==this.iframeSettings.enable&&("Markdown"!==this.editorMode?(this.placeHolderWrapper||(this.placeHolderWrapper=this.createElement("span",{className:"rte-placeholder e-rte-placeholder "+this.getCssClass()}),this.fontSize.default&&(this.placeHolderWrapper.style.fontSize=this.fontSize.default),this.inputElement&&this.inputElement.parentElement.insertBefore(this.placeHolderWrapper,this.inputElement)),this.placeHolderWrapper.innerHTML=this.placeholder,0===this.inputElement.textContent.length&&this.inputElement.childNodes.length<2&&!je(this.inputElement.firstChild)&&("BR"===this.inputElement.firstChild.nodeName||("P"===this.inputElement.firstChild.nodeName||"DIV"===this.inputElement.firstChild.nodeName)&&!je(this.inputElement.firstChild.firstChild)&&this.inputElement.firstChild.childNodes.length<2&&"BR"===this.inputElement.firstChild.firstChild.nodeName)?(this.placeHolderWrapper.classList.add("enabled"),E.add(this.inputElement,"input",this.setPlaceHolder,this)):(this.placeHolderWrapper.classList.remove("enabled"),E.remove(this.inputElement,"input",this.setPlaceHolder))):this.inputElement.setAttribute("placeholder",this.placeholder)),this.placeholder&&this.iframeSettings.enable&&this.inputElement&&(!(0===this.inputElement.textContent.length&&this.inputElement.childNodes.length<2)||je(this.inputElement.firstChild)||"BR"!==this.inputElement.firstChild.nodeName&&("P"!==this.inputElement.firstChild.nodeName&&"DIV"!==this.inputElement.firstChild.nodeName||je(this.inputElement.firstChild.firstChild)||"BR"!==this.inputElement.firstChild.firstChild.nodeName)?(q([this.inputElement],"e-rte-placeholder"),E.remove(this.inputElement,"input",this.setPlaceHolder)):(U([this.inputElement],"e-rte-placeholder"),this.inputElement.setAttribute("placeholder",this.placeholder),E.add(this.inputElement,"input",this.setPlaceHolder,this)))},Jet.prototype.setWidth=function(e){"auto"!==e?gt(this.element,{width:T(this.width)}):this.element.style.width="auto"},Jet.prototype.setCssClass=function(e){if(!je(e))for(var t=e.split(" "),i=0;i<t.length;i++)""!==t[i].trim()&&this.element.classList.add(t[i])},Jet.prototype.updateRTL=function(){this.notify(f5e,{enableRtl:this.enableRtl}),this.enableRtl?(this.element.classList.add(FWe),this.inputElement.classList.add(FWe)):(this.element.classList.remove(FWe),this.inputElement.classList.remove(FWe))},Jet.prototype.updateReadOnly=function(){this.notify(C5e,{editPanel:this.inputElement,mode:this.readonly})},Jet.prototype.setReadOnly=function(e){this.updateReadOnly(),e||(this.readonly&&this.enabled?(this.unbindEvents(),this.unWireEvents()):this.enabled&&this.wireEvents())},Jet.prototype.print=function(){var t,i=this,e={element:this.inputElement,requestType:"print",cancel:!1};this.trigger(O4e,e,function(e){t=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth),"msie"===F.info.name&&t.resizeTo(screen.availWidth,screen.availHeight),t=V(i.inputElement,t),e.cancel||i.trigger(N4e,{requestType:"print"})})},Jet.prototype.refreshUI=function(){this.renderModule.refresh(),"Markdown"===this.editorMode&&this.autoResize()},Jet.prototype.showFullScreen=function(){this.fullScreenModule.showFullScreen()},Jet.prototype.enableToolbarItem=function(e,t){this.toolbarModule.enableTBarItems(this.getBaseToolbarObject(),e,!0,t)},Jet.prototype.disableToolbarItem=function(e,t){this.toolbarModule.enableTBarItems(this.getBaseToolbarObject(),e,!1,t)},Jet.prototype.removeToolbarItem=function(e){this.toolbarModule.removeTBarItems(e)},Jet.prototype.getRange=function(){return this.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument())},Jet.prototype.initializeServices=function(){this.serviceLocator.register("rendererFactory",new Iqe),this.serviceLocator.register("rteLocale",this.localeObj=new Cn(this.getModuleName(),u6e,this.locale)),this.serviceLocator.register("dialogRenderObject",new pqe(this))},Jet.prototype.RTERender=function(){var e=this.serviceLocator.getService("rendererFactory");this.contentModule=e.getRenderer(q3e.Content),this.fullScreenModule=new Net(this),this.enterKeyModule=new _et(this),this.renderModule.render(),this.inputElement=this.contentModule.getEditPanel(),this.setHeight(this.height),Oet(this.htmlAttributes,this,!1,!0),this.iframeSettings&&this.setIframeSettings(),this.setCssClass(this.cssClass),this.updateEnable(),this.setPlaceHolder(),this.updateRTL(),this.updateReadOnly(),this.updatePanelValue(),this.enableHtmlEncode&&!je(this.value)&&this.setProperties({value:this.encode(j6e(this.value))})},Jet.prototype.setIframeSettings=function(){var e,t;this.iframeSettings.resources&&(e=this.iframeSettings.resources.styles,t=this.iframeSettings.resources.scripts,!je(this.iframeSettings.resources.scripts)&&0<this.iframeSettings.resources.scripts.length&&this.InjectSheet(!0,t),!je(this.iframeSettings.resources.styles))&&0<this.iframeSettings.resources.styles.length&&this.InjectSheet(!1,e),this.iframeSettings.attributes&&Oet(this.iframeSettings.attributes,this,!0,!1)},Jet.prototype.InjectSheet=function(e,t){try{if(t&&0<t.length)for(var i,n,o=this.contentModule.getDocument().querySelector("head"),r=0;r<t.length;r++)e?((i=this.createScriptElement()).src=t[r],o.appendChild(i)):((n=this.createStyleElement()).href=t[r],o.appendChild(n))}catch(e){}},Jet.prototype.createScriptElement=function(){var e=this.createElement("script",{className:RWe});return e.type="text/javascript",e},Jet.prototype.createStyleElement=function(){var e=this.createElement("link",{className:OWe});return e.rel="stylesheet",e},Jet.prototype.setValue=function(e){var t=this;if(this.valueTemplate){var i=new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);if("string"==typeof this.valueTemplate&&i.test(this.valueTemplate))this.setProperties({value:this.valueTemplate});else{var n=oo(this.valueTemplate)("",this,"valueTemplate");if("string"!=typeof this.valueTemplate&&this.isReact){this.displayTempElem=this.createElement("div");for(var o=0;o<n.length;o++)ht([n[o]],this.displayTempElem);this.renderTemplates(function(){t.inputElement.innerHTML=G6e(t.displayTempElem.childNodes[0].innerHTML,t.editorMode),t.setProperties({value:t.inputElement.innerHTML.trim()})})}else{var r=this.element;e&&(this.inputElement.innerHTML="",r=this.inputElement);for(o=0;o<n.length;o++)ht([n[o]],r);i=r.innerHTML.trim();0<i.length&&this.setProperties({value:i}),this.renderReactTemplates()}}}else{e=!je(this.element.innerHTML)&&this.element.innerHTML.replace(/<(\/?|\!?)(!--!--)>/g,"").trim();""!==e&&("TEXTAREA"===this.element.tagName?this.setProperties({value:j6e(e)}):this.setProperties({value:e}))}},Jet.prototype.renderTemplates=function(e){this.renderReactTemplates(e)},Jet.prototype.updateResizeFlag=function(){this.isResizeInitialized=!0},Jet.prototype.getInsertImgMaxWidth=function(){var e=this.insertImageSettings.maxWidth,t=this.contentModule.getEditPanel(),i=("HTML"!==this.editorMode||je(this.formatter.editorManager.nodeSelection)||je(this.formatter.editorManager.nodeSelection.range)||3!==(i=this.formatter.editorManager.nodeSelection.range).startContainer.nodeType&&i.startContainer.closest&&!je(i.startContainer.closest("TD"))&&(t=i.startContainer),window.getComputedStyle(t)),t=t.offsetWidth-(14+parseFloat(i.paddingLeft.split("px")[0])+parseFloat(i.paddingRight.split("px")[0])+parseFloat(i.marginLeft.split("px")[0])+parseFloat(i.marginRight.split("px")[0]));return je(e)?t:e},Jet.prototype.getInsertVidMaxWidth=function(){var e=this.insertVideoSettings.maxWidth,t=this.contentModule.getEditPanel(),i=window.getComputedStyle(t),t=t.offsetWidth-(14+parseFloat(i.paddingLeft.split("px")[0])+parseFloat(i.paddingRight.split("px")[0])+parseFloat(i.marginLeft.split("px")[0])+parseFloat(i.marginRight.split("px")[0]));return je(e)?t:e},Jet.prototype.getHtml=function(){var e=Y6e(this.contentModule.getEditPanel().innerHTML,this.editorMode);return!this.enableXhtml||"<p><br></p>"!==e&&"<div><br></div>"!==e&&"<br>"!==e?this.serializeValue(e):null},Jet.prototype.getXhtml=function(){var e=Y6e(this.value,this.editorMode);return e=!je(e)&&this.enableXhtml?this.htmlEditorModule.xhtmlValidation.selfEncloseValidation(e):e},Jet.prototype.showSourceCode=function(){this.readonly||this.notify(Z4e,{})},Jet.prototype.getCharCount=function(){var e=("Markdown"===this.editorMode?this.inputElement.value:this.inputElement.textContent).trim(),e=("Markdown"!==this.editorMode&&-1!==e.indexOf("​")?e.replace(/\u200B/g,""):e).length;return e},Jet.prototype.showDialog=function(e){e===Y3e.InsertLink?this.notify(nWe,{}):e===Y3e.InsertImage?this.notify(rWe,{}):e===Y3e.InsertAudio?this.notify(sWe,{}):e===Y3e.InsertVideo?this.notify(aWe,{}):e===Y3e.InsertTable&&this.notify(pWe,{})},Jet.prototype.closeDialog=function(e){e===Y3e.InsertLink?this.notify(oWe,{}):e===Y3e.InsertImage?this.notify(lWe,{}):e===Y3e.InsertAudio?this.notify(hWe,{}):e===Y3e.InsertVideo?this.notify(dWe,{}):e===Y3e.InsertTable&&this.notify(cWe,{})},Jet.prototype.getBaseToolbarObject=function(){var e=!this.inlineMode.enable||F.isDevice&&!I6e()?this.toolbarModule&&this.toolbarModule.getBaseToolbar():this.quickToolbarModule&&this.quickToolbarModule.getInlineBaseToolbar();return e},Jet.prototype.getToolbar=function(){return this.toolbarModule?this.toolbarModule.getToolbarElement():null},Jet.prototype.getToolbarElement=function(){return this.toolbarModule&&this.toolbarModule.getToolbarElement()},Jet.prototype.getID=function(){return this.internalID},Jet.prototype.getCssClass=function(e){return je(this.cssClass)?"":e?" "+this.cssClass:this.cssClass},Jet.prototype.mouseDownHandler=function(e){var t=e.touches?e.changedTouches[0]:e;U([this.element],[d8e]),this.preventDefaultResize(e),this.notify(o5e,{args:e}),this.formatter.editorManager.observer.notify(o5e,{args:e}),this.clickPoints={clientX:t.clientX,clientY:t.clientY}},Jet.prototype.preventImgResize=function(e){"img"===e.target.nodeName.toLocaleLowerCase()&&e.preventDefault()},Jet.prototype.preventDefaultResize=function(e){"msie"===F.info.name?this.contentModule.getEditPanel().addEventListener("mscontrolselect",this.preventImgResize):"mozilla"===F.info.name&&(this.contentModule.getDocument().execCommand("enableObjectResizing",!1,"false"),this.contentModule.getDocument().execCommand("enableInlineTableEditing",!1,"false"))},Jet.prototype.defaultResize=function(e){"msie"===F.info.name?this.contentModule.getEditPanel().removeEventListener("mscontrolselect",this.preventImgResize):"mozilla"===F.info.name&&(this.contentModule.getDocument().execCommand("enableObjectResizing",!0,"true"),this.contentModule.getDocument().execCommand("enableInlineTableEditing",!0,"true"))},Jet.prototype.resizeHandler=function(){document.body.contains(this.element)?(this.toolbarSettings.enable&&!this.inlineMode.enable&&this.toolbarModule.refreshToolbarOverflow(),this.notify(D4e,null),this.autoResize()):(document.defaultView.removeEventListener("resize",this.resizeHandler,!0),this.onResizeHandler=null)},Jet.prototype.scrollHandler=function(e){this.element&&this.notify(a5e,{args:e})},Jet.prototype.contentScrollHandler=function(e){this.notify(l5e,{args:e})},Jet.prototype.focusHandler=function(e){if(!this.isRTE||this.isFocusOut){this.isRTE=!this.isFocusOut,this.isFocusOut=!1,U([this.element],[d8e]),"HTML"===this.editorMode?this.cloneValue="<p><br></p>"===this.inputElement.innerHTML||"<div><br></div>"===this.inputElement.innerHTML||"<br>"===this.inputElement.innerHTML?null:this.enableHtmlEncode?this.encode(j6e(this.inputElement.innerHTML)):this.inputElement.innerHTML:this.cloneValue=""===this.inputElement.value?null:this.inputElement.value;var t=document.activeElement;if((t===this.element||t===this.getToolbarElement()||t===this.contentModule.getEditPanel()||this.iframeSettings.enable&&t===this.contentModule.getPanel()&&e.target&&!e.target.classList.contains("e-img-inner")&&e.target&&e.target.parentElement&&!e.target.parentElement.classList.contains("e-img-wrap")||z(t,".e-rte-toolbar")===this.getToolbarElement())&&(this.contentModule.getEditPanel().focus(),!je(this.getToolbarElement()))){this.getToolbarElement().setAttribute("tabindex","-1");for(var i=this.getToolbarElement().querySelectorAll('[tabindex="0"]'),n=0;n<i.length;n++)i[n].setAttribute("tabindex","-1")}this.preventDefaultResize(e),this.trigger("focus",{event:e,isInteracted:0!==Object.keys(e).length}),!je(this.saveInterval)&&0<this.saveInterval&&!this.autoSaveOnIdle&&je(this.timeInterval)&&(this.timeInterval=setInterval(this.updateValueOnIdle.bind(this),this.saveInterval)),E.add(document,"mousedown",this.onDocumentClick,this)}this.readonly||"editArea"!==(t=this.getCurrentFocus(e))&&"textArea"!==t&&"sourceCode"!==t||this.resetToolbarTabIndex()},Jet.prototype.getUpdatedValue=function(){var e,t=this.element.querySelector("."+VQe);return"HTML"===this.editorMode?(e="<p><br></p>"===this.inputElement.innerHTML||"<div><br></div>"===this.inputElement.innerHTML||"<br>"===this.inputElement.innerHTML?null:this.enableHtmlEncode?this.encode(j6e(Y6e(this.inputElement.innerHTML,this.editorMode))):this.inputElement.innerHTML,this.enableHtmlSanitizer&&!je(e)&&/&(amp;)*((times)|(divide)|(ne))/.test(e)&&(e=e.replace(/&(amp;)*(times|divide|ne)/g,"&amp;amp;$2")),!je(t)&&this.rootContainer.classList.contains("e-source-code-enabled")&&(e=/&(amp;)*((times)|(divide)|(ne))/.test(t.value)?t.value.replace(/&(amp;)*(times|divide|ne)/g,"&amp;amp;$2"):t.value)):e=""===this.inputElement.value?null:this.inputElement.value,e=null==e||this.enableHtmlEncode?e:Y6e(e,this.editorMode)},Jet.prototype.updateValueOnIdle=function(){(je(this.tableModule)||je(this.inputElement.querySelector(".e-table-box.e-rbox-select")))&&(this.setProperties({value:this.getUpdatedValue()},!0),this.valueContainer.value=this.value,this.isValueChangeBlurhandler=!1,this.invokeChangeEvent())},Jet.prototype.updateIntervalValue=function(){clearTimeout(this.idleInterval),this.idleInterval=setTimeout(this.updateValueOnIdle.bind(this),0)},Jet.prototype.cleanupResizeElements=function(e){var t=Y6e(e.value,this.editorMode);e.callBack(t)},Jet.prototype.addAnchorAriaLabel=function(e){var t=document.createElement("div"),i=(t.innerHTML=e,t.querySelectorAll("a"));if(0<i.length)for(var n=0;n<i.length;n++)i[n].hasAttribute("target")&&"_blank"===i[n].getAttribute("target")&&i[n].setAttribute("aria-label",this.serviceLocator.getService("rteLocale").getConstant("linkAriaLabel"));return t.innerHTML},Jet.prototype.updateStatus=function(e){var t;je(e.html)&&je(e.markdown)||(t={undo:(t=this.formatter.editorManager.undoRedoManager.getUndoStatus()).undo,redo:t.redo,html:e.html,markdown:e.markdown},this.trigger(V4e,t))},Jet.prototype.onDocumentClick=function(e){var t=e.target,i=z(t,"."+BWe),i=(this.element.contains(e.target)||document===e.target||i===this.element||z(t,'[aria-owns="'+this.getID()+'"]')||(this.isBlur=!0,this.isRTE=!1),this.notify(v5e,{args:e}),this.quickToolbarModule&&!this.inlineMode.enable&&je(this.quickToolbarModule.inlineQTBar));(!i||je(z(t,".e-toolbar-wrapper")))&&(!i||je(z(t,".e-rte-table-resize"))&&je(z(t,".e-table-box")))||this.quickToolbarModule.hideQuickToolbars(),"msie"!==F.info.name&&3<e.detail&&e.preventDefault()},Jet.prototype.blurHandler=function(e){var t,i,n=e.relatedTarget;n&&((t=!(t=z(n,"."+BWe))&&this.iframeSettings.enable&&(i=this.element.querySelector("#"+this.getID()+"_rte-view"))&&i.contentWindow.document.body.contains(n)?z(i,"."+BWe):t)&&t===this.element?(this.isBlur=!1,n===this.getToolbarElement()&&n.setAttribute("tabindex","-1")):z(n,'[aria-owns="'+this.getID()+'"]')||z(n,"."+L8e)?this.isBlur=!1:(this.isBlur=!0,n=null)),this.isBlur&&je(n)?(q([this.element],[d8e]),X6e(this.inputElement),this.notify(d5e,{}),i=this.getUpdatedValue(),this.rootContainer.classList.contains("e-source-code-enabled")?this.setProperties({value:i}):this.setProperties({value:i},!0),this.valueContainer.value=this.value,this.isValueChangeBlurhandler=!0,this.invokeChangeEvent(),this.isFocusOut=!0,this.isBlur=!1,L6e(this.valueContainer,"focusout"),this.defaultResize(e),this.trigger("blur",{event:e,isInteracted:0!==Object.keys(e).length}),je(this.timeInterval)||(clearInterval(this.timeInterval),this.timeInterval=null),!je(this.placeHolderWrapper)&&this.element.querySelector("[title = Preview]")&&(this.placeHolderWrapper.style.display="none"),E.remove(document,"mousedown",this.onDocumentClick)):this.isRTE=!0,this.readonly||"outside"!==this.getCurrentFocus(e)||this.resetToolbarTabIndex()},Jet.prototype.contentChanged=function(e){var t=this.inputElement.querySelector(".tempSpan");t&&G(t),e&&!je(e.detail)&&e.detail.click&&this.formatter.saveData(),this.autoSaveOnIdle&&!je(this.saveInterval)&&(clearTimeout(this.autoSaveTimeOut),this.autoSaveTimeOut=setTimeout(this.updateIntervalValue.bind(this),this.saveInterval))},Jet.prototype.invokeChangeEvent=function(){var e=this.enableXhtml?this.getXhtml():this.value,e={value:e,isInteracted:this.isValueChangeBlurhandler};this.value!==Y6e(this.cloneValue,this.editorMode)&&(this.trigger("change",e),this.cloneValue=this.value)},Jet.prototype.wireScrollElementsEvents=function(){this.scrollParentElements=xv(this.element);for(var e=0,t=this.scrollParentElements;e<t.length;e++){var i=t[e];E.add(i,"scroll",this.scrollHandler,this)}this.iframeSettings.enable||E.add(this.inputElement,"scroll",this.contentScrollHandler,this)},Jet.prototype.wireContextEvent=function(){this.quickToolbarSettings.showOnRightClick&&(E.add(this.inputElement,"contextmenu",this.contextHandler,this),F.isDevice)&&(this.touchModule=new Mn(this.inputElement,{tapHold:this.touchHandler.bind(this),tapHoldThreshold:500}))},Jet.prototype.unWireContextEvent=function(){E.remove(this.inputElement,"contextmenu",this.contextHandler),F.isDevice&&this.touchModule&&this.touchModule.destroy()},Jet.prototype.unWireScrollElementsEvents=function(){this.scrollParentElements=xv(this.element);for(var e=0,t=this.scrollParentElements;e<t.length;e++){var i=t[e];E.remove(i,"scroll",this.scrollHandler)}this.iframeSettings.enable||E.remove(this.inputElement,"scroll",this.contentScrollHandler)},Jet.prototype.touchHandler=function(e){this.notifyMouseUp(e.originalEvent),this.triggerEditArea(e.originalEvent)},Jet.prototype.contextHandler=function(e){var t=z(e.target,"a, table, img, video, audio, .e-embed-video-wrap");!t&&e.target&&e.target.classList&&(e.target.classList.contains(b8e)||e.target.classList.contains(y8e))&&(t=e.target.querySelector("audio")),!1!==this.inlineMode.onSelection&&(je(t)||!this.inputElement.contains(t)||"IMG"!==t.tagName&&"TABLE"!==t.tagName&&"A"!==t.tagName&&"video"!==t.tagName.toLowerCase()&&"audio"!==t.tagName.toLowerCase()&&"SPAN"!==t.tagName)||e.preventDefault()},Jet.prototype.resetHandler=function(){var e=this.valueContainer.defaultValue.trim();this.setProperties({value:""===e?null:e})},Jet.prototype.autoResize=function(){var e,t;this.element&&this.originalElement&&this.valueContainer&&("auto"===this.height?"Markdown"===this.editorMode?this.setAutoHeight(this.inputElement):this.iframeSettings.enable&&(e=this.element.querySelector("#"+this.getID()+"_rte-view"))&&this.setAutoHeight(e):"Markdown"===this.editorMode?(e=this.inputElement,t=this.enableResize||this.showCharCount?20:0,e&&(e.style.height=this.element.clientHeight-(this.toolbarModule.getToolbarHeight()+t+3)+"px")):this.iframeSettings.enable&&(e=this.element.querySelector("#"+this.getID()+"_rte-view"),t=this.enableResize||this.showCharCount?20:0,e)&&this.toolbarModule&&(e.style.height=this.element.clientHeight-(this.toolbarModule.getToolbarHeight()+t+3)+"px"))},Jet.prototype.setAutoHeight=function(e){"TEXTAREA"===e.nodeName?(e.style.height="auto",e.style.height=this.inputElement.scrollHeight+16+"px",e.style.overflow="hidden"):"IFRAME"===e.nodeName&&(e.style.height=this.inputElement.parentElement.offsetHeight+"px")},Jet.prototype.wireEvents=function(){this.onBlurHandler=this.blurHandler.bind(this),this.onFocusHandler=this.focusHandler.bind(this),this.onResizeHandler=this.resizeHandler.bind(this),this.element.addEventListener("focusin",this.onFocusHandler,!0),this.element.addEventListener("focusout",this.onBlurHandler,!0),this.on(Z3e,this.contentChanged,this),this.on(K5e,this.updateResizeFlag,this),this.on(iWe,this.updateStatus,this),this.on(bWe,this.cleanupResizeElements,this),this.on(CWe,this.updateValueOnIdle,this),this.on(IWe,this.autoResize,this),this.iframeSettings.enable&&(this.onLoadHandler=this.iframeEditableElemLoad.bind(this),this.contentModule.getEditPanel().addEventListener("load",this.onLoadHandler,!0)),this.readonly&&this.enabled||this.bindEvents()},Jet.prototype.restrict=function(e){if(0<=this.maxLength){var t="Markdown"===this.editorMode?this.contentModule.getText():this.getText().replace(/(\r\n|\n|\r|\t)/gm,"").replace(/\u200B/g,"");if(t){for(var i=[8,16,17,37,38,39,40,46,65],n=void 0,o=0;o<=i.length-1;o++)if(e.which===i[o]){if(e.ctrlKey&&65===e.which)return;if(65!==e.which)return void(n=i[o])}t.length>=this.maxLength&&-1!==this.maxLength&&e.which!==n&&e.preventDefault()}}},Jet.prototype.beforeInputHandler=function(e){var t;0<=this.maxLength&&(t="Markdown"===this.editorMode?this.contentModule.getText():this.getText().replace(/(\r\n|\n|\r|\t)/gm,"").replace(/\u200B/g,""),e.data)&&t.length>=this.maxLength&&!this.isSpecialInputType(e)&&e.preventDefault()},Jet.prototype.isSpecialInputType=function(e){return e.inputType?-1!==e.inputType.indexOf("delete")||-1!==e.inputType.indexOf("backward")||"insertLineBreak"===e.inputType:-1!==[8,16,17,37,38,39,40,46,65].indexOf(e.which)},Jet.prototype.bindEvents=function(){this.keyboardModule=new rqe(this.inputElement,{keyAction:this.keyDown.bind(this),keyConfigs:Yet({},this.formatter.keyConfig,this.keyConfig),eventName:"keydown"}),this.userAgentData&&"Android"===this.userAgentData.getPlatform()&&E.add(this.inputElement,"beforeinput",this.beforeInputHandler,this);var e=z(this.valueContainer,"form");e&&E.add(e,"reset",this.resetHandler,this),E.add(this.inputElement,"keyup",this.keyUp,this),E.add(this.inputElement,"paste",this.onPaste,this),E.add(this.inputElement,"content-changed",this.contentChanged,this),this.mouseDownDebListener=P(this.mouseUp,30),E.add(this.inputElement,F.touchEndEvent,this.mouseDownDebListener,this),E.add(this.inputElement,F.touchStartEvent,this.mouseDownHandler,this),E.add(this.inputElement,"input",this.inputHandler,this),this.wireContextEvent(),this.formatter.editorManager.observer.on(n7e,this.editorKeyDown,this),this.element.ownerDocument.defaultView.addEventListener("resize",this.onResizeHandler,!0),this.iframeSettings.enable&&(E.add(this.inputElement,"focusin",this.focusHandler,this),E.add(this.inputElement,"focusout",this.blurHandler,this),E.add(this.inputElement.ownerDocument,"scroll",this.contentScrollHandler,this),E.add(this.inputElement.ownerDocument,F.touchStartEvent,this.onIframeMouseDown,this),E.add(this.contentModule.getPanel(),"load",this.iframeLoadHandler,this)),this.wireScrollElementsEvents()},Jet.prototype.onIframeMouseDown=function(e){this.isBlur=!1,this.currentTarget=e.target,this.notify(e4e,e)},Jet.prototype.inputHandler=function(){this.autoResize()},Jet.prototype.editorKeyDown=function(e){switch(e.event.action){case"copy":this.onCopy();break;case"cut":this.onCut();break;case"tab":this.iframeSettings.enable&&(this.isBlur=!0)}!e.callBack||"copy"!==e.event.action&&"cut"!==e.event.action&&"delete"!==e.event.action||e.callBack({requestType:e.event.action,editorMode:"HTML",event:e.event})},Jet.prototype.unWireEvents=function(){this.element.removeEventListener("focusin",this.onFocusHandler,!0),this.onFocusHandler=null,this.element.removeEventListener("focusout",this.onBlurHandler,!0),this.onBlurHandler=null,this.off(Z3e,this.contentChanged),this.off(K5e,this.updateResizeFlag),this.off(iWe,this.updateStatus),this.off(bWe,this.cleanupResizeElements),this.off(CWe,this.updateValueOnIdle),this.off(IWe,this.autoResize),this.iframeSettings.enable&&(this.contentModule.getEditPanel().removeEventListener("load",this.onLoadHandler,!0),this.onLoadHandler=null),this.readonly&&this.enabled||this.unbindEvents()},Jet.prototype.unbindEvents=function(){this.keyboardModule&&!this.keyboardModule.isDestroyed&&(this.keyboardModule.destroy(),this.keyboardModule=null);var e=z(this.valueContainer,"form");e&&E.remove(e,"reset",this.resetHandler),E.remove(this.inputElement,"keyup",this.keyUp),E.remove(this.inputElement,"paste",this.onPaste),E.remove(this.inputElement,"content-changed",this.contentChanged),E.remove(this.inputElement,F.touchEndEvent,this.mouseDownDebListener),this.mouseDownDebListener=null,E.remove(this.inputElement,F.touchStartEvent,this.mouseDownHandler),E.remove(this.inputElement,"input",this.inputHandler),E.remove(document,"mousedown",this.onDocumentClick),this.unWireContextEvent(),this.formatter&&this.formatter.editorManager.observer.off(n7e,this.editorKeyDown),this.element.ownerDocument.defaultView.removeEventListener("resize",this.onResizeHandler,!0),this.onResizeHandler=null,this.iframeSettings.enable&&(E.remove(this.inputElement,"focusin",this.focusHandler),E.remove(this.inputElement,"focusout",this.blurHandler),E.remove(this.inputElement.ownerDocument,"scroll",this.contentScrollHandler),E.remove(this.inputElement.ownerDocument,F.touchStartEvent,this.onIframeMouseDown),E.remove(this.contentModule.getPanel(),"load",this.iframeLoadHandler)),this.userAgentData&&"Android"===this.userAgentData.getPlatform()&&E.remove(this.inputElement,"beforeinput",this.beforeInputHandler),this.unWireScrollElementsEvents()},Jet.prototype.getCurrentFocus=function(e){return e.target===this.inputElement&&document.activeElement===this.inputElement?"editArea":e.target===this.getToolbarElement()||!je(e.relatedTarget)&&z(e.relatedTarget,".e-rte-toolbar")===this.getToolbarElement()?"toolbar":e.target===this.valueContainer&&document.activeElement===this.valueContainer?"textArea":!je(e.target)&&e.target.classList.contains(VQe)&&document.activeElement===e.target?"sourceCode":"outside"},Jet.prototype.resetToolbarTabIndex=function(){if(this.getToolbarElement())for(var e=this.getToolbarElement().querySelectorAll("input,select,button,a,[tabindex]"),t=0;t<e.length;t++)e[t].classList.contains("e-rte-dropdown-btn")||e[t].classList.contains("e-insert-table-btn")||e[t].hasAttribute("tabindex")&&"-1"===e[t].getAttribute("tabindex")||e[t].setAttribute("tabindex","-1")},Jet.prototype.getRenderedQuickToolbarElem=function(){if(!je(this.quickToolbarModule))for(var e=this.quickToolbarModule.getQuickToolbarInstance(),t=0;t<e.length;t++)if(e[t]&&e[t].isRendered)return e[t].element;return null},Jet.prototype.iframeLoadHandler=function(){this.autoResize()},Jet.prototype.iframeEditableElemLoad=function(){this.autoResize()},Xet([t({},jee)],Jet.prototype,"toolbarSettings",void 0),Xet([t({enable:!1,items:["Paragraph","Heading 1","Heading 2","Heading 3","Heading 4","OrderedList","UnorderedList","CodeBlock","Blockquote"],popupWidth:"300px",popupHeight:"320px"},Met)],Jet.prototype,"slashMenuSettings",void 0),Xet([t({},Z$e)],Jet.prototype,"quickToolbarSettings",void 0),Xet([t({},set)],Jet.prototype,"pasteCleanupSettings",void 0),Xet([t({},tet)],Jet.prototype,"formatPainterSettings",void 0),Xet([t({},Wo)],Jet.prototype,"emojiPickerSettings",void 0),Xet([t({},d$)],Jet.prototype,"iframeSettings",void 0),Xet([t({},N$e)],Jet.prototype,"insertImageSettings",void 0),Xet([t({},pJ)],Jet.prototype,"importWord",void 0),Xet([t({},P$e)],Jet.prototype,"exportWord",void 0),Xet([t({},L$e)],Jet.prototype,"exportPdf",void 0),Xet([t({},H$e)],Jet.prototype,"insertAudioSettings",void 0),Xet([t({},W$e)],Jet.prototype,"insertVideoSettings",void 0),Xet([t({},X$e)],Jet.prototype,"tableSettings",void 0),Xet([e(0)],Jet.prototype,"floatingToolbarOffset",void 0),Xet([t({},Det)],Jet.prototype,"inlineMode",void 0),Xet([t({},q$e)],Jet.prototype,"fileManagerSettings",void 0),Xet([e("100%")],Jet.prototype,"width",void 0),Xet([e(!1)],Jet.prototype,"enablePersistence",void 0),Xet([e(!0)],Jet.prototype,"showTooltip",void 0),Xet([e(!1)],Jet.prototype,"enableResize",void 0),Xet([e({})],Jet.prototype,"htmlAttributes",void 0),Xet([e(null)],Jet.prototype,"placeholder",void 0),Xet([e(!1)],Jet.prototype,"autoSaveOnIdle",void 0),Xet([e(!1)],Jet.prototype,"readonly",void 0),Xet([e(!0)],Jet.prototype,"enabled",void 0),Xet([e(!0)],Jet.prototype,"enableHtmlSanitizer",void 0),Xet([e(!1)],Jet.prototype,"enableHtmlEncode",void 0),Xet([e(!1)],Jet.prototype,"enableXhtml",void 0),Xet([e("auto")],Jet.prototype,"height",void 0),Xet([e(null)],Jet.prototype,"cssClass",void 0),Xet([e(null)],Jet.prototype,"value",void 0),Xet([e("P")],Jet.prototype,"enterKey",void 0),Xet([e("BR")],Jet.prototype,"shiftEnterKey",void 0),Xet([e(30)],Jet.prototype,"undoRedoSteps",void 0),Xet([e(300)],Jet.prototype,"undoRedoTimer",void 0),Xet([e("HTML")],Jet.prototype,"editorMode",void 0),Xet([e(null)],Jet.prototype,"keyConfig",void 0),Xet([e(!1)],Jet.prototype,"showCharCount",void 0),Xet([e(!1)],Jet.prototype,"enableTabKey",void 0),Xet([e(!1)],Jet.prototype,"enableAutoUrl",void 0),Xet([e(-1)],Jet.prototype,"maxLength",void 0),Xet([t({},h)],Jet.prototype,"format",void 0),Xet([t({},Cet)],Jet.prototype,"numberFormatList",void 0),Xet([t({},wce)],Jet.prototype,"bulletFormatList",void 0),Xet([t({},det)],Jet.prototype,"fontFamily",void 0),Xet([t({},fJ)],Jet.prototype,"fontSize",void 0),Xet([t({},Vee)],Jet.prototype,"fontColor",void 0),Xet([t({},tte)],Jet.prototype,"backgroundColor",void 0),Xet([e(null)],Jet.prototype,"valueTemplate",void 0),Xet([e(1e4)],Jet.prototype,"saveInterval",void 0),Xet([i()],Jet.prototype,"actionBegin",void 0),Xet([i()],Jet.prototype,"actionComplete",void 0),Xet([i()],Jet.prototype,"beforeDialogOpen",void 0),Xet([i()],Jet.prototype,"dialogOpen",void 0),Xet([i()],Jet.prototype,"beforeDialogClose",void 0),Xet([i()],Jet.prototype,"dialogClose",void 0),Xet([i()],Jet.prototype,"beforeQuickToolbarOpen",void 0),Xet([i()],Jet.prototype,"quickToolbarOpen",void 0),Xet([i()],Jet.prototype,"quickToolbarClose",void 0),Xet([i()],Jet.prototype,"toolbarStatusUpdate",void 0),Xet([i()],Jet.prototype,"updatedToolbarStatus",void 0),Xet([i()],Jet.prototype,"imageSelected",void 0),Xet([i()],Jet.prototype,"beforeImageUpload",void 0),Xet([i()],Jet.prototype,"imageUploading",void 0),Xet([i()],Jet.prototype,"imageUploadSuccess",void 0),Xet([i()],Jet.prototype,"imageUploadFailed",void 0),Xet([i()],Jet.prototype,"imageRemoving",void 0),Xet([i()],Jet.prototype,"afterImageDelete",void 0),Xet([i()],Jet.prototype,"fileSelected",void 0),Xet([i()],Jet.prototype,"beforeFileUpload",void 0),Xet([i()],Jet.prototype,"fileUploading",void 0),Xet([i()],Jet.prototype,"fileUploadSuccess",void 0),Xet([i()],Jet.prototype,"fileUploadFailed",void 0),Xet([i()],Jet.prototype,"fileRemoving",void 0),Xet([i()],Jet.prototype,"afterMediaDelete",void 0),Xet([i()],Jet.prototype,"created",void 0),Xet([i()],Jet.prototype,"destroyed",void 0),Xet([i()],Jet.prototype,"beforeSanitizeHtml",void 0),Xet([i()],Jet.prototype,"blur",void 0),Xet([i()],Jet.prototype,"toolbarClick",void 0),Xet([i()],Jet.prototype,"focus",void 0),Xet([i()],Jet.prototype,"change",void 0),Xet([i()],Jet.prototype,"resizing",void 0),Xet([i()],Jet.prototype,"resizeStart",void 0),Xet([i()],Jet.prototype,"resizeStop",void 0),Xet([i()],Jet.prototype,"beforePasteCleanup",void 0),Xet([i()],Jet.prototype,"afterPasteCleanup",void 0),Xet([i()],Jet.prototype,"beforeImageDrop",void 0),Xet([e(null)],Jet.prototype,"formatter",void 0),Xet([i()],Jet.prototype,"slashMenuItemSelect",void 0),Xet([Bt],Jet));function Jet(e,t){e=Get.call(this,e,t)||this;return e.isPlainPaste=!1,e.needsID=!0,e.isCopyAll=!1,e}Zet.prototype.removeEventListener=function(){this.parent.off(d4e,this.onPropertyChanged),this.parent.off(t4e,this.removeEventListener)},Zet.prototype.onPropertyChanged=function(e){for(var t=0,i=Object.keys(e.newProp);t<i.length;t++)if("slashMenuSettings"===i[t])switch(Object.keys(e.newProp.slashMenuSettings)[0]){case"enable":e.newProp.slashMenuSettings.enable?this.render():this.removeEventListener();break;case"items":this.mention.dataSource=this.getItems();break;case"popupHeight":this.mention.popupHeight=e.newProp.slashMenuSettings.popupHeight;break;case"popupWidth":this.mention.popupWidth=e.newProp.slashMenuSettings.popupWidth}},Zet.prototype.getModuleName=function(){return"slashMenu"},Zet.prototype.destroy=function(){this.mention&&!this.mention.isDestroyed&&(this.mention.destroy(),this.defaultItems=[],this.injectibleItems=[])},Zet.prototype.generateMentionModel=function(){var e=this;return{dataSource:this.getItems(),cssClass:"e-slash-menu"+this.parent.getCssClass(),fields:{text:"text",groupBy:"type",iconCss:"iconCss",value:"description"},mentionChar:"/",target:this.parent.inputElement,popupHeight:this.parent.slashMenuSettings.popupHeight,popupWidth:this.parent.slashMenuSettings.popupWidth,allowSpaces:!0,itemTemplate:'${if(iconCss && description)}<div class="e-rte-slash-menu-item-content" style="display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center;"><div class="e-slash-menu-icon"style="padding: 15px 15px 15px 15px;"><div class="${iconCss}"></div></div> <div style="display: flex; flex-direction: column;"><span class="e-rte-slash-menu-item-text" style="font-weight: 500;">${text}</span>${if(description)}<span class="e-rte-slash-menu-item-description">${description}</span>${/if}</div></div>${else}${if(iconCss && text)}<div class="e-rte-slash-menu-item-content" style="display: flex; flex-direction: row; align-items: center; height: 25px; font-weight: 500;"><div class="e-slash-menu-icon"style="margin-left: 15px; width: 30px"><div class="${iconCss}"></div></div> <span class="e-rte-slash-menu-item-icon-text">${text}</span></div>${/if}${/if}',beforeOpen:function(){e.parent.notify(o4e,{}),e.savedSelection=e.savedSelection.save(e.savedSelection.getRange(e.currentDocument),e.currentDocument)},filtering:function(){e.savedSelection=e.savedSelection.save(e.savedSelection.getRange(e.currentDocument),e.currentDocument)},select:this.handleSelect.bind(this)}},Zet.prototype.handleSelect=function(e){var i=this,n=(e.cancel=!0,this.parent.focusIn(),this.savedSelection.restore(),e.itemData),o={isInteracted:e.isInteracted,item:e.item,itemData:e.itemData,originalEvent:e.e,cancel:!1};e.itemData.isCustomItem&&this.parent.formatter.beforeSlashMenuApply(),this.parent.trigger("slashMenuItemSelect",o,function(e){if(!e.cancel)if(e.itemData.isCustomItem)i.parent.inputElement.classList.contains("e-mention")&&(e=i.parent.inputElement.ownerDocument.getElementById(i.parent.inputElement.id+"_slash_menu_popup"))&&e.classList.contains("e-popup-open")&&i.mention.hidePopup();else{i.parent.formatter.beforeSlashMenuApply();var t=n;switch(t.command){case"OrderedList":i.parent.executeCommand("insertOrderedList");break;case"UnorderedList":i.parent.executeCommand("insertUnorderedList");break;case"Audio":case"Video":case"Image":case"Table":case"Link":i.mention.hidePopup(),setTimeout(function(){t.subCommand===Y3e.InsertLink?i.parent.notify(nWe,{}):t.subCommand===Y3e.InsertImage?i.parent.notify(rWe,o):t.subCommand===Y3e.InsertAudio?i.parent.notify(sWe,o):t.subCommand===Y3e.InsertVideo?i.parent.notify(aWe,o):t.subCommand===Y3e.InsertTable&&i.parent.notify(pWe,{})},100);break;case"Emojipicker":i.mention.hidePopup(),setTimeout(function(){i.parent.showEmojiPicker()},100);break;default:i.parent.executeCommand("formatBlock",t.subCommand)}i.parent.notify(n4e,{})}})},Zet.prototype.getItems=function(){for(var o=this.parent.slashMenuSettings.items,r=[],s=this,e=0;e<o.length;e++)!function(e){var t,i,n;"string"==typeof o[e]?(t=o[e],je(i=s.defaultItems.filter(function(e){return e.command===t})[0])&&(i=s.injectibleItems.filter(function(e){return e.module.toLowerCase().replace(" ","")===t.toLowerCase().replace(" ","")})[0]),n=b6e.get(t),r.push({text:s.L10n.getConstant(n.text),command:i.command,subCommand:i.subCommand,type:i.type,module:i.module,iconCss:i.iconCss,description:s.L10n.getConstant(n.description)})):r.push({text:o[e].text,command:o[e].command,type:o[e].type,iconCss:o[e].iconCss,description:o[e].description,isCustomItem:!0})}(e);return r},Zet.prototype.render=function(){var e;"HTML"===this.parent.editorMode&&this.parent.slashMenuSettings.enable&&(e=this.generateMentionModel(),this.mention=new c7(e),this.mention.appendTo(this.parent.rootContainer.appendChild(this.parent.createElement("div",{className:"e-rte-slash-menu",id:this.parent.getID()+"_slash_menu"}))))};jee=Zet;function Zet(e,t){this.parent=e,this.currentDocument=this.parent.element.ownerDocument,this.L10n=t.getService("rteLocale"),this.savedSelection=new _9e(this.parent.inputElement),this.defaultItems=Qet,this.injectibleItems=Uet,this.parent.on(d4e,this.onPropertyChanged,this),this.parent.on(t4e,this.removeEventListener,this),this.parent.on($3e,this.render,this)}ett.prototype.addEventListener=function(){this.parent.on(f5e,this.setRtl,this),this.parent.on(uWe,this.setCssClass,this)},ett.prototype.removeEventListener=function(){this.parent.off(f5e,this.setRtl),this.parent.off(uWe,this.setCssClass)},ett.prototype.setCssClass=function(e){je(this.toolbarObj)||(je(e.oldCssClass)?this.toolbarObj.setProperties({cssClass:(this.toolbarObj.cssClass+" "+e.cssClass).trim()}):this.toolbarObj.setProperties({cssClass:(this.toolbarObj.cssClass.replace(e.oldCssClass,"").trim()+" "+e.cssClass).trim()}))},ett.prototype.setRtl=function(e){je(this.toolbarObj)||this.toolbarObj.setProperties({enableRtl:e.enableRtl})},ett.prototype.getClass=function(e){var t;switch(e){case"fontsize":t="e-rte-inline-size-template";break;case"fontcolor":case"backgroundcolor":t="e-rte-inline-color-template";break;default:t="e-rte-inline-template"}return t},ett.prototype.getTemplateObject=function(e,t){var i;switch(e){case"fontcolor":case"backgroundcolor":case"numberformatlist":case"bulletformatlist":i="span";break;default:i="button"}return{command:this.tools[e.toLocaleLowerCase()].command,subCommand:this.tools[e.toLocaleLowerCase()].subCommand,template:this.parent.createElement(i,{id:this.parent.getID()+"_"+t+"_"+this.tools[e.toLocaleLowerCase()].id}).outerHTML,cssClass:this.parent.inlineMode.enable?this.getClass(e):"",tooltipText:D6e(e,this.locator)}},ett.prototype.getObject=function(e,t){var i=e.toLowerCase();if(-1!==HQe.indexOf(i))return this.getTemplateObject(i,t);switch(i){case"|":return{type:"Separator"};case"-":return{type:"Separator",cssClass:O8e};default:return{id:this.parent.getID()+"_"+t+"_"+this.tools[i.toLocaleLowerCase()].id,prefixIcon:this.tools[i.toLocaleLowerCase()].icon,tooltipText:D6e(i,this.locator),command:this.tools[i.toLocaleLowerCase()].command,subCommand:this.tools[i.toLocaleLowerCase()].subCommand}}},ett.prototype.getItems=function(e,t){var o=this;if(this.parent.toolbarSettings.items.length<1)return[];for(var r=[],s=this,i=0,n=e;i<n.length;i++)!function(e){var i,n;"string"==typeof e?r.push(s.getObject(e,t)):(je(e.click)||(n=(i=e).click,i.click=function(){if(i.undo&&0===o.parent.formatter.getUndoRedoStack().length&&o.parent.formatter.saveData(),n.call(o),0<o.parent.formatter.getUndoRedoStack().length){var e=o.parent.createElement("div"),t=o.parent.formatter.getUndoRedoStack()[o.parent.formatter.getUndoRedoStack().length-1].text.cloneNode(!0);if(e.appendChild(t),e.innerHTML.trim()===o.parent.inputElement.innerHTML.trim())return}i.undo&&o.parent.formatter.saveData()}),r.push(e))}(n[i]);if(this.parent.showTooltip)for(var a=this,l=0;l<r.length;l++)!function(e){var t=r[e].tooltipText,i=void 0,n="macOS"===a.parent.userAgentData.getPlatform();!(i=!c6e[""+r[e].subCommand]||je(r[e].id)&&je(r[e].cssClass)?t:c6e[""+r[e].subCommand].split(",").map(function(e){return n?e.replace("Ctrl+","⌘").replace("Shift+","⇧").replace("Alt+","⌥"):e}).join(", "))||"Images"===r[e].command&&"InsertLink"===r[e].subCommand||(r[e].tooltipText=t!==i?t+" ("+i+")":t)}(l);return r},ett.prototype.getToolbarOptions=function(e){return{target:e.target,rteToolbarObj:this,items:this.getItems(e.items,e.container),overflowMode:e.mode,enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,cssClass:e.cssClass,type:e.container}},ett.prototype.render=function(e){this.toolbarRenderer=this.renderFactory.getRenderer(q3e.Toolbar),this.toolbarRenderer&&this.toolbarRenderer.isDestroyed&&(this.toolbarRenderer=new U9e(this.parent,this.locator)),this.toolbarRenderer.renderToolbar(this.getToolbarOptions(e))},ett.prototype.destroy=function(){this.isDestroyed||(this.removeEventListener(),this.toolbarObj&&!this.toolbarObj.isDestroyed&&(this.toolbarObj.destroy(),this.toolbarObj=null),this.toolbarRenderer.destroy(),this.toolbarRenderer=null,this.tools={},this.isDestroyed=!0)};var $et=ett;function ett(e,t){this.tools={},this.parent=e,this.locator=t,this.isDestroyed=!1,this.renderFactory=this.locator.getService("rendererFactory"),this.addEventListener(),this.parent.toolbarSettings&&0<Object.keys(this.parent.toolbarSettings.itemConfigs).length?Pe(this.tools,zQe,N6e(this.parent.toolbarSettings.itemConfigs),!0):this.tools=zQe,(this.parent.toolbarSettings.enable||this.parent.quickToolbarSettings.enable)&&(this.toolbarRenderer=new U9e(this.parent,this.locator),this.renderFactory.addRenderer(q3e.Toolbar,this.toolbarRenderer))}itt.prototype.initializeInstance=function(){this.toolbarRenderer=this.renderFactory.getRenderer(q3e.Toolbar)},itt.prototype.beforeRender=function(e){var t=e.item;t.cssClass&&U([e.element],t.cssClass)},itt.prototype.dropdownContent=function(e,t,i){return'<span style="display: inline-flex;width:'+("quick"===t?"auto":e)+'" ><span class="e-rte-dropdown-btn-text">'+i+"</span></span>"},itt.prototype.renderDropDowns=function(o,r){var s=this,a=(this.initializeInstance(),o.containerType),l=o.container;HQe.forEach(function(e){var t=void 0;if(-1!==S6e(e,o.items))switch(e){case"numberformatlist":if(je(t=ge("#"+s.parent.getID()+"_"+a+"_NumberFormatList",l))||t.classList.contains(n8e))return;var i=s.parent.numberFormatList.types.slice();i.forEach(function(e){Object.defineProperties(e,{command:{value:"Lists",enumerable:!0},subCommand:{value:"NumberFormatList",enumerable:!0}})}),s.numberFormatListDropDown=s.toolbarRenderer.renderListDropDown({cssClass:"e-order-list "+L8e+" "+P8e,itemName:"NumberFormatList",items:i,element:t});break;case"bulletformatlist":if(je(t=ge("#"+s.parent.getID()+"_"+a+"_BulletFormatList",l))||t.classList.contains(n8e))return;i=s.parent.bulletFormatList.types.slice();i.forEach(function(e){Object.defineProperties(e,{command:{value:"Lists",enumerable:!0},subCommand:{value:"BulletFormatList",enumerable:!0}})}),s.bulletFormatListDropDown=s.toolbarRenderer.renderListDropDown({cssClass:"e-unorder-list "+L8e+" "+P8e,itemName:"BulletFormatList",items:i,element:t});break;case"formats":if(je(t=ge("#"+s.parent.getID()+"_"+a+"_Formats",l))||t.classList.contains(n8e))return;var i=s.parent.format.types.slice(),n=(i.forEach(function(e){Object.defineProperties(e,{command:{value:"Formats",enumerable:!0},subCommand:{value:e.value,enumerable:!0}})}),je(s.parent.format.default)?i[0].text:s.parent.format.default);s.formatDropDown=s.toolbarRenderer.renderDropDownButton({iconCss:"quick"===a?"e-formats e-icons":"",content:s.dropdownContent(s.parent.format.width,a,"quick"===a?"":x6e(i,n,"text","text")),cssClass:e8e+" "+i8e+" "+z8e,itemName:"Formats",items:i,element:t});break;case"fontname":if(je(t=ge("#"+s.parent.getID()+"_"+a+"_FontName",l))||t.classList.contains(n8e))return;n=s.parent.fontFamily.items.slice(),i=(n.forEach(function(e){Object.defineProperties(e,{command:{value:"Font",enumerable:!0},subCommand:{value:"FontName",enumerable:!0}})}),je(s.parent.fontFamily.default)?0===n.length?"":n[0].text:s.parent.fontFamily.default);s.fontNameDropDown=s.toolbarRenderer.renderDropDownButton({iconCss:"quick"===a?"e-font-name e-icons":"",content:s.dropdownContent(s.parent.fontFamily.width,a,0===n.length?s.i10n.getConstant("fontName"):"quick"===a?"":"Default"===x6e(n,i,"text","text")?s.i10n.getConstant("fontName"):x6e(n,i,"text","text")),cssClass:e8e+" "+i8e+" "+j8e,itemName:"FontName",items:n,element:t});break;case"fontsize":if(je(t=ge("#"+s.parent.getID()+"_"+a+"_FontSize",l))||t.classList.contains(n8e))return;i=!je(s.fontSizeDropDown)&&!je(s.fontSizeDropDown.items)&&0<s.fontSizeDropDown.items.length?s.fontSizeDropDown.items:JSON.parse(JSON.stringify(s.parent.fontSize.items.slice())),n=(i.forEach(function(e){Object.defineProperties(e,{command:{value:"Font",enumerable:!0},subCommand:{value:"FontSize",enumerable:!0}})}),je(s.parent.fontSize.default)?0===i.length?"":i[0].text:s.parent.fontSize.default),n=x6e(i,n.replace(/\s/g,""),"Default"===n?"text":"value","text");s.fontSizeDropDown=s.toolbarRenderer.renderDropDownButton({content:s.dropdownContent(s.parent.fontSize.width,a,0===i.length?s.i10n.getConstant("fontSize"):T6e("Default"===n?s.i10n.getConstant("fontSize"):n)),cssClass:e8e+" "+i8e+" "+W8e,itemName:"FontSize",items:i,element:t});break;case"alignments":je(t=ge("#"+s.parent.getID()+"_"+a+"_Alignments",l))||t.classList.contains(n8e)||(s.alignDropDown=s.toolbarRenderer.renderDropDownButton({iconCss:"e-justify-left e-icons",cssClass:e8e+" "+i8e+" "+Q8e,itemName:"Alignments",items:WQe,element:t}));break;case"align":case"videoalign":s.renderAlignmentDropDown(a,l,r,e);break;case"display":case"audiolayoutoption":case"videolayoutoption":s.renderDisplayDropDown(a,l,r,e);break;case"tablerows":s.rowDropDown(a,l,t,r);break;case"tablecolumns":s.columnDropDown(a,l,t);break;case"tablecell":s.cellDropDown(a,l,t);break;case"tablecellverticalalign":s.verticalAlignDropDown(a,l,t);break;case"styles":s.tableStylesDropDown(a,l,t)}}),this.parent.inlineMode.enable&&this.setCssClass({cssClass:this.parent.getCssClass()})},itt.prototype.getUpdateItems=function(e,t){e=e.slice();return e.forEach(function(e){Object.defineProperties(e,{command:{value:"Format"===t?"Formats":"Font",enumerable:!0},subCommand:{value:"Format"===t?e.value:t,enumerable:!0}})}),e},itt.prototype.onPropertyChanged=function(e){for(var t=e.newProp,i=0,n=Object.keys(t);i<n.length;i++)switch(n[i]){case"fontFamily":if(this.fontNameDropDown)for(var o=0,r=Object.keys(t.fontFamily);o<r.length;o++)switch(r[o]){case"default":case"width":var s=this.fontNameDropDown.items,a=je(z(this.fontNameDropDown.element,"."+QWe))?"toolbar":"quick",l=je(this.parent.fontFamily.default)?s[0].text:this.parent.fontFamily.default,h=this.dropdownContent(this.parent.fontFamily.width,a,"quick"===a?"":"Default"===x6e(s,l,"text","text")?this.i10n.getConstant("fontName"):x6e(s,l,"text","text"));this.fontNameDropDown.setProperties({content:h}),je(this.parent.fontFamily.default)?this.getEditNode().style.removeProperty("font-family"):this.getEditNode().style.fontFamily=this.parent.fontFamily.default;break;case"items":this.fontNameDropDown.setProperties({items:this.getUpdateItems(t.fontFamily.items,"FontName")})}break;case"fontSize":if(this.fontSizeDropDown)for(var d=0,p=Object.keys(t.fontSize);d<p.length;d++)switch(p[d]){case"default":case"width":var c=this.fontSizeDropDown.items,u=(a=je(z(this.fontSizeDropDown.element,"."+QWe))?"toolbar":"quick",je(this.parent.fontSize.default)?c[0].text:this.parent.fontSize.default),c=x6e(c,u.replace(/\s/g,""),"Default"===u?"text":"value","text");h=this.dropdownContent(this.parent.fontSize.width,a,T6e("Default"===c?this.i10n.getConstant("fontSize"):c)),this.fontSizeDropDown.setProperties({content:h}),je(this.parent.fontSize.default)?this.getEditNode().style.removeProperty("font-size"):this.getEditNode().style.fontSize=this.parent.fontSize.default;break;case"items":this.fontSizeDropDown.setProperties({items:this.getUpdateItems(t.fontSize.items,"FontSize")})}break;case"format":if(this.formatDropDown)for(var g=0,m=Object.keys(t.format);g<m.length;g++)switch(m[g]){case"default":case"width":var f=this.formatDropDown.items,y=(a=je(z(this.formatDropDown.element,"."+QWe))?"toolbar":"quick",je(this.parent.format.default)?f[0].text:this.parent.format.default);h=this.dropdownContent(this.parent.format.width,a,"quick"===a?"":x6e(f,y,"text","text")),this.formatDropDown.setProperties({content:h});break;case"types":this.formatDropDown.setProperties({items:this.getUpdateItems(t.format.types,"Format")})}}},itt.prototype.getEditNode=function(){return this.parent.contentModule.getEditPanel()},itt.prototype.rowDropDown=function(e,t,i,n){i=ge("#"+this.parent.getID()+"_"+e+"_TableRows",t);e=Array.from(e6e);i.classList.contains(n8e)||(n.closest("th")&&e.shift(),this.tableRowsDropDown=this.toolbarRenderer.renderDropDownButton({iconCss:"e-table-rows e-icons",cssClass:e8e+" "+i8e+" "+XWe,itemName:"TableRows",items:e,element:i}))},itt.prototype.columnDropDown=function(e,t,i){(i=ge("#"+this.parent.getID()+"_"+e+"_TableColumns",t)).classList.contains(n8e)||(this.tableColumnsDropDown=this.toolbarRenderer.renderDropDownButton({iconCss:"e-table-columns e-icons",cssClass:e8e+" "+i8e+" "+XWe,itemName:"TableColumns",items:i6e,element:i}))},itt.prototype.cellDropDown=function(e,t,i){(i=ge("#"+this.parent.getID()+"_"+e+"_TableCell",t)).classList.contains(n8e)||(this.tableCellDropDown=this.toolbarRenderer.renderDropDownButton({iconCss:"e-table-cell e-icons",cssClass:e8e+" "+i8e+" "+XWe,itemName:"TableCell",items:ZQe,element:i}))},itt.prototype.verticalAlignDropDown=function(e,t,i){(i=ge("#"+this.parent.getID()+"_"+e+"_TableCellVerticalAlign",t)).classList.contains(n8e)||(this.tableCellVerticalAlignDropDown=this.toolbarRenderer.renderDropDownButton({iconCss:"e-table-cell-ver-align e-icons",cssClass:e8e+" "+i8e+" "+XWe,itemName:"TableCellVerticalAlign",items:o6e,element:i}))},itt.prototype.renderDisplayDropDown=function(e,t,i,n){var o=i;(i=ge("#"+this.parent.getID()+"_"+e+("display"===n?"_Display":"videolayoutoption"===n?"_VideoLayoutOption":"_AudioLayoutOption"),t)).classList.contains(n8e)||(this.displayDropDown=this.toolbarRenderer.renderDropDownButton({iconCss:"display"===n?"e-display e-icons":"videolayoutoption"===n?"e-video-display e-icons":"e-audio-display e-icons",cssClass:e8e+" "+i8e+" "+XWe,itemName:"display"===n?"Display":"videolayoutoption"===n?"VideoLayoutOption":"AudioLayoutOption",items:"display"===n?XQe:"videolayoutoption"===n?JQe:KQe,element:i,activeElement:o}))},itt.prototype.renderAlignmentDropDown=function(e,t,i,n){var o=i;(i=ge("#"+this.parent.getID()+"_"+e+("align"===n?"_Align":"_VideoAlign"),t)).classList.contains(n8e)||(this.imageAlignDropDown=this.toolbarRenderer.renderDropDownButton({iconCss:"e-justify-left e-icons",cssClass:e8e+" "+t8e+" "+XWe,itemName:"align"===n?"Align":"VideoAlign",items:"align"===n?QQe:UQe,element:i,activeElement:o}))},itt.prototype.tableStylesDropDown=function(e,t,i){(i=ge("#"+this.parent.getID()+"_"+e+"_Styles",t)).classList.contains(n8e)||(this.imageAlignDropDown=this.toolbarRenderer.renderDropDownButton({iconCss:"e-style e-icons",cssClass:e8e+" "+t8e+" "+XWe,itemName:"Styles",items:this.parent.tableSettings.styles,element:i}))},itt.prototype.removeDropDownClasses=function(e){q([e],[n8e,e8e,t8e,i8e])},itt.prototype.destroyDropDowns=function(){this.formatDropDown&&(this.removeDropDownClasses(this.formatDropDown.element),this.formatDropDown.destroy(),this.formatDropDown=null),this.fontNameDropDown&&(this.removeDropDownClasses(this.fontNameDropDown.element),this.fontNameDropDown.destroy(),this.fontNameDropDown=null),this.fontSizeDropDown&&(this.removeDropDownClasses(this.fontSizeDropDown.element),this.fontSizeDropDown.destroy(),this.fontSizeDropDown=null),this.alignDropDown&&(this.removeDropDownClasses(this.alignDropDown.element),this.alignDropDown.destroy(),this.alignDropDown=null),this.imageAlignDropDown&&(this.removeDropDownClasses(this.imageAlignDropDown.element),this.imageAlignDropDown.destroy(),this.imageAlignDropDown=null),this.displayDropDown&&(this.removeDropDownClasses(this.displayDropDown.element),this.displayDropDown.destroy(),this.displayDropDown=null),this.tableRowsDropDown&&(this.removeDropDownClasses(this.tableRowsDropDown.element),this.tableRowsDropDown.destroy(),this.tableRowsDropDown=null),this.tableColumnsDropDown&&(this.removeDropDownClasses(this.tableColumnsDropDown.element),this.tableColumnsDropDown.destroy(),this.tableColumnsDropDown=null),this.tableCellDropDown&&(this.removeDropDownClasses(this.tableCellDropDown.element),this.tableCellDropDown.destroy(),this.tableCellDropDown=null),this.tableCellVerticalAlignDropDown&&(this.removeDropDownClasses(this.tableCellVerticalAlignDropDown.element),this.tableCellVerticalAlignDropDown.destroy(),this.tableCellVerticalAlignDropDown=null),this.numberFormatListDropDown&&(this.removeDropDownClasses(this.numberFormatListDropDown.element),this.numberFormatListDropDown.destroy(),this.numberFormatListDropDown=null),this.bulletFormatListDropDown&&(this.removeDropDownClasses(this.bulletFormatListDropDown.element),this.bulletFormatListDropDown.destroy(),this.bulletFormatListDropDown=null),this.toolbarRenderer=null},itt.prototype.setRtl=function(e){this.formatDropDown&&this.formatDropDown.setProperties({enableRtl:e.enableRtl}),this.fontNameDropDown&&this.fontNameDropDown.setProperties({enableRtl:e.enableRtl}),this.fontSizeDropDown&&this.fontSizeDropDown.setProperties({enableRtl:e.enableRtl}),this.alignDropDown&&this.alignDropDown.setProperties({enableRtl:e.enableRtl}),this.imageAlignDropDown&&this.imageAlignDropDown.setProperties({enableRtl:e.enableRtl}),this.displayDropDown&&this.displayDropDown.setProperties({enableRtl:e.enableRtl}),this.numberFormatListDropDown&&this.numberFormatListDropDown.setProperties({enableRtl:e.enableRtl}),this.bulletFormatListDropDown&&this.bulletFormatListDropDown.setProperties({enableRtl:e.enableRtl})},itt.prototype.updateCss=function(e,t){e&&t.cssClass&&(je(t.oldCssClass)?e.setProperties({cssClass:(e.cssClass+" "+t.cssClass).trim()}):e.setProperties({cssClass:(e.cssClass.replace(t.oldCssClass,"").trim()+" "+t.cssClass).trim()}))},itt.prototype.setCssClass=function(e){for(var t=[this.formatDropDown,this.fontNameDropDown,this.fontSizeDropDown,this.alignDropDown,this.imageAlignDropDown,this.displayDropDown,this.numberFormatListDropDown,this.bulletFormatListDropDown,this.tableRowsDropDown,this.tableColumnsDropDown,this.tableCellDropDown,this.tableCellVerticalAlignDropDown],i=0;i<t.length;i++)this.updateCss(t[i],e)},itt.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(S4e,this.beforeRender,this),this.parent.on(e4e,this.onIframeMouseDown,this),this.parent.on(f5e,this.setRtl,this),this.parent.on(d4e,this.onPropertyChanged,this),this.parent.on(uWe,this.setCssClass,this))},itt.prototype.onIframeMouseDown=function(){!je(this.parent.getToolbarElement())&&(0<this.parent.getToolbarElement().querySelectorAll('.e-rte-dropdown-btn[aria-expanded="true"]').length||0<this.parent.getToolbarElement().querySelectorAll('.e-dropdown-btn.e-rte-inline-dropdown[aria-expanded="true"]').length)&&this.closeOpenDropdowns()},itt.prototype.closeOpenDropdowns=function(){[this.formatDropDown,this.fontNameDropDown,this.fontSizeDropDown,this.alignDropDown,this.imageAlignDropDown,this.displayDropDown,this.numberFormatListDropDown,this.bulletFormatListDropDown,this.tableRowsDropDown,this.tableColumnsDropDown,this.tableCellDropDown,this.tableCellVerticalAlignDropDown,this.parent.toolbarModule.colorPickerModule.fontColorDropDown,this.parent.toolbarModule.colorPickerModule.backgroundColorDropDown].forEach(function(e){e&&e.dropDown&&e.dropDown.element&&e.dropDown.element.classList.contains("e-popup-open")&&e.toggle()})},itt.prototype.removeEventListener=function(){this.parent.off(e4e,this.onIframeMouseDown),this.parent.off(f5e,this.setRtl),this.parent.off(S4e,this.beforeRender),this.parent.off(d4e,this.onPropertyChanged),this.parent.off(uWe,this.setCssClass)},itt.prototype.destroy=function(){this.removeEventListener(),this.destroyDropDowns()};var ttt=itt;function itt(e,t){this.parent=e,this.locator=t,this.i10n=t.getService("rteLocale"),this.renderFactory=this.locator.getService("rendererFactory"),this.addEventListener()}ott.prototype.addEventListener=function(){this.parent.on(i4e,this.toolbarClick,this),this.parent.on(C4e,this.dropDownSelect,this),this.parent.on(h5e,this.renderSelection,this),this.parent.on(t4e,this.removeEventListener,this)},ott.prototype.toolbarClick=function(e){var t;this.parent.userAgentData.isSafari()&&this.parent.formatter.editorManager.nodeSelection&&!this.parent.inputElement.contains(this.parent.getRange().startContainer)&&this.parent.notify(i5e,{}),je(e.item)||(je(e.item.controlParent)||(t=e.item.controlParent.activeEle)&&(t.tabIndex=-1),"NumberFormatList"!==e.item.command&&"BulletFormatList"!==e.item.command||(e.originalEvent.target.classList.contains("e-order-list")||e.originalEvent.target.classList.contains("e-unorder-list"))&&(e.item.command="Lists",e.item.subCommand="NumberFormatList"===e.item.subCommand?"OL":"UL"),"Lists"===e.item.command&&e.originalEvent.target.classList.contains("e-caret")&&(e.originalEvent.target.parentElement.classList.contains("e-rte-bulletformatlist-dropdown")||e.originalEvent.target.parentElement.classList.contains("e-rte-numberformatlist-dropdown")))||(this.parent.notify(l4e,e),this.parent.notify(h4e,e))},ott.prototype.dropDownSelect=function(e){var t,i;this.parent.notify(i5e,{}),document.body.contains(document.body.querySelector(".e-rte-quick-toolbar"))&&e.item&&("Images"===e.item.command||"Audios"===e.item.command||"Videos"===e.item.command||"VideoLayoutOption"===e.item.command||"Display"===e.item.command||"Table"===e.item.command)||(t=e.item.controlParent&&this.parent.quickToolbarModule&&this.parent.quickToolbarModule.tableQTBar&&this.parent.quickToolbarModule.tableQTBar.element.contains(e.item.controlParent.element)?"Table":null,"Lists"===e.item.command?(i={listStyle:e.item.value,listImage:e.item.listImage,type:e.item.subCommand},this.parent.formatter.process(this.parent,e,e.originalEvent,i)):this.parent.formatter.process(this.parent,e,e.originalEvent,t)),this.parent.notify(t5e,{})},ott.prototype.renderSelection=function(e){this.parent.notify(i5e,{}),this.parent.formatter.process(this.parent,e,e.originalEvent,null),this.parent.notify(t5e,{})},ott.prototype.removeEventListener=function(){this.parent.off(i4e,this.toolbarClick),this.parent.off(C4e,this.dropDownSelect),this.parent.off(h5e,this.renderSelection),this.parent.off(t4e,this.removeEventListener)};var ntt=ott;function ott(e){this.parent=e,this.addEventListener()}stt.prototype.initializeInstance=function(){this.toolbarRenderer=this.renderFactory.getRenderer(q3e.Toolbar)},stt.prototype.renderColorPickerInput=function(r){var s,a,l=this,h=(this.initializeInstance(),r.containerType),d=r.container;HQe.forEach(function(e){if(-1!==S6e(e,r.items))switch(e){case"fontcolor":s=l.parent.getID()+"_"+h+"_FontColor_Target";var t=l.parent.createElement("input");if(t.id=s,t.classList.add(U8e),!je(l.parent.cssClass))for(var i=l.parent.cssClass.split(" "),n=0;n<i.length;n++)""!==i[n].trim()&&t.classList.add(i[n]);document.body.appendChild(t),a={cssClass:l.tools[e.toLocaleLowerCase()].icon+" "+L8e+" "+P8e+l.parent.getCssClass(!0),value:l.tools[e.toLocaleLowerCase()].value,command:l.tools[e.toLocaleLowerCase()].command,subCommand:l.tools[e.toLocaleLowerCase()].subCommand,element:ge("#"+l.parent.getID()+"_"+h+"_FontColor",d),target:s},l.fontColorPicker=l.toolbarRenderer.renderColorPicker(a,"fontcolor"),l.fontColorDropDown=l.toolbarRenderer.renderColorPickerDropDown(a,"fontcolor",l.fontColorPicker);break;case"backgroundcolor":s=l.parent.getID()+"_"+h+"_BackgroundColor_Target";var o=l.parent.createElement("input");if(o.id=s,o.classList.add(q8e),!je(l.parent.cssClass))for(i=l.parent.cssClass.split(" "),n=0;n<i.length;n++)""!==i[n].trim()&&o.classList.add(i[n]);document.body.appendChild(o),a={cssClass:l.tools[e.toLocaleLowerCase()].icon+" "+L8e+" "+P8e+l.parent.getCssClass(!0),value:l.tools[e.toLocaleLowerCase()].value,command:l.tools[e.toLocaleLowerCase()].command,subCommand:l.tools[e.toLocaleLowerCase()].subCommand,element:ge("#"+l.parent.getID()+"_"+h+"_BackgroundColor",d),target:s},l.backgroundColorPicker=l.toolbarRenderer.renderColorPicker(a,"backgroundcolor",r.containerType),l.backgroundColorDropDown=l.toolbarRenderer.renderColorPickerDropDown(a,"backgroundcolor",l.backgroundColorPicker,l.defaultColorPicker,r.containerType)}}),this.parent.inlineMode.enable&&this.setCssClass({cssClass:this.parent.getCssClass()})},stt.prototype.destroy=function(){this.removeEventListener(),this.destroyColorPicker(),this.defaultColorPicker=null,this.fontColorPicker=null,this.fontColorDropDown=null,this.backgroundColorDropDown=null,this.backgroundColorPicker=null,this.tools={}},stt.prototype.destroyColorPicker=function(){var e;this.fontColorPicker&&!this.fontColorPicker.isDestroyed&&this.fontColorPicker.destroy(),this.backgroundColorPicker&&!this.backgroundColorPicker.isDestroyed&&this.backgroundColorPicker.destroy(),this.fontColorDropDown&&!this.fontColorDropDown.isDestroyed&&((e=this.fontColorDropDown.element.querySelector(".e-rte-color-content"))&&G(e),this.fontColorDropDown.destroy()),this.backgroundColorDropDown&&!this.backgroundColorDropDown.isDestroyed&&((e=this.backgroundColorDropDown.element.querySelector(".e-rte-color-content"))&&(this.defaultColorPicker=e.children[0].style.borderBottomColor,G(e)),this.backgroundColorDropDown.destroy())},stt.prototype.setRtl=function(e){this.fontColorPicker&&(this.fontColorPicker.setProperties({enableRtl:e.enableRtl}),this.fontColorDropDown.setProperties({enableRtl:e.enableRtl})),this.backgroundColorPicker&&(this.backgroundColorPicker.setProperties({enableRtl:e.enableRtl}),this.backgroundColorDropDown.setProperties({enableRtl:e.enableRtl}))},stt.prototype.setCssClass=function(e){this.updateCss(this.fontColorPicker,this.fontColorDropDown,e),this.updateCss(this.backgroundColorPicker,this.backgroundColorDropDown,e)},stt.prototype.updateCss=function(e,t,i){e&&i.cssClass&&(je(i.oldCssClass)?(e.setProperties({cssClass:(e.cssClass+" "+i.cssClass).trim()}),t.setProperties({cssClass:(t.cssClass+" "+i.cssClass).trim()})):(e.setProperties({cssClass:(e.cssClass.replace(i.oldCssClass,"").replace("  "," ").trim()+" "+i.cssClass).trim()}),t.setProperties({cssClass:(t.cssClass.replace(i.oldCssClass,"").replace("  "," ").trim()+" "+i.cssClass).trim()})))},stt.prototype.addEventListener=function(){this.parent.on(v4e,this.renderColorPickerInput,this),this.parent.on(f5e,this.setRtl,this),this.parent.on(d4e,this.onPropertyChanged,this),this.parent.on(uWe,this.setCssClass,this),this.parent.on(AWe,this.showColorPicker,this)},stt.prototype.showColorPicker=function(e){je(this.fontColorPicker)||"fontcolor"!==e.toolbarClick?je(this.backgroundColorPicker)||"backgroundcolor"!==e.toolbarClick||this.backgroundColorDropDown.toggle():this.fontColorDropDown.toggle()},stt.prototype.onPropertyChanged=function(e){for(var t=e.newProp,i=0,n=Object.keys(t);i<n.length;i++)switch(n[i]){case"fontColor":if(this.fontColorPicker)for(var o=0,r=Object.keys(t.fontColor);o<r.length;o++)switch(r[o]){case"default":this.fontColorPicker.setProperties({value:t.fontColor.default}),this.fontColorDropDown.element.querySelector("."+this.tools.fontcolor.icon).style.borderBottomColor=t.fontColor.default;break;case"mode":this.fontColorPicker.setProperties({mode:t.fontColor.mode});break;case"columns":this.fontColorPicker.setProperties({columns:t.fontColor.columns});break;case"colorCode":this.fontColorPicker.setProperties({presetColors:t.fontColor.colorCode});break;case"modeSwitcher":this.fontColorPicker.setProperties({modeSwitcher:t.fontColor.modeSwitcher})}break;case"backgroundColor":if(this.backgroundColorPicker)for(var s=0,a=Object.keys(t.backgroundColor);s<a.length;s++)switch(a[s]){case"default":this.backgroundColorPicker.setProperties({value:t.backgroundColor.default}),this.backgroundColorDropDown.element.querySelector("."+this.tools.backgroundcolor.icon).style.borderBottomColor=t.backgroundColor.default;break;case"mode":this.backgroundColorPicker.setProperties({mode:t.backgroundColor.mode});break;case"columns":this.backgroundColorPicker.setProperties({columns:t.backgroundColor.columns});break;case"colorCode":this.backgroundColorPicker.setProperties({presetColors:t.backgroundColor.colorCode});break;case"modeSwitcher":this.backgroundColorPicker.setProperties({modeSwitcher:t.backgroundColor.modeSwitcher})}}},stt.prototype.removeEventListener=function(){this.parent.off(v4e,this.renderColorPickerInput),this.parent.off(f5e,this.setRtl),this.parent.off(d4e,this.onPropertyChanged),this.parent.off(uWe,this.setCssClass),this.parent.off(AWe,this.showColorPicker)};var rtt=stt;function stt(e,t){this.tools={},this.parent=e,this.locator=t,this.renderFactory=this.locator.getService("rendererFactory"),this.addEventListener(),this.parent.toolbarSettings&&0<Object.keys(this.parent.toolbarSettings.itemConfigs).length?Pe(this.tools,zQe,N6e(this.parent.toolbarSettings.itemConfigs),!0):this.tools=zQe}ltt.prototype.initializeInstance=function(){this.contentRenderer=this.renderFactory.getRenderer(q3e.Content),this.editableElement=this.contentRenderer.getEditPanel(),this.editPanel=this.contentRenderer.getPanel()},ltt.prototype.toolbarBindEvent=function(){this.parent.inlineMode.enable||(this.keyBoardModule=new bn(this.getToolbarElement(),{keyAction:this.toolBarKeyDown.bind(this),keyConfigs:this.parent.formatter.keyConfig,eventName:"keydown"}))},ltt.prototype.toolBarKeyDown=function(e){switch(e.action){case"escape":this.parent.contentModule.getEditPanel().focus();break;case"enter":je(e.target)||!e.target.classList.contains("e-rte-fontcolor-dropdown")&&!e.target.classList.contains("e-rte-backgroundcolor-dropdown")||this.parent.notify(AWe,{toolbarClick:e.target.classList.contains("e-rte-fontcolor-dropdown")?"fontcolor":"backgroundcolor"})}},ltt.prototype.createToolbarElement=function(){this.tbElement=this.parent.createElement("div",{id:this.parent.getID()+"_toolbar"}),!F.isDevice&&this.parent.inlineMode.enable&&I6e()||(this.parent.inlineMode.enable?this.parent.rootContainer.insertBefore(this.tbElement,this.editPanel):(this.tbWrapper=this.parent.createElement("div",{id:this.parent.getID()+"_toolbar_wrapper",innerHTML:this.tbElement.outerHTML,className:s8e}),this.tbElement=this.tbWrapper.firstElementChild,this.parent.rootContainer.insertBefore(this.tbWrapper,this.editPanel)))},ltt.prototype.getToolbarMode=function(){var e;switch(this.parent.toolbarSettings.type){case G3e.Expand:e="Extended";break;case G3e.Scrollable:e="Scrollable";break;default:e="MultiRow"}return e=I6e()&&this.parent.toolbarSettings.type===G3e.Expand?G3e.Scrollable:e},ltt.prototype.checkToolbarResponsive=function(e){var t;return!(!F.isDevice||I6e()||(t=this.parent.toolbarSettings.type===G3e.Expand?G3e.MultiRow:this.parent.toolbarSettings.type,this.baseToolbar.render({container:this.parent.inlineMode.enable?"quick":"toolbar",items:this.parent.toolbarSettings.items,mode:t,target:e,cssClass:this.parent.getCssClass()}),this.parent.toolbarSettings.type===G3e.Expand&&(U([e],["e-rte-tb-mobile"]),this.parent.inlineMode.enable?this.addFixedTBarClass():U([e],[GWe])),this.wireEvents(),this.dropDownModule.renderDropDowns({container:e,containerType:this.parent.inlineMode.enable?"quick":"toolbar",items:this.parent.toolbarSettings.items}),this.renderColorPicker({container:this.tbElement,containerType:this.parent.inlineMode.enable?"quick":"toolbar",items:this.parent.toolbarSettings.items}),0))},ltt.prototype.checkIsTransformChild=function(){this.isTransformChild=!1;for(var e=ct('[style*="transform"]',document),t=0;t<e.length;t++)if(!je(e[t].contains)&&e[t].contains(this.parent.element)){this.isTransformChild=!0;break}},ltt.prototype.toggleFloatClass=function(){var e=this.parent.floatingToolbarOffset;this.parent.toolbarSettings.enableFloating?(U([this.tbElement.parentElement],[HWe]),gt(this.tbElement.parentElement,{top:e+"px"})):(q([this.tbElement.parentElement],[HWe]),gt(this.tbElement.parentElement,{top:""}))},ltt.prototype.renderToolbar=function(){this.initializeInstance(),this.createToolbarElement(),this.checkToolbarResponsive(this.tbElement)||(this.parent.inlineMode.enable?this.parent.notify(g5e,{}):(this.baseToolbar.render({container:"toolbar",items:this.parent.toolbarSettings.items,mode:this.getToolbarMode(),target:this.tbElement,cssClass:this.parent.getCssClass()}),this.parent.element.classList.contains("e-rte-full-screen")&&this.updateItem({targetItem:"Maximize",updateItem:"Minimize",baseToolbar:this.parent.getBaseToolbarObject()}),this.parent.inlineMode.enable||(this.parent.toolbarSettings.enableFloating&&(this.checkIsTransformChild(),this.toggleFloatClass()),U([this.parent.element],[OQe]),this.parent.toolbarSettings.type===G3e.Expand&&U([this.parent.element],[jWe]))),this.wireEvents(),this.parent.inlineMode.enable&&!I6e()&&this.addFixedTBarClass(),this.parent.inlineMode.enable||(this.dropDownModule.renderDropDowns({container:this.tbElement,containerType:"toolbar",items:this.parent.toolbarSettings.items}),this.renderColorPicker({container:this.tbElement,containerType:"toolbar",items:this.parent.toolbarSettings.items}),this.refreshToolbarOverflow()),this.parent.rootContainer&&this.parent.rootContainer.classList.contains("e-source-code-enabled")&&(this.parent.notify(_4e,{targetItem:"SourceCode",updateItem:"Preview",baseToolbar:this.parent.getBaseToolbarObject()}),this.parent.disableToolbarItem(this.parent.toolbarSettings.items)))},ltt.prototype.addFixedTBarClass=function(){U([this.tbElement],[_We])},ltt.prototype.removeFixedTBarClass=function(){q([this.tbElement],[_We])},ltt.prototype.showFixedTBar=function(){U([this.tbElement],[a8e]),F.isIos&&U([this.tbElement],[N8e])},ltt.prototype.hideFixedTBar=function(){this.isToolbar?this.isToolbar=!1:q([this.tbElement],[a8e,N8e])},ltt.prototype.updateItem=function(e){var t=this.tools[e.updateItem.toLocaleLowerCase()];("Code View"!==D6e(e.updateItem.toLocaleLowerCase(),this.locator)&&"Preview"!==D6e(e.updateItem.toLocaleLowerCase(),this.locator)||"en-US"!==this.parent.locale)&&(t.tooltip=D6e(e.updateItem.toLocaleLowerCase(),this.locator));var i,n=B6e(k6e(this.tools[e.targetItem.toLocaleLowerCase()].subCommand),e.baseToolbar.toolbarObj.items)[0];je(n)?this.addTBarItem(e,0):(i=this.parent.inlineMode.enable?"_quick_":"_toolbar_",e.baseToolbar.toolbarObj.items[n].id=this.parent.getID()+i+t.id,e.baseToolbar.toolbarObj.items[n].prefixIcon=t.icon,e.baseToolbar.toolbarObj.items[n].tooltipText=t.tooltip,e.baseToolbar.toolbarObj.items[n].subCommand=t.subCommand,e.baseToolbar.toolbarObj.dataBind(),e.baseToolbar.toolbarObj.refreshOverflow())},ltt.prototype.updateToolbarStatus=function(e){this.tbElement&&(!this.parent.inlineMode.enable||!I6e()&&F.isDevice)&&M6e({args:e,dropDownModule:this.dropDownModule,parent:this.parent,tbElements:ct("."+r8e,this.tbElement),tbItems:this.baseToolbar.toolbarObj.items},!!this.parent.inlineMode.enable,this.parent)},ltt.prototype.fullScreen=function(e){this.parent.fullScreenModule.showFullScreen(e)},ltt.prototype.hideScreen=function(e){this.parent.fullScreenModule.hideFullScreen(e)},ltt.prototype.getBaseToolbar=function(){return this.baseToolbar},ltt.prototype.addTBarItem=function(e,t){e.baseToolbar.toolbarObj.addItems([e.baseToolbar.getObject(e.updateItem,"toolbar")],t)},ltt.prototype.enableTBarItems=function(e,t,i,n){var o=B6e(k6e(t),e.toolbarObj.items);this.tbItems=ct("."+r8e,e.toolbarObj.element);for(var r=0;r<o.length;r++){var s=this.tbItems[o[r]];s&&e.toolbarObj.enableItems(s,i)}ge("."+VQe,this.parent.element)||n||F6e(e,this.parent.formatter.editorManager.undoRedoManager.getUndoStatus())},ltt.prototype.removeTBarItems=function(e){je(this.baseToolbar.toolbarObj)&&(this.baseToolbar=this.parent.getBaseToolbarObject());var t=B6e(k6e(e),this.baseToolbar.toolbarObj.items);this.tbItems=this.parent.inlineMode.enable?ct("."+r8e,this.baseToolbar.toolbarObj.element):ct("."+r8e,this.parent.element);for(var i=0;i<t.length;i++)this.baseToolbar.toolbarObj.removeItems(this.tbItems[t[i]])},ltt.prototype.getExpandTBarPopHeight=function(){var e,t=0;return this.parent.toolbarSettings.type===G3e.Expand&&this.tbElement.classList.contains("e-extended-toolbar")&&((e=ge(".e-toolbar-extended",this.tbElement))&&this.tbElement.classList.contains("e-expand-open")||e&&e.classList.contains("e-popup-open")?(U([e],[h8e]),t+=e.offsetHeight,q([e],[h8e])):q([this.tbElement],[F8e])),t},ltt.prototype.getToolbarHeight=function(){return this.tbElement.offsetHeight},ltt.prototype.getToolbarElement=function(){return this.parent&&this.parent.element?ge("."+VWe,this.parent.element):null},ltt.prototype.refreshToolbarOverflow=function(){this.parent.element.classList.remove(FWe),this.baseToolbar.toolbarObj.refreshOverflow(),this.parent.enableRtl&&this.parent.element.classList.add(FWe)},ltt.prototype.isToolbarDestroyed=function(){return!!(this.baseToolbar&&this.baseToolbar.toolbarObj&&this.baseToolbar.toolbarObj.isDestroyed)},ltt.prototype.destroyToolbar=function(){var e,t;this.isToolbarDestroyed()||(this.parent.unWireScrollElementsEvents(),this.unWireEvents(),this.dropDownModule.destroy(),this.parent.emojiPickerModule&&!this.parent.emojiPickerModule.isPopupDestroyed&&this.parent.emojiPickerModule.childDestroy(),this.dropDownModule=null,this.colorPickerModule.destroy(),this.colorPickerModule=null,this.keyBoardModule&&(this.keyBoardModule.destroy(),this.keyBoardModule=null),this.baseToolbar.destroy(),this.removeEventListener(),q([this.parent.element],[OQe]),q([this.parent.element],[jWe]),e=ge("."+s8e,this.parent.element),t=ge("."+VWe,this.parent.element),je(e)||G(e),je(t))||G(t)},ltt.prototype.destroy=function(){this.isDestroyed||(this.isToolbarDestroyed()||this.destroyToolbar(),this.toolbarObj=null,this.editPanel=null,this.isToolbar=null,this.editableElement=null,this.tbItems=null,this.baseToolbar=null,this.tbElement=null,this.tbWrapper=null,this.isTransformChild=null,this.contentRenderer=null,this.dropDownModule=null,this.colorPickerModule=null,this.toolbarActionModule=null,this.tools=null,this.locator=null,this.renderFactory=null,this.isDestroyed=!0)},ltt.prototype.mouseDownHandler=function(){F.isDevice&&this.parent.inlineMode.enable&&!I6e()&&this.showFixedTBar()},ltt.prototype.focusChangeHandler=function(){F.isDevice&&this.parent.inlineMode.enable&&!I6e()&&(this.isToolbar=!1,this.hideFixedTBar())},ltt.prototype.dropDownBeforeOpenHandler=function(){this.isToolbar=!0},ltt.prototype.tbFocusHandler=function(e){var t=document.activeElement,i=z(t,".e-rte-toolbar");if(t===this.parent.getToolbarElement()||i===this.parent.getToolbarElement())for(var n=this.parent.getToolbarElement().querySelectorAll(".e-expended-nav"),o=0;o<n.length;o++)je(this.parent.getToolbarElement().querySelector(".e-insert-table-btn"))?n[o].setAttribute("tabindex","0"):n[o].setAttribute("tabindex","1")},ltt.prototype.wireEvents=function(){this.parent.inlineMode.enable&&I6e()||E.add(this.tbElement,"focusin",this.tbFocusHandler,this)},ltt.prototype.unWireEvents=function(){E.remove(this.tbElement,"focusin",this.tbFocusHandler)},ltt.prototype.addEventListener=function(){this.parent.isDestroyed||(this.dropDownModule=new ttt(this.parent,this.locator),this.toolbarActionModule=new ntt(this.parent),this.colorPickerModule=new rtt(this.parent,this.locator),this.parent.on($3e,this.renderToolbar,this),this.parent.on(a4e,this.toolbarBindEvent,this),this.parent.on(s4e,this.updateToolbarStatus,this),this.parent.on(d4e,this.onPropertyChanged,this),this.parent.on(r4e,this.onRefresh,this),this.parent.on(t4e,this.destroy,this),this.parent.on(b4e,this.fullScreen,this),this.parent.on(w4e,this.hideScreen,this),this.parent.on(_4e,this.updateItem,this),this.parent.on(e5e,this.dropDownBeforeOpenHandler,this),this.parent.on(d5e,this.focusChangeHandler,this),this.parent.on(o5e,this.mouseDownHandler,this),this.parent.on(r5e,this.mouseDownHandler,this),this.parent.on(uWe,this.setCssClass,this))},ltt.prototype.removeEventListener=function(){this.parent.off($3e,this.renderToolbar),this.parent.off(a4e,this.toolbarBindEvent),this.parent.off(s4e,this.updateToolbarStatus),this.parent.off(d4e,this.onPropertyChanged),this.parent.off(r4e,this.onRefresh),this.parent.off(t4e,this.destroy),this.parent.off(b4e,this.parent.fullScreenModule.showFullScreen),this.parent.off(w4e,this.parent.fullScreenModule.hideFullScreen),this.parent.off(_4e,this.updateItem),this.parent.off(e5e,this.dropDownBeforeOpenHandler),this.parent.off(d5e,this.focusChangeHandler),this.parent.off(o5e,this.mouseDownHandler),this.parent.off(r5e,this.mouseDownHandler),this.parent.off(uWe,this.setCssClass)},ltt.prototype.setCssClass=function(e){this.toolbarObj&&e.cssClass&&(je(e.oldCssClass)?this.toolbarObj.setProperties({cssClass:(this.toolbarObj.cssClass+" "+e.cssClass).trim()}):this.toolbarObj.setProperties({cssClass:(this.toolbarObj.cssClass.replace(e.oldCssClass,"").trim()+" "+e.cssClass).trim()}))},ltt.prototype.onRefresh=function(){this.parent.inlineMode.enable||this.refreshToolbarOverflow(),this.parent.autoResize()},ltt.prototype.onPropertyChanged=function(e){if(!je(e.newProp.inlineMode))for(var t=0,i=Object.keys(e.newProp.inlineMode);t<i.length;t++)"enable"===i[t]&&this.refreshToolbar();je(e.newProp.toolbarSettings)||je(e.newProp.toolbarSettings.enableFloating)||this.toggleFloatClass(),e.module===this.getModuleName()&&this.refreshToolbar()},ltt.prototype.refreshToolbar=function(){je(this.baseToolbar.toolbarObj)&&(this.baseToolbar=this.parent.getBaseToolbarObject());var e=ge("."+s8e,this.parent.element);(ge("."+VWe,this.parent.element)||e)&&this.destroyToolbar(),this.parent.toolbarSettings.enable&&(this.baseToolbar&&this.baseToolbar.toolbarObj&&!this.baseToolbar.toolbarObj.isDestroyed&&this.baseToolbar.destroy(),this.baseToolbar=new $et(this.parent,this.locator),this.addEventListener(),this.renderToolbar(),this.parent.wireScrollElementsEvents(),ge("."+VQe,this.parent.element)||this.parent.inlineMode.enable||F6e(this.baseToolbar,this.parent.formatter.editorManager.undoRedoManager.getUndoStatus()),this.parent.notify($5e,{}))},ltt.prototype.getModuleName=function(){return"toolbar"},ltt.prototype.renderColorPicker=function(e){this.colorPickerModule.renderColorPickerInput(e)};var att=ltt;function ltt(e,t){var i;this.tools={},this.parent=e,this.isDestroyed=!1,this.isToolbar=!1,this.locator=t,this.isTransformChild=!1,this.renderFactory=this.locator.getService("rendererFactory"),i=this.parent,WQe.forEach(function(e,t){WQe[t].text=p6e(i,jQe,WQe[t])}),XQe.forEach(function(e,t){XQe[t].text=p6e(i,qQe,XQe[t])}),KQe.forEach(function(e,t){KQe[t].text=p6e(i,GQe,KQe[t])}),JQe.forEach(function(e,t){JQe[t].text=p6e(i,YQe,JQe[t])}),e6e.forEach(function(e,t){e6e[t].text=p6e(i,$Qe,e6e[t])}),i6e.forEach(function(e,t){i6e[t].text=p6e(i,t6e,i6e[t])}),o6e.forEach(function(e,t){o6e[t].text=p6e(i,n6e,o6e[t])}),s6e.forEach(function(e,t){s6e[t].text=p6e(i,r6e,s6e[t])}),K6e(this.parent),this.baseToolbar=new $et(this.parent,this.locator),this.addEventListener(),this.parent.toolbarSettings&&0<Object.keys(this.parent.toolbarSettings.itemConfigs).length?Pe(this.tools,zQe,N6e(this.parent.toolbarSettings.itemConfigs),!0):this.tools=zQe}dtt.prototype.appendPopupContent=function(){this.toolbarElement=this.parent.createElement("div",{className:QWe}),this.element.classList.contains(JWe)&&this.toolbarElement.classList.add(UWe),this.element.appendChild(this.toolbarElement)},dtt.prototype.render=function(e){var t="Image"===e.popupType?KWe:"Inline"===e.popupType?ZWe:"Text"===e.popupType?JWe:"",i=D(e.popupType+"_Quick_Popup");this.stringItems=e.toolbarItems,this.element=this.parent.createElement("div",{id:i,className:t+" "+L8e}),this.element.setAttribute("aria-owns",this.parent.getID()),this.appendPopupContent(),this.createToolbar(e.toolbarItems,e.mode,e.cssClass),this.popupRenderer.renderPopup(this),this.addEventListener()},dtt.prototype.createToolbar=function(e,t,i){this.quickTBarObj=new $et(this.parent,this.locator),this.quickTBarObj.render({container:"quick",target:this.toolbarElement,items:e,mode:t,cssClass:i}),this.quickTBarObj.toolbarObj.refresh()},dtt.prototype.setPosition=function(e){var t=z(e.target,".e-img-caption"),i=!!e.target.classList.contains("e-imginline")&&!je(t)?t:e.target,t=(U([this.toolbarElement],[p8e]),!je(i.classList)&&["e-rte-image","e-rte-img-caption","e-clickelem","e-rte-audio","e-rte-video"].some(function(e){return i.classList.contains(e)}));if(je(z(i,"table"))||i.classList.contains("e-multi-cells-select")||t)n=(this.parent.iframeSettings.enable?i=i.classList.contains("e-clickelem")?i.childNodes[0]:i:i.parentElement&&i.classList.contains("e-rte-audio")||i.parentElement.classList.contains("e-video-clickelem")?i.parentElement:i).offsetTop;else for(var n=i.offsetTop,o=z(i,"table");!je(o);)n+=o.offsetTop,o=z(o.parentElement,"table");var r=window.pageYOffset+e.parentData.top,r=n-e.editTop>e.popHeight?r+e.tBarElementHeight+(n-e.editTop)-e.popHeight-5:e.editTop+e.editHeight-(n+i.offsetHeight)>e.popHeight?r+e.tBarElementHeight+(n-e.editTop)+i.offsetHeight+5:e.y;if(je(z(i,"table"))||i.classList.contains("e-multi-cells-select")||t)s=(!this.parent.iframeSettings.enable&&(i.parentElement&&i.classList.contains("e-rte-audio")||i.parentElement.classList.contains("e-video-clickelem"))?i.parentElement:i).offsetLeft;else for(var s=i.offsetLeft,o=z(i.parentElement,"th, td");!je(o);)s+=o.offsetLeft,o=z(o.parentElement,"table");t=i.offsetWidth>e.popWidth?i.offsetWidth/2-e.popWidth/2+e.parentData.left+s:e.parentData.left+s,this.popupObj.position.X=t+e.popWidth>e.parentData.right?e.parentData.right-e.popWidth:t,this.popupObj.position.Y=0<=r?r:e.y+5,this.popupObj.dataBind(),q([this.toolbarElement],[p8e])},dtt.prototype.checkCollision=function(e,t,i){for(var n,o=e.parentData.top,r=e.windowY+o+e.tBarElementHeight,s=[],s="document"===t?Y0(e.popup):Y0(e.popup,e.parentElement),a=0;a<s.length;a++)switch(s[a]){case"top":l="document"===t?e.windowY:window.pageYOffset+o+e.tBarElementHeight;break;case"bottom":var l="document"===t?"inline"===i||"text"===i?e.y-e.popHeight-10:e.windowHeight-(o+e.tBarElementHeight)>e.popHeight?r-e.windowHeight>e.popHeight?r+(e.windowHeight-o)-e.popHeight:r:e.windowY+(o+e.tBarElementHeight):"IMG"!==e.target.tagName?e.parentData.bottom+window.pageYOffset-e.popHeight-10:e.parentData.bottom+window.pageYOffset-e.popHeight-5;break;case"right":n="inline"===i||"text"===i?window.pageXOffset+(e.windowWidth-(e.popWidth+e.bodyRightSpace+10)):e.x-e.popWidth;break;case"left":n="inline"===i||"text"===i?0:e.parentData.left}this.popupObj.position.X=n||this.popupObj.position.X,this.popupObj.position.Y=l||this.popupObj.position.Y,this.popupObj.dataBind()},dtt.prototype.showPopup=function(p,c,u,g){var m=this,e={popup:this.popupObj,cancel:!1,targetElement:u,positionX:p,positionY:c};this.parent.trigger(k5e,e,function(e){var t,i,n,o,r,s,a,l,h,d;e.cancel||(a=s=void 0,t=window.getComputedStyle(document.body),t=parseFloat(t.marginRight.split("px")[0])+parseFloat(t.paddingRight.split("px")[0]),i=window.innerHeight,n=window.innerWidth,o=m.parent.element,h=(r=!je(m.parent.getToolbar()))&&m.parent.toolbarModule.getToolbarHeight(),d=r&&m.parent.toolbarModule.getExpandTBarPopHeight(),r=r?h+d:0,U([m.element],[l8e]),F.isDevice&&!I6e()&&U([m.parent.getToolbar()],[l8e]),a=m.parent.iframeSettings.enable?(s=(l=m.contentRenderer.getPanel().contentWindow).pageYOffset,l.innerHeight):(s=(l=z(u,"."+o8e))?l.scrollTop:0,l?l.offsetHeight:0),h=!je(u.classList)&&["e-rte-image","e-clickelem","e-rte-audio","e-rte-video"].some(function(e){return u.classList.contains(e)}),!m.parent.inlineMode.enable&&!z(u,"table")&&"text"!==g&&"link"!==g||h?(m.parent.disableToolbarItem(m.parent.toolbarSettings.items),m.parent.enableToolbarItem(["Undo","Redo"])):m.parent.enableToolbarItem(m.parent.toolbarSettings.items),ht([m.element],document.body),m.parent.showTooltip&&(m.tooltip=new NS({target:"#"+m.element.id+" [title]",openDelay:400,showTipPointer:!0,beforeRender:m.tooltipBeforeRender.bind(m),windowCollision:!0,position:"BottomCenter",cssClass:m.parent.getCssClass()}),m.tooltip.appendTo(m.element)),m.popupObj.position.X=e.positionX+20,m.popupObj.position.Y=e.positionY+20,m.popupObj.dataBind(),m.popupObj.element.classList.add("e-popup-open"),m.dropDownButtons.renderDropDowns({container:m.toolbarElement,containerType:"quick",items:m.stringItems},e.targetElement),m.colorPickerObj.renderColorPickerInput({container:m.toolbarElement,containerType:"quick",items:m.stringItems}),d={x:p,y:c,target:u,editTop:s,editHeight:a,popup:m.popupObj.element,popHeight:m.popupObj.element.offsetHeight,popWidth:m.popupObj.element.offsetWidth,parentElement:o,bodyRightSpace:t,windowY:window.pageYOffset,windowHeight:i,windowWidth:n,parentData:o.getBoundingClientRect(),tBarElementHeight:r},!(z(u,"TABLE")||"IMG"===u.tagName||"AUDIO"===u.tagName||"VIDEO"===u.tagName||"IFRAME"===u.tagName||u.classList&&(u.classList.contains(b8e)||u.classList.contains(y8e)||u.classList.contains(v8e)))||p!==e.positionX&&c!==e.positionY||m.setPosition(d),m.parent.inlineMode.enable&&!m.parent.iframeSettings.enable||m.checkCollision(d,"parent",""),m.checkCollision(d,"document",m.parent.inlineMode.enable?"inline":"text"===g?"text":""),m.popupObj.element.classList.remove("e-popup-open"),q([m.element],[l8e]),m.popupObj.show({name:"ZoomIn",duration:F.isIE?250:400},u),m.popupObj&&m.parent.cssClass&&(q([m.popupObj.element],m.parent.cssClass.replace(/\s+/g," ").trim().split(" ")),U([m.popupObj.element],m.parent.cssClass.replace(/\s+/g," ").trim().split(" "))),gt(m.element,{maxWidth:window.outerWidth+"px"}),U([m.element],[qWe]),m.isRendered=!0)})},dtt.prototype.tooltipBeforeRender=function(e){e.target.querySelector(".e-active")&&(e.cancel=!0,je(e.target.getAttribute("title"))||this.parent.notify(xWe,{target:e.target,isTitle:!0}))},dtt.prototype.hidePopup=function(){var e,t,i=!je(this.parent.rootContainer)&&this.parent.rootContainer.classList.contains("e-source-code-enabled");F.isDevice&&!I6e()&&q([this.parent.getToolbar()],[l8e]),je(this.element.querySelectorAll("[data-title]"))||this.element.querySelectorAll("[data-title]").forEach(function(e){var t=new MouseEvent("mouseout",{bubbles:!0,cancelable:!0});e.dispatchEvent(t)}),je(document.querySelector(".e-tooltip-wrap"))?je(this.tooltip)||this.tooltip.destroy():(je(document.querySelector("#"+this.element.id+" [data-tooltip-id]"))||(t=(e=document.querySelector("#"+this.element.id+" [data-tooltip-id]")).getAttribute("data-content"),e.removeAttribute("data-content"),e.setAttribute("title",t),e.removeAttribute("data-tooltip-id")),this.tooltip.destroy()),je(this.parent.getToolbar())||this.parent.inlineMode.enable||i||this.parent.enableToolbarItem(this.parent.toolbarSettings.items),this.removeEleFromDOM(),this.isRendered=!1},dtt.prototype.addQTBarItem=function(e,t){this.quickTBarObj.toolbarObj.addItems(this.quickTBarObj.getItems(e,"toolbar"),t)},dtt.prototype.removeQTBarItem=function(e){this.quickTBarObj.toolbarObj.removeItems(e)},dtt.prototype.removeEleFromDOM=function(){var e=this.popupObj.element;this.isRendered&&(this.dropDownButtons.destroyDropDowns(),this.colorPickerObj.destroyColorPicker(),q([this.element],[qWe]),G(e),e=this.popupObj,this.parent.trigger(B5e,e))},dtt.prototype.updateStatus=function(e){M6e({args:e,dropDownModule:this.dropDownButtons,parent:this.parent,tbElements:ct("."+r8e,this.element),tbItems:this.quickTBarObj.toolbarObj.items},!0,this.parent),this.parent.quickToolbarSettings.text&&this.parent.quickToolbarModule.textQTBar&&(M6e({args:e,dropDownModule:this.parent.quickToolbarModule.textQTBar.dropDownButtons,parent:this.parent,tbElements:ct("."+r8e,this.parent.quickToolbarModule.textQTBar.element),tbItems:this.parent.quickToolbarModule.textQTBar.quickTBarObj.toolbarObj.items},!0,this.parent),F6e(this.parent.quickToolbarModule.textQTBar.quickTBarObj,this.parent.formatter.editorManager.undoRedoManager.getUndoStatus())),ge("."+VQe,this.parent.element)||F6e(this.parent.getBaseToolbarObject(),this.parent.formatter.editorManager.undoRedoManager.getUndoStatus())},dtt.prototype.destroy=function(){this.isDestroyed||(this.tooltip&&!this.tooltip.isDestroyed&&(this.tooltip.destroy(),this.tooltip=null),this.removeEventListener(),this.quickTBarObj.destroy(),this.quickTBarObj=null,this.popupObj&&!this.popupObj.isDestroyed&&(this.removeEleFromDOM(),this.popupObj.destroy()),this.colorPickerObj=null,this.dropDownButtons=null,this.stringItems=null,this.dropDownButtons=null,this.colorPickerObj=null,this.toolbarElement=null,this.isDestroyed=!0)},dtt.prototype.addEventListener=function(){!this.parent.isDestroyed&&(this.parent.on(t4e,this.destroy,this),this.parent.on(d4e,this.onPropertyChanged,this),this.parent.inlineMode.enable||this.parent.quickToolbarSettings.text)&&this.parent.on(s4e,this.updateStatus,this)},dtt.prototype.onPropertyChanged=function(e){if(!je(e.newProp.inlineMode))for(var t=0,i=Object.keys(e.newProp.inlineMode);t<i.length;t++)"enable"===i[t]&&(e.newProp.inlineMode.enable?this.parent.on(s4e,this.updateStatus,this):this.parent.off(s4e,this.updateStatus))},dtt.prototype.removeEventListener=function(){this.parent.off(t4e,this.destroy),this.parent.off(d4e,this.onPropertyChanged),(this.parent.inlineMode.enable||this.parent.quickToolbarSettings.text)&&this.parent.off(s4e,this.updateStatus)};var htt=dtt;function dtt(e,t){this.parent=e,this.locator=t,this.isRendered=!1,this.isDestroyed=!1,this.renderFactory=this.locator.getService("rendererFactory"),this.contentRenderer=this.renderFactory.getRenderer(q3e.Content),this.popupRenderer=this.renderFactory.getRenderer(q3e.Popup),this.dropDownButtons=new ttt(this.parent,this.locator),this.colorPickerObj=new rtt(this.parent,this.locator)}ctt.prototype.formatItems=function(e){var t=[];return e.forEach(function(e){if("string"==typeof e)switch(e.toLocaleLowerCase()){case"open":t.push("openLink");break;case"edit":t.push("editLink");break;case"unlink":t.push("removeLink");break;default:t.push(e)}else t.push(e)}),t},ctt.prototype.getQTBarOptions=function(e,t,i,n){return{popupType:e,toolbarItems:i,mode:t,renderType:n,cssClass:this.parent.getCssClass()}},ctt.prototype.createQTBar=function(e,t,i,n){var o;return i.length<1?null:((o=new htt(this.parent,this.locator)).render(this.getQTBarOptions(e,t,this.formatItems(i),n)),o)},ctt.prototype.initializeQuickToolbars=function(){(this.parent.quickToolbarModule=this).contentRenderer=this.renderFactory.getRenderer(q3e.Content),this.parent.inlineMode.enable&&this.parent.inlineMode.onSelection&&I6e()&&E.add(this.contentRenderer.getDocument(),"selectionchange",this.selectionChangeHandler,this)},ctt.prototype.onMouseDown=function(e){this.parent.isBlur=!1,this.parent.isRTE=!0},ctt.prototype.keyUpQT=function(e){27===e.which&&this.hideQuickToolbars()},ctt.prototype.renderQuickToolbars=function(){this.linkQTBar||this.imageQTBar||this.audioQTBar||this.videoQTBar||this.textQTBar||this.tableQTBar||(this.linkQTBar=this.createQTBar("Link","Scrollable",this.parent.quickToolbarSettings.link,q3e.LinkToolbar),this.renderFactory.addRenderer(q3e.LinkToolbar,this.linkQTBar),je(this.parent.quickToolbarSettings.text)||this.parent.inlineMode.enable||(this.textQTBar=this.createQTBar("Text","MultiRow",this.parent.quickToolbarSettings.text,q3e.TextToolbar),this.renderFactory.addRenderer(q3e.TextToolbar,this.textQTBar)),this.imageQTBar=this.createQTBar("Image","MultiRow",this.parent.quickToolbarSettings.image,q3e.ImageToolbar),this.renderFactory.addRenderer(q3e.ImageToolbar,this.imageQTBar),this.audioQTBar=this.createQTBar("Audio","MultiRow",this.parent.quickToolbarSettings.audio,q3e.AudioToolbar),this.renderFactory.addRenderer(q3e.AudioToolbar,this.audioQTBar),this.videoQTBar=this.createQTBar("Video","MultiRow",this.parent.quickToolbarSettings.video,q3e.VideoToolbar),this.renderFactory.addRenderer(q3e.VideoToolbar,this.videoQTBar),this.tableQTBar=this.createQTBar("Table","MultiRow",this.parent.quickToolbarSettings.table,q3e.TableToolbar),this.renderFactory.addRenderer(q3e.TableToolbar,this.tableQTBar),this.linkQTBar&&(E.add(this.linkQTBar.element,"mousedown",this.onMouseDown,this),E.add(this.linkQTBar.element,"keyup",this.keyUpQT,this)),this.imageQTBar&&(E.add(this.imageQTBar.element,"mousedown",this.onMouseDown,this),E.add(this.imageQTBar.element,"keyup",this.keyUpQT,this)),this.audioQTBar&&(E.add(this.audioQTBar.element,"mousedown",this.onMouseDown,this),E.add(this.audioQTBar.element,"keyup",this.keyUpQT,this)),this.videoQTBar&&(E.add(this.videoQTBar.element,"mousedown",this.onMouseDown,this),E.add(this.videoQTBar.element,"keyup",this.keyUpQT,this)),this.textQTBar&&(E.add(this.textQTBar.element,"mousedown",this.onMouseDown,this),E.add(this.textQTBar.element,"keyup",this.keyUpQT,this)),this.tableQTBar&&(E.add(this.tableQTBar.element,"mousedown",this.onMouseDown,this),E.add(this.tableQTBar.element,"keyup",this.keyUpQT,this)))},ctt.prototype.renderInlineQuickToolbar=function(){!this.parent.inlineMode.enable||F.isDevice&&!I6e()||(U([this.parent.element],[zWe]),this.inlineQTBar=this.createQTBar("Inline","MultiRow",this.parent.toolbarSettings.items,q3e.InlineToolbar),this.renderFactory.addRenderer(q3e.InlineToolbar,this.inlineQTBar),E.add(this.inlineQTBar.element,"mousedown",this.onMouseDown,this),E.add(this.inlineQTBar.element,"keyup",this.keyUpQT,this))},ctt.prototype.showInlineQTBar=function(e,t,i){je(this.parent)||this.parent.readonly||"img"===i.tagName.toLowerCase()||this.inlineQTBar.element.querySelector(".e-rte-color-content")||this.inlineQTBar.showPopup(e,t,i)},ctt.prototype.hideInlineQTBar=function(){this.inlineQTBar&&!A6e(this.inlineQTBar.element,"e-popup-close")&&this.inlineQTBar.hidePopup(),this.escapeKeyPressed=!1},ctt.prototype.hideQuickToolbars=function(){this.linkQTBar&&!A6e(this.linkQTBar.element,"e-popup-close")&&document.body.contains(this.linkQTBar.element)&&this.linkQTBar.hidePopup(),!this.escapeKeyPressed&&this.textQTBar&&!A6e(this.textQTBar.element,"e-popup-close")&&document.body.contains(this.textQTBar.element)&&this.textQTBar.hidePopup(),!this.escapeKeyPressed&&this.imageQTBar&&!A6e(this.imageQTBar.element,"e-popup-close")&&document.body.contains(this.imageQTBar.element)&&this.imageQTBar.hidePopup(),!this.escapeKeyPressed&&this.audioQTBar&&!A6e(this.audioQTBar.element,"e-popup-close")&&document.body.contains(this.audioQTBar.element)&&this.audioQTBar.hidePopup(),!this.escapeKeyPressed&&this.videoQTBar&&!A6e(this.videoQTBar.element,"e-popup-close")&&document.body.contains(this.videoQTBar.element)&&this.videoQTBar.hidePopup(),!this.escapeKeyPressed&&this.tableQTBar&&!A6e(this.tableQTBar.element,"e-popup-close")&&document.body.contains(this.tableQTBar.element)&&this.tableQTBar.hidePopup(),je(this.parent)||!this.parent.inlineMode.enable||F.isDevice&&!I6e()||this.hideInlineQTBar(),this.escapeKeyPressed=!1},ctt.prototype.deBounce=function(e,t,i){var n=this;clearTimeout(this.deBouncer),this.deBouncer=window.setTimeout(function(){n.showInlineQTBar(e,t,i)},this.debounceTimeout)},ctt.prototype.mouseUpHandler=function(e){if(this.parent.inlineMode.enable&&(!F.isDevice||I6e())){var t=e.args.touches?e.args.changedTouches[0]:e.args,i=this.parent.getRange(),n=e.args.target;if(je(ge("."+ZWe,document.body))){if(I6e()&&e.touchData&&e.touchData.prevClientX!==e.touchData.clientX&&e.touchData.prevClientY!==e.touchData.clientY)return;this.hideInlineQTBar();var o=this.parent.element.getBoundingClientRect().left;if(this.offsetX=this.parent.iframeSettings.enable?window.pageXOffset+o+t.clientX:t.pageX,this.offsetY=E6e(t,this.parent.element,this.parent.iframeSettings.enable),"TEXTAREA"===n.nodeName)this.showInlineQTBar(this.offsetX,this.offsetY,n);else{var r=z(n,"a"),r=(n=r||n,this.parent.getRange().startContainer.parentElement),s=this.parent.getRange().endContainer.parentElement;if((je(z(r,"A"))||je(z(s,"A")))&&(!z(n,"td,th")||!i.collapsed)&&("IMG"!==n.tagName||this.parent.getRange().startOffset!==this.parent.getRange().endOffset)){r=i.startOffset===i.endOffset&&i.startContainer===i.endContainer;if(this.parent.inlineMode.onSelection&&r||!this.parent.inlineMode.onSelection&&!r)return;this.target=n,this.showInlineQTBar(this.offsetX,this.offsetY,n)}}}}je(this.textQTBar)||je(this.parent.quickToolbarSettings.text)||this.parent.inlineMode.enable||(je(e)||je(e.name)||"sourceCodeMouseDown"!==e.name)&&(t=e.args.touches?e.args.changedTouches[0]:e.args,n=e.args.target,this.hideQuickToolbars(),o=this.parent.element.getBoundingClientRect().left,this.offsetX=this.parent.iframeSettings.enable?this.parent.element.ownerDocument.documentElement.scrollLeft+o+t.clientX:t.pageX,this.offsetY=E6e(t,this.parent.element,this.parent.iframeSettings.enable),(i=this.parent.getRange()).endContainer.parentElement.tagName===i.startContainer.parentElement.tagName&&"A"===i.startContainer.parentElement.tagName&&"A"===i.endContainer.parentElement.tagName||"IMG"===n.tagName||"VIDEO"===n.tagName||this.isEmbedVidElem(n)||"AUDIO"===n.tagName||n.childNodes[0]&&1===n.childNodes[0].nodeType&&n.childNodes[0].classList.contains("e-rte-audio")||this.parent.getRange().startOffset===this.parent.getRange().endOffset||(this.target=n,this.textQTBar.showPopup(this.offsetX,this.offsetY,n,"text")))},ctt.prototype.isEmbedVidElem=function(e){return!!(e&&3!==e.nodeType&&"BR"!==e.nodeName&&e.classList&&e.classList.contains(v8e)||e&&"IFRAME"===e.nodeName)},ctt.prototype.keyDownHandler=function(e){var t=e.args.altKey;this.parent.inlineMode.enable&&e.args.metaKey&&65===e.args.keyCode?this.showInlineQTBar(this.offsetX,this.offsetY,e.args.target):t||(!this.parent.inlineMode.enable||F.isDevice&&!I6e()||je(ge("."+ZWe,document))||this.hideInlineQTBar(),this.textQTBar&&!A6e(this.textQTBar.element,"e-popup-close")&&this.textQTBar.hidePopup())},ctt.prototype.inlineQTBarMouseDownHandler=function(){!this.parent.inlineMode.enable||F.isDevice&&!I6e()||je(ge("."+ZWe,document))||this.hideInlineQTBar(),je(this.parent.quickToolbarSettings.text)||this.textQTBar&&!A6e(this.textQTBar.element,"e-popup-close")&&document.body.contains(this.textQTBar.element)&&this.textQTBar.hidePopup()},ctt.prototype.keyUpHandler=function(e){e=e.args;if(this.parent.inlineMode.enable&&!F.isDevice){if(this.parent.inlineMode.onSelection)return void(0<this.parent.getSelection().length&&(e.ctrlKey&&65===e.keyCode||e.shiftKey&&(33===e.keyCode||34===e.keyCode||35===e.keyCode||36===e.keyCode||37===e.keyCode||38===e.keyCode||39===e.keyCode||40===e.keyCode))&&this.showInlineQTBar(this.offsetX,this.offsetY,e.target));this.deBounce(this.offsetX,this.offsetY,e.target)}this.parent.quickToolbarSettings.text&&!F.isDevice&&(e.ctrlKey&&65===e.keyCode||e.shiftKey&&(33===e.keyCode||34===e.keyCode||35===e.keyCode||36===e.keyCode||37===e.keyCode||38===e.keyCode||39===e.keyCode||40===e.keyCode))&&this.textQTBar.showPopup(this.offsetX,this.offsetY,e.target,"text")},ctt.prototype.selectionChangeHandler=function(e){var t=this;clearTimeout(this.deBouncer),this.deBouncer=window.setTimeout(function(){t.onSelectionChange(e)},this.debounceTimeout)},ctt.prototype.onSelectionChange=function(e){je(ge("."+ZWe,document.body))&&!this.contentRenderer.getDocument().getSelection().isCollapsed&&this.mouseUpHandler({args:e})},ctt.prototype.getInlineBaseToolbar=function(){return this.inlineQTBar&&this.inlineQTBar.quickTBarObj},ctt.prototype.destroy=function(){this.isDestroyed||(this.linkQTBar&&!this.linkQTBar.isDestroyed&&(E.remove(this.linkQTBar.element,"mousedown",this.onMouseDown),E.remove(this.linkQTBar.element,"keyup",this.keyUpQT),this.linkQTBar.destroy()),this.textQTBar&&!this.textQTBar.isDestroyed&&(E.remove(this.textQTBar.element,"mousedown",this.onMouseDown),E.remove(this.textQTBar.element,"keyup",this.keyUpQT),this.textQTBar.destroy()),this.imageQTBar&&!this.imageQTBar.isDestroyed&&(E.remove(this.imageQTBar.element,"mousedown",this.onMouseDown),E.remove(this.imageQTBar.element,"keyup",this.keyUpQT),this.imageQTBar.destroy()),this.audioQTBar&&!this.audioQTBar.isDestroyed&&(E.remove(this.audioQTBar.element,"mousedown",this.onMouseDown),E.remove(this.audioQTBar.element,"keyup",this.keyUpQT),this.audioQTBar.destroy()),this.videoQTBar&&!this.videoQTBar.isDestroyed&&(E.remove(this.videoQTBar.element,"mousedown",this.onMouseDown),E.remove(this.videoQTBar.element,"keyup",this.keyUpQT),this.videoQTBar.destroy()),this.tableQTBar&&!this.tableQTBar.isDestroyed&&(E.remove(this.tableQTBar.element,"mousedown",this.onMouseDown),E.remove(this.tableQTBar.element,"keyup",this.keyUpQT),this.tableQTBar.destroy()),this.inlineQTBar&&!this.inlineQTBar.isDestroyed&&(E.remove(this.inlineQTBar.element,"mousedown",this.onMouseDown),E.remove(this.inlineQTBar.element,"keyup",this.keyUpQT),I6e()&&E.remove(document,"selectionchange",this.selectionChangeHandler),this.inlineQTBar.destroy()),this.removeEventListener(),this.isDestroyed=!0)},ctt.prototype.wireInlineQTBarEvents=function(){this.parent.on(f4e,this.mouseUpHandler,this),this.parent.on(o5e,this.inlineQTBarMouseDownHandler,this),this.parent.on(u4e,this.keyDownHandler,this),this.parent.on(c4e,this.keyUpHandler,this),this.parent.on(r5e,this.mouseUpHandler,this),this.parent.on(g5e,this.renderInlineQuickToolbar,this)},ctt.prototype.unWireInlineQTBarEvents=function(){this.parent.off(f4e,this.mouseUpHandler),this.parent.off(o5e,this.inlineQTBarMouseDownHandler),this.parent.off(u4e,this.keyDownHandler),this.parent.off(c4e,this.keyUpHandler),this.parent.off(r5e,this.mouseUpHandler),this.parent.off(g5e,this.renderInlineQuickToolbar)},ctt.prototype.toolbarUpdated=function(e){this.linkQTBar&&!A6e(this.linkQTBar.element,"e-popup-close")&&this.linkQTBar.hidePopup(),this.escapeKeyPressed||!this.imageQTBar||A6e(this.imageQTBar.element,"e-popup-close")||this.imageQTBar.hidePopup(),this.escapeKeyPressed||!this.audioQTBar||A6e(this.audioQTBar.element,"e-popup-close")||this.audioQTBar.hidePopup(),this.escapeKeyPressed||!this.videoQTBar||A6e(this.videoQTBar.element,"e-popup-close")||this.videoQTBar.hidePopup(),this.escapeKeyPressed||!this.tableQTBar||A6e(this.tableQTBar.element,"e-popup-close")||this.tableQTBar.hidePopup(),this.escapeKeyPressed=!1},ctt.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on($3e,this.initializeQuickToolbars,this),this.parent.on(o5e,this.renderQuickToolbars,this),this.parent.on(s4e,this.toolbarUpdated,this),this.parent.on(U5e,this.renderQuickToolbars,this),this.wireInlineQTBarEvents(),this.parent.on(d4e,this.onPropertyChanged,this),"hide"===this.parent.quickToolbarSettings.actionOnScroll&&(this.parent.on(a5e,this.hideQuickToolbars,this),this.parent.on(l5e,this.hideQuickToolbars,this)),this.parent.on(d5e,this.hideQuickToolbars,this),this.parent.on(e4e,this.onIframeMouseDown,this),this.parent.on(t4e,this.destroy,this),this.parent.on(u4e,this.onKeyDown,this),this.parent.on(f5e,this.setRtl,this),this.parent.on(uWe,this.setCssClass,this),this.parent.on(vWe,this.hideQuickToolbars,this),this.parent.on(q5e,this.renderQuickToolbars,this),this.parent.on(PWe,this.preventQuickToolbarClose,this))},ctt.prototype.preventQuickToolbarClose=function(e){var t=this.parent.getID(),t=[t+"_quick_Display-popup",t+"_quick_Align-popup",t+"_quick_VideoLayoutOption-popup",t+"_quick_VideoAlign-popup",t+"_quick_TableRows-popup",t+"_quick_TableColumns-popup",t+"_quick_TableCell-popup",t+"_quick_TableCellVerticalAlign-popup",t+"_quick_Styles-popup",t+"_quick_Alignments-popup",t+"_quick_BackgroundColor-popup",t+"_quick_AudioLayoutOption-popup",t+"_quick_FontSize-popup",t+"_quick_FontName-popup",t+"_quick_FontColor-popup",t+"_quick_BackgroundColor-popup",t+"_quick_Formats-popup",t+"_quick_Alignments-popup",t+"_quick_NumberFormatList-popup",t+"_quick_BulletFormatList-popup"];!je(e.element)&&!je(e.element.parentElement)&&-1<t.indexOf(e.element.parentElement.id)&&(this.escapeKeyPressed=!0)},ctt.prototype.onKeyDown=function(e){e=e.args;8!==e.which&&46!==e.which||(this.imageQTBar&&!A6e(this.imageQTBar.element,"e-popup-close")&&this.imageQTBar.hidePopup(),this.audioQTBar&&!A6e(this.audioQTBar.element,"e-popup-close")&&this.audioQTBar.hidePopup(),this.videoQTBar&&!A6e(this.videoQTBar.element,"e-popup-close")&&this.videoQTBar.hidePopup(),this.tableQTBar&&!A6e(this.tableQTBar.element,"e-popup-close")&&this.tableQTBar.hidePopup(),this.linkQTBar&&!A6e(this.linkQTBar.element,"e-popup-close")&&this.linkQTBar.hidePopup(),this.textQTBar&&!A6e(this.textQTBar.element,"e-popup-close")&&this.textQTBar.hidePopup())},ctt.prototype.onIframeMouseDown=function(){this.hideQuickToolbars(),this.hideInlineQTBar()},ctt.prototype.updateCss=function(e,t){e&&t.cssClass&&(je(t.oldCssClass&&e.quickTBarObj.toolbarObj.cssClass!==t.cssClass)?e.quickTBarObj.toolbarObj.setProperties({cssClass:(e.quickTBarObj.toolbarObj.cssClass+" "+t.cssClass).trim()}):e.quickTBarObj.toolbarObj.setProperties({cssClass:(e.quickTBarObj.toolbarObj.cssClass.replace(t.oldCssClass,"").trim()+" "+t.cssClass).trim()}))},ctt.prototype.setCssClass=function(e){for(var t=[this.inlineQTBar,this.imageQTBar,this.linkQTBar,this.textQTBar,this.tableQTBar],i=0;i<t.length;i++)this.updateCss(t[i],e)},ctt.prototype.setRtl=function(e){this.inlineQTBar&&this.inlineQTBar.quickTBarObj.toolbarObj.setProperties({enableRtl:e.enableRtl}),this.imageQTBar&&this.imageQTBar.quickTBarObj.toolbarObj.setProperties({enableRtl:e.enableRtl}),this.audioQTBar&&this.audioQTBar.quickTBarObj.toolbarObj.setProperties({enableRtl:e.enableRtl}),this.videoQTBar&&this.videoQTBar.quickTBarObj.toolbarObj.setProperties({enableRtl:e.enableRtl}),this.linkQTBar&&this.linkQTBar.quickTBarObj.toolbarObj.setProperties({enableRtl:e.enableRtl}),this.textQTBar&&this.textQTBar.quickTBarObj.toolbarObj.setProperties({enableRtl:e.enableRtl})},ctt.prototype.removeEventListener=function(){this.deBouncer&&(clearTimeout(this.deBouncer),this.deBouncer=null),this.parent.off($3e,this.initializeQuickToolbars),this.parent.off(o5e,this.renderQuickToolbars),this.parent.off(s4e,this.toolbarUpdated),this.parent.off(U5e,this.renderQuickToolbars),this.unWireInlineQTBarEvents(),this.parent.off(d4e,this.onPropertyChanged),"hide"===this.parent.quickToolbarSettings.actionOnScroll&&(this.parent.off(a5e,this.hideQuickToolbars),this.parent.off(l5e,this.hideQuickToolbars)),this.parent.off(d5e,this.hideQuickToolbars),this.parent.off(t4e,this.destroy),this.parent.off(e4e,this.onIframeMouseDown),this.parent.off(u4e,this.onKeyDown),this.parent.off(f5e,this.setRtl),this.parent.off(uWe,this.setCssClass),this.parent.off(vWe,this.hideQuickToolbars),this.parent.off(q5e,this.renderQuickToolbars),this.parent.off(PWe,this.preventQuickToolbarClose)},ctt.prototype.onPropertyChanged=function(e){if(!je(e.newProp.quickToolbarSettings))for(var t=0,i=Object.keys(e.newProp.quickToolbarSettings);t<i.length;t++)"actionOnScroll"===i[t]&&("none"===e.newProp.quickToolbarSettings.actionOnScroll?(this.parent.off(a5e,this.hideQuickToolbars),this.parent.off(l5e,this.hideQuickToolbars)):(this.parent.on(a5e,this.hideQuickToolbars,this),this.parent.on(l5e,this.hideQuickToolbars,this)));e.module!==this.getModuleName()||(this.inlineQTBar&&(q([this.parent.element],[zWe]),this.unWireInlineQTBarEvents(),this.hideInlineQTBar()),!this.parent.inlineMode.enable)||F.isDevice&&!I6e()||(U([this.parent.element],[zWe]),this.wireInlineQTBarEvents())},ctt.prototype.getModuleName=function(){return"quickToolbar"},ctt.prototype.getQuickToolbarInstance=function(){return[this.linkQTBar,this.imageQTBar,this.audioQTBar,this.videoQTBar,this.tableQTBar,this.textQTBar,this.inlineQTBar]};var ptt=ctt;function ctt(e,t){this.debounceTimeout=1e3,this.escapeKeyPressed=!1,this.parent=e,this.locator=t,this.renderFactory=this.locator.getService("rendererFactory"),this.renderFactory.addRenderer(q3e.Popup,new wqe(this.parent)),this.addEventListener(),this.isDestroyed=!1}gtt.prototype.initializeInstance=function(){this.contentRenderer=this.renderFactory.getRenderer(q3e.Content),this.editPanel=this.contentRenderer.getEditPanel(),this.addEventListener()},gtt.prototype.renderCount=function(){this.initializeInstance(),this.element=this.parent.createElement("span",{className:D8e}),this.parent.rootContainer.appendChild(this.element),this.parent.rootContainer.classList.add("e-count-enabled"),this.parent.iframeSettings.enable&&this.parent.inputElement.classList.add("e-count-enabled"),this.appendCount(),-1!==this.parent.maxLength&&this.charCountBackground(this.htmlLength)},gtt.prototype.appendCount=function(){var e="Markdown"===this.parent.editorMode?this.editPanel.value:this.parent.getText().replace(/(\r\n|\n|\r|\t)/gm,""),e=("Markdown"!==this.parent.editorMode&&-1!==e.indexOf("​")?this.htmlLength=e.replace(/\u200B/g,"").length:this.htmlLength=e.length,-1===this.parent.maxLength?this.htmlLength:this.htmlLength+" / "+this.parent.maxLength);this.element.innerHTML=e},gtt.prototype.charCountBackground=function(e){e=e/this.parent.maxLength*100;e<85?(this.element.classList.remove(M8e),this.element.classList.remove(k8e)):85<e&&e<=90?(this.element.classList.remove(k8e),this.element.classList.add(M8e)):90<e&&(this.element.classList.remove(M8e),this.element.classList.add(k8e))},gtt.prototype.refresh=function(){je(this.editPanel)||(this.appendCount(),-1!==this.parent.maxLength&&this.charCountBackground(this.htmlLength))},gtt.prototype.destroy=function(){this.isDestroyed||(this.parent&&this.parent.rootContainer&&this.parent.rootContainer.classList.contains("e-count-enabled")&&this.parent.rootContainer.classList.remove("e-count-enabled"),this.parent.iframeSettings.enable&&!je(this.parent.inputElement)&&this.parent.inputElement.classList.remove("e-count-enabled"),this.element&&!je(this.parent.element.querySelector("."+D8e))&&G(this.element),this.removeEventListener(),this.editPanel&&(this.editPanel=null),this.element&&(G(this.element),this.element=null),this.isDestroyed=!0)},gtt.prototype.toggle=function(e){this.element.style.display="viewSource"===e.member?"none":"block"},gtt.prototype.addEventListener=function(){this.parent.on($3e,this.renderCount,this),this.parent.on(c4e,this.refresh,this),this.parent.on(n5e,this.refresh,this),this.parent.on(r4e,this.refresh,this),this.parent.on(o5e,this.refresh,this),this.parent.on(t4e,this.destroy,this),this.parent.on(Z4e,this.toggle,this),this.parent.on($4e,this.toggle,this)},gtt.prototype.removeEventListener=function(){this.parent.off($3e,this.renderCount),this.parent.off(c4e,this.refresh),this.parent.off(r4e,this.refresh),this.parent.off(n5e,this.refresh),this.parent.off(o5e,this.refresh),this.parent.off(t4e,this.destroy),this.parent.off(Z4e,this.toggle),this.parent.off($4e,this.toggle)},gtt.prototype.getModuleName=function(){return"count"};var utt=gtt;function gtt(e,t){this.parent=e,this.locator=t,this.renderFactory=this.locator.getService("rendererFactory"),this.addEventListener(),this.isDestroyed=!1}ftt.prototype.getLineNumber=function(e,t){return e.value.substr(0,t).split("\n").length},ftt.prototype.getSelectedText=function(e){var t=e.selectionStart,i=e.selectionEnd;return e.value.substring(t,i)},ftt.prototype.getAllParents=function(e){return e.split("\n")},ftt.prototype.getSelectedLine=function(e){return this.getAllParents(e.value)[this.getLineNumber(e,e.selectionStart)-1]},ftt.prototype.getLine=function(e,t){return this.getAllParents(e.value)[t]},ftt.prototype.getSelectedParentPoints=function(e){var t=this.getAllParents(e.value),i=this.getLineNumber(e,e.selectionStart),n=this.getLineNumber(e,e.selectionEnd),o=this.getSelectedText(e).split("\n"),r=[],e=t[i-1],s=t.slice(0,i-1).join("").length,a={};if(a.line=i-1,a.start=s+a.line,a.end=""!==e?a.start+e.length+1:a.start+e.length,a.text=e,r.push(a),1<o.length){for(var l=1;l<o.length-1;l++){var h={};h.line=r[l-1].line+1,h.start=(o[l],r[l-1].end),h.end=h.start+o[l].length+1,h.text=o[l],r.push(h)}i={};i.line=r[r.length-1].line+1,i.start=r[r.length-1].end,i.end=i.start+t[n-1].length+1,i.text=t[n-1],r.push(i)}return r},ftt.prototype.setSelection=function(e,t,i){e.setSelectionRange(t,i),e.focus()},ftt.prototype.save=function(e,t){this.selectionStart=e,this.selectionEnd=t},ftt.prototype.restore=function(e){this.setSelection(e,this.selectionStart,this.selectionEnd)},ftt.prototype.isStartWith=function(e,t){var i=!1,n=RegExp;return i=e?(e.trim()===t.trim()?new n("^("+this.replaceSpecialChar(t.trim())+")","gim"):new n("^("+this.replaceSpecialChar(t)+")","gim")).test(e.trim()):i},ftt.prototype.replaceSpecialChar=function(e){return e.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/g,"\\$&")},ftt.prototype.isClear=function(e,t){for(var i=RegExp,n=0;n<e.length;n++)if(new i(t,"gim").test(e[n].text))return!0;return!1},ftt.prototype.getSelectedInlinePoints=function(e){return{start:e.selectionStart,end:e.selectionEnd,text:this.getSelectedText(e)}};var mtt=ftt;function ftt(){}vtt.prototype.addEventListener=function(){this.parent.on(n4e,this.onRefreshHandler,this),this.parent.on(t4e,this.removeEventListener,this)},vtt.prototype.removeEventListener=function(){this.parent.off(n4e,this.onRefreshHandler),this.parent.off(t4e,this.removeEventListener)},vtt.prototype.onRefreshHandler=function(e){var t=this.selection.getSelectedParentPoints(this.element),t=(this.toolbarStatus={orderedlist:!e.documentNode&&this.isListsApplied(t,"OL"),unorderedlist:!e.documentNode&&this.isListsApplied(t,"UL"),formats:this.currentFormat(t,e.documentNode),bold:!e.documentNode&&this.parent.formatter.editorManager.mdSelectionFormats.isAppliedCommand("Bold"),italic:!e.documentNode&&this.parent.formatter.editorManager.mdSelectionFormats.isAppliedCommand("Italic"),inlinecode:!e.documentNode&&this.parent.formatter.editorManager.mdSelectionFormats.isAppliedCommand("InlineCode"),strikethrough:!e.documentNode&&this.parent.formatter.editorManager.mdSelectionFormats.isAppliedCommand("StrikeThrough"),subscript:!e.documentNode&&this.parent.formatter.editorManager.mdSelectionFormats.isAppliedCommand("SubScript"),superscript:!e.documentNode&&this.parent.formatter.editorManager.mdSelectionFormats.isAppliedCommand("SuperScript"),uppercase:!e.documentNode&&this.parent.formatter.editorManager.mdSelectionFormats.isAppliedCommand("UpperCase")},this.parent.formatter.editorManager.mdSelectionFormats.isAppliedCommand("InlineCode")&&(this.toolbarStatus.formats="pre"),JSON.stringify(this.toolbarStatus));this.parent.notify(s4e,this.toolbarStatus),JSON.stringify(this.prevToolbarStatus)!==t&&(this.parent.notify(iWe,{html:null,markdown:JSON.parse(t)}),this.prevToolbarStatus=JSON.parse(t))},vtt.prototype.isListsApplied=function(e,t){var i=!0;if("OL"===t)for(var n=0;n<e.length;n++){var o=e[n].text.trim().split(" ",2)[0]+" ";if(!/^[\d.]+[ ]+$/.test(o)){i=!1;break}}else for(n=0;n<e.length;n++)if(!this.selection.isStartWith(e[n].text,this.parent.formatter.listTags[""+t])){i=!1;break}return i},vtt.prototype.currentFormat=function(e,t){for(var i="p",n=Object.keys(this.parent.formatter.formatTags),o=("backward"===this.element.selectionDirection?e[0]:e[e.length-1]).text,r=0;!t&&r<n.length;r++){if("pre"!==n[r]&&this.selection.isStartWith(o,this.parent.formatter.formatTags[n[r]])){i=n[r];break}if("pre"===n[r]&&this.codeFormat()){i=n[r];break}}return i},vtt.prototype.codeFormat=function(){var t,e=!1,i=this.parent.inputElement,n=i.selectionStart,n=(t=n,function(e){return[e.slice(0,t),e.slice(t)]}(i.value)),o=this.parent.formatter.formatTags.pre,r=this.getSelectedText(i);if(""!==r&&r===r.toLocaleUpperCase())return!0;if(""===r){r=i.value.substr(n[0].length-1,1),i=n[1].substr(0,1);if(""!==r&&""!==i&&r.match(/[a-z]/i)&&r===r.toLocaleUpperCase()&&i===i.toLocaleUpperCase())return!0}return e=this.isCode(n[0],o)&&this.isCode(n[1],o)&&n[0].match(this.multiCharRegx(o)).length%2==1&&n[1].match(this.multiCharRegx(o)).length%2==1?!0:e},vtt.prototype.getSelectedText=function(e){return e.value.substring(e.selectionStart,e.selectionEnd)},vtt.prototype.isCode=function(e,t){return-1!==e.search("\\"+t)},vtt.prototype.multiCharRegx=function(e){return new RegExp("(\\"+e+")","g")};var ytt=vtt;function vtt(e){this.toolbarStatus=this.prevToolbarStatus={bold:!1,italic:!1,subscript:!1,superscript:!1,strikethrough:!1,orderedlist:!1,uppercase:!1,lowercase:!1,inlinecode:!1,unorderedlist:!1,formats:null},this.selection=new mtt,this.parent=e,this.element=this.parent.contentModule.getEditPanel(),this.addEventListener()}btt.prototype.process=function(n,o,r,s){var a,t,l=this,e=n.contentModule.getDocument().getSelection(),e=0<e.rangeCount?e.getRangeAt(e.rangeCount-1):null,h=(je(s)||je(s.selection)||(i=s.selection.range),!je(s)&&!je(s.cssClass)&&"e-video-inline"!==s.cssClass);if("HTML"!==n.editorMode||je(o)||h||(je(o.name)||!je(o.name)&&"showDialog"!==o.name)&&(a=i?this.editorManager.nodeSelection.save(i,n.contentModule.getDocument()):this.editorManager.nodeSelection.save(e,n.contentModule.getDocument())),je(o)||!o.item.command||"Table"===o.item.command||"Actions"===o.item.command||"Links"===o.item.command||"Images"===o.item.command||"Files"===o.item.command||"Audios"===o.item.command||"Videos"===o.item.command||"EmojiPicker"===o.item.command||!e||n.contentModule.getEditPanel().contains(this.getAncestorNode(e.commonAncestorContainer))||n.contentModule.getEditPanel()===e.commonAncestorContainer||n.contentModule.getPanel()===e.commonAncestorContainer){if(!je(o)&&-1!==n.maxLength&&!je(o.item.command)){var i=0,e=("Links"===o.item.command&&(i=(0===s.text.length?s.url:s.text).length),"Images"!==o.item.command&&"Videos"!==o.item.command&&"Table"!==o.item.command&&"Files"!==o.item.command||(i=1),n.getText().trim().replace(/(\r\n|\n|\r|\t)/gm,"").replace(/\u200B/g,"").length),d=n.getSelection().length;if(!(-1===n.maxLength||e-d+i<=n.maxLength))return}je(o)?(t=r.action,e={originalEvent:r,cancel:!(o={}),requestType:t||r.key+"Key",itemCollection:s},Pe(o,o,e,!0),"tab"!==t&&"enter"!==t&&"space"!==t&&"escape"!==t&&("Markdown"===n.editorMode&&"insert-table"===t&&(s={headingText:n.localeObj.getConstant("TableHeadingText"),colText:n.localeObj.getConstant("TableColText")}),n.trigger(O4e,o,function(e){!e.cancel||"paste"!==t&&"cut"!==t&&"copy"!==t||r.preventDefault()})),!o.cancel&&(d=!!je(n.tableModule)||!!n.tableModule&&n.tableModule.ensureInsideTableList,9===r.which&&d||9!==r.which)&&(13===r.which&&"HTML"===n.editorMode&&(s={enterAction:n.enterKey}),this.editorManager.observer.notify("keydown"===r.type?e7e:s7e,{event:r,callBack:this.onSuccess.bind(this,n),value:s,enterAction:n.enterKey,enableTabKey:n.enableTabKey}))):!je(o)&&o.item.command&&o.item.subCommand&&(o.item.command!==o.item.subCommand&&"Font"!==o.item.command&&"Export"!==o.item.command||("FontName"===o.item.subCommand||"FontSize"===o.item.subCommand)&&"dropDownSelect"===o.name||!("BackgroundColor"!==o.item.subCommand&&"FontColor"!==o.item.subCommand||"colorPickerChanged"!==o.name&&"tableColorPickerChanged"!==o.name)||"FormatPainter"===o.item.subCommand||"EmojiPicker"===o.item.subCommand)&&(Pe(o,o,{requestType:o.item.subCommand,cancel:!1,itemCollection:s,selectType:o.name},!0),n.trigger(O4e,o,function(e){var t,i;e.cancel||(t=!je(e.requestType)&&"FormatPainter"===e.requestType&&"format-copy"===e.name,i=!je(e.requestType)&&"FormatPainter"===e.requestType&&"format-paste"===e.name,(0===l.getUndoRedoStack().length&&"Links"!==e.item.command&&"Images"!==e.item.command&&!t||i)&&l.saveData(),n.isBlur=!1,t=!(je(r)||je(r.target)||je(z(r.target,".e-rte-elements.e-dropdown-popup.e-rte-dropdown-popup.e-quick-dropdown.e-popup-open"))&&je(z(r.target,".e-rte-elements.e-rte-quick-popup.e-popup-open"))),!je(a)&&(t||!je(z(a.range.startContainer.parentElement,".e-img-caption"))&&"false"===z(a.range.startContainer.parentElement,".e-img-caption").getAttribute("contenteditable")||-1!==F.userAgent.indexOf("Firefox"))||n.contentModule.getEditPanel().focus({preventScroll:!0}),"HTML"!==n.editorMode||h||(je(o.selectType)||!je(o.selectType)&&"showDialog"!==o.selectType)&&a.restore(),"image"!==(i=e.item.subCommand.toLocaleLowerCase())&&"file"!==i&&"replace"!==i||(s=e.itemCollection),"paste"===i||"cut"===i||"copy"===i?n.clipboardAction(i,r):(l.editorManager.observer.notify(w5e,{subCommand:e.item.subCommand}),l.editorManager.execCommand(e.item.command,e.item.subCommand,r,l.onSuccess.bind(l,n),e.item.value,"Pre"===e.item.subCommand&&"dropDownSelect"===e.selectType?{name:e.selectType}:s,"#"+n.getID()+" iframe",n.enterKey)))})),!(je(r)||r&&"copy"!==r.action)||r&&r.shiftKey&&"Tab"===r.key||this.enableUndo(n)}},btt.prototype.getAncestorNode=function(e){return e=3===e.nodeType?e.parentNode:e},btt.prototype.onKeyHandler=function(e,t){var i=this;this.editorManager.observer.notify(s7e,{event:t,callBack:function(){e.notify(Z3e,{}),i.enableUndo(e)},enterAction:e.enterKey})},btt.prototype.onSuccess=function(t,e){t.notify(Z3e,{}),e&&(je(e.event)||"copy"!==e.event.action)&&("Paste"===e.requestType?(t.notify(A4e,e),this.enableUndo(t)):(this.enableUndo(t),t.notify(A4e,e))),t.trigger(N4e,e,function(e){if(t.setPlaceHolder(),("Images"===e.requestType||"Replace"===e.requestType||"Links"===e.requestType||"Audios"===e.requestType||"Videos"===e.requestType)&&"HTML"===t.editorMode){if("Links"===e.requestType&&e.event&&"keydown"===e.event.type&&32===e.event.keyCode)return;t.notify(W4e,{args:e.event,type:e.requestType,isNotify:!0,elements:e.elements})}"VideosPlayPause"===e.requestType&&t.notify("editAreaClick",{args:event}),t.autoResize()})},btt.prototype.saveData=function(e){this.editorManager.undoRedoManager.saveData(e)},btt.prototype.getUndoStatus=function(){return this.editorManager.undoRedoManager.getUndoStatus()},btt.prototype.getUndoRedoStack=function(){return this.editorManager.undoRedoManager.undoRedoStack},btt.prototype.enableUndo=function(e){var t=this.getUndoStatus();!e.inlineMode.enable||F.isDevice&&!I6e()?e.toolbarModule&&e.toolbarModule.baseToolbar&&F6e(e.toolbarModule.baseToolbar,t):F6e(e.quickToolbarModule.inlineQTBar.quickTBarObj,t)},btt.prototype.beforeSlashMenuApply=function(){this.editorManager.beforeSlashMenuApplyFormat()},btt.prototype.getCurrentStackIndex=function(){return this.editorManager.undoRedoManager.getCurrentStackIndex()};Met=btt;function btt(){}var wtt="lists-commands",Ctt="command-type",Stt="link-commands",Att="clear-commands",xtt="insert-table",Itt="insert-text",Ttt=(Ett.prototype.addEventListener=function(){this.parent.observer.on(wtt,this.applyListsHandler,this),this.parent.observer.on(n7e,this.keyDownHandler,this),this.parent.observer.on(r7e,this.keyUpHandler,this),this.parent.observer.on(v7e,this.destroy,this)},Ett.prototype.removeEventListener=function(){this.parent.observer.off(wtt,this.applyListsHandler),this.parent.observer.off(n7e,this.keyDownHandler),this.parent.observer.off(r7e,this.keyUpHandler),this.parent.observer.off(v7e,this.destroy)},Ett.prototype.keyDownHandler=function(e){switch(9===e.event.which&&this.tabKey(e),e.event.action){case"ordered-list":this.applyListsHandler({subCommand:"OL",callBack:e.callBack}),e.event.preventDefault();break;case"unordered-list":this.applyListsHandler({subCommand:"UL",callBack:e.callBack}),e.event.preventDefault()}},Ett.prototype.keyUpHandler=function(e){13===e.event.which&&this.enterKey(e)},Ett.prototype.tabKey=function(e){var t=this.parent.element,i=(this.selection.save(t.selectionStart,t.selectionEnd),t.selectionStart),n=t.selectionEnd,o=this.selection.getSelectedParentPoints(t),r=0,s=this.isNotFirstLine(t,o[0]);if(s||e.event.shiftKey){var a=this.olListType(),l=this.getListRegex();this.currentAction=this.getAction(o[0].text);for(var h=0;h<o.length;h++){e.event.shiftKey;var d=o[h].line-1;if((y=this.selection.getLine(t,d))&&(!e.event.shiftKey&&s||e.event.shiftKey)){var p=y.split(". "),c=e.event.shiftKey?-"\t".length:"\t".length,u=o[h].text.split("\t");if(e.event.shiftKey&&1===u.length)break;if("OL"===this.currentAction&&/^\d+$/.test(p[0].trim())&&a){e.event.preventDefault(),o[h].text=e.event.shiftKey?u.splice(1,u.length).join("\t"):"\t"+o[h].text;var g=this.getTabSpace(o[h].text),m=this.getTabSpace(y),f=o[h].text.split(". ");if(g===m)this.changeTextAreaValue(f,this.nextOrderedListValue(p[0].trim()),e,t,o,h,n);else if(m<g)this.changeTextAreaValue(f,"1. ",e,t,o,h,n);else for(;m.length>g.length;){d-=1;var y,v=(y=this.selection.getLine(t,d)).trim().split(". ");if(/^\d+$/.test(v[0])&&(m=this.getTabSpace(y)).length<=g.length){this.changeTextAreaValue(f,this.nextOrderedListValue(v[0]),e,t,o,h,n);break}}}else("UL"===this.currentAction&&l.test(y.trim())||!a)&&(e.event.preventDefault(),o[h].text=e.event.shiftKey?u.splice(1,u.length).join("\t"):"\t"+o[h].text,t.value=t.value.substr(0,o[h].start)+o[h].text+"\n"+t.value.substr(o[h].end,t.value.length));if(i=0===h?i+c:i,r+=c,1!==o.length)for(var b=h;b<o.length;b++)o[b].start=0!==b?o[b].start+c:o[b].start,o[b].end=o[b].end+c}}}this.restore(t,i,n+r,e)},Ett.prototype.changeTextAreaValue=function(e,t,i,n,o,r,s){e.splice(0,1);for(var a,l=this.selection.getAllParents(n.value).length,h="",d=this.getTabSpace(o[r].text),p=parseInt(t.split(".")[0],null),c=this.getTabSpace(o[r].text),u=!0,g=!0,m=-1,f=!0,y=0,h=""!==this.selection.getLine(n,o[0].line+1)?"":h+n.value.substr(o[0].end,n.value.length),v=1;v<l&&!je(this.selection.getLine(n,o[0].line+v))&&""!==this.selection.getLine(n,o[0].line+v);v++){var b=this.selection.getLine(n,o[0].line+v),w=this.getTabSpace(b),C=b.split(". ");if(1===C.length){h+=n.value.substr(o[0].end+y,n.value.length);break}y+=b.length;var S,A=!1,x=i.event.shiftKey?d.length+1:d.length-1;w.length>c.length&&(f=!1),d.length!==w.length&&w.length<c.length?(u=!(g=!0),A=!(!i.event.shiftKey||d.length!==w.length||(g=!1))):f&&i.event.shiftKey&&d.length===w.length&&w.length===c.length&&(A=!(g=!1)),a=""===h?"":"\n",x===w.length&&g?(S=i.event.shiftKey?(m++,this.nextOrderedListValue(m.toString())):this.previousOrderedListValue(C[0]),C.splice(0,1),h=h+a+w+S+C.join(". ")):d.length===w.length&&u||A?(S=this.nextOrderedListValue(p.toString()),p++,C.splice(0,1),h=h+a+w+S+C.join(". ")):(h=h+a+b,g=!1),c=this.getTabSpace(b)}o[r].text=this.getTabSpace(o[r].text)+t+e.join(". ")+"\n",n.value=n.value.substr(0,o[r].start)+o[r].text+h},Ett.prototype.getTabSpace=function(e){for(var t=e.split("\t"),i="",n=0;n<t.length&&""===t[n];n++)i+="\t";return i},Ett.prototype.isNotFirstLine=function(e,t){var i,n=t.text,o=t.line-1,r=this.selection.getLine(e,o),s=this.getListRegex(),a=!1;if(r&&(this.currentAction=this.getAction(r),d=r.split(". "),i="OL"===this.currentAction?/^\d+$/.test(d[0].trim()):s.test(r.trim())),r&&i)for(var l=this.getTabSpace(n),h=this.getTabSpace(r),a=l===h||a;h.length>l.length;){o-=1;var d=(r=this.selection.getLine(e,o)).trim().split(". "),p="OL"===this.currentAction?/^\d+$/.test(d[0]):s.test(r.trim());if(p&&(h=this.getTabSpace(r)).length<=l.length){a=!0;break}}return a},Ett.prototype.getAction=function(e){var t=e.split(". ")[0],t=/^\d+$/.test(t.trim()),e=e.trim().split(new RegExp("^("+this.selection.replaceSpecialChar(this.syntax.UL).trim()+")"))[1];return t?"OL":e?"UL":"NOTLIST"},Ett.prototype.nextOrderedListValue=function(e){return(parseInt(e,null)+1).toString()+". "},Ett.prototype.previousOrderedListValue=function(e){return(parseInt(e,null)-1).toString()+". "},Ett.prototype.enterKey=function(e){var t=this.parent.element,i=(this.selection.save(t.selectionStart,t.selectionEnd),t.selectionStart),n=t.selectionEnd,o=this.selection.getSelectedParentPoints(t),r=this.selection.getLine(t,o[0].line-1),s=this.olListType(),a=this.getListRegex(),l=[],h=(je(r)||(l=r.split(". "),this.currentAction=this.getAction(r)),0);if("OL"===this.currentAction&&1<l.length&&/^\d+$/.test(l[0].trim())&&s&&""!==l[1]){for(var d=this.getTabSpace(r),p=(this.currentAction=this.getAction(r),this.nextOrderedListValue(l[0])),c=(o[0].text=d+p+o[0].text,this.selection.getAllParents(t.value).length),u="\n",g=this.getTabSpace(r),m=this.getTabSpace(o[0].text),f=!0,y=1;y<c&&""!==t.value.substr(o[0].end,t.value.length);y++){var v,b,w,C=this.selection.getLine(t,o[0].line+y);je(C)?u+="":(v=C.split(". "),(b=this.getTabSpace(C)).length<m.length&&(f=!1),1<v.length&&/^\d+$/.test(v[0].trim())&&g.length===b.length&&f?(w=this.nextOrderedListValue(v[0]),v.splice(0,1),u=u+b+w+v.join(". ")+"\n"):(u=u+C+"\n",m=this.getTabSpace(C)))}t.value=t.value.substr(0,o[0].start)+g+p+this.selection.getLine(t,o[0].line)+u,i=i+p.length+d.length,h+=p.length+d.length}else("UL"===this.currentAction&&r&&a.test(r.trim())&&""!==r.trim().replace(a,"")||"OL"===this.currentAction&&!s&&""!==l[1])&&(d=this.getTabSpace(r),p=this.syntax[this.currentAction],o[0].text=d+p+o[0].text+(0<o[0].text.trim().length?"\n":""),t.value=t.value.substr(0,o[0].start)+o[0].text+t.value.substr(o[0].end,t.value.length),i=i+p.length+d.length,h+=p.length+d.length);this.restore(t,i,n+h,e)},Ett.prototype.olListType=function(){var e=this.syntax.OL.split(".,");return(1===e.length?null:parseInt(e[2].trim(),null)-parseInt(e[0].trim(),null))?1:0},Ett.prototype.applyListsHandler=function(e){for(var t,i=this.parent.element,n=(this.selection.save(i.selectionStart,i.selectionEnd),this.currentAction=e.subCommand,i.selectionStart),o=i.selectionEnd,r=0,s=0,a=this.selection.getSelectedParentPoints(i),l="",h=this.olListType(),d={},p=0;p<a.length;p++)if(t=h?"OL"===this.currentAction?p+h+". ":this.syntax[this.currentAction]:"OL"===this.currentAction?this.syntax.OL:this.syntax[this.currentAction],this.selection.isStartWith(a[p].text,t))a[p].text=a[p].text.replace(t,""),i.value=i.value.substr(0,a[p].start+s)+a[p].text+"\n"+i.value.substr(a[p].end+s,i.value.length),s-=t.length,u=t.length,this.restore(i,n-u,o+s,null);else{if(""===a[p].text&&0===p&&(this.selection.save(n,o),1!==a.length))for(var c=p;c<a.length;c++)a[c].start=0!==c?1+a[c].start:a[c].start,a[c].end=1+a[c].end;var u=je(a[p-1])?0:this.getTabSpace(a[p-1].text).length,g=this.appliedLine(a[p].text,t,d,u),l=g.line?l:t;if(a[p].text=g.line||l+a[p].text,g.space=g.space||0,i.value=i.value.substr(0,a[p].start+s)+a[p].text+"\n"+i.value.substr(a[p].end,i.value.length),n=0===p?0<n+l.length+g.space?n+l.length+g.space:0:n,r+=l.length+g.space,1!==a.length)for(c=p;c<a.length;c++)a[c].start=0!==c?l.length+a[c].start+g.space:a[c].start,a[c].end=l.length+a[c].end+g.space;this.restore(i,n<=t.length?0:n,o+r,null)}this.restore(i,null,null,e)},Ett.prototype.appliedLine=function(e,t,i,n){var o={},r=new RegExp("^["+this.syntax.UL.trim()+"]"),s=e.split(". "),a=s[0]+". ",l=r.test(e.trim())||e.trim()===this.syntax.OL.trim()||e.trim()===this.syntax.UL.trim()||/^\d+$/.test(s[0].trim()),h=this.olListType(),d=this.getTabSpace(e).length;return"OL"===this.currentAction&&h&&(i[d.toString()]=je(i[d.toString()])?1:i[d.toString()].valueOf()+1,t=i[d.toString()].valueOf().toString()+". ",!je(n))&&d<n&&(i[n.toString()]=0),l&&(i=d=void 0,r.test(e.trim())?(i=this.syntax.UL,d=t,o.space=t.trim().length-this.syntax.UL.trim().length):/^\d+$/.test(s[0].trim())&&h?(i=s[0].trim()+". ",d=t,o.space=this.syntax.UL.trim().length-a.trim().length):/^\d+$/.test(s[0].trim())&&(i=s[0].trim()+". ",d=this.syntax.UL,o.space=this.syntax.UL.trim().length-a.trim().length),o.line=e.replace(i,d)),o},Ett.prototype.restore=function(e,t,i,n){je(t)||je(t)||this.selection.save(t,i),je(n)||this.selection.restore(e),n&&n.callBack&&n.callBack({requestType:this.currentAction,selectedText:this.selection.getSelectedText(e),editorMode:"Markdown",event:n.event})},Ett.prototype.getListRegex=function(){for(var e="",t=Object.keys(this.syntax),i=RegExp,n=0;n<t.length;n++){var o=this.selection.replaceSpecialChar(this.syntax[t[n]]);e+=""===e?"^("+o+")|^("+o.trim()+")":"|^("+o+")|^("+o.trim()+")"}return new i(e)},Ett.prototype.destroy=function(){this.removeEventListener()},Ett);function Ett(e){Pe(this,this,e,!0),this.selection=this.parent.markdownSelection,this.addEventListener()}Mtt.prototype.addEventListener=function(){this.parent.observer.on(i7e,this.applyFormats,this),this.parent.observer.on(v7e,this.destroy,this)},Mtt.prototype.removeEventListener=function(){this.parent.observer.off(i7e,this.applyFormats),this.parent.observer.off(v7e,this.destroy)},Mtt.prototype.applyFormats=function(e){e.subCommand=e.subCommand.toLowerCase();var t=this.parent.element,i=(this.selection.save(t.selectionStart,t.selectionEnd),this.selection.getSelectedParentPoints(t));if(this.isAppliedFormat(i)===e.subCommand){if("pre"===e.subCommand){if(!(1<i.length))return;this.applyCodeBlock(t,e,i)}this.cleanFormat(t),this.restore(t,t.selectionStart,t.selectionEnd,e)}else if("p"===e.subCommand)this.cleanFormat(t),this.restore(t,t.selectionStart,t.selectionEnd,e);else{("pre"===e.subCommand&&1!==i.length||"pre"!==e.subCommand)&&this.cleanFormat(t,e.subCommand);var n=t.selectionStart,o=t.selectionEnd,r=0,i=this.selection.getSelectedParentPoints(t);if("pre"===e.subCommand)1<i.length?this.applyCodeBlock(t,e,i):(Pe(e,e,{subCommand:"InlineCode"},!0),this.parent.observer.notify(Ctt,e));else{for(var s=0;s<i.length;s++)if(""===i[s].text||this.selection.isStartWith(i[s].text,"\\"+this.syntax[e.subCommand])){if(""===i[s].text&&0===s&&(this.selection.save(n,o),0===this.selection.getSelectedText(t).length&&(i[s].text=this.syntax[e.subCommand],t.value=t.value.substr(0,i[s].start)+this.syntax[e.subCommand]+t.value.substr(i[s].end,t.value.length),n=0===s?n+this.syntax[e.subCommand].length:n,r+=this.syntax[e.subCommand].length),1!==i.length))for(a=s;a<i.length;a++)i[a].start=0!==a?1+i[a].start:i[a].start,i[a].end=1+i[a].end}else if(i[s].text=this.syntax[e.subCommand]+i[s].text,t.value=t.value.substr(0,i[s].start)+i[s].text+"\n"+t.value.substr(i[s].end,t.value.length),n=0===s?n+this.syntax[e.subCommand].length:n,r+=this.syntax[e.subCommand].length,1!==i.length)for(var a=s;a<i.length;a++)i[a].start=0!==a?this.syntax[e.subCommand].length+i[a].start:i[a].start,i[a].end=this.syntax[e.subCommand].length+i[a].end;this.restore(t,n,o+r,e)}}},Mtt.prototype.clearRegex=function(){for(var e="",t=Object.keys(this.syntax),i=0;i<t.length&&"pre"!==t[i]&&"p"!==t[i];i++)e+=""===e?"^("+this.selection.replaceSpecialChar(this.syntax[t[i]].trim())+")":"|^("+this.selection.replaceSpecialChar(this.syntax[t[i]].trim())+")";return e},Mtt.prototype.cleanFormat=function(e,t){var i=this.selection.getSelectedParentPoints(e),n=e.selectionStart,o=e.selectionEnd,r=0;if(this.selection.isClear(i,this.clearRegex())){for(var s=0;s<i.length;s++){for(var a=Object.keys(this.syntax),l=0;""!==i[s].text&&l<a.length;l++){var h=this.syntax[a[l]];if(a[l]!==t){var d=new RegExp("^("+this.selection.replaceSpecialChar(h)+")","gim");if(d.test(i[s].text)){if(i[s].text=i[s].text.replace(d,""),e.value=e.value.substr(0,i[s].start)+i[s].text+"\n"+e.value.substr(i[s].end,e.value.length),n=0===s?0<n-h.length?n-h.length:0:n,r+=h.length,1!==i.length)for(var p=0;p<i.length;p++)i[p].start=0!==p?i[p].start-h.length:i[p].start,i[p].end=i[p].end-h.length;break}}}if(""===i[s].text&&0===s&&(this.selection.save(n,o),1!==i.length))for(l=s;l<i.length;l++)i[l].start=0!==l?1+i[l].start:i[l].start,i[l].end=1+i[l].end}this.restore(e,n,o-r)}},Mtt.prototype.applyCodeBlock=function(e,t,i){var n,o=t.subCommand,r=i[0].start,s=i[i.length-1].end,a=this.selection.getAllParents(e.value),l=a[i[0].line-1],a=a[i.length+1+1],s=this.selection.isStartWith(l,this.syntax.pre.split("\n")[0])||this.selection.isStartWith(a,this.syntax.pre.split("\n")[0])?(i=this.syntax[""+o],l=this.parent.markdownSelection.getSelectedInlinePoints(e),a=e.value.substr(0,e.selectionStart).lastIndexOf(i),n=e.value.substr(e.selectionEnd,e.selectionEnd).indexOf(i),n+=l.end,a=this.replaceAt(e.value.substr(0,l.start),i,"",a,l.start),n=this.replaceAt(e.value.substr(l.end,e.value.length),i,"",0,n),e.value=a+l.text+n,r=this.selection.selectionStart-i.length,this.selection.selectionEnd-i.length):(l=""===(a=e.value.substring(r,s).split("\n"))[a.length-1]?"":"\n",e.value=e.value.substr(0,r)+this.syntax[""+o]+e.value.substring(r,s)+l+this.syntax[""+o]+e.value.substr(s,e.value.length),r=this.selection.selectionStart+this.syntax[""+o].length,this.selection.selectionEnd+this.syntax[""+o].length-1);this.restore(e,r,s,t)},Mtt.prototype.replaceAt=function(e,t,i,n,o){return e.slice(0,n)+e.slice(n,o).replace(t,i)+e.slice(o)},Mtt.prototype.restore=function(e,t,i,n){this.selection.save(t,i),this.selection.restore(e),n&&n.callBack&&n.callBack({requestType:n.subCommand,selectedText:this.selection.getSelectedText(e),editorMode:"Markdown",event:n.event})},Mtt.prototype.isAppliedFormat=function(e,t){for(var i="p",n=(Object.keys(this.syntax),Object.keys(this.syntax)),o=("backward"===this.parent.element.selectionDirection?e[0]:e[e.length-1]).text,r=0;!t&&r<n.length;r++){if("pre"!==n[r]&&this.selection.isStartWith(o,this.syntax[n[r]])){i=n[r];break}if("pre"===n[r]){var s=this.selection.getAllParents(this.parent.element.value),a=s[e[0].line-1],s=s[e.length+1];if(this.selection.isStartWith(a,this.syntax[n[r]].split("\n")[0])&&this.selection.isStartWith(s,this.syntax[n[r]].split("\n")[0])){i=n[r];break}}}return i},Mtt.prototype.destroy=function(){this.removeEventListener()};var Dtt=Mtt;function Mtt(e){Pe(this,this,e,!0),this.selection=this.parent.markdownSelection,this.addEventListener()}Ptt.prototype.addEventListener=function(){this.parent.observer.on(Ctt,this.applyCommands,this),this.parent.observer.on(n7e,this.keyDownHandler,this),this.parent.observer.on(v7e,this.destroy,this)},Ptt.prototype.removeEventListener=function(){this.parent.observer.off(Ctt,this.applyCommands),this.parent.observer.off(n7e,this.keyDownHandler),this.parent.observer.off(v7e,this.destroy)},Ptt.prototype.keyDownHandler=function(e){switch(e.event.action){case"bold":this.applyCommands({subCommand:"Bold",callBack:e.callBack}),e.event.preventDefault();break;case"italic":this.applyCommands({subCommand:"Italic",callBack:e.callBack}),e.event.preventDefault();break;case"strikethrough":this.applyCommands({subCommand:"StrikeThrough",callBack:e.callBack}),e.event.preventDefault();break;case"uppercase":this.applyCommands({subCommand:"UpperCase",callBack:e.callBack}),e.event.preventDefault();break;case"lowercase":this.applyCommands({subCommand:"LowerCase",callBack:e.callBack}),e.event.preventDefault();break;case"superscript":this.applyCommands({subCommand:"SuperScript",callBack:e.callBack}),e.event.preventDefault();break;case"subscript":this.applyCommands({subCommand:"SubScript",callBack:e.callBack}),e.event.preventDefault()}},Ptt.prototype.isBold=function(e,t){return-1!==e.search("\\"+t+"\\"+t)},Ptt.prototype.isItalic=function(e,t){return-1!==e.search("\\"+t)},Ptt.prototype.isMatch=function(e,t){var i=[""];switch(t){case this.syntax.Italic:case this.syntax.InlineCode:case this.syntax.StrikeThrough:i=e.match(this.singleCharRegx(t))}return i},Ptt.prototype.multiCharRegx=function(e){return new RegExp("(\\"+e+"\\"+e+")","g")},Ptt.prototype.singleCharRegx=function(e){return new RegExp("(\\"+e+")","g")},Ptt.prototype.isAppliedCommand=function(e){var t,i=!1,n=this.parent.element,o=n.selectionStart,o=(t=o,function(e){return[e.slice(0,t),e.slice(t)]}(n.value)),r=this.syntax.Bold.substr(0,1),s=this.syntax.Italic,a=this.parent.markdownSelection.getSelectedText(n);if(""!==a&&a===a.toLocaleUpperCase()&&"UpperCase"===e)return!0;if(""===a){a=n.value.substr(o[0].length-1,1),n=o[1].substr(0,1);if(""!==a&&""!==n&&a.match(/[a-z]/i)&&a===a.toLocaleUpperCase()&&n===n.toLocaleUpperCase()&&"UpperCase"===e)return!0}return this.isBold(o[0],r)||this.isItalic(o[0],s)||this.isBold(o[1],r)||this.isItalic(o[1],s)||(je(this.isMatch(o[0],this.syntax.StrikeThrough))||je(this.isMatch(o[1],this.syntax.StrikeThrough))||this.isMatch(o[0],this.syntax.StrikeThrough).length%2!=1||this.isMatch(o[1],this.syntax.StrikeThrough).length%2!=1||"StrikeThrough"!==e||(i=!0),je(this.isMatch(o[0],this.syntax.InlineCode))||je(this.isMatch(o[1],this.syntax.InlineCode))||this.isMatch(o[0],this.syntax.InlineCode).length%2!=1||this.isMatch(o[1],this.syntax.InlineCode).length%2!=1||"InlineCode"!==e||(i=!0),je(o[0].match(/\<sub>/g))||je(o[1].match(/\<\/sub>/g))||o[0].match(/\<sub>/g).length%2!=1||o[1].match(/\<\/sub>/g).length%2!=1||"SubScript"!==e||(i=!0),je(o[0].match(/\<sup>/g)))||je(o[1].match(/\<\/sup>/g))||o[0].match(/\<sup>/g).length%2!=1||o[1].match(/\<\/sup>/g).length%2!=1||"SuperScript"!==e||(i=!0),this.isBold(o[0],r)&&this.isBold(o[1],r)&&o[0].match(this.multiCharRegx(r)).length%2==1&&o[1].match(this.multiCharRegx(r)).length%2==1&&"Bold"===e&&(i=!0),o[0]=this.isBold(o[0],r)?o[0].replace(this.multiCharRegx(r),"$%@"):o[0],o[1]=this.isBold(o[1],r)?o[1].replace(this.multiCharRegx(r),"$%@"):o[1],je(this.isMatch(o[0],this.syntax.Italic))||je(this.isMatch(o[1],this.syntax.Italic))||this.isMatch(o[0],this.syntax.Italic).length%2!=1||this.isMatch(o[1],this.syntax.Italic).length%2!=1||"Italic"!==e||(i=!0),je(this.isMatch(o[0],this.syntax.StrikeThrough))||je(this.isMatch(o[1],this.syntax.StrikeThrough))||this.isMatch(o[0],this.syntax.StrikeThrough).length%2!=1||this.isMatch(o[1],this.syntax.StrikeThrough).length%2!=1||"StrikeThrough"!==e||(i=!0),je(this.isMatch(o[0],this.syntax.InlineCode))||je(this.isMatch(o[1],this.syntax.InlineCode))||this.isMatch(o[0],this.syntax.InlineCode).length%2!=1||this.isMatch(o[1],this.syntax.InlineCode).length%2!=1||"InlineCode"!==e||(i=!0),je(o[0].match(/\<sub>/g))||je(o[1].match(/\<\/sub>/g))||o[0].match(/\<sub>/g).length%2!=1||o[1].match(/\<\/sub>/g).length%2!=1||"SubScript"!==e||(i=!0),i=je(o[0].match(/\<sup>/g))||je(o[1].match(/\<\/sup>/g))||o[0].match(/\<sup>/g).length%2!=1||o[1].match(/\<\/sup>/g).length%2!=1||"SuperScript"!==e?i:!0},Ptt.prototype.applyCommands=function(e){this.currentAction=e.subCommand;var t,i,n,o,r,s=this.parent.element,a=(this.selection.save(s.selectionStart,s.selectionEnd),s.selectionStart),l=s.selectionEnd,h=0,d=this.parent.markdownSelection.getSelectedInlinePoints(s);this.isAppliedCommand(e.subCommand)&&""!==d.text?(o=this.syntax[e.subCommand],n="SubScript"===e.subCommand?"</sub>":"SuperScript"===e.subCommand?"</sup>":this.syntax[e.subCommand],t="UpperCase"===e.subCommand||"LowerCase"===e.subCommand?0:o.length,r=s.value.substr(0,d.start).lastIndexOf(o),i=s.value.substr(d.end,s.value.length).indexOf(n),i+=d.end,o=this.replaceAt(s.value.substr(0,d.start),o,"",r,d.start),r=this.replaceAt(s.value.substr(d.end,s.value.length),n,"",0,i),s.value=o+d.text+r,this.restore(s,a-t,l-t,e)):(""===d.text||this.isApplied(d,e.subCommand)?"UpperCase"!==e.subCommand&&"LowerCase"!==e.subCommand?("SubScript"===e.subCommand||"SuperScript"===e.subCommand?(d.text=this.textReplace(d.text,e.subCommand),d.text=this.syntax[e.subCommand]+d.text+"</"+this.syntax[e.subCommand].substring(1,5)):(d.text=this.textReplace(d.text,e.subCommand),d.text=this.syntax[e.subCommand]+d.text+this.syntax[e.subCommand]),s.value=s.value.substr(0,d.start)+d.text+s.value.substr(d.end,s.value.length),h=this.syntax[e.subCommand].length,d.start===d.end?this.restore(s,a+h,l+h,e):this.restore(s,a+h,l-h,e)):this.restore(s,a,l,e):(h="UpperCase"===e.subCommand||"LowerCase"===e.subCommand?0:this.syntax[e.subCommand].length,n=void 0,(i=s.value.substr(d.start-this.syntax[e.subCommand].length,this.syntax[e.subCommand].length))===e.subCommand||d.start-this.syntax[e.subCommand].length===s.value.indexOf(this.syntax[e.subCommand])&&(d.end===s.value.lastIndexOf(this.syntax[e.subCommand])||d.end===s.value.lastIndexOf("</"+this.syntax[e.subCommand].substring(1,5)))?(n="SubScript"===e.subCommand||"SuperScript"===e.subCommand?s.value.substr(d.end,this.syntax[e.subCommand].length+1):s.value.substr(d.end,this.syntax[e.subCommand].length),o=this.replaceAt(s.value.substr(0,d.start),i,"",d.start-this.syntax[e.subCommand].length,d.start),r=this.replaceAt(s.value.substr(d.end,s.value.length),n,"",0,n.length),s.value=o+d.text+r,this.restore(s,a-h,l-h,e)):("SubScript"===e.subCommand||"SuperScript"===e.subCommand?d.text=this.syntax[e.subCommand]+d.text+"</"+this.syntax[e.subCommand].substring(1,5):"UpperCase"===e.subCommand||"LowerCase"===e.subCommand?d.text="UpperCase"===e.subCommand?d.text.toUpperCase():d.text.toLowerCase():d.text=this.syntax[e.subCommand]+d.text+this.syntax[e.subCommand],s.value=s.value.substr(0,d.start)+d.text+s.value.substr(d.end,s.value.length),this.restore(s,a+h,l+h,e))),this.parent.undoRedoManager.saveData())},Ptt.prototype.replaceAt=function(e,t,i,n,o){return e.slice(0,n)+e.slice(n,o).replace(t,i)+e.slice(o)},Ptt.prototype.restore=function(e,t,i,n){this.selection.save(t,i),this.selection.restore(e),n&&n.callBack&&n.callBack({requestType:this.currentAction,selectedText:this.selection.getSelectedText(e),editorMode:"Markdown",event:n.event})},Ptt.prototype.textReplace=function(e,t){var i,n,o=this.singleCharRegx(this.syntax[""+t]);switch(t){case"Bold":o=this.multiCharRegx(this.syntax[""+t].substr(0,1)),e=e.replace(o,"");break;case"Italic":e=this.isBold(e,this.syntax[""+t].substr(0,1))?(n=this.multiCharRegx(this.syntax[""+t].substr(0,1)),i=(i=e).replace(n,"$%@").replace(o,""),n=new RegExp("\\$%@","g"),i.replace(n,this.syntax[""+t].substr(0,1)+this.syntax[""+t].substr(0,1))):e.replace(o,"");break;case"StrikeThrough":case"InlineCode":e=e.replace(o,"");break;case"SubScript":e=e.replace(/<sub>/g,"").replace(/<\/sub>/g,"");break;case"SuperScript":e=e.replace(/<sup>/g,"").replace(/<\/sup>/g,"")}return e},Ptt.prototype.isApplied=function(e,t){var i=this.singleCharRegx(this.syntax[""+t]);switch(t){case"SubScript":case"SuperScript":return(i=this.singleCharRegx(this.syntax[""+t])).test(e.text);case"Bold":case"StrikeThrough":return(i=this.multiCharRegx(this.syntax[""+t].substr(0,1))).test(e.text);case"UpperCase":case"LowerCase":return(i=new RegExp("^["+this.syntax[""+t]+"]*$","g")).test(e.text);case"Italic":var n,o=this.multiCharRegx(this.syntax[""+t].substr(0,1));return o.test(e.text)?(n=(n=e.text).replace(o,"$%#"),i.test(n)):i.test(e.text);case"InlineCode":return i.test(e.text)}},Ptt.prototype.destroy=function(){this.removeEventListener()};var ktt=Ptt;function Ptt(e){Pe(this,this,e,!0),this.selection=this.parent.markdownSelection,this.addEventListener()}Ftt.prototype.addEventListener=function(){var e=P(this.keyUp,this.undoRedoTimer);this.parent.observer.on(r7e,e,this),this.parent.observer.on(n7e,this.keyDown,this),this.parent.observer.on(t7e,this.onAction,this),this.parent.observer.on(a7e,this.onPropertyChanged,this),this.parent.observer.on(v7e,this.destroy,this)},Ftt.prototype.onPropertyChanged=function(e){for(var t=0,i=Object.keys(e.newProp);t<i.length;t++)switch(i[t]){case"undoRedoSteps":this.undoRedoSteps=e.newProp.undoRedoSteps;break;case"undoRedoTimer":this.undoRedoTimer=e.newProp.undoRedoTimer}},Ftt.prototype.removeEventListener=function(){var e=P(this.keyUp,300);this.parent.observer.off(r7e,e),this.parent.observer.off(n7e,this.keyDown),this.parent.observer.off(t7e,this.onAction),this.parent.observer.off(a7e,this.onPropertyChanged),this.parent.observer.off(v7e,this.destroy)},Ftt.prototype.destroy=function(){this.removeEventListener()},Ftt.prototype.onAction=function(e){"Undo"===e.subCommand?this.undo(e):this.redo(e)},Ftt.prototype.keyDown=function(e){var t=e.event;switch(t.action){case"undo":t.preventDefault(),this.undo(e);break;case"redo":t.preventDefault(),this.redo(e)}},Ftt.prototype.keyUp=function(e){17===e.event.keyCode||e.event.ctrlKey||this.saveData(e)},Ftt.prototype.saveData=function(e){var t=this.parent.element,i=(this.selection.save(t.selectionStart,t.selectionEnd),t.selectionStart),t=t.selectionEnd,n={text:this.parent.element.value.replace(/</g,"&lt;").replace(/>/g,"&gt;"),start:i,end:t};this.undoRedoStack.length>=this.steps&&(this.undoRedoStack=this.undoRedoStack.slice(0,this.steps+1)),1<this.undoRedoStack.length&&this.undoRedoStack[this.undoRedoStack.length-1].start===i&&this.undoRedoStack[this.undoRedoStack.length-1].end===t||(this.undoRedoStack.push(n),this.steps=this.undoRedoStack.length-1,this.steps>this.undoRedoSteps&&(this.undoRedoStack.shift(),this.steps--),e&&e.callBack&&e.callBack())},Ftt.prototype.undo=function(e){var t,i,n;0<this.steps&&(this.currentAction="Undo",t=this.undoRedoStack[this.steps-1].start,i=this.undoRedoStack[this.steps-1].end,n=this.undoRedoStack[this.steps-1].text,this.parent.element.value=n.replace(/&lt;/g,"<").replace(/&gt;/g,">"),this.parent.element.focus(),this.steps--,this.restore(this.parent.element,t,i,e))},Ftt.prototype.redo=function(e){var t,i;null!=this.undoRedoStack[this.steps+1]&&(this.currentAction="Redo",t=this.undoRedoStack[this.steps+1].start,i=this.undoRedoStack[this.steps+1].end,this.parent.element.value=this.undoRedoStack[this.steps+1].text,this.parent.element.focus(),this.steps++,this.restore(this.parent.element,t,i,e))},Ftt.prototype.restore=function(e,t,i,n){this.selection.save(t,i),this.selection.restore(e),n&&n.callBack&&n.callBack({requestType:this.currentAction,selectedText:this.selection.getSelectedText(e),editorMode:"Markdown",event:n.event})},Ftt.prototype.getUndoStatus=function(){var e={undo:!1,redo:!1};return 0<this.steps&&(e.undo=!0),null!=this.undoRedoStack[this.steps+1]&&(e.redo=!0),e},Ftt.prototype.getCurrentStackIndex=function(){return this.steps};var Btt=Ftt;function Ftt(e,t){this.undoRedoStack=[],this.parent=e,this.undoRedoSteps=je(t)?30:t.undoRedoSteps,this.undoRedoTimer=je(t)?300:t.undoRedoTimer,this.selection=this.parent.markdownSelection,this.addEventListener()}Rtt.prototype.addEventListener=function(){this.parent.observer.on(Stt,this.createLink,this),this.parent.observer.on(v7e,this.destroy,this)},Rtt.prototype.removeEventListener=function(){this.parent.observer.off(Stt,this.createLink),this.parent.observer.off(v7e,this.destroy)},Rtt.prototype.createLink=function(e){var t=this.parent.element,i=(t.focus(),t.selectionStart),n=t.selectionEnd,o="Image"===e.subCommand?this.selection.getSelectedText(t):e.item.text,r="Image"===e.subCommand?i+2:i+1,s="Image"===e.subCommand?n+2:n+1,o="Image"===e.subCommand?"!["+o+"]("+e.item.url+")":"["+o+"]("+e.item.url+")";t.value=t.value.substr(0,i)+o+t.value.substr(n,t.value.length),this.parent.markdownSelection.setSelection(t,r,s),this.restore(t,r,s,e)},Rtt.prototype.restore=function(e,t,i,n){this.selection.save(t,i),this.selection.restore(e),n&&n.callBack&&n.callBack({requestType:n.subCommand,selectedText:this.selection.getSelectedText(e),editorMode:"Markdown",event:n.event})},Rtt.prototype.destroy=function(){this.removeEventListener()};var Ltt=Rtt;function Rtt(e){this.parent=e,this.selection=this.parent.markdownSelection,this.addEventListener()}Ntt.prototype.addEventListener=function(){this.parent.observer.on(xtt,this.createTable,this),this.parent.observer.on(n7e,this.onKeyDown,this),this.parent.observer.on(v7e,this.destroy,this)},Ntt.prototype.removeEventListener=function(){this.parent.observer.off(xtt,this.createTable),this.parent.observer.off(n7e,this.onKeyDown),this.parent.observer.off(v7e,this.destroy)},Ntt.prototype.destroy=function(){this.removeEventListener()},Ntt.prototype.onKeyDown=function(e){"insert-table"===e.event.action&&(e.item=e.value,this.createTable(e))},Ntt.prototype.createTable=function(e){this.element=this.parent.element;var t=this.element.selectionStart,i=this.element.selectionEnd,n=this.element.value;this.locale=e,this.selection.save(t,i),this.restore(this.element.selectionStart,this.element.selectionEnd,null),this.insertTable(t,i,n,e)},Ntt.prototype.getTable=function(){var e="";return(e+=this.textNonEmpty())+this.tableHeader(this.locale)+this.tableCell(this.locale)},Ntt.prototype.tableHeader=function(e){for(var t="",i=1;i<=2;i++){t+="|";for(var n=1;n<=2;n++)t+=1===i?e.item.headingText+" "+n+"|":"---------|";t+=this.insertLine()}return t},Ntt.prototype.tableCell=function(e){for(var t="",i=1;i<=2;i++){t+="|";for(var n=1;n<=2;n++)t+=e.item.colText+" "+this.convertToLetters(i)+n+"|";t+=this.insertLine()}return t+=this.insertLine()},Ntt.prototype.insertLine=function(){var e=document.createElement("div");return e.innerHTML="\n",e.textContent},Ntt.prototype.insertTable=function(e,t,i,n){var o=this.selection.getSelectedParentPoints(this.element),r=o[o.length-1].text.split(" ",2),s=this.getFormatTag();!(r.length<2)&&this.ensureFormatApply(o[o.length-1].text)?this.checkValid(e,t,this.getTable(),i,n,r,o,s):(this.element.value=this.updateValue(this.getTable()),this.makeSelection(i,e,t)),this.restore(this.element.selectionStart,this.element.selectionEnd,n)},Ntt.prototype.makeSelection=function(e,t,i){i=t+(0<e.length?12:10),t+=0<e.length?3:1,this.selection.setSelection(this.element,t,i)},Ntt.prototype.getFormatTag=function(){for(var e=Object.keys(this.syntaxTag.Formats),t=Object.keys(this.syntaxTag.List),i=[],n=0;n<e.length;n++)i.push(this.syntaxTag.Formats[e[n]]);for(var o=0;o<t.length;o++)i.push(this.syntaxTag.List[t[o]]);return i},Ntt.prototype.ensureFormatApply=function(e){for(var t=this.getFormatTag(),i=e.trim().split(" ",2)[0]+" ",n=0;n<t.length;n++)if(i===t[n]||/^[\d.]+[ ]+$/.test(i))return!0;return!1},Ntt.prototype.ensureStartValid=function(e,t){for(var i=t[0].text.split(" ",2),n=e+1;n<=e+i[0].length-1;n++)if(this.element.selectionStart===n||this.element.selectionEnd===n)return!1;return!0},Ntt.prototype.ensureEndValid=function(e,t){for(var i=e+1;i<=e+t-1;i++)if(this.element.selectionEnd===i)return!1;return!0},Ntt.prototype.updateValueWithFormat=function(e,t){var i=this.element.value.substring(this.element.selectionEnd,this.element.value.length);return t+=i.replace(i,e[0]+" "+i),this.element.value.substr(0,this.element.selectionStart)+t},Ntt.prototype.updateValue=function(e){return this.element.value.substr(0,this.element.selectionStart)+e+this.element.value.substr(this.element.selectionEnd,this.element.value.length)},Ntt.prototype.checkValid=function(e,t,i,n,o,r,s,a){this.ensureStartValid(s[0].start,s)&&this.ensureEndValid(s[s.length-1].start,r[0].length)&&(e===s[0].start?e!==t&&t!==s[s.length-1].end-1?this.element.value=this.updateValueWithFormat(r,i):this.element.value=this.updateValue(i):t===s[s.length-1].end-1?this.element.value=this.updateValue(i):this.element.value=this.updateValueWithFormat(r,i),this.makeSelection(n,e,t))},Ntt.prototype.convertToLetters=function(e){for(var t="A".charCodeAt(0),i="";--e,i=String.fromCharCode(t+e%26)+i,0<(e=e/26>>0););return i},Ntt.prototype.textNonEmpty=function(){var e="";return e=(this.isCursorBased()||this.isSelectionBased())&&0<this.element.value.length?(e+=this.insertLine())+this.insertLine():e},Ntt.prototype.isCursorBased=function(){return this.element.selectionStart===this.element.selectionEnd},Ntt.prototype.isSelectionBased=function(){return this.element.selectionStart!==this.element.selectionEnd},Ntt.prototype.restore=function(e,t,i){this.selection.save(e,t),this.selection.restore(this.element),i&&i.callBack&&(je(i.subCommand)&&"action"in i.event&&"insert-table"===i.event.action&&(i.subCommand="CreateTable"),i.callBack({requestType:i.subCommand,selectedText:this.selection.getSelectedText(this.element),editorMode:"Markdown",event:i.event}))};var Ott=Ntt;function Ntt(e){Pe(this,this,e,!0),this.selection=this.parent.markdownSelection,this.addEventListener()}_tt.prototype.addEventListener=function(){this.parent.observer.on(Att,this.clear,this),this.parent.observer.on(v7e,this.destroy,this)},_tt.prototype.removeEventListener=function(){this.parent.observer.off(Att,this.clear),this.parent.observer.off(v7e,this.destroy)},_tt.prototype.replaceRegex=function(e){return e.replace(/\*/gi,"\\*").replace(/\&/gi,"\\&").replace(/\-/gi,"\\-").replace(/\^/gi,"\\^").replace(/\$/gi,"\\$").replace(/\./gi,"\\.").replace(/\|/gi,"\\|").replace(/\?/gi,"\\?").replace(/\+/gi,"\\+").replace(/\-/gi,"\\-").replace(/\&/gi,"\\&")},_tt.prototype.clearSelectionTags=function(e){for(var t=this.parent.selectionTags,i=Object.keys(t),n=0;n<i.length;n++){var o=i[n];if(Object.prototype.hasOwnProperty.call(t,o)&&""!==t[""+o])for(var r=this.replaceRegex(t[""+o]),s=void 0,a=t[""+o].length,l="<sup>"===t[""+o]||"<sub>"===t[""+o]?t[""+o].length+1:t[""+o].length,h=(s="<sup>"===t[""+o]?new RegExp("<sup>(.*?)</sup>","ig"):"<sub>"===t[""+o]?new RegExp("<sub>(.*?)</sub>","ig"):new RegExp(r+"(.*?)"+r,"ig"),e.match(s)),d=0;h&&d<h.length&&""!==h[d];d++)e=e.replace(h[d],h[d].substr(a,h[d].length-l-a))}return e},_tt.prototype.clearFormatTags=function(e){e=e.split("\n");return this.clearFormatLines(e)},_tt.prototype.clearFormatLines=function(e){for(var t=[this.parent.formatTags,this.parent.listTags],i="",n=0;n<e.length;n++){for(var o=0;o<t.length;o++)for(var r=t[o],s=Object.keys(r),a=0;a<s.length;a++){var l=s[a];Object.prototype.hasOwnProperty.call(r,l)&&""!==r[""+l]&&0===e[n].indexOf(r[""+l])&&(e[n]=e[n].replace(r[""+l],""),e[n]=this.clearFormatLines([e[n]]))}i=i+e[n]+(n!==e.length-1?"\n":"")}return i},_tt.prototype.clear=function(e){var t=this.parent.element,i=(t.focus(),t.selectionStart),n=t.selectionEnd,o=this.selection.getSelectedText(t),o=this.clearSelectionTags(o);o=this.clearFormatTags(o),t.value=t.value.substr(0,i)+o+t.value.substr(n,t.value.length),this.parent.markdownSelection.setSelection(t,i,i+o.length),this.restore(t,i,i+o.length,e)},_tt.prototype.restore=function(e,t,i,n){this.selection.save(t,i),this.selection.restore(e),n&&n.callBack&&n.callBack({requestType:n.subCommand,selectedText:this.selection.getSelectedText(e),editorMode:"Markdown",event:n.event})},_tt.prototype.destroy=function(){this.removeEventListener()};var Vtt=_tt;function _tt(e){this.parent=e,this.selection=this.parent.markdownSelection,this.addEventListener()}ztt.prototype.addEventListener=function(){this.parent.observer.on(Itt,this.InsertTextExec,this),this.parent.observer.on(v7e,this.destroy,this)},ztt.prototype.removeEventListener=function(){this.parent.observer.off(Itt,this.InsertTextExec),this.parent.observer.off(v7e,this.destroy)},ztt.prototype.InsertTextExec=function(e){var t=this.parent.element,i=(t.focus(),t.selectionStart),n=t.selectionEnd,o=e.value.text,r=i+o.length,s=n+o.length;t.value=t.value.substr(0,i)+o+t.value.substr(n,t.value.length),this.parent.markdownSelection.setSelection(t,r,s),this.restore(t,r,s,e)},ztt.prototype.restore=function(e,t,i,n){this.selection.save(t,i),this.selection.restore(e),n&&n.callBack&&n.callBack({requestType:n.subCommand,selectedText:this.selection.getSelectedText(e),editorMode:"Markdown",event:n.event})},ztt.prototype.destroy=function(){this.removeEventListener()};var Htt=ztt;function ztt(e){this.parent=e,this.selection=this.parent.markdownSelection,this.addEventListener()}Wtt.prototype.initialize=function(){this.formatTags=LUe,this.listTags=OUe,this.selectionTags=RUe},Wtt.prototype.wireEvents=function(){this.observer.on(e7e,this.editorKeyDown,this),this.observer.on(s7e,this.editorKeyUp,this),this.observer.on(l7e,this.onPropertyChanged,this)},Wtt.prototype.unwireEvents=function(){this.observer.off(e7e,this.editorKeyDown),this.observer.off(s7e,this.editorKeyUp),this.observer.off(l7e,this.onPropertyChanged)},Wtt.prototype.onPropertyChanged=function(e){this.observer.notify(a7e,e)},Wtt.prototype.editorKeyDown=function(e){this.observer.notify(n7e,e)},Wtt.prototype.editorKeyUp=function(e){this.observer.notify(r7e,e)},Wtt.prototype.execCommand=function(e,t,i,n,o,r){switch(e.toLocaleLowerCase()){case"lists":this.observer.notify(wtt,{subCommand:t,event:i,callBack:n});break;case"formats":this.observer.notify(i7e,{subCommand:t,event:i,callBack:n});break;case"actions":this.observer.notify(t7e,{subCommand:t,event:i,callBack:n});break;case"style":case"effects":case"casing":this.observer.notify(Ctt,{subCommand:t,event:i,callBack:n});break;case"links":case"images":this.observer.notify(Stt,{subCommand:t,event:i,callBack:n,item:r});break;case"table":"createtable"===t.toString().toLocaleLowerCase()&&this.observer.notify(xtt,{subCommand:t,item:r,event:i,callBack:n});break;case"clear":this.observer.notify(Att,{subCommand:t,event:i,callBack:n});break;case"inserttext":this.observer.notify(Itt,{subCommand:t,event:i,callBack:n,value:{text:r}})}},Wtt.prototype.destroy=function(){this.observer.notify(v7e,{}),this.unwireEvents()};var jtt=Wtt;function Wtt(e){this.initialize(),Pe(this,this,e,!0),this.observer=new yt(this),this.markdownSelection=new mtt,this.listObj=new Ttt({parent:this,syntax:this.listTags}),this.formatObj=new Dtt({parent:this,syntax:this.formatTags}),this.undoRedoManager=new Btt(this,e.options),this.mdSelectionFormats=new ktt({parent:this,syntax:this.selectionTags}),this.linkObj=new Ltt(this),this.tableObj=new Ott({parent:this,syntaxTag:{Formats:this.formatTags,List:this.listTags}}),this.clearObj=new Vtt(this),this.insertTextObj=new Htt(this),this.wireEvents()}Qtt=function(e,t){return(Qtt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Qtt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Gtt,Utt=Met),Gtt.prototype.initialize=function(){this.keyConfig=VUe,this.formatTags=LUe,this.listTags=OUe,this.selectionTags=RUe},Gtt.prototype.updateFormatter=function(e,t,i){e&&(this.editorManager=new jtt({element:e,formatTags:this.formatTags,listTags:this.listTags,selectionTags:this.selectionTags,options:i}))};var Qtt,Utt,qtt=Gtt;function Gtt(e){var t=Utt.call(this)||this;return t.initialize(),Pe(t,t,e,!0),e&&t.element&&t.updateFormatter(t.element,document,e.options),t}Xtt.prototype.destroy=function(){this.isDestroyed||(this.removeEventListener(),this.isDestroyed=!0)},Xtt.prototype.addEventListener=function(){this.parent.isDestroyed||(this.saveSelection=new mtt,this.parent.on(J3e,this.instantiateRenderer,this),this.parent.on($3e,this.render,this),this.parent.on(d4e,this.onPropertyChanged,this),this.parent.on(h4e,this.onToolbarClick,this),this.parent.on(t4e,this.destroy,this),this.parent.on(p5e,this.selectAll,this),this.parent.on(u5e,this.getSelectedHtml,this),this.parent.on(t5e,this.onSelectionSave,this),this.parent.on(i5e,this.onSelectionRestore,this),this.parent.on(C5e,this.updateReadOnly,this))},Xtt.prototype.updateReadOnly=function(){(this.parent.readonly?(this.parent.contentModule.getEditPanel().setAttribute("readonly","readonly"),U):(this.parent.contentModule.getEditPanel().removeAttribute("readonly"),q))([this.parent.element],$8e)},Xtt.prototype.onSelectionSave=function(){var e=this.parent.contentModule.getEditPanel();this.saveSelection.save(e.selectionStart,e.selectionEnd)},Xtt.prototype.onSelectionRestore=function(e){this.contentRenderer.getEditPanel().focus();var t=this.parent.contentModule.getEditPanel();this.saveSelection.restore(t)},Xtt.prototype.onToolbarClick=function(e){var t=e.item,i=this.parent.contentModule.getEditPanel(),n=("Formats"!==t.command&&i.focus(),i.selectionStart),o=i.selectionEnd,r=i.value.substring(n,o);switch(t.subCommand){case"Maximize":this.parent.notify(b4e,{args:e});break;case"Minimize":this.parent.notify(w4e,{args:e});break;case"CreateLink":this.parent.notify(B4e,{member:"link",args:e,text:r,module:"Markdown"});break;case"Image":this.parent.notify(H4e,{member:"image",args:e,text:r,module:"Markdown"});break;case"CreateTable":var s={headingText:this.parent.localeObj.getConstant("TableHeadingText"),colText:this.parent.localeObj.getConstant("TableColText")};this.parent.formatter.process(this.parent,e,e.originalEvent,s);break;default:this.parent.formatter.process(this.parent,e,e.originalEvent,null)}},Xtt.prototype.instantiateRenderer=function(){this.renderFactory.addRenderer(q3e.Content,new vqe(this.parent))},Xtt.prototype.removeEventListener=function(){this.parent.off($3e,this.render),this.parent.off(d4e,this.onPropertyChanged),this.parent.off(t4e,this.destroy),this.parent.off(h4e,this.onToolbarClick),this.parent.off(J3e,this.instantiateRenderer),this.parent.off(p5e,this.selectAll),this.parent.off(u5e,this.getSelectedHtml),this.parent.off(t5e,this.onSelectionSave),this.parent.off(i5e,this.onSelectionRestore),this.parent.off(C5e,this.updateReadOnly)},Xtt.prototype.render=function(){this.contentRenderer=this.renderFactory.getRenderer(q3e.Content);var e=this.contentRenderer.getEditPanel(),t={undoRedoSteps:this.parent.undoRedoSteps,undoRedoTimer:this.parent.undoRedoTimer};je(this.parent.formatter)?this.parent.formatter=new qtt({element:e,options:t}):this.parent.formatter.updateFormatter(e,this.contentRenderer.getDocument(),t),this.parent.toolbarSettings.enable&&(this.toolbarUpdate=new ytt(this.parent)),this.parent.notify(a4e,{})},Xtt.prototype.onPropertyChanged=function(e){var t;je(e.newProp.formatter)||(e=this.contentRenderer.getEditPanel(),t={undoRedoSteps:this.parent.undoRedoSteps,undoRedoTimer:this.parent.undoRedoTimer},this.parent.formatter.updateFormatter(e,this.contentRenderer.getDocument(),t))},Xtt.prototype.getModuleName=function(){return"markdownEditor"},Xtt.prototype.selectAll=function(){this.parent.formatter.editorManager.markdownSelection.setSelection(this.parent.contentModule.getEditPanel(),0,this.parent.contentModule.getEditPanel().value.length)},Xtt.prototype.getSelectedHtml=function(e){e.callBack(this.parent.formatter.editorManager.markdownSelection.getSelectedText(this.parent.contentModule.getEditPanel()))};var Ytt=Xtt;function Xtt(e,t){this.parent=e,this.locator=t,this.renderFactory=this.locator.getService("rendererFactory"),this.addEventListener(),this.isDestroyed=!1}Ktt=function(e,t){return(Ktt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Ktt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})($tt,Jtt=Met),$tt.prototype.initialize=function(){this.keyConfig=NUe},$tt.prototype.updateFormatter=function(e,t,i,n){e&&t&&(this.editorManager=new N9e({document:t,editableElement:e,options:i,formatPainterSettings:n}))};var Ktt,Jtt,Ztt=$tt;function $tt(e){var t=Jtt.call(this)||this;return t.initialize(),Pe(t,t,e,!0),t.currentDocument&&t.element&&t.updateFormatter(t.element,t.currentDocument,e.options,e.formatPainterSettings),t}tit.prototype.addEventListener=function(){this.parent.on(n4e,this.onRefreshHandler,this),this.parent.on(t4e,this.removeEventListener,this)},tit.prototype.removeEventListener=function(){this.toolbarStatus=null,this.prevToolbarStatus=null,this.parent.off(n4e,this.onRefreshHandler),this.parent.off(t4e,this.removeEventListener)},tit.prototype.onRefreshHandler=function(e){var t,i,n;this.parent.readonly||(t=[],i=[],n=[],this.parent.fontSize.items.forEach(function(e){t.push(e.value)}),this.parent.fontFamily.items.forEach(function(e){i.push(e.value)}),this.parent.format.types.forEach(function(e){n.push(e.value.toLocaleLowerCase())}),this.toolbarStatus=j9e.get(this.parent.contentModule.getDocument(),this.parent.contentModule.getEditPanel(),n,t,i,e.documentNode),e=JSON.stringify(this.toolbarStatus),this.parent.notify(s4e,this.toolbarStatus),JSON.stringify(this.prevToolbarStatus)!==e&&(this.parent.notify(iWe,{html:JSON.parse(e),markdown:null}),this.prevToolbarStatus=JSON.parse(e)))};var eit=tit;function tit(e){this.parent=e,this.toolbarStatus=this.prevToolbarStatus=UUe(),this.addEventListener()}nit.prototype.addEventListener=function(){this.parent.on(G5e,this.enableXhtmlValidation,this),this.parent.on(t4e,this.removeEventListener,this)},nit.prototype.removeEventListener=function(){this.parent.off(G5e,this.enableXhtmlValidation),this.parent.off(t4e,this.removeEventListener)},nit.prototype.enableXhtmlValidation=function(){this.parent.enableXhtml&&(je(this.parent.inputElement)?this.currentElement=this.parent.element:this.currentElement=this.parent.inputElement,this.clean(this.currentElement),this.ImageTags(),this.removeTags(),this.RemoveUnsupported(),this.currentElement.innerHTML=this.selfEncloseValidation(this.currentElement.innerHTML,("\n"===this.currentElement.innerText?this.currentElement.innerText:this.currentElement.innerText.trim()).length),this.parent.setProperties({value:this.currentElement.innerHTML},!0))},nit.prototype.selfEncloseValidation=function(e,t){0===t&&e.indexOf("table")<0&&e.indexOf("img")<0&&e.includes("&nbsp;")&&((t=e.split("&nbsp;"))[t.length-1]="&#8203;"+t[t.length-1],e=t.join("")),e=e.replace(/<br>/g,"<br/>").replace(/<hr>/g,"<hr/>").replace(/ /g," ");for(var i,n=[],o=[/<img(.*?)>/gi,/<area(.*?)>/gi,/<base(.*?)>/gi,/<col (.*?)>/gi,/<embed(.*?)>/gi,/<input(.*?)>/gi,/<link(.*?)>/gi,/<meta(.*?)>/gi,/<param(.*?)>/gi,/<source(.*?)>/gi,/<track(.*?)>/gi,/<wbr(.*?)>/gi],r=0;r<o.length;r++){for(i=o[r].exec(e);null!==i;)n.push(i[0].toString()),i=o[r].exec(e);for(var s=n.slice(0),a=0;a<n.length;a++)-1!==n[a].indexOf("/")&&n[a].lastIndexOf("/")===n[a].length-2||(n[a]=n[a].substr(0,n[a].length-1)+" /"+n[a].substr(n[a].length-1,n[a].length));for(var l=0;l<=n.length-1;l++)e=e.replace(s[l],n[l])}return e},nit.prototype.clean=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];8===i.nodeType||"V:IMAGE"===i.nodeName?(e.removeChild(i),t--):1===i.nodeType&&this.clean(i)}return this.currentElement.innerHTML},nit.prototype.ImageTags=function(){for(var e=this.currentElement.querySelectorAll("IMG"),t=e.length-1;0<=t;t--)e[t].hasAttribute("alt")||e[t].setAttribute("alt","")},nit.prototype.removeTags=function(){for(var e=[["br","ul"],["br","ol"],["table","span"],["div","span"],["p","span"]],t=0;t<e.length;t++)this.RemoveElementNode(e[t][0],e[t][1])},nit.prototype.RemoveElementNode=function(e,t){for(var i=this.currentElement.querySelectorAll(t),n=0;n<i.length;n++)for(var o=i[n].querySelectorAll(e),r=o.length;0<r;r--)G(o[r-1])},nit.prototype.RemoveUnsupported=function(){for(var e=this.currentElement.querySelectorAll("u"),t=e.length-1;0<=t;t--){var i=this.parent.createElement("span");i.style.textDecoration="underline",i.innerHTML=e[t].innerHTML,e[t].parentNode.insertBefore(i,e[t]),G(e[t])}for(var n=this.currentElement.querySelectorAll("strong"),t=n.length-1;0<=t;t--){var o=this.parent.createElement("b");o.innerHTML=n[t].innerHTML,n[t].parentNode.insertBefore(o,n[t]),G(n[t])}for(var r=["language","role","target","contenteditable","cellspacing","cellpadding","border","valign","colspan"],t=0;t<=r.length;t++)this.RemoveAttributeByName(r[t])},nit.prototype.RemoveAttributeByName=function(e){if(null!==this.currentElement.firstChild&&3!==this.currentElement.firstChild.nodeType)for(var t=0;t<this.currentElement.childNodes.length;t++){var i=this.currentElement.childNodes[t];if(3!==i.nodeType&&"TABLE"!==i.nodeName&&"TBODY"!==i.nodeName&&"THEAD"!==i.nodeName&&"TH"!==i.nodeName&&"TR"!==i.nodeName&&"TD"!==i.nodeName&&(i.hasAttribute(e)&&i.removeAttribute(e),i.hasChildNodes()))for(var n=0;n<i.childNodes.length;n++){var o=i.childNodes[n];if(3!==o.nodeType&&"TABLE"!==o.nodeName&&"TBODY"!==o.nodeName&&"THEAD"!==o.nodeName&&"TH"!==o.nodeName&&"TR"!==o.nodeName&&"TD"!==o.nodeName&&o.hasAttribute(e)&&!o.classList.contains("e-mention-chip")&&o.removeAttribute(e),o.hasChildNodes())for(var r=0;r<o.childNodes.length;r++)3!==o.childNodes[r].nodeType&&"TABLE"!==o.childNodes[r].nodeName&&"TBODY"!==o.childNodes[r].nodeName&&"THEAD"!==o.childNodes[r].nodeName&&"TH"!==o.childNodes[r].nodeName&&"TR"!==o.childNodes[r].nodeName&&"TD"!==o.childNodes[r].nodeName&&o.childNodes[r].hasAttribute(e)&&o.childNodes[r].removeAttribute(e)}}};var iit=nit;function nit(e){this.parent=e,this.addEventListener()}rit.prototype.destroy=function(){this.isDestroyed||(this.clickTimeout&&(clearTimeout(this.clickTimeout),this.clickTimeout=null),this.removeEventListener(),this.locator=null,this.contentRenderer=null,this.renderFactory=null,this.toolbarUpdate=null,this.nodeSelectionObj=null,this.isCopyAll=null,this.isSlashMenuOpen=null,0<this.rangeCollection.length&&(this.rangeCollection=[]),this.rangeElement&&(this.rangeElement=null),this.oldRangeElement&&(this.oldRangeElement=null),this.deleteRangeElement&&(this.deleteRangeElement=null),this.deleteOldRangeElement&&(this.deleteOldRangeElement=null),this.saveSelection&&(this.saveSelection=null),this.xhtmlValidation&&(this.xhtmlValidation=null),this.isDestroyed=!0)},rit.prototype.sanitizeHelper=function(e){return e=W6e(e,this.parent)},rit.prototype.addEventListener=function(){this.parent.isDestroyed||(this.nodeSelectionObj=new _9e(this.parent.inputElement),this.parent.on(J3e,this.instantiateRenderer,this),this.parent.on(l4e,this.onToolbarClick,this),this.parent.on(o4e,this.onSlashMenuOpen,this),this.parent.on(u4e,this.onKeyDown,this),this.parent.on(c4e,this.onKeyUp,this),this.parent.on($3e,this.render,this),this.parent.on(d4e,this.onPropertyChanged,this),this.parent.on(t4e,this.destroy,this),this.parent.on(p5e,this.selectAll,this),this.parent.on(c5e,this.selectRange,this),this.parent.on(u5e,this.getSelectedHtml,this),this.parent.on(t5e,this.onSelectionSave,this),this.parent.on(i5e,this.onSelectionRestore,this),this.parent.on(C5e,this.updateReadOnly,this),this.parent.on(m5e,this.onPaste,this),this.parent.on(K3e,this.isTableClassAdded,this),this.parent.on(kWe,this.onHandleFontsizeChange,this))},rit.prototype.onSlashMenuOpen=function(){this.isSlashMenuOpen=!0},rit.prototype.updateReadOnly=function(){(this.parent.readonly?(pt(this.parent.contentModule.getEditPanel(),{contenteditable:"false"}),U):(pt(this.parent.contentModule.getEditPanel(),{contenteditable:"true"}),q))([this.parent.element],$8e)},rit.prototype.onSelectionSave=function(){var e=this.contentRenderer.getDocument(),t=this.nodeSelectionObj.getRange(e);this.saveSelection=this.nodeSelectionObj.save(t,e)},rit.prototype.onSelectionRestore=function(e){this.parent.isBlur=!1,this.contentRenderer.getEditPanel().focus({preventScroll:!0}),!je(e.items)&&!e.items||je(this.saveSelection)||this.saveSelection.restore()},rit.prototype.isTableClassAdded=function(){for(var e=this.parent.inputElement.querySelectorAll("table"),t=0;t<e.length;t++)e[t].classList.contains("e-rte-table")||e[t].classList.contains("e-rte-paste-table")||e[t].classList.contains("e-rte-custom-table")||e[t].classList.add("e-rte-table")},rit.prototype.onHandleFontsizeChange=function(e){var t,i,n,o,r,s,e=e.args,a={name:"dropDownSelect",item:{command:"Font",subCommand:"FontSize"}},l=this.parent.fontSize.items,h=(i=this.parent.toolbarModule&&this.parent.toolbarModule.dropDownModule&&this.parent.toolbarModule.dropDownModule.fontSizeDropDown&&!je(this.parent.toolbarModule.dropDownModule.fontSizeDropDown.activeElem[0].textContent)&&""!==this.parent.toolbarModule.dropDownModule.fontSizeDropDown.activeElem[0].textContent?this.parent.toolbarModule.dropDownModule.fontSizeDropDown.activeElem[0].textContent:(r=void 0,h=(r=je(r=(h=this.parent.contentModule.getDocument().getSelection())&&h.focusNode&&h.focusNode.parentElement?document.defaultView.getComputedStyle(h.focusNode.parentElement,null).getPropertyValue("font-size"):this.parent.fontSize.width)?this.parent.fontSize.width:r).match(/^([\d.]+)(\D+)$/),t=parseInt(h[1],10),r=h[2],h=(h=l[1].value.match(/^([\d.]+)(\D+)$/))[2]===r?l.findIndex(function(e){e=e.value;return parseInt(e,10)>=t}):(n=this.convertFontSize(t,r,h[2]),l.findIndex(function(e){e=e.value;return parseInt(e,10)>=n})),l[h].text),l.findIndex(function(e){return e.text===("Font Size"===i?"Default":i)}));"increase-fontsize"===e.action&&-1!==h?h>=l.length-1?((s=l[h].value.match(/^([\d.]+)(\D+)$/))&&(o=parseInt(s[1],10),r=s[2],s=o%10==0?10*Math.ceil((o+1)/10):10*Math.ceil(o/10),a.item.value=s.toLocaleString()+r,a.item.text=s.toLocaleString()+" "+r),this.parent.fontSize.items.push(a.item)):(a.item.value=l[h+1].value,a.item.text=l[h+1].text):"decrease-fontsize"===e.action&&-1!==h&&0<h?(a.item.value=l[h-1].value,a.item.text=l[h-1].text):0<=h&&h<l.length&&l[h]&&(a.item.value=l[h].value,a.item.text=l[h].text),this.parent.formatter.process(this.parent,a,e)},rit.prototype.convertFontSize=function(e,t,i){return-1===DWe.indexOf(t)&&-1===DWe.indexOf(i)||(t="px"),e*MWe[t][i]},rit.prototype.onKeyUp=function(e){var e=e.args,t=this.parent.getRange(),i=new RegExp("​","g"),n=t.startContainer===t.endContainer&&t.startOffset===t.endOffset&&1===t.startOffset&&1===t.startContainer.textContent.length&&8203===t.startContainer.textContent.charCodeAt(0)&&0===t.startContainer.textContent.replace(i,"").length,o=!1;if(t.startContainer===t.endContainer&&t.startOffset===t.endOffset&&t.startContainer!==this.parent.inputElement&&0!==t.startOffset&&(r=3===t.startContainer.nodeType?t.startContainer:t.startContainer.childNodes[t.startOffset-1],o=16===e.keyCode&&8203===r.textContent.charCodeAt(0)&&!je(r.previousSibling)&&"false"===r.previousSibling.contentEditable),!this.isCopyAll){var r=!1;if(!this.isSlashMenuOpen&&[8,9,13,17,18,20,27,37,38,39,40,44,45,46,91,112,113,114,115,116,117,118,119,120,121,122,123].indexOf(e.keyCode)<0&&!e.shiftKey&&!e.ctrlKey&&!e.altKey&&!n&&!o){l=t.startOffset,"#text"===t.startContainer.nodeName?t.startContainer.parentElement!==this.parent.inputElement?t.startContainer.parentElement.classList.add("currentStartMark"):r=!0:t.startContainer.classList.add("currentStartMark"),8203===t.startContainer.textContent.charCodeAt(0)&&(e=t.startContainer.textContent.length,n=t.startOffset,this.removeZeroWidthSpaces(t.startContainer,i),l=0===n?n:n-(e-t.startContainer.textContent.length),this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),t.startContainer,l));var o=this.parent.inputElement.innerHTML.length,n=this.parent.inputElement.innerHTML.replace(i,"").length,s=t.startContainer;if(n<o&&!r){0!==s.textContent.trim().length&&s.previousSibling&&((e=document.createElement("span")).className="tempSpan",t.insertNode(e));for(var a=this.parent.inputElement.firstChild;!je(a);)a=("#text"===a.nodeName||0<a.textContent.replace(i,"").trim().length&&a.textContent.includes("​")&&this.removeZeroWidthSpaces(a,i),a.nextElementSibling);var l,n=this.parent.inputElement.querySelector(".tempSpan"),o=(n&&n.previousSibling&&0!==s.textContent.trim().length&&(s=n.previousSibling,l=n.previousSibling.textContent.length,n.parentNode.removeChild(n),0),this.parent.inputElement.querySelector(".currentStartMark")),h=o?o.childNodes:[];if(1<h.length)for(var d,p=0;p<h.length;p++)"#text"===h[p].nodeName&&0===h[p].textContent.length&&(G(h[p]),p--),je(h[p])||s.textContent.replace(i,"")!==h[p].textContent||(d=l<=s.textContent.indexOf("​"),l=1<s.textContent.length?s.textContent===h[p].textContent||d?l:l-(s.textContent.length-s.textContent.replace(i,"").length):s.textContent.length,s=h[p]);else 1===h.length&&s.textContent.replace(i,"")===h[0].textContent&&(s=h[0]);this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),s,l)}r=this.parent.inputElement.querySelector(".currentStartMark");je(r)||(r.classList.remove("currentStartMark"),""===r.getAttribute("class").trim()&&r.removeAttribute("class")),!je(t.startContainer.previousSibling)&&!je(t.startContainer.previousSibling.parentElement)&&t.startContainer.parentElement===t.startContainer.previousSibling.parentElement&&8203===t.startContainer.previousSibling.textContent.charCodeAt(0)&&t.startContainer.previousSibling.textContent.length<=1&&(t.startContainer.previousSibling.textContent=t.startContainer.previousSibling.textContent.replace(i,"")),8203===t.endContainer.textContent.charCodeAt(t.endOffset)&&(l=t.startOffset,t.endContainer.textContent=t.endContainer.textContent.replace(i,""),this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),t.startContainer,l))}this.isSlashMenuOpen=!1}},rit.prototype.removeZeroWidthSpaces=function(e,t){var i=this;e.nodeType===Node.TEXT_NODE?null!==e.textContent&&(e.textContent=e.textContent.replace(t,"")):e.childNodes.forEach(function(e){i.removeZeroWidthSpaces(e,t)})},rit.prototype.onKeyDown=function(t){var e,i=this,n=(t.args.ctrlKey&&65===t.args.keyCode?this.isCopyAll=!0:this.isCopyAll=!1,t.args);if(1<this.parent.inputElement.querySelectorAll(".e-cell-select:not(table)").length&&(8===n.keyCode||32===n.keyCode||13===n.keyCode))this.tableSelectionKeyAction(t);else{var o,r,s;if("chrome"===F.info.name&&(e=this.parent.getRange(),this.backSpaceCleanup(t,e),this.deleteCleanup(t,e)),9===n.keyCode&&this.parent.enableTabKey&&(this.parent.formatter.saveData(t),!je(n.target)&&je(z(n.target,".e-rte-toolbar"))&&(a=this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()),"LI"===(l=this.nodeSelectionObj.getParentNodeCollection(a))[0].nodeName||z(l[0],"li")||z(l[0],"table")||(n.preventDefault(),l=this.contentRenderer.getDocument().getSelection().getRangeAt(0),s=this.parent.formatter.editorManager.domNode.blockNodes(),"BR"===this.parent.enterKey?l.startOffset!==l.endOffset&&0===l.startOffset?(a=this.nodeSelectionObj.save(a,this.contentRenderer.getDocument()),this.parent.formatter.editorManager.domNode.setMarker(a),s=this.parent.formatter.editorManager.domNode.blockNodes(),this.parent.formatter.editorManager.domNode.convertToBlockNodes(s,!1),this.marginTabAdd(n.shiftKey,s),(a=this.parent.formatter.editorManager.domNode.saveMarker(a)).restore()):(A7e.Insert(this.contentRenderer.getDocument(),"&nbsp;&nbsp;&nbsp;&nbsp;"),this.rangeCollection.push(this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()))):l.startOffset!==l.endOffset&&0===l.startOffset?this.marginTabAdd(n.shiftKey,s):(A7e.Insert(this.contentRenderer.getDocument(),"&nbsp;&nbsp;&nbsp;&nbsp;"),this.rangeCollection.push(this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()))))),this.parent.formatter.saveData(t)),("space"===t.args.action||"enter"===t.args.action||13===t.args.keyCode||/[^\w\s\\/\\.\\:]/g.test(t.args.key))&&(this.spaceLink(t.args),"HTML"===this.parent.editorMode)&&!this.parent.readonly){var a=this.parent.getText().trim().replace(/(\r\n|\n|\r|\t)/gm,"").replace(/\u200B/g,"").length,l=this.parent.getSelection().length;if(!(-1===this.parent.maxLength||a-l+1<=this.parent.maxLength||13!==t.args.keyCode))return void t.args.preventDefault();this.parent.notify(A5e,{args:t.args}),qUe(this.parent.contentModule.getDocument(),this.parent.inputElement)}"space"!==t.args.action||(a=(s=this.parent.getRange()).startContainer.textContent.slice(0,s.startOffset),o=this.isOrderedList(a),l=this.isUnOrderedList(a),a=!1,a=!((o||l)&&(a=this.hasMultipleTextNode(s))&&!this.isMention&&(s=s.startContainer,0<(s=this.parent.formatter.editorManager.domNode.getImmediateBlockNode(s)).childNodes.length)&&!s.innerHTML.includes("<br>"))&&a)||!(o&&!l||l&&!o)||(s={cancel:!(r={callBack:null,event:t.args,name:"keydown-handler",enterKey:this.parent.enterKey,shiftEnterKey:this.parent.shiftEnterKey}),item:{command:"Lists",subCommand:o?"OL":"UL"},name:"actionBegin",originalEvent:t.args,requestType:o?"OL":"UL"},this.parent.trigger(O4e,s,function(e){e.cancel||(i.parent.formatter.editorManager.observer.notify(p7e,r),i.parent.trigger(N4e,{editorMode:i.parent.editorMode,elements:i.parent.formatter.editorManager.domNode.blockNodes(),event:t.args,name:N4e,range:i.parent.getRange(),requestType:o?"OL":"UL"}))})),"chrome"!==F.info.name||(je(this.rangeElement)||je(this.oldRangeElement))&&(je(this.deleteRangeElement)||je(this.deleteOldRangeElement))||"TD"===e.startContainer.parentElement.tagName||"TH"===e.startContainer.parentElement.tagName||(this.rangeElement=null,this.oldRangeElement=null,this.deleteRangeElement=null,this.deleteOldRangeElement=null,this.isImageDelete||n.preventDefault(),n.preventDefault())}this.parent.autoResize()},rit.prototype.isOrderedList=function(e){var t=[/^[1]+[.]+$/,/^[i]+[.]+$/,/^[a]+[.]+$/];if(!je(e=e.replace(/\u200B/g,"")))for(var i=0;i<t.length;i++)if(t[i].test(e))return!0;return!1},rit.prototype.isUnOrderedList=function(e){var t=[/^[*]$/,/^[-]$/];if(!je(e=e.replace(/\u200B/g,"")))for(var i=0;i<t.length;i++)if(t[i].test(e))return!0;return!1},rit.prototype.hasMultipleTextNode=function(e){if(this.isMention=!1,e&&e.startContainer&&e.startContainer.parentNode){var t=e.startContainer.parentNode;if(e.startContainer.previousElementSibling&&e.startContainer.previousElementSibling.classList.contains("e-mention-chip")&&!e.startContainer.previousElementSibling.isContentEditable)return this.isMention=!0;if("BR"===this.parent.enterKey||z(t,"table"))return!1;for(var i=t.childNodes,n=[],o=0;o<i.length;o++){var r=i[o];if(r&&r.nodeType===Node.TEXT_NODE&&(n.push(r),1<n.length))return!0}}return!1},rit.prototype.isCursorAtBlockStart=function(e){if(0!==e.startOffset||0!==e.endOffset)return!1;var t=e.startContainer,i=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if("TD"===i.tagName||"TH"===i.tagName)return!1;var n=this.parent.formatter.editorManager.domNode.getImmediateBlockNode(i);if(t===n&&0===e.startOffset)return!0;for(var o=i,r=!1;o&&o!==n;){for(var s=o.previousSibling;s;){if(s.nodeType!==Node.TEXT_NODE||s.textContent&&s.textContent.trim()){r=!0;break}s=s.previousSibling}if(r)break;o=o.parentNode}return!r},rit.prototype.backSpaceCleanup=function(e,t){var i=!1,n=!0,o=(je(t.startContainer.previousSibling)||"SPAN"!==t.startContainer.previousSibling.nodeName||(n="false"!==t.startContainer.previousSibling.contentEditable),"#text"===t.startContainer.nodeName?t.startContainer.parentElement:t.startContainer),r=!z("#text"===t.startContainer.nodeName?t.startContainer.parentElement:t.startContainer,"li")||"li"!==o.nodeName&&je(o.previousSibling),s=this.isCursorAtBlockStart(t);if("Backspace"===e.args.code&&8===e.args.keyCode&&s&&" "!==t.startContainer.textContent&&0===this.parent.getSelection().length&&0<t.startContainer.textContent.length&&n&&r){if(!this.parent.formatter.editorManager.domNode.isBlockNode(o)&&!je(o.previousSibling)&&"BR"===o.previousSibling.nodeName||!je(t.startContainer.previousSibling)&&"BR"===t.startContainer.previousSibling.nodeName)return;if(this.rangeElement=this.getRootBlockNode(t.startContainer),"OL"===this.rangeElement.tagName||"UL"===this.rangeElement.tagName){s=this.getRangeLiNode(t.startContainer);s.previousElementSibling&&0<s.previousElementSibling.childElementCount&&(this.oldRangeElement="BR"===s.previousElementSibling.lastElementChild.nodeName?s.previousElementSibling:s.previousElementSibling.lastChild,!je(s.lastElementChild)&&"BR"!==s.lastElementChild.nodeName&&je(s.lastElementChild.previousSibling)&&"#text"!==s.lastChild.nodeName?(this.rangeElement=s.lastElementChild,i=!0):this.rangeElement=s)}else{if(this.rangeElement===this.parent.inputElement||"TABLE"===this.rangeElement.tagName||!je(this.rangeElement.previousElementSibling)&&"TABLE"===this.rangeElement.previousElementSibling.tagName)return;this.oldRangeElement=this.rangeElement.previousElementSibling}n=this.parent.formatter.editorManager.domNode.blockNodes();if(!je(n[0])&&t.collapsed&&0===t.startOffset&&0===t.endOffset&&""!==n[0].style.marginLeft&&(n[0].style.marginLeft=parseInt(n[0].style.marginLeft,10)<=20?"":parseInt(n[0].style.marginLeft,10)-20+"px"),je(this.oldRangeElement)&&je(n[0].previousSibling))return;if(n[0].previousSibling){var r=n[0].previousSibling,o=n[0];if(r.textContent.trim()){this.removeLastBr(r);for(var s=this.parent.formatter.editorManager.nodeSelection.findLastTextPosition(r),n=s.offset,s=s.node,a=Array.from(o.childNodes),l=this.nodeSelectionObj.save(t,this.contentRenderer.getDocument()),h=(this.isPreviousNodeBrAfterBackSpace&&this.parent.formatter.editorManager.domNode.setMarker(l),this.parent.formatter.editorManager.domNode.getImmediateBlockNode(s)),d=0;d<a.length;d++)h.appendChild(a[d].cloneNode(!0));this.isPreviousNodeBrAfterBackSpace?(l=this.parent.formatter.editorManager.domNode.saveMarker(l)).restore():this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),s,n),o.parentNode.removeChild(o),e.args.preventDefault()}else r.parentNode.removeChild(r)}else{"OL"!==this.oldRangeElement.tagName&&"UL"!==this.oldRangeElement.tagName||(this.oldRangeElement=this.oldRangeElement.lastElementChild.lastElementChild||this.oldRangeElement.lastElementChild);for(var p=this.oldRangeElement.lastChild||this.oldRangeElement;3!==p.nodeType&&"#text"!==p.nodeName&&"BR"!==p.nodeName&&!je(p.lastChild);)p=p.lastChild;"IMG"===p.nodeName?this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),p.parentElement,p.parentElement.childNodes.length):this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),p,p.textContent.length);l=!1;if(this.oldRangeElement&&"#text"!==this.oldRangeElement.nodeName&&1===this.oldRangeElement.querySelectorAll("BR").length&&(s=this.oldRangeElement.querySelector("BR"))&&je(s.nextSibling)&&(n=s.parentNode,o=this.oldRangeElement.innerHTML,this.parent.formatter.saveData(o),G(s),n)&&0===n.childNodes.length&&(G(n),l=!0),!je(this.rangeElement)&&this.oldRangeElement!==this.rangeElement&&!l){for(;this.rangeElement.firstChild;)("#text"===this.oldRangeElement.nodeName?this.oldRangeElement.parentElement:this.oldRangeElement).appendChild(this.rangeElement.childNodes[0]);G(i?this.rangeElement.parentElement:this.rangeElement),this.oldRangeElement.normalize()}}}"Backspace"===e.args.code&&8===e.args.keyCode&&t.startContainer.nodeType!==Node.TEXT_NODE&&(r=je(t.startContainer.childNodes[t.startOffset-1])||je(t.startContainer.childNodes[t.startOffset-1].isContentEditable)||t.startContainer.childNodes[t.startOffset-1].isContentEditable?null:t.startContainer.childNodes[t.startOffset-1])&&(r.remove(),e.args.preventDefault())},rit.prototype.getLastNode=function(e){for(;e&&e.lastChild;)e=e.lastChild;for(;e&&e.nodeType===Node.TEXT_NODE&&!e.nodeValue.trim();)e=e.previousSibling;return e},rit.prototype.removeLastBr=function(e){e=this.getLastNode(e);e&&"BR"===e.nodeName&&e.parentNode&&(this.isPreviousNodeBrAfterBackSpace=!je(e.previousSibling)&&"BR"===e.previousSibling.nodeName,e.parentNode.removeChild(e))},rit.prototype.deleteCleanup=function(e,t){var i=!1;if("Delete"===e.args.code&&46===e.args.keyCode&&0!==this.parent.contentModule.getText().trim().replace(/(\r\n|\n|\r|\t)/gm,"").replace(/\u200B/g,"").length&&0===this.parent.getSelection().length&&"TD"!==t.startContainer.parentElement.tagName&&"TH"!==t.startContainer.parentElement.tagName){if(this.deleteRangeElement=r=this.getRootBlockNode(t.startContainer),"OL"===this.deleteRangeElement.tagName||"UL"===this.deleteRangeElement.tagName)(o=this.getRangeLiNode(t.startContainer)).nextElementSibling&&0<o.nextElementSibling.childElementCount&&!o.nextElementSibling.querySelector("BR")?je(o.lastElementChild)?this.deleteRangeElement=o:(this.deleteRangeElement=o.lastElementChild,i=!0):this.deleteRangeElement=this.getRangeElement(o);else if(3===this.deleteRangeElement.nodeType||"TABLE"===this.deleteRangeElement.tagName||!je(this.deleteRangeElement.nextElementSibling)&&"TABLE"===this.deleteRangeElement.nextElementSibling.tagName)return;var n=!1;if(0<this.deleteRangeElement.querySelectorAll("img").length&&""===this.deleteRangeElement.textContent.trim()&&(n=!0),this.getCaretIndex(t,this.deleteRangeElement)!==this.deleteRangeElement.textContent.length||n)this.deleteRangeElement=null;else if(je(o)?this.deleteOldRangeElement=this.deleteRangeElement.nextElementSibling:i||!je(o.nextElementSibling)?this.deleteOldRangeElement=this.getRangeElement(o.nextElementSibling):this.deleteOldRangeElement=r.nextElementSibling,!je(this.deleteOldRangeElement)){0===t.startOffset&&1===t.endOffset&&"IMG"===this.deleteRangeElement.childNodes[0].nodeName?(this.parent.formatter.editorManager.nodeSelection.setSelectionText(this.parent.contentModule.getDocument(),this.deleteRangeElement,this.deleteRangeElement,0,1),this.isImageDelete=!0):(this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),this.deleteRangeElement,this.deleteRangeElement.childNodes.length),this.isImageDelete=!1);var n=this.deleteRangeElement.querySelector("BR"),o=this.deleteRangeElement.lastChild,r=void 0;if(o&&(r=o.parentNode),n&&n.classList.contains("e-rte-image-remove-focus"))q([n],["e-rte-image-focus"]);else{if(n&&o&&"BR"===o.nodeName){if(G(o),je(r)||0!==r.childNodes.length||G(r),!je(this.deleteRangeElement)&&this.deleteOldRangeElement.tagName&&("OL"===this.deleteOldRangeElement.tagName||"UL"===this.deleteOldRangeElement.tagName)&&this.deleteOldRangeElement!==this.deleteRangeElement&&!this.parent.contentModule.getEditPanel().contains(this.deleteRangeElement)){t=this.deleteOldRangeElement.querySelector("li");if(t){for(var s=t;s&&s.firstChild&&s.firstChild.nodeType!==Node.TEXT_NODE;)s=s.firstChild;s&&s.firstChild&&s.firstChild.nodeType===Node.TEXT_NODE?this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),s.firstChild,0):this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),t,0)}else this.parent.formatter.editorManager.nodeSelection.setSelectionText(this.parent.contentModule.getDocument(),this.deleteOldRangeElement,this.deleteOldRangeElement,0,0)}e.args.preventDefault()}if(!je(this.deleteRangeElement)&&"OL"!==this.deleteOldRangeElement.tagName&&"UL"!==this.deleteOldRangeElement.tagName&&this.deleteOldRangeElement!==this.deleteRangeElement&&this.parent.contentModule.getEditPanel().contains(this.deleteRangeElement)){for(;this.deleteOldRangeElement.firstChild;)this.deleteRangeElement.appendChild(this.deleteOldRangeElement.childNodes[0]);G(i?this.deleteOldRangeElement.parentElement:this.deleteOldRangeElement),this.deleteRangeElement.normalize()}else this.deleteRangeElement=null,this.deleteOldRangeElement=null}}}},rit.prototype.getCaretIndex=function(e,t){var i,n=0;return 0!==this.parent.contentModule.getDocument().getSelection().rangeCount&&((i=e.cloneRange()).selectNodeContents(t),i.setEnd(e.endContainer,e.endOffset),n=i.toString().length),n},rit.prototype.getRangeElement=function(e){e=e.childNodes.length<=1&&e.lastElementChild?"BR"===e.lastElementChild.tagName?e.lastElementChild.previousElementSibling||e:e.lastElementChild:e;return e},rit.prototype.getRootBlockNode=function(e){for(;e&&this.parent&&this.parent.inputElement!==e&&e.parentElement!==this.parent.inputElement;)e=e.parentElement;return e},rit.prototype.getRangeLiNode=function(e){for(var t=e.parentElement;t!==this.parent.inputElement&&(1!==t.nodeType||"LI"!==t.tagName);)t=t.parentElement;return t},rit.prototype.onPaste=function(e){var t=new RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi);if(e.text.match(t)&&!e.isWordPaste){e.args.preventDefault();for(var t=this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()),i=(this.parent.formatter.editorManager.nodeSelection.save(t,this.parent.contentModule.getDocument()),new RegExp(/([^\S]|^)(((https?\:\/\/)))/gi)),n=new RegExp(/([^\S]|^)(((www\.))(\S+))/gi),o=e.text.split("\n"),r="",s=0;s<o.length;s++)if(""===o[s].trim())r+=H6e(this.parent);else{for(var a="",l=!0,h=o[s].split(" "),d=0;d<h.length;d++)""===h[d].trim()?a+=l?"&nbsp;":" ":(l=!1,a+=h[d]+" ");r+=0===s?"<span>"+a.trim()+"</span>":"<p>"+a.trim()+"</p>"}for(var t=this.parent.createElement("div"),p=(t.setAttribute("class","pasteContent"),t.style.display="inline",t.innerHTML=r.replace("&para","&amp;para"),t.querySelectorAll("span, p")),s=0;s<p.length;s++){for(var c=p[s].innerHTML.split(" "),u="",d=0;d<c.length;d++)c[d].match(i)||c[d].match(n)?u+='<a class="e-rte-anchor" href="'+c[d]+'" title="'+c[d]+'" target="_blank" aria-label="'+this.parent.serviceLocator.getService("rteLocale").getConstant("linkAriaLabel")+'">'+c[d]+" </a>":u+=c[d]+" ";p[s].innerHTML=u.trim()}var g=t.childNodes[0];je(g)||je(g.childNodes[0])||"SPAN"!==g.nodeName||"A"!==g.childNodes[0].nodeName||(t.innerHTML=t.innerHTML.replace("<span>","").replace("</span>","")),je(this.parent.pasteCleanupModule)?this.parent.formatter.editorManager.execCommand("insertHTML",null,null,null,t):e.callBack(t.innerHTML)}},rit.prototype.spaceLink=function(e){var t,i,n,o,r=this.nodeSelectionObj.getRange(this.contentRenderer.getDocument());r.startContainer.nodeType===Node.TEXT_NODE&&(n=this.nodeSelectionObj.getParentNodeCollection(r),t=(o=(i=r.startContainer.textContent.substr(0,r.endOffset)).split(" "))[o.length-1],i=r.startOffset-(i.length-o[o.length-1].length),t=t.slice(0,i),o=new RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi),n[0])&&"A"!==n[0].nodeName&&t.match(o)&&(i=this.nodeSelectionObj.save(r,this.parent.contentModule.getDocument()),n=-1<t.indexOf("http")?t:"http://"+t,o=this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(r),this.parent.formatter.process(this.parent,{item:{command:"Links",subCommand:"CreateLink"}},e,{url:n,selection:i,selectParent:o,text:t,title:"",target:"_blank"}))},rit.prototype.onToolbarClick=function(e){var t,i,n,o=this,r=e.item,s=z(e.originalEvent.target,".e-rte-quick-popup"),a=e.originalEvent.target;if(this.parent.notify(xWe,{target:a}),"FormatPainter"!==r.command)if(!s||s.classList.contains("e-rte-inline-popup")||s.classList.contains("e-rte-text-popup")){var l,a=document.getElementById(this.parent.getID()+"_rtelink"),s=document.getElementById(this.parent.getID()+"_image");switch("SourceCode"!==r.subCommand&&"Preview"!==r.subCommand&&"FontColor"!==r.subCommand&&"BackgroundColor"!==r.subCommand&&"NumberFormatList"!==r.subCommand&&"BulletFormatList"!==r.subCommand&&(l=this.nodeSelectionObj.getRange(this.parent.contentModule.getDocument()),je(a)&&je(s)&&(t=this.nodeSelectionObj.save(l,this.parent.contentModule.getDocument())),i=this.nodeSelectionObj.getNodeCollection(l),n=this.nodeSelectionObj.getParentNodeCollection(l)),r.subCommand){case"Maximize":this.parent.notify(b4e,{args:e});break;case"Minimize":this.parent.notify(w4e,{args:e});break;case"CreateLink":this.parent.notify(B4e,{member:"link",args:e,selectNode:i,selection:t,selectParent:n});break;case"RemoveLink":this.parent.notify(F4e,{member:"link",args:e,selectNode:i,selection:t,selectParent:n});break;case"Print":this.parent.print();break;case"Image":this.parent.notify(H4e,{member:"image",args:e,selectNode:i,selection:t,selectParent:n});break;case"Audio":this.parent.notify(z4e,{member:"audio",args:e,selectNode:i,selection:t,selectParent:n});break;case"Video":this.parent.notify(j4e,{member:"video",args:e,selectNode:i,selection:t,selectParent:n});break;case"CreateTable":this.parent.notify(y5e,{member:"table",args:e,selection:t});break;case"SourceCode":this.parent.notify(Z4e,{member:"viewSource",args:e});break;case"Preview":this.parent.notify($4e,{member:"updateSource",args:e});break;case"FontColor":case"BackgroundColor":break;case"File":this.parent.notify(J5e,{member:"fileManager",args:e,selectNode:i,selection:t,selectParent:n});break;case"EmojiPicker":this.parent.notify(fWe,{member:"emojiPicker",args:e});break;case"ImportWord":this.parent.notify(g4e,{});break;case"ExportWord":this.parent.notify(m4e,{member:"ExportWord",args:e});break;case"ExportPdf":this.parent.notify(m4e,{member:"ExportPdf",args:e});break;default:this.parent.formatter.process(this.parent,e,e.originalEvent,null)}!je(this.parent.quickToolbarModule)&&(je(this.parent.quickToolbarModule.imageQTBar)&&"Image"===r.subCommand||je(this.parent.quickToolbarModule.audioQTBar)&&"Audio"===r.subCommand||je(this.parent.quickToolbarModule.videoQTBar)&&"Video"===r.subCommand||je(this.parent.quickToolbarModule.linkQTBar)&&"CreateLink"===r.subCommand)&&this.parent.notify(q5e,{})}else"SourceCode"!==r.subCommand&&"Preview"!==r.subCommand&&"FontColor"!==r.subCommand&&"BackgroundColor"!==r.subCommand&&(WUe()&&"Images"===r.command&&this.nodeSelectionObj.restore(),l=this.nodeSelectionObj.getRange(this.parent.contentModule.getDocument()),t=this.nodeSelectionObj.save(l,this.parent.contentModule.getDocument()),i=this.nodeSelectionObj.getNodeCollection(l),n=this.nodeSelectionObj.getParentNodeCollection(l)),"Images"===r.command&&this.parent.notify(x4e,{member:"image",args:e,selectNode:i,selection:t,selectParent:n}),"Audios"===r.command&&this.parent.notify(I4e,{member:"audio",args:e,selectNode:i,selection:t,selectParent:n}),"Videos"===r.command&&this.parent.notify(T4e,{member:"video",args:e,selectNode:i,selection:t,selectParent:n}),"Links"===r.command&&this.parent.notify(E4e,{member:"link",args:e,selectNode:i,selection:t,selectParent:n}),"Table"===r.command&&this.parent.notify(b5e,{member:"table",args:e,selectNode:i,selection:t,selectParent:n});else 1===e.originalEvent.detail?(clearTimeout(this.clickTimeout),this.clickTimeout=setTimeout(function(){o.parent.notify(gWe,{member:"formatPainter",args:e})},200)):(clearTimeout(this.clickTimeout),this.parent.notify(mWe,{member:"formatPainter",args:e}))},rit.prototype.instantiateRenderer=function(){this.parent.iframeSettings.enable?this.renderFactory.addRenderer(q3e.Content,new fqe(this.parent)):this.renderFactory.addRenderer(q3e.Content,new J6e(this.parent))},rit.prototype.removeEventListener=function(){this.parent.off($3e,this.render),this.parent.off(d4e,this.onPropertyChanged),this.parent.off(l4e,this.onToolbarClick),this.parent.off(t4e,this.destroy),this.parent.off(u4e,this.onKeyDown),this.parent.off(J3e,this.instantiateRenderer),this.parent.off(p5e,this.selectAll),this.parent.off(c5e,this.selectRange),this.parent.off(u5e,this.getSelectedHtml),this.parent.off(t5e,this.onSelectionSave),this.parent.off(i5e,this.onSelectionRestore),this.parent.off(C5e,this.updateReadOnly),this.parent.off(m5e,this.onPaste),this.parent.off(K3e,this.isTableClassAdded)},rit.prototype.render=function(){this.contentRenderer=this.renderFactory.getRenderer(q3e.Content);var e,t=this.contentRenderer.getEditPanel(),i={undoRedoSteps:this.parent.undoRedoSteps,undoRedoTimer:this.parent.undoRedoTimer};je(this.parent.formatter)?(e=new Ztt({currentDocument:this.contentRenderer.getDocument(),element:t,options:i,formatPainterSettings:this.parent.formatPainterSettings}),this.parent.setProperties({formatter:e},!0)):this.parent.formatter.updateFormatter(t,this.contentRenderer.getDocument(),i,this.parent.formatPainterSettings),this.parent.enableXhtml&&this.parent.notify(G5e,{}),this.parent.toolbarSettings.enable&&(this.toolbarUpdate=new eit(this.parent)),this.parent.inlineMode.enable&&(je(this.parent.fontFamily.default)||(t.style.fontFamily=this.parent.fontFamily.default),je(this.parent.fontSize.default)||(t.style.fontSize=this.parent.fontSize.default)),this.parent.notify(a4e,{})},rit.prototype.onPropertyChanged=function(e){var t;je(e)||je(e.newProp.toolbarSettings)||je(e.newProp.toolbarSettings.enable)||(this.toolbarUpdate=new eit(this.parent)),je(e.newProp.formatter)||(e=this.contentRenderer.getEditPanel(),t={undoRedoSteps:this.parent.undoRedoSteps,undoRedoTimer:this.parent.undoRedoTimer},this.parent.formatter.updateFormatter(e,this.contentRenderer.getDocument(),t))},rit.prototype.getModuleName=function(){return"htmlEditor"},rit.prototype.selectAll=function(){var e=O6e(this.parent.contentModule.getDocument(),this.parent.contentModule.getEditPanel());0<e.length&&this.parent.formatter.editorManager.nodeSelection.setSelectionText(this.parent.contentModule.getDocument(),e[0],e[e.length-1],0,e[e.length-1].textContent.length)},rit.prototype.selectRange=function(e){this.parent.formatter.editorManager.nodeSelection.setRange(this.parent.contentModule.getDocument(),e.range)},rit.prototype.getSelectedHtml=function(e){e.callBack(this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()).toString())},rit.prototype.tableSelectionKeyAction=function(e){for(var t=e.args,i=this.parent.inputElement.querySelectorAll(".e-cell-select"),n=0;n<i.length;n++){var o=i[n];YUe([o],[eQe,iQe,tQe]),0===n?(32===t.keyCode?o.innerHTML="&#8203;<br>":o.innerHTML="<br>",this.nodeSelectionObj.setCursorPoint(this.parent.contentModule.getDocument(),o.firstChild,0)):o.innerHTML="<br>"}},rit.prototype.marginTabAdd=function(e,t){for(var i=0;i<t.length;i++){var n,o=t[i];o.closest("li")||(o.style.marginLeft?(n=parseInt(o.style.marginLeft,10),e?n-=20:n+=20,o.style.marginLeft=n.toString()+"px","0px"===o.style.marginLeft&&o.removeAttribute("style")):e||(o.style.marginLeft="20px"))}};var oit=rit;function rit(e,t){this.rangeCollection=[],this.isImageDelete=!1,this.isMention=!1,this.parent=e,this.locator=t,this.renderFactory=this.locator.getService("rendererFactory"),this.xhtmlValidation=new iit(e),this.addEventListener(),this.isDestroyed=!1,this.isCopyAll=!1,this.isSlashMenuOpen=!1,this.isPreviousNodeBrAfterBackSpace=!1}ait.prototype.addEventListener=function(){this.nodeSelectionObj=new _9e(this.parent.inputElement),this.parent.isDestroyed||(this.parent.on(S5e,this.pasteClean,this),this.parent.on(uWe,this.setCssClass,this),this.parent.on(t4e,this.destroy,this),this.parent.on(v5e,this.docClick,this))},ait.prototype.destroy=function(){this.isDestroyed||(this.fireFoxUploadTime&&(clearTimeout(this.fireFoxUploadTime),this.fireFoxUploadTime=null),this.refreshPopupTime&&(clearTimeout(this.refreshPopupTime),this.refreshPopupTime=null),this.popupCloseTime&&(clearTimeout(this.popupCloseTime),this.popupCloseTime=null),this.failureTime&&(clearTimeout(this.failureTime),this.failureTime=null),this.iframeUploadTime&&(clearTimeout(this.iframeUploadTime),this.iframeUploadTime=null),this.removeEventListener(),this.popupObj&&!this.popupObj.isDestroyed&&(this.popupObj.destroy(),this.popupObj=null),this.uploadObj&&!this.uploadObj.isDestroyed&&(this.uploadObj.destroy(),this.uploadObj=null),this.keepRadioButton&&!this.keepRadioButton.isDestroyed&&(this.keepRadioButton.destroy(),this.keepRadioButton=null),this.cleanRadioButton&&!this.cleanRadioButton.isDestroyed&&(this.cleanRadioButton.destroy(),this.cleanRadioButton=null),this.plainTextRadioButton&&!this.plainTextRadioButton.isDestroyed&&(this.plainTextRadioButton.destroy(),this.plainTextRadioButton=null),this.isDestroyed=!0,this.plainTextContent="")},ait.prototype.removeEventListener=function(){this.parent.off(S5e,this.pasteClean),this.parent.off(uWe,this.setCssClass),this.parent.off(t4e,this.destroy),this.parent.off(v5e,this.docClick)},ait.prototype.pasteClean=function(t){var i,n=this,o={requestType:"Paste",editorMode:this.parent.editorMode,event:t},r=null,e=this.parent.insertImageSettings.allowedTypes;if(t.args&&!je(t.args.clipboardData)&&(r=t.args.clipboardData.getData("text/html"),t.args.clipboardData.getData("text/plain"))&&(this.plainTextContent=t.args.clipboardData.getData("text/plain")),t.args&&null!==r&&"HTML"===this.parent.editorMode){if(0===r.length){var s=new RegExp(/<\/[a-z][\s\S]*>/i),r=t.args.clipboardData.getData("text/plain");if(this.parent.trigger(eWe,{value:r}),this.isNotFromHtml=""!==r,r=(r=r.replace(/</g,"&lt;")).replace(/>/g,"&gt;"),this.containsHtml=s.test(r),this.plainTextContent=r,h=t&&t.args.clipboardData&&0<t.args.clipboardData.items.length?null===t.args.clipboardData.items[0].getAsFile()?je(t.args.clipboardData.items[1])?null:t.args.clipboardData.items[1].getAsFile():t.args.clipboardData.items[0].getAsFile():null){var a=h.name,l=a.substring(a.lastIndexOf("."));if(e.every(function(e){return e.toLowerCase()!==l}))return void t.args.preventDefault()}this.parent.notify(m5e,{file:h,args:t.args,text:r,callBack:function(e){"object"==typeof(i=e)?n.parent.formatter.editorManager.execCommand("Images","Image",t.args,n.imageFormatting.bind(n,o),"pasteCleanup",i,"pasteCleanupModule"):r=i}}),s.test(r)||((a=this.parent.createElement("div")).innerHTML=this.splitBreakLine(r),r=a.innerHTML)}else 0<r.length&&(this.parent.trigger(eWe,{value:r}),this.parent.formatter.editorManager.observer.notify(d7e,{args:t.args,text:t.text,allowedStylePropertiesArray:this.parent.pasteCleanupSettings.allowedStyleProps,callBack:function(e,t,i){o.pasteTableSource=i,r=e.trim(),n.cropImageData=t}}));null!==r&&""!==r&&(r=r.replace(/<base[^>]*>/g,"")),this.contentRenderer=this.renderFactory.getRenderer(q3e.Content);for(var e=this.contentRenderer.getDocument(),h=this.nodeSelectionObj.getRange(e),s=(this.saveSelection=this.nodeSelectionObj.save(h,e),this.parent.createElement("div")),d=(s.innerHTML=r,s.querySelectorAll(".e-rte-image-unsupported")),p=0;p<d.length;p++)d[p].setAttribute("alt",this.i10n.getConstant("unsupportedImage")),d[p].classList.remove("e-rte-image-unsupported");r=s.innerHTML;a=""!==s.textContent||!je(s.querySelector("img"))||!je(s.querySelector("table"));this.parent.notify(bWe,{value:r,callBack:function(e){r=e}}),this.parent.pasteCleanupSettings.prompt&&!t.isPlainPaste?a&&(t.args.preventDefault(),this.pasteDialog(r,o)):this.parent.pasteCleanupSettings.plainText?(t.args.preventDefault(),this.plainFormatting(r,o)):this.parent.pasteCleanupSettings.keepFormat||t.isPlainPaste?(t.args.preventDefault(),this.formatting(r,!1,o)):(t.args.preventDefault(),this.formatting(r,!0,o))}},ait.prototype.splitBreakLine=function(e){for(var t=e.split("\r\n\r\n"),i="",n="P"===this.parent.enterKey?"<p>":"DIV"===this.parent.enterKey?"<div>":"",o="P"===this.parent.enterKey?"</p>":"DIV"===this.parent.enterKey?"</div>":"<br>",r=0;r<t.length;r++){var s=t[r],s=this.makeSpace(s).replace(/\r\n|\n/g,"<br>");0===r?"BR"===this.parent.enterKey?i+=s+o:i+=s:"BR"===this.parent.enterKey?r===t.length-1?i+=s+o:i+=s+o+o:i+=n+s+o}return i},ait.prototype.makeSpace=function(e){var t="";if(""===e)return e;for(var i=e.split(" "),n=0;n<i.length;n++){var o=i[n];""===o?t+="&nbsp;":"\t"===o?t+="&nbsp;&nbsp;&nbsp;&nbsp;":(0<n&&n<i.length&&(t+=" "),t+=o)}return t=(t=t.replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;")).replace(/&nbsp;&nbsp;/g,"&nbsp; ")},ait.prototype.imgUploading=function(e){var t=e.querySelectorAll(".pasteContent_Img");if(this.parent.insertImageSettings.saveUrl&&0<t.length){for(var i=[],n=[],o=[],r=0;r<t.length;r++)!je(t[r].getAttribute("src"))&&0<=t[r].getAttribute("src").split(",")[0].indexOf("base64")&&(i.push(t[r].getAttribute("src")),n.push(D("rte_image")),o.push(t[r]));for(var s=[],r=0;r<i.length;r++)s.push(this.base64ToFile(i[r],n[r]));for(r=0;r<s.length;r++)this.uploadMethod(s[r],o[r]);je(this.parent.insertImageSettings.path)&&"Blob"===this.parent.insertImageSettings.saveFormat&&this.getBlob(t)}else"Blob"===this.parent.insertImageSettings.saveFormat&&this.getBlob(t);for(var a=e.querySelectorAll(".pasteContent_Img"),r=0;r<a.length;r++)a[r].classList.remove("pasteContent_Img"),""===a[r].getAttribute("class").trim()&&t[r].removeAttribute("class")},ait.prototype.getBlob=function(e){for(var t,i=0;i<e.length;i++)!je(e[i].getAttribute("src"))&&0<=e[i].getAttribute("src").split(",")[0].indexOf("base64")&&(t=URL.createObjectURL(U6e(e[i].getAttribute("src"))),e[i].setAttribute("src",t))},ait.prototype.toolbarEnableDisable=function(e){this.parent.inlineMode.enable||this.parent.toolbarModule.baseToolbar.toolbarObj.disable(e)},ait.prototype.uploadMethod=function(e,t){var i=this,n=(t.style.opacity="0.5",this.parent.createElement("div")),o=(this.parent.rootContainer.appendChild(n),this.parent.createElement("input",{id:this.parent.getID()+"_upload",attrs:{type:"File",name:"UploadFiles"}})),r=this.parent.iframeSettings.enable?-50:-90,n=(this.popupObj=new Sv(n,{relateTo:t,height:"85px",width:"300px",offsetY:r,content:o,viewPortElement:this.parent.element,position:{X:"center",Y:"top"},enableRtl:this.parent.enableRtl,zIndex:10001,close:function(e){i.parent.isBlur=!1,i.popupObj.destroy(),G(i.popupObj.element)}}),this.popupObj.element.style.display="none",U([this.popupObj.element],[xQe,AQe]),je(this.parent.cssClass)||U([this.popupObj.element],this.parent.cssClass.replace(/\s+/g," ").trim().split(" ")),1e6<e.size?300:100),r=(this.refreshPopupTime=setTimeout(function(){i.refreshPopup(t,i.popupObj)},n),this.uploadObj=new GN({asyncSettings:{saveUrl:this.parent.insertImageSettings.saveUrl,removeUrl:this.parent.insertImageSettings.removeUrl},cssClass:MQe,dropArea:this.parent.inputElement,allowedExtensions:this.parent.insertImageSettings.allowedTypes.toString(),success:function(e){i.popupClose(i.popupObj,i.uploadObj,t,e)},uploading:function(e){i.parent.isServerRendered||i.parent.trigger(L5e,e,function(e){e.cancel?(je(t)||G(t),je(i.popupObj.element)||G(i.popupObj.element)):i.parent.inputElement.contentEditable="false"})},beforeUpload:function(e){i.parent.trigger(Y5e,e),i.toolbarEnableDisable(!0)},failure:function(e){i.failureTime=setTimeout(function(){i.uploadFailure(t,i.uploadObj,i.popupObj,e)},900)},canceling:function(){i.parent.inputElement.contentEditable="true"," "===t.nextSibling.textContent&&G(t.nextSibling),G(t),i.popupObj.close()},selected:function(e){e.cancel=!0},removing:function(){i.parent.inputElement.contentEditable="true"," "===t.nextSibling.textContent&&G(t.nextSibling),G(t),i.popupObj.close()}}),this.uploadObj.appendTo(this.popupObj.element.childNodes[0]),[{name:e.name,rawFile:e,size:e.size,type:e.type,status:"Ready to Upload",validationMessages:{minSize:"",maxSize:""},statusCode:"1"}]);this.uploadObj.createFileList(r),this.uploadObj.upload(r),this.popupObj.element.getElementsByClassName("e-file-select-wrap")[0].style.display="none",G(this.popupObj.element.querySelector(".e-rte-dialog-upload .e-file-select-wrap"))},ait.prototype.uploadFailure=function(e,t,i,n){this.parent&&this.parent.isDestroyed||(this.parent.inputElement.contentEditable="true",G(e),i&&(this.parent.isBlur=!1,i.destroy(),je(i.element)||G(i.element)),this.parent.trigger(O5e,n),t&&document.body.contains(t.element)&&t.destroy())},ait.prototype.popupClose=function(o,r,s,e){var a=this,t=(this.parent.inputElement.contentEditable="true",e.element=s,e.detectImageSource=X3e.Pasted,e.file);"2"===t.statusCode?this.parent.trigger(R5e,e,function(e){if(!je(a.parent.insertImageSettings.path)){var t=a.parent.insertImageSettings.path+e.file.name;if(!a.parent.inputElement.contains(s)&&s.id)for(var i=a.parent.inputElement.querySelectorAll("#"+s.id),n=0;n<i.length;n++){var o=i[n];o&&o.style&&"0.5"===o.style.opacity&&(o.src=t,o.setAttribute("alt",e.file.name))}else s.src=t,s.setAttribute("alt",e.file.name)}}):"5"===t.statusCode&&this.parent.trigger(N5e,e,function(e){je(e.element.src)||(e.element.src="")}),this.popupCloseTime=setTimeout(function(){if(o&&(a.parent.isBlur=!1,o.destroy(),je(o.element)||G(o.element)),a.parent.inputElement.contains(s)||!s.id&&!s.alt)s.style.opacity="1";else{var e=s.id?"#"+s.id:'[alt="'+s.alt+'"]';if(e)for(var t=a.parent.inputElement.querySelectorAll(e),i=0;i<t.length;i++){var n=t[i];n&&n.style&&"0.5"===n.style.opacity&&(n.style.opacity="1")}}a.toolbarEnableDisable(!1),r&&document.body.contains(r.element)&&r.destroy()},1500)},ait.prototype.refreshPopup=function(e,t){var i=this.parent.iframeSettings.enable?this.parent.element.offsetTop+e.offsetTop:e.offsetTop;this.parent.element.offsetTop+this.parent.element.offsetHeight<i?(t.relateTo=this.parent.inputElement,t.offsetY=this.parent.iframeSettings.enable?-30:-65,t.element.style.display="block"):t&&(t.refreshPosition(e),t.element.style.display="block")},ait.prototype.base64ToFile=function(e,t){for(var e=e.split(","),i=e[0].match(/:(.*?);/)[1].split("/")[1],n=atob(e[1]),o=n.length,r=new Uint8Array(o);o--;)r[o]=n.charCodeAt(o);return F.isIE||-1<navigator.appVersion.indexOf("Edge")?(Pe(e=new Blob([r],{type:i}),{name:t+"."+(je(i)?"":i)}),e):new File([r],t+"."+(je(i)?"":i),{type:i})},ait.prototype.imageFormatting=function(e,t){je(t.elements[0].getAttribute("src"))||t.elements[0].classList.add("pasteContent_Img");var i=this.parent.createElement("span"),t=(i.appendChild(t.elements[0]),i.innerHTML),i=(this.contentRenderer=this.renderFactory.getRenderer(q3e.Content),this.contentRenderer.getDocument()),n=this.nodeSelectionObj.getRange(i);this.saveSelection=this.nodeSelectionObj.save(n,i),this.parent.pasteCleanupSettings.prompt?this.pasteDialog(t,e):this.parent.pasteCleanupSettings.plainText?this.plainFormatting(t,e):this.parent.pasteCleanupSettings.keepFormat?this.formatting(t,!1,e):this.formatting(t,!0,e)},ait.prototype.radioRender=function(){this.keepRadioButton=new cb({label:this.i10n.getConstant("keepFormat"),name:"pasteOption",checked:!0}),this.keepRadioButton.isStringTemplate=!0;var e=this.parent.element.querySelector("#keepFormating"),e=(this.keepRadioButton.appendTo(e),this.cleanRadioButton=new cb({label:this.i10n.getConstant("cleanFormat"),name:"pasteOption"}),this.cleanRadioButton.isStringTemplate=!0,this.parent.element.querySelector("#cleanFormat")),e=(this.cleanRadioButton.appendTo(e),this.plainTextRadioButton=new cb({label:this.i10n.getConstant("plainText"),name:"pasteOption"}),this.plainTextRadioButton.isStringTemplate=!0,this.parent.element.querySelector("#plainTextFormat"));this.plainTextRadioButton.appendTo(e)},ait.prototype.selectFormatting=function(e,t,i,n){i?this.formatting(e,!1,t):n?this.formatting(e,!0,t):this.plainFormatting(e,t)},ait.prototype.pasteDialog=function(n,o){var r=this,e={buttons:[{click:function(){var e,t,i;r.dialogObj.isDestroyed||(e=r.parent.element.querySelector("#keepFormating").checked,t=r.parent.element.querySelector("#cleanFormat").checked,r.dialogObj.hide(),i=r.dialogObj,r.dialogRenderObj.close(i),r.dialogObj.destroy(),r.selectFormatting(n,o,e,t))},buttonModel:{isPrimary:!0,cssClass:"e-flat "+cQe,content:this.i10n.getConstant("pasteDialogOk")}},{click:function(){var e;r.dialogObj.isDestroyed||(r.dialogObj.hide(),e=r.dialogObj,r.dialogRenderObj.close(e),r.dialogObj.destroy())},buttonModel:{cssClass:"e-flat "+uQe,content:this.i10n.getConstant("pasteDialogCancel")}}],header:this.i10n.getConstant("pasteFormat"),content:this.i10n.getConstant("pasteFormatContent")+'<br/><div><div style="padding-top:24px;"><input type="radio" class="'+hQe+'" id="keepFormating"/></div><div style="padding-top:20px;"><input type="radio" class="'+dQe+'" id="cleanFormat"/></div><div style="padding-top:20px;"><input type="radio" class="'+pQe+'" id="plainTextFormat"/></div></div>',target:this.parent.element,width:"300px",height:"265px",cssClass:gQe,isModal:F.isDevice,visible:!1},e=(this.dialogObj=this.dialogRenderObj.render(e),this.parent.element.querySelector("#"+this.parent.getID()+"_pasteCleanupDialog"));null!==e&&""!==e.innerHTML&&this.destroyDialog(e),null===e&&(e=this.parent.createElement("div",{id:this.parent.getID()+"_pasteCleanupDialog"}),this.parent.rootContainer.appendChild(e)),this.dialogObj.appendTo(e),this.radioRender(),this.dialogObj.show(),this.setCssClass({cssClass:this.parent.getCssClass()})},ait.prototype.updateCss=function(e,t){e&&t.cssClass&&(je(t.oldCssClass)?e.setProperties({cssClass:(e.cssClass+" "+t.cssClass).trim()}):e.setProperties({cssClass:(e.cssClass.replace(t.oldCssClass,"").trim()+" "+t.cssClass).trim()}))},ait.prototype.setCssClass=function(e){this.popupObj&&e.cssClass&&(je(e.oldCssClass)||q([this.popupObj.element],e.oldCssClass),U([this.popupObj.element],e.cssClass)),this.updateCss(this.dialogObj,e),this.updateCss(this.uploadObj,e),this.updateCss(this.plainTextRadioButton,e),this.updateCss(this.cleanRadioButton,e),this.updateCss(this.keepRadioButton,e)},ait.prototype.destroyDialog=function(e){G(this.parent.element.querySelector(".e-rte-dialog-minheight"));for(var t=e.children.length,i=0;i<t;i++)G(e.children[0])},ait.prototype.docClick=function(e){e=e.args.target;e&&e.classList&&this.dialogObj&&!z(e,"[id='"+this.dialogObj.element.id+"']")&&!e.classList.contains("e-toolbar-item")&&this.dialogObj&&this.dialogObj.hide()},ait.prototype.cleanAppleClass=function(e){for(var t=e.querySelectorAll("br.Apple-interchange-newline"),i=0;i<t.length;i++)G(t[i]);return e},ait.prototype.formatting=function(t,e,i){for(var n=this,o=this.parent.createElement("div",{className:"pasteContent",styles:"display:inline;"}),e=(this.isNotFromHtml&&this.containsHtml&&(t=this.splitBreakLine(t)),o.innerHTML=t,o=this.cleanAppleClass(o),null!==this.parent.pasteCleanupSettings.deniedTags&&(o=this.deniedTags(o)),(e||null!==this.parent.pasteCleanupSettings.deniedAttrs)&&(o=this.deniedAttributes(o,e)),null!==this.parent.pasteCleanupSettings.allowedStyleProps&&(o=this.allowedStyle(o)),this.saveSelection.restore(),o.innerHTML.split("&").join("&amp;")),r=(o.innerHTML=this.sanitizeHelper(e),o.querySelectorAll("img")),s=0;s<r.length;s++)je(r[s].getAttribute("src"))||r[s].classList.add("pasteContent_Img"),this.setImageProperties(r[s]);if(this.addTempClass(o),0<o.querySelectorAll("picture").length&&this.processPictureElement(o),""!==o.textContent||!je(o.querySelector("img"))||!je(o.querySelector("table"))){var e=this.parent.createElement("div"),a=(e.innerHTML=t,[]);if(!je(e.querySelector("img"))){for(var l=e.querySelectorAll("img"),h=[],d=[],p=[],s=0;s<l.length;s++)l[s].getAttribute("src")&&0<=l[s].getAttribute("src").split(",")[0].indexOf("base64")&&(h.push(l[s].getAttribute("src")),d.push(D("rte_image")),p.push(l[s]));for(var c,u=[],s=0;s<h.length;s++)u.push(this.base64ToFile(h[s],d[s])),c={name:u[s].name,rawFile:u[s],size:u[s].size,type:u[s].type,status:"",validationMessages:{minSize:"",maxSize:""},statusCode:"1"},a.push(c)}this.parent.trigger(tWe,{value:o.innerHTML,filesData:a},function(e){t=e.value}),o.innerHTML=this.parent.addAnchorAriaLabel(t),o=this.addTableClass(o,i.pasteTableSource),this.parent.formatter.editorManager.execCommand("inserthtml","pasteCleanup",i,function(e){Pe(i,{elements:e.elements,imageElements:e.imgElem},!0),n.parent.formatter.onSuccess(n.parent,i)},o,null,null,this.parent.enterKey),this.parent.notify(IWe,{}),qUe(this.parent.contentModule.getDocument(),this.parent.inputElement),this.removeTempClass(),this.parent.notify(n4e,{}),this.cropImageHandler(this.parent.inputElement)}},ait.prototype.convertBlobToBase64=function(e){for(var r=e.querySelectorAll("img"),t=0;t<r.length;t++)!function(i){var e,n,o;r[i].getAttribute("src")&&r[i].getAttribute("src").startsWith("blob")&&(e=r[i].getAttribute("src"),n=new Image,o=function(){var e=document.createElement("canvas"),t=e.getContext("2d"),t=(e.width=n.width,e.height=n.height,t.drawImage(n,0,0),e.toDataURL("image/png"));r[i].src=t,n.removeEventListener("load",o)},n.src=e,n.addEventListener("load",o))}(t)},ait.prototype.cropImageHandler=function(e){var l=this,h=e.querySelectorAll(".e-img-cropped");if(0<h.length)for(var t=0;t<h.length;t++)!function(o){var r,s,a;0<=h[o].getAttribute("src").split(",")[0].indexOf("base64")&&((r=new Image).src=h[o].getAttribute("src"),s=document.createElement("canvas"),a=s.getContext("2d"),r.onload=function(){var e=l.cropImageData[o].goalWidth/r.naturalWidth,t=l.cropImageData[o].goalHeight/r.naturalHeight,i=l.cropImageData[o].cropLength/e,n=l.cropImageData[o].cropTop/t,e=(l.cropImageData[o].goalWidth-l.cropImageData[o].cropLength-l.cropImageData[o].cropR)/e,t=(l.cropImageData[o].goalHeight-l.cropImageData[o].cropTop-l.cropImageData[o].cropB)/t,i=(s.width=e,s.height=t,a.drawImage(r,i,n,e,t,0,0,e,t),s.toDataURL("image/png"));h[o].setAttribute("src",i),h[o].classList.remove("e-img-cropped"),l.imgUploading(l.parent.inputElement),l.parent.iframeSettings.enable&&l.parent.updateValue()})}(t);else!je(this.parent.insertImageSettings.saveUrl)&&!je(this.parent.insertImageSettings.path)&&0<this.parent.inputElement.querySelectorAll("img").length&&this.parent.inputElement.querySelectorAll("img")[0].src.startsWith("blob")?(this.convertBlobToBase64(this.parent.inputElement),this.iframeUploadTime=setTimeout(function(){l.imgUploading(l.parent.inputElement),l.parent.iframeSettings.enable&&l.parent.updateValue()},20)):(this.imgUploading(this.parent.inputElement),this.parent.iframeSettings.enable&&this.parent.updateValue())},ait.prototype.addTableClass=function(e,t){for(var i=e.querySelectorAll("table"),n=0;n<i.length;n++){var o="FIGURE"===i[n].parentElement.nodeName;0<i[n].classList.length&&i[n].classList.contains("e-rte-custom-table")||(this.parent.pasteCleanupSettings.keepFormat&&t&&!o?i[n].classList.add("e-rte-paste-"+t+"-table"):i[n].classList.contains("e-rte-table")||i[n].classList.add("e-rte-table"),je(i[n].nextElementSibling)&&i[n].nextSibling&&!i[n].nextSibling.textContent.trim()&&G(i[n].nextSibling))}return e},ait.prototype.setImageProperties=function(e){"auto"!==this.parent.insertImageSettings.width&&e.setAttribute("width",this.parent.insertImageSettings.width),"0"!==this.parent.insertImageSettings.minWidth&&0!==this.parent.insertImageSettings.minWidth&&(e.style.minWidth=this.parent.insertImageSettings.minWidth.toString()),null!==this.parent.insertImageSettings.maxWidth&&(e.style.maxWidth=this.parent.getInsertImgMaxWidth().toString()),"auto"!==this.parent.insertImageSettings.height&&e.setAttribute("height",this.parent.insertImageSettings.height),"0"!==this.parent.insertImageSettings.minHeight&&0!==this.parent.insertImageSettings.minHeight&&(e.style.minHeight=this.parent.insertImageSettings.minHeight.toString()),null!==this.parent.insertImageSettings.maxHeight&&(e.style.maxHeight=this.parent.insertImageSettings.maxHeight.toString())},ait.prototype.addTempClass=function(e){for(var t=e.children,i=0;i<t.length;i++)t[i].classList.add("pasteContent_RTE")},ait.prototype.removeTempClass=function(){for(var e=this.parent.inputElement.querySelectorAll(".pasteContent_RTE"),t=0;t<e.length;t++)e[t].classList.remove("pasteContent_RTE"),""===e[t].getAttribute("class")&&e[t].removeAttribute("class")},ait.prototype.sanitizeHelper=function(e){return e=W6e(e,this.parent)},ait.prototype.plainFormatting=function(t,i){var n=this,e=this.parent.createElement("div",{className:"pasteContent"}),o=(this.plainTextContent=this.plainTextContent.replace(/</g,"&lt;"),this.plainTextContent=this.plainTextContent.replace(/>/g,"&gt;"),this.sanitizeHelper(this.plainTextContent)),o=this.splitBreakLine(o);e.innerHTML=o,""!==e.textContent.trim()?(this.saveSelection.restore(),this.parent.trigger(tWe,{value:e.innerHTML,filesData:null},function(e){t=e.value}),e.innerHTML=t,this.parent.formatter.editorManager.execCommand("inserthtml","pasteCleanup",i,function(e){Pe(i,{elements:e.elements,imageElements:e.imgElem},!0),n.parent.formatter.onSuccess(n.parent,i)},e,null,null,this.parent.enterKey),this.removeTempClass()):(this.saveSelection.restore(),Pe(i,{elements:[]},!0),this.parent.formatter.onSuccess(this.parent,i))},ait.prototype.tagGrouping=function(e){for(var t=e.slice(),i=Object.keys(_Ue),n=i.map(function(e){return _Ue[""+e]}),o=[],r=0;r<t.length;r++)if(1<t[r].split("[").length&&(t[r]=t[r].split("[")[0].trim()),-1<i.indexOf(t[r]))for(var s=0;s<n[i.indexOf(t[r])].length;s++)t.indexOf(n[i.indexOf(t[r])][s])<0&&o.indexOf(n[i.indexOf(t[r])][s])<0&&o.push(n[i.indexOf(t[r])][s]);return e.concat(o)},ait.prototype.attributesfilter=function(e){for(var t=0;t<e.length;t++)if(1<e[t].split("[").length){for(var i=e[t].split("[")[1].split("]")[0].split(","),n=[],o=[],r=0;r<i.length;r++)i[r].indexOf("!")<0?n.push(i[r].trim()):o.push(i[r].split("!")[1].trim());var s,a=1<n.length?n.join("]["):n.join(),l=1<o.length?o.join("]["):o.join();0<l.length?(s=""!==a?e[t].split("[")[0]+"["+a+"]":e[t].split("[")[0],e[t]=s+":not(["+l+"])"):e[t]=e[t].split("[")[0]+"["+a+"]"}return e},ait.prototype.deniedTags=function(e){var t=je(this.parent.pasteCleanupSettings.deniedTags)?[]:this.parent.pasteCleanupSettings.deniedTags.slice(),t=this.attributesfilter(t);t=this.tagGrouping(t);for(var i=0;i<t.length;i++)for(var n=e.querySelectorAll(t[i]),o=n.length-1;0<=o;o--){for(var r=n[o].parentNode;n[o].firstChild;)r.insertBefore(n[o].firstChild,n[o]);r.removeChild(n[o])}return e},ait.prototype.deniedAttributes=function(e,t){var i=je(this.parent.pasteCleanupSettings.deniedAttrs)?[]:this.parent.pasteCleanupSettings.deniedAttrs.slice();t&&i.push("style");for(var n=0;n<i.length;n++)for(var o=e.querySelectorAll("["+i[n]+"]"),r=0;r<o.length;r++)o[r].removeAttribute(i[n]);return e},ait.prototype.allowedStyle=function(e){for(var t=je(this.parent.pasteCleanupSettings.allowedStyleProps)?[]:this.parent.pasteCleanupSettings.allowedStyleProps.slice(),i=(t.push("list-style-type","list-style"),e.querySelectorAll("[style]")),n=0;n<i.length;n++){for(var o,r=[],s=i[n].getAttribute("style").split(";"),a=0;a<s.length;a++)0<=t.indexOf(s[a].split(":")[0].trim())&&r.push(s[a]);i[n].removeAttribute("style"),(o=""===r.join(";").trim()?r.join(";"):r.join(";")+";")&&(i[n].style.cssText+=o)}return e},ait.prototype.processPictureElement=function(e){for(var t=e.querySelectorAll("picture"),i=this.parent.contentModule.getDocument().baseURI,n=0;n<t.length;n++){var o=t[n].querySelector("img"),r=t[n].querySelectorAll("source");if(o&&o.getAttribute("src"))for(var o=o.getAttribute("src"),s=-1<o.indexOf("http")?new URL(o):new URL(o,i),a=0;a<r.length;a++){var l=r[a].getAttribute("srcset");l&&-1===l.indexOf("http")&&(l=s.origin+l,r[a].setAttribute("srcset",l))}}},ait.prototype.getModuleName=function(){return"pasteCleanup"};var sit=ait;function ait(e,t){this.isNotFromHtml=!1,this.containsHtml=!1,this.cropImageData=[],this.plainTextContent="",this.parent=e,this.locator=t,this.renderFactory=this.locator.getService("rendererFactory"),this.i10n=t.getService("rteLocale"),this.dialogRenderObj=t.getService("dialogRenderObject"),this.addEventListener(),this.isDestroyed=!1}lit.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on($3e,this.renderResizable,this),this.parent.on(t4e,this.destroy,this))},lit.prototype.renderResizable=function(){var t=this,e=this.parent.enableRtl?NQe:fQe;this.resizer=this.parent.createElement("div",{id:this.parent.getID()+"-resizable",className:"e-icons "+mQe+" "+e}),this.parent.element.classList.add(kQe),this.parent.rootContainer.appendChild(this.resizer),this.parent.rootContainer.classList.add("e-resize-enabled"),this.parent.iframeSettings.enable&&(this.parent.inputElement.classList.add("e-resize-enabled"),this.parent.contentModule.getDocument().addEventListener("mouseup",this.iframeMouseUpBoundFn)),this.iframeElement=this.parent.contentModule.getDocument().querySelectorAll("iframe"),je(this.iframeElement)||this.iframeElement.forEach(function(e){E.add(e,"load",t.onIFrameLoad,t)}),this.touchStartEvent="msie"===F.info.name?"pointerdown":"touchstart",E.add(this.resizer,"mousedown",this.resizeStart,this),E.add(this.resizer,this.touchStartEvent,this.resizeStart,this)},lit.prototype.onIFrameLoad=function(e){e=e.target;"IFRAME"===e.nodeName&&e.contentDocument&&E.add(e.contentDocument,"mouseup",this.stopResize,this)},lit.prototype.removeMouseUpEventListener=function(e){e.contentDocument&&E.remove(e.contentDocument,"mouseup",this.stopResize)},lit.prototype.resizeStart=function(e){var t=this,e=(this.isResizing=!1,e.cancelable&&e.preventDefault(),this.wireResizeEvents(),this.parent.notify(K5e,{}),{event:e,requestType:"editor"});this.parent.trigger(M4e,e,function(e){e.cancel&&t.unwireResizeEvents()})},lit.prototype.performResize=function(e){var t,i=this,n=(this.isResizing=!0,{event:e,requestType:"editor"}),n=(this.parent.trigger(k4e,n,function(e){e.cancel&&i.unwireResizeEvents()}),this.parent.element.getBoundingClientRect()),o=(this.isMouseEvent(e)?(this.parent.element.style.height=e.clientY-n.top+"px",this.parent.element.style.width=this.parent.enableRtl?n.right-e.clientX+"px":e.clientX-n.left+"px",!this.parent.toolbarModule||je(t=this.parent.toolbarModule.getToolbarElement())||je(t.parentElement)||t.parentElement.classList.contains(HWe)&&this.parent.toolbarSettings.enableFloating&&this.parent.getToolbar()&&!this.parent.inlineMode.enable&&(o=this.parent.contentModule.getPanel().getBoundingClientRect().width,t.style.width=o+"px")):(t="msie"!==F.info.name?e.touches[0]:e,this.parent.element.style.height=t.clientY-n.top+"px",this.parent.element.style.width=this.parent.enableRtl?n.right-t.clientX+"px":t.clientX-n.left+"px"),this.parent.element.querySelector("#"+this.parent.getID()+"_source-view"));je(o)||(o.style.height=this.parent.element.style.height),this.parent.refreshUI()},lit.prototype.stopResize=function(e){this.isResizing=!1,this.parent.refreshUI(),this.unwireResizeEvents(),this.parent.trigger(P4e,{event:e,requestType:"editor"})},lit.prototype.getEventType=function(e){return-1<e.indexOf("mouse")?"mouse":"touch"},lit.prototype.isMouseEvent=function(e){var t=!1;return t="mouse"!==this.getEventType(e.type)&&(je(e.pointerType)||"mouse"!==this.getEventType(e.pointerType))?t:!0},lit.prototype.wireResizeEvents=function(){E.add(document,"mousemove",this.performResize,this),E.add(document,"mouseup",this.stopResize,this),this.touchMoveEvent="msie"===F.info.name?"pointermove":"touchmove",this.touchEndEvent="msie"===F.info.name?"pointerup":"touchend",E.add(document,this.touchMoveEvent,this.performResize,this),E.add(document,this.touchEndEvent,this.stopResize,this)},lit.prototype.unwireResizeEvents=function(){E.remove(document,"mousemove",this.performResize),E.remove(document,"mouseup",this.stopResize),E.remove(document,this.touchMoveEvent,this.performResize),E.remove(document,this.touchEndEvent,this.stopResize)},lit.prototype.destroy=function(){this.isDestroyed||(this.removeEventListener(),this.resizer&&(G(this.resizer),this.resizer=null),this.isDestroyed=!0)},lit.prototype.removeEventListener=function(){var t=this;this.parent.off($3e,this.renderResizable),this.parent.element.classList.remove(kQe),this.parent&&this.parent.rootContainer&&this.parent.rootContainer.classList.contains("e-resize-enabled")&&this.parent.rootContainer.classList.remove("e-resize-enabled"),this.parent.iframeSettings.enable&&!je(this.parent.inputElement)&&(this.parent.inputElement.classList.remove("e-resize-enabled"),this.parent.contentModule.getDocument().removeEventListener("mouseup",this.iframeMouseUpBoundFn)),je(this.iframeElement)||this.iframeElement.forEach(function(e){t.removeMouseUpEventListener(e),E.remove(e,"load",t.onIFrameLoad)}),this.resizer&&(E.remove(this.resizer,"mousedown",this.resizeStart),E.remove(this.resizer,this.touchStartEvent,this.resizeStart),G(this.resizer)),this.parent.off(t4e,this.destroy),this.iframeMouseUpBoundFn=null},lit.prototype.iframeMouseUp=function(e){this.isResizing&&this.stopResize(e)},lit.prototype.getModuleName=function(){return"resize"};Z$e=lit;function lit(e){this.parent=e,this.addEventListener(),this.isDestroyed=!1,this.isResizing=!1,this.iframeMouseUpBoundFn=this.iframeMouseUp.bind(this)}dit.prototype.initialize=function(){this.contentModule=this.rendererFactory.getRenderer(q3e.Content)},dit.prototype.render=function(e){var t=e.selectNode&&"IMG"===e.selectNode[0].nodeName?this.parent.localeObj.getConstant("dialogUpdate"):this.i10n.getConstant("dialogInsert"),i=this.parent.localeObj.getConstant("fileDialogHeader"),n=this.i10n.getConstant("dialogCancel"),t=(this.dlgButtons=[{click:this.insertImageBoundFn,buttonModel:{content:t,cssClass:"e-flat e-insertImage",isPrimary:!0,disabled:!0}},{click:this.cancelDialogBoundFn,buttonModel:{cssClass:"e-flat e-cancel",content:n}}],this.selectObj={selection:e.selection,args:e.args,selectParent:e.selectParent},this.parent.createElement("div",{className:"e-rte-file-manager-dialog",id:this.parent.getID()+"_file-manager-dialog",attrs:{"aria-owns":this.parent.getID()}})),n=(document.body.appendChild(t),this.fileWrap=this.parent.createElement("div",{id:this.parent.getID()+"_rte-file-manager",className:"e-img-file-wrap"}),t.appendChild(this.fileWrap),t.appendChild(this.getInputUrlElement()),{visible:!1,isModal:!0,header:i,target:document.body,locale:this.parent.locale,enableRtl:this.parent.enableRtl,cssClass:L8e,animationSettings:{effect:"None"},showCloseIcon:!0,closeOnEscape:!0,width:"720px",height:"auto",position:{X:"center",Y:"center"},buttons:this.dlgButtons,created:this.renderFileManagerBoundFn,close:this.dialogClosedBoundFn});this.dialogObj=this.dialogRenderObj.render(n),this.dialogObj.createElement=this.parent.createElement,this.dialogObj.appendTo(t),this.dialogObj.show(!!F.isDevice),this.setCssClass({cssClass:this.parent.getCssClass()})},dit.prototype.setCssClass=function(e){this.dialogObj&&e.cssClass&&(je(e.oldCssClass)?this.dialogObj.setProperties({cssClass:(this.dialogObj.cssClass+" "+e.cssClass).trim()}):this.dialogObj.setProperties({cssClass:(this.dialogObj.cssClass.replace(e.oldCssClass,"").trim()+" "+e.cssClass).trim()}))},dit.prototype.dialogClosed=function(e){this.parent.isBlur=!1,e&&e.event.returnValue&&this.selectObj.selection.restore(),this.destroyComponents(),this.parent.element.ownerDocument.removeEventListener("mousedown",this.onDocumentClickBoundFn),this.dialogRenderObj.close(e)},dit.prototype.renderFileManager=function(){var t=this;this.fileObj=new f$e({allowMultiSelection:!1,locale:this.parent.locale,enableRtl:this.parent.enableRtl,path:this.parent.fileManagerSettings.path,view:this.parent.fileManagerSettings.view,enablePersistence:this.parent.enablePersistence,cssClass:this.parent.fileManagerSettings.cssClass,sortOrder:this.parent.fileManagerSettings.sortOrder,ajaxSettings:this.parent.fileManagerSettings.ajaxSettings,showThumbnail:this.parent.fileManagerSettings.showThumbnail,rootAliasName:this.parent.fileManagerSettings.rootAliasName,uploadSettings:this.parent.fileManagerSettings.uploadSettings,searchSettings:this.parent.fileManagerSettings.searchSettings,toolbarSettings:this.parent.fileManagerSettings.toolbarSettings,showHiddenItems:this.parent.fileManagerSettings.showHiddenItems,allowDragAndDrop:this.parent.fileManagerSettings.allowDragAndDrop,showFileExtension:this.parent.fileManagerSettings.showFileExtension,detailsViewSettings:this.parent.fileManagerSettings.detailsViewSettings,contextMenuSettings:this.parent.fileManagerSettings.contextMenuSettings,navigationPaneSettings:this.parent.fileManagerSettings.navigationPaneSettings,beforeSend:this.parent.fileManagerSettings.beforeSend,fileSelect:function(e){e=e.fileDetails;e.isFile&&-1<t.parent.insertImageSettings.allowedTypes.indexOf(e.type)?(t.inputUrl.value=t.parent.fileManagerSettings.ajaxSettings.getImageUrl+"?path="+(e.filterPath&&e.filterPath.replace(/\\/g,"/"))+e.name,t.dlgButtons[0].buttonModel.disabled=!1):(t.inputUrl.value="",t.dlgButtons[0].buttonModel.disabled=!0),t.dialogObj.setProperties({buttons:t.dlgButtons})},created:function(){t.inputUrl.removeAttribute("disabled")},success:function(){t.fileObj.refreshLayout()}}),F.isDevice&&(this.fileObj.height="85%"),this.fileObj.appendTo(this.fileWrap),this.parent.element.ownerDocument.addEventListener("mousedown",this.onDocumentClickBoundFn)},dit.prototype.getInputUrlElement=function(){var e=this.parent.createElement("div",{className:"imgUrl"}),t=this.parent.createElement("div",{className:"e-rte-label"}),t=(t.innerHTML='<label for="rteSample_img_url">'+this.i10n.getConstant("linkWebUrl")+"</label>",e.appendChild(t),this.i10n.getConstant("imageUrl"));return this.inputUrl=this.parent.createElement("input",{className:"e-input e-img-url",attrs:{placeholder:t,spellcheck:"false",disabled:"true"}}),e.appendChild(this.inputUrl),e},dit.prototype.insertImageUrl=function(e){var t,i=this.inputUrl.value;0===this.parent.formatter.getUndoRedoStack().length&&this.parent.formatter.saveData(),""!==i&&("HTML"===this.parent.editorMode&&je(z(this.selectObj.selection.range.startContainer.parentNode,"#"+this.contentModule.getPanel().id))&&(this.contentModule.getEditPanel().focus(),t=this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument()),this.selectObj.selection=this.parent.formatter.editorManager.nodeSelection.save(t,this.contentModule.getDocument()),this.selectObj.selectParent=this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(t)),t=je(i.match(t=/[\w-]+.(jpg|png|jpeg|gif)/g))||"HTML"!==this.parent.editorMode?"":i.match(t)[0],i={cssClass:"inline"===this.parent.insertImageSettings.display?I8e:m8e,url:i,selection:this.selectObj.selection,altText:t,selectParent:this.selectObj.selectParent,width:{width:this.parent.insertImageSettings.width,minWidth:this.parent.insertImageSettings.minWidth,maxWidth:this.parent.getInsertImgMaxWidth()},height:{height:this.parent.insertImageSettings.height,minHeight:this.parent.insertImageSettings.minHeight,maxHeight:this.parent.insertImageSettings.maxHeight}},this.parent.formatter.process(this.parent,this.selectObj.args,this.selectObj.args.originalEvent,i),this.dialogObj.hide({returnValue:!1}))},dit.prototype.cancelDialog=function(){this.parent.isBlur=!1,this.dialogObj.hide({returnValue:!0})},dit.prototype.onDocumentClick=function(e){var e=e.target,t="#document"!==e.nodeName&&!je(e.previousElementSibling)&&e.previousElementSibling;je(this.dialogObj)||z(e,"#"+this.parent.getID()+"_file-manager-dialog")||z(e,"#"+this.parent.getID()+"_rte-file-manager_tb_sortby-popup")||z(e,"#"+this.parent.getID()+"_rte-file-manager_tb_view-popup")||z(e,"#"+this.parent.getID()+"_rte-file-manager_contextmenu")||!je(z(e,".e-contextmenu-wrapper"))&&z(e,".e-contextmenu-wrapper").querySelector("#"+this.parent.getID()+"_rte-file-manager_contextmenu")||je(t)||t.classList.contains("e-rte-file-manager-dialog")||je(t)||t.id===this.parent.getID()+"_rte-file-manager_contextmenu"?this.parent.isRTE=!0:(this.dialogObj.hide({returnValue:!0}),this.parent.isBlur=!0,L6e(this.parent.element,"focusout"))},dit.prototype.addEventListener=function(){this.parent.on($3e,this.initialize,this),this.parent.on(J5e,this.render,this),this.parent.on(uWe,this.setCssClass,this),this.parent.on(t4e,this.destroy,this)},dit.prototype.removeEventListener=function(){this.parent.element.ownerDocument.removeEventListener("mousedown",this.onDocumentClickBoundFn),this.parent.off($3e,this.initialize),this.parent.off(J5e,this.render),this.parent.off(uWe,this.setCssClass),this.parent.off(t4e,this.destroy)},dit.prototype.destroyComponents=function(){this.fileObj&&(this.fileObj.destroy(),this.fileObj=null),this.dialogObj&&(this.dialogObj.destroy(),G(this.dialogObj.element))},dit.prototype.destroy=function(){this.isDestroyed||(this.destroyComponents(),this.removeEventListener(),this.dlgButtons=null,this.isDestroyed=!0,this.insertImageBoundFn=null,this.cancelDialogBoundFn=null,this.renderFileManagerBoundFn=null,this.dialogClosedBoundFn=null,this.onDocumentClickBoundFn=null)},dit.prototype.getModuleName=function(){return"fileManager"};var hit=dit;function dit(e,t){f$e.Inject(d$e,A$e,C$e,v$e),this.parent=e,this.i10n=t.getService("rteLocale"),this.dialogRenderObj=t.getService("dialogRenderObject"),this.rendererFactory=t.getService("rendererFactory"),this.addEventListener(),this.isDestroyed=!1,this.insertImageBoundFn=this.insertImageUrl.bind(this),this.cancelDialogBoundFn=this.cancelDialog.bind(this),this.renderFileManagerBoundFn=this.renderFileManager.bind(this),this.dialogClosedBoundFn=this.dialogClosed.bind(this),this.onDocumentClickBoundFn=this.onDocumentClick.bind(this)}cit.prototype.addEventListener=function(){this.parent.on(gWe,this.toolbarClick,this),this.parent.on(mWe,this.toolbarDoubleClick,this),this.parent.on(s5e,this.editAreaClick,this),this.parent.on(u4e,this.onKeyDown,this),this.parent.on(t4e,this.destroy,this)},cit.prototype.toolbarClick=function(e){this.parent.focusIn(),this.isSticky?(e.args.action="escape",this.actionHandler(e,"keyBoard")):(this.isActive=!0,this.actionHandler(e,"click")),this.parent.quickToolbarModule&&!je(this.parent.quickToolbarSettings.text)&&this.parent.element.ownerDocument.contains(this.parent.quickToolbarModule.textQTBar.element)&&this.parent.quickToolbarModule.textQTBar.hidePopup()},cit.prototype.toolbarDoubleClick=function(e){this.isActive=!0,this.isSticky=!0,this.parent.focusIn(),this.actionHandler(e,"dbClick")},cit.prototype.onKeyDown=function(e){var t=e.args;(je(t)||je(t.action)||"format-copy"!==t.action&&"format-paste"!==t.action)&&("escape"!==t.action||"format-copy"!==this.previousAction&&"format-paste"!==this.previousAction)||("format-copy"!==t.action&&"format-paste"!==t.action||t.stopPropagation(),"Firefox"!==this.parent.userAgentData.getBrowser()&&"Safari"!==this.parent.userAgentData.getBrowser()||t.preventDefault(),this.actionHandler(e,"keyBoard"))},cit.prototype.actionHandler=function(e,t){var i,n,o,r=!1;switch(t){case"dbClick":o=e.args.item,n=e.args.originalEvent,i="format-copy";break;case"keyBoard":n=e.args,r=!null,"escape"===(i=e.args.action)&&(this.isSticky=!1,this.isActive=!1);break;case"click":o=e.args.item,n=e.args.originalEvent,i="format-copy";break;case"docClick":n=e,i="format-paste"}var s={requestType:"FormatPainter",originalEvent:n,name:i,item:o=je(o)?{command:"FormatPainter",subCommand:"FormatPainter"}:o};this.parent.formatter.process(this.parent,s,n,{formatPainterAction:i}),s.cancel||(this.updateCursor(r),this.updateToolbarBtn("docClick"!==t&&"escape"!==i)),this.previousAction=i},cit.prototype.updateCursor=function(e){this.parent.inputElement.classList.contains("e-rte-cursor-brush")||e?this.isSticky||q([this.parent.inputElement],"e-rte-cursor-brush"):U([this.parent.inputElement],"e-rte-cursor-brush")},cit.prototype.updateToolbarBtn=function(e){var t;je(this.parent.element.querySelector(".e-rte-format-painter"))||(t=this.parent.element.querySelector(".e-rte-format-painter").parentElement.parentElement,e?U([t],"e-active"):this.isSticky||q([t],"e-active"))},cit.prototype.editAreaClick=function(e){this.isActive&&(this.isSticky||(this.isActive=!1),this.actionHandler(e,"docClick"),this.updateToolbarBtn(!1))},cit.prototype.destroy=function(){this.isDestroyed||(this.parent.off(gWe,this.toolbarClick),this.parent.off(s5e,this.editAreaClick),this.parent.off(mWe,this.toolbarDoubleClick),this.parent.off(u4e,this.onKeyDown),this.parent.off(t4e,this.destroy),this.parent=null,this.isSticky=null,this.isActive=null,this.previousAction=null,this.isDestroyed=!0)},cit.prototype.getModuleName=function(){return"formatPainter"};var pit=cit;function cit(e){this.isSticky=!1,this.isActive=!1,this.parent=e,this.addEventListener(),this.isDestroyed=!1}git.prototype.destroy=function(){this.isDestroyed||(this.removeEventListener(),this.isDestroyed=!0)},git.prototype.childDestroy=function(){var e;this.isPopupDestroyed||(this.popupObj&&!this.popupObj.isDestroyed&&(this.popupObj.element&&this.popupObj.element.querySelector(".e-rte-emoji-search")&&(e=At(this.popupObj.element.querySelector(".e-rte-emoji-search"),"textbox"))&&!e.isDestroyed&&e.destroy(),this.popupObj.element&&this.popupObj.element.querySelector(".e-rte-emojipicker-toolbar")&&(e=At(this.popupObj.element.querySelector(".e-rte-emojipicker-toolbar"),"toolbar"))&&!e.isDestroyed&&e.destroy(),je(e=this.popupObj.element.querySelector(".e-clear-icon"))||E.remove(e,"mousedown",this.searchFilter),this.popupObj.destroy(),this.isPopupDestroyed=!0),this.popDiv&&(E.remove(this.popDiv,"keydown",this.onKeyDown),E.remove(this.popDiv,"keyup",this.searchFilter),this.popDiv.querySelector(".e-rte-emojipicker-btn"))&&(e=this.popDiv.querySelector(".e-rte-emojipicker-btn"),E.remove(e,"scroll",this.scrollEvent),E.remove(e,"click",this.emojiBtnClick)))},git.prototype.addEventListener=function(){this.parent.on(fWe,this.toolbarClick,this),this.parent.on(v5e,this.docClick,this),this.parent.on(e4e,this.onIframeMouseDown,this),this.parent.on(u4e,this.onkeyPress,this),this.parent.on(c4e,this.onkeyUp,this),this.parent.on(l5e,this.contentscroll,this),this.parent.on(a5e,this.contentscroll,this),this.parent.on(t4e,this.destroy,this)},git.prototype.toolbarClick=function(e){var t,i=this,n=(this.noResultsFoundCount=0,je(this.parent.element.querySelector(".e-emoji"))?this.parent.inlineMode.enable&&(n=this.parent.element.ownerDocument.querySelector(".e-emoji")):n=this.parent.element.querySelector(".e-emoji"),this.divElement=n.closest("div"),this.parent.inputElement.contains(this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()).startContainer)||this.parent.contentModule.getEditPanel().focus(),this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument())),o=(this.save=this.parent.formatter.editorManager.nodeSelection.save(n,this.parent.contentModule.getDocument()),this.clickEvent=e.args,this.parent.emojiPickerSettings.iconsSet);if(this.popupObj){if(q([this.divElement],"e-active"),this.popupObj.element.querySelector(".e-rte-emoji-search")||!this.parent.emojiPickerSettings.showSearchBox)return void this.popupObj.hide();this.popupObj.hide()}this.popDiv=this.parent.createElement("div",{className:"e-rte-emojipicker-popup",id:this.parent.getID()+"_emojiPicker"}),je(this.parent.getToolbar())||this.parent.inlineMode.enable?this.parent.inlineMode.enable&&this.parent.rootContainer.appendChild(this.popDiv):this.parent.getToolbar().parentElement.appendChild(this.popDiv),E.add(this.popDiv,"keydown",this.onKeyDown,this),E.add(this.popDiv,"keyup",this.searchFilter,this);for(var n=this.parent.element.querySelector(".e-toolbar-extended"),r=(n=je(n)?"10001":window.getComputedStyle(n).getPropertyValue("z-index"),je(e.args)||this.parent.inlineMode.enable||!je(this.parent.quickToolbarSettings.text)?je(e.x)&&je(e.y)&&!this.parent.inlineMode.enable&&je(this.parent.quickToolbarSettings.text)?(f=this.parent.inputElement,0<this.parent.contentModule.getDocument().getSelection().rangeCount&&(r=(y=this.getCoordinates()).left,s=y.top)):je(e.x)&&je(e.y)&&(this.parent.inlineMode.enable||!je(this.parent.quickToolbarSettings.text))?(this.parent.notify(vWe,{}),0<this.parent.contentModule.getDocument().getSelection().rangeCount&&(r=(y=this.getCoordinates()).left,s=y.top)):(f=this.parent.inputElement,r=e.x,s=e.y):(f=(f=e.args.originalEvent.target).classList.contains("e-toolbar-item")?f.firstChild:f.parentElement,r="left",s="bottom"),this.popupObj=new Sv(this.popDiv,{targetType:"relative",relateTo:f,collision:{X:"fit",Y:"none"},offsetY:8,viewPortElement:this.parent.element,position:{X:r,Y:s},enableRtl:this.parent.enableRtl,zIndex:parseInt(n,10)+1,actionOnScroll:"hide",close:function(){i.parent.isBlur=!1,i.childDestroy(),i.popupObj.element.parentElement.style.zIndex="",G(i.popupObj.element),i.popupObj=null,i.divElement.firstChild.focus()}}),this.isPopupDestroyed=!1,U([this.popupObj.element],"e-popup-open"),this.popupObj.element.parentElement.style.zIndex="11",this.popupObj.refreshPosition(f),(!je(e.args)||je(e.x)&&je(e.y))&&this.parent.emojiPickerSettings.showSearchBox&&(y=Q("input",{id:"e-rte-emoji-search",className:"e-rte-emoji-search"}),this.popDiv.append(y),new fV({placeholder:this.i10n.getConstant("emojiPickerTypeToFind"),showClearButton:!0}).appendTo(y),this.parent.userAgentData.isSafari()&&this.parent.inputElement.contains(this.parent.getRange().startContainer)&&this.parent.notify(t5e,{}),y.focus()),this.popupObj.element.querySelector(".e-clear-icon")),s=(je(r)||E.add(r,"mousedown",this.searchFilter,this),this.parent.createElement("div",{className:"e-rte-emojipicker-toolbar"})),a=(this.popDiv.appendChild(s),[]),l=0;l<this.parent.emojiPickerSettings.iconsSet.length;l++)je(this.parent.emojiPickerSettings.iconsSet[l].iconCss)?a.push({text:"&#x"+this.parent.emojiPickerSettings.iconsSet[l].code+";",htmlAttributes:((t={}).title=this.parent.emojiPickerSettings.iconsSet[l].name,t)}):a.push({prefixIcon:this.parent.emojiPickerSettings.iconsSet[l].iconCss,htmlAttributes:((t={}).title=this.parent.emojiPickerSettings.iconsSet[l].name,t)});new U3({items:a,clicked:this.emojiToolbarClick.bind(this)}).appendTo(s);var h=this.parent.createElement("div",{className:"e-rte-emojipicker-btn"}),n=(this.popDiv.appendChild(h),window.getComputedStyle(this.popDiv));r=(!je(e.args)||je(e.x)&&je(e.y))&&this.parent.emojiPickerSettings.showSearchBox?(f=this.parent.element.querySelector(".e-rte-emoji-search").parentElement,y=window.getComputedStyle(f),this.popDiv.getBoundingClientRect().height-s.getBoundingClientRect().height-f.getBoundingClientRect().height-parseFloat(y.marginTop)-parseFloat(y.marginBottom)-2*parseFloat(n.borderWidth)+"px"):this.popDiv.getBoundingClientRect().height-s.getBoundingClientRect().height-2*parseFloat(n.borderWidth)+"px",h.style.setProperty("height",r,"important");for(l=0;l<o.length;l++){var d=this.parent.createElement("div",{className:"e-rte-emojipicker-group"}),p=(h.appendChild(d),this.parent.createElement("div",{className:"e-rte-emojipicker-name"})),c=(p.innerText=this.parent.emojiPickerSettings.iconsSet[l].name,p.setAttribute("aria-label",this.parent.emojiPickerSettings.iconsSet[l].name),d.appendChild(p),this.parent.createElement("div",{className:"e-rte-emojipickerbtn-group"}));d.appendChild(c);for(var u=0;u<o[l].icons.length;u++){var g=this.parent.createElement("button",{className:"e-btn  e-control"});g.innerHTML=this.buttoncode(this.parent.emojiPickerSettings.iconsSet[l].icons[u].code),g.setAttribute("aria-label",this.parent.emojiPickerSettings.iconsSet[l].icons[u].desc),g.setAttribute("title",this.parent.emojiPickerSettings.iconsSet[l].icons[u].desc),c.appendChild(g),2<g.innerHTML.length&&(g.style.fontSize="17px")}}E.add(h,"scroll",this.scrollEvent,this),E.add(h,"click",this.emojiBtnClick,this);var m,f=this.parent.element.querySelectorAll(".e-rte-emojipicker-btn button"),y=(je(this.parent.element.querySelector(".e-rte-emoji-search"))&&!je(e.args)&&(f[0].focus(),U([f[0]],"e-focus")),this.parent.element.querySelector(".e-rte-emojipicker-btn")),s=this.parent.element.querySelectorAll(".e-rte-emojipicker-toolbar button");(m=je(y)?m:Math.round(y.scrollTop))<s[0].offsetHeight&&U([s[0]],"e-selected"),this.popupObj&&U([this.divElement],"e-active")},git.prototype.onIframeMouseDown=function(e){this.popupObj&&(q([this.divElement],"e-active"),this.popupObj.hide())},git.prototype.buttoncode=function(e){return e.split("-").map(function(e){return String.fromCodePoint(parseInt(e,16))}).join("‍")},git.prototype.docClick=function(e){e=e.args.target;e&&e.classList&&this.popupObj&&!z(e,"[id='"+this.popupObj.element.id+"']")&&!e.classList.contains("e-emoji")&&!e.classList.contains("e-toolbar-item")&&this.popupObj&&(q([this.divElement],"e-active"),this.popupObj.hide())},git.prototype.scrollEvent=function(){for(var e,t=this.parent.element.querySelector(".e-rte-emojipicker-btn"),i=this.parent.element.querySelectorAll(".e-rte-emojipicker-group"),n=this.parent.element.querySelectorAll(".e-rte-emojipicker-toolbar button"),o=(je(t)||(e=Math.round(t.scrollTop)),0),r=0;r<n.length;r++)e<n[0].offsetHeight&&(je(n[r+1])||q([n[r+1]],"e-selected"),U([n[0]],"e-selected"));for(var s=0;s<i.length;s++)if((o+=Math.round(i[s].offsetHeight))<=e){for(var a=0;a<n.length;a++)n[a].classList.contains("e-selected")&&q([n[a]],"e-selected");je(n[s+1])||U([n[s+1]],"e-selected")}},git.prototype.contentscroll=function(){je(this.clickEvent)&&this.popupObj&&(q([this.divElement],"e-active"),this.popupObj.hide())},git.prototype.emojiToolbarClick=function(e){for(var o={text:e.item.htmlAttributes.title}.text,e=this.parent.element.querySelectorAll(".e-rte-emojipicker-group"),t=this.parent.element.querySelectorAll(".e-rte-emojipicker-btn button"),i=this.parent.element.querySelectorAll(".e-rte-emojipicker-toolbar button"),n=0;n<i.length;n++)i[n].classList.contains("e-selected")&&q([i[n]],"e-selected");for(n=0;n<t.length;n++)t[n].classList.contains("e-focus")&&q([t[n]],"e-focus");var r=this.parent.element.querySelector(".e-rte-emojipicker-btn"),s=0;e.forEach(function(e){var t=e.childNodes[0],i=e.childNodes[1].childNodes[0],n=t.getAttribute("aria-label");o===n?t&&(r.scrollTop=s+10,U([i],"e-focus"),i.focus()):(s+=e.scrollHeight,q([i],"e-focus"))})},git.prototype.onKeyDown=function(e){var t=this.parent.element.querySelectorAll(".e-rte-emojipicker-btn button"),i=this.parent.element.querySelectorAll(".e-rte-emojipickerbtn-group"),n=this.parent.element.querySelector(".e-rte-emojisearch-btn button"),o=(27===e.keyCode&&this.popupObj&&(q([this.divElement],"e-active"),this.popupObj.hide()),13===e.keyCode&&document.activeElement.classList.contains("e-btn")&&(this.emojiBtnClick(e),e.preventDefault()),e.srcElement);if(!je(o)&&o.classList.contains("e-rte-emoji-search")&&40===e.keyCode)for(var r=0;r<t.length;r++)t[r].classList.contains("e-focus")&&q([t[r]],"e-focus");if(je(n))for(r=0;r<t.length;r++){var s=r;if(t[r].classList.contains("e-focus"))if(40===e.keyCode){if(t.length-4>r){for(var a=0,l=0;l<i.length;l++)for(var h=0;h<i[l].childNodes.length;h++)if(i[l].childNodes[h].classList.contains("e-focus")&&1!==a){var d=h,p=i[l].lastChild,c=Math.floor(h%6),u=i[l].childNodes.length-1,u=Math.floor(u%6);if(-1!==d){var g=d+6;if(je(i[l].childNodes[g])){if(je(i[l].childNodes[g])&&!p.classList.contains("e-focus")&&u<c){q([t[r]],"e-focus"),U([f=i[l].lastChild],"e-focus"),f.focus(),a=1;break}q([t[r]],"e-focus"),U([f=i[l+1].childNodes[c]],"e-focus"),f.focus(),a=1;break}q([t[r]],"e-focus"),U([f=t[s+=6]],"e-focus"),f.focus();break}}break}}else{if(38===e.keyCode){if(6<=r){for(a=0,l=0;l<i.length;l++)for(h=0;h<i[l].childNodes.length;h++)if(i[l].childNodes[h].classList.contains("e-focus")&&1!==a){var d=h,m=je(i[l-1])?null:i[l-1].childNodes.length%6||6;if(-1!==d){if(je(i[l].childNodes[d-6])){if(je(i[l-1].childNodes[i[l-1].childNodes.length-(m-h)])){q([t[r]],"e-focus"),U([f=i[l-1].lastChild],"e-focus"),f.focus(),a=1;break}q([t[r]],"e-focus"),U([f=i[l-1].childNodes[i[l-1].childNodes.length-(m-h)]],"e-focus"),f.focus(),a=1;break}q([t[r]],"e-focus"),U([f=t[s-=6]],"e-focus"),f.focus();break}}}else{q([t[r]],"e-focus");var f=t[--s],y=this.popupObj.element.querySelector(".e-rte-emoji-search");if(je(f)&&!je(y)){y.focus();break}U([f],"e-focus"),f.focus()}break}if(39===e.keyCode){t.length!==r+1&&(q([t[r]],"e-focus"),U([f=t[s+=1]],"e-focus"),t[s].focus());break}if(37===e.keyCode){0<r&&(q([t[r]],"e-focus"),U([f=t[--s]],"e-focus"),t[s].focus());break}}}else this.filterKeyHandler(e);40===e.keyCode&&je(this.parent.element.querySelector(".e-focus"))&&(U([f=t[0]],"e-focus"),this.parent.userAgentData.isSafari()&&this.parent.inputElement.contains(this.parent.getRange().startContainer)&&this.parent.notify(t5e,{}),t[0].focus())},git.prototype.filterKeyHandler=function(e){var t=this.parent.element.querySelectorAll(".e-rte-emojisearch-btn button"),i=this.parent.element.querySelector(".e-focus");if(je(i)&&40===e.keyCode)U([r=t[0]],"e-focus"),this.parent.userAgentData.isSafari()&&this.parent.notify(t5e,{}),t[0].focus();else for(var n=0;n<t.length;n++){var o=n;if(t[n].classList.contains("e-focus"))if(38===e.keyCode){if(6<=n){q([t[n]],"e-focus"),U([r=t[o-=6]],"e-focus"),r.focus();break}q([t[n]],"e-focus");var r=t[--o],s=this.popupObj.element.querySelector(".e-rte-emoji-search");if(je(r)&&!je(s)){s.focus();break}U([r],"e-focus"),r.focus()}else if(40===e.keyCode){if(t.length-6>n){q([t[n]],"e-focus"),U([r=t[o+=6]],"e-focus"),r.focus();break}}else{if(39===e.keyCode){t.length!==n+1&&(q([t[n]],"e-focus"),U([r=t[o+=1]],"e-focus"),t[o].focus());break}if(37===e.keyCode&&0<n){q([t[n]],"e-focus"),U([r=t[--o]],"e-focus"),t[o].focus();break}}}},git.prototype.searchFilter=function(e,t,i){void 0===i&&(i=!1);var n=this.parent.element.querySelector(".e-rte-emoji-search"),o=this.parent.iframeSettings.enable?this.parent.contentModule.getPanel():this.parent.element.querySelector(".e-content");if(document.activeElement===n||document.activeElement===o){var o=void 0,r=(":"===t||je(t)?je(t)||(o=t):o=t.replace(/^:/,""),je(n)?o:n.value),o=this.parent.element.querySelectorAll(".e-rte-emojipicker-btn button"),n=this.parent.element.querySelector(".e-rte-emojipicker-btn"),s=this.parent.element.querySelectorAll(".e-rte-emojipicker-group"),a=this.parent.element.querySelector(".e-rte-emojipicker-toolbar"),l=this.parent.element.querySelector(".e-rte-emojisearch-btn"),h=this.popDiv.childNodes[0],d=window.getComputedStyle(h),h="SPAN"===h.nodeName?h.getBoundingClientRect().height+parseFloat(d.marginTop)+parseFloat(d.marginBottom):0,d=window.getComputedStyle(this.popDiv),p=je(l)?o:Array.from(o).filter(function(e){return!l.contains(e)});if(!je(a)&&!je(n)&&!je(r)){""===r||":"===t?(a.style.display="",n.style.height=this.popDiv.getBoundingClientRect().height-a.getBoundingClientRect().height-h-2*parseFloat(d.borderWidth)+"px",s.forEach(function(e){e.style.display=""})):(s.forEach(function(e){e.style.display="none"}),a.style.display="none",n.style.height=this.popDiv.getBoundingClientRect().height-h-2*parseFloat(d.borderWidth)+"px");for(var c=this.parent.createElement("div",{className:"e-rte-emojisearch-btn"}),o=this.parent.element.querySelector(".e-rte-emojisearch-btn"),u=(o&&o.remove(),!0),g=0;g<p.length;g++)if(!je(p[g].getAttribute("title")))for(var m=p[g].getAttribute("title").toLowerCase().split(" "),f=0;f<m.length;f++)if(m[f].startsWith(r.toLowerCase())&&""!==r){var y=p[g].cloneNode(!0);c.appendChild(y),u=!1;break}s=this.parent.createElement("div",{className:"e-rte-emojiSearch-noEmoji"});u&&!this.parent.element.querySelector(".e-rte-emojiSearch-noEmoji")&&""!==r&&":"!==t&&": :"!==t?je(s)||(s.innerHTML='<span style="color: rgba(0, 0, 0, 0.75); font-weight: 500; font-size: 16px;">'+this.i10n.getConstant("emojiPickerNoResultFound")+' 😥 </span><br><span style="color: rgba(0, 0, 0, 0.75);"> '+this.i10n.getConstant("emojiPickerTrySomethingElse")+" ? </span>",s.style.margin="55px",n.appendChild(s)):(!u&&this.parent.element.querySelector(".e-rte-emojiSearch-noEmoji")||""===r&&":"===t||""===r&&this.parent.element.querySelector(".e-rte-emojiSearch-noEmoji"))&&n.removeChild(this.parent.element.querySelector(".e-rte-emojiSearch-noEmoji")),n.appendChild(c),i&&(u&&":"!==t?this.noResultsFoundCount+=1:this.noResultsFoundCount=0,9<=this.noResultsFoundCount)&&(je(this.popupObj)||(q([this.divElement],"e-active"),this.popupObj.hide(),this.noResultsFoundCount=0))}}},git.prototype.emojiBtnClick=function(e){for(var t=new MouseEvent("mouseleave",{bubbles:!0,cancelable:!0}),i=this.parent.element.querySelectorAll(".e-rte-emojipicker-popup [data-tooltip-id]"),n=0;n<i.length;n++)i[n].dispatchEvent(t);var o,r=e.target;"BUTTON"===r.tagName&&(r.focus(),o=this.save.startOffset,o=this.save.range.startContainer.textContent.substring(o,o+1),je(this.clickEvent)&&":"===o||this.save.restore(),this.popupObj&&(q([this.divElement],"e-active"),this.popupObj.hide()),this.parent.userAgentData.isSafari()&&"keydown"===e.type&&this.parent.notify(i5e,{}),this.parent.formatter.process(this.parent,{item:{command:"EmojiPicker",subCommand:"EmojiPicker",value:r.innerHTML},originalEvent:e},e,e))},git.prototype.onkeyPress=function(e){var t,i,n,e=e.args,o=(this.parent.iframeSettings.enable?this.parent.contentModule.getPanel().contentWindow:this.parent.contentModule.getDocument()).getSelection();o.rangeCount<=0||(i=o.getRangeAt(0).startOffset,n=o.focusNode.textContent.substring(i-1,i),n=/\s/.test(n),t=":"===o.focusNode.textContent.substring(i-1,i),i=":"===o.focusNode.textContent.charAt(i-1),186===e.keyCode&&e.shiftKey&&(n||0===o.focusOffset)&&(n=this.getCoordinates(),this.parent.showEmojiPicker(n.left,n.top)),8===e.keyCode&&i&&this.popupObj&&(q([this.divElement],"e-active"),this.popupObj.hide()),32===e.keyCode&&t&&this.popupObj&&(q([this.divElement],"e-active"),o=this.parent.iframeSettings.enable?this.parent.contentModule.getPanel().ownerDocument:this.parent.contentModule.getDocument(),this.parent.showTooltip&&!je(o.querySelector(".e-tooltip-wrap"))&&this.parent.notify(yWe,{args:event}),this.popupObj.hide()),!this.popupObj)||37!==e.keyCode&&38!==e.keyCode&&39!==e.keyCode&&27!==e.keyCode&&40!==e.keyCode||(this.onKeyDown(e),e.preventDefault())},git.prototype.onkeyUp=function(e){var t=e.args,i=(this.parent.iframeSettings.enable?this.parent.contentModule.getPanel().contentWindow:this.parent.contentModule.getDocument()).getSelection();if(!(i.rangeCount<=0)){for(var n,o=i.getRangeAt(0),r=o.startOffset,s=0,a=r-1;a>=r-i.focusNode.textContent.length;a--){var l=i.focusNode.textContent.substring(a-1,a);/:$/.test(l)&&!je(this.popDiv)&&0===s&&(n=o.startContainer.textContent.substring(a-1,r),this.searchFilter(t,n,!0),s=1)}e=i.focusNode.textContent.substring(r-1,r);":"!==e||je(this.popupObj)||this.searchFilter(t,n=e,!0)}},git.prototype.getCoordinates=function(){var e,t=(this.parent.iframeSettings.enable?this.parent.contentModule.getPanel().contentWindow:window).getSelection().getRangeAt(0),t=("P"!==t.startContainer.nodeName&&"DIV"!==t.startContainer.nodeName||"#text"!==t.startContainer.childNodes[0].nodeName&&(i=t.startContainer.childNodes[0]),(je(i)?t:i).getBoundingClientRect()),i=this.parent.element.querySelector(".e-rte-content"),n=this.parent.element,o=n.offsetHeight-i.offsetHeight,r=t.top-this.parent.inputElement.getBoundingClientRect().top,s=t.left-this.parent.inputElement.getBoundingClientRect().left,a=window.innerHeight,s=s+t.width;return n.getBoundingClientRect().top<0&&!this.parent.inlineMode.enable&&(r=r+i.getBoundingClientRect().top-o),t.top<330||t.top+330>a&&(r-=350),e=this.parent.inputElement?{top:r+60,left:s+8}:e},git.prototype.removeEventListener=function(){this.parent.off(fWe,this.toolbarClick),this.parent.off(v5e,this.docClick),this.parent.off(e4e,this.onIframeMouseDown),this.parent.off(u4e,this.onkeyPress),this.parent.off(c4e,this.onkeyUp),this.parent.off(l5e,this.contentscroll),this.parent.off(a5e,this.contentscroll),this.parent.off(t4e,this.destroy)},git.prototype.getModuleName=function(){return"emojiPicker"};var uit=git;function git(e,t){this.noResultsFoundCount=0,this.parent=e,this.locator=t,this.i10n=t.getService("rteLocale"),this.renderFactory=this.locator.getService("rendererFactory"),this.addEventListener(),this.isDestroyed=!1,this.isPopupDestroyed=!1}mit.prototype.addEventListener=function(){this.parent.on(g4e,this.onImport,this),this.parent.on(m4e,this.onExport,this),this.parent.on(t4e,this.destroy,this)},mit.prototype.onImport=function(){var i=this;this.parent.trigger(O4e,{cancel:!1,requestType:"Import"},function(e){var t;e.cancel||(i.uploaderObj=new GN({allowedExtensions:".doc,.docx,.rtf,.dot,.dotx,.docm,.dotm",asyncSettings:{saveUrl:i.parent.importWord.serviceUrl},success:function(e){i.parent.executeCommand("importWord",e.e.currentTarget.response,{undo:!0}),i.parent.trigger(N4e,{requestType:"Import"})}}),i.parent.setProperties({enableXhtml:!0},!0),e=i.parent.createElement("div",{className:"e-import-uploadwrap e-droparea"+i.parent.getCssClass(!0)}),t=i.parent.createElement("input",{id:i.rteID+"_upload",attrs:{type:"File",name:"UploadFiles"},className:i.parent.getCssClass()}),e.appendChild(t),i.uploaderObj.appendTo(t),i.uploaderObj.element.click(),i.uploaderObj.element.closest(".e-upload").style.display="none")})},mit.prototype.onExport=function(n){var t,i,e,o=this,r=(this.parent.setProperties({enableXhtml:!0},!0),this.parent.getHtml()),r=("ExportWord"===n.member?(t=this.parent.exportWord.fileName,i=this.parent.exportWord.serviceUrl,e="<html><head><style>"+this.parent.exportWord.stylesheet+"</style></head><body>"+r+"</body></html>"):"ExportPdf"===n.member&&(t=this.parent.exportPdf.fileName,i=this.parent.exportPdf.serviceUrl,e="<html><head><style>"+this.parent.exportPdf.stylesheet+"</style></head><body>"+r+"</body></html>"),{requestType:n.member,exportValue:e,cancel:!1});this.parent.trigger(O4e,r,function(e){e.cancel||fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:e.exportValue})}).then(function(e){if(e.ok)return e.blob().then(function(e){return{blob:e,filename:t}});throw new Error("HTTP error! Status: "+e.status)}).then(function(e){var t=e.blob,e=e.filename,t=window.URL.createObjectURL(t),i=document.createElement("a");i.href=t,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(t),o.parent.trigger(N4e,{requestType:n.member})}).catch(function(e){console.error("Fetch error:",e)})})},mit.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(g4e,this.onImport),this.parent.off(m4e,this.onExport),this.parent.off(t4e,this.destroy),this.uploaderObj&&!this.uploaderObj.isDestroyed&&(this.uploaderObj.destroy(),this.uploaderObj=null))},mit.prototype.getModuleName=function(){return"importExport"};set=mit;function mit(e){this.parent=e,this.addEventListener()}Ket.Inject(att,G9e,X9e,set,J9e,$9e,utt,ptt,oit,Ytt,hqe,sit,Z$e,hit,pit,uit,jee);var fit,yit,vit,bit,wit,Cit,tet=Object.freeze({__proto__:null,Toolbar:att,KeyboardEvents:rqe,BaseToolbar:$et,BaseQuickToolbar:htt,QuickToolbar:ptt,Count:utt,ColorPickerInput:rtt,MarkdownToolbarStatus:ytt,ExecCommandCallBack:Eqe,ToolbarAction:ntt,MarkdownEditor:Ytt,HtmlEditor:oit,PasteCleanup:sit,Resize:Z$e,DropDownButtons:ttt,FileManager:hit,FullScreen:Net,setAttributes:Oet,HtmlToolbarStatus:eit,XhtmlValidation:iit,FormatPainter:pit,EmojiPicker:uit,ImportExport:set,HTMLFormatter:Ztt,Formatter:Met,MarkdownFormatter:qtt,ContentRender:J6e,Render:$6e,ToolbarRenderer:U9e,Link:G9e,Image:X9e,Audio:J9e,Video:$9e,ViewSource:aqe,Table:hqe,DialogRenderer:pqe,IframeContentRender:fqe,MarkdownRender:vqe,PopupRenderer:wqe,SlashMenu:jee,RichTextEditor:Ket,get RenderType(){return q3e},get ToolbarType(){return G3e},get DialogType(){return Y3e},get ImageInputSource(){return X3e},executeGroup:Sqe,created:"create",destroyed:"destroy",tableclass:K3e,load:"load",initialLoad:J3e,contentChanged:Z3e,initialEnd:$3e,iframeMouseDown:e4e,destroy:t4e,toolbarClick:i4e,toolbarRefresh:n4e,slashMenuOpening:o4e,refreshBegin:r4e,toolbarUpdated:s4e,bindOnEnd:a4e,htmlToolbarClick:l4e,markdownToolbarClick:h4e,modelChanged:d4e,tableModulekeyUp:p4e,keyUp:c4e,keyDown:u4e,onImport:g4e,onExport:m4e,mouseUp:f4e,toolbarCreated:y4e,toolbarRenderComplete:v4e,enableFullScreen:b4e,disableFullScreen:w4e,dropDownSelect:C4e,beforeDropDownItemRender:S4e,execCommandCallBack:A4e,imageToolbarAction:x4e,audioToolbarAction:I4e,videoToolbarAction:T4e,linkToolbarAction:E4e,windowResize:D4e,resizeStart:M4e,onResize:k4e,resizeStop:P4e,undo:"undo",redo:"redo",insertLink:B4e,unLink:F4e,editLink:L4e,openLink:R4e,actionBegin:O4e,actionComplete:N4e,updatedToolbarStatus:V4e,actionSuccess:"actionSuccess",updateToolbarItem:_4e,insertImage:H4e,insertAudio:z4e,insertVideo:j4e,insertCompleted:W4e,imageLeft:"justifyLeft",imageRight:"justifyRight",imageCenter:"justifyCenter",imageBreak:"break",imageInline:"inline",imageLink:Q4e,imageAlt:U4e,imageDelete:q4e,audioDelete:G4e,videoDelete:Y4e,imageCaption:X4e,imageSize:K4e,videoSize:J4e,sourceCode:Z4e,updateSource:$4e,toolbarOpen:"toolbarOpen",beforeDropDownOpen:e5e,selectionSave:t5e,selectionRestore:i5e,expandPopupClick:"expandPopupClick",count:n5e,contentFocus:"contentFocus",contentBlur:"contentBlur",mouseDown:o5e,sourceCodeMouseDown:r5e,editAreaClick:s5e,scroll:a5e,contentscroll:l5e,colorPickerChanged:h5e,focusChange:d5e,selectAll:p5e,selectRange:c5e,getSelectedHtml:u5e,renderInlineToolbar:g5e,paste:m5e,imgModule:"imageModule",rtlMode:f5e,createTable:y5e,docClick:v5e,tableToolbarAction:b5e,checkUndo:w5e,readOnlyMode:C5e,pasteClean:S5e,enterHandler:A5e,beforeDialogOpen:x5e,clearDialogObj:I5e,hideTableQuickToolbar:T5e,dialogOpen:E5e,beforeDialogClose:D5e,dialogClose:M5e,beforeQuickToolbarOpen:k5e,quickToolbarOpen:P5e,quickToolbarClose:B5e,popupHide:"popupHide",imageSelected:F5e,imageUploading:L5e,imageUploadSuccess:R5e,imageUploadFailed:O5e,imageRemoving:N5e,fileSelected:V5e,fileUploading:_5e,fileUploadSuccess:H5e,fileUploadFailed:z5e,fileRemoving:j5e,afterImageDelete:W5e,afterMediaDelete:Q5e,drop:U5e,renderQuickToolbar:q5e,xhtmlValidation:G5e,beforeImageUpload:Y5e,beforeFileUpload:X5e,resizeInitialized:K5e,renderFileManager:J5e,beforeImageDrop:Z5e,dynamicModule:$5e,beforePasteCleanup:eWe,afterPasteCleanup:tWe,updateTbItemsStatus:iWe,showLinkDialog:nWe,closeLinkDialog:oWe,showImageDialog:rWe,showAudioDialog:sWe,showVideoDialog:aWe,closeImageDialog:lWe,closeAudioDialog:hWe,closeVideoDialog:dWe,showTableDialog:pWe,closeTableDialog:cWe,bindCssClass:uWe,formatPainterClick:gWe,formatPainterDoubleClick:mWe,emojiPicker:fWe,destroyTooltip:yWe,hidePopup:vWe,cleanupResizeElements:bWe,afterKeyDown:wWe,updateValueOnIdle:CWe,documentClickClosedBy:SWe,showColorPicker:AWe,closeTooltip:xWe,autoResize:IWe,blockEmptyNodes:TWe,inlineEmptyNodes:EWe,supportedUnits:DWe,conversionFactors:MWe,onHandleFontsizeChange:kWe,preventQuickToolbarClose:PWe,CLS_RTE:BWe,CLS_RTL:FWe,CLS_CONTENT:"e-content",CLS_DISABLED:LWe,CLS_SCRIPT_SHEET:RWe,CLS_STYLE_SHEET:OWe,CLS_RTE_CONTAINER:NWe,CLS_TOOLBAR:VWe,CLS_TB_FIXED:_We,CLS_TB_FLOAT:HWe,CLS_INLINE:zWe,CLS_TB_INLINE:"e-rte-tb-inline",CLS_RTE_EXPAND_TB:jWe,CLS_FULL_SCREEN:WWe,CLS_QUICK_TB:QWe,CLS_TEXT_QUICK_TB:UWe,CLS_POP:qWe,CLS_TB_STATIC:GWe,CLS_QUICK_POP:YWe,CLS_QUICK_DROPDOWN:XWe,CLS_IMAGE_POP:KWe,CLS_TEXT_POP:JWe,CLS_INLINE_POP:ZWe,CLS_INLINE_DROPDOWN:$We,CLS_DROPDOWN_POPUP:e8e,CLS_DROPDOWN_ICONS:t8e,CLS_DROPDOWN_ITEMS:i8e,CLS_DROPDOWN_BTN:n8e,CLS_RTE_CONTENT:o8e,CLS_TB_ITEM:r8e,CLS_TB_EXTENDED:"e-toolbar-extended",CLS_TB_WRAP:s8e,CLS_POPUP:"e-popup",CLS_SEPARATOR:"e-separator",CLS_MINIMIZE:"e-minimize",CLS_MAXIMIZE:"e-maximize",CLS_BACK:"e-back",CLS_SHOW:a8e,CLS_HIDE:l8e,CLS_VISIBLE:h8e,CLS_FOCUS:d8e,CLS_RM_WHITE_SPACE:p8e,CLS_IMGRIGHT:c8e,CLS_IMGLEFT:u8e,CLS_IMGCENTER:g8e,CLS_IMGBREAK:m8e,CLS_AUDIOBREAK:f8e,CLS_CLICKELEM:y8e,CLS_VID_CLICK_ELEM:v8e,CLS_AUDIOWRAP:b8e,CLS_VIDEOWRAP:w8e,CLS_VIDEOBREAK:C8e,CLS_CAPTION:S8e,CLS_RTE_CAPTION:A8e,CLS_CAPINLINE:x8e,CLS_IMGINLINE:I8e,CLS_AUDIOINLINE:T8e,CLS_VIDEOINLINE:E8e,CLS_COUNT:D8e,CLS_WARNING:M8e,CLS_ERROR:k8e,CLS_ICONS:P8e,CLS_ACTIVE:B8e,CLS_EXPAND_OPEN:F8e,CLS_RTE_ELEMENTS:L8e,CLS_TB_BTN:R8e,CLS_HR_SEPARATOR:O8e,CLS_TB_IOS_FIX:N8e,CLS_LIST_PRIMARY_CONTENT:V8e,CLS_NUMBERFORMATLIST_TB_BTN:_8e,CLS_BULLETFORMATLIST_TB_BTN:H8e,CLS_FORMATS_TB_BTN:z8e,CLS_FONT_NAME_TB_BTN:j8e,CLS_FONT_SIZE_TB_BTN:W8e,CLS_ALIGN_TB_BTN:Q8e,CLS_FONT_COLOR_TARGET:U8e,CLS_BACKGROUND_COLOR_TARGET:q8e,CLS_COLOR_CONTENT:G8e,CLS_FONT_COLOR_DROPDOWN:Y8e,CLS_BACKGROUND_COLOR_DROPDOWN:X8e,CLS_COLOR_PALETTE:K8e,CLS_FONT_COLOR_PICKER:J8e,CLS_BACKGROUND_COLOR_PICKER:Z8e,CLS_RTE_READONLY:$8e,CLS_TABLE_SEL:eQe,CLS_TABLE_SEL_END:tQe,CLS_TABLE_MULTI_CELL:iQe,CLS_TB_DASH_BOR:nQe,CLS_TB_ALT_BOR:oQe,CLS_TB_COL_RES:rQe,CLS_TB_ROW_RES:sQe,CLS_TB_BOX_RES:aQe,CLS_RTE_HIDDEN:lQe,CLS_RTE_PASTE_KEEP_FORMAT:hQe,CLS_RTE_PASTE_REMOVE_FORMAT:dQe,CLS_RTE_PASTE_PLAIN_FORMAT:pQe,CLS_RTE_PASTE_OK:cQe,CLS_RTE_PASTE_CANCEL:uQe,CLS_RTE_DIALOG_MIN_HEIGHT:gQe,CLS_RTE_RES_HANDLE:mQe,CLS_RTE_RES_EAST:fQe,CLS_RTE_IMAGE:yQe,CLS_RESIZE:vQe,CLS_IMG_FOCUS:bQe,CLS_AUD_FOCUS:wQe,CLS_VID_FOCUS:CQe,CLS_RTE_DRAG_IMAGE:SQe,CLS_RTE_UPLOAD_POPUP:AQe,CLS_POPUP_OPEN:xQe,CLS_IMG_RESIZE:IQe,CLS_DROPAREA:TQe,CLS_IMG_INNER:EQe,CLS_UPLOAD_FILES:DQe,CLS_RTE_DIALOG_UPLOAD:MQe,CLS_RTE_RES_CNT:kQe,CLS_CUSTOM_TILE:PQe,CLS_NOCOLOR_ITEM:BQe,CLS_TABLE:"e-rte-table",CLS_TABLE_BORDER:FQe,CLS_RTE_TABLE_RESIZE:LQe,CLS_RTE_FIXED_TB_EXPAND:RQe,CLS_RTE_TB_ENABLED:OQe,CLS_RTE_RES_WEST:NQe,CLS_RTE_SOURCE_CODE_TXTAREA:VQe,ALLOWED_ACTIONKEYS:_Qe,getIndex:S6e,hasClass:A6e,getDropDownValue:x6e,isIDevice:I6e,getFormattedFontSize:T6e,pageYOffset:E6e,getTooltipText:D6e,setToolbarStatus:M6e,getCollection:k6e,updateDropdownContent:P6e,getTBarItemsIndex:B6e,updateUndoRedoStatus:F6e,dispatchEvent:L6e,parseHtml:R6e,getTextNodesUnder:O6e,toObjectLowerCase:N6e,getEditValue:V6e,updateTextNode:_6e,getDefaultValue:H6e,isEditableValueEmpty:z6e,decode:j6e,sanitizeHelper:W6e,parseHelper:Q6e,convertToBlob:U6e,getLocaleFontFormat:q6e,resetContentEditableElements:G6e,cleanupInternalElements:Y6e,removeSelectionClassStates:X6e,updateDropDownFontFormatLocale:K6e,ServiceLocator:Aqe,RendererFactory:Iqe,EditorManager:N9e,IMAGE:nUe,AUDIO:oUe,VIDEO:rUe,TABLE:sUe,LINK:aUe,INSERT_ROW:lUe,INSERT_COLUMN:hUe,DELETEROW:dUe,DELETECOLUMN:pUe,REMOVETABLE:cUe,TABLEHEADER:uUe,TABLE_VERTICAL_ALIGN:gUe,TABLE_MERGE:mUe,TABLE_VERTICAL_SPLIT:fUe,TABLE_HORIZONTAL_SPLIT:yUe,TABLE_DASHED:vUe,TABLE_ALTERNATE:bUe,TABLE_BACKGROUND_COLOR:wUe,TABLE_MOVE:CUe,ALIGNMENT_TYPE:SUe,INDENT_TYPE:AUe,DEFAULT_TAG:"p",BLOCK_TAGS:xUe,IGNORE_BLOCK_TAGS:IUe,TABLE_BLOCK_TAGS:TUe,SELECTION_TYPE:EUe,INSERTHTML_TYPE:DUe,INSERT_TEXT_TYPE:MUe,CLEAR_TYPE:kUe,SELF_CLOSING_TAGS:PUe,PASTE_SOURCE:BUe,ALLOWED_TABLE_BLOCK_TAGS:FUe,CLASS_IMAGE_RIGHT:N7e,CLASS_IMAGE_LEFT:V7e,CLASS_IMAGE_CENTER:_7e,CLASS_VIDEO_RIGHT:H7e,CLASS_VIDEO_LEFT:z7e,CLASS_VIDEO_CENTER:j7e,CLASS_IMAGE_BREAK:W7e,CLASS_AUDIO_BREAK:Q7e,CLASS_VIDEO_BREAK:U7e,CLASS_CAPTION:q7e,CLASS_RTE_CAPTION:"e-rte-img-caption",CLASS_CAPTION_INLINE:G7e,CLASS_IMAGE_INLINE:Y7e,CLASS_AUDIO_INLINE:X7e,CLASS_CLICK_ELEM:K7e,CLASS_VIDEO_CLICK_ELEM:J7e,CLASS_AUDIO:Z7e,CLASS_VIDEO:$7e,CLASS_AUDIO_WRAP:e9e,CLASS_VIDEO_WRAP:t9e,CLASS_EMBED_VIDEO_WRAP:i9e,CLASS_AUDIO_FOCUS:n9e,CLASS_VIDEO_FOCUS:o9e,CLASS_VIDEO_INLINE:r9e,Lists:E7e,markerClassName:JUe,DOMNode:ZUe,Alignments:F7e,Indents:R7e,Formats:M7e,LinkCommand:P7e,InsertMethods:b7e,InsertTextExec:P9e,InsertHtmlExec:C9e,InsertHtml:A7e,IsFormatted:tUe,MsWordPaste:M9e,NodeCutter:C7e,ImageCommand:s9e,AudioCommand:l9e,VideoCommand:d9e,SelectionCommands:y9e,SelectionBasedExec:b9e,ClearFormatExec:I9e,UndoRedoManager:E9e,TableCommand:c9e,statusCollection:z9e,ToolbarStatus:j9e,FormatPainterActions:R9e,EmojiPickerAction:F9e,NodeSelection:_9e,MarkdownParser:jtt,LISTS_COMMAND:wtt,selectionCommand:Ctt,LINK_COMMAND:Stt,CLEAR_COMMAND:Att,MD_TABLE:xtt,INSERT_TEXT_COMMAND:Itt,ClearFormat:Vtt,MDLists:Ttt,MDFormats:Dtt,MarkdownSelection:mtt,UndoRedoCommands:Btt,MDSelectionFormats:ktt,MDLink:Ltt,MDTable:Ott,markdownFormatTags:LUe,markdownSelectionTags:RUe,markdownListsTags:OUe,htmlKeyConfig:NUe,markdownKeyConfig:VUe,pasteCleanupGroupingTags:_Ue,listConversionFilters:{first:"MsoListParagraphCxSpFirst",middle:"MsoListParagraphCxSpMiddle",last:"MsoListParagraphCxSpLast"},selfClosingTags:HUe,imageResizeFactor:zUe,mentionRestrictKeys:jUe,KEY_DOWN:e7e,ACTION:t7e,FORMAT_TYPE:i7e,KEY_DOWN_HANDLER:n7e,LIST_TYPE:o7e,KEY_UP_HANDLER:r7e,KEY_UP:s7e,MODEL_CHANGED_PLUGIN:a7e,MODEL_CHANGED:l7e,MS_WORD_CLEANUP_PLUGIN:h7e,MS_WORD_CLEANUP:d7e,ON_BEGIN:p7e,SPACE_ACTION:c7e,FORMAT_PAINTER_ACTIONS:u7e,BLOCKQUOTE_LIST_HANDLE:g7e,EMOJI_PICKER_ACTIONS:m7e,MOUSE_DOWN:f7e,DESTROY:y7e,INTERNAL_DESTROY:v7e});(Wo=fit=fit||{}).Classic="Classic",Wo.Simplified="Simplified",(d$=yit=yit||{}).Row="Row",d$.Column="Column",(N$e=vit=vit||{})[N$e.Large=4]="Large",N$e[N$e.Medium=2]="Medium",N$e[N$e.Small=1]="Small",(pJ=bit=bit||{})[pJ.Classic=4]="Classic",pJ[pJ.Simplified=2]="Simplified",pJ[pJ.Overflow=1]="Overflow",pJ[pJ.Auto=7]="Auto",(P$e=wit=wit||{}).Button="Button",P$e.CheckBox="CheckBox",P$e.ColorPicker="ColorPicker",P$e.ComboBox="ComboBox",P$e.DropDown="DropDown",P$e.SplitButton="SplitButton",P$e.GroupButton="GroupButton",P$e.Gallery="Gallery",P$e.Template="Template",(L$e=Cit=Cit||{}).Single="Single",L$e.Multiple="Multiple",Sit=function(e,t){return(Sit=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])}))(e,t)};var Sit,Ait,H$e=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},W$e=(function(e,t){function i(){this.constructor=e}Sit(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(xit,Ait=n),xit.prototype.setProperties=function(e,t){Ait.prototype.setProperties.call(this,e,t)},H$e([e("")],xit.prototype,"content",void 0),H$e([e("")],xit.prototype,"cssClass",void 0),H$e([e("")],xit.prototype,"iconCss",void 0),H$e([e(!1)],xit.prototype,"isToggle",void 0),H$e([e(!1)],xit.prototype,"isPrimary",void 0),H$e([e({})],xit.prototype,"htmlAttributes",void 0),H$e([i()],xit.prototype,"created",void 0),H$e([i()],xit.prototype,"clicked",void 0),xit);function xit(){return null!==Ait&&Ait.apply(this,arguments)||this}Iit=function(e,t){return(Iit=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])}))(e,t)};var Iit,Tit,X$e=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Det=(function(e,t){function i(){this.constructor=e}Iit(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Eit,Tit=n),X$e([e(!(Eit.prototype.setProperties=function(e,t){Tit.prototype.setProperties.call(this,e,t)}))],Eit.prototype,"checked",void 0),X$e([e("")],Eit.prototype,"cssClass",void 0),X$e([e("")],Eit.prototype,"label",void 0),X$e([e("After")],Eit.prototype,"labelPosition",void 0),X$e([e({})],Eit.prototype,"htmlAttributes",void 0),X$e([i()],Eit.prototype,"created",void 0),X$e([i()],Eit.prototype,"change",void 0),Eit);function Eit(){return null!==Tit&&Tit.apply(this,arguments)||this}Dit=function(e,t){return(Dit=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])}))(e,t)};var Dit,Mit,q$e=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},h=(function(e,t){function i(){this.constructor=e}Dit(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(kit,Mit=n),kit.prototype.setProperties=function(e,t){Mit.prototype.setProperties.call(this,e,t)},q$e([e(10)],kit.prototype,"columns",void 0),q$e([e("")],kit.prototype,"cssClass",void 0),q$e([e("")],kit.prototype,"label",void 0),q$e([e(!0)],kit.prototype,"enableOpacity",void 0),q$e([e("Palette")],kit.prototype,"mode",void 0),q$e([e(!0)],kit.prototype,"modeSwitcher",void 0),q$e([e(!1)],kit.prototype,"noColor",void 0),q$e([e(null)],kit.prototype,"presetColors",void 0),q$e([e(!0)],kit.prototype,"showButtons",void 0),q$e([e("#008000ff")],kit.prototype,"value",void 0),q$e([e({})],kit.prototype,"htmlAttributes",void 0),q$e([i()],kit.prototype,"beforeClose",void 0),q$e([i()],kit.prototype,"beforeOpen",void 0),q$e([i()],kit.prototype,"beforeTileRender",void 0),q$e([i()],kit.prototype,"created",void 0),q$e([i()],kit.prototype,"change",void 0),q$e([i()],kit.prototype,"open",void 0),q$e([i()],kit.prototype,"select",void 0),kit);function kit(){return null!==Mit&&Mit.apply(this,arguments)||this}Pit=function(e,t){return(Pit=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])}))(e,t)};var Pit,Bit,Cet=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},wce=(function(e,t){function i(){this.constructor=e}Pit(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Fit,Bit=n),Cet([e(!(Fit.prototype.setProperties=function(e,t){Bit.prototype.setProperties.call(this,e,t)}))],Fit.prototype,"allowFiltering",void 0),Cet([e(!0)],Fit.prototype,"autofill",void 0),Cet([e("")],Fit.prototype,"cssClass",void 0),Cet([e("")],Fit.prototype,"label",void 0),Cet([e([])],Fit.prototype,"dataSource",void 0),Cet([t({text:null,value:null,iconCss:null,groupBy:null},HH)],Fit.prototype,"fields",void 0),Cet([e("Contains")],Fit.prototype,"filterType",void 0),Cet([e(null)],Fit.prototype,"footerTemplate",void 0),Cet([e(null)],Fit.prototype,"groupTemplate",void 0),Cet([e(null)],Fit.prototype,"headerTemplate",void 0),Cet([e(null)],Fit.prototype,"index",void 0),Cet([e(null)],Fit.prototype,"itemTemplate",void 0),Cet([e("No records found")],Fit.prototype,"noRecordsTemplate",void 0),Cet([e(null)],Fit.prototype,"placeholder",void 0),Cet([e("300px")],Fit.prototype,"popupHeight",void 0),Cet([e("100%")],Fit.prototype,"popupWidth",void 0),Cet([e(!0)],Fit.prototype,"showClearButton",void 0),Cet([e("None")],Fit.prototype,"sortOrder",void 0),Cet([e(null)],Fit.prototype,"text",void 0),Cet([e(null)],Fit.prototype,"value",void 0),Cet([e("150px")],Fit.prototype,"width",void 0),Cet([e({})],Fit.prototype,"htmlAttributes",void 0),Cet([i()],Fit.prototype,"beforeOpen",void 0),Cet([i()],Fit.prototype,"change",void 0),Cet([i()],Fit.prototype,"close",void 0),Cet([i()],Fit.prototype,"created",void 0),Cet([i()],Fit.prototype,"filtering",void 0),Cet([i()],Fit.prototype,"open",void 0),Cet([i()],Fit.prototype,"select",void 0),Fit);function Fit(){return null!==Bit&&Bit.apply(this,arguments)||this}Lit=function(e,t){return(Lit=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])}))(e,t)};var Lit,Rit,det=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},fJ=(function(e,t){function i(){this.constructor=e}Lit(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Oit,Rit=n),Oit.prototype.setProperties=function(e,t){Rit.prototype.setProperties.call(this,e,t)},det([e("")],Oit.prototype,"closeActionEvents",void 0),det([e("")],Oit.prototype,"content",void 0),det([e("")],Oit.prototype,"cssClass",void 0),det([e("")],Oit.prototype,"iconCss",void 0),det([kt([],e2)],Oit.prototype,"items",void 0),det([e("")],Oit.prototype,"target",void 0),det([e(!1)],Oit.prototype,"createPopupOnClick",void 0),det([e({})],Oit.prototype,"htmlAttributes",void 0),det([i()],Oit.prototype,"beforeClose",void 0),det([i()],Oit.prototype,"beforeItemRender",void 0),det([i()],Oit.prototype,"beforeOpen",void 0),det([i()],Oit.prototype,"close",void 0),det([i()],Oit.prototype,"created",void 0),det([i()],Oit.prototype,"open",void 0),det([i()],Oit.prototype,"select",void 0),Oit);function Oit(){return null!==Rit&&Rit.apply(this,arguments)||this}Nit=function(e,t){return(Nit=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])}))(e,t)};var Nit,Vit,Vee=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},tte=(function(e,t){function i(){this.constructor=e}Nit(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(_it,Vit=n),_it.prototype.setProperties=function(e,t){Vit.prototype.setProperties.call(this,e,t)},Vee([e("")],_it.prototype,"closeActionEvents",void 0),Vee([e("")],_it.prototype,"content",void 0),Vee([e("")],_it.prototype,"cssClass",void 0),Vee([e("")],_it.prototype,"iconCss",void 0),Vee([kt([],e2)],_it.prototype,"items",void 0),Vee([e("")],_it.prototype,"target",void 0),Vee([e({})],_it.prototype,"htmlAttributes",void 0),Vee([i()],_it.prototype,"beforeClose",void 0),Vee([i()],_it.prototype,"beforeItemRender",void 0),Vee([i()],_it.prototype,"beforeOpen",void 0),Vee([i()],_it.prototype,"close",void 0),Vee([i()],_it.prototype,"click",void 0),Vee([i()],_it.prototype,"created",void 0),Vee([i()],_it.prototype,"open",void 0),Vee([i()],_it.prototype,"select",void 0),_it);function _it(){return null!==Vit&&Vit.apply(this,arguments)||this}Hit=function(e,t){return(Hit=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])}))(e,t)};var Hit,zit,Xet=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Z$e=(function(e,t){function i(){this.constructor=e}Hit(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(jit,zit=n),Xet([e("")],jit.prototype,"cssClass",void 0),Xet([e("")],jit.prototype,"id",void 0),Xet([e("")],jit.prototype,"title",void 0),Xet([e("")],jit.prototype,"content",void 0),Xet([e("")],jit.prototype,"iconCss",void 0),jit);function jit(){return null!==zit&&zit.apply(this,arguments)||this}Wit=function(e,t){return(Wit=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])}))(e,t)};var Wit,Qit,set=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Met=(function(e,t){function i(){this.constructor=e}Wit(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Uit,Qit=n),Uit.prototype.setProperties=function(e,t){Qit.prototype.setProperties.call(this,e,t)},set([e("")],Uit.prototype,"content",void 0),set([e("")],Uit.prototype,"iconCss",void 0),set([e("")],Uit.prototype,"keyTip",void 0),set([t({},Z$e)],Uit.prototype,"ribbonTooltipSettings",void 0),set([e(!1)],Uit.prototype,"selected",void 0),set([e({})],Uit.prototype,"htmlAttributes",void 0),set([i()],Uit.prototype,"beforeClick",void 0),set([i()],Uit.prototype,"click",void 0),Uit);function Uit(){return null!==Qit&&Qit.apply(this,arguments)||this}qit=function(e,t){return(qit=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])}))(e,t)};var qit,Git,jee=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Wo=(function(e,t){function i(){this.constructor=e}qit(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Yit,Git=n),jee([e("")],Yit.prototype,"header",void 0),jee([e("Single")],Yit.prototype,"selection",void 0),jee([kt([],Met)],Yit.prototype,"items",void 0),Yit);function Yit(){return null!==Git&&Git.apply(this,arguments)||this}Xit=function(e,t){return(Xit=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])}))(e,t)};var Xit,Kit,d$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},N$e=(function(e,t){function i(){this.constructor=e}Xit(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Jit,Kit=n),d$([e("")],Jit.prototype,"content",void 0),d$([e("")],Jit.prototype,"iconCss",void 0),d$([e({})],Jit.prototype,"htmlAttributes",void 0),d$([e("")],Jit.prototype,"cssClass",void 0),d$([e(!1)],Jit.prototype,"disabled",void 0),Jit);function Jit(){return null!==Kit&&Kit.apply(this,arguments)||this}Zit=function(e,t){return(Zit=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])}))(e,t)};var Zit,$it,pJ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},P$e=(function(e,t){function i(){this.constructor=e}Zit(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(ent,$it=n),pJ([kt([],N$e)],ent.prototype,"items",void 0),pJ([e("")],ent.prototype,"header",void 0),pJ([e("auto")],ent.prototype,"itemWidth",void 0),pJ([e("auto")],ent.prototype,"itemHeight",void 0),pJ([e("")],ent.prototype,"cssClass",void 0),ent);function ent(){return null!==$it&&$it.apply(this,arguments)||this}tnt=function(e,t){return(tnt=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])}))(e,t)};var tnt,nnt,L$e=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},H$e=(function(e,t){function i(){this.constructor=e}tnt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(ont,nnt=n),L$e([kt([],P$e)],ont.prototype,"groups",void 0),L$e([e(3)],ont.prototype,"itemCount",void 0),L$e([e(null)],ont.prototype,"selectedItemIndex",void 0),L$e([e("auto")],ont.prototype,"popupHeight",void 0),L$e([e("auto")],ont.prototype,"popupWidth",void 0),L$e([e("")],ont.prototype,"template",void 0),L$e([e("")],ont.prototype,"popupTemplate",void 0),L$e([i()],ont.prototype,"popupOpen",void 0),L$e([i()],ont.prototype,"popupClose",void 0),L$e([i()],ont.prototype,"itemHover",void 0),L$e([i()],ont.prototype,"beforeItemRender",void 0),L$e([i()],ont.prototype,"beforeSelect",void 0),L$e([i()],ont.prototype,"select",void 0),ont);function ont(){return null!==nnt&&nnt.apply(this,arguments)||this}rnt=function(e,t){return(rnt=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])}))(e,t)};var rnt,snt,X$e=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},q$e=(function(e,t){function i(){this.constructor=e}rnt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(ant,snt=n),ant.prototype.setProperties=function(e,t){snt.prototype.setProperties.call(this,e,t)},X$e([e("")],ant.prototype,"keyTip",void 0),X$e([e(vit.Medium)],ant.prototype,"activeSize",void 0),X$e([e(vit.Small|vit.Medium|vit.Large)],ant.prototype,"allowedSizes",void 0),X$e([e("")],ant.prototype,"id",void 0),X$e([e("")],ant.prototype,"cssClass",void 0),X$e([e(!1)],ant.prototype,"disabled",void 0),X$e([e("")],ant.prototype,"itemTemplate",void 0),X$e([e("Button")],ant.prototype,"type",void 0),X$e([e(bit.Auto)],ant.prototype,"displayOptions",void 0),X$e([t({},Z$e)],ant.prototype,"ribbonTooltipSettings",void 0),X$e([t({},W$e)],ant.prototype,"buttonSettings",void 0),X$e([t({},fJ)],ant.prototype,"dropDownSettings",void 0),X$e([t({},Det)],ant.prototype,"checkBoxSettings",void 0),X$e([t({},h)],ant.prototype,"colorPickerSettings",void 0),X$e([t({},wce)],ant.prototype,"comboBoxSettings",void 0),X$e([t({},tte)],ant.prototype,"splitButtonSettings",void 0),X$e([t({},Wo)],ant.prototype,"groupButtonSettings",void 0),X$e([t({},H$e)],ant.prototype,"gallerySettings",void 0),ant);function ant(){return null!==snt&&snt.apply(this,arguments)||this}lnt=function(e,t){return(lnt=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])}))(e,t)};var lnt,hnt,Cet=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},det=(function(e,t){function i(){this.constructor=e}lnt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(dnt,hnt=n),dnt.prototype.setProperties=function(e,t){hnt.prototype.setProperties.call(this,e,t)},Cet([e("")],dnt.prototype,"id",void 0),Cet([e("")],dnt.prototype,"cssClass",void 0),Cet([kt([],q$e)],dnt.prototype,"items",void 0),dnt);function dnt(){return null!==hnt&&hnt.apply(this,arguments)||this}pnt=function(e,t){return(pnt=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])}))(e,t)};var pnt,cnt,Vee=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Xet=(function(e,t){function i(){this.constructor=e}pnt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(unt,cnt=n),unt.prototype.setProperties=function(e,t){cnt.prototype.setProperties.call(this,e,t)},Vee([e("")],unt.prototype,"keyTip",void 0),Vee([e("")],unt.prototype,"launcherIconKeyTip",void 0),Vee([kt([],det)],unt.prototype,"collections",void 0),Vee([e("")],unt.prototype,"cssClass",void 0),Vee([e("")],unt.prototype,"id",void 0),Vee([e(!1)],unt.prototype,"isCollapsed",void 0),Vee([e(!0)],unt.prototype,"isCollapsible",void 0),Vee([e(!1)],unt.prototype,"enableGroupOverflow",void 0),Vee([e("")],unt.prototype,"groupIconCss",void 0),Vee([e("")],unt.prototype,"header",void 0),Vee([e("Column")],unt.prototype,"orientation",void 0),Vee([e("")],unt.prototype,"overflowHeader",void 0),Vee([e(0)],unt.prototype,"priority",void 0),Vee([e(!1)],unt.prototype,"showLauncherIcon",void 0),unt);function unt(){return null!==cnt&&cnt.apply(this,arguments)||this}gnt=function(e,t){return(gnt=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])}))(e,t)};var gnt,mnt,set=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},jee=(function(e,t){function i(){this.constructor=e}gnt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(fnt,mnt=n),fnt.prototype.setProperties=function(e,t){mnt.prototype.setProperties.call(this,e,t)},set([e("")],fnt.prototype,"keyTip",void 0),set([e("")],fnt.prototype,"id",void 0),set([e("")],fnt.prototype,"cssClass",void 0),set([kt([],Xet)],fnt.prototype,"groups",void 0),set([e("")],fnt.prototype,"header",void 0),fnt);function fnt(){return null!==mnt&&mnt.apply(this,arguments)||this}ynt=function(e,t){return(ynt=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])}))(e,t)};var ynt,vnt,d$=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},pJ=(function(e,t){function i(){this.constructor=e}ynt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(bnt,vnt=n),bnt.prototype.setProperties=function(e,t){vnt.prototype.setProperties.call(this,e,t)},d$([e("File")],bnt.prototype,"text",void 0),d$([e(!1)],bnt.prototype,"visible",void 0),d$([kt([],e3)],bnt.prototype,"menuItems",void 0),d$([e(!1)],bnt.prototype,"showItemOnClick",void 0),d$([t({},n3)],bnt.prototype,"animationSettings",void 0),d$([e("")],bnt.prototype,"itemTemplate",void 0),d$([e("")],bnt.prototype,"popupTemplate",void 0),d$([t({},Z$e)],bnt.prototype,"ribbonTooltipSettings",void 0),d$([i()],bnt.prototype,"beforeClose",void 0),d$([i()],bnt.prototype,"beforeOpen",void 0),d$([i()],bnt.prototype,"beforeItemRender",void 0),d$([i()],bnt.prototype,"close",void 0),d$([i()],bnt.prototype,"open",void 0),d$([i()],bnt.prototype,"select",void 0),d$([e("")],bnt.prototype,"keyTip",void 0),bnt);function bnt(){return null!==vnt&&vnt.apply(this,arguments)||this}wnt=function(e,t){return(wnt=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])}))(e,t)};var wnt,Cnt,L$e=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},X$e=(function(e,t){function i(){this.constructor=e}wnt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Snt,Cnt=n),L$e([e("")],Snt.prototype,"text",void 0),L$e([e("")],Snt.prototype,"iconCss",void 0),L$e([e(!0)],Snt.prototype,"visible",void 0),Snt);function Snt(){return null!==Cnt&&Cnt.apply(this,arguments)||this}Ant=function(e,t){return(Ant=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])}))(e,t)};var Ant,xnt,Cet=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Vee=(function(e,t){function i(){this.constructor=e}Ant(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Int,xnt=n),Cet([e("")],Int.prototype,"text",void 0),Cet([e("")],Int.prototype,"id",void 0),Cet([e("")],Int.prototype,"keyTip",void 0),Cet([e("")],Int.prototype,"content",void 0),Cet([e("")],Int.prototype,"iconCss",void 0),Cet([e(!1)],Int.prototype,"separator",void 0),Cet([e(!1)],Int.prototype,"isFooter",void 0),Cet([i()],Int.prototype,"backStageItemClick",void 0),Int);function Int(){return null!==xnt&&xnt.apply(this,arguments)||this}Tnt=function(e,t){return(Tnt=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])}))(e,t)};var Tnt,Ent,set=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},d$=(function(e,t){function i(){this.constructor=e}Tnt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Dnt,Ent=n),Dnt.prototype.setProperties=function(e,t){Ent.prototype.setProperties.call(this,e,t)},set([e("File")],Dnt.prototype,"text",void 0),set([e("")],Dnt.prototype,"keyTip",void 0),set([e(!1)],Dnt.prototype,"visible",void 0),set([e("auto")],Dnt.prototype,"height",void 0),set([e("auto")],Dnt.prototype,"width",void 0),set([e(null)],Dnt.prototype,"target",void 0),set([t({},X$e)],Dnt.prototype,"backButton",void 0),set([kt([],Vee)],Dnt.prototype,"items",void 0),set([e("")],Dnt.prototype,"template",void 0),set([t({},Z$e)],Dnt.prototype,"ribbonTooltipSettings",void 0),Dnt);function Dnt(){return null!==Ent&&Ent.apply(this,arguments)||this}Mnt=function(e,t){return(Mnt=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])}))(e,t)};var Mnt,knt,L$e=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Cet=(function(e,t){function i(){this.constructor=e}Mnt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Pnt,knt=n),L$e([e(!(Pnt.prototype.setProperties=function(e,t){knt.prototype.setProperties.call(this,e,t)}))],Pnt.prototype,"visible",void 0),L$e([e(!1)],Pnt.prototype,"isSelected",void 0),L$e([kt([],jee)],Pnt.prototype,"tabs",void 0),Pnt);function Pnt(){return null!==knt&&knt.apply(this,arguments)||this}var Bnt="e-ribbon-vertical-center",Fnt="e-icons e-drop-icon",Lnt="e-icons e-arrow-left",Rnt="e-icons e-more-horizontal-1",Ont="e-vertical",Nnt="e-disabled",Vnt="e-rtl",_nt="e-ribbon-hover",Hnt="e-ribbon-control",znt="e-ribbon-popup-control",jnt="e-ribbon-open",Wnt="e-ribbon-keytip",Qnt="e-hscroll-bar",Unt="e-ribbon-hide",qnt="e-ribbon-tab",Gnt="e-ribbon-contextual-tab",Ynt="e-ribbon-active",Xnt="e-ribbon-tab-item",Knt="e-ribbon-collapse-btn",Jnt="e-ribbon-expand-btn",Znt="e-ribbon-collapsible",$nt="e-ribbon-overall-of-btn",eot="e-ribbon-group-of-btn",tot="e-ribbon-overflow-target",iot="e-ribbon-overflow",not="e-content",oot="e-ribbon-minimize",rot="e-ribbon-group",sot="e-ribbon-single-selection",aot="e-ribbon-multiple-selection",lot="e-ribbon-group-button",hot="e-ribbon-group-button-overflow-popup",dot="e-ribbon-group-button-content",pot="e-ribbon-group-container",cot="e-ribbon-of-tab",uot="e-ribbon-of-group-container",got="e-ribbon-group-content",mot="e-ribbon-group-header",fot="e-ribbon-overflow-header",yot="e-ribbon-group-overflow",vot="e-ribbon-group-overflow-ddb",bot="e-ribbon-launcher",wot="e-ribbon-launcher-icon",Cot="e-icons e-launcher",Sot="e-ribbon-collection",Aot="e-ribbon-item",xot="e-ribbon-row",Iot="e-ribbon-column",Tot="e-ribbon-large-item",Eot="e-ribbon-medium-item",Dot="e-ribbon-small-item",Mot="e-ribbon-content-height",kot="e-caret-hide",Pot="e-ribbon-template",Bot="e-ribbon-help-template",Fot="e-ribbon-tooltip",Lot="e-ribbon-tooltip-target",Rot="e-ribbon-tooltip-title",Oot="e-ribbon-tooltip-content",Not="e-ribbon-tooltip-icon",Vot="e-ribbon-tooltip-container",_ot="e-ribbon-text-container",Hot="e-ribbon-simplified-mode",zot="e-ribbon-backstage-popup",jot="e-ribbon-backstage-open",Wot="e-ribbon-backstage-content",Qot="e-ribbon-backstage",Uot="e-ribbon-backstage-menu",qot="e-ribbon-backstage-template",Got="e-ribbon-backstage-wrapper",Yot="e-ribbon-backstage-items-wrapper",Xot="e-blankicon",Kot="_tab",Jot="_collection",Zot="_collapsebutton",$ot="_sim_ovrl_overflow",ert="_sim_grp_overflow",trt="_header",irt="_launcher",nrt="_content",ort="_container",rrt="_overflow",srt="_dropdown",art="_backstage",lrt="_backstagepopup",hrt="_filemenulist",drt="_footermenulist",prt="_helppanetemplate",crt="_grpbtn",urt="_keytip",grt="--fileMenuWidth",mrt="--helpTemplateWidth",frt=(yrt.prototype.getModuleName=function(){return"ribbonButton"},yrt.prototype.destroy=function(){this.parent=null},yrt.prototype.createButton=function(e,t){var i=this,n=this.parent.createElement("button",{id:e.id}),o=(t.appendChild(n),e.buttonSettings);new zv({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===vit.Large?"Top":"Left",iconCss:o.iconCss,disabled:e.disabled,cssClass:(Bnt+" "+Hnt+" "+(o.cssClass||"")).trim(),content:e.activeSize===vit.Small?"":o.content,isPrimary:o.isPrimary,isToggle:o.isToggle,created:o.created},n),o.htmlAttributes&&(o.htmlAttributes.id&&delete o.htmlAttributes.id,zrt(n,o.htmlAttributes)),n.onclick=function(e){o.clicked&&o.clicked.call(i,e)},o.content?n.setAttribute("aria-label",o.content):n.setAttribute("aria-label","button")},yrt.prototype.addOverFlowEvents=function(t,e,i){var n=this,e=e.querySelector("#"+t.id),o=(e.setAttribute("data-control",t.type.toString()),At(e,zv));o.setProperties({cssClass:o.cssClass+" "+znt}),e.onclick=function(e){t.buttonSettings.clicked&&t.buttonSettings.clicked.call(n,e),i.element.classList.contains("e-active")&&i.toggle()}},yrt.prototype.removeOverFlowEvents=function(t,e){var i=this,e=e.querySelector("#"+t.id),n=At(e,zv),o=(o=n.cssClass.split(" ")).filter(function(e){return e!==znt});n.setProperties({cssClass:o.join(" ")}),e.onclick=function(e){t.buttonSettings.clicked&&t.buttonSettings.clicked.call(i,e)}},yrt.prototype.click=function(e){var e=Rrt(this.parent,e);!e||(e=At(e,zv)).disabled||e.click()},yrt.prototype.updateButton=function(e,t){var i,n=Mrt(this.parent.tabs,t);n&&(I(n.item.buttonSettings,e),t=Rrt(this.parent,t,n))&&(i=At(t,zv),e.isToggle&&t.classList.add("e-active"),e.cssClass&&(e.cssClass=(Bnt+" "+Hnt+" "+e.cssClass).trim()),e.content&&(e.content=n.item.activeSize===vit.Small?"":e.content,t.setAttribute("aria-label",e.content)),delete e.clicked,i.setProperties(e))},yrt.prototype.updateButtonSize=function(e,t){At(e,zv).setProperties({iconPosition:t.activeSize===vit.Large?"Top":"Left",content:t.activeSize===vit.Small?"":t.buttonSettings.content})},yrt);function yrt(e){this.parent=e}brt.prototype.getModuleName=function(){return"ribbonCheckBox"},brt.prototype.destroy=function(){this.parent=null},brt.prototype.createCheckBox=function(e,t){var i=this,n=this.parent.createElement("input",{id:e.id}),o=(t.appendChild(n),e.checkBoxSettings);o.htmlAttributes&&o.htmlAttributes.id&&delete o.htmlAttributes.id,new ib({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,checked:o.checked,cssClass:(Hnt+" "+(o.cssClass||"")).trim(),label:o.label,labelPosition:o.labelPosition,disabled:e.disabled,created:o.created,htmlAttributes:o.htmlAttributes,change:function(e){o.change&&o.change.call(i,e)}},n)},brt.prototype.addOverFlowEvents=function(t,e,i){var n=this,e=e.querySelector("#"+t.id),e=(e.setAttribute("data-control",t.type.toString()),At(e,ib));e.cssClass=e.cssClass+" "+znt,e.dataBind(),e.change=function(e){t.checkBoxSettings.change&&t.checkBoxSettings.change.call(n,e),i.element.classList.contains("e-active")&&i.toggle()}},brt.prototype.removeOverFlowEvents=function(t,e){var i=this,e=At(e.querySelector("#"+t.id),ib),n=(n=e.cssClass.split(" ")).filter(function(e){return e!==znt});e.cssClass=n.join(" "),e.dataBind(),e.change=function(e){t.checkBoxSettings.change&&t.checkBoxSettings.change.call(i,e)}},brt.prototype.click=function(e){var e=Rrt(this.parent,e);!e||(e=At(e,ib)).disabled||e.click()},brt.prototype.updateCheckBox=function(e,t){var i=Mrt(this.parent.tabs,t);i&&(I(i.item.checkBoxSettings,e),t=Rrt(this.parent,t,i))&&(e.cssClass&&(e.cssClass=(Hnt+" "+e.cssClass).trim()),delete e.change,At(t,ib).setProperties(e))};var vrt=brt;function brt(e){this.parent=e}wrt.prototype.getModuleName=function(){return"ribbonColorPicker"},wrt.prototype.destroy=function(){this.parent=null},wrt.prototype.createColorPicker=function(e,t){var i=this,n=this.parent.createElement("input",{id:e.id}),o=(t.appendChild(n),e.colorPickerSettings),r=new cV({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,columns:o.columns,cssClass:(Hnt+" "+(o.cssClass||"")).trim(),disabled:e.disabled,enableOpacity:o.enableOpacity,mode:o.mode,modeSwitcher:o.modeSwitcher,noColor:o.noColor,presetColors:o.presetColors,showButtons:o.showButtons,value:o.value,beforeClose:function(){r.element.parentElement.classList.remove(jnt),o.beforeClose&&o.beforeClose.call(i)},beforeOpen:o.beforeOpen,beforeTileRender:o.beforeTileRender,created:o.created,change:function(e){o.value=e.value.toString(),o.change&&o.change.call(i,e)},open:function(){r.element.parentElement.classList.add(jnt),o.open&&o.open.call(i)},select:o.select},n),t=(o.htmlAttributes&&(o.htmlAttributes.id&&delete o.htmlAttributes.id,zrt(n,o.htmlAttributes)),r.element.parentElement);E.add(t,"mouseenter",this.toggleWrapperHover.bind(this,t,!0),this),E.add(t,"mouseleave",this.toggleWrapperHover.bind(this,t,!1),this)},wrt.prototype.toggleWrapperHover=function(e,t){t?e.classList.add(_nt):e.classList.remove(_nt)},wrt.prototype.addOverFlowEvents=function(t,e,i){var n,o=this,r=t.colorPickerSettings,r=(r.label&&"Simplified"===this.parent.activeLayout&&(r=this.parent.createElement("div",{className:"e-ribbon-colorpicker-label",id:t.id+"_label",innerHTML:r.label}),e.insertBefore(r,e.firstChild)),e.querySelector("#"+t.id)),s=(r.setAttribute("data-control",t.type.toString()),At(r,cV)),e=(s.setProperties({cssClass:s.cssClass+" "+znt}),s.splitBtn);s.beforeClose=function(e){n=e.event?e.event.target:null,s.element.parentElement.classList.remove(jnt),t.colorPickerSettings.beforeClose&&t.colorPickerSettings.beforeClose.call(o)},e.close=function(){n&&!n.closest(".e-ribbon-group-overflow-ddb")&&i.element.classList.contains("e-active")&&i.toggle()}},wrt.prototype.removeOverFlowEvents=function(e,t){var i=this;e.colorPickerSettings.label&&(o=t.querySelector("#"+e.id+"_label"))&&o.remove();var n=At(t.querySelector("#"+e.id),cV),o=(o=n.cssClass.split(" ")).filter(function(e){return e!==znt});n.setProperties({cssClass:o.join(" ")}),n.splitBtn.close=null,n.beforeClose=function(){n.element.parentElement.classList.remove(jnt),e.colorPickerSettings.beforeClose&&e.colorPickerSettings.beforeClose.call(i)}},wrt.prototype.getColorPickerObj=function(e){e=Rrt(this.parent,e);return e?At(e,cV):null},wrt.prototype.getValue=function(e,t,i){e=this.getColorPickerObj(e);return e?e.getValue(t,i):""},wrt.prototype.toggle=function(e){e=this.getColorPickerObj(e);e&&!e.disabled&&e.toggle()},wrt.prototype.updateColorPicker=function(e,t){var i=Mrt(this.parent.tabs,t);i&&(I(i.item.checkBoxSettings,e),t=Rrt(this.parent,t,i))&&(e.cssClass&&(e.cssClass=(Hnt+" "+e.cssClass).trim()),delete e.beforeClose,delete e.open,At(t,cV).setProperties(e))},wrt.prototype.unwireColorPickerEvents=function(e){e=At(e,cV).element.parentElement;E.remove(e,"mouseenter",this.toggleWrapperHover),E.remove(e,"mouseleave",this.toggleWrapperHover)};set=wrt;function wrt(e){this.parent=e}Srt.prototype.getModuleName=function(){return"ribbonComboBox"},Srt.prototype.destroy=function(){this.parent=null},Srt.prototype.createComboBox=function(e,t){var i=this,n=this.parent.createElement("input",{id:e.id}),o=(t.appendChild(n),e.comboBoxSettings);o.htmlAttributes&&o.htmlAttributes.id&&delete o.htmlAttributes.id,new oU({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,allowCustom:!1,floatLabelType:"Never",ignoreAccent:!0,ignoreCase:!0,allowFiltering:o.allowFiltering,autofill:o.autofill,cssClass:(Hnt+" "+(o.cssClass||"")).trim(),dataSource:o.dataSource,enabled:!e.disabled,fields:o.fields,filterType:o.filterType,footerTemplate:o.footerTemplate,groupTemplate:o.groupTemplate,headerTemplate:o.headerTemplate,index:o.index,itemTemplate:o.itemTemplate,noRecordsTemplate:o.noRecordsTemplate,placeholder:o.placeholder,popupHeight:o.popupHeight,popupWidth:o.popupWidth,showClearButton:o.showClearButton,sortOrder:o.sortOrder,text:o.text,value:o.value,width:o.width,beforeOpen:o.beforeOpen,open:o.open,htmlAttributes:o.htmlAttributes,close:function(e){o.close&&o.close.call(i,e)},filtering:o.filtering,change:o.change,select:o.select,created:o.created},n)},Srt.prototype.addOverFlowEvents=function(i,e,n){var o=this,t=i.comboBoxSettings,t=(t.label&&"Simplified"===this.parent.activeLayout&&(t=this.parent.createElement("div",{className:"e-ribbon-combobox-label",id:i.id+"_label",innerHTML:t.label}),e.insertBefore(t,e.firstChild)),e.querySelector("#"+i.id)),e=(t.setAttribute("data-control",i.type.toString()),At(t,oU));e.setProperties({cssClass:e.cssClass+" "+znt}),e.close=function(e){var t=e.event?e.event.target:null;i.comboBoxSettings.close&&i.comboBoxSettings.close.call(o,e),t&&!t.closest(".e-ribbon-group-overflow-ddb")&&n.element.classList.contains("e-active")&&n.toggle()}},Srt.prototype.removeOverFlowEvents=function(t,e){var i=this;t.comboBoxSettings.label&&(n=e.querySelector("#"+t.id+"_label"))&&n.remove();var n=At(e.querySelector("#"+t.id),oU),e=(e=n.cssClass.split(" ")).filter(function(e){return e!==znt});n.setProperties({cssClass:e.join(" ")}),n.close=function(e){t.comboBoxSettings.close&&t.comboBoxSettings.close.call(i,e)}},Srt.prototype.getComboBoxObj=function(e){e=Rrt(this.parent,e);return e?At(e,oU):null},Srt.prototype.filter=function(e,t,i,n){this.getComboBoxObj(e).filter(t,i,n)},Srt.prototype.hidePopup=function(e){e=this.getComboBoxObj(e);e&&e.hidePopup()},Srt.prototype.showPopup=function(e){e=this.getComboBoxObj(e);e&&e.showPopup()},Srt.prototype.updateComboBox=function(e,t){var i=Mrt(this.parent.tabs,t);i&&(I(i.item.comboBoxSettings,e),t=Rrt(this.parent,t,i))&&(e.cssClass&&(e.cssClass=(Hnt+" "+e.cssClass).trim()),delete e.close,At(t,oU).setProperties(e))};var Crt=Srt;function Srt(e){this.parent=e}xrt.prototype.getModuleName=function(){return"ribbonDropDown"},xrt.prototype.destroy=function(){this.parent=null},xrt.prototype.createDropDown=function(e,t){var i=this,n=this.parent.createElement("button",{id:e.id}),o=(t.appendChild(n),e.dropDownSettings),t=(Bnt+" "+Hnt+" "+(o.cssClass||"")).trim();new u2({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===vit.Large?"Top":"Left",closeActionEvents:o.closeActionEvents,content:e.activeSize===vit.Small?"":o.content,cssClass:t+(e.activeSize===vit.Large?" "+Ont:""),disabled:e.disabled,iconCss:o.iconCss,items:o.items,target:o.target,createPopupOnClick:o.createPopupOnClick,beforeClose:function(e){o.beforeClose&&o.beforeClose.call(i,e)},beforeItemRender:o.beforeItemRender,beforeOpen:o.beforeOpen,close:function(e){o.close&&o.close.call(i,e)},created:o.created,open:o.open,select:o.select}).appendTo(n),o.htmlAttributes&&(o.htmlAttributes.id&&delete o.htmlAttributes.id,zrt(n,o.htmlAttributes))},xrt.prototype.addOverFlowEvents=function(t,e,i){var n,o=this,e=e.querySelector("#"+t.id),e=(e.setAttribute("data-control",t.type.toString()),At(e,u2));e.cssClass=e.cssClass+" "+znt,e.dataBind(),e.beforeClose=function(e){t.dropDownSettings.beforeClose&&t.dropDownSettings.beforeClose.call(o,e),n=e.event?e.event.target:null},e.close=function(e){t.dropDownSettings.close&&t.dropDownSettings.close.call(o,e),n&&!n.closest(".e-ribbon-group-overflow-ddb")&&i.element.classList.contains("e-active")&&i.toggle()}},xrt.prototype.removeOverFlowEvents=function(t,e){var i=this,e=At(e.querySelector("#"+t.id),u2),n=(n=e.cssClass.split(" ")).filter(function(e){return e!==znt});e.cssClass=n.join(" "),e.dataBind(),e.close=function(e){t.dropDownSettings.close&&t.dropDownSettings.close.call(i,e)},e.beforeClose=function(e){t.dropDownSettings.beforeClose&&t.dropDownSettings.beforeClose.call(i,e)}},xrt.prototype.createOverFlowDropDown=function(e,t,i,n,o,r){var s=this,r=(this.enableRtl=r,this.parent.createElement("button",{id:e+rrt+srt})),e=(n.setAttribute("tabindex","0"),o.appendChild(r),new u2({iconCss:i,target:n,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,cssClass:Ont+" "+vot,iconPosition:"Top",content:t,beforeClose:function(e){e.cancel=!je(e.event&&z(e.event.target,"."+znt))}},r));return Vrt(n,this.parent),r.onclick=r.onkeydown=function(){s.itemIndex=0},n.onkeydown=function(e){s.keyActionHandler(e,n)},e},xrt.prototype.keyActionHandler=function(e,t){var i,n=Array.prototype.slice.call(t.querySelectorAll(".e-control")),o=Array.prototype.slice.call(t.querySelectorAll(".e-ribbon-template")),r=n.concat(o),s=t.querySelectorAll(".e-combobox");if(s)for(var a=0;a<s.length;a++)s[parseInt(a.toString(),10)].closest(".e-input-focus")&&(i=s[parseInt(a.toString(),10)]);if(i)for(a=0;a<r.length;a++)r[parseInt(a.toString(),10)].classList.contains("e-combobox")&&r[parseInt(a.toString(),10)].closest(".e-input-focus")&&(this.itemIndex=a);(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-launcher-icon")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-first-item"))&&("ArrowRight"!==e.key&&(e.shiftKey||"Tab"!==e.key)||this.handleNavigation(e,!this.enableRtl,r),"ArrowLeft"===e.key||e.shiftKey&&"Tab"===e.key)&&this.handleNavigation(e,this.enableRtl,r)},xrt.prototype.handleNavigation=function(e,t,i){i[0].classList.contains("e-ribbon-first-item")||i[0].classList.add("e-ribbon-first-item"),i[i.length-1].classList.contains("e-ribbon-last-item")||i[i.length-1].classList.add("e-ribbon-last-item"),t?(0===this.itemIndex&&i[parseInt(this.itemIndex.toString(),10)].classList.contains("e-ribbon-first-item")&&this.updateItemIndex(e,i,!0),e.target.classList.contains("e-combobox")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-group-container")||!e.target.classList.contains("e-ribbon-first-item")&&0===this.itemIndex||!e.target.classList.contains("e-control")&&!e.target.classList.contains("e-ribbon-template")||(this.itemIndex++,this.updateItemIndex(e,i,!0)),e.target.classList.contains("e-ribbon-last-item")&&!this.focusLauncherIcon(e,i)&&(this.itemIndex=0,this.updateItemIndex(e,i,!0)),e.target.classList.contains("e-ribbon-launcher-icon")&&(this.itemIndex=0,this.updateItemIndex(e,i,!0))):(e.target.classList.contains("e-combobox")||0===this.itemIndex||(this.itemIndex--,this.updateItemIndex(e,i,!1)),e.target.classList.contains("e-ribbon-first-item")&&!this.focusLauncherIcon(e,i)&&(this.itemIndex=i.length-1,this.updateItemIndex(e,i,!1)),e.target.classList.contains("e-ribbon-launcher-icon")&&(this.itemIndex=i.length-1,this.updateItemIndex(e,i,!1))),e.target.classList.contains("e-combobox")&&"Tab"===e.key&&(t?this.itemIndex<i.length-1&&this.itemIndex++:0<this.itemIndex&&this.itemIndex--)},xrt.prototype.focusLauncherIcon=function(e,t){var i,t=t[parseInt(this.itemIndex.toString(),10)].closest(".e-ribbon-group-container");return!!(i=t?t.querySelector(".e-ribbon-launcher-icon"):i)&&("Tab"===e.key&&e.preventDefault(),t.querySelector(".e-ribbon-launcher-icon").focus(),!0)},xrt.prototype.updateItemIndex=function(e,t,i){for(var n=t[this.itemIndex].closest(".e-ribbon-item");n&&n.classList.contains("e-disabled");){if(i)if(this.itemIndex<t.length-1)this.itemIndex++;else{if(this.focusLauncherIcon(e,t))break;this.itemIndex=0}else if(0<this.itemIndex)this.itemIndex--;else{if(this.focusLauncherIcon(e,t))break;this.itemIndex=t.length-1}n=t[this.itemIndex].closest(".e-ribbon-item")}"Tab"===e.key&&e.preventDefault(),t[parseInt(this.itemIndex.toString(),10)].focus()},xrt.prototype.removeOverFlowDropDown=function(e){var t=At(e,u2);At(t.target,NS).destroy(),e.parentElement.parentElement.insertBefore(t.target,e.parentElement),t.destroy(),ue(e)},xrt.prototype.getDDBItemElement=function(e,t){return At(e,u2).dropDown.element.querySelector("#"+t)},xrt.prototype.getOverflowDropDownPopup=function(e,t){return At(t.querySelector("#"+this.parent.tabs[e.tabIndex].groups[e.groupIndex].id+rrt+srt),u2).dropDown.element},xrt.prototype.getDropDownObj=function(e){e=Rrt(this.parent,e);return e?At(e,u2):null},xrt.prototype.addItems=function(e,t,i){this.getDropDownObj(e).addItems(t,i)},xrt.prototype.removeItems=function(e,t,i){this.getDropDownObj(e).removeItems(t,i)},xrt.prototype.toggle=function(e){e=this.getDropDownObj(e);e&&!e.disabled&&e.toggle()},xrt.prototype.updateDropDown=function(e,t){var i=Mrt(this.parent.tabs,t);i&&(I(i.item.dropDownSettings,e),t=Rrt(this.parent,t,i))&&(t=At(t,u2),e.cssClass&&(e.cssClass=(Hnt+" "+Bnt+" "+e.cssClass).trim(),e.cssClass=i.item.activeSize===vit.Large?(Ont+" "+e.cssClass).trim():e.cssClass,t.cssClass=e.cssClass),delete e.close,delete e.beforeClose,e.content&&(e.content=i.item.activeSize===vit.Small?"":e.content),t.setProperties(e))},xrt.prototype.updateDropDownSize=function(e,t){var e=At(e,u2),i=e.cssClass.split(" ");t.activeSize===vit.Large?i.push(Ont):i=i.filter(function(e){return e!==Ont}),e.cssClass=i.join(" "),e.setProperties({iconPosition:t.activeSize===vit.Large?"Top":"Left"}),e.setProperties({content:t.activeSize===vit.Small?"":t.dropDownSettings.content})};var Art=xrt;function xrt(e){this.parent=e}Trt.prototype.getModuleName=function(){return"ribbonSplitButton"},Trt.prototype.destroy=function(){this.parent=null},Trt.prototype.createSplitButton=function(e,t){var i=this,n=this.parent.createElement("button",{id:e.id}),o=(t.appendChild(n),e.splitButtonSettings),t=(Bnt+" "+Hnt+" "+(o.cssClass||"")).trim(),r=new b2({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===vit.Large?"Top":"Left",closeActionEvents:o.closeActionEvents,cssClass:t+(e.activeSize===vit.Large?" "+Ont:""),disabled:e.disabled,iconCss:o.iconCss,items:o.items,target:o.target,beforeClose:function(e){o.beforeClose&&o.beforeClose.call(i,e)},beforeItemRender:o.beforeItemRender,beforeOpen:o.beforeOpen,close:function(){r.wrapper.classList.remove(jnt),o.close&&o.close.call(i)},created:o.created,open:function(){r.wrapper.classList.add(jnt),o.open&&o.open.call(i)},select:o.select,click:function(e){o.click&&o.click.call(i,e)}},n),s=(o.htmlAttributes&&(o.htmlAttributes.id&&delete o.htmlAttributes.id,zrt(n,o.htmlAttributes)),n.parentElement.querySelector(".e-dropdown-btn")),a=(s.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),s.click())},this.setContent(e,r),r.wrapper);E.add(a,"mouseenter",function(){a.classList.add(_nt)},this),E.add(a,"mouseleave",function(){a.classList.remove(_nt)},this)},Trt.prototype.addOverFlowEvents=function(t,e,i){var n,o=this,e=e.querySelector("#"+t.id),r=(e.setAttribute("data-control",t.type.toString()),At(e,b2)),s=(r.cssClass=r.cssClass+" "+znt,r.dataBind(),e.parentElement.querySelector(".e-dropdown-btn")),e=s.getAttribute("id"),a=document.querySelector("#"+e+"-popup");s.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),s.click())},a.onkeydown=function(e){"Enter"===e.key&&(e.preventDefault(),r.wrapper.classList.remove("e-ribbon-open"),a.querySelector(".e-focused").click())},r.beforeClose=function(e){t.splitButtonSettings.beforeClose&&t.splitButtonSettings.beforeClose.call(o,e),n=e.event?e.event.target:null},r.click=function(e){t.splitButtonSettings.click&&t.splitButtonSettings.click.call(o,e),i.element.classList.contains("e-active")&&i.toggle()},r.close=function(e){t.splitButtonSettings.close&&t.splitButtonSettings.close.call(o,e),r.wrapper.classList.remove(jnt),n&&!n.closest(".e-ribbon-group-overflow-ddb")&&i.element.classList.contains("e-active")&&i.toggle()}},Trt.prototype.removeOverFlowEvents=function(t,e){var i=this,n=At(e.querySelector("#"+t.id),b2),e=(e=n.cssClass.split(" ")).filter(function(e){return e!==znt});n.cssClass=e.join(" "),n.dataBind(),n.beforeClose=function(e){t.splitButtonSettings.beforeClose&&t.splitButtonSettings.beforeClose.call(i,e)},n.click=function(e){t.splitButtonSettings.click&&t.splitButtonSettings.click.call(i,e)},n.close=function(e){t.splitButtonSettings.close&&t.splitButtonSettings.close.call(i,e),n.wrapper.classList.remove(jnt)}},Trt.prototype.setContent=function(e,t){t.primaryBtnObj.setProperties({content:e.activeSize===vit.Medium?e.splitButtonSettings.content:""}),t.secondaryBtnObj.setProperties({content:e.activeSize===vit.Large?e.splitButtonSettings.content:""})},Trt.prototype.getSplitButtonObj=function(e){return At(Rrt(this.parent,e),b2)},Trt.prototype.addItems=function(e,t,i){this.getSplitButtonObj(e).addItems(t,i)},Trt.prototype.removeItems=function(e,t,i){this.getSplitButtonObj(e).removeItems(t,i)},Trt.prototype.toggle=function(e){e=this.getSplitButtonObj(e);e&&!e.disabled&&e.toggle()},Trt.prototype.updateSplitButton=function(e,t){var i=Mrt(this.parent.tabs,t);i&&(I(i.item.splitButtonSettings,e),t=Rrt(this.parent,t,i))&&(t=At(t,b2),e.cssClass&&(e.cssClass=(Hnt+" "+Bnt+" "+e.cssClass).trim(),e.cssClass=i.item.activeSize===vit.Large?(Ont+" "+e.cssClass).trim():e.cssClass,t.cssClass=e.cssClass),delete e.open,delete e.click,delete e.close,delete e.beforeClose,t.setProperties(e),e.content)&&this.setContent(i.item,t)},Trt.prototype.updateSplitButtonSize=function(e,t){var e=At(e,b2),i=e.cssClass.split(" ");t.activeSize===vit.Large?i.push(Ont):i=i.filter(function(e){return e!==Ont}),e.cssClass=i.join(" "),e.setProperties({iconPosition:t.activeSize===vit.Large?"Top":"Left"}),this.setContent(t,e)};var Irt=Trt;function Trt(e){this.parent=e}function Ert(e,t){for(var i=0;i<e.length;i++)if(t(e[parseInt(i.toString(),10)],i))return i;return-1}function Drt(t){if("string"!=typeof t)return oo(t);var i="";try{var e=ge(t),i=e?"SCRIPT"===e.tagName?e.innerHTML:e.outerHTML:t}catch(e){i=t}return oo(i)}function Mrt(e,t,i){for(var n=0;n<e.length;n++)for(var o=e[parseInt(n.toString(),10)],r=0;r<o.groups.length;r++)for(var s=o.groups[parseInt(r.toString(),10)],a=0;a<s.collections.length;a++)for(var l=s.collections[parseInt(a.toString(),10)],h=0;h<l.items.length;h++){var d=l.items[parseInt(h.toString(),10)];if(t&&d.id===t||i&&d.type===i)return{item:d,collection:l,group:s,tabIndex:n,groupIndex:r,collectionIndex:a,itemIndex:h}}return null}function krt(e,t){for(var i=0;i<e.length;i++)for(var n=e[parseInt(i.toString(),10)],o=0;o<n.groups.length;o++)for(var r=n.groups[parseInt(o.toString(),10)],s=0;s<r.collections.length;s++){var a=r.collections[parseInt(s.toString(),10)];if(a.id===t)return{collection:a,group:r,tabIndex:i,groupIndex:o,collectionIndex:s}}return null}function Prt(e,t){for(var i=0;i<e.length;i++)for(var n=e[parseInt(i.toString(),10)],o=0;o<n.groups.length;o++){var r=n.groups[parseInt(o.toString(),10)];if(r.id===t)return{group:r,tabIndex:i,groupIndex:o}}return null}function Brt(e,t){At(e,t).destroy()}function Frt(e,t,i){At(e,t).setProperties(i)}function Lrt(e,t,i){At(e,t).setProperties("combobox"===t?{enabled:!i}:{disabled:i})}function Rrt(e,t,i){var n;return!(i=i||Mrt(e.tabs,t))||""===(n=e.tabObj.items[i.tabIndex].content).innerHTML?null:e.activeLayout===fit.Classic?i.item.displayOptions&bit.Classic?(n=i.group.isCollapsed?e.ribbonDropDownModule.getOverflowDropDownPopup(i,n):n).querySelector("#"+t):null:(i.item.displayOptions&bit.Simplified?n.querySelector("#"+i.item.id):null)||(i.group.enableGroupOverflow?At(n.querySelector("#"+i.group.id+ert),u2):e.overflowDDB).target.querySelector("#"+i.item.id)}function Ort(e){return!!(e.content||e.iconCss||e.title||e.id||e.cssClass)}function Nrt(e,t,i){var n,o=e.target.getAttribute("id"),e=i.filter(function(e){return e.id===o})[0].data,i=t.createElement("div",{id:e.id?Vot+"_"+e.id:Vot}),r=(t.element.append(i),e.title&&(r=t.createElement("div",{innerHTML:e.title,className:Rot}),i.appendChild(r)),t.createElement("div",{className:_ot}));i.appendChild(r),e.iconCss&&(n=t.createElement("div",{className:e.iconCss+" "+Not}),r.appendChild(n)),e.content&&(n=t.createElement("div",{innerHTML:e.content,className:Oot}),r.appendChild(n)),t.setProperties({content:i,cssClass:e.cssClass?e.cssClass+" "+Fot:Fot})}function Vrt(e,t){var i=new NS({target:"."+Lot,beforeRender:function(e){Nrt(e,i,t.tooltipData)}.bind(this),windowCollision:!0});i.appendTo(e)}function _rt(e){At(e,NS).destroy()}function Hrt(e,t){At(e,NS).setProperties(t)}function zrt(e,t){for(var i in t){var n;"class"===i?(n=t.class.replace(/\s+/g," ").trim())&&U([e],n.split(" ")):"style"===i?(n=""+(e.getAttribute("style")||"")+t[""+i],e.setAttribute(""+i,n)):e.setAttribute(i,t[""+i])}}Wrt.prototype.getModuleName=function(){return"ribbonGroupButton"},Wrt.prototype.destroy=function(){this.parent=null},Wrt.prototype.createGroupButton=function(t,e){var i=this,n=t.groupButtonSettings,o=(this.count=0,this.parent.createElement("div",{id:t.id+crt,className:"e-btn-group"}));e.appendChild(o);for(var r,s=0;s<n.items.length;s++)n.items[parseInt(s.toString(),10)].iconCss&&(r=this.parent.createElement("button",{id:t.id+crt+s,className:lot}),o.appendChild(r),new zv({iconCss:n.items[parseInt(s.toString(),10)].iconCss,disabled:t.disabled,enableRtl:this.parent.enableRtl,content:t.activeSize===vit.Small?"":n.items[parseInt(s.toString(),10)].content,iconPosition:t.activeSize===vit.Large?"Top":"Left"},r),n.items[parseInt(s.toString(),10)].htmlAttributes&&zrt(r,n.items[parseInt(s.toString(),10)].htmlAttributes),n.items[parseInt(s.toString(),10)].content?(r.classList.add(dot),r.setAttribute("aria-label",n.items[parseInt(s.toString(),10)].content)):r.setAttribute("aria-label","groupbuttonitem"),d=e.querySelector("#"+t.id+crt+s),n.selection===Cit.Single?o.classList.add(sot):o.classList.add(aot),n.items[parseInt(s.toString(),10)].selected&&(n.selection===Cit.Multiple?d.classList.add("e-active"):this.count<1&&(d.classList.add("e-active"),this.count++)),n.items[parseInt(s.toString(),10)].ribbonTooltipSettings&&Ort(n.items[parseInt(s.toString(),10)].ribbonTooltipSettings)&&(r.classList.add(Lot),this.parent.tooltipData.push({id:r.id,data:n.items[parseInt(s.toString(),10)].ribbonTooltipSettings})),E.add(d,"click",this.groupButtonClicked.bind(this,s,t,n),this));if("Simplified"===this.parent.activeLayout){var a=void 0,l=0,h=0,d=this.parent.createElement("button",{id:t.id});e.appendChild(d);for(s=0;s<n.items.length;s++)t.groupButtonSettings.items[parseInt(s.toString(),10)].selected&&!this.isSelected&&n.selection===Cit.Single?(a=t.groupButtonSettings.items[parseInt(s.toString(),10)].iconCss,this.isSelected=!0):t.groupButtonSettings.items[parseInt(s.toString(),10)].selected&&n.selection===Cit.Multiple&&(a=1===++l?t.groupButtonSettings.items[parseInt(s.toString(),10)].iconCss:null);for(;h<t.groupButtonSettings.items.length&&!this.isSelected&&!a;)t.groupButtonSettings.items[parseInt(h.toString(),10)].iconCss&&(a=t.groupButtonSettings.items[parseInt(h.toString(),10)].iconCss,this.isSelected=!0),h++;var p=new u2({iconCss:a,target:o,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:t.disabled},d);n.header&&(p=p.dropDown,this.addGroupButtonHeader(t.id,n,p.element)),d.onclick=d.onkeydown=function(){i.handleFocusState(t,e)},o.onkeydown=function(e){"Simplified"===i.parent.activeLayout&&i.handleGroupButtonNavigation(e,t)},Vrt(o,this.parent),this.isSelected=!1}},Wrt.prototype.groupButtonClicked=function(e,t,i){for(var n=[],o=[],r=[],s=0;s<i.items.length;s++)document.querySelector("#"+t.id+crt+s)&&document.querySelector("#"+t.id+crt+s).classList.contains("e-active")&&n.push(i.items[parseInt(s.toString(),10)]);document.querySelector("#"+t.id+crt+e).classList.contains("e-active")||o.push(i.items[parseInt(e.toString(),10)]);o={cancel:!1,previousItems:n,selectingItems:o};if(i.items[parseInt(e.toString(),10)].beforeClick&&i.items[parseInt(e.toString(),10)].beforeClick.call(this,o),!o.cancel){if(i.selection===Cit.Single){document.querySelector("#"+t.id+crt).classList.contains(aot)&&(document.querySelector("#"+t.id+crt).classList.remove(aot),document.querySelector("#"+t.id+crt).classList.add(sot));for(s=0;s<i.items.length;s++)document.querySelector("#"+t.id+crt+s)&&document.querySelector("#"+t.id+crt+s).classList.contains("e-active")&&(document.querySelector("#"+t.id+crt+s).classList.remove("e-active"),i.items[parseInt(s.toString(),10)].setProperties({selected:!1},!0));document.querySelector("#"+t.id+crt+e).classList.toggle("e-active"),i.items[parseInt(e.toString(),10)].setProperties({selected:!0},!0),document.querySelector("#"+t.id+crt+e).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&(this.grpBtnIndex=e,(p=At(document.querySelector("#"+t.id),u2)).setProperties({iconCss:i.items[parseInt(e.toString(),10)].iconCss}))}else{document.querySelector("#"+t.id+crt).classList.contains(sot)&&(document.querySelector("#"+t.id+crt).classList.remove(sot),document.querySelector("#"+t.id+crt).classList.add(aot)),document.querySelector("#"+t.id+crt+e).classList.toggle("e-active"),document.querySelector("#"+t.id+crt+e).classList.contains("e-active")?i.items[parseInt(e.toString(),10)].setProperties({selected:!0},!0):i.items[parseInt(e.toString(),10)].setProperties({selected:!1},!0);for(var a=0,l=0;l<i.items.length;l++)document.querySelector("#"+t.id+crt+l)&&document.querySelector("#"+t.id+crt+l).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&l!==e&&(this.isSelected=!0,a++);if("Simplified"===this.parent.activeLayout){var h=null,d=0,p=At(document.querySelector("#"+t.id),u2);if(this.isSelected){if(1===a&&!document.querySelector("#"+t.id+crt+e).classList.contains("e-active"))for(l=0;l<i.items.length;l++)document.querySelector("#"+t.id+crt+l)&&document.querySelector("#"+t.id+crt+l).classList.contains("e-active")&&(h=i.items[parseInt(l.toString(),10)].iconCss)}else document.querySelector("#"+t.id+crt+e).classList.contains("e-active")&&(h=i.items[parseInt(e.toString(),10)].iconCss);for(;d<i.items.length&&!h;)i.items[parseInt(d.toString(),10)].iconCss&&(h=i.items[parseInt(d.toString(),10)].iconCss),d++;p.setProperties({iconCss:h}),this.grpBtnIndex=e}this.isSelected=!1}document.querySelector("#"+t.id+crt+e).classList.contains("e-active")&&r.push(i.items[parseInt(e.toString(),10)]);o={previousItems:n,selectedItems:r};i.items[parseInt(e.toString(),10)].click&&i.items[parseInt(e.toString(),10)].click.call(this,o)}},Wrt.prototype.switchGroupButton=function(t,e){var i=this,n=t.groupButtonSettings,o=null,r=0,s=0;if("Simplified"===this.parent.activeLayout){var a=e.querySelector("#"+t.id+crt),l=this.parent.createElement("button",{id:t.id});e.appendChild(l);for(var h=0;h<n.items.length;h++)document.querySelector("#"+t.id+crt+h)&&(document.querySelector("#"+t.id+crt+h).classList.contains("e-active")&&n.selection===Cit.Single?o=n.items[parseInt(h.toString(),10)].iconCss:document.querySelector("#"+t.id+crt+h).classList.contains("e-active")&&n.selection===Cit.Multiple&&(1===++r?o=n.items[parseInt(h.toString(),10)].iconCss:1<r&&(o=null)));for(;s<n.items.length&&!o;)n.items[parseInt(s.toString(),10)].iconCss&&(o=n.items[parseInt(s.toString(),10)].iconCss),s++;var d=new u2({iconCss:o,target:a,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:t.disabled},l);n.header&&(p=d.dropDown,this.addGroupButtonHeader(t.id,n,p.element)),l.onclick=l.onkeydown=function(){i.handleFocusState(t,e)},a.onkeydown=function(e){"Simplified"===i.parent.activeLayout&&i.handleGroupButtonNavigation(e,t)},Vrt(a,this.parent)}else{var p=e.querySelector("#"+t.id),d=At(p,u2);e.appendChild(d.target),p&&(d.destroy(),ue(p))}},Wrt.prototype.handleFocusState=function(e,t){t.querySelector("#"+e.id).classList.contains("e-active")&&((document.querySelector("#"+e.id+"_grpbtn").querySelector("."+lot+".e-active")||document.querySelector("#"+e.id+crt+0)).focus(),this.grpBtnIndex=0)},Wrt.prototype.addGroupButtonHeader=function(e,t,i){e=this.parent.createElement("div",{className:"e-ribbon-groupbutton-header",id:e+trt,innerHTML:t.header});i.insertBefore(e,i.firstChild)},Wrt.prototype.handleGroupButtonNavigation=function(e,t){var i=At(document.querySelector("#"+t.id),u2).target,n=!1,i=("Simplified"===this.parent.activeLayout&&i.closest(".e-ribbon-dropdown-group-button").classList.contains(hot)&&(n=!0),"Tab"===e.key&&e.preventDefault(),t.groupButtonSettings);"ArrowRight"===e.key&&!n||"ArrowDown"===e.key&&n?(!this.parent.enableRtl||"ArrowDown"===e.key&&n?(this.grpBtnIndex++,this.grpBtnIndex<i.items.length||(this.grpBtnIndex=0)):0===this.grpBtnIndex?this.grpBtnIndex=i.items.length-1:this.grpBtnIndex--,document.querySelector("#"+t.id+crt+this.grpBtnIndex).focus()):("ArrowLeft"===e.key&&!n||"ArrowUp"===e.key&&n)&&(!this.parent.enableRtl||"ArrowUp"===e.key&&n?0===this.grpBtnIndex?this.grpBtnIndex=i.items.length-1:this.grpBtnIndex--:(this.grpBtnIndex++,this.grpBtnIndex<i.items.length||(this.grpBtnIndex=0)),document.querySelector("#"+t.id+crt+this.grpBtnIndex).focus())},Wrt.prototype.addOverFlowEvents=function(e,t,i){var n=this,o=e.groupButtonSettings,r=!0,s=At(t.querySelector("#"+e.id),u2),a=(s.setProperties({cssClass:s.cssClass+" "+hot,content:o.header||""}),s.target);if(a.children.length){for(var l=0;l<a.children.length;l++)if(o.items[parseInt(l.toString(),10)].content){r=!1;break}r&&a.classList.add("e-icon-btn")}a.onclick=function(){"Simplified"===n.parent.activeLayout&&a.closest(".e-ribbon-dropdown-group-button").classList.contains(hot)&&(s.toggle(),i.element.classList.contains("e-active"))&&i.toggle()}},Wrt.prototype.removeOverFlowEvents=function(e,t){var t=t.querySelector("#"+e.id);t&&((t=(e=At(t,u2)).target).classList.contains("e-icon-btn")&&t.classList.remove("e-icon-btn"),t=(t=e.cssClass.split(" ")).filter(function(e){return e!==hot}),e.setProperties({cssClass:t.join(" "),content:""}))},Wrt.prototype.destroyDropDown=function(e){var t,e=document.querySelector("#"+e.id);e&&(t=At(e,u2),At(t.target,NS).destroy(),t.destroy(),ue(e))},Wrt.prototype.updateGroupButtonSize=function(e,t){for(var i,n=t.groupButtonSettings,o=0;o<n.items.length;o++)(i=("Classic"===this.parent.activeLayout?e:document).querySelector("#"+t.id+crt+o))&&At(i,zv).setProperties({iconPosition:t.activeSize===vit.Large?"Top":"Left",content:t.activeSize===vit.Small?"":n.items[parseInt(o.toString(),10)].content})};var jrt=Wrt;function Wrt(e){this.parent=e,this.isSelected=!1}Qrt.prototype.getModuleName=function(){return"ribbonGallery"},Qrt.prototype.destroy=function(){this.parent=null},Qrt.prototype.createGallery=function(n,e){var s=this,o=n.gallerySettings,t=(this.renderGalleryItems(o,!1,n.id,e),this.parent.createElement("button",{id:n.id+"_popupButton",className:"e-ribbon-gallery-button e-icons e-drop-icon"}));t.setAttribute("aria-label","gallerydropdownbutton"),e.appendChild(t),this.createPopup(n,t),t.onclick=function(e){var t,i=document.querySelector("#"+n.id+"_galleryPopup");i&&(t=At(i,Sv),i.classList.contains("e-popup-close")?s.showPopup(t,i,e,o,n.id):s.hidePopup(t,i,e,o,n.id))},document.onclick=function(e){for(var t,i,n=document.querySelectorAll(".e-ribbon-gallery-popup.e-popup-open"),o=0;o<n.length;o++){var r=At(n[parseInt(o.toString(),10)],Sv);if(!e.target.classList.contains("e-ribbon-gallery-button")){t=n[parseInt(o.toString(),10)].id.replace(/_galleryPopup/g,""),i=Mrt(s.parent.tabs,t),s.hidePopup(r,n[parseInt(o.toString(),10)],e,i.item.gallerySettings,t);break}if(t=n[parseInt(o.toString(),10)].id.replace(/_galleryPopup/g,""),e.target.id.replace(/_popupButton/g,"")!==t){i=Mrt(s.parent.tabs,t),s.hidePopup(r,n[parseInt(o.toString(),10)],e,i.item.gallerySettings,t);break}}}},Qrt.prototype.renderGalleryItems=function(o,r,s,a){for(var l,h,d=this,e=Mrt(this.parent.tabs,s),p=(e&&e.group&&(e.group.isCollapsible=!1),this.parent.createElement("div",{className:"e-ribbon-gallery-wrapper",id:s+"_galleryWrapper"})),t=(r||a.appendChild(p),function(i){for(var e,n=!1,t=(l=c.parent.createElement("ol",{className:"e-ribbon-gallery-container",id:s+"_galleryContainer"+i}),o.groups[parseInt(i.toString(),10)].itemHeight&&"auto"!==o.groups[parseInt(i.toString(),10)].itemHeight&&(n=!0),o.groups[parseInt(i.toString(),10)].cssClass&&l.classList.add(o.groups[parseInt(i.toString(),10)].cssClass),0);t<o.groups[parseInt(i.toString(),10)].items.length&&"break"!==function(t){h=c.parent.createElement("li",{className:"e-ribbon-gallery-item",id:(r?"popup_":"")+l.id+"_gallery"+t,attrs:{tabindex:"0"}});var e={name:"beforeItemRender",item:o.groups[parseInt(i.toString(),10)].items[parseInt(t.toString(),10)]};if(o.beforeItemRender&&o.beforeItemRender.call(c,e),l.appendChild(h),o.selectedItemIndex&&o.selectedItemIndex===c.count?h.classList.add("e-ribbon-gallery-selected"):o.selectedItemIndex||0!==c.count||(h.classList.add("e-ribbon-gallery-selected"),o.selectedItemIndex=c.count),c.count=c.count+1,h.onclick=function(e){d.setActiveState(e.currentTarget,o,s,!0,e,r)},h.onkeydown=function(e){"Enter"!==e.key&&" "!==e.key||d.setActiveState(e.currentTarget,o,s,!0,e,r)},h.onmouseover=function(e){e={event:e,name:"itemHover",item:o.groups[parseInt(i.toString(),10)].items[parseInt(t.toString(),10)]};o.itemHover&&o.itemHover.call(d,e)},o.groups[parseInt(i.toString(),10)].itemWidth&&"auto"!==o.groups[parseInt(i.toString(),10)].itemWidth&&(h.style.width=o.groups[parseInt(i.toString(),10)].itemWidth+"px"),o.groups[parseInt(i.toString(),10)].itemHeight&&"auto"!==o.groups[parseInt(i.toString(),10)].itemHeight&&(h.style.height=o.groups[parseInt(i.toString(),10)].itemHeight+"px",h.style.paddingTop="0px",h.style.paddingBottom="0px","Simplified"===c.parent.activeLayout||r||(l.style.flexFlow="wrap")),(!o.template&&!o.popupTemplate||o.template&&!o.popupTemplate&&r||o.popupTemplate&&!o.template&&!r)&&(o.groups[parseInt(i.toString(),10)].items[parseInt(t.toString(),10)].htmlAttributes&&zrt(h,o.groups[parseInt(i.toString(),10)].items[parseInt(t.toString(),10)].htmlAttributes),o.groups[parseInt(i.toString(),10)].items[parseInt(t.toString(),10)].iconCss&&(e=c.parent.createElement("span",{className:"e-ribbon-gallery-icons "+o.groups[parseInt(i.toString(),10)].items[parseInt(t.toString(),10)].iconCss}),h.appendChild(e),"Simplified"!==c.parent.activeLayout||r||e.classList.add("e-hidden")),o.groups[parseInt(i.toString(),10)].items[parseInt(t.toString(),10)].content&&h.appendChild(c.parent.createElement("span",{innerHTML:o.groups[parseInt(i.toString(),10)].items[parseInt(t.toString(),10)].content,className:"e-ribbon-gallery-text"})),o.groups[parseInt(i.toString(),10)].items[parseInt(t.toString(),10)].disabled&&h.classList.add("e-disabled"),o.groups[parseInt(i.toString(),10)].items[parseInt(t.toString(),10)].cssClass)&&h.classList.add(o.groups[parseInt(i.toString(),10)].items[parseInt(t.toString(),10)].cssClass),o.template&&!r&&c.createGalleryTemplate(h,o,s,o.groups[parseInt(i.toString(),10)].items[parseInt(t.toString(),10)]),o.popupTemplate&&r&&c.createGalleryPopupTemplate(h,o,s,o.groups[parseInt(i.toString(),10)].items[parseInt(t.toString(),10)]),!r&&!n&&o.itemCount===c.count)return p.appendChild(l),c.isAdded=!0,"break"}(t);t++);if(c.isAdded&&!r)return"break";(r?a:p).appendChild(l),r&&o.groups[parseInt(i.toString(),10)].header&&(e=c.parent.createElement("div",{className:"e-ribbon-gallery-header",innerHTML:o.groups[parseInt(i.toString(),10)].header}),a.insertBefore(e,l))}),c=this,i=0;i<o.groups.length&&"break"!==t(i);i++);this.count=0,this.isAdded=!1,this.parent.isReact&&(this.parent.portals=this.parent.portals.concat(this.portals),this.parent.renderReactTemplates(),this.portals=void 0)},Qrt.prototype.setWrapperWidth=function(e,t,i,n){for(var o=1,r=0,s=!1,a=0;a<i.groups.length;a++){for(var l=0;l<i.groups[parseInt(a.toString(),10)].items.length;l++){if(!(o<=e)){s=!0;break}var h,d=t.querySelector("#"+n+"_galleryContainer"+a+"_gallery"+l);d&&(r+=d.offsetWidth,d=window.getComputedStyle(d))&&(je(h=parseFloat(d.paddingLeft)+parseFloat(d.paddingRight))||(r+=h),je(h=parseFloat(d.marginLeft)+parseFloat(d.marginRight))||(r+=h)),o++}if(s)break}0<r&&(t.style.width=r+"px")},Qrt.prototype.checkAvailableHeight=function(e){for(var t=e.querySelectorAll(".e-ribbon-gallery-wrapper"),i=0;i<t.length;i++){var n=0,o=0,r=!1,s=t[parseInt(i.toString(),10)],a=s.id.replace(/_galleryWrapper/g,""),l=s.offsetHeight,h=Mrt(this.parent.tabs,a);if(h){this.setWrapperWidth(h.item.gallerySettings.itemCount,s,h.item.gallerySettings,a);for(var d=0;d<h.item.gallerySettings.groups.length;d++)for(var p=0;p<h.item.gallerySettings.groups[parseInt(d.toString(),10)].items.length;p++){var c,u,g=s.querySelector("#"+a+"_galleryContainer"+d+"_gallery"+p);g&&("Classic"===this.parent.activeLayout?(g.classList.contains("e-hidden")&&g.classList.remove("e-hidden"),r?g.remove():(c=0,(u=window.getComputedStyle(g))&&!je(u=parseFloat(u.marginTop)+parseFloat(u.marginBottom))&&(c+=u),n++,h.item.gallerySettings.itemCount===n?(n=0,l>=g.offsetHeight+c?l-=g.offsetHeight+c:(r=!0,g.remove())):l<g.offsetHeight+c&&(r=!0,g.remove()))):++o>h.item.gallerySettings.itemCount&&g.classList.add("e-hidden"))}}}},Qrt.prototype.checkCollision=function(e,t,i){void 0===i&&(i=0);var n=0,o=0;if(t){for(var r=window.innerWidth,s=0===i?r:Math.abs(r-(r-i)),a=window.getComputedStyle(t),l=(!a||je(n=parseFloat(a.paddingLeft)+parseFloat(a.paddingRight))||(s-=n),t.querySelectorAll(".e-ribbon-gallery-container")),h=("auto"!==e.width&&l.forEach(function(e){e.style.flexFlow="wrap"}),!1),d=0;d<l.length;d++){for(var p=0,c=0;c<l[parseInt(d.toString(),10)].querySelectorAll(".e-ribbon-gallery-item").length;c++){var u=window.getComputedStyle(l[parseInt(d.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(c.toString(),10)]);if(!u||je(o=parseFloat(u.marginLeft)+parseFloat(u.marginRight))||(p+=o),s<=(p+=Math.round(parseFloat(u.width)))&&"auto"===e.width||"auto"!==e.width&&s<=parseInt(e.width.toString(),10)&&s<=p){t.style.width=p+Math.abs(n-o)-Math.round(parseFloat(u.width))+"px",h=!0;break}}if(h){l.forEach(function(e){e.style.flexFlow="wrap"}),"auto"===e.height&&this.setGalleryPopupHeight(t,parseFloat(a.height),parseFloat(a.top));break}}h||("auto"===e.width?(l.forEach(function(e){e.style.flexFlow="nowrap"}),t.style.width="auto"):t.style.width=e.width.toString(),"auto"===e.height&&this.setGalleryPopupHeight(t,parseFloat(a.height),parseFloat(a.top)))}},Qrt.prototype.setGalleryPopupHeight=function(e,t,i){window.innerHeight<t||window.innerHeight<Math.round(t+i)?e.style.height=window.innerHeight-i+"px":e.style.height="auto"},Qrt.prototype.createPopup=function(e,t){var i=this.parent.createElement("div",{className:"e-ribbon-popup-container",id:e.id+"_popupContainer"}),n=(this.renderGalleryItems(e.gallerySettings,!0,e.id,i),this.parent.createElement("div",{className:"e-ribbon-gallery-popup",id:e.id+"_galleryPopup"}));document.body.append(n),new Sv(n,{relateTo:t,content:i,collision:{X:"fit",Y:"flip"},actionOnScroll:"hide",targetType:"relative",position:{X:"left",Y:"bottom"},enableRtl:this.parent.enableRtl,width:e.gallerySettings.popupWidth,height:e.gallerySettings.popupHeight}).hide()},Qrt.prototype.switchGalleryItems=function(e,t){var i=this.parent.element.querySelector("#"+t+ort),n=Mrt(this.parent.tabs,t);if(i){var o=i.querySelectorAll(".e-ribbon-gallery-icons"),r=i.querySelectorAll(".e-ribbon-gallery-container");if(o.length)for(var s=0;s<o.length;s++)"Simplified"===e?o[parseInt(s.toString(),10)].classList.add("e-hidden"):o[parseInt(s.toString(),10)].classList.remove("e-hidden");if(r.length&&n)for(var a=0;a<n.item.gallerySettings.groups.length;a++)for(s=0;s<r.length;s++)n.item.gallerySettings.groups[parseInt(a.toString(),10)].itemHeight&&"auto"!==n.item.gallerySettings.groups[parseInt(a.toString(),10)].itemHeight&&t+"_galleryContainer"+a===r[parseInt(s.toString(),10)].id&&(r[parseInt(s.toString(),10)].style.flexFlow="Simplified"===e?"nowrap":"wrap");i=this.parent.tabObj.element.querySelector("#"+this.parent.tabs[this.parent.selectedTab].id+nrt);i&&this.checkAvailableHeight(i)}},Qrt.prototype.addOverFlowEvents=function(t,e){var i=this;if(e.closest(".e-ribbon-overflow-target")){var n=this.parent.createElement("button",{id:t.id}),e=(e.appendChild(n),e.querySelector(".e-ribbon-gallery-wrapper").classList.contains("e-disabled")&&n.classList.add("e-disabled"),e.querySelector(".e-ribbon-gallery-wrapper").classList.add("e-hidden"),e.querySelectorAll(".e-ribbon-gallery-container").forEach(function(e){e.classList.add("e-hidden")}),e.querySelector("#"+t.id+"_popupButton")),e=(e&&e.classList.add("e-hidden"),Mrt(this.parent.tabs,t.id)),o=e&&e.group.groupIconCss?e.group.groupIconCss:"",e=e&&e.group.header?e.group.header:"";if(!o)for(var r=0;r<t.gallerySettings.groups.length;r++){for(var s=0;s<t.gallerySettings.groups[parseInt(r.toString(),10)].items.length;s++)if(t.gallerySettings.groups[parseInt(r.toString(),10)].items[parseInt(s.toString(),10)].iconCss){o=t.gallerySettings.groups[parseInt(r.toString(),10)].items[parseInt(s.toString(),10)].iconCss;break}if(o)break}var a=At(document.querySelector("#"+t.id+"_galleryPopup"),Sv),l=document.querySelector("#"+t.id+"_galleryPopup .e-ribbon-popup-container"),e=new u2({iconCss:o,content:e,target:l,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-gallery-dropdown",disabled:t.disabled,open:function(){i.setFoucsToFirstItem(l,!0,t.id)},beforeClose:function(e){i.popupEvents(e.event,t.gallerySettings,"popupClose",!1)&&(e.cancel=!0)}},n);"auto"!==a.width&&(e.dropDown.width=T(a.width)),"auto"!==a.height&&(e.dropDown.height=T(a.height),e.dropDown.element.style.height=a.height.toString())}},Qrt.prototype.removeOverFlowEvents=function(e,t){var i=t.querySelector("#"+e.id+"_popupButton"),i=(i&&i.classList.remove("e-hidden"),t.querySelector(".e-ribbon-gallery-wrapper").classList.remove("e-hidden"),t.querySelectorAll(".e-ribbon-gallery-container").forEach(function(e){e.classList.remove("e-hidden")}),document.querySelector("#"+e.id));i&&(t=document.querySelector("#"+e.id+"_galleryPopup"),e=At(i,u2),t.appendChild(e.target),e.destroy(),ue(i))},Qrt.prototype.setActiveState=function(e,t,i,n,o,r){var s,a,l=document.querySelector("#"+i+ort),h=Array.prototype.slice.call(l.querySelectorAll(".e-ribbon-gallery-selected")),l=document.querySelector("#"+i+"_popupContainer"),l=Array.prototype.slice.call(l.querySelectorAll(".e-ribbon-gallery-selected"));l.length&&(h=h.concat(l));for(var d=0;d<t.groups.length;d++)for(var p=0;p<t.groups[parseInt(d.toString(),10)].items.length;p++)h[0].id===i+"_galleryContainer"+d+"_gallery"+p&&(s=t.groups[parseInt(d.toString(),10)].items[parseInt(p.toString(),10)]),e.id===(r?"popup_":"")+i+"_galleryContainer"+d+"_gallery"+p&&(a=t.groups[parseInt(d.toString(),10)].items[parseInt(p.toString(),10)]);var c,l=document.getElementById(e.id),u={cancel:!1,name:"beforeSelect",previousItem:s,currentItem:a,isInteracted:n,event:o};if(t.beforeSelect&&t.beforeSelect.call(this,u),!u.cancel){for(d=0;d<h.length;d++)h[parseInt(d.toString(),10)].classList.remove("e-ribbon-gallery-selected");l.id.startsWith("popup_")?document.getElementById(l.id.slice(6))&&(c=document.getElementById(l.id.slice(6))):c=document.getElementById("popup_"+e.id),c&&c.classList.add("e-ribbon-gallery-selected"),l.classList.add("e-ribbon-gallery-selected");for(var u={previousItem:s,currentItem:a,name:"select",isInteracted:n,event:o},g=document.querySelectorAll("#"+i+"_popupContainer .e-ribbon-gallery-item"),d=0;d<g.length;d++)if(g[parseInt(d.toString(),10)].id===e.id){t.selectedItemIndex=d;break}t.select&&t.select.call(this,u)}},Qrt.prototype.popupEvents=function(e,t,i,n){e={cancel:!1,event:e,name:i};return n&&t.popupOpen?t.popupOpen.call(this,e):!n&&t.popupClose&&t.popupClose.call(this,e),!!e.cancel},Qrt.prototype.showPopup=function(e,t,i,n,o){var r;this.popupEvents(i,n,"popupOpen",!0)||(e.show(),this.checkCollision(e,t),(i=document.querySelector("#"+o+"_popupButton")).classList.add("e-gallery-button-active"),r=i.getBoundingClientRect(),t.offsetWidth>r.left&&this.checkCollision(e,t,r.left),r=Math.abs(t.offsetWidth-r.left)+i.offsetWidth,t.style.left=r+"px",t.style.top=t.getBoundingClientRect().top+2+"px",this.setFoucsToFirstItem(t,!1,o,e,n))},Qrt.prototype.hidePopup=function(e,t,i,n,o){this.popupEvents(i,n,"popupClose",!1)||(e.hide(),document.querySelector("#"+o+"_popupButton").classList.remove("e-gallery-button-active"))},Qrt.prototype.showGalleryPopup=function(e){var t=Mrt(this.parent.tabs,e),i=document.querySelector("#"+e+"_galleryPopup"),n=At(i,Sv);this.showPopup(n,i,null,t.item.gallerySettings,e)},Qrt.prototype.hideGalleryPopup=function(e){var t=Mrt(this.parent.tabs,e),i=document.querySelector("#"+e+"_galleryPopup"),n=At(i,Sv);this.hidePopup(n,i,null,t.item.gallerySettings,e)},Qrt.prototype.setFoucsToFirstItem=function(t,i,n,o,r){var s=this;t.querySelectorAll(".e-ribbon-gallery-item")[0].focus(),this.galleryItemsIndex=0,t.onkeydown=function(e){s.handleGalleryPopupNavigation(e,t,i,n,o,r)}},Qrt.prototype.handleGalleryPopupNavigation=function(e,t,i,n,o,r){var s=t.querySelectorAll(".e-ribbon-gallery-item");s&&("Home"===e.key?(this.galleryItemsIndex=0,s[this.galleryItemsIndex].focus()):"End"===e.key?(this.galleryItemsIndex=s.length-1,s[this.galleryItemsIndex].focus()):"ArrowRight"===e.key||"ArrowDown"===e.key?(this.galleryItemsIndex++,this.galleryItemsIndex!==s.length?s&&s[this.galleryItemsIndex]&&s[this.galleryItemsIndex].focus():(this.galleryItemsIndex=0,s[this.galleryItemsIndex].focus())):"ArrowLeft"===e.key||"ArrowUp"===e.key?0!==this.galleryItemsIndex?(this.galleryItemsIndex--,s&&s[this.galleryItemsIndex]&&s[this.galleryItemsIndex].focus()):(this.galleryItemsIndex=s.length-1,s[this.galleryItemsIndex].focus()):"Enter"!==e.key&&"Space"!==e.code&&("Escape"!==e.key||i)||this.hidePopup(o,t,e,r,n))},Qrt.prototype.createGalleryTemplate=function(e,t,i,n){e.classList.add("e-ribbon-gallery-template");var o="ribbon"+i+"galleryTemplate",t=(this.parent.clearTemplate([o]),Drt(t.template));n.disabled&&e.classList.add("e-disabled"),n.cssClass&&e.classList.add(n.cssClass),ht(t({items:n},this,o,i+"galleryTemplate",this.parent.isStringTemplate,null,null,this.parent),e)},Qrt.prototype.createGalleryPopupTemplate=function(e,t,i,n){e.classList.add("e-ribbon-gallery-popup-template");var o="ribbon"+i+"galleryPopupTemplate",t=(this.parent.clearTemplate([o]),Drt(t.popupTemplate));n.disabled&&e.classList.add("e-disabled"),n.cssClass&&e.classList.add(n.cssClass),ht(t({items:n},this,o,i+"galleryPopupTemplate",this.parent.isStringTemplate,null,null,this.parent),e)};L$e=Qrt;function Qrt(e){this.count=0,this.isAdded=!1,this.galleryItemsIndex=0,this.registeredTemplate={},this.parent=e;e="viewContainerRef";x("registeredTemplate",this.registeredTemplate,this),x(e,this.parent[e],this)}Urt=function(e,t){return(Urt=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])}))(e,t)};var Urt,qrt,Grt,Yrt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Yrt=(function(e,t){function i(){this.constructor=e}Urt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Xrt,qrt=Ji),(Grt=Xrt).prototype.render=function(){this.initialize()},Xrt.prototype.preRender=function(){this.keysPress="",this.idIndex=0,this.tooltipData=[],this.initialPropsData={},this.hiddenElements={},this.keyTipElements={},this.hiddenGroups=[],this.itemsModel=[],this.targetTabs={},this.isAddRemove=!1,this.isUpdateItems=!1,this.keyConfigs={leftarrow:"leftarrow",rightarrow:"rightarrow",tab:"tab",shiftTab:"shift+tab"}},Xrt.prototype.getPersistData=function(){return this.addOnPersist(["activeLayout"])},Xrt.prototype.getModuleName=function(){return"ribbon"},Xrt.prototype.requiredModules=function(){var e=[],t=(e.push({member:"ribbonButton",args:[this],name:"RibbonButton"},{member:"ribbonDropDown",args:[this],name:"RibbonDropDown"},{member:"ribbonSplitButton",args:[this],name:"RibbonSplitButton"},{member:"ribbonCheckBox",args:[this],name:"RibbonCheckBox"},{member:"ribbonComboBox",args:[this],name:"RibbonComboBox"},{member:"ribbonGroupButton",args:[this],name:"RibbonGroupButton"}),Mrt(this.tabs,null,wit.ColorPicker)),i=Mrt(this.tabs,null,wit.Gallery);return t&&e.push({member:"ribbonColorPicker",args:[this],name:"RibbonColorPicker"}),i&&e.push({member:"ribbonGallery",args:[this],name:"RibbonGallery"}),(this.backStageMenu.visible||this.backStageMenu.items.length)&&e.push({member:"ribbonBackstage",args:[this],name:"RibbonBackstage"}),(this.fileMenu.visible||this.fileMenu.menuItems.length)&&e.push({member:"ribbonFileMenu",args:[this],name:"RibbonFileMenu"}),this.contextualTabs.length&&e.push({member:"ribbonContextualTab",args:[this],name:"RibbonContextualTab"}),this.enableKeyTips&&e.push({member:"ribbonKeyTip",args:[this],name:"RibbonKeyTip"}),e},Xrt.prototype.initialize=function(){this.element.id=this.element.id||D("e-"+this.getModuleName()),U([this.element],["e-rbn"].concat(this.cssClass?this.cssClass.split(" "):[])),this.enableRtl&&this.element.classList.add(Vnt),this.element.style.width=T(this.width),this.renderTabs(),this.ribbonContextualTabModule&&this.ribbonContextualTabModule.addContextualTabs(),this.ribbonFileMenuModule&&this.ribbonFileMenuModule.createFileMenu(this.fileMenu),this.ribbonBackstageModule&&this.ribbonBackstageModule.createBackStage(this.backStageMenu),this.createHelpPaneTemplate(),this.tabObj.tbObj.refreshOverflow(),this.addTabOverflowKeyTip(),Vrt(this.element,this),this.isKeytipOpen=!1,this.wireEvents(),this.wireKeyboardEvent(),this.currentControlIndex=0},Xrt.prototype.wireEvents=function(){E.add(window,"resize",this.resizeHandler,this),E.add(document.body,"keydown",this.keytipActionHandler,this),E.add(document,"mousedown",this.mouseEventHandler,this),E.add(document,"scroll",this.mouseEventHandler,this)},Xrt.prototype.wireKeyboardEvent=function(){this.keyboardModuleRibbon=new bn(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},Xrt.prototype.keyActionHandler=function(e){"Tab"!==e.key||e.target.classList.contains("e-tab-wrap")||e.target.classList.contains("e-combobox")||e.preventDefault();var t,i=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+nrt),n=Array.prototype.slice.call(i.querySelectorAll(".e-control")),o=Array.prototype.slice.call(i.querySelectorAll(".e-ribbon-template")),r=Array.prototype.slice.call(i.querySelectorAll(".e-ribbon-gallery-item")),s=n.concat(o,r),a=i.querySelectorAll(".e-combobox");if(a)for(var l=0;l<a.length;l++)a[parseInt(l.toString(),10)].closest(".e-input-focus")&&(t=a[parseInt(l.toString(),10)]);if(t)for(l=0;l<s.length;l++)s[parseInt(l.toString(),10)].classList.contains("e-combobox")&&s[parseInt(l.toString(),10)].closest(".e-input-focus")&&(this.currentControlIndex=l);if(0===this.currentControlIndex)for(var h=s[this.currentControlIndex].closest(".e-ribbon-item");h&&h.classList.contains("e-disabled");)this.currentControlIndex++,h=s[this.currentControlIndex].closest(".e-ribbon-item");if(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-launcher-icon")||e.target.classList.contains("e-ribbon-collapse-btn")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-first-item")||e.target.classList.contains("e-ribbon-group-of-btn")||e.target.classList.contains("e-ribbon-overall-of-btn")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-gallery-item"))switch(e.action){case"rightarrow":this.handleNavigation(e,!this.enableRtl,s);break;case"leftarrow":this.handleNavigation(e,this.enableRtl,s);break;case"tab":e.target.classList.contains("e-combobox")&&this.currentControlIndex<s.length-1&&this.currentControlIndex++;break;case"shiftTab":e.target.classList.contains("e-combobox")?0<this.currentControlIndex&&this.currentControlIndex--:(this.tabObj.element.querySelector(".e-toolbar-item.e-active").querySelector(".e-tab-wrap").focus(),this.currentControlIndex=0)}},Xrt.prototype.handleNavigation=function(e,t,i){var n,o;if(t?this.currentControlIndex<i.length-1&&i[this.currentControlIndex+1].classList.contains("e-colorpicker")&&this.currentControlIndex++:0<this.currentControlIndex&&i[this.currentControlIndex-1].classList.contains("e-colorpicker")&&this.currentControlIndex--,!t&&0<this.currentControlIndex||t&&this.currentControlIndex<i.length-1){if(!e.target.classList.contains("e-combobox")&&(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-gallery-item"))&&!e.target.classList.contains("e-ribbon-last-item")){t?this.currentControlIndex++:((r=i[parseInt(this.currentControlIndex.toString(),10)].closest("."+pot))&&(n=r.getAttribute("id")),this.currentControlIndex--);for(var r,s,a,l=i[this.currentControlIndex].closest(".e-ribbon-item");l&&l.classList.contains("e-disabled");){if((t&&this.currentControlIndex===i.length-1||!t&&0===this.currentControlIndex)&&i[this.currentControlIndex].closest(".e-ribbon-item").classList.contains("e-disabled")){this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus();break}t?this.currentControlIndex++:this.currentControlIndex--,l=i[this.currentControlIndex].closest(".e-ribbon-item")}i[parseInt(this.currentControlIndex.toString(),10)].focus(),"Classic"===this.activeLayout?(a=i[parseInt(this.currentControlIndex.toString(),10)].closest("."+pot),t?(s=void 0,(s=a?a.querySelector(".e-ribbon-launcher-icon"):s)&&(r=(r=a.querySelectorAll(".e-ribbon-item"))[r.length-1].querySelector(".e-control"))&&r.classList.add("e-ribbon-last-item")):a&&n!==a.getAttribute("id")&&(s=a.querySelector(".e-ribbon-launcher-icon"))&&i[parseInt((this.currentControlIndex+1).toString(),10)].classList.add("e-ribbon-first-item")):i[parseInt(this.currentControlIndex.toString(),10)].classList.contains("e-ribbon-first-item")?i[parseInt(this.currentControlIndex.toString(),10)].classList.remove("e-ribbon-first-item"):i[parseInt(this.currentControlIndex.toString(),10)].classList.contains("e-ribbon-last-item")&&i[parseInt(this.currentControlIndex.toString(),10)].classList.remove("e-ribbon-last-item")}}else"Classic"===this.activeLayout&&this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus(),"Simplified"===this.activeLayout&&(o=this.tabObj.element.querySelector(".e-ribbon-overall-of-btn"),(t&&o&&!o.classList.contains("e-ribbon-hide")?o:this.tabObj.element.querySelector(".e-ribbon-collapse-btn")).focus());if(e.target.classList.contains("e-ribbon-last-item")&&(t?(a=i[parseInt(this.currentControlIndex.toString(),10)].closest("."+pot)).querySelector(".e-ribbon-launcher-icon"):(this.currentControlIndex--,i[parseInt(this.currentControlIndex.toString(),10)])).focus(),!t&&e.target.classList.contains("e-ribbon-first-item")&&(s=(a=i[parseInt((this.currentControlIndex-1).toString(),10)].closest("."+pot)).querySelector(".e-ribbon-launcher-icon"))&&a.querySelector(".e-ribbon-launcher-icon").focus(),e.target.classList.contains("e-ribbon-launcher-icon")&&(t?(this.currentControlIndex++,i[parseInt(this.currentControlIndex.toString(),10)].focus(),i[parseInt((this.currentControlIndex-1).toString(),10)].classList.contains("e-ribbon-last-item")&&i[parseInt((this.currentControlIndex-1).toString(),10)].classList.remove("e-ribbon-last-item")):(this.currentControlIndex,i[parseInt(this.currentControlIndex.toString(),10)].focus())),e.target.classList.contains("e-ribbon-collapse-btn"))if(t){this.currentControlIndex=0;for(var h=i[this.currentControlIndex].closest(".e-ribbon-item");h&&h.classList.contains("e-disabled");)this.currentControlIndex++,h=i[this.currentControlIndex].closest(".e-ribbon-item");i[parseInt(this.currentControlIndex.toString(),10)].focus()}else if((o=this.tabObj.element.querySelector(".e-ribbon-overall-of-btn"))&&!o.classList.contains("e-ribbon-hide"))o.focus();else{this.currentControlIndex=i.length-1;for(h=i[this.currentControlIndex].closest(".e-ribbon-item");h&&h.classList.contains("e-disabled");)this.currentControlIndex--,h=i[this.currentControlIndex].closest(".e-ribbon-item");i[parseInt(this.currentControlIndex.toString(),10)].focus()}"Simplified"===this.activeLayout&&e.target.classList.contains("e-ribbon-overall-of-btn")&&(t?this.tabObj.element.querySelector(".e-ribbon-collapse-btn"):(this.currentControlIndex=i.length-1,i[parseInt(this.currentControlIndex.toString(),10)])).focus()},Xrt.prototype.resizeHandler=function(){var e=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+nrt);if(this.checkOverflow(this.selectedTab,e),this.scrollModule&&(e=this.tabObj.element.querySelector("."+Qnt),this.scrollModule.scrollStep=e.offsetWidth),"Simplified"===this.activeLayout){var t=document.querySelectorAll(".e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active");if(t.length)for(var i=0;i<t.length;i++)K(t[parseInt(i.toString(),10)],u2).toggle()}e=document.querySelector(".e-ribbon-gallery-popup.e-popup-open");e&&At(e,Sv).hide(),this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},Xrt.prototype.mouseEventHandler=function(){this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},Xrt.prototype.keytipActionHandler=function(e){if(this.enableKeyTips){var t=!1,i=e.key;if(e.altKey&&"Meta"===e.key){var n,o=document.querySelectorAll(".e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active");if(o.length){for(var r=0;r<o.length;r++)K(o[parseInt(r.toString(),10)],u2).toggle();this.ribbonKeyTipModule.removeKeytip()}else this.isKeytipOpen?this.ribbonKeyTipModule.removeKeytip():((n=document.querySelector(".e-ribbon-backstage-popup"))&&n.classList.contains("e-popup-open")&&this.ribbonBackstageModule.hideBackstage(),this.ribbonKeyTipModule.createKeytip("tab"))}else if("Escape"===e.key||"Tab"===e.key||"ArrowLeft"===e.key||"ArrowUp"===e.key||"ArrowRight"===e.key||"ArrowDown"===e.key)this.ribbonKeyTipModule.removeKeytip(e.key);else{var s=document.querySelectorAll(".e-ribbon-keytip");if(s){for(r=0;r<s.length;r++)if(s[parseInt(r.toString(),10)].innerHTML.toLowerCase()===i){t=!0,this.ribbonKeyTipModule.keytipPress(i);break}t||this.checkKeyTipPresent(i,this.keysPress.length)}}}},Xrt.prototype.checkKeyTipPresent=function(e,t){for(var i=document.querySelectorAll(".e-ribbon-keytip"),n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)];if(1<o.innerHTML.length&&o.innerHTML[parseInt(t.toString(),10)].toLowerCase()===e){this.keysPress+=e,this.ribbonKeyTipModule.keytipPress(this.keysPress),this.removeKeytip(this.keysPress);break}}},Xrt.prototype.removeKeytip=function(e){for(var t=document.querySelectorAll(".e-ribbon-keytip"),i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];n.innerHTML[0].toLowerCase()!==e&&""!==e&&ue(n)}},Xrt.prototype.addKeyTip=function(e,t,i,n){if(this.keyTipElements&&this.keyTipElements[parseInt(e.toString(),10)]){var o=!1;if(this.keyTipElements[parseInt(e.toString(),10)][""+n]||(this.keyTipElements[parseInt(e.toString(),10)][""+n]=[]),Object.keys(this.keyTipElements[parseInt(e.toString(),10)][""+n]).length){for(var r=this.keyTipElements[parseInt(e.toString(),10)][""+n],s=0;s<Object.keys(this.keyTipElements[parseInt(e.toString(),10)][""+n]).length;s++)r[parseInt(s.toString(),10)].id===i&&(o=!0);o||this.keyTipElements[parseInt(e.toString(),10)][""+n].push({id:i,type:n,keyTip:t})}else this.keyTipElements[parseInt(e.toString(),10)][""+n].push({id:i,type:n,keyTip:t})}},Xrt.prototype.renderTabs=function(){this.tabsInternal=this.tabs.slice(),this.tabsInternal=this.checkID(this.tabsInternal,"tab",this.element.id),this.setProperties({tabs:this.tabsInternal},!0);var e=this.createElement("div",{id:this.element.id+Kot}),t=(this.element.appendChild(e),this.validateItemSize(),this.createTabItems(this.tabs));this.tabObj=new k5({cssClass:qnt,selectedItem:this.selectedTab,overflowMode:"Popup",width:this.width,items:t,enableRtl:this.enableRtl,created:this.tabCreated.bind(this),selected:this.ribbonTabSelected.bind(this),selecting:this.ribbonTabSelecting.bind(this),animation:this.tabAnimation}),this.tabObj.appendTo(e),this.element.style.setProperty(grt,"0px"),this.element.style.setProperty(mrt,"0px"),At(e.querySelector(".e-toolbar"),U3).setProperties({width:"calc(100% - var(--fileMenuWidth) - var(--helpTemplateWidth))"}),this.element.classList[this.isMinimized?"add":"remove"](oot)},Xrt.prototype.minimize=function(t){var i=this;t!==this.isMinimized&&this.trigger(t?"ribbonCollapsing":"ribbonExpanding",{cancel:!1},function(e){e.cancel||(i.setProperties({isMinimized:t},!0),i.element.classList.toggle(oot,i.isMinimized),i.tabObj.element.querySelector(".e-content").style.display=t?"none":"block",t)||i.refreshLayout()})},Xrt.prototype.toggleLayout=function(e){this.setProperties({activeLayout:"Simplified"===this.activeLayout?"Classic":"Simplified"},!0),this.switchLayout();e={activeLayout:this.activeLayout,event:e};this.trigger("ribbonLayoutSwitched",e)},Xrt.prototype.tabCreated=function(){this.hideLayoutSwitcher||this.addExpandCollapse(),this.renderInitialTab(this.selectedTab)},Xrt.prototype.ribbonTabSelected=function(e){e.preventFocus=!0,this.isAddRemove=!1;var t=e.selectedItem.getAttribute("data-id"),i=-1===(i=Ert(this.tabs,function(e){return e.id===t}))?this.selectedTab:i,n=this.tabObj.items[parseInt(i.toString(),10)].content,o=(n.querySelector("."+rot)||0===this.tabs[parseInt(i.toString(),10)].groups.length||ht(this.createGroups(this.tabs[parseInt(i.toString(),10)].groups,i),n),this.isContextualTab(t)),o=(this.updateSelectedState(t),{previousIndex:this.selectedTab,selectedIndex:i,isContextual:o});if(this.setProperties({selectedTab:i},!0),this.calculateHiddenElementsWidth(i),this.isUpdateItems){for(var r=0;r<this.itemsModel.length;r++){var s=this.itemsModel[parseInt(r.toString(),10)];this.selectedTab===this.targetTabs[s.id]&&(this.updateItem(s),this.itemsModel.splice(r,1),r--)}0===this.itemsModel.length&&(this.isUpdateItems=!1)}this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(e.selectedContent.firstChild),this.checkOverflow(i,n),"Simplified"===this.activeLayout&&this.overflowDDB&&((n=(e=this.overflowDDB.target).querySelector("."+Ynt))&&n.classList.remove(Ynt),(n=e.querySelector("#"+t+rrt))?(n.classList.add(Ynt),this.overflowDDB.element.classList.remove(Unt),this.checkOverflowHiddenItems(!1,i)):this.overflowDDB.element.classList.add(Unt)),this.trigger("tabSelected",o)},Xrt.prototype.updateSelectedState=function(e){if(this.contextualTabs.length)for(var t=0;t<this.contextualTabs.length;t++){for(var i=!1,n=0;n<this.contextualTabs[parseInt(t.toString(),10)].tabs.length;n++)if(this.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(n.toString(),10)].id===e){i=!0;break}this.contextualTabs[parseInt(t.toString(),10)].setProperties({isSelected:i},!0)}},Xrt.prototype.checkOverflow=function(e,t){var i,n=t.closest("."+not),o=n.offsetWidth<t.offsetWidth;o&&!this.scrollModule?("Classic"===this.activeLayout?(!(i=this.checkGroupShrinking(e,n,t,!(i=!1)))&&n.offsetWidth<t.offsetWidth&&(i=this.checkGroupShrinking(e,n,t,!1)),n.offsetWidth<t.offsetWidth&&this.createOverflowDropdown(e,n,t)):(this.checkSimplifiedItemShrinking(e,n,t),n.offsetWidth<t.offsetWidth&&this.createSimplfiedOverflow(n,t,e)),n.offsetWidth<t.offsetWidth&&!this.scrollModule&&(this.scrollModule=new lj({enableRtl:this.enableRtl},this.tabObj.element.querySelector("."+not)))):o||(this.destroyScroll(),"Classic"===this.activeLayout?!(i=!(i=this.removeOverflowDropdown(n,t,i=!1,e))&&n.offsetWidth>t.offsetWidth?this.checkGroupExpanding(e,n,t,!0):i)&&n.offsetWidth>t.offsetWidth&&(i=this.checkGroupExpanding(e,n,t,!1)):(this.removeSimplfiedOverflow(n,t,e),n.offsetWidth>t.offsetWidth&&this.checkSimplifiedItemExpanding(e,n,t))),this.addTabOverflowKeyTip()},Xrt.prototype.addTabOverflowKeyTip=function(){var e=this.tabObj.element.querySelector("#_nav");e?(this.keyTipElements.taboverflow=[],this.keyTipElements.taboverflow.push({id:e.id,type:"taboverflow",keyTip:"00"})):delete this.keyTipElements.taboverflow},Xrt.prototype.checkSimplifiedItemShrinking=function(e,t,i){for(var n=this.tabs[parseInt(e.toString(),10)],o=n.groups.length-1;0<=o;o--)for(var r=n.groups[parseInt(o.toString(),10)],s=t.querySelector("#"+r.id+ort),a=0;a<r.collections.length&&t.offsetWidth<i.offsetWidth;a++)for(var l=r.collections[parseInt(a.toString(),10)],h=l.items.length;1<=h&&t.offsetWidth<i.offsetWidth;h--){var d,p,c=l.items[h-1];c.allowedSizes&vit.Small&&c.allowedSizes&vit.Medium&&c.activeSize===vit.Medium&&c.displayOptions&bit.Simplified&&(d=s.querySelector("#"+c.id+ort))&&(p=d.querySelector("#"+c.id),d.setAttribute("data-medium-width",i.offsetWidth.toString()),c.setProperties({activeSize:vit.Small},!0),this.setItemSize(p,c))}},Xrt.prototype.checkSimplifiedItemExpanding=function(e,t,i){for(var n=this.tabs[parseInt(e.toString(),10)],o=n.groups.length-1;0<=o;o--)for(var r=n.groups[parseInt(o.toString(),10)],s=t.querySelector("#"+r.id+ort),a=0;a<r.collections.length&&t.offsetWidth>i.offsetWidth;a++)for(var l=r.collections[parseInt(a.toString(),10)],h=l.items.length;1<=h&&t.offsetWidth>i.offsetWidth;h--){var d,p,c=l.items[h-1];c.allowedSizes&vit.Small&&c.allowedSizes&vit.Medium&&c.activeSize===vit.Small&&c.displayOptions&bit.Simplified&&(d=s.querySelector("#"+c.id+ort))&&(p=(p=d.getAttribute("data-medium-width"))?parseInt(p,10):null)&&t.offsetWidth>p&&(d.removeAttribute("data-medium-width"),p=d.querySelector("#"+c.id),c.setProperties({activeSize:vit.Medium},!0),this.setItemSize(p,c))}},Xrt.prototype.createSimplfiedOverflow=function(e,t,i){for(var n=this.getGroupResizeOrder(!0,i),o=0;o<n.length&&e.offsetWidth<t.offsetWidth;o++){for(var r=!1,s=n[parseInt(o.toString(),10)],a=e.querySelector("#"+s.id),l=a.querySelector("#"+s.id+ort),h=s.collections.length;1<=h&&e.offsetWidth<t.offsetWidth;h--)for(var d=s.collections[parseInt((h-1).toString(),10)],p=a.querySelector("#"+d.id),c=d.items.length;1<=c&&e.offsetWidth<t.offsetWidth;c--){var u=d.items[c-1],g=p.querySelector("#"+u.id+ort);if((u.displayOptions===bit.Auto||u.displayOptions===(bit.Simplified|bit.Overflow))&&!je(g)){var m=!1,f=!1,y=!1,v=!1,b=void 0;if(a.classList.contains("e-hidden")||a.classList.contains("e-hide-group")){if((b=a.querySelectorAll(".e-ribbon-item.e-hidden")).length)for(var w=0;w<b.length;w++)b[parseInt(w.toString(),10)].classList.remove("e-hidden");a.classList.contains("e-hide-group")?(y=!0,a.classList.remove("e-hide-group"),a.classList.remove("e-ribbon-emptyCollection"),-1!==this.hiddenGroups.indexOf(a.id)&&this.hiddenGroups.splice(this.hiddenGroups.indexOf(a.id),1)):(m=!0,a.classList.remove("e-hidden")),r||(this.calculateOverflowItemsWidth(a.offsetWidth,!1,i),this.calculateMediumDataWidth(a.offsetWidth,i,!1),r=!0)}else g.classList.contains("e-hidden")&&(f=!0,g.classList.remove("e-hidden"),a.classList.contains("e-ribbon-emptyCollection")&&(v=!0,a.classList.remove("e-ribbon-emptyCollection")),this.calculateOverflowItemsWidth(g.offsetWidth,!1,i),this.calculateMediumDataWidth(g.offsetWidth,i,!1));if(g.setAttribute("data-simplified-width",t.offsetWidth.toString()),f&&g.classList.add("e-hidden"),b&&b.length)for(var C=0;C<b.length;C++)b[parseInt(C.toString(),10)].classList.add("e-hidden");m&&a.classList.add("e-hidden"),y&&(a.classList.add("e-hide-group"),a.classList.add("e-ribbon-emptyCollection")),v&&a.classList.add("e-ribbon-emptyCollection"),this.createOverflowPopup(u,i,s.enableGroupOverflow,s.id,s.header,g,l,!0),u.activeSize===vit.Small&&(f=g.querySelector("#"+u.id),u.setProperties({activeSize:vit.Medium},!0),this.setItemSize(f,u)),u.type!==wit.DropDown&&u.type!==wit.SplitButton&&u.type!==wit.GroupButton&&u.type!==wit.Gallery||this.updatePopupItems(u,g,s.enableGroupOverflow,!0)}}s.enableGroupOverflow||a.querySelector("."+Aot)||a.classList.add("e-ribbon-emptyCollection");var S=a.querySelectorAll("."+Aot);S&&!s.enableGroupOverflow&&this.checkEmptyCollection(S)&&a.classList.add("e-ribbon-emptyCollection"),this.checkOverflowHiddenItems(s.enableGroupOverflow,i,s.id)}},Xrt.prototype.checkEmptyCollection=function(e){for(var t=!0,i=0;i<e.length;i++)if(!e[parseInt(i.toString(),10)].classList.contains("e-hidden")){t=!1;break}return t},Xrt.prototype.updatePopupItems=function(e,t,i,n){var o=this,t=At(t.querySelector("#"+e.id),e.type===wit.DropDown||e.type===wit.Gallery||e.type===wit.GroupButton?u2:b2),r=t.dropDown,s=(i&&n)===this.enableRtl;r&&(r.setProperties({position:{X:s?"left":"right",Y:n?"top":"bottom"}},!0),n?t.beforeOpen=function(){s&&(e.type===wit.Gallery&&o.ribbonGalleryModule&&o.ribbonGalleryModule.checkCollision(r,r.element),r.element.style.setProperty("visibility","hidden"),r.element.style.setProperty("display","block"),r.setProperties({offsetX:-1*r.element.offsetWidth}),r.element.style.removeProperty("display"),r.element.style.removeProperty("visibility"))}:(r.setProperties({offsetX:0},!0),t.beforeOpen=null))},Xrt.prototype.removeSimplfiedOverflow=function(e,t,i,n){void 0===n&&(n=!1);for(var o=this.getGroupResizeOrder(!1,i),r=!0,s=0;s<o.length&&r;s++){var a=o[parseInt(s.toString(),10)],l=void 0,h=void 0;a.enableGroupOverflow?(d=e.querySelector("#"+a.id+ert))&&(h=(l=K(d,u2)).target):(l=this.overflowDDB,h=this.overflowDDB?this.overflowDDB.target:null);for(var d,p=0;p<a.collections.length&&r;p++)for(var c=a.collections[parseInt(p.toString(),10)],u=0;u<c.items.length&&r&&!n&&e.offsetWidth>t.offsetWidth;u++){var g=c.items[parseInt(u.toString(),10)],m=void 0;if(h&&(m=h.querySelector("#"+g.id+ort)),(g.displayOptions===bit.Auto||g.displayOptions===(bit.Simplified|bit.Overflow))&&!je(m)){var f=parseInt(m.getAttribute("data-simplified-width"),10),y=e.querySelector("#"+a.id);if((m.classList.contains("e-hidden")||y.classList.contains("e-hidden"))&&(f=Math.abs(f-t.offsetWidth)),!n&&e.offsetWidth<f){r=!1;break}var v=e.querySelector("#"+c.id),b=(g.type!==wit.DropDown&&g.type!==wit.SplitButton&&g.type!==wit.GroupButton&&g.type!==wit.Gallery||this.updatePopupItems(g,m,a.enableGroupOverflow,!1),v.append(m),(m.classList.contains("e-hidden")||y.classList.contains("e-hidden"))&&(m.setAttribute("data-simplified-width",f.toString()),v=!1,b=0,m.classList.contains("e-hidden")&&(m.classList.remove("e-hidden"),y.classList.contains("e-hide-group")&&(v=!0,b=this.checkWidthDifference(m,y)),f=m.offsetWidth+b,m.classList.add("e-hidden")),this.calculateOverflowItemsWidth(f,!0,i),this.calculateMediumDataWidth(f,i,!0),v)&&(y.classList.add("e-hide-group"),y.classList.add("e-ribbon-emptyCollection")),this.removeOverflowEvent(g,m),g.allowedSizes&vit.Small&&(g.setProperties({activeSize:vit.Small},!0),this.setItemSize(m.querySelector("#"+g.id),g)),e.querySelector("#"+a.id)),f=b.querySelector("."+Aot);b.classList.contains("e-ribbon-emptyCollection")&&null!==f&&(v=b.querySelectorAll("."+Aot))&&!this.checkEmptyCollection(v)&&b.classList.remove("e-ribbon-emptyCollection")}}l&&(a.enableGroupOverflow?(0===h.childElementCount||1===h.childElementCount&&this.isHeaderVisible(h,a.id))&&this.removeOverflowButton(l):((d=h.querySelector("#"+a.id+ort))&&1===d.childElementCount&&d.remove(),(l=h.querySelector("#"+this.tabs[parseInt(i.toString(),10)].id+rrt))&&0===l.childElementCount&&(l.remove(),this.overflowDDB.element.classList.add(Unt))))}for(s=0;s<o.length;s++)this.checkOverflowHiddenItems(o[parseInt(s.toString(),10)].enableGroupOverflow,i,o[parseInt(s.toString(),10)].id);this.overflowDDB&&0===this.overflowDDB.target.childElementCount&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},Xrt.prototype.checkOverflowHiddenItems=function(e,t,i){if(e){e=document.querySelector("#"+i+ert);if(e){for(var i=K(e,u2),n=i.target.querySelectorAll(".e-ribbon-item"),o=!0,r=0;r<n.length;r++)if(!n[parseInt(r.toString(),10)].classList.contains("e-hidden")){o=!1;break}i.element.classList[o?"add":"remove"]("e-hidden")}}else if(this.overflowDDB){var s=!0,a=void 0,l=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+rrt);if(l){for(var h=0;h<l.children.length;h++){for(var a=!0,d=l.children[parseInt(h.toString(),10)],p=d.querySelectorAll(".e-ribbon-item"),c=0;c<p.length;c++)if(!p[parseInt(c.toString(),10)].classList.contains("e-hidden")){a=!1;break}d.classList[a?"add":"remove"]("e-hide-group"),d.classList.contains("e-hide-group")||d.classList.contains("e-hidden")||(s=!1)}this.overflowDDB.element.classList[s?"add":"remove"](Unt)}}},Xrt.prototype.createOverflowPopup=function(e,t,i,n,o,r,s,a){var l,h,d,p=Prt(this.tabs,n),c=this.tabObj.items[parseInt(t.toString(),10)].content.querySelector("#"+n);i?((h=s.querySelector("#"+n+ert))?l=K(h,u2):((l=this.addOverflowButton(n+ert,i)).element.classList.add(eot),s.appendChild(l.element)),this.addKeyTip(t,"0"+(p.groupIndex+1),l.element.id,"grpofbtn"),h=l.target,(s=l.target).querySelector("#"+n+ert+trt)||p.group.overflowHeader&&(d=this.createElement("div",{className:fot,id:n+ert+trt,innerHTML:p.group.overflowHeader}),s.append(d)),c&&(c.classList.contains("e-disabled")&&s.classList.add("e-disabled"),c.classList.contains("e-hidden")&&s.classList.add("e-hidden"),c.classList.contains("e-hide-group"))&&s.classList.add("e-hide-group"),a?s.insertBefore(r,s.querySelector("."+Aot)):s.append(r)):(this.overflowDDB?(this.overflowDDB.element.classList.remove(Unt),(s=(d=this.overflowDDB.target).querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+rrt))?((d=d.querySelector("#"+n+ort))||(d=p.group.overflowHeader?this.createGroupContainer(n,p.group.overflowHeader):this.createGroupContainer(n,o),c&&(c.classList.contains("e-disabled")&&d.classList.add("e-disabled"),c.classList.contains("e-hidden")&&d.classList.add("e-hidden"),c.classList.contains("e-hide-group"))&&d.classList.add("e-hide-group"),s.append(d)),a?d.insertBefore(r,d.querySelector("."+Aot)):d.append(r)):this.createOfTabContainer(n,o,r,t)):(this.overflowDDB=this.addOverflowButton(this.tabObj.element.id+$ot,i),this.tabObj.element.insertBefore(this.overflowDDB.element,this.collapseButton),this.overflowDDB.element.classList.add($nt),this.createOfTabContainer(n,o,r,t)),l=this.overflowDDB,h=this.overflowDDB?this.overflowDDB.target:null),null!==r&&this.addOverflowEvents(e,r,l),h&&e.keyTip&&this.addKeyTip(t,e.keyTip,e.id,"popupitem")},Xrt.prototype.addOverflowEvents=function(e,t,i){switch(e.type){case"Button":this.ribbonButtonModule.addOverFlowEvents(e,t,i);break;case"DropDown":this.ribbonDropDownModule.addOverFlowEvents(e,t,i);break;case"SplitButton":this.ribbonSplitButtonModule.addOverFlowEvents(e,t,i);break;case"CheckBox":this.ribbonCheckBoxModule.addOverFlowEvents(e,t,i);break;case"ColorPicker":this.ribbonColorPickerModule.addOverFlowEvents(e,t,i);break;case"ComboBox":this.ribbonComboBoxModule.addOverFlowEvents(e,t,i);break;case"Gallery":"Simplified"===this.activeLayout&&this.ribbonGalleryModule.addOverFlowEvents(e,t);break;case"GroupButton":"Simplified"===this.activeLayout&&this.ribbonGroupButtonModule.addOverFlowEvents(e,t,i)}},Xrt.prototype.createOfTabContainer=function(e,t,i,n){var o=this.createElement("div",{id:this.tabs[parseInt(n.toString(),10)].id+rrt,className:cot}),r=(this.overflowDDB.target.append(o),Prt(this.tabs,e)),r=r.group.overflowHeader?this.createGroupContainer(e,r.group.overflowHeader):this.createGroupContainer(e,t),t=(r.append(i),o.append(r),n===this.selectedTab&&o.classList.add(Ynt),document.querySelector("#"+e));t&&(t.classList.contains("e-disabled")&&r.classList.add("e-disabled"),t.classList.contains("e-hidden")&&r.classList.add("e-hidden"),t.classList.contains("e-hide-group"))&&r.classList.add("e-hide-group")},Xrt.prototype.checkGroupShrinking=function(e,t,i,n){for(var o=!0,r=!1,s=this.tabs[parseInt(e.toString(),10)],a=s.groups.length-1;o&&0<=a;a--)o=!(r=n?this.checkLargeToMedium(e,s,a,t,i):this.checkMediumToSmall(e,s,a,t,i))&&t.offsetWidth<i.offsetWidth;return r},Xrt.prototype.checkValidCollectionLength=function(e){for(var t=0,i=0;i<e.length;i++){for(var n=e[parseInt(i.toString(),10)].items,o=0;o<n.length;o++)if(n[parseInt(o.toString(),10)].displayOptions&bit.Classic){t++;break}if(1<t)return!1}return 1===t},Xrt.prototype.checkClassicCollection=function(e,t,i){for(var n=e[parseInt(t.toString(),10)].items,o=0;o<n.length;o++)if(n[parseInt(o.toString(),10)].displayOptions&bit.Classic)return t;return t=i?t+1:t-1,i?t===e.length?t:this.checkClassicCollection(e,t,i):t<0?t:this.checkClassicCollection(e,t,i)},Xrt.prototype.checkClassicItem=function(e,t,i){return e[parseInt(t.toString(),10)].displayOptions&bit.Classic?t:(t=i?t+1:t-1,i?t===e.length?t:this.checkClassicItem(e,t,i):t<0?t:this.checkClassicItem(e,t,i))},Xrt.prototype.checkLargeToMedium=function(l,e,h,t,d,p){var c=this,i=(void 0===p&&(p=!1),e.groups[parseInt(h.toString(),10)]);if(!i.isCollapsed||p){var n=function(e){return 1===e.items.length&&o(e.items[0])},o=function(e){return e.allowedSizes&vit.Medium&&e.activeSize===vit.Large},u=function(e,t,i,n){e=c.createElement("div",{className:"e-ribbon-shrink "+xot,id:e+"_shrink_container"+i,attrs:{"data-start":i.toString(),"data-end":n.toString()}});return t.parentElement.insertBefore(e,t),p||e.setAttribute("data-large-width",d.offsetWidth.toString()),e},r=function(e,t){for(var i=c.tabs[parseInt(l.toString(),10)].groups[parseInt(h.toString(),10)].collections[0],n=d.querySelector("#"+i.items[parseInt(e.toString(),10)].id+ort),o=p?d.querySelector("#"+i.id+"_shrink_container"+e):u(i.id,n,e,t),r=e;r<=t;r++){var s,a=i.items[parseInt(r.toString(),10)];a.displayOptions&bit.Classic&&(s=d.querySelector("#"+a.id+ort),o.appendChild(s),a.setProperties({activeSize:vit.Medium},!0),a.type===wit.GroupButton&&"Classic"===c.activeLayout?c.setItemSize(s.querySelector("#"+a.id+crt),a):c.setItemSize(s.querySelector("#"+a.id),a))}},s=function(e,t){for(var i=c.tabs[parseInt(l.toString(),10)].groups[parseInt(h.toString(),10)],n=d.querySelector("#"+i.collections[parseInt(e.toString(),10)].id),o=p?d.querySelector("#"+i.id+"_shrink_container"+e):u(i.id,n,e,t),r=e;r<=t;r++){var s=i.collections[parseInt(r.toString(),10)],a=d.querySelector("#"+s.id);o.appendChild(a),s.items[0].setProperties({activeSize:vit.Medium},!0),s.items[0].type===wit.GroupButton&&"Classic"===c.activeLayout?c.setItemSize(a.querySelector("#"+s.items[0].id+crt),s.items[0]):c.setItemSize(a.querySelector("#"+s.items[0].id),s.items[0])}};if(i.orientation===yit.Column)for(var a=i.collections.length-1;0<a;a--){var g=(a=this.checkClassicCollection(i.collections,a,!1))-1;if(0<=g&&n(i.collections[parseInt(a.toString(),10)]))if(0<=(g=this.checkClassicCollection(i.collections,g,!1))&&n(i.collections[parseInt(g.toString(),10)])){if(0<=(f=0<=(f=g-1)?this.checkClassicCollection(i.collections,f,!1):f)&&n(i.collections[parseInt(f.toString(),10)])?s(f,a):s(g,a),a=f,!p&&t.offsetWidth>d.offsetWidth)return!0}else a=g}else if(this.checkValidCollectionLength(i.collections))for(var m=i.collections[0],a=m.items.length-1;0<a;a--){var f,g=(a=this.checkClassicItem(m.items,a,!1))-1;if(0<=g&&o(m.items[parseInt(a.toString(),10)]))if(0<=(g=this.checkClassicItem(m.items,g,!1))&&o(m.items[parseInt(g.toString(),10)])){if(0<=(f=0<=(f=g-1)?this.checkClassicItem(m.items,f,!1):f)&&o(m.items[parseInt(f.toString(),10)])?r(f,a):r(g,a),a=f,!p&&t.offsetWidth>d.offsetWidth)return!0}else a=g}}return!1},Xrt.prototype.checkMediumToSmall=function(s,e,a,t,l,h){var d=this,i=(void 0===h&&(h=!1),e.groups[parseInt(a.toString(),10)]);if(!i.isCollapsed||h){var e=i.orientation,p=l.querySelector("#"+i.id).querySelectorAll(".e-ribbon-shrink"),n=function(e){return e.allowedSizes&vit.Small&&e.activeSize===vit.Medium},o=function(e,t,i,n){void 0===n&&(n=null);function o(e){var t;(e=r.items[parseInt(e.toString(),10)]).displayOptions&bit.Classic&&(t=l.querySelector("#"+e.id),e.setProperties({activeSize:vit.Small},!0),e.type===wit.GroupButton&&(t=l.querySelector("#"+e.id+"_grpbtn")),d.setItemSize(t,e))}var r=d.tabs[parseInt(s.toString(),10)].groups[parseInt(a.toString(),10)].collections[parseInt(e.toString(),10)];o(t),n&&o(n),o(i)},r=function(e,t,i,n){void 0===n&&(n=null);function o(e){var t;(e=r.collections[parseInt(e.toString(),10)]).items[0].displayOptions&bit.Classic&&(t=l.querySelector("#"+e.items[0].id),e.items[0].setProperties({activeSize:vit.Small},!0),e.items[0].type===wit.GroupButton&&(t=l.querySelector("#"+e.items[0].id+crt)),d.setItemSize(t,e.items[0]))}var r=d.tabs[parseInt(s.toString(),10)].groups[parseInt(a.toString(),10)];h||p[parseInt(e.toString(),10)].setAttribute("data-medium-width",l.offsetWidth.toString());o(t),n&&o(n),o(i)},c=function(e){h||l.querySelector("#"+e).setAttribute("data-medium-width",l.offsetWidth.toString())};if(e===yit.Column){if(0<p.length)for(var u=p.length-1;0<=u;u--){var g=parseInt(p[parseInt(u.toString(),10)].getAttribute("data-start"),10),m=parseInt(p[parseInt(u.toString(),10)].getAttribute("data-end"),10),f=this.checkClassicCollection(i.collections,g+1,!1);if(n(i.collections[parseInt(g.toString(),10)].items[0])&&n(i.collections[parseInt(f.toString(),10)].items[0])&&(m===f?r(u,g,m):n(i.collections[parseInt(m.toString(),10)].items[0])&&r(u,g,m,f),!h)&&t.offsetWidth>l.offsetWidth)return!0}for(u=i.collections.length-1;0<=u;u--){for(var y=i.collections[parseInt(u.toString(),10)],v=[],b=0;b<y.items.length;b++)y.items[parseInt(b.toString(),10)].displayOptions&bit.Classic&&v.push(b);if(1<v.length&&n(y.items[v[0]])&&n(y.items[v[1]])&&(2===v.length?(c(y.id),o(u,v[0],v[1])):n(y.items[v[2]])&&(c(y.id),o(u,v[0],v[2],v[1])),!h)&&t.offsetWidth>l.offsetWidth)return!0}}else if(this.checkValidCollectionLength(i.collections)){if(0<p.length)for(u=p.length-1;0<=u;u--){var w=p[parseInt(u.toString(),10)],g=parseInt(w.getAttribute("data-start"),10),m=parseInt(w.getAttribute("data-end"),10),y=i.collections[0],f=this.checkClassicItem(y.items,g+1,!1);if(n(i.collections[0].items[parseInt(g.toString(),10)])&&n(i.collections[0].items[parseInt(f.toString(),10)])&&(m===f?(c(w.id),o(0,g,m)):n(i.collections[0].items[parseInt(m.toString(),10)])&&(c(w.id),o(0,g,m,f)),!h)&&t.offsetWidth>l.offsetWidth)return!0}}else for(u=i.collections.length-1;0<=u;u--)for(f=(y=i.collections[parseInt(u.toString(),10)]).items.length-1;0<=f;f--)if(!((f=this.checkClassicItem(y.items,f,!1))<0)){var C=y.items[parseInt(f.toString(),10)];if(n(C)&&(C.type!==wit.GroupButton?c(C.id):c(C.id+crt),o(u,f,f),!h)&&t.offsetWidth>l.offsetWidth)return!0}}return!1},Xrt.prototype.checkGroupExpanding=function(e,t,i,n){for(var o=!1,r=this.tabs[parseInt(e.toString(),10)],s=0;!o&&s<r.groups.length;s++)o=n?this.checkSmallToMedium(e,r,s,t,i,!1,!0):this.checkMediumToLarge(e,r,s,t,i,!1,!0);return o},Xrt.prototype.checkSmallToMedium=function(o,e,r,t,s,i,n){function a(e,t,i){(e=d.tabs[parseInt(o.toString(),10)].groups[parseInt(r.toString(),10)].collections[parseInt(e.toString(),10)].items[parseInt(t.toString(),10)]).displayOptions&bit.Classic&&(t=i.id===e.id?i:i.querySelector("#"+e.id),e.setProperties({activeSize:vit.Medium},!0),e.type===wit.GroupButton&&(t=document.querySelector("#"+e.id+crt)),d.setItemSize(t,e))}function l(e){var t,i=d.tabs[parseInt(o.toString(),10)].groups[parseInt(r.toString(),10)].collections,n=i[parseInt(e.toString(),10)].items[0];n.displayOptions&bit.Classic&&(t=s.querySelector("#"+i[parseInt(e.toString(),10)].items[0].id),i[parseInt(e.toString(),10)].items[0].setProperties({activeSize:vit.Medium},!0),n.type===wit.GroupButton&&(t=s.querySelector("#"+i[parseInt(e.toString(),10)].items[0].id+crt)),d.setItemSize(t,i[parseInt(e.toString(),10)].items[0]))}var h,d=this,p=e.groups[parseInt(r.toString(),10)],c=p.orientation,u=s.querySelector("#"+p.id).querySelectorAll(".e-ribbon-shrink");if(c===yit.Row){if(!this.checkValidCollectionLength(p.collections))for(var g=0;g<p.collections.length;g++)for(var m=p.collections[parseInt(g.toString(),10)],f=0;f<m.items.length;f++)if((f=this.checkClassicItem(m.items,f,!0))!==m.items.length){var y=m.items[parseInt(f.toString(),10)];if((h=y).allowedSizes&vit.Medium&&h.activeSize===vit.Small){var v=s.querySelector("#"+y.id);if((b=(S=(v="GroupButton"===y.type?s.querySelector("#"+y.id+crt):v).getAttribute("data-medium-width"))?parseInt(S,10):null)&&(i||t.offsetWidth>b))a(g,f,v),i&&!n||v.removeAttribute("data-medium-width");else if(b)return!0}}}else for(g=0;g<p.collections.length;g++)if(1<p.collections[parseInt(g.toString(),10)].items.length){for(var m=p.collections[parseInt(g.toString(),10)],b=(S=(v=s.querySelector("#"+m.id)).getAttribute("data-medium-width"))?parseInt(S,10):null,w=[],C=0;C<m.items.length;C++)m.items[parseInt(C.toString(),10)].displayOptions&bit.Classic&&w.push(C);if(1<w.length&&b&&(i||t.offsetWidth>b))a(g,w[0],v),a(g,w[1],v),3===w.length&&a(g,w[2],v),i&&!n||v.removeAttribute("data-medium-width");else if(b)return!0}if(0<u.length)for(g=0;g<u.length;g++){var S,A=u[parseInt(g.toString(),10)];if((b=(S=A.getAttribute("data-medium-width"))?parseInt(S,10):null)&&(i||t.offsetWidth>b)){var x,I=parseInt(A.getAttribute("data-start"),10),T=parseInt(A.getAttribute("data-end"),10);c===yit.Row?(m=p.collections[0],f=this.checkClassicItem(m.items,I+1,!0),a(0,I,A),a(0,f,A),f!==T&&a(0,T,A)):(x=this.checkClassicCollection(p.collections,I+1,!0),l(I),l(x),x!==T&&l(T)),i&&!n||A.removeAttribute("data-medium-width")}else if(b)return!0}return!1},Xrt.prototype.checkMediumToLarge=function(s,e,a,t,i,l,h){var d=this,n=e.groups[parseInt(a.toString(),10)],o=n.orientation,r=i.querySelector("#"+n.id).querySelectorAll(".e-ribbon-shrink");if(0!==r.length)for(var p=function(e,t,n,i){function o(e){var t,i;(e=r[parseInt(e.toString(),10)]).displayOptions&bit.Classic&&(i=(t=n.querySelector("#"+e.id+ort)).querySelector("#"+e.id),e.setProperties({activeSize:vit.Large},!0),e.type===wit.GroupButton&&(i=t.querySelector("#"+e.id+crt)),d.setItemSize(i,e),n.insertAdjacentElement("beforebegin",t))}var r=d.tabs[parseInt(s.toString(),10)].groups[parseInt(a.toString(),10)].collections[0].items;o(e),i&&o(i),o(t),l&&!h||ue(n)},c=function(e,t,n,i){function o(e){var t,i;(e=r[parseInt(e.toString(),10)]).items[0].displayOptions&bit.Classic&&(i=(t=n.querySelector("#"+e.id)).querySelector("#"+e.items[0].id),e.items[0].setProperties({activeSize:vit.Large},!0),e.items[0].type===wit.GroupButton&&(i=t.querySelector("#"+e.items[0].id+crt)),d.setItemSize(i,e.items[0]),n.insertAdjacentElement("beforebegin",t))}var r=d.tabs[parseInt(s.toString(),10)].groups[parseInt(a.toString(),10)].collections;o(e),i&&o(i),o(t),l&&!h||ue(n)},u=0;u<r.length;u++){var g=r[parseInt(u.toString(),10)],m=g.getAttribute("data-large-width"),m=m?parseInt(m,10):null;if(m&&(l||t.offsetWidth>m)){var f,y=parseInt(g.getAttribute("data-start"),10),v=parseInt(g.getAttribute("data-end"),10);o===yit.Row?(f=n.collections[0],(f=this.checkClassicItem(f.items,y+1,!0))===v?p(y,v,g):p(y,v,g,f)):(f=this.checkClassicCollection(n.collections,y+1,!0))===v?c(y,v,g):c(y,v,g,f),l&&!h||g.removeAttribute("data-large-width")}else if(m)return!0}return!1},Xrt.prototype.handleContentSize=function(e,t){e=e.closest("."+got);t?e.classList.add(Mot):e.classList.remove(Mot)},Xrt.prototype.setItemSize=function(e,t){var i;e&&(i=e.closest("."+Aot),t.type===wit.Button?this.ribbonButtonModule.updateButtonSize(e,t):t.type===wit.DropDown?this.ribbonDropDownModule.updateDropDownSize(e,t):t.type===wit.SplitButton?this.ribbonSplitButtonModule.updateSplitButtonSize(e,t):t.type===wit.Template?(ue(e),this.createTemplateContent(t,i)):t.type===wit.GroupButton&&this.ribbonGroupButtonModule.updateGroupButtonSize(e,t),i.classList.remove(Mot,Tot,Eot,Dot),t.activeSize===vit.Large?i.classList.add(Tot,Mot):i.classList.add(t.activeSize===vit.Medium?Eot:Dot))},Xrt.prototype.createOverflowDropdown=function(g,m,f){var y=this.getGroupResizeOrder(!0,g);if(0!==y.length)for(var v=this,e=0;e<y.length&&m.offsetWidth<f.offsetWidth;e++)!function(e){var t=y[parseInt(e.toString(),10)],e=v.tabObj.element.querySelector("#"+t.id),i=(e.setAttribute("data-expanded-width",f.offsetWidth.toString()),e.querySelector("#"+t.id+ort)),n=v.createElement("div",{className:yot+" "+Tot,id:t.id+rrt+ort}),e=(e.insertBefore(n,i),Ert(v.tabs[parseInt(g.toString(),10)].groups,function(e){return e.id===t.id})),o=v.tabs[parseInt(g.toString(),10)],r=(v.checkSmallToMedium(g,o,e,m,f,!0,!1),v.checkMediumToLarge(g,o,e,m,f,!0,!1),v.ribbonDropDownModule.createOverFlowDropDown(t.id,t.header,t.groupIconCss,i,n,v.enableRtl));t.keyTip&&(c=t.id+rrt+srt,v.addKeyTip(g,t.keyTip,c,"grpoverflow")),v.tabs[parseInt(g.toString(),10)].groups[parseInt(e.toString(),10)].setProperties({isCollapsed:!0},!0);for(var s=0;s<t.collections.length;s++)for(var a=t.collections[parseInt(s.toString(),10)],l=i.querySelector("#"+a.id),h=0;h<a.items.length;h++){var d=a.items[parseInt(h.toString(),10)],p=l.querySelector("#"+d.id+ort);null!==p&&(v.handleContentSize(p),v.addOverflowEvents(d,p,r));var c,p=K(c=document.querySelector("#"+t.id+rrt+srt),u2);if(p){p=p.target;if(p&&v.keyTipElements[parseInt(g.toString(),10)]){if(d.type===wit.GroupButton)for(var u=0;u<d.groupButtonSettings.items.length;u++)d.groupButtonSettings.items[parseInt(u.toString(),10)].keyTip&&v.addKeyTip(g,d.groupButtonSettings.items[parseInt(u.toString(),10)].keyTip,d.id+crt+u,"grpoverflowpopup");d.keyTip&&v.addKeyTip(g,d.keyTip,d.id,"grpoverflowpopup")}}}}(e)},Xrt.prototype.removeOverflowDropdown=function(d,p,c,u){void 0===c&&(c=!1);var g=this.getGroupResizeOrder(!1,u);if(0!==g.length)for(var m=this,e=0;e<g.length;e++){var t=function(e){var t=g[parseInt(e.toString(),10)],i=m.tabObj.element.querySelector("#"+t.id);if(!i)return"break";e=parseInt(i.getAttribute("data-expanded-width"),10);if(!c&&d.offsetWidth<e)return{value:!0};m.removeDropdown(t.id);var e=Ert(m.tabs[parseInt(u.toString(),10)].groups,function(e){return e.id===t.id}),n=(m.tabs[parseInt(u.toString(),10)].groups[parseInt(e.toString(),10)].setProperties({isCollapsed:!1},!0),m.tabs[parseInt(u.toString(),10)]);m.checkLargeToMedium(u,n,e,d,p,!0),m.checkMediumToSmall(u,n,e,d,p,!0);for(var o=0;o<t.collections.length;o++)for(var r=t.collections[parseInt(o.toString(),10)],s=i.querySelector("#"+r.id),a=0;a<r.items.length;a++){var l=r.items[parseInt(a.toString(),10)],h=s.querySelector("#"+l.id+ort);null!==h&&(m.handleContentSize(h,!0),m.removeOverflowEvent(l,h))}}(e);if("object"==typeof t)return t.value;if("break"===t)break}return!1},Xrt.prototype.removeDropdown=function(e){var t,e=this.tabObj.element.querySelector("#"+e+rrt+srt);e&&(t=e.parentElement,this.ribbonDropDownModule.removeOverFlowDropDown(e),ue(t))},Xrt.prototype.getGroupResizeOrder=function(t,e){var i=this,e=this.tabs[parseInt(e.toString(),10)].groups;return(e=e.filter(function(e){return"Classic"!==i.activeLayout||(ee(e.isCollapsible)||e.isCollapsible)&&(t&&ee(e.isCollapsed)||!ee(e.isCollapsed)&&t!==e.isCollapsed)})).sort(function(e,t){return e.priority-t.priority}),t?e.reverse():e},Xrt.prototype.destroyScroll=function(){this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null)},Xrt.prototype.clearOverflowDropDown=function(e){var t,i=this.tabObj.element.querySelector("#"+this.tabs[parseInt(e.toString(),10)].id+nrt);i&&(t=i.closest("."+not),"Simplified"===this.activeLayout?this.removeSimplfiedOverflow(i,t,e,!0):this.removeOverflowDropdown(i,t,!0,e))},Xrt.prototype.isContextualTab=function(e){var t=!1;if(this.contextualTabs.length)for(var i=0;i<this.contextualTabs.length;i++)for(var n=0;n<this.contextualTabs[parseInt(i.toString(),10)].tabs.length;n++)if(this.contextualTabs[parseInt(i.toString(),10)].tabs[parseInt(n.toString(),10)].id===e){t=!0;break}return t},Xrt.prototype.ribbonTabSelecting=function(e){var t=this,i=(this.currentControlIndex=0,e.selectingItem?e.selectingItem.getAttribute("data-id"):null),n=e.previousItem.getAttribute("data-id"),o=Ert(this.tabs,function(e){return e.id===i}),r=this.isContextualTab(i),s=Ert(this.tabs,function(e){return e.id===n}),o=-1===o?this.selectedTab:o,e={cancel:e.cancel,isInteracted:e.isInteracted,previousIndex:s,selectedIndex:o,isContextual:r};this.trigger("tabSelecting",e,function(e){e.cancel||(t.destroyScroll(),t.isAddRemove||-1===s||t.clearOverflowDropDown(s),(e=t.tabObj.items[parseInt(o.toString(),10)].content).querySelector("."+rot))||0===t.tabs[parseInt(o.toString(),10)].groups.length||ht(t.createGroups(t.tabs[parseInt(o.toString(),10)].groups,o),e)})},Xrt.prototype.createTabItems=function(n){for(var o=this,r=[],s=this,e=0;e<n.length;e++)!function(e){var t=n[parseInt(e.toString(),10)],e=s.createElement("span",{innerHTML:t.header,id:t.id+trt}),i=Ert(s.tabs,function(e){return e.id===t.id}),i=(t.keyTip&&(s.keyTipElements[parseInt(i.toString(),10)]||(s.keyTipElements[parseInt(i.toString(),10)]={}),s.addKeyTip(i,t.keyTip,t.id,"tab")),e.onclick=function(){o.minimize(!1)},e.ondblclick=function(){o.minimize(!0)},{header:{text:e},id:t.id,cssClass:t.cssClass}),e=s.createElement("div",{className:i.cssClass,id:t.id+nrt});e.classList.add(Xnt),i.content=e,r.push(i)}(e);return r},Xrt.prototype.renderInitialTab=function(e){ht(this.createGroups(this.tabs[parseInt(e.toString(),10)].groups,e),this.tabObj.items[parseInt(e.toString(),10)].content),"Simplified"===this.activeLayout&&this.element.classList.add(Hot);e=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+nrt);this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(e),this.checkOverflow(this.selectedTab,e)},Xrt.prototype.addOverflowButton=function(e,t){var i,o=this,n=this.createElement("button",{id:e}),r=this.createElement("div",{className:tot,attrs:{tabindex:"0"}}),s=new u2({iconCss:Rnt,cssClass:kot+" "+vot,target:r,locale:this.locale,enableRtl:this.enableRtl,enablePersistence:this.enablePersistence,beforeOpen:function(t){var e={element:t.element,event:t.event,cancel:t.cancel};o.trigger("overflowPopupOpen",e,function(e){e.cancel&&(t.cancel=!0)})},beforeClose:function(t){var i=t.event?z(t.event.target,"."+znt):null,n=t.event?z(t.event.target,".e-ribbon-group-button-overflow-popup"):null,e={element:t.element,event:t.event,cancel:t.cancel};o.trigger("overflowPopupClose",e,function(e){(i||e.cancel||n)&&(t.cancel=!0)})}},n);return this.element.classList.add(iot),Vrt(r,this),t||(this.keyTipElements.overflowbtn=[],this.keyTipElements.overflowbtn.push({id:e,type:"overflowbtn",keyTip:"00"})),n.onkeydown=n.onclick=function(){o.itemIndex=-1,i=!n.classList.contains("e-ribbon-overall-of-btn")},r.onkeydown=function(e){return o.upDownKeyHandler(e,r,i),o},s},Xrt.prototype.upDownKeyHandler=function(e,t,i){var n,o=(i=(i?t:t.querySelector(".e-ribbon-of-tab.e-ribbon-active")).getElementsByClassName("e-ribbon-item"))[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-control"),o=o&&o.classList.contains("e-combobox")?i[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-combobox"):null,r=((null===o||"Tab"===e.key||this.itemIndex<0)&&("ArrowDown"===e.key||!e.shiftKey&&"Tab"===e.key?(!this.itemIndex&&0!==this.itemIndex||this.itemIndex<0||this.itemIndex===i.length-1?(this.itemIndex=0,r=i[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(r,i,!0),o&&"Tab"===e.key&&(e.preventDefault(),s=i[this.itemIndex].querySelector(".e-control"))&&s.focus(),n=i[this.itemIndex].querySelector(".e-ribbon-template")):this.itemIndex<i.length-1&&0<=this.itemIndex&&(this.itemIndex++,r=i[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(r,i,!0),n=i[this.itemIndex].querySelector(".e-ribbon-template")),n&&n.focus()):!("ArrowUp"===e.key||e.shiftKey&&"Tab"===e.key)||null!==o&&"Tab"!==e.key||(this.itemIndex&&-1!==this.itemIndex?this.itemIndex<=i.length-1&&0<this.itemIndex&&(this.itemIndex--,r=i[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(r,i,!1),n=i[this.itemIndex].querySelector(".e-ribbon-template")):(this.itemIndex=i.length-1,r=i[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(r,i,!1),o&&e.shiftKey&&"Tab"===e.key&&(e.preventDefault(),s=i[this.itemIndex].querySelector(".e-control"))&&s.focus(),n=i[this.itemIndex].querySelector(".e-ribbon-template")),n&&n.focus()),t.setAttribute("index",this.itemIndex.toString())),parseInt(t.getAttribute("index"),10)),o="",s=i[parseInt(r.toString(),10)]?i[parseInt(r.toString(),10)].querySelector(".e-control"):null;s&&(o=s.getAttribute("data-control")),"ArrowDown"!==e.key&&"ArrowUp"!==e.key&&" "!==e.key&&"Tab"!==e.key||("ColorPicker"===o?("Tab"===e.key&&e.preventDefault(),i[parseInt(r.toString(),10)].querySelector(".e-split-colorpicker").focus()):("Tab"===e.key&&e.preventDefault(),(n=i[parseInt(r.toString(),10)].querySelector(".e-control"))&&n.focus())," "===e.key&&"CheckBox"===o&&(t=At(i[parseInt(r.toString(),10)].querySelector(".e-control"),ib),this.itemIndex=-1,t.click())),"SplitButton"!==o||"ArrowRight"!==e.key&&"ArrowLeft"!==e.key||("ArrowRight"===e.key&&(this.enableRtl?i[parseInt(r.toString(),10)].querySelector(".e-control"):i[parseInt(r.toString(),10)].querySelector(".e-dropdown-btn")).focus(),"ArrowLeft"===e.key&&(this.enableRtl?i[parseInt(r.toString(),10)].querySelector(".e-dropdown-btn"):i[parseInt(r.toString(),10)].querySelector(".e-control")).focus()),"Enter"===e.key&&(this.itemIndex=-1)},Xrt.prototype.findDisabledItem=function(e,t,i){for(;e&&e.classList.contains("e-disabled");)i?this.itemIndex===t.length-1&&t[this.itemIndex].closest(".e-ribbon-item").classList.contains("e-disabled")&&(this.itemIndex=-1):0===this.itemIndex&&t[this.itemIndex].closest(".e-ribbon-item").classList.contains("e-disabled")&&(this.itemIndex=t.length),i?this.itemIndex++:this.itemIndex--,e=t[this.itemIndex].closest(".e-ribbon-item")},Xrt.prototype.removeOverflowButton=function(e){var t;e&&(t=e.element,_rt(e.target),e.destroy(),t.remove())},Xrt.prototype.removeOverflowEvent=function(e,t){if(t)switch(e.type){case"Button":this.ribbonButtonModule.removeOverFlowEvents(e,t);break;case"DropDown":this.ribbonDropDownModule.removeOverFlowEvents(e,t);break;case"SplitButton":this.ribbonSplitButtonModule.removeOverFlowEvents(e,t);break;case"CheckBox":this.ribbonCheckBoxModule.removeOverFlowEvents(e,t);break;case"ColorPicker":this.ribbonColorPickerModule.removeOverFlowEvents(e,t);break;case"ComboBox":this.ribbonComboBoxModule.removeOverFlowEvents(e,t);break;case"Gallery":this.ribbonGalleryModule.removeOverFlowEvents(e,t);break;case"GroupButton":this.ribbonGroupButtonModule.removeOverFlowEvents(e,t)}},Xrt.prototype.createGroupContainer=function(e,t){var i=this.createElement("div",{className:uot,id:e+ort}),e=this.createElement("div",{className:fot,id:e+trt,innerHTML:t});return i.append(e),i},Xrt.prototype.addExpandCollapse=function(){var t=this;this.collapseButton=this.createElement("span",{className:Knt+" "+Fnt,id:this.tabObj.element.id+Zot,attrs:{tabindex:"0",type:"button","aria-label":"Layout Switcher",role:"button"}}),this.collapseButton.onclick=function(e){t.toggleLayout(e)},this.collapseButton.onkeydown=function(e){"Enter"===e.key&&t.toggleLayout(e)},this.element.classList.add(Znt),"Simplified"===this.activeLayout&&this.collapseButton.classList.add(Jnt),this.tabObj.element.appendChild(this.collapseButton),this.layoutSwitcherKeyTip&&(this.keyTipElements.collapse=[],this.keyTipElements.collapse.push({id:this.collapseButton.id,type:"collapse",keyTip:this.layoutSwitcherKeyTip}))},Xrt.prototype.removeExpandCollapse=function(){var t=this,e=Ert(this.tooltipData,function(e){return e.id===t.collapseButton.id});-1!==e&&this.tooltipData.splice(e,1),this.element.classList.remove(Znt),ue(this.tabObj.element.querySelector("."+Knt)),this.collapseButton=null},Xrt.prototype.reRenderTabs=function(e){this.destroyScroll(),this.checkID(this.tabs,"tab",this.element.id);for(var t=0,i=Object.keys(e);t<i.length;t++){for(var n=i[t],o=parseInt(n,10),n=e[parseInt(o.toString(),10)],r=!1,s=0;s<this.tabObj.items.length;s++)if(this.tabs[parseInt(o.toString(),10)].id===this.tabObj.items[parseInt(s.toString(),10)].id){r=!0;break}if(!r){this.destroyTabItems(this.tabsInternal),this.tabsInternal=this.tabs.slice(),this.validateItemSize();var a=this.createTabItems(this.tabs);this.selectedTab>=this.tabs.length&&(this.selectedTab=this.tabs.length-1),this.tabObj.setProperties({items:a,selectedItem:this.selectedTab});break}var a=this.tabs[parseInt(o.toString(),10)].groups,l=this.tabObj.element,h=this.tabs[parseInt(o.toString(),10)],d=(h.setProperties(n,!0),this.setProperties({groups:this.checkID(h.groups,"group",h.id)},!0),this.validateItemSize(),this.tabObj.items[parseInt(o.toString(),10)].content);if(a&&(n.header&&(this.tabObj.items[parseInt(o.toString(),10)].header.text.innerText=h.header),n.cssClass&&(this.tabObj.items[parseInt(o.toString(),10)].cssClass&&(d.classList.remove(this.tabObj.items[parseInt(o.toString(),10)].cssClass),l.querySelector(".e-active").classList.remove(this.tabObj.items[parseInt(o.toString(),10)].cssClass)),d.classList.add(h.cssClass),l.querySelector(".e-active").classList.add(h.cssClass)),n.groups)){for(var p=0,c=a;p<c.length;p++){for(var u=c[p],g=u.isCollapsed?d.querySelector("#"+u.id+rrt+srt):null,m=0,f=u.collections;m<f.length;m++)for(var y=0,v=f[m].items;y<v.length;y++){var b=v[y],w=g?this.ribbonDropDownModule.getDDBItemElement(g,b.id):d.querySelector("#"+b.id);w&&this.destroyFunction(b,w)}g&&this.ribbonDropDownModule.removeOverFlowDropDown(g)}d.querySelectorAll(".e-ribbon-group").forEach(function(e){e.remove()}),ht(this.createGroups(h.groups,o),d)}}var C=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+nrt);this.checkOverflow(this.selectedTab,C)},Xrt.prototype.switchLayout=function(){this.currentControlIndex=0,this.destroyScroll(),this.collapseButton.classList.toggle(Jnt,"Simplified"===this.activeLayout),this.element.classList.toggle(Hot,"Simplified"===this.activeLayout);for(var e=0;e<=this.tabs.length-1;e++){var t=e;if(""!==this.tabObj.items[parseInt(t.toString(),10)].content.innerHTML){var i=this.tabs[parseInt(t.toString(),10)],n=this.tabs[parseInt(t.toString(),10)].groups,o=this.tabObj.element.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+nrt),r=o.closest("."+not);if("Simplified"===this.activeLayout)for(var s=0;s<n.length;s++){for(var a=n[parseInt(s.toString(),10)],l=n[parseInt(s.toString(),10)].orientation,h=(a.isCollapsed?(a.setProperties({isCollapsed:!1},!0),this.removeDropdown(a.id)):(this.checkSmallToMedium(t,i,s,r,o,!0,!1),this.checkMediumToLarge(t,i,s,r,o,!0,!1)),r.querySelector("#"+a.id)),d=(A=h.querySelector("#"+a.id+ort)).querySelectorAll(".e-ribbon-shrink"),p=0;p<d.length;p++)d[parseInt(p.toString(),10)].remove();(I=A.querySelector("#"+a.id+trt)).remove(),(x=A.querySelector("#"+a.id+nrt)).classList.replace(xot,Iot),x.classList.remove(Mot);for(var c=0;c<a.collections.length;c++){var u=a.collections[parseInt(c.toString(),10)];(M=A.querySelector("#"+u.id)).classList.replace(xot,Iot);for(var g=0;g<u.items.length;g++){for(var m=u.items,f=u.items[parseInt(g.toString(),10)],y=!0;y&&f.displayOptions===bit.Classic;){g++;var v=A.querySelector("#"+f.id+ort),b=v.querySelector("#"+f.id);this.destroyFunction(f,b),v.remove(),g<m.length?f=m[parseInt(g.toString(),10)]:y=!1}if(!y)break;var w=f.allowedSizes===vit.Large||f.allowedSizes&vit.Medium?vit.Medium:vit.Small,w=!(f.displayOptions&bit.Simplified)&&f.displayOptions&bit.Overflow?vit.Medium:w,C=void 0;f.displayOptions&bit.Classic?(C=A.querySelector("#"+f.id+ort),f.displayOptions===(bit.Classic|bit.Overflow)&&(this.createOverflowPopup(f,t,a.enableGroupOverflow,a.id,a.header,C,A),f.type!==wit.DropDown&&f.type!==wit.SplitButton&&f.type!==wit.GroupButton&&f.type!==wit.Gallery||this.updatePopupItems(f,C,a.enableGroupOverflow,!0)),f.type===wit.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(f,C),f.setProperties({activeSize:w},!0),C&&(b=C.querySelector("#"+f.id),this.setItemSize(b,f))):(C=this.createItems([f],l,a.id,a.header,a.enableGroupOverflow,t,A)[0],f.displayOptions&bit.Simplified&&M.append(C)),f.type===wit.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,f.id)}}a.enableGroupOverflow||h.querySelector("."+Aot)||h.classList.add("e-ribbon-emptyCollection")}else{this.element.classList.remove(iot);for(var S=0;S<n.length;S++){var A,a=n[parseInt(S.toString(),10)],l=n[parseInt(S.toString(),10)].orientation,x=(A=r.querySelector("#"+a.id+ort)).querySelector("#"+a.id+nrt),I=this.createElement("div",{className:mot,id:a.id+trt,innerHTML:a.header});A.appendChild(I),"Row"===l&&x.classList.replace(Iot,xot),x.classList.add(Mot);for(c=0;c<a.collections.length;c++){var T,E=void 0,D=void 0,u=(a.enableGroupOverflow?(T=A.querySelector("#"+a.id+ert))&&(D=(E=K(T,u2)).target):(E=this.overflowDDB)&&(D=this.overflowDDB.target),a.collections[parseInt(c.toString(),10)]),M=A.querySelector("#"+u.id);"Column"===l&&M.classList.replace(Iot,xot);for(g=0;g<u.items.length;g++){for(m=u.items,f=u.items[parseInt(g.toString(),10)],y=!0;y&&!(f.displayOptions&bit.Classic);){g++;var k,C=void 0;(f.displayOptions&bit.Simplified||f.displayOptions&bit.Overflow)&&null!==(C=(f.displayOptions&bit.Simplified?A:D).querySelector("#"+f.id+ort))&&(k=C.querySelector("#"+f.id),this.destroyFunction(f,k),C.remove()),g<m.length?f=m[parseInt(g.toString(),10)]:y=!1}if(!y)break;f.displayOptions&(bit.Simplified|bit.Overflow)?(!(C=A.querySelector("#"+f.id+ort))&&D&&(C=D.querySelector("#"+f.id+ort),f.type!==wit.DropDown&&f.type!==wit.SplitButton&&f.type!==wit.GroupButton&&f.type!==wit.Gallery||this.updatePopupItems(f,C,a.enableGroupOverflow,!1),this.removeOverflowEvent(f,C)),f.type===wit.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(f,C),C&&M.append(C)):(C=this.createItems([f],l,a.id,a.header,a.enableGroupOverflow,t)[0],M.append(C));var b=A.querySelector("#"+f.id),P=(f.type===wit.GroupButton&&(b=A.querySelector("#"+f.id+crt)),f.allowedSizes&vit.Large?vit.Large:f.allowedSizes&vit.Medium?vit.Medium:vit.Small);f.setProperties({activeSize:P},!0),this.setItemSize(b,f),f.type===wit.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,f.id)}a.enableGroupOverflow&&E&&(0===D.childElementCount||1===D.childElementCount&&this.isHeaderVisible(D,a.id))&&this.removeOverflowButton(E)}}}this.selectedTab===t&&this.checkOverflow(t,o)}}"Classic"===this.activeLayout&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},Xrt.prototype.createLauncherIcon=function(t,e,i){var n=this,o=this.createElement("div",{className:wot+" "+(this.launcherIconCss||Cot),id:t+irt,attrs:{tabindex:"0",type:"button","aria-label":"Launcher Icon",role:"button"}}),e=(e.appendChild(o),e.classList.add(bot),E.add(o,"click",this.launcherIconClicked.bind(this,t),this),E.add(o,"keydown",function(e){"Enter"===e.key&&n.launcherIconClicked(t)},this),Prt(this.tabs,t));e.group.launcherIconKeyTip&&this.addKeyTip(i,e.group.launcherIconKeyTip,o.id,"launcher")},Xrt.prototype.launcherIconClicked=function(e){this.trigger("launcherIconClick",{groupId:e})},Xrt.prototype.createGroups=function(e,t){for(var i=[],n=0;n<e.length;n++){for(var o=e[parseInt(n.toString(),10)],r=o.orientation,s=this.createElement("div",{className:o.cssClass,id:o.id}),a=(s.classList.add(rot),i.push(s),this.createElement("div",{className:o.cssClass,id:o.id+ort})),l=(a.classList.add(pot),s.appendChild(a),this.createElement("div",{className:"Simplified"===this.activeLayout?got:got+" "+Mot,id:o.id+nrt})),h=(l.classList.add("Column"===r||"Simplified"===this.activeLayout?Iot:xot),a.appendChild(l),"Classic"===this.activeLayout&&(r=this.createElement("div",{className:mot,id:o.id+trt,innerHTML:o.header}),a.appendChild(r)),o.showLauncherIcon&&this.createLauncherIcon(o.id,a,t),this.createCollection(o.collections,o.orientation,o.id,o.header,o.enableGroupOverflow,t,a)),d=(ht(h,l),!0),p=0;p<h.length;p++)if(d)for(var c=0;c<h[parseInt(p.toString(),10)].children.length;c++)if(!h[parseInt(p.toString(),10)].children[parseInt(c.toString(),10)].classList.contains("e-hidden")){d=!1;break}d&&s.classList.add("e-hide-group"),"Simplified"!==this.activeLayout||o.enableGroupOverflow||s.querySelector("."+Aot)||s.classList.add("e-ribbon-emptyCollection");r=this.initialPropsData[parseInt(t.toString(),10)];r&&(r.hiddenGroups&&r.hiddenGroups.length&&this.updateGroupProps("hiddenGroups",r,s),r.disabledGroups)&&r.disabledGroups.length&&this.updateGroupProps("disabledGroups",r,s)}return this.initialPropsData[parseInt(t.toString(),10)]&&delete this.initialPropsData[parseInt(t.toString(),10)],i},Xrt.prototype.updateGroupProps=function(e,t,i){-1!==t[e].indexOf(i.id)&&("hiddenGroups"===e?i.classList.add("e-hidden"):i.classList.add("e-disabled"))},Xrt.prototype.validateItemSize=function(){for(var e=0;e<this.tabs.length;e++)for(var t=this.tabs[parseInt(e.toString(),10)].groups,i=0;i<t.length;i++)for(var n=t[parseInt(i.toString(),10)].collections,o=t[parseInt(i.toString(),10)].orientation,r=0;r<n.length;r++)for(var s=n[parseInt(r.toString(),10)].items,a=0;a<s.length;a++){var l=s[parseInt(a.toString(),10)],h=(l.allowedSizes&&0!==l.allowedSizes||l.setProperties({allowedSizes:vit.Small|vit.Medium|vit.Large},!0),"ColorPicker"===l.type&&l.allowedSizes!==vit.Small?l.setProperties({allowedSizes:vit.Small},!0):"ComboBox"!==l.type&&"CheckBox"!==l.type||l.allowedSizes===vit.Medium?("Column"===o&&1<s.length||"Row"===o&&1<n.length)&&l.allowedSizes&vit.Large&&(h=(h=l.allowedSizes&(vit.Small|vit.Medium))||vit.Medium,l.setProperties({allowedSizes:h},!0)):l.setProperties({allowedSizes:vit.Medium},!0),l.allowedSizes&vit.Large?vit.Large:l.allowedSizes&vit.Medium?vit.Medium:vit.Small);l.setProperties({activeSize:h},!0)}},Xrt.prototype.createCollection=function(e,t,i,n,o,r,s){for(var a=[],l=0;l<e.length;l++){var h=e[parseInt(l.toString(),10)],d=this.createElement("div",{className:h.cssClass,id:h.id});if(d.classList.add(Sot),d.classList.add("Column"!==t||"Simplified"===this.activeLayout?Iot:xot),a.push(d),ht(this.createItems(h.items,t,i,n,o,r,s),d),"Row"===t&&2===l)break}return a},Xrt.prototype.createRibbonItem=function(e,t){switch(e.type){case"Button":this.ribbonButtonModule.createButton(e,t);break;case"DropDown":this.ribbonDropDownModule.createDropDown(e,t);break;case"SplitButton":this.ribbonSplitButtonModule.createSplitButton(e,t);break;case"CheckBox":this.ribbonCheckBoxModule.createCheckBox(e,t);break;case"ColorPicker":this.ribbonColorPickerModule.createColorPicker(e,t);break;case"ComboBox":this.ribbonComboBoxModule.createComboBox(e,t);break;case"Template":this.createTemplateContent(e,t);break;case"GroupButton":this.ribbonGroupButtonModule.createGroupButton(e,t);break;case"Gallery":this.ribbonGalleryModule.createGallery(e,t)}},Xrt.prototype.createItems=function(e,t,i,n,o,r,s){for(var a=[],l=0;l<e.length;l++){for(var h=e[parseInt(l.toString(),10)],d=!0;d&&("Simplified"===this.activeLayout&&!(h.displayOptions&(bit.Simplified|bit.Overflow))||"Classic"===this.activeLayout&&!(h.displayOptions&bit.Classic));)++l<e.length?h=e[parseInt(l.toString(),10)]:d=!1;if(!d)break;var p=this.createElement("div",{className:h.cssClass,id:h.id+ort});if((u=p.classList).add.apply(u,[Aot].concat(h.disabled?[Nnt]:[])),h.ribbonTooltipSettings&&Ort(h.ribbonTooltipSettings)&&(p.classList.add(Lot),this.tooltipData.push({id:p.id,data:h.ribbonTooltipSettings})),h.type===wit.GroupButton)for(var c=0;c<h.groupButtonSettings.items.length;c++)this.keyTipElements[parseInt(r.toString(),10)]&&h.groupButtonSettings.items[parseInt(c.toString(),10)].keyTip&&this.addKeyTip(r,h.groupButtonSettings.items[parseInt(c.toString(),10)].keyTip,h.id+crt+c,"item");h.keyTip&&(h.type===wit.Gallery?this.addKeyTip(r,h.keyTip,h.id+"_popupButton","item"):this.addKeyTip(r,h.keyTip,h.id,"item"));var u=h.activeSize,u=(h.type!==wit.Gallery&&("Simplified"===this.activeLayout&&(u=h.allowedSizes===vit.Large||h.allowedSizes&vit.Medium||h.displayOptions===bit.Overflow?vit.Medium:vit.Small,h.setProperties({activeSize:u},!0)),u&vit.Large?p.classList.add(Tot,Mot):p.classList.add(u&vit.Medium?Eot:Dot)),this.initialPropsData[parseInt(r.toString(),10)]);if(u&&u.hiddenItems&&u.hiddenItems.length&&-1!==u.hiddenItems.indexOf(h.id)&&p.classList.add("e-hidden"),this.createRibbonItem(h,p),"Simplified"!==this.activeLayout||h.displayOptions!==bit.Overflow&&h.displayOptions!==(bit.Classic|bit.Overflow)?a.push(p):(this.createOverflowPopup(h,r,o,i,n,p,s),h.type!==wit.DropDown&&h.type!==wit.SplitButton&&h.type!==wit.GroupButton&&h.type!==wit.Gallery||this.updatePopupItems(h,p,o,!0)),"Column"===t&&2===l)break}return a},Xrt.prototype.createHelpPaneTemplate=function(){var e;this.helpPaneTemplate&&(this.clearTemplate([e="helpPaneTemplate"]),this.ribbonTempEle=this.createElement("div",{className:Bot,id:this.element.id+prt}),ht(Drt(this.helpPaneTemplate)({},this,e,"helpPaneTemplate",this.isStringTemplate),this.ribbonTempEle),(e=this.tabObj.element).querySelector(".e-toolbar").after(this.ribbonTempEle),e.style.setProperty(mrt,this.ribbonTempEle.offsetWidth+"px"),this.renderReactTemplates())},Xrt.prototype.createTemplateContent=function(e,t){var i=this.createElement("div",{className:e.cssClass?Pot+" "+e.cssClass:Pot,id:e.id,attrs:{tabindex:"-1"}});e.disabled&&(i.classList.add(Nnt),i.setAttribute("disabled","")),t.appendChild(i),this.renderItemTemplate(e,i)},Xrt.prototype.renderItemTemplate=function(e,t){var i="ribbon"+e.id+"itemTemplate";this.clearTemplate([i]),ht(Drt(e.itemTemplate)({activeSize:vit[e.activeSize]},this,i,e.id+"itemTemplate",this.isStringTemplate),t),this.renderReactTemplates()},Xrt.prototype.checkID=function(e,t,i){for(var n="tab"===t?Kot:"group"===t?"_group":"collection"===t?Jot:"_item",o=0;o<e.length;o++){var r,s=e[parseInt(o.toString(),10)];switch(s.id||(r=void 0,"item"===t&&(r=this.hasHtmlAtrrID(s)),s.setProperties({id:r||i+n+this.idIndex++},!0)),t){case"tab":s.setProperties({groups:this.checkID(s.groups,"group",s.id)},!0);break;case"group":s.setProperties({collections:this.checkID(s.collections,"collection",s.id)},!0);break;case"collection":s.setProperties({items:this.checkID(s.items,"item",s.id)},!0)}}return e},Xrt.prototype.hasHtmlAtrrID=function(e){var t="";return e.buttonSettings.htmlAttributes.id?t=e.buttonSettings.htmlAttributes.id:e.checkBoxSettings.htmlAttributes.id?t=e.checkBoxSettings.htmlAttributes.id:e.colorPickerSettings.htmlAttributes.id?t=e.colorPickerSettings.htmlAttributes.id:e.comboBoxSettings.htmlAttributes.id?t=e.comboBoxSettings.htmlAttributes.id:e.dropDownSettings.htmlAttributes.id?t=e.dropDownSettings.htmlAttributes.id:e.splitButtonSettings.htmlAttributes.id&&(t=e.splitButtonSettings.htmlAttributes.id),t},Xrt.prototype.updateCommonProperty=function(e){this.tabObj.setProperties(e),this.ribbonFileMenuModule&&this.ribbonFileMenuModule.setCommonProperties(e),this.ribbonBackstageModule&&this.ribbonBackstageModule.setCommonProperties(e);for(var t=0;t<this.tabs.length;t++){var i=this.tabs[parseInt(t.toString(),10)],n=this.tabObj.items[parseInt(t.toString(),10)].content;if(n.querySelector("."+rot))for(var o=0,r=i.groups;o<r.length;o++){var s=r[o],a=void 0,l=void 0;this.activeLayout===fit.Classic?a=s.isCollapsed?n.querySelector("#"+s.id+rrt+srt):null:(l=(a=s.enableGroupOverflow?n.querySelector("#"+s.id+ert):null)?At(a,u2):this.overflowDDB)&&(Hrt(l.target,e),l.setProperties(e));for(var h=0,d=s.collections;h<d.length;h++)for(var p=0,c=d[h].items;p<c.length;p++){var u=c[p],g=null;if(this.activeLayout===fit.Classic?u.displayOptions&bit.Classic&&(g=a?this.ribbonDropDownModule.getDDBItemElement(a,u.id):u.type===wit.GroupButton?n.querySelector("#"+u.id+crt):n.querySelector("#"+u.id)):(g=u.displayOptions&bit.Simplified?n.querySelector("#"+u.id):null)||(g=l.target.querySelector("#"+u.id),"DropDown"===u.type&&this.updatePopupItems(u,l.target,s.enableGroupOverflow,!0)),g){var m=this.getItemModuleName(u);if("template"!==m)if("group-btn"===m&&"Classic"===this.activeLayout)for(var f=0;f<u.groupButtonSettings.items.length;f++)Frt(g.querySelector("#"+u.id+crt+f),"btn",e);else if("group-btn"===m&&"Simplified"===this.activeLayout){Frt(g,"dropdown-btn",e);for(var y=0;y<u.groupButtonSettings.items.length;y++)Frt(document.querySelector("#"+u.id+crt+y),"btn",e)}else Frt(g,m,e);else je(e.enableRtl)||g.classList.toggle(Vnt,e.enableRtl)}}}}},Xrt.prototype.removeLauncherIcon=function(e,t,i){var n=e+ort,t=t?this.ribbonDropDownModule.getDDBItemElement(t,n):i.querySelector("#"+n);t&&(t.classList.remove(bot),ue(t.querySelector("#"+e+irt)))},Xrt.prototype.destroyTabItems=function(e){for(var t=0;t<e.length;t++)for(var i=e[parseInt(t.toString(),10)],n=this.tabObj.items[parseInt(t.toString(),10)].content,o=0,r=i.groups;o<r.length;o++){var s=r[o],a=void 0,l=void 0;this.activeLayout===fit.Classic?(a=s.isCollapsed?n.querySelector("#"+s.id+rrt+srt):null,s.showLauncherIcon&&this.removeLauncherIcon(s.id,a,n)):l=(a=s.enableGroupOverflow?n.querySelector("#"+s.id+ert):null)?At(a,u2):this.overflowDDB;for(var h=0,d=s.collections;h<d.length;h++)for(var p=0,c=d[h].items;p<c.length;p++){var u=c[p],g=void 0;this.activeLayout===fit.Classic?u.displayOptions&bit.Classic&&(g=a?this.ribbonDropDownModule.getDDBItemElement(a,u.id):n.querySelector("#"+u.id),u.type===wit.GroupButton&&(g=a?this.ribbonDropDownModule.getDDBItemElement(a,u.id+crt):n.querySelector("#"+u.id+crt)),u.type===wit.Gallery)&&(g=n.querySelector("#"+u.id+ort)):(g=u.displayOptions&bit.Simplified?n.querySelector("#"+u.id):null,g=(g=u.type===wit.Gallery?u.displayOptions&bit.Simplified?n.querySelector("#"+u.id+ort):null:g)||(l?l.target.querySelector("#"+u.id):null)),g&&this.destroyFunction(u,g)}this.activeLayout===fit.Classic&&a?this.ribbonDropDownModule.removeOverFlowDropDown(a):this.activeLayout===fit.Simplified&&s.enableGroupOverflow&&a&&this.removeOverflowButton(l)}this.overflowDDB&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},Xrt.prototype.destroyFunction=function(i,e){var t=this.getItemModuleName(i);if("colorpicker"===t)this.ribbonColorPickerModule.unwireColorPickerEvents(e);else if("group-btn"===t){if("Classic"===this.activeLayout)for(var n=0;n<i.groupButtonSettings.items.length;n++){var o=e.querySelector("#"+i.id+crt+n);o&&Brt(o,"btn")}else this.ribbonGroupButtonModule.destroyDropDown(i);for(var r=this,n=0;n<i.groupButtonSettings.items.length;n++)!function(e){var t;i.groupButtonSettings.items[parseInt(e.toString(),10)].ribbonTooltipSettings&&(t=i.id+crt+e,-1!==(e=Ert(r.tooltipData,function(e){return e.id===t})))&&r.tooltipData.splice(e,1)}(n)}else if("gallery"===t)if(e.closest(".e-ribbon-overflow-target")){Brt(e,"dropdown-btn"),(h=Array.prototype.slice.call(document.querySelectorAll("#"+i.id+"_galleryPopup"))).concat(Array.prototype.slice.call(document.querySelectorAll("#"+i.id+"-popup")));for(n=0;n<h.length;n++)h[parseInt(n.toString(),10)].remove();(a=document.querySelector("#"+i.id+"_popupButton"))&&a.remove();var s=document.querySelector("#"+i.id+"_galleryWrapper");s&&s.remove()}else{var a,l=e.querySelectorAll(".e-ribbon-gallery-item");(a=e.parentElement.querySelector("#"+i.id+"_popupButton"))&&a.remove();for(n=0;n<l.length;n++)l[parseInt(n.toString(),10)].remove();for(var h=document.querySelectorAll("#"+i.id+"_galleryPopup"),n=0;n<h.length;n++)h[parseInt(n.toString(),10)].remove()}else"template"!==t&&Brt(e,t);i.ribbonTooltipSettings&&-1!==(s=Ert(this.tooltipData,function(e){return e.id===i.id+ort}))&&this.tooltipData.splice(s,1),"GroupButton"===i.type&&this.ribbonGroupButtonModule.destroyDropDown(i)},Xrt.prototype.getItemModuleName=function(e){switch(e.type){case"Button":return"btn";case"DropDown":return"dropdown-btn";case"SplitButton":return"split-btn";case"CheckBox":return"checkbox";case"ColorPicker":return"colorpicker";case"ComboBox":return"combobox";case"GroupButton":return"group-btn";case"Gallery":return"gallery";default:return"template"}},Xrt.prototype.clearOverflowResize=function(){this.destroyScroll(),this.clearOverflowDropDown(this.selectedTab);for(var e=this.tabs[this.selectedTab],t=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+nrt),i=t.closest("."+not),n=0;n<e.groups.length;n++)this.checkSmallToMedium(this.selectedTab,e,n,i,t,!0,!0),this.checkMediumToLarge(this.selectedTab,e,n,i,t,!0,!0)},Xrt.prototype.refreshLayout=function(){this.resizeHandler()},Xrt.prototype.selectTab=function(t){var e=Ert(this.tabs,function(e){return e.id===t});this.setProperties({selectedTab:e})},Xrt.prototype.showTab=function(e,t){this.showHideTab(e,!1,t=void 0===t?!1:t)},Xrt.prototype.hideTab=function(e,t){this.showHideTab(e,!0,t=void 0===t?!1:t)},Xrt.prototype.showHideTab=function(t,e,i){var n=Ert(this.tabs,function(e){return e.id===t});if(-1!==n&&(this.tabObj.hideTab(n,e),i)){for(var o,r=this.tabObj.element,s=0;s<this.contextualTabs.length;s++)for(var a=0;a<this.contextualTabs[parseInt(s.toString(),10)].tabs.length;a++)t===this.contextualTabs[parseInt(s.toString(),10)].tabs[parseInt(a.toString(),10)].id&&(o=this.contextualTabs[parseInt(s.toString(),10)]);if(o){for(var l=!0,h=this,s=0;s<o.tabs.length;s++)!function(t){var e=Ert(h.tabs,function(e){return e.id===o.tabs[parseInt(t.toString(),10)].id});-1===e||r.querySelectorAll(".e-toolbar-item")[parseInt(e.toString(),10)].classList.contains("e-hidden")||(l=!1)}(s);l?o.setProperties({visible:!1},!0):o.setProperties({visible:!0},!0)}}},Xrt.prototype.enableTab=function(e){this.enableDisableTab(e,!0)},Xrt.prototype.disableTab=function(e){this.enableDisableTab(e,!1)},Xrt.prototype.enableDisableTab=function(t,e){var i,n=Ert(this.tabs,function(e){return e.id===t});-1!==n&&(i=this.tabObj.items[parseInt(n.toString(),10)].content,this.tabObj.element.querySelector("#"+t+trt).classList[e?"remove":"add"]("e-disabled"),i.classList[e?"remove":"add"]("e-disabled"),this.tabObj.enableTab(n,e))},Xrt.prototype.addTab=function(e,t,i){var n=-1===(n=t?Ert(this.tabs,function(e){return e.id===t}):-1)?this.tabs.length:n+(i?1:0),i=(this.tabsInternal=this.tabs.slice(),this.tabsInternal.splice(n,0,e),this.setProperties({tabs:this.tabsInternal},!0),this.checkID([this.tabs[parseInt(n.toString(),10)]],"tab",this.element.id),this.tabsInternal=this.tabs.slice(),this.validateItemSize(),this.createTabItems([e]));this.tabObj.addTab(i,n)},Xrt.prototype.removeTab=function(t){var e=Ert(this.tabs,function(e){return e.id===t});if(-1!==e){var i=this.tabObj.items[parseInt(e.toString(),10)].content,n=this.tabs[parseInt(e.toString(),10)].groups;if(n&&""!==i.innerHTML)for(var o=0,r=n;o<r.length;o++){for(var s=r[o],a=s.isCollapsed?i.querySelector("#"+s.id+rrt+srt):null,l=0,h=s.collections;l<h.length;l++)for(var d=0,p=h[l].items;d<p.length;d++){var c=p[d],u=a?this.ribbonDropDownModule.getDDBItemElement(a,c.id):i.querySelector("#"+c.id);(u=c.type===wit.GroupButton&&"Classic"===this.activeLayout?a?this.ribbonDropDownModule.getDDBItemElement(a,c.id+crt):i.querySelector("#"+c.id+crt):u)&&this.destroyFunction(c,u)}a&&this.ribbonDropDownModule.removeOverFlowDropDown(a)}e===this.selectedTab&&(this.isAddRemove=!0),this.tabsInternal=this.tabs.slice(),this.tabsInternal.splice(e,1),this.setProperties({tabs:this.tabsInternal},!0),this.tabObj.removeTab(e)}},Xrt.prototype.addGroup=function(t,e,i,n){var o,r,s,a=Ert(this.tabs,function(e){return e.id===t});-1!==a&&(this.selectedTab===a&&this.clearOverflowResize(),r=(s=this.tabs[parseInt(a.toString(),10)]).groups.slice(),o=-1===(o=i?Ert(r,function(e){return e.id===i}):-1)?r.length:o+(n?1:0),r.splice(o,0,e),s.setProperties({groups:r},!0),this.checkID([s.groups[parseInt(o.toString(),10)]],"group",t),this.validateItemSize(),""!==(e=this.tabObj.items[parseInt(a.toString(),10)].content).innerHTML&&(r=this.createGroups([s.groups[parseInt(o.toString(),10)]],a)[0],(s=i?e.querySelector("#"+i):null)?s.insertAdjacentElement(n?"afterend":"beforebegin",r):e.append(r)),this.selectedTab===a)&&this.refreshLayout()},Xrt.prototype.removeGroup=function(e){var t=Prt(this.tabs,e);if(t){this.selectedTab===t.tabIndex&&this.clearOverflowResize();var i=this.tabObj.items[t.tabIndex].content;if(""!==i.innerHTML){var n=void 0;t.group.showLauncherIcon&&this.removeLauncherIcon(t.group.id,null,i),this.activeLayout===fit.Simplified&&(n=(h=t.group.enableGroupOverflow?i.querySelector("#"+t.group.id+ert):null)?At(h,u2):this.overflowDDB);for(var o=0,r=t.group.collections;o<r.length;o++)for(var s=0,a=r[o].items;s<a.length;s++){var l=a[s];this.removeItemElement(i,l,n)}this.activeLayout===fit.Simplified&&(t.group.enableGroupOverflow?(0===n.target.childElementCount||1===n.target.childElementCount&&this.isHeaderVisible(n.target,t.group.id))&&this.removeOverflowButton(n):((h=n.target.querySelector("#"+t.group.id+ort))&&1===h.childElementCount&&h.remove(),(h=n.target.querySelector("#"+this.tabs[parseInt(t.tabIndex.toString(),10)].id+rrt))&&0===h.childElementCount&&h.remove()));var h=i.querySelector("#"+e);h&&h.remove()}e=this.tabs[t.tabIndex].groups.slice();e.splice(t.groupIndex,1),this.tabs[t.tabIndex].setProperties({groups:e},!0),this.selectedTab===t.tabIndex&&this.refreshLayout()}},Xrt.prototype.isHeaderVisible=function(e,t){return!!e.querySelector("#"+t+ert+trt)},Xrt.prototype.hideGroup=function(e){this.showHideGroup(e,!0)},Xrt.prototype.showGroup=function(e){this.showHideGroup(e,!1)},Xrt.prototype.showHideGroup=function(e,t){var i,n,o,r=Prt(this.tabs,e);r&&((n=(o=this.tabObj.items[r.tabIndex].content).querySelector("#"+e))?this.updateHiddenElements(r.tabIndex,t?"hideGroup":"showGroup",e,t,n):this.updateInitialProps(r.tabIndex,e,"hiddenGroups",t),this.overflowDDB&&(n=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(r.tabIndex.toString(),10)].id+rrt),r.group.enableGroupOverflow?(i=(o=o.querySelector("#"+e+ert))?K(o,u2).target:i)&&(t?i.classList.add("e-hidden"):i.classList.remove("e-hidden")):n&&(o=n.querySelector("#"+e+ort))&&(t?o.classList.add("e-hidden"):o.classList.remove("e-hidden"))),this.selectedTab===r.tabIndex)&&this.refreshLayout()},Xrt.prototype.updateHiddenElements=function(e,t,i,n,o,r){n?o.classList.contains("e-hidden")||(this.checkHiddenElements(t,i,e),o.classList.add("e-hidden"),"hideItem"===t&&this.checkHiddenItems(r,n,e),this.calculateHiddenElementsWidth(e)):o.classList.contains("e-hidden")&&(this.checkHiddenElements(t,i,e),o.classList.remove("e-hidden"),this.calculateHiddenElementsWidth(e),"showItem"===t)&&this.checkHiddenItems(r,n,e)},Xrt.prototype.checkHiddenElements=function(e,t,i){var n;"Simplified"===this.activeLayout&&((n=this.hiddenElements[parseInt(i.toString(),10)])||(this.hiddenElements[parseInt(i.toString(),10)]={},n=this.hiddenElements[parseInt(i.toString(),10)]),n)&&(n[""+e]||(n[""+e]=[]),n[""+e].length&&-1!==n[""+e].indexOf(t)||n[""+e].push(t))},Xrt.prototype.updateItemsSimplifiedWidth=function(s,a){var l=this.hiddenElements[parseInt(s.toString(),10)];if(l&&l[""+a]&&l[""+a].length)for(var h,d=this,e=0;e<l[""+a].length;e++)!function(e){var t=d.tabObj.items[parseInt(s.toString(),10)].content,i=void 0,n=!1,o=0,r="hideGroup"===a||"showGroup"===a?t.querySelector("#"+l[""+a][parseInt(e.toString(),10)]):t.querySelector("#"+l[""+a][parseInt(e.toString(),10)]+ort),t=(r&&("hideGroup"===a||"hideItem"===a?(t=!1,r.classList.contains("e-hidden")&&(t=!0,r.classList.remove("e-hidden")),"hideItem"===a&&(i=r.closest(".e-ribbon-group")).classList.contains("e-hide-group")&&(n=!0,o=d.checkWidthDifference(r,i)),d.calculateOverflowItemsWidth(r.offsetWidth+o,!0,s),d.calculateMediumDataWidth(r.offsetWidth+o,s,!0),t&&r.classList.add("e-hidden")):("showItem"===a&&((i=r.closest(".e-ribbon-group")).classList.contains("e-hide-group")?(n=!0,i.classList.remove("e-hide-group"),i.classList.remove("e-ribbon-emptyCollection"),o=Math.abs(r.offsetWidth-i.offsetWidth),-1!==d.hiddenGroups.indexOf(i.id)&&d.hiddenGroups.splice(d.hiddenGroups.indexOf(i.id),1)):-1!==d.hiddenGroups.indexOf(i.id)&&((t=i.querySelectorAll(".e-ribbon-item:not(.e-hidden)")).forEach(function(e){e.id!==r.id&&e.classList.add("e-hidden")}),o=Math.abs(r.offsetWidth-i.offsetWidth),t.forEach(function(e){e.id!==r.id&&e.classList.remove("e-hidden")}),d.hiddenGroups.splice(d.hiddenGroups.indexOf(i.id),1))),d.calculateOverflowItemsWidth(r.offsetWidth+o,!1,s),d.calculateMediumDataWidth(r.offsetWidth+o,s,!1)),n)&&(i.classList.add("e-hide-group"),i.classList.add("e-ribbon-emptyCollection")),l[""+a].indexOf(l[""+a][parseInt(e.toString(),10)]));-1!==t&&(l[""+a].splice(t,1),e--),h=e}(e),e=h},Xrt.prototype.checkWidthDifference=function(e,t){var i=0;return t.classList.remove("e-hide-group"),t.classList.remove("e-ribbon-emptyCollection"),this.hiddenGroups.length&&-1!==this.hiddenGroups.indexOf(t.id)||(this.hiddenGroups.push(t.id),i=Math.abs(e.offsetWidth-t.offsetWidth)),i},Xrt.prototype.calculateHiddenElementsWidth=function(e){if(e===this.selectedTab&&"Simplified"===this.activeLayout){var t=this.hiddenElements[parseInt(e.toString(),10)];if(t)for(var i=0;i<Object.keys(t).length;i++)this.updateItemsSimplifiedWidth(e,Object.keys(t)[parseInt(i.toString(),10)])}},Xrt.prototype.calculateMediumDataWidth=function(e,t,i){if(this.selectedTab===t&&"Simplified"===this.activeLayout){var n=this.tabObj.element.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+nrt),o=Array.prototype.slice.call(n.querySelectorAll(".e-ribbon-item"));if(this.overflowDDB)for(var r=this.overflowDDB.target.querySelectorAll(".e-ribbon-item"),s=document.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+rrt),a=0;a<r.length;a++){var l=r[parseInt(a.toString(),10)].closest("#"+this.tabs[parseInt(t.toString(),10)].id+rrt);s&&l&&s.id===l.id&&r[parseInt(a.toString(),10)].hasAttribute("data-medium-width")&&o.push(r[parseInt(a.toString(),10)])}for(var h=n.querySelectorAll(".e-ribbon-group-of-btn"),a=0;a<h.length;a++)for(var r=K(h[parseInt(a.toString(),10)],u2).target.querySelectorAll(".e-ribbon-item"),d=0;d<r.length;d++)r[parseInt(d.toString(),10)].hasAttribute("data-medium-width")&&o.push(r[parseInt(d.toString(),10)]);for(var p,a=0;a<o.length;a++)o[parseInt(a.toString(),10)].hasAttribute("data-medium-width")&&(p=parseInt(o[parseInt(a.toString(),10)].getAttribute("data-medium-width"),10),o[parseInt(a.toString(),10)].setAttribute("data-medium-width",(i?p-e:p+e).toString()))}},Xrt.prototype.calculateOverflowItemsWidth=function(e,t,i){if(this.selectedTab===i&&"Simplified"===this.activeLayout)for(var n=this.tabs[parseInt(i.toString(),10)].groups,o=0;o<n.length;o++){var r=n[parseInt(o.toString(),10)];if(r.enableGroupOverflow){var s=void 0,r=document.querySelector("#"+r.id).querySelector("#"+r.id+ert);if(s=r?K(r,u2):s)for(var a=s.target.querySelectorAll(".e-ribbon-item"),l=0;l<a.length;l++)(d=parseInt(a[parseInt(l.toString(),10)].getAttribute("data-simplified-width"),10))&&a[parseInt(l.toString(),10)].setAttribute("data-simplified-width",(t?d-e:d+e).toString())}}if(this.overflowDDB)for(var h=document.querySelector("#"+this.tabs[parseInt(i.toString(),10)].id+rrt),a=this.overflowDDB.target.querySelectorAll(".e-ribbon-item"),o=0;o<a.length;o++){var d,p=a[parseInt(o.toString(),10)].closest("#"+this.tabs[parseInt(i.toString(),10)].id+rrt);h&&p&&h.id===p.id&&(d=parseInt(a[parseInt(o.toString(),10)].getAttribute("data-simplified-width"),10))&&a[parseInt(o.toString(),10)].setAttribute("data-simplified-width",(t?d-e:d+e).toString())}},Xrt.prototype.disableGroup=function(e){this.enableDisableGroup(e,!0)},Xrt.prototype.enableGroup=function(e){this.enableDisableGroup(e,!1)},Xrt.prototype.enableDisableGroup=function(e,t){var i,n,o,r=Prt(this.tabs,e);r&&((n=(o=this.tabObj.items[r.tabIndex].content).querySelector("#"+e))?t?n.classList.add("e-disabled"):n.classList.remove("e-disabled"):this.updateInitialProps(r.tabIndex,e,"disabledGroups",t),this.overflowDDB)&&(n=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(r.tabIndex.toString(),10)].id+rrt),r.group.enableGroupOverflow?(i=(r=o.querySelector("#"+e+ert))?K(r,u2).target:i)&&(t?i.classList.add("e-disabled"):i.classList.remove("e-disabled")):n&&(o=n.querySelector("#"+e+ort))&&(t?o.classList.add("e-disabled"):o.classList.remove("e-disabled")))},Xrt.prototype.addCollection=function(e,t,i,n){var o,r,s=Prt(this.tabs,e);!s||"Row"===s.group.orientation&&3===s.group.collections.length||(this.selectedTab===s.tabIndex&&this.clearOverflowResize(),r=s.group.collections.slice(),o=-1===(o=i?Ert(r,function(e){return e.id===i}):-1)?r.length:o+(n?1:0),r.splice(o,0,t),s.group.setProperties({collections:r},!0),this.checkID([s.group.collections[parseInt(o.toString(),10)]],"collection",e),this.validateItemSize(),""!==(t=this.tabObj.items[s.tabIndex].content).innerHTML&&(r=s.group.collections[parseInt(o.toString(),10)],o=this.createCollection([r],s.group.orientation,s.group.id,s.group.header,s.group.enableGroupOverflow,s.tabIndex)[0],s.group.isCollapsed&&(t=this.ribbonDropDownModule.getOverflowDropDownPopup(s,t)),(r=i?t.querySelector("#"+i):null)?r.insertAdjacentElement(n?"afterend":"beforebegin",o):t.querySelector("#"+e+nrt).append(o)),this.selectedTab===s.tabIndex&&this.refreshLayout())},Xrt.prototype.removeCollection=function(e){var t=krt(this.tabs,e);if(t){this.selectedTab===t.tabIndex&&this.clearOverflowResize();var i=this.tabObj.items[t.tabIndex].content;if(""!==i.innerHTML){var n=void 0;this.activeLayout===fit.Simplified&&(n=(a=t.group.enableGroupOverflow?i.querySelector("#"+t.group.id+ert):null)?At(a,u2):this.overflowDDB);for(var o=0,r=t.collection.items;o<r.length;o++){var s=r[o];this.removeItemElement(i,s,n)}var a=i.querySelector("#"+e);a&&a.remove()}e=t.group,a=e.collections.slice();a.splice(t.collectionIndex,1),e.setProperties({collections:a},!0),this.selectedTab===t.tabIndex&&this.refreshLayout()}},Xrt.prototype.addItem=function(e,t,i,n){var o,r,s=krt(this.tabs,e);!s||"Column"===s.group.orientation&&3===s.collection.items.length||(this.selectedTab===s.tabIndex&&this.clearOverflowResize(),r=s.collection.items.slice(),o=-1===(o=i?Ert(r,function(e){return e.id===i}):-1)?r.length:o+(n?1:0),r.splice(o,0,t),s.collection.setProperties({items:r},!0),this.checkID([s.collection.items[parseInt(o.toString(),10)]],"item",e),this.validateItemSize(),r=(t=this.tabObj.items[s.tabIndex].content).querySelector("#"+s.group.id+ort),""!==t.innerHTML&&(o=s.collection.items[parseInt(o.toString(),10)],o=this.createItems([o],s.group.orientation,s.group.id,s.group.header,s.group.enableGroupOverflow,s.tabIndex,r)[0],s.group.isCollapsed&&(t=this.ribbonDropDownModule.getOverflowDropDownPopup(s,t)),(r=i?t.querySelector("#"+i):null)?r.closest("."+Aot).insertAdjacentElement(n?"afterend":"beforebegin",o):o&&t.querySelector("#"+e).append(o)),this.selectedTab===s.tabIndex&&this.refreshLayout())},Xrt.prototype.removeItem=function(e){var t,i,n,e=Mrt(this.tabs,e);e&&(this.selectedTab===e.tabIndex&&this.clearOverflowResize(),""!==(i=this.tabObj.items[e.tabIndex].content).innerHTML&&(t=n=void 0,this.activeLayout===fit.Simplified&&(t=(n=e.group.enableGroupOverflow?i.querySelector("#"+e.group.id+ert):null)?At(n,u2):this.overflowDDB),n=e.item,this.removeItemElement(i,n,t)),(n=(i=e.collection).items).splice(e.itemIndex,1),i.setProperties({items:n},!0),this.selectedTab===e.tabIndex)&&this.refreshLayout()},Xrt.prototype.hideItem=function(e){this.showHideItem(e,!0)},Xrt.prototype.showItem=function(e){this.showHideItem(e,!1)},Xrt.prototype.showHideItem=function(e,t){var i,n=Mrt(this.tabs,e);n&&((i="GroupButton"===n.item.type?Rrt(this,e+crt,n):Rrt(this,e,n))?(i=z(i,".e-ribbon-item"),this.updateHiddenElements(n.tabIndex,t?"hideItem":"showItem",e,t,i,n.group),this.selectedTab===n.tabIndex&&this.refreshLayout()):this.updateInitialProps(n.tabIndex,e,"hiddenItems",t))},Xrt.prototype.updateInitialProps=function(e,t,i,n){var o,r=this.initialPropsData[parseInt(e.toString(),10)];r||(this.initialPropsData[parseInt(e.toString(),10)]={},r=this.initialPropsData[parseInt(e.toString(),10)]),r&&(r[""+i]||(r[""+i]=[]),o=r[""+i].indexOf(t),n?-1===o&&r[""+i].push(t):(-1!==o&&r[""+i].splice(o,1),0===r[""+i].length&&delete r[""+i],0===Object.keys(r).length&&delete this.initialPropsData[parseInt(e.toString(),10)]))},Xrt.prototype.checkHiddenItems=function(e,t,i){var n=!0,o=this.tabObj.items[parseInt(i.toString(),10)].content,r=o.querySelector("#"+e.id);if(t){for(var s=0;s<e.collections.length;s++)if(n)for(var a=e.collections[parseInt(s.toString(),10)],l=0;l<a.items.length;l++){var h,d=a.items[parseInt(l.toString(),10)],p=void 0;if(!((p="GroupButton"===d.type?(h=Mrt(this.tabs,d.id),Rrt(this,d.id+crt,h)):Rrt(this,d.id))?p.closest(".e-ribbon-item"):null).classList.contains("e-hidden")){n=!1;break}}n&&(r.classList.add("e-hide-group"),this.checkOverflowItems(t,o,e.enableGroupOverflow,i,e.id))}else r.classList.remove("e-hide-group"),this.checkOverflowItems(t,o,e.enableGroupOverflow,i,e.id);"Simplified"!==this.activeLayout||e.enableGroupOverflow||(t=r.querySelectorAll("."+Aot))&&(o=this.checkEmptyCollection(t),r.classList[o?"add":"remove"]("e-ribbon-emptyCollection"))},Xrt.prototype.checkOverflowItems=function(e,t,i,n,o){var r;i?(r=(i=t.querySelector("#"+o+ert))?K(i,u2).target:r)&&(e?r.classList.add("e-hide-group"):r.classList.remove("e-hide-group")):this.overflowDDB&&(t=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(n.toString(),10)].id+rrt))&&(i=t.querySelector("#"+o+ort))&&(e?i.classList.add("e-hide-group"):i.classList.remove("e-hide-group"))},Xrt.prototype.updateTab=function(e){var t=e.id,i=Ert(this.tabs,function(e){return e.id===t});if(-1!==i){var n=this.tabObj.items[parseInt(i.toString(),10)].content,o=this.tabs[parseInt(i.toString(),10)].groups,r=this.tabObj.element;if(o&&""!==n.innerHTML&&(e.cssClass&&this.tabs[parseInt(i.toString(),10)].cssClass&&(n.classList.remove(this.tabs[parseInt(i.toString(),10)].cssClass),r.querySelector(".e-active").classList.remove(this.tabs[parseInt(i.toString(),10)].cssClass)),e.groups)){for(var s=0,a=o;s<a.length;s++){for(var l=a[s],h=l.isCollapsed?n.querySelector("#"+l.id+rrt+srt):null,d=0,p=l.collections;d<p.length;d++)for(var c=0,u=p[d].items;c<u.length;c++){var g=u[c],m=h?this.ribbonDropDownModule.getDDBItemElement(h,g.id):n.querySelector("#"+g.id);(m=g.type===wit.GroupButton&&"Classic"===this.activeLayout?h?this.ribbonDropDownModule.getDDBItemElement(h,g.id+crt):n.querySelector("#"+g.id+crt):m)&&this.destroyFunction(g,m)}h&&this.ribbonDropDownModule.removeOverFlowDropDown(h)}n.querySelectorAll(".e-ribbon-group").forEach(function(e){e.remove()})}i===this.selectedTab&&(this.isAddRemove=!0);o=this.tabs[parseInt(i.toString(),10)];o.setProperties(e,!0),this.setProperties({groups:this.checkID(o.groups,"group",o.id)},!0),this.validateItemSize(),""===n.innerHTML&&(e.groups&&ht(this.createGroups(o.groups,i),n),this.selectedTab===i&&this.refreshLayout(),e.cssClass&&(n.classList.add(o.cssClass),r.querySelector(".e-active").classList.add(o.cssClass)),e.header)&&(r.querySelector("#"+t+trt).innerText=o.header)}},Xrt.prototype.updateGroup=function(e){var t=e.id,i=Prt(this.tabs,t);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var n,o=this.tabObj.items[i.tabIndex].content,t=o.querySelector("#"+t),r=t.querySelector("#"+e.id+ort);if(""!==o.innerHTML){if(i.group.showLauncherIcon&&this.removeLauncherIcon(i.group.id,null,o),this.activeLayout===fit.Simplified&&(n=(u=i.group.enableGroupOverflow?o.querySelector("#"+i.group.id+ert):null)?At(u,u2):this.overflowDDB),e.cssClass&&i.group.cssClass&&(t.classList.remove(i.group.cssClass),r)&&r.classList.remove(i.group.cssClass),(e.collections||e.orientation)&&(i.group.collections||i.group.orientation)){for(var s=0,a=i.group.collections;s<a.length;s++)for(var l=0,h=a[s].items;l<h.length;l++){var d=h[l];this.removeItemElement(o,d,n)}t.querySelectorAll(".e-ribbon-collection").forEach(function(e){e.remove()}),e.orientation&&(u=(p=r.querySelector(".e-ribbon-group-content")).classList.value.match(/(e-ribbon-[column|row]+)/g))&&q([p],u)}this.activeLayout===fit.Simplified&&(i.group.enableGroupOverflow?(0===n.target.childElementCount||1===n.target.childElementCount&&this.isHeaderVisible(n.target,i.group.id))&&this.removeOverflowButton(n):((u=n.target.querySelector("#"+i.group.id+ort))&&1===u.childElementCount&&u.remove(),(u=n.target.querySelector("#"+this.tabs[parseInt(i.tabIndex.toString(),10)].id+rrt))&&0===u.childElementCount&&u.remove()))}var p,c,u=i.group;u.setProperties(e,!0),u.setProperties({collections:this.checkID(u.collections,"collection",u.id)},!0),this.validateItemSize(),""!==o.innerHTML&&(e.showLauncherIcon&&this.createLauncherIcon(u.id,r,i.tabIndex),(e.collections||e.orientation)&&((p=r.querySelector(".e-ribbon-group-content")).classList.add("Column"===u.orientation||"Simplified"===this.activeLayout?Iot:xot),ht(this.createCollection(u.collections,u.orientation,u.id,u.header,u.enableGroupOverflow,i.tabIndex,r),p)),this.selectedTab===i.tabIndex&&this.refreshLayout(),e.cssClass&&(t.classList.add(u.cssClass),r)&&r.classList.add(u.cssClass),e.header)&&(this.activeLayout!==fit.Simplified||e.enableGroupOverflow?this.activeLayout!==fit.Classic||u.isCollapsed?this.activeLayout===fit.Classic&&u.isCollapsed&&(c=K(t.querySelector("#"+u.id+rrt+srt),u2).target.querySelector("#"+e.id+trt))&&(c.innerText=u.header):t.querySelector(".e-ribbon-group-header").innerText=u.header:(c=n.target.querySelector("#"+e.id+trt))&&(c.innerText=u.header))}},Xrt.prototype.updateCollection=function(e){var t=e.id,i=krt(this.tabs,t);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var n=this.tabObj.items[i.tabIndex].content,t=n.querySelector("#"+t);if(""!==n.innerHTML){var o=void 0;if(this.activeLayout===fit.Simplified&&(o=(h=i.group.enableGroupOverflow?n.querySelector("#"+i.group.id+ert):null)?At(h,u2):this.overflowDDB),e.cssClass&&i.collection.cssClass&&t.classList.remove(i.collection.cssClass),e.items&&i.collection.items)for(var r=0,s=i.collection.items;r<s.length;r++){var a=s[r];this.removeItemElement(n,a,o)}}var l,h=i.collection;h.setProperties(e,!0),h.setProperties({items:this.checkID(h.items,"item",h.id)},!0),this.validateItemSize(),""!==n.innerHTML&&e.items&&(l=n.querySelector("#"+i.group.id+ort),ht(this.createItems(h.items,i.group.orientation,i.group.id,i.group.header,i.group.enableGroupOverflow,i.tabIndex,l),t)),this.selectedTab===i.tabIndex&&this.refreshLayout(),e.cssClass&&t.classList.add(h.cssClass)}},Xrt.prototype.updateItem=function(e){var t,i,n,o,r,s,a=e.id,l=Mrt(this.tabs,a);l&&(this.selectedTab===l.tabIndex&&this.clearOverflowResize(),(i=(t=this.tabObj.items[l.tabIndex].content).querySelector("#"+l.group.id))?(i=i.querySelector("#"+l.group.id+ort),r=o=null,n=s=void 0,""!==t.innerHTML&&(this.activeLayout===fit.Simplified&&(n=(s=l.group.enableGroupOverflow?t.querySelector("#"+l.group.id+ert):null)?At(s,u2):this.overflowDDB),this.activeLayout===fit.Simplified&&l.item.displayOptions===bit.Overflow?(o=n.target.querySelector("#"+a+ort),r=n.target.querySelector("#"+a),e.displayOptions&&e.displayOptions!==bit.Overflow&&(s=i.querySelector("#"+l.collection.id))&&s.appendChild(o)):(o=i.querySelector("#"+a+ort),r=t.querySelector("#"+a),o=o||(n?n.target:i).querySelector("#"+a+ort),r=r||(n?n.target:t).querySelector("#"+a),"Gallery"===l.item.type&&(r=r||t.querySelector("#"+a+"_galleryWrapper")),"GroupButton"===l.item.type&&this.activeLayout===fit.Classic&&(r=t.querySelector("#"+a+crt)),this.activeLayout===fit.Simplified&&e.displayOptions===bit.Overflow&&(this.createOverflowPopup(l.item,l.tabIndex,l.group.enableGroupOverflow,l.group.id,l.group.header,o,i),l.item.type!==wit.DropDown&&l.item.type!==wit.SplitButton&&e.type!==wit.GroupButton&&e.type!==wit.Gallery||this.updatePopupItems(l.item,o,l.group.enableGroupOverflow,!0))),e.cssClass&&l.item.cssClass&&o.classList.remove(l.item.cssClass),this.destroyFunction(l.item,r),r.remove(),s=o.classList.value.match(/(e-ribbon-[large|medium|small]+-item)/g))&&q([o],s),(r=l.item).setProperties(e,!0),this.validateItemSize(),""!==t.innerHTML&&(r.ribbonTooltipSettings&&Ort(r.ribbonTooltipSettings)&&(o.classList.add(Lot),this.tooltipData.push({id:o.id,data:r.ribbonTooltipSettings})),s=r.activeSize,"Simplified"===this.activeLayout&&(s=r.allowedSizes===vit.Large||r.allowedSizes&vit.Medium||r.displayOptions===bit.Overflow?vit.Medium:vit.Small,r.setProperties({activeSize:s},!0)),s&vit.Large?o.classList.add(Tot,Mot):s&vit.Medium?o.classList.add(Eot):o.classList.add(Dot),this.createRibbonItem(r,o),"Gallery"===l.item.type&&document.querySelector("#"+a+"_container").closest(".e-ribbon-overflow-target")&&e.displayOptions!==bit.Overflow&&this.createOverflowPopup(l.item,l.tabIndex,l.group.enableGroupOverflow,l.group.id,l.group.header,o,i),"Simplified"===this.activeLayout&&l.group.enableGroupOverflow&&(0===n.target.childElementCount||1===n.target.childElementCount&&this.isHeaderVisible(n.target,l.group.id))&&this.removeOverflowButton(n),this.selectedTab===l.tabIndex&&this.refreshLayout(),e.cssClass&&o.classList.add(r.cssClass),!r.disabled&&o.classList.contains(Nnt)&&o.classList.remove(Nnt),this.enableDisableItem(r.id,r.disabled))):(this.isUpdateItems=!0,this.itemsModel.push(e),this.targetTabs[e.id]=l.tabIndex))},Xrt.prototype.removeItemElement=function(e,t,i){var n=null;this.activeLayout===fit.Classic?(n=t.displayOptions&bit.Classic?e.querySelector("#"+t.id):null,"GroupButton"===t.type&&(n=t.displayOptions&bit.Classic?e.querySelector("#"+t.id+crt):null)):n=(n=t.displayOptions&bit.Simplified?e.querySelector("#"+t.id):null)||i.target.querySelector("#"+t.id),n&&(this.destroyFunction(t,n),("GroupButton"===t.type&&this.activeLayout===fit.Simplified?document.getElementById(t.id+ort):n.closest("#"+t.id+ort)).remove())},Xrt.prototype.enableItem=function(e){this.enableDisableItem(e,!1)},Xrt.prototype.disableItem=function(e){this.enableDisableItem(e,!0)},Xrt.prototype.getItem=function(e){return Mrt(this.tabs,e).item},Xrt.prototype.enableDisableItem=function(e,t){var i,n=!1,o=Mrt(this.tabs,e);if(o&&(o.item.setProperties({disabled:t},!0),"GroupButton"===o.item.type?i=Rrt(this,e+crt,o):"Gallery"===o.item.type?(i=document.querySelector("#"+e))?n=!0:i=document.querySelector("#"+e+"_galleryWrapper"):i=Rrt(this,e,o),i)){var r=z(i,".e-ribbon-item"),s=this.getItemModuleName(o.item),a=t?!r.classList.contains(Nnt):r.classList.contains(Nnt);if("template"!==s){if(a)if("group-btn"===s&&"Simplified"===this.activeLayout){Lrt(i,"dropdown-btn",t);for(var l=0;l<o.item.groupButtonSettings.items.length;l++)Lrt(document.querySelector("#"+e+crt+l),"btn",t)}else if("group-btn"===s&&"Classic"===this.activeLayout)for(l=0;l<o.item.groupButtonSettings.items.length;l++)Lrt(i.querySelector("#"+e+crt+l),"btn",t);else"gallery"===s?(i.classList.toggle(Nnt,t),document.getElementById(e+"_popupButton").classList.toggle(Nnt,t),n&&document.getElementById(e+"_galleryWrapper").classList.toggle(Nnt,t)):Lrt(i,s,t)}else i.classList.toggle(Nnt,t),i.toggleAttribute("disabled",t);r.classList.toggle(Nnt,o.item.disabled)}},Xrt.prototype.unwireEvents=function(){E.remove(window,"resize",this.resizeHandler),E.remove(document.body,"keydown",this.keytipActionHandler),E.remove(document,"mousedown",this.mouseEventHandler),E.remove(document,"scroll",this.mouseEventHandler)},Xrt.prototype.destroy=function(){this.keyboardModuleRibbon.destroy(),this.keyboardModuleRibbon=null,_rt(this.element),this.refreshing&&this.clearOverflowDropDown(this.selectedTab),this.destroyTabItems(this.tabs),this.hideLayoutSwitcher||this.removeExpandCollapse(),this.collapseButton=void 0,this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null),this.ribbonTempEle&&(ue(this.ribbonTempEle),this.ribbonTempEle=null),qrt.prototype.destroy.call(this),this.tabObj.destroy(),this.tabObj=void 0,this.initialPropsData={},this.hiddenGroups=[],this.hiddenElements={},this.keyTipElements={},this.itemsModel=[],this.targetTabs={},ue(this.element.querySelector("#"+this.element.id+Kot)),this.element.style.removeProperty(grt),this.element.style.removeProperty(mrt),this.element.style.removeProperty("width"),this.cssClass&&q([this.element],this.cssClass.split(" ")),this.element.classList.remove(Vnt,Hot,iot,Znt,oot,"e-rbn"),this.unwireEvents()},Xrt.prototype.onPropertyChanged=function(e,t){for(var i,n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"activeLayout":this.switchLayout();break;case"cssClass":t.cssClass&&(i=this.element.classList).remove.apply(i,t.cssClass.split(" ")),e.cssClass&&(i=this.element.classList).add.apply(i,e.cssClass.split(" "));break;case"isMinimized":this.element.classList.toggle(oot,this.isMinimized),this.tabObj.element.querySelector(".e-content").style.display=this.isMinimized?"none":"block",this.isMinimized||this.refreshLayout();break;case"locale":this.updateCommonProperty({locale:this.locale});break;case"enablePersistence":this.updateCommonProperty({enablePersistence:this.enablePersistence});break;case"enableRtl":this.element.classList.toggle(Vnt,this.enableRtl),this.updateCommonProperty({enableRtl:e.enableRtl}),this.scrollModule&&this.scrollModule.setProperties({enableRtl:e.enableRtl});break;case"launcherIconCss":for(var r=0;r<this.tabs.length;r++){var s=this.tabObj.items[parseInt(r.toString(),10)].content,a=this.tabs[parseInt(r.toString(),10)];if(s.querySelector("."+rot))for(var l=0,h=a.groups;l<h.length;l++){var d,p=h[l];p.showLauncherIcon&&(d=wot+" "+(this.launcherIconCss||Cot),p.isCollapsed?At(s.querySelector("#"+p.id+rrt+srt),u2).target.querySelector("#"+p.id+irt).className=d:s.querySelector("#"+p.id+irt).className=d)}}break;case"selectedTab":var c=this.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(e.selectedTab.toString(),10)];c.classList.contains("e-hidden")||c.classList.contains("e-disable")||this.tabObj.setProperties({selectedItem:e.selectedTab});break;case"tabAnimation":this.tabObj.setProperties({animation:e.tabAnimation});break;case"tabs":this.reRenderTabs(e.tabs);break;case"contextualTabs":for(r=0;r<this.contextualTabs.length;r++)e.contextualTabs[parseInt(r.toString(),10)]&&this.ribbonContextualTabModule.updateContextualTabs(e.contextualTabs[parseInt(r.toString(),10)],this.contextualTabs[parseInt(r.toString(),10)]);break;case"width":this.element.style.width=T(e.width),this.refreshLayout();break;case"fileMenu":this.ribbonFileMenuModule&&this.ribbonFileMenuModule.updateFileMenu(this.fileMenu),this.tabObj.tbObj.refreshOverflow();break;case"backStageMenu":this.ribbonBackstageModule&&this.ribbonBackstageModule.updateBackStageMenu(this.backStageMenu),this.tabObj.tbObj.refreshOverflow();break;case"helpPaneTemplate":this.ribbonTempEle&&(ue(this.ribbonTempEle),this.ribbonTempEle=null,this.tabObj.element.style.setProperty(mrt,"0px")),this.helpPaneTemplate&&this.createHelpPaneTemplate(),this.tabObj.tbObj.refreshOverflow();break;case"hideLayoutSwitcher":this.hideLayoutSwitcher?this.removeExpandCollapse():this.addExpandCollapse()}},Yrt([e("Classic")],Xrt.prototype,"activeLayout",void 0),Yrt([e("")],Xrt.prototype,"cssClass",void 0),Yrt([e(!1)],Xrt.prototype,"enableKeyTips",void 0),Yrt([e("")],Xrt.prototype,"layoutSwitcherKeyTip",void 0),Yrt([t({},pJ)],Xrt.prototype,"fileMenu",void 0),Yrt([t({},d$)],Xrt.prototype,"backStageMenu",void 0),Yrt([e("")],Xrt.prototype,"launcherIconCss",void 0),Yrt([e(!1)],Xrt.prototype,"isMinimized",void 0),Yrt([e("en-us")],Xrt.prototype,"locale",void 0),Yrt([e(0)],Xrt.prototype,"selectedTab",void 0),Yrt([t({},C5)],Xrt.prototype,"tabAnimation",void 0),Yrt([kt([],jee)],Xrt.prototype,"tabs",void 0),Yrt([kt([],Cet)],Xrt.prototype,"contextualTabs",void 0),Yrt([e("100%")],Xrt.prototype,"width",void 0),Yrt([e("")],Xrt.prototype,"helpPaneTemplate",void 0),Yrt([e(!1)],Xrt.prototype,"hideLayoutSwitcher",void 0),Yrt([i()],Xrt.prototype,"tabSelecting",void 0),Yrt([i()],Xrt.prototype,"tabSelected",void 0),Yrt([i()],Xrt.prototype,"ribbonExpanding",void 0),Yrt([i()],Xrt.prototype,"ribbonCollapsing",void 0),Yrt([i()],Xrt.prototype,"ribbonLayoutSwitched",void 0),Yrt([i()],Xrt.prototype,"launcherIconClick",void 0),Yrt([i()],Xrt.prototype,"created",void 0),Yrt([i()],Xrt.prototype,"overflowPopupOpen",void 0),Yrt([i()],Xrt.prototype,"overflowPopupClose",void 0),Grt=Yrt([Bt],Xrt));function Xrt(e,t){return Grt.Inject(frt,vrt,Art,Irt,Crt,jrt),qrt.call(this,e,t)||this}Jrt.prototype.getModuleName=function(){return"ribbonFileMenu"},Jrt.prototype.destroy=function(){this.fileMenuDDB&&this.destroyDDB(),this.parent=null},Jrt.prototype.createFileMenu=function(e){var t,i,n=this;e.visible&&(this.ddbElement=this.parent.createElement("button",{id:this.parent.element.id+"_filemenu"}),i=(t=this.parent.tabObj.element).querySelector(".e-toolbar"),t.insertBefore(this.ddbElement,i),this.fileMenuDDB=new u2({content:e.text,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-file-menu e-caret-hide",created:function(){t.style.setProperty(grt,n.ddbElement.offsetWidth+"px")},beforeClose:this.ddbBeforeEvent.bind(this,!1),beforeOpen:this.ddbBeforeEvent.bind(this,!0),close:this.ddbAfterEvent.bind(this,!1),open:this.ddbAfterEvent.bind(this,!0)},this.ddbElement),this.parent.fileMenu.popupTemplate?this.fileMenuDDB.setProperties({target:this.parent.fileMenu.popupTemplate}):this.createRibbonMenu(e),this.parent.tabObj.refreshActiveTabBorder(),this.addFileMenuTooltip(e),this.addFileMenuKeytip())},Jrt.prototype.addFileMenuTooltip=function(e){Ort(e.ribbonTooltipSettings)&&(this.ddbElement.classList.add(Lot),this.parent.tooltipData.push({id:this.ddbElement.id,data:e.ribbonTooltipSettings}))},Jrt.prototype.addFileMenuKeytip=function(){this.parent.fileMenu.keyTip&&(this.parent.keyTipElements.filemenu=[],this.parent.keyTipElements.filemenu.push({id:this.ddbElement.id,type:"filemenu",keyTip:this.parent.fileMenu.keyTip}))},Jrt.prototype.ddbBeforeEvent=function(e,t){!e&&t.event&&t.event.target.closest(".e-ribbon-menu")&&(t.cancel=!0);var i,e=e?this.parent.fileMenu.beforeOpen:this.parent.fileMenu.beforeClose;e&&(i={cancel:t.cancel,element:t.element,event:t.event},e.call(this,i),t.cancel=i.cancel)},Jrt.prototype.ddbAfterEvent=function(e,t){(e?this.fileMenuDDB.target:this.fileMenuDDB.element).focus();e=e?this.parent.fileMenu.open:this.parent.fileMenu.close;e&&(t={element:t.element},e.call(this,t))},Jrt.prototype.cloneMenuItem=function(e){for(var t=[],i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)];t.push({iconCss:n.iconCss,id:n.id,separator:n.separator,text:n.text,url:n.url,items:this.cloneMenuItem(n.items)})}return t},Jrt.prototype.createRibbonMenu=function(e){var t=this,i=this.parent.createElement("ul",{id:this.parent.element.id+hrt});this.fileMenuDDB.setProperties({target:i}),this.menuctrl=new L4({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-menu",animationSettings:e.animationSettings,items:this.cloneMenuItem(e.menuItems),showItemOnClick:e.showItemOnClick,template:e.itemTemplate,beforeClose:this.menuBeforeEvent.bind(this,!1),beforeOpen:this.menuBeforeEvent.bind(this,!0),beforeItemRender:this.beforeItemRender.bind(this),onClose:this.menuAfterEvent.bind(this,!1),onOpen:this.menuAfterEvent.bind(this,!0),select:this.menuSelect.bind(this)},i),E.add(i,"keydown",function(e){"Tab"===e.key&&t.fileMenuDDB.toggle()},this)},Jrt.prototype.menuBeforeEvent=function(e,t){var i,e=e?this.parent.fileMenu.beforeOpen:this.parent.fileMenu.beforeClose;e&&(i={cancel:t.cancel,element:t.element,event:t.event,items:t.items,parentItem:t.parentItem},e.call(this,i),t.cancel=i.cancel)},Jrt.prototype.menuAfterEvent=function(e,t){e=e?this.parent.fileMenu.open:this.parent.fileMenu.close;e&&(t={element:t.element,items:t.items,parentItem:t.parentItem},e.call(this,t))},Jrt.prototype.beforeItemRender=function(e){var t=this.parent.fileMenu.beforeItemRender;t&&(e={element:e.element,item:e.item},t.call(this,e))},Jrt.prototype.menuSelect=function(e){var t,i=this.parent.fileMenu.select;i&&(t={element:e.element,item:e.item,event:e.event},i.call(this,t),e.element.classList.contains("e-menu-caret-icon")||this.fileMenuDDB.toggle())},Jrt.prototype.setCommonProperties=function(e){this.fileMenuDDB&&(this.fileMenuDDB.setProperties(e),this.menuctrl)&&this.menuctrl.setProperties(e)},Jrt.prototype.updateFileMenu=function(e){e.visible?this.fileMenuDDB?(e.text&&(this.fileMenuDDB.setProperties({content:e.text}),this.parent.tabObj.element.style.setProperty(grt,this.ddbElement.offsetWidth+"px")),e.popupTemplate?(this.menuctrl&&this.destroyMenu(),this.fileMenuDDB.setProperties({target:e.popupTemplate})):this.menuctrl?this.menuctrl.setProperties({animationSettings:e.animationSettings,items:this.cloneMenuItem(e.menuItems),showItemOnClick:e.showItemOnClick,template:e.itemTemplate}):this.createRibbonMenu(e),this.removeFileMenuTooltip(),this.removeFileMenuKeytip(),this.addFileMenuTooltip(e),this.addFileMenuKeytip()):this.createFileMenu(e):this.fileMenuDDB&&this.destroyDDB(),this.parent.tabObj.refreshActiveTabBorder()},Jrt.prototype.destroyMenu=function(){this.menuctrl&&(this.menuctrl.destroy(),this.menuctrl=null)},Jrt.prototype.destroyDDB=function(){this.removeFileMenuTooltip(),this.removeFileMenuKeytip(),this.parent.tabObj.element.style.removeProperty(grt),this.destroyMenu(),this.fileMenuDDB.destroy(),this.fileMenuDDB=null,ue(this.ddbElement),this.ddbElement=null},Jrt.prototype.removeFileMenuTooltip=function(){var t=this,e=Ert(this.parent.tooltipData,function(e){return e.id===t.ddbElement.id});-1!==e&&(this.ddbElement.classList.remove(Lot),this.parent.tooltipData.splice(e,1))},Jrt.prototype.removeFileMenuKeytip=function(){var e,t=this;this.parent.keyTipElements.filemenu&&-1!==(e=Ert(this.parent.keyTipElements.filemenu,function(e){return e.id===t.ddbElement.id}))&&this.parent.keyTipElements.filemenu.splice(e,1)},Jrt.prototype.addItems=function(e,t,i,n){i?this.menuctrl.insertAfter(e,t,n):this.menuctrl.insertBefore(e,t,n),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},Jrt.prototype.removeItems=function(e,t){this.menuctrl.removeItems(e,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},Jrt.prototype.enableItems=function(e,t){this.menuctrl.enableItems(e,!0,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},Jrt.prototype.disableItems=function(e,t){this.menuctrl.enableItems(e,!1,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},Jrt.prototype.setItem=function(e,t,i){this.menuctrl.setItem(e,t,i),this.menuctrl.refresh(),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)};var Krt=Jrt;function Jrt(e){this.parent=e}Zrt=function(e,t){return(Zrt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Zrt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(tst,$rt=Ji),tst.prototype.render=function(){},tst.prototype.preRender=function(){},tst.prototype.getPersistData=function(){return""},tst.prototype.onPropertyChanged=function(){},tst.prototype.getModuleName=function(){return"ribbonBackstage"},tst.prototype.destroy=function(){this.backstageButton&&this.destroyDDB(),this.parent=null},tst.prototype.createBackStage=function(o){var r=this;if(o.visible){this.backstageButtonEle=this.parent.createElement("button",{id:this.parent.element.id+art});var e=this.parent.tabObj.element,t=e.querySelector(".e-toolbar");if(e.insertBefore(this.backstageButtonEle,t),this.backstageButton=new zv({content:o.text,enableRtl:this.parent.enableRtl,cssClass:Qot,created:function(){e.style.setProperty(grt,r.backstageButtonEle.offsetWidth+"px")}},this.backstageButtonEle),this.createBackStagePopup(o),this.parent.backStageMenu.template)this.createBackStageTemplate(this.parent.backStageMenu.template);else{for(var i=0,n=0,s=0;s<o.items.length;s++)o.items[parseInt(s.toString(),10)].isFooter?i++:n++;0<n&&this.createBackstageMenu(o,!1),0<i&&this.createBackstageMenu(o,!0),this.menuCtrl&&this.checkMenuItems(this.menuCtrl.items),this.footerMenuCtrl&&this.checkMenuItems(this.footerMenuCtrl.items)}this.backstageButtonEle.onclick=function(e){e.stopPropagation(),r.showBackstage(),r.popupHTMLElement.classList.add(jot);e=r.menuWrapper.querySelector(".e-menu-item.e-selected");e&&e.classList.remove("e-selected");for(var t=0;t<o.items.length;t++){var i=o.items[parseInt(t.toString(),10)];if(!i.isFooter&&r.menuCtrl.items[0].text===i.text){var n=r.popupHTMLElement.querySelector("#"+r.menuCtrl.items[0].id);n&&(n.classList.add("e-selected"),n.focus(),r.menuIndex=0,r.isCloseBtn=!1),r.createBackStageContent(r.menuCtrl.items[0].id,i.content);break}}},this.parent.tabObj.refreshActiveTabBorder(),this.addBackStageMenuTooltip(o),this.addBackStageMenuKeyTip(o),E.add(document,"click",this.onClickEvent,this)}},tst.prototype.onClickEvent=function(e){e=e.target;this.popupHTMLElement.contains(e)||this.hideBackstage()},tst.prototype.addBackStageMenuTooltip=function(e){Ort(e.ribbonTooltipSettings)&&(this.backstageButtonEle.classList.add(Lot),this.parent.tooltipData.push({id:this.backstageButtonEle.id,data:e.ribbonTooltipSettings}))},tst.prototype.addBackStageMenuKeyTip=function(e){if(e.keyTip&&(this.parent.keyTipElements.backstage||(this.parent.keyTipElements.backstage=[]),this.parent.keyTipElements.backstage.push({id:this.backstageButtonEle.id,type:"backstage",keyTip:e.keyTip})),e.items&&e.items.length){this.parent.keyTipElements.backstageMenu||(this.parent.keyTipElements.backstageMenu=[]);for(var t=0;t<e.items.length;t++)e.items[parseInt(t.toString(),10)].keyTip&&this.parent.keyTipElements.backstageMenu.push({id:e.items[parseInt(t.toString(),10)].id,type:"backstageMenu",keyTip:e.items[parseInt(t.toString(),10)].keyTip})}},tst.prototype.checkMenuItems=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i.iconCss||this.popupHTMLElement.querySelector("#"+i.id).classList.add(Xot)}},tst.prototype.createBackStagePopup=function(e){var t=this;this.popupHTMLElement=this.parent.createElement("div",{id:this.parent.element.id+lrt,className:zot}),(e.target?e.target instanceof HTMLElement?e.target:document.querySelector(e.target):this.parent.element).appendChild(this.popupHTMLElement),this.popupEle=new Sv(this.popupHTMLElement,{height:e.height,width:e.width,relateTo:e.target||this.parent.element,enableRtl:this.parent.enableRtl}),this.parent.enableRtl&&this.updatePopupPositionOnRtl(this.parent.enableRtl),this.hideBackstage(),E.add(this.popupHTMLElement,"keyup",function(e){"Escape"===e.code&&t.hideBackstage(),t.handleNavigation(e)},this)},tst.prototype.handleNavigation=function(e){var t=this.popupHTMLElement.querySelector(".e-ribbon-close-btn"),i=this.popupHTMLElement.querySelectorAll(".e-menu-item"),n="ArrowUp"===e.key,e="ArrowDown"===e.key;if(n||e){n&&0<this.menuIndex||e&&this.menuIndex<i.length-1&&!this.isCloseBtn?this.menuIndex=n?this.menuIndex-1:this.menuIndex+1:t&&!this.isCloseBtn?(t.focus(),this.isCloseBtn=!0):(this.menuIndex=n?i.length-1:0,this.isCloseBtn=!1);for(var o=0;o<i.length;o++)i[parseInt(o.toString(),10)].classList.remove("e-focused");this.isCloseBtn||(n&&i[this.menuIndex].classList.contains("e-separator")?this.menuIndex--:e&&i[this.menuIndex].classList.contains("e-separator")&&this.menuIndex++,i[this.menuIndex].classList.add("e-focused"),i[this.menuIndex].focus())}},tst.prototype.updatePopupPositionOnRtl=function(e){var t=this.popupHTMLElement.style;e?(t.right=t.left,t.left="unset"):(t.left=t.right,t.right="unset")},tst.prototype.createBackstageMenu=function(e,t){var i,n,o=this;this.popupHTMLElement.querySelector("#"+this.parent.element.id+"_wrapper")||(this.menuWrapper=this.parent.createElement("div",{id:this.parent.element.id+"_wrapper",className:Got}),this.popupHTMLElement.appendChild(this.menuWrapper)),e.backButton.visible&&!t&&(i=this.parent.createElement("button",{id:this.parent.element.id+"_close",className:"e-ribbon-close-btn"}),this.closeBtn=new zv({content:e.backButton.text,iconCss:e.backButton.iconCss||Lnt,enableRtl:this.parent.enableRtl},i),this.menuWrapper.append(i),i.onclick=function(){o.popupHTMLElement.classList.remove(jot),o.hideBackstage(),o.isBackButtonClicked=!0}),this.popupHTMLElement.querySelector("#"+this.parent.element.id+"_itemswrapper")||(this.itemsWrapperEle=this.parent.createElement("div",{id:this.parent.element.id+"_itemswrapper",className:Yot}),this.menuWrapper.append(this.itemsWrapperEle)),t?(n=this.parent.createElement("ul",{id:this.parent.element.id+drt}),this.itemsWrapperEle.appendChild(n)):(this.ulMenuElem=this.parent.createElement("ul",{id:this.parent.element.id+"_menulist"}),this.itemsWrapperEle.appendChild(this.ulMenuElem)),t?this.footerMenuCtrl=new L4({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:Uot,items:this.cloneFooterMenuItem(e.items),select:this.menuSelect.bind(this,e)},n):this.menuCtrl=new L4({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:Uot,items:this.cloneMenuItem(e.items),select:this.menuSelect.bind(this,e)},this.ulMenuElem)},tst.prototype.cloneMenuItem=function(e){for(var t=[],i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)];n.isFooter||t.push({id:n.id,iconCss:n.iconCss,separator:n.separator,text:n.text})}return t},tst.prototype.cloneFooterMenuItem=function(e){for(var t=[],i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)];n.isFooter&&t.push({id:n.id,iconCss:n.iconCss,separator:n.separator,text:n.text})}return t},tst.prototype.createBackStageContent=function(e,t){var i="backstageContent",e=(this.clearTemplate([i]),this.backstageContentEle?(this.backstageContentEle.innerHTML="",this.backstageContentEle.id=e+nrt):this.backstageContentEle=this.parent.createElement("div",{id:e+nrt,className:Wot}),Drt(t));return ht(e({},this,i,"backstageContent",this.parent.isStringTemplate),this.backstageContentEle),t&&this.popupHTMLElement.append(this.backstageContentEle),this.renderReactTemplates(),e},tst.prototype.createBackStageTemplate=function(e){var t="backstageTemplate",e=(this.clearTemplate([t]),this.backstageTempEle=this.parent.createElement("div",{id:this.parent.element.id+art+"_template",className:qot}),Drt(e));return ht(e({},this,t,"backstageTemplate",this.parent.isStringTemplate),this.backstageTempEle),this.popupHTMLElement.append(this.backstageTempEle),this.renderReactTemplates(),e},tst.prototype.menuSelect=function(e,t){for(var i=0;i<e.items.length;i++){var n=e.items[parseInt(i.toString(),10)];if(n.text===t.item.text){this.contentItem=n,this.menuIndex=i;break}}this.createBackStageContent(t.item.id,this.contentItem.content);var o={cancel:!1,target:t.element,item:this.contentItem,isBackButton:this.isBackButtonClicked};this.contentItem.backStageItemClick&&this.contentItem.backStageItemClick.call(this,o)},tst.prototype.setCommonProperties=function(e){this.backstageButton&&(this.backstageButton.setProperties(e),this.popupEle)&&(this.popupEle.setProperties(e),this.popupHTMLElement&&this.updatePopupPositionOnRtl(e.enableRtl),this.menuCtrl&&(this.menuCtrl.setProperties(e),this.closeBtn)&&this.closeBtn.setProperties(e),this.footerMenuCtrl)&&this.footerMenuCtrl.setProperties(e)},tst.prototype.updateBackStageMenu=function(e){if(e.visible)if(this.backstageButton){if(e.text&&(this.backstageButton.setProperties({content:e.text}),this.parent.tabObj.element.style.setProperty(grt,this.backstageButtonEle.offsetWidth+"px")),this.popupEle&&this.popupEle.setProperties({height:e.height,width:e.width,target:e.target||this.parent.element}),e.template)this.backstageTempEle&&(ue(this.backstageTempEle),this.backstageTempEle=null),this.createBackStageTemplate(e.template);else if(this.menuCtrl&&this.menuCtrl.setProperties({items:this.cloneMenuItem(e.items)}),this.footerMenuCtrl)this.footerMenuCtrl.setProperties({items:this.cloneFooterMenuItem(e.items)});else{for(var t=0,i=0,n=0;n<e.items.length;n++)e.items[parseInt(n.toString(),10)].isFooter?t++:i++;0<i&&this.createBackstageMenu(e,!1),0<t&&this.createBackstageMenu(e,!0)}this.removeBackstageMenuTooltip(),this.removeBackstageMenuKeyTip(),this.addBackStageMenuTooltip(e),this.addBackStageMenuKeyTip(e)}else this.createBackStage(e);else this.backstageButton&&this.destroyDDB();this.parent.tabObj.refreshActiveTabBorder()},tst.prototype.destroyMenu=function(){this.menuCtrl&&(this.menuCtrl.destroy(),this.menuCtrl=null)},tst.prototype.destroyDDB=function(){this.removeBackstageMenuTooltip(),this.removeBackstageMenuKeyTip(),this.parent.tabObj.element.style.removeProperty(grt),this.destroyMenu(),this.backstageButton.destroy(),this.backstageButton=null,ue(this.backstageButtonEle),this.backstageButtonEle=null,E.remove(document,"click",this.onClickEvent)},tst.prototype.removeBackstageMenuTooltip=function(){var t=this,e=Ert(this.parent.tooltipData,function(e){return e.id===t.backstageButtonEle.id});-1!==e&&(this.backstageButtonEle.classList.remove(Lot),this.parent.tooltipData.splice(e,1))},tst.prototype.removeBackstageMenuKeyTip=function(){var e,t=this;if(this.parent.keyTipElements.backstage&&this.parent.keyTipElements.backstage.length&&-1!==(e=Ert(this.parent.keyTipElements.backstage,function(e){return e.id===t.backstageButtonEle.id}))&&this.parent.keyTipElements.backstage.splice(e,1),this.parent.keyTipElements.backstageMenu&&this.parent.keyTipElements.backstageMenu.length)for(var i=0;i<this.parent.keyTipElements.backstageMenu.length;i++)this.parent.keyTipElements.backstageMenu.splice(i,1),i--},tst.prototype.addBackstageItems=function(e,t,i,n){for(var o=0;o<e.length;o++)(a=e[parseInt(o.toString(),10)]).isFooter?i?this.footerMenuCtrl.insertAfter(e,t,n):this.footerMenuCtrl.insertBefore(e,t,n):i?this.menuCtrl.insertAfter(e,t,n):this.menuCtrl.insertBefore(e,t,n);for(var r=[].concat(this.menuCtrl.items,this.footerMenuCtrl.items),s=this.parent.backStageMenu,o=0;o<s.items.length;o++)for(var a=s.items[parseInt(o.toString(),10)],l=0;l<r.length;l++){var h=r[parseInt(l.toString(),10)];if(a.text===h.text){h.content=a.content;break}}this.parent.backStageMenu.setProperties({items:r},!0)},tst.prototype.removeBackstageItems=function(e,t){this.menuCtrl.removeItems(e,t),this.footerMenuCtrl.removeItems(e,t);e=[].concat(this.menuCtrl.items,this.footerMenuCtrl.items);this.parent.backStageMenu.setProperties({items:e},!0)},tst.prototype.showBackstage=function(){this.popupEle.show()},tst.prototype.hideBackstage=function(){this.popupEle.element.classList.contains(jot)&&this.popupEle.element.classList.remove(jot),this.popupEle.hide()};var Zrt,$rt,est=tst;function tst(e){var t=$rt.call(this)||this;return t.parent=e,t}nst.prototype.getModuleName=function(){return"ribbonContextualTab"},nst.prototype.destroy=function(){this.parent=null},nst.prototype.addContextualTabs=function(){for(var e=!1,t=0;t<this.parent.contextualTabs.length;t++)for(var i=0;i<this.parent.contextualTabs[parseInt(t.toString(),10)].tabs.length;i++){this.parent.addTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(i.toString(),10)]);var n=this.parent.tabs.length-1,n=this.parent.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(n.toString(),10)];n.classList.add(Gnt),n.classList.add("e-hidden"),this.parent.contextualTabs[parseInt(t.toString(),10)].visible&&(this.parent.showTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(i.toString(),10)].id,!0),this.parent.contextualTabs[parseInt(t.toString(),10)].isSelected)&&!e&&(this.parent.selectTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[0].id),e=!0)}},nst.prototype.updateContextualTabs=function(e,i){if(!je(e.visible))for(var t=0;t<i.tabs.length;t++)e.visible?this.parent.showTab(i.tabs[parseInt(t.toString(),10)].id,!0):this.parent.hideTab(i.tabs[parseInt(t.toString(),10)].id,!0);if(!je(e.isSelected))if(e.isSelected&&i.visible)this.parent.selectTab(i.tabs[0].id);else for(var n=this.parent.tabObj.element,t=0;t<this.parent.tabs.length;t++){var o=n.querySelectorAll(".e-toolbar-item")[parseInt(t.toString(),10)];if(!o.classList.contains("e-hidden")&&!o.classList.contains("e-disable")){this.parent.selectTab(this.parent.tabs[parseInt(t.toString(),10)].id);break}}if(e.tabs)for(var r=this,s=0,a=Object.keys(e.tabs);s<a.length;s++)!function(e){var t=parseInt(e,10),e=r.parent.tabs.filter(function(e){return e.id===i.tabs[parseInt(t.toString(),10)].id})[0];r.parent.updateTab(e)}(a[s])};var ist=nst;function nst(e){this.parent=e}rst.prototype.getModuleName=function(){return"ribbonKeyTip"},rst.prototype.destroy=function(){this.parent=null},rst.prototype.createKeytip=function(e){if(this.parent.keyTipElements){var t=void 0;if("tab"===e){for(var i=0;i<this.parent.tabs.length;i++)this.parent.keyTipElements[parseInt(i.toString(),10)]&&(t=this.parent.keyTipElements[parseInt(i.toString(),10)][""+e],this.createKeyTipElement(t[0].id,t[0].keyTip,"tab","center","bottom",!0));this.parent.keyTipElements.filemenu&&(t=this.parent.keyTipElements.filemenu,this.createKeyTipElement(t[0].id,t[0].keyTip,"filemenu")),this.parent.keyTipElements.backstage&&(t=this.parent.keyTipElements.backstage,this.createKeyTipElement(t[0].id,t[0].keyTip,"backstage")),this.parent.keyTipElements.collapse&&(t=this.parent.keyTipElements.collapse,this.createKeyTipElement(t[0].id,t[0].keyTip,"collapse")),this.parent.keyTipElements.taboverflow&&(t=this.parent.keyTipElements.taboverflow,this.createKeyTipElement(t[0].id,t[0].keyTip,"taboverflow"))}else if("popupitem"===e){if(this.parent.keyTipElements[this.parent.selectedTab].popupitem)for(var n=this.parent.keyTipElements[this.parent.selectedTab].popupitem,i=0;i<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].popupitem).length;i++)this.createKeyTipElement(n[parseInt(i.toString(),10)].id,n[parseInt(i.toString(),10)].keyTip,"popupitem","left","top",!1,!0)}else if("backstageMenu"===e){if(this.parent.keyTipElements.backstageMenu)for(var o=this.parent.keyTipElements.backstageMenu,i=0;i<Object.keys(this.parent.keyTipElements.backstageMenu).length;i++)this.createKeyTipElement(o[parseInt(i.toString(),10)].id,o[parseInt(i.toString(),10)].keyTip,"backstageMenu","left","center")}else if("grpoverflowpopup"===e&&"Classic"===this.parent.activeLayout){if(this.parent.keyTipElements[this.parent.selectedTab].grpoverflowpopup&&this.calculateItemPosition(e),this.parent.keyTipElements[this.parent.selectedTab].launcher)for(i=0;i<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].launcher).length;i++)t=this.parent.keyTipElements[this.parent.selectedTab].launcher,this.createKeyTipElement(t[parseInt(i.toString(),10)].id,t[parseInt(i.toString(),10)].keyTip,"launcher","center","bottom",!1,!0)}else{if(this.calculateItemPosition(e),"Classic"===this.parent.activeLayout){if(this.parent.keyTipElements[this.parent.selectedTab].launcher)for(i=0;i<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].launcher).length;i++)t=this.parent.keyTipElements[this.parent.selectedTab].launcher,this.createKeyTipElement(t[parseInt(i.toString(),10)].id,t[parseInt(i.toString(),10)].keyTip,"launcher");if(this.parent.keyTipElements[this.parent.selectedTab].grpoverflow)for(i=0;i<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].grpoverflow).length;i++)t=this.parent.keyTipElements[this.parent.selectedTab].grpoverflow,this.createKeyTipElement(t[parseInt(i.toString(),10)].id,t[parseInt(i.toString(),10)].keyTip,"grpoverflow")}if("Simplified"===this.parent.activeLayout&&(this.parent.keyTipElements.overflowbtn&&(t=this.parent.keyTipElements.overflowbtn,this.createKeyTipElement(t[0].id,t[0].keyTip,"overflowbtn")),this.parent.keyTipElements[this.parent.selectedTab].grpofbtn))for(i=0;i<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].grpofbtn).length;i++)t=this.parent.keyTipElements[this.parent.selectedTab].grpofbtn,this.createKeyTipElement(t[parseInt(i.toString(),10)].id,t[parseInt(i.toString(),10)].keyTip,"grpofbtn")}}},rst.prototype.calculateItemPosition=function(e,t,i){void 0===t&&(t=!1);var n,o,r=this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][""+e];if(r)for(var s,a=0;a<Object.keys(this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][""+e]).length;a++)(t&&r[parseInt(a.toString(),10)].keyTip===i||!t)&&(s=r[parseInt(a.toString(),10)].id,-1!==r[parseInt(a.toString(),10)].id.indexOf("_grpbtn")&&(s=r[parseInt(a.toString(),10)].id.replace(/_grpbtn\d+/,"")),(s=Mrt(this.parent.tabs,s))&&"Column"===s.group.orientation&&1<s.collection.items.length&&"Simplified"!==this.parent.activeLayout?o=0===s.itemIndex?(n="center","top"):1===s.itemIndex?n="center":(n="center","bottom"):s&&"Row"===s.group.orientation&&1<s.group.collections.length&&"Simplified"!==this.parent.activeLayout&&(o=0===s.collectionIndex?(n="center","top"):(n="center","bottom")),"item"===e?this.createKeyTipElement(r[parseInt(a.toString(),10)].id,r[parseInt(a.toString(),10)].keyTip,e,n,o):this.createKeyTipElement(r[parseInt(a.toString(),10)].id,r[parseInt(a.toString(),10)].keyTip,e,n,o,!1,!0))},rst.prototype.createKeyTipElement=function(e,t,i,n,o,r,s){void 0===n&&(n="center"),void 0===o&&(o="bottom"),void 0===r&&(r=!1),void 0===s&&(s=!1);var a,l=document.querySelector("#"+e),h=!1;(l=r?document.querySelector("#"+e+trt):l)&&(l.closest(".e-ribbon-group-overflow-ddb")&&(h=!0),r&&s&&l.closest(".e-toolbar-pop")&&(h=!0),l.closest(".e-split-btn-wrapper")?a=l.closest(".e-split-btn-wrapper").closest(".e-ribbon-item").id:l.closest(".e-colorpicker-wrapper")&&(a=(l=l.closest(".e-colorpicker-wrapper")).closest(".e-ribbon-item").id)),(l&&l.offsetParent||r&&s)&&(s&&h||!s)&&(h=this.parent.createElement("div",{className:Wnt,id:e+urt,attrs:{role:"dialog","aria-label":"ribbon-keytip"}}),document.body.append(h),new Sv(h,{relateTo:"#"+(r?e+trt:a||e),content:t,collision:{X:"fit",Y:"flip"},targetType:"relative",position:{X:n,Y:o},enableRtl:this.parent.enableRtl,actionOnScroll:"hide"}).show(),this.calculateKeyTipPosition(l,h,i,o),this.parent.isKeytipOpen=!0)},rst.prototype.calculateKeyTipPosition=function(e,t,i,n){var o=e.getBoundingClientRect();"backstageMenu"===i?(t.style.top=o.top+t.offsetHeight/2+"px",t.style.left=o.left+e.offsetWidth/5+"px"):"popupitem"!==i&&(t.style.left=o.left+(o.width-t.offsetWidth)/2+"px"),"filemenu"===i||"backstage"===i?t.style.top=o.top+(e.offsetHeight-e.offsetHeight/3+t.offsetHeight/6)+"px":"item"===i&&"top"===n&&(t.style.top=o.top-e.offsetHeight/2+"px")},rst.prototype.keytipPress=function(e,t){var i=this;void 0===t&&(t=!1),this.isKeytipPresent=!1;for(var n=0;n<Object.keys(this.parent.keyTipElements).length&&!this.isKeytipPresent;n++)if(this.parent.keyTipElements[parseInt(n.toString(),10)])for(var o=0;o<Object.keys(this.parent.keyTipElements[parseInt(n.toString(),10)]).length&&!this.isKeytipPresent;o++)for(var r,s,a,l=this.parent.keyTipElements[parseInt(n.toString(),10)][Object.keys(this.parent.keyTipElements[parseInt(n.toString(),10)])[parseInt(o.toString(),10)]],h=0;h<Object.keys(l).length&&!this.isKeytipPresent;h++)e.toUpperCase()===l[parseInt(h.toString(),10)].keyTip&&(document.querySelector("#"+l[parseInt(h.toString(),10)].id+urt)||t)&&(this.isKeytipPresent=!0,this.removeKeytip(),"tab"===l[parseInt(h.toString(),10)].type?n!==this.parent.selectedTab?(this.parent.tabObj.select(n),setTimeout(function(){var e=i.parent.tabObj.element.querySelector(".e-nav-active");e&&e.click(),i.createKeytip("item")},600)):this.createKeytip("item"):"item"===l[parseInt(h.toString(),10)].type||"grpoverflowpopup"===l[parseInt(h.toString(),10)].type||"popupitem"===l[parseInt(h.toString(),10)].type?document.getElementById(l[parseInt(h.toString(),10)].id)&&document.getElementById(l[parseInt(h.toString(),10)].id).classList.contains("e-ribbon-group-button")?document.getElementById(l[parseInt(h.toString(),10)].id).click():(a=void 0,a=-1!==l[parseInt(h.toString(),10)].id.indexOf("_popupButton")?(r=l[parseInt(h.toString(),10)].id.replace(/_popupButton/g,""),Mrt(this.parent.tabs,r)):Mrt(this.parent.tabs,l[parseInt(h.toString(),10)].id),t&&a.tabIndex!==this.parent.selectedTab||this.clickItems(a,l,h,!1,t)):"grpoverflow"!==l[parseInt(h.toString(),10)].type&&"grpofbtn"!==l[parseInt(h.toString(),10)].type&&"launcher"!==l[parseInt(h.toString(),10)].type||(r=document.querySelector("#"+l[parseInt(h.toString(),10)].id),this.removeKeytip(),r&&(s=l[parseInt(h.toString(),10)].id,t?-1===l[parseInt(h.toString(),10)].id.indexOf("_launcher")&&-1===l[parseInt(h.toString(),10)].id.indexOf("_sim_grp_overflow")&&-1===l[parseInt(h.toString(),10)].id.indexOf("_overflow_dropdown")||(s=l[parseInt(h.toString(),10)].id.replace(/_launcher|_sim_grp_overflow|_overflow_dropdown/g,""),(a=Prt(this.parent.tabs,s)).tabIndex===this.parent.selectedTab&&this.clickItems(a,l,h,!0,t,r)):this.clickItems(null,l,h,!0,t,r))));else this.parent.keyTipElements&&this.commonItemsKeyTipPress(e,Object.keys(this.parent.keyTipElements)[parseInt(n.toString(),10)],t)},rst.prototype.clickItems=function(e,t,i,n,o,r){if(n)r.click(),"launcher"!==t[parseInt(i.toString(),10)].type&&(this.isKeytipPopupOpen=!0,"grpoverflow"===t[parseInt(i.toString(),10)].type?this.createKeytip("grpoverflowpopup"):this.createKeytip("popupitem"));else{var s=t[parseInt(i.toString(),10)].id;switch(document.querySelector("#"+s)&&o&&("Simplified"===this.parent.activeLayout?document.querySelector("#"+s).closest("#"+e.group.id+"_sim_grp_overflow-popup")&&document.querySelector("#"+s).closest("#"+e.group.id+"_sim_grp_overflow-popup").classList.contains("e-popup-close")?document.querySelector("#"+e.group.id+"_sim_grp_overflow").click():document.querySelector("#"+s).closest("#"+this.parent.tabObj.element.id+$ot+"-popup")&&document.querySelector("#"+s).closest("#"+this.parent.tabObj.element.id+$ot+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+this.parent.tabObj.element.id+$ot).click():document.querySelector("#"+s).closest("#"+e.group.id+rrt+srt+"-popup")&&document.querySelector("#"+s).closest("#"+e.group.id+rrt+srt+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+e.group.id+rrt+srt).click()),this.parent.getItemModuleName(e.item)){case"btn":this.parent.ribbonButtonModule.click(s);break;case"dropdown-btn":this.parent.ribbonDropDownModule.toggle(s);break;case"split-btn":this.parent.ribbonSplitButtonModule.toggle(s);break;case"checkbox":this.parent.ribbonCheckBoxModule.click(s);break;case"colorpicker":this.parent.ribbonColorPickerModule.toggle(s);break;case"combobox":var a=document.querySelector("#"+s);this.isInteractableElement(a)&&setTimeout(function(){a.focus()},100);break;case"gallery":var l=document.querySelector("#"+s);this.isInteractableElement(l)&&l.click();break;case"template":l=document.querySelector("#"+s);this.isInteractableElement(l)&&l.focus();break;case"group-btn":l=document.querySelector("#"+s);if(this.isInteractableElement(l)){K(l,u2).toggle();for(var h=0;h<e.item.groupButtonSettings.items.length;h++)e.item.groupButtonSettings.items[parseInt(h.toString(),10)].keyTip&&this.createKeyTipElement(s+crt+h,e.item.groupButtonSettings.items[parseInt(h.toString(),10)].keyTip,"item")}}}},rst.prototype.isInteractableElement=function(e){return e&&!e.closest(".e-ribbon-item").classList.contains("e-disabled")},rst.prototype.commonItemsKeyTipPress=function(e,t,i){var n=this;if(this.parent.keyTipElements[""+t]){var o=!1,r=this.parent.keyTipElements[""+t],s=void 0;if(r)if("backstageMenu"===t){for(var a=0;a<Object.keys(this.parent.keyTipElements[""+t]).length;a++)if(r[parseInt(a.toString(),10)].keyTip===e.toUpperCase()&&(s=document.querySelector("#"+r[parseInt(a.toString(),10)].id),document.querySelector("#"+s.id+urt)||i)){o=!0,i&&document.querySelector(".e-ribbon-backstage-popup").classList.contains("e-popup-close")&&this.parent.tabObj.element.querySelector(".e-ribbon-backstage").click();break}}else r[0]&&r[0].keyTip===e.toUpperCase()&&(s=document.querySelector("#"+r[0].id),document.querySelector("#"+r[0].id+urt)||i)&&(o=!0);o&&(this.removeKeytip(),this.isKeytipPresent=!0,s)&&(s.click(),"backstage"===t?this.createKeytip("backstageMenu"):"overflowbtn"===t?(this.isKeytipPopupOpen=!0,this.createKeytip("popupitem")):"taboverflow"===t&&setTimeout(function(){for(var e,t=0;t<Object.keys(n.parent.keyTipElements).length;t++)n.parent.keyTipElements[parseInt(t.toString(),10)]&&(e=n.parent.keyTipElements[parseInt(t.toString(),10)].tab,n.createKeyTipElement(e[0].id,e[0].keyTip,"tab","center","bottom",!0,!0))},600))}},rst.prototype.removeKeytip=function(s){for(var a=this,l=document.querySelectorAll(".e-ribbon-keytip"),h=!1,d=(this.parent.keysPress="",this),e=0;e<l.length;e++)!function(t){var e=l[parseInt(t.toString(),10)];if("Escape"===s&&d.parent.keyTipElements&&d.parent.keyTipElements[d.parent.selectedTab]){for(var i=0;i<Object.keys(d.parent.keyTipElements[d.parent.selectedTab]).length;i++){var n=Object.keys(d.parent.keyTipElements[parseInt(d.parent.selectedTab.toString(),10)])[parseInt(i.toString(),10)];if(-1!==Ert(d.parent.keyTipElements[parseInt(d.parent.selectedTab.toString(),10)][""+n],function(e){return e.id+urt===l[parseInt(t.toString(),10)].id})){if("item"===n&&!d.isKeytipPopupOpen||"grpoverflow"===n&&"Classic"===d.parent.activeLayout){d.createKeytip("tab"),h=!(s="");break}if(d.isKeytipPopupOpen&&("popupitem"===n&&"Simplified"===d.parent.activeLayout||"grpoverflowpopup"===n&&"Classic"===d.parent.activeLayout)){d.createKeytip("item"),h=!(s="");break}}}for(var o=0;o<Object.keys(d.parent.keyTipElements).length;o++)if(d.parent.keyTipElements[parseInt(o.toString(),10)]){for(var r=d.parent.keyTipElements[parseInt(o.toString(),10)].tab,i=0;i<Object.keys(r).length;i++)if(e.id===r[0].id+urt&&document.querySelector("#"+r[0].id+trt).closest(".e-toolbar-pop")){d.parent.tabObj.element.querySelector(".e-nav-active").click(),setTimeout(function(){a.createKeytip("tab")},600),h=!(s="");break}if(h)break}!h&&d.parent.keyTipElements.backstageMenu&&-1!==Ert(d.parent.keyTipElements.backstageMenu,function(e){return e.id+urt===l[parseInt(t.toString(),10)].id})&&(d.createKeytip("tab"),h=!(s=""))}e&&ue(e)}(e);this.isKeytipPopupOpen=!1,h||(this.parent.isKeytipOpen=!1)},rst.prototype.showKeyTips=function(e){this.parent.enableKeyTips&&(e?this.keytipPress(e,!0):this.createKeytip("tab"))},rst.prototype.hideKeyTips=function(){this.removeKeytip()};var ost=rst;function rst(e){this.isKeytipPopupOpen=!1,this.parent=e}Yrt.Inject(frt,Art,Irt,vrt,set,Crt,jrt,Krt,est,ost,ist,L$e);var sst,ast,Yrt=Object.freeze({__proto__:null,Ribbon:Yrt,get RibbonLayout(){return fit},get ItemOrientation(){return yit},get RibbonItemSize(){return vit},get DisplayMode(){return bit},get RibbonItemType(){return wit},get RibbonGroupButtonSelection(){return Cit},ITEM_VERTICAL_CENTER:Bnt,EXPAND_COLLAPSE_ICON:Fnt,BACKSTAGE_CLOSE_ICON:Lnt,OVERFLOW_ICON:Rnt,VERTICAL_DDB:Ont,DISABLED_CSS:Nnt,RTL_CSS:Vnt,RIBBON_HOVER:_nt,RIBBON_CONTROL:Hnt,RIBBON_POPUP_CONTROL:znt,RIBBON_POPUP_OPEN:jnt,RIBBON_KEYTIP:Wnt,SPACE:" ",HORIZONTAL_SCROLLBAR:Qnt,HIDE_CSS:Unt,RIBBON_TAB:qnt,RIBBON_CONTEXTUAL_TAB:Gnt,RIBBON_TAB_ACTIVE:Ynt,RIBBON_TAB_ITEM:Xnt,RIBBON_COLLAPSE_BUTTON:Knt,RIBBON_EXPAND_BUTTON:Jnt,RIBBON_COLLAPSIBLE:Znt,RIBBON_OVERALL_OF_BUTTON:$nt,RIBBON_GROUP_OF_BUTTON:eot,RIBBON_OVERFLOW_TARGET:tot,RIBBON_OVERFLOW:iot,TAB_CONTENT:not,RIBBON_MINIMIZE:oot,RIBBON_GROUP:rot,RIBBON_SINGLE_BUTTON_SELECTION:sot,RIBBON_MULTIPLE_BUTTON_SELECTION:aot,RIBBON_GROUP_BUTTON:lot,RIBBON_GROUP_BUTTON_OVERFLOW_POPUP:hot,RIBBON_GROUP_BUTTON_CONTENT:dot,RIBBON_GROUP_CONTAINER:pot,RIBBON_OF_TAB_CONTAINER:cot,RIBBON_OF_GROUP_CONTAINER:uot,RIBBON_GROUP_CONTENT:got,RIBBON_GROUP_HEADER:mot,RIBBON_OVERFLOW_HEADER:fot,RIBBON_GROUP_OVERFLOW:yot,RIBBON_GROUP_OVERFLOW_DDB:vot,RIBBON_LAUNCHER:bot,RIBBON_LAUNCHER_ICON_ELE:wot,RIBBON_LAUNCHER_ICON:Cot,RIBBON_COLLECTION:Sot,RIBBON_ITEM:Aot,RIBBON_ROW:xot,RIBBON_COLUMN:Iot,RIBBON_LARGE_ITEM:Tot,RIBBON_MEDIUM_ITEM:Eot,RIBBON_SMALL_ITEM:Dot,RIBBON_CONTENT_HEIGHT:Mot,DROPDOWNBUTTON:"e-dropdown-btn",DROPDOWNBUTTON_HIDE:kot,RIBBON_TEMPLATE:Pot,RIBBON_HELP_TEMPLATE:Bot,RIBBON_TOOLTIP:Fot,RIBBON_TOOLTIP_TARGET:Lot,RIBBON_TOOLTIP_TITLE:Rot,RIBBON_TOOLTIP_CONTENT:Oot,RIBBON_TOOLTIP_ICON:Not,RIBBON_TOOLTIP_CONTAINER:Vot,RIBBON_TEXT_CONTAINER:_ot,RIBBON_SIMPLIFIED_MODE:Hot,RIBBON_BACKSTAGE_POPUP:zot,RIBBON_BACKSTAGE_OPEN:jot,RIBBON_BACKSTAGE_CONTENT:Wot,RIBBON_SELECTED_CONTENT:"e-ribbon-selected-content",RIBBON_BACKSTAGE:Qot,RIBBON_BACKSTAGE_MENU:Uot,RIBBON_BACKSTAGE_TEMPLATE:qot,RIBBON_BACKSTAGE_MENU_WRAPPER:Got,RIBBON_BACKSTAGE_ITEMS_WRAPPER:Yot,RIBBON_BACKSTAGE_TEXT_MENU:Xot,TAB_ID:Kot,GROUP_ID:"_group",COLLECTION_ID:Jot,ITEM_ID:"_item",COLLAPSE_BUTTON_ID:Zot,OVRLOF_BUTTON_ID:$ot,GROUPOF_BUTTON_ID:ert,HEADER_ID:trt,LAUNCHER_ID:irt,CONTENT_ID:nrt,CONTAINER_ID:ort,OVERFLOW_ID:rrt,DROPDOWN_ID:srt,RIBBON_FILE_MENU_ID:"_filemenu",RIBBON_BACKSTAGE_MENU_ID:art,RIBBON_BACKSTAGE_POPUP_ID:lrt,RIBBON_FILE_MENU_LIST:hrt,RIBBON_MENU_LIST:"_menulist",RIBBON_FOOTER_MENU_LIST:drt,RIBBON_HELP_PANE_TEMPLATE_ID:prt,RIBBON_GROUP_BUTTON_ID:crt,RIBBON_KEYTIP_ID:urt,RIBBON_FILE_MENU_WIDTH:grt,RIBBON_HELP_PANE_TEMPLATE_WIDTH:mrt,getIndex:Ert,getTemplateFunction:Drt,getItem:Mrt,getCollection:krt,getGroup:Prt,destroyControl:Brt,updateCommonProperty:Frt,updateControlDisabled:Lrt,getItemElement:Rrt,isTooltipPresent:Ort,setToolTipContent:Nrt,createTooltip:Vrt,destroyTooltip:_rt,updateTooltipProp:Hrt,setCustomAttributes:zrt,RibbonTab:jee,RibbonGroup:Xet,RibbonCollection:det,RibbonItem:q$e,RibbonButtonSettings:W$e,RibbonCheckBoxSettings:Det,RibbonColorPickerSettings:h,RibbonComboBoxSettings:wce,RibbonDropDownSettings:fJ,RibbonSplitButtonSettings:tte,FileMenuSettings:pJ,BackStageMenu:d$,BackstageBackButton:X$e,BackstageItem:Vee,RibbonTooltip:Z$e,RibbonGroupButtonSettings:Wo,RibbonGroupButtonItem:Met,RibbonContextualTabSettings:Cet,RibbonGalleryGroup:P$e,RibbonGalleryItem:N$e,RibbonGallerySettings:H$e,RibbonButton:frt,RibbonCheckBox:vrt,RibbonColorPicker:set,RibbonComboBox:Crt,RibbonDropDown:Art,RibbonSplitButton:Irt,RibbonGroupButton:jrt,RibbonGallery:L$e,RibbonFileMenu:Krt,RibbonBackstage:est,RibbonContextualTab:ist,RibbonKeyTip:ost}),jee=(sst=function(e,t){return(sst=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])}))(e,t)},function(e,t){function i(){this.constructor=e}sst(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),lst=function(){return(lst=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Xet=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},det=(jee(hst,ast=n),Xet([e(null)],hst.prototype,"field",void 0),Xet([e(null)],hst.prototype,"label",void 0),Xet([e(null)],hst.prototype,"type",void 0),Xet([e(null)],hst.prototype,"values",void 0),Xet([e(null)],hst.prototype,"operators",void 0),Xet([e()],hst.prototype,"ruleTemplate",void 0),Xet([e(null)],hst.prototype,"template",void 0),Xet([e({isRequired:!0,min:0,max:Number.MAX_VALUE})],hst.prototype,"validation",void 0),Xet([e(null)],hst.prototype,"format",void 0),Xet([e(null)],hst.prototype,"step",void 0),Xet([e(null)],hst.prototype,"value",void 0),Xet([e(null)],hst.prototype,"category",void 0),Xet([e(null)],hst.prototype,"columns",void 0),hst);function hst(){return null!==ast&&ast.apply(this,arguments)||this}jee(pst,dst=n),Xet([e(null)],pst.prototype,"condition",void 0),Xet([kt([],pst)],pst.prototype,"rules",void 0),Xet([e(null)],pst.prototype,"field",void 0),Xet([e(null)],pst.prototype,"label",void 0),Xet([e(null)],pst.prototype,"type",void 0),Xet([e(null)],pst.prototype,"operator",void 0),Xet([e(null)],pst.prototype,"value",void 0),Xet([e(!1)],pst.prototype,"not",void 0),Xet([e(null)],pst.prototype,"isLocked",void 0);var dst,q$e=pst;function pst(){return null!==dst&&dst.apply(this,arguments)||this}jee(ust,cst=n),Xet([e(null)],ust.prototype,"numericTextBoxModel",void 0),Xet([e(null)],ust.prototype,"multiSelectModel",void 0),Xet([e(null)],ust.prototype,"datePickerModel",void 0),Xet([e(null)],ust.prototype,"textBoxModel",void 0),Xet([e(null)],ust.prototype,"radioButtonModel",void 0);var cst,W$e=ust;function ust(){return null!==cst&&cst.apply(this,arguments)||this}jee(mst,gst=n),Xet([e(!1)],mst.prototype,"cloneRule",void 0),Xet([e(!1)],mst.prototype,"cloneGroup",void 0),Xet([e(!1)],mst.prototype,"lockRule",void 0),Xet([e(!1)],mst.prototype,"lockGroup",void 0),Xet([e(!0)],mst.prototype,"ruleDelete",void 0),Xet([e(!0)],mst.prototype,"groupInsert",void 0),Xet([e(!0)],mst.prototype,"groupDelete",void 0);var gst,Det=mst;function mst(){return null!==gst&&gst.apply(this,arguments)||this}jee(yst,fst=Ji),yst.prototype.getPersistData=function(){return this.addOnPersist(["rule"])},yst.prototype.reset=function(){this.isImportRules=!1;for(var e,t,i,n=this.element.querySelector(".e-group-body"),o=this.element.querySelectorAll("input.e-control"),r=0,s=o.length;r<s;r++)-1<o[r].className.indexOf("e-tooltip")?At(o[r],"tooltip").destroy():-1<o[r].parentElement.className.indexOf("e-tooltip")&&At(o[r].parentElement,"tooltip").destroy();n?n.innerHTML="":(e=this.createElement("div",{attrs:{class:"e-group-container"}}),t=this.createElement("div",{attrs:{class:"e-group-header"}}),i=this.createElement("div",{attrs:{class:"e-group-body"}}),e.appendChild(t).appendChild(i),this.element.appendChild(e),n=this.element.querySelector(".e-group-body")),this.headerTemplate&&this.isRoot&&(this.element.innerHTML="",this.isRoot=!1),this.enableNotCondition&&q(this.element.querySelectorAll(".e-qb-toggle"),"e-active-toggle"),n.appendChild(this.createElement("div",{attrs:{class:"e-rule-list"}})),this.levelColl[this.element.id+"_group0"]=[0],this.setProperties({rule:{condition:"and",not:!1,rules:[]}},!0),this.disableRuleCondition(n.parentElement)},yst.prototype.getWrapper=function(){return this.element},yst.prototype.getModuleName=function(){return"query-builder"},yst.prototype.requiredModules=function(){var e=[];return e.push({member:"query-library",args:[this]}),e},yst.prototype.GetRootColumnName=function(e){return this.separator?e.split(this.separator)[0]:e},yst.prototype.initialize=function(){if(this.dataColl.length){var e=Object.keys(this.dataColl[0]),t=[],i=[],n=void 0,o=!1,r=!1,s=void 0,a={isRequired:!0,min:0,max:Number.MAX_VALUE};if(this.columns.length){this.columnSort();for(var l=0,h=(d=this.columns).length;l<h;l++)this.updateCustomOperator(d[l],"initial"),d[l].type||(-1<e.indexOf(d[l].field)&&("string"===(n=typeof(s=this.dataColl[0][d[l].field]))?r=!isNaN(Date.parse(s)):"object"===n&&(r=s instanceof Date&&!isNaN(s.getTime()),n="string"),d[l].type=n,r=!1),n="string"),d[l].validation||(d[l].validation=a),d[l].category?o=!0:d[l].category=this.l10n.getConstant("OtherFields"),i.indexOf(d[l].category)<0&&i.push(d[l].category),(!d[l].operators||this.isLocale&&-1===this.isCustomOprCols.indexOf(d[l].field))&&(d[l].operators=this.customOperators[d[l].type+"Operator"]);o&&(1<i.length||i[0]!==this.l10n.getConstant("OtherFields"))&&(this.fields={text:"label",value:"field",groupBy:"category"}),this.updateSubFieldsFromColumns(this.columns)}else{for(l=0,h=e.length;l<h;l++)"string"===(n=typeof(s=this.dataColl[0][e[l]]))?r=!isNaN(Date.parse(s)):"object"!==n||Object.keys(s).length||(r=s instanceof Date&&!isNaN(s.getTime()),n="string"),r=!(t[l]={field:e[l],label:e[l],type:r?"date":n,validation:a}),t[l].operators=this.customOperators[t[l].type+"Operator"],"object"===n&&this.updateSubFields(s,t[l]);this.columns=t}}else if(this.columns&&this.columns.length){for(var d,l=0,h=(d=this.columns).length;l<h;l++)d[l].category?this.fields={text:"label",value:"field",groupBy:"category"}:d[l].category=this.l10n.getConstant("OtherFields"),this.updateCustomOperator(d[l],"initial"),(!d[l].operators||this.isLocale&&-1===this.isCustomOprCols.indexOf(d[l].field))&&(d[l].operators=this.customOperators[d[l].type+"Operator"]);this.updateSubFieldsFromColumns(this.columns)}this.trigger("dataBound",{type:"dataBound"})},yst.prototype.updateSubFieldsFromColumns=function(e,t){for(var i=0;i<e.length;i++)""!==this.separator&&e[i].field.indexOf(this.separator)<0&&(e[i].field=t?t+this.separator+e[i].field:e[i].field),e[i].operators?this.updateCustomOperator(e[i]):e[i].type&&"object"!==e[i].type&&(e[i].operators=this.customOperators[e[i].type+"Operator"]),e[i].columns&&(e[i].type="object",this.updateSubFieldsFromColumns(e[i].columns,e[i].field))},yst.prototype.updateSubFields=function(e,t,i){t.columns=[];var n=Object.keys(e);i=i||this.dataColl[0];for(var o=0,r=n.length;o<r;o++){var s,a=t.field.split("."),a=(i?i[a[a.length-1]]:this.dataColl[0][t.field])[n[o]],l=i[t.field.split(this.separator)[t.field.split(this.separator).length-1]],h={field:t.field+this.separator+n[o],label:n[o],type:s="object"!=(s=typeof a)||isNaN(Date.parse(a))?s:"date"};"object"!=s&&(h.operators=this.customOperators[s+"Operator"]),t.columns.push(h),"object"==s&&this.updateSubFields(a,h,l)}},yst.prototype.updateCustomOperator=function(o,e){if(o.operators){this.isLocale||"initial"!==e||je(this.isCustomOprCols)||this.isCustomOprCols.push(o.field);for(var r=this,t=0;t<o.operators.length;t++)!function(e){var t,i,n=Object.keys(o.operators[e]).indexOf("sqlOperator");-1<n&&(t=o.operators[e],i=(e=Object.keys(t)).map(function(e){return t[""+e]}).join(",").split(","),e=e.indexOf("value"),r.operators[i[e]]=i[n])}(t)}},yst.prototype.focusEventHandler=function(e){this.target=e.target},yst.prototype.clickEventHandler=function(e){var t,i,n,o,r=this,s=e.target;if(this.isImportRules=!1,"string"==typeof(s="SPAN"===s.tagName?s.parentElement:s).className&&-1<s.className.indexOf("e-collapse-rule")&&(h=new Vt({duration:1e3,delay:0}),this.element.querySelectorAll(".e-summary-content").length<1&&this.renderSummary(),o=(e=document.getElementById(this.element.id+"_summary_content")).querySelector(".e-summary-text"),h.animate(".e-query-builder",{name:"SlideLeftIn"}),(l=this.element.querySelector(".e-group-container")).style.display="none",o.textContent=this.getSqlFromRules(this.rule),e.style.display="block",o.style.height=o.scrollHeight+"px"),"BUTTON"===s.tagName&&"string"==typeof s.className&&s.className.indexOf("e-qb-toggle")<0){var a,l,h=new Vt({duration:1e3,delay:0});switch(!0){case-1<s.className.indexOf("e-removerule"):this.actionButton=s,this.deleteRule(s);break;case-1<s.className.indexOf("e-clone-rule-btn"):this.actionButton=s,this.cloneRuleBtnClick=!0,this.ruleClone(s);break;case-1<s.className.indexOf("e-lock-rule-btn"):this.actionButton=s,this.ruleLock(s);break;case-1<s.className.indexOf("e-lock-grp-btn"):this.actionButton=s,this.groupLock(s);break;case-1<s.className.indexOf("e-clone-grp-btn"):this.actionButton=s,this.cloneGrpBtnClick=!0,this.groupClone(z(s,".e-group-container"));break;case-1<s.className.indexOf("e-deletegroup"):this.actionButton=s,this.deleteGroup(z(s,".e-group-container"));break;case-1<s.className.indexOf("e-edit-rule"):h.animate(".e-query-builder",{name:"SlideLeftIn"}),document.getElementById(this.element.id+"_summary_content").style.display="none",this.element.querySelectorAll(".e-group-container").length<1?(this.addGroupElement(!1,this.element,this.rule.condition,!1,this.rule.not),a=Pe({},this.rule,{},!0),this.setGroupRules(a),this.renderSummaryCollapse()):((l=this.element.querySelector(".e-group-container")).querySelectorAll(".e-collapse-rule").length<1&&this.renderSummaryCollapse(),l.style.display="block")}}else("LABEL"===s.tagName&&-1<s.parentElement.className.indexOf("e-btn-group")||"string"==typeof s.className&&-1<s.className.indexOf("e-qb-toggle"))&&(e=z(s,".e-group-container"),this.headerTemplate||(o=void 0,(t=s.getAttribute("for"))?o=document.getElementById(t).getAttribute("value"):this.enableSeparateConnector&&(o=s.textContent),t=e.id.replace(this.element.id+"_",""),i=this.getGroup(t),n=void 0,this.enableNotCondition&&(-1<s.className.indexOf("e-qb-toggle")?(n=-1<(e=e.getElementsByClassName("e-qb-toggle")[0]).className.indexOf("e-active-toggle")?(q([e],"e-active-toggle"),!1):(U([e],"e-active-toggle"),!0),o=i.condition):n=i.not),i={groupID:t,cancel:!1,type:"condition",value:o.toLowerCase()},this.enableNotCondition&&(i={groupID:t,cancel:!1,type:"condition",value:o.toLowerCase(),not:n})),this.isImportRules?this.beforeSuccessCallBack(i,s):this.trigger("beforeChange",i,function(e){r.beforeSuccessCallBack(e,s)}),this.target=s)},yst.prototype.beforeSuccessCallBack=function(e,t){var i,n,o,r,s;e&&!e.cancel&&(i=(r=z(t,".e-group-container")).id.replace(this.element.id+"_",""),n=this.getValidRules(this.rule),o=this.getParentGroup(r),this.enableSeparateConnector?(s=(r=je(z(t,".e-rule-container"))&&r.classList.contains("e-group-container")?null!==t.parentElement.previousElementSibling?t.parentElement.previousElementSibling:r:z(t,".e-rule-container")).id.replace(this.element.id+"_",""),r.classList.contains("e-rule-container")?(o=this.getRule(r)).condition=e.value:r.classList.contains("e-group-container")&&((o=this.getGroup(r)).condition=e.value),this.enableNotCondition&&(o.not=e.not),this.isImportRules||this.trigger("change",{groupID:i,ruleID:s,type:"condition",value:o.condition})):(o.condition=e.value,this.enableNotCondition&&(o.not=e.not),this.isImportRules||this.trigger("change",{groupID:i,type:"condition",value:o.condition})),this.filterRules(n,this.getValidRules(this.rule),"condition"),this.enableSeparateConnector)&&(r=t.parentElement.querySelector(".e-btngroup-and"),s=t.parentElement.querySelector(".e-btngroup-or"),r)&&s&&("and"===e.value?(r.checked=!0,s.checked=!1):"or"===e.value&&(s.checked=!0,r.checked=!1))},yst.prototype.selectBtn=function(e,t){"beforeOpen"===t.name?this.showButtons.groupInsert||je(this.showButtons.groupInsert)?((this.element.querySelectorAll(".e-group-container").length>=this.maxGroupCount+1?U:q)([t.element.querySelector("li span.e-addgroup").parentElement],"e-button-hide"),this.enableRtl&&U([t.element.querySelector("li").parentElement],"e-rtl")):U([t.element.querySelector("li span.e-addgroup").parentElement],"e-button-hide"):-1<t.element.children[0].className.indexOf("e-addrule")?this.addRuleElement(z(e,".e-group-container"),{}):-1<t.element.children[0].className.indexOf("e-addgroup")&&this.addGroupElement(!0,z(e,".e-group-container"),"",!0)},yst.prototype.appendRuleElem=function(e,t,i,n,o,r){var s,a,l=e.querySelector(".e-rule-list");if("change"===i)s=ge("#"+n,e);else{if((s=this.createElement("div",{attrs:{class:"e-rule-container"}})).setAttribute("id",e.id+"_rule"+this.ruleIdCounter),this.showButtons.cloneRule&&this.cloneRuleBtnClick){if(this.ruleIndex<0)l.appendChild(s);else if(this.enableSeparateConnector){for(var h=-1,d=this.ruleIndex+1,p=0;p<d&&p!==l.children.length;p++)l.children[p].classList.contains("e-rule-container")&&(d++,h++);l.insertBefore(s,l.children[this.ruleIndex+h+1])}else l.insertBefore(s,l.children[this.ruleIndex+1]);this.cloneRuleBtnClick=!1}else l.appendChild(s);this.ruleIdCounter++}return t&&t.ruleTemplate&&r?(i={requestType:"template-initialize",ruleID:s.id,action:o,fields:this.fields,rule:r},this.trigger("actionBegin",i),this.ruleTemplateFn=this.templateParser(t.ruleTemplate),n=this.element.id+t.field,i.fields=this.fields,i.columns=this.columns,""===r.field&&(r.field=t.field),i.operators=this.getOperators(r.field),i.operatorFields={text:"key",value:"value"},this.isReact?((a=this.ruleTemplateFn(i,this,s.id,n)[0]).className+=" e-rule-field",s.appendChild(a)):this.isAngular?((a=3===(e=this.ruleTemplateFn(i,this,s.id,n))[0].nodeType?e[1]:e[0]).className+=" e-rule-field",s.appendChild(a)):this.isVue3?(ht(a=this.ruleTemplateFn(i,this,"Template",n),s),s.children.length&&(s.children[s.children.length-1].className+=" e-rule-field")):((a=this.ruleTemplateFn(i,this,"Template",n)[0]).className+=" e-rule-field",s.appendChild(a))):(a=this.ruleElem.querySelector(".e-rule-field").cloneNode(!0),s.appendChild(a)),this.showButtons.lockGroup&&q(s.querySelectorAll(".e-lock-grp-btn"),"e-button-hide"),this.showButtons.lockRule&&q(s.querySelectorAll(".e-lock-rule-btn"),"e-button-hide"),this.showButtons.cloneGroup&&q(s.querySelectorAll(".e-clone-grp-btn"),"e-button-hide"),this.showButtons.cloneRule&&q(s.querySelectorAll(".e-clone-rule-btn"),"e-button-hide"),this.showButtons.ruleDelete&&q(s.querySelectorAll(".e-lock-grp-btn"),"e-button-hide"),this.allowDragAndDrop&&q(s.querySelectorAll(".e-drag-qb-rule"),"e-hidden"),t&&t.ruleTemplate&&r&&this.renderReactTemplates(),s},yst.prototype.addRuleElement=function(t,i,n,o,r,s){var e,a=this;t&&(e={groupID:t.id.replace(this.element.id+"_",""),cancel:!1,type:"insertRule"},this.isImportRules||this.isInitialLoad||this.prvtEvtTgrDaD?(this.isInitialLoad=!1,this.addRuleSuccessCallBack(e,t,i,n,o,r,s)):this.trigger("beforeChange",e,function(e){a.addRuleSuccessCallBack(e,t,i,n,o,r,s)}))},yst.prototype.addRuleSuccessCallBack=function(e,t,i,n,o,r,s){var a,l,h,d,p=-1<this.element.className.indexOf("e-device")?"250px":"200px",n=i&&i.field?this.getColumn(i.field):n||this.columns[0],c={label:"",field:"",type:"",operator:""};if(e.cancel||(n&&n.ruleTemplate&&i.field?(this.selectedColumn=n,e=this.selectedColumn.operators,c={label:n.label,field:n.field,type:n.type,operator:e[0].value},e=Object.keys(i).length?i:c,e={requestType:"template-create",action:"insert-rule",ruleID:(a=this.appendRuleElem(t,n,o,r,"field",e)).id,fields:this.fields,rule:e},this.trigger("actionBegin",e)):((a=this.appendRuleElem(t,n,o,r,"field")).querySelector(".e-filter-input").setAttribute("id",a.id+"_filterkey"),e=a.querySelector(".e-rule-delete"),-1<this.element.className.indexOf("e-device")||"Vertical"===this.displayMode?(e.textContent=this.l10n.getConstant("Remove"),U([e],"e-flat"),U([e],"e-primary")):(U([e],"e-round"),U([e],"e-icon-btn"),e.setAttribute("title",this.l10n.getConstant("DeleteRule")),o=this.createElement("span",{attrs:{class:"e-btn-icon e-icons e-delete-icon"}}),a.querySelector(".e-rule-delete").appendChild(o)),this.showButtons.ruleDelete||e.classList.add("e-button-hide")),"Vertical"===this.displayMode||-1<this.element.className.indexOf("e-device")?a.className="e-rule-container e-vertical-mode":a.className="e-rule-container e-horizontal-mode",o=a.previousElementSibling,this.enableSeparateConnector?(f=g=void 0,(o=o&&o.classList.contains("e-group-container")?(f=o.querySelectorAll(".e-rule-container"))[f.length-1]:o)&&o.classList.contains("e-rule-container")&&(g=this.getRule(o)),this.headerTemplate&&o&&g?this.headerTemplateFn(o,!1,g.condition,g,o.id):je(o)&&a.id!==this.element.id+"_group0_rule0"&&((u=a.closest(".e-group-container"))&&u.previousElementSibling?(e=(m=u.previousElementSibling).querySelectorAll(".e-rule-container"),(m=m.classList.contains("e-group-container")?e[e.length-1]:m).classList.contains("e-rule-container")&&(e=this.getRule(m),this.headerTemplateFn(m,!1,e.condition,e,m.id,!0))):this.headerTemplateFn(a,!1,i.condition,i,a.id,!0))):o&&-1<o.className.indexOf("e-rule-container")&&(a.className.indexOf("e-joined-rule")<0&&(a.className+=" e-joined-rule"),o.className.indexOf("e-prev-joined-rule")<0)&&(o.className+=" e-prev-joined-rule"),o&&-1<o.className.indexOf("e-group-container")&&a.className.indexOf("e-separate-rule")<0&&(a.className+=" e-separate-rule"),this.isImportRules||this.updateAddedRule(t,i,c,s,r,!!this.enableSeparateConnector||null),n&&n.ruleTemplate&&i.field||("Default"===this.fieldMode?(h=l=void 0,h=this.separator&&i.field||this.autoSelectField||this.isImportRules?this.GetRootColumnName(i.field):i.field,l={dataSource:this.columns,fields:this.fields,placeholder:this.l10n.getConstant("SelectField"),popupHeight:5<this.columns.length?p:"auto",close:this.fieldClose.bind(this,a.id+"_filterkey"),change:this.changeField.bind(this),value:i?h:null,open:this.popupOpen.bind(this,!0),cssClass:"qb-dropdownlist"},this.fieldModel&&(l=lst({},l,this.fieldModel)),d=void(e=new qz(l)).appendTo("#"+a.id+"_filterkey"),d=this.separator&&i.field||this.isImportRules?this.GetRootColumnName(i.field):e.value,this.selectedColumn=e.getDataByValue(d),Object.keys(i).length&&this.changeRule(i,{element:e.element,itemData:this.selectedColumn})):(this.isImportRules,h=i.field,this.dummyDropdownTreeDs=Pe([],this.columns,[],!(l=void 0)),this.updateDropdowntreeDS(this.dummyDropdownTreeDs),l={fields:{dataSource:this.dummyDropdownTreeDs,value:"field",text:"label",child:"columns",expanded:"expanded",selectable:"selectable"},placeholder:this.l10n.getConstant("SelectField"),showClearButton:!1,popupHeight:5<this.columns.length?p:"auto",changeOnBlur:!1,change:this.changeField.bind(this),value:je(h)?null:[h],open:this.popupOpen.bind(this,!1),treeSettings:{expandOn:"Click"},cssClass:"e-qb-ddt",filtering:this.dropdownTreeFiltering.bind(this),close:this.dropdownTreeClose.bind(this)},this.fieldModel&&(l=lst({},l,this.fieldModel)),(o=new Z6(l)).appendTo("#"+a.id+"_filterkey"),je(o.value)||(c=this.getLabelFromColumn(o.value[0]),o.element.value=c),d=je(i.field)?o.value:this.GetRootColumnName(i.field),this.selectedColumn=this.getColumn(d),Object.keys(i).length&&this.changeRule(i,{element:o.element,itemData:this.selectedColumn}))),h=a.id.replace(this.element.id+"_",""),i&&i.isLocked&&(s=a.querySelector(".e-lock-rule-btn"),this.ruleLock(s)),this.isImportRules)||this.prvtEvtTgrDaD||this.trigger("change",{groupID:t.id.replace(this.element.id+"_",""),ruleID:h,type:"insertRule"}),this.enableSeparateConnector&&je(i.condition)&&h&&(i=this.getRule(h)),this.enableSeparateConnector){for(var u,g,m=a.previousElementSibling,f=void 0;m&&!m.classList.contains("e-rule-container");){if(m.classList.contains("e-group-container")){m=(f=m.querySelectorAll(".e-rule-container"))[f.length-1];break}m=m.previousElementSibling}this.headerTemplate&&m?(g=this.getRule(m),r={requestType:"rule-template-create",ruleID:m.id,condition:g.condition,notCondition:!!this.enableNotCondition||void 0},this.trigger("actionBegin",r)):je(m)&&a.id!==this.element.id+"_group0_rule0"&&(u=a.closest(".e-group-container"))&&u.previousElementSibling&&u.previousElementSibling.previousElementSibling&&(n=(n=u.previousElementSibling.previousElementSibling).classList.contains("e-group-container")?(e=n.querySelectorAll(".e-rule-container"))[e.length-1]:n).classList.contains("e-rule-container")&&(g=this.getRule(n),p={requestType:"rule-template-create",ruleID:n.id,condition:g.condition,notCondition:!!this.enableNotCondition||void 0},this.trigger("actionBegin",p)),this.setMultiConnector(a)}},yst.prototype.dropdownTreeFiltering=function(t){var i=this,e=this,n=t.event.srcElement,n=(n.classList.contains("e-clear-icon")?n.parentElement.querySelector(".e-textbox"):n).id.split("_filterkey")[0],n=document.getElementById(n),n=(this.ddTree=At(n.querySelector("input.e-dropdowntree"),"dropdowntree"),Pe([],this.columns,[],!0));t.cancel=!0,""===t.text?this.changeDataSource(n):(n=n.map(function(e){return i.nestedChildFilter(t.text,e)}).filter(function(e){return null!==e}),this.changeDataSource(n),setTimeout(function(){je(e.ddTree)||je(e.ddTree.treeObj)||e.ddTree.treeObj.expandAll()},100))},yst.prototype.changeDataSource=function(e){this.updateDropdowntreeDS(e),this.ddTree.treeObj.fields={dataSource:e,value:"field",text:"label",child:"columns",expanded:"expanded"},this.ddTree.treeObj.refresh()},yst.prototype.nestedChildFilter=function(t,e){var i,n=this,o=e[this.ddTree.fields.child];return o?(i=o.map(function(e){return n.nestedChildFilter(t,e)}).filter(function(e){return null!==e})).length?(e[this.ddTree.fields.child]=i,e):(e[this.ddTree.fields.child]=o,this.isMatchedNode(t,e)?e:null):this.isMatchedNode(t,e)?e:null},yst.prototype.isMatchedNode=function(e,t){t=t[this.ddTree.fields.text].toLowerCase();return e=e?e.toLowerCase():"",-1!==t.indexOf(e)},yst.prototype.dropdownTreeClose=function(){this.ddTree&&this.changeDataSource(Pe([],this.columns,[],!0)),this.ddTree=null},yst.prototype.updateDropdowntreeDS=function(e){for(var t=0;t<e.length;t++)"object"===e[parseInt(t.toString(),10)].type?(this.isAngular&&e[parseInt(t.toString(),10)].template&&delete e[parseInt(t.toString(),10)].template,e[parseInt(t.toString(),10)].selectable=!1,this.updateDropdowntreeDS(e[parseInt(t.toString(),10)].columns)):this.isAngular&&e[parseInt(t.toString(),10)].template&&delete e[parseInt(t.toString(),10)].template},yst.prototype.updateAddedRule=function(e,t,i,n,o,r){var s=0;if(n){for(a=ge("#"+o,e),h=z(e,".e-group-container"),d=this.getParentGroup(h);a&&null!==a.previousElementSibling;){var a=a.previousElementSibling,l=this.enableSeparateConnector&&(!this.headerTemplate&&!a.classList.contains("e-btn-group")||this.headerTemplate&&(a.classList.contains("e-rule-container")||a.classList.contains("e-group-container")));this.enableSeparateConnector&&!l||s++}d.rules[s]=t}else{var h=z(e,".e-group-container"),d=this.getParentGroup(h),n=t.custom;Object.keys(t).length?this.ruleIndex<0?(d.rules.push({field:t.field,type:t.type,label:t.label,operator:t.operator,value:t.value}),n&&(d.rules[d.rules.length-1].custom=n),this.enableSeparateConnector&&(d.rules[d.rules.length-1].condition=t.condition||i.condition)):(d.rules.splice(this.ruleIndex+1,0,{field:t.field,type:t.type,label:t.label,operator:t.operator,value:t.value}),n&&(d.rules[this.ruleIndex+1].custom=n),this.enableSeparateConnector&&(d.rules[this.ruleIndex+1].condition=t.condition||i.condition)):(n&&(i.custom=n),this.autoSelectField&&(t.field=i.field=this.rule.rules[0].field),d.rules.push(i))}this.disableRuleCondition(e,d,r)},yst.prototype.changeRuleTemplate=function(e,t){var i,n,o=this.selectedColumn.operators;e.ruleTemplate||(i=z(t,".e-group-container"),n=z(t,".e-rule-container").id,this.previousColumn&&this.previousColumn.ruleTemplate&&(G(t.closest('[id="'+n+'"]').querySelector(".e-rule-field")),this.clearQBTemplate([n])),e&&(t={field:e.field,label:e.label,operator:o[0].value,value:""},this.addRuleElement(i,t,e,"change",n,!0)))},yst.prototype.renderToolTip=function(e){var t=new NS({content:this.l10n.getConstant("ValidationMessage"),isSticky:!0,position:"BottomCenter",cssClass:"e-querybuilder-error",afterClose:function(){t.destroy()},beforeOpen:function(e){e=e.element.querySelector(".e-tooltip-close");e&&(e.style.display="none")}});t.appendTo(e),t.open(e)},yst.prototype.validateFields=function(){var e,t=!0;if(this.allowValidation)for(var i=["isnull","isnotnull","isempty","isnotempty"],n=void 0,o=void 0,r=void 0,s=[],a=void 0,l=void 0,h=void 0,d=void 0,p=this.element.querySelectorAll(".e-rule-container"),n=0,c=p.length;n<c;n++){var u=void 0,g=z(p[n],".e-group-container"),d=this.getParentGroup(g),a=0;if(r=h=p[n],"DropdownTree"===this.fieldMode?(e=At(p[n].querySelector(".e-rule-filter input.e-dropdowntree"),"dropdowntree"))&&e.value&&e.value.length&&(this.selectedColumn=this.getColumn(e.value[0]),u=this.selectedColumn.validation):(l=At(p[n].querySelector(".e-rule-filter input.e-dropdownlist"),"dropdownlist"))&&l.value&&(this.selectedColumn=l.getDataByValue(l.value),u=!je(l.value)&&this.selectedColumn.validation),o=h.querySelector(".e-rule-field input.e-control"),u&&u.isRequired){for(;r&&null!==r.previousElementSibling;){var r=r.previousElementSibling,m=this.enableSeparateConnector&&(!this.headerTemplate&&!r.classList.contains("e-btn-group")||this.headerTemplate&&(r.classList.contains("e-rule-container")||r.classList.contains("e-group-container")));this.enableSeparateConnector&&!m||a++}if(o=h.querySelector(".e-rule-operator .e-control"),d.rules[a].operator||(o.parentElement.className.indexOf("e-tooltip")<0&&o.className.indexOf("e-tooltip")<0&&this.renderToolTip(o.parentElement),t=!1),d.rules[a].value instanceof Array&&(s=d.rules[a].value),i.indexOf(d.rules[a].operator)<-1&&je(d.rules[a].value)&&"date"!==d.rules[a].type||""===d.rules[a].value||null===d.rules[a].value||d.rules[a].value instanceof Array&&s.length<1){var f=h.querySelectorAll(".e-rule-value .e-control");i.indexOf(d.rules[a].operator)<0&&(t=!1);for(var y=0,v=f.length;y<v;y++){var b=f[y],w=void 0;-1<b.parentElement.className.indexOf("e-searcher")?(w=z(b,".e-multi-select-wrapper")).className.indexOf("e-tooltip")<0&&this.renderToolTip(w):f[y].parentElement.className.indexOf("e-tooltip")<0&&f[y].className.indexOf("e-tooltip")<0&&this.renderToolTip(f[y].parentElement),y++}}else if("date"===d.rules[a].type&&(null===d.rules[a].value||-1<d.rules[a].value.indexOf(null))){f=h.querySelectorAll(".e-rule-value .e-control");i.indexOf(d.rules[a].operator)<0&&(t=!1);for(y=0,v=f.length;y<v;y++)f[y].parentElement.className.indexOf("e-tooltip")<0&&f[y].className.indexOf("e-tooltip")<0&&(je(d.rules[a].value)||null==d.rules[a].value[y])&&this.renderToolTip(f[y].parentElement)}}else(l&&l.element&&je(l.value)||e&&e.element&&(je(e.value)||e.value.length<1))&&(o.parentElement.className.indexOf("e-tooltip")<0&&this.renderToolTip(o.parentElement),t=!1)}return t},yst.prototype.refreshLevelColl=function(){this.levelColl={};var e=this.element.querySelector(".e-group-container");e&&(this.levelColl[e.id]=[0],this.refreshLevel({groupElement:e,level:[0]}))},yst.prototype.refreshLevel=function(e){for(var t,i=e.groupElement.querySelector(".e-rule-list").children,n=e.groupElement,o=i.length,r=0,s=0;s<o;s++)-1<(t=i[s]).className.indexOf("e-group-container")&&(e.level.push(r),this.levelColl[t.id]=e.level.slice(),r++,e.groupElement=t,e=this.refreshLevel(e));var a=z(n,".e-rule-list");return e.groupElement=a?z(a,".e-group-container"):n,e.level=this.levelColl[e.groupElement.id].slice(),e},yst.prototype.groupTemplate=function(e){var t,i,n=this.createElement("div",{attrs:{class:"e-group-container"}}),o=this.createElement("div",{attrs:{class:"e-group-header"}}),r=this.createElement("div",{attrs:{class:"e-group-body"}}),s=this.createElement("div",{attrs:{class:"e-rule-list"}});return n.appendChild(o),r.appendChild(s),n.appendChild(r),this.headerTemplate||(s=this.allowDragAndDrop?"e-icons e-drag-qb-rule":"e-icons e-drag-qb-rule e-hidden",r=this.createElement("span",{attrs:{class:s,"aria-lable":"drag handle",title:"drag handle"}}),o.appendChild(r),s=this.enableSeparateConnector&&!e?"e-lib e-btn-group e-qb-toggle-btn":"e-lib e-btn-group",r=this.createElement("div",{attrs:{class:s,role:"group"}}),this.enableSeparateConnector&&r.classList.add("e-multi-connector"),this.enableNotCondition&&(t=this.enableSeparateConnector?this.createElement("input",{attrs:{type:"checkbox",class:"e-qb-toggle"}}):this.createElement("button",{attrs:{type:"button",class:"e-qb-toggle"}}),r.appendChild(t)),t=this.createElement("input",{attrs:{type:"radio",class:"e-btngroup-and",value:"AND"}}),r.appendChild(t),e=this.createElement("label",{attrs:{class:"e-lib e-btn e-btngroup-and-lbl e-small"},innerHTML:this.l10n.getConstant("AND")}),r.appendChild(e),t=this.createElement("input",{attrs:{type:"radio",class:"e-btngroup-or",value:"OR"}}),r.appendChild(t),e=this.createElement("label",{attrs:{class:"e-lib e-btn e-btngroup-or-lbl e-small"},innerHTML:this.l10n.getConstant("OR")}),r.appendChild(e),o.appendChild(r),s=this.createElement("div",{attrs:{class:"e-group-action"}}),i=this.enableSeparateConnector?(i=this.createElement("button",{attrs:{type:"button",class:"e-add-condition-btn"}}),s.appendChild(i),this.createElement("button",{attrs:{type:"button",class:"e-add-group-btn"}})):this.createElement("button",{attrs:{type:"button",class:"e-add-btn"}}),s.appendChild(i),o.appendChild(s)),n},yst.prototype.ruleTemplate=function(){var e=this.createElement("div"),t=this.createElement("div",{attrs:{class:"e-rule-field"}}),i=this.createElement("div",{attrs:{class:"e-rule-filter"}}),n=this.allowDragAndDrop?"e-icons e-drag-qb-rule":"e-icons e-drag-qb-rule e-hidden",n=this.createElement("span",{attrs:{class:n,"aria-lable":"drag handle",title:"drag handle"}}),n=(t.appendChild(n),this.createElement("input",{attrs:{type:"text",class:"e-filter-input"}})),n=(i.appendChild(n),t.appendChild(i),i=this.createElement("div",{attrs:{class:"e-rule-operator"}}),t.appendChild(i),i=this.createElement("div",{attrs:{class:"e-rule-value"}}),t.appendChild(i),i=this.createElement("div",{attrs:{class:"e-rule-value-delete"}}),n=this.showButtons.cloneRule?"e-clone-rule-btn e-clone-rule e-css e-btn e-small e-round e-icon-btn":"e-clone-rule-btn e-clone-rule e-css e-btn e-small e-round e-icon-btn e-button-hide",r=this.showButtons.lockRule?"e-lock-rule-btn e-lock-rule e-css e-btn e-small e-round e-icons e-icon-btn":"e-lock-rule-btn e-lock-rule e-css e-btn e-small e-round e-icons e-icon-btn e-button-hide",this.createElement("button",{attrs:{title:this.l10n.getConstant("CloneRule"),type:"button",class:n}})),o=this.createElement("span",{attrs:{class:"e-btn-icon e-icons e-copy"}}),r=(n.appendChild(o),this.createElement("button",{attrs:{title:this.l10n.getConstant("LockRule"),type:"button",class:r}})),o=this.createElement("span",{attrs:{class:"e-btn-icon e-icons e-unlock"}}),o=(r.appendChild(o),this.showButtons.ruleDelete||je(this.showButtons.ruleDelete)?"e-removerule e-rule-delete e-css e-btn e-small":"e-removerule e-rule-delete e-css e-btn e-small e-button-hide"),o=this.createElement("button",{attrs:{type:"button",class:o}});return i.appendChild(n),i.appendChild(r),i.appendChild(o),t.appendChild(i),e.appendChild(t),e},yst.prototype.addGroupElement=function(t,i,n,o,r,s,a){var l=this,e={groupID:i.id.replace(this.element.id+"_",""),cancel:!1,type:"insertGroup"};this.isImportRules||this.isInitialLoad||this.prvtEvtTgrDaD?(this.isInitialLoad=!1,this.addGroupSuccess(e,t,i,n,o,r,s,a)):this.trigger("beforeChange",e,function(e){l.addGroupSuccess(e,t,i,n,o,r,s,a)})},yst.prototype.addGroupSuccess=function(e,t,i,n,o,r,s,a){var l=this;if(!e.cancel&&this.element.querySelectorAll(".e-group-container").length<=this.maxGroupCount){var h,d,p,e=i,i=void 0,c="",c=e.className.indexOf("e-group-container")<0?e.querySelector(".e-group-container")&&e.querySelector(".e-group-container").id:e.id,u=(this.enableSeparateConnector&&(this.groupElem=this.groupTemplate()),this.groupElem.cloneNode(!0));if(u.setAttribute("id",this.element.id+"_group"+this.groupIdCounter),0===this.groupIdCounter&&this.allowDragAndDrop&&u.querySelector(".e-drag-qb-rule")&&(u&&u.children[0]&&u.children[0].classList.add("e-parent-header"),U([u.querySelector(".e-drag-qb-rule")],"e-hidden")),this.headerTemplate&&(s?(t=!1,u.setAttribute("id",this.element.id+"_group0"),this.headerTemplateFn(u,r,n,a,c),this.groupIdCounter=0):this.headerTemplateFn(u,r,n,a,c)),this.groupIdCounter++,this.headerTemplate||(s=u.querySelector(".e-btngroup-and"),a=u.querySelector(".e-btngroup-or"),c=u.querySelector(".e-btngroup-and-lbl"),I=u.querySelector(".e-btngroup-or-lbl"),s.setAttribute("id",this.element.id+"_and"+this.btnGroupId),a.setAttribute("id",this.element.id+"_or"+this.btnGroupId),s.setAttribute("name",this.element.id+"_and"+this.btnGroupId),a.setAttribute("name",this.element.id+"_and"+this.btnGroupId),c.setAttribute("for",this.element.id+"_and"+this.btnGroupId),I.setAttribute("for",this.element.id+"_or"+this.btnGroupId),this.btnGroupId++),t){for(var s=void 0,s=this.showButtons.groupDelete||je(this.showButtons.groupDelete)?"e-deletegroup":"e-deletegroup e-button-hide",i=this.createElement("button",{attrs:{type:"button",class:s}}),a=(new zv({iconCss:"e-icons e-delete-icon",cssClass:"e-small e-round"}).appendTo(i),i.setAttribute("title",this.l10n.getConstant("DeleteGroup")),Ht(i,{selector:".deletegroup"}),e.querySelector(".e-rule-list")),g=a.children,m=0,f=0,y=g.length;f<y;f++)-1<g[f].className.indexOf("e-group-container")&&(m+=1);if(this.showButtons.cloneGroup&&this.cloneGrpBtnClick)if(this.groupIndex===g.length-1)a.appendChild(u),this.isLastGroup=!0;else{if(this.enableSeparateConnector){for(var v=0,b=this.groupIndex+1,w=0;w<b;w++)g[w].classList.contains("e-rule-container")&&(b++,v++);0<v&&v--,g[T=this.groupIndex+v+1].parentNode.insertBefore(u,g[T])}else g[T=this.groupIndex+1].parentNode.insertBefore(u,g[T]);this.isMiddleGroup=!0}else a.appendChild(u);var C,S,A,c=this.levelColl[e.id].slice(0);c.push(m),this.levelColl[u.id]=c,-1<this.groupIndex&&this.refreshLevelColl(),this.isImportRules||(this.isAddSuccess=!0,this.addGroups([],e.id.replace(this.element.id+"_","")),this.isAddSuccess=!1,o&&this.addRuleToNewGroups&&this.addRuleElement(u,{})),this.headerTemplate||(C="",C=this.showButtons.cloneGroup?"e-clone-grp-btn e-css e-btn e-small e-round e-icons e-icon-btn":"e-clone-grp-btn e-css e-btn e-small e-round e-icons e-icon-btn e-button-hide",I=this.createElement("button",{attrs:{title:this.l10n.getConstant("CloneGroup"),type:"button",class:C}}),S=this.createElement("span",{attrs:{class:"e-btn-icon e-icons e-copy"}}),I.appendChild(S),u.querySelector(".e-group-action").appendChild(I),C=this.showButtons.lockGroup?"e-lock-grp-btn e-css e-btn e-small e-round e-icons e-icon-btn":"e-lock-grp-btn e-css e-btn e-small e-round e-icons e-icon-btn e-button-hide",A=this.createElement("button",{attrs:{title:this.l10n.getConstant("LockGroup"),type:"button",class:C}}),t=this.createElement("span",{attrs:{class:"e-btn-icon e-icons e-unlock"}}),A.appendChild(t),u.querySelector(".e-group-action").appendChild(A),u.querySelector(".e-group-action").appendChild(i))}else this.headerTemplate||(C="",C=this.showButtons.lockGroup?"e-lock-grp-btn e-css e-btn e-small e-round e-icons e-icon-btn":"e-lock-grp-btn e-css e-btn e-small e-round e-icons e-icon-btn e-button-hide",A=this.createElement("button",{attrs:{title:this.l10n.getConstant("LockGroup"),type:"button",class:C}}),S=this.createElement("span",{attrs:{class:"e-btn-icon e-icons e-unlock"}}),A.appendChild(S),u.querySelector(".e-group-action").appendChild(A)),e.appendChild(u),this.levelColl[u.id]=[0];if(this.enableNotCondition&&!this.headerTemplate&&(x=u.querySelector(".e-qb-toggle"),(this.enableSeparateConnector?new ib({label:this.l10n.getConstant("NOT"),cssClass:"e-qb-toggle"}):new zv({content:this.l10n.getConstant("NOT"),cssClass:"e-btn e-small"})).appendTo(x),u.querySelector(".e-btngroup-and-lbl").classList.add("e-not"),this.updatedRule)&&this.updatedRule.not&&U([x],"e-active-toggle"),this.enableSeparateConnector&&!this.headerTemplate){for(var x,I,s=u.querySelector(".e-btngroup-and"),T=u.querySelector(".e-btngroup-or"),E=u.querySelector(".e-btn-group"),w=0;w<E.childNodes.length;w++)"not"===u.querySelector(".e-btn-group").childNodes[w].textContent.toLowerCase()&&this.enableNotCondition?E.childNodes[w].classList.add("e-multiconnector"):E.childNodes[w].style.display="none";u.previousElementSibling&&(je(this.headerTemplate)&&(u.parentElement.insertBefore(this.groupTemplate(!0).querySelector(".e-btn-group"),u),(x=u.previousElementSibling.childNodes[0]).classList.contains("e-qb-toggle"))&&(x.style.display="none"),this.isImportRules||(c=(a=u.previousElementSibling).querySelector(".e-btngroup-and"),o=a.querySelector(".e-btngroup-or"),s.checked||T.checked?this.enableSeparateConnector&&(s.checked&&(c.checked=!0),T.checked)&&(o.checked=!0):(I=u.nextElementSibling)&&I.classList.contains("e-btn-group")&&(s=I.querySelector(".e-btngroup-and"),T=I.querySelector(".e-btngroup-or"),c.checked=s.checked,o.checked=T.checked)))}this.updatedRule=null,this.headerTemplate?(t={requestType:"header-template-create",ruleID:u.id,condition:n,notCondition:this.enableNotCondition?r:void 0},this.trigger("actionBegin",t)):this.enableSeparateConnector?(h=u.querySelector(".e-add-condition-btn"),(p=new zv({cssClass:this.element.id+"_addConditionbtn",content:this.l10n.getConstant("AddCondition")})).appendTo(h),p.element.onclick=function(){l.addRuleElement(z(h,".e-group-container"),{})},d=u.querySelector(".e-add-group-btn"),(p=new zv({cssClass:this.element.id+"_addGroupbtn",content:this.l10n.getConstant("AddGroup")})).appendTo(d),p.element.onclick=function(){l.addGroupElement(!0,z(d,".e-group-container"),"",!0)}):(i=u.querySelector(".e-add-btn"),(p=new u2({items:this.items,cssClass:"e-round e-small e-caret-hide e-addrulegroup",iconCss:"e-icons e-add-icon",beforeOpen:this.selectBtn.bind(this,i),select:this.selectBtn.bind(this,i)})).appendTo(i),i.setAttribute("title",this.l10n.getConstant("AddButton"))),this.isImportRules||this.prvtEvtTgrDaD||(C=e.id.replace(this.element.id+"_",""),S=u.id.replace(this.element.id+"_",""),this.trigger("change",{groupID:C,type:"insertGroup",childGroupID:S}))}},yst.prototype.setMultiConnector=function(e){var t;this.enableSeparateConnector&&!this.headerTemplate&&e.previousElementSibling&&this.groupElem.querySelector(".e-btn-group")&&(e.parentElement.insertBefore(this.groupTemplate(!0).querySelector(".e-btn-group"),e),(t=e.previousElementSibling.childNodes[0]).classList.contains("e-qb-toggle")&&(t.style.display="none"),this.addHeaderDiv(e))},yst.prototype.addHeaderDiv=function(e){var t,i=e.previousElementSibling.previousElementSibling;i&&(je((i=-1<i.id.indexOf("rule")?this.getRule(i):this.getGroup(i)).condition)&&(i.condition="and"),t=e.previousElementSibling.querySelector(".e-btngroup-or"),e=e.previousElementSibling.querySelector(".e-btngroup-and"),t.disabled=!1,e.disabled=!1,"or"===i.condition?t.checked=!0:e.checked=!0)},yst.prototype.headerTemplateFn=function(e,t,i,n,o,r){var s=this.element.id+"_header",a=e.querySelector(".e-group-header");if(this.enableSeparateConnector&&-1!==e.id.indexOf("rule")&&(a=e),this.headerTemplate){if(t={requestType:"header-template-initialize",ruleID:e.id,notCondition:this.enableNotCondition?t:void 0,condition:i,rule:this.getRuleCollection(n,!1),groupID:o},this.trigger("actionBegin",t),this.enableSeparateConnector&&-1!==e.id.indexOf("rule")&&(t.requestType="rule-template-create"),this.headerFn=this.templateParser(this.headerTemplate),this.isReact)l=this.headerFn(t,this,e.id,s)[0],this.enableSeparateConnector&&r?this.enableSeparateConnectorInitialRule(e,l):this.enableSeparateConnector&&-1!==e.id.indexOf("rule")?a.parentElement.insertBefore(l,a.nextElementSibling):a.appendChild(l);else if(this.isAngular){var i=this.headerFn(t,this,e.id,s),l=3===i[0].nodeType?i[1]:i[0];this.enableSeparateConnector&&r?this.enableSeparateConnectorInitialRule(e,l):this.enableSeparateConnector&&-1!==e.id.indexOf("rule")?a.parentElement.insertBefore(l,a.nextElementSibling):a.appendChild(l)}else if(this.isVue3){if(l=this.headerFn(t,this,e.id,s),this.enableSeparateConnector&&(r||-1!==e.id.indexOf("rule")))for(var h=0;h<l.length;h++)if("DIV"===l[h].nodeName){l=l[h];break}this.enableSeparateConnector&&r?this.enableSeparateConnectorInitialRule(e,l):this.enableSeparateConnector&&-1!==e.id.indexOf("rule")?a.parentElement.insertBefore(l,a.nextElementSibling):ht(l,a)}else l=this.headerFn(t,this,"Template",s)[0],this.enableSeparateConnector&&r?this.enableSeparateConnectorInitialRule(e,l):this.enableSeparateConnector&&-1!==e.id.indexOf("rule")?a.parentElement.insertBefore(l,a.nextElementSibling):a.appendChild(l);this.renderReactTemplates()}return e},yst.prototype.enableSeparateConnectorInitialRule=function(e,t){var i=(e.nextElementSibling||e).closest(".e-group-container");(i=e.nextElementSibling?i:i&&(i.nextElementSibling||i))&&i.parentElement.insertBefore(t,i)},yst.prototype.notifyChange=function(e,t,i){var n=z(t,".e-group-container"),n=this.getParentGroup(n),o=z(t,".e-rule-container"),r=0;if("not"===i)n.not=e;else if("condition"===i)this.enableSeparateConnector?(n=(o=(o=t.parentElement.previousElementSibling)&&o.classList.contains("e-group-container")?o.querySelectorAll(".e-rule-container")[o.querySelectorAll(".e-rule-container").length-1]:o)&&o.classList.contains("e-rule-container")?this.getRule(o):n).condition=e:n.condition=e;else{for(;o&&null!==o.previousElementSibling;)o=o.previousElementSibling,(!this.enableSeparateConnector||this.enableSeparateConnector&&(!this.headerTemplate&&!o.classList.contains("e-btn-group")||this.headerTemplate&&(o.classList.contains("e-rule-container")||o.classList.contains("e-group-container"))))&&r++;var n=n.rules[r],n=this.getColumn(n.field),s=this.getFormat(n.format);if("date"===n.type)if(e instanceof Date)e=this.intl.formatDate(e,s);else if(e instanceof Array)for(var a=0;a<e.length;a++)e[a]&&e[a]instanceof Date&&(e[a]=this.intl.formatDate(e[a],s));n.ruleTemplate?this.templateChange(t,e,i):(this.isNotified=!0,this.updateRules(t,e),this.isNotified=!1)}},yst.prototype.templateChange=function(e,t,i){var n=z(e,".e-group-container"),o=this.getParentGroup(n),r=z(e,".e-rule-container"),s=0;for(this.allowValidation&&this.validateValue(o,r);r&&null!==r.previousElementSibling;)r=r.previousElementSibling,(!this.enableSeparateConnector||this.enableSeparateConnector&&(!this.headerTemplate&&!r.classList.contains("e-btn-group")||this.headerTemplate&&(r.classList.contains("e-rule-container")||r.classList.contains("e-group-container"))))&&s++;var a,l,h=o.rules[s],o=("field"===i?this.selectedColumn=this.getColumn(t):h&&(this.selectedColumn=this.getColumn(h.field)),this.previousColumn=this.getColumn(h.field),this.getValidRules(this.rule)),d=(this.selectedColumn&&(a=this.selectedColumn.operators||this.customOperators[this.selectedColumn.type+"Operator"]),["in","notin","between","notbetween"]);switch(i){case"field":h.field=t,h.label=this.selectedColumn.label,h.type=this.selectedColumn.type,h.value="",h.operator=a[0].value;break;case"operator":l=h.operator,h.operator=t,-1<d.indexOf(h.operator)?h.value=[]:-1<d.indexOf(l)&&(h.value="");break;case"value":h.value=t}this.changeRuleTemplate(this.selectedColumn,e),this.filterRules(o,this.getValidRules(this.rule),i),this.selectedColumn&&this.selectedColumn.ruleTemplate&&("field"!==i&&"operator"!==i||(o=z(e,".e-rule-container"),this.destroyControls(o,!0),G(o.querySelector(".e-rule-field")),e=this.appendRuleElem(z(o,".e-group-container"),this.selectedColumn,"change",o.id,i,h),"Vertical"===this.displayMode||-1<this.element.className.indexOf("e-device")?e.className="e-rule-container e-vertical-mode":e.className="e-rule-container e-horizontal-mode",this.enableSeparateConnector||e.previousElementSibling&&-1<e.previousElementSibling.className.indexOf("e-rule-container")&&(e.className.indexOf("e-joined-rule")<0&&(e.className+=" e-joined-rule"),e.previousElementSibling.className.indexOf("e-prev-joined-rule")<0)&&(e.previousElementSibling.className+=" e-prev-joined-rule"),e.previousElementSibling&&-1<e.previousElementSibling.className.indexOf("e-group-container")&&e.className.indexOf("e-separate-rule")<0&&(e.className+=" e-separate-rule"),e={requestType:"template-create",action:i,ruleID:o.id,fields:this.fields,rule:h},i={groupID:n.id.replace(this.element.id+"_",""),ruleID:o.id.replace(this.element.id+"_",""),value:h.field,type:"field"},this.trigger("actionBegin",e),this.trigger("change",i)))},yst.prototype.changeValue=function(e,t){var i,n,o,r,s,a,l,h=this;this.isNumInput&&"number"==typeof t.value||"input"===t.type&&t.target&&t.target.classList.contains("e-numerictextbox")&&this.selectedColumn.validation&&(this.selectedColumn.validation.max!==Number.MAX_VALUE||0<this.selectedColumn.validation.min)?this.isNumInput=!1:(i=t.element&&t.element.classList.contains("e-multiselect")?t.element:t.event?t.event.target:"input"===t.type&&t.target&&t.target.classList.contains("e-numerictextbox")?t.currentTarget:t.element)&&(s=z(i=-1<i.className.indexOf("e-day")||-1<i.className.indexOf("e-today")||-1<i.className.indexOf("e-cell")?t.element:i,".e-group-container"),l=z(i,".e-rule-container"),n=s&&s.id.replace(this.element.id+"_",""),o=l.id.replace(this.element.id+"_",""),(s=t).element&&-1<s.element.className.indexOf("e-datepicker")&&((a=At(z(i=s.element,".e-rule-container").querySelector(".e-filter-input"),"dropdownlist"))&&(this.selectedColumn=a.getDataByValue(a.value)),a=At(z(i,".e-rule-container").querySelector(".e-filter-input"),"dropdowntree"))&&(this.selectedColumn=this.getColumn(a.value[0])),-1<i.className.indexOf("e-radio")?(l=parseInt(i.id.split("valuekey")[1],10),"Default"===this.fieldMode?(a=At(z(i,".e-rule-container").querySelector(".e-filter-input"),"dropdownlist"),this.selectedColumn=a.getDataByValue(a.value),this.selectedColumn.columns&&(a=At(z(i,".e-rule-container").querySelector(".e-rule-sub-filter .e-dropdownlist"),"dropdownlist"),this.selectedColumn=this.getColumn(a.value))):(a=At(z(i,".e-rule-container").querySelector(".e-filter-input"),"dropdowntree"),this.selectedColumn=this.getColumn(a.value[0])),r=(this.selectedColumn.values||[!0,!1])[l]):-1<i.className.indexOf("e-multiselect")?r=At(i,"multiselect").value:(r=t.value,"input"===t.type&&t.target&&t.target.classList.contains("e-numerictextbox")&&(r=Number(t.currentTarget.value),a=K(s=t.currentTarget,NL),l=R("decimal",Mi(this.locale)),isNaN(r)&&-1!==s.value.indexOf(l)&&(r=this.intl.getNumberParser({format:"n"})(s.value)),isNaN(r)||(a.value=r),this.isNumInput=!0)),"input"===t.name&&this.immediateModeDelay?(window.clearInterval(this.timer),this.timer=window.setInterval(function(){h.filterValue(n,o,r,e,i)},this.immediateModeDelay)):this.filterValue(n,o,r,e,i))},yst.prototype.filterValue=function(t,i,e,n,o){var r=this,e={groupID:t,ruleID:i,value:e,cancel:!1,type:"value"};window.clearInterval(this.timer),this.isImportRules?this.changeValueSuccessCallBack(e,o,n,t,i):this.trigger("beforeChange",e,function(e){r.changeValueSuccessCallBack(e,o,n,t,i)})},yst.prototype.changeValueSuccessCallBack=function(e,t,i,n,o){e.cancel||(this.updateRules(t,e.value,i),this.isImportRules)||this.trigger("change",{groupID:n,ruleID:o,value:e.value,cancel:!1,type:"value"})},yst.prototype.fieldClose=function(e){var t,i;this.isFieldChange||this.isDestroy||(this.isFieldClose=!0,i=(e=At(e,"dropdownlist")).popupObj&&e.popupObj.element.querySelector(".e-active"),t=e.getItemData(),e.value=t.value,i={element:e.element,value:t.value,isInteracted:!0,previousItemData:this.prevItemData,previousItem:null,item:i,itemData:t,event:null,e:null},e.previousValue!==e.value&&this.changeField(i),this.isFieldChange=!1)},yst.prototype.changeField=function(e){if(e.isInteracted&&!je(e.value)){this.isFieldChange=!0,this.prevItemData=e.itemData;var t=z(e.element,".e-rule-filter")||z(e.element,".e-rule-sub-filter"),i="DropdownTree"===this.fieldMode?this.getColumn(e.value[0]):this.getColumn(e.value);if("DropdownTree"===this.fieldMode&&null!==t){var n,o=t.querySelector(".e-dropdowntree.e-control"),r=At(o,"dropdowntree");if(!i)return;if("object"===i.type)return r.value=e.oldValue,r.dataBind(),void(je(e.oldValue)?o.value="":(n=this.getLabelFromColumn(e.oldValue[0]),o.value=n));je(e.value[0])||(r.value=e.value[0],r.dataBind(),n=this.getLabelFromColumn(e.value[0]),o.value=n)}if(this.destroySubFields(t),this.subFieldElem=null,this.isNotValueChange=!0,i&&i.ruleTemplate)this.templateChange(e.element,i.field,"field");else if(i&&i.columns&&i.columns[0].ruleTemplate)this.templateChange(e.element,i.columns[0].field,"field");else{for(var r=z(e.element,".e-group-container"),o=this.getParentGroup(r),s=z(e.element,".e-rule-container"),a=0;s&&null!==s.previousElementSibling;)s=s.previousElementSibling,(!this.enableSeparateConnector||this.enableSeparateConnector&&(!this.headerTemplate&&!s.classList.contains("e-btn-group")||this.headerTemplate&&(s.classList.contains("e-rule-container")||s.classList.contains("e-group-container"))))&&a++;o.rules[a].value="",this.changeRule(o.rules[a],e)}}},yst.prototype.changeRule=function(e,t){if(!t.itemData){if("DropdownTree"!==this.fieldMode)return;if(null==At(t.element,"dropdowntree").value)return}var i=z(t.element,".e-rule-filter")||z(t.element,".e-rule-sub-filter"),n=At(t.element,"dropdownlist");"DropdownTree"===this.fieldMode&&null!==i&&(n=At(t.element,"dropdowntree"));var o=z(t.element,".e-group-container").id.replace(this.element.id+"_","");this.changeFilter(i,n,o,e,{},t)},yst.prototype.changeFilter=function(t,e,i,n,o,r){var s,a=this;t?(s=void 0,s="DropdownTree"===this.fieldMode?e.value[0]:this.isImportRules?this.GetRootColumnName(e.value):e.value,this.selectedColumn=this.getColumn(s),s={groupID:i,ruleID:z(t,".e-rule-container").id.replace(this.element.id+"_",""),selectedField:"DropdownTree"===this.fieldMode?e.value[0]:e.value,cancel:!1,type:"field"},this.isImportRules||this.prvtEvtTgrDaD?this.fieldChangeSuccess(s,o,t,n,r):this.trigger("beforeChange",s,function(e){a.fieldChangeSuccess(e,o,t,n,r)})):(s=z(r.element,".e-rule-operator"),this.changeOperator(t,s,e,i,n,o,r))},yst.prototype.changeOperator=function(t,e,i,n,o,r,s){var a=this;e?(n={groupID:n,ruleID:z(e,".e-rule-container").id.replace(this.element.id+"_",""),selectedIndex:i.index,cancel:!1,type:"operator"},this.isImportRules?this.operatorChangeSuccess(n,t,r,o,s):this.trigger("beforeChange",n,function(e){a.operatorChangeSuccess(e,t,r,o,s)})):this.changeRuleValues(t,o,r,s)},yst.prototype.fieldChangeSuccess=function(e,t,i,n,o){for(var r=z(i,".e-rule-container"),s=z(o.element,".e-rule-operator"),a=z(o.element,".e-group-container").id.replace(this.element.id+"_",""),l=At(o.element,"dropdownlist"),h=r.querySelectorAll(".e-tooltip.e-input-group"),d=0;d<h.length;d++)At(h[d],"tooltip").destroy();if(e.cancel)this.changeOperator(i,s,l,a,n,t,o);else if(!je(this.selectedColumn))if(t.type=this.selectedColumn.type,r.querySelector(".e-template")&&(n.value=""),"object"===this.selectedColumn.type&&"Default"===this.fieldMode)for(t.type=this.selectedColumn.columns[0].type;this.selectedColumn.columns;)this.createSubFields(i,n,t,o);else this.destroySubFields(i),this.changeOperator(i,s,l,a,n,t,o)},yst.prototype.destroySubFields=function(e){for(;e&&e.nextElementSibling.classList.contains("e-rule-sub-filter");)this.destroyControls(e),e.nextElementSibling.remove()},yst.prototype.createSubFields=function(e,t,i,n){var o=!1,e=z(e,".e-rule-field"),r=this.createElement("div",{attrs:{class:"e-rule-sub-filter",id:"subfilter"+this.subFilterCounter}}),e=(e.insertBefore(r,e.querySelector(".e-rule-operator")),z(r,".e-rule-container").id),s=this.createElement("input",{attrs:{type:"text",id:e+"_subfilterkey"+this.subFilterCounter}}),a=(r.appendChild(s),-1<this.element.className.indexOf("e-device")?"250px":"200px"),a={dataSource:this.selectedColumn.columns,fields:this.fields,placeholder:this.l10n.getConstant("SelectField"),popupHeight:5<this.selectedColumn.columns.length?a:"auto",change:this.changeField.bind(this),index:0,open:this.popupOpen.bind(this,!1)},l=(this.fieldModel&&(a=lst({},a,this.fieldModel)),new qz(a));if(l.appendTo("#"+e+"_subfilterkey"+this.subFilterCounter),this.isImportRules||this.previousColumn&&this.previousColumn.ruleTemplate&&this.GetRootColumnName(t.field)===this.GetRootColumnName(this.previousColumn.field))for(var h=this.selectedColumn.columns,d=0;d<h.length;d++)if(t.field===h[d].field||-1<t.field.indexOf(h[d].field+this.separator)){l.value=h[d].field,this.selectedColumn=h[d],o=!0;break}this.subFilterCounter++,this.subFieldElem=s,n.itemData=n.itemData,!o&&this.selectedColumn.columns&&(!o&&this.isImportRules&&(l.value=null),this.selectedColumn=this.selectedColumn.columns[0]),this.previousColumn=this.selectedColumn,this.selectedColumn.columns||this.changeRuleValues(r,t,i,n)},yst.prototype.operatorChangeSuccess=function(e,t,i,n,o){var r,s,a,l;e.cancel||(r=(e=z(o.element,".e-rule-operator")).nextElementSibling,s=At(o.element,"dropdownlist"),l=n.operator?n.operator.toString().toLowerCase():"",i.operator=s.value.toString(),s=i.operator.toLowerCase(),-1<i.operator.toLowerCase().indexOf("between")||-1<i.operator.toLowerCase().indexOf("in")&&i.operator.toLowerCase().indexOf("contains")<0?(t=e.previousElementSibling,i.type=n.type,(i.operator.toLowerCase().indexOf("in")<0||l.indexOf("in")<0)&&(n.value=[])):"object"==typeof n.value&&null!==n.value&&(n.value=0<n.value.length?n.value[0]:"number"===n.type?0:""),o.previousItemData&&(-1<(a=o.previousItemData.value.toString().toLowerCase()).indexOf("between")||(-1<a.indexOf("in")||-1<a.indexOf("null")||-1<a.indexOf("empty"))&&a.indexOf("contains")<0)&&(t=e.previousElementSibling,i.type=n.type),-1<l.indexOf("in")&&l.indexOf("in")<5&&-1<s.indexOf("in")&&s.indexOf("in")<5&&(t=null),(-1<i.operator.indexOf("null")||-1<i.operator.indexOf("empty"))&&((l=(a=e.parentElement.querySelector(".e-rule-value")).querySelector(".e-tooltip.e-input-group"))&&At(l,"tooltip").destroy(),q([a],"e-show"),U([a],"e-hide")),r&&this.getColumn(n.field).template&&(t=e.previousElementSibling),0===r.children.length&&(t=e.previousElementSibling),this.changeRuleValues(t,n,i,o))},yst.prototype.changeRuleValues=function(e,t,i,n){var o,r,s,a,l,h,d=z(n.element,".e-rule-operator");e&&(d=e.nextElementSibling,e.classList.contains("e-rule-sub-filter")&&(i.type=this.selectedColumn.type,d=d.classList.contains("e-rule-sub-filter")?d.nextElementSibling:d),U([d],"e-operator"),d.childElementCount?(a=At(d.querySelector(".e-dropdownlist"),"dropdownlist"),i.operator=a.value,r=void 0,r="DropdownTree"===this.fieldMode?At(e.querySelector(".e-dropdowntree"),"dropdowntree"):At(e.querySelector(".e-dropdownlist"),"dropdownlist"),i.type=("DropdownTree"===this.fieldMode?this.getColumn(r.value[0]):this.getColumn(r.value)).type,e=n.itemData,""!==a.value&&this.renderValues(d,e,n.previousItemData,!0,t,i,n.element)):(r=z(d,".e-rule-container").id,a=this.createElement("input",{attrs:{type:"text",id:r+"_operatorkey"}}),d.appendChild(a),this.selectedColumn.operators?o=this.selectedColumn.operators:n.itemData&&(o=this.customOperators[this.selectedColumn.type+"Operator"]),e=-1<this.element.className.indexOf("e-device")?"250px":"200px",t.operator&&o.forEach(function(e){"value"in e&&"string"==typeof e.value&&e.value.toLowerCase()===t.operator.toLowerCase()&&(s=e.value)}),a=s||o[0].value,l=0,this.autoSelectOperator||(a="",l=-1),h=void((this.isImportRules||-1<this.ruleIndex||-1<this.groupIndex||this.prvtEvtTgrDaD)&&(a=t&&t.operator||a)),h={dataSource:o,fields:{text:"key",value:"value"},placeholder:this.l10n.getConstant("SelectOperator"),popupHeight:5<o.length?e:"auto",change:this.changeField.bind(this),index:l,value:a,open:this.popupOpen.bind(this,!1)},this.operatorModel&&(h=lst({},h,this.operatorModel)),new qz(h).appendTo("#"+r+"_operatorkey"),i.operator=t&&""!==t.operator&&!je(t.operator)?t.operator:o[0].value,this.isImportRules&&(i.type=this.selectedColumn.type,i.operator=t.operator),(!je(a)&&""!==a||this.autoSelectField&&this.autoSelectOperator)&&this.renderValues(d,this.selectedColumn,n.previousItemData,!1,t,i,n.element))),this.isImportRules||this.updateRules(n.element,n.item)},yst.prototype.popupOpen=function(e,t){this.enableRtl&&U([t.popup.element],"e-rtl"),e&&(this.isFieldClose=!1)},yst.prototype.destroyControls=function(e,t){for(var i=t?e:e.nextElementSibling,n=i.querySelectorAll("input.e-control"),o=i.querySelectorAll("div.e-control:not(.e-handle)"),r=this.columns,s=0,a=n.length;s<a;s++){if(n[s].classList.contains("e-textbox"))At(n[s],"textbox").destroy(),G(ge("input#"+n[s].id,i));else if(n[s].classList.contains("e-dropdownlist"))this.allowValidation&&-1<n[s].parentElement.className.indexOf("e-tooltip")&&At(n[s].parentElement,"tooltip").destroy(),At(n[s],"dropdownlist").destroy();else if(n[s].classList.contains("e-radio"))At(n[s],"radio").destroy();else if(n[s].classList.contains("e-numerictextbox"))At(n[s],"numerictextbox").destroy(),G(ge("input#"+n[s].id,i));else if(n[s].classList.contains("e-datepicker"))At(n[s],"datepicker").destroy();else if(n[s].classList.contains("e-multiselect"))At(n[s],"multiselect").destroy();else if(-1<n[s].className.indexOf("e-template"))for(var l=n[s].className,h=0,d=r.length;h<d;h++)if(r[h].template&&-1<l.indexOf(r[h].field)){this.templateDestroy(r[h],n[s].id);break}document.getElementById(n[s].id)&&G(n[s])}for(s=0,a=o.length;s<a;s++){if(-1<o[s].className.indexOf("e-template"))for(l=o[s].className,h=0,d=r.length;h<d;h++)if(r[h].template&&-1<l.indexOf(r[h].field)){this.templateDestroy(r[h],o[s].id);break}G(o[s])}for(var p=i.querySelectorAll(".e-template:not(.e-control)"),s=0,a=p.length;s<a;s++)G(p[s])},yst.prototype.templateDestroy=function(e,t){var i,n,o;"string"==typeof e.template&&void 0!==e.template.destroy||(n=(i=e.template).destroy,i.destroy&&(o=void 0,document.getElementById(t)&&(o=z(document.getElementById(t),".e-rule-field").querySelectorAll(".e-template")),"string"==typeof n?(n=R(n,window))({field:e.field,elementId:t,elements:o}):i.destroy({field:e.field,elementId:t,elements:o})))},yst.prototype.getValues=function(e){var t,i={},n=[],o=[],r=(0<this.separator.length&&(o=e.split(this.separator)),this.dataColl);if(this.dataColl[1])for(var s=0,a=r.length;s<a;s++){var l={};if(1<o.length)for(var h,d=r[s],p=0,c=o.length;p<c;p++)h=o[p],o.length===p+1?(t=d[""+h],Number(d[""+h])===d[""+h]&&d[""+h]%1!=0&&(t=d[""+h].toString())):d=d[""+h];else t=r[s][""+e],Number(r[s][""+e])===r[s][""+e]&&r[s][""+e]%1!=0&&(t=r[s][""+e].toString());t in i||((i[""+t]=1)<o.length?this.createNestedObject(l,o,t):l[""+e]=t,n.push(l))}return n},yst.prototype.createNestedObject=function(e,t,i){for(var n,o=t.length-1,r=0;r<o;++r)(n=t[r])in e||(e[""+n]={}),e=e[""+n];e[t[o]]=i},yst.prototype.getDistinctValues=function(i,n){for(var o={},r=[],s=[],a="",l=n.indexOf(this.separator),h=this,e=0,t=i.length;e<t;e++)!function(t){a="",0===l?a=i[t][""+n]:(s=n.split(h.separator)).forEach(function(e){a=(a||i[t])[""+e]});var e={};(a=Number(i[t][""+n])===i[t][""+n]&&i[t][""+n]%1!=0?i[t][""+n].toString():a)in o||(o[""+a]=1,0===l?e[""+n]=a:e[s[s.length-1]]=a,r.push(e))}(e);return r},yst.prototype.renderMultiSelect=function(e,t,i,n,o){var r,s=!1,a=!1,o=(this.isGetNestedData=!1,this.dataColl[1]&&-1<Object.keys(this.dataColl[1]).indexOf(e.field)&&(s=!0,r=this.getDistinctValues(this.dataColl,e.field)),s=!e.columns&&s,a={dataSource:(a=!this.dataColl.length&&o.length?!0:a)?o:s?r:this.dataManager,query:new ya([e.field]),fields:{text:this.selectedRule.field,value:this.selectedRule.field},placeholder:this.l10n.getConstant("SelectValue"),value:n,mode:"CheckBox",width:"100%",change:this.changeValue.bind(this,i),close:this.closePopup.bind(this,i),actionBegin:this.multiSelectOpen.bind(this,t+"_valuekey"+i),open:this.popupOpen.bind(this,!1)},this.valueModel&&this.valueModel.multiSelectModel&&(a=lst({},a,this.valueModel.multiSelectModel)),new zU(a));o.appendTo("#"+t+"_valuekey"+i),this.updateRules(o.element,n,0)},yst.prototype.multiSelectOpen=function(e,t){var i,n;this.dataSource instanceof me&&(i=At(z(e=document.getElementById(e),".e-rule-container").querySelector(".e-filter-input"),"DropdownTree"===this.fieldMode?"dropdowntree":"dropdownlist"),"DropdownTree"===this.fieldMode?this.selectedColumn=this.getColumn(i.value[0]):this.selectedColumn=i.getDataByValue(i.value),i=this.selectedColumn.field,n=!1,(n=this.dataColl[1]&&(-1<Object.keys(this.dataColl[1]).indexOf(i)&&(n=!0),0!==i.indexOf(this.separator))&&this.isGetNestedData?!0:n)||(t.cancel=!0,this.bindMultiSelectData(e,i)))},yst.prototype.bindMultiSelectData=function(e,t){this.getMultiSelectData(e,t)},yst.prototype.getMultiSelectData=function(t,i){var n,o=this,r=new ll,e=this.dataManager.executeQuery((new ya).select(i)),s=At(t,"multiselect");s.hideSpinner(),this.createSpinner(z(t,".e-multi-select-wrapper").parentElement),kA(z(t,".e-multi-select-wrapper").parentElement),e.then(function(e){n=(e.actual&&e.actual.result?e.actual:e).result,o.dataColl=Pe(o.dataColl,n,[],!0),s.dataSource=o.getDistinctValues(o.dataColl,i),o.isGetNestedData=!0,BA(z(t,".e-multi-select-wrapper").parentElement)}).catch(function(e){r.reject(e)})},yst.prototype.createSpinner=function(e){var t=this.createElement("span",{attrs:{class:"e-qb-spinner"}});e.appendChild(t),mA({target:t,width:F.isDevice?"16px":"14px"})},yst.prototype.closePopup=function(e,t){var i,t=document.getElementById(t.popup.element.id.replace("_popup",""));t&&(i=At(t,"multiselect"))&&(i=i.value,this.updateRules(t,i,e))},yst.prototype.processTemplate=function(e,t,i,n){var e=z(e,".e-rule-container"),o=e.querySelectorAll(".e-template"),r=e.querySelector(".e-rule-filter .e-filter-input"),r="DropdownTree"===this.fieldMode?At(r,"dropdowntree"):At(e.querySelector(".e-rule-filter .e-filter-input"),"dropdownlist"),r="DropdownTree"===this.fieldMode?this.getColumn(r.value[0]):this.getColumn(r.value);"string"==typeof t.template||void 0===t.template.write?(e={rule:i,ruleID:e.id,operator:n.operator,field:r.field,requestType:"value-template-create"},this.trigger("actionBegin",e)):"string"==typeof(e=t.template).write?R(e.write,window)({elements:1<o.length?o:o[0],values:i.value,operator:n.operator,field:r.field,dataSource:r.values}):"function"!=typeof t.template&&t.template.write({elements:1<o.length?o:o[0],values:i.value,operator:n.operator,field:r.field,dataSource:r.values})},yst.prototype.getItemData=function(e){var t=At(document.getElementById(e+"_filterkey"),"dropdownlist"),i=this.element.querySelector("#"+e);return"DropdownTree"===this.fieldMode?t=At(document.getElementById(e+"_filterkey"),"dropdowntree"):i&&0<(e=i.querySelectorAll(".e-rule-sub-filter")).length&&(t=At(e[e.length-1].querySelector(".e-dropdownlist"),"dropdownlist")),"DropdownTree"===this.fieldMode?this.getColumn(t.value[0]):this.getColumn(t.value)},yst.prototype.setDefaultValue=function(e,t,i){e=this.getItemData(e);if(je(e.value))return i?t?[0,0]:0:t?[]:"";if(t){if(!(e.value instanceof Array))return[e.value]}else if(e.value instanceof Array)return e.value[0];return e.value},yst.prototype.renderStringValue=function(e,t,i,n,o){var r,s=this.getItemData(e),a="string"==typeof s.template,a=this.isImportRules||-1<this.ruleIndex||-1<this.groupIndex||this.isPublic||a||""!==t.value?t.value:this.setDefaultValue(e,!1,!1);"in"!==i&&"notin"!==i||!this.dataColl.length&&!s.values?("in"!==i&&"notin"!==i||(a=(r=this.isImportRules||-1<this.ruleIndex||-1<this.groupIndex?t.value:this.setDefaultValue(e,!0,!1)).join(",")),"between"!==i&&"notbetween"!==i||1<a.length&&(a=a[n]),i=void 0,i={placeholder:this.l10n.getConstant("SelectValue"),input:this.changeValue.bind(this,n)},this.valueModel&&this.valueModel.textBoxModel&&(i=lst({},i,this.valueModel.textBoxModel)),(i=new fV(i)).appendTo("#"+e+"_valuekey"+n),i.value=a,i.dataBind()):(r=this.isImportRules||-1<this.ruleIndex||-1<this.groupIndex||this.isPublic?t.value:this.setDefaultValue(e,!0,!1),this.renderMultiSelect(s,e,n,r,s.values),"Vertical"===this.displayMode||-1<this.element.className.indexOf("e-device")?o.style.width="100%":(o.style.width=null,o.style.minWidth="200px"))},yst.prototype.renderNumberValue=function(e,t,i,n,o,r,s){var a,l,h,d=this.getItemData(e),p="string"==typeof d.template,p=this.isImportRules||-1<this.ruleIndex||-1<this.groupIndex||this.isPublic||p||"number"==typeof t.value?t.value:this.setDefaultValue(e,!1,!0);"in"!==i&&"notin"!==i||!this.dataColl.length&&!d.values?"in"===i||"notin"===i?(i=(p=this.isImportRules||-1<this.ruleIndex||-1<this.groupIndex?t.value:this.setDefaultValue(e,!0,!1)).join(","),a=void 0,a={placeholder:this.l10n.getConstant("SelectValue"),input:this.changeValue.bind(this,n)},this.valueModel&&this.valueModel.textBoxModel&&(a=lst({},a,this.valueModel.textBoxModel)),(a=new fV(a)).appendTo("#"+e+"_valuekey"+n),a.value=i,a.dataBind()):(i=(r=d).validation&&r.validation.min?r.validation.min:0,a=r.validation&&r.validation.max?r.validation.max:Number.MAX_VALUE,l=r.format||"n",h=void 0,h={value:(p=1<s&&t?t.value[n]||this.setDefaultValue(e,!0,!0):p)instanceof Array?p[n]:p,format:l,min:i,max:a,width:"100%",step:r.step||1,change:this.changeValue.bind(this,n)},this.valueModel&&this.valueModel.numericTextBoxModel&&(h=lst({},h,this.valueModel.numericTextBoxModel)),(s=new NL(h)).appendTo("#"+e+"_valuekey"+n),s.element.setAttribute("aria-label",r.label+" Value"),s.element.oninput=this.changeValue.bind(this,n)):(p=this.isImportRules||-1<this.ruleIndex||-1<this.groupIndex||this.isPublic?t.value:this.setDefaultValue(e,!0,!1),this.renderMultiSelect(d,e,n,p,d.values),-1<this.element.className.indexOf("e-device")||"Vertical"===this.displayMode?o.style.width="100%":(o.style.minWidth="200px",o.style.width=null))},yst.prototype.processValueString=function(e,t){var i=[],n=e.split(",");if("string"===t)return n;for(var o=0,r=n.length;o<r;o++)i.push(Number(n[o]));return i},yst.prototype.parseDate=function(e,t){var i;return t?(i=this.intl.getDateParser({skeleton:"full",type:"dateTime"}),t=this.getFormat(t),je(i=i(e))&&(i=this.intl.parseDate(e,t))):i=new Date(e),i},yst.prototype.renderControls=function(e,t,i,n,o){if(U([e.parentElement.querySelector(".e-rule-value")],"e-value"),q([e.parentElement.querySelector(".e-rule-value")],"e-hide"),U([e.parentElement.querySelector(".e-rule-value")],"e-show"),t.template&&(t.template.create||o))this.processTemplate(e,t,i,n);else{var r="boolean"===n.type?this.selectedColumn.values?this.selectedColumn.values.length:2:n.operator&&-1<n.operator.toString().toLowerCase().indexOf("between")?2:1,s=z(e,".e-rule-container").id,a=void 0,l=n.operator.toString();if(-1<e.className.indexOf("e-rule-operator")||-1<e.className.indexOf("e-rule-filter")){a=e.parentElement.querySelector(".e-rule-value"),-1<this.element.className.indexOf("e-device")||"Vertical"===this.displayMode?a.style.width="100%":("in"!==l&&"notin"!==l?U:q)([a],"e-custom-value");for(var h=0;h<r;h++)switch(n.type){case"string":this.renderStringValue(s,i,l,h,a);break;case"number":this.renderNumberValue(s,i,l,h,a,t,r);break;case"boolean":this.processBoolValues(t,i,s,h);break;case"date":var d=new Date,p=void 0,c=void 0,u=t.format,g=void 0,m=this.l10n.getConstant("SelectValue"),f="string"==typeof t.template;i.value&&!je(u)&&(p=1<r?i.value[h]:i.value,d=this.parseDate(p,u)||new Date),t.field||t.key||!t.value||(d=t.value instanceof Date?t.value:this.parseDate(t.value,t.format)),!t.format&&i&&""!==i.field&&(u=(c=this.getColumn(i.field)).format),(this.isImportRules||this.isPublic||f)&&i&&(u=(c=this.getColumn(i.field)).format,d=i.value&&(p=1<r?i.value[h]:i.value,this.parseDate(p,c.format))),g=u?(f=this.getFormat(u)).skeleton?{locale:this.getLocale(),value:d,placeholder:m,format:f,change:this.changeValue.bind(this,h)}:{value:d,locale:this.getLocale(),placeholder:m,format:f.format,change:this.changeValue.bind(this,h)}:{locale:this.getLocale(),value:d,placeholder:m,change:this.changeValue.bind(this,h)},this.valueModel&&this.valueModel.datePickerModel&&(g=lst({},g,this.valueModel.datePickerModel)),new o9(g).appendTo("#"+s+"_valuekey"+h),i.value||(p=document.getElementById(s+"_valuekey"+h),this.updateRules(p,d,null,this.isNotValueChange),this.isNotValueChange=!1)}}}},yst.prototype.processBoolValues=function(e,t,i,n){var o,r,s,a,l=!1,t=(je(t.type)&&e&&(t.type=e.type),e.values?(a=e.values,"boolean"!==t.type||je(t.value)?e.value?l=a[n].toLowerCase()===e.value.toString().toLowerCase():0===n&&(l=!0):l=a[n].toLowerCase()===t.value.toString().toLowerCase(),r=o=s=a[n]):(a=[!0,!1],"boolean"!==t.type||je(t.value)?e.value?l=a[n].toString().toLowerCase()===e.value.toString().toLowerCase():0===n&&(l="boolean"!=typeof t.value||!!t.value):l=a[n].toString().toLowerCase()===t.value.toString().toLowerCase(),"boolean"==typeof t.value&&1===n&&(l=!t.value),o=a[n].toString(),r=a[n],s=this.l10n.getConstant(["True","False"][n])),e={label:s,name:i+"default",checked:l,value:o,change:this.changeValue.bind(this,n)},this.valueModel&&this.valueModel.radioButtonModel&&(e=lst({},e,this.valueModel.radioButtonModel)),new cb(e));t.appendTo("#"+i+"_valuekey"+n),l&&this.updateRules(t.element,r,0,!0)},yst.prototype.getOperatorIndex=function(e,t){for(var i=e.dataSource.length,n=0;n<i;n++)if(t.operator===e.dataSource[n].value)return n;return 0},yst.prototype.getPreviousItemData=function(e,t){return this.isFieldClose&&(e=e&&this.getColumn(e.value||e.field)),t&&t.template&&e&&Object.keys(e).length<4&&(e.template=t.template),e},yst.prototype.renderValues=function(e,t,i,n,o,r,s){var a=e.previousElementSibling.getElementsByTagName("input")[0],a="DropdownTree"===this.fieldMode?At(a,"dropdowntree"):At(a,"dropdownlist"),a="DropdownTree"===this.fieldMode?this.getColumn(a.value[0]):this.getColumn(a.value),l=(this.selectedRule=a,At(e.querySelector("input"),"dropdownlist")),s=(n&&(t=-1<s.id.indexOf("operator")?t:this.selectedRule).operators&&(l.value=null,l.dataBind(),l.dataSource=t.operators,l.index=this.getOperatorIndex(l,o),l.value=r.operator=l.dataSource[l.index].value,this.autoSelectOperator?l.dataBind():(l.index=-1,r.operator=l.value="")),r.operator.toString()),h=!1;if(-1<s.indexOf("null")||-1<s.indexOf("isempty")||-1<s.indexOf("isnotempty"))(c=e.parentElement.querySelector(".e-rule-value"))&&(q([c],"e-show"),U([c],"e-hide"));else{var d,p=z(e,".e-rule-container").id;if((i=this.getPreviousItemData(i,a))&&void 0===i.template?i.columns&&(i=this.getColumn(o.field)):"DropdownTree"===this.fieldMode&&void 0===i&&(i=this.getColumn(o.field)),i&&i.template&&(this.templateDestroy(i,p+"_valuekey0"),(d=ge("#"+p+"_valuekey0",e.nextElementSibling))&&!d.classList.contains("e-control")&&G(ge("#"+p+"_valuekey0",e.nextElementSibling)),"string"!=typeof i.template&&void 0!==i.template.create||(e.nextElementSibling.classList.contains("e-template-value")&&this.clearQBTemplate([p]),e.nextElementSibling.innerHTML=""),this.isAngular)&&!je(i.key)&&"DropdownTree"===this.fieldMode&&delete i.template,n&&(this.validateValue(o,z(e,".e-rule-container")),this.destroyControls(e)),this.isImportRules||l&&""!==l.value){if(a&&(t.template=a.template),t.template&&(U([e.nextElementSibling],"e-template-value"),t.template=a.template,h=this.setColumnTemplate(t,p,a.field,t.value||s,e,o)),h){var c=e.parentElement.querySelector(".e-rule-value");-1<this.element.className.indexOf("e-device")||"Vertical"===this.displayMode?c.style.width="100%":c.style.width="200px"}else{q([e.nextElementSibling],"e-template-value");for(var u=1,u="boolean"===r.type?this.selectedColumn.values?this.selectedColumn.values.length:2:s&&-1<s.toLowerCase().indexOf("between")?2:1,g=0;g<u;g++){var m=this.createElement("input",{attrs:{type:"text",id:p+"_valuekey"+g}});e.nextElementSibling.appendChild(m)}}this.renderControls(e,t,o,r,h),this.isAngular&&!je(t.key)&&t.template&&"DropdownTree"===this.fieldMode&&delete t.template}}},yst.prototype.setColumnTemplate=function(t,i,n,e,o,r){var s=this,a=!0;if(t.template){if("string"==typeof t.template||void 0===t.template.create)return this.trigger("actionBegin",{requestType:"value-template-initialize",ruleID:i,field:n,operator:e,rule:r,renderTemplate:!0},function(e){a=s.actionBeginSuccessCallBack(e,t,i,n,o)}),a;var l=void 0,r=t.template;if((l="string"==typeof r.create?R(r.create,window)({field:n,operator:e}):r.create({field:n,operator:e}))instanceof Element)l.id=i+"_valuekey0",U([l],"e-template"),o.nextElementSibling.appendChild(l),n.indexOf(" ")<0&&U([l],"e-"+n);else if(l instanceof Array){U(l,"e-template");for(var h=0,d=l.length;h<d;h++)l[h].id=i+"_valuekey"+h,o.nextElementSibling.appendChild(l[h])}U([o.nextElementSibling],"e-template-value")}return!0},yst.prototype.actionBeginSuccessCallBack=function(e,t,i,n,o){var r;return!!e.renderTemplate&&(r=void 0,this.columnTemplateFn=this.templateParser((t.template,t.template)),t=this.element.id+n,this.isReact?(r=this.columnTemplateFn(e,this,i,t)[0],o.nextElementSibling.appendChild(r)):this.isAngular?(r=3===(n=this.columnTemplateFn(e,this,i,t))[0].nodeType?n[1]:n[0],o.nextElementSibling.appendChild(r)):this.isVue3?ht(r=this.columnTemplateFn(e,this,"Template",t),o.nextElementSibling):(r=this.columnTemplateFn(e,this,"Template",t)[0],o.nextElementSibling.appendChild(r)),U([o.nextElementSibling],"e-template-value"),this.renderReactTemplates(),!0)},yst.prototype.updateValues=function(e,t){var i,n,o=1,r=(-1<e.className.indexOf("e-template")&&(o=3),e.className.split(" e-")[o]),s=parseInt(e.id.slice(-1),2);switch(r){case"checkbox":n=At(e,r).value,t.value=""!==n?n:void 0;break;case"textbox":n=At(e,r).value,-1<t.operator.indexOf("between")?("string"==typeof t.value&&(t.value=[]),t.value[s]=n):t.value=n;break;case"dropdownlist":t.value=At(e,r).value;break;case"radio":(n=At(e,r)).checked&&("boolean"!=typeof t.value&&this.getColumn(t.field).values?t.value=n.value:t.value="true"===n.value),n.refresh();break;case"numerictextbox":-1<t.operator.indexOf("between")?("string"==typeof t.value&&(t.value=[]),t.value[s]=At(e,r).value):t.value=At(e,r).value;break;case"datepicker":n=this.getColumn(t.field),n=this.getFormat(n.format),i=At(e,r).value,-1<t.operator.indexOf("between")?("string"==typeof t.value&&(t.value=[]),t.value[s]=this.intl.formatDate(i,n)):je(n.format)&&i?t.value=this.intl.formatDate(i):t.value=i&&this.intl.formatDate(i,n);break;case"multiselect":t.value=At(e,r).value}},yst.prototype.updateRules=function(e,t,i,n){for(var o=z(e,".e-group-container"),r=this.getParentGroup(o),s=z(e,".e-rule-container"),a=0,l=o.id.replace(this.element.id+"_",""),h=this.getValidRules(this.rule);s&&null!==s.previousElementSibling;)s=s.previousElementSibling,(!this.enableSeparateConnector||this.enableSeparateConnector&&(!this.headerTemplate&&!s.classList.contains("e-btn-group")||this.headerTemplate&&(s.classList.contains("e-rule-container")||s.classList.contains("e-group-container"))))&&a++;var d=r.rules[a].operator?r.rules[a].operator.toString():"",p=(s=z(e,".e-rule-container")).id.replace(this.element.id+"_","");if(z(e,".e-rule-filter")||z(e,".e-rule-sub-filter")){this.subFieldElem&&(e=this.subFieldElem);var c="DropdownTree"===this.fieldMode?At(e,"dropdowntree"):At(e,"dropdownlist"),u="DropdownTree"===this.fieldMode?this.getColumn(c.value[0]):this.getColumn(c.value),u=(this.isImportRules||!r.rules[a].field||r.rules[a].field.toLowerCase()===u.field.toLowerCase()||(!(s.querySelectorAll(".e-template")||-1<d.indexOf("null"))||-1<d.indexOf("empty"))&&(r.rules[a].value=""),this.selectedColumn=this.getColumn(this.selectedColumn.field),r.rules[a].field=this.selectedColumn.field,r.rules[a].type=this.selectedColumn.type,r.rules[a].label=this.selectedColumn.label,z(e,".e-rule-filter")),g=(u=u||z(e,".e-rule-sub-filter")).nextElementSibling.querySelector("input.e-control"),d=At(g||u.nextElementSibling.nextElementSibling.querySelector("input.e-control"),"dropdownlist").value.toString(),g=(r.rules[a].operator=d,u.nextElementSibling.nextElementSibling),m=g.querySelectorAll("input.e-control");(m=m.length<1?g.querySelectorAll("div.e-control"):m).length<1&&(m=g.querySelectorAll(".e-template"));for(var u={groupID:l,ruleID:p,value:r.rules[a].field,type:"field"},f=0;f<m.length;f++)-1<d.indexOf("null")||-1<d.indexOf("empty")?r.rules[a].value=null:this.updateValues(m[f],r.rules[a]);this.isImportRules||this.prvtEvtTgrDaD||this.trigger("change",u),this.allowValidation&&r.rules[a].field&&-1<e.parentElement.className.indexOf("e-tooltip")&&At(e.parentElement,"tooltip").destroy(),this.filterRules(h,this.getValidRules(this.rule),"field")}else if(z(e,".e-rule-operator")){c=At(e,"dropdownlist"),r.rules[a].operator=c.value.toString();var y=s.querySelectorAll(".e-rule-value input.e-control");u={groupID:l,ruleID:p,value:c.value,type:"operator"},this.allowValidation&&r.rules[a].operator&&-1<e.parentElement.className.indexOf("e-tooltip")&&At(e.parentElement,"tooltip").destroy(),1<y.length&&!(-1<y[0].className.indexOf("e-template"))&&(r.rules[a].value=[]);for(var v=0;v<y.length;v++)-1<r.rules[a].operator.indexOf("null")||-1<r.rules[a].operator.indexOf("empty")?r.rules[a].value=null:y[v].classList.contains("e-template")||this.updateValues(y[v],r.rules[a]);this.isImportRules||this.trigger("change",u),this.filterRules(h,this.getValidRules(this.rule),"operator")}else z(e,".e-rule-value")&&(this.ruleValueUpdate(e,t,r,a,o,s,i),n||this.filterRules(h,this.getValidRules(this.rule),"value"))},yst.prototype.filterRules=function(e,t,i){JSON.stringify({condition:e.condition,not:e.not,rule:e.rules})===JSON.stringify({condition:t.condition,not:t.not,rule:t.rules})||this.isImportRules||this.prvtEvtTgrDaD||this.trigger("ruleChange",{previousRule:e,rule:t,type:i})},yst.prototype.ruleValueUpdate=function(e,t,i,n,o,r,s){var a,l=["in","between","notin","notbetween"];if(i.rules[n].operator&&(a=i.rules[n].operator.toString().toLowerCase()),null!==t){if(-1<e.className.indexOf("e-multiselect")&&"number"===i.rules[n].type&&!this.isNotified){for(var h=[],d=t,p=0,c=d.length;p<c;p++)"string"==typeof d[p]&&h.push(parseFloat(d[p]));h.length&&(t=h)}this.isNotified?(i.rules[n].value=t,o={groupID:o.id,ruleID:r.id,value:i.rules[n].value,type:"value"},this.isImportRules||this.trigger("change",o)):-1<e.className.indexOf("e-spin")||-1<e.className.indexOf("e-numeric")?-1<l.indexOf(a)?i.rules[n].value[s]=t:i.rules[n].value=t:-1<e.className.indexOf("e-radio")||-1<e.className.indexOf("e-multiselect")?i.rules[n].value=t:-1<e.className.indexOf("e-textbox")?"in"===a||"notin"===a?(i.rules[n].type,i.rules[n].value=this.processValueString(t,i.rules[n].type)):"between"===a||"notbetween"===a?("string"==typeof i.rules[n].value&&(i.rules[n].value=[]),i.rules[n].value[s]=t):i.rules[n].value=t:-1<e.className.indexOf("e-datepicker")&&(o=this.getFormat(this.getColumn(this.selectedColumn.field).format)).type&&(-1<l.indexOf(a)?("string"==typeof i.rules[n].value&&(i.rules[n].value=[]),i.rules[n].value[s]=this.intl.formatDate(t,o)):i.rules[n].value=this.intl.formatDate(t,o)),this.validateValue(i,r,n)}else-1<e.className.indexOf("e-datepicker")&&-1<l.indexOf(a)?("string"==typeof i.rules[n].value&&(i.rules[n].value=[]),i.rules[n].value[s]=t):i.rules[n].value=t},yst.prototype.validateValue=function(e,t,i){var n="object"==typeof(e=je(i)?e:e.rules[i]).value;this.allowValidation&&(je(i)||(n?0<e.value.length:e.value))&&0<(i=t.querySelectorAll(".e-rule-value .e-control")).length&&(-1<i[0].className.indexOf("e-tooltip")?At(i[0],"tooltip").destroy():-1<i[0].parentElement.className.indexOf("e-tooltip")&&At(i[0].parentElement,"tooltip").destroy(),i[1]&&-1<i[1].parentElement.className.indexOf("e-tooltip")&&At(i[1].parentElement,"tooltip").destroy(),i[2])&&-1<i[2].parentElement.className.indexOf("e-tooltip")&&At(i[2].parentElement,"tooltip").destroy()},yst.prototype.getFormat=function(e){var t;return e?"string"==typeof e?(t={type:"dateTime"},"short"===e||"yMd"===e?(t.type="date",t.skeleton=e):t.format=e):t={type:"dateTime",skeleton:e.skeleton}:t={type:"date",skeleton:"yMd"},t},yst.prototype.findGroupByIdx=function(e,t,i){var n=t.rules,o=[];if(i)return t;for(var r=0,s=n.length;r<s;r++)(t=n[r]).rules&&o.push(t);return o[e]},yst.prototype.destroy=function(){var e,t,i,n;if(this.isDestroy=!0,this.element){for(fst.prototype.destroy.call(this),i=(e=this.element.querySelectorAll(".e-addrulegroup")).length,t=0;t<i;t++)At(e[t],"dropdown-btn").destroy(),G(e[t]);for(n=this.element.querySelectorAll(".e-rule-filter .e-control.e-tooltip"),t=0;t<n.length;t++)At(n[t],"tooltip").destroy();for(i=(e=this.element.querySelectorAll(".e-rule-filter .e-control:not(.e-tooltip)")).length,t=0;t<i;t++)(At(e[t],"dropdownlist")?At(e[t],"dropdownlist"):At(e[t],"dropdowntree")).destroy(),G(e[t]);for(n=this.element.querySelectorAll(".e-rule-operator .e-control.e-tooltip"),t=0;t<n.length;t++)At(n[t],"tooltip").destroy();for(i=(e=this.element.querySelectorAll(".e-rule-operator .e-control:not(.e-tooltip)")).length,t=0;t<i;t++)At(e[t],"dropdownlist")&&(At(e[t],"dropdownlist").destroy(),G(e[t]));for(n=this.element.querySelectorAll(".e-rule-value .e-control.e-tooltip"),t=0;t<n.length;t++)At(n[t],"tooltip").destroy();this.isImportRules=!1,this.unWireEvents(),this.levelColl[this.element.id+"_group0"]=[0],this.element.innerHTML="",this.portals&&this.portals.length&&this.clearQBTemplate();var o=document.querySelectorAll(".qb-dropdownlist.e-popup");if(o)for(t=0;t<o.length;t++)o[t].remove();mt(this.element,[],["e-rtl","e-responsive","e-device"]),this.isDestroy=!1}},yst.prototype.addRules=function(e,t){t=this.element.id+"_"+t,this.isPublic=!0;for(var i=0,n=e.length;i<n;i++)this.addRuleElement(document.getElementById(t),e[i]);this.isPublic=!1},yst.prototype.addGroups=function(e,t){if(this.isAddSuccess||this.element.querySelectorAll(".e-group-container").length<=this.maxGroupCount){t=this.element.id+"_"+t;var i=document.getElementById(t),t=this.getParentGroup(i);if(e.length){this.isPublic=!0;for(var n=0,o=e.length;n<o;n++)this.updatedRule={isLocked:e[n].isLocked,condition:e[n].condition,not:e[n].not},this.importRules(e[n],i,!1,e[n].not);this.isPublic=!1}else{var r="and",s=!1,a=!1;this.updatedRule&&(r=this.updatedRule.condition,s=this.updatedRule.not,a=this.updatedRule.isLocked),this.groupIndex<0?this.enableNotCondition?t.rules.push({condition:r,not:s,rules:[]}):t.rules.push({condition:r,rules:[]}):this.enableNotCondition?t.rules.splice(this.groupIndex+1,0,{condition:r,not:s,rules:[],isLocked:a}):t.rules.splice(this.groupIndex+1,0,{condition:r,rules:[],isLocked:a})}this.headerTemplate||this.disableRuleCondition(i,t,null,!!this.enableSeparateConnector||null)}},yst.prototype.initWrapper=function(){if(this.isInitialLoad=!0,this.cssClass&&U([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableSeparateConnector&&U([this.element],"e-multi-connector"),this.enableRtl&&U([this.element],"e-rtl"),this.width&&(this.element.style.width=this.width),this.height&&(this.element.style.height=this.height),this.rule.rules.length?this.isImportRules=!0:this.addGroupElement(!1,this.element),F.isDevice||"Vertical"===this.displayMode?(F.isDevice&&(this.element.style.width="100%",this.element.classList.add("e-device")),q(this.element.querySelectorAll(".e-rule-container"),"e-horizontal-mode"),U(this.element.querySelectorAll(".e-rule-container"),"e-vertical-mode"),this.displayMode="Vertical"):this.displayMode="Horizontal",this.summaryView)this.isImportRules?this.renderSummary():this.renderSummaryCollapse();else{this.columns&&this.columns.length&&this.isImportRules?(this.addGroupElement(!1,this.element,this.rule.condition,!1,this.rule.not,!1,this.rule),e=Pe({},this.rule,{},!0),this.isRefreshed=!0,this.setGroupRules(e),this.isRefreshed=!1):this.columns&&this.columns.length&&this.addRuleElement(this.element.querySelector(".e-group-container"),{}),this.notGroupRtl(),this.readonly&&this.enableReadonly();for(var e,t=this.element.querySelectorAll("label.e-btn"),i=0;i<t.length;i++)Ht(t.item(i),{selector:".e-btn"})}},yst.prototype.renderSummary=function(){var e=this.createElement("div",{attrs:{class:"e-summary-content",id:this.element.id+"_summary_content"}}),t=this.createElement("textarea",{attrs:{class:"e-summary-text",readonly:"true"},styles:"max-height:500px"}),i=this.createElement("button",{attrs:{type:"button",class:"e-edit-rule e-css e-btn e-small e-flat e-primary"}}),n=this.createElement("div",{attrs:{class:"e-summary-btndiv"}});e.appendChild(t),t.textContent=this.getSqlFromRules(this.rule),i.textContent=this.l10n.getConstant("Edit"),n.appendChild(i),e.appendChild(n),this.element.appendChild(e)},yst.prototype.renderSummaryCollapse=function(){var e=this.createElement("div",{attrs:{class:"e-collapse-rule e-icons",title:this.l10n.getConstant("SummaryViewTitle")}});this.element.querySelector(".e-group-header").appendChild(e)},yst.prototype.columnSort=function(){"descending"===this.sortDirection.toLowerCase()?this.columns=new me(this.columns).executeLocal((new ya).sortByDesc("field")):"ascending"===this.sortDirection.toLowerCase()&&(this.columns=new me(this.columns).executeLocal((new ya).sortBy("field")))},yst.prototype.onChangeNotGroup=function(){var e;this.element.innerHTML="",this.groupIdCounter=0,this.headerTemplate||(this.enableNotCondition?(e=this.createElement("button",{attrs:{type:"button",class:"e-qb-toggle"}}),this.groupElem.querySelector(".e-btn-group")&&this.groupElem.querySelector(".e-btn-group").insertBefore(e,this.groupElem.querySelector(".e-btngroup-and"))):this.groupElem.querySelector(".e-qb-toggle").remove()),this.setProperties({rule:this.checkNotGroup(this.rule)},!0),this.initWrapper()},yst.prototype.notGroupRtl=function(){(this.enableRtl?U:q)(this.element.querySelectorAll(".e-btn-group"),"e-rtl")},yst.prototype.checkNotGroup=function(e){var t;if(e.rules)for(var i=0;i<e.rules.length;i++)t=e.rules[i],t=this.checkNotGroup(t),e.rules[i]=t;return je(e.not)?this.enableNotCondition&&!je(e.condition)&&(e.not=!1):(this.enableNotCondition&&(e.not=!1),delete e.not),e},yst.prototype.onPropertyChanged=function(e,t){for(var i=Object.keys(e),n=this.element.querySelector(".e-group-container"),o=this.element.querySelector(".e-summary-content"),r=0,s=i;r<s.length;r++)switch(s[r]){case"summaryView":e.summaryView?(n.style.display="none",this.element.querySelectorAll(".e-summary-content").length<1?(this.renderSummary(),o=this.element.querySelector(".e-summary-content")):this.element.querySelector(".e-summary-text").textContent=this.getSqlFromRules(this.rule),o.style.display="block"):(-1<n.querySelectorAll(".e-collapse-rule").length&&this.renderSummaryCollapse(),n.style.display="block",o.style.display="none");break;case"displayMode":this.refresh();break;case"showButtons":je(e.showButtons.lockGroup)||(e.showButtons.lockGroup?q:U)(this.element.querySelectorAll(".e-lock-grp-btn"),"e-button-hide"),je(e.showButtons.lockRule)||(e.showButtons.lockRule?q:U)(this.element.querySelectorAll(".e-lock-rule-btn"),"e-button-hide"),je(e.showButtons.cloneGroup)||(e.showButtons.cloneGroup?q:U)(this.element.querySelectorAll(".e-clone-grp-btn"),"e-button-hide"),je(e.showButtons.cloneRule)||(e.showButtons.cloneRule?q:U)(this.element.querySelectorAll(".e-clone-rule-btn"),"e-button-hide"),je(e.showButtons.ruleDelete)||(e.showButtons.ruleDelete?q:U)(this.element.querySelectorAll(".e-rule-delete"),"e-button-hide"),je(e.showButtons.groupDelete)||(e.showButtons.groupDelete?q:U)(this.element.querySelectorAll(".e-deletegroup"),"e-button-hide");break;case"cssClass":t.cssClass&&q([this.element],t.cssClass.split(" ")),e.cssClass&&U([this.element],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":(e.enableRtl?U:q)([this.element],"e-rtl"),this.notGroupRtl();break;case"enablePersistence":this.enablePersistence=e.enablePersistence;break;case"dataSource":this.dataSource=e.dataSource,this.refresh();break;case"columns":this.columns=e.columns,this.columnSort(),this.updateSubFieldsFromColumns(this.columns);break;case"sortDirection":this.sortDirection=e.sortDirection,this.columnSort();break;case"maxGroupCount":this.maxGroupCount=e.maxGroupCount;break;case"height":this.height=e.height,this.element.style.height=this.height;break;case"rule":0!==this.rule.rules.length||je(this.rule)||this.reset(),this.setProperties({rule:e.rule},!0),e.rule=this.getRuleCollection(this.rule,!1),this.setRules(this.rule);break;case"width":this.width=e.width,this.element.style.width=this.width;break;case"locale":this.locale=e.locale,this.intl=new Ti(this.locale),this.isLocale=!0,this.refresh(),this.isLocale=!1;break;case"enableNotCondition":this.onChangeNotGroup();break;case"readonly":this.isReadonly=e.readonly,this.enableReadonly();break;case"allowDragAndDrop":this.allowDragAndDrop=e.allowDragAndDrop,this.refresh();break;case"enableSeparateConnector":this.enableSeparateConnector=e.enableSeparateConnector,this.refresh()}},yst.prototype.preRender=function(){this.element.id=this.element.id||D("ej2-querybuilder"),this.defaultLocale={StartsWith:"Starts With",DoesNotStartWith:"Does Not Start With",EndsWith:"Ends With",DoesNotEndWith:"Does Not End With",Contains:"Contains",DoesNotContain:"Does Not Contain",NotLike:"Not Like",Like:"Like",Equal:"Equal",NotEqual:"Not Equal",LessThan:"Less Than",LessThanOrEqual:"Less Than Or Equal",GreaterThan:"Greater Than",GreaterThanOrEqual:"Greater Than Or Equal",Between:"Between",NotBetween:"Not Between",In:"In",NotIn:"Not In",Remove:"REMOVE",SelectField:"Select a field",SelectOperator:"Select operator",DeleteRule:"Remove this condition",DeleteGroup:"Delete group",AddGroup:"Add Group",AddCondition:"Add Condition",Edit:"EDIT",ValidationMessage:"This field is required",SummaryViewTitle:"Summary View",OtherFields:"Other Fields",AND:"AND",OR:"OR",NOT:"NOT",SelectValue:"Enter Value",IsEmpty:"Is Empty",IsNotEmpty:"Is Not Empty",IsNull:"Is Null",IsNotNull:"Is Not Null",True:"true",False:"false",AddButton:"Add Group/Condition",CloneGroup:"Clone Group",LockGroup:"Lock Group",CloneRule:"Clone Rule",LockRule:"Lock Rule",UnlockRule:"Unlock Rule",UnlockGroup:"Unlock Group"},this.l10n=new Cn("querybuilder",this.defaultLocale,this.locale),this.intl=new Ti(this.locale),this.groupIdCounter=0,this.subFilterCounter=0,this.ruleIdCounter=0,this.btnGroupId=0,this.isImportRules=!1,this.parser=[],this.customOperators={stringOperator:[{value:"startswith",key:this.l10n.getConstant("StartsWith")},{value:"notstartswith",key:this.l10n.getConstant("DoesNotStartWith")},{value:"endswith",key:this.l10n.getConstant("EndsWith")},{value:"notendswith",key:this.l10n.getConstant("DoesNotEndWith")},{value:"contains",key:this.l10n.getConstant("Contains")},{value:"notcontains",key:this.l10n.getConstant("DoesNotContain")},{value:"equal",key:this.l10n.getConstant("Equal")},{value:"notequal",key:this.l10n.getConstant("NotEqual")},{value:"in",key:this.l10n.getConstant("In")},{value:"notin",key:this.l10n.getConstant("NotIn")},{value:"isempty",key:this.l10n.getConstant("IsEmpty")},{value:"isnotempty",key:this.l10n.getConstant("IsNotEmpty")}],dateOperator:[{value:"equal",key:this.l10n.getConstant("Equal")},{value:"greaterthan",key:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",key:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",key:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",key:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",key:this.l10n.getConstant("NotEqual")},{value:"between",key:this.l10n.getConstant("Between")},{value:"notbetween",key:this.l10n.getConstant("NotBetween")}],booleanOperator:[{value:"equal",key:this.l10n.getConstant("Equal")},{value:"notequal",key:this.l10n.getConstant("NotEqual")}],numberOperator:[{value:"equal",key:this.l10n.getConstant("Equal")},{value:"greaterthanorequal",key:this.l10n.getConstant("GreaterThanOrEqual")},{value:"greaterthan",key:this.l10n.getConstant("GreaterThan")},{value:"between",key:this.l10n.getConstant("Between")},{value:"lessthan",key:this.l10n.getConstant("LessThan")},{value:"notbetween",key:this.l10n.getConstant("NotBetween")},{value:"lessthanorequal",key:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",key:this.l10n.getConstant("NotEqual")},{value:"in",key:this.l10n.getConstant("In")},{value:"notin",key:this.l10n.getConstant("NotIn")}]},this.operators={equal:"=",notequal:"!=",greaterthan:">",greaterthanorequal:">=",lessthan:"<",in:"IN",notin:"NOT IN",lessthanorequal:"<=",startswith:"LIKE",endswith:"LIKE",between:"BETWEEN",notbetween:"NOT BETWEEN",contains:"LIKE",isnull:"IS NULL",isnotnull:"IS NOT NULL",isempty:"IS EMPTY",isnotempty:"IS NOT EMPTY",notstartswith:"NOT LIKE",notendswith:"NOT LIKE",notcontains:"NOT LIKE"},this.sqlOperators={equal:"=",notequal:"!=",greaterthan:">",greaterthanorequal:">=",lessthan:"<",in:this.l10n.getConstant("In").toUpperCase(),notin:this.l10n.getConstant("NotIn").toUpperCase(),lessthanorequal:"<=",startswith:this.l10n.getConstant("Like").toUpperCase(),endswith:this.l10n.getConstant("Like").toUpperCase(),between:this.l10n.getConstant("Between").toUpperCase(),notbetween:this.l10n.getConstant("NotBetween").toUpperCase(),contains:this.l10n.getConstant("Like").toUpperCase(),isnull:this.l10n.getConstant("IsNull").toUpperCase(),isnotnull:this.l10n.getConstant("IsNotNull").toUpperCase(),isempty:this.l10n.getConstant("IsEmpty").toUpperCase(),isnotempty:this.l10n.getConstant("IsNotEmpty").toUpperCase(),notstartswith:this.l10n.getConstant("NotLike").toUpperCase(),notendswith:this.l10n.getConstant("NotLike").toUpperCase(),notcontains:this.l10n.getConstant("NotLike").toUpperCase()},this.fields||(this.fields={text:"label",value:"field"})},yst.prototype.render=function(){this.levelColl={},this.items=[{text:this.l10n.getConstant("AddGroup"),iconCss:"e-icons e-add-icon e-addgroup"},{text:this.l10n.getConstant("AddCondition"),iconCss:"e-icons e-add-icon e-addrule"}],this.ruleElem=this.ruleTemplate(),this.groupElem=this.groupTemplate();var e=[{value:"isnull",key:this.l10n.getConstant("IsNull")},{value:"isnotnull",key:this.l10n.getConstant("IsNotNull")}],t=[{value:"isnull",key:this.l10n.getConstant("IsNull")},{value:"isnotnull",key:this.l10n.getConstant("IsNotNull")}];this.customOperators.stringOperator=this.customOperators.stringOperator.concat(e),this.customOperators.numberOperator=this.customOperators.numberOperator.concat(t),this.dataSource instanceof me?(this.dataManager=this.dataSource,this.executeDataManager((new ya).take(1))):(this.dataManager=new me(this.dataSource),this.dataColl=this.dataManager.executeLocal(new ya),this.initControl()),this.renderComplete(),this.allowDragAndDrop&&this.initializeDrag()},yst.prototype.initializeDrag=function(){this.draggable=new hn(this.element,{dragTarget:".e-drag-qb-rule",distance:5,helper:this.helper.bind(this),dragStart:this.dragStartHandler.bind(this),drag:this.dragHandler.bind(this),dragStop:this.dragStopHandler.bind(this),isReplaceDragEle:!0,isPreventSelect:!1,abort:".e-parent-header",isDragScroll:!0})},yst.prototype.helper=function(e){var t,i,n,o=this.draggable.currentStateTarget;return!(!o.classList.contains("e-drag-qb-rule")||o.classList.contains("e-drag-qb-rule")&&z(o,".e-disable"))&&(t=this.createElement("div",{className:"e-cloneproperties e-draganddrop e-dragclone",styles:'height:"auto", z-index:2, width:'+this.element.offsetWidth}),(this.draggable.currentStateTarget.parentElement.classList.contains("e-group-header")?(i=z(o,".e-group-container").cloneNode(!0),z(o,".e-group-container")):(t.classList.add("e-group-body"),i=this.createElement("div",{className:"e-rule-container"}),n=z(o,".e-rule-field").cloneNode(!0),i.appendChild(n),z(o,".e-rule-field"))).classList.add("e-qb-dragging-rule"),t.appendChild(i),t.querySelectorAll("*").forEach(function(e){e.removeAttribute("id")}),this.element.appendChild(t),t)},yst.prototype.dragStartHandler=function(e){this.draggedRule=e.target,this.isDragEventPrevent=!1,document.body.classList.add("e-prevent-select"),this.dragElement=e.dragElement;var t=z(e.target,".e-rule-container"),e=z(e.target,".e-group-container"),t={dragRuleID:(null!==t?t:e).id,dragGroupID:e.id,cancel:!1};this.trigger("dragStart",t),this.isDragEventPrevent=t.cancel},yst.prototype.dragHandler=function(e){var t,i,n,o,r,s,a;this.isDragEventPrevent||(this.element.querySelectorAll(".e-drag-rule-bottom-line").forEach(function(e){e.classList.remove("e-drag-rule-bottom-line")}),this.element.querySelectorAll(".e-drag-rule-top-line").forEach(function(e){e.classList.remove("e-drag-rule-top-line")}),je(e.target))||("HTML"===e.target.nodeName||z(e.target,".e-qb-dragging-rule")||z(e.target,".e-group-header")||!z(e.target,"#"+this.element.id)||z(e.target,".e-disable")||e.target.parentElement&&e.target.parentElement.classList.contains("e-btn-group")&&this.enableSeparateConnector?this.dragElement.classList.add("e-notallowedcur"):(this.dragElement.classList.remove("e-notallowedcur"),t=z(e.target,".e-rule-container"),s=z(e.target,".e-group-container"),t?(i=t.getBoundingClientRect(),a=(n=e.event.clientY||e.event.changedTouches[0].clientY)-i.top,o=i.bottom-n,a<(r=20)?t.classList.add("e-drag-rule-top-line"):o<r&&t.classList.add("e-drag-rule-bottom-line")):e.target.classList.contains("e-rule-list")&&0===e.target.children.length?e.target.classList.add("e-drag-rule-bottom-line"):e.target.classList.contains("e-rule-list")&&e.target.children[0].classList.contains("e-group-container")?(i=e.target.children[0].getBoundingClientRect(),(a=(n=e.event.clientY||e.event.changedTouches[0].clientY)-i.top)<(r=20)&&e.target.classList.add("e-drag-rule-top-line")):(z(e.target,".e-group-container")||e.target.classList.contains("e-group-container"))&&-1<(s=s||e.target).id.indexOf("group0")&&(i=e.target.getBoundingClientRect(),n=e.event.clientY||e.event.changedTouches[0].clientY,(o=i.bottom-n)<(r=20))&&e.target.classList.add("e-drag-rule-bottom-line"),a={dragRuleID:null!==t?t.id:null!==s?s.id:null,dragGroupID:null!==s?s.id:null,cancel:!1},this.trigger("drag",a),this.isDragEventPrevent=a.cancel))},yst.prototype.dragStopHandler=function(e){var t=this;if(!this.isDragEventPrevent){var i,n,o,r,s=z(e.target,".e-rule-container"),a=(je(s)&&e.target.parentElement&&e.target.parentElement.classList.contains("e-btn-group")&&this.enableSeparateConnector&&(s=z(e.target.parentElement.previousElementSibling,".e-rule-container")),(i=je(e.helper)?i:z(e.helper,".e-notallowedcur"))||(n=z(e.target,".e-group-container"),n={cancel:!1,dropRuleID:null!==s?s.id:null!==n?n.id:null,dropGroupID:null!==n?n.id:null},this.trigger("drop",n),n.cancel&&(i=!0),n=this.getValidRules()),this.prvtEvtTgrDaD=!0,this.enableSeparateConnector&&e.target.parentElement&&e.target.parentElement.classList.contains("e-btn-group")?e.target.parentElement.previousElementSibling:e.target);if(s&&!i){var l=s.id.split(this.element.id+"_")[1].split("_")[0];if(this.draggable.currentStateTarget.parentElement.classList.contains("e-rule-field")||this.draggable.currentStateTarget.parentElement.classList.contains("e-group-header")){var h,d=void 0;this.draggable.currentStateTarget.parentElement.classList.contains("e-group-header")?(d=this.getGroup(this.draggedRule),this.deleteGroup(z(this.draggedRule,".e-group-container"))):(d=this.getRule(this.draggedRule),this.deleteRule(this.draggedRule)),(h=Pe([],this.getGroup(s),[],!0)).properties&&(h=h.properties);(p=z(s,".e-group-container")).querySelectorAll(".e-group-container").forEach(function(e){t.element.querySelector("#"+e.id)&&t.deleteGroup(e)});for(var p,c=p.querySelectorAll(".e-rule-container"),u=[],g=void 0,m=0;m<c.length;m++)(c[m].classList.contains("e-drag-rule-top-line")||c[m].classList.contains("e-drag-rule-bottom-line"))&&(g=m),u.push(c[m].id.split(this.element.id+"_")[1]);this.deleteRules(u),s.classList.contains("e-drag-rule-top-line")?h.rules.splice(g,0,d):h.rules.splice(g+1,0,d),h.rules.forEach(function(e){t.enableSeparateConnector?e.rules?t.addGroups([e],l):t.addRules([e],l):e.condition?t.addGroups([e],l):t.addRules([e],l)})}}else a.classList.contains("e-rule-list")&&0===a.children.length&&!i?(r=(p=z(a,".e-group-container")).id.split(this.element.id+"_")[1].split("_")[0],d=void 0,this.draggable.currentStateTarget.parentElement.classList.contains("e-group-header")?(d=this.getGroup(this.draggedRule),this.deleteGroup(z(this.draggedRule,".e-group-container"))):(d=this.getRule(this.draggedRule),this.deleteRule(this.draggedRule)),this.enableSeparateConnector?d.rules?this.addGroups([d],r):this.addRules([d],r):d.condition?this.addGroups([d],r):this.addRules([d],r)):a.classList.contains("e-rule-list")&&a.children[0].classList.contains("e-group-container")&&!i?(o=(p=z(a,".e-group-container")).id.split(this.element.id+"_")[1].split("_")[0],d=void 0,this.draggable.currentStateTarget.parentElement.classList.contains("e-group-header")?(d=this.getGroup(this.draggedRule),this.deleteGroup(z(this.draggedRule,".e-group-container"))):(d=this.getRule(this.draggedRule),this.deleteRule(this.draggedRule)),(h=Pe([],this.getGroup(a),[],!0)).properties&&(h=h.properties),a.querySelectorAll(".e-group-container").forEach(function(e){t.element.querySelector("#"+e.id)&&t.deleteGroup(e)}),(c=p.querySelectorAll(".e-rule-container")).forEach(function(e){t.element.querySelector("#"+e.id)&&t.deleteRule(e)}),this.draggable.currentStateTarget.parentElement.classList.contains("e-group-header")?this.addGroups([d],o):this.addRules([d],o),h.rules.forEach(function(e){t.enableSeparateConnector?e.rules?t.addGroups([e],o):t.addRules([e],o):e.condition?t.addGroups([e],o):t.addRules([e],o)})):!z(e.target,".e-group-container")&&!e.target.classList.contains("e-group-container")||i||(d=void 0,"group0"===(r=(s=!(s=z(e.target,".e-group-container"))&&e.target.classList.contains("e-group-container")?e.target:s).id.split(this.element.id+"_")[1].split("_")[0])&&(this.draggable.currentStateTarget.parentElement.classList.contains("e-group-header")?(d=this.getGroup(this.draggedRule),this.deleteGroup(z(this.draggedRule,".e-group-container"))):(d=this.getRule(this.draggedRule),this.deleteRule(this.draggedRule)),this.enableSeparateConnector?d.rules?this.addGroups([d],r):this.addRules([d],r):d.condition?this.addGroups([d],r):this.addRules([d],r)));i||this.trigger("ruleChange",{previousRule:n,rule:this.getValidRules(),type:"drag-and-drop"}),this.prvtEvtTgrDaD=!1,document.body.classList.remove("e-prevent-select");a=this.element.querySelectorAll(".e-drag-rule-bottom-line");a.forEach(function(e){e.classList.remove("e-drag-rule-bottom-line")}),(a=this.element.querySelectorAll(".e-drag-rule-top-line")).forEach(function(e){e.classList.remove("e-drag-rule-top-line")}),(a=this.element.querySelectorAll(".e-qb-dragging-rule")).forEach(function(e){e.classList.remove("e-qb-dragging-rule")}),e.helper&&e.helper.classList.contains("e-cloneproperties")&&document.querySelector("."+e.helper.classList[0])&&ue(e.helper),this.enableSeparateConnector&&this.refresh()}},yst.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){return oo(t)}},yst.prototype.executeDataManager=function(e){var t=this,e=this.dataManager.executeQuery(e),i=new ll;e.then(function(e){e.actual&&e.actual.result?t.dataColl=e.actual.result:t.dataColl=e.result,t.initControl()}).catch(function(e){i.reject(e)})},yst.prototype.initControl=function(){this.initialize(),this.initWrapper(),this.wireEvents()},yst.prototype.wireEvents=function(){var e=this.getWrapper();E.add(e,"click",this.clickEventHandler,this),E.add(e,"focusout",this.focusEventHandler,this),E.add(e,"focusin",this.focusEventHandler,this),E.add(this.element,"keydown",this.keyBoardHandler,this),E.add(document,"keydown",this.keyBoardHandler,this)},yst.prototype.unWireEvents=function(){var e=this.getWrapper();E.remove(e,"click",this.clickEventHandler),E.remove(e,"focusout",this.focusEventHandler),E.remove(e,"focusin",this.focusEventHandler),E.remove(this.element,"keydown",this.keyBoardHandler),E.remove(document,"keydown",this.keyBoardHandler)},yst.prototype.getParentGroup=function(e,t){for(var i=e instanceof Element?this.levelColl[e.id]:this.levelColl[""+e],n=t?i.length-1:i.length,o=this.rule,r=0;r<n;r++)o=this.findGroupByIdx(i[r],o,0===r);return o},yst.prototype.deleteGroup=function(t){var i=this,e=t,n=("string"==typeof t?(n=this.element.id+"_"+t,t=document.getElementById(n),n):e.id).replace(this.element.id+"_","");"group0"!==n&&t&&(e={groupID:n,cancel:!1,type:"deleteGroup"},this.isImportRules||this.prvtEvtTgrDaD?this.deleteGroupSuccessCallBack(e,t):this.trigger("beforeChange",e,function(e){i.deleteGroupSuccessCallBack(e,t)}))},yst.prototype.deleteGroupSuccessCallBack=function(e,t){if(!e.cancel){for(var i=t,n=this.getParentGroup(i,!0),o=0,r=void 0,s=void 0,a=this.getValidRules(this.rule),l=i.nextElementSibling,h=i.previousElementSibling,d=i.querySelectorAll(".e-group-container"),p=i.querySelectorAll(".e-tooltip"),s=p.length,r=0;r<s;r++)At(p[r],"tooltip").destroy();for(r=0,s=d.length;r<s;r++)delete this.levelColl[d[r].id];for(;null!==i.previousElementSibling;)i=i.previousElementSibling,(!this.enableSeparateConnector||this.enableSeparateConnector&&(!this.headerTemplate&&!i.classList.contains("e-btn-group")||this.headerTemplate&&(i.classList.contains("e-rule-container")||i.classList.contains("e-group-container"))))&&o++;this.enableSeparateConnector||l&&-1<l.className.indexOf("e-separate-rule")&&(q([l],"e-separate-rule"),U([l],"e-joined-rule"),h)&&-1<h.className.indexOf("e-rule-container")&&U([h],"e-prev-joined-rule");var l=i.parentElement.parentElement.parentElement,c=[];if(this.isReact||this.isAngular){var u=n.rules[o],g=t.querySelectorAll(".e-rule-container");if(u&&u.rules)for(var m=0;m<u.rules.length;m++){var f,y=this.getColumn(u.rules[m].field);g[m]&&(f=g[m].querySelector(".e-template-value"),y)&&(y.ruleTemplate||this.isPlatformTemplate(y)&&f)&&c.push(g[m].id)}}G(t),this.headerTemplate&&this.clearQBTemplate([t.id]),c.length&&this.clearQBTemplate(c),n.rules.splice(o,1),delete this.levelColl[e.groupID],this.refreshLevelColl(),this.disableRuleCondition(l,n),this.enableSeparateConnector&&h&&(!this.headerTemplate&&h.classList.contains("e-btn-group")||this.headerTemplate&&h.classList.contains("e-custom-group-btn"))&&G(h),this.isImportRules||this.prvtEvtTgrDaD||this.trigger("change",e),this.filterRules(a,this.getValidRules(this.rule),"deleteGroup")}},yst.prototype.isPlatformTemplate=function(e){return e.template&&("string"==typeof e.template||void 0===e.template.create)},yst.prototype.deleteRule=function(t){var i=this,e={groupID:z(t,".e-group-container").id.replace(this.element.id+"_",""),ruleID:z(t,".e-rule-container").id.replace(this.element.id+"_",""),cancel:!1,type:"deleteRule"};this.isImportRules||this.prvtEvtTgrDaD?this.deleteRuleSuccessCallBack(e,t):this.trigger("beforeChange",e,function(e){i.deleteRuleSuccessCallBack(e,t)})},yst.prototype.deleteRuleSuccessCallBack=function(e,t){if(!e.cancel){for(var i=z(t,".e-group-container"),n=this.getParentGroup(i),o=z(t,".e-rule-container"),t=this.getValidRules(this.rule),r=o.previousElementSibling,s=0,a=o,l=o.nextElementSibling,h=o.querySelectorAll(".e-tooltip"),d=void 0,p=h.length,d=0;d<p;d++)At(h[d],"tooltip").destroy();for(;null!==o.previousElementSibling;)o=o.previousElementSibling,(!this.enableSeparateConnector||this.enableSeparateConnector&&(!this.headerTemplate&&!o.classList.contains("e-btn-group")||this.headerTemplate&&(o.classList.contains("e-rule-container")||o.classList.contains("e-group-container"))))&&s++;var c,u,g=this.getColumn(n.rules[s].field),l=(g&&g.template&&a.querySelector(".e-template")&&this.templateDestroy(g,a.querySelector(".e-template").id),(!r||r.className.indexOf("e-rule-container")<0)&&l&&q([l],"e-joined-rule"),(!l||l.className.indexOf("e-rule-container")<0)&&r&&q([r],"e-prev-joined-rule"),a.querySelector(".e-template-value"));try{this.enableSeparateConnector&&(a.previousElementSibling||a.nextElementSibling)&&(c=a.previousElementSibling,je(u=a.nextElementSibling)&&(!this.headerTemplate&&c.classList.contains("e-btn-group")||this.headerTemplate&&c.classList.contains("e-custom-group-btn"))?(c&&c.previousElementSibling&&c.previousElementSibling.classList.contains("e-rule-container")&&(this.getRule(c.previousElementSibling).condition=null),G(c)):(!this.headerTemplate&&u.classList.contains("e-btn-group")||this.headerTemplate&&u.classList.contains("e-custom-group-btn"))&&G(u)),G(a)}catch(e){return}g&&g.ruleTemplate&&this.clearQBTemplate([a.id]),g&&this.isPlatformTemplate(g)&&l&&this.clearQBTemplate([a.id]),n.rules.splice(s,1),n.rules[0]&&n.rules[0].rules||this.disableRuleCondition(i,n,!!this.enableSeparateConnector);for(var m=this.element.querySelectorAll(".e-tooltip"),f=0;f<m.length;f++)At(m[f],"tooltip").refresh(m[f]);this.isImportRules||this.prvtEvtTgrDaD||this.trigger("change",e),this.filterRules(t,this.getValidRules(this.rule),"deleteRule")}},yst.prototype.setGroupRules=function(e,t){this.headerTemplate&&t&&(this.isRoot=!0),this.reset(),this.groupIdCounter=1,this.ruleIdCounter=0,this.isImportRules=!0,this.setProperties({rule:e},!0),e=this.getRuleCollection(this.rule,!1),this.importRules(this.rule,this.element.querySelector(".e-group-container"),!0,this.rule.not,t),e.isLocked&&(t=this.element.querySelector(".e-group-container").querySelector(".e-lock-grp-btn"),this.groupLock(t)),this.isImportRules=!1},yst.prototype.keyBoardHandler=function(e){var t;e.currentTarget!==this.element||!this.readonly||38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode?"Escape"===e.code&&this.allowDragAndDrop&&(this.isDragEventPrevent=!0,document.body.classList.remove("e-prevent-select"),this.element.querySelectorAll(".e-drag-rule-bottom-line").forEach(function(e){e.classList.remove("e-drag-rule-bottom-line")}),this.element.querySelectorAll(".e-drag-rule-top-line").forEach(function(e){e.classList.remove("e-drag-rule-top-line")}),this.element.querySelectorAll(".e-qb-dragging-rule").forEach(function(e){e.classList.remove("e-qb-dragging-rule")}),(t=this.element.querySelector(".e-cloneproperties"))&&ue(t),this.enableSeparateConnector)&&this.refresh():e.preventDefault()},yst.prototype.clearQBTemplate=function(e){(this.isReact||this.isAngular)&&this.clearTemplate(e)},yst.prototype.disableRuleCondition=function(e,t,i,n){if(!this.headerTemplate&&!this.readonly){var o=e.querySelector(".e-rule-list").childElementCount,r=e.querySelector(".e-btngroup-and"),s=e.querySelector(".e-btngroup-or");if(1<o)if(r.disabled=!1,s.disabled=!1,(s.nextElementSibling.classList.contains("e-btn-disable")||r.nextElementSibling.classList.contains("e-btn-disable"))&&(s.nextElementSibling.classList.remove("e-btn-disable"),r.nextElementSibling.classList.remove("e-btn-disable")),this.enableSeparateConnector&&!i){for(var a=0,l=void 0;;){var h=e.parentElement.querySelectorAll(".e-btngroup-and"),d=e.parentElement.querySelectorAll(".e-btngroup-or"),r=h[h.length-(1+a)],s=d[d.length-(1+a)];if(!(l=h[h.length-(1+a)])||!l.parentElement||"none"!==l.parentElement.style.display)break;a++}for(var p=e.previousElementSibling;p&&!p.classList.contains("e-rule-container");){if(p.classList.contains("e-group-container")){p=p.querySelectorAll(".e-rule-container")[p.querySelectorAll(".e-rule-container").length-1];break}p=p.previousElementSibling}n&&e.classList.contains("e-group-container")?"or"===this.getGroup(p=e).condition?s.checked=!0:r.checked=!0:p&&p.classList.contains("e-rule-container")&&(c=p.id.replace(this.element.id+"_",""),"or"===this.getRule(c).condition?s.checked=!0:r.checked=!0)}else i||(t&&"or"===t.condition?s.checked=!0:r.checked=!0);else if(this.enableSeparateConnector&&!i){for(a=0,l=void 0;;){h=e.parentElement.querySelectorAll(".e-btngroup-and"),d=e.parentElement.querySelectorAll(".e-btngroup-or");if(r=h[h.length-(1+a)],s=d[d.length-(1+a)],!(l=h[h.length-(1+a)])||!l.parentElement||"none"!==l.parentElement.style.display)break;a++}for(var c,p=void 0,u=e.previousElementSibling;u;){if((u=u.classList.contains("e-group-container")?u.querySelectorAll(".e-rule-container")[u.querySelectorAll(".e-rule-container").length-1]:u).classList.contains("e-rule-container")){p=u;break}u=u.previousElementSibling}je(p)&&e.querySelectorAll(".e-rule-container")[e.querySelectorAll(".e-rule-container").length-1]&&(p=e.querySelectorAll(".e-rule-container")[e.querySelectorAll(".e-rule-container").length-1]),n&&e.classList.contains("e-group-container")?"or"===this.getGroup(p=e).condition?s.checked=!0:r.checked=!0:p&&(c=p.id.replace(this.element.id+"_",""),"or"===this.getRule(c).condition&&s?s.checked=!0:r&&(r.checked=!0))}else i||je(r)||(r.checked=!1,r.disabled=!0,s.checked=!1,s.disabled=!0,t&&(s.nextElementSibling.classList.add("e-btn-disable"),r.nextElementSibling.classList.add("e-btn-disable")))}},yst.prototype.getValidRules=function(e){this.isValueEmpty=!0;var t=(e=e||this.getRules()).condition,i=e.not,n=Pe([],e.rules,[],!0),t=je(e.isLocked)?this.getRuleCollection({condition:t,rules:n,not:i},!0):this.getRuleCollection({condition:t,rules:n,not:i,isLocked:e.isLocked},!0);return this.isValueEmpty=!1,t},yst.prototype.getRuleCollection=function(e,t){if(je(e))return null;var i;if(e.rules&&e.rules.length&&(6<Object.keys(e.rules[0]).length||t))for(var n=e.rules.length,o=0;o<n;o++)i=e.rules[o],i=this.getRuleCollection(i,t),e.rules[o]=i,Object.keys(i).length<1&&t&&(e.rules.splice(o,1),o--,n--);var r,s,a=e.custom;return e.field&&""!==e.field&&(je(a)||a&&"question"!==a.type&&"answer"!==a.type)?(e.operator&&(-1<e.operator.toString().indexOf("null")||-1<e.operator.toString().indexOf("empty"))&&(e.value=null),(this.isRefreshed&&this.enablePersistence||""!==e.field&&""!==e.operator&&(!this.isValueEmpty||""!==e.value)&&void 0!==e.value||a&&a.isQuestion)&&(s=e.condition,r=e.isLocked,e={label:e.label,field:e.field,operator:e.operator,type:e.type,value:e.value},je(r)||(e.isLocked=r),s&&(e.condition=s),a&&(e.custom=a),"between"!==(e="in"!==e.operator&&"notin"!==e.operator||!e.value||0!==e.value.length?e:{}).operator&&"notbetween"!==e.operator||!Array.isArray(e.value)||!(e.value.length<2||e.value.some(function(e){return""===e||null===e})))||(e={})):!a||"question"!==a.type&&"answer"!==a.type?(je(e.condition)&&je(e.rules)||(r=e.isLocked,e=this.enableNotCondition?{condition:e.condition,rules:e.rules,not:e.not}:{condition:e.condition,rules:e.rules},je(r)||(e.isLocked=r),a&&(e.custom=a),e.rules&&0===e.rules.length))&&(e={}):(s=e.not,(e={label:e.label,field:e.field,operator:e.operator,type:e.type,value:e.value,condition:e.condition,rules:e.rules}).custom=a,this.enableNotCondition&&(e.not=s)),e},yst.prototype.setRules=function(e){e=Pe({},e,{},!0);this.headerTemplate?this.setGroupRules(e,!0):this.setGroupRules(e)},yst.prototype.getRules=function(){var e=this.enableNotCondition?{condition:this.rule.condition,rules:this.rule.rules,not:this.rule.not}:{condition:this.rule.condition,rules:this.rule.rules};return je(this.rule.isLocked)||(e.isLocked=this.rule.isLocked),this.rule.custom&&(e.custom=this.rule.custom),e},yst.prototype.getRule=function(e){var t=0,i=e instanceof HTMLElement?z(e,".e-rule-container"):(e=this.element.id+"_"+e,document.getElementById(e));if(je(i))return null;for(e=z(i,".e-group-container"),e=this.getParentGroup(e);null!==i.previousElementSibling;)i=i.previousElementSibling,(!this.enableSeparateConnector||this.enableSeparateConnector&&(!this.headerTemplate&&!i.classList.contains("e-btn-group")||this.headerTemplate&&(i.classList.contains("e-rule-container")||i.classList.contains("e-group-container"))))&&t++;return e.rules[t]},yst.prototype.getGroup=function(e){e=(e=e instanceof Element&&e.className.indexOf("e-group-container")<1?z(e,".e-group-container"):e)instanceof Element?e.id:this.element.id+"_"+e;return this.getParentGroup(e)},yst.prototype.deleteGroups=function(e){for(var t,i=e.length,n=0;n<i;n++)"group0"!==e[n]&&(t=this.element.id+"_"+e[n],this.deleteGroup(document.getElementById(t)))},yst.prototype.getFilteredRecords=function(){var e=this.getPredicate(this.getValidRules(this.rule)),e=je(e)?new ya:(new ya).where(e);return this.dataManager.executeQuery(e)},yst.prototype.deleteRules=function(e){for(var t,i=e.length,n=0;n<i;n++)t=this.element.id+"_"+e[n],this.deleteRule(document.getElementById(t))},yst.prototype.getDataManagerQuery=function(e){for(var t=this.getPredicate(e),i=[],n=0,o=Object.keys(this.columns);n<o.length;n++)i.push(this.columns[n].field);return e.rules.length?(new ya).select(i).where(t):(new ya).select(i)},yst.prototype.getPredicate=function(e){var t,i,n=e.rules,o=!1;if(n){for(var r=0,s=n.length;r<s;r++){var a=n[r].operator;"notstartswith"===a?a="doesnotstartwith":"notendswith"===a?a="doesnotendwith":"notcontains"===a&&(a="doesnotcontain");var l,h,d,p,c,o=!1;-1<Object.keys(n[r]).indexOf("rules")&&n[r].rules?(l=this.getPredicate(n[r]))&&(t=t?"and"===e.condition?t.and(l):t.or(l):l):je(a)||je(a.length)||(l=n[r].operator.toLowerCase(),h=!1,d=["equal","notequal","greaterthan","greaterthanorequal","lessthan","lessthanorequal"],"string"===n[r].type&&(o=!this.matchCase),"date"===n[r].type&&-1<d.indexOf(l)&&(o=!0),p=this.getColumn(n[r].field),-1<l.indexOf("null")||-1<l.indexOf("empty")?n[r].value=null:"date"!==n[r].type||n[r].value instanceof Array?i=n[r].value:(p=this.getFormat(p.format),je(n[r].value)?i=null:(i=this.getDate(n[r].value,p),-1<d.indexOf(l)&&!this.isTime(n[r].value)&&(h=!0))),0===r?h||(-1<l.indexOf("in")||-1<l.indexOf("between")||-1<l.indexOf("null")||-1<l.indexOf("empty"))&&l.indexOf("contain")<0?t=h?this.datePredicate(n[r],i):this.arrayPredicate(n[r]):""!==(c=i)&&(t=new ba(n[r].field,a,i,o)):h||(-1<l.indexOf("in")||-1<l.indexOf("between")||-1<l.indexOf("null")||-1<l.indexOf("empty"))&&l.indexOf("contain")<0?t=h?this.datePredicate(n[r],i,t,e.condition):this.arrayPredicate(n[r],t,e.condition):"and"===e.condition?(c=i,t&&""!==c?t=t.and(n[r].field,a,i,o):""!==c&&(t=new ba(n[r].field,a,i,o))):(c=i,t&&""!==c?t=t.or(n[r].field,a,i,o):""!==c&&(t=new ba(n[r].field,a,i,o))))}this.dataSource instanceof me&&(je(t)||"isnull"!==t.operator&&"isnotnull"!==t.operator||(t.operator="isnull"===t.operator?"equal":"notequal"))}return t},yst.prototype.getLocale=function(){var e=this.locale;return e=R("main."+this.locale+".dates.calendars.gregorian.days.format.short",Ai)?e:"en"},yst.prototype.getColumn=function(e,t){for(var i,n=this.columns,o=0,r=(n=t||n).length;o<r;o++){if(n[o].field===e){i=n[o];break}if(n[o].columns){if(i=this.getColumn(e,n[o].columns))break}else if(e&&-1<e.indexOf(this.separator)&&""!==this.separator&&n[o].field===e.split(this.separator)[0]){i=n[o];break}}return i},yst.prototype.getOperators=function(e){return this.getColumn(e).operators},yst.prototype.setTime=function(e,t){return t?e.setHours(0,0,0):e.setHours(23,59,59),e},yst.prototype.datePredicate=function(e,t,i,n){var o,r=this.setTime(new Date(t.getTime()),!0),s=this.setTime(t);switch(e.operator){case"equal":o=(o=new ba(e.field,"greaterthanorequal",r)).and(e.field,"lessthanorequal",s);break;case"notequal":o=(o=new ba(e.field,"lessthan",r)).or(e.field,"greaterthan",s);break;case"greaterthan":o=new ba(e.field,"greaterthan",s);break;case"greaterthanorequal":o=new ba(e.field,"greaterthanorequal",r);break;case"lessthan":o=new ba(e.field,"lessthan",r);break;case"lessthanorequal":o=new ba(e.field,"lessthanorequal",s)}return o&&(i?"and"===n?i=i.and(o):"or"===n&&(i=i.or(o)):i=o),i},yst.prototype.arrayPredicate=function(e,t,i){var n,o=e.value,r=e.operator.toString(),s=e.value,a=this.getColumn(e.field),l=this.getFormat(a.format);if(-1<r.indexOf("null")||-1<r.indexOf("empty"))switch(r){case"isnull":n=new ba(e.field,"isnull",s);break;case"isnotnull":n=new ba(e.field,"isnotnull",s);break;case"isempty":n=new ba(e.field,"equal","");break;case"isnotempty":n=new ba(e.field,"notequal","")}if(!(-1<r.indexOf("null")||-1<r.indexOf("empty")))for(var h=0,d=o.length;h<d;h++)if(""!==o[h]||("in"===r||"notin"===r)&&"string"===a.type)if(0===h){var p="greaterthanorequal";switch(r){case"between":n="date"!==a.type?new ba(e.field,p,o[h]):new ba(e.field,p,o[h]?this.isTime(o[h])?this.getDate(o[h],l):this.setTime(this.getDate(o[h],l),!0):null);break;case"notbetween":n="date"===a.type?new ba(e.field,"lessthan",o[h]?this.isTime(o[h])?this.getDate(o[h],l):this.setTime(this.getDate(o[h],l),!0):null):new ba(e.field,"lessthan",o[h]);break;case"in":n=new ba(e.field,"equal",o[h]);break;case"notin":n=new ba(e.field,"notequal",o[h])}}else switch(e.operator){case"between":n="date"===a.type?n.and(e.field,"lessthanorequal",o[h]&&(this.isTime(o[h])?this.getDate(o[h],l):this.setTime(this.getDate(o[h],l)))):n.and(e.field,"lessthanorequal",o[h]);break;case"notbetween":n="date"===a.type?n.or(e.field,"greaterthan",o[h]&&(this.isTime(o[h])?this.getDate(o[h],l):this.setTime(this.getDate(o[h],l)))):n.or(e.field,"greaterthan",o[h]);break;case"in":n=n.or(e.field,"equal",o[h]);break;case"notin":n=n.and(e.field,"notequal",o[h])}return n&&(t?"and"===i?t=t.and(n):"or"===i&&(t=t.or(n)):t=n),t},yst.prototype.getDate=function(e,t){t=this.intl.parseDate(e,t);return-1<e.indexOf(":")&&e.indexOf("/")<0&&e.indexOf(",")<0&&e.indexOf("-")<0&&((t=new Date).setHours(parseInt(e.split(":")[0],10)),t.setMinutes(parseInt(e.split(":")[1],10)),e.split(":")[2])&&t.setSeconds(parseInt(e.split(":")[2],10)),t},yst.prototype.isTime=function(e){return!!(e&&-1<e.indexOf(":"))},yst.prototype.importRules=function(e,t,i,n,o){if(i){if(e.rules&&1<e.rules.length&&!this.headerTemplate){var i=t.querySelector(".e-btngroup-or"),r=t.querySelector(".e-btngroup-and");if(this.enableSeparateConnector&&t.previousElementSibling&&(i=t.previousElementSibling.querySelector(".e-btngroup-or"),r=t.previousElementSibling.querySelector(".e-btngroup-and")),i.disabled=!1,r.disabled=!1,this.enableSeparateConnector){for(var s=t.previousElementSibling;s&&!s.classList.contains("e-rule-container");){if(s.classList.contains("e-group-container")){s=s.querySelectorAll(".e-rule-container")[s.querySelectorAll(".e-rule-container").length-1];break}s=s.previousElementSibling}s&&s.classList.contains("e-rule-container")&&(a=s.id.replace(this.element.id+"_",""),"or"===this.getRule(a).condition?i.checked=!0:r.checked=!0)}else"or"===e.condition?i.checked=!0:r.checked=!0}else this.disableRuleCondition(t);var a;this.headerTemplate&&o&&(t=this.renderGroup(e,e.condition,this.element,e.not,o)),this.enableNotCondition&&!this.headerTemplate&&(a=t.querySelector(".e-qb-toggle"),(e.not?U:q)([a],"e-active-toggle"))}else t=this.renderGroup(e,e.condition,t,n);e.rules&&0===e.rules.length&&this.headerTemplate&&(e.rules[0]={label:"",field:"",operator:"",type:"",value:""});var l=e.rules;if(!je(l))for(var h=0,d=l.length;h<d;h++){var p=Object.keys(l[h]);if(!je(l[h].rules)&&-1<p.indexOf("rules")&&0!==l[h].rules.length){if(this.element.querySelectorAll(".e-group-container").length>this.maxGroupCount)return null;t=this.renderGroup(l[h],l[h].condition,t,l[h].not),t=this.importRules(l[h],t,!0)}else this.renderRule(l[h],t);!je(l[h].rules)&&l[h].isLocked&&(p=t.querySelector(".e-rule-list").children[h].querySelector(".e-lock-grp-btn"),this.groupLock(p))}return t=(t=t&&z(t,".e-rule-list"))&&z(t,".e-group-container")},yst.prototype.renderGroup=function(e,t,i,n,o){this.addGroupElement(!0,i,t,!1,n,o,e);var t=i.querySelectorAll(".e-group-container"),r=i.querySelector(".e-rule-list").children;if(this.showButtons.cloneGroup&&this.cloneGrpBtnClick&&this.isMiddleGroup){this.isMiddleGroup=!1,this.cloneGrpBtnClick=!1;var s=0,a=this.groupIndex+1;if(this.enableSeparateConnector)for(var l=0;l<a;l++)r[l].classList.contains("e-rule-container")&&(a++,s++);return r[this.groupIndex+s+1]}return this.showButtons.cloneGroup&&this.cloneGrpBtnClick&&this.isLastGroup?(this.isLastGroup=!1,this.cloneGrpBtnClick=!1,r[r.length-1]):t[t.length-1]},yst.prototype.renderRule=function(e,t){-1<t.className.indexOf("e-group-container")?this.addRuleElement(t,e):this.addRuleElement(t.querySelector(".e-group-container"),e)},yst.prototype.enableReadonly=function(){for(var e=this.element.querySelectorAll(".e-dropdownlist, .e-dropdowntree, .e-numerictextbox, .e-textbox, .e-datepicker, .e-multiselect .e-lib, .e-radio"),t=0;t<e.length;t++)e[t].classList.contains("e-dropdownlist")?K(e[t],qz).readonly=this.isReadonly:e[t].classList.contains("e-dropdowntree")?At(e[t],"dropdowntree").readonly=this.isReadonly:e[t].classList.contains("e-numerictextbox")?K(e[t],NL).readonly=this.isReadonly:e[t].classList.contains("e-textbox")?K(e[t],fV).readonly=this.isReadonly:e[t].classList.contains("e-datepicker")?K(e[t],o9).readonly=this.isReadonly:e[t].classList.contains("e-multiselect")?K(e[t],zU).readonly=this.isReadonly:e[t].classList.contains("e-radio")&&!K(e[t],cb).checked&&(this.isReadonly?e[t].parentElement.style.display="none":e[t].parentElement.style.display="inherit");for(var i=this.element.querySelectorAll(".e-deletegroup"),n=this.element.querySelectorAll(".e-addrulegroup"),o=this.element.querySelectorAll(".e-removerule"),r=(!this.isReadonly&&this.ruleElem.classList.contains("e-readonly")&&this.ruleElem.classList.remove("e-readonly"),[i,n,o]),t=0;t<r.length;t++)r[t].forEach(function(e){e.classList.contains("e-readonly")?e.classList.remove("e-readonly"):e.classList.add("e-readonly")});this.enableBtnGroup()},yst.prototype.enableBtnGroup=function(){var t=this,e=this.element.querySelectorAll(".e-btngroup-and-lbl, .e-btngroup-or-lbl, .e-qb-toggle"),i=!1;e.forEach(function(e){!e.classList.contains("e-qb-toggle")||e.classList.contains("e-active-toggle")||e.classList.contains("e-readonly")?e.classList.contains("e-qb-toggle")&&e.classList.contains("e-not-readonly")?e.classList.remove("e-not-readonly"):e.classList.contains("e-qb-toggle")&&e.classList.contains("e-readonly")?e.classList.remove("e-readonly"):e.classList.contains("e-active-toggle")?(e.classList.add("e-not-readonly"),i=!0):e.previousElementSibling.checked||e.classList.contains("e-readonly")?(e.classList.remove("e-readonly"),i?"AND"===e.textContent?e.classList.add("e-readonly-and"):e.classList.add("e-readonly-or"):("AND"===e.textContent&&t.isReadonly?(e.classList.remove("e-not"),e.classList.add("e-readonly-and")):(t.enableNotCondition&&e.classList.add("e-not"),e.classList.remove("e-readonly-and")),"OR"===e.textContent&&t.isReadonly?e.classList.add("e-readonly-or-not"):e.classList.remove("e-readonly-or-not"))):e.classList.contains("e-btn-disable")||e.classList.add("e-readonly"):(e.classList.add("e-readonly"),i=!1)})},yst.prototype.isDateFunction=function(e){for(var t=["date","time","day","week","month","year","hour","minute","second","now","quarter","period","extract"],i=0,n=t.length;i<n;i++)if(-1<e.toLowerCase().indexOf(t[i]))return!0;return!1},yst.prototype.getSqlString=function(e,t,i,n){var o=!1,r=(i||""===i?i+="(":o=!(i=""),e.condition);if(e.not&&(i+=o?n?this.l10n.getConstant("NOT").toUpperCase()+" (":"NOT (":n?" "+this.l10n.getConstant("NOT").toUpperCase()+" (":" NOT ("),e.rules)for(var s=0,a=e.rules.length;s<a;s++){if(e.rules[s].rules)i=this.getSqlString(e.rules[s],t,i,n),this.enableSeparateConnector&&(r=e.rules[s].condition);else{var l=e.rules[s],h="",d=(n?this.sqlOperators:this.operators)[l.operator];if(l.value instanceof Array)if(-1<l.operator.toString().indexOf("between")){var p=n?" "+this.l10n.getConstant("AND").toUpperCase()+" ":" AND ";"date"!==l.type||this.isDateFunction(l.value[0])?h+=l.value[0]+p+l.value[1]:h+='"'+l.value[0]+'"'+p+'"'+l.value[1]+'"'}else if("string"==typeof l.value[0]&&null!==l.value){h+='("'+l.value[0]+'"';for(var c=1,u=l.value.length;c<u;c++)h+=',"'+l.value[c]+'"';h+=")"}else h+="("+l.value+")";else-1<l.operator.toString().indexOf("startswith")?h+=l.value?'("'+l.value+'%")':"("+l.value+")":-1<l.operator.toString().indexOf("endswith")?h+=l.value?'("%'+l.value+'")':"("+l.value+")":-1<l.operator.toString().indexOf("contains")?h+=l.value?'("%'+l.value+'%")':"("+l.value+")":"number"===l.type||"boolean"==typeof l.value||null===l.value&&l.operator.toString().indexOf("empty")<-1?h+=l.value:-1<l.operator.toString().indexOf("empty")?h+='""':h+='"'+l.value+'"';-1<l.operator.toString().indexOf("null")?(t?l.field="`"+l.field+"`":-1<l.field.indexOf(" ")&&(l.field='"'+l.field+'"'),i+=l.field+" "+d):(p=d,"isempty"===l.operator?p="=":"isnotempty"===l.operator&&(p="!="),t?l.field="`"+l.field+"`":-1<l.field.indexOf(" ")&&(l.field='"'+l.field+'"'),i+=l.field+" "+p+" "+h),l.condition&&""!==l.condition&&(r=l.condition)}s!==a-1&&(l=e.rules[s],r=""===r||l&&""!==l.condition&&l.custom&&l.custom.isCustom?l.condition:r)&&(i+=" "+(r=(n?this.l10n.getConstant(r.toUpperCase()):r).toUpperCase())+" ")}return o||(i+=")"),e.not&&(i+=")"),i},yst.prototype.setRulesFromSql=function(e,t){e=e.replace(/`/g,"");e=this.getRulesFromSql(e,t);this.setRules({condition:e.condition,not:e.not,rules:e.rules})},yst.prototype.getRulesFromSql=function(e,t){this.parser=[],this.sqlParser(e,t),this.setProperties({rule:{condition:"and",not:!1,rules:[]}},!0);e=this.processParser(this.parser,this.rule,[0],t);return this.enableNotCondition?{condition:e.condition,not:e.not,rules:e.rules}:{condition:e.condition,rules:e.rules}},yst.prototype.getSqlFromRules=function(e,t,i){return e=e||this.getValidRules(),e=this.getRuleCollection(e,!1),this.getSqlString(this.getValidRules(e),t,null,i).replace(/"/g,"'")},yst.prototype.getParameterizedSql=function(e){var t;return this.moduleLoader.loadedModules.length?(e=e||this.getValidRules(),this.notify("query-library",{prop:"getParameterSql",onPropertyChange:!(t={sql:null}),value:{rule:e,obj:t}}),t.sql):(console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.'),null)},yst.prototype.setParameterizedSql=function(e){var t;this.moduleLoader.loadedModules.length?(this.notify("query-library",{prop:"convertParamSqlToSql",onPropertyChange:!(t={sql:null}),value:{sql:e,obj:t}}),(e=t.sql)&&(e=e.replace(/`/g,""),t=this.getRulesFromSql(e),this.setRules({condition:t.condition,not:t.not,rules:t.rules}))):console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.')},yst.prototype.getParameterizedNamedSql=function(e){var t;return this.moduleLoader.loadedModules.length?(e=e||this.getValidRules(),this.notify("query-library",{prop:"getNamedParameterSql",onPropertyChange:!(t={sql:null}),value:{rule:e,obj:t}}),t.sql):(console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.'),null)},yst.prototype.setParameterizedNamedSql=function(e){var t;this.moduleLoader.loadedModules.length?(this.notify("query-library",{prop:"convertNamedParamSqlToSql",onPropertyChange:!(t={sql:null}),value:{sql:e,obj:t}}),(e=t.sql)&&(e=e.replace(/`/g,""),t=this.getRulesFromSql(e),this.setRules({condition:t.condition,not:t.not,rules:t.rules}))):console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.')},yst.prototype.setMongoQuery=function(e,t){this.moduleLoader.loadedModules.length?(this.rule={condition:"and",not:!1,rules:[]},this.notify("query-library",{prop:"mongoParser",onPropertyChange:!1,value:{mongoQuery:JSON.parse(e),rule:this.rule,mongoLocale:t}})):console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.')},yst.prototype.getMongoQuery=function(e){var t;return this.moduleLoader.loadedModules.length?(e=e||this.getValidRules(),this.notify("query-library",{prop:"getMongoFromRules",onPropertyChange:!(t={mongoQuery:null}),value:{rule:e,mongoQuery:"",obj:t}}),t.mongoQuery):(console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.'),"")},yst.prototype.cloneRule=function(e,t,i){var e=this.getRule(e.replace(this.element.id+"_","")),n=this.showButtons.cloneRule;t=t.replace(this.element.id+"_",""),this.ruleIndex=i,this.cloneRuleBtnClick=!0,this.showButtons.cloneRule=!0,this.addRules([{label:e.label,field:e.field,type:e.type,operator:e.operator,value:e.value,condition:e.condition}],t),this.ruleIndex=-1,this.cloneRuleBtnClick=!1,this.showButtons.cloneRule=n},yst.prototype.cloneGroup=function(e,t,i){t=t.replace(this.element.id+"_","");var t=this.getGroup(t),n=this.showButtons.cloneGroup;e=e.replace(this.element.id+"_",""),this.groupIndex=i,this.cloneGrpBtnClick=!0,this.showButtons.cloneGroup=!0,this.addGroups([{condition:t.condition,not:t.not,rules:t.rules}],e),this.groupIndex=-1,this.cloneGrpBtnClick=!1,this.showButtons.cloneGroup=n},yst.prototype.lockRule=function(e){e.indexOf(this.element.id)<0&&(e=this.element.id+"_"+e);e=document.getElementById(e).querySelectorAll(".e-lock-rule-btn")[0];this.ruleLock(e)},yst.prototype.lockGroup=function(e){e.indexOf(this.element.id)<0&&(e=this.element.id+"_"+e);e=document.getElementById(e).querySelectorAll(".e-lock-grp-btn")[0];this.groupLock(e)},yst.prototype.sqlParser=function(e,t){for(var i,n=0;i=e.slice(n),n+=this.parseSqlStrings(i,t),""!==i;);return this.parser},yst.prototype.parseSqlStrings=function(e,t){for(var i,n=["=","!=","<=",">=","<",">"],o=t?[this.l10n.getConstant("AND").toUpperCase(),this.l10n.getConstant("OR").toUpperCase(),this.l10n.getConstant("NOT").toUpperCase()]:["AND","OR","NOT"],r=t?[this.l10n.getConstant("In").toUpperCase(),this.l10n.getConstant("NotIn").toUpperCase(),this.l10n.getConstant("Like").toUpperCase(),this.l10n.getConstant("NotLike").toUpperCase(),this.l10n.getConstant("Between").toUpperCase(),this.l10n.getConstant("NotBetween").toUpperCase(),this.l10n.getConstant("IsNull").toUpperCase(),this.l10n.getConstant("IsNotNull").toUpperCase(),this.l10n.getConstant("IsEmpty").toUpperCase(),this.l10n.getConstant("IsNotEmpty").toUpperCase()]:["IN","NOT IN","LIKE","NOT LIKE","BETWEEN","NOT BETWEEN","IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"],s=0,a=n.length;s<a;s++){var l=/^\w+$/.test(n[s])?"\\b":"";if(new RegExp("^("+n[s]+")"+l,"ig").exec(e))return this.parser.push(["Operators",n[s].toLowerCase()]),n[s].length}var h=this.parser[this.parser.length-1];if(!h||"Literal"!==h[0])for(s=0,a=o.length;s<a;s++)if(l=/^\w+$/.test(o[s])?"\\b":"",new RegExp("^("+o[s]+")"+l,"ig").exec(e))return this.parser.push(["Conditions",o[s].toLowerCase()]),o[s].length;for(s=0,a=r.length;s<a;s++)if(l=/^\w+$/.test(r[s])?"\\b":"",new RegExp("^("+r[s]+")"+l,"ig").exec(e))return this.parser.push(["SubOperators",r[s].toLowerCase()]),r[s].length;if(/^\(/.exec(e))return this.parser.push(["Left","("]),1;if(/^\)/.exec(e))return this.parser.push(["Right",")"]),1;if(/^(true|false)/.exec(e))return i=/^(true|false)/.exec(e)[0],this.parser.push(["String",i]),i.length;if(/^null/.exec(e))return i=/^null/.exec(e)[0],this.parser.push(["String",null]),i.length;if(/^`?([a-z_][a-z0-9_.\\[\]\\(\\)]{0,}(\\:(number|float|string|date|boolean))?)`?/i.exec(e))return i=/^`?([a-z_][a-z0-9_.\\[\]\\(\\)]{0,}(\\:(number|float|string|date|boolean))?)`?/i.exec(e)[1],this.parser.push(["Literal",i]),i.length;if(this.checkLiteral()&&/^'?([a-z_][a-z0-9 _.\\[\]\\(\\)-]{0,}(\\:(number|float|string|date|boolean))?)'?/i.exec(e))return i=/^'?([a-z_][a-z0-9 _.\\[\]\\(\\)-]{0,}(\\:(number|float|string|date|boolean))?)'?/i.exec(e)[1],this.parser.push(["Literal",i]),i.length+2;if(this.checkNumberLiteral(e,t)){h=/^[0-9]+(\.[0-9]+)$/.exec(e);if(h)return i=h[0],this.parser.push(["Literal",i]),i.length}t=this.getSingleQuoteString(e);if(""!==t){if("("===(i=t)[i.length-2])for(var d=!1,p=i.length;p<e.length&&(i+=e[p],!(d=")"===e[p]||d)||"'"!==e[p]);p++);else e[i.length]&&")"!==e[i.length]&&!this.checkCondition(e,i)&&(i=this.combineSingleQuoteString(e,i));return this.parser.push(["String",i]),i.length}h=this.getDoubleQuoteString(e);return""!==h?(this.parser.push(["DoubleString",i=h]),i.length):/^\d*\.?\d+/.exec(e)?(i=/^\d*\.?\d+/.exec(e)[0],this.parser.push(["Number",i]),i.length):/^-?\d*\.?\d+/.exec(e)?(i=/^-?\d*\.?\d+/.exec(e)[0],this.parser.push(["Number",i]),i.length):1},yst.prototype.getDoubleQuoteString=function(e){var t=e.indexOf('"');if(0===t){var i=e.indexOf('"',t+1);if(-1!==i)return e.substring(t,i+1)}return""},yst.prototype.checkCondition=function(e,t){return"AND"===e.slice(t.length+1,t.length+4)||"OR"===e.slice(t.length+1,t.length+3)},yst.prototype.getSingleQuoteString=function(e,t){var i=e.indexOf("'");if(-1!==i&&t||0===i&&!t){t=e.indexOf("'",i+1);if(-1!==t)return e.substring(i,t+1)}return""},yst.prototype.combineSingleQuoteString=function(e,t){var i;return e[t.length]&&")"!==e[t.length]&&!this.checkCondition(e,t)&&","!==e[t.length]&&(i=t.substring(0,t.length-1),i=e.replace(i,""),""!==(i=this.getSingleQuoteString(i,!0)))&&(i=i.substring(1,i.length),t=this.combineSingleQuoteString(e,t+=i)),t},yst.prototype.checkLiteral=function(){var e,t,i=this.parser[this.parser.length-1];return!(i&&(e=this.parser[this.parser.length-2],t=this.parser[this.parser.length-3],"Left"!==i[0]||!e||"Conditions"!==e[0]))||!!("Conditions"===i[0]&&t&&t[1].indexOf("between")<0)},yst.prototype.checkNumberLiteral=function(e,t){var i=this.parser[this.parser.length-1];if(!i)return!0;if(/^[0-9]+(?:\.[0-9]+)$/.exec(e)){var e=this.parser[this.parser.length-2],n=this.parser[this.parser.length-3];if("Left"===i[0]&&e&&"Conditions"===e[0])return!0;e=t?this.l10n.getConstant("Between").toLowerCase():"between";if("Conditions"===i[0]&&n&&n[1].indexOf(e)<0)return!0}return!1},yst.prototype.getOperator=function(e,t,i){if(i){for(var n=Object.keys(this.sqlOperators),o=0;o<n.length;o++)if(this.sqlOperators[n[o]]===t.toUpperCase())return e&&0===e.indexOf("%")&&"%"===e[e.length-1]?"NOT LIKE"===t.toUpperCase()?"notcontains":"contains":e&&0!==e.indexOf("%")&&e.indexOf("%")===e.length-1?"NOT LIKE"===t.toUpperCase()?"notstartswith":"startswith":e&&0===e.indexOf("%")&&e.indexOf("%")!==e.length-1?"NOT LIKE"===t.toUpperCase()?"notendswith":"endswith":n[o];return null}if(e){if(0===e.indexOf("%")&&"%"===e[e.length-1])return"not like"===t?"notcontains":"contains";if(0!==e.indexOf("%")&&e.indexOf("%")===e.length-1)return"not like"===t?"notstartswith":"startswith";if(0===e.indexOf("%")&&e.indexOf("%")!==e.length-1)return"not like"===t?"notendswith":"endswith"}else{if("not like"===t)return"notequal";if("like"===t)return"equal"}return{"=":"equal","!=":"notequal","<":"lessthan",">":"greaterthan","<=":"lessthanorequal",">=":"greaterthanorequal",in:"in","not in":"notin",between:"between","not between":"notbetween","is empty":"isempty","is null":"isnull","is not null":"isnotnull","is not empty":"isnotempty"}[""+t]},yst.prototype.getTypeFromColumn=function(e){e=this.getColumn(e.field);return je(e)?null:e.type},yst.prototype.getLabelFromColumn=function(e){var t="",i=0;if(""===this.separator)return this.getColumn(e).label;for(var n=e.split(this.separator),o=0;o<n.length;o++)t+=this.getLabelFromField(n,o+1),++i<n.length&&(t+=this.separator);return t},yst.prototype.getLabelFromField=function(e,t){for(var i="",n=0,o=0;o<t;o++)i+=e[o],++n<t&&(i+=this.separator);return this.getColumn(i).label},yst.prototype.processParser=function(e,t,i,n){for(var o,r,s,a,l,h,d,p,c=[],u=[],g=!1,m=!1,f=0,y=e.length;f<y;f++)if("Literal"===e[f][0]){var v=this.getColumn(e[f][1]),b={label:v&&v.label?v.label:e[f][1],field:e[f][1]};if("SubOperators"===e[f+1][0]){for(-1<e[f+1][1].indexOf("null")||-1<e[f+1][1].indexOf("empty")?(b.operator=this.getOperator(" ",e[f+1][1],n),b.value=null,b.type=this.getTypeFromColumn(b)):(v=e[f+3][1]&&e[f+3][1].replace(/'/g,""),b.operator=this.getOperator(v,e[f+1][1],n)),p=e[f+1][1],r=y,n&&"contains"===b.operator||"startswith"===b.operator||"endswith"===b.operator?p="like":n&&"notcontains"===b.operator||"notstartswith"===b.operator||"notendswith"===b.operator?p="not like":n&&(p=b.operator),o=o=++f+1;o<r;o++)if(p.indexOf("between")<0&&"Left"===e[o][0])g=!0;else{if("Right"===e[o][0]&&g){f=o,g=!1;break}if(-1<p.indexOf("null")||-1<p.indexOf("empty"))break;if(-1<p.indexOf("like")&&"String"===e[o][0]){var w=e[o][1];w=(w=e[o][1]&&"'"===e[o][1][0]?e[o][1].substring(1,e[o][1].length-1):w)?w.replace(/%/g,""):e[o][1],b.value=w,b.type="string"}else{if(-1<p.indexOf("between")&&("Literal"===e[o][0]||"Left"===e[o][0]))break;"Number"===e[o][0]?c.push(Number(e[o][1])):"String"===e[o][0]&&(w=e[o][1],e[o][1]&&"'"===e[o][1][0]&&(w=e[o][1].substring(1,e[o][1].length-1)),u.push(w))}b.type=this.getTypeFromColumn(b)}p.indexOf("like")<0&&("Number"===e[o-1][0]?(b.value=c,b.type="number"):"String"===e[o-1][0]?(b.value=u,b.type="string"):-1<p.indexOf("between")&&"Conditions"===e[o-1][0]&&(0!==u.length?(b.value=u,b.type="string"):(b.value=c,b.type="number")),c=[],u=[],b.type=this.getTypeFromColumn(b)),this.enableSeparateConnector&&"Conditions"===e[f+1][0]&&(b.condition=e[f+1][1])}else"Operators"===e[f+1][0]&&(b.operator=this.getOperator(e[f+2][1],e[f+1][1],n),"equal"===b.operator&&"String"===e[f+2][0]&&"''"===e[f+2][1]?b.operator="isempty":"notequal"===b.operator&&"String"===e[f+2][0]&&"''"===e[f+2][1]&&(b.operator="isnotempty"),"Number"===e[f+2][0]?(b.type="number",b.value=Number(e[f+2][1])):(b.type="string",(w=e[f+2][1])&&"'"===w[0]&&(w=w.substring(1,w.length-1)),b.value=w),this.enableSeparateConnector&&"Conditions"===e[f+3][0]&&(b.condition=e[f+3][1]),b.type=this.getTypeFromColumn(b));t.rules.push(b)}else if("Left"===e[f][0]){if("Left"===e[0][0]||!("not"===e[f-1][1]||n&&this.l10n.getConstant("NOT").toLowerCase()===e[f-1][1])){for(this.parser=e.splice(f+1,y-(f+1)),v=this.enableNotCondition?{condition:"and",rules:[],not:!1}:{condition:"and",rules:[]},a=t.rules.length,s=d=0;s<a;s++)t.rules[s].rules&&d++;return i.push(d),t.rules.push(v),v=this.processParser(this.parser,v,i,n),t}m=!0}else if("Conditions"!==e[f][0]||this.enableSeparateConnector){if("Right"===e[f][0]){if(!m||"Right"!==e[f+1][0]){for(this.parser=e.splice(f+1,y-(f+1)),i.pop(),t=this.rule,h=i.length,l=0;l<h;l++)t=this.findGroupByIdx(i[l],t,0===l);return this.processParser(this.parser,t,i,n)}m=!1}}else"not"===e[f][1]||n&&this.l10n.getConstant("NOT").toLowerCase()===e[f][1]?t.not=!0:t.condition=e[f][1];return t},yst.prototype.groupClone=function(e){var t=e.closest(".e-rule-list").closest(".e-group-container"),i=e.id.replace(this.element.id+"_",""),t=t.id.replace(this.element.id+"_",""),i=this.getGroup(i);this.groupIndex=Array.prototype.indexOf.call(e.closest(".e-rule-list").children,e.closest(".e-group-container")),this.addGroups([{condition:i.condition,not:i.not,rules:i.rules}],t),this.groupIndex=-1},yst.prototype.ruleClone=function(e){for(var t=z(e,".e-rule-container"),i=e.closest(".e-rule-list").closest(".e-group-container"),e=this.getRule(e),n=i.id.replace(this.element.id+"_",""),o=i.querySelectorAll(".e-rule-container"),r=0,s=o.length;r<s;r++)t.id===o[r].id&&(this.ruleIndex=r);this.enableSeparateConnector?this.addRules([{label:e.label,field:e.field,type:e.type,operator:e.operator,value:e.value,condition:e.condition}],n):this.addRules([{label:e.label,field:e.field,type:e.type,operator:e.operator,value:e.value}],n),this.ruleIndex=-1},yst.prototype.ruleLock=function(e){var t=z(e,".e-rule-container"),i=this.getRule(t.id.replace(this.element.id+"_",""));t.classList.contains("e-disable")?(i.isLocked=!1,this.lockItems=this.lockItems.filter(function(e){return e!==t.id}),t.classList.remove("e-disable"),this.disableRuleControls(e,t,!1),e.children[0].classList.add("e-unlock"),e.children[0].classList.remove("e-lock"),e.setAttribute("title",this.l10n.getConstant("LockRule"))):(i.isLocked=!0,this.lockItems.indexOf(t.id)<0&&this.lockItems.splice(this.lockItems.length-1,0,t.id),t.classList.add("e-disable"),this.disableRuleControls(e,t,!0),e.children[0].classList.add("e-lock"),e.children[0].classList.remove("e-unlock"),e.setAttribute("title",this.l10n.getConstant("UnlockRule")))},yst.prototype.groupLock=function(e){var t,i=z(e,".e-group-container"),n=this.getGroup(i.id.replace(this.element.id+"_","")),o=-1<i.id.indexOf("group0");i.classList.contains("e-disable")?(o?((t={}).condition=n.condition,t.not=n.not,t.isLocked=!1,this.setProperties({rule:t},!0)):n.isLocked=!1,this.lockItems=this.lockItems.filter(function(e){return e!==i.id}),i.classList.remove("e-disable"),this.disableHeaderControls(e,i,!1),e.children[0].classList.add("e-unlock"),e.children[0].classList.remove("e-lock"),e.setAttribute("title",this.l10n.getConstant("LockGroup")),this.updateLockItems()):(o?((t={}).condition=n.condition,t.not=n.not,t.isLocked=!0,this.setProperties({rule:t},!0)):n.isLocked=!0,this.lockItems.indexOf(i.id)<0&&this.lockItems.splice(this.lockItems.length-1,0,i.id),i.classList.add("e-disable"),this.disableHeaderControls(e,i,!0),e.children[0].classList.add("e-lock"),e.children[0].classList.remove("e-unlock"),e.setAttribute("title",this.l10n.getConstant("UnlockGroup")))},yst.prototype.updateLockItems=function(){for(var e,t=0;t<this.lockItems.length;t++)2<this.lockItems[t].split("_").length?z(e=this.element.querySelector("#"+this.lockItems[t]).querySelector(".e-lock-rule-btn"),".e-rule-container").classList.contains("e-disable")||this.ruleLock(e):z(e=this.element.querySelector("#"+this.lockItems[t]).querySelector(".e-lock-grp-btn"),".e-group-container").classList.contains("e-disable")||this.groupLock(e)},yst.prototype.disableHeaderControls=function(e,t,i){for(var n=t.querySelectorAll(".e-btngroup-and"),o=t.querySelectorAll(".e-btngroup-or"),r=t.querySelectorAll(".e-qb-toggle"),s=t.querySelectorAll(".e-add-btn"),a=t.querySelectorAll(".e-deletegroup"),l=t.querySelectorAll(".e-lock-grp-btn"),h=t.querySelectorAll(".e-clone-grp-btn"),d=t.querySelectorAll(".e-group-container"),p=t.querySelectorAll(".e-add-condition-btn"),c=t.querySelectorAll(".e-add-group-btn"),u=0;u<n.length;u++)i?(d[u]&&d[u].classList.contains("e-disable")&&d[u].classList.add("e-disable"),n[u].disabled=!0,o[u].disabled=!0,s[u]&&(s[u].disabled=!0),p[u]&&(p[u].disabled=!0),c[u]&&(c[u].disabled=!0),r[u]&&(r[u].disabled=!0),a[u]&&(a[u].disabled=!0),h[u]&&(h[u].disabled=!0),n[u].parentElement.classList.add("e-disabled"),l[u]&&l[u]!==e&&(l[u].disabled=!0,l[u].children[0].classList.remove("e-unlock"),l[u].children[0].classList.add("e-lock"))):(d[u]&&d[u].classList.remove("e-disable"),n[u].disabled=!1,o[u].disabled=!1,s[u]&&(s[u].disabled=!1),p[u]&&(p[u].disabled=!1),c[u]&&(c[u].disabled=!1),l[u]&&(l[u].disabled=!1),r[u]&&(r[u].disabled=!1),a[u]&&(a[u].disabled=!1),h[u]&&(h[u].disabled=!1),n[u].parentElement.classList.remove("e-disabled"),l[u]&&l[u].children[0].classList.remove("e-lock"),l[u]&&l[u].children[0].classList.add("e-unlock"));this.disableRuleControls(e,t,i)},yst.prototype.disableRuleControls=function(e,t,i){for(var n=t.querySelectorAll(".e-control.e-dropdownlist"),o=t.querySelectorAll(".e-control.e-numerictextbox"),r=t.querySelectorAll(".e-control.e-textbox"),s=t.querySelectorAll(".e-control.e-datepicker"),a=t.querySelectorAll(".e-control.e-checkbox"),l=t.querySelectorAll(".e-control.e-radio"),h=t.querySelectorAll(".e-control.e-multiselect"),d=t.querySelectorAll(".e-rule-delete"),p=t.querySelectorAll(".e-lock-rule"),c=t.querySelectorAll(".e-clone-rule"),u=t.querySelectorAll(".e-rule-container"),g=0;g<d.length;g++)i?(u[g]&&u[g].classList.contains("e-disable")&&u[g].classList.add("e-disable"),d[g].disabled=!0,c[g]&&(c[g].disabled=!0),p[g]!==e&&(p[g].disabled=!0,p[g].children[0].classList.remove("e-unlock"),p[g].children[0].classList.add("e-lock"))):(u[g]&&u[g].classList.remove("e-disable"),c[g]&&(c[g].disabled=!1),d[g].disabled=!1,p[g].disabled=!1,p[g].children[0].classList.remove("e-lock"),p[g].children[0].classList.add("e-unlock"));for(g=0;g<n.length;g++)At(n[g],"dropdownlist").enabled=!i;for(g=0;g<o.length;g++)At(o[g],"numerictextbox").enabled=!i;for(g=0;g<r.length;g++)At(r[g],"textbox").enabled=!i;for(g=0;g<s.length;g++)At(s[g],"datepicker").enabled=!i;for(g=0;g<a.length;g++)At(a[g],"checkbox").disabled=!!i;for(g=0;g<l.length;g++)At(l[g],"radio").disabled=!!i;for(g=0;g<h.length;g++)At(h[g],"multiselect").enabled=!i},Xet([i()],yst.prototype,"created",void 0),Xet([i()],yst.prototype,"actionBegin",void 0),Xet([i()],yst.prototype,"beforeChange",void 0),Xet([i()],yst.prototype,"change",void 0),Xet([i()],yst.prototype,"dataBound",void 0),Xet([i()],yst.prototype,"ruleChange",void 0),Xet([i()],yst.prototype,"dragStart",void 0),Xet([i()],yst.prototype,"drag",void 0),Xet([i()],yst.prototype,"drop",void 0),Xet([t({},Det)],yst.prototype,"showButtons",void 0),Xet([e(!1)],yst.prototype,"summaryView",void 0),Xet([e(!1)],yst.prototype,"allowValidation",void 0),Xet([e("Default")],yst.prototype,"fieldMode",void 0),Xet([e([])],yst.prototype,"columns",void 0),Xet([e(null)],yst.prototype,"fieldModel",void 0),Xet([e(null)],yst.prototype,"operatorModel",void 0),Xet([e(null)],yst.prototype,"valueModel",void 0),Xet([e()],yst.prototype,"headerTemplate",void 0),Xet([e("")],yst.prototype,"cssClass",void 0),Xet([e([])],yst.prototype,"dataSource",void 0),Xet([e("Horizontal")],yst.prototype,"displayMode",void 0),Xet([e(!1)],yst.prototype,"enablePersistence",void 0),Xet([e("Default")],yst.prototype,"sortDirection",void 0),Xet([e(5)],yst.prototype,"maxGroupCount",void 0),Xet([e("auto")],yst.prototype,"height",void 0),Xet([e("auto")],yst.prototype,"width",void 0),Xet([e(!1)],yst.prototype,"matchCase",void 0),Xet([e(0)],yst.prototype,"immediateModeDelay",void 0),Xet([e(!1)],yst.prototype,"enableNotCondition",void 0),Xet([e(!1)],yst.prototype,"readonly",void 0),Xet([e(!0)],yst.prototype,"addRuleToNewGroups",void 0),Xet([e(!1)],yst.prototype,"autoSelectField",void 0),Xet([e(!0)],yst.prototype,"autoSelectOperator",void 0),Xet([e("")],yst.prototype,"separator",void 0),Xet([e(!1)],yst.prototype,"enableSeparateConnector",void 0),Xet([t({condition:"and",rules:[]},q$e)],yst.prototype,"rule",void 0),Xet([e(!1)],yst.prototype,"allowDragAndDrop",void 0);var fst,h=Xet([Bt],yst);function yst(e,t){e=fst.call(this,e,t)||this;return e.isReadonly=!0,e.fields={text:"label",value:"field"},e.updatedRule={not:!1,condition:"and",isLocked:!1},e.isLocale=!1,e.isRefreshed=!1,e.isNotified=!1,e.isAddSuccess=!1,e.isNotValueChange=!1,e.isFieldChange=!1,e.isFieldClose=!1,e.isDestroy=!1,e.isGetNestedData=!1,e.isCustomOprCols=[],e.groupCounter=0,e.lockItems=[],e.groupIndex=-1,e.ruleIndex=-1,e.isLastGroup=!1,e.cloneGrpBtnClick=!1,e.isMiddleGroup=!1,e.cloneRuleBtnClick=!1,e.isValueEmpty=!1,zU.Inject(JU),e}vst.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},vst.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("query-library",this.queryLibrary,this),this.parent.on("destroyed",this.destroy,this))},vst.prototype.removeEventListener=function(){this.parent.off("query-library",this.queryLibrary),this.parent.off("destroyed",this.destroy)},vst.prototype.queryLibrary=function(e){switch(e.prop){case"getMongoFromRules":e.value.obj.mongoQuery=this.getMongoFromRules(e.value.rule,e.value.mongoQuery);break;case"mongoParser":this.mongoParser(e.value.mongoQuery,e.value.rule,e.value.mongoLocale);break;case"getParameterSql":e.value.obj.sql=this.getParameterSql(e.value.rule);break;case"getNamedParameterSql":e.value.obj.sql=this.getNamedParameterSql(e.value.rule);break;case"convertParamSqlToSql":e.value.obj.sql=this.convertParamSqlToSql(e.value.sql);break;case"convertNamedParamSqlToSql":e.value.obj.sql=this.convertNamedParamSqlToSql(e.value.sql)}},vst.prototype.getMongoFromRules=function(e,t){return t="{",t="or"===e.condition?this.convertMongoQuery(e.rules,t+='"$or":[')+"]":this.convertMongoQuery(e.rules,t+='"$and":[')+"]",t+="}"},vst.prototype.getOperatorFromMongoOperator=function(e){var t;switch(e){case"$ne":t="notequal";break;case"$gt":t="greaterthan";break;case"$gte":t="greaterthanorequal";break;case"$lt":t="lessthan";break;case"$lte":t="lessthanorequal";break;case"$nin":t="notin"}return t},vst.prototype.convertMongoQuery=function(o,r){var s=this,a=0;return o.forEach(function(i){a++,r+="{",void 0!==i.rules&&(r=("or"===i.condition?r+=' "$or":[':r+=' "$and":[',s.convertMongoQuery(i.rules,r)+"]"));var e,t="string"===i.type&&"in"!==i.operator&&"notin"!==i.operator&&i.value&&""!==i.value.trim()?i.value.replace(/'/g,"\\"):"",n=("string"!==i.type||"in"!==i.operator&&"notin"!==i.operator||!i.value||1!==i.value.length||(t=i.value[0].replace(/'/g,"\\")),i.field?i.field.substring(0):"");switch(i.operator){case"contains":r+='"'+n+'":{"$regex":"'+t+'"}';break;case"notcontains":r+='"'+n+'":{"$not":{"$regex":"'+i.value+'"}}';break;case"startswith":r+='"'+n+'":{"$regex":"^'+t+'"}';break;case"notstartswith":r+='"'+n+'":{"$not":{"$regex":"^'+i.value+'"}}';break;case"endswith":r+='"'+n+'":{"$regex":"'+t+'$"}';break;case"notendswith":r+='"'+n+'":{"$not":{"$regex":"'+i.value+'$"}}';break;case"isnull":r+='"'+n+'": null';break;case"isnotnull":r+='"'+n+'":{"$ne": null}';break;case"isempty":r+='"'+n+'": ""';break;case"isnotempty":r+='"'+n+'":{"$ne": ""}';break;case"equal":"string"===i.type?r+='"'+n+'":"'+t+'"':"date"===i.type?r+='"'+n+'":"'+i.value+'"':(i.type,r+='"'+n+'":'+i.value);break;case"notequal":"string"===i.type?r+='"'+n+'":{"$ne":"'+t+'"}':"date"===i.type?r+='"'+n+'":{"$ne":"'+i.value+'"}':r+='"'+n+'":{"$ne":'+i.value+"}";break;case"in":"string"===i.type?1<i.value.length?(e=(e=i.value.map(function(e,t){return t<i.value.length?'"'+e+'"':""}).toString()).endsWith(",")?e.substring(0,e.length-1):e,r+='"'+n+'": { "$in": ['+e+"]}"):r+='"'+n+'": { "$in": ["'+t+'"]}':"number"===i.type&&(1<i.value.length?r+='"'+n+'": { "$in": ['+i.value.toString()+"]}":r+='"'+n+'": { "$in": ['+i.value+"]}");break;case"notin":"string"===i.type?1<i.value.length?(e=(e=i.value.map(function(e,t){return t<i.value.length?'"'+e+'"':""}).toString()).endsWith(",")?e.substring(0,e.length-1):e,r+='"'+n+'": { "$nin": ['+e+"]}"):r+='"'+n+'": { "$nin": ["'+t+'"]}':"number"===i.type&&(1<i.value.length?r+='"'+n+'": { "$nin": ['+i.value.toString()+"]}":r+='"'+n+'": { "$nin": ['+i.value+"]}");break;case"greaterthan":"number"===i.type?r+='"'+n+'": { "$gt": '+i.value+"}":r+='"'+n+'": { "$gt": "'+i.value+'"}';break;case"greaterthanorequal":"number"===i.type?r+='"'+n+'": { "$gte": '+i.value+"}":r+='"'+n+'": { "$gte": "'+i.value+'"}';break;case"between":"number"===i.type?r+='"'+n+'": {"$gte":'+i.value[0]+', "$lte":'+i.value[1]+"}":r+='"'+n+'": {"$gte": "'+i.value[0]+'", "$lte": "'+i.value[1]+'"}';break;case"notbetween":"number"===i.type?r+='"$or":[{"'+n+'": {"$lt":'+i.value[0]+'}}, {"'+n+'": {"$gt":'+i.value[1]+"}}]":r+='"$or":[{"'+n+'": {"$lt": "'+i.value[0]+'"}}, {"'+n+'": {"$gt": "'+i.value[1]+'"}}]';break;case"lessthan":"number"===i.type?r+='"'+n+'": { "$lt": '+i.value+"}":r+='"'+n+'": { "$lt": "'+i.value+'"}';break;case"lessthanorequal":"number"===i.type?r+='"'+n+'": { "$lte": '+i.value+"}":r+='"'+n+'": { "$lte": "'+i.value+'"}'}r+="}",o.length!==a&&(r+=",")}),r},vst.prototype.mongoParser=function(e,t,i){var n;-1<Object.keys(e).indexOf("$and")?(n=e.$and,t.condition="and"):-1<Object.keys(e).indexOf("$or")&&(n=e.$or,t.condition="or"),t.rules=[],this.mongoRecursion(n,t.rules,i)},vst.prototype.mongoRecursion=function(e,t,i){for(var n,o,r,s,a,l,h,d,p,c=0,u=e.length;c<u;c++){var g=[],m=[],f=Object.keys(e[c])[0],y=e[c][f];if("$and"===f)h=this.parent.enableNotCondition?{condition:f.replace("$",""),rules:[],not:!1}:{condition:f.replace("$",""),rules:[]},t.push(h),this.mongoRecursion(e[c][f],t[t.length-1].rules,i);else if("$or"===f){var v,b,w,C,S,A=void 0;Array.isArray(y)&&2===y.length&&(C=y[(S=Object.keys(y))[0]],S=y[S[1]],"object"==typeof C)&&(v=Object.keys(C)[0],w=Object.keys(C[Object.keys(C)[0]])[0],b=Object.keys(S[Object.keys(S)[0]])[0],"$lt"===w)&&"$gt"===b&&(C=C[v][w],w=S[v][b],t.push(d={field:v,label:v,value:p=[C,w],operator:n="notbetween",type:o="number"==typeof C?"number":"date"}),A=!0),A||(h=this.parent.enableNotCondition?{condition:f.replace("$",""),rules:[],not:!1}:{condition:f.replace("$",""),rules:[]},t.push(h),this.mongoRecursion(e[c][f],t[t.length-1].rules,i))}else{if(null===(y=e[c][f])&&(n="isnull"),"boolean"==typeof y&&(n="equal",o="boolean",p=y),"number"==typeof y)p=y,o="number",n="equal";else if("object"==typeof y&&null!==y){for(var x=Object.keys(y),I=0;I<x.length;I++)if(s=x[I],r=y[x[I]],"$ne"===s&&je(r)&&(n="isnotnull",p=null),"$ne"===s&&"boolean"==typeof r&&(n="notequal",p=r,o="boolean"),2<=x.length&&x[I]?("object"==typeof r?(n="notbetween",f=Object.keys(r)[0],a=[Object.keys(r[f])[0]],g.push(r[f][a]),o="number"):(n="between",g.push(r)),"number"==typeof r&&(o="number")):"object"==typeof r&&null!==r?"$not"===s&&"$regex"===Object.keys(r)[0]?p=-1<r.$regex.indexOf("^")?(n="notstartswith",r.$regex.replace("^","")):-1<r.$regex.indexOf("$")?(n="notendswith",r.$regex.replace("$","")):(n="notcontains",r.$regex):(n="$in"===s?"in":"notin",o="number"==typeof(m=r)[0]?"number":"string"):"number"==typeof r&&(n=this.getOperatorFromMongoOperator(s),o="number",p=r),"string"==typeof r){"$regex"===s&&(n="contains",p=r,o="string"),"$ne"===s&&(null!==r&&0<r.length&&isNaN(Date.parse(r))?(n="notequal",p=r):je(r)?(n="isnotnull",p=r):""===r&&(n="isnotempty",p=r),o="string"),-1<r.indexOf("^")&&(n="startswith",p=r.replace("^",""),o="string"),-1<r.indexOf("$")&&"$not"!==s&&(n="endswith",p=r.replace("$",""),o="string");for(var T=0,E=this.parent.columns;T<E.length;T++){var D=E[T];if(D.field===f){l=D.type;break}}isNaN(Date.parse(r))&&"date"!==l||(n=n||this.getOperatorFromMongoOperator(s),o="date",p=r)}}else y&&"string"==typeof y&&!isNaN(Date.parse(y))?(n="equal",p=y,o="date"):"string"==typeof y&&""!==y&&"true"!==y&&"false"!==y?(n="equal",p=y,o="string"):"string"==typeof y&&""===y&&(n="isempty",p=y,o="string");d=g&&1<g.length?{field:f,label:f,value:g,operator:n,type:o}:m&&1<m.length?{field:f,label:f,value:m,operator:n,type:o}:{field:f,label:f,value:p,operator:n,type:o},t.push(d),n=""}}},vst.prototype.convertParamSqlToSql=function(e){for(var t=e.sql,i=e.params,n=t.split("?"),o=n[0],r=0;r<i.length;r++)o+="string"==typeof i[r]?"'"+i[r]+"'"+n[r+1]:i[r]+n[r+1];return o=(o=2<=o.length&&"("===o[0]&&")"===o[o.length-1]?o.slice(1,-1):o).replace(/!= ''(?! =)/g,"IS NOT EMPTY").replace(/= ''/g,"IS EMPTY")},vst.prototype.convertNamedParamSqlToSql=function(e){var t=e.sql,i=e.params,n=t;return Object.keys(i).forEach(function(e){var t=i[e];n=n.replace(e=":"+e,"string"==typeof t?"'"+t+"'":String(t))}),n=(n=2<=n.length&&"("===n[0]&&")"===n[n.length-1]?n.slice(1,-1):n).replace(/!= ''(?! =)/g,"IS NOT EMPTY").replace(/= ''/g,"IS EMPTY")},vst.prototype.getParameterSql=function(e){var e=Pe({},e,null,!0),t=this.updateRuleValue(e,!1);return this.getParameterSQLVal(this.parent.getSqlFromRules(e),t.ruleVal)},vst.prototype.getNamedParameterSql=function(e){var e=Pe({},e,null,!0),t=this.updateRuleValue(e,!0);return this.getNamedParameterSQLVal(this.parent.getSqlFromRules(e),t.namedRuleVal)},vst.prototype.getParameterSQLVal=function(e,t){return{sql:"("+e.replace(/[%']/g,"")+")",params:t}},vst.prototype.getNamedParameterSQLVal=function(e,t){return{sql:"("+e.replace(/[%']/g,"")+")",params:t}},vst.prototype.updateRuleValue=function(e,t){return this.updateValue(e.rules,t,[],{},[])},vst.prototype.updateValue=function(e,t,i,n,o){if(!je(e))for(var r=0;r<e.length;r++)if(e[r].rules)i=(l=this.updateValue(e[r].rules,t,i,n,o)).ruleVal,n=l.namedRuleVal;else{var s=void 0;if(e[r].value instanceof Array)for(var a=0;a<e[r].value.length;a++)t&&(s=this.getNamedParameter(e[r].field,o)),je(e[r].value[a])||("string"!==e[r].type&&e[r].type,t?n[s]=e[r].value[a]:i.push(e[r].value[a])),e[r].value[a]=t?":"+s:"?";else if(t&&(s=this.getNamedParameter(e[r].field,o)),e[r].operator.indexOf("null")<1&&("string"!==e[r].type||"string"===e[r].type&&(""!==e[r].value||0===e[r].value))){if("string"===e[r].type||"date"===e[r].type)if(e[r].operator.indexOf("empty")<1){var l=e[r].value.toString();switch(e[r].operator){case"startswith":case"notstartswith":l+="%";break;case"endswith":case"notendswith":l="%"+l;break;case"contains":case"notcontains":l="%"+l+"%"}t?n[s]=l:i.push(l)}else t?n[s]="":i.push(""),"isempty"===e[r].operator?e[r].operator="equal":e[r].operator="notequal";else je(e[r].value)||(t?n[s]=e[r].value:i.push(e[r].value));e[r].value=t?":"+s:"?"}}return{ruleVal:i,namedRuleVal:n}},vst.prototype.getNamedParameter=function(e,t){var i=null;if(0<t.length)for(var n=t.length-1;0<=n;n--){var o=t[n];if(-1<o.indexOf(e)){i=e+"_"+(parseInt(o.split("_")[1],10)+1);t.push(i);break}}return i||t.push(i=e+"_1"),i},vst.prototype.getModuleName=function(){return"query-library"};wce=vst;function vst(e){this.parent=e,this.addEventListener()}h.Inject(wce);fJ=Object.freeze({__proto__:null,Columns:det,Rule:q$e,Value:W$e,ShowButtons:Det,QueryBuilder:h,QueryLibrary:wce});wst=function(e,t){return(wst=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])}))(e,t)};function bst(e,t){this.x=e,this.y=t}var wst,Cst,Sst=function(e,t,i,n){this.x=e,this.y=t,this.height=i,this.width=n},Ast=function(e,t){this.height=e,this.width=t},xst=(function(e,t){function i(){this.constructor=e}wst(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Ist,Cst=No),Ist);function Ist(e,t,i,n,o,r,s,a,l,h){e=Cst.call(this,e,t,i,n,o,h)||this;return e.y=r.y,e.x=r.x,e.height=r.height,e.width=r.width,e.rx=s||0,e.ry=a||0,e.transform=l||"",e.stroke=0!==i&&""!==e.stroke?n:"transparent",e}var Tst=function(e,t,i){this.r=e,this.g=t,this.b=i};function Est(e){return"#"+Dst(e.r)+Dst(e.g)+Dst(e.b)}function Dst(e){e=e.toString(16);return 1===e.length?"0"+e:e}var Mst=function(e,t,i,n,o,r,s,a,l,h,d){this.id=e,this["font-size"]=t,this["font-style"]=i,this["font-family"]=n,this["font-weight"]=o,this["text-anchor"]=r,this.fill=s,this.x=a,this.y=l,this.width=h||0,this.height=d||0};function kst(e,t,i,n){n=(n-90)*(Math.PI/180);return{x:e+i*Math.cos(n),y:t+i*Math.sin(n)}}function Pst(e,t,i,n,o,r,s){var a=kst(e,t,i,n),l=kst(e,t,i,o),h="0",d=r?"0":"1",h=r?(o<=n?n:n+360)-o<=180?"0":"1":(n<=o?o:o+360)-n<=180?"0":"1",r=s?"M "+e+" "+t+" L "+a.x+" "+a.y+" A "+i+" "+i+"  0  "+h+" "+d+" "+l.x+" "+l.y+" Z":"M"+a.x+" "+a.y+"A"+i+" "+i+" 0 "+h+" "+d+" "+l.x+" "+l.y;return r}function Bst(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function Fst(e,t){for(var i=Object.keys(e),n=0;n<i.length;n++)t.setAttribute(i[n],e[i[n]]);return t}function Lst(e,t,i,n,o){t+=o?-i:i;return(o?i:-i)*Math.cos(e/n*(Math.PI/2))+t}var Rst="annotationRender";function Ost(e){return document.getElementById(e)}function Nst(e){if(!e)return null;e="string"==typeof e?Ost(e):e;e&&ue(e)}var Vst,_st,Hst=function(e,t){this.x=e,this.y=t},tte=(Vst=function(e,t){return(Vst=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])}))(e,t)},function(e,t){function i(){this.constructor=e}Vst(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),pJ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},d$=(tte(zst,_st=n),pJ([e(10)],zst.prototype,"top",void 0),pJ([e(10)],zst.prototype,"bottom",void 0),pJ([e(10)],zst.prototype,"left",void 0),pJ([e(10)],zst.prototype,"right",void 0),zst);function zst(){return null!==_st&&_st.apply(this,arguments)||this}tte(Wst,jst=n),pJ([e("Normal")],Wst.prototype,"fontStyle",void 0),pJ([e("16px")],Wst.prototype,"size",void 0),pJ([e("Normal")],Wst.prototype,"fontWeight",void 0),pJ([e("")],Wst.prototype,"color",void 0),pJ([e("Segoe UI")],Wst.prototype,"fontFamily",void 0),pJ([e(null)],Wst.prototype,"opacity",void 0),pJ([e("Far")],Wst.prototype,"textAlignment",void 0),pJ([e("")],Wst.prototype,"text",void 0);var jst,X$e=Wst;function Wst(){return null!==jst&&jst.apply(this,arguments)||this}tte(Ust,Qst=n),pJ([e(!1)],Ust.prototype,"enable",void 0),pJ([e(2e3)],Ust.prototype,"duration",void 0),pJ([e(0)],Ust.prototype,"delay",void 0);var Qst,Vee=Ust;function Ust(){return null!==Qst&&Qst.apply(this,arguments)||this}tte(Gst,qst=n),pJ([e(null)],Gst.prototype,"content",void 0),pJ([e(0)],Gst.prototype,"annotationAngle",void 0),pJ([e("0%")],Gst.prototype,"annotationRadius",void 0);var qst,Z$e=Gst;function Gst(){return null!==qst&&qst.apply(this,arguments)||this}tte(Xst,Yst=n),pJ([e("")],Xst.prototype,"color",void 0),pJ([e(1)],Xst.prototype,"width",void 0);var Yst,Wo=Xst;function Xst(){return null!==Yst&&Yst.apply(this,arguments)||this}tte(Jst,Kst=n),pJ([e(!1)],Jst.prototype,"enable",void 0),pJ([e(null)],Jst.prototype,"fill",void 0),pJ([e(null)],Jst.prototype,"format",void 0),pJ([e(!1)],Jst.prototype,"showTooltipOnHover",void 0),pJ([t({fontFamily:null,size:"12px",fontWeight:null,fontStyle:"Normal",color:null},X$e)],Jst.prototype,"textStyle",void 0),pJ([t({color:"#cccccc",width:.5},Wo)],Jst.prototype,"border",void 0);var Kst,Met=Jst;function Jst(){return null!==Kst&&Kst.apply(this,arguments)||this}tte($st,Zst=n),pJ([e("")],$st.prototype,"color",void 0),pJ([e(null)],$st.prototype,"start",void 0),pJ([e(null)],$st.prototype,"end",void 0);var Zst,Cet=$st;function $st(){return null!==Zst&&Zst.apply(this,arguments)||this}var eat=359.99,tat="valueChanged",iat="progressCompleted",nat="http://www.w3.org/2000/svg",oat="tooltipRender",P$e=(rat.prototype.render=function(e,t){return this.annotation=e,Q("div",{id:this.control.element.id+"Annotation"+t,styles:"position:absolute;z-index:1",innerHTML:e.content})},rat.prototype.processAnnotation=function(e,t,i){var n=new Hst(0,0),e=this.render(e,t);e?this.setElementStyle(n,e,i):this.control.redraw&&(Nst(e.id),this.control.isReact)&&this.control.clearTemplate()},rat.prototype.setElementStyle=function(e,t,i){t={cancel:!1,name:Rst,content:t,location:e};this.control.trigger(Rst,t),t.cancel||(e=this.Location(this.annotation.annotationRadius,this.annotation.annotationAngle),t.content.style.left=e.left+"px",t.content.style.top=e.top+"px",t.content.style.transform="translate(-50%, -50%)",t.content.setAttribute("aria-label","Annotation"),i.appendChild(t.content),this.control.isReact&&this.control.renderReactTemplates())},rat.prototype.Location=function(e,t){var i,n,o,e=parseFloat(e);return{top:0===e&&0===t?(i=(n=this.control.progressRect).x+n.width/2,n.y+n.height/2):(t=(t-90)*(Math.PI/180),n=Math.round(this.control.progressSize.width/2.25),o=Math.round(this.control.progressSize.height/2.25),i=e*Math.cos(t)+n,e*Math.sin(t)+o),left:i}},rat);function rat(e){this.control=e}aat.prototype.doLinearAnimation=function(e,t,i,n,o){var r=this,s=new Vt({}),a=e,l=t.isActive?3e3:t.animation.duration,h=a.getAttribute("width"),d=a.getAttribute("x"),p=0,c=0,u=t.enableRtl&&"Round4px"!==t.cornerRadius?parseInt(d,10):n,g=t.enableRtl&&"Round4px"!==t.cornerRadius?parseInt(h,10)-n:parseInt(h,10)-u,m=parseInt(d,10)-g;a.style.visibility="hidden",s.animate(a,{duration:0===t.animation.duration&&"Enable"===Ut?2e3:l,delay:i,progress:function(e){t.cancelResize=!0,t.enableRtl&&"Round4px"!==t.cornerRadius?e.timeStamp>=e.delay&&(a.style.visibility="visible",t.isActive?(c=r.activeAnimate(e.timeStamp/e.duration,parseInt(d,10),parseInt(h,10),!0),p=Lst(e.timeStamp,.5,.5,e.duration,!0),o.setAttribute("opacity",p.toString())):c=Lst(e.timeStamp,u,g,e.duration,!0),a.setAttribute("x",c.toString())):e.timeStamp>=e.delay&&(a.style.visibility="visible",t.isActive?(c=r.activeAnimate(e.timeStamp/e.duration,0,parseInt(h,10),!1),p=Lst(e.timeStamp,.5,.5,e.duration,!0),o.setAttribute("opacity",p.toString())):c=Lst(e.timeStamp,u,g,e.duration,!1),a.setAttribute("width",c.toString()))},end:function(){t.cancelResize=!1,a.style.visibility="",t.enableRtl&&"Round4px"!==t.cornerRadius?t.isActive?(a.setAttribute("x",d.toString()),r.doLinearAnimation(e,t,i,n,o)):a.setAttribute("x",m.toString()):(a.setAttribute("width",h),t.isActive&&r.doLinearAnimation(e,t,i,n,o)),t.trigger("animationComplete",{value:t.value,trackColor:t.trackColor,progressColor:t.progressColor})}})},aat.prototype.doLinearIndeterminate=function(e,t,i,n,o){var r=this,s=new Vt({}),a=e,l=a.getAttribute("x"),h=a.getAttribute("width"),d=0,p=h?-parseInt(h,10):-t,c=n.progressRect.x+n.progressRect.width+(h?parseInt(h,10):t),h=n.enableProgressSegments?n.animation.duration+1e3:n.animation.duration;s.animate(o,{duration:0===n.animation.duration&&"Enable"===Ut?2e3:h,delay:0,progress:function(e){d=n.enableRtl&&"Round4px"!==n.cornerRadius?Lst(e.timeStamp,parseInt(l,10)||n.progressRect.x+t,c,e.duration,!0):Lst(e.timeStamp,p,c,e.duration,!1),n.enableProgressSegments?a.setAttribute("d",n.getPathLine(d,t,i)):a.setAttribute("x",d.toString())},end:function(){n.enableRtl&&!n.enableProgressSegments&&"Round4px"!==n.cornerRadius?a.setAttribute("x",l.toString()):n.enableProgressSegments||a.setAttribute("x",p.toString()),n.destroyIndeterminate||r.doLinearIndeterminate(e,t,i,n,o)}})},aat.prototype.doStripedAnimation=function(e,t,i){var n=this,o=new Vt({}),r=1e3/t.animation.duration;o.animate(e,{duration:0===t.animation.duration&&"Enable"===Ut?2e3:t.animation.duration,delay:t.animation.delay,progress:function(){i+=t.enableRtl?-r:r,e.setAttribute("gradientTransform","translate("+i+") rotate(-45)")},end:function(){t.destroyIndeterminate||n.doStripedAnimation(e,t,i)}})},aat.prototype.doCircularAnimation=function(t,i,e,n,o,r,s,a,l,h,d,p){var c=this,u=new Vt({}),g=r,m=s.startAngle,f=e+a/2,y=0,v=0,b=s.isActive?3e3:s.animation.duration;if(m+="Round"===s.cornerRadius&&o!==eat&&0!==o?s.enableRtl?.45*a:-.45*a:0,o+="Round"===s.cornerRadius&&o!==eat&&0!==o?.45*a:0,n+="Round"===s.cornerRadius&&o!==eat&&0!==o?s.enableRtl?-.45*a:.45*a:0,"Round"===s.cornerRadius&&o!==eat&&0!==o&&s.startAngle===s.endAngle)for(var w=kst(t,i,f,m).x,C=kst(t,i,f,n).x;s.enableRtl!==180<=s.startAngle?C<=w:w<=C;)n+=s.enableRtl?.1:-.1,C=kst(t,i,f,n).x;var S=je(h)?m:h,A=je(h)?o:o-d;g.setAttribute("visibility","Hidden"),u.animate(g,{duration:0===s.animation.duration&&"Enable"===Ut?2e3:b,delay:l,progress:function(e){s.cancelResize=!0,e.timeStamp>=e.delay&&(g.setAttribute("visibility","visible"),s.isActive?(y=c.activeAnimate(e.timeStamp/e.duration,S,A,s.enableRtl),v=Lst(e.timeStamp,.5,.5,e.duration,!0),p.setAttribute("opacity",v.toString())):y=Lst(e.timeStamp,S,A,e.duration,s.enableRtl),g.setAttribute("d",Pst(t,i,f,m,y%360,s.enableRtl,!0)))},end:function(){s.cancelResize=!1,g.setAttribute("visibility",""),g.setAttribute("d",Pst(t,i,f,m,n,s.enableRtl,!0)),s.isActive&&c.doCircularAnimation(t,i,e,n,o,r,s,a,l,h,d,p),s.trigger("animationComplete",{value:s.value,trackColor:s.trackColor,progressColor:s.progressColor})}})},aat.prototype.doCircularIndeterminate=function(e,t,i,n,o,r,s,a,l){var h=this,d=new Vt({}),p=s+(t.enableProgressSegments?0:a/2),c=0===t.animation.duration&&"Enable"===Ut?2e3:t.animation.duration,u=t.enableProgressSegments?4e3/c:6e3/c;d.animate(l,{progress:function(){e.style.visibility="visible",i+=t.enableRtl?-u:u,n+=t.enableRtl?-u:u,e.setAttribute("d",Pst(o,r,p,i%360,n%360,t.enableRtl,!t.enableProgressSegments))},end:function(){t.destroyIndeterminate||h.doCircularIndeterminate(e,t,i,n,o,r,s,a,l)}})},aat.prototype.doLabelAnimation=function(t,i,n,o,e,r){var s,a,l=new Vt({}),h=new Vt({}),d=t.innerHTML,p=0,c=0,u=0,g=o.labelStyle.text,m=o.labelStyle.textAlignment,f=parseInt(t.getAttribute("x"),10);t.setAttribute("visibility","Hidden"),"Linear"===o.type&&(s=(s=o.enableRtl?o.progressRect.x+o.progressRect.width+r/2:i-r/2)<=0?0:s,a=o.enableRtl?s-f:f-s),l.animate(t,{duration:0===o.animation.duration&&"Enable"===Ut?2e3:o.animation.duration,delay:e,progress:function(e){o.cancelResize=!0,e.name="SlideRight","Linear"===o.type?e.timeStamp>=e.delay&&""===g&&(t.setAttribute("visibility","visible"),p=Lst(e.timeStamp,i,n,e.duration,!1),u=parseInt((Math.round(p)/o.progressRect.width*100).toString(),10),t.innerHTML=u.toString()+"%","Far"!==m&&"Center"!==m||(c=Lst(e.timeStamp,s,a,e.duration,o.enableRtl),t.setAttribute("x",c.toString()))):"Circular"===o.type&&""===g&&(t.setAttribute("visibility","visible"),p=Lst(e.timeStamp,i,n-i,e.duration,!1),u=parseInt((Math.round(p)/o.totalAngle*100).toString(),10),t.innerHTML=u.toString()+"%")},end:function(){o.cancelResize=!1,""===g?(t.innerHTML=d,t.setAttribute("x",f.toString())):h.animate(t,{progress:function(e){t.setAttribute("visibility","visible"),p=Lst(e.timeStamp,0,1,e.duration,!1),t.setAttribute("opacity",p.toString())},end:function(){t.setAttribute("opacity","1")}})}})},aat.prototype.doAnnotationAnimation=function(e,t,i,n){var o,r,s,a,l=new Vt({}),h=0<t.annotations.length,d=t.startAngle,p=t.totalAngle,c=(h&&t.progressAnnotationModule&&(r=document.getElementById(t.element.id+"Annotation0").children[0])&&r.children[0]&&"SPAN"===r.children[0].tagName&&(o=r.children[0]),r=(t.argsData.value-t.minimum)/(t.maximum-t.minimum)*t.totalAngle,t.annotateTotal=r=t.argsData.value<t.minimum?0:r,t.annotateEnd=d+r,a=(t.argsData.value-t.minimum)/(t.maximum-t.minimum)*100,a=t.argsData.value<t.minimum?0:Math.round(a),je(i)?d:i),u=je(i)?r:r-n;t.argsData.value<=t.minimum?o.innerHTML=a+"%":l.animate(e,{duration:0===t.animation.duration&&"Enable"===Ut?2e3:t.animation.duration,delay:t.animation.delay,progress:function(e){t.cancelResize=!0,h&&o&&(s=Lst(e.timeStamp,c,u,e.duration,!1),s=parseInt(((Math.round(s)-d)/p*100).toString(),10),o.innerHTML=s?s.toString()+"%":"0%")},end:function(){t.cancelResize=!1,o.innerHTML=a+"%"}})},aat.prototype.activeAnimate=function(e,t,i,n){e=1-Math.pow(1-e,3);return t+(n?-e*i:e*i)};var sat=aat;function aat(){}lat=function(e,t){return(lat=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}lat(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(dat,hat=P$e),dat.prototype.renderAnnotations=function(e){var i=this,t=(this.annotations=this.progress.annotations,document.getElementById(this.progress.element.id+"Annotation_collections"));this.parentElement=t||Q("div",{id:this.progress.element.id+"Annotation_collections",styles:"position:absolute"}),this.annotations.map(function(e,t){i.processAnnotation(e,t,i.parentElement)}),t||e.appendChild(this.parentElement),this.progress.animation.enable&&!this.progress.isIndeterminate&&this.animation.doAnnotationAnimation(this.progress.clipPath,this.progress)},dat.prototype.getModuleName=function(){return"ProgressAnnotation"},dat.prototype.destroy=function(){};var lat,hat,N$e=dat;function dat(e,t){var i=hat.call(this,e)||this;return i.animation=new sat,i.progress=e,i.annotations=t,i}cat.prototype.tooltip=function(e){var t,i=document.getElementById(this.control.element.id+"_tooltip"),n=i&&0<parseInt(i.getAttribute("opacity"),10);this.previousPosition=i.style.left?parseInt(i.style.left,10):0,this.renderTooltip(e,this.control,!n),this.control.tooltip.enable&&"Circular"===this.control.type&&this.control.animation.enable&&!this.control.tooltip.showTooltipOnHover&&(i.style.visibility="hidden",t=this.control.secondaryProgress?this.control.circular.delay+this.control.animation.duration:this.control.animation.duration,this.tooltipDelay(this.control,i,t)),this.control.animation.enable&&!this.control.tooltip.showTooltipOnHover&&"Circular"!==this.control.type&&(t=(this.control.secondaryProgress?this.control.linear:this.control.animation).delay,this.control.secondaryProgress&&(i.style.visibility="hidden"),this.toolTipAnimation(i,this.control,t))},cat.prototype.tooltipDelay=function(e,t,i){new Vt({}).animate(t,{duration:e.animation.duration,delay:i,progress:function(e){e.element.style.visibility="visible"}})},cat.prototype.toolTipAnimation=function(e,n,t){var o=this,i=new Vt({}),r=parseInt(e.style.left,10),s=document.getElementById(this.control.element.id+"_tooltip_svg"),a=parseInt(s.getAttribute("width"),10);i.animate(e,{duration:n.animation.duration,delay:t,progress:function(e){var t,i;n.cancelResize=!0,e.name="SlideRight","Linear"===n.type&&e.timeStamp>=e.delay&&(e.element.style.visibility="visible",i=o.previousPosition||0-(a/2-o.control.progressRect.x-5),t=o.previousPosition?r-i:r+(a/2-o.control.progressRect.x-5),i=Lst(e.timeStamp,i,t,e.duration,n.enableRtl),e.element.style.left="",e.element.style.left=i+"px".toString())},end:function(e){n.cancelResize=!1,e.element.style.left="",e.element.style.left=r+"px".toString()}})},cat.prototype.renderTooltip=function(e,t,i){this.textFormat=this.format(this.control.tooltip.showTooltipOnHover&&(0<=e.target.id.indexOf("Linearbuffer")||0<=e.target.id.indexOf("Circularbuffer"))?this.control.secondaryProgress:this.control.value),this.triggerTooltipRender(e,i,this.textFormat)},cat.prototype.format=function(e){var t,i=e.toString();return this.control.tooltip.format&&(i=this.control.tooltip.format,t=new RegExp("${value}","gm"),i=i.replace(t.source,e.toString())),i},cat.prototype.removeTooltip=function(e){var t=this;document.getElementById(this.control.element.id+"_tooltip")&&(this.fadeInInterval=+setTimeout(function(){t.svgTooltip&&t.svgTooltip.fadeOut()},e))},cat.prototype.triggerTooltipRender=function(e,t,i){var n={cancel:!1,name:oat,text:i+"%"};this.control.trigger(oat,n),i=n.text,n.cancel||(this.text=[].concat(n.text),"Linear"===this.control.type?(i=this.control.linear.linearProgressWidth-2.5+this.control.progressRect.x,n="Round4px"===this.control.cornerRadius?this.control.progressRect.y+5:this.control.progressRect.y+this.control.progressRect.height/2-(this.control.progressThickness||this.control.themeStyle.linearProgressThickness)/2+5,this.createTooltip(this.control,t,(!this.control.tooltip.enable||this.control.tooltip.showTooltipOnHover)&&0<=e.target.id.indexOf("Linearbuffer")?new Hst(this.control.linear.bufferWidth-2.5+this.control.progressRect.x,n):new Hst("Round4px"===this.control.cornerRadius?i-5:i,n),this.control.initialClipRect)):(i=this.control.circular.endPosition.x-2.5,n=this.control.circular.endPosition.y+this.control.progressRect.y-2.5,this.createTooltip(this.control,t,(!this.control.tooltip.enable||this.control.tooltip.showTooltipOnHover)&&0<=e.target.id.indexOf("Circularbuffer")?new Hst(this.control.circular.bufferEndPosition.x-2.5,this.control.circular.bufferEndPosition.y+this.control.progressRect.y-2.5):new Hst(i,n),this.control.initialClipRect))),this.isRendered=!0},cat.prototype.createTooltip=function(e,t,i,n){var o=Pe({},this.control.tooltip.textStyle,null,!0);o.fontWeight=o.fontWeight||this.control.themeStyle.tooltipLabelFont.fontWeight,t?this.svgTooltip=new tr({opacity:this.control.tooltip.textStyle.opacity||("Material3"===this.control.theme||"Material3Dark"===this.control.theme||-1<this.control.theme.indexOf("Bootstrap5")?1:.75),header:"",content:this.text,fill:this.control.tooltip.fill,border:this.control.tooltip.border,enableAnimation:!0,location:i,theme:this.control.theme,areaBounds:n,template:null,offset:7.5,marginX:8,marginY:4.5,textStyle:o,arrowPadding:7,availableSize:this.control.progressSize,duration:300,blazorTemplate:{name:"Template",parent:this.control.tooltip},controlInstance:this.control,enableRTL:e.enableRtl,controlName:"Progressbar"},"#"+this.control.element.id+"_tooltip"):this.svgTooltip&&(this.svgTooltip.location=i,this.svgTooltip.content=this.text,this.svgTooltip.header="",this.svgTooltip.offset=7.5,this.svgTooltip.textStyle=o,this.svgTooltip.areaBounds=n,this.svgTooltip.arrowPadding=7,this.svgTooltip.dataBind())},cat.prototype.getModuleName=function(){return"ProgressTooltip"},cat.prototype.destroy=function(){};var pat=cat;function cat(e){this.text=[],this.previousPosition=0,this.control=e}gat.prototype.createLinearSegment=function(e,t,i,n,o,r){for(var s,a=e.enableRtl?"Round"===e.cornerRadius?e.progressRect.x+e.progressRect.width-.45*o:e.progressRect.x+e.progressRect.width:"Round"===e.cornerRadius?e.progressRect.x+.45*o:e.progressRect.x,l=e.progressRect.y+e.progressRect.height/2,h=e.gapWidth||e.themeStyle.linearGapWidth,d=r/e.segmentCount,p=(r-(e.segmentCount-1)*h-("Round"===e.cornerRadius?e.segmentCount*(.9*o):0))/e.segmentCount,c="Round"===e.cornerRadius?h+.9*o:h,u=e.renderer.createGroup({id:e.element.id+t}),g=Math.ceil(i/d),m=0,f="Round"===e.cornerRadius?i-.9*o:i,y=e.progressThickness||e.themeStyle.linearProgressThickness,v=0;v<g;v++)s=m<e.segmentColor.length?e.segmentColor[m]:e.segmentColor[m=0],m++,s=new No(e.element.id+t+v,"none",y,s,n,"0",this.getLinearSegmentPath(a,l,f<p?f:p,e.enableRtl)),s=e.renderer.drawPath(s),"Round"===e.cornerRadius&&s.setAttribute("stroke-linecap","round"),u.appendChild(s),a+=e.enableRtl?-p-c:p+c,f=(f-=p+c)<0?0:f;return u},gat.prototype.getLinearSegmentPath=function(e,t,i,n){return"M "+e+" "+t+" L"+(e+(n?-i:i))+" "+t},gat.prototype.createCircularSegment=function(e,t,i,n,o,r,s,a,l,h){var d=e.startAngle,p=this.widthToAngle(e.minimum,e.maximum,r,e.totalAngle);p-="Round"===e.cornerRadius&&e.totalAngle===eat?this.widthToAngle(0,h,.45*a,l):0;for(var c,u,g,r=(h-(e.totalAngle===eat?e.segmentCount:e.segmentCount-1)*(e.gapWidth||e.themeStyle.circularGapWidth)-("Round"===e.cornerRadius?.9*(e.totalAngle===eat?e.segmentCount:e.segmentCount-1)*a:0))/e.segmentCount,m=this.widthToAngle(0,h,h/e.segmentCount,l),f=(m-="Round"===e.cornerRadius&&e.totalAngle===eat?this.widthToAngle(0,h,.45*a,l):0,this.widthToAngle(0,h,r,l)),y=this.widthToAngle(0,h,e.gapWidth||e.themeStyle.circularGapWidth,l),v=(y+="Round"===e.cornerRadius?this.widthToAngle(0,h,.9*a,l):0,e.renderer.createGroup({id:e.element.id+t})),r=Math.floor(p/m),b=Math.ceil((p-y*r)/f),w=(d+(e.enableRtl?-f:f))%360,C=0,S=e.progressThickness||e.themeStyle.circularProgressThickness,A=0;A<b;A++)c=Pst(i,n,o,d,u=e.enableRtl?e.startAngle-p>w?e.startAngle-p:w:e.startAngle+p<w?e.startAngle+p:w,e.enableRtl),g=C<e.segmentColor.length?e.segmentColor[C]:e.segmentColor[C=0],C++,g=new No(e.element.id+t+A,"none",S,g,s,"0",c),c=e.renderer.drawPath(g),"Round"===e.cornerRadius&&c.setAttribute("stroke-linecap","round"),v.appendChild(c),d=u+(e.enableRtl?-y:y),w+=e.enableRtl?-f-y:f+y;return v},gat.prototype.widthToAngle=function(e,t,i,n){return(i-e)/(t-e)*n},gat.prototype.createLinearRange=function(e,t,i){for(var n,o,r,s,a=t.progressRect.x+(t.enableRtl?t.progressRect.width:0),l=t.progressRect.y+t.progressRect.height/2,h=t.renderer.createGroup({id:t.element.id+"_LinearRangeGroup"}),d=t.rangeColors,p=t.progressThickness||t.themeStyle.linearProgressThickness,c=t.themeStyle.progressOpacity,u=t.minimum,g=t.value,m=t.enableRtl?.1:-.1,f=0;f<d.length;f++)n=d[f].start>=u&&d[f].start<=g&&d[f].end>=u&&d[f].end<=g,o=e*t.calculateProgressRange(d[f].start,u,g),r=e*t.calculateProgressRange(d[f].end,u,g),o=a+(t.enableRtl?-o:o),r=a+(t.enableRtl?-r:r),o=n?t.isGradient&&0<f?o+m:o:a,s=t.isGradient?"url(#lineRangeGrad_"+f+")":d[f].color,s=new No(t.element.id+"_LinearRange_"+f,"none",p,s,c,"0","M "+o+" "+l+" L"+(r=n?r:a)+" "+l),n=t.renderer.drawPath(s),"Round"===t.cornerRadius&&i&&n.setAttribute("stroke-linecap","round"),h.appendChild(n),t.isGradient&&(s=(d.length-1===f?d[f]:d[f+1]).color,n=this.setLinearGradientColor(f,d[f].color,s,o,r,t),h.appendChild(n));return h},gat.prototype.createCircularRange=function(e,t,i,n){for(var o,r,s,a=n.renderer.createGroup({id:n.element.id+"_CircularRangeGroup"}),l=n.rangeColors,h=n.progressThickness||n.themeStyle.linearProgressThickness,d=n.themeStyle.progressOpacity,p=n.minimum,c=n.value,u=n.startAngle,g=this.widthToAngle(n.minimum,n.maximum,n.value,n.totalAngle),m=0;m<l.length;m++)s=l[m].start>=p&&l[m].start<=c&&l[m].end>=p&&l[m].end<=c,o=this.widthToAngle(p,c,l[m].start,g),r=this.widthToAngle(p,c,l[m].end,g),o=s?(u+(n.enableRtl?-o:o))%360:u,r=s?(u+(n.enableRtl?-r:r))%360:u,s=n.isGradient?"url(#circleRangeGrad_"+m+")":l[m].color,s=new No(n.element.id+"_CircularRange_"+m,"none",h,s,d,"0",Pst(e,t,i,o,r,n.enableRtl)),s=n.renderer.drawPath(s),"Round"===n.cornerRadius&&o!==r&&s.setAttribute("stroke-linecap","round"),a.appendChild(s),n.isGradient&&(s=(l.length-1===m?l[m]:l[m+1]).color,s=this.setCircularGradientColor(m,l[m].color,s,o,r,i,e,t,n),a.appendChild(s));return a},gat.prototype.setLinearGradientColor=function(e,t,i,n,o,r){var s=[],e={id:"lineRangeGrad_"+e,x1:n.toString(),x2:o.toString()},n=(s[0]={color:t,colorStop:"50%"},s[1]={color:i,colorStop:"100%"},r.renderer.drawGradient("linearGradient",e,s));return n.firstElementChild.setAttribute("gradientUnits","userSpaceOnUse"),n},gat.prototype.setCircularGradientColor=function(e,t,i,n,o,r,s,a,l){var h=[],n=kst(s,a,r,n),s=kst(s,a,r,o),a={id:"circleRangeGrad_"+e,x1:n.x.toString(),x2:s.x.toString(),y1:n.y.toString(),y2:s.y.toString()},r=(h[0]={color:t,colorStop:"50%"},h[1]={color:i,colorStop:"100%"},l.renderer.drawGradient("linearGradient",a,h));return r.firstElementChild.setAttribute("gradientUnits","userSpaceOnUse"),r};var uat=gat;function gat(){}fat.prototype.renderLinearTrack=function(){var e,t,i=this.progress,n=i.renderer.createGroup({id:i.element.id+"_LinearTrackGroup"}),o=(this.isRange=""!==this.progress.rangeColors[0].color||null!==this.progress.rangeColors[0].start||null!==this.progress.rangeColors[0].end,i.trackThickness||i.themeStyle.linearTrackThickness),r=i.argsData.trackColor||i.themeStyle.linearTrackColor;"Round4px"===i.cornerRadius?e=1<i.segmentCount?this.createRoundCornerSegment("_LinearTrack_",r,o,!0,0,i):(t=new No(i.element.id+"_Lineartrack",r,0,"none",i.themeStyle.trackOpacity,"0",this.cornerRadius(i.progressRect.x,i.progressRect.y,i.progressRect.width,o,4,"")),i.renderer.drawPath(t)):(t=new No(i.element.id+"_Lineartrack","none",o,r,i.themeStyle.trackOpacity,"0",i.getPathLine(i.progressRect.x,i.progressRect.width,o)),e=i.renderer.drawPath(t),i.trackWidth=e.getTotalLength(),"Round"!==i.cornerRadius||this.isRange||e.setAttribute("stroke-linecap","round"),1<i.segmentCount&&!this.isRange&&!i.enableProgressSegments&&(i.segmentSize=i.calculateSegmentSize(i.trackWidth,o),e.setAttribute("stroke-dasharray",i.segmentSize))),n.appendChild(e),i.svgObject.appendChild(n)},fat.prototype.renderLinearProgress=function(e,t){void 0===t&&(t=0);var i,n,o=this.progress,r=o.value>=o.maximum,s=o.progressRect.width*o.calculateProgressRange(o.value>o.maximum?o.maximum:o.value),a=o.calculateProgressRange(o.argsData.value>o.maximum?o.maximum:o.argsData.value),l=(this.linearProgressWidth=o.progressRect.width*(o.isIndeterminate&&!o.enableProgressSegments?1:a),n=e?Bo(o.element.id+"_LinearProgressGroup"):o.renderer.createGroup({id:o.element.id+"_LinearProgressGroup"}),o.progressThickness||o.themeStyle.linearProgressThickness),h=o.isStriped?"url(#"+o.element.id+"_LinearStriped)":this.checkingLinearProgressColor(),d="Round4px"===o.cornerRadius?new No(o.element.id+"_Linearprogress",h,0,"none",o.themeStyle.progressOpacity,"0",this.cornerRadius(o.progressRect.x,o.progressRect.y,this.linearProgressWidth,l,4,r||o.isIndeterminate?"":"start")):new No(o.element.id+"_Linearprogress","none",l,h,o.themeStyle.progressOpacity,"0",o.getPathLine(o.progressRect.x,this.linearProgressWidth,l));o.progressWidth=o.renderer.drawPath(d).getTotalLength(),o.segmentSize=o.enableProgressSegments?o.calculateSegmentSize(o.progressWidth,l):o.segmentSize,null===o.secondaryProgress||o.isIndeterminate||this.renderLinearBuffer(o),null!==o.argsData.value&&("Round4px"===o.cornerRadius?i=1<o.segmentCount?this.createRoundCornerSegment("_Linearprogress_",h,l,!1,this.linearProgressWidth,o,o.themeStyle.progressOpacity):o.renderer.drawPath(d):0===o.segmentColor.length||o.isIndeterminate||this.isRange?this.isRange&&!o.isIndeterminate?i=this.segment.createLinearRange(this.linearProgressWidth,o,a):(e?((i=Bo(o.element.id+"_Linearprogress")).setAttribute("d",o.getPathLine(o.progressRect.x,this.linearProgressWidth,l)),i.setAttribute("stroke",h)):i=o.renderer.drawPath(d),1<o.segmentCount&&i.setAttribute("stroke-dasharray",o.segmentSize),"Round"===o.cornerRadius&&a&&i.setAttribute("stroke-linecap","round")):(h=o.enableProgressSegments?o.progressWidth:o.trackWidth,i=this.segment.createLinearSegment(o,"_LinearProgressSegment",this.linearProgressWidth,o.themeStyle.progressOpacity,l,h)),n.appendChild(i),o.isStriped&&!o.isIndeterminate&&(d=this.checkingLinearProgressColor(),this.renderLinearStriped(d,n,o)),!o.isActive||o.isIndeterminate||o.isStriped||this.renderActiveState(n,a,this.linearProgressWidth,l,e),!(o.animation.enable&&"Disable"!==Ut||"Enable"===Ut)||o.isIndeterminate||o.isActive||o.isStriped||(h=null!==o.secondaryProgress?o.animation.delay+(this.bufferWidth-this.linearProgressWidth):o.animation.delay,this.delay=h,d=o.createClipPath(o.clipPath,a,null,e,l,!1,"Round4px"===o.cornerRadius&&r),n.appendChild(o.clipPath),i.style.clipPath="url(#"+o.element.id+"_clippath)",this.animation.doLinearAnimation(d,o,h,e?t:0)),o.isIndeterminate&&(r=o.createClipPath(o.clipPath,o.enableProgressSegments?1:a,null,e,l,o.enableProgressSegments),n.appendChild(o.clipPath),i.setAttribute("style","clip-path:url(#"+o.element.id+"_clippath)"),this.animation.doLinearIndeterminate(o.enableProgressSegments?i:r,this.linearProgressWidth,l,o,r)),o.svgObject.appendChild(n),o.previousWidth=s)},fat.prototype.renderLinearBuffer=function(e){var t,i,n,o=e.secondaryProgress>=e.maximum,r=e.calculateProgressRange(e.secondaryProgress>e.maximum?e.maximum:e.secondaryProgress),s=(this.bufferWidth=i=e.progressRect.width*r,e.renderer.createGroup({id:e.element.id+"_LinearBufferGroup"})),a=e.secondaryProgressThickness||e.progressThickness||e.themeStyle.linearProgressThickness,l=e.secondaryProgressColor||e.themeStyle.bufferColor||this.checkingLinearProgressColor();"Round4px"===e.cornerRadius?t=1<e.segmentCount?this.createRoundCornerSegment("_Linearbuffer_",l,a,!1,i,e,e.themeStyle.bufferOpacity):(n=new No(e.element.id+"_Linearbuffer",l,0,"none",e.themeStyle.bufferOpacity,"0",this.cornerRadius(e.progressRect.x,e.progressRect.y,i,a,4,o?"":"start")),e.renderer.drawPath(n)):(n=new No(e.element.id+"_Linearbuffer","none",a,l,e.themeStyle.bufferOpacity,"0",e.getPathLine(e.progressRect.x,i,a)),0===e.segmentColor.length||e.isIndeterminate||this.isRange?(t=e.renderer.drawPath(n),1<e.segmentCount&&!this.isRange&&t.setAttribute("stroke-dasharray",e.segmentSize),"Round"!==e.cornerRadius||this.isRange||t.setAttribute("stroke-linecap","round")):(l=e.enableProgressSegments?e.progressWidth:e.trackWidth,t=this.segment.createLinearSegment(e,"_LinearBufferSegment",i,e.themeStyle.bufferOpacity,e.progressThickness||e.themeStyle.linearProgressThickness,l))),s.appendChild(t),(e.animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&(n=e.createClipPath(e.bufferClipPath,r,null,!1,a,!1,"Round4px"===e.cornerRadius&&o),s.appendChild(e.bufferClipPath),t.setAttribute("style","clip-path:url(#"+e.element.id+"_clippathBuffer)"),this.animation.doLinearAnimation(n,e,e.animation.delay,0)),e.svgObject.appendChild(s)},fat.prototype.renderLinearLabel=function(e){void 0===e&&(e=!1);var t,i,n,o=this.progress.progressThickness||this.progress.themeStyle.linearProgressThickness,r=this.progress,s=r.labelStyle.textAlignment,a=r.labelStyle.text,l=r.progressRect.width*r.calculateProgressRange(r.value>r.maximum?r.maximum:r.value),h=r.renderer.createGroup({id:r.element.id+"_LinearLabelGroup"}),d=(document.getElementById(h.id)&&document.getElementById(h.id).remove(),(r.value-r.minimum)/(r.maximum-r.minimum)*100),d=r.value<r.minimum?0:+d.toFixed(2),a={cancel:!1,text:a||String(d)+"%",color:r.labelStyle.color||this.progress.themeStyle.linearLabelFont.color};r.trigger("textRender",a),a.cancel||(d=So(a.text,r.labelStyle,r.themeStyle.linearLabelFont),i=r.enableRtl?r.progressRect.x+r.progressRect.width-d.width/2:r.progressRect.x+d.width/2,r.labelOnTrack?"Near"===s?t=i+(r.enableRtl?-5:5):(t="Center"===s?(n=r.enableRtl?r.progressRect.x+r.progressRect.width-l/2:r.progressRect.x+l/2,r.enableRtl,l<d.width/2?i:n):(n=r.enableRtl?r.progressRect.x+r.progressRect.width-l+d.width/2:r.progressRect.x+l-d.width/2,n+=r.enableRtl?5:-5,(r.enableRtl?n<=i:i<=n)?n:i),!l&&!r.enableRtl&&t/2<r.progressRect.x+5&&(t+=5)):"Near"===s?t=i+(r.enableRtl?-5:5):"Center"===s?t=(r.progressRect.x+r.progressRect.width)/2:(t=r.enableRtl?r.progressRect.x+d.width/2:r.progressRect.x+r.progressRect.width-d.width/2,t+=r.enableRtl?5:-5),n="Round4px"===this.progress.cornerRadius?r.progressRect.y+o/2+d.height/4:r.progressRect.y+r.progressRect.height/2+d.height/4,i=new Mst(r.element.id+"_linearLabel",r.labelStyle.size||r.themeStyle.linearLabelFont.size,r.labelStyle.fontStyle||r.themeStyle.linearLabelFont.fontStyle,r.labelStyle.fontFamily||r.themeStyle.linearLabelFont.fontFamily,r.labelStyle.fontWeight||r.themeStyle.linearLabelFont.fontWeight,"middle",a.color,t,n),s=r.renderer.createText(i,a.text),h.appendChild(s),(r.animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&!r.isIndeterminate&&(o=r.renderer.createClipPath({id:r.element.id+"_clippathLabel"}),r.createClipPath(o,1,null,!1,r.progressThickness||r.themeStyle.linearProgressThickness,!0),h.appendChild(o),s.style.clipPath="url(#"+r.element.id+"_clippathLabel)",this.animation.doLabelAnimation(s,e?r.previousLabelWidth:0,l-(e?r.previousLabelWidth:0),r,this.delay,d.width)),r.svgObject.appendChild(h),r.previousLabelWidth=l)},fat.prototype.renderActiveState=function(e,t,i,n,o){var r,s,a=this.progress,l=a.value===a.maximum,l=("Round4px"===a.cornerRadius?r=1<a.segmentCount?this.createRoundCornerSegment("_LinearActiveProgress_","#ffffff",n,!1,i,a,.5):(s=new No(a.element.id+"_LinearActiveProgress","#ffffff",0,"none",.5,"0",this.cornerRadius(a.progressRect.x,a.progressRect.y,i,n,4,l?"":"start")),a.renderer.drawPath(s)):(o?(r=Bo(a.element.id+"_LinearActiveProgress")).setAttribute("d",a.getPathLine(a.progressRect.x,i,n)):(s=new No(a.element.id+"_LinearActiveProgress","none",n,"#ffffff",.5,"",a.getPathLine(a.progressRect.x,i,n)),r=a.renderer.drawPath(s)),1<a.segmentCount&&!this.isRange&&r.setAttribute("stroke-dasharray",a.segmentSize),"Round"===a.cornerRadius&&t&&!this.isRange&&r.setAttribute("stroke-linecap","round")),a.createClipPath(a.clipPath,t,null,o,n,!1));r.setAttribute("style","clip-path:url(#"+a.element.id+"_clippath)"),e.appendChild(r),e.appendChild(a.clipPath),this.animation.doLinearAnimation(l,a,0,0,r)},fat.prototype.renderLinearStriped=function(e,t,i){for(var n,o=i.renderer.createDefs(),r=document.createElementNS(nat,"linearGradient"),s=[{offset:"50%","stop-color":e,"stop-opacity":"1"},{offset:"50%","stop-color":e,"stop-opacity":"0.4"}],r=Fst({id:i.element.id+"_LinearStriped",x1:i.progressRect.x.toString(),x2:(i.progressRect.x+14).toString(),spreadMethod:"repeat",gradientUnits:"userSpaceOnUse",gradientTransform:"rotate(-45)"},r),a=0;a<s.length;a++)n=document.createElementNS(nat,"stop"),n=Fst(s[a],n),r.appendChild(n);o.appendChild(r),t.appendChild(o),(i.animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&this.animation.doStripedAnimation(r,i,0)},fat.prototype.checkingLinearProgressColor=function(){var e,t=this.progress;switch(t.role){case"Success":e=t.themeStyle.success;break;case"Info":e=t.themeStyle.info;break;case"Warning":e=t.themeStyle.warning;break;case"Danger":e=t.themeStyle.danger;break;default:e=t.argsData.progressColor||t.themeStyle.linearProgressColor}return e},fat.prototype.cornerRadius=function(e,t,i,n,o,r){var s="",a=i,l=o;switch(r){case"start":s="M"+e+","+t+" h"+i+" v"+n+" h"+-i+" a"+o+","+o+" 0 0 1 "+-o+","+-o+" v"+(2*o-n)+" a"+o+","+o+" 0 0 1 "+o+","+-o+" z";break;case"end":s="M"+e+","+t+" h"+(a-l)+" a"+l+","+l+" 0 0 1 "+l+","+l+" v"+(n-2*l)+" a"+l+","+l+" 0 0 1 "+-l+","+l+" h"+(o-a)+" v"+-n+" z";break;case"none":s="M"+e+","+t+" h"+i+" v"+n+" h"+-i+" v"+-n+" z";break;default:s="M"+e+","+t+" h"+(i-o)+" a"+o+","+o+" 0 0 1 "+o+","+o+" v"+(n-2*o)+" a"+o+","+o+" 0 0 1 "+-o+","+o+" h"+(o-i)+" a"+o+","+o+" 0 0 1 "+-o+","+-o+" v"+(2*o-n)+" a"+o+","+o+" 0 0 1 "+o+","+-o+" z"}return s},fat.prototype.createRoundCornerSegment=function(e,t,i,n,o,r,s){for(var a,l,h,d=r.progressRect.x,p=r.progressRect.y,c=r.progressRect.width,u=r.gapWidth||r.themeStyle.linearGapWidth,g=(c-(r.segmentCount-1)*u)/r.segmentCount,m=r.renderer.createGroup({id:r.element.id+e+"SegmentGroup"}),f=1;f<=r.segmentCount;f++)if(l=1===f||f===r.segmentCount?1===f?"start":"end":"none",n)a=new No(r.element.id+e+f,t,0,"none",r.themeStyle.trackOpacity,"0",this.cornerRadius(d,p,g,i,4,l)),h=r.renderer.drawPath(a),m.appendChild(h),d+=g+u;else if(a=new No(r.element.id+e+f,t,0,"none",s,"0",this.cornerRadius(d,p,o<g?o:g,i,4,l)),h=r.renderer.drawPath(a),m.appendChild(h),d+=g+u,(o-=g+u)<=0)break;return m};var mat=fat;function fat(e){this.segment=new uat,this.animation=new sat,this.progress=e}vat.prototype.renderCircularTrack=function(){var e=this.progress,t=e.renderer.createGroup({id:e.element.id+"_CircularTrackGroup"}),i=e.startAngle,n=(e.totalAngle=(e.endAngle-e.startAngle)%360,e.totalAngle=e.totalAngle<=0?360+e.totalAngle:e.totalAngle,e.totalAngle-=360===e.totalAngle?.01:0,this.trackEndAngle=a=(e.startAngle+(e.enableRtl?-e.totalAngle:+e.totalAngle))%360,this.centerX=e.progressRect.x+e.progressRect.width/2,this.centerY=e.progressRect.y+e.progressRect.height/2,this.maxThickness=Math.max(e.trackThickness,e.progressThickness)||Math.max(e.themeStyle.circularProgressThickness,e.themeStyle.circularTrackThickness),this.availableSize=Math.min(e.progressRect.height,e.progressRect.width)/2-this.maxThickness/2,s=Bst(e.radius,this.availableSize),e.argsData.trackColor||e.themeStyle.circularTrackColor),o=e.enablePieProgress?e.argsData.trackColor||e.themeStyle.circularTrackColor:"none",r=e.enablePieProgress?0:e.trackThickness||e.themeStyle.circularTrackThickness,s=Pst(this.centerX,this.centerY,null===s?0:s,i,a,e.enableRtl,e.enablePieProgress),i=(this.isRange=""!==this.progress.rangeColors[0].color||null!==this.progress.rangeColors[0].start||null!==this.progress.rangeColors[0].end,new No(e.element.id+"_Circulartrack",o,r,n,e.themeStyle.trackOpacity,"0",s)),a=e.renderer.drawPath(i);e.trackWidth=a.getTotalLength(),1<e.segmentCount&&!e.enableProgressSegments&&!e.enablePieProgress&&!this.isRange&&(e.segmentSize=e.calculateSegmentSize(e.trackWidth,r),a.setAttribute("stroke-dasharray",e.segmentSize)),"Round"!==e.cornerRadius||e.enablePieProgress||this.isRange||a.setAttribute("stroke-linecap","round"),t.appendChild(a),e.svgObject.appendChild(t)},vat.prototype.renderCircularProgress=function(e,t,i){var n,o,r,s,a,l=this.progress,h=l.startAngle,d=i?Bo(l.element.id+"_CircularProgressGroup"):l.renderer.createGroup({id:l.element.id+"_CircularProgressGroup"}),p=Bst(l.innerRadius,this.availableSize),c=(p=null===p?0:p,l.previousTotalEnd=r=l.calculateProgressRange(l.argsData.value>l.maximum?l.maximum:l.argsData.value),(l.startAngle+(l.enableRtl?-r:r))%360),u=(l.previousEndAngle=a=l.isIndeterminate&&!l.enableProgressSegments?(l.startAngle+(l.enableRtl?-l.totalAngle:l.totalAngle))%360:c,o=(o=(r-l.startAngle)%360)<=0?360+o:o,o-=360==o?.01:0,Pst(this.centerX,this.centerY,p,h,a,l.enableRtl,l.enablePieProgress)),g=this.checkingCircularProgressColor(),m=l.enablePieProgress?g:"none",f=l.progressThickness||l.themeStyle.circularProgressThickness,y=l.enablePieProgress?0:f,m=new No(l.element.id+"_Circularprogress",m,y,g,l.themeStyle.progressOpacity,"0",u);l.progressWidth=l.renderer.drawPath(m).getTotalLength(),l.segmentSize=this.validateSegmentSize(l,f),this.endPosition=kst(this.centerX,this.centerY,p,a),null===l.secondaryProgress||l.isIndeterminate||this.renderCircularBuffer(l,p,o),null!==l.argsData.value&&(0===l.segmentColor.length||l.isIndeterminate||l.enablePieProgress?this.isRange&&!l.isIndeterminate?s=this.segment.createCircularRange(this.centerX,this.centerY,p,l):(i?(n=(s=Bo(l.element.id+"_Circularprogress")).getAttribute("d"),s.setAttribute("stroke",g),s.setAttribute("d",u)):s=l.renderer.drawPath(m),1<l.segmentCount&&!l.enablePieProgress&&s.setAttribute("stroke-dasharray",l.segmentSize),"Round"===l.cornerRadius&&h!==a&&s.setAttribute("stroke-linecap","round")):(g=l.enableProgressSegments?o:l.totalAngle,m=l.enableProgressSegments?l.progressWidth:l.trackWidth,s=this.segment.createCircularSegment(l,"_CircularProgressSegment",this.centerX,this.centerY,p,l.argsData.value,l.themeStyle.progressOpacity,f,g,m)),d.appendChild(s),!l.isActive||l.isIndeterminate||l.enablePieProgress||this.renderActiveState(d,p,y,u,c,r,i),(l.animation.enable&&"Disable"!==Ut||"Enable"===Ut||l.isIndeterminate)&&(this.delay=null!==l.secondaryProgress?300:l.animation.delay,a=l.createClipPath(l.clipPath,null,i?n:"",i),d.appendChild(l.clipPath),!(l.animation.enable&&"Disable"!==Ut||"Enable"===Ut)||l.isIndeterminate||l.isActive||(s.style.clipPath="url(#"+l.element.id+"_clippath)",this.animation.doCircularAnimation(this.centerX,this.centerY,p,c,r,a,l,f,this.delay,i?e:null,i?t:null)),l.isIndeterminate)&&(l.enableProgressSegments&&a.setAttribute("d",Pst(this.centerX,this.centerY,p+f/2,l.startAngle,this.trackEndAngle,l.enableRtl,!0)),s.setAttribute("style","clip-path:url(#"+l.element.id+"_clippath)"),this.animation.doCircularIndeterminate(l.enableProgressSegments?s:a,l,h,c,this.centerX,this.centerY,p,f,a)),l.svgObject.appendChild(d))},vat.prototype.renderCircularBuffer=function(e,t,i){var n,o=e.renderer.createGroup({id:e.element.id+"_ CircularBufferGroup"}),r=e.calculateProgressRange(e.secondaryProgress>e.maximum?e.maximum:e.secondaryProgress),s=(e.startAngle+(e.enableRtl?-r:r))%360,a=Pst(this.centerX,this.centerY,t,e.startAngle,s,e.enableRtl,e.enablePieProgress),l=(this.bufferEndPosition=kst(this.centerX,this.centerY,t,s),e.secondaryProgressColor||e.themeStyle.bufferColor||this.checkingCircularProgressColor()),h=e.enablePieProgress?l:"none",d=e.enablePieProgress?0:e.secondaryProgressThickness||e.progressThickness||e.themeStyle.circularProgressThickness,h=new No(e.element.id+"_Circularbuffer",h,d,l,e.themeStyle.bufferOpacity,"0",a);0===e.segmentColor.length||e.isIndeterminate||e.enablePieProgress||this.isRange?(n=e.renderer.drawPath(h),1<e.segmentCount&&!e.enablePieProgress&&!this.isRange&&n.setAttribute("stroke-dasharray",e.segmentSize),"Round"!==e.cornerRadius||this.isRange||n.setAttribute("stroke-linecap","round")):(l=e.enableProgressSegments?i:e.totalAngle,a=e.enableProgressSegments?e.progressWidth:e.trackWidth,n=this.segment.createCircularSegment(e,"_CircularBufferSegment",this.centerX,this.centerY,t,e.secondaryProgress>e.maximum?e.maximum:e.secondaryProgress,e.themeStyle.bufferOpacity,d,l,a)),o.appendChild(n),(e.animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&!e.isActive&&(h=e.createClipPath(e.bufferClipPath,null,"",!1),o.appendChild(e.bufferClipPath),n.setAttribute("style","clip-path:url(#"+e.element.id+"_clippathBuffer)"),this.animation.doCircularAnimation(this.centerX,this.centerY,t,s,r,h,e,e.progressThickness||e.themeStyle.circularProgressThickness,e.animation.delay)),e.svgObject.appendChild(o)},vat.prototype.renderCircularLabel=function(e){void 0===e&&(e=!1);var t,i=this.progress,n=i.labelStyle.text,o=i.renderer.createGroup({id:i.element.id+"_CircularLabelGroup"}),r=(document.getElementById(o.id)&&document.getElementById(o.id).remove(),(i.value-i.minimum)/(i.maximum-i.minimum)*100),r=i.value<i.minimum?0:+r.toFixed(2),n={cancel:!1,text:n||String(r)+"%",color:i.labelStyle.color||i.themeStyle.circularLabelFont.color};i.trigger("textRender",n),n.cancel||(r=So(n.text,i.labelStyle,i.themeStyle.circularLabelFont),r=this.centerY+r.height/2,r=new Mst(i.element.id+"_circularLabel",i.labelStyle.size||i.themeStyle.circularLabelFont.size,i.labelStyle.fontStyle||i.themeStyle.circularLabelFont.fontStyle,i.labelStyle.fontFamily||i.themeStyle.circularLabelFont.fontFamily,i.labelStyle.fontWeight||i.themeStyle.circularLabelFont.fontWeight,"middle",n.color,this.centerX,r,i.progressRect.width,i.progressRect.height),r=i.renderer.createText(r,n.text),o.appendChild(r),(i.animation.enable&&"Disable"!==Ut||"Enable"===Ut)&&!i.isIndeterminate&&(t=(i.value-i.minimum)/(i.maximum-i.minimum)*i.totalAngle,t=i.value<i.minimum?0:t,this.animation.doLabelAnimation(r,e?i.previousWidth:i.startAngle,t,i,this.delay)),i.svgObject.appendChild(o),i.previousWidth=t)},vat.prototype.renderActiveState=function(e,t,i,n,o,r,s){var a,l=this.progress,i=i+1,n=(s?(a=Bo(l.element.id+"_CircularActiveProgress")).setAttribute("d",n):(n=new No(l.element.id+"_CircularActiveProgress","none",i,"#ffffff",.5,"0",n),a=l.renderer.drawPath(n)),1<l.segmentCount&&a.setAttribute("stroke-dasharray",l.segmentSize),"Round"===l.cornerRadius&&a.setAttribute("stroke-linecap","round"),l.createClipPath(l.clipPath,null,"",s));a.setAttribute("style","clip-path:url(#"+l.element.id+"_clippath)"),e.appendChild(a),e.appendChild(l.clipPath),this.animation.doCircularAnimation(this.centerX,this.centerY,t,o,r,n,l,i,0,null,null,a)},vat.prototype.validateSegmentSize=function(e,t){var i=parseInt(e.radius,10)-parseInt(e.innerRadius,10),e=0==i||e.enableProgressSegments?e.enableProgressSegments?e.calculateSegmentSize(e.progressWidth,t):e.segmentSize:(i=e.trackWidth+(i<0?e.trackWidth*Math.abs(i)/parseInt(e.radius,10):-(e.trackWidth*Math.abs(i))/parseInt(e.radius,10)),e.calculateSegmentSize(i,t));return e},vat.prototype.checkingCircularProgressColor=function(){var e,t=this.progress;switch(t.role){case"Success":e=t.themeStyle.success;break;case"Info":e=t.themeStyle.info;break;case"Warning":e=t.themeStyle.warning;break;case"Danger":e=t.themeStyle.danger;break;default:e=t.argsData.progressColor||t.themeStyle.circularProgressColor}return e};var yat=vat;function vat(e){this.segment=new uat,this.animation=new sat,this.progress=e}bat=function(e,t){return(bat=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])}))(e,t)};var bat,wat,Cat,H$e=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},set=(function(e,t){function i(){this.constructor=e}bat(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Sat,wat=Ji),(Cat=Sat).prototype.getModuleName=function(){return"progressbar"},Sat.prototype.preRender=function(){this.unWireEvents(),this.initPrivateVariable(),this.wireEvents()},Sat.prototype.initPrivateVariable=function(){this.progressRect=new Sst(0,0,0,0),this.progressSize=new Ast(0,0)},Sat.prototype.render=function(){var e=this;this.trigger("load",{progressBar:this}),this.element.style.display="block",this.element.style.position="relative",this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin",this.minimum.toString()),this.element.setAttribute("aria-valuemax",this.maximum.toString()),this.element.setAttribute("aria-valuenow",this.value?this.value.toString():"0"),this.element.setAttribute("tabindex","0"),this.element.setAttribute("aria-label",this.labelStyle.text||"progress bar"),this.calculateProgressBarSize(),this.setTheme(),this.createSVG(),this.argsData={value:this.value,progressColor:this.progressColor,trackColor:this.trackColor},this.argsData.value===this.maximum?this.trigger(iat,this.argsData,function(){e.controlRendering()}):this.trigger(tat,this.argsData,function(){e.controlRendering()})},Sat.prototype.controlRendering=function(){this.renderElements(),this.trigger("loaded",{progressBar:this}),this.renderComplete(),this.controlRenderedTimeStamp=(new Date).getTime()},Sat.prototype.calculateProgressBarSize=function(){var e=this.element.clientWidth||this.element.offsetWidth,t=this.element.clientHeight,i="Linear"===this.type?200:120,n="Linear"===this.type?30:120,o=Math.max(this.progressThickness,this.trackThickness),n="Linear"===this.type&&n-10<o?o+10:n;this.progressSize.width=Bst(this.width,e)||e||i,this.progressSize.height=Bst(this.height,t)||t||n,this.progressRect.x=this.margin.left,this.progressRect.y=this.margin.top,this.progressRect.width=this.progressSize.width-(this.margin.left+this.margin.right),this.progressRect.height=this.progressSize.height-(this.margin.top+this.margin.bottom),this.initialClipRect=new Sst(this.progressRect.x,this.progressRect.y,this.progressSize.height,this.progressSize.width)},Sat.prototype.renderAnnotations=function(){this.renderAnnotation()},Sat.prototype.renderElements=function(){this.createSecondaryElement(),this.renderTrack(),this.renderProgress(),this.renderLabel(),0<this.annotations.length&&this.renderAnnotations(),this.setSecondaryElementPosition(),this.tooltip.enable&&!this.tooltip.showTooltipOnHover&&this.progressTooltipModule.tooltip()},Sat.prototype.createSecondaryElement=function(){var e=document.getElementById(this.element.id+"Secondary_Element"),t=(this.tooltip.enable&&(this.tooltipElement=Q("div",{id:this.element.id+"_tooltip",className:"ejSVGTooltip",styles:"pointer-events: none; position: absolute; zIndex: 1; visibility: visible"}),e)&&this.secElement.appendChild(this.tooltipElement),document.getElementById(this.element.id+"_tooltip"));e?(e.innerHTML="",this.secElement=t?e.appendChild(t):e):(this.secElement=Q("div",{id:this.element.id+"Secondary_Element",styles:"position: absolute"}),this.element.appendChild(this.secElement),this.tooltipElement&&this.secElement.appendChild(this.tooltipElement))},Sat.prototype.setSecondaryElementPosition=function(){var e,t=this.secElement,i=this.element.getBoundingClientRect();Bo(this.svgObject.id)&&(e=Bo(this.svgObject.id).getBoundingClientRect(),t.style.left=Math.max(e.left-i.left,0)+"px",t.style.top=Math.max(e.top-i.top,0)+"px")},Sat.prototype.createSVG=function(){this.removeSvg(),this.renderer=new fo(this.element.id),this.svgObject=this.renderer.createSvg({id:this.element.id+"SVG",width:this.progressSize.width,height:this.progressSize.height,style:"background-color:"+this.themeStyle.backgroundColor})},Sat.prototype.clipPathElement=function(){this.clipPath=this.renderer.createClipPath({id:this.element.id+"_clippath"}),this.bufferClipPath=this.renderer.createClipPath({id:this.element.id+"_clippathBuffer"})},Sat.prototype.renderTrack=function(){"Linear"===this.type?this.linear.renderLinearTrack():"Circular"===this.type&&this.circular.renderCircularTrack()},Sat.prototype.renderProgress=function(){this.clipPathElement(),"Linear"===this.type?this.linear.renderLinearProgress():"Circular"===this.type&&this.circular.renderCircularProgress()},Sat.prototype.renderLabel=function(){"Linear"===this.type&&this.showProgressValue&&!this.isIndeterminate?this.linear.renderLinearLabel():"Circular"===this.type&&this.showProgressValue&&!this.isIndeterminate&&this.circular.renderCircularLabel(),this.element.appendChild(this.svgObject)},Sat.prototype.getPathLine=function(e,t,i){e=this.enableRtl?"Round"===this.cornerRadius?e+this.progressRect.width-.45*i:e+this.progressRect.width:"Round"===this.cornerRadius?e+.45*i:e,i=t<i&&"Round"===this.cornerRadius?t:i,i=this.enableRtl?"Round"===this.cornerRadius&&t?e-t+.9*i:e-t:"Round"===this.cornerRadius&&t?e+t-.9*i:e+t;return"M"+e+" "+(this.progressRect.y+this.progressRect.height/2)+"L"+i+" "+(this.progressRect.y+this.progressRect.height/2)},Sat.prototype.calculateProgressRange=function(e,t,i){var t=t||this.minimum,i=i||this.maximum,n=(e-t)/(i-t)*("Linear"===this.type?1:this.totalAngle);return e<t||i<e?0:n},Sat.prototype.calculateSegmentSize=function(e,t){var i="Circular"===this.type&&this.totalAngle===eat?this.segmentCount:this.segmentCount-1,n=this.totalAngle===eat||"Linear"===this.type?this.segmentCount:this.segmentCount-1,o=this.gapWidth||("Linear"===this.type?this.themeStyle.linearGapWidth:this.themeStyle.circularGapWidth);return" "+(e-i*o-("Round"===this.cornerRadius?n*(.9*t):0))/this.segmentCount+" "+(o+="Round"===this.cornerRadius?.9*t:0)},Sat.prototype.createClipPath=function(e,t,i,n,o,r,s){var a,l,h,d,p=this.progressRect.x,c=this.progressRect.width;return"Linear"===this.type?("Round4px"===this.cornerRadius?(l=p,d=c*t,l+=r?0:-4,h=this.progressRect.y,d+=!r&&s||this.isIndeterminate?4:0):(l=this.enableRtl&&!r?p+c+("Round"===this.cornerRadius?o/10:0):p-("Round"===this.cornerRadius?o/10:0),d=c*t,h=this.progressRect.y+this.progressRect.height/2-o/2,d+="Round"!==this.cornerRadius||r?0:.9*o),n?((a=Bo(this.element.id+"_clippathrect"+(r?"label":""))).setAttribute("width",d.toString()),this.isActive&&a.setAttribute("x",l.toString())):(s=new xst(this.element.id+"_clippathrect"+(r?"label":""),"transparent",1,"transparent",1,new Sst(l,h,o,d)),a=this.renderer.drawRectangle(s),e.appendChild(a))):n?(a=Bo(this.element.id+"_clippathcircle")).setAttribute("d",i):(p=new No(this.element.id+"_clippathcircle","transparent",10,"transparent",1,"0",i),a=this.renderer.drawPath(p),e.appendChild(a)),a},Sat.prototype.setTheme=function(){switch(this.themeStyle=function(e){var t;switch(e){case"Material":t={linearTrackColor:"#E3165B",linearProgressColor:"#E3165B",circularTrackColor:"#E3165B",circularProgressColor:"#E3165B",backgroundColor:"transparent",progressOpacity:1,trackOpacity:.26,bufferOpacity:.4,linearGapWidth:4,circularGapWidth:4,linearTrackThickness:4,linearProgressThickness:4,circularTrackThickness:4,circularProgressThickness:4,tooltipFill:"#ffffff",tooltipLightLabel:"#000000",success:"#4caf50",danger:"#ff6652",warning:"#ff9800",info:"#03a9f4",tooltipLabelFont:{color:"rgba(249, 250, 251, 1)",fontFamily:"Roboto",fontWeight:"400"},linearLabelFont:{size:"10",fontWeight:"400",color:"#000000",fontStyle:"Normal",fontFamily:"Roboto"},circularLabelFont:{size:"12",fontWeight:"500",color:"#000000",fontStyle:"Normal",fontFamily:"Roboto"}};break;case"Bootstrap":t={linearTrackColor:"#EEEEEE",linearProgressColor:"#317ab9",circularTrackColor:"#EEEEEE",circularProgressColor:"#317ab9",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.44,linearGapWidth:4,circularGapWidth:4,linearTrackThickness:20,linearProgressThickness:20,circularTrackThickness:6,circularProgressThickness:6,tooltipFill:"#ffffff",tooltipLightLabel:"#000000",success:"#48b14c",danger:"#d44f4f",warning:"#fac168",info:"#2aaac0",tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Helvetica Neue",fontWeight:"400"},linearLabelFont:{size:"10",fontWeight:"400",color:"#000000",fontStyle:"Normal",fontFamily:"Helvetica Neue"},circularLabelFont:{size:"12",fontWeight:"500",color:"#000000",fontStyle:"Normal",fontFamily:"Helvetica Neue"}};break;case"Bootstrap4":t={linearTrackColor:"#E9ECEF",linearProgressColor:"#007bff",circularTrackColor:"#E9ECEF",circularProgressColor:"#007bff",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.44,linearGapWidth:4,circularGapWidth:4,linearTrackThickness:16,linearProgressThickness:16,circularTrackThickness:6,circularProgressThickness:6,tooltipFill:"#ffffff",tooltipLightLabel:"#000000",success:"#28a745",danger:"#dc3545",warning:"#ffc107",info:"#17a2b8",tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Helvetica Neue",fontWeight:"400"},linearLabelFont:{size:"10",fontWeight:"400",color:"#000000",fontStyle:"Normal",fontFamily:"Helvetica Neue"},circularLabelFont:{size:"12",fontWeight:"500",color:"#000000",fontStyle:"Normal",fontFamily:"Helvetica Neue"}};break;case"HighContrast":t={linearTrackColor:"#BFBFBF",linearProgressColor:"#FFD939",circularTrackColor:"#BFBFBF",circularProgressColor:"#FFD939",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.35,linearGapWidth:2,circularGapWidth:4,linearTrackThickness:2,linearProgressThickness:2,circularTrackThickness:4,circularProgressThickness:4,tooltipFill:"#ffffff",tooltipLightLabel:"#000000",success:"#2bc700",danger:"#ff6161",warning:"#ff7d1a",info:"#66b0ff",tooltipLabelFont:{color:"#000000",fontFamily:"Segoe UI",fontWeight:"400"},linearLabelFont:{size:"10",fontWeight:"400",color:"#FFFFFF",fontStyle:"Normal",fontFamily:"Segoe UI"},circularLabelFont:{size:"12",fontWeight:"500",color:"#FFFFFF",fontStyle:"Normal",fontFamily:"Segoe UI"}};break;case"Tailwind3":t={linearTrackColor:"#E5E7EB",linearProgressColor:"#4F46E5",circularTrackColor:"#E5E7EB",circularProgressColor:"#4F46E5",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.35,bufferColor:"#818CF8",linearGapWidth:2,circularGapWidth:4,linearTrackThickness:2,linearProgressThickness:2,circularTrackThickness:4,circularProgressThickness:4,tooltipFill:"#111827",tooltipLightLabel:"#F9FAFB",success:"#15803D",danger:"#DC2626",warning:"#C2410C",info:"#0E7490",tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Inter",fontWeight:"500"},linearLabelFont:{size:"10",fontWeight:"500",color:"#FFFFFF",fontStyle:"Normal",fontFamily:"Inter"},circularLabelFont:{size:"10",fontWeight:"500",color:"#4F46E5",fontStyle:"Normal",fontFamily:"Inter"}};break;case"Tailwind3Dark":t={linearTrackColor:"#282F3C",linearProgressColor:"#6366F1",circularTrackColor:"#282F3C",circularProgressColor:"#6366F1",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.45,bufferColor:"#3730A3",linearGapWidth:2,circularGapWidth:4,linearTrackThickness:2,linearProgressThickness:2,circularTrackThickness:4,circularProgressThickness:4,tooltipFill:"#F9FAFB",tooltipLightLabel:"#1F2937",success:"#22C55E",danger:"#F87171",warning:"#F97316",info:"#38BDF8",tooltipLabelFont:{color:"#1F2937",fontFamily:"Inter",fontWeight:"500"},linearLabelFont:{size:"10",fontWeight:"500",color:"#FFFFFF",fontStyle:"Normal",fontFamily:"Inter"},circularLabelFont:{size:"10",fontWeight:"500",color:"#6366F1",fontStyle:"Normal",fontFamily:"Inter"}};break;case"Tailwind":t={linearTrackColor:"#E5E7EB",linearProgressColor:"#4F46E5",circularTrackColor:"#E5E7EB",circularProgressColor:"#4F46E5",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.35,linearGapWidth:2,circularGapWidth:4,linearTrackThickness:2,linearProgressThickness:2,circularTrackThickness:4,circularProgressThickness:4,tooltipFill:"#ffffff",tooltipLightLabel:"#000000",success:"#15803D",danger:"#DC2626",warning:"#C2410C",info:"#0E7490",tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Inter",fontWeight:"400"},linearLabelFont:{size:"10",fontWeight:"400",color:"#FFFFFF",fontStyle:"Normal",fontFamily:"Inter"},circularLabelFont:{size:"12",fontWeight:"500",color:"#FFFFFF",fontStyle:"Normal",fontFamily:"Inter"}};break;case"TailwindDark":t={linearTrackColor:"#4B5563",linearProgressColor:"#22D3EE",circularTrackColor:"#4B5563",circularProgressColor:"#22D3EE",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.45,linearGapWidth:2,circularGapWidth:4,linearTrackThickness:2,linearProgressThickness:2,circularTrackThickness:4,circularProgressThickness:4,tooltipFill:"#ffffff",tooltipLightLabel:"#000000",success:"#22C55E",danger:"#F87171",warning:"#ea580c",info:"#06B6D4",tooltipLabelFont:{color:"#1F2937",fontFamily:"Inter",fontWeight:"400"},linearLabelFont:{size:"10",fontWeight:"400",color:"#D1D5DB",fontStyle:"Normal",fontFamily:"Inter"},circularLabelFont:{size:"12",fontWeight:"500",color:"#D1D5DB",fontStyle:"Normal",fontFamily:"Inter"}};break;case"FabricDark":case"BootstrapDark":case"MaterialDark":t={linearTrackColor:"#C8C8C8",linearProgressColor:"#9A9A9A",circularTrackColor:"#C8C8C8",circularProgressColor:"#9A9A9A",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.44,linearGapWidth:2,circularGapWidth:4,linearTrackThickness:16,linearProgressThickness:16,circularTrackThickness:4,circularProgressThickness:4,tooltipFill:"#ffffff",tooltipLightLabel:"#000000",success:"#22b24b",danger:"#ac2a2a",warning:"#ffca1c",info:"#489bd5",tooltipLabelFont:{color:"BootstrapDark"===e?"#1A1A1A":"FabricDark"===e?"#DADADA":"rgba(18, 18, 18, 1)",fontFamily:"BootstrapDark"===e?"Helvetica Neue":"FabricDark"===e?"Segoe UI":"Roboto",fontWeight:"400"},linearLabelFont:{size:"10",fontWeight:"400",color:"#000000",fontStyle:"Normal",fontFamily:"BootstrapDark"===e?"Helvetica Neue":"FabricDark"===e?"Segoe UI":"Roboto"},circularLabelFont:{size:"12",fontWeight:"500",color:"#000000",fontStyle:"Normal",fontFamily:"BootstrapDark"===e?"Helvetica Neue":"FabricDark"===e?"Segoe UI":"Roboto"}};break;case"Bootstrap5":t={linearTrackColor:"#DEE2E6",linearProgressColor:"#0D6EFD",circularTrackColor:"#DEE2E6",circularProgressColor:"#0D6EFD",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.44,linearGapWidth:4,circularGapWidth:4,linearTrackThickness:2,linearProgressThickness:2,circularTrackThickness:2,circularProgressThickness:2,tooltipFill:"#000000E5",tooltipLightLabel:"#FFFFFF",success:"#198754",danger:"#DC3545",warning:"#FFC107",info:"#0DCAF0",tooltipLabelFont:{color:"#F9FAFB",fontFamily:"Segoe UI",fontWeight:"400"},linearLabelFont:{size:"10",fontWeight:"400",color:"#FFFFFF",fontStyle:"Normal",fontFamily:"Segoe UI"},circularLabelFont:{size:"12",fontWeight:"400",color:"#0D6EFD",fontStyle:"Normal",fontFamily:"Segoe UI"}};break;case"Bootstrap5Dark":t={linearTrackColor:"#495057",linearProgressColor:"#0D6EFD",circularTrackColor:"#495057",circularProgressColor:"#0D6EFD",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.4,linearGapWidth:4,circularGapWidth:4,linearTrackThickness:2,linearProgressThickness:2,circularTrackThickness:2,circularProgressThickness:2,tooltipFill:"#FFFFFFE5",tooltipLightLabel:"#212529",success:"#198754",danger:"#DC3545",warning:"#FFC107",info:"#0DCAF0",tooltipLabelFont:{color:"#212529",fontFamily:"Segoe UI",fontWeight:"400"},linearLabelFont:{size:"10",fontWeight:"400",color:"#FFFFFF",fontStyle:"Normal",fontFamily:"Segoe UI"},circularLabelFont:{size:"12",fontWeight:"400",color:"#0D6EFD",fontStyle:"Normal",fontFamily:"Segoe UI"}};break;case"Fluent":t={linearTrackColor:"#F3F2F1",linearProgressColor:"#0D6EFD",circularTrackColor:"#F3F2F1",circularProgressColor:"#0D6EFD",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.45,linearGapWidth:4,circularGapWidth:4,linearTrackThickness:16,linearProgressThickness:16,circularTrackThickness:4,circularProgressThickness:4,tooltipFill:"#ffffff",tooltipLightLabel:"#000000",success:"#0B6A0B",danger:"#D13438",warning:"#CA5010",info:"#038387",tooltipLabelFont:{color:"#323130",fontFamily:"Segoe UI",fontWeight:"400"},linearLabelFont:{size:"10",fontWeight:"400",color:"#0D6EFD",fontStyle:"Normal",fontFamily:"Segoe UI"},circularLabelFont:{size:"12",fontWeight:"500",color:"#0D6EFD",fontStyle:"Normal",fontFamily:"Segoe UI"}};break;case"FluentDark":t={linearTrackColor:"#3B4248",linearProgressColor:"#0D6EFD",circularTrackColor:"#3B4248",circularProgressColor:"#0D6EFD",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.35,linearGapWidth:4,circularGapWidth:4,linearTrackThickness:16,linearProgressThickness:16,circularTrackThickness:4,circularProgressThickness:4,tooltipFill:"#ffffff",tooltipLightLabel:"#000000",success:"#0B6A0B",danger:"#D13438",warning:"#CA5010",info:"#038387",tooltipLabelFont:{color:"#F3F2F1",fontFamily:"Segoe UI",fontWeight:"400"},linearLabelFont:{size:"10",fontWeight:"400",color:"#0D6EFD",fontStyle:"Normal",fontFamily:"Segoe UI"},circularLabelFont:{size:"12",fontWeight:"500",color:"#0D6EFD",fontStyle:"Normal",fontFamily:"Segoe UI"}};break;case"Fluent2":t={linearTrackColor:"#E6E6E6",linearProgressColor:"#0F6CBD",circularTrackColor:"#E6E6E6",circularProgressColor:"#0F6CBD",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.35,linearGapWidth:4,circularGapWidth:4,linearTrackThickness:F.isDevice?4:2,linearProgressThickness:F.isDevice?4:2,circularTrackThickness:(F.isDevice,2),circularProgressThickness:(F.isDevice,2),tooltipFill:"#FFFFFF",tooltipLightLabel:"#242424",success:"#107C10",danger:"#D13438",warning:"#BC4B09",info:"#008AA9",tooltipLabelFont:{color:"#242424",fontFamily:"Segoe UI",fontWeight:"400"},linearLabelFont:{size:"12",fontWeight:"400",color:"#FFFFFF",fontStyle:"Normal",fontFamily:"Segoe UI"},circularLabelFont:{size:"12",fontWeight:"500",color:"#242424",fontStyle:"Normal",fontFamily:"Segoe UI"}};break;case"Fluent2Dark":t={linearTrackColor:"#333333",linearProgressColor:"#115EA3",circularTrackColor:"#333333",circularProgressColor:"#115EA3",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.35,linearGapWidth:4,circularGapWidth:4,linearTrackThickness:F.isDevice?4:2,linearProgressThickness:F.isDevice?4:2,circularTrackThickness:(F.isDevice,2),circularProgressThickness:(F.isDevice,2),tooltipFill:"#292929",tooltipLightLabel:"#FFFFFF",success:"#107C10",danger:"#DC626D",warning:"#FAA06B",info:"#0099BC",tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",fontWeight:"400"},linearLabelFont:{size:"12",fontWeight:"400",color:"#FFFFFF",fontStyle:"Normal",fontFamily:"Segoe UI"},circularLabelFont:{size:"12",fontWeight:"500",color:"#FFFFFF",fontStyle:"Normal",fontFamily:"Segoe UI"}};break;case"Fluent2HighContrast":t={linearTrackColor:"#000000",linearProgressColor:"#1AEBFF",circularTrackColor:"#000000",circularProgressColor:"#1AEBFF",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.35,linearGapWidth:4,circularGapWidth:4,linearTrackThickness:F.isDevice?4:2,linearProgressThickness:F.isDevice?4:2,circularTrackThickness:(F.isDevice,2),circularProgressThickness:(F.isDevice,2),tooltipFill:"#000000",tooltipLightLabel:"#FFFFFF",success:"#107C10",danger:"#C50F1F",warning:"#F7630C",info:"#0099BC",tooltipLabelFont:{color:"#FFFFFF",fontFamily:"Segoe UI",fontWeight:"400"},linearLabelFont:{size:"12",fontWeight:"400",color:"#FFFFFF",fontStyle:"Normal",fontFamily:"Segoe UI"},circularLabelFont:{size:"12",fontWeight:"400",color:"#FFFFFF",fontStyle:"Normal",fontFamily:"Segoe UI"}};break;case"Material3":t={linearTrackColor:"#E7E0EC",linearProgressColor:"#6750A4",circularTrackColor:"#E7E0EC",circularProgressColor:"#6750A4",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.24,linearGapWidth:4,circularGapWidth:4,linearTrackThickness:4,linearProgressThickness:4,circularTrackThickness:4,circularProgressThickness:4,tooltipFill:"#313033",tooltipLightLabel:"#F4EFF4",success:"#0B6A0B",danger:"#D13438",warning:"#CA5010",info:"#038387",tooltipLabelFont:{size:"12px",fontWeight:"400",color:"#F4EFF4",fontStyle:"Normal",fontFamily:"Roboto"},linearLabelFont:{size:"10",fontWeight:"400",color:"#FFFFFF",fontStyle:"Normal",fontFamily:"Roboto"},circularLabelFont:{size:"12",fontWeight:"500",color:"#6750A4",fontStyle:"Normal",fontFamily:"Roboto"}};break;case"Material3Dark":t={linearTrackColor:"#49454F",linearProgressColor:"#D0BCFF",circularTrackColor:"#49454F",circularProgressColor:"#D0BCFF",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.24,linearGapWidth:4,circularGapWidth:4,linearTrackThickness:4,linearProgressThickness:4,circularTrackThickness:4,circularProgressThickness:4,tooltipFill:"#E6E1E5",tooltipLightLabel:"#313033",success:"#0B6A0B",danger:"#D13438",warning:"#CA5010",info:"#038387",tooltipLabelFont:{color:"#313033",fontFamily:"roboto",fontWeight:"400"},linearLabelFont:{size:"10",fontWeight:"400",color:"#371E73",fontStyle:"Normal",fontFamily:"Roboto"},circularLabelFont:{size:"12",fontWeight:"500",color:"#D0BCFF",fontStyle:"Normal",fontFamily:"Roboto"}};break;default:t={linearTrackColor:"#EAEAEA",linearProgressColor:"#0078D6",circularTrackColor:"#E6E6E6",circularProgressColor:"#0078D6",backgroundColor:"transparent",progressOpacity:1,trackOpacity:1,bufferOpacity:.3,linearGapWidth:2,circularGapWidth:4,linearTrackThickness:2,linearProgressThickness:2,circularTrackThickness:4,circularProgressThickness:4,tooltipFill:"#ffffff",tooltipLightLabel:"#000000",success:"#166600",danger:"#b30900",warning:"#944000",info:"#0056b3",tooltipLabelFont:{color:"#333333",fontFamily:"Segoe UI",fontWeight:"400"},linearLabelFont:{size:"10",fontWeight:"400",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},circularLabelFont:{size:"12",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"}}}return t}(this.theme),this.theme){case"Bootstrap":case"Bootstrap4":this.cornerRadius="Auto"===this.cornerRadius?"Linear"===this.type?"Round4px":"Round":this.cornerRadius;break;case"Fluent2":case"Fluent2Dark":case"Fluent2HighContrast":case"Bootstrap5":case"Bootstrap5Dark":this.cornerRadius="Auto"===this.cornerRadius&&"Linear"===this.type?"Round":this.cornerRadius;break;default:this.cornerRadius="Auto"===this.cornerRadius?"Square":this.cornerRadius}},Sat.prototype.renderAnnotation=function(){this.progressAnnotationModule&&0<this.annotations.length&&this.progressAnnotationModule.renderAnnotations(this.secElement)},Sat.prototype.progressResize=function(){var e,t=this;return(new Date).getTime()>this.controlRenderedTimeStamp+800&&(e={bar:this,name:"resized",currentSize:new Ast(0,0),previousSize:new Ast(this.progressSize.width,this.progressSize.height),cancel:!!this.cancelResize},this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=setTimeout(function(){t.isDestroyed?clearTimeout(t.resizeTo):(e.currentSize=t.progressSize,t.trigger("resized",e),(null===t.width||null===t.height||-1<t.width.indexOf("%")||-1<t.height.indexOf("%"))&&!e.cancel&&(t.secElement&&(t.secElement.innerHTML=""),t.calculateProgressBarSize(),t.createSVG(),t.renderElements()))},500)),!1},Sat.prototype.progressMouseClick=function(e){this.mouseEvent("mouseClick",e)},Sat.prototype.progressMouseDown=function(e){this.mouseEvent("mouseDown",e)},Sat.prototype.progressMouseMove=function(e){this.mouseEvent("mouseMove",e);var t=e.target;this.tooltip.enable&&this.tooltip.showTooltipOnHover&&(0<=t.id.indexOf("Circularprogress")||0<=t.id.indexOf("Circularbuffer")||0<=t.id.indexOf("Linearprogress")||0<=t.id.indexOf("Linearbuffer")||0<=t.id.indexOf("Linearbuffer")?this.progressTooltipModule.tooltip(e):this.progressTooltipModule.isRendered&&(this.progressTooltipModule.removeTooltip(1e3),this.progressTooltipModule.isRendered=!1))},Sat.prototype.progressMouseUp=function(e){this.mouseEvent("mouseUp",e)},Sat.prototype.progressMouseLeave=function(e){this.mouseEvent("mouseLeave",e)},Sat.prototype.mouseEvent=function(e,t){t=t.target;this.trigger(e,{target:t.id})},Sat.prototype.unWireEvents=function(){var e=F.touchStartEvent,t=F.touchMoveEvent,i=F.touchEndEvent,n=F.isPointer?"pointerleave":"mouseleave";E.remove(this.element,"click",this.progressMouseClick),E.remove(this.element,e,this.progressMouseDown),E.remove(this.element,t,this.progressMouseMove),E.remove(this.element,i,this.progressMouseUp),E.remove(this.element,n,this.progressMouseLeave),window.removeEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBounds)},Sat.prototype.wireEvents=function(){var e=F.touchStartEvent,t=F.touchMoveEvent,i=F.touchEndEvent,n=F.isPointer?"pointerleave":"mouseleave";E.add(this.element,"click",this.progressMouseClick,this),E.add(this.element,e,this.progressMouseDown,this),E.add(this.element,t,this.progressMouseMove,this),E.add(this.element,i,this.progressMouseUp,this),E.add(this.element,n,this.progressMouseLeave,this),this.resizeBounds=this.progressResize.bind(this),window.addEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBounds)},Sat.prototype.removeSvg=function(){var e=document.getElementById(this.element.id+"SVG");e&&ue(e)},Sat.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"annotations":this.secElement.innerHTML="",this.renderAnnotation();break;case"value":this.cancelResize=!!this.animation.enable,this.argsData={value:this.value,progressColor:this.argsData.progressColor,trackColor:this.argsData.trackColor},this.argsData.value<t.value&&this.animation.enable&&(this.argsData.value=t.value),this.argsData.value===this.maximum?this.trigger(iat,this.argsData):this.trigger(tat,this.argsData),"Circular"===this.type?(this.circular.renderCircularProgress(this.previousEndAngle,this.previousTotalEnd,!je(t.value)),this.showProgressValue&&this.circular.renderCircularLabel(!0),this.progressAnnotationModule&&this.animation.enable&&!this.isIndeterminate&&this.annotateAnimation.doAnnotationAnimation(this.clipPath,this,this.annotateEnd,this.annotateTotal)):(this.linear.renderLinearProgress(!je(t.value),this.previousWidth),this.showProgressValue&&this.linear.renderLinearLabel(!0)),this.progressTooltipModule&&this.progressTooltipModule.tooltip(),this.element.setAttribute("aria-valuenow",this.argsData.value?this.argsData.value.toString():"0");break;case"animation":this.createSVG(),this.renderElements()}},Sat.prototype.requiredModules=function(){var e=[];return this.annotations.some(function(e){return null!==e.content})&&e.push({member:"ProgressAnnotation",args:[this]}),this.tooltip.enable&&e.push({member:"ProgressTooltip",args:[this]}),e},Sat.prototype.getPersistData=function(){return" "},Sat.prototype.show=function(){je(this.svgObject)||(this.svgObject.setAttribute("visibility","Visible"),this.isIndeterminate&&(this.destroyIndeterminate=!1,"Linear"===this.type?this.linear.renderLinearProgress(!0):this.circular.renderCircularProgress(null,null,!0)))},Sat.prototype.hide=function(){je(this.svgObject)||(this.svgObject.setAttribute("visibility","Hidden"),this.isIndeterminate&&(this.destroyIndeterminate=!0))},Sat.prototype.destroy=function(){this.unWireEvents(),wat.prototype.destroy.call(this),this.removeSvg(),this.isReact&&this.clearTemplate(),this.svgObject=null,this.element.classList.remove("e-progressbar"),this.refreshing||(this.destroyIndeterminate=!0)},H$e([e("Linear")],Sat.prototype,"type",void 0),H$e([e(null)],Sat.prototype,"value",void 0),H$e([e(null)],Sat.prototype,"secondaryProgress",void 0),H$e([e("")],Sat.prototype,"secondaryProgressColor",void 0),H$e([e(null)],Sat.prototype,"secondaryProgressThickness",void 0),H$e([e(0)],Sat.prototype,"minimum",void 0),H$e([e(100)],Sat.prototype,"maximum",void 0),H$e([e(0)],Sat.prototype,"startAngle",void 0),H$e([e(0)],Sat.prototype,"endAngle",void 0),H$e([e("100%")],Sat.prototype,"radius",void 0),H$e([e("100%")],Sat.prototype,"innerRadius",void 0),H$e([e(1)],Sat.prototype,"segmentCount",void 0),H$e([e(null)],Sat.prototype,"gapWidth",void 0),H$e([e("")],Sat.prototype,"segmentColor",void 0),H$e([e("Auto")],Sat.prototype,"cornerRadius",void 0),H$e([e(null)],Sat.prototype,"height",void 0),H$e([e(null)],Sat.prototype,"width",void 0),H$e([e(!1)],Sat.prototype,"isIndeterminate",void 0),H$e([e(!1)],Sat.prototype,"isActive",void 0),H$e([e(!1)],Sat.prototype,"isGradient",void 0),H$e([e(!1)],Sat.prototype,"isStriped",void 0),H$e([e("Auto")],Sat.prototype,"role",void 0),H$e([e(!1)],Sat.prototype,"enableRtl",void 0),H$e([e(!0)],Sat.prototype,"labelOnTrack",void 0),H$e([e(null)],Sat.prototype,"trackColor",void 0),H$e([e(null)],Sat.prototype,"progressColor",void 0),H$e([e(0)],Sat.prototype,"trackThickness",void 0),H$e([e(0)],Sat.prototype,"progressThickness",void 0),H$e([e(!1)],Sat.prototype,"enablePieProgress",void 0),H$e([e("Fabric")],Sat.prototype,"theme",void 0),H$e([e(!1)],Sat.prototype,"showProgressValue",void 0),H$e([e(!1)],Sat.prototype,"enableProgressSegments",void 0),H$e([t({size:null,color:null,fontStyle:null,fontWeight:null,fontFamily:null},X$e)],Sat.prototype,"labelStyle",void 0),H$e([t({},d$)],Sat.prototype,"margin",void 0),H$e([t({},Vee)],Sat.prototype,"animation",void 0),H$e([t({},Met)],Sat.prototype,"tooltip",void 0),H$e([i()],Sat.prototype,"load",void 0),H$e([i()],Sat.prototype,"textRender",void 0),H$e([i()],Sat.prototype,"loaded",void 0),H$e([i()],Sat.prototype,"valueChanged",void 0),H$e([i()],Sat.prototype,"progressCompleted",void 0),H$e([i()],Sat.prototype,"animationComplete",void 0),H$e([i()],Sat.prototype,"mouseClick",void 0),H$e([i()],Sat.prototype,"mouseMove",void 0),H$e([i()],Sat.prototype,"mouseUp",void 0),H$e([i()],Sat.prototype,"mouseDown",void 0),H$e([i()],Sat.prototype,"mouseLeave",void 0),H$e([i()],Sat.prototype,"tooltipRender",void 0),H$e([kt([{}],Z$e)],Sat.prototype,"annotations",void 0),H$e([kt([{}],Cet)],Sat.prototype,"rangeColors",void 0),Cat=H$e([Bt],Sat));function Sat(e,t){e=wat.call(this,e,t)||this;return e.linear=new mat(e),e.circular=new yat(e),e.annotateAnimation=new sat,e.destroyIndeterminate=!1,e.scaleX=1,e.scaleY=1,Cat.Inject(pat),e}set.Inject(N$e,pat);var L$e=Object.freeze({__proto__:null,ProgressBar:set,Margin:d$,Font:X$e,Animation:Vee,ProgressAnnotationSettings:Z$e,Border:Wo,TooltipSettings:Met,RangeColor:Cet,ProgressAnnotation:N$e,ProgressTooltip:pat,Rect:Sst,Size:Ast,Pos:bst,RectOption:xst,ColorValue:Tst,convertToHexCode:Est,componentToHex:Dst,convertHexToColor:function(e){return(e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e))?new Tst(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)):new Tst(255,255,255)},colorNameToHex:function(e){e="transparent"===e?"white":e,document.body.appendChild(Q("text",{id:"chartmeasuretext"}));var t,i=document.getElementById("chartmeasuretext");return i.style.color=e,e=window.getComputedStyle(i).color,ue(i),0!==e.indexOf("rgb")&&0!==e.indexOf("hsl")||(t=(e=e.replace(/\s/g,"").replace(/[()]/g,"")).slice(3).split(",")),Est(new Tst(parseInt(t[3],10),parseInt(t[4],10),parseInt(t[5],10)))},TextOption:Mst,degreeToLocation:kst,getPathArc:Pst,stringToNumber:Bst,setAttributes:Fst,effect:Lst,annotationRender:Rst,getElement:Ost,removeElement:Nst,ProgressLocation:Hst,ProgressAnimation:sat}),Krt=Object.freeze({__proto__:null,PositionData:ts,Popup:Sv,getScrollableParent:xv,getZindexPartial:Iv,getMaxZindex:function(e){void 0===e&&(e=["*"]);for(var t=[],i=0;i<e.length;i++)for(var n=document.getElementsByTagName(e[i]),o=0;o<n.length;o++){var r=document.defaultView.getComputedStyle(n[o],null).getPropertyValue("z-index"),s=document.defaultView.getComputedStyle(n[o],null).getPropertyValue("position");"auto"!==r&&"static"!==s&&t.push(r)}var a=Math.max.apply(Math,t)+1;return 2147483647<a?2147483647:a},calculateRelativeBasedPosition:R0,calculatePosition:O0,fit:G0,isCollide:Y0,flip:X0,getZoomValue:K0,getTransformElement:J0,destroy:uv,ButtonProps:i0,AnimationSettings:o,Dialog:pS,get DialogUtility(){return WC},Animation:tn,Tooltip:NS,Spinner:function(e,t,i,n){switch(e){case"Create":mA({type:n,target:document.querySelector(t.target),cssClass:t.cssClass,label:t.label,width:t.width});break;case"Show":kA(document.querySelector(i));break;case"Hide":BA(document.querySelector(i));break;case"Set":FA({cssClass:t.cssClass,type:n})}},createSpinner:mA,showSpinner:kA,hideSpinner:BA,setSpinner:FA}),Aat="e-pivotfieldlist",xat="e-rtl",Iat="e-device",Tat="e-icons",Eat="e-disable",Dat="e-hide",Mat="e-icon-first",kat="e-icon-last",Pat="e-icon-prev",Bat="e-icon-next",Fat="e-dropdown-icon",Lat="e-pivotfieldlist-container",Rat="e-toggle-field-list",Oat="e-static",Nat="e-draggable",Vat="e-field-list",_at="e-field-list-tree-outer-div",Hat="e-field-list-tree-outer-div-searchMode",zat="e-search-mode",jat="e-pivot-parent",Wat="e-pivot-child",Qat="e-field-list-footer",Uat="e-left-axis-fields",qat="e-right-axis-fields",Gat="e-all-fields-axis",Yat="e-axis-content",Xat="e-draggable-prompt",Kat="e-pvt-btn-div",Jat="e-pivot-button",Zat="e-content",$at="e-pvt-btn-content",elt="e-sort",tlt="e-member-sort",ilt="e-descend",nlt="e-btn-filter",olt="e-pv-filter",rlt="e-pv-filtered",slt="e-remove",alt="e-drag",llt="e-disable-drag",hlt="e-drop-indicator",dlt="e-drop-hover",plt="e-member-editor-outer-container",clt="e-member-editor-container",ult="e-drillthrough-body-header",glt="e-drillthrough-body-header-common",mlt="e-drillthrough-body-header-value",flt="e-check",ylt="e-stop",vlt="e-ok-btn",blt="e-cancel-btn",wlt="e-pivot-error-dialog",Clt="e-droppable",Slt="e-rows",Alt="e-columns",xlt="e-values",Ilt="e-filters",Tlt="e-grouping-bar",Elt="e-group-all-fields",Dlt="e-group-rows",Mlt="e-group-columns",klt="e-group-values",Plt="e-group-filters",Blt="e-drag-restrict",Flt="e-list-selected",Llt="e-title-header",Rlt="e-text-content",Olt="e-field-list-btn",Nlt="e-calculated-field-btn",Vlt="e-small",_lt="e-round",Hlt="e-add-icon",zlt="e-list-text",jlt="e-selected-node",Wlt="e-selected-option-icon",Qlt="e-selected-level-icon",Ult="e-between-text-div",qlt="e-filter-input-div-2",Glt="e-value-options",Ylt="e-filter-operator",Xlt="e-filter-sort",Klt="e-sort-ascend-icon",Jlt="e-sort-descend-icon",Zlt="e-active",$lt="e-collapse",eht="e-expand",tht="e-table",iht="e-columnsheader",nht="e-rowsheader",oht="e-headercell",rht="e-cellvalue",sht="e-tooltipheader",aht="e-tooltipcontent",lht="e-nextspan",hht="e-lastspan",dht="e-editor-search-container",pht="e-editor-search",cht="e-select-all",uht="e-pivot-calc-check",ght="e-pivot-calc-input",mht="e-custom-format-input",fht="e-olap-calc-hierarchy-list-div",yht="e-pivot-calc-format-type-div",vht="e-olap-calc-member-type-div",bht="e-member-options",wht="e-format",Cht="e-pivot-formula",Sht="e-pivot-treeview",Aht="e-pivot-treeview-outer",xht="e-treeContainer",Iht="e-pivot-ok-button",Tht="e-pivot-button-div",Eht="e-axis",Dht="e-axis-filter",Mht="e-grid",kht="e-pivotview",Pht="e-pivot-all-field-title",Bht="e-disabled",Fht="e-menu-hide",Lht="e-member-prompt",Rht="e-edit",Oht="e-edited",Nht="e-empty-field",Vht="e-format-condition-button",_ht="e-format-table",Hht="e-input",zht="e-visible-hide",jht="e-format-color-picker",Wht="e-dlg-header",Qht="e-virtualtrack",Uht="e-movablescrolldiv",qht="e-content-virtualtable",Ght="e-movablescroll",Yht="e-headercontent",Xht="e-cellselectionbackground",Kht="e-selectionbackground",Jht="e-checkbox-wrapper",Zht="e-headercontent",$ht="e-field-list-back-icon",edt="e-rowcell",tdt="e-active",idt="e-spanclicked",ndt="e-rowselect",odt="e-gridheader",rdt="e-gridcontent",sdt="e-pivotview-pdf-export",adt="e-pivotview-excel-export",ldt="e-pivotview-csv-export",hdt="e-remove-report",ddt="e-pivot-toolbar",pdt="e-pivotview-report-input",cdt="e-toolbar-grid",udt="e-toolbar-chart",gdt="e-pivotchart",mdt="e-group-chart-rows",fdt="e-group-chart-columns",ydt="e-group-chart-values",vdt="e-group-chart-values-drodown-div",bdt="e-group-chart-columns-dropdown-div",wdt="e-chart-grouping-bar",Cdt="e-pivotview-disable-icon",Sdt="e-pivotview-select-icon",Adt="e-pivot-grouping-bar",xdt="e-mdx-query-content",Idt="e-pivotchart-inner",Tdt="e-group-pivot-rows",Edt="e-pivot-toolbar-menu",Ddt="e-pivot-pager",Mdt="e-pagercontainer",kdt="e-page-size-disable",Pdt="e-node-limit",Bdt="e-leftfreeze",Fdt="e-pivot-content-loader",Ldt="e-hide-loader",Rdt="e-icon-collapsible",Odt="e-icon-expandable",Ndt="e-pivotview-autofit",Vdt="e-group-row",_dt="e-freezeleftborder",Hdt=(zdt.getType=function(e){var t=new Date(e),t="boolean"==typeof e?"boolean":isNaN(Number(e))?t instanceof Date&&!isNaN(t.valueOf())?t&&t.getDay()&&(0<t.getHours()||0<t.getMinutes()||0<t.getSeconds()||0<t.getMilliseconds())?"datetime":"date":typeof e:"number";return t},zdt.resetTime=function(e){return e.setHours(0,0,0,0),e},zdt.getClonedData=function(e){var t=[];if(e)for(var i=0,n=e;i<n.length;i++){for(var o=n[i],r=Object.keys(o),s=0,a={};s<r.length;)a[r[s]]=o[r[s]],s++;t.push(a)}return t},zdt.getClonedCSVData=function(e){return e.map(function(e){return e.slice()})},zdt.getDefinedObj=function(e){var t=0,i={};if(null!=e)for(var n=Object.keys(e);t<n.length;)null!==e[n[t]]&&void 0!==e[n[t]]&&(i[n[t]]=e[n[t]]),t++;else i=e;return i},zdt.inArray=function(e,t){if(t)for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},zdt.setPivotProperties=function(e,t){e.allowServerDataBinding=!1,e.pivotGridModule&&(e.pivotGridModule.allowServerDataBinding=!1),e.setProperties(t,!0),e.allowServerDataBinding=!0,e.pivotGridModule&&(e.pivotGridModule.allowServerDataBinding=!0)},zdt.getClonedDataSourceSettings=function(e){return this.getDefinedObj({type:e.type,catalog:e.catalog,cube:e.cube,providerType:e.providerType,url:e.url,localeIdentifier:e.localeIdentifier,excludeFields:je(e.excludeFields)?[]:e.excludeFields.slice(),expandAll:e.expandAll,allowLabelFilter:e.allowLabelFilter,allowValueFilter:e.allowValueFilter,allowMemberFilter:e.allowMemberFilter,enableSorting:!!e.enableSorting,rows:this.cloneFieldSettings(e.rows),columns:this.cloneFieldSettings(e.columns),filters:this.cloneFieldSettings(e.filters),values:this.cloneFieldSettings(e.values),filterSettings:this.cloneFilterSettings(e.filterSettings),sortSettings:this.cloneSortSettings(e.sortSettings),drilledMembers:this.cloneDrillMemberSettings(e.drilledMembers),valueSortSettings:this.CloneValueSortObject(e.valueSortSettings),valueAxis:e.valueAxis,valueIndex:e.valueIndex,grandTotalsPosition:e.grandTotalsPosition,formatSettings:this.cloneFormatSettings(e.formatSettings),calculatedFieldSettings:this.cloneCalculatedFieldSettings(e.calculatedFieldSettings),fieldMapping:this.cloneFieldSettings(e.fieldMapping),showSubTotals:e.showSubTotals,showRowSubTotals:e.showRowSubTotals,showColumnSubTotals:e.showColumnSubTotals,subTotalsPosition:e.subTotalsPosition,showGrandTotals:e.showGrandTotals,showRowGrandTotals:e.showRowGrandTotals,showColumnGrandTotals:e.showColumnGrandTotals,showHeaderWhenEmpty:e.showHeaderWhenEmpty,alwaysShowValueHeader:e.alwaysShowValueHeader,conditionalFormatSettings:this.cloneConditionalFormattingSettings(e.conditionalFormatSettings),emptyCellsTextContent:e.emptyCellsTextContent,groupSettings:this.cloneGroupSettings(e.groupSettings),showAggregationOnValueField:e.showAggregationOnValueField,authentication:this.CloneAuthenticationObject(e.authentication)})},zdt.getClonedFieldList=function(e,t){for(var i=Object.keys(e),n={},o=0,r=i.length;o<r;o++){var s=e[i[o]];e[i[o]]&&(n[i[o]]={type:s.type,caption:s.caption,id:s.id,isSelected:s.isSelected,sort:s.sort,filterType:s.filterType,index:s.index,filter:t?[]:s.filter,isCustomField:s.isCustomField,showRemoveIcon:s.showRemoveIcon,showFilterIcon:s.showFilterIcon,showSortIcon:s.showSortIcon,showNoDataItems:s.showNoDataItems,isCalculatedField:s.isCalculatedField,showEditIcon:s.showEditIcon,showValueTypeIcon:s.showValueTypeIcon,allowDragAndDrop:s.allowDragAndDrop,showSubTotals:s.showSubTotals,expandAll:s.expandAll,pid:s.pid,aggregateType:s.aggregateType,baseField:s.baseField,baseItem:s.baseItem,dateMember:t?[]:this.cloneDateMembers(s.dateMember),members:t?{}:this.cloneFormatMembers(s.members),formatString:s.formatString,format:s.format,formula:s.formula,isExcelFilter:s.isExcelFilter,membersOrder:s.membersOrder&&s.membersOrder.slice(),isAlphanumeric:s.isAlphanumeric,tag:s.tag,expanded:s.expanded,spriteCssClass:s.spriteCssClass,name:s.name,defaultHierarchy:s.defaultHierarchy,hasAllMember:s.hasAllMember,allMember:s.allMember,isChecked:s.isChecked,filterMembers:this.cloneFieldMembers(s.filterMembers),childMembers:t?[]:this.cloneFieldMembers(s.childMembers),searchMembers:t?[]:this.cloneFieldMembers(s.searchMembers),htmlAttributes:this.getDefinedObj(s.htmlAttributes),currrentMembers:t?{}:this.cloneFormatMembers(s.currrentMembers),isHierarchy:s.isHierarchy,isNamedSets:s.isNamedSets,actualFilter:s.actualFilter&&s.actualFilter.slice(),levels:t?[]:this.cloneFieldMembers(s.levels),levelCount:s.levelCount,fieldType:s.fieldType,memberType:s.memberType,parentHierarchy:s.parentHierarchy})}return n},zdt.cloneDateMembers=function(e){if(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];t.push({formattedText:o.formattedText,actualText:o.actualText})}return t}return e},zdt.cloneFormatMembers=function(e){if(e){for(var t=Object.keys(e),i={},n=0,o=t.length;n<o;n++){var r=e[t[n]];i[t[n]]={index:r.index&&r.index.slice(),isDrilled:r.isDrilled,ordinal:r.ordinal}}return i}return e},zdt.cloneFieldMembers=function(e){if(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];t.push({caption:o.caption,hasChildren:o.hasChildren,id:o.id,isSelected:o.isSelected,name:o.name,tag:o.tag,htmlAttributes:this.getDefinedObj(o.htmlAttributes),type:o.type,spriteCssClass:o.spriteCssClass,pid:o.pid,isChecked:o.isChecked})}return t}return e},zdt.updateDataSourceSettings=function(e,t){e&&this.setPivotProperties(e,{dataSourceSettings:this.getDefinedObj({type:t.type,catalog:t.catalog,cube:t.cube,providerType:t.providerType,url:t.url,localeIdentifier:t.localeIdentifier,excludeFields:je(t.excludeFields)?[]:t.excludeFields,expandAll:t.expandAll,allowLabelFilter:t.allowLabelFilter,allowValueFilter:t.allowValueFilter,allowMemberFilter:t.allowMemberFilter,enableSorting:!!t.enableSorting,rows:t.rows,columns:t.columns,filters:t.filters,values:t.values,filterSettings:t.filterSettings,sortSettings:t.sortSettings,drilledMembers:t.drilledMembers,valueSortSettings:t.valueSortSettings,valueAxis:t.valueAxis,grandTotalsPosition:t.grandTotalsPosition,formatSettings:t.formatSettings,calculatedFieldSettings:t.calculatedFieldSettings,fieldMapping:t.fieldMapping,showSubTotals:t.showSubTotals,showRowSubTotals:t.showRowSubTotals,showColumnSubTotals:t.showColumnSubTotals,subTotalsPosition:t.subTotalsPosition,showGrandTotals:t.showGrandTotals,showRowGrandTotals:t.showRowGrandTotals,showColumnGrandTotals:t.showColumnGrandTotals,showHeaderWhenEmpty:t.showHeaderWhenEmpty,alwaysShowValueHeader:t.alwaysShowValueHeader,conditionalFormatSettings:t.conditionalFormatSettings,emptyCellsTextContent:t.emptyCellsTextContent,groupSettings:t.groupSettings,showAggregationOnValueField:t.showAggregationOnValueField,authentication:this.CloneAuthenticationObject(t.authentication)})})},zdt.cloneFieldSettings=function(e){if(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];t.push(this.getDefinedObj({name:o.name,caption:o.caption,axis:o.axis,baseField:o.baseField,baseItem:o.baseItem,isCalculatedField:o.isCalculatedField,isNamedSet:o.isNamedSet,showNoDataItems:o.showNoDataItems,showSubTotals:o.showSubTotals,type:o.type,dataType:o.dataType,showFilterIcon:o.showFilterIcon,showSortIcon:o.showSortIcon,showRemoveIcon:o.showRemoveIcon,showValueTypeIcon:o.showValueTypeIcon,showEditIcon:o.showEditIcon,allowDragAndDrop:o.allowDragAndDrop,expandAll:o.expandAll,groupName:o.groupName}))}return t}return e},zdt.cloneOlapFieldSettings=function(e){if(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];t.push(this.getDefinedObj({caption:o.caption,hasChildren:o.hasChildren,id:o.id,isSelected:o.isSelected,name:o.name,spriteCssClass:o.spriteCssClass,tag:o.tag,type:o.type,pid:o.pid,expanded:o.expanded,defaultHierarchy:o.defaultHierarchy,hasAllMember:o.hasAllMember,allMember:o.allMember,isChecked:o.isChecked,filterMembers:o.filterMembers,formula:o.formula,childMembers:o.childMembers,searchMembers:o.searchMembers,htmlAttributes:this.getDefinedObj(o.htmlAttributes),currrentMembers:o.currrentMembers,isHierarchy:o.isHierarchy,isNamedSets:o.isNamedSets,formatString:o.formatString,actualFilter:o.actualFilter,levels:o.levels,levelCount:o.levelCount,memberType:o.memberType,fieldType:o.fieldType,parentHierarchy:o.parentHierarchy}))}return t}return e},zdt.cloneFilterSettings=function(e){if(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];t.push(this.getDefinedObj({name:o.name,type:o.type,condition:o.condition,items:o.items&&o.items.slice(),levelCount:o.levelCount,measure:o.measure,selectedField:o.selectedField,showDateFilter:o.showDateFilter,showLabelFilter:o.showLabelFilter,showNumberFilter:o.showNumberFilter,value1:o.value1,value2:o.value2}))}return t}return e},zdt.cloneSortSettings=function(e){if(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];t.push(this.getDefinedObj({name:o.name,order:o.order,membersOrder:o.membersOrder&&o.membersOrder.slice()}))}return t}return e},zdt.getFormattedHeader=function(e,t){var i,n,o=zdt.frameHeaderWithKeys(e);return o.valueSort&&o.valueSort.axis&&(i=o.valueSort.axis,n=this.isDateField(i,t),o.formattedText=(n||!t.formatFields[i]||!0===e.isSum?o:t.getFormattedValue(o.actualText,i)).formattedText),o},zdt.getFormattedMembers=function(e,t,i){var n=this.isDateField(t,i);if(n||i.groupingFields[t]){for(var o={},r=Object.keys(e),s=i.fieldList[t].dateMember,a=0,l=r.length;a<l;a++){var h=e[r[a]];n?o[h.caption]=h:o[s[h.ordinal-1].actualText]=h}return o}return e},zdt.isDateField=function(e,t){return t.formatFields[e]&&-1<["date","dateTime","time"].indexOf(t.formatFields[e].type)},zdt.formatChartHeaders=function(e,t,i,n){for(var o=[],r=0,s=e.length;r<s;r++){var a=i?0<t.parent.dataSourceSettings.columns.length&&!je(t.parent.dataSourceSettings.columns[r])?t.parent.dataSourceSettings.columns[r].name:void 0:0<t.parent.dataSourceSettings.rows.length&&!je(t.parent.dataSourceSettings.rows[r])?t.parent.dataSourceSettings.rows[r].name:void 0;je(a)?n&&n.isGrandSum?o.push(t.parent.localeObj.getConstant("grandTotal")):o.push(e[r]):t.engineModule.formatFields[a]&&-1<["date","dateTime","time"].indexOf(t.engineModule.formatFields[a].type)?o.push(e[r]):o.push(t.engineModule.getFormattedValue(e[r],a).formattedText)}return o.join(" - ")},zdt.cloneDrillMemberSettings=function(e){if(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];t.push(this.getDefinedObj({name:o.name,delimiter:o.delimiter,items:o.items&&o.items.slice()}))}return t}return e},zdt.cloneFormatSettings=function(e){if(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];t.push(this.getDefinedObj({name:o.name,calendar:o.calendar,currency:o.currency,format:o.format,maximumFractionDigits:o.maximumFractionDigits,maximumSignificantDigits:o.maximumSignificantDigits,minimumFractionDigits:o.minimumFractionDigits,minimumIntegerDigits:o.minimumIntegerDigits,minimumSignificantDigits:o.minimumSignificantDigits,skeleton:o.skeleton,type:o.type,useGrouping:o.useGrouping}))}return t}return e},zdt.CloneValueSortObject=function(e){return e&&{columnIndex:e.columnIndex,headerDelimiter:e.headerDelimiter,headerText:e.headerText,measure:e.measure,sortOrder:e.sortOrder}},zdt.CloneAuthenticationObject=function(e){return e&&{userName:e.userName,password:e.password}},zdt.cloneCalculatedFieldSettings=function(e){if(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];t.push(this.getDefinedObj({name:o.name,formatString:o.formatString,formula:o.formula,hierarchyUniqueName:o.hierarchyUniqueName}))}return t}return e},zdt.cloneConditionalFormattingSettings=function(e){if(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];t.push(this.getDefinedObj({applyGrandTotals:o.applyGrandTotals,conditions:o.conditions,label:o.label,measure:o.measure,style:o.style&&{backgroundColor:o.style.backgroundColor,color:o.style.color,fontFamily:o.style.fontFamily,fontSize:o.style.fontSize},value1:o.value1,value2:o.value2}))}return t}return e},zdt.cloneGroupSettings=function(e){if(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];t.push(this.getDefinedObj({name:o.name,caption:o.caption,customGroups:this.cloneCustomGroups(o.customGroups),endingAt:o.endingAt,startingAt:o.startingAt,groupInterval:o.groupInterval,rangeInterval:o.rangeInterval,type:o.type}))}return t}return e},zdt.cloneCustomGroups=function(e){if(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];t.push(this.getDefinedObj({groupName:o.groupName,items:o.items&&o.items.slice()}))}return t}return e},zdt.getFilterItemByName=function(e,t){t=new me({json:t}).executeLocal((new ya).where("name","equal",e));if(t&&0<t.length)return t[t.length-1]},zdt.getFieldByName=function(e,t){return new me({json:t}).executeLocal((new ya).where("name","equal",e))[0]},zdt.getFieldInfo=function(e,t,i){if(!i)for(var n=[this.cloneFieldSettings(t.dataSourceSettings.rows),this.cloneFieldSettings(t.dataSourceSettings.columns),this.cloneFieldSettings(t.dataSourceSettings.values),this.cloneFieldSettings(t.dataSourceSettings.filters)],o=0,r=n.length;o<r;o++)for(var s=0,a=n[o]?n[o].length:0;s<a;s++)if(n[o][s]&&n[o][s].name===e)return{fieldName:e,fieldItem:n[o][s],axis:0===o?"rows":1===o?"columns":2===o?"values":"filters",position:s};i=("olap"===t.dataType?t.olapEngineModule:t.engineModule).fieldList[e];return{fieldName:e,fieldItem:i?{name:e,caption:i.caption,baseField:i.baseField,baseItem:i.baseItem,isCalculatedField:i.isCalculatedField,isNamedSet:i.isNamedSets,showNoDataItems:i.showNoDataItems,showSubTotals:i.showSubTotals,type:i.aggregateType,showFilterIcon:i.showFilterIcon,showSortIcon:i.showSortIcon,showRemoveIcon:i.showRemoveIcon,showValueTypeIcon:i.showValueTypeIcon,showEditIcon:i.showEditIcon,allowDragAndDrop:i.allowDragAndDrop,expandAll:i.expandAll}:void 0,axis:"fieldlist",position:-1}},zdt.isButtonIconRefesh=function(e,t,i){var n=!1;try{if("dataSourceSettings"===e&&t.dataSourceSettings&&i.dataSourceSettings){var o=["notAvail","notAvail","notAvail","notAvail"],r=Object.keys(t.dataSourceSettings),s=Object.keys(i.dataSourceSettings);if(r&&s&&0<s.length&&r.length===s.length)for(var a=["rows","columns","values","filters"],l=0;l<s.length;l++){var h=s[l]in t.dataSourceSettings&&!je(t.dataSourceSettings[s[l]])?Object.keys(t.dataSourceSettings[s[l]]):[],d=s[l]in i.dataSourceSettings&&!je(i.dataSourceSettings[s[l]])?Object.keys(i.dataSourceSettings[s[l]]):[];if(-1!==a.indexOf(s[l])&&-1!==a.indexOf(r[l])&&h&&d&&0<d.length&&h.length===d.length)for(var p=["showFilterIcon","showSortIcon","showRemoveIcon","showValueTypeIcon","showEditIcon","allowDragAndDrop","expandAll"],c=0;c<d.length;c++){for(var u=Object.keys(t.dataSourceSettings[s[l]][d[c]]),g=Object.keys(i.dataSourceSettings[s[l]][d[c]]),m=0;m<g.length;m++){if(-1===p.indexOf(g[m])||-1===p.indexOf(u[m])){o[l]="break";break}o[l]="update"}if("break"===o[l])break}else o[l]="break";if("break"===o[l])break}for(var f=0,y=0,v=0,b=0,w=o;b<w.length;b++){var C=w[b];"break"===C&&f++,"notAvail"===C&&y++,"update"===C&&v++}n=!(0<f||4===y)&&0===f&&y<4&&0<v}}catch(e){n=!1}return n},zdt.formatPivotValues=function(e){for(var t=[],i=0;i<e.length;i++)if(e[i]){t[i]=[];for(var n=0;n<e[i].length;n++)e[i][n]&&(t[i][n]={axis:e[i][n].Axis,actualText:e[i][n].ActualText,indexObject:e[i][n].IndexObject,index:e[i][n].Index,rowHeaders:e[i][n].RowHeaders,columnHeaders:e[i][n].ColumnHeaders,formattedText:e[i][n].FormattedText,actualValue:e[i][n].ActualValue,rowIndex:e[i][n].RowIndex,colIndex:e[i][n].ColIndex,colSpan:e[i][n].ColSpan,level:e[i][n].Level,rowSpan:e[i][n].RowSpan,isSum:e[i][n].IsSum,isGrandSum:e[i][n].IsGrandSum,valueSort:e[i][n].ValueSort,ordinal:e[i][n].Ordinal,hasChild:e[i][n].HasChild,isDrilled:e[i][n].IsDrilled,value:e[i][n].Value,type:e[i][n].Type,members:e[i][n].Members})}return t},zdt.formatFieldList=function(e){for(var t=Object.keys(e),i={},n=0;n<t.length;n++)e[t[n]]&&(i[t[n]]={id:e[t[n]].Id,caption:e[t[n]].Caption,type:e[t[n]].Type,formatString:e[t[n]].FormatString,index:e[t[n]].Index,members:e[t[n]].Members,formattedMembers:e[t[n]].FormattedMembers,dateMember:e[t[n]].DateMember,filter:e[t[n]].Filter,sort:e[t[n]].Sort,aggregateType:e[t[n]].AggregateType,baseField:e[t[n]].BaseField,baseItem:e[t[n]].BaseItem,filterType:e[t[n]].FilterType,format:e[t[n]].Format,formula:e[t[n]].Formula,isSelected:e[t[n]].IsSelected,isExcelFilter:e[t[n]].IsExcelFilter,showNoDataItems:e[t[n]].ShowNoDataItems,isCustomField:e[t[n]].IsCustomField,showFilterIcon:e[t[n]].ShowFilterIcon,showSortIcon:e[t[n]].ShowSortIcon,showRemoveIcon:e[t[n]].ShowRemoveIcon,showEditIcon:e[t[n]].ShowEditIcon,showValueTypeIcon:e[t[n]].ShowValueTypeIcon,allowDragAndDrop:e[t[n]].AllowDragAndDrop,isCalculatedField:e[t[n]].IsCalculatedField,showSubTotals:e[t[n]].ShowSubTotals,expandAll:e[t[n]].expandAll,groupName:e[t[n]].groupName});return i},zdt.frameContent=function(e,t,i,n){var o=[];if(0<n.dataSourceSettings.values.length&&!n.engineModule.isEmptyData&&(n.enableValueSorting||!n.engineModule.isEngineUpdated))for(var r=0,s="value"===t?e.length:i,a="value"===t?i:0;a<s;a++)if(e[a]){o[r="header"===t?a:r]={};for(var l=0;l<e[a].length;l++)e[a][l]&&(o[r][l]=e[a][l]);r++}return o},zdt.getLocalizedObject=function(e){var t={};return t.Null=e.localeObj.getConstant("null"),t.Years=e.localeObj.getConstant("Years"),t.Quarters=e.localeObj.getConstant("Quarters"),t.Months=e.localeObj.getConstant("Months"),t.Days=e.localeObj.getConstant("Days"),t.Hours=e.localeObj.getConstant("Hours"),t.Minutes=e.localeObj.getConstant("Minutes"),t.Seconds=e.localeObj.getConstant("Seconds"),t.QuarterYear=e.localeObj.getConstant("QuarterYear"),t.Of=e.localeObj.getConstant("of"),t.Qtr=e.localeObj.getConstant("qtr"),t.Undefined=e.localeObj.getConstant("undefined"),t.GroupOutOfRange=e.localeObj.getConstant("groupOutOfRange"),t.Group=e.localeObj.getConstant("group"),t},zdt.updateReport=function(e,t){e.setProperties({dataSourceSettings:{rows:[]}},!0),e.setProperties({dataSourceSettings:{columns:[]}},!0),e.setProperties({dataSourceSettings:{formatSettings:[]}},!0);for(var i=0;i<t.Rows.length;i++)e.dataSourceSettings.rows.push({name:t.Rows[i].Name,caption:t.Rows[i].Caption,showNoDataItems:t.Rows[i].ShowNoDataItems,baseField:t.Rows[i].BaseField,baseItem:t.Rows[i].BaseItem,showFilterIcon:t.Rows[i].ShowFilterIcon,showSortIcon:t.Rows[i].ShowSortIcon,showEditIcon:t.Rows[i].ShowEditIcon,showRemoveIcon:t.Rows[i].ShowRemoveIcon,showSubTotals:t.Rows[i].ShowValueTypeIcon,allowDragAndDrop:t.Rows[i].AllowDragAndDrop,axis:t.Rows[i].Axis,dataType:t.Rows[i].DataType,isCalculatedField:t.Rows[i].IsCalculatedField,showValueTypeIcon:t.Rows[i].ShowValueTypeIcon,type:t.Rows[i].Type,expandAll:t.Rows[i].expandAll});for(i=0;i<t.Columns.length;i++)e.dataSourceSettings.columns.push({name:t.Columns[i].Name,caption:t.Columns[i].Caption,showNoDataItems:t.Columns[i].ShowNoDataItems,baseField:t.Columns[i].BaseField,baseItem:t.Columns[i].BaseItem,showFilterIcon:t.Columns[i].ShowFilterIcon,showSortIcon:t.Columns[i].ShowSortIcon,showEditIcon:t.Columns[i].ShowEditIcon,showRemoveIcon:t.Columns[i].ShowRemoveIcon,showSubTotals:t.Columns[i].ShowValueTypeIcon,allowDragAndDrop:t.Columns[i].AllowDragAndDrop,axis:t.Columns[i].Axis,dataType:t.Columns[i].DataType,isCalculatedField:t.Columns[i].IsCalculatedField,showValueTypeIcon:t.Columns[i].ShowValueTypeIcon,type:t.Columns[i].Type,expandAll:t.Columns[i].expandAll});for(i=0;i<t.FormatSettings.length;i++)e.dataSourceSettings.formatSettings.push({name:t.FormatSettings[i].Name,format:t.FormatSettings[i].Format,type:t.FormatSettings[i].Type,currency:t.FormatSettings[i].Currency,maximumFractionDigits:t.FormatSettings[i].MaximumFractionDigits,maximumSignificantDigits:t.FormatSettings[i].MaximumSignificantDigits,minimumFractionDigits:t.FormatSettings[i].MinimumFractionDigits,minimumIntegerDigits:t.FormatSettings[i].MinimumIntegerDigits,minimumSignificantDigits:t.FormatSettings[i].MinimumSignificantDigits,skeleton:t.FormatSettings[i].Skeleton,useGrouping:t.FormatSettings[i].UseGrouping})},zdt.generateUUID=function(){var i=(new Date).getTime(),n=performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random();return 0<i?(t=(i+t)%16|0,i=Math.floor(i/16)):(t=(n+t)%16|0,n=Math.floor(n/16)),("x"===e?t:3&t|8).toString(16)})},zdt.applyCustomSort=function(e,i,n,t,o){var r,s=[],a=((s=e.IsOrderChanged?e.members:"Ascending"===e.sortOrder||"None"===e.sortOrder||void 0===e.sortOrder?[].concat(e.members):[].concat(e.members).reverse()).length>i.length&&(s=s.filter(function(t){return i.some(function(e){e=o?e.formattedText:"string"===n||"number"===n?e.actualText:e.dateText;return typeof t==typeof e&&e===t})})),[]),l=void 0===n||"string"===n||"number"===n;0<i.length&&"Grand Total"===i[0].actualText&&(r=i[0],i.shift());for(var h=0,d=0;h<i.length;h++){var p=i[h],c=o?p.formattedText:l?p.actualText:!0===n?p.actualText.toString():p.dateText;if(s[d]===c){if(i.splice(d++,0,p),i.splice(++h,1),!(d<s.length)){t||a.splice(--d,0,c);break}h=-1}0<=h&&!t&&(a[h]=c)}if(!t){for(h=a.length;h<i.length;h++){p=i[h],c=o?p.formattedText:l?p.actualText:!0===n?p.actualText.toString():p.dateText;a[h]=c}"Grand Total"===a[a.length-1]&&a.pop(),e.members=a}return r&&i.splice(0,0,r),i},zdt.applyHeadersSort=function(e,i,t,n){return e=n?e.sort(function(e,t){e=e.actualText,t=t.actualText;return"Grand Total"===e||"Grand Total"===t?0:"Out of Range"===e?1:"Out of Range"===t?-1:isNaN(parseFloat(e))||isNaN(parseFloat(t))?"Ascending"===i?e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"}):t.localeCompare(e,void 0,{numeric:!0,sensitivity:"base"}):"Ascending"===i?parseFloat(e)-parseFloat(t):parseFloat(t)-parseFloat(e)}):"datetime"===t||"date"===t||"time"===t?"Ascending"===i?e.sort(function(e,t){return"Out of Range"===e.dateText?1:"Out of Range"===t.dateText?-1:e.dateText>t.dateText?1:e.dateText<t.dateText?-1:0}):"Descending"===i?e.sort(function(e,t){return"Out of Range"===e.dateText?1:"Out of Range"===t.dateText?-1:e.dateText<t.dateText?1:e.dateText>t.dateText?-1:0}):e:!0===t?"Ascending"===i?e.sort(function(e,t){return"Grand Total"===e.actualText||"Grand Total"===t.actualText?0:"Out of Range"===e.actualText?1:"Out of Range"===t.actualText?-1:Number(e.actualText.toString().match(/\d+/))>Number(t.actualText.toString().match(/\d+/))?1:Number(t.actualText.toString().match(/\d+/))>Number(e.actualText.toString().match(/\d+/))?-1:0}):"Descending"===i?e.sort(function(e,t){return"Grand Total"===e.actualText||"Grand Total"===t.actualText?0:"Out of Range"===e.actualText?-1:"Out of Range"===t.actualText||Number(e.actualText.toString().match(/\d+/))<Number(t.actualText.toString().match(/\d+/))?1:Number(t.actualText.toString().match(/\d+/))<Number(e.actualText.toString().match(/\d+/))?-1:0}):e:"Ascending"===i?e.sort(function(e,t){return"Grand Total"===e.actualText||"Grand Total"===t.actualText?0:e.actualText>t.actualText?1:t.actualText>e.actualText?-1:0}):"Descending"===i?e.sort(function(e,t){return"Grand Total"===e.actualText||"Grand Total"===t.actualText?0:e.actualText<t.actualText?1:t.actualText<e.actualText?-1:0}):e},zdt.renderOlapEngine=function(t,e){try{t.olapEngineModule.renderEngine(t.dataSourceSettings,e||t.frameCustomProperties(t.olapEngineModule.fieldListData,t.olapEngineModule.fieldList),t.onHeadersSort?t.getHeaderSortInfo.bind(t):void 0),t.setProperties({dataSourceSettings:{valueIndex:t.olapEngineModule.measureIndex}},!0)}catch(e){t.actionObj.actionName="engineFormation",t.olapEngineModule.errorInfo?(t.actionFailureMethod(t.olapEngineModule.errorInfo),t.olapEngineModule.errorInfo=void 0):t.actionFailureMethod(e)}},zdt.frameHeaderWithKeys=function(e){for(var t=Object.keys(e),i=0,n={};i<t.length;)n[t[i]]=e[t[i]],i++;return n},zdt.getPageSize=function(e){switch(e){case"Letter":return new td(612,792);case"Note":return new td(540,720);case"Legal":return new td(612,1008);case"A0":return new td(2380,3368);case"A1":return new td(1684,2380);case"A2":return new td(1190,1684);case"A3":return new td(842,1190);case"A5":return new td(421,595);case"A6":return new td(297,421);case"A7":return new td(210,297);case"A8":return new td(148,210);case"A9":return new td(105,148);case"B0":return new td(2836,4008);case"B1":return new td(2004,2836);case"B2":return new td(1418,2004);case"B3":return new td(1002,1418);case"B4":return new td(709,1002);case"B5":return new td(501,709);case"Archa":return new td(648,864);case"Archb":return new td(864,1296);case"Archc":return new td(1296,1728);case"Archd":return new td(1728,2592);case"Arche":return new td(2592,3456);case"Flsa":return new td(612,936);case"HalfLetter":return new td(396,612);case"Letter11x17":return new td(792,1224);case"Ledger":return new td(1224,792);default:return new td(595,842)}},zdt.getSortedValue=function(e,i){return e.sort(function(e,t){return"Descending"===i?(t.value||"grand sum"===t.header.type?t.value:0)-(e.value||"grand sum"===e.header.type?e.value:0):(e.value||"grand sum"===e.header.type?e.value:0)-(t.value||"grand sum"===t.header.type?t.value:0)}),e.map(function(e){return e.header})},zdt.toggleFieldListIconVisibility=function(e){e.showFieldList&&ge("#"+e.element.id+"_PivotFieldList",e.element)&&(e.toolbar&&-1!==e.toolbar.indexOf("FieldList")?ge("#"+e.element.id+"_PivotFieldList",e.element).style.display="none":(ge("#"+e.element.id+"_PivotFieldList",e.element).style.top=e.element.querySelector("."+ddt).offsetHeight.toString()+"px",ge("#"+e.element.id+"_PivotFieldList",e.element).style.position="relative")),e.toolbar&&-1!==e.toolbar.indexOf("FieldList")&&e.showToolbar&&e.element.querySelector(".e-toggle-field-list")&&(e.element.querySelector(".e-toggle-field-list").style.display="none")},zdt);function zdt(){}var jdt=function(){return(jdt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Wdt=(Qdt.prototype.clearProperties=function(e){this.isPagingOrVirtualizationEnabled||e||(this.columnKeys={},this.headerCollection={rowHeaders:[],columnHeaders:[],rowHeadersCount:0,columnHeadersCount:0}),this.enableValueSorting&&(this.valueContent=[]),this.saveDataHeaders=this.allowValueFilter?this.saveDataHeaders:{},this.rMembers=[],this.cMembers=[],this.slicedHeaders=[],this.fieldFilterMem={},this.filterPosObj={},this.selectedHeaders={selectedHeader:[],values:[]},this.rowGrandTotal=null,this.columnGrandTotal=null,this.rawIndexObject={},-1<this.dataSourceSettings.valueIndex&&(this.valueAxisFields={}),this.headerObjectsCollection={},this.fieldDrillCollection={}},Qdt.prototype.renderEngine=function(e,t,i,n){if(this.getValueCellInfo=i,this.getHeaderSortInfo=n,this.customProperties=t,this.fieldList)for(var o=0,r=e.formatSettings;o<r.length;o++)!this.formatFields[r[o].name]&&this.fieldList[r[o].name]&&(this.fieldList[r[o].name].members={},this.fieldList[r[o].name].formattedMembers={},this.fieldList[r[o].name].dateMember=[]);if(this.formatFields={},this.dateFormatFunction={},this.calculatedFields={},this.calculatedFormulas={},this.valueAxis=0,this.saveDataHeaders={},this.columnCount=0,this.rowCount=0,this.columnPageCount=0,this.rowPageCount=0,this.colFirstLvl=0,this.rowFirstLvl=0,this.rowStartPos=0,this.colStartPos=0,this.dataSourceSettings.excludeFields=je(e.excludeFields)?[]:e.excludeFields,this.enableValueSorting=!1,this.headerCollection={rowHeaders:[],columnHeaders:[],rowHeadersCount:0,columnHeadersCount:0},this.aggregatedValueMatrix=[],this.rMembers=[],this.cMembers=[],this.memberCnt=-1,this.pageInLimit=!1,this.endPos=0,this.removeCount=0,this.colHdrBufferCalculated=!1,this.colValuesLength=1,this.rowValuesLength=1,this.slicedHeaders=[],this.fieldFilterMem={},this.filterPosObj={},this.selectedHeaders={selectedHeader:[],values:[]},this.rowGrandTotal=null,this.columnGrandTotal=null,this.removeRowGrandTotal=!1,this.removeColumnGrandTotal=!1,this.isValueHasAdvancedAggregate=!1,this.rawIndexObject={},this.isLastHeaderHasMeasures=!0,this.isEditing=!1,this.globalize=t&&t.globalize?t.globalize:new Ti,this.currencyCode=t&&t.currenyCode?t.currenyCode:void 0,this.localeObj=t?t.localeObj:void 0,this.fieldsType=t?t.fieldsType:{},this.clonedReport=t?t.clonedReport&&t.clonedReport.properties?t.clonedReport.properties:t.clonedReport:{},this.enablePaging=t.enablePaging,this.enableVirtualization=t.enableVirtualization,this.enableOptimizedRendering=t.enableOptimizedRendering,this.enableHtmlSanitizer=t.enableHtmlSanitizer,this.isPagingOrVirtualizationEnabled=this.enablePaging||this.enableVirtualization,this.enableSort=e.enableSorting,this.dataSourceSettings.alwaysShowValueHeader=e.alwaysShowValueHeader,this.dataSourceSettings.showHeaderWhenEmpty=!!je(e.showHeaderWhenEmpty)||e.showHeaderWhenEmpty,this.dataSourceSettings.showSubTotals=!!je(e.showSubTotals)||e.showSubTotals,this.dataSourceSettings.showRowSubTotals=!!je(e.showRowSubTotals)||e.showRowSubTotals,this.dataSourceSettings.showColumnSubTotals=!!je(e.showColumnSubTotals)||e.showColumnSubTotals,this.dataSourceSettings.showGrandTotals=!!je(e.showGrandTotals)||e.showGrandTotals,this.dataSourceSettings.grandTotalsPosition=je(e.grandTotalsPosition)?"Bottom":e.grandTotalsPosition,this.dataSourceSettings.showRowGrandTotals=!!je(e.showRowGrandTotals)||e.showRowGrandTotals,this.dataSourceSettings.showColumnGrandTotals=!!je(e.showColumnGrandTotals)||e.showColumnGrandTotals,this.showSubTotalsAtTop=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&"Top"===e.subTotalsPosition&&!t.isTabularLayout,this.showSubTotalsAtBottom=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals&&"Bottom"===e.subTotalsPosition||t.isTabularLayout,this.allowValueFilter=e.allowValueFilter,this.isValueFilterEnabled=!1,this.enableValueSorting=!!t&&t.enableValueSorting,this.isDrillThrough=t&&t.isDrillThrough||!1,this.valueContent=[],this.dataSourceSettings=Hdt.getClonedDataSourceSettings(e),e.dataSource instanceof me||("CSV"===e.type?(this.data=e.dataSource.map(function(e){return e.slice()}),this.fieldList&&this.data.shift()):this.data=e.dataSource),this.data&&this.data[0]){if(!this.fieldList){"CSV"===e.type?this.fields=this.data.shift():this.fields=Object.keys(this.data[0]),this.fieldKeys={};for(o=0;o<this.fields.length;o++)this.fieldKeys[this.fields[o]]="CSV"===e.type?o:this.fields[o]}t&&t.pageSettings&&t.allowDataCompression&&(this.actualData=this.data,this.data=this.getGroupedRawData(e)),this.dataSourceSettings.rows=e.rows||[],this.dataSourceSettings.columns=e.columns||[],this.dataSourceSettings.filters=e.filters||[],this.dataSourceSettings.values=e.values||[],this.dataSourceSettings.formatSettings=e.formatSettings||[],this.dataSourceSettings.groupSettings=e.groupSettings||[],this.dataSourceSettings.calculatedFieldSettings=e.calculatedFieldSettings||[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.dataSourceSettings.fieldMapping=e.fieldMapping||[],this.valueAxisFields={};for(var s=0,a=this.dataSourceSettings.values;s<a.length;s++){var l=a[s];this.valueAxisFields[l.name]=l}i=this.getGroupData(this.data),this.validateFilters(e),this.isExpandAll=!(!this.isValueFiltersAvail||!e.allowValueFilter)||e.expandAll,this.drilledMembers=!e.drilledMembers||this.isValueFiltersAvail&&e.allowValueFilter?[]:e.drilledMembers,this.isMultiMeasures=1<this.dataSourceSettings.values.length,this.valueAxis="row"===e.valueAxis?1:0,this.measureIndex=je(e.valueIndex)?-1:e.valueIndex,this.emptyCellTextContent=e.emptyCellsTextContent||"",this.rowValuesLength=1===this.valueAxis?this.dataSourceSettings.values.length:1,this.colValuesLength=0===this.valueAxis?this.dataSourceSettings.values.length:1,this.valueSortSettings=e.valueSortSettings||{sortOrder:"None",headerDelimiter:".",headerText:"",columnIndex:void 0},this.valueSortData=[],this.pageSettings=t?t.pageSettings||this.pageSettings:void 0,this.allowDataCompression=t&&t.allowDataCompression,this.savedFieldList=t?t.savedFieldList:void 0,this.getFieldList(i,this.enableSort,e.allowValueFilter),this.removeIrrelevantFields(Object.keys(this.fieldList)),this.fillFieldMembers(),this.updateSortSettings(e.sortSettings,this.enableSort),this.filterMembers=[];var h=this.dataSourceSettings.columns.length-1;for(this.columnKeys={};-1<h;)this.columnKeys[this.dataSourceSettings.columns[h].name]=this.dataSourceSettings.columns[h],h--;this.updateFilterMembers(e),this.generateGridData(e)}},Qdt.prototype.removeIrrelevantFields=function(e){for(var t={},i=(t[0]=this.dataSourceSettings.rows,t[1]=this.dataSourceSettings.columns,t[2]=this.dataSourceSettings.values,t[3]=this.dataSourceSettings.filters,0);i<4;){if(t[i])for(var n=0;n<t[i].length;n++){var o=t[i][n].name;-1<this.dataSourceSettings.excludeFields.indexOf(o)||!je(e)&&-1===e.indexOf(o)?(t[i].splice(n,1),n--):2===i&&(this.measureNames[o]=t[i][n].caption||o,this.measureNames[t[i][n].caption||o]=o)}i++}this.isMultiMeasures=1<this.dataSourceSettings.values.length,this.measureIndex=-1===this.measureIndex?(this.valueAxis?t[0]:t[1]).length:this.measureIndex},Qdt.prototype.updateDataSourceSettings=function(e,t){t&&(this.emptyCellTextContent=e.emptyCellsTextContent||"",this.valueAxis="row"===e.valueAxis?1:0,this.rowValuesLength=1===this.valueAxis?this.dataSourceSettings.values.length:1,this.colValuesLength=0===this.valueAxis?this.dataSourceSettings.values.length:1,this.measureIndex=je(e.valueIndex)?-1:e.valueIndex,this.enableSort=e.enableSorting,this.dataSourceSettings.alwaysShowValueHeader=e.alwaysShowValueHeader,this.dataSourceSettings.showHeaderWhenEmpty=!!je(e.showHeaderWhenEmpty)||e.showHeaderWhenEmpty,this.dataSourceSettings.showSubTotals=!!je(e.showSubTotals)||e.showSubTotals,this.dataSourceSettings.showRowSubTotals=!!je(e.showRowSubTotals)||e.showRowSubTotals,this.dataSourceSettings.showColumnSubTotals=!!je(e.showColumnSubTotals)||e.showColumnSubTotals,this.dataSourceSettings.showGrandTotals=!!je(e.showGrandTotals)||e.showGrandTotals,this.dataSourceSettings.grandTotalsPosition=je(e.grandTotalsPosition)?"Bottom":e.grandTotalsPosition,this.dataSourceSettings.showRowGrandTotals=!!je(e.showRowGrandTotals)||e.showRowGrandTotals,this.dataSourceSettings.showColumnGrandTotals=!!je(e.showColumnGrandTotals)||e.showColumnGrandTotals,this.showSubTotalsAtTop=this.dataSourceSettings.showSubTotals&&"Top"===e.subTotalsPosition&&e.showColumnSubTotals,this.showSubTotalsAtBottom=!!this.customProperties.isTabularLayout||this.dataSourceSettings.showSubTotals&&"Bottom"===e.subTotalsPosition&&e.showRowSubTotals,this.allowValueFilter=e.allowValueFilter,this.dataSourceSettings.formatSettings=e.formatSettings||[],this.dataSourceSettings.groupSettings=e.groupSettings||[],this.dataSourceSettings.calculatedFieldSettings=e.calculatedFieldSettings||[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.dataSourceSettings.fieldMapping=e.fieldMapping||[],this.dataSourceSettings.values=e.values||[],this.dataSourceSettings.rows=e.rows||[],this.dataSourceSettings.columns=e.columns||[],this.dataSourceSettings.filters=e.filters||[],this.dataSourceSettings.filterSettings=e.filterSettings||[],this.dataSourceSettings.sortSettings=e.sortSettings||[],this.dataSourceSettings.conditionalFormatSettings=e.conditionalFormatSettings||[],this.dataSourceSettings.valueSortSettings=e.valueSortSettings||{},this.removeIrrelevantFields(Object.keys(this.fieldList)))},Qdt.prototype.getGroupedRawData=function(e){this.data=[];for(var t=0,i=this.actualData;t<i.length;t++){var n=i[t];this.data[this.data.length]=Hdt.frameHeaderWithKeys(n)}for(var o=e.values.filter(function(e){return"Count"===e.type||"DistinctCount"===e.type}).map(function(e){return e.name}),r=0<o.length,s=this.data,a=e.rows.concat(e.columns.concat(e.filters)).map(function(e){return e.name}),l={},h=[],d=(this.groupRawIndex={},{}),p=0,c=0;c<s.length;c++){var u=s[c],g=[];if(r)for(var m=0;m<o.length;m++)u[this.fieldKeys[o[m]]]=je(u[this.fieldKeys[o[m]]])?u[this.fieldKeys[o[m]]]:1;for(var f=0;f<a.length;f++)g.push(u[this.fieldKeys[a[f]]]);var y=g.join("-");if(l[y]){for(m=0;m<e.values.length;m++){var v=e.values[m].name,b=u[this.fieldKeys[v]],w=l[y],C=e.values[m].type;je(b)||("number"==typeof b&&"DistinctCount"!==C||(C="Count"),je(w[v])?w[v]="Product"===C?1:"Min"===C||"Max"===C?void 0:0:"number"!=typeof w[v]&&(w[v]=1),"Count"===C?w[v]+=1:"Min"===C?je(w[v])||(w[v]=w[v]>b?b:w[v]):"Max"===C?je(w[v])||(w[v]=w[v]<b?b:w[v]):"Product"===C?w[v]*=b:w[v]+=b)}this.isDrillThrough&&this.groupRawIndex[d[y]].push(c)}else l[y]=u,h.push(u),this.isDrillThrough&&(this.groupRawIndex[p]=[c],d[y]=p,p++)}return h},Qdt.prototype.getGroupData=function(Ee){for(var De=this,Me=Ee[0],ke=this,e=0,t=this.dataSourceSettings.groupSettings;e<t.length;e++){var i=function(e,O){var t=O[e],i=t.name,n=t.caption;if(!(-1<ke.fields.indexOf(i)))return e<O.length-1?"continue":{value:Me};var o={},N=void 0;if("Date"===t.type&&ke.groupingFields[i]||"Custom"===t.type&&ke.groupingFields[i])return{value:Me};if("Number"===t.type){if("number"!==Hdt.getType(Me[i])&&ke.groupingFields[i])return{value:Me};t.rangeInterval&&Ee.sort(function(e,t){return Number(e[De.fieldKeys[i]])>Number(t[De.fieldKeys[i]])?1:Number(t[De.fieldKeys[i]])>Number(e[De.fieldKeys[i]])?-1:0})}for(var V=Ee.length;V--;){var r=Ee[V];if(r[ke.fieldKeys[i]]&&"Date"===t.type){var s=new Date(r[ke.fieldKeys[i]].toString());if(!je(s)&&0<t.groupInterval.length)for(var a=0,_=t.groupInterval.length;a<_;a++){var l=t.groupInterval[a],h=ke.getRange(t,s.getTime()),d=Hdt.resetTime(new Date);switch(l){case"Years":o[p=a===t.groupInterval.length-1?i:i+"_date_group_years"]=l,ke.fieldKeys[p]="CSV"===ke.dataSourceSettings.type?ke.fieldKeys[p]||ke.fields.length:p,-1===ke.fields.indexOf(p)&&ke.fields.push(p),r[ke.fieldKeys[p]]=h?void 0:new Date(d.setFullYear(s.getFullYear())).toString();break;case"Quarters":o[p=a===t.groupInterval.length-1?i:i+"_date_group_quarters"]=l;var H=Math.ceil((s.getMonth()+1)/3);ke.fieldKeys[p]="CSV"===ke.dataSourceSettings.type?ke.fieldKeys[p]||ke.fields.length:p,-1===ke.fields.indexOf(p)&&ke.fields.push(p),r[ke.fieldKeys[p]]=h?void 0:(ke.localeObj?ke.localeObj.getConstant("qtr"):"Qtr")+H.toString();break;case"QuarterYear":H=(o[p=a===t.groupInterval.length-1?i:i+"_date_group_quarterYear"]=l,Math.ceil((s.getMonth()+1)/3));ke.fieldKeys[p]="CSV"===ke.dataSourceSettings.type?ke.fieldKeys[p]||ke.fields.length:p,-1===ke.fields.indexOf(p)&&ke.fields.push(p),r[ke.fieldKeys[p]]=h?void 0:(ke.localeObj?ke.localeObj.getConstant("qtr"):"Qtr")+H.toString()+" "+(ke.localeObj?ke.localeObj.getConstant("of"):"of")+" "+s.getFullYear().toString();break;case"Months":o[p=a===t.groupInterval.length-1?i:i+"_date_group_months"]=l,ke.fieldKeys[p]="CSV"===ke.dataSourceSettings.type?ke.fieldKeys[p]||ke.fields.length:p,-1===ke.fields.indexOf(p)&&ke.fields.push(p),r[ke.fieldKeys[p]]=h?void 0:new Date(d.setMonth(s.getMonth(),1)).toString();break;case"Days":o[p=a===t.groupInterval.length-1?i:i+"_date_group_days"]=l,ke.fieldKeys[p]="CSV"===ke.dataSourceSettings.type?ke.fieldKeys[p]||ke.fields.length:p,-1===ke.fields.indexOf(p)&&ke.fields.push(p),r[ke.fieldKeys[p]]=h?void 0:new Date(d.setMonth(s.getMonth(),s.getDate())).toString();break;case"Hours":o[p=a===t.groupInterval.length-1?i:i+"_date_group_hours"]=l,ke.fieldKeys[p]="CSV"===ke.dataSourceSettings.type?ke.fieldKeys[p]||ke.fields.length:p,-1===ke.fields.indexOf(p)&&ke.fields.push(p),r[ke.fieldKeys[p]]=h?void 0:new Date(d.setHours(s.getHours())).toString();break;case"Minutes":o[p=a===t.groupInterval.length-1?i:i+"_date_group_minutes"]=l,ke.fieldKeys[p]="CSV"===ke.dataSourceSettings.type?ke.fieldKeys[p]||ke.fields.length:p,-1===ke.fields.indexOf(p)&&ke.fields.push(p),r[ke.fieldKeys[p]]=h?void 0:new Date(d.setMinutes(s.getMinutes())).toString();break;case"Seconds":o[p=a===t.groupInterval.length-1?i:i+"_date_group_seconds"]=l,ke.fieldKeys[p]="CSV"===ke.dataSourceSettings.type?ke.fieldKeys[p]||ke.fields.length:p,-1===ke.fields.indexOf(p)&&ke.fields.push(p),r[ke.fieldKeys[p]]=h?void 0:new Date(d.setSeconds(s.getSeconds())).toString()}}}else if(isNaN(Number(r[ke.fieldKeys[i]]))||"Number"!==t.type){if(r[ke.fieldKeys[i]]&&"Custom"===t.type&&t.customGroups&&0<t.customGroups.length){var p=i+"_custom_group",z=t.customGroups,j=void 0;ke.groupingFieldsInfo[i]=i,ke.groupingFieldsInfo[p]=i;for(var W=0,Q=z.length;W<Q;W++){var U,c=z[W];c.items&&1<c.items.length&&(ke.fieldKeys[N=p]="CSV"===ke.dataSourceSettings.type?ke.fieldKeys[p]||ke.fields.length:p,-1===ke.fields.indexOf(p)&&ke.fields.push(p),U=-1!==Hdt.inArray(r[ke.fieldKeys[i]].toString(),c.items),r[ke.fieldKeys[p]]=U?c.groupName&&""!==c.groupName?c.groupName:ke.localeObj.getConstant("group")+" "+W:j&&j!==r[ke.fieldKeys[i]].toString()?j:r[ke.fieldKeys[i]].toString(),j=r[ke.fieldKeys[p]])}}}else{h=ke.getRange(t,Number(r[ke.fieldKeys[i]]));r[ke.fieldKeys[i]]=h?void 0:r[ke.fieldKeys[i]]}for(var q=[],G=0,Y=ue=Object.keys(r);G<Y.length;G++){var X=Y[G];q.push(!!r[X])}Me=-1===q.indexOf(!1)&&ue.length===Object.keys(Ee[0]).length?r:Me}if("Date"===t.type){for(var u=!1,K=[ke.dataSourceSettings.rows,ke.dataSourceSettings.columns,ke.dataSourceSettings.values,ke.dataSourceSettings.filters],g=Object.keys(o),m=Object.keys(g).length,f=void 0,J=0,Z=K;J<Z.length;J++){var y=Z[J];if(!u&&y){for(var $,v,ee,b=y.length,w=0;w<b;){if(y[w].name===i){u=!0;var C=y[w];for(y.splice(w,1),B=(B=ke.dataSourceSettings.rows).concat(ke.dataSourceSettings.columns,ke.dataSourceSettings.values,ke.dataSourceSettings.filters);m--;){var S,A=C.caption||C.name;ke.clonedReport&&(S=(S=ke.clonedReport.rows).concat(ke.clonedReport.columns,ke.clonedReport.values,ke.clonedReport.filters),S=Hdt.getFieldByName(g[m],S))&&(A=S.caption||S.name),Hdt.getFieldByName(g[m],B)?ke.groupingFieldsInfo[g[m]]=i:(f=o[g[m]],A=-1!==A.indexOf(" (")&&-1!==A.indexOf(")")?A.slice(A.indexOf("(")+1,A.length-1):A,R={name:g[m],caption:(ke.localeObj?ke.localeObj.getConstant(f):f)+" ("+A+")",type:"Count",showNoDataItems:C.showNoDataItems,baseField:C.baseField,baseItem:C.baseItem,showFilterIcon:C.showFilterIcon,showSortIcon:C.showSortIcon,showEditIcon:C.showEditIcon,showRemoveIcon:C.showRemoveIcon,showSubTotals:C.showValueTypeIcon,allowDragAndDrop:C.allowDragAndDrop,expandAll:C.expandAll,groupName:C.groupName},y.splice(w,0,R),ke.groupingFieldsInfo[R.name]=i)}break}-1<y[w].name.indexOf(i)&&($=o[y[w].name],je(v=y.filter(function(e){return e.name===i})[0])||(ee=v.caption?-1!==v.caption.indexOf(" (")&&-1!==v.caption.indexOf(")")?v.caption.slice(v.caption.indexOf("(")+1,v.caption.length-1):v.caption:i,y[w].caption=(ke.localeObj?ke.localeObj.getConstant($):v)+" ("+ee+")")),w++}if(u)break}}for(var m=Object.keys(g).length,te=(ve=ke.getMappingField(i,(ke.clonedReport||ke.dataSourceSettings).fieldMapping)).caption||i;m--;){f=o[g[m]];for(var ie,x,ne=0,oe=ke.dataSourceSettings.formatSettings.length;ne<oe;ne++)if(ke.dataSourceSettings.formatSettings[ne].name===g[m]){ke.dataSourceSettings.formatSettings.splice(ne,1);break}"Quarters"!==f&&"QuarterYear"!==f&&(ie={name:g[m],type:-1<["Years","Months","Days"].indexOf(f)?"date":"time",format:"Years"===f?"yyyy":"Months"===f?"MMM":"Days"===f?"d-MMM":"Hours"===f?"hh a":"Minutes"===f?":mm":"Seconds"===f?":ss":void 0},ke.dataSourceSettings.formatSettings.push(ie)),u||(x=ke.getMappingField(g[m],ke.dataSourceSettings.fieldMapping),g[m]!==i&&je(x.name)?(R={name:g[m],caption:(ke.localeObj?ke.localeObj.getConstant(f):f)+" ("+te+")"},ke.dataSourceSettings.fieldMapping.push(R),ke.groupingFieldsInfo[R.name]=i):g[m]!==i&&(x.caption=(ke.localeObj?ke.localeObj.getConstant(f):f)+" ("+te+")",ke.groupingFieldsInfo[x.name]=i))}u||(x=ke.getMappingField(i,ke.dataSourceSettings.fieldMapping),f=o[i],g[m]!==i&&je(x.name)?(R={name:i,caption:(ke.localeObj?ke.localeObj.getConstant(f):f)+" ("+te+")"},ke.dataSourceSettings.fieldMapping.push(R),ke.groupingFieldsInfo[R.name]=i):(x.caption=(ke.localeObj?ke.localeObj.getConstant(f):f)+" ("+te+")",ke.groupingFieldsInfo[x.name]=i))}else if("Number"===t.type&&t.rangeInterval){for(var re=[],se=[],ae=Ee.length,b=0,I=(ke.groupingFields[i]=i,[]);b<ae;){var le=Number(Ee[b][i]);se.push(le),isNaN(le)||-1!==re.indexOf(le)||re.push(le),b++}for(ae=Ee.length,b=0;b<ae;){var T=Ee[b];if(T&&!isNaN(Number(T[i]))){var he=("string"==typeof t.endingAt?parseInt(t.endingAt,10):t.endingAt)||Math.max.apply(Math,re),E=Number.isInteger(t.rangeInterval)?0:ke.countDecimalPlaces(t.rangeInterval),D=void 0;switch(E){case 10:D=1e-10;break;case 9:D=1e-9;break;case 8:D=1e-8;break;case 7:D=1e-7;break;case 6:D=1e-6;break;case 5:D=1e-5;break;case 4:D=1e-4;break;case 3:D=.001;break;case 2:D=.01;break;case 1:D=.1;break;default:D=1}var M=Number.isInteger(t.rangeInterval)?Math.floor(Number(T[i])):Number(T[i].toFixed(E)),de=Number.isInteger(t.rangeInterval)?Math.floor(Number(M+(t.rangeInterval-1))):Number((M+t.rangeInterval).toFixed(E));if(M>=I[0]&&M<=I[I.length-1]){var k=I[0],P=Number.isInteger(t.rangeInterval)?Math.floor(I[I.length-1]):Number(I[I.length-1].toFixed(E));ke.processGrouping(T,i,k,P,he,t.rangeInterval,E),je(ke.groupedDataType[i])&&(ke.groupedDataType[i]="string")}else if(0===I.length){for(var pe=M;pe<=de;pe=Number((pe+D).toFixed(E)))I.push(pe);k=I[0],P=Number.isInteger(t.rangeInterval)?Math.floor(I[I.length-1]):Number(I[I.length-1].toFixed(E));ke.processGrouping(T,i,k,P,he,t.rangeInterval,E),je(ke.groupedDataType[i])&&(ke.groupedDataType[i]="string")}else{var k=Number.isInteger(t.rangeInterval)?Math.floor(I[I.length-1])+1:Number(I[I.length-1].toFixed(E)),P=Number.isInteger(t.rangeInterval)?Math.floor(k+(t.rangeInterval-1)):Number((k+t.rangeInterval).toFixed(E)),ce=!0;for(I.splice(0,I.length);ce;)k<=M&&M<=P&&(ke.processGrouping(T,i,k,P,he,t.rangeInterval,E),je(ke.groupedDataType[i])&&(ke.groupedDataType[i]="string"),I.push(k),I.push(P),ce=!1),k=Number.isInteger(t.rangeInterval)?P+1:P,P=Number.isInteger(t.rangeInterval)?Math.floor(k+(t.rangeInterval-1)):Number((k+t.rangeInterval).toFixed(E))}for(var ue,q=[],ge=0,me=ue=Object.keys(T);ge<me.length;ge++){X=me[ge];q.push(!!T[X])}Me=-1===q.indexOf(!1)&&ue.length===Object.keys(Ee[0]).length?T:Me}b++}for(var fe=0,ye=K=[ke.dataSourceSettings.rows,ke.dataSourceSettings.columns,ke.dataSourceSettings.values,ke.dataSourceSettings.filters];fe<ye.length;fe++){var ve,be=ye[fe];(ve=Hdt.getFieldByName(i,be))&&((ve=ve.properties||ve).type="Count")}for(var we=0,Ce=ke.dataSourceSettings.formatSettings.length;we<Ce;we++)if(ke.dataSourceSettings.formatSettings[we].name===i){ke.dataSourceSettings.formatSettings.splice(we,1);break}}else if("Custom"===t.type&&N){for(var B,Se=N,u=!1,K=[ke.dataSourceSettings.rows,ke.dataSourceSettings.columns,ke.dataSourceSettings.values,ke.dataSourceSettings.filters],Ae=(B=(B=ke.dataSourceSettings.rows).concat(ke.dataSourceSettings.columns,ke.dataSourceSettings.values,ke.dataSourceSettings.filters),[]),xe=(n&&""!==n||(Ae=Se.match(/_custom_group/g)),Hdt.getFieldByName(i.replace(/_custom_group/g,""),B)),F=Hdt.getFieldByName(Se,B),Ie=0,Te=K;Ie<Te.length;Ie++){y=Te[Ie];if(!u&&y){for(var b=y.length,L=0;L<b;){if(y[L].name===t.name&&!F){u=!0;var C=y[L],R={name:Se,caption:n&&""!==n?n:(xe.caption||xe.name)+(Ae.length+1),type:"Count",showNoDataItems:C.showNoDataItems,baseField:C.baseField,baseItem:C.baseItem,showSubTotals:C.showValueTypeIcon,allowDragAndDrop:C.allowDragAndDrop,showFilterIcon:C.showFilterIcon,showSortIcon:C.showSortIcon,showRemoveIcon:C.showRemoveIcon,showEditIcon:C.showEditIcon,expandAll:C.expandAll,groupName:C.groupName};y.splice(L,0,R),ke.groupingFieldsInfo[R.name]=i,ke.groupingFieldsInfo[i]=i;break}if(y[L].name===Se&&F){R={name:F.name,caption:n&&""!==n?n:F.caption,type:F.type,showNoDataItems:F.showNoDataItems,baseField:F.baseField,baseItem:F.baseItem,showRemoveIcon:F.showRemoveIcon,showSubTotals:F.showValueTypeIcon,allowDragAndDrop:F.allowDragAndDrop,showFilterIcon:F.showFilterIcon,showSortIcon:F.showSortIcon,showEditIcon:F.showEditIcon,expandAll:F.expandAll,groupName:F.groupName};y.splice(L,1,R),ke.groupingFieldsInfo[R.name]=i,ke.groupingFieldsInfo[i]=i;break}L++}if(u)break}}e=Hdt.getFieldByName(i,Hdt.cloneFormatSettings(ke.dataSourceSettings.formatSettings));e&&(e.name=Se,ke.dataSourceSettings.formatSettings.push(e)),ke.groupingFields[i]=i}ke.groupingFields=Pe(ke.groupingFields,o)}(e,t);if("object"==typeof i)return i.value}return Me},Qdt.prototype.countDecimalPlaces=function(e){e=e.toString();return e.includes(".")?e.split(".")[1].length:0},Qdt.prototype.processGrouping=function(e,t,i,n,o,r,s){Number.isInteger(e[t])||!Number.isInteger(e[t])&&(Number(e[t])<n||o<=Number(e[t]))?e[t]=this.getNumberGroupHeaders(i,n,o):!Number.isInteger(e[t])&&Number(e[t])>=n&&(e[t]=this.getNumberGroupHeaders(Number((i+r).toFixed(s)),Number((n+r).toFixed(s)),o))},Qdt.prototype.getNumberGroupHeaders=function(e,t,i){return e===t?e.toString():e<=i&&i<=t?i===e?e.toString():e.toString()+"-"+i.toString():e.toString()+"-"+t.toString()},Qdt.prototype.getRange=function(e,t){var i,n,o;return"Date"===e.type?(o=new Date(t),n="string"==typeof e.startingAt?new Date(e.startingAt):e.startingAt,i="string"==typeof e.endingAt?new Date(e.endingAt):e.endingAt,!!(n&&o.getTime()<n.getTime()||i&&o.getTime()>i.getTime())):(n="string"==typeof e.startingAt?parseFloat(e.startingAt):e.startingAt,o="string"==typeof e.endingAt?parseFloat(e.endingAt):e.endingAt,!isNaN(n)&&t<n||!isNaN(o)&&o<t)},Qdt.prototype.getPercentFormat=function(e,t){e=je(e[t])||je(this.formatFields[t].format)?void 0:this.formatFields[t].format.toLowerCase().match(/p[0-9]/);return je(e)?2:Number(this.formatFields[t].format.replace(/[^0-9]/g,""))},Qdt.prototype.getFormattedFields=function(e){this.formatFields=this.setFormattedFields(e.formatSettings)},Qdt.prototype.setFormattedFields=function(e){for(var t=e.length,i={};t--;)i[e[t].name]=e[t],e[t].type&&(this.dateFormatFunction[e[t].name]={exactFormat:this.globalize.getDateFormat(e[t]),fullFormat:this.globalize.getDateFormat({format:"yyyy/MM/dd/HH/mm/ss",type:e[t].type})});return i},Qdt.prototype.getFieldList=function(i,n,e){for(var o,r=this,t=this.dataSourceSettings.excludeFields.length-1;-1<t;){var s=this.fields.indexOf(this.dataSourceSettings.excludeFields[t]);-1!==s&&this.fields.splice(s,1),this.fieldList&&delete this.fieldList[this.dataSourceSettings.excludeFields[t]],t--}var a=this.fields,l=(l=Pe([],this.dataSourceSettings.rows,null,!0)).concat(this.dataSourceSettings.columns,this.dataSourceSettings.values,this.dataSourceSettings.filters);this.getFormattedFields(this.dataSourceSettings),this.getCalculatedField(a);var h=(a=this.fields).length,d=["string","number","datetime","date","boolean"];if(this.savedFieldList)for(this.fieldList=this.savedFieldList;h--;){var p=a[h],c=this.getMappingField(p,this.dataSourceSettings.fieldMapping);this.fieldList[p]?(this.fieldList[p].isSelected=!1,this.fieldList[p].index=h,this.fieldList[p].filter=[],this.fieldList[p].sort=n?"Ascending":"None",this.fieldList[p].isExcelFilter=!1,this.fieldList[p].filterType="",this.fieldList[p].showFilterIcon=!(c&&"showFilterIcon"in c)||c.showFilterIcon,this.fieldList[p].showRemoveIcon=!(c&&"showRemoveIcon"in c)||c.showRemoveIcon,this.fieldList[p].showSortIcon=!(c&&"showSortIcon"in c)||c.showSortIcon,this.fieldList[p].showEditIcon=!(c&&"showEditIcon"in c)||c.showEditIcon,this.fieldList[p].showValueTypeIcon=!(c&&"showValueTypeIcon"in c)||c.showValueTypeIcon,this.fieldList[p].allowDragAndDrop=!(c&&"allowDragAndDrop"in c)||c.allowDragAndDrop,this.fieldList[p].isCalculatedField=!!(c&&"isCalculatedField"in c)&&c.isCalculatedField,this.fieldList[p].showNoDataItems=!!(c&&"showNoDataItems"in c)&&c.showNoDataItems,this.fieldList[p].showSubTotals=!(c&&"showSubTotals"in c)||c.showSubTotals,this.fieldList[p].expandAll=!!(c&&"expandAll"in c)&&c.expandAll,this.fieldList[p].pid=c&&"groupName"in c&&c.groupName?c.groupName:this.groupingFieldsInfo[p]||void 0,this.isValueFiltersAvail&&e&&(this.fieldList[p].dateMember=[],this.fieldList[p].members={},this.fieldList[p].isMembersFilled=!1)):(o=je(this.groupedDataType[p])?c&&"dataType"in c&&c.dataType&&-1<d.indexOf(c.dataType.toLowerCase())?c.dataType.toLowerCase():o:this.groupedDataType[p],this.fieldList[p]={caption:c&&"caption"in c&&c.caption?c.caption:p,id:p,type:-1!==p.indexOf("_custom_group")||-1!==p.indexOf("_date_group")?"string":void 0===o||"undefined"===o?"number":o,isSelected:!1,sort:n?"Ascending":"None",filterType:"",index:h,filter:[],isCustomField:-1!==p.indexOf("_custom_group")||-1!==p.indexOf("_date_group"),showRemoveIcon:!(c&&"showRemoveIcon"in c)||c.showRemoveIcon,showFilterIcon:!(c&&"showFilterIcon"in c)||c.showFilterIcon,showSortIcon:!(c&&"showSortIcon"in c)||c.showSortIcon,showNoDataItems:!!(c&&"showNoDataItems"in c)&&c.showNoDataItems,isCalculatedField:!!(c&&"isCalculatedField"in c)&&c.isCalculatedField,showEditIcon:!(c&&"showEditIcon"in c)||c.showEditIcon,showValueTypeIcon:!(c&&"showValueTypeIcon"in c)||c.showValueTypeIcon,allowDragAndDrop:!(c&&"allowDragAndDrop"in c)||c.allowDragAndDrop,showSubTotals:!(c&&"showSubTotals"in c)||c.showSubTotals,expandAll:!!(c&&"expandAll"in c)&&c.expandAll,pid:c&&"groupName"in c&&c.groupName?c.groupName:this.groupingFieldsInfo[p]||void 0,aggregateType:c&&"type"in c?c.type:"number"===(-1!==p.indexOf("_custom_group")||-1!==p.indexOf("_date_group")?"string":void 0===o||"undefined"===o?"number":o)?"Sum":"Count",baseField:c&&"baseField"in c?c.baseField:void 0,baseItem:c&&"baseItem"in c?c.baseItem:void 0}),this.updateMembersOrder(p)}else{this.fieldList={};for(var u=this;h--;)!function(){var t=a[h],e=u.getMappingField(t,u.dataSourceSettings.fieldMapping);void 0!==(o=je(u.groupedDataType[t])?e&&"dataType"in e&&e.dataType&&-1<d.indexOf(e.dataType.toLowerCase())?e.dataType.toLowerCase():Hdt.getType(i[u.fieldKeys[t]]):u.groupedDataType[t])&&"undefined"!==o||(0<u.dataSourceSettings.groupSettings.length?u.dataSourceSettings.groupSettings.forEach(function(e){o=r.fieldKeys[t]===e.name&&"number"===e.type.toLocaleLowerCase()?"string":"number"}):o="number"),u.fieldList[t]={id:t,pid:e&&"groupName"in e&&e.groupName?e.groupName:u.groupingFieldsInfo[t]||void 0,caption:e&&"caption"in e&&e.caption?e.caption:t,type:-1!==t.indexOf("_custom_group")||-1!==t.indexOf("_date_group")?"string":o,filterType:"",index:h,filter:[],sort:n?"Ascending":"None",isSelected:!1,isCustomField:-1!==t.indexOf("_custom_group")||-1!==t.indexOf("_date_group"),showFilterIcon:!(e&&"showFilterIcon"in e)||e.showFilterIcon,showRemoveIcon:!(e&&"showRemoveIcon"in e)||e.showRemoveIcon,showSortIcon:!(e&&"showSortIcon"in e)||e.showSortIcon,showEditIcon:!(e&&"showEditIcon"in e)||e.showEditIcon,showValueTypeIcon:!(e&&"showValueTypeIcon"in e)||e.showValueTypeIcon,allowDragAndDrop:!(e&&"allowDragAndDrop"in e)||e.allowDragAndDrop,showSubTotals:!(e&&"showSubTotals"in e)||e.showSubTotals,showNoDataItems:!!(e&&"showNoDataItems"in e)&&e.showNoDataItems,isCalculatedField:!!(e&&"isCalculatedField"in e)&&e.isCalculatedField,expandAll:!!(e&&"expandAll"in e)&&e.expandAll,aggregateType:e&&"type"in e?e.type:"number"===(-1!==t.indexOf("_custom_group")||-1!==t.indexOf("_date_group")?"string":void 0===o||"undefined"===o?"number":o)?"Sum":"Count",baseField:e&&"baseField"in e?e.baseField:void 0,baseItem:e&&"baseItem"in e?e.baseItem:void 0},u.updateMembersOrder(t)}()}this.groupedDataType={},this.updateTreeViewData(l)},Qdt.prototype.updateMembersOrder=function(e){for(var t=0,i=this.dataSourceSettings.sortSettings;t<i.length;t++){var n=i[t];if(e===n.name&&n.membersOrder){this.fieldList[e].membersOrder=n.membersOrder;break}}},Qdt.prototype.getMappingField=function(e,t){var i={};if(t&&0<t.length)for(var n=0,o=t.length;n<o;n++)if(t[n].name===e){i=t[n];break}return i},Qdt.prototype.updateFieldList=function(e){for(var t=this.fields,i=t.length;i--;)this.fieldList[t[i]].isExcelFilter=e[t[i]].isExcelFilter},Qdt.prototype.updateTreeViewData=function(e){for(var t,o=this,i=e.length,n=this.dataSourceSettings.calculatedFieldSettings.length;i--;)this.fieldList[e[i].name]&&((t=this.fieldList[e[i].name]).type=e[i].dataType?e[i].dataType.toLowerCase():t.type,t.caption=e[i].caption||e[i].name,t.isSelected=!0,t.showNoDataItems=e[i].showNoDataItems,t.aggregateType=e[i].type,t.baseField=e[i].baseField,t.baseItem=e[i].baseItem,t.allowDragAndDrop=e[i].allowDragAndDrop,t.showFilterIcon=e[i].showFilterIcon,t.showSortIcon=e[i].showSortIcon,t.showRemoveIcon=e[i].showRemoveIcon,t.showValueTypeIcon=e[i].showValueTypeIcon,t.showEditIcon=e[i].showEditIcon,t.showSubTotals=e[i].showSubTotals,t.expandAll=e[i].expandAll);for(;n--;)this.fieldList[this.dataSourceSettings.calculatedFieldSettings[n].name]&&(this.fieldList[this.dataSourceSettings.calculatedFieldSettings[n].name].aggregateType="CalculatedField",this.fieldList[this.dataSourceSettings.calculatedFieldSettings[n].name].isCalculatedField=!0,this.fieldList[this.dataSourceSettings.calculatedFieldSettings[n].name].formula=this.dataSourceSettings.calculatedFieldSettings[n].formula);var r=this.dataSourceSettings.groupSettings.filter(function(t){return!e.some(function(e){return t.name===e.name})}),s=["_date_group_years","_date_group_quarters","_date_group_quarterYear","_date_group_months","_date_group_days","_date_group_hours","_date_group_minutes","_date_group_seconds"];r.forEach(function(e){var i=e.name,n=e.type.toLowerCase();Object.keys(o.fieldList).forEach(function(t){"date"!==n||je(e.caption)||!s.some(function(e){return t===""+i+e})&&t!==i?("custom"===n&&!je(e.caption)&&t===i+"_custom_group"||"number"===n&&!je(e.caption)&&t===i)&&(o.fieldList[t].caption=e.caption):o.fieldList[t].caption=o.fieldList[t].caption.replace(e.name,e.caption)})})},Qdt.prototype.getCalculatedField=function(p){for(var e=0,t=this.dataSourceSettings.calculatedFieldSettings;e<t.length;e++){var i=t[e];this.calculatedFields[i.name]=Pe({},i,null,!0),this.calculatedFields[i.name].actualFormula=i.formula}for(var c=Object.keys(this.calculatedFields),u=this,n=0,o=c.length;n<o;n++)!function(e){for(var t=u.calculatedFields[c[e]],e=t.properties,i=(e||t).formula.trim(),n=i.replace(/"/g,""),o=(t.formula=-1<n.indexOf("^")?u.powerFunction(n):n,-1===t.formula.indexOf("Math.min(")&&-1<t.formula.indexOf("min(")&&(t.formula=t.formula.replace(/min\(/g,"Math.min(")),-1===t.formula.indexOf("Math.max(")&&-1<t.formula.indexOf("max(")&&(t.formula=t.formula.replace(/max\(/g,"Math.max(")),-1===t.formula.indexOf("Math.abs(")&&-1<t.formula.indexOf("abs(")&&(t.formula=t.formula.replace(/abs\(/g,"Math.abs(")),t.name=(e||t).name,"CSV"===u.dataSourceSettings.type?-1===p.indexOf(t.name)&&p.push(t.name):(p=p.filter(function(e){return e!==t.name})).push(t.name),i.split('"')),r=0,s=o.length;r<s;r++){var a=o[r].trim(),l=a.split(/[ .:;?!~,`"&|()<>{}[\]\r\n/\\]+/),h=a.match(/^([^()]+)\((.*)\)$/),d="DistinctCount"===l[0]?"DistinctCount":"PopulationStDev"===l[0]?"PopulationStDev":"SampleStDev"===l[0]?"SampleStDev":"PopulationVar"===l[0]?"PopulationVar":"SampleVar"===l[0]?"SampleVar":l[0];-1!==["Sum","Count","Min","Max","Avg","Product","DistinctCount","PopulationStDev","SampleStDev","PopulationVar","SampleVar","Median"].indexOf(d)&&(h=-1===p.indexOf(l[1])&&h[2]?p.indexOf(h[2]):p.indexOf(l[1]),u.calculatedFormulas[t.name]?u.calculatedFormulas[t.name].push({index:h,type:d,formula:a}):u.calculatedFormulas[t.name]=[{index:h,type:d,formula:a}])}}(n);this.fields=p},Qdt.prototype.validateFilters=function(e){this.isValueFiltersAvail=!1;for(var e=e.filterSettings||[],t=(t=Pe([],this.dataSourceSettings.rows,null,!0)).concat(this.dataSourceSettings.columns),i=0,n=e;i<n.length;i++){for(var o=n[i],r=0,s=t;r<s.length;r++){var a=s[r];if(o.name===a.name&&"Value"===o.type){this.isValueFiltersAvail=!0;break}}if(this.isValueFiltersAvail)break}},Qdt.prototype.validateValueFields=function(){this.isValueHasAdvancedAggregate=!1;for(var e=0,t=this.dataSourceSettings.values;e<t.length;e++){var i=t[e];if(-1!==["DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal","RunningTotals"].indexOf(i.type)){this.isValueHasAdvancedAggregate=!0;break}}},Qdt.prototype.fetchFieldMembers=function(e){e=this.fieldList[e].index;this.generateMembers(e,new Set)},Qdt.prototype.generateMembers=function(e,t){var i=this.data.length,n=this.fields,o=this.fieldList,r=n[e],s=(o[r].members&&!this.allowDataCompression||(o[r].members={},this.allowDataCompression&&(o[r].isMembersFilled=!1)),o[r].dateMember&&!this.allowDataCompression||(o[r].dateMember=[]),o[r].members),a=o[r].dateMember;if((o[r].isSelected||t.has(e))&&!o[r].isMembersFilled){for(var l=0<Object.keys(s).length,h=0,d=o[r].expandAll,p=Hdt.isDateField(r,this),c=0;c<i;c++){var u=this.data[c][this.fieldKeys[r]],g=u,g=this.enableHtmlSanitizer?go.sanitize(g):g,m=(l||(m=p?this.getFormattedValue(g,r):{formattedText:null===g?this.localeObj?this.localeObj.getConstant("null"):String(g):void 0===g?this.localeObj?r in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(g):g.toString(),actualText:null===g?this.localeObj?this.localeObj.getConstant("null"):String(g):void 0===g?this.localeObj?r in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(g):g},Object.prototype.hasOwnProperty.call(s,g)?s[g].index.push(c):(h++,s[g]={index:[c],ordinal:h,isDrilled:this.isExpandAll||d,caption:m.formattedText},a.push({formattedText:m.formattedText,actualText:p?m.dateText:m.actualText}))),je(u)?u:"number"===o[r].type?isNaN(Number(u))?void 0:Number(u):1),u={ordinal:s[g].ordinal,member:m};this.valueMatrix[c]||(this.valueMatrix[c]=[]),this.valueMatrix[c][e]=u}o[r].isMembersFilled=!0}},Qdt.prototype.fillFieldMembers=function(){var e=this.fields,t=this.fieldList,i=e.length,n=(this.data.length-this.valueMatrix.length<0&&(this.valueMatrix=this.valueMatrix.slice(0,this.data.length)),new Set);if(this.calculatedFormulas&&0<Object.keys(this.calculatedFormulas).length)for(var o in this.calculatedFormulas)if(t[o]&&t[o].isSelected)for(var r=this.calculatedFormulas[o],s=0;s<r.length;s++){var a=r[s];n.add(a.index)}for(var l=0;l<i;l++)this.generateMembers(l,n)},Qdt.prototype.generateValueMatrix=function(){for(var e=this.fields,t=this.data.length,i=e.length,n=this.fieldList;t--;)for(var o=i;o--;){var r=e[o],s=n[r];s.isMembersFilled&&(r=this.data[t][this.fieldKeys[r]],this.valueMatrix[t][o].member=je(r)?r:"number"===s.type?isNaN(Number(r))?void 0:Number(r):1)}},Qdt.prototype.updateSortSettings=function(e,t){for(var i=0,n=e?e.length:0;i<n&&t;i++)this.fieldList[e[i].name]&&(this.fieldList[e[i].name].sort=e[i].order)},Qdt.prototype.updateFilterMembers=function(e){var t=this.filterMembers,i={},e=this.getFilters(e,i),n=this.valueMatrix.length;if(e)for(var o=i.include.index,r=0;r<o.length;r++)void 0!==i.exclude&&void 0!==i.exclude.indexObject[o[r]]||t.push(o[r]);else for(r=0;r<n;r++)void 0!==i.exclude&&void 0!==i.exclude.indexObject[r]||t.push(r)},Qdt.prototype.getFilters=function(e,t){for(var i=e.filterSettings||[],n=!1,o=[],r=0,s=i.length;r<s;r++){var a=i[r].properties||i[r];this.fieldList[a.name]&&this.fieldList[a.name].isSelected&&this.isValidFilterField(a,e.allowMemberFilter,e.allowLabelFilter)&&(this.applyLabelFilter(a),a&&(o=a.items),a.type&&"Include"===a.type?(this.frameFilterList(o,a.name,t,"include",a.showLabelFilter,n),n=!0):this.frameFilterList(o,a.name,t,"exclude",a.showLabelFilter),a.showLabelFilter)&&(a.items=[],a.type=a.showDateFilter?"Date":a.showNumberFilter?"Number":"Label")}return n},Qdt.prototype.isValidFilterField=function(e,t,i){var n=e.name,o=!1,r=(r=Pe([],this.dataSourceSettings.rows,null,!0)).concat(this.dataSourceSettings.columns);if(this.fieldList[n].isSelected&&t&&0<=["Include","Exclude"].indexOf(e.type)){for(var o=!0,s=0,a=this.dataSourceSettings.values;s<a.length;s++)if(n===a[s].name){o=!1;break}}else if(i)for(var l=0,h=r;l<h.length;l++)if(n===h[l].name&&0<=["Label","Date","Number"].indexOf(e.type)){o=!0;break}return o},Qdt.prototype.applyLabelFilter=function(e){if(0<=["Label","Date","Number"].indexOf(e.type)){var t=Object.keys(this.fieldList[e.name].members);if(e.showLabelFilter=!0,"Label"===e.type)e.items=this.getLabelFilterMembers(t,e.condition,e.value1,e.value2);else if("Date"===e.type){e.showDateFilter=!0;var i="string"==typeof e.value1?new Date(e.value1):e.value1,n="string"==typeof e.value2?new Date(e.value2):e.value2;e.items=this.getDateFilterMembers(t,e.name,e.condition,i,n)}else{e.showNumberFilter=!0,e.items=[];for(var o=0,r=t;o<r.length;o++){var s=r[o],a=this.getParsedValue(e.name,e.value1),l=this.getParsedValue(e.name,e.value2),h=this.getParsedValue(e.name,s);this.validateFilterValue(h,e.condition,a,l)&&e.items.push(s)}}e.type=!e.condition||-1<["DoesNotBeginWith","DoesNotContains","DoesNotEndsWith","DoesNotEquals","NotBetween"].indexOf(e.condition)&&!e.showNumberFilter?"Exclude":"Include"}else e.showLabelFilter=!1},Qdt.prototype.getLabelFilterMembers=function(e,t,i,n){for(var o=[],r=0,s=e;r<s.length;r++){var a=s[r],l=a.toLowerCase();if(i.toString())switch(t){case"Equals":case"DoesNotEquals":l===i.toLowerCase()&&o.push(a);break;case"BeginWith":case"DoesNotBeginWith":0===l.indexOf(i.toLowerCase())&&o.push(a);break;case"EndsWith":case"DoesNotEndsWith":null!==l.match(i.toLowerCase()+"$")&&o.push(a);break;case"Contains":case"DoesNotContains":-1<l.indexOf(i.toLowerCase())&&o.push(a);break;case"GreaterThan":l>i.toLowerCase()&&o.push(a);break;case"GreaterThanOrEqualTo":l>=i.toLowerCase()&&o.push(a);break;case"LessThan":l<i.toLowerCase()&&o.push(a);break;case"LessThanOrEqualTo":l<=i.toLowerCase()&&o.push(a);break;case"Between":case"NotBetween":l>=i.toLowerCase()&&l<=n.toLowerCase()&&o.push(a);break;default:l===i.toLowerCase()&&o.push(a)}}return o},Qdt.prototype.getDateFilterMembers=function(e,t,i,n,o){for(var r=[],s=0,a=e;s<a.length;s++){var l=a[s],h=new Date(l);if(n)switch(i){case"Equals":case"DoesNotEquals":this.getFormattedValue(h.toString(),t).formattedText===this.getFormattedValue(n.toString(),t).formattedText&&r.push(this.getFormattedValue(l,t).formattedText);break;case"After":h.getTime()>n.getTime()&&r.push(this.getFormattedValue(l,t).formattedText);break;case"AfterOrEqualTo":h.getTime()>=n.getTime()&&r.push(this.getFormattedValue(l,t).formattedText);break;case"Before":h.getTime()<n.getTime()&&r.push(this.getFormattedValue(l,t).formattedText);break;case"BeforeOrEqualTo":h.getTime()<=n.getTime()&&r.push(this.getFormattedValue(l,t).formattedText);break;case"Between":case"NotBetween":h.getTime()>=n.getTime()&&h.getTime()<=o.getTime()&&r.push(this.getFormattedValue(l,t).formattedText);break;default:this.getFormattedValue(h.toString(),t).formattedText===this.getFormattedValue(n.toString(),t).formattedText&&r.push(this.getFormattedValue(l,t).formattedText)}}return r},Qdt.prototype.validateFilterValue=function(e,t,i,n){var o=!1;if("number"==typeof i)switch(t){case"Equals":e===i&&(o=!0);break;case"DoesNotEquals":e!==i&&(o=!0);break;case"GreaterThan":i<e&&(o=!0);break;case"GreaterThanOrEqualTo":i<=e&&(o=!0);break;case"LessThan":e<i&&(o=!0);break;case"LessThanOrEqualTo":e<=i&&(o=!0);break;case"Between":i<=e&&e<=n&&(o=!0);break;case"NotBetween":i<=e&&e<=n||(o=!0);break;default:e!==i&&(o=!0)}return o},Qdt.prototype.frameFilterList=function(e,t,i,n,o,r){i[n]||(i[n]={indexObject:{},index:[]}),this.updateFilter(e,t,i,n,o,r)},Qdt.prototype.updateFilter=function(e,t,i,n,o,r){var s=0,a=this.fieldList[t],l=(a.filter=e,a.filterType=n,a.isExcelFilter=o,Hdt.getFormattedMembers(a.members,t,this)),h=r,d={},p={};for(d[n]={indexObject:{},index:[]},this.fieldFilterMem[t]={memberObj:{}};!je(e[s]);){if(l[e[s]]){var c=l[e[s]].index;if("include"===n)for(var u=0,g=c.length;u<g;u++)h&&void 0===i[n].indexObject[c[u]]||(d[n].indexObject[c[u]]=c[u],d[n].index.push(c[u]));else{for(u=0,g=c.length;u<g;u++)void 0===i[n].indexObject[c[u]]&&(i[n].indexObject[c[u]]=c[u],i[n].index.push(c[u]));this.fieldFilterMem[t].memberObj[e[s]]=e[s]}}s++}if("include"===n){i[n]=d[n];for(u=0;u<e.length;u++)l[e[u]]&&(p[e[u]]=e[u]);for(var m=Object.keys(l),u=0,g=m.length;u<g;u++)void 0===p[m[u]]&&(this.fieldFilterMem[t].memberObj[m[u]]=m[u])}},Qdt.prototype.applyValueFiltering=function(e,t,i,n,o,r,s){this.isValueFiltered=!1;var a=Pe({},"row"===s&&this.rowGrandTotal?this.rowGrandTotal:"column"===s&&this.columnGrandTotal?this.columnGrandTotal:"Top"!==this.dataSourceSettings.grandTotalsPosition?i[i.length-1]:i[0],null,!0);return this.getFilteredData(i,n,o,r,t,e.name,a,s),this.isValueFiltered&&(("row"===s&&null===this.rowGrandTotal||"column"===s&&null===this.columnGrandTotal)&&r.push(a),i=r),i},Qdt.prototype.getFilteredData=function(e,t,i,n,o,r,s,a){for(var l,h,d,p,c=e.length,u=0;u<c;u++)i[r]&&(e[u].level===o?(this.isValueFiltered=!0,this.fieldList[r].isExcelFilter=!0,l=0,p=i[r].measure,d=this.fieldList[p].index,h=this.fieldList[p].aggregateType,this.rawIndexObject={},l="row"===a?this.getAggregateValue(e[u].index,t.indexObject,d,h,!1):this.getAggregateValue(t.index,e[u].indexObject,d,h,!1),d={fieldName:p,row:e[u],column:t,value:l,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:e[u].hasChild&&e[u].isDrilled?"subTotal":"grand sum"===e[u].type?"grandTotal":"value",columnCellType:t.hasChild&&t.isDrilled?"subTotal":"grand sum"===t.type?"grandTotal":"value",aggregateType:h,skipFormatting:!1},this.getValueCellInfo&&this.getValueCellInfo(d),l=d.value,this.rawIndexObject={},h=this.getParsedValue(p,i[r].value1),d=this.getParsedValue(p,i[r].value2),this.validateFilterValue(l,i[r].condition,h,d)||"grand sum"===e[u].type?"grand sum"!==e[u].type&&(n.push(Pe({},e[u],null,!0)),n[n.length-1].isLevelFiltered=!0):(p=this.removefilteredData(e[u],this.valueFilteredData)||e[u],this.validateFilteredParentData(p,this.valueFilteredData,s,0,o,a))):e[u].hasChild&&0<e[u].members.length&&"grand sum"!==e[u].type&&(n.push(Pe({},e[u],null,!0)),n[n.length-1].members=[],n[n.length-1].isLevelFiltered=!0,this.getFilteredData(e[u].members,t,i,n[n.length-1].members,o,r,s,a)))},Qdt.prototype.getParsedValue=function(e,t){var i=t?t.toString():"";return this.formatFields[e]&&t?(delete(t=Pe({},this.formatFields[e],null,!0)).name,this.globalize.parseNumber(i,t)):this.globalize.parseNumber(i,{format:"N"})},Qdt.prototype.removefilteredData=function(e,t){for(var i,n=Pe([],t,null,!0),o=0;o<n.length;o++){if(e.isLevelFiltered&&e.axis===n[o].axis&&e.valueSort.levelName===n[o].valueSort.levelName&&e.actualText===n[o].actualText&&e.axis===n[o].axis&&e.level===n[o].level&&e.ordinal===n[o].ordinal){i=n[o],t.splice(o,1);break}t[o].hasChild&&0<t[o].members.length&&this.removefilteredData(e,t[o].members)}return i},Qdt.prototype.validateFilteredParentData=function(e,t,i,n,o,r){if(0<t.length)for(var s=0,a=t;s<a.length;s++){var l=a[s];if(l.level===n){if("row"===r)for(var h=0,d=c=e.index;h<d.length;h++){var p=d[h];0<=i.index.indexOf(p)&&i.index.splice(i.index.indexOf(p),1),0<=e.valueSort.levelName.toString().indexOf(l.valueSort.levelName.toString())&&l.level!==o&&0<=l.index.indexOf(p)&&l.index.splice(l.index.indexOf(p),1)}else for(var c=e.indexObject,u=0,g=Object.keys(c);u<g.length;u++){p=g[u];Object.prototype.hasOwnProperty.call(c,p)&&(delete i.indexObject[p],0<=e.valueSort.levelName.toString().indexOf(l.valueSort.levelName.toString()))&&l.level!==o&&delete l.indexObject[p]}l&&0<l.members.length&&l.members[0].level===n+1&&l.members[0].level!==o&&this.validateFilteredParentData(e,l.members,i,n+1,o,r)}}else if("row"===r)for(var m=0,f=c=e.index;m<f.length;m++){p=f[m];0<=i.index.indexOf(p)&&i.index.splice(i.index.indexOf(p),1)}else for(var c=e.indexObject,y=0,v=Object.keys(c);y<v.length;y++){p=v[y];Object.prototype.hasOwnProperty.call(c,p)&&delete i.indexObject[p]}},Qdt.prototype.updateFramedHeaders=function(e,t,i,n,o){for(var r=0,s=e;r<s.length;r++){var a=s[r];this.isHeaderAvail=!1,(this.validateFilteredHeaders(a,i,o)||"grand sum"===a.type)&&("row"===o?this.rowCount+=this.rowValuesLength:this.columnCount+=this.customProperties.isTabularLayout?this.rowMaxLevel+this.colValuesLength:this.colValuesLength,n.push(Pe({},a,null,!0)),n[n.length-1].members=[],a.hasChild)&&a.isDrilled&&0<a.members.length&&this.updateFramedHeaders(a.members,t,i,n[n.length-1].members,o)}return this.filterFramedHeaders},Qdt.prototype.validateFilteredHeaders=function(e,t,i){for(var n=0,o=t;n<o.length;n++){var r=o[n];if(!this.isHeaderAvail){if(e.actualText===r.actualText&&e.level===r.level&&e.valueSort.levelName===r.valueSort.levelName)return"row"===i?0<r.index.length?(this.isHeaderAvail=!0,e.index=r.index,!0):(this.isHeaderAvail=!1,e.index=r.index,!1):0<Object.keys(r.indexObject).length?(this.isHeaderAvail=!0,e.indexObject=r.indexObject,!0):(this.isHeaderAvail=!1,e.indexObject=r.indexObject,!1);r.hasChild&&0<r.members.length&&"grand sum"!==r.type&&this.validateFilteredHeaders(e,r.members,i)}}return this.isHeaderAvail},Qdt.prototype.isEmptyDataAvail=function(e,t){this.isEmptyData=!1,0<e.length&&"grand sum"===e[e.length-1].type&&0===e[e.length-1].index.length&&(this.isEmptyData=!0),0<t.length&&"grand sum"===t[t.length-1].type&&0===Object.keys(t[t.length-1].indexObject).length&&(this.isEmptyData=!0),0!==e.length&&0!==t.length||(this.isEmptyData=!0)},Qdt.prototype.updateGridData=function(e){this.updateDataSourceSettings(e,!0),this.data=e.dataSource,this.allowDataCompression&&(this.actualData=this.data,this.data=this.getGroupedRawData(e));for(var t=0,i=this.fields;t<i.length;t++){var n=i[t];this.fieldList[n].members={},this.fieldList[n].dateMember=[],this.fieldList[n].isMembersFilled=!1}this.fillFieldMembers(),this.filterMembers=[],this.cMembers=[],this.rMembers=[],this.updateFilterMembers(e),this.isEditing=!0,this.isDrillThrough=!0,this.generateGridData(e),this.isEditing=!1},Qdt.prototype.generateGridData=function(e,t,i,n){void 0===t&&(t=!1),je(n)&&this.customProperties.isTabularLayout&&(this.rowMaxLevel=0),this.updateDataSourceSettings(e,t);var o=e.columns||[],r=this.data,s=e.rows||[],a=e.filterSettings,l=e.values||[],h=(this.removeCount=0,this.isExpandAll=e.expandAll,this.drilledMembers=e.drilledMembers||[],this.isEmptyData=!1,[]);if(s[0]&&s[0].showNoDataItems||o[0]&&o[0].showNoDataItems)for(var d=0;d<this.valueMatrix.length;d++)h.push(d);for(d=0;d<this.filterMembers.length;d++)this.filterPosObj[this.filterMembers[d]]=this.filterMembers[d];this.valueSortSettings.columnIndex=void 0,this.validateValueFields(),this.frameDrillObject(),this.isValueFilterEnabled&&!this.isEditing||n||(this.isLastHeaderHasMeasures=!0,this.columnCount=0,this.rowCount=0,this.cMembers=[],this.rMembers=[],0!==s.length&&0!==l.length&&(this.rMembers=this.getIndexedHeaders(s,r,this.customProperties.isTabularLayout?this.rowMaxLevel:0,s[0].showNoDataItems?h:this.filterMembers,"row","",this.allowValueFilter)),0!==o.length&&0!==l.length&&(this.cMembers=this.getIndexedHeaders(o,r,0,o[0].showNoDataItems?h:this.filterMembers,"column","",this.allowValueFilter)),this.insertAllMembersCommon(),this.saveDataHeaders=this.isValueFiltersAvail&&e.allowValueFilter?{rowHeaders:Pe([],this.rMembers,null,!0),columnHeaders:Pe([],this.cMembers,null,!0)}:{}),this.customProperties.isTabularLayout&&(this.showSubTotalsAtBottom=!0),this.pivotValues=[],this.headerContent=[],this.valueContent=[],this.valueFilteredData=[],this.filterFramedHeaders=[];var p=[],c=[],u=[],g=[],m=[],f=this.dataSourceSettings.values.length;if(this.isValueFiltersAvail&&e.allowValueFilter&&!n){this.valueFilteredData=[];var y=this.saveDataHeaders.rowHeaders||[],v=this.saveDataHeaders.columnHeaders||[];if(0<a.length){for(var b={},w={},C=0,S=l;C<S.length;C++){var A=S[C];w[A.name]=A}for(var x=0,I=a;x<I.length;x++){var T=I[x],y=0<u.length?u:y,v=0<g.length?g:v,E=(this.valueFilteredData=[],T.properties||T);if("Value"===E.type&&this.fieldList[T.name]&&this.fieldList[T.name].isSelected){b[T.name]=T;for(var D=!(E.items=[]),M=s.length,k=o.length,P=0;P<M;P++)if(E.name===s[P].name&&w[E.measure]&&!D){D=!0,u=this.applyValueFiltering(s[P],P,y,this.columnGrandTotal||("Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals?v[0]:v[v.length-1]),b,this.valueFilteredData,"row");break}for(var B=0;B<k;B++)if(E.name===o[B].name&&w[E.measure]&&!D){D=!0,g=this.applyValueFiltering(o[B],B,v,this.rowGrandTotal||("Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals?y[0]:y[y.length-1]),b,this.valueFilteredData,"column");break}}}}u=0<u.length?u:y,g=0<g.length?g:v,this.isEmptyDataAvail(u,g);var a=Hdt.getClonedFieldList(this.fieldList),F=this.data[0];this.getFieldList(F,this.enableSort,e.allowValueFilter),this.fillFieldMembers(),this.updateSortSettings(e.sortSettings,this.enableSort),this.filterMembers=[],this.updateFilterMembers(e),this.isLastHeaderHasMeasures=!0,this.rMembers=0!==s.length?this.getIndexedHeaders(s,r,0,s[0].showNoDataItems?h:this.filterMembers,"row",""):[],this.cMembers=0!==o.length?this.getIndexedHeaders(o,r,0,o[0].showNoDataItems?h:this.filterMembers,"column",""):[],this.insertAllMembersCommon(),this.updateFieldList(a),this.rowCount=0,this.columnCount=0,this.rMembers=this.updateFramedHeaders(this.rMembers,this.rMembers,u,this.filterFramedHeaders,"row"),this.filterFramedHeaders=[],this.cMembers=this.updateFramedHeaders(this.cMembers,this.cMembers,g,this.filterFramedHeaders,"column"),this.isValueFilterEnabled=!0}n||this.applyValueSorting(),this.isPagingOrVirtualizationEnabled&&(n?(this.rMembers=n.rowHeaders,this.cMembers=n.columnHeaders,this.rowCount=this.customProperties.isTabularLayout?this.rowCount+this.emptyRowsLength:n.rowHeadersCount,this.columnCount=n.columnHeadersCount):(this.headerCollection.rowHeaders=this.rMembers,this.headerCollection.columnHeaders=this.cMembers,this.headerCollection.rowHeadersCount=this.rowCount,this.headerCollection.columnHeadersCount=this.columnCount),this.calculatePagingValues()),!this.valueAxis&&this.isLastHeaderHasMeasures&&this.getAggregatedHeaders(s,o,this.rMembers,this.cMembers,l),this.getHeaderData(s,o,l,m,this.cMembers,c,this.pivotValues,0,this.valueAxis?1:f),this.insertSubTotals(),this.getTableData(0<m.length?m:this.rMembers,p,c,0,this.pivotValues,f,0,this.rowGrandTotal||this.rMembers[this.rMembers.length-1],this.columnGrandTotal||this.cMembers[this.cMembers.length-1]),this.applyAdvancedAggregate(p,c,this.pivotValues),this.customProperties.isTabularLayout&&(this.pivotValues=this.getTabularPivotValues(t,e),this.setRowSpan(),this.rowCount=this.rowCount-this.emptyRowsLength),this.isEngineUpdated=!0,this.isEmptyDataAvail(this.rMembers,this.cMembers),this.clearProperties(i)},Qdt.prototype.updateHeaders=function(e,t){e=je(e)?!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)&&0<this.dataSourceSettings.rows.length):e,(this.pageSettings&&this.removeRowGrandTotal||!e&&!this.rowGrandTotal)&&"grand sum"===this.rMembers[this.rMembers.length-1].type&&(this.rMembers=this.rMembers.slice(0,this.rMembers.length-1)),t=je(t)?!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)&&0<this.dataSourceSettings.columns.length):t,(this.pageSettings&&this.removeColumnGrandTotal||!t&&!this.columnGrandTotal)&&"grand sum"===this.cMembers[this.cMembers.length-1].type&&(this.cMembers=this.cMembers.slice(0,this.cMembers.length-1))},Qdt.prototype.updatePivotValues=function(e){var t=!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)&&0<this.dataSourceSettings.rows.length),i=!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)&&0<this.dataSourceSettings.columns.length);if(e&&this.updateHeaders(t,i),(this.pageSettings&&this.removeRowGrandTotal||!t&&!this.rowGrandTotal)&&0<this.valueContent.length&&(n=1,this.valueAxis&&0<this.dataSourceSettings.values.length&&(n=1+this.dataSourceSettings.values.length),this.pivotValues[this.pivotValues.length-n])&&"grand sum"===this.pivotValues[this.pivotValues.length-n][0].type&&(this.pivotValues=this.pivotValues.slice(0,this.pivotValues.length-n),this.valueContent=this.valueContent.slice(0,this.valueContent.length-n)),(this.pageSettings&&this.removeColumnGrandTotal||!i&&!this.columnGrandTotal)&&0<this.headerContent.length){var n=this.dataSourceSettings.values.length;if(this.valueAxis&&0<this.dataSourceSettings.values.length&&(n=1),this.pivotValues[0][this.pivotValues[0].length-n]&&"grand sum"===this.pivotValues[0][this.pivotValues[0].length-n].type)for(var o=0;o<this.pivotValues.length;o++)if(this.pivotValues[o]&&(this.pivotValues[o]=this.pivotValues[o].slice(0,this.pivotValues[o].length-n)),this.headerContent[o])for(var r=this.pivotValues[o].length;r<this.pivotValues[o].length+n;r++)delete this.headerContent[o][r]}this.removeRowGrandTotal=this.removeColumnGrandTotal=!1},Qdt.prototype.onDrill=function(e){this.enableVirtualization||this.enablePaging||!this.customProperties.isTabularLayout||(this.rowMaxLevel=0),this.frameDrillObject(e);var t=this.getHeadersInfo(e.fieldName,e.axis);this.performDrillOperation(t.headers,e,t.fields,t.position,0),this.headerCollection.rowHeadersCount=this.rowCount,this.headerCollection.columnHeadersCount=this.columnCount,"row"===t.axis?this.headerCollection.rowHeaders=t.headers:this.headerCollection.columnHeaders=t.headers,this.updateEngine()},Qdt.prototype.onSort=function(e,t){t&&this.updateDataSourceSettings(t,!0);t=this.getHeadersInfo(e.name,"");this.fieldList[e.name].sort=e.order,this.performSortOperation(t.headers,e,t,0),this.updateEngine()},Qdt.prototype.onFilter=function(e,t){this.updateDataSourceSettings(t,!0);for(var i=this.getHeadersInfo(e.name,""),n=(this.isLastHeaderHasMeasures=!!(this.valueAxis&&"row"===i.axis||!this.valueAxis&&"column"===i.axis)||this.isLastHeaderHasMeasures,"Include"===e.type&&e.items.length===this.fieldList[e.name].dateMember.length?(this.fieldList[e.name].filter=[],this.fieldList[e.name].filterType=""):(this.fieldList[e.name].filter=e.items,this.fieldList[e.name].filterType=e.type),{}),o=0,r=this.filterMembers;o<r.length;o++){var s=r[o];n[s]=s}this.filterMembers=[],this.fieldFilterMem={},this.updateFilterMembers(t);for(var a=this.filterMembers.filter(function(e){return void 0===n[e]}),l=0,h=e.items;l<h.length;l++)h[l];t=this.dataSourceSettings.rows[0]&&this.dataSourceSettings.rows[0].showNoDataItems||this.dataSourceSettings.columns[0]&&this.dataSourceSettings.columns[0].showNoDataItems;if(t&&this.columnKeys[e.name]?t=!(!this.dataSourceSettings.columns[0]||!this.dataSourceSettings.columns[0].showNoDataItems):t&&"row"===i.axis&&(t=!(!this.dataSourceSettings.rows[0]||!this.dataSourceSettings.rows[0].showNoDataItems)),t){var d=[];this.filterPosObj={};for(var p=0;p<a.length;p++)this.filterPosObj[a[p]]=a[p];for(p=0;p<this.valueMatrix.length;p++)d.push(p);a=d}this.performFilterCommonUpdate(e,i,a),i="column"===i.axis?this.getHeadersInfo("","row"):this.getHeadersInfo("","column"),this.performFilterCommonUpdate(e,i,a),this.frameHeaderObjectsCollection=!1,this.headerObjectsCollection={},this.customProperties.isTabularLayout&&(this.rowCount=this.rowCount-this.emptyRowsLength),this.updateEngine()},Qdt.prototype.onAggregation=function(e,t){t&&this.updateDataSourceSettings(t,!0),this.fieldList[e.name].aggregateType=e.type,this.rMembers=this.headerCollection.rowHeaders,this.cMembers=this.headerCollection.columnHeaders,this.allowDataCompression&&(this.data=this.getGroupedRawData(this.dataSourceSettings),this.generateValueMatrix()),this.updateEngine()},Qdt.prototype.onCalcOperation=function(e,t){this.dataSourceSettings.calculatedFieldSettings=t.calculatedFieldSettings||[],this.dataSourceSettings.values=t.values||[],this.rMembers=this.headerCollection.rowHeaders,this.cMembers=this.headerCollection.columnHeaders,this.getCalculatedField(this.fields),this.fieldList[e.name]?this.fieldList[e.name].formula=e.formula:(this.fieldList[e.name]={id:e.name,caption:e.name,type:"number",aggregateType:"CalculatedField",filterType:"",index:this.fields.length-1,filter:[],sort:this.enableSort?"Ascending":"None",isSelected:!0,isExcelFilter:!1,formula:e.formula},1===this.valueAxis?this.headerCollection.rowHeadersCount=this.rowCount=this.rowCount/(this.dataSourceSettings.values.length-1)*this.dataSourceSettings.values.length:this.headerCollection.columnHeadersCount=this.columnCount=this.columnCount/(this.dataSourceSettings.values.length-1)*this.dataSourceSettings.values.length),this.getFormattedFields(t),this.fillFieldMembers(),this.updateEngine()},Qdt.prototype.performDrillOperation=function(e,t,i,n,o){for(var r=0;r<e.length;){if(n===o){var s,a=e[r].valueSort.levelName.split(this.valueSortSettings.headerDelimiter);if(t.memberName===a.join(t.delimiter||"**")){"down"===t.action?(e[r].isDrilled=!0,e[r].members=this.getIndexedHeaders(i,this.data,n+1,e[r].index,t.axis,t.memberName.split(t.delimiter||"**").join(this.valueSortSettings.headerDelimiter)),a=void 0,"row"===t.axis?(a=this.applyValueSorting(e[r].members,this.cMembers),e[r].members=a.rMembers,this.rowCount+=this.showSubTotalsAtBottom?1:0):(s=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&i[n].showSubTotals,this.columnCount-=s?0:this.colValuesLength,a=this.applyValueSorting(this.rMembers,e[r].members),e[r].members=a.cMembers)):(e[r].isDrilled=!1,this.updateHeadersCount(e[r].members,t.axis,n,i,"minus",!0),e[r].members=[],"row"===t.axis&&(this.rowCount-=this.showSubTotalsAtBottom?1:0));break}}else 0<e[r].members.length&&(e[r].members=this.performDrillOperation(e[r].members,t,i,n,o+1));r++}return e},Qdt.prototype.performSortOperation=function(e,t,i,n){for(var o=0;o<e.length;){if(i.position===n){e=this.getSortedHeaders(e,t.order.toString());break}0<e[o].members.length&&(e[o].members=this.performSortOperation(e[o].members,t,i,n+1)),o++}return e},Qdt.prototype.performFilterDeletion=function(e,i,n,o,r){for(var s=0,a=!0,l=this;s<e.length&&a;)!function(){var t;n.position===r?(t=l,e=e.filter(function(e){return""!==t.fieldFilterMem[i.name].memberObj[e.formattedText]&&(!t.fieldFilterMem[i.name].memberObj[e.formattedText]||"grand sum"===e.type)}),a=!1):0<e[s].members.length&&(e[s].members=l.performFilterDeletion(e[s].members,i,n,o,r+1)),s++}();var t=this;return e.filter(function(e){return 0<e.members.length||"grand sum"===e.type||t.matchIndexes(e.indexObject,o)})},Qdt.prototype.matchIndexes=function(e,t){var i=Object.keys(e),n=i.length;if(0===n)return!0;for(;-1<n;){if(void 0!==t[e[i[n]]])return!0;n--}return!1},Qdt.prototype.performFilterAddition=function(s,a,l){for(var h=0,d=this;h<s.length;)!function(){var e=s[h].valueSort.levelName;if(d.headerObjectsCollection[e]){for(var t={},i=0,n=s[h].members;i<n.length;i++){var o=n[i];t[o.valueSort.levelName.toString()]=o.valueSort.levelName.toString()}var r=d.headerObjectsCollection[e].filter(function(e){return!t[e.valueSort.levelName.toString()]});s[h].members=s[h].members.concat(r),s[h].members=d.getSortedHeaders(s[h].members,d.fieldList[l.fields[s[h].members[0].level].name].sort),delete d.headerObjectsCollection[e]}0<s[h].members.length&&(s[h].members=d.performFilterAddition(s[h].members,a,l)),h++}();return s},Qdt.prototype.performFilterCommonUpdate=function(e,t,i){if("row"===t.axis||"column"===t.axis){for(var n="row"===t.axis?this.rMembers:this.cMembers,o={},r=0,s=this.filterMembers;r<s.length;r++){var a=s[r];o[a]=a}if(this.fieldFilterMem[e.name]&&(n=this.performFilterDeletion(t.headers,e,t,o,0)),0<i.length&&0<t.fields.length){if(this.frameHeaderObjectsCollection=!0,0<t.fields.filter(function(e){return e.showNoDataItems}).length)for(var l=0;l<this.data.length;l++)i.push(l);this.headerObjectsCollection.parent=this.getIndexedHeaders(t.fields,this.data,0,i,t.axis,"");for(var n=this.performFilterAddition(n,t.fields,t),h={},d=0,p=n;d<p.length;d++){var c=p[d];h[c.valueSort.levelName.toString()]=c.valueSort.levelName.toString()}var e=this.headerObjectsCollection.parent.filter(function(e){return!h[e.valueSort.levelName.toString()]}),u=n.filter(function(e){return"grand sum"===e.type});0<u.length&&n.pop(),n=this.getSortedHeaders(n.concat(e),this.fieldList[t.fields[0].name].sort).concat(u),"row"===t.axis?(this.cMembers=this.getIndexedHeaders(this.dataSourceSettings.columns,this.data,0,this.filterMembers,"column",""),this.insertAllMember(this.cMembers,this.filterMembers,"","column")):(this.rMembers=this.getIndexedHeaders(this.dataSourceSettings.rows,this.data,0,this.filterMembers,"row",""),this.insertAllMember(this.rMembers,this.filterMembers,"","row"))}"row"===t.axis?this.rowCount=0:this.columnCount=0,this.updateHeadersCount(n,t.axis,0,t.fields,"plus",!1),"row"===t.axis?(0<t.position&&this.insertPosition(this.dataSourceSettings.rows,this.data,0,this.filterMembers,"row","",n),this.insertTotalPosition(n),this.rMembers=this.headerCollection.rowHeaders=n,this.headerCollection.rowHeadersCount=this.rowCount):(0<t.position&&this.insertPosition(this.dataSourceSettings.columns,this.data,0,this.filterMembers,"column","",n),this.insertTotalPosition(n),this.cMembers=this.headerCollection.columnHeaders=n,this.headerCollection.columnHeadersCount=this.columnCount)}else{e=this.dataSourceSettings.rows[0]&&this.dataSourceSettings.rows[0].showNoDataItems||this.dataSourceSettings.columns[0]&&this.dataSourceSettings.columns[0].showNoDataItems;this.rMembers=this.getIndexedHeaders(this.dataSourceSettings.rows,this.data,0,e?i:this.filterMembers,"row",""),this.cMembers=this.getIndexedHeaders(this.dataSourceSettings.columns,this.data,0,e?i:this.filterMembers,"column",""),this.insertAllMembersCommon(),this.rowCount=0,this.columnCount=0,this.updateHeadersCount(this.cMembers,"column",0,this.dataSourceSettings.columns,"plus",!1),this.updateHeadersCount(this.rMembers,"row",0,this.dataSourceSettings.rows,"plus",!1),e&&(this.insertPosition(this.dataSourceSettings.rows,this.data,0,this.filterMembers,"row","",this.rMembers),this.insertPosition(this.dataSourceSettings.columns,this.data,0,this.filterMembers,"column","",this.cMembers)),this.headerCollection.rowHeaders=this.rMembers,this.headerCollection.rowHeadersCount=this.rowCount,this.headerCollection.columnHeaders=this.cMembers,this.headerCollection.columnHeadersCount=this.columnCount}this.applyValueSorting()},Qdt.prototype.getHeadersInfo=function(e,t){this.rMembers=this.headerCollection.rowHeaders,this.cMembers=this.headerCollection.columnHeaders;for(var i="row"===(t=""===t?this.getAxisByFieldName(e):t)?this.rMembers:this.cMembers,n="row"===t?this.dataSourceSettings.rows:this.dataSourceSettings.columns,o=0,r=0,s=n;r<s.length&&s[r].name!==e;r++)o++;return{axis:t,fields:n,headers:i,position:o}},Qdt.prototype.updateEngine=function(){this.customProperties.isTabularLayout&&(this.rowCount=this.rowCount+this.emptyRowsLength),this.removeCount=0,this.validateValueFields(),this.calculatePagingValues(),this.pivotValues=[],this.headerContent=[],this.valueContent=[];var e=[],t=[],i=[],n=this.dataSourceSettings.values.length;this.frameDrillObject(),this.getAggregatedHeaders(this.dataSourceSettings.rows,this.dataSourceSettings.columns,this.rMembers,this.cMembers,this.dataSourceSettings.values),this.getHeaderData(this.dataSourceSettings.rows,this.dataSourceSettings.columns,this.dataSourceSettings.values,i,this.cMembers,t,this.pivotValues,0,this.valueAxis?1:n),this.insertSubTotals(),this.getTableData(0<i.length?i:this.rMembers,e,t,0,this.pivotValues,n,0,this.rowGrandTotal||this.rMembers[this.rMembers.length-1],this.columnGrandTotal||this.cMembers[this.cMembers.length-1]),this.applyAdvancedAggregate(e,t,this.pivotValues),this.customProperties.isTabularLayout&&(this.pivotValues=this.getTabularPivotValues(),this.setRowSpan(),this.rowCount=this.rowCount-this.emptyRowsLength),this.isEngineUpdated=!0,this.isEmptyDataAvail(this.rMembers,this.cMembers)},Qdt.prototype.getAxisByFieldName=function(e){for(var t=0,i="";t<4&&""===i;){switch(t){case 0:i=this.getFieldByName(e,this.dataSourceSettings.rows)?"row":"";break;case 1:i=this.getFieldByName(e,this.dataSourceSettings.columns)?"column":""}t++}return i},Qdt.prototype.getFieldByName=function(e,t){return new me({json:t}).executeLocal((new ya).where("name","equal",e))[0]},Qdt.prototype.updateHeadersCount=function(e,t,i,n,o,r){for(var s=0,a=n[i],l=!0,l="column"===t?this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&(!a||a.showSubTotals):this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals&&(!a||a.showSubTotals);s<e.length;)"row"===t?this.rowCount=this.rowCount-("plus"===o?-(1===this.valueAxis?this.dataSourceSettings.values.length:1):1===this.valueAxis?this.dataSourceSettings.values.length:1):this.columnCount=this.columnCount-("plus"===o?-(1===this.valueAxis?1:this.dataSourceSettings.values.length):1===this.valueAxis?1:this.dataSourceSettings.values.length),0<e[s].members.length&&(this.updateHeadersCount(e[s].members,t,i+1,n,o,!0),"row"===t)&&(this.rowCount-=this.showSubTotalsAtBottom&&e[s].hasChild&&e[s].isDrilled?1:0),s++;"column"===t&&!l&&r&&(this.columnCount+="plus"===o?-this.colValuesLength:this.colValuesLength)},Qdt.prototype.getSortedHeaders=function(e,t){var i=("Grand Total"!==e[0].actualText?e[0]:e[1]).valueSort.axis,n=!(this.formatFields&&this.formatFields[i]&&this.formatFields[i].type),o=this.fieldList[i];if(n){if(o&&"number"===o.type&&0<e.length&&"string"==typeof e[0].actualText){for(var r=[],s=[],a=[],l=0;l<e.length;l++)if(isNaN(Number(e[l].actualText.toString().charAt(0))))r.push(e[l]);else{if(""!==e[l].actualText){s.push(e[l]);break}a.push(e[l])}return 0<s.length&&(s=this.sortHeaders(i,o,e,o.sort,o.isAlphanumeric)),e}return this.sortHeaders(i,o,e,t,o.type)}return this.sortHeaders(i,o,e,t,"date")},Qdt.prototype.sortHeaders=function(e,t,i,n,o){var r,s=!1,a=this.fieldList[e]&&this.fieldList[e].membersOrder?this.fieldList[e].membersOrder.slice():[],l={fieldName:e,sortOrder:n,members:a&&0<a.length?a:Object.keys(t.members),IsOrderChanged:!1},h="datetime"===(o="datetime"!==o&&"date"!==o&&"time"!==o||this.formatFields[e]&&-1<["date","dateTime","time"].indexOf(this.formatFields[e].type)?o:"string")||"date"===o||"time"===o,e=!1;if(0<this.dataSourceSettings.groupSettings.length&&!je(r=this.dataSourceSettings.groupSettings.filter(function(e){return e.name===t.id}))&&0<r.length&&(e="number"===r[0].type.toLocaleLowerCase()&&"string"===t.type.toLocaleLowerCase()),a&&0<a.length?Hdt.applyCustomSort(l,i,o):(Hdt.applyHeadersSort(i,n,o,e),s=!0),s&&this.getHeaderSortInfo){for(var d=[],p=0,c=0;p<i.length;p++){var u=i[p],g=h?u.dateText:u.actualText;"Grand Total"!==u.actualText&&(d[c++]=g)}l.members=d}return this.getHeaderSortInfo&&this.getHeaderSortInfo(l),l.IsOrderChanged&&Hdt.applyCustomSort(l,i,o,!0),i},Qdt.prototype.applyValueSorting=function(e,t){var i=!1;if(void 0===e||void 0===t){if(this.valueSortHeaderText=void 0,this.enableValueSorting&&this.valueSortSettings.headerText&&!this.valueSortHeaderText&&""!==this.valueSortSettings.headerText&&0<this.dataSourceSettings.values.length){this.valueSortHeaderText=this.valueSortSettings.headerText;for(var n=this.valueSortHeaderText.split(this.valueSortSettings.headerDelimiter),o=0,r=this.dataSourceSettings.values;o<r.length;o++){var s=r[o],s=s.caption||s.name,a=n.indexOf(s);if(-1<a){n.splice(a,1),n.push(s),this.valueSortHeaderText=n.join(this.valueSortSettings.headerDelimiter);break}}}e=this.rMembers,t=this.cMembers,i=!0}if(this.valueSortHeaderText){for(var n=this.valueSortHeaderText.split(this.valueSortSettings.headerDelimiter),l="",h=void 0,d=void 0,p=void 0,c=0;c<this.dataSourceSettings.values.length;c++){if(this.dataSourceSettings.values[c].caption===n[n.length-1]){p=this.dataSourceSettings.values[c].name;break}p=n[n.length-1]}if((1===this.dataSourceSettings.values.length&&0===this.dataSourceSettings.columns.length||1<this.dataSourceSettings.values.length)&&p&&this.fieldList[p]){for(c=0;c<n.length-1;c++)l=""===l?n[c]:l+this.valueSortSettings.headerDelimiter+n[c];h=this.fieldList[p].index,d=this.fieldList[p].aggregateType}else{if(this.dataSourceSettings.alwaysShowValueHeader&&1!==n.length)for(c=0;c<n.length-1;c++)l=""===l?n[c]:l+this.valueSortSettings.headerDelimiter+n[c];else l=this.valueSortHeaderText;h=this.fieldList[this.dataSourceSettings.values[0].name].index,d=this.fieldList[this.dataSourceSettings.values[0].name].aggregateType}var u=void 0;0===this.valueAxis?(u=this.getMember(t,l))&&(e=this.sortByValueRow(e,u,this.valueSortSettings.sortOrder,h,d)):(u=this.getMember(e,l))&&(t=this.sortByValueRow(t,u,this.valueSortSettings.sortOrder,h,d)),i&&(this.rMembers=e,this.cMembers=t,this.isPagingOrVirtualizationEnabled)&&(this.headerCollection.rowHeaders=this.rMembers,this.headerCollection.columnHeaders=this.cMembers)}return{rMembers:e,cMembers:t}},Qdt.prototype.getMember=function(e,t){for(var i,n=e.length,o=0;o<n;o++){if(e[o].valueSort.levelName===t){i=e[o];break}if(i=0<e[o].members.length?this.getMember(e[o].members,t):i)return i}return i},Qdt.prototype.sortByValueRow=function(e,t,i,n,o){for(var r,s,a=[],l=0,h=e;l<h.length;l++)"grand sum"===(d=h[l]).type?a.push({header:d}):(this.rawIndexObject={},r=this.getAggregateValue(d.index,t.indexObject,n,o,!1),s={fieldName:this.fields[n],row:d,column:t,value:r,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:d.hasChild&&d.isDrilled?"subTotal":"grand sum"===d.type?"grandTotal":"value",columnCellType:t.hasChild&&t.isDrilled?"subTotal":"grand sum"===t.type?"grandTotal":"value",aggregateType:o,skipFormatting:!1},this.getValueCellInfo&&this.getValueCellInfo(s),r=s.value,this.rawIndexObject={},a.push({header:d,value:r}));for(var d,p=0,c=e=Hdt.getSortedValue(a,i);p<c.length;p++)0<(d=c[p]).members.length&&(d.members=this.sortByValueRow(d.members,t,i,n,o));return e},Qdt.prototype.insertAllMembersCommon=function(){this.rowGrandTotal=this.columnGrandTotal=null;var e=!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)&&0<this.dataSourceSettings.rows.length),t=!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)&&0<this.dataSourceSettings.columns.length);this.isValueHasAdvancedAggregate?(this.insertAllMember(this.rMembers,this.filterMembers,"","row"),e&&(this.rowCount+=this.rowValuesLength),this.insertAllMember(this.cMembers,this.filterMembers,"","column"),t&&(this.columnCount+=this.colValuesLength)):(e?(this.insertAllMember(this.rMembers,this.filterMembers,"","row"),this.rowCount+=this.rowValuesLength):this.rowGrandTotal=this.insertAllMember([],this.filterMembers,"","row")[0],t?(this.insertAllMember(this.cMembers,this.filterMembers,"","column"),this.columnCount+=this.colValuesLength):this.columnGrandTotal=this.insertAllMember([],this.filterMembers,"","column")[0])},Qdt.prototype.insertSubTotals=function(){for(var e=this.pivotValues.length,t=0;t<e;t++){var i=this.pivotValues[t];if(i)for(var n=void 0,o=1,r=i.length,s=void 0,a=1,l=this.showSubTotalsAtTop?this.reformAxisCount:r,h=this.showSubTotalsAtTop?a:l-1,d=void 0,p=void 0;a<l;){var c,u=i[h];if(u){n&&(n.colSpan=o,n.colIndex=this.showSubTotalsAtTop?n.colIndex+(o-1):n.colIndex-(o-1)),this.showSubTotalsAtTop&&(d=p=this.getMemberSpanCount(this.pivotValues[t],h)),s={index:u.index,indexObject:u.indexObject},u.index=[],u.indexObject={},n=Pe({},u,null,!0),u.index=s.index,u.indexObject=s.indexObject;for(var g=t+1;this.pivotValues[g]&&!this.pivotValues[g][h];){var m=this.pivotValues[t][h],f=(m.isDrilled||!this.valueAxis&&!this.isLastHeaderHasMeasures&&m.members&&0<m.members.length&&g>this.measureIndex||(m.rowSpan=g-t+1,n.rowSpan=g-t+1),"sum"===u.type||"grand sum"===u.type?u.type:"sum"),y=(this.pivotValues[g][h]=this.headerContent[g][h]={type:f,formattedText:"sum"===u.type||"grand sum"===u.type?u.formattedText:u.formattedText+" Total",axis:"column",hierarchyName:u.hierarchyName,level:-1,colIndex:h,rowIndex:g,valueSort:u.valueSort},u.valueSort&&u.valueSort[this.valueSortSettings.headerText]&&(this.valueSortSettings.columnIndex=h),!1);"grand sum"===f?(m.rowSpan=g-t+1,n.rowSpan=g-t+1):"sum"!==m.type&&(m.isDrilled||this.valueAxisFields[m.actualText]&&!this.valueAxis&&!this.isLastHeaderHasMeasures&&m.members&&0<m.members.length)?(this.pivotValues[t+1][h].rowSpan=g-t,y=!0):this.pivotValues[g][h].rowSpan=-1,t+1<g&&("sum"===m.type||y)&&(this.pivotValues[g][h].rowSpan=-1),g++}o=1}else i[h]=this.headerContent[t][h]=Pe({},n,null,!0),i[h].index=this.headerContent[t][h].index=s.index,i[h].indexObject=this.headerContent[t][h].indexObject=s.indexObject,o++,this.showSubTotalsAtTop?(p--,i[h].colSpan=p,i[h].colIndex=i[h].colIndex+(o-1)):(i[h].colSpan=o,i[h].colIndex=i[h].colIndex-(o-1));1===h&&n&&(this.showSubTotalsAtTop?(n.colSpan=d,n.colIndex=n.colIndex+(o-1)):(n.colSpan=o,n.colIndex=n.colIndex-(o-1))),this.showSubTotalsAtTop&&(i[h+1]||h+1===this.reformAxisCount)&&((c=this.pivotValues[t][h-o+1]).colSpan=d,this.pivotValues[t][h-o+1]=c),h=this.showSubTotalsAtTop?h+1:h-1,a++}}},Qdt.prototype.getMemberSpanCount=function(e,t){for(var i=1,n=t+1;n<this.reformAxisCount&&!e[n];n++)i++;return i},Qdt.prototype.frameDrillObject=function(e){void 0===e&&(e=null),this.fieldDrillCollection={};for(var t=0;t<this.drilledMembers.length;t++){for(var i=this.drilledMembers[t],n=!1,o=1,r=!1,s=this.fieldList[i.name],a=s&&s.expandAll,l=0;l<this.dataSourceSettings.rows.length;l++)if(this.dataSourceSettings.rows[l].name===i.name){o=((h=this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&-1<this.measureIndex&&this.measureIndex<=l)?l+1:l)+1,n=!!h,r=!0;break}if(!r)for(var h,l=0;l<this.dataSourceSettings.columns.length;l++)if(this.dataSourceSettings.columns[l].name===i.name){o=((h=!this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&-1<this.measureIndex&&this.measureIndex<=l)?l+1:l)+1,n=!!h,r=!0;break}for(var d=0,p=i.items;d<p.length;d++){var c=p[d],u=c.split(i.delimiter);if(o===u.length){var g=i.name+this.valueSortSettings.headerDelimiter+u.join(this.valueSortSettings.headerDelimiter);if(this.fieldDrillCollection[g]=g,n){var m=!1;if(this.isExpandAll||a)for(var f=0,y=this.dataSourceSettings.values;f<y.length;f++){var v=y[f],v=v.caption||v.name;if(u[this.measureIndex]=v,!(-1<i.items.indexOf(u.join(i.delimiter)))){m=!1;break}m=!0}(!this.isExpandAll&&!a||!m)&&this.isExpandAll&&a||((u=c.split(i.delimiter)).splice(this.measureIndex,1),e&&e.memberName===c&&(e.memberName=u.join(i.delimiter)),g=i.name+this.valueSortSettings.headerDelimiter+u.join(this.valueSortSettings.headerDelimiter),this.fieldDrillCollection[g]=g)}}}}},Qdt.prototype.getIndexedHeaders=function(e,t,i,n,o,r,s){var a=[];if(e&&0<e.length){0;var l=e.length,h={},d=e[i].name,p=e[i],c=this.fieldList[d];if(je(this.reportDataType)){this.reportDataType={};for(var u=0;u<this.dataSourceSettings.rows.length;u++)this.reportDataType[this.dataSourceSettings.rows[u].name]=this.dataSourceSettings.rows[u].dataType;for(u=0;u<this.dataSourceSettings.columns.length;u++)this.reportDataType[this.dataSourceSettings.columns[u].name]=this.dataSourceSettings.columns[u].dataType;for(u=0;u<this.dataSourceSettings.values.length;u++)this.reportDataType[this.dataSourceSettings.values[u].name]=this.dataSourceSettings.values[u].dataType}c.type=je(this.reportDataType[c.id])?c.type:this.reportDataType[c.id];var g=!1,m=this.formatFields[d]&&-1<["date","dateTime","time"].indexOf(this.formatFields[d].type),f=n.length<1&&0<i||p.showNoDataItems,y={};if(f){for(var v=Object.keys(c.members),b=0,w=v.length;b<w;b++)(this.dataSourceSettings.showHeaderWhenEmpty||this.localeObj&&v[b]!==this.localeObj.getConstant("undefined"))&&(y[v[b]]=v[b]);n.length<1&&(g=!0,n.length=v.length)}o===this.dataSourceSettings.valueAxis&&this.measureIndex===i&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&(this.isLastHeaderHasMeasures=!1);for(b=0,w=n.length;b<w;b++){var C,S,A={},x=(je(e[i].showSubTotals)||e[i].showSubTotals||(A.showSubTotals=!1),A.hasChild=i<l-1,A.level=i,A.axis=o,A.colSpan=1,this.rowMaxLevel="row"===o&&this.rowMaxLevel<i?i:this.rowMaxLevel,(g?c.members[Object.keys(y)[0]]:this.valueMatrix[n[b]][c.index]).ordinal),I=g?Object.keys(y)[0]:t[n[b]][this.fieldKeys[d]];(je(I=this.enableHtmlSanitizer?go.sanitize(I):I)||this.localeObj&&I===this.localeObj.getConstant("undefined"))&&!this.dataSourceSettings.showHeaderWhenEmpty?f&&!g&&0<i&&b+1===n.length&&0<Object.keys(y).length&&(w=Object.keys(y).length,g=!0,b=-1):(delete y[I],f&&this.fieldFilterMem[d]&&this.fieldFilterMem[d].memberObj[I]===I||(S=m?{actualText:I,formattedText:c.dateMember[x-1].formattedText,dateText:c.dateMember[x-1].actualText}:{formattedText:null===I?this.localeObj?this.localeObj.getConstant("null"):String(I):void 0===I&&this.localeObj?d in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(I),actualText:null===I?this.localeObj?this.localeObj.getConstant("null"):String(I):void 0===I?this.localeObj?d in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(I):I},A.actualText=S.actualText,A.formattedText=S.formattedText,m&&(A.dateText=S.dateText),S=!f||void 0!==this.filterPosObj[n[b]]&&!g,C=!1,f&&0<c.filter.length&&"include"===c.filterType&&(C=!0),h&&h[x]||C&&!(-1<c.filter.indexOf(I.toString()))?S&&(h[x].index.push(n[b]),h[x].indexObject[n[b]]=n[b]):(h[x]={index:[],indexObject:{}},A.index=h[x].index,A.indexObject=h[x].indexObject,S&&(A.index=h[x].index=[n[b]],h[x].indexObject[n[b]]=n[b],A.indexObject=h[x].indexObject),A.ordinal=x,A.valueSort={},A.valueSort.axis=d,0!==i?(A.valueSort.levelName=r+this.valueSortSettings.headerDelimiter+(this.customProperties.isTabularLayout?this.getFormattedValue(A.formattedText,c.caption):A).formattedText,A.valueSort[r+this.valueSortSettings.headerDelimiter+A.formattedText]=1,A.valueSort.uniqueName=r+this.valueSortSettings.headerDelimiter+(A.actualText||A.formattedText),A.valueSort[r+this.valueSortSettings.headerDelimiter+(A.actualText||A.formattedText)]=1):(A.valueSort[A.formattedText]=1,A.valueSort.levelName=(this.customProperties.isTabularLayout?this.getFormattedValue(A.formattedText,c.caption):A).formattedText,A.valueSort[A.actualText||A.formattedText]=1,A.valueSort.uniqueName=A.actualText||A.formattedText),C=A.valueSort.axis+this.valueSortSettings.headerDelimiter+A.valueSort.levelName,S=this.isExpandAll||p&&p.expandAll,A.isDrilled=!(!s||!this.isValueFiltersAvail)||(A.hasChild&&this.fieldDrillCollection[C]?!S||!this.valueAxis&&!this.isLastHeaderHasMeasures&&this.measureIndex<=1:S),A.members=[],a.push(A)),f&&!g&&0<i&&b+1===n.length&&0<Object.keys(y).length&&(g=!0,w=Object.keys(y).length,b=-1)))}for(var T=0,E=a.length;T<E;T++){this.frameHeaderObjectsCollection||("row"===o?this.rowCount+=this.rowValuesLength+(a[T].isDrilled&&a[T].hasChild&&this.showSubTotalsAtBottom?1:0):this.columnCount+=this.colValuesLength);var D=null;if(r=(D=a[T].valueSort&&a[T].valueSort.levelName?a[T].valueSort.levelName:D)||a[T].formattedText,!this.dataSourceSettings.showHeaderWhenEmpty&&i<l-1&&a[T].index&&0<a[T].index.length)if(f&&e[i+1]&&e[i+1].name&&0<Object.keys(this.fieldList[e[i+1].name].members).length)a[T].hasChild=!0;else{for(var M=a[T].index.length,k=0,P=0;P<M;P++)(je(I=t[a[T].index[P]][this.fieldKeys[e[i+1].name]])||this.localeObj&&I===this.localeObj.getConstant("undefined"))&&k++;a[T].hasChild=k!==M}i<l-1&&a[T].isDrilled&&(this.columnCount-=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&p.showSubTotals||"column"!==o?0:this.colValuesLength,D=a[T].index,a[T].members=this.getIndexedHeaders(e,t,i+1,void 0===D?[]:D,o,r,s),this.frameHeaderObjectsCollection)&&(this.headerObjectsCollection[r]=a[T].members)}if(this.enableSort){if(m)return this.sortHeaders(d,c,a,c.sort,"date");if("number"===c.type.toLowerCase()&&0<a.length&&"string"==typeof a[0].actualText&&a[0].actualText.match(/[a-zA-Z]+/g)){for(var B=[],F=void 0,L=[],R=[],u=0;u<a.length;u++)if(je(a[u].actualText.toString().match(/\d+/)))B.push(a[u]),F||"None"===c.sort||"Out of Range"===a[u].actualText&&(F=a[u],a.splice(u,1));else{if(""!==a[u].actualText){this.fieldList[d].isAlphanumeric=!0,L.push(a[u]);break}R.push(a[u])}return F&&("Ascending"===c.sort?"Grand Total"===a[0].actualText?a.splice(1,0,F):a.splice(0,0,F):"Grand Total"===a[a.length-1].actualText?a.splice(a.length-1,0,F):a.splice(a.length,0,F)),0<L.length&&this.sortHeaders(d,c,a,c.sort,c.isAlphanumeric),a}return this.sortHeaders(d,c,a,c.sort,c.type)}}return a},Qdt.prototype.getOrderedIndex=function(e){for(var t={},i=0;i<e.length;i++)"grand sum"!==e[i].type&&(t[e[i].ordinal]=i);return t},Qdt.prototype.insertPosition=function(e,t,i,n,o,r,s){var a=[],l=this.getOrderedIndex(s);if(e){for(var h={},d=e[i].name,p=this.fieldList[d],c=0,u=n.length;c<u;c++){var g={},m=this.valueMatrix[n[c]][p.index].ordinal,f=s[l[m]],y=null===(y=t[n[c]][this.fieldKeys[d]])?this.localeObj?this.localeObj.getConstant("null"):String(y):y,y=this.formatFields[d]&&-1<["date","dateTime","time"].indexOf(this.formatFields[d].type)?this.getFormattedValue(y,d):{formattedText:y.toString(),actualText:y.toString()};f&&f.formattedText===y.formattedText&&(h&&h[m]?(h[m].index.push(n[c]),h[m].indexObject[n[c]]=n[c]):(h[m]={index:[],indexObject:{}},f.index=h[m].index=[n[c]],h[m].indexObject[n[c]]=n[c],f.indexObject=h[m].indexObject,f.valueSort={},f.valueSort.axis=d,0!==i?(f.valueSort.levelName=r+this.valueSortSettings.headerDelimiter+f.formattedText,f.valueSort[r+this.valueSortSettings.headerDelimiter+f.formattedText]=1,f.valueSort.uniqueName=r+this.valueSortSettings.headerDelimiter+(f.actualText||f.formattedText),f.valueSort[r+this.valueSortSettings.headerDelimiter+(f.actualText||f.formattedText)]=1):(f.valueSort[f.formattedText]=1,f.valueSort.levelName=f.formattedText,f.valueSort[f.actualText||f.formattedText]=1,f.valueSort.uniqueName=f.actualText||f.formattedText),g.members=[],a.push(g)))}for(var v=s.length-a.length;0<v;)a.push({members:[]}),v--;for(var b,w=0,C=a.length;w<C;w++)0<s[w].members.length&&(b=null,r=(b=s[w].valueSort&&s[w].valueSort.levelName?s[w].valueSort.levelName:b)||s[w].formattedText,a[w].members=this.insertPosition(e,t,i+1,s[w].index,o,r,s[w].members))}return a},Qdt.prototype.insertTotalPosition=function(e){var t=e[e.length-1];if(t&&"grand sum"===t.type){t.index=this.filterMembers,t.indexObject={};for(var i=0,n=this.filterMembers.length;i<n;i++)t.indexObject[this.filterMembers[i]]=this.filterMembers[i]}return e},Qdt.prototype.calculatePagingValues=function(){var e,t;this.isPagingOrVirtualizationEnabled&&(1===this.valueAxis?this.rowValuesLength=this.dataSourceSettings.values.length:this.colValuesLength=this.dataSourceSettings.values.length,this.columnPageCount=Math.ceil(this.columnCount/this.pageSettings.columnPageSize),this.rowPageCount=Math.ceil(this.rowCount/this.pageSettings.rowPageSize),this.pageSettings.currentColumnPage=this.pageSettings.currentColumnPage>=this.columnPageCount||this.enableOptimizedRendering&&1<this.pageSettings.currentColumnPage&&(this.pageSettings.currentColumnPage+1)*this.colValuesLength>=this.columnPageCount?this.columnPageCount:this.pageSettings.currentColumnPage,this.pageSettings.currentRowPage=this.pageSettings.currentRowPage>=this.rowPageCount||this.enableOptimizedRendering&&1<this.pageSettings.currentRowPage&&(this.pageSettings.currentRowPage+1)*this.rowValuesLength>=this.rowPageCount?this.rowPageCount:this.pageSettings.currentRowPage,e=this.enablePaging?1:this.enableOptimizedRendering?1.5:3,this.memberCnt=this.enablePaging?0:-this.rowValuesLength,this.rowStartPos=(this.pageSettings.currentRowPage*this.pageSettings.rowPageSize-this.pageSettings.rowPageSize)*(this.enablePaging?1:this.rowValuesLength)+(this.enablePaging?1:0),(t=!this.enablePaging&&this.rowStartPos+this.pageSettings.rowPageSize*e*this.rowValuesLength>this.rowCount?this.rowCount-this.pageSettings.rowPageSize*e*this.rowValuesLength:this.rowStartPos)<0&&(t=this.rowStartPos=0,this.pageSettings.currentRowPage=1),this.rowFirstLvl=(this.rowStartPos-t)%this.pageSettings.rowPageSize,this.rowStartPos=t,this.endPos=this.rowStartPos+this.pageSettings.rowPageSize*e*(this.enablePaging?1:this.rowValuesLength)-(this.enablePaging?1:0),this.endPos=this.endPos>this.rowCount+1?this.rowCount+1:this.endPos,this.rMembers=this.performSlicing(this.rMembers,[],this.rowStartPos,"row"),this.memberCnt=this.enablePaging?0:-this.colValuesLength,this.pageInLimit=!1,this.colHdrBufferCalculated=!1,this.colStartPos=(this.pageSettings.currentColumnPage*this.pageSettings.columnPageSize-this.pageSettings.columnPageSize)*(this.enablePaging?1:this.colValuesLength)+(this.enablePaging?1:0),(t=!this.enablePaging&&this.colStartPos+this.pageSettings.columnPageSize*e*this.colValuesLength>this.columnCount?this.columnCount-this.pageSettings.columnPageSize*e*this.colValuesLength:this.colStartPos)<0&&(t=this.colStartPos=0,this.pageSettings.currentColumnPage=1),this.colFirstLvl=(this.colStartPos-t)%this.pageSettings.columnPageSize,this.colStartPos=t,this.endPos=this.colStartPos+this.pageSettings.columnPageSize*e*(this.enablePaging?1:this.colValuesLength)-(this.enablePaging?1:0),this.endPos=this.endPos>this.columnCount+1?this.columnCount+1:this.endPos,this.cMembers=this.performSlicing(this.cMembers,[],this.colStartPos,"column"),this.memberCnt=-1,this.pageInLimit=!1,this.isValueHasAdvancedAggregate?("grand sum"!==this.rMembers[this.rMembers.length-1].type&&"grand sum"===this.headerCollection.rowHeaders[this.headerCollection.rowHeaders.length-1].type&&(this.rMembers.push(this.headerCollection.rowHeaders[this.headerCollection.rowHeaders.length-1]),this.removeRowGrandTotal=!0),"grand sum"!==this.cMembers[this.cMembers.length-1].type&&"grand sum"===this.headerCollection.columnHeaders[this.headerCollection.columnHeaders.length-1].type&&(this.cMembers.push(this.headerCollection.columnHeaders[this.headerCollection.columnHeaders.length-1]),this.removeColumnGrandTotal=!0)):(this.rowGrandTotal=this.rowGrandTotal||this.headerCollection.rowHeaders[this.headerCollection.rowHeaders.length-1],this.columnGrandTotal=this.columnGrandTotal||this.headerCollection.columnHeaders[this.headerCollection.columnHeaders.length-1]))},Qdt.prototype.performSlicing=function(e,t,i,n){for(var o=0;e[o]&&!(this.enablePaging&&this.endPos<=this.memberCnt&&0!==o);){if(this.memberCnt+=e[o].level<=this.measureIndex?"column"===n?this.colValuesLength:this.rowValuesLength:1,i<=this.memberCnt&&this.endPos>=this.memberCnt&&!this.pageInLimit&&("column"===n?this.colFirstLvl=this.colFirstLvl+e[o].level:this.rowFirstLvl=this.rowFirstLvl+e[o].level,this.pageInLimit=!0),this.pageInLimit&&!this.enablePaging&&this.endPos<=this.memberCnt){if("column"!==n)break;if(0===e[o].members.length){if(this.colHdrBufferCalculated)break;this.colHdrBufferCalculated=!0,this.endPos+=e[o].level*this.colValuesLength}else if(this.colHdrBufferCalculated)break}if(t.push(0<e[o].members.length?this.removeChildMembers(e[o]):e[o]),0<e[o].members.length&&("column"===n?this.memberCnt-=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&this.columnKeys[e[o].valueSort.axis].showSubTotals?0:this.colValuesLength:this.showSubTotalsAtBottom&&this.memberCnt++,t[t.length-1].members=this.performSlicing(e[o].members,[],i,n)),this.pageInLimit||t.pop(),0===e[o].level&&this.pageInLimit&&this.endPos<=this.memberCnt)break;o++}return t},Qdt.prototype.removeChildMembers=function(e){for(var t=Object.keys(e),i=0,n={};i<t.length;)n[t[i]]=e[t[i]],"members"===t[i]&&(n.members=[]),i++;return n},Qdt.prototype.insertAllMember=function(e,t,i,n){var o=e.length,r={hasChild:!" Total",index:t,level:0,axis:n,isDrilled:!1,indexObject:{},members:[],actualText:"Grand Total",formattedText:this.localeObj?this.localeObj.getConstant("grandTotal"):"Grand Total",ordinal:o,type:"grand sum",valueSort:{}};r.valueSort[r.formattedText]=1,r.valueSort.levelName=r.formattedText,r.valueSort[r.actualText]=1,r.valueSort.uniqueName=r.actualText;for(var s=0,a=t.length;s<a;s++)r.indexObject[t[s]]=t[s];return"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals?e.unshift(r):e.push(r),e},Qdt.prototype.getTableData=function(e,t,i,n,o,r,s,a,l,h){for(var d=e.length,p=0;p<d;p++){var c=!this.valueAxis&&!this.isLastHeaderHasMeasures&&o.length<this.dataSourceSettings.columns.length+1?this.dataSourceSettings.columns.length+1:o.length,u=e[p],g=(t[c]=u,c-Number(Object.keys(t)[0])),m=!t[c].members.length,f=(u.colIndex=0,u.rowIndex=c,!1),y=this.dataSourceSettings.valueSortSettings.headerDelimiter;if(this.valueAxis&&0===this.dataSourceSettings.rows.length&&1<this.dataSourceSettings.values.length&&(this.rowIndex=je(this.rowIndex)&&!m&&0===this.dataSourceSettings.rows.length?u.index:this.rowIndex,f=this.valueAxis&&0===this.dataSourceSettings.rows.length&&u.valueSort.levelName&&0!==u.valueSort.levelName.toString().indexOf("Grand Total"+y),this.valueAxis)&&0===this.dataSourceSettings.rows.length&&0===u.valueSort.levelName.toString().indexOf("Grand Total"+y)&&(u.index=this.rowIndex),f)m||this.recursiveRowData(e,t,i,c,o,r,m,p,0,s,a,l);else{var v=!1;if(this.showSubTotalsAtBottom&&t[n]&&t[n].hasChild)for(var b=0,w=t[n].members;b<w.length;b++)if("value"===w[b].type){v=!0;break}if(!v||t[c].isSum||!t[c].members||0!==t[c].members.length)if(o[c]||(o[c]=[],this.valueContent[g]={}),o[c][0]=t[c]=this.valueContent[g][0]=Hdt.getFormattedHeader(u,this),this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)){var C=c,S=g,y=c,A=!1;if(((0!==s||0!==this.measureIndex)&&!m||m)&&"value"===u.type&&!u.valueSort.axis||s>this.measureIndex&&"row"===u.axis&&u.valueSort.axis)for(var x=0,I=!1,T=u.valueSort.uniqueName?u.valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter):[],E=0,D=1,M=i.length;E<M;++E){if(!I)for(x=0;x<r;x++)if(-1<T.indexOf(this.dataSourceSettings.values[x].name)){A=I=!0;break}if(s>this.measureIndex&&"row"===u.axis&&u.valueSort.axis)this.updateRowData(e,i,c,o,x,p,E,D,g,a,l);else{if(!t[n]){A=!1;break}var k=this.showSubTotalsAtBottom&&h?h:n;this.updateRowData(t,i,c,o,x,k,E,D,g,a,l)}D=o[c].length}if(!A)for(E=0,D=1,M=i.length;E<M;++E)D=o[c].length,o[C][D]=this.valueContent[S][D]={axis:"value",actualText:"",colSpan:1,colIndex:D,formattedText:"",hasChild:!1};this.recursiveRowData(e,t,i,y,o,r,m,p,r,s,a,l)}else{for(E=0,D=1,M=i.length;E<M;++E)for(var P=i[E].valueSort.uniqueName?i[E].valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter):[],x=0;x<r;x++)(this.valueAxis||this.isLastHeaderHasMeasures||-1<P.indexOf(this.dataSourceSettings.values[x].name))&&(this.updateRowData(e,i,c,o,x,p,E,D,g,a,l),D=o[c].length);this.recursiveRowData(e,t,i,c,o,r,m,p,0,s,a,l)}}}},Qdt.prototype.insertRowSubTotals=function(e,t,i,n,o,r,s,a){var l=!!e[i].type&&"value"===e[i].type&&e[i].valueSort.levelName!==e[i].actualText;if(e[i].hasChild&&0<e[i].members.length){var h=[],d=Hdt.frameHeaderWithKeys(e[i]);if("value"===e[i].members[0].type){for(var p=0,c=[],u=1,g=0,m=d.members;g<m.length;g++){var f=m[g];"value"===f.type&&(c[c.length]=f)}for(;p<c.length;){for(var y=Hdt.frameHeaderWithKeys(c[p]),v=void 0;u<e.length;u++)if(e[u]&&e[u].valueSort.levelName===y.valueSort.levelName){v=e.indexOf(e[u]);break}-1<v&&(h[h.length]=v),y.formattedText=d.formattedText+" "+y.formattedText,y.isSum=!0,y.members=[],this.getTableData([y],e,t,i,n,o,r,s,a),p++}}else{d.formattedText=d.formattedText+" Total",d.members=[],d.isDrilled=!1,d.hasChild=!1,d.isSum=!0,d.type="sum";l=l?this.getParentIndex(e,d):0;this.getTableData([d],e,t,i,n,o,r,s,a,l),h=[i]}for(v=0;v<h.length;v++){var b=(b=n[h[v]]).map(function(e){return e.formattedText=0===e.colIndex?e.formattedText:"",e});n[h[v]]=b}}},Qdt.prototype.getParentIndex=function(e,t){for(var i=0,n=e.length-1;0<n;n--)if(t.level===e[n].level&&e[n].index){i=n;break}return i},Qdt.prototype.getAggregatedHeaders=function(e,t,i,n,o){this.selectedHeaders={selectedHeader:[],values:[]};for(var r=o.length,s=0;s<r;s++)switch(o[s].type){case"DifferenceFrom":case"PercentageOfDifferenceFrom":for(var a=void 0,l=void 0,h=(this.selectedHeaders.values.push(o[s].name),o[s].baseField&&o[s].baseItem?(a=o[s].baseField,l=o[s].baseItem):this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&0<t.length?(a=t[0].name,l=Object.keys(this.fieldList[t[0].name].members)[0]):0<e.length&&(a=e[0].name,l=Object.keys(this.fieldList[e[0].name].members)[0]),!1),d=0,p=e;d<p.length;d++)if(p[d].name===a){this.getAggregatedHeaderData(i,o[s].name,l,!1,"row",o[s].type,this.selectedHeaders.selectedHeader,s),h=!0;break}if(!h)for(var c=0,u=t;c<u.length;c++)if(u[c].name===a){this.getAggregatedHeaderData(n,o[s].name,l,!1,"column",o[s].type,this.selectedHeaders.selectedHeader,s);break}break;case"PercentageOfParentRowTotal":case"PercentageOfParentColumnTotal":this.selectedHeaders.values.push(o[s].name),this.getAggregatedHeaderData("PercentageOfParentRowTotal"===o[s].type?i:n,o[s].name,void 0,!1,"PercentageOfParentRowTotal"===o[s].type?"row":"column",o[s].type,this.selectedHeaders.selectedHeader,s);break;case"RunningTotals":this.selectedHeaders.values.push(o[s].name),this.getAggregatedHeaderData(this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)?n:i,o[s].name,void 0,!1,this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)?"column":"row",o[s].type,this.selectedHeaders.selectedHeader,s);break;case"PercentageOfParentTotal":for(var a=void 0,h=(this.selectedHeaders.values.push(o[s].name),o[s].baseField?a=o[s].baseField:this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&0<t.length?a=t[0].name:0<e.length&&(a=e[0].name),!1),g=e.length,m=0;m<g;m++)if(e[m].name===a){var f=m>=this.measureIndex?m+1:m;this.getAggregatedHeaderData(i,o[s].name,void 0,!1,"row",o[s].type,this.selectedHeaders.selectedHeader,s,f),h=!0;break}if(!h)for(g=t.length,m=0;m<g;m++)if(t[m].name===a){f=m;this.valueAxis||this.isLastHeaderHasMeasures||(f=m>=this.measureIndex?m+1:m),this.getAggregatedHeaderData(n,o[s].name,void 0,!1,"column",o[s].type,this.selectedHeaders.selectedHeader,s,f);break}}},Qdt.prototype.getAggregatedHeaderData=function(e,t,i,n,o,r,s,a,l){for(var h=0,d=e;h<d.length;h++){var p=d[h];switch(r){case"DifferenceFrom":case"PercentageOfDifferenceFrom":if(-1!==p.valueSort.levelName.toString().split(this.valueSortSettings.headerDelimiter).indexOf(i)){var c=[];if(!n&&"row"===o)for(var u=0,g=e;u<g.length;u++){var m=g[u];m.level>=p.level&&c.push(m)}if(s.push(this.updateSelectedHeaders(i,p.level,o,n,t,r,p.valueSort.levelName,n?[p]:"column"===o?e:c,a+1)),0<p.members.length){var f=!1,y=[];if("row"===o)for(var v=0,b=p.members;v<b.length;v++){if("value"!==(A=b[v]).type||0!==A.members.length){y.push(A),f=!1;break}f=!0}(!f&&0<y.length||"column"===o)&&this.getAggregatedHeaderData("column"===o?p.members:y,t,i,!0,o,r,s[s.length-1].childMembers,a)}}else 0<p.members.length&&this.getAggregatedHeaderData(p.members,t,i,!1,o,r,s,a);break;case"RunningTotals":case"PercentageOfParentRowTotal":case"PercentageOfParentColumnTotal":"grand sum"===p.type?s.push(this.updateSelectedHeaders(void 0,p.level,o,!1,t,r,p.valueSort.levelName,e,a+1)):0<p.members.length&&(s.push(this.updateSelectedHeaders(void 0,p.level,o,!1,t,r,p.valueSort.levelName,p.members,a+1)),this.getAggregatedHeaderData(p.members,t,void 0,!1,o,r,s,a));break;case"PercentageOfParentTotal":if("grand sum"!==p.type)if(p.valueSort.levelName.split(this.valueSortSettings.headerDelimiter).length-1===l)if(0<p.members.length){if(n)for(var w=s[s.length-1].aggregateHeaders,C=0,S=p.members;C<S.length;C++){var A=S[C];w.push(Pe({},A,null,!0))}else{var x=Pe([],p.members,null,!0);s.push(this.updateSelectedHeaders(void 0,p.level,o,!1,t,r,p.valueSort.levelName,x,a+1)),(w=s[s.length-1].aggregateHeaders).push(Pe({},p,null,!0))}this.getAggregatedHeaderData(p.members,t,void 0,!0,o,r,s,a,l+1)}else n||s.push(this.updateSelectedHeaders(void 0,p.level,o,!1,t,r,p.valueSort.levelName,[p],a+1));else 0<p.members.length&&this.getAggregatedHeaderData(p.members,t,void 0,!1,o,r,s,a,l)}}},Qdt.prototype.updateSelectedHeaders=function(e,t,i,n,o,r,s,a,l){return{name:e,level:t,axis:i,isChild:n,value:o,type:r,uniqueName:s,aggregateHeaders:Pe([],a,null,!0),childMembers:[],valueCount:l}},Qdt.prototype.applyAdvancedAggregate=function(e,t,i){if(this.aggregatedValueMatrix=[],0<this.selectedHeaders.values.length){for(var n={},o=[],r=[],s=!1,a=i.length,l=0;l<a;l++)if(void 0!==i[l]&&void 0!==i[l][0]){if(!s)for(var h=i[l].length,d=0;d<h;d++){var p=i[l][d].actualText;"value"===i[l][d].axis&&-1!==this.selectedHeaders.values.indexOf(p)&&(o.push(d),s=!0)}var c=this.showSubTotalsAtBottom&&i[l][0].isDrilled&&i[l][0].hasChild;if(!c&&0<o.length&&"value"===i[l][o[0]].axis&&-1!==this.selectedHeaders.values.indexOf(i[l][o[0]].actualText)){r.push(l);for(var u=0,g=o;u<g.length;u++)n[l+","+(m=g[u])]=[l,m]}}this.updateAggregates(e,t,i,this.selectedHeaders.selectedHeader,o,r,n);for(var m,f=0,y=Object.keys(n);f<y.length;f++)i[n[m=y[f]][0]][n[m][1]].formattedText=0<this.selectedHeaders.selectedHeader.length?this.emptyCellTextContent:"#N/A",this.aggregatedValueMatrix[n[m][0]]||(this.aggregatedValueMatrix[n[m][0]]=[]),this.aggregatedValueMatrix[n[m][0]][n[m][1]]=0;this.updatePivotValues(!0)}},Qdt.prototype.updateAggregates=function(e,t,i,O,n,o,r){for(var s=0,N=O;s<N.length;s++){var a=N[s],l=a.aggregateHeaders,h=a.value,V=a.type,d=a.uniqueName,p="row"===a.axis,c=void 0,u=[],g=[],m=[],f=[],y=[],v=[];if(-1!==["DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal","RunningTotals"].indexOf(a.type))if(p){if("RunningTotals"!==a.type)for(var _=0,H=o;_<H.length;_++){var b=H[_];if(void 0!==e[b]&&e[b].valueSort[d]){c=e[b],y=0===this.valueAxis||this.valueAxis&&i[b]&&i[b][1]&&i[b][1].actualText===h?i[b]:[];break}}}else{for(var z=i.length,w=0;w<z&&(void 0!==i[w]&&void 0===i[w][0]);w++)m.push(i[w]);for(var C=m.length;C--;){var j=(I=m[C][n[0]]).actualText;-1===this.selectedHeaders.values.indexOf(j)&&(g=m[C],C=0)}if("RunningTotals"!==a.type){for(var S=g.length,A=0;A<S;A++){var x=!1;if(void 0!==g[A]&&g[A].valueSort[d]){for(var c=g[A],W=i.length,w=0;w<W;w++)void 0!==(I=i[w])&&void 0!==I[0]&&"value"===I[A].axis&&-1!==this.selectedHeaders.values.indexOf(I[A].actualText)&&(x=!0,v[w]=I[A],f.push(w));if(x)break}}if(0===v.length&&0===f.length)for(S=g.length,A=0;A<S;A++){x=!1;if(void 0!==g[A]&&0===g[A].valueSort.levelName.indexOf(d)){c=g[A];for(var I,Q=i.length,T=0;T<Q;T++)void 0!==(I=i[T])&&void 0!==I[0]&&"value"===I[A].axis&&-1!==this.selectedHeaders.values.indexOf(I[A].actualText)&&(x=!0,f.push(T));if(x)break}}}}switch(a.type){case"DifferenceFrom":case"PercentageOfDifferenceFrom":var U=a.isChild;if(p){if(U)for(var E=d.split(this.valueSortSettings.headerDelimiter),q=0,G=o;q<G.length;q++){var D=G[q];if(void 0!==e[D])if(-1!==e[D].valueSort.levelName.split(this.valueSortSettings.headerDelimiter).indexOf(E[E.length-1])&&c&&e[D].level===c.level)for(var Y=0,X=n;Y<X.length;Y++){k=X[Y];"value"===(P=i[D][k]).axis&&P.actualText===h&&(u.push([D,k]),r[D+","+k])&&delete r[D+","+k]}}else for(var K=0,J=l;K<J.length;K++)for(var M=J[K],Z=0,$=o;Z<$.length;Z++){b=$[Z];if(void 0!==e[b]&&e[b].valueSort[M.valueSort.levelName]&&e[b].level===c.level&&"grand sum"!==e[b].type)for(var ee=0,te=n;ee<te.length;ee++){var k=te[ee];"value"===(P=i[b][k]).axis&&P.actualText===h&&(u.push([b,k]),r[b+","+k])&&delete r[b+","+k]}}for(var ie=0,ne=u;ie<ne.length;ie++){var P=i[(k=ne[ie])[0]][k[1]],oe=je(y[k[1]].actualValue)?0:y[k[1]].actualValue,B=(je(P.actualValue)?0:P.actualValue)-oe;B=isNaN(B)||0===P.value&&0===y[k[1]].value?0:B,this.aggregatedValueMatrix[k[0]]||(this.aggregatedValueMatrix[k[0]]=[]),"DifferenceFrom"===V?(this.aggregatedValueMatrix[k[0]][k[1]]=B,P.formattedText=0===B?this.emptyCellTextContent:this.getFormattedValue(B,h).formattedText):(this.aggregatedValueMatrix[k[0]][k[1]]=B=0===oe?0:B/oe,P.formattedText=P.showSubTotals?0!==B?this.globalize.formatNumber(B,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,P.actualText)}):this.emptyCellTextContent:P.formattedText)}}else{if(U)for(var E=d.split(this.valueSortSettings.headerDelimiter),S=g.length,F=0;F<S;F++){x=!1;if(void 0!==g[F])if(-1!==g[F].valueSort.levelName.split(this.valueSortSettings.headerDelimiter).indexOf(E[E.length-1])&&g[F].level===c.level){for(var re=0,se=f;re<se.length;re++)"value"===(P=i[k=se[re]][F]).axis&&P.actualText===h&&(x=!0,u.push([k,F]),r[k+","+F])&&delete r[k+","+F];if(x)break}}else for(var ae=0,le=l;ae<le.length;ae++)for(M=le[ae],S=g.length,A=0;A<S;A++){var x=!1;if(void 0!==g[A]&&g[A].valueSort[M.valueSort.levelName]&&c&&g[A].level===c.level&&"grand sum"!==g[A].type){for(var he=0,de=f;he<de.length;he++)"value"===(P=i[k=de[he]][A]).axis&&P.actualText===h&&(x=!0,u.push([k,A]),r[k+","+A])&&delete r[k+","+A];if(x)break}}var pe=void 0;0===v.length&&(pe=this.getSelectedColumn(a.uniqueName,t));for(var ce=0,ue=u;ce<ue.length;ce++){var P=i[(k=ue[ce])[0]][k[1]],ge=0,B=(ge=0===v.length?(L=this.getSelectedRow(P.rowHeaders,e),this.getAggregateValue(L.index,pe.indexObject,this.fieldList[h].index,a.type,!1)):v[k[0]].value,P.value-ge);B=isNaN(B)?0:B,this.aggregatedValueMatrix[k[0]]||(this.aggregatedValueMatrix[k[0]]=[]),"DifferenceFrom"===V?P.formattedText=0===B?this.emptyCellTextContent:this.getFormattedValue(B,h).formattedText:(B=0===v[k[0]].value?0:B/v[k[0]].value,P.formattedText=0!==B?this.globalize.formatNumber(B,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,P.actualText)}):this.emptyCellTextContent),this.aggregatedValueMatrix[k[0]][k[1]]=B}}0<a.childMembers.length&&this.updateAggregates(e,t,i,a.childMembers,n,o,r);break;case"PercentageOfParentRowTotal":case"PercentageOfParentColumnTotal":case"PercentageOfParentTotal":if(p){for(var me=0,fe=l;me<fe.length;me++)for(var M=fe[me],ye=0,ve=o;ye<ve.length;ye++){w=ve[ye];if(void 0!==e[w]&&e[w].valueSort[M.valueSort.levelName]&&e[w].level===M.level)for(var be=0,we=n;be<we.length;be++){k=we[be];"value"===(P=i[w][k]).axis&&P.actualText===h&&(u.push([w,k]),r[w+","+k])&&delete r[w+","+k]}}for(var Ce=0,Se=u;Ce<Se.length;Ce++){var P=i[(w=Se[Ce])[0]][w[1]],Ae=0,Ae=0===y.length&&c?this.getAggregateValue(c.index,t[w[1]-1].indexObject,this.fieldList[h].index,a.type,!1):y[w[1]]?y[w[1]].actualValue:0,B=P.value/Ae;B=isNaN(B)?0:B,P.formattedText=P.showSubTotals?0!==B?this.globalize.formatNumber(B,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,P.actualText)}):this.emptyCellTextContent:P.formattedText,this.aggregatedValueMatrix[w[0]]||(this.aggregatedValueMatrix[w[0]]=[]),this.aggregatedValueMatrix[w[0]][w[1]]=B}}else{for(var xe=0,Ie=l;xe<Ie.length;xe++)for(M=Ie[xe],S=g.length,T=0;T<S;T++){x=!1;if(void 0!==g[T]&&g[T].valueSort[M.valueSort.levelName]){for(var Te=0,Ee=f;Te<Ee.length;Te++){k=Ee[Te];this.showSubTotalsAtBottom&&i[k][0].isDrilled&&i[k][0].hasChild||"value"===(P=i[k][T]).axis&&P.actualText===h&&(x=!0,u.push([k,T]),r[k+","+T])&&delete r[k+","+T]}if(x)break}}var De=void 0;0===v.length&&(De=this.getSelectedColumn(a.uniqueName,t));for(var Me=0,ke=u;Me<ke.length;Me++){var L,P=i[(w=ke[Me])[0]][w[1]],R=0,R=(R=0===v.length?(L=this.getSelectedRow(P.rowHeaders,e),this.getAggregateValue(L.index,De.indexObject,this.fieldList[h].index,a.type,!1)):v[w[0]].value,P.value/R),R=isNaN(R)?0:R;P.formattedText=0!=R?this.globalize.formatNumber(R,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,P.actualText)}):this.emptyCellTextContent,this.aggregatedValueMatrix[w[0]]||(this.aggregatedValueMatrix[w[0]]=[]),this.aggregatedValueMatrix[w[0]][w[1]]=R}}break;case"RunningTotals":if(p){for(var Pe=0,Be=n;Pe<Be.length;Pe++)for(var k=Be[Pe],B=0,Fe=0,Le=l;Fe<Le.length;Fe++)for(var M=Le[Fe],Re=0,Oe=o;Re<Oe.length;Re++)if(void 0!==e[D=Oe[Re]]){P=i[D][k];if(void 0!==e[D]&&e[D].valueSort[M.valueSort.levelName]&&e[D].level===M.level&&"value"===P.axis&&P.actualText===h){"grand sum"!==e[D].type&&(B+=P.showSubTotals||!je(P.actualValue)&&isNaN(P.actualValue)?je(P.value)||isNaN(P.value)?null:P.value:P.actualValue,P.formattedText=P.showSubTotals?0===B&&P.actualValue&&0!==P.actualValue?"":this.getFormattedValue(B,h).formattedText:P.formattedText,this.aggregatedValueMatrix[D]||(this.aggregatedValueMatrix[D]=[]),this.aggregatedValueMatrix[D][k]=B),r[D+","+k]&&delete r[D+","+k];break}}}else for(var Ne=0,Ve=o;Ne<Ve.length;Ne++)if(void 0!==i[b=Ve[Ne]])for(var B=0,_e=0,He=l;_e<He.length;_e++)for(var M=He[_e],ze=e[b].hasChild&&e[b].isDrilled&&(!je(e[b].showSubTotals)&&!e[b].showSubTotals||!this.dataSourceSettings.showSubTotals||!this.dataSourceSettings.showRowSubTotals),S=g.length,A=0;A<S;A++){P=i[b][A];if(void 0!==g[A]&&g[A].valueSort[M.valueSort.levelName]&&"value"===P.axis&&P.actualText===h){"grand sum"!==g[A].type&&(je(P.value)||(B+=P.value),P.formattedText=ze?"":this.getFormattedValue(B,h).formattedText,this.aggregatedValueMatrix[b]||(this.aggregatedValueMatrix[b]=[]),this.aggregatedValueMatrix[b][A]=B),r[b+","+A]&&delete r[b+","+A];break}}}}},Qdt.prototype.getSelectedColumn=function(e,t){for(var i={axis:"column",index:[],indexObject:{}},n=0,o=t;n<o.length;n++){var r=o[n];r&&r.valueSort&&0===r.valueSort.levelName.indexOf(e)&&(i.index=i.index.concat(r.index).sort(function(e,t){return e-t}),i.indexObject=jdt({},i.indexObject,r.indexObject))}return i},Qdt.prototype.getSelectedRow=function(e,t){for(var i=0,n=t;i<n.length;i++){var o=n[i];if(o){if(o.valueSort&&o.valueSort.levelName===e)return o;if(""===e&&"grand sum"===o.type)return o}}return null},Qdt.prototype.recursiveRowData=function(e,t,i,n,o,r,s,a,l,h,d,p){s||this.getTableData(t[n].members,t,i,n,o,r,h+1,d,p),this.showSubTotalsAtBottom&&(je(e[a].showSubTotals)||e[a].showSubTotals)&&this.insertRowSubTotals(t,i,n,o,r,h,d,p),this.isPagingOrVirtualizationEnabled||(t[n].members=[])},Qdt.prototype.updateRowData=function(e,t,i,n,o,r,s,a,l,h,d){var p=this.fieldList[this.dataSourceSettings.values[o].name].index,c=this.fieldList[this.dataSourceSettings.values[o].name].aggregateType,u=this.dataSourceSettings.values[o].name,g=[],m={},f=0,y=0;switch(c){case"Index":for(var v=["cVal","rTotalVal","cTotalVal","gTotalVal"],b=0,w=0,C=g=[[e[r],t[s]],[e[r],d],[h,t[s]],[h,d]];w<C.length;w++){var S=C[w];m[v[b]]=this.getAggregateValue(S[0].index,S[1].indexObject,p,c,0!==b),b++}var A=m.cVal*m.gTotalVal/(m.rTotalVal*m.cTotalVal),f=!(0<e[r].members.length&&e[r].hasChild&&e[r].isDrilled)||(je(e[r].showSubTotals)||e[r].showSubTotals)&&this.dataSourceSettings.showRowSubTotals&&this.dataSourceSettings.showSubTotals?je(m.cVal)?m.cVal:isNaN(A)?0:A:void 0,y=je(m.cVal)?m.cVal:isNaN(A)?0:A;break;case"PercentageOfGrandTotal":case"PercentageOfColumnTotal":case"PercentageOfRowTotal":(g=[[e[r],t[s]]]).push("PercentageOfGrandTotal"===c?[h,d]:"PercentageOfColumnTotal"===c?[h,t[s]]:[e[r],d]);for(var v=["cVal","gTotalVal"],b=0,x=0,I=g;x<I.length;x++){S=I[x];m[v[b]]=this.getAggregateValue(S[0].index,S[1].indexObject,p,c,0!==b),b++}A=m.cVal/m.gTotalVal;f=!(0<e[r].members.length&&e[r].hasChild&&e[r].isDrilled)||(je(e[r].showSubTotals)||e[r].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals?je(m.cVal)?m.cVal:isNaN(A)?0:A:void 0,y=je(m.cVal)?m.cVal:isNaN(A)?0:A;break;default:A=this.getAggregateValue(e[r].index,t[s].indexObject,p,c,!1);f=!(0<e[r].members.length&&e[r].hasChild&&e[r].isDrilled)||(je(e[r].showSubTotals)||e[r].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals?A:void 0,y=A}var o={fieldName:this.dataSourceSettings.values[o].name,row:e[r],column:t[s],value:f,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:e[r].hasChild&&e[r].isDrilled?"subTotal":"grand sum"===e[r].type?"grandTotal":"value",columnCellType:t[s].hasChild&&t[s].isDrilled?"subTotal":"grand sum"===t[s].type?"grandTotal":"value",aggregateType:c,skipFormatting:!1},T=(this.getValueCellInfo&&this.getValueCellInfo(o),f=o.value,e[r].hasChild||t[s].hasChild||"grand sum"===e[r].type||"grand sum"===t[s].type||this.showSubTotalsAtBottom&&e[r].isSum),E="grand sum"===e[r].type||"grand sum"===t[s].type,D=0<e[r].members.length&&e[r].hasChild&&e[r].isDrilled&&(!je(e[r].showSubTotals)&&!e[r].showSubTotals||!this.dataSourceSettings.showSubTotals||!this.dataSourceSettings.showRowSubTotals),M=D?"":void 0===f?this.emptyCellTextContent:"Count"===c||"DistinctCount"===c?f.toLocaleString():this.getFormattedValue(f,u).formattedText;!isNaN(f)&&!je(f)&&0<=["PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal"].indexOf(c)?M=this.globalize.formatNumber(f,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,o.fieldName)}):D||!isNaN(f)||je(f)||-1===["PopulationStDev","SampleStDev","PopulationVar","SampleVar"].indexOf(c)||(M="#DIV/0!",f=0),M=o.skipFormatting?je(f)?this.emptyCellTextContent:f.toString():M,n[i][a]=this.valueContent[l][a]={axis:"value",actualText:u,indexObject:this.isDrillThrough?this.rawIndexObject:{},rowHeaders:"grand sum"===e[r].type?"":e[r].valueSort.levelName,columnHeaders:"grand sum"===t[s].type?"":t[s].valueSort.levelName,formattedText:M,value:f,hierarchyName:t[s].hierarchyName,actualValue:y,rowIndex:i,colIndex:a,isSum:T,isGrandSum:E,showSubTotals:!D},this.rawIndexObject={}},Qdt.prototype.getCellSet=function(e){for(var t=[],i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];this.data[parseInt(o,10)]&&t.push(this.data[parseInt(o,10)])}return t},Qdt.prototype.updateValueMembers=function(e,t,i,n,o,r,s){var a=i&&!je(i.levelName)?i.levelName.toString():void 0,l=i&&!je(i.uniqueName)?i.uniqueName.toString():void 0;if(e)for(var h=0;h<r;h++){var d=this.dataSourceSettings.values[h],p=d.caption||d.name,c={axis:this.valueAxis?"row":"column",rowIndex:this.valueAxis?0:t&&s<=t.rowIndex?t.rowIndex+1:s,actualText:d.name,formattedText:p,level:0,valueSort:{},members:[],type:this.valueAxis?"value":t?t.type:null,index:!this.valueAxis&&t?t.index:null,indexObject:!this.valueAxis&&t?t.indexObject:null},u=(0<o.length&&(c.showSubTotals=d.showSubTotals),c.valueSort);u.axis=this.valueAxis?void 0:d.name,u[(a?a+this.valueSortSettings.headerDelimiter:"")+p]=1,u[(l?l+this.valueSortSettings.headerDelimiter:"")+d.name]=1,u.levelName=(a?a+this.valueSortSettings.headerDelimiter:"")+p,u.uniqueName=(l?l+this.valueSortSettings.headerDelimiter:"")+d.name,n.push(c),this.updateValueMembers(!1,t,u,c.members,o,r,s+1)}else for(var g=0,m=o.length;g<m;g++){var f=Hdt.frameHeaderWithKeys(o[g]),y=(f.members=[],f.rowIndex=this.valueAxis?f.rowIndex:s<0?0:s,{}),v=(y.axis=f.valueSort.axis,y[(a?a+this.valueSortSettings.headerDelimiter:"")+f.formattedText]=1,y[(l?l+this.valueSortSettings.headerDelimiter:"")+f.actualText]=1,y.levelName=(a?a+this.valueSortSettings.headerDelimiter:"")+f.formattedText,y.uniqueName=(l?l+this.valueSortSettings.headerDelimiter:"")+f.actualText,f.hierarchyName=f.valueSort.uniqueName,(f.valueSort=y).axis+this.valueSortSettings.headerDelimiter+y.levelName),b=this.fieldList[y.axis];f.isDrilled&&((this.isExpandAll||b.expandAll)&&this.fieldDrillCollection[v]||!this.isExpandAll&&!b.expandAll&&!this.fieldDrillCollection[v])&&(f.isDrilled=!1),n.push(f),f.isDrilled&&0<o[g].members.length?(this.valueAxis&&s<this.measureIndex&&this.measureIndex!==s+1&&(!o[g].hasChild||(je(o[g].showSubTotals)||o[g].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals)&&this.updateValueMembers(!0,f,y,n[n.length-1].members,[],r,s),this.updateValueMembers(this.measureIndex===s+1,f,y,n[n.length-1].members,o[g].members,r,s+1),!this.valueAxis&&s<this.measureIndex&&this.measureIndex!==s+1&&(!o[g].hasChild||(je(o[g].showSubTotals)||o[g].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals)&&this.updateValueMembers(!0,f,y,n[n.length-1].members,[],r,s)):s<this.measureIndex&&this.updateValueMembers(!0,f,y,n[n.length-1].members,[],r,s)}},Qdt.prototype.reArrangeValueMember=function(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];this.valueAxisFields[o.actualText]&&(t[t.length]=o)}return t.concat(e).slice(0,e.length)},Qdt.prototype.frameDefinedHeaderData=function(e,t,i,n,o,r){for(var s=0,a=e.length;s<a;s++){var l,h,d=!0,p=(!(0<e[s].members.length)||(je(e[s].showSubTotals)||e[s].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals||(d=!1),this.measureIndex<n&&d?1:this.measureIndex>n&&0<e[s].members.length||this.measureIndex!==n+1||!e[s].isDrilled?this.measureIndex===n&&0!==this.measureIndex&&d||this.measureIndex>n&&d&&e[s].valueSort&&e[s].valueSort.axis&&this.measureNames[e[s].valueSort.axis.toString()]?1:0:0!==this.measureIndex&&d?1:0),d=(e[s].members.length&&(l=void 0,h=e[s].members,this.showSubTotalsAtTop?n+1<this.measureIndex&&d?(l=o,h=this.reArrangeValueMember(h)):l=o+p:l=o,this.frameDefinedHeaderData(h,t,i,n+1,l,r)),this.measureIndex>n&&e[s].valueSort&&e[s].valueSort.axis&&this.measureNames[e[s].valueSort.axis.toString()]?this.measureIndex:n);t[(o=this.showSubTotalsAtTop?o+1:t.length+p)-1]||(t[o-1]=Hdt.frameHeaderWithKeys(e[s])),e[s].colIndex=o,i[d]||(i[d]=[],this.headerContent[d]={}),i[d][o]=this.headerContent[d][o]=Hdt.frameHeaderWithKeys(e[s]),this.isPagingOrVirtualizationEnabled||this.showSubTotalsAtTop&&0==p||t[o-1]&&(t[o-1].members=[]),this.showSubTotalsAtTop&&(o=t.length,s+1===a)&&0===e[s].level&&(this.reformAxisCount=t.length+1)}},Qdt.prototype.getHeaderData=function(e,t,i,n,o,r,s,a,l){if(this.valueAxis||this.isLastHeaderHasMeasures){if(0===n.length&&this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&0<this.dataSourceSettings.values.length&&(this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&"grand sum"===this.rMembers[this.rMembers.length-1].type?(this.updateValueMembers(0===this.measureIndex&&1<this.rMembers.length,null,null,n,this.rMembers.slice(0,this.rMembers.length-1),this.dataSourceSettings.values.length,0),this.updateValueMembers(!1,null,null,n,this.rMembers.slice(this.rMembers.length-1,this.rMembers.length),this.dataSourceSettings.values.length,-1)):"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&0===this.measureIndex?(this.updateValueMembers(!1,null,null,n,this.rMembers.slice(0,1),this.dataSourceSettings.values.length,-1),this.updateValueMembers(0===this.measureIndex&&1<this.rMembers.length,null,null,n,this.rMembers.slice(1,this.rMembers.length),this.dataSourceSettings.values.length,0)):(I=0===e.length&&1===this.rMembers.length&&"grand sum"===this.rMembers[0].type,this.updateValueMembers(!I&&0===this.measureIndex,null,null,n,this.rMembers,this.dataSourceSettings.values.length,I?-1:0)),this.getAggregatedHeaders(e,t,n,o,i),0<this.selectedHeaders.values.length))for(E=this.selectedHeaders.selectedHeader.length,D=0;D<E;D++)if("row"===(T=this.selectedHeaders.selectedHeader[D]).axis)for(var h=T.aggregateHeaders.length,d=0;d<h;d++)if(T.aggregateHeaders[d].actualText===T.value)if(-1!==T.aggregateHeaders[d].valueSort.levelName.indexOf(T.uniqueName))T.uniqueName=T.aggregateHeaders[d].valueSort.levelName,T.aggregateHeaders.splice(d,1),d--,h--;else for(var p,c=T.aggregateHeaders[d].members.length,u=0;u<c;u++)"value"!==(k=T.aggregateHeaders[d].members[u]).type&&k.level===T.aggregateHeaders[d].level&&(p=Pe([],T.aggregateHeaders[d].members,null,!0),T.aggregateHeaders=[].concat(T.aggregateHeaders,p,T.aggregateHeaders.splice(d)),T.aggregateHeaders.splice(p.length+d,1),d=p.length+d-1,h=T.aggregateHeaders.length);else if(T.aggregateHeaders[d].actualText!==T.value&&0<T.aggregateHeaders[d].members.length)for(c=T.aggregateHeaders[d].members.length,u=0;u<c;u++)if((k=T.aggregateHeaders[d].members[u]).actualText===T.value){T.uniqueName===T.aggregateHeaders[d].valueSort.levelName&&(T.uniqueName=k.valueSort.levelName),T.aggregateHeaders[d].members.splice(u,1),T.aggregateHeaders[d]=k;break}for(var g=o.length,m=this.dataSourceSettings.columns.length,f=this.valueSortSettings.headerText,y=0;y<g;y++){var v=!je(o[y].showSubTotals)&&!o[y].showSubTotals,b=(o[y].members.length&&this.getHeaderData(e,t,i,n,o[y].members,r,s,this.showSubTotalsAtTop&&!v?a+1:a,l),!0),v=(a=this.showSubTotalsAtTop?a:r.length,!v&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals?r[a]=Hdt.frameHeaderWithKeys(o[y]):(0<o[y].members.length?(this.removeCount++,b=!1):r[this.showSubTotalsAtTop?a:r.length]=Hdt.frameHeaderWithKeys(o[y]),a=this.showSubTotalsAtTop?a:r.length-1),o[y].level),w=(o[y].rowIndex=v,a*l+(this.showSubTotalsAtTop?1:l)),v=(o[y].colIndex=w,s[v]||(s[v]=[],this.headerContent[v]={}),s[v][w]=this.headerContent[v][w]=Hdt.getFormattedHeader(o[y],this),0===this.dataSourceSettings.columns.length&&1===this.dataSourceSettings.values.length);if((this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader||v)&&!this.valueAxis&&b)for(var C=0;C<l;C++){var S=this.dataSourceSettings.values[C].caption||this.dataSourceSettings.values[C].name,A={axis:"column",actualText:this.dataSourceSettings.values[C].name,formattedText:S,level:0,valueSort:{},colIndex:a*l+1+C,rowIndex:m},A=(s[m]||(s[m]=[],this.headerContent[m]={}),s[m][a*l+1+C]=this.headerContent[m][a*l+1+C]=A,s[m][a*l+1+C].valueSort);A[o[y].valueSort.levelName+this.valueSortSettings.headerDelimiter+S]=1,A.levelName=o[y].valueSort.levelName+this.valueSortSettings.headerDelimiter+S,A[o[y].valueSort.uniqueName+this.valueSortSettings.headerDelimiter+this.dataSourceSettings.values[C].name]=1,A.uniqueName=o[y].valueSort.uniqueName+this.valueSortSettings.headerDelimiter+this.dataSourceSettings.values[C].name,A&&A[f]&&(this.valueSortSettings.columnIndex=a*l+1+C)}else o[y].valueSort&&o[y].valueSort[f]&&(this.valueSortSettings.columnIndex=a*l+1);this.isPagingOrVirtualizationEnabled||(r[a].members=[]),this.showSubTotalsAtTop&&(a=r.length,0===o[y].level)&&y+1===g&&(this.reformAxisCount=r.length*l+1)}}else{var x,I=[];if(this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals&&"grand sum"===o[o.length-1].type?(this.updateValueMembers(0===this.measureIndex&&1<o.length,null,null,I,o.slice(0,o.length-1),l,0),this.updateValueMembers(!1,null,null,I,o.slice(o.length-1,o.length),l,-1)):"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&0===this.measureIndex?(this.updateValueMembers(!1,null,null,I,o.slice(0,1),l,-1),this.updateValueMembers(0===this.measureIndex&&1<o.length,null,null,I,o.slice(1,o.length),l,0)):(x=0===t.length&&1===o.length&&"grand sum"===o[0].type,this.updateValueMembers(!x&&0===this.measureIndex,null,null,I,o,l,x?-1:0)),this.getAggregatedHeaders(e,t,this.rMembers,I,i),0<this.selectedHeaders.values.length)for(var T,E=this.selectedHeaders.selectedHeader.length,D=0;D<E;D++)if("column"===(T=this.selectedHeaders.selectedHeader[D]).axis)if(T.uniqueName===T.value)this.selectedHeaders.selectedHeader.splice(D,1),D--,E--;else if("Grand Total"===T.uniqueName)for(var M=T.aggregateHeaders.length,d=0;d<M;d++)if(T.aggregateHeaders[d]&&0<T.aggregateHeaders[d].members.length)for(var k,P=0,B=T.aggregateHeaders[d].members;P<B.length;P++)(k=B[P]).actualText===T.value&&"grand sum"===(T.aggregateHeaders[d]=k).type&&(T.uniqueName=k.valueSort.levelName);this.frameDefinedHeaderData(I,r,s,0,this.showSubTotalsAtTop?0:1,l)}},Qdt.prototype.getAggregateValue=function(e,t,i,n,o){var r=0,s=0,a=0,l=!0,h=!1;switch(n.toLowerCase()){case"median":for(var d=[],p=0;void 0!==e[r];)void 0!==t[C=e[r]]&&(h=!0,this.rawIndexObject[C]=C,je(this.valueMatrix[C][i].member)||d.push(this.valueMatrix[C][i].member)),r++;0<(E=d.length)&&(d.sort(function(e,t){return e-t}),s=E%2==0?(d[p=E/2<=1?0:E/2-1]+d[p+1])/2:d[p=(E+1)/2<=1?0:(E+1)/2-1]);break;case"count":for(;void 0!==e[r];)void 0!==t[C=e[r]]&&(h=!0,this.rawIndexObject[C]=C,s+=je(this.valueMatrix[C][i].member)?0:this.allowDataCompression?this.valueMatrix[C][i].member:1),r++;break;case"distinctcount":for(var c=[];void 0!==e[r];)void 0!==t[e[r]]&&(this.rawIndexObject[e[r]]=e[r],h=!0,!je(m=this.data[e[r]][this.fieldKeys[this.fields[i]]]))&&(u=m.toString(),0===c.length||0<c.length&&-1===c.indexOf(u))&&(s+=this.allowDataCompression&&"number"==typeof m?m:1,c.push(u)),r++;break;case"product":for(;void 0!==e[r];)void 0!==t[C=e[r]]&&(this.rawIndexObject[C]=C,je(u=this.valueMatrix[C][i].member)?l&&(s=u):(s=l||je(s)?1:s,s*=u),l=!(h=!0)),r++;break;case"populationstdev":case"samplestdev":case"populationvar":case"samplevar":for(var u,g=0,m=0,f=[],p=0,y=0;void 0!==e[r];)void 0!==t[C=e[r]]&&(h=!0,this.rawIndexObject[C]=C,je(u=this.valueMatrix[C][i].member)||(m+=u,f.push(u),g++)),r++;if(0<g){for(var v=m/g,b=0,w=f;b<w.length;b++){var C=w[b];y+=Math.pow(C-v,2)}s=0===(p=-1!==["populationstdev","samplestdev"].indexOf(n.toLowerCase())?Math.sqrt(y/("populationstdev"===n.toLowerCase()?g:g-1)):y/("populationvar"===n.toLowerCase()?g:g-1))?NaN:p}else s=m;break;case"min":for(var S=!0,s=void 0;void 0!==e[r];)void 0!==t[C=e[r]]&&void 0!==this.valueMatrix[C][i].member&&(h=!0,this.rawIndexObject[C]=C,je(s)&&je(this.valueMatrix[C][i].member)?s=this.valueMatrix[C][i].member:S?(s=this.valueMatrix[C][i].member,S=!1):s=this.valueMatrix[C][i].member<s?this.valueMatrix[C][i].member:s),r++;break;case"max":for(var A=!0;void 0!==e[r];)void 0!==t[C=e[r]]&&void 0!==this.valueMatrix[C][i].member&&(h=!0,this.rawIndexObject[C]=C,A?(s=this.valueMatrix[C][i].member,A=!1):s=this.valueMatrix[C][i].member>s?this.valueMatrix[C][i].member:s),r++;break;case"calculatedfield":h=!0;var p=this.calculatedFields[this.fields[i]],x=p.formula,I={};if(this.calculatedFormulas[p.name])for(var T=this.calculatedFormulas[p.name],E=0,D=T.length;E<D;E++){var M,k=T[E],P=I[k.formula];void 0===P&&(M=k.type,P=this.getAggregateValue(e,t,k.index,M,!1),I[k.formula]=P),x=x.replace(k.formula,String(P))}s=(s=this.evaluate(x))===1/0||s===-1/0?1/0:void 0===s||isNaN(s)?void 0:JSON.parse(String(s));break;default:for(s=void 0;void 0!==e[r];)void 0!==t[C=e[r]]&&(h=!0,o||(this.rawIndexObject[C]=C),u=this.valueMatrix[C][i].member,je(s)&&je(u)?s=u:(je(s)&&(s=0),s+=je(u)?0:u),je(u)||a++),r++}return n&&"avg"===n.toLowerCase()&&0!==s&&!je(s)?s/a:h?s:void 0},Qdt.prototype.evaluate=function(e){return Function('"use strict";return ('+e+")")()},Qdt.prototype.getFormattedValue=function(e,t){var i=null===e?this.localeObj?this.localeObj.getConstant("null"):String(e):void 0===e?this.localeObj?t in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(e):e,n={formattedText:i.toString(),actualText:i,dateText:i};if(this.formatFields[t]&&(this.formatFields[t].format||this.formatFields[t].skeleton)&&!je(e))try{var o=Pe({},this.formatFields[t].properties||this.formatFields[t],null,!0);delete o.name,!o.minimumSignificantDigits&&o.minimumSignificantDigits<1&&delete o.minimumSignificantDigits,!o.maximumSignificantDigits&&o.maximumSignificantDigits<1&&delete o.maximumSignificantDigits,o.type?(n.formattedText=null===this.dateFormatFunction[t].exactFormat(new Date(e))?n.formattedText:this.dateFormatFunction[t].exactFormat(new Date(e)),n.actualText=e):(delete o.type,o.format&&!this.formatRegex.test(o.format)&&(je(o.minimumFractionDigits)&&delete o.minimumFractionDigits,je(o.maximumFractionDigits)&&delete o.maximumFractionDigits,je(o.minimumIntegerDigits))&&delete o.minimumIntegerDigits,n.formattedText=this.globalize.formatNumber(isNaN(Number(e))?e:Number(e),o),n.actualText=isNaN(Number(e))?e:Number(e),n.dateText=isNaN(Number(e))?e:Number(e)),"None"!==this.fieldList[t].sort&&o.type&&-1<["date","dateTime","time"].indexOf(this.formatFields[t].type)&&(n.dateText=this.dateFormatFunction[t].fullFormat(new Date(e))),this.fieldList[t].isCustomField&&(n.formattedText="NaN"===n.formattedText?i.toString():n.formattedText,n.dateText="NaN"===n.dateText?i.toString():n.dateText)}catch(e){if(!this.fieldList[t].isCustomField)throw e}finally{this.fieldList[t].isCustomField&&(n.formattedText=je(n.formattedText)||"NaN"===n.formattedText?i.toString():n.formattedText,n.dateText=je(n.dateText)||"NaN"===n.dateText?i.toString():n.dateText)}return n},Qdt.prototype.powerFunction=function(e){if(-1<e.indexOf("^")){for(var i=[];-1<e.indexOf("(");)e=e.replace(/(\([^()]*\))/g,function(e,t){return i.push(t),"~"+(i.length-1)});for(i.push(e),e="~"+(i.length-1);-1<e.indexOf("~");)e=e.replace(new RegExp("~(\\d+)","g"),function(e,t){return i[t].replace(/(\w*)\^(\w*)/g,"Math.pow($1,$2)")})}return e},Qdt.prototype.getTabularPivotValues=function(O,e){this.tabularPivotValues=[];var t=(this.emptyRowsLength=0)<Object.keys(this.groupingFields).length;"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&(this.rowMaxLevel=this.rowMaxLevel+1);for(var i=0;i<this.pivotValues.length;i++){for(var n=void 0,o=!1,r=!0,s=void 0,a=void 0;je(this.pivotValues[i])&&i<this.pivotValues.length;)this.tabularPivotValues.length++,i++;var l,h,d,p,c=(n=i<this.pivotValues.length?this.pivotValues[i]:n)[0]||void 0;if(c&&(s=c.valueSort.levelName.split(this.dataSourceSettings.valueSortSettings.headerDelimiter),this.dataSourceSettings.showSubTotals&&(!this.dataSourceSettings.showColumnSubTotals||this.dataSourceSettings.showRowSubTotals)||c.formattedText===this.localeObj.getConstant("grandTotal")||c.isSum&&(r=!1),t)&&(l=this.pivotValues[i-1][this.rowMaxLevel-1],h=this.tabularPivotValues[this.tabularPivotValues.length-1][this.rowMaxLevel-1],je(l)&&je(h)||(d=l.valueSort.axis,p=void 0,!je(h)&&h.valueSort.axis&&(p=h.valueSort.axis),a=(d.includes("custom_group")||p.includes("custom_group"))&&(l.formattedText===s[this.rowMaxLevel-1]&&l.formattedText!==s[s.length-1]||h&&h.formattedText===s[this.rowMaxLevel-1])?l.valueSort.axis||h.valueSort.axis:c.valueSort.axis)),c&&"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)){if("value"===c.type&&s.length-1!==this.rowMaxLevel&&s[0]!==this.localeObj.getConstant("grandTotal"))for(var u=0;u<this.dataSourceSettings.values.length;u++)if(c.formattedText===this.dataSourceSettings.values[u].name){c.hasChild=r=!1;break}s.length-1!==this.rowMaxLevel&&(c.isDrilled=!0,!c.hasChild&&!c.type||s[0]===this.localeObj.getConstant("grandTotal")&&"grand sum"===c.type)?c.hasChild=!0:c.level=s.length-1;for(var g=0;g<e.drilledMembers.length;g++)for(var m=e.drilledMembers[g].items,f=0;f<m.length;f++){var y=m[f].split(e.drilledMembers[g].delimiter),v=c.formattedText.split(" "),v=1<v.length?v.slice(0,v.length-1).join(" "):v[0];if(y[y.length-1]===v&&y[0]===s[0]){o=!0;break}}}if(je(c)||"row"!==c.axis){for(var b=[],w=this.rowMaxLevel+1,C=0;C<this.rowMaxLevel;C++)b.push(void 0);b.push(c);for(var S=n.slice(1,n.length),A=0;A<S.length;A++)S[A].colIndex=w,S[A].rowIndex=this.tabularPivotValues.length,w++;b=b.concat(S),this.tabularPivotValues.push(b)}else if(je(n[1])||c.hasChild&&c.isDrilled||!r)this.emptyRowsLength++;else{var x=[];if("row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&(O&&o?s.length-1<this.rowMaxLevel:s.length<=this.rowMaxLevel)&&"value"===c.type&&(this.dataSourceSettings.expandAll?!o:o)||s[0]===this.localeObj.getConstant("grandTotal")){for(var I=s.length-1;0<=I;I--){if(s[I]===s[s.length-2]){if(x[I]=s[s.length-2]+" "+s[s.length-1],0===I)break;for(;0<=I;)x[I-1]=s[I-1],I--;break}x[I]=s[s.length-2]+" "+s[s.length-1]}s=x}for(var T=c.colIndex,E=[],D=s[0],M=0,k=0;k<s.length-1||k<this.rowMaxLevel;k++){var P=void 0,B=void 0,F=c.isDrilled,L=c.hasChild;"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)?(B=P=!1,s[s.length-1]!==s[s.length-2]&&(k<(s.length-1===this.rowMaxLevel&&this.dataSourceSettings.rows.length===this.rowMaxLevel?s.length-2:s.length-1)&&(B=!0),k<s.length-2)&&(P=!0)):(k<this.rowMaxLevel&&(L=!0),(1<s.length||0===k)&&(F=!0)),k<s.length-1&&(0<k&&(D=D+this.dataSourceSettings.valueSortSettings.headerDelimiter+s[k]),E.push({actualText:s[k],axis:c.axis,formattedText:s[k],rowIndex:this.tabularPivotValues.length,hasChild:"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&"grand sum"!==c.type?B:L,isDrilled:"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&"grand sum"!==c.type?P:F,level:M,valueSort:{levelName:D,axis:t?a:this.dataSourceSettings.rows[k].name},colIndex:T++,colSpan:1,rowSpan:1})),k>=c.level&&(L=0===k?this.rowMaxLevel:this.rowMaxLevel-1,E.push({actualText:"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)?void 0===s[k]?s[s.length-1]:s[k]:c.formattedText,axis:c.axis,formattedText:"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)?void 0===s[k]?s[s.length-1]:s[k]:c.formattedText,rowIndex:this.tabularPivotValues.length,hasChild:"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&"grand sum"!==c.type?B:c.hasChild,isDrilled:"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&"grand sum"!==c.type?P:c.isDrilled,level:M,valueSort:{levelName:c.valueSort.levelName,axis:t?a:this.dataSourceSettings.rows[k].name},colIndex:T++,colSpan:L,rowSpan:1})),M++}c.colIndex=T,c.rowIndex=this.tabularPivotValues.length,c.colSpan=1,c.rowSpan=1,"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&(c.formattedText=s[s.length-1]),E.push(c),this.setColumnSpan(E,c);for(var S=n.slice(1,n.length),R=1;R<n.length;R++){var N=n[R];N.colIndex=T+1,N.rowIndex=this.tabularPivotValues.length,T++}E=E.concat(S),this.tabularPivotValues.push(E)}}return this.tabularPivotValues},Qdt.prototype.setColumnSpan=function(e,t){for(var i=1,n=e.length-1;0<=n;n--)if(0!==n&&e[n].formattedText===e[n-1].formattedText&&(e[n].colSpan=0,i++,e[n-1].colSpan=i),n<("row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)?e.length-2:e.length-1)&&("grand sum"!==t.type||t.isSum)&&e[e.length-1].formattedText!==e[e.length-2].formattedText&&"grand sum"!==t.type){e[n].hasChild=!0;for(var o=this.dataSourceSettings.drilledMembers,r=0;r<o.length;r++)for(var s=0;s<o[r].items.length;s++)o[r].items[s]===e[n].formattedText&&(e[n].isDrilled=!!e[n].isDrilled)}},Qdt.prototype.setRowSpan=function(){for(var e=this.headerContent.length,t=0;t<this.rowMaxLevel;t++){var i=1;if(this.tabularPivotValues.length>this.rowMaxLevel+e)for(var n=this.tabularPivotValues.length-1;e-1<=n;n--)if(n!==e-1){var o=this.tabularPivotValues;if(je(o[n-1]))break;je(o[n-1][t])||o[n][t].formattedText!==o[n-1][t].formattedText?i=1:(o[n][t].rowSpan=0,i++,o[n-1][t].rowSpan=i)}}},Qdt);function Qdt(){this.aggregatedValueMatrix=[],this.valueContent=[],this.formatFields={},this.groupingFieldsInfo={},this.dateFormatFunction={},this.calculatedFields={},this.calculatedFormulas={},this.valueAxis=0,this.saveDataHeaders={},this.columnCount=0,this.rowCount=0,this.columnPageCount=0,this.rowPageCount=0,this.colFirstLvl=0,this.rowFirstLvl=0,this.rowStartPos=0,this.colStartPos=0,this.enableValueSorting=!1,this.headerCollection={rowHeaders:[],columnHeaders:[],rowHeadersCount:0,columnHeadersCount:0},this.rMembers=[],this.cMembers=[],this.groupingFields={},this.isLastHeaderHasMeasures=!0,this.measureIndex=-1,this.isPagingOrVirtualizationEnabled=!1,this.rowMaxLevel=0,this.valueMatrix=[],this.memberCnt=-1,this.pageInLimit=!1,this.endPos=0,this.removeCount=0,this.colHdrBufferCalculated=!1,this.colValuesLength=1,this.rowValuesLength=1,this.slicedHeaders=[],this.fieldFilterMem={},this.filterPosObj={},this.selectedHeaders={selectedHeader:[],values:[]},this.rowGrandTotal=null,this.columnGrandTotal=null,this.removeRowGrandTotal=!1,this.removeColumnGrandTotal=!1,this.isValueHasAdvancedAggregate=!1,this.rawIndexObject={},this.reformAxisCount=0,this.isEditing=!1,this.valueAxisFields={},this.data=[],this.actualData=[],this.groupRawIndex={},this.fieldKeys={},this.allowDataCompression=!1,this.dataSourceSettings={},this.frameHeaderObjectsCollection=!1,this.headerObjectsCollection={},this.columnKeys={},this.fieldDrillCollection={},this.formatRegex=/^(?:[ncpae])(?:([0-9]|1[0-9]|20))?$/i,this.measureNames={},this.enablePaging=!1,this.enableVirtualization=!1,this.enableHtmlSanitizer=!1,this.enableOptimizedRendering=!1,this.groupedDataType={},this.emptyRowsLength=0,this.tabularPivotValues=[]}var Udt="enginePopulating",qdt="enginePopulated",Gdt="onFieldDropped",Ydt="fieldDrop",Xdt="beforeExport",Kdt="exportComplete",Jdt="excelHeaderQueryCellInfo",Zdt="pdfHeaderQueryCellInfo",$dt="excelQueryCellInfo",ept="pdfQueryCellInfo",tpt="onPdfCellRender",ipt="dataBound",npt="queryCellInfo",opt="headerCellInfo",rpt="hyperlinkCellClick",spt="resizeStop",apt="drillThrough",lpt="beforeColumnsRender",hpt="cellSelecting",dpt="drill",ppt="cellSelected",cpt="cellDeselected",upt="rowSelected",gpt="rowDeselected",mpt="beginDrillThrough",fpt="editCompleted",ypt="multiLevelLabelClick",vpt="saveReport",bpt="fetchReport",wpt="loadReport",Cpt="renameReport",Spt="removeReport",Apt="newReport",xpt="toolbarRender",Ipt="toolbarClick",Tpt="chartTooltipRender",Ept="chartLegendClick",Dpt="chartLoaded",Mpt="multiLevelLabelRender",kpt="beforePrint",Ppt="animationComplete",Bpt="legendRender",Fpt="textRender",Lpt="pointRender",Rpt="seriesRender",Opt="chartMouseMove",Npt="chartMouseClick",Vpt="chartMouseLeave",_pt="chartMouseDown",Hpt="chartMouseUp",zpt="dragComplete",jpt="zoomComplete",Wpt="scrollStart",Qpt="scrollChanged",Upt="chartResized",qpt="chartAxisLabelRender",Gpt="chartSeriesCreated",Ypt="aggregateCellInfo",Xpt="onHeadersSort",Kpt="contextMenuClick",Jpt="contextMenuOpen",Zpt="fieldListRefreshed",$pt="conditionalFormatting",ect="beforeExcelExport",tct="memberFiltering",ict="calculatedFieldCreate",nct="memberEditorOpen",oct="fieldRemove",rct="numberFormatting",sct="aggregateMenuOpen",act="fieldDragStart",lct="chartPointClick",hct="beforeServiceInvoke",dct="afterServiceInvoke",pct="actionBegin",cct="actionComplete",uct="actionFailure",gct="initial-load",mct="ui-update",fct="vertical-scroll",yct="horizontal-scroll",vct="content-ready",bct="data-ready",wct="init-groupingbar",Cct="tree-view-update",Sct="pivot-button-update",Act="init-calculatedfield",xct="init-toolbar",Ict="init-pivotPager",Tct="init-formatting",Ect="init-grouping",Dct="Sort value",Mct="Drill down",kct="Add new report",Pct="Save current report",Bct="Save as current report",Fct="Rename current report",Lct="Remove current report",Rct="Load report",Oct="Open conditional formatting dialog",Nct="Open number formatting dialog",Vct="Open field list",_ct="Show table view",Hct="Show chart view",zct="Multiple Axis",jct="Show legend",Wct="PDF export",Qct="PNG export",Uct="Excel export",qct="CSV export",Gct="JPEG export",Yct="SVG export",Xct="Hide sub-totals",Kct="Show row sub-totals",Jct="Show column sub-totals",Zct="Show sub-totals",$ct="Hide grand totals",eut="Show row grand totals",tut="Show column grand totals",iut="Show grand totals",nut="Number Formatting menu",out="Conditional Formatting menu",rut="Report change",sut="Sort field tree",aut="Edit calculated field",lut="Sort field",hut="Filter field",dut="Remove field",put="Open calculated field dialog",cut="Edit record",uut="Save edited records",gut="Add new record",mut="Remove record",fut="Aggregate field",yut="Window resize",vut="Navigate row page",but="Navigate column page",wut="Calculated field applied",Cut="Edited records saved",Sut="New record added",Aut="Record removed",xut="Field list closed",Iut="Field tree sorted",Tut="Report saved",Eut="New report added",Dut="Report re-saved",Mut="Report renamed",kut="Report removed",Put="Excel exported",But="CSV exported",Fut="PDF exported",Lut="PNG exported",Rut="JPEG exported",Out="SVG exported",Nut="Conditional formatting applied",Vut="Number formatting applied",_ut="Table view shown",Hut="Chart view shown",zut="Sub-totals hidden",jut="Row sub-totals shown",Wut="Column sub-totals shown",Qut="Sub-totals shown",Uut="Grand totals hidden",qut="Row grand totals shown",Gut="Column grand totals shown",Yut="Grand totals shown",Xut="Value sorted",Kut="Calculated field edited",Jut="Field sorted",Zut="Field filtered",$ut="Field removed",egt="Field aggregated",tgt="Record edited",igt="Report changed",ngt="Window resized",ogt="Records updated",rgt="Drill-through closed",sgt="Vertically scrolled",agt="Horizontally scrolled",lgt="Row page navigated",hgt="Column page navigated",dgt="Action dropped",pgt=(cgt.prototype.render=function(e,t){this.parentElement=t,this.openContextMenu(e)},cgt.prototype.openContextMenu=function(t){var i=this,e=t.target.parentElement.getAttribute("data-uid"),n=Hdt.getFieldInfo(e,this.parent),o=(this.buttonElement=t.target.parentElement,"number"!==this.parent.engineModule.fieldList[e].type?1:0),r=this.getMenuItem(o).slice();if(this.parent.actionObj.actionName=fut,this.parent.actionObj.fieldInfo=n.fieldItem,!this.parent.actionBeginMethod()){n={cancel:!1,fieldName:e,aggregateTypes:r,displayMenuCount:7},e="pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent;try{e.trigger(sct,n,function(e){e.cancel||(r=e.aggregateTypes,i.createContextMenu(o,r,e.displayMenuCount),i.currentMenu=t.target,e=i.currentMenu.getBoundingClientRect(),i.parent.enableRtl?i.menuInfo[o].open(e.top+(window.scrollY||document.documentElement.scrollTop),e.left-105):i.menuInfo[o].open(e.top+(window.scrollY||document.documentElement.scrollTop),e.left))})}catch(e){this.parent.actionFailureMethod(e)}}},cgt.prototype.createContextMenu=function(e,t,i){for(var n=this,o=[],r=(o[e]=[],this.menuInfo[e]&&!this.menuInfo[e].isDestroyed&&this.menuInfo[e].destroy(),[]),s=0;s<t.length;s++){var a=t[s];e?-1<this.stringAggregateTypes.indexOf(a)&&r.indexOf(a)<0&&(o[e].push({text:this.parent.localeObj.getConstant(a),id:this.parent.element.id+"StringMenu_"+a}),r.push(a)):-1<this.parent.getAllSummaryType().indexOf(a)&&r.indexOf(a)<0&&(o[e].push({text:this.parent.localeObj.getConstant(a),id:this.parent.element.id+"_"+a}),r.push(a))}o[e].length>i&&(o[e].splice(i),o[e].push({text:this.parent.localeObj.getConstant("MoreOption"),id:this.parent.element.id+"_MoreOption"}));var i={items:o[e],enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:this.parent.cssClass,beforeOpen:this.beforeMenuOpen.bind(this,e),onClose:function(){ge("#"+n.buttonElement.id,n.parentElement).focus()},select:this.selectOptionInContextMenu.bind(this)},l=document.getElementById(this.parent.element.id+(e?"valueFieldStringContextMenu":"valueFieldContextMenu"));null!==l?l.innerHTML="":l=Q("ul",{id:this.parent.element.id+(e?"valueFieldStringContextMenu":"valueFieldContextMenu")}),this.parent.element.appendChild(l),this.menuInfo[e]=new D4(i),this.menuInfo[e].isStringTemplate=!0,this.menuInfo[e].appendTo(l)},cgt.prototype.getMenuItem=function(e){for(var t=[],i=0;i<this.parent.aggregateTypes.length;i++){var n=this.parent.aggregateTypes[i];e?-1<this.stringAggregateTypes.indexOf(n)&&-1===t.indexOf(n)&&t.push(n):-1<this.parent.getAllSummaryType().indexOf(n)&&-1===t.indexOf(n)&&t.push(n)}return t},cgt.prototype.beforeMenuOpen=function(e,t){t.element.style.zIndex=(this.menuInfo[e].element.style.zIndex+3).toString(),t.element.style.display="inline"},cgt.prototype.createValueSettingsDialog=function(e,t,i){this.parentElement=t;var t=Q("div",{id:this.parentElement.id+"_ValueDialog",className:"e-value-field-settings",attrs:{"data-field":e.getAttribute("data-uid")?e.getAttribute("data-uid"):e.getAttribute("data-field")}}),n=(this.parentElement.appendChild(t),new pS({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("valueFieldSettings"),content:this.createFieldOptions(e,i),isModal:!0,visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"320px",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:this.updateValueSettings.bind(this),isFlat:!1,buttonModel:{cssClass:vlt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){n.hide()},isFlat:!1,buttonModel:{cssClass:blt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:"pivotfieldlist"!==this.parent.getModuleName()||"Popup"!==this.parent.renderMode,target:this.parentElement,close:this.removeDialog.bind(this),cssClass:this.parent.cssClass}));n.isStringTemplate=!0,n.appendTo(t)},cgt.prototype.createFieldOptions=function(e,t){for(var n=this,i=e.getAttribute("data-caption"),t=t&&"MoreOption"!==t?t:e.getAttribute("data-type"),o=e.getAttribute("data-basefield"),r=e.getAttribute("data-baseitem"),t="undefined"!==t.toString()?t:"Sum",s=[],a=this.parent.aggregateTypes,l=[],h=0;h<a.length;h++)-1<this.parent.getAllSummaryType().indexOf(a[h])&&l.indexOf(a[h])<0&&(s.push({value:a[h],text:this.parent.localeObj.getConstant(a[h])}),l.push(a[h]));for(var d,p,c=["DifferenceFrom","PercentageOfDifferenceFrom"],u=["DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"],g=(g=Pe([],this.parent.dataSourceSettings.rows,null,!0)).concat(this.parent.dataSourceSettings.columns),m=[],f=[],y=0,v=g;y<v.length;y++){var b=v[y],O=b.name,b=b.caption||b.name;m.push({value:O,text:b})}f=0===Object.keys(m).length?(m.push({value:"",text:""}),o="",[]):(d="undefined"!==(o=o&&"undefined"!==o.toString()&&"null"!==o.toString()?o:m[0].value).toString()?o:m[0].value,p=Hdt.isDateField(d,this.parent.engineModule),this.parent.engineModule.fieldList[d].dateMember.map(function(e){return(p?e:n.parent.engineModule.getFormattedValue(e.actualText,d)).formattedText}));var r="undefined"!==r.toString()?r:f[0],g=Q("div",{className:"e-value-field-div-content",id:this.parentElement.id+"_field_div_content",attrs:{"data-type":t,"data-caption":i,"data-basefield":o,"data-baseitem":r}}),w=Q("div",{className:"e-field-name-text-container"}),C=Q("div",{className:"e-field-option-container"}),S=Q("div",{className:"e-type-option-container"}),A=Q("div",{className:"e-base-field-option-container"}),x=Q("div",{className:"e-base-item-option-container"}),I=Q("div",{className:"e-field-name-title"}),T=(I.innerText=this.parent.localeObj.getConstant("sourceName")+" ",Q("div",{className:"e-field-name-content"})),e=(T.innerText=this.parent.enableHtmlSanitizer?go.sanitize(e.getAttribute("data-uid")?e.getAttribute("data-uid"):e.getAttribute("data-field")):e.getAttribute("data-uid")?e.getAttribute("data-uid"):e.getAttribute("data-field"),this.buttonElement=this.buttonElement||document.getElementsByClassName(T.innerText)[0],Q("div",{className:"e-type-option-text"})),E=(e.innerText=this.parent.localeObj.getConstant("sourceCaption"),Q("div",{className:"e-base-field-option-text"})),D=(E.innerText=this.parent.localeObj.getConstant("summarizeValuesBy"),Q("div",{className:"e-base-item-option-text"})),M=(D.innerText=this.parent.localeObj.getConstant("baseField"),Q("div",{className:"e-type-option-text"})),k=(M.innerText=this.parent.localeObj.getConstant("baseItem"),Q("div",{className:"e-caption-input-container"})),P=Q("div",{id:this.parentElement.id+"_type_option"}),B=Q("div",{id:this.parentElement.id+"_base_field_option"}),F=Q("div",{id:this.parentElement.id+"_base_item_option"}),N=Q("input",{id:this.parentElement.id+"type_input_option",className:"e-caption-input-text",attrs:{type:"text"}}),V=(w.appendChild(I),w.appendChild(T),k.appendChild(e),k.appendChild(N),S.appendChild(E),A.appendChild(D),x.appendChild(M),S.appendChild(P),A.appendChild(B),x.appendChild(F),C.appendChild(w),C.appendChild(k),C.appendChild(S),C.appendChild(A),C.appendChild(x),g.appendChild(C),this),I=new qz({dataSource:s,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:t,cssClass:Glt+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){L.enabled=-1!==u.indexOf(e.value),R.enabled=-1!==c.indexOf(e.value),R.enabled&&1===R.dataSource.length&&(R.dataSource=f,R.dataBind())}}),L=(I.isStringTemplate=!0,I.appendTo(P),new qz({dataSource:m,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:o,enabled:-1!==u.indexOf(t),cssClass:Glt+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(t){var i=Hdt.isDateField(t.value,n.parent.engineModule);f=V.parent.engineModule.fieldList[t.value].dateMember.map(function(e){return(i?e:n.parent.engineModule.getFormattedValue(e.actualText,t.value)).formattedText}),R.dataSource=f,R.value=f[0],R.filterBarPlaceholder=V.parent.localeObj.getConstant("example")+" "+f[0],R.itemData=null,R.dataBind()}})),R=(L.isStringTemplate=!0,L.appendTo(B),new qz({dataSource:f,enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:r,allowFiltering:!0,filterBarPlaceholder:this.parent.localeObj.getConstant("example")+" "+f[0],enabled:-1!==c.indexOf(t),cssClass:Ylt+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%"})),T=(R.isStringTemplate=!0,R.appendTo(F),new LR({placeholder:"Enter field caption",enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:i,width:"100%",cssClass:this.parent.cssClass}));return T.isStringTemplate=!0,T.appendTo(N),g},cgt.prototype.selectOptionInContextMenu=function(e){if(null!==e.item.text){var t=this.currentMenu.parentElement,i=Hdt.getFieldInfo(t?t.getAttribute("data-uid"):"",this.parent);if(this.parent.actionObj.actionName=fut,this.parent.actionObj.fieldInfo=i.fieldItem,!this.parent.actionBeginMethod()){var n=e.item.id.split("_").pop();try{if("MoreOption"===n||"PercentageOfDifferenceFrom"===n||"PercentageOfParentTotal"===n||"DifferenceFrom"===n)this.createValueSettingsDialog(t,this.parentElement,n);else{var o=t.getAttribute("data-uid"),r=this.parent.dataSourceSettings.values,s=t.querySelector("."+$at),a=e.item.text+" "+this.parent.localeObj.getConstant("of")+" "+this.parent.engineModule.fieldList[o].caption,a=this.parent.enableHtmlSanitizer?go.sanitize(a):a;this.parent.dataSourceSettings.showAggregationOnValueField&&(s.innerText=a),s.setAttribute("title",a),t.setAttribute("data-type",n);for(var l,h=0;h<this.parent.dataSourceSettings.values.length;h++)this.parent.dataSourceSettings.values[h].name===o&&((l=Pe({},r[h].properties||r[h],null,!0)).type=n,this.parent.engineModule.fieldList[o].aggregateType=n,r.splice(h,1,l),this.parent.lastAggregationInfo=l);this.updateDataSource()}}catch(e){this.parent.actionFailureMethod(e)}}}},cgt.prototype.updateDataSource=function(e){!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotview"===this.parent.getModuleName()||this.parent.isAdaptive&&"pivotfieldlist"===this.parent.getModuleName()&&"Popup"===this.parent.renderMode?this.parent.updateDataSource(e):"pivotfieldlist"===this.parent.getModuleName()&&"Popup"===this.parent.renderMode?(this.parent.pivotGridModule.setProperties({dataSourceSettings:this.parent.dataSourceSettings.properties},!0),this.parent.pivotGridModule.notify(mct,this),this.parent.pivotGridModule.engineModule=this.parent.engineModule):this.parent.triggerPopulateEvent()},cgt.prototype.updateValueSettings=function(){var e,t,i=K(ge("#"+this.parentElement.id+"_ValueDialog",document),pS),n=i.element,o=K(ge("#"+this.parentElement.id+"type_input_option"),LR),r=K(ge("#"+this.parentElement.id+"_type_option"),qz),s=K(ge("#"+this.parentElement.id+"_base_field_option"),qz),a=K(ge("#"+this.parentElement.id+"_base_item_option"),qz),n=n.getAttribute("data-field"),l=((e=this.parentElement.querySelector("."+Jat)?this.parentElement.getElementsByClassName(Jat+" "+n.replace(/[^A-Z0-9]/gi,""))[0]:e)&&(l=e.querySelector("."+$at),t=this.parent.dataSourceSettings.showAggregationOnValueField?this.parent.localeObj.getConstant(r.value)+" "+this.parent.localeObj.getConstant("of")+" "+o.value:o.value,t=this.parent.enableHtmlSanitizer?go.sanitize(t):t,l.innerText=t,l.setAttribute("title",t),e.setAttribute("data-type",r.value),e.setAttribute("data-caption",o.value),e.setAttribute("data-basefield",s.value),e.setAttribute("data-baseitem",a.value)),Hdt.getFieldByName(n,this.parent.dataSourceSettings.values));(l=l.properties||l).caption=o.value,l.type=r.value,l.baseField=s.value,l.baseItem=a.value,this.parent.engineModule.fieldList[n].aggregateType=l.type,i.close(),this.parent.lastAggregationInfo=l,this.updateDataSource(!0)},cgt.prototype.removeDialog=function(){this.buttonElement&&ge("#"+this.buttonElement.id,this.parentElement)&&ge("#"+this.buttonElement.id,this.parentElement).focus();var e=ge("#"+this.parentElement.id+"_ValueDialog",document),e=e?K(e,pS):null;e&&!e.isDestroyed&&e.destroy(),document.getElementById(this.parentElement.id+"_ValueDialog")&&ue(document.getElementById(this.parentElement.id+"_ValueDialog"))},cgt.prototype.destroy=function(){this.parent.isDestroyed||this.menuInfo&&(void 0===this.menuInfo[1]||this.menuInfo[1].isDestroyed||this.menuInfo[1].destroy(),void 0===this.menuInfo[0]||this.menuInfo[0].isDestroyed||this.menuInfo[0].destroy())},cgt);function cgt(e){this.menuInfo=[],this.stringAggregateTypes=["Count","DistinctCount"],this.parent=e}ggt.prototype.render=function(e){e&&this.initProperties(),this.resColWidth=this.parent.isTabular?this.gridSettings.columnWidth:this.parent.showGroupingBar&&this.parent.groupingBarModule?this.parent.isAdaptive?180:250:this.parent.isAdaptive?140:200,this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.gridSettings=this.parent.gridSettings,this.formatList=this.getFormatList(),this.parent.gridCellCollection={},this.injectGridModules(this.parent),this.rowStartPos=this.getRowStartPos(),this.parent.grid&&this.parent.grid.element&&this.parent.element.querySelector("."+Mht)?(this.parent.notEmpty=!0,this.engine.isEngineUpdated?"olap"!==this.parent.dataType&&(this.parent.isTabular&&(this.engine.headerContent=this.frameDataSource("header")),this.parent.enableValueSorting||this.parent.isTabular)&&(this.engine.valueContent=this.frameDataSource("value")):(this.engine.headerContent=this.frameDataSource("header"),this.engine.valueContent=this.frameDataSource("value")),this.engine.isEngineUpdated=!1,e=this.parent.isTabular?this.parent.engineModule.rowMaxLevel+1:1,this.parent.grid.setProperties({frozenColumns:e,columns:this.frameStackedHeaders(),dataSource:("olap"===this.parent.dataType&&""!==this.parent.dataSourceSettings.url||this.parent.dataSourceSettings.dataSource&&0<this.parent.engineModule.data.length&&0<this.parent.dataSourceSettings.values.length)&&!this.engine.isEmptyData?this.frameGridDataSource(this.engine.valueContent):this.frameDataSource("value")},!0),this.parent.grid.notify("datasource-modified",{}),this.parent.isScrolling&&(this.parent.resizeInfo={}),this.parent.grid.width=this.calculateGridWidth(),this.parent.grid.refreshColumns(),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+Tlt)&&this.parent.groupingBarModule.setGridRowWidth(),this.isAutoFitEnabled?this.addPivotAutoFitClass():this.removePivotAutoFitClass(),!this.gridSettings.allowAutoResizing&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+Tlt)&&this.parent.groupingBarModule.refreshUI(),this.parent.isScrolling||this.calculateGridHeight(!0)):(this.parent.element.innerHTML="",this.bindGrid(this.parent,!!this.engine.isEmptyData),e=Q("div",{id:this.parent.element.id+"_grid"}),this.parent.element.appendChild(e),this.parent.grid.isStringTemplate=!0,this.parent.grid.appendTo(e)),this.parent.grid.on(tx,this.refreshHeader,this)},ggt.prototype.initProperties=function(){this.rowStartPos=void 0,this.maxIndent=void 0,this.resColWidth=void 0,this.isOverflows=void 0,this.indentCollection={},this.formatList=void 0,this.colPos=0,this.colGrandPos=void 0,this.rowGrandPos=void 0,this.lastSpan=0,this.field=void 0,this.fieldCaption=void 0,this.lvlCollection={},this.hierarchyCollection={},this.lvlPosCollection={},this.hierarchyPosCollection={},this.position=0,this.measurePos=0,this.maxMeasurePos=0,this.hierarchyCount=0,this.actualText="",this.timeOutObj=void 0},ggt.prototype.refreshHeader=function(){var e,t,i,n=this.parent.element.querySelector("."+qht);this.parent.enableVirtualization&&!je(n)&&(e=z(n,"."+rdt).querySelector("."+Uht),t=this.parent.element.querySelector("."+Yht),i=n.querySelector("."+Qht),this.parent.virtualHeaderDiv=t.querySelector("."+Qht),t.querySelector("."+Qht)?ue(t.querySelector("."+Qht)):this.parent.virtualHeaderDiv=Q("div",{className:Qht}),t.appendChild(this.parent.virtualHeaderDiv),i&&gt(this.parent.virtualHeaderDiv,{height:0,width:i.style.width}),t.querySelector("."+tht)&&(gt(t.querySelector("."+tht),{transform:n.querySelector("."+tht).style.transform.split(",")[0]+",0px)"}),i=parseInt(t.querySelector("."+tht).style.transform.split("(")[1].split(",")[0].split("px")[0],10),this.parent.enableRtl?this.parent.element.querySelector("."+Bdt).style.right=Number(i)+"px":this.parent.element.querySelector("."+Bdt).style.left=Number(-i)+"px"),i=this.parent.isAdaptive?n:e&&"none"!==e.style.display?e:n.parentElement,t.scrollLeft=i.scrollLeft)},ggt.prototype.bindGrid=function(e,t){this.injectGridModules(e),this.parent.grid=new IP({cssClass:this.parent.cssClass,frozenColumns:1,frozenRows:0,enableHover:!1,dataSource:t?this.frameEmptyData():this.frameDataSource("value"),columns:t?this.frameEmptyColumns():this.frameStackedHeaders(),height:t?"auto":this.calculateGridHeight(),width:t?this.gridSettings.allowAutoResizing?this.parent.width:400:this.calculateGridWidth(),locale:e.locale,enableRtl:e.enableRtl,allowExcelExport:e.allowExcelExport,allowPdfExport:e.allowPdfExport,allowResizing:this.gridSettings.allowResizing,allowTextWrap:this.gridSettings.allowTextWrap,clipMode:this.gridSettings.clipMode,allowReordering:this.gridSettings.allowReordering,allowSelection:this.gridSettings.allowSelection,contextMenuItems:this.gridSettings.contextMenuItems,selectedRowIndex:this.gridSettings.selectedRowIndex,selectionSettings:this.gridSettings.selectionSettings,textWrapSettings:this.gridSettings.textWrapSettings,printMode:this.gridSettings.printMode,rowHeight:this.gridSettings.rowHeight,gridLines:this.gridSettings.gridLines,contextMenuClick:this.contextMenuClick.bind(this),contextMenuOpen:this.contextMenuOpen.bind(this),beforeCopy:this.gridSettings.beforeCopy?this.gridSettings.beforeCopy.bind(this.parent):void 0,beforePrint:this.gridSettings.beforePrint?this.gridSettings.beforePrint.bind(this.parent):void 0,printComplete:this.gridSettings.printComplete?this.gridSettings.printComplete.bind(this.parent):void 0,rowSelecting:this.gridSettings.rowSelecting?this.gridSettings.rowSelecting.bind(this.parent):void 0,rowSelected:this.rowSelected.bind(this),rowDeselecting:this.gridSettings.rowDeselecting?this.gridSettings.rowDeselecting.bind(this.parent):void 0,rowDeselected:this.rowDeselected.bind(this),cellSelecting:this.cellSelecting.bind(this),cellSelected:this.cellSelected.bind(this),cellDeselecting:this.gridSettings.cellDeselecting?this.gridSettings.cellDeselecting.bind(this.parent):void 0,cellDeselected:this.cellDeselected.bind(this),resizeStart:this.gridSettings.resizeStart?this.gridSettings.resizeStart.bind(this.parent):void 0,columnDragStart:this.gridSettings.columnDragStart?this.gridSettings.columnDragStart.bind(this):void 0,columnDrag:this.gridSettings.columnDrag?this.gridSettings.columnDrag.bind(this):void 0,columnDrop:this.gridSettings.columnDrop?this.gridSettings.columnDrop.bind(this):void 0,beforeExcelExport:this.beforeExcelExport.bind(this),resizing:this.setGroupWidth.bind(this),resizeStop:this.onResizeStop.bind(this),queryCellInfo:this.queryCellInfo.bind(this),dataBound:this.dataBound.bind(this),headerCellInfo:this.headerCellInfo.bind(this),excelHeaderQueryCellInfo:this.excelHeaderQueryCellInfo.bind(this),pdfHeaderQueryCellInfo:this.pdfHeaderQueryCellInfo.bind(this),excelQueryCellInfo:this.excelQueryCellInfo.bind(this),pdfQueryCellInfo:this.pdfQueryCellInfo.bind(this),beforePdfExport:this.gridSettings.beforePdfExport?this.gridSettings.beforePdfExport.bind(this):void 0,pdfExportComplete:this.pdfExportComplete.bind(this),excelExportComplete:this.excelExportComplete.bind(this),actionComplete:this.actionComplete.bind(this)}),this.parent.grid.on("header-refreshed",this.headerRefreshed.bind(this)),this.parent.grid.on("export-DataBound",this.excelDataBound.bind(this))},ggt.prototype.actionComplete=function(e){e&&"refresh"===e.requestType&&this.isAutoFitEnabled&&this.removePivotAutoFitClass()},ggt.prototype.addPivotAutoFitClass=function(){document.body.classList.contains(kht)||document.body.classList.add(kht),document.body.classList.contains(Ndt)||document.body.classList.add(Ndt)},ggt.prototype.removePivotAutoFitClass=function(){document.body.classList.contains(kht)&&document.body.classList.remove(kht),document.body.classList.contains(Ndt)&&document.body.classList.remove(Ndt)},ggt.prototype.headerRefreshed=function(){var e=this.parent.element.querySelector("."+Yht);this.parent.lastGridSettings&&-1<Object.keys(this.parent.lastGridSettings).indexOf("allowResizing")&&!je(e)&&e.querySelector("."+tht)&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+Tlt)&&(this.parent.lastGridSettings=void 0,this.parent.groupingBarModule.setGridRowWidth())},ggt.prototype.beforeExcelExport=function(e){je(e.gridObject.columns)||je(this.parent.pivotColumns)||(e.gridObject.columns[e.gridObject.columns.length-1].width=this.parent.pivotColumns[this.parent.pivotColumns.length-1].width),this.parent.trigger(ect,e)},ggt.prototype.rowSelected=function(e){this.parent.renderModule.selected(),this.parent.trigger(upt,e)},ggt.prototype.rowDeselected=function(e){this.parent.renderModule.selected(),this.parent.trigger(gpt,e)},ggt.prototype.cellSelected=function(e){this.parent.rowRangeSelection.enable?(this.parent.grid.selectionModule.selectRowsByRange(this.parent.rowRangeSelection.startIndex,this.parent.rowRangeSelection.endIndex),this.parent.rowRangeSelection.enable=!1):(this.parent.renderModule.selected(),this.parent.trigger("selected",e))},ggt.prototype.cellSelecting=function(e){var t=this.parent.grid.selectionModule.actualTarget;je(t)||!t.classList.contains("e-expand")&&!t.classList.contains("e-collapse")||(e.cancel=!0),this.parent.trigger("selecting",e)},ggt.prototype.cellDeselected=function(e){this.parent.renderModule.selected(),this.parent.trigger(cpt,e)},ggt.prototype.queryCellInfo=function(e){this.parent.renderModule.rowCellBoundEvent(e)},ggt.prototype.headerCellInfo=function(e){this.parent.renderModule.columnCellBoundEvent(e)},ggt.prototype.excelHeaderQueryCellInfo=function(e){this.parent.renderModule.excelColumnEvent(e)},ggt.prototype.pdfQueryCellInfo=function(e){this.parent.renderModule.pdfRowEvent(e)},ggt.prototype.excelQueryCellInfo=function(e){this.parent.renderModule.excelRowEvent(e)},ggt.prototype.pdfHeaderQueryCellInfo=function(e){this.parent.renderModule.pdfColumnEvent(e)},ggt.prototype.pdfExportComplete=function(e){void 0!==this.parent.lastColumn&&this.parent.lastColumn&&"auto"!==this.parent.lastColumn.width&&(this.parent.lastColumn.width="auto",this.parent.lastColumn=void 0);e={type:"PDF",promise:e.promise};this.parent.trigger(Kdt,e)},ggt.prototype.excelExportComplete=function(e){void 0!==this.parent.lastColumn&&this.parent.lastColumn&&"auto"!==this.parent.lastColumn.width&&(this.parent.lastColumn.width="auto",this.parent.lastColumn=void 0);e={type:"Excel/CSV",promise:e.promise};this.parent.trigger(Kdt,e)},ggt.prototype.dataBound=function(){this.parent.notEmpty&&this.calculateGridHeight(!0),this.parent.isScrolling=!1,this.setFocusOnLastCell(),je(this.parent.renderReactTemplates)||this.parent.renderReactTemplates(),this.parent.isInitial&&(this.parent.isInitial=!1,this.parent.refreshData(),this.parent.enableVirtualization)&&this.parent.onContentReady(),this.parent.notify(vct,{})},ggt.prototype.setFocusOnLastCell=function(){var e;this.parent.keyboardModule&&this.parent.keyboardModule.event&&"TD"===this.parent.keyboardModule.event.target.nodeName&&((e=this.parent.grid.serviceLocator.getService("focus")).setFocusedElement(this.parent.keyboardModule.event.target),e.focus(this.parent.keyboardModule.event),U([this.parent.keyboardModule.event.target],["e-focused","e-focus"]),this.parent.keyboardModule.event.target.setAttribute("tabindex","0"),this.parent.keyboardModule.event=void 0)},ggt.prototype.getCellElement=function(e){var t=z(e,"td");return t=je(t)?z(e,"th"):t},ggt.prototype.contextMenuOpen=function(y){for(var v=this,b=(y.element&&this.parent.cssClass&&U([y.element.parentElement],this.parent.cssClass),this),e=0,t=y.items;e<t.length;e++){var i=function(r){var e=b.parent.lastCellClicked||(b.parent.isAdaptive?y.event.target:b.parent.lastCellClicked),s=b.getCellElement(e),t=void 0,i=void 0;if(!s||0===Number(s.getAttribute("index"))&&parseInt(s.getAttribute("aria-colindex"),10)-1==0)return y.cancel=!0,{value:void 0};(s.classList.contains("e-valuesheader")||s.classList.contains("e-stot"))&&(t=!0),b.parent.allowGrouping&&b.parent.groupingModule&&!b.validateField(s)&&(i=!0);var a,e=Number(s.getAttribute("index")),n=parseInt(s.getAttribute("aria-colindex"),10)-1,o=b.parent.pivotValues[e][n];switch(r.id){case b.parent.element.id+"_expand":0<s.querySelectorAll("."+eht).length?(ct("#"+b.parent.element.id+"_expand",y.element)&&ge("#"+b.parent.element.id+"_expand",y.element).classList.add(Bht),ge("#"+b.parent.element.id+"_expand",y.element).classList.contains(Bht)&&ge("#"+b.parent.element.id+"_expand",y.element).classList.remove(Bht),ge("#"+b.parent.element.id+"_expand",y.element).classList.contains(Fht)&&(ge("#"+b.parent.element.id+"_expand",y.element).classList.remove(Fht),ge("#"+b.parent.element.id+"_collapse",y.element).classList.remove(Fht))):t?ge("#"+b.parent.element.id+"_expand",y.element).classList.add(Fht):ge("#"+b.parent.element.id+"_expand",y.element).classList.add(Bht);break;case b.parent.element.id+"_collapse":0<s.querySelectorAll("."+$lt).length?(ge("#"+b.parent.element.id+"_expand",y.element)&&ge("#"+b.parent.element.id+"_expand",y.element).classList.add(Bht),ge("#"+b.parent.element.id+"_collapse",y.element).classList.contains(Bht)&&ge("#"+b.parent.element.id+"_collapse",y.element).classList.remove(Bht),ge("#"+b.parent.element.id+"_collapse",y.element).classList.contains(Fht)&&(ge("#"+b.parent.element.id+"_collapse",y.element).classList.remove(Fht),ge("#"+b.parent.element.id+"_expand",y.element).classList.remove(Fht))):t?ge("#"+b.parent.element.id+"_collapse",y.element).classList.add(Fht):ge("#"+b.parent.element.id+"_collapse",y.element).classList.add(Bht);break;case b.parent.element.id+"_custom_group":i||2!==y.items.length||(y.cancel=!0),ct("#"+b.parent.element.id+"_custom_group",y.element)&&U([ge("#"+b.parent.element.id+"_custom_group",y.element)],Fht),i&&ct("#"+b.parent.element.id+"_custom_group",y.element)&&q([ge("#"+b.parent.element.id+"_custom_group",y.element)],Fht);break;case b.parent.element.id+"_custom_ungroup":if(ct("#"+b.parent.element.id+"_custom_ungroup",y.element)&&U([ge("#"+b.parent.element.id+"_custom_ungroup",y.element)],Fht),i){var l=!1,h=s.getAttribute("fieldname"),d=Hdt.getFieldByName(h,b.parent.dataSourceSettings.groupSettings);if(d&&"Custom"===d.type||b.parent.engineModule.fieldList[h].isCustomField&&-1<h.indexOf("_custom_group")){if(d=Hdt.getFieldByName(h.replace("_custom_group",""),b.parent.dataSourceSettings.groupSettings))for(var p=b.parent.engineModule.pivotValues[Number(s.getAttribute("index"))][parseInt(s.getAttribute("aria-colindex"),10)-1],c=b.parent.groupingModule.getSelectedCells(p.axis,h,p.actualText.toString()),u=(c.push({axis:p.axis,fieldName:h,name:p.actualText.toString(),cellInfo:p}),b.parent.groupingModule.getSelectedOptions(c)),g=0,m=d.customGroups;g<m.length;g++){var f=m[g];if(-1<u.indexOf(f.groupName)){l=!0;break}}}else(d&&("Date"===d.type||"Number"===d.type)||b.parent.engineModule.fieldList[h].isCustomField&&-1<h.indexOf("_date_group"))&&(l=!0);ct("#"+b.parent.element.id+"_custom_ungroup",y.element)&&l&&q([ge("#"+b.parent.element.id+"_custom_ungroup",y.element)],Fht)}break;case b.parent.element.id+"_drillthrough":b.parent.allowDrillThrough?s.classList.contains("e-summary")?ge("#"+b.parent.element.id+"_drillthrough",y.element).classList.contains(Bht)&&ge("#"+b.parent.element.id+"_drillthrough",y.element).classList.remove(Bht):""===s.innerText&&ge("#"+b.parent.element.id+"_drillthrough",y.element)&&ge("#"+b.parent.element.id+"_drillthrough",y.element).classList.add(Bht):ge("#"+b.parent.element.id+"_drillthrough",y.element)&&ge("#"+b.parent.element.id+"_drillthrough",y.element).classList.add(Bht);break;case b.parent.element.id+"_sortasc":b.parent.enableValueSorting?0<s.querySelectorAll(".e-icon-descending").length?(ge("#"+b.parent.element.id+"_sortdesc",y.element)?ge("#"+b.parent.element.id+"_sortdesc",y.element).classList.add(Bht):ge("#"+b.parent.element.id+"_sortdesc",y.element).classList.remove(Bht),ge("#"+b.parent.element.id+"_sortasc",y.element).classList.contains(Bht)&&ge("#"+b.parent.element.id+"_sortasc",y.element).classList.remove(Bht)):ge("#"+b.parent.element.id+"_sortdesc",y.element).classList.contains(Bht)&&ge("#"+b.parent.element.id+"_sortdesc",y.element).classList.remove(Bht):ge("#"+b.parent.element.id+"_sortasc",y.element)&&ge("#"+b.parent.element.id+"_sortasc",y.element).classList.add(Bht);break;case b.parent.element.id+"_sortdesc":b.parent.enableValueSorting?0<s.querySelectorAll(".e-icon-ascending").length?(ge("#"+b.parent.element.id+"_sortasc",y.element)?ge("#"+b.parent.element.id+"_sortasc",y.element).classList.add(Bht):ge("#"+b.parent.element.id+"_sortasc",y.element).classList.remove(Bht),ge("#"+b.parent.element.id+"_sortdesc",y.element).classList.contains(Bht)&&ge("#"+b.parent.element.id+"_sortdesc",y.element).classList.remove(Bht)):ge("#"+b.parent.element.id+"_sortasc",y.element).classList.contains(Bht)&&ge("#"+b.parent.element.id+"_sortasc",y.element).classList.remove(Bht):ge("#"+b.parent.element.id+"_sortdesc",y.element)&&ge("#"+b.parent.element.id+"_sortdesc",y.element).classList.add(Bht);break;case b.parent.element.id+"_CalculatedField":b.parent.allowCalculatedField||ge("#"+b.parent.element.id+"_CalculatedField",y.element).classList.add(Bht);break;case b.parent.element.id+"_pdf":b.parent.allowPdfExport||ge("#"+b.parent.element.id+"_pdf",y.element).classList.add(Bht);break;case b.parent.element.id+"_excel":b.parent.allowExcelExport||ge("#"+b.parent.element.id+"_excel",y.element).classList.add(Bht);break;case b.parent.element.id+"_csv":b.parent.allowExcelExport||ge("#"+b.parent.element.id+"_csv",y.element).classList.add(Bht);break;case b.parent.element.id+"_exporting":b.parent.allowExcelExport||b.parent.allowPdfExport||ge("#"+b.parent.element.id+"_exporting",y.element).classList.add(Bht);break;case b.parent.element.id+"_aggregate":ge("#"+b.parent.element.id+"_aggregate",y.element)&&!ge("#"+b.parent.element.id+"_aggregate",y.element).classList.contains(Bht)&&ge("#"+b.parent.element.id+"_aggregate",y.element).classList.add(Bht),(s.classList.contains("e-valuesheader")||s.classList.contains("e-valuescontent")||s.classList.contains("e-stot")&&s.classList.contains("e-rowsheader"))&&"olap"!==b.parent.dataType&&(""!==s.innerText&&(a=b.parent.engineModule.fieldList[o.actualText.toString()].type),p={cancel:!1,fieldName:o.actualText.toString(),aggregateTypes:b.getMenuItem(a).slice(),displayMenuCount:7},b.parent.trigger(sct,p,function(e){if(!e.cancel&&""!==s.innerText){for(var t=[],i=[],n=0;n<e.aggregateTypes.length;n++){var o=e.aggregateTypes[n];"number"!==a?-1<["Count","DistinctCount"].indexOf(o)&&i.indexOf(o)<0&&(t.push({text:v.parent.localeObj.getConstant(o),id:v.parent.element.id+"_Agg"+o}),i.push(o)):-1<v.parent.getAllSummaryType().indexOf(o)&&i.indexOf(o)<0&&(t.push({text:v.parent.localeObj.getConstant(o),id:v.parent.element.id+"_Agg"+o}),i.push(o))}t.length>e.displayMenuCount&&(t.splice(e.displayMenuCount),t.push({text:v.parent.localeObj.getConstant("MoreOption"),id:v.parent.element.id+"_AggMoreOption"})),t&&1<=t.length&&(r.items=t,ge("#"+v.parent.element.id+"_aggregate",y.element).classList.remove(Bht))}}))}}(t[e]);if("object"==typeof i)return i.value}this.parent.trigger(Jpt,y)},ggt.prototype.getMenuItem=function(e){for(var t=[],i=0;i<this.parent.aggregateTypes.length;i++){var n=this.parent.aggregateTypes[i];"string"!==e?-1<this.parent.getAllSummaryType().indexOf(n)&&-1===t.indexOf(n)&&t.push(n):-1<["Count","DistinctCount"].indexOf(n)&&-1===t.indexOf(n)&&t.push(n)}return t},ggt.prototype.contextMenuClick=function(e){var t,i=this,n=this.parent.lastCellClicked,o=e.item.id,r=this.getCellElement(n),n=Number(r.getAttribute("index")),s=parseInt(r.getAttribute("aria-colindex"),10)-1,a=this.parent.pivotValues[n][s];switch(-1<e.item.id.indexOf(this.parent.element.id+"_Agg")&&(this.field=this.parent.engineModule.fieldList[a.actualText.toString()].id,this.fieldCaption=this.parent.engineModule.fieldList[a.actualText.toString()].caption,t=e.item.id.split("_Agg")[1]),o){case this.parent.element.id+"_pdf":this.parent.trigger(Xdt,{pdfDoc:void 0,isBlob:!1,isMultipleExport:!1,pdfExportProperties:{fileName:"Export.pdf"}},function(e){i.parent.pdfExport(e.pdfExportProperties,e.isMultipleExport,e.pdfDoc,e.isBlob)});break;case this.parent.element.id+"_excel":this.parent.trigger(Xdt,{isBlob:!1,isMultipleExport:!1,workbook:void 0,excelExportProperties:{fileName:"Export.xlsx"}},function(e){i.parent.excelExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"_csv":this.parent.trigger(Xdt,{isBlob:!1,workbook:void 0,isMultipleExport:!1,excelExportProperties:{fileName:"Export.csv"}},function(e){i.parent.csvExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"_drillthrough_menu":var l=new MouseEvent("dblclick",{view:window,bubbles:!0,cancelable:!0});r.dispatchEvent(l);break;case this.parent.element.id+"_sortasc":this.parent.setProperties({dataSourceSettings:{valueSortSettings:{headerText:a.valueSort.levelName,headerDelimiter:this.parent.dataSourceSettings.valueSortSettings.headerDelimiter}}}),this.parent.dataSourceSettings.valueSortSettings.sortOrder="Ascending";break;case this.parent.element.id+"_sortdesc":this.parent.setProperties({dataSourceSettings:{valueSortSettings:{headerText:a.valueSort.levelName,headerDelimiter:this.parent.dataSourceSettings.valueSortSettings.headerDelimiter}}}),this.parent.dataSourceSettings.valueSortSettings.sortOrder="Descending";break;case this.parent.element.id+"_expand":r.querySelectorAll("."+eht)&&(l=r.querySelectorAll("."+eht)[0],this.parent.onDrill(l));break;case this.parent.element.id+"_collapse":r.querySelectorAll("."+$lt)&&(l=r.querySelectorAll("."+$lt)[0],this.parent.onDrill(l));break;case this.parent.element.id+"_CalculatedField":this.parent.calculatedFieldModule.createCalculatedFieldDialog();break;case this.parent.element.id+"_AggMoreOption":case this.parent.element.id+"_AggDifferenceFrom":case this.parent.element.id+"_AggPercentageOfDifferenceFrom":case this.parent.element.id+"_AggPercentageOfParentTotal":r.setAttribute("id",this.field),r.setAttribute("data-caption",this.fieldCaption),r.setAttribute("data-field",this.field),r.setAttribute("data-type",this.engine.fieldList[a.actualText.toString()].aggregateType),r.setAttribute("data-basefield",this.engine.fieldList[a.actualText.toString()].baseField),r.setAttribute("data-baseItem",this.engine.fieldList[a.actualText.toString()].baseItem),this.aggMenu.createValueSettingsDialog(r,this.parent.element,t);break;case this.parent.element.id+"_Agg"+t:this.updateAggregate(t);break;case this.parent.element.id+"_custom_group":case this.parent.element.id+"_custom_ungroup":this.parent.groupingModule&&(l={target:r,option:o,parentElement:this.parent.element},this.parent.notify(Ect,l),this.parent.grid.contextMenuModule.contextMenu.close())}this.parent.trigger(Kpt,e)},ggt.prototype.validateColumnTotalcell=function(e){for(var t=Object.keys(this.engine.headerContent),i=!1,n="",o=t.length-1;0<=o;o--){var r=this.engine.headerContent[Number(t[o])][e];if(!r)return!1;if(i=!(!i||""===n)&&n===r.valueSort.axis,n=r.valueSort.axis?r.valueSort.axis.toString():"",(i="sum"===r.type?!0:i)&&r.members&&0<r.members.length)return!0}return!1},ggt.prototype.validateField=function(e){var t=!1;if(e.classList.contains("e-stot")||e.classList.contains("e-gtot")||e.classList.contains("e-valuescontent")||e.classList.contains("e-valuesheader"))t=!0;else for(var i,n=e.getAttribute("fieldName"),o=(n&&""!==n||(i=Number(e.getAttribute("index")),e=parseInt(e.getAttribute("aria-colindex"),10)-1,n=this.engine.pivotValues[i][e].actualText),this.parent.dataSourceSettings.values),r=0;r<o.length;r++)if(this.parent.dataSourceSettings.values[r].name===n){t=!0;break}return t},ggt.prototype.updateAggregate=function(e){if(-1<this.parent.getAllSummaryType().indexOf(e))for(var t=this.parent.dataSourceSettings.values,i=0;i<this.parent.dataSourceSettings.values.length;i++)this.parent.dataSourceSettings.values[i].name===this.field&&(t[i].type=e)},ggt.prototype.injectGridModules=function(e){IP.Inject(xK),e.allowExcelExport&&IP.Inject(pK),e.allowPdfExport&&IP.Inject(uK),IP.Inject(hk,QG,jG),this.gridSettings.contextMenuItems&&IP.Inject(SK)},ggt.prototype.updateGridSettings=function(){var e;this.injectGridModules(this.parent),this.parent.grid.allowResizing=this.gridSettings.allowResizing,this.parent.grid.clipMode=this.gridSettings.clipMode,this.parent.grid.allowTextWrap=this.gridSettings.allowTextWrap,this.parent.grid.allowReordering=this.gridSettings.allowReordering,this.parent.grid.allowSelection=this.gridSettings.allowSelection,this.parent.grid.contextMenuItems=this.gridSettings.contextMenuItems,this.parent.grid.selectedRowIndex=this.gridSettings.selectedRowIndex,this.parent.grid.selectionSettings=this.gridSettings.selectionSettings,this.parent.grid.textWrapSettings=this.gridSettings.textWrapSettings,this.parent.grid.printMode=this.gridSettings.printMode,this.parent.grid.rowHeight=this.gridSettings.rowHeight,this.parent.grid.gridLines=this.gridSettings.gridLines,this.parent.lastGridSettings&&(-1<(e=Object.keys(this.parent.lastGridSettings)).indexOf("height")&&(this.parent.grid.height=this.gridSettings.height),-1<e.indexOf("width")&&(this.parent.grid.width=this.gridSettings.width),this.updatePivotColumns(),-1<e.indexOf("allowTextWrap")||-1<e.indexOf("clipMode"))&&this.parent.layoutRefresh(),this.clearColumnSelection()},ggt.prototype.updatePivotColumns=function(){for(var e=Object.keys(this.parent.lastGridSettings),t=0;t<this.parent.pivotColumns.length;t++)for(var i=this.parent.pivotColumns[t],n=0;n<e.length;n++){var o=e[n];je(this.parent.pivotColumns[t][o])||(i[o]=this.parent.lastGridSettings[o])}this.parent.fillGridColumns(this.parent.grid.columns)},ggt.prototype.clearColumnSelection=function(){q(this.parent.element.querySelectorAll("."+tdt),[tdt,Kht])},ggt.prototype.appendValueSortIcon=function(e,t,i,n,o){var r,s,a="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,l=this.parent.dataSourceSettings.valueSortSettings;return this.parent.enableValueSorting&&l&&""!==l.headerText&&(r="grand sum"===e.type&&1===this.parent.dataSourceSettings.values.length&&!this.parent.dataSourceSettings.alwaysShowValueHeader||!(1<this.parent.dataSourceSettings.values.length||this.parent.dataSourceSettings.alwaysShowValueHeader)&&0===this.parent.dataSourceSettings.columns.length?0:a.headerContent.length-1,s=l&&l.headerText?e.valueSort.levelName===l.headerText:n===l.columnIndex,void 0!==l)&&s&&(i===r||i+1===r&&-1<e.level&&a.headerContent[i+1][n]&&-1===a.headerContent[i+1][n].level)&&"column"===this.parent.dataSourceSettings.valueAxis&&t.querySelector("div div").appendChild(Q("span",{className:("Descending"===l.sortOrder?"e-icon-descending e-icons e-descending e-sortfilterdiv e-value-sort-icon":"e-icon-ascending e-icons e-ascending e-sortfilterdiv e-value-sort-icon")+(e.hasChild?" e-value-sort-align":""),styles:"Right"===o.headerTextAlign?"float : left":""})),t},ggt.prototype.onResizeStop=function(e){var t;e.column.columns&&0<e.column.columns.length?this.getChildColumnWidth(e.column.columns):(t=this.parent.isTabular?e.column.index<this.parent.engineModule.rowMaxLevel+1?e.column.index+".formattedText":""+e.column.customAttributes.cell.valueSort.levelName:"0.formattedText"===e.column.field?"0.formattedText":""+e.column.customAttributes.cell.valueSort.levelName,this.parent.resizeInfo[t]=Number(e.column.width.toString().split("px")[0])),this.parent.enableVirtualization&&"0.formattedText"===e.column.field&&(1<this.parent.dataSourceSettings.values.length&&!je(this.parent.grid.columns[this.parent.grid.columns.length-1].columns)?(t=this.parent.grid.columns[this.parent.grid.columns.length-1].columns)[t.length-1].minWidth=this.parent.gridSettings.columnWidth:this.parent.grid.columns[this.parent.grid.columns.length-1].minWidth=this.parent.gridSettings.columnWidth,this.parent.layoutRefresh()),this.setGroupWidth(e),this.calculateGridHeight(!0),this.parent.grid.hideScroll()},ggt.prototype.getChildColumnWidth=function(e){for(var t=0,i=e;t<i.length;t++){var n,o=i[t];o.columns&&0<o.columns.length?this.getChildColumnWidth(o.columns):(n=o.customAttributes.cell.valueSort.levelName,this.parent.resizeInfo[n]=Number(o.width.toString().split("px")[0]))}},ggt.prototype.setGroupWidth=function(e){var t;this.parent.enableVirtualization&&"0.formattedText"===e.column.field&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+Tlt)&&Number(e.column.width.toString().split("px")[0])<250&&(e.cancel=!0),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+Tlt)&&(this.parent.groupingBarModule.refreshUI(),this.parent.element.querySelector(".e-group-row").offsetWidth<245&&!this.parent.firstColWidth&&(e.cancel=!0,(t=this.parent.grid.columns)&&0<t.length&&(t[0].width=this.resColWidth),this.parent.element.querySelector("."+Zht).querySelector("col").style.width=this.resColWidth+"px",this.parent.element.querySelector("."+Zat).querySelector("col").style.width=this.resColWidth+"px"),this.parent.element.querySelector(".e-group-rows").style.height="auto",this.parent.element.querySelector(".e-group-values").style.width=this.parent.element.querySelector(".e-group-row").offsetWidth+"px",t=this.parent.element.querySelector("."+Zht).offsetHeight,this.parent.element.querySelector(".e-group-rows").style.height=t+"px"),e.cancel&&(t="0.formattedText"===e.column.field?"0.formattedText":e.column.customAttributes.cell.valueSort.levelName,this.parent.resizeInfo[t]=Number(e.column.width.toString().split("px")[0]),this.parent.enableVirtualization)&&this.parent.layoutRefresh(),this.parent.enableVirtualization&&(this.parent.resizedValue=e.cancel||"0.formattedText"!==e.column.field?this.parent.resizedValue:Number(e.column.width.toString().split("px")[0])),this.parent.trigger("touchend"===e.e.type||"mouseup"===e.e.type?spt:"resizing",e)},ggt.prototype.selected=function(){clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.onSelect.bind(this),300)},ggt.prototype.onSelect=function(){for(var e={selectedCellsInfo:[],pivotValues:this.parent.pivotValues,currentCell:null},t=this.parent.element.querySelectorAll("."+Xht+",."+Kht),i=0;i<t.length;i++){var n=t[i],o=parseInt(n.getAttribute("aria-colindex"),10)-1,n=Number(n.getAttribute("index")),n=this.engine.pivotValues[n][o];n&&("value"===n.axis?e.selectedCellsInfo.push({currentCell:n,value:n.value,columnHeaders:n.columnHeaders,rowHeaders:n.rowHeaders,measure:n.actualText.toString()}):"column"===n.axis?e.selectedCellsInfo.push({currentCell:n,value:n.formattedText,columnHeaders:n.valueSort.levelName,rowHeaders:"",measure:""}):e.selectedCellsInfo.push({currentCell:n,value:n.formattedText,columnHeaders:"",rowHeaders:n.valueSort.levelName,measure:""}))}this.parent.trigger(ppt,e)},ggt.prototype.rowCellBoundEvent=function(e){var t=e.cell,i=Q("div",{className:"e-pivotrow-container"});if(t&&this.parent.notEmpty&&this.engine.headerContent){var n=this.parent.hyperlinkSettings.cssClass,o=parseInt(t.getAttribute("aria-colindex"),10)-1,r=this.parent.isTabular?o.toString():"0",r=e.data[Number(r)],s=r.valueSort&&r.valueSort.levelName===(0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis&&this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+r.formattedText),a=(t.setAttribute("index",r.rowIndex?r.rowIndex.toString():"0"),this.parent.pivotValues[r.rowIndex]&&this.parent.pivotValues[r.rowIndex][o]?this.parent.pivotValues[r.rowIndex][o]:null);if(o<=(this.parent.isTabular?this.parent.engineModule.rowMaxLevel:0)){if("pivot"===this.parent.dataType){var l=r.type&&"value"===r.type,h=(t.innerText="",r.valueSort?r.valueSort.levelName.toString():""),d=r.actualText?r.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,d=h.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(d&&d-1),p=d?d-1:0;if("Bottom"!==this.parent.dataSourceSettings.subTotalsPosition||je(h)||(y=r.isSum?"value"===r.type?h.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+(this.parent.engineModule.valueAxisFields[r.actualText].caption||this.parent.engineModule.valueAxisFields[r.actualText].name))[0]:"":h,r.isSum&&("value"!==r.type||this.drilledLevelInfo[y])?p-=1:r.isSum||(1===y.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length&&(this.drilledLevelInfo={}),r.members&&0<r.members.length&&(this.drilledLevelInfo[y]=r.isDrilled))),!this.parent.isTabular){for(;0<p&&i.appendChild(Q("span",{className:0===p?"":lht})),-1<--p;);p=d?d-1:0,this.lastSpan=d?this.lastSpan:0,!r.hasChild&&0<(l?0:p)&&i.appendChild(Q("span",{className:hht}))}var c=void 0;if(0<this.parent.dataSourceSettings.rows.length&&(!r.valueSort||0<Object.keys(r.valueSort).length)){if(l)for(var u=0,g=this.parent.dataSourceSettings.values;u<g.length;u++){var m=g[u],f=m.caption||m.name;if(-1<h.indexOf(f)){c=m.name;break}}else c=-1<r.level&&this.parent.dataSourceSettings.rows[r.level]?this.parent.dataSourceSettings.rows[r.level].name:"";t.setAttribute("fieldname",c)}}else i=this.onOlapRowCellBoundEvent(t,i,r);var y=r.formattedText,l=(r.type&&("grand sum"===r.type?(this.rowGrandPos=r.rowIndex,t.classList.add("e-gtot"),d=this.parent.dataSourceSettings.values,y=je(r.valueSort.axis)?0===this.parent.dataSourceSettings.rows.length&&1===d.length&&"row"===this.parent.dataSourceSettings.valueAxis?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(d[d.length-1].type)+" "+this.parent.localeObj.getConstant("of")+" "+(je(d[d.length-1].caption)?d[d.length-1].name:d[d.length-1].caption):this.parent.localeObj.getConstant("grandTotal"):r.formattedText):r.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+r.formattedText?(t.classList.add("e-gtot"),y=s?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[r.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+r.formattedText:y):"sum"===r.type&&3!==r.memberType?y=r.formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total"):t.classList.add("e-stot")),this.parent.isTabular?(this.setSpanAttributes("rowspan",r.rowSpan,t),this.setSpanAttributes("colspan",r.colSpan,t)):t.classList.add(nht),!0!==r.hasChild||r.isNamedSet||i.appendChild(Q("div",{className:(!0===r.isDrilled?$lt:eht)+" "+Tat,attrs:{title:!0===r.isDrilled?this.parent.localeObj.getConstant("collapse"):this.parent.localeObj.getConstant("expand")}})),i.appendChild(Q("span",{className:rht,innerHTML:this.parent.isRowCellHyperlink||r.enableHyperlink?'<a  data-url="'+y+'" class="e-hyperlinkcell '+n+'">'+y+"</a>":y})),this.parent.pivotView.dataSourceSettings.valueSortSettings);this.parent.enableValueSorting&&l&&l.headerText&&"row"===this.parent.dataSourceSettings.valueAxis&&this.parent.pivotValues[Number(t.getAttribute("index"))][0]&&this.parent.pivotValues[Number(t.getAttribute("index"))][0].valueSort.levelName&&this.parent.pivotValues[Number(t.getAttribute("index"))][0].valueSort.levelName===l.headerText&&i.appendChild(Q("span",{className:("Descending"===l.sortOrder?"e-icon-descending e-icons e-descending e-sortfilterdiv e-value-sort-icon":"e-icon-ascending e-icons e-ascending e-sortfilterdiv e-value-sort-icon")+(r.hasChild?" e-value-sort-align":""),styles:"right"===i.style.textAlign?"float: left":""})),t.appendChild(i)}else{d=t.innerText,y=(t.innerText="",t.classList.add("e-valuescontent"),(r=je(r=e.data[o])?e.column.customAttributes.cell:r).isGrandSum=!!s||r.isGrandSum,r.isSum&&t.classList.add("e-summary"),je(r.isGrandSum)&&!je(this.parent.olapEngineModule)&&"column"===this.parent.olapEngineModule.olapValueAxis&&"olap"===this.parent.dataType&&this.colGrandPos-this.parent.dataSourceSettings.values.length<o);r.isGrandSum||y||this.colGrandPos===o||this.rowGrandPos===Number(t.getAttribute("index"))?t.classList.add("e-gtot"):("olap"===this.parent.dataType?r.isSum:this.validateColumnTotalcell(r.colIndex))&&t.classList.add("e-colstot"),a&&a.cssClass&&t.classList.add(a.cssClass),t.appendChild(Q("span",{className:rht,innerHTML:-1!==t.className.indexOf("e-summary")&&this.parent.isSummaryCellHyperlink||-1===t.className.indexOf("e-summary")&&this.parent.isValueCellHyperlink||r.enableHyperlink?'<a data-url="'+d+'" class="e-hyperlinkcell '+n+'">'+d+"</a>":d})),this.parent.gridSettings.allowReordering&&t.setAttribute("aria-colindex",(e.column.customAttributes?e.column.customAttributes.cell.colIndex:e.column.index).toString())}this.parent.cellTemplate&&this.appendTemplate(t,a),this.unWireEvents(t),this.wireEvents(t)}e.pivotview=this.parent,this.parent.trigger(npt,e)},ggt.prototype.appendTemplate=function(e,t){var i,t=this.parent.getCellTemplate()({targetCell:e,cellInfo:t},this.parent,"cellTemplate",this.parent.element.id+"_cellTemplate",null,null,e);t&&""!==t&&0<t.length&&(this.parent.enableHtmlSanitizer?this.parent.isVue||this.parent.isVue3?((i=Q("div")).innerHTML=go.sanitize(t),ht([i.firstChild],e)):this.parent.appendHtml(e,go.sanitize(t[0].outerHTML)):this.parent.isVue||this.parent.isVue3?ht(t,e):this.parent.appendHtml(e,t[0].outerHTML))},ggt.prototype.onOlapRowCellBoundEvent=function(e,t,i){e.innerText="";var n=this.engine.rowMeasurePos;if(this.parent.enableVirtualization){if(-1<i.ordinal&&0<this.parent.olapEngineModule.tupRowInfo.length){for(var o=this.parent.olapEngineModule.tupRowInfo[i.ordinal],r=(3===i.memberType?this.engine.fieldList[i.actualText.toString()].tag:i.actualText).toString(),r=o.uNameCollection.indexOf(r),s=(o.uNameCollection.substring(0,r)+(3===i.memberType?"":i.actualText.toString())).split("::[").map(function(e){return"["===e[0]?e:"["+e}),a=(3===i.memberType&&n&&s.push(i.actualText.toString()),-1),l=0,h=!1,d=0;d<s.length;d++){a+=s[d].split("~~").length;var p="2"!==o.typeCollection[d]&&(!!(this.engine.fieldList[o.members[d].getAttribute("Hierarchy")]&&this.engine.fieldList[o.members[d].getAttribute("Hierarchy")].isHierarchy&&d<this.parent.dataSourceSettings.rows.length-1&&!this.parent.dataSourceSettings.rows[d+1].isNamedSet&&this.parent.dataSourceSettings.rows[d+1].name.indexOf("[Measures]")<0&&this.engine.fieldList[this.parent.dataSourceSettings.rows[d+1].name]&&this.engine.fieldList[this.parent.dataSourceSettings.rows[d+1].name].hasAllMember)||0<Number(o.members[d].querySelector("CHILDREN_CARDINALITY").textContent));l+=0<d&&h&&!p?1:0,h=p}for(var c=0,u=0;u<a;u++)t.appendChild(Q("span",{className:lht})),c++;for(u=0;u<l&&0<a;u++)t.appendChild(Q("span",{className:hht}));this.indentCollection[i.rowIndex]=c,this.maxIndent=this.maxIndent>c?this.maxIndent:c}}else{var r=i.hierarchy,g=i.valueSort?i.valueSort.levelName.toString():"",g=-1===i.level?this.measurePos:g.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-1,g=3===i.memberType?g+"."+i.levelUniqueName:i.levelUniqueName,p=i.hasChild,m=!1;if(i.isSum&&3===i.memberType){for(var f=this.lvlCollection[i.parentUniqueName].position,y=f+1;y<this.position;y++)delete this.lvlCollection[this.lvlPosCollection[y]],delete this.lvlPosCollection[y];this.position=this.position>f+1?f+1:this.position,m=!0,this.measurePos=this.lvlCollection[i.parentUniqueName].position}if(!this.lvlCollection[g]&&g)this.lvlPosCollection[this.position]=g,this.lvlCollection[g]={position:this.position,hasChild:p},this.position++;else if(g){for(var f=this.lvlCollection[g].position,v=f+1;v<this.position;v++)delete this.lvlCollection[this.lvlPosCollection[v]],delete this.lvlPosCollection[v];this.position=this.position>f+1?f+1:this.position}if(!this.hierarchyCollection[r]&&r)this.hierarchyPosCollection[this.hierarchyCount]=r,this.hierarchyCollection[r]={lvlPosition:this.position-1,hierarchyPOs:this.hierarchyCount},this.hierarchyCount++;else if(r){for(f=this.hierarchyCollection[r].hierarchyPOs,v=f+1;v<this.hierarchyCount;v++)delete this.hierarchyCollection[this.hierarchyPosCollection[v]],delete this.hierarchyPosCollection[v];this.hierarchyCount=this.hierarchyCount>f+1?f+1:this.hierarchyCount}3!==i.memberType&&g&&this.lvlCollection[g]&&(f=this.hierarchyCollection[r]?this.hierarchyCollection[r].hierarchyPOs:-1,this.measurePos=n<=f&&this.hierarchyPosCollection[n+1]?this.measurePos:this.lvlCollection[g].position);for(var b=this.lvlCollection[g]?this.lvlCollection[g].position:-1,b=m?b-1:b,w=0,c=0;w<=b&&0<b&&-1<i.level;){var C=this.lvlCollection[this.lvlPosCollection[w]].hasChild;(h=0<w&&this.lvlCollection[this.lvlPosCollection[w-1]].hasChild)&&!C&&t.appendChild(Q("span",{className:hht})),w!==b&&(t.appendChild(Q("span",{className:lht})),c++),w++}"Top"!==this.parent.dataSourceSettings.grandTotalsPosition||je(this.parent.olapEngineModule)||"row"!==this.parent.olapEngineModule.olapValueAxis||"olap"!==this.parent.dataType||0!==i.valueSort.levelName.toString().indexOf(this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter)||t.appendChild(Q("span",{className:lht})),3===i.memberType&&-1===i.level&&1<Object.keys(this.lvlCollection).length&&(t.appendChild(Q("span",{className:lht})),c++),this.indentCollection[i.rowIndex]=c,this.maxIndent=this.maxIndent>c?this.maxIndent:c}return t.setAttribute("fieldname",i.hierarchy),e.setAttribute("fieldname",i.hierarchy),!this.parent.olapEngineModule.tupRowInfo[i.ordinal]||(0===this.parent.olapEngineModule.tupRowInfo[i.ordinal].measurePosition?1!==this.parent.olapEngineModule.tupRowInfo[i.ordinal].allStartPos:0!==this.parent.olapEngineModule.tupRowInfo[i.ordinal].allStartPos)||e.classList.add("e-gtot"),t},ggt.prototype.columnCellBoundEvent=function(e){if(e.cell.column&&e.cell.column.customAttributes){var t=e.cell.column.customAttributes.cell,i=e.node;if(t){for(var n=this.parent.hyperlinkSettings.cssClass,o=!1,r=0,s=this.parent.dataSourceSettings.values;r<s.length;r++){var a=s[r];a.name===t.actualText&&(o=!0,i.setAttribute("fieldname",a.name))}-1===t.level&&!t.rowSpan||-1===t.rowSpan?e.node.style.display="none":1<t.rowSpan&&(e.node.setAttribute("rowspan",t.rowSpan.toString()),e.node.setAttribute("aria-rowspan",t.rowSpan.toString()),t.rowIndex+t.rowSpan===this.engine.headerContent.length)&&(e.node.style.borderBottomWidth="0px"),e.node.setAttribute("aria-colindex",(t.colIndex+1).toString()),e.node.setAttribute("index",t.rowIndex.toString());"pivot"===this.parent.dataType?(!o&&!(this.parent.dataSourceSettings.values&&"column"===this.parent.dataSourceSettings.valueAxis&&1<this.parent.dataSourceSettings.values.length&&o&&t.rowIndex===this.engine.headerContent.length-1)&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length&&(d=-1<t.level&&this.parent.dataSourceSettings.columns[t.level]?this.parent.dataSourceSettings.columns[t.level].name:"",i.setAttribute("fieldname",d)),this.validateColumnTotalcell(t.colIndex)&&i.classList.add("e-colstot")):i=this.onOlapColumnCellBoundEvent(i,t);for(var l,h,d=0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis&&t.valueSort&&t.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+t.formattedText,p=((t.type||d)&&(i.classList.add("grand sum"===t.type?"e-gtot":"e-stot"),"grand sum"===t.type?this.colGrandPos=t.colIndex:t.type&&i.classList.add("e-colstot"),h="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,u="grand sum"===t.type?je(t.valueSort.axis)||"olap"===this.parent.dataType?this.parent.localeObj.getConstant("grandTotal"):t.formattedText:t.formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total"),u=d&&h.fieldList?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(h.fieldList[t.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+t.formattedText:u,null!==i.querySelector(".e-headertext")?i.querySelector(".e-headertext").innerText=u:i.querySelector(".e-stackedheadercelldiv").innerText=u),i.classList.add(iht),(this.parent.isColumnCellHyperlink||t.enableHyperlink)&&(i.querySelector(".e-stackedheadercelldiv")?(l=i.querySelector(".e-stackedheadercelldiv").innerText,i.querySelector(".e-stackedheadercelldiv").innerHTML='<a data-url="'+l+'" class="e-hyperlinkcell '+n+'">'+l+"</a>"):i.querySelector(".e-headertext")&&(l=i.querySelector(".e-headertext").innerText,i.querySelector(".e-headertext").innerHTML='<a data-url="'+l+'" class="e-hyperlinkcell '+n+'">'+l+"</a>")),!0!==t.hasChild||t.isNamedSet?this.updateWrapper(i):((d=i.querySelector(".e-headercelldiv"))&&(d.style.height="auto",d.style.lineHeight="normal"),h=Q("div",{className:(!0===t.isDrilled?$lt:eht)+" "+Tat,attrs:{title:!0===t.isDrilled?this.parent.localeObj.getConstant("collapse"):this.parent.localeObj.getConstant("expand")}}),-1<window.navigator.userAgent.indexOf("Edge")||-1<window.navigator.userAgent.indexOf("Trident")?i.children[0].style.display="table":i.children[0].style.display="block",this.updateWrapper(i,h)),i=this.appendValueSortIcon(t,i,t.rowIndex,t.colIndex,e.cell.column),this.parent.cellTemplate&&this.appendTemplate(i,t),this.parent.dataSourceSettings.values.length),c=0;c<p;c++)this.parent.dataSourceSettings.values[c].name===t.actualText&&("olap"===this.parent.dataType&&this.parent.olapEngineModule.tupColumnInfo[t.ordinal]&&(0===this.parent.olapEngineModule.tupColumnInfo[t.ordinal].measurePosition?1===this.parent.olapEngineModule.tupColumnInfo[t.ordinal].allStartPos:0===this.parent.olapEngineModule.tupColumnInfo[t.ordinal].allStartPos)&&i.classList.add("e-gtot"),t.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+t.formattedText||t.valueSort.levelName==="Grand Total"+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+t.formattedText?i.classList.add("e-gtot"):i.classList.add("e-valuesheader"));this.unWireEvents(i),this.wireEvents(i)}}else{var u;this.parent.isTabular&&(u=this.parent.engineModule.rowMaxLevel+1,e.cell&&e.cell.column&&0===e.cell.column.index?(e.node.setAttribute("colspan",u.toString()),e.node.classList.add(_dt)):e.node.style.display="none")}this.parent.trigger(opt,e)},ggt.prototype.updateWrapper=function(e,t){var i,n;return(0<e.querySelectorAll(".e-headercelldiv").length||0<e.querySelectorAll(".e-stackedheadercelldiv").length)&&(i=Q("div",{className:"e-pivotcell-container"}),n=Q("div",{className:(t?"e-stackedheadertext":"e-headertext")+" "+rht,innerHTML:(0<e.querySelectorAll(".e-headercelldiv").length?e.querySelector(".e-headercelldiv"):e.querySelector(".e-stackedheadercelldiv")).innerHTML}),t&&i.append(t),i.append(n),e.children[0].innerHTML="",e.children[0].append(i)),e},ggt.prototype.onOlapColumnCellBoundEvent=function(e,t){e.setAttribute("fieldname",3===t.memberType?t.actualText.toString():t.hierarchy);var i=this.engine.headerContent[t.rowIndex]?this.engine.headerContent[t.rowIndex][t.colIndex-1]:void 0;return i&&i.actualText===t.actualText&&i.type===t.type&&1<i.colSpan&&(e.style.display="none"),t.rowIndex===this.engine.headerContent.length-1&&2===t.memberType&&(e.style.display=this.isSpannedCell(this.engine.headerContent.length,t)?"none":e.style.display),e},ggt.prototype.isSpannedCell=function(e,t){for(var i,n,o=this.engine.headerContent[t.rowIndex-1]?this.engine.headerContent[t.rowIndex-1][t.colIndex]:void 0;o&&(o.memberType===t.memberType||o.type&&t.type);)0<o.rowSpan&&(i=o.rowSpan,n=o.rowIndex),o=this.engine.headerContent[o.rowIndex-1]?this.engine.headerContent[o.rowIndex-1][t.colIndex]:void 0;return e<=n+i},ggt.prototype.onHyperCellClick=function(e){var t=e.target.closest("td.e-rowcell")?e.target.closest("td.e-rowcell"):e.target.closest("th"),i={currentCell:t,data:this.engine.pivotValues[Number(t.getAttribute("index"))][parseInt(t.getAttribute("aria-colindex"),10)-1],cancel:!0,nativeEvent:e};this.parent.trigger(rpt,i,function(e){e.cancel||(i.currentCell=H(i.currentCell),e=(i.currentCell.getAttribute("data-url")?i.currentCell:i.currentCell.querySelector("a")).getAttribute("data-url"),window.open(e))})},ggt.prototype.getRowStartPos=function(){for(var e,t=this.parent.pivotValues,i=0;i<(t?t.length:0);i++)if(t[i]&&t[i][0]&&"row"===t[i][0].axis){e=i;break}return e},ggt.prototype.frameDataSource=function(e){var t=[];if(("pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&0<this.parent.engineModule.data.length||"olap"===this.parent.dataType&&""!==this.parent.dataSourceSettings.url||"Server"===this.parent.dataSourceSettings.mode&&""!==this.parent.dataSourceSettings.url&&0<this.engine.pivotValues.length)&&0<this.parent.dataSourceSettings.values.length&&!this.engine.isEmptyData)if(this.parent.enableValueSorting||!this.engine.isEngineUpdated||"Tabular"===this.gridSettings.layout){for(var i=0,n=this.parent.pivotValues,o="value"===e?this.rowStartPos:0,r="value"===e?n?n.length:0:this.rowStartPos,s=o;s<r;s++)if(n[s]){t[i="header"===e?s:i]={};for(var a=0;a<n[s].length;a++)n[s][a]&&(t[i][a]=n[s][a]);i++}}else t="value"===e?this.engine.valueContent:this.engine.headerContent;else t=this.frameEmptyData();return t},ggt.prototype.frameEmptyData=function(){return[{0:{formattedText:this.parent.localeObj.getConstant("grandTotal")},1:{formattedText:this.parent.localeObj.getConstant("emptyData")}}]},ggt.prototype.calculateColWidth=function(e){je(this.parent.resizedValue)||(this.parent.resizedValue=this.parent.showGroupingBar&&this.parent.resizedValue<250?250:this.parent.resizedValue),this.resColWidth=je(this.parent.resizedValue)?this.resColWidth:this.parent.resizedValue;var t=this.calculateGridWidth(),i=this.parent.element.getBoundingClientRect().width?this.parent.element.getBoundingClientRect().width:this.parent.element.offsetWidth,i=isNaN(this.parent.width)?-1<this.parent.width.toString().indexOf("%")?parseFloat(this.parent.width.toString())/100*i:t:Number(this.parent.width),n=(i-=this.gridSettings.columnWidth>this.resColWidth?this.gridSettings.columnWidth:this.parent.isTabular?(this.parent.engineModule.rowMaxLevel+1)*this.resColWidth:this.resColWidth,e=this.parent.isTabular?e-(this.parent.engineModule.rowMaxLevel+1):e-1,this.isOverflows=!(e*this.gridSettings.columnWidth<i),this.isOverflows||(t="auto"===(t=this.calculateGridHeight())?this.parent.getHeightAsNumber():t,n=this.engine&&this.engine.headerContent?Object.keys(this.engine.headerContent).length:1,t=t-this.gridSettings.rowHeight*n,this.engine&&this.engine.valueContent&&this.gridSettings.rowHeight*this.engine.valueContent.length>t&&(i-=aB())),e*this.gridSettings.columnWidth<i?i/e:this.gridSettings.columnWidth);return this.isOverflows||this.gridSettings.allowAutoResizing?n:this.gridSettings.columnWidth},ggt.prototype.resizeColWidth=function(e){je(this.parent.resizedValue)||(this.parent.resizedValue=this.parent.showGroupingBar&&this.parent.resizedValue<250?250:this.parent.resizedValue),this.resColWidth=je(this.parent.resizedValue)?this.resColWidth:this.parent.resizedValue;var t=isNaN(this.parent.width)?-1<this.parent.width.toString().indexOf("%")?parseFloat(this.parent.width.toString())/100*this.parent.element.offsetWidth:this.parent.element.offsetWidth:Number(this.parent.width),t=(t-=this.gridSettings.columnWidth>this.resColWidth?this.gridSettings.columnWidth:this.resColWidth,this.isOverflows=!((e-=1)*this.gridSettings.columnWidth<t),e*this.gridSettings.columnWidth<t?t/e:this.gridSettings.columnWidth);return this.isOverflows||this.gridSettings.allowAutoResizing?t:this.gridSettings.columnWidth},ggt.prototype.calculateGridWidth=function(){var e=this.parent.width,t=this.parent.element.getBoundingClientRect().width?this.parent.element.getBoundingClientRect().width:this.parent.element.offsetWidth;return 0===t&&(t=this.parent.element.parentElement.getBoundingClientRect().width?this.parent.element.parentElement.getBoundingClientRect().width:this.parent.element.parentElement.offsetWidth),"auto"===this.gridSettings.width?"auto"===this.parent.width?e=t:-1<this.parent.width.toString().indexOf("%")?e=parseFloat(this.parent.width.toString())/100*t:-1<this.parent.width.toString().indexOf("px")&&(e=this.parent.width.toString().split("px")[0]):e=this.gridSettings.width,!this.gridSettings.allowAutoResizing&&e>this.parent.totColWidth?this.parent.totColWidth:e},ggt.prototype.calculateGridHeight=function(e){var t,i=this.parent.element.querySelector(".e-grid ."+Zat),n=this.parent.height,o=this.parent.getHeightAsNumber();return i&&(o=isNaN(o)?o>this.parent.minHeight?o:this.parent.minHeight:i.offsetWidth<i.querySelector("."+tht).offsetWidth?o-aB():o,this.parent.showToolbar&&"Chart"!==this.parent.currentView||!this.parent.showToolbar&&"Chart"!==this.parent.displayOption.view)&&("auto"===this.gridSettings.height&&o&&this.parent.element.querySelector("."+odt)?(n=(n=o-(this.parent.element.querySelector("."+odt).offsetHeight+(this.parent.element.querySelector("."+Adt)?this.parent.element.querySelector("."+Adt).offsetHeight:0)+(this.parent.element.querySelector("."+ddt)?42:0)+(this.parent.element.querySelector("."+Ddt)?this.parent.element.querySelector("."+Ddt).offsetHeight:0))-1)<40?40:n,e?(o=i.querySelector("."+tht).offsetHeight,e=i.querySelector("."+tht).offsetHeight,t=i.querySelector("."+tht).offsetWidth,i=i.offsetWidth<=t,o<=n&&(!i||e<=n)&&!(i&&n-o<18)?this.parent.grid.height="auto":(this.parent.grid.height=n,this.parent.grid.dataBind())):n>this.engine.valueContent.length*this.gridSettings.rowHeight&&(n="auto")):n=this.gridSettings.height),n<this.parent.gridSettings.rowHeight?this.parent.gridSettings.rowHeight:n},ggt.prototype.frameStackedHeaders=function(){var e=this.parent.pivotColumns,t="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,i=this.parent.grid.columnModel,n=!1,o=!(!this.parent.toolbarModule||!this.parent.toolbarModule.isReportChange)||!!this.parent.actionObj&&("Sort value"===this.parent.actionObj.actionName&&1===t.valueAxis||"Sort field"===this.parent.actionObj.actionName&&"columns"===this.parent.actionObj.fieldInfo.axis||this.parent.pivotFieldListModule&&"Sort field"===this.parent.pivotFieldListModule.actionObj.actionName&&"columns"===this.parent.pivotFieldListModule.actionObj.fieldInfo.axis);if(this.pivotColumns=[],("olap"===this.parent.dataType&&""!==this.parent.dataSourceSettings.url||0<this.parent.dataSourceSettings.values.length&&this.parent.dataSourceSettings.dataSource&&0<this.parent.engineModule.data.length||"Server"===this.parent.dataSourceSettings.mode&&0<this.parent.dataSourceSettings.values.length&&""!==this.parent.dataSourceSettings.url&&0<this.engine.pivotValues.length)&&!this.engine.isEmptyData){var r=this.engine.headerContent.length,s=[],a=[],l=this.calculateColWidth(this.engine.pivotValues&&this.engine.pivotValues[0]?this.engine.pivotValues[0].length:0),h="olap"===this.parent.dataType&&!je(this.engine.colMeasurePos)&&this.engine.colDepth-1===this.parent.olapEngineModule.colMeasurePos;do{var d=[],p=0,c=(r--,this.engine.headerContent[r]),u=c?Object.keys(c).length:0;if(c)for(var g=this.parent.isTabular?this.parent.engineModule.rowMaxLevel+1:c[0]?0:1,m=0,f=Object.keys(c).length+g;m<f;m++){var y=c[m]&&c[m].colSpan?3!==c[m].memberType||3===c[m].memberType&&!h||0===r?c[m].colSpan:s[m]:1,y="olap"===this.parent.dataType&&je(y)?1:y,v=c[m]?"grand sum"===c[m].type?je(c[m].valueSort.axis)?this.parent.localeObj.getConstant("grandTotal"):c[m].formattedText:"sum"===c[m].type?c[m].formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total"):c[m].formattedText:"",v=this.parent.enableHtmlSanitizer?go.sanitize(v):v;if(r===this.engine.headerContent.length-1)n=e.length-(y=1)===u&&!o&&!this.parent.isEmptyGrid&&e[p]&&e[p].autoFit,d[p]={field:m+".formattedText",headerText:v,customAttributes:{cell:this.cloneDataWithoutIndex(c[m])},width:n&&i[p]?i[p].width:c[m]&&c[m].valueSort?this.setSavedWidth(c[m].valueSort.levelName,l):this.resColWidth,minWidth:n&&p===u?i[i.length-1].minWidth:30,allowReordering:this.parent.gridSettings.allowReordering,allowResizing:this.parent.gridSettings.allowResizing,visible:!0,textAlign:this.parent.enableRtl?"Left":"Right",headerTextAlign:this.parent.enableRtl?"Right":"Left"},m===u&&(d[p].width=d[p].width-3,this.lastColumn=d[p]);else if(s[m]){for(var b=y,w=[],C=m;0<b;){if(d[p]){if(!this.pivotColumns[a[C]])break;w.push(this.pivotColumns[a[C]])}else d[p]={headerText:v,field:c[m]?c[m].valueSort.levelName:"",customAttributes:{cell:this.cloneDataWithoutIndex(c[m])},width:n&&0===p&&!o&&!this.parent.isEmptyGrid&&e[0].autoFit?i[0].width:c[m]?this.setSavedWidth(c[m].valueSort.levelName,l):this.resColWidth,minWidth:30,allowReordering:this.parent.gridSettings.allowReordering,allowResizing:this.parent.gridSettings.allowResizing,visible:!0,headerTextAlign:this.parent.enableRtl?"Right":"Left"},w=[this.pivotColumns[a[C]]];this.isAutoFitEnabled=!!this.isAutoFitEnabled||n,b-=s[C],C+=s[C]}d[p].columns=w}d[p]&&(d[p].clipMode=this.gridSettings.clipMode),s[m]=y,a[m]=p,p++,m=m+y-1}}while(this.pivotColumns=0<d.length?d:this.pivotColumns,0<r);if(this.parent.isTabular)for(var S=0;S<this.parent.engineModule.rowMaxLevel+1;S++)if(this.parent.showGroupingBar&&!this.parent.isAdaptive){var A=this.parent.element.querySelector("."+Vdt),x=A.querySelectorAll(".e-pvt-btn-div"),I=0;I=this.parent.engineModule.rowMaxLevel!==x.length-1&&S===this.parent.engineModule.rowMaxLevel?this.getTotalColumnWidth(x,S):1===A.querySelectorAll(".e-pvt-btn-div").length?250:.8*this.parent.element.getBoundingClientRect().width<=this.getTotalColumnWidth(x,0)?this.gridSettings.columnWidth:(A.querySelectorAll(".e-pvt-btn-div")[S].getBoundingClientRect().width<this.parent.gridSettings.columnWidth?this.parent.gridSettings.columnWidth:A.querySelectorAll(".e-pvt-btn-div")[S].getBoundingClientRect().width)+6,this.pivotColumns[S]={field:S+".formattedText",width:I>this.gridSettings.columnWidth?I:this.resColWidth,minWidth:30,headerText:"",allowReordering:!1,allowResizing:this.parent.gridSettings.allowResizing,visible:!0,clipMode:this.parent.gridSettings.clipMode}}else for(var T=0;T<this.parent.engineModule.rowMaxLevel+1;T++)this.updatePivotColumn(this.pivotColumns,T,n,o,i);else this.updatePivotColumn(this.pivotColumns,0,n,o,i)}else this.pivotColumns=this.frameEmptyColumns();return this.parent.toolbarModule&&this.parent.showToolbar&&(this.parent.toolbarModule.isReportChange=!1),this.parent.triggerColumnRenderEvent(this.pivotColumns),n=0<this.parent.pivotColumns.length&&this.parent.pivotColumns[this.parent.pivotColumns.length-1].autoFit,this.pivotColumns},ggt.prototype.setSavedWidth=function(e,t){if("0.formattedText"!==e||je(this.parent.resizedValue)){if(this.parent.isTabular&&this.parent.element.querySelector(".e-row").querySelector(".e-rowcell")&&this.parent.showGroupingBar&&"0.formattedText"===e&&0===this.parent.dataSourceSettings.values.length){for(var i=0,n=this.parent.element.querySelector("."+Vdt).querySelectorAll(".e-pvt-btn-div"),o=0;o<n.length;o++)i+=n[o].getBoundingClientRect().width+6;t=i}t=this.parent.resizeInfo[e]||t}else t=this.parent.resizedValue;return t},ggt.prototype.frameEmptyColumns=function(){var e=[],t=this.calculateColWidth(2);return e.push({field:"0.formattedText",headerText:"",minWidth:30,width:this.resColWidth}),e.push({field:"1.formattedText",headerText:this.parent.localeObj.getConstant("grandTotal"),minWidth:30,width:t-3}),e},ggt.prototype.getFormatList=function(){for(var e={},t=0;t<this.parent.dataSourceSettings.values.length;t++){var i,n=this.parent.dataSourceSettings.values[t],o="N";if("olap"===this.parent.dataType)this.parent.olapEngineModule.fieldList[n.name]&&!je(this.parent.olapEngineModule.fieldList[n.name].formatString)&&(o=-1<(i="Standard"===(i=this.parent.olapEngineModule.formatFields[n.name]?this.parent.olapEngineModule.formatFields[n.name].format:this.parent.olapEngineModule.fieldList[n.name].formatString)?"Number":i).indexOf("#")||null!==i.match(/\d/)?i:i[0]+"2");else if(-1<["PercentageOfDifferenceFrom","PercentageOfRowTotal","PercentageOfColumnTotal","PercentageOfGrandTotal","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal"].indexOf(n.type)?o="P2":-1<["PopulationStDev","SampleStDev","PopulationVar","SampleVar","Index"].indexOf(n.type)&&(o=void 0),0<this.parent.dataSourceSettings.formatSettings.length)for(var r=0;r<this.parent.dataSourceSettings.formatSettings.length;r++){var s=this.parent.dataSourceSettings.formatSettings[r];if(n.name===s.name){o=s.format;break}}e[n.name]=o}return e},ggt.prototype.getValidHeader=function(e,t){var i,n=this.parent.dataSourceSettings.values;if("row"===t){var o=e;if(0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length){if(0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis&&this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+o.value===o.data[0].valueSort.levelName)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[o.value.toString()].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+o.value.toString();if(1===n.length&&0===this.parent.dataSourceSettings.rows.length)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(n[n.length-1].type)+" "+this.parent.localeObj.getConstant("of")+" "+(je(n[n.length-1].caption)?n[n.length-1].name:n[n.length-1].caption)}i=o.value}else if("column"===t){o=e;if((0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length)&&!je(e.gridCell.column.customAttributes)&&0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis&&this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+o.gridCell.column.customAttributes.cell.formattedText===o.gridCell.column.customAttributes.cell.valueSort.levelName)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[o.gridCell.column.customAttributes.cell.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+o.gridCell.column.customAttributes.cell.formattedText;i=o.cell.value}return i},ggt.prototype.excelColumnEvent=function(e){0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis&&(e.cell.value=this.getValidHeader(e,"column")),void 0!==e.gridCell&&"auto"===e.gridCell.column.width&&(this.parent.lastColumn=e.gridCell.column,e.gridCell.column.width=e.gridCell.column.minWidth),e=this.exportHeaderEvent(e,"XLSX"),this.parent.trigger(Jdt,e)},ggt.prototype.pdfColumnEvent=function(e){0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis&&(e.cell.value=this.getValidHeader(e,"column")),void 0!==e.gridCell&&"auto"===e.gridCell.column.width&&(this.parent.lastColumn=e.gridCell.column,e.gridCell.column.width=e.gridCell.column.minWidth),0===e.gridCell.column.index&&(e.cell.colSpan=this.parent.isTabular?this.parent.engineModule.rowMaxLevel+1:1),this.parent.trigger(Zdt,e)},ggt.prototype.excelRowEvent=function(e){var t,i,n,o,r=this.parent.isTabular?this.parent.engineModule.rowMaxLevel:0,s=e.column?e.column.index:void 0;0<=s&&s<=r?(i=(r=e.data[s]).type&&"value"===r.type,o=0,o="olap"===this.parent.dataType?this.indentCollection[r.rowIndex]:(n=r.valueSort?r.valueSort.levelName.toString():"",r=r.actualText?r.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,(n=n.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(r&&r-1))?n-1:0),this.colPos=0,e.style={hAlign:"Left",indent:2*o},this.lastSpan=i?this.lastSpan:o,0!==e.data[s].rowSpan&&0!==e.data[s].colSpan||"CSV"!==this.parent.exportType||!this.parent.isTabular||(e.value="")):(this.colPos++,je((t=e.data[e.column.customAttributes.cell?e.column.customAttributes.cell.colIndex:this.colPos]).value)||je(t.formattedText)||""===t.formattedText?e.value="Excel"===this.parent.exportType?null:"":(r="pivot"===this.parent.dataType&&this.parent.engineModule?this.parent.engineModule.aggregatedValueMatrix:void 0)&&r[t.rowIndex]&&r[t.rowIndex][t.colIndex]?e.value=r[t.rowIndex][t.colIndex]:e.value=je(t.value)||"#DIV/0!"===t.formattedText?t.formattedText:t.value),e=this.exportContentEvent(e),0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis&&(e.value="0.formattedText"===e.column.field?this.getValidHeader(e,"row"):e.value),this.parent.trigger($dt,e),t&&!je(e.value)&&""!==e.value&&(e.style&&this.formatList[t.actualText]?(e.style.type="number",e.style.numberFormat=e.style.numberFormat||this.formatList[t.actualText]):this.formatList[t.actualText]&&(e.style={numberFormat:this.formatList[t.actualText]}),e.column.format=this.formatList[t.actualText])},ggt.prototype.pdfRowEvent=function(e){var t,i,n,o;"0.formattedText"===(e=this.exportContentEvent(e)).column.field&&(t=(i=e.data[o=0]).type&&"value"===i.type,o="olap"===this.parent.dataType?this.indentCollection[i.rowIndex]:(n=i.valueSort?i.valueSort.levelName.toString():"",i=i.actualText?i.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,(n=n.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(i&&i-1))?n-1:0),e.style={paragraphIndent:10*o},this.lastSpan=t?this.lastSpan:o,0===this.parent.dataSourceSettings.rows.length)&&"row"===this.parent.dataSourceSettings.valueAxis&&(e.value=this.getValidHeader(e,"row")),this.parent.trigger(ept,e)},ggt.prototype.excelDataBound=function(e){for(var t=e.excelRows,i=Object.keys(this.engine.headerContent).length,n=0;n<i;n++){for(var o=t[n].cells,r=[],s=0;s<o.length;s++)-1!==o[s].rowSpan&&r.push(o[s]);t[n].cells=r}},ggt.prototype.exportHeaderEvent=function(e,t){var i,n=1;return e.gridCell.column.customAttributes?(n=0<(i=e.gridCell.column.customAttributes.cell).rowSpan?i.rowSpan:1,"XLSX"===t&&(0<i.rowSpan?n=i.rowSpan:je(i.type)||0===i.level||(e.cell.rowSpan=n=1)),this.actualText=i.actualText):n=Object.keys(this.engine.headerContent).length,e.cell.rowSpan!==n&&0<n&&(e.cell.rowSpan=n),e},ggt.prototype.frameGridDataSource=function(e){for(var t=[],i=0;i<e.length;i++)for(var n=0,o=(t[i]={},Object.keys(e[i])),r=0;null!=e[i]&&r<o.length;r++)for(;n<o.length;)t[i][Number(o[n])]=this.cloneDataWithoutIndex(e[i][Number(o[n])]),n++;return t},ggt.prototype.cloneDataWithoutIndex=function(e){if(je(e))return e;for(var t=Object.keys(e),i=0,n={};i<t.length;)"indexObject"!==t[i]&&"index"!==t[i]&&(n[t[i]]=e[t[i]]),i++;return n},ggt.prototype.exportContentEvent=function(e){var t=e.data[Number(e.column.field.split(".formattedText")[0])];return 0<t.rowSpan&&"row"===t.axis&&(e.cell.rowSpan=t.rowSpan),0<t.colSpan&&"row"===t.axis&&(e.colSpan=t.colSpan),e.value="grand sum"===t.type?je(t.valueSort.axis)?this.parent.localeObj.getConstant("grandTotal"):t.formattedText:e.value,e},ggt.prototype.unWireEvents=function(e){e.querySelector(".e-hyperlinkcell")&&E.remove(e.querySelector(".e-hyperlinkcell"),this.parent.isAdaptive?"touchend":"click",this.onHyperCellClick)},ggt.prototype.wireEvents=function(e){e.querySelector(".e-hyperlinkcell")&&E.add(e.querySelector(".e-hyperlinkcell"),this.parent.isAdaptive?"touchend":"click",this.onHyperCellClick,this)},ggt.prototype.setSpanAttributes=function(e,t,i){i.setAttribute(e,t?t.toString():"1"),i.classList.add(nht,_dt,"e-tabular-layout-header"),0===t&&i.classList.add(Eat)},ggt.prototype.updatePivotColumn=function(e,t,i,n,o){e[t]={field:t+".formattedText",width:i&&!n&&!this.parent.isEmptyGrid&&e[t].autoFit?o[t].width:this.resColWidth,minWidth:30,headerText:"",allowReordering:!1,allowResizing:this.parent.gridSettings.allowResizing,visible:!0,clipMode:this.parent.gridSettings.clipMode}},ggt.prototype.getTotalColumnWidth=function(e,t){for(var i=0,n=t;n<e.length;n++)i+=(e[n].getBoundingClientRect().width<this.parent.gridSettings.columnWidth?this.parent.gridSettings.columnWidth:e[n].getBoundingClientRect().width)+6;return i};var ugt=ggt;function ggt(e){this.isAutoFitEnabled=!1,this.pivotColumns=[],this.indentCollection={},this.colPos=0,this.lastSpan=0,this.lvlCollection={},this.hierarchyCollection={},this.lvlPosCollection={},this.hierarchyPosCollection={},this.position=0,this.measurePos=0,this.maxMeasurePos=0,this.hierarchyCount=0,this.actualText="",this.drilledLevelInfo={},this.parent=e,this.resColWidth=this.parent.showGroupingBar&&this.parent.groupingBarModule?this.parent.isAdaptive?180:250:this.parent.isAdaptive?140:200,this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.gridSettings=this.parent.gridSettings,this.formatList=this.getFormatList(),this.aggMenu=new pgt(this.parent)}fgt.prototype.keyActionHandler=function(e){switch(e.action){case"shiftF":this.processFilter(e);break;case"shiftS":this.processSort(e);break;case"shiftE":this.processEdit(e);break;case"delete":this.processDelete(e);break;case"enter":this.processEnter(e);break;case"escape":this.processClose(e);break;case"upArrow":case"downArrow":this.processFilterNodeSelection(e);break;case"altJ":this.processComponentFocus(e)}},fgt.prototype.processComponentFocus=function(e){this.parent.element&&(this.parent.element.focus(),e.stopPropagation(),e.preventDefault())},fgt.prototype.getButtonElement=function(e){for(var t=[].slice.call(this.parent.element.querySelectorAll("."+Jat)),i=0,n=t.length;i<n;i++)if(t[i].getAttribute("data-uid")===e.getAttribute("data-uid"))return t[i];return e},fgt.prototype.processEnter=function(e){var t=e.target;t&&z(t,"."+Jat)&&(t.querySelector("."+Fat)&&z(t,"."+xlt)?t.querySelector("."+Fat).click():t.querySelector("."+Rht)?t.querySelector("."+Rht).click():!t.querySelector("."+elt)||z(t,"."+xlt)||z(t,"."+Dht)?t.querySelector("."+nlt)&&!z(t,"."+xlt)&&t.querySelector("."+nlt).click():(t.querySelector("."+elt).click(),this.getButtonElement(t).focus()),e.preventDefault())},fgt.prototype.processSort=function(e){var t=e.target;t&&z(t,"."+Jat)&&t.querySelector("."+elt)&&!z(t,"."+xlt)&&!z(t,"."+Dht)&&(t.querySelector("."+elt).click(),this.getButtonElement(t).focus(),e.preventDefault())},fgt.prototype.processEdit=function(e){var t=e.target;t&&z(t,"."+Jat)&&t.querySelector("."+Rht)&&(t.querySelector("."+Rht).click(),e.preventDefault())},fgt.prototype.processFilter=function(e){var t,i,n=e.target;n&&z(n,"."+Jat)&&n.querySelector("."+nlt)&&!z(n,"."+xlt)&&(n.querySelector("."+nlt).click(),this.parent&&this.parent.control&&"pivotview"===this.parent.moduleName&&this.parent.control.grid&&this.parent.control.showGroupingBar&&this.parent.control.groupingBarModule&&z(n,"."+Dlt)&&this.parent.filterDialog&&this.parent.filterDialog.dialogPopUp&&!this.parent.filterDialog.dialogPopUp.isDestroyed&&this.parent.filterDialog.dialogPopUp.element&&(t=this.parent.filterDialog.dialogPopUp.element,i=this.parent.filterDialog.allowExcelLikeFilter,clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){t&&t.classList.contains("e-popup-open")&&(i&&t.querySelector(".e-dlg-closeicon-btn")?t.querySelector(".e-dlg-closeicon-btn").focus():t.querySelector("input")&&t.querySelector("input").focus())})),e.preventDefault())},fgt.prototype.processFilterNodeSelection=function(e){var t,i,n=e.target;n&&z(n,"."+cht)&&40===e.keyCode?(t=z(n,"."+plt).querySelector("."+clt))&&t.querySelector("li")&&(i=t.querySelector("li"),t.querySelector("li#_active")&&(q([t.querySelector("li#_active")],["e-node-focus"]),t.querySelector("li#_active").removeAttribute("id")),i.setAttribute("id","_active"),U([i],["e-node-focus"]),i.focus(),e.preventDefault()):n&&z(n,"."+clt)&&38===e.keyCode?(t=z(n,"."+clt)).querySelector("li#_active.e-node-focus")&&t.querySelector("li")&&t.querySelector("li").classList.contains("e-prev-active-node")&&t.querySelector("li")===t.querySelector("li#_active.e-node-focus")&&(q(t.querySelectorAll("li.e-prev-active-node"),"e-prev-active-node"),t=z(n,"."+plt).querySelector("."+cht))&&t.querySelector("li")&&((i=t.querySelector("li")).setAttribute("id","_active"),U([i],["e-node-focus"]),i.focus(),e.preventDefault()):n&&n.id===this.parent.parentID+"_inputbox"&&("upArrow"===e.action?n.parentElement.querySelector(".e-spin-up").click():"downArrow"===e.action&&n.parentElement.querySelector(".e-spin-down").click())},fgt.prototype.processDelete=function(e){var t=e.target;t&&z(t,"."+Jat)&&t.querySelector("."+slt)&&(t.querySelector("."+slt).click(),e.preventDefault())},fgt.prototype.processClose=function(e){var t=e.target;if(t&&z(t,".e-popup.e-popup-open")){t=K(z(t,".e-popup.e-popup-open"),pS);if(t&&!t.closeOnEscape){var i=t.element.getAttribute("data-fieldName");if(t.hide(),this.parent.element)for(var n=0,o=[].slice.call(this.parent.element.querySelectorAll(".e-pivot-button"));n<o.length;n++){var r=o[n];if(r.getAttribute("data-uid")===i){r.focus();break}}e.preventDefault()}}},fgt.prototype.destroy=function(){this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null)};var mgt=fgt;function fgt(e){this.keyConfigs={shiftF:"shift+F",shiftS:"shift+S",shiftE:"shift+E",delete:"delete",enter:"enter",escape:"escape",upArrow:"upArrow",downArrow:"downArrow",altJ:"alt+J"},this.parent=e,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.keyboardModule=new bn(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})}vgt.prototype.updateSorting=function(e){if(!e.target.classList.contains(nlt)&&!e.target.classList.contains(slt)){this.parent.filterDialog.dialogPopUp&&this.parent.filterDialog.dialogPopUp.close();var e=e.target,t=void 0,i=void 0,i=0!==(e.id?(t=e.getAttribute("data-uid"),[].slice.call(e.querySelectorAll("."+ilt))):(t=e.parentElement.getAttribute("data-uid"),[].slice.call(e.parentElement.querySelectorAll("."+ilt)))).length,n=Hdt.getFieldByName(t,this.parent.dataSourceSettings.sortSettings),o=this.parent.engineModule&&this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].membersOrder?this.parent.engineModule.fieldList[t].membersOrder.slice():[];if(!je(n))for(var r=0;r<this.parent.dataSourceSettings.sortSettings.length;r++)if(this.parent.dataSourceSettings.sortSettings[r].name===t){this.parent.dataSourceSettings.sortSettings.splice(r,1);break}n={name:t,order:i?"Ascending":"Descending",membersOrder:n?n.membersOrder:o};this.parent.dataSourceSettings.sortSettings.push(n),this.parent.control.lastSortInfo=this.parent.dataSourceSettings.sortSettings[this.parent.dataSourceSettings.sortSettings.length-1],(i?q:U)([e],ilt)}},vgt.prototype.updateFiltering=function(e){var e=e.target,t=e.parentElement.getAttribute("data-uid"),e=e.parentElement.textContent,i=!1,n=[],o=[];if(this.parent.dataSourceSettings.allowMemberFilter)if("olap"===this.parent.dataType)o=this.getOlapData(t,i);else{var r=this.parent.engineModule.fieldList[t],s=Hdt.getClonedData(r.dateMember),a=(this.parent.isDateField=Hdt.isDateField(t,this.parent.engineModule),r&&r.membersOrder?r.membersOrder.slice():[]),l=void 0,h=("Out of Range"===s[0].actualText?(l=s[0],s.splice(0,1)):"Out of Range"===s[s.length-1].actualText&&(l=s[s.length-1],s.splice(s.length-1,1)),{fieldName:t,sortOrder:r.sort,members:a&&0<a.length?a:Object.keys(s),IsOrderChanged:!1}),d=!1,r=!(!r||!r.isAlphanumeric)||void 0,a=(a&&0<a.length?s=Hdt.applyCustomSort(h,s,r):(a=!je(a=this.parent.dataSourceSettings.groupSettings.filter(function(e){return e.name===t&&"number"===e.type.toLocaleLowerCase()}))&&0<a.length,s=Hdt.applyHeadersSort(s,h.sortOrder,r,a),d=!0),Hdt.getFilterItemByName(t,this.parent.dataSourceSettings.filterSettings));if(je(a)||(i=!(!this.isValidFilterItemsAvail(t,a)||"Include"!==a.type),n=a.items||[]),l&&("Ascending"===h.sortOrder?"Grand Total"===s[s.length-1].actualText?s.splice(s.length-1,0,l):s.splice(s.length,0,l):"Grand Total"===s[0].actualText?s.splice(1,0,l):s.splice(0,0,l)),d){for(var p=[],c=0,u=0;c<s.length;c++)"Grand Total"!==s[c].actualText&&(p[u++]=s[c].actualText);h.members=p}this.parent.control.trigger(Xpt,h),h.IsOrderChanged&&(s=Hdt.applyCustomSort(h,s,r,!0)),o=this.getTreeData(i,s,n,t)}this.parent.filterDialog.dialogPopUp&&this.parent.filterDialog.dialogPopUp.close();a=this.parent.control.filterTargetID;je(a)&&(a="pivotfieldlist"!==this.parent.moduleName?this.parent.element:document.getElementById(this.parent.parentID+"_Container")),this.parent.filterDialog.createFilterDialog(o,t,e,a)},vgt.prototype.isValidFilterItemsAvail=function(e,t){var i=!1;if(t&&0<=["Include","Exclude"].indexOf(t.type))if("Include"===t.type&&0===t.items.length)i=!0;else for(var n=this.parent.engineModule,o=n.fieldList[e],r=void 0,r="Server"===this.parent.dataSourceSettings.mode||"olap"===this.parent.dataType?o.members:Hdt.getFormattedMembers(o.members,e,n),s=0,a=t.items;s<a.length;s++)if(r[a[s]]){i=!0;break}return i},vgt.prototype.getOlapData=function(e,t){var i=[],n=(this.parent.filterDialog.isSearchEnabled=!1,this.parent.engineModule),o=Hdt.getFilterItemByName(e,this.parent.dataSourceSettings.filterSettings),r=(0===n.fieldList[e].filterMembers.length?this.parent.control.loadOnDemandInMemberEditor?o&&1<o.levelCount&&1<n.fieldList[e].levels.length?n.getFilterMembers(this.parent.dataSourceSettings,e,o.levelCount):(n.fieldList[e].levelCount=1,n.getMembers(this.parent.dataSourceSettings,e)):n.getMembers(this.parent.dataSourceSettings,e,!0):(n.fieldList[e].currrentMembers={},n.fieldList[e].searchMembers=[]),n.fieldList[e].isHierarchy),s=n.fieldList[e].filterMembers;je(o)||(t=!o.type||"Include"===o.type,i=o.items||[]);for(var a={},l={},h=n.fieldList[e].members,d=0,p=i;d<p.length;d++){var c=p[d];h[l[a[c]=c]=c]&&(l=this.getParentNode(e,c,l))}return s=this.getFilteredTreeNodes(e,s,l,[]),s=this.getOlapTreeData(t,Hdt.getClonedData(s),a,e,r),this.sortOlapFilterData(s,n.fieldList[e].sort)},vgt.prototype.sortOlapFilterData=function(e,t){if(0<e.length){for(var i=!1,n=[],o=0;o<e.length;o++)n.push(e[o].caption);var r=("Grand Total"!==e[0].caption||void 0===e[0].caption?e[0]:e[1]).htmlAttributes["data-fieldName"],s=this.parent.engineModule.fieldList[r],s=s&&s.membersOrder?s.membersOrder.slice():[],r={fieldName:r,sortOrder:t,members:s&&0<s.length?s:n,IsOrderChanged:!1};if(s&&0<s.length?this.applyFilterCustomSort(e,r):(e="Ascending"===t?e.sort(function(e,t){return e.caption>t.caption?1:t.caption>e.caption?-1:0}):"Descending"===t?e.sort(function(e,t){return e.caption<t.caption?1:t.caption<e.caption?-1:0}):e,i=!0),i){for(var a=[],l=0,h=0;l<e.length;l++)"Grand Total"!==e[l].caption&&(a[h++]=e[l].caption);r.members=a}this.parent.control.trigger(Xpt,r),r.IsOrderChanged&&this.applyFilterCustomSort(e,r,!0)}return e},vgt.prototype.applyFilterCustomSort=function(e,t,i){var n,o=[],r=[],o=t.IsOrderChanged?t.members:"Ascending"===t.sortOrder||"None"===t.sortOrder||void 0===t.sortOrder?[].concat(t.members):[].concat(t.members).reverse();"Grand Total"===e[0].caption&&(n=e[0],e.shift());for(var s=0,a=0;s<e.length;s++){var l=e[s].caption;if(o[a]===l){if(e.splice(a++,0,e[s]),e.splice(++s,1),!(a<o.length)){i||r.splice(--a,0,l);break}s=-1}0<=s&&!i&&(r[s]=e[s].caption)}if(!i){for(s=r.length;s<e.length;s++)r[s]=e[s].caption;"Grand Total"===r[r.length-1]&&r.pop(),t.members=r}return n&&e.splice(0,0,n),e},vgt.prototype.getParentIDs=function(e,t,i){for(var n,o=0,r=e.fields.dataSource;o<r.length;o++){var s=r[o];if(s.id===t){n=s.pid;break}}return n&&(i.push(n),this.getParentIDs(e,n,i)),i},vgt.prototype.getChildIDs=function(e,t,i){for(var n,o=0,r=e.fields.dataSource;o<r.length;o++){var s=r[o];if(s.pid===t){n=s.id;break}}return n&&(i.push(n),this.getParentIDs(e,n,i)),i},vgt.prototype.searchTreeNodes=function(e,t,i,n){if(i){for(var o=[],r=[],s=0,a=[].slice.call(t.element.querySelectorAll("li"));s<a.length;s++){var l=a[s];(-1<l.querySelector(".e-list-text").textContent.toLowerCase().indexOf(e.value.toLowerCase())?o:r).push(l)}if(t.enableNodes(o),q(o,Eat),t.disableNodes(r),U(r,Eat),0<o.length&&0<r.length)for(var h=0,d=o;h<d.length;h++){var p=d[h].getAttribute("data-uid"),c=this.getParentIDs(t,p,[]),u=this.getChildIDs(t,p,[]),g=[];if(0<c.length)for(var m=0,f=r;m<f.length;m++){var y=f[m];-1!==Hdt.inArray(y.getAttribute("data-uid"),c)&&g.push(y)}if(0<u.length)for(var v=0,b=r;v<b.length;v++){y=b[v];-1!==Hdt.inArray(y.getAttribute("data-uid"),u)&&g.push(y)}t.enableNodes(g),q(g,Eat)}0===[].slice.call(t.element.querySelectorAll("li."+Eat)).length?t.collapseAll():t.expandAll(void 0,void 0,!0),this.searchListItem=o}else if(this.parent.searchTreeItems=[],"olap"!==this.parent.dataType||n){for(var o=[],w=0,w=1,C=0,S=this.parent.currentTreeItems;C<S.length;C++){var A=S[C];-1<A.name.toLowerCase().indexOf(e.value.toLowerCase())&&(this.parent.searchTreeItems.push(A),w<=this.parent.control.maxNodeLimitInMemberEditor&&o.push(A),w++)}--w>this.parent.control.maxNodeLimitInMemberEditor?(this.parent.editorLabelElement.innerText=w-this.parent.control.maxNodeLimitInMemberEditor+this.parent.control.localeObj.getConstant("editorDataLimitMsg"),this.parent.filterDialog.dialogPopUp.height=this.parent.filterDialog.allowExcelLikeFilter?"440px":"400px",this.parent.isDataOverflow=!0):(this.parent.editorLabelElement.innerText="",this.parent.filterDialog.dialogPopUp.height=this.parent.filterDialog.allowExcelLikeFilter?"400px":"350px",this.parent.isDataOverflow=!1),this.parent.isDataOverflow=w>this.parent.control.maxNodeLimitInMemberEditor,this.parent.editorLabelElement.parentElement.style.display=this.parent.isDataOverflow?"block":"none",t.fields={dataSource:o,id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},t.dataBind()}else this.updateOlapSearchTree(e,t,n)},vgt.prototype.updateOlapSearchTree=function(e,t,i){var n=[],o=this.parent.filterDialog.dialogPopUp.element.getAttribute("data-fieldname");if(""===e.value.toLowerCase()){this.parent.filterDialog.isSearchEnabled=!1,this.parent.engineModule.fieldList[o].searchMembers=[];for(var r={},s={},a=this.parent.engineModule.fieldList[o].members,l=[],h=0,d=Object.keys(a);h<d.length;h++)!a[p=d[h]].isSelected||a[p].parent&&a[a[p].parent].isSelected||l.push(p);for(var p,c=0,u=l;c<u.length;c++)a[s[r[p=u[c]]=p]=p]&&(s=this.getParentNode(o,p,s));var g=this.parent.engineModule.fieldList[o].filterMembers,n=this.getFilteredTreeNodes(o,g,s,[]);n=this.getOlapTreeData(!0,Hdt.getClonedData(n),r,o,i,!0)}else{this.parent.filterDialog.isSearchEnabled=!0;g=this.parent.engineModule.fieldList[o].searchMembers;n=Hdt.getClonedData(g),n=this.getOlapSearchTreeData(!0,n,o)}t.fields={dataSource:n,id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},t.dataBind()},vgt.prototype.getTreeData=function(e,t,i,n){this.parent.currentTreeItems=[],this.parent.searchTreeItems=[],this.parent.currentTreeItemsPos={},this.parent.savedTreeFilterPos={};for(var o=this.parent.engineModule,r=[],s=1,a={},l=0,h=i;l<h.length;l++){var d=h[l];a[d]=d}for(var p=n.replace(/[^a-zA-Z0-9 ]/g,"_"),c=0,u=t;c<u.length;c++){var g=u[c],m=g.actualText.toString(),m=this.parent.enableHtmlSanitizer?go.sanitize(m):m,f=this.parent.enableHtmlSanitizer?go.sanitize(g.actualText):g.actualText,y={id:p+"_"+s,htmlAttributes:{"data-fieldName":n,"data-memberId":f.toString()},actualText:f,name:(this.parent.isDateField?g:o.getFormattedValue(f,n)).formattedText,isSelected:!e},v="Server"===this.parent.dataSourceSettings.mode?g.actualText:g.formattedText;void 0!==a[this.parent.isDateField?v:m]&&(y.isSelected=!!e),s<=this.parent.control.maxNodeLimitInMemberEditor&&r.push(y),y.isSelected||(this.parent.savedTreeFilterPos[s-1]=this.parent.isDateField?g.formattedText:m),this.parent.currentTreeItems.push(y),this.parent.searchTreeItems.push(y),this.parent.currentTreeItemsPos[f]={index:s-1,isSelected:y.isSelected},s++}return this.parent.isDataOverflow=s-1>this.parent.control.maxNodeLimitInMemberEditor,r},vgt.prototype.getOlapTreeData=function(e,t,i,n,o,r){for(var s=this.parent.engineModule.fieldList[n],a=(this.parent.currentTreeItems=[],this.parent.searchTreeItems=[],this.parent.currentTreeItemsPos={},[]),l=1,h=0,d=t;h<d.length;h++){var p=d[h],c=p,u=p.id.toString();r||(c.isSelected=!e),void 0!==i[u]&&(c.isSelected=!!e),!r&&p.hasChildren&&this.updateChildNodeStates(s.filterMembers,n,p.id,c.isSelected),s.members[u].isSelected=c.isSelected,s.currrentMembers&&s.currrentMembers[u]&&(s.currrentMembers[u].isSelected=c.isSelected),l<=this.parent.control.maxNodeLimitInMemberEditor&&o&&a.push(c),this.parent.currentTreeItems.push(c),this.parent.searchTreeItems.push(c),this.parent.currentTreeItemsPos[u]={index:l-1,isSelected:c.isSelected},l++}return this.parent.isDataOverflow=!!o&&l-1>this.parent.control.maxNodeLimitInMemberEditor,o?a:t},vgt.prototype.getOlapSearchTreeData=function(e,t,i){for(var n=this.parent.engineModule.fieldList[i].members,o=0,r=t;o<r.length;o++){var s=r[o],a=s.id.toString();n[a]&&(s.isSelected=n[a].isSelected),this.parent.searchTreeItems.push(s)}return t},vgt.prototype.updateChildNodeStates=function(e,t,i,n){for(var o=this.parent.engineModule.fieldList[t].members,r=this.parent.engineModule.fieldList[t].currrentMembers,s=0,a=e;s<a.length;s++){var l=a[s];l.pid&&l.pid.toString()===i&&(o[l.id].isSelected=n,r&&r[l.id]&&(r[l.id].isSelected=n),l.hasChildren)&&this.updateChildNodeStates(e,t,l.id,n)}},vgt.prototype.getParentNode=function(e,t,i){var n=this.parent.engineModule.fieldList[e].members;return n[t].parent&&t!==n[t].parent&&(i[n=n[t].parent]=n,this.getParentNode(e,n,i)),i},vgt.prototype.getFilteredTreeNodes=function(e,t,i,n){for(var o=[],r=this.parent.engineModule.fieldList[e].members,s=0,a=i?Object.keys(i):[];s<a.length;s++){var l=a[s],l=r[l]?r[l].parent:void 0;void 0!==l&&-1===Hdt.inArray(l,o)&&o.push(l)}for(var h=0,d=t;h<d.length;h++){var p=d[h];je(p.pid)||-1!==Hdt.inArray(p.pid,o)?(n.push(p),je(p.pid)&&-1!==Hdt.inArray(p.id,o)?r[p.id].isNodeExpand=!0:je(p.pid)||-1===Hdt.inArray(p.pid,o)?r[p.id].isNodeExpand=!1:(r[p.id].isNodeExpand=!1,r[p.pid].isNodeExpand=!0)):r[p.id].isNodeExpand=!1}return n};var ygt=vgt;function vgt(e){this.searchListItem=[],this.parent=e}wgt.prototype.onStateModified=function(e,t){var i="",n=z(e.target,"."+Clt),o=-1;if(this.parent.dataSourceUpdate.btnElement=e.element?e.element.parentElement:void 0,n&&(i=n.classList[1]===Slt?"rows":n.classList[1]===Alt?"columns":n.classList[1]===xlt?"values":n.classList[1]===Ilt?"filters":""),"olap"===this.parent.dataType||"pivot"===this.parent.dataType){var r,s,a="olap"===this.parent.dataType&&this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].isCalculatedField?this.parent.engineModule.fieldList[t].tag:t;if(e.cancel&&""===i)return!1;if(this.parent.dataSourceUpdate.btnElement&&"true"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&("filters"===i||"values"===i)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&-1<a.toLowerCase().indexOf("[measures].")&&"olap"===this.parent.dataType&&("filters"===i||"rows"===i||"columns"===i)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&"olap"===this.parent.dataType&&-1===a.toLowerCase().indexOf("[measures].")&&this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].isNamedSets&&("filters"===i||"values"===i)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&"olap"===this.parent.dataType&&-1===a.toLowerCase().indexOf("[measures].")&&"values"===i)return r=this.parent.localeObj.getConstant("warning"),s=this.parent.localeObj.getConstant("fieldDropErrorAction"),this.parent.errorDialog.createErrorDialog(r,s),!1}else if(e.cancel&&""===i||this.parent.dataSourceUpdate.btnElement&&"true"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&("filters"===i||"values"===i||-1<i.indexOf(this.parent.dataSourceSettings.valueAxis)))return!1;if(""!==i){if("olap"===this.parent.dataType||"pivot"===this.parent.dataType)if(-1<(a="olap"===this.parent.dataType&&this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].isCalculatedField?this.parent.engineModule.fieldList[t].tag:t).toLowerCase().indexOf("[measures].")&&"olap"===this.parent.dataType&&("filters"===i||"rows"===i||"columns"===i)||this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].isNamedSets&&"filters"===i||"olap"===this.parent.dataType&&"values"===i&&-1===a.toLowerCase().indexOf("[measures]."))return r=this.parent.localeObj.getConstant("warning"),s=this.parent.localeObj.getConstant("fieldDropErrorAction"),this.parent.errorDialog.createErrorDialog(r,s),!1;if("pivot"===this.parent.dataType&&this.parent.engineModule.fieldList[t]&&"CalculatedField"===this.parent.engineModule.fieldList[t].aggregateType&&"values"!==i)return r=this.parent.localeObj.getConstant("warning"),s=this.parent.localeObj.getConstant("dropAction"),this.parent.errorDialog.createErrorDialog(r,s),!1;o=this.getButtonPosition(e.target,i)}else this.parent.engineModule.fieldList[t]&&(this.parent.engineModule.fieldList[t].isSelected=!1,"olap"===this.parent.dataType)&&this.parent.engineModule.updateFieldlistData(t);return this.parent.dataSourceUpdate.updateDataSource(t,i,o)},wgt.prototype.getButtonPosition=function(e,t){var i=-1;if(!je(n=z(e,"."+Kat)))for(var n=n.querySelector("."+Jat),e=this.parent.element.querySelector(".e-"+t),o=[].slice.call(e.querySelectorAll("."+Jat)),r=0,s=o.length;r<s;r++)if(o[r].id===n.id){i=r;break}return i};var bgt=wgt;function wgt(e){this.parent=e}Sgt.prototype.updateDataSource=function(i,n,o){for(var r,s,a=this,l=-1,h=!0,e=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],t=0,d=e.length;t<d;t++)if(e[t])for(var p=0,c=e[t].length;p<c;p++)(e[t][p].name===i||"olap"===this.parent.dataType&&"[measures]"===e[t][p].name.toLowerCase()&&e[t][p].name.toLowerCase()===i)&&(s=0===t?"rows":1===t?"columns":2===t?"values":"filters",l=p),s=s||"fieldList";var u={fieldName:i,dropField:Hdt.getFieldInfo(i,this.control).fieldItem,dataSourceSettings:Hdt.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:n,dropPosition:o,draggedAxis:s,cancel:!1},g="pivotfieldlist"===this.control.getModuleName()&&this.control.isPopupView?this.control.pivotGridModule:this.control;return g.trigger(Ydt,u,function(e){if(e.cancel)h=!1;else{var t;if(n=e.dropAxis,o=e.dropPosition,i=e.dropField?e.dropField.name:e.fieldName,r=e.dropField,a.control&&a.btnElement&&"true"===a.btnElement.getAttribute("isvalue"))switch(n){case"":a.control.setProperties({dataSourceSettings:{values:[]}},!0);break;case"rows":o=o===a.parent.dataSourceSettings.rows.length?-1:o,a.control.setProperties({dataSourceSettings:{valueAxis:"row",valueIndex:o}},!0);break;case"columns":o=o===a.parent.dataSourceSettings.columns.length?-1:o,a.control.setProperties({dataSourceSettings:{valueAxis:"column",valueIndex:o}},!0)}else a.removeFieldFromReport(i.toString()),"pivot"===a.parent.dataType&&a.control.showValuesButton&&1<a.parent.dataSourceSettings.values.length&&(t="row"===a.parent.dataSourceSettings.valueAxis&&"rows"===n?a.parent.dataSourceSettings.rows:"column"===a.parent.dataSourceSettings.valueAxis&&"columns"===n?a.parent.dataSourceSettings.columns:void 0,l<a.parent.dataSourceSettings.valueIndex&&("row"===a.parent.dataSourceSettings.valueAxis&&"rows"===s||"column"===a.parent.dataSourceSettings.valueAxis&&"columns"===s)&&a.control.setProperties({dataSourceSettings:{valueIndex:a.parent.dataSourceSettings.valueIndex-1}},!0),je(t)||(-1===o&&-1===a.parent.dataSourceSettings.valueIndex?a.control.setProperties({dataSourceSettings:{valueIndex:t.length}},!0):-1<o&&o<=a.parent.dataSourceSettings.valueIndex?a.control.setProperties({dataSourceSettings:{valueIndex:a.parent.dataSourceSettings.valueIndex+1}},!0):-1<a.parent.dataSourceSettings.valueIndex&&o>a.parent.dataSourceSettings.valueIndex&&(o-=1))),"CalculatedField"===(r=a.getNewField(i.toString(),e.dropField)).type&&""!==n&&(n="values");"olap"===a.parent.dataType&&(a.removeFieldFromReport(i.toString()),r=a.getNewField(i.toString(),e.dropField),0===a.parent.dataSourceSettings.values.length&&a.removeFieldFromReport("[measures]"),"CalculatedField"===r.type)&&""!==n&&(n="values"),a.control&&(t={fieldName:i,droppedField:r,dataSourceSettings:Hdt.getClonedDataSourceSettings(a.parent.dataSourceSettings),droppedAxis:n,droppedPosition:o},g.trigger(Gdt,t,function(e){if(r=e.droppedField){switch(o=e.droppedPosition,n=e.droppedAxis){case"filters":-1!==o?a.parent.dataSourceSettings.filters.splice(o,0,r):a.parent.dataSourceSettings.filters.push(r);break;case"rows":-1!==o?a.parent.dataSourceSettings.rows.splice(o,0,r):a.parent.dataSourceSettings.rows.push(r);break;case"columns":-1!==o?a.parent.dataSourceSettings.columns.splice(o,0,r):a.parent.dataSourceSettings.columns.push(r);break;case"values":-1!==o?a.parent.dataSourceSettings.values.splice(o,0,r):a.parent.dataSourceSettings.values.push(r),"olap"!==a.parent.dataType||a.parent.engineModule.isMeasureAvail||1<a.parent.dataSourceSettings.values.length||("row"===a.parent.dataSourceSettings.valueAxis?a.parent.dataSourceSettings.rows:a.parent.dataSourceSettings.columns).push({name:"[Measures]",caption:"Measures",showRemoveIcon:!0,allowDragAndDrop:!0})}e="columns"===n?g.dataSourceSettings.columns.length:"rows"===n?g.dataSourceSettings.rows.length:0;0!==e&&g.dataSourceSettings.valueIndex===e&&a.control.setProperties({dataSourceSettings:{valueIndex:-1}},!0)}}))}}),h},Sgt.prototype.removeFieldFromReport=function(e){for(var t=!1,i=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],n=this.parent.engineModule.fieldList[e],o=0,r=i.length;o<r;o++)if(!t&&i[o])for(var s,a,l=0,h=i[o].length;l<h;l++)if(i[o][l].name===e||"olap"===this.parent.dataType&&"[measures]"===i[o][l].name.toLowerCase()&&i[o][l].name.toLowerCase()===e){(a=i[o][l].properties||i[o][l]).type=n&&"number"===n.type?a.type:"Count",i[o].splice(l,1),"olap"===this.parent.dataType&&(s=this.parent.engineModule)&&s.fieldList[e]&&(s.fieldList[e].currrentMembers={},s.fieldList[e].searchMembers=[]),t=!0;break}return a},Sgt.prototype.getNewField=function(e,t){var i;return"olap"===this.parent.dataType?(i=this.parent.engineModule.fieldList[e],{name:t?t.name:e,caption:(t||i).caption,isNamedSet:t?t.isNamedSet:i.isNamedSets,isCalculatedField:(t||i).isCalculatedField,type:t?void 0===t.type?"number"===i.type?"Sum":"Count":t.type:void 0===i.aggregateType?"number"===i.type?"Sum":"Count":i.aggregateType,showFilterIcon:(t||i).showFilterIcon,showSortIcon:(t||i).showSortIcon,showEditIcon:(t||i).showEditIcon,showRemoveIcon:(t||i).showRemoveIcon,showValueTypeIcon:(t||i).showValueTypeIcon,allowDragAndDrop:(t||i).allowDragAndDrop,showSubTotals:(t||i).showSubTotals,expandAll:(t||i).expandAll}):(i=this.parent.engineModule.fieldList[e],{name:t?t.name:e,caption:(t||i).caption,type:t?void 0===t.type||null===t.type?"number"===i.type?"Sum":"Count":t.type:void 0===i.aggregateType||null===i.aggregateType?"number"===i.type?"Sum":"Count":i.aggregateType,showNoDataItems:(t||i).showNoDataItems,baseField:(t||i).baseField,baseItem:(t||i).baseItem,allowDragAndDrop:(t||i).allowDragAndDrop,showSubTotals:(t||i).showSubTotals,showFilterIcon:(t||i).showFilterIcon,showSortIcon:(t||i).showSortIcon,showEditIcon:(t||i).showEditIcon,showRemoveIcon:(t||i).showRemoveIcon,showValueTypeIcon:(t||i).showValueTypeIcon,expandAll:(t||i).expandAll})};var Cgt=Sgt;function Sgt(e){this.parent=e}xgt.prototype.createErrorDialog=function(e,t){var i=Q("div",{id:this.parent.parentID+"_ErrorDialog",className:wlt});this.parent.element.appendChild(i),this.errorPopUp=new pS({animationSettings:{effect:"Fade"},allowDragging:!1,header:e,content:t,isModal:!0,visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:this.closeErrorDialog.bind(this),isFlat:!1,buttonModel:{cssClass:vlt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}}],cssClass:this.parent.cssClass,closeOnEscape:!0,target:document.body,close:this.removeErrorDialog.bind(this)}),this.errorPopUp.isStringTemplate=!0,this.errorPopUp.appendTo(i)},xgt.prototype.closeErrorDialog=function(){this.errorPopUp.close()},xgt.prototype.removeErrorDialog=function(){this.errorPopUp&&!this.errorPopUp.isDestroyed&&(this.errorPopUp.destroy(),this.errorPopUp=null),document.getElementById(this.parent.parentID+"_ErrorDialog")&&ue(document.getElementById(this.parent.parentID+"_ErrorDialog"))};var Agt=xgt;function xgt(e){this.parent=e}Tgt.prototype.createFilterDialog=function(t,i,n,e){var o=this,r=Q("div",{id:this.parent.parentID+"_EditorTreeView",className:"e-member-editor-dialog "+("olap"===this.parent.dataType?"e-olap-editor-dialog":"")+(this.parent.isDataOverflow?" "+Pdt:""),attrs:{"data-fieldName":i,"aria-label":n}}),s=this.parent.engineModule.fieldList[i].caption,a=this.parent.localeObj.getConstant("filter")+' "'+n+'" '+this.parent.localeObj.getConstant("by"),a=(this.filterObject=this.getFilterObject(i),this.isSearchEnabled=!1,this.allowExcelLikeFilter=this.isExcelFilter(i),this.parent.element.appendChild(r),this.dialogPopUp=new pS({animationSettings:{effect:this.allowExcelLikeFilter?"None":"Fade"},allowDragging:!1,header:this.allowExcelLikeFilter?a:s,content:"",isModal:!0,visible:!0,showCloseIcon:!!this.allowExcelLikeFilter,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"320px",height:this.parent.isDataOverflow?this.allowExcelLikeFilter?"440px":"400px":this.allowExcelLikeFilter?"400px":"350px",position:{X:"center",Y:"center"},buttons:[{isFlat:!1,buttonModel:{cssClass:"e-clear-filter-button"+(this.allowExcelLikeFilter?"":" "+Eat)+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:"e-icons e-clear-filter-icon",enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("clearFilter"),disabled:!this.filterObject}},{isFlat:!1,buttonModel:{cssClass:vlt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:this.closeFilterDialog.bind(this),isFlat:!1,buttonModel:{cssClass:blt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:"Popup"!==this.parent.renderMode,target:e,cssClass:this.parent.cssClass,close:this.removeFilterDialog.bind(this)}),this.dialogPopUp.isStringTemplate=!0,this.dialogPopUp.appendTo(r),{cancel:!1,fieldName:i,fieldMembers:this.parent.dataSourceSettings.allowMemberFilter?t:[],filterSetting:this.filterObject});("pivotfieldlist"===this.parent.moduleName&&this.parent.control.isPopupView?this.parent.control.pivotGridModule:this.parent.control).trigger(nct,a,function(e){e.cancel?(o.dialogPopUp.close(),o.dialogPopUp=void 0):(t=e.fieldMembers,o.allowExcelLikeFilter?(o.createTabMenu(t,n,i),U([o.dialogPopUp.element],"e-excel-filter")):o.dialogPopUp.content=o.createTreeView(t,n,i),o.updateCheckedState(),gt(o.dialogPopUp.element,{visibility:"visible"}),o.allowExcelLikeFilter&&o.dialogPopUp.element.querySelector(".e-dlg-closeicon-btn").focus(),o.memberTreeView.nodeChecked=o.parent.control.pivotButtonModule.nodeStateModified.bind(o.parent.control.pivotButtonModule),o.allMemberSelect.nodeChecked=o.parent.control.pivotButtonModule.nodeStateModified.bind(o.parent.control.pivotButtonModule))})},Tgt.prototype.createTreeView=function(e,t,i){var n=this,o=Q("div",{id:this.parent.parentID+"EditorDiv",className:plt+(this.allowExcelLikeFilter?" e-excelfilter":"")}),r=Q("button",{id:this.parent.parentID+"_LevelDiv",className:"e-level-container-class",attrs:{type:"button"}}),s=Q("div",{id:this.parent.parentID+"_SearchDiv",attrs:{tabindex:"-1"},className:dht}),a=this.parent.engineModule.fieldList[i].caption,l=Q("input",{attrs:{type:"text",className:"e-editor-search-input"}}),h=this.parent.isDataOverflow?this.parent.currentTreeItems.length-this.parent.control.maxNodeLimitInMemberEditor+this.parent.control.localeObj.getConstant("editorDataLimitMsg"):"",d=Q("div",{id:this.parent.parentID+"_LabelDiv",attrs:{tabindex:"-1",title:h},className:"e-editor-label-container"}),h=(this.parent.editorLabelElement=Q("label",{className:"e-editor-label"}),this.parent.editorLabelElement.innerText=h,d.style.display=this.parent.isDataOverflow?"block":"none",d.appendChild(this.parent.editorLabelElement),s.appendChild(l),this.createSortOptions(i,s,e),Q("div",{id:this.parent.parentID+"_AllDiv",attrs:{tabindex:"-1"},className:"e-select-all-container"})),p=Q("div",{id:this.parent.parentID+"_SelectAllContainer",className:cht}),c=Q("div",{className:clt+"-outer-div"}),u=Q("div",{className:clt}),g=Q("div",{className:Lht+" "+Eat}),r=(g.innerText=this.parent.localeObj.getConstant("noMatches"),"olap"!==this.parent.dataType||!this.parent.control.loadOnDemandInMemberEditor||this.parent.engineModule.fieldList[i].isHierarchy||this.parent.engineModule.fieldList[i].isNamedSets||(s.appendChild(r),this.createLevelWrapper(r,i)),h.appendChild(p),o.appendChild(s),o.appendChild(h),o.appendChild(g),this.editorSearch=new LR({placeholder:this.parent.localeObj.getConstant("search")+" &#8220"+a+"&#8220",enableRtl:this.parent.enableRtl,cssClass:pht+(this.parent.cssClass?" "+this.parent.cssClass:""),showClearButton:!0,change:function(e){"olap"===n.parent.dataType?n.searchOlapTreeView(e,g):(n.parent.eventBase.searchTreeNodes(e,n.memberTreeView,!1),e=n.dialogPopUp.element,(0===[].slice.call(n.memberTreeView.element.querySelectorAll("li")).length?(n.allMemberSelect.disableNodes([n.allMemberSelect.element.querySelector("li")]),e.querySelector("."+vlt).setAttribute("disabled","disabled"),q):(n.allMemberSelect.enableNodes([n.allMemberSelect.element.querySelector("li")]),e.querySelector("."+vlt).removeAttribute("disabled"),U))([g],Eat),n.updateCheckedState())}}),this.editorSearch.isStringTemplate=!0,this.editorSearch.appendTo(l),{"data-fieldName":i,"data-memberId":"all"}),s=[{id:"all",name:this.parent.localeObj.getConstant("all"),isSelected:!0,htmlAttributes:r}];if(this.allMemberSelect=new PW({fields:{dataSource:s,id:"id",text:"name",isChecked:"isSelected"},showCheckBox:!0,expandOn:"None",enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,nodeClicked:this.nodeCheck.bind(this,!0),keyPress:this.nodeCheck.bind(this,!0),nodeSelected:function(e){q([e.node],"e-active"),e.cancel=!0},cssClass:this.parent.cssClass}),this.allMemberSelect.isStringTemplate=!0,!je(this.parent.currentTreeItems))for(var m=0;m<this.parent.currentTreeItems.length;m++)!this.parent.currentTreeItems[m].id.indexOf("\n")&&0!==this.parent.currentTreeItems[m].id.indexOf("\n")||(this.parent.currentTreeItems[m].id=this.parent.currentTreeItems[m].id.replace("\n"," "));return this.allMemberSelect.appendTo(p),c.appendChild(u),o.appendChild(c),this.memberTreeView=new PW({fields:{dataSource:e,id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},showCheckBox:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,nodeChecking:this.validateTreeNode.bind(this),nodeClicked:this.nodeCheck.bind(this,!1),keyPress:this.nodeCheck.bind(this,!1),nodeExpanding:this.updateChildNodes.bind(this),nodeSelected:function(e){q([e.node],"e-active"),e.cancel=!0},expandOn:"None",cssClass:this.parent.cssClass}),this.memberTreeView.isStringTemplate=!0,this.memberTreeView.appendTo(u),this.parent.isDataOverflow&&this.parent.control.maxNodeLimitInMemberEditor<this.parent.currentTreeItems.length&&o.appendChild(d),o},Tgt.prototype.createSortOptions=function(e,t,i){var n,o;"pivot"===this.parent.dataType&&i&&0<i.length&&(i=this.parent.engineModule.fieldList[e].sort,n=Q("div",{className:Xlt+" e-btn-group"+(this.parent.enableRtl?" "+xat:"")+(this.parent.cssClass?" "+this.parent.cssClass:""),id:this.parent.element.id+"_Member_Sort"}),this.parent.element.appendChild(n),o=Q("button",{className:("Ascending"===i?Zlt+" ":"")+tlt,id:this.parent.element.id+"_Sort_Ascend",attrs:{type:"button","aria-label":"button"}}),i=Q("button",{className:("Descending"===i?Zlt+" ":"")+tlt,id:this.parent.element.id+"_Sort_Descend",attrs:{type:"button","aria-label":"button"}}),new zv({iconCss:Tat+" "+Klt,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}).appendTo(o),new zv({iconCss:Tat+" "+Jlt,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}).appendTo(i),n.appendChild(o),n.appendChild(i),t.appendChild(n),this.unWireEvent(o),this.unWireEvent(i),this.wireEvent(o,e),this.wireEvent(i,e))},Tgt.prototype.createLevelWrapper=function(e,r){for(var s=this,t=this.parent.engineModule,i=t.fieldList[r].levels,t=t.fieldList[r].levelCount,a=[],n=0,o=i.length;n<o;n++)a.push({id:i[n].id,text:i[n].name});this.dropMenu=new u2({cssClass:"e-level-drop e-caret-hide"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:a,iconCss:"e-icons e-dropdown-icon",disabled:t===i.length,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeOpen:function(e){var t=[].slice.call(e.element.querySelectorAll("li")),i=s.parent.engineModule.fieldList[r].levelCount;q(t,Bht);for(var n=0,o=t.length;n<o;n++)n<i&&U([t[n]],Bht)},select:function(e){for(var t,i=s.dialogPopUp.element.getAttribute("data-fieldname"),n=s.parent.engineModule,o=0,r=a.length;o<r;o++)a[o].id===e.item.id&&(t=o);n.getFilterMembers(s.parent.dataSourceSettings,i,t+1,!1,!0)},close:function(){var e=s.parent.engineModule,t=e.fieldList[r].levels;e.fieldList[r].levelCount===t.length?(s.dropMenu.disabled=!0,s.dropMenu.dataBind()):s.dropMenu.disabled=!1}}),this.dropMenu.appendTo(e)},Tgt.prototype.searchOlapTreeView=function(r,s){var a=this;clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){var e,t=a.parent.engineModule,i=a.dialogPopUp.element,n=i.getAttribute("data-fieldname"),o=a.parent.control.maxNodeLimitInMemberEditor||5e3;t.fieldList[n].isHierarchy?a.parent.eventBase.searchTreeNodes(r,a.memberTreeView,!1,!0):(a.dropMenu&&""!==r.value?a.dropMenu.disabled=!0:a.dropMenu.disabled=!1,a.parent.control.loadOnDemandInMemberEditor?(e=t.fieldList[n].levelCount||1,t.getSearchMembers(a.parent.dataSourceSettings,n,r.value.toLowerCase(),o,!1,e)):t.getSearchMembers(a.parent.dataSourceSettings,n,r.value.toLowerCase(),o,!0),a.parent.eventBase.searchTreeNodes(r,a.memberTreeView,!1,!1)),(0===[].slice.call(a.memberTreeView.element.querySelectorAll("li")).length?(a.allMemberSelect.disableNodes([a.allMemberSelect.element.querySelector("li")]),i.querySelector("."+vlt).setAttribute("disabled","disabled"),q):(a.allMemberSelect.enableNodes([a.allMemberSelect.element.querySelector("li")]),i.querySelector("."+vlt).removeAttribute("disabled"),U))([s],Eat),a.updateCheckedState()},500)},Tgt.prototype.nodeCheck=function(e,t){var i,n=[t.node];t.event.target.classList.contains("e-fullrow")||"Enter"===t.event.key?"true"===(i=e?this.allMemberSelect:this.memberTreeView).getNode(t.node).isChecked?i.uncheckAll(n):i.checkAll(n):38!==t.event.keyCode||e||(q(this.memberTreeView.element.querySelectorAll("li.e-prev-active-node"),"e-prev-active-node"),U(n,"e-prev-active-node"))},Tgt.prototype.applySorting=function(e,t){var i,t=z(t.target,"."+tlt);t&&(i=[].slice.call(z(t,"."+Xlt).querySelectorAll("."+tlt)),t.querySelector("."+Klt)&&!t.classList.contains(Zlt)?(this.updateFilterMembers("Ascending",e),U([t],Zlt),q([i[1]],Zlt)):t.querySelector("."+Jlt)&&!t.classList.contains(Zlt)?(this.updateFilterMembers("Descending",e),U([t],Zlt),q([i[0]],Zlt)):(this.updateFilterMembers("None",e),q(i,Zlt)))},Tgt.prototype.updateFilterMembers=function(e,t){var i=this.parent.engineModule.fieldList[t],n="None"===e?Hdt.getClonedData(i.dateMember):this.parent.currentTreeItems.slice(),o=!!i.isAlphanumeric||void 0,r=!1,i=i&&i.membersOrder?i.membersOrder.slice():[],s={fieldName:t,sortOrder:e,members:i&&0<i.length?i:Object.keys(n),IsOrderChanged:!1},i=(i&&0<i.length?n=Hdt.applyCustomSort(s,n,o):(i=!je(i=this.parent.dataSourceSettings.groupSettings.filter(function(e){return e.name===t&&"number"===e.type.toLocaleLowerCase()}))&&0<i.length,n=Hdt.applyHeadersSort(n,s.sortOrder,o,i),r=!0),"pivotfieldlist"===this.parent.moduleName&&this.parent.control.isPopupView?this.parent.control.pivotGridModule:this.parent.control);if(r){for(var a=[],l=0,h=0;l<n.length;l++)"Grand Total"!==n[l].actualText&&(a[h++]=n[l].actualText);s.members=a}i.trigger(Xpt,s),s.IsOrderChanged&&(n=Hdt.applyCustomSort(s,n,o,!0)),this.parent.currentTreeItems=[],this.parent.searchTreeItems=[];for(var d,p=[],c=t.replace(/[^a-zA-Z0-9 ]/g,"_"),u=this.parent.engineModule,g=0,m=n.length;g<m;g++)"None"===e?(d=n[g].actualText.toString(),d={id:c+"_"+(g+1),htmlAttributes:{"data-fieldName":t,"data-memberId":d},actualText:n[g].actualText,name:(this.parent.isDateField?n[g]:u.getFormattedValue(d,t)).formattedText,isSelected:this.parent.currentTreeItemsPos[n[g].actualText].isSelected},this.parent.currentTreeItems.push(d),(""===this.editorSearch.value||-1<d.name.toLowerCase().indexOf(this.editorSearch.value.toLowerCase()))&&(this.parent.searchTreeItems.push(d),p.push(d))):(this.parent.currentTreeItems.push(n[g]),(""===this.editorSearch.value||-1<n[g].name.toLowerCase().indexOf(this.editorSearch.value.toLowerCase()))&&(this.parent.searchTreeItems.push(n[g]),p.push(n[g]))),this.parent.currentTreeItemsPos[n[g].actualText].index=g;r=this.memberTreeView.fields.dataSource.length;this.memberTreeView.fields={dataSource:p.slice(0,r),id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},this.memberTreeView.dataBind()},Tgt.prototype.updateChildNodes=function(e){if("olap"===this.parent.dataType){var t=this.parent.engineModule,i=e.node.getAttribute("data-fieldname"),n=t.fieldList[i],o=[];if(n&&0<n.filterMembers.length&&!this.isSearchEnabled&&!n.members[e.nodeData.id].isNodeExpand){for(var r=[],s=0,a=n.filterMembers;s<a.length;s++){var l=a[s];l.pid===e.nodeData.id.toString()&&r.push(l)}0===r.length&&(n.childMembers=[],t.getChildMembers(this.parent.dataSourceSettings,e.nodeData.id.toString(),i),r=n.childMembers,n.childMembers=[]);var h=Hdt.getClonedData(r),d=this.memberTreeView.fields.dataSource,p=!1;je(this.filterObject)||(p="Include"===this.filterObject.type,o=this.filterObject.items||[]),h=this.updateChildData(p,h,o,i,e.nodeData);for(var c=0,u=h=this.parent.eventBase.sortOlapFilterData(h,t.fieldList[i].sort);c<u.length;c++){var g=u[c];d.push(g)}n.members[e.nodeData.id].isNodeExpand=!0,this.memberTreeView.addNodes(h,e.node)}}},Tgt.prototype.updateChildData=function(e,t,i,n,o){for(var r=Object.keys(this.parent.currentTreeItemsPos).length,s=this.parent.engineModule.fieldList[n],a=[],l=1,h=0,d=t;h<d.length;h++){var p=d[h],c=p,u=p.id.toString();s.members[u].isNodeExpand=!1,p.isSelected="true"===o.isChecked,l<=this.parent.control.maxNodeLimitInMemberEditor&&a.push(c),this.parent.currentTreeItems.push(c),this.parent.searchTreeItems.push(c),this.parent.currentTreeItemsPos[u]={index:r,isSelected:c.isSelected},r++,l++}return this.parent.isDataOverflow=!1,a},Tgt.prototype.createTabMenu=function(e,t,i){for(var n=Q("div",{id:this.parent.parentID+"_FilterTabContainer",className:"e-filter-tab-container",attrs:{tabindex:"-1"}}),o=(this.dialogPopUp.content=n,this.dialogPopUp.dataBind(),["Label","Value","Include","Exclude"]),r="((-|\\+)?[0-9]+(\\.[0-9]+)?)+",s=Object.keys(this.parent.engineModule.fieldList[i].members)[0],a=this.parent.engineModule.fieldList[i].type,l=Hdt.getFieldByName(i,this.parent.dataSourceSettings.formatSettings),h=[{header:{text:this.parent.localeObj.getConstant("member"),iconCss:this.filterObject&&1<o.indexOf(this.filterObject.type)?Wlt:""},content:this.createTreeView(e,t,i)}],d=0,p=o;d<p.length;d++){var c=p[d];("Label"===c&&this.parent.dataSourceSettings.allowLabelFilter||"Value"===c&&this.parent.dataSourceSettings.allowValueFilter)&&(c={header:{text:"Number"===(c="Label"===c&&s&&s.match(r)&&s.match(r)[0].length===s.length&&"number"===a?"Number":"Label"===c&&s&&"Invalid Date"!==new Date(s).toString()&&(l&&l.type||this.filterObject&&"Date"===this.filterObject.type)?"Date":c)?this.parent.localeObj.getConstant("label"):this.parent.localeObj.getConstant(c.toLowerCase()),iconCss:this.filterObject&&this.filterObject.type===c?Wlt:""},content:this.createCustomFilter(i,this.filterObject&&this.filterObject.type===c?this.filterObject:void 0,c.toLowerCase())},h.push(c))}e=this.filterObject?0<=["Label","Date","Number"].indexOf(this.filterObject.type)?1:"Value"===this.filterObject.type?this.parent.dataSourceSettings.allowLabelFilter&&this.parent.dataSourceSettings.allowValueFilter?2:1:0:0,e=this.parent.dataSourceSettings.allowMemberFilter||0!=e?e:1;this.tabObj=new k5({heightAdjustMode:"Auto",items:h,height:"100%",selectedItem:e,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass}),this.tabObj.isStringTemplate=!0,this.tabObj.appendTo(n),this.parent.dataSourceSettings.allowMemberFilter||this.tabObj.hideTab(0),0<e&&U([this.dialogPopUp.element.querySelector(".e-filter-div-content."+(1==e&&this.parent.dataSourceSettings.allowLabelFilter?"e-label-filter":"e-value-filter"))],"e-selected-tab")},Tgt.prototype.createCustomFilter=function(e,t,i){for(var n=[],o=[],r=[],s=this.parent.dataSourceSettings.values,a="DoesNotEquals",l=0,h=0,d={label:["Equals","DoesNotEquals","BeginWith","DoesNotBeginWith","EndsWith","DoesNotEndsWith","Contains","DoesNotContains","GreaterThan","GreaterThanOrEqualTo","LessThan","LessThanOrEqualTo","Between","NotBetween"],date:["Equals","DoesNotEquals","Before","BeforeOrEqualTo","After","AfterOrEqualTo","Between","NotBetween"],value:["Equals","DoesNotEquals","GreaterThan","GreaterThanOrEqualTo","LessThan","LessThanOrEqualTo","Between","NotBetween"]},p=["Between","NotBetween"],c="label"===i?d.label:"date"===i?d.date:d.value,u=0,g=c;u<g.length;u++){var m=g[u],a=t&&m===t.condition?0<=c.indexOf(t.condition)?t.condition:c[0]:a;n.push({value:m,text:this.parent.localeObj.getConstant(m)})}for(var f=s.length;f--;)o.unshift({value:s[f].name,text:s[f].caption||s[f].name}),l=t&&"Value"===t.type&&t.measure===s[f].name&&t.condition===a?f:l;if("olap"===this.parent.dataType){var d=this.parent.engineModule,y=d.fieldList[e].levels;if(this.parent.engineModule.fieldList[e].isHierarchy){for(var v=void 0,b=0,w=this.parent.engineModule.fieldListData;b<w.length;b++){var C=w[b];if(C&&C.pid===e){v=C;break}}r.push({value:v?v.id:e,text:v?v.caption:d.fieldList[e].name}),h=0,t&&t.name===e&&t.type.toLowerCase()===i&&(r[r.length-1].iconClass=Tat+" "+Qlt)}else for(var S=0,O=y.length;S<O;S++){h=t&&t.selectedField===y[S].id?S:h,r.push({value:y[S].id,text:y[S].name});for(var A=0,x=this.parent.dataSourceSettings.filterSettings;A<x.length;A++){var I=x[A];if(I.name===e&&I.selectedField===y[S].id&&I.type.toLowerCase()===i){r[r.length-1].iconClass=Tat+" "+Qlt;break}}}}var d=Q("div",{className:"e-filter-div-content e-"+(0<=["date","number"].indexOf(i)?"label":i)+"-filter"+(this.parent.isDataOverflow?" "+Pdt:""),id:this.parent.parentID+"_"+i+"_filter_div_content",attrs:{"data-type":i,"data-fieldName":e,"data-operator":a,"data-selectedField":"olap"===this.parent.dataType&&0<r.length?r[h].value.toString():"","data-measure":0<this.parent.dataSourceSettings.values.length?this.parent.dataSourceSettings.values[l].name:"","data-value1":t&&a===t.condition&&t.value1?t.value1.toString():"","data-value2":t&&a===t.condition&&t.value2?t.value2.toString():""}}),T=Q("div",{className:"e-filter-text-div"}),E=(T.innerText=this.parent.localeObj.getConstant(i+"TextContent"),Q("div",{className:Ult+" "+(-1===p.indexOf(a)?Eat:"")})),D=(E.innerText=this.parent.localeObj.getConstant("And"),Q("div",{className:"e-separator-div"})),M=Q("div",{className:"e-filter-option-container-1"}),k=Q("div",{className:"e-level-option-container "+("olap"===this.parent.dataType?"":Eat)}),P=Q("div",{className:"e-measure-option-container "+(0<=["label","date","number"].indexOf(i)?Eat:"")}),B=Q("div",{className:"e-condition-option-container"}),F=Q("div",{className:"e-filter-option-container-2"}),L=Q("div",{id:this.parent.parentID+"_"+i+"_level_option_container"}),R=Q("div",{id:this.parent.parentID+"_"+i+"_measure_option_container"}),N=Q("div",{id:this.parent.parentID+"_"+i+"_contition_option_container"}),V=Q("div",{className:"e-filter-input-div-1"}),_=Q("div",{className:qlt+" "+(-1===p.indexOf(a)?Eat:"")}),H=Q("input",{id:this.parent.parentID+"_"+i+"_input_option_1",attrs:{type:"text"}}),z=Q("input",{id:this.parent.parentID+"_"+i+"_input_option_2",attrs:{type:"text"}});return V.appendChild(H),_.appendChild(z),k.appendChild(L),k.appendChild(D.cloneNode(!0)),P.appendChild(R),P.appendChild(D),B.appendChild(N),M.appendChild(k),M.appendChild(P),M.appendChild(B),F.appendChild(V),F.appendChild(E),F.appendChild(_),this.createElements(t,p,R,N,H,z,o,n,l,a,i,L,r,h),d.appendChild(T),d.appendChild(M),d.appendChild(F),d},Tgt.prototype.createElements=function(e,r,t,i,d,p,c,n,o,s,a,l,h,u){var g,m,f,y,v,b,w=this,C=("olap"===this.parent.dataType&&((h=new qz({dataSource:h,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text",iconCss:"iconClass"},index:u,cssClass:"e-level-options"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var t,i=w.dialogPopUp.element.querySelector(".e-selected-tab"),n=i.getAttribute("data-fieldName"),o=i.getAttribute("data-type");if(!je(i)){w.updateInputValues(i,o,d,p),zP(i,{"data-selectedField":e.value});for(var r,s,a=0,l=w.parent.dataSourceSettings.filterSettings;a<l.length;a++){var h=l[a];if(h.name===n&&h.selectedField===e.value){t=h;break}}t&&("value"===o&&t.measure&&""!==t.measure&&(C.value=t.measure||c[0].value),t.condition?S.value=t.condition||"DoesNotEquals":S.value="DoesNotEquals",s=r=void 0,"value"===o?(r=K(d,NL),s=K(p,NL),r&&(r.value=t.value1?parseInt(t.value1,10):void 0),s&&(s.value=t.value2?parseInt(t.value2,10):void 0)):(r=K(d,LR),s=K(p,LR),r&&(r.value=t.value1||""),s&&(s.value=t.value2||""))),w.updateInputValues(i,o,d,p)}}})).isStringTemplate=!0,h.appendTo(l)),new qz({dataSource:c,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text"},index:o,cssClass:Glt+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var t=w.dialogPopUp.element.querySelector(".e-selected-tab");je(t)||(w.updateInputValues(t,a,d,p),zP(t,{"data-measure":e.value}))}})),S=(C.isStringTemplate=!0,C.appendTo(t),new qz({dataSource:n,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text"},value:s,cssClass:Ylt+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var t=w.dialogPopUp.element.querySelector(".e-selected-tab");if(!je(t)){w.updateInputValues(t,a,d,p);for(var i=0,n=[Ult,qlt];i<n.length;i++){var o=n[i];(0<=r.indexOf(e.value)?q:U)([t.querySelector("."+o)],Eat)}zP(t,{"data-operator":e.value})}}}));S.isStringTemplate=!0,S.appendTo(i),("date"===a?(g=new jq({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,format:"dd/MM/yyyy hh:mm:ss a",showClearButton:!0,value:e&&s===e.condition?"string"==typeof e.value1?new Date(e.value1):e.value1:null,change:function(e){var t=w.dialogPopUp.element.querySelector(".e-selected-tab");je(t)||zP(t,{"data-value1":e.value,"data-value2":m.value})},width:"100%",cssClass:this.parent.cssClass}),m=new jq({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,format:"dd/MM/yyyy hh:mm:ss a",showClearButton:!0,value:e&&s===e.condition?"string"==typeof e.value2?new Date(e.value2):e.value2:null,change:function(e){var t=w.dialogPopUp.element.querySelector(".e-selected-tab");je(t)||zP(t,{"data-value1":g.value,"data-value2":e.value})},width:"100%",cssClass:this.parent.cssClass}),g.isStringTemplate=!0,g.appendTo(d),m.isStringTemplate=!0,m):"value"===a?(f=new NL({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,format:"###.##",value:e&&s===e.condition?parseInt(e.value1,10):void 0,change:function(e){var t=w.dialogPopUp.element.querySelector(".e-selected-tab");je(t)||zP(t,{"data-value1":e.value?e.value.toString():"0","data-value2":y.value?y.value.toString():"0"})},width:"100%",cssClass:this.parent.cssClass}),y=new NL({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,format:"###.##",value:e&&s===e.condition?parseInt(e.value2,10):void 0,change:function(e){var t=w.dialogPopUp.element.querySelector(".e-selected-tab");je(t)||zP(t,{"data-value1":f.value?f.value.toString():"0","data-value2":e.value?e.value.toString():"0"})},width:"100%",cssClass:this.parent.cssClass}),f.isStringTemplate=!0,f.appendTo(d),y.isStringTemplate=!0,y):(v=new LR({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,value:e&&s===e.condition?e.value1:"",change:function(e){var t=w.dialogPopUp.element.querySelector(".e-selected-tab");je(t)||zP(t,{"data-value1":e.value,"data-value2":b.value})},width:"100%",cssClass:this.parent.cssClass}),b=new LR({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,value:e&&s===e.condition?e.value2:"",change:function(e){var t=w.dialogPopUp.element.querySelector(".e-selected-tab");je(t)||zP(t,{"data-value1":v.value,"data-value2":e.value})},width:"100%",cssClass:this.parent.cssClass}),v.isStringTemplate=!0,v.appendTo(d),b.isStringTemplate=!0,b)).appendTo(p)},Tgt.prototype.updateInputValues=function(e,t,i,n){i=K(i,"date"===t?jq:"value"===t?NL:LR),n=K(n,"date"===t?jq:"value"===t?NL:LR);zP(e,{"data-value1":je(i.value)?"":i.value.toString(),"data-value2":je(n.value)?"":n.value.toString()})},Tgt.prototype.validateTreeNode=function(e){e.node.classList.contains(Eat)&&(e.cancel=!0)},Tgt.prototype.updateCheckedState=function(){var e=this.dialogPopUp.element,t=[].slice.call(this.memberTreeView.element.querySelectorAll("li")),i=e.getAttribute("data-fieldname"),n=this.getUnCheckedNodes(i),o=this.getCheckedNodes(i),r=this.allMemberSelect.element.querySelector("li").querySelector("span.e-frame");0<t.length?0<o?(0<n?(q([r],flt),U([r],ylt),this.allMemberSelect.element.querySelector("li").setAttribute("aria-checked","false")):0===n&&(q([r],ylt),U([r],flt)),this.dialogPopUp.buttons[0].buttonModel.disabled=!1,e.querySelector("."+vlt).removeAttribute("disabled")):0<n&&0===o&&(q([r],[flt,ylt]),this.getCheckedNodes(i)===o)&&(this.dialogPopUp.buttons[0].buttonModel.disabled=!0,e.querySelector("."+vlt).setAttribute("disabled","disabled")):(this.dialogPopUp.buttons[0].buttonModel.disabled=!0,e.querySelector("."+vlt).setAttribute("disabled","disabled"))},Tgt.prototype.getCheckedNodes=function(e){var t=this.parent.engineModule,i=[];if("olap"===this.parent.dataType&&t&&!t.fieldList[e].isHierarchy)return this.memberTreeView.getAllCheckedNodes().length;for(var n=0,o=this.parent.searchTreeItems;n<o.length;n++){var r=o[n];r.isSelected&&i.push(r)}return i.length},Tgt.prototype.getUnCheckedNodes=function(e){var t=[],i=this.parent.engineModule;if("olap"===this.parent.dataType&&i&&!i.fieldList[e].isHierarchy)return i=this.memberTreeView.getAllCheckedNodes(),this.memberTreeView.fields.dataSource.length-i.length;for(var n=0,o=this.parent.searchTreeItems;n<o.length;n++){var r=o[n];r.isSelected||t.push(r)}return t.length},Tgt.prototype.isExcelFilter=function(e){for(var t=!1,i=0,n=this.parent.dataSourceSettings.filters;i<n.length;i++)if(n[i].name===e){t=!0;break}return!(t||!this.parent.dataSourceSettings.allowLabelFilter&&!this.parent.dataSourceSettings.allowValueFilter)},Tgt.prototype.getFilterObject=function(e){var t=Hdt.getFilterItemByName(e,Hdt.cloneFilterSettings(this.parent.dataSourceSettings.filterSettings));if(t&&(0<=["Label","Date","Number"].indexOf(t.type)&&this.parent.dataSourceSettings.allowLabelFilter||"Value"===t.type&&this.parent.dataSourceSettings.allowValueFilter||0<=["Include","Exclude"].indexOf(t.type)&&this.parent.eventBase.isValidFilterItemsAvail(e,t)))return t},Tgt.prototype.wireEvent=function(e,t){E.add(e,"click",this.applySorting.bind(this,t),this)},Tgt.prototype.unWireEvent=function(e){E.remove(e,"click",this.applySorting)},Tgt.prototype.closeFilterDialog=function(){this.dialogPopUp.close()},Tgt.prototype.removeFilterDialog=function(){this.editorSearch&&!this.editorSearch.isDestroyed&&(this.editorSearch.destroy(),this.editorSearch=null),this.allowExcelLikeFilter&&this.tabObj&&!this.tabObj.isDestroyed&&(this.tabObj.destroy(),this.tabObj=null),this.dropMenu&&!this.dropMenu.isDestroyed&&(this.dropMenu.destroy(),this.dropMenu=null),this.memberTreeView&&!this.memberTreeView.isDestroyed&&(this.memberTreeView.destroy(),this.memberTreeView=null),this.allMemberSelect&&!this.allMemberSelect.isDestroyed&&(this.allMemberSelect.destroy(),this.allMemberSelect=null),document.getElementById(this.parent.parentID+"_LevelDiv-popup")&&ue(document.getElementById(this.parent.parentID+"_LevelDiv-popup")),this.dialogPopUp&&!this.dialogPopUp.isDestroyed&&(this.dialogPopUp.destroy(),this.dialogPopUp=null,setTimeout(this.setFocus.bind(this))),document.getElementById(this.parent.parentID+"_EditorTreeView")&&ue(document.getElementById(this.parent.parentID+"_EditorTreeView"))},Tgt.prototype.setFocus=function(){if(this.parent.control.pivotButtonModule.parentElement)for(var e=0,t=[].slice.call(this.parent.control.pivotButtonModule.parentElement.querySelectorAll(".e-pivot-button"));e<t.length;e++){var i=t[e];if(i.getAttribute("data-uid")===this.parent.control.pivotButtonModule.fieldName){i.focus();break}}};var Igt=Tgt;function Tgt(e){this.parent=e}Dgt.prototype.destroy=function(){this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null)};var Egt=Dgt;function Dgt(e){return this.currentTreeItems=[],this.savedTreeFilterPos={},this.currentTreeItemsPos={},this.searchTreeItems=[],this.isDataOverflow=!1,this.isDateField=!1,this.element=e.element,this.moduleName=e.moduleName,this.dataSourceSettings=e.dataSourceSettings,this.engineModule=e.pivotEngine,this.enableRtl=e.enableRtl,this.enableHtmlSanitizer=e.enableHtmlSanitizer,this.isAdaptive=e.isAdaptive,this.renderMode=e.renderMode,this.parentID=e.id,this.localeObj=e.localeObj,this.dataType=e.dataType,this.cssClass=e.cssClass,this.nodeStateModified=new bgt(this),this.dataSourceUpdate=new Cgt(this),this.eventBase=new ygt(this),this.filterDialog=new Igt(this),this.errorDialog=new Agt(this),this.keyboardModule=new mgt(this),this}kgt.prototype.getModuleName=function(){return"common"},kgt.prototype.initiateCommonModule=function(){var e;this.parent.pivotCommon?(this.parent.pivotCommon.element=this.parent.element,this.parent.pivotCommon.engineModule="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.parent.pivotCommon.parentID=this.parent.element.id,this.parent.pivotCommon.dataSourceSettings=this.parent.dataSourceSettings.properties||this.parent.dataSourceSettings,this.parent.pivotCommon.moduleName=this.parent.getModuleName(),this.parent.pivotCommon.enableRtl=this.parent.enableRtl,this.parent.pivotCommon.isAdaptive=F.isDevice,this.parent.pivotCommon.renderMode="Popup",this.parent.pivotCommon.localeObj=this.parent.localeObj,this.parent.pivotCommon.dataType=this.parent.dataType,this.parent.pivotCommon.cssClass=this.parent.cssClass):(e={pivotEngine:"olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,dataSourceSettings:this.parent.dataSourceSettings.properties||this.parent.dataSourceSettings,id:this.parent.element.id,element:this.parent.element,moduleName:this.parent.getModuleName(),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,isAdaptive:F.isDevice,renderMode:"Popup",localeObj:this.parent.localeObj,dataType:this.parent.dataType,cssClass:this.parent.cssClass},this.parent.pivotCommon=new Egt(e)),this.parent.pivotCommon.control=this.parent},kgt.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(gct,this.initiateCommonModule,this),this.parent.on(mct,this.initiateCommonModule,this))},kgt.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(gct,this.initiateCommonModule),this.parent.off(mct,this.initiateCommonModule))},kgt.prototype.destroy=function(){this.removeEventListener(),this.parent.pivotCommon&&(this.parent.pivotCommon.destroy(),this.parent.pivotCommon=null)};var Mgt=kgt;function kgt(e){this.parent=e,(this.parent.commonModule=this).addEventListener()}Pgt=function(e,t){return(Pgt=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])}))(e,t)};var Pgt,Bgt,est=function(e,t){function i(){this.constructor=e}Pgt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},ist=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},ost=(est(Fgt,Bgt=n),ist([e()],Fgt.prototype,"name",void 0),ist([e()],Fgt.prototype,"caption",void 0),ist([e("Sum")],Fgt.prototype,"type",void 0),ist([e()],Fgt.prototype,"axis",void 0),ist([e(!1)],Fgt.prototype,"showNoDataItems",void 0),ist([e()],Fgt.prototype,"baseField",void 0),ist([e()],Fgt.prototype,"baseItem",void 0),ist([e(!0)],Fgt.prototype,"showSubTotals",void 0),ist([e(!1)],Fgt.prototype,"isNamedSet",void 0),ist([e(!1)],Fgt.prototype,"isCalculatedField",void 0),ist([e(!0)],Fgt.prototype,"showFilterIcon",void 0),ist([e(!0)],Fgt.prototype,"showSortIcon",void 0),ist([e(!0)],Fgt.prototype,"showRemoveIcon",void 0),ist([e(!0)],Fgt.prototype,"showValueTypeIcon",void 0),ist([e(!0)],Fgt.prototype,"showEditIcon",void 0),ist([e(!0)],Fgt.prototype,"allowDragAndDrop",void 0),ist([e()],Fgt.prototype,"dataType",void 0),ist([e(!1)],Fgt.prototype,"expandAll",void 0),ist([e()],Fgt.prototype,"groupName",void 0),Fgt);function Fgt(){return null!==Bgt&&Bgt.apply(this,arguments)||this}est(Rgt,Lgt=ost);var Lgt,jee=Rgt;function Rgt(){return null!==Lgt&&Lgt.apply(this,arguments)||this}est(Ngt,Ogt=n),ist([e()],Ngt.prototype,"backgroundColor",void 0),ist([e()],Ngt.prototype,"color",void 0),ist([e()],Ngt.prototype,"fontFamily",void 0),ist([e()],Ngt.prototype,"fontSize",void 0);var Ogt,Xet=Ngt;function Ngt(){return null!==Ogt&&Ogt.apply(this,arguments)||this}est(_gt,Vgt=n),ist([e()],_gt.prototype,"name",void 0),ist([e("Include")],_gt.prototype,"type",void 0),ist([e()],_gt.prototype,"items",void 0),ist([e("DoesNotEquals")],_gt.prototype,"condition",void 0),ist([e()],_gt.prototype,"value1",void 0),ist([e()],_gt.prototype,"value2",void 0),ist([e()],_gt.prototype,"measure",void 0),ist([e(1)],_gt.prototype,"levelCount",void 0),ist([e()],_gt.prototype,"selectedField",void 0);var Vgt,det=_gt;function _gt(){return null!==Vgt&&Vgt.apply(this,arguments)||this}est(zgt,Hgt=n),ist([e()],zgt.prototype,"measure",void 0),ist([e()],zgt.prototype,"label",void 0),ist([e()],zgt.prototype,"conditions",void 0),ist([e()],zgt.prototype,"value1",void 0),ist([e()],zgt.prototype,"value2",void 0),ist([e()],zgt.prototype,"style",void 0),ist([e(!0)],zgt.prototype,"applyGrandTotals",void 0);var Hgt,q$e=zgt;function zgt(){return null!==Hgt&&Hgt.apply(this,arguments)||this}est(Wgt,jgt=n),ist([e()],Wgt.prototype,"name",void 0),ist([e("Ascending")],Wgt.prototype,"order",void 0),ist([e([])],Wgt.prototype,"membersOrder",void 0);var jgt,W$e=Wgt;function Wgt(){return null!==jgt&&jgt.apply(this,arguments)||this}est(Ugt,Qgt=n),ist([e()],Ugt.prototype,"name",void 0),ist([e()],Ugt.prototype,"minimumFractionDigits",void 0),ist([e()],Ugt.prototype,"maximumFractionDigits",void 0),ist([e()],Ugt.prototype,"minimumSignificantDigits",void 0),ist([e()],Ugt.prototype,"maximumSignificantDigits",void 0),ist([e(!0)],Ugt.prototype,"useGrouping",void 0),ist([e()],Ugt.prototype,"skeleton",void 0),ist([e()],Ugt.prototype,"type",void 0),ist([e()],Ugt.prototype,"currency",void 0),ist([e()],Ugt.prototype,"minimumIntegerDigits",void 0),ist([e()],Ugt.prototype,"format",void 0);var Qgt,Det=Ugt;function Ugt(){return null!==Qgt&&Qgt.apply(this,arguments)||this}est(Ggt,qgt=n),ist([e()],Ggt.prototype,"name",void 0),ist([e()],Ggt.prototype,"groupInterval",void 0),ist([e()],Ggt.prototype,"startingAt",void 0),ist([e()],Ggt.prototype,"endingAt",void 0),ist([e("Date")],Ggt.prototype,"type",void 0),ist([e()],Ggt.prototype,"rangeInterval",void 0),ist([e()],Ggt.prototype,"caption",void 0),ist([e()],Ggt.prototype,"customGroups",void 0);var qgt,h=Ggt;function Ggt(){return null!==qgt&&qgt.apply(this,arguments)||this}est(Xgt,Ygt=n),ist([e()],Xgt.prototype,"groupName",void 0),ist([e([])],Xgt.prototype,"items",void 0);var Ygt,wce=Xgt;function Xgt(){return null!==Ygt&&Ygt.apply(this,arguments)||this}est(Jgt,Kgt=n),ist([e()],Jgt.prototype,"name",void 0),ist([e()],Jgt.prototype,"formula",void 0),ist([e()],Jgt.prototype,"hierarchyUniqueName",void 0),ist([e()],Jgt.prototype,"formatString",void 0);var Kgt,tte=Jgt;function Jgt(){return null!==Kgt&&Kgt.apply(this,arguments)||this}est($gt,Zgt=n),ist([e()],$gt.prototype,"name",void 0),ist([e()],$gt.prototype,"items",void 0),ist([e()],$gt.prototype,"delimiter",void 0);var Zgt,pJ=$gt;function $gt(){return null!==Zgt&&Zgt.apply(this,arguments)||this}est(tmt,emt=n),ist([e()],tmt.prototype,"headerText",void 0),ist([e(".")],tmt.prototype,"headerDelimiter",void 0),ist([e("None")],tmt.prototype,"sortOrder",void 0),ist([e()],tmt.prototype,"measure",void 0);var emt,P$e=tmt;function tmt(){return null!==emt&&emt.apply(this,arguments)||this}est(nmt,imt=n),ist([e()],nmt.prototype,"userName",void 0),ist([e()],nmt.prototype,"password",void 0);var imt,H$e=nmt;function nmt(){return null!==imt&&imt.apply(this,arguments)||this}est(rmt,omt=n),ist([e("Local")],rmt.prototype,"mode",void 0),ist([e()],rmt.prototype,"catalog",void 0),ist([e()],rmt.prototype,"cube",void 0),ist([e()],rmt.prototype,"roles",void 0),ist([e("Relational")],rmt.prototype,"providerType",void 0),ist([e()],rmt.prototype,"url",void 0),ist([e(1033)],rmt.prototype,"localeIdentifier",void 0),ist([e()],rmt.prototype,"dataSource",void 0),ist([kt([],ost)],rmt.prototype,"rows",void 0),ist([kt([],ost)],rmt.prototype,"columns",void 0),ist([kt([],ost)],rmt.prototype,"values",void 0),ist([kt([],ost)],rmt.prototype,"filters",void 0),ist([kt([],ost)],rmt.prototype,"fieldMapping",void 0),ist([e([])],rmt.prototype,"excludeFields",void 0),ist([e(!1)],rmt.prototype,"expandAll",void 0),ist([e("column")],rmt.prototype,"valueAxis",void 0),ist([e(-1)],rmt.prototype,"valueIndex",void 0),ist([kt([],det)],rmt.prototype,"filterSettings",void 0),ist([kt([],W$e)],rmt.prototype,"sortSettings",void 0),ist([e(!0)],rmt.prototype,"enableSorting",void 0),ist([e("JSON")],rmt.prototype,"type",void 0),ist([e(!0)],rmt.prototype,"allowMemberFilter",void 0),ist([e(!1)],rmt.prototype,"allowLabelFilter",void 0),ist([e(!1)],rmt.prototype,"allowValueFilter",void 0),ist([e(!0)],rmt.prototype,"showSubTotals",void 0),ist([e(!0)],rmt.prototype,"showRowSubTotals",void 0),ist([e(!0)],rmt.prototype,"showColumnSubTotals",void 0),ist([e("Auto")],rmt.prototype,"subTotalsPosition",void 0),ist([e(!0)],rmt.prototype,"showGrandTotals",void 0),ist([e("Bottom")],rmt.prototype,"grandTotalsPosition",void 0),ist([e(!0)],rmt.prototype,"showRowGrandTotals",void 0),ist([e(!0)],rmt.prototype,"showColumnGrandTotals",void 0),ist([e(!1)],rmt.prototype,"alwaysShowValueHeader",void 0),ist([e(!0)],rmt.prototype,"showHeaderWhenEmpty",void 0),ist([e(!0)],rmt.prototype,"showAggregationOnValueField",void 0),ist([kt([],Det)],rmt.prototype,"formatSettings",void 0),ist([kt([],pJ)],rmt.prototype,"drilledMembers",void 0),ist([t({},P$e)],rmt.prototype,"valueSortSettings",void 0),ist([kt([],tte)],rmt.prototype,"calculatedFieldSettings",void 0),ist([kt([],q$e)],rmt.prototype,"conditionalFormatSettings",void 0),ist([e()],rmt.prototype,"emptyCellsTextContent",void 0),ist([kt([],h)],rmt.prototype,"groupSettings",void 0),ist([t({},H$e)],rmt.prototype,"authentication",void 0);var omt,set=rmt;function rmt(){return null!==omt&&omt.apply(this,arguments)||this}smt=function(e,t){return(smt=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])}))(e,t)};var smt,amt,d$=function(e,t){function i(){this.constructor=e}smt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},X$e=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s};d$(lmt,amt=n),X$e([e("Row")],lmt.prototype,"mode",void 0),X$e([e("Flow")],lmt.prototype,"cellSelectionMode",void 0),X$e([e("Single")],lmt.prototype,"type",void 0),X$e([e(!1)],lmt.prototype,"checkboxOnly",void 0),X$e([e(!1)],lmt.prototype,"persistSelection",void 0),X$e([e("Default")],lmt.prototype,"checkboxMode",void 0),X$e([e(!1)],lmt.prototype,"enableSimpleMultiRowSelection",void 0);function lmt(){return null!==amt&&amt.apply(this,arguments)||this}d$(dmt,hmt=n),X$e([e("auto")],dmt.prototype,"height",void 0),X$e([e("auto")],dmt.prototype,"width",void 0),X$e([e("Both")],dmt.prototype,"gridLines",void 0),X$e([e(!1)],dmt.prototype,"allowTextWrap",void 0),X$e([e(!1)],dmt.prototype,"allowReordering",void 0),X$e([e(!0)],dmt.prototype,"allowResizing",void 0),X$e([e(!0)],dmt.prototype,"allowAutoResizing",void 0),X$e([e(null)],dmt.prototype,"rowHeight",void 0),X$e([e(110)],dmt.prototype,"columnWidth",void 0),X$e([e("Compact")],dmt.prototype,"layout",void 0),X$e([e("Ellipsis")],dmt.prototype,"clipMode",void 0),X$e([e(!1)],dmt.prototype,"allowSelection",void 0),X$e([e(-1)],dmt.prototype,"selectedRowIndex",void 0),X$e([e({mode:"Row",cellSelectionMode:"Flow",type:"Single"})],dmt.prototype,"selectionSettings",void 0),X$e([e({wrapMode:"Both"})],dmt.prototype,"textWrapSettings",void 0),X$e([e("AllPages")],dmt.prototype,"printMode",void 0),X$e([e()],dmt.prototype,"contextMenuItems",void 0),X$e([i()],dmt.prototype,"beforeCopy",void 0),X$e([i()],dmt.prototype,"printComplete",void 0),X$e([i()],dmt.prototype,"beforePrint",void 0),X$e([i()],dmt.prototype,"beforePdfExport",void 0),X$e([i()],dmt.prototype,"beforeExcelExport",void 0),X$e([i()],dmt.prototype,"contextMenuOpen",void 0),X$e([i()],dmt.prototype,"contextMenuClick",void 0),X$e([i()],dmt.prototype,"queryCellInfo",void 0),X$e([i()],dmt.prototype,"headerCellInfo",void 0),X$e([i()],dmt.prototype,"rowSelecting",void 0),X$e([i()],dmt.prototype,"rowSelected",void 0),X$e([i()],dmt.prototype,"rowDeselecting",void 0),X$e([i()],dmt.prototype,"rowDeselected",void 0),X$e([i()],dmt.prototype,"cellSelecting",void 0),X$e([i()],dmt.prototype,"cellSelected",void 0),X$e([i()],dmt.prototype,"cellDeselecting",void 0),X$e([i()],dmt.prototype,"cellDeselected",void 0),X$e([i()],dmt.prototype,"resizeStart",void 0),X$e([i()],dmt.prototype,"resizing",void 0),X$e([i()],dmt.prototype,"resizeStop",void 0),X$e([i()],dmt.prototype,"pdfHeaderQueryCellInfo",void 0),X$e([i()],dmt.prototype,"pdfQueryCellInfo",void 0),X$e([i()],dmt.prototype,"excelHeaderQueryCellInfo",void 0),X$e([i()],dmt.prototype,"excelQueryCellInfo",void 0),X$e([i()],dmt.prototype,"columnDragStart",void 0),X$e([i()],dmt.prototype,"columnDrag",void 0),X$e([i()],dmt.prototype,"columnDrop",void 0),X$e([i()],dmt.prototype,"columnRender",void 0);var hmt,Vee=dmt;function dmt(){return null!==hmt&&hmt.apply(this,arguments)||this}cmt.prototype.keyActionHandler=function(e){switch(e.action){case"tab":this.processTab(e);break;case"shiftTab":this.processShiftTab(e);break;case"enter":case"shiftEnter":case"ctrlEnter":this.processEnter(e);break;case"shiftUp":case"shiftDown":case"shiftLeft":case"shiftRight":case"upArrow":case"downArrow":case"leftArrow":case"rightArrow":this.processSelection(e);break;case"escape":this.clearSelection();break;case"ctrlShiftF":this.toggleFieldList(e)}},cmt.prototype.getNextButton=function(e){var t=this.allpivotButtons(e);if(q(t,"e-btn-focused"),this.parent.grid.element.querySelector("."+Jat))for(var i=t.length,n=0;n<i;n++)if(t[n].getAttribute("data-uid")===e.getAttribute("data-uid"))return t[n+1]||e;return e},cmt.prototype.getPrevButton=function(e){var t=this.allpivotButtons(e);if(q(t,"e-btn-focused"),this.parent.grid.element.querySelector("."+Jat))for(var i=t.length,n=0;n<i;n++)if(t[n].getAttribute("data-uid")===e.getAttribute("data-uid"))return t[n-1]||e;return e},cmt.prototype.allpivotButtons=function(e){var t,i,n,o,r,s,a=[];return e&&this.parent.showGroupingBar&&(r=z(e,"."+Adt),s=z(e,"."+Tdt),t=z(e,"."+wdt),e=e.classList.contains(nht),o=n=i=void 0,null!==r?n=r.classList.contains(Adt):null!==s?o=s.classList.contains(Tdt):null!==t&&(i=t.classList.contains(wdt)),n||o||e?(r=[].slice.call(this.parent.element.querySelector("."+Adt).querySelectorAll("."+Jat)),s=[].slice.call(this.parent.element.querySelector("."+Tdt).querySelectorAll("."+Jat)),a=r.concat(s)):i&&(a=[].slice.call(this.parent.element.querySelector("."+wdt).querySelectorAll("."+Jat)))),a},cmt.prototype.processTab=function(e){var t=e.target;if(t&&(z(t,"."+Jat)||t.classList.contains("e-group-row"))){if(this.parent.grid){var i=this.parent.grid.serviceLocator.getService("focus");if(t.classList.contains("e-group-row")&&t.querySelector(".e-btn-focused"))t=t.querySelector(".e-btn-focused");else if(t.classList.contains("e-group-row"))return i.focus(),U([n=i.getFocusedElement()],["e-focused","e-focus"]),n.setAttribute("tabindex","0"),void e.preventDefault();var n,o=this.getNextButton(t);o.getAttribute("data-uid")!==t.getAttribute("data-uid")?(this.parent.element.querySelector(".e-focused")?(this.parent.element.querySelector(".e-focused").setAttribute("tabindex","-1"),q(this.parent.element.querySelectorAll(".e-focus"),"e-focus"),q(this.parent.element.querySelectorAll(".e-focused"),"e-focused"),i.setFocusedElement(this.parent.element.querySelector(".e-headercell")),this.parent.element.querySelector(".e-headercell").setAttribute("tabindex","0")):i.currentInfo.skipAction=!0,U([o],"e-btn-focused"),o.focus()):(i.focus(),U([n=i.getFocusedElement()],["e-focused","e-focus"]),n.setAttribute("tabindex","0")),e.preventDefault()}}else!this.parent.showGroupingBar&&this.parent.showFieldList&&t&&z(t,"."+Rat)?this.parent.grid&&((i=this.parent.grid.serviceLocator.getService("focus")).focus(),U([n=i.getFocusedElement()],["e-focused","e-focus"]),n.setAttribute("tabindex","0"),e.preventDefault()):this.parent.showGroupingBar||this.parent.showFieldList||!t||!z(t,"."+kht)||z(t,".e-popup.e-popup-open")?t&&z(t,"."+ddt)&&this.parent.toolbar&&this.parent.toolbarModule?(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){q(z(t,"."+ddt).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),document.activeElement&&document.activeElement.classList.contains("e-menu-item")&&U([document.activeElement],"e-focused")})):t.classList.contains("e-numerictextbox")&&((i=this.parent.grid.serviceLocator.getService("focus")).focus(),q([n=i.getFocusedElement()],["e-focused","e-focus"]),n.setAttribute("tabindex","0"),e.preventDefault()):this.parent.grid&&(o=z(t,"."+kht),i=this.parent.grid.serviceLocator.getService("focus"),o=[].slice.call(o.getElementsByTagName("tr")),t.innerHTML===o[o.length-1].lastChild.innerHTML?i.currentInfo.skipAction=!0:(i.focus(),U([n=i.getFocusedElement()],["e-focused","e-focus"]),n.setAttribute("tabindex","0"),e.preventDefault()))},cmt.prototype.processShiftTab=function(e){var t,i,n=e.target;if(n&&(z(n,"."+Jat)||n.classList.contains("e-group-row"))){if(this.parent.grid){var o=this.parent.grid.serviceLocator.getService("focus");if(n.classList.contains("e-group-row")&&n.querySelector(".e-btn-focused"))n=n.querySelector(".e-btn-focused");else if(n.classList.contains("e-group-row")){var n=this.parent.element.querySelector(".e-btn-focused")?this.parent.element.querySelector(".e-btn-focused"):this.parent.element.querySelector("."+Adt),r=this.allpivotButtons(n);if(0<r.length&&r[r.length-1])return o.currentInfo.skipAction=!0,r[r.length-1].focus(),q(r,"e-btn-focused"),U([r[r.length-1]],"e-btn-focused"),void e.preventDefault()}r=this.getPrevButton(n);r.getAttribute("data-uid")!==n.getAttribute("data-uid")&&(o.currentInfo.skipAction=!0,r.focus(),e.preventDefault())}}else n&&this.parent.grid&&(n.classList.contains("e-movablefirst")||n.classList.contains("e-rowsheader")&&z(n,"tr").getAttribute("data-uid")===this.parent.grid.element.querySelector(".e-frozencontent tr").getAttribute("data-uid"))?(o=this.parent.grid.serviceLocator.getService("focus"),n.classList.contains("e-movablefirst")&&(n=this.parent.element.querySelector("."+Dlt+" .e-btn-focused")?this.parent.element.querySelector("."+Dlt+" .e-btn-focused"):this.parent.element.querySelector("."+Dlt),q([i=o.getFocusedElement()],["e-focused","e-focus"])),0<(t=this.allpivotButtons(n)).length&&(o.currentInfo.skipAction=!0,setTimeout(function(){t[t.length-1].focus()}),q(t,"e-btn-focused"),U([t[t.length-1]],"e-btn-focused"),e.preventDefault())):n&&z(n,"."+ddt)&&this.parent.toolbar&&this.parent.toolbarModule?(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){q(z(n,"."+ddt).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),document.activeElement&&document.activeElement.classList.contains("e-menu-item")&&U([document.activeElement],"e-focused")})):n.classList.contains("e-numerictextbox")&&((o=this.parent.grid.serviceLocator.getService("focus")).focus(),q([i=o.getFocusedElement()],["e-focused","e-focus"]),i.setAttribute("tabindex","0"),e.preventDefault())},cmt.prototype.processEnter=function(e){var t,i,n=e.target;n&&z(n,"."+Mht)&&(t=this.parent.grid.serviceLocator.getService("focus"),13!==e.keyCode||e.shiftKey||e.ctrlKey?13===e.keyCode&&e.shiftKey&&!e.ctrlKey?this.parent.enableValueSorting&&(this.event=e,n.click(),t.focus(),U([i=t.getFocusedElement()],["e-focused","e-focus"]),i.setAttribute("tabindex","0")):13===e.keyCode&&!e.shiftKey&&e.ctrlKey&&this.parent.hyperlinkSettings&&n.querySelector("a")&&n.querySelector("a").click():n.querySelector("."+Tat)?(this.event=e,n.querySelector("."+Tat).click(),t.focus(),U([i=t.getFocusedElement()],["e-focused","e-focus"]),i.setAttribute("tabindex","0")):n.classList.contains("e-valuescontent")?(n.dispatchEvent(new MouseEvent("dblclick",{view:window,bubbles:!0,cancelable:!0})),n.querySelector(".e-numerictextbox")&&n.click()):n.classList.contains("e-numerictextbox")&&(t.focus(),q([i=t.getFocusedElement()],["e-focused","e-focus"])),e.preventDefault())},cmt.prototype.clearSelection=function(){q(this.parent.element.querySelectorAll("."+Xht+",."+Kht),[Kht,Xht,tdt]),this.parent.renderModule.selected()},cmt.prototype.processSelection=function(t){var i,n,o,r,s,e,a=t.target;this.parent.grid&&this.parent.gridSettings.allowSelection&&"Row"!==this.parent.gridSettings.selectionSettings.mode&&!a.classList.contains("e-numerictextbox")?(i=this.parent,o=parseInt(t.target.getAttribute("aria-colindex"),10)-1,r=Number(t.target.getAttribute("index")),je(n="TH"!==a.nodeName&&"TD"!==a.nodeName?n:"shiftUp"===t.action||"upArrow"===t.action?0===r||0===o||"TH"!==a.nodeName&&i.renderModule.rowStartPos!==r?null:this.getParentElement(i,n,o,r-1):"shiftDown"===t.action||"downArrow"===t.action?i.element.querySelector('th[aria-colindex="'+(o+1)+'"][index="'+(r+1)+'"]'):"shiftLeft"===t.action||"leftArrow"===t.action?t.target.previousSibling:t.target.nextSibling)?("upArrow"===t.action?(n=i.element.querySelector('[aria-colindex="'+(o+1)+'"][index="'+(r-1)+'"]'),r--):"downArrow"===t.action&&(n=i.element.querySelector('[aria-colindex="'+(o+1)+'"][index="'+(r+1)+'"]'),r++),je(n)||i.clearSelection(n,t)):"Both"===i.gridSettings.selectionSettings.mode&&n.classList.contains(edt)?i.clearSelection(n,t):(o=parseInt(n.getAttribute("aria-colindex"),10)-1,r=Number(n.getAttribute("index")),s=Number(n.getAttribute("aria-colspan")),i.clearSelection(n,t),e={cancel:!1,isCellClick:!0,currentCell:n,data:i.pivotValues[r][o]},i.trigger(hpt,e,function(e){e.cancel||i.applyColumnSelection(t,n,o,o+(0<s?s-1:0),r)}))):a&&(37===t.keyCode||38===t.keyCode)&&this.parent&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&!a.classList.contains("e-numerictextbox")?this.parent.grid&&this.parent.element.querySelector(".e-frozenheader")&&0<this.parent.element.querySelector(".e-frozenheader").querySelectorAll(".e-focus").length&&(q(this.parent.element.querySelector(".e-frozenheader").querySelectorAll(".e-focus"),"e-focus"),q(this.parent.element.querySelector(".e-frozenheader").querySelectorAll(".e-focused"),"e-focused"),this.parent.element.querySelector(".e-headercell").setAttribute("tabindex","-1"),this.parent.grid.serviceLocator.getService("focus").setFocusedElement(a),U([a],["e-focused","e-focus"]),a.setAttribute("tabindex","0"),a.focus(),t.preventDefault()):!a.classList.contains("e-numerictextbox")||"rightArrow"!==t.action&&"leftArrow"!==t.action||a.click()},cmt.prototype.getParentElement=function(e,t,i,n){for(;!t;)t=e.element.querySelector('[aria-colindex="'+(i+1)+'"][index="'+n+'"]'),i--;return t},cmt.prototype.toggleFieldList=function(e){this.parent&&!this.parent.isDestroyed&&this.parent.showFieldList&&this.parent.pivotFieldListModule&&!this.parent.pivotFieldListModule.isDestroyed&&this.parent.element.querySelector("."+Rat)&&(this.parent.element.querySelector("."+Rat).classList.contains(Dat)?this.parent.element.querySelector("."+Rat).classList.contains(Dat)&&this.parent.pivotFieldListModule.dialogRenderer&&this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog&&!this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.isDestroyed&&this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.hide():(this.parent.element.querySelector("."+Rat).click(),e.preventDefault()))},cmt.prototype.destroy=function(){this.pivotViewKeyboardModule&&this.pivotViewKeyboardModule.destroy()};var pmt=cmt;function cmt(e){this.keyConfigs={tab:"tab",shiftTab:"shift+tab",enter:"enter",shiftUp:"shift+upArrow",shiftDown:"shift+downArrow",shiftLeft:"shift+leftArrow",shiftRight:"shift+rightArrow",shiftEnter:"shift+enter",ctrlEnter:"ctrl+enter",upArrow:"upArrow",downArrow:"downArrow",leftArrow:"leftArrow",rightArrow:"rightArrow",escape:"escape",ctrlShiftF:"ctrl+shift+f"},this.parent=e,this.event=void 0,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.pivotViewKeyboardModule=new bn(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})}gmt.prototype.render=function(){this.renderContextMenu()},gmt.prototype.renderContextMenu=function(){var e=[{text:this.parent.localeObj.getConstant("addToFilter"),id:this.parent.element.id+"_Filters"},{text:this.parent.localeObj.getConstant("addToRow"),id:this.parent.element.id+"_Rows"},{text:this.parent.localeObj.getConstant("addToColumn"),id:this.parent.element.id+"_Columns"},{text:this.parent.localeObj.getConstant("addToValue"),id:this.parent.element.id+"_Values"}],e={cssClass:"e-pivot-context-menu"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:e,enableRtl:this.parent.enableRtl,locale:this.parent.locale,beforeOpen:this.onBeforeMenuOpen.bind(this),select:this.onSelectContextMenu.bind(this)},t=Q("ul",{id:this.parent.element.id+"_PivotContextMenu"});this.parent.element.appendChild(t),this.menuObj=new D4(e),this.menuObj.isStringTemplate=!0,this.menuObj.appendTo(t)},gmt.prototype.onBeforeMenuOpen=function(e){var e=[].slice.call(e.element.querySelectorAll("li")),t=("olap"===this.parent.dataType?this.fieldElement:this.fieldElement.querySelector("."+$at)).getAttribute("data-type");if(q(e,Bht),"CalculatedField"===t||"isMeasureFieldsAvail"===t)for(var i=0,n=e;i<n.length;i++)(l=n[i]).textContent!==this.parent.localeObj.getConstant("addToValue")&&U([l],Bht);else if("isMeasureAvail"===t)for(var o=0,r=e;o<r.length;o++)(l=r[o]).textContent!==this.parent.localeObj.getConstant("addToRow")&&l.textContent!==this.parent.localeObj.getConstant("addToColumn")&&U([l],Bht);else if("olap"===this.parent.dataType){for(var s=0,a=e;s<a.length;s++)if((l=a[s]).textContent===this.parent.localeObj.getConstant("addToValue")){U([l],Bht);break}}else if("true"===this.fieldElement.getAttribute("isvalue"))for(var l,h=0,d=e;h<d.length;h++)(l=d[h]).textContent!==this.parent.localeObj.getConstant("addToValue")&&l.textContent!==this.parent.localeObj.getConstant("addToFilter")||U([l],Bht)},gmt.prototype.onSelectContextMenu=function(e){var t;null!==e.element.textContent&&(t=this.fieldElement.getAttribute("data-uid"),e=e.item.id.replace(this.parent.element.id+"_","").toLowerCase(),this.parent.pivotCommon.dataSourceUpdate.control="pivotview"!==this.parent.getModuleName()&&this.parent.pivotGridModule||this.parent,this.parent.pivotCommon.dataSourceUpdate.btnElement=this.fieldElement,this.parent.pivotCommon.dataSourceUpdate.updateDataSource(t,e,-1),this.parent.updateDataSource(!0),this.fieldElement=void 0)},gmt.prototype.destroy=function(){this.parent.isDestroyed&&this.menuObj&&!this.menuObj.isDestroyed&&(this.menuObj.destroy(),ge("#"+this.parent.element.id+"_PivotContextMenu",document))&&ue(ge("#"+this.parent.element.id+"_PivotContextMenu",document))};var umt=gmt;function gmt(e){this.parent=e,this.parent.contextMenuModule=this}fmt.prototype.getModuleName=function(){return"virtualscroll"},fmt.prototype.addInternalEvents=function(){this.parent.isDestroyed||this.parent.on(vct,this.wireEvents,this)},fmt.prototype.wireEvents=function(){var e,t,i,n;this.engineModule="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,"Chart"!==this.parent.displayOption.view&&(e=this.parent.element.querySelector("."+qht),n=this.parent.element.querySelector("."+rdt),t=this.parent.element.querySelector("."+Yht),i=n.querySelector("."+Uht),E.clearEvents(e),this.isFireFox&&E.clearEvents(t),this.engineModule&&(n=this.parent.isAdaptive?e:n.querySelector("."+Uht),E.add(n,"scroll touchmove pointermove",this.onHorizondalScroll(t,e),this),E.add(e.parentElement,"scroll wheel touchmove pointermove keyup keydown",this.onVerticalScroll(e.parentElement,e),this),this.isFireFox?(E.add(n,"mouseup touchend scroll",this.common(t,e,e),this),this.parent.isAdaptive||E.add(e.parentElement,"mouseup touchend scroll",this.common(t,e.parentElement,e),this)):(E.add(n,"mouseup touchend",this.common(t,e,e),this),this.parent.isAdaptive||E.add(e.parentElement,"mouseup touchend",this.common(t,e.parentElement,e),this)),E.add(i,"scroll",this.onCustomScrollbarScroll(e,t),this),E.add(e,"scroll",this.onCustomScrollbarScroll(i,t),this),E.add(t,"scroll",this.onCustomScrollbarScroll(i,e),this),E.add(t,"touchstart pointerdown",this.setPageXY(),this),E.add(t,"touchmove pointermove",this.onTouchScroll(t,e),this),E.add(e,"touchstart pointerdown",this.setPageXY(),this),E.add(e,"touchmove pointermove",this.onTouchScroll(t,e),this)),this.parent.grid.on("check-scroll-reset",function(e){e.cancel=!0}),this.parent.grid.on("prevent-frozen-scroll-refresh",function(e){e.cancel=!0}),this.parent.grid.isPreventScrollEvent=!0)},fmt.prototype.onWheelScroll=function(e){var i=this,n=e;return function(e){var t=n.scrollTop+(1===e.deltaMode?30*e.deltaY:e.deltaY);i.frozenPreviousValues.top!==t&&(e.preventDefault(),i.frozenPreviousValues.top=t,i.eventType=e.type)}},fmt.prototype.getPointXY=function(e){var t={x:0,y:0};return e.touches&&e.touches.length?(t.x=e.touches[0].pageX,t.y=e.touches[0].pageY):(t.x=e.pageX,t.y=e.pageY),t},fmt.prototype.onCustomScrollbarScroll=function(e,t){var i=this,n=e,o=t;return function(e){var t;null===i.parent.element.querySelector("."+Zat).querySelector("tbody")||(t=(e=e.target).scrollLeft,i.previousValues.left===t)||i.isFireFox&&e.classList.contains(Yht)||(n.scrollLeft=t,o.scrollLeft=t,i.parent.isDestroyed)}},fmt.prototype.onTouchScroll=function(r,s){var a=this,l=s;return function(e){var t,i,n,o;"mouse"===e.pointerType||(t=a.getPointXY(e),i=a.parent.element.querySelector(".e-grid ."+Zat).scrollTop+(a.pageXY.y-t.y),o=(n=a.parent.isAdaptive?s:l.parentElement.parentElement.querySelector("."+Uht)).scrollLeft+(a.pageXY.x-t.x),a.frozenPreviousValues.left===o)||o<0||(r.scrollLeft=o,n.scrollLeft=o,a.pageXY.x=t.x,a.frozenPreviousValues.left=o,a.frozenPreviousValues.top===i)||i<0||(a.pageXY.y=t.y,a.frozenPreviousValues.top=i,a.eventType=e.type)}},fmt.prototype.update=function(e,t,i,n,o,r){var s=this,a=this.parent.element.querySelector("."+qht),l=(this.parent.isScrolling=!0,"pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule),h={dataSourceSettings:Hdt.getClonedDataSourceSettings(this.parent.dataSourceSettings)},d=this.parent.virtualScrollSettings&&this.parent.virtualScrollSettings.allowSinglePage&&"pivot"===this.parent.dataType;if(this.parent.pageSettings&&l.pageSettings){if("vertical"===this.direction){var p=r.parentElement.scrollHeight-(e+r.parentElement.offsetHeight),c="pivot"===this.parent.dataType&&"row"===this.parent.dataSourceSettings.valueAxis?this.parent.dataSourceSettings.values.length:1,u=this.parent.pageSettings.rowPageSize*c*this.parent.gridSettings.rowHeight,g=Math.ceil(e/u);if((this.parent.scrollPosObject.vertical===(g+=d&&p<=0?1:0)||l.pageSettings.rowPageSize>=l.rowCount||a&&a.scrollHeight<3*a.parentElement.clientHeight)&&!d)return;this.parent.actionObj.actionName=fct,d&&this.parent.grid&&this.parent.grid.element.querySelector(".e-spinner-inner")&&U([this.parent.grid.element.querySelector(".e-spinner-inner")],[Ldt]),this.parent.actionBeginMethod(),d||this.parent.showWaitingPopup(),this.parent.scrollPosObject.vertical=g,this.parent.pageSettings.currentRowPage=l.pageSettings.currentRowPage=1<g?g:1;var m=0;this.parent.trigger(Udt,h,function(){"pivot"===s.parent.dataType?"Server"===s.parent.dataSourceSettings.mode?s.parent.getEngine("onScroll",null,null,null,null,null,null):(s.parent.engineModule.generateGridData(s.parent.dataSourceSettings,!0,!1,s.parent.engineModule.headerCollection),m=s.parent.engineModule.rowStartPos):(s.parent.olapEngineModule.scrollPage(),m=s.parent.olapEngineModule.pageRowStartPos),s.enginePopulatedEventMethod(l)});p=u*Math.ceil(m/(this.parent.pageSettings.rowPageSize*c))-l.rowFirstLvl*c*this.parent.gridSettings.rowHeight;this.parent.scrollPosObject.verticalSection=p}else{e=n.scrollWidth-(n.scrollLeft+n.offsetWidth),d="pivot"===this.parent.dataType&&"column"===this.parent.dataSourceSettings.valueAxis?this.parent.dataSourceSettings.values.length:1,u=this.parent.pageSettings.columnPageSize*d*this.parent.gridSettings.columnWidth,g=Math.ceil(Math.abs(t)/u),c=this.parent.virtualScrollSettings&&this.parent.virtualScrollSettings.allowSinglePage&&"pivot"===this.parent.dataType;if((this.parent.scrollPosObject.horizontal===(g+=c&&e<=0?1:0)||a&&a.scrollWidth<3*a.parentElement.clientWidth)&&!c)return;this.parent.actionObj.actionName=yct,c&&this.parent.grid&&this.parent.grid.element.querySelector(".e-spinner-inner")&&(U([this.parent.grid.element.querySelector(".e-spinner-inner")],[Ldt]),o)&&q([o,r],["e-virtual-pivot-content"]),this.parent.actionBeginMethod(),c||this.parent.showWaitingPopup();var f=this.parent,y=(f.scrollPosObject.horizontal=g,this.parent.pageSettings.currentColumnPage=l.pageSettings.currentColumnPage=1<g?g:1,0);this.parent.trigger(Udt,h,function(){"pivot"===f.dataType?"Server"===s.parent.dataSourceSettings.mode?s.parent.getEngine("onScroll",null,null,null,null,null,null):(f.engineModule.generateGridData(f.dataSourceSettings,!0,!1,f.engineModule.headerCollection),y=f.engineModule.colStartPos):(f.olapEngineModule.scrollPage(),y=f.olapEngineModule.pageColStartPos),s.enginePopulatedEventMethod(l)});p=u*Math.ceil(y/(f.pageSettings.columnPageSize*d))-l.colFirstLvl*d*f.gridSettings.columnWidth;f.scrollPosObject.horizontalSection=p}this.parent.actionObj.actionName=this.parent.getActionCompleteName(),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()}},fmt.prototype.enginePopulatedEventMethod=function(e,t){var i=this,t=t||this.parent,e={dataSourceSettings:t.dataSourceSettings,pivotValues:e.pivotValues};t.trigger(qdt,e,function(e){i.parent.pivotValues=e.pivotValues})},fmt.prototype.setPageXY=function(){var t=this;return function(e){"mouse"!==e.pointerType&&(t.pageXY=t.getPointXY(e))}},fmt.prototype.common=function(n,o,r){var s=this;return function(e){var t,i=s.parent.virtualScrollSettings&&s.parent.virtualScrollSettings.allowSinglePage&&"pivot"===s.parent.dataType;!s.isScrolling&&i||(s.isScrolling=!1,t=s.parent.isAdaptive?o:z(o,"."+rdt).querySelector("."+Uht),i&&("vertical"===s.direction?s.parent.element.querySelector("."+Fdt)&&(U([r],["e-virtual-pivot-content"]),q([s.parent.element.querySelector("."+Fdt)],[Ldt])):s.parent.element.querySelector("."+Fdt)&&(U([n,o],["e-virtual-pivot-content"]),q([s.parent.element.querySelector("."+Fdt)],[Ldt]))),s.update(s.parent.element.querySelector(".e-grid ."+Zat).scrollTop*s.parent.verticalScrollScale,t.scrollLeft*s.parent.horizontalScrollScale,e,t,n,o))}},fmt.prototype.onHorizondalScroll=function(r,s){var a,l=this,h=this.parent.isAdaptive?s:z(s,"."+rdt).querySelector("."+Uht),d=Math.abs(h.scrollLeft),p=d*this.parent.horizontalScrollScale,c=p-this.parent.scrollPosObject.horizontalSection-d,c=this.parent.enableRtl?c:-c;return"none"!==h.style.display&&this.alignFreezedCells(c,!1),function(e){var t,i,n,o;d=Math.abs(h.scrollLeft),p=d*l.parent.horizontalScrollScale,"wheel"!==e.type&&"touchmove"!==e.type&&"wheel"!==l.eventType&&"touchmove"!==l.eventType||(clearTimeout(a),a=setTimeout(function(){p="touchmove"===e.type?d:p,l.update(s.parentElement.scrollTop*l.parent.verticalScrollScale,p,e,h,r,s)},300)),l.previousValues.left!==p&&(l.parent.scrollDirection=l.direction="horizondal",l.isScrolling=!0,c=p-l.parent.scrollPosObject.horizontalSection-d,c=l.parent.enableRtl?c:-c,t=1<s.querySelector("."+tht).style.transform.split(",").length?s.querySelector("."+tht).style.transform.split(",")[1].trim():"0px)",d<l.parent.scrollerBrowserLimit&&(gt(s.querySelector("."+tht),{transform:"translate("+c+"px,"+t}),gt(r.querySelector("."+tht),{transform:"translate("+c+"px,0px)"}),l.alignFreezedCells(c,!1)),o=l.parent.scrollPosObject.horizontalSection>p?-(l.parent.scrollPosObject.horizontalSection-p):p+(r.offsetWidth-r.querySelector(".e-headercell.e-leftfreeze").offsetWidth)-(l.parent.scrollPosObject.horizontalSection+(s.querySelector("."+tht).offsetWidth-s.querySelector("."+tht).querySelector(".e-leftfreeze.e-rowsheader").offsetWidth)),i=Math.ceil(l.parent.scrollPosObject.horizontalSection/l.parent.horizontalScrollScale)<l.parent.scrollerBrowserLimit,(l.parent.scrollPosObject.horizontalSection>p||1<o&&i)&&(l.parent.virtualScrollSettings&&l.parent.virtualScrollSettings.allowSinglePage&&"pivot"===l.parent.dataType&&l.parent.element.querySelector("."+Fdt)&&(U([r,s],["e-virtual-pivot-content"]),q([l.parent.element.querySelector("."+Fdt)],[Ldt])),o=p>r.clientWidth?(l.parent.scrollPosObject.left<1&&(l.parent.scrollPosObject.left=r.clientWidth),l.parent.scrollPosObject.left=l.parent.scrollPosObject.left-50,l.parent.scrollPosObject.horizontalSection>p?o-l.parent.scrollPosObject.left:o+l.parent.scrollPosObject.left):-l.parent.scrollPosObject.horizontalSection,c=-(p-(l.parent.scrollPosObject.horizontalSection+o)-z(s,"."+rdt).querySelector("."+Uht).scrollLeft),(i=l.parent.gridSettings.columnWidth*l.engineModule.columnCount)>l.parent.scrollerBrowserLimit&&(l.parent.horizontalScrollScale=i/l.parent.scrollerBrowserLimit,i=l.parent.scrollerBrowserLimit),i<c&&p<c&&(c=p,o=0),gt(s.querySelector("."+tht),{transform:"translate("+c+"px,"+t}),gt(r.querySelector("."+tht),{transform:"translate("+c+"px,0px)"}),l.alignFreezedCells(c,!1),l.parent.scrollPosObject.horizontalSection=l.parent.scrollPosObject.horizontalSection+o),(i=h.scrollWidth-(d+(h.offsetWidth-l.parent.element.querySelector("."+Mht).querySelector("."+oht+"."+Bdt).offsetWidth)))<=0&&((o=s.querySelector("."+Qht)).style.display="none",n=s.scrollWidth-(s.scrollLeft+s.offsetWidth),o.style.display="",o=s.scrollWidth-(s.scrollLeft+s.offsetWidth),l.parent.scrollPosObject.horizontalSection-=i<n?n:-o,c=d>l.parent.scrollerBrowserLimit?Number(s.querySelector("."+tht).style.transform.split(",")[0].split("px")[0].trim()):-(d*l.parent.horizontalScrollScale-l.parent.scrollPosObject.horizontalSection-d),gt(s.querySelector("."+tht),{transform:"translate("+c+"px,"+t}),gt(r.querySelector("."+tht),{transform:"translate("+c+"px,0px)"}),l.alignFreezedCells(c,!1)),l.previousValues.left=p,l.frozenPreviousValues.left=p,l.eventType="",r.scrollLeft=h.scrollLeft,s.scrollLeft=h.scrollLeft)}},fmt.prototype.alignFreezedCells=function(e,t){for(var i,n=0,o=this.parent.element.querySelectorAll("."+Bdt);n<o.length;n++)this.parent.isTabular&&1<this.parent.dataSourceSettings.rows.length?(i=this.parent.element.querySelector("."+Bdt),t?this.parent.enableRtl?o[n].style.right=-e+"px":this.setFrozenColumnPosition(e,i,n,o):this.parent.enableRtl?o[n].style.right=Number(e)+"px":this.setFrozenColumnPosition(e,i,n,o)):t?this.parent.enableRtl?o[n].style.right=-e+"px":o[n].style.left=e+"px":this.parent.enableRtl?o[n].style.right=Number(e)+"px":o[n].style.left=Number(-e)+"px"},fmt.prototype.onVerticalScroll=function(a,l){var h,d=this,p=a.querySelector("."+qht)?a.querySelector("."+qht):a;return function(i){var e,n,t,o,r,s;(d.parent.isAdaptive||p.scrollHeight>3*p.parentElement.clientHeight)&&(e=a.scrollTop*d.parent.verticalScrollScale,"wheel"!==i.type&&"touchmove"!==i.type&&"scroll"!==i.type&&"wheel"!==d.eventType&&"touchmove"!==d.eventType&&"keyup"!==i.type&&"keydown"!==i.type||(n=d.parent.isAdaptive?a:z(a,"."+rdt).querySelector("."+Uht),clearTimeout(h),h=setTimeout(function(){var e,t=0;t=(!d.parent.isAdaptive||(e=n.querySelector("."+qht),n.scrollLeft===e.scrollLeft)?n:e).scrollLeft,d.update(a.scrollTop*d.parent.verticalScrollScale,t*d.parent.horizontalScrollScale,i,n,null,a)},300)),d.previousValues.top!==e)&&(d.parent.scrollPosObject.horizontalSection<0&&(d.parent.scrollPosObject.horizontalSection=0),d.parent.scrollDirection=d.direction="vertical",d.isScrolling=!0,r=-(e-d.parent.scrollPosObject.verticalSection-a.scrollTop),t=a.querySelector("."+tht).style.transform.split(",")[0].trim(),r>d.parent.virtualDiv.clientHeight&&(r=d.parent.virtualDiv.clientHeight),a.scrollTop<d.parent.scrollerBrowserLimit&&(gt(a.querySelector("."+tht),{transform:"translate(0px,"+r+"px)"}),gt(a.querySelector("."+tht),{transform:t+","+r+"px)"})),o=d.parent.scrollPosObject.verticalSection>e?-(d.parent.scrollPosObject.verticalSection-e):e+a.clientHeight-(d.parent.scrollPosObject.verticalSection+a.querySelector("."+tht).offsetHeight),s=Math.ceil(d.parent.scrollPosObject.verticalSection/d.parent.verticalScrollScale)<d.parent.scrollerBrowserLimit,(d.parent.scrollPosObject.verticalSection>e||1<o&&s)&&(d.parent.virtualScrollSettings&&d.parent.virtualScrollSettings.allowSinglePage&&"pivot"===d.parent.dataType&&d.parent.element.querySelector("."+Fdt)&&(U([l],["e-virtual-pivot-content"]),q([d.parent.element.querySelector("."+Fdt)],[Ldt])),o=e>a.clientHeight?(d.parent.scrollPosObject.top<1&&(d.parent.scrollPosObject.top=a.clientHeight),d.parent.scrollPosObject.top=d.parent.scrollPosObject.top-50,d.parent.scrollPosObject.verticalSection>e?o-d.parent.scrollPosObject.top:o+d.parent.scrollPosObject.top):-d.parent.scrollPosObject.verticalSection,s=d.parent.element.querySelector("."+Zat).querySelector("."+tht),r=-(e-(d.parent.scrollPosObject.verticalSection+o)-a.scrollTop),(s=d.parent.gridSettings.rowHeight*d.engineModule.rowCount+.1-s.clientHeight)>d.parent.scrollerBrowserLimit&&(d.parent.verticalScrollScale=s/d.parent.scrollerBrowserLimit,s=d.parent.scrollerBrowserLimit),s<r&&e<r&&(r=e,o=0),r>d.parent.virtualDiv.clientHeight&&(r=d.parent.virtualDiv.clientHeight),gt(a.querySelector("."+tht),{transform:"translate(0px,"+r+"px)"}),gt(a.querySelector("."+tht),{transform:t+","+r+"px)"}),d.parent.scrollPosObject.verticalSection=d.parent.scrollPosObject.verticalSection+o),d.previousValues.top=e,d.frozenPreviousValues.top=e,d.eventType="")}},fmt.prototype.removeInternalEvents=function(){this.parent.isDestroyed||this.parent.off(vct,this.wireEvents)},fmt.prototype.destroy=function(){this.removeInternalEvents()},fmt.prototype.setFrozenColumnPosition=function(e,t,i,n){t?0<(t=parseInt(t.getAttribute("aria-colindex"),10)-1)&&t<=this.parent.engineModule.rowMaxLevel+1&&(n[i].style.left=t*this.parent.gridSettings.columnWidth+"px"):n[i].style.left=e+"px"};var mmt=fmt;function fmt(e){this.previousValues={top:0,left:0},this.frozenPreviousValues={top:0,left:0},this.eventType="",this.isFireFox=-1<F.userAgent.toLowerCase().indexOf("firefox"),this.isScrolling=!1,this.parent=e,this.addInternalEvents()}vmt.prototype.showDrillThroughDialog=function(e){for(var t,C=this,S=e.rawData,A=[],x={},i=0;i<e.rawData.length;i++)A.push(Hdt.frameHeaderWithKeys(e.rawData[i]));try{"Table"===this.parent.currentView&&this.parent.editSettings.allowInlineEditing&&this.parent.editSettings.allowEditing&&1===e.rawData.length?(this.parent.actionObj.actionName=cut,this.parent.actionBeginMethod()||this.editCell(e,S)):(this.removeDrillThroughDialog(),t=Q("div",{id:this.parent.element.id+"_drillthrough",className:"e-drillthrough-dialog"}),this.parent.element.appendChild(t),this.dialogPopUp=new pS({animationSettings:{effect:"Fade"},allowDragging:!1,header:this.parent.localeObj.getConstant("details"),content:this.createDrillThroughGrid(e,S),cssClass:this.parent.cssClass,beforeOpen:function(){C.drillThroughGrid.setProperties({dataSource:C.parent.editSettings.allowEditing?C.dataWithPrimarykey(e,S,x):S,height:C.parent.editSettings.allowEditing?220:300},!1)},beforeClose:function(){if(C.parent.editSettings.allowEditing&&C.isUpdated){"CSV"===C.parent.dataSourceSettings.type&&C.updateData(C.drillThroughGrid.dataSource);for(var e=[],t=0,i=Object.keys(x);t<i.length;t++){var n=i[t];e.push(x[n])}for(var o=Object.keys(x).length,r=[],s=[],a=0,l=0,h=C.drillThroughGrid.dataSource;l<h.length;l++){if("0"===(f=h[l]).__index||""===f.__index){for(var d=0,p=C.engine.fields;d<p.length;d++){var c=p[d];je(f[c])&&delete f[c]}delete f.__index,r.push(f)}else 0<o&&(delete x[f.__index.toString()],s.push(f),o--);"Server"===C.parent.dataSourceSettings.mode&&(f.__index&&delete f.__index,S[a].__index)&&delete S[a].__index,a++}if(o=0,"Server"===C.parent.dataSourceSettings.mode){for(var u=[],g=Object.keys(x),m=0;m<g.length;m++)delete C.parent.drillThroughValue.indexObject[x[g[m]]],u.push({Key:g[m],Value:x[g[m]]});C.parent.getEngine("updateRawData",null,null,null,null,null,null,null,{addedData:r,removedData:u,updatedData:s,indexObject:C.parent.drillThroughValue.indexObject})}else{for(var f,y=[],v=0,b=C.parent.allowDataCompression?C.parent.engineModule.actualData:C.parent.engineModule.data;v<b.length;v++)delete(f=b[v]).__index,void 0===x[o.toString()]&&y.push(f),o++;var y=y.concat(r),w={currentData:C.drillThroughGrid.dataSource,previousData:A,previousPosition:e,cancel:!1};C.parent.trigger(fpt,w),w.cancel||(C.parent.setProperties({dataSourceSettings:{dataSource:y}},!0),C.engine.updateGridData(C.parent.dataSourceSettings),C.parent.pivotValues=C.engine.pivotValues)}C.parent.actionObj.actionName=ogt;w={editInfo:{type:C.drillThroughGrid.editSettings.mode,action:"Update",currentData:C.drillThroughGrid.dataSource,previousData:A,previousPosition:e}};C.parent.actionObj.actionInfo=w}C.isUpdated=!1,x={}},isModal:!0,visible:!0,showCloseIcon:!0,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:this.parent.isAdaptive?"100%":"60%",position:{X:"center",Y:"center"},closeOnEscape:!this.parent.editSettings.allowEditing,target:document.body,close:this.removeDrillThroughDialog.bind(this)}),this.dialogPopUp.isStringTemplate=!0,this.dialogPopUp.appendTo(t),gt(this.dialogPopUp.element,{visibility:"visible"}),this.parent.editSettings.allowEditing&&(this.drillthroughKeyboardModule=new bn(this.dialogPopUp.element,{keyAction:this.drillthroughKeyActionHandler.bind(this),keyConfigs:{escape:"escape"},eventName:"keydown"})))}catch(e){this.parent.actionFailureMethod(e)}},vmt.prototype.editCell=function(i,e){var n=this,t=this.parent.gridSettings.allowResizing,o=i.currentCell.actualText.toString(),r=Number(Object.keys(i.currentCell.indexObject)),s=(i.currentTarget.firstElementChild.style.display="none",Number(i.rawData[0][o])),a=Hdt.frameHeaderWithKeys(i.rawData[i.rawData.length-1]),l=i.rawData[i.rawData.length-1],h=(this.parent.actionObj.actionInfo={editInfo:{type:"Inline editing",action:"update",data:e}},new NL({value:s,enableRtl:this.parent.enableRtl,enabled:!0,format:"####.##",locale:this.parent.locale,cssClass:this.parent.cssClass,change:function(){var e=je(h.value)?0:h.value,t=i.currentCell.indexObject[r];i.rawData[0][o]=e,n.parent.engineModule.data[t]=i.rawData[0]},blur:function(){var e={currentData:[l],previousData:[a],previousPosition:[l.index],cancel:!1};n.parent.trigger(fpt,e),e.cancel||("Server"===n.parent.dataSourceSettings.mode?((e={})[r]=r,n.parent.getEngine("updateRawData",null,null,null,null,null,null,null,{addedData:[],removedData:[],updatedData:[l],indexObject:e})):(n.parent.setProperties({dataSourceSettings:{dataSource:n.parent.engineModule.data}},!0),n.engine.updateGridData(n.parent.dataSourceSettings),n.parent.pivotValues=n.engine.pivotValues,n.parent.gridSettings.allowResizing=t))}})),e=Q("input",{id:this.parent.element.id+"_inputbox"});i.currentTarget.appendChild(e),h.appendTo(e),i.currentCell.value=h.value,h.focusIn(),this.parent.gridSettings.allowResizing=!1},vmt.prototype.updateData=function(e){for(var t=0,i=this.parent.allowDataCompression?this.parent.engineModule.actualData:this.parent.engineModule.data;t<e.length;){for(var n=Object.keys(e[t]),o=0,r=[];o<n.length;)je(this.parent.engineModule.fieldKeys[n[o]])||(r[this.parent.engineModule.fieldKeys[n[o]]]=e[t][n[o]]),o++;i[Number(e[t].__index)]=r,t++}this.parent.allowDataCompression?this.parent.engineModule.actualData=i:this.parent.engineModule.data=i},vmt.prototype.removeDrillThroughDialog=function(){this.dialogPopUp&&!this.dialogPopUp.isDestroyed&&(this.parent.actionObj.actionName=rgt,this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.dialogPopUp.destroy());var e=document.getElementById(this.parent.element.id+"_drillthrough");e&&ue(e),document.getElementById(this.parent.element.id+"_drillthroughgrid_ccdlg")&&ue(document.getElementById(this.parent.element.id+"_drillthroughgrid_ccdlg"))},vmt.prototype.createDrillThroughGrid=function(e,i){var n=this,t=Q("div",{id:this.parent.element.id+"_drillthroughbody",className:"e-drillthrough-body"}),o=Q("div",{id:this.parent.element.id+"_drillthroughbodyheader",className:"e-drillthrough-body-header-container"}),r=(""!==e.rowHeaders&&(o.innerHTML="<span class="+glt+"><span class="+ult+">"+this.parent.localeObj.getConstant("row")+"</span> : <span class="+mlt+">"+e.rowHeaders+"</span></span>"),""!==e.columnHeaders&&(o.innerHTML=o.innerHTML+"<span class="+glt+"><span class="+ult+">"+this.parent.localeObj.getConstant("column")+"</span> : <span class="+mlt+">"+e.columnHeaders+"</span></span>"),""!==e.value&&(r=e.value.split("(")[0],"0"!==(s=e.value.split("(")[1].split(")")[0]))&&(o.innerHTML=o.innerHTML+"<span class="+glt+"><span class="+ult+">"+r+"</span> : <span class="+mlt+">"+s+"</span></span>"),["ColumnChooser"]),s=(this.parent.editSettings.allowEditing&&(r=this.parent.editSettings.allowCommandColumns?["ColumnChooser","Add"]:"Batch"===this.parent.editSettings.mode?["ColumnChooser","Add","Delete","Update","Cancel"]:"Dialog"===this.parent.editSettings.mode?["ColumnChooser","Add","Edit","Delete"]:["ColumnChooser","Add","Edit","Delete","Update","Cancel"]),Q("div",{id:this.parent.element.id+"_drillthroughgrid",className:"e-drillthrough-grid"})),a=(IP.Inject(hk,QG,jG,ZG,mX),this.drillThroughGrid=new IP({cssClass:this.parent.cssClass,gridLines:"Default",allowResizing:!0,allowReordering:!0,showColumnChooser:!0,enableHover:!1,toolbar:r,columns:e.gridColumns,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableVirtualization:!this.parent.editSettings.allowEditing,allowPaging:this.parent.editSettings.allowEditing,pageSettings:{pageSize:20},rowHeight:this.parent.gridSettings.rowHeight,height:"100%"}),"olap"===this.parent.dataType&&this.formatData(i),this);if(this.parent.trigger(mpt,{cellInfo:e,gridObj:this.drillThroughGrid,type:"editing"}),this.drillThroughGrid.allowExcelExport&&IP.Inject(pK),this.drillThroughGrid.allowPdfExport&&IP.Inject(uK),this.parent.editSettings.allowEditing){IP.Inject(uX,gG);try{this.drillThroughGrid.editSettings=this.parent.editSettings,this.drillThroughGrid.actionBegin=function(e){e="save"===e.requestType?uut:"add"===e.requestType?gut:"delete"===e.requestType?mut:"";n.parent.actionObj.actionName=e,n.parent.actionObj.actionName&&n.parent.actionBeginMethod()},this.parent.editSettings.allowCommandColumns?(this.drillThroughGrid.editSettings.mode="Normal",this.drillThroughGrid.editSettings.allowEditOnDblClick=!1,IP.Inject(bK),this.drillThroughGrid.columns.push({headerText:this.parent.localeObj.getConstant("manageRecords"),width:160,showInColumnChooser:!1,commands:[{type:"Edit",buttonOption:{iconCss:" e-icons e-edit",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:"")}},{type:"Delete",buttonOption:{iconCss:"e-icons e-delete",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:"")}},{type:"Save",buttonOption:{iconCss:"e-icons e-update",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:"")}},{type:"Cancel",buttonOption:{iconCss:"e-icons e-cancel-icon",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:"")}}]})):this.drillThroughGrid.editSettings.allowEditOnDblClick=this.parent.editSettings.allowEditOnDblClick,this.drillThroughGrid.columns.push({field:"__index",visible:!1,isPrimaryKey:!0,type:"string",showInColumnChooser:!1,defaultValue:"0",validationRules:{required:!0}})}catch(e){this.parent.actionFailureMethod(e)}this.drillThroughGrid.actionComplete=function(e){"batchsave"!==e.requestType&&"save"!==e.requestType&&"delete"!==e.requestType||(a.isUpdated=!0),n.parent.actionObj.actionName=n.parent.getActionCompleteName();var t={editInfo:{type:n.drillThroughGrid.editSettings.mode,action:e.requestType,data:i}};n.parent.actionObj.actionInfo=t,n.parent.actionObj.actionName&&n.parent.actionCompleteMethod(),("Normal"===a.drillThroughGrid.editSettings.mode&&"save"===e.requestType&&0<a.drillThroughGrid.element.querySelectorAll(".e-tbar-btn:hover").length&&!a.parent.editSettings.allowCommandColumns||"batchsave"===e.requestType)&&a.dialogPopUp.hide()},this.drillThroughGrid.beforeBatchSave=function(){a.isUpdated=!0}}else IP.Inject(xY);return document.body.appendChild(s),this.drillThroughGrid.isStringTemplate=!0,this.drillThroughGrid.appendTo(s),t.appendChild(o),t.appendChild(s),t},vmt.prototype.frameGridColumns=function(e){this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;var t="olap"===this.parent.dataType?e[0]?Object.keys(e[0]):[]:Object.keys(this.engine.fieldList),i=[],n={};if(0<this.parent.dataSourceSettings.formatSettings.length)for(var o=0;o<this.parent.dataSourceSettings.formatSettings.length;o++)n[this.parent.dataSourceSettings.formatSettings[o].name]=this.parent.dataSourceSettings.formatSettings[o].format;if("olap"===this.parent.dataType)for(var r=0,s=t;r<s.length;r++){var a=s[r];i.push({field:a.replace(/_x005B_|_x0020_|_x005D_|_x0024_/g,"").replace("].[","").split(".").reverse().join(""),headerText:a.replace(/_x005B_|_x005D_|_x0024_/g,"").replace(/_x0020_/g," ").replace("].[","").split(".").reverse().join("."),width:120,visible:!0,validationRules:{required:!0},format:je(n[a])?null:n[a],type:je(n[a])?"string":null})}else for(var l=0,h=t;l<h.length;l++){var d,p,c,a=h[l];"CalculatedField"!==this.engine.fieldList[a].aggregateType&&(d="",p=null,c=!("date"!==this.engine.fieldList[a].type&&"datetime"!==this.engine.fieldList[a].type||!(this.isDateFieldExist(a)||e[0]&&e[0][a]&&-1===e[0][a].toString().indexOf(" "))),"number"===this.engine.fieldList[a].type?(d="numericedit",p="number"):"date"===this.engine.fieldList[a].type&&c?(d="datepickeredit",p="date"):"datetime"===this.engine.fieldList[a].type&&c?(d="datetimepickeredit",p="date"):d="defaultedit",this.parent.engineModule.formatFields[a]&&(p=this.parent.engineModule.formatFields[a].type),c=this.parent.enableHtmlSanitizer?go.sanitize(this.engine.fieldList[a].caption):this.engine.fieldList[a].caption,i.push({field:a,headerText:c,width:120,visible:this.engine.fieldList[a].isSelected,validationRules:{required:!0},editType:d,format:je(n[a])?void 0:n[a],type:je(n[a])?"string":p}))}return i},vmt.prototype.isDateFieldExist=function(e){for(var t=0;t<this.parent.dataSourceSettings.formatSettings.length;t++)if(this.parent.dataSourceSettings.formatSettings[t].name===e&&-1<this.parent.dataSourceSettings.formatSettings[t].type.indexOf("date"))return!0;for(t=0;t<this.parent.dataSourceSettings.fieldMapping.length;t++)if(this.parent.dataSourceSettings.fieldMapping[t].name===e&&this.parent.dataSourceSettings.fieldMapping[t].dataType&&-1<this.parent.dataSourceSettings.fieldMapping[t].dataType.indexOf("date"))return!0;return!1},vmt.prototype.formatData=function(e){for(var t=0;t<e.length;){for(var i=e[t],n=Object.keys(e[t]),o={},r=0;r<n.length;)o[n[r].replace(/_x005B_|_x0020_|_x005D_|_x0024_/g,"").replace("].[","").split(".").reverse().join("")]=i[n[r]],r++;e[t]=o,t++}},vmt.prototype.dataWithPrimarykey=function(e,t,i){for(var n=0<this.indexString.length?this.indexString:Object.keys(e.currentCell.indexObject),e=t,o=0,r=0,s=e;r<s.length;r++)s[r].__index=n[o],i[n[o].toString()]=Number(n[o]),o++;return e},vmt.prototype.drillthroughKeyActionHandler=function(e){"escape"===e.action&&this.processClose(e)},vmt.prototype.processClose=function(e){var t=e.target;if(t&&z(t,".e-popup.e-popup-open")){t=K(z(t,".e-popup.e-popup-open"),pS);if(t&&!t.closeOnEscape){var i=t.element.getAttribute("data-fieldName");if(t.hide(),this.parent.element)for(var n=0,o=[].slice.call(this.parent.element.querySelectorAll(".e-pivot-button"));n<o.length;n++){var r=o[n];if(r.getAttribute("data-uid")===i){r.focus();break}}e.preventDefault()}}},vmt.prototype.destroy=function(){this.parent.isDestroyed||this.drillthroughKeyboardModule&&!this.drillthroughKeyboardModule.isDestroyed&&(this.drillthroughKeyboardModule.destroy(),this.drillthroughKeyboardModule=null)};var ymt=vmt;function vmt(e){this.indexString=[],this.isUpdated=!1,this.parent=e,this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule}wmt.prototype.getModuleName=function(){return"drillThrough"},wmt.prototype.addInternalEvents=function(){this.parent.on(vct,this.wireEvents,this)},wmt.prototype.wireEvents=function(){this.unWireEvents(),E.add(this.parent.element,"dblclick",this.mouseClickHandler,this)},wmt.prototype.unWireEvents=function(){this.parent.isDestroyed||E.remove(this.parent.element,"dblclick",this.mouseClickHandler)},wmt.prototype.mouseClickHandler=function(e){var t,e=e.target,i=null;e.classList.contains("e-stackedheadercelldiv")||e.classList.contains("e-headercelldiv")||e.classList.contains("e-stackedheadertext")||e.classList.contains("e-headertext")?i=z(e.parentElement,"th"):e.classList.contains("e-cellvalue")?i=e.parentElement:(e.classList.contains("e-headercell")||e.classList.contains("e-rowcell"))&&(i=e),i&&0<this.parent.pivotValues.length&&0<this.parent.dataSourceSettings.values.length&&(this.parent.allowDrillThrough||this.parent.editSettings.allowEditing)&&i.classList.contains("e-valuescontent")&&(e=parseInt(i.getAttribute("aria-colindex"),10)-1,t=Number(i.getAttribute("index")),je(this.parent.pivotValues[t])||je(this.parent.pivotValues[t][e])||this.executeDrillThrough(this.parent.pivotValues[t][e],t,e,i))},wmt.prototype.executeDrillThrough=function(e,t,i,n){this.parent.drillThroughElement=n,this.parent.drillThroughValue=e;var o="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,r="",s="",a=[];if(!je(e.rowHeaders)&&!je(e.columnHeaders)){if("olap"===this.parent.dataType){var l=void 0,l=(l="row"===this.parent.dataSourceSettings.valueAxis?o.tupRowInfo[e.rowOrdinal]:o.tupColumnInfo[e.colOrdinal])?o.getUniqueName(l.measureName):e.actualText;if(o.fieldList[l]&&o.fieldList[l].isCalculatedField)return void this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("drillError"));r=o.fieldList[l||e.actualText].caption,s=o.fieldList[l||e.actualText].aggregateType;try{this.parent.olapEngineModule.getDrillThroughData(e,this.parent.maxRowsInDrillThrough),a=JSON.parse(o.gridJSON)}catch(e){return this.parent.olapEngineModule.errorInfo&&this.parent.actionFailureMethod(this.parent.olapEngineModule.errorInfo),this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.olapEngineModule.errorInfo||o.gridJSON),void(this.parent.olapEngineModule.errorInfo=void 0)}}else if(r=o.fieldList[e.actualText.toString()]?o.fieldList[e.actualText.toString()].caption:e.actualText.toString(),s=o.fieldList[e.actualText]?o.fieldList[e.actualText].aggregateType:"","Server"===this.parent.dataSourceSettings.mode)this.parent.getEngine("fetchRawData",null,null,null,null,null,null,{rowIndex:t,columnIndex:i});else if(this.parent.allowDataCompression){var h=Object.keys(e.indexObject);this.drillThroughDialog.indexString=[];for(var d=0,p=h;d<p.length;d++)for(var c=p[d],u=0,g=this.parent.engineModule.groupRawIndex[Number(c)];u<g.length;u++){var m=g[u];a.push(this.parent.engineModule.actualData[m]),this.drillThroughDialog.indexString.push(m.toString())}}else for(var f=0,y=h=Object.keys(e.indexObject);f<y.length;f++){var v=y[f];a.push(this.parent.engineModule.data[Number(v)])}"Server"!==this.parent.dataSourceSettings.mode&&this.triggerDialog(r,s,a,e,n)}},wmt.prototype.frameData=function(e){for(var t=0,i=0,n=[];i<e.rawData.length;){for(var o={};t<e.gridColumns.length;)o[e.gridColumns[t].field]="Server"===this.parent.dataSourceSettings.mode?e.rawData[i][-1!==this.parent.engineModule.fields.indexOf(e.gridColumns[t].field)?this.parent.engineModule.fields.indexOf(e.gridColumns[t].field):0]:e.rawData[i][this.parent.engineModule.fieldKeys[e.gridColumns[t].field]],t++;n.push(o),i++,t=0}return e.rawData=n,e},wmt.prototype.triggerDialog=function(e,t,i,n,o){var t="CalculatedField"===t?e.toString():""!==t?this.parent.localeObj.getConstant(t)+" "+this.parent.localeObj.getConstant("of")+" "+e:e,t=this.parent.enableHtmlSanitizer?go.sanitize(t):t,e="row"===this.parent.dataSourceSettings.valueAxis?this.parent.getRowText(Number(o.getAttribute("index")),0):""===n.rowHeaders?"":n.rowHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - "),r={currentTarget:o,currentCell:n,rawData:i,rowHeaders:e,columnHeaders:""===n.columnHeaders?"":n.columnHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - "),value:t+"("+n.formattedText+")",gridColumns:this.drillThroughDialog.frameGridColumns(i),cancel:!1},s=("CSV"===this.parent.dataSourceSettings.type&&(r=this.frameData(r)),this);this.parent.trigger(apt,r,function(e){r.cancel||s.drillThroughDialog.showDrillThroughDialog(e)})},wmt.prototype.destroy=function(){this.unWireEvents(),this.drillThroughDialog&&(this.drillThroughDialog.destroy(),this.drillThroughDialog=null)};var bmt=wmt;function wmt(e){this.parent=e,this.drillThroughDialog=new ymt(this.parent),this.addInternalEvents()}Smt.prototype.getModuleName=function(){return"pivotChart"},Smt.prototype.loadChart=function(e,t){if(this.parent=e,this.measuresNames={},this.engineModule="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.dataSourceSettings=this.parent.dataSourceSettings,this.chartSettings=t,!("olap"===e.dataType?""!==e.dataSourceSettings.url&&!e.olapEngineModule.isEmptyData&&0<e.olapEngineModule.tupColumnInfo.length&&0<e.olapEngineModule.tupRowInfo.length&&(!je(e.olapEngineModule.colMeasurePos)||!je(e.olapEngineModule.rowMeasurePos)):"Server"===this.parent.dataSourceSettings.mode?!je(e.dataSourceSettings.url)&&""!==e.dataSourceSettings.url&&0<e.dataSourceSettings.values.length&&!e.engineModule.isEmptyData:0<e.dataSourceSettings.values.length&&e.dataSourceSettings.dataSource&&(0<e.dataSourceSettings.dataSource.length||e.dataSourceSettings.dataSource instanceof me)&&!e.engineModule.isEmptyData))return this.parent.chart?(this.parent.element.querySelector(".e-chart")?(this.parent.chart.series=[],this.parent.chart.rows=[],this.parent.chart.primaryXAxis.title="",this.parent.chart.primaryYAxis.title="",this.parent.chart.primaryXAxis.multiLevelLabels=[],this.parent.chart.primaryYAxis.multiLevelLabels=[],0<this.parent.chart.axes.length&&(this.parent.chart.axes[0].title=""),this.parent.chart.primaryXAxis.zoomFactor=je(this.parent.chartSettings.primaryXAxis.zoomFactor)?1:this.parent.chartSettings.primaryXAxis.zoomFactor):this.parent.element.querySelector(".e-accumulationchart")&&(this.parent.chart.series[0].dataSource=[{}],this.parent.chart.series[0].dataLabel={}),void this.parent.chart.refresh()):(this.parent.appendChartElement(),this.parent.enableVirtualization&&this.isChartInitial&&(this.isChartInitial=!1,this.parent.onContentReady()),void this.parent.notify(vct,{}));this.parent.chart||!this.parent.element.querySelector(".e-chart")&&!this.parent.element.querySelector(".e-accumulationchart")||ue(ge("#"+this.parent.element.id+"_chart",this.parent.element)),this.chartSettings.enableMultipleAxis&&this.accumulationType.indexOf(t.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type?this.measureList=this.dataSourceSettings.values.map(function(e){return e.name}):this.measureList=[""===t.value?this.dataSourceSettings.values[0].name:t.value];for(var O=0,N=this.dataSourceSettings.values;O<N.length;O++){var i=(r=N[O]).name.replace(/[^A-Z0-9]+/gi,"_");this.measuresNames[r.name]=i,this.measuresNames[i]=r.name,"Polar"!==this.chartSettings.chartSeries.type&&"Radar"!==this.chartSettings.chartSeries.type||(this.measuresNames[r.caption||r.name]=r.name)}this.columnGroupObject={},this.accEmptyPoint=!1;for(var V,_,n,o,r,s=this.engineModule.pivotValues,H=(this.currentMeasure=t.enableMultipleAxis&&this.accumulationType.indexOf(t.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type?this.measureList[0]:(""===t.value||0===this.dataSourceSettings.values.filter(function(e){return e.name===t.value}).length)&&0<this.dataSourceSettings.values.length?this.dataSourceSettings.values[0].name:t.value,this.getColumnTotalIndex(s)),a=Object.keys(s),l={},h=0,d=-.5,z=(this.headerColl={},this.maxLevel=0,{}),j="",W="",p="",Q=(this.chartSeriesInfo={},this.selectedLegend=0,!1),U={},c=!1,u=this.parent.dataSourceSettings.valueSortSettings.headerDelimiter,q=0,G=this.dataSourceSettings.values;q<G.length;q++)U[i=(r=G[q]).name]=r.caption||i,U[r.caption||i]=i;"olap"===this.parent.dataType&&(z=this.groupHierarchyWithLevels(s,e=[]),j=e[e.length-1],p=W=this.measurePos===e.length-1&&1<e.length?e[e.length-2]:j);for(var g=0,m=0,Y=0,X=!1,K=0,f=0,J=0,Z=0,$=a;Z<$.length;Z++){var y=$[Z],v=Number(y),ee=void 0,b=!1,w=void 0,y=void 0,w=X?s[v-f][this.parent.engineModule.rowMaxLevel]:s[v]["Tabular"===this.parent.gridSettings.layout?this.parent.engineModule.rowMaxLevel:0];if(w&&(y=f===w.level?1:f+1),"Tabular"===this.parent.gridSettings.layout&&(!this.parent.dataSourceSettings.showSubTotals||!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals)&&w&&s[v-(f===w.level?1:f+1)]&&!this.dataSourceSettings.showSubTotals&&s[v-y][this.parent.engineModule.rowMaxLevel])for(var te,y=(X?s[v-(f+1)]:s[v-y])[this.parent.engineModule.rowMaxLevel],ie=y.valueSort.levelName.split(u),ne=w.valueSort.levelName.split(u),C=y.formattedText.split(" "),ee=this.isMemberDrilled(y,C),S=ie.length-2-J;0<=S;S--)if(ie[S]!==ne[S]&&!ee){1!==K?(w=(X?s[v-(f+1)]:s[v-(f===w.level?1:f+1)])[S],X=b=!0,K++,f++,te=Number(a[a.length-1])+1,a[a.length]=te.toString(),ie[S-1]&&ie[S-1]!==ne[S-1]?(K=0,J++):J=0):K--;break}if(!je(s[v-f])){var y="Tabular"===this.parent.gridSettings.layout?this.parent.engineModule.rowMaxLevel:0,C=s[v-f][y],A=C&&C.valueSort&&!je(C.valueSort.levelName)?C.valueSort.levelName.toString().split(u):void 0,c=!1;if(A&&"Grand Total"!==A[0]&&!(c=t.enableMultipleAxis&&this.accumulationType.indexOf(t.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type||-1<A.indexOf(U[this.currentMeasure])?!0:c)){for(var oe=0,re=A;oe<re.length;oe++)if(U[he=re[oe]]){c=!0;break}c=!c}if(C&&"row"===C.axis&&(0===this.dataSourceSettings.rows.length||"grand sum"!==C.type&&c)&&("Tabular"===this.parent.gridSettings.layout||!w.isSum)){var x="olap"===this.parent.dataType?this.engineModule.tupRowInfo[w.ordinal]:void 0,se=-1,y=w.level;if("olap"===this.parent.dataType)Q="[Measures]"===w.hierarchy?Q:this.isAttributeDrill(w.hierarchy,x.drillInfo),p=p===W||"[Measures]"===w.hierarchy||w.isNamedSet||this.engineModule.fieldList[w.hierarchy]&&!this.engineModule.fieldList[w.hierarchy].hasAllMember?W:p,se=x.drillInfo.length-1,3===w.memberType||x.measureName&&x.measureName!==this.dataSourceSettings.values[0].name||(l=0===(h=(_=void 0===_?w.levelUniqueName:_)===w.levelUniqueName?0:h)?{}:l,h=n&&_!==w.levelUniqueName?n.hierarchy===w.hierarchy?h+(w.level-n.level):je(l[w.levelUniqueName])?z[w.hierarchy].start:l[w.levelUniqueName]:h,y=l[w.levelUniqueName]=h,d+=!n||p!==n.hierarchy||n.isDrilled&&n.hasChild?0:1,p=Q?w.hierarchy:W,V=h,n=w);else if("value"!==w.type){if("Tabular"===this.parent.gridSettings.layout){for(var ne=w.valueSort.levelName.split(u),I=w.formattedText.split(" "),ae=(ee=this.isMemberDrilled(w,ne),A.length-2!=this.parent.engineModule.rowMaxLevel-1?A.length-2:this.parent.engineModule.rowMaxLevel-1),T=0;T<=this.parent.engineModule.rowMaxLevel;T++)if(this.headerColl[d]&&this.headerColl[d][T]||b){if(w.isSum||b){if(0<w.level){d-=w.level===this.parent.engineModule.rowMaxLevel-1?g-1:m-1,w.formattedText=!this.parent.dataSourceSettings.showSubTotals||!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?w.formattedText:2<I.length?I.slice(0,I.length-1).join(" "):I[0],w.hasChild=!0;break}d-=Y-1,w.formattedText=!this.parent.dataSourceSettings.showSubTotals||!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?w.formattedText:2<I.length?I.slice(0,I.length-1).join(" "):I[0],w.hasChild=!0;break}if(this.headerColl[d][T]&&A[ae]!==this.headerColl[d][T].name){d++;break}}w.isSum||b||(g++,m++,Y++),this.parent.dataSourceSettings.expandAll?w.isDrilled=!ee:w.isDrilled=!!ee}else void 0===V||V<y||d++;V=y}this.maxLevel=y>this.maxLevel?y:this.maxLevel;var le="olap"===this.parent.dataType?w.formattedText:(w.actualText||w.formattedText).toString(),E=this.engineModule.fieldList[this.currentMeasure],E=0===this.parent.dataSourceSettings.rows.length?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(E.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+(je(E.caption)?E.name:E.caption):w.formattedText?w.formattedText.toString():le,E=w.hasChild&&!w.isNamedSet?(w.isDrilled?" - ":" + ")+E:E,he=x?x.uNameCollection:w.valueSort.levelName.toString(),le={name:le,text:E,hasChild:w.hasChild,isDrilled:w.isDrilled,levelName:he,level:y,fieldName:w.valueSort.axis?w.valueSort.axis.toString():"",rowIndex:v-f,colIndex:0,cell:w},E=(("olap"===this.parent.dataType?3!==w.memberType:"value"!==w.type)&&(this.headerColl[d]||(this.headerColl[d]={}),this.headerColl[d][y]=le,"Tabular"===this.parent.gridSettings.layout)&&((w.isSum||b)&&(0<w.level?d+=w.level===this.parent.engineModule.rowMaxLevel-1?g-1:m-1:d+=Y-1),0===w.level?Y=g=m=0:w.level===this.parent.engineModule.rowMaxLevel-1?g=0:w.level<this.parent.engineModule.rowMaxLevel-1&&0!==w.level&&(m=0)),"Tabular"===this.parent.gridSettings.layout?s[v-f]:s[v]),de=Object.keys(E),D=void 0;if("olap"===this.parent.dataType)o=3!==w.memberType?w:o;else if(o="value"!==w.type?w:o,"value"!==w.type)o=w;else{var y=w&&w.valueSort&&w.valueSort.levelName&&w.valueSort.levelName.toString().split(u),pe=void 0;if(y&&0<y.length&&(y.splice(y.length-1,1),pe=y.join(u)),!(this.parent.dataSourceSettings.valueIndex<=0||this.engineModule.valueAxis&&this.dataSourceSettings.rows.length===this.engineModule.measureIndex||je(o.valueSort)||pe===o.valueSort.levelName))for(var M=v;-1<M;)s[M]&&s[M][0]&&s[M][0].valueSort&&s[M][0].valueSort.levelName===pe&&(o=s[M][0],M=0),M--}for(var ce="Tabular"===this.parent.gridSettings.layout?this.parent.engineModule.rowMaxLevel:0;ce<de.length;ce++){var k=de[ce],k=Number(k),P=s[v-f][k],B=!je(P.rowHeaders)||0===this.dataSourceSettings.rows.length,F="olap"===this.parent.dataType&&x&&x.measureName?x.measureName:P.actualText;if(("olap"!==this.parent.dataType||!P.isGrandSum)&&!H[P.colIndex]&&"value"===P.axis&&"header"!==w.type&&""!==F&&(t.enableMultipleAxis&&this.accumulationType.indexOf(t.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type||F===this.currentMeasure)){if(je(w.members)&&(w.members=[]),"olap"===this.parent.dataType?j!==w.hierarchy&&!Q||(3===w.memberType&&D?se!==this.measurePos||D.isDrilled&&D.hasChild:w.isDrilled&&w.hasChild):("value"===w.type&&D?!je(D.members)&&D.hasChild&&D.isDrilled:w.hasChild&&w.isDrilled)||!B)break;if("olap"===this.parent.dataType&&!0===P.isSum&&"row"===this.parent.dataSourceSettings.valueAxis)continue;var B="",L=(B="olap"===this.parent.dataType?P.columnHeaders.toString().split(/~~|::/).join(" - "):(L=P.columnHeaders.toString().split(u),Hdt.formatChartHeaders(L,this,!0,P)),""),R=(L="olap"===this.parent.dataType?P.rowHeaders.toString().split(/~~|::/).join(" - "):(R=P.rowHeaders.toString().split(u),Hdt.formatChartHeaders(R,this,!1,P)),B+" | "+F),F=(this.chartSeriesInfo[B]={uniqueName:B,caption:P.hierarchyName&&P.hierarchyName.toString().split(u).join(" - "),colorIndex:[]},this.chartSeriesInfo[this.chartSeriesInfo[B].caption]=this.chartSeriesInfo[B],"pivot"===this.parent.dataType&&this.engineModule.aggregatedValueMatrix[v]&&!je(this.engineModule.aggregatedValueMatrix[v][k])?Number(this.engineModule.aggregatedValueMatrix[v][k]):je(P.value)?P.value:Number(P.value));0===(F=F===1/0?null:F)&&(this.accEmptyPoint=!0),this.columnGroupObject[R]?this.columnGroupObject[R].push({x:0===this.dataSourceSettings.rows.length?w.formattedText:L,y:F,rIndex:v,cIndex:k}):this.columnGroupObject[R]=[{x:0===this.dataSourceSettings.rows.length?w.formattedText:L,y:F,rIndex:v,cIndex:k}]}D=o}}}}this.refreshChart()},Smt.prototype.refreshChart=function(){this.chartSeries=[];for(var e=0,t={},i=Object.keys(this.columnGroupObject),n=(this.persistSettings=JSON.parse(this.parent.getChartSettings()).chartSettings,this.persistSettings.palettes&&0<this.persistSettings.palettes.length?this.persistSettings.palettes:Vve(this.chartSettings.theme)),o=this.parent.chartSettings.columnDelimiter||"-",o=this.parent.chartSettings.columnHeader&&""!==this.parent.chartSettings.columnHeader?this.parent.chartSettings.columnHeader.split(o).join(" - "):"",r=this.chartSettings.chartSeries?this.chartSettings.chartSeries.type:void 0,s={},a=0;a<this.parent.dataSourceSettings.values.length;a++)s[this.parent.dataSourceSettings.values[a].name]=je(this.parent.dataSourceSettings.values[a].caption)?void 0:this.parent.dataSourceSettings.values[a].caption;if(-1<this.accumulationType.indexOf(r)&&0<i.length){this.currentColumn=-1<i.indexOf(o+" | "+this.currentMeasure)&&void 0!==o?o+" | "+this.currentMeasure:i[0];var l={};(je((l=this.persistSettings.chartSeries?this.frameChartSeries(this.persistSettings.chartSeries):l).palettes)||0===l.palettes.length)&&!je(this.persistSettings.palettes)&&0<this.persistSettings.palettes.length&&(l.palettes=this.persistSettings.palettes),l.dataSource=this.columnGroupObject[this.currentColumn],l.xName="x",l.yName="y",this.persistSettings.chartSeries&&this.persistSettings.chartSeries.dataLabel?(l.dataLabel=this.persistSettings.chartSeries.dataLabel,l.dataLabel.name="x"):(l.dataLabel={visible:!0,position:"Outside",name:"x"},this.parent.setProperties({chartSettings:{chartSeries:{dataLabel:{visible:!0,position:"Outside"}}}},!0)),this.accEmptyPoint&&l.emptyPointSettings?l.emptyPointSettings.mode="Zero":this.accEmptyPoint&&(l.emptyPointSettings={mode:"Zero"}),l.name=this.currentColumn,"Doughnut"===r?(l.type="Pie",l.innerRadius=this.chartSettings.chartSeries.innerRadius||"40%"):"Pie"===r&&(l.innerRadius=this.chartSettings.chartSeries.innerRadius||"0"),this.chartSeries=this.chartSeries.concat(l)}else for(var h=0,d=i;h<d.length;h++){var p=d[h],l={};!je((l=this.persistSettings.chartSeries?this.frameChartSeries(this.persistSettings.chartSeries):l).palettes)&&0<l.palettes.length&&(je(this.persistSettings.palettes)||0===this.persistSettings.palettes.length)&&(this.chartSettings.palettes=l.palettes);for(a=0;a<this.columnGroupObject[p].length;a++){var c=this.engineModule.fieldList[this.currentMeasure];this.columnGroupObject[p][a].x=0!==this.parent.dataSourceSettings.rows.length||this.chartSettings.showMultiLevelLabels?""===this.columnGroupObject[p][a].x?this.parent.localeObj.getConstant("blank"):this.columnGroupObject[p][a].x:this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(c.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+(je(c.caption)?c.name:c.caption)}l.dataSource=this.columnGroupObject[p],l.xName="x",l.yName="y",l.visible=!0;for(var u,g=void 0,m=void 0,f=void 0,a=0,y=p.split(" | ");a<y.length;a++)this.measuresNames&&this.measuresNames[y[a]]&&(m=y[a],f=p.split(" | "+m)[0]);this.chartSettings.enableMultipleAxis&&(g=f+" | "+(u=je(s[u=m])?u:s[u])),l.name=this.chartSettings.enableMultipleAxis?g:f,this.chartSettings.showPointColorByMembers&&this.chartSettings.enableMultipleAxis&&(l.name=f,u=this.chartSeriesInfo[l.name].caption,l.name=null!=u?u:l.name,t[l.name]?(l.fill=t[l.name].color,this.chartSeriesInfo[l.name].colorIndex.push(this.selectedLegend++),l.name=void 0):(e=n[e]?e:0,t[l.name]={name:l.name,color:n[e]},l.fill=n[e++],this.chartSeriesInfo[l.name].colorIndex.push(this.selectedLegend++))),["Radar","Polar"].indexOf(r)<0&&(g=m,l.tooltipMappingName=this.measuresNames[g],l.yAxisName=this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.measureList.join("_"):this.measuresNames[g]||g),this.persistSettings.chartSeries&&this.persistSettings.chartSeries.emptyPointSettings&&(l.emptyPointSettings=this.persistSettings.chartSeries.emptyPointSettings),l.emptyPointSettings||(l.emptyPointSettings={mode:"Zero"}),this.chartSeries=this.chartSeries.concat(l)}var o={series:this.chartSeries,cancel:!1},v=this;this.parent.trigger(Gpt,o,function(e){e.cancel?(v.element&&ue(v.element),v.parent.notify(vct,{})):v.bindChart()})},Smt.prototype.frameObjectWithKeys=function(e){for(var t=Object.keys(e),i=0,n={};i<t.length;)n[t[i]]=e[t[i]],i++;return n},Smt.prototype.frameChartSeries=function(e){for(var t=Object.keys(e),i=0,n={};i<t.length;)-1<this.accumulationType.indexOf(this.parent.chartSettings.chartSeries.type)&&-1<["fill","dashArray","width","segmentAxis","drawType","isClosed","segments","stackingGroup","marker","errorBar","trendlines","minRadius","splineType","maxRadius","cardinalSplineTension","columnWidth","columnSpacing","cornerRadius"].indexOf(t[i])||this.accumulationType.indexOf(this.parent.chartSettings.chartSeries.type)<0&&-1<["endAngle","explode","explodeAll","explodeIndex","explodeOffset","gapRatio","groupMode","groupTo","neckHeight","neckWidth","pyramidMode","startAngle","dataLabel","innerRadius"].indexOf(t[i])||(n[t[i]]=e[t[i]]),i++;return n},Smt.prototype.bindChart=function(){this.parent.showWaitingPopup();var e=this.configXAxis(),t=this.configTooltipSettings(),i=this.configLegendSettings(),n=this.configZoomSettings(),o=this.frameAxesWithRows(),r=this.chartSettings.chartSeries.type,s=("Both"===this.parent.displayOption.view?this.element="Chart"===this.parent.displayOption.primary?this.parent.element.insertBefore(this.element||Q("div",{className:gdt,id:this.parent.element.id+"_chart"}),this.parent.element.querySelector("."+Mht)):this.parent.element.appendChild(this.element||Q("div",{className:gdt,id:this.parent.element.id+"_chart"})):this.element||(this.element=this.parent.element.appendChild(Q("div",{className:gdt,id:this.parent.element.id+"_chart"}))),!this.chartElement&&this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&"Pareto"!==this.chartSettings.chartSeries.type&&(this.parent.element.querySelector("."+gdt).innerHTML="",this.chartElement=this.parent.element.querySelector("."+gdt).appendChild(Q("div",{className:Idt,id:this.parent.element.id+"_chartInner"}))),this.parent.element.querySelector("."+Idt)&&(this.parent.element.querySelector("."+Idt).innerHTML=""),this.parent.showGroupingBar?this.element.style.minWidth=this.parent.minWidth?this.parent.minWidth+"px":"400px !important":this.element.style.minWidth=this.parent.minWidth?this.parent.minWidth+"px":"310px !important",this.parent.width.toString()),a=(this.parent.showToolbar&&this.parent.grid&&(s=this.parent.getGridWidthAsNumber().toString()),this.getChartHeight());this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&this.accumulationType.indexOf(r)<0&&"Pareto"!==this.chartSettings.chartSeries.type&&(this.parent.element.querySelector("."+gdt).style.height=("auto"===a?this.getChartAutoHeight():a)+"px",this.parent.element.querySelector("."+gdt).style.width=s+"px","Polar"!==this.parent.chartSettings.chartSeries.type)&&"Radar"!==this.parent.chartSettings.chartSeries.type&&(this.parent.element.querySelector("."+gdt).style.overflow="auto",this.parent.element.querySelector("."+gdt).style.overflowX="hidden"),this.parent.chart&&("accumulationchart"===this.parent.chart.getModuleName()&&this.accumulationType.indexOf(r)<0||"chart"===this.parent.chart.getModuleName()&&-1<this.accumulationType.indexOf(r)&&"Pareto"!==this.chartSettings.chartSeries.type)&&(this.parent.chart.destroy(),ge("#"+this.parent.element.id+"_chart",this.parent.element))&&(ge("#"+this.parent.element.id+"_chart",this.parent.element).innerHTML="",ge("#"+this.parent.element.id+"_chart",this.parent.element).appendChild(Q("div",{className:Idt,id:this.parent.element.id+"_chartInner"}))),!(this.parent.chart&&this.parent.chart.element&&this.parent.element.querySelector(".e-chart")||this.parent.element.querySelector(".e-accumulationchart"))||this.parent.toolbarModule&&this.parent.toolbarModule.isMultiAxisChange?(this.parent.toolbarModule&&this.parent.toolbarModule.isMultiAxisChange&&this.parent.chart&&(this.parent.chart.isDestroyed||this.parent.chart.destroy(),this.parent.chart=void 0,ge("#"+this.parent.element.id+"_chart",this.parent.element).innerHTML="",ge("#"+this.parent.element.id+"_chart",this.parent.element).appendChild(Q("div",{className:Idt,id:this.parent.element.id+"_chartInner"})),this.parent.toolbarModule.isMultiAxisChange=!1),twe.Inject(Fwe,gCe,HCe,Uwe,aCe,OCe,fSe,Ewe,vCe,wSe,DSe,m1e,$we,nCe,zwe,sSe,TCe,SCe,LCe,p1e,I1e,JAe,FAe,pwe,y1e,C1e,NAe,M1e,bAe,IAe,Cwe,UAe),oxe.Inject(exe,pxe,mxe,Axe,bxe,Exe,M1e),-1<this.accumulationType.indexOf(r)?this.parent.chart=new oxe({series:0<this.chartSeries.length?this.chartSeries:[{}],legendSettings:i,tooltip:t,width:s,height:a.toString(),title:this.chartSettings.title,enableSmartLabels:this.chartSettings.enableSmartLabels,center:this.chartSettings.pieCenter,enableBorderOnMouseMove:this.chartSettings.enableBorderOnMouseMove,highlightMode:this.chartSettings.highlightMode,highlightPattern:this.chartSettings.highlightPattern,titleStyle:this.chartSettings.titleStyle,subTitle:this.chartSettings.subTitle,subTitleStyle:this.chartSettings.subTitleStyle,margin:this.chartSettings.margin,border:this.chartSettings.border,background:this.chartSettings.background,theme:this.chartSettings.theme,selectionMode:this.chartSettings.accumulationSelectionMode,isMultiSelect:this.chartSettings.isMultiSelect,enableExport:this.parent.allowPdfExport,selectedDataIndexes:this.chartSettings.selectedDataIndexes,enableAnimation:this.chartSettings.enableAnimation,useGroupingSeparator:this.chartSettings.useGroupingSeparator,locale:this.parent.locale,enableRtl:this.parent.enableRtl,beforePrint:this.beforePrint.bind(this),animationComplete:this.animationComplete.bind(this),legendRender:this.legendRender.bind(this),textRender:this.textRender.bind(this),pointRender:this.pointRender.bind(this),seriesRender:this.seriesRender.bind(this),chartMouseMove:this.chartMouseMove.bind(this),chartMouseClick:this.chartMouseClick.bind(this),pointMove:this.pointMove.bind(this),pointClick:this.pointClick.bind(this),chartMouseLeave:this.chartMouseLeave.bind(this),chartMouseDown:this.chartMouseDown.bind(this),chartMouseUp:this.chartMouseUp.bind(this),tooltipRender:this.tooltipRender.bind(this),loaded:this.loaded.bind(this),load:this.load.bind(this),resized:this.resized.bind(this)}):this.parent.chart=new twe({series:0<this.chartSeries.length?this.chartSeries:[{}],legendSettings:i,tooltip:t,zoomSettings:n,axes:"Polar"===r||"Radar"===r?[]:o.axes,rows:"Polar"===r||"Radar"===r?[{}]:"Bar"===r||"StackingBar"===r||"StackingBar100"===r||"Pareto"===r&&this.chartSettings.enableMultipleAxis?[{height:"100%"}]:o.rows,columns:"Polar"===r||"Radar"===r?[{}]:"Bar"===r||"StackingBar"===r||"StackingBar100"===r&&this.chartSettings.enableMultipleAxis?o.columns:[{width:"100%"}],primaryYAxis:"Polar"===r||"Radar"===r?o.axes[0]:{visible:!1},primaryXAxis:e,width:s,height:("Polar"!==this.parent.chartSettings.chartSeries.type&&"Radar"!==this.parent.chartSettings.chartSeries.type&&this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&"Pareto"!==this.parent.chartSettings.chartSeries.type&&0<this.parent.dataSourceSettings.values.length?Number(a)>235*this.parent.dataSourceSettings.values.length+100?isNaN(Number(a))?a:Number(a)-5:!isNaN(Number(a))||1<this.parent.dataSourceSettings.values.length?235*this.parent.dataSourceSettings.values.length+100:a:a).toString(),title:this.chartSettings.title,titleStyle:this.chartSettings.titleStyle,subTitle:this.chartSettings.subTitle,subTitleStyle:this.chartSettings.subTitleStyle,margin:this.chartSettings.margin,border:this.chartSettings.border,background:this.chartSettings.background,chartArea:(je(this.persistSettings.chartArea)?this.chartSettings:this.persistSettings).chartArea,palettes:this.chartSettings.palettes,theme:this.chartSettings.theme,crosshair:this.chartSettings.crosshair,selectionMode:this.chartSettings.selectionMode,isMultiSelect:this.chartSettings.isMultiSelect,enableExport:this.parent.allowPdfExport,selectedDataIndexes:this.chartSettings.selectedDataIndexes,isTransposed:this.chartSettings.isTransposed,enableAnimation:this.chartSettings.enableAnimation,enableCanvas:this.chartSettings.enableCanvas,useGroupingSeparator:this.chartSettings.useGroupingSeparator,description:this.chartSettings.description,tabIndex:this.chartSettings.tabIndex,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableSideBySidePlacement:this.chartSettings.enableSideBySidePlacement,beforePrint:this.beforePrint.bind(this),animationComplete:this.animationComplete.bind(this),legendRender:this.legendRender.bind(this),textRender:this.textRender.bind(this),pointRender:this.pointRender.bind(this),seriesRender:this.seriesRender.bind(this),chartMouseMove:this.chartMouseMove.bind(this),chartMouseClick:this.chartMouseClick.bind(this),pointMove:this.pointMove.bind(this),pointClick:this.pointClick.bind(this),chartMouseLeave:this.chartMouseLeave.bind(this),chartMouseDown:this.chartMouseDown.bind(this),chartMouseUp:this.chartMouseUp.bind(this),dragComplete:this.dragComplete.bind(this),zoomComplete:this.zoomComplete.bind(this),scrollStart:this.scrollStart.bind(this),scrollEnd:this.scrollEnd.bind(this),scrollChanged:this.scrollChanged.bind(this),tooltipRender:this.tooltipRender.bind(this),legendClick:this.legendClick.bind(this),loaded:this.loaded.bind(this),load:this.load.bind(this),resized:this.resized.bind(this),axisLabelRender:this.axisLabelRender.bind(this),multiLevelLabelClick:this.multiLevelLabelClick.bind(this),axisMultiLabelRender:this.multiLevelLabelRender.bind(this)}),this.parent.chart.isStringTemplate=!0):(this.parent.chart.series=this.chartSeries,this.parent.chart.title=this.parent.chartSettings.title,this.parent.chart.subTitle=this.parent.chartSettings.subTitle,this.parent.chart.background=this.parent.chartSettings.background,this.parent.chart.theme=this.parent.chartSettings.theme,this.parent.chart.legendSettings=i,this.parent.chart.selectionMode=this.parent.chartSettings.selectionMode,this.parent.chart.enableExport=this.parent.allowPdfExport,this.parent.chart.isMultiSelect=this.parent.chartSettings.isMultiSelect,this.parent.chart.enableAnimation=this.parent.chartSettings.enableAnimation,this.parent.chart.useGroupingSeparator=this.parent.chartSettings.useGroupingSeparator,this.parent.chart.highlightPattern=this.parent.chartSettings.highlightPattern,-1<this.accumulationType.indexOf(r)?(this.parent.chart.enableBorderOnMouseMove=this.parent.chartSettings.enableBorderOnMouseMove,this.parent.chart.highlightMode=this.parent.chartSettings.highlightMode,this.parent.chart.enableSmartLabels=this.parent.chartSettings.enableSmartLabels):(this.parent.chart.palettes=this.parent.chartSettings.palettes,this.parent.chart.isTransposed=this.parent.chartSettings.isTransposed,this.parent.chart.enableSideBySidePlacement=this.parent.chartSettings.enableSideBySidePlacement,this.parent.chart.tabIndex=this.parent.chartSettings.tabIndex,this.parent.chart.description=this.parent.chartSettings.description,this.parent.chart.enableCanvas=this.parent.chartSettings.enableCanvas),"Polar"===r||"Radar"===r?(this.parent.chart.primaryXAxis=e,this.parent.chart.primaryYAxis.visible=!0,this.parent.chart.primaryYAxis=o.axes[0],this.parent.chart.axes=[],this.parent.chart.rows=[{}]):this.accumulationType.indexOf(r)<0&&"chart"===this.parent.chart.getModuleName()&&(this.parent.chart.primaryYAxis.visible=!1,this.parent.chart.primaryXAxis=e,this.parent.chart.axes=o.axes,"Bar"===r||"StackingBar"===r||"StackingBar100"===r&&this.chartSettings.enableMultipleAxis?(this.parent.chart.rows=[{height:"100%"}],this.parent.chart.columns=o.columns):("Pareto"===r&&this.chartSettings.enableMultipleAxis?this.parent.chart.rows=[{height:"100%"}]:this.parent.chart.rows=o.rows,this.parent.chart.columns=[{width:"100%"}])),this.parent.chart.refresh(),-1<this.accumulationType.indexOf(r)&&"accumulationchart"===this.parent.chart.getModuleName()&&(0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length)&&(this.parent.hideWaitingPopup(),this.parent.pivotFieldListModule)&&BA(this.parent.pivotFieldListModule.fieldListSpinnerElement)),this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis?this.parent.chart.appendTo(ge("#"+this.parent.element.id+"_chartInner",this.parent.element)):this.parent.chart.appendTo(ge("#"+this.parent.element.id+"_chart",this.parent.element))},Smt.prototype.legendClick=function(e){if(this.chartSettings.showPointColorByMembers&&this.chartSettings.enableMultipleAxis)for(var t=this.chartSeriesInfo[e.legendText].colorIndex,i=1;i<t.length;i++)e.chart.series[t[i]].visible=!e.chart.series[t[i]].visible;this.parent.trigger(Ept,e)},Smt.prototype.pointClick=function(e){var t,i,n=e.series.dataSource||this.parent.chart.series[e.seriesIndex].dataSource;(-1<["Pie","Funnel","Doughnut","Pyramid","Radar","Polar"].indexOf(this.parent.chartSettings.chartSeries.type)||!this.parent.chartSettings.showMultiLevelLabels)&&("olap"===this.parent.dataType||1<this.parent.dataSourceSettings.rows.length)?(this.pivotIndex={rIndex:n?n[e.pointIndex].rIndex:void 0,cIndex:n?n[e.pointIndex].cIndex:void 0},this.creatMenu(),i=this.parent.element.getBoundingClientRect(),t=(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:0)+(this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:0)+(window.scrollY||document.documentElement.scrollTop)+i.top,this.accumulationMenu.open(t+e.y,e.x+i.left+(window.scrollX||document.documentElement.scrollLeft))):(this.parent.allowDrillThrough||this.parent.editSettings.allowEditing)&&this.parent.drillThroughModule&&(t=n[e.pointIndex].rIndex,i=n[e.pointIndex].cIndex,this.parent.drillThroughModule.executeDrillThrough(this.parent.pivotValues[t][i],t,i)),this.parent.trigger(lct,e)},Smt.prototype.frameAxesWithRows=function(){var e=[],t=[],i=[],n=[],o=this.persistSettings.chartSeries&&("StackingColumn100"===this.persistSettings.chartSeries.type||"StackingBar100"===this.persistSettings.chartSeries.type||"StackingArea100"===this.persistSettings.chartSeries.type||"StackingLine100"===this.persistSettings.chartSeries.type),r=["PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfDifferenceFrom","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal"];if(this.chartSettings.enableMultipleAxis)for(var s=0,a=100/this.dataSourceSettings.values.length+"%",l=0,h=this.dataSourceSettings.values;l<h.length;l++){for(var d=h[l],p=this.engineModule.fieldList[d.name],c=("olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(p.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" ")+p.caption,u=(n.push(c),void 0),g=0,m=this.dataSourceSettings.formatSettings;g<m.length;g++){var f=m[g];if(f.name===d.name){u=f;break}}var y=-1!==Hdt.inArray(p.aggregateType,r)?"P2":u?u.format:"olap"===this.parent.dataType?this.getFormat(p.formatString):"N",v="Polar"===this.chartSettings.chartSeries.type||"Radar"===this.chartSettings.chartSeries.type,b={};(b=this.persistSettings.primaryYAxis?this.frameObjectWithKeys(this.persistSettings.primaryYAxis):b).labelFormat=b.labelFormat||(o?"":v?"N":y),b.title=b.title||("Combined"===this.chartSettings.multipleAxisMode?n.join(" - "):c),b.zoomFactor=je(this.chartSettings.primaryYAxis.zoomFactor)?1:this.chartSettings.primaryYAxis.zoomFactor,b.edgeLabelPlacement=this.chartSettings.primaryYAxis.edgeLabelPlacement||this.persistSettings.primaryYAxis.edgeLabelPlacement,"Bar"===this.chartSettings.chartSeries.type||"StackingBar"===this.chartSettings.chartSeries.type||"StackingBar100"===this.chartSettings.chartSeries.type?b.plotOffsetRight=b.plotOffsetRight||30:b.plotOffsetTop=b.plotOffsetTop||30,v||(b.name="Combined"===this.chartSettings.multipleAxisMode?this.measureList.join("_"):this.measuresNames[d.name]||d.name),e=e.concat(b),"Combined"===this.chartSettings.multipleAxisMode&&(e=[e[e.length-1]]),"Stacked"===this.chartSettings.multipleAxisMode?(b.rowIndex=s,b.columnIndex=s,t.push({height:a}),i.push({width:a})):(b.rowIndex=0,b.columnIndex=0,t=[{height:"100%"}],i=[{width:"100%"}]),s++}else{for(var p=this.engineModule.fieldList[this.currentMeasure],c=("olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(p.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" ")+p.caption,u=void 0,w=0,C=this.dataSourceSettings.formatSettings;w<C.length;w++)if((d=C[w]).name===this.currentMeasure){u=d;break}b={},y=-1!==Hdt.inArray(p.aggregateType,r)?"P2":u?u.format:"olap"===this.parent.dataType?this.getFormat(p.formatString):"N";(b=this.persistSettings.primaryYAxis?this.frameObjectWithKeys(this.persistSettings.primaryYAxis):b).zoomFactor=je(this.chartSettings.primaryYAxis.zoomFactor)?1:this.chartSettings.primaryYAxis.zoomFactor,b.rowIndex=0,b.columnIndex=0,b.edgeLabelPlacement=this.chartSettings.primaryYAxis.edgeLabelPlacement||this.persistSettings.primaryYAxis.edgeLabelPlacement,"Polar"!==this.chartSettings.chartSeries.type&&"Radar"!==this.chartSettings.chartSeries.type&&(b.name=this.measuresNames[this.currentMeasure]||this.currentMeasure),b.labelFormat=b.labelFormat||(o?"":y),b.title=b.title||c,e=e.concat(b),t.push({height:"100%"}),i.push({width:"100%"})}return{axes:e,rows:t,columns:i}},Smt.prototype.getFormat=function(e){return e="Currency"===e?"C":"Percent"===e?"P":"N"},Smt.prototype.getColumnTotalIndex=function(e){for(var t={},i=0,n=Object.keys(e);i<n.length;i++){var o=n[i],r=e[Number(o)];if(!je(r))for(var s=0,a=Object.keys(r);s<a.length;s++){var l=a[s],l=r[Number(l)];if(!je(l)){if("column"!==l.axis)return t;"sum"!==l.type&&(this.dataSourceSettings&&this.dataSourceSettings.columns&&0===this.dataSourceSettings.columns.length||"grand sum"!==l.type)||-1===l.rowSpan||(t[l.colIndex]=l.colIndex)}}}return t},Smt.prototype.groupHierarchyWithLevels=function(e,t){var i,n={},o=0,r={};this.measurePos=this.engineModule.tupRowInfo[0].measurePosition;for(var s=0;s<e.length;s++){var a=e[s][0];a&&"row"===a.axis&&"grand sum"!==a.type&&(je(n[a.hierarchy])?(3===a.memberType?o===this.measurePos?(t[this.measurePos]=a.hierarchy,n[a.hierarchy]=((i={})[a.levelUniqueName]=a.levelUniqueName,i)):o--:(t[o]=a.hierarchy,n[a.hierarchy]=((i={})[a.levelUniqueName]=a.levelUniqueName,i)),o++):n[a.hierarchy][a.levelUniqueName]=a.levelUniqueName)}for(var l=-1,h=0;h<t.length;h++)this.measurePos!==h&&(r[t[h]]={start:l+1,end:l+Object.keys(n[t[h]]).length},l=r[t[h]].end);return r},Smt.prototype.frameMultiLevelLabels=function(){for(var e=Object.keys(this.headerColl),t=this.headerColl[-.5],i=0,n=e;i<n.length;i++){for(var o=n[i],r=Number(o),s=this.headerColl[r],a=0,l=!1;a<=this.maxLevel;)l?s[a]||(s[a]={name:s[a-1].name,text:"",hasChild:s[a-1].hasChild,isDrilled:s[a-1].isDrilled,levelName:s[a-1].levelName,level:s[a-1].level,fieldName:s[a-1].fieldName,rowIndex:s[a-1].rowIndex,colIndex:s[a-1].colIndex,span:-1}):s[a]?l=!0:s[a]=t[a],a++;t=this.headerColl[r]}for(var h={},d=0,p=e;d<p.length;d++){for(var o=p[d],r=Number(o),s=this.headerColl[r],c=0,u=Object.keys(s);c<u.length;c++){var g,m=u[c],m=Number(m);h[m]?(g=h[m].length,s[m].levelName===t[m].levelName?h[m][g-1].end=h[m][g-1].end+1:h[m].push({start:r,end:r+1,text:s[m].text,type:-1===s[m].span?"WithoutTopandBottomBorder":"WithoutTopBorder",customAttributes:s[m]})):h[m]=[{start:r,end:r+1,text:s[m].text,type:-1===s[m].span?"WithoutTopandBottomBorder":"WithoutTopBorder",customAttributes:s[m]}]}t=s}for(var f=[],y=Object.keys(h).length-1;-1<y;y--)f.push({categories:h[y],border:{width:1},overflow:"Trim"});return f},Smt.prototype.getZoomFactor=function(){this.calculatedWidth=this.getCalulatedWidth();var e=120<10*this.chartSeries.length?10*this.chartSeries.length:120,e=0<this.chartSeries.length?this.calculatedWidth/(Object.keys(this.chartSeries[0].dataSource).length*e):1;return e<1&&0<e?e:1},Smt.prototype.getCalulatedWidth=function(){return isNaN(Number(this.parent.width))?-1<this.parent.width.indexOf("%")?this.calculatedWidth=this.parent.element.clientWidth*(parseFloat(this.parent.width)/100):-1<this.parent.width.indexOf("px")?this.calculatedWidth=Number(this.parent.width.toString().split("px")[0]):this.calculatedWidth=this.parent.element.clientWidth:this.calculatedWidth=Number(this.parent.width),this.calculatedWidth},Smt.prototype.configTooltipSettings=function(){var e=this.persistSettings.tooltip||this.chartSettings.tooltip;return e.enable=void 0===e.enable||e.enable,e.enable&&e.template&&(this.templateFn=this.parent.templateParser(e.template)),this.parent.tooltipTemplate&&(e.template=e.template||this.parent.tooltipTemplate),e.header=e.header||"",e.enableMarker=void 0===e.enableMarker||e.enableMarker,e},Smt.prototype.configLegendSettings=function(){var e={};if(this.chartSettings.legendSettings)for(var t=0,i=Object.keys(this.chartSettings.legendSettings);t<i.length;)e[i[t]]=this.chartSettings.legendSettings[i[t]],t++;return e.visible=!1!==e.visible,e.padding=e.padding||25,e.shapePadding=e.shapePadding||10,e},Smt.prototype.configXAxis=function(){var e={};return(e=this.persistSettings.primaryXAxis?this.frameObjectWithKeys(this.persistSettings.primaryXAxis):e).valueType="Category",e.labelIntersectAction=e.labelIntersectAction||"Rotate45",e.title=e.title||this.dataSourceSettings.rows.map(function(e){return e.caption||e.name}).join(" / "),e.zoomFactor=je(this.parent.chartSettings.primaryXAxis.zoomFactor)?this.getZoomFactor():this.parent.chartSettings.primaryXAxis.zoomFactor,this.parent.chartSettings.zoomSettings.enableScrollbar||(e.zoomFactor=1),this.chartSettings.showMultiLevelLabels&&"Pareto"!==this.chartSettings.chartSeries.type?(e.multiLevelLabels=this.frameMultiLevelLabels(),e.border={width:1,type:"WithoutTopandBottomBorder"},e.majorTickLines={width:0,height:-10}):(e.multiLevelLabels=[],e.border={width:1,type:"Rectangle"},e.majorTickLines={width:0,height:5}),e},Smt.prototype.configZoomSettings=function(){var e=this.chartSettings.zoomSettings;return e.enableSelectionZooming=void 0===e.enableSelectionZooming||e.enableSelectionZooming,e.enableScrollbar=void 0===e.enableScrollbar||e.enableScrollbar,e},Smt.prototype.tooltipRender=function(e){var t=this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode&&this.accumulationType.indexOf(this.chartSettings.chartSeries.type)<0&&"Radar"!==this.chartSettings.chartSeries.type&&"Polar"!==this.chartSettings.chartSeries.type?e.series.tooltipMappingName:e.series.yAxisName?e.series.yAxisName.split("_CumulativeAxis")[0]:this.chartSettings.enableMultipleAxis&&this.accumulationType.indexOf(this.chartSettings.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type?e.series.name?e.series.name.split(" | ")[1]:e.data.seriesName?e.data.seriesName.split(" | ")[1]:this.currentMeasure:this.measuresNames[this.currentMeasure]||this.currentMeasure,i=e.series.dataSource||this.parent.chart.series[e.data.seriesIndex].dataSource,n=i?i[e.data.pointIndex].rIndex:void 0,o=i?i[e.data.pointIndex].cIndex:void 0,t=this.engineModule.fieldList[this.measuresNames[t]||t],r="olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(t.aggregateType),s=("olap"===this.parent.dataType?"":r+" "+this.parent.localeObj.getConstant("of")+" ")+t.caption,a=this.engineModule.pivotValues[n][o].formattedText,l=this.engineModule.formatFields[t.id],h=this.engineModule.getFormattedValue(e.point.y,t.id,a),l=l&&l.format&&null!==l.format.toLowerCase().match(/n|p|c/)&&this.chartSettings.useGroupingSeparator?"olap"===this.parent.dataType?h.toString():h.formattedText:a,h=this.parent.pivotValues[n][o],a=h.columnHeaders,d="",p=(d=je(a)?void 0:("olap"===this.parent.dataType?this.chartSeriesInfo[a.toString().split(/~~|::/).join(" - ")]:(p=a.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter),a=Hdt.formatChartHeaders(p,this,!0,h),this.chartSeriesInfo[a.toString()])).uniqueName,e.point.x);this.parent.tooltipTemplate&&void 0!==this.parent.getTooltipTemplate()||this.chartSettings.tooltip.template?(h=i?this.parent.getHeaderField(n,o,"row"):"",a=i?this.parent.getHeaderField(n,o,"Column"):"",i={rowHeaders:p,columnHeaders:d,aggregateType:r,value:l,valueField:t.caption,rowFields:h,columnFields:a},n=void 0,n=(this.parent.chartSettings&&this.parent.chartSettings.tooltip&&this.parent.chartSettings.tooltip.enable&&this.parent.chartSettings.tooltip.template?this.tooltipTemplateFn()(i,this,"tooltipTemplate",this.element.id+"1tooltipTemplate"):this.parent.getTooltipTemplate()(i,this,"tooltipTemplate",this.element.id+"tooltipTemplate"))[0].outerHTML,e.template=n):(e.text=s+": "+l+(0===this.dataSourceSettings.columns.length?"":" <br/>"+this.parent.localeObj.getConstant("column")+": "+d)+(0===this.dataSourceSettings.rows.length?"":" <br/>"+this.parent.localeObj.getConstant("row")+": "+p)+(e.data&&"Pareto"===e.data.seriesName?" <br/>"+this.parent.localeObj.getConstant("pareto")+": "+e.data.pointY+"%":""),this.parent.trigger(Tpt,e))},Smt.prototype.tooltipTemplateFn=function(){return this.templateFn},Smt.prototype.loaded=function(e){this.parent.isChartLoaded=!0;var t=(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()).toString(),i=(this.parent.chart&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.showFieldList&&"Chart"===this.parent.currentView&&this.parent.groupingBarModule.alignIcon(),this.chartSettings.showMultiLevelLabels&&(i=-1<Hdt.inArray(this.chartSettings.chartSeries.type,["Bar","StackingBar","StackingBar100"])?"_chartYAxisMultiLevelLabel0":"_chartXAxisMultiLevelLabel0",je(ge("#"+this.parent.element.id+i,this.parent.element))||this.parent.element.querySelector("#"+this.parent.element.id+i).setAttribute("cursor","pointer")),this.getChartHeight());this.parent.chart.height=i,this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&(0<=["Pie","Funnel","Pyramid","Doughnut","Radar","Polar","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)?this.parent.element.querySelector("."+gdt).style.overflow="visible":(this.parent.element.querySelector("."+gdt).style.overflow="auto",this.parent.element.querySelector("."+gdt).style.overflowX="hidden"),this.parent.element.querySelector("."+gdt).style.width=t+"px",this.parent.element.querySelector("."+gdt).style.height=i+"px"),this.updateView(),"Chart"!==this.parent.displayOption.primary&&"Chart"!==this.parent.displayOption.view||this.parent.notify(vct,{}),this.parent.trigger(Dpt,e),("Server"===this.parent.dataSourceSettings.mode&&this.parent.isServerWaitingPopup||"Local"===this.parent.dataSourceSettings.mode)&&this.parent.hideWaitingPopup()},Smt.prototype.updateView=function(){var e,t;this.parent.grid&&this.parent.chart&&this.parent.showToolbar&&(e=this.parent.element.querySelector(".e-pivot-grouping-bar"),t=this.parent.element.querySelector(".e-chart-grouping-bar"),"Table"===this.parent.currentView?(this.parent.grid.element.style.display="",this.parent.chart.element.style.display="none",this.parent.showGroupingBar&&this.parent.groupingBarModule&&(e&&(e.style.display="",e.querySelector("."+Gat))&&null!=this.parent.groupingBarModule.gridPanel&&!this.parent.groupingBarModule.gridPanel.isDestroyed&&this.parent.groupingBarModule.gridPanel.refreshOverflow(),t)&&(t.style.display="none"),this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.enableScrollOnMultiAxis&&(this.parent.element.querySelector(".e-pivotchart").style.display="none")):(this.parent.grid.element.style.display="none",this.parent.chart.element.style.display="",this.parent.showGroupingBar&&this.parent.groupingBarModule&&(e&&(e.style.display="none"),t)&&(t.style.display="",t.querySelector("."+Gat))&&null!=this.parent.groupingBarModule.chartPanel&&!this.parent.groupingBarModule.chartPanel.isDestroyed&&this.parent.groupingBarModule.chartPanel.refreshOverflow(),this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.enableScrollOnMultiAxis&&(this.parent.element.querySelector(".e-pivotchart").style.display="")))},Smt.prototype.creatMenu=function(){this.accumulationMenu&&!this.accumulationMenu.isDestroyed&&this.accumulationMenu.destroy();for(var e=(this.parent.allowDrillThrough||this.parent.editSettings.allowEditing)&&this.parent.drillThroughModule?["expand","collapse","drillThrough","exit"]:["expand","collapse","exit"],t=[],i=0;i<e.length;i++)t.push({id:this.parent.element.id+"_DrillMenuChart_"+e[i],text:this.parent.localeObj.getConstant(e[i]),items:[]});for(var n=this.getMenuItems(),o=[],r=[],i=0;i<n.length;i++)"expand"===n[i].type?o.push({id:this.element.id+"drillExpand_"+n[i].key,text:n[i].value}):r.push({id:this.element.id+"drillCollapse_"+n[i].key,text:n[i].value});0<o.length&&(t[0].items=o),0<r.length&&(t[1].items=r);var s,a={cssClass:this.parent.element.id+"_accumulationChart"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:t,enableRtl:this.parent.enableRtl,beforeOpen:this.drillMenuOpen.bind(this),select:this.drillMenuSelect.bind(this),locale:this.parent.locale};this.accumulationMenu=new D4(a),ge("#"+this.parent.element.id+"_accumulationChart",this.parent.element)?(s=ge("#"+this.parent.element.id+"_accumulationChart",this.parent.element)).innerHTML="":(s=Q("ul",{id:this.parent.element.id+"_accumulationChart"}),this.parent.element.appendChild(s)),this.accumulationMenu.isStringTemplate=!0,this.accumulationMenu.appendTo(s)},Smt.prototype.drillMenuOpen=function(e){e.items[0]&&e.items[0].text===this.parent.localeObj.getConstant("expand")&&e.items[0].items&&0===e.items[0].items.length&&this.accumulationMenu.enableItems([this.parent.localeObj.getConstant("expand")],!1),e.items[1]&&e.items[1].text===this.parent.localeObj.getConstant("collapse")&&e.items[1].items&&0===e.items[1].items.length&&this.accumulationMenu.enableItems([this.parent.localeObj.getConstant("collapse")],!1)},Smt.prototype.getMenuItems=function(){for(var e=this.pivotIndex.rIndex,t=[],i=this.engineModule.pivotValues,n=[],o=i[e][this.pivotIndex.cIndex],r=!i[e][0].isNamedSet&&i[e][0].hasChild?i[e][0].level:void 0,s="olap"===this.parent.dataType?o.rowHeaders.toString().split(/~~|::/):o.rowHeaders.toString().split(this.engineModule.valueSortSettings.headerDelimiter);i[e][0];){var a,o=i[e][0];0!==s.length&&s.indexOf(o.formattedText.toString())===s.length-1&&(o.hasChild&&!o.isNamedSet&&n.indexOf(o.level)<0&&(r?r>=o.level:0!==r||0===o.level)&&(o.isDrilled&&o.hasChild?t.push({key:e,type:"collapse",value:o.formattedText}):t.push({key:e,type:"expand",value:o.formattedText}),n.push(o.level),r=r?r-1:o.level-1),a=s.indexOf(o.formattedText.toString()),s.splice(a,1)),0===o.level&&o.hasChild&&!o.isNamedSet&&(r=void 0,n=[]),e--}return t},Smt.prototype.drillMenuSelect=function(e){var t,i,n,o,r=("olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule).pivotValues,s=e.element.id.split("_DrillMenuChart_")[1];0===e.element.id.indexOf(this.element.id+"drill")?(t=0<=e.element.id.split(this.element.id+"drill")[1].indexOf("Expand")?"drillExpand":"drillCollapse",t=r[e=Number(e.element.id.split(this.element.id+t+"_")[1])][0],i="olap"===this.parent.dataType?t.formattedText:(t.actualText||t.formattedText).toString(),n=t.formattedText?t.formattedText.toString():i,n=t.hasChild&&!t.isNamedSet?(t.isDrilled?" - ":" + ")+n:n,o=(o="olap"===this.parent.dataType?this.engineModule.tupRowInfo[t.ordinal]:void 0)?o.uNameCollection:t.valueSort.levelName.toString(),o={fieldName:t.valueSort.axis,level:t.level,hasChild:t.hasChild,levelName:o,name:i,text:n,rowIndex:e,colIndex:0,isDrilled:t.isDrilled,cell:t},"olap"===this.parent.dataType?this.parent.onDrill(void 0,o):this.onDrill({customAttributes:o})):"drillThrough"===s?this.parent.drillThroughModule.executeDrillThrough(r[this.pivotIndex.rIndex][this.pivotIndex.cIndex],this.pivotIndex.rIndex,this.pivotIndex.rIndex):"exit"===s&&this.accumulationMenu.close()},Smt.prototype.getChartHeight=function(){var e,t,i;return je(this.parent.getHeightAsNumber())?e="auto":(t=this.parent.showToolbar?6:5,e=(this.parent.getHeightAsNumber()-t).toString(),t=this.parent.getHeightAsNumber()-t),je(this.parent.getHeightAsNumber())?e="auto":(i=!1,null!==this.parent.element.querySelector(".e-chart-grouping-bar")&&"none"===this.parent.element.querySelector(".e-chart-grouping-bar").style.display.toLowerCase()&&(i=!0,this.parent.element.querySelector(".e-chart-grouping-bar").style.display="block"),this.parent.showToolbar&&this.parent.showGroupingBar?e=(t-(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:42)-(this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:62)).toString():this.parent.showToolbar?e=(t-(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:42)).toString():this.parent.showGroupingBar?e=(t-(this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:62)).toString():(this.parent.chart&&parseInt(this.parent.chart.height,10)<200||t<200)&&(e="200"),i&&(this.parent.element.querySelector(".e-chart-grouping-bar").style.display="none")),e},Smt.prototype.getChartAutoHeight=function(){var e=this.parent.element.offsetHeight<this.parent.minHeight?this.parent.minHeight:this.parent.element.offsetHeight;return this.parent.showToolbar&&this.parent.showGroupingBar?e=e-(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:42)-(this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:62):this.parent.showToolbar?e-=this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:42:this.parent.showGroupingBar&&(e-=this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:62),e},Smt.prototype.axisLabelRender=function(e){var t,i;this.chartSettings.showMultiLevelLabels&&"Pareto"!==this.chartSettings.chartSeries.type&&"primaryXAxis"===e.axis.name&&(e.text=""),"primaryXAxis"!==e.axis.name&&"StackingColumn100"!==this.parent.chartSettings.chartSeries.type&&"StackingBar100"!==this.parent.chartSettings.chartSeries.type&&"StackingArea100"!==this.parent.chartSettings.chartSeries.type&&"StackingLine100"!==this.parent.chartSettings.chartSeries.type&&(i=this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.currentMeasure:"olap"===this.parent.dataType?this.measuresNames[e.axis.name]:e.axis.name,i=this.engineModule.formatFields[i]||null,t=this.engineModule.getFormattedValue(e.value,this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.currentMeasure:e.axis.name,e.text),i=i&&i.format&&this.chartSettings.useGroupingSeparator?"olap"===this.parent.dataType?t.toString():t.formattedText:e.value.toString(),e.text=i),this.parent.trigger(qpt,e)},Smt.prototype.multiLevelLabelClick=function(e){var t={axis:e.axis,text:e.text,cell:je(e.customAttributes)?void 0:e.customAttributes.cell,cancel:!1};this.parent.trigger(ypt,t),!t.cancel&&e.customAttributes&&e.customAttributes.hasChild&&!e.customAttributes.cell.isNamedSet&&("olap"===this.parent.dataType?this.parent.onDrill(void 0,e.customAttributes):this.onDrill(e))},Smt.prototype.onDrill=function(e){var e=e.customAttributes,t=this.dataSourceSettings.drilledMembers[0]&&this.dataSourceSettings.drilledMembers[0].delimiter?this.dataSourceSettings.drilledMembers[0].delimiter:"**",i=e.fieldName,n="Tabular"===this.parent.gridSettings.layout?!this.parent.dataSourceSettings.showSubTotals||!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?e.level:this.parent.engineModule.rowMaxLevel:e.colIndex,n=this.engineModule.pivotValues[e.rowIndex][n],o=n.valueSort.levelName.split(this.engineModule.valueSortSettings.headerDelimiter).join(t),r=!1;if(0===this.dataSourceSettings.drilledMembers.length)this.parent.setProperties({dataSourceSettings:{drilledMembers:[{name:i,items:[o],delimiter:t}]}},!0);else{for(var s=0;s<this.dataSourceSettings.drilledMembers.length;s++){var a,l=this.dataSourceSettings.drilledMembers[s],o=o.split(t).join(l.delimiter||t),t=l.delimiter=l.delimiter||t;l.name===i&&(r=!0,-1<(a=l.items.indexOf(o))?l.items.splice(a,1):l.items.push(o))}r||this.dataSourceSettings.drilledMembers.push({name:i,items:[o],delimiter:t})}this.parent.showWaitingPopup();var h=this,e={fieldName:i,memberName:o,delimiter:t,axis:"row",action:e.isDrilled?"up":"down",currentCell:n},n={drillInfo:e,pivotview:h.parent},n=(h.parent.trigger(dpt,n),{dataSourceSettings:Hdt.getClonedDataSourceSettings(this.parent.dataSourceSettings)}),n=(this.parent.trigger(Udt,n),this.parent.setProperties({dataSourceSettings:n.dataSourceSettings},!0),h.parent.enableVirtualization||h.parent.enablePaging?"Server"===h.parent.dataSourceSettings.mode?h.parent.getEngine("onDrill",e,null,null,null,null,null):(h.engineModule.drilledMembers=h.dataSourceSettings.drilledMembers,h.engineModule.onDrill(e)):"Server"===h.parent.dataSourceSettings.mode?h.parent.getEngine("onDrill",e,null,null,null,null,null):h.engineModule.generateGridData(h.dataSourceSettings,!0),h.parent.allowServerDataBinding=!1,h.parent.setProperties({pivotValues:h.engineModule.pivotValues},!0),h.parent.allowServerDataBinding=!0,{dataSourceSettings:Hdt.getClonedDataSourceSettings(this.parent.dataSourceSettings),pivotValues:this.parent.pivotValues});this.parent.trigger(qdt,n),h.engineModule.pivotValues=n.pivotValues,h.parent.renderPivotGrid()},Smt.prototype.isAttributeDrill=function(e,t){for(var i=!1,n=0;n<this.dataSourceSettings.drilledMembers.length;n++)if(this.dataSourceSettings.drilledMembers[n].name===e)for(var o=0;o<this.dataSourceSettings.drilledMembers[n].items.length;o++){for(var r=this.dataSourceSettings.drilledMembers[n].items[o].split(this.dataSourceSettings.drilledMembers[n].delimiter),s="",a=0;a<r.length;a++)t[a]&&t[a].uName&&(s=s+(""===s?"":this.dataSourceSettings.drilledMembers[n].delimiter)+(-1<t[a].uName.indexOf("[Measures]")?"[Measures]":t[a].uName));if(s===this.dataSourceSettings.drilledMembers[n].items[o]){i=!0;break}}return i},Smt.prototype.load=function(e){e.chart.zoomModule&&(e.chart.zoomModule.isZoomed=!0),this.parent.trigger("chartLoad",e)},Smt.prototype.beforePrint=function(e){this.parent.trigger(kpt,e)},Smt.prototype.animationComplete=function(e){this.parent.trigger(Ppt,e)},Smt.prototype.legendRender=function(e){this.parent.trigger(Bpt,e)},Smt.prototype.textRender=function(e){this.parent.trigger(Fpt,e)},Smt.prototype.pointRender=function(e){this.parent.trigger(Lpt,e)},Smt.prototype.seriesRender=function(e){this.parent.trigger(Rpt,e)},Smt.prototype.chartMouseMove=function(e){this.parent.trigger(Opt,e)},Smt.prototype.chartMouseClick=function(e){this.parent.trigger(Npt,e)},Smt.prototype.pointMove=function(e){this.parent.trigger("pointMove",e)},Smt.prototype.chartMouseLeave=function(e){this.parent.trigger(Vpt,e)},Smt.prototype.chartMouseDown=function(e){this.parent.trigger(_pt,e)},Smt.prototype.chartMouseUp=function(e){this.parent.trigger(Hpt,e)},Smt.prototype.dragComplete=function(e){this.parent.trigger(zpt,e)},Smt.prototype.zoomComplete=function(e){this.parent.trigger(jpt,e)},Smt.prototype.scrollStart=function(e){this.parent.trigger(Wpt,e)},Smt.prototype.scrollEnd=function(e){this.parent.trigger("scrollEnd",e)},Smt.prototype.scrollChanged=function(e){this.parent.trigger(Qpt,e)},Smt.prototype.multiLevelLabelRender=function(e){this.parent.trigger(Mpt,e)},Smt.prototype.resized=function(e){this.accumulationType.indexOf(this.chartSettings.chartSeries.type)<0&&(e.chart.primaryXAxis.zoomFactor=je(this.parent.chartSettings.primaryXAxis.zoomFactor)?this.getZoomFactor():this.parent.chartSettings.primaryXAxis.zoomFactor,this.parent.chartSettings.zoomSettings.enableScrollbar||(e.chart.primaryXAxis.zoomFactor=je(this.parent.chartSettings.primaryXAxis.zoomFactor)?1:this.parent.chartSettings.primaryXAxis.zoomFactor)),this.parent.trigger(Upt,e)},Smt.prototype.isMemberDrilled=function(e,t){for(var i=!1,n=0;n<this.parent.dataSourceSettings.drilledMembers.length;n++)for(var o=this.parent.dataSourceSettings.drilledMembers[n].items,r=0;r<o.length;r++){var s=o[r].split(this.parent.dataSourceSettings.drilledMembers[n].delimiter);if(s[s.length-1]===e.formattedText.split(" ")[0]&&s[0]===t[0]){i=!0;break}}return i},Smt.prototype.getResizedChartHeight=function(){return(["Pie","Funnel","Pyramid","Doughnut","Radar","Polar","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)<0&&this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&0<this.parent.dataSourceSettings.values.length?Number(this.parent.chart.height)>235*this.parent.dataSourceSettings.values.length+100?isNaN(Number(this.getChartHeight()))?this.getChartHeight():Number(this.getChartHeight())-5:!isNaN(Number(this.getChartHeight()))||1<this.parent.dataSourceSettings.values.length?235*this.parent.dataSourceSettings.values.length+100:this.getChartHeight():this.getChartHeight()).toString()},Smt.prototype.destroy=function(){this.parent&&this.parent.isDestroyed||(this.engineModule&&!this.parent.destroyEngine&&(this.engineModule.fieldList={},this.engineModule={}),this.chartSeries&&(this.chartSeries=null),this.columnGroupObject&&(this.columnGroupObject=null),this.chartSeriesInfo&&(this.chartSeriesInfo={},this.selectedLegend=null),this.chartSettings&&(this.chartSettings=null),this.dataSourceSettings&&(this.dataSourceSettings=null),this.accumulationMenu&&!this.accumulationMenu.isDestroyed&&(this.accumulationMenu.destroy(),this.accumulationMenu=null),this.parent&&this.parent.chart&&!this.parent.chart.isDestroyed&&(this.parent.chart.destroy(),this.parent.chart=null))};var Cmt=Smt;function Smt(e){this.headerColl={},this.maxLevel=0,this.columnGroupObject={},this.selectedLegend=0,this.chartSeriesInfo={},this.measurePos=-1,this.measuresNames={},this.accumulationType=["Pie","Pyramid","Doughnut","Funnel"],this.isChartInitial=!0,this.parent=e}var Amt,xmt,Z$e={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},Wo={size:"14px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},Met={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},Cet={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},N$e={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},ts={size:"12px",fontWeight:"Regular",color:"#353535",fontStyle:"Normal",fontFamily:"Segoe UI"},i0=(Amt=function(e,t){return(Amt=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])}))(e,t)},function(e,t){function i(){this.constructor=e}Amt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},tn=(i0(Imt,xmt=n),o([e(!0)],Imt.prototype,"enable",void 0),o([e(1e3)],Imt.prototype,"duration",void 0),o([e(0)],Imt.prototype,"delay",void 0),Imt);function Imt(){return null!==xmt&&xmt.apply(this,arguments)||this}i0(Emt,Tmt=n),o([e(null)],Emt.prototype,"value",void 0),o([e(null)],Emt.prototype,"color",void 0),o([e("0")],Emt.prototype,"dashArray",void 0);var Tmt,est=Emt;function Emt(){return null!==Tmt&&Tmt.apply(this,arguments)||this}i0(Mmt,Dmt=n),o([e("Normal")],Mmt.prototype,"fontStyle",void 0),o([e("16px")],Mmt.prototype,"size",void 0),o([e("Normal")],Mmt.prototype,"fontWeight",void 0),o([e("")],Mmt.prototype,"color",void 0),o([e("Center")],Mmt.prototype,"textAlignment",void 0),o([e("Segoe UI")],Mmt.prototype,"fontFamily",void 0),o([e(1)],Mmt.prototype,"opacity",void 0),o([e("Trim")],Mmt.prototype,"textOverflow",void 0);var Dmt,ist=Mmt;function Mmt(){return null!==Dmt&&Dmt.apply(this,arguments)||this}i0(Pmt,kmt=n),o([e(10)],Pmt.prototype,"left",void 0),o([e(10)],Pmt.prototype,"right",void 0),o([e(10)],Pmt.prototype,"top",void 0),o([e(10)],Pmt.prototype,"bottom",void 0);var kmt,d$=Pmt;function Pmt(){return null!==kmt&&kmt.apply(this,arguments)||this}i0(Fmt,Bmt=n),o([e("")],Fmt.prototype,"color",void 0),o([e(1)],Fmt.prototype,"width",void 0);var Bmt,X$e=Fmt;function Fmt(){return null!==Bmt&&Bmt.apply(this,arguments)||this}i0(Omt,Lmt=n),o([e(0)],Omt.prototype,"x",void 0),o([e(0)],Omt.prototype,"y",void 0);var Lmt,Rmt=Omt;function Omt(){return null!==Lmt&&Lmt.apply(this,arguments)||this}i0(_mt,Nmt=n),o([e(0)],_mt.prototype,"series",void 0),o([e(0)],_mt.prototype,"point",void 0);var Nmt,Vmt=_mt;function _mt(){return null!==Nmt&&Nmt.apply(this,arguments)||this}i0(jmt,Hmt=n),o([t({},X$e)],jmt.prototype,"border",void 0),o([e("transparent")],jmt.prototype,"background",void 0),o([e(1)],jmt.prototype,"opacity",void 0),o([e(null)],jmt.prototype,"backgroundImage",void 0);var Hmt,zmt=jmt;function jmt(){return null!==Hmt&&Hmt.apply(this,arguments)||this}i0(Umt,Wmt=n),o([e(!1)],Umt.prototype,"enable",void 0),o([e("")],Umt.prototype,"dashArray",void 0),o([t({color:null,width:1},X$e)],Umt.prototype,"line",void 0),o([e("Both")],Umt.prototype,"lineType",void 0);var Wmt,Qmt=Umt;function Umt(){return null!==Wmt&&Wmt.apply(this,arguments)||this}i0(Ymt,qmt=n),o([e(!1)],Ymt.prototype,"visible",void 0),o([e(null)],Ymt.prototype,"name",void 0),o([e("transparent")],Ymt.prototype,"fill",void 0),o([e(1)],Ymt.prototype,"opacity",void 0),o([e(0)],Ymt.prototype,"angle",void 0),o([e(!1)],Ymt.prototype,"enableRotation",void 0),o([e("Auto")],Ymt.prototype,"position",void 0),o([e(5)],Ymt.prototype,"rx",void 0),o([e(5)],Ymt.prototype,"ry",void 0),o([e("Center")],Ymt.prototype,"alignment",void 0),o([t({width:null,color:null},X$e)],Ymt.prototype,"border",void 0),o([t({left:5,right:5,top:5,bottom:5},d$)],Ymt.prototype,"margin",void 0),o([t({size:"11px",color:"",fontStyle:"Normal",fontWeight:"Normal",fontFamily:"Segoe UI"},ist)],Ymt.prototype,"font",void 0),o([e(null)],Ymt.prototype,"template",void 0);var qmt,Gmt=Ymt;function Ymt(){return null!==qmt&&qmt.apply(this,arguments)||this}i0(Jmt,Xmt=n),o([e("Line")],Jmt.prototype,"type",void 0),o([e(null)],Jmt.prototype,"color",void 0),o([e(1)],Jmt.prototype,"width",void 0),o([e(null)],Jmt.prototype,"length",void 0),o([e("")],Jmt.prototype,"dashArray",void 0);var Xmt,Kmt=Jmt;function Jmt(){return null!==Xmt&&Xmt.apply(this,arguments)||this}i0($mt,Zmt=n),o([e(!0)],$mt.prototype,"visible",void 0),o([t({width:null,color:null},X$e)],$mt.prototype,"border",void 0),o([t({size:"11px",color:"",fontStyle:"Normal",fontWeight:"Normal",fontFamily:"Segoe UI"},ist)],$mt.prototype,"font",void 0),o([e("transparent")],$mt.prototype,"fill",void 0),o([e(0)],$mt.prototype,"angle",void 0),o([e(!1)],$mt.prototype,"enableRotation",void 0),o([e("Outside")],$mt.prototype,"position",void 0),o([e(5)],$mt.prototype,"rx",void 0),o([e(5)],$mt.prototype,"ry",void 0),o([e(null)],$mt.prototype,"template",void 0),o([t({},Kmt)],$mt.prototype,"connectorStyle",void 0);var Zmt,Kmt=$mt;function $mt(){return null!==Zmt&&Zmt.apply(this,arguments)||this}i0(tft,eft=n),o([e(!1)],tft.prototype,"visible",void 0),o([e("Circle")],tft.prototype,"shape",void 0),o([e("")],tft.prototype,"imageUrl",void 0),o([e(5)],tft.prototype,"width",void 0),o([e(5)],tft.prototype,"height",void 0),o([t({width:2,color:null},X$e)],tft.prototype,"border",void 0),o([t({x:0,y:0},Rmt)],tft.prototype,"offset",void 0),o([e(null)],tft.prototype,"fill",void 0),o([e(1)],tft.prototype,"opacity",void 0),o([t({},Gmt)],tft.prototype,"dataLabel",void 0);var eft,Rmt=tft;function tft(){return null!==eft&&eft.apply(this,arguments)||this}i0(oft,ift=n),o([e(1)],oft.prototype,"width",void 0),o([e(10)],oft.prototype,"length",void 0),o([e(null)],oft.prototype,"color",void 0),o([e(1)],oft.prototype,"opacity",void 0);var ift,nft=oft;function oft(){return null!==ift&&ift.apply(this,arguments)||this}i0(aft,rft=n),o([e(!1)],aft.prototype,"visible",void 0),o([e("Fixed")],aft.prototype,"type",void 0),o([e("Both")],aft.prototype,"direction",void 0),o([e("Vertical")],aft.prototype,"mode",void 0),o([e(1)],aft.prototype,"verticalError",void 0),o([e(null)],aft.prototype,"color",void 0),o([e(1)],aft.prototype,"width",void 0),o([e(1)],aft.prototype,"horizontalError",void 0),o([e(3)],aft.prototype,"verticalNegativeError",void 0),o([e(3)],aft.prototype,"verticalPositiveError",void 0),o([e(1)],aft.prototype,"horizontalNegativeError",void 0),o([e(1)],aft.prototype,"horizontalPositiveError",void 0),o([t(null,nft)],aft.prototype,"errorBarCap",void 0);var rft,sft=aft;function aft(){return null!==rft&&rft.apply(this,arguments)||this}i0(dft,lft=n),o([e("")],dft.prototype,"name",void 0),o([e("0")],dft.prototype,"dashArray",void 0),o([e(!0)],dft.prototype,"visible",void 0),o([e(2)],dft.prototype,"period",void 0),o([e("Linear")],dft.prototype,"type",void 0),o([e(0)],dft.prototype,"backwardForecast",void 0),o([e(0)],dft.prototype,"forwardForecast",void 0),o([e(2)],dft.prototype,"polynomialOrder",void 0),o([t({},Rmt)],dft.prototype,"marker",void 0),o([e(!0)],dft.prototype,"enableTooltip",void 0),o([t({},tn)],dft.prototype,"animation",void 0),o([e("")],dft.prototype,"fill",void 0),o([e(1)],dft.prototype,"width",void 0),o([e(null)],dft.prototype,"intercept",void 0),o([e("SeriesType")],dft.prototype,"legendShape",void 0);var lft,hft=dft;function dft(){return null!==lft&&lft.apply(this,arguments)||this}i0(uft,pft=n),o([e(null)],uft.prototype,"fill",void 0),o([t({color:"transparent",width:0},X$e)],uft.prototype,"border",void 0),o([e("Zero")],uft.prototype,"mode",void 0);var pft,cft=uft;function uft(){return null!==pft&&pft.apply(this,arguments)||this}i0(fft,gft=n),o([e(0)],fft.prototype,"topLeft",void 0),o([e(0)],fft.prototype,"topRight",void 0),o([e(0)],fft.prototype,"bottomLeft",void 0),o([e(0)],fft.prototype,"bottomRight",void 0);var gft,mft=fft;function fft(){return null!==gft&&gft.apply(this,arguments)||this}i0(bft,yft=n),o([e(!1)],bft.prototype,"enable",void 0),o([e(null)],bft.prototype,"fill",void 0),o([t(Met,ist)],bft.prototype,"textStyle",void 0);var yft,vft=bft;function bft(){return null!==yft&&yft.apply(this,arguments)||this}i0(Sft,wft=n),o([e(!0)],Sft.prototype,"visible",void 0),o([e(!1)],Sft.prototype,"startFromAxis",void 0),o([e(null)],Sft.prototype,"start",void 0),o([e(null)],Sft.prototype,"end",void 0),o([e(null)],Sft.prototype,"size",void 0),o([e("#808080")],Sft.prototype,"color",void 0),o([e(null)],Sft.prototype,"dashArray",void 0),o([e("Auto")],Sft.prototype,"sizeType",void 0),o([e(!1)],Sft.prototype,"isRepeat",void 0),o([e(null)],Sft.prototype,"repeatEvery",void 0),o([e(null)],Sft.prototype,"repeatUntil",void 0),o([e(!1)],Sft.prototype,"isSegmented",void 0),o([e(null)],Sft.prototype,"segmentStart",void 0),o([e(null)],Sft.prototype,"segmentEnd",void 0),o([e(null)],Sft.prototype,"segmentAxisName",void 0),o([t({color:"transparent",width:1},X$e)],Sft.prototype,"border",void 0),o([e("")],Sft.prototype,"text",void 0),o([e(null)],Sft.prototype,"rotation",void 0),o([e("Middle")],Sft.prototype,"horizontalAlignment",void 0),o([e("Middle")],Sft.prototype,"verticalAlignment",void 0),o([t(ts,ist)],Sft.prototype,"textStyle",void 0),o([e("Behind")],Sft.prototype,"zIndex",void 0),o([e(1)],Sft.prototype,"opacity",void 0);var wft,Cft=Sft;function Sft(){return null!==wft&&wft.apply(this,arguments)||this}i0(xft,Aft=n),o([e("")],xft.prototype,"color",void 0),o([e(1)],xft.prototype,"width",void 0),o([e("Rectangle")],xft.prototype,"type",void 0);var Aft,d=xft;function xft(){return null!==Aft&&Aft.apply(this,arguments)||this}i0(Eft,Ift=n),o([e(1)],Eft.prototype,"width",void 0),o([e("")],Eft.prototype,"dashArray",void 0),o([e(null)],Eft.prototype,"color",void 0);var Ift,Tft=Eft;function Eft(){return null!==Ift&&Ift.apply(this,arguments)||this}i0(kft,Dft=n),o([e(.7)],kft.prototype,"width",void 0),o([e("")],kft.prototype,"dashArray",void 0),o([e(null)],kft.prototype,"color",void 0);var Dft,Mft=kft;function kft(){return null!==Dft&&Dft.apply(this,arguments)||this}i0(Fft,Pft=n),o([e(1)],Fft.prototype,"width",void 0),o([e("")],Fft.prototype,"dashArray",void 0),o([e(null)],Fft.prototype,"color",void 0);var Pft,Bft=Fft;function Fft(){return null!==Pft&&Pft.apply(this,arguments)||this}i0(Oft,Lft=n),o([e(1)],Oft.prototype,"width",void 0),o([e(5)],Oft.prototype,"height",void 0),o([e(null)],Oft.prototype,"color",void 0);var Lft,Rft=Oft;function Oft(){return null!==Lft&&Lft.apply(this,arguments)||this}i0(_ft,Nft=n),o([e(.7)],_ft.prototype,"width",void 0),o([e(5)],_ft.prototype,"height",void 0),o([e(null)],_ft.prototype,"color",void 0);var Nft,Vft=_ft;function _ft(){return null!==Nft&&Nft.apply(this,arguments)||this}i0(jft,Hft=n),o([e(0)],jft.prototype,"x",void 0),o([e(0)],jft.prototype,"y",void 0);var Hft,zft=jft;function jft(){return null!==Hft&&Hft.apply(this,arguments)||this}o([e("")],Wft.prototype,"color",void 0),o([e(1)],Wft.prototype,"width",void 0);function Wft(){}o([e(!0)],Qft.prototype,"enable",void 0),o([e(1e3)],Qft.prototype,"duration",void 0),o([e(0)],Qft.prototype,"delay",void 0);function Qft(){}o([e(null)],Uft.prototype,"value",void 0),o([e(null)],Uft.prototype,"color",void 0),o([e("0")],Uft.prototype,"dashArray",void 0);function Uft(){}o([e(!1)],qft.prototype,"visible",void 0),o([e("Circle")],qft.prototype,"shape",void 0),o([e("")],qft.prototype,"imageUrl",void 0),o([e(5)],qft.prototype,"height",void 0),o([e(5)],qft.prototype,"width",void 0),o([t({width:2,color:null},X$e)],qft.prototype,"border",void 0),o([e(null)],qft.prototype,"fill",void 0),o([e(1)],qft.prototype,"opacity",void 0),o([t({},Gmt)],qft.prototype,"dataLabel",void 0);function qft(){}o([e(!1)],Gft.prototype,"visible",void 0),o([e("Fixed")],Gft.prototype,"type",void 0),o([e("Both")],Gft.prototype,"direction",void 0),o([e("Vertical")],Gft.prototype,"mode",void 0),o([e(null)],Gft.prototype,"color",void 0),o([e(1)],Gft.prototype,"verticalError",void 0),o([e(1)],Gft.prototype,"width",void 0),o([e(1)],Gft.prototype,"horizontalError",void 0),o([e(3)],Gft.prototype,"verticalPositiveError",void 0),o([e(3)],Gft.prototype,"verticalNegativeError",void 0),o([e(1)],Gft.prototype,"horizontalPositiveError",void 0),o([e(1)],Gft.prototype,"horizontalNegativeError",void 0),o([t(null,nft)],Gft.prototype,"errorBarCap",void 0);function Gft(){}o([e("")],Yft.prototype,"name",void 0),o([e("Linear")],Yft.prototype,"type",void 0),o([e(2)],Yft.prototype,"period",void 0),o([e(2)],Yft.prototype,"polynomialOrder",void 0),o([e(0)],Yft.prototype,"backwardForecast",void 0),o([e(0)],Yft.prototype,"forwardForecast",void 0),o([t({},tn)],Yft.prototype,"animation",void 0),o([t({},Rmt)],Yft.prototype,"marker",void 0),o([e(!0)],Yft.prototype,"enableTooltip",void 0),o([e(null)],Yft.prototype,"intercept",void 0),o([e("")],Yft.prototype,"fill",void 0),o([e(1)],Yft.prototype,"width",void 0),o([e("SeriesType")],Yft.prototype,"legendShape",void 0);function Yft(){}o([e(null)],Xft.prototype,"fill",void 0),o([t({color:"transparent",width:0},X$e)],Xft.prototype,"border",void 0),o([e("Zero")],Xft.prototype,"mode",void 0);function Xft(){}o([e(0)],Kft.prototype,"topLeft",void 0),o([e(0)],Kft.prototype,"topRight",void 0),o([e(0)],Kft.prototype,"bottomLeft",void 0),o([e(0)],Kft.prototype,"bottomRight",void 0);function Kft(){}o([e("Normal")],Jft.prototype,"fontStyle",void 0),o([e("16px")],Jft.prototype,"size",void 0),o([e("Normal")],Jft.prototype,"fontWeight",void 0),o([e("")],Jft.prototype,"color",void 0),o([e("Center")],Jft.prototype,"textAlignment",void 0),o([e("Segoe UI")],Jft.prototype,"fontFamily",void 0),o([e(1)],Jft.prototype,"opacity",void 0),o([e("Trim")],Jft.prototype,"textOverflow",void 0);function Jft(){}o([e(!1)],Zft.prototype,"enable",void 0),o([e(null)],Zft.prototype,"fill",void 0),o([t(Met,ist)],Zft.prototype,"textStyle",void 0);function Zft(){}o([e(1)],$ft.prototype,"width",void 0),o([e(5)],$ft.prototype,"height",void 0),o([e(null)],$ft.prototype,"color",void 0);function $ft(){}o([e(1)],eyt.prototype,"width",void 0),o([e("")],eyt.prototype,"dashArray",void 0),o([e(null)],eyt.prototype,"color",void 0);function eyt(){}o([e(.7)],tyt.prototype,"width",void 0),o([e(5)],tyt.prototype,"height",void 0),o([e(null)],tyt.prototype,"color",void 0);function tyt(){}o([e(.7)],iyt.prototype,"width",void 0),o([e("")],iyt.prototype,"dashArray",void 0),o([e(null)],iyt.prototype,"color",void 0);function iyt(){}o([e(1)],nyt.prototype,"width",void 0),o([e("")],nyt.prototype,"dashArray",void 0),o([e(null)],nyt.prototype,"color",void 0);function nyt(){}o([e(!0)],oyt.prototype,"visible",void 0),o([e(!1)],oyt.prototype,"startFromAxis",void 0),o([e(null)],oyt.prototype,"start",void 0),o([e(null)],oyt.prototype,"end",void 0),o([e(null)],oyt.prototype,"size",void 0),o([e("#808080")],oyt.prototype,"color",void 0),o([e(null)],oyt.prototype,"dashArray",void 0),o([e("Auto")],oyt.prototype,"sizeType",void 0),o([e(!1)],oyt.prototype,"isRepeat",void 0),o([e(null)],oyt.prototype,"repeatEvery",void 0),o([e(null)],oyt.prototype,"repeatUntil",void 0),o([e(!1)],oyt.prototype,"isSegmented",void 0),o([e(null)],oyt.prototype,"segmentStart",void 0),o([e(null)],oyt.prototype,"segmentEnd",void 0),o([e(null)],oyt.prototype,"segmentAxisName",void 0),o([t({color:"transparent",width:1},X$e)],oyt.prototype,"border",void 0),o([e("")],oyt.prototype,"text",void 0),o([e(null)],oyt.prototype,"rotation",void 0),o([e("Middle")],oyt.prototype,"horizontalAlignment",void 0),o([e("Middle")],oyt.prototype,"verticalAlignment",void 0),o([t(ts,ist)],oyt.prototype,"textStyle",void 0),o([e("Behind")],oyt.prototype,"zIndex",void 0),o([e(1)],oyt.prototype,"opacity",void 0);function oyt(){}o([e("")],ryt.prototype,"color",void 0),o([e(1)],ryt.prototype,"width",void 0),o([e("Rectangle")],ryt.prototype,"type",void 0);function ryt(){}o([t({},X$e)],syt.prototype,"border",void 0),o([e("transparent")],syt.prototype,"background",void 0),o([e(1)],syt.prototype,"opacity",void 0);function syt(){}o([e(!1)],ayt.prototype,"enable",void 0),o([e("")],ayt.prototype,"dashArray",void 0),o([t({color:null,width:1},X$e)],ayt.prototype,"line",void 0),o([e("Both")],ayt.prototype,"lineType",void 0);function ayt(){}o([e(!0)],lyt.prototype,"visible",void 0),o([e(null)],lyt.prototype,"height",void 0),o([e(null)],lyt.prototype,"width",void 0),o([t({x:0,y:0},zft)],lyt.prototype,"location",void 0),o([e("Auto")],lyt.prototype,"position",void 0),o([e(8)],lyt.prototype,"padding",void 0),o([e("Center")],lyt.prototype,"alignment",void 0),o([t(N$e,ist)],lyt.prototype,"textStyle",void 0),o([e(10)],lyt.prototype,"shapeHeight",void 0),o([e(10)],lyt.prototype,"shapeWidth",void 0),o([t({},X$e)],lyt.prototype,"border",void 0),o([t({left:0,right:0,top:0,bottom:0},d$)],lyt.prototype,"margin",void 0),o([e(5)],lyt.prototype,"shapePadding",void 0),o([e("transparent")],lyt.prototype,"background",void 0),o([e(1)],lyt.prototype,"opacity",void 0),o([e(!0)],lyt.prototype,"toggleVisibility",void 0),o([e(null)],lyt.prototype,"description",void 0),o([e(3)],lyt.prototype,"tabIndex",void 0);function lyt(){}o([e(0)],hyt.prototype,"series",void 0),o([e(0)],hyt.prototype,"point",void 0);function hyt(){}o([e(10)],dyt.prototype,"left",void 0),o([e(10)],dyt.prototype,"right",void 0),o([e(10)],dyt.prototype,"top",void 0),o([e(10)],dyt.prototype,"bottom",void 0);function dyt(){}i0(cyt,pyt=n),o([e(null)],cyt.prototype,"fill",void 0),o([e(null)],cyt.prototype,"endAngle",void 0),o([e(!1)],cyt.prototype,"explode",void 0),o([e(!1)],cyt.prototype,"explodeAll",void 0),o([e(null)],cyt.prototype,"explodeIndex",void 0),o([e(null)],cyt.prototype,"innerRadius",void 0),o([e("30%")],cyt.prototype,"explodeOffset",void 0),o([e(0)],cyt.prototype,"gapRatio",void 0),o([e("Value")],cyt.prototype,"groupMode",void 0),o([e(null)],cyt.prototype,"groupTo",void 0),o([e("20%")],cyt.prototype,"neckHeight",void 0),o([e("20%")],cyt.prototype,"neckWidth",void 0),o([e("Linear")],cyt.prototype,"pyramidMode",void 0),o([e([])],cyt.prototype,"palettes",void 0),o([e(0)],cyt.prototype,"startAngle",void 0),o([t(null,tn)],cyt.prototype,"animation",void 0),o([t(null,Kmt)],cyt.prototype,"dataLabel",void 0),o([e("0")],cyt.prototype,"dashArray",void 0),o([e(1)],cyt.prototype,"width",void 0),o([e("X")],cyt.prototype,"segmentAxis",void 0),o([e("Line")],cyt.prototype,"drawType",void 0),o([e(!0)],cyt.prototype,"isClosed",void 0),o([kt([],est)],cyt.prototype,"segments",void 0),o([e("")],cyt.prototype,"stackingGroup",void 0),o([t({color:"transparent",width:0},X$e)],cyt.prototype,"border",void 0),o([e(!0)],cyt.prototype,"visible",void 0),o([e(1)],cyt.prototype,"opacity",void 0),o([e("Line")],cyt.prototype,"type",void 0),o([t(null,Rmt)],cyt.prototype,"marker",void 0),o([t(null,sft)],cyt.prototype,"errorBar",void 0),o([e(!0)],cyt.prototype,"enableTooltip",void 0),o([kt([],hft)],cyt.prototype,"trendlines",void 0),o([e("")],cyt.prototype,"tooltipMappingName",void 0),o([e("SeriesType")],cyt.prototype,"legendShape",void 0),o([e(1)],cyt.prototype,"minRadius",void 0),o([e(null)],cyt.prototype,"selectionStyle",void 0),o([e("Natural")],cyt.prototype,"splineType",void 0),o([e(3)],cyt.prototype,"maxRadius",void 0),o([e(.5)],cyt.prototype,"cardinalSplineTension",void 0),o([e(null)],cyt.prototype,"columnWidth",void 0),o([t(null,cft)],cyt.prototype,"emptyPointSettings",void 0),o([t(null,mft)],cyt.prototype,"cornerRadius",void 0),o([e(0)],cyt.prototype,"columnSpacing",void 0);var pyt,Gmt=cyt;function cyt(){return null!==pyt&&pyt.apply(this,arguments)||this}i0(gyt,uyt=n),o([e("Rotate45")],gyt.prototype,"labelIntersectAction",void 0),o([t(Z$e,ist)],gyt.prototype,"labelStyle",void 0),o([e("")],gyt.prototype,"title",void 0),o([e(null)],gyt.prototype,"zoomFactor",void 0),o([t({},vft)],gyt.prototype,"crosshairTooltip",void 0),o([e("")],gyt.prototype,"labelFormat",void 0),o([t(Wo,ist)],gyt.prototype,"titleStyle",void 0),o([e(!1)],gyt.prototype,"isIndexed",void 0),o([e(0)],gyt.prototype,"plotOffset",void 0),o([e("Shift")],gyt.prototype,"edgeLabelPlacement",void 0),o([e("BetweenTicks")],gyt.prototype,"labelPlacement",void 0),o([e("Outside")],gyt.prototype,"tickPosition",void 0),o([e(!1)],gyt.prototype,"opposedPosition",void 0),o([e(!0)],gyt.prototype,"visible",void 0),o([e("Outside")],gyt.prototype,"labelPosition",void 0),o([e(0)],gyt.prototype,"labelRotation",void 0),o([e(0)],gyt.prototype,"minorTicksPerInterval",void 0),o([e(null)],gyt.prototype,"maximum",void 0),o([e(null)],gyt.prototype,"minimum",void 0),o([e(34)],gyt.prototype,"maximumLabelWidth",void 0),o([e(null)],gyt.prototype,"interval",void 0),o([t({},Rft)],gyt.prototype,"majorTickLines",void 0),o([e(!1)],gyt.prototype,"enableTrim",void 0),o([t({},Tft)],gyt.prototype,"majorGridLines",void 0),o([t({},Vft)],gyt.prototype,"minorTickLines",void 0),o([t({},Bft)],gyt.prototype,"lineStyle",void 0),o([t({},Mft)],gyt.prototype,"minorGridLines",void 0),o([e(!1)],gyt.prototype,"isInversed",void 0),o([e(null)],gyt.prototype,"description",void 0),o([e(0)],gyt.prototype,"startAngle",void 0),o([e(100)],gyt.prototype,"coefficient",void 0),o([kt([],Cft)],gyt.prototype,"stripLines",void 0),o([e(2)],gyt.prototype,"tabIndex",void 0),o([t({color:null,width:0,type:"Rectangle"},d)],gyt.prototype,"border",void 0);var uyt,nft=gyt;function gyt(){return null!==uyt&&uyt.apply(this,arguments)||this}i0(fyt,myt=n),o([e(!1)],fyt.prototype,"enableMarker",void 0),o([e(!0)],fyt.prototype,"enable",void 0),o([e(null)],fyt.prototype,"fill",void 0),o([e(!1)],fyt.prototype,"shared",void 0),o([e(.75)],fyt.prototype,"opacity",void 0),o([e(null)],fyt.prototype,"header",void 0),o([e(null)],fyt.prototype,"format",void 0),o([t(Cet,ist)],fyt.prototype,"textStyle",void 0),o([e(null)],fyt.prototype,"template",void 0),o([t({color:"#cccccc",width:.5},X$e)],fyt.prototype,"border",void 0),o([e(!0)],fyt.prototype,"enableAnimation",void 0);var myt,zft=fyt;function fyt(){return null!==myt&&myt.apply(this,arguments)||this}i0(vyt,yyt=n),o([e("50%")],vyt.prototype,"x",void 0),o([e("50%")],vyt.prototype,"y",void 0);var yyt,tn=vyt;function vyt(){return null!==yyt&&yyt.apply(this,arguments)||this}i0(wyt,byt=n),o([e(!1)],wyt.prototype,"enablePinchZooming",void 0),o([e(!0)],wyt.prototype,"enableSelectionZooming",void 0),o([e(!1)],wyt.prototype,"enableDeferredZooming",void 0),o([e(!1)],wyt.prototype,"enableMouseWheelZooming",void 0),o([e("XY")],wyt.prototype,"mode",void 0),o([e(["Zoom","ZoomIn","ZoomOut","Pan","Reset"])],wyt.prototype,"toolbarItems",void 0),o([e(!0)],wyt.prototype,"enableScrollbar",void 0),o([e(!1)],wyt.prototype,"enablePan",void 0);var byt,Kmt=wyt;function wyt(){return null!==byt&&byt.apply(this,arguments)||this}i0(Syt,Cyt=n),o([t({},Gmt)],Syt.prototype,"chartSeries",void 0),o([t({},nft)],Syt.prototype,"primaryXAxis",void 0),o([t({},nft)],Syt.prototype,"primaryYAxis",void 0),o([e("")],Syt.prototype,"value",void 0),o([e("")],Syt.prototype,"columnHeader",void 0),o([e("-")],Syt.prototype,"columnDelimiter",void 0),o([e(!1)],Syt.prototype,"enableMultipleAxis",void 0),o([e("Stacked")],Syt.prototype,"multipleAxisMode",void 0),o([e(!1)],Syt.prototype,"enableScrollOnMultiAxis",void 0),o([e(!1)],Syt.prototype,"showMemberSeries",void 0),o([e(!1)],Syt.prototype,"showPointColorByMembers",void 0),o([t({border:{color:null,width:.5},background:"transparent"},pme)],Syt.prototype,"titleStyle",void 0),o([e("")],Syt.prototype,"title",void 0),o([t({border:{color:null,width:.5},background:"transparent"},pme)],Syt.prototype,"subTitleStyle",void 0),o([e("")],Syt.prototype,"subTitle",void 0),o([t({color:"#DDDDDD",width:0},X$e)],Syt.prototype,"border",void 0),o([t({},d$)],Syt.prototype,"margin",void 0),o([t({border:{color:null,width:.5},background:"transparent"},zmt)],Syt.prototype,"chartArea",void 0),o([e(null)],Syt.prototype,"background",void 0),o([e("Material")],Syt.prototype,"theme",void 0),o([e([])],Syt.prototype,"palettes",void 0),o([t({},Qmt)],Syt.prototype,"crosshair",void 0),o([t({},zft)],Syt.prototype,"tooltip",void 0),o([t(null,tn)],Syt.prototype,"pieCenter",void 0),o([t({},Kmt)],Syt.prototype,"zoomSettings",void 0),o([e()],Syt.prototype,"legendSettings",void 0),o([e("None")],Syt.prototype,"selectionMode",void 0),o([e("None")],Syt.prototype,"accumulationSelectionMode",void 0),o([e(!0)],Syt.prototype,"enableSmartLabels",void 0),o([e(!0)],Syt.prototype,"enableBorderOnMouseMove",void 0),o([e("None")],Syt.prototype,"highlightMode",void 0),o([e("None")],Syt.prototype,"highlightPattern",void 0),o([e(!0)],Syt.prototype,"enableExport",void 0),o([e(!1)],Syt.prototype,"isMultiSelect",void 0),o([kt([],Vmt)],Syt.prototype,"selectedDataIndexes",void 0),o([e(!0)],Syt.prototype,"enableAnimation",void 0),o([e(!1)],Syt.prototype,"enableCanvas",void 0),o([e(!0)],Syt.prototype,"useGroupingSeparator",void 0),o([e(!1)],Syt.prototype,"isTransposed",void 0),o([e(1)],Syt.prototype,"tabIndex",void 0),o([e(null)],Syt.prototype,"description",void 0),o([i()],Syt.prototype,"resized",void 0),o([e(!0)],Syt.prototype,"enableSideBySidePlacement",void 0),o([i()],Syt.prototype,"loaded",void 0),o([i()],Syt.prototype,"beforePrint",void 0),o([i()],Syt.prototype,"animationComplete",void 0),o([i()],Syt.prototype,"load",void 0),o([i()],Syt.prototype,"textRender",void 0),o([i()],Syt.prototype,"legendRender",void 0),o([i()],Syt.prototype,"seriesRender",void 0),o([i()],Syt.prototype,"multiLevelLabelRender",void 0),o([i()],Syt.prototype,"pointRender",void 0),o([i()],Syt.prototype,"tooltipRender",void 0),o([i()],Syt.prototype,"legendClick",void 0),o([i()],Syt.prototype,"axisLabelRender",void 0),o([i()],Syt.prototype,"multiLevelLabelClick",void 0),o([i()],Syt.prototype,"chartMouseClick",void 0),o([i()],Syt.prototype,"chartMouseMove",void 0),o([i()],Syt.prototype,"pointMove",void 0),o([i()],Syt.prototype,"pointClick",void 0),o([i()],Syt.prototype,"chartMouseDown",void 0),o([i()],Syt.prototype,"chartMouseLeave",void 0),o([i()],Syt.prototype,"dragComplete",void 0),o([i()],Syt.prototype,"chartMouseUp",void 0),o([i()],Syt.prototype,"scrollStart",void 0),o([i()],Syt.prototype,"zoomComplete",void 0),o([i()],Syt.prototype,"scrollChanged",void 0),o([i()],Syt.prototype,"scrollEnd",void 0),o([e(!0)],Syt.prototype,"showMultiLevelLabels",void 0);var Cyt,est=Syt;function Syt(){return null!==Cyt&&Cyt.apply(this,arguments)||this}xyt.getCellSets=function(e,t,i,n,o){this.engine=t,this.isMondrian=t.isMondrian,this.isMeasureAvail=t.isMeasureAvail,this.isPaging=t.isPaging,this.pageSettings=t.pageSettings,this.rows=t.rows,this.columns=t.columns,this.values=t.values,this.filters=t.filters,this.allowLabelFilter=t.allowLabelFilter,this.allowValueFilter=t.allowValueFilter,this.drilledMembers=t.updateDrilledItems(e.drilledMembers),this.calculatedFieldSettings=t.calculatedFieldSettings,this.valueAxis="row"===e.valueAxis?"rows":"columns",n&&(n.axis="row"===n.axis?"rows":"columns"),this.filterMembers=Pe({},t.filterMembers,null,!0),this.fieldDataObj=t.fieldListObj,this.fieldList=t.fieldList,this.cellSetInfo="\nDIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE";var r=this.getMeasuresQuery(this.values),s=this.getDimensionsQuery(this.rows,r,"rows",n).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;"),r=this.getDimensionsQuery(this.columns,r,"columns",n).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;"),a=(this.isPaging&&i&&void 0!==this.pageSettings?(s=(a=this.getPagingQuery(s,r)).rowQuery,r=a.columnQuery):this.isPaging&&!i&&void 0!==this.pageSettings&&(s=(a=this.getPagingCountQuery(s,r)).rowQuery,r=a.columnQuery),s=0<s.length?s+(this.isPaging&&!i?"":this.cellSetInfo+" ON ROWS"):"",r=0<r.length?r+(this.isPaging&&!i?"":this.cellSetInfo+" ON COLUMNS"):"",this.getSlicersQuery(this.filters,"filters").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;")),l=this.getfilterQuery(this.filterMembers,e.cube).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;"),h=this.getCalculatedFieldQuery(this.calculatedFieldSettings).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;"),s=this.frameMDXQuery(s,r,a,l,h,i),r={catalog:e.catalog,cube:e.cube,url:e.url,request:s,LCID:e.localeIdentifier.toString(),roles:e.roles};t.mdxQuery=s.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/%280/g,'"').replace(/&apos;/g,"'"),n&&(n.axis="rows"===n.axis?"row":"column"),o||this.getTableCellData(r,(this.isPaging&&!i?this.engine.generatePagingData:this.engine.generateEngine).bind(this.engine),n?{action:n.action,drillInfo:n}:{dataSourceSettings:e,action:"loadTableElements"})},xyt.getTableCellData=function(e,t,i){var n=this.engine.getConnectionInfo(e.url,e.LCID),e='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Header></Header> <Body> <Execute xmlns="urn:schemas-microsoft-com:xml-analysis"> <Command> <Statement>'+e.request+"</Statement> </Command> <Properties> <PropertyList> <Catalog>"+e.catalog+"</Catalog> <LocaleIdentifier>"+n.LCID+"</LocaleIdentifier>"+(e.roles?"<Roles>"+e.roles+"</Roles>":"")+"</PropertyList> </Properties></Execute> </Body> </Envelope>";if(this.engine.doAjaxPost("POST",n.url,e,t,i),this.engine.errorInfo)throw this.engine.errorInfo},xyt.frameMDXQuery=function(e,t,i,n,o,r){var s=this.isPaging&&!r?""!==o?"":"\nWITH":"\nSelect ";return 0<t.length&&(s+=t),s=o+(s=0<e.length?s+(!(0<t.length)||this.isPaging&&!r?"":", ")+e:s)+(this.isPaging&&!r?"\nMEMBER [Measures].[3d268ce0-664d-4092-b9cb-fece97175006] AS Count([e16a30d0-2174-4874-8dae-a5085a75a3e2]) MEMBER [Measures].[8d7fe8c1-f09f-410e-b9ba-eaab75a1fc3e] AS Count ([d1876d2b-e50e-4547-85fe-5b8ed9d629de])\nSELECT { [Measures].[3d268ce0-664d-4092-b9cb-fece97175006] , [Measures].[8d7fe8c1-f09f-410e-b9ba-eaab75a1fc3e] } ON AXIS(0)":"")+" "+n+i+"\nCELL PROPERTIES VALUE, FORMAT_STRING, FORMATTED_VALUE\n"},xyt.getPagingQuery=function(e,t){e=e.replace("NON EMPTY ( ","").slice(0,-1),t=t.replace("NON EMPTY ( ","").slice(0,-1);var i=e,n=(this.pageSettings.currentRowPage-1)*this.pageSettings.rowPageSize,o=(this.pageSettings.currentColumnPage-1)*this.pageSettings.columnPageSize,r=this.engine.isExporting&&this.engine.exportSpeciedPages&&this.engine.exportSpeciedPages.rowSize?this.engine.exportSpeciedPages.rowSize:3*this.pageSettings.rowPageSize,s=this.engine.isExporting&&this.engine.exportSpeciedPages&&this.engine.exportSpeciedPages.columnSize?this.engine.exportSpeciedPages.columnSize:3*this.pageSettings.columnPageSize,n=this.engine.rowCount<n+r?this.engine.rowCount>r?this.engine.rowCount-r:0:n;return this.engine.pageRowStartPos=n,o=this.engine.columnCount<o+s?this.engine.columnCount>s?this.engine.columnCount-s:0:o,this.engine.pageColStartPos=o,{rowQuery:""!==e?"\nSUBSET ({ "+(this.isMondrian?"":"NONEMPTY")+" ("+e+(this.isMondrian||""===t?"":","+t)+")},"+n+","+r+")":"",columnQuery:""!==t?"\nSUBSET ({ "+(this.isMondrian?"":"NONEMPTY")+" ("+t+(this.isMondrian||""===i?"":","+i)+")},"+o+","+s+")":""}},xyt.getPagingCountQuery=function(e,t){e=e.replace("NON EMPTY ( ","").slice(0,-1),t=t.replace("NON EMPTY ( ","").slice(0,-1);var i=e;return{rowQuery:""!==e?"SET [d1876d2b-e50e-4547-85fe-5b8ed9d629de] as "+(this.isMondrian?"":"NONEMPTY")+" ("+e+(this.isMondrian||""===t?"":","+t)+")\n":"",columnQuery:""!==t?"\nSET [e16a30d0-2174-4874-8dae-a5085a75a3e2] as "+(this.isMondrian?"":"NONEMPTY")+" ("+t+(this.isMondrian||""===i?"":","+i)+")\n":""}},xyt.getDimensionsQuery=function(e,t,i,n){var o="";if(0<e.length){for(var o="\nNON EMPTY ( "+(0<this.drilledMembers.length?"HIERARCHIZE ({":""),r=0;r<e.length;)0===r?"[measures]"===e[r].name.toLowerCase()?""!==t&&(o+=t):o+="({"+this.getDimensionQuery(e[r],i)+"})":"[measures]"===e[r].name.toLowerCase()?""!==t&&(o=o+" * "+t):o=o+" * "+("({"+this.getDimensionQuery(e[r],i)+"})"),r++;var s=this.getDrillQuery(e,t,i,n),s=(o=n&&n.axis===i?"\nNON EMPTY ( "+(0<this.drilledMembers.length?"HIERARCHIZE ({":"")+s.query:o+(""!==s.query?",":"")+s.query,this.getAttributeDrillQuery(e,t,i,n));o=o+(this.isPaging?(""!==s?"-":"")+s:"")+(0<this.drilledMembers.length?"})":"")+(this.isPaging?"":(""!==s?"-":"")+s)+")"}return o},xyt.getAttributeDrillQuery=function(e,t,i,n){for(var o="",r=[],r=n&&n.axis===i&&"down"===n.action.toLowerCase()?[{name:n.fieldName,items:[n.memberName],delimiter:"~~"}]:this.drilledMembers,s=i===this.valueAxis?this.getMeasurePos(i):0,a=0,l=r;a<l.length;a++){var h=l[a];if(!!this.engine.fieldList[h.name]&&this.engine.fieldList[h.name].isHierarchy)for(var d=0,p=h.items;d<p.length;d++){for(var c=p[d],u=[],g=c.split(h.delimiter||"~~"),m=this.getDrillLevel(e,g),f=this.getDimensionPos(i,h.name),y=e.length-(f<s?1:0),v=!!this.isPaging&&this.isAttributeMemberExist(h.name,c.split(h.delimiter||"~~"),h.delimiter,g,i);0<m.level&&m.isDrill&&f+1!==s&&!v;){for(var b=[],w=0;w<e.length;){if("[measures]"===e[w].name.toLowerCase())""!==t&&b.push(g[w]?"({{"+g[w]+"}})":"("+t+")");else if(g[w]&&(-1!==g[w].indexOf(e[w].name)||e[w].isNamedSet&&this.fieldList[e[w].name]&&-1!==g[w].indexOf(this.fieldList[e[w].name].pid.split("Sets_")[1])))b.push(this.getHierarchyQuery(g[w],!1,!1,!1,m.level,!0));else{if(g[w]||!e[w]){b=[];break}b.push(this.getHierarchyQuery(e[w].name,!!(this.isPaging&&2===m.level||!this.isPaging&&w<y),e[w].isNamedSet,e[w].isCalculatedField,m.level,!1))}w++}0<b.length&&u.push("("+b.join("*")+")"),m.level--,y--}0<u.length&&(o=o+(""!==o?"-":"")+u.join(this.isPaging?"+":"-"))}}return o},xyt.getDimensionPos=function(e,t){for(var i=0,n="rows"===e?this.rows:this.columns,o=0;o<n.length;o++)if(n[o].name===t){i=o;break}return i},xyt.getMeasurePos=function(e){for(var t=0,i="rows"===e?this.rows:this.columns,n=0;n<i.length;n++)if(0===i[n].name.indexOf("[Measures]")){t=n;break}return t},xyt.getDrillLevel=function(e,t){for(var i=e.length,n=!1,o=0;o<e.length;)t[o]&&-1!==t[o].indexOf(e[o].name)?(--i,e[o+1]&&!(e[o+1].isNamedSet||0===e[o+1].name.indexOf("[Measures]")||this.fieldList[e[o+1].name]&&!this.fieldList[e[o+1].name].hasAllMember)&&(n=!0)):(e[o].isNamedSet||0===e[o].name.indexOf("[Measures]")||this.fieldList[e[o].name]&&!this.fieldList[e[o].name].hasAllMember)&&--i,o++;return{level:this.isPaging?2:i,isDrill:n}},xyt.getHierarchyQuery=function(e,t,i,n,o,r){return e=n?this.fieldList[e].tag:e,!this.fieldList[e]||this.fieldList[e].hasAllMember||i||n?i||n?"({"+e+"})":this.isPaging?"({"+e+(t?".CHILDREN})":r||1!==o?"})":".[All]})"):"({DrilldownLevel({"+e+(t?".CHILDREN":"")+"},,,INCLUDE_CALC_MEMBERS)})":"(("+e+").levels(0).AllMembers)"},xyt.isAttributeMemberExist=function(e,t,i,n,o){t.splice(n.length-1,1);var r=!1;if(""!==t.join(i)&&(!this.isPaging||1!==t.length||"[Measures]"!==t.join(i))&&this.engine.fieldList[e]&&this.engine.fieldList[e].hasAllMember)for(var s=this.getDimensionPos(o,e),a=0;a<this.drilledMembers.length;a++)if(e!==this.drilledMembers[a].name)if(!!this.engine.fieldList[this.drilledMembers[a].name]&&this.engine.fieldList[this.drilledMembers[a].name].isHierarchy)for(var l=this.getDimensionPos(o,this.drilledMembers[a].name),h=0;h<this.drilledMembers[a].items.length;h++){var d=this.getDrillLevel("rows"===o?this.rows:this.columns,this.drilledMembers[a].items[h].split(this.drilledMembers[a].delimiter||"~~"));if((!this.isPaging||l<s&&d.isDrill)&&(0===this.drilledMembers[a].items[h].indexOf(t.join(i))||0===t.join(i).indexOf(this.drilledMembers[a].items[h]))){r=!0;break}}return r},xyt.getDrillQuery=function(e,t,i,n){for(var o="",r=[],s=!1,a="",l=0,h=n&&n.axis===i&&"down"===n.action.toLowerCase()?(s=!0,[{name:n.fieldName,items:[n.memberName],delimiter:"~~"}]):this.drilledMembers;l<h.length;l++){var d=h[l];if(!(!!this.engine.fieldList[d.name]&&this.engine.fieldList[d.name].isHierarchy))for(var p=0,c=d.items;p<c.length;p++){for(var u,g=c[p],m=[],f=[],y=0,v=g.split(d.delimiter||"~~"),b=this.isAttributeMemberExist(d.name,g.split(d.delimiter||"~~"),d.delimiter||"~~",v,i);y<e.length&&!b;){if(v[y]&&-1!==v[y].indexOf(e[y].name))-1!==v[v.length-1].indexOf(e[y].name)?s?a=a+(""!==a?" * ":"")+"({"+v[y]+".CHILDREN})":(m.push("("+v[y]+".CHILDREN)"),f.push("("+v[y]+")")):"[measures]"===v[y].toLowerCase()&&""!==t?s?a=a+(""!==a?" * ":"")+"("+t+")":(m.push("("+t+")"),f.push("("+t+")")):-1!==v[y].toLowerCase().indexOf("[measures]")?s?a=a+(""!==a?" * ":"")+"({"+v[y]+"})":(m.push("({"+v[y]+"})"),f.push("({"+v[y]+"})")):s?a=a+(""!==a?" * ":"")+"({"+v[y]+"})":(m.push("("+v[y]+")"),f.push("("+v[y]+")"));else{if(v[y]||!e[y]){m=[];break}"[measures]"===e[y].name.toLowerCase()&&""!==t?s?a=a+(""!==a?" * ":"")+"("+t+")":(m.push("("+t+")"),f.push("("+t+")")):(u=this.getDimensionQuery(e[y],i),s?a=a+(""!==a?" * ":"")+"({"+u+"})":(m.push("("+u+")"),f.push("("+u+")")))}y++}0<m.length&&m.length<v.length&&(m=[],f=[]),o=o+(""!==o&&0<m.length?",":"")+(0<m.length?"("+m.toString()+")":""),0<f.length&&r.push("("+f.toString()+")")}}return{query:s?a:o,collection:s?[a]:r}},xyt.getSlicersQuery=function(i,e){var n=this,t="",o=(o=Pe([],this.rows,null,!0)).concat(this.columns);if(0<i.length){for(var r=0;r<i.length;)0<o.filter(function(e){var e=n.getDimensionUniqueName(e.name),t=n.getDimensionUniqueName(i[r].name);return e===t&&!(n.isMondrian&&""===t&&""===e)}).length||(void 0===i[r].name||this.filterMembers[i[r].name]?this.filterMembers[i[r].name]&&(t=t+(""!==t?" * ":"")+"{"+this.filterMembers[i[r].name].toString()+"}"):t=t+(""!==t?" * ":"")+"{"+this.getDimensionQuery(i[r],e)+"}"),r++;t=""===t?"":"\nWHERE ("+t.replace(/DrilldownLevel/g,"")+")"}return t},xyt.getDimensionQuery=function(e,t){var i=e.isCalculatedField?this.fieldList[e.name].tag:e.name;return this.fieldList[e.name]&&this.fieldList[e.name].hasAllMember||e.isNamedSet||e.isCalculatedField?e.isNamedSet||e.isCalculatedField?"{"+i+"}":this.isPaging?i+".CHILDREN":"DrilldownLevel({"+i+"}"+("rows"===t||"columns"===t?",,,INCLUDE_CALC_MEMBERS":"")+")":"(("+i+").levels(0).AllMembers)"},xyt.getDimensionUniqueName=function(e){var t=this.fieldDataObj.hierarchy,i=[];if(t){for(var n=0,o=t;n<o.length;n++){var r=o[n];r.id.toLowerCase()===e.toLowerCase()&&i.push(r)}return 0<i.length?i[0].pid:""}return e.split(".")[0]},xyt.getMeasuresQuery=function(e){var t="";if(0<e.length){for(var t="{{",i="",n=0,o=e;n<o.length;n++)var r=o[n],r=r.isCalculatedField?this.fieldList[r.name].tag:r.name,i=0<i.length?i+", "+r:r;t=t+i+"}}"}return t},xyt.getfilterQuery=function(e,t){for(var t="\nFROM ["+t+"]",i="\nFROM( SELECT (",n=[],o=[],r=[],s=[],a=0,l=this.rows;a<l.length;a++)e[(g=l[a]).name]&&0<e[g.name].length&&("string"==typeof e[g.name][0]?r.push(e[g.name]):(e[g.name][1]=e[g.name][0].type,n.push(e[g.name]),delete e[g.name]));for(var h,d=0,p=this.columns;d<p.length;d++)e[(g=p[d]).name]&&0<e[g.name].length&&("string"==typeof e[g.name][0]?s.push(e[g.name]):((h=e[g.name])[1]=h[0].type,n.push(e[g.name]),delete e[g.name]));for(var c=0,u=this.filters;c<u.length;c++){for(var g=u[c],m=!1,f=0,y=this.columns;f<y.length;f++){var v=y[f];m||this.getDimensionUniqueName(v.name)!==this.getDimensionUniqueName(g.name)||e[g.name]&&(s.push(e[g.name]),m=!0)}if(!m)for(var b=0,w=this.rows;b<w.length;b++){var C=w[b];m||this.getDimensionUniqueName(C.name)!==this.getDimensionUniqueName(g.name)||e[g.name]&&(r.push(e[g.name]),m=!0)}}if((this.allowLabelFilter||this.allowValueFilter)&&0<n.length)for(var S=0,A=["Value","Label"];S<A.length;S++)for(var x=A[S],I=0,T=n;I<T.length;I++){var E=T[I];E&&2===E.length&&"string"==typeof E[1]&&E[1]===x&&o.push(this.getAdvancedFilterQuery(E[0],i,"COLUMNS"))}for(var D=0,M=s.length;D<M;D++)i=0===D?i+"{"+s[D].toString()+"}":i+",{"+s[D].toString()+"}";0<s.length&&(i=0<r.length?i+" ) ON COLUMNS ,(":i+" ) ON COLUMNS");for(D=0,M=r.length;D<M;D++)i=0<D?i+",{"+r[D].toString()+"}":i+"{"+r[D].toString()+"}";var i=0<s.length&&0<r.length?i+") ON ROWS ":0===s.length&&0<r.length?i+") ON COLUMNS ":i,k="";return 0<(k=0<o.length?o.join(" ")+" "+(0<s.length||0<r.length?i:"")+" "+t+Array(o.length+1+(0<s.length||0<r.length?1:0)).join(")"):k).length?k:0===s.length&&0===r.length?t:i+t+")"},xyt.getAdvancedFilterQuery=function(e,t,i){return"\nFROM (SELECT Filter("+e.selectedField+".AllMembers, "+this.getAdvancedFilterCondtions(e.name,e.condition,e.value1,e.value2,e.type,e.measure)+")) on "+i},xyt.getAdvancedFilterCondtions=function(e,t,i,n,o,r){var s="";switch(t){case"Equals":s="("+("Value"!==o?e+'.CurrentMember.member_caption ="'+i+'"':r+" = "+i);break;case"DoesNotEquals":s="("+("Value"!==o?e+'.CurrentMember.member_caption <>"'+i+'"':r+" <>"+i);break;case"Contains":s="( InStr (1,"+e+'.CurrentMember.member_caption,"'+i+'") >0';break;case"DoesNotContains":s="( InStr (1,"+e+'.CurrentMember.member_caption,"'+i+'")=0';break;case"BeginWith":s="( Left ("+e+".CurrentMember.member_caption,"+i.length+')="'+i+'"';break;case"DoesNotBeginWith":s="( Left ("+e+".CurrentMember.member_caption,"+i.length+') <>"'+i+'"';break;case"EndsWith":s="( Right ("+e+".CurrentMember.member_caption,"+i.length+')="'+i+'"';break;case"DoesNotEndsWith":s="( Right ("+e+".CurrentMember.member_caption,"+i.length+') <>"'+i+'"';break;case"GreaterThan":s="("+("Value"!==o?e+'.CurrentMember.member_caption >"'+i+'"':r+" >"+i);break;case"GreaterThanOrEqualTo":s="("+("Value"!==o?e+'.CurrentMember.member_caption >="'+i+'"':r+" >="+i);break;case"LessThan":s="("+("Value"!==o?e+'.CurrentMember.member_caption <"'+i+'"':r+" <"+i);break;case"LessThanOrEqualTo":s="("+("Value"!==o?e+'.CurrentMember.member_caption <="'+i+'"':r+" <="+i);break;case"Between":s="("+("Value"!==o?e+'.CurrentMember.member_caption >="'+i+'"AND '+e+'.CurrentMember.member_caption <="'+n+'"':r+" >="+i+" AND "+r+" <="+n);break;case"NotBetween":s="("+("Value"!==o?e+'.CurrentMember.member_caption >="'+i+'"OR '+e+'.CurrentMember.member_caption <="'+n+'"':r+" >="+i+" OR "+r+" <="+n);break;default:s="( InStr (1,"+e+'.CurrentMember.member_caption,"'+i+'") >0'}return s},xyt.getCalculatedFieldQuery=function(e){var t="";if(0<e.length)for(var t="\nWITH",i=0,n=e;i<n.length;i++){var o=n[i],r=(-1<o.formula.indexOf("Measure")?"[Measures].":o.hierarchyUniqueName+".")+"["+o.name+"]",s=je(o.formatString)?null:o.formatString;t+="\nMEMBER "+r+"as ("+o.formula+") "+(je(s)?"":', FORMAT_STRING ="'+s.trim()+'"')}return t};var Ayt=xyt;function xyt(){}Tyt.prototype.renderEngine=function(e,t,i){this.isEmptyData=!1,this.getHeaderSortInfo=i,this.mdxQuery="",this.isMeasureAvail=!1,this.allowMemberFilter=!1,this.allowLabelFilter=!1,this.allowValueFilter=!1,this.isMondrian=!1,this.aggregatedValueMatrix=[],this.measureReportItems=[],this.calcChildMembers=[],this.selectedItems=[],this.savedFieldList=void 0,this.savedFieldListData=void 0,this.formatFields={},this.filterMembers={},this.dataFields={},this.valueAxis="",this.columnCount=0,this.rowCount=0,this.colFirstLvl=0,this.rowFirstLvl=0,this.pageColStartPos=0,this.sortObject={},this.globalize=new Ti,this.locale=this.globalize.culture||"en-US",this.localeObj=t?t.localeObj:void 0,this.enableValueSorting=!!t&&t.enableValueSorting,e.url&&(this.dataSourceSettings=e,this.measureIndex=je(e.valueIndex)?-1:e.valueIndex,this.valueAxis="row"===e.valueAxis?"row":"column",this.getAxisFields(),this.formats=e.formatSettings||[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.valueSortSettings=e.valueSortSettings||void 0,this.filterSettings=e.filterSettings||[],this.sortSettings=e.sortSettings||[],this.allowMemberFilter=!!e.allowMemberFilter,this.allowLabelFilter=!!e.allowLabelFilter,this.allowValueFilter=!!e.allowValueFilter,this.drilledMembers=e.drilledMembers?this.updateDrilledItems(e.drilledMembers):[],this.calculatedFieldSettings=e.calculatedFieldSettings||[],this.emptyCellTextContent=e.emptyCellsTextContent||"",this.pageSettings=t?t.pageSettings||this.pageSettings:void 0,this.isPaging=!(!this.pageSettings||!t.enablePaging&&!t.enableVirtualization),this.frameSortObject(),this.getFormattedFields(this.formats),this.savedFieldList=t?t.savedFieldList:void 0,this.savedFieldListData=t?t.savedFieldListData:void 0,this.fieldListData=[],this.fieldListObj={},this.setNamedSetsPosition(),this.savedFieldList&&0<Object.keys(this.savedFieldList).length&&this.savedFieldListData?this.updateFieldlist(!0):(this.getCubes(e),this.getFieldList(e)),this.loadCalculatedMemberElements(this.calculatedFieldSettings),i=this.getMeasureInfo(),this.olapVirtualization=this.isPaging&&e.showSubTotals&&i.measureIndex===("column"===i.measureAxis?e.columns.length-1:e.rows.length-1)&&!je(this.pageSettings)&&e.showGrandTotals,this.isPaging=this.isPaging&&!this.olapVirtualization,this.measureReportItems=[],this.updateFilterItems(this.filterSettings),this.generateGridData(e))},Tyt.prototype.generateGridData=function(e,t){t=!(!t||"navPaging"!==t||!this.isPaging||void 0===this.pageSettings);0<this.rows.length||0<this.columns.length||0<this.values.length||0<this.filters.length?Ayt.getCellSets(e,this,t):(Ayt.getCellSets(e,this,!0,void 0,!0),this.generateEngine(void 0,void 0,{dataSourceSettings:e,action:"loadTableElements"}))},Tyt.prototype.generatePagingData=function(e,t,i){e=[].slice.call(e.querySelectorAll("Axes, CellData")),e=e[1]?e[1].querySelectorAll("FmtValue"):null,e&&0<e.length&&(this.columnCount=Number(e[0].textContent),this.rowCount=Number(e[1].textContent)),e=i.dataSourceSettings;Ayt.getCellSets(e,this,!0)},Tyt.prototype.scrollPage=function(){var e;this.olapVirtualization?((e=this.getVirtualScrollingData(this.clonedColumnTuple,this.clonedRowTuple)).isCalculated&&(this.pivotValues=[],this.clearEngineProperties(),this.performEngine(e.columnTuple,e.rowTuple,e.valueTuple)),this.pivotValues=this.pivotValues.slice()):Ayt.getCellSets(this.dataSourceSettings,this,!0)},Tyt.prototype.getVirtualScrollingData=function(e,t){var i,n,o,r,s,a,l,h,d,p,c,u=this.clonedValTuple.slice(),g=!1,m=(this.pageSettings.currentColumnPage-1)*this.pageSettings.columnPageSize,f=(this.pageSettings.currentRowPage-1)*this.pageSettings.rowPageSize,y=3*this.pageSettings.columnPageSize,v=3*this.pageSettings.rowPageSize,m=this.columnCount<m+y?this.columnCount>y?this.columnCount-y:0:m,f=this.rowCount<f+v?this.rowCount>v?this.rowCount-v:0:f;return m===this.pageColStartPos&&f===this.pageRowStartPos&&e.length<=y&&t.length<=v||(g=!0,r=this.getMeasureInfo(),l=!je(e[0])&&0===Number(e[0].querySelectorAll("Member")[0].querySelector("LNum").textContent),i=!je(t[0])&&0===Number(t[0].querySelectorAll("Member")[0].querySelector("LNum").textContent),a=l&&m+y>=e.length-1,n=i&&f+v>=t.length-1,o=l?this.getAxisdepth(e):"column"===r.measureAxis?r.valueInfo.length:1,r=i?this.getAxisdepth(t):"row"===r.measureAxis?r.valueInfo.length:1,h=(i?r:0)+f,d=e.slice(l=(l?o:0)+m,l+y),p=t.slice(h,h+v),s=d[0]?Number(d[0].querySelectorAll("Member")[0].querySelector("LNum").textContent):0,c=p[0]?Number(p[0].querySelectorAll("Member")[0].querySelector("LNum").textContent):0,s=this.getVirtualTotals(e.slice(0,l),s,a,"column",o),a=this.getVirtualTotals(t.slice(0,h),c,n,"row",r),l=d.length+s.totalsCollection.length>y?Math.max(d.length+s.totalsCollection.length-y):0,h=p.length+a.totalsCollection.length>v?Math.max(p.length+a.totalsCollection.length-v):0,d=s.totalsCollection.concat(d.slice(l,d.length)),p=a.totalsCollection.concat(p.slice(h,p.length)),c=this.getVirtualValues(u,m+l,f+h,y,v,s.indexCollection,a.indexCollection,e.length,t.length,o,r,i),e=d.slice(),t=p.slice(),u=c.slice()),this.pageColStartPos=m,this.pageRowStartPos=f,{columnTuple:e,rowTuple:t,valueTuple:u,isCalculated:g}},Tyt.prototype.getAxisdepth=function(e){for(var t=0,i=0;i<e.length&&0===Number(e[i].querySelectorAll("Member")[0].querySelector("LNum").textContent);i++)t++;return t},Tyt.prototype.getVirtualTotals=function(e,t,i,n,o){var r=[],s=[];if(1!==t)for(var a=e.length-1;0<a;a--){var l=Number(e[a].querySelectorAll("Member")[0].querySelector("LNum").textContent);if(0===l)break;if(l<t)if(t=l,Number(e[a-1].querySelectorAll("Member")[0].querySelector("LNum").textContent)===l){for(var h=0;h<o;h++)r[r.length]=e[a-h],s[s.length]=a-h;a=1<o?a-(o-1):a}else r[r.length]=e[a],s[s.length]=a;else if(1===l)break}if(i)for(a=o;0<a;a--)r=r.concat([e[a-1]]),s=s.concat([a-1]);return{totalsCollection:r.reverse(),indexCollection:s.reverse()}},Tyt.prototype.getVirtualValues=function(e,t,i,n,o,r,s,a,l,h,d,p){var c=[],u=e;if(o<l){for(var l=((p?d:0)+i)*a,u=e.slice(l,l+o*a),g=[],m=0;m<s.length;m++)g=g.concat(e.slice(s[m]*a,s[m]*a+a));u=g.concat(u)}for(var m=0,f=u.length/a;m<f;m++){for(var y=u.slice(m*a,m*a+a),v=y.slice(t+h,t+h+n),b=[],w=0;w<r.length;w++)b[b.length]=y[r[w]];c=c.concat(b.concat(v))}return c},Tyt.prototype.generateEngine=function(e,t,i){"down"!==i.action&&this.clearEngineProperties(),this.xmlDoc=e?e.cloneNode(!0):void 0,this.request=t,this.customArgs=i,this.parentObjCollection={},this.curDrillEndPos=-1,this.onDemandDrillEngine=[],this.getSubTotalsVisibility(),this.xmlaCellSet=e?e.querySelectorAll("Axes, CellData"):void 0;var t=this.xmlaCellSet&&0<this.xmlaCellSet.length?[].slice.call(this.xmlaCellSet[0].querySelectorAll('Axis[name|="Axis0"] Tuple')):[],i=this.xmlaCellSet&&0<this.xmlaCellSet.length?[].slice.call(this.xmlaCellSet[0].querySelectorAll('Axis[name|="Axis1"] Tuple')):[],n=this.xmlaCellSet&&1<this.xmlaCellSet.length?[].slice.call(this.xmlaCellSet[1].querySelectorAll("Cell")):[];if(this.olapVirtualization&&!je(this.pageSettings)){if(t.length*i.length!==n.length){for(var o=[],r=0;r<n.length;r++)je(n[r])||(o[Number(n[r].getAttribute("CellOrdinal"))]=n[r]);n=o}this.clonedValTuple=n;var e=this.getDrillInfo("columns"),s=this.getActualTuples(t,e),e=this.getDrillInfo("rows"),e=this.getActualTuples(i,e,s.indexColls,t.length),s=(this.clonedColumnTuple=s.tupColls,this.clonedRowTuple=e.tupColls,this.columnCount=this.clonedColumnTuple.length,this.rowCount=this.clonedRowTuple.length,this.getVirtualScrollingData(this.clonedColumnTuple,this.clonedRowTuple));this.performEngine(s.columnTuple,s.rowTuple,s.valueTuple)}else this.performEngine(t,i,n)},Tyt.prototype.getDrillInfo=function(e){var t={},i=[];if("columns"===e?i=this.dataSourceSettings.columns.map(function(e){return e.name}):"rows"===e&&(i=this.dataSourceSettings.rows.map(function(e){return e.name})),0<i.length)for(var n=0,o=this.drilledMembers.length;n<o;n++){var r=this.drilledMembers[n],s=i.indexOf(r.name);-1<s&&(t[s]||(t[s]=[]),t[s]=t[s].concat(r.items))}return t},Tyt.prototype.getActualTuples=function(c,u,g,m){var t,f=[],y=[],v=[];if(0<c.length)for(var b=this,e=0,i=c.length;e<i;e++)!function(e){for(var t,i=c[e],n=!0,o=!1,r=!1,s=i.getElementsByTagName("MEMBER_TYPE"),a=i.getElementsByTagName("UName"),l=0,h=s.length;l<h;l++){var d=Number(s[l].textContent),p=a[l].textContent;if(r&&d<2?n=!1:2===d?o=!0:o&&d<2&&(n=!1),u[l]&&-1<u[l].indexOf(p)&&(r=!0),!n)break}n&&(f[f.length]=i,g?(t=b.clonedValTuple.slice(e*m,e*m+m),v=v.concat(g.map(function(e){return t[e]}))):y[y.length]=e)}(e);else g&&(t=this.clonedValTuple.slice(0,m),v=v.concat(g.map(function(e){return t[e]})));return 0<v.length&&(this.clonedValTuple=v),{tupColls:f,indexColls:y}},Tyt.prototype.clearEngineProperties=function(){this.pivotValues=[],this.valueContent=[],this.headerContent=[],this.colDepth=0,this.tupColumnInfo=[],this.tupRowInfo=[],this.colMeasures={},this.colMeasurePos=void 0,this.rowMeasurePos=void 0,this.rowStartPos=-1},Tyt.prototype.performEngine=function(e,t,i){this.totalCollection=[];for(var n,o,r,s=this.getMeasureInfo(),a=(0<this.drilledMembers.length&&(o=void 0,n=e.length&&t.length?e.length*t.length:e.length||t.length,e=(o=this.frameMeasureOrder(s,"column",e,i,e.length,n)).orderedHeaderTuples,i=o.orderedValueTuples,t=(o=this.frameMeasureOrder(s,"row",t,i,e.length,n)).orderedHeaderTuples,i=o.orderedValueTuples),"down"===this.customArgs.action&&this.updateTupCollection(("row"===this.customArgs.drillInfo.axis?t:e).length),{}),l=0;l<i.length;l++)je(i[l])||(a[this.olapVirtualization?l:Number(i[l].getAttribute("CellOrdinal"))]=i[l]);if(this.valueSortSettings.columnIndex=void 0,this.enableValueSorting&&this.valueSortSettings&&!this.isPaging&&!this.olapVirtualization&&(r=this.getValueSortInfo(e,t,s)),"down"===this.customArgs.action&&"column"!==this.customArgs.drillInfo.axis||(this.frameColumnHeader(e),this.isPaging)||this.olapVirtualization||this.performColumnSorting(a,r),"down"===this.customArgs.action&&"row"!==this.customArgs.drillInfo.axis||(this.frameRowHeader(t),this.isPaging)||this.olapVirtualization||this.performRowSorting(a,r),this.frameValues(a,e.length),this.performColumnSpanning(),!this.isPaging&&!this.olapVirtualization&&this.enableSort)for(var h=0;h<this.headerContent.length;h++)this.headerContent[h]=this.pivotValues[h];this.isEngineUpdated=!0,this.isEmptyData=0===e.length},Tyt.prototype.getValueSortInfo=function(e,t,i){if(this.valueSortSettings.headerText){for(var n,o,r=this.valueSortSettings.headerText.split(this.valueSortSettings.headerDelimiter),s=r.indexOf("Grand Total"),a=(-1<s&&(n=r.join("").split(r[s]).join(""),(r=[])[i.measureIndex]=n),""),l=i.measureIndex,h=0;h<this.dataSourceSettings.values.length;h++)if(l=r.indexOf(this.dataSourceSettings.values[h].caption),this.dataSourceSettings.values[h].caption===r[l]){r[l]=this.fieldList[this.dataSourceSettings.values[h].name].name,a=r[l];break}-1!==l&&(l<i.measureIndex&&(r=this.reArrangeHeaders(r,i.measureIndex,a)),0<(n="column"===this.olapValueAxis?e:t).length)&&(o=n[0].getElementsByTagName("Member").length-(-1<s?l:0),o=this.getParentElement(n,r,o,i.measureIndex,a,-1<s)[0],o=n.indexOf(o))}return{memberIndex:o,columnLength:e.length,rowLength:t.length,isValueSorting:-1<o}},Tyt.prototype.getParentElement=function(e,t,i,n,o,r){for(var s=[],a=0,l=!1,h=!1,d=e[0].getElementsByTagName("Member").length-i,p=0;p<e.length;p++){if(je(e[p].getElementsByTagName("Member")[d])){s=[];break}var c=e[p].getElementsByTagName("UName")[d].textContent,u=e[p].getElementsByTagName("Caption")[d].textContent,g=Number(e[p].getElementsByTagName("LNum")[d].textContent),c=c===t[d]||u===t[d]||je(t[d])&&0===g;if(c){if(s[s.length]=e[p],l=!0,a=g,r)break}else{if(l&&a<g){for(var m=[],f=p;f<e.length;f++){var y=e[f].getElementsByTagName("UName")[d].textContent,v=e[f].getElementsByTagName("Caption")[d].textContent,b=Number(e[f].getElementsByTagName("LNum")[d].textContent),y=y===t[1+d]||v===t[1+d]||je(t[1+d])&&0===b;if(a+1===b&&y)m[m.length]=e[f],h=!0;else if(a+1<b){if(!h)break;m[m.length]=e[f]}else if(b<a+1)break}h&&((u=t.slice(0,d).concat(t.slice(1+d,t.length))).indexOf(o)<n&&(u=this.reArrangeHeaders(u,n,o)),s=this.getParentElement(m,u,m[0].getElementsByTagName("Member").length,n,o));break}if(l&&!c)break}}return r||d<t.length-1&&0<s.length&&!h&&(s=this.getParentElement(s,t,i-1,n,o)),s},Tyt.prototype.reArrangeHeaders=function(e,t,i){var i=e.indexOf(i),n=e.slice(0,i),o=e.slice(i+1,e.length);return n[t]=e[i],n.concat(o)},Tyt.prototype.getSubTotalsVisibility=function(){this.showRowSubTotals=this.dataSourceSettings.showRowSubTotals&&this.dataSourceSettings.showSubTotals,this.showColumnSubTotals=this.dataSourceSettings.showColumnSubTotals&&this.dataSourceSettings.showSubTotals,this.showSubTotalsAtTop=this.showColumnSubTotals&&"Top"===this.dataSourceSettings.subTotalsPosition,this.showSubTotalsAtBottom=this.showRowSubTotals&&"Bottom"===this.dataSourceSettings.subTotalsPosition,this.hideRowTotalsObject={},this.hideColumnTotalsObject={};var e=1;do{if(1===e){if(this.showColumnSubTotals)for(var t=0;t<this.dataSourceSettings.columns.length;t++)!1===this.dataSourceSettings.columns[t].showSubTotals&&(this.hideColumnTotalsObject[this.dataSourceSettings.columns[t].name]=t)}else if(this.showRowSubTotals)for(var i=0;i<this.dataSourceSettings.rows.length;i++)!1===this.dataSourceSettings.rows[i].showSubTotals&&(this.hideRowTotalsObject[this.dataSourceSettings.rows[i].name]=i)}while(++e<3)},Tyt.prototype.frameRowHeader=function(e){for(var t,i,n,o=this,O=(this.headerGrouping={},this.lastLevel=[],!0),r=this.pivotValues.length,s=[],a=[],l=("down"!==this.customArgs.action?(s=this.pivotValues,a=this.valueContent):r=this.customArgs.drillInfo.currentCell.rowIndex+1,this.rowStartPos=0<this.rowStartPos?this.rowStartPos:r,0),h=[],d={},N=[],p=!1,c=-1,u=-1,g=[],m=[{actualText:"Grand Total",axis:"row",colIndex:0,formattedText:"Grand Total",hasChild:!1,level:-1,rowIndex:0,index:[],type:"grand sum",ordinal:0,colSpan:1,rowSpan:1,memberType:2,isDrilled:!1,valueSort:{"Grand Total":1,levelName:"Grand Total"}}],V=[],_=this.customArgs.drillInfo&&"row"===this.customArgs.drillInfo.axis?this.customArgs.drillInfo.currentCell.ordinal+1:0;l<e.length;){var f=e[l].querySelectorAll("Member"),V=this.frameTupCollection(f,V,l+_,this.tupRowInfo,this.showRowSubTotals,this.hideRowTotalsObject,"row");l++}l=0;for(var y,H=e.length,z=("down"===this.customArgs.action&&(H+=l=y=this.customArgs.drillInfo.currentCell.ordinal+1,i=this.tupRowInfo[y-1].allCount,t=this.tupRowInfo[y-1].allStartPos,P=this.tupRowInfo[y-1]),l),v=0,b=[];l<H;){var f=e["down"===this.customArgs.action?l-(this.customArgs.drillInfo.currentCell.ordinal+1):l].querySelectorAll("Member"),w=0,C=void 0,S=this.tupRowInfo[l].allCount,A=this.tupRowInfo[l].allStartPos,x=this.tupRowInfo[l].measure,I=this.tupRowInfo[l].typeCollection,T=this.tupRowInfo[l].drillStartPos,j=this.tupRowInfo[l].startDrillUniquename;if(0===l||l===z){for(var E="down"===this.customArgs.action?this.tupRowInfo[0].members:f;w<E.length;)"1"===E[w].querySelector("MEMBER_TYPE").textContent&&0===Number(E[w].querySelector("LNum").textContent)?g[w]=0:g[w]=Number(E[w].querySelector("LNum").textContent),"1"===E[w].querySelector("MEMBER_TYPE").textContent?(d[w]=0,c=-1===c?w:c,u=w):(d[w]=1,p="3"!==E[w].querySelector("MEMBER_TYPE").textContent||p),w++;n=I.indexOf("3")}if((w=0)===l&&(f.length>S+(x?1:0)||1===f.length&&x)&&m.pop(),0===l&&this.isPaging?0===m.length:!p||S===i||A!==t||1===f.length&&x){var D=this.checkAttributeDrill(this.tupRowInfo[l].drillInfo,"rows"),M=!(-1<T)||!(0<S)||D||T<A,M=P&&M&&-1<T?P.startDrillUniquename!==j||!(u>P.measurePosition||P.measureName===this.tupRowInfo[l].measureName||A!==T+1&&this.tupRowInfo[l].measurePosition!==T+1):M,j=!(-1<c&&0<S)||D||u<A;if((T="Top"===this.dataSourceSettings.grandTotalsPosition&&0===this.olapRowValueIndex&&"row"===this.olapValueAxis&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&("row"!==this.olapValueAxis||1<this.dataSourceSettings.rows.length))&&1===m.length&&(m=this.frameGrandTotalValues(e,m,I,n)),f.length===S+(x?1:0)&&x&&!T){var k="Grand Total"+this.valueSortSettings.headerDelimiter+this.dataFields[this.getUniqueName(f[n].querySelector("UName").textContent)].caption?this.dataFields[this.getUniqueName(f[n].querySelector("UName").textContent)].caption:f[n].querySelector("Caption").textContent,D="3"===I[n]&&this.dataFields[this.getUniqueName(f[n].querySelector("UName").textContent)]&&this.dataFields[this.getUniqueName(f[n].querySelector("UName").textContent)].caption?this.dataFields[this.getUniqueName(f[n].querySelector("UName").textContent)].caption:f[n].querySelector("Caption").textContent;(m=this.frameGrandTotalAxisSet(m,this.getUniqueName(f[n].querySelector("UName").textContent),D,r,l,Number(I[n]),f[n].querySelector("PARENT_UNIQUE_NAME")?f[n].querySelector("PARENT_UNIQUE_NAME").textContent:void 0,f[n].querySelector("LName").textContent,f[n].getAttribute("Hierarchy"),{levelName:k,axis:f[n].getAttribute("Hierarchy")}))[m.length-1].valueSort[k]=1}else if(0!==A&&(0!==n||1!==A)&&M&&j){"Top"===this.dataSourceSettings.grandTotalsPosition&&O&&this.dataSourceSettings.showGrandTotals&&("row"!==this.olapValueAxis||1<this.dataSourceSettings.rows.length)&&(this.insertRowGrandTotal(m,a,s,e,r),r=this.pivotValues.length,O=!1);for(var P=this.tupRowInfo[l],W=r,B=w,C={},Q=!1;w<f.length;){var F=f[w];if(F.querySelector("UName").textContent!==h[w]&&"2"!==I[w]&&(!(0<Object.keys(C).length?C.isDrilled&&!this.fieldList[C.hierarchy].isHierarchy:Q)||"3"===I[w]&&d[w-1]&&0!==d[w+1])){var U=Number(F.querySelector("LNum").textContent)-(d[w]&&"3"!==I[w]?1:g[w]),q=!!this.namedSetsPosition.row[w],L=this.getUniqueName(F.querySelector("UName").textContent),G=this.getDepth(this.tupRowInfo[l],L,Number(I[w])),k=this.getCaptionCollectionWithMeasure(this.tupRowInfo[l],w,!0);if(this.showSubTotalsAtBottom&&r>this.rowStartPos&&(W=r=this.insertRowSubTotal(s,a,b,r,U,k)),!(this.isPaging&&s[v][0]&&this.fieldList[s[v][0].hierarchy]&&this.fieldList[s[v][0].hierarchy].isHierarchy&&s[v][0].hasChild&&!s[v][0].isDrilled&&!this.rows[w].isNamedSet&&(0===this.rows[w].name.indexOf("[Measures]")||this.fieldList[F.getAttribute("Hierarchy")]&&(this.fieldList[F.getAttribute("Hierarchy")].isHierarchy||this.fieldList[F.getAttribute("Hierarchy")].hasAllMember))&&s[v][0].depth<G)){s[r]=[{axis:"row",actualText:L,colIndex:0,formattedText:"3"===I[w]&&this.dataFields[L]&&this.dataFields[L].caption?this.dataFields[L].caption:F.querySelector("Caption").textContent,hasChild:!!(this.fieldList[F.getAttribute("Hierarchy")]&&this.fieldList[F.getAttribute("Hierarchy")].isHierarchy&&w<this.rows.length-1&&!this.rows[w+1].isNamedSet&&this.rows[w+1].name.indexOf("[Measures]")<0&&this.fieldList[this.rows[w+1].name]&&this.fieldList[this.rows[w+1].name].hasAllMember)||0<Number(F.querySelector("CHILDREN_CARDINALITY").textContent),level:U,depth:G,rowIndex:r,index:[],ordinal:l,type:"header",colSpan:1,rowSpan:1,memberType:Number(I[w]),isDrilled:!(!this.fieldList[F.getAttribute("Hierarchy")]||!this.fieldList[F.getAttribute("Hierarchy")].isHierarchy||this.isAttributeDrill(F.getAttribute("Hierarchy"),this.tupRowInfo[l].drillInfo,"rows"))||this.tupRowInfo[l].drillInfo[w].isDrilled,parentUniqueName:F.querySelector("PARENT_UNIQUE_NAME")?F.querySelector("PARENT_UNIQUE_NAME").textContent:void 0,levelUniqueName:F.querySelector("LName").textContent,hierarchy:F.getAttribute("Hierarchy"),isNamedSet:q,valueSort:{levelName:"",axis:F.getAttribute("Hierarchy")}}],this.olapVirtualization&&"header"===s[r][0].type&&delete s[r][0].type,(C="3"!==I[w]?s[r][0]:C)||N.push(F.querySelector("Caption").textContent),k=this.getCaptionCollectionWithMeasure(this.tupRowInfo[l],w,!1),s[r][0].valueSort.levelName=k,s[r][0].valueSort[k]=1,a[r-this.rowStartPos]={},a[r-this.rowStartPos][0]=s[r][0],x&&w<n&&(h[n]="");for(var R=w+1;R<f.length;R++)h[R]="";h[w]=F.querySelector("UName").textContent,v=3!==Number(I[w])?r:v,r++,B=w}}else"2"===I[w]?B=w:this.tupRowInfo[l].drillInfo[w].isDrilled&&0===d[w]&&(Q=!0);this.tupRowInfo[l].drillInfo[w].isDrilled&&this.tupRowInfo[l].showTotals&&(this.tupRowInfo[l].showTotals=!!this.showRowSubTotals&&void 0===this.hideRowTotalsObject[this.tupRowInfo[l].drillInfo[w].hierarchy]),w++}W<r&&B>=f.length-1&&(s[r-1][0].ordinal=l,"header"===s[r-1][0].type)&&delete s[r-1][0].type}i=S,t=A}l++}this.showSubTotalsAtBottom&&0<b.length&&(b.reverse(),b.forEach(function(e){s[r]=[e],a[r-o.rowStartPos]={},a[r-o.rowStartPos][0]=s[r][0],r++})),("Top"!==this.dataSourceSettings.grandTotalsPosition||"row"===this.olapValueAxis&&1===this.dataSourceSettings.rows.length&&"Top"===this.dataSourceSettings.grandTotalsPosition||0===this.dataSourceSettings.rows.length)&&this.insertRowGrandTotal(m,a,s,e,r)},Tyt.prototype.insertRowSubTotal=function(e,t,i,n,o,r){var s=Hdt.frameHeaderWithKeys(e[n-1][0]);if(s.level<o&&"grand sum"!==s.type&&(s.isDrilled||3===s.memberType))if(3===s.memberType){for(var a=[],l=1;3===e[n-l][0].memberType;)a[a.length]=e[n-l][0],l++;if(e[n-l][0].isDrilled&&0!==a.length){for(var h=0,d=a.length;h<d;h++)a[h].formattedText=e[n-l][0].formattedText+" "+a[h].formattedText,a[h].isSum=!0,a[h].type="sum",a[h].parentUniqueName=e[n-l][0].levelUniqueName,i[i.length]=a[h];n-=--l}}else s.hasChild=!1,s.isDrilled=!1,s.isSum=!0,s.type="sum",s.formattedText=s.formattedText+" Total",i[Object.keys(i).length]=s;if(0<i.length)for(var p=i.length-1,c=i[p].valueSort.levelName.split(".").length,u=r.split(".").length;u<=c&&(e[n]=[i[p]],t[n-this.rowStartPos]={},t[n-this.rowStartPos][0]=e[n][0],n++,i.splice(i.length-1,1),0<Object.keys(i).length);)c=i[--p].valueSort.levelName.split(".").length;return n},Tyt.prototype.insertRowGrandTotal=function(e,t,i,n,o){if(1<e.length&&3!==e[0].memberType&&(e[0].ordinal=-1),"down"!==this.customArgs.action){var r=0===this.dataSourceSettings.rows.length||1===this.dataSourceSettings.rows.length&&"[Measures]"===this.dataSourceSettings.rows[0].name;if(this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals||r)for(var s=0;s<e.length;s++)i[e[s].rowIndex=o]=[e[s]],t[o-this.rowStartPos]={},t[o-this.rowStartPos][0]=i[o][0],o++}else this.updateRowEngine(i,t,n.length),this.onDemandDrillEngine=i;return e},Tyt.prototype.frameGrandTotalAxisSet=function(e,t,i,n,o,r,s,a,l,h){return e.push({axis:"row",actualText:t,colIndex:0,formattedText:i,hasChild:!1,level:-1,rowIndex:n,index:[],ordinal:o,colSpan:1,rowSpan:1,memberType:r,isDrilled:!1,parentUniqueName:s,levelUniqueName:a,hierarchy:l,valueSort:h}),e},Tyt.prototype.getDepth=function(e,t,i){for(var n=e.uNameCollection.indexOf(t),o=(e.uNameCollection.substring(0,n)+(3===i?"":t)).split("::[").map(function(e){return"["===e[0]?e:"["+e}),r=(3===i&&this.rowMeasurePos===o.length&&o.push(t),-1),s=0;s<o.length;s++)r+=o[s].split("~~").length;return r},Tyt.prototype.checkAttributeDrill=function(e,t){for(var i=!1,n=0;n<e.length&&!(i=this.isAttributeDrill(e[n].hierarchy,e,t));n++);return i},Tyt.prototype.frameTupCollection=function(e,t,i,n,o,r,s){for(var a,l,h,d,p=0,c=0,u=[],g=[],m=[],f="",y="",v=!0,b=-1;p<e.length;){var w=e[p],C=Number(w.querySelector("LNum").textContent),S=w.querySelector("UName").textContent,A=(3<Number(w.querySelector("MEMBER_TYPE").textContent)&&(w.querySelector("MEMBER_TYPE").textContent=0===S.indexOf("[Measures]")?"3":"1"),0===S.indexOf("[Measures]")?"3":3<Number(w.querySelector("MEMBER_TYPE").textContent)?"1":w.querySelector("MEMBER_TYPE").textContent),x=w.querySelector("Caption").textContent,I=(this.fieldList[x]&&"CalculatedField"===this.fieldList[x].type&&(x=this.fieldList[x].caption,w.querySelector("Caption").textContent=x),w.getAttribute("Hierarchy")),T=w.querySelector("PARENT_UNIQUE_NAME")?w.querySelector("PARENT_UNIQUE_NAME").textContent:"";if("2"===A?(this.isPaging||c++,a=je(a)?p:a):"3"===A?(l=w,h=S,d=p,"column"===s?(this.colMeasures[S]=w,this.colMeasurePos=p):this.rowMeasurePos=p):b=r[I],"2"!==A){if(this.headerGrouping[p]){if(C>this.lastLevel[p])this.lastLevel[p]=C;else if(C<this.lastLevel[p]){for(var E=this.lastLevel[p];C<=E;)delete this.headerGrouping[p].UName[E],delete this.headerGrouping[p].Caption[E],E--;this.lastLevel[p]=C}this.headerGrouping[p].UName[C]=S,this.headerGrouping[p].Caption[C]=x}else this.lastLevel[p]=C,this.headerGrouping[p]={UName:((w={})[C]=S,w),Caption:((w={})[C]=x,w)};if(this.isPaging)for(var D=T;this.drilledSets[D];){var O=this.drilledSets[D].querySelector("Caption").textContent,M=Number(this.drilledSets[D].querySelector("LNum").textContent);this.headerGrouping[p].UName[M]=D,this.headerGrouping[p].Caption[M]=O,D=null===this.drilledSets[D].querySelector("PARENT_UNIQUE_NAME")?"":this.drilledSets[D].querySelector("PARENT_UNIQUE_NAME").textContent}for(var k="",P=Object.keys(this.headerGrouping[p].UName),B=0;B<P.length;B++)var F=P[B],k=0===B?this.headerGrouping[p].UName[Number(F)]:k+"~~"+this.headerGrouping[p].UName[Number(F)];for(var f=""===f?k:f+"::"+k,L="",R=Object.keys(this.headerGrouping[p].Caption),B=0;B<R.length;B++)F=R[B],L=0===B?this.headerGrouping[p].Caption[Number(F)]:L+"~~"+this.headerGrouping[p].Caption[Number(F)];p!==d&&(y=""===y?L:y+"::"+L)}u.push(A),g.push(C),(je(t[p])||t[p]<C)&&(t[p]=C),m.push({level:C,uName:S,hierarchy:I,isDrilled:!1}),n[i-1]&&"1"===n[i-1].typeCollection[p]&&m[p].level>n[i-1].drillInfo[p].level&&((x=f.split(/~~|::\[/).map(function(e){return"["===e[0]?e:"["+e})).pop(),w=x.join("~~"),this.setDrillInfo(T,w,p,i,n)),p++}return-1<b&&(v="2"!==u[b+1]),n[i]={allCount:c,allStartPos:a,measure:l,measureName:h,measurePosition:d,members:e,typeCollection:u,uNameCollection:f,captionCollection:y,levelCollection:g,drillInfo:m,drillStartPos:-1,drillEndPos:-1,showTotals:!(!o&&0<c&&(0===d?1:0)<a)&&v},t},Tyt.prototype.getCaptionCollectionWithMeasure=function(e,t,i){e.captionCollection;var n,o,r=!0;if(!i&&"3"!==e.typeCollection[t])for(var s=0;s<this.measurePosition;s++)if(e.drillInfo[t].hierarchy===this.dataSourceSettings.rows[s].name){r=!1;break}return(e.measure&&r?(i=this.getUniqueName(e.measure.querySelector("UName").textContent),i=this.dataFields[i]&&this.dataFields[i].caption?this.dataFields[i].caption:e.measure.querySelector("Caption").textContent,n=e.uNameCollection.split(/[~~::]+/g).indexOf(e.measureName),(o=e.captionCollection.split(/[~~::]+/g)).splice(n,0,i),o):o=e.captionCollection.split(/[~~::]+/g)).join(this.valueSortSettings.headerDelimiter)},Tyt.prototype.setNamedSetsPosition=function(){this.namedSetsPosition={};var e=0;do{for(var t={},i=e?this.dataSourceSettings.rows:this.dataSourceSettings.columns,n=0;n<i.length;n++)i[n].isNamedSet&&(t[n]=i[n].name)}while(this.namedSetsPosition[e?"row":"column"]=t,++e<2)},Tyt.prototype.updateRowEngine=function(e,t,i){for(var n=this.pivotValues.length-1,o=Object.keys(e).length;n>this.customArgs.drillInfo.currentCell.rowIndex;)this.pivotValues[n+o]=this.pivotValues[n],this.pivotValues[n+o][0].ordinal+=i,this.pivotValues[n+o][0].rowIndex+=o,this.valueContent[n+o-this.rowStartPos]=this.valueContent[n-this.rowStartPos],n--;for(var r=0;r<e.length;r++)this.pivotValues[r]=e[r],this.valueContent[Number(r)-this.rowStartPos]=t[Number(r)-this.rowStartPos];this.pivotValues[this.customArgs.drillInfo.currentCell.rowIndex][0].isDrilled=!0},Tyt.prototype.updateTupCollection=function(e){for(var t="row"===this.customArgs.drillInfo.axis?this.tupRowInfo:this.tupColumnInfo,i=t.length-1;i>this.customArgs.drillInfo.currentCell.ordinal;)t[i+e]=t[i],i--},Tyt.prototype.frameGrandTotalValues=function(e,t,i,n){for(var o=0,r=!1;o<e.length&&!r;){var s=e["down"===this.customArgs.action?o-(this.customArgs.drillInfo.currentCell.ordinal+1):o].querySelectorAll("Member"),a=this.tupRowInfo[o].allCount,l=(this.tupRowInfo[o].allStartPos,this.tupRowInfo[o].measure),h=this.tupRowInfo[o].typeCollection;this.tupRowInfo[o].drillStartPos,this.tupRowInfo[o].startDrillUniquename;0===o&&(s.length>a+(l?1:0)||1===s.length&&l)&&t.pop(),0===o&&this.isPaging&&0!==t.length||(this.checkAttributeDrill(this.tupRowInfo[o].drillInfo,"rows"),s.length===a+(l?1:0)&&l&&(a="Grand Total"+this.valueSortSettings.headerDelimiter+s[n].querySelector("Caption").textContent,l="3"===h[n]&&this.dataFields[this.getUniqueName(s[n].querySelector("UName").textContent)]&&this.dataFields[this.getUniqueName(s[n].querySelector("UName").textContent)].caption?this.dataFields[this.getUniqueName(s[n].querySelector("UName").textContent)].caption:s[n].querySelector("Caption").textContent,(t=this.frameGrandTotalAxisSet(t,this.getUniqueName(s[n].querySelector("UName").textContent),l,this.pivotValues.length,o,Number(h[n]),s[n].querySelector("PARENT_UNIQUE_NAME")?s[n].querySelector("PARENT_UNIQUE_NAME").textContent:void 0,s[n].querySelector("LName").textContent,s[n].getAttribute("Hierarchy"),{levelName:a,axis:s[n].getAttribute("Hierarchy")}))[t.length-1].valueSort["Grand Total"+this.valueSortSettings.headerDelimiter+s[n].querySelector("Caption").textContent]=1)),r=this.dataSourceSettings.values.length+1===t.length,o++}return t},Tyt.prototype.frameColumnHeader=function(f){for(var y=this,v=(this.headerGrouping={},this.lastLevel=[],0),b=[],w=[],C=[],S=-1,A=-1,e=this.customArgs.drillInfo&&"column"===this.customArgs.drillInfo.axis?this.customArgs.drillInfo.currentCell.ordinal+1:0;v<f.length;){var t=f[v].querySelectorAll("Member"),b=this.frameTupCollection(t,b,v+e,this.tupColumnInfo,this.showColumnSubTotals,this.hideColumnTotalsObject,"column");v++}if(this.olapVirtualization&&(b=b.slice(0,b.length-1).map(function(e){return 0===e?1:e}).concat(b.slice(b.length-1))),0<f.length)for(var t=f[0].querySelectorAll("Member"),i=0;i<t.length;)C[i]="1"===t[i].querySelector("MEMBER_TYPE").textContent&&0===Number(t[i].querySelector("LNum").textContent)?0:Number(t[i].querySelector("LNum").textContent),"1"!==t[i].querySelector("MEMBER_TYPE").textContent||!this.isPaging&&0!==Number(t[i].querySelector("LNum").textContent)?w[i]=1:(w[i]=0,S=-1===S?i:S,A=i),i++;for(var x,v=0,I=1,T={},E=!0,D=!1,M=this;v<f.length;)!function(){var e=f[v].querySelectorAll("Member"),t=M.tupColumnInfo[v].allCount,i=M.tupColumnInfo[v].allStartPos,n=M.tupColumnInfo[v].measure,o=M.tupColumnInfo[v].typeCollection,r=M.tupColumnInfo[v].drillInfo,s=M.tupColumnInfo[v].drillStartPos,a=M.tupColumnInfo[v].startDrillUniquename,l=M.tupColumnInfo[v].endDrillUniquename,h=M.tupColumnInfo[v].drillEndPos,d=M.tupColumnInfo[v].levelCollection,p="2"!==o[0]&&("3"!==o[0]||"2"!==o[1]),c=0,n=(b.map(function(e,t){c+=0===w[t]?e+(1-(1<C[t]?1:C[t])):0===e?y.isPaging&&"2"===o[t]?0:1:e}),M.colDepth=M.colDepth>c?M.colDepth:c,0===v&&e.length>t+(n?1:0)&&(D=!0,p=0<t&&p?S<i:p),!1);if("Top"===M.dataSourceSettings.grandTotalsPosition&&M.dataSourceSettings.showGrandTotals&&M.dataSourceSettings.showColumnGrandTotals){for(var u=0,g=0;g<e.length;g++)0===e[g].querySelector("Caption").textContent.indexOf("All")&&u++;n=u===("column"===M.olapValueAxis?M.dataSourceSettings.columns.length-1:M.dataSourceSettings.columns.length)}!p&&!n||0!==t&&!n||(m=[-1,-1,-1],M.tupColumnInfo[v-1]&&0===M.tupColumnInfo[v-1].allCount?m=M.levelCompare(d,M.tupColumnInfo[v-1].levelCollection):D&&x&&(m=M.levelCompare(d,x.levelCollection)),M.tupColumnInfo[v].drillStartPos<0||M.showSubTotalsAtTop?(!E&&-1<m[0]&&-1<m[2]&&(I=M.mergeTotCollection(I,t,b,C,w,i,r,m)),M.setParentCollection(e),M.frameCommonColumnLoop(e,v,I,b,w,C),M.tupColumnInfo[v].showTotals||I--,!E&&-1<m[0]&&-1<m[2]&&(I=M.mergeTotCollection(I,t,b,C,w,i,r,m)),E=!1,M.isColDrill?M.isColDrill=!1:I++):(T.drillStartPos!==s||T.startDrillUniquename!==a||T.allCount===t)&&(!E&&-1<m[0]&&-1<m[2]&&(I=M.mergeTotCollection(I,t,b,C,w,i,r,m),E=!0),M.setParentCollection(e),!D||A<=s)&&(n||(M.totalCollection[M.totalCollection.length]={allCount:t,ordinal:v,members:e,drillInfo:r}),T.allCount=t,T.allStartPos=i,T.drillStartPos=s,T.startDrillUniquename=a,T.endDrillUniquename=l),x=M.tupColumnInfo[v]);var m,d=M.checkAttributeDrill(M.tupColumnInfo[v].drillInfo,"columns");0<t&&(!D||p&&(d||A<i))&&(t!==T.allCount&&i===T.allStartPos||(m=h===s||T.endDrillUniquename===l,p=i!==T.allStartPos?T.startDrillUniquename!==a:m,-1<s&&!p)||(E||(I=M.mergeTotCollection(I,t,b,C,w,i,r),E=!0),M.setParentCollection(e),D&&-1<s&&!(A<=s))||(n||(M.totalCollection[M.totalCollection.length]={allCount:t,ordinal:v,members:e,allStartPos:i,drillInfo:r}),T.allCount=t,T.allStartPos=i,T.drillStartPos=s,T.startDrillUniquename=a,T.endDrillUniquename=l)),v++}();if(0<this.totalCollection.length)if(1<Object.keys(this.colMeasures).length)this.orderTotals(I,b,w,C);else{this.totalCollection=this.totalCollection.reverse();for(var n=0,o=this.totalCollection;n<o.length;n++){var r,s=o[n];(!(0===this.tupColumnInfo[s.ordinal].measurePosition?1===this.tupColumnInfo[s.ordinal].allStartPos:0===this.tupColumnInfo[s.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals)&&(this.frameCommonColumnLoop(s.members,s.ordinal,I,b,C,w),r=this.checkAttributeDrill(this.tupColumnInfo[s.ordinal].drillInfo,"columns"),this.tupColumnInfo[s.ordinal].showTotals||r)&&I++}}},Tyt.prototype.orderTotals=function(e,t,i,n){for(var o={},r=1,s=0,a=this.totalCollection;s<a.length;s++){var l,h=a[s];(!(0===this.tupColumnInfo[h.ordinal].measurePosition?1===this.tupColumnInfo[h.ordinal].allStartPos:0===this.tupColumnInfo[h.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals)&&(o[l=this.tupColumnInfo[h.ordinal].measure.querySelector("UName").textContent]?(o[l].coll.push(h),o[l].count++,r=r<o[l].count?o[l].count:r):o[l]={coll:[h],count:1})}for(var d=Object.keys(o),p=r-1;-1<p;){for(var c=0,u=d;c<u.length;c++)(h=o[u[c]].coll[p])&&(this.frameCommonColumnLoop(h.members,h.ordinal,e,t,i,n),this.tupColumnInfo[h.ordinal].showTotals)&&e++;p--}},Tyt.prototype.setParentCollection=function(e){for(var t=0;e.length>t;){var i,n,o=e[t],r=2<Number(o.querySelector("MEMBER_TYPE").textContent)?"3":o.querySelector("MEMBER_TYPE").textContent,s=Number(o.querySelector("LNum").textContent),a=o.querySelector("UName").textContent,l=o.querySelector("PARENT_UNIQUE_NAME")?o.querySelector("PARENT_UNIQUE_NAME").textContent:"",h=!0,d=!1;this.parentObjCollection[t]&&(i=Object.keys(this.parentObjCollection[t]),h=(n=this.parentObjCollection[t][s-1])?l===n.querySelector("UName").textContent:0===i.length,d="1"===this.tupColumnInfo[0].typeCollection[t]),"2"===r?delete this.parentObjCollection[t]:(!this.isPaging&&!d||h||delete this.parentObjCollection[t],this.parentObjCollection[t]?this.parentObjCollection[t][s]&&this.parentObjCollection[t][s].querySelector("UName").textContent===a||(this.parentObjCollection[t][s]=o):(this.parentObjCollection[t]={},this.parentObjCollection[t][s]=o)),t++}},Tyt.prototype.setDrillInfo=function(e,t,i,n,o){for(n--;o[n]&&o[n].drillInfo[i].uName===e;){if(o[n].uNameCollection.split(/~~|::\[/).map(function(e){return"["===e[0]?e:"["+e}).join("~~").indexOf(t)<0)break;o[n].drillInfo[i].isDrilled=!0,this.curDrillEndPos<=i&&(o[n].drillEndPos=this.curDrillEndPos=i,o[n].endDrillUniquename=e),(o[n].drillStartPos>i||-1===o[n].drillStartPos)&&(o[n].drillStartPos=i),o[n].startDrillUniquename=e,n--}},Tyt.prototype.levelCompare=function(e,t){for(var i=[-1,0],n=0;n<t.length;n++)if(e[n]!==t[n]){i=[n,e[n],t[n]-e[n]];break}return i},Tyt.prototype.mergeTotCollection=function(e,t,i,n,o,r,s,a){for(var l=je(r)?a[0]:r-(this.colMeasurePos===r-1?2:1),h=s[l]&&s[l].level,d=this.getLevelsAsString(l-1,s),p={},c=1,u=!1,g=0,m=this.totalCollection;g<m.length;g++){var f,y=m[g];(u||y.allCount<=t&&(!(-1<h&&y.drillInfo[l])||y.drillInfo[l].level>=h&&this.getLevelsAsString(l-1,y.drillInfo)===d))&&(p[f=this.tupColumnInfo[y.ordinal].measure?this.tupColumnInfo[y.ordinal].measure.querySelector("UName").textContent:"measure"]?(p[f].coll.push(y),p[f].count++,c=c<p[f].count?p[f].count:c):p[f]={coll:[y],count:1},u=!1)}for(var v=Object.keys(p),b=c-1;-1<b;){for(var w=0,C=v;w<C.length;w++){var S=p[C[w]].coll[b];S&&((!(0===this.tupColumnInfo[S.ordinal].measurePosition?1===this.tupColumnInfo[S.ordinal].allStartPos:0===this.tupColumnInfo[S.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals)&&(this.frameCommonColumnLoop(S.members,S.ordinal,e,i,o,n),this.tupColumnInfo[S.ordinal].showTotals)&&e++,this.totalCollection.pop())}b--}return e},Tyt.prototype.getLevelsAsString=function(e,t){for(var i=[],n=0;n<e;n++)i[n]=t[n].level;return 0<i.length?i.toString():""},Tyt.prototype.frameCommonColumnLoop=function(e,t,i,n,o,r){var s=-1;if(this.tupColumnInfo[t].showTotals)for(var a=0,l=0;a<e.length;)l+=0<r[a]&&this.getMeasurePosition(this.tupColumnInfo[t].uNameCollection,this.tupColumnInfo[t].measurePosition)!==a?n[a]:n[a]+(1-o[a]),this.tupColumnInfo[t].drillInfo[a].isDrilled&&this.tupColumnInfo[t].showTotals&&(this.tupColumnInfo[t].showTotals=!!this.showColumnSubTotals&&void 0===this.hideColumnTotalsObject[this.tupColumnInfo[t].drillInfo[a].hierarchy],l-=n[a]-this.tupColumnInfo[t].levelCollection[a],s=this.tupColumnInfo[t].showTotals?-1:l-1),a++;var h=this.checkAttributeDrill(this.tupColumnInfo[t].drillInfo,"columns");if(this.tupColumnInfo[t].showTotals||h)for(var d=0,p=0,c={},u="0"===e[0].querySelector("LNum").textContent;d<e.length;){for(var g=e[d],m=2<Number(g.querySelector("MEMBER_TYPE").textContent)?"3":g.querySelector("MEMBER_TYPE").textContent,f=0,y=g.querySelector("LNum").textContent,v="2"===m||r[d]?1:o[d];v<=("3"===m?1:n[d]);v++){for(var b=!1,w=(this.pivotValues[p]||(this.pivotValues[p]=[]),Number(e[d].querySelector("LNum").textContent)>v&&"2"!==m?(this.parentObjCollection[d][v]||this.getDrilledParent(e[d],v,this.parentObjCollection[d]),this.parentObjCollection[d][v]&&(g=this.parentObjCollection[d][v]),b=!0):(g=e[d],f++),this.getUniqueName(g.querySelector("UName").textContent)),C=("2"!==m?c[w]="3"===m&&this.dataFields[w]&&this.dataFields[w].caption?this.dataFields[w].caption:g.querySelector("Caption").textContent:"2"===m&&"0"===y&&(u=u&&!(c[w]="Grand Total")),Object.keys(c)),S=d>=this.measurePosition&&0===Number(g.getElementsByTagName("LNum")[0].textContent)&&1===C.length?"Grand Total"+this.valueSortSettings.headerDelimiter:"",A=0;A<C.length;A++){var x=C[A];0===A?S+=c[x]:S=S+this.valueSortSettings.headerDelimiter+c[x]}var I=!!this.namedSetsPosition.column[d],T=this.getDepth(this.tupColumnInfo[t],w,Number(m));if(this.isPaging&&this.pivotValues[p-1]&&this.pivotValues[p-1][i]&&this.fieldList[this.pivotValues[p-1][i].hierarchy]&&this.fieldList[this.pivotValues[p-1][i].hierarchy].isHierarchy&&this.pivotValues[p-1][i].hasChild&&!this.pivotValues[p-1][i].isDrilled&&!this.columns[d].isNamedSet&&this.fieldList[g.getAttribute("Hierarchy")]&&(this.fieldList[g.getAttribute("Hierarchy")].isHierarchy||this.fieldList[g.getAttribute("Hierarchy")].hasAllMember)&&this.pivotValues[p-1][i].depth<T){this.isColDrill=!0;break}this.pivotValues[p][i]={axis:"column",actualText:w,colIndex:i,formattedText:"3"===m&&this.dataFields[w]&&this.dataFields[w].caption?this.dataFields[w].caption:g.querySelector("Caption").textContent,hasChild:!!(this.fieldList[g.getAttribute("Hierarchy")]&&this.fieldList[g.getAttribute("Hierarchy")].isHierarchy&&d<this.columns.length-1&&!this.columns[d+1].isNamedSet&&this.columns[d+1].name.indexOf("[Measures]")<0&&this.fieldList[this.columns[d+1].name]&&this.fieldList[this.columns[d+1].name].hasAllMember)||0<Number(g.querySelector("CHILDREN_CARDINALITY").textContent),level:1<f?-1:Number(g.querySelector("LNum").textContent)-(r[d]&&"3"!==m?1:0),rowIndex:p,ordinal:t,memberType:Number(m),depth:T,isDrilled:!(!this.fieldList[g.getAttribute("Hierarchy")]||!this.fieldList[g.getAttribute("Hierarchy")].isHierarchy||this.isAttributeDrill(g.getAttribute("Hierarchy"),this.tupColumnInfo[t].drillInfo,"columns"))||b||this.tupColumnInfo[t].drillInfo[d].isDrilled,parentUniqueName:g.querySelector("PARENT_UNIQUE_NAME")?g.querySelector("PARENT_UNIQUE_NAME").textContent:void 0,levelUniqueName:g.querySelector("LName").textContent,hierarchy:g.getAttribute("Hierarchy"),isNamedSet:I,valueSort:((w={levelName:S})[S]=1,w.axis=g.getAttribute("Hierarchy"),w)},this.headerContent[p]||(this.headerContent[p]={}),this.headerContent[p][i]=this.pivotValues[p][i],p++}d++}else if(-1<s)this.pivotValues[s][i-1].ordinal=t;else if(0<this.tupColumnInfo[t].allCount){for(a=0,l=0;a<this.tupColumnInfo[t].allStartPos;)l+=0<r[a]&&this.getMeasurePosition(this.tupColumnInfo[t].uNameCollection,this.tupColumnInfo[t].measurePosition)!==a?n[a]:n[a]+(1-o[a]),a++;this.tupColumnInfo[t].allStartPos===this.tupColumnInfo[t].measurePosition+1?l-=n[this.tupColumnInfo[t].allStartPos-2]-this.tupColumnInfo[t].levelCollection[this.tupColumnInfo[t].allStartPos-2]+1:l-=n[this.tupColumnInfo[t].allStartPos-1]-this.tupColumnInfo[t].levelCollection[this.tupColumnInfo[t].allStartPos-1],this.pivotValues[l-1]&&(this.pivotValues[l-1][i-1].ordinal=t)}},Tyt.prototype.isAttributeDrill=function(e,t,i){var n=!1;if(!this.isAdjacentToMeasure(e,i))for(var o=0;o<this.drilledMembers.length;o++)if(this.drilledMembers[o].name===e)for(var r=0;r<this.drilledMembers[o].items.length;r++){for(var s=this.drilledMembers[o].delimiter,a=this.drilledMembers[o].items[r].split(s),l="",h=0;h<a.length;h++)t[h]&&t[h].uName&&(l=l+(""===l?"":this.drilledMembers[o].delimiter)+t[h].uName);if(l===this.drilledMembers[o].items[r]){n=!0;break}}return n},Tyt.prototype.isAdjacentToMeasure=function(e,t){for(var i=!1,n="rows"===t?this.rows:this.columns,o=0;o<n.length;o++)if(n[o].name===e&&n[o+1]&&("[Measures]"===n[o+1].name||n[o+1].isNamedSet||this.fieldList[n[o+1].name]&&!this.fieldList[n[o+1].name].hasAllMember)){i=!0;break}return i},Tyt.prototype.getDrilledParent=function(e,t,i){for(var n=Number(e.querySelector("LNum").textContent),o=e,r=n-1;t<=r;r--){var s=this.drilledSets[o.querySelector("PARENT_UNIQUE_NAME").textContent];if(!s)break;o=i[r]=s}},Tyt.prototype.performRowSorting=function(e,t){if((this.enableSort||this.enableValueSorting)&&0<this.tupRowInfo.length){for(var i=this.pivotValues.length,n={},o={},r=[],s=!1,a=this.tupRowInfo[0].typeCollection.lastIndexOf("1"),l=void 0,h=this.colDepth;h<i;h++){var d,p,c=this.pivotValues[h][0];this.showSubTotalsAtBottom&&c.isSum&&3!==c.memberType||(""!==(d=(p=this.tupRowInfo[c.ordinal])?0===p.measurePosition&&3===c.memberType?p.measureName:p.uNameCollection:"")&&(p=(d=-1<a?this.frameUniqueName(d,c,p):d).split(/~~|::\[/).length,3===c.memberType&&0<this.tupRowInfo[0].measurePosition?o[F=this.getParentUname(d,c,!0,!0)]?o[F].push(c):o[F]=[c]:n[p]?n[p][d]=[c]:n[p]=((p={})[d]=[c],p)),s&&r.push(c),"grand sum"===c.type&&(s=!0))}for(var u=0<Object.keys(o).length&&0<this.tupRowInfo[0].measurePosition,g=Object.keys(n).map(function(e){return Number(e)}).sort(function(e,t){return t<e?1:e<t?-1:0}),m={},f=g.length-1;0<=f;f--){for(var y={},v=n[g[f]],b=Object.keys(v),w=0;w<b.length;w++)y[F=0===f?"parent":this.getParentUname(b[w],v[b[w]][0],u,!1)]?y[F].push(v[b[w]][0]):y[F]=v[b[w]];for(var C=Object.keys(y),S=0;S<C.length;S++)y[C[S]]=this.sortRowHeaders(y[C[S]],e,t);if(m[g[f+1]])for(S=0;S<C.length;S++){for(var A=[],x=y[C[S]],I=0;I<x.length;I++){var T=this.tupRowInfo[x[I].ordinal],E=0===T.measurePosition&&3===x[I].memberType?T.measureName:T.uNameCollection,O=(A.push(x[I]),-1<a&&(E=this.frameUniqueName(E,x[I],T)),!1);if(u)if(o[F=this.getParentUname(E,x[I],u,!0)]){o[F]=this.sortRowHeaders(o[F],e,t);var D=E.lastIndexOf("::[")===E.indexOf("::[Measures]"),N=E.split("::[").length-1===T.measurePosition,V=!T.drillInfo[T.measurePosition-1].isDrilled,T=T.members.length>T.measurePosition+1;if(D&&N&&V&&T)for(var O=!0,M=0;M<o[F].length;M++){A.push(o[F][M]);var k=E.substring(0,E.indexOf("::[Measures]"))+"::"+o[F][M].actualText;m[g[f+1]][k]&&(A=A.concat(m[g[f+1]][k]))}else l=this.showSubTotalsAtBottom&&A[A.length-1].isDrilled,A=A.concat(o[F])}if(!O&&m[g[f+1]][E])if(this.showSubTotalsAtBottom&&3===A[A.length-1].memberType&&-1<A[A.length-1].level&&l){for(var P=[],_=0,B=A.length-1;0<=B;B--){if(3!==A[B].memberType){P=P.reverse(),_=B+1;break}P[P.length]=A[B]}A=A.slice(0,_).concat(m[g[f+1]][E]).concat(P)}else{c=A[A.length-1],D=void 0;this.showSubTotalsAtBottom&&c.isDrilled&&((D=Hdt.frameHeaderWithKeys(c)).hasChild=!1,D.isDrilled=!1,D.isSum=!0,D.formattedText=D.formattedText+" Total"),A=A.concat(m[g[f+1]][E]),D&&(A[A.length]=D)}}y[C[S]]=A}else if(u)for(S=0;S<C.length;S++){for(x=y[C[S]],A=[],I=0;I<x.length;I++){A.push(x[I]);var F,E=this.tupRowInfo[x[I].ordinal].uNameCollection;-1<a&&(E=this.frameUniqueName(E,x[I],this.tupRowInfo[x[I].ordinal])),o[F=this.getParentUname(E,x[I],!0,!0)]&&(o[F]=this.sortRowHeaders(o[F],e,t),A=A.concat(o[F]))}y[C[S]]=A}m[g[f]]=y}for(var L=0,H=0,z=0,s=!1,r=this.sortRowHeaders(r,e,t),h=this.colDepth;h<i;h++){"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&("column"===this.olapValueAxis&&this.colDepth+1===h||"row"===this.olapValueAxis&&this.colDepth+this.dataSourceSettings.values.length+1===h)&&(L=0,s=!1);var R=s?r:m[g[0]].parent,j="Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&this.colDepth===h?R.length:s?L-H:L;R[j]&&(this.pivotValues[h]=[R[j]],this.pivotValues[h][0].rowIndex=h,this.valueContent[z][0]=this.pivotValues[h][0]),L++,z++,"grand sum"===this.pivotValues[h][0].type&&(s=!0,H=L)}}},Tyt.prototype.performColumnSorting=function(e,t){if(this.enableSort||this.enableValueSorting)for(var i=0;i<this.dataSourceSettings.columns.length;i++){for(var n=[],o=0,r=[],s=0;s<this.pivotValues.length;s++){for(var a=this.pivotValues[s],l=void 0,h={},d=[],p=1,c=(r[o]=[],n[o]=[],1),u=a[c].hierarchy,g=a[c].levelUniqueName;c<a.length;c++)if(!a[c].isNamedSet){if(2!==a[c].memberType&&"[Measures]"!==a[c].hierarchy&&-1!==a[c].level){if(je(h[a[c].formattedText])||je(this.pivotValues[s-1]))h[a[c].formattedText]||(h[a[c].formattedText]=[]),a[c+1]&&a[c].formattedText===a[c+1].formattedText||(d[d.length]=a[c]),h[a[c].formattedText][a[c].colIndex]=a[c];else if(h[a[c].formattedText]&&this.pivotValues[s-1]){var m=this.pivotValues[s-1][a[c].colIndex],f=Number(Object.keys(h[a[c].formattedText])[0]),f=h[a[c].formattedText][f].colIndex,f=this.pivotValues[s-1][f];if(m.formattedText!==f.formattedText){l=this.sortColumnHeaders(h,d,this.sortObject[a[c-1].levelUniqueName]||this.sortObject[a[c].hierarchy],e,t,u,g),n[o]=je(n[o])?[]:n[o];for(var y=0;y<l.length;y++)for(var v=Object.keys(h[l[y]]).length,b=0;b<v;b++)p=0===n[o].length?1:0,n[o][n[o].length+p]=h[l[y]][Number(Object.keys(h[l[y]])[b])];d=[],(h={})[a[c].formattedText]=[],d[d.length]=a[c]}h[a[c].formattedText][a[c].colIndex]=a[c]}}else if(0<Object.keys(h).length){r[o][r[o].length+p]=a[c],l=this.sortColumnHeaders(h,d,this.sortObject[a[c-1].levelUniqueName]||this.sortObject[a[c].hierarchy],e,t,u,g),n[o]=je(n[o])?[]:n[o];for(var w=0;w<l.length;w++)for(var C=Object.keys(h[l[w]]).length,S=0;S<C;S++)p=0===n[o].length?1:0,n[o][n[o].length+p]=h[l[w]][Number(Object.keys(h[l[w]])[S])]}else(-1===a[c].level||0===a[c].level)&&0<=Object.keys(h).length&&"[Measures]"!==a[c].hierarchy&&(r[o][r[o].length+p]=a[c]);if(-1!==a[c].level&&1===Object.keys(h).length&&"[Measures]"!==a[c].hierarchy&&!je(a[c+1])&&-1===a[c+1].level){var A=Object.keys(h[a[c].formattedText]).length,x=Object.keys(h[a[c].formattedText]);if(1<A)for(var I=0;I<A;I++)p=0===r[o].length?1:0,r[o][r[o].length+p]=h[a[c].formattedText][Number(x[I])];else r[o][r[o].length+p]=a[c]}if(0<Object.keys(r[o]).length){var p=0===n[o].length?1:0,T=r[o].length;if(2<T)for(var E=1;E<T;E++)p=0===n[o].length?1:0,n[o][n[o].length+p]=r[o][E];else n[o][n[o].length+p]=r[o][1]||r[o][0];h={},d=[],r[o]=[]}}if(0<Object.keys(h).length){r[o][r[o].length+p]=a[c];var D=this.sortObject[a[c-1].levelUniqueName]||this.sortObject[a[c-1].hierarchy],l=this.sortColumnHeaders(h,d,D,e,t,u,g);n[o]=je(n[o])?[]:n[o];for(var M=0;M<l.length;M++)for(var O=Object.keys(h[l[M]]).length,S=0;S<O;S++)p=0===n[o].length?1:0,n[o][n[o].length+p]=h[l[M]][Number(Object.keys(h[l[M]])[S])]}for(var k=1;k<n[o].length;k++)this.pivotValues[o][k]=n[o][k];for(var P=s;P<this.pivotValues.length;P++){var B=Pe({},this.pivotValues[P+1],null,!0),F=Pe({},this.pivotValues[P],null,!0);if(Object.keys(B).length===Object.keys(F).length&&2<Object.keys(B).length){for(var L=1;L<this.pivotValues[s].length;L++)0<Object.keys(B).length&&F[L].colIndex!==B[L].colIndex&&(this.pivotValues[P+1][L]=B[F[L].colIndex]);break}}o++,h={}}for(var R=0;R<this.pivotValues.length;R++)for(a=this.pivotValues[R],s=1;s<a.length;s++)a[s].colIndex=s}},Tyt.prototype.frameUniqueName=function(e,t,i){var n=-1<e.indexOf(t.actualText.toString()+"::[Measures]"),t=(e=e.substring(0,e.indexOf(t.actualText.toString()))+t.actualText.toString()).split("::[").length<=this.getMeasurePosition(e,i.measurePosition);return e+=n||t?"::"+i.measureName:""},Tyt.prototype.getMeasurePosition=function(e,t){for(var i=t,n=e.split("::["),o=0;o<n.length;o++)if(n[o]&&-1<n[o].indexOf("Measures")){i=o;break}return i},Tyt.prototype.sortRowHeaders=function(e,t,i){if(this.enableValueSorting&&"column"===this.olapValueAxis&&i.isValueSorting&&!je(this.valueSortSettings)){for(var n=[],o=0;o<e.length;o++){var r=e[o],s=t[r.ordinal*i.columnLength+i.memberIndex],a=s?s.getElementsByTagName("Value"):void 0,s=s&&0<a.length?Number(a[0].textContent):0;n.push({header:r,value:s})}e=Hdt.getSortedValue(n,this.valueSortSettings.sortOrder)}else if(this.enableSort&&0<e.length&&3!==e[0].memberType&&!e[0].isNamedSet){for(var l=[],o=0;o<e.length;o++)l[o]=e[o].actualText;var h=!1,d=("Grand Total"!==e[0].actualText?e[0]:e[1]).hierarchy,p=this.fieldList[d]&&this.fieldList[d].membersOrder?this.fieldList[d].membersOrder.slice():[],d={fieldName:d,levelName:e[0].levelUniqueName,sortOrder:this.sortObject[e[0].hierarchy]||this.sortObject[e[0].levelUniqueName],members:p&&0<p.length?p:l,IsOrderChanged:!1};if(p&&0<p.length?Hdt.applyCustomSort(d,e,"string",!1,!0):("Ascending"===d.sortOrder||void 0===d.sortOrder?e.sort(function(e,t){return e.formattedText>t.formattedText?1:t.formattedText>e.formattedText?-1:0}):"Descending"===d.sortOrder&&e.sort(function(e,t){return e.formattedText<t.formattedText?1:t.formattedText<e.formattedText?-1:0}),h=!0),h&&this.getHeaderSortInfo){for(var c=[],u=0,g=0;u<e.length;u++)"Grand Total"!==e[u].actualText&&(c[g++]=e[u].formattedText);d.members=c}this.getHeaderSortInfo&&this.getHeaderSortInfo(d),d.IsOrderChanged&&Hdt.applyCustomSort(d,e,"string",!0,!0)}return e},Tyt.prototype.sortColumnHeaders=function(e,t,i,n,o,r,s){var a=Object.keys(e);if(this.enableValueSorting&&"row"===this.olapValueAxis&&o.isValueSorting&&!je(this.valueSortSettings)){for(var l=[],h=0;h<a.length;h++){var d=e[a[h]],d=this.showSubTotalsAtTop?d[0]:d[d.length-1],p=n[o.memberIndex*o.columnLength+d.ordinal],c=p?p.getElementsByTagName("Value"):void 0,p=p&&0<c.length?Number(c[0].textContent):0;l.push({header:d,value:p})}a=Hdt.getSortedValue(l,this.valueSortSettings.sortOrder).map(function(e){return e.formattedText})}else if(this.enableSort){var u=!1,g=this.fieldList[r]&&this.fieldList[r].membersOrder?this.fieldList[r].membersOrder.slice():[],r={fieldName:r,levelName:s,sortOrder:i,members:g&&0<g.length?g:a,IsOrderChanged:!1};if(g&&0<g.length?this.applyCustomSort(a,r):("Ascending"===r.sortOrder||void 0===r.sortOrder?a.sort(function(e,t){return t<e?1:e<t?-1:0}):"Descending"===r.sortOrder&&a.sort(function(e,t){return e<t?1:t<e?-1:0}),u=!0),u&&this.getHeaderSortInfo){for(var m=[],f=0,y=0;f<a.length;f++)"Grand Total"!==a[f]&&(m[y++]=a[f]);r.members=m}this.getHeaderSortInfo&&this.getHeaderSortInfo(r),r.IsOrderChanged&&this.applyCustomSort(a,r,!0)}return a},Tyt.prototype.applyCustomSort=function(e,t,i){var n,o=[],r=[],o=t.IsOrderChanged?t.members:"Ascending"===t.sortOrder||"None"===t.sortOrder||void 0===t.sortOrder?[].concat(t.members):[].concat(t.members).reverse();"Grand Total"===e[0]&&(n=e[0],e.shift());for(var s=0,a=0;s<e.length;s++){var l=e[s];if(o[a]===l){if(e.splice(a++,0,l),e.splice(++s,1),!(a<o.length)){i||r.splice(--a,0,l);break}s=-1}0<=s&&!i&&(r[s]=e[s])}if(!i){for(s=r.length;s<e.length;s++)r[s]=e[s];"Grand Total"===r[r.length-1]&&r.pop(),t.members=r}return n&&e.splice(0,0,n),e},Tyt.prototype.frameSortObject=function(){if(this.enableSort)for(var e=0;e<this.sortSettings.length;e++)this.sortObject[this.sortSettings[e].name]=this.sortSettings[e].order},Tyt.prototype.getParentUname=function(e,t,i,n){var o="";if(i&&!n){for(var r,i=this.tupRowInfo[t.ordinal],s=[],a={},l=0;l<e.length;l++)"~"!==e[l]&&":"!==e[l]||(s.push(l),a[l]=e[l]+e[l],l++);o=this.getMeasurePosition(e,i.measurePosition)>=e.split("::[").length-1?-1<s[s.length-2]?e.substring(0,s[s.length-2])+a[s[s.length-1]]+i.measureName:"parent":-1<(r=e.lastIndexOf("~~")>e.lastIndexOf("::[")?e.lastIndexOf("~~"):e.lastIndexOf("::["))?e.substring(0,r):"parent"}else o=-1<(r=e.lastIndexOf("~~")>e.lastIndexOf("::[")?e.lastIndexOf("~~"):e.lastIndexOf("::["))?e.substring(0,r):"parent";return o},Tyt.prototype.performColumnSpanning=function(){for(var e={},t=this.rowStartPos-1,i=Object.keys(this.colMeasures).length,n=this.tupColumnInfo[0]?this.tupColumnInfo[0].measurePosition:this.measureIndex,o=t;-1<o;o--)if(3===this.pivotValues[o][1].memberType){n=o;break}for(;-1<t;){e[t]={};for(var r=this.pivotValues[t].length-1;0<r;){e[t][r]=1;var s=this.pivotValues[t][r+1],a=this.pivotValues[t+1]&&1<this.rowStartPos-t?this.pivotValues[t+1][r]:void 0,l=this.pivotValues[t][r],h=!1,d=!1,p=this.tupColumnInfo[l.ordinal],c=p.allStartPos>("3"===p.typeCollection[0]?1:0),p=this.checkAttributeDrill(p.drillInfo,"columns");this.showSubTotalsAtTop&&l.isDrilled&&s&&s.actualText!==l.actualText&&-1<l.level&&(l.ordinal=this.getOrdinal(l,this.pivotValues[t+1])),a&&s&&(2===l.memberType||-1===l.level?s.actualText===l.actualText:3===l.memberType&&l.actualText===s.actualText||s.valueSort.levelName===l.valueSort.levelName)&&(2===l.memberType?c&&"sum"!==s.type?l.colSpan=1:l.colSpan=s.colSpan+1>(t<n?i:0)?1:s.colSpan+1:(l.colSpan=s.colSpan+1,l.ordinal=s.ordinal),h=!0),2===l.memberType?(c?(p||(l.type="sum"),l.formattedText="Total",l.valueSort[l.valueSort.levelName.toString()]=1):(l.type="grand sum",l.formattedText="Grand Total",t<this.measureIndex&&(l.valueSort.levelName=s="Grand Total",l.valueSort[s.toString()]=1)),l.hasChild=!1):-1===l.level&&(l.type="sum",l.formattedText="Total",l.hasChild=!1,l.valueSort[l.valueSort.levelName.toString()]=1),a?2===l.memberType&&2===a.memberType||a.actualText===l.actualText?(e[t][r]=e[t+1]?e[t+1][r]+1:1,0===t||1===l.memberType&&-1<l.level&&1===a.memberType&&-1===a.level?(l.rowSpan=!l.isDrilled||this.fieldList[l.hierarchy]&&this.fieldList[l.hierarchy].isHierarchy&&!l.hasChild?e[t+1][r]+1:1,a.rowSpan=!a.isDrilled||this.fieldList[a.hierarchy]&&this.fieldList[a.hierarchy].isHierarchy&&!a.hasChild||-1!==a.level?a.rowSpan:e[t+1][r]):3===l.memberType?l.rowSpan=1:l.rowSpan=-1,d=!0):!l.isDrilled||this.fieldList[l.hierarchy]&&this.fieldList[l.hierarchy].isHierarchy&&!l.hasChild||-1!==l.level||2!==a.memberType?(l.rowSpan=0===t?e[t][r]:-1,a.rowSpan=-1<a.level&&(!a.isDrilled||this.fieldList[a.hierarchy]&&this.fieldList[a.hierarchy].isHierarchy&&!a.hasChild)||2!==l.memberType&&2===a.memberType?e[t+1][r]:1):(e[t][r]=e[t+1]?e[t+1][r]+1:1,l.rowSpan=-1,d=!0):l.rowSpan=-1<l.level||1===this.rowStartPos?e[t][r]:-1,h||(l.colSpan=1),d||(e[t][r]=1),r--}t--}},Tyt.prototype.getOrdinal=function(e,t){for(var i=0,n=e.colIndex;0<n;n--)if(-1===t[n].level){i=t[n].ordinal;break}return i},Tyt.prototype.frameValues=function(e,t){var i,n=this.colDepth,o=this.pivotValues.length,r=0;"down"===this.customArgs.action&&(i=Object.keys(this.onDemandDrillEngine),n=Number(i[0]),o=Number(i[i.length-1])+1,r=this.onDemandDrillEngine[n][0].ordinal);for(var s=n;s<o;s++)for(var a,l,h,d,p,c,u,g=this.pivotValues[s],m=g[0].ordinal,f=1;f<this.pivotValues[0].length;f++)this.pivotValues[this.colDepth-1][f]&&(a=this.pivotValues[this.colDepth-1][f].ordinal,l=this.pivotValues[this.colDepth-1][f],l=3===g[0].memberType?g[0].actualText.toString():this.tupColumnInfo[l.ordinal]&&this.tupColumnInfo[l.ordinal].measure?this.tupColumnInfo[l.ordinal].measure.querySelector("UName").textContent:g[0].actualText,"header"===g[0].type?g[f]={axis:"value",actualText:this.getUniqueName(l),formattedText:"",value:0,colIndex:f,rowIndex:s}:(d=void 0,p="0",l=this.getUniqueName(l),u=!0,c=!this.fieldList[g[0].hierarchy]||!this.fieldList[g[0].hierarchy].isHierarchy||g[0].isDrilled,u=this.tupRowInfo[m]?this.tupRowInfo[m].showTotals:(h=0===this.dataSourceSettings.rows.length||1===this.dataSourceSettings.rows.length&&"[Measures]"===this.dataSourceSettings.rows[0].name,this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals||h),h=e[(m-r)*t+a],d=this.showSubTotalsAtBottom&&g[0].isDrilled||!u&&c?"":je(h)||je(h.querySelector("FmtValue"))?this.emptyCellTextContent:h.querySelector("FmtValue").textContent,p=!u&&c?"0":je(h)||je(h.querySelector("Value"))?null:h.querySelector("Value").textContent,d=this.showSubTotalsAtBottom&&g[0].isDrilled?"":u&&!je(p)?this.getFormattedValue(Number(p),l,""!==d?d:p):d,c=!this.tupColumnInfo[a]||0<this.tupColumnInfo[a].allCount||-1<this.tupColumnInfo[a].drillStartPos||!this.tupRowInfo[m]||0<this.tupRowInfo[m].allCount||-1<this.tupRowInfo[m].drillStartPos,u=!!this.tupRowInfo[m]&&(0===this.tupRowInfo[m].measurePosition?1===this.tupRowInfo[m].allStartPos:0===this.tupRowInfo[m].allStartPos)||!!this.tupColumnInfo[a]&&(0===this.tupColumnInfo[a].measurePosition?1===this.tupColumnInfo[a].allStartPos:0===this.tupColumnInfo[a].allStartPos),g[f]={axis:"value",actualText:l,formattedText:d,colOrdinal:a,rowOrdinal:m,columnHeaders:this.tupColumnInfo[a]?this.tupColumnInfo[a].captionCollection:"",rowHeaders:this.tupRowInfo[m]?this.tupRowInfo[m].captionCollection:"",value:je(p)?null:Number(p),colIndex:f,rowIndex:s,isSum:c,isGrandSum:u}),this.valueContent[s-this.rowStartPos][f]=g[f])},Tyt.prototype.getFormattedValue=function(e,t,i){return this.formatFields[t]&&!je(e)&&(delete(t=Pe({},this.formatFields[t].properties||this.formatFields[t],null,!0)).name,!t.minimumSignificantDigits&&t.minimumSignificantDigits<1&&delete t.minimumSignificantDigits,!t.maximumSignificantDigits&&t.maximumSignificantDigits<1&&delete t.maximumSignificantDigits,i=t.type?this.globalize.formatDate(new Date(e.toString()),t):(delete t.type,this.globalize.formatNumber(e,t))),i},Tyt.prototype.getMeasureInfo=function(){this.olapValueAxis=void 0,this.olapRowValueIndex=void 0;for(var e,t="column",i=[],n=0,o=this.values;n<o.length;n++){var r=o[n];i[i.length]=r.isCalculatedField?this.fieldList[r.name].tag:r.name}if(0<i.length){if(this.isMeasureAvail){for(var s=!1,a=0,l=0,h=this.rows.length;l<h;l++)if("[measures]"===this.rows[l].name.toLowerCase()){t="row",e=l,s=!0,a=this.dataSourceSettings.rows.length,this.olapRowValueIndex=e;break}if(!s)for(l=0,h=this.columns.length;l<h;l++)if("[measures]"===this.columns[l].name.toLowerCase()){t="column",e=l,s=!0,a=this.dataSourceSettings.columns.length;break}this.olapValueAxis=t,this.measurePosition=e,this.measureIndex=e===a-1?-1:e}else e="row"===(t=this.valueAxis)?this.rows.length-1:this.columns.length-1;return{measureAxis:t,measureIndex:e,valueInfo:i}}return{measureAxis:t,measureIndex:-1,valueInfo:[]}},Tyt.prototype.frameMeasureOrder=function(e,O,t,i,n,N){var o=[],r=[],s=[],a={},l=[],h=e.measureAxis,d=e.measureIndex,p=e.valueInfo;if(h===O&&0<p.length){for(var c={},u=[],g=0,V=t.length;g<V;g++){for(var m=t[g],_=[].slice.call(m.querySelectorAll("Member")),f="",y="",v=0;v<_.length;)f=f+(""!==f?"~~":"")+_[v].querySelector("UName").textContent,(v===d&&0===d||v===d-1)&&(y=f),v++;c[y]?c[y][c[y].length]=f:(c[y]=[f],u[u.length]=y),a[f]={index:g,node:m},l[l.length]=f}if(0<l.length&&0<u.length)if(0===d){for(var b=0,H=p;b<H.length;b++)for(var z=H[b],w=0,j=u;w<j.length;w++)if((A=j[w])===z)for(var C=0,W=c[A];C<W.length;C++){f=W[C];s[s.length]=a[f].index,o[o.length]=a[f].node}}else for(var S=0,Q=u;S<Q.length;S++)for(var A=Q[S],x=0,U=p;x<U.length;x++)for(var q=U[x],I=0,G=c[A];I<G.length;I++)(f=G[I]).split("~~")[d]===q&&(s[s.length]=a[f].index,o[o.length]=a[f].node);var Y=[];if(0<i.length){for(var T=[],E=[],D=0,M=0,k=0,g=0,P=N;g<P;g++){n-1<M?(M=0,T[++k]||(T[k]=[])):T[k]||(T[k]=[]),T[k][M]=g,M++;var B=void 0;i[D]?B=this.olapVirtualization?g:Number(i[D].getAttribute("CellOrdinal")):D++,B===g&&(Y[E[g]=B]=i[D],D++)}if(i=Y,"column"===h){if(0<T.length&&T[0].length===s.length)for(v=0,P=s.length;v<P;v++)for(g=0;g<T.length;){var F=g*n+v;!je(T[g])&&!je(s[v])&&(R=(E[F]||F).toString(),L=i[Number(T[g][s[v]])])&&(L.setAttribute("CellOrdinal",R.toString()),r[F]=L),g++}}else if(T.length===s.length)for(v=0,P=s.length;v<P;v++)for(g=0;g<T[s[v]].length;){var L,R=(E[F=v*n+g]||F).toString();(L=i[Number(T[s[v]][g])])&&(L.setAttribute("CellOrdinal",R.toString()),r[r.length]=L),g++}}return{orderedHeaderTuples:o,orderedValueTuples:r}}return{orderedHeaderTuples:t,orderedValueTuples:i}},Tyt.prototype.getDrilledSets=function(e,t,i,n){for(var o=[],r=t.actualText.toString(),s="row"===n?this.tupRowInfo:this.tupColumnInfo,n=s[t.ordinal],a=0===s[0].typeCollection.indexOf("3")?1:0,l=0,h="1"===s[0].typeCollection[i];l<s.length;)(je(s[l].allStartPos)||s[l].allStartPos>a)&&(o[o.length]=s[l].uNameCollection),l++;for(var d=e.split("::[").map(function(e){return"["===e[0]?e:"["+e}),p=[],c=0;c<=i;c++)if(d[c])if((h||this.isPaging)&&c===i){for(var u=d[c].split("~~"),g=u.indexOf(r),m=[],f=0;f<=g;f++)m.push(u[f]);p[p.length]=0<m.length?m.join("~~"):d[c]}else p[p.length]=d[c];e=p.join("::");for(var y=[],v={},b=0,w=o;b<w.length;b++){var C=w[b];if(0===C.indexOf(e)&&(y.push(C),this.isPaging))for(var C=C.split("::[")[i],S=(I=(C="["===C[0]?C:"["+C).split("~~")).indexOf(r);S<I.length;S++)v[I[S]]=I[S]}if(this.isPaging){for(var A=n.uNameCollection.split("::[").map(function(e){return"["===e[0]?e:"["+e}),x=[],S=0;S<A.length;S++)S!==i&&(x[S]=A[S]);for(var I=Object.keys(v),S=0;S<I.length;S++)x[i]=I[S],y.push(x.join("::"))}for(var T={},E=0,D=y;E<D.length;E++){for(var M=D[E].split("::[").map(function(e){return"["===e[0]?e:"["+e}),k="",P=0;P<=i;P++){var B=M[P];B&&(k=k+(""!==k?"~~":"")+(B=B.split("~~"))[B.length-1])}T[k]=k}return T},Tyt.prototype.updateDrilledInfo=function(e){this.dataSourceSettings=e,this.drilledMembers=e.drilledMembers?this.updateDrilledItems(e.drilledMembers):[],this.generateGridData(e)},Tyt.prototype.updateCalcFields=function(e,t){this.dataSourceSettings=e,this.calculatedFieldSettings=e.calculatedFieldSettings||[],this.getAxisFields(),this.updateFieldlist(),this.loadCalculatedMemberElements(this.calculatedFieldSettings),this.dataFields[t.name]?this.generateGridData(e):Ayt.getCellSets(e,this,!0,void 0,!0)},Tyt.prototype.onSort=function(e,t){this.dataSourceSettings=e,t||(this.sortSettings=e.sortSettings||[],this.getAxisFields(),this.frameSortObject(),this.updateFieldlist()),0<this.xmlaCellSet.length&&this.xmlDoc?this.generateEngine(this.xmlDoc,this.request,this.customArgs):this.generateGridData(e)},Tyt.prototype.updateFieldlist=function(e){for(var t=0;t<this.savedFieldListData.length;){var i,n=this.savedFieldListData[t].id,o=this.savedFieldListData[t].pid;if(this.savedFieldList[n]&&(i=this.enableSort?this.sortObject[n]||"Ascending":"None",this.savedFieldList[n].isSelected=!1,this.savedFieldList[n].isExcelFilter=!1,this.savedFieldList[n].sort=i,this.savedFieldList[n].allowDragAndDrop=!0,this.savedFieldList[n].showFilterIcon=!0,this.savedFieldList[n].showSortIcon=!0,this.savedFieldList[n].showEditIcon=!0,this.savedFieldList[n].showRemoveIcon=!0,this.savedFieldList[n].showValueTypeIcon=!0,this.savedFieldList[n].showSubTotals=!0,this.savedFieldListData[t].sort=i,this.savedFieldListData[t].allowDragAndDrop=!0,this.savedFieldListData[t].showFilterIcon=!0,this.savedFieldListData[t].showSortIcon=!0,this.savedFieldListData[t].showEditIcon=!0,this.savedFieldListData[t].showRemoveIcon=!0,this.savedFieldListData[t].showValueTypeIcon=!0,this.savedFieldListData[t].showSubTotals=!0,e)&&(this.savedFieldList[n].filter=[],this.savedFieldList[n].actualFilter=[]),this.dataFields[n]&&this.savedFieldList[n]&&-1<this.selectedItems.indexOf(n)?(this.savedFieldList[n].isSelected=!0,this.savedFieldList[n].allowDragAndDrop=!this.dataFields[n]||this.dataFields[n].allowDragAndDrop,this.savedFieldList[n].showFilterIcon=!this.dataFields[n]||this.dataFields[n].showFilterIcon,this.savedFieldList[n].showSortIcon=!this.dataFields[n]||this.dataFields[n].showSortIcon,this.savedFieldList[n].showEditIcon=!this.dataFields[n]||this.dataFields[n].showEditIcon,this.savedFieldList[n].showRemoveIcon=!this.dataFields[n]||this.dataFields[n].showRemoveIcon,this.savedFieldList[n].showValueTypeIcon=!this.dataFields[n]||this.dataFields[n].showValueTypeIcon,this.savedFieldList[n].showSubTotals=!this.dataFields[n]||this.dataFields[n].showSubTotals,this.savedFieldListData[t].isSelected=!0,this.savedFieldListData[t].allowDragAndDrop=!this.dataFields[n]||this.dataFields[n].allowDragAndDrop,this.savedFieldListData[t].showFilterIcon=!this.dataFields[n]||this.dataFields[n].showFilterIcon,this.savedFieldListData[t].showSortIcon=!this.dataFields[n]||this.dataFields[n].showSortIcon,this.savedFieldListData[t].showEditIcon=!this.dataFields[n]||this.dataFields[n].showEditIcon,this.savedFieldListData[t].showRemoveIcon=!this.dataFields[n]||this.dataFields[n].showRemoveIcon,this.savedFieldListData[t].showValueTypeIcon=!this.dataFields[n]||this.dataFields[n].showValueTypeIcon,this.savedFieldListData[t].showSubTotals=!this.dataFields[n]||this.dataFields[n].showSubTotals):this.dataFields[o]&&this.savedFieldList[o]&&-1<this.selectedItems.indexOf(o)?this.savedFieldListData[t].isSelected=!0:this.savedFieldListData[t].isSelected=!1,this.savedFieldList[n]&&this.savedFieldList[n].isCalculatedField||"[calculated members].[_0]"===n.toLowerCase()){for(var r=!1,s=0,a=this.calculatedFieldSettings;s<a.length;s++){var l,h,d=a[s];n===d.name&&(l=d.formula,h=d.formatString,this.savedFieldListData[t].formula=l,this.savedFieldListData[t].formatString=h,this.savedFieldListData[t].parentHierarchy=-1<l.toLowerCase().indexOf("measure")?void 0:d.hierarchyUniqueName,this.savedFieldList[n].formula=l,this.savedFieldList[n].formatString=h,this.savedFieldList[n].parentHierarchy=this.savedFieldListData[t].parentHierarchy,r=!0)}(!r&&"[calculated members].[_0]"!==n.toLowerCase()||"[calculated members].[_0]"===n.toLowerCase()&&0===this.calculatedFieldSettings.length)&&(this.savedFieldListData.splice(t,1),t--,this.savedFieldList[n])&&delete this.savedFieldList[n]}t++}this.fieldList=this.savedFieldList,this.fieldListData=this.savedFieldListData},Tyt.prototype.updateFieldlistData=function(e,t){for(var i=0,n=this.fieldListData;i<n.length;i++){var o=n[i];if(o.id===e){o.isSelected=!!t;break}}},Tyt.prototype.getFormattedFields=function(e){this.formatFields={};for(var t=e.length;t--;)this.formatFields[e[t].name]=e[t]},Tyt.prototype.getCubes=function(e){var t=this.getConnectionInfo(e.url,e.localeIdentifier.toString()),i='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><Discover xmlns="urn:schemas-microsoft-com:xml-analysis"><RequestType>MDSCHEMA_CUBES</RequestType><Restrictions><RestrictionList><CATALOG_NAME>'+e.catalog+"</CATALOG_NAME></RestrictionList></Restrictions><Properties><PropertyList><Catalog>"+e.catalog+"</Catalog> <LocaleIdentifier>"+t.LCID+"</LocaleIdentifier>"+(e.roles?"<Roles>"+e.roles+"</Roles>":"")+"</PropertyList></Properties></Discover></Body></Envelope>";if(this.doAjaxPost("POST",t.url,i,this.validateCube.bind(this),{dataSourceSettings:e,action:"getCubes"}),this.errorInfo)throw this.errorInfo},Tyt.prototype.validateCube=function(e,t,i){for(var e=[].slice.call(e.querySelectorAll("row")),n=!1,o=0,r=e;o<r.length;o++)if(r[o].querySelector("CUBE_NAME").textContent===i.dataSourceSettings.cube){n=!0;break}!n&&0<e.length&&(this.errorInfo="Invalid cube name "+this.dataSourceSettings.cube)},Tyt.prototype.getFieldList=function(e){var t={catalog:e.catalog,cube:e.cube,url:e.url,LCID:e.localeIdentifier.toString(),request:"MDSCHEMA_HIERARCHIES",roles:e.roles};this.getTreeData(t,this.getFieldListItems.bind(this),{dataSourceSettings:e,action:"loadFieldElements"})},Tyt.prototype.getTreeData=function(e,t,i){var n=this.getConnectionInfo(e.url,e.LCID),e='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><Discover xmlns="urn:schemas-microsoft-com:xml-analysis"><RequestType>'+e.request+"</RequestType><Restrictions><RestrictionList><CATALOG_NAME>"+e.catalog+"</CATALOG_NAME><CUBE_NAME>"+e.cube+"</CUBE_NAME></RestrictionList></Restrictions><Properties><PropertyList><Catalog>"+e.catalog+"</Catalog> <LocaleIdentifier>"+n.LCID+"</LocaleIdentifier>"+(e.roles?"<Roles>"+e.roles+"</Roles>":"")+"</PropertyList></Properties></Discover></Body></Envelope>";if(this.doAjaxPost("POST",n.url,e,t,i),this.errorInfo)throw this.errorInfo},Tyt.prototype.getAxisFields=function(){this.rows=this.dataSourceSettings.rows||[],this.columns=this.dataSourceSettings.columns||[],this.filters=this.dataSourceSettings.filters||[],this.values=this.dataSourceSettings.values||[];for(var e=Pe([],this.rows,null,!0),t=(e=e.concat(this.columns,this.values,this.filters)).length;t--;)this.dataFields[e[t].name]=e[t],"[measures]"===e[t].name.toLowerCase()?this.isMeasureAvail=!0:this.selectedItems.push(e[t].name);if(this.mappingFields={},this.dataSourceSettings.fieldMapping)for(var i=0,n=this.dataSourceSettings.fieldMapping;i<n.length;i++){var o=n[i];this.mappingFields[o.name]=o}!this.isMeasureAvail&&0<this.values.length&&(("row"===this.valueAxis?this.rows:this.columns).push({name:"[Measures]",caption:"Measures",showRemoveIcon:!0,allowDragAndDrop:!0}),this.isMeasureAvail=!0)},Tyt.prototype.getAggregateType=function(e,t){var i;switch(t){case"1":i="Sum";break;case"2":i="Count";break;case"3":i="Min";break;case"4":i="Max";break;case"5":i="Avg";break;case"8":i="DistinctCount";break;case"127":i="CalculatedField";break;default:i=void 0}if(i)return i},Tyt.prototype.getUniqueName=function(e){for(var t=e,i=0,n=this.calculatedFieldSettings;i<n.length;i++){var o=n[i];if(e===(-1<o.formula.toLowerCase().indexOf("measure")?"[Measures].":o.hierarchyUniqueName+".")+"["+o.name+"]"){t=o.name;break}}return t},Tyt.prototype.updateFilterItems=function(e){for(var t=(t=Pe([],this.rows,null,!0)).concat(this.columns),i=0,n=e;i<n.length;i++){var o=n[i];if("Include"===o.type&&this.allowMemberFilter&&this.fieldList[o.name]){var r=this.fieldList[o.name].members,s=r&&0<Object.keys(r).length,a=(this.fieldList[o.name].actualFilter=o.items.slice(),Pe([],o.items,null,!0));if(s)for(var l=0;l<a.length;){for(var h=0,d=this.getParentNode(a[l],r,[]);h<d.length;h++){var p=d[h],p=Hdt.inArray(p,o.items);-1!==p&&o.items.splice(p,1)}l++}for(var c=[],u=0,g=o.items;u<g.length;u++){var m=g[u],f=void 0;s||1!==o.items.length||(this.getMembers(this.dataSourceSettings,o.name,void 0,void 0,void 0,o.items[0]),f=this.fieldList[o.name].actualFilter[0]),c.push(m),s?this.fieldList[o.name].filter.push(r[m].caption):this.fieldList[o.name].filter.push(f||m)}this.filterMembers[o.name]=c,this.fieldList[o.name].isExcelFilter=!1}else if((this.allowValueFilter||this.allowLabelFilter)&&-1!==["Date","Label","Number","Value"].indexOf(o.type))for(var y=0,v=t;y<v.length;y++)if(v[y].name===o.name){var b=this.filterMembers[o.name];b&&"object"==typeof b[0]&&b[0].type===o.type?b[b.length]=o:this.filterMembers[o.name]=[o],this.fieldList[o.name].isExcelFilter=!0;break}}},Tyt.prototype.getParentNode=function(e,t,i){return t[e].parent&&e!==t[e].parent&&(e=t[e].parent,i.push(e),this.getParentNode(e,t,i)),i},Tyt.prototype.updateDrilledItems=function(e){for(var t=[],i=(i=Pe([],this.rows,null,!0)).concat(this.columns),n=0,o=e;n<o.length;n++)for(var r=o[n],s=0,a=i;s<a.length;s++){var l=a[s];if(r.name===l.name){t.push(r);break}}return t},Tyt.prototype.getDrillThroughData=function(e,t){for(var i,n=this.tupColumnInfo[e.colOrdinal]&&this.tupColumnInfo[e.colOrdinal].uNameCollection&&""!==this.tupColumnInfo[e.colOrdinal].uNameCollection?this.tupColumnInfo[e.colOrdinal].uNameCollection.split("::[").map(function(e){return"["===e[0]?e:"["+e}):[],o=this.tupRowInfo[e.rowOrdinal]&&this.tupRowInfo[e.rowOrdinal].uNameCollection&&""!==this.tupRowInfo[e.rowOrdinal].uNameCollection?this.tupRowInfo[e.rowOrdinal].uNameCollection.split("::[").map(function(e){return"["===e[0]?e:"["+e}):[],r=[],s="",a=0;a<this.filters.length;a++)if(i=this.filterMembers[this.filters[a].name]){for(var l=0;l<i.length;l++)s+=i[l],s=l<i.length-1?s+",":s+"";r[a]=s,s=""}for(a=0;a<r.length;a++)s=""===s?"{"+r[a]+"}":s+",{"+r[a]+"}";for(var h="",d="",a=0;a<n.length;a++)h=(0<h.length?h+",":"")+(1<n[a].split("~~").length?n[a].split("~~")[n[a].split("~~").length-1]:n[a]);for(a=0;a<o.length;a++)d=(0<d.length?d+",":"")+(1<o[a].split("~~").length?o[a].split("~~")[o[a].split("~~").length-1]:o[a]);e=(e="DRILLTHROUGH MAXROWS "+t+" Select("+(0<h.length?h:"")+(0<h.length&&0<d.length?",":"")+(0<d.length?d:"")+") on 0 from "+(""===s?"["+this.dataSourceSettings.cube+"]":"(SELECT ("+s+") ON COLUMNS FROM ["+this.dataSourceSettings.cube+"])")).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;"),t=this.getSoapMsg(this.dataSourceSettings,e),e=this.getConnectionInfo(this.dataSourceSettings.url,this.dataSourceSettings.localeIdentifier);if(this.doAjaxPost("POST",e.url,t,this.drillThroughSuccess.bind(this),{dataSourceSettings:this.dataSourceSettings,action:"drillThrough"}),this.errorInfo)throw this.errorInfo},Tyt.prototype.drillThroughSuccess=function(e){var t=[].slice.call(e.querySelectorAll("row")),i="";if(0<t.length){for(var n=[],o=0;o<t.length;){for(var r=[].slice.call(t[o].children),s=0;s<r.length;)n.push('"'+r[s].tagName+'":"'+r[s].textContent+'"'),s++;o++}for(var a=n[0],l=0;l<n.length;)Object.keys(JSON.parse("[{"+n[l]+"}]")[0])[0]===Object.keys(JSON.parse("[{"+a+"}]")[0])[0]?i+=""===i?"[{"+n[l]:"}, {"+n[l]:i+=","+n[l],l++;i+="}]"}else for(var h=[].slice.call(e.querySelectorAll("faultstring")),o=0;o<h.length;)i+=h[o].textContent,o++;this.gridJSON=i},Tyt.prototype.getFilterMembers=function(e,t,i,n,o){var r=this.fieldList[t].levels,s=this.fieldList[t].levelCount,s=o?"Descendants({"+r[s].id+"}, "+r[i-1].id+", "+(i-s==1?"SELF)":"SELF_AND_BEFORE)"):t+", Descendants({"+r[0].id+"}, "+r[i-1].id+", SELF_AND_BEFORE)";return this.fieldList[t].levelCount=i,n||this.getMembers(e,t,!1,s,o),s},Tyt.prototype.getMembers=function(e,t,i,n,o,r){var s="DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE",a=this.fieldList[t].hasAllMember,l=(a?t:t+".LEVELS(0)").replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;"),i=i||r?r?"SELECT {"+(r=r.replace(/&/g,"&amp;"))+"} ON 0 FROM ["+e.cube+"] WHERE {}":"SELECT ({"+l+".ALLMEMBERS})"+s+" ON 0 FROM ["+e.cube+"]":"SELECT ({"+(n||(a?l+", "+l+".CHILDREN":l+".ALLMEMBERS"))+"})"+s+" ON 0 FROM ["+e.cube+"]",n=this.getSoapMsg(e,i),a=this.getConnectionInfo(e.url,e.localeIdentifier);if(o||(this.fieldList[t].filterMembers=[],this.fieldList[t].childMembers=[],this.fieldList[t].searchMembers=[],this.fieldList[t].members={},this.fieldList[t].currrentMembers={}),this.doAjaxPost("POST",a.url,n,(r?this.getOlapFilterText:this.generateMembers).bind(this),{dataSourceSettings:e,fieldName:t,loadLevelMembers:o,action:"fetchMembers"}),this.errorInfo)throw this.errorInfo},Tyt.prototype.getOlapFilterText=function(e,t,i){e=[].slice.call(e.querySelectorAll('Axis[name="Axis0"] Tuple'));0<e.length&&this.fieldList[i.fieldName]&&e[e.length-1].getElementsByTagName("Caption")&&e[e.length-1].getElementsByTagName("Caption")[0]&&(this.fieldList[i.fieldName].actualFilter[0]=e[e.length-1].getElementsByTagName("Caption")[0].textContent)},Tyt.prototype.getChildMembers=function(e,t,i){var t="SELECT ({"+t.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;")+".CHILDREN})DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE ON 0 FROM ["+e.cube+"]",t=this.getSoapMsg(e,t),n=this.getConnectionInfo(e.url,e.localeIdentifier);if(this.doAjaxPost("POST",n.url,t,this.generateMembers.bind(this),{dataSourceSettings:e,fieldName:i,action:"fetchChildMembers"}),this.errorInfo)throw this.errorInfo},Tyt.prototype.getCalcChildMembers=function(e,t){this.calcChildMembers=[];var t="SELECT ({"+t.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;")+".MEMBERS})DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE ON 0 FROM ["+e.cube+"]",i=this.getConnectionInfo(e.url,e.localeIdentifier),t=this.getSoapMsg(e,t);if(this.doAjaxPost("POST",i.url,t,this.generateMembers.bind(this),{dataSourceSettings:e,action:"fetchCalcChildMembers"}),this.errorInfo)throw this.errorInfo},Tyt.prototype.getSearchMembers=function(e,t,i,n,o,r){if(this.fieldList[t].searchMembers=[],this.fieldList[t].currrentMembers={},""!==i){var s=t.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;"),o="WITH SET [SearchMembersSet] AS &#39;FILTER("+(o?s+".ALLMEMBERS, ":"{"+(1<r?this.getFilterMembers(e,t,r,!0):s+", "+s+".CHILDREN")+"},")+"(INSTR(1, "+s+'.CurrentMember.member_caption, "'+i+'") > 0))&#39;SET [SearchParentsSet] AS &#39;GENERATE([SearchMembersSet], ASCENDANTS([SearchMembersSet].Current))&#39;SET [SearchSet] AS &#39;HIERARCHIZE(DISTINCT({[SearchMembersSet], [SearchParentsSet]}))&#39;SELECT SUBSET([SearchSet], 0, '+n+")DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE ON 0 FROM ["+e.cube+"]",r=this.getSoapMsg(e,o),s=this.getConnectionInfo(e.url,e.localeIdentifier);if(this.doAjaxPost("POST",s.url,r,this.generateMembers.bind(this),{dataSourceSettings:e,fieldName:t,action:"fetchSearchMembers"}),this.errorInfo)throw this.errorInfo}},Tyt.prototype.generateMembers=function(e,t,i){for(var n,e=[].slice.call(e.querySelectorAll('Axis[name="Axis0"] Tuple')),o=i.fieldName,r={},s=0,a=e;s<a.length;s++){var l,h=a[s],d=h.querySelector("Member"),p=d.querySelector("MEMBER_TYPE").textContent,c=d.querySelector("UName").textContent,u=d.querySelector("Caption").textContent,d=d.querySelector("PARENT_UNIQUE_NAME")?d.querySelector("PARENT_UNIQUE_NAME").textContent:"",g={"data-fieldName":o,"data-memberId":c};""===d&&"1"===p?(r={hasChildren:!!h.querySelector("CHILDREN_CARDINALITY")&&"0"!==h.querySelector("CHILDREN_CARDINALITY").textContent,isSelected:!1,id:c,tag:c,name:u,caption:u,htmlAttributes:g},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[o].members[c]={name:c,caption:u,parent:void 0,isNodeExpand:!1,isSelected:!1},this.fieldList[o].filterMembers.push(r),this.fieldList[o].childMembers.push(r)):"fetchSearchMembers"===i.action?(this.fieldList[o].currrentMembers[c]={name:c,caption:u,parent:void 0,isNodeExpand:!1,isSelected:!1},this.fieldList[o].searchMembers.push(r),r.expanded=!0):this.calcChildMembers.push(r)):""!==d&&"1"===p?d===n&&"1"===p?(r={hasChildren:!!h.querySelector("CHILDREN_CARDINALITY")&&"0"!==h.querySelector("CHILDREN_CARDINALITY").textContent,id:c,name:u,isSelected:!1,caption:u,htmlAttributes:g,tag:c},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[o].filterMembers.push(r),this.fieldList[o].childMembers.push(r),this.fieldList[o].members[c]={name:c,caption:u,parent:void 0,isNodeExpand:!1,isSelected:!1}):"fetchSearchMembers"===i.action?(r.expanded=!0,this.fieldList[o].searchMembers.push(r),this.fieldList[o].currrentMembers[c]={name:c,caption:u,parent:void 0,isNodeExpand:!1,isSelected:!1}):this.calcChildMembers.push(r)):"fetchMembers"===i.action&&this.fieldList[o].members[c]||(l=!!i.loadLevelMembers&&this.fieldList[o].members[d].isSelected,r={hasChildren:!!h.querySelector("CHILDREN_CARDINALITY")&&"0"!==h.querySelector("CHILDREN_CARDINALITY").textContent,htmlAttributes:g,isSelected:!1,id:c,pid:d,name:u,caption:u,tag:c},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[o].isHierarchy=!1,this.fieldList[o].filterMembers.push(r),this.fieldList[o].childMembers.push(r),this.fieldList[o].members[c]={name:c,caption:u,parent:d,isNodeExpand:!1,isSelected:l}):"fetchSearchMembers"===i.action?(this.fieldList[o].searchMembers.push(r),r.expanded=!0,this.fieldList[o].currrentMembers[c]={name:c,caption:u,parent:d,isNodeExpand:!1,isSelected:!1}):this.calcChildMembers.push(r)):"2"===p&&(n=c)}},Tyt.prototype.getFieldListItems=function(e,t,i){for(var n=[],o=0,r=[].slice.call(e.querySelectorAll("row"));o<r.length;o++){var s=r[o],a=0<[].slice.call(s.querySelectorAll("ALL_MEMBER")).length,l=s.querySelector("DIMENSION_UNIQUE_NAME").textContent,h=s.querySelector("HIERARCHY_UNIQUE_NAME").textContent,d=l===h&&"[measures]"!==l.toLowerCase()&&"[measures]"!==h.toLowerCase();n.push({pid:this.isMondrian||d?l+"~#^Dim":l,id:h,name:s.querySelector("HIERARCHY_CAPTION").textContent,caption:s.querySelector("HIERARCHY_CAPTION").textContent,tag:h,hasAllMember:a,allMember:a?s.querySelectorAll("ALL_MEMBER")[0].textContent:void 0,type:"string"})}this.fieldListObj={hierarchy:n,hierarchySuccess:e,measures:[]};e={catalog:i.dataSourceSettings.catalog,cube:i.dataSourceSettings.cube,url:i.dataSourceSettings.url,LCID:i.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_DIMENSIONS",roles:i.dataSourceSettings.roles};this.getTreeData(e,this.loadDimensionElements.bind(this),i)},Tyt.prototype.loadCalculatedMemberElements=function(e){if(0<e.length){var t=this.fieldListData,i={hasChildren:!0,isSelected:!1,id:"[Calculated Members].[_0]",name:"[Calculated Members].[_0]",caption:"Calculated Members",spriteCssClass:"e-calcMemberGroupCDB "+Tat,tag:"[Calculated Members].[_0]",type:"string"};0<t.length&&"[measures]"===t[0].id.toLowerCase()&&t.splice(0,0,i);for(var n=0,o=e;n<o.length;n++){var r,s,a,l,h=o[n];this.fieldList[h.name]||(s=(-1<(r=h.formula).toLowerCase().indexOf("measure")?"[Measures].":h.hierarchyUniqueName+".")+"["+h.name+"]",l=this.dataFields[h.name]&&this.dataFields[h.name].caption?this.dataFields[h.name].caption:this.mappingFields[h.name]&&this.mappingFields[h.name].caption?this.mappingFields[h.name].caption:h.name,a=h.formatString,l={hasChildren:!1,isSelected:!1,id:h.name,pid:"[Calculated Members].[_0]",name:h.name,caption:l,spriteCssClass:"e-calc-member "+(-1<r.toLowerCase().indexOf("measure")?"e-calc-measure-icon":"e-calc-dimension-icon")+" "+Tat,tag:s,formula:r,formatString:a,aggregateType:void 0,type:"CalculatedField",filter:[],dateMember:[],sort:"Ascending",actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},isHierarchy:!0,isExcelFilter:!1,isCalculatedField:!0,allowDragAndDrop:this.dataFields[h.name]?this.dataFields[h.name].allowDragAndDrop:!this.mappingFields[h.name]||this.mappingFields[h.name].allowDragAndDrop,showFilterIcon:this.dataFields[h.name]?this.dataFields[h.name].showFilterIcon:!this.mappingFields[h.name]||this.mappingFields[h.name].showFilterIcon,showSortIcon:this.dataFields[h.name]?this.dataFields[h.name].showSortIcon:!this.mappingFields[h.name]||this.mappingFields[h.name].showSortIcon,showEditIcon:this.dataFields[h.name]?this.dataFields[h.name].showEditIcon:!this.mappingFields[h.name]||this.mappingFields[h.name].showEditIcon,showRemoveIcon:this.dataFields[h.name]?this.dataFields[h.name].showRemoveIcon:!this.mappingFields[h.name]||this.mappingFields[h.name].showRemoveIcon,showValueTypeIcon:this.dataFields[h.name]?this.dataFields[h.name].showValueTypeIcon:!this.mappingFields[h.name]||this.mappingFields[h.name].showValueTypeIcon,showSubTotals:this.dataFields[h.name]?this.dataFields[h.name].showSubTotals:!this.mappingFields[h.name]||this.mappingFields[h.name].showSubTotals,fieldType:-1<r.toLowerCase().indexOf("measure")?"Measure":"Dimension",parentHierarchy:-1<r.toLowerCase().indexOf("measure")?void 0:h.hierarchyUniqueName},t.push(l),this.fieldList[l.id]=l,this.updateMembersOrder(h.name))}}},Tyt.prototype.loadDimensionElements=function(e,t,i){for(var n=[],o=[].slice.call(e.querySelectorAll("row")),r={},s=0,a=o;s<a.length;s++){var l=a[s],h=l.querySelector("DIMENSION_UNIQUE_NAME").textContent,d=l.querySelector("DEFAULT_HIERARCHY").textContent,p=l.querySelector("DIMENSION_CAPTION").textContent,d=h===d;0<=h.toLowerCase().indexOf("[measure")?r={hasChildren:!0,isSelected:!1,id:h,name:h,caption:p,spriteCssClass:"[measures]"===h.toLowerCase()?"e-measureGroupCDB-icon "+Tat:"e-dimensionCDB-icon "+Tat,tag:h,type:"string"}:je(o[0].querySelector("HIERARCHY_CAPTION"))&&n.push({hasChildren:!0,isSelected:!1,id:this.isMondrian||d?h+"~#^Dim":h,name:h,caption:p,spriteCssClass:"e-dimensionCDB-icon "+Tat,tag:h,defaultHierarchy:l.querySelector("DEFAULT_HIERARCHY").textContent,type:"string"})}n.splice(0,0,r),this.fieldListData=n;e={catalog:i.dataSourceSettings.catalog,cube:i.dataSourceSettings.cube,url:i.dataSourceSettings.url,LCID:i.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_SETS",roles:i.dataSourceSettings.roles};this.getTreeData(e,this.loadNamedSetElements.bind(this),i)},Tyt.prototype.loadNamedSetElements=function(e,t,i){for(var n=(n=Pe([],this.rows,null,!0)).concat(this.columns,this.filters),o=this.fieldListData,r=[],s=0,a=n;s<a.length;s++){var l=a[s];r.push(l.name)}for(var h=[],d=0,p=[].slice.call(e.querySelectorAll("row"));d<p.length;d++){var l=p[d],c=(0<=h.indexOf(l.querySelector("DIMENSIONS").textContent.split(".")[0])||(o.push({hasChildren:!0,isSelected:!1,pid:l.querySelector("DIMENSIONS").textContent.split(".")[0],id:l.querySelector("SET_DISPLAY_FOLDER").textContent+"_"+l.querySelector("DIMENSIONS").textContent.split(".")[0],name:l.querySelector("SET_DISPLAY_FOLDER").textContent,spriteCssClass:"e-folderCDB-icon e-icons namedSets",caption:l.querySelector("SET_DISPLAY_FOLDER").textContent,type:"string"}),h.push(l.querySelector("DIMENSIONS").textContent.split(".")[0])),"["+l.querySelector("SET_NAME").textContent.trim()+"]"),u={hasChildren:!0,isNamedSets:!0,isSelected:0<=r.indexOf("["+l.querySelector("SET_NAME").textContent+"]"),pid:l.querySelector("SET_DISPLAY_FOLDER").textContent+"_"+l.querySelector("DIMENSIONS").textContent.split(".")[0],id:c,name:l.querySelector("SET_CAPTION").textContent,caption:this.dataFields[c]&&this.dataFields[c].caption?this.dataFields[c].caption:this.mappingFields[c]&&this.mappingFields[c].caption?this.mappingFields[c].caption:l.querySelector("SET_CAPTION").textContent,spriteCssClass:"e-namedSetCDB-icon "+Tat,tag:l.querySelector("EXPRESSION").textContent,type:"string",filter:[],dateMember:[],actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},isHierarchy:!0,isExcelFilter:!1,allowDragAndDrop:this.dataFields[c]?this.dataFields[c].allowDragAndDrop:!this.mappingFields[c]||this.mappingFields[c].allowDragAndDrop,showFilterIcon:this.dataFields[c]?this.dataFields[c].showFilterIcon:!this.mappingFields[c]||this.mappingFields[c].showFilterIcon,showSortIcon:this.dataFields[c]?this.dataFields[c].showSortIcon:!this.mappingFields[c]||this.mappingFields[c].showSortIcon,showEditIcon:this.dataFields[c]?this.dataFields[c].showEditIcon:!this.mappingFields[c]||this.mappingFields[c].showEditIcon,showRemoveIcon:this.dataFields[c]?this.dataFields[c].showRemoveIcon:!this.mappingFields[c]||this.mappingFields[c].showRemoveIcon,showValueTypeIcon:this.dataFields[c]?this.dataFields[c].showValueTypeIcon:!this.mappingFields[c]||this.mappingFields[c].showValueTypeIcon,showSubTotals:this.dataFields[c]?this.dataFields[c].showSubTotals:!this.mappingFields[c]||this.mappingFields[c].showSubTotals};o.push(u),this.fieldList[c]=u,this.updateMembersOrder(c)}i.hierarchy=this.fieldListData,i.hierarchySuccess=this.fieldListObj.hierarchySuccess,this.loadHierarchyElements(i)},Tyt.prototype.loadHierarchyElements=function(e){for(var t=e.hierarchySuccess,i=e.hierarchy,n=[],o=0,r=Pe([],this.rows,null,!0).concat(this.columns,this.filters);o<r.length;o++){var s=r[o];n.push(s.name)}for(var a=0,l=[].slice.call(t.querySelectorAll("row"));a<l.length;a++){for(var h=(s=l[a]).querySelector("DIMENSION_UNIQUE_NAME").textContent,d=s.querySelector("HIERARCHY_UNIQUE_NAME").textContent,p=0<[].slice.call(s.querySelectorAll("ALL_MEMBER")).length,c=void 0,u=(c=p?(u=s.querySelectorAll("ALL_MEMBER")[0].textContent.replace(/[&[\]']+/g,"").split("."))[u.length-1].trim():void 0,s.querySelector("HIERARCHY_DISPLAY_FOLDER")?s.querySelector("HIERARCHY_DISPLAY_FOLDER").textContent:""),g=[],m=0,f=i;m<f.length;m++)(b=f[m]).tag===h&&g.push(b);if(0<g.length){var y=h===d&&"[measures]"!==h.toLowerCase()&&"[measures]"!==d.toLowerCase();if("[measures]"!==h.toLowerCase()&&"[measures]"!==d.toLowerCase()){var v=h+(this.isMondrian||y?"~#^Dim":"");if(""!==u){for(var b,w=h+(this.isMondrian||y?"~#^Dim":"")+"_"+u,C=[],S=0,A=i;S<A.length;S++)(b=A[S]).tag===w&&b.pid===v&&C.push(b);0===C.length&&(y={hasChildren:!0,isSelected:!1,pid:h+(this.isMondrian||y?"~#^Dim":""),id:w,name:u,spriteCssClass:"e-folderCDB-icon "+Tat,tag:w,caption:u,type:"string"},i.push(y)),v=w}y={hasChildren:!s.querySelector("HIERARCHY_ORIGIN")||"2"!==s.querySelector("HIERARCHY_ORIGIN").textContent&&"6"!==s.querySelector("HIERARCHY_ORIGIN").textContent,isSelected:0<=n.indexOf(d),pid:v,id:d,name:s.querySelector("HIERARCHY_CAPTION").textContent,spriteCssClass:(!s.querySelector("HIERARCHY_ORIGIN")||"2"!==s.querySelector("HIERARCHY_ORIGIN").textContent&&"6"!==s.querySelector("HIERARCHY_ORIGIN").textContent?"e-hierarchyCDB-icon":"e-attributeCDB-icon")+" "+Tat,hasAllMember:p,allMember:c,tag:d,caption:this.dataFields[d]&&this.dataFields[d].caption?this.dataFields[d].caption:this.mappingFields[d]&&this.mappingFields[d].caption?this.mappingFields[d].caption:s.querySelector("HIERARCHY_CAPTION").textContent,type:"string",filter:[],dateMember:[],sort:this.enableSort?this.sortObject[d]||"Ascending":"None",actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},levels:[],levelCount:1,isHierarchy:!!s.querySelector("HIERARCHY_ORIGIN")&&("2"===s.querySelector("HIERARCHY_ORIGIN").textContent||"6"===s.querySelector("HIERARCHY_ORIGIN").textContent),isExcelFilter:!1,allowDragAndDrop:this.dataFields[d]?this.dataFields[d].allowDragAndDrop:!this.mappingFields[d]||this.mappingFields[d].allowDragAndDrop,showFilterIcon:this.dataFields[d]?this.dataFields[d].showFilterIcon:!this.mappingFields[d]||this.mappingFields[d].showFilterIcon,showSortIcon:this.dataFields[d]?this.dataFields[d].showSortIcon:!this.mappingFields[d]||this.mappingFields[d].showSortIcon,showEditIcon:this.dataFields[d]?this.dataFields[d].showEditIcon:!this.mappingFields[d]||this.mappingFields[d].showEditIcon,showRemoveIcon:this.dataFields[d]?this.dataFields[d].showRemoveIcon:!this.mappingFields[d]||this.mappingFields[d].showRemoveIcon,showValueTypeIcon:this.dataFields[d]?this.dataFields[d].showValueTypeIcon:!this.mappingFields[d]||this.mappingFields[d].showValueTypeIcon,showSubTotals:this.dataFields[d]?this.dataFields[d].showSubTotals:!this.mappingFields[d]||this.mappingFields[d].showSubTotals};i.push(y),this.fieldList[d]=y,this.updateMembersOrder(d)}}}t={catalog:e.dataSourceSettings.catalog,cube:e.dataSourceSettings.cube,url:e.dataSourceSettings.url,LCID:e.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_LEVELS",roles:e.dataSourceSettings.roles};this.getTreeData(t,this.loadLevelElements.bind(this),e)},Tyt.prototype.updateMembersOrder=function(e){for(var t=0,i=this.sortSettings;t<i.length;t++){var n=i[t];if(e===n.name&&n.membersOrder){this.fieldList[e].membersOrder=n.membersOrder;break}}},Tyt.prototype.loadLevelElements=function(e,t,i){for(var n=[],o=this.fieldListData,n=[],r=0,s=[].slice.call(e.querySelectorAll("row"));r<s.length;r++){var a,l,h,d=s[r];1!==parseInt(d.querySelector("LEVEL_TYPE").textContent,10)&&"[measures]"!==d.querySelector("HIERARCHY_UNIQUE_NAME").textContent.toLowerCase()&&(a=d.querySelector("HIERARCHY_UNIQUE_NAME").textContent,h=d.querySelector("LEVEL_UNIQUE_NAME").textContent,l=d.querySelector("LEVEL_CAPTION").textContent,h={hasChildren:!1,isChecked:!1,isSelected:this.fieldList[a].isSelected,pid:a,id:h,name:l,tag:h,spriteCssClass:"e-level-members e-hierarchy-level-"+parseInt(d.querySelector("LEVEL_NUMBER").textContent,10)+"-icon "+Tat,caption:l,type:"string"},n.push(h),this.fieldList[a]&&this.fieldList[a].spriteCssClass&&-1===this.fieldList[a].spriteCssClass.indexOf("e-attributeCDB-icon")?(this.fieldList[a].levels.push(h),this.fieldList[a].isHierarchy=!1):this.fieldList[a].isHierarchy=!0)}this.fieldListData=o=o.concat(n);e={catalog:i.dataSourceSettings.catalog,cube:i.dataSourceSettings.cube,url:i.dataSourceSettings.url,LCID:i.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_MEASURES",roles:i.dataSourceSettings.roles};this.getTreeData(e,this.loadMeasureElements.bind(this),i)},Tyt.prototype.loadMeasureElements=function(e,t,i){for(var n,o,r=this.fieldListData,s=[],a=[],l=0,h=Pe([],this.values,null,!0);l<h.length;l++){var d=h[l];a.push(d.name)}"en-US"!==this.locale&&(o={catalog:i.dataSourceSettings.catalog,cube:i.dataSourceSettings.cube,url:i.dataSourceSettings.url,LCID:i.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_MEASUREGROUPS",roles:i.dataSourceSettings.roles},this.getTreeData(o,this.loadMeasureGroups.bind(this),i));for(var p=0,c=[].slice.call(e.querySelectorAll("row"));p<c.length;p++){var u=je((d=c[p]).querySelector("MEASUREGROUP_NAME"))?"":d.querySelector("MEASUREGROUP_NAME").textContent,g=d.querySelector("MEASURE_UNIQUE_NAME").textContent,m=d.querySelector("DEFAULT_FORMAT_STRING")?d.querySelector("DEFAULT_FORMAT_STRING").textContent:"#,#",f=d.querySelector("MEASURE_AGGREGATOR")?d.querySelector("MEASURE_AGGREGATOR").textContent:"1";if(!(0<=s.indexOf(u))){if("en-US"!==this.locale){for(var y=[],v=0,b=this.fieldListObj.measuresGroups;v<b.length;v++){var w=b[v];w.querySelector("MEASUREGROUP_NAME").textContent===u&&y.push(w)}n=0<y.length?y[0].querySelector("MEASUREGROUP_CAPTION").textContent:u}else n=u;""!==u&&(r.push({hasChildren:!0,isChecked:!1,isSelected:!1,pid:"[Measures]",id:u,name:n,spriteCssClass:"e-measureCDB e-folderCDB-icon "+Tat,tag:u,caption:n,aggregateType:this.getAggregateType(u,f),type:"string"}),s.push(u))}f={hasChildren:!1,isSelected:0<=a.indexOf(g),pid:""===u?"[Measures]":u,id:g,name:d.querySelector("MEASURE_CAPTION").textContent,spriteCssClass:"e-measure-icon "+Tat,tag:g,caption:this.dataFields[g]&&this.dataFields[g].caption?this.dataFields[g].caption:this.mappingFields[g]&&this.mappingFields[g].caption?this.mappingFields[g].caption:d.querySelector("MEASURE_CAPTION").textContent,aggregateType:this.getAggregateType(g,f),type:"number",filter:[],actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},formatString:m,allowDragAndDrop:this.dataFields[g]?this.dataFields[g].allowDragAndDrop:!this.mappingFields[g]||this.mappingFields[g].allowDragAndDrop,showFilterIcon:this.dataFields[g]?this.dataFields[g].showFilterIcon:!this.mappingFields[g]||this.mappingFields[g].showFilterIcon,showSortIcon:this.dataFields[g]?this.dataFields[g].showSortIcon:!this.mappingFields[g]||this.mappingFields[g].showSortIcon,showEditIcon:this.dataFields[g]?this.dataFields[g].showEditIcon:!this.mappingFields[g]||this.mappingFields[g].showEditIcon,showRemoveIcon:this.dataFields[g]?this.dataFields[g].showRemoveIcon:!this.mappingFields[g]||this.mappingFields[g].showRemoveIcon,showValueTypeIcon:this.dataFields[g]?this.dataFields[g].showValueTypeIcon:!this.mappingFields[g]||this.mappingFields[g].showValueTypeIcon,showSubTotals:this.dataFields[g]?this.dataFields[g].showSubTotals:!this.mappingFields[g]||this.mappingFields[g].showSubTotals};r.push(f),this.fieldList[g]=f,0<=a.indexOf(g)&&a.splice(a.indexOf(g),1)}this.measureReportItems=a},Tyt.prototype.loadMeasureGroups=function(e){je(this.fieldListObj)&&(this.fieldListObj={}),this.fieldListObj.measuresGroups=[].slice.call(e.querySelectorAll("row"))},Tyt.prototype.doAjaxPost=function(e,t,i,n,o){var r=this;new ze({mode:!1,contentType:"text/xml",url:t,data:i,dataType:"xml",type:e,beforeSend:this.beforeSend.bind(this),onSuccess:function(e,t){var e=(new DOMParser).parseFromString(e,"text/xml"),i=e.querySelector("Body");i.querySelector("OlapInfo")||i.querySelector("DiscoverResponse")||(i.querySelector("Fault")&&i.querySelector("Fault").querySelector("faultstring")?r.errorInfo=i.querySelector("Fault").querySelector("faultstring").innerHTML:i.querySelector("return")&&i.querySelector("return").querySelector("Error")&&(r.errorInfo=i.querySelector("return").querySelector("Error").getAttribute("Description"))),n(e,t,o)},onFailure:function(e){r.errorInfo=e}}).send()},Tyt.prototype.beforeSend=function(e){this.dataSourceSettings.authentication.userName&&this.dataSourceSettings.authentication.password&&e.httpRequest.setRequestHeader("Authorization","Basic "+btoa(this.dataSourceSettings.authentication.userName+":"+this.dataSourceSettings.authentication.password))},Tyt.prototype.getSoapMsg=function(e,t){var i=this.getConnectionInfo(e.url,e.localeIdentifier);return this.isMondrian?'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><Execute xmlns="urn:schemas-microsoft-com:xml-analysis"><Command><Statement><![CDATA['+t+"]]></Statement></Command><Properties><PropertyList><DataSourceInfo></DataSourceInfo><Catalog>"+e.catalog+"</Catalog><AxisFormat>TupleFormat</AxisFormat><Content>Data</Content><Format>Multidimensional</Format></PropertyList></Properties></Execute></SOAP-ENV:Body></SOAP-ENV:Envelope>":'<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Header></Header> <Body> <Execute xmlns="urn:schemas-microsoft-com:xml-analysis"> <Command> <Statement> '+t+" </Statement> </Command> <Properties> <PropertyList> <Catalog>"+e.catalog+"</Catalog> <LocaleIdentifier>"+i.LCID+"</LocaleIdentifier>"+(e.roles?"<Roles>"+e.roles+"</Roles>":"")+"</PropertyList> </Properties> </Execute> </Body> </Envelope>"},Tyt.prototype.getConnectionInfo=function(e,t){var i={url:"",LCID:je(t)?"1033":t.toString()};if(""!==e)for(var n=0,o=e.split(";");n<o.length;n++){var r=o[n];r.toLowerCase().indexOf("locale")<0&&0===i.url.length?i.url=r:0<=r.toLowerCase().indexOf("locale")&&(i.LCID=r.replace(/ /g,"").split("=")[1])}return i},Tyt.prototype.getMDXQuery=function(e){return Ayt.getCellSets(e,this,!0,void 0,!0),this.mdxQuery};var Iyt=Tyt;function Tyt(){this.fieldList={},this.columnCount=0,this.rowCount=0,this.colFirstLvl=0,this.rowFirstLvl=0,this.pageColStartPos=0,this.enableSort=!1,this.enableValueSorting=!1,this.dataFields={},this.formatFields={},this.filterMembers={},this.drilledSets={},this.isExporting=!1,this.aggregatedValueMatrix=[],this.mappingFields={},this.formatRegex=/^(?:[ncpae])(?:([0-9]|1[0-9]|20))?$/i,this.clonedValTuple=[],this.clonedColumnTuple=[],this.clonedRowTuple=[],this.pivotValues=[],this.valueContent=[],this.headerContent=[],this.rowStartPos=0,this.pageRowStartPos=0,this.tupColumnInfo=[],this.tupRowInfo=[],this.gridJSON="",this.namedSetsPosition={},this.colDepth=0,this.totalCollection=[],this.parentObjCollection={},this.curDrillEndPos=-1,this.headerGrouping={},this.lastLevel=[],this.showRowSubTotals=!0,this.showColumnSubTotals=!0,this.hideRowTotalsObject={},this.hideColumnTotalsObject={},this.sortObject={},this.isColDrill=!1}Dyt.prototype.drawHeader=function(e,t){var i=t.pageSettings.size,e=e.header,n=new ed(0,e&&e.fromTop?e.fromTop:0),i=new td(i.width-80,e&&e.height?.75*e.height:50),n=new id(n,i);t.template.top=this.drawPageTemplate(new Gy(n),e)},Dyt.prototype.drawFooter=function(e,t){var i=t.pageSettings.size,e=e.footer,n=new ed(0,i.width-80-(e&&e.fromBottom?.75*e.fromBottom:0)),i=new td(i.width-80,e&&e.height?.75*e.height:50),n=new id(n,i);t.template.bottom=this.drawPageTemplate(new Gy(n),e)},Dyt.prototype.drawPageTemplate=function(e,t){for(var i=0,n=t.contents;i<n.length;i++){var o=n[i];switch(this.processContentValidation(o),o.type){case"Text":if(""===o.value||je(o.value)||"string"!=typeof o.value)throw new Error("please enter the valid input value in text content...");this.drawText(e,o);break;case"PageNumber":this.drawPageNumber(e,o);break;case"Image":if(je(o.src)||""===o.src)throw new Error("please enter the valid base64 string in image content...");this.drawImage(e,o);break;case"Line":this.drawLine(e,o)}}return e},Dyt.prototype.processContentValidation=function(e){if(je(e.type))throw new Error("please set valid content type...");if("Line"===e.type){if(je(e.points))throw new Error("please enter valid points in "+e.type+" content...");if(je(e.points.x1)||"number"!=typeof e.points.x1)throw new Error("please enter valid x1 co-ordinate in "+e.type+" points...");if(je(e.points.y1)||"number"!=typeof e.points.y1)throw new Error("please enter valid y1 co-ordinate in "+e.type+" points...");if(je(e.points.x2)||"number"!=typeof e.points.x2)throw new Error("please enter valid x2 co-ordinate in "+e.type+" points...");if(je(e.points.y2)||"number"!=typeof e.points.y2)throw new Error("please enter valid y2 co-ordinate in "+e.type+" points...")}else{if(je(e.position))throw new Error("please enter valid position in "+e.type+" content...");if(je(e.position.x)||"number"!=typeof e.position.x)throw new Error("please enter valid x co-ordinate in "+e.type+" position...");if(je(e.position.y)||"number"!=typeof e.position.y)throw new Error("please enter valid y co-ordinate in "+e.type+" position...")}},Dyt.prototype.drawText=function(e,t){var i=this.getFontFromContent(t),n=this.getBrushFromContent(t),o=null,r=(je(t.style)||je(t.style.textPenColor)||(r=this.hexDecToRgb(t.style.textPenColor),o=new Ep(new se(r.r,r.g,r.b))),null==n&&null==o&&(n=new Sd(new se(0,0,0))),t.value.toString()),s=.75*t.position.x,a=.75*t.position.y,l=new xd,t=(je(t.stringFormat)||(l=t.stringFormat),this.setContentFormat(t,l));null===t||je(t.format)||je(t.size)?e.graphics.drawString(r,i,o,n,s,a,l):e.graphics.drawString(r,i,o,n,s,a,t.size.width,t.size.height,t.format)},Dyt.prototype.drawPageNumber=function(e,t){var i,n,o,r=this.getFontFromContent(t),s=null,a=(s=je(t.style)||je(t.style.textBrushColor)?new Sd(new se(0,0,0)):(a=this.hexDecToRgb(t.style.textBrushColor),new Sd(new se(a.r,a.g,a.b))),new vm(r,s)),a=(a.numberStyle=this.getPageNumberStyle(t.pageNumberType),o=je(t.format)?new Sm(r,s,n="{0}",a):(o="$current",-1!==t.format.indexOf(l="$total")&&-1!==t.format.indexOf(o)?((i=new km(r)).numberStyle=this.getPageNumberStyle(t.pageNumberType),n=t.format.indexOf(l)>t.format.indexOf(o)?(n=t.format.replace(o,"0")).replace(l,"1"):(n=t.format.replace(o,"1")).replace(l,"0"),new Sm(r,s,n,a,i)):-1!==t.format.indexOf(o)&&-1===t.format.indexOf(l)?(n=t.format.replace(o,"0"),new Sm(r,s,n,a)):(i=new km(r),n=t.format.replace(l,"0"),new Sm(r,s,n,i))),.75*t.position.x),l=.75*t.position.y,r=this.setContentFormat(t,o.stringFormat);null===r||je(r.format)||je(r.size)||(o.stringFormat=r.format,o.bounds=new id(a,l,r.size.width,r.size.height)),o.draw(e.graphics,a,l)},Dyt.prototype.drawImage=function(e,t){var i=.75*t.position.x,n=.75*t.position.y,o=je(t.size)||je(t.size.width)?void 0:.75*t.size.width,r=je(t.size)||je(t.size.height)?void 0:.75*t.size.height,t=new oc(t.src);je(o)?e.graphics.drawImage(t,i,n):e.graphics.drawImage(t,i,n,o,r)},Dyt.prototype.drawLine=function(e,t){var i=.75*t.points.x1,n=.75*t.points.y1,o=.75*t.points.x2,r=.75*t.points.y2,s=this.getPenFromContent(t);je(t.style)||(je(t.style.penSize)||"number"!=typeof t.style.penSize||(s.width=.75*t.style.penSize),s.dashStyle=this.getDashStyle(t.style.dashStyle)),e.graphics.drawLine(s,i,n,o,r)},Dyt.prototype.getFontFromContent=function(e){var t=je(e.font)||je(e.font.fontSize)?je(e.style)||je(e.style.fontSize)?9.75:.75*e.style.fontSize:.75*e.font.fontSize,i=je(e.font)||je(e.font.pdfFontFamily)?dd.TimesRoman:e.font.pdfFontFamily,n=hd.Regular;return je(e.font)||je(e.font.bold)||(n|=hd.Bold),je(e.font)||je(e.font.italic)||(n|=hd.Italic),je(e.font)||je(e.font.underline)||(n|=hd.Underline),je(e.font)||je(e.font.strikeout)||(n|=hd.Strikeout),new cg(i,t,n)},Dyt.prototype.getPenFromContent=function(e){var t=new Ep(new se(0,0,0));return je(e.style)||null===e.style||je(e.style.penColor)||(e=this.hexDecToRgb(e.style.penColor),t=new Ep(new se(e.r,e.g,e.b))),t},Dyt.prototype.getBrushFromContent=function(e){var t=null;return je(e.style)||je(e.style.textBrushColor)||(e=this.hexDecToRgb(e.style.textBrushColor),t=new Sd(new se(e.r,e.g,e.b))),t},Dyt.prototype.setContentFormat=function(e,t){if(je(e.size))return null;var i=.75*e.size.width,n=.75*e.size.height;if(t=new xd(Hh.Left,_h.Middle),!je(e.style)&&!je(e.style.hAlign))switch(e.style.hAlign){case"Right":t.alignment=Hh.Right;break;case"Center":t.alignment=Hh.Center;break;case"Justify":t.alignment=Hh.Justify}if(!je(e.style)&&!je(e.style.vAlign))switch(e.style.vAlign){case"Bottom":t.lineAlignment=_h.Bottom;break;case"Top":t.lineAlignment=_h.Top}return{format:t,size:new td(i,n)}},Dyt.prototype.getPageNumberStyle=function(e){switch(e){case"LowerLatin":return 2;case"LowerRoman":return 3;case"UpperLatin":return 4;case"UpperRoman":return 5;default:return 1}},Dyt.prototype.getDashStyle=function(e){switch(e){case"Dash":return 1;case"Dot":return 2;case"DashDot":return 3;case"DashDotDot":return 4;default:return 0}},Dyt.prototype.hexDecToRgb=function(e){if(null===e||""===e||7!==e.length)throw new Error("please set valid hex value for color..");e=e.substring(1);e=parseInt(e,16);return{r:e>>16&255,g:e>>8&255,b:255&e}};var Eyt=Dyt;function Dyt(){}kyt.prototype.getModuleName=function(){return"chartExport"},kyt.prototype.pdfChartExport=function(i,n,o,r){var s=this,e=[this.parent.chart],e=this.getChartInfo(e),a=e.width,l=e.height,h=this.parent.chart.svgObject,d=(this.parent.chart.enableCanvas||(h=Q("canvas",{id:"ej2-canvas",attrs:{width:a.toString(),height:l.toString()}})),window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(e.svg)],{type:"image/svg+xml"}))),p=new Image,c=h.getContext("2d");return p.src=d,new Promise(function(t){p.onload=function(){var e=je(n)?new sg:n;c.drawImage(p,0,0),window.URL.revokeObjectURL(d),s.exportPdf(h,e,o,r,a,l,i),t(e)}})},kyt.prototype.getChartInfo=function(e,n){var o,r=0,s=0,a=this.parent.chart.enableCanvas,l=new fo("").createSvg({id:"Svg_Export_Element",width:200,height:200});return e.map(function(e){var t=e.svgObject.cloneNode(!0),i=e.renderer.createGroup({style:je(n)||n?"transform: translateY("+s+"px)":"transform: translateX("+r+"px)"});"transparent"===(o=t.childNodes[0]?t.childNodes[0].getAttribute("fill"):"transparent")&&(o=-1<e.theme.indexOf("Dark")||"HighContrast"===e.theme?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)"),a||i.appendChild(t),r=e.availableSize.width,s=e.availableSize.height,a||l.appendChild(i)}),a||(l.setAttribute("width",r+""),l.setAttribute("height",s+""),l.setAttribute("style","background-color: "+o+";")),{width:r,height:s,svg:l}},kyt.prototype.exportPdf=function(e,t,i,n,o,r,s){var a,l=t.sections.add(),h=t.pageSettings.width,d=t.pageSettings.height,p=t.pageSettings.margins,o=o+p.left+p.right,p=(t.pageSettings.size=new td(o,d),this.exportProperties.fileName||(je(s)||je(s.fileName)?"default":s.fileName)),d=(this.exportProperties.width||this.exportProperties.height?(t.pageSettings.orientation=this.exportProperties.width>this.exportProperties.height||!this.exportProperties.height&&this.exportProperties.width>d||!this.exportProperties.width&&h>this.exportProperties.height?up.Landscape:up.Portrait,t.pageSettings.size=new td(this.exportProperties.width||h,this.exportProperties.height||d)):(t.pageSettings.orientation=0===this.exportProperties.orientation||this.exportProperties.orientation?this.exportProperties.orientation:je(s)||je(s.pageOrientation)||"Landscape"===s.pageOrientation?up.Landscape:up.Portrait,je(s)||je(s.pageSize)||(t.pageSettings.size=Hdt.getPageSize(s.pageSize))),je(this.exportProperties.pdfMargins)||((h=t.pageSettings.margins).top=(je(this.exportProperties.pdfMargins.top)?h:this.exportProperties.pdfMargins).top,h.bottom=(je(this.exportProperties.pdfMargins.bottom)?h:this.exportProperties.pdfMargins).bottom,h.left=(je(this.exportProperties.pdfMargins.left)?h:this.exportProperties.pdfMargins).left,h.right=(je(this.exportProperties.pdfMargins.right)?h:this.exportProperties.pdfMargins).right),l.setPageSettings(t.pageSettings),t.pageSettings.height),h=(h=e.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream")).slice(h.indexOf(",")+1),e=new oc(h),h=l.pages.add(),l=(je(s)||je(s.header)||this.pdfExportHelper.drawHeader(s,t),je(s)||je(s.footer)||this.pdfExportHelper.drawFooter(s,t),h.graphics.drawImage(e,0,0,d<r||this.exportProperties.width||t.pageSettings.size?h.getClientSize().width:o,d<r?h.getClientSize().height:r),n||i?n&&(a=t.save()):(t.save(p+".pdf"),t.destroy()),{type:"PDF",promise:n?a:null});return this.parent.trigger(Kdt,l),new Promise(function(){})},kyt.prototype.destroy=function(){this.exportProperties&&(this.exportProperties=null),this.pdfExportHelper&&(this.pdfExportHelper=null)};var Myt=kyt;function kyt(e){this.parent=e,this.pdfExportHelper=new Eyt}Pyt=function(e,t){return(Pyt=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])}))(e,t)};var Pyt,Byt,Rmt=function(e,t){function i(){this.constructor=e}Pyt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},sft=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},hft=(Rmt(Fyt,Byt=n),sft([e(!0)],Fyt.prototype,"showFilterIcon",void 0),sft([e(!0)],Fyt.prototype,"showSortIcon",void 0),sft([e(!0)],Fyt.prototype,"showRemoveIcon",void 0),sft([e(!0)],Fyt.prototype,"showValueTypeIcon",void 0),sft([e("Both")],Fyt.prototype,"displayMode",void 0),sft([e(!0)],Fyt.prototype,"allowDragAndDrop",void 0),sft([e(!1)],Fyt.prototype,"showFieldsPanel",void 0),Fyt);function Fyt(){return null!==Byt&&Byt.apply(this,arguments)||this}Rmt(Ryt,Lyt=n),sft([e(!1)],Ryt.prototype,"allowAdding",void 0),sft([e(!1)],Ryt.prototype,"allowEditing",void 0),sft([e(!1)],Ryt.prototype,"allowDeleting",void 0),sft([e(!1)],Ryt.prototype,"allowCommandColumns",void 0),sft([e(!1)],Ryt.prototype,"allowInlineEditing",void 0),sft([e("Normal")],Ryt.prototype,"mode",void 0),sft([e(!0)],Ryt.prototype,"allowEditOnDblClick",void 0),sft([e(!0)],Ryt.prototype,"showConfirmDialog",void 0),sft([e(!1)],Ryt.prototype,"showDeleteConfirmDialog",void 0);var Lyt,cft=Ryt;function Ryt(){return null!==Lyt&&Lyt.apply(this,arguments)||this}Rmt(Nyt,Oyt=n),sft([e()],Nyt.prototype,"measure",void 0),sft([e()],Nyt.prototype,"label",void 0),sft([e("NotEquals")],Nyt.prototype,"conditions",void 0),sft([e()],Nyt.prototype,"value1",void 0),sft([e()],Nyt.prototype,"value2",void 0);var Oyt,mft=Nyt;function Nyt(){return null!==Oyt&&Oyt.apply(this,arguments)||this}Rmt(_yt,Vyt=n),sft([e(!1)],_yt.prototype,"showHyperlink",void 0),sft([e(!1)],_yt.prototype,"showRowHeaderHyperlink",void 0),sft([e(!1)],_yt.prototype,"showColumnHeaderHyperlink",void 0),sft([e(!1)],_yt.prototype,"showValueCellHyperlink",void 0),sft([e(!1)],_yt.prototype,"showSummaryCellHyperlink",void 0),sft([kt([],mft)],_yt.prototype,"conditionalSettings",void 0),sft([e()],_yt.prototype,"headerText",void 0),sft([e("")],_yt.prototype,"cssClass",void 0);var Vyt,vft=_yt;function _yt(){return null!==Vyt&&Vyt.apply(this,arguments)||this}Rmt(zyt,Hyt=n),sft([e(5)],zyt.prototype,"columnPageSize",void 0),sft([e(5)],zyt.prototype,"rowPageSize",void 0),sft([e(1)],zyt.prototype,"currentColumnPage",void 0),sft([e(1)],zyt.prototype,"currentRowPage",void 0);var Hyt,Rft=zyt;function zyt(){return null!==Hyt&&Hyt.apply(this,arguments)||this}Rmt(Wyt,jyt=n),sft([e("Bottom")],Wyt.prototype,"position",void 0),sft([e(!1)],Wyt.prototype,"isInversed",void 0),sft([e(!0)],Wyt.prototype,"showRowPager",void 0),sft([e(!0)],Wyt.prototype,"showColumnPager",void 0),sft([e(!0)],Wyt.prototype,"showRowPageSize",void 0),sft([e(!0)],Wyt.prototype,"showColumnPageSize",void 0),sft([e([10,50,100,200])],Wyt.prototype,"rowPageSizes",void 0),sft([e([5,10,20,50,100])],Wyt.prototype,"columnPageSizes",void 0),sft([e(!1)],Wyt.prototype,"enableCompactView",void 0),sft([e()],Wyt.prototype,"template",void 0);var jyt,Tft=Wyt;function Wyt(){return null!==jyt&&jyt.apply(this,arguments)||this}Rmt(Uyt,Qyt=n),sft([e("Table")],Uyt.prototype,"view",void 0),sft([e("Table")],Uyt.prototype,"primary",void 0);var Qyt,Vft=Uyt;function Uyt(){return null!==Qyt&&Qyt.apply(this,arguments)||this}Rmt(Gyt,qyt=n),sft([e(!1)],Gyt.prototype,"allowSinglePage",void 0);var qyt,Bft=Gyt;function Gyt(){return null!==qyt&&qyt.apply(this,arguments)||this}Rmt(Kyt,Yyt=Ji),Kyt.prototype.requiredModules=function(){var e=[];return this.showGroupingBar&&e.push({args:[this],member:"groupingBar"}),this.allowConditionalFormatting&&e.push({args:[this],member:"conditionalFormatting"}),this.allowNumberFormatting&&e.push({args:[this],member:"numberFormatting"}),this.allowCalculatedField&&e.push({args:[this],member:"calculatedField"}),this.showToolbar&&(0<this.toolbar.length||this.toolbarTemplate)&&e.push({args:[this],member:"toolbar"}),this.showFieldList&&e.push({args:[this],member:"fieldList"}),this.allowExcelExport&&e.push({args:[this],member:"excelExport"}),this.allowPdfExport&&e.push({args:[this],member:"pdfExport"}),this.enableVirtualization&&e.push({args:[this],member:"virtualscroll"}),this.allowGrouping&&e.push({args:[this],member:"grouping"}),(this.allowDrillThrough||this.editSettings&&this.editSettings.allowEditing)&&e.push({args:[this],member:"drillThrough"}),this.enablePaging&&e.push({args:[this],member:"pager"}),e},Kyt.prototype.preRender=function(){this.dataSourceSettings&&"SSAS"===this.dataSourceSettings.providerType?(this.dataType="olap",this.olapEngineModule=new Iyt):(this.dataType="pivot",this.engineModule=new Wdt),this.isAdaptive=F.isDevice,F.isIE||"edge"===F.info.name?this.scrollerBrowserLimit=15e5:"chrome"===F.info.name&&(this.scrollerBrowserLimit=15e6),this.isTouchMode=!!z(this.element,"e-bigger"),this.initProperties(),this.renderToolTip(),this.keyboardModule=new pmt(this),this.contextMenuModule=new umt(this),this.globalize=new Ti(this.locale),(this.showFieldList||this.showGroupingBar||this.allowNumberFormatting||this.allowCalculatedField||this.toolbar&&this.showToolbar||this.allowGrouping||this.gridSettings.contextMenuItems||this.allowDrillThrough)&&(this.commonModule=new Mgt(this)),!this.allowPdfExport||"Both"!==this.displayOption.view&&"Chart"!==this.displayOption.view||(this.chartExportModule=new Myt(this)),this.defaultLocale={applyToGrandTotal:"Apply to Grand Total",grandTotal:"Grand Total",total:"Total",value:"Value",noValue:"No value",row:"Row",column:"Column",collapse:"Collapse",expand:"Expand",rowAxisPrompt:"Drop row here",columnAxisPrompt:"Drop column here",valueAxisPrompt:"Drop value here",filterAxisPrompt:"Drop filter here",filter:"Filter",filtered:"Filtered",sort:"Sort",filters:"Filters",rows:"Rows",columns:"Columns",values:"Values",close:"Close",cancel:"Cancel",delete:"Delete",CalculatedField:"Calculated Field",createCalculatedField:"Create Calculated Field",fieldName:"Enter the field name",error:"Error",invalidFormula:"Invalid formula.",dropText:'Example: ("Sum(Order_Count)" + "Sum(In_Stock)") * 250',dropTextMobile:"Add fields and edit formula here.",dropAction:"Calculated field cannot be place in any other region except value axis.",alert:"Alert",warning:"Warning",ok:"OK",search:"Search",drag:"Drag",remove:"Remove",allFields:"All Fields",formula:"Formula",addToRow:"Add to Row",addToColumn:"Add to Column",addToValue:"Add to Value",addToFilter:"Add to Filter",emptyData:"No records to display",fieldExist:"A field already exists in this name. Please enter a different name.",confirmText:"A calculation field already exists in this name. Do you want to replace it?",noMatches:"No matches",format:"Summaries values by",edit:"Edit",clear:"Clear",sortAscending:"Sort ascending order",sortDescending:"Sort descending order",sortNone:"Sort data order",clearCalculatedField:"Clear edited field info",editCalculatedField:"Edit calculated field",formulaField:"Drag and drop fields to formula",dragField:"Drag field to formula",clearFilter:"Clear",by:"by",all:"All",multipleItems:"Multiple items",member:"Member",label:"Label",date:"Date",enterValue:"Enter value",chooseDate:"Enter date",Before:"Before",BeforeOrEqualTo:"Before Or Equal To",After:"After",AfterOrEqualTo:"After Or Equal To",labelTextContent:"Show the items for which the label",dateTextContent:"Show the items for which the date",valueTextContent:"Show the items for which",Equals:"Equals",DoesNotEquals:"Does Not Equal",BeginWith:"Begins With",DoesNotBeginWith:"Does Not Begin With",EndsWith:"Ends With",DoesNotEndsWith:"Does Not End With",Contains:"Contains",DoesNotContains:"Does Not Contain",GreaterThan:"Greater Than",GreaterThanOrEqualTo:"Greater Than Or Equal To",LessThan:"Less Than",LessThanOrEqualTo:"Less Than Or Equal To",Between:"Between",NotBetween:"Not Between",And:"and",Sum:"Sum",Count:"Count",DistinctCount:"Distinct Count",Product:"Product",Avg:"Avg",Median:"Median",Min:"Min",SampleVar:"Sample Var",PopulationVar:"Population Var",RunningTotals:"Running Totals",Max:"Max",Index:"Index",SampleStDev:"Sample StDev",PopulationStDev:"Population StDev",PercentageOfRowTotal:"% of Row Total",PercentageOfParentTotal:"% of Parent Total",PercentageOfParentColumnTotal:"% of Parent Column Total",PercentageOfParentRowTotal:"% of Parent Row Total",DifferenceFrom:"Difference From",PercentageOfDifferenceFrom:"% of Difference From",PercentageOfGrandTotal:"% of Grand Total",PercentageOfColumnTotal:"% of Column Total",MoreOption:"More...",NotEquals:"Not Equals",AllValues:"All Values",conditionalFormatting:"Conditional Formatting",apply:"Apply",condition:"Add Condition",formatLabel:"Format",valueFieldSettings:"Value field settings",baseField:"Base field",baseItem:"Base item",summarizeValuesBy:"Summarize values by",sourceName:"Field name :",sourceCaption:"Field caption",example:"e.g:",editorDataLimitMsg:" more items. Search to refine further.",details:"Details",manageRecords:"Manage Records",Years:"Years",Quarters:"Quarters",Months:"Months",Days:"Days",Hours:"Hours",Minutes:"Minutes",Seconds:"Seconds",save:"Save a report",new:"Create a new report",load:"Load",saveAs:"Save as current report",rename:"Rename a current report",deleteReport:"Delete a current report",export:"Export",subTotals:"Sub totals",grandTotals:"Grand totals",reportName:"Report Name :",pdf:"PDF",excel:"Excel",csv:"CSV",png:"PNG",jpeg:"JPEG",svg:"SVG",mdxQuery:"MDX Query",showSubTotals:"Show subtotals",doNotShowSubTotals:"Do not show subtotals",showSubTotalsRowsOnly:"Show subtotals rows only",showSubTotalsColumnsOnly:"Show subtotals columns only",showGrandTotals:"Show grand totals",doNotShowGrandTotals:"Do not show grand totals",showGrandTotalsRowsOnly:"Show grand totals rows only",showGrandTotalsColumnsOnly:"Show grand totals columns only",fieldList:"Show fieldlist",grid:"Show table",toolbarFormatting:"Conditional formatting",chart:"Chart",reportMsg:"Please enter valid report name!!!",reportList:"Report list",removeConfirm:"Are you sure you want to delete this report?",emptyReport:"No reports found!!",bar:"Bar",pie:"Pie",funnel:"Funnel",doughnut:"Doughnut",pyramid:"Pyramid",stackingcolumn:"Stacked Column",stackingarea:"Stacked Area",stackingbar:"Stacked Bar",stackingline:"Stacked Line",stepline:"Step Line",steparea:"Step Area",splinearea:"Spline Area",spline:"Spline",stackingcolumn100:"100% Stacked Column",stackingbar100:"100% Stacked Bar",stackingarea100:"100% Stacked Area",stackingline100:"100% Stacked Line",bubble:"Bubble",pareto:"Pareto",radar:"Radar",line:"Line",area:"Area",scatter:"Scatter",polar:"Polar",of:"of",emptyFormat:"No format found!!!",emptyInput:"Enter a value",newReportConfirm:"Do you want to save the changes to this report?",emptyReportName:"Enter a report name",qtr:"Qtr",null:"null",undefined:"undefined",groupOutOfRange:"Out of Range",fieldDropErrorAction:"The field you are moving cannot be placed in that area of the report",aggregate:"Aggregate",drillThrough:"Drill Through",ascending:"Ascending",descending:"Descending",number:"Number",currency:"Currency",percentage:"Percentage",formatType:"Format Type",customText:"Currency Symbol",symbolPosition:"Symbol Position",left:"Left",right:"Right",grouping:"Grouping",true:"True",false:"False",decimalPlaces:"Decimal Places",numberFormat:"Number Formatting",memberType:"Field Type",formatString:"Format",expressionField:"Expression",customFormat:"Enter custom format string",numberFormatString:"Example: C, P, 0000 %, ###0.##0#, etc.",selectedHierarchy:"Parent Hierarchy",olapDropText:"Example: [Measures].[Order Quantity] + ([Measures].[Order Quantity] * 0.10)",Percent:"Percent",Currency:"Currency",Custom:"Custom",Measure:"Measure",Dimension:"Dimension",Standard:"Standard",blank:"(Blank)",fieldTooltip:'Drag and drop fields to create an expression. And, if you want to edit the existing calculated fields! You can achieve it by simply selecting the field under "Calculated Members".',fieldTitle:"Field Name",QuarterYear:"Quarter Year",drillError:"Cannot show the raw items of calculated fields.",caption:"Field Caption",copy:"Copy",defaultReport:"Sample Report",customFormatString:"Custom Format",invalidFormat:"Invalid Format.",group:"Group",unGroup:"Ungroup",invalidSelection:"Cannot group that selection.",groupName:"Enter the caption to display in header",captionName:"Enter the caption for group field",selectedItems:"Selected items",groupFieldCaption:"Field caption",groupTitle:"Group name",startAt:"Starting at",endAt:"Ending at",groupBy:"Interval by",selectGroup:"Select groups",multipleAxes:"Multiple Axis",showLegend:"Show Legend",exit:"Exit",chartTypeSettings:"Chart Type Settings",ChartType:"Chart Type",yes:"Yes",no:"No",numberFormatMenu:"Number Formatting...",conditionalFormattingMenu:"Conditional Formatting...",removeCalculatedField:"Are you sure you want to delete this calculated field?",replaceConfirmBefore:"A report named ",replaceConfirmAfter:" already exists. Do you want to replace it?",invalidJSON:"Invalid JSON data",invalidCSV:"Invalid CSV data",stacked:"Stacked",single:"Single",combined:"Combined",multipleAxisMode:"Multiple Axis Mode",grandTotalPosition:"Grand totals position",top:"Top",bottom:"Bottom",None:"None",rowPage:"Row pager",rowPerPage:"Rows per page",columnPage:"Column pager",columnPerPage:"Columns per page",goToFirstPage:"Go to first page",goToPreviousPage:"Go to previous page",goToNextPage:"Go to next page",goToLastPage:"Go to last page",subTotalPosition:"Subtotals position",auto:"Auto",loading:"Loading...",add:"Add"},this.localeObj=new Cn(this.getModuleName(),this.defaultLocale,this.locale),this.renderContextMenu(),this.isDragging=!1,this.pivotDeferLayoutUpdate=je(this.pivotDeferLayoutUpdate)?this.allowDeferLayoutUpdate:this.pivotDeferLayoutUpdate,this.addInternalEvents()},Kyt.prototype.onBeforeTooltipOpen=function(e){e.element.classList.add("e-pivottooltipwrap")},Kyt.prototype.renderToolTip=function(){this.showTooltip?(this.tooltipTemplate?this.tooltip=new NS({target:"td.e-valuescontent",cssClass:"e-pivottooltiptemplate"+(this.cssClass?" "+this.cssClass:""),showTipPointer:!1,position:"BottomRight",mouseTrail:!0,enableRtl:this.enableRtl,locale:this.locale,enableHtmlSanitizer:this.enableHtmlSanitizer,beforeRender:this.setToolTip.bind(this),beforeOpen:this.onBeforeTooltipOpen}):this.tooltip=new NS({target:"td.e-valuescontent",cssClass:this.cssClass,showTipPointer:!1,position:"BottomRight",mouseTrail:!0,enableRtl:this.enableRtl,locale:this.locale,enableHtmlSanitizer:this.enableHtmlSanitizer,beforeRender:this.setToolTip.bind(this),beforeOpen:this.onBeforeTooltipOpen}),this.tooltip.isStringTemplate=!0,this.tooltip.appendTo(this.element)):this.tooltip&&this.tooltip.destroy()},Kyt.prototype.renderContextMenu=function(){if(this.gridSettings.contextMenuItems||this.allowGrouping&&"pivot"===this.dataType){var e=[],t=[],i=[],n=[],o=[],r=[],s=[];if(this.gridSettings.contextMenuItems)for(var a=0,l=this.gridSettings.contextMenuItems;a<l.length;a++){var h,d=l[a];"string"==typeof d&&-1!==this.getDefaultItems().indexOf(d)?-1!==d.toString().toLowerCase().indexOf("aggregate")&&"pivot"===this.dataType?(s=[{text:this.localeObj.getConstant("Sum")}],(h=this.buildDefaultItems("Aggregate")).items=s,o.push(h)):(-1!==d.toString().toLowerCase().indexOf("export")?n:e).push(this.buildDefaultItems(d)):"string"!=typeof d&&i.push(d)}this.allowGrouping&&"pivot"===this.dataType&&(this.getFieldByID(this.element.id+"_custom_group",this.gridSettings.contextMenuItems)||t.push(this.buildDefaultItems("Group")),this.getFieldByID(this.element.id+"_custom_ungroup",this.gridSettings.contextMenuItems)||t.push(this.buildDefaultItems("Ungroup"))),0<n.length&&((p=this.buildDefaultItems("export")).items=n,r.push(p));var p=[];Array.prototype.push.apply(p,o),Array.prototype.push.apply(p,e),Array.prototype.push.apply(p,t),Array.prototype.push.apply(p,r),Array.prototype.push.apply(p,i),this.setProperties({gridSettings:{contextMenuItems:p}},!0)}},Kyt.prototype.getFieldByID=function(e,t){return new me({json:t}).executeLocal((new ya).where("id","equal",e))[0]},Kyt.prototype.getAllSummaryType=function(){return["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"]},Kyt.prototype.getDefaultItems=function(){return["Drillthrough","Expand","Collapse","Pdf Export","Excel Export","Csv Export","Sort Ascending","Sort Descending","Aggregate","CalculatedField"]},Kyt.prototype.buildDefaultItems=function(e){var t;switch(e){case"Aggregate":t={text:this.localeObj.getConstant("aggregate"),target:"th.e-valuesheader,td.e-valuescontent,.e-stot.e-rowsheader",id:this.element.id+"_aggregate"};break;case"CalculatedField":t={text:this.localeObj.getConstant("CalculatedField"),target:"td.e-valuescontent",id:this.element.id+"_CalculatedField"};break;case"Drillthrough":t={text:this.localeObj.getConstant("drillThrough"),target:"td.e-valuescontent",id:this.element.id+"_drillthrough_menu",iconCss:"e-pivotview-grid "+Tat};break;case"export":t={text:this.localeObj.getConstant("export"),target:"td.e-valuescontent",id:this.element.id+"_exporting",iconCss:"e-pivotview-export "+Tat};break;case"Pdf Export":t={text:this.localeObj.getConstant("pdf"),id:this.element.id+"_pdf",iconCss:sdt+" "+Tat};break;case"Excel Export":t={text:this.localeObj.getConstant("excel"),id:this.element.id+"_excel",iconCss:adt+" "+Tat};break;case"Csv Export":t={text:this.localeObj.getConstant("csv"),id:this.element.id+"_csv",iconCss:ldt+" "+Tat};break;case"Expand":t={text:this.localeObj.getConstant("expand"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_expand",iconCss:"e-pivotview-expand "+Tat};break;case"Collapse":t={text:this.localeObj.getConstant("collapse"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_collapse",iconCss:"e-pivotview-collapse "+Tat};break;case"Sort Ascending":t={text:this.localeObj.getConstant("ascending"),target:"th.e-valuesheader,.e-stot",id:this.element.id+"_sortasc",iconCss:"e-icon-ascending "+Tat};break;case"Sort Descending":t={text:this.localeObj.getConstant("descending"),target:"th.e-valuesheader,.e-stot",id:this.element.id+"_sortdesc",iconCss:"e-icon-descending "+Tat};break;case"Group":t={text:this.localeObj.getConstant("group"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_custom_group",iconCss:"e-pivotview-group "+Tat};break;case"Ungroup":t={text:this.localeObj.getConstant("unGroup"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_custom_ungroup",iconCss:"e-pivotview-ungroup "+Tat}}return this.defaultItems[e]={text:t.text,id:t.id,target:t.target,iconCss:t.iconCss},this.defaultItems[e]},Kyt.prototype.initProperties=function(){this.isTabular="Tabular"===this.gridSettings.layout,this.pivotRefresh=Ji.prototype.refresh,this.minHeight=je(this.minHeight)?300:this.minHeight<10?10:this.minHeight,this.isScrolling=!1,this.allowServerDataBinding=!1,this.isStaticRefresh=!1,this.setProperties({pivotValues:[]},!0),this.allowServerDataBinding=!0,this.scrollPosObject={vertical:0,horizontal:0,verticalSection:0,horizontalSection:0,top:0,left:0,scrollDirection:{direction:"",position:0}},this.queryCellInfo=this.gridSettings.queryCellInfo?this.gridSettings.queryCellInfo.bind(this):void 0,this.headerCellInfo=this.gridSettings.headerCellInfo?this.gridSettings.headerCellInfo.bind(this):void 0,this.resizing=this.gridSettings.resizing?this.gridSettings.resizing.bind(this):void 0,this.resizeStop=this.gridSettings.resizeStop?this.gridSettings.resizeStop.bind(this):void 0,this.pdfHeaderQueryCellInfo=this.gridSettings.pdfHeaderQueryCellInfo||void 0,this.pdfQueryCellInfo=this.gridSettings.pdfQueryCellInfo||void 0,this.excelHeaderQueryCellInfo=this.gridSettings.excelHeaderQueryCellInfo||void 0,this.excelQueryCellInfo=this.gridSettings.excelQueryCellInfo||void 0,this.columnDragStart=this.gridSettings.columnDragStart?this.gridSettings.columnDragStart.bind(this):void 0,this.columnDrag=this.gridSettings.columnDrag?this.gridSettings.columnDrag.bind(this):void 0,this.columnDrop=this.gridSettings.columnDrop?this.gridSettings.columnDrop.bind(this):void 0,this.beforeColumnsRender=this.gridSettings.columnRender||void 0,this.selected=this.gridSettings.cellSelected||void 0,this.selecting=this.gridSettings.cellSelecting||void 0,this.cellDeselected=this.gridSettings.cellDeselected||void 0,this.rowSelected=this.gridSettings.rowSelected||void 0,this.rowDeselected=this.gridSettings.rowDeselected||void 0,this.chartTooltipRender=this.chartSettings.tooltipRender||void 0,this.chartLegendClick=this.chartSettings.legendClick||void 0,this.chartLoaded=this.chartSettings.loaded||void 0,this.chartLoad=this.chartSettings.load||void 0,this.chartResized=this.chartSettings.resized||void 0,this.chartAxisLabelRender=this.chartSettings.axisLabelRender||void 0,this.multiLevelLabelClick=this.chartSettings.multiLevelLabelClick||void 0,this.chartPointClick=this.chartSettings.pointClick||void 0,this.contextMenuClick=this.gridSettings.contextMenuClick||void 0,this.contextMenuOpen=this.gridSettings.contextMenuOpen||void 0,this.beforePdfExport=this.gridSettings.beforePdfExport?this.gridSettings.beforePdfExport.bind(this):void 0,this.beforeExcelExport=this.gridSettings.beforeExcelExport?this.gridSettings.beforeExcelExport.bind(this):void 0,this.beforePrint=this.chartSettings.beforePrint||void 0,this.animationComplete=this.chartSettings.animationComplete||void 0,this.legendRender=this.chartSettings.legendRender||void 0,this.textRender=this.chartSettings.textRender||void 0,this.pointRender=this.chartSettings.pointRender||void 0,this.seriesRender=this.chartSettings.seriesRender||void 0,this.chartMouseMove=this.chartSettings.chartMouseMove||void 0,this.chartMouseClick=this.chartSettings.chartMouseClick||void 0,this.pointMove=this.chartSettings.pointMove||void 0,this.chartMouseLeave=this.chartSettings.chartMouseLeave||void 0,this.chartMouseDown=this.chartSettings.chartMouseDown||void 0,this.chartMouseUp=this.chartSettings.chartMouseUp||void 0,this.dragComplete=this.chartSettings.dragComplete||void 0,this.zoomComplete=this.chartSettings.zoomComplete||void 0,this.scrollStart=this.chartSettings.scrollStart||void 0,this.scrollEnd=this.chartSettings.scrollEnd||void 0,this.scrollChanged=this.chartSettings.scrollChanged||void 0,this.multiLevelLabelRender=this.chartSettings.multiLevelLabelRender||void 0,null===this.gridSettings.rowHeight&&(this.isTouchMode?this.setProperties({gridSettings:{rowHeight:36}},!0):this.setProperties({gridSettings:{rowHeight:this.isAdaptive?36:30}},!0)),this.chartSettings&&this.chartSettings.showMemberSeries&&!this.chartSettings.showPointColorByMembers&&this.setProperties({chartSettings:{showPointColorByMembers:!0}},!0),this.element.style.height="100%",this.enableVirtualization&&this.updatePageSettings(!0),this.isCellBoxMultiSelection=this.gridSettings.allowSelection&&"Box"===this.gridSettings.selectionSettings.cellSelectionMode&&"Cell"===this.gridSettings.selectionSettings.mode&&"Multiple"===this.gridSettings.selectionSettings.type,this.allowGrouping&&!this.isCellBoxMultiSelection&&(this.isCellBoxMultiSelection=!0,this.setProperties({gridSettings:{allowSelection:!0,selectionSettings:{cellSelectionMode:"Box",mode:"Cell",type:"Multiple"}}},!0)),"Table"!==this.displayOption.view&&(this.pivotChartModule=new Cmt(this)),this.currentView=this.currentView||("Both"===this.displayOption.view?this.displayOption.primary:this.displayOption.view)},Kyt.prototype.updatePageSettings=function(e){var t,i,n;this.enableVirtualization&&((i=t=1)<this.dataSourceSettings.values.length&&"pivot"===this.dataType&&("row"===this.dataSourceSettings.valueAxis?i=this.dataSourceSettings.values.length:t=this.dataSourceSettings.values.length),n=this.getHeightAsNumber(),isNaN(n)&&(n=this.element.offsetHeight),this.pageSettings={currentColumnPage:e?1:this.pageSettings.currentColumnPage,currentRowPage:e?1:this.pageSettings.currentRowPage,columnPageSize:Math.ceil((Math.floor(this.getWidthAsNumber()/this.gridSettings.columnWidth)-1)/t),rowPageSize:Math.ceil(Math.floor(n/this.gridSettings.rowHeight)/i)})},Kyt.prototype.render=function(){this.loadData()},Kyt.prototype.loadData=function(){if(0<this.dataSourceSettings.formatSettings.length)for(var e=this.dataSourceSettings.formatSettings,t=0;t<e.length;t++)je(e[t].maximumFractionDigits)&&je(e[t].minimumFractionDigits)||null!==e[t].format.match(/^(P|N|C|P[0-9]|C[0-9]|N[0-9])$/g)||(e[t].maximumFractionDigits=void 0,e[t].minimumIntegerDigits=void 0);"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url?"Server"===this.dataSourceSettings.mode?(this.guid=Hdt.generateUUID(),this.initialLoad(),"Chart"!==this.displayOption.view?this.renderEmptyGrid():this.refreshData(),this.showWaitingPopup()):new Qe(this.dataSourceSettings.url,"GET").send().then(function(e){return"string"==typeof e?e:e.text()}).then(this.onReadyStateChange.bind(this)):this.initialLoad()},Kyt.prototype.onSuccess=function(e){if(this.request.readyState===XMLHttpRequest.DONE)if("onExcelExport"===this.currentAction||"onCsvExport"===this.currentAction)200===this.request.status&&(E=this.request.response,e=je(e.fileName)?"onExcelExport"===this.currentAction?"default.xlsx":"default.csv":e.fileName,Ll.save(e,E));else{this.isServerWaitingPopup=!0;try{var t={action:this.currentAction,response:this.request.responseText},i=(this.trigger(dct,t),JSON.parse(this.request.responseText));if("fetchFieldMembers"===this.currentAction){for(var n=JSON.parse(i.members),o=[],r={},s=Hdt.isDateField(i.memberName,this.engineModule),a="number"===this.engineModule.fieldList[i.memberName].type,l=Object.keys(n),h=0,d=l.length;h<d;h++){var p=n[l[h]],c=s?this.engineModule.getFormattedValue(p.Name,i.memberName):{formattedText:p.Caption};r[l[h]]={index:p.Index,ordinal:p.Ordinal,isDrilled:p.IsDrilled,caption:c.formattedText},o.push({formattedText:c.formattedText,actualText:s?c.actualText:!a||isNaN(Number(p.Name))?p.Name:Number(p.Name)})}this.engineModule.fieldList[i.memberName].members=r,this.engineModule.fieldList[i.memberName].dateMember=o,(this.showGroupingBar?this:this.pivotFieldListModule).pivotButtonModule.updateFilterEvents()}else if("fetchRawData"===this.currentAction){for(var u=this.engineModule.fieldList[this.drillThroughValue.actualText.toString()]?this.engineModule.fieldList[this.drillThroughValue.actualText.toString()].caption:this.drillThroughValue.actualText.toString(),g=this.engineModule.fieldList[this.drillThroughValue.actualText]?this.engineModule.fieldList[this.drillThroughValue.actualText].aggregateType:"",m=JSON.parse(i.rawData),f=JSON.parse(i.indexObject),y={},v=0;v<f.length;v++)y[f[v].Key]=f[v].Value;this.drillThroughValue.indexObject=y,this.drillThroughModule.triggerDialog(u,g,m,this.drillThroughValue,this.drillThroughElement),this.hideWaitingPopup()}else{var b=Hdt.formatFieldList(JSON.parse(i.fieldList));if(this.engineModule.fieldList)for(l=Object.keys(this.engineModule.fieldList),h=0;h<l.length;h++)this.engineModule.fieldList[l[h]]&&b[l[h]]&&(b[l[h]].dateMember=this.engineModule.fieldList[l[h]].dateMember,b[l[h]].formattedMembers=this.engineModule.fieldList[l[h]].formattedMembers,b[l[h]].members=this.engineModule.fieldList[l[h]].members);this.engineModule.fieldList=b,this.engineModule.fields=JSON.parse(i.fields),this.engineModule.rowCount=JSON.parse(i.pivotCount).RowCount,this.engineModule.columnCount=JSON.parse(i.pivotCount).ColumnCount,this.engineModule.rowStartPos=JSON.parse(i.pivotCount).RowStartPosition,this.engineModule.colStartPos=JSON.parse(i.pivotCount).ColumnStartPosition,this.engineModule.rowFirstLvl=JSON.parse(i.pivotCount).RowFirstLevel,this.engineModule.colFirstLvl=JSON.parse(i.pivotCount).ColumnFirstLevel,this.engineModule.columnPageCount=JSON.parse(i.pivotCount).ColumnPageCount,this.engineModule.rowPageCount=JSON.parse(i.pivotCount).RowPageCount;for(var w=void 0,C=Hdt.formatPivotValues(JSON.parse(i.pivotValue)),S=0;S<C.length;S++)if(C[S]&&C[S][0]&&"row"===C[S][0].axis){w=S;break}this.engineModule.headerContent=Hdt.frameContent(C,"header",w,this),this.engineModule.pageSettings=this.pageSettings,0<this.dataSourceSettings.groupSettings.length&&Hdt.updateReport(this,JSON.parse(i.dataSourceSettings));var A=JSON.parse(i.dataSourceSettings).ValueSortSettings;this.engineModule.valueSortSettings={headerText:A.HeaderText,headerDelimiter:A.HeaderDelimiter,sortOrder:A.SortOrder,columnIndex:A.ColumnIndex},this.engineModule.pivotValues=C,this.engineModule.isEmptyData=i.isEmptyData,this.engineModule.isEngineUpdated=i.isEngineUpdated;for(var x=0,I=this.dataSourceSettings.values;x<I.length;x++){var T=I[x];this.engineModule.valueAxisFields[T.name]=T}this.engineModule.globalize=je(this.globalize)?new Ti:this.globalize,this.engineModule.formatFields=this.engineModule.setFormattedFields(this.dataSourceSettings.formatSettings)}}catch(e){this.engineModule.pivotValues=[]}var E,D;"onScroll"===this.currentAction&&("vertical"===this.scrollDirection?(e="row"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1,D=this.pageSettings.rowPageSize*e*this.gridSettings.rowHeight*Math.ceil(this.engineModule.rowStartPos/(this.pageSettings.rowPageSize*e))-this.engineModule.rowFirstLvl*e*this.gridSettings.rowHeight,this.scrollPosObject.verticalSection=D):"horizondal"===this.scrollDirection&&(E="column"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1,D=this.pageSettings.columnPageSize*E*this.gridSettings.columnWidth*Math.ceil(this.engineModule.colStartPos/(this.pageSettings.columnPageSize*E))-this.engineModule.colFirstLvl*E*this.gridSettings.columnWidth,this.scrollPosObject.horizontalSection=D)),"fetchFieldMembers"!==this.currentAction&&"fetchRawData"!==this.currentAction&&(this.initEngine(),this.calculatedFieldModule&&this.calculatedFieldModule.isRequireUpdate&&(this.calculatedFieldModule.endDialog(),this.calculatedFieldModule.isRequireUpdate=!1),this.pivotFieldListModule)&&this.pivotFieldListModule.calculatedFieldModule&&this.pivotFieldListModule.calculatedFieldModule.isRequireUpdate&&(this.pivotFieldListModule.calculatedFieldModule.endDialog(),this.pivotFieldListModule.calculatedFieldModule.isRequireUpdate=!1)}},Kyt.prototype.getEngine=function(e,t,i,n,o,r,s,a,l,h){for(var d=this,p=(this.engineModule.isEmptyData=!1,this.element.querySelector(".e-spin-hide")&&"onExcelExport"!==e&&"onCsvExport"!==e&&this.showWaitingPopup(),this.currentAction=e,this.isServerWaitingPopup=!1,{pageSettings:JSON.parse(this.getPageSettings()).pageSettings,enableValueSorting:this.enableValueSorting,enablePaging:this.enablePaging,enableVirtualization:this.enableVirtualization,allowDataCompression:this.allowDataCompression,enableDrillThrough:this.allowDrillThrough||this.editSettings.allowEditing,locale:JSON.stringify(Hdt.getLocalizedObject(this)),savedFieldList:"onDrop"===e&&null!==this.engineModule.fieldList?Hdt.getClonedFieldList(this.engineModule.fieldList,!0):void 0,enableOptimizedRendering:this.enableVirtualization&&this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage,requestType:"string",headers:{"Content-type":"application/json"}}),c=(this.request.readyState!==XMLHttpRequest.UNSENT&&this.request.readyState!==XMLHttpRequest.OPENED||(this.request.withCredentials=!1),{request:this.request,dataSourceSettings:JSON.parse(this.getPersistData()).dataSourceSettings,action:e,customProperties:{},internalProperties:p,drillItem:t,sortItem:i,aggregatedItem:n,calculatedItem:o,filterItem:r,memberName:s,fetchRawDataArgs:a,editArgs:l,hash:this.guid,excelExportProperties:h,exportAllPages:this.exportAllPages,isGroupingUpdated:"onRefresh"===this.currentAction&&0<this.dataSourceSettings.groupSettings.length||!!this.groupingModule&&this.groupingModule.isUpdate}),u=(this.trigger(hct,c,function(e){d.request=e.request,c.internalProperties=e.internalProperties,c.customProperties=e.customProperties,c.dataSourceSettings=e.dataSourceSettings,c.calculatedItem=e.calculatedItem,c.drillItem=e.drillItem,c.editArgs=e.editArgs,c.fetchRawDataArgs=e.fetchRawDataArgs,c.filterItem=e.filterItem,c.hash=e.hash,c.memberName=e.memberName,c.sortItem=e.sortItem,c.excelExportProperties=e.excelExportProperties,c.exportAllPages=e.exportAllPages}),this.request.open("POST",this.dataSourceSettings.url,!0),this.request.onreadystatechange=this.onSuccess.bind(this,c.excelExportProperties),"onExcelExport"===c.action||"onCsvExport"===c.action?this.request.responseType="blob":this.request.responseType="",Object.keys(c.internalProperties.headers)),g=0;g<u.length;g++){var m=u[g],f=String(c.internalProperties.headers[m]);this.request.setRequestHeader(m,f)}"string"===c.internalProperties.requestType?this.request.send(JSON.stringify(c)):"base64"===c.internalProperties.requestType&&this.request.send(btoa(JSON.stringify(c)))},Kyt.prototype.getChartSettings=function(){var e=this.chartSettings.load,t=this.chartSettings.loaded,i=this.chartSettings.textRender,n=this.chartSettings.pointRender,o=this.chartSettings.seriesRender,r=this.chartSettings.legendRender,s=this.chartSettings.pointClick,a=this.chartSettings.tooltipRender,l=this.chartSettings.legendClick,h=this.chartSettings.multiLevelLabelRender,d=this.chartSettings.beforePrint,p=this.chartSettings.animationComplete,c=this.chartSettings.chartMouseMove,u=this.chartSettings.chartMouseClick,g=this.chartSettings.pointMove,m=this.chartSettings.chartMouseLeave,f=this.chartSettings.chartMouseDown,y=this.chartSettings.chartMouseUp,v=this.chartSettings.dragComplete,b=this.chartSettings.zoomComplete,w=this.chartSettings.scrollStart,C=this.chartSettings.scrollEnd,S=this.chartSettings.scrollChanged,A=(this.chartSettings.load=void 0,this.chartSettings.loaded=void 0,this.chartSettings.textRender=void 0,this.chartSettings.pointRender=void 0,this.chartSettings.seriesRender=void 0,this.chartSettings.legendRender=void 0,this.chartSettings.pointClick=void 0,this.chartSettings.tooltipRender=void 0,this.chartSettings.legendClick=void 0,this.chartSettings.multiLevelLabelRender=void 0,this.chartSettings.beforePrint=void 0,this.chartSettings.animationComplete=void 0,this.chartSettings.chartMouseMove=void 0,this.chartSettings.chartMouseClick=void 0,this.chartSettings.pointMove=void 0,this.chartSettings.chartMouseLeave=void 0,this.chartSettings.chartMouseDown=void 0,this.chartSettings.chartMouseUp=void 0,this.chartSettings.dragComplete=void 0,this.chartSettings.zoomComplete=void 0,this.chartSettings.scrollStart=void 0,this.chartSettings.scrollEnd=void 0,this.chartSettings.scrollChanged=void 0,this.addOnPersist(["chartSettings"]));return this.chartSettings.load=e,this.chartSettings.loaded=t,this.chartSettings.textRender=i,this.chartSettings.pointRender=n,this.chartSettings.seriesRender=o,this.chartSettings.legendRender=r,this.chartSettings.pointClick=s,this.chartSettings.tooltipRender=a,this.chartSettings.legendClick=l,this.chartSettings.multiLevelLabelRender=h,this.chartSettings.beforePrint=d,this.chartSettings.animationComplete=p,this.chartSettings.chartMouseMove=c,this.chartSettings.chartMouseClick=u,this.chartSettings.pointMove=g,this.chartSettings.chartMouseLeave=m,this.chartSettings.chartMouseDown=f,this.chartSettings.chartMouseUp=y,this.chartSettings.dragComplete=v,this.chartSettings.zoomComplete=b,this.chartSettings.scrollStart=w,this.chartSettings.scrollEnd=C,this.chartSettings.scrollChanged=S,A},Kyt.prototype.getPageSettings=function(){return this.addOnPersist(["pageSettings"])},Kyt.prototype.onReadyStateChange=function(e){var t=[];if("CSV"===this.dataSourceSettings.type)for(var i=e.split(/\r?\n|\r/),n=0;n<i.length;n++)je(i[n])||""===i[n]||t.push(i[n].split(","));else try{t=JSON.parse(e)}catch(e){t=[]}t&&0<t.length&&this.setProperties({dataSourceSettings:{dataSource:t}},!0),this.initialLoad()},Kyt.prototype.initialLoad=function(){var t=this;try{this.cellTemplateFn=this.templateParser(this.cellTemplate),this.tooltipTemplateFn=this.templateParser(this.tooltipTemplate),this.spinnerTemplate?mA({target:this.element,template:this.spinnerTemplate,cssClass:this.cssClass||void 0},this.createElement):mA({target:this.element,cssClass:this.cssClass||void 0},this.createElement);var i={dataSourceSettings:this.dataSourceSettings,pivotview:this,fieldsType:{},defaultFieldListOrder:this.defaultFieldListOrder};this.trigger("load",i,function(e){t.dataSourceSettings=e.dataSourceSettings,t.fieldsType=e.fieldsType,t.defaultFieldListOrder=i.defaultFieldListOrder,t.updateClass(),t.notify(wct,{}),t.notify(gct,{}),t.isAdaptive&&t.contextMenuModule.render(),t.notify(xct,{}),t.notify(Ict,{})})}catch(e){this.actionFailureMethod(e)}},Kyt.prototype.addInternalEvents=function(){this.on(gct,this.generateData,this),this.on(bct,this.renderPivotGrid,this),this.on(vct,this.onContentReady,this)},Kyt.prototype.removeInternalEvents=function(){this.off(gct,this.generateData),this.off(bct,this.renderPivotGrid),this.off(vct,this.onContentReady)},Kyt.prototype.getPersistData=function(e){var t=this.gridSettings.columnRender,i=this.gridSettings.excelQueryCellInfo,n=this.gridSettings.excelHeaderQueryCellInfo,o=this.gridSettings.pdfQueryCellInfo,r=this.gridSettings.pdfHeaderQueryCellInfo,s=this.chartSettings.load,a=this.chartSettings.loaded,l=this.chartSettings.textRender,h=this.chartSettings.pointRender,d=this.chartSettings.seriesRender,p=this.chartSettings.legendRender,c=this.chartSettings.pointClick,u=this.chartSettings.tooltipRender,g=this.chartSettings.legendClick,m=this.chartSettings.multiLevelLabelRender,f=this.chartSettings.beforePrint,y=this.chartSettings.animationComplete,v=this.chartSettings.chartMouseMove,b=this.chartSettings.chartMouseClick,w=this.chartSettings.pointMove,C=this.chartSettings.chartMouseLeave,S=this.chartSettings.chartMouseDown,A=this.chartSettings.chartMouseUp,x=this.chartSettings.dragComplete,I=this.chartSettings.zoomComplete,T=this.chartSettings.scrollStart,E=this.chartSettings.scrollEnd,D=this.chartSettings.scrollChanged,M=(this.gridSettings.columnRender=void 0,this.gridSettings.excelQueryCellInfo=void 0,this.gridSettings.excelHeaderQueryCellInfo=void 0,this.gridSettings.pdfQueryCellInfo=void 0,this.gridSettings.pdfHeaderQueryCellInfo=void 0,this.chartSettings.tooltipRender=void 0,this.chartSettings.legendClick=void 0,this.chartSettings.multiLevelLabelRender=void 0,this.chartSettings.load=void 0,this.chartSettings.loaded=void 0,this.chartSettings.textRender=void 0,this.chartSettings.pointRender=void 0,this.chartSettings.seriesRender=void 0,this.chartSettings.legendRender=void 0,this.chartSettings.pointClick=void 0,this.chartSettings.beforePrint=void 0,this.chartSettings.animationComplete=void 0,this.chartSettings.chartMouseMove=void 0,this.chartSettings.chartMouseClick=void 0,this.chartSettings.pointMove=void 0,this.chartSettings.chartMouseLeave=void 0,this.chartSettings.chartMouseDown=void 0,this.chartSettings.chartMouseUp=void 0,this.chartSettings.dragComplete=void 0,this.chartSettings.zoomComplete=void 0,this.chartSettings.scrollStart=void 0,this.chartSettings.scrollEnd=void 0,this.chartSettings.scrollChanged=void 0,[]),k=(e&&(M=!this.dataSourceSettings.dataSource||this.dataSourceSettings.dataSource instanceof me?this.dataSourceSettings.dataSource:this.dataSourceSettings.dataSource.slice(),this.setProperties({dataSourceSettings:{dataSource:[]}},!0)),this.addOnPersist(["dataSourceSettings","pivotValues","gridSettings","chartSettings","displayOption","pageSettings"]));return this.gridSettings.columnRender=t,this.gridSettings.excelQueryCellInfo=i,this.gridSettings.excelHeaderQueryCellInfo=n,this.gridSettings.pdfQueryCellInfo=o,this.gridSettings.pdfHeaderQueryCellInfo=r,this.chartSettings.load=s,this.chartSettings.loaded=a,this.chartSettings.textRender=l,this.chartSettings.pointRender=h,this.chartSettings.seriesRender=d,this.chartSettings.legendRender=p,this.chartSettings.pointClick=c,this.chartSettings.tooltipRender=u,this.chartSettings.legendClick=g,this.chartSettings.multiLevelLabelRender=m,this.chartSettings.beforePrint=f,this.chartSettings.animationComplete=y,this.chartSettings.chartMouseMove=v,this.chartSettings.chartMouseClick=b,this.chartSettings.pointMove=w,this.chartSettings.chartMouseLeave=C,this.chartSettings.chartMouseDown=S,this.chartSettings.chartMouseUp=A,this.chartSettings.dragComplete=x,this.chartSettings.zoomComplete=I,this.chartSettings.scrollStart=T,this.chartSettings.scrollEnd=E,this.chartSettings.scrollChanged=D,e&&this.setProperties({dataSourceSettings:{dataSource:M}},!0),k},Kyt.prototype.loadPersistData=function(e){e=JSON.parse(e);this.allowServerDataBinding=!1,this.setProperties({gridSettings:e.gridSettings,pivotValues:e.pivotValues,chartSettings:e.chartSettings,displayOption:e.displayOption},!0),"Chart"===e.displayOption.primary?this.currentView="Chart":this.currentView="Table",this.allowServerDataBinding=!0,this.dataSourceSettings&&this.dataSourceSettings.dataSource&&this.dataSourceSettings.dataSource instanceof me&&e.dataSourceSettings&&e.dataSourceSettings.dataSource&&e.dataSourceSettings.dataSource.dataSource&&this.dataSourceSettings.dataSource.dataSource&&e.dataSourceSettings.dataSource.dataSource.url===this.dataSourceSettings.dataSource.dataSource.url&&(e.dataSourceSettings.dataSource=this.dataSourceSettings.dataSource),this.dataSourceSettings=e.dataSourceSettings},Kyt.prototype.mergePersistPivotData=function(){var e=window.localStorage.getItem(this.getModuleName()+this.element.id);je(e)||""===e||(e=JSON.parse(e),this.dataSourceSettings&&this.dataSourceSettings.dataSource&&this.dataSourceSettings.dataSource instanceof me&&e.dataSourceSettings&&e.dataSourceSettings.dataSource&&e.dataSourceSettings.dataSource.dataSource&&this.dataSourceSettings.dataSource.dataSource&&e.dataSourceSettings.dataSource.dataSource.url===this.dataSourceSettings.dataSource.dataSource.url&&(e.dataSourceSettings.dataSource=this.dataSourceSettings.dataSource),this.setProperties(e,!0))},Kyt.prototype.showConditionalFormattingDialog=function(){this.conditionalFormattingModule&&this.conditionalFormattingModule.showConditionalFormattingDialog()},Kyt.prototype.createCalculatedFieldDialog=function(){this.calculatedFieldModule&&this.calculatedFieldModule.createCalculatedFieldDialog()},Kyt.prototype.getModuleName=function(){return"pivotview"},Kyt.prototype.copy=function(e){this.grid.copy(e)},Kyt.prototype.onPropertyChanged=function(e,t){for(var i=!1,n=0,o=Object.keys(e);n<o.length;n++){var r,s,a=o[n];switch(a){case"dataSourceSettings":case"hyperlinkSettings":case"allowDrillThrough":case"editSettings":case"allowDataCompression":e.dataSourceSettings&&(!je(e.dataSourceSettings.dataSource)&&!je(this.clonedDataSet)&&this.clonedDataSet!==e.dataSourceSettings.dataSource&&!je(e.dataSourceSettings.groupSettings)&&0<e.dataSourceSettings.groupSettings.length||1===Object.keys(e.dataSourceSettings).length&&"dataSource"===Object.keys(e.dataSourceSettings)[0]&&0<this.dataSourceSettings.groupSettings.length)&&(this.clonedDataSet=e.dataSourceSettings.dataSource,this.engineModule.groupingFields={}),e.dataSourceSettings&&1===Object.keys(e.dataSourceSettings).length&&e.dataSourceSettings.groupSettings&&"pivot"===this.dataType&&this.updateGroupingReport(e.dataSourceSettings.groupSettings,"Date"),-1<(je(e.dataSourceSettings)?[]:Object.keys(e.dataSourceSettings)).indexOf("dataSource")&&"CSV"!==e.dataSourceSettings.type?(!je(this.savedDataSourceSettings)&&0<this.dataSourceSettings.dataSource.length&&(Hdt.updateDataSourceSettings(this,this.savedDataSourceSettings),this.savedDataSourceSettings=void 0),e.dataSourceSettings.dataSource&&0===e.dataSourceSettings.dataSource.length&&(this.savedDataSourceSettings=Hdt.getClonedDataSourceSettings(this.dataSourceSettings),this.setProperties({dataSourceSettings:{rows:[]}},!0),this.setProperties({dataSourceSettings:{columns:[]}},!0),this.setProperties({dataSourceSettings:{values:[]}},!0),this.setProperties({dataSourceSettings:{filters:[]}},!0)),this.isStaticRefresh||(this.pivotValues=[],"pivot"===this.dataType?(this.engineModule.fieldList=null,this.engineModule.isEmptyData=!0,this.engineModule.data=[],this.engineModule.groupingFieldsInfo={}):"olap"===this.dataType&&(this.olapEngineModule.fieldList={},this.olapEngineModule.fieldListData=void 0,this.olapEngineModule.isEmptyData=!0)),this.showWaitingPopup(),this.notify(gct,{})):Hdt.isButtonIconRefesh(a,t,e)?(this.showGroupingBar&&this.groupingBarModule&&this.axisFieldModule.render(),this.showFieldList&&this.pivotFieldListModule&&(l=Hdt.cloneFieldSettings(this.dataSourceSettings.rows),h=Hdt.cloneFieldSettings(this.dataSourceSettings.columns),s=Hdt.cloneFieldSettings(this.dataSourceSettings.values),r=Hdt.cloneFieldSettings(this.dataSourceSettings.filters),this.pivotFieldListModule.setProperties({dataSourceSettings:{rows:l,columns:h,values:s,filters:r}},!0),this.pivotFieldListModule.axisFieldModule.render(),this.pivotFieldListModule.treeViewModule.fieldTable)&&!this.isAdaptive&&this.pivotFieldListModule.notify(Cct,{})):(this.remoteData=[],"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url&&!je(e.dataSourceSettings)&&("type"in e.dataSourceSettings||"url"in e.dataSourceSettings)?(this.engineModule.fieldList=null,this.loadData()):(e.dataSourceSettings&&("pivot"===this.dataType&&"dataSource"in e.dataSourceSettings||"olap"===this.dataType&&"url"in e.dataSourceSettings)&&(this.isStaticRefresh||("pivot"===this.dataType?(this.engineModule.fieldList=null,this.engineModule.isEmptyData=!0,this.engineModule.data=[],this.engineModule.groupingFieldsInfo={}):"olap"===this.dataType&&(this.olapEngineModule.fieldList={},this.olapEngineModule.fieldListData=void 0,this.olapEngineModule.isEmptyData=!0),this.pivotValues=[])),this.notify(gct,{})));break;case"height":case"width":this.layoutRefresh();break;case"pivotValues":case"displayOption":if(e.displayOption&&1===Object.keys(e.displayOption).length&&e.displayOption.view)switch(this.currentView="Both"===e.displayOption.view?this.displayOption.primary:e.displayOption.view,(this.showGroupingBar||this.showFieldList)&&(this.showFieldList&&this.pivotFieldListModule&&(this.pivotFieldListModule.destroyEngine=!0,this.pivotFieldListModule.destroy(),null!==ge("#"+this.element.id+"_PivotFieldList",this.element)&&ue(ge("#"+this.element.id+"_PivotFieldList",this.element)),this.pivotFieldListModule.destroyEngine=!1),this.notify(wct,this)),e.displayOption.view){case"Both":this.pivotChartModule||(this.pivotChartModule=new Cmt(this)),this.grid||this.renderEmptyGrid();break;case"Chart":this.grid&&(this.grid.destroy(),this.grid=void 0),this.pivotChartModule||(this.pivotChartModule=new Cmt(this));break;case"Table":this.grid||this.renderEmptyGrid(),this.pivotChartModule&&(this.destroyEngine=!0,this.pivotChartModule.destroy(),this.destroyEngine=!1,this.chart=void 0,this.pivotChartModule=void 0)}else this.showToolbar&&!je(e.displayOption)&&e.displayOption.view&&(this.currentView="Both"===e.displayOption.view?this.displayOption.primary:e.displayOption.view);this.showToolbar&&!je(e.displayOption)&&e.displayOption.view&&("Chart"===e.displayOption.view?(this.toolbarModule.createChartMenu(),this.toggleButtonState(cdt,"add"),this.toggleButtonState(udt,"remove")):"Table"===e.displayOption.view?(ge("#"+this.element.id+"_grid",this.element).style.display="block",this.toggleButtonState(udt,"add"),this.toggleButtonState(cdt,"remove")):(this.toolbarModule.createChartMenu(),this.toggleButtonState(cdt,"remove"),this.toggleButtonState(udt,"remove")));var l="pivot"===this.dataType?this.engineModule:this.olapEngineModule;je(l.fieldList)&&je(l.pivotValues)||this.notify(bct,{});break;case"gridSettings":this.isTabular="Tabular"===this.gridSettings.layout,this.lastGridSettings=e.gridSettings,this.isCellBoxMultiSelection=this.gridSettings.allowSelection&&"Box"===this.gridSettings.selectionSettings.cellSelectionMode&&"Cell"===this.gridSettings.selectionSettings.mode&&"Multiple"===this.gridSettings.selectionSettings.type,this.allowGrouping&&this.groupingModule&&!this.isCellBoxMultiSelection&&(this.setProperties({gridSettings:{allowSelection:!0,selectionSettings:{cellSelectionMode:"Box",mode:"Cell",type:"Multiple"}}},!0),this.isCellBoxMultiSelection=!0),this.renderModule&&this.grid&&this.renderModule.updateGridSettings(),e.gridSettings.layout&&this.initialLoad();break;case"chartSettings":this.showGroupingBar&&this.groupingBarModule&&(-1!==Object.keys(e.chartSettings).indexOf("enableMultipleAxis")||e.chartSettings.chartSeries&&-1!==Object.keys(e.chartSettings.chartSeries).indexOf("type"))&&(this.groupingBarModule.renderLayout(),this.pivotChartModule)&&this.groupingBarModule.appendToElement(),je(this.pivotChartModule)&&"Table"!==this.displayOption.view&&(this.pivotChartModule=new Cmt(this));var h="pivot"===this.dataType?this.engineModule:this.olapEngineModule;je(this.pivotChartModule)||je(h.pivotValues)||this.pivotChartModule.loadChart(this,this.chartSettings),je(h.pivotValues)||je(h.fieldList)||this.notify(mct,this);break;case"locale":case"currencyCode":case"enableRtl":this.tooltip&&this.tooltip.destroy(),this.dataSourceSettings.groupSettings&&0<this.dataSourceSettings.groupSettings.length&&this.clonedDataSet&&(s="CSV"===this.dataSourceSettings.type?Hdt.getClonedCSVData(this.clonedDataSet):Hdt.getClonedData(this.clonedDataSet),this.setProperties({dataSourceSettings:{dataSource:s}},!0)),Yyt.prototype.refresh.call(this),this.updateClass();break;case"enableValueSorting":this.enableValueSorting=e.enableValueSorting,this.updateDataSource();break;case"showGroupingBar":this.element.querySelector(".e-grouping-bar")?this.element.querySelector(".e-grouping-bar").remove():this.groupingBarModule&&(this.groupingBarModule.renderLayout(),this.commonModule||(this.commonModule=new Mgt(this)),this.notify(gct,{})),je(e.showFieldList)&&this.renderPivotGrid();break;case"showFieldList":this.initialLoad();break;case"groupingBarSettings":this.showGroupingBar&&this.groupingBarModule&&(e.groupingBarSettings&&-1<Object.keys(e.groupingBarSettings).indexOf("showFieldsPanel")?(this.groupingBarModule.RefreshFieldsPanel(),this.layoutRefresh()):this.axisFieldModule.render());break;case"showValuesButton":this.showGroupingBar&&this.groupingBarModule&&this.axisFieldModule&&this.axisFieldModule.render(),this.showFieldList&&this.pivotFieldListModule&&this.pivotFieldListModule.axisFieldModule&&(this.pivotFieldListModule.setProperties({showValuesButton:e.showValuesButton},!0),this.pivotFieldListModule.axisFieldModule.render());break;case"showTooltip":this.renderToolTip();break;case"showToolbar":case"toolbar":this.toolbarModule&&this.showToolbar&&this.toolbarModule.refreshToolbar();break;case"chartTypes":this.toolbarModule&&this.toolbarModule.createChartMenu();break;case"aggregateTypes":this.showGroupingBar&&this.groupingBarModule&&this.axisFieldModule&&this.axisFieldModule.render(),this.showFieldList&&this.pivotFieldListModule&&this.pivotFieldListModule.axisFieldModule&&(this.pivotFieldListModule.setProperties({aggregateTypes:e.aggregateTypes},!0),this.pivotFieldListModule.axisFieldModule.render());break;case"enableFieldSearching":this.pivotFieldListModule&&(this.pivotFieldListModule.enableFieldSearching=this.enableFieldSearching);break;case"pageSettings":this.enableVirtualization||(this.engineModule.pageSettings=this.pageSettings,this.engineModule.fieldList?this.refreshPageData():this.initialLoad());break;case"pagerSettings":case"enablePaging":this.isStaticFieldList&&this.isStaticRefresh&&(this.isStaticRefresh=!1),this.initialLoad();break;case"cellTemplate":this.cellTemplateFn=this.templateParser(this.cellTemplate),i=!0;break;case"tooltipTemplate":this.tooltipTemplateFn=this.templateParser(this.tooltipTemplate),i=!0;break;case"allowCalculatedField":this.pivotFieldListModule&&(this.pivotFieldListModule.allowCalculatedField=this.allowCalculatedField);break;case"allowDeferLayoutUpdate":this.pivotDeferLayoutUpdate=this.allowDeferLayoutUpdate,this.pivotFieldListModule&&(this.pivotFieldListModule.allowDeferLayoutUpdate=this.allowDeferLayoutUpdate);break;case"allowGrouping":this.refresh()}}i&&this.grid&&this.grid.refreshColumns()},Kyt.prototype.toggleButtonState=function(e,t){var e=this.element.querySelector("."+e);e&&(e=e.closest(".e-toolbar-item"))&&("add"===t?e.classList.add(Bht):"remove"===t&&e.classList.remove(Bht))},Kyt.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){return oo(t)}},Kyt.prototype.getCellTemplate=function(){return this.cellTemplateFn},Kyt.prototype.appendHtml=function(e,t){var i=document.createElement("div");return i.innerHTML=t,je(i.firstChild)||e.appendChild(i.firstChild),e},Kyt.prototype.renderPivotGrid=function(){this.isEmptyGrid=!1,this.notEmpty=!0,this.clearTemplate(),this.showGroupingBar&&(this.pivotChartModule&&this.appendChartElement(),this.groupingBarModule.appendToElement()),this.pivotChartModule&&(this.pivotChartModule.engineModule=this.engineModule,this.pivotChartModule.loadChart(this,this.chartSettings),this.enableRtl)&&this.chart&&"rtl"!==document.body.getAttribute("dir")&&U([this.chart.element],"e-ltr"),this.enableVirtualization&&(this.virtualscrollModule=new mmt(this)),(this.allowDrillThrough||this.editSettings.allowEditing)&&(this.drillThroughModule=new bmt(this)),this.enablePaging&&this.notify(Ict,this),"Chart"!==this.displayOption.view?(this.hyperlinkSettings&&(this.isRowCellHyperlink=!!this.hyperlinkSettings.showRowHeaderHyperlink||!!this.hyperlinkSettings.showHyperlink,this.isColumnCellHyperlink=!!this.hyperlinkSettings.showColumnHeaderHyperlink||!!this.hyperlinkSettings.showHyperlink,this.isValueCellHyperlink=!!this.hyperlinkSettings.showValueCellHyperlink||!!this.hyperlinkSettings.showHyperlink,this.isSummaryCellHyperlink=!!this.hyperlinkSettings.showSummaryCellHyperlink||!!this.hyperlinkSettings.showHyperlink,this.applyHyperlinkSettings()),this.renderModule=this.renderModule||new ugt(this),this.renderModule.render(!0)):this.grid&&ue(this.grid.element);var e=this.actionObj.actionName===Nct||this.actionObj.actionName===nut,t=this.actionObj.actionName===out||this.actionObj.actionName===Oct;!(this.showFieldList||this.allowNumberFormatting||this.allowCalculatedField||this.toolbar||this.allowGrouping||this.gridSettings.contextMenuItems)||e||t||(this.notify(mct,this),this.pivotFieldListModule&&this.allowDeferLayoutUpdate&&(this.pivotFieldListModule.clonedDataSource=Hdt.getClonedDataSourceSettings(this.dataSourceSettings))),this.allowConditionalFormatting&&this.applyFormatting(this.pivotValues),this.showToolbar&&"Both"===this.displayOption.view&&this.chart&&this.grid&&(this.showGroupingBar&&this.groupingBarModule&&this.element.querySelector("."+Tlt)&&this.groupingBarModule.refreshUI(),this.toolbarModule&&this.toolbarModule.toolbar&&(this.toolbarModule.toolbar.width=this.getGridWidthAsNumber()),this.chartSettings.enableScrollOnMultiAxis&&this.chartSettings.enableMultipleAxis&&(this.element.querySelector("."+gdt).style.width=T(this.getGridWidthAsNumber())),this.chart.width=T(this.getGridWidthAsNumber()),"Table"===this.currentView?(this.grid.element.style.display="",this.chart.element.style.display="none",this.chartSettings.enableMultipleAxis&&this.chartSettings.enableScrollOnMultiAxis&&(this.element.querySelector(".e-pivotchart").style.display="none")):(this.grid.element.style.display="none",this.chart.element.style.display="",this.chartSettings.enableMultipleAxis&&this.chartSettings.enableScrollOnMultiAxis&&(this.element.querySelector(".e-pivotchart").style.display=""))),this.toolbarModule&&(Hdt.toggleFieldListIconVisibility(this),this.toolbarModule&&"New"!==this.toolbarModule.action&&"Load"!==this.toolbarModule.action&&"Remove"!==this.toolbarModule.action&&(this.isModified=!0),this.isInitialRendering||(this.isModified=!1,this.isInitialRendering=!this.isInitialRendering),this.toolbarModule.action="")},Kyt.prototype.appendChartElement=function(){var e,t;ge("#"+this.element.id+"_chart",this.element)||("Both"===this.displayOption.view&&"Chart"===this.displayOption.primary?this.element.insertBefore(Q("div",{className:gdt,id:this.element.id+"_chart"}),this.element.querySelector("."+Mht)):this.element.appendChild(Q("div",{className:gdt,id:this.element.id+"_chart"})),e=this.width.toString(),this.showToolbar&&this.grid&&(e=this.getGridWidthAsNumber().toString()),t=this.pivotChartModule.getChartHeight(),new(this.chartSettings&&this.chartSettings.chartSeries&&-1<this.pivotChartModule.accumulationType.indexOf(this.chartSettings.chartSeries.type)?oxe:twe)({width:e,height:t}).appendTo(ge("#"+this.element.id+"_chart",this.element)),this.showToolbar&&("Both"===this.displayOption.view&&"Chart"===this.currentView&&(this.grid.element.style.display="none"),"Chart"!==this.currentView)&&(ge("#"+this.element.id+"_chart",this.element).style.display="none"))},Kyt.prototype.showWaitingPopup=function(){this.grid&&this.grid.element&&!this.spinnerTemplate&&"Table"===this.currentView?kA(this.grid.element):kA(this.element)},Kyt.prototype.hideWaitingPopup=function(){this.grid&&this.grid.element&&!this.spinnerTemplate&&"Table"===this.currentView?BA(this.grid.element):BA(this.element)},Kyt.prototype.updateDataSource=function(){var i=this,n=(this.showWaitingPopup(),this),o=!je(n.lastSortInfo)&&0<Object.keys(n.lastSortInfo).length,r=!je(n.lastFilterInfo)&&0<Object.keys(n.lastFilterInfo).length,s=!je(n.lastAggregationInfo)&&0<Object.keys(n.lastAggregationInfo).length,a=!je(n.lastCalcFieldInfo)&&0<Object.keys(n.lastCalcFieldInfo).length,e={dataSourceSettings:Hdt.getClonedDataSourceSettings(n.dataSourceSettings)};n.trigger(Udt,e,function(e){var t;(n.enableVirtualization||n.enablePaging)&&(o||r||s||a)||Hdt.updateDataSourceSettings(n,e.dataSourceSettings),n.updatePageSettings(!1),o&&""!==n.dataSourceSettings.valueSortSettings.headerText&&n.setProperties({dataSourceSettings:{valueSortSettings:{headerText:""}}},!0),"pivot"===n.dataType&&(n.enableVirtualization||n.enablePaging)&&(o||r||s||a)?(o&&("Server"===i.dataSourceSettings.mode?n.getEngine("onSort",null,n.lastSortInfo,null,null,null,null):n.engineModule.onSort(n.lastSortInfo,n.dataSourceSettings),n.lastSortInfo={}),s&&("Server"===i.dataSourceSettings.mode?n.getEngine("onAggregation",null,null,n.lastAggregationInfo,null,null,null):n.engineModule.onAggregation(n.lastAggregationInfo,n.dataSourceSettings),n.lastAggregationInfo={}),a&&("Server"===i.dataSourceSettings.mode?n.getEngine("onCalcOperation",null,null,null,n.lastCalcFieldInfo,null,null):n.engineModule.onCalcOperation(n.lastCalcFieldInfo,n.dataSourceSettings),n.lastCalcFieldInfo={}),r&&("Server"===i.dataSourceSettings.mode?n.getEngine("onFilter",null,null,null,null,n.lastFilterInfo,null):n.engineModule.onFilter(n.lastFilterInfo,n.dataSourceSettings),n.lastFilterInfo={}),n.allowServerDataBinding=!1,n.setProperties({pivotValues:n.engineModule.pivotValues},!0),n.allowServerDataBinding=!0,"Server"!==n.dataSourceSettings.mode&&n.enginePopulatedEventMethod("updateDataSource")):"olap"===n.dataType?(t={mode:"",savedFieldList:n.olapEngineModule.fieldList,savedFieldListData:n.olapEngineModule.fieldListData,pageSettings:n.pageSettings,enableValueSorting:n.enableValueSorting,isDrillThrough:n.allowDrillThrough||n.editSettings.allowEditing,localeObj:n.localeObj,enableVirtualization:i.enableVirtualization},a||o?(n.olapEngineModule.savedFieldList=n.olapEngineModule.fieldList,n.olapEngineModule.savedFieldListData=n.olapEngineModule.fieldListData,a?(n.olapEngineModule.updateCalcFields(n.dataSourceSettings,n.lastCalcFieldInfo),n.lastCalcFieldInfo={}):(n.olapEngineModule.onSort(n.dataSourceSettings),n.lastSortInfo={})):Hdt.renderOlapEngine(n,t),n.allowServerDataBinding=!1,n.setProperties({pivotValues:n.olapEngineModule.pivotValues},!0),n.allowServerDataBinding=!0,n.enginePopulatedEventMethod("updateDataSource")):(t={mode:"",savedFieldList:n.engineModule.fieldList,pageSettings:n.pageSettings,enableValueSorting:n.enableValueSorting,isDrillThrough:n.allowDrillThrough||n.editSettings.allowEditing,localeObj:n.localeObj,fieldsType:n.fieldsType,clonedReport:n.clonedReport,globalize:n.globalize,currenyCode:n.currencyCode,enablePaging:i.enablePaging,enableVirtualization:i.enableVirtualization,allowDataCompression:i.allowDataCompression,enableHtmlSanitizer:i.enableHtmlSanitizer,enableOptimizedRendering:i.enableVirtualization&&i.virtualscrollModule&&i.virtualScrollSettings.allowSinglePage,isTabularLayout:i.isTabular},"Server"===n.dataSourceSettings.mode?o?n.getEngine("onSort",null,n.lastSortInfo,null,null,null,null):s?n.getEngine("onAggregation",null,null,n.lastAggregationInfo,null,null,null):a?n.getEngine("onCalcOperation",null,null,null,n.lastCalcFieldInfo,null,null):r?n.getEngine("onFilter",null,null,null,null,n.lastFilterInfo,null):n.getEngine("onDrop",null,null,null,null,null,null):(n.engineModule.renderEngine(n.dataSourceSettings,t,n.aggregateCellInfo?n.getValueCellInfo.bind(n):void 0,n.onHeadersSort?n.getHeaderSortInfo.bind(n):void 0),n.allowServerDataBinding=!1,n.setProperties({pivotValues:n.engineModule.pivotValues},!0),n.allowServerDataBinding=!0,n.enginePopulatedEventMethod("updateDataSource")),n.lastSortInfo={},n.lastAggregationInfo={},n.lastCalcFieldInfo={},n.lastFilterInfo={})})},Kyt.prototype.refreshPageData=function(){var e={dataSourceSettings:Hdt.getClonedDataSourceSettings(this.dataSourceSettings)};this.actionBeginMethod(),this.showWaitingPopup(),this.trigger(Udt,e),"pivot"===this.dataType&&("Server"===this.dataSourceSettings.mode?this.getEngine("onPageChange",null,null,null,null,null,null):this.engineModule.generateGridData(this.dataSourceSettings,!0,!1,this.engineModule.headerCollection),this.setProperties({pivotValues:this.engineModule.pivotValues},!0),this.enginePopulatedEventMethod("updateDataSource")),this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&this.actionCompleteMethod()},Kyt.prototype.excelExport=function(e,t,i,n){"Server"===this.dataSourceSettings.mode?this.getEngine("onExcelExport",null,null,null,null,null,null,null,null,e):(this.enableVirtualization||this.enablePaging||this.allowEngineExport||this.allowConditionalFormatting&&0<this.dataSourceSettings.conditionalFormatSettings.length?this.excelExportModule.exportToExcel("Excel",e,n):(this.exportType="Excel",this.grid.excelExport(e,t,i,n)),this.actionObj.actionName=this.getActionCompleteName(),t={exportInfo:{type:this.exportType,info:e}},this.actionObj.actionInfo=t,this.actionObj.actionName&&this.actionCompleteMethod())},Kyt.prototype.csvExport=function(e,t,i,n){"Server"===this.dataSourceSettings.mode?this.getEngine("onCsvExport",null,null,null,null,null,null,null,null,e):(this.enableVirtualization||this.enablePaging||this.allowEngineExport||this.allowConditionalFormatting&&0<this.dataSourceSettings.conditionalFormatSettings.length?this.excelExportModule.exportToExcel("CSV",e,n):(this.exportType="CSV",this.grid.csvExport(e,t,i,n)),this.actionObj.actionName=this.getActionCompleteName(),t={exportInfo:{type:this.exportType,info:e}},this.actionObj.actionInfo=t,this.actionObj.actionName&&this.actionCompleteMethod())},Kyt.prototype.gridPdfExport=function(e,t,i,n){t={pdfExportProperties:e,isMultipleExport:t,isBlob:n,pdfDoc:i,currentExportView:"Table",pdfMargins:{}},n=null,this.trigger(Xdt,t),this.pdfExportModule&&(this.pdfExportModule.exportProperties=t),n="Server"!==this.dataSourceSettings.mode&&(this.enableVirtualization||this.enablePaging||this.allowEngineExport||0<Object.keys(t.pdfMargins).length||t.height||t.width||this.allowConditionalFormatting&&0<this.dataSourceSettings.conditionalFormatSettings.length)?this.pdfExportModule.exportToPDF(t.pdfExportProperties,t.isMultipleExport,t.pdfDoc,t.isBlob):this.grid.pdfExport(t.pdfExportProperties,t.isMultipleExport,t.pdfDoc,t.isBlob),this.actionObj.actionName=this.getActionCompleteName(),i={exportInfo:{type:"PDF",info:e}};return this.actionObj.actionInfo=i,this.actionObj.actionName&&this.actionCompleteMethod(),n},Kyt.prototype.chartExport=function(e,t,i,n,o){i={pdfExportProperties:t,isMultipleExport:i,isBlob:o,pdfDoc:n,type:e,currentExportView:"Chart",pdfMargins:{}},this.trigger(Xdt,i),o=(this.chartExportModule.exportProperties=i).fileName||(je(t)||je(t.fileName)?"default":t.fileName),t="PDF"===e?this.chartExportModule.pdfChartExport(i.pdfExportProperties,i.pdfDoc,i.isMultipleExport,i.isBlob):(n=0===i.orientation||i.orientation?i.orientation:je(t)||je(t.pageOrientation)||"Landscape"===t.pageOrientation?up.Landscape:up.Portrait,this.chart.exportModule.export(i.type,o,n,null)),this.actionObj.actionName=this.getActionCompleteName(),i={exportInfo:{type:e,info:o}};return this.actionObj.actionInfo=i,this.actionObj.actionName&&this.actionCompleteMethod(),t},Kyt.prototype.pdfExport=function(i,n,o,r,s){var a=this,l=null;return new Promise(function(t){var e;s&&"Both"===a.displayOption.view?"Chart"===a.displayOption.primary?a.chartExport("PDF",i,!0,o,!1).then(function(e){l=a.gridPdfExport(i,n,e,r),t(l)}):a.gridPdfExport(i,!0,o,!1).then(function(e){l=a.chartExport("PDF",i,n,e,r),t(l)}):(e=a.gridPdfExport(i,n,o,r),t(e))})},Kyt.prototype.printChart=function(){this.chart&&this.chart.print()},Kyt.prototype.onDrill=function(e,t){var i=this,n=this.dataSourceSettings.drilledMembers[0]&&this.dataSourceSettings.drilledMembers[0].delimiter?this.dataSourceSettings.drilledMembers[0].delimiter:"**",o="",r="",s="";if(s=t?(o=t.fieldName,r=t.cell.axis,t.isDrilled?"up":"down"):(l=e.closest("td.e-rowsheader"),o=z(e,"row"===(r=l?"row":"column")?"td":"th").getAttribute("fieldname"),e.classList.contains($lt)?"up":"down"),"pivot"===this.dataType){var a=Hdt.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers),l="row"===r?parseInt(z(e,"td").getAttribute("aria-colindex"),10)-1:parseInt(z(e,"th").getAttribute("aria-colindex"),10)-1,h="row"===r?Number(z(e,"td").getAttribute("index")):Number(z(e,"th").getAttribute("index")),h=t?t.cell:this.engineModule.pivotValues[h][l],d=h.valueSort.levelName.split(this.engineModule.valueSortSettings.headerDelimiter).join(n),p=!1;if(0===this.dataSourceSettings.drilledMembers.length)this.setProperties({dataSourceSettings:{drilledMembers:[{name:o,items:[d],delimiter:n}]}},!0);else{for(var c=Hdt.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers),u=0;u<c.length;u++){var g,m=c[u],d=d.split(n).join(m.delimiter||n),n=m.delimiter=m.delimiter||n;m.name===o&&(p=!0,-1<(g=m.items.indexOf(d))?m.items.splice(g,1):m.items.push(d))}this.setProperties({dataSourceSettings:{drilledMembers:c}},!0),p||this.dataSourceSettings.drilledMembers.push({name:o,items:[d],delimiter:n})}this.showWaitingPopup();var f=this,y={fieldName:o,memberName:d,delimiter:n,axis:r,action:s,currentCell:h};f.trigger(dpt,{drillInfo:y,pivotview:f,cancel:!1},function(e){e.cancel?(i.hideWaitingPopup(),i.setProperties({dataSourceSettings:{drilledMembers:a}},!0)):(e={dataSourceSettings:Hdt.getClonedDataSourceSettings(i.dataSourceSettings)},f.trigger(Udt,e),f.setProperties({dataSourceSettings:e.dataSourceSettings},!0),f.enableVirtualization||f.enablePaging?"Server"===i.dataSourceSettings.mode?i.getEngine("onDrill",y,null,null,null,null,null):(f.engineModule.drilledMembers=f.dataSourceSettings.drilledMembers,f.engineModule.onDrill(y)):"Server"===i.dataSourceSettings.mode?i.getEngine("onDrill",y,null,null,null,null,null):f.engineModule.generateGridData(f.dataSourceSettings,!0),f.allowServerDataBinding=!1,f.setProperties({pivotValues:f.engineModule.pivotValues},!0),f.allowServerDataBinding=!0,e={dataSourceSettings:Hdt.getClonedDataSourceSettings(e.dataSourceSettings),pivotValues:i.pivotValues},i.trigger(qdt,e),f.engineModule.pivotValues=e.pivotValues,i.actionObj.actionInfo={drillInfo:y},f.renderPivotGrid())})}else this.onOlapDrill(o,r,s,n,e,t)},Kyt.prototype.onOlapDrill=function(O,e,t,N,i,n){var o=this,r=this,s=Hdt.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers),n=(i=n?n.cell:(n="row"===e?parseInt(z(i,"td").getAttribute("aria-colindex"),10)-1:parseInt(z(i,"th").getAttribute("aria-colindex"),10)-1,i="row"===e?Number(z(i,"td").getAttribute("index")):Number(z(i,"th").getAttribute("index")),this.olapEngineModule.pivotValues[i][n]),("row"===e?this.olapEngineModule.tupRowInfo:this.olapEngineModule.tupColumnInfo)[i.ordinal]),a={axis:e,action:t,fieldName:O,delimiter:"~~",memberName:n.uNameCollection,currentCell:i},t=(this.showWaitingPopup(),{drillInfo:a,pivotview:r,cancel:!1}),l=this.olapEngineModule.fieldList[a.fieldName]&&this.olapEngineModule.fieldList[a.fieldName].isHierarchy,h=n.drillInfo.map(function(e){return e.hierarchy}).indexOf(i.hierarchy.toString()),d=Hdt.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers);if(a&&"down"===a.action){for(var p=n.drillInfo.map(function(e){return e.uName}),c="",u=0;u<=h;u++)c=c+(""!==c?"~~":"")+(D=(E=p[u]).split("~~"))[D.length-1];for(var g=this.olapEngineModule.getDrilledSets(a.memberName,i,this.olapEngineModule.fieldList[i.hierarchy]&&!this.olapEngineModule.fieldList[i.hierarchy].hasAllMember?i.valueSort.levelName.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length-1:h,e),m=0,f=M=Object.keys(g);m<f.length;m++)for(var y=g[f[m]],v=0,b=d.length;v<b;v++){for(var w=d[v],C=y,S=(w.delimiter&&(C=C.replace(/~~/g,w.delimiter)),[]),A=0;A<w.items.length;A++)0!==w.items[A].indexOf(C)&&(S[S.length]=w.items[A]);w.items=S}this.olapEngineModule.drilledSets[i.actualText]=n.members[h],a.memberName=c;for(var x=[],I=0,T=d;I<T.length;I++)(E=T[I]).name===a.fieldName&&x.push(E);if(0<x.length){if(x[0].delimiter&&(c=c.replace(/~~/g,x[0].delimiter)),-1===Hdt.inArray(c,x[0].items)&&x[0].items.push(c),l)for(v=0;v<x[0].items.length;)x[0].items[v]===c?x[0].items.splice(v,1):++v}else l||(B={name:a.fieldName,items:[c],delimiter:"~~"},d?d.push(B):d=[B]);t.drillInfo.memberName=c,this.setProperties({dataSourceSettings:{drilledMembers:d}},!0),r.trigger(dpt,t,function(e){e.cancel?(o.hideWaitingPopup(),o.setProperties({dataSourceSettings:{drilledMembers:s}},!0)):(e={dataSourceSettings:Hdt.getClonedDataSourceSettings(o.dataSourceSettings)},o.trigger(Udt,e),o.setProperties({dataSourceSettings:e.dataSourceSettings},!0),o.olapEngineModule.updateDrilledInfo(o.dataSourceSettings),o.allowServerDataBinding=!1,o.setProperties({pivotValues:o.olapEngineModule.pivotValues},!0),o.allowServerDataBinding=!0,e={dataSourceSettings:Hdt.getClonedDataSourceSettings(e.dataSourceSettings),pivotValues:r.olapEngineModule.pivotValues},o.trigger(qdt,e),o.olapEngineModule.pivotValues=e.pivotValues,o.renderPivotGrid())})}else{delete this.olapEngineModule.drilledSets[i.actualText];for(var E,D,g=this.olapEngineModule.getDrilledSets(a.memberName,i,h,e),M=Object.keys(g),p=n.drillInfo.map(function(e){return e.uName}),c="",u=0;u<=h;u++)c=c+(""!==c?"~~":"")+(D=(E=p[u]).split("~~"))[D.length-1];for(var k=0,P=M;k<P.length;k++){for(var B,y=g[P[k]],F=[],v=0,b=d.length;v<b;v++){var L=y;if((x=d[v]).name===a.fieldName&&F.push(x),x.delimiter&&(L=y.replace(/~~/g,x.delimiter)),!l){for(S=[],A=0;A<x.items.length;A++)0!==x.items[A].indexOf(L)&&(S[S.length]=x.items[A]);x.items=S}}l&&(0<F.length?(F[0].delimiter&&(c=c.replace(/~~/g,F[0].delimiter)),-1===Hdt.inArray(c,F[0].items)&&F[0].items.push(c)):(B={name:a.fieldName,items:[c],delimiter:"~~"},d?d.push(B):d=[B]))}for(var V=[],R=0,_=d;R<_.length;R++){var H=_[R];0<H.items.length&&V.push(H)}this.setProperties({dataSourceSettings:{drilledMembers:d}},!0),r.trigger(dpt,t,function(e){e.cancel?(o.hideWaitingPopup(),o.setProperties({dataSourceSettings:{drilledMembers:s}},!0)):(e={dataSourceSettings:Hdt.getClonedDataSourceSettings(o.dataSourceSettings)},o.trigger(Udt,e),o.setProperties({dataSourceSettings:e.dataSourceSettings},!0),o.setProperties({dataSourceSettings:{drilledMembers:V}},!0),o.olapEngineModule.updateDrilledInfo(o.dataSourceSettings),o.allowServerDataBinding=!1,o.setProperties({pivotValues:o.olapEngineModule.pivotValues},!0),o.allowServerDataBinding=!0,e={dataSourceSettings:Hdt.getClonedDataSourceSettings(e.dataSourceSettings),pivotValues:r.olapEngineModule.pivotValues},o.trigger(qdt,e),o.olapEngineModule.pivotValues=e.pivotValues,o.renderPivotGrid())})}},Kyt.prototype.onContentReady=function(){var e,t,i,n,o,r,s,a,l=aB(),h=(this.isPopupClicked=!1,this.showFieldList&&this.pivotFieldListModule&&"Server"!==this.dataSourceSettings.mode?(this.pivotFieldListModule.element.style.display="block",BA(this.pivotFieldListModule.fieldListSpinnerElement)):this.fieldListSpinnerElement&&BA(this.fieldListSpinnerElement),this.isEmptyGrid?0<this.pivotValues.length&&(this.isEmptyGrid=!1,this.notEmpty=!0):("Server"===this.dataSourceSettings.mode&&this.isServerWaitingPopup||"Local"===this.dataSourceSettings.mode)&&this.hideWaitingPopup(),this.element.querySelector("."+qht)?this.element.querySelector("."+qht):this.element.querySelector("."+Zat)),d=this.element.querySelector("."+Yht),p=this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage&&"pivot"===this.dataType;this.grid&&(r=this.element.querySelector("."+rdt),a=h.parentElement.offsetWidth<h.querySelector("."+tht).offsetWidth,s="pivot"===this.dataType?this.engineModule:this.olapEngineModule,this.enableVirtualization&&s&&this.virtualscrollModule&&(p&&this.element.querySelector("."+Fdt)&&(q([d,h],["e-virtual-pivot-content"]),U([this.element.querySelector("."+Fdt)],[Ldt]),this.grid)&&this.grid.element.querySelector(".e-spinner-inner")&&q([this.grid.element.querySelector(".e-spinner-inner")],[Ldt]),p&&((o=this.element.querySelector("."+Fdt))||(o=Q("div",{className:Fdt+" "+Ldt,innerHTML:this.localeObj.getConstant("loading")}),this.grid.element&&!this.element.querySelector("."+Fdt)&&this.grid.element.insertBefore(o,this.grid.element.firstElementChild)),this.element.querySelector("."+Zht))&&this.element.querySelector("."+rdt)&&gt(o,{height:(o=this.element.querySelector("."+rdt).offsetHeight+this.element.querySelector("."+Zht).offsetHeight)+"px",width:this.element.querySelector("."+Zht).offsetWidth+"px",padding:Math.floor(o/2)+"px"}),this.element.querySelector("."+Zat)&&!this.element.querySelector("."+Zat).querySelector("."+Qht)&&(this.virtualDiv=Q("div",{className:Qht}),this.element.querySelector("."+Zat).appendChild(this.virtualDiv)),this.element.querySelector("."+Yht)&&!this.element.querySelector("."+Yht).querySelector("."+Qht)?(this.virtualHeaderDiv=Q("div",{className:Qht}),this.element.querySelector("."+Yht).appendChild(this.virtualHeaderDiv)):this.virtualHeaderDiv=this.element.querySelector("."+Yht).querySelector("."+Qht),o=r.querySelector("."+Uht),r&&!o&&(this.virtualTableDiv=Q("div",{className:Uht}),r.appendChild(this.virtualTableDiv),o=r.querySelector("."+Uht),this.virtualScrollDiv=Q("div",{className:Ght}),o.appendChild(this.virtualScrollDiv),gt(o,{minHeight:l+"px",maxHeight:l+"px",overflowX:"scroll"}),gt(this.virtualScrollDiv,{height:"0.1px"}),(t=Q("div",{className:qht})).append.apply(t,Array.prototype.slice.call(h.childNodes)),h.appendChild(t),t.scrollLeft=0),t=this.element.querySelector("."+Zat).querySelector("."+tht),(t=this.gridSettings.rowHeight*s.rowCount+.1-t.clientHeight)>this.scrollerBrowserLimit&&(this.verticalScrollScale=t/this.scrollerBrowserLimit,t=this.scrollerBrowserLimit),(e=this.gridSettings.columnWidth*s.columnCount)>this.scrollerBrowserLimit&&(this.horizontalScrollScale=e/this.scrollerBrowserLimit,e=this.scrollerBrowserLimit),gt(this.virtualDiv,{height:(.1<t?t:.1)+"px",width:(.1<e?e:.1)+"px"}),gt(this.virtualHeaderDiv,{height:0,width:(.1<e?e:.1)+"px"}),this.isAdaptive&&(h.style.minHeight="1px",h.style.minHeight="1px"),s=!this.isAdaptive&&r.querySelector("."+Uht)?r.querySelector("."+Uht):h,t=h.parentElement.scrollTop>this.scrollerBrowserLimit?h.querySelector("."+tht).style.transform.split(",")[1].trim():(p?h.parentElement.scrollTop:-(h.parentElement.scrollTop*this.verticalScrollScale-this.scrollPosObject.verticalSection-h.parentElement.scrollTop))+"px)",Number(t.split("px")[0])>this.virtualDiv.clientHeight&&(t=this.virtualDiv.clientHeight+"px)"),n=(i=Math.abs(s.scrollLeft))>this.scrollerBrowserLimit?h.querySelector("."+tht).style.transform.split(",")[0].trim()+",":"translate("+(this.enableRtl?1:-1)*(i*this.horizontalScrollScale-this.scrollPosObject.horizontalSection-i)+"px,",gt(h.querySelector("."+tht),{transform:n+t}),gt(d.querySelector("."+tht),{transform:n+"0px)"}),!a&&r&&o||this.isAdaptive?o.style.display="none":o.style.display="block",o=Number(-h.querySelector("."+tht).style.transform.split("(")[1].split(",")[0].split("px")[0]),this.virtualscrollModule.alignFreezedCells(o,!0),a&&(a=0,a=this.pivotColumns.length<25?e+h.querySelector("."+tht).querySelector("."+Bdt).offsetWidth+(r.offsetWidth-r.clientWidth):e+(r.offsetWidth-r.clientWidth),"auto"!==this.grid.height?this.grid.element.querySelector("."+Ght).style.width=a+l+"px":this.grid.element.querySelector("."+Ght).style.width=a+"px"),this.grid.element.querySelector("."+qht)&&h.parentElement.scrollHeight===h.scrollHeight&&(h.style.overflowY=""),r="pivot"===this.dataType&&"column"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1,a=this.pageSettings.columnPageSize*r*this.gridSettings.columnWidth,r=s.scrollWidth-(Math.abs(i)+s.offsetWidth),this.virtualscrollModule)&&0<a&&r<=a&&0<i&&(s=void 0,(a=h.scrollWidth-(Math.abs(h.scrollLeft)+h.parentElement.offsetWidth))<1&&"horizondal"===this.scrollDirection&&(0<h.parentElement.scrollTop&&(s=h.parentElement.scrollTop),this.virtualDiv.style.display="none",a=h.scrollWidth-(Math.abs(h.scrollLeft)+h.parentElement.offsetWidth)),this.virtualDiv.style.display="",s&&(h.parentElement.scrollTop=s),s=h.scrollWidth-(Math.abs(h.scrollLeft)+h.parentElement.offsetWidth),1<a&&(this.scrollPosObject.horizontalSection-=r<=0?r<a?a:-s:s===a?a-r:a<s&&(r==s||a<r)?-(s-a):0,"auto"!==this.grid.height&&(this.scrollPosObject.horizontalSection-=l),this.scrollPosObject.horizontalSection=this.scrollPosObject.horizontalSection>=-this.element.querySelector("."+Mht).querySelector("."+oht+"."+Bdt).offsetWidth?this.scrollPosObject.horizontalSection:-this.element.querySelector("."+Mht).querySelector("."+oht+"."+Bdt).offsetWidth),n=i>this.scrollerBrowserLimit?h.querySelector("."+tht).style.transform.split(",")[0].trim()+",":"translate("+(this.enableRtl?1:-1)*(i*this.horizontalScrollScale-this.scrollPosObject.horizontalSection-i)+"px,",gt(h.querySelector("."+tht),{transform:n+t}),gt(d.querySelector("."+tht),{transform:n+"0px)"}),o=Number(-h.querySelector("."+tht).style.transform.split("(")[1].split(",")[0].split("px")[0]),this.virtualscrollModule.alignFreezedCells(o,!0)),"Chart"!==this.currentView&&this.grid.hideScroll(),this.showGroupingBar?(this.groupingBarModule&&this.element.querySelector("."+Tlt)&&this.groupingBarModule.setGridRowWidth(),this.actionObj.fieldInfo&&this.actionObj.fieldInfo.fieldName&&(je(r=this.pivotButtonModule.parentElement.querySelector('[data-uid="'+this.actionObj.fieldInfo.fieldName+'"]'))||r.focus()),this.element.style.minWidth=this.isAdaptive?this.minWidth?this.minWidth+"px":"310px":this.minWidth?this.minWidth+"px":"400px",this.grid.element.style.minWidth=this.isAdaptive?this.minWidth?this.minWidth+"px":"310px":this.minWidth?this.minWidth+"px":"400px"):(this.element.style.minWidth=this.minWidth?this.minWidth+"px":"310px",this.grid.element.style.minWidth=this.minWidth?this.minWidth+"px":"310px")),this.unwireEvents(),this.wireEvents(),this.isChartLoaded=!1,this.isEmptyGrid||this.trigger(ipt),this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&(this.actionObj.actionName===Zut&&this.pivotCommon&&this.pivotCommon.filterDialog&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.pivotCommon.filterDialog.setFocus.bind(this.pivotCommon.filterDialog))),this.actionObj.actionName!==yut)&&this.actionCompleteMethod(),this.groupingModule&&(this.groupingModule.isUpdate=!1),this.engineModule&&this.engineModule.clearProperties(),this.virtualscrollModule&&this.grid&&this.virtualscrollModule.onHorizondalScroll(d,h),!this.isAdaptive&&this.enableVirtualization&&h&&this.virtualscrollModule&&!p&&(s=h.parentElement.parentElement.querySelector(".e-movablescrolldiv"),e<3*h.parentElement.clientWidth?(h.style.overflowX="visible",s.style.display="none",d.scrollLeft=h.parentElement.scrollLeft,gt(h.querySelector("."+tht),{transform:"translate(0px,"+t}),gt(d.querySelector("."+tht),{transform:"translate(0px, 0px)"}),this.virtualscrollModule.alignFreezedCells(0,!0)):(E.remove(this.element.querySelector("."+rdt).querySelector("."+Zat),"scroll",this.headerScrollUpdate),a=this.element.querySelector("."+rdt).querySelector("."+Zat).scrollLeft,h.style.overflowX="auto",s.style.display="block",0!==a&&(s.scrollLeft=a),s.scrollLeft!==h.scrollLeft&&0!==h.scrollLeft&&(s.scrollLeft=h.scrollLeft))),this.isStaticRefresh=!1},Kyt.prototype.setToolTip=function(e){var t,i,n,o,r,s,a,l=this,h=parseInt(e.target.getAttribute("aria-colindex"),10)-1,d=Number(e.target.getAttribute("index")),p=0<this.dataSourceSettings.values.length&&this.pivotValues&&this.pivotValues[d]&&this.pivotValues[d][h]?this.pivotValues[d][h]:void 0,c=(this.tooltip.content="",!1);p&&"olap"===this.dataType?(je(n=p.actualText)||!this.olapEngineModule.fieldList||this.olapEngineModule.fieldList[n]||(r=this.olapEngineModule.tupRowInfo,n=-1<p.rowOrdinal&&0<r.length&&r[p.rowOrdinal]&&!je(r[p.rowOrdinal].measureName)?r[p.rowOrdinal].measureName:n),this.olapEngineModule.fieldList&&this.olapEngineModule.fieldList[n]&&(t=(o=this.olapEngineModule.fieldList[n]).isCalculatedField?o.type:o.aggregateType,i=(this.olapEngineModule.dataFields[n]&&this.olapEngineModule.dataFields[n].caption?this.olapEngineModule.dataFields[n]:o).caption,c=!0)):p&&this.engineModule.fieldList&&this.engineModule.fieldList[p.actualText]&&(t="DistinctCount"===(t=(o=this.engineModule.fieldList[p.actualText]).aggregateType)||"number"===o.type&&"include"!==o.type&&"exclude"!==o.type?void 0===t?"Sum":o.aggregateType:"Count",i=o.caption,c=!0),p&&c?(r=this.isTabular&&0<this.engineModule.rowMaxLevel?this.engineModule.rowMaxLevel:0,n=this.getRowText(d,r),o=this.getColText(0,h,d),c=""===p.formattedText?this.localeObj.getConstant("noValue"):p.formattedText,this.tooltipTemplate&&void 0!==this.getTooltipTemplate()?(r={rowHeaders:n,columnHeaders:o,aggregateType:t,valueField:i,value:c,rowFields:this.getHeaderField(d,h,"row"),columnFields:this.getHeaderField(d,h,"column")},"function"==typeof this.tooltipTemplate&&this.isReact?(s=document.createElement("div"),this.getTooltipTemplate()(r,this,"tooltipTemplate",this.element.id+"tooltipTemplate",null,null,s),this.renderReactTemplates(function(){l.enableHtmlSanitizer?l.tooltip.content=go.sanitize(s.outerHTML):l.tooltip.content=s.outerHTML})):(d=this.getTooltipTemplate()(r,this,"tooltipTemplate",this.element.id+"tooltipTemplate")[0].outerHTML,this.enableHtmlSanitizer?this.tooltip.content=go.sanitize(d):this.tooltip.content=d)):(a="<div class=e-pivottooltip><p class="+sht+">"+this.localeObj.getConstant("row")+":</p><p class="+aht+">"+n+"</p></br><p class="+sht+">"+this.localeObj.getConstant("column")+":</p><p class="+aht+">"+o+"</p></br>"+(""!==p.actualText?"<p class="+sht+">"+("olap"===this.dataType?"":this.localeObj.getConstant(t)+" "+this.localeObj.getConstant("of")+" ")+i+":</p><p class="+aht+">"+c+"</p></div>":""),this.tooltip.content=ao(function(){return a}))):e.cancel=!0},Kyt.prototype.getTooltipTemplate=function(){return this.tooltipTemplateFn},Kyt.prototype.getHeaderField=function(e,t,i){var n="",o="olap"===this.dataType?this.olapEngineModule:this.engineModule,r=o.valueSortSettings.headerDelimiter;if("row"===i)for(var s=this.pivotValues[e][0].valueSort.levelName.toString().split(r).length,a=0;a<s&&0<this.dataSourceSettings.rows.length&&this.dataSourceSettings.rows[a];a++)n+=(a?" - ":"")+(this.dataSourceSettings.rows[a].caption||this.dataSourceSettings.rows[a].name);else{0<this.dataSourceSettings.columns.length&&(i=0===this.dataSourceSettings.values.length?0:Number(Object.keys(o.headerContent)[Object.keys(o.headerContent).length-1]),s=this.pivotValues[i][t].valueSort.levelName.toString().split(r).length,s=1<this.dataSourceSettings.values.length?s-1:s);for(var l=0;l<s&&0<this.dataSourceSettings.columns.length&&this.dataSourceSettings.columns[l];l++)n+=(l?" - ":"")+(this.dataSourceSettings.columns[l].caption||this.dataSourceSettings.columns[l].name)}return n},Kyt.prototype.getLevel=function(e){var t=e.valueSort?e.valueSort.levelName.toString():"",e=e.actualText?e.actualText.toString().split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,t=t.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length-(e&&e-1);return t?t-1:0},Kyt.prototype.getRowText=function(e,t){var i=this.pivotValues[e][t],n="";if(i){var o=this.getLevel(i),n="grand sum"===i.type?this.localeObj.getConstant("grandTotal"):i.formattedText;if("row"===this.dataSourceSettings.valueAxis)n=(n=0===this.dataSourceSettings.rows.length&&1<this.dataSourceSettings.values.length?this.pivotValues[e][0].valueSort.levelName.toString().slice((this.localeObj.getConstant("grandTotal")+this.dataSourceSettings.valueSortSettings.headerDelimiter).length).toString():1===this.dataSourceSettings.values.length?je(this.dataSourceSettings.values[0].caption)?this.dataSourceSettings.values[0].name:this.dataSourceSettings.values[0].caption:this.pivotValues[e][0].valueSort.levelName.toString()).split(this.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - ");else if(this.isTabular)for(;0<o;)i=this.pivotValues[e][--t],n=n+this.dataSourceSettings.valueSortSettings.headerDelimiter+i.formattedText,o-=1;else for(;0<o||void 0===i.index;)void 0!==(i=this.pivotValues[--e][t]).index&&o>i.level&&(n=n+this.dataSourceSettings.valueSortSettings.headerDelimiter+i.formattedText,o-=1);n=n.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).reverse().join(" - ")}return n},Kyt.prototype.getColText=function(e,t,i){for(var n=this.pivotValues[0][t],o=n.axis,r="grand sum"===n.type?this.localeObj.getConstant("grandTotal"):n.formattedText;"value"!==o&&e<i;)this.pivotValues[++e]&&(o=(n=this.pivotValues[e][t]).axis,"sum"!==n.type)&&"grand sum"!==n.type&&"value"!==o&&(r=r+" - "+n.formattedText);return r},Kyt.prototype.updateClass=function(){(this.enableRtl?U:q)([this.element],xat),(this.isAdaptive?U:q)([this.element],Iat),this.cssClass&&U([this.element],this.cssClass.split(" "))},Kyt.prototype.mouseRclickHandler=function(e){3!==e.which&&0!==e.which||(this.lastCellClicked=e.target),this.lastCellClicked=e.target},Kyt.prototype.mouseDownHandler=function(e){3===e.which&&(this.lastCellClicked=e.target),this.isCellBoxMultiSelection&&(this.isMouseDown=!e.target.closest("."+Jat),this.isMouseUp=!1,this.lastSelectedElement=void 0)},Kyt.prototype.mouseMoveHandler=function(e){var t,i,n=this;this.isCellBoxMultiSelection&&(e.preventDefault(),i=e.target||void 0,this.isMouseDown)&&i&&!i.classList.contains("e-expand")&&!i.classList.contains("e-collapse")&&(e=i.parentElement.classList.contains(nht)||i.classList.contains(nht)?"row":"column",i=z(i,"column"==e?"th":"td"))&&(e=parseInt(i.getAttribute("aria-colindex"),10)-1,t=Number(i.getAttribute("index")),t={cancel:!1,isCellClick:!0,currentCell:i,data:this.pivotValues[t][e]},this.trigger(hpt,t,function(e){e.cancel||(n.grid.clearSelection(),e=n.parentAt(i,"TH"),n.lastSelectedElement&&n.lastSelectedElement!==e&&e.classList.contains(Kht)?(n.lastSelectedElement.classList.remove(tdt),n.lastSelectedElement.classList.remove(Kht),n.lastSelectedElement=e):(n.lastSelectedElement=e).classList.contains(oht)&&e.classList.contains(Bdt)||(e.classList.add(tdt),e.classList.add(Kht)),n.renderModule.selected())}))},Kyt.prototype.mouseUpHandler=function(){this.isCellBoxMultiSelection&&(this.isMouseDown=!1,this.isMouseUp=!0)},Kyt.prototype.parentAt=function(e,t){for(;e.tagName!==t&&e.parentElement;)e=e.parentElement;return e},Kyt.prototype.mouseClickHandler=function(e){3!==e.which&&0!==e.which||(this.lastCellClicked=e.target);var t=e.target;if(!z(t,"."+Jat)){var i=null,n=t.closest("td.e-rowsheader")?"row":"column",i=z(t,"column"==n?"th":"td");if("column"!=n||i||"Row"===this.gridSettings.selectionSettings.mode||(i=z(t,"td")),t.classList.contains($lt)||t.classList.contains(eht)||!this.enableValueSorting||t.classList.contains("e-resized")||t.classList.contains("e-rhandler")&&t.classList.contains("e-rcursor")||"olap"===this.dataType&&this.enableVirtualization)if(t.classList.contains($lt)||t.classList.contains(eht)){n=t.parentElement.getAttribute("fieldname"),r=Hdt.getFieldInfo(n,this),n=t.classList.contains($lt)?this.actionObj.actionName="Drill up":t.classList.contains(eht)?this.actionObj.actionName=Mct:"";if(this.actionObj.actionName=n,this.actionObj.fieldInfo=r.fieldItem,!this.actionBeginMethod())try{this.onDrill(t)}catch(e){this.actionFailureMethod(e)}}else this.cellClicked(t,i,e);else{n="pivot"===this.dataType?this.engineModule:this.olapEngineModule;this.cellClicked(t,i,e);try{if(i&&(i.parentElement.parentElement.parentElement.parentElement.classList.contains(Zht)&&"column"===this.dataSourceSettings.valueAxis&&!i.classList.contains(Bdt)||i.parentElement.classList.contains("e-row")&&"row"===this.dataSourceSettings.valueAxis&&(i.classList.contains("e-rowsheader")||i.classList.contains("e-stot")))){var o=i.getAttribute("fieldname"),r=Hdt.getFieldInfo(o,this);if(this.actionObj.actionName=Dct,this.actionObj.fieldInfo=r.fieldItem,!this.actionBeginMethod()){var s,a=parseInt(i.getAttribute("aria-colindex"),10)-1,l=Number(i.getAttribute("index")),h=("row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)?(s=this.pivotValues[l][a],l=-1===this.dataSourceSettings.valueIndex?"value"===s.type||3===s.memberType?l:l+1:this.getLevel(s)<=n.measureIndex&&s.members&&0<s.members.length?s.members[0].rowIndex:l):"column"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&(a=parseInt(i.getAttribute("aria-colindex"),10)-1+Number(i.getAttribute("aria-colspan"))-1,l=n.headerContent.length-1),this.setProperties({dataSourceSettings:{valueSortSettings:{columnIndex:parseInt(i.getAttribute("aria-colindex"),10)-1+Number(i.getAttribute("aria-colspan"))-1,sortOrder:"Descending"===this.dataSourceSettings.valueSortSettings.sortOrder?"Ascending":"Descending",headerText:this.pivotValues[l][a].valueSort.levelName,headerDelimiter:this.dataSourceSettings.valueSortSettings.headerDelimiter||"."}}},!0),this.showWaitingPopup(),this);if(n.enableValueSorting=!0,h.enableVirtualization||h.enablePaging){if(h.dataSourceSettings.enableSorting){for(var d=0,p=Object.keys(h.engineModule.fieldList);d<p.length;d++){var c=p[d];h.engineModule.fieldList[c].sort="Ascending"}h.setProperties({dataSourceSettings:{sortSettings:[]}},!0)}"Server"===h.dataSourceSettings.mode?h.getEngine("onValueSort",null,null,null,null,null,null):(h.engineModule.rMembers=h.engineModule.headerCollection.rowHeaders,h.engineModule.cMembers=h.engineModule.headerCollection.columnHeaders,h.engineModule.applyValueSorting(),h.engineModule.updateEngine())}else"Server"===h.dataSourceSettings.mode?h.getEngine("onValueSort",null,null,null,null,null,null):"olap"===this.dataType?h.olapEngineModule.onSort(h.dataSourceSettings,!0):h.engineModule.generateGridData(h.dataSourceSettings,!0);h.allowServerDataBinding=!1,h.setProperties({pivotValues:n.pivotValues},!0),h.allowServerDataBinding=!0;var u={valueSortInfo:n.valueSortSettings};this.actionObj.actionInfo=u,h.renderPivotGrid()}}}catch(e){this.actionFailureMethod(e)}}}},Kyt.prototype.updateTotColWidth=function(){for(var e=this.totColWidth=0,t=this.pivotColumns;e<t.length;e++){var i=t[e];this.totColWidth=this.totColWidth+i.width}},Kyt.prototype.framePivotColumns=function(e){for(var t=0,i=e;t<i.length;t++){var n,o,r=i[t];r.columns&&0<r.columns.length?this.framePivotColumns(r.columns):(n="0.formattedText"!==r.field&&r.customAttributes&&r.customAttributes.cell&&r.customAttributes.cell.valueSort?r.customAttributes.cell.valueSort.levelName:"",o=this.renderModule.setSavedWidth("0.formattedText"===r.field?r.field:n,Number("auto"===r.width?r.minWidth:r.width)),this.pivotColumns.push({allowReordering:r.allowReordering,allowResizing:r.allowResizing,headerText:n,width:o,autoFit:r.autoFit}),this.totColWidth=this.totColWidth+Number(o))}},Kyt.prototype.setGridColumns=function(e){if(!je(this.totColWidth)&&0<this.totColWidth||this.renderModule.isAutoFitEnabled){for(var t=0,i=e;t<i.length;t++){var n,o=i[t];o.columns&&0<o.columns.length?this.setGridColumns(o.columns):this.renderModule.isAutoFitEnabled?(o.autoFit=this.pivotColumns[this.posCount].autoFit,this.posCount++):(n="0.formattedText"!==o.field&&o.customAttributes?o.customAttributes.cell.valueSort.levelName:"",o.allowReordering=this.pivotColumns[this.posCount].allowReordering,o.allowResizing=this.pivotColumns[this.posCount].allowResizing,o.autoFit=this.pivotColumns[this.posCount].autoFit,n=this.renderModule.setSavedWidth("0.formattedText"===o.field?o.field:n,Number(this.pivotColumns[this.posCount].width)),o.autoFit?this.renderModule.isAutoFitEnabled=!0:"auto"!==o.width?o.width=n:o.minWidth=n,this.posCount++,o.allowReordering&&(this.gridSettings.allowReordering=!0),o.allowResizing&&(this.gridSettings.allowResizing=!0))}this.gridSettings.allowReordering&&IP.Inject(QG),this.gridSettings.allowResizing&&IP.Inject(jG)}},Kyt.prototype.fillGridColumns=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];n.allowReordering=this.gridSettings.allowReordering,n.allowResizing=this.gridSettings.allowResizing,n.clipMode=this.gridSettings.clipMode,this.posCount++,n.columns&&0<n.columns.length&&this.fillGridColumns(n.columns)}},Kyt.prototype.triggerColumnRenderEvent=function(e){this.pivotColumns=[],this.totColWidth=0,this.framePivotColumns(e);var t=this.pivotColumns[0].width,i={columns:this.pivotColumns,dataSourceSettings:this.dataSourceSettings,stackedColumns:this.getStackedColumns(e,[])};this.trigger(lpt,i),this.updateTotColWidth(),t!==this.pivotColumns[0].width&&(this.firstColWidth=this.pivotColumns[0].width,this.renderModule.resColWidth=parseInt(this.firstColWidth.toString(),10)),this.posCount=0,this.setGridColumns(e)},Kyt.prototype.setCommonColumnsWidth=function(e,t){for(var i=0,n=e;i<n.length;i++){var o=n[i];this.isTabular?o.index>this.engineModule.rowMaxLevel?o.columns?this.setCommonColumnsWidth(o.columns,t):this.setColumnWidth(o,t):o.width=this.firstColWidth||o.width:"0.formattedText"!==o.field?o.columns?this.setCommonColumnsWidth(o.columns,t):this.setColumnWidth(o,t):o.width=this.firstColWidth||o.width}},Kyt.prototype.getHeightAsNumber=function(){var e,t;return isNaN(this.height)?-1<this.height.toString().indexOf("%")?(this.isAngular&&this.element&&this.element.style&&(t=window.getComputedStyle(this.element).display,this.element.style.display="block"),e=parseFloat(this.height.toString())/100*this.element.offsetHeight,this.isAngular&&this.element&&this.element.style&&(this.element.style.display=t)):-1<this.height.toString().indexOf("px")&&(e=Number(this.height.toString().split("px")[0])):e=Number(this.height),e=e<this.minHeight||"auto"===this.height?this.minHeight:e},Kyt.prototype.getWidthAsNumber=function(){var e;return isNaN(this.width)?(-1<this.width.toString().indexOf("%")?e=parseFloat(this.width.toString())/100*this.element.offsetWidth:-1<this.width.toString().indexOf("px")&&(e=Number(this.width.toString().split("px")[0])),isNaN(e)&&(e=this.element.offsetWidth)):e=Number(this.width),e<400&&!this.isAdaptive?e=this.minWidth||400:this.isAdaptive&&e<310&&(e=this.minWidth||310),e},Kyt.prototype.getGridWidthAsNumber=function(){var e,t=this.element.offsetWidth||this.element.getBoundingClientRect().width;return isNaN(this.grid.width)?(-1<this.grid.width.toString().indexOf("%")?e=parseFloat(this.grid.width.toString())/100*t:-1<this.grid.width.toString().indexOf("px")&&(e=Number(this.grid.width.toString().split("px")[0])),isNaN(e)&&(e=t)):e=Number(this.grid.width),e},Kyt.prototype.onWindowResize=function(){this.actionObj.actionName=yut,this.actionBeginMethod()||(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.layoutRefresh.bind(this),500),this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&this.actionCompleteMethod())},Kyt.prototype.refresh=function(){this.pivotRefresh()},Kyt.prototype.layoutRefresh=function(){var e;this.element&&this.element.classList.contains("e-pivotview")&&("olap"===this.dataType?this.olapEngineModule&&this.olapEngineModule.pivotValues:this.engineModule&&this.engineModule.pivotValues)&&(this.grid&&(e="olap"===this.dataType&&0<this.olapEngineModule.pivotValues.length?this.olapEngineModule.pivotValues[0].length:0<this.dataSourceSettings.values.length&&this.engineModule&&0<this.engineModule.pivotValues.length?this.engineModule.pivotValues[0].length:2,e=this.renderModule.calculateColWidth(e),this.grid.width=this.renderModule.calculateGridWidth(),this.renderModule.calculateGridHeight(!0),this.gridSettings.allowAutoResizing&&this.setCommonColumnsWidth(this.grid.columns,e),this.triggerColumnRenderEvent(this.grid.columns),this.grid.refreshColumns(),this.renderModule.isAutoFitEnabled?this.renderModule.addPivotAutoFitClass():this.renderModule.removePivotAutoFitClass(),this.showGroupingBar&&this.groupingBarModule&&this.element.querySelector("."+Tlt)&&this.groupingBarModule.setGridRowWidth(),this.chart)&&this.pivotChartModule&&(this.chart.height=this.pivotChartModule.getResizedChartHeight()),this.showToolbar&&this.toolbarModule&&this.toolbarModule.toolbar&&(this.toolbarModule.toolbar.width=this.grid?this.getGridWidthAsNumber():this.getWidthAsNumber()),this.enablePaging&&this.notify(Ict,this),this.chart)&&(this.showToolbar&&"Chart"===this.currentView||!this.showToolbar)&&(this.chart.width=(this.showToolbar&&this.grid||"Both"===this.displayOption.view&&this.grid?this.getGridWidthAsNumber():this.getWidthAsNumber()).toString(),this.chart.height=this.pivotChartModule.getResizedChartHeight(),"Chart"===this.displayOption.view)&&this.showGroupingBar&&this.groupingBarModule&&this.element.querySelector("."+wdt)&&this.groupingBarModule.refreshUI()},Kyt.prototype.cellClicked=function(e,t,i){var n,o,r,s=this;e.classList.contains(ndt)&&(e.classList.contains(idt)?this.isPopupClicked=!1:this.isPopupClicked=!0),t&&!je(this.pivotValues)&&0<this.pivotValues.length?(n=parseInt(t.getAttribute("aria-colindex"),10)-1,o=Number(t.getAttribute("index")),r=Number(t.getAttribute("aria-colspan")),e={cancel:!1,isCellClick:!0,currentCell:t,data:this.pivotValues[o][n]},this.trigger(hpt,e,function(e){s.gridSettings.allowSelection&&(("Both"===s.gridSettings.selectionSettings.mode?t.classList.contains(edt):"Row"===s.gridSettings.selectionSettings.mode)?s.clearSelection(t,i):e.cancel||(s.clearSelection(t,i),s.applyColumnSelection(i,t,n,n+(0<r?r-1:0),o)),"Column"===s.gridSettings.selectionSettings.mode||t.classList.contains(iht)||s.rowDeselect(t,i,o,s.gridSettings.selectionSettings.mode,e),"Column"===s.gridSettings.selectionSettings.mode||e.cancel||(("Multiple"===s.gridSettings.selectionSettings.type?i.ctrlKey||i.shiftKey:s.selectedRowIndex===o)?s.selectedRowIndex=void 0:(s.selectedRowIndex=o,s.grid.selectionModule.selectRow(o-s.renderModule.rowStartPos)))),s.cellClick&&e.isCellClick&&s.trigger("cellClick",{currentCell:t,data:s.pivotValues[o][n],nativeEvent:i}),s.getSelectedCellsPos()})):this.clearSelection(null,i)},Kyt.prototype.rowDeselect=function(e,t,i,n,o){!t.shiftKey&&!t.ctrlKey&&"Both"!==this.gridSettings.selectionSettings.mode||"Single"===this.gridSettings.selectionSettings.type?e.classList.contains(Xht)||e.classList.contains(Kht)||e.classList.contains(tdt)?(q(this.element.querySelectorAll("."+Xht),Xht),q(this.element.querySelectorAll("."+Kht),Kht),q(this.element.querySelectorAll("."+tdt),tdt),o.cancel?this.setSavedSelectedCells():"Cell"===n?U([e],[Xht]):"Row"!==n&&"Single"!==this.gridSettings.selectionSettings.type||(U(this.element.querySelectorAll('[index="'+i+'"]'),[Kht,tdt]),"Row"!==n&&e.classList.add(Xht))):o.cancel?this.setSavedSelectedCells():(q(this.element.querySelectorAll("."+Xht),Xht),q(this.element.querySelectorAll("."+Kht),Kht),q(this.element.querySelectorAll("."+tdt),tdt)):(t.shiftKey||t.ctrlKey||"Both"===this.gridSettings.selectionSettings.mode)&&o.cancel&&(q(this.element.querySelectorAll("."+Xht),Xht),q(this.element.querySelectorAll("."+Kht),Kht),q(this.element.querySelectorAll("."+tdt),tdt),this.setSavedSelectedCells())},Kyt.prototype.clearSelection=function(e,t){if(!t.shiftKey&&!t.ctrlKey||"Single"===this.gridSettings.selectionSettings.type)if("Cell"===this.gridSettings.selectionSettings.mode)e&&e.classList.contains(iht)?q(this.element.querySelectorAll("."+edt+"."+Xht),Xht):q(this.element.querySelectorAll("."+iht+"."+tdt),[tdt,Kht]);else if("Both"===this.gridSettings.selectionSettings.mode)if(e&&e.classList.contains(edt))for(var i=0,n=[].slice.call(this.element.querySelectorAll("."+Kht+", ."+Xht));i<n.length;i++)q([n[i]],[tdt,Kht,Xht]);else q(this.element.querySelectorAll("."+Xht),Xht)},Kyt.prototype.applyRowSelection=function(e,t,i){var n=this.engineModule.pivotValues[t][e];if(i.ctrlKey||i.shiftKey||!n||this.selectedRowIndex===t)this.selectedRowIndex=void 0;else{this.selectedRowIndex=t;for(var o=n.level,r=t;(n=this.engineModule.pivotValues[++r][e])&&o<n.level;);this.isAdaptive?this.rowRangeSelection={enable:!0,startIndex:t-this.renderModule.rowStartPos,endIndex:r-(1+this.renderModule.rowStartPos)}:this.grid.selectionModule.selectRowsByRange(t-this.renderModule.rowStartPos,r-(1+this.renderModule.rowStartPos))}},Kyt.prototype.applyColumnSelection=function(e,t,i,n,o){if(!t.classList.contains(nht)&&("Cell"!==this.gridSettings.selectionSettings.mode||t.classList.contains(iht))){for(var r=e.ctrlKey,s=(this.isAdaptive&&"Multiple"===this.gridSettings.selectionSettings.type&&(this.grid.selectionModule.showPopup(e),r=this.isPopupClicked?(this.element.querySelector("."+ndt).classList.add(idt),!0):(this.element.querySelector("."+ndt).classList.remove(idt),!1)),[]),a=this.gridSettings.selectionSettings.type,l=t.classList.contains(tdt),h=[],d={},p=i;p<=n;p++)h.push(p.toString());if(r&&"Single"!==a)l=!1;else{for(var c=0,u=[].slice.call(this.element.querySelectorAll("."+tdt));c<u.length;c++){q([v=u[c]],[tdt,Kht]),-1===h.indexOf((parseInt(v.getAttribute("aria-colindex"),10)-1).toString())&&(l=!1);var g=parseInt(v.getAttribute("aria-colindex"),10)-1;d[g]=g}h=0<Object.keys(d).length?Object.keys(d).sort(function(e,t){return parseInt(e,10)-parseInt(t,10)}):h}"Multiple"===a&&e.shiftKey?(this.shiftLockedPos=0===this.shiftLockedPos.length?h:this.shiftLockedPos,Number(this.shiftLockedPos[0])<=i?i=Number(this.shiftLockedPos[0]):n=n<Number(this.shiftLockedPos[this.shiftLockedPos.length-1])?Number(this.shiftLockedPos[this.shiftLockedPos.length-1]):n):this.shiftLockedPos=[];var m=[];if(e.ctrlKey&&"Both"===this.gridSettings.selectionSettings.mode&&"Multiple"===a&&!t.classList.contains(nht))for(var f=0,y=[].slice.call(this.element.querySelectorAll("."+nht+"."+Xht));f<y.length;f++){var v=y[f];m.push(v.getAttribute("index"))}for(var b=i;b<=n;)s.push('[aria-colindex="'+(b+1)+'"]'+("Cell"===this.gridSettings.selectionSettings.mode?'[index="'+o+'"]':"")),b++;if(!l){o=t.classList.contains(oht)?o:this.renderModule.rowStartPos-1;for(var w=t.classList.contains(tdt),C=0,S=[].slice.call(this.element.querySelectorAll(s.toString()));C<S.length;C++){v=S[C];Number(v.getAttribute("index"))>=o&&(w&&r&&-1===m.indexOf(v.getAttribute("index"))?q:U)([v],[tdt,Kht])}}this.renderModule.selected()}},Kyt.prototype.getSelectedCellsPos=function(){this.savedSelectedCellsPos=[],this.cellSelectionPos=[];for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+Kht));e<t.length;e++){var i=t[e];this.savedSelectedCellsPos.push({rowIndex:i.getAttribute("index"),colIndex:(parseInt(i.getAttribute("aria-colindex"),10)-1).toString()})}for(var n=0,o=[].slice.call(this.element.querySelectorAll("."+Xht));n<o.length;n++){i=o[n];this.cellSelectionPos.push({rowIndex:i.getAttribute("index"),colIndex:(parseInt(i.getAttribute("aria-colindex"),10)-1).toString()})}},Kyt.prototype.setSavedSelectedCells=function(){for(var e=0,t=[].slice.call(this.savedSelectedCellsPos);e<t.length;e++){var i=t[e],n='[aria-colindex="'+(parseInt(i.colIndex,10)+1)+'"][index="'+i.rowIndex+'"]';U([this.element.querySelector(n)],[tdt,Kht])}for(var o=0,r=[].slice.call(this.cellSelectionPos);o<r.length;o++){i=r[o],n='[aria-colindex="'+(parseInt(i.colIndex,10)+1)+'"][index="'+i.rowIndex+'"]';U([this.element.querySelector(n)],[Xht])}},Kyt.prototype.renderEmptyGrid=function(){var e,t=this;this.isEmptyGrid=!0,this.notEmpty=!1,this.isInitial=!0,this.renderModule=this.renderModule||new ugt(this),this.grid&&this.grid.element&&this.element.querySelector("."+Mht)?(this.notEmpty=!0,this.grid.setProperties({columns:this.renderModule.frameEmptyColumns(),dataSource:this.renderModule.frameEmptyData()},!0),this.grid.notify("datasource-modified",{}),this.grid.refreshColumns()):(this.element.querySelector("."+Mht)&&ue(this.element.querySelector("."+Mht)),this.renderModule.bindGrid(this,!0),this.grid.showSpinner=function(){},this.grid.hideSpinner=function(){},e=Q("div",{id:this.element.id+"_grid"}),this.element.appendChild(e),this.grid.isStringTemplate=!0,this.grid.appendTo(e),this.grid.off("data-ready",this.grid.dataReady),this.grid.on("data-ready",function(){t.grid.scrollModule.setWidth(),t.grid.scrollModule.setHeight()}))},Kyt.prototype.initEngine=function(){var i=this;if(this.element.querySelector(".e-spin-hide")&&this.showWaitingPopup(),"pivot"===this.dataType){var e=!je(this.dataSourceSettings.dataSource)&&0<this.dataSourceSettings.dataSource.length?this.dataSourceSettings.dataSource[0]:je(this.engineModule.data)?void 0:this.engineModule.data[0];if(e&&this.pivotCommon){e="[object Array]"===Object.prototype.toString.call(e);if(e&&"JSON"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidJSON"));if(!e&&"CSV"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidCSV"))}}e={dataSourceSettings:Hdt.getClonedDataSourceSettings(this.dataSourceSettings)};this.trigger(Udt,e,function(e){Hdt.updateDataSourceSettings(i,e.dataSourceSettings),i.updatePageSettings(!1);var t,e={mode:"",savedFieldList:void 0,pageSettings:i.pageSettings,enableValueSorting:i.enableValueSorting,isDrillThrough:i.allowDrillThrough||i.editSettings.allowEditing,localeObj:i.localeObj,fieldsType:i.fieldsType,clonedReport:i.clonedReport,globalize:i.globalize,currenyCode:i.currencyCode,enablePaging:i.enablePaging,enableVirtualization:i.enableVirtualization,allowDataCompression:i.allowDataCompression,enableHtmlSanitizer:i.enableHtmlSanitizer,enableOptimizedRendering:i.enableVirtualization&&i.virtualScrollSettings&&i.virtualScrollSettings.allowSinglePage,isTabularLayout:i.isTabular};"pivot"===i.dataType?(i.dataSourceSettings.groupSettings&&0<i.dataSourceSettings.groupSettings.length&&(t=i.engineModule.data,i.clonedDataSet=i.clonedDataSet||("CSV"===i.dataSourceSettings.type?Hdt.getClonedCSVData(t):Hdt.getClonedData(t)),(t=JSON.parse(i.getPersistData()).dataSourceSettings).dataSource=[],i.clonedReport=i.clonedReport||t),"Server"!==i.dataSourceSettings.mode&&i.engineModule.renderEngine(i.dataSourceSettings,e,i.aggregateCellInfo?i.getValueCellInfo.bind(i):void 0,i.onHeadersSort?i.getHeaderSortInfo.bind(i):void 0),i.allowServerDataBinding=!1,i.setProperties({pivotValues:i.engineModule.pivotValues},!0),i.allowServerDataBinding=!0,i.enginePopulatedEventMethod("initEngine")):"SSAS"===i.dataSourceSettings.providerType&&"olap"===i.dataType&&(e.savedFieldList=i.olapEngineModule.fieldList,e.savedFieldListData=i.olapEngineModule.fieldListData,Hdt.renderOlapEngine(i,e),i.allowServerDataBinding=!1,i.setProperties({pivotValues:i.olapEngineModule.pivotValues},!0),i.allowServerDataBinding=!0,i.enginePopulatedEventMethod("initEngine"))})},Kyt.prototype.enginePopulatedEventMethod=function(e,t){var i,n;"initEngine"===e?(i=t||this,this.trigger(qdt,{pivotValues:this.pivotValues},function(e){"olap"===i.dataType?(i.olapEngineModule.pivotValues=e.pivotValues,i.setProperties({pivotValues:i.olapEngineModule.pivotValues},!0)):(i.engineModule.pivotValues=e.pivotValues,i.setProperties({pivotValues:i.engineModule.pivotValues},!0)),i.notify(bct,{}),i.notEmpty=!0})):(e={dataSourceSettings:(n=t||this).dataSourceSettings,pivotValues:n.pivotValues},n.trigger(qdt,e,function(e){n.dataSourceSettings=e.dataSourceSettings,"olap"===n.dataType?(n.olapEngineModule.pivotValues=e.pivotValues,n.allowServerDataBinding=!1,n.setProperties({pivotValues:n.olapEngineModule.pivotValues},!0)):(n.engineModule.pivotValues=e.pivotValues,n.allowServerDataBinding=!1,n.setProperties({pivotValues:n.engineModule.pivotValues},!0)),n.allowServerDataBinding=!0,n.pivotCommon&&(n.pivotCommon.engineModule="olap"===n.dataType?n.olapEngineModule:n.engineModule,n.pivotCommon.dataSourceSettings=n.dataSourceSettings),n.renderPivotGrid()}))},Kyt.prototype.generateData=function(){this.isStaticRefresh||("Chart"!==this.displayOption.view&&je(this.grid)?(this.renderEmptyGrid(),this.showWaitingPopup()):(this.showWaitingPopup(),clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.refreshData.bind(this),100)))},Kyt.prototype.refreshData=function(){var e=this;e.isStaticRefresh?(e.isStaticRefresh=!1,e.hideWaitingPopup()):e.dataSourceSettings&&(e.dataSourceSettings.dataSource||e.dataSourceSettings.url)?e.dataSourceSettings.dataSource instanceof me?"pivot"===e.dataType&&0<e.remoteData.length?(this.element.querySelector(".e-spinner-pane")||this.showWaitingPopup(),this.engineModule.data=e.remoteData,this.initEngine()):je(e.engineModule.data)||0!==e.engineModule.data.length?e.initEngine():(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(e.getData.bind(e),100)):""!==this.dataSourceSettings.url&&"olap"===this.dataType||e.dataSourceSettings.dataSource&&0<e.dataSourceSettings.dataSource.length||this.engineModule.data&&0<this.engineModule.data.length?("pivot"===e.dataType&&(this.hideWaitingPopup(),e.engineModule.data=e.dataSourceSettings.dataSource),e.initEngine()):"Server"===this.dataSourceSettings.mode?this.getEngine("onRefresh"):(this.notify(bct,{}),this.hideWaitingPopup()):(this.notify(bct,{}),this.hideWaitingPopup())},Kyt.prototype.getValueCellInfo=function(e){return this.trigger(Ypt,e),e},Kyt.prototype.getHeaderSortInfo=function(e){return this.trigger(Xpt,e),e},Kyt.prototype.bindTriggerEvents=function(e){this.trigger(FB("name",e),e)},Kyt.prototype.getData=function(){(this.dataSourceSettings.dataSource.defaultQuery?this.dataSourceSettings.dataSource.executeQuery(this.dataSourceSettings.dataSource.defaultQuery):this.dataSourceSettings.dataSource.executeQuery(new ya)).then(this.executeQuery.bind(this))},Kyt.prototype.executeQuery=function(e){this.element.querySelector(".e-spinner-pane")||this.showWaitingPopup();this.engineModule.data=e.result,this.isEmptyGrid&&!je(this.engineModule.data)&&0===this.engineModule.data.length?this.hideWaitingPopup():!je(this.engineModule.data)&&0<this.engineModule.data.length?(this.isEmptyGrid=!1,this.initEngine()):(this.isEmptyGrid=!0,this.hideWaitingPopup(),this.renderEmptyGrid(),this.engineModule.fieldList=null,this.engineModule.isEmptyData=!0,this.pivotValues=[],this.engineModule.data=[],this.notify(bct,{}))},Kyt.prototype.applyFormatting=function(e){if(e){for(var t=[],i=e.length,n=0;n<i;n++)void 0!==e[n]&&void 0===e[n][0]&&t.push(n);for(n=0;n<e.length;n++)for(var o=this.isTabular?this.engineModule.rowMaxLevel+1:1;e[n]&&o<e[n].length;o++)if("value"===e[n][o].axis&&""!==e[n][o].formattedText){e[n][o].style=void 0,e[n][o].cssClass=void 0;for(var r=this.dataSourceSettings.conditionalFormatSettings,s=0;s<r.length;s++)!0!==r[s].applyGrandTotals&&!je(r[s].applyGrandTotals)&&e[n][o].isGrandSum||!this.checkCondition(e[n][o].value,r[s].conditions,r[s].value1,r[s].value2)||r[s].measure&&e[n][o].actualText!==r[s].measure||void 0!==r[s].measure&&""===r[s].measure||void 0!==r[s].label&&""===r[s].label||!(!r[s].label||-1<e[n][0].valueSort.levelName.indexOf(r[s].label)||-1<e[n][o].rowHeaders.indexOf(r[s].label)||-1<e[n][o].columnHeaders.indexOf(r[s].label))||(r[s].style&&r[s].style.backgroundColor&&(r[s].style.backgroundColor="#"===r[s].style.backgroundColor.charAt(0)&&this.conditionalFormattingModule.isHex(r[s].style.backgroundColor.substr(1))?r[s].style.backgroundColor:this.conditionalFormattingModule.colourNameToHex(r[s].style.backgroundColor)),r[s].style&&r[s].style.color&&(r[s].style.color="#"===r[s].style.color.charAt(0)&&this.conditionalFormattingModule.isHex(r[s].style.color.substr(1))?r[s].style.color:this.conditionalFormattingModule.colourNameToHex(r[s].style.color)),e[n][o].style=r[s].style,e[n][o].cssClass="format"+this.element.id+s)}for(var a=this.dataSourceSettings.conditionalFormatSettings,s=0;s<a.length;s++){var l=this.createStyleSheet.bind(this)(),h="color: "+a[s].style.color+"!important;background-color: "+a[s].style.backgroundColor+"!important;font-size: "+a[s].style.fontSize+"!important;font-family: "+a[s].style.fontFamily+" !important;",d=".format"+this.element.id+s;l.insertRule(d+", "+d+" .e-cellvalue{"+h+"}",0)}}},Kyt.prototype.createStyleSheet=function(){var e=document.createElement("style");return e.appendChild(document.createTextNode("")),document.head.appendChild(e),e.sheet},Kyt.prototype.applyHyperlinkSettings=function(){if(this.pivotValues){for(var e=this.pivotValues,t=[],i=e.length,n=0;n<i;n++)je(e[n])||void 0!==e[n][0]||t.push(n);if(0<this.hyperlinkSettings.conditionalSettings.length)for(n=0;n<e.length;n++)for(var o=this.isTabular?this.engineModule.rowMaxLevel+1:1;e[n]&&o<e[n].length;o++)if("value"===e[n][o].axis){e[n][o].enableHyperlink=!1;for(var r,s,a=this.hyperlinkSettings.conditionalSettings,l=0;l<a.length;l++)this.checkCondition(e[n][o].value,a[l].conditions,a[l].value1,a[l].value2)&&(r="row"===this.dataSourceSettings.valueAxis?n:"pivot"===this.dataType?this.engineModule.headerContent.length-1:this.olapEngineModule.headerContent.length-1,s="row"===this.dataSourceSettings.valueAxis?0:o,!a[l].measure||1===this.dataSourceSettings.values.length||e[r][s].valueSort&&e[r][s].actualText===a[l].measure)&&(!a[l].label||e[t[a[l].label.split(".").length-1]]&&e[t[a[l].label.split(".").length-1]][o]&&e[t[a[l].label.split(".").length-1]][o].valueSort&&e[t[a[l].label.split(".").length-1]][o].valueSort[a[l].label]||-1<e[n][0].valueSort.levelName.indexOf(a[l].label))&&(e[n][o].enableHyperlink=!0)}if(!je(this.hyperlinkSettings.headerText))for(var h=this.dataSourceSettings.valueSortSettings.headerDelimiter||".",n=0;n<e.length;n++)for(o=this.isTabular?this.engineModule.rowMaxLevel+1:1;e[n]&&o<e[n].length;o++)if("value"===e[n][o].axis){var d=this.hyperlinkSettings.headerText;if(-1<e[n][0].valueSort.levelName.indexOf(d))e[n][0].enableHyperlink=!0,e[n][o].enableHyperlink=!0;else{for(var p=!1,l=0;l<t.length;l++)d=h+this.hyperlinkSettings.headerText,-1<(h+e[t[l]][o].valueSort.levelName).indexOf(d)&&(p=e[t[l]][o].enableHyperlink=!0);e[n][o].enableHyperlink=p}}}},Kyt.prototype.checkCondition=function(e,t,i,n){switch(t){case"LessThan":return e<i;case"LessThanOrEqualTo":return e<=i;case"GreaterThan":return i<e;case"GreaterThanOrEqualTo":return i<=e;case"Equals":return e===i;case"NotEquals":return e!==i;case"Between":return i<n&&i<=e&&e<=n||n<i&&e<=i&&n<=e;case"NotBetween":return!(i<n&&i<=e&&e<=n||n<i&&e<=i&&n<=e);default:return!1}},Kyt.prototype.updateGroupingReport=function(e,t){this.clonedDataSet||this.clonedReport||(i=this.engineModule.data,this.clonedDataSet="CSV"===this.dataSourceSettings.type?Hdt.getClonedCSVData(i):Hdt.getClonedData(i),(i=JSON.parse(this.getPersistData()).dataSourceSettings).dataSource=[],this.clonedReport=this.clonedReport||i);var a=/_date_group_years|_date_group_quarters|_date_group_quarterYear|_date_group_months|_date_group_days|_date_group_hours|_date_group_minutes|_date_group_seconds/g,i="CSV"===this.dataSourceSettings.type?Hdt.getClonedCSVData(this.clonedDataSet):Hdt.getClonedData(this.clonedDataSet),l=this.dataSourceSettings,n=this.clonedReport.properties||this.clonedReport,h=[l.rows,l.columns,l.values,l.filters],o=[l.filterSettings,l.sortSettings,l.formatSettings,l.drilledMembers],d=(d=n.rows).concat(n.columns,n.values,n.filters);if(0===e.length||0<e.length){this.engineModule.groupingFields={},this.setProperties({dataSourceSettings:{dataSource:i,groupSettings:0<e.length?l.groupSettings:[]}},!0);for(var p,c="Date"===t,u=[],g=0,r=h.length;g<r;g++)for(var m,f,s=0,y=h[g].length;s<y;s++)!function(e,t){var i=h[g][e].name,n=(-1===u.indexOf(i)&&u.push(i),u.indexOf(i));if(!je(i.match(a))&&c||-1!==i.indexOf("_custom_group")&&!Hdt.getFieldByName(i.replace("_custom_group",""),l.groupSettings)){h[g].splice(e,1),u.splice(n,1),e--,t--;for(var o,i=i.split("_")[0],r=!1,s=0;s<h.length&&!(r=0<h[s].filter(function(e){return e.name===i}).length);s++);r||(p=i.split("_")[0],o=Hdt.getFieldByName(p,d),d=d.filter(function(e){return e.name!==p}),u.push(p),o&&(r?h[g].splice(e,1,o):h[g].splice(++e,0,o)))}else(o=Hdt.getFieldByName(i,d))?h[g].splice(e,1,o):p===i&&h[g].splice(e,1);m=e,f=t}(s,y),s=m,y=f;for(var v=0,b=u;v<b.length;v++)for(var w=b[v],C=Hdt.getFilterItemByName(w,n.filterSettings),S=Hdt.getFieldByName(w,n.sortSettings),A=Hdt.getFieldByName(w,n.formatSettings),x=Hdt.getFieldByName(w,n.drilledMembers),I=[C,S,A,x],g=0,r=o.length;g<r;g++){for(var T=!1,s=0,y=o[g].length;s<y;s++){var E=o[g][s].name;if(!je(E.match(a))&&c||-1!==E.indexOf("_custom_group")&&!Hdt.getFieldByName(E.replace("_custom_group",""),l.groupSettings))o[g].splice(s,1),s--,y--;else if(w===o[g][s].name){T=!0,I[g]?o[g].splice(s,1,I[g]):(o[g].splice(s,1),s--,y--);break}}!T&&0===g&&C&&o[g].push(C),!T&&1===g&&S&&o[g].push(S),!T&&2===g&&A&&o[g].push(A),!T&&3===g&&x&&o[g].push(x)}}},Kyt.prototype.removeButtonFocus=function(){document.querySelectorAll(".e-btn-focused")&&q(document.querySelectorAll(".e-btn-focused"),"e-btn-focused")},Kyt.prototype.wireEvents=function(){var e=this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage&&"pivot"===this.dataType;"Chart"!==this.displayOption.view&&(E.add(this.element,this.isAdaptive?"touchend":"click",this.mouseClickHandler,this),E.add(this.element,"mousedown",this.mouseDownHandler,this),E.add(this.element.querySelector("."+odt),"mousemove",this.mouseMoveHandler,this),E.add(this.element,"mouseup",this.mouseUpHandler,this),E.add(this.element,this.isAdaptive?"touchend":"contextmenu",this.mouseRclickHandler,this),this.virtualscrollModule)&&this.enableVirtualization&&!e&&E.add(this.element.querySelector("."+rdt).querySelector("."+Zat),"scroll",this.headerScrollUpdate,this),E.add(document,this.isAdaptive?"touchend":"click",this.removeButtonFocus,this),window.addEventListener("resize",this.onWindowResize.bind(this),!0)},Kyt.prototype.headerScrollUpdate=function(){this.element.querySelector("."+Yht).scrollLeft!==this.element.querySelector("."+rdt).querySelector("."+Zat).scrollLeft&&(this.virtualscrollModule.direction="horizondal"),this.element.querySelector("."+Yht).scrollLeft=this.element.querySelector("."+rdt).querySelector("."+Zat).scrollLeft},Kyt.prototype.unwireEvents=function(){"Chart"!==this.displayOption.view&&(E.remove(this.element,this.isAdaptive?"touchend":"click",this.mouseClickHandler),E.remove(this.element,"mousedown",this.mouseDownHandler),this.element.querySelector("."+odt)&&E.remove(this.element.querySelector("."+odt),"mousemove",this.mouseMoveHandler),E.remove(this.element,"mouseup",this.mouseUpHandler),E.remove(this.element,this.isAdaptive?"touchend":"contextmenu",this.mouseRclickHandler),this.virtualscrollModule)&&this.enableVirtualization&&this.element.querySelector("."+rdt)&&E.remove(this.element.querySelector("."+rdt).querySelector("."+Zat),"scroll",this.headerScrollUpdate),E.remove(document,this.isAdaptive?"touchend":"click",this.removeButtonFocus),window.removeEventListener("resize",this.onWindowResize.bind(this),!0)},Kyt.prototype.actionBeginMethod=function(){var e={dataSourceSettings:Hdt.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,cancel:!1};return this.trigger(pct,e),e.cancel},Kyt.prototype.actionCompleteMethod=function(){var e={dataSourceSettings:Hdt.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,actionInfo:this.actionObj.actionInfo};this.trigger(cct,e),this.actionObj.actionName="",this.actionObj.actionInfo=void 0,this.actionObj.fieldInfo=void 0},Kyt.prototype.actionFailureMethod=function(e){e={actionName:this.actionObj.actionName,errorInfo:e};this.trigger(uct,e)},Kyt.prototype.getActionCompleteName=function(){var e;switch(this.actionObj.actionName){case Oct:case out:e=Nut;break;case Nct:case nut:e=Vut;break;case _ct:e=_ut;break;case Hct:e=Hut;break;case Xct:e=zut;break;case Kct:e=jut;break;case Jct:e=Wut;break;case Zct:e=Qut;break;case $ct:e=Uut;break;case eut:e=qut;break;case tut:e=Gut;break;case iut:e=Yut;break;case Dct:e=Xut;break;case put:e=wut;break;case aut:e=Kut;break;case lut:e=Jut;break;case hut:e=Zut;break;case dut:e=$ut;break;case fut:e=egt;break;case cut:e=tgt;break;case rut:e=igt;break;case uut:e=Cut;break;case gut:e=Sut;break;case mut:e=Aut;break;case Qct:e=Lut;break;case Gct:e=Rut;break;case Yct:e=Out;break;case Wct:e=Fut;break;case qct:e=But;break;case Uct:e=Put;break;case yut:e=ngt;break;case Pct:e=Tut;break;case kct:e=Eut;break;case Bct:e=Dut;break;case Fct:e=Mut;break;case yct:e=agt;break;case fct:e=sgt;break;case vut:e=lgt;break;case but:e=hgt;break;default:e=this.actionObj.actionName}return e},Kyt.prototype.getStackedColumns=function(e,t){for(var i=0,n=e;i<n.length;i++){var o=n[i];t.push(o),o.columns&&0<o.columns.length&&this.getStackedColumns(o.columns,t)}return t},Kyt.prototype.destroy=function(){this.removeInternalEvents(),this.engineModule&&(this.engineModule.fieldList={},this.engineModule.rMembers=null,this.engineModule.cMembers=null,this.engineModule.valueMatrix=[],this.engineModule={}),this.olapEngineModule&&(this.olapEngineModule.fieldList={},this.olapEngineModule={}),this.showGroupingBar&&this.groupingBarModule&&this.groupingBarModule.destroy(),this.allowGrouping&&this.groupingModule&&this.groupingModule.destroy(),this.showToolbar&&this.toolbarModule&&this.toolbarModule.destroy(),this.enablePaging&&this.pagerModule&&this.pagerModule.destroy(),this.enableVirtualization&&this.virtualscrollModule&&this.virtualscrollModule.destroy(),this.allowConditionalFormatting&&this.conditionalFormattingModule&&this.conditionalFormattingModule.destroy(),this.allowNumberFormatting&&this.numberFormattingModule&&this.numberFormattingModule.destroy(),this.contextMenuModule&&this.contextMenuModule.destroy(),this.keyboardModule&&this.keyboardModule.destroy(),this.tooltip&&!this.tooltip.isDestroyed&&this.tooltip.destroy(),this.calculatedFieldModule&&this.calculatedFieldModule.destroy(),this.chart&&!this.chart.isDestroyed&&(this.chart.destroy(),this.chart.isDestroyed)&&ge("#"+this.element.id+"_chart",this.element)&&ue(ge("#"+this.element.id+"_chart",this.element)),this.grid&&!this.grid.isDestroyed&&(this.grid.destroy(),this.grid.isDestroyed)&&ge("#"+this.element.id+"_grid",this.element)&&ue(ge("#"+this.element.id+"_grid",this.element)),this.commonModule&&this.commonModule.destroy(),this.pivotChartModule&&this.pivotChartModule.destroy(),this.pivotButtonModule&&!this.pivotButtonModule.isDestroyed&&this.pivotButtonModule.destroy(),this.pivotFieldListModule&&!this.pivotFieldListModule.isDestroyed&&(this.pivotFieldListModule.destroy(),this.pivotFieldListModule.isDestroyed)&&null!==ge("#"+this.element.id+"_PivotFieldList",this.element)&&ue(ge("#"+this.element.id+"_PivotFieldList",this.element)),(this.allowDrillThrough||this.editSettings&&this.editSettings.allowEditing)&&this.drillThroughModule&&this.drillThroughModule.destroy(),this.chartExportModule&&this.chartExportModule.destroy(),this.unwireEvents(),Yyt.prototype.destroy.call(this),this.groupingBarModule&&(this.groupingBarModule=null),this.groupingModule&&(this.groupingModule=null),this.pivotFieldListModule&&(this.pivotFieldListModule=null),this.calculatedFieldModule&&(this.calculatedFieldModule=null),this.conditionalFormattingModule&&(this.conditionalFormattingModule=null),this.numberFormattingModule&&(this.numberFormattingModule=null),this.toolbarModule&&(this.toolbarModule=null),this.pagerModule&&(this.pagerModule=null),this.virtualscrollModule&&(this.virtualscrollModule=null),this.contextMenuModule&&(this.contextMenuModule=null),this.keyboardModule&&(this.keyboardModule=null),this.tooltip&&(this.tooltip=null),this.chart&&(this.chart=null),this.grid&&(this.grid=null),this.commonModule&&(this.commonModule=null),this.pivotChartModule&&(this.pivotChartModule=null),this.pivotButtonModule&&(this.pivotButtonModule=null),this.renderModule&&(this.renderModule=null),this.axisFieldModule&&(this.axisFieldModule=null),this.pdfExportModule&&(this.pdfExportModule=null),this.excelExportModule&&(this.excelExportModule=null),this.drillThroughModule&&(this.drillThroughModule=null),this.clonedDataSet&&(this.clonedDataSet=null),this.clonedReport&&(this.clonedReport=null),this.pagerModule&&(this.pagerModule=null),this.chartExportModule&&(this.chartExportModule=null),this.exportSpecifiedPages&&(this.exportSpecifiedPages=void 0),this.element.innerHTML="",q([this.element],Aat),q([this.element],xat),q([this.element],Iat),this.globalize=null,this.localeObj=null,this.currentView=null,this.fieldListSpinnerElement=null,this.lastSortInfo=null,this.lastFilterInfo=null,this.lastAggregationInfo=null,this.lastCalcFieldInfo=null,this.lastCellClicked=null,this.lastColumn=null,this.pivotCommon=null},Kyt.prototype.showNumberFormattingDialog=function(){this.allowNumberFormatting&&this.numberFormattingModule.showNumberFormattingDialog()},Kyt.prototype.getValuesHeader=function(e,t){var i=this.dataSourceSettings.values;return"value"===t&&!je(e.valueSort)&&this.localeObj.getConstant("grandTotal")+this.dataSourceSettings.valueSortSettings.headerDelimiter+e.formattedText===e.valueSort.levelName&&("column"===e.axis&&0===this.dataSourceSettings.columns.length&&"column"===this.dataSourceSettings.valueAxis||"row"===e.axis&&0===this.dataSourceSettings.rows.length&&"row"===this.dataSourceSettings.valueAxis)?this.localeObj.getConstant("total")+" "+this.localeObj.getConstant(this.engineModule.fieldList[e.actualText].aggregateType)+" "+this.localeObj.getConstant("of")+" "+e.formattedText:"grandTotal"===t&&1===i.length&&"row"===this.dataSourceSettings.valueAxis&&e.formattedText===this.localeObj.getConstant("grandTotal")?this.localeObj.getConstant("total")+" "+this.localeObj.getConstant(i[i.length-1].type)+" "+this.localeObj.getConstant("of")+" "+(je(i[i.length-1].caption)?i[i.length-1].name:i[i.length-1].caption):e.formattedText},Kyt.prototype.setColumnWidth=function(e,t){e.autoFit||("auto"!==e.width?e.width=this.renderModule.lastColumn&&e.field===this.renderModule.lastColumn.field?t-3:t:e.minWidth=t)},sft([e("USD")],Kyt.prototype,"currencyCode",void 0),sft([e(!1)],Kyt.prototype,"showFieldList",void 0),sft([t({},Vee)],Kyt.prototype,"gridSettings",void 0),sft([t({},est)],Kyt.prototype,"chartSettings",void 0),sft([t({},hft)],Kyt.prototype,"groupingBarSettings",void 0),sft([t({},vft)],Kyt.prototype,"hyperlinkSettings",void 0),sft([t({},Rft)],Kyt.prototype,"pageSettings",void 0),sft([t({},Tft)],Kyt.prototype,"pagerSettings",void 0),sft([t({},set)],Kyt.prototype,"dataSourceSettings",void 0),sft([t({},cft)],Kyt.prototype,"editSettings",void 0),sft([t({},Vft)],Kyt.prototype,"displayOption",void 0),sft([t({},Bft)],Kyt.prototype,"virtualScrollSettings",void 0),sft([e()],Kyt.prototype,"pivotValues",void 0),sft([e(!1)],Kyt.prototype,"showGroupingBar",void 0),sft([e(!0)],Kyt.prototype,"showTooltip",void 0),sft([e(!1)],Kyt.prototype,"showToolbar",void 0),sft([e([])],Kyt.prototype,"toolbar",void 0),sft([e(!1)],Kyt.prototype,"showValuesButton",void 0),sft([e(!1)],Kyt.prototype,"allowCalculatedField",void 0),sft([e(!1)],Kyt.prototype,"enableFieldSearching",void 0),sft([e(!1)],Kyt.prototype,"enableValueSorting",void 0),sft([e(!1)],Kyt.prototype,"allowConditionalFormatting",void 0),sft([e(!1)],Kyt.prototype,"allowNumberFormatting",void 0),sft([e("auto")],Kyt.prototype,"height",void 0),sft([e("auto")],Kyt.prototype,"width",void 0),sft([e(!1)],Kyt.prototype,"allowExcelExport",void 0),sft([e(!1)],Kyt.prototype,"enableVirtualization",void 0),sft([e(!1)],Kyt.prototype,"enablePaging",void 0),sft([e(!1)],Kyt.prototype,"allowDrillThrough",void 0),sft([e(!1)],Kyt.prototype,"allowPdfExport",void 0),sft([e(!1)],Kyt.prototype,"allowDeferLayoutUpdate",void 0),sft([e(!1)],Kyt.prototype,"allowDataCompression",void 0),sft([e(1e3)],Kyt.prototype,"maxNodeLimitInMemberEditor",void 0),sft([e(1e4)],Kyt.prototype,"maxRowsInDrillThrough",void 0),sft([e(!0)],Kyt.prototype,"loadOnDemandInMemberEditor",void 0),sft([e(!1)],Kyt.prototype,"enableHtmlSanitizer",void 0),sft([e()],Kyt.prototype,"cellTemplate",void 0),sft([e()],Kyt.prototype,"toolbarTemplate",void 0),sft([e()],Kyt.prototype,"tooltipTemplate",void 0),sft([e()],Kyt.prototype,"spinnerTemplate",void 0),sft([e(!1)],Kyt.prototype,"allowGrouping",void 0),sft([e(!0)],Kyt.prototype,"exportAllPages",void 0),sft([e(["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"])],Kyt.prototype,"aggregateTypes",void 0),sft([e(["Column","Bar","Line","Area","Scatter","Polar","StackingColumn","StackingArea","StackingBar","StackingLine","StepLine","StepArea","SplineArea","Spline","StackingColumn100","StackingBar100","StackingArea100","StackingLine100","Bubble","Pareto","Radar","Pie","Doughnut","Funnel","Pyramid"])],Kyt.prototype,"chartTypes",void 0),sft([e("")],Kyt.prototype,"cssClass",void 0),sft([i()],Kyt.prototype,"queryCellInfo",void 0),sft([i()],Kyt.prototype,"headerCellInfo",void 0),sft([i()],Kyt.prototype,"resizing",void 0),sft([i()],Kyt.prototype,"resizeStop",void 0),sft([i()],Kyt.prototype,"pdfHeaderQueryCellInfo",void 0),sft([i()],Kyt.prototype,"pdfQueryCellInfo",void 0),sft([i()],Kyt.prototype,"excelHeaderQueryCellInfo",void 0),sft([i()],Kyt.prototype,"excelQueryCellInfo",void 0),sft([i()],Kyt.prototype,"columnDragStart",void 0),sft([i()],Kyt.prototype,"columnDrag",void 0),sft([i()],Kyt.prototype,"columnDrop",void 0),sft([i()],Kyt.prototype,"beforePdfExport",void 0),sft([i()],Kyt.prototype,"beforeExcelExport",void 0),sft([i()],Kyt.prototype,"beforeColumnsRender",void 0),sft([i()],Kyt.prototype,"selected",void 0),sft([i()],Kyt.prototype,"selecting",void 0),sft([i()],Kyt.prototype,"cellDeselected",void 0),sft([i()],Kyt.prototype,"rowSelected",void 0),sft([i()],Kyt.prototype,"rowDeselected",void 0),sft([i()],Kyt.prototype,"chartTooltipRender",void 0),sft([i()],Kyt.prototype,"chartLegendClick",void 0),sft([i()],Kyt.prototype,"beforePrint",void 0),sft([i()],Kyt.prototype,"animationComplete",void 0),sft([i()],Kyt.prototype,"legendRender",void 0),sft([i()],Kyt.prototype,"textRender",void 0),sft([i()],Kyt.prototype,"pointRender",void 0),sft([i()],Kyt.prototype,"seriesRender",void 0),sft([i()],Kyt.prototype,"chartMouseMove",void 0),sft([i()],Kyt.prototype,"chartMouseClick",void 0),sft([i()],Kyt.prototype,"pointMove",void 0),sft([i()],Kyt.prototype,"chartMouseLeave",void 0),sft([i()],Kyt.prototype,"chartMouseDown",void 0),sft([i()],Kyt.prototype,"chartMouseUp",void 0),sft([i()],Kyt.prototype,"dragComplete",void 0),sft([i()],Kyt.prototype,"zoomComplete",void 0),sft([i()],Kyt.prototype,"scrollStart",void 0),sft([i()],Kyt.prototype,"scrollEnd",void 0),sft([i()],Kyt.prototype,"scrollChanged",void 0),sft([i()],Kyt.prototype,"multiLevelLabelRender",void 0),sft([i()],Kyt.prototype,"chartLoaded",void 0),sft([i()],Kyt.prototype,"chartLoad",void 0),sft([i()],Kyt.prototype,"chartResized",void 0),sft([i()],Kyt.prototype,"chartAxisLabelRender",void 0),sft([i()],Kyt.prototype,"multiLevelLabelClick",void 0),sft([i()],Kyt.prototype,"chartPointClick",void 0),sft([i()],Kyt.prototype,"contextMenuClick",void 0),sft([i()],Kyt.prototype,"contextMenuOpen",void 0),sft([i()],Kyt.prototype,"onPdfCellRender",void 0),sft([i()],Kyt.prototype,"saveReport",void 0),sft([i()],Kyt.prototype,"fetchReport",void 0),sft([i()],Kyt.prototype,"loadReport",void 0),sft([i()],Kyt.prototype,"renameReport",void 0),sft([i()],Kyt.prototype,"removeReport",void 0),sft([i()],Kyt.prototype,"newReport",void 0),sft([i()],Kyt.prototype,"toolbarRender",void 0),sft([i()],Kyt.prototype,"toolbarClick",void 0),sft([i()],Kyt.prototype,"load",void 0),sft([i()],Kyt.prototype,"enginePopulating",void 0),sft([i()],Kyt.prototype,"enginePopulated",void 0),sft([i()],Kyt.prototype,"onFieldDropped",void 0),sft([i()],Kyt.prototype,"fieldDrop",void 0),sft([i()],Kyt.prototype,"fieldDragStart",void 0),sft([i()],Kyt.prototype,"dataBound",void 0),sft([i()],Kyt.prototype,"created",void 0),sft([i()],Kyt.prototype,"destroyed",void 0),sft([i()],Kyt.prototype,"beforeExport",void 0),sft([i()],Kyt.prototype,"exportComplete",void 0),sft([i()],Kyt.prototype,"conditionalFormatting",void 0),sft([i()],Kyt.prototype,"memberFiltering",void 0),sft([i()],Kyt.prototype,"cellClick",void 0),sft([i()],Kyt.prototype,"drillThrough",void 0),sft([i()],Kyt.prototype,"editCompleted",void 0),sft([i()],Kyt.prototype,"beginDrillThrough",void 0),sft([i()],Kyt.prototype,"hyperlinkCellClick",void 0),sft([i()],Kyt.prototype,"cellSelecting",void 0),sft([i()],Kyt.prototype,"drill",void 0),sft([i()],Kyt.prototype,"cellSelected",void 0),sft([i()],Kyt.prototype,"chartSeriesCreated",void 0),sft([i()],Kyt.prototype,"aggregateCellInfo",void 0),sft([i()],Kyt.prototype,"fieldListRefreshed",void 0),sft([i()],Kyt.prototype,"memberEditorOpen",void 0),sft([i()],Kyt.prototype,"calculatedFieldCreate",void 0),sft([i()],Kyt.prototype,"numberFormatting",void 0),sft([i()],Kyt.prototype,"aggregateMenuOpen",void 0),sft([i()],Kyt.prototype,"fieldRemove",void 0),sft([i()],Kyt.prototype,"beforeServiceInvoke",void 0),sft([i()],Kyt.prototype,"afterServiceInvoke",void 0),sft([i()],Kyt.prototype,"actionBegin",void 0),sft([i()],Kyt.prototype,"actionComplete",void 0),sft([i()],Kyt.prototype,"actionFailure",void 0),sft([i()],Kyt.prototype,"onHeadersSort",void 0);var Yyt,Xyt=sft([Bt],Kyt);function Kyt(e,t){e=Yyt.call(this,e,t)||this;return e.verticalScrollScale=1,e.horizontalScrollScale=1,e.scrollerBrowserLimit=8e6,e.lastSortInfo={},e.lastFilterInfo={},e.lastAggregationInfo={},e.lastCalcFieldInfo={},e.isScrolling=!1,e.allowEngineExport=!1,e.isInitial=!0,e.shiftLockedPos=[],e.savedSelectedCellsPos=[],e.cellSelectionPos=[],e.isPopupClicked=!1,e.isMouseDown=!1,e.isMouseUp=!1,e.fieldsType={},e.remoteData=[],e.defaultItems={},e.isCellBoxMultiSelection=!1,e.gridCellCollection={},e.rowRangeSelection={enable:!1,startIndex:0,endIndex:0},e.isStaticRefresh=!1,e.isStaticFieldList=!1,e.resizeInfo={},e.scrollPosObject={vertical:0,horizontal:0,verticalSection:0,horizontalSection:0,top:0,left:0,scrollDirection:{direction:"",position:0}},e.pivotColumns=[],e.totColWidth=0,e.posCount=0,e.isModified=!1,e.isInitialRendering=!1,e.needsID=!0,e.pivotRefresh=Ji.prototype.refresh,e.request="undefined"!=typeof window?new XMLHttpRequest:null,e.isServerWaitingPopup=!1,e.actionObj={},e.defaultFieldListOrder="None",e.destroyEngine=!1,x("mergePersistData",(e.pivotView=e).mergePersistPivotData,e),e}Zyt.getClonedPivotValues=function(e){for(var t=[],i=0;i<e.length;i++)if(e[i]){t[i]=[];for(var n=0;n<e[i].length;n++)e[i][n]&&(t[i][n]=this.getClonedPivotValueObj(e[i][n]))}return t},Zyt.getClonedPivotValueObj=function(e){var t=0,i={};if(null!=e)for(var n=Object.keys(e);t<n.length;)i[n[t]]=e[n[t]],t++;else i=e;return i},Zyt.isContainCommonElements=function(e,t){for(var i=0,n=e.length;i<n;i++)for(var o=0,r=t.length;o<r;o++)if(t[o]===e[i])return!0;return!1};var Jyt=Zyt;function Zyt(){}$yt.prototype.getModuleName=function(){return"excelExport"},$yt.prototype.addHeaderAndFooter=function(e,t,i,n){var o=[];if(je(e.rows))""!==t&&("footer"===i&&this.actualrCnt++,o.push({index:1,value:t}),this.rows.push({index:this.actualrCnt+1,cells:o}),this.actualrCnt="header"===i?this.actualrCnt+2:this.actualrCnt);else{this.actualrCnt="footer"===i?this.actualrCnt+n-e.rows[0].cells.length:this.actualrCnt;for(var r=e.rows,s=0;s<r.length;s++){for(var a=0,o=[],l=r[s],h=0;h<l.cells.length;h++)o.push({index:a+1,value:l.cells[h].value,colSpan:l.cells[h].colSpan,rowSpan:l.cells[h].rowSpan,style:l.cells[h].style}),a+=o[h].colSpan;this.actualrCnt++,this.rows.push({index:this.actualrCnt,cells:o})}this.actualrCnt="header"===i?n:this.actualrCnt}},$yt.prototype.exportToExcel=function(e,t,i){this.rows=[],this.actualrCnt=0;for(var n,o,r,s,a,l=!je(t)&&!je(t.header),h=!je(t)&&!je(t.footer),d=!je(t)&&!je(t.fileName),p=(this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,Jyt.getClonedPivotValues(this.engine.pivotValues)),d=d?t.fileName:"CSV"===e?"default.csv":"default.xlsx",c=(this.parent.exportAllPages&&(this.parent.enableVirtualization||this.parent.enablePaging)?(F=this.engine.pageSettings,L=void 0,this.engine.isPagingOrVirtualizationEnabled=!1,"olap"===this.parent.dataType?(this.updateOlapPageSettings(!0),L=this.parent.olapEngineModule.mdxQuery.slice(0)):this.engine.pageSettings=null,this.engine.generateGridData(this.parent.dataSourceSettings,!0,!0),this.parent.applyFormatting(this.engine.pivotValues),n=Jyt.getClonedPivotValues(this.engine.pivotValues),this.engine.pivotValues=p,this.engine.pageSettings=F,this.engine.isPagingOrVirtualizationEnabled=!0,"olap"===this.parent.dataType&&(this.updateOlapPageSettings(!1),this.parent.olapEngineModule.mdxQuery=L)):n=p,{fileName:d,header:"",footer:"",dataCollections:[n],excelExportProperties:t}),u=(this.parent.trigger(Xdt,c,function(e){o=e.fileName,r=e.header,s=e.footer,a=e.dataCollections}),!l&&je(c.excelExportProperties)&&""!==r?this.addHeaderAndFooter({},r,"header",void 0):je(c.excelExportProperties)||je(c.excelExportProperties.header)||this.addHeaderAndFooter(c.excelExportProperties.header,"","header",c.excelExportProperties.header.headerRows),[]),g=0;g<a.length;g++){for(var m=a[g],f=0,y=m.length,v=this.parent.renderModule.getFormatList(),b=0,w=0;w<y;w++)if(m[w]){this.actualrCnt++;for(var C,S,A,x,I,T,E,D,f=m[w].length,M=[],k=0;k<f;k++)m[w][k]?(E=m[w][k],C="row"===this.parent.dataSourceSettings.valueAxis&&"olap"===this.parent.dataType&&E.rowOrdinal&&this.engine.tupRowInfo[E.rowOrdinal]?this.engine.tupRowInfo[E.rowOrdinal].measureName:E.actualText,C="row"===E.axis?{hAlign:"Left",bold:!0,wrapText:!0}:{numberFormat:v[C],bold:!1,wrapText:!0},S={bold:!0,vAlign:"Center",wrapText:!0,indent:0===k?10*E.level:0},(-1!==E.level||E.rowSpan)&&(T=this.engine.aggregatedValueMatrix,T="value"===E.axis?T[w]&&T[w][k]?T[w][k]:"#DIV/0!"===E.formattedText?E.formattedText:E.value:E.formattedText,A=0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis||0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis,T="grand sum"!==E.type||1===this.parent.dataSourceSettings.values.length&&"row"===this.parent.dataSourceSettings.valueAxis&&"column"===E.axis?"sum"===E.type?T.toString().replace("Total",this.parent.localeObj.getConstant("total")):!je(E.valueSort)&&this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+E.formattedText===E.valueSort.levelName&&A?this.parent.getValuesHeader(E,"value"):T:A?this.parent.getValuesHeader(E,"grandTotal"):this.parent.localeObj.getConstant("grandTotal"),-1!==E.level||E.rowSpan)&&0!==E.rowSpan&&(M.push({index:k+1,value:T,colSpan:E.colSpan,rowSpan:-1===E.rowSpan?1:E.rowSpan}),A=M[M.length-1],"value"===E.axis?((isNaN(E.value)||""===E.formattedText||void 0===E.formattedText||je(E.value))&&(A.value="Excel"===e?null:""),C.numberFormat="string"==typeof T?void 0:C.numberFormat,A.style=C):(A.style=S,"row"===E.axis&&0===k&&(A.style=C,b="olap"===this.parent.dataType?(x=this.parent.renderModule.indentCollection[w],A.style.indent=2*x,x<b?b:x):(x=E.valueSort?E.valueSort.levelName.toString():"",D=E.actualText?E.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,D=x.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(D&&D-1),A.style.indent=2*(D=D?D-1:0),b<D?D:b))),(E.style||A.style.backColor||A.style.fontColor||A.style.fontName||A.style.fontSize)&&(A.style.backColor=A.style.backColor||E.style.backgroundColor,A.style.fontColor=A.style.fontColor||E.style.color,A.style.fontName=A.style.fontName||E.style.fontFamily,je(A.style.fontSize)&&je(E.style.fontSize)||(A.style.fontSize=je(A.style.fontSize)?Number(E.style.fontSize.split("px")[0]):Number(A.style.fontSize))),D=void(A.style.borders={color:"#000000",lineStyle:"thin"}),I=void 0,"column"===E.axis?this.parent.trigger(Jdt,D={style:S,cell:E}):this.parent.trigger($dt,I={style:C,cell:E,column:void 0,data:m,value:T}),A.value="column"===E.axis?D.cell.formattedText:I.value,A.style=("column"===E.axis?D:I).style),k+=E.colSpan?E.colSpan-1:0):(D=void 0,(E={formattedText:""})&&this.parent.trigger(Jdt,D={style:void 0,cell:E}),M.push({index:k+1,colSpan:1,rowSpan:1,value:E.formattedText,style:D.style}));this.rows.push({index:this.actualrCnt,cells:M})}h?this.addHeaderAndFooter(t.footer,"","footer",t.footer.footerRows):!h&&""!==s&&je(c.excelExportProperties)?this.addHeaderAndFooter({},s,"footer",void 0):je(c.excelExportProperties)||je(c.excelExportProperties.footer)||this.addHeaderAndFooter(c.excelExportProperties.footer,"","footer",c.excelExportProperties.footer.footerRows);for(var P=[],k=0;k<f;k++)P.push({index:k+1,width:100});0<b&&(P[0].width=100+20*b),u.push({columns:P,rows:this.rows})}var B,F=new oK({worksheets:u},"Excel"===e?"xlsx":"csv",void 0,this.parent.currencyCode),L=o.split(".").pop(),p=(i?B=F.saveAsBlob("xlsx"===L||"Excel"===e?"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"text/csv"):F.save("xlsx"===L||"csv"===L?o:o+("Excel"===e?".xlsx":".csv")),{type:e,promise:i?B:null});this.parent.trigger(Kdt,p)},$yt.prototype.updateOlapPageSettings=function(e){this.parent.olapEngineModule.isExporting=!!e,this.parent.exportSpecifiedPages?this.parent.olapEngineModule.exportSpeciedPages=this.parent.exportSpecifiedPages=e?this.parent.exportSpecifiedPages:void 0:(this.parent.olapEngineModule.pageSettings=e?null:this.parent.olapEngineModule.pageSettings,this.parent.olapEngineModule.isPaging=!e)},$yt.prototype.destroy=function(){this.engine&&(this.engine=null)};Mft=$yt;function $yt(e){this.actualrCnt=0,this.parent=e}e0t.prototype.getModuleName=function(){return"pdfExport"},e0t.prototype.addPage=function(e,t){t=t||this.exportProperties.pdfExportProperties;var i=e.document.sections.add(),n=e.document.pageSettings.height,o=e.document.pageSettings.width,n=(this.exportProperties.width||this.exportProperties.height?(e.document.pageSettings.orientation=this.exportProperties.width>this.exportProperties.height||!this.exportProperties.height&&this.exportProperties.width>n||!this.exportProperties.width&&o>this.exportProperties.height?up.Landscape:up.Portrait,e.document.pageSettings.size=new td(this.exportProperties.width||o,this.exportProperties.height||n)):(e.document.pageSettings.orientation=0===this.exportProperties.orientation||this.exportProperties.orientation?this.exportProperties.orientation:je(t)||je(t.pageOrientation)||"Landscape"===t.pageOrientation?up.Landscape:up.Portrait,je(t)||je(t.pageSize)||(e.document.pageSettings.size=Hdt.getPageSize(t.pageSize))),je(this.exportProperties.pdfMargins)||((o=e.document.pageSettings.margins).top=(je(this.exportProperties.pdfMargins.top)?o:this.exportProperties.pdfMargins).top,o.bottom=(je(this.exportProperties.pdfMargins.bottom)?o:this.exportProperties.pdfMargins).bottom,o.left=(je(this.exportProperties.pdfMargins.left)?o:this.exportProperties.pdfMargins).left,o.right=(je(this.exportProperties.pdfMargins.right)?o:this.exportProperties.pdfMargins).right),i.setPageSettings(e.document.pageSettings),i.pages.add());return je(t)||je(t.header)||this.pdfExportHelper.drawHeader(t,e.document),je(t)||je(t.footer)||this.pdfExportHelper.drawFooter(t,e.document),n},e0t.prototype.getFontStyle=function(e){var t=hd.Regular;return!je(e)&&e.bold&&(t|=hd.Bold),!je(e)&&e.italic&&(t|=hd.Italic),!je(e)&&e.underline&&(t|=hd.Underline),!je(e)&&e.strikeout&&(t|=hd.Strikeout),t},e0t.prototype.getBorderStyle=function(e){var t,i,n,o=new Og;return je(e)?(t=new se(234,234,234),o.all=new Ep(t)):(t=je(t=e.width)||"number"!=typeof t?void 0:.75*t,i=new se(196,196,196),je(e.color)||(n=this.pdfExportHelper.hexDecToRgb(e.color),i=new se(n.r,n.g,n.b)),n=new Ep(i,t),je(e.dashStyle)||(n.dashStyle=this.pdfExportHelper.getDashStyle(e.dashStyle)),o.all=n),o},e0t.prototype.getStyle=function(){var e,t,i,n,o=new Og;return je(this.gridStyle)?{brush:new Sd(new se),border:o,font:void 0}:(o=je(this.gridStyle.header.fontName)?dd.Helvetica:this.getFontFamily(this.gridStyle.header.fontName),e=this.getFontStyle(this.gridStyle.header),t=je(this.gridStyle.header.fontSize)?10.5:this.gridStyle.header.fontSize,i=new se,je(this.gridStyle.header.fontColor)||(n=this.pdfExportHelper.hexDecToRgb(this.gridStyle.header.fontColor),i=new se(n.r,n.g,n.b)),n=new cg(o,t,e),je(this.gridStyle.header.font)||(n=this.gridStyle.header.font),{border:this.getBorderStyle(this.gridStyle.header.border),font:n,brush:new Sd(i)})},e0t.prototype.setRecordThemeStyle=function(e,t){je(this.gridStyle)||je(this.gridStyle.record)||(o=je(this.gridStyle.record.fontName)?dd.Helvetica:this.getFontFamily(this.gridStyle.record.fontName),n=je(this.gridStyle.record.fontSize)?9.75:this.gridStyle.record.fontSize,i=this.getFontStyle(this.gridStyle.record),o=new cg(o,n,i),je(this.gridStyle.record.font)||(o=this.gridStyle.record.font),e.style.setFont(o),n=new se,je(this.gridStyle.record.fontColor)||(i=this.pdfExportHelper.hexDecToRgb(this.gridStyle.record.fontColor),n=new se(i.r,i.g,i.b)),e.style.setTextBrush(new Sd(n)));var i,n,o=this.gridStyle&&this.gridStyle.record&&this.gridStyle.record.border?this.getBorderStyle(this.gridStyle.record.border):t;return e.style.setBorder(o),e},e0t.prototype.exportToPDF=function(e,i,t,n){var o,r=this,s=(this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.gridStyle=je(this.exportProperties.pdfExportProperties)?void 0:this.exportProperties.pdfExportProperties.theme,this.applyEvent()),a=(je(t)||(s.document=t),this.getStyle()),l=je(this.exportProperties)||je(this.exportProperties.fileName)?je(e)||je(e.fileName)?"default":e.fileName:this.exportProperties.fileName,t=this.parent.renderModule.maxIndent||5,h=Math.floor((540-(100+20*t))/90)+1,d=0,p=s.args.pivotValues[d];(this.exportProperties.columnSize||this.exportProperties.width||this.exportProperties.height)&&(h=0<this.exportProperties.columnSize?this.exportProperties.columnSize:p[0].length),this.exportProperties.allowRepeatHeader=!0===this.exportProperties.allowRepeatHeader||je(this.exportProperties.allowRepeatHeader);var c,O=(this.exportProperties.allowRepeatHeader||!1)&&1<h;this.parent.isTabular&&(h=(c=this.parent.engineModule.rowMaxLevel)+1<h?h:c+2);for(var u=0;O&&u<p.length;u++)for(var g=h;p[u]&&g<p[u].length;g+=h){var N=this.parent.isTabular?p[u].slice(0,c+1):[p[u][0]];(o=p[u]).splice.apply(o,[g,0].concat(N))}var m=p&&0<p.length?p[0].length:0,f=0;do{je(e)||(this.exportProperties.header=je(e.header)||je(e.header.contents)||je(e.header.contents[0].value)?this.exportProperties.header:e.header.contents[0].value,this.exportProperties.footer=je(e.footer)||je(e.footer.contents)||je(e.footer.contents[0].value)?this.exportProperties.footer:e.footer.contents[0].value);var V=this.addPage(s,e),y=new Lf,v=0<h?h:5;if(p&&0<p.length){y.columns.add(p[0].length-f>=v?v:p[0].length-f);for(var _=p.length,b=0,w=0,C=0,S=0;S<_;S++)if(p[S]){for(var A=!(p[S][0]&&"row"===p[S][0].axis),H=p[S].length>f+v?f+v:p[S].length,x=0,I=(A&&y.headers.add(1),A?y.headers.getHeader(b):y.rows.addRow()),T=(A?(I.style.setBorder(a.border),a.font&&I.style.setFont(a.font),I.style.setTextBrush(a.brush)):this.setRecordThemeStyle(I,a.border),0),E=!0,D=f;D<H;D++){var M,k,P,B,F,L=!1,R=(p[S][D]&&0!==p[S][D].rowSpan?(R=(k=p[S][D]).formattedText,R=0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length?this.parent.getValuesHeader(k,"value"):R,R="grand sum"===k.type?0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length?this.parent.getValuesHeader(k,"grandTotal"):this.parent.localeObj.getConstant("grandTotal"):"sum"===k.type?R.toString().replace("Total",this.parent.localeObj.getConstant("total")):R,-1===k.level&&!k.rowSpan||(-1===k.level&&!k.rowSpan||(I.cells.getCell(T).columnSpan=k.colSpan?v-T<k.colSpan?v-T:k.colSpan:1,(A&&k.rowSpan&&1<k.rowSpan||!A&&k.rowSpan&&1<k.rowSpan&&this.parent.isTabular)&&(I.cells.getCell(T).rowSpan=k.rowSpan||1),I.cells.getCell(T).value=R?R.toString():""),""===R)||(E=!1),w=k.level>w?k.level:w,L="value"===k.axis,D+=I.cells.getCell(T).columnSpan?I.cells.getCell(T).columnSpan-1:0,T+=I.cells.getCell(T).columnSpan?I.cells.getCell(T).columnSpan-1:0,M={style:void 0,pivotCell:k,cell:(I=k.style?this.applyStyle(I,k,T):I).cells.getCell(T),column:y.columns.getColumn(T)},this.parent.trigger(tpt,M),"column"===k.axis?(M={style:M.style,cell:M.cell,gridCell:M.pivotCell},this.parent.trigger(Zdt,M),I.cells.getCell(T).value=M.gridCell.formattedText||R):(M={style:M.style,cell:M.cell,column:void 0,data:M.pivotCell,value:R},this.parent.trigger(ept,M),I.cells.getCell(T).value=M.value||R),M.style&&this.processCellStyle(I.cells.getCell(T),M)):(M={style:void 0,pivotCell:void 0,cell:I.cells.getCell(T),column:y.columns.getColumn(T)},this.parent.trigger(tpt,M),C=M.column.width,"column"===(k={formattedText:""}).axis&&(M={style:M.style,cell:M.cell,gridCell:M.pivotCell},this.parent.trigger(Zdt,M)),M.style&&this.processCellStyle(I.cells.getCell(T),M),I.cells.getCell(T).value="",this.parent.isTabular&&0===x?(0===D&&A&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length?(y.headers.getHeader(0).cells.getCell(0).rowSpan=Object.keys(this.engine.headerContent).length+1,y.headers.getHeader(0).cells.getCell(0).columnSpan=this.parent.engineModule.rowMaxLevel+1):0!==D&&A&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length&&y.headers.getHeader(0).cells.getCell(0).rowSpan<Object.keys(this.engine.headerContent).length&&(y.headers.getHeader(0).cells.getCell(0).rowSpan=Object.keys(this.engine.headerContent).length,y.headers.getHeader(0).cells.getCell(0).columnSpan=this.parent.engineModule.rowMaxLevel+1),x++):(0===D&&A&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length||0!==D&&A&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length&&y.headers.getHeader(0).cells.getCell(0).rowSpan<Object.keys(this.engine.headerContent).length)&&y.headers.getHeader(0).cells.getCell(0).rowSpan++),new xd);"olap"===this.parent.dataType?(P=!A&&0===T&&p[S][D]?this.parent.renderModule.indentCollection[p[S][D].rowIndex]:0,R.paragraphIndent=15*P,w=P<w?w:P):(R.paragraphIndent=0,!A&&0===T&&p[S][D]&&-1!==p[S][D].level&&(F=(P=p[S][D]).valueSort?P.valueSort.levelName.toString():"",B=P.actualText?P.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,F=F.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(B&&B-1),R.paragraphIndent=10*(F?F-1:0))),R.alignment=L?Hh.Right:Hh.Left,R.lineAlignment=_h.Middle,I.cells.getCell(T).style.stringFormat=R,T++}E&&(I.height=16),b++}y.columns.getColumn(0).width=0<C?C:100+20*w}}while(0===f&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length&&y.headers.getHeader(0).cells.getCell(0).rowSpan--,y.draw(V,new ed(10,20)),m<=(f+=v)&&s.args.pivotValues.length>d+1&&(m=(p=s.args.pivotValues[++d])&&0<p.length?p[0].length:0,f=0),f<m);return new Promise(function(e){var t;n||i?n&&(t=s.document.save()):(s.document.save(l+".pdf"),s.document.destroy()),r.parent.trigger(Kdt,{type:"PDF",promise:n?t:null}),e(s.document)})},e0t.prototype.applyStyle=function(e,t,i){var n=this.parent.conditionalFormattingModule.hexToRgb(t.style.backgroundColor),o=new Sd(new se(n.r,n.g,n.b)),r=(e.cells.getCell(i).style.backgroundBrush=o,Number(t.style.fontSize.split("px")[0])),r=new cg(dd.TimesRoman,r,hd.Regular);return e.cells.getCell(i).style.font=r,n=this.parent.conditionalFormattingModule.hexToRgb(t.style.color),o=new Sd(new se(n.r,n.g,n.b)),e.cells.getCell(i).style.textBrush=o,e},e0t.prototype.getFontFamily=function(e){switch(e){case"TimesRoman":return 2;case"Courier":return 1;case"Symbol":return 3;case"ZapfDingbats":return 4;default:return 0}},e0t.prototype.getFont=function(e){var t,i,n;return e.style.font||(t=e.cell.cellStyle.font&&e.cell.cellStyle.font.fontSize?e.cell.cellStyle.font.fontSize:je(e.style.fontSize)?9.75:.75*e.style.fontSize,i=je(e.style.fontFamily)?dd.TimesRoman:this.getFontFamily(e.style.fontFamily),n=hd.Regular,!je(e.style.bold)&&e.style.bold&&(n|=hd.Bold),!je(e.style.italic)&&e.style.italic&&(n|=hd.Italic),!je(e.style.underline)&&e.style.underline&&(n|=hd.Underline),!je(e.style.strikeout)&&e.style.strikeout&&(n|=hd.Strikeout),new cg(i,t,n))},e0t.prototype.processCellStyle=function(e,t){var i,n,o,r;je(t.style.backgroundColor)||(i=this.pdfExportHelper.hexDecToRgb(t.style.backgroundColor),e.style.backgroundBrush=new Sd(new se(i.r,i.g,i.b))),je(t.style.textBrushColor)||(i=this.pdfExportHelper.hexDecToRgb(t.style.textBrushColor),e.style.textBrush=new Sd(new se(i.r,i.g,i.b))),je(t.style.textPenColor)||(i=this.pdfExportHelper.hexDecToRgb(t.style.textPenColor),e.style.textPen=new Ep(new se(i.r,i.g,i.b))),je(t.style.fontFamily)&&je(t.style.fontSize)&&je(t.style.bold)&&je(t.style.italic)&&je(t.style.underline)&&je(t.style.strikeout)||(e.style.font=this.getFont(t)),je(t.style.border)||(i=new Og,n=je(n=t.style.border.width)||"number"!=typeof n?void 0:.75*n,o=new se(196,196,196),je(t.style.border.color)||(r=this.pdfExportHelper.hexDecToRgb(t.style.border.color),o=new se(r.r,r.g,r.b)),r=new Ep(o,n),je(t.style.border.dashStyle)||(r.dashStyle=this.pdfExportHelper.getDashStyle(t.style.border.dashStyle)),i.all=r,e.style.borders=i)},e0t.prototype.applyEvent=function(){var e,t,i=Jyt.getClonedPivotValues(this.engine.pivotValues),n=(this.parent.exportAllPages&&(this.parent.enableVirtualization||this.parent.enablePaging)&&"Server"!==this.parent.dataSourceSettings.mode?(n=this.engine.pageSettings,this.engine.isPagingOrVirtualizationEnabled=!1,"olap"===this.parent.dataType?(this.updateOlapPageSettings(!0),t=this.parent.olapEngineModule.mdxQuery.slice(0)):this.engine.pageSettings=null,this.engine.generateGridData(this.parent.dataSourceSettings,!0,!0),this.parent.applyFormatting(this.engine.pivotValues),e=Jyt.getClonedPivotValues(this.engine.pivotValues),this.engine.pivotValues=i,this.engine.pageSettings=n,this.engine.isPagingOrVirtualizationEnabled=!0,"olap"===this.parent.dataType&&(this.updateOlapPageSettings(!1),this.parent.olapEngineModule.mdxQuery=t)):e=i,{pivotValues:[e]});return this.parent.trigger(qdt,n),this.document=new sg,{document:this.document,args:n}},e0t.prototype.updateOlapPageSettings=function(e){this.parent.olapEngineModule.isExporting=!!e,this.parent.exportSpecifiedPages?this.parent.olapEngineModule.exportSpeciedPages=this.parent.exportSpecifiedPages=e?this.parent.exportSpecifiedPages:void 0:(this.parent.olapEngineModule.pageSettings=e?null:this.parent.olapEngineModule.pageSettings,this.parent.olapEngineModule.isPaging=!e)},e0t.prototype.destroy=function(){this.engine&&(this.engine=null),this.exportProperties&&(this.exportProperties=null),this.document&&(this.document=null),this.pdfExportHelper&&(this.pdfExportHelper=null)};Cft=e0t;function e0t(e){this.parent=e,this.pdfExportHelper=new Eyt}t0t.prototype.getModuleName=function(){return"pager"},t0t.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Ict,this.createPager,this)},t0t.prototype.removeEventListener=function(){this.parent.isDestroyed||(je(this.parent.pagerSettings.template)&&this.unWireEvent(),this.parent.off(Ict,this.createPager))},t0t.prototype.createPager=function(){null!==ge("#"+this.parent.element.id+"pivot-pager",this.parent.element)&&(ue(ge("#"+this.parent.element.id+"pivot-pager",this.parent.element)),this.destroy(),this.addEventListener());var e,t,i=this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber(),n=this.parent.pagerSettings;this.parent.enablePaging&&(t=Q("div",{id:this.parent.element.id+"pivot-pager",className:Ddt+" "+(this.parent.isAdaptive||i<650?Iat:"")+" "+(this.parent.enableRtl?xat:"")+" "+("Top"===this.parent.pagerSettings.position?" e-pivot-pager-top":" e-pivot-pager-bottom")+" "+(n.enableCompactView||i<400?"e-compact-view":""),styles:"width:"+(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())+"px"}),this.parent.showFieldList&&ge("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)&&"Top"===n.position?this.parent.element.insertBefore(t,ge("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)):this.parent.showGroupingBar&&ge("#"+this.parent.element.id+" ."+Adt,this.parent.element)&&"Top"===n.position?this.parent.element.insertBefore(t,ge("#"+this.parent.element.id+" ."+Adt,this.parent.element)):"Top"===this.parent.pagerSettings.position?this.parent.element.insertBefore(t,ge("#"+this.parent.element.id+"_grid",this.parent.element)):this.parent.element.append(t),(e=this).pager=new lG({enableRtl:this.parent.enableRtl,locale:this.parent.locale,template:""===n.template||n.template?n.template:ao(function(){return e.createPagerContainer()}),cssClass:this.parent.cssClass}),this.pager.isVue=this.parent.isVue,this.pager.appendTo(t),je(n.template))&&(n.showRowPager&&(!n.enableCompactView&&400<i&&new NL({min:1,max:this.parent.engineModule.rowPageCount,showSpinButton:!1,format:"#",validateDecimalOnType:!0,decimals:0,strictMode:!0,value:this.parent.pageSettings.currentRowPage,enableRtl:this.parent.enableRtl,locale:this.parent.locale,width:i<669?"50px":"64px",change:this.rowPageChange.bind(this),cssClass:this.parent.cssClass}).appendTo(ge("#"+this.parent.element.id+"_row_textbox",this.parent.element)),n.showRowPageSize)&&(t=this.parent.pagerSettings.rowPageSizes.slice(0),-1===this.parent.pagerSettings.rowPageSizes.indexOf(this.parent.pageSettings.rowPageSize)&&(t.push(this.parent.pageSettings.rowPageSize),t.sort(function(e,t){return e-t})),new qz({dataSource:t,value:this.parent.pageSettings.rowPageSize,enableRtl:this.parent.enableRtl,locale:this.parent.locale,change:this.rowPageSizeChange.bind(this),popupHeight:"300px",popupWidth:"100%",width:"64px",cssClass:this.parent.cssClass}).appendTo(ge("#"+this.parent.element.id+"_row_size_list",this.parent.element))),n.showColumnPager&&(!n.enableCompactView&&400<i&&new NL({min:1,max:this.parent.engineModule.columnPageCount,showSpinButton:!1,format:"#",validateDecimalOnType:!0,decimals:0,strictMode:!0,value:this.parent.pageSettings.currentColumnPage,enableRtl:this.parent.enableRtl,locale:this.parent.locale,width:i<669?"50px":"64px",change:this.columnPageChange.bind(this),cssClass:this.parent.cssClass}).appendTo(ge("#"+this.parent.element.id+"_column_textbox",this.parent.element)),n.showColumnPageSize)&&(t=this.parent.pagerSettings.columnPageSizes.slice(0),-1===this.parent.pagerSettings.columnPageSizes.indexOf(this.parent.pageSettings.columnPageSize)&&(t.push(this.parent.pageSettings.columnPageSize),t.sort(function(e,t){return e-t})),new qz({dataSource:t,value:this.parent.pageSettings.columnPageSize,enableRtl:this.parent.enableRtl,locale:this.parent.locale,change:this.columnPageSizeChange.bind(this),popupHeight:"300px",popupWidth:"100%",width:"64px",cssClass:this.parent.cssClass}).appendTo(ge("#"+this.parent.element.id+"_column_size_list",this.parent.element))),this.unWireEvent(),this.wireEvent())},t0t.prototype.wireEvent=function(){for(var e=[].slice.call(this.parent.element.querySelectorAll("."+Mat+", ."+Pat+", ."+Bat+", ."+kat)),t=0;t<e.length;t++)E.add(e[t],"click",this.updatePageSettings,this)},t0t.prototype.unWireEvent=function(){for(var e=[].slice.call(this.parent.element.querySelectorAll("."+Mat+", ."+Pat+", ."+Bat+", ."+kat)),t=0;t<e.length;t++)E.remove(e[t],"click",this.updatePageSettings)},t0t.prototype.columnPageChange=function(e){this.parent.pageSettings.currentColumnPage=e.value},t0t.prototype.rowPageChange=function(e){this.parent.pageSettings.currentRowPage=e.value},t0t.prototype.columnPageSizeChange=function(e){this.parent.pageSettings.columnPageSize=Number(e.value)},t0t.prototype.rowPageSizeChange=function(e){this.parent.pageSettings.rowPageSize=Number(e.value)},t0t.prototype.updatePageSettings=function(e){e=e.target.id;switch(e){case this.parent.element.id+"_row_firstIcon":this.parent.pageSettings.currentRowPage=1;break;case this.parent.element.id+"_row_prevIcon":this.parent.pageSettings.currentRowPage=1<this.parent.pageSettings.currentRowPage?this.parent.pageSettings.currentRowPage-1:this.parent.pageSettings.currentRowPage;break;case this.parent.element.id+"_row_nextIcon":this.parent.pageSettings.currentRowPage=this.parent.pageSettings.currentRowPage<this.parent.engineModule.rowPageCount?this.parent.pageSettings.currentRowPage+1:this.parent.pageSettings.currentRowPage;break;case this.parent.element.id+"_row_lastIcon":this.parent.pageSettings.currentRowPage=this.parent.engineModule.rowPageCount;break;case this.parent.element.id+"_column_firstIcon":this.parent.pageSettings.currentColumnPage=1;break;case this.parent.element.id+"_column_prevIcon":this.parent.pageSettings.currentColumnPage=1<this.parent.pageSettings.currentColumnPage?this.parent.pageSettings.currentColumnPage-1:this.parent.pageSettings.currentColumnPage;break;case this.parent.element.id+"_column_nextIcon":this.parent.pageSettings.currentColumnPage=this.parent.pageSettings.currentColumnPage<this.parent.engineModule.columnPageCount?this.parent.pageSettings.currentColumnPage+1:this.parent.pageSettings.currentColumnPage;break;case this.parent.element.id+"_column_lastIcon":this.parent.pageSettings.currentColumnPage=this.parent.engineModule.columnPageCount}-1!==e.indexOf("_row")?this.parent.actionObj.actionName=vut:-1!==e.indexOf("_column")&&(this.parent.actionObj.actionName=but)},t0t.prototype.createPagerContainer=function(){var e,t,i=this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber(),n=this.parent.pagerSettings,o=(n.showRowPager&&(e=this.createPagerItems("row",n,i)),n.showColumnPager&&(t=this.createPagerItems("column",n,i)),Q("div",{id:this.parent.element.id+"_mainDiv",className:"e-pivot-pager-maindiv "+(n.showRowPager&&n.showColumnPager?"":"e-pivot-pager-single-maindiv")+" "+(n.isInversed?"e-inverse-view":"")})),i=Q("div",{id:this.parent.element.id+"_vertical_separator",className:this.parent.isAdaptive||i<650?"e-pivotview-hseparator":"e-pivotview-vseparator"});return n.isInversed&&n.showColumnPager&&n.showRowPager?o.append(t,i,e):n.showColumnPager&&n.showRowPager?o.append(e,i,t):n.showRowPager&&!n.showColumnPager?o.append(e):!n.showRowPager&&n.showColumnPager&&o.append(t),o.outerHTML},t0t.prototype.createPagerItems=function(e,t,i){var n=!t.showRowPager||!t.showColumnPager,o=Q("div",{id:this.parent.element.id+"_"+e+"_mainDiv",className:"row"===e?"e-pivot-pager-row-maindiv "+(t.showRowPageSize?"":kdt):"e-pivot-pager-column-maindiv "+(t.showColumnPageSize?"":kdt)}),r=Q("div",{id:this.parent.element.id+"_"+e+"_pagerSettings",className:"row"===e?"e-pivot-row-pager-settings":"e-pivot-column-pager-settings"}),s=(this.parent.pagerSettings.showColumnPager&&this.parent.pagerSettings.showRowPager&&r.classList.add("e-pivot-both-pager-settings"),"column"===e&&1===this.parent.pageSettings.currentColumnPage||"row"===e&&1===this.parent.pageSettings.currentRowPage),a="column"===e&&this.parent.pageSettings.currentColumnPage===this.parent.engineModule.columnPageCount||"row"===e&&this.parent.pageSettings.currentRowPage===this.parent.engineModule.rowPageCount,l=Q("div",{id:this.parent.element.id+"_"+e+"_NavContainer",attrs:{class:"e-pivot-pager-nav-container "+Mdt}}),h=Q("div",{id:this.parent.element.id+"_"+e+"_PageInfoContainer",attrs:{class:"e-pivot-pager-info-container "+Mdt}}),d=Q("div",{id:this.parent.element.id+"_"+e+"_firstIcon",attrs:{class:"e-first e-icons e-icon-first"+(s?" e-firstpagedisabled "+Eat:" e-firstpage e-pager-default"),title:this.parent.localeObj.getConstant("goToFirstPage"),"aria-label":this.parent.localeObj.getConstant("goToFirstPage"),tabindex:"0",role:"button"}}),s=Q("div",{id:this.parent.element.id+"_"+e+"_prevIcon",attrs:{class:"e-prev e-icons e-icon-prev"+(s?" e-prevpagedisabled "+Eat:" e-prevpage e-pager-default"),title:this.parent.localeObj.getConstant("goToPreviousPage"),"aria-label":this.parent.localeObj.getConstant("goToPreviousPage"),tabindex:"0",role:"button"}}),p=Q("span",{id:this.parent.element.id+"_"+e+"_pagerString",className:"row"===e?"e-pivotview-row-pagerString":"e-pivotview-column-pagerString"}),c=(p.innerText="row"===e?this.parent.localeObj.getConstant("rowPage"):this.parent.localeObj.getConstant("columnPage"),Q("input",{id:this.parent.element.id+"_"+e+"_textbox",className:"row"===e?"e-pivot-pager-row-dropdown":"e-pivot-pager-column-dropdown",attrs:{placeholder:"1"}})),u=Q("div",{id:this.parent.element.id+"_"+e+"_of_string_mainDiv",className:"row"===e?"e-pivot-row-of-string-maindiv":"e-pivot-column-of-string-maindiv"}),g=Q("span",{id:this.parent.element.id+"_"+e+"_ofString",className:"row"===e?"e-pivot-row-of-string":"e-pivot-column-of-string"}),m=(g.innerText=this.parent.localeObj.getConstant("of")+" ",Q("span",{id:this.parent.element.id+"_"+e+"_pagerNumber",className:"row"===e?"e-pivotview-row-pagerNumber":"e-pivotview-column-pagerNumber"})),f=(m.innerText=("row"===e?this.parent.engineModule.rowPageCount:this.parent.engineModule.columnPageCount).toString(),Q("div",{id:this.parent.element.id+"_"+e+"_nextIcon",attrs:{class:"e-next e-icons e-icon-next"+(a?" e-nextpagedisabled "+Eat:" e-nextpage e-pager-default"),title:this.parent.localeObj.getConstant("goToNextPage"),"aria-label":this.parent.localeObj.getConstant("goToNextPage"),tabindex:"0",role:"button"}})),a=Q("div",{id:this.parent.element.id+"_"+e+"_lastIcon",attrs:{class:"e-last e-icons e-icon-last"+(a?" e-lastpagedisabled "+Eat:" e-lastpage e-pager-default"),title:this.parent.localeObj.getConstant("goToLastPage"),"aria-label":this.parent.localeObj.getConstant("goToLastPage"),tabindex:"0",role:"button"}}),y=Q("span",{id:this.parent.element.id+"_"+e+"_size",className:"row"===e?"e-pivotview-row-size":"e-pivotview-column-size"}),v=(y.innerText="row"===e?this.parent.localeObj.getConstant("rowPerPage"):this.parent.localeObj.getConstant("columnPerPage"),Q("div",{id:this.parent.element.id+"_"+e+"_size_list_maindiv",className:"e-pager-dropdown "+Mdt})),b=Q("div",{id:this.parent.element.id+"_"+e+"_size_list",className:"row"===e?"e-pivot-row-size-list":"e-pivot-column-size-list"}),w=Q("div",{id:this.parent.element.id+"_"+e+"_text_div",className:"e-pivotview-text-div"}),C=Q("div",{id:this.parent.element.id+"_"+e+"_text_div_1",className:"e-pivotview-text-div-1"});return v.append(b),t.enableCompactView||i<400?(l.append(s,f),r.append(l)):(u.append(g,m),l.append(d,s,f,a),h.append(c,u),r.append(l,h)),("row"===e&&t.showRowPager||"column"===e&&t.showColumnPager)&&(("column"===e&&!t.showRowPager||"row"===e&&!t.showColumnPager)&&n&&C.append(y,v),t.showColumnPager&&t.showRowPager||!n?("row"===e&&t.showRowPageSize||"column"===e&&t.showColumnPageSize?!t.enableCompactView&&400<i?(w.append(p,y),C.append(r,v)):(w.append(p,r),C.append(y,v)):("row"===e&&!t.showRowPageSize||"column"===e&&!t.showColumnPageSize)&&(w.append(p),C.append(r)),o.append(w,C)):("row"===e&&(t.showRowPageSize?o.append(r,p,C):o.append(r,p)),"column"===e&&(t.showColumnPageSize?o.append(r,p,C):o.append(r,p)))),o},t0t.prototype.destroy=function(){var e,t;this.removeEventListener(),this.parent.pagerModule&&((t=(e=ge("#"+this.parent.element.id+"_column_textbox",this.parent.element))?K(e,NL):null)&&(t.destroy(),t=null),(t=(e=ge("#"+this.parent.element.id+"_row_textbox",this.parent.element))?K(e,NL):null)&&(t.destroy(),t=null),(t=(e=ge("#"+this.parent.element.id+"_column_size_list",this.parent.element))?K(e,qz):null)&&(t.destroy(),t=null),(t=(e=ge("#"+this.parent.element.id+"_row_size_list",this.parent.element))?K(e,qz):null)&&(t.destroy(),t=null),this.pager&&this.pager.destroy(),this.pager=null)};d=t0t;function t0t(e){this.parent=e,(this.parent.pagerModule=this).addEventListener()}n0t.prototype.render=function(){var e=Q("div",{id:this.parent.element.id+"_Container",className:Lat+" "+("olap"===this.parent.dataType?"e-olapfieldlist-container":""),styles:"width:"+this.parent.element.style.width});(this.parent.isAdaptive?U:q)([e],Iat),(this.parent.enableRtl?U:q)([e],xat),this.parent.cssClass&&U([e],this.parent.cssClass.split(" ")),(this.parent.enableFieldSearching?U:q)([e],zat),this.parentElement=Q("div",{className:"e-field-list-container"}),this.parent.element.appendChild(e),this.parent.isAdaptive&&(e.removeAttribute("style"),this.parentElement=Q("div",{className:"e-adaptive-container"}),this.renderAdaptiveLayout(e)),"Popup"===this.parent.renderMode?(this.renderFieldListDialog(e),this.unWireDialogEvent(this.parent.element.querySelector("."+Rat)),this.wireDialogEvent(this.parent.element.querySelector("."+Rat))):this.renderStaticLayout(e)},n0t.prototype.renderStaticLayout=function(e){var t,i;this.parent.isAdaptive||(t=Q("div",{className:"e-field-list-title"}),(i=Q("div",{className:"e-title-content"})).innerText=this.parent.localeObj.getConstant("staticFieldList"),t.appendChild(i),t.appendChild(this.createCalculatedButton()),U([e],Oat),e.appendChild(t),e.appendChild(this.parentElement),U([e],Oat),this.parent.allowDeferLayoutUpdate&&(e.appendChild(this.createDeferUpdateButtons()),this.renderDeferUpdateButtons(e)))},n0t.prototype.renderDeferUpdateButtons=function(e){this.parent.allowDeferLayoutUpdate&&(this.deferUpdateCheckBox=new ib({label:this.parent.localeObj.getConstant("deferLayoutUpdate"),checked:this.parent.isPopupView&&this.parent.pivotGridModule?!!je(this.parent.pivotGridModule.pivotDeferLayoutUpdate)||this.parent.pivotGridModule.pivotDeferLayoutUpdate:!!je(this.parent.isDeferLayoutUpdate)||this.parent.isDeferLayoutUpdate,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,change:this.onCheckChange.bind(this),cssClass:this.parent.cssClass}),this.deferUpdateCheckBox.isStringTemplate=!0,this.deferUpdateCheckBox.appendTo(ge("#"+this.parent.element.id+"DeferUpdateCheckBox",e)),this.deferUpdateApplyButton=new zv({cssClass:"e-defer-apply-button e-defer-update-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("apply"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,isPrimary:!0,disabled:this.parent.isPopupView&&this.parent.pivotGridModule?!je(this.parent.pivotGridModule.pivotDeferLayoutUpdate)&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate:!je(this.parent.isDeferLayoutUpdate)&&!this.parent.isDeferLayoutUpdate}),this.deferUpdateApplyButton.isStringTemplate=!0,this.deferUpdateApplyButton.appendTo(ge("#"+this.parent.element.id+"_DeferUpdateButton1",e)),this.deferUpdateApplyButton.element.onclick=("Fixed"===this.parent.renderMode?this.applyButtonClick:this.onDeferUpdateClick).bind(this)),this.deferUpdateCancelButton=new zv({cssClass:"e-defer-cancel-button "+blt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.allowDeferLayoutUpdate?this.parent.localeObj.getConstant("cancel"):this.parent.localeObj.getConstant("close"),enableRtl:this.parent.enableRtl,isPrimary:!this.parent.allowDeferLayoutUpdate,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,disabled:this.parent.isPopupView&&this.parent.pivotGridModule&&this.parent.pivotGridModule.refreshing?!(!this.parent.allowDeferLayoutUpdate||je(this.parent.pivotGridModule.pivotDeferLayoutUpdate)||this.parent.pivotGridModule.pivotDeferLayoutUpdate):!(!this.parent.refreshing||je(this.parent.isDeferLayoutUpdate)||!this.parent.allowDeferLayoutUpdate||this.parent.isDeferLayoutUpdate)}),this.deferUpdateCancelButton.isStringTemplate=!0,this.deferUpdateCancelButton.appendTo(ge("#"+this.parent.element.id+"_DeferUpdateButton2",e)),this.parent.allowDeferLayoutUpdate&&(!this.parent.isDeferLayoutUpdate&&"Popup"===this.parent.renderMode&&this.parent.refreshing||this.parent.isPopupView&&this.parent.pivotGridModule&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate&&this.parent.pivotGridModule.refreshing)&&(this.deferUpdateApplyButton.element.style.display="none",this.deferUpdateCancelButton.setProperties({content:this.parent.localeObj.getConstant("close")}),this.deferUpdateCancelButton.isPrimary=!0,this.deferUpdateApplyButton.disabled=this.parent.isPopupView?this.parent.pivotGridModule.pivotDeferLayoutUpdate:this.parent.isDeferLayoutUpdate,this.deferUpdateCancelButton.disabled=this.parent.isPopupView?this.parent.pivotGridModule.pivotDeferLayoutUpdate:this.parent.isDeferLayoutUpdate),this.deferUpdateCancelButton.element.onclick=this.onCloseFieldList.bind(this)},n0t.prototype.createDeferUpdateButtons=function(){var e=Q("div",{className:"e-layout-footer"}),t=(this.parent.allowDeferLayoutUpdate&&(i=Q("div",{className:"e-checkbox-layout",attrs:{title:this.parent.localeObj.getConstant("deferLayoutUpdate")}}),t=Q("input",{id:this.parent.element.id+"DeferUpdateCheckBox"}),i.appendChild(t),e.appendChild(i)),Q("div",{className:"e-button-layout"})),i=(this.parent.allowDeferLayoutUpdate&&(i=Q("button",{id:this.parent.element.id+"_DeferUpdateButton1",attrs:{type:"button",title:this.parent.localeObj.getConstant("apply")}}),t.appendChild(i)),Q("button",{id:this.parent.element.id+"_DeferUpdateButton2",attrs:{type:"button",title:this.parent.localeObj.getConstant("cancel")}}));return t.appendChild(i),e.appendChild(t),e},n0t.prototype.onCheckChange=function(e){e.checked&&(this.parent.clonedDataSource=Hdt.getClonedDataSourceSettings(this.parent.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=Hdt.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),this.parent.clonedFieldList=Hdt.getClonedFieldList(this.parent.pivotFieldList)),this.parent.isDeferLayoutUpdate=e.checked,this.parent.isPopupView&&this.parent.pivotGridModule&&(this.parent.pivotGridModule.pivotDeferLayoutUpdate=e.checked),"Fixed"===this.parent.renderMode?(this.deferUpdateApplyButton.setProperties({disabled:!e.checked}),this.deferUpdateCancelButton.setProperties({disabled:!e.checked})):this.parent.allowDeferLayoutUpdate&&e.checked?(this.deferUpdateApplyButton.element.style.display="",this.deferUpdateCancelButton.setProperties({content:this.parent.localeObj.getConstant("cancel")}),this.deferUpdateCancelButton.isPrimary=!1):(this.deferUpdateApplyButton.element.style.display="none",this.deferUpdateCancelButton.setProperties({content:this.parent.localeObj.getConstant("close")}),this.deferUpdateCancelButton.isPrimary=!0),Object.keys(this.parent.clonedFieldList).length!==Object.keys(this.parent.pivotFieldList).length&&this.parent.calculatedFieldModule&&this.parent.calculatedFieldModule.field&&"pivot"===this.parent.dataType&&(this.parent.engineModule.fields=Object.keys(this.parent.clonedFieldList)),this.onCloseFieldList(null,!0)},n0t.prototype.applyButtonClick=function(){"pivotfieldlist"===this.parent.getModuleName()&&this.parent.allowDeferLayoutUpdate&&(this.parent.pivotChange=!1),this.parent.isDeferUpdateApplied=!0,this.parent.isPopupView||"Server"!==this.parent.dataSourceSettings.mode||(this.parent.isRequiredUpdate=!0),this.parent.updateDataSource(!1);var e=this.parent;e.axisFieldModule.render(),e.clonedDataSource=Hdt.getClonedDataSourceSettings(e.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=Hdt.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),e.clonedFieldList=Hdt.getClonedFieldList(e.pivotFieldList)},n0t.prototype.onCloseFieldList=function(e,t){if((this.parent.allowDeferLayoutUpdate||t)&&(!this.parent.isPopupView||this.parent.pivotGridModule&&""!==this.parent.pivotGridModule.actionObj.actionName||""!==this.parent.actionObj.actionName)){if(this.parent.setProperties({dataSourceSettings:this.parent.clonedDataSource},!0),"olap"===this.parent.dataType)if(this.parent.olapEngineModule.fieldList=Hdt.getClonedFieldList(this.parent.clonedFieldList),this.parent.olapEngineModule.fieldListData=Hdt.cloneOlapFieldSettings(this.parent.clonedFieldListData),this.parent.isPopupView)this.parent.isPopupView&&this.parent.clonedFieldListData&&0<Object.keys(this.parent.clonedFieldListData).length&&(this.parent.olapEngineModule.fieldListData=this.parent.clonedFieldListData);else for(var i=0,n=Object.keys(this.parent.clonedFieldList);i<n.length;i++){var o=n[i],o=this.parent.clonedFieldList[o];this.parent.olapEngineModule.updateFieldlistData(o.id,o.isSelected)}else this.parent.engineModule.fieldList=Hdt.getClonedFieldList(this.parent.clonedFieldList);this.parent.updateDataSource(!1,!0)}var r,s;(!this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate)&&t&&(this.parent.pivotChange=!1),this.parent.allowDeferLayoutUpdate&&this.parent.isPopupView&&this.parent.pivotGridModule&&!this.parent.isAdaptive&&(this.parent.pivotGridModule.actionObj.actionName="",this.parent.pivotGridModule.engineModule=this.parent.engineModule,this.parent.pivotGridModule.olapEngineModule=this.parent.olapEngineModule,this.parent.pivotGridModule.setProperties({dataSourceSettings:this.parent.clonedDataSource},!0)),this.parent.allowDeferLayoutUpdate&&this.parent.allowCalculatedField&&"pivot"===this.parent.dataType&&!this.parent.isAdaptive&&(this.parent.engineModule.fieldList=this.parent.pivotFieldList=Hdt.getClonedFieldList(this.parent.clonedFieldList),r=Object.keys(this.parent.engineModule.fieldList),this.parent.allowCalculatedField)&&r.length!==this.parent.engineModule.fields.length&&(s=[],this.parent.engineModule.fields.forEach(function(e){-1!==r.indexOf(e)&&(s[s.length]=e)}),this.parent.engineModule.fields=s),"Popup"!==this.parent.renderMode||t?this.parent.actionObj.actionName=dgt:(this.parent.dialogRenderer.fieldListDialog.hide(),this.parent.actionObj.actionName=xut),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()},n0t.prototype.renderFieldListDialog=function(e){var t,i=Q("div",{className:Rat+" "+Tat+" e-select-table",attrs:{tabindex:"0",title:this.parent.localeObj.getConstant("fieldList"),"aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("fieldList"),role:"button"}});this.parent.element.appendChild(i),this.parent.isAdaptive?(t='<div class=e-title-mobile-header><span class="e-icons '+$ht+'"></span><div class=e-title-mobile-content>'+this.parent.localeObj.getConstant("fieldList")+"</div></div>",i=[{click:this.showFieldListDialog.bind(this),isFlat:!1,buttonModel:{cssClass:Olt+" "+Vlt+" "+_lt+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:Tat+" "+Hlt,isPrimary:!0}},{click:this.showCalculatedField.bind(this),isFlat:!1,buttonModel:{cssClass:Nlt+" "+Vlt+" "+_lt+" "+Eat+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:Tat+" "+Hlt,enableRtl:this.parent.enableRtl,isPrimary:!0}}],this.fieldListDialog=new pS({animationSettings:{effect:this.parent.enableRtl?"SlideRight":"SlideLeft"},header:t,content:this.parentElement,isModal:!0,showCloseIcon:!1,visible:!1,allowDragging:!1,closeOnEscape:!1,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"100%",height:"100%",position:{X:"center",Y:"center"},buttons:i,target:document.body,cssClass:this.parent.cssClass,close:this.removeFieldListIcon.bind(this),open:this.dialogOpen.bind(this)}),this.fieldListDialog.isStringTemplate=!0,this.fieldListDialog.appendTo(e),gt(ge("#"+e.id+"_dialog-content",e),{padding:"0"}),U([i=e.querySelector(".e-footer-content")],Qat),q([i.querySelector("."+Nlt)],"e-flat"),q([i.querySelector("."+Olt)],"e-flat"),this.fieldListDialog.element.querySelector("."+$ht).onclick=(this.parent.allowDeferLayoutUpdate?this.onDeferUpdateClick:this.onCloseFieldList).bind(this)):(i=this.createDeferUpdateButtons().outerHTML,t="<div class="+Llt+"><div class=e-title-content>"+this.parent.localeObj.getConstant("fieldList")+"</div></div>",this.fieldListDialog=new pS({animationSettings:{effect:"Zoom"},header:t,content:this.parentElement,isModal:!1,showCloseIcon:!1,visible:!1,allowDragging:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:this.parent.element.style.width,position:{X:"center",Y:this.parent.element.offsetTop},footerTemplate:i,closeOnEscape:!1,cssClass:this.parent.cssClass,target:je(this.parent.target)?document.body:"string"==typeof this.parent.target?document.querySelector(this.parent.target):this.parent.target,close:this.removeFieldListIcon.bind(this)}),this.fieldListDialog.isStringTemplate=!0,this.fieldListDialog.appendTo(e),this.renderDeferUpdateButtons(e),gt(ge("#"+e.id+"_title",e),{width:"100%"}),e.querySelector("."+Llt).appendChild(this.createCalculatedButton()))},n0t.prototype.dialogOpen=function(){4===this.lastTabIndex?(this.adaptiveElement.items[this.lastTabIndex].content="",this.adaptiveElement.dataBind(),this.parent.notify(Act,{})):this.adaptiveElement.refresh()},n0t.prototype.updateDataSource=function(e){for(var t=["filters","columns","rows","values"],i=0,n=e;i<n.length;i++){var o=n[i],r=t[this.adaptiveElement.selectedItem];this.parent.pivotCommon.dataSourceUpdate.control="pivotview"!==this.parent.getModuleName()&&this.parent.pivotGridModule||this.parent,this.parent.pivotCommon.dataSourceUpdate.updateDataSource(o,r,-1)}this.parent.axisFieldModule.render(),this.parent.allowDeferLayoutUpdate?this.parent.triggerPopulateEvent():this.parent.updateDataSource(!0)},n0t.prototype.onDeferUpdateClick=function(){this.parent.isPopupView&&"Server"===this.parent.dataSourceSettings.mode&&(this.parent.isRequiredUpdate=!0),this.parent.updateDataSource(),this.parent.dialogRenderer.fieldListDialog.hide()},n0t.prototype.renderAdaptiveLayout=function(e){var t=Q("div",{className:Qat}),i=(e.appendChild(this.parentElement),[{header:{text:this.parent.localeObj.getConstant("filters")},content:this.createAxisTable("filters")},{header:{text:this.parent.localeObj.getConstant("columns")},content:this.createAxisTable("columns")},{header:{text:this.parent.localeObj.getConstant("rows")},content:this.createAxisTable("rows")},{header:{text:this.parent.localeObj.getConstant("values")},content:this.createAxisTable("values")},{header:{text:this.parent.localeObj.getConstant("createCalculatedField")},content:"Calculated Field Related UI"}]);this.parent.allowCalculatedField||i.pop(),this.adaptiveElement=new k5({heightAdjustMode:"Auto",items:i,height:"100%",enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,selected:this.tabSelect.bind(this),cssClass:this.parent.cssClass}),"Fixed"===this.parent.renderMode?(t.appendChild(this.createAddButton()),U([e],Oat),this.adaptiveElement.isStringTemplate=!0,this.adaptiveElement.appendTo(this.parentElement),this.parentElement.appendChild(t)):(this.adaptiveElement.isStringTemplate=!0,this.adaptiveElement.appendTo(this.parentElement))},n0t.prototype.tabSelect=function(e){var t=z(this.parentElement,"."+Lat);this.lastTabIndex=e.selectedIndex,t&&t.querySelector("."+Olt)&&(4!==e.selectedIndex?(U([t.querySelector("."+Nlt)],Eat),q):(q([t.querySelector("."+Nlt)],Eat),U))([t.querySelector("."+Olt)],Eat),4===e.selectedIndex?(this.adaptiveElement.items[4].content="",this.adaptiveElement.dataBind(),this.parent.notify(Act,{})):this.parent.axisFieldModule.render()},n0t.prototype.createCalculatedButton=function(){var e=Q("button",{id:this.parent.element.id+"_CalculatedField",attrs:{type:"button",tabindex:"0","aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("CalculatedField")}}),t=new zv({cssClass:"e-calculated-field "+Eat+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("CalculatedField"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});return t.isStringTemplate=!0,t.appendTo(e),this.parent.calculatedFieldModule&&q([e],Eat),t.element.onclick=this.showCalculatedField.bind(this),e},n0t.prototype.createAddButton=function(){var e=Q("div",{className:Qat+"-content"}),t=Q("div",{}),i=Q("div",{}),n=new zv({cssClass:Nlt+" "+Vlt+" "+_lt+" "+Eat+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:Tat+" "+Hlt,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),o=new zv({cssClass:Olt+" "+Vlt+" "+_lt+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:Tat+" "+Hlt,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});return o.isStringTemplate=!0,o.appendTo(t),n.isStringTemplate=!0,n.appendTo(i),e.appendChild(t),e.appendChild(i),n.element.onclick=this.showCalculatedField.bind(this),o.element.onclick=this.showFieldListDialog.bind(this),e},n0t.prototype.createAxisTable=function(e){var t=Q("div",{className:Vat+"-"+e}),e=Q("div",{className:Yat+" e-"+e}),i=Q("span",{className:Xat});return i.innerText=this.parent.localeObj.getConstant("addPrompt"),t.appendChild(e),t.appendChild(i),t},n0t.prototype.showCalculatedField=function(){try{if(!this.parent.isAdaptive){if(this.parent.actionObj.actionName=put,this.parent.actionBeginMethod())return;this.parent.dialogRenderer.fieldListDialog&&(this.parent.dialogRenderer.fieldListDialog.hide(),U([this.parent.element.querySelector("."+Rat)],Dat))}this.parent.notify(Act,{})}catch(e){this.parent.actionFailureMethod(e)}},n0t.prototype.showFieldListDialog=function(){var e=this.adaptiveElement.selectedItem;this.parent.treeViewModule.render(e)},n0t.prototype.onShowFieldList=function(){if(this.parent.actionObj.actionName=Vct,!this.parent.actionBeginMethod()){this.parent.actionObj.actionName="";try{this.parent.allowDeferLayoutUpdate&&(this.parent.isAdaptive&&this.parent.axisFieldModule.render(),this.parent.clonedDataSource=Hdt.getClonedDataSourceSettings(this.parent.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=Hdt.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),this.parent.clonedFieldList=Hdt.getClonedFieldList(this.parent.pivotFieldList)),U([this.parent.element.querySelector("."+Rat)],Dat),this.parent.dialogRenderer.fieldListDialog.show(),this.parent.dialogRenderer.fieldListDialog.element.style.top=parseInt(this.parent.dialogRenderer.fieldListDialog.element.style.top,10)<0?"0px":this.parent.dialogRenderer.fieldListDialog.element.style.top}catch(e){this.parent.actionFailureMethod(e)}}},n0t.prototype.removeFieldListIcon=function(){this.parent.isAdaptive&&this.parent.allowCalculatedField&&this.parent.calculatedFieldModule&&this.adaptiveElement&&4===this.adaptiveElement.selectedItem&&(ge("#"+this.parent.element.id+"droppable",this.adaptiveElement.element)?this.parent.calculatedFieldModule.updateAdaptiveCalculatedField(!1):this.parent.notify(Act,{edit:!1})),document.getElementById(this.parent.element.id+"calculateddialog")||q([this.parent.element.querySelector("."+Rat)],Dat)},n0t.prototype.keyPress=function(e){13===e.keyCode&&e.target&&(e.target.click(),e.preventDefault())},n0t.prototype.wireDialogEvent=function(e){E.add(e,"keydown",this.keyPress,this),E.add(e,"click",this.onShowFieldList,this)},n0t.prototype.unWireDialogEvent=function(e){E.remove(e,"keydown",this.keyPress),E.remove(e,"click",this.onShowFieldList)},n0t.prototype.destroy=function(){"Popup"===this.parent.renderMode&&this.unWireDialogEvent(this.parent.element.querySelector("."+Rat)),this.deferUpdateCheckBox&&!this.deferUpdateCheckBox.isDestroyed&&(this.deferUpdateCheckBox.destroy(),this.deferUpdateCheckBox=null),this.deferUpdateApplyButton&&!this.deferUpdateApplyButton.isDestroyed&&(this.deferUpdateApplyButton.destroy(),this.deferUpdateApplyButton=null),this.deferUpdateCancelButton&&!this.deferUpdateCancelButton.isDestroyed&&(this.deferUpdateCancelButton.destroy(),this.deferUpdateCancelButton=null),this.adaptiveElement&&!this.adaptiveElement.isDestroyed&&(this.adaptiveElement.destroy(),this.adaptiveElement=null),"Popup"===this.parent.renderMode&&(this.fieldListDialog&&!this.fieldListDialog.isDestroyed&&(this.fieldListDialog.destroy(),this.fieldListDialog=null),document.getElementById(this.parent.element.id+"_Container"))&&ue(document.getElementById(this.parent.element.id+"_Container"))};var i0t=n0t;function n0t(e){this.parent=e}r0t.prototype.render=function(e){var t,i,n;this.parentElement=this.parent.dialogRenderer.parentElement,this.fieldListSort=(this.parent.pivotGridModule||this.parent).defaultFieldListOrder,this.fieldListSort="Ascending"===this.fieldListSort?"Ascend":"Descending"===this.fieldListSort?"Descend":"None",this.parent.isAdaptive?this.renderTreeDialog(e):(e=Q("div",{className:"e-field-table "+("olap"===this.parent.dataType?"e-olap-field-table":"")}),(i=Q("div",{className:"e-field-header",attrs:{title:this.parent.localeObj.getConstant("allFields")}})).innerText=this.parent.localeObj.getConstant("allFields"),t=Q("div",{className:_at+" "+xht}),this.treeViewElement=Q("div",{id:this.parent.element.id+"_TreeView",className:Vat+" "+("olap"===this.parent.dataType?"e-olap-field-list-tree":"")}),(n=Q("div",{className:"e-field-header-container"})).appendChild(i),e.appendChild(n),this.updateSortElements(n),this.parent.enableFieldSearching&&(i=Q("div",{id:this.parent.element.id+"_SearchDiv",attrs:{tabindex:"-1"},className:"e-field-list-search"}),n=Q("input",{attrs:{type:"text"}}),i.appendChild(n),this.fieldSearch=new fV({placeholder:this.parent.localeObj.getConstant("search"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-field-list-search-input"+(this.parent.cssClass?" "+this.parent.cssClass:""),input:this.textChange.bind(this),showClearButton:!0}),this.fieldSearch.isStringTemplate=!0,this.fieldSearch.appendTo(n),this.fieldSearch.addIcon("append","e-field-list-search-icon "+Tat),(n=Q("div",{className:Lht+" "+Eat})).innerText=this.parent.localeObj.getConstant("noMatches"),e.appendChild(i),e.appendChild(n)),t.appendChild(this.treeViewElement),e.appendChild(t),this.parentElement.appendChild(e),"Fixed"===this.parent.renderMode&&(i=Q("div",{className:"e-center-div"}),(n=Q("div",{className:"e-center-title"})).innerText=this.parent.localeObj.getConstant("centerHeader"),this.parentElement.appendChild(i),this.parentElement.appendChild(n)),this.renderTreeView())},r0t.prototype.updateSortElements=function(e){for(var t={None:"sortNone",Ascend:"sortAscending",Descend:"sortDescending"},i=0,n=Object.keys(t);i<n.length;i++){var o=n[i],o=Q("span",{attrs:{tabindex:"0","aria-disabled":"false","aria-label":"Sort "+o,"data-sort":o,title:this.parent.localeObj.getConstant(t[o]),role:"button"},className:Tat+" e-sort-"+o.toLowerCase()+" "+(this.fieldListSort===o?"e-selected":"")});e.appendChild(o),this.unWireFieldListEvent(o),this.wireFieldListEvent(o)}},r0t.prototype.renderTreeView=function(){this.fieldTable=new PW({fields:{dataSource:this.getTreeData(),id:"id",text:"caption",isChecked:"isSelected",parentID:"pid",iconCss:"spriteCssClass"},nodeChecked:this.nodeChecked.bind(this),nodeClicked:this.nodeStateChange.bind(this),keyPress:this.nodeStateChange.bind(this),cssClass:"e-field-list-tree"+(this.parent.cssClass?" "+this.parent.cssClass:""),showCheckBox:!0,allowDragAndDrop:!0,sortOrder:"None",loadOnDemand:"olap"!==this.parent.dataType&&!this.parent.enableFieldSearching,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,nodeDragStart:this.dragStart.bind(this),nodeDragStop:this.dragStop.bind(this),drawNode:this.updateTreeNode.bind(this),nodeExpanding:this.updateNodeIcon.bind(this),nodeCollapsed:this.updateNodeIcon.bind(this),nodeSelected:function(e){q([e.node],"e-active"),e.cancel=!0}}),this.treeViewElement.innerHTML="",this.fieldTable.isStringTemplate=!0,this.fieldTable.appendTo(this.treeViewElement);var e="Fixed"===this.parent.renderMode?this.parent.element:this.parentElement;je(e.querySelector("."+Vat))||(K(e.querySelector("."+Vat),PW).dragObj.enableAutoScroll=!1)},r0t.prototype.updateNodeIcon=function(e){var t;"olap"===this.parent.dataType&&(e.node&&e.node.querySelector(".e-list-icon")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-icon")?(q([t=e.node.querySelector(".e-list-icon")],"e-folderCDB-icon"),U([t],"e-folderCDB-open-icon")):e.node&&e.node.querySelector(".e-list-icon")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-open-icon")&&(q([t=e.node.querySelector(".e-list-icon")],"e-folderCDB-open-icon"),U([t],"e-folderCDB-icon")))},r0t.prototype.updateTreeNode=function(e){var t,i=!1,n=("olap"===this.parent.dataType?i=this.updateOlapTreeNode(e):e.nodeData.hasChildren?(i=!1,e.node.querySelector("."+Jht).style.display="none",U([e.node],jat)):i=!0,je(e.nodeData.pid)||U([e.node],Wat),e.node.querySelector("."+Rlt));if(e.node.querySelector(".e-list-icon")&&n&&(t=e.node.querySelector(".e-list-icon"),n.insertBefore(t,e.node.querySelector(".e-list-text"))),i&&!this.parent.isAdaptive&&(i=!1,i=Q("span",{attrs:{tabindex:"-1",title:!(t=Hdt.getFieldInfo(e.nodeData.id,this.parent)).fieldItem||t.fieldItem.allowDragAndDrop?this.parent.localeObj.getConstant("drag"):"","aria-disabled":"false"},className:Tat+" "+alt+" "+(!t.fieldItem||t.fieldItem.allowDragAndDrop?"":llt)}),e.node.querySelector("."+Jht))&&!e.node.querySelector(".cls.DRAG_CLASS")&&n&&n.insertBefore(i,e.node.querySelector("."+Jht)),e.node.querySelector("."+flt)&&U([e.node.querySelector("."+zlt)],jlt),this.parent.enableFieldSearching&&this.isSearching){var o=e.node;if("olap"===this.parent.dataType)for(var r=o.getAttribute("data-uid"),s=this.parent.pivotCommon.eventBase.searchListItem,a=0;a<this.parentIDs.length;a++){r===this.parentIDs[a]&&U([o],Eat);for(var l=0,h=s;l<h.length;l++){var d=h[l],d=this.parent.pivotCommon.eventBase.getParentIDs(this.fieldTable,d.getAttribute("data-uid"),[]);if(-1<Hdt.inArray(r,d)){q([o],Eat);break}}}else for(a=0;a<this.nonSearchList.length;a++){if(o.textContent===this.nonSearchList[a].textContent){U([o],Eat);break}if(o.innerText===this.nonSearchList[a].textContent){U([o],Eat);break}}}},r0t.prototype.updateOlapTreeNode=function(e){var t=!1;return"olap"===this.parent.dataType?(e.node&&e.node.querySelector(".e-calcMemberGroupCDB,.e-measureGroupCDB-icon,.e-folderCDB-icon,.e-folderCDB-open-icon,.e-dimensionCDB-icon,.e-kpiCDB-icon")&&(e.node.querySelector("."+Jht).style.display="none"),e.node&&e.node.querySelector(".e-list-icon")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-level-members")&&(this.parent.isAdaptive?e.node.querySelector("."+Jht).style.display="none":e.node.querySelector("."+Jht).style.visibility="hidden"),e.node&&(e.node.querySelector(".e-hierarchyCDB-icon,.e-attributeCDB-icon,.e-namedSetCDB-icon")||e.node.querySelector(".e-measure-icon,.e-kpiGoal-icon,.e-kpiStatus-icon,.e-kpiTrend-icon,.e-kpiValue-icon")||e.node.querySelector(".e-calc-measure-icon,.e-calc-dimension-icon"))&&(t=(e.node.querySelector(".e-measure-icon")&&(e.node.querySelector(".e-list-icon").style.display="none"),!0))):t=!0,t},r0t.prototype.renderTreeDialog=function(e){var t=Q("div",{id:this.parent.element.id+"_FieldListTreeView",className:"e-adaptive-field-list-dialog "+("olap"===this.parent.dataType?"e-olap-editor-dialog":"")});this.parentElement.appendChild(t),this.fieldDialog=new pS({animationSettings:{effect:"Fade"},allowDragging:!1,header:this.parent.localeObj.getConstant("adaptiveFieldHeader"),content:this.createTreeView(this.getTreeData(e)),isModal:!0,visible:!0,showCloseIcon:!1,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,width:"320px",height:"350px",position:{X:"center",Y:"center"},buttons:[{click:this.closeTreeDialog.bind(this),isFlat:!1,buttonModel:{cssClass:blt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}},{click:this.onFieldAdd.bind(this),isFlat:!1,buttonModel:{cssClass:vlt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("add"),isPrimary:!0}}],closeOnEscape:!1,cssClass:this.parent.cssClass,close:this.closeTreeDialog.bind(this),target:z(this.parentElement,"."+Lat)}),this.fieldDialog.isStringTemplate=!0,this.fieldDialog.appendTo(t)},r0t.prototype.createTreeView=function(e){var t=Q("div",{id:this.parent.element.id+"EditorDiv",className:plt}),i=Q("div",{id:this.parent.element.id+"_SearchDiv",attrs:{tabindex:"-1"},className:dht}),n=Q("input",{attrs:{type:"text"}}),o=(i.appendChild(n),Q("div",{className:_at})),r=Q("div",{className:clt+" "+("olap"===this.parent.dataType?"e-olap-field-list-tree":"")}),i=(t.appendChild(i),this.editorSearch=new LR({showClearButton:!0,placeholder:this.parent.localeObj.getConstant("search"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:pht+(this.parent.cssClass?" "+this.parent.cssClass:""),change:this.textChange.bind(this)}),this.editorSearch.isStringTemplate=!0,this.editorSearch.appendTo(n),Q("div",{className:Lht+" "+Eat}));return i.innerText=this.parent.localeObj.getConstant("noMatches"),t.appendChild(i),o.appendChild(r),t.appendChild(o),this.fieldTable=new PW({fields:{dataSource:e,id:"id",text:"caption",isChecked:"isSelected",parentID:"pid",iconCss:"spriteCssClass"},showCheckBox:!0,loadOnDemand:"olap"!==this.parent.dataType,sortOrder:"olap"===this.parent.dataType?"None":"Ascending",enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,nodeChecked:this.nodeChecked.bind(this),nodeClicked:this.addNode.bind(this),keyPress:this.addNode.bind(this),drawNode:this.updateTreeNode.bind(this),nodeExpanding:this.updateNodeIcon.bind(this),nodeCollapsed:this.updateNodeIcon.bind(this),nodeSelected:function(e){q([e.node],"e-active"),e.cancel=!0}}),this.fieldTable.isStringTemplate=!0,this.fieldTable.appendTo(r),t},r0t.prototype.textChange=function(e){this.parent.pivotCommon.eventBase.searchTreeNodes(e,this.fieldTable,!0),this.parent.isAdaptive?t=this.fieldDialog.element.querySelector("."+Lht):(t=this.parentElement.querySelector("."+Lht),i=this.parentElement.querySelector("."+xht));var t,i,n=[].slice.call(this.fieldTable.element.querySelectorAll("li")),e=[].slice.call(this.fieldTable.element.querySelectorAll("li."+Eat));if(n.length===e.length?(q([t],Eat),this.parent.isAdaptive||(U([i],Eat),q([i],Hat))):(U([t],Eat),this.parent.isAdaptive||(q([i],Eat),U([i],Hat))),this.isSearching=0<e.length,this.nonSearchList=e,"olap"===this.parent.dataType){this.parentIDs=[];for(var o,r=0;r<n.length;r++)n[r].classList.contains("e-level-1")&&(o=n[r].getAttribute("data-uid"),this.parentIDs.push(o))}},r0t.prototype.dragStart=function(n){var e,o=this;n.event.target.classList.contains(alt)&&!n.event.target.classList.contains(llt)?(e={fieldName:(e=Hdt.getFieldInfo(n.draggedNode.getAttribute("data-uid"),this.parent)).fieldName,fieldItem:e.fieldItem,axis:e.axis,dataSourceSettings:this.parent.dataSourceSettings,cancel:!1},(this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(act,e,function(e){if(e.cancel)o.parent.isDragging=!1,n.cancel=!0;else{o.parent.isDragging=!0,U([n.draggedNode.querySelector("."+zlt)],Flt);e=void 0;if((e=("olap"===o.parent.dataType?o.parent.olapEngineModule:o.parent.engineModule).fieldList[n.draggedNode.getAttribute("data-uid")])&&"CalculatedField"===e.aggregateType)for(var t=0,i=[Slt,Alt,Ilt];t<i.length;t++)U([o.parentElement.querySelector("."+i[t])],Blt);e=n.clonedNode;e&&"Popup"===("pivotfieldlist"===o.parent.getModuleName()&&o.parent.renderMode)&&(e.style.zIndex=(o.parent.dialogRenderer.fieldListDialog.zIndex+1).toString())}})):(this.parent.isDragging=!1,n.cancel=!0)},r0t.prototype.dragStop=function(e){e.cancel=!0,this.parent.isDragging=!1;for(var t=0,i=[Slt,Alt,Ilt];t<i.length;t++)q([this.parentElement.querySelector("."+i[t])],Blt);q([e.draggedNode.querySelector("."+zlt)],Flt),this.parent.pivotCommon.filterDialog.dialogPopUp&&this.parent.pivotCommon.filterDialog.dialogPopUp.close();var n,o=e.draggedNodeData.id.toString();this.isNodeDropped(e,o)&&(n=this.parent.pivotFieldList[o],this.parent.pivotCommon.dataSourceUpdate.control="pivotview"!==this.parent.getModuleName()&&this.parent.isPopupView&&this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent,this.parent.pivotCommon.nodeStateModified.onStateModified(e,o))&&((this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&this.parent.pivotGridModule.pivotDeferLayoutUpdate?(n.isSelected=!0,this):this.parent).updateDataSource(),this.parent.axisFieldModule.render())},r0t.prototype.isNodeDropped=function(e,t){var i=!0;if("true"===e.draggedNodeData.isChecked){var n=this.getButton(t),t=z(n,"."+Clt),o=z(e.target,"."+Clt);if(n&&t===o){for(var r,s=[].slice.call(t.querySelectorAll("."+Jat)),a=z(e.target,"."+Kat),l=void 0,h=-1,d=0,p=s.length;d<p;d++)s[d].id===n.id&&(l=d),a&&(r=a.querySelector("."+Jat),s[d].id===r.id)&&(h=d);(l===h||l===s.length-1&&-1===h)&&(o=document.getElementById(this.parent.element.id+"_Container"),q([].slice.call(o.querySelectorAll("."+hlt)),dlt),i=!1)}}return i},r0t.prototype.getButton=function(e){for(var t,i=document.getElementById(this.parent.element.id+"_Container"),n=[].slice.call(i.querySelectorAll("."+Jat)),o=0,r=n.length;o<r;o++)if(n[o].getAttribute("data-uid")===e){t=n[o];break}return t},r0t.prototype.nodeChecked=function(e){var t,i;this.isSpaceKey&&!je(t=z(e.node,"."+Rlt))&&(i=z(t,"li").getAttribute("data-uid"),this.parent.isAdaptive?this.addNode(void 0,i,"check"===e.action,t):this.nodeStateChange(void 0,i,"check"===e.action,t)),this.isSpaceKey=!1},r0t.prototype.nodeStateChange=function(e,i,n,o){var r=this;o=je(o)?e.node:o,i=je(i)?o.getAttribute("data-uid"):i,this.parent.pivotCommon.filterDialog.dialogPopUp&&this.parent.pivotCommon.filterDialog.dialogPopUp.close();var s=this.parent.pivotFieldList[i];if(!je(e)){if(this.isSpaceKey=e.event.action&&"space"===e.event.action,je(s)||o.classList.contains(Eat)||e.event.target&&(e.event.target.classList.contains(Rdt)||e.event.target.classList.contains(Odt))||e.event.action&&"enter"!==e.event.action)return;n=!1;var t=this.fieldTable.getNode(o);n=e.event&&e.event.target&&!e.event.target.closest("."+Jht)?"true"===t.isChecked?(this.fieldTable.uncheckAll([o]),!1):(this.fieldTable.checkAll([o]),!0):"true"===t.isChecked}var a=this.parent.isPopupView?this.parent.pivotGridModule:this.parent,l=Hdt.getFieldInfo(i,this.parent),h=o.closest("."+jat);n?(e={fieldName:i,dropField:l.fieldItem,dataSourceSettings:Hdt.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:"number"===s.type||"CalculatedField"===s.type&&s.formula&&-1<s.formula.indexOf("Measure")&&"olap"===this.parent.dataType?"values":"rows",dropPosition:l.position,draggedAxis:"fieldlist",cancel:!1},a.trigger(Ydt,e,function(e){var t;e.cancel?r.updateCheckState(s,"check"):(U([o.querySelector("."+zlt)],jlt),h&&U([h.querySelector("."+zlt)],jlt),r.updateSelectedNodes(o,"check"),t=r.parent.pivotCommon.dataSourceUpdate.getNewField(i,l.fieldItem),r.updateReportSettings(t,e),r.updateNodeStateChange(i,s,n))})):(t={cancel:!1,fieldName:i,dataSourceSettings:Hdt.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:l.fieldItem,axis:l.axis},a.trigger(oct,t,function(e){e.cancel?r.updateCheckState(s,"uncheck"):(q([o.querySelector("."+zlt)],jlt),h&&je(h.querySelector("."+Wat+" ."+flt))&&q([h.querySelector("."+zlt)],jlt),r.updateSelectedNodes(o,"uncheck"),r.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(i),"pivot"===r.parent.dataType&&r.parent.showValuesButton&&1<r.parent.dataSourceSettings.values.length&&l&&l.position<r.parent.dataSourceSettings.valueIndex&&("row"===r.parent.dataSourceSettings.valueAxis&&"rows"===l.axis||"column"===r.parent.dataSourceSettings.valueAxis&&"columns"===l.axis)&&a.setProperties({dataSourceSettings:{valueIndex:r.parent.dataSourceSettings.valueIndex-1}},!0),"olap"===r.parent.dataType&&0===r.parent.dataSourceSettings.values.length&&r.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport("[Measures]"),r.updateNodeStateChange(i,s,n))}))},r0t.prototype.updateReportSettings=function(e,t){var i,n=t.dropPosition,t=t.dropAxis;switch("pivot"===this.parent.dataType&&this.parent.showValuesButton&&1<this.parent.dataSourceSettings.values.length&&(je(i="row"===this.parent.dataSourceSettings.valueAxis&&"rows"===t?this.parent.dataSourceSettings.rows:"column"===this.parent.dataSourceSettings.valueAxis&&"columns"===t?this.parent.dataSourceSettings.columns:void 0)||(-1===n&&-1===this.parent.dataSourceSettings.valueIndex?this.parent.setProperties({dataSourceSettings:{valueIndex:i.length}},!0):-1<n&&n<=this.parent.dataSourceSettings.valueIndex?this.parent.setProperties({dataSourceSettings:{valueIndex:this.parent.dataSourceSettings.valueIndex+1}},!0):-1<this.parent.dataSourceSettings.valueIndex&&n>this.parent.dataSourceSettings.valueIndex&&(n-=1))),t){case"filters":-1!==n?this.parent.dataSourceSettings.filters.splice(n,0,e):this.parent.dataSourceSettings.filters.push(e);break;case"rows":-1!==n?this.parent.dataSourceSettings.rows.splice(n,0,e):this.parent.dataSourceSettings.rows.push(e);break;case"columns":-1!==n?this.parent.dataSourceSettings.columns.splice(n,0,e):this.parent.dataSourceSettings.columns.push(e);break;case"values":-1!==n?this.parent.dataSourceSettings.values.splice(n,0,e):this.parent.dataSourceSettings.values.push(e),"olap"!==this.parent.dataType||!this.parent.olapEngineModule||this.parent.olapEngineModule.isMeasureAvail||1<this.parent.dataSourceSettings.values.length||("row"===this.parent.dataSourceSettings.valueAxis?this.parent.dataSourceSettings.rows:this.parent.dataSourceSettings.columns).push({name:"[Measures]",caption:"Measures",baseField:void 0,baseItem:void 0})}},r0t.prototype.updateCheckState=function(e,t){for(var i=this.fieldTable.element.querySelectorAll("."+Jht),n=this.fieldTable.element.querySelectorAll(".e-list-text"),o=0;o<i.length;o++)e.caption===n[o].textContent&&("check"===t?this.fieldTable.uncheckAll([e.id]):this.fieldTable.checkAll([e.id]))},r0t.prototype.updateNodeStateChange=function(e,t,i){!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate?this.parent.updateDataSource(!0):(t.isSelected=i,"olap"===this.parent.dataType&&this.parent.olapEngineModule.updateFieldlistData(e,i),this.updateDataSource());var t=this.treeViewElement.querySelector('[data-uid="'+e+'"]'),n=(t.focus(),q([t],"e-hover"),this.parent);setTimeout(function(){n.axisFieldModule.render()})},r0t.prototype.updateSelectedNodes=function(e,t){if(e&&e.querySelector("ul"))for(var i=0,n=[].slice.call(e.querySelectorAll("li"));i<n.length;i++){var o=n[i];("check"===t?U:q)([o.querySelector("."+zlt)],jlt)}},r0t.prototype.updateDataSource=function(){this.parent.isPopupView?("olap"===this.parent.dataType?this.parent.pivotGridModule.olapEngineModule=this.parent.olapEngineModule:this.parent.pivotGridModule.engineModule=this.parent.engineModule,this.parent.pivotGridModule.setProperties({dataSourceSettings:this.parent.dataSourceSettings.properties},!0),this.parent.pivotGridModule.notify(mct,this)):this.parent.triggerPopulateEvent()},r0t.prototype.addNode=function(e,t,i,n){var o=this;n=je(n)?e.node:n,t=je(t)?n.getAttribute("data-uid"):t;var r=this.parent.pivotFieldList[t];if(!je(e)){if(this.isSpaceKey=e.event.key&&" "===e.event.key,je(r)||e.node.classList.contains(Eat)||e.event.target&&(e.event.target.classList.contains(Rdt)||e.event.target.classList.contains(Odt))||e.event.key&&"Enter"!==e.event.key)return;i=!1;n=this.fieldTable.getNode(e.node);i=e.event&&e.event.target&&!e.event.target.classList.contains("e-frame")?"true"===n.isChecked?(this.fieldTable.uncheckAll([e.node]),!1):(this.fieldTable.checkAll([e.node]),!0):"true"===n.isChecked}t=Hdt.getFieldInfo(r.id.toString(),this.parent),e=this.parent.isPopupView?this.parent.pivotGridModule:this.parent;i?(n={fieldName:t.fieldName,dropField:t.fieldItem,dataSourceSettings:Hdt.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:["filters","columns","rows","values"][this.parent.dialogRenderer.adaptiveElement.selectedItem],draggedAxis:"fieldlist",cancel:!1},e.trigger(Ydt,n,function(e){e.cancel?o.updateCheckState(r,"check"):o.selectedNodes.push(r.id.toString())})):(i={cancel:!1,fieldName:t.fieldName,dataSourceSettings:Hdt.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:t.fieldItem,axis:t.axis},e.trigger(oct,i,function(e){if(e.cancel)o.updateCheckState(r,"uncheck");else for(var t=o.selectedNodes.length;t--;)if(o.selectedNodes[t]===r.id.toString()){o.selectedNodes.splice(t,1);break}}))},r0t.prototype.refreshTreeView=function(){var e;this.fieldTable&&(e=this.getUpdatedData(),this.fieldTable.fields={dataSource:e,id:"id",text:"caption",isChecked:"isSelected",parentID:"pid",iconCss:"spriteCssClass"},this.fieldTable.dataBind())},r0t.prototype.getUpdatedData=function(){var e=this.getTreeData(),t=this.fieldTable.expandedNodes;return this.updateExpandedNodes(e,t),this.applySorting(e,this.fieldListSort)},r0t.prototype.getTreeData=function(e){var t=[];if("olap"===this.parent.dataType)t=this.getOlapTreeData(e);else{for(var i=this.parent.pivotFieldList?Object.keys(this.parent.pivotFieldList):[],n={},o=0,r=i;o<r.length;o++){var s,a=r[o],l=this.parent.pivotFieldList[a];n[a]={id:l.id,pid:l.pid,caption:l.caption,isSelected:l.isSelected},je(l.pid)||n[a].hasChildren||(s=l.pid+"_group_name",n[a].pid=s,n[s]={id:s,caption:l.pid,isSelected:(n[s]&&n[s].isSelected?n[s]:l).isSelected,hasChildren:!0})}if(this.parent.isAdaptive){for(var e=[this.parent.dataSourceSettings.filters,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.values][e],h=i.length;h--;)n[i[h]].isSelected=!1;for(var d=0,p=e;d<p.length;d++)n[p[d].name].isSelected=!0}for(var c=0,u=Object.keys(n);c<u.length;c++){l=u[c];t.push(n[l])}}return t},r0t.prototype.getOlapTreeData=function(e){var t=[],i=this.parent.olapEngineModule.fieldListData||[];if(this.parent.isAdaptive)for(var n=[this.parent.dataSourceSettings.filters,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.values][e],o=0;o<i.length;){var r=i[o],s=void 0;if(3===e){if("[measures]"!==r.id.toLowerCase()&&(0===r.id.toLowerCase().indexOf("[measures]")||r.spriteCssClass&&-1!==r.spriteCssClass.indexOf("e-measureCDB"))||"[calculated members].[_0]"===r.id.toLowerCase()||r.spriteCssClass&&-1!==r.spriteCssClass.indexOf("e-calc-measure-icon")){(s={id:r.id,caption:r.caption,hasChildren:r.hasChildren,type:r.type,aggregateType:r.aggregateType,isSelected:r.isSelected,pid:r.pid,spriteCssClass:r.spriteCssClass}).isSelected=!1,s.spriteCssClass&&-1!==s.spriteCssClass.indexOf("e-measureCDB")&&(s.spriteCssClass=s.spriteCssClass.replace("e-folderCDB-icon","e-measureGroupCDB-icon"),s.pid=void 0);for(var a=0,l=n;a<l.length;a++){var h=l[a];if(s.id===h.name){s.isSelected=!0;break}}t.push(s)}}else if(!(0===r.id.toLowerCase().indexOf("[measures]")||r.spriteCssClass&&-1!==r.spriteCssClass.indexOf("e-measureCDB")||r.spriteCssClass&&-1!==r.spriteCssClass.indexOf("e-calc-measure-icon"))){(s={id:r.id,caption:r.caption,hasChildren:r.hasChildren,type:r.type,aggregateType:r.aggregateType,isSelected:r.isSelected,pid:r.pid,spriteCssClass:r.spriteCssClass}).isSelected=!1;for(var d=0,p=n;d<p.length;d++){var c=p[d];if(s.id===c.name){s.isSelected=!0;break}}t.push(s)}o++}else t=je(this.parent.olapEngineModule.fieldListData)?[]:Hdt.getClonedData(this.parent.olapEngineModule.fieldListData);return t},r0t.prototype.updateExpandedNodes=function(e,t){if(0<t.length)for(var i=0,n=0,o=e;n<o.length;n++){var r=o[n];if(-1<t.indexOf(r.id)&&(i++,r.expanded=!0,r.spriteCssClass=r.spriteCssClass&&-1<r.spriteCssClass.toString().indexOf("e-folderCDB-icon")?r.spriteCssClass.toString().replace("e-folderCDB-icon","e-folderCDB-open-icon"):r.spriteCssClass,i===t.length))break}},r0t.prototype.updateSorting=function(e){var t=e.target,e=t.getAttribute("data-sort");if(this.parent.actionObj.actionName=sut,!this.parent.actionBeginMethod()){try{if(-1===t.className.indexOf("e-selected")){switch(e){case"None":this.fieldListSort="None",U([t],"e-selected"),q([this.parentElement.querySelector(".e-sort-ascend")],"e-selected"),q([this.parentElement.querySelector(".e-sort-descend")],"e-selected");break;case"Ascend":this.fieldListSort="Ascend",U([t],"e-selected"),q([this.parentElement.querySelector(".e-sort-none")],"e-selected"),q([this.parentElement.querySelector(".e-sort-descend")],"e-selected");break;case"Descend":this.fieldListSort="Descend",U([t],"e-selected"),q([this.parentElement.querySelector(".e-sort-ascend")],"e-selected"),q([this.parentElement.querySelector(".e-sort-none")],"e-selected")}this.refreshTreeView()}}catch(e){this.parent.actionFailureMethod(e)}this.parent.actionObj.actionName=this.parent.getActionCompleteName(),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()}},r0t.prototype.applySorting=function(e,t){var i,n;return 0<e.length&&("olap"===this.parent.dataType?(n=i=void 0,0<this.parent.dataSourceSettings.calculatedFieldSettings.length&&"[calculated members].[_0]"===e[0].id.toLowerCase()?(n=e[0],i=e[1],e.splice(0,2)):(i=e[0],e.splice(0,1)),e="Ascend"===t?e.sort(function(e,t){return e.caption>t.caption?1:t.caption>e.caption?-1:0}):"Descend"===t?e.sort(function(e,t){return e.caption<t.caption?1:t.caption<e.caption?-1:0}):e,n?e.splice(0,0,n,i):e.splice(0,0,i)):this.fieldTable.sortOrder="Ascend"===t?"Ascending":"Descend"===t?"Descending":"None"),e},r0t.prototype.onFieldAdd=function(){this.parent.dialogRenderer.updateDataSource(this.selectedNodes),this.closeTreeDialog()},r0t.prototype.closeTreeDialog=function(){this.selectedNodes=[],this.fieldDialog.hide(),this.fieldDialog.destroy(),document.getElementById(this.parent.element.id+"_FieldListTreeView")&&ue(document.getElementById(this.parent.element.id+"_FieldListTreeView")),this.fieldDialog=null},r0t.prototype.keyPress=function(e){13===e.keyCode&&e.target&&(e.target.click(),e.preventDefault())},r0t.prototype.wireFieldListEvent=function(e){E.add(e,"keydown",this.keyPress,this),E.add(e,"click",this.updateSorting,this)},r0t.prototype.unWireFieldListEvent=function(e){E.remove(e,"keydown",this.keyPress),E.remove(e,"click",this.updateSorting)},r0t.prototype.addEventListener=function(){this.parent.on(Cct,this.refreshTreeView,this)},r0t.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Cct,this.refreshTreeView)},r0t.prototype.destroy=function(){this.removeEventListener(),this.editorSearch&&!this.editorSearch.isDestroyed&&(this.editorSearch.destroy(),this.editorSearch=null),this.fieldSearch&&!this.fieldSearch.isDestroyed&&(this.fieldSearch.destroy(),this.fieldSearch=null),this.fieldTable&&!this.fieldTable.isDestroyed&&(this.fieldTable.destroy(),this.fieldTable=null),this.fieldDialog&&!this.fieldDialog.isDestroyed&&(this.fieldDialog.destroy(),this.fieldDialog=null)};var o0t=r0t;function r0t(e){this.selectedNodes=[],this.isSearching=!1,this.parentIDs=[],this.isSpaceKey=!1,this.parent=e,this.addEventListener()}a0t.prototype.render=function(){var e;this.parent.isAdaptive||(e=Q("div",{className:"e-axis-table "+("olap"===this.parent.dataType?"e-olap-axis-table":"")}),this.leftAxisPanel=Q("div",{className:Uat}),this.rightAxisPanel=Q("div",{className:qat}),this.parent.dialogRenderer.parentElement.appendChild(e),e.appendChild(this.leftAxisPanel),e.appendChild(this.rightAxisPanel),this.axisTable=e,this.renderAxisTable()),this.parent.axisFieldModule.render()},a0t.prototype.renderAxisTable=function(){for(var e=["filters","rows","columns","values"],t=0,i=e.length;t<i;t++){var n=Q("div",{className:Vat+"-"+e[t]}),o=Q("div",{className:Eht+"-container"}),r=Q("div",{className:"e-axis-header",attrs:{title:this.parent.localeObj.getConstant(e[t])}}),r=(r.innerText=this.parent.localeObj.getConstant(e[t]),o.appendChild(this.getIconupdate(e[t])),o.appendChild(r),Q("div",{className:Yat+" e-"+e[t]})),s=void 0,s="rows"===e[t]?this.parent.localeObj.getConstant("dropRowPrompt"):"columns"===e[t]?this.parent.localeObj.getConstant("dropColPrompt"):"values"===e[t]?this.parent.localeObj.getConstant("dropValPrompt"):this.parent.localeObj.getConstant("dropFilterPrompt"),a=Q("span",{className:Xat});a.innerText=s,new un(r,{}),n.appendChild(o),n.appendChild(r),n.appendChild(a),(t<=1?this.leftAxisPanel:this.rightAxisPanel).appendChild(n),this.unWireEvent(r),this.wireEvent(r)}},a0t.prototype.getIconupdate=function(e){var t=Q("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:Eht+"-icon-container"}),e=Q("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:Tat+" "+Eht+"-"+e});return t.appendChild(e),t},a0t.prototype.wireEvent=function(e){E.add(e,"mouseover",this.updateDropIndicator,this),E.add(e,"mouseleave",this.updateDropIndicator,this)},a0t.prototype.unWireEvent=function(e){E.remove(e,"mouseover",this.updateDropIndicator),E.remove(e,"mouseleave",this.updateDropIndicator)},a0t.prototype.updateDropIndicator=function(e){var t,i=this.parent.dialogRenderer.parentElement;this.parent.isDragging&&e.target.classList.contains(Yat)&&"mouseover"===e.type?(q([].slice.call(i.querySelectorAll("."+hlt)),dlt),q([].slice.call(i.querySelectorAll("."+hlt+"-last")),dlt),0<(t=[].slice.call(e.target.querySelectorAll("."+Kat))).length&&U([t[t.length-1].querySelector("."+hlt+"-last")],dlt)):this.parent.isDragging&&(e.target.classList.contains(Clt)||"mouseleave"!==e.type)||(q([].slice.call(i.querySelectorAll("."+hlt)),dlt),q([].slice.call(i.querySelectorAll("."+hlt+"-last")),dlt))};var s0t=a0t;function a0t(e){this.parent=e}h0t.prototype.renderPivotButton=function(e){var t,i=this,o=(this.parentElement="pivotview"===this.parent.getModuleName()?this.parent.element:document.getElementById(this.parent.element.id+"_Container"),Array.prototype.slice.call(this.parentElement.querySelectorAll(".e-group-"+e.axis))),r=("rows"===e.axis&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&je(this.parentElement.querySelector("."+Tdt))&&(o.push(this.parent.groupingBarModule.rowPanel),t=this.parent.groupingBarModule.rowPanel),Pe([],e.field,null,!0)),n=e.axis,s=-1,a="pivot"===this.parent.dataType&&("pivotfieldlist"===this.parent.getModuleName()&&this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent).showValuesButton;if(("row"===this.parent.dataSourceSettings.valueAxis&&"rows"===e.axis||"column"===this.parent.dataSourceSettings.valueAxis&&"columns"===e.axis)&&a&&1<this.parent.dataSourceSettings.values.length&&je(Hdt.getFieldByName("[Measures]",r))&&(a=Hdt.getFieldByName("[Measures]",this.parent.dataSourceSettings.fieldMapping),e={name:"[Measures]",caption:this.parent.localeObj.getConstant("values"),axis:e.axis,showRemoveIcon:!(a&&"showRemoveIcon"in a)||a.showRemoveIcon,allowDragAndDrop:!(a&&"allowDragAndDrop"in a)||a.allowDragAndDrop},-1===this.parent.dataSourceSettings.valueIndex||this.parent.dataSourceSettings.valueIndex>r.length?(s=r.length,r.push(e),this.parent.setProperties({dataSourceSettings:{valueIndex:-1}},!0)):(s=this.parent.dataSourceSettings.valueIndex,r.splice(s,0,e))),"pivotfieldlist"===this.parent.getModuleName()){if(this.parentElement=document.getElementById(this.parent.element.id+"_Container"),!this.parentElement.querySelector("."+Vat+"-"+n))return;var l=this.parentElement.querySelector("."+Vat+"-"+n).querySelector("."+Xat);(0===r.length?q:U)([l],Eat),t=this.parentElement.querySelector("."+Vat+"-"+n).querySelector("."+Yat)}else this.parentElement=this.parent.element,je(this.parentElement.querySelector(".e-group-"+n))||(t=this.parentElement.querySelector(".e-group-"+n));if(t)if("pivotview"===this.parent.getModuleName()&&0===r.length)for(var h=0;h<o.length;h++)(w=o[h]).classList.contains(ydt)||w.classList.contains(fdt)||((l=Q("span",{className:Xat})).innerText=this.parent.groupingBarSettings.allowDragAndDrop?"rows"===n?this.parent.localeObj.getConstant("rowAxisPrompt"):"columns"===n?this.parent.localeObj.getConstant("columnAxisPrompt"):"values"===n?this.parent.localeObj.getConstant("valueAxisPrompt"):"filters"===n?this.parent.localeObj.getConstant("filterAxisPrompt"):this.parent.localeObj.getConstant("allFields"):"",w.appendChild(l));else{for(var h=0,O=r.length;h<O;h++)for(var d="pivotfieldlist"===this.parent.getModuleName()?[t]:o,p=0;p<d.length;p++){var c,u,g,m,f,y,v,b,w=d[p];(this.parent.olapEngineModule&&(this.parent.olapEngineModule.fieldList[r[h].name]||"[Measures]"===r[h].name)||this.parent.engineModule)&&(c="olap"===this.parent.dataType&&("[measures]"===r[h].name.toLowerCase()||"values"===n),g="olap"===this.parent.dataType&&"values"===n,w.classList.contains(ydt)||w.classList.contains(fdt)||(u=Q("div",{className:Kat+(0===h&&"all-fields"!==n?" e-first-btn":"")+(this.parent.isTabular?" e-tabular-pvt-btn":""),attrs:{"data-tag":n+":"+r[h].name}}),this.parent.isTabular&&(u.style.width="auto"),m=r[h].caption||r[h].name,m=this.parent.enableHtmlSanitizer?go.sanitize(m):m,g=Q("div",{id:this.parent.element.id+"_"+r[h].name,className:Jat+" "+r[h].name.replace(/[^A-Z0-9]/gi,"")+(this.parent.isTabular?" e-tabular-row-btn":""),attrs:{"data-uid":r[h].name,tabindex:"pivotview"===this.parent.getModuleName()&&this.parent.grid&&"rows"===n&&!w.classList.contains(mdt)?"-1":"0",isvalue:h===s||c&&!g?"true":"false","aria-disabled":"false","aria-label":m,"data-type":"olap"===this.parent.dataType?g?"isMeasureFieldsAvail":c?"isMeasureAvail":r[h].type:r[h].type,"data-caption":m,"data-basefield":this.parent.enableHtmlSanitizer?go.sanitize(r[h].baseField):r[h].baseField,"data-baseitem":this.parent.enableHtmlSanitizer?go.sanitize(r[h].baseItem):r[h].baseItem,role:"button"}}),m=Q("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:hlt}),b=Q("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:hlt+"-last"}),f=this.createButtonDragIcon(r[h],g),y=this.createButtonText(r,h,n,s),g.appendChild(y),"all-fields"!==n?(c||r[h].isNamedSet||r[h].isCalculatedField||(-1!==["filters","values"].indexOf(n)||s===h||"olap"===this.parent.dataType&&("pivotview"===this.parent.getModuleName()&&this.parent.enableVirtualization||"pivotfieldlist"===this.parent.getModuleName()&&void 0!==this.parent.pivotGridModule&&this.parent.pivotGridModule.enableVirtualization)||this.createSortOption(g,r[h].name,r[h]),"values"!==n&&s!==h&&this.createFilterOption(g,r[h].name,n,r[h]),"values"===n&&this.getTypeStatus(r,h,g)),!r[h].isCalculatedField&&"CalculatedField"!==r[h].type||(v=Q("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("editCalculatedField")},className:Tat+" "+Rht}),(this.parent.allowCalculatedField&&this.parent.calculatedFieldModule&&(r[h].showEditIcon||void 0===r[h].showEditIcon)?q:U)([v],Eat),g.appendChild(v)),v=Q("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("remove")},className:Tat+" "+slt}),("pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.showRemoveIcon&&(r[h].showRemoveIcon||void 0===r[h].showRemoveIcon)?q:U:r[h].showRemoveIcon||void 0===r[h].showRemoveIcon?q:U)([v],Eat),g.appendChild(v),u.appendChild(m),u.appendChild(g),u.appendChild(b)):(u.appendChild(m),u.appendChild(g)),w.appendChild(u),(b=new zv({enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass})).isStringTemplate=!0,b.appendTo(g),this.unWireEvent(u,h===s&&"all-fields"!==n?"values":n,c),this.wireEvent(u,h===s&&"all-fields"!==n?"values":n,c),("pivotview"!==this.parent.getModuleName()||this.parent.isAdaptive)&&"pivotfieldlist"!==this.parent.getModuleName())||(this.createDraggable(r[h],"pivotview"===this.parent.getModuleName()?y:f),K(g.querySelector("."+Nat),hn).enableAutoScroll=!1))}if("values"===n)for(var C=ge("."+vdt,this.parentElement)?K(ge("."+vdt,this.parentElement),qz):null,S=this,h=0;h<o.length;h++)!function(e){var t,i,n,e=o[e];e.classList.contains(ydt)&&S.parent.pivotChartModule&&(t=r.map(function(e){return{text:e.caption||e.name,value:e.name}}),i=S.parent,C&&e.querySelector("."+vdt)?(C.dataSource=t,C.value=i.chartSettings.enableMultipleAxis?t[0].value:i.pivotChartModule.currentMeasure):(n=Q("div",{className:vdt}),e.appendChild(n),(C=new qz({dataSource:t,enableRtl:S.parent.enableRtl,locale:S.parent.locale,value:i.chartSettings.enableMultipleAxis?t[0].value:i.pivotChartModule.currentMeasure,width:S.parent.isAdaptive?150:200,fields:{value:"value",text:"text"},cssClass:"e-group-chart-values-drodown"+(S.parent.cssClass?" "+S.parent.cssClass:""),change:function(e){e.e&&null!==e.e&&(i.chartSettings.value=e.value)}})).isStringTemplate=!0,C.appendTo(n)))}(h);else if("columns"===n)for(var A=void 0,x=ge("."+bdt,this.parentElement)?K(ge("."+bdt,this.parentElement),qz):null,h=0;h<o.length;h++)if((w=o[h]).classList.contains(fdt)&&this.parent.pivotChartModule){for(var N=this.parent.pivotChartModule.currentMeasure,I=this.parent.chartSettings.columnDelimiter||"-",V=this.parent.chartSettings.columnHeader&&""!==this.parent.chartSettings.columnHeader?this.parent.chartSettings.columnHeader.split(I).join(" - "):"",T="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,E=T.pivotValues,_=this.parent.pivotChartModule.getColumnTotalIndex(E),D=[],M=!1,k=0,H=Object.keys(E);k<H.length;k++){var z=H[k];if(M)break;var P=Number(z);if(E[P][0]&&"row"===E[P][0].axis&&(0===this.parent.dataSourceSettings.rows.length||"grand sum"!==E[P][0].type))for(var j=E[P][0],B="olap"===this.parent.dataType?T.tupRowInfo[j.ordinal]:void 0,z=E[P],F=0,W=Object.keys(z);F<W.length;F++){var L=W[F],L=Number(L),L=E[P][L],R="olap"===this.parent.dataType&&B&&B.measureName?B.measureName:L.actualText;_[L.colIndex]||"value"!==L.axis||"header"===j.type||""===R||R!==N||(M=!0,R=("olap"===this.parent.dataType?L.columnHeaders.toString().split(/~~|::/):L.columnHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter)).join(" - "),D.push({value:R,text:R,title:((L={}).title=R,L)}),R===V&&(A=D.length))}}x&&w.querySelector("."+bdt)?(x.dataSource=D,x.value=(void 0!==A?D[A-1]:D[0]).value):(I=Q("div",{className:bdt}),w.appendChild(I),(x=new qz({dataSource:D,enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:A?D[A-1].value:D[0]?D[0].value:"",width:"200",fields:{value:"value",text:"text",htmlAttributes:"title"},cssClass:"e-group-chart-columns-dropdown"+(this.parent.cssClass?" "+this.parent.cssClass:""),change:function(e){var t;e.e&&null!==e.e&&(t=i.parent.chartSettings.columnDelimiter||"-",i.parent.chartSettings.columnHeader=e.value.split(" - ").join(t))}})).isStringTemplate=!0,x.appendTo(I))}}},h0t.prototype.createButtonText=function(e,t,i,n){"filters"===i&&(r=this.updateButtontext(e[t].name)),(s="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule).fieldList&&void 0!==s.fieldList[e[t].name]&&(o="DistinctCount"===(o=s.fieldList[e[t].name].aggregateType)||"number"===s.fieldList[e[t].name].type&&"include"!==s.fieldList[e[t].name].type&&"exclude"!==s.fieldList[e[t].name].type?void 0===o?"Sum":s.fieldList[e[t].name].aggregateType:"Count");var o,r,s,a=e[t].caption||e[t].name,a=this.parent.enableHtmlSanitizer?go.sanitize(a):a,n=Q("span",{attrs:{title:"filters"===i?"olap"===this.parent.dataType&&"CalculatedField"===s.fieldList[e[t].name].type?a:a+" ("+r+")":"olap"!==this.parent.dataType&&this.parent.dataSourceSettings.showAggregationOnValueField&&"values"===i&&"CalculatedField"!==o?this.parent.localeObj.getConstant(o)+" "+this.parent.localeObj.getConstant("of")+" "+a:a,tabindex:"-1","aria-disabled":"false",oncontextmenu:"return false;","data-type":n===t?"":o},className:$at+" "+("pivotview"!==this.parent.getModuleName()||this.parent.groupingBarSettings.allowDragAndDrop&&(e[t].allowDragAndDrop||void 0===e[t].allowDragAndDrop)?"":llt)});return n.innerText="filters"===i?"olap"===this.parent.dataType&&"CalculatedField"===s.fieldList[e[t].name].type?a:a+" ("+r+")":"olap"!==this.parent.dataType&&this.parent.dataSourceSettings.showAggregationOnValueField&&"values"===i&&"CalculatedField"!==o?this.parent.localeObj.getConstant(o)+" "+this.parent.localeObj.getConstant("of")+" "+a:a,n},h0t.prototype.getTypeStatus=function(e,t,i){var n="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;n.fieldList&&(n=n.fieldList[e[t].name])&&"CalculatedField"!==n.aggregateType&&this.validateDropdown(n.type)&&this.createSummaryType(i,e[t].name,e[t])},h0t.prototype.validateDropdown=function(e){var t=this.parent.aggregateTypes;if("number"!==e)return-1<t.indexOf("Count")||-1<t.indexOf("DistinctCount");for(var i=0;i<t.length;i++)if(-1<this.parent.getAllSummaryType().indexOf(t[i]))return!0;return!1},h0t.prototype.createSummaryType=function(e,t,i){var n=Q("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("format")},className:Tat+" "+Fat});return("pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.showValueTypeIcon&&i.showValueTypeIcon?q:U:i.showValueTypeIcon?q:U)([n],Eat),e.appendChild(n),n},h0t.prototype.createMenuOption=function(e){this.menuOption.render(e,this.parentElement),this.parent.pivotButtonModule=this},h0t.prototype.openCalculatedFieldDialog=function(e){var e=e.target.parentElement.getAttribute("data-uid"),t=Hdt.getFieldInfo(e,this.parent);if(this.parent.actionObj.actionName=aut,this.parent.actionObj.fieldInfo=t,!this.parent.actionBeginMethod())try{"pivotview"===this.parent.getModuleName()?this.parent.isAdaptive&&this.parent.showFieldList&&this.parent.pivotFieldListModule&&!this.parent.pivotFieldListModule.isDestroyed?(this.parent.pivotFieldListModule.element.querySelector("."+Rat).click(),this.parent.pivotFieldListModule.dialogRenderer.adaptiveElement.select(4),this.parent.pivotFieldListModule.calculatedFieldModule.updateAdaptiveCalculatedField(!0,e)):(this.parent.isAdaptive||(this.parent.calculatedFieldModule.buttonCall=!0),this.parent.notify(Act,{edit:!0,fieldName:e})):"pivotfieldlist"===this.parent.getModuleName()&&(this.parent.isAdaptive?(this.parent.dialogRenderer.adaptiveElement.select(4),this.parent.calculatedFieldModule.updateAdaptiveCalculatedField(!0,e),this.parent.calculatedFieldModule.buttonCall=!0):(this.parent.dialogRenderer.fieldListDialog&&(this.parent.dialogRenderer.fieldListDialog.hide(),U([this.parent.element.querySelector("."+Rat)],Dat)),this.parent.notify(Act,{edit:!0,fieldName:e}),this.parent.calculatedFieldModule&&(this.parent.calculatedFieldModule.buttonCall=!0)))}catch(e){this.parent.actionFailureMethod(e)}},h0t.prototype.createDraggable=function(e,t){this.draggable=new hn(t,{clone:!0,enableTailMode:!0,enableAutoScroll:!0,helper:this.createDragClone.bind(this),dragStart:this.onDragStart.bind(this),drag:this.onDragging.bind(this),dragStop:this.onDragStop.bind(this),abort:"pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.allowDragAndDrop&&e.allowDragAndDrop?"":"."+Jat:e.allowDragAndDrop?"":"."+Jat})},h0t.prototype.createButtonDragIcon=function(e,t){var i=Q("span",{attrs:{tabindex:"-1","aria-disabled":"false"}}),e=Q("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("drag")},className:Tat+" "+alt+" "+(e.allowDragAndDrop||void 0===e.allowDragAndDrop?"":llt)});return i.appendChild(e),"pivotfieldlist"===this.parent.getModuleName()&&t.appendChild(i),i},h0t.prototype.createSortOption=function(e,t,i){var n="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;if(!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate)o="Descending"===n.fieldList[t].sort?ilt:"";else for(var o="",r=0;r<this.parent.dataSourceSettings.sortSettings.length;r++)this.parent.dataSourceSettings.sortSettings[r].name===t&&(o="Descending"===this.parent.dataSourceSettings.sortSettings[r].order?ilt:"");return n=n.fieldList&&"None"===n.fieldList[t].sort?Q("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("sort")},className:Tat}):Q("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("sort")},className:Tat+" "+elt+" "+o}),(this.parent.dataSourceSettings.enableSorting?"pivotview"===this.parent.getModuleName()?i.showSortIcon&&this.parent.groupingBarSettings.showSortIcon?q:U:i.showSortIcon?q:U:U)([n],Eat),e.appendChild(n),n},h0t.prototype.createFilterOption=function(e,t,i,n){var o="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,r=Hdt.getFieldByName(t,this.parent.dataSourceSettings.filterSettings);if(!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate)o.fieldList[t].filter=null===o.fieldList[t].filter?[]:o.fieldList[t].filter,s=!("Server"===this.parent.dataSourceSettings.mode&&!r||"Local"===this.parent.dataSourceSettings.mode&&0===o.fieldList[t].filter.length)||o.fieldList[t].isExcelFilter?rlt:olt;else for(var s=olt,a=0;a<this.parent.dataSourceSettings.filterSettings.length;a++)this.parent.dataSourceSettings.filterSettings[a].name===t&&(s=rlt);r=Q("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("filter")},className:nlt+" "+Tat+" "+s});return((this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==i||this.parent.dataSourceSettings.allowMemberFilter?q:U)([r],Eat),("pivotview"===this.parent.getModuleName()?((this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==i||this.parent.dataSourceSettings.allowMemberFilter)&&this.parent.groupingBarSettings.showFilterIcon&&n.showFilterIcon?q:U:n.showFilterIcon&&((this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==i||this.parent.dataSourceSettings.allowMemberFilter)?q:U)([r],Eat),e.appendChild(r),r},h0t.prototype.updateButtontext=function(e){var t,i="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,n=i.fieldList[e].filter.length,o=i.fieldList[e].filterType,r=i.fieldList[e].dateMember.length,s=i.fieldList[e].filter[0];if("olap"===this.parent.dataType)t=this.updateOlapButtonText(i,e,s,n);else if("include"===o)1===n?t=s:1<n&&(t=n===r?this.parent.localeObj.getConstant("all"):this.parent.localeObj.getConstant("multipleItems"));else if("exclude"===o){if(1===n)t=2===r?s!==i.fieldList[e].dateMember[0].actualText?s:i.fieldList[e].dateMember[0].actualText:this.parent.localeObj.getConstant("multipleItems");else if(1<n){var a=void 0,l=Object.keys(i.fieldList[e].members),h=i.fieldList[e].filter;if(n===l.length-1)for(a=0;a<l.length;a++){var d=l[a];if(-1===h.indexOf(d)){t=l[a];break}}else t=this.parent.localeObj.getConstant("multipleItems")}}else t=this.parent.localeObj.getConstant("all");return t},h0t.prototype.updateOlapButtonText=function(e,t,i,n){var o,r=e.fieldList[t].actualFilter;if(0<r.length){var s=e.fieldList[t].members,a=[];if(0<e.fieldList[t].filterMembers.length){for(var l={},h=0,d=r;h<d.length;h++)s[l[p=d[h]]=p]&&(l=this.parent.pivotCommon.eventBase.getParentNode(t,p,l));for(var p,c=0,u=l?Object.keys(l):[];c<u.length;c++)!s[p=u[c]].isSelected||s[p].parent&&s[s[p].parent].isSelected||a.push(p);i=1===a.length?s[a[0]].caption:i}n=0===a.length?n:a.length}return 0===n?o=e.fieldList[t].allMember||this.parent.localeObj.getConstant("all"):1===n?o=i:1<n&&(o=this.parent.localeObj.getConstant("multipleItems")),o},h0t.prototype.createDragClone=function(e){var e=z(e.element,"."+Jat),t=Q("div",{id:this.parent.element.id+"_DragClone",className:"e-button-drag-clone"+(this.parent.cssClass?" "+this.parent.cssClass:"")}),i=Q("span",{className:Rlt});return i.innerText=this.parent.enableHtmlSanitizer?go.sanitize(e.textContent):e.textContent,t.appendChild(i),document.body.appendChild(t),t},h0t.prototype.onDragStart=function(s){var a=this,l=z(s.element,"."+Jat),h=document.getElementById(this.parent.element.id+"_DragClone"),e=Hdt.getFieldInfo(l.getAttribute("data-uid"),this.parent),e={fieldName:e.fieldName,fieldItem:e.fieldItem,axis:e.axis,dataSourceSettings:Hdt.getClonedDataSourceSettings(this.parent.dataSourceSettings),cancel:!1};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(act,e,function(e){if(e.cancel)a.parent.isDragging=!1,a.draggable.intDestroy(s.event),G(h);else{a.parent.isDragging=!0;var t,e=("olap"===a.parent.dataType?a.parent.olapEngineModule:a.parent.engineModule).fieldList[l.getAttribute("data-uid")],i=[Slt,Alt,Ilt];if(U([l],Flt),h&&"Popup"===("pivotfieldlist"===a.parent.getModuleName()&&a.parent.renderMode)&&(t=a.parent,h.style.zIndex=(t.dialogRenderer.fieldListDialog.zIndex+1).toString()),e&&"CalculatedField"===e.aggregateType)for(var n=0,o=i;n<o.length;n++){var r=o[n];U([a.parentElement.querySelector("."+r)],Blt),a.parentElement.querySelector("."+r).querySelectorAll(".e-pivot-button").forEach(function(e){e.style.cursor="no-drop"})}}})},h0t.prototype.onDragging=function(e){this.draggable.setProperties({cursorAt:{top:!je(e.event.targetTouches)||F.isDevice?60:-20}})},h0t.prototype.onDragStop=function(e){this.parent.isDragging=!1,e.target&&e.element&&z(e.element,"."+Elt)&&!z(e.target,"."+Clt)&&(e.cancel=!0);var t=z(e.element,"."+Jat);q([].slice.call(this.parentElement.querySelectorAll("."+Jat)),Flt),q([].slice.call(this.parentElement.querySelectorAll("."+hlt)),dlt);for(var i=0,n=[Slt,Alt,Ilt];i<n.length;i++){var o=n[i];q([this.parentElement.querySelector("."+o)],Blt),this.parentElement.querySelector("."+o).querySelectorAll(".e-pivot-button").forEach(function(e){e.style.cursor="default"})}this.parent.pivotCommon.filterDialog.dialogPopUp&&this.parent.pivotCommon.filterDialog.dialogPopUp.close(),document.getElementById(this.parent.element.id+"_DragClone")&&ue(document.getElementById(this.parent.element.id+"_DragClone")),document.body.style.cursor="auto",this.isButtonDropped(e.target,t)&&!e.cancel&&(this.parent.pivotCommon.dataSourceUpdate.control="pivotview"!==this.parent.getModuleName()&&this.parent.pivotGridModule||this.parent,this.parent.pivotCommon.nodeStateModified.onStateModified(e,t.getAttribute("data-uid")))&&(this.updateDataSource(),this.parent.axisFieldModule.render())},h0t.prototype.isButtonDropped=function(e,t){var i=z(t,"."+Clt),n=z(e,"."+Clt),o=!0;if(i&&i===n){for(var r,s=[].slice.call(i.querySelectorAll("."+Jat)),a=z(e,"."+Kat),l=void 0,h=-1,d=0,p=s.length;d<p;d++)s[d].id===t.id&&(l=d),a&&(r=a.querySelector("."+Jat),s[d].id===r.id)&&(h=d);(l===h||l===s.length-1&&-1===h)&&(q([].slice.call(this.parentElement.querySelectorAll("."+hlt)),dlt),o=!1)}return o},h0t.prototype.updateSorting=function(e){var t,i=z(e.target,"."+Jat),n=Hdt.getFieldInfo(i?i.getAttribute("data-uid"):"",this.parent);if(!e.target.classList.contains(nlt)&&!e.target.classList.contains(slt)&&!e.target.classList.contains(alt)&&i&&n.fieldItem&&(n.fieldItem.showSortIcon||je(n.fieldItem.showSortIcon))&&!n.fieldItem.isCalculatedField&&(this.parent.actionObj.actionName=lut,this.parent.actionObj.fieldInfo=n,!this.parent.actionBeginMethod()))try{!(this.parent instanceof f0t||this.parent.groupingBarSettings.showSortIcon)||!this.parent.dataSourceSettings.enableSorting||"olap"===this.parent.dataType&&("pivotfieldlist"===this.parent.getModuleName()&&void 0!==this.parent.pivotGridModule&&this.parent.pivotGridModule.enableVirtualization||"pivotview"===this.parent.getModuleName()&&this.parent.enableVirtualization)||(this.parent.pivotCommon.eventBase.updateSorting(e),this.parent.staticPivotGridModule&&(this.parent.staticPivotGridModule.actionObj=this.parent.actionObj),(!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotfieldlist"!==this.parent.getModuleName())&&(t={sortInfo:this.parent.lastSortInfo},this.parent.actionObj.actionInfo=t,this.updateDataSource(!0)),this.parent instanceof f0t&&(this.axisField.render(),this.parent.isPopupView&&this.parent.pivotGridModule?this.parent.pivotGridModule.notify(mct,this):this.parent.staticPivotGridModule&&this.parent.staticPivotGridModule.notify(mct,this)))}catch(e){this.parent.actionFailureMethod(e)}},h0t.prototype.updateDataSource=function(e){!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotview"===this.parent.getModuleName()?this.parent.updateDataSource(e):"pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView&&this.parent.pivotGridModule?("olap"===this.parent.dataType?this.parent.pivotGridModule.olapEngineModule=this.parent.olapEngineModule:this.parent.pivotGridModule.engineModule=this.parent.engineModule,this.parent.pivotGridModule.notify(mct,this),this.parent.pivotGridModule.setProperties({dataSourceSettings:this.parent.dataSourceSettings.properties},!0)):this.parent.triggerPopulateEvent()},h0t.prototype.updateFiltering=function(e){var t=this.parent.pivotGridModule||this.parent,i=e.target.parentElement.getAttribute("data-uid"),n=Hdt.getFieldInfo(i,this.parent);if(this.parent.actionObj.actionName=hut,this.parent.actionObj.fieldInfo=n,!this.parent.actionBeginMethod())try{"pivotfieldlist"===t.getModuleName()?kA(t.fieldListSpinnerElement):t.showWaitingPopup(),t.mouseEventArgs=e,t.filterTargetID="pivotfieldlist"!==this.parent.pivotCommon.moduleName?this.parent.element:document.getElementById(this.parent.pivotCommon.parentID+"_Container"),"Server"===t.dataSourceSettings.mode?this.parent.engineModule.fieldList[i].members&&0<Object.keys(this.parent.engineModule.fieldList[i].members).length?this.updateFilterEvents():this.parent.getEngine("fetchFieldMembers",null,null,null,null,null,i):("pivot"!==t.dataType||this.parent.engineModule.fieldList[i].isMembersFilled||this.parent.engineModule.fetchFieldMembers(i),this.updateFilterEvents())}catch(e){this.parent.actionFailureMethod(e)}},h0t.prototype.updateFilterEvents=function(){var e=this.parent.pivotGridModule||this.parent,t=(this.parent.pivotCommon.eventBase.updateFiltering(e.mouseEventArgs),e.mouseEventArgs.target);this.fieldName=t.parentElement.getAttribute("data-uid"),this.parent.pivotCommon.filterDialog.dialogPopUp&&this.bindDialogEvents(),"pivotfieldlist"===e.getModuleName()?BA(e.fieldListSpinnerElement):e.hideWaitingPopup()},h0t.prototype.bindDialogEvents=function(){this.parent.pivotCommon.filterDialog.allowExcelLikeFilter&&this.parent.pivotCommon.filterDialog.tabObj?(this.index=this.parent.pivotCommon.filterDialog.tabObj.selectedItem,this.updateDialogButtonEvents(),this.parent.pivotCommon.filterDialog.dialogPopUp.buttons=this.buttonModel(),this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind(),this.parent.pivotCommon.filterDialog.tabObj.selected=this.tabSelect.bind(this)):this.parent.dataSourceSettings.allowMemberFilter&&(this.index=0,this.updateDialogButtonEvents())},h0t.prototype.buttonModel=function(){return[{isFlat:!1,buttonModel:{cssClass:"e-clear-filter-button"+(this.parent.pivotCommon.filterDialog.allowExcelLikeFilter?"":" "+Eat)+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:"e-icons e-clear-filter-icon",enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("clearFilter"),disabled:!this.parent.pivotCommon.filterDialog.filterObject},click:this.ClearFilter.bind(this)},{isFlat:!1,buttonModel:{cssClass:vlt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0},click:0===this.index?this.updateFilterState.bind(this,this.fieldName):this.updateCustomFilter.bind(this)},{isFlat:!1,click:this.parent.pivotCommon.filterDialog.closeFilterDialog.bind(this.parent.pivotCommon.filterDialog),buttonModel:{cssClass:blt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}]},h0t.prototype.tabSelect=function(e){this.index=e.selectedIndex,this.updateDialogButtonEvents(),q([].slice.call(this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelectorAll(".e-selected-tab")),"e-selected-tab"),0<e.selectedIndex&&U([this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector(".e-filter-div-content."+(1===e.selectedIndex&&this.parent.dataSourceSettings.allowLabelFilter?"e-label-filter":"e-value-filter"))],"e-selected-tab"),0===e.selectedIndex?this.parent.pivotCommon.filterDialog.updateCheckedState():(this.parent.pivotCommon.filterDialog.dialogPopUp.buttons[0].buttonModel.disabled=!1,this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector("."+vlt).removeAttribute("disabled"))},h0t.prototype.updateDialogButtonEvents=function(){this.parent.pivotCommon.filterDialog.dialogPopUp.buttons=this.buttonModel(),this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind()},h0t.prototype.updateCustomFilter=function(){var t,i=this,e=this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector(".e-selected-tab"),n=e.getAttribute("data-fieldname"),o=e.getAttribute("data-selectedField"),r=e.getAttribute("data-type"),s=e.getAttribute("data-measure"),a=e.getAttribute("data-operator"),l=e.getAttribute("data-value1"),h=e.getAttribute("data-value2"),d="value"===r?"Value":"date"===r?"Date":"number"===r?"Number":"Label",p={name:n,type:d,measure:s,condition:a,value1:"date"===r?new Date(l):l,value2:"date"===r?new Date(h):h};if("olap"===this.parent.dataType){p.selectedField=o,this.removeDataSourceSettings(n,o,d);for(var c=0,u=this.parent.dataSourceSettings.filterSettings;c<u.length;c++){var g=u[c];g.name===n&&g.selectedField===o&&(t=g)}}else t=Hdt.getFilterItemByName(n,this.parent.dataSourceSettings.filterSettings);je(l)||""===l||-1<["Between","NotBetween"].indexOf(a)&&(je(h)||""===h)?(s=d.toLowerCase()+(je(l)||""===l?"_input_option_1":"_input_option_2"),U([r=ge("#"+this.parent.element.id+"_"+s,e)],Nht),r.focus()):(a={cancel:!1,filterSettings:p,dataSourceSettings:Hdt.getClonedDataSourceSettings(this.parent.dataSourceSettings)},("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(tct,a,function(e){e.cancel||(p=e.filterSettings,t?((t=t.properties||t).type=p.type,t.measure=p.measure,t.condition=p.condition,t.value1=p.value1,t.value2=p.value2,"olap"===i.parent.dataType&&(t.selectedField=p.selectedField)):i.parent.dataSourceSettings.filterSettings.push(p)),"Value"!==d&&(i.parent.lastFilterInfo=Hdt.getFilterItemByName(n,i.parent.dataSourceSettings.filterSettings),i.parent.lastFilterInfo=i.parent.lastFilterInfo.properties||i.parent.lastFilterInfo),i.parent.pivotCommon.filterDialog.dialogPopUp.close(),e.cancel||(i.refreshPivotButtonState(n,!0),i.updateDataSource(!0))}))},h0t.prototype.ClearFilter=function(){var e=this.parent.pivotCommon.filterDialog.dialogPopUp.element,t=e.getAttribute("data-fieldname"),e=e.querySelector(".e-selected-tab"),e=(this.parent.pivotCommon.filterDialog.dialogPopUp.close(),"olap"===this.parent.dataType&&e?(e=e.getAttribute("data-selectedField"),this.removeDataSourceSettings(t,e)):this.removeDataSourceSettings(t),Hdt.getFilterItemByName(t,this.parent.dataSourceSettings.filterSettings));this.refreshPivotButtonState(t,!!e),this.updateDataSource(!0)},h0t.prototype.removeButton=function(e){var t=this,i=e.target,n=i.parentElement.getAttribute("data-uid"),o=Hdt.getFieldInfo(n,this.parent);if(this.parent.actionObj.actionName=dut,this.parent.actionObj.fieldInfo=o,!this.parent.actionBeginMethod()){e={cancel:!1,fieldName:n,dataSourceSettings:Hdt.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:o.fieldItem,axis:o.axis};try{("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(oct,e,function(e){e.cancel||("true"===i.parentElement.getAttribute("isvalue")?(t.parent.setProperties({dataSourceSettings:{values:[]}},!0),"olap"===t.parent.dataType&&t.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport("[Measures]")):(t.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(n),"pivot"===t.parent.dataType&&t.parent.showValuesButton&&1<t.parent.dataSourceSettings.values.length&&o.position<t.parent.dataSourceSettings.valueIndex&&("row"===t.parent.dataSourceSettings.valueAxis&&"rows"===e.axis||"column"===t.parent.dataSourceSettings.valueAxis&&"columns"===e.axis)&&t.parent.setProperties({dataSourceSettings:{valueIndex:t.parent.dataSourceSettings.valueIndex-1}},!0),"olap"===t.parent.dataType&&0===t.parent.dataSourceSettings.values.length&&t.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport("[Measures]")),"pivotfieldlist"===t.parent.getModuleName()&&t.parent.axisFieldModule.render(),t.updateDataSource())})}catch(e){this.parent.actionFailureMethod(e)}}},h0t.prototype.nodeStateModified=function(e){var t,i=z(e.node,"li"),n=i.getAttribute("data-fieldname");"all"===i.getAttribute("data-memberId")?(this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked=null,"check"===e.action?this.parent.pivotCommon.filterDialog.memberTreeView.checkAll():this.parent.pivotCommon.filterDialog.memberTreeView.uncheckAll(),"olap"===this.parent.dataType&&this.parent.olapEngineModule&&!this.parent.olapEngineModule.fieldList[n].isHierarchy&&this.updateNodeStates(this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(),n),this.checkedStateAll(e.action),this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked=this.nodeStateModified.bind(this)):("olap"===this.parent.dataType&&this.parent.olapEngineModule&&!this.parent.olapEngineModule.fieldList[n].isHierarchy&&(t=this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(),this.updateNodeStates(t,n)),t=this.parent.pivotCommon.currentTreeItemsPos[i.getAttribute("data-memberId")].index,this.parent.pivotCommon.currentTreeItems[t]&&(this.parent.pivotCommon.currentTreeItems[t].isSelected="check"===e.action,this.parent.pivotCommon.currentTreeItemsPos[i.getAttribute("data-memberId")].isSelected="check"===e.action)),this.parent.pivotCommon.filterDialog.updateCheckedState()},h0t.prototype.checkedStateAll=function(e){for(var t={},i=0,n=this.parent.pivotCommon.searchTreeItems;i<n.length;i++)(o=n[i]).isSelected="check"===e,t[o.htmlAttributes["data-memberId"]]=o.htmlAttributes["data-memberId"];for(var o,r=0,s=this.parent.pivotCommon.currentTreeItems;r<s.length;r++)void 0!==t[(o=s[r]).htmlAttributes["data-memberId"]]&&(o.isSelected="check"===e,this.parent.pivotCommon.currentTreeItemsPos[o.htmlAttributes["data-memberId"]].isSelected="check"===e)},h0t.prototype.updateNodeStates=function(e,t){var i=this.parent.pivotCommon.engineModule.fieldList[t],n=i.members,o=i.currrentMembers;if(0<i.searchMembers.length){for(var r=0,s=Object.keys(o);r<s.length;r++)o[d=s[r]]&&(o[d].isSelected=!1),n[d]&&(n[d].isSelected=!1,this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+d+'"]'))&&(a=this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+d+'"]'))&&!a.querySelector("ul")&&this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,d,!1);for(var a,l=0,h=e;l<h.length;l++)n[u=h[l]]&&this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+u+'"]')&&(a=this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+u+'"]'))&&!a.querySelector("ul")&&(n[u].isSelected=!0,this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,u,!0)),o[u]&&(o[u].isSelected=!0)}else{for(var d,p=0,c=Object.keys(n);p<c.length;p++)n[d=c[p]].isSelected&&(n[d].isSelected=!1);for(var u,g=0,m=e;g<m.length;g++)n[u=m[g]]&&(n[u].isSelected=!0,this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,u,!0))}},h0t.prototype.updateFilterState=function(r){var s=this,a=!1,l={items:[],name:r,type:"Include"},e="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;if("olap"===this.parent.dataType&&e&&!e.fieldList[r].isHierarchy){var t=e.fieldList[r].members,i=e.fieldList[r].currrentMembers;l.items=this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(),l.levelCount=e.fieldList[r].levelCount,a=l.items.length!==this.parent.pivotCommon.filterDialog.memberTreeView.fields.dataSource.length,0<e.fieldList[r].searchMembers.length&&!a&&(g=Object.keys(t).length,a=g!==Object.keys(i).length||g!==l.items.length);for(var n=0,o=l.items;n<o.length;n++){var h=o[n];0<e.fieldList[r].searchMembers.length&&i[h]?i[h].isSelected=!0:t[h]&&(t[h].isSelected=!0)}}else{for(var d=0,p=this.parent.pivotCommon.searchTreeItems;d<p.length;d++){var c=p[d];c.isSelected&&(this.parent.pivotCommon.isDateField?l.items.push("Server"===this.parent.dataSourceSettings.mode?c.actualText:c.name):l.items.push(c.htmlAttributes["data-memberId"]))}a=l.items.length!==this.parent.pivotCommon.currentTreeItems.length}if("olap"===this.parent.dataType&&this.removeDataSourceSettings(r),this.parent.allowDeferLayoutUpdate){e.fieldList[l.name].filterType=l.type.toLowerCase(),e.fieldList[l.name].filter=[];for(var u=0;u<l.items.length;u++)e.fieldList[l.name].filter.push(l.items[u])}var g={filterSettings:l,dataSourceSettings:Hdt.getClonedDataSourceSettings(this.parent.dataSourceSettings),cancel:!1};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(tct,g,function(e){if(l=e.filterSettings,!e.cancel){if(Hdt.getFilterItemByName(r,s.parent.dataSourceSettings.filterSettings))for(var t=0;t<s.parent.dataSourceSettings.filterSettings.length;t++)if(s.parent.dataSourceSettings.filterSettings[t].name===r){s.parent.dataSourceSettings.filterSettings.splice(t,1);break}s.parent.dataSourceSettings.filterSettings.push(l)}s.parent.pivotCommon.filterDialog.dialogPopUp.close(),e.cancel||(s.refreshPivotButtonState(r,a),a||(s.removeDataSourceSettings(r),l={}),s.parent.lastFilterInfo=l,e={filterInfo:s.parent.lastFilterInfo},s.parent.actionObj.actionInfo=e,s.updateDataSource(!0),(e=s).parent instanceof f0t&&e.axisField.render());for(var i=0,n=[].slice.call(s.parentElement.querySelectorAll(".e-pivot-button"));i<n.length;i++){var o=n[i];if(o.getAttribute("data-uid")===r){o.focus();break}}})},h0t.prototype.refreshPivotButtonState=function(e,t){for(var i,n=0,o=[].slice.call(this.parentElement.querySelectorAll(".e-pivot-button"));n<o.length;n++){var r=o[n];if(r.getAttribute("data-uid")===e){i=r.querySelector("."+nlt);break}}i&&(t?(q([i],olt),U([i],rlt)):(q([i],rlt),U([i],olt)))},h0t.prototype.removeDataSourceSettings=function(e,t,i){for(var n=this.parent.dataSourceSettings.filterSettings,o=0,r=n.length;o<r;o++)if("olap"===this.parent.dataType&&t){if(!i&&n[o].name===e&&n[o].selectedField===t){n.splice(o,1);break}i&&n[o].type!==i&&n[o].name===e&&(n.splice(o,1),r--,o--)}else if(n[o].name===e){if(n.splice(o,1),"olap"!==this.parent.dataType)break;r--,o--}},h0t.prototype.updateDropIndicator=function(e){this.parent.isDragging&&(q([].slice.call(this.parentElement.querySelectorAll("."+hlt+"-last")),dlt),q([].slice.call(this.parentElement.querySelectorAll("."+hlt)),dlt),z(e.target,"."+Clt))&&U([z(e.target,"."+Kat).querySelector("."+hlt)],dlt)},h0t.prototype.wireEvent=function(e,t,i){E.add(e,"mouseover",this.updateDropIndicator,this),i||(-1===["filters","values"].indexOf(t)&&null!==e.querySelector("."+Jat)&&E.add(e.querySelector("."+Jat),"click",this.updateSorting,this),"values"!==t&&null!==e.querySelector("."+nlt)&&E.add(e.querySelector("."+nlt),"click",this.updateFiltering,this),"values"===t&&null!==e.querySelector("."+Fat)&&E.add(e.querySelector("."+Fat),"click",this.createMenuOption,this)),null!==e.querySelector("."+Rht)&&E.add(e.querySelector("."+Rht),"click",this.openCalculatedFieldDialog,this),null!==e.querySelector("."+slt)&&E.add(e.querySelector("."+slt),"click",this.removeButton,this)},h0t.prototype.unWireEvent=function(e,t,i){E.remove(e,"mouseover",this.updateDropIndicator),i||(-1===["filters","values"].indexOf(t)&&null!==e.querySelector("."+Jat)&&E.remove(e.querySelector("."+Jat),"click",this.updateSorting),"values"!==t&&null!==e.querySelector("."+nlt)&&E.remove(e.querySelector("."+nlt),"click",this.updateFiltering),"values"===t&&null!==e.querySelector("."+Fat)&&E.remove(e.querySelector("."+Fat),"click",this.createMenuOption)),null!==e.querySelector("."+Rht)&&E.remove(e.querySelector("."+Rht),"click",this.openCalculatedFieldDialog),null!==e.querySelector("."+slt)&&E.remove(e.querySelector("."+slt),"click",this.removeButton)},h0t.prototype.addEventListener=function(){this.handlers={load:this.renderPivotButton},this.parent.isDestroyed||this.parent.on(Sct,this.handlers.load,this)},h0t.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Sct,this.handlers.load)},h0t.prototype.destroy=function(){this.menuOption&&(this.menuOption.destroy(),this.menuOption=null);var e=ge("."+vdt,this.parentElement),t=e?K(e,qz):null,t=(t&&!t.isDestroyed&&t.destroy(),(e=ge("."+bdt,this.parentElement))?K(e,qz):null);t&&!t.isDestroyed&&(t.destroy(),t=null),this.draggable&&!this.draggable.isDestroyed&&(this.draggable.destroy(),this.draggable=null),this.axisField&&(this.axisField=null),this.removeEventListener(),this.isDestroyed=!0};var l0t=h0t;function h0t(e){this.parent=e,this.menuOption=new pgt(this.parent),(this.parent.pivotButtonModule=this).addEventListener(),this.parent instanceof f0t&&(this.axisField=new d0t(this.parent)),this.isDestroyed=!1}p0t.prototype.render=function(){(!this.parent.pivotButtonModule||this.parent.pivotButtonModule&&this.parent.pivotButtonModule.isDestroyed)&&new l0t(this.parent),this.createPivotButtons()},p0t.prototype.createPivotButtons=function(){var e=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],t=this.parent.dialogRenderer.parentElement;if(t.querySelector("."+Vat+"-filters")&&(t.querySelector("."+Vat+"-filters").querySelector("."+Yat).innerHTML=""),t.querySelector("."+Vat+"-rows")&&(t.querySelector("."+Vat+"-rows").querySelector("."+Yat).innerHTML=""),t.querySelector("."+Vat+"-columns")&&(t.querySelector("."+Vat+"-columns").querySelector("."+Yat).innerHTML=""),t.querySelector("."+Vat+"-values")&&(t.querySelector("."+Vat+"-values").querySelector("."+Yat).innerHTML=""),"pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&(!(this.parent.dataSourceSettings.dataSource instanceof me)&&0<this.parent.dataSourceSettings.dataSource.length||this.parent.dataSourceSettings.dataSource instanceof me&&this.parent.engineModule.data&&0<this.parent.engineModule.data.length)||"olap"===this.parent.dataType&&this.parent.dataSourceSettings.url&&""!==this.parent.dataSourceSettings.url||"Server"===this.parent.dataSourceSettings.mode&&""!==this.parent.dataSourceSettings.url)for(var i,n=["rows","columns","values","filters"],o=0,r=e.length;o<r;o++)e[o]&&(i={field:e[o],axis:n[o].toString()},this.parent.notify(Sct,i))};var d0t=p0t;function p0t(e){this.parent=e}u0t.prototype.render=function(){this.parent.dialogRenderer.render(),this.parent.isAdaptive||this.parent.treeViewModule.render(),this.parent.axisTableModule.render()};var c0t=u0t;function u0t(e){this.parent=e,this.parent.dialogRenderer=new i0t(this.parent),this.parent.treeViewModule=new o0t(this.parent),this.parent.axisTableModule=new s0t(this.parent),this.parent.axisFieldModule=new d0t(this.parent)}g0t=function(e,t){return(g0t=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])}))(e,t)};var g0t,m0t,ist=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},f0t=(function(e,t){function i(){this.constructor=e}g0t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(y0t,m0t=Ji),y0t.prototype.requiredModules=function(){var e=[];return this.allowCalculatedField&&e.push({args:[this],member:"calculatedField"}),e},y0t.prototype.getAllSummaryType=function(){return["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"]},y0t.prototype.preRender=function(){this.dataSourceSettings&&"SSAS"===this.dataSourceSettings.providerType?(this.olapEngineModule=new Iyt,this.dataType="olap"):(this.engineModule=new Wdt,this.dataType="pivot"),this.isAdaptive=F.isDevice,this.globalize=new Ti(this.locale),this.renderModule=new c0t(this),this.defaultLocale={staticFieldList:"Pivot Field List",fieldList:"Field List",dropFilterPrompt:"Drop filter here",dropColPrompt:"Drop column here",dropRowPrompt:"Drop row here",dropValPrompt:"Drop value here",addPrompt:"Add field here",adaptiveFieldHeader:"Choose field",centerHeader:"Drag fields between axes below:",add:"Add",drag:"Drag",filter:"Filter",filtered:"Filtered",sort:"Sort",remove:"Remove",filters:"Filters",rows:"Rows",columns:"Columns",values:"Values",CalculatedField:"Calculated Field",createCalculatedField:"Create Calculated Field",fieldName:"Enter the field name",error:"Error",invalidFormula:"Invalid formula.",dropText:'Example: ("Sum(Order_Count)" + "Sum(In_Stock)") * 250',dropTextMobile:"Add fields and edit formula here.",dropAction:"Calculated field cannot be place in any other region except value axis.",search:"Search",close:"Close",cancel:"Cancel",delete:"Delete",alert:"Alert",warning:"Warning",ok:"OK",allFields:"All Fields",formula:"Formula",fieldExist:"A field already exists in this name. Please enter a different name.",confirmText:"A calculation field already exists in this name. Do you want to replace it?",noMatches:"No matches",format:"Summaries values by",edit:"Edit",clear:"Clear",clearCalculatedField:"Clear edited field info",editCalculatedField:"Edit calculated field",sortAscending:"Sort ascending order",sortDescending:"Sort descending order",sortNone:"Sort data order",formulaField:"Drag and drop fields to formula",dragField:"Drag field to formula",clearFilter:"Clear",by:"by",enterValue:"Enter value",chooseDate:"Enter date",all:"All",multipleItems:"Multiple items",Equals:"Equals",DoesNotEquals:"Does Not Equal",BeginWith:"Begins With",DoesNotBeginWith:"Does Not Begin With",EndsWith:"Ends With",DoesNotEndsWith:"Does Not End With",Contains:"Contains",DoesNotContains:"Does Not Contain",GreaterThan:"Greater Than",GreaterThanOrEqualTo:"Greater Than Or Equal To",LessThan:"Less Than",LessThanOrEqualTo:"Less Than Or Equal To",Between:"Between",NotBetween:"Not Between",Before:"Before",BeforeOrEqualTo:"Before Or Equal To",After:"After",AfterOrEqualTo:"After Or Equal To",member:"Member",label:"Label",date:"Date",value:"Value",labelTextContent:"Show the items for which the label",dateTextContent:"Show the items for which the date",valueTextContent:"Show the items for which",And:"and",Sum:"Sum",Count:"Count",DistinctCount:"Distinct Count",Product:"Product",Avg:"Avg",Median:"Median",Min:"Min",Max:"Max",Index:"Index",SampleStDev:"Sample StDev",PopulationStDev:"Population StDev",SampleVar:"Sample Var",PopulationVar:"Population Var",RunningTotals:"Running Totals",DifferenceFrom:"Difference From",PercentageOfDifferenceFrom:"% of Difference From",PercentageOfGrandTotal:"% of Grand Total",PercentageOfColumnTotal:"% of Column Total",PercentageOfRowTotal:"% of Row Total",PercentageOfParentTotal:"% of Parent Total",PercentageOfParentColumnTotal:"% of Parent Column Total",PercentageOfParentRowTotal:"% of Parent Row Total",MoreOption:"More...",Years:"Years",Quarters:"Quarters",Months:"Months",Days:"Days",Hours:"Hours",Minutes:"Minutes",Seconds:"Seconds",apply:"Apply",valueFieldSettings:"Value field settings",sourceName:"Field name :",sourceCaption:"Field caption",summarizeValuesBy:"Summarize values by",baseField:"Base field",baseItem:"Base item",example:"e.g:",editorDataLimitMsg:" more items. Search to refine further.",deferLayoutUpdate:"Defer Layout Update",null:"null",undefined:"undefined",groupOutOfRange:"Out of Range",fieldDropErrorAction:"The field you are moving cannot be placed in that area of the report",memberType:"Field Type",selectedHierarchy:"Parent Hierarchy",formatString:"Format",expressionField:"Expression",olapDropText:"Example: [Measures].[Order Quantity] + ([Measures].[Order Quantity] * 0.10)",customFormat:"Enter custom format string",numberFormatString:"Example: C, P, 0000 %, ###0.##0#, etc.",Measure:"Measure",Dimension:"Dimension",Standard:"Standard",Currency:"Currency",Percent:"Percent",Custom:"Custom",blank:"(Blank)",fieldTooltip:'Drag and drop fields to create an expression. And, if you want to edit the existing calculated fields! You can achieve it by simply selecting the field under "Calculated Members".',fieldTitle:"Field Name",QuarterYear:"Quarter Year",caption:"Field Caption",copy:"Copy",of:"of",group:"Group",removeCalculatedField:"Are you sure you want to delete this calculated field?",yes:"Yes",no:"No",None:"None",qtr:"Qtr",grandTotal:"Grand Total"},this.localeObj=new Cn(this.getModuleName(),this.defaultLocale,this.locale),this.isDragging=!1,this.isDeferLayoutUpdate=je(this.isDeferLayoutUpdate)&&!this.isPopupView?this.allowDeferLayoutUpdate:this.isDeferLayoutUpdate,this.wireEvent()},y0t.prototype.frameCustomProperties=function(e,t){this.pivotGridModule&&this.pivotGridModule.updatePageSettings(!1);var i=!!this.pivotGridModule&&this.pivotGridModule.isTabular,n=(this.pivotGridModule||this).pageSettings,o=!!this.pivotGridModule&&this.pivotGridModule.enablePaging,r=!!this.pivotGridModule&&this.pivotGridModule.enableVirtualization,s=(this.pivotGridModule||this).enableHtmlSanitizer,a=(this.pivotGridModule||this.staticPivotGridModule||this).localeObj,l=!this.pivotGridModule||this.pivotGridModule.allowDrillThrough||this.pivotGridModule.editSettings.allowEditing,h=this.pivotGridModule?this.pivotGridModule.enableValueSorting:void 0,d=!(!this.pivotGridModule||!this.pivotGridModule.allowDataCompression)&&this.pivotGridModule.allowDataCompression,p=this.pivotGridModule&&this.pivotGridModule.enableVirtualization&&this.pivotGridModule.virtualScrollSettings&&this.pivotGridModule.virtualScrollSettings.allowSinglePage,t="olap"===this.dataType?{mode:"",savedFieldList:t||void 0,savedFieldListData:e||void 0,pageSettings:n,enableValueSorting:h,isDrillThrough:l,localeObj:a,enableVirtualization:r,allowDataCompression:d}:{mode:"",savedFieldList:void 0,pageSettings:n,enableValueSorting:h,isDrillThrough:l,localeObj:a,clonedReport:this.clonedReport,globalize:this.globalize,currenyCode:this.currencyCode,enablePaging:o,enableVirtualization:r,enableHtmlSanitizer:s,allowDataCompression:d,enableOptimizedRendering:p,isTabularLayout:i};return t},y0t.prototype.render=function(){"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url?"Server"===this.dataSourceSettings.mode?(this.guid=Hdt.generateUUID(),this.initialLoad()):new Qe(this.dataSourceSettings.url,"GET").send().then(function(e){return"string"==typeof e?e:e.text()}).then(this.onReadyStateChange.bind(this)):this.initialLoad()},y0t.prototype.getEngine=function(e,t,i,n,o,r,s,a,l){for(var h=this,d=(this.currentAction=e,this.pivotGridModule&&this.pivotGridModule.updatePageSettings(!1),{pageSettings:this.pivotGridModule?JSON.parse(this.pivotGridModule.getPageSettings()).pageSettings:void 0,enableValueSorting:this.pivotGridModule?this.pivotGridModule.enableValueSorting:void 0,enableDrillThrough:!this.pivotGridModule||this.pivotGridModule.allowDrillThrough||this.pivotGridModule.editSettings.allowEditing,locale:JSON.stringify(Hdt.getLocalizedObject(this)),savedFieldList:"onDrop"===e&&null!==this.engineModule.fieldList?Hdt.getClonedFieldList(this.engineModule.fieldList,!0):void 0,enableOptimizedRendering:this.pivotGridModule&&this.pivotGridModule.enableVirtualization&&this.pivotGridModule.virtualScrollSettings&&this.pivotGridModule.virtualScrollSettings.allowSinglePage,requestType:"string",headers:{"Content-type":"application/json"}}),p=(this.request.readyState!==XMLHttpRequest.UNSENT&&this.request.readyState!==XMLHttpRequest.OPENED||(this.request.withCredentials=!1),{request:this.request,dataSourceSettings:JSON.parse(this.getPersistData()).dataSourceSettings,action:e,customProperties:{},internalProperties:d,drillItem:t,sortItem:i,aggregatedItem:n,calculatedItem:o,filterItem:r,memberName:s,fetchRawDataArgs:a,editArgs:l,hash:(this.pivotGridModule||this.staticPivotGridModule||this).guid,isGroupingUpdated:"onRefresh"===this.currentAction&&0<this.dataSourceSettings.groupSettings.length||!(!this.pivotGridModule||!this.pivotGridModule.groupingModule)&&this.pivotGridModule.groupingModule.isUpdate}),c=(this.trigger(hct,p,function(e){h.request=e.request,p.internalProperties=e.internalProperties,p.customProperties=e.customProperties,p.dataSourceSettings=e.dataSourceSettings,p.calculatedItem=e.calculatedItem,p.drillItem=e.drillItem,p.editArgs=e.editArgs,p.fetchRawDataArgs=e.fetchRawDataArgs,p.filterItem=e.filterItem,p.hash=e.hash,p.memberName=e.memberName,p.sortItem=e.sortItem}),this.request.open("POST",this.dataSourceSettings.url,!0),this.request.onreadystatechange=this.onSuccess.bind(this),Object.keys(p.internalProperties.headers)),u=0;u<c.length;u++){var g=c[u],m=String(p.internalProperties.headers[g]);this.request.setRequestHeader(g,m)}"string"===p.internalProperties.requestType?this.request.send(JSON.stringify(p)):"base64"===p.internalProperties.requestType&&this.request.send(btoa(JSON.stringify(p)))},y0t.prototype.onSuccess=function(){if(this.request.readyState===XMLHttpRequest.DONE){try{var e={action:this.currentAction,response:this.request.responseText},t=(this.trigger(dct,e),JSON.parse(this.request.responseText));if("fetchFieldMembers"===this.currentAction){for(var i=JSON.parse(t.members),n=[],o={},r=(this.engineModule.globalize=je(this.globalize)?new Ti:this.globalize,this.engineModule.formatFields=this.engineModule.setFormattedFields(this.dataSourceSettings.formatSettings),Hdt.isDateField(t.memberName,this.engineModule)),s="number"===this.engineModule.fieldList[t.memberName].type,a=Object.keys(i),l=0,h=a.length;l<h;l++){var d=i[a[l]],p=r?this.engineModule.getFormattedValue(d.Name,t.memberName):{formattedText:d.Caption};o[a[l]]={index:d.Index,ordinal:d.Ordinal,isDrilled:d.IsDrilled,caption:p.formattedText},n.push({formattedText:p.formattedText,actualText:r?p.actualText:!s||isNaN(Number(d.Name))?d.Name:Number(d.Name)})}this.engineModule.fieldList[t.memberName].members=o,this.engineModule.fieldList[t.memberName].dateMember=n,this.pivotButtonModule.updateFilterEvents()}else{var c=Hdt.formatFieldList(JSON.parse(t.fieldList));if(this.engineModule.fieldList)for(a=Object.keys(this.engineModule.fieldList),l=0;l<a.length;l++)this.engineModule.fieldList[a[l]]&&c[a[l]]&&(c[a[l]].dateMember=this.engineModule.fieldList[a[l]].dateMember,c[a[l]].formattedMembers=this.engineModule.fieldList[a[l]].formattedMembers,c[a[l]].members=this.engineModule.fieldList[a[l]].members);this.engineModule.fieldList=c,this.engineModule.fields=JSON.parse(t.fields),this.engineModule.rowCount=JSON.parse(t.pivotCount).RowCount,this.engineModule.columnCount=JSON.parse(t.pivotCount).ColumnCount,this.engineModule.rowStartPos=JSON.parse(t.pivotCount).RowStartPosition,this.engineModule.colStartPos=JSON.parse(t.pivotCount).ColumnStartPosition,this.engineModule.rowFirstLvl=JSON.parse(t.pivotCount).RowFirstLevel,this.engineModule.colFirstLvl=JSON.parse(t.pivotCount).ColumnFirstLevel;for(var u=void 0,g=Hdt.formatPivotValues(JSON.parse(t.pivotValue)),m=0;m<g.length;m++)if(g[m]&&g[m][0]&&"row"===g[m][0].axis){u=m;break}this.engineModule.headerContent=Hdt.frameContent(g,"header",u,this),this.engineModule.pageSettings=this.pivotGridModule?this.pivotGridModule.pageSettings:void 0;var f=JSON.parse(t.dataSourceSettings).ValueSortSettings;this.engineModule.valueSortSettings={headerText:f.HeaderText,headerDelimiter:f.HeaderDelimiter,sortOrder:f.SortOrder,columnIndex:f.ColumnIndex},this.engineModule.pivotValues=g,this.engineModule.isEmptyData=0===this.dataSourceSettings.values.length}}catch(e){this.engineModule.pivotValues=[]}"fetchFieldMembers"!==this.currentAction&&(this.isInitial&&!this.isPopupView?(this.initEngine(),this.isInitial=!1):this.enginePopulatedEventMethod(this,!0,!1),this.calculatedFieldModule&&"onCalcOperation"===this.currentAction&&(this.calculatedFieldModule.endDialog(),this.calculatedFieldModule.isRequireUpdate)&&(this.calculatedFieldModule.isRequireUpdate=!1),this.pivotGridModule)&&this.pivotGridModule.calculatedFieldModule&&this.pivotGridModule.calculatedFieldModule.isRequireUpdate&&(this.pivotGridModule.calculatedFieldModule.endDialog(),this.pivotGridModule.calculatedFieldModule.isRequireUpdate=!1)}},y0t.prototype.onReadyStateChange=function(e){var t=[];if("CSV"===this.dataSourceSettings.type)for(var i=e.split(/\r?\n|\r/),n=0;n<i.length;n++)je(i[n])||""===i[n]||t.push(i[n].split(","));else try{t=JSON.parse(e)}catch(e){t=[]}t&&0<t.length&&this.setProperties({dataSourceSettings:{dataSource:t}},!0),this.initialLoad()},y0t.prototype.initialLoad=function(){var t=this,i={dataSourceSettings:this.dataSourceSettings,defaultFieldListOrder:this.defaultFieldListOrder};this.trigger("load",i,function(e){t.dataSourceSettings=e.dataSourceSettings,t.defaultFieldListOrder=i.defaultFieldListOrder,U([t.element],Aat),(t.enableRtl?U:q)([t.element],xat),(t.isAdaptive?U:q)([t.element],Iat),t.cssClass&&U([t.element],t.cssClass.split(" ")),t.notify(gct,{})})},y0t.prototype.wireEvent=function(){this.on(gct,this.generateData,this),this.on(bct,this.fieldListRender,this)},y0t.prototype.unWireEvent=function(){this.pivotGridModule&&this.pivotGridModule.isDestroyed||(this.off(gct,this.generateData),this.off(bct,this.fieldListRender))},y0t.prototype.getPersistData=function(){return this.addOnPersist(["dataSourceSettings"])},y0t.prototype.getModuleName=function(){return"pivotfieldlist"},y0t.prototype.onPropertyChanged=function(e,t){for(var i=!1,n=0,o=Object.keys(e);n<o.length;n++){var r,s,a,l,h,d=o[n];switch(d){case"locale":m0t.prototype.refresh.call(this);break;case"dataSourceSettings":e.dataSourceSettings&&(!je(e.dataSourceSettings.dataSource)&&this.clonedDataSet!==e.dataSourceSettings.dataSource&&e.dataSourceSettings.groupSettings||1===Object.keys(e.dataSourceSettings).length&&"dataSource"===Object.keys(e.dataSourceSettings)[0]&&0<this.dataSourceSettings.groupSettings.length)&&(this.clonedDataSet=e.dataSourceSettings.dataSource,this.engineModule.groupingFields={}),e.dataSourceSettings&&1===Object.keys(e.dataSourceSettings).length&&e.dataSourceSettings.groupSettings&&"pivot"===this.dataType&&(r=this.isPopupView?this.pivotGridModule:this.staticPivotGridModule)&&r.updateGroupingReport(e.dataSourceSettings.groupSettings,"Date"),je(e.dataSourceSettings.dataSource)&&("olap"!==this.dataType||je(e.dataSourceSettings.url))||("olap"!==this.dataType&&(je(this.savedDataSourceSettings)||(Hdt.updateDataSourceSettings(this.staticPivotGridModule,this.savedDataSourceSettings),this.savedDataSourceSettings=void 0),e.dataSourceSettings.dataSource)&&0===e.dataSourceSettings.dataSource.length&&!je(this.staticPivotGridModule)&&(this.savedDataSourceSettings=Hdt.getClonedDataSourceSettings(this.staticPivotGridModule.dataSourceSettings),this.staticPivotGridModule.setProperties({dataSourceSettings:{rows:[],columns:[],values:[],filters:[]}},!0)),"pivot"===this.dataType?(this.engineModule.fieldList=null,this.engineModule.isEmptyData=!0,this.engineModule.data=[],this.engineModule.pivotValues=[],this.engineModule.groupingFieldsInfo={}):"olap"===this.dataType&&(this.olapEngineModule.fieldList={},this.olapEngineModule.fieldListData=void 0,this.olapEngineModule.isEmptyData=!0),je(this.staticPivotGridModule)||(this.staticPivotGridModule.pivotValues=[]),this.initialLoad()),Hdt.isButtonIconRefesh(d,t,e)?(this.isPopupView&&this.pivotGridModule&&this.pivotGridModule.showGroupingBar&&this.pivotGridModule.groupingBarModule?(h=Hdt.cloneFieldSettings(this.dataSourceSettings.filters),l=Hdt.cloneFieldSettings(this.dataSourceSettings.values),s=Hdt.cloneFieldSettings(this.dataSourceSettings.rows),a=Hdt.cloneFieldSettings(this.dataSourceSettings.columns),this.pivotGridModule.setProperties({dataSourceSettings:{rows:s,columns:a,values:l,filters:h}},!0),this.pivotGridModule.axisFieldModule.render()):this.isPopupView||!this.staticPivotGridModule||this.staticPivotGridModule.isDestroyed||((r=this.staticPivotGridModule).showGroupingBar&&r.groupingBarModule&&r.axisFieldModule.render(),r.showFieldList&&r.pivotFieldListModule&&(s=Hdt.cloneFieldSettings(r.dataSourceSettings.rows),a=Hdt.cloneFieldSettings(r.dataSourceSettings.columns),l=Hdt.cloneFieldSettings(r.dataSourceSettings.values),h=Hdt.cloneFieldSettings(r.dataSourceSettings.filters),r.pivotFieldListModule.setProperties({dataSourceSettings:{rows:s,columns:a,values:l,filters:h}},!0),r.pivotFieldListModule.axisFieldModule.render(),r.pivotFieldListModule.treeViewModule.fieldTable)&&!r.isAdaptive&&r.pivotFieldListModule.notify(Cct,{})),this.axisFieldModule.render(),this.treeViewModule.fieldTable&&!this.isAdaptive&&this.notify(Cct,{})):(this.remoteData=[],"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url&&("type"in e.dataSourceSettings||"url"in e.dataSourceSettings)&&(this.engineModule.fieldList=null,this.render()));break;case"aggregateTypes":this.axisFieldModule&&this.axisFieldModule.render(),this.pivotGridModule&&this.pivotGridModule.axisFieldModule&&(this.pivotGridModule.setProperties({aggregateTypes:e.aggregateTypes},!0),this.pivotGridModule.axisFieldModule.render());break;case"showValuesButton":this.axisFieldModule&&this.axisFieldModule.render(),this.pivotGridModule&&this.pivotGridModule.showGroupingBar&&this.pivotGridModule.groupingBarModule&&this.pivotGridModule.axisFieldModule&&(this.pivotGridModule.setProperties({showValuesButton:e.showValuesButton},!0),this.pivotGridModule.axisFieldModule.render());break;case"enableRtl":(this.enableRtl?U:q)([this.element],xat),i=!0;break;case"enableFieldSearching":case"allowCalculatedField":this.refresh();break;case"allowDeferLayoutUpdate":this.isDeferLayoutUpdate=this.allowDeferLayoutUpdate,this.fieldListRender()}i&&this.fieldListRender()}},y0t.prototype.initEngine=function(){var o=this;if("pivot"===this.dataType){var e=je(this.dataSourceSettings.dataSource)?je(this.engineModule.data)?void 0:this.engineModule.data[0]:this.dataSourceSettings.dataSource[0];if(e&&this.pivotCommon){e="[object Array]"===Object.prototype.toString.call(e);if(e&&"JSON"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidJSON"));if(!e&&"CSV"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidCSV"))}}var e={dataSourceSettings:Hdt.getClonedDataSourceSettings(this.dataSourceSettings)},r=this.isPopupView?this.pivotGridModule:this;r.trigger(Udt,e,function(e){var t,i,n;Hdt.updateDataSourceSettings(o,e.dataSourceSettings),"pivot"===o.dataType?(o.dataSourceSettings.groupSettings&&0<o.dataSourceSettings.groupSettings.length&&(e=o.engineModule.data,o.clonedDataSet=o.clonedDataSet||("CSV"===o.dataSourceSettings.type?Hdt.getClonedCSVData(e):Hdt.getClonedData(e)),(e=JSON.parse(o.getPersistData()).dataSourceSettings).dataSource=[],o.clonedReport=o.clonedReport||e),(e=o.frameCustomProperties()).enableValueSorting=(o.staticPivotGridModule||o).enableValueSorting,"Server"!==o.dataSourceSettings.mode&&o.engineModule.renderEngine(o.dataSourceSettings,e,o.aggregateCellInfo?o.getValueCellInfo.bind(o):void 0,o.onHeadersSort?o.getHeaderSortInfo.bind(o):void 0),o.pivotFieldList=o.engineModule.fieldList,i={pivotFieldList:o.pivotFieldList,pivotValues:o.engineModule.pivotValues},t=o,r.trigger(qdt,i,function(e){t.pivotFieldList=e.pivotFieldList,t.engineModule.pivotValues=e.pivotValues,t.notify(bct,{}),t.trigger(ipt)})):"olap"===o.dataType&&(Hdt.renderOlapEngine(o),o.pivotFieldList=o.olapEngineModule.fieldList,i={pivotFieldList:o.pivotFieldList,pivotValues:o.olapEngineModule.pivotValues},n=o,r.trigger(qdt,i,function(e){n.pivotFieldList=e.pivotFieldList,n.olapEngineModule.pivotValues=e.pivotValues,n.notify(bct,{}),n.trigger(ipt)}))}),"None"!==this.defaultFieldListOrder&&this.treeViewModule.fieldTable&&!this.isAdaptive&&this.notify(Cct,{})},y0t.prototype.generateData=function(){this.pivotFieldList={},this.dataSourceSettings&&(this.dataSourceSettings.dataSource||this.dataSourceSettings.url)?""!==this.dataSourceSettings.url&&"olap"===this.dataType||!je(this.dataSourceSettings.dataSource)&&0<this.dataSourceSettings.dataSource.length?("pivot"===this.dataType&&(this.engineModule.data=this.dataSourceSettings.dataSource),this.initEngine()):this.dataSourceSettings.dataSource instanceof me?"pivot"===this.dataType&&0<this.remoteData.length?(this.engineModule.data=this.remoteData,this.initEngine()):setTimeout(this.getData.bind(this),100):"Server"===this.dataSourceSettings.mode?this.getEngine("onRefresh"):this.notify(bct,{}):(this.notify(bct,{}),this.trigger(ipt))},y0t.prototype.getValueCellInfo=function(e){return this.trigger(Ypt,e),e},y0t.prototype.getHeaderSortInfo=function(e){return this.trigger(Xpt,e),e},y0t.prototype.getData=function(){(this.dataSourceSettings.dataSource.defaultQuery?this.dataSourceSettings.dataSource.executeQuery(this.dataSourceSettings.dataSource.defaultQuery):this.dataSourceSettings.dataSource.executeQuery(new ya)).then(this.executeQuery.bind(this))},y0t.prototype.executeQuery=function(e){this.engineModule.data=e.result,this.initEngine()},y0t.prototype.fieldListRender=function(){this.element.innerHTML="","Popup"===this.renderMode&&this.dialogRenderer.fieldListDialog&&!this.dialogRenderer.fieldListDialog.isDestroyed&&(e=this.dialogRenderer.fieldListDialog.visible,this.dialogRenderer.fieldListDialog.destroy(),ue(document.getElementById(this.element.id+"_Container"))),this.renderModule.render(),"Popup"===this.renderMode?(this.fieldListSpinnerElement=this.dialogRenderer.fieldListDialog.element,e&&this.dialogRenderer.fieldListDialog.show()):this.fieldListSpinnerElement=this.element.querySelector(".e-pivotfieldlist-container"),this.spinnerTemplate?mA({target:this.fieldListSpinnerElement,template:this.spinnerTemplate,cssClass:this.cssClass||void 0},this.createElement):mA({target:this.fieldListSpinnerElement,cssClass:this.cssClass||void 0},this.createElement);var e={pivotEngine:"olap"===this.dataType?this.olapEngineModule:this.engineModule,dataSourceSettings:this.dataSourceSettings,id:this.element.id,element:"Popup"===this.renderMode?this.dialogRenderer.fieldListDialog.element:ge("#"+this.element.id+"_Container",this.element),moduleName:this.getModuleName(),enableRtl:this.enableRtl,enableHtmlSanitizer:this.enableHtmlSanitizer,isAdaptive:this.isAdaptive,renderMode:this.renderMode,localeObj:this.localeObj,dataType:this.dataType,cssClass:this.cssClass},e=(this.pivotCommon=new Egt(e),(this.pivotCommon.control=this).allowDeferLayoutUpdate&&(this.clonedDataSource=Hdt.getClonedDataSourceSettings(this.dataSourceSettings),"olap"===this.dataType&&(this.clonedFieldListData=Hdt.cloneOlapFieldSettings(this.olapEngineModule.fieldListData)),this.clonedFieldList=Hdt.getClonedFieldList(this.pivotFieldList)),this.isPopupView?this.pivotGridModule:this.staticPivotGridModule);e&&e.toolbarModule&&Hdt.toggleFieldListIconVisibility(e)},y0t.prototype.getFieldCaption=function(e){var t=this.getFields(e),i="olap"===this.dataType?this.olapEngineModule:this.engineModule;if(0<t.length&&i&&i.fieldList)for(var n=t.length;n--;)if(t[n])for(var o=0,r=t[n];o<r.length;o++){var s=r[o];s&&i.fieldList[s.name]&&(s.caption?i.fieldList[s.name].caption=s.caption:i.fieldList[s.name].caption=s.name)}},y0t.prototype.getFields=function(e){return[e.rows,e.columns,e.values,e.filters]},y0t.prototype.updateDataSource=function(i,n){var o=this,r=(this.pivotGridModule&&this.pivotGridModule.showWaitingPopup(),kA(this.fieldListSpinnerElement),this),s=r.isPopupView?r.pivotGridModule:r,a=!1,l=r.pivotGridModule&&(r.pivotGridModule.enableVirtualization||r.pivotGridModule.enablePaging)?r.pivotGridModule.pageSettings:void 0,h=0<Object.keys(r.lastCalcFieldInfo).length,d=0<Object.keys(r.lastSortInfo).length,p=0<Object.keys(r.lastAggregationInfo).length,c=0<Object.keys(r.lastFilterInfo).length,e={dataSourceSettings:Hdt.getClonedDataSourceSettings(r.dataSourceSettings)};s.trigger(Udt,e,function(e){var t;l&&(d||c||p||h)||(Hdt.updateDataSourceSettings(r,e.dataSourceSettings),Hdt.updateDataSourceSettings(r.pivotGridModule,e.dataSourceSettings)),je(n)?(e=!d&&(r.staticPivotGridModule||r).enableValueSorting,d&&""!==r.dataSourceSettings.valueSortSettings.headerText&&(r.pivotGridModule&&r.pivotGridModule.setProperties({dataSourceSettings:{valueSortSettings:{headerText:""}}},!0),r.setProperties({dataSourceSettings:{valueSortSettings:{headerText:""}}},!0)),"pivot"===r.dataType?((t=r.frameCustomProperties()).enableValueSorting=e,t.savedFieldList=r.pivotFieldList,l&&(d||c||p||h)&&!r.allowDeferLayoutUpdate?(d&&("Server"===s.dataSourceSettings.mode?s.getEngine("onSort",null,r.lastSortInfo,null,null,null,null):r.engineModule.onSort(r.lastSortInfo),r.lastSortInfo={}),c&&("Server"===s.dataSourceSettings.mode?s.getEngine("onFilter",null,null,null,null,r.lastFilterInfo,null):r.engineModule.onFilter(r.lastFilterInfo,r.dataSourceSettings),r.lastFilterInfo={}),p&&("Server"===s.dataSourceSettings.mode?s.getEngine("onAggregation",null,null,r.lastAggregationInfo,null,null,null):r.engineModule.onAggregation(r.lastAggregationInfo),r.lastAggregationInfo={}),h&&("Server"===s.dataSourceSettings.mode?s.getEngine("onCalcOperation",null,null,null,r.lastCalcFieldInfo,null,null):r.engineModule.onCalcOperation(r.lastCalcFieldInfo,r.dataSourceSettings),r.lastCalcFieldInfo={})):("Server"===r.dataSourceSettings.mode?d?r.getEngine("onSort",null,r.lastSortInfo,null,null,null,null):p?r.getEngine("onAggregation",null,null,r.lastAggregationInfo,null,null,null):h?r.getEngine("onCalcOperation",null,null,null,r.lastCalcFieldInfo,null,null):c?r.getEngine("onFilter",null,null,null,null,r.lastFilterInfo,null):r.getEngine("onDrop",null,null,null,null,null,null):r.engineModule.renderEngine(r.dataSourceSettings,t,r.aggregateCellInfo?r.getValueCellInfo.bind(r):void 0,r.onHeadersSort?r.getHeaderSortInfo.bind(r):void 0),r.lastSortInfo={},r.lastAggregationInfo={},r.lastCalcFieldInfo={},r.lastFilterInfo={})):a=r.updateOlapDataSource(r,d,h,a,e,c),r.getFieldCaption(r.dataSourceSettings)):(r.axisFieldModule.render(),r.pivotGridModule&&r.pivotGridModule.notify(mct,r),r.isRequiredUpdate=!1),"Server"!==r.dataSourceSettings.mode?r.enginePopulatedEventMethod(r,i,a):(r.allowDeferLayoutUpdate&&!r.isRequiredUpdate||r.isRequiredUpdate)&&(BA(o.fieldListSpinnerElement),o.pivotGridModule)&&o.pivotGridModule.hideWaitingPopup()})},y0t.prototype.enginePopulatedEventMethod=function(t,i,n){var o=this,e=t.isPopupView?t.pivotGridModule:t,r={dataSourceSettings:t.dataSourceSettings,pivotFieldList:("pivot"===t.dataType?t.engineModule:t.olapEngineModule).fieldList,pivotValues:("pivot"===t.dataType?t.engineModule:t.olapEngineModule).pivotValues},e=(e.trigger(qdt,r,function(e){t.dataSourceSettings=e.dataSourceSettings,t.pivotCommon.dataSourceSettings=t.dataSourceSettings,t.pivotFieldList=e.pivotFieldList,"olap"===t.dataType?(t.olapEngineModule.pivotValues=e.pivotValues,t.pivotCommon.engineModule=t.olapEngineModule):(t.engineModule.pivotValues=e.pivotValues,t.pivotCommon.engineModule=t.engineModule),i||!t.treeViewModule.fieldTable||t.isAdaptive||t.notify(Cct,{}),t.isRequiredUpdate?(t.allowDeferLayoutUpdate&&(t.clonedDataSource=Hdt.getClonedDataSourceSettings(t.dataSourceSettings),"olap"===o.dataType&&(o.clonedFieldListData=Hdt.cloneOlapFieldSettings(o.olapEngineModule.fieldListData)),t.clonedFieldList=Hdt.getClonedFieldList(t.pivotFieldList)),t.updateView(t.pivotGridModule)):o.isPopupView&&(o.isDeferLayoutUpdate||t.pivotGridModule&&t.pivotGridModule.pivotDeferLayoutUpdate)&&(t.pivotGridModule.engineModule=t.engineModule,t.pivotGridModule.setProperties({dataSourceSettings:t.dataSourceSettings.properties},!0),t.pivotGridModule.notify(mct,t),BA(t.fieldListSpinnerElement)),(o.isPopupView&&t.pivotGridModule&&t.pivotGridModule.allowDeferLayoutUpdate&&!t.isRequiredUpdate||!je(t.pivotGridModule))&&(BA(t.fieldListSpinnerElement),t.pivotGridModule.hideWaitingPopup()),t.isRequiredUpdate=!0,!t.pivotGridModule||n?BA(t.fieldListSpinnerElement):t.pivotGridModule.fieldListSpinnerElement=t.fieldListSpinnerElement}),this.getActionCompleteName());this.actionObj.actionName=e,this.actionObj.actionName&&this.actionCompleteMethod()},y0t.prototype.updateOlapDataSource=function(e,t,i,n,o,r){var s=e.frameCustomProperties(e.olapEngineModule.fieldListData,e.olapEngineModule.fieldList);return s.enableValueSorting=o,s.savedFieldList=e.pivotFieldList,!i&&!t||r?Hdt.renderOlapEngine(e,s):(e.olapEngineModule.savedFieldList=e.pivotFieldList,e.olapEngineModule.savedFieldListData=e.olapEngineModule.fieldListData,i?(e.olapEngineModule.updateCalcFields(e.dataSourceSettings,e.lastCalcFieldInfo),e.lastCalcFieldInfo={},n=!e.olapEngineModule.dataFields[e.lastCalcFieldInfo.name],e.pivotGridModule&&e.pivotGridModule.hideWaitingPopup()):e.olapEngineModule.onSort(e.dataSourceSettings)),e.lastSortInfo={},e.lastAggregationInfo={},e.lastCalcFieldInfo={},e.lastFilterInfo={},n},y0t.prototype.update=function(e){e&&(this.clonedDataSet=e.clonedDataSet,this.clonedReport=e.clonedReport,this.setProperties({dataSourceSettings:e.dataSourceSettings,showValuesButton:e.showValuesButton},!0),this.engineModule=e.engineModule,this.olapEngineModule=e.olapEngineModule,this.dataType=e.dataType,this.pivotFieldList=("olap"===this.dataType?e.olapEngineModule:e.engineModule).fieldList,this.isPopupView?this.pivotGridModule=e:this.staticPivotGridModule=e,this.getFieldCaption(e.dataSourceSettings),this.pivotCommon.engineModule="olap"===this.dataType?this.olapEngineModule:this.engineModule,this.pivotCommon.dataSourceSettings=this.dataSourceSettings,(this.pivotCommon.control=this).treeViewModule.fieldTable&&!this.isAdaptive&&this.notify(Cct,{}),this.axisFieldModule.render(),!this.isPopupView)&&this.allowDeferLayoutUpdate&&(this.clonedDataSource=Hdt.getClonedDataSourceSettings(this.dataSourceSettings),"olap"===this.dataType&&(this.clonedFieldListData=Hdt.cloneOlapFieldSettings(this.olapEngineModule.fieldListData)),this.clonedFieldList=Hdt.getClonedFieldList(this.pivotFieldList))},y0t.prototype.updateView=function(e){var t;e&&(t="Calculated field applied"===this.actionObj.actionName&&"olap"===e.dataType,e.element.querySelector(".e-spin-hide")&&!t&&(!this.allowDeferLayoutUpdate||this.isDeferUpdateApplied||e.isInitial&&"Chart"!==e.currentView)&&e.showWaitingPopup(),e.clonedDataSet=this.clonedDataSet,e.clonedReport=this.clonedReport,e.setProperties({dataSourceSettings:this.dataSourceSettings,showValuesButton:this.showValuesButton},!0),e.engineModule=this.engineModule,e.olapEngineModule=this.olapEngineModule,e.dataType=this.dataType,this.pivotChange||(e.pivotValues=("olap"===this.dataType?this.olapEngineModule:this.engineModule).pivotValues),t={dataSourceSettings:Hdt.getClonedDataSourceSettings(e.dataSourceSettings),pivotValues:e.pivotValues},e.trigger(Zpt,t),this.isPopupView||!("olap"===this.dataType?this.olapEngineModule:this.engineModule).isEngineUpdated&&!this.isInitial||((this.staticPivotGridModule=e).isStaticRefresh=!0,e.isStaticFieldList=!0),this.isDeferUpdateApplied=!1,this.staticPivotGridModule&&(this.staticPivotGridModule.isServerWaitingPopup=!0),e.dataBind())},y0t.prototype.triggerPopulateEvent=function(){var t=this,e=this.isPopupView?this.pivotGridModule:this,i={dataSourceSettings:this.dataSourceSettings,pivotFieldList:("olap"===this.dataType?this.olapEngineModule:this.engineModule).fieldList,pivotValues:("olap"===this.dataType?this.olapEngineModule:this.engineModule).pivotValues};e.trigger(qdt,i,function(e){t.dataSourceSettings=e.dataSourceSettings,t.pivotFieldList=e.pivotFieldList,"olap"===t.dataType?t.olapEngineModule.pivotValues=e.pivotValues:t.engineModule.pivotValues=e.pivotValues})},y0t.prototype.actionBeginMethod=function(){var e={dataSourceSettings:Hdt.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,cancel:!1};return(this.isPopupView?this.pivotGridModule:this).trigger(pct,e),e.cancel},y0t.prototype.actionCompleteMethod=function(){var e={dataSourceSettings:Hdt.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,actionInfo:this.actionObj.actionInfo};(this.isPopupView?this.pivotGridModule:this).trigger(cct,e),this.actionObj.actionName="",this.actionObj.actionInfo=void 0,this.actionObj.fieldInfo=void 0},y0t.prototype.actionFailureMethod=function(e){e={actionName:this.actionObj.actionName,errorInfo:e};(this.isPopupView?this.pivotGridModule:this).trigger(uct,e)},y0t.prototype.getActionCompleteName=function(){return this.actionObj.actionName===put?wut:this.actionObj.actionName===aut?Kut:this.actionObj.actionName===lut?Jut:this.actionObj.actionName===hut?Zut:this.actionObj.actionName===dut?$ut:this.actionObj.actionName===fut?egt:this.actionObj.actionName===sut?Iut:this.actionObj.actionName},y0t.prototype.destroy=function(){this.unWireEvent(),this.engineModule&&!this.destroyEngine&&(this.engineModule.fieldList={},this.engineModule.rMembers=null,this.engineModule.cMembers=null,this.engineModule.valueMatrix=[],this.engineModule={}),this.olapEngineModule&&!this.destroyEngine&&(this.olapEngineModule.fieldList={},this.olapEngineModule={}),this.pivotFieldList&&(this.pivotFieldList={}),this.contextMenuModule&&this.contextMenuModule.destroy(),this.treeViewModule&&this.treeViewModule.destroy(),this.pivotButtonModule&&this.pivotButtonModule.destroy(),this.pivotCommon&&this.pivotCommon.destroy(),this.dialogRenderer&&this.dialogRenderer.destroy(),this.calculatedFieldModule&&this.calculatedFieldModule.destroy(),m0t.prototype.destroy.call(this),this.contextMenuModule&&(this.contextMenuModule=null),this.treeViewModule&&(this.treeViewModule=null),this.pivotButtonModule&&(this.pivotButtonModule=null),this.pivotCommon&&(this.pivotCommon=null),this.dialogRenderer&&(this.dialogRenderer=null),this.calculatedFieldModule&&(this.calculatedFieldModule=null),this.axisFieldModule&&(this.axisFieldModule=null),this.axisTableModule&&(this.axisTableModule=null),this.renderModule&&(this.renderModule=null),this.clonedDataSet&&(this.clonedDataSet=null),this.clonedReport&&(this.clonedReport=null),this.clonedFieldList&&(this.clonedFieldList=null),this.clonedFieldListData&&(this.clonedFieldListData=null),this.localeObj&&(this.localeObj=null),this.defaultLocale&&(this.defaultLocale=null),this.element.innerHTML="",q([this.element],Aat),q([this.element],xat),q([this.element],Iat)},ist([t({},set)],y0t.prototype,"dataSourceSettings",void 0),ist([e("Popup")],y0t.prototype,"renderMode",void 0),ist([e()],y0t.prototype,"target",void 0),ist([e("")],y0t.prototype,"cssClass",void 0),ist([e(!1)],y0t.prototype,"enableHtmlSanitizer",void 0),ist([e(!1)],y0t.prototype,"allowCalculatedField",void 0),ist([e(!1)],y0t.prototype,"enableFieldSearching",void 0),ist([e(!1)],y0t.prototype,"showValuesButton",void 0),ist([e(!1)],y0t.prototype,"allowDeferLayoutUpdate",void 0),ist([e(1e3)],y0t.prototype,"maxNodeLimitInMemberEditor",void 0),ist([e(!0)],y0t.prototype,"loadOnDemandInMemberEditor",void 0),ist([e()],y0t.prototype,"spinnerTemplate",void 0),ist([e(["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"])],y0t.prototype,"aggregateTypes",void 0),ist([e("USD")],y0t.prototype,"currencyCode",void 0),ist([i()],y0t.prototype,"load",void 0),ist([i()],y0t.prototype,"enginePopulating",void 0),ist([i()],y0t.prototype,"memberFiltering",void 0),ist([i()],y0t.prototype,"enginePopulated",void 0),ist([i()],y0t.prototype,"onFieldDropped",void 0),ist([i()],y0t.prototype,"fieldDrop",void 0),ist([i()],y0t.prototype,"fieldDragStart",void 0),ist([i()],y0t.prototype,"aggregateCellInfo",void 0),ist([i()],y0t.prototype,"memberEditorOpen",void 0),ist([i()],y0t.prototype,"calculatedFieldCreate",void 0),ist([i()],y0t.prototype,"aggregateMenuOpen",void 0),ist([i()],y0t.prototype,"fieldRemove",void 0),ist([i()],y0t.prototype,"dataBound",void 0),ist([i()],y0t.prototype,"created",void 0),ist([i()],y0t.prototype,"destroyed",void 0),ist([i()],y0t.prototype,"beforeServiceInvoke",void 0),ist([i()],y0t.prototype,"afterServiceInvoke",void 0),ist([i()],y0t.prototype,"actionBegin",void 0),ist([i()],y0t.prototype,"actionComplete",void 0),ist([i()],y0t.prototype,"actionFailure",void 0),ist([i()],y0t.prototype,"onHeadersSort",void 0),ist([Bt],y0t));function y0t(e,t){e=m0t.call(this,e,t)||this;return e.pivotChange=!1,e.isRequiredUpdate=!0,e.lastSortInfo={},e.lastFilterInfo={},e.lastAggregationInfo={},e.lastCalcFieldInfo={},e.isPopupView=!1,e.enableValueSorting=!1,e.request="undefined"!=typeof window?new XMLHttpRequest:null,e.remoteData=[],e.actionObj={},e.destroyEngine=!1,e.defaultFieldListOrder="None",e.isDeferUpdateApplied=!1,e.isInitial=!0,e}var v0t="Count",b0t="DistinctCount",w0t="SampleStDev",C0t="PopulationStDev",S0t="PopulationVar",A0t="CalculatedField",i0=(x0t.prototype.getModuleName=function(){return"calculatedField"},x0t.prototype.keyActionHandler=function(e){var t=e.currentTarget.querySelector(".e-node-focus");if(t)switch(e.action){case"moveRight":case"shiftE":"pivot"===this.parent.dataType&&this.displayMenu(t);break;case"delete":"LI"===t.tagName&&!t.querySelector(".e-list-icon.e-format")&&!t.querySelector(".e-list-icon").classList.contains(".e-icons")&&t.querySelector("."+hdt)&&t.querySelector("."+hdt).classList.contains("e-list-icon")&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,t);break;case"enter":var i=t.getAttribute("data-field"),n=K(ge("#"+this.parentID+"calculateddialog",document),pS),o=t.getAttribute("data-type"),n=ge("#"+this.parentID+"droppable",n.element);"pivot"===this.parent.dataType?""===n.value?n.value=o===A0t?t.getAttribute("data-uid"):'"'+o+"("+i+')"':""!==n.value&&(n.value=o===A0t?n.value+t.getAttribute("data-uid"):n.value+'"'+o+"("+i+')"'):(this.parent.olapEngineModule&&this.parent.olapEngineModule.fieldList[i]&&this.parent.olapEngineModule.fieldList[i].isCalculatedField&&(i=this.parent.olapEngineModule.fieldList[i].tag),""===n.value?n.value=i:""!==n.value&&(n.value=n.value+i))}},x0t.prototype.fieldClickHandler=function(e){var t=z(e.event.target,"li");(e.event.target.classList.contains(wht)||e.event.target.classList.contains(Rht)||e.event.target.classList.contains(Oht)||e.event.target.classList.contains(hdt))&&(this.parent.isAdaptive?"olap"===this.parent.dataType&&this.parent.isAdaptive&&("LI"===t.tagName&&t.querySelector(".e-list-edit-icon").classList.contains(Rht)&&e.event.target.classList.contains(Rht)?(this.isEdit=!0,this.currentFieldName=t.getAttribute("data-field"),this.fieldText=t.getAttribute("data-caption"),this.formulaText=t.getAttribute("data-formula"),this.formatType=t.getAttribute("data-formatString"),this.formatText="Custom"===this.formatType?t.getAttribute("data-customformatstring"):null,this.fieldType=t.getAttribute("data-membertype"),this.parentHierarchy="Dimension"===this.fieldType?t.getAttribute("data-hierarchy"):null,U([t.querySelector(".e-list-edit-icon")],Oht),q([t.querySelector(".e-list-edit-icon")],Rht),this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)):"LI"===t.tagName&&t.querySelector(".e-list-edit-icon").classList.contains(Oht)&&e.event.target.classList.contains(Oht)?(this.isEdit=!1,this.fieldText=this.formatText=this.formulaText=this.currentFieldName=null,this.parentHierarchy=this.fieldType=this.formatType=null,U([t.querySelector(".e-list-edit-icon")],Rht),q([t.querySelector(".e-list-edit-icon")],Oht)):"LI"===t.tagName&&t.querySelector("."+hdt).classList.contains("e-icons")&&e.event.target.classList.contains(hdt)&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,e.node)):this.displayMenu(t,e.node,e.event.target))},x0t.prototype.accordionClickHandler=function(e){var t,i,n,o,r,s;e.item&&-1!==e.item.iconCss.indexOf("e-list-icon")&&z(e.originalEvent.target,".e-acrdn-header-icon")&&(i=(t=z(e.originalEvent.target,".e-acrdn-header").querySelector("."+uht)).getAttribute("data-field"),n=t.getAttribute("data-caption"),o=Hdt.getFieldByName(i,this.parent.dataSourceSettings.formatSettings),r=z(e.originalEvent.target,".e-acrdn-header-icon"),o&&(s=(s=this.getFormat(o.format))?-1<this.formatTypes.indexOf(s)?o.format:"Custom":"None",this.formatType=s),r.querySelector("."+Rht)&&e.originalEvent.target.classList.contains(Rht)?(this.isEdit=!0,this.currentFieldName=i,this.fieldText=n||i,this.formulaText=this.parent.engineModule.fieldList[i].formula,this.formatText=o?o.format:"",U([r.querySelector(".e-list-icon")],Oht),q([r.querySelector(".e-list-icon")],Rht),this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)):r.querySelector("."+Oht)&&e.originalEvent.target.classList.contains(Oht)?(this.isEdit=!1,this.fieldText=this.formatText=this.formulaText=this.currentFieldName=null,U([r.querySelector(".e-list-icon")],Rht),q([r.querySelector(".e-list-icon")],Oht)):r.querySelector("."+hdt)&&e.originalEvent.target.classList.contains(hdt)&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,t))},x0t.prototype.accordionCreated=function(){for(var e=K(ge("#"+this.parentID+"accordDiv",document),x4).element.querySelectorAll(".e-acrdn-item"),t=0;t<e.length;t++)(e[t].querySelector("."+Rht)||e[t].querySelector("."+Oht))&&(ht([Q("span",{className:"e-list-icon "+hdt+" e-icons"})],e[t].querySelector(".e-acrdn-header-icon")),U([e[t]],"e-select"))},x0t.prototype.clearFormula=function(){this.treeObj&&this.treeObj.element.querySelector("li")&&(q(this.treeObj.element.querySelectorAll("li"),"e-active"),this.displayMenu(this.treeObj.element.querySelector("li")))},x0t.prototype.displayMenu=function(e,t,i){var n,o,r,s,a,l,h,d,p,c,u,g,m,f,y,v,b=!i||i.classList.contains(Rht),w=!i||i.classList.contains(Oht),C=K(ge("#"+this.parentID+"calculateddialog",document),pS),S=K(ge("#"+this.parentID+"ddlelement",document),LR);try{"pivot"!==this.parent.dataType||!e.querySelector(".e-list-icon.e-format")||!e.querySelector(".e-list-icon.e-format").classList.contains(Tat)||e.querySelector(".e-list-icon").classList.contains(Oht)||e.querySelector(".e-list-icon").classList.contains(hdt)||e.querySelector(".e-list-icon").classList.contains(Rht)||"LI"!==e.tagName?"LI"===e.tagName&&(e.querySelector("."+Rht)&&e.querySelector("."+Rht).classList.contains("e-list-icon")&&b||"olap"===this.parent.dataType&&e.getAttribute("data-type")===A0t&&e.classList.contains("e-active")&&(i&&!i.classList.contains(hdt)||!i))?(this.isEdit=!0,n=e.getAttribute("data-field"),o=e.getAttribute("data-caption"),this.currentFieldName=n,S.value=o,S.dataBind(),r=e.getAttribute("data-formatString"),d=C.element,u=K(ge("#"+this.parentID+"Format_Div",d),qz),p=K(ge("#"+this.parentID+"Custom_Format_Element",d),LR),s=e.getAttribute("data-customformatstring"),"olap"===this.parent.dataType?(a=e.getAttribute("data-membertype"),l=e.getAttribute("data-hierarchy"),h=e.getAttribute("data-formula"),m=ge("#"+this.parentID+"_FieldNameTitle",d),g=K(ge("#"+this.parentID+"Member_Type_Div",d),qz),c=K(ge("#"+this.parentID+"Hierarchy_List_Div",d),qz),m.innerText=this.parent.localeObj.getConstant("caption"),ge("#"+this.parentID+"droppable",document).value=h,g.readonly=!0,g.value=a,g.dataBind(),"Dimension"===a&&(c.value=l)):(U(this.treeObj.element.querySelectorAll("."+Oht),Rht),q(this.treeObj.element.querySelectorAll("."+Oht),Oht),U([e.querySelector(".e-list-icon")],Oht),q([e.querySelector(".e-list-icon")],Rht),e.querySelector("."+Oht).setAttribute("title",this.parent.localeObj.getConstant("clearCalculatedField")),ge("#"+this.parentID+"droppable",document).value=e.getAttribute("data-uid")),""!==r&&(u.value=r,u.dataBind()),p.value=s,p.dataBind()):"LI"===e.tagName&&(e.querySelector("."+Oht)&&e.querySelector("."+Oht).classList.contains("e-list-icon")&&w||"olap"===this.parent.dataType&&!e.classList.contains("e-active"))?(this.isEdit=!1,S.value="",S.dataBind(),d=C.element,(p=K(ge("#"+this.parentID+"Custom_Format_Element",d),LR)).value="",p.dataBind(),"olap"===this.parent.dataType?(c=K(ge("#"+this.parentID+"Hierarchy_List_Div",d),qz),u=K(ge("#"+this.parentID+"Format_Div",d),qz),g=K(ge("#"+this.parentID+"Member_Type_Div",d),qz),(m=ge("#"+this.parentID+"_FieldNameTitle",d)).innerText=this.parent.localeObj.getConstant("fieldTitle"),c.index=0,c.dataBind(),u.index=0,u.dataBind(),g.index=0,g.readonly=!1,g.dataBind()):(U(this.treeObj.element.querySelectorAll("."+Oht),Rht),q(this.treeObj.element.querySelectorAll("."+Oht),Oht),e.querySelector("."+Rht).setAttribute("title",this.parent.localeObj.getConstant("edit"))),ge("#"+this.parentID+"droppable",document).value=""):"LI"===e.tagName&&e.querySelector("."+hdt)&&e.querySelector("."+hdt).classList.contains("e-list-icon")&&!b&&!w&&(this.parent.actionObj.actionName=dut,this.parent.actionBeginMethod()||(f=ge("#"+this.parentID+"droppable",document),y={name:this.isEdit?this.currentFieldName:S.value,caption:S.value,formula:f.value},this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),y,!0,t))):((v=ge("#"+this.parentID+"CalcContextmenu",document)?K(ge("#"+this.parentID+"CalcContextmenu",document),D4):null)&&!v.isDestroyed&&v.destroy(),this.curMenu=e.querySelector("."+zlt),this.openContextMenu(e))}catch(e){this.parent.actionFailureMethod(e)}},x0t.prototype.removeCalcField=function(e){var t=this.parent.dataSourceSettings,i=e.getAttribute("data-field"),n=t.calculatedFieldSettings;"pivot"===this.parent.dataType&&(this.parent.isAdaptive?"number"==typeof(h=parseInt(e.getAttribute("id").split(this.parentID+"_")[1],10))&&K(ge("#"+this.parentID+"accordDiv",document),x4).hideItem(h):this.treeObj.removeNodes([e]));for(var o=0;o<n.length;o++)if(n[o]&&n[o].name===i){n.splice(o,1);break}if("olap"===this.parent.dataType){for(var r,s=(r=this.parent.olapEngineModule).fieldListData||[],a=0,l=Object.keys(s);a<l.length;a++){var h,d=l[a];if(s[parseInt(d,10)].name===i)if("number"==typeof(h=parseInt(d,10))){s.splice(h,1);break}}var p=this.treeObj.getNode(e).parentID;this.treeObj.removeNodes([e]),n.length<=0&&this.treeObj.removeNodes([p])}else r=this.parent.engineModule;if(r.fields)for(o=0;o<r.fields.length;o++)if(r.fields[o]===i){r.fields.splice(o,1);break}r.savedFieldList&&r.savedFieldList[i]&&delete r.savedFieldList[i],r.fieldList&&r.fieldList[i]&&delete r.fieldList[i];for(var c=t.formatSettings,o=0;o<c.length;o++)if(c[o]&&c[o].name===i){c.splice(o,1);break}for(var u=[t.values,t.rows,t.columns,t.filters],o=0,g=u.length;o<g;o++)for(var m=0,f=u[o].length;m<f;m++)if(u[o][m].name===i){u[o].splice(m,1);break}this.isEdit&&this.currentFieldName===i&&(e=K(ge("#"+this.parentID+"ddlelement",document),LR),this.isEdit=!1,e.value="",this.currentFieldName=this.formatText=this.fieldText=this.formatType=null,this.formulaText=this.fieldType=this.parentHierarchy=null),(!je(this.parent.isDeferLayoutUpdate)&&!this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotfieldlist"!==this.parent.getModuleName())&&this.parent.updateDataSource(),this.closeErrorDialog()},x0t.prototype.openContextMenu=function(l){var h=this,e=l.getAttribute("data-field"),t="number"!==this.parent.engineModule.fieldList[e].type?"string":"number",d="string"==t?this.getValidSummaryType().slice(0,2):this.getValidSummaryType(),e={cancel:!1,fieldName:e,aggregateTypes:this.getMenuItems(t).slice()};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(sct,e,function(e){if(!e.cancel){for(var t=[],i=[],n=0,o=e.aggregateTypes;n<o.length;n++){var r=o[n];-1<d.indexOf(r)&&-1===t.indexOf(r)&&(t.push(r),i.push({id:h.parent.element.id+"Calc_"+r,text:h.parent.localeObj.getConstant(r)}))}h.createMenu(i,l);var e=l.getBoundingClientRect(),s=window.scrollY||document.documentElement.scrollTop,a=K(ge("#"+h.parentID+"CalcContextmenu",document),D4);h.parent.enableRtl?a.open(e.top+s,e.left-100):a.open(e.top+s,e.left+150)}})},x0t.prototype.selectContextMenu=function(e){var t;null!==e.element.textContent&&(t=z(this.curMenu,".e-list-item").getAttribute("data-caption"),z(this.curMenu,".e-list-item").setAttribute("data-type",e.element.id.split("_").pop()),this.curMenu.textContent=t+" ("+e.element.textContent+")",U([this.curMenu.parentElement.parentElement],["e-node-focus","e-hover"]),this.curMenu.parentElement.parentElement.setAttribute("tabindex","0"),this.curMenu.parentElement.parentElement.focus())},x0t.prototype.createMenu=function(e,t){var i=this,e={cssClass:this.parentID+"calculatedmenu"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:e,enableRtl:this.parent.enableRtl,locale:this.parent.locale,select:this.selectContextMenu.bind(this),onClose:function(){i.treeObj.element.focus(),U([t],["e-hover","e-node-focus"])}},n=ge("#"+this.parentID+"CalcContextmenu",document)?ge("#"+this.parentID+"CalcContextmenu",document):Q("ul",{id:this.parentID+"CalcContextmenu"}),e=(K(ge("#"+this.parentID+"calculateddialog",document),pS).element.appendChild(n),new D4(e));e.isStringTemplate=!0,e.appendTo(n)},x0t.prototype.applyFormula=function(){var f=this,y=this,v=!1,e=(q([document.getElementById(this.parentID+"ddlelement")],Nht),K(ge("#"+this.parentID+"ddlelement",document),LR)),e=(this.newFields=Pe([],this.parent.dataSourceSettings.calculatedFieldSettings,null,!0),{fieldName:this.isEdit?this.currentFieldName:e.value,calculatedField:this.getCalculatedFieldInfo(),calculatedFieldSettings:Hdt.cloneCalculatedFieldSettings(this.parent.dataSourceSettings.calculatedFieldSettings),cancel:!1});("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(ict,e,function(e){if(e.cancel)f.endDialog(),f.parent.lastCalcFieldInfo={},f.isFormula=!1;else{var t=e.calculatedField;if(!f.isEdit)if("olap"===y.parent.dataType){var i=t.name;y.parent.olapEngineModule.fieldList[i]&&"CalculatedField"!==y.parent.olapEngineModule.fieldList[i].type&&(v=!0)}else for(var n=0,o=Object.keys(y.parent.engineModule.fieldList);n<o.length;n++){var r=o[n];t.name&&t.name===r&&"CalculatedField"!==y.parent.engineModule.fieldList[r].aggregateType&&(v=!0)}if(v)y.parent.pivotCommon.errorDialog.createErrorDialog(y.parent.localeObj.getConstant("error"),y.parent.localeObj.getConstant("fieldExist"));else{f.existingReport=Pe({},f.parent.dataSourceSettings,null,!0);var s=f.parent.dataSourceSettings;if(je(t.name)||""===t.name||je(t.caption)||""===t.caption||!t.formula||""===t.formula)je(t.name)||""===t.name||je(t.caption)||""===t.caption?(K(ge("#"+f.parentID+"ddlelement",document),LR).value="",U([document.getElementById(f.parentID+"ddlelement")],Nht),document.getElementById(f.parentID+"ddlelement").focus()):f.parent.pivotCommon.errorDialog.createErrorDialog(f.parent.localeObj.getConstant("error"),f.parent.localeObj.getConstant("invalidFormula"));else{i=void 0;if("olap"===f.parent.dataType){if(i={name:t.name,formula:t.formula,formatString:t.formatString},je(t.hierarchyUniqueName)||(i.hierarchyUniqueName=t.hierarchyUniqueName),f.isFieldExist=!1,f.isEdit){for(u=0;u<s.calculatedFieldSettings.length;u++)if(s.calculatedFieldSettings[u].name===i.name&&f.isEdit){s.calculatedFieldSettings[u].hierarchyUniqueName=t.hierarchyUniqueName,f.parent.olapEngineModule.fieldList[i.name].caption=t.caption,s.calculatedFieldSettings[u].formatString=i.formatString,s.calculatedFieldSettings[u].formula=i.formula,i=s.calculatedFieldSettings[u],f.updateFormatSettings(s,i.name,t.formatString),f.parent.olapEngineModule.getFormattedFields(s.formatSettings),f.parent.olapEngineModule.formatFields[i.name]&&(f.parent.olapEngineModule.formatFields[i.name].format?f.parent.olapEngineModule.formatFields[i.name].format=f.getFormat(i.formatString):delete f.parent.olapEngineModule.formatFields[i.name]),f.isFieldExist=!0;break}for(var a=!1,l=0,h=[s.rows,s.columns,s.values,s.filters];l<h.length;l++){for(var d=0,p=h[l];d<p.length;d++){var c=p[d];if(c.isCalculatedField&&null!==i.name&&c.name===i.name&&f.isEdit){c.caption=t.caption,a=f.isFieldExist=!0;break}}if(a)break}}else for(var u=0;u<s.calculatedFieldSettings.length;u++)if(s.calculatedFieldSettings[u].name===i.name)return void f.createConfirmDialog(y.parent.localeObj.getConstant("alert"),y.parent.localeObj.getConstant("confirmText"),t);f.isFieldExist||(s.calculatedFieldSettings.push(i),f.updateFormatSettings(s,i.name,t.formatString),f.parent.olapEngineModule.getFormattedFields(s.formatSettings),f.parent.olapEngineModule.formatFields[i.name]&&(f.parent.olapEngineModule.formatFields[i.name].format?f.parent.olapEngineModule.formatFields[i.name].format=f.getFormat(i.formatString):delete f.parent.olapEngineModule.formatFields[i.name])),f.parent.lastCalcFieldInfo=i}else{i={name:t.name,caption:t.caption,type:"CalculatedField"};var g={name:t.name,formula:t.formula};if(je(t.formatString)||(g.formatString=t.formatString),f.isFieldExist=!0,f.isEdit){for(u=0;u<s.values.length;u++)if(s.values[u].type===A0t&&null!==i.name&&s.values[u].name===i.name&&f.isEdit)for(m=0;m<s.calculatedFieldSettings.length;m++)s.calculatedFieldSettings[m].name===i.name&&(s.values.splice(u,1),s.values.splice(u,0,i),f.currentFormula=s.calculatedFieldSettings[m].formula,s.calculatedFieldSettings.splice(m,1),s.calculatedFieldSettings.splice(m,0,g),f.updateFormatSettings(s,i.name,t.formatString),f.isFieldExist=!1)}else for(var u=0;u<s.values.length;u++)if(s.values[u].type===A0t&&s.values[u].name===i.name){for(var m=0;m<s.calculatedFieldSettings.length;m++)if(s.calculatedFieldSettings[m].name===i.name)return void f.createConfirmDialog(y.parent.localeObj.getConstant("alert"),y.parent.localeObj.getConstant("confirmText"),t);f.isFieldExist=!1}f.isFieldExist&&(s.values.push(i),s.calculatedFieldSettings.push(g),f.updateFormatSettings(s,i.name,t.formatString)),f.parent.lastCalcFieldInfo=g}f.addFormula(s,i.name)}}}})},x0t.prototype.getCalculatedFieldInfo=function(){var e=ge("#"+this.parentID+"calculateddialog",document),e=e?K(e,pS):void 0,t=K(ge("#"+this.parentID+"ddlelement",document),LR),i=ge("#"+this.parentID+"droppable",document),e=(this.parent.isAdaptive?this.parent.dialogRenderer.adaptiveElement:e).element,n=K(ge("#"+this.parentID+"Custom_Format_Element",e),LR),t={name:this.isEdit?this.currentFieldName:t.value,caption:t.value,formula:i.value},i=K(ge("#"+this.parentID+"Format_Div",e),qz);return t.formatString="Custom"===i.value?n.value:"None"===i.value?null:i.value,"olap"===this.parent.dataType&&(n=K(ge("#"+this.parentID+"Member_Type_Div",e),qz),i=K(ge("#"+this.parentID+"Hierarchy_List_Div",e),qz),"Dimension"===n.value)&&(t.hierarchyUniqueName=i.value),t},x0t.prototype.updateFormatSettings=function(e,t,i){for(var n={name:t,format:i,useGrouping:!0},o=!1,r=0;r<e.formatSettings.length;r++)if(e.formatSettings[r].name===t){if("undefined"===i||void 0===i||""===i){e.formatSettings.splice(r,1),o=!0;break}var s=e.formatSettings[r].properties||e.formatSettings[r];s.format=i,e.formatSettings.splice(r,1,s),o=!0;break}o||""===i||je(i)||e.formatSettings.push(n)},x0t.prototype.addFormula=function(e,t){this.isFormula=!0,this.field=t,this.parent.setProperties({dataSourceSettings:e},!0),"pivotfieldlist"===this.parent.getModuleName()&&(this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&this.parent.pivotGridModule.pivotDeferLayoutUpdate)&&(this.parent.isRequiredUpdate=!1);try{var i={calculatedFieldInfo:this.parent.lastCalcFieldInfo},n=(this.parent.actionObj.actionInfo=i,this.parent.actionObj.actionName===aut?Kut:wut),o=(this.parent.actionObj.actionName=n,this.parent.updateDataSource(!1),"pivotfieldlist"===this.parent.getModuleName()&&this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent);o&&"Server"!==o.dataSourceSettings.mode?this.endDialog():this.isRequireUpdate=!0,"pivotfieldlist"===this.parent.getModuleName()&&"Fixed"===this.parent.renderMode&&this.parent.isDeferLayoutUpdate&&(this.parent.pivotChange=!0)}catch(e){this.showError()}},x0t.prototype.endDialog=function(){this.isEdit=!1;var e,t,i=ge("#"+this.parentID+"calculateddialog",document),i=i?K(i,pS):void 0;i?i.close():(K(ge("#"+this.parentID+"ddlelement",document),LR).value="",this.currentFieldName=this.formatText=this.fieldText=this.formatType=null,this.formulaText=this.fieldType=this.parentHierarchy=null,i=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:i.element,this.parent.dialogRenderer.parentElement.querySelector("."+ght).value="",ge("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement).value="",ge("#"+this.parentID+"Custom_Format_Element",this.parent.dialogRenderer.parentElement).value="","olap"===this.parent.dataType&&(e=K(ge("#"+this.parentID+"Member_Type_Div",i),qz),t=K(ge("#"+this.parentID+"Hierarchy_List_Div",i),qz),e.index=0,e.readonly=!1,e.dataBind(),t.index=0,t.enabled=!1,t.dataBind()),e=K(ge("#"+this.parentID+"Custom_Format_Element",i),LR),(t=K(ge("#"+this.parentID+"Format_Div",i),qz)).index="olap"===this.parent.dataType?0:4,t.dataBind(),e.enabled=!1,e.dataBind())},x0t.prototype.showError=function(){if(this.parent.engineModule.fieldList[this.field]&&delete this.parent.engineModule.fieldList[this.field],this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("invalidFormula")),this.parent.setProperties({dataSourceSettings:this.existingReport},!0),this.isEdit){for(var e=this.parent.dataSourceSettings.calculatedFieldSettings,t=0;e&&t<e.length;t++)if(e[t].name===this.field){e[t].formula=this.currentFormula;break}}else if(this.parent.engineModule.fields)for(t=0;t<this.parent.engineModule.fields.length;t++)if(this.parent.engineModule.fields[t]===this.field){this.parent.engineModule.fields.splice(t,1);break}this.parent.lastCalcFieldInfo={},this.parent.updateDataSource(!1),this.isFormula=!1},x0t.prototype.getFieldListData=function(e){var t=[];if("olap"===this.parent.dataType)for(var i=0,n=t=Hdt.getClonedData(e.olapEngineModule.fieldListData||[]);i<n.length;i++){var o=n[i];o.spriteCssClass&&(-1<o.spriteCssClass.indexOf("e-attributeCDB-icon")||-1<o.spriteCssClass.indexOf("e-level-members"))?o.hasChildren=!0:o.spriteCssClass&&-1<o.spriteCssClass.indexOf("e-namedSetCDB-icon")?o.hasChildren=!1:o.spriteCssClass&&-1<o.spriteCssClass.indexOf("e-calcMemberGroupCDB")&&(o.expanded=this.isEdit)}else for(var r=0,s=e.engineModule.fieldList?Object.keys(e.engineModule.fieldList):[];r<s.length;r++){var a=s[r],l=null,h=e.engineModule.fieldList[a],l="number"===h.type&&"include"!==e.engineModule.fieldList[a].type&&"exclude"!==e.engineModule.fieldList[a].type||"DistinctCount"===h.aggregateType?void 0!==h.aggregateType?h.aggregateType:"Sum":v0t,d=this.parent.localeObj.getConstant(l);t.push({index:h.index,name:(this.parent.enableHtmlSanitizer?go.sanitize(h.caption):h.caption)+" ("+d+")",type:l,icon:wht+" "+Tat,formula:this.parent.enableHtmlSanitizer?go.sanitize(h.formula):h.formula,field:this.parent.enableHtmlSanitizer?go.sanitize(a):a,caption:this.parent.enableHtmlSanitizer?go.sanitize(h.caption||a):h.caption||a})}return t},x0t.prototype.fieldDropped=function(e){e.cancel=!0;var t,i,n,o,r,s,a=K(ge("#"+this.parentID+"calculateddialog",document),pS),a=ge("#"+this.parentID+"droppable",a.element),l=(q([a],"e-copy-drop"),q([e.draggedNode.querySelector("."+zlt)],Flt),e.draggedNode.getAttribute("data-field"));"olap"===this.parent.dataType?(this.parent.olapEngineModule.fieldList[l]&&this.parent.olapEngineModule.fieldList[l].isCalculatedField&&(l=this.parent.olapEngineModule.fieldList[l].tag),e.target.id===this.parentID+"droppable"&&""===a.value?(a.value=l,a.focus()):e.target.id===this.parentID+"droppable"&&""!==a.value?(o=a.value,n=a.selectionStart,s=o.substring(n,o.length),i=(r=o.substring(0,n))+l,a.value=r+l+s,a.focus(),a.setSelectionRange(i.length,i.length)):e.cancel=!0):(t=e.draggedNode.getAttribute("data-type"),e.target.id===this.parentID+"droppable"&&""===a.value?(a.value=t===A0t?e.draggedNodeData.id.toString():'"'+t+"("+l+')"',a.focus()):e.target.id===this.parentID+"droppable"&&""!==a.value?(i=void 0,n=a.selectionStart,r=(o=a.value).substring(0,n),s=o.substring(n,o.length),t===A0t?(i=r+e.draggedNodeData.id.toString(),a.value=r+e.draggedNodeData.id.toString()+s):a.value=(i=r+'"'+t+"("+l+')"')+s,a.focus(),a.setSelectionRange(i.length,i.length)):e.cancel=!0)},x0t.prototype.createDialog=function(){var e=this;if(null!==ge("#"+this.parentID+"calculateddialog",document))for(ue(ge("#"+this.parentID+"calculateddialog",document));!je(document.querySelector("."+this.parentID+"calculatedmenu"));)ue(document.querySelector("."+this.parentID+"calculatedmenu"));var t,i=Q("div",{id:this.parentID+"calculateddialog",className:"e-pivot-calc-dialog-div "+("olap"===this.parent.dataType?"e-olap-calc-dialog-div":"")}),n=(this.parent.element.appendChild(i),[{click:this.applyFormula.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("ok"),isPrimary:!0,cssClass:this.parent.cssClass}},{click:this.cancelClick.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("cancel"),cssClass:this.parent.cssClass}}]),o=("olap"===this.parent.dataType&&(t={click:this.clearFormula.bind(this),isFlat:!1,buttonModel:{cssClass:"e-calc-clear-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("clear")}},n.splice(0,0,t)),new pS({allowDragging:!0,position:{X:"center",Y:"center"},buttons:n,close:this.closeDialog.bind(this),beforeOpen:this.beforeOpen.bind(this),open:function(){ge("#"+e.parentID+"ddlelement",o.element)&&ge("#"+e.parentID+"ddlelement",o.element).focus()},animationSettings:{effect:"Zoom"},width:"25%",isModal:!0,closeOnEscape:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,showCloseIcon:!0,header:this.parent.localeObj.getConstant("createCalculatedField"),target:document.body,cssClass:this.parent.cssClass}));o.isStringTemplate=!0,o.appendTo(i)},x0t.prototype.cancelClick=function(){K(ge("#"+this.parentID+"calculateddialog",document),pS).close(),this.isEdit=!1},x0t.prototype.beforeOpen=function(){K(ge("#"+this.parentID+"calculateddialog",document),pS).element.querySelector(".e-dlg-header").setAttribute("title",this.parent.localeObj.getConstant("createCalculatedField"))},x0t.prototype.closeDialog=function(){"pivotfieldlist"===this.parent.getModuleName()&&(this.parent.axisFieldModule.render(),"Fixed"!==this.parent.renderMode)&&(U([this.parent.element.querySelector("."+Rat)],Dat),this.parent.dialogRenderer.fieldListDialog.show()),this.destroy(),je(document.getElementById(this.parentID+"calculateddialog"))||ue(document.getElementById(this.parentID+"calculateddialog")),je(document.querySelector("."+this.parentID+"calculatedmenu"))||ue(document.querySelector("."+this.parentID+"calculatedmenu"));var e="pivotview"===this.parent.getModuleName()||"pivotfieldlist"===this.parent.getModuleName()&&"Fixed"===this.parent.renderMode?0:500;this.buttonCall&&(this.buttonCall=!1,setTimeout(this.setFocus.bind(this),e))},x0t.prototype.setFocus=function(){var e;if("pivotview"===this.parent.getModuleName()&&this.parent.element?e=this.parent.element:document.getElementById(this.parent.element.id+"_Container")&&(e=document.getElementById(this.parent.element.id+"_Container")),e)for(var t=0,i=[].slice.call(e.querySelectorAll(".e-pivot-button"));t<i.length;t++){var n=i[t];if(n.getAttribute("data-uid")===this.currentFieldName){n.focus();break}}},x0t.prototype.renderDialogElements=function(){var e,t,i,n,o,r,s,a=Q("div",{id:this.parentID+"outerDiv",className:("olap"===this.parent.dataType?"e-olap-calc-outer-div ":"")+"e-pivot-calc-outer-div"}),l=Q("div",{id:this.parentID+"Olap_Tree_Div",className:"e-olap-field-tree-div"}),h=Q("div",{id:this.parentID+"Pivot_Calc_Div",className:"e-pivot-calculated-div"});return"pivotfieldlist"===this.parent.getModuleName()&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+Cht)&&this.parent.isAdaptive?(n=Q("div",{id:this.parentID+"accordDiv",className:"e-pivot-accord"}),a.appendChild(n),n=Q("div",{id:this.parentID+"buttonDiv",className:Tht}),(e=Q("button",{id:this.parentID+"addBtn",className:"e-pivot-add-button",attrs:{type:"button"}})).innerText=this.parent.localeObj.getConstant("add"),(i=Q("button",{id:this.parentID+"cancelBtn",className:"e-pivot-cancel-button",attrs:{type:"button"}})).innerText=this.parent.localeObj.getConstant("cancel"),n.appendChild(i),n.appendChild(e),a.appendChild(n)):(this.parent.isAdaptive||"olap"!==this.parent.dataType||((t=Q("div",{className:"e-pivot-field-name-title",id:this.parentID+"_FieldNameTitle"})).innerText=this.parent.localeObj.getConstant("fieldTitle"),h.appendChild(t)),i=Q("div",{id:this.parentID+"innerDiv",className:"e-pivot-calc-input-div"}),e=Q("input",{id:this.parentID+"ddlelement",attrs:{type:"text"},className:ght}),i.appendChild(e),("olap"!==this.parent.dataType||this.parent.isAdaptive?a:h).appendChild(i),e=Q("div",{id:this.parentID+"control_container",className:Aht}),this.parent.isAdaptive||((i=Q("div",{className:Pht})).innerText="olap"===this.parent.dataType?this.parent.localeObj.getConstant("allFields"):this.parent.localeObj.getConstant("formulaField"),"olap"===this.parent.dataType?((r=Q("div",{className:Pht+"-container"})).appendChild(i),o=Q("span",{attrs:{tabindex:"0","aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("fieldTooltip"),role:"button"},className:Tat+" e-info"}),r.appendChild(o),new NS({content:this.parent.localeObj.getConstant("fieldTooltip"),position:this.parent.enableRtl?"RightCenter":"LeftCenter",target:".e-info",offsetY:(this.parent.enableRtl,-10),locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:220,cssClass:this.parent.cssClass}).appendTo(r),e.appendChild(r)):a.appendChild(i)),o=Q("div",{className:Sht+"-outer-div"}),e.appendChild(o),r=Q("div",{id:this.parentID+"tree",className:Sht}),o.appendChild(r),("olap"!==this.parent.dataType||this.parent.isAdaptive?a:l).appendChild(e),this.parent.isAdaptive||((t=Q("div",{className:"e-pivot-formula-title"})).innerText="olap"===this.parent.dataType?this.parent.localeObj.getConstant("expressionField"):this.parent.localeObj.getConstant("formula"),("olap"===this.parent.dataType?h:a).appendChild(t)),i=Q("textarea",{id:this.parentID+"droppable",className:Cht+" e-control e-textbox e-input",attrs:{placeholder:this.parent.isAdaptive?this.parent.localeObj.getConstant("dropTextMobile"):"olap"===this.parent.dataType?this.parent.localeObj.getConstant("olapDropText"):this.parent.localeObj.getConstant("dropText")}}),("olap"!==this.parent.dataType||this.parent.isAdaptive?a:h).appendChild(i),this.parent.isAdaptive&&(n=Q("div",{id:this.parentID+"buttonDiv",className:Tht}),(s=Q("button",{id:this.parentID+"okBtn",className:Iht,attrs:{type:"button"}})).innerText=this.parent.localeObj.getConstant("apply"),n.appendChild(s),a.appendChild(n)),"olap"===this.parent.dataType&&(this.parent.isAdaptive||((o=Q("div",{className:"e-olap-member-title"})).innerText=this.parent.localeObj.getConstant("memberType"),h.appendChild(o)),r=Q("div",{id:this.parentID+"Member_Type_Div",className:vht}),this.parent.isAdaptive?a.appendChild(r):(h.appendChild(r),(e=Q("div",{className:"e-olap-hierarchy-title"})).innerText=this.parent.localeObj.getConstant("selectedHierarchy"),h.appendChild(e)),t=Q("div",{id:this.parentID+"Hierarchy_List_Div",className:fht}),(this.parent.isAdaptive?a:h).appendChild(t)),this.parent.isAdaptive||((i=Q("div",{className:"e-pivot-format-title"})).innerText=this.parent.localeObj.getConstant("formatString"),h.appendChild(i)),n=Q("div",{id:this.parentID+"Format_Div",className:yht}),(this.parent.isAdaptive?a:h).appendChild(n),o=Q("div",{id:this.parentID+"custom_Format_Div",className:"e-pivot-calc-custom-format-div"}),r=Q("input",{id:this.parentID+"Custom_Format_Element",attrs:{type:"text"},className:mht}),o.appendChild(r),h.appendChild(o),(this.parent.isAdaptive?a:h).appendChild(o),"pivotfieldlist"===this.parent.getModuleName()&&null===this.parent.dialogRenderer.parentElement.querySelector("."+Cht)&&this.parent.isAdaptive?(s=a.querySelector("."+Iht),a.appendChild(s)):("olap"===this.parent.dataType&&a.appendChild(l),a.appendChild(h))),a},x0t.prototype.renderAdaptiveLayout=function(e){var t=this.parent.dialogRenderer.adaptiveElement;e?(ge("#"+this.parentID+"droppable",t.element)&&(e=K(ge("#"+this.parentID+"ddlelement",document),LR),this.formulaText=ge("#"+this.parentID+"droppable",document).value,this.fieldText=e.value),t.element.querySelector("."+vht)&&(e=K(ge("#"+this.parentID+"Member_Type_Div",t.element),qz),this.fieldType=e.value),t.element.querySelector("."+fht)&&(e=K(ge("#"+this.parentID+"Hierarchy_List_Div",t.element),qz),this.parentHierarchy="Dimension"===this.fieldType?e.value:null),t.element.querySelector("."+yht)&&(e=K(ge("#"+this.parentID+"Format_Div",t.element),qz),this.formatType=e.value),t.element.querySelector("."+mht)&&(e=K(ge("#"+this.parentID+"Custom_Format_Element",t.element),LR),this.formatText="Custom"===("olap"===this.parent.dataType?this.formatType:this.getFormat(this.formatType))?e.value:null)):(this.currentFieldName=this.formulaText=this.fieldText=this.formatText=null,this.fieldType=this.formatType=this.parentHierarchy=null),this.renderMobileLayout(t)},x0t.prototype.updateAdaptiveCalculatedField=function(e,t){var i=this.parent.dialogRenderer.adaptiveElement.element,n=(this.isEdit=e)?("pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule).fieldList[t]:{id:null,caption:null,formula:null,fieldType:"Measure",formatString:"pivot"===this.parent.dataType?null:"Standard",parentHierarchy:null},o=(this.currentFieldName=n.id,K(ge("#"+this.parentID+"ddlelement",document),LR));ge("#"+this.parentID+"droppable",document)&&(this.formulaText=ge("#"+this.parentID+"droppable",document).value=n.formula,this.fieldText=o.value=n.caption,o.dataBind()),i.querySelector("."+vht)&&(o=K(ge("#"+this.parentID+"Member_Type_Div",i),qz),this.fieldType=o.value=n.fieldType,o.readonly=!!e,o.dataBind()),i.querySelector("."+fht)&&(e=K(ge("#"+this.parentID+"Hierarchy_List_Div",i),qz),"Dimension"===this.fieldType?this.parentHierarchy=e.value=n.parentHierarchy:(this.parentHierarchy=null,e.index=0),e.dataBind()),i.querySelector("."+yht)&&(o=K(ge("#"+this.parentID+"Format_Div",i),qz),this.formatType=o.value=-1<this.formatTypes.indexOf(n.formatString)?n.formatString:"Custom"),i.querySelector("."+mht)&&(e=K(ge("#"+this.parentID+"Custom_Format_Element",i),LR),o=Hdt.getFieldByName(t,this.parent.dataSourceSettings.formatSettings),"pivot"===this.parent.dataType?this.formatText=e.value=o?o.format:null:this.formatText=e.value="Custom"===this.formatType?n.formatString:null,e.dataBind())},x0t.prototype.createDropElements=function(){for(var t=this,e=ge("#"+this.parentID+"calculateddialog",document)?K(ge("#"+this.parentID+"calculateddialog",document),pS):null,e=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:e.element,i=[],n=[],o=0,r=this.formatTypes;o<r.length;o++){var s=r[o];i.push({value:"pivot"===this.parent.dataType?this.getFormat(s):s,text:this.parent.localeObj.getConstant(s)})}if("olap"===this.parent.dataType){for(var a=[],l=0,h=["Measure","Dimension"];l<h.length;l++){var d=h[l];a.push({value:d,text:this.parent.localeObj.getConstant(d)})}for(var p=0,c=Hdt.getClonedData(this.parent.olapEngineModule.fieldListData);p<c.length;p++){var u=c[p];u.spriteCssClass&&(-1<u.spriteCssClass.indexOf("e-attributeCDB-icon")||-1<u.spriteCssClass.indexOf("e-hierarchyCDB-icon"))&&n.push({value:u.id,text:u.caption})}var g=new qz({dataSource:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:null!==this.fieldType?this.fieldType:a[0].value,readonly:this.isEdit,cssClass:bht+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){m.enabled="Dimension"===e.value,t.fieldType=e.value,t.formulaText=ge("#"+t.parentID+"droppable",document).value,m.dataBind()}}),m=(g.isStringTemplate=!0,g.appendTo(ge("#"+this.parentID+"Member_Type_Div",e)),new qz({dataSource:n,enableRtl:this.parent.enableRtl,locale:this.parent.locale,allowFiltering:!0,enabled:"Dimension"===g.value,filterBarPlaceholder:this.parent.localeObj.getConstant("example")+" "+n[0].text.toString(),fields:{value:"value",text:"text"},value:null!==this.parentHierarchy&&"Dimension"===g.value?this.parentHierarchy:n[0].value,cssClass:bht+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){t.parentHierarchy=e.value,t.formulaText=ge("#"+t.parentID+"droppable",document).value}}));m.isStringTemplate=!0,m.appendTo(ge("#"+this.parentID+"Hierarchy_List_Div",e))}var g=new qz({dataSource:i,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:this.parent.isAdaptive&&null!==this.formatType?this.formatType:("olap"===this.parent.dataType?i[0]:i[4]).value,cssClass:bht+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){f.enabled="Custom"===e.value,t.formatType=e.value,t.formulaText=ge("#"+t.parentID+"droppable",document).value,f.dataBind()}}),f=(g.isStringTemplate=!0,g.appendTo(ge("#"+this.parentID+"Format_Div",e)),new LR({placeholder:this.parent.localeObj.getConstant("customFormat"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,value:null!==this.formatText&&"Custom"===g.value?this.formatText:null,enabled:"Custom"===g.value,change:function(e){t.formatText=e.value,t.formulaText=ge("#"+t.parentID+"droppable",document).value},cssClass:this.parent.cssClass}));f.isStringTemplate=!0,f.appendTo(ge("#"+this.parentID+"Custom_Format_Element",e))},x0t.prototype.getFormat=function(e){var t=e;if("olap"!==this.parent.dataType)switch(t){case"Standard":t="N";break;case"Currency":t="C";break;case"Percent":t="P";break;case"N":t="Standard";break;case"C":t="Currency";break;case"P":t="Percent"}else switch(t){case"Standard":t="N";break;case"Currency":t="C";break;case"Percent":t="P"}return t},x0t.prototype.createTreeView=function(){var t=this,e=ge("#"+this.parentID+"calculateddialog",document)?K(ge("#"+this.parentID+"calculateddialog",document),pS):null,e=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:e.element;"olap"===this.parent.dataType?this.treeObj=new PW({fields:{dataSource:this.getFieldListData(this.parent),id:"id",text:"caption",parentID:"pid",iconCss:"spriteCssClass"},allowDragAndDrop:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,nodeDragStart:this.dragStart.bind(this),nodeDragging:function(e){e.event.target&&e.event.target.classList.contains(Cht)?(q([e.clonedNode],Blt),U([e.event.target],"e-copy-drop")):(U([e.clonedNode],Blt),q([e.event.target],"e-copy-drop"),e.dropIndicator="e-no-drop",U([e.clonedNode.querySelector("."+Tat)],"e-icon-expandable"),q([e.clonedNode.querySelector("."+Tat)],"e-list-icon"))},nodeClicked:this.fieldClickHandler.bind(this),nodeSelected:function(e){e.node.getAttribute("data-type")===A0t?t.displayMenu(e.node):(q([e.node],"e-active"),e.cancel=!0)},nodeDragStop:this.fieldDropped.bind(this),drawNode:this.drawTreeNode.bind(this),nodeExpanding:this.updateNodeIcon.bind(this),nodeCollapsed:this.updateNodeIcon.bind(this),sortOrder:"None",cssClass:this.parent.cssClass}):this.treeObj=new PW({fields:{dataSource:this.getFieldListData(this.parent),id:"formula",text:"name",iconCss:"icon"},allowDragAndDrop:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,cssClass:this.parent.cssClass,nodeCollapsing:this.nodeCollapsing.bind(this),nodeDragStart:this.dragStart.bind(this),nodeClicked:this.fieldClickHandler.bind(this),nodeDragStop:this.fieldDropped.bind(this),drawNode:this.drawTreeNode.bind(this),keyPress:function(e){39===e.event.keyCode&&(e.cancel=!0)},sortOrder:"Ascending"}),this.treeObj.isStringTemplate=!0,this.treeObj.appendTo(ge("#"+this.parentID+"tree",e))},x0t.prototype.updateNodeIcon=function(e){if(e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-icon-expandable.e-process")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-icon"))q([s=e.node.querySelector(".e-list-icon")],"e-folderCDB-icon"),U([s],"e-folderCDB-open-icon");else if(e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-icon-expandable")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-open-icon"))q([s=e.node.querySelector(".e-list-icon")],"e-folderCDB-open-icon"),U([s],"e-folderCDB-icon");else{for(var t=this.treeObj.fields.dataSource,i=[],n=0,o=t;n<o.length;n++){var r=o[n];r.pid===e.nodeData.id.toString()&&i.push(r)}if(0===i.length){this.parent.olapEngineModule.calcChildMembers=[],this.parent.olapEngineModule.getCalcChildMembers(this.parent.dataSourceSettings,e.nodeData.id.toString()),i=this.parent.olapEngineModule.calcChildMembers,this.parent.olapEngineModule.calcChildMembers=[];for(var s,a=0,l=i;a<l.length;a++)(s=l[a]).pid=e.nodeData.id.toString(),s.hasChildren=!1,s.spriteCssClass="e-level-members",s.caption=""===s.caption?this.parent.localeObj.getConstant("blank"):s.caption,t.push(s);this.treeObj.addNodes(i,e.node)}}},x0t.prototype.nodeCollapsing=function(e){e.cancel=!0},x0t.prototype.dragStart=function(e){var t=!1,i=e.clonedNode;(t=i&&("olap"===this.parent.dataType&&(i.querySelector(".e-calc-dimension-icon,.e-calc-measure-icon,.e-measure-icon")||i.querySelector(".e-attributeCDB-icon,.e-hierarchyCDB-icon")||i.querySelector(".e-level-members,.e-namedSetCDB-icon"))||"pivot"===this.parent.dataType&&e.event.target.classList.contains(alt))?!0:t)?(U([e.draggedNode.querySelector("."+zlt)],Flt),U([i],"e-pivot-calc"),t=K(ge("#"+this.parentID+"calculateddialog",document),pS),i.style.zIndex=(t.zIndex+1).toString(),i.style.display="inline"):e.cancel=!0},x0t.prototype.drawTreeNode=function(e){var t,i,n,o,r,s;"olap"===this.parent.dataType?(e.node.querySelector(".e-measure-icon")&&(e.node.querySelector(".e-list-icon").style.display="none"),t=e.nodeData,e.node.setAttribute("data-field",t.id),e.node.setAttribute("data-caption",t.caption),i=e.node.querySelector("."+Rlt),e.nodeData&&e.nodeData.type===A0t&&i&&e.node.querySelector(".e-list-icon.e-calc-member")&&(e.node.setAttribute("data-type",t.type),e.node.setAttribute("data-membertype",t.fieldType),e.node.setAttribute("data-hierarchy",t.parentHierarchy||""),e.node.setAttribute("data-formula",t.formula),o=t.formatString?-1<this.formatTypes.indexOf(t.formatString)?t.formatString:"Custom":"None",e.node.setAttribute("data-formatString",o),e.node.setAttribute("data-customformatstring","Custom"===o?t.formatString:""),n=Q("span",{className:hdt+" e-icons e-list-icon"}),i.classList.add("e-calcfieldmember"),this.parent.isAdaptive?(r=Q("span",{className:"e-list-edit-icon"+(this.isEdit&&this.currentFieldName===t.id?" e-edited ":" e-edit ")+Tat}),(s=Q("div",{className:"e-list-header-icon"})).appendChild(r),s.appendChild(n),i.appendChild(s)):i.appendChild(n)),this.parent.isAdaptive&&(r=e.node.querySelector("."+Rlt),e.node&&e.node.querySelector(".e-list-icon")&&r&&(s=e.node.querySelector(".e-list-icon"),r.insertBefore(s,e.node.querySelector(".e-list-text"))),e.node&&e.node.querySelector(".e-calcMemberGroupCDB,.e-measureGroupCDB-icon,.e-folderCDB-icon")&&(e.node.querySelector("."+Jht).style.display="none"),e.node)&&e.node.querySelector(".e-level-members")&&(e.node.querySelector(".e-list-icon").style.display="none"),(e.node.querySelector(".e-calc-dimension-icon,.e-calc-measure-icon,.e-measure-icon")||e.node.querySelector(".e-attributeCDB-icon,.e-hierarchyCDB-icon")||e.node.querySelector(".e-level-members,.e-namedSetCDB-icon"))&&U([e.node],Nat)):(t=e.nodeData.field,e.node.setAttribute("data-field",t),e.node.setAttribute("data-caption",e.nodeData.caption),e.node.setAttribute("data-type",e.nodeData.type),i=Hdt.getFieldByName(t,this.parent.dataSourceSettings.formatSettings),e.node.setAttribute("data-formatString",i?i.format:""),i&&(o=(n=this.getFormat(i.format))?-1<this.formatTypes.indexOf(n)?i.format:"Custom":"None",e.node.setAttribute("data-customformatstring","Custom"===o?n:""),e.node.setAttribute("data-formatString",i?o:"")),r=Q("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("dragField")},className:Tat+" e-drag"}),s=Q("div",{className:" e-iconspace"}),lt([r],e.node.querySelector("."+Rlt)),ht([s,e.node.querySelector("."+wht)],e.node.querySelector("."+Rlt)),this.getMenuItems(this.parent.engineModule.fieldList[t].type).length<=0?q([e.node.querySelector("."+wht)],Tat):e.node.querySelector("."+wht).setAttribute("title",this.parent.localeObj.getConstant("format")),this.parent.engineModule.fieldList[t].aggregateType===A0t&&(e.node.querySelector("."+wht).setAttribute("title",this.parent.localeObj.getConstant("remove")),U([e.node.querySelector("."+wht)],hdt),U([e.node.querySelector(".e-iconspace")],[Rht,Tat,"e-list-icon"]),e.node.querySelector("."+Rht).setAttribute("title",this.parent.localeObj.getConstant("edit")),e.node.querySelector("."+Rht).setAttribute("aria-disabled","false"),e.node.querySelector("."+Rht).setAttribute("tabindex","-1"),q([e.node.querySelector("."+wht)],wht),q([e.node.querySelector(".e-iconspace")],"e-iconspace")))},x0t.prototype.createTypeContainer=function(e){for(var t=Q("div",{id:this.parentID+"control_container",className:Aht}),i=this.getMenuItems(this.parent.engineModule.fieldList[e].type),n=0;n<i.length;n++){var o=Q("input",{id:this.parentID+"radio"+e+i[n],attrs:{type:"radio","data-ftxt":e,"data-value":i[n]},className:"e-pivot-calc-radio"});t.appendChild(o)}return t},x0t.prototype.getMenuItems=function(e,t){for(var i=je(t)?this.parent.aggregateTypes:t,n=[],o=this.getValidSummaryType(),r=0;r<i.length;r++)-1<o.indexOf(i[r])&&n.indexOf(i[r])<0&&((i[r]!==v0t&&i[r]!==b0t||"number"===e)&&"number"!==e||n.push(i[r]));return n},x0t.prototype.getValidSummaryType=function(){return[v0t,b0t,"Sum","Avg","Median","Min","Max","Product",w0t,C0t,"SampleVar",S0t]},x0t.prototype.getAccordionData=function(e){for(var t=[],i=Object.keys(e.engineModule.fieldList),n=0,o=i.length;n<o;n++){var r=i[n];t.push({header:"<input id="+this.parentID+"_"+n+" class="+uht+' type="checkbox" data-field='+r+' data-caption="'+this.parent.engineModule.fieldList[r].caption+'" data-type='+this.parent.engineModule.fieldList[r].type+"/>",content:this.parent.engineModule.fieldList[r].aggregateType===A0t||this.getMenuItems(this.parent.engineModule.fieldList[r].type).length<1?"":this.createTypeContainer(r).outerHTML,iconCss:this.parent.engineModule.fieldList[r].aggregateType===A0t?"e-list-icon "+(this.isEdit&&this.currentFieldName===r?"e-edited":"e-edit"):""})}return t},x0t.prototype.renderMobileLayout=function(e){var t,i=this,e=(e.items[4].content=this.renderDialogElements().outerHTML,e.dataBind(),ge("#"+this.parentID+"calculateddialog",document)?K(ge("#"+this.parentID+"calculateddialog",document),pS):null),e=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:e.element,n=(this.parent.isAdaptive&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+Cht)&&this.createDropElements(),new zv({cssClass:this.parent.cssClass,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}));n.isStringTemplate=!0,n.appendTo(ge("#"+this.parentID+"cancelBtn",e)),n.element&&(n.element.onclick=this.cancelBtnClick.bind(this)),null!==this.parent.dialogRenderer.parentElement.querySelector("."+Cht)&&this.parent.isAdaptive?((n=new zv({cssClass:this.parent.cssClass,isPrimary:!0,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer})).isStringTemplate=!0,n.appendTo(ge("#"+this.parentID+"okBtn",e)),(t=new LR({placeholder:this.parent.localeObj.getConstant("fieldName"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:function(e){i.fieldText=e.value,i.formulaText=ge("#"+i.parentID+"droppable",document).value},cssClass:this.parent.cssClass})).isStringTemplate=!0,t.appendTo(ge("#"+this.parentID+"ddlelement",e)),null!==this.formulaText&&null!==ge("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement)&&(ge("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement).value=this.formulaText),null!==this.fieldText&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+ght)&&(this.parent.dialogRenderer.parentElement.querySelector("."+ght).value=this.fieldText,t.value=this.fieldText),n.element&&(n.element.onclick=this.applyFormula.bind(this))):this.parent.isAdaptive&&((t=new zv({cssClass:this.parent.cssClass,isPrimary:!0,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer})).isStringTemplate=!0,t.appendTo(ge("#"+this.parentID+"addBtn",e)),"olap"===this.parent.dataType?(this.treeObj=new PW({fields:{dataSource:this.getFieldListData(this.parent),id:"id",text:"caption",parentID:"pid",iconCss:"spriteCssClass"},showCheckBox:!0,autoCheck:!1,sortOrder:"None",enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,nodeClicked:this.fieldClickHandler.bind(this),drawNode:this.drawTreeNode.bind(this),nodeExpanding:this.updateNodeIcon.bind(this),nodeCollapsed:this.updateNodeIcon.bind(this),nodeSelected:function(e){q([e.node],"e-active"),e.cancel=!0},cssClass:this.parent.cssClass}),this.treeObj.isStringTemplate=!0,this.treeObj.appendTo(ge("#"+this.parentID+"accordDiv",e))):((n=new x4({items:this.getAccordionData(this.parent),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,expanding:this.accordionExpand.bind(this),clicked:this.accordionClickHandler.bind(this),created:this.accordionCreated.bind(this)})).isStringTemplate=!0,n.appendTo(ge("#"+this.parentID+"accordDiv",e)),this.updateType()),t.element)&&(t.element.onclick=this.addBtnClick.bind(this))},x0t.prototype.accordionExpand=function(e){if(0===e.element.querySelectorAll(".e-radio-wrapper").length)for(var t=Object.keys(this.parent.engineModule.fieldList),i=0,n=t.length;i<n;i++){var o=t[i],r="number"!==this.parent.engineModule.fieldList[o].type?[v0t,b0t]:["Sum",v0t,"Avg","Median","Min","Max",b0t,"Product",w0t,C0t,"SampleVar",S0t],s=void 0;if(o===e.element.querySelector("[data-field").getAttribute("data-field"))for(var a=0;a<r.length;a++)(s=new cb({label:this.parent.localeObj.getConstant(r[a]),name:"AggregateType"+o,checked:e.element.querySelector("[data-type").getAttribute("data-type")===r[a],change:this.onChange.bind(this),locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass})).isStringTemplate=!0,s.appendTo(ge("#"+this.parentID+"radio"+o+r[a],e.element))}},x0t.prototype.onChange=function(e){var t=e.event.target.parentElement.querySelector(".e-label").innerText,i=e.event.target.closest(".e-acrdn-item").querySelector("[data-field").getAttribute("data-caption");e.event.target.closest(".e-acrdn-item").querySelector(".e-label").innerText=i+" ("+t+")",e.event.target.closest(".e-acrdn-item").querySelector("[data-type").setAttribute("data-type",e.event.target.getAttribute("data-value"))},x0t.prototype.updateType=function(){for(var e=Object.keys(this.parent.engineModule.fieldList),t=ge("#"+this.parentID+"calculateddialog",document)?K(ge("#"+this.parentID+"calculateddialog",document),pS):null,i=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:t.element,n=0,o=e.length;n<o;n++){var r=e[n],s=null,s="number"===this.parent.engineModule.fieldList[r].type&&"include"!==this.parent.engineModule.fieldList[r].type&&"exclude"!==this.parent.engineModule.fieldList[r].type||"DistinctCount"===this.parent.engineModule.fieldList[r].aggregateType?void 0!==this.parent.engineModule.fieldList[r].aggregateType?this.parent.engineModule.fieldList[r].aggregateType:"Sum":v0t,a=new ib({label:this.parent.engineModule.fieldList[r].caption+" ("+this.parent.localeObj.getConstant(s)+")",locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass});a.isStringTemplate=!0,a.appendTo(ge("#"+this.parentID+"_"+n,i)),ge("#"+this.parentID+"_"+n,i).setAttribute("data-field",r),ge("#"+this.parentID+"_"+n,i).setAttribute("data-type",s)}},x0t.prototype.cancelBtnClick=function(){this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)},x0t.prototype.addBtnClick=function(){var e,t="",i=null;if("pivot"===this.parent.dataType){for(var n=document.querySelectorAll(".e-accordion .e-check"),o=0;o<n.length;o++)if(e=n[o].parentElement.querySelector("[data-field]").getAttribute("data-field"),-1===(i=n[o].parentElement.querySelector("[data-field]").getAttribute("data-type")).indexOf(A0t))t=t+'"'+i+"("+e+')"';else for(var r=0;r<this.parent.dataSourceSettings.calculatedFieldSettings.length;r++)if(this.parent.dataSourceSettings.calculatedFieldSettings[r].name===e){t+=this.parent.dataSourceSettings.calculatedFieldSettings[r].formula;break}}else for(var s=this.treeObj.getAllCheckedNodes(),a=this.parent.olapEngineModule,l=0,h=s;l<h.length;l++){var d=h[l];t+=a.fieldList[d]&&a.fieldList[d].type===A0t?a.fieldList[d].tag:d}this.formulaText=null!==this.formulaText?this.formulaText+t:t,this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)},x0t.prototype.createCalculatedFieldDialog=function(e){var t;this.parent.isAdaptive&&"pivotfieldlist"===this.parent.getModuleName()?(this.renderAdaptiveLayout(!e||void 0===e.edit||e.edit),this.isEdit=e&&void 0!==e.edit?e.edit:this.isEdit):this.parent.isAdaptive||(this.isEdit=!(!e||void 0===e.edit)&&e.edit,this.renderDialogLayout(),e&&e.edit&&(e=this.treeObj.element.querySelector('li[data-field="'+e.fieldName+'"]'))&&(U([e],["e-active","e-node-focus"]),e.setAttribute("aria-selected","true"),e.id=this.treeObj.element.id+"_active","pivot"===this.parent.dataType?(t={event:{target:e.querySelector(".e-list-icon.e-edit.e-icons")}},this.fieldClickHandler(t)):this.displayMenu(e)),(t=K(ge("#"+this.parentID+"calculateddialog",document),pS)).element.style.top=parseInt(t.element.style.top,10)<0?"0px":t.element.style.top)},x0t.prototype.renderDialogLayout=function(){this.newFields=Pe([],this.parent.dataSourceSettings.calculatedFieldSettings,null,!0),this.createDialog();var e=K(ge("#"+this.parentID+"calculateddialog",document),pS),t=(e.content=this.renderDialogElements(),e.refresh(),new LR({placeholder:this.parent.localeObj.getConstant("fieldName"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass}));t.isStringTemplate=!0,t.appendTo(ge("#"+this.parentID+"ddlelement",e.element)),this.createDropElements(),this.createTreeView(),this.droppable=new un(ge("#"+this.parentID+"droppable",e.element)),this.keyboardEvents=new bn(e.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:{moveRight:"rightarrow",enter:"enter",shiftE:"shift+E",delete:"delete"},eventName:"keydown"})},x0t.prototype.createConfirmDialog=function(e,t,i,n,o){var r=Q("div",{id:this.parentID+"_CalculatedFieldErrorDialog",className:wlt}),o=(this.parent.element.appendChild(r),new pS({animationSettings:{effect:"Fade"},allowDragging:!1,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:n?this.removeCalcField.bind(this,o):this.replaceFormula.bind(this,i),isFlat:!1,buttonModel:{cssClass:vlt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:n?this.parent.localeObj.getConstant("yes"):this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:this.closeErrorDialog.bind(this),isFlat:!1,buttonModel:{cssClass:blt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:n?this.parent.localeObj.getConstant("no"):this.parent.localeObj.getConstant("cancel")}}],header:e,content:t,isModal:!0,visible:!0,closeOnEscape:!0,target:document.body,cssClass:this.parent.cssClass,close:this.removeErrorDialog.bind(this)}));o.isStringTemplate=!0,o.appendTo(r)},x0t.prototype.replaceFormula=function(e){var t=this.parent.dataSourceSettings;if("olap"===this.parent.dataType){for(var i=0;i<t.calculatedFieldSettings.length;i++)if(t.calculatedFieldSettings[i].name===e.name){je(e.hierarchyUniqueName)||(t.calculatedFieldSettings[i].hierarchyUniqueName=e.hierarchyUniqueName),t.calculatedFieldSettings[i].formatString=e.formatString,t.calculatedFieldSettings[i].formula=e.formula,this.parent.lastCalcFieldInfo=t.calculatedFieldSettings[i];break}}else for(var n=0;n<t.values.length;n++)if(t.values[n].type===A0t&&t.values[n].name===e.name)for(i=0;i<t.calculatedFieldSettings.length;i++)t.calculatedFieldSettings[i].name===e.name&&(t.calculatedFieldSettings[i].formula=e.formula,this.parent.lastCalcFieldInfo=t.calculatedFieldSettings[i].properties||t.calculatedFieldSettings[i],this.updateFormatSettings(t,e.name,e.formatString));this.addFormula(t,e.name),this.removeErrorDialog()},x0t.prototype.removeErrorDialog=function(){var e=ge("#"+this.parentID+"_CalculatedFieldErrorDialog",document),e=e?K(e,pS):null;e&&!e.isDestroyed&&e.destroy(),null!==ge("#"+this.parentID+"_CalculatedFieldErrorDialog",document)&&ue(ge("#"+this.parentID+"_CalculatedFieldErrorDialog",document))},x0t.prototype.closeErrorDialog=function(){K(ge("#"+this.parentID+"_CalculatedFieldErrorDialog",document),pS).close()},x0t.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Act,this.createCalculatedFieldDialog,this)},x0t.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Act,this.createCalculatedFieldDialog)},x0t.prototype.destroy=function(){this.treeObj&&!this.treeObj.isDestroyed&&this.treeObj.destroy(),this.treeObj&&(this.treeObj=null),this.newFields&&(this.newFields=null),this.curMenu&&(this.curMenu=null),this.droppable&&(this.droppable=null),this.keyboardEvents&&(this.keyboardEvents=null);var e=ge("#"+this.parentID+"ddlelement",document);e&&K(e,LR).destroy(),(e=ge("#"+this.parentID+"calculateddialog",document))&&K(e,pS).destroy(),(e=ge("#"+this.parentID+"CalcContextmenu",document))&&K(e,D4).destroy(),(e=ge("#"+this.parentID+"accordDiv",document))&&K(e,x4).destroy(),(e=ge("#"+this.parentID+"_CalculatedFieldErrorDialog",document))&&K(e,pS).destroy()},x0t);function x0t(e){this.isFormula=!1,this.isRequireUpdate=!1,this.formatTypes=["Standard","Currency","Percent","Custom","None"],this.parent=e,this.existingReport=null,(this.parent.calculatedFieldModule=this).removeEventListener(),this.addEventListener(),this.parentID=this.parent.element.id,this.treeObj=null,this.droppable=null,this.newFields=null,this.isFieldExist=!0,this.formulaText=null,this.fieldText=null,this.formatText=null,this.formatType=null,this.fieldType=null,this.parentHierarchy=null,this.isEdit=!1,this.currentFieldName=null}f0t.Inject(i0);I0t.prototype.getModuleName=function(){return"fieldList"},I0t.prototype.initiateModule=function(){var e;ge("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)||(this.element=Q("div",{id:this.parent.element.id+"_PivotFieldList",styles:"position:"+(this.parent.enableRtl?"static":"absolute")+";height:0;width:"+this.parent.element.style.width+";display:none"}),null===ge("#"+this.parent.element.id+"containerwrapper",document)?(e=Q("div",{id:this.parent.element.id+"containerwrapper",styles:"height:"+(isNaN(this.parent.height)?this.parent.height:this.parent.height+"px")}),this.parent.element.parentElement.appendChild(e),e.appendChild(this.element),e.appendChild(this.parent.element)):ge("#"+this.parent.element.id+"containerwrapper",document).appendChild(this.element),this.parent.pivotFieldListModule=new f0t({dataSourceSettings:{providerType:this.parent.dataSourceSettings.providerType,rows:[],columns:[],values:[],filters:[]},spinnerTemplate:this.parent.spinnerTemplate,allowDeferLayoutUpdate:this.parent.allowDeferLayoutUpdate,renderMode:"Popup",allowCalculatedField:this.parent.allowCalculatedField,showValuesButton:this.parent.showValuesButton,enableRtl:this.parent.enableRtl,locale:this.parent.locale,target:this.parent.element.parentElement,aggregateTypes:this.parent.aggregateTypes,maxNodeLimitInMemberEditor:this.parent.maxNodeLimitInMemberEditor,aggregateCellInfo:this.parent.bindTriggerEvents.bind(this.parent),onHeadersSort:this.parent.bindTriggerEvents.bind(this.parent),cssClass:this.parent.cssClass,enableFieldSearching:this.parent.enableFieldSearching,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),this.parent.pivotFieldListModule.isPopupView=!0,this.parent.pivotFieldListModule.pivotGridModule=this.parent,this.parent.pivotFieldListModule.appendTo(this.element))},I0t.prototype.updateControl=function(){if(this.parent.allowDeferLayoutUpdate&&(this.parent.actionObj.actionName="Field list refreshed"),this.element){for(var e=void 0,t=0;t<this.parent.toolbar.length;t++)"FieldList"===this.parent.toolbar[t]&&(e=!0);e&&this.parent.showToolbar&&"Server"===this.parent.dataSourceSettings.mode?this.element.style.display="none":this.element.style.display="block",lt([this.element],this.parent.element),this.parent.showGroupingBar&&this.parent.groupingBarModule?(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.update.bind(this))):je(this.element.querySelector("."+Rat))||(gt(this.element.querySelector("."+Rat),{left:"auto"}),(this.parent.enableRtl?q:U)([this.element.querySelector("."+Rat)],"e-fieldlist-left")),gt(this.element,{width:T(this.parent.element.offsetWidth)})}this.parent.pivotFieldListModule.update(this.parent)},I0t.prototype.update=function(){var e="Table"!==this.parent.currentView?this.parent.chart?this.parent.pivotChartModule.getCalulatedWidth():e:this.parent.grid?this.parent.grid.element.offsetWidth:e;e&&!je(this.element.querySelector("."+Rat))&&(e=e<400?this.parent.minWidth||400:e,gt(this.element.querySelector("."+Rat),{left:T(this.parent.enableRtl?-Math.abs(e-this.element.querySelector("."+Rat).offsetWidth):e-this.element.querySelector("."+Rat).offsetWidth)}),(this.parent.enableRtl?U:q)([this.element.querySelector("."+Rat)],"e-fieldlist-left"))},I0t.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(wct,this.initiateModule,this),this.parent.on(mct,this.updateControl,this))},I0t.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(wct,this.initiateModule),this.parent.off(mct,this.updateControl))},I0t.prototype.destroy=function(){this.removeEventListener(),this.parent.pivotFieldListModule&&!this.parent.pivotFieldListModule.isDestroyed&&(this.parent.pivotFieldListModule.destroy(),this.parent.pivotFieldListModule=null,je(ge("#"+this.parent.element.id+"_PivotFieldList",document))||ue(ge("#"+this.parent.element.id+"_PivotFieldList",document)))};Gmt=I0t;function I0t(e){this.parent=e,this.addEventListener()}E0t.prototype.render=function(){(!this.parent.pivotButtonModule||this.parent.pivotButtonModule&&this.parent.pivotButtonModule.isDestroyed)&&new l0t(this.parent),this.createPivotButtons();for(var e=[],t=(e=e.concat([].slice.call(this.parent.groupingBarModule.rowPanel.querySelectorAll("."+Kat)))).length,i=0;i<t;i++)this.parent.isTabular||lt([Q("span",{className:"e-indent-div",styles:this.parent.isTabular?"auto":"width:"+24*i+"px"})],e[i])},E0t.prototype.createPivotButtons=function(){var e=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],t=Array.prototype.slice.call(this.parent.element.querySelectorAll("."+Elt+",."+Dlt+",."+Mlt+",."+klt+",."+Plt));je(this.parent.element.querySelector("."+Tdt))&&t.push(this.parent.groupingBarModule.rowPanel);for(var i=0;i<t.length;i++){var n=t[i];0<this.parent.dataSourceSettings.values.length&&n.classList.contains(ydt)&&0<this.parent.dataSourceSettings.columns.length&&n.classList.contains(fdt)||(n.innerHTML="")}if("pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&(!(this.parent.dataSourceSettings.dataSource instanceof me)&&0<this.parent.dataSourceSettings.dataSource.length||this.parent.dataSourceSettings.dataSource instanceof me&&this.parent.engineModule.data&&0<this.parent.engineModule.data.length)||"olap"===this.parent.dataType&&this.parent.dataSourceSettings.url&&""!==this.parent.dataSourceSettings.url||"Server"===this.parent.dataSourceSettings.mode&&this.parent.dataSourceSettings.url&&""!==this.parent.dataSourceSettings.url){var o=["rows","columns","values","filters"];if("pivot"===this.parent.dataType&&this.parent.groupingBarSettings.showFieldsPanel){o.push("all-fields"),e.push([]);for(var r=0,s=this.parent.engineModule&&this.parent.engineModule.fieldList?Object.keys(this.parent.engineModule.fieldList):[];r<s.length;r++){var a=s[r];this.parent.engineModule.fieldList[a]&&!this.parent.engineModule.fieldList[a].isSelected&&e[e.length-1].push(Hdt.getFieldInfo(a,this.parent,!0).fieldItem)}}for(var l,i=0,h=e.length;i<h;i++)e[i]&&(l={field:e[i],axis:o[i].toString()},this.parent.notify(Sct,l))}};var T0t=E0t;function E0t(e){this.parent=e}D0t.prototype.getModuleName=function(){return"groupingBar"},D0t.prototype.renderLayout=function(){this.groupingTable=Q("div",{className:Tlt});var e=Q("div",{className:Uat}),t=(this.rightAxisPanel=Q("div",{className:qat}),Q("div",{className:"e-axis-row e-axiscontainer"})),i=Q("div",{className:"e-axis-column e-axiscontainer"}),n=Q("div",{className:"e-axis-value e-axiscontainer"}),o=Q("div",{className:Dht+" "+Eht+"container"}),r=(this.rowPanel=Q("div",{className:Dlt+" "+Slt+(this.parent.isTabular?" e-tabular-group-rows":"")}),Q("div",{className:Mlt+" "+Alt})),s=Q("div",{className:klt+" "+xlt}),a=Q("div",{className:Plt+" "+Ilt});t.appendChild(this.rowPanel),i.appendChild(r),n.appendChild(s),o.appendChild(a),this.rowAxisPanel=t,e.appendChild(n),e.appendChild(t),this.rightAxisPanel.appendChild(o),this.rightAxisPanel.appendChild(i),this.groupingTable.appendChild(Q("div",{styles:"display:flex;"})),this.groupingTable.firstElementChild.appendChild(e),this.groupingTable.firstElementChild.appendChild(this.rightAxisPanel),"pivot"===this.parent.dataType&&null!=this.parent.groupingBarSettings&&this.parent.groupingBarSettings.showFieldsPanel&&(this.gridPanel=this.createToolbarUI(this.groupingTable)),this.groupingTable.classList.add(Adt),this.groupingTable.querySelector("."+Dlt).classList.add(Tdt);for(var l=0,h=[this.rowPanel,r,s,a];l<h.length;l++){var d=h[l];this.parent.groupingBarSettings.allowDragAndDrop&&new un(d,{}),this.unWireEvent(d),this.wireEvent(d)}"Table"!==this.parent.displayOption.view&&"Table"!==this.parent.groupingBarSettings.displayMode?(this.groupingChartTable=this.groupingTable.cloneNode(!0),ge("#"+this.parent.element.id+"_AllFields",this.groupingChartTable)&&(ge("#"+this.parent.element.id+"_AllFields",this.groupingChartTable).remove(),this.chartPanel=this.createToolbarUI(this.groupingChartTable)),this.groupingChartTable.classList.add(wdt),this.groupingChartTable.classList.remove(Adt),this.groupingChartTable.querySelector("."+Dlt).classList.add(mdt),this.groupingChartTable.querySelector("."+Dlt).classList.remove(Tdt),this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.chartSeries&&["Pie","Pyramid","Doughnut","Funnel"].indexOf(this.parent.chartSettings.chartSeries.type)<0?this.groupingChartTable.querySelector("."+klt).classList.add("e-group-chart-multi-values"):this.groupingChartTable.querySelector("."+klt).classList.add(ydt),this.parent.chartSettings.chartSeries&&-1<["Pie","Pyramid","Doughnut","Funnel"].indexOf(this.parent.chartSettings.chartSeries.type)?this.groupingChartTable.querySelector("."+Mlt).classList.add(fdt):this.groupingChartTable.querySelector("."+Mlt).classList.add("e-group-chart-accumulation-column"),this.groupingChartTable.querySelector("."+Plt).classList.add("e-group-chart-filters")):this.groupingChartTable=void 0,"Chart"!==this.parent.displayOption.view&&"Chart"!==this.parent.groupingBarSettings.displayMode||(this.groupingTable=void 0)},D0t.prototype.appendToElement=function(){var e=this.groupingTable||this.groupingChartTable;if(!je(e)){var t=e.getElementsByClassName(Uat)[0],i=e.getElementsByClassName(Plt+" "+Ilt)[0],n=e.getElementsByClassName(Mlt+" "+Alt)[0],e=e.getElementsByClassName(klt+" "+xlt)[0];if((this.parent.element.querySelector("."+Mht)||this.parent.element.querySelector("."+gdt))&&this.parent.showGroupingBar){if(this.parent.element.querySelector("."+Tlt))for(var o=this.parent.element.querySelectorAll("."+Tlt),r=0;r<o.length;r++)ue(o[r]);if(this.groupingChartTable&&(ge("#"+this.parent.element.id+"_chart",this.parent.element)?(gt(this.groupingChartTable,{width:T(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),a=this.groupingChartTable.getElementsByClassName(Uat)[0],s=this.groupingChartTable.getElementsByClassName(klt+" "+xlt)[0],this.parent.isAdaptive&&(this.parent.isTabular?(a.style.minWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth+"px",s.style.minWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth+"px"):(a.style.minWidth="180px",s.style.minWidth="180px")),this.parent.element.insertBefore(this.groupingChartTable,ge("#"+this.parent.element.id+"_chart",this.parent.element)),this.groupingChartTable.querySelector("."+Gat)&&null!=this.chartPanel&&!this.chartPanel.isDestroyed&&(a=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2,this.chartPanel.width=!this.parent.isAdaptive&&a<400?this.parent.minWidth||"398px":a,this.chartPanel.refreshOverflow(),this.parent.showFieldList)&&this.parent.pivotFieldListModule&&this.parent.pivotFieldListModule.element&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.alignIcon.bind(this)))):this.groupingChartTable=void 0),"Chart"!==this.parent.displayOption.view&&this.groupingTable){this.parent.isAdaptive&&(this.parent.isTabular?(t.style.minWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth+"px",e.style.minWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth+"px"):(t.style.minWidth="180px",e.style.minWidth="180px")),this.parent.firstColWidth&&(t.style.minWidth="auto",e.style.minWidth="auto"),i.removeAttribute("style"),n.removeAttribute("style"),this.rowPanel.removeAttribute("style");je("olap"===this.parent.dataType?this.parent.olapEngineModule.headerContent?Object.keys(this.parent.olapEngineModule.headerContent).length:0:this.parent.engineModule.headerContent?Object.keys(this.parent.engineModule.headerContent).length:0)||((s=this.parent.element.querySelector("."+Zht).querySelector(".e-columnheader")).removeAttribute("style"),U([s.querySelector("."+oht)],"e-group-row"),s.querySelector(".e-group-row").querySelector(".e-headercelldiv").style.display="none",s.querySelector(".e-group-row").querySelector(".e-sortfilterdiv").style.display="none"),this.parent.element.insertBefore(this.groupingTable,this.parent.element.querySelector("."+Mht)),gt(this.groupingTable,{width:T(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingTable&&this.groupingTable.querySelector("."+Gat)&&null!=this.gridPanel&&!this.gridPanel.isDestroyed&&(a=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2,this.gridPanel.width=!this.parent.isAdaptive&&a<400?this.parent.minWidth||"398px":a,this.gridPanel.refreshOverflow()),this.groupingTable.style.minWidth=this.parent.minWidth?this.parent.minWidth+"px":"400px",this.parent.axisFieldModule.render(),this.setGridRowWidth();var t=this.parent.element.querySelector("."+Zht).querySelector("colgroup").children[0],s=this.parent.isTabular?this.rowAxisWidth:parseInt(t.style.width,10),a=T(this.groupingTable.offsetWidth-s),t=(gt(e,{width:s+"px"}),gt(this.rightAxisPanel,{width:a}),this.groupingTable.style.display="",e.offsetHeight/2),s=("Chart"===this.parent.displayOption.primary&&(this.groupingTable.style.display="none"),t>n.offsetHeight&&(gt(i,{height:T(t)}),gt(n,{height:T(2+t)})),this.parent.element.querySelector("."+Zht).offsetHeight);gt(this.rowPanel,{height:s+"px"}),this.parent.element.querySelector("."+Zht).querySelector(".e-rhandler")&&(this.parent.element.querySelector("."+Zht).querySelector(".e-rhandler").style.height=s+"px");for(var a=[].slice.call(this.parent.element.querySelector("."+Zht).querySelector("thead").querySelectorAll("tr")).filter(function(e){return 0<e.childNodes.length}),l=s/a.length,h=0,d=a;h<d.length;h++){var p=d[h];gt(p,{height:l+"px"});for(var c=0,u=[].slice.call(p.querySelectorAll(".e-rhandler"));c<u.length;c++)gt(u[c],{height:l+"px"})}}else this.parent.axisFieldModule.render(),this.updateChartAxisHeight();this.parent.showToolbar&&"Both"===this.parent.displayOption.view&&(e="Table"===this.parent.currentView?".e-chart-grouping-bar":".e-pivot-grouping-bar",i=this.parent.element.querySelector(e))&&(i.style.display="none")}}},D0t.prototype.updateChartAxisHeight=function(){var e,t,i,n,o,r,s;this.groupingChartTable&&ge("#"+this.parent.element.id+"_chart",this.parent.element)&&(e=this.groupingChartTable.querySelector("."+qat),t=this.groupingChartTable.querySelector("."+Uat),s=this.groupingChartTable.querySelector("."+Dlt),i=this.groupingChartTable.querySelector("."+klt),n=this.groupingChartTable.querySelector("."+Plt),o=this.groupingChartTable.querySelector("."+Mlt),s&&o&&(s.style.height="auto",o.style.height="auto",0<s.offsetHeight)&&0<o.offsetHeight&&(gt(s,{height:T(r=(s.offsetHeight>o.offsetHeight?s:o).offsetHeight)}),gt(o,{height:T(r)})),i&&n&&(i.style.height="auto",n.style.height="auto",0<i.offsetHeight)&&0<n.offsetHeight&&(gt(i,{height:T(r=(i.offsetHeight>n.offsetHeight?i:n).offsetHeight)}),gt(n,{height:T(r)})),s=T(this.groupingChartTable.offsetWidth-Math.ceil(t.getBoundingClientRect().width)),gt(i,{width:Math.ceil(i.getBoundingClientRect().width)+"px"}),gt(e,{width:s}))},D0t.prototype.refreshUI=function(){if(this.groupingChartTable&&(gt(this.groupingChartTable,{width:T(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingChartTable.querySelector("."+Gat)&&null!=this.chartPanel&&!this.chartPanel.isDestroyed&&(e=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2,this.chartPanel.width=!this.parent.isAdaptive&&e<400?this.parent.minWidth||"398px":e,this.chartPanel.refreshOverflow()),this.updateChartAxisHeight(),this.parent.showFieldList)&&this.parent.pivotFieldListModule&&this.parent.pivotFieldListModule.element&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.alignIcon.bind(this))),this.groupingTable){var e=this.groupingTable.getElementsByClassName(klt+" "+xlt)[0],t=(gt(this.groupingTable,{width:T(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingTable&&this.groupingTable.querySelector("."+Gat)&&null!=this.gridPanel&&!this.gridPanel.isDestroyed&&(t=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2,this.gridPanel.width=!this.parent.isAdaptive&&t<400?this.parent.minWidth||"398px":t,this.gridPanel.refreshOverflow()),this.groupingTable.style.minWidth=this.parent.minWidth?this.parent.minWidth+"px":"400px",this.parent.element.querySelector("."+Zht).querySelector("colgroup").children[0]),t=this.parent.isTabular?this.rowAxisWidth:parseInt(t.style.width,10),i=T(this.groupingTable.offsetWidth-t);if(gt(e,{width:t+"px"}),gt(this.rightAxisPanel,{width:i}),this.parent.showFieldList&&this.parent.pivotFieldListModule&&this.parent.pivotFieldListModule.element&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.alignIcon.bind(this))),!this.parent.grid.element.querySelector(".e-group-row")){e=this.parent.element.querySelector("."+Zht).querySelector(".e-columnheader"),t=(U([e.querySelector("."+oht)],"e-group-row"),gt(this.rowPanel,{height:this.parent.element.querySelector("."+Zht).offsetHeight+"px"}),e.querySelector(".e-group-row").appendChild(this.rowAxisPanel),gt(e.querySelector(".e-group-row").querySelector(".e-headercelldiv"),{display:"none"}),gt(e.querySelector(".e-group-row").querySelector(".e-sortfilterdiv"),{display:"none"}),this.parent.element.querySelector("."+Zht).offsetHeight);gt(this.rowPanel,{height:t+"px"}),this.parent.element.querySelector("."+Zht).querySelector(".e-rhandler")&&(this.parent.element.querySelector("."+Zht).querySelector(".e-rhandler").style.height=t+"px");for(var i=[].slice.call(this.parent.element.querySelector("."+Zht).querySelector("thead").querySelectorAll("tr")).filter(function(e){return 0<e.childNodes.length}),n=t/i.length,o=0,r=i;o<r.length;o++){var s=r[o];gt(s,{height:n+"px"});for(var a=0,l=[].slice.call(s.querySelectorAll(".e-rhandler"));a<l.length;a++){var h=l[a];h.parentElement.parentElement.querySelector("."+Bdt)||gt(h,{height:n+"px"})}}}}},D0t.prototype.alignIcon=function(){var e,t,i;this.parent.pivotFieldListModule&&(e=this.parent.pivotFieldListModule.element,i=void 0,i="Table"===this.parent.currentView?this.parent.grid?this.parent.grid.element.offsetWidth:i:this.parent.chart?this.parent.pivotChartModule.getCalulatedWidth():i)&&(t=i<(t=this.parent.minWidth||(this.parent.isAdaptive?300:400))?t:i,gt(e.querySelector("."+Rat),{left:T(this.parent.enableRtl?-Math.abs(t-e.querySelector("."+Rat).offsetWidth):t-e.querySelector("."+Rat).offsetWidth)}))},D0t.prototype.setGridRowWidth=function(){var e=this.parent.element.querySelector("."+Zht).querySelector(".e-columnheader"),e=(U([e.querySelector("."+oht)],"e-group-row"),e.querySelector(".e-group-row").appendChild(this.rowAxisPanel),this.parent.element.querySelector("."+Zht).querySelector("colgroup").children[0]);if(this.rowPanel.querySelector("."+Jat))if(this.parent.isAdaptive){if(!this.parent.firstColWidth){if((i=this.parent.grid.columns)&&0<i.length)if(this.parent.isTabular){this.rowAxisWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth;for(var t=0;t<this.parent.engineModule.rowMaxLevel;t++)i[t].width=this.parent.gridSettings.columnWidth}else i[0].width=this.resColWidth;this.parent.posCount=0,this.parent.grid.headerModule.refreshUI()}}else{for(var i,n,o=[].slice.call(this.rowPanel.querySelectorAll("."+Kat)),o=o[o.length-1],r=this.parent.isTabular?0:o.querySelector(".e-indent-div").offsetWidth+20,o=o.querySelector("."+Jat).offsetWidth+r,r=T(o<this.resColWidth?this.resColWidth:o),o=this.parent.element.querySelector("."+Zht).querySelector("."+oht),s=this.parent.element.querySelector("."+Zat).querySelector("colgroup").children[0],a=parseInt(r,10),l=0<this.parent.pivotColumns.length,h=((i=this.parent.grid.columns)&&0<i.length&&(i[0].width=i[0].autoFit?i[0].width:a>this.resColWidth?a:this.resColWidth),void 0),h="olap"===this.parent.dataType?this.parent.renderModule.calculateColWidth(0<this.parent.olapEngineModule.pivotValues.length?this.parent.olapEngineModule.pivotValues[0].length:2):this.parent.renderModule.calculateColWidth(0<this.parent.dataSourceSettings.values.length&&0<this.parent.engineModule.pivotValues.length?this.parent.engineModule.pivotValues[0].length:2),d=0;d<i.length;d++)0!==d&&(i[d].columns?this.parent.setCommonColumnsWidth(this.parent.renderModule.pivotColumns[d].columns,h):"auto"!==i[d].width?(n=i[d].customAttributes?i[d].customAttributes.cell.valueSort.levelName:"",n=this.parent.renderModule.setSavedWidth(n,h),i[d].width=i[d].autoFit||l&&this.parent.pivotColumns[d].autoFit?i[d].width:this.parent.renderModule.lastColumn&&this.parent.renderModule.lastColumn.field===i[d].field?n-3:n):i[d].minWidth=h);this.parent.isTabular&&("row"===this.parent.dataSourceSettings.valueAxis?this.rowAxisWidth=this.rowAxisPanel.querySelector(".e-tabular-group-rows").getBoundingClientRect().width:(a=this.rowAxisPanel.querySelectorAll("."+Kat),this.rowAxisWidth=this.getPivotButtonsTotalWidth(a),0===this.parent.engineModule.rowMaxLevel&&1===a.length&&(this.rowAxisWidth=250),.8*this.parent.element.getBoundingClientRect().width<=this.rowAxisWidth&&(this.rowAxisWidth=a.length*this.parent.gridSettings.columnWidth))),this.parent.posCount=0,this.parent.setGridColumns(this.parent.grid.columns),this.parent.grid.headerModule.refreshUI(),this.parent.firstColWidth||(r=i[0].autoFit?i[0].width.toString():r,e.style.width=r,s.style.width=r,o.style.width=r,gt(o,{width:r}))}else this.parent.grid.columns&&0<this.parent.grid.columns.length&&(this.parent.grid.columns[0].width=this.parent.grid.columns[0].width>this.resColWidth?this.parent.grid.columns[0].width:this.resColWidth),this.parent.grid.headerModule.refreshUI();(this.groupingTable||this.groupingChartTable)&&this.refreshUI()},D0t.prototype.wireEvent=function(e){E.add(e,"mouseover",this.dropIndicatorUpdate,this),E.add(e,"mouseleave",this.dropIndicatorUpdate,this)},D0t.prototype.unWireEvent=function(e){E.remove(e,"mouseover",this.dropIndicatorUpdate),E.remove(e,"mouseleave",this.dropIndicatorUpdate)},D0t.prototype.dropIndicatorUpdate=function(e){(this.parent.isDragging&&e.target.classList.contains(Clt)&&"mouseover"===e.type||!this.parent.isDragging||!e.target.classList.contains(Clt)&&"mouseleave"===e.type)&&(q([].slice.call(this.parent.element.querySelectorAll("."+hlt)),dlt),q([].slice.call(this.parent.element.querySelectorAll("."+hlt+"-last")),dlt))},D0t.prototype.tapHoldHandler=function(e){var t,e=z(e.originalEvent.target,"."+Jat);!je(e)&&this.parent.isAdaptive&&(t=e.getBoundingClientRect(),this.parent.contextMenuModule.fieldElement=e,this.parent.contextMenuModule.menuObj.open(t.top,t.left))},D0t.prototype.RefreshFieldsPanel=function(){if("pivot"===this.parent.dataType&&null!=this.parent.groupingBarSettings){if(0<ct("#"+this.parent.element.id+"_AllFields",this.parent.element).length)for(var e=0,t=ct("#"+this.parent.element.id+"_AllFields",this.parent.element);e<t.length;e++)t[e].remove();this.parent.groupingBarSettings.showFieldsPanel&&(this.groupingChartTable&&"Table"!==this.parent.displayOption.view&&"Table"!==this.parent.groupingBarSettings.displayMode&&(this.chartPanel=this.createToolbarUI(this.groupingChartTable)),this.groupingTable&&(this.gridPanel=this.createToolbarUI(this.groupingTable)),this.parent.axisFieldModule.render(),this.refreshUI())}},D0t.prototype.createToolbarUI=function(e){ge("#"+this.parent.element.id+"_AllFields",e)&&ge("#"+this.parent.element.id+"_AllFields",e).remove(),e.prepend(Q("div",{id:this.parent.element.id+"_AllFields"}));var t=new U3({cssClass:Gat+(this.parent.cssClass?" "+this.parent.cssClass:""),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,items:[{template:"<div class="+Elt+"></div>"}],allowKeyboard:!1,width:this.parent.gridSettings.allowAutoResizing?"auto":this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2});return t.appendTo(ge("#"+this.parent.element.id+"_AllFields",e)),t},D0t.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(wct,this.renderLayout,this),this.parent.on(mct,this.appendToElement,this))},D0t.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(mct,this.appendToElement),this.parent.off(wct,this.renderLayout))},D0t.prototype.destroy=function(){this.removeEventListener(),this.parent.pivotButtonModule&&(this.parent.pivotButtonModule.destroy(),this.parent.pivotButtonModule=null),this.groupingTable&&this.groupingTable.querySelector("."+Gat)&&null!=this.gridPanel&&!this.gridPanel.isDestroyed&&(this.gridPanel.destroy(),this.gridPanel=null),this.groupingChartTable&&this.groupingChartTable.querySelector("."+Gat)&&null!=this.chartPanel&&!this.chartPanel.isDestroyed&&(this.chartPanel.destroy(),this.chartPanel=null),this.touchObj&&!this.touchObj.isDestroyed&&this.touchObj.destroy(),this.parent.element.querySelector("."+Tlt)&&ue(this.parent.element.querySelector("."+Tlt))},D0t.prototype.getPivotButtonsTotalWidth=function(e){for(var t=0,i=0;i<e.length;i++)t+=(e[i].getBoundingClientRect().width<this.parent.gridSettings.columnWidth?this.parent.gridSettings.columnWidth:e[i].getBoundingClientRect().width)+6;return t};nft=D0t;function D0t(e){this.rowAxisWidth=0,this.parent=e,(this.parent.groupingBarModule=this).resColWidth=this.parent.isAdaptive?180:249,this.addEventListener(),this.parent.axisFieldModule=new T0t(this.parent),this.touchObj=new Mn(this.parent.element,{tapHold:this.tapHoldHandler.bind(this)})}M0t.prototype.getModuleName=function(){return"conditionalFormatting"},M0t.prototype.createDialog=function(){null!==ge("#"+this.parentID+"conditionalformatting",document)&&ue(ge("#"+this.parentID+"conditionalformatting",document));var e=Q("div",{id:this.parentID+"conditionalformatting",className:"e-pivot-formatting-dialog"}),t=(this.parent.element.appendChild(e),[{click:this.addButtonClick.bind(this),isFlat:!1,buttonModel:{cssClass:(this.parent.isAdaptive?"e-small e-round "+Vht:Vht)+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:Tat+" "+Hlt,content:this.parent.isAdaptive?"":this.parent.localeObj.getConstant("condition")}},{click:this.applyButtonClick.bind(this),isFlat:!1,buttonModel:{isPrimary:!0,cssClass:"e-format-apply-button"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("apply")}},{click:this.cancelButtonClick.bind(this),isFlat:!1,buttonModel:{cssClass:"e-format-cancel-button"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}]),t=this.parent.isAdaptive?new pS({animationSettings:{effect:"Zoom"},isModal:!0,width:"100%",height:"100%",showCloseIcon:!1,closeOnEscape:!1,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,position:{X:"center",Y:"center"},allowDragging:!0,buttons:t,beforeOpen:this.beforeOpen.bind(this),close:this.removeDialog.bind(this),cssClass:this.parent.cssClass,header:this.parent.localeObj.getConstant("conditionalFormatting"),target:document.body}):new pS({allowDragging:!0,position:{X:"center",Y:this.parent.element.offsetTop},buttons:t,beforeOpen:this.beforeOpen.bind(this),close:this.removeDialog.bind(this),cssClass:this.parent.cssClass,isModal:!0,closeOnEscape:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,showCloseIcon:!0,header:this.parent.localeObj.getConstant("conditionalFormatting"),target:this.parent.element});t.isStringTemplate=!0,t.appendTo(e)},M0t.prototype.beforeOpen=function(){ge("#"+this.parentID+"conditionalformatting",document).querySelector("."+Wht).setAttribute("title",this.parent.localeObj.getConstant("conditionalFormatting"))},M0t.prototype.addButtonClick=function(){var t=this,i=this;this.parent.trigger($pt,{conditions:"LessThan",value1:0,applyGrandTotals:!0,style:{backgroundColor:"white",color:"black",fontFamily:"Arial",fontSize:"12px"}},function(e){i.refreshConditionValues(),t.destroyColorPickers(),i.newFormat.push(e),i.addFormat()})},M0t.prototype.applyButtonClick=function(){var e;this.refreshConditionValues()&&(this.parent.setProperties({dataSourceSettings:{conditionalFormatSettings:this.newFormat}},!0),e={conditionalFormattingInfo:this.parent.dataSourceSettings.conditionalFormatSettings},this.parent.actionObj.actionInfo=e,0<this.parent.dataSourceSettings.values.length&&this.parent.renderPivotGrid(),K(ge("#"+this.parentID+"conditionalformatting",document),pS).close())},M0t.prototype.cancelButtonClick=function(){K(ge("#"+this.parentID+"conditionalformatting",document),pS).close(),this.newFormat=[]},M0t.prototype.refreshConditionValues=function(){for(var e=0;e<this.newFormat.length;e++){if(""===ge("#"+this.parentID+"conditionvalue1"+e,document).value||""===ge("#"+this.parentID+"conditionvalue2"+e,document).value)return(""===ge("#"+this.parentID+"conditionvalue1"+e,document).value?ge("#"+this.parentID+"conditionvalue1"+e,document):ge("#"+this.parentID+"conditionvalue2"+e,document)).focus(),!1;this.newFormat[e].value1=Number(ge("#"+this.parentID+"conditionvalue1"+e,document).value),this.newFormat[e].value2=Number(ge("#"+this.parentID+"conditionvalue2"+e,document).value)}return!0},M0t.prototype.addFormat=function(){for(var e,t,i=Q("div",{id:this.parentID+"formatDiv",className:"e-new-format"}),n=0;n<this.newFormat.length;n++)i.appendChild(this.createDialogElements(n));0===this.newFormat.length&&(e=this.createDialogElements(),(t=Q("p",{id:this.parentID+"emptyFormat",className:"e-pivot-conditional-empty-format"})).innerText=this.parent.localeObj.getConstant("emptyFormat"),e.appendChild(t),i.appendChild(e)),K(ge("#"+this.parentID+"conditionalformatting",document),pS).setProperties({content:i},!1);for(n=0;n<this.newFormat.length;n++)this.renderDropDowns(n),this.renderColorPicker(n)},M0t.prototype.createDialogElements=function(e){var t,i,n,o,r,s,a,l,h,d=Q("div",{id:this.parentID+"outerDiv"+e,className:"e-format-outer-div"});return void 0!==e&&(r=this.newFormat[e],t=Q("button",{id:this.parentID+"removeButton"+e,className:"e-format-delete-button",attrs:{type:"button",title:this.parent.localeObj.getConstant("delete")}}),d.appendChild(t),t=Q("div",{id:this.parentID+"innerDiv"+e,className:"e-format-inner-div"}),a=Q("table",{id:this.parentID+"_valueTable"+e,className:_ht,attrs:{role:"table"}}),o=Q("tr"),n=Q("td"),(l=Q("span",{id:this.parentID+"valuelabel"+e,className:"e-format-value-label"})).innerText=this.parent.localeObj.getConstant("value"),n.appendChild(l),o.appendChild(n),a.appendChild(o),o=Q("tr"),n=Q("td"),l=Q("div",{id:this.parentID+"measure"+e}),i=Q("input",{id:this.parentID+"measureinput"+e,attrs:{type:"text",tabindex:"0"}}),l.appendChild(i),n.appendChild(l),o.appendChild(n),n=Q("td"),i=Q("div",{id:this.parentID+"condition"+e}),l=Q("input",{id:this.parentID+"conditioninput"+e,attrs:{type:"text",tabindex:"0"}}),i.appendChild(l),n.appendChild(i),o.appendChild(n),n=Q("td",{attrs:{style:"display:table"},className:"e-format-input-value"}),l="Between"!==r.conditions&&"NotBetween"!==r.conditions?zht:"",i=Q("div",{attrs:{style:"display: table-row;"}}),h=Q("div",{id:this.parentID+"ConditionValue1"+e,attrs:{style:"display: table-cell;"}}),s=Q("input",{id:this.parentID+"conditionvalue1"+e,attrs:{type:"text",tabindex:"0",value:je(r.value1)?"0":r.value1.toString(),placeholder:this.parent.localeObj.getConstant("emptyInput")}}),h.appendChild(s),i.appendChild(h),s=Q("span",{id:this.parentID+"valuespan"+e,className:"e-format-value-span "+l,innerHTML:"&"}),i.appendChild(s),h=Q("div",{id:this.parentID+"ConditionValue2"+e,attrs:{style:"display: table-cell;"}}),l=Q("input",{id:this.parentID+"conditionvalue2"+e,attrs:{type:"text",tabindex:"0",value:je(r.value2)?"0":r.value2.toString(),placeholder:this.parent.localeObj.getConstant("emptyInput")}}),h.appendChild(l),i.appendChild(h),n.appendChild(i),o.appendChild(n),a.appendChild(o),t.appendChild(a),s=Q("table",{id:this.parentID+"_grandTotalTable"+e,className:_ht+" e-grandtotal-checkbox-table",attrs:{role:"table"}}),r=Q("tr"),l=Q("td"),s.appendChild(r),h=Q("input",{id:this.parentID+"grandtotalcheckbox"+e,attrs:{type:"checkbox",tabindex:"0"}}),l.appendChild(h),r.appendChild(l),s.appendChild(r),t.appendChild(s),i=Q("table",{id:this.parentID+"_formatTable"+e,className:_ht,attrs:{role:"table"}}),n=Q("tr"),o=Q("td"),(a=Q("span",{id:this.parentID+"formatlabel"+e,className:"e-format-label"})).innerText=this.parent.localeObj.getConstant("formatLabel"),o.appendChild(a),n.appendChild(o),i.appendChild(n),n=Q("tr"),o=Q("td"),h=Q("div",{id:this.parentID+"fontname"+e}),l=Q("input",{id:this.parentID+"fontnameinput"+e,attrs:{type:"text",tabindex:"0"}}),h.appendChild(l),o.appendChild(h),n.appendChild(o),o=Q("td"),r=Q("div",{id:this.parentID+"fontsize"+e}),s=Q("input",{id:this.parentID+"fontsizeinput"+e,attrs:{type:"text",tabindex:"0"}}),r.appendChild(s),o.appendChild(r),n.appendChild(o),this.parent.isAdaptive&&(i.appendChild(n),n=Q("tr"),i.appendChild(n),n=Q("tr")),o=Q("td"),a=Q("input",{id:this.parentID+"fontcolor"+e,attrs:{type:"color",tabindex:"0"},className:"e-format-font-color"}),o.appendChild(a),l=Q("input",{id:this.parentID+"backgroundcolor"+e,attrs:{type:"color",tabindex:"0"},className:"e-format-back-color"}),o.appendChild(l),n.appendChild(o),o=Q("td"),h=Q("input",{id:this.parentID+"valuepreview"+e,className:Hht+" e-format-value-preview",attrs:{tabindex:"-1",readonly:"true",value:"123.45"}}),o.appendChild(h),n.appendChild(o),i.appendChild(n),t.appendChild(i),d.appendChild(t)),d},M0t.prototype.renderDropDowns=function(e){var t=K(ge("#"+this.parentID+"conditionalformatting",document),pS).element,i=this.newFormat[e],n=[];n.push({index:0,name:this.parent.localeObj.getConstant("AllValues"),field:this.parent.localeObj.getConstant("AllValues")});for(var o=0;o<this.parent.dataSourceSettings.values.length;o++){var r=this.parent.dataSourceSettings.values[o].caption||this.parent.dataSourceSettings.values[o].name,r=this.parent.enableHtmlSanitizer?go.sanitize(r):r;n.push({index:o+1,name:r,field:this.parent.dataSourceSettings.values[o].name})}var s=je(i.measure)?this.parent.localeObj.getConstant("AllValues"):i.measure,a=[],a=(a[e]=new qz({dataSource:n,fields:{text:"name",value:"field"},value:s,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.measureChange.bind(this,e)}),a[e].isStringTemplate=!0,a[e].appendTo(ge("#"+this.parentID+"measureinput"+e,t)),[{value:"LessThan",name:this.parent.localeObj.getConstant("LessThan")},{value:"LessThanOrEqualTo",name:this.parent.localeObj.getConstant("LessThanOrEqualTo")},{value:"GreaterThan",name:this.parent.localeObj.getConstant("GreaterThan")},{value:"GreaterThanOrEqualTo",name:this.parent.localeObj.getConstant("GreaterThanOrEqualTo")},{value:"Equals",name:this.parent.localeObj.getConstant("Equals")},{value:"NotEquals",name:this.parent.localeObj.getConstant("NotEquals")},{value:"Between",name:this.parent.localeObj.getConstant("Between")},{value:"NotBetween",name:this.parent.localeObj.getConstant("NotBetween")}]),s=je(i.conditions)?"LessThan":i.conditions,l=[],a=(l[e]=new qz({dataSource:a,fields:{value:"value",text:"name"},value:s,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.conditionChange.bind(this,e)}),l[e].isStringTemplate=!0,l[e].appendTo(ge("#"+this.parentID+"conditioninput"+e,t)),"Between"!==this.newFormat[e].conditions&&"NotBetween"!==this.newFormat[e].conditions?zht:""),l=new fV({enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-format-value1 "+this.parent.cssClass,width:"auto"}),l=(l.isStringTemplate=!0,l.appendTo(ge("#"+this.parentID+"conditionvalue1"+e,t)),new fV({enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-format-value2 "+a+" "+this.parent.cssClass,width:"auto"})),a=(l.isStringTemplate=!0,l.appendTo(ge("#"+this.parentID+"conditionvalue2"+e,t)),new ib({label:this.parent.localeObj.getConstant("applyToGrandTotal"),checked:this.newFormat[e].applyGrandTotals,enableRtl:this.parent.enableRtl,locale:this.parent.locale,change:this.onCheckChange.bind(this,e),cssClass:this.parent.cssClass})),l=(a.isStringTemplate=!0,a.appendTo(ge("#"+this.parentID+"grandtotalcheckbox"+e,t)),s=je(i.style.fontFamily)?"Arial":i.style.fontFamily,[]),a=(l[e]=new qz({dataSource:[{index:0,name:"Arial"},{index:1,name:"San Serif"},{index:2,name:"Impact"},{index:3,name:"Trebuchet MS"},{index:4,name:"Serif"},{index:5,name:"Verdana"},{index:6,name:"Courier New"},{index:7,name:"Times New Roman"},{index:8,name:"Tahoma"},{index:9,name:"Gerogia"}],fields:{text:"name"},value:s,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.fontNameChange.bind(this,e)}),l[e].isStringTemplate=!0,l[e].appendTo(ge("#"+this.parentID+"fontnameinput"+e,t)),s=je(i.style.fontSize)?"12px":i.style.fontSize,[]);a[e]=new qz({dataSource:[{index:0,name:"9px"},{index:1,name:"10px"},{index:2,name:"11px"},{index:3,name:"12px"},{index:4,name:"13px"},{index:5,name:"14px"},{index:6,name:"15px"},{index:6,name:"16px"}],fields:{text:"name"},popupHeight:"200px",popupWidth:"auto",value:s,width:"100%",change:this.fontSizeChange.bind(this,e),locale:this.parent.locale,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass}),a[e].isStringTemplate=!0,a[e].appendTo(ge("#"+this.parentID+"fontsizeinput"+e,t))},M0t.prototype.conditionChange=function(e,t){this.newFormat[e].conditions=t.value;var i=ge("#"+this.parentID+"valuespan"+e,document),e=ge("#"+this.parentID+"conditionvalue2"+e,document);"Between"===t.value||"NotBetween"===t.value?(i.classList.remove(zht),e.parentElement.classList.remove(zht)):(i.classList.add(zht),e.parentElement.classList.add(zht))},M0t.prototype.onCheckChange=function(e,t){this.newFormat[e].applyGrandTotals=t.checked},M0t.prototype.fontNameChange=function(e,t){this.newFormat[e].style.fontFamily=t.value.toString(),ge("#"+this.parentID+"valuepreview"+e,document).style.fontFamily=t.value},M0t.prototype.fontSizeChange=function(e,t){this.newFormat[e].style.fontSize=t.value.toString(),ge("#"+this.parentID+"valuepreview"+e,document).style.fontSize=t.value},M0t.prototype.measureChange=function(e,t){this.newFormat[e].measure=t.value.toString()===this.parent.localeObj.getConstant("AllValues")?void 0:t.value.toString()},M0t.prototype.renderColorPicker=function(e){var t=K(ge("#"+this.parentID+"conditionalformatting",document),pS).element,i=this.newFormat[e],n=je(i.style.color)?"black":i.style.color,o="#"===n.charAt(0)&&this.isHex(n.substr(1))?n:this.colourNameToHex(n),n=(ge("#"+this.parentID+"valuepreview"+e,document).style.color=o,this.fontColor[e]=new cV({cssClass:jht+" e-format-font-color-picker"+(this.parent.cssClass?" "+this.parent.cssClass:""),value:o,mode:"Palette",change:this.fontColorChange.bind(this,e),locale:this.parent.locale,enableRtl:this.parent.enableRtl}),this.fontColor[e].isStringTemplate=!0,this.fontColor[e].appendTo(ge("#"+this.parentID+"fontcolor"+e,t)),U([this.fontColor[e].element.nextElementSibling.querySelector(".e-selected-color")],Tat),o="#"===(n=je(i.style.backgroundColor)?"white":i.style.backgroundColor).charAt(0)&&this.isHex(n.substr(1))?n:this.colourNameToHex(n),ge("#"+this.parentID+"valuepreview"+e,document).style.backgroundColor=o,ge("#"+this.parentID+"valuepreview"+e,document).style.fontFamily=i.style.fontFamily,ge("#"+this.parentID+"valuepreview"+e,document).style.fontSize=i.style.fontSize,this.backgroundColor[e]=new cV({cssClass:jht+(this.parent.cssClass?" "+this.parent.cssClass:""),value:o,mode:"Palette",change:this.backColorChange.bind(this,e),locale:this.parent.locale,enableRtl:this.parent.enableRtl}),this.backgroundColor[e].isStringTemplate=!0,this.backgroundColor[e].appendTo(ge("#"+this.parentID+"backgroundcolor"+e,t)),U([this.backgroundColor[e].element.nextElementSibling.querySelector(".e-selected-color")],Tat),new zv({iconCss:Tat+" e-format-delete-icon",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:""),locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}));n.isStringTemplate=!0,n.appendTo(ge("#"+this.parentID+"removeButton"+e,t)),n.element.onclick=this.toggleButtonClick.bind(this,e)},M0t.prototype.backColorChange=function(e,t){this.newFormat[e].style.backgroundColor=t.currentValue.hex,ge("#"+this.parentID+"valuepreview"+e,document).style.backgroundColor=t.currentValue.hex},M0t.prototype.fontColorChange=function(e,t){this.newFormat[e].style.color=t.currentValue.hex,ge("#"+this.parentID+"valuepreview"+e,document).style.color=t.currentValue.hex},M0t.prototype.toggleButtonClick=function(e){this.destroyColorPickers(),this.newFormat.splice(e,1),this.addFormat()},M0t.prototype.isHex=function(e){for(var t=parseInt(e,16);"0"===e.charAt(0);)e=e.substr(1);return t.toString(16)===e.toLowerCase()||0===t&&""===e},M0t.prototype.hexToRgb=function(e){e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},M0t.prototype.colourNameToHex=function(e){var t={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};if(void 0!==t[e.toLowerCase()])return t[e.toLowerCase()];if(0===e.search("rgba")){for(var i=e.substr(5).split(")")[0].split(","),n="",o=0;o<i.length-1;o++)i[o]=(+i[o]).toString(16),1===i[o].length&&(i[o]="0"+i[o]),n+=i[o];return"#"+n+Math.round(255*+i[3]).toString(16)}if(0!==e.search("rgb"))return"#d5d5d5";for(i=e.substr(4).split(")")[0].split(","),n="",o=0;o<i.length;o++)i[o]=(+i[o]).toString(16),1===i[o].length&&(i[o]="0"+i[o]),n+=i[o];return"#"+n},M0t.prototype.removeDialog=function(){var e=ge("#"+this.parentID+"conditionalformatting",document),t=e?K(e,pS):null;t&&!t.isDestroyed&&(this.destroyColorPickers(),t.destroy()),e&&ue(e),this.fontColor=[],this.backgroundColor=[],this.newFormat=[]},M0t.prototype.destroyColorPickers=function(){for(var e=0;e<(this.newFormat?this.newFormat.length:0);e++)this.fontColor&&this.fontColor[e]&&!this.fontColor[e].isDestroyed&&this.fontColor[e].destroy(),this.backgroundColor&&this.backgroundColor[e]&&!this.backgroundColor[e].isDestroyed&&this.backgroundColor[e].destroy()},M0t.prototype.showConditionalFormattingDialog=function(){this.newFormat=[];for(var e=0;e<this.parent.dataSourceSettings.conditionalFormatSettings.length;e++)this.newFormat.push(Pe({},this.parent.dataSourceSettings.conditionalFormatSettings[e].properties,null,!0));this.createDialog(),K(ge("#"+this.parentID+"conditionalformatting",document),pS).refresh(),this.addFormat()},M0t.prototype.destroy=function(){var e=ge("#"+this.parentID+"conditionalformatting",document),e=e?K(e,pS):null;e&&!e.isDestroyed&&e.close()};X$e=M0t;function M0t(e){this.parent=e,(this.parent.conditionalFormattingModule=this).parentID=this.parent.element.id,this.fontColor=[],this.backgroundColor=[],this.newFormat=[]}k0t.prototype.getModuleName=function(){return"toolbar"},k0t.prototype.createToolbar=function(){this.parent.isModified=!1,this.renderDialog(),null!==ge("#"+this.parent.element.id+"pivot-toolbar",this.parent.element)&&ue(ge("#"+this.parent.element.id+"pivot-toolbar",this.parent.element));var e=Q("div",{id:this.parent.element.id+"pivot-toolbar",className:ddt}),t=(this.parent.showFieldList&&ge("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)?this.parent.element.insertBefore(e,ge("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)):this.parent.showGroupingBar&&ge("#"+this.parent.element.id+" .e-pivot-grouping-bar",this.parent.element)?this.parent.element.insertBefore(e,ge("#"+this.parent.element.id+" .e-pivot-grouping-bar",this.parent.element)):this.parent.element.insertBefore(e,ge("#"+this.parent.element.id+"_grid",this.parent.element)),this.toolbar=new U3({created:this.create.bind(this),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,items:this.getItems(),allowKeyboard:!1,cssClass:this.parent.cssClass,width:this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()}),this.toolbar.isStringTemplate=!0,"viewContainerRef");this.parent[t]&&(x("registeredTemplate",{},this.toolbar),this.toolbar[t]=this.parent[t]),this.parent.toolbarTemplate&&"string"==typeof this.parent.toolbarTemplate?(this.toolbar.appendTo(this.parent.toolbarTemplate),this.parent.element.replaceChild(this.toolbar.element,this.parent.element.querySelector("."+ddt)),this.toolbar.element.classList.add(ddt)):this.toolbar.appendTo(e),this.toolbar.width=this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber(),this.parent.chart&&this.parent.chart.setProperties({width:(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()).toString()},!0),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+Tlt)&&this.parent.groupingBarModule.refreshUI()},k0t.prototype.fetchReports=function(){var e={reportName:[]};return this.parent.trigger(bpt,e),e},k0t.prototype.fetchReportsArgs=function(){var t=new ll;return this.parent.trigger(bpt,{reportName:[]},function(e){t.resolve(e)}),t},k0t.prototype.getItems=function(){for(var e=this.parent.toolbar.filter(function(e,t,i){return i.indexOf(e)===t}),t=[],i=0,n=e;i<n.length;i++){var o=n[i];switch(o){case"New":t.push({prefixIcon:"e-new-report "+Tat,tooltipText:this.parent.localeObj.getConstant("new"),click:this.actionClick.bind(this),id:this.parent.element.id+"new"});break;case"Save":t.push({prefixIcon:"e-save-report "+Tat,tooltipText:this.parent.localeObj.getConstant("save"),click:this.actionClick.bind(this),id:this.parent.element.id+"save"});break;case"SaveAs":t.push({prefixIcon:"e-saveas-report "+Tat,tooltipText:this.parent.localeObj.getConstant("saveAs"),click:this.actionClick.bind(this),id:this.parent.element.id+"saveas"});break;case"Rename":t.push({prefixIcon:"e-rename-report "+Tat,tooltipText:this.parent.localeObj.getConstant("rename"),click:this.actionClick.bind(this),id:this.parent.element.id+"rename"});break;case"Remove":t.push({prefixIcon:hdt+" "+Tat,tooltipText:this.parent.localeObj.getConstant("deleteReport"),click:this.actionClick.bind(this),id:this.parent.element.id+"remove"});break;case"Load":t.push({template:"<div><input class=e-load-report id="+this.parent.element.id+"_reportlist></input></div>",click:this.actionClick.bind(this),id:this.parent.element.id+"load"});break;case"Grid":var r="Chart"===this.parent.displayOption.view;t.push({prefixIcon:cdt+" "+Tat,tooltipText:this.parent.localeObj.getConstant("grid"),id:this.parent.element.id+"grid",cssClass:(r?Bht:"")+(this.parent.cssClass?" "+this.parent.cssClass:""),click:this.menuItemClick.bind(this)});break;case"Chart":r="Table"===this.parent.displayOption.view;t.push({template:'<ul id="'+this.parent.element.id+'chart_menu"></ul>',id:this.parent.element.id+"chartmenu",cssClass:(r?Bht:"")+(this.parent.cssClass?" "+this.parent.cssClass:"")});break;case"MDX":"olap"===this.parent.dataType&&t.push({prefixIcon:"e-mdx "+Tat,id:this.parent.element.id+"mdxQuery",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("mdxQuery")});break;case"Export":t.push({template:'<ul id="'+this.parent.element.id+'export_menu"></ul>',id:this.parent.element.id+"exportmenu"});break;case"SubTotal":t.push({template:'<ul id="'+this.parent.element.id+'subtotal_menu"></ul>',id:this.parent.element.id+"subtotalmenu"});break;case"GrandTotal":t.push({template:'<ul id="'+this.parent.element.id+'grandtotal_menu"></ul>',id:this.parent.element.id+"grandtotalmenu"});break;case"ConditionalFormatting":t.push({prefixIcon:"e-toolbar-formatting "+Tat,id:this.parent.element.id+"formatting",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("toolbarFormatting")});break;case"NumberFormatting":t.push({prefixIcon:"e-pivot-format-toolbar "+Tat,id:this.parent.element.id+"numberFormatting",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("numberFormat")});break;case"Formatting":t.push({template:'<ul id="'+this.parent.element.id+'formatting_menu"></ul>',id:this.parent.element.id+"formattingmenu"});break;case"FieldList":t.push({prefixIcon:"e-toolbar-fieldlist "+Tat,tooltipText:this.parent.localeObj.getConstant("fieldList"),click:this.actionClick.bind(this),align:"Right",id:this.parent.element.id+"fieldlist"}),this.parent.element.querySelector(".e-toggle-field-list")&&(this.parent.element.querySelector(".e-toggle-field-list").style.display="none");break;default:"object"==typeof o&&t.push(o)}}return this.parent.showFieldList&&-1===e.indexOf("FieldList")&&ge("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)&&"none"===ge("#"+this.parent.element.id+"_PivotFieldList",this.parent.element).style.display&&(ge("#"+this.parent.element.id+"_PivotFieldList",this.parent.element).style.display="block"),this.parent.trigger(xpt,{customToolbar:t}),t},k0t.prototype.reportChange=function(e){if(this.parent.actionObj.actionName=rut,this.isReportChange=!0,this.parent.actionBeginMethod())e.cancel=!0;else try{this.dropArgs=e,this.parent.isModified&&""!==this.currentReport?this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("newReportConfirm")):this.reportLoad(e)}catch(e){this.parent.actionFailureMethod(e)}},k0t.prototype.reportLoad=function(e){var t,i=this;"Save"!==this.action&&"Rename"!==this.action&&"New"!==this.action&&(t={reportName:e.itemData.value},e={reportName:e.itemData.value},this.parent.actionObj.actionInfo=e,this.parent.trigger(wpt,t,function(e){i.currentReport=e.reportName,i.parent.isModified=!1}))},k0t.prototype.saveReport=function(e){var t,i;this.currentReport&&""!==this.currentReport&&e.item.id===this.parent.element.id+"save"?(t={report:this.getCurrentReport(),reportName:this.currentReport},this.parent.actionObj.actionName=this.parent.getActionCompleteName(),i={reportName:this.currentReport},this.parent.actionObj.actionInfo=i,this.parent.trigger(vpt,t),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.parent.isModified=!1):""!==this.currentReport||e.item.id!==this.parent.element.id+"save"&&e.item.id!==this.parent.element.id+"saveas"?this.dialogShow(e,"saveAs"):this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("emptyReport"))},k0t.prototype.mdxQueryDialog=function(){ge("#"+this.parent.element.id+"mdx-dialog",document)||this.renderMDXDialog();var e=K(ge("#"+this.parent.element.id+"mdx-dialog",document),pS),t=Q("div",{className:"e-mdx-query"}),i=Q("textarea",{className:xdt,attrs:{readonly:"readonly","aria-label":this.parent.localeObj.getConstant("mdxQuery")}});i.innerText=this.parent.olapEngineModule.getMDXQuery(this.parent.dataSourceSettings).trim(),t.appendChild(i),e.content=t,e.show()},k0t.prototype.dialogShow=function(e,t){var i,n,o;e&&((i=K(ge("#"+this.parent.element.id+"report-dialog",document),pS)).header=e.item.tooltipText,e=Q("div",{className:"e-report-outer"}),(n=Q("div",{className:"e-pivotview-report-label"})).innerText=this.parent.localeObj.getConstant("reportName"),(o=Q("input",{className:pdt+" "+Hht,attrs:{placeholder:this.parent.localeObj.getConstant("emptyReportName"),value:t&&"rename"===t?this.currentReport:""}})).innerText=t&&"rename"===t?this.currentReport:"",o.setSelectionRange(o.textContent.length,o.textContent.length),e.appendChild(n),e.appendChild(o),i.content=e,i.refresh(),i.show())},k0t.prototype.renameReport=function(e){this.parent.trigger(Ipt,e),this.currentReport&&""!==this.currentReport?this.dialogShow(e,"rename"):this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("emptyReport"))},k0t.prototype.actionClick=function(e){var t=e.item.id===this.parent.element.id+"new"?kct:e.item.id===this.parent.element.id+"save"?Pct:e.item.id===this.parent.element.id+"saveas"?Bct:e.item.id===this.parent.element.id+"rename"?Fct:e.item.id===this.parent.element.id+"remove"?Lct:e.item.id===this.parent.element.id+"load"?Rct:e.item.id===this.parent.element.id+"formatting"?Oct:e.item.id===this.parent.element.id+"numberFormatting"?Nct:e.item.id===this.parent.element.id+"mdxQuery"?"MdxQuery":e.item.id===this.parent.element.id+"fieldlist"?Vct:"";if(this.parent.actionObj.actionName=t,!this.parent.actionBeginMethod())try{switch(e.item.id){case this.parent.element.id+"save":case this.parent.element.id+"saveas":this.saveReport(e);break;case this.parent.element.id+"remove":return this.action="Remove",void(this.currentReport&&""!==this.currentReport?this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeConfirm")):this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("emptyReport")));case this.parent.element.id+"rename":this.renameReport(e);break;case this.parent.element.id+"new":this.action="New",this.newArgs=e,this.parent.isModified&&this.currentReport&&""!==this.currentReport?this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("newReportConfirm")):this.createNewReport(e);break;case this.parent.element.id+"load":this.action="Load";break;case this.parent.element.id+"fieldlist":this.parent.pivotFieldListModule&&this.parent.pivotFieldListModule.dialogRenderer&&this.parent.pivotFieldListModule.dialogRenderer.onShowFieldList();break;case this.parent.element.id+"formatting":this.parent.conditionalFormattingModule&&this.parent.conditionalFormattingModule.showConditionalFormattingDialog();break;case this.parent.element.id+"mdxQuery":this.mdxQueryDialog();break;case this.parent.element.id+"numberFormatting":this.parent.numberFormattingModule&&this.parent.numberFormattingModule.showNumberFormattingDialog()}}catch(e){this.parent.actionFailureMethod(e)}},k0t.prototype.renderDialog=function(){null!==ge("#"+this.parent.element.id+"report-dialog",this.parent.element)&&ue(ge("#"+this.parent.element.id+"report-dialog",this.parent.element));var e=Q("div",{id:this.parent.element.id+"report-dialog",className:"e-pivotview-report-dialog"}),t=(this.parent.element.appendChild(e),new pS({animationSettings:{effect:"Fade"},allowDragging:!0,position:{X:"center",Y:"center"},buttons:[{click:this.okBtnClick.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:this.cancelBtnClick.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],isModal:!0,visible:!1,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",zIndex:1000001,closeOnEscape:!0,target:document.body,cssClass:this.parent.cssClass}));t.isStringTemplate=!0,t.appendTo(e)},k0t.prototype.renderMDXDialog=function(){null!==ge("#"+this.parent.element.id+"mdx-dialog",this.parent.element)&&ue(ge("#"+this.parent.element.id+"mdx-dialog",this.parent.element));var e=Q("div",{id:this.parent.element.id+"mdx-dialog",className:"e-pivotview-mdx-dialog"}),t=(this.parent.element.appendChild(e),new pS({animationSettings:{effect:"Fade"},allowDragging:!0,position:{X:"center",Y:"center"},buttons:[{click:this.copyMDXQuery.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("copy"),isPrimary:!0}}],header:this.parent.localeObj.getConstant("mdxQuery"),isModal:!0,visible:!1,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",zIndex:1000001,closeOnEscape:!0,target:document.body,cssClass:this.parent.cssClass}));t.isStringTemplate=!0,t.appendTo(e)},k0t.prototype.copyMDXQuery=function(){var e=K(ge("#"+this.parent.element.id+"mdx-dialog",document),pS).element.querySelector("."+xdt);try{e.select(),document.execCommand("copy")}catch(e){window.alert("Oops, unable to copy")}},k0t.prototype.okBtnClick=function(){var o=this,e=K(ge("#"+this.parent.element.id+"report-dialog",document),pS),r=e.element.querySelector("."+pdt);if(r&&""===r.value)r.focus();else{if(this.parent.localeObj||(this.parent=K(ge("#"+this.parent.element.id,document),Xyt)),e.header!==this.parent.localeObj.getConstant("save")&&e.header!==this.parent.localeObj.getConstant("saveAs")||!r.value||""===r.value){if(e.header===this.parent.localeObj.getConstant("new")&&r.value&&""!==r.value){this.action="New",this.currentReport=r.value;var s=!1,a=this,l={reportName:[]};this.parent.trigger(bpt,l,function(e){for(var t,i,n=0;n<e.reportName.length;n++)if(r.value===l.reportName[n]){s=!0;break}s?a.createConfirmDialog(a.parent.localeObj.getConstant("alert"),a.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+r.value+'"'+a.parent.localeObj.getConstant("replaceConfirmAfter")):(a.parent.trigger(Apt),t={report:a.getCurrentReport(),reportName:r.value},i={reportName:r.value},o.parent.actionObj.actionInfo=i,a.parent.trigger(vpt,t),a.parent.isModified=!1,a.updateReportList(),K(ge("#"+o.parent.element.id+"report-dialog",document),pS).hide())})}else if(e.header===this.parent.localeObj.getConstant("rename")&&r.value&&""!==r.value){if(this.currentReport===r.value)return void e.hide();for(var t=!(this.action="Rename"),i=(this.renameText=r.value,this.fetchReports()),n=0;n<i.reportName.length;n++)if(r.value===i.reportName[n]){t=!0;break}if(t)return void this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+r.value+'"'+this.parent.localeObj.getConstant("replaceConfirmAfter"));var h={reportName:this.currentReport,rename:r.value},d={reportName:{oldName:this.currentReport,newName:r.value}};this.parent.actionObj.actionInfo=d,this.parent.trigger(Cpt,h),this.currentReport=r.value,this.updateReportList(),e.hide()}}else{this.action="Save",this.currentReport=r.value;var p=!1,c=this,i={reportName:[]};this.parent.trigger(bpt,i,function(e){for(var t,i,n=0;n<e.reportName.length;n++)if(r.value===e.reportName[n]){p=!0;break}p?c.createConfirmDialog(c.parent.localeObj.getConstant("alert"),c.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+r.value+'"'+c.parent.localeObj.getConstant("replaceConfirmAfter")):(t={report:c.getCurrentReport(),reportName:r.value},i={reportName:r.value},o.parent.actionObj.actionInfo=i,c.parent.trigger(vpt,t),c.parent.isModified=!1,c.updateReportList(),K(ge("#"+o.parent.element.id+"report-dialog",document),pS).hide())})}this.parent.actionObj.actionName=this.parent.getActionCompleteName(),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()}},k0t.prototype.createNewReport=function(e){this.dialogShow(e)},k0t.prototype.cancelBtnClick=function(){K(ge("#"+this.parent.element.id+"report-dialog",document),pS).hide()},k0t.prototype.createConfirmDialog=function(e,t){document.getElementById(this.parent.element.id+"_ConfirmDialog")&&ue(document.getElementById(this.parent.element.id+"_ConfirmDialog").parentElement);var i=Q("div",{id:this.parent.element.id+"_ConfirmDialog",className:wlt}),t=(this.parent.element.appendChild(i),new pS({animationSettings:{effect:"Fade"},allowDragging:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,header:e,content:t,isModal:!0,visible:!0,closeOnEscape:!0,target:document.body,cssClass:this.parent.cssClass,width:"auto",height:"auto",position:{X:"center",Y:"center"},buttons:[{isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("yes"),isPrimary:!0,cssClass:vlt+(this.parent.cssClass?" "+this.parent.cssClass:"")},click:this.okButtonClick.bind(this)},{isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("no"),cssClass:blt+(this.parent.cssClass?" "+this.parent.cssClass:"")},click:this.cancelButtonClick.bind(this)}]}));t.isStringTemplate=!0,t.appendTo(i),t.element.querySelector(".e-dlg-header").innerText=this.parent.enableHtmlSanitizer?go.sanitize(e):e},k0t.prototype.okButtonClick=function(){var e,t,i,n,o=this,r=K(ge("#"+this.parent.element.id+"report-dialog",document),pS);"Remove"===this.action?(e={reportName:this.currentReport},t={reportName:this.currentReport},this.parent.actionObj.actionInfo=t,this.parent.trigger(Spt,e),(e=this.fetchReports()).reportName&&0<e.reportName.length?(n={reportName:e.reportName[e.reportName.length-1]},this.parent.trigger(wpt,n,function(e){o.currentReport=e.reportName,o.parent.isModified=!1}),this.currentReport=e.reportName[e.reportName.length-1]):(this.currentReport="",this.parent.isModified=!1,this.action=""),this.updateReportList(),this.parent.actionObj.actionName=kut,this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()):"New"===this.action||"Save"!==this.action&&"Rename"!==this.action&&"New"!==this.action?this.currentReport&&""!==this.currentReport&&this.parent.isModified?(i={report:this.getCurrentReport(),reportName:this.currentReport},t={reportName:this.currentReport},this.parent.actionObj.actionInfo=t,this.parent.actionObj.actionName=Tut,this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.parent.trigger(vpt,i),this.parent.isModified=!1,"New"===this.action?(this.parent.actionObj.actionName=kct,this.createNewReport(this.newArgs)):(this.parent.actionObj.actionName=rut,this.reportLoad(this.dropArgs))):"New"===this.action&&(this.parent.trigger(Apt),i={report:this.getCurrentReport(),reportName:this.currentReport},this.parent.trigger(vpt,i),this.parent.isModified=!1,this.updateReportList(),r.hide()):"Save"===this.action?(i={report:this.getCurrentReport(),reportName:this.currentReport},this.parent.trigger(vpt,i),this.parent.isModified=!1,this.updateReportList(),r.hide()):"Rename"===this.action&&(n={reportName:this.currentReport,rename:this.renameText,isReportExists:!0},this.parent.trigger(Cpt,n),this.currentReport=this.renameText,this.parent.isModified=!1,this.updateReportList(),r.hide()),K(ge("#"+this.parent.element.id+"_ConfirmDialog",document),pS).hide()},k0t.prototype.cancelButtonClick=function(){var e,t=K(ge("#"+this.parent.element.id+"report-dialog",document),pS);"New"===this.action?this.parent.isModified?this.createNewReport(this.newArgs):t.hide():"Save"===this.action?(ge("#"+this.parent.element.id+"_reportlist",this.parent.element)&&(e=K(ge("#"+this.parent.element.id+"_reportlist",this.parent.element),qz),this.currentReport=e.value),t.hide()):"Rename"===this.action?t.hide():this.dropArgs&&"Remove"!==this.action&&this.reportLoad(this.dropArgs),K(ge("#"+this.parent.element.id+"_ConfirmDialog",document),pS).hide()},k0t.prototype.createChartMenu=function(){var e=this;if(ge("#"+this.parent.element.id+"chart_menu",this.parent.element)){for(var t=ge("#"+this.parent.element.id+"chart_menu",this.parent.element),i=[],n=this.getValidChartType(),o=0;o<n.length&&o<7;o++){var r=n[o];i.push({text:this.parent.localeObj.getConstant(r.toLowerCase()),id:this.parent.element.id+"_"+r})}7===i.length&&(i.splice(6),i.push({text:this.parent.localeObj.getConstant("MoreOption"),id:this.parent.element.id+"_ChartMoreOption"}));var s=i.length<=0||"Table"===this.parent.displayOption.view,s=(i.push({separator:!0}),i.push({text:this.parent.localeObj.getConstant("multipleAxes"),id:this.parent.element.id+"_multipleAxes"}),i.push({text:this.parent.localeObj.getConstant("showLegend"),id:this.parent.element.id+"_showLegend"}),[{iconCss:udt+" "+Tat,items:s?[]:i}]),a=t?K(t,L4):null;a&&!a.isDestroyed&&(a.destroy(),a=null),(a=new L4({items:s,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:Edt+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.whitespaceRemove.bind(this),onClose:function(){e.focusToolBar()},beforeItemRender:this.multipleAxesCheckbox.bind(this)})).isStringTemplate=!0,a.appendTo(t)}},k0t.prototype.create=function(){var e,t,i=this,n=(ge("#"+this.parent.element.id+"chart_menu",this.parent.element)&&this.createChartMenu(),ge("#"+this.parent.element.id+"export_menu",this.parent.element)&&(e=ge("#"+this.parent.element.id+"export_menu",this.parent.element),n=[{iconCss:"e-export "+Tat,items:[{text:this.parent.localeObj.getConstant("pdf"),iconCss:sdt+" "+Tat,id:this.parent.element.id+"pdf"},{text:this.parent.localeObj.getConstant("excel"),iconCss:adt+" "+Tat,id:this.parent.element.id+"excel"},{text:this.parent.localeObj.getConstant("csv"),iconCss:ldt+" "+Tat,id:this.parent.element.id+"csv"},{text:this.parent.localeObj.getConstant("png"),iconCss:"e-pivotview-png-export "+Tat,id:this.parent.element.id+"png"},{text:this.parent.localeObj.getConstant("jpeg"),iconCss:"e-pivotview-jpeg-export "+Tat,id:this.parent.element.id+"jpeg"},{text:this.parent.localeObj.getConstant("svg"),iconCss:"e-pivotview-svg-export "+Tat,id:this.parent.element.id+"svg"}]}],(t=new L4({items:n,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:Edt+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateExportMenu.bind(this),onClose:function(){i.focusToolBar()}})).isStringTemplate=!0,t.appendTo(e)),ge("#"+this.parent.element.id+"subtotal_menu",this.parent.element)&&(t=ge("#"+this.parent.element.id+"subtotal_menu",this.parent.element),n=[{iconCss:"e-sub-total "+Tat,items:[{text:this.parent.localeObj.getConstant("showSubTotals"),id:this.parent.element.id+"subtotal",iconCss:Sdt+" "+Tat},{text:this.parent.localeObj.getConstant("doNotShowSubTotals"),id:this.parent.element.id+"notsubtotal",iconCss:Sdt+" "+Tat},{text:this.parent.localeObj.getConstant("showSubTotalsRowsOnly"),id:this.parent.element.id+"subtotalrow",iconCss:Sdt+" "+Tat},{text:this.parent.localeObj.getConstant("showSubTotalsColumnsOnly"),id:this.parent.element.id+"subtotalcolumn",iconCss:Sdt+" "+Tat},{separator:!0},{text:this.parent.localeObj.getConstant("subTotalPosition"),id:this.parent.element.id+"subtotalpositions",iconCss:Cdt+" "+Tat,items:[{text:this.parent.localeObj.getConstant("auto"),id:this.parent.element.id+"sub-none-position",iconCss:Sdt+" "+Tat},{text:this.parent.localeObj.getConstant("top"),id:this.parent.element.id+"sub-top-position",iconCss:Sdt+" "+Tat},{text:this.parent.localeObj.getConstant("bottom"),id:this.parent.element.id+"sub-bottom-position",iconCss:Sdt+" "+Tat}]}]}],(e=new L4({items:n,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:Edt+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateSubtotalSelection.bind(this),onClose:function(){i.focusToolBar()}})).isStringTemplate=!0,e.appendTo(t)),ge("#"+this.parent.element.id+"grandtotal_menu",this.parent.element)&&(e=ge("#"+this.parent.element.id+"grandtotal_menu",this.parent.element),n=[{iconCss:"e-grand-total "+Tat,items:[{text:this.parent.localeObj.getConstant("showGrandTotals"),id:this.parent.element.id+"grandtotal",iconCss:Sdt+" "+Tat},{text:this.parent.localeObj.getConstant("doNotShowGrandTotals"),id:this.parent.element.id+"notgrandtotal",iconCss:Sdt+" "+Tat},{text:this.parent.localeObj.getConstant("showGrandTotalsRowsOnly"),id:this.parent.element.id+"grandtotalrow",iconCss:Sdt+" "+Tat},{text:this.parent.localeObj.getConstant("showGrandTotalsColumnsOnly"),id:this.parent.element.id+"grandtotalcolumn",iconCss:Sdt+" "+Tat},{separator:!0},{text:this.parent.localeObj.getConstant("grandTotalPosition"),id:this.parent.element.id+"grandtotalpositions",iconCss:Cdt+" "+Tat,items:[{text:this.parent.localeObj.getConstant("top"),id:this.parent.element.id+"top-position",iconCss:Sdt+" "+Tat},{text:this.parent.localeObj.getConstant("bottom"),id:this.parent.element.id+"bottom-position",iconCss:Sdt+" "+Tat}]}]}],(t=new L4({items:n,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:Edt+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateGrandtotalSelection.bind(this),onClose:function(){i.focusToolBar()}})).isStringTemplate=!0,t.appendTo(e)),ge("#"+this.parent.element.id+"formatting_menu",this.parent.element)&&(t=ge("#"+this.parent.element.id+"formatting_menu",this.parent.element),n=[{iconCss:"e-pivot-format-menu "+Tat,items:[{text:this.parent.localeObj.getConstant("numberFormatMenu"),iconCss:"e-pivot-number-format-menu "+Tat,id:this.parent.element.id+"numberFormattingMenu"},{text:this.parent.localeObj.getConstant("conditionalFormattingMenu"),iconCss:"e-pivot-conditional-format-menu "+Tat,id:this.parent.element.id+"conditionalFormattingMenu"}]}],(e=new L4({items:n,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:Edt+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this)})).isStringTemplate=!0,e.appendTo(t)),{report:this.parent.getPersistData(),reportName:this.parent.localeObj.getConstant("defaultReport")});this.currentReport=this.parent.localeObj.getConstant("defaultReport"),this.parent.trigger(vpt,n),ge("#"+this.parent.element.id+"_reportlist",this.parent.element)&&(e=ge("#"+this.parent.element.id+"_reportlist",this.parent.element),t=this.fetchReports(),(n=new qz({dataSource:t.reportName,width:"150px",popupHeight:"200px",placeholder:""===this.currentReport?this.parent.localeObj.getConstant("reportList"):"",enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-reportlist-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.reportChange.bind(this),value:this.currentReport})).isStringTemplate=!0,n.appendTo(e)),this.updateItemElements()},k0t.prototype.getCurrentReport=function(){var e,t=this.parent.getPersistData();return"CSV"===this.parent.dataSourceSettings.type&&"Server"!==this.parent.dataSourceSettings.mode&&((e=JSON.parse(t)).dataSourceSettings.dataSource.splice(0,0,this.parent.engineModule.fields),t=JSON.stringify(e)),t},k0t.prototype.updateItemElements=function(){for(var e=0,t=[].slice.call(this.toolbar.element.querySelectorAll(".e-toolbar-item"));e<t.length;e++){var i=t[e];i.querySelector("button")?i.querySelector("button").setAttribute("tabindex","0"):i.querySelector(".e-menu.e-menu-parent")&&(i.querySelector(".e-menu.e-menu-parent").setAttribute("tabindex","-1"),i.querySelector(".e-menu-item.e-menu-caret-icon"))&&i.querySelector(".e-menu-item.e-menu-caret-icon").setAttribute("tabindex","0")}},k0t.prototype.whitespaceRemove=function(e){e=e.element.querySelector(".e-separator");e&&(e.style.margin="0px")},k0t.prototype.multipleAxesCheckbox=function(e){var t,i,n,o=this;this.parent.element.id+"_multipleAxes"===e.element.id?((t=Q("input",{id:this.parent.element.id+"_checkBox"})).style.display="none",this.parent.element.appendChild(t),i=new ib({label:this.parent.localeObj.getConstant("multipleAxes"),cssClass:"e-multipleAxes"+(this.parent.cssClass?" "+this.parent.cssClass:""),checked:this.parent.chartSettings.enableMultipleAxis,change:function(){document.getElementById(o.parent.element.id+"_multipleAxes").click()},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),e.element.innerText="",i.appendTo(t),-1<["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)&&!e.element.classList.contains(Bht)?(e.element.classList.add(Bht),i.disabled=!0):["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)<0&&e.element.classList.contains(Bht)&&(e.element.classList.remove(Bht),i.disabled=!1),n=this.parent.element.querySelector("."+Jht+".e-multipleAxes"),e.element.appendChild(n)):this.parent.element.id+"_showLegend"===e.element.id&&((t=Q("input",{id:this.parent.element.id+"_showLegendCheckBox"})).style.display="none",this.parent.element.appendChild(t),i=new ib({label:this.parent.localeObj.getConstant("showLegend"),checked:this.getLableState(),cssClass:"e-showLegend"+(this.parent.cssClass?" "+this.parent.cssClass:""),change:function(){document.getElementById(o.parent.element.id+"_showLegend").click()},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),e.element.innerText="",i.appendTo(t),n=this.parent.element.querySelector("."+Jht+".e-showLegend"),e.element.appendChild(n))},k0t.prototype.getLableState=function(){var e=JSON.parse(this.parent.getChartSettings()).chartSettings;return e&&e.legendSettings&&void 0!==e.legendSettings.visible?this.showLableState=e.legendSettings.visible:this.showLableState=!0,this.showLableState},k0t.prototype.getAllChartItems=function(){return["Line","Column","Area","Bar","StackingColumn","StackingArea","StackingBar","StackingLine","StepLine","StepArea","SplineArea","Scatter","Spline","StackingColumn100","StackingBar100","StackingArea100","StackingLine100","Bubble","Pareto","Polar","Radar","Pie","Pyramid","Funnel","Doughnut"]},k0t.prototype.updateExportMenu=function(e){e=[].slice.call(e.element.querySelectorAll("li"));"Table"===this.parent.currentView?(U(e.slice(3),Fht),q(e.slice(1,3),Fht)):(U(e.slice(1,3),Fht),q(e.slice(3),Fht))},k0t.prototype.updateSubtotalSelection=function(e){e.parentItem.id!==this.parent.element.id+"subtotalpositions"?(ge("#"+this.parent.element.id+"subtotal ."+Sdt,e.element).classList.contains(Cdt)||ge("#"+this.parent.element.id+"subtotal ."+Sdt,e.element).classList.add(Cdt),ge("#"+this.parent.element.id+"notsubtotal ."+Sdt,e.element).classList.contains(Cdt)||ge("#"+this.parent.element.id+"notsubtotal ."+Sdt,e.element).classList.add(Cdt),ge("#"+this.parent.element.id+"subtotalrow ."+Sdt,e.element).classList.contains(Cdt)||ge("#"+this.parent.element.id+"subtotalrow ."+Sdt,e.element).classList.add(Cdt),ge("#"+this.parent.element.id+"subtotalcolumn ."+Sdt,e.element).classList.contains(Cdt)||ge("#"+this.parent.element.id+"subtotalcolumn ."+Sdt,e.element).classList.add(Cdt),this.parent.dataSourceSettings.showSubTotals&&this.parent.dataSourceSettings.showRowSubTotals&&!this.parent.dataSourceSettings.showColumnSubTotals?ge("#"+this.parent.element.id+"subtotalrow ."+Sdt,e.element).classList.remove(Cdt):this.parent.dataSourceSettings.showSubTotals&&!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?ge("#"+this.parent.element.id+"subtotalcolumn ."+Sdt,e.element).classList.remove(Cdt):this.parent.dataSourceSettings.showSubTotals&&this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?ge("#"+this.parent.element.id+"subtotal ."+Sdt,e.element).classList.remove(Cdt):this.parent.dataSourceSettings.showSubTotals&&(this.parent.dataSourceSettings.showRowSubTotals||this.parent.dataSourceSettings.showColumnSubTotals)||ge("#"+this.parent.element.id+"notsubtotal ."+Sdt,e.element).classList.remove(Cdt)):(ge("#"+this.parent.element.id+"sub-none-position ."+Sdt,e.element).classList.add(Cdt),"Auto"===this.parent.dataSourceSettings.subTotalsPosition&&ge("#"+this.parent.element.id+"sub-none-position ."+Sdt,e.element).classList.remove(Cdt),ge("#"+this.parent.element.id+"sub-top-position ."+Sdt,e.element).classList.add(Cdt),"Top"===this.parent.dataSourceSettings.subTotalsPosition&&ge("#"+this.parent.element.id+"sub-top-position ."+Sdt,e.element).classList.remove(Cdt),ge("#"+this.parent.element.id+"sub-bottom-position ."+Sdt,e.element).classList.add(Cdt),"Bottom"===this.parent.dataSourceSettings.subTotalsPosition&&ge("#"+this.parent.element.id+"sub-bottom-position ."+Sdt,e.element).classList.remove(Cdt))},k0t.prototype.updateGrandtotalSelection=function(e){e.parentItem.id!==this.parent.element.id+"grandtotalpositions"?(ge("#"+this.parent.element.id+"grandtotal ."+Sdt,e.element).classList.contains(Cdt)||ge("#"+this.parent.element.id+"grandtotal ."+Sdt,e.element).classList.add(Cdt),ge("#"+this.parent.element.id+"notgrandtotal ."+Sdt,e.element).classList.contains(Cdt)||ge("#"+this.parent.element.id+"notgrandtotal ."+Sdt,e.element).classList.add(Cdt),ge("#"+this.parent.element.id+"grandtotalrow ."+Sdt,e.element).classList.contains(Cdt)||ge("#"+this.parent.element.id+"grandtotalrow ."+Sdt,e.element).classList.add(Cdt),ge("#"+this.parent.element.id+"grandtotalcolumn ."+Sdt,e.element).classList.contains(Cdt)||ge("#"+this.parent.element.id+"grandtotalcolumn ."+Sdt,e.element).classList.add(Cdt),this.parent.dataSourceSettings.showGrandTotals&&this.parent.dataSourceSettings.showRowGrandTotals&&!this.parent.dataSourceSettings.showColumnGrandTotals?ge("#"+this.parent.element.id+"grandtotalrow ."+Sdt,e.element).classList.remove(Cdt):this.parent.dataSourceSettings.showGrandTotals&&!this.parent.dataSourceSettings.showRowGrandTotals&&this.parent.dataSourceSettings.showColumnGrandTotals?ge("#"+this.parent.element.id+"grandtotalcolumn ."+Sdt,e.element).classList.remove(Cdt):this.parent.dataSourceSettings.showGrandTotals&&this.parent.dataSourceSettings.showRowGrandTotals&&this.parent.dataSourceSettings.showColumnGrandTotals?ge("#"+this.parent.element.id+"grandtotal ."+Sdt,e.element).classList.remove(Cdt):this.parent.dataSourceSettings.showGrandTotals&&(this.parent.dataSourceSettings.showRowGrandTotals||this.parent.dataSourceSettings.showColumnGrandTotals)||ge("#"+this.parent.element.id+"notgrandtotal ."+Sdt,e.element).classList.remove(Cdt)):(ge("#"+this.parent.element.id+"top-position ."+Sdt,e.element).classList.add(Cdt),"Top"===this.parent.dataSourceSettings.grandTotalsPosition&&ge("#"+this.parent.element.id+"top-position ."+Sdt,e.element).classList.remove(Cdt),ge("#"+this.parent.element.id+"bottom-position ."+Sdt,e.element).classList.add(Cdt),"Bottom"===this.parent.dataSourceSettings.grandTotalsPosition&&ge("#"+this.parent.element.id+"bottom-position ."+Sdt,e.element).classList.remove(Cdt))},k0t.prototype.updateReportList=function(){var e,t;ge("#"+this.parent.element.id+"_reportlist",this.parent.element)&&(e=this.fetchReports(),(t=K(ge("#"+this.parent.element.id+"_reportlist",this.parent.element),qz)).dataSource=e.reportName,""===this.currentReport&&0<t.dataSource.length?(t.value=t.dataSource[t.dataSource.length-1],t.text=t.dataSource[t.dataSource.length-1],this.currentReport=t.dataSource[t.dataSource.length-1]):(t.value=this.currentReport,t.text=this.currentReport),t.refresh())},k0t.prototype.menuItemClick=function(e){var t,i,n=this,o={},r=e.item.id===this.parent.element.id+"grid"?_ct:e.item.id===this.parent.element.id+"_Column"||e.item.id===this.parent.element.id+"_Bar"||e.item.id===this.parent.element.id+"_Line"||e.item.id===this.parent.element.id+"_Area"||e.item.id===this.parent.element.id+"_Scatter"||e.item.id===this.parent.element.id+"_Polar"||e.item.id===this.parent.element.id+"_ChartMoreOption"?Hct:e.item.id===this.parent.element.id+"_multipleAxes"?zct:e.item.id===this.parent.element.id+"_showLegend"?jct:e.item.id===this.parent.element.id+"pdf"?Wct:e.item.id===this.parent.element.id+"png"?Qct:e.item.id===this.parent.element.id+"excel"?Uct:e.item.id===this.parent.element.id+"csv"?qct:e.item.id===this.parent.element.id+"jpeg"?Gct:e.item.id===this.parent.element.id+"svg"?Yct:e.item.id===this.parent.element.id+"notsubtotal"?Xct:e.item.id===this.parent.element.id+"subtotalrow"?Kct:e.item.id===this.parent.element.id+"subtotalcolumn"?Jct:e.item.id===this.parent.element.id+"subtotal"?Zct:e.item.id===this.parent.element.id+"notgrandtotal"?$ct:e.item.id===this.parent.element.id+"grandtotalrow"?eut:e.item.id===this.parent.element.id+"grandtotalcolumn"?tut:e.item.id===this.parent.element.id+"grandtotal"?iut:e.item.id===this.parent.element.id+"numberFormattingMenu"?nut:e.item.id===this.parent.element.id+"conditionalFormattingMenu"?out:"";if(this.parent.actionObj.actionName=r,!this.parent.actionBeginMethod()){(-1<this.getAllChartItems().indexOf(e.item.id.split(this.parent.element.id+"_")[1])||"ChartMoreOption"===e.item.id.split(this.parent.element.id+"_")[1]||"multipleAxes"===e.item.id.split(this.parent.element.id+"_")[1]||"showLegend"===e.item.id.split(this.parent.element.id+"_")[1])&&(t=e.item.id.split(this.parent.element.id+"_")[1]);try{switch(e.item.id){case this.parent.element.id+"grid":this.parent.grid&&this.parent.chart&&(this.parent.grid.element.style.display="",this.parent.chart.element.style.display="none",this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.enableScrollOnMultiAxis&&(this.parent.element.querySelector(".e-pivotchart").style.display="none"),this.parent.currentView="Table",this.parent.setProperties({displayOption:{primary:"Table"}},!0),this.parent.showGroupingBar&&this.parent.groupingBarModule&&(this.parent.element.querySelector(".e-pivot-grouping-bar")&&(this.parent.element.querySelector(".e-pivot-grouping-bar").style.display=""),this.parent.element.querySelector(".e-chart-grouping-bar"))&&(this.parent.element.querySelector(".e-chart-grouping-bar").style.display="none"),i={toolbarInfo:{displayOption:this.parent.displayOption,gridSettings:this.parent.gridSettings}},this.parent.actionObj.actionInfo=i,this.parent.layoutRefresh());break;case this.parent.element.id+"pdf":"Table"===this.parent.currentView?this.parent.pdfExport({fileName:"Export.pdf"},!1,void 0,!1):this.parent.chartExport("PDF",{fileName:"result"},void 0,null,void 0);break;case this.parent.element.id+"excel":o={excelExportProperties:{fileName:"Export.xlsx"},isBlob:void 0,isMultipleExport:void 0,workbook:void 0},this.parent.trigger(Xdt,o,function(e){n.parent.excelExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"csv":o={excelExportProperties:{fileName:"Export.csv"},isBlob:!1,isMultipleExport:!1,workbook:void 0},this.parent.trigger(Xdt,o,function(e){"Server"===n.parent.dataSourceSettings.mode?n.parent.getEngine("onCsvExport",null,null,null,null,null,null,null,null,e.excelExportProperties):n.parent.csvExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"png":this.parent.chartExport("PNG",{fileName:"result"},void 0,null,void 0);break;case this.parent.element.id+"jpeg":this.parent.chartExport("JPEG",{fileName:"result"},void 0,null,void 0);break;case this.parent.element.id+"svg":this.parent.chartExport("SVG",{fileName:"result"},void 0,null,void 0);break;case this.parent.element.id+"notsubtotal":this.parent.setProperties({dataSourceSettings:{showSubTotals:!1,showColumnSubTotals:!1,showRowSubTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"subtotalrow":this.parent.setProperties({dataSourceSettings:{showSubTotals:!0,showColumnSubTotals:!1,showRowSubTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"subtotalcolumn":this.parent.setProperties({dataSourceSettings:{showSubTotals:!0,showColumnSubTotals:!0,showRowSubTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"subtotal":this.parent.setProperties({dataSourceSettings:{showSubTotals:!0,showColumnSubTotals:!0,showRowSubTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"notgrandtotal":this.parent.setProperties({dataSourceSettings:{showGrandTotals:!1,showColumnGrandTotals:!1,showRowGrandTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"grandtotalrow":this.parent.setProperties({dataSourceSettings:{showGrandTotals:!0,showColumnGrandTotals:!1,showRowGrandTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"grandtotalcolumn":this.parent.setProperties({dataSourceSettings:{showGrandTotals:!0,showColumnGrandTotals:!0,showRowGrandTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"grandtotal":this.parent.setProperties({dataSourceSettings:{showGrandTotals:!0,showColumnGrandTotals:!0,showRowGrandTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"top-position":this.parent.setProperties({dataSourceSettings:{grandTotalsPosition:"Top"}},!0),this.parent.refreshData();break;case this.parent.element.id+"bottom-position":this.parent.setProperties({dataSourceSettings:{grandTotalsPosition:"Bottom"}},!0),this.parent.refreshData();break;case this.parent.element.id+"sub-top-position":this.parent.setProperties({dataSourceSettings:{subTotalsPosition:"Top"}},!0),this.parent.refreshData();break;case this.parent.element.id+"sub-bottom-position":this.parent.setProperties({dataSourceSettings:{subTotalsPosition:"Bottom"}},!0),this.parent.refreshData();break;case this.parent.element.id+"sub-none-position":this.parent.setProperties({dataSourceSettings:{subTotalsPosition:"Auto"}},!0),this.parent.refreshData();break;case this.parent.element.id+"numberFormattingMenu":this.parent.numberFormattingModule&&this.parent.numberFormattingModule.showNumberFormattingDialog();break;case this.parent.element.id+"conditionalFormattingMenu":this.parent.conditionalFormattingModule&&this.parent.conditionalFormattingModule.showConditionalFormattingDialog();break;case this.parent.element.id+"_"+t:e.item&&e.item.text&&("ChartMoreOption"===t?this.createChartTypeDialog():"multipleAxes"===t?(this.parent.chartSettings.enableScrollOnMultiAxis&&(this.isMultiAxisChange=!0),this.parent.chartSettings.enableMultipleAxis=!this.parent.chartSettings.enableMultipleAxis,this.updateChartType(this.parent.chartSettings.chartSeries.type,!0)):-1<this.getAllChartItems().indexOf(t)?this.updateChartType(t,!1):"showLegend"===t&&(this.parent.chart.legendSettings.visible=!this.showLableState,this.parent.chartSettings.legendSettings?this.parent.chartSettings.legendSettings.visible=!this.showLableState:this.parent.setProperties({chartSettings:{legendSettings:{visible:!this.showLableState}}},!0),this.updateChartType(this.parent.chartSettings.chartSeries.type,!0)))}}catch(e){this.parent.actionFailureMethod(e)}}},k0t.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(xct,this.createToolbar,this)},k0t.prototype.getValidChartType=function(){for(var e=[],t=0;t<=this.parent.chartTypes.length;t++){var i=this.parent.chartTypes[t];-1<this.getAllChartItems().indexOf(i)&&e.indexOf(i)<0&&e.push(i)}return e},k0t.prototype.createChartTypeDialog=function(){var e=this,t=this.parent.element.appendChild(Q("div",{id:this.parent.element.id+"_ChartTypeDialog",className:"e-pivotchart-type-dialog"})),i=new pS({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("chartTypeSettings"),content:this.getDialogContent(),isModal:!0,beforeOpen:this.beforeOpen.bind(this),visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:function(){e.chartTypeDialogUpdate()},isFlat:!1,buttonModel:{cssClass:vlt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){e.removeDialog()},isFlat:!1,buttonModel:{cssClass:blt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:!0,target:this.parent.element,cssClass:this.parent.cssClass,close:this.removeDialog.bind(this)});i.isStringTemplate=!0,i.appendTo(t)},k0t.prototype.removeDialog=function(){var e=ge("#"+this.parent.element.id+"_ChartTypeDialog",this.parent.element)?K(ge("#"+this.parent.element.id+"_ChartTypeDialog",this.parent.element),pS):null;e&&!e.isDestroyed&&e.destroy(),document.getElementById(this.parent.element.id+"_ChartTypeDialog")&&ue(document.getElementById(this.parent.element.id+"_ChartTypeDialog"))},k0t.prototype.chartTypeDialogUpdate=function(){var e=K(ge("#"+this.parent.element.id+"_ChartTypeOption"),qz).value,t=K(ge("#"+this.parent.element.id+"_DialogMultipleAxis"),ib).checked,i=K(ge("#"+this.parent.element.id+"_DialogShowLabel"),ib).checked;this.parent.chart.legendSettings.visible=i,this.chartLableState&&(this.parent.chart.legendSettings.visible=i,this.parent.chartSettings.legendSettings?this.parent.chartSettings.legendSettings.visible=i:this.parent.setProperties({chartSettings:{legendSettings:{visible:i}}},!0)),this.updateChartType(e,!1),this.parent.chartSettings.enableMultipleAxis=t,this.parent.chartSettings.multipleAxisMode=K(ge("#"+this.parent.element.id+"_AxisModeOption"),qz).value,(ge("#"+this.parent.element.id+"_ChartTypeDialog",document)?K(ge("#"+this.parent.element.id+"_ChartTypeDialog",document),pS):null).close()},k0t.prototype.updateChartType=function(e,t){-1<this.getAllChartItems().indexOf(e)&&this.parent.chart&&(this.parent.currentView="Chart",this.parent.setProperties({displayOption:{primary:"Chart"}},!0),this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&(this.parent.element.querySelector("."+gdt).style.width=T(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()),this.parent.element.querySelector("."+gdt).style.height=T(this.parent.pivotChartModule.getChartHeight())),this.parent.chart.setProperties({width:T(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()),height:T(this.parent.pivotChartModule.getChartHeight())},!0),this.parent.chartSettings.chartSeries.type!==e||t?this.parent.chartSettings.chartSeries.type=e:this.parent.chart.refresh(),t={toolbarInfo:{displayOption:this.parent.displayOption,chartSettings:this.parent.chartSettings}},this.parent.actionObj.actionInfo=t)},k0t.prototype.getDialogContent=function(){for(var e=Q("div",{className:"e-chart-type-div-content"}),t=Q("div",{className:"e-chart-type-option-container"}),i=Q("div",{className:"e-multiple-axes-mode-container"}),n=Q("div",{className:"e-chart-type-option-text"}),o=(n.innerText=this.parent.localeObj.getConstant("ChartType"),Q("div",{className:"e-multiple-axes-mode-text"})),r=(o.innerText=this.parent.localeObj.getConstant("multipleAxisMode"),Q("div",{id:this.parent.element.id+"_ChartTypeOption"})),s=Q("div",{id:this.parent.element.id+"_AxisModeOption"}),a=(t.appendChild(n),t.appendChild(r),[]),n=[{value:"Stacked",text:this.parent.localeObj.getConstant("stacked")},{value:"Single",text:this.parent.localeObj.getConstant("single")},{value:"Combined",text:this.parent.localeObj.getConstant("combined")}],l=this.getValidChartType(),h=0;h<l.length;h++)a.push({value:l[h],text:this.parent.localeObj.getConstant(l[h].toLowerCase())});var d=new qz({dataSource:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:this.parent.chartSettings.chartSeries.type||this.getValidChartType()[0],width:"100%",change:this.changeDropDown.bind(this),cssClass:this.parent.cssClass}),d=(d.isStringTemplate=!0,d.appendTo(r),e.appendChild(t),Q("input",{id:this.parent.element.id+"_DialogMultipleAxis",attrs:{type:"checkbox"}})),r=(e.appendChild(d),Q("input",{id:this.parent.element.id+"_DialogShowLabel",attrs:{type:"checkbox"}})),t=(e.appendChild(r),i.appendChild(o),i.appendChild(s),e.appendChild(i),new qz({dataSource:n,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:this.parent.chartSettings.multipleAxisMode||"Stacked",width:"100%",enabled:this.parent.chartSettings.enableMultipleAxis,cssClass:this.parent.cssClass}));return t.isStringTemplate=!0,t.appendTo(s),e},k0t.prototype.changeDropDown=function(e){var t=JSON.parse(this.parent.getChartSettings()).chartSettings;t&&t.legendSettings&&void 0!==t.legendSettings.visible||(K(ge("#"+this.parent.element.id+"_DialogShowLabel"),ib).checked=!0),-1<["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(e.value.toString())?(K(ge("#"+this.parent.element.id+"_DialogMultipleAxis"),ib).disabled=!0,K(ge("#"+this.parent.element.id+"_AxisModeOption"),qz).enabled=!1):((t=K(ge("#"+this.parent.element.id+"_DialogMultipleAxis"),ib)).disabled=!1,K(ge("#"+this.parent.element.id+"_AxisModeOption"),qz).enabled=t.checked)},k0t.prototype.beforeOpen=function(){var t=this,e=new ib({label:this.parent.localeObj.getConstant("multipleAxes"),cssClass:"e-dialog-multiple-axis"+(this.parent.cssClass?" "+this.parent.cssClass:""),checked:this.parent.chartSettings.enableMultipleAxis||!1,change:function(e){K(ge("#"+t.parent.element.id+"_AxisModeOption"),qz).enabled=e.checked},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),i=new ib({label:this.parent.localeObj.getConstant("showLegend"),checked:this.getLableState(),change:function(){t.chartLableState=!0},cssClass:"e-dialog-show-legend"+(this.parent.cssClass?" "+this.parent.cssClass:""),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),n=ge("#"+this.parent.element.id+"_ChartTypeDialog",document)?K(ge("#"+this.parent.element.id+"_ChartTypeDialog",document),pS):null,i=(i.appendTo(ge("#"+this.parent.element.id+"_DialogShowLabel",n.element)),e.appendTo(ge("#"+this.parent.element.id+"_DialogMultipleAxis",n.element)),-1<["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)&&(e.disabled=!0,K(ge("#"+this.parent.element.id+"_AxisModeOption"),qz).enabled=!1),JSON.parse(this.parent.getChartSettings()).chartSettings);i&&i.legendSettings&&void 0!==i.legendSettings.visible?this.chartLableState=!0:this.chartLableState=!1},k0t.prototype.refreshToolbar=function(){this.destroy(),this.createToolbar()},k0t.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(xct,this.createToolbar)},k0t.prototype.destroy=function(){this.removeEventListener();var e=ge("#"+this.parent.element.id+"_ConfirmDialog",document),t=e?K(e,pS):null,t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=ge("#"+this.parent.element.id+"report-dialog",document))?K(e,pS):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=ge("#"+this.parent.element.id+"mdx-dialog",document))?K(e,pS):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=ge("#"+this.parent.element.id+"chart_menu",document))?K(e,L4):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=ge("#"+this.parent.element.id+"_ChartTypeDialog",document))?K(e,pS):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=ge("#"+this.parent.element.id+"export_menu",document))?K(e,L4):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=ge("#"+this.parent.element.id+"subtotal_menu",document))?K(e,L4):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=ge("#"+this.parent.element.id+"grandtotal_menu",document))?K(e,L4):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=ge("#"+this.parent.element.id+"formatting_menu",document))?K(e,L4):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=ge("#"+this.parent.element.id+"_reportlist",document))?K(e,qz):null);t&&!t.isDestroyed&&(t.destroy(),t=null),this.toolbar&&!this.toolbar.isDestroyed&&(this.toolbar.destroy(),this.toolbar=null),(e=ge("#"+this.parent.element.id+"pivot-toolbar",document))&&ue(e)},k0t.prototype.focusToolBar=function(){q(document.querySelector("."+ddt).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),q(document.querySelector("."+ddt).querySelectorAll(".e-menu-item.e-selected"),"e-selected"),document.querySelector(".e-toolbar-items")&&U([document.querySelector(".e-toolbar-items")],"e-focused")};d$=k0t;function k0t(e){this.isMultiAxisChange=!1,this.isReportChange=!1,this.currentReport="",this.parent=e,(this.parent.toolbarModule=this).addEventListener()}P0t.prototype.getModuleName=function(){return"numberFormatting"},P0t.prototype.showNumberFormattingDialog=function(){for(var e,t=this,i=Q("div",{id:this.parent.element.id+"_FormatDialog",className:"e-pivot-format-dialog"}),n=(this.parent.element.appendChild(i),this.dialog=new pS({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("numberFormat"),content:this.getDialogContent(),isModal:!0,visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"320px",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:this.updateFormatting.bind(this),isFlat:!1,buttonModel:{cssClass:vlt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("apply"),isPrimary:!0}},{click:function(){t.dialog.hide()},isFlat:!1,buttonModel:{cssClass:blt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:!0,cssClass:this.parent.cssClass,target:this.parent.element,close:this.removeDialog.bind(this)}),this.dialog.isStringTemplate=!0,this.dialog.appendTo(i),this.dialog.element.querySelector("."+Wht).innerText=this.parent.localeObj.getConstant("numberFormat"),this.newFormat=[{name:this.parent.localeObj.getConstant("AllValues"),format:"N0",useGrouping:!0,type:void 0}],[]),o=0;o<this.parent.dataSourceSettings.formatSettings.length;o++)e={name:this.parent.dataSourceSettings.formatSettings[o].name,format:this.parent.dataSourceSettings.formatSettings[o].format,useGrouping:this.parent.dataSourceSettings.formatSettings[o].useGrouping,type:this.parent.dataSourceSettings.formatSettings[o].type},this.newFormat.push(e);for(o=0;o<this.newFormat.length;o++)n.push(this.newFormat[o].name);for(var r=0;r<this.parent.dataSourceSettings.values.length;r++)-1===n.indexOf(this.parent.dataSourceSettings.values[r].name)&&(e={name:this.parent.dataSourceSettings.values[r].name,format:"N0",useGrouping:!0},this.newFormat.push(e));this.renderControls()},P0t.prototype.getDialogContent=function(){var e=Q("div",{id:this.parent.element.id+"_FormatDialogOuter",className:"e-pivot-format-dialog-outer"}),t=Q("table",{id:this.parent.element.id+"_FormatTable",className:"e-pivot-format-table",attrs:{role:"tableItems"}}),i=Q("tr"),n=Q("td"),o=Q("div",{id:this.parent.element.id+"_FormatValueLable",className:"e-pivot-format-value-lable"}),r=(o.innerText=this.parent.localeObj.getConstant("values"),Q("div",{id:this.parent.element.id+"_FormatValueDrop"})),o=(n.appendChild(o),n.appendChild(r),i.appendChild(n),t.appendChild(i),i=Q("tr"),n=Q("td"),Q("div",{id:this.parent.element.id+"_FormatLable",className:"e-pivot-format-lable"})),r=(o.innerText=this.parent.localeObj.getConstant("formatType"),Q("div",{id:this.parent.element.id+"_FormatDrop"})),o=(n.appendChild(o),n.appendChild(r),i.appendChild(n),t.appendChild(i),i=Q("tr"),n=Q("td"),Q("div",{id:this.parent.element.id+"_GroupingLable",className:"e-pivot-format-grouping-lable"})),r=(o.innerText=this.parent.localeObj.getConstant("grouping"),Q("div",{id:this.parent.element.id+"_GroupingDrop"})),o=(n.appendChild(o),n.appendChild(r),i.appendChild(n),t.appendChild(i),i=Q("tr"),n=Q("td"),Q("div",{id:this.parent.element.id+"_DecimalLable",className:"e-pivot-format-decimal-lable"})),r=(o.innerText=this.parent.localeObj.getConstant("decimalPlaces"),Q("div",{id:this.parent.element.id+"_DecimalDrop"}));return n.appendChild(o),n.appendChild(r),i.appendChild(n),t.appendChild(i),i=Q("tr"),n=Q("td"),this.customLable=Q("div",{id:this.parent.element.id+"_CustomLable",className:"e-pivot-format-custom-lable"}),this.customLable.innerText=this.parent.localeObj.getConstant("customFormatString"),this.customText=Q("input",{id:this.parent.element.id+"_CustomText",attrs:{type:"text",tabindex:"0"},className:Hht+" e-pivot-format-custom-text"}),n.appendChild(this.customLable),n.appendChild(this.customText),i.appendChild(n),t.appendChild(i),i=Q("tr"),t.appendChild(i),e.appendChild(t),e},P0t.prototype.renderControls=function(){var e,t,i,n;if(ge("#"+this.parent.element.id+"_FormatValueDrop",this.dialog.element)){var o=[];o.push({index:0,name:this.parent.localeObj.getConstant("AllValues"),field:this.parent.localeObj.getConstant("AllValues")});for(var r=0;r<this.parent.dataSourceSettings.values.length;r++){var s=this.parent.dataSourceSettings.values[r].caption||this.parent.dataSourceSettings.values[r].name,s=this.parent.enableHtmlSanitizer?go.sanitize(s):s;o.push({index:r+1,name:s,field:this.parent.dataSourceSettings.values[r].name})}(e=new qz({dataSource:o,fields:{text:"name",value:"field"},enableRtl:this.parent.enableRtl,locale:this.parent.locale,index:0,cssClass:"e-pivot-format-value-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),change:this.valueChange.bind(this),width:"100%",open:this.customUpdate.bind(this)})).isStringTemplate=!0,e.appendTo(ge("#"+this.parent.element.id+"_FormatValueDrop",this.dialog.element))}ge("#"+this.parent.element.id+"_FormatDrop",this.dialog.element)&&(t=[{index:0,name:this.parent.localeObj.getConstant("number")},{index:1,name:this.parent.localeObj.getConstant("currency")},{index:2,name:this.parent.localeObj.getConstant("percentage")},{index:3,name:this.parent.localeObj.getConstant("Custom")}],(n=new qz({dataSource:t,fields:{text:"name",value:"name"},index:0,change:this.dropDownChange.bind(this),enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-pivot-format-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%"})).isStringTemplate=!0,n.appendTo(ge("#"+this.parent.element.id+"_FormatDrop",this.dialog.element))),ge("#"+this.parent.element.id+"_GroupingDrop",this.dialog.element)&&(t=[{index:0,name:this.parent.localeObj.getConstant("true")},{index:1,name:this.parent.localeObj.getConstant("false")}],(i=new qz({dataSource:t,fields:{text:"name",value:"name"},enableRtl:this.parent.enableRtl,locale:this.parent.locale,index:0,cssClass:"e-pivot-format-grouping-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:this.groupingChange.bind(this)})).isStringTemplate=!0,i.appendTo(ge("#"+this.parent.element.id+"_GroupingDrop",this.dialog.element))),ge("#"+this.parent.element.id+"_DecimalDrop",this.dialog.element)&&((i=new qz({dataSource:t=[{index:0,name:0},{index:1,name:1},{index:2,name:2},{index:3,name:3},{index:4,name:4},{index:5,name:5},{index:6,name:6},{index:7,name:7},{index:8,name:8},{index:9,name:9},{index:10,name:10}],fields:{text:"name",value:"name"},enableRtl:this.parent.enableRtl,locale:this.parent.locale,index:0,cssClass:"e-pivot-format-decimal-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),popupHeight:150,width:"100%",change:this.decimalChange.bind(this)})).isStringTemplate=!0,i.appendTo(ge("#"+this.parent.element.id+"_DecimalDrop",this.dialog.element))),n.value!==this.parent.localeObj.getConstant("Custom")&&(this.customText.disabled=!0),0!==this.lastFormattedValue.length&&(e.value=this.lastFormattedValue[0].name,i=""===(t=this.lastFormattedValue[0].format)?"":t.split("")[0].toLowerCase(),n=this.lastFormattedValue[0].useGrouping?this.parent.localeObj.getConstant("true"):this.parent.localeObj.getConstant("false"),this.updateFormattingDialog(t,i,n))},P0t.prototype.valueChange=function(e){for(var t=this.newFormat,i=!1,n=0;n<t.length;n++)if(t[n].name===e.value){var o=t[n].format,r=""===o?"":o.split("")[0].toLowerCase(),s=t[n].useGrouping?this.parent.localeObj.getConstant("true"):this.parent.localeObj.getConstant("false");this.updateFormattingDialog(o,r,s),i=!0;break}i||(K(ge("#"+this.parent.element.id+"_FormatDrop",this.parent.element),qz).value=this.parent.localeObj.getConstant("number"),K(ge("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),qz).value=0,K(ge("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),qz).value=this.parent.localeObj.getConstant("true"))},P0t.prototype.updateFormattingDialog=function(e,t,i){var n=K(ge("#"+this.parent.element.id+"_FormatDrop",this.parent.element),qz);2===e.length&&-1<["n","p","c"].indexOf(t)?(n.value="n"===t?this.parent.localeObj.getConstant("number"):"p"===t?this.parent.localeObj.getConstant("percentage"):"c"===t?this.parent.localeObj.getConstant("currency"):this.parent.localeObj.getConstant("number"),K(ge("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),qz).value=Number(e.split("")[1]),K(ge("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),qz).value=i):(n.value=this.parent.localeObj.getConstant("Custom"),this.customText.value=e)},P0t.prototype.customUpdate=function(){var e;K(ge("#"+this.parent.element.id+"_FormatDrop",this.parent.element),qz).value===this.parent.localeObj.getConstant("Custom")&&(e=this.getIndexValue(),this.newFormat[e].format=this.customText.value)},P0t.prototype.dropDownChange=function(e){var t=this.getIndexValue(),i=K(ge("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),qz),n=K(ge("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),qz);e.value===this.parent.localeObj.getConstant("Custom")?(this.customText.disabled=!1,i.enabled=!1,n.enabled=!1,this.newFormat[t].format=this.customText.value):(e=this.formattedText(),this.newFormat[t].format=e,this.customText.disabled=!0,i.enabled=!0,n.enabled=!0,this.customText.value="")},P0t.prototype.groupingChange=function(){var e=this.getIndexValue(),t=K(ge("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),qz);this.newFormat[e].useGrouping=t.value===this.parent.localeObj.getConstant("true")},P0t.prototype.getIndexValue=function(){for(var e=[],t=0;t<this.newFormat.length;t++)e.push(this.newFormat[t].name);var i=K(ge("#"+this.parent.element.id+"_FormatValueDrop",this.parent.element),qz);return e.indexOf(i.value.toString())},P0t.prototype.decimalChange=function(){var e=this.getIndexValue(),t=this.formattedText();this.newFormat[e].format=t},P0t.prototype.formattedText=function(){var e=K(ge("#"+this.parent.element.id+"_FormatDrop",this.parent.element),qz),t=K(ge("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),qz);return e.value===this.parent.localeObj.getConstant("number")||e.value===this.parent.localeObj.getConstant("percentage")||e.value===this.parent.localeObj.getConstant("currency")?(e.value===this.parent.localeObj.getConstant("number")?"N":e.value===this.parent.localeObj.getConstant("currency")?"C":"P")+t.value:this.customText.value},P0t.prototype.removeDialog=function(){this.dialog&&!this.dialog.isDestroyed&&this.dialog.destroy(),document.getElementById(this.parent.element.id+"_FormatDialog")&&ue(document.getElementById(this.parent.element.id+"_FormatDialog"))},P0t.prototype.updateFormatting=function(){for(var o=this,e=this.formattedText(),t=this.getIndexValue(),i=(this.newFormat=this.newFormat.splice(t,1),Pe([],this.newFormat,!0)),n=this.parent.dataSourceSettings.formatSettings,r=0;r<n.length;r++)this.insertFormat(n[r].name,n[r].format,n[r].type,n[r].currency,n[r].useGrouping);t=K(ge("#"+this.parent.element.id+"_FormatValueDrop",this.parent.element),qz);if(t.value===this.parent.localeObj.getConstant("AllValues"))for(r=0;r<this.parent.dataSourceSettings.values.length;r++)this.insertFormat(this.parent.dataSourceSettings.values[r].name,e);else this.insertFormat(t.value.toString(),e);t={formatSettings:Hdt.cloneFormatSettings(this.newFormat),formatName:t.value.toString(),cancel:!1};this.parent.trigger(rct,t,function(n){if(n.cancel)o.dialog.close(),o.parent.setProperties({dataSourceSettings:{formatSettings:i}},!0);else{if("olap"===o.parent.dataType)for(var e=0;e<n.formatSettings.length;e++)!function(t){var i=Hdt.getFieldInfo(n.formatSettings[t].name,o.parent);o.parent.dataSourceSettings.calculatedFieldSettings.forEach(function(e){e.name===i.fieldName&&(e.formatString=n.formatSettings[t].format)})}(e);o.parent.setProperties({dataSourceSettings:{formatSettings:n.formatSettings}},!0);var t={numberFormattingInfo:o.parent.dataSourceSettings.formatSettings};o.parent.actionObj.actionInfo=t;try{o.parent.updateDataSource(),o.dialog.close()}catch(e){o.parent.setProperties({dataSourceSettings:{formatSettings:i}},!0),o.parent.pivotCommon.errorDialog.createErrorDialog(o.parent.localeObj.getConstant("error"),o.parent.localeObj.getConstant("invalidFormat")),o.parent.hideWaitingPopup()}}})},P0t.prototype.insertFormat=function(e,t,i,n,o){for(var r=!1,s=K(ge("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),qz),a={name:e,format:t,useGrouping:je(o)?s.value===this.parent.localeObj.getConstant("true"):o,type:i,currency:n},l=this.newFormat,h=0;h<l.length;h++)l[h].name===e&&(l[h]=a,r=!0);r||l.push(a),this.lastFormattedValue=[],this.lastFormattedValue.push(a)},P0t.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Tct,this.showNumberFormattingDialog,this)},P0t.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Tct,this.showNumberFormattingDialog)},P0t.prototype.destroy=function(){this.dialog&&!this.dialog.isDestroyed&&(this.dialog.destroy(),this.dialog=null),this.removeEventListener()};zmt=P0t;function P0t(e){this.parent=e,(this.parent.numberFormattingModule=this).removeEventListener(),this.addEventListener(),this.newFormat=[],this.lastFormattedValue=[]}B0t.prototype.getModuleName=function(){return"grouping"},B0t.prototype.render=function(e){var t=e.target,i=e.option,e=e.parentElement,n=[],o=(this.parentElement=e,this.isUpdate=!1,parseInt(t.getAttribute("aria-colindex"),10)-1),t=Number(t.getAttribute("index")),t=this.parent.engineModule.pivotValues[t][o],o=t.valueSort.axis.toString();(n=this.getSelectedCells(t.axis,o,t.actualText.toString())).push({axis:t.axis,fieldName:o,name:t.actualText.toString(),cellInfo:t}),-1!==i.replace(e.id,"").indexOf("_custom_group")?this.createGroupSettings(o,n):this.updateUnGroupSettings(o,n)},B0t.prototype.getSelectedOptions=function(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];-1===Hdt.inArray(o.name,t)&&t.push(o.name)}return t},B0t.prototype.createGroupSettings=function(e,t){var i,n,o,r,s=this.parent.engineModule.fieldList[e],a=this.getGroupSettings(e);0<t.length&&(i=void 0,n=!1,s.isCustomField?a?"Custom"===a.type?1===t.length?n=!0:(n=!1,i="custom"):a&&"Number"===a.type&&(n=!1,i="number"):(o=this.getGroupSettings(e.replace(this.dateGroup,"")),r=this.getGroupSettings(e.replace(/_custom_group/g,"")),o?(n=!1,i="date",e=e.replace(this.dateGroup,"")):r&&(n=1===t.length,i="custom")):a?"Number"===a.type||"Date"===a.type?(n=!1,i="Date"===a.type?"date":"number"):"Custom"===a.type&&(n=1===t.length,i="custom"):"number"===s.type||-1!==["datetime","date"].indexOf(s.type)||this.isDateType(e)?(n=!1,i=1===t.length?-1!==["datetime","date"].indexOf(s.type)||this.isDateType(e)?"date":"number":"custom"):"string"===s.type&&(n=1===t.length,i="custom"),n?(this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("warning"),this.parent.localeObj.getConstant("invalidSelection")),this.parent.grid.clearSelection()):i&&""!==i&&this.createGroupDialog(e,i,t))},B0t.prototype.updateUnGroupSettings=function(e,t){var i,n,o=this.parent.engineModule.fieldList[e],r=Hdt.cloneGroupSettings(this.parent.dataSourceSettings.groupSettings),s=this.getGroupSettings(e);0<t.length&&(i=void 0,o.isCustomField?s?"Custom"===s.type&&(i="custom"):(o=this.getGroupSettings(e.replace(this.dateGroup,"")),n=this.getGroupSettings(e.replace(/_custom_group/g,"")),o?(i="date",e=e.replace(this.dateGroup,"")):n&&(i="custom")):!s||"Number"!==s.type&&"Date"!==s.type||(i="Date"===s.type?"date":"number"),"date"===i||"number"===i?r=this.validateSettings(e,r,i,[]):"custom"===i&&(o=this.getSelectedOptions(t),r=this.validateSettings(e,r,i,o)),this.updateDateSource(r,i))},B0t.prototype.updateDateSource=function(e,t){this.isUpdate&&(this.parent.setProperties({dataSourceSettings:{groupSettings:e}},!0),this.parent.updateGroupingReport(e,"date"===t?"Date":"custom"===t?"Custom":"Number"),"Server"===this.parent.dataSourceSettings.mode?this.parent.getEngine("onRefresh"):this.parent.initEngine())},B0t.prototype.removeGroupSettings=function(e,t,i,n){var o=n.indexOf(e);if(-1!==o)for(var r,s=i[o],a=0,l=s.customGroups.length;a<l;a++)s.customGroups[a]&&(r=s.customGroups[a],-1!==Hdt.inArray(r.groupName,t))&&(i=this.modifyParentGroupItems(e,i,[r.groupName],r.items,n),s.customGroups.splice(a,1),this.isUpdate=!0,a--,l--);return delete this.parent.engineModule.groupingFieldsInfo[e],i},B0t.prototype.getGroupSettings=function(e){for(var t=0,i=this.parent.dataSourceSettings.groupSettings;t<i.length;t++){var n=i[t];if(n.name===e)return n}},B0t.prototype.isDateType=function(e){for(var t=0,i=this.parent.dataSourceSettings.formatSettings;t<i.length;t++){var n=i[t];if(n.name===e&&n.type)return!0}return!1},B0t.prototype.getSelectedCells=function(e,t,i){for(var n=[],o=this.parent.element.querySelectorAll("."+Xht+",."+Kht),r=0;r<o.length;r++){var s=o[r],a=parseInt(s.getAttribute("aria-colindex"),10)-1,s=Number(s.getAttribute("index")),s=this.parent.engineModule.pivotValues[s][a];s&&s.axis===e&&"grand sum"!==s.type&&"sum"!==s.type&&s.valueSort.axis===t&&i!==s.actualText.toString()&&n.push({axis:s.axis,fieldName:s.valueSort.axis.toString(),name:s.actualText.toString(),cellInfo:s})}return n},B0t.prototype.createGroupDialog=function(e,t,i){var n=Q("div",{id:this.parentElement.id+"_GroupDialog",className:"e-group-field-settings",attrs:{"data-field":e,"data-type":t}}),o=(this.parentElement.appendChild(n),new pS({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("grouping"),content:this.createGroupOptions(e,t),isModal:!0,visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:300,height:"auto",position:{X:"center",Y:"center"},buttons:[{click:this.updateGroupSettings.bind(this,i),isFlat:!1,buttonModel:{cssClass:vlt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){o.hide()},isFlat:!1,buttonModel:{cssClass:blt+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:!0,close:this.removeDialog.bind(this),target:this.parentElement,cssClass:this.parent.cssClass}));o.isStringTemplate=!0,o.appendTo(n)},B0t.prototype.createGroupOptions=function(e,i){var n=this,o=this,t=Q("div",{className:"e-group-field-div-content",id:this.parentElement.id+"_group_field_div_content",attrs:{"data-fieldName":e,"data-type":i}}),r=Q("div",{className:"e-group-option-container"}),s=(t.appendChild(r),this.parent.dataSourceSettings),a=Hdt.getFieldByName(e,s.groupSettings);switch(i){case"custom":var l=void 0,h=(h=s.rows).concat(s.columns,s.values,s.filters),d=Hdt.getFieldByName(e.replace(/_custom_group/g,""),h),p=(je(d)&&!je(this.parent.clonedReport)&&(c=(c=(p=this.parent.clonedReport).rows).concat(p.columns,p.values,p.filters),d=Hdt.getFieldByName(e.replace(/_custom_group/g,""),c)),Hdt.getFieldByName(e,h)),c=Hdt.getFieldByName(e+"_custom_group",h),h=(p&&(l=c?c.caption:this.parent.engineModule.fieldList[d.name].caption+((e+"_custom_group").match(/_custom_group/g).length+1)),Q("div",{className:"e-caption-option-text"})),p=(h.innerText=this.parent.localeObj.getConstant("groupFieldCaption"),Q("div",{className:"e-group-caption-container"})),c=Q("input",{id:this.parentElement.id+"group_caption_option",className:"e-group-caption-text",attrs:{type:"text"}}),d=(p.appendChild(h),p.appendChild(c),r.appendChild(p),Q("div",{className:"e-input-option-text"})),h=(d.innerText=this.parent.localeObj.getConstant("groupTitle"),Q("div",{className:"e-group-input-container"})),p=Q("input",{id:this.parentElement.id+"group_input_option",className:"e-group-input-text",attrs:{type:"text"}}),d=(h.appendChild(d),h.appendChild(p),r.appendChild(h),new LR({placeholder:this.parent.localeObj.getConstant("captionName"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:l,width:"100%",cssClass:this.parent.cssClass})),h=(d.isStringTemplate=!0,d.appendTo(c),new LR({placeholder:this.parent.localeObj.getConstant("groupName"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,width:"100%",cssClass:this.parent.cssClass}));h.isStringTemplate=!0,h.appendTo(p);break;case"date":case"number":var u,g,m,f,l=Q("div",{className:"e-group-start-option-container"}),d=Q("input",{id:this.parentElement.id+"group_start_option",className:"e-group_start_option",attrs:{type:"checkbox"}}),c=Q("input",{id:this.parentElement.id+"group_start_input",className:"e-group_start_input",attrs:{type:"text"}}),h=(l.appendChild(d),l.appendChild(c),r.appendChild(l),Q("div",{className:"e-group-end-option-container"})),p=Q("input",{id:this.parentElement.id+"group_end_option",className:"e-group_end_option",attrs:{type:"checkbox"}}),l=Q("input",{id:this.parentElement.id+"group_end_input",className:"e-group_end_input",attrs:{type:"text"}}),h=(h.appendChild(p),h.appendChild(l),r.appendChild(h),Q("div",{className:"e-group-interval-option-container"})),y=Q("div",{className:"e-group-inerval-option-text"}),v=(y.innerText=this.parent.localeObj.getConstant("groupBy"),Q("input",{id:this.parentElement.id+"group_interval_input",className:"e-group_interval_input",attrs:{type:"text"}})),y=(h.appendChild(y),h.appendChild(v),r.appendChild(h),void 0),h=void 0,b=("date"===i?(f=[],g=[{value:"Seconds",text:this.parent.localeObj.getConstant("Seconds")},{value:"Minutes",text:this.parent.localeObj.getConstant("Minutes")},{value:"Hours",text:this.parent.localeObj.getConstant("Hours")},{value:"Days",text:this.parent.localeObj.getConstant("Days")},{value:"Months",text:this.parent.localeObj.getConstant("Months")},{value:"QuarterYear",text:this.parent.localeObj.getConstant("QuarterYear")},{value:"Quarters",text:this.parent.localeObj.getConstant("Quarters")},{value:"Years",text:this.parent.localeObj.getConstant("Years")}],a&&"Date"===a.type?(f=a.groupInterval,y=a.startingAt?a.startingAt.toString():void 0,h=a.endingAt?a.endingAt.toString():void 0):f=["Months"],(b=new jq({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,format:"dd/MM/yyyy hh:mm:ss a",enabled:!(void 0===y),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,b.appendTo(c),(m=new jq({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,format:"dd/MM/yyyy hh:mm:ss a",enabled:!(void 0===h),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,m.appendTo(l),zU.Inject(JU),(u=new zU({dataSource:g,value:f,fields:{text:"text",value:"value"},mode:"CheckBox",showDropDownIcon:!0,enableSelectionOrder:!1,placeholder:this.parent.localeObj.getConstant("selectGroup"),filterBarPlaceholder:this.parent.localeObj.getConstant("example")+" "+this.parent.localeObj.getConstant("Months"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,select:function(){K(ge("#"+o.parentElement.id+"_GroupDialog",document),pS).element.querySelector("."+vlt).removeAttribute("disabled")},removed:function(){var e=u.liCollections,t=0;e.forEach(function(e){e.classList.contains("e-active")&&t++}),0===t&&K(ge("#"+o.parentElement.id+"_GroupDialog",document),pS).element.querySelector("."+vlt).setAttribute("disabled","disabled")}})).isStringTemplate=!0,u.appendTo(v),b.value=void 0===y?null:new Date(y),b.dataBind(),m.value=void 0===h?null:new Date(h),m.dataBind()):(g=void 0,a&&"Number"===a.type?(g=a.rangeInterval,y=a.startingAt?a.startingAt.toString():void 0,h=a.endingAt?a.endingAt.toString():void 0):g=2,(b=new NL({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###.##########",value:void 0===y?void 0:parseFloat(y),enabled:!(void 0===y),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,b.appendTo(c),(m=new NL({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###.##########",value:void 0===h?void 0:parseFloat(h),enabled:!(void 0===h),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,m.appendTo(l),(f=new NL({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###.##########",min:0,value:g,width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,f.appendTo(v)),new ib({label:this.parent.localeObj.getConstant("startAt"),checked:!(void 0===y),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,change:function(e){var t=K(ge("#"+n.parentElement.id+"group_start_input"),"date"===i?jq:NL);t.enabled=e.checked,t.dataBind()}})),c=(b.isStringTemplate=!0,b.appendTo(d),new ib({label:this.parent.localeObj.getConstant("endAt"),checked:!(void 0===h),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,change:function(e){var t=K(ge("#"+n.parentElement.id+"group_end_input"),"date"===i?jq:NL);t.enabled=e.checked,t.dataBind()}}));c.isStringTemplate=!0,c.appendTo(p)}return t},B0t.prototype.updateGroupSettings=function(e){var t=K(ge("#"+this.parentElement.id+"_GroupDialog",document),pS),i=t.element,n=i.getAttribute("data-type"),o=i.getAttribute("data-field"),r=Hdt.cloneGroupSettings(this.parent.dataSourceSettings.groupSettings);if(0!==r.length||this.parent.clonedDataSet||this.parent.clonedReport||(i=this.parent.engineModule.data,this.parent.clonedDataSet="CSV"===this.parent.dataSourceSettings.type?Hdt.getClonedCSVData(i):Hdt.getClonedData(i),this.parent.setProperties({dataSourceSettings:{dataSource:[]}},!0),this.parent.clonedReport=Pe({},this.parent.dataSourceSettings,null,!0),this.parent.setProperties({dataSourceSettings:{dataSource:i}},!0)),"custom"===n){var i=K(ge("#"+this.parentElement.id+"group_input_option"),LR),s=K(ge("#"+this.parentElement.id+"group_caption_option"),LR);if(q([i.element],Nht),null===i.value||""===i.value)return U([i.element],Nht),void i.element.focus();for(var a=this.getSelectedOptions(e),l={groupName:i.value,items:a},h=[],d=[],p={name:o,caption:s.value,type:"Custom",customGroups:[]},c=!1,u=0,g=r.length;u<g;u++)if(r[u].name===o){(p=r[u]).caption=s.value;for(var m,f=0,y=p.customGroups.length;f<y;f++)p.customGroups[f]&&(m=p.customGroups[f]).items&&Jyt.isContainCommonElements(m.items,a)&&(h=this.mergeArray(h,[m.groupName]),d=this.mergeArray(d,m.items),p.customGroups.splice(f,1),f--,y--);for(var v=0,b=a;v<b.length;v++){var w=b[v],w=d.indexOf(w);-1!==w&&d.splice(w,1)}d=this.mergeArray(d,[l.groupName]),p.customGroups.push(l),c=this.isUpdate=!0;break}c||(p.customGroups.push(l),this.isUpdate=!0,r.push(p)),r=this.validateSettings(o,r,n,0===h.length?l.items:h,d)}else if("date"===n||"number"===n){var e=K(ge("#"+this.parentElement.id+"group_start_option"),ib),i=K(ge("#"+this.parentElement.id+"group_end_option"),ib),C=K(ge("#"+this.parentElement.id+"group_start_input"),"date"===n?jq:NL),S=K(ge("#"+this.parentElement.id+"group_end_input"),"date"===n?jq:NL),A=K(ge("#"+this.parentElement.id+"group_interval_input"),"date"===n?zU:NL),p={name:o,startingAt:e.checked?C.value.toString():void 0,endingAt:i.checked?S.value.toString():void 0};if("date"===n){for(var x=[],I=0,T=A.value;I<T.length;I++){var E=T[I];x.push(E)}p.type="Date",p.groupInterval=x}else p.type="Number",p.rangeInterval=A.value;for(c=!1,u=0,g=r.length;u<g;u++)if(r[u].name===o){r.splice(u,1,p),c=this.isUpdate=!0;break}c||(this.isUpdate=!0,r.push(p)),r=this.validateSettings(o,r,n,[],[])}t.close(),this.updateDateSource(r,n)},B0t.prototype.getGroupBasedSettings=function(e){for(var t={},i=0,n=e;i<n.length;i++){var o=n[i];t[o.type]?t[o.type].push(o):t[o.type]=[o]}return t},B0t.prototype.getGroupByName=function(e){for(var t={},i=0,n=e;i<n.length;i++){var o=n[i],r=o.name.replace(/_custom_group/g,"");t[r]?t[r].push(o):t[r]=[o]}return t},B0t.prototype.validateSettings=function(i,e,t,n,o){var r=[],s=this.getGroupBasedSettings(e),e=["Date","Number","Custom"];if(s[e[2]]&&"custom"===t){for(var a=this.getGroupByName(s[e[2]]),l=(a[i.replace(/_custom_group/g,"")]&&(c=(y=a[i.replace(/_custom_group/g,"")]).map(function(e){return e.name}),y=o?this.modifyParentGroupItems(i,y,n,o,c):this.removeGroupSettings(i.replace("_custom_group",""),n,y,c)),[]),h=0,d=Object.keys(a);h<d.length;h++)var p=d[h],c=a[p].map(function(e){return e.name}),l=this.reOrderSettings(a[p],c,l,p,i);s[e[2]]=l}else if(("date"===t||"number"===t)&&!o){n="date"===t?s[e[0]]:s[e[1]];if("date"===t){s[e[0]]=n.filter(function(e){return e.name!==i});var u=["_date_group_years","_date_group_quarters","_date_group_quarterYear","_date_group_months","_date_group_days","_date_group_hours","_date_group_minutes","_date_group_seconds"];if(0===s[e[0]].length){delete this.parent.engineModule.groupingFieldsInfo[i];var g=this;for(m in this.parent.engineModule.groupingFieldsInfo)!function(t){u.some(function(e){return t===""+i+e})&&delete g.parent.engineModule.groupingFieldsInfo[t]}(m);var m,f=this;for(m in this.parent.engineModule.fieldList)!function(t){u.some(function(e){return t===""+i+e})&&delete f.parent.engineModule.fieldList[t]}(m);var y=this.parent.engineModule.fields.filter(function(t){return!u.some(function(e){return t===""+i+e})});this.parent.engineModule.fields=y}}else s[e[1]]=n.filter(function(e){return e.name!==i});this.isUpdate=!0}for(var v=0,b=e;v<b.length;v++){var w=b[v];s[w]&&(r=r.concat(s[w]))}return r},B0t.prototype.reOrderSettings=function(e,t,i,n,o){var r=t.indexOf(n);return-1<r&&e[r].customGroups&&0<e[r].customGroups.length?(i.push(e[r]),this.reOrderSettings(e,t,i,n+"_custom_group")):-1<r&&e[r].customGroups&&0===e[r].customGroups.length&&!je(o)&&(delete this.parent.engineModule.fieldList[o],delete this.parent.engineModule.groupingFieldsInfo[o],t=this.parent.engineModule.fields.filter(function(e){return e!==o}),this.parent.engineModule.fields=t),i},B0t.prototype.modifyParentGroupItems=function(e,t,i,n,o){o=o.indexOf(e+"_custom_group");if(-1!==o){var r=t[o];if(r.customGroups&&0<r.customGroups.length)for(var s=0,a=r.customGroups.length;s<a;s++)if(r.customGroups[s]){var l=!1,h=r.customGroups[s];if(h.items){for(var d=0,p=i;d<p.length;d++){var c=p[d],c=h.items.indexOf(c);-1!==c&&(h.items.splice(c,1),l=this.isUpdate=!0)}l&&(h.items=this.mergeArray(h.items,n))}}}return t},B0t.prototype.mergeArray=function(e,t){for(var i=[],n=e.concat(t),o=n.length,r={};o--;){var s=String(n[o]);r[s]||(i.unshift(s),r[s]=!0)}return i},B0t.prototype.removeDialog=function(){var e;this.parent.grid&&this.parent.grid.isDestroyed||je(this.parent.grid)||(this.parent.grid.clearSelection(),(e=(e=ge("#"+this.parent.element.id+"_GroupDialog",document))?K(e,pS):null)&&!e.isDestroyed&&e.destroy(),this.parent.element&&document.getElementById(this.parent.element.id+"_GroupDialog")&&ue(document.getElementById(this.parent.element.id+"_GroupDialog")))},B0t.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Ect,this.render,this)},B0t.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.removeDialog(),this.parent.off(Ect,this.render))},B0t.prototype.destroy=function(){this.removeEventListener()};Qmt=B0t;function B0t(e){this.dateGroup=/_date_group_years|_date_group_quarters|_date_group_quarterYear|_date_group_months|_date_group_days|_date_group_hours|_date_group_minutes|_date_group_seconds/g,this.parent=e,(this.parent.groupingModule=this).addEventListener()}Xyt.Inject(nft,Gmt,i0,X$e,mmt,bmt,d$,Cmt,Cft,Mft,zmt,Qmt,d),f0t.Inject(i0);function F0t(e){switch(e.type){case"Linear":return W0t;case"Radial":return q0t;default:return W0t}}function L0t(e,t,i,n){this.left=e,this.right=t,this.top=i,this.bottom=n}var R0t,O0t,zft=Object.freeze({__proto__:null,GroupingBarSettings:hft,CellEditSettings:cft,ConditionalSettings:mft,HyperlinkSettings:vft,PageSettings:Rft,PagerSettings:Tft,DisplayOption:Vft,VirtualScrollSettings:Bft,PivotView:Xyt,Render:ugt,ExcelExport:Mft,PDFExport:Cft,KeyboardInteraction:pmt,VirtualScroll:mmt,DrillThrough:bmt,Pager:d,PivotChart:Cmt,PivotFieldList:f0t,TreeViewRenderer:o0t,AxisFieldRenderer:d0t,AxisTableRenderer:s0t,DialogRenderer:i0t,EventBase:ygt,NodeStateModified:bgt,DataSourceUpdate:Cgt,FieldList:Gmt,CommonKeyboardInteraction:mgt,Common:Mgt,GroupingBar:nft,CalculatedField:i0,ConditionalFormatting:X$e,PivotCommon:Egt,load:"load",enginePopulating:Udt,enginePopulated:qdt,onFieldDropped:Gdt,fieldDrop:Ydt,beforePivotTableRender:"beforePivotTableRender",afterPivotTableRender:"afterPivotTableRender",beforeExport:Xdt,exportComplete:Kdt,excelHeaderQueryCellInfo:Jdt,pdfHeaderQueryCellInfo:Zdt,excelQueryCellInfo:$dt,pdfQueryCellInfo:ept,onPdfCellRender:tpt,dataBound:ipt,queryCellInfo:npt,headerCellInfo:opt,hyperlinkCellClick:rpt,resizing:"resizing",resizeStop:spt,cellClick:"cellClick",drillThrough:apt,beforeColumnsRender:lpt,selected:"selected",selecting:"selecting",cellSelecting:hpt,drill:dpt,cellSelected:ppt,cellDeselected:cpt,rowSelected:upt,rowDeselected:gpt,beginDrillThrough:mpt,editCompleted:fpt,multiLevelLabelClick:ypt,saveReport:vpt,fetchReport:bpt,loadReport:wpt,renameReport:Cpt,removeReport:Spt,newReport:Apt,toolbarRender:xpt,toolbarClick:Ipt,chartTooltipRender:Tpt,chartLegendClick:Ept,chartLoaded:Dpt,multiLevelLabelRender:Mpt,beforePrint:kpt,animationComplete:Ppt,legendRender:Bpt,textRender:Fpt,pointRender:Lpt,seriesRender:Rpt,chartMouseMove:Opt,chartMouseClick:Npt,pointMove:"pointMove",chartMouseLeave:Vpt,chartMouseDown:_pt,chartMouseUp:Hpt,dragComplete:zpt,zoomComplete:jpt,scrollStart:Wpt,scrollEnd:"scrollEnd",scrollChanged:Qpt,chartLoad:"chartLoad",chartResized:Upt,chartAxisLabelRender:qpt,chartSeriesCreated:Gpt,aggregateCellInfo:Ypt,onHeadersSort:Xpt,contextMenuClick:Kpt,contextMenuOpen:Jpt,fieldListRefreshed:Zpt,conditionalFormatting:$pt,beforePdfExport:"beforePdfExport",beforeExcelExport:ect,memberFiltering:tct,calculatedFieldCreate:ict,memberEditorOpen:nct,fieldRemove:oct,numberFormatting:rct,aggregateMenuOpen:sct,fieldDragStart:act,chartPointClick:lct,beforeServiceInvoke:hct,afterServiceInvoke:dct,actionBegin:pct,actionComplete:cct,actionFailure:uct,initialLoad:gct,uiUpdate:mct,scroll:"scroll",verticalScroll:fct,horizontalScroll:yct,contentReady:vct,dataReady:bct,initSubComponent:wct,treeViewUpdate:Cct,pivotButtonUpdate:Sct,initCalculatedField:Act,click:"click",initToolbar:xct,initPivotPager:Ict,initFormatting:Tct,initGrouping:Ect,sortValue:Dct,drillUp:"Drill up",drillDown:Mct,addNewReport:kct,saveCurrentReport:Pct,saveAsCurrentReport:Bct,renameCurrentReport:Fct,removeCurrentReport:Lct,loadReports:Rct,openConditionalFormatting:Oct,openNumberFormatting:Nct,MdxQuery:"MdxQuery",showFieldList:Vct,tableView:_ct,chartView:Hct,multipleAxis:zct,showLegend:jct,pdfExport:Wct,pngExport:Qct,excelExport:Uct,csvExport:qct,jpegExport:Gct,svgExport:Yct,hideSubTotals:Xct,subTotalsRow:Kct,subTotalsColumn:Jct,showSubTotals:Zct,hideGrandTotals:$ct,grandTotalsRow:eut,grandTotalsColumn:tut,showGrandTotals:iut,numberFormattingMenu:nut,conditionalFormattingMenu:out,reportChange:rut,sortFieldTree:sut,editCalculatedField:aut,sortField:lut,filterField:hut,removeField:dut,openCalculatedField:put,editRecord:cut,saveEditedRecords:uut,addNewRecord:gut,removeRecord:mut,aggregateField:fut,contextMenuCalculatedField:"CalculatedField Context menu",windowResize:yut,rowPageNavigation:vut,columnPageNavigation:but,calculatedFieldApplied:wut,editedRecordsSaved:Cut,newRecordAdded:Sut,recordRemoved:Aut,closeFieldlist:xut,fieldTreeSorted:Iut,reportSaved:Tut,newReportAdded:Eut,reportReSaved:Dut,reportRenamed:Mut,reportRemoved:kut,excelExported:Put,csvExported:But,pdfExported:Fut,pngExported:Lut,jpegExported:Rut,svgExported:Out,conditionallyFormatted:Nut,numberFormatted:Vut,tableViewed:_ut,chartViewed:Hut,subTotalsHidden:zut,subTotalsRowShown:jut,subTotalsColumnShown:Wut,subTotalsShown:Qut,grandTotalsHidden:Uut,grandTotalsRowShown:qut,grandTotalsColumnShown:Gut,grandTotalsShown:Yut,valueSorted:Xut,calculatedFieldEdited:Kut,fieldSorted:Jut,fieldFiltered:Zut,fieldRemoved:$ut,fieldAggregated:egt,recordEdited:tgt,reportChanged:igt,windowResized:ngt,recordUpdated:ogt,drillThroughClosed:rgt,verticalScrolled:sgt,horizontalScrolled:agt,rowPageNavigated:lgt,columnPageNavigated:hgt,actionDropped:dgt,axisLabelFont:Z$e,axisTitleFont:Wo,chartTitleFont:{size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},chartSubTitleFont:{size:"11px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},crosshairLabelFont:Met,tooltipLabelFont:Cet,legendLabelFont:N$e,stripLineLabelFont:ts,stockEventFont:{size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},ErrorDialog:Agt,FilterDialog:Igt,PivotContextMenu:umt,AggregateMenu:pgt,Toolbar:d$,NumberFormatting:zmt,Grouping:Qmt,PivotEngine:Wdt,PivotUtil:Hdt,OlapEngine:Iyt,MDXQuery:Ayt,FieldOptions:ost,FieldListFieldOptions:jee,Style:Xet,Filter:det,ConditionalFormatSettings:q$e,Sort:W$e,FormatSettings:Det,GroupSettings:h,CustomGroups:wce,CalculatedFieldSettings:tte,DrillOptions:pJ,ValueSortSettings:P$e,Authentication:H$e,DataSourceSettings:set}),tn=(R0t=function(e,t){return(R0t=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])}))(e,t)},function(e,t){function i(){this.constructor=e}R0t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Kmt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Vmt=(tn(N0t,O0t=n),Kmt([e(0)],N0t.prototype,"left",void 0),Kmt([e(0)],N0t.prototype,"right",void 0),Kmt([e(0)],N0t.prototype,"top",void 0),Kmt([e(0)],N0t.prototype,"bottom",void 0),N0t);function N0t(){return null!==O0t&&O0t.apply(this,arguments)||this}tn(_0t,V0t=n),_0t.prototype.getClassName=function(){return"Stop"},Kmt([e("")],_0t.prototype,"color",void 0),Kmt([e(0)],_0t.prototype,"offset",void 0),Kmt([e(1)],_0t.prototype,"opacity",void 0);var V0t,o=_0t;function _0t(){return null!==V0t&&V0t.apply(this,arguments)||this}tn(z0t,H0t=n),Kmt([kt([],o)],z0t.prototype,"stops",void 0),Kmt([e("None")],z0t.prototype,"type",void 0),Kmt([e("")],z0t.prototype,"id",void 0);var H0t,Rmt=z0t;function z0t(){return null!==H0t&&H0t.apply(this,arguments)||this}tn(Q0t,j0t=Rmt),Kmt([e(0)],Q0t.prototype,"x1",void 0),Kmt([e(0)],Q0t.prototype,"x2",void 0),Kmt([e(0)],Q0t.prototype,"y1",void 0),Kmt([e(0)],Q0t.prototype,"y2",void 0);var j0t,W0t=Q0t;function Q0t(){return null!==j0t&&j0t.apply(this,arguments)||this}tn(G0t,U0t=Rmt),Kmt([e(0)],G0t.prototype,"cx",void 0),Kmt([e(0)],G0t.prototype,"cy",void 0),Kmt([e(0)],G0t.prototype,"fx",void 0),Kmt([e(0)],G0t.prototype,"fy",void 0),Kmt([e(50)],G0t.prototype,"r",void 0);var U0t,q0t=G0t;function G0t(){return null!==U0t&&U0t.apply(this,arguments)||this}tn(X0t,Y0t=n),Kmt([e("white")],X0t.prototype,"fill",void 0),Kmt([e("black")],X0t.prototype,"strokeColor",void 0),Kmt([e("")],X0t.prototype,"strokeDashArray",void 0),Kmt([e(1)],X0t.prototype,"strokeWidth",void 0),Kmt([e(1)],X0t.prototype,"opacity",void 0),Kmt([Mt(F0t)],X0t.prototype,"gradient",void 0);var Y0t,Vee=X0t;function X0t(){return null!==Y0t&&Y0t.apply(this,arguments)||this}tn(Z0t,K0t=Vee),Kmt([e("transparent")],Z0t.prototype,"fill",void 0);var K0t,J0t=Z0t;function Z0t(){return null!==K0t&&K0t.apply(this,arguments)||this}tn(svt,$0t=Vee),Kmt([e("black")],svt.prototype,"color",void 0),Kmt([e("Arial")],svt.prototype,"fontFamily",void 0),Kmt([e(12)],svt.prototype,"fontSize",void 0),Kmt([e(!1)],svt.prototype,"italic",void 0),Kmt([e(!1)],svt.prototype,"bold",void 0),Kmt([e("CollapseSpace")],svt.prototype,"whiteSpace",void 0),Kmt([e("WrapWithOverflow")],svt.prototype,"textWrapping",void 0),Kmt([e("Center")],svt.prototype,"textAlign",void 0),Kmt([e("None")],svt.prototype,"textDecoration",void 0),Kmt([e("Wrap")],svt.prototype,"textOverflow",void 0),Kmt([e("transparent")],svt.prototype,"fill",void 0);var $0t,evt,tvt,ivt,nvt,ovt,rvt,est=svt;function svt(){return null!==$0t&&$0t.apply(this,arguments)||this}(sft=evt=evt||{})[sft.Self=1]="Self",sft[sft.Parent=2]="Parent",(ist=tvt=tvt||{})[ist.None=0]="None",ist[ist.ElementIsPort=2]="ElementIsPort",ist[ist.ElementIsGroup=4]="ElementIsGroup",(hft=ivt=ivt||{})[hft.None=1]="None",hft[hft.Select=2]="Select",hft[hft.Delete=4]="Delete",hft[hft.Drag=8]="Drag",hft[hft.DragSourceEnd=16]="DragSourceEnd",hft[hft.DragTargetEnd=32]="DragTargetEnd",hft[hft.DragSegmentThumb=64]="DragSegmentThumb",hft[hft.AllowDrop=128]="AllowDrop",hft[hft.Bridging=256]="Bridging",hft[hft.BridgeObstacle=512]="BridgeObstacle",hft[hft.InheritBridging=1024]="InheritBridging",hft[hft.PointerEvents=2048]="PointerEvents",hft[hft.Tooltip=4096]="Tooltip",hft[hft.InheritTooltip=8192]="InheritTooltip",hft[hft.Interaction=4218]="Interaction",hft[hft.ReadOnly=16384]="ReadOnly",hft[hft.Default=11838]="Default",(cft=nvt=nvt||{})[cft.Rotate=2]="Rotate",cft[cft.ConnectorSource=4]="ConnectorSource",cft[cft.ConnectorTarget=8]="ConnectorTarget",cft[cft.ResizeNorthEast=16]="ResizeNorthEast",cft[cft.ResizeEast=32]="ResizeEast",cft[cft.ResizeSouthEast=64]="ResizeSouthEast",cft[cft.ResizeSouth=128]="ResizeSouth",cft[cft.ResizeSouthWest=256]="ResizeSouthWest",cft[cft.ResizeWest=512]="ResizeWest",cft[cft.ResizeNorthWest=1024]="ResizeNorthWest",cft[cft.ResizeNorth=2048]="ResizeNorth",cft[cft.Default=4094]="Default",(mft=ovt=ovt||{})[mft.None=1]="None",mft[mft.ConnectorSourceThumb=2]="ConnectorSourceThumb",mft[mft.ConnectorTargetThumb=4]="ConnectorTargetThumb",mft[mft.ResizeSouthEast=8]="ResizeSouthEast",mft[mft.ResizeSouthWest=16]="ResizeSouthWest",mft[mft.ResizeNorthEast=32]="ResizeNorthEast",mft[mft.ResizeNorthWest=64]="ResizeNorthWest",mft[mft.ResizeEast=128]="ResizeEast",mft[mft.ResizeWest=256]="ResizeWest",mft[mft.ResizeSouth=512]="ResizeSouth",mft[mft.ResizeNorth=1024]="ResizeNorth",mft[mft.Rotate=2048]="Rotate",mft[mft.UserHandle=4096]="UserHandle",mft[mft.ToolTip=8192]="ToolTip",mft[mft.ResizeAll=2046]="ResizeAll",mft[mft.All=16382]="All",(vft=rvt=rvt||{})[vft.Zero=0]="Zero",vft[vft.One=1]="One",vft[vft.Two=2]="Two",vft[vft.Three=3]="Three",vft[vft.Four=4]="Four",vft[vft.Five=5]="Five";lvt.prototype.clone=function(){return new lvt(this.width,this.height)};var avt=lvt;function lvt(e,t){this.width=e,this.height=t}Object.defineProperty(pvt.prototype,"left",{get:function(){return this.x},enumerable:!0,configurable:!0}),Object.defineProperty(pvt.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(pvt.prototype,"top",{get:function(){return this.y},enumerable:!0,configurable:!0}),Object.defineProperty(pvt.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),Object.defineProperty(pvt.prototype,"topLeft",{get:function(){return{x:this.left,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(pvt.prototype,"topRight",{get:function(){return{x:this.right,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(pvt.prototype,"bottomLeft",{get:function(){return{x:this.left,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(pvt.prototype,"bottomRight",{get:function(){return{x:this.right,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(pvt.prototype,"middleLeft",{get:function(){return{x:this.left,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),Object.defineProperty(pvt.prototype,"middleRight",{get:function(){return{x:this.right,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),Object.defineProperty(pvt.prototype,"topCenter",{get:function(){return{x:this.x+this.width/2,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(pvt.prototype,"bottomCenter",{get:function(){return{x:this.x+this.width/2,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(pvt.prototype,"center",{get:function(){return{x:this.x+this.width/2,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),pvt.prototype.equals=function(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},pvt.prototype.uniteRect=function(e){var t=Math.max((Number.NaN===this.right||this.x===Number.MAX_VALUE?e:this).right,e.right),i=Math.max((Number.NaN===this.bottom||this.y===Number.MAX_VALUE?e:this).bottom,e.bottom);return this.x=Math.min(this.left,e.left),this.y=Math.min(this.top,e.top),this.width=t-this.x,this.height=i-this.y,this},pvt.prototype.unitePoint=function(e){var t,i,n;this.x===Number.MAX_VALUE?(this.x=e.x,this.y=e.y):(t=Math.min(this.left,e.x),i=Math.min(this.top,e.y),n=Math.max(this.right,e.x),e=Math.max(this.bottom,e.y),this.x=t,this.y=i,this.width=n-this.x,this.height=e-this.y)},pvt.prototype.intersection=function(e){var t,i;return this.intersects(e)?new pvt(t=Math.max(this.left,e.left),i=Math.max(this.top,e.top),Math.min(this.right,e.right)-t,Math.min(this.bottom,e.bottom)-i):pvt.empty},pvt.prototype.Inflate=function(e){return this.x-=e,this.y-=e,this.width+=2*e,this.height+=2*e,this},pvt.prototype.intersects=function(e){return!(this.right<e.left||this.left>e.right||this.top>e.bottom||this.bottom<e.top)},pvt.prototype.containsRect=function(e){return this.left<=e.left&&this.right>=e.right&&this.top<=e.top&&this.bottom>=e.bottom},pvt.prototype.containsPoint=function(e,t){return this.left-(t=void 0===t?0:t)<=e.x&&this.right+t>=e.x&&this.top-t<=e.y&&this.bottom+t>=e.y},pvt.prototype.toPoints=function(){var e=[];return e.push(this.topLeft),e.push(this.topRight),e.push(this.bottomLeft),e.push(this.bottomRight),e},pvt.toBounds=function(e){for(var t=new pvt,i=0,n=e;i<n.length;i++){var o=n[i];t.unitePoint(o)}return t},pvt.prototype.scale=function(e,t){this.width*=e,this.height*=t},pvt.prototype.offset=function(e,t){this.x+=e,this.y+=t},pvt.empty=new pvt(Number.MAX_VALUE,Number.MIN_VALUE,0,0);var hvt,dvt=pvt;function pvt(e,t,i,n){this.x=Number.MAX_VALUE,this.y=Number.MAX_VALUE,this.width=0,void(this.height=0)===e||void 0===t?(e=t=Number.MAX_VALUE,i=n=0):(void 0===i&&(i=0),void 0===n&&(n=0)),this.x=e,this.y=t,this.width=i,this.height=n}(Rft=hvt=hvt||{})[Rft.Identity=0]="Identity",Rft[Rft.Translation=1]="Translation",Rft[Rft.Scaling=2]="Scaling",Rft[Rft.Unknown=4]="Unknown";var cvt=function(e,t,i,n,o,r,s){this.m11=e,this.m12=t,this.m21=i,this.m22=n,this.offsetX=o,this.offsetY=r,this.type=s};function uvt(){return new cvt(1,0,0,1,0,0,hvt.Identity)}function gvt(e,t){e=function(e,t,i){switch(e.type){case hvt.Identity:break;case hvt.Translation:t+=e.offsetX,i+=e.offsetY;break;case hvt.Scaling:t*=e.m11,i*=e.m22;break;case hvt.Translation|hvt.Scaling:t=(t*=e.m11)+e.offsetX,i=(i*=e.m22)+e.offsetY;break;default:var n=i*e.m21+e.offsetX,o=t*e.m12+e.offsetY;t=(t*=e.m11)+n,i=(i*=e.m22)+o}return{x:t,y:i}}(e,t.x,t.y);return{x:Math.round(100*e.x)/100,y:Math.round(100*e.y)/100}}function mvt(e,t,i,n){var o,r;yvt(e,(e=.017453292519943295*(t%=360),t=i||0,i=n||0,n=uvt(),o=Math.sin(e),e=Math.cos(e),r=t*(1-e)+i*o,i=i*(1-e)-t*o,n.type=hvt.Unknown,vvt(n,e,o,-o,e,r,i),n))}function fvt(e,t,i,n,o){yvt(e,(e=t,t=i,i=n=void 0===n?0:n,n=o=void 0===o?0:o,(o=uvt()).type=i||n?hvt.Scaling|hvt.Translation:hvt.Scaling,vvt(o,e,0,0,t,i-e*i,n-t*n),o))}function yvt(e,t){var i=e.type,n=t.type;if(n!==hvt.Identity)if(i===hvt.Identity)bvt(e,t),e.type=t.type;else if(n===hvt.Translation)e.offsetX+=t.offsetX,e.offsetY+=t.offsetY,i!==hvt.Unknown&&(e.type|=hvt.Translation);else if(i!==hvt.Translation){var o=i<<4|n;switch(o){case 34:return e.m11*=t.m11,void(e.m22*=t.m22);case 35:return e.m11*=t.m11,e.m22*=t.m22,e.offsetX=t.offsetX,e.offsetY=t.offsetY,void(e.type=hvt.Translation|hvt.Scaling);case 36:break;default:switch(o){case 50:return e.m11*=t.m11,e.m22*=t.m22,e.offsetX*=t.m11,void(e.offsetY*=t.m22);case 51:return e.m11*=t.m11,e.m22*=t.m22,e.offsetX=t.m11*e.offsetX+t.offsetX,void(e.offsetY=t.m22*e.offsetY+t.offsetY);case 52:break;default:switch(o){case 66:case 67:case 68:break;default:return}}}i=uvt();vvt(i,e.m11*t.m11+e.m12*t.m21,e.m11*t.m12+e.m12*t.m22,e.m21*t.m11+e.m22*t.m21,e.m21*t.m12+e.m22*t.m22,e.offsetX*t.m11+e.offsetY*t.m21+t.offsetX,e.offsetX*t.m12+e.offsetY*t.m22+t.offsetY),i.m21||i.m12?i.type=hvt.Unknown:((i.m11&&1!==i.m11||i.m22&&1!==i.m22)&&(i.type=hvt.Scaling),(i.offsetX||i.offsetY)&&(i.type|=hvt.Translation),(i.type&(hvt.Translation|hvt.Scaling))===hvt.Identity&&(i.type=hvt.Identity),i.type=hvt.Scaling|hvt.Translation),bvt(e,i),e.type=i.type}else{var i=e.offsetX,r=e.offsetY;e.offsetX=i*t.m11+r*t.m21+t.offsetX,e.offsetY=i*t.m12+r*t.m22+t.offsetY,n===hvt.Unknown?e.type=hvt.Unknown:e.type=hvt.Translation|hvt.Scaling}}function vvt(e,t,i,n,o,r,s){e.m11=t,e.m12=i,e.m21=n,e.m22=o,e.offsetX=r,e.offsetY=s}function bvt(e,t){e.m11=t.m11,e.m12=t.m12,e.m21=t.m21,e.m22=t.m22,e.offsetX=t.offsetX,e.offsetY=t.offsetY,e.type=t.type}function wvt(e){var t,i=[];if("msie"===F.info.name||"edge"===F.info.name)for(var n=0;n<e.childNodes.length;n++)1===(t=e.childNodes[parseInt(n.toString(),10)]).nodeType&&i.push(t);else i=e.children;return i}function Cvt(e){var t,i,n,o="pathTable";return window[o]||(window[o]={}),e?(t="measureElement",window[t].style.visibility="visible",i=void(n=wvt(window[t].children[2])[0]).setAttribute("d",e),window[o][e]?i=window[o][e]:(window[o][e]=i=n.getBBox(),0!==i.x&&0!==i.y||0!==i.width&&0!==i.height||(window[o][e]=i=function(e){var t,i=0,n=0,o=0,r=0,s=e;s=s.replace(/[a-z].*/g," ").replace(/[\sA-Z]+/gi," ").trim().split(" ");for(var a=0;a<s.length;a++)1<s[parseInt(a.toString(),10)].length&&(t=s[parseInt(a.toString(),10)].split(","),i=n=t[0],o=r=t[1]);for(a=0;a<s.length;a++)(t=s[parseInt(a.toString(),10)].split(","))[1]||(t[0]=i,t[1]=o),i=Math.min(i,t[0]),n=Math.max(n,t[0]),o=Math.min(o,t[1]),r=Math.max(r,t[1]);return{x:i,y:o,width:n-i,height:r-o}}(e))),n=new dvt(i.x,i.y,i.width,i.height),window[t].style.visibility="hidden",n):new dvt(0,0,0,0)}function Svt(e,t,i,n){var o,r,s=[],a=0,l=t||e.content;if("nowrap"!==e.whiteSpace&&"pre"!==e.whiteSpace)if("breakall"===e.breakWord)for(o="",o+=l[0],a=0;a<l.length;a++)(r=Ovt(o,e))>=e.width&&0<o.length?(s[s.length]={text:o,x:0,dy:0,width:r},o=""):(r=Ovt(o+=l[a+1]||"",e),(Math.ceil(r)+2>=e.width&&0<o.length||-1<o.indexOf("\n"))&&(s[s.length]={text:o,x:0,dy:0,width:r},o=""),a===l.length-1&&0<o.length&&(s[s.length]={text:o,x:0,dy:0,width:r},o=""));else s=function(e,t,i,n){var o,r,s,a,l=[],h="",d=0,p=0,c="nowrap"!==e.whiteSpace,u=(t||e.content).split("\n");for(d=0;d<u.length;d++)for(o="NoWrap"!==e.textWrapping?u[parseInt(d.toString(),10)].split(" "):u,p=0;p<o.length;p++){var g;Ovt(o[parseInt(p.toString(),10)],e)>e.width&&0<o[parseInt(p.toString(),10)].length&&"NoWrap"!==e.textWrapping?(1<u.length&&(o[parseInt(p.toString(),10)]=o[parseInt(p.toString(),10)]+"\n"),e.content=o[parseInt(p.toString(),10)],l=function(e,t,i,n,o){var r,s,a=0,l=t||e.content,h=(r="",e.y),d=0;for(r+=l[0],a=0;a<l.length;a++){var p;(p=Ovt(r,e))>=e.width&&0<r.length?(i[i.length]={text:r,x:0,dy:0,width:p},r=""):(p=Ovt(r+=l[a+1]||"",e),(Math.ceil(p)+2>=e.width&&0<r.length||-1<r.indexOf("\n"))&&(r=r.slice(0,-1),d+=Nvt(r,e),h+=d,p=Ovt(r,e),(s=(null==n||d<=n)&&(null==o||h<=o))&&(i[i.length]={text:r,x:0,dy:0,width:p}),r=l[a+1]||"",h+=d),s=(null==n||d<=n)&&(null==o||h<=o),a===l.length-1&&0<r.length&&s&&(i[i.length]={text:r,x:0,dy:0,width:p},r=""))}return i}(e,h,l,i,n)):(h+=((0!==p||1===o.length)&&c&&0<h.length?" ":"")+o[parseInt(p.toString(),10)],g=Ovt(r=h+(o[p+1]||""),e),1<u.length&&p===o.length-1&&(h+="\n"),Math.floor(g)>e.width-2&&0<h.length?(t=h,l[l.length]={text:-1===h.indexOf("\n")&&p!==o.length-1?h+" ":t,x:0,dy:0,width:r===h?g:h===a?s:Ovt(h,e)},h=""):p===o.length-1&&(l[l.length]={text:h,x:0,dy:0,width:g},h=""),a=r,s=g)}return l}(e,t,i,n);else s[s.length]={text:l,x:0,dy:0,width:Ovt(l,e)};return s}function Avt(e,t,i,n,o,r,s){var a,l=new avt(0,0),h=(a=n,(a={fill:(h=e).style.fill,stroke:h.style.strokeColor,angle:h.rotateAngle+h.parentTransform,pivotX:h.pivot.x,pivotY:h.pivot.y,strokeWidth:h.style.strokeWidth,dashArray:h.style.strokeDashArray,opacity:h.style.opacity,visible:h.visible,id:h.id,width:a||h.actualSize.width,height:h.actualSize.height,x:h.offsetX-h.actualSize.width*h.pivot.x+.5,y:h.offsetY-h.actualSize.height*h.pivot.y+.5}).fontSize=h.style.fontSize,a.fontFamily=h.style.fontFamily,a.textOverflow=h.style.textOverflow,a.textDecoration=h.style.textDecoration,a.doWrap=h.doWrap,a.whiteSpace=Vvt(h.style.whiteSpace,h.style.textWrapping),a.content=h.content,a.textWrapping=h.style.textWrapping,a.breakWord=Rvt(h.style.textWrapping),a.textAlign=Lvt(h.style.textAlign),a.color=h.style.color,a.italic=h.style.italic,a.bold=h.style.bold,a.dashArray="",a.strokeWidth=0,a.fill="",a);return e.childNodes=a=Svt(h,s,o,r),e.wrapBounds=s=function(e,t){for(var i,n,o={x:0,width:0},r=0,r=0;r<t.length;r++)n=i=t[parseInt(r.toString(),10)].width,i="left"===e.textAlign?0:"center"===e.textAlign?i>e.width&&("Ellipsis"===e.textOverflow||"Clip"===e.textOverflow)?0:-i/2:"right"===e.textAlign?-i:1<t.length?0:-i/2,t[parseInt(r.toString(),10)].dy=1.2*e.fontSize,t[parseInt(r.toString(),10)].x=i,o?(o.x=Math.min(o.x,i),o.width=Math.max(o.width,n)):o={x:i,width:n};return o}(h,a),l.width=s.width,e.wrapBounds.width>=n&&"Wrap"!==h.textOverflow&&(l.width=n),l.height=a.length*e.style.fontSize*1.2,l}function xvt(e,t){var i;return(i=t&&"undefined"!=typeof document?document.getElementById(t):i)?i.querySelector("#"+e):"undefined"!=typeof document?document.getElementById(e):null}function Ivt(e,t){e=Q(e);return Tvt(e,t),e}function Tvt(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++)"style"===i[parseInt(n.toString(),10)]?e.style.cssText=t[i[parseInt(n.toString(),10)]]:e.setAttribute(i[parseInt(n.toString(),10)],t[i[parseInt(n.toString(),10)]])}function Evt(e,t){var i=null,e=xvt(e+t+"_diagramAdornerLayer");return i=e?e.getElementsByClassName("e-adorner-layer"+t)[0]:i}function Dvt(){var e,t,i,n="measureElement";window[n]?window[n].usageCount+=1:(e=Ivt("div",{id:"measureElement",style:"visibility:hidden ; height: 0px ; width: 0px; overflow: hidden;"}),i=Ivt("span",{style:"display:inline-block ; line-height: normal"}),i=void e.appendChild(i),i=Ivt("img",{}),e.appendChild(i),"undefined"!=typeof document&&((i=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("xlink","http://www.w3.org/1999/xlink"),e.appendChild(i),t=document.createElementNS("http://www.w3.org/2000/svg","path"),i.appendChild(t),document.createTextNode(""),(t=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.appendChild(t),window[n]=e,window[n].usageCount=1,document.body.appendChild(e)))}function Mvt(e,t){var i="measureElement",n=(window[i].style.visibility="visible",window[i].children[1]),e=(n.setAttribute("src",e),n.getBoundingClientRect()),n=e.width,e=e.height;return t=new avt(n,e),window[i].style.visibility="hidden",t}function kvt(){for(var e,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",i="",n=0;n<5;n++)e="crypto"in window&&"getRandomValues"in crypto?(e=new Uint16Array(1),(window.msCrypto||window.crypto).getRandomValues(e)[0]%(t.length-1)):Math.floor(Math.random()*t.length),0===n&&e<10?n--:i+=t.substring(e,e+1);return i}function Pvt(e){new dvt;var t=e.offsetY-e.actualSize.height*e.pivot.y,i=e.offsetY+e.actualSize.height*(1-e.pivot.y),n=e.offsetX-e.actualSize.width*e.pivot.x,e=e.offsetX+e.actualSize.width*(1-e.pivot.x);return dvt.toBounds([{x:n,y:t},{x:e,y:t},{x:n,y:i},{x:e,y:i}])}function Bvt(e,t){var i=uvt(),t=(mvt(i,t,0,0),gvt(i,{x:0,y:0})),n=gvt(i,{x:e.width,y:0}),o=gvt(i,{x:0,y:e.height}),i=gvt(i,{x:e.width,y:e.height}),e=Math.min(t.x,n.x,o.x,i.x),r=Math.min(t.y,n.y,o.y,i.y),s=Math.max(t.x,n.x,o.x,i.x),t=Math.max(t.y,n.y,o.y,i.y);return new avt(s-e,t-r)}function Fvt(e){new dvt;var t,i=Pvt(e),n=i.middleLeft,o=i.topCenter,r=i.bottomCenter,s=i.middleRight,a=i.topLeft,l=i.topRight,h=i.bottomLeft,i=i.bottomRight;return e.corners={topLeft:a,topCenter:o,topRight:l,middleLeft:n,middleRight:s,bottomLeft:h,bottomCenter:r,bottomRight:i},0===e.rotateAngle&&0===e.parentTransform||(mvt(t=uvt(),e.rotateAngle+e.parentTransform,e.offsetX,e.offsetY),e.corners.topLeft=a=gvt(t,a),e.corners.topCenter=gvt(t,o),e.corners.topRight=l=gvt(t,l),e.corners.middleLeft=gvt(t,n),e.corners.middleRight=gvt(t,s),e.corners.bottomLeft=h=gvt(t,h),e.corners.bottomCenter=gvt(t,r),e.corners.bottomRight=i=gvt(t,i)),o=dvt.toBounds([a,l,h,i]),e.corners.left=o.left,e.corners.right=o.right,e.corners.top=o.top,e.corners.bottom=o.bottom,e.corners.center=o.center,e.corners.width=o.width,e.corners.height=o.height,o}function Lvt(e){var t="";switch(e){case"Center":t="center";break;case"Left":t="left";break;case"Right":t="right"}return t}function Rvt(e){var t="";switch(e){case"Wrap":t="breakall";break;case"NoWrap":t="keepall";break;case"WrapWithOverflow":t="normal";break;case"LineThrough":t="line-through"}return t}function Ovt(e,t){var i="measureElement";window[i].style.visibility="visible";var n=wvt(window[i].children[2])[1],e=(n.textContent=e,n.setAttribute("style","font-size:"+t.fontSize+"px; font-family:"+t.fontFamily+";font-weight:"+(t.bold?"bold":"normal")),n.getBBox().width);return window[i].style.visibility="hidden",e}function Nvt(e,t){var i="measureElement";window[i].style.visibility="visible";var n=wvt(window[i].children[2])[1],e=(n.textContent=e,n.setAttribute("style","font-size:"+t.fontSize+"px; font-family:"+t.fontFamily+";font-weight:"+(t.bold?"bold":"normal")),n.getBBox().height);return window[i].style.visibility="hidden",e}function Vvt(e,t){if("NoWrap"===t&&"PreserveAll"===e)return"pre";var i="";switch(e){case"CollapseAll":i="nowrap";break;case"CollapseSpace":i="pre-line";break;case"PreserveAll":i="pre-wrap"}return i}function _vt(e,t,i,n){var o;return 0!==e?(mvt(o=uvt(),e,t,i),gvt(o,n)):n}function Hvt(e,t){return{x:e.x+t.desiredSize.width*t.pivot.x,y:e.y+t.desiredSize.height*t.pivot.y}}jvt.prototype.setOffsetWithRespectToBounds=function(e,t,i){this.unitMode=i,this.position={x:e,y:t}},jvt.prototype.getAbsolutePosition=function(e){if(void 0!==this.position)return"Absolute"===this.unitMode?this.position:{x:this.position.x*e.width,y:this.position.y*e.height}},Object.defineProperty(jvt.prototype,"outerBounds",{get:function(){return this.floatingBounds||this.bounds},set:function(e){this.floatingBounds=e},enumerable:!0,configurable:!0}),jvt.prototype.measure=function(e){var t=void 0!==this.width?this.width:(e.width||0)-this.margin.left-this.margin.right,i=void 0!==this.height?this.height:(e.height||0)-this.margin.top-this.margin.bottom;return this.desiredSize=new avt(t,i),this.isCalculateDesiredSize&&(this.desiredSize=this.validateDesiredSize(this.desiredSize,e)),this.desiredSize},jvt.prototype.arrange=function(e){return this.actualSize=e,this.updateBounds(),this.actualSize},jvt.prototype.updateBounds=function(){this.bounds=Fvt(this)},jvt.prototype.validateDesiredSize=function(e,t){return!this.isRectElement||this.width||this.minWidth||this.maxWidth||(e.width=50),!this.isRectElement||this.height||this.minHeight||this.maxHeight||(e.height=50),(void 0===e||void 0!==this.width&&void 0!==this.height)&&((e=e||new avt).width=void 0===this.width?(t.width||0)-this.margin.left-this.margin.right:this.width,e.height=void 0===this.height?(t.height||0)-this.margin.top-this.margin.bottom:this.height),void 0!==this.minWidth&&(e.width=Math.max(e.width,this.minWidth)),void 0!==this.minHeight&&(e.height=Math.max(e.height,this.minHeight)),void 0!==this.maxWidth&&(e.width=Math.min(e.width,this.maxWidth)),void 0!==this.maxHeight&&(e.height=Math.min(e.height,this.maxHeight)),e};var zvt=jvt;function jvt(){this.pivot={x:.5,y:.5},this.rotateValue={x:0,y:0,angle:0},this.isDirt=!0,this.offsetX=0,this.offsetY=0,this.cornerRadius=0,this.minHeight=void 0,this.minWidth=void 0,this.maxWidth=void 0,this.maxHeight=void 0,this.width=void 0,this.height=void 0,this.horizontalAlignment="Auto",this.verticalAlignment="Auto",this.visible=!0,this.rotateAngle=0,this.margin={left:0,right:0,top:0,bottom:0},this.relativeMode="Point",this.transform=evt.Self|evt.Parent,this.style={fill:"white",strokeColor:"black",opacity:1,strokeWidth:1},this.desiredSize=new avt,this.actualSize=new avt,this.parentTransform=0,this.preventContainer=!1,this.bounds=new dvt(0,0,0,0),this.staticSize=!1,this.isRectElement=!1,this.isCalculateDesiredSize=!0,this.elementActions=tvt.None,this.position=void 0,this.unitMode=void 0,this.float=!1,this.floatingBounds=void 0}Wvt=function(e,t){return(Wvt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Wvt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(qvt,Qvt=zvt),qvt.prototype.hasChildren=function(){return void 0!==this.children&&0<this.children.length},qvt.prototype.measure=function(e){var t,i=this.desiredBounds=void 0;if(this.hasChildren()){for(var n,o=0;o<this.children.length;o++){"Stretch"!==(t=this.children[parseInt(o.toString(),10)]).horizontalAlignment||e.width||(e.width=t.bounds.width),"Stretch"!==t.verticalAlignment||e.height||(e.height=t.bounds.height);var r="Stretch"===t.horizontalAlignment||"Stretch"===t.verticalAlignment;(this.measureChildren||r||t instanceof qvt&&void 0!==t.measureChildren)&&t.measure(e),r=this.GetChildrenBounds(t),"Stretch"!==t.horizontalAlignment&&"Stretch"!==t.verticalAlignment?void 0===this.desiredBounds?this.desiredBounds=r:this.desiredBounds.uniteRect(r):!this.actualSize||this.actualSize.width||this.actualSize.height||t.preventContainer||"Stretch"!==t.horizontalAlignment||"Stretch"!==t.verticalAlignment||(void 0===this.desiredBounds?this.desiredBounds=t.bounds:this.desiredBounds.uniteRect(t.bounds))}void 0!==this.desiredBounds&&0!==this.rotateAngle&&(n={x:this.desiredBounds.x+this.desiredBounds.width*this.pivot.x,y:this.desiredBounds.y+this.desiredBounds.height*this.pivot.y},n=_vt(this.rotateAngle,void 0,void 0,n),this.desiredBounds.x=n.x-this.desiredBounds.width*this.pivot.x,this.desiredBounds.y=n.y-this.desiredBounds.height*this.pivot.y),this.desiredBounds&&(i=new avt(this.desiredBounds.width,this.desiredBounds.height))}return i=this.validateDesiredSize(i,e),this.stretchChildren(i),this.desiredSize=i},qvt.prototype.measureFreeText=function(e,t){var i,n=this.desiredBounds=void 0;if(this.hasChildren()){for(var o,r=0;r<this.children.length;r++){"Stretch"!==(i=this.children[parseInt(r.toString(),10)]).horizontalAlignment||e.width||(e.width=i.bounds.width),"Stretch"!==i.verticalAlignment||e.height||(e.height=i.bounds.height);var s="Stretch"===i.horizontalAlignment||"Stretch"===i.verticalAlignment;(this.measureChildren||s||i instanceof qvt&&void 0!==i.measureChildren)&&i.measure(e),s=this.GetChildrenBounds(i),"Stretch"!==i.horizontalAlignment&&"Stretch"!==i.verticalAlignment?void 0===this.desiredBounds?this.desiredBounds=s:this.desiredBounds.uniteRect(s):!this.actualSize||this.actualSize.width||this.actualSize.height||i.preventContainer||"Stretch"!==i.horizontalAlignment||"Stretch"!==i.verticalAlignment||(void 0===this.desiredBounds?this.desiredBounds=i.bounds:this.desiredBounds.uniteRect(i.bounds))}void 0!==this.desiredBounds&&0!==this.rotateAngle&&(o={x:this.desiredBounds.x+this.desiredBounds.width*this.pivot.x,y:this.desiredBounds.y+this.desiredBounds.height*this.pivot.y},o=_vt(this.rotateAngle,void 0,void 0,o),this.desiredBounds.x=o.x-this.desiredBounds.width*this.pivot.x,this.desiredBounds.y=o.y-this.desiredBounds.height*this.pivot.y),this.desiredBounds&&(n=new avt(this.desiredBounds.width,this.desiredBounds.height))}return n=this.validateDesiredSize(n,e),this.stretchChildren(n),this.desiredSize=n},qvt.prototype.arrange=function(e){var t=this.desiredBounds;if(t){this.offsetX,this.offsetY;if(this.offsetX=t.x+t.width*this.pivot.x,this.offsetY=t.y+t.height*this.pivot.y,this.hasChildren())for(var i=0;i<this.children.length;i++){var n,o=!1;"Stretch"===(n=this.children[parseInt(i.toString(),10)]).horizontalAlignment&&(n.offsetX=this.offsetX,n.parentTransform=this.parentTransform+this.rotateAngle,o=!0),"Stretch"===n.verticalAlignment&&(n.offsetY=this.offsetY,n.parentTransform=this.parentTransform+this.rotateAngle,o=!0),(o||this.measureChildren||n instanceof qvt&&void 0!==n.measureChildren)&&n.arrange(n.desiredSize)}}return this.actualSize=e,this.updateBounds(),this.prevRotateAngle=this.rotateAngle,e},qvt.prototype.stretchChildren=function(e){if(this.hasChildren())for(var t=0,i=this.children;t<i.length;t++){var n=i[t];"Stretch"!==n.horizontalAlignment&&void 0!==n.desiredSize.width||(n.desiredSize.width=e.width-n.margin.left-n.margin.right),"Stretch"!==n.verticalAlignment&&void 0!==n.desiredSize.height||(n.desiredSize.height=e.height-n.margin.top-n.margin.bottom),n instanceof qvt&&n.stretchChildren(n.desiredSize)}},qvt.prototype.findChildOffsetFromCenter=function(e,t){var i=Hvt({x:t.x-e.desiredSize.width/2,y:t.y-e.desiredSize.height/2},e),i=_vt(e.rotateAngle,t.x,t.y,i);i=_vt(this.rotateAngle+this.parentTransform,this.offsetX,this.offsetY,i),e.offsetX=i.x,e.offsetY=i.y},qvt.prototype.GetChildrenBounds=function(e){var t=e.desiredSize.clone(),i=(e.rotateAngle,this.rotateAngle,e.offsetX),n=e.offsetY,i=i-t.width*e.pivot.x,n=n-t.height*e.pivot.y,o=i+t.width,t=n+t.height,r={x:i,y:n},n={x:o,y:n},i={x:i,y:t},o={x:o,y:t},r=_vt(e.rotateAngle,e.offsetX,e.offsetY,r),n=_vt(e.rotateAngle,e.offsetX,e.offsetY,n),i=_vt(e.rotateAngle,e.offsetX,e.offsetY,i),o=_vt(e.rotateAngle,e.offsetX,e.offsetY,o);return 0!==this.rotateAngle&&(r=_vt(-this.rotateAngle,void 0,void 0,r),n=_vt(-this.rotateAngle,void 0,void 0,n),i=_vt(-this.rotateAngle,void 0,void 0,i),o=_vt(-this.rotateAngle,void 0,void 0,o)),dvt.toBounds([r,n,i,o])};var Wvt,Qvt,Uvt=qvt;function qvt(){var e=null!==Qvt&&Qvt.apply(this,arguments)||this;return e.desiredBounds=void 0,e.measureChildren=!0,e.prevRotateAngle=0,e}Gvt=function(e,t){return(Gvt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Gvt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Kvt,Yvt=zvt),Object.defineProperty(Kvt.prototype,"content",{get:function(){return this.textContent},set:function(e){this.textContent!==e&&(this.textContent=e,this.isDirt=!0,this.doWrap=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(Kvt.prototype,"childNodes",{get:function(){return this.textNodes},set:function(e){this.textNodes=e},enumerable:!0,configurable:!0}),Object.defineProperty(Kvt.prototype,"wrapBounds",{get:function(){return this.textWrapBounds},set:function(e){this.textWrapBounds=e},enumerable:!0,configurable:!0}),Kvt.prototype.refreshTextElement=function(){this.isDirt=!0},Kvt.prototype.measureFreeText=function(e,t){t=this.isDirt&&this.canMeasure?Avt(this,this.style,this.content,this.width||e.width,e.height,t):this.desiredSize;return void 0===this.width||void 0===this.height?this.desiredSize=new avt(t.width,t.height):this.desiredSize=new avt(this.width,this.height),this.desiredSize=this.validateDesiredSize(this.desiredSize,e),this.desiredSize},Kvt.prototype.measure=function(e){var t=this.isDirt&&this.canMeasure?Avt(this,this.style,this.content,this.width||e.width):this.desiredSize;return void 0===this.width||void 0===this.height?this.desiredSize=new avt(t.width,t.height):this.desiredSize=new avt(this.width,this.height),this.desiredSize=this.validateDesiredSize(this.desiredSize,e),this.desiredSize},Kvt.prototype.arrange=function(e){return e.width===this.actualSize.width&&e.height===this.actualSize.height&&!this.isDirt||(this.doWrap=!0),this.actualSize=e,this.updateBounds(),this.isDirt=!1,this.actualSize};var Gvt,Yvt,Xvt=Kvt;function Kvt(){var e=Yvt.call(this)||this;return e.textContent="",e.canMeasure=!0,e.canConsiderBounds=!0,e.doWrap=!0,e.textNodes=[],e.style={color:"black",fill:"transparent",strokeColor:"black",strokeWidth:1,fontFamily:"Arial",fontSize:12,whiteSpace:"CollapseSpace",textWrapping:"WrapWithOverflow",textAlign:"Center",italic:!1,bold:!1,textDecoration:"None",strokeDashArray:"",opacity:1,textOverflow:"Wrap"},e.style.fill="transparent",e.style.strokeColor="transparent",e}Jvt=function(e,t){return(Jvt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Jvt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ebt,Zvt=Uvt),ebt.prototype.measureFreeText=function(e,t){var i=void 0,n=void 0;if(this.hasChildren()){for(var o,r,s=0,a=this.children;s<a.length;s++){var l=a[s];if(l instanceof Xvt){if(!l.canMeasure)break;e.width=e.width||this.maxWidth||this.minWidth,l.measureFreeText(e,t)}else l instanceof Xvt||l.measure(e);var h=l.desiredSize.clone(),d=(h=0!==l.rotateAngle?Bvt(h,l.rotateAngle):h).width+l.margin.right,p=h.height+l.margin.bottom,d=new dvt(l.margin.left,l.margin.top,d,p);if(l.float)if(void 0!==l.getAbsolutePosition(h))continue;l instanceof Xvt&&!(l instanceof Xvt&&l.canConsiderBounds)||(void 0===n?n=d:n.uniteRect(d))}n&&(r=o=0,o=Math.max(n.left,0),r=Math.max(n.top,0),i=new avt(n.width+o,n.height+r))}return i=Zvt.prototype.validateDesiredSize.call(this,i,e),Zvt.prototype.stretchChildren.call(this,i),this.desiredSize=i},ebt.prototype.measure=function(e){var t=void 0,i=void 0;if(this.hasChildren()){for(var n,o,r=0,s=this.children;r<s.length;r++){var a=s[r];if(a instanceof Xvt){if(!a.canMeasure)break;e.width=e.width||this.maxWidth||this.minWidth,a.measure(e)}else a instanceof Xvt||a.measure(e);var l=a.desiredSize.clone(),h=(l=0!==a.rotateAngle?Bvt(l,a.rotateAngle):l).width+a.margin.right,d=l.height+a.margin.bottom,h=new dvt(a.margin.left,a.margin.top,h,d);if(a.float)if(void 0!==a.getAbsolutePosition(l))continue;a instanceof Xvt&&!(a instanceof Xvt&&a.canConsiderBounds)||(void 0===i?i=h:i.uniteRect(h))}i&&(o=n=0,n=Math.max(i.left,0),o=Math.max(i.top,0),t=new avt(i.width+n,i.height+o))}return t=Zvt.prototype.validateDesiredSize.call(this,t,e),Zvt.prototype.stretchChildren.call(this,t),this.desiredSize=t},ebt.prototype.arrange=function(e){if(this.outerBounds=new dvt,this.hasChildren())for(var t=this.offsetY-e.height*this.pivot.y,i=this.offsetX-e.width*this.pivot.x,n=0,o=this.children;n<o.length;n++){var r,s,a,l,h,d,p=o[n];0!=(p.transform&evt.Parent)&&(p.parentTransform=this.parentTransform+this.rotateAngle,r=p.desiredSize.clone(),d=void 0,s={x:0,y:0},l=i,h=t,"Point"===p.relativeMode&&void 0!==(a=p.getAbsolutePosition(e))&&(l+=a.x,h+=a.y),s={x:(d="Object"===p.relativeMode?this.alignChildBasedOnParent(p,r,e,l,h):this.alignChildBasedOnaPoint(p,l,h)).x+r.width/2,y:d.y+r.height/2},p.rotateValue&&(a={x:this.offsetX+(p.rotateValue.x||0),y:this.offsetY+(p.rotateValue.y||0)},l={x:this.offsetX,y:this.offsetY},h=0|p.rotateValue.angle,mvt(d=uvt(),h,l.x,l.y),s=gvt(d,a)),Zvt.prototype.findChildOffsetFromCenter.call(this,p,s)),"Stretch"===p.horizontalAlignment||"Stretch"===p.verticalAlignment?p.arrange(e):!(p instanceof Xvt&&p.canMeasure)&&p instanceof Xvt||(p.arrange(p.desiredSize),this.outerBounds.uniteRect(p.outerBounds))}return this.actualSize=e,this.updateBounds(),this.outerBounds.uniteRect(this.bounds),e},ebt.prototype.alignChildBasedOnParent=function(e,t,i,n,o){switch(e.horizontalAlignment){case"Auto":case"Left":n+=e.margin.left;break;case"Right":n+=i.width-t.width-e.margin.right;break;case"Stretch":case"Center":n+=i.width/2-t.width/2}switch(e.verticalAlignment){case"Auto":case"Top":o+=e.margin.top;break;case"Bottom":o+=i.height-t.height-e.margin.bottom;break;case"Stretch":case"Center":o+=i.height/2-t.height/2}return{x:n,y:o}},ebt.prototype.alignChildBasedOnaPoint=function(e,t,i){switch(t+=e.margin.left-e.margin.right,i+=e.margin.top-e.margin.bottom,e.horizontalAlignment){case"Auto":case"Left":break;case"Stretch":case"Center":t-=e.desiredSize.width*e.pivot.x;break;case"Right":t-=e.desiredSize.width}switch(e.verticalAlignment){case"Auto":case"Top":break;case"Stretch":case"Center":i-=e.desiredSize.height*e.pivot.y;break;case"Bottom":i-=e.desiredSize.height}return{x:t,y:i}};var Jvt,Zvt,$vt=ebt;function ebt(){var e=null!==Zvt&&Zvt.apply(this,arguments)||this;return e.measureChildren=void 0,e}tbt=function(e,t){return(tbt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}tbt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(obt,ibt=zvt),Object.defineProperty(obt.prototype,"source",{get:function(){return this.imageSource},set:function(e){this.imageSource=e,this.isDirt=!0},enumerable:!0,configurable:!0}),obt.prototype.measure=function(e){return this.isDirt&&("Stretch"!==this.stretch||void 0===this.width&&void 0===this.height)&&(this.contentSize=Mvt(this.source,this.contentSize),this.isDirt=!1),void 0!==this.width&&void 0!==this.height?(this.desiredSize=new avt(this.width,this.height),this.contentSize=this.desiredSize):this.desiredSize=this.contentSize,this.desiredSize=this.validateDesiredSize(this.desiredSize,e),this.desiredSize},obt.prototype.arrange=function(e){return this.actualSize=new avt(this.desiredSize.width,this.desiredSize.height),this.updateBounds(),this.actualSize};var tbt,ibt,nbt=obt;function obt(){var e=ibt.call(this)||this;return e.imageSource="",e.printID="",e.imageScale="None",e.imageAlign="None",e.stretch="Stretch",e}function rbt(e){var t,i=[],n=sbt(e);if(0<n.length)for(var o=0;o<n.length;o++){var r=n[parseInt(o.toString(),10)],s="";switch((s=r[0]).toLowerCase()){case"m":for(t=1;t<r.length;t++)i.push({command:s,x:r[parseInt(t.toString(),10)],y:r[t+1]}),t+=1,"m"===s?s="l":"M"===s&&(s="L");break;case"l":case"t":for(t=1;t<r.length;t++)i.push({command:s,x:r[parseInt(t.toString(),10)],y:r[t+1]}),t+=1;break;case"h":for(t=1;t<r.length;t++)i.push({command:s,x:r[parseInt(t.toString(),10)]});break;case"v":for(t=1;t<r.length;t++)i.push({command:s,y:r[parseInt(t.toString(),10)]});break;case"z":i.push({command:s});break;case"c":for(t=1;t<r.length;t++)i.push({command:s,x1:r[parseInt(t.toString(),10)],y1:r[t+1],x2:r[t+2],y2:r[t+3],x:r[t+4],y:r[t+5]}),t+=5;break;case"s":for(t=1;t<r.length;t++)i.push({command:s,x2:r[parseInt(t.toString(),10)],y2:r[t+1],x:r[t+2],y:r[t+3]}),t+=3;break;case"q":for(t=1;t<r.length;t++)i.push({command:s,x1:r[parseInt(t.toString(),10)],y1:r[t+1],x:r[t+2],y:r[t+3]}),t+=3;break;case"a":for(t=1;t<r.length;t++)i.push({command:s,r1:r[parseInt(t.toString(),10)],r2:r[t+1],angle:r[t+2],largeArc:r[t+3],sweep:r[t+4],x:r[t+5],y:r[t+6]}),t+=6}}return i}function sbt(e){for(var t=/([a-z]+)|([+-]?(?:\d+\.?\d*|\.\d+))/gi,i=[],n=[],o={},r=(t.lastIndex=0,!1),o=t.exec(e);o;)r="e"===o[1]||(o[1]?i="zm"===o[1].toLowerCase()?(i.length&&n.push(i),n.push(["Z"]),[o[1].substring(1,2)]):(i.length&&n.push(i),[o[1]]):(i.length||(i=[]),r||i.push(Number(o[2]))),!1),o=t.exec(e);return i.length&&n.push(i),n}function abt(e,t,i){for(var n,o="",r=[{x:0+(e=i/2<(e=t/2<e?t/2:e)?i/2:e),y:0},{x:0+i-e,y:0},{x:0+i,y:0+e},{x:0+i,y:0+t-e},{x:0+i-e,y:0+t},{x:0+e,y:0+t},{x:0,y:0+t-e},{x:0,y:0+e}],s=[{x:0+i,y:0},{x:0+i,y:0+t},{x:0,y:0+t},{x:0,y:0}],a=0,o="M"+r[0].x+" "+r[0].y,l=0;l<r.length;l+=2)o=(o+="L"+(n=r[l+1]).x+" "+n.y)+"Q"+s[a].x+" "+s[a].y+" "+(n=r[l+2]||r[0]).x+" "+n.y,a++;return o}function lbt(e){for(var t,i,n,o,r,s,a=[],l=0,h=0,d=0,p=e.length;d<p;++d){var c,u,g=e[parseInt(d.toString(),10)],m=g.command,f=("y1"in g&&(o=g.y1),"y2"in g&&(s=g.y2),"x1"in g&&(n=g.x1),"x2"in g&&(r=g.x2),"x"in g&&(l=g.x),"y"in g&&(h=g.y),a[a.length-1]);switch(m){case"M":a.push({command:"M",x:l,y:h});break;case"L":a.push({command:"L",x0:t,y0:i,x:l,y:h});break;case"H":a.push({command:"L",x0:t,y0:i,x:l,y:i});break;case"V":a.push({command:"L",x0:t,y0:i,x:t,y:h});break;case"C":a.push({command:"C",x0:t,y0:i,x1:n,y1:o,x2:r,y2:s,x:l,y:h});break;case"S":f&&(c=void 0,u={x:2*t-(c="C"===f.command||"S"===f.command?{x:f.x2,y:f.y2}:{x:t,y:i}).x,y:2*i-c.y},a.push({command:"C",x0:t,y0:i,x1:u.x,y1:u.y,x2:r,y2:s,x:l,y:h}));break;case"Q":a.push({command:"Q",x0:t,y0:i,x1:n,y1:o,x:l,y:h});break;case"T":f&&(c=void 0,u={x:2*t-(c="Q"===f.command?{x:f.x1,y:f.y1}:{x:t,y:i}).x,y:2*i-c.y},a.push({command:"Q",x0:t,y0:i,x1:u.x,y1:u.y,x:l,y:h}));break;case"A":var y=g;y.command="A",a.push(y);break;case"Z":case"z":a.push({command:"Z"}),l=t,h=i}t=l,i=h}return a}function hbt(e,t,i,n,o,r,s,a){for(var l,h,d,p,c=0,u=0,g=0,m=e.length;g<m;++g){var f=e[parseInt(g.toString(),10)],y=f.command;"x"in f&&(c=f.x),"y"in f&&(u=f.y),"y1"in f&&(h=f.y1),"y2"in f&&(p=f.y2),"x1"in f&&(l=f.x1),"x2"in f&&(d=f.x2),n?(void 0!==c&&(c=pbt(c,t,o,s)),void 0!==u&&(u=pbt(u,i,r,a)),void 0!==l&&(l=pbt(l,t,o,s)),void 0!==h&&(h=pbt(h,i,r,a)),void 0!==d&&(d=pbt(d,t,o,s)),void 0!==p&&(p=pbt(p,i,r,a))):(void 0!==c&&(c=Number((c+t).toFixed(2))),void 0!==u&&(u=Number((u+i).toFixed(2))),void 0!==l&&(l=Number((l+t).toFixed(2))),void 0!==h&&(h=Number((h+i).toFixed(2))),void 0!==d&&(d=Number((d+t).toFixed(2))),void 0!==p&&(p=Number((p+i).toFixed(2)))),(y=dbt(f,y,{x:c,y:u,x1:l,y1:h,x2:d,y2:p,r1:f.r1,r2:f.r2},n,t,i))&&(e[parseInt(g.toString(),10)]=y)}return ubt(e)}function dbt(e,t,i,n,o,r){switch(t){case"M":case"L":e.x=i.x,e.y=i.y;break;case"H":e.x=i.x;break;case"V":e.y=i.y;break;case"C":e.x=i.x,e.y=i.y,e.x1=i.x1,e.y1=i.y1,e.x2=i.x2,e.y2=i.y2;break;case"S":e.x=i.x,e.y=i.y,e.x2=i.x2,e.y2=i.y2;break;case"Q":e.x=i.x,e.y=i.y,e.x1=i.x1,e.y1=i.y1;break;case"T":e.x=i.x,e.y=i.y;break;case"A":var s=i.r1,a=i.r2;n&&(i.r1=s*=o,i.r2=a*=r),e.x=i.x,e.y=i.y,e.r1=i.r1,e.r2=i.r2;break;case"z":case"Z":e={command:"Z"}}return e}function pbt(e,t,i,n){return e!==i?e=n!==i?e*t-(Number(i)*t-Number(i))+(n-Number(i)):Number(e)*t-(Number(i)*t-Number(i)):n!==i&&(e=n),Number(e.toFixed(2))}function cbt(e){for(var t,i,n,o,r,s,a=0,l=0,h=0,d=e.length;h<d;++h){var p=e[parseInt(h.toString(),10)],c=p.command;if(/[MLHVCSQTA]/.test(c))"x"in p&&(p.x=a=p.x),"y"in p&&(p.y=l=p.y);else{"x1"in p&&(p.x1=n=a+p.x1),"x2"in p&&(p.x2=r=a+p.x2),"y1"in p&&(p.y1=o=l+p.y1),"y2"in p&&(p.y2=s=l+p.y2),"x"in p&&(p.x=a+=p.x),"y"in p&&(p.y=l+=p.y);var u=void 0;switch(c){case"m":case"M":u={command:"M",x:a,y:l};break;case"l":case"L":u={command:"L",x:a,y:l};break;case"h":case"H":u={command:"H",x:a};break;case"v":case"V":u={command:"V",y:l};break;case"c":case"C":u={command:"C",x:a,y:l,x1:n,y1:o,x2:r,y2:s};break;case"s":case"S":u={command:"S",x:a,y:l,x2:r,y2:s};break;case"q":case"Q":u={command:"Q",x:a,y:l,x1:n,y1:o};break;case"t":case"T":u={command:"T",x:a,y:l};break;case"a":case"A":(u={command:"A",x:a,y:l}).r1=p.r1,u.r2=p.r2,u.angle=p.angle,u.largeArc=p.largeArc,u.sweep=p.sweep;break;case"z":case"Z":u={command:"Z"},a=t,l=i,u=e[parseInt(h.toString(),10)]}u&&(e[parseInt(h.toString(),10)]=u)}"M"!==c&&"m"!==c||(t=a,i=l)}return e}function ubt(e){for(var t="",i=0;i<e.length;i++)t+=0===i?gbt(e[parseInt(i.toString(),10)]):" "+gbt(e[parseInt(i.toString(),10)]);return t}function gbt(e){var t="";switch(e.command){case"Z":case"z":t=e.command;break;case"M":case"m":case"L":case"l":t=e.command+" "+e.x+" "+e.y;break;case"C":case"c":t=e.command+" "+e.x1+" "+e.y1+" "+e.x2+" "+e.y2+" "+e.x+" "+e.y;break;case"Q":case"q":t=e.command+" "+e.x1+" "+e.y1+" "+e.x+" "+e.y;break;case"A":case"a":var i=e.command,n=e.angle,o=e.largeArc?"1":"0",r=e.sweep?"1":"0",t=i+" "+e.r1+" "+e.r2+" "+n+" "+o+" "+r+" "+e.x+" "+e.y;break;case"H":case"h":t=e.command+" "+e.x;break;case"V":case"v":t=e.command+" "+e.y;break;case"S":case"s":t=e.command+" "+e.x2+" "+e.y2+" "+e.x+" "+e.y;break;case"T":case"t":t=e.command+" "+e.x+" "+e.y}return t}mbt=function(e,t){return(mbt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}mbt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(vbt,fbt=zvt),Object.defineProperty(vbt.prototype,"data",{get:function(){return this.pathData},set:function(e){this.pathData!==e&&(this.pathData=e,this.isDirt=!0)},enumerable:!0,configurable:!0}),vbt.prototype.measure=function(e){return this.staticSize&&void 0!==this.width&&void 0!==this.height?this.absoluteBounds=new dvt(this.offsetX-this.width*this.pivot.x,this.offsetY-this.height*this.pivot.y,this.width,this.height):(!this.isDirt||!this.transformPath&&void 0!==this.width&&void 0!==this.height||this.absoluteBounds&&0!==this.absoluteBounds.height)&&!this.canMeasurePath||(this.absoluteBounds=Cvt(this.data||"")),void 0===this.width?this.desiredSize=new avt(this.absoluteBounds.width,this.height||this.absoluteBounds.height):void 0===this.height?this.desiredSize=new avt(this.width||this.absoluteBounds.width,this.absoluteBounds.height):this.desiredSize=new avt(this.width,this.height),this.desiredSize=this.validateDesiredSize(this.desiredSize,e),this.canMeasurePath=!1,this.desiredSize},vbt.prototype.arrange=function(e){return!this.isDirt&&this.actualSize.width===e.width&&this.actualSize.height===e.height||(this.isDirt=!0,this.absolutePath=this.updatePath(this.data,this.absoluteBounds,e),this.staticSize)||(this.points=null),this.actualSize=this.desiredSize,this.updateBounds(),this.isDirt=!1,this.actualSize},vbt.prototype.updatePath=function(e,t,i){var n=!1,o="",r=-t.x,s=-t.y;return i.width===t.width&&i.height===t.height||(r=i.width/Number(t.width||1),s=i.height/Number(t.height||1),n=!0),i=cbt(rbt(e)),o=(n||this.isDirt)&&this.transformPath?hbt(i,r,s,n,t.x,t.y,0,0):ubt(i),n=!1,o};var mbt,fbt,ybt=vbt;function vbt(){var e=fbt.call(this)||this;return e.pathData="",e.transformPath=!0,e.absolutePath="",e.canMeasurePath=!1,e.absoluteBounds=new dvt,e}bbt=function(e,t){return(bbt=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])}))(e,t)};var bbt,wbt,Tft=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Cbt=(function(e,t){function i(){this.constructor=e}bbt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Sbt,wbt=n),Sbt.equals=function(e,t){return e===t||!(!e||!t||e&&t&&(e.x!==t.x||e.y!==t.y))},Sbt.isEmptyPoint=function(e){return!e.x||!e.y},Sbt.transform=function(e,t,i){var n={x:0,y:0};return n.x=Math.round(100*(e.x+i*Math.cos(t*Math.PI/180)))/100,n.y=Math.round(100*(e.y+i*Math.sin(t*Math.PI/180)))/100,n},Sbt.findLength=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},Sbt.findAngle=function(e,t){t=180*(t=Math.atan2(t.y-e.y,t.x-e.x))/Math.PI;return(t%=360)<0&&(t+=360),t},Sbt.distancePoints=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},Sbt.getLengthFromListOfPoints=function(e){for(var t=0,i=0;i<e.length-1;i++)t+=this.distancePoints(e[parseInt(i.toString(),10)],e[i+1]);return t},Sbt.adjustPoint=function(e,t,i,n){var o,r=i?{x:e.x,y:e.y}:{x:t.x,y:t.y};return e.x===t.x?e.y<t.y&&i||e.y>t.y&&!i?r.y+=n:r.y-=n:e.y===t.y?e.x<t.x&&i||e.x>t.x&&!i?r.x+=n:r.x-=n:r=i?(o=this.findAngle(e,t),this.transform(e,o,n)):(o=this.findAngle(t,e),this.transform(t,o,n)),r},Sbt.direction=function(e,t){return Math.abs(t.x-e.x)>Math.abs(t.y-e.y)?e.x<t.x?"Right":"Left":e.y<t.y?"Bottom":"Top"},Sbt.prototype.getClassName=function(){return"Point"},Tft([e(0)],Sbt.prototype,"x",void 0),Tft([e(0)],Sbt.prototype,"y",void 0),Sbt);function Sbt(){return null!==wbt&&wbt.apply(this,arguments)||this}xbt.getContext=function(e){return e.getContext("2d")},xbt.prototype.setStyle=function(e,t){var e=xbt.getContext(e),i=("none"===t.fill&&(t.fill="transparent"),"none"===t.stroke&&(t.stroke="transparent"),e.strokeStyle=t.stroke,e.lineWidth=t.strokeWidth,0===t.strokeWidth&&(e.strokeStyle="transparent"),e.globalAlpha=t.opacity,[]);t.dashArray&&(i=this.parseDashArray(t.dashArray)),e.setLineDash(i),e.fillStyle=t.fill},xbt.prototype.rotateContext=function(e,t,i,n){e=xbt.getContext(e);e.translate(i,n),e.rotate(t*Math.PI/180),e.translate(-i,-n)},xbt.prototype.setFontStyle=function(e,t){var e=xbt.getContext(e),i="";t.italic&&(i+="italic "),t.bold&&(i+="bold "),i=(i+=t.fontSize+"px ")+t.fontFamily,e.font=i},xbt.prototype.parseDashArray=function(e){for(var t=[],i=-1!==e.indexOf(" ")?" ":",",n=0,o=e.split(i);n<o.length;n++){var r=o[n];t.push(Number(r))}return t},xbt.prototype.drawRectangle=function(e,t){var i,n,o;!0===t.visible&&(t.cornerRadius?(t.data=abt(t.cornerRadius,t.height,t.width),this.drawPath(e,t)):((i=xbt.getContext(e)).save(),i.beginPath(),t.cornerRadius,n=t.x+t.width*t.pivotX,o=t.y+t.height*t.pivotY,this.rotateContext(e,t.angle,n,o),this.setStyle(e,t),i.rect(t.x,t.y,t.width,t.height),i.fillRect(t.x,t.y,t.width,t.height),i.fill(),i.stroke(),i.closePath(),i.restore()))},xbt.prototype.drawPath=function(e,t){i=lbt(rbt(t.data));var i,n=xbt.getContext(e),o=(n.save(),n.beginPath(),t.y+t.height*t.pivotY),r=t.x+t.width*t.pivotX;this.rotateContext(e,t.angle,r,o),this.setStyle(e,t),n.translate(t.x,t.y),this.renderPath(e,t,i),n.fill(),n.translate(-t.x,-t.y),n.stroke(),n.restore()},xbt.prototype.renderPath=function(e,t,i){if(!0===t.visible)for(var n=xbt.getContext(e),o=void 0,r=void 0,s=void 0,a=void 0,l=void 0,h=void 0,d=void 0,p=void 0,c=void 0,u=i,d=0,p=0,c=0,g=u.length;c<g;++c){var m=u[parseInt(c.toString(),10)],f=m.command;switch("x1"in m&&(s=m.x1),"x2"in m&&(l=m.x2),"y1"in m&&(a=m.y1),"y2"in m&&(h=m.y2),"x"in m&&(d=m.x),"y"in m&&(p=m.y),f){case"M":n.moveTo(d,p),m.x=d,m.y=p;break;case"L":n.lineTo(d,p),m.x=d,m.y=p;break;case"C":n.bezierCurveTo(s,a,l,h,d,p),m.x=d,m.y=p,m.x1=s,m.y1=a,m.x2=l,m.y2=h;break;case"Q":n.quadraticCurveTo(s,a,d,p),m.x=d,m.y=p,m.x1=s,m.y1=a;break;case"A":var y=o,v=r,b=m.r1,w=m.r2,C=m.angle*(Math.PI/180),S=m.largeArc,A=m.sweep,x=d,I=p,T={x:Math.cos(C)*(y-x)/2+Math.sin(C)*(v-I)/2,y:-Math.sin(C)*(y-x)/2+Math.cos(C)*(v-I)/2},E=Math.pow(T.x,2)/Math.pow(b,2)+Math.pow(T.y,2)/Math.pow(w,2),E=(1<E&&(b*=Math.sqrt(E),w*=Math.sqrt(E)),Math.pow(w,2)*Math.pow(T.x,2)),S=(S===A?-1:1)*Math.sqrt((Math.pow(b,2)*Math.pow(w,2)-Math.pow(b,2)*Math.pow(T.y,2)-E)/(Math.pow(b,2)*Math.pow(T.y,2)+Math.pow(w,2)*Math.pow(T.x,2))),E=(S=isNaN(S)?0:S)*b*T.y/w,S=S*-w*T.x/b,y={x:(y+x)/2+Math.cos(C)*E-Math.sin(C)*S,y:(v+I)/2+Math.sin(C)*E+Math.cos(C)*S},x=this.a([1,0],[(T.x-E)/b,(T.y-S)/w]),v=[(T.x-E)/b,(T.y-S)/w],I=[(-T.x-E)/b,(-T.y-S)/w],E=this.a(v,I),T=(this.r(v,I)<=-1&&(E=Math.PI),A?1:-1),S=x+(E=1<=this.r(v,I)?0:E)/2*T;Math.cos(S),Math.sin(S);m.centp=y,m.xAxisRotation=C,m.rx=b,m.ry=w,m.a1=x,m.ad=E,m.sweep=A,null!=n&&(v=w<b?b:w,I=w<b?1:b/w,T=w<b?w/b:1,n.save(),n.translate(y.x,y.y),n.rotate(C),n.scale(I,T),n.arc(0,0,v,x,x+E,!A),n.scale(1/I,1/T),n.rotate(-C),n.translate(-y.x,-y.y),n.restore());break;case"Z":case"z":n.closePath(),d=o,p=r}o=d,r=p}},xbt.prototype.drawText=function(e,t){if(t.content&&!0===t.visible){var i=xbt.getContext(e),n=(i.save(),this.setStyle(e,t),t.x+t.width*t.pivotX),o=t.y+t.height*t.pivotY,r=(this.rotateContext(e,t.angle,n,o),this.setFontStyle(e,t),0),s=t.childNodes,a=t.wrapBounds;if(i.fillStyle=t.color,a)for(var l=this.labelAlign(t,a,s),r=0;r<s.length;r++){var h=s[parseInt(r.toString(),10)];if("\n"!==h.text){var d=l.x+h.x-a.x,p=l.y+h.dy*r+.8*t.fontSize;if(i.fillText(h.text,d,p),"Underline"===t.textDecoration||"Overline"===t.textDecoration||"LineThrough"===t.textDecoration){var c=d,u=void 0,d=d+i.measureText(h.text).width,g=void 0;switch(t.textDecoration){case"Underline":g=u=p+2;break;case"Overline":u=l.y+h.dy*r,g=l.y+h.dy*r;break;case"LineThrough":u=(p+l.y+h.dy*r)/2+2,g=(p+l.y+h.dy*r)/2+2}i.beginPath(),i.moveTo(c,u),i.lineTo(d,g),i.strokeStyle=t.color,i.lineWidth=.08*t.fontSize,i.globalAlpha=t.opacity,i.stroke()}}}i.restore()}},xbt.prototype.m=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2))},xbt.prototype.r=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(this.m(e)*this.m(t))},xbt.prototype.a=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(this.r(e,t))},xbt.prototype.getMeetOffset=function(e,t,i){var n=Math.max(t,i),o=Math.min(t,i);switch(e){case"min":return 0;case"mid":return(n-o)/2;case"max":return n-o;default:return 0}},xbt.prototype.getSliceOffset=function(e,t,i,n){switch(e){case"min":return 0;case"mid":return(t-i)/2*n/t;case"max":return(t-i)*n/t;default:return 0}},xbt.prototype.image=function(i,n,o,r,s,a,l,h){i.beginPath();var e,t,d,p,c,u,g,m,f,y,v,b,w,C,S=n.width,A=n.height,x=s,I=a,T=0,E=0;i.globalAlpha=l.opacity,l&&"None"!==l.alignment?(e=l.alignment.toLowerCase().substr(1,3),t=l.alignment.toLowerCase().substr(5,3),"Slice"===l.scale?(C=function(){E=A*(T=x)/S},f=function(){T=S*I/A,E=I},I<x?(C(),E<I&&f()):x===I?(A<S?f:C)():(f(),T<x&&C()),f=this.getSliceOffset(e,T,x,S),C=this.getSliceOffset(t,E,I,A),d=S-f,p=A-C,c=T-f*(T/S),u=E-C*(E/A),m=(g=Ivt("canvas",{width:s.toString(),height:a.toString()})).getContext("2d"),i.clearRect(o,r,c,u),m.drawImage(n,f,C,d,p,0,0,c,u),i.clearRect(o,r,s,a),i.drawImage(g,o,r,s,a)):"Meet"===l.scale?(T=(m=A/S)<(f=I/x)?x:I/m,E=m<f?x*m:I,o+=this.getMeetOffset(e,T,x),r+=this.getMeetOffset(t,E,I),i.clearRect(o,r,T,E),i.drawImage(n,0,0,S,A,o,r,T,E)):(i.clearRect(o,r,s,a),i.drawImage(n,o,r,s,a))):n.complete?(b=i.canvas.id,this.imageList[b]&&(-1!==(w=this.isExistingImage(b,this.imageList,l))&&this.updateImageList(w,this.imageList,b),this.updateCanvasList(this.imageList,b)),i.drawImage(n,o,r,s,a)):(y=this,v=i.getTransform(),n.onload=null,b=i.canvas.id,this.imageList[b]||(this.imageList[b]=[]),w=this.isExistingImage(b,this.imageList,l),C={id:l.id,image:n,canvasId:b},-1!==w&&this.updateImageList(w,this.imageList,b),this.imageList[b].push(C),n.onload=function(){var e=l.id.lastIndexOf("_content"),e=-1!==e?l.id.substring(0,e):l.id,t=!0;(t=void 0===h||h(e)?t:!1)&&(i.setTransform(v.a,v.b,v.c,v.d,v.e,v.f),e=i.canvas.id,y.imageList[e])&&(-1!==(t=y.isExistingImage(e,y.imageList,l))&&(y.updateImageList(t,y.imageList,e),i.drawImage(n,o,r,s,a)),y.updateCanvasList(y.imageList,e))}),i.closePath()},xbt.prototype.isExistingImage=function(e,t,i){return t[e].findIndex(function(e){return e.id===i.id})},xbt.prototype.updateImageList=function(e,t,i){t[i][e].image.onload=null,t[i].splice(e,1)},xbt.prototype.updateCanvasList=function(e,t){e[t]&&0===e[t].length&&delete e[t]},xbt.prototype.loadImage=function(e,t,i,n,o,r,s){var a;this.rotateContext(i,t.angle,n,o),window.customStampCollection&&window.customStampCollection.get(t.printID)?a=window.customStampCollection.get(t.printID):window&&window.stickyNote&&window.stickyNote.src&&s&&"StickyNotes"==s?a=window.stickyNote:(a=new Image).src=t.source,this.image(e,a,t.x,t.y,t.width,t.height,t,r)},xbt.prototype.drawImage=function(e,t,i,n,o,r){var s,a,l,h,d,p=this;t.visible&&((s=xbt.getContext(e)).save(),a=t.x+t.width*t.pivotX,l=t.y+t.height*t.pivotY,(h=new Image).src=t.source,(d=s.canvas.id.split("_"))[d.length-1],n?h.onload=function(){p.loadImage(s,t,e,a,l)}:this.loadImage(s,t,e,a,l,o,r),s.restore())},xbt.prototype.labelAlign=function(e,t,i){var i=new avt(t.width,i.length*(1.2*e.fontSize)),n={x:0,y:0},o=e.x,r=e.y,s=.5*e.width,a=.5*e.height;return"left"===e.textAlign?s=0:"center"===e.textAlign?s=t.width>e.width&&("Ellipsis"===e.textOverflow||"Clip"===e.textOverflow)?0:.5*e.width:"right"===e.textAlign&&(s=+e.width),n.x=o+s+(t?t.x:0),n.y=r+a-i.height/2,n};var Abt=xbt;function xbt(){this.imageList={}}function Ibt(e,t,i,n,o){for(var r=0;r<t.length;r++)i.renderElement(t[parseInt(r.toString(),10)],e,void 0,void 0,void 0,void 0,void 0,void 0,n,o)}Ebt.prototype.renderElement=function(e,t,i,n,o,r,s,a,l,h){e instanceof Uvt?this.renderContainer(e,t,i,n,o,r,s,a,l,h):e instanceof nbt?this.renderImageElement(e,t,n,o,s,l,h):e instanceof ybt?this.renderPathElement(e,t,n,o,s):e instanceof Xvt?this.renderTextElement(e,t,n,o,s):this.renderRect(e,t,n,o)},Ebt.prototype.renderImageElement=function(e,t,i,n,o,r,s){var a,l,h,d,p=this.getBaseAttributes(e,i);if(p.cornerRadius=0,this.renderer.drawRectangle(t,p),"Stretch"===e.stretch)a=e.actualSize.width,l=e.actualSize.height;else{var c=e.contentSize.width,u=e.contentSize.height,g=p.width/c,m=p.height/u,f=void 0;switch(e.stretch){case"Meet":a=c*(f=Math.min(g,m)),l=u*f,p.x+=Math.abs(p.width-a)/2,p.y+=Math.abs(p.height-l)/2;break;case"Slice":g=p.width/c,m=p.height/u,f=Math.max(g,m),h=p.width/(a=c*f)*c,d=p.height/(l=u*f)*u;break;case"None":a=c,l=u}}p.width=a,p.height=l,p.sourceWidth=h,p.sourceHeight=d,p.source=e.source,p.alignment=e.imageAlign,p.scale=e.imageScale,p.printID=e.printID,this.renderer.drawImage(t,p,n,o,r,s)},Ebt.prototype.renderPathElement=function(e,t,i,n,o){i=this.getBaseAttributes(e,i);i.data=e.absolutePath,i.data=e.absolutePath,e.id;this.isSvgMode||(i.x=i.x,i.y=i.y),this.renderer.drawPath(t,i)},Ebt.prototype.renderTextElement=function(e,t,i,n,o){i=this.getBaseAttributes(e,i);i.cornerRadius=0,i.whiteSpace=Vvt(e.style.whiteSpace,e.style.textWrapping),i.content=e.content,i.breakWord=Rvt(e.style.textWrapping),i.textAlign=Lvt(e.style.textAlign),i.color=e.style.color,i.italic=e.style.italic,i.bold=e.style.bold,i.fontSize=e.style.fontSize,i.fontFamily=e.style.fontFamily,i.textOverflow=e.style.textOverflow,i.textDecoration=e.style.textDecoration,i.doWrap=e.doWrap,i.wrapBounds=e.wrapBounds,i.childNodes=e.childNodes,i.dashArray="",i.strokeWidth=0,i.fill=e.style.fill,e.content||e.id;this.renderer.drawRectangle(t,i),this.renderer.drawText(t,i)},Ebt.prototype.renderContainer=function(e,t,i,n,o,r,s,a,l,h){if(this.diagramId,this.renderRect(e,t,n={tx:0,ty:0,scale:1},o),e.hasChildren())for(var d=0,p=e.children;d<p.length;d++){var c=p[d];this.renderElement(c,t,i,n,o,!0,s,a,l,h)}},Ebt.prototype.renderRect=function(e,t,i,n){i=this.getBaseAttributes(e,i);i.cornerRadius=e.cornerRadius||0,e.id;this.renderer.drawRectangle(t,i)},Ebt.prototype.getBaseAttributes=function(e,t){e={width:e.actualSize.width,height:e.actualSize.height,x:e.offsetX-e.actualSize.width*e.pivot.x+.5,y:e.offsetY-e.actualSize.height*e.pivot.y+.5,fill:e.style.fill,stroke:e.style.strokeColor,angle:e.rotateAngle+e.parentTransform,pivotX:e.pivot.x,pivotY:e.pivot.y,strokeWidth:e.style.strokeWidth,dashArray:e.style.strokeDashArray||"",opacity:e.style.opacity,visible:e.visible,id:e.id,gradient:e.style.gradient};return t&&(e.x+=t.tx,e.y+=t.ty),e};var Tbt=Ebt;function Ebt(e,t){this.renderer=null,this.isSvgMode=!0,this.diagramId=e,this.element=xvt(this.diagramId),this.isSvgMode=t,this.renderer=new Abt}Mbt.prototype.parseDashArray=function(e){return[]},Mbt.prototype.drawRectangle=function(e,t,i,n,o,r,s){var a,l=t.id===e.id?t.id+"_container":t.id,o=(a&&!o||(a=document.createElementNS("http://www.w3.org/2000/svg","rect"),e.appendChild(a)),{id:l,x:t.x.toString(),y:t.y.toString(),width:t.width.toString(),height:t.height.toString(),visibility:t.visible?"visible":"hidden",transform:"rotate("+t.angle+","+(t.x+t.width*t.pivotX)+","+(t.y+t.height*t.pivotY)+")",rx:t.cornerRadius||0,ry:t.cornerRadius||0,opacity:t.opacity,"aria-label":s||""});t.class&&(o.class=t.class);s||(o["pointer-events"]="none"),kbt(a,o),this.setSvgStyle(a,t,i)},Mbt.prototype.updateSelectionRegion=function(e,t){var i=e.parentNode.getElementById(t.id),n={id:t.id,x:t.x.toString(),y:t.y.toString(),width:t.width.toString(),height:t.height.toString(),transform:"rotate("+t.angle+","+(t.x+t.width*t.pivotX)+","+(t.y+t.height*t.pivotY)+")",class:"e-diagram-selected-region"};i||(i=document.createElementNS("http://www.w3.org/2000/svg","rect"),e.appendChild(i)),this.setSvgStyle(i,t),kbt(i,n)},Mbt.prototype.createGElement=function(e,t){return Pbt(e,t)},Mbt.prototype.drawCircle=function(e,t,i,n){var o=document.createElementNS("http://www.w3.org/2000/svg","circle"),r=(this.setSvgStyle(o,t),t.class||""),i=(i||(r+=" e-disabled"),{id:t.id,cx:t.centerX,cy:t.centerY,r:t.radius,visibility:t.visible?"visible":"hidden",class:r,"aria-label":n?n["aria-label"]:""});""===i["aria-label"]&&(i["pointer-events"]="none"),o.style.display=t.visible?"block":"none",kbt(o,i),e.appendChild(o)},Mbt.prototype.setSvgStyle=function(e,t,i){var n,o;(t.canApplyStyle||void 0===t.canApplyStyle)&&("none"===t.fill&&(t.fill="transparent"),"none"===t.stroke&&(t.stroke="transparent"),o=[],(n=void 0)!==t.dashArray&&(o=(new Abt).parseDashArray(t.dashArray)),n=t.fill,t.stroke&&e.setAttribute("stroke",t.stroke),void 0!==t.strokeWidth&&null!==t.strokeWidth&&e.setAttribute("stroke-width",t.strokeWidth.toString()),o&&e.setAttribute("stroke-dasharray",o.toString()),n)&&e.setAttribute("fill",n)},Mbt.prototype.svgLabelAlign=function(e,t,i){var i=new avt(t.width,i.length*(1.2*e.fontSize)),n={x:0,y:0},o=.5*e.width,r=.5*e.height;return"left"===e.textAlign?o=0:"center"===e.textAlign?o=t.width>e.width&&("Ellipsis"===e.textOverflow||"Clip"===e.textOverflow)?0:.5*e.width:"right"===e.textAlign&&(o=+e.width),n.x=0+o+(t?t.x:0),n.y=1.2+r-i.height/2,n},Mbt.prototype.drawLine=function(e,t){var i=document.createElementNS("http://www.w3.org/2000/svg","line"),n=(this.setSvgStyle(i,t),t.x+t.width*t.pivotX),o=t.y+t.height*t.pivotY,n={id:t.id,x1:t.startPoint.x+t.x,y1:t.startPoint.y+t.y,x2:t.endPoint.x+t.x,y2:t.endPoint.y+t.y,stroke:t.stroke,"stroke-width":t.strokeWidth.toString(),opacity:t.opacity.toString(),transform:"rotate("+t.angle+" "+n+" "+o+")",visibility:t.visible?"visible":"hidden"};t.class&&(n.class=t.class),kbt(i,n),e.appendChild(i)},Mbt.prototype.drawPath=function(e,t,i,n,o,r){var s,a=Math.floor(10*Math.random()+1),l=(e.id,a.toString(),a=lbt(rbt(t.data)),o&&(l=o.getElementById(t.id+"_groupElement_shadow"))&&l.parentNode.removeChild(l),(s=o?o.getElementById(t.id):s)&&!n||(s=document.createElementNS("http://www.w3.org/2000/svg","path"),e.appendChild(s)),this.renderPath(s,t,a),{id:t.id,transform:"rotate("+t.angle+","+(t.x+t.width*t.pivotX)+","+(t.y+t.height*t.pivotY)+")translate("+t.x+","+t.y+")",visibility:t.visible?"visible":"hidden",opacity:t.opacity,"aria-label":r||""});t.class&&(l.class=t.class),kbt(s,l),this.setSvgStyle(s,t,i)},Mbt.prototype.renderPath=function(e,t,i){for(var n,o,r,s,a=i,l="",h=0,d=0,p=0,c=a.length;p<c;++p){var u=a[parseInt(p.toString(),10)],g=u.command;switch("x1"in u&&(n=u.x1),"x2"in u&&(r=u.x2),"y1"in u&&(o=u.y1),"y2"in u&&(s=u.y2),"x"in u&&(h=u.x),"y"in u&&(d=u.y),g){case"M":l=l+"M"+h.toString()+","+d.toString()+" ";break;case"L":l=l+"L"+h.toString()+","+d.toString()+" ";break;case"C":l=l+"C"+n.toString()+","+o.toString()+","+r.toString()+","+s.toString()+",",l+=h.toString()+","+d.toString()+" ";break;case"Q":l=l+"Q"+n.toString()+","+o.toString()+","+h.toString()+","+d.toString()+" ";break;case"A":l=l+"A"+u.r1.toString()+","+u.r2.toString()+","+u.angle.toString()+",",l+=u.largeArc.toString()+","+u.sweep+","+h.toString()+","+d.toString()+" ";break;case"Z":case"z":l+="Z "}}e.setAttribute("d",l)};var Dbt=Mbt;function Mbt(){}function kbt(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++)"style"===i[parseInt(n.toString(),10)]?e.style.cssText=t[i[parseInt(n.toString(),10)]]:e.setAttribute(i[parseInt(n.toString(),10)],t[i[parseInt(n.toString(),10)]])}function Pbt(e,t){e=document.createElementNS("http://www.w3.org/2000/svg",e);return kbt(e,t),e}function Bbt(e,t,i){for(var n=e.children.length-1;0<=n;n--){var o=e.children[parseInt(n.toString(),10)];if(o&&o.bounds.containsPoint(t,0)){if(o instanceof Uvt){var r=this.findTargetElement(o,t);if(r)return r}if(o.bounds.containsPoint(t,0))return o}}return e.bounds.containsPoint(t,i)&&"none"!==e.style.fill?e:null}function Fbt(e,t){var i={x:0,y:0},n=(t.y2-t.y1)*(e.x2-e.x1)-(t.x2-t.x1)*(e.y2-e.y1),o=(t.x2-t.x1)*(e.y1-t.y1)-(t.y2-t.y1)*(e.x1-t.x1),t=(e.x2-e.x1)*(e.y1-t.y1)-(e.y2-e.y1)*(e.x1-t.x1);return 0!=n&&(t=t/n,0<=(o=o/n))&&o<=1&&0<=t&&t<=1?(i.x=e.x1+o*(e.x2-e.x1),i.y=e.y1+o*(e.y2-e.y1),{enabled:!0,intersectPt:i}):{enabled:!1,intersectPt:i}}function Lbt(e,t,i,n){return{x1:Number(e)||0,y1:Number(t)||0,x2:Number(i)||0,y2:Number(n)||0}}function Rbt(e,t,i){return e.x>=t.x-i&&e.x<=t.x+i&&e.y>=t.y-i&&e.y<=t.y+i}Obt=function(e,t){return(Obt=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])}))(e,t)};var Obt,Nbt,Vft=function(e,t){function i(){this.constructor=e}Obt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Bft=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Mft=(Vft(Vbt,Nbt=n),Bft([e(0)],Vbt.prototype,"x",void 0),Bft([e(0)],Vbt.prototype,"y",void 0),Bft([e(0)],Vbt.prototype,"width",void 0),Bft([e(0)],Vbt.prototype,"height",void 0),Bft([e(0)],Vbt.prototype,"left",void 0),Bft([e(0)],Vbt.prototype,"top",void 0),Bft([e(0)],Vbt.prototype,"right",void 0),Bft([e(0)],Vbt.prototype,"bottom",void 0),Bft([t({x:0,y:0},Cbt)],Vbt.prototype,"location",void 0),Bft([t(new avt(0,0),avt)],Vbt.prototype,"size",void 0),Vbt);function Vbt(){return null!==Nbt&&Nbt.apply(this,arguments)||this}Vft(Hbt,_bt=n),Bft([e(!1)],Hbt.prototype,"isBold",void 0),Bft([e(!1)],Hbt.prototype,"isItalic",void 0),Bft([e(!1)],Hbt.prototype,"isUnderline",void 0),Bft([e(!1)],Hbt.prototype,"isStrikeout",void 0);var _bt,Cft=Hbt;function Hbt(){return null!==_bt&&_bt.apply(this,arguments)||this}Vft(Wbt,zbt=n),Bft([e("")],Wbt.prototype,"id",void 0),Bft([e("Rectangle")],Wbt.prototype,"shapeAnnotationType",void 0),Bft([e(null)],Wbt.prototype,"formFieldAnnotationType",void 0),Bft([e("")],Wbt.prototype,"measureType",void 0),Bft([e("")],Wbt.prototype,"author",void 0),Bft([e("")],Wbt.prototype,"modifiedDate",void 0),Bft([e("")],Wbt.prototype,"subject",void 0),Bft([e("")],Wbt.prototype,"notes",void 0),Bft([e(!1)],Wbt.prototype,"isCommentLock",void 0),Bft([e("black")],Wbt.prototype,"strokeColor",void 0),Bft([e("#ffffff00")],Wbt.prototype,"fillColor",void 0),Bft([e("#ffffff00")],Wbt.prototype,"stampFillColor",void 0),Bft([e("black")],Wbt.prototype,"stampStrokeColor",void 0),Bft([e("")],Wbt.prototype,"data",void 0),Bft([e(1)],Wbt.prototype,"opacity",void 0),Bft([e(1)],Wbt.prototype,"thickness",void 0),Bft([e("")],Wbt.prototype,"borderStyle",void 0),Bft([e("")],Wbt.prototype,"borderDashArray",void 0),Bft([e(0)],Wbt.prototype,"rotateAngle",void 0),Bft([e(!1)],Wbt.prototype,"isCloudShape",void 0),Bft([e(0)],Wbt.prototype,"cloudIntensity",void 0),Bft([e(40)],Wbt.prototype,"leaderHeight",void 0),Bft([e(null)],Wbt.prototype,"lineHeadStart",void 0),Bft([e(null)],Wbt.prototype,"lineHeadEnd",void 0),Bft([e([])],Wbt.prototype,"vertexPoints",void 0),Bft([e(null)],Wbt.prototype,"sourcePoint",void 0),Bft([e("None")],Wbt.prototype,"sourceDecoraterShapes",void 0),Bft([e("None")],Wbt.prototype,"taregetDecoraterShapes",void 0),Bft([e(null)],Wbt.prototype,"targetPoint",void 0),Bft([e([])],Wbt.prototype,"segments",void 0),Bft([t({x:0,y:0},Mft)],Wbt.prototype,"bounds",void 0),Bft([e(0)],Wbt.prototype,"pageIndex",void 0),Bft([e(-1)],Wbt.prototype,"zIndex",void 0),Bft([e(null)],Wbt.prototype,"wrapper",void 0),Bft([e(!1)],Wbt.prototype,"isDynamicStamp",void 0),Bft([e("")],Wbt.prototype,"dynamicText",void 0),Bft([e("")],Wbt.prototype,"annotName",void 0),Bft([e({})],Wbt.prototype,"review",void 0),Bft([e([])],Wbt.prototype,"comments",void 0),Bft([e("#000")],Wbt.prototype,"fontColor",void 0),Bft([e(16)],Wbt.prototype,"fontSize",void 0),Bft([e("Helvetica")],Wbt.prototype,"fontFamily",void 0),Bft([e("None")],Wbt.prototype,"fontStyle",void 0),Bft([e(!1)],Wbt.prototype,"enableShapeLabel",void 0),Bft([e("label")],Wbt.prototype,"labelContent",void 0),Bft([e("#ffffff00")],Wbt.prototype,"labelFillColor",void 0),Bft([e(15)],Wbt.prototype,"labelMaxLength",void 0),Bft([e("")],Wbt.prototype,"template",void 0),Bft([e("")],Wbt.prototype,"templateSize",void 0),Bft([e(1)],Wbt.prototype,"labelOpacity",void 0),Bft([e("")],Wbt.prototype,"annotationSelectorSettings",void 0),Bft([e("#ffffff00")],Wbt.prototype,"labelBorderColor",void 0),Bft([e("left")],Wbt.prototype,"textAlign",void 0),Bft([e("")],Wbt.prototype,"signatureName",void 0),Bft([e(0)],Wbt.prototype,"minHeight",void 0),Bft([e(0)],Wbt.prototype,"minWidth",void 0),Bft([e(0)],Wbt.prototype,"maxHeight",void 0),Bft([e(0)],Wbt.prototype,"maxWidth",void 0),Bft([e(!1)],Wbt.prototype,"isLock",void 0),Bft([e("UI Drawn Annotation")],Wbt.prototype,"annotationAddMode",void 0),Bft([e("")],Wbt.prototype,"annotationSettings",void 0),Bft([e(16)],Wbt.prototype,"previousFontSize",void 0),Bft([t({isBold:!1,isItalic:!1,isStrikeout:!1,isUnderline:!1},Cft)],Wbt.prototype,"font",void 0),Bft([t({x:0,y:0},Mft)],Wbt.prototype,"labelBounds",void 0),Bft([e(null)],Wbt.prototype,"customData",void 0),Bft([e(["None"])],Wbt.prototype,"allowedInteractions",void 0),Bft([e(!0)],Wbt.prototype,"isPrint",void 0),Bft([e(!1)],Wbt.prototype,"isReadonly",void 0),Bft([e(0)],Wbt.prototype,"pageRotation",void 0),Bft([e("")],Wbt.prototype,"icon",void 0),Bft([e(!1)],Wbt.prototype,"isAddAnnotationProgrammatically",void 0),Bft([e(!1)],Wbt.prototype,"isTransparentSet",void 0);var zbt,jbt=Wbt;function Wbt(e,t,i,n){return zbt.call(this,e,t,i,n)||this}Vft(qbt,Qbt=n),Bft([e("")],qbt.prototype,"id",void 0),Bft([e("")],qbt.prototype,"signatureType",void 0),Bft([e("")],qbt.prototype,"name",void 0),Bft([e("")],qbt.prototype,"value",void 0),Bft([e(null)],qbt.prototype,"formFieldAnnotationType",void 0),Bft([e("#daeaf7ff")],qbt.prototype,"backgroundColor",void 0),Bft([e("black")],qbt.prototype,"color",void 0),Bft([e("#303030")],qbt.prototype,"borderColor",void 0),Bft([e("")],qbt.prototype,"tooltip",void 0),Bft([e(1)],qbt.prototype,"opacity",void 0),Bft([e(1)],qbt.prototype,"thickness",void 0),Bft([e(0)],qbt.prototype,"rotateAngle",void 0),Bft([t({x:0,y:0},Mft)],qbt.prototype,"bounds",void 0),Bft([e(0)],qbt.prototype,"pageIndex",void 0),Bft([e(1)],qbt.prototype,"pageNumber",void 0),Bft([e(-1)],qbt.prototype,"zIndex",void 0),Bft([e(null)],qbt.prototype,"wrapper",void 0),Bft([e(16)],qbt.prototype,"fontSize",void 0),Bft([e("Helvetica")],qbt.prototype,"fontFamily",void 0),Bft([e("None")],qbt.prototype,"fontStyle",void 0),Bft([e("left")],qbt.prototype,"alignment",void 0),Bft([e(0)],qbt.prototype,"minHeight",void 0),Bft([e(0)],qbt.prototype,"minWidth",void 0),Bft([e(0)],qbt.prototype,"maxHeight",void 0),Bft([e(0)],qbt.prototype,"maxWidth",void 0),Bft([e(0)],qbt.prototype,"maxLength",void 0),Bft([e("visible")],qbt.prototype,"visibility",void 0),Bft([e(!0)],qbt.prototype,"isPrint",void 0),Bft([e(!1)],qbt.prototype,"isReadonly",void 0),Bft([e(!1)],qbt.prototype,"isChecked",void 0),Bft([e(!1)],qbt.prototype,"isSelected",void 0),Bft([e(!1)],qbt.prototype,"isRequired",void 0),Bft([e(!1)],qbt.prototype,"isMultiline",void 0),Bft([e(!1)],qbt.prototype,"isTransparent",void 0),Bft([e(!1)],qbt.prototype,"insertSpaces",void 0),Bft([e("")],qbt.prototype,"options",void 0),Bft([e()],qbt.prototype,"signatureIndicatorSettings",void 0),Bft([t({isBold:!1,isItalic:!1,isStrikeout:!1,isUnderline:!1},Cft)],qbt.prototype,"font",void 0),Bft([e()],qbt.prototype,"selectedIndex",void 0),Bft([e(null)],qbt.prototype,"customData",void 0);var Qbt,Ubt=qbt;function qbt(e,t,i,n){return Qbt.call(this,e,t,i,n)||this}Object.defineProperty(Ybt.prototype,"pageId",{get:function(){return this.pageIdTemp},set:function(e){this.pageIdTemp=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ybt.prototype,"zIndex",{get:function(){return this.zIndexTemp},set:function(e){this.zIndexTemp=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ybt.prototype,"objects",{get:function(){return this.childNodesTemp},set:function(e){this.childNodesTemp=e},enumerable:!0,configurable:!0});var Gbt=Ybt;function Ybt(){this.pageIdTemp=0,this.zIndexTemp=-1,this.childNodesTemp=[],this.objects=[],this.zIndexTemp=-1,this.pageIdTemp=0}Xbt=function(e,t){return(Xbt=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])}))(e,t)};var Xbt,Kbt,d=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Jbt=(function(e,t){function i(){this.constructor=e}Xbt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Zbt,Kbt=n),Zbt.prototype.init=function(e){var t=new Uvt;if(t.measureChildren=!1,t.children=[],this.formFields&&0<this.formFields.length)for(var i=0;i<this.formFields.length;i++){var n=e.pdfViewer.nameTable[this.formFields[parseInt(i.toString(),10)].id].wrapper;t.children.push(n)}else if(this.annotations)for(i=0;i<this.annotations.length;i++)je(this.annotations[parseInt(i.toString(),10)])||(n=e.pdfViewer.nameTable[this.annotations[parseInt(i.toString(),10)].id].wrapper,t.children.push(n));return this.wrapper=t},d([e(null)],Zbt.prototype,"wrapper",void 0),d([kt([],jbt)],Zbt.prototype,"annotations",void 0),d([kt([],Ubt)],Zbt.prototype,"formFields",void 0),d([e()],Zbt.prototype,"width",void 0),d([e()],Zbt.prototype,"height",void 0),d([e(0)],Zbt.prototype,"rotateAngle",void 0),d([e(0)],Zbt.prototype,"offsetX",void 0),d([e(0)],Zbt.prototype,"offsetY",void 0),d([t({x:.5,y:.5},Cbt)],Zbt.prototype,"pivot",void 0),Zbt);function Zbt(){return null!==Kbt&&Kbt.apply(this,arguments)||this}function $bt(e){return"Line"===e.shapeAnnotationType||"LineWidthArrowHead"===e.shapeAnnotationType||"Distance"===e.shapeAnnotationType||"Polygon"===e.shapeAnnotationType}function ewt(e,t){var i;e&&t&&(e.formFieldAnnotationType?-1!==e.id.indexOf("diagram_helper")?(t.style.fill="transparent",t.style.strokeWidth=1,t.style.strokeDashArray=e.borderDashArray):(t.style.fill="transparent",t.style.strokeWidth=0):(i="#ffffff00"===e.fillColor?"transparent":e.fillColor,t.style.fill=i||"white",t.style.strokeColor=e.strokeColor||e.borderColor,t.style.color=e.strokeColor||e.borderColor,t.style.strokeWidth=e.thickness,"Image"!==e.shapeAnnotationType&&"SignatureText"!==e.shapeAnnotationType&&"SignatureImage"!==e.shapeAnnotationType||(t.style.strokeWidth=0),t.style.strokeDashArray=e.borderDashArray,t.style.opacity=e.opacity))}function twt(e){for(var t=0,i=0;i<e.length-1;i++)t+=Cbt.findLength(e[parseInt(i.toString(),10)],e[i+1]);return t}function iwt(e,t){e={width:e.actualSize.width,height:e.actualSize.height,x:e.offsetX-e.actualSize.width*e.pivot.x+.5,y:e.offsetY-e.actualSize.height*e.pivot.y+.5,angle:e.rotateAngle+e.parentTransform,fill:e.style.fill,stroke:e.style.strokeColor,pivotX:e.pivot.x,pivotY:e.pivot.y,strokeWidth:1,opacity:e.style.opacity,dashArray:e.style.strokeDashArray||"",visible:e.visible,id:e.id};return t&&(e.x+=t.tx,e.y+=t.ty),e}function nwt(e){return e=void 0!==e&&"string"==typeof e?R(e,window):e}function owt(e,t,i){var n={};if(e){i=e.propName;for(var o=e.properties||e,r=[],s=[],a=((r=r.concat(Object.keys(o))).push("version"),i&&(s=(o=nwt(t))?o(i):[],r=r.concat(s)),swt(i)),l=0,h=r=r.concat(a);l<h.length;l++){var d=h[l];"historyManager"!==d&&("wrapper"!==d?e[""+d]&&Object.prototype.hasOwnProperty.call(e,"observers")||(e[""+d]instanceof Array?n[""+d]=rwt((-1===a.indexOf(d)&&e[""+i]?e[""+i]:e)[""+d],t):e[""+d]instanceof Array==!1&&e[""+d]instanceof HTMLElement?n[""+d]=e[""+d].cloneNode(!0).innerHtml:e[""+d]instanceof Array==!1&&e[""+d]instanceof Object&&"template"!==d?n[""+d]=owt((-1===a.indexOf(d)&&e[""+i]?e[""+i]:e)[""+d]):n[""+d]=e[""+d]):e[""+d]&&(n[""+d]={actualSize:{width:e[""+d].actualSize.width,height:e[""+d].actualSize.height},offsetX:e[""+d].offsetX,offsetY:e[""+d].offsetY}))}}return n}function rwt(e,t,i){if(e)for(var n=[],o=0;o<e.length;o++)!(e[parseInt(o.toString(),10)]instanceof Array)&&e[parseInt(o.toString(),10)]instanceof Object?n.push(owt(e[parseInt(o.toString(),10)],t)):n.push(e[parseInt(o.toString(),10)]);return n}function swt(e){switch(e){case"nodes":case"children":return["inEdges","outEdges","parentId","processId","nodeId","umlIndex","isPhase","isLane"];case"connectors":return["parentId"];case"annotation":case"annotations":return["nodeId"];case"shape":return["hasHeader"]}return[]}function awt(e,t){var i;if("Distance"===e.shapeAnnotationType)for(var n=0,o=void 0,r=0;r<e.wrapper.children.length;r++){var s=Cbt.findAngle(e.sourcePoint,e.targetPoint);if(-1<e.wrapper.children[parseInt(r.toString(),10)].id.indexOf("leader")){var a=e.wrapper.children[0].bounds.center,a=0===n?(o={x:e.sourcePoint.x,y:e.sourcePoint.y-e.leaderHeight},e.sourcePoint):(o={x:e.targetPoint.x,y:e.targetPoint.y-e.leaderHeight},e.targetPoint),l=uvt();if(mvt(l,s,a.x,a.y),i=gvt(l,{x:o.x,y:o.y}),t==="Leader"+n)return{leader:"leader"+n,point:i};n++}}return{leader:"",point:i}}function lwt(e,t){var i=e.vertexPoints.slice(0);return i&&0<i.length&&(e.sourcePoint=i[0],e.targetPoint=i[i.length-1]),i}function hwt(e,t){for(var i,n="",o=[],r=0;r<t.length;)o.push({x:t[parseInt(r.toString(),10)].x,y:t[parseInt(r.toString(),10)].y}),r++;for(var o=gwt(e,o),s=0;s<o.length;s++)i=o[parseInt(s.toString(),10)],0===s&&(n="M"+i.x+" "+i.y),0<s&&(n+=" L"+i.x+" "+i.y);return n}function dwt(e,t,i){new dvt;var n=hwt(e,t),t=dvt.toBounds(t);return i.width=t.width,i.height=t.height,i.offsetX=t.x+i.width/2,i.offsetY=t.y+i.height/2,i.data=n,e.wrapper&&(e.wrapper.offsetX=i.offsetX,e.wrapper.offsetY=i.offsetY,n=t.width,n=t.width<t.height?t.height:t.width,e.wrapper.width=e.enableShapeLabel?n/2:n,e.wrapper.height=t.height),i}function pwt(e,t){var i=lwt(e);return t.staticSize=!0,ewt(e,t=dwt(e,i,t)),t}function cwt(e,t,i,n,o){t.offsetX=i.x,t.offsetY=i.y;i=Cbt.findAngle(i,n),n=Dwt(o?e.sourceDecoraterShapes:e.taregetDecoraterShapes),o=0,o="LineWidthArrowHead"===e.shapeAnnotationType||"Line"===e.shapeAnnotationType?(o=e.thickness,new avt(12*o,12*o)):(o=e.thickness<=5?5:e.thickness,new avt(2*o,2*o));t.transform=evt.Self,ewt(e,t),t.style.fill="tranparent"!==e.fillColor?e.fillColor:"white",t.rotateAngle=i,t.data=n,t.canMeasurePath=!0,t.width=o.width,t.height=o.height,"Butt"===e.sourceDecoraterShapes&&(t.width=o.width-10,t.height=o.height+10)}function uwt(e,t,i,n){var o=new ybt;return cwt(e,o,t,i,n),o}function gwt(e,t){return t[0]=mwt(e,t,!0),t[t.length-1]=mwt(e,t,!1),t}function mwt(e,t,i){var n={x:0,y:0},o=t.length,r=i?t[0]:t[o-1],i=i?t[1]:t[o-2],t=0===(t=Cbt.distancePoints(r,i))?1:t,o=e.thickness;n.x=Math.round(r.x+o*(i.x-r.x)/t),n.y=Math.round(r.y+o*(i.y-r.y)/t);return n=Cbt.adjustPoint(n,i,!0,.5)}function fwt(e,t,i,n){var o=[],r=Cbt.findAngle(t[0],t[1]),s=Awt(e,r);return!n.enableImportAnnotationMeasurement&&e.notes&&""!==e.notes?s.content=e.notes:s.content=i.setConversion(twt([t[0],t[1]])*i.pixelToPointFactor,e),s.rotateValue={y:-10,angle:r},!0===e.enableShapeLabel&&(s.style.strokeColor=e.labelBorderColor,s.style.fill=e.labelFillColor,s.style.fontSize=e.fontSize,s.style.color=e.fontColor,s.style.fontFamily=e.fontFamily),o.push(s),o}function ywt(e,t,i){for(var n,o=0;o<e.wrapper.children.length;o++){var r=e.wrapper.children[parseInt(o.toString(),10)];r&&!je(r.content)&&(n=i.setConversion(twt([t[0],t[1]])*i.pixelToPointFactor,e),r.content=n,r.childNodes[0].text=r.content,r.refreshTextElement())}return n}function vwt(e,t){for(var i,n=0;n<e.wrapper.children.length;n++){var o=e.wrapper.children[parseInt(n.toString(),10)];o&&!je(o.content)&&(i=t.setConversion(e.bounds.width/2*t.pixelToPointFactor,e),o.content=i,2===o.childNodes.length?(o.childNodes[0].text=i,o.childNodes.splice(o.childNodes.length-1,1)):o.childNodes[0].text=i,o.refreshTextElement())}return i}function bwt(e,t,i,n){var o=[],t=Cbt.findAngle(t[0],t[1]),r=Awt(e,t);return!n.enableImportAnnotationMeasurement&&e.notes&&""!==e.notes?r.content=e.notes:r.content=i.calculatePerimeter(e),!0===e.enableShapeLabel&&(r.style.strokeColor=e.labelBorderColor,r.style.fill=e.labelFillColor,r.style.fontSize=e.fontSize,r.style.color=e.fontColor,r.style.fontFamily=e.fontFamily),r.rotateValue={y:-10,angle:t},o.push(r),o}function wwt(e,t,i){for(var n,o=0;o<e.wrapper.children.length;o++){var r=e.wrapper.children[parseInt(o.toString(),10)];r&&!je(r.content)&&(n=i.calculatePerimeter(e),r.content=n,r.childNodes[0].text=r.content,r.refreshTextElement())}return n}function Cwt(e){if(e.wrapper&&e.wrapper.children)for(var t=0;t<e.wrapper.children.length;t++){var i=e.wrapper.children[parseInt(t.toString(),10)];i&&!je(i.content)&&(i.content=e.notes,i.childNodes[0].text=i.content,i.refreshTextElement())}}function Swt(e){for(var t,i="",i="M"+e[0].x+" "+e[0].y,n=1;n<e.length;n++)i+="L"+(t=e[parseInt(n.toString(),10)]).x+" "+t.y;return i+="Z"}function Awt(e,t){var i=new Xvt;return ewt(e,i),i.style.fill="transparent",i.id=kvt(),i.horizontalAlignment="Center",i.rotateValue={y:10,angle:t},i.verticalAlignment="Top",i.relativeMode="Object",i.setOffsetWithRespectToBounds(.5,.5,"Absolute"),i.style.textWrapping="NoWrap",i}function xwt(e,t){var i=[],n=Iwt(e,t[0],t[1]);return i.push(n),n=Iwt(e,t[1],t[0],!0),i.push(n),i}function Iwt(e,t,i,n){var o=new ybt,r=(o.offsetX=t.x,o.offsetY=t.y,Cbt.findAngle(t,i)),i={x:(t.x+i.x)/2,y:(t.y+i.y)/2},s=uvt();mvt(s,0-r,i.x,i.y);var a={x:(i=gvt(s,t)).x,y:i.y-e.leaderHeight},i=(mvt(s=uvt(),r,o.offsetX,o.offsetY),gvt(s,a)),s={x:t.x,y:t.y},a=(o.offsetX=s.x,o.offsetY=s.y,o.transform=evt.Self,"M"+t.x+","+t.y+",L"+i.x+","+i.y+"Z"),s=new avt(0,e.leaderHeight);return o.pivot.x=.5,n?(o.id="leader2_"+kvt(),o.pivot.y=0):(o.id="leader1_"+kvt(),o.pivot.y=1),ewt(e,o),o.rotateAngle=r,o.data=a,o.canMeasurePath=!0,o.width=s.width,o.height=s.height,o}function Twt(e,t){var i=e.vertexPoints;if(!je(i))for(var n=0;n<i.length-1;n++){var o=i[parseInt(n.toString(),10)],r=i[n+1],s=dvt.toBounds([o,r]);if(s.Inflate(10),s.containsPoint(t)){var s=Ewt(t,o,r),a=Fbt({x1:o.x,x2:r.x,y1:o.y,y2:r.y},{x1:t.x,x2:s.x,y1:t.y,y2:s.y});if(a.enabled){a=Cbt.findLength(t,a.intersectPt);if(Math.abs(a)<10)return!0}else{a=dvt.toBounds([t,t]);if(a.Inflate(3),a.containsPoint(o)||a.containsPoint(r))return!0}if(Cbt.equals(t,s))return!0}}return!1}function Ewt(e,t,i){var n=Cbt.findLength(t,e),n=Cbt.findLength(i,e)<n?i:t,t=Cbt.findAngle(t,i),i=Cbt.findAngle(n,e),e=Cbt.findLength(n,e),t=i+2*(t-i);return{x:n.x+e*Math.cos(t*Math.PI/180),y:n.y+e*Math.sin(t*Math.PI/180)}}function Dwt(e){return Mwt[""+e]}var Mwt={OpenArrow:"M15.9,23 L5,16 L15.9,9 L17,10.7 L8.7,16 L17,21.3Z",Square:"M0,0 L10,0 L10,10 L0,10 z",Fletch:"M14.8,10c0,0-3.5,6,0.2,12c0,0-2.5-6-10.9-6C4.1,16,11.3,16,14.8,10z",OpenFetch:"M6,17c-0.6,0-1-0.4-1-1s0.4-1,1-1c10.9,0,11-5,11-5c0-0.6,0.4-1,1-1s1,0.4,1,1C19,10.3,18.9,17,6,17C6,17,6,17,6,17z M18,23c-0.5,0-1-0.4-1-1c0-0.2-0.3-5-11-5c-0.6,0-1-0.5-1-1s0.4-1,1-1c0,0,0,0,0,0c12.9,0,13,6.7,13,7    C19,22.6,18.6,23,18,23z",IndentedArrow:"M17,10c0,0-4.5,5.5,0,12L5,16L17,10z",OutdentedArrow:"M14.6,10c0,0,5.4,6,0,12L5,16L14.6,10z",DoubleArrow:"M19,10 L19,22 L13,16Z M12,10 L12,22 L6,16Z",Arrow:"M15,10 L15,22 L5,16Z",Diamond:"M12,23l-7-7l7-7l6.9,7L12,23z",Circle:"M0,50 A50,50,0 1 1 100,50 A50,50,0 1 1 0,50 Z",Butt:"M0,0 L0,90"};kwt=function(e,t){return(kwt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}kwt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Fwt,Pwt=zvt),Fwt.prototype.templateCompiler=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){return oo(t)}},Fwt.prototype.getNodeTemplate=function(){return this.templateFn};var kwt,Pwt,Bwt=Fwt;function Fwt(e){var t=Pwt.call(this)||this;return t.templateFn=t.templateCompiler(e),t}Rwt.prototype.renderLabels=function(e){var t=e.annotations;if(t)for(var i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];this.initObject(n)}},Rwt.prototype.createNewZindexTable=function(e){var t=new Gbt;return this.pdfViewer.zIndex++,t.pageId=this.pdfViewer.zIndex,this.pdfViewer.zIndexTable.push(t),t},Rwt.prototype.getPageTable=function(e){var t;if(void 0!==this.pdfViewer.zIndexTable.length){for(var i=!0,n=0;n<this.pdfViewer.zIndexTable.length;n++)if(this.pdfViewer.zIndexTable[parseInt(n.toString(),10)].pageId===e){i=!1,t=this.pdfViewer.zIndexTable[parseInt(n.toString(),10)];break}i&&((t=this.createNewZindexTable(e)).pageId=e)}else t=this.createNewZindexTable(e);return t},Rwt.prototype.setZIndex=function(e,t){if(void 0!==t.pageIndex){var i,n=this.getPageTable(t.pageIndex),o=!1;if("Polygon"!==t.shapeAnnotationType)for(var r=0;r<n.objects.length;r++)if(t.id===n.objects[parseInt(r.toString(),10)].id){n.objects.splice(parseInt(r.toString(),10),1),n.objects.splice(parseInt(r.toString(),10),0,t),o=!0;break}o||(-1===t.zIndex?(n.zIndex++,t.zIndex=n.zIndex):(i=n.objects.length,t.zIndex=i++),n.objects.push(t))}},Rwt.prototype.initObject=function(e){return this.setZIndex(this.pdfViewer.zIndex,e),Dvt(),$bt(e)?(this.initLine(e),e.wrapper.measure(new avt(void 0,void 0)),e.wrapper.arrange(e.wrapper.desiredSize)):this.initNode(e),e.wrapper,(this.pdfViewer.nameTable[e.id]=e).formFieldAnnotationType&&this.nodePropertyChange(e,{bounds:{width:e.bounds.width,height:e.bounds.height}}),e},Rwt.prototype.initNode=function(e){var t=this.initContainer(e);t.children||(t.children=[]),this.init(e,t),t.rotateAngle=e.rotateAngle,t.measure(new avt(e.wrapper.width,e.wrapper.height)),t.arrange(t.desiredSize),this.isDynamicStamps&&(this.pdfViewer.annotation.stampAnnotationModule.updateSessionStorage(e,null,"dynamicStamp"),this.isDynamicStamps=!1)},Rwt.prototype.init=function(e,t){var i=new zvt,n=this.pdfViewer.annotationModule?this.pdfViewer.annotationModule.findAnnotationSettings(e):{},o=0,r=0,s=0,a=0,n=((n.minWidth||n.maxWidth||n.minHeight||n.maxHeight)&&(o=n.maxHeight||2e3,r=n.maxWidth||2e3,s=n.minHeight||0,a=n.minWidth||0),!1);return(s||a||o||r)&&(n=!0),(i=e.formFieldAnnotationType?this.initFormFields(e,i,t):this.initAnnotationObject(e,void 0,i,t,!1,void 0,n,o,r,a,s)).id=e.id+"_content",i.relativeMode="Object","Stamp"!==e.shapeAnnotationType&&(void 0!==e.bounds.width&&(i.width=e.bounds.width,n)&&(i.width<a||i.width>r)&&(i.width<a&&(i.width=a),i.width>r)&&(i.width=r),i.horizontalAlignment="Stretch",void 0!==e.bounds.height&&(i.height=e.bounds.height,n)&&(i.height<s||i.width>o)&&(i.height<s&&(i.height=s),i.height>o)&&(i.height=o),ewt(e,i),this.pdfViewer.viewerBase.drawSignatureWithTool)&&"SignatureText"===e.shapeAnnotationType&&(i.style.strokeWidth=0),i.isRectElement=!0,i.verticalAlignment="Stretch",i},Rwt.prototype.initFormFields=function(e,t,i){switch(e.formFieldAnnotationType){case"Textbox":case"PasswordField":case"Checkbox":case"RadioButton":case"DropdownList":case"ListBox":case"SignatureField":case"InitialField":(t=new Bwt).id=e.id+"_content",i.children.push(t)}return t},Rwt.prototype.initAnnotationObject=function(e,t,i,n,o,r,s,a,l,h,d){switch(e.shapeAnnotationType){case"Ellipse":(t=new ybt).data="M80.5,12.5 C80.5,19.127417 62.59139,24.5 40.5,24.5 C18.40861,24.5 0.5,19.127417 0.5,12.5C0.5,5.872583 18.40861,0.5 40.5,0.5 C62.59139,0.5 80.5,5.872583 80.5,12.5 z",i=t,n.children.push(i),e.enableShapeLabel&&((g=this.textElement(e)).content=e.labelContent,g.style.color=e.fontColor,g.style.strokeColor=e.labelBorderColor,g.style.fill=e.labelFillColor,g.style.fontSize=e.fontSize,g.style.fontFamily=e.fontFamily,g.style.opacity=e.labelOpacity,n.children.push(g));break;case"Path":(t=new ybt).data=e.data,i=t,n.children.push(i);break;case"HandWrittenSignature":case"Ink":(t=new ybt).data=e.data,t.style.strokeColor=e.strokeColor,t.style.strokeWidth=e.thickness,t.style.opacity=e.opacity,i=t,n.children.push(i);break;case"Polygon":(t=new ybt).data=Swt(e.vertexPoints),i=t,n.children.push(i);break;case"Stamp":this.isDynamicStamps=o=!0,e&&e.annotationAddMode&&("Existing Annotation"===e.annotationAddMode||"Imported Annotation"===e.annotationAddMode)&&(e.bounds.width=e.bounds.width-20,e.bounds.height=e.bounds.height-20),e.isDynamicStamp?(n.horizontalAlignment="Left",(i=r=new zvt).cornerRadius=10,i.style.fill=e.stampFillColor,i.style.strokeColor=e.stampStrokeColor,n.children.push(i),c=this.textElement(e),(c=new Xvt).style.fontFamily="Helvetica",c.style.fontSize=14,c.style.italic=!0,c.style.bold=!0,c.style.color=e.fillColor,c.rotateValue=void 0,c.content=e.dynamicText,c.relativeMode="Point",c.margin.left=10,c.margin.bottom=-7,c.setOffsetWithRespectToBounds(0,.57,null),c.relativeMode="Point","Existing Annotation"!==e.annotationAddMode&&"Imported Annotation"!==e.annotationAddMode||(c.style.fontSize=this.fontSizeCalculation(e,c,e.bounds.width-10)),n.children.push(c),(p=new ybt).id=kvt()+"_stamp",p.data=e.data,p.width=e.bounds.width,s&&e.bounds.width>l&&(p.width=l,e.bounds.width=l),p.height=e.bounds.height/2,s&&e.bounds.height>a&&(p.height=a/2,e.bounds.height=a/2),p.rotateValue=void 0,p.margin.left=10,p.margin.bottom=-5,p.relativeMode="Point",p.setOffsetWithRespectToBounds(0,.1,null),(u=p).style.fill=e.fillColor,p.style.strokeColor=e.strokeColor,p.style.opacity=e.opacity,i.width=e.bounds.width+20,i.height=e.bounds.height+20,i.style.opacity=e.opacity,n.children.push(u)):(n.horizontalAlignment="Left",(i=r=new zvt).cornerRadius=10,i.style.fill=e.stampFillColor,i.style.strokeColor=e.stampStrokeColor,n.children.push(i),(p=new ybt).id=kvt()+"_stamp",p.data=e.data,p.width=e.bounds.width,s&&e.bounds.width>l&&(p.width=l,e.bounds.width=l),p.height=e.bounds.height,s&&e.bounds.height>a&&(p.height=a,e.bounds.height=a),p.minWidth=p.width/2,p.minHeight=p.height/2,(u=p).style.fill=e.fillColor,p.style.strokeColor=e.strokeColor,p.style.opacity=e.opacity,i.width=e.bounds.width+20,i.height=e.bounds.height+20,i.minWidth=p.width/2,i.minHeight=p.height/2,i.style.opacity=e.opacity,n.children.push(u),n.minHeight=i.minHeight+20,n.minWidth=i.minWidth+20);break;case"Image":case"SignatureImage":var p=new nbt;p.source=e.data,(i=p).style.strokeWidth=0,n.children.push(i);break;case"Rectangle":i=r=new zvt,n.children.push(i),e.enableShapeLabel&&((g=this.textElement(e)).content=e.labelContent,g.style.color=e.fontColor,g.style.strokeColor=e.labelBorderColor,g.style.fill=e.labelFillColor,g.style.fontSize=e.fontSize,g.style.fontFamily=e.fontFamily,g.style.opacity=e.labelOpacity,n.children.push(g));break;case"Perimeter":(t=new ybt).data="M80.5,12.5 C80.5,19.127417 62.59139,24.5 40.5,24.5 C18.40861,24.5 0.5,19.127417 0.5,12.5C0.5,5.872583 18.40861,0.5 40.5,0.5 C62.59139,0.5 80.5,5.872583 80.5,12.5 z",ewt(e,i=t),n.children.push(i),(r=new zvt).id="perimeter_"+kvt(),r.height=.2,r.width=.2,r.transform=evt.Self,r.horizontalAlignment="Stretch",this.setNodePosition(r,e),r.rotateAngle=e.rotateAngle,ewt(e,r),n.children.push(r);var c=this.textElement(e);(c=new Xvt).content=c.content=twt([{x:e.bounds.x,y:e.bounds.y},{x:e.bounds.x+e.bounds.width,y:e.bounds.y+e.bounds.height}]).toString(),c.rotateValue={y:-10,angle:e.rotateAngle},n.children.push(c);break;case"Radius":(t=new ybt).data="M80.5,12.5 C80.5,19.127417 62.59139,24.5 40.5,24.5 C18.40861,24.5 0.5,19.127417 0.5,12.5C0.5,5.872583 18.40861,0.5 40.5,0.5 C62.59139,0.5 80.5,5.872583 80.5,12.5 z",ewt(e,i=t),n.children.push(i),(r=new zvt).id="radius_"+kvt(),r.height=.2,r.width=e.bounds.width/2,r.transform=evt.Self,this.setNodePosition(r,e),r.rotateAngle=e.rotateAngle,ewt(e,r),n.children.push(r);var u=this.textElement(e);e.enableShapeLabel&&(u.style.color=e.fontColor,u.style.strokeColor=e.labelBorderColor,u.style.fill=e.labelFillColor,u.style.fontSize=e.fontSize,u.style.fontFamily=e.fontFamily,u.style.opacity=e.labelOpacity),twt([{x:e.bounds.x,y:e.bounds.y},{x:e.bounds.x+e.bounds.width,y:e.bounds.y+e.bounds.height}]);!this.pdfViewer.enableImportAnnotationMeasurement&&e.notes&&""!==e.notes?u.content=e.notes:u.content=this.pdfViewer.annotation.measureAnnotationModule.setConversion(e.bounds.width/2*this.pdfViewer.annotation.measureAnnotationModule.pixelToPointFactor,e),u.rotateValue={y:-10,x:e.bounds.width/4,angle:e.rotateAngle},n.children.push(u);break;case"StickyNotes":p=new nbt;p.source=e.data,p.width=e.bounds.width,p.height=e.bounds.height,p.style.strokeColor=e.strokeColor,p.style.strokeWidth=0,n.children.push(i=p);break;case"SignatureText":var g=new zvt,c=(g.style.strokeWidth=0,(i=g).style.strokeWidth=0,n.style.strokeWidth=0,n.children.push(i),this.textElement(e));c.style.fontFamily=e.fontFamily,c.style.fontSize=e.fontSize,c.style.textAlign="Left",c.rotateValue=void 0,c.content=e.data,c.style.strokeWidth=0,n.children.push(c);break;case"FreeText":u=new zvt,p=(n.children.push(i=u),this.textElement(e));(p=new Xvt).style.fontFamily=e.fontFamily,p.style.fontSize=e.fontSize,p.style.textAlign="Left","center"===e.textAlign.toLowerCase()?p.style.textAlign="Center":"right"===e.textAlign.toLowerCase()?p.style.textAlign="Right":"justify"===e.textAlign.toLowerCase()&&(p.style.textAlign="Justify"),p.style.color=e.fontColor,p.style.bold=e.font.isBold,p.style.italic=e.font.isItalic,!0===e.font.isUnderline?p.style.textDecoration="Underline":!0===e.font.isStrikeout&&(p.style.textDecoration="LineThrough"),p.rotateValue=void 0,p.content=e.dynamicText,p.style.opacity=e.opacity,p.margin.left=4,p.margin.right=5,p.margin.top=e.fontSize/16*5,this.pdfViewer.freeTextSettings.enableAutoFit?p.style.textWrapping="Wrap":p.style.textWrapping="WrapWithOverflow",p.relativeMode="Point",p.setOffsetWithRespectToBounds(0,0,null),p.relativeMode="Point",n.children.push(p)}return i.id=e.id+"_content",i.relativeMode="Object",o||(void 0!==e.bounds.width&&(i.width=e.bounds.width,s)&&(i.width<h||i.width>l)&&(i.width<h&&(i.width=h),i.width>l)&&(i.width=l),i.horizontalAlignment="Stretch",void 0!==e.bounds.height&&(i.height=e.bounds.height,s)&&(i.height<d||i.width>a)&&(i.height<d&&(i.height=d),i.height>a)&&(i.height=a),ewt(e,i)),i.isRectElement=!0,i.verticalAlignment="Stretch",i},Rwt.prototype.textElement=function(e){var t=new Xvt;return ewt(e,t),t.horizontalAlignment="Center",t.verticalAlignment="SignatureText"===e.shapeAnnotationType?"Center":"Top",t.relativeMode="Object",t.setOffsetWithRespectToBounds(.5,.5,"Absolute"),t},Rwt.prototype.setNodePosition=function(e,t){var i,n,o;"Perimeter"===t.shapeAnnotationType?(e.offsetX=t.bounds.x+t.bounds.width/2,e.offsetY=t.bounds.y+t.bounds.height/2):"Radius"===t.shapeAnnotationType&&(i={x:t.bounds.x+t.bounds.width/2+t.bounds.width/4,y:t.bounds.y+t.bounds.height/2},n={x:t.bounds.x+t.bounds.width/2,y:t.bounds.y+t.bounds.height/2},mvt(o=uvt(),t.rotateAngle,n.x,n.y),o={x:(n=gvt(o,i)).x,y:n.y},e.offsetX=o.x,e.offsetY=o.y,e.width=t.bounds.width/2)},Rwt.prototype.initContainer=function(e){e.id||(e.id=kvt());var t=new $vt;return t.id=e.id,t.offsetX=e.bounds.x+.5*e.bounds.width,t.offsetY=e.bounds.y+.5*e.bounds.height,t.style.fill="transparent",t.style.strokeColor="transparent",t.rotateAngle=e.rotateAngle,e.wrapper=t},Rwt.prototype.initLine=function(e){e.id||(e.id=kvt());var t=new $vt,i=((r=new ybt).id=e.id+"_path",new ybt),n=new ybt;if(e.vertexPoints.length){e.sourcePoint=e.vertexPoints[0],e.targetPoint=e.vertexPoints[e.vertexPoints.length-1];for(var o=0;o<e.vertexPoints.length;o++)0!==o&&o!==e.vertexPoints.length-1&&e.segments.push(e.vertexPoints[parseInt(o.toString(),10)])}var r=pwt(e,r),s=lwt(e),a=[],l=[],h=("Distance"===e.shapeAnnotationType&&(a=xwt(e,s),l=fwt(e,s,this.pdfViewer.annotation.measureAnnotationModule,this.pdfViewer)),"Line"!==e.shapeAnnotationType&&"LineWidthArrowHead"!==e.shapeAnnotationType||"Perimeter"!==e.measureType||(l=bwt(e,s,this.pdfViewer.annotation.measureAnnotationModule,this.pdfViewer)),!0===e.enableShapeLabel&&"Distance"!==e.shapeAnnotationType&&"Perimeter"!==e.measureType&&(h=Cbt.findAngle(s[0],s[1]),(d=this.textElement(e)).id=kvt(),!this.pdfViewer.enableImportAnnotationMeasurement&&e.notes&&""!==e.notes?d.content=e.notes:d.content=e.labelContent,d.style.strokeColor=e.labelBorderColor,d.style.fill=e.labelFillColor,d.style.fontSize=e.fontSize,d.style.color=e.fontColor,d.style.fontFamily=e.fontFamily,d.style.opacity=e.labelOpacity,d.rotateValue={y:-10,angle:h},l.push(d)),s=gwt(e,s),dvt.toBounds(s)),d=(t.width=h.width,t.height=h.height,t.offsetX=h.x+t.pivot.x*h.width,t.offsetY=h.y+t.pivot.y*h.height,e.vertexPoints);if("Line"!==e.shapeAnnotationType&&"LineWidthArrowHead"!==e.shapeAnnotationType&&"Distance"!==e.shapeAnnotationType||(i=uwt(e,s[0],d[1],!0),n=uwt(e,s[s.length-1],d[d.length-2],!1)),i.id=e.id+"_srcDec",n.id=e.id+"_tarDec",r.style.fill="transparent",t.style.strokeColor="transparent",t.style.fill="transparent",t.style.strokeWidth=0,t.children=[],ewt(e,r),t.children.push(r),0<a.length)for(o=0;o<a.length;o++)t.children.push(a[parseInt(o.toString(),10)]);if(0<l.length)for(o=0;o<l.length;o++)t.children.push(l[parseInt(o.toString(),10)]);if(t.children.push(i),t.children.push(n),"LineWidthArrowHead"===e.shapeAnnotationType)for(o=0;o<t.children.length;o++){var p=t.children[parseInt(o.toString(),10)];(p.id.includes("srcDec")||p.id.includes("tarDec"))&&(p.width=12*e.thickness,p.height=12*e.thickness)}return t.id=e.id,t.offsetX=r.offsetX,t.offsetY=r.offsetY,t.width=r.width,t.height=r.height,lwt(e),e.wrapper=t},Rwt.prototype.add=function(e){var t=this.pdfViewer.allowServerDataBinding;return this.pdfViewer.enableServerDataBinding(!1),(e.formFieldAnnotationType&&this.pdfViewer.formDesignerModule?(e=new Ubt(this.pdfViewer,"formFields",e,!0),e=this.initObject(e),this.pdfViewer.formFields):(e=new jbt(this.pdfViewer,"annotations",e,!0),e=this.initObject(e),this.pdfViewer.annotations)).push(e),this.pdfViewer.enableServerDataBinding(t,!0),e},Rwt.prototype.remove=function(e){for(var t=this.pdfViewer.allowServerDataBinding,i=(this.pdfViewer.enableServerDataBinding(!1),e.pageIndex),n=0;n<this.pdfViewer.annotations.length;n++){var o=this.pdfViewer.annotations[parseInt(n.toString(),10)];if(o.id&&(o.id===e.id||o.id.split("_")[0]===e.id)||o.wrapper&&o.wrapper.id===e.id){this.pdfViewer.annotations.splice(n,1);for(var r=this.getPageObjects(e.pageIndex),s=0;s<r.length;s++)r[parseInt(s.toString(),10)].id===e.id&&(r.splice(s,1),"Path"===e.shapeAnnotationType||"SignatureImage"===e.shapeAnnotationType||"SignatureText"===e.shapeAnnotationType?this.refreshCanvasDiagramLayer(void 0,i,e.id):this.pdfViewer.renderDrawing(void 0,i))}}for(n=0;n<this.pdfViewer.formFields.length;n++)if((l=this.pdfViewer.formFields[parseInt(n.toString(),10)]).id===e.id||l.wrapper.id===e.id){this.pdfViewer.formFields.splice(n,1),this.pdfViewer.formDesignerModule&&e.formFieldAnnotationType&&this.pdfViewer.formFieldCollection.splice(n,1);for(r=this.getPageObjects(e.pageIndex),s=0;s<r.length;s++){if(r[parseInt(s.toString(),10)].id===e.id){r.splice(s,1);break}r[parseInt(s.toString(),10)]&&r[parseInt(s.toString(),10)].id&&-1!==r[parseInt(s.toString(),10)].id.indexOf(e.id)&&r.splice(s,1)}}if("Textbox"===e.formFieldAnnotationType||"Checkbox"===e.formFieldAnnotationType||"RadioButton"===e.formFieldAnnotationType||"PasswordField"===e.formFieldAnnotationType||"DropdownList"===e.formFieldAnnotationType||"ListBox"===e.formFieldAnnotationType||"SignatureField"===e.formFieldAnnotationType||"InitialField"===e.formFieldAnnotationType){var a=document.getElementById("form_field_"+e.id+"_content_html_element");a&&(a.remove(),this.pdfViewer.renderDrawing(void 0,i));for(var l,n=0;n<this.pdfViewer.formFieldCollections.length;n++)(l=this.pdfViewer.formFieldCollections[parseInt(n.toString(),10)]).id===e.id&&this.pdfViewer.formFieldCollections.splice(n,1);for(n=0;n<this.pdfViewer.viewerBase.formFieldCollection.length;n++)e.id==this.pdfViewer.viewerBase.formFieldCollection[parseInt(n.toString(),10)]&&this.pdfViewer.viewerBase.formFieldCollection.splice(n,1);a={name:e.name,id:e.id,value:e.value,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,color:e.color,backgroundColor:e.backgroundColor,alignment:e.alignment,isReadonly:e.isReadonly,visibility:e.visibility,maxLength:e.maxLength,isRequired:e.isRequired,isPrint:e.isPrint,rotation:e.rotateAngle,tooltip:e.tooltip,options:e.options,isChecked:e.isChecked,isSelected:e.isSelected};je(a)||"diagram_helper"===a.id||(this.pdfViewer.fireFormFieldRemoveEvent("formFieldRemove",a,e.pageIndex),this.pdfViewer.formDesignerModule.removeFieldsFromAnnotationCollections(e.id,a.name))}this.pdfViewer.enableServerDataBinding(t,!0)},Rwt.prototype.getPageObjects=function(e){return this.getPageTable(e).objects},Rwt.prototype.refreshCanvasDiagramLayer=function(e,t,i){var n=this;if(e=e||this.pdfViewer.viewerBase.getAnnotationCanvas("_annotationCanvas_",t)){var o=void 0,o=e.id===this.pdfViewer.element.id+"_print_annotation_layer_"+t?1:this.pdfViewer.viewerBase.getZoomFactor(),r=e.width/o,s=e.height/o,a=e.getContext("2d");a.lineCap="round",a.lineJoin="round",o<1&&(a.lineWidth=a.lineWidth/o);var l=o*this.pdfViewer.viewerBase.getWindowDevicePixelRatio();!F.isDevice||F.isDevice&&o<=.7?a.setTransform(l,0,0,l,0,0):a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,r,s);for(var h=this.getPageObjects(t).filter(function(t,e,i){return"free"===t.id.split("_")[0]||(je(n.pdfViewer.formDesignerModule)?e===i.findIndex(function(e){return e.id===t.id}):e===i.findIndex(function(e){return e.id.split("_")[0]===t.id.split("_")[0]}))}),d=0;d<h.length;d++){var p,c,u=void 0;e.id===this.pdfViewer.element.id+"_print_annotation_layer_"+t?h[parseInt(d.toString(),10)].isPrint&&!je(u=this.pdfViewer.nameTable[h[parseInt(d.toString(),10)].id].wrapper)&&Ibt(e,[u],this.renderer):(u=this.pdfViewer.nameTable[h[parseInt(d.toString(),10)].id].wrapper,p=h[parseInt(d.toString(),10)].id,p=this.pdfViewer.nameTable[""+p],(u&&this.shouldRefreshElement(p)||je(this.pdfViewer.formDesignerModule))&&(!je(p.properties.data)&&p.properties.data.includes("base64")&&((c=new Image).src=p.properties.data,null==window.customStampCollection&&void 0===window.customStampCollection&&(window.customStampCollection=new Map),window.customStampCollection)&&!window.customStampCollection.get(u.id)&&window.customStampCollection.set(u.id,c),Ibt(e,[u],this.renderer)))}}},Rwt.prototype.shouldRefreshElement=function(e){var t=this.pdfViewer.nameTable[e.id.split("_")[0]];return!je(t)&&"visible"===e.visibility||!je(e.subject)&&"SignatureField"!==e.annotName&&je(e.visibility)||"annotations"===e.propName&&"Path"!==e.shapeAnnotationType&&"SignatureText"!==e.shapeAnnotationType&&"SignatureImage"!==e.shapeAnnotationType||"SignatureImage"===e.shapeAnnotationType&&"formFields"!==e.propName||"SignatureText"===e.shapeAnnotationType&&"formFields"!==e.propName||je(t)&&"diagram_helper"===e.id},Rwt.prototype.clearHighlighter=function(e){var e=this.getAdornerLayerSvg(this.pdfViewer.element.id+e+"_diagramAdornerLayer",e);e&&(e=e.getElementById(e.id+"_highlighter"))&&e.parentNode.removeChild(e)},Rwt.prototype.getSelectorElement=function(e,t){var i=null,n=this.getAdornerLayerSvg(e,t);return i=n?n.getElementById(e+t+"_SelectorElement"):i},Rwt.prototype.getAdornerLayerSvg=function(e,t){var i=null,e=xvt(e+t+"_diagramAdornerLayer");return i=e?e.getElementsByClassName("e-adorner-layer"+t)[0]:i},Rwt.prototype.clearSelectorLayer=function(e){var t=this.getAdornerLayerSvg(this.pdfViewer.element.id,e);if(t)for(var t=t.getElementById(this.pdfViewer.adornerSvgLayer.id+"_selected_region"),i=(t&&t.parentNode.removeChild(t),this.clearHighlighter(e),this.getSelectorElement(this.pdfViewer.element.id,e).childNodes),n=void 0,o=i.length;0<o;o--)(n=i[o-1]).parentNode.removeChild(n)},Rwt.prototype.renderSelector=function(e,t,i,n){if(!i||n){var n=new avt,o=this.pdfViewer.selectedItems;if(this.clearSelectorLayer(e),o.wrapper){o.wrapper.measure(n);var r=this.pdfViewer.viewerBase.getZoomFactor(),s=(o.wrapper.arrange(o.wrapper.desiredSize),o.width=o.wrapper.actualSize.width,o.height=o.wrapper.actualSize.height,o.offsetX=o.wrapper.offsetX,o.offsetY=o.wrapper.offsetY,1===o.annotations.length&&(o.rotateAngle=o.annotations[0].rotateAngle,o.wrapper.rotateAngle=o.annotations[0].rotateAngle),void 0);if(o.formFields.length)for(var a=0;a<o.formFields.length;a++){var l=o.formFields[parseInt(a.toString(),10)];(s=this.getSelectorElement(this.pdfViewer.element.id,e))&&l.pageIndex===e&&this.pdfViewer.designerMode&&this.renderResizeHandle(l.wrapper.children[0],s,o.thumbsConstraints,r,void 0,void 0,void 0,!1,!0,null,null,t),this.pdfViewer.formDesignerModule&&l.formFieldAnnotationType&&(this.pdfViewer.viewerBase.isFormFieldSelect||this.pdfViewer.viewerBase.isFormFieldMouseDown||this.pdfViewer.viewerBase.isFormFieldMouseMove||(this.pdfViewer.viewerBase.isFormFieldSelect=!0,p={name:l.name,id:l.id,value:l.value,fontFamily:l.fontFamily,fontSize:l.fontSize,fontStyle:l.fontStyle,color:l.color,backgroundColor:l.backgroundColor,alignment:l.alignment,isReadonly:l.isReadonly,visibility:l.visibility,maxLength:l.maxLength,isRequired:l.isRequired,isPrint:l.isPrint,rotation:l.rotateAngle,tooltip:l.tooltip,options:l.options,isChecked:l.isChecked,isSelected:l.isSelected,bounds:l.bounds},this.pdfViewer.formDesignerModule.isFormFieldSizeUpdated||this.pdfViewer.fireFormFieldSelectEvent("formFieldSelect",p,l.pageIndex,this.pdfViewer.formDesignerModule.isProgrammaticSelection),this.pdfViewer.formDesignerModule.isFormFieldSizeUpdated=!1))}if(o.annotations.length)for(var h=0;h<o.annotations.length;h++){var d,p,l=o.annotations[parseInt(h.toString(),10)];(s=this.getSelectorElement(this.pdfViewer.element.id,e))&&l.pageIndex===e&&("Distance"===l.shapeAnnotationType||"Line"===l.shapeAnnotationType||"LineWidthArrowHead"===l.shapeAnnotationType||"Polygon"===l.shapeAnnotationType?this.renderEndPointHandle(l,s,o.thumbsConstraints,{scale:r,tx:0,ty:0},void 0,void 0,!0,t):"StickyNotes"===l.shapeAnnotationType?this.renderResizeHandle(l.wrapper.children[0],s,o.thumbsConstraints,r,void 0,void 0,void 0,!1,!0,null,null,t):"Stamp"!==this.pdfViewer.tool&&(d="Path"===l.shapeAnnotationType||"SignatureField"===l.formFieldAnnotationType||"InitialField"===l.formFieldAnnotationType,this.renderResizeHandle(l.wrapper.children[0],s,o.thumbsConstraints,r,void 0,void 0,void 0,"Stamp"===l.shapeAnnotationType,!1,d,"FreeText"===l.shapeAnnotationType||"HandWrittenSignature"===l.shapeAnnotationType||"SignatureImage"===l.shapeAnnotationType||"Image"===l.shapeAnnotationType||"SignatureText"===l.shapeAnnotationType,t)),this.pdfViewer.viewerBase.isNewSignatureAdded||"HandWrittenSignature"!==l.shapeAnnotationType&&"SignatureText"!==l.shapeAnnotationType&&"SignatureImage"!==l.shapeAnnotationType||this.pdfViewer.annotationModule.selectSignature(l.signatureName,l.pageIndex,l),this.pdfViewer.formDesignerModule&&l.formFieldAnnotationType&&(this.pdfViewer.viewerBase.isFormFieldSelect||this.pdfViewer.viewerBase.isFormFieldMouseDown||this.pdfViewer.viewerBase.isFormFieldMouseMove||(this.pdfViewer.viewerBase.isFormFieldSelect=!0,p={value:l.value,fontFamily:l.fontFamily,fontSize:l.fontSize,fontStyle:l.fontStyle,color:l.color,backgroundColor:l.backgroundColor,alignment:l.alignment,isReadonly:l.isReadonly,visibility:l.visibility,maxLength:l.maxLength,isRequired:l.isRequired,isPrint:l.isPrint,rotation:l.rotateAngle,tooltip:l.tooltip,options:l.options,isChecked:l.isChecked,isSelected:l.isSelected,bounds:l.bounds},this.pdfViewer.formDesignerModule.isFormFieldSizeUpdated||this.pdfViewer.fireFormFieldSelectEvent("formFieldSelect",p,l.pageIndex,this.pdfViewer.formDesignerModule.isProgrammaticSelection),this.pdfViewer.formDesignerModule.isFormFieldSizeUpdated=!1)),""===l.annotName&&"ink"!==l.signatureName||"SignatureText"===l.annotName||!i||l!==i||l.formFieldAnnotationType||this.pdfViewer.viewerBase.isAddComment||this.pdfViewer.viewerBase.isAnnotationSelect||this.pdfViewer.viewerBase.isAnnotationMouseDown||this.pdfViewer.viewerBase.isAnnotationMouseMove||this.pdfViewer.viewerBase.isInkAdded||this.pdfViewer.viewerBase.isNewStamp||(this.pdfViewer.viewerBase.isAnnotationSelect=!0,this.pdfViewer.annotationModule.annotationSelect(l.annotName,l.pageIndex,l)))}}}},Rwt.prototype.rotate=function(e,t,i,n){var o;e&&(i=i||{x:e.wrapper.offsetX,y:e.wrapper.offsetY},e instanceof Jbt?(e.rotateAngle+=t,e.wrapper.rotateAngle+=t,o=(o=[]).concat(e.annotations),this.rotateObjects(e,o,t,i,null,n)):this.rotateObjects(e,[e],t,i))},Rwt.prototype.rotateObjects=function(e,t,i,n,o,r){n=n||{};var s=uvt();mvt(s,i,n.x,n.y);for(var a=0,l=t;a<l.length;a++){var h,d=l[a];d instanceof jbt&&(!1===o&&e===d||(d.rotateAngle+=i,d.rotateAngle=(d.rotateAngle+360)%360,h=gvt(s,{x:d.wrapper.offsetX,y:d.wrapper.offsetY}),d.wrapper.offsetX=h.x,d.wrapper.offsetY=h.y,this.nodePropertyChange(d,{rotateAngle:d.rotateAngle})),this.renderSelector(d.pageIndex,r))}},Rwt.prototype.getParentSvg=function(e,t,i){return e&&e.id&&t&&"selector"===t?this.pdfViewer.adornerSvgLayer:i},Rwt.prototype.shownBorder=function(){var e,t,i=!1;return this.pdfViewer.annotationModule&&(t=this.pdfViewer.selectedItems.annotations[0],e=this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(t),t=this.pdfViewer.annotationModule.checkIsLockSettings(t),i=!je(e)&&(e.includes("Select")||!t)),i},Rwt.prototype.renderBorder=function(e,t,i,n,o,r,s,a){var l,h,d,p,c=iwt(e,n);n=n||{scale:1,tx:0,ty:0},a?(c.x*=n.scale,c.y*=n.scale,c.width*=n.scale,c.height*=n.scale,l=0<this.pdfViewer.selectedItems.annotations.length?this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType:this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType,i&&"object"!=typeof i&&""!==i?(d=""===(h=JSON.parse(i)).selectionBorderColor?"black":h.selectionBorderColor,c.stroke=d,c.strokeWidth=1===i.selectionBorderThickness?1:h.selectionBorderThickness,2<(p=0===h.selectorLineDashArray.length?[6,3]:h.selectorLineDashArray).length&&(p=[p[0],p[1]]),c.dashArray=p.toString()):i&&""!==i?(d=""===i.selectionBorderColor?"black":i.selectionBorderColor,c.stroke=d,c.strokeWidth=1===i.selectionBorderThickness?1:i.selectionBorderThickness,p=je(i.selectorLineDashArray)||0!==i.selectorLineDashArray.length?i.selectorLineDashArray:[6,3],!je(p)&&2<p.length&&(p=[p[0],p[1]]),je(p)||(c.dashArray=p.toString())):this.getBorderSelector(l,c)):(c.x*=n.scale,c.y*=n.scale,c.width*=n.scale,c.height*=n.scale,c.fill="transparent",l=this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType,i&&"object"!=typeof i&&""!==i?(d=""===(h=JSON.parse(i)).selectionBorderColor?"black":h.selectionBorderColor,c.stroke=d,c.strokeWidth=1===i.selectionBorderThickness?1:h.selectionBorderThickness,2<(p=0===h.selectorLineDashArray.length?[6,3]:h.selectorLineDashArray).length&&(p=[p[0],p[1]]),c.dashArray=p.toString()):i&&""!==i?(d=""===i.selectionBorderColor?"black":i.selectionBorderColor,c.stroke=d,c.strokeWidth=1===i.selectionBorderThickness?1:i.selectionBorderThickness,p=je(i.selectorLineDashArray)||0!==i.selectorLineDashArray.length?i.selectorLineDashArray:[6,3],!je(p)&&2<p.length&&(p=[p[0],p[1]]),je(p)||(c.dashArray=p.toString())):this.pdfViewer.designerMode||("HandWrittenSignature"===l||"SignatureText"===l||"SignatureImage"===l||"Ink"===l?(this.pdfViewer.nameTable[e.id.split("_")[0]],a=this.pdfViewer.viewerBase.checkSignatureFormField(e.id),this.getSignBorder(l,c,a)):this.getBorderSelector(l,c)),c.class="e-pv-diagram-border",s&&(c.class+=" e-diagram-lane"),c.id="borderRect",c.id="borderRect",o||(c.class+=" e-disabled"),r&&(c.class+=" e-thick-border"),c.cornerRadius=0),this.shownBorder()&&(n=this.getParentSvg(e,"selector"),this.svgRenderer.drawRectangle(t,c,this.pdfViewer.element.id,void 0,!0,n))},Rwt.prototype.getSignBorder=function(e,t,i){var n,o,r;i||"HandWrittenSignature"!==e&&"SignatureText"!==e&&"SignatureImage"!==e||!this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings?"Ink"===e&&this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings?(n=je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.selectionBorderColor)||""===this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.selectionBorderColor?"#0000ff":this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.selectionBorderColor,t.stroke=n,o=je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.selectionBorderThickness,t.strokeWidth=o,2<(r=je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.selectorLineDashArray)||0===this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.selectorLineDashArray.length?[4]:this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.selectorLineDashArray).length&&(r=[r[0],r[1]])):(n=""===(i=this.pdfViewer.annotationSelectorSettings).selectionBorderColor?"black":i.selectionBorderColor,t.stroke=n,t.strokeWidth=1===i.selectionBorderThickness?1:i.selectionBorderThickness,2<(r=0===i.selectorLineDashArray.length?[6,3]:i.selectorLineDashArray).length&&(r=[r[0],r[1]])):(n=je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.selectionBorderColor)||""===this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.selectionBorderColor?"#0000ff":this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.selectionBorderColor,t.stroke=n,o=je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.selectionBorderThickness,t.strokeWidth=o,2<(r=je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.selectorLineDashArray)||0===this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.selectorLineDashArray.length?[4]:this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.selectorLineDashArray).length&&(r=[r[0],r[1]])),t.dashArray=r.toString()},Rwt.prototype.getBorderSelector=function(e,t){var i,n=this.pdfViewer.annotationSelectorSettings,o=je(n.selectionBorderColor)||""===n.selectionBorderColor?"black":n.selectionBorderColor,o=(t.stroke=o,t.strokeWidth=je(n.selectionBorderThickness)||1===n.selectionBorderThickness?1:n.selectionBorderThickness,je(n.selectorLineDashArray)||0===n.selectorLineDashArray.length?[6,3]:n.selectorLineDashArray);2<o.length&&(o=[o[0],o[1]]),t.dashArray=o.toString(),"Rectangle"===e&&this.pdfViewer.rectangleSettings.annotationSelectorSettings?(n=je(this.pdfViewer.annotationSelectorSettings.selectionBorderColor)||""===this.pdfViewer.annotationSelectorSettings.selectionBorderColor?"black":this.pdfViewer.annotationSelectorSettings.selectionBorderColor||this.pdfViewer.rectangleSettings.annotationSelectorSettings.selectionBorderColor,t.stroke=n,i=je(this.pdfViewer.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.annotationSelectorSettings.selectionBorderThickness||this.pdfViewer.rectangleSettings.annotationSelectorSettings.selectionBorderThickness,t.strokeWidth=i,2<(o=je(this.pdfViewer.annotationSelectorSettings.selectorLineDashArray)||0===this.pdfViewer.annotationSelectorSettings.selectorLineDashArray.length?[4]:this.pdfViewer.annotationSelectorSettings.selectorLineDashArray||this.pdfViewer.rectangleSettings.annotationSelectorSettings.selectorLineDashArray).length&&(o=[o[0],o[1]]),t.dashArray=o.toString()):"Textbox"!==e&&"Checkbox"!==e&&"RadioButton"!==e&&"SignatureField"!==e&&"InitialField"!==e&&"DropdownList"!==e&&"ListBox"!==e&&"PasswordField"!==e||!this.pdfViewer.rectangleSettings.annotationSelectorSettings?"Ellipse"===e&&this.pdfViewer.circleSettings.annotationSelectorSettings?(n=je(this.pdfViewer.annotationSelectorSettings.selectionBorderColor)||""===this.pdfViewer.annotationSelectorSettings.selectionBorderColor?"black":this.pdfViewer.annotationSelectorSettings.selectionBorderColor||(je(this.pdfViewer.circleSettings.annotationSelectorSettings)||je(this.pdfViewer.circleSettings.annotationSelectorSettings.selectionBorderColor)?"black":this.pdfViewer.circleSettings.annotationSelectorSettings.selectionBorderColor),t.stroke=n,i=je(this.pdfViewer.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.annotationSelectorSettings.selectionBorderThickness||(je(this.pdfViewer.circleSettings.annotationSelectorSettings)||je(this.pdfViewer.circleSettings.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.circleSettings.annotationSelectorSettings.selectionBorderThickness),t.strokeWidth=i,2<(o=je(this.pdfViewer.annotationSelectorSettings.selectorLineDashArray)||0===this.pdfViewer.annotationSelectorSettings.selectorLineDashArray.length?[4]:this.pdfViewer.annotationSelectorSettings.selectorLineDashArray||(je(this.pdfViewer.circleSettings.annotationSelectorSettings)||je(this.pdfViewer.circleSettings.annotationSelectorSettings.selectorLineDashArray)?[4]:this.pdfViewer.circleSettings.annotationSelectorSettings.selectorLineDashArray)).length&&(o=[o[0],o[1]]),t.dashArray=o.toString()):"Radius"===e&&this.pdfViewer.radiusSettings.annotationSelectorSettings?(n=je(this.pdfViewer.annotationSelectorSettings.selectionBorderColor)||""===this.pdfViewer.annotationSelectorSettings.selectionBorderColor?"black":this.pdfViewer.annotationSelectorSettings.selectionBorderColor||(je(this.pdfViewer.radiusSettings.annotationSelectorSettings)||je(this.pdfViewer.radiusSettings.annotationSelectorSettings.selectionBorderColor)?"black":this.pdfViewer.radiusSettings.annotationSelectorSettings.selectionBorderColor),t.stroke=n,i=je(this.pdfViewer.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.annotationSelectorSettings.selectionBorderThickness||(je(this.pdfViewer.radiusSettings.annotationSelectorSettings)||je(this.pdfViewer.radiusSettings.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.radiusSettings.annotationSelectorSettings.selectionBorderThickness),t.strokeWidth=i,2<(o=je(this.pdfViewer.annotationSelectorSettings.selectorLineDashArray)||0===this.pdfViewer.annotationSelectorSettings.selectorLineDashArray.length?[4]:this.pdfViewer.annotationSelectorSettings.selectorLineDashArray||(je(this.pdfViewer.radiusSettings.annotationSelectorSettings)||je(this.pdfViewer.radiusSettings.annotationSelectorSettings.selectorLineDashArray)?[4]:this.pdfViewer.radiusSettings.annotationSelectorSettings.selectorLineDashArray)).length&&(o=[o[0],o[1]]),t.dashArray=o.toString()):"FreeText"===e&&this.pdfViewer.freeTextSettings.annotationSelectorSettings?(n=je(this.pdfViewer.annotationSelectorSettings.selectionBorderColor)||""===this.pdfViewer.annotationSelectorSettings.selectionBorderColor?"black":this.pdfViewer.annotationSelectorSettings.selectionBorderColor||(je(this.pdfViewer.freeTextSettings.annotationSelectorSettings)||je(this.pdfViewer.freeTextSettings.annotationSelectorSettings.selectionBorderColor)?"black":this.pdfViewer.freeTextSettings.annotationSelectorSettings.selectionBorderColor),t.stroke=n,i=je(this.pdfViewer.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.annotationSelectorSettings.selectionBorderThickness||(je(this.pdfViewer.freeTextSettings.annotationSelectorSettings)||je(this.pdfViewer.freeTextSettings.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.freeTextSettings.annotationSelectorSettings.selectionBorderThickness),t.strokeWidth=i,2<(o=je(this.pdfViewer.annotationSelectorSettings.selectorLineDashArray)||0===this.pdfViewer.annotationSelectorSettings.selectorLineDashArray.length?[4]:this.pdfViewer.annotationSelectorSettings.selectorLineDashArray||(je(this.pdfViewer.freeTextSettings.annotationSelectorSettings)||je(this.pdfViewer.freeTextSettings.annotationSelectorSettings.selectorLineDashArray)?[4]:this.pdfViewer.freeTextSettings.annotationSelectorSettings.selectorLineDashArray)).length&&(o=[o[0],o[1]]),t.dashArray=o.toString()):"StickyNotes"===e&&this.pdfViewer.stickyNotesSettings.annotationSelectorSettings?(n=je(this.pdfViewer.annotationSelectorSettings.selectionBorderColor)||""===this.pdfViewer.annotationSelectorSettings.selectionBorderColor?"black":this.pdfViewer.annotationSelectorSettings.selectionBorderColor||(je(this.pdfViewer.stickyNotesSettings.annotationSelectorSettings)||je(this.pdfViewer.stickyNotesSettings.annotationSelectorSettings.selectionBorderColor)?"black":this.pdfViewer.stickyNotesSettings.annotationSelectorSettings.selectionBorderColor),t.stroke=n,i=je(this.pdfViewer.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.annotationSelectorSettings.selectionBorderThickness||(je(this.pdfViewer.stickyNotesSettings.annotationSelectorSettings)||je(this.pdfViewer.stickyNotesSettings.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.stickyNotesSettings.annotationSelectorSettings.selectionBorderThickness),t.strokeWidth=i,2<(o=je(this.pdfViewer.annotationSelectorSettings.selectorLineDashArray)||0===this.pdfViewer.annotationSelectorSettings.selectorLineDashArray.length?[6,3]:this.pdfViewer.annotationSelectorSettings.selectorLineDashArray||(je(this.pdfViewer.stickyNotesSettings.annotationSelectorSettings)||je(this.pdfViewer.stickyNotesSettings.annotationSelectorSettings.selectorLineDashArray)?[4]:this.pdfViewer.stickyNotesSettings.annotationSelectorSettings.selectorLineDashArray)).length&&(o=[o[0],o[1]]),t.dashArray=o.toString()):"Stamp"!==e&&"Image"!==e||!this.pdfViewer.stampSettings.annotationSelectorSettings||(n=je(this.pdfViewer.annotationSelectorSettings.selectionBorderColor)||""===this.pdfViewer.annotationSelectorSettings.selectionBorderColor?"#0000ff":this.pdfViewer.annotationSelectorSettings.selectionBorderColor||(je(this.pdfViewer.stampSettings.annotationSelectorSettings)||je(this.pdfViewer.stampSettings.annotationSelectorSettings.selectionBorderColor)?"#0000ff":this.pdfViewer.stampSettings.annotationSelectorSettings.selectionBorderColor),t.stroke=n,i=je(this.pdfViewer.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.annotationSelectorSettings.selectionBorderThickness||(je(this.pdfViewer.stampSettings.annotationSelectorSettings)||je(this.pdfViewer.stampSettings.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.stampSettings.annotationSelectorSettings.selectionBorderThickness),t.strokeWidth=i,2<(o=je(this.pdfViewer.annotationSelectorSettings.selectorLineDashArray)||0===this.pdfViewer.annotationSelectorSettings.selectorLineDashArray.length?[4]:this.pdfViewer.annotationSelectorSettings.selectorLineDashArray||(je(this.pdfViewer.stampSettings.annotationSelectorSettings)||je(this.pdfViewer.stampSettings.annotationSelectorSettings.selectorLineDashArray)?[4]:this.pdfViewer.stampSettings.annotationSelectorSettings.selectorLineDashArray)).length&&(o=[o[0],o[1]]),t.dashArray=o.toString()):(e=je(this.pdfViewer.annotationSelectorSettings.selectionBorderColor)||""===this.pdfViewer.annotationSelectorSettings.selectionBorderColor?"black":this.pdfViewer.annotationSelectorSettings.selectionBorderColor||(je(this.pdfViewer.rectangleSettings.annotationSelectorSettings)||je(this.pdfViewer.rectangleSettings.annotationSelectorSettings.selectionBorderColor)?"black":this.pdfViewer.rectangleSettings.annotationSelectorSettings.selectionBorderColor),t.stroke=e,i=je(this.pdfViewer.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.annotationSelectorSettings.selectionBorderThickness||(je(this.pdfViewer.rectangleSettings.annotationSelectorSettings)||je(this.pdfViewer.rectangleSettings.annotationSelectorSettings.selectionBorderThickness)?1:this.pdfViewer.rectangleSettings.annotationSelectorSettings.selectionBorderThickness),t.strokeWidth=i,2<(n=je(this.pdfViewer.annotationSelectorSettings.selectorLineDashArray)||0===this.pdfViewer.annotationSelectorSettings.selectorLineDashArray.length?[4]:this.pdfViewer.annotationSelectorSettings.selectorLineDashArray||(je(this.pdfViewer.rectangleSettings.annotationSelectorSettings)||je(this.pdfViewer.rectangleSettings.annotationSelectorSettings.selectorLineDashArray)?[4]:this.pdfViewer.rectangleSettings.annotationSelectorSettings.selectorLineDashArray)).length&&(n=[n[0],n[1]]),t.dashArray=n.toString())},Rwt.prototype.renderCircularHandle=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u){var g=t,i={x:i,y:n},n=(a=a||{scale:1,tx:0,ty:0},0===g.rotateAngle&&0===g.parentTransform||(mvt(n=uvt(),g.rotateAngle+g.parentTransform,g.offsetX,g.offsetY),i=gvt(n,i)),iwt(g)),g=0<this.pdfViewer.selectedItems.annotations.length&&this.pdfViewer.selectedItems.annotations[0].measureType?this.pdfViewer.selectedItems.annotations[0].measureType:0<this.pdfViewer.selectedItems.formFields.length?this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType:this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType,p=(this.getResizerColors(g,n,u,a),this.getShapeSize(g,n,u,a),n.strokeWidth=1,void 0!==p&&(n.id="segmentEnd_"+p),n.centerX=(i.x+a.tx)*a.scale,n.centerY=(i.y+a.ty)*a.scale,n.angle=0,n.id=e,n.visible=r,n.class=c,n.opacity=1,l&&(n.class+=" e-connected"),h&&(n.visible=!1),n.x=i.x*a.scale-n.width/2,n.y=i.y*a.scale-n.height/2,this.getParentSvg(t,"selector"));"Square"===this.getShape(g,u)?this.svgRenderer.drawRectangle(o,n,e,void 0,!0,p):"Circle"===this.getShape(g,u)&&this.svgRenderer.drawCircle(o,n,1)},Rwt.prototype.getShapeSize=function(e,t,i,n){var o;i&&"object"!=typeof i&&""!==i?(o=JSON.parse(i),t.radius=(je(o.resizerSize)||8===o.resizerSize?8:o.resizerSize)/2,t.width=(je(o.resizerSize)||8===o.resizerSize?8:o.resizerSize)*n.scale,t.height=(je(o.resizerSize)||8===o.resizerSize?8:o.resizerSize)*n.scale):i&&""!==i?(t.radius=(je(i.resizerSize)||8===i.resizerSize?8:i.resizerSize)/2,t.width=(je(i.resizerSize)||8===i.resizerSize?8:i.resizerSize)*n.scale,t.height=(je(i.resizerSize)||8===i.resizerSize?8:i.resizerSize)*n.scale):(o=this.pdfViewer.annotationSelectorSettings,t.radius=(je(o.resizerSize)||8===o.resizerSize?8:o.resizerSize)/2,t.width=(je(o.resizerSize)||8===o.resizerSize?8:o.resizerSize)*n.scale,t.height=(je(o.resizerSize)||8===o.resizerSize?8:o.resizerSize)*n.scale,"Line"===e&&this.pdfViewer.lineSettings.annotationSelectorSettings?(t.radius=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.lineSettings.annotationSelectorSettings)||je(this.pdfViewer.lineSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.lineSettings.annotationSelectorSettings.resizerSize/2,t.width=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.lineSettings.annotationSelectorSettings)||je(this.pdfViewer.lineSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.lineSettings.annotationSelectorSettings.resizerSize*n.scale,t.height=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.lineSettings.annotationSelectorSettings)||je(this.pdfViewer.lineSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.lineSettings.annotationSelectorSettings.resizerSize*n.scale):"LineWidthArrowHead"===e&&this.pdfViewer.arrowSettings.annotationSelectorSettings?(t.radius=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.arrowSettings.annotationSelectorSettings)||je(this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerSize/2,t.width=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.arrowSettings.annotationSelectorSettings)||je(this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerSize*n.scale,t.height=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.arrowSettings.annotationSelectorSettings)||je(this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerSize*n.scale):"Rectangle"===e&&this.pdfViewer.rectangleSettings.annotationSelectorSettings?(t.radius=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.rectangleSettings.annotationSelectorSettings)||je(this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerSize/2,t.width=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.rectangleSettings.annotationSelectorSettings)||je(this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerSize*n.scale,t.height=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.rectangleSettings.annotationSelectorSettings)||je(this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerSize*n.scale):"Ellipse"===e&&this.pdfViewer.circleSettings.annotationSelectorSettings?(t.radius=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.circleSettings.annotationSelectorSettings)||je(this.pdfViewer.circleSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.circleSettings.annotationSelectorSettings.resizerSize/2,t.width=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.circleSettings.annotationSelectorSettings)||je(this.pdfViewer.circleSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.circleSettings.annotationSelectorSettings.resizerSize*n.scale,t.height=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.circleSettings.annotationSelectorSettings)||je(this.pdfViewer.circleSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.circleSettings.annotationSelectorSettings.resizerSize*n.scale):"Distance"===e&&this.pdfViewer.distanceSettings.annotationSelectorSettings?(t.radius=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.distanceSettings.annotationSelectorSettings)||je(this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerSize/2,t.width=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.distanceSettings.annotationSelectorSettings)||je(this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerSize*n.scale,t.height=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.distanceSettings.annotationSelectorSettings)||je(this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerSize*n.scale):"Polygon"===e&&this.pdfViewer.polygonSettings.annotationSelectorSettings?(t.radius=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.polygonSettings.annotationSelectorSettings)||je(this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerSize/2,t.width=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.polygonSettings.annotationSelectorSettings)||je(this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerSize*n.scale,t.height=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.polygonSettings.annotationSelectorSettings)||je(this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerSize*n.scale):"Radius"===e&&this.pdfViewer.radiusSettings.annotationSelectorSettings?(t.radius=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.radiusSettings.annotationSelectorSettings)||je(this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerSize/2,t.width=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.radiusSettings.annotationSelectorSettings)||je(this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerSize*n.scale,t.height=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.radiusSettings.annotationSelectorSettings)||je(this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerSize*n.scale):"Stamp"!==e&&"Image"!==e||!this.pdfViewer.stampSettings.annotationSelectorSettings?"FreeText"===e&&this.pdfViewer.freeTextSettings.annotationSelectorSettings?(t.radius=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.freeTextSettings.annotationSelectorSettings)||je(this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerSize/2,t.width=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.freeTextSettings.annotationSelectorSettings)||je(this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerSize*n.scale,t.height=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.freeTextSettings.annotationSelectorSettings)||je(this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerSize*n.scale):"HandWrittenSignature"!==e&&"SignatureText"!==e&&"SignatureImage"!==e||!this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings?"Perimeter"===e&&this.pdfViewer.perimeterSettings.annotationSelectorSettings?(t.radius=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.perimeterSettings.annotationSelectorSettings)||je(this.pdfViewer.perimeterSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.perimeterSettings.annotationSelectorSettings.resizerSize/2,t.width=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.perimeterSettings.annotationSelectorSettings)||je(this.pdfViewer.perimeterSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.perimeterSettings.annotationSelectorSettings.resizerSize*n.scale,t.height=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.perimeterSettings.annotationSelectorSettings)||je(this.pdfViewer.perimeterSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.perimeterSettings.annotationSelectorSettings.resizerSize*n.scale):"Area"===e&&this.pdfViewer.areaSettings.annotationSelectorSettings?(t.radius=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.areaSettings.annotationSelectorSettings)||je(this.pdfViewer.areaSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.areaSettings.annotationSelectorSettings.resizerSize/2,t.width=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.areaSettings.annotationSelectorSettings)||je(this.pdfViewer.areaSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.areaSettings.annotationSelectorSettings.resizerSize*n.scale,t.height=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.areaSettings.annotationSelectorSettings)||je(this.pdfViewer.areaSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.areaSettings.annotationSelectorSettings.resizerSize*n.scale):"Volume"===e&&this.pdfViewer.volumeSettings.annotationSelectorSettings?(t.radius=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.volumeSettings.annotationSelectorSettings)||je(this.pdfViewer.volumeSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.volumeSettings.annotationSelectorSettings.resizerSize/2,t.width=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.volumeSettings.annotationSelectorSettings)||je(this.pdfViewer.volumeSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.volumeSettings.annotationSelectorSettings.resizerSize*n.scale,t.height=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.volumeSettings.annotationSelectorSettings)||je(this.pdfViewer.volumeSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.volumeSettings.annotationSelectorSettings.resizerSize*n.scale):"Ink"===e&&this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings&&(t.radius=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings)||je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerSize/2,t.width=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings)||je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerSize*n.scale,t.height=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings)||je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerSize*n.scale):(t.radius=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings)||je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerSize/2,t.width=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings)||je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerSize*n.scale,t.height=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings)||je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerSize*n.scale):(t.radius=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.stampSettings.annotationSelectorSettings)||je(this.pdfViewer.stampSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.stampSettings.annotationSelectorSettings.resizerSize/2,t.width=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.stampSettings.annotationSelectorSettings)||je(this.pdfViewer.stampSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.stampSettings.annotationSelectorSettings.resizerSize*n.scale,t.height=je(this.pdfViewer.annotationSelectorSettings.resizerSize)||8!==this.pdfViewer.annotationSelectorSettings.resizerSize?this.pdfViewer.annotationSelectorSettings.resizerSize:je(this.pdfViewer.stampSettings.annotationSelectorSettings)||je(this.pdfViewer.stampSettings.annotationSelectorSettings.resizerSize)?8:this.pdfViewer.stampSettings.annotationSelectorSettings.resizerSize*n.scale))},Rwt.prototype.getShape=function(e,t){var i,n;return t&&"object"!=typeof t&&""!==t?i=je((n=JSON.parse(t)).resizerShape)||"Square"===n.resizerShape?"Square":n.resizerShape:t&&""!==t?i=je(t.resizerShape)||"Square"===t.resizerShape?"Square":t.resizerShape:(i=je((n=this.pdfViewer.annotationSelectorSettings).resizerShape)||"Square"===n.resizerShape?"Square":n.resizerShape,"Line"===e&&this.pdfViewer.lineSettings.annotationSelectorSettings?i=je(this.pdfViewer.annotationSelectorSettings.resizerShape)||"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape?this.pdfViewer.annotationSelectorSettings.resizerShape:je(this.pdfViewer.lineSettings.annotationSelectorSettings)||je(this.pdfViewer.lineSettings.annotationSelectorSettings.resizerShape)?"Square":this.pdfViewer.lineSettings.annotationSelectorSettings.resizerShape:"LineWidthArrowHead"===e&&this.pdfViewer.arrowSettings.annotationSelectorSettings?i=je(this.pdfViewer.annotationSelectorSettings.resizerShape)||"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape?this.pdfViewer.annotationSelectorSettings.resizerShape:je(this.pdfViewer.arrowSettings.annotationSelectorSettings)||je(this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerShape)?"Square":this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerShape:"Rectangle"===e&&this.pdfViewer.rectangleSettings.annotationSelectorSettings?i=je(this.pdfViewer.annotationSelectorSettings.resizerShape)||"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape?this.pdfViewer.annotationSelectorSettings.resizerShape:je(this.pdfViewer.rectangleSettings.annotationSelectorSettings)||je(this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerShape)?"Square":this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerShape:"Ellipse"===e&&this.pdfViewer.circleSettings.annotationSelectorSettings?i=je(this.pdfViewer.annotationSelectorSettings.resizerShape)||"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape?this.pdfViewer.annotationSelectorSettings.resizerShape:je(this.pdfViewer.circleSettings.annotationSelectorSettings)||je(this.pdfViewer.circleSettings.annotationSelectorSettings.resizerShape)?"Square":this.pdfViewer.circleSettings.annotationSelectorSettings.resizerShape:"Polygon"===e&&this.pdfViewer.polygonSettings.annotationSelectorSettings?i=je(this.pdfViewer.annotationSelectorSettings.resizerShape)||"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape?this.pdfViewer.annotationSelectorSettings.resizerShape:je(this.pdfViewer.polygonSettings.annotationSelectorSettings)||je(this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerShape)?"Square":this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerShape:"Distance"===e&&this.pdfViewer.distanceSettings.annotationSelectorSettings?i=je(this.pdfViewer.annotationSelectorSettings.resizerShape)||"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape?this.pdfViewer.annotationSelectorSettings.resizerShape:je(this.pdfViewer.distanceSettings.annotationSelectorSettings)||je(this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerShape)?"Square":this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerShape:"Radius"===e&&this.pdfViewer.radiusSettings.annotationSelectorSettings?i=je(this.pdfViewer.annotationSelectorSettings.resizerShape)||"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape?this.pdfViewer.annotationSelectorSettings.resizerShape:je(this.pdfViewer.radiusSettings.annotationSelectorSettings)||je(this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerShape)?"Square":this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerShape:"Stamp"!==e&&"Image"!==e||!this.pdfViewer.stampSettings.annotationSelectorSettings?"FreeText"===e&&this.pdfViewer.freeTextSettings.annotationSelectorSettings?i=je(this.pdfViewer.annotationSelectorSettings.resizerShape)||"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape?this.pdfViewer.annotationSelectorSettings.resizerShape:je(this.pdfViewer.freeTextSettings.annotationSelectorSettings)||je(this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerShape)?"Square":this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerShape:("HandWrittenSignature"===e||"SignatureText"===e||"SignatureImage"===e)&&this.pdfViewer.handWrittenSignatureSettings&&this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings?i=je(this.pdfViewer.annotationSelectorSettings.resizerShape)||"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape?this.pdfViewer.annotationSelectorSettings.resizerShape:je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings)||je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerShape)?"Square":this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerShape:"Perimeter"===e&&this.pdfViewer.perimeterSettings.annotationSelectorSettings?i=je(this.pdfViewer.annotationSelectorSettings.resizerShape)||"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape?this.pdfViewer.annotationSelectorSettings.resizerShape:je(this.pdfViewer.perimeterSettings.annotationSelectorSettings)||je(this.pdfViewer.perimeterSettings.annotationSelectorSettings.resizerShape)?"Square":this.pdfViewer.perimeterSettings.annotationSelectorSettings.resizerShape:"Area"===e&&this.pdfViewer.areaSettings.annotationSelectorSettings?i=je(this.pdfViewer.annotationSelectorSettings.resizerShape)||"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape?this.pdfViewer.annotationSelectorSettings.resizerShape:je(this.pdfViewer.areaSettings.annotationSelectorSettings)||je(this.pdfViewer.areaSettings.annotationSelectorSettings.resizerShape)?"Square":this.pdfViewer.areaSettings.annotationSelectorSettings.resizerShape:"Volume"===e&&this.pdfViewer.volumeSettings.annotationSelectorSettings?i=je(this.pdfViewer.annotationSelectorSettings.resizerShape)||"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape?this.pdfViewer.annotationSelectorSettings.resizerShape:je(this.pdfViewer.volumeSettings.annotationSelectorSettings)||je(this.pdfViewer.volumeSettings.annotationSelectorSettings.resizerShape)?"Square":this.pdfViewer.volumeSettings.annotationSelectorSettings.resizerShape:"Ink"===e&&this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings&&(i=je(this.pdfViewer.annotationSelectorSettings.resizerShape)||"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape?this.pdfViewer.annotationSelectorSettings.resizerShape:je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings)||je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerShape)?"Square":this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerShape):i=je(this.pdfViewer.annotationSelectorSettings.resizerShape)||"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape?this.pdfViewer.annotationSelectorSettings.resizerShape:je(this.pdfViewer.stampSettings.annotationSelectorSettings)||je(this.pdfViewer.stampSettings.annotationSelectorSettings.resizerShape)?"Square":this.pdfViewer.stampSettings.annotationSelectorSettings.resizerShape),i},Rwt.prototype.getResizerColors=function(e,t,i,n){var o;i&&"object"!=typeof i&&""!==i?(o=JSON.parse(i),t.stroke=je(o.resizerBorderColor)||"black"===o.resizerBorderColor?"black":o.resizerBorderColor,t.fill=je(o.resizerFillColor)||"#FF4081"===o.resizerFillColor?"#FF4081":o.resizerFillColor):i&&""!==i?(t.stroke=je(i.resizerBorderColor)?"black":i.resizerBorderColor,t.fill=je(i.resizerFillColor)?"#FF4081":i.resizerFillColor):(o=this.pdfViewer.annotationSelectorSettings,t.stroke=je(o.resizerBorderColor)||"black"===o.resizerBorderColor?"black":o.resizerBorderColor,t.fill=je(o.resizerFillColor)||"#FF4081"===o.resizerFillColor?"#FF4081":o.resizerFillColor,"Line"===e&&this.pdfViewer.lineSettings.annotationSelectorSettings?(t.stroke=je(this.pdfViewer.annotationSelectorSettings.resizerBorderColor)||"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor?this.pdfViewer.annotationSelectorSettings.resizerBorderColor:je(this.pdfViewer.lineSettings.annotationSelectorSettings)||je(this.pdfViewer.lineSettings.annotationSelectorSettings.resizerBorderColor)?"black":this.pdfViewer.lineSettings.annotationSelectorSettings.resizerBorderColor,t.fill=je(this.pdfViewer.annotationSelectorSettings.resizerFillColor)||"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor?this.pdfViewer.annotationSelectorSettings.resizerFillColor:je(this.pdfViewer.lineSettings.annotationSelectorSettings)||je(this.pdfViewer.lineSettings.annotationSelectorSettings.resizerFillColor)?"FF4081":this.pdfViewer.lineSettings.annotationSelectorSettings.resizerFillColor):"LineWidthArrowHead"===e&&this.pdfViewer.arrowSettings.annotationSelectorSettings?(t.stroke=je(this.pdfViewer.annotationSelectorSettings.resizerBorderColor)||"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor?this.pdfViewer.annotationSelectorSettings.resizerBorderColor:je(this.pdfViewer.arrowSettings.annotationSelectorSettings)||je(this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerBorderColor)?"black":this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerBorderColor,t.fill=je(this.pdfViewer.annotationSelectorSettings.resizerFillColor)||"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor?this.pdfViewer.annotationSelectorSettings.resizerFillColor:je(this.pdfViewer.arrowSettings.annotationSelectorSettings)||je(this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerFillColor)?"FF4081":this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerFillColor):"Rectangle"===e&&this.pdfViewer.rectangleSettings.annotationSelectorSettings?(t.stroke=je(this.pdfViewer.annotationSelectorSettings.resizerBorderColor)||"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor?this.pdfViewer.annotationSelectorSettings.resizerBorderColor:je(this.pdfViewer.rectangleSettings.annotationSelectorSettings)||je(this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerBorderColor)?"black":this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerBorderColor,t.fill=je(this.pdfViewer.annotationSelectorSettings.resizerFillColor)||"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor?this.pdfViewer.annotationSelectorSettings.resizerFillColor:je(this.pdfViewer.rectangleSettings.annotationSelectorSettings)||je(this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerFillColor)?"FF4081":this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerFillColor):"Ellipse"===e&&this.pdfViewer.circleSettings.annotationSelectorSettings?(t.stroke=je(this.pdfViewer.annotationSelectorSettings.resizerBorderColor)||"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor?this.pdfViewer.annotationSelectorSettings.resizerBorderColor:je(this.pdfViewer.circleSettings.annotationSelectorSettings)||je(this.pdfViewer.circleSettings.annotationSelectorSettings.resizerBorderColor)?"black":this.pdfViewer.circleSettings.annotationSelectorSettings.resizerBorderColor,t.fill=je(this.pdfViewer.annotationSelectorSettings.resizerFillColor)||"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor?this.pdfViewer.annotationSelectorSettings.resizerFillColor:je(this.pdfViewer.circleSettings.annotationSelectorSettings)||je(this.pdfViewer.circleSettings.annotationSelectorSettings.resizerFillColor)?"FF4081":this.pdfViewer.circleSettings.annotationSelectorSettings.resizerFillColor):"Distance"===e&&this.pdfViewer.distanceSettings.annotationSelectorSettings?(t.stroke=je(this.pdfViewer.annotationSelectorSettings.resizerBorderColor)||"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor?this.pdfViewer.annotationSelectorSettings.resizerBorderColor:je(this.pdfViewer.distanceSettings.annotationSelectorSettings)||je(this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerBorderColor)?"black":this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerBorderColor,t.fill=je(this.pdfViewer.annotationSelectorSettings.resizerFillColor)||"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor?this.pdfViewer.annotationSelectorSettings.resizerFillColor:je(this.pdfViewer.distanceSettings.annotationSelectorSettings)||je(this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerFillColor)?"FF4081":this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerFillColor):"Polygon"===e&&this.pdfViewer.polygonSettings.annotationSelectorSettings?(t.stroke=je(this.pdfViewer.annotationSelectorSettings.resizerBorderColor)||"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor?this.pdfViewer.annotationSelectorSettings.resizerBorderColor:je(this.pdfViewer.polygonSettings.annotationSelectorSettings)||je(this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerBorderColor)?"black":this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerBorderColor,t.fill=je(this.pdfViewer.annotationSelectorSettings.resizerFillColor)||"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor?this.pdfViewer.annotationSelectorSettings.resizerFillColor:je(this.pdfViewer.polygonSettings.annotationSelectorSettings)||je(this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerFillColor)?"FF4081":this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerFillColor):"Radius"===e&&this.pdfViewer.radiusSettings.annotationSelectorSettings?(t.stroke=je(this.pdfViewer.annotationSelectorSettings.resizerBorderColor)||"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor?this.pdfViewer.annotationSelectorSettings.resizerBorderColor:je(this.pdfViewer.radiusSettings.annotationSelectorSettings)||je(this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerBorderColor)?"black":this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerBorderColor,t.fill=je(this.pdfViewer.annotationSelectorSettings.resizerFillColor)||"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor?this.pdfViewer.annotationSelectorSettings.resizerFillColor:je(this.pdfViewer.radiusSettings.annotationSelectorSettings)||je(this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerFillColor)?"FF4081":this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerFillColor):"Stamp"!==e&&"Image"!==e||!this.pdfViewer.stampSettings.annotationSelectorSettings?"FreeText"===e&&this.pdfViewer.freeTextSettings.annotationSelectorSettings?(t.stroke=je(this.pdfViewer.annotationSelectorSettings.resizerBorderColor)||"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor?this.pdfViewer.annotationSelectorSettings.resizerBorderColor:je(this.pdfViewer.freeTextSettings.annotationSelectorSettings)||je(this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerBorderColor)?"black":this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerBorderColor,t.fill=je(this.pdfViewer.annotationSelectorSettings.resizerFillColor)||"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor?this.pdfViewer.annotationSelectorSettings.resizerFillColor:je(this.pdfViewer.freeTextSettings.annotationSelectorSettings)||je(this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerFillColor)?"FF4081":this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerFillColor):"HandWrittenSignature"!==e&&"SignatureText"!==e&&"SignatureImage"!==e||!this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings?"Perimeter"===e&&this.pdfViewer.perimeterSettings.annotationSelectorSettings?(t.stroke=je(this.pdfViewer.annotationSelectorSettings.resizerBorderColor)||"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor?this.pdfViewer.annotationSelectorSettings.resizerBorderColor:je(this.pdfViewer.perimeterSettings.annotationSelectorSettings)||je(this.pdfViewer.perimeterSettings.annotationSelectorSettings.resizerBorderColor)?"black":this.pdfViewer.perimeterSettings.annotationSelectorSettings.resizerBorderColor,t.fill=je(this.pdfViewer.annotationSelectorSettings.resizerFillColor)||"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor?this.pdfViewer.annotationSelectorSettings.resizerFillColor:je(this.pdfViewer.perimeterSettings.annotationSelectorSettings)||je(this.pdfViewer.perimeterSettings.annotationSelectorSettings.resizerFillColor)?"FF4081":this.pdfViewer.perimeterSettings.annotationSelectorSettings.resizerFillColor):"Area"===e&&this.pdfViewer.areaSettings.annotationSelectorSettings?(t.stroke=je(this.pdfViewer.annotationSelectorSettings.resizerBorderColor)||"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor?this.pdfViewer.annotationSelectorSettings.resizerBorderColor:je(this.pdfViewer.areaSettings.annotationSelectorSettings)||je(this.pdfViewer.areaSettings.annotationSelectorSettings.resizerBorderColor)?"black":this.pdfViewer.areaSettings.annotationSelectorSettings.resizerBorderColor,t.fill=je(this.pdfViewer.annotationSelectorSettings.resizerFillColor)||"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor?this.pdfViewer.annotationSelectorSettings.resizerFillColor:je(this.pdfViewer.areaSettings.annotationSelectorSettings)||je(this.pdfViewer.areaSettings.annotationSelectorSettings.resizerFillColor)?"FF4081":this.pdfViewer.areaSettings.annotationSelectorSettings.resizerFillColor):"Volume"===e&&this.pdfViewer.volumeSettings.annotationSelectorSettings?(t.stroke=je(this.pdfViewer.annotationSelectorSettings.resizerBorderColor)||"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor?this.pdfViewer.annotationSelectorSettings.resizerBorderColor:je(this.pdfViewer.volumeSettings.annotationSelectorSettings)||je(this.pdfViewer.volumeSettings.annotationSelectorSettings.resizerBorderColor)?"black":this.pdfViewer.volumeSettings.annotationSelectorSettings.resizerBorderColor,t.fill=je(this.pdfViewer.annotationSelectorSettings.resizerFillColor)||"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor?this.pdfViewer.annotationSelectorSettings.resizerFillColor:je(this.pdfViewer.volumeSettings.annotationSelectorSettings)||je(this.pdfViewer.volumeSettings.annotationSelectorSettings.resizerFillColor)?"FF4081":this.pdfViewer.volumeSettings.annotationSelectorSettings.resizerFillColor):"Ink"===e&&this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings&&(t.stroke=je(this.pdfViewer.annotationSelectorSettings.resizerBorderColor)||"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor?this.pdfViewer.annotationSelectorSettings.resizerBorderColor:je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings)||je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerBorderColor)?"black":this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerBorderColor,t.fill=je(this.pdfViewer.annotationSelectorSettings.resizerFillColor)||"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor?this.pdfViewer.annotationSelectorSettings.resizerFillColor:je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings)||je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerFillColor)?"FF4081":this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerFillColor):(t.stroke=je(this.pdfViewer.annotationSelectorSettings.resizerBorderColor)||"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor?this.pdfViewer.annotationSelectorSettings.resizerBorderColor:je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings)||je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerBorderColor)?"black":this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerBorderColor,t.fill=je(this.pdfViewer.annotationSelectorSettings.resizerFillColor)||"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor?this.pdfViewer.annotationSelectorSettings.resizerFillColor:je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings)||je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerFillColor)?"FF4081":this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerFillColor):(t.stroke=je(this.pdfViewer.annotationSelectorSettings.resizerBorderColor)||"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor?this.pdfViewer.annotationSelectorSettings.resizerBorderColor:je(this.pdfViewer.stampSettings.annotationSelectorSettings)||je(this.pdfViewer.stampSettings.annotationSelectorSettings.resizerBorderColor)?"black":this.pdfViewer.stampSettings.annotationSelectorSettings.resizerBorderColor,t.fill=je(this.pdfViewer.annotationSelectorSettings.resizerFillColor)||"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor?this.pdfViewer.annotationSelectorSettings.resizerFillColor:je(this.pdfViewer.stampSettings.annotationSelectorSettings)||je(this.pdfViewer.stampSettings.annotationSelectorSettings.resizerFillColor)?"FF4081":this.pdfViewer.stampSettings.annotationSelectorSettings.resizerFillColor))},Rwt.prototype.renderRotateThumb=function(e,t,i,n,o){var r=e.offsetY-e.actualSize.height*e.pivot.y,r={x:(e.offsetX-e.actualSize.width*e.pivot.x+e.pivot.x*e.actualSize.width+i.tx)*i.scale,y:(r+i.ty)*i.scale-25},i=(0===e.rotateAngle&&0===e.parentTransform||(mvt(s=uvt(),e.rotateAngle+e.parentTransform,(i.tx+e.offsetX)*i.scale,(i.ty+e.offsetY)*i.scale),r=gvt(s,r)),iwt(e));i.stroke="black",i.strokeWidth=1,i.opacity=1,i.fill="#FF4081",i.centerX=r.x,i.centerY=r.y,i.radius=4,i.angle=0,i.visible=!0,i.class="e-diagram-rotate-handle",i.id="rotateThumb";this.shownBorder()&&this.svgRenderer.drawCircle(t,i,nvt.Rotate,{"aria-label":"Thumb to rotate the selected object"});var s=t.querySelector("#"+i.id);s&&s.setAttribute("role","separator")},Rwt.prototype.renderResizeHandle=function(e,t,i,n,o,r,s,a,l,h,d,p){var c=e.offsetX-e.actualSize.width*e.pivot.x,u=e.offsetY-e.actualSize.height*e.pivot.y,g=e.actualSize.height,m=e.actualSize.width,f={scale:n,tx:0,ty:0},d=(a&&(this.renderPivotLine(e,t,f),this.renderRotateThumb(e,t,f)),d&&(a=!0),this.renderBorder(e,t,p,f,r,s,!0,l),e.actualSize.width*n),r=e.actualSize.height*n,n=0<this.pdfViewer.selectedItems.annotations.length?this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType:this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType,y=!1,v=(this.pdfViewer.formDesignerModule||(v=this.pdfViewer.selectedItems.annotations[0],b=this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(v),(this.pdfViewer.annotationModule.checkIsLockSettings(v)||v.annotationSettings.isLock)&&this.getAllowedInteractions(b)&&(y=!0),"Select"===b[0]&&(y=!1)),this.getResizerLocation(n,p)),b=((v<1||3<v)&&(v=3),!1);!this.pdfViewer.selectedItems.annotations[0]||"Ellipse"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"Radius"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"Rectangle"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"Ink"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||(b=!0),this.pdfViewer.viewerBase.checkSignatureFormField(e.id)||s||l||h||y||((a||b&&40<=d&&40<=r&&(1===v||3===v))&&(this.renderCircularHandle("resizeNorthWest",e,c,u,t,!0,i&nvt.ResizeNorthWest,f,void 0,o,{"aria-label":"Thumb to resize the selected object on top left side direction"},void 0,"e-pv-diagram-resize-handle e-northwest",p),this.renderCircularHandle("resizeNorthEast",e,c+m,u,t,!0,i&nvt.ResizeNorthEast,f,void 0,o,{"aria-label":"Thumb to resize the selected object on top right side direction"},void 0,"e-pv-diagram-resize-handle e-northeast",p),this.renderCircularHandle("resizeSouthWest",e,c,u+g,t,!0,i&nvt.ResizeSouthWest,f,void 0,o,{"aria-label":"Thumb to resize the selected object on bottom left side direction"},void 0,"e-pv-diagram-resize-handle e-southwest",p),this.renderCircularHandle("resizeSouthEast",e,c+m,u+g,t,!0,i&nvt.ResizeSouthEast,f,void 0,o,{"aria-label":"Thumb to resize the selected object on bottom right side direction"},void 0,"e-pv-diagram-resize-handle e-southeast",p)),(a||b)&&(!b||2!==v&&3!==v&&(40<=d&&40<=r||1!==v)))||(this.renderCircularHandle("resizeNorth",e,c+m/2,u,t,!0,i&nvt.ResizeNorth,f,void 0,o,{"aria-label":"Thumb to resize the selected object on top side direction"},void 0,"e-pv-diagram-resize-handle e-north",p),this.renderCircularHandle("resizeSouth",e,c+m/2,u+g,t,!0,i&nvt.ResizeSouth,f,void 0,o,{"aria-label":"Thumb to resize the selected object on bottom side direction"},void 0,"e-pv-diagram-resize-handle e-south",p),this.renderCircularHandle("resizeWest",e,c,u+g/2,t,!0,i&nvt.ResizeWest,f,void 0,o,{"aria-label":"Thumb to resize the selected object on left side direction"},void 0,"e-pv-diagram-resize-handle e-west",p),this.renderCircularHandle("resizeEast",e,c+m,u+g/2,t,!0,i&nvt.ResizeEast,f,void 0,o,{"aria-label":"Thumb to resize the selected object on right side direction"},void 0,"e-pv-diagram-resize-handle e-east",p)),"Textbox"!==n&&"Checkbox"!==n&&"RadioButton"!==n&&"SignatureField"!==n&&"InitialField"!==n&&"DropdownList"!==n&&"ListBox"!==n&&"PasswordField"!==n||(this.renderCircularHandle("resizeNorth",e,c+m/2,u,t,!0,i&nvt.ResizeNorth,f,void 0,o,{"aria-label":"Thumb to resize the selected object on top side direction"},void 0,"e-pv-diagram-resize-handle e-north",p),this.renderCircularHandle("resizeSouth",e,c+m/2,u+g,t,!0,i&nvt.ResizeSouth,f,void 0,o,{"aria-label":"Thumb to resize the selected object on bottom side direction"},void 0,"e-pv-diagram-resize-handle e-south",p),this.renderCircularHandle("resizeWest",e,c,u+g/2,t,!0,i&nvt.ResizeWest,f,void 0,o,{"aria-label":"Thumb to resize the selected object on left side direction"},void 0,"e-pv-diagram-resize-handle e-west",p),this.renderCircularHandle("resizeEast",e,c+m,u+g/2,t,!0,i&nvt.ResizeEast,f,void 0,o,{"aria-label":"Thumb to resize the selected object on right side direction"},void 0,"e-pv-diagram-resize-handle e-east",p))},Rwt.prototype.getAllowedInteractions=function(e){if(e&&0<e.length)for(var t=0;t<e.length;t++)if("None"!==e[0]&&"Resize"===e[parseInt(t.toString(),10)])return!1;return!0},Rwt.prototype.getResizerLocation=function(e,t){var i,n;return t&&"object"!=typeof t&&""!==t?i=je((n=JSON.parse(t)).resizerLocation)||3===n.resizerLocation?3:n.resizerLocation:t&&""!==t?i=je(t.resizerLocation)||3===t.resizerLocation?3:t.resizerLocation:(i=je((n=this.pdfViewer.annotationSelectorSettings).resizerLocation)||3===n.resizerLocation?3:n.resizerLocation,"Line"===e&&this.pdfViewer.lineSettings.annotationSelectorSettings?i=je(this.pdfViewer.lineSettings.annotationSelectorSettings.resizerLocation)||3===this.pdfViewer.lineSettings.annotationSelectorSettings.resizerLocation||je(this.pdfViewer.lineSettings.annotationSelectorSettings)||je(this.pdfViewer.lineSettings.annotationSelectorSettings.resizerLocation)?3:this.pdfViewer.lineSettings.annotationSelectorSettings.resizerLocation:"LineWidthArrowHead"===e&&this.pdfViewer.arrowSettings.annotationSelectorSettings?i=je(this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerLocation)||3===this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerLocation||je(this.pdfViewer.arrowSettings.annotationSelectorSettings)||je(this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerLocation)?3:this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerLocation:"Rectangle"===e&&this.pdfViewer.rectangleSettings.annotationSelectorSettings?i=je(this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerLocation)||3===this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerLocation||je(this.pdfViewer.rectangleSettings.annotationSelectorSettings)||je(this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerLocation)?3:this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerLocation:"Ellipse"===e&&this.pdfViewer.circleSettings.annotationSelectorSettings?i=je(this.pdfViewer.circleSettings.annotationSelectorSettings.resizerLocation)||3===this.pdfViewer.circleSettings.annotationSelectorSettings.resizerLocation||je(this.pdfViewer.circleSettings.annotationSelectorSettings)||je(this.pdfViewer.circleSettings.annotationSelectorSettings.resizerLocation)?3:this.pdfViewer.circleSettings.annotationSelectorSettings.resizerLocation:"Polygon"===e&&this.pdfViewer.polygonSettings.annotationSelectorSettings?i=je(this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerLocation)||3===this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerLocation||je(this.pdfViewer.polygonSettings.annotationSelectorSettings)||je(this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerLocation)?3:this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerLocation:"Distance"===e?i=je(this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerLocation)||3===this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerLocation||je(this.pdfViewer.distanceSettings.annotationSelectorSettings)||je(this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerLocation)?3:this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerLocation:"Radius"===e&&this.pdfViewer.radiusSettings.annotationSelectorSettings?i=je(this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerLocation)||3===this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerLocation||je(this.pdfViewer.radiusSettings.annotationSelectorSettings)||je(this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerLocation)?3:this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerLocation:"Stamp"===e&&this.pdfViewer.stampSettings.annotationSelectorSettings?i=je(this.pdfViewer.stampSettings.annotationSelectorSettings.resizerLocation)||3===this.pdfViewer.stampSettings.annotationSelectorSettings.resizerLocation||je(this.pdfViewer.stampSettings.annotationSelectorSettings)||je(this.pdfViewer.stampSettings.annotationSelectorSettings.resizerLocation)?3:this.pdfViewer.stampSettings.annotationSelectorSettings.resizerLocation:"FreeText"===e&&this.pdfViewer.freeTextSettings.annotationSelectorSettings?i=je(this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerLocation)||3===this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerLocation||je(this.pdfViewer.freeTextSettings.annotationSelectorSettings)||je(this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerLocation)?3:this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerLocation:"HandWrittenSignature"!==e&&"SignatureText"!==e&&"SignatureImage"!==e||!this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings?"Ink"===e&&this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings&&(i=je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerLocation)||3===this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerLocation||je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings)||je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerLocation)?3:this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerLocation):i=je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerLocation)||3===this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerLocation||je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings)||je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerLocation)?3:this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerLocation),i},Rwt.prototype.renderPivotLine=function(e,t,i,n,o){var r=!0,o=(o&&(r=!1),iwt(e,i)),r=(o.fill="None",o.stroke="black",o.strokeWidth=1,o.dashArray="2,3",o.visible=r,i.scale),i=(o.x*=r,o.y*=r,o.width*=r,o.height*=r,o.id="pivotLine",o.class="e-diagram-pivot-line",{x:e.actualSize.width*e.pivot.x*r,y:-20}),e={x:e.actualSize.width*e.pivot.x*r,y:0};o.startPoint=i,o.endPoint=e,this.shownBorder()&&this.svgRenderer.drawLine(t,o)},Rwt.prototype.renderEndPointHandle=function(e,t,i,n,o,r,s,a){n=n||{tx:0,ty:0,scale:1};var l,h=e.sourcePoint,d=e.targetPoint,p=e.wrapper,c=this.shownBorder();if(c)for(l=0;l<e.vertexPoints.length;l++){var u=e.vertexPoints[parseInt(l.toString(),10)];this.renderCircularHandle("segementThumb_"+(l+1),p,u.x,u.y,t,!0,i&nvt.ConnectorSource,n,o,null,null,l,"e-pv-diagram-resize-handle",a)}var g=0;if("Distance"===e.shapeAnnotationType)for(l=0;l<e.wrapper.children.length;l++){var m,f,u=e.wrapper.children[parseInt(l.toString(),10)],y=void 0,v=Cbt.findAngle(e.sourcePoint,e.targetPoint);-1<u.id.indexOf("leader")&&(m=e.wrapper.children[0].bounds.center,m=0===g?(y={x:e.sourcePoint.x,y:e.sourcePoint.y-e.leaderHeight},h):(y={x:e.targetPoint.x,y:e.targetPoint.y-e.leaderHeight},d),mvt(f=uvt(),v,m.x,m.y),c&&(v=gvt(f,{x:y.x,y:y.y}),this.renderCircularHandle("leaderThumb_"+(l+1),p,v.x,v.y,t,!0,i&nvt.ConnectorSource,n,o,null,null,l,"e-pv-diagram-resize-handle",a)),g++)}},Rwt.prototype.initSelectorWrapper=function(){this.pdfViewer.selectedItems.init(this)},Rwt.prototype.select=function(o,r,e,s){for(var a=this.pdfViewer.selectedItems,l=this,t=0;t<o.length;t++)!function(e){var t,i,n=l.pdfViewer.nameTable[o[parseInt(e.toString(),10)]];n.formFieldAnnotationType&&l.pdfViewer.designerMode?(a.formFields.push(n),l.initSelectorWrapper(),a.wrapper.children.push(n.wrapper),l.renderSelector(n.pageIndex,r,n,!0)):!n||n.formFieldAnnotationType||n instanceof Jbt||!n.wrapper.visible||!l.pdfViewer.annotationModule||(e=void 0,n.annotationSettings?je(e=n.annotationSettings)||je(e.isLock)||(e.isLock=JSON.parse(e.isLock)):n.formFieldAnnotationType||(e=l.pdfViewer.annotationModule.findAnnotationSettings(n,!0),n.annotationSettings=e),t=!n.formFieldAnnotationType&&!!e&&e.isLock,e&&e.isLock&&l.pdfViewer.annotationModule.checkAllowedInteractions("Select",n)&&(t=!1),e="Path"===n.shapeAnnotationType||"SignatureText"===n.shapeAnnotationType||"SignatureImage"===n.shapeAnnotationType,i=!1,l.pdfViewer.formFieldCollection.filter(function(e){return e.id===n.id.split("_")[0]}).forEach(function(e){return i=e.isReadonly}),t)||i&&e||(a.annotations.push(n),l.shownBorder()&&(l.initSelectorWrapper(),a.wrapper.rotateAngle=a.rotateAngle=0,a.wrapper.children.push(n.wrapper),s||l.renderSelector(n.pageIndex,r,n,!0)))}(t)},Rwt.prototype.dragSelectedObjects=function(e,t,i,n,o){var r=this.pdfViewer.selectedItems;return this.drag(r,e,t,n,o),!0},Rwt.prototype.drag=function(e,t,i,n,o){if(e instanceof Jbt){if(e.annotations.length)for(var r=0,s=e.annotations;r<s.length;r++){var a=s[r];this.drag(a,t,i,n,o),this.renderSelector(a.pageIndex,n,o)}else if(e.formFields.length)for(var l=0,h=e.formFields;l<h.length;l++){a=h[l];this.drag(a,t,i,n,o),this.renderSelector(a.pageIndex,n,o)}}else this.dragAnnotation(e,t,i)},Rwt.prototype.dragAnnotation=function(e,t,i){var n=this.moveInsideViewer(e,t,i);if(e.wrapper.offsetX+=n.tx,e.wrapper.offsetY+=n.ty,$bt(e)||"Polygon"===e.shapeAnnotationType){if(e.wrapper.children.length)for(var o=e.wrapper.children,r=0;r<o.length;r++)o[parseInt(r.toString(),10)].offsetX+=t,o[parseInt(r.toString(),10)].offsetY+=i;this.dragControlPoint(e,t,i,!0)}this.nodePropertyChange(e,{bounds:{x:e.wrapper.offsetX,y:e.wrapper.offsetY}}),e.wrapper.measureChildren=!1;n=this.pdfViewer.viewerBase.getAnnotationCanvas("_annotationCanvas_",e.pageIndex);this.pdfViewer.renderDrawing(n,e.pageIndex)},Rwt.prototype.dragControlPoint=function(e,t,i,n,o){for(var r=this.pdfViewer.nameTable[e.id],s=0;s<r.vertexPoints.length;s++)r.vertexPoints[parseInt(s.toString(),10)].x+=t,r.vertexPoints[parseInt(s.toString(),10)].y+=i;return n||this.updateEndPoint(r),!0},Rwt.prototype.updateEndPoint=function(e){this.nodePropertyChange(e,{vertexPoints:e.vertexPoints}),this.renderSelector(e.pageIndex)},Rwt.prototype.nodePropertyChange=function(e,t){var i,n,o,r;if(t.bounds&&(void 0!==t.bounds.width&&(e.bounds.width=e.wrapper.width=t.bounds.width),void 0!==t.bounds.height&&(e.bounds.height=e.wrapper.height=t.bounds.height),void 0!==t.bounds.x&&(e.bounds.x=t.bounds.x-.5*e.bounds.width,e.wrapper.offsetX=t.bounds.x),void 0!==t.bounds.y&&(e.bounds.y=t.bounds.y-.5*e.bounds.height,e.wrapper.offsetY=t.bounds.y),void 0!==t.leaderHeight&&(e.leaderHeight=t.leaderHeight,this.updateConnector(e,e.vertexPoints)),e.wrapper.children.length))for(var s,a,l,h=e.wrapper.children,d=0;d<h.length;d++)h[parseInt(d.toString(),10)].id&&((s=h[parseInt(d.toString(),10)].id.split("_")).length&&(-1<s.indexOf("perimeter")||-1<s.indexOf("radius"))?this.setNodePosition(h[parseInt(d.toString(),10)],e):s.length&&-1<s.indexOf("srcDec")?(h[parseInt(d.toString(),10)].offsetX=e.vertexPoints[0].x,h[parseInt(d.toString(),10)].offsetY=e.vertexPoints[0].y):s.length&&-1<s.indexOf("tarDec")?(h[parseInt(d.toString(),10)].offsetX=e.vertexPoints[e.vertexPoints.length-1].x,h[parseInt(d.toString(),10)].offsetY=e.vertexPoints[e.vertexPoints.length-1].y):s.length&&-1<s.indexOf("stamp")&&(void(s=0)!==e.wrapper.width&&void 0!==e.wrapper.height&&(s=20),e.isDynamicStamp?(h[parseInt(d.toString(),10)].width=e.bounds.width-s,h[parseInt(d.toString(),10)].height=e.bounds.height/2-s,a=h[1],(l=this.pdfViewer.stampSettings||this.pdfViewer.annotationSettings)&&(l.maxHeight||l.maxWidth)&&60<e.bounds.height?a.style.fontSize=0!==s?e.bounds.width/s:e.wrapper.bounds.width/20:a.style.fontSize=0!==s?this.fontSizeCalculation(e,a,e.bounds.width-20):this.fontSizeCalculation(e,a,e.wrapper.bounds.width-20),0!==s&&(a.margin.bottom=-h[parseInt(d.toString(),10)].height/2)):(h[parseInt(d.toString(),10)].width=e.bounds.width-s,h[parseInt(d.toString(),10)].height=e.bounds.height-s),h[parseInt(d.toString(),10)].offsetX=e.wrapper.offsetX,h[parseInt(d.toString(),10)].offsetY=e.wrapper.offsetX,h[parseInt(d.toString(),10)].isDirt=!0));if(void 0!==t.sourceDecoraterShapes&&(e.sourceDecoraterShapes=t.sourceDecoraterShapes,this.updateConnector(e,e.vertexPoints)),void 0!==t.isReadonly&&"FreeText"===e.shapeAnnotationType&&(e.isReadonly=t.isReadonly),void 0!==t.annotationSelectorSettings&&(e.annotationSelectorSettings=t.annotationSelectorSettings),void 0!==t.taregetDecoraterShapes&&(e.taregetDecoraterShapes=t.taregetDecoraterShapes,this.updateConnector(e,e.vertexPoints)),void 0!==t.fillColor&&(e.fillColor=t.fillColor,e.wrapper.children[0].style.fill=t.fillColor,e.enableShapeLabel||e.measureType)&&e.wrapper&&e.wrapper.children)for(var h=e.wrapper.children,p=0;p<h.length;p++)h[parseInt(p.toString(),10)].textNodes&&(e.enableShapeLabel&&(e.labelFillColor=t.fillColor,h[parseInt(p.toString(),10)].style.fill=t.fillColor),e.measureType)&&(h[parseInt(p.toString(),10)].style.fill=t.fillColor);if(e.enableShapeLabel&&void 0!==t.labelFillColor&&e.enableShapeLabel&&e.wrapper&&e.wrapper.children)for(var h=e.wrapper.children,c=0;c<h.length;c++)h[parseInt(c.toString(),10)].textNodes&&(e.labelFillColor=t.labelFillColor,h[parseInt(c.toString(),10)].style.fill=t.labelFillColor);if(void 0!==t.opacity&&("Stamp"===e.shapeAnnotationType||"FreeText"===e.shapeAnnotationType?(e.wrapper.children[1].style.opacity=t.opacity,e.wrapper.children[2]&&(e.wrapper.children[2].style.opacity=t.opacity)):"StickyNotes"===e.shapeAnnotationType&&(this.pdfViewer.nameTable[e.annotName].wrapper.children[0].style.opacity=t.opacity),e.opacity=t.opacity,e.wrapper.children[0].style.opacity=t.opacity,e.enableShapeLabel)&&e.wrapper&&e.wrapper.children)for(var h=e.wrapper.children,u=0;u<h.length;u++)h[parseInt(u.toString(),10)].textNodes&&(h[parseInt(u.toString(),10)].style.opacity=t.labelOpacity);if(e.enableShapeLabel&&void 0!==t.labelOpacity&&e.enableShapeLabel&&e.wrapper&&e.wrapper.children)for(var h=e.wrapper.children,g=0;g<h.length;g++)h[parseInt(g.toString(),10)].textNodes&&(h[parseInt(g.toString(),10)].style.opacity=t.labelOpacity);if((void 0!==t.rotateAngle&&(e.rotateAngle=t.rotateAngle,e.wrapper.rotateAngle=t.rotateAngle),void 0!==t.strokeColor&&(e.strokeColor=t.strokeColor,e.wrapper.children[0].style.strokeColor=t.strokeColor,"Radius"===e.shapeAnnotationType)&&e.wrapper.children[1]&&(e.wrapper.children[1].style.strokeColor=t.strokeColor),void 0!==t.fontColor)&&(e.fontColor=t.fontColor,"FreeText"===e.shapeAnnotationType&&e.wrapper&&e.wrapper.children&&e.wrapper.children.length&&((h=e.wrapper.children)[1].style.color=t.fontColor,"Justify"===e.textAlign?h[1].horizontalAlignment="Center":h[1].horizontalAlignment="Auto"),e.enableShapeLabel&&e.wrapper&&e.wrapper.children))for(var h=e.wrapper.children,m=0;m<h.length;m++)h[parseInt(m.toString(),10)].textNodes&&(h[parseInt(m.toString(),10)].style.color=t.fontColor);if(void 0!==t.fontFamily&&(e.fontFamily=t.fontFamily,"FreeText"===e.shapeAnnotationType&&e.wrapper&&e.wrapper.children&&e.wrapper.children.length&&((h=e.wrapper.children)[1].style.fontFamily=t.fontFamily),e.enableShapeLabel&&e.wrapper&&e.wrapper.children))for(var h=e.wrapper.children,f=0;f<h.length;f++)h[parseInt(f.toString(),10)].textNodes&&(h[parseInt(f.toString(),10)].style.fontFamily=t.fontFamily);if(void 0!==t.fontSize){if(("FreeText"===e.shapeAnnotationType||"SignatureText"===e.shapeAnnotationType)&&e.wrapper&&e.wrapper.children&&e.wrapper.children.length&&((h=e.wrapper.children)[1].style.fontSize=t.fontSize,"SignatureText"===e.shapeAnnotationType)&&(e.wrapper.children[1].bounds.width=e.bounds.width,e.wrapper.children[1].desiredSize.width=e.bounds.width,e.wrapper.children[1].actualSize.width=e.bounds.width,h[1].horizontalAlignment="Center",h[1].verticalAlignment="Center",h[1].setOffsetWithRespectToBounds(0,0,"Absolute")),e.enableShapeLabel&&e.wrapper&&e.wrapper.children)for(var h=e.wrapper.children,y=0;y<h.length;y++)h[parseInt(y.toString(),10)].textNodes&&(h[parseInt(y.toString(),10)].style.fontSize=t.fontSize);this.pdfViewer.enableToolbar&&this.pdfViewer.toolbarModule?this.pdfViewer.toolbarModule.annotationToolbarModule.updateFontSizeInIcon(t.fontSize):this.pdfViewer.annotationModule&&e.fontSize!==t.fontSize&&this.pdfViewer.annotationModule.handleFontSizeUpdate(t.fontSize)}if(void 0!==t.font&&"FreeText"===e.shapeAnnotationType&&e.wrapper&&e.wrapper.children&&e.wrapper.children.length&&(h=e.wrapper.children,void 0!==t.font.isBold&&(h[1].style.bold=t.font.isBold,e.font.isBold=t.font.isBold),void 0!==t.font.isItalic&&(h[1].style.italic=t.font.isItalic,e.font.isItalic=t.font.isItalic),void 0!==t.font.isUnderline&&(t.font.isUnderline&&(e.font.isStrikeout=!1),!0===t.font.isUnderline?h[1].style.textDecoration="Underline":t.font.isStrikeout||(h[1].style.textDecoration="None"),e.font.isUnderline=t.font.isUnderline),void 0!==t.font.isStrikeout)&&(t.font.isStrikeout&&(e.font.isUnderline=!1),!0===t.font.isStrikeout?h[1].style.textDecoration="LineThrough":t.font.isUnderline||(h[1].style.textDecoration="None"),e.font.isStrikeout=t.font.isStrikeout),void 0!==t.textAlign&&(n=owt(r=!je(this.pdfViewer.selectedItems.annotations)&&0<this.pdfViewer.selectedItems.annotations.length?this.pdfViewer.selectedItems.annotations[0]:e),o=owt(r),e.textAlign!==t.textAlign)&&(e.textAlign=t.textAlign,o.textAlign=t.textAlign,"FreeText"===e.shapeAnnotationType)&&e.wrapper&&e.wrapper.children&&e.wrapper.children.length&&((h=e.wrapper.children)[1].style.textAlign=t.textAlign,1===h[1].childNodes.length?"Justify"===e.textAlign?(h[1].horizontalAlignment="Left",h[1].setOffsetWithRespectToBounds(.01,0,null)):"Right"===e.textAlign?(h[1].horizontalAlignment="Right",h[1].setOffsetWithRespectToBounds(1,0,null)):"Left"===e.textAlign?(h[1].horizontalAlignment="Left",h[1].setOffsetWithRespectToBounds(.01,0,null)):"Center"===e.textAlign&&(h[1].horizontalAlignment="Center",h[1].setOffsetWithRespectToBounds(.51,0,null)):1<h[1].childNodes.length&&"Justify"===e.textAlign?h[1].horizontalAlignment="Center":h[1].horizontalAlignment="Auto",this.pdfViewer.annotation.isUndoRedoAction||this.pdfViewer.annotation.addAction(this.pdfViewer.viewerBase.getActivePage(!1),null,r,"textAlign","",n,o)),void 0!==t.thickness){if(e.thickness=t.thickness,e.wrapper.children[0].style.strokeWidth=t.thickness,"Line"===e.shapeAnnotationType||"LineWidthArrowHead"===e.shapeAnnotationType)for(var v=0;v<e.wrapper.children.length;v++){var b=e.wrapper.children[parseInt(v.toString(),10)];(b.id.includes("srcDec")||b.id.includes("tarDec"))&&(b.width=12*t.thickness,b.height=12*t.thickness)}"Radius"===e.shapeAnnotationType&&e.wrapper.children[1]&&(e.wrapper.children[1].style.strokeWidth=t.thickness)}if(void 0!==t.borderDashArray&&(e.borderDashArray=t.borderDashArray,e.wrapper.children[0].style.strokeDashArray=t.borderDashArray),void 0!==t.borderStyle&&(e.borderStyle=t.borderStyle),void 0!==t.author&&(e.author=t.author),void 0!==t.modifiedDate&&(e.modifiedDate=t.modifiedDate),void 0!==t.subject&&(e.subject=t.subject),void 0!==t.vertexPoints&&(e.vertexPoints=t.vertexPoints,this.pdfViewer.nameTable[e.id].vertexPoints=t.vertexPoints,this.updateConnector(e,t.vertexPoints)),void 0!==t.leaderHeight&&"Polygon"!==e.shapeAnnotationType&&(e.leaderHeight=t.leaderHeight,this.updateConnector(e,e.vertexPoints)),void 0!==t.notes&&(e.notes=t.notes),void 0!==t.annotName&&(e.annotName=t.annotName),"Distance"===e.shapeAnnotationType){for(i=0;i<e.wrapper.children.length;i++){var w=e.wrapper.children[parseInt(i.toString(),10)],C=lwt(e);-1<w.id.indexOf("leader1")&&this.setLineDistance(e,C,w,!1),-1<w.id.indexOf("leader2")&&this.setLineDistance(e,C,w,!0)}this.updateConnector(e,e.vertexPoints)}if("Polygon"===e.shapeAnnotationType&&t.vertexPoints&&(e.data=Swt(e.vertexPoints),(r=e.wrapper.children[0]).data=e.data,r.canMeasurePath=!0),$bt(e))for(var S=0;S<e.wrapper.children.length;S++)e.wrapper.children[parseInt(S.toString(),10)].textNodes||ewt(e,e.wrapper.children[parseInt(S.toString(),10)]),!0===e.enableShapeLabel?(e.wrapper.children[parseInt(S.toString(),10)]instanceof Xvt&&(e.wrapper.children[parseInt(S.toString(),10)].style.fill=e.labelFillColor),e.wrapper.children[parseInt(S.toString(),10)]instanceof ybt&&"Perimeter"===e.measureType&&(e.wrapper.children[parseInt(S.toString(),10)].style.fill="transparent")):(e.wrapper.children[parseInt(S.toString(),10)]instanceof ybt&&"Perimeter"===e.measureType||e.wrapper.children[parseInt(S.toString(),10)]instanceof Xvt)&&(e.wrapper.children[parseInt(S.toString(),10)].style.fill="transparent");if(e&&("FreeText"===e.shapeAnnotationType||!0===e.enableShapeLabel)&&e.wrapper&&e.wrapper.children&&e.wrapper.children.length)for(var h=e.wrapper.children,A=0;A<h.length;A++)h[parseInt(A.toString(),10)].textNodes&&("FreeText"===e.shapeAnnotationType?(t.dynamicText?(h[parseInt(A.toString(),10)].content=t.dynamicText,e.dynamicText=t.dynamicText):h[parseInt(A.toString(),10)].content=e.dynamicText,h[parseInt(A.toString(),10)].width=e.bounds.width):(!0===e.enableShapeLabel&&e.measureType||!0===e.enableShapeLabel)&&(t.labelContent?(h[parseInt(A.toString(),10)].content=t.labelContent,e.labelContent=t.labelContent):h[parseInt(A.toString(),10)].content=e.labelContent,e.notes=h[parseInt(A.toString(),10)].content),h[parseInt(A.toString(),10)].isDirt=!0);if(e&&"SignatureText"===e.shapeAnnotationType&&e.wrapper&&e.wrapper.children&&1<e.wrapper.children.length&&(e.wrapper.children[1].isDirt=!0),e&&"FreeText"===e.shapeAnnotationType&&this.pdfViewer.annotationModule.stickyNotesAnnotationModule.textFromCommentPanel?(e.wrapper.width=void 0,e.wrapper.height=void 0,e.wrapper.measure(new avt(e.wrapper.bounds.width,e.wrapper.bounds.height)),this.pdfViewer.annotationModule.stickyNotesAnnotationModule.textFromCommentPanel=!1):e.wrapper.measure(new avt(e.wrapper.bounds.width,e.wrapper.bounds.height)),e.wrapper.arrange(e.wrapper.desiredSize),e&&e.formFieldAnnotationType&&e.wrapper&&e.wrapper.children&&e.wrapper.children.length&&((h=e.wrapper.children[0]).actualSize.width=e.wrapper.desiredSize.width,h.actualSize.height=e.wrapper.desiredSize.height),e&&"FreeText"===e.shapeAnnotationType&&!je(e.subject)){if(e.wrapper&&e.wrapper.children&&e.wrapper.children.length){1<(h=e.wrapper.children)[1].childNodes.length&&"Justify"===e.textAlign?h[1].horizontalAlignment="Center":1===h[1].childNodes.length&&("Justify"===e.textAlign?(h[1].horizontalAlignment="Left",h[1].setOffsetWithRespectToBounds(.01,0,null)):"Right"===e.textAlign?(h[1].horizontalAlignment="Right",h[1].setOffsetWithRespectToBounds(1,0,null)):"Left"===e.textAlign?(h[1].horizontalAlignment="Left",h[1].setOffsetWithRespectToBounds(.01,0,null)):"Center"===e.textAlign&&(h[1].horizontalAlignment="Center",h[1].setOffsetWithRespectToBounds(.51,0,null)));for(var x=0;x<h.length;x++){if(h[parseInt(x.toString(),10)].textNodes&&0<h[parseInt(x.toString(),10)].textNodes.length){h[parseInt(x.toString(),10)].isDirt=!0;var I=h[parseInt(x.toString(),10)].textNodes.length*h[parseInt(x.toString(),10)].textNodes[0].dy,T=e.bounds.height-I;if(0<T&&T<h[parseInt(x.toString(),10)].textNodes[0].dy&&(I+=h[parseInt(x.toString(),10)].textNodes[0].dy),I>e.bounds.height){for(var E="",D=0;D<h[parseInt(x.toString(),10)].textNodes.length;D++)E+=h[parseInt(x.toString(),10)].textNodes[parseInt(D.toString(),10)].text;h[parseInt(x.toString(),10)].content=E}}h[parseInt(x.toString(),10)].width=e.bounds.width}}e.wrapper.measure(new avt(e.wrapper.bounds.width,e.wrapper.bounds.height)),e.wrapper.arrange(e.wrapper.desiredSize)}this.pdfViewer.renderDrawing(void 0,e.pageIndex),e&&"FreeText"===e.shapeAnnotationType&&e.wrapper&&e.wrapper.children&&e.wrapper.children.length&&(1===(h=e.wrapper.children)[1].childNodes.length&&"Justify"===e.textAlign?(h[1].horizontalAlignment="Left",h[1].setOffsetWithRespectToBounds(.5,0,null)):1<h[1].childNodes.length&&"Justify"===e.textAlign&&(h[1].horizontalAlignment="Center",h[1].setOffsetWithRespectToBounds(0,0,null)))},Rwt.prototype.fontSizeCalculation=function(e,t,i){var n=this.pdfViewer.viewerBase.getAnnotationCanvas("_annotationCanvas_",e.pageIndex).getContext("2d"),o=0,r=0,s="";for(t.style.italic&&t.style.bold?s="bold italic ":t.style.bold?s="bold ":t.style.italic&&(s="italic ");o<i;)n.font=s+r+"px "+t.style.fontFamily,o=n.measureText(e.dynamicText).width,r+=.1;return r-=.1},Rwt.prototype.setLineDistance=function(e,t,i,n){e=n?Iwt(e,t[1],t[0],n):Iwt(e,t[0],t[1],n);i.data=e.data,i.offsetX=e.offsetX,i.offsetY=e.offsetY,i.rotateAngle=e.rotateAngle,i.width=e.width,i.height=e.height,i.pivot=e.pivot,i.canMeasurePath=!0,i.isDirt=!0},Rwt.prototype.scaleSelectedItems=function(e,t,i){var n=this.pdfViewer.selectedItems;return this.scale(n,e,t,i)},Rwt.prototype.scale=function(e,t,i,n){var o=!0;if(e instanceof Jbt){if(e.annotations&&e.annotations.length)for(var r=0,s=e.annotations;r<s.length;r++)var a=s[r],o=this.scaleAnnotation(a,t,i,n,e);else if(e.formFields&&e.formFields.length)for(var l=0,h=e.formFields;l<h.length;l++){a=h[l];o=this.scaleAnnotation(a,t,i,n,e)}}else o=this.scaleAnnotation(e,t,i,n,void 0);return o},Rwt.prototype.scaleObject=function(e,t,i,n,o,r){var s,a,l,h;t=t<0?1:t,1===(e=e<0?1:e)&&1===t||(a=s=void 0,$bt(n)||(s=(h=n).wrapper.actualSize.width*e,a=h.wrapper.actualSize.height*t,e=s/h.wrapper.actualSize.width,t=a/h.wrapper.actualSize.height),mvt(l=uvt(),-(r=(r=r||n).wrapper).rotateAngle,i.x,i.y),fvt(l,e,t,i.x,i.y),mvt(l,r.rotateAngle,i.x,i.y),$bt(n))||(e=gvt(l,{x:(h=n).wrapper.offsetX,y:h.wrapper.offsetY}),0<s&&(h.wrapper.width=s,h.wrapper.offsetX=e.x),0<a&&(h.wrapper.height=a,h.wrapper.offsetY=e.y),this.nodePropertyChange(n,{bounds:{width:h.wrapper.width,height:h.wrapper.height,x:h.wrapper.offsetX,y:h.wrapper.offsetY}}))},Rwt.prototype.scaleAnnotation=function(e,t,i,n,o){var r=this.pdfViewer.nameTable[e.id],s=r.wrapper,a=(o=o||e).wrapper,l=a.offsetX-a.actualSize.width*a.pivot.x,h=a.offsetY-a.actualSize.height*a.pivot.y,l=this.getShapePoint(l,h,a.actualSize.width,a.actualSize.height,a.rotateAngle,a.offsetX,a.offsetY,n),h=(void 0!==s.actualSize.width&&void 0!==s.actualSize.height&&this.scaleObject(t,i,l,r,s,o),this.checkBoundaryConstraints(void 0,void 0,e.pageIndex,e.wrapper.bounds));return h||(this.scaleObject(1/t,1/i,l,r,s,o),"FreeText"!==e.shapeAnnotationType)||"free_text"!==e.id.slice(0,9)&&"freetext"!==e.id.slice(0,8)||(a=this.moveInsideViewer(e),this.nodePropertyChange(e,{bounds:{width:e.wrapper.width,height:e.wrapper.height,x:e.wrapper.offsetX+a.tx,y:e.wrapper.offsetY+a.ty}})),h},Rwt.prototype.moveInsideViewer=function(e,t,i){var n,o,r,s,a,l,h;return t=t||0,i=i||0,"FreeText"!==e.shapeAnnotationType||"free_text"!==e.id.slice(0,9)&&"freetext"!==e.id.slice(0,8)||(o=this.pdfViewer.viewerBase.getAnnotationCanvas("_annotationCanvas_",e.pageIndex))&&(e=e.wrapper.bounds,n=o.clientWidth/this.pdfViewer.viewerBase.getZoomFactor(),o=o.clientHeight/this.pdfViewer.viewerBase.getZoomFactor(),r=e.right,s=e.left,a=e.top,e=e.bottom,r+t<=n-3&&1<=s+t&&e+i<=o-3&&1<=a+i||(h=l=0,r<=n-3||(l=n-r-3),e<=o-3||(h=o-e-3),0!==(l=1<=s?l:l-s+1)&&(t=l),0!==(h=1<=a?h:h-a+1)&&(i=h))),{tx:t,ty:i}},Rwt.prototype.checkBoundaryConstraints=function(e,t,i,n,o,r){var s=n?void 0:this.pdfViewer.selectedItems.wrapper.bounds,a=n,i=this.pdfViewer.viewerBase.getAnnotationCanvas("_annotationCanvas_",i),l=1;if(i){var h=i.clientWidth/this.pdfViewer.viewerBase.getZoomFactor(),i=i.clientHeight/this.pdfViewer.viewerBase.getZoomFactor(),d=(n?a:s).right+(e||0),e=(n?a:s).left+(e||0),p=(n?a:s).top+(t||0),n=(n?a:s).bottom+(t||0);if(o&&(l=50,this.pdfViewer.viewerBase.eventArgs)&&this.pdfViewer.viewerBase.eventArgs.source&&this.RestrictStamp(this.pdfViewer.viewerBase.eventArgs.source))return!1;if(d<=h-3&&1<=e&&n<=i-3&&l<=p)return!0;if(r&&d<=h-(l=10)&&10<=e&&n<=i-10&&l<=p)return!0}return!1},Rwt.prototype.RestrictStamp=function(e){return!(!e||void 0===e.pageIndex||!this.pdfViewer.viewerBase.activeElements||e.pageIndex===this.pdfViewer.viewerBase.activeElements.activePageID)},Rwt.prototype.getShapeBounds=function(e){new dvt;var t,i=Pvt(e),n=i.middleLeft,o=i.topCenter,r=i.bottomCenter,s=i.middleRight,a=i.topLeft,l=i.topRight,h=i.bottomLeft,i=i.bottomRight;return e.corners={topLeft:a,topCenter:o,topRight:l,middleLeft:n,middleRight:s,bottomLeft:h,bottomCenter:r,bottomRight:i},0===e.rotateAngle&&0===e.parentTransform||(mvt(t=uvt(),e.rotateAngle+e.parentTransform,e.offsetX,e.offsetY),e.corners.topLeft=a=gvt(t,a),e.corners.topCenter=gvt(t,o),e.corners.topRight=l=gvt(t,l),e.corners.middleLeft=gvt(t,n),e.corners.middleRight=gvt(t,s),e.corners.bottomLeft=h=gvt(t,h),e.corners.bottomCenter=gvt(t,r),e.corners.bottomRight=i=gvt(t,i)),o=dvt.toBounds([a,l,h,i]),e.corners.left=o.left,e.corners.right=o.right,e.corners.top=o.top,e.corners.bottom=o.bottom,e.corners.center=o.center,e.corners.width=o.width,e.corners.height=o.height,o},Rwt.prototype.getShapePoint=function(e,t,i,n,o,r,s,a){var l={x:0,y:0},h=uvt();switch(mvt(h,o,r,s),a.x){case 1:switch(a.y){case 1:l=gvt(h,{x:e+i,y:t+n});break;case 0:l=gvt(h,{x:e+i,y:t});break;case.5:l=gvt(h,{x:e+i,y:t+n/2})}break;case 0:switch(a.y){case.5:l=gvt(h,{x:e,y:t+n/2});break;case 1:l=gvt(h,{x:e,y:t+n});break;case 0:l=gvt(h,{x:e,y:t})}break;case.5:switch(a.y){case 0:l=gvt(h,{x:e+i/2,y:t});break;case.5:l=gvt(h,{x:e+i/2,y:t+n/2});break;case 1:l=gvt(h,{x:e+i/2,y:t+n})}}return{x:l.x,y:l.y}},Rwt.prototype.dragConnectorEnds=function(e,t,i,n,o,r,s){var a,l,h,d,p,c,u,g=t instanceof Jbt?t.annotations[0]:t;return i={x:i.x/this.pdfViewer.viewerBase.getZoomFactor(),y:i.y/this.pdfViewer.viewerBase.getZoomFactor()},this.checkBoundaryConstraints(void 0,void 0,g.pageIndex,g.wrapper.bounds)&&("Distance"===g.shapeAnnotationType?(c=awt(g,e),"Leader0"===e?this.pdfViewer.viewerBase.tool instanceof hCt?(g.vertexPoints[0].x=i.x,g.vertexPoints[0].y=i.y):(u=i.x-c.point.x,p=i.y-c.point.y,g.vertexPoints[0].x+=u,g.vertexPoints[0].y+=p):"Leader1"===e?(a=g.vertexPoints.length-1,this.pdfViewer.viewerBase.tool instanceof hCt?(g.vertexPoints[parseInt(a.toString(),10)].x=i.x,g.vertexPoints[parseInt(a.toString(),10)].y=i.y):(u=i.x-c.point.x,p=i.y-c.point.y,g.vertexPoints[parseInt(a.toString(),10)].x+=u,g.vertexPoints[parseInt(a.toString(),10)].y+=p)):(c=Cbt.findAngle(g.sourcePoint,g.targetPoint),a=t.wrapper.children[0].bounds.center,mvt(d=uvt(),-c,a.x,a.y),d=gvt(d,{x:i.x,y:i.y}),"ConnectorSegmentPoint"===e.split("_")[0]&&(mvt(h=uvt(),-c,a.x,a.y),l=gvt(h,g.vertexPoints[0]),h=gvt(h,g.vertexPoints[g.vertexPoints.length-1]),p=d.y-l.y,0===g.leaderHeight&&null!=g.leaderHeight?g.leaderHeight=this.pdfViewer.distanceSettings.leaderLength:(g.leaderHeight+=p,l.y+=p,h.y+=p,mvt(d=uvt(),c,a.x,a.y),g.vertexPoints[0]=gvt(d,l),g.vertexPoints[g.vertexPoints.length-1]=gvt(d,h))))):"ConnectorSegmentPoint"===e.split("_")[0]&&(c=Number(e.split("_")[1]),u=i.x-g.vertexPoints[parseInt(c.toString(),10)].x,p=i.y-g.vertexPoints[parseInt(c.toString(),10)].y,g.vertexPoints[parseInt(c.toString(),10)].x+=u,g.vertexPoints[parseInt(c.toString(),10)].y+=p,2<g.vertexPoints.length)&&"Perimeter"!==t.measureType&&(0===parseFloat(e.split("_")[1])?(g.vertexPoints[g.vertexPoints.length-1].x+=u,g.vertexPoints[g.vertexPoints.length-1].y+=p):parseFloat(e.split("_")[1])===g.vertexPoints.length-1&&(g.vertexPoints[0].x+=u,g.vertexPoints[0].y+=p)),this.nodePropertyChange(g,{vertexPoints:g.vertexPoints}),this.renderSelector(g.pageIndex,s)),this.pdfViewer.renderDrawing(),!0},Rwt.prototype.dragSourceEnd=function(e,t,i,n){e=this.pdfViewer.nameTable[e.id];return e.vertexPoints[parseInt(n.toString(),10)].x+=t,e.vertexPoints[parseInt(n.toString(),10)].y+=i,this.pdfViewer.renderDrawing(),!0},Rwt.prototype.updateConnector=function(e,t){e.vertexPoints=t,dwt(e,t,e.wrapper.children[0]);var i=e.vertexPoints,n=e.wrapper.children[0];n.canMeasurePath=!0;for(var o=0;o<e.wrapper.children.length;o++)n=e.wrapper.children[parseInt(o.toString(),10)],"Polygon"!==e.shapeAnnotationType&&(-1<n.id.indexOf("srcDec")&&cwt(e,n,t[0],i[1],!0),e.targetPoint,-1<n.id.indexOf("tarDec"))&&cwt(e,n,t[t.length-1],i[i.length-2],!1)},Rwt.prototype.copy=function(){je(this.pdfViewer.annotationModule)||(t=this.pdfViewer.annotationModule.findAnnotationSettings(this.pdfViewer.selectedItems.annotations[0])),!(this.pdfViewer.formDesignerModule&&!this.pdfViewer.formDesigner.isPropertyDialogOpen||this.pdfViewer.annotationModule)||!this.pdfViewer.designerMode&&!this.pdfViewer.enableAnnotation||0===this.pdfViewer.selectedItems.formFields.length&&(0===this.pdfViewer.selectedItems.annotations.length||je(t)||t.isLock)||(this.pdfViewer.clipboardData.pasteIndex=1,this.pdfViewer.clipboardData.clipObject=this.copyObjects(),this.copiedElementID=this.pdfViewer.clipboardData.clipObject[0].id);var e,t=document.getElementById(this.pdfViewer.element.id+"_search_box");return t&&(e="none"!==t.style.display),(this.pdfViewer.formDesigner&&this.pdfViewer.formDesigner.isPropertyDialogOpen||e)&&(this.pdfViewer.clipboardData.clipObject={}),this.pdfViewer.clipboardData.clipObject},Rwt.prototype.copyObjects=function(){var e=[],t=[];if(this.pdfViewer.clipboardData.childTable={},0<this.pdfViewer.selectedItems.annotations.length)for(var e=this.pdfViewer.selectedItems.annotations,i=0;i<e.length;i++){var n=owt(e[parseInt(i.toString(),10)]);t.push(n)}if(0<this.pdfViewer.selectedItems.formFields.length){e=this.pdfViewer.selectedItems.formFields;for(i=0;i<e.length;i++){n=owt(e[parseInt(i.toString(),10)]);t.push(n)}}if(0===this.pdfViewer.clipboardData.pasteIndex)for(var o=0,r=e;o<r.length;o++){var s=r[o];this.pdfViewer.nameTable[s.id]&&(s.formFieldAnnotationType?(this.pdfViewer.clearSelection(s.pageIndex),this.pdfViewer.formDesignerModule.deleteFormField(s.id)):s.annotName?this.pdfViewer.annotationModule.deleteAnnotationById(s.annotName):this.pdfViewer.annotationModule.deleteAnnotation())}return this.sortByZIndex(t,"zIndex"),t},Rwt.prototype.getNewObject=function(e){var t,i=[];this.pdfViewer.clipboardData.pasteIndex=1;for(var n=0;n<e.length;n++)t=owt(e[parseInt(n.toString(),10)]),i.push(t);return i},Rwt.prototype.isWithinBounds=function(e,t){var i=t.clientX,t=t.clientY,n=e.left,o=e.right,r=e.top,e=e.bottom;return n<i&&i<o&&r<t&&t<e},Rwt.prototype.paste=function(e,t){var i=this.pdfViewer.viewerBase.getZoomFactor(),n=this.pdfViewer.allowServerDataBinding;if(this.pdfViewer.enableServerDataBinding(!1),this.isPasted=!0,e||this.pdfViewer.clipboardData.clipObject){var o=e?this.getNewObject(e):this.pdfViewer.clipboardData.clipObject;if(o)if(0!==this.pdfViewer.clipboardData.pasteIndex&&this.pdfViewer.clearSelection(t),!je(o[0])&&this.pdfViewer.currentPageNumber===o[0].pageIndex+1){for(var r=0,s=o;r<s.length;r++){var a,l=(p=s[r]).id,h=(p.id+=kvt(),this.splitFormFieldName(p));this.pdfViewer.formDesigner&&(this.pdfViewer.formDesigner.setFormFieldIndex(),a=this.pdfViewer.formDesigner.formFieldIndex,p.name=h+a),p.id,p}for(var d=0;d<o.length;d++){var p=o[parseInt(d.toString(),10)],c=this.pdfViewer.viewerBase.getElement("_pageDiv_"+p.pageIndex),u=event,g=c.getBoundingClientRect();!u||u.clientX||u.clientY||(u={clientX:this.pdfViewer.viewerBase.mouseLeft,clientY:this.pdfViewer.viewerBase.mouseTop}),N&&(u=this.pdfViewer.viewerBase.mouseDownEvent),$bt(p)?this.calculateCopyPosition(p,c,u):c&&(g.right-u.clientX<p.bounds.width*i?p.bounds.x=(c.clientWidth-p.bounds.width*i)/i:p.bounds.x=(u.clientX-g.left)/i,g.bottom-u.clientY>p.bounds.height*i?p.bounds.y=(u.clientY-g.top)/i:p.bounds.y=(c.clientHeight-p.bounds.height*i)/i),this.isWithinBounds(g,u)&&(c=owt(p),"Cut"!==this.pdfViewer.viewerBase.contextMenuModule.previousAction?(c.id+=kvt(),this.pdfViewer.annotationModule&&"HandWrittenSignature"!==c.shapeAnnotationType&&(c.annotName=c.id,this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateAnnotationCollection(c,o[0],!1))):this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateAnnotationCollection(c,o[0],!0),"SignatureText"!==c.shapeAnnotationType&&"HandWrittenSignature"!==c.shapeAnnotationType&&"SignatureImage"!==c.shapeAnnotationType||this.pdfViewer.viewerBase.signatureModule.storeSignatureData(c.pageIndex,c),c.formFieldAnnotationType||"SignatureText"===c.shapeAnnotationType||"HandWrittenSignature"===c.shapeAnnotationType||"SignatureImage"===c.shapeAnnotationType||this.pdfViewer.annotation.addAction(this.pdfViewer.viewerBase.getActivePage(!1),null,c,"Addition","",c,c),g=this.add(c),this.pdfViewer.formDesigner&&g.formFieldAnnotationType&&this.pdfViewer.annotation&&this.pdfViewer.annotation.addAction(this.pdfViewer.viewerBase.getActivePage(!0),null,g,"Addition","",g,g),("FreeText"===c.shapeAnnotationType||c.enableShapeLabel)&&g&&this.nodePropertyChange(g,{}),g.formFieldAnnotationType&&g.pageIndex===t&&(this.pdfViewer.formFieldCollection.push(g),u={id:g.id,name:g.name,value:g.value,type:g.formFieldAnnotationType,isReadOnly:g.isReadonly,fontFamily:g.fontFamily,fontSize:g.fontSize,fontStyle:g.fontStyle,color:g.color,backgroundColor:g.backgroundColor,alignment:g.alignment,visibility:g.visibility,maxLength:g.maxLength,isRequired:g.isRequired,isPrint:g.isPrint,isSelected:g.isSelected,isChecked:g.isChecked,tooltip:g.tooltip,bounds:g.bounds,thickness:g.thickness,borderColor:g.borderColor,signatureIndicatorSettings:g.signatureIndicatorSettings,insertSpaces:g.insertSpaces,isMultiline:g.isMultiline,isTransparent:g.isTransparent,options:g.options,pageIndex:g.pageIndex,pageNumber:g.pageNumber,rotateAngle:g.rotateAngle,signatureType:g.signatureType,zIndex:g.zIndex,selectedIndex:g.selectedIndex},g.options&&0<g.options.length&&(u.options=g.options),this.pdfViewer.formFieldCollections.push(u),this.pdfViewer.formDesigner.drawHTMLContent(g.formFieldAnnotationType,g.wrapper.children[0],g,g.pageIndex,this.pdfViewer,l)),this.pdfViewer.select([c.id],this.pdfViewer.annotationSelectorSettings),g.formFieldAnnotationType||this.pdfViewer.annotationModule.triggerAnnotationAddEvent(c))}}this.pdfViewer.renderDrawing(void 0,t),this.pdfViewer.clipboardData.pasteIndex++}this.pdfViewer.enableServerDataBinding(n,!0)},Rwt.prototype.splitFormFieldName=function(e){var t=null;if(e)switch(e.formFieldAnnotationType){case"Textbox":t="Textbox";break;case"PasswordField":t="Password";break;case"Checkbox":t="Check Box";break;case"RadioButton":t="Radio Button";break;case"DropdownList":t="Dropdown";break;case"ListBox":t="List Box";break;case"SignatureField":t="Signature";break;case"InitialField":t="Initial"}return t},Rwt.prototype.calculateCopyPosition=function(e,t,i){for(var n,o,r,s,a=this.pdfViewer.viewerBase.getZoomFactor(),l=0;l<e.vertexPoints.length;l++)t&&(0===l?(o=t.getBoundingClientRect(),r=e.vertexPoints[parseInt(l.toString(),10)].x,s=e.vertexPoints[parseInt(l.toString(),10)].y,e.vertexPoints[parseInt(l.toString(),10)].x=(i.clientX-o.left)/a,e.vertexPoints[parseInt(l.toString(),10)].y=(i.clientY-o.top)/a,o=e.vertexPoints[parseInt(l.toString(),10)].x,n=e.vertexPoints[parseInt(l.toString(),10)].y):(e.vertexPoints[parseInt(l.toString(),10)].x+=o-r,e.vertexPoints[parseInt(l.toString(),10)].y+=n-s))},Rwt.prototype.cut=function(e){var t,i=this.pdfViewer.allowServerDataBinding,e=(this.pdfViewer.enableServerDataBinding(!1),this.pdfViewer.annotationModule&&(this.pdfViewer.annotationModule.removedAnnotationCollection=[]),(this.pdfViewer.formDesignerModule&&!this.pdfViewer.formDesigner.isPropertyDialogOpen||0<this.pdfViewer.selectedItems.annotations.length)&&(this.pdfViewer.designerMode||0<this.pdfViewer.selectedItems.annotations.length)&&(0!==this.pdfViewer.selectedItems.formFields.length||0!==this.pdfViewer.selectedItems.annotations.length)&&(this.pdfViewer.clipboardData.pasteIndex=0,this.pdfViewer.clipboardData.clipObject=this.copyObjects(),this.pdfViewer.renderDrawing(void 0,e),this.pdfViewer.enableServerDataBinding(i,!0),this.copiedElementID=this.pdfViewer.clipboardData.clipObject[0].id),document.getElementById(this.pdfViewer.element.id+"_search_box"));e&&(t="none"!==e.style.display),(this.pdfViewer.formDesigner&&this.pdfViewer.formDesigner.isPropertyDialogOpen||t)&&(this.pdfViewer.clipboardData.clipObject={})},Rwt.prototype.sortByZIndex=function(e,t){var i=t||"zIndex";return e=e.sort(function(e,t){return e[""+i]-t[""+i]})};var Lwt=Rwt;function Rwt(e){this.isDynamicStamps=!1,this.copiedElementID="",this.isPasted=!1,this.pdfViewer=e,this.renderer=new Tbt("this.pdfViewer.element.id",!1),this.svgRenderer=new Dbt}Owt=function(e,t){return(Owt=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])}))(e,t)};var Owt,Gmt=function(e,t){function i(){this.constructor=e}Owt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},nft=(Nwt.prototype.startAction=function(e){this.currentElement=e,this.inAction=!0},Nwt.prototype.mouseDown=function(e){this.currentElement=e.source,this.startPosition=this.currentPosition=this.prevPosition=e.position,this.isTooltipVisible=!0,this.startAction(e.source)},Nwt.prototype.mouseMove=function(e){return this.currentPosition=e.position,this.prevPageId=this.pdfViewerBase.activeElements.activePageID,!this.blocked},Nwt.prototype.mouseUp=function(e){this.currentPosition=e.position,this.isTooltipVisible=!1,this.endAction(),this.helper=null},Nwt.prototype.endAction=function(){this.commandHandler&&(this.commandHandler.tool="",this.helper)&&this.commandHandler.remove(this.helper),this.commandHandler=null,this.currentElement=null,this.currentPosition=null,this.inAction=!1,this.blocked=!1},Nwt.prototype.mouseWheel=function(e){this.currentPosition=e.position},Nwt.prototype.mouseLeave=function(e){this.mouseUp(e)},Nwt.prototype.updateSize=function(e,t,i,n,o,r,s){var a,l=this.commandHandler.viewerBase.getZoomFactor(),h=this.currentPosition.x/l-this.startPosition.x/l,d=this.currentPosition.y/l-this.startPosition.y/l,l=e instanceof Xvt?r:e.rotateAngle,p=uvt(),c=(mvt(p,-l,0,0),0),u=0,g=(e instanceof Xvt?e.actualSize:e.wrapper.bounds).width,m=(e instanceof Xvt?e.actualSize:e.wrapper.bounds).height,r=e,l=(e.formFieldAnnotationType||e.annotName||e.shapeAnnotationType||e&&(r=e.annotations[0]),this.commandHandler.annotationModule?this.commandHandler.annotationModule.findAnnotationSettings(r):{}),f=0,y=0,e=0,r=0,v=((l.minWidth||l.maxWidth||l.minHeight||l.maxHeight)&&(f=l.maxHeight||2e3,y=l.maxWidth||2e3,e=l.minHeight||0,r=l.minWidth||0),!1);switch((v=e||r||f||y?!0:v)&&s&&(s=g+(l=this.getPositions(n,h,d)).x,(l=m+l.y)<e?d=e-m:f<l&&(d=f-m),s<r?h=r-g:y<s&&(h=y-g)),n){case"ResizeWest":h=(a=gvt(p,{x:h,y:d})).x,d=a.y,u=1,d=0,v&&o.width-h>y&&(h=y-o.width),c=(o.width-h)/g;break;case"ResizeEast":h=(a=gvt(p,{x:h,y:d})).x,d=a.y,d=0,v&&o.width+h>y&&(h=y-o.width),c=(o.width+h)/g,u=1;break;case"ResizeNorth":c=1,h=(a=gvt(p,{x:h,y:d})).x,d=a.y,v&&o.height-d>f&&(d=f-o.height),u=(o.height-d)/m;break;case"ResizeSouth":c=1,h=(a=gvt(p,{x:h,y:d})).x,d=a.y,v&&o.height+d>f&&(d=f-o.height),u=(o.height+d)/m;break;case"ResizeNorthEast":h=(a=gvt(p,{x:h,y:d})).x,d=a.y,v&&(o.width+h>y&&(h=y-o.width),o.height-d>f)&&(d=f-o.height),c=(o.width+h)/g,u=(o.height-d)/m;break;case"ResizeNorthWest":h=(a=gvt(p,{x:h,y:d})).x,d=a.y,v&&(o.width-h>y&&(h=y-o.width),o.height-d>f)&&(d=f-o.height),c=(o.width-h)/g,u=(o.height-d)/m;break;case"ResizeSouthEast":h=(a=gvt(p,{x:h,y:d})).x,d=a.y,v&&(o.width+h>y&&(h=y-o.width),o.height+d>f)&&(d=f-o.height),u=(o.height+d)/m,c=(o.width+h)/g;break;case"ResizeSouthWest":h=(a=gvt(p,{x:h,y:d})).x,d=a.y,v&&(o.width-h>y&&(h=y-o.width),o.height+d>f)&&(d=f-o.height),c=(o.width-h)/g,u=(o.height+d)/m}return{width:c,height:u}},Nwt.prototype.getPivot=function(e){switch(e){case"ResizeWest":return{x:1,y:.5};case"ResizeEast":return{x:0,y:.5};case"ResizeNorth":return{x:.5,y:1};case"ResizeSouth":return{x:.5,y:0};case"ResizeNorthEast":return{x:0,y:1};case"ResizeNorthWest":return{x:1,y:1};case"ResizeSouthEast":return{x:0,y:0};case"ResizeSouthWest":return{x:1,y:0}}return{x:.5,y:.5}},Nwt.prototype.getPositions=function(e,t,i){switch(e){case"ResizeEast":return{x:t,y:0};case"ResizeSouthEast":return{x:t,y:i};case"ResizeSouth":return{x:0,y:i};case"ResizeNorth":return{x:0,y:-i};case"ResizeNorthEast":return{x:t,y:-i};case"ResizeNorthWest":return{x:-t,y:-i};case"ResizeWest":return{x:-t,y:0};case"ResizeSouthWest":return{x:-t,y:i}}return{x:t,y:i}},Nwt);function Nwt(e,t,i){this.commandHandler=null,this.inAction=!1,this.pdfViewerBase=null,this.currentElement=null,this.blocked=!1,this.isTooltipVisible=!1,this.childTable={},this.helper=void 0,this.undoElement={annotations:[]},this.undoParentElement={annotations:[]},this.commandHandler=e,this.pdfViewerBase=t}Gmt(Hwt,Vwt=nft),Hwt.prototype.mouseDown=function(e){this.inAction=!0,this.mouseEventHelper(e),Vwt.prototype.mouseDown.call(this,e)},Hwt.prototype.mouseEventHelper=function(e){this.commandHandler&&this.commandHandler.annotationModule&&(this.commandHandler.annotationModule.overlappedCollections=gCt(e,this.pdfViewerBase,this.commandHandler,!0));var t=gCt(e,this.pdfViewerBase,this.commandHandler),i=!1;if(!(i=t&&"StickyNotes"===t.shapeAnnotationType&&t.annotationSettings&&t.annotationSettings.isLock?!this.commandHandler.annotationModule.checkAllowedInteractions("Select",t):i)){i=void 0,i=e.source&&null!==e.annotationSelectorSettings?e.source.annotationSelectorSettings:"";if(this.commandHandler){var n=this.commandHandler.selectedItems;if(n){var o=n.annotations[0],r=n.formFields[0],s=this.commandHandler.selectedItems.annotations[0],a=e.source;if((n.annotations.length&&e.info&&!e.info.ctrlKey&&this.commandHandler.annotationModule&&!1===this.commandHandler.annotationModule.freeTextAnnotationModule.isInuptBoxInFocus||e.info&&e.info.ctrlKey&&(a&&"FreeText"===a.shapeAnnotationType||s&&"FreeText"===s.shapeAnnotationType)||je(t)&&this.commandHandler.annotationModule&&!je(this.commandHandler.annotation.textMarkupAnnotationModule)&&je(this.commandHandler.annotation.textMarkupAnnotationModule.currentTextMarkupAnnotation)&&this.commandHandler.formDesignerModule&&!(a&&"FreeText"===a.shapeAnnotationType||s&&("FreeText"===s.shapeAnnotationType||"Image"===s.shapeAnnotationType||"StickyNotes"===s.shapeAnnotationType)))&&this.commandHandler.clearSelection(this.pdfViewerBase.activeElements.activePageID),t&&(!(je(r)||r&&r.id!==t.id)||je(this.pdfViewerBase.isFreeTextSelected)||this.pdfViewerBase.isFreeTextSelected||(this.commandHandler.select([t.id],i),this.commandHandler.viewerBase.isAnnotationMouseDown=!0),this.pdfViewerBase.isFreeTextSelected=!1,this.commandHandler.viewerBase.isFormFieldMouseDown=!0),0===n.annotations.length&&o&&"HandWrittenSignature"!==o.shapeAnnotationType&&"SignatureText"!==o.shapeAnnotationType&&"SignatureImage"!==o.shapeAnnotationType&&"Path"!==o.shapeAnnotationType&&!o.formFieldAnnotationType&&(this.commandHandler.enableToolbar&&F.isDevice&&!this.commandHandler.enableDesktopMode&&this.commandHandler.toolbarModule.showToolbar(!0),this.commandHandler.fireAnnotationUnSelect(o.annotName,o.pageIndex,o)),0===n.annotations.length&&o&&("HandWrittenSignature"===o.shapeAnnotationType||"SignatureText"===o.shapeAnnotationType||"SignatureImage"===o.shapeAnnotationType||"Path"===o.shapeAnnotationType||o.signatureType)&&this.commandHandler.fireSignatureUnselect(o.signatureName,o.pageIndex,o),0===n.formFields.length&&this.commandHandler.formDesignerModule&&r&&r.formFieldAnnotationType){var l={name:r.name,id:r.id,value:r.value,fontFamily:r.fontFamily,fontSize:r.fontSize,fontStyle:r.fontStyle,color:r.color,backgroundColor:r.backgroundColor,alignment:r.alignment,isReadonly:r.isReadOnly,visibility:r.visibility,maxLength:r.maxLength,isRequired:r.isRequired,isPrint:r.isPrint,rotation:r.rotation,tooltip:r.tooltip,options:r.options,isChecked:r.isChecked,isSelected:r.isSelected};this.commandHandler.fireFormFieldUnselectEvent("formFieldUnselect",l,r.pageIndex)}else if(this.pdfViewerBase.currentTarget&&this.pdfViewerBase.currentTarget.id&&this.commandHandler.formFields&&"mousedown"===event.type)for(var h=0;h<this.commandHandler.formFields.length;h++){var d=this.commandHandler.formFields[parseInt(h.toString(),10)];this.pdfViewerBase.currentTarget&&this.pdfViewerBase.currentTarget.id===d.id&&(l={value:d.value,fontFamily:d.fontFamily,fontSize:d.fontSize,fontStyle:d.fontStyle,color:d.color,backgroundColor:d.backgroundColor,alignment:d.alignment,isReadonly:d.isReadonly,visibility:d.visibility,maxLength:d.maxLength,isRequired:d.isRequired,isPrint:d.isPrint,rotation:d.rotateAngle,tooltip:d.tooltip,options:d.options,isChecked:d.isChecked,isSelected:d.isSelected,id:d.id,name:d.name},!t||this.pdfViewerBase.currentTarget.id!==event.target.id&&"e-pv-text-layer"!==event.target.className)&&(this.commandHandler.fireFocusOutFormField(l,d.pageIndex),this.pdfViewerBase.currentTarget=null)}}}}},Hwt.prototype.mouseMove=function(e){return Vwt.prototype.mouseMove.call(this,e),!this.blocked},Hwt.prototype.mouseUp=function(e){this.mouseEventHelper(e),this.inAction=!1,Vwt.prototype.mouseUp.call(this,e)},Hwt.prototype.mouseLeave=function(e){this.inAction&&this.mouseUp(e)};var Vwt,_wt=Hwt;function Hwt(e,t){return Vwt.call(this,e,t,!0)||this}Gmt(Wwt,zwt=nft),Wwt.prototype.mouseDown=function(e){zwt.prototype.mouseDown.call(this,e),this.offset={x:e.source.wrapper.offsetX,y:e.source.wrapper.offsetY},this.startPosition=e.position;e=owt(e.source);this.redoElement={bounds:{x:e.wrapper.offsetX,y:e.wrapper.offsetY,width:e.wrapper.actualSize.width,height:e.wrapper.actualSize.height}},$bt(e)&&(this.redoElement.vertexPoints=e.vertexPoints,this.redoElement.leaderHeight=e.leaderHeight),this.inAction=!0},Wwt.prototype.mouseUp=function(e){this.commandHandler&&e.source&&(this.checkisAnnotationMove(e),t=!1,i=e.source.annotationSelectorSettings,this.commandHandler.clearSelection(this.pdfViewerBase.activeElements.activePageID),this.commandHandler.select([e.source.id],i),this.pdfViewerBase.activeElements.activePageID===e.source.pageIndex&&"Drag"===this.pdfViewerBase.action&&this.commandHandler.dragSelectedObjects(this.calculateMouseActionXDiff(e),this.calculateMouseActionYDiff(e),this.pdfViewerBase.activeElements.activePageID,i,null),!e.source||"Textbox"!==e.source.formFieldAnnotationType&&"Checkbox"!==e.source.formFieldAnnotationType&&"RadioButton"!==e.source.formFieldAnnotationType&&"ListBox"!==e.source.formFieldAnnotationType&&"SignatureField"!==e.source.formFieldAnnotationType&&"InitialField"!==e.source.formFieldAnnotationType&&"DropdownList"!==e.source.formFieldAnnotationType&&"PasswordField"!==e.source.formFieldAnnotationType||this.commandHandler.formDesignerModule.updateHTMLElement(e.source),this.commandHandler.renderSelector(this.pdfViewerBase.activeElements.activePageID,i),this.commandHandler.viewerBase.isAnnotationMouseMove=!1,this.commandHandler.viewerBase.isFormFieldMouseMove=!1,i={bounds:{x:e.source.wrapper.offsetX,y:e.source.wrapper.offsetY,width:e.source.wrapper.actualSize.width,height:e.source.wrapper.actualSize.height},modifiedDate:e.source.modifiedDate},$bt(e.source)&&(i.vertexPoints=e.source.vertexPoints,i.leaderHeight=e.source.leaderHeight),e.target&&e.target.formFieldAnnotationType&&(s={value:(n=e.target).value,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,color:n.color,backgroundColor:n.backgroundColor,borderColor:n.borderColor,thickness:n.thickness,alignment:n.alignment,isReadonly:n.isReadonly,visibility:n.visibility,maxLength:n.maxLength,isRequired:n.isRequired,isPrint:n.isPrint,rotation:n.rotateAngle,tooltip:n.tooltip,options:n.options,isChecked:n.isChecked,isSelected:n.isSelected},o={X:e.source.wrapper.offsetX,Y:e.source.wrapper.offsetY,Width:e.source.wrapper.actualSize.width,Height:e.source.wrapper.actualSize.height},r={X:this.offset.x,Y:this.offset.y,Width:e.source.wrapper.actualSize.width,Height:e.source.wrapper.actualSize.height},this.commandHandler.fireFormFieldMoveEvent("formFieldMove",s,n.pageIndex,r,o)),je(this.redoElement)||this.redoElement.bounds.height===i.bounds.height&&this.redoElement.bounds.width===i.bounds.width&&this.redoElement.bounds.x===i.bounds.x&&this.redoElement.bounds.y===i.bounds.y||(t=!0),this.commandHandler.annotation)&&t&&(this.commandHandler.annotation.addAction(this.pageIndex,null,e.source,"Drag","",this.redoElement,i),this.commandHandler.annotation.stampAnnotationModule.updateSessionStorage(e.source,null,"Drag"),this.commandHandler.annotation.stickyNotesAnnotationModule.updateStickyNotes(e.source,null));var t,i,n,o,r,s=this.commandHandler&&this.commandHandler.selectedItems&&this.commandHandler.selectedItems.annotations&&0<this.commandHandler.selectedItems.annotations.length?this.commandHandler.selectedItems.annotations[0].shapeAnnotationType:null;s&&"Image"!==s&&"SignatureImage"!==s?zwt.prototype.mouseUp.call(this,e):"Image"===s||"SignatureImage"===s?this.inAction=!1:this.commandHandler&&this.commandHandler.selectedItems&&this.commandHandler.selectedItems.formFields&&0<this.commandHandler.selectedItems.formFields.length&&zwt.prototype.mouseUp.call(this,e)},Wwt.prototype.calculateMouseXDiff=function(){return this.currentPosition&&this.startPosition?this.currentPosition.x-this.startPosition.x:0},Wwt.prototype.calculateMouseYDiff=function(){return this.currentPosition&&this.startPosition?this.currentPosition.y-this.startPosition.y:0},Wwt.prototype.calculateMouseActionXDiff=function(e){var t=this.calculateMouseXDiff()/this.commandHandler.viewerBase.getZoomFactor();return this.offset?this.offset.x+t-e.source.wrapper.offsetX:0},Wwt.prototype.calculateMouseActionYDiff=function(e){var t=this.calculateMouseYDiff()/this.commandHandler.viewerBase.getZoomFactor();return this.offset?this.offset.y+t-e.source.wrapper.offsetY:0},Wwt.prototype.mouseMove=function(e,t,i){var n,o,r,s,a,l,h,d;return zwt.prototype.mouseMove.call(this,e),this.inAction&&(this.currentPosition=e.position,this.currentTarget=e.target,n=e.source.annotationSelectorSettings,d=this.calculateMouseXDiff()/this.commandHandler.viewerBase.getZoomFactor(),o=this.calculateMouseYDiff()/this.commandHandler.viewerBase.getZoomFactor(),d=this.offset.x+d,o=this.offset.y+o,r=this.calculateMouseActionXDiff(e),s=this.calculateMouseActionYDiff(e),a=this.commandHandler.selectedItems.annotations[0],l=void 0,this.helper?(r=d-this.helper.wrapper.offsetX,s=o-this.helper.wrapper.offsetY):((l=0<this.commandHandler.selectedItems.annotations.length?owt(this.commandHandler.selectedItems.annotations[0]):owt(this.commandHandler.selectedItems.formFields[0])).wrapper&&(r=d-l.wrapper.offsetX,s=o-l.wrapper.offsetY,l.bounds=(0<this.commandHandler.selectedItems.annotations.length?this.commandHandler.selectedItems.annotations:this.commandHandler.selectedItems.formFields)[0].wrapper.bounds),l.wrapper=void 0,l.id="diagram_helper","Stamp"===l.shapeAnnotationType?(l.strokeColor="",l.borderDashArray="",l.fillColor="transparent",l.stampFillColor="transparent",l.data=""):"FreeText"===l.shapeAnnotationType?(l.strokeColor="blue",l.fillColor="transparent",l.thickness=1,l.opacity=1,l.dynamicText=""):"SignatureText"===l.shapeAnnotationType?(l.strokeColor="red",l.borderDashArray="5,5",l.fillColor="transparent",l.thickness=2,l.opacity=1,l.data=""):(l.strokeColor="red",l.borderDashArray="5,5",l.fillColor="transparent",l.thickness=2,l.opacity=1),!0===l.enableShapeLabel&&(l.labelContent=""),h=l.shapeAnnotationType,t||"Image"===h||"SignatureImage"===h?l=this.helper=e.source:this.helper=l=this.commandHandler.add(l),0<this.commandHandler.selectedItems.annotations.length?this.commandHandler.selectedItems.annotations=[l]:this.commandHandler.selectedItems.formFields=[l]),this.helper&&"Stamp"===this.helper.shapeAnnotationType&&(t=!0),this.commandHandler.checkBoundaryConstraints(r,s,this.pdfViewerBase.activeElements.activePageID,this.helper.wrapper.bounds,t,i)?(h=this.helper.shapeAnnotationType,!this.helper||"Image"!==h&&"SignatureImage"!==h?this.commandHandler.dragSelectedObjects(r,s,this.pdfViewerBase.activeElements.activePageID,n,this.helper):(this.checkisAnnotationMove(e),d=e.source.annotationSelectorSettings,this.commandHandler.clearSelection(this.pdfViewerBase.activeElements.activePageID),this.commandHandler.select([e.source.id],d),this.commandHandler.dragSelectedObjects(r,s,this.pdfViewerBase.activeElements.activePageID,d,this.helper),this.commandHandler.renderSelector(this.pdfViewerBase.activeElements.activePageID,d)),this.prevNode=this.helper,this.prevPosition=this.currentPosition):this.currentPosition=this.prevPosition,a)&&a.annotName&&this.commandHandler.annotation.triggerAnnotationMove(a,!0),!0},Wwt.prototype.mouseLeave=function(e){var t=e.source.annotationSelectorSettings,i=this.offset.x+this.calculateMouseXDiff(),n=this.offset.y+this.calculateMouseYDiff(),i=i-e.source.wrapper.offsetX,n=n-e.source.wrapper.offsetY;this.commandHandler.dragSelectedObjects(i,n,this.prevPageId,t,null),this.commandHandler.renderSelector(this.prevPageId,t),zwt.prototype.mouseLeave.call(this,e)},Wwt.prototype.endAction=function(){zwt.prototype.endAction.call(this),this.currentTarget=null,this.prevPosition=null},Wwt.prototype.checkisAnnotationMove=function(e){this.commandHandler.selectedItems&&this.commandHandler.selectedItems.annotations&&0<this.commandHandler.selectedItems.annotations.length?this.commandHandler.selectedItems.annotations[0].annotName===e.source.annotName&&(this.commandHandler.viewerBase.isAnnotationMouseMove=!0):this.commandHandler.viewerBase.isAnnotationMouseMove=!1,this.commandHandler.selectedItems&&this.commandHandler.selectedItems.formFields&&0<this.commandHandler.selectedItems.formFields.length?this.commandHandler.selectedItems.formFields[0].name===e.source.name&&(this.commandHandler.viewerBase.isFormFieldMouseMove=!0):this.commandHandler.viewerBase.isFormFieldMouseMove=!1};var zwt,jwt=Wwt;function Wwt(e,t){e=zwt.call(this,e,t)||this;return e.currentTarget=null,e.prevNode=null,e}Gmt(qwt,Qwt=jwt),qwt.prototype.mouseDown=function(e){Qwt.prototype.mouseUp.call(this,e)},qwt.prototype.mouseMove=function(e){this.inAction||(n=this.pdfViewerBase.activeElements.activePageID,this.commandHandler.clearSelection(this.pdfViewerBase.activeElements.activePageID),"SignatureText"===(n=this.commandHandler.annotation.stampAnnotationModule.moveStampElement(e.position.x,e.position.y,n)).shapeAnnotationType&&(i=1,(t=this.getTextWidth(n.data,n.fontSize,n.fontFamily))>n.bounds.width&&(i=n.bounds.width/t),n.fontSize=this.getFontSize(Math.floor(n.fontSize*i)),n.bounds.height=n.fontSize<32?2*n.fontSize:n.bounds.height,n.thickness=0),t=this.commandHandler.add(n),e.source=this.commandHandler.annotations[this.commandHandler.annotations.length-1],e.sourceWrapper=e.source.wrapper,this.inAction=!0,!(i=e.source)||"HandWrittenSignature"!==i.shapeAnnotationType&&"SignatureText"!==i.shapeAnnotationType&&"SignatureImage"!==i.shapeAnnotationType?this.offset={x:e.source.wrapper.offsetX,y:e.source.wrapper.offsetY}:this.offset={x:e.source.wrapper.offsetX-e.source.wrapper.bounds.width/2,y:e.source.wrapper.offsetY-e.source.wrapper.bounds.height/2},this.startPosition=e.position,this.commandHandler.select([t.id]));var t,i,n=e.source.annotationSelectorSettings;return Qwt.prototype.mouseMove.call(this,e,!0,!0),this.commandHandler.renderSelector(e.source.pageIndex,n),this.inAction},qwt.prototype.getTextWidth=function(e,t,i){var n,o=document.createElement("canvas"),r=o.getContext("2d"),t=(r.font=(n=t?t+"px "+i:n)||getComputedStyle(document.body).font,r.measureText(e).width);return this.pdfViewerBase.releaseCanvas(o),t},qwt.prototype.getFontSize=function(e){return e%2==0?e:--e};var Qwt,Uwt=qwt;function qwt(){return null!==Qwt&&Qwt.apply(this,arguments)||this}Gmt(Xwt,Gwt=nft),Xwt.prototype.mouseDown=function(e){this.pdfViewerBase.disableTextSelectionMode(),Gwt.prototype.mouseDown.call(this,e),this.inAction=!0;e={currentPosition:this.currentPosition,prevPosition:this.prevPosition};this.commandHandler.annotation.inkAnnotationModule.drawInkInCanvas(e,this.pdfViewerBase.activeElements.activePageID)},Xwt.prototype.mouseMove=function(e){return Gwt.prototype.mouseMove.call(this,e),this.inAction&&(e={currentPosition:this.currentPosition,prevPosition:this.pdfViewerBase.prevPosition},this.commandHandler.annotation.inkAnnotationModule.drawInkInCanvas(e,this.pdfViewerBase.activeElements.activePageID)),this.inAction},Xwt.prototype.mouseUp=function(e){return this.commandHandler.annotation.inkAnnotationModule.storePathData(),!0},Xwt.prototype.mouseLeave=function(e){},Xwt.prototype.endAction=function(){Gwt.prototype.endAction.call(this)};var Gwt,Ywt=Xwt;function Xwt(e,t,i){e=Gwt.call(this,e,t)||this;return e.sourceObject=i,e}Gmt(Zwt,Kwt=nft),Zwt.prototype.mouseDown=function(e){this.inAction=!0,this.undoElement=void 0,Kwt.prototype.mouseDown.call(this,e),e.source&&e.source.annotations&&(this.prevPosition.x,this.prevPosition.y,e.source.annotations[0]),this.initialPosition=e.position,this.prevSource=this.commandHandler.selectedItems.annotations[0];var t=owt(e.source);this.redoElement={bounds:{x:t.wrapper.offsetX,y:t.wrapper.offsetY,width:t.wrapper.actualSize.width,height:t.wrapper.actualSize.height}},$bt(t)&&(this.redoElement.vertexPoints=t.vertexPoints,this.redoElement.leaderHeight=t.leaderHeight,"Distance"!==t.measureType&&"Perimeter"!==t.measureType&&"Area"!==t.measureType&&"Volume"!==t.measureType||(this.redoElement.notes=t.notes)),this.currentPosition=e.position},Zwt.prototype.mouseUp=function(e){var t,i,n,o,r,s,a,l;this.commandHandler&&(i=!1,t=this.commandHandler.selectedItems.annotations[0])&&(r=o=n=l=0,((s=this.commandHandler.annotationModule.findAnnotationSettings(t)).minWidth||s.maxWidth||s.minHeight||s.maxHeight)&&(l=s.maxHeight||2e3,n=s.maxWidth||2e3,o=s.minHeight||0,r=s.minWidth||0),3<t.vertexPoints.length?(a=(s=this.commandHandler.viewerBase.checkAnnotationWidth(t.vertexPoints)).width,s=s.height,(!(o||r||l||n)||o<s&&s<l||r<a&&a<n)&&this.commandHandler.nodePropertyChange(this.prevSource,{vertexPoints:t.vertexPoints,leaderHeight:t.leaderHeight})):(!(o||r||l||n)||"Line"!==t.shapeAnnotationType&&"Distance"!==t.shapeAnnotationType&&"LineWidthArrowHead"!==t.shapeAnnotationType||(s=t.vertexPoints[a=s=0].x>t.vertexPoints[1].x?t.vertexPoints[0].x-t.vertexPoints[1].x:t.vertexPoints[1].x-t.vertexPoints[0].x,(s=(a=t.vertexPoints[0].y>t.vertexPoints[1].y?t.vertexPoints[0].y-t.vertexPoints[1].y:t.vertexPoints[1].y-t.vertexPoints[0].y)<s?s:a)<(l||n)&&(o||r)<s))&&this.commandHandler.nodePropertyChange(this.prevSource,{vertexPoints:t.vertexPoints,leaderHeight:t.leaderHeight}),a=e.source.annotationSelectorSettings,this.commandHandler.clearSelection(this.pdfViewerBase.activeElements.activePageID),this.commandHandler.select([this.prevSource.id],a),this.commandHandler.renderSelector(this.pdfViewerBase.activeElements.activePageID,a),l={bounds:{x:e.source.wrapper.offsetX,y:e.source.wrapper.offsetY,width:e.source.wrapper.actualSize.width,height:e.source.wrapper.actualSize.height}},"Distance"!==t.measureType&&"Perimeter"!==t.measureType&&"Area"!==t.measureType&&"Volume"!==t.measureType||(this.commandHandler.annotation.updateCalibrateValues(this.commandHandler.selectedItems.annotations[0]),l.notes=e.source.notes),$bt(e.source)&&(l.vertexPoints=e.source.vertexPoints,l.leaderHeight=e.source.leaderHeight),i=this.redoElement.bounds.height!==l.bounds.height||this.redoElement.bounds.width!==l.bounds.width||this.redoElement.bounds.x!==l.bounds.x||this.redoElement.bounds.y!==l.bounds.y||i)&&this.commandHandler.annotation.addAction(this.pageIndex,null,this.prevSource,"Resize","",this.redoElement,l),Kwt.prototype.mouseUp.call(this,e)},Zwt.prototype.mouseMove=function(e){var t,i;return Kwt.prototype.mouseMove.call(this,e),this.currentPosition=e.position,this.currentPosition&&this.prevPosition&&(t=this.currentPosition.x-this.prevPosition.x,i=this.currentPosition.y-this.prevPosition.y,0,e.source&&e.source.annotations&&(this.currentPosition.x,this.currentPosition.y,this.prevPosition.x,this.prevPosition.y,e.source.annotations[0]),this.inAction&&void 0!==this.endPoint&&0!=t||0!=i)&&(this.helper||((t=owt(this.commandHandler.selectedItems.annotations[0])).id="diagram_helper",t.strokeColor="red",t.borderDashArray="5,5",t.fillColor="transparent",t.thickness=2,t.opacity=1,!0===t.enableShapeLabel&&(t.labelContent=""),this.helper=t=this.commandHandler.add(t),this.commandHandler.selectedItems.annotations=[t]),i=e.source.annotationSelectorSettings,this.blocked=!this.commandHandler.dragConnectorEnds(this.endPoint,this.helper,this.currentPosition,this.selectedSegment,e.target,null,i),this.commandHandler.renderSelector(this.pdfViewerBase.activeElements.activePageID,i)),this.prevPosition=this.currentPosition,!this.blocked},Zwt.prototype.mouseLeave=function(e){this.mouseUp(e)},Zwt.prototype.endAction=function(){Kwt.prototype.endAction.call(this),this.prevPosition=null,this.endPoint=null};var Kwt,Jwt=Zwt;function Zwt(e,t,i){e=Kwt.call(this,e,t,!0)||this;return e.endPoint=i,e}Gmt(tCt,$wt=nft),tCt.prototype.mouseDown=function(e){$wt.prototype.mouseDown.call(this,e),this.initialBounds.x=e.source.wrapper.offsetX,this.initialBounds.y=e.source.wrapper.offsetY,this.initialBounds.height=e.source.wrapper.actualSize.height,this.initialBounds.width=e.source.wrapper.actualSize.width,this.initialPosition=e.position;e=owt(e.source);this.redoElement={bounds:{x:e.wrapper.offsetX,y:e.wrapper.offsetY,width:e.wrapper.actualSize.width,height:e.wrapper.actualSize.height}},$bt(e)&&(this.redoElement.vertexPoints=e.vertexPoints,this.redoElement.leaderHeight=e.leaderHeight),"Radius"===e.measureType&&(this.redoElement.notes=e.notes),this.prevSource=(0<this.commandHandler.selectedItems.annotations.length?this.commandHandler.selectedItems.annotations:this.commandHandler.selectedItems.formFields)[0]},tCt.prototype.mouseUp=function(e,t){e.source;var i,n,o=owt(e.source),r=!1;return this.commandHandler&&this.prevSource&&(this.commandHandler.clearSelection(this.pdfViewerBase.activeElements.activePageID),this.commandHandler.viewerBase.isAnnotationSelect=!0,this.commandHandler.viewerBase.isFormFieldSelect=!0,this.commandHandler.select([this.prevSource.id],this.prevSource.annotationSelectorSettings),i=this.updateSize(this.prevSource,this.currentPosition,this.initialPosition,this.corner,this.initialBounds,null,!0),this.blocked=this.scaleObjects(i.width,i.height,this.corner,this.currentPosition,this.initialPosition,this.prevSource,e.info.ctrlKey),this.commandHandler.selectedItems&&this.commandHandler.selectedItems.annotations&&this.commandHandler.selectedItems.annotations[0]&&"Stamp"===this.commandHandler.selectedItems.annotations[0].shapeAnnotationType&&(this.commandHandler.stampSettings.minHeight||this.commandHandler.stampSettings.minWidth)&&this.commandHandler.select([this.prevSource.id],this.prevSource.annotationSelectorSettings),0<this.commandHandler.selectedItems.formFields.length&&("Textbox"===this.commandHandler.selectedItems.formFields[0].formFieldAnnotationType||"Checkbox"===this.commandHandler.selectedItems.formFields[0].formFieldAnnotationType||"RadioButton"===this.commandHandler.selectedItems.formFields[0].formFieldAnnotationType||"InitialField"===this.commandHandler.selectedItems.formFields[0].formFieldAnnotationType||"SignatureField"===this.commandHandler.selectedItems.formFields[0].formFieldAnnotationType||"DropdownList"===this.commandHandler.selectedItems.formFields[0].formFieldAnnotationType||"ListBox"===this.commandHandler.selectedItems.formFields[0].formFieldAnnotationType||"PasswordField"===this.commandHandler.selectedItems.formFields[0].formFieldAnnotationType)&&("SignatureField"===this.commandHandler.selectedItems.formFields[0].formFieldAnnotationType&&(this.commandHandler.selectedItems.formFields[0].signatureIndicatorSettings=this.commandHandler.selectedItems.formFields[0].signatureIndicatorSettings||{opacity:1,backgroundColor:"rgba(255, 228, 133, 0.35)",width:19,height:10,fontSize:10,text:null,color:"black"}),this.commandHandler.formDesignerModule.updateHTMLElement(this.commandHandler.selectedItems.formFields[0])),this.commandHandler.renderSelector(this.prevPageId,this.prevSource.annotationSelectorSettings),this.commandHandler.annotation&&e.source.wrapper&&(i={bounds:{x:e.source.wrapper.offsetX,y:e.source.wrapper.offsetY,width:e.source.wrapper.actualSize.width,height:e.source.wrapper.actualSize.height}},$bt(e.source)&&(i.vertexPoints=e.source.vertexPoints,i.leaderHeight=e.source.leaderHeight),this.redoElement.bounds.height===i.bounds.height&&this.redoElement.bounds.width===i.bounds.width&&this.redoElement.bounds.x===i.bounds.x&&this.redoElement.bounds.y===i.bounds.y||(r=!0),"Radius"===this.prevSource.measureType&&r&&(i.notes=e.source.notes,this.commandHandler.annotation.updateCalibrateValues(this.prevSource)),"SignatureText"===this.prevSource.shapeAnnotationType&&(o=(o.bounds&&o.bounds.width?o.bounds:o).width,o=i.bounds.width/o,i.fontSize=this.prevSource.wrapper.children[1].style.fontSize*o,null!=e.target)&&(e.target.fontSize=i.fontSize,e.target.wrapper.children[1].style.fontSize=i.fontSize,e.target.wrapper.children[1].horizontalAlignment="Center",e.target.wrapper.children[1].verticalAlignment="Center",e.target.wrapper.children[1].setOffsetWithRespectToBounds(0,0,"Absolute"),this.commandHandler.selectedItems.annotations[0].wrapper.children[1].style.fontSize=i.fontSize,this.commandHandler.selectedItems.annotations[0].wrapper.children[1].horizontalAlignment="Center",this.commandHandler.selectedItems.annotations[0].wrapper.children[1].verticalAlignment="Center",this.commandHandler.selectedItems.annotations[0].wrapper.children[1].setOffsetWithRespectToBounds(0,0,"Absolute"),this.commandHandler.selectedItems.annotations[0].fontSize=i.fontSize),"SignatureText"===this.prevSource.shapeAnnotationType&&this.commandHandler.selectedItems.annotations&&0<this.commandHandler.selectedItems.annotations.length&&this.commandHandler.nodePropertyChange(this.commandHandler.selectedItems.annotations[0],{fontSize:i.fontSize}),r)&&this.commandHandler.annotation.addAction(this.pageIndex,null,this.prevSource,"Resize","",this.redoElement,i),e.target&&e.target.formFieldAnnotationType&&(o=e.target,r={id:e.source.id,value:o.value,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,color:o.color,backgroundColor:o.backgroundColor,alignment:o.alignment,isReadonly:o.isReadonly,visibility:o.visibility,maxLength:o.maxLength,isRequired:o.isRequired,isPrint:o.isPrint,rotation:o.rotateAngle,tooltip:o.tooltip,options:o.options,isChecked:o.isChecked,isSelected:o.isSelected},i={X:e.source.wrapper.offsetX,Y:e.source.wrapper.offsetY,Width:e.source.wrapper.actualSize.width,Height:e.source.wrapper.actualSize.height},n={X:this.initialBounds.x,Y:this.initialBounds.y,Width:this.initialBounds.width,Height:this.initialBounds.height},this.commandHandler.fireFormFieldResizeEvent("formFieldResize",r,o.pageIndex,n,i)),this.commandHandler.annotation)&&this.commandHandler.annotation.stampAnnotationModule&&this.commandHandler.annotation.stampAnnotationModule.updateSessionStorage(e.source,this.prevSource.id,"Resize"),$wt.prototype.mouseUp.call(this,e),!this.blocked},tCt.prototype.mouseMove=function(e){$wt.prototype.mouseMove.call(this,e);var t=e.source,i=(this.currentPosition=e.position,this.currentPosition.x-this.startPosition.x),n=this.currentPosition.y-this.startPosition.y,o=(i/=this.commandHandler.viewerBase.getZoomFactor(),n/=this.commandHandler.viewerBase.getZoomFactor(),e.source),r=this.getPoints(i,n),s=o.width+r.x,r=o.height+r.y,a=t,t=(t&&t.annotations&&(a=t.annotations[0]),this.commandHandler.annotationModule?this.commandHandler.annotationModule.findAnnotationSettings(a):{}),a=0,l=0,h=0,d=0,t=((t.minWidth||t.maxWidth||t.minHeight||t.maxHeight)&&(a=t.maxHeight||2e3,l=t.maxWidth||2e3,h=t.minHeight||0,d=t.minWidth||0),(h||d||a||l)&&(r<h?n=h-o.height:a<r&&(n=a-o.height),s<d?i=d-o.width:l<s&&(i=l-o.width)),{x:i,y:n}),r=(this.currentElement.wrapper&&(t=_vt(-this.currentElement.wrapper.rotateAngle,void 0,void 0,t)),t=this.getChanges(t),this.commandHandler.renderSelector(this.prevPageId,this.prevSource.annotationSelectorSettings),this.helper||((h=0<this.commandHandler.selectedItems.annotations.length?owt(this.commandHandler.selectedItems.annotations[0]):owt(this.commandHandler.selectedItems.formFields[0])).id="diagram_helper","Stamp"===h.shapeAnnotationType?(h.strokeColor="",h.borderDashArray="",h.fillColor="transparent",h.stampFillColor="transparent",h.data=""):"FreeText"===h.shapeAnnotationType?(h.strokeColor="blue",h.fillColor="transparent",h.thickness=1,h.opacity=1,h.dynamicText=""):(h.bounds=(0<this.commandHandler.selectedItems.annotations.length?this.commandHandler.selectedItems.annotations:this.commandHandler.selectedItems.formFields)[0].wrapper.bounds,h.strokeColor="red",h.borderDashArray="5,5",h.fillColor="transparent",h.thickness=2,h.opacity=1),!0===h.enableShapeLabel&&(h.labelContent=""),"SignatureText"===h.shapeAnnotationType&&(h.fillColor="transparent",h.thickness=1,h.opacity=1,h.data=""),this.helper=h=this.commandHandler.add(h),0<this.commandHandler.selectedItems.annotations.length?this.commandHandler.selectedItems.annotations=[h]:this.commandHandler.selectedItems.formFields=[h]),this.updateSize(this.helper,this.startPosition,this.currentPosition,this.corner,this.initialBounds));return this.blocked=!this.scaleObjects(r.width,r.height,this.corner,this.startPosition,this.currentPosition,this.helper,e.info.ctrlKey),this.prevPosition=this.currentPosition,!this.blocked},tCt.prototype.mouseLeave=function(e){this.mouseUp(e)},tCt.prototype.getTooltipContent=function(e){return"W:"+Math.round(e.wrapper.bounds.width)+" H:"+Math.round(e.wrapper.bounds.height)},tCt.prototype.getChanges=function(e){switch(this.corner){case"ResizeEast":return{x:e.x,y:0};case"ResizeSouthEast":return e;case"ResizeSouth":return{x:0,y:e.y};case"ResizeNorth":return{x:0,y:-e.y};case"ResizeNorthEast":return{x:e.x,y:-e.y};case"ResizeNorthWest":return{x:-e.x,y:-e.y};case"ResizeWest":return{x:-e.x,y:0};case"ResizeSouthWest":return{x:-e.x,y:e.y}}return e},tCt.prototype.getPoints=function(e,t){switch(this.corner){case"ResizeEast":return{x:e,y:0};case"ResizeSouthEast":return{x:e,y:t};case"ResizeSouth":return{x:0,y:t};case"ResizeNorth":return{x:0,y:-t};case"ResizeNorthEast":return{x:e,y:-t};case"ResizeNorthWest":return{x:-e,y:-t};case"ResizeWest":return{x:-e,y:0};case"ResizeSouthWest":return{x:-e,y:t}}return{x:e,y:t}},tCt.prototype.scaleObjects=function(e,t,i,n,o,r,s){var a=this.commandHandler.annotationModule?this.commandHandler.annotationModule.findAnnotationSettings(r):{},l=0,h=0,d=this.currentPosition.x-this.startPosition.x,p=this.currentPosition.y-this.startPosition.y,c=(d/=this.commandHandler.viewerBase.getZoomFactor(),p/=this.commandHandler.viewerBase.getZoomFactor(),r),d=this.getPoints(d,p),p=c.bounds.width+d.x,c=c.bounds.height+d.y;return(a.minWidth||a.maxWidth||a.minHeight||a.maxHeight)&&(l=a.maxHeight||2e3,h=a.maxWidth||2e3,a.minHeight,a.minWidth),r instanceof Jbt&&1===r.annotations.length&&("Perimeter"===r.annotations[0].shapeAnnotationType||"Radius"===r.annotations[0].shapeAnnotationType||"Stamp"===r.shapeAnnotationType)?t=e=1!==t||1!==e?Math.max(1===t?0:t,1===e?0:e):n!==o?Math.max(t,e):0:"Image"===r.shapeAnnotationType||"HandWrittenSignature"===r.shapeAnnotationType||"SignatureText"===r.shapeAnnotationType||"SignatureImage"===r.shapeAnnotationType?(1===t&&1===e||s&&(h<=p&&c<l&&(t=Math.max(t,e)),l<=c&&p<h&&(e=Math.max(t,e)),p<h)&&c<l&&(t=e=Math.max(t,e)),s||(t=e=Math.max(t,e))):"Perimeter"!==r.shapeAnnotationType&&"Radius"!==r.shapeAnnotationType&&"Stamp"!==r.shapeAnnotationType||("Stamp"===r.shapeAnnotationType?(l||(t=t||Math.max(1===t?0:t)),h||(e=e||Math.max(1===e?0:e))):l&&h||1===t&&1===e||(t=e=Math.max(1===t?0:t,1===e?0:e))),this.blocked=this.commandHandler.scaleSelectedItems(e,t,this.getPivot(this.corner)),this.blocked};var $wt,eCt=tCt;function tCt(e,t,i){e=$wt.call(this,e,t,!0)||this;return e.initialBounds=new dvt,e.corner=i,e}Gmt(oCt,iCt=nft),oCt.prototype.mouseDown=function(e){var t,i,n,o;isNaN(this.pdfViewerBase.activeElements.activePageID)||"e-pv-page-container"===event.target.className||(iCt.prototype.mouseDown.call(this,e),this.inAction=!0,(e={bounds:{x:100,y:300,width:100,height:100},pageIndex:0,strokeColor:"red",thickness:3}).id=kvt(),this.sourceObject.pageIndex=e.pageIndex=this.pdfViewerBase.activeElements.activePageID||0,this.sourceObject.enableShapeLabel=this.commandHandler.enableShapeLabel,this.pdfViewerBase.updateFreeTextProperties(this.sourceObject),this.isFormDesign=!1,(t=document.getElementById("FormField_helper_html_element"))&&t.remove(),this.commandHandler.drawingObject=this.drawingObject=this.commandHandler.add(this.sourceObject||e),"Textbox"!==this.drawingObject.formFieldAnnotationType&&"SignatureField"!==this.drawingObject.formFieldAnnotationType&&"InitialField"!==this.drawingObject.formFieldAnnotationType&&"Checkbox"!==this.drawingObject.formFieldAnnotationType&&"ListBox"!==this.drawingObject.formFieldAnnotationType&&"RadioButton"!==this.drawingObject.formFieldAnnotationType&&"DropdownList"!==this.drawingObject.formFieldAnnotationType&&"PasswordField"!==this.drawingObject.formFieldAnnotationType)||(this.inAction=!1,this.drawingObject.pageNumber=this.pdfViewerBase.getActivePage(!0),t=this.commandHandler.formDesignerModule.updateFormFieldInitialSize(this.drawingObject.wrapper.children[0],this.drawingObject.formFieldAnnotationType),e=this.drawingObject.pageIndex,o=(e=this.pdfViewerBase.getElement("_pageDiv_"+e)).clientWidth-t.width,t=e.clientHeight-t.height,e=e.offsetLeft,i=void 0,n=void(i=this.currentPosition.y>=t&&event.target&&event.target.parentElement&&event.target.parentElement.classList.contains("foreign-object")&&event.path?(n=event.path[3].getBoundingClientRect(),event.clientX-n.left):!je(event.path)||"SignatureField"!==this.drawingObject.formFieldAnnotationType&&"InitialField"!==this.drawingObject.formFieldAnnotationType?this.currentPosition.x-e:this.currentPosition.x),n=this.currentPosition.x>=o&&this.currentPosition.y>=t?{x:o,y:t,width:this.drawingObject.wrapper.children[0].width,height:this.drawingObject.wrapper.children[0].height}:this.currentPosition.x>=o?{x:o,y:this.currentPosition.y,width:this.drawingObject.wrapper.children[0].width,height:this.drawingObject.wrapper.children[0].height}:this.currentPosition.y>=t?{x:i,y:t,width:this.drawingObject.wrapper.children[0].width,height:this.drawingObject.wrapper.children[0].height}:{x:this.currentPosition.x,y:this.currentPosition.y,width:this.drawingObject.wrapper.children[0].width,height:this.drawingObject.wrapper.children[0].height},this.updateNodeDimension(this.drawingObject,n),this.drawingObject.bounds.x=this.drawingObject.bounds.x-this.drawingObject.bounds.width/2,this.drawingObject.bounds.y=this.drawingObject.bounds.y-this.drawingObject.bounds.height/2,this.commandHandler.formFieldCollection.push(this.drawingObject),o={id:(e=this.drawingObject).id,name:e.name,value:e.value,type:e.formFieldAnnotationType,isReadOnly:e.isReadonly,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,color:e.color,backgroundColor:e.backgroundColor,alignment:e.alignment,visibility:e.visibility,maxLength:e.maxLength,isRequired:e.isRequired,isPrint:e.isPrint,isSelected:e.isSelected,isChecked:e.isChecked,tooltip:e.tooltip,bounds:e.bounds,thickness:e.thickness,borderColor:e.borderColor,signatureIndicatorSettings:e.signatureIndicatorSettings,pageIndex:e.pageIndex,pageNumber:e.pageNumber,isMultiline:e.isMultiline,insertSpaces:e.insertSpaces,isTransparent:e.isTransparent,rotateAngle:e.rotateAngle,selectedIndex:e.selectedIndex,options:e.options||[],signatureType:e.signatureType,zIndex:e.zIndex,customData:e.customData||""},this.commandHandler.formFieldCollections.push(o),this.commandHandler.formDesignerModule.drawHTMLContent(this.drawingObject.formFieldAnnotationType,this.drawingObject.wrapper.children[0],this.drawingObject,this.drawingObject.pageIndex,this.commandHandler),this.commandHandler.select([this.commandHandler.drawingObject.id],this.commandHandler.annotationSelectorSettings),this.commandHandler.annotation&&this.commandHandler.annotation.addAction(this.pdfViewerBase.getActivePage(!0),null,this.drawingObject,"Addition","",this.drawingObject,this.drawingObject),this.endAction(),this.pdfViewerBase.tool=null,this.pdfViewerBase.action="Select",this.drawingObject=null,this.pdfViewerBase.isMouseDown=!1,this.pdfViewerBase.pdfViewer.drawingObject=null,this.isFormDesign=!0)},oCt.prototype.mouseMove=function(e){return iCt.prototype.mouseMove.call(this,e),this.inAction&&!1===Cbt.equals(this.currentPosition,this.prevPosition)&&(this.dragging=!0,e=dvt.toBounds([this.prevPosition,this.currentPosition]),je(this.drawingObject)||(this.updateNodeDimension(this.drawingObject,e),"Radius"===this.drawingObject.shapeAnnotationType&&this.updateRadiusLinePosition(this.drawingObject.wrapper.children[1],this.drawingObject))),!0},oCt.prototype.mouseUp=function(e){var t;this.drawingObject&&this.dragging?(this.commandHandler.clearSelection(this.pdfViewerBase.activeElements.activePageID),je(e.source)||je(e.source.annotationSelectorSettings)||this.commandHandler.select([this.drawingObject.id],e.source.annotationSelectorSettings),je(t=this.commandHandler.selectedItems.annotations[0])||je(t.wrapper)||(this.commandHandler.nodePropertyChange(t,{bounds:{x:t.wrapper.offsetX,y:t.wrapper.offsetY}}),this.commandHandler.annotation.updateCalibrateValues(this.drawingObject,!0),this.commandHandler&&!this.isFormDesign&&this.commandHandler.annotation.addAction(this.pageIndex,null,this.drawingObject,"Addition","",this.drawingObject,this.drawingObject),this.dragging=!1,iCt.prototype.mouseUp.call(this,e),this.inAction=!1)):iCt.prototype.mouseUp.call(this,e),this.drawingObject=null},oCt.prototype.endAction=function(){iCt.prototype.endAction.call(this)},oCt.prototype.updateNodeDimension=function(e,t){var i,n=this.commandHandler.viewerBase.getZoomFactor();!je(e)&&(e.bounds.x=t.x/n+t.width/n,e.bounds.y=t.y/n+t.height/n,e.bounds.width=t.width/n,e.bounds.height=t.height/n,n=t=0,!(i=this.commandHandler.annotationModule?this.commandHandler.annotationModule.findAnnotationSettings(e):{}).maxWidth&&!i.maxHeight||(t=i.maxHeight||2e3,n=i.maxWidth||2e3,e.bounds.width>n&&(e.bounds.width=n),e.bounds.height>t&&(e.bounds.height=t),e.bounds.height<=t&&e.bounds.width<=n))&&this.commandHandler.nodePropertyChange(e,{bounds:e.bounds})},oCt.prototype.updateRadiusLinePosition=function(e,t){var i={x:t.bounds.x+t.bounds.width/4,y:t.bounds.y},n={x:t.bounds.x+t.bounds.width/2,y:t.bounds.y+t.bounds.height/2},o=uvt(),n=(mvt(o,t.rotateAngle,n.x,n.y),gvt(o,i)),o={x:n.x,y:n.y},i=(e.offsetX=o.x,e.offsetY=o.y,e.width=t.bounds.width/2,this.commandHandler.annotationModule.findAnnotationSettings(t));i.maxWidth&&(n=i.maxWidth||2e3,t.bounds.width>n)&&(t.bounds.width=n,e.width=t.bounds.width/2),this.commandHandler.renderDrawing(void 0,t.pageIndex)};var iCt,nCt=oCt;function oCt(e,t,i){e=iCt.call(this,e,t)||this;return e.sourceObject=i,e}Gmt(aCt,rCt=nft),aCt.prototype.mouseDown=function(e){var t,i;rCt.prototype.mouseDown.call(this,e),this.inAction=!0,this.drawingObject?(e=void 0,e={x:(e=(t=this.drawingObject).vertexPoints[t.vertexPoints.length-1]).x,y:e.y},(i=this.drawingObject.vertexPoints[this.drawingObject.vertexPoints.length-1]).x===e.x&&i.x===e.y||this.drawingObject.vertexPoints.push(e),this.commandHandler.nodePropertyChange(t,{vertexPoints:t.vertexPoints})):(this.startPoint={x:this.startPosition.x,y:this.startPosition.y},i={bounds:{x:this.currentPosition.x,y:this.currentPosition.y,width:5,height:5},vertexPoints:[{x:this.startPoint.x/this.pdfViewerBase.getZoomFactor(),y:this.startPoint.y/this.pdfViewerBase.getZoomFactor()},{x:this.currentPosition.x/this.pdfViewerBase.getZoomFactor(),y:this.currentPosition.y/this.pdfViewerBase.getZoomFactor()}],shapeAnnotationType:"Line",fillColor:this.commandHandler.drawingObject.fillColor,strokeColor:this.commandHandler.drawingObject.strokeColor,pageIndex:this.pdfViewerBase.activeElements.activePageID,notes:this.commandHandler.drawingObject.notes,thickness:this.commandHandler.drawingObject.thickness,author:this.commandHandler.drawingObject.author,subject:this.commandHandler.drawingObject.subject,borderDashArray:this.commandHandler.drawingObject.borderDashArray,modifiedDate:this.commandHandler.drawingObject.modifiedDate,borderStyle:this.commandHandler.drawingObject.borderStyle,measureType:this.commandHandler.drawingObject.measureType,enableShapeLabel:this.commandHandler.enableShapeLabel,opacity:this.commandHandler.drawingObject.opacity},this.pdfViewerBase.updateFreeTextProperties(i),this.drawingObject=this.commandHandler.add(i))},aCt.prototype.mouseMove=function(e){return rCt.prototype.mouseMove.call(this,e),this.inAction&&!1===Cbt.equals(this.currentPosition,this.prevPosition)&&(this.dragging=!0,e=this.drawingObject,this.drawingObject&&this.currentPosition&&(e.vertexPoints[e.vertexPoints.length-1].x=this.currentPosition.x/this.pdfViewerBase.getZoomFactor(),e.vertexPoints[e.vertexPoints.length-1].y=this.currentPosition.y/this.pdfViewerBase.getZoomFactor(),this.commandHandler.nodePropertyChange(e,{vertexPoints:e.vertexPoints})),"Perimeter"===e.measureType)&&wwt(e,e.vertexPoints,this.commandHandler.annotation.measureAnnotationModule),!0},aCt.prototype.mouseUp=function(e,t,i){var n,o,r=!1;rCt.prototype.mouseMove.call(this,e),n=e.source&&null!==e.annotationSelectorSettings?e.source.annotationSelectorSettings:"",this.drawingObject&&2===this.drawingObject.vertexPoints.length&&t&&i&&(this.commandHandler.remove(this.drawingObject),r=!0,this.endAction()),this.drawingObject&&!r&&(r=new dvt(this.drawingObject.vertexPoints[this.drawingObject.vertexPoints.length-1].x-20,this.drawingObject.vertexPoints[this.drawingObject.vertexPoints.length-1].y-20,40,40),o={x:this.drawingObject.vertexPoints[0].x,y:this.drawingObject.vertexPoints[0].y},(r.containsPoint(o)||t)&&this.dragging?(this.inAction&&(this.inAction=!1,this.drawingObject)&&(i||2<this.drawingObject.vertexPoints.length&&!e.isTouchMode&&this.drawingObject.vertexPoints.splice(this.drawingObject.vertexPoints.length-1,1),"Polygon"===this.action?(i?this.drawingObject.vertexPoints[this.drawingObject.vertexPoints.length]=this.drawingObject.vertexPoints[0]:this.drawingObject.vertexPoints[this.drawingObject.vertexPoints.length-1]=this.drawingObject.vertexPoints[0],this.commandHandler.nodePropertyChange(this.drawingObject,{vertexPoints:this.drawingObject.vertexPoints}),(r=owt(this.drawingObject)).shapeAnnotationType="Polygon",r.bounds.width=r.wrapper.actualSize.width,r.bounds.height=r.wrapper.actualSize.height,r.bounds.x=this.drawingObject.wrapper.bounds.x,r.bounds.y=this.drawingObject.wrapper.bounds.y,this.commandHandler.add(r),this.commandHandler.remove(this.drawingObject),this.commandHandler.select([r.id],n),(o=this.commandHandler.selectedItems.annotations[0])&&(this.commandHandler.enableShapeAnnotation&&(je(o.measureType)||""===o.measureType)&&this.commandHandler.annotation.shapeAnnotationModule.renderShapeAnnotations(o,o.pageIndex),!this.commandHandler.enableMeasureAnnotation||"Area"!==o.measureType&&"Volume"!==o.measureType||("Area"===o.measureType?(o.notes=this.commandHandler.annotation.measureAnnotationModule.calculateArea(o.vertexPoints),this.commandHandler.annotation.stickyNotesAnnotationModule.addTextToComments(o.annotName,o.notes)):"Volume"===o.measureType&&(o.notes=this.commandHandler.annotation.measureAnnotationModule.calculateVolume(o.vertexPoints),this.commandHandler.annotation.stickyNotesAnnotationModule.addTextToComments(o.annotName,o.notes)),o.enableShapeLabel&&(o.labelContent=o.notes,this.commandHandler.nodePropertyChange(o,{vertexPoints:o.vertexPoints,notes:o.notes})),this.commandHandler.annotation.measureAnnotationModule.renderMeasureShapeAnnotations(o,o.pageIndex)))):(i||t&&this.drawingObject.vertexPoints.splice(this.drawingObject.vertexPoints.length-1,1),this.commandHandler.nodePropertyChange(this.drawingObject,{vertexPoints:this.drawingObject.vertexPoints,sourceDecoraterShapes:this.commandHandler.drawingObject.sourceDecoraterShapes,taregetDecoraterShapes:this.commandHandler.drawingObject.taregetDecoraterShapes}),this.commandHandler.select([this.drawingObject.id],n),this.commandHandler.enableMeasureAnnotation&&"Perimeter"===this.drawingObject.measureType&&(this.commandHandler.renderDrawing(null,this.drawingObject.pageIndex),this.drawingObject.notes=this.commandHandler.annotation.measureAnnotationModule.calculatePerimeter(this.drawingObject),this.drawingObject.enableShapeLabel&&(this.drawingObject.labelContent=this.drawingObject.notes,this.commandHandler.nodePropertyChange(this.drawingObject,{vertexPoints:this.drawingObject.vertexPoints,notes:this.drawingObject.notes})),this.commandHandler.annotation.stickyNotesAnnotationModule.addTextToComments(this.drawingObject.annotName,this.drawingObject.notes),this.commandHandler.annotation.measureAnnotationModule.renderMeasureShapeAnnotations(this.drawingObject,this.drawingObject.pageIndex))),e=this.commandHandler.selectedItems.annotations[0],this.commandHandler.annotation.addAction(this.pageIndex,null,e,"Addition","",e,e),this.drawingObject=null),this.endAction()):this.inAction&&!this.dragging&&this.commandHandler.remove(this.drawingObject))},aCt.prototype.mouseLeave=function(e){this.mouseUp(e,!0,!0)},aCt.prototype.mouseWheel=function(e){rCt.prototype.mouseWheel.call(this,e),this.mouseMove(e)},aCt.prototype.endAction=function(){this.inAction=!1,this.drawingObject=null,this.commandHandler.tool=""};var rCt,sCt=aCt;function aCt(e,t,i){e=rCt.call(this,e,t)||this;return e.action=i,e}Gmt(dCt,lCt=nft),dCt.prototype.mouseDown=function(e){this.inAction=!0,this.undoElement=void 0,lCt.prototype.mouseDown.call(this,e),e.source&&e.source.annotations&&(this.prevPosition.x,this.prevPosition.y,this.drawingObject),this.initialPosition=e.position,this.prevSource=this.drawingObject,this.currentPosition=e.position,this.drawingObject?this.dragging||(e={bounds:{x:this.currentPosition.x,y:this.currentPosition.y,width:5,height:5},vertexPoints:[{x:this.startPosition.x/this.pdfViewerBase.getZoomFactor(),y:this.startPosition.y/this.pdfViewerBase.getZoomFactor()},{x:this.currentPosition.x/this.pdfViewerBase.getZoomFactor(),y:this.currentPosition.y/this.pdfViewerBase.getZoomFactor()}],shapeAnnotationType:this.drawingObject.shapeAnnotationType,sourceDecoraterShapes:this.drawingObject.sourceDecoraterShapes,taregetDecoraterShapes:this.drawingObject.taregetDecoraterShapes,fillColor:this.drawingObject.fillColor,strokeColor:this.drawingObject.strokeColor,pageIndex:this.pdfViewerBase.activeElements.activePageID,opacity:this.drawingObject.opacity||1,borderDashArray:this.drawingObject.borderDashArray,thickness:this.drawingObject.thickness,modifiedDate:this.drawingObject.modifiedDate,author:this.drawingObject.author,subject:this.drawingObject.subject,lineHeadEnd:this.drawingObject.lineHeadEnd,lineHeadStart:this.drawingObject.lineHeadStart,measureType:this.commandHandler.drawingObject.measureType,enableShapeLabel:this.commandHandler.enableShapeLabel},this.pdfViewerBase.updateFreeTextProperties(e),this.drawingObject=this.commandHandler.add(e)):(e=this.commandHandler.annotation.measureAnnotationModule,e={vertexPoints:[{x:this.startPosition.x/this.pdfViewerBase.getZoomFactor(),y:this.startPosition.y/this.pdfViewerBase.getZoomFactor()},{x:this.currentPosition.x/this.pdfViewerBase.getZoomFactor(),y:this.currentPosition.y/this.pdfViewerBase.getZoomFactor()}],bounds:{x:this.currentPosition.x,y:this.currentPosition.y,width:5,height:5},sourceDecoraterShapes:this.commandHandler.drawingObject.sourceDecoraterShapes,taregetDecoraterShapes:this.commandHandler.drawingObject.taregetDecoraterShapes,measureType:"Distance",fillColor:this.commandHandler.drawingObject.fillColor,notes:this.commandHandler.drawingObject.notes,strokeColor:this.commandHandler.drawingObject.strokeColor,opacity:this.commandHandler.drawingObject.opacity,thickness:this.commandHandler.drawingObject.thickness,borderDashArray:this.commandHandler.drawingObject.borderDashArray,shapeAnnotationType:"Distance",pageIndex:this.pdfViewerBase.activeElements.activePageID,author:this.commandHandler.drawingObject.author,subject:this.commandHandler.drawingObject.subject,enableShapeLabel:this.commandHandler.enableShapeLabel,leaderHeight:e.leaderLength},this.pdfViewerBase.updateFreeTextProperties(e),this.drawingObject=this.commandHandler.add(e))},dCt.prototype.mouseUp=function(e){var t,i;this.dragging?(lCt.prototype.mouseMove.call(this,e),this.commandHandler&&(t=void 0,t=e.source&&null!==e.annotationSelectorSettings?e.source.annotationSelectorSettings:"",i=this.drawingObject,this.commandHandler.nodePropertyChange(i,{vertexPoints:i.vertexPoints,leaderHeight:i.leaderHeight}),this.commandHandler.clearSelection(this.pdfViewerBase.activeElements.activePageID),this.commandHandler.select([i.id],t),this.commandHandler.renderSelector(this.pdfViewerBase.activeElements.activePageID,t)),this.endPoint&&-1<this.endPoint.indexOf("ConnectorSegmentPoint")&&this.dragging&&(this.commandHandler.annotation.updateCalibrateValues(this.drawingObject),this.commandHandler.annotation.addAction(this.pageIndex,null,this.drawingObject,"Addition","",this.drawingObject,this.drawingObject),this.drawingObject=null,this.dragging=!1,lCt.prototype.mouseUp.call(this,e)),this.drawingObject&&(this.endPoint="ConnectorSegmentPoint_1")):this.drawingObject&&this.commandHandler.remove(this.drawingObject)},dCt.prototype.mouseMove=function(e){var t,i,n;return lCt.prototype.mouseMove.call(this,e),this.inAction&&!1===Cbt.equals(this.currentPosition,this.prevPosition)&&(this.currentPosition=e.position,this.dragging=!0,this.currentPosition&&this.prevPosition&&(t=this.currentPosition.x-this.prevPosition.x,i=this.currentPosition.y-this.prevPosition.y,n=void 0,n=e.source&&null!==e.annotationSelectorSettings?e.source.annotationSelectorSettings:"",this.inAction&&this.commandHandler&&this.drawingObject&&void 0!==this.endPoint&&0!=t||0!=i)&&(this.blocked=!this.commandHandler.dragConnectorEnds(this.endPoint,this.drawingObject,this.currentPosition,this.selectedSegment,e.target,null,n),this.commandHandler.renderSelector(this.pdfViewerBase.activeElements.activePageID,n)),this.prevPosition=this.currentPosition),!this.blocked},dCt.prototype.mouseLeave=function(e){this.mouseUp(e)},dCt.prototype.endAction=function(){lCt.prototype.endAction.call(this),this.prevPosition=null,this.endPoint=null};var lCt,hCt=dCt;function dCt(e,t,i,n){e=lCt.call(this,e,t,!0)||this;return e.endPoint=i,e.drawingObject=n,e}Gmt(uCt,pCt=nft),uCt.prototype.mouseDown=function(e){var t=owt(e.source);this.undoElement={bounds:{x:t.wrapper.offsetX,y:t.wrapper.offsetY,width:t.wrapper.actualSize.width,height:t.wrapper.actualSize.height},rotateAngle:t.rotateAngle},pCt.prototype.mouseDown.call(this,e)},uCt.prototype.mouseUp=function(e){var t,i=e.source;this.undoElement.rotateAngle!==i.wrapper.rotateAngle&&(i=e.source.annotations[0].annotationSelectorSettings,this.commandHandler.renderSelector(this.pdfViewerBase.activeElements.activePageID,i),t={bounds:{x:e.source.wrapper.offsetX,y:e.source.wrapper.offsetY,width:e.source.wrapper.actualSize.width,height:e.source.wrapper.actualSize.height},rotateAngle:e.source.wrapper.rotateAngle}),this.commandHandler.annotation.addAction(this.pageIndex,null,e.source,"Rotate","",this.undoElement,t),this.commandHandler.annotation.stampAnnotationModule.updateSessionStorage(e.source,null,"Rotate"),this.commandHandler.annotation.stickyNotesAnnotationModule.updateStickyNotes(e.source,null),pCt.prototype.mouseUp.call(this,e)},uCt.prototype.mouseMove=function(e){pCt.prototype.mouseMove.call(this,e);var t=e.source,i=e.source.annotations[0].annotationSelectorSettings;return this.currentPosition=e.position,t.wrapper&&(e={x:t.wrapper.offsetX,y:t.wrapper.offsetY},e=Cbt.findAngle(e,this.currentPosition)+90,this.blocked=!this.commandHandler.rotate((e=(e+360)%360)-t.wrapper.rotateAngle,i)),!this.blocked},uCt.prototype.getTooltipContent=function(e){return Math.round(e.rotateAngle%360).toString()+"°"},uCt.prototype.mouseLeave=function(e){this.mouseUp(e)},uCt.prototype.endAction=function(){pCt.prototype.endAction.call(this)};var pCt,cCt=uCt;function uCt(e,t){return pCt.call(this,e,t,!0)||this}function gCt(e,t,i,n){var o;if(i&&-1<t.activeElements.activePageID)return e=fCt(o=mCt(t,i,e),e,t,i),n?o:e}function mCt(e,t,i){i=e.currentPosition||{x:i.offsetX,y:i.offsetY};return CCt({x:i.x/e.getZoomFactor(),y:i.y/e.getZoomFactor()},t.getPageTable(e.activeElements.activePageID).objects,t.touchPadding)}function fCt(e,t,i,n){for(var o,r,s,a,l,h,d,p,c,u=null,g=(t&&t.type&&-1!==t.type.indexOf("touch")?(a=t,n.annotation&&(o=i.getElement("_pageDiv_"+n.annotation.getEventPageNumber(t)))&&(o=o.getBoundingClientRect(),r=a.changedTouches[0].clientX-o.left,s=a.changedTouches[0].clientY-o.top)):t&&t.target&&t.path&&t.target.parentElement&&t.target.parentElement.classList.contains("foreign-object")?(l=t.path[4].getBoundingClientRect(),r=t.clientX-l.left,s=t.clientY-l.top):t.target&&t.target.parentElement&&t.target.parentElement.classList.contains("foreign-object")?(l=t.target.offsetParent.offsetParent.offsetParent.getBoundingClientRect(),r=t.clientX-l.left,s=t.clientY-l.top):t.target&&t.target.parentElement&&t.target.parentElement.parentElement&&t.target.parentElement.parentElement.classList.contains("foreign-object")?(l=void 0,t.target.offsetParent&&t.target.offsetParent.offsetParent&&t.target.offsetParent.offsetParent.offsetParent&&t.target.offsetParent.offsetParent.offsetParent.offsetParent?(l=t.target.offsetParent.offsetParent.offsetParent.offsetParent.getBoundingClientRect(),r=t.clientX-l.left,s=t.clientY-l.top):t.target.parentElement.offsetParent&&t.target.parentElement.offsetParent.offsetParent&&(l=t.target.parentElement.offsetParent.offsetParent.getBoundingClientRect(),r=t.clientX-l.left,s=t.clientY-l.top)):(r=isNaN(t.offsetX)?t.position?t.position.x:0:t.offsetX,s=isNaN(t.offsetY)?t.position?t.position.y:0:t.offsetY),n.touchPadding/2),m=0,f=0;f<e.length;f++)"Distance"===e[parseInt(f.toString(),10)].shapeAnnotationType||"Line"===e[parseInt(f.toString(),10)].shapeAnnotationType||"LineWidthArrowHead"===e[parseInt(f.toString(),10)].shapeAnnotationType||i.tool instanceof hCt?(p={x:r/i.getZoomFactor(),y:s/i.getZoomFactor()},c=vCt(e[parseInt(f.toString(),10)],p,g),h=Twt(e[parseInt(f.toString(),10)],p),c&&!h&&(d=yCt(e[parseInt(f.toString(),10)],c))&&((d=dvt.toBounds([d,d])).Inflate(10),d.containsPoint(p))&&(h=!0),c&&h&&(u=e[parseInt(f.toString(),10)])):(d=e[parseInt(f.toString(),10)].wrapper.bounds,p=0,"Stamp"!==e[parseInt(f.toString(),10)].shapeAnnotationType&&"Image"!==e[parseInt(f.toString(),10)].shapeAnnotationType||(p=25),(d.x-g)*i.getZoomFactor()<r&&(d.x+d.width+g)*i.getZoomFactor()>r&&(d.y-g-p)*i.getZoomFactor()<s&&(d.y+d.height+g)*i.getZoomFactor()>s&&(i.tool instanceof nCt||i.tool instanceof Uwt?u=e[parseInt(f.toString(),10)]:m?(c=r-(d.x-g)*i.getZoomFactor()+((d.x+d.width+g)*i.getZoomFactor()-r)+(s-(d.y-g-p)*i.getZoomFactor())+((d.y+d.height+g)*i.getZoomFactor()-s))<m||m===c?(u=e[parseInt(f.toString(),10)],m=c):"Image"!==e[parseInt(f.toString(),10)].shapeAnnotationType&&"Stamp"!==e[parseInt(f.toString(),10)].shapeAnnotationType||(u=e[parseInt(f.toString(),10)]):(u=e[parseInt(f.toString(),10)],m=r-(d.x-g)*i.getZoomFactor()+((d.x+d.width+g)*i.getZoomFactor()-r)+(s-(d.y-g-p)*i.getZoomFactor())+((d.y+d.height+g)*i.getZoomFactor()-s))));return u}function yCt(e,t){var i=e.sourcePoint,n=e.targetPoint;if("Distance"===e.shapeAnnotationType){var o,r=void 0,s=Cbt.findAngle(e.sourcePoint,e.targetPoint);if(-1<t.id.indexOf("leader"))return o=e.wrapper.children[0].bounds.center,o=-1<t.id.indexOf("leader1")?(r={x:e.sourcePoint.x,y:e.sourcePoint.y-e.leaderHeight},i):(r={x:e.targetPoint.x,y:e.targetPoint.y-e.leaderHeight},n),mvt(t=uvt(),s,o.x,o.y),gvt(t,{x:r.x,y:r.y})}}function vCt(e,t,i){return wCt(e.wrapper,t,i)}function bCt(e,t,i){if(0===i.length)i.push(e);else if(1===i.length)i[0][""+t]>e[""+t]?i.splice(0,0,e):i.push(e);else if(1<i.length){for(var n=0,o=i.length-1,r=Math.floor((n+o)/2);r!==n;)i[parseInt(r.toString(),10)][""+t]<e[""+t]?(n=r,r=Math.floor((n+o)/2)):i[parseInt(r.toString(),10)][""+t]>e[""+t]&&(o=r,r=Math.floor((n+o)/2));i[parseInt(o.toString(),10)][""+t]<e[""+t]?i.push(e):i[parseInt(n.toString(),10)][""+t]>e[""+t]?i.splice(n,0,e):i[parseInt(n.toString(),10)][""+t]<e[""+t]&&i[parseInt(o.toString(),10)][""+t]>e[""+t]&&i.splice(o,0,e)}}function wCt(e,t,i){if(e&&e.children)for(var n=e.children.length-1;0<=n;n--){var o=e.children[parseInt(n.toString(),10)],r=i;if(!je(o.children)&&0<o.children.length)for(var s=o.children.length-1;0<=s;s--){var a,l=o.children[parseInt(s.toString(),10)];if(l&&l.bounds.containsPoint(t,r)){if(l instanceof Uvt)if(a=this.findTargetElement(l,t))return a;if(l.bounds.containsPoint(t,r))return l}}else if(o&&o.bounds.containsPoint(t,r)){if(o instanceof Uvt)if(a=this.findTargetElement(o,t))return a;if(o.bounds.containsPoint(t,r))return o}}if(e&&e.bounds.containsPoint(t,i)&&"none"!==e.style.fill){var h=e,d=uvt(),p=(mvt(d,h.parentTransform,h.offsetX,h.offsetY),h.offsetX-h.pivot.x*h.actualSize.width),c=h.offsetY-h.pivot.y*h.actualSize.height;if(Rbt(t,gvt(d,{x:p+(.5===h.pivot.x?2*h.pivot.x:h.pivot.x)*h.actualSize.width/2,y:c-30}),10))return e}return null}function CCt(e,t,i){for(var n=[],o=0,r=t;o<r.length;o++){var s=r[o];(vCt(s,e,i)||"Stamp"===s.shapeAnnotationType&&vCt(s,e,40))&&bCt(s,"zIndex",n)}return n}Object.defineProperty(_Ct.prototype,"activePageID",{get:function(){return this.activePage},set:function(e){this.activePage=e},enumerable:!0,configurable:!0});var SCt,ACt,xCt,ICt,TCt,ECt,DCt,MCt,kCt,PCt,BCt,FCt,LCt,RCt,OCt,NCt,VCt=_Ct;function _Ct(){this.activePage=void 0,this.activePageID=void 0}function HCt(e,t,i,n,o){var r,s,e=Ivt("div",{id:o.element.id+n+"_diagramAdornerLayer",style:"width:"+e.width+"px;height:"+e.height+"px;"+t});xvt(e.id)||(s=(t=o.viewerBase.getElement("_pageDiv_"+n)).getBoundingClientRect(),(r=zCt(o.element.id+n+"_diagramAdorner_svg",s.width,s.height)).setAttribute("class","e-adorner-layer"+n),r.style.pointerEvents="none",o.adornerSvgLayer=Pbt("g",{id:o.element.id+n+"_diagramAdorner"}),o.adornerSvgLayer.style.pointerEvents="all",r.appendChild(o.adornerSvgLayer),e.appendChild(r),e.style.width=s.width+"px",e.style.height=s.height+"px",t?t.insertBefore(e,t.childNodes[0]):i.parentElement.appendChild(e),s=Pbt("g",{id:o.element.id+n+"_SelectorElement"}),o.adornerSvgLayer.appendChild(s),kbt(r,{style:"pointer-events:none;"})),o.viewerBase.applyElementStyles(e,n)}function zCt(e,t,i){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return kbt(n,{id:e,width:t,height:i}),n}(i0=SCt=SCt||{})[i0.None=1]="None",i0[i0.Accepted=2]="Accepted",i0[i0.Canceled=3]="Canceled",i0[i0.Completed=4]="Completed",i0[i0.Rejected=5]="Rejected",(X$e=ACt=ACt||{})[X$e.None=0]="None",X$e[X$e.Bold=1]="Bold",X$e[X$e.Italic=2]="Italic",X$e[X$e.Underline=4]="Underline",X$e[X$e.Strikethrough=8]="Strikethrough",(Z$e=xCt=xCt||{})[Z$e.Copy=0]="Copy",Z$e[Z$e.Highlight=1]="Highlight",Z$e[Z$e.Cut=2]="Cut",Z$e[Z$e.Underline=4]="Underline",Z$e[Z$e.Paste=8]="Paste",Z$e[Z$e.Delete=16]="Delete",Z$e[Z$e.ScaleRatio=32]="ScaleRatio",Z$e[Z$e.Strikethrough=64]="Strikethrough",Z$e[Z$e.Properties=128]="Properties",Z$e[Z$e.Comment=256]="Comment",(Wo=ICt=ICt||{}).Draw="Draw",Wo.Type="Type",Wo.Image="Image",(Met=TCt=TCt||{})[Met.Corners=1]="Corners",Met[Met.Edges=2]="Edges",(Cet=ECt=ECt||{}).None="None",Cet.TextOnly="TextOnly",Cet.BoundsOnly="BoundsOnly",Cet.TextAndBounds="TextAndBounds",(N$e=DCt=DCt||{})[N$e.Draw=1]="Draw",N$e[N$e.Text=2]="Text",N$e[N$e.Upload=4]="Upload",(ts=MCt=MCt||{}).auto="auto",ts.crossHair="crosshair",ts.e_resize="e-resize",ts.ew_resize="ew-resize",ts.grab="grab",ts.grabbing="grabbing",ts.move="move",ts.n_resize="n-resize",ts.ne_resize="ne-resize",ts.ns_resize="ns-resize",ts.nw_resize="nw-resize",ts.pointer="pointer",ts.s_resize="s-resize",ts.se_resize="se-resize",ts.sw_resize="sw-resize",ts.text="text",ts.w_resize="w-resize",(d$=kCt=kCt||{}).Revised="Revised",d$.Reviewed="Reviewed",d$.Received="Received",d$.Approved="Approved",d$.Confidential="Confidential",d$.NotApproved="NotApproved",(zmt=PCt=PCt||{}).Witness="Witness",zmt.InitialHere="InitialHere",zmt.SignHere="SignHere",zmt.Accepted="Accepted",zmt.Rejected="Rejected",(Qmt=BCt=BCt||{}).Approved="Approved",Qmt.NotApproved="NotApproved",Qmt.Draft="Draft",Qmt.Final="Final",Qmt.Completed="Completed",Qmt.Confidential="Confidential",Qmt.ForPublicRelease="ForPublicRelease",Qmt.NotForPublicRelease="NotForPublicRelease",Qmt.ForComment="ForComment",Qmt.Void="Void",Qmt.PreliminaryResults="PreliminaryResults",Qmt.InformationOnly="InformationOnly",(ost=FCt=FCt||{}).Select="Select",ost.Move="Move",ost.Resize="Resize",ost.Delete="Delete",ost.None="None",ost.PropertyChange="PropertyChange",(jee=LCt=LCt||{}).Json="Json",jee.Xfdf="Xfdf",(Xet=RCt=RCt||{}).Xml="Xml",Xet.Fdf="Fdf",Xet.Xfdf="Xfdf",Xet.Json="Json",(det=OCt=OCt||{})[det.None=0]="None",det[det.Control=1]="Control",det[det.Meta=1]="Meta",det[det.Alt=2]="Alt",det[det.Shift=4]="Shift",(q$e=NCt=NCt||{})[q$e.None=null]="None",q$e[q$e.N0=48]="N0",q$e[q$e.N1=49]="N1",q$e[q$e.N2=50]="N2",q$e[q$e.N3=51]="N3",q$e[q$e.N4=52]="N4",q$e[q$e.N5=53]="N5",q$e[q$e.N6=54]="N6",q$e[q$e.N7=55]="N7",q$e[q$e.N8=56]="N8",q$e[q$e.N9=57]="N9",q$e[q$e.Number0=96]="Number0",q$e[q$e.Number1=97]="Number1",q$e[q$e.Number2=98]="Number2",q$e[q$e.Number3=99]="Number3",q$e[q$e.Number4=100]="Number4",q$e[q$e.Number5=101]="Number5",q$e[q$e.Number6=102]="Number6",q$e[q$e.Number7=103]="Number7",q$e[q$e.Number8=104]="Number8",q$e[q$e.Number9=105]="Number9",q$e[q$e.A=65]="A",q$e[q$e.B=66]="B",q$e[q$e.C=67]="C",q$e[q$e.D=68]="D",q$e[q$e.E=69]="E",q$e[q$e.F=70]="F",q$e[q$e.G=71]="G",q$e[q$e.H=72]="H",q$e[q$e.I=73]="I",q$e[q$e.J=74]="J",q$e[q$e.K=75]="K",q$e[q$e.L=76]="L",q$e[q$e.M=77]="M",q$e[q$e.N=78]="N",q$e[q$e.O=79]="O",q$e[q$e.P=80]="P",q$e[q$e.Q=81]="Q",q$e[q$e.R=82]="R",q$e[q$e.S=83]="S",q$e[q$e.T=84]="T",q$e[q$e.U=85]="U",q$e[q$e.V=86]="V",q$e[q$e.W=87]="W",q$e[q$e.X=88]="X",q$e[q$e.Y=89]="Y",q$e[q$e.Z=90]="Z",q$e[q$e.ArrowLeft=37]="ArrowLeft",q$e[q$e.ArrowUp=38]="ArrowUp",q$e[q$e.ArrowRight=39]="ArrowRight",q$e[q$e.ArrowDown=40]="ArrowDown",q$e[q$e.Escape=27]="Escape",q$e[q$e.Space=32]="Space",q$e[q$e.PageUp=33]="PageUp",q$e[q$e.PageDown=34]="PageDown",q$e[q$e.End=35]="End",q$e[q$e.Home=36]="Home",q$e[q$e.Delete=46]="Delete",q$e[q$e.Tab=9]="Tab",q$e[q$e.Enter=13]="Enter",q$e[q$e.BackSpace=8]="BackSpace",q$e[q$e.F1=112]="F1",q$e[q$e.F2=113]="F2",q$e[q$e.F3=114]="F3",q$e[q$e.F4=115]="F4",q$e[q$e.F5=116]="F5",q$e[q$e.F6=117]="F6",q$e[q$e.F7=118]="F7",q$e[q$e.F8=119]="F8",q$e[q$e.F9=120]="F9",q$e[q$e.F10=121]="F10",q$e[q$e.F11=122]="F11",q$e[q$e.F12=123]="F12",q$e[q$e.Star=56]="Star",q$e[q$e.Plus=187]="Plus",q$e[q$e.Minus=189]="Minus",q$e[q$e.BracketLeft=219]="BracketLeft",q$e[q$e.BracketRight=221]="BracketRight";WCt.prototype.updateTextProperties=function(){var e;this.defautWidth=this.pdfViewer.freeTextSettings.width||151,this.defaultHeight=this.pdfViewer.freeTextSettings.height||24.6,this.borderColor=this.pdfViewer.freeTextSettings.borderColor||"#ffffff00",this.fillColor=this.pdfViewer.freeTextSettings.fillColor||"#fff",this.borderStyle=this.pdfViewer.freeTextSettings.borderStyle||"solid",this.borderWidth=je(this.pdfViewer.freeTextSettings.borderWidth)?1:this.pdfViewer.freeTextSettings.borderWidth,this.fontSize=this.pdfViewer.freeTextSettings.fontSize||16,this.opacity=this.pdfViewer.freeTextSettings.opacity||1,this.fontColor=this.pdfViewer.freeTextSettings.fontColor||"#000",this.author=this.pdfViewer.freeTextSettings.author&&"Guest"!==this.pdfViewer.freeTextSettings.author?this.pdfViewer.freeTextSettings.author:this.pdfViewer.annotationSettings.author||"Guest",je(this.pdfViewer.annotationModule)||0===this.getRgbCode(this.borderColor).a&&(this.borderWidth=0),this.pdfViewer.freeTextSettings.fontFamily?(e=this.pdfViewer.freeTextSettings.fontFamily,this.fontFamily="Helvetica"===e||"Times New Roman"===e||"Courier"===e||"Symbol"===e||"ZapfDingbats"===e?e:"Helvetica"):this.fontFamily="Helvetica",this.textAlign=this.pdfViewer.freeTextSettings.textAlignment||"Left",this.defaultText=this.pdfViewer.freeTextSettings.defaultText||"Type here",this.isReadonly=!1,this.pdfViewer.freeTextSettings.enableAutoFit?(this.wordBreak="break-all",this.padding="2px"):(this.padding="0px",this.wordBreak="break-word"),(this.pdfViewer.freeTextSettings.isLock||this.pdfViewer.annotationSettings.isLock||this.pdfViewer.freeTextSettings.isReadonly)&&(this.isReadonly=!0),this.isBold=(this.pdfViewer.freeTextSettings.fontStyle&ACt.Bold)===ACt.Bold,this.isItalic=(this.pdfViewer.freeTextSettings.fontStyle&ACt.Italic)===ACt.Italic,this.isUnderline=(this.pdfViewer.freeTextSettings.fontStyle&ACt.Underline)===ACt.Underline,this.isStrikethrough=(this.pdfViewer.freeTextSettings.fontStyle&ACt.Strikethrough)===ACt.Strikethrough},WCt.prototype.renderFreeTextAnnotations=function(e,t,i,n){var o=!1;if(!i)for(var r=0;r<this.freeTextPageNumbers.length;r++)if(this.freeTextPageNumbers[parseInt(r.toString(),10)]===t){o=!0;break}if(e&&(!o||n)&&1<=e.length){this.freeTextPageNumbers.push(t);for(var s=0;s<e.length;s++){var a=e[parseInt(s.toString(),10)];if(a.annotationAddMode=this.pdfViewer.annotationModule.findAnnotationMode(a,t,a.AnnotType),a.AnnotType){var l=null;if(a.VertexPoints)for(var l=[],h=0;h<a.VertexPoints.length;h++){var d={x:a.VertexPoints[parseInt(h.toString(),10)].X,y:a.VertexPoints[parseInt(h.toString(),10)].Y};l.push(d)}a.AnnotationSettings=a.AnnotationSettings||this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.freeTextSettings),a.IsLocked&&(a.AnnotationSettings.isLock=a.IsLocked);var p,c,u,g=je(a.Bounds.X)?a.Bounds.x:a.Bounds.X-.5,m=je(a.Bounds.Y)?a.Bounds.y:a.Bounds.Y-.5,f=a.Bounds.Width||a.Bounds.width,y=a.Bounds.Height||a.Bounds.height,v=a.isAddAnnotationProgramatically||!1,b=this.getRotationValue(t,v),w=a.PageRotation,C=(1===Math.sign(a.Rotate)?a.Rotate=-a.Rotate+b:a.Rotate=a.Rotate+b,Math.abs(a.Rotate)),S=(i&&b!==w&&this.pdfViewerBase.isJsonImported&&(S=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)],A=a.Bounds.X,u=a.Bounds.Y,p=f,c=y,0<w&&(1==(w=w/90)?(y=f,f=a.Bounds.Height,g=a.Bounds.Y,m=270!==b?S.height-a.Bounds.X-a.Bounds.Width:S.width-a.Bounds.X-a.Bounds.Width):2==w?m=270!==b&&90!==b?(g=S.width-a.Bounds.X-a.Bounds.Width,S.height-a.Bounds.Y-a.Bounds.Height):(g=S.height-a.Bounds.X-a.Bounds.Width,S.width-a.Bounds.Y-a.Bounds.Height):3==w&&(y=f,f=a.Bounds.Height,g=90!==b?S.width-a.Bounds.Y-f:S.height-a.Bounds.Y-f,m=a.Bounds.X),A=g,u=m,p=f,c=y),1===(C=b/90%4)?(y=f,f=c,g=S.width-u-c-.5,m=A-.5,C=90):2===C?(g=S.width-A-p-.5,m=S.height-u-c-.5,C=180):3===C?(y=f,f=c,g=u-.5,m=S.height-A-y-.5,C=270):0===C&&(g=A-.5,m=u-.5)),90!==C&&270!==C||(w=f,g=g-(f=y)/2+(y=w)/2,m+=f/2-y/2),a.allowedInteractions=a.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(a),!je(a)&&a.MarkupText&&a.MarkupText.includes("\n")&&(p=a.MarkupText.split("\n").length*a.FontSize*this.lineGap,(c=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)].height-a.Bounds.Y)<(y=y<p?p:y))&&(y=c),{author:a.Author,modifiedDate:a.ModifiedDate,subject:a.Subject,id:"freetext"+this.inputBoxCount,rotateAngle:a.Rotate,dynamicText:a.MarkupText,strokeColor:a.StrokeColor,thickness:a.Thickness,fillColor:a.FillColor,bounds:{x:g,y:m,left:g,top:m,width:f,height:y,right:a.Bounds.Right,bottom:a.Bounds.Bottom},annotName:a.AnnotName,shapeAnnotationType:"FreeText",pageIndex:t,opacity:a.Opacity,fontColor:a.FontColor,fontSize:a.FontSize,pageRotation:b,fontFamily:a.FontFamily,notes:a.MarkupText,textAlign:a.TextAlign,comments:this.pdfViewer.annotationModule.getAnnotationComments(a.Comments,a,a.Author),review:{state:a.State,stateModel:a.StateModel,modifiedDate:a.ModifiedDate,author:a.Author},font:{isBold:a.Font.Bold,isItalic:a.Font.Italic,isStrikeout:a.Font.Strikeout,isUnderline:a.Font.Underline},annotationSelectorSettings:this.getSettings(a),annotationSettings:a.AnnotationSettings,customData:this.pdfViewer.annotation.getCustomData(a),annotationAddMode:a.annotationAddMode,allowedInteractions:a.allowedInteractions,isPrint:a.IsPrint,isCommentLock:a.IsCommentLock,isReadonly:a.IsReadonly,isAddAnnotationProgrammatically:v,isTransparentSet:a.IsTransparentSet}),A=(i&&(S.id=a.AnnotName,S.previousFontSize=a.FontSize||this.fontSize),this.pdfViewer.add(S));this.pdfViewer.annotationModule.storeAnnotations(t,S,"_annotations_freetext"),this.isAddAnnotationProgramatically&&(u={opacity:S.opacity,borderColor:S.strokeColor,borderWidth:S.thickness,author:a.author,subject:a.subject,modifiedDate:a.modifiedDate,fillColor:S.fillColor,fontSize:S.fontSize,width:S.bounds.width,height:S.bounds.height,fontColor:S.fontColor,fontFamily:S.fontFamily,defaultText:S.dynamicText,fontStyle:S.font,textAlignment:S.textAlign},this.pdfViewer.fireAnnotationAdd(S.pageIndex,S.annotName,"FreeText",S.bounds,u)),this.inputBoxCount+=1,this.pdfViewer.annotation.freeTextAnnotationModule.isFreeTextValueChange=!0,this.pdfViewer.nodePropertyChange(A,{}),this.pdfViewer.annotation.freeTextAnnotationModule.isFreeTextValueChange=!1}}}},WCt.prototype.getSettings=function(e){var t=this.pdfViewer.annotationSelectorSettings;return e.AnnotationSelectorSettings?t="string"==typeof e.AnnotationSelectorSettings?JSON.parse(e.AnnotationSelectorSettings):e.AnnotationSelectorSettings:this.pdfViewer.freeTextSettings.annotationSelectorSettings&&(t=this.pdfViewer.freeTextSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(t)),t},WCt.prototype.setAnnotationType=function(e){this.pdfViewerBase.disableTextSelectionMode(),this.pdfViewer.annotationModule.isFormFieldShape=!1,"FreeText"===e&&(this.currentAnnotationMode="FreeText",this.updateTextProperties(),e=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),this.pdfViewer.drawingObject={shapeAnnotationType:"FreeText",strokeColor:this.borderColor,fillColor:this.fillColor,opacity:this.opacity,notes:"",isCommentLock:!1,thickness:this.borderWidth,borderDashArray:"0",modifiedDate:e,author:this.author,subject:this.pdfViewer.freeTextSettings.subject,font:{isBold:this.isBold,isItalic:this.isItalic,isStrikeout:this.isStrikethrough,isUnderline:this.isUnderline},textAlign:this.textAlign},this.pdfViewer.tool="Select")},WCt.prototype.modifyInCollection=function(e,t,i,n){je(i.formFieldAnnotationType)||""===i.formFieldAnnotationType?this.pdfViewer.annotationModule.isFormFieldShape=!1:this.pdfViewer.annotationModule.isFormFieldShape=!0;var o=null,r=!1,s=this.getAnnotations(t,null);if(null!==s&&i){for(var a=0;a<s.length;a++)if(i.id===s[parseInt(a.toString(),10)].id){if("bounds"===e)this.pdfViewerBase.isBounds=this.pdfViewerBase.boundsCalculation(s[parseInt(a.toString(),10)].bounds,i.wrapper.bounds),this.pdfViewerBase.isBounds&&(s[parseInt(a.toString(),10)].bounds={left:i.bounds.x,top:i.bounds.y,width:i.bounds.width,height:i.bounds.height,right:i.bounds.right,bottom:i.bounds.bottom});else if("fill"===e)s[parseInt(a.toString(),10)].fillColor=i.wrapper.children[0].style.fill;else if("stroke"===e)s[parseInt(a.toString(),10)].strokeColor=i.wrapper.children[0].style.strokeColor;else if("opacity"===e)s[parseInt(a.toString(),10)].opacity=i.wrapper.children[0].style.opacity;else if("thickness"===e)s[parseInt(a.toString(),10)].thickness=i.wrapper.children[0].style.strokeWidth;else if("notes"===e)s[parseInt(a.toString(),10)].note=i.notes;else{if("delete"===e){o=s.splice(a,1)[0];break}"dynamicText"===e?(s[parseInt(a.toString(),10)].dynamicText!==i.dynamicText&&(r=!0,this.pdfViewer.fireCommentEdit(s[parseInt(a.toString(),10)].annotName,i.dynamicText,s[parseInt(a.toString(),10)])),s[parseInt(a.toString(),10)].dynamicText=i.dynamicText):"fontColor"===e?s[parseInt(a.toString(),10)].fontColor=i.fontColor:"fontSize"===e?s[parseInt(a.toString(),10)].fontSize=i.fontSize:"fontFamily"===e?s[parseInt(a.toString(),10)].fontFamily=i.fontFamily:"textPropertiesChange"===e?s[parseInt(a.toString(),10)].font={isBold:i.font.isBold,isItalic:i.font.isItalic,isStrikeout:i.font.isStrikeout,isUnderline:i.font.isUnderline}:"textAlign"===e&&(s[parseInt(a.toString(),10)].textAlign=i.textAlign)}this.pdfViewerBase.isBounds&&(s[parseInt(a.toString(),10)].modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime()),this.pdfViewer.annotationModule.storeAnnotationCollections(s[parseInt(a.toString(),10)],t)}this.manageAnnotations(s,t)}return!n&&r&&this.pdfViewerBase.updateDocumentEditedProperty(!0),o},WCt.prototype.addInCollection=function(e,t){var i;t&&((i=this.getAnnotations(e,null))&&i.push(t),this.manageAnnotations(i,e))},WCt.prototype.saveFreeTextAnnotations=function(){for(var e=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_freetext"),t=(this.pdfViewerBase.isStorageExceed&&(e=this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_freetext"]),[]),i=0;i<this.pdfViewerBase.pageCount;i++)t[parseInt(i.toString(),10)]=[];if(e&&!this.pdfViewer.annotationSettings.skipDownload)for(var n=JSON.parse(e),o=0;o<n.length;o++){var r=[],s=n[parseInt(o.toString(),10)];if(s){for(var a=0;s.annotations.length>a;a++){this.pdfViewer.annotationModule.updateModifiedDate(s.annotations[parseInt(a.toString(),10)]),s.annotations[parseInt(a.toString(),10)].bounds=this.getBoundsBasedOnRotation(s.annotations[parseInt(a.toString(),10)].bounds,s.annotations[parseInt(a.toString(),10)].rotateAngle,s.pageIndex,s.annotations[parseInt(a.toString(),10)]),s.annotations[parseInt(a.toString(),10)].bounds=JSON.stringify(this.pdfViewer.annotation.getBounds(s.annotations[parseInt(a.toString(),10)].bounds,s.pageIndex));var l=s.annotations[parseInt(a.toString(),10)].strokeColor,l=(s.annotations[parseInt(a.toString(),10)].strokeColor=JSON.stringify(this.getRgbCode(l)),s.annotations[parseInt(a.toString(),10)].fillColor),l=(s.annotations[parseInt(a.toString(),10)].fillColor=JSON.stringify(this.getRgbCode(l)),s.annotations[parseInt(a.toString(),10)].fontColor);s.annotations[parseInt(a.toString(),10)].fontColor=JSON.stringify(this.getRgbCode(l)),s.annotations[parseInt(a.toString(),10)].vertexPoints=JSON.stringify(s.annotations[parseInt(a.toString(),10)].vertexPoints),null!==s.annotations[parseInt(a.toString(),10)].rectangleDifference&&(s.annotations[parseInt(a.toString(),10)].rectangleDifference=JSON.stringify(s.annotations[parseInt(a.toString(),10)].rectangleDifference)),s.annotations[parseInt(a.toString(),10)].padding=this.getPaddingValues(this.fontSize)}r=s.annotations}t[s.pageIndex]=r}return JSON.stringify(t)},WCt.prototype.getRotationValue=function(e,t){e=this.pdfViewerBase.pageSize[parseInt(e.toString(),10)];return!je(t)&&t||0===e.rotation?0:1===e.rotation?90:2===e.rotation?180:3===e.rotation?270:0},WCt.prototype.getBoundsBasedOnRotation=function(e,t,i,n,o){i=this.getRotationValue(i,o);return n.rotateAngle=t-i,n.pageRotation=i,90===t||-90===t||270===t||-270===t?{x:.5+(o=e.left+e.width/2-e.height/2),y:.5+(n=e.top-(e.width/2-e.height/2)),left:.5+o,top:.5+n,width:e.height,height:e.width}:{x:e.left+.5,y:e.top+.5,left:e.left+.5,top:e.top+.5,width:e.width,height:e.height}},WCt.prototype.manageAnnotations=function(e,t){var i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_freetext");(i=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_freetext"]:i)&&(i=JSON.parse(i),this.pdfViewerBase.isStorageExceed||ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_freetext"),null!=(t=this.pdfViewer.annotationModule.getPageCollection(i,t))&&i[parseInt(t.toString(),10)]&&(i[parseInt(t.toString(),10)].annotations=e),t=JSON.stringify(i),this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_freetext"]=t:ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_freetext",t))},WCt.prototype.getAnnotations=function(e,t){var i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_freetext");return(i=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_freetext"]:i)&&(i=JSON.parse(i),null!=(e=this.pdfViewer.annotationModule.getPageCollection(i,e)))&&i[parseInt(e.toString(),10)]?i[parseInt(e.toString(),10)].annotations:t},WCt.prototype.getRgbCode=function(e){var t=(e=e.match(/#([a-z0-9]+)/gi)||e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/)?e:this.pdfViewer.annotationModule.nameToHash(e)).split(",");return je(t[1])&&(t=(e=this.pdfViewer.annotationModule.getValue(e,"rgba")).split(",")),{r:parseFloat(t[0].split("(")[1]),g:parseFloat(t[1]),b:parseFloat(t[2]),a:parseFloat(t[3])}},WCt.prototype.onFocusOutInputBox=function(){var e,t,i,n,o,r,s,a,l,h,d,p,c,u,g=this.pdfViewer.allowServerDataBinding;this.pdfViewer.enableServerDataBinding(!1),this.pdfViewerBase.isFreeTextContextMenu?(this.inputBoxElement.focus(),this.isTextSelected||window.getSelection().removeAllRanges()):(this.pdfViewer.fireBeforeAddFreeTextAnnotation(this.inputBoxElement.value),this.pdfViewer.enableHtmlSanitizer&&this.inputBoxElement&&(this.inputBoxElement.value=go.sanitize(this.inputBoxElement.value)),e=this.inputBoxElement.id&&this.inputBoxElement.id.split("_freeText_")[1]&&this.inputBoxElement.id.split("_freeText_")[1].split("_")[0]?parseFloat(this.inputBoxElement.id.split("_freeText_")[1].split("_")[0]):this.pdfViewerBase.currentPageNumber-1,t=this.pdfViewerBase.getElement("_pageDiv_"+e),r=parseFloat(this.inputBoxElement.style.width),this.pdfViewer.freeTextSettings.enableAutoFit&&!this.isMaximumWidthReached&&this.isNewFreeTextAnnot&&(r=parseFloat(this.inputBoxElement.style.width),this.inputBoxElement.style.width=r-8+"px"),r=parseFloat(this.inputBoxElement.style.height),s=parseFloat(this.inputBoxElement.style.width),p=parseFloat(this.inputBoxElement.style.left),this.pdfViewerBase.isMixedSizeDocument&&(p-=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",e).offsetLeft),c=parseFloat(this.inputBoxElement.style.top),i=this.pdfViewerBase.getZoomFactor(),this.pdfViewer.isValidFreeText&&(this.inputBoxElement.value="Type Here",this.pdfViewer.isValidFreeText=!1),n=this.inputBoxElement.value,!(o=!1)===this.isNewFreeTextAnnot&&(h=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),d=this.pdfViewer.annotation.createGUID(),o=!(this.isNewFreeTextAnnot=!1),(u=this.pdfViewer.annotation.stickyNotesAnnotationModule.addComments("freeText",e+1))&&(document.getElementById(u).id=d),u=this.pdfViewer.freeTextSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(u),l=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.freeTextSettings),this.author=this.author||this.pdfViewer.freeTextSettings.author||"Guest",this.subject=this.subject||this.pdfViewer.freeTextSettings.subject||"Text Box",a=this.pdfViewer.freeTextSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,p={author:this.author,modifiedDate:h,subject:this.subject,id:"free_text"+this.inputBoxCount,rotateAngle:0,dynamicText:n,strokeColor:this.borderColor,thickness:this.borderWidth,fillColor:this.fillColor,bounds:{left:p/i,top:c/i,x:p/i,y:c/i,width:s/i,height:r/i},annotName:d,shapeAnnotationType:"FreeText",pageIndex:e,fontColor:this.fontColor,fontSize:this.fontSize,fontFamily:this.fontFamily,opacity:this.opacity,comments:[],textAlign:this.textAlign,font:{isBold:this.isBold,isItalic:this.isItalic,isStrikeout:this.isStrikethrough,isUnderline:this.isUnderline},review:{state:"Unmarked",stateModel:"None",modifiedDate:h,author:this.author},annotationSelectorSettings:u,annotationSettings:l,customData:this.pdfViewer.annotationModule.getData("FreeText"),isPrint:!(this.pdfViewer.freeTextSettings&&!je(this.pdfViewer.freeTextSettings.isPrint))||this.pdfViewer.freeTextSettings.isPrint,allowedInteractions:a,isReadonly:this.isReadonly},this.pdfViewer.enableRtl&&(p.textAlign="Right"),c=this.pdfViewer.add(p),d={left:p.bounds.x,top:p.bounds.y,width:p.bounds.width,height:p.bounds.height},h={opacity:p.opacity,borderColor:p.strokeColor,borderWidth:p.thickness,author:c.author,subject:c.subject,modifiedDate:c.modifiedDate,fillColor:p.fillColor,fontSize:p.fontSize,width:p.bounds.width,height:p.bounds.height,fontColor:p.fontColor,fontFamily:p.fontFamily,defaultText:p.dynamicText,fontStyle:p.font,textAlignment:p.textAlign},this.pdfViewer.annotation.storeAnnotations(e,p,"_annotations_freetext"),this.pdfViewer.fireAnnotationAdd(p.pageIndex,p.annotName,"FreeText",d,h),this.pdfViewer.fireCommentAdd(p.annotName,p.dynamicText,p),this.pdfViewer.annotation.addAction(e,null,c,"Addition","",c,c),this.pdfViewer.renderSelector(p.pageIndex),this.pdfViewer.clearSelection(p.pageIndex),this.pdfViewerBase.updateDocumentEditedProperty(!0),this.selectedAnnotation=c),this.isInuptBoxInFocus=!1,this.selectedAnnotation&&this.pdfViewer.selectedItems.annotations&&(u=90===this.selectedAnnotation.pageRotation||270===this.selectedAnnotation.pageRotation,r=parseFloat(u?this.inputBoxElement.style.width:this.inputBoxElement.style.height)/i,s=parseFloat(u?this.inputBoxElement.style.height:this.inputBoxElement.style.width)/i,l=void 0,0<(a=r-this.selectedAnnotation.bounds.height)&&(l=0<(l=this.selectedAnnotation.wrapper.offsetY+a/2)?l:void 0),d=void 0,d=0<(h=s-this.selectedAnnotation.bounds.width)?0<(d=this.selectedAnnotation.wrapper.offsetX+h/2)?d:void 0:(h=Math.abs(h),this.selectedAnnotation.wrapper.offsetX-h/2),this.selectedAnnotation.bounds.width=s,this.selectedAnnotation.bounds.height=r,p=0,p=parseFloat(this.inputBoxElement.style.fontSize)/i/(this.defaultFontSize/2),this.selectedAnnotation.wrapper.children[1].margin.left=this.freeTextPaddingLeft,this.selectedAnnotation.wrapper.children[1].margin.top=parseFloat(this.inputBoxElement.style.paddingTop)/i+p,this.pdfViewer.annotation.modifyDynamicTextValue(n,this.selectedAnnotation.annotName),this.selectedAnnotation.dynamicText=n,this.modifyInCollection("dynamicText",e,this.selectedAnnotation,o),this.modifyInCollection("bounds",e,this.selectedAnnotation,o),this.pdfViewer.nodePropertyChange(this.selectedAnnotation,{bounds:{width:this.selectedAnnotation.bounds.width,height:this.selectedAnnotation.bounds.height,y:l,x:d}}),(c=document.getElementById(this.selectedAnnotation.annotName))&&c.childNodes&&(c.childNodes[0].ej2_instances?c.childNodes[0].ej2_instances[0].value=n:c.childNodes[0].childNodes&&c.childNodes[0].childNodes[1].ej2_instances&&(c.childNodes[0].childNodes[1].ej2_instances[0].value=n)),this.pdfViewer.renderSelector(this.selectedAnnotation.pageIndex,this.selectedAnnotation.annotationSelectorSettings)),this.inputBoxElement.parentElement&&(t&&t.id===this.inputBoxElement.parentElement.id?t:this.inputBoxElement.parentElement).removeChild(this.inputBoxElement),u=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",e),this.pdfViewer.renderDrawing(u,e),this.inputBoxCount+=1),this.pdfViewer.enableServerDataBinding(g,!0)},WCt.prototype.onKeyDownInputBox=function(e){var t;18!==e.which&&(t=this,(9===e.which||je(this.pdfViewer.selectedItems.annotations[0])&&!this.isNewFreeTextAnnot)&&e.preventDefault(),this.selectedAnnotation=this.pdfViewer.selectedItems.annotations&&this.isNewFreeTextAnnot?this.pdfViewer.selectedItems.annotations[0]:this.selectedAnnotation,setTimeout(function(){t.defaultHeight<t.inputBoxElement.scrollHeight&&parseInt(t.inputBoxElement.style.height,10)<t.inputBoxElement.scrollHeight?t.updateFreeTextAnnotationSize(!0):t.updateFreeTextAnnotationSize(!1)},0))},WCt.prototype.updateFreeTextAnnotationSize=function(e){var t,i,n=this,o=n.pdfViewer.freeTextSettings.enableAutoFit,r=(o?this.autoFitFreeText():this.isMaximumWidthReached=!0,this.isMaximumWidthReached&&(s=n.inputBoxElement.getBoundingClientRect().height,e||n.inputBoxElement.readOnly||(n.inputBoxElement.style.height="auto"),e=n.inputBoxElement.getBoundingClientRect().height-s,r=parseFloat(n.inputBoxElement.style.fontSize),n.inputBoxElement.style.height=n.inputBoxElement.readOnly?n.inputBoxElement.style.height:n.inputBoxElement.scrollHeight+r/2+"px",n.inputBoxElement.style.height=e<0&&!n.inputBoxElement.readOnly?s+"px":n.inputBoxElement.style.height),n.pdfViewerBase.getZoomFactor()),e=this.selectedAnnotation&&(90===this.selectedAnnotation.pageRotation||270===this.selectedAnnotation.pageRotation),s=parseFloat(e?this.inputBoxElement.style.width:this.inputBoxElement.style.height)/r,e=parseFloat(e?this.inputBoxElement.style.height:this.inputBoxElement.style.width)/r,r=0;this.selectedAnnotation&&(t=void 0,i=(i=0)<(t=90===this.selectedAnnotation.pageRotation||270===this.selectedAnnotation.pageRotation?e-n.selectedAnnotation.bounds.width:s-n.selectedAnnotation.bounds.height)?n.selectedAnnotation.wrapper.offsetY+t/2:(t=Math.abs(t),n.selectedAnnotation.wrapper.offsetY-t/2),o&&(r=0<(t=e-n.selectedAnnotation.bounds.width)?n.selectedAnnotation.wrapper.offsetX+t/2:(t=Math.abs(t),n.selectedAnnotation.wrapper.offsetX-t/2)),n.selectedAnnotation.bounds.width=e,n.selectedAnnotation.bounds.height=s,o?n.pdfViewer.nodePropertyChange(n.selectedAnnotation,{bounds:{width:n.selectedAnnotation.bounds.width,height:n.selectedAnnotation.bounds.height,y:i,x:r}}):n.pdfViewer.nodePropertyChange(n.selectedAnnotation,{bounds:{width:n.selectedAnnotation.bounds.width,height:n.selectedAnnotation.bounds.height,y:i}}),n.pdfViewer.renderSelector(n.selectedAnnotation.pageIndex,this.selectedAnnotation.annotationSelectorSettings))},WCt.prototype.autoFitFreeText=function(e,t){var i=this.pdfViewerBase.currentPageNumber-1,n=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",i).getContext("2d"),o=this.inputBoxElement.style.fontSize,r=(this.pdfViewer.freeTextSettings.fontStyle===ACt.Bold||"bold"===this.inputBoxElement.style.fontWeight?n.font="bold "+o+" "+this.inputBoxElement.style.fontFamily:n.font=o+" "+this.inputBoxElement.style.fontFamily,""),s=this.inputBoxElement.value;if(-1<s.indexOf("\n")){for(var a=s.split("\n"),l=0;l<a.length;l++){var h=n.measureText(a[parseInt(l.toString(),10)]),d=n.measureText(r);h.width>d.width&&(r=a[parseInt(l.toString(),10)])}this.isMaximumWidthReached=!0}else r=s,this.isMaximumWidthReached=!1;var p,s=n.measureText(r),c=(o=parseFloat(this.inputBoxElement.style.fontSize))+o/2,t=(this.isNewFreeTextAnnot?(p=Math.ceil(s.width+18),this.inputBoxElement.style.height=c+"px",this.inputBoxElement.style.top=t-c/2+"px"):p=Math.ceil(s.width)+o+Math.ceil(4),this.inputBoxElement.style.width=p+"px",this.pdfViewerBase.getPageWidth(i)-parseFloat(this.inputBoxElement.style.left));parseFloat(this.inputBoxElement.style.width)>t&&(this.isMaximumWidthReached=!0,this.isNewAddedAnnot&&e?(this.inputBoxElement.style.width=(p-=8)+"px",c=e+p*this.pdfViewerBase.getZoomFactor(),s=parseFloat(this.inputBoxElement.style.left),c>=this.pdfViewerBase.getPageWidth(i)&&(s=this.pdfViewerBase.getPageWidth(i)-p),this.inputBoxElement.style.left=s+"px"):this.inputBoxElement.style.width=t+"px")},WCt.prototype.onMouseUpInputBox=function(e){var t=e.target;this.selectionStart=0,this.selectionEnd=0,3===e.which&&t&&(this.selectionStart=t.selectionStart,this.selectionEnd=t.selectionEnd),3===e.which&&null!==window.getSelection()&&""!==window.getSelection().toString()?this.isTextSelected=!0:this.isTextSelected=!1},WCt.prototype.addInuptElemet=function(e,t,i){void 0===t&&(t=null),this.currentPosition=[],je(i)&&(i=this.pdfViewerBase.currentPageNumber-1),t&&(i=t.pageIndex),N&&null===t&&0===this.pdfViewer.selectedItems.annotations.length&&this.updateTextProperties(),this.inputBoxElement.id=this.pdfViewer.element.id+"_freeText_"+i+"_"+this.inputBoxCount;var n=this.pdfViewerBase.getElement("_pageDiv_"+i),o=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",i),r=this.pdfViewerBase.getZoomFactor(),i=(this.inputBoxElement.value=t&&t.dynamicText?t.dynamicText:this.defaultText,this.inputBoxElement.style.boxSizing="border-box",this.inputBoxElement.style.left=e.x+"px",this.inputBoxElement.style.top=e.y-this.defaultHeight*r/2+"px",this.pdfViewer.freeTextSettings.enableAutoFit?this.inputBoxElement.style.wordBreak="break-all":this.inputBoxElement.style.wordBreak="break-word",t?this.applyFreetextStyles(r,t.isReadonly):this.applyFreetextStyles(r),this.isBold?this.inputBoxElement.style.fontWeight="bold":this.inputBoxElement.style.fontWeight="normal",this.isItalic?this.inputBoxElement.style.fontStyle="italic":this.inputBoxElement.style.fontStyle="normal",this.inputBoxElement.style.textDecoration="none",this.isUnderline&&(this.inputBoxElement.style.textDecoration="underline"),this.isStrikethrough&&(this.inputBoxElement.style.textDecoration="line-through"),this.pdfViewer.enableRtl?(this.inputBoxElement.style.textAlign="right",this.inputBoxElement.style.direction="rtl",this.inputBoxElement.style.left=e.x-this.defautWidth*r/2):this.inputBoxElement.style.textAlign=this.textAlign.toLowerCase(),this.inputBoxElement.style.borderColor=this.borderColor,this.inputBoxElement.style.color=this.fontColor,this.inputBoxElement.style.background=this.fillColor,t&&t.wrapper&&t.wrapper.children[0]&&(this.inputBoxElement.style.opacity=t.wrapper.children[0].style.opacity),!0===this.isNewFreeTextAnnot&&this.pdfViewer.clearSelection(i),t&&t.wrapper&&t.wrapper.bounds&&((i=t.wrapper.bounds).left&&(this.inputBoxElement.style.left=i.left*r+"px"),i.top&&(this.inputBoxElement.style.top=i.top*r+"px"),this.inputBoxElement.style.height=i.height?i.height*r+"px":this.defaultHeight*r+"px",this.inputBoxElement.style.width=i.width?i.width*r+"px":this.defautWidth*r+"px",this.selectedAnnotation=t,this.previousText=this.selectedAnnotation.dynamicText,this.selectedAnnotation.dynamicText="",this.inputBoxElement.style.borderColor=this.selectedAnnotation.strokeColor,this.inputBoxElement.style.color=this.selectedAnnotation.fontColor,this.inputBoxElement.style.background=this.selectedAnnotation.fillColor,!0===this.selectedAnnotation.font.isBold&&(this.inputBoxElement.style.fontWeight="bold"),!0===this.selectedAnnotation.font.isItalic&&(this.inputBoxElement.style.fontStyle="italic"),!0===this.selectedAnnotation.font.isUnderline&&(this.inputBoxElement.style.textDecoration="underline"),!0===this.selectedAnnotation.font.isStrikeout&&(this.inputBoxElement.style.textDecoration="line-through"),this.pdfViewer.enableRtl?(this.inputBoxElement.style.textAlign="right",this.inputBoxElement.style.direction="rtl"):this.selectedAnnotation.textAlign&&(this.inputBoxElement.style.textAlign=this.selectedAnnotation.textAlign),this.inputBoxElement.style.fontSize=this.selectedAnnotation.fontSize*r+"px",this.inputBoxElement.style.fontFamily=this.selectedAnnotation.fontFamily,this.pdfViewer.nodePropertyChange(this.selectedAnnotation,{})),this.pdfViewerBase.isMixedSizeDocument&&(this.inputBoxElement.style.left=parseFloat(this.inputBoxElement.style.left)+o.offsetLeft+"px"),this.pdfViewer.annotation.freeTextAnnotationModule.isFreeTextValueChange=!1,this.pdfViewer.freeTextSettings.enableAutoFit&&this.autoFitFreeText(e.x,e.y),this.inputBoxElement.style.paddingLeft=this.freeTextPaddingLeft*r+"px",this.inputBoxElement.style.paddingTop=parseFloat(this.inputBoxElement.style.fontSize)/r/this.defaultFontSize/r*this.freeTextPaddingTop+"px",parseFloat(this.inputBoxElement.style.fontSize)/r/(this.defaultFontSize/2));this.inputBoxElement.style.paddingTop=parseFloat(this.inputBoxElement.style.paddingTop)-i+"px",n.appendChild(this.inputBoxElement),!this.pdfViewer.freeTextSettings.enableAutoFit&&this.defaultHeight*r<this.inputBoxElement.scrollHeight&&parseInt(this.inputBoxElement.style.height,10)<this.inputBoxElement.scrollHeight&&(this.inputBoxElement.style.height=this.inputBoxElement.scrollHeight+"px"),this.isInuptBoxInFocus=!0,this.inputBoxElement.focus(),!0!==this.isNewFreeTextAnnot&&this.inputBoxElement.value!==this.defaultText||(this.inputBoxElement.select(),this.pdfViewerBase.isFreeTextSelected=!0),this.currentPosition.push(parseInt(this.inputBoxElement.style.left,10)/r,parseInt(this.inputBoxElement.style.top,10)/r,parseInt(this.inputBoxElement.style.width,10)/r,parseInt(this.inputBoxElement.style.height,10)/r)},WCt.prototype.applyFreetextStyles=function(e,t){this.inputBoxElement.style.height=this.defaultHeight*e+"px",this.inputBoxElement.style.width=this.defautWidth*e+"px",this.inputBoxElement.style.borderWidth=this.borderWidth*e+"px",this.inputBoxElement.style.fontSize=this.fontSize*e+"px",this.inputBoxElement.style.fontFamily=this.fontFamily,this.inputBoxElement.readOnly=je(t)?this.isReadonly:t},WCt.prototype.copySelectedText=function(){if(null!==window.getSelection()){this.selectedText=window.getSelection().toString();var e=document.createElement("textarea");e.contentEditable="true",e.textContent=this.selectedText,e.style.position="fixed",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch(e){console.warn("Copy to clipboard failed.",e)}finally{e&&document.body.removeChild(e)}}},WCt.prototype.pasteSelectedText=function(e){""!==this.selectedText&&e&&(t=e.value,e.value=t.slice(0,this.selectionStart)+this.selectedText+t.slice(this.selectionEnd,t.length));var t,e=event;this.onKeyDownInputBox(e)},WCt.prototype.cutSelectedText=function(e){if(null!==window.getSelection()){var t=e.value,t=(this.selectedText=window.getSelection().toString(),e.value=t.slice(0,e.selectionStart)+t.slice(e.selectionEnd),document.createElement("textarea"));t.contentEditable="true",t.textContent=this.selectedText,t.style.position="fixed",document.body.appendChild(t),t.select();try{document.execCommand("cut")}catch(e){console.warn("Copy to clipboard failed.",e)}finally{t&&document.body.removeChild(t)}}},WCt.prototype.saveImportedFreeTextAnnotations=function(e,t){var i=e;if(i.AnnotType){var n=null;if(i.VertexPoints)for(var n=[],o=0;o<i.VertexPoints.length;o++){var r={x:i.VertexPoints[parseInt(o.toString(),10)].X,y:i.VertexPoints[parseInt(o.toString(),10)].Y};n.push(r)}i.AnnotationSettings=i.AnnotationSettings||this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.freeTextSettings),i.allowedInteractions=i.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(i);var e=je(i.Bounds.X)?i.Bounds.x:i.Bounds.X,s=je(i.Bounds.Y)?i.Bounds.y:i.Bounds.Y,a=i.Bounds.Width||i.Bounds.width,l=i.Bounds.Height||i.Bounds.height,e={author:i.Author,allowedInteractions:i.allowedInteractions,modifiedDate:i.ModifiedDate,subject:i.Subject,id:"freetext",rotateAngle:i.Rotate,dynamicText:i.MarkupText,strokeColor:i.StrokeColor,thickness:i.Thickness,fillColor:i.FillColor,bounds:{x:e,y:s,left:e,top:s,width:a,height:l,right:i.Bounds.Right,bottom:i.Bounds.Bottom},annotName:i.AnnotName,shapeAnnotationType:"FreeText",pageIndex:t,opacity:i.Opacity,fontColor:i.FontColor,fontSize:i.FontSize,fontFamily:i.FontFamily,notes:i.MarkupText,textAlign:i.TextAlign,comments:this.pdfViewer.annotationModule.getAnnotationComments(i.Comments,i,i.Author),review:{state:i.State,stateModel:i.StateModel,modifiedDate:i.ModifiedDate,author:i.Author},font:{isBold:i.Font.Bold,isItalic:i.Font.Italic,isStrikeout:i.Font.Strikeout,isUnderline:i.Font.Underline},annotationSelectorSettings:this.getSettings(i),annotationSettings:i.AnnotationSettings,customData:this.pdfViewer.annotation.getCustomData(i),isPrint:i.IsPrint,isCommentLock:i.IsCommentLock,isReadonly:i.IsReadonly};this.pdfViewer.annotationModule.storeAnnotations(t,e,"_annotations_freetext")}},WCt.prototype.updateFreeTextAnnotationCollections=function(e,t){var i=e;if(i.annotationAddMode=this.pdfViewer.annotationModule.findAnnotationMode(i,t,i.AnnotType),i.AnnotType){var n=null;if(i.VertexPoints)for(var n=[],o=0;o<i.VertexPoints.length;o++){var r={x:i.VertexPoints[parseInt(o.toString(),10)].X,y:i.VertexPoints[parseInt(o.toString(),10)].Y};n.push(r)}i.AnnotationSettings=i.AnnotationSettings||this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.freeTextSettings),i.IsLocked&&(i.AnnotationSettings.isLock=i.IsLocked),i.allowedInteractions=i.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(i);var e=i.Bounds.X||i.Bounds.x,s=i.Bounds.Y||i.Bounds.y,a=i.Bounds.Width||i.Bounds.width,l=i.Bounds.Height||i.Bounds.height;return{author:i.Author,allowedInteractions:i.allowedInteractions,modifiedDate:i.ModifiedDate,subject:i.Subject,id:"freetext",rotateAngle:i.Rotate,dynamicText:i.MarkupText,strokeColor:i.StrokeColor,thickness:i.Thickness,fillColor:i.FillColor,bounds:{x:e,y:s,left:e,top:s,width:a,height:l,right:i.Bounds.Right,bottom:i.Bounds.Bottom},annotationId:i.AnnotName,shapeAnnotationType:"FreeText",pageIndex:t,opacity:i.Opacity,fontColor:i.FontColor,fontSize:i.FontSize,fontFamily:i.FontFamily,notes:i.MarkupText,comments:this.pdfViewer.annotationModule.getAnnotationComments(i.Comments,i,i.Author),review:{state:i.State,stateModel:i.StateModel,modifiedDate:i.ModifiedDate,author:i.Author},customData:this.pdfViewer.annotation.getCustomData(i),font:{isBold:i.Font.Bold,isItalic:i.Font.Italic,isStrikeout:i.Font.Strikeout,isUnderline:i.Font.Underline},pageNumber:t,annotationSettings:i.AnnotationSettings,isCommentLock:i.IsCommentLock,isReadonly:i.IsReadonly,isPrint:i.IsPrint}}},WCt.prototype.updateAddAnnotationDetails=function(e,t){t=e?e.offset||{x:1,y:1}:(e={offset:{x:1,y:1},pageNumber:0,width:void 0,height:void 0}).offset;var i=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),n=this.pdfViewer.annotation.createGUID(),o=e.fontStyle||ACt.None,r=this.pdfViewer.freeTextSettings.annotationSelectorSettings,s=(this.pdfViewerBase.updateSelectorSettings(r),this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.freeTextSettings)),a=this.pdfViewer.freeTextSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,l=(e.author=e.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("freeText",s.annotationSubType),s.isLock=e.isLock||s.isLock,(this.pdfViewer.freeTextSettings.isLock||this.pdfViewer.annotationSettings.isLock||this.pdfViewer.freeTextSettings.isReadonly)&&(e.isReadonly=!0),s.minHeight=e.minHeight||0,s.minWidth=e.minWidth||0,s.maxWidth=e.maxWidth||0,s.maxHeight=e.maxHeight||0,e.width=e.width||150,e.height=e.height||24.6,[]),a={AllowedInteractions:e.allowedInteractions||a,AnnotName:n,AnnotType:"freeText",AnnotationFlags:"Default",AnnotationIntent:null,AnnotationSelectorSettings:e.annotationSelectorSettings||r,AnnotationSettings:s,Author:e.author||"Guest",Border:{HorizontalRadius:0,VerticalRadius:0,Width:je(e.borderWidth)?1:e.borderWidth},BorderColor:{IsEmpty:!0,B:255,Blue:1,C:0,G:255},Bounds:{X:t.x,Y:t.y,Width:e.width,Height:e.height,Left:t.x,Top:t.y,Right:t.x+e.width,Bottom:t.y+e.height},CalloutLines:null,Color:{IsEmpty:!1,B:51,Blue:.2,C:0,G:255},Comments:null,CreatedDate:i,CustomData:e.customData||null,ExistingCustomData:null,FillColor:e.fillColor||"#ffffff00",Flatten:!1,FlattenPopups:!1,Font:{Bold:(o&ACt.Bold)===ACt.Bold,Italic:(o&ACt.Italic)===ACt.Italic,Strikeout:(o&ACt.Strikethrough)===ACt.Strikethrough,Underline:(o&ACt.Underline)===ACt.Underline},FontColor:e.fontColor||"#000",FontFamily:e.fontFamily||"Helvetica",FontSize:e.fontSize||16,FreeTextAnnotationType:"Text Box",InnerColor:null,IsCommentLock:!1,IsLock:e.isLock||!1,IsPrint:!!je(e.isPrint)||e.isPrint,Layer:null,LineEndingStyle:"OpenArrow",Location:null,MarkupText:e.defaultText||"Type Here",ModifiedDate:"",Name:n,Opacity:e.opacity||1,Page:null,PageTags:null,ReviewHistory:null,Rotate:0,IsReadonly:e.isReadonly||!1,State:"Unmarked",StateModel:"None",StrokeColor:e.borderColor||"#ffffff00",Subject:e.subject||"Text Box",Text:e.defaultText||"Type Here",TextAlign:e.textAlignment||"Left",TextMarkupColor:null,Thickness:je(e.borderWidth)?1:e.borderWidth,isAddAnnotationProgramatically:!0};return l[0]=a,{freeTextAnnotation:l}},WCt.prototype.getPaddingValues=function(e){return[4,e/16*3]},WCt.prototype.addInputInZoom=function(e){var t=this.pdfViewerBase.getZoomFactor();this.inputBoxElement.style.left=e.x*t+"px",this.inputBoxElement.style.top=e.y*t+"px",this.inputBoxElement.style.height=e.height*t+"px",this.inputBoxElement.style.width=e.width*t+"px",this.inputBoxElement.style.borderWidth=this.borderWidth*t+"px",this.inputBoxElement.style.fontSize=this.fontSize*t+"px"};var jCt=WCt;function WCt(e,t){this.inputBoxCount=0,this.isFreeTextValueChange=!1,this.isAddAnnotationProgramatically=!1,this.isInuptBoxInFocus=!1,this.freeTextPageNumbers=[],this.selectedText="",this.isTextSelected=!1,this.selectionStart=0,this.selectionEnd=0,this.isBold=!1,this.isItalic=!1,this.isUnderline=!1,this.isStrikethrough=!1,this.isReadonly=!1,this.isMaximumWidthReached=!1,this.freeTextPaddingLeft=4,this.freeTextPaddingTop=5,this.defaultFontSize=16,this.lineGap=1.5,this.previousText="Type Here",this.currentPosition=[],this.pdfViewer=e,this.pdfViewerBase=t,this.updateTextProperties(),this.inputBoxElement=document.createElement("textarea"),this.inputBoxElement.style.position="absolute",this.inputBoxElement.style.Width=this.defautWidth,this.inputBoxElement.style.Height=this.defaultHeight,this.inputBoxElement.style.zIndex="5",this.inputBoxElement.style.fontSize=this.fontSize+"px",this.inputBoxElement.className="free-text-input",this.inputBoxElement.style.resize="none",this.inputBoxElement.style.borderColor=this.borderColor,this.inputBoxElement.style.background=this.fillColor,this.inputBoxElement.style.borderStyle=this.borderStyle,this.inputBoxElement.style.borderWidth=this.borderWidth+"px",this.inputBoxElement.style.padding=this.padding,this.inputBoxElement.style.paddingLeft=this.freeTextPaddingLeft+"px",this.inputBoxElement.style.paddingTop=this.freeTextPaddingTop*(parseFloat(this.inputBoxElement.style.fontSize)/this.defaultFontSize)+"px",this.inputBoxElement.style.borderRadius="2px",this.inputBoxElement.style.verticalAlign="middle",this.inputBoxElement.style.fontFamily=this.fontFamily,this.inputBoxElement.style.color=this.pdfViewer.freeTextSettings.fontColor||"#000",this.inputBoxElement.style.overflow="hidden",this.inputBoxElement.style.wordBreak=this.wordBreak,this.inputBoxElement.readOnly=this.isReadonly,this.inputBoxElement.addEventListener("focusout",this.onFocusOutInputBox.bind(this)),this.inputBoxElement.addEventListener("keydown",this.onKeyDownInputBox.bind(this)),this.inputBoxElement.addEventListener("mouseup",this.onMouseUpInputBox.bind(this)),this.freeTextPageNumbers=[]}UCt.prototype.editLabel=function(e,t){var i=this.pdfViewerBase.currentPageNumber-1,i=this.pdfViewerBase.getElement("_pageDiv_"+i),n=this.pdfViewerBase.getZoomFactor();this.inputBoxElement.value=t.labelContent,this.inputBoxElement.select(),t.labelContent="",this.pdfViewer.nodePropertyChange(t,{}),this.inputBoxElement.style.left=e.x*n+"px",this.inputBoxElement.style.top=e.y*n+"px",this.inputBoxElement.style.maxHeight=this.maxHeight*n+"px",this.inputBoxElement.style.maxWidth=this.maxWidth*n+"px",this.inputBoxElement.style.fontSize=this.fontSize*n+"px",this.inputBoxElement.style.textAlign="center",t&&t.wrapper&&t.wrapper.bounds&&(this.inputBoxElement.style.width=t.wrapper.bounds.width?t.wrapper.bounds.width*n+1+"px":this.maxWidth*n+"px",e=(e=parseFloat(this.inputBoxElement.style.width))>this.maxWidth*n?this.maxWidth*n:e,t.wrapper.bounds.left&&(this.inputBoxElement.style.left=(t.wrapper.bounds.left+t.wrapper.bounds.width/2-e/(2*n))*n+"px"),t.wrapper.bounds.top&&("Line"===t.shapeAnnotationType||"LineWidthArrowHead"===t.shapeAnnotationType||"Distance"===t.shapeAnnotationType||"Polygon"===t.shapeAnnotationType?this.inputBoxElement.style.top=(t.wrapper.bounds.top+t.wrapper.bounds.height/2-this.maxHeight)*n+"px":this.inputBoxElement.style.top=(t.wrapper.bounds.top+t.wrapper.bounds.height/2-this.maxHeight/2)*n+"px"),this.inputBoxElement.maxLength=t.labelMaxLength,this.inputBoxElement.fontFamily=t.fontFamily,this.inputBoxElement.style.color=t.fontColor,this.inputBoxElement.style.border="1px solid #ffffff00",this.inputBoxElement.style.padding="2px",this.inputBoxElement.style.background=t.labelFillColor),i.appendChild(this.inputBoxElement),this.isInFocus=!0,this.inputBoxElement.focus()},UCt.prototype.onFocusOutInputBox=function(){var e=this.pdfViewerBase.currentPageNumber-1,t=this.pdfViewerBase.getElement("_pageDiv_"+e),i=(parseFloat(this.inputBoxElement.style.height),parseFloat(this.inputBoxElement.style.width),this.isInFocus=!1,this.pdfViewer.selectedItems.annotations[0]),i=(i&&(this.pdfViewerBase.getZoomFactor(),this.pdfViewerBase.getZoomFactor(),i.labelContent=this.inputBoxElement.value,i.notes=this.inputBoxElement.value,"Rectangle"===i.shapeAnnotationType||"Ellipse"===i.shapeAnnotationType||"Line"===i.shapeAnnotationType||"LineWidthArrowHead"===i.shapeAnnotationType?this.pdfViewer.annotation.shapeAnnotationModule.modifyInCollection("labelContent",e,i,null):"Radius"===i.shapeAnnotationType&&i.measureType&&this.pdfViewer.annotation.measureAnnotationModule.modifyInCollection("labelContent",e,i),this.pdfViewer.nodePropertyChange(i,{}),this.pdfViewer.renderSelector(i.pageIndex,this.pdfViewer.annotationSelectorSettings),i=document.getElementById(this.pdfViewer.selectedItems.annotations[0].annotName))&&i.childNodes&&"label"!==this.inputBoxElement.value&&(i.childNodes[0].ej2_instances?i.childNodes[0].ej2_instances[0].value=this.inputBoxElement.value:i.childNodes[0].childNodes&&i.childNodes[0].childNodes[1].ej2_instances&&(i.childNodes[0].childNodes[1].ej2_instances[0].value=this.inputBoxElement.value)),t.removeChild(this.inputBoxElement),this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",e));this.pdfViewer.renderDrawing(i,e)},UCt.prototype.calculateLabelBounds=function(e,t){var i,n,o,r={};return e&&(void(o=n=i=0)===t&&(t=this.pdfViewerBase.currentPageNumber-1),t=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)].rotation,e.width&&(o=0<(o=e.width/2)&&o<151?o:151),e.left&&(n=e.left+e.width/2-o/2),e.top&&(i=e.top+e.height/2-12.3),r=1===t||3===t?{left:n,top:i,width:o-24.6+o/2,height:49.2+o,right:0,bottom:0}:{left:n,top:i,width:o,height:24.6,right:0,bottom:0}),r},UCt.prototype.calculateLabelBoundsFromLoadedDocument=function(e){var t,i,n,o={};return e&&(n=i=t=0,e.Width&&(n=0<(n=e.Width/2)&&n<151?n:151),o={left:i=e.Left?e.Left+e.Width/2-n/2:i,top:t=e.Top?e.Top+e.Height/2-12.3:t,width:n,height:24.6,right:0,bottom:0}),o};var QCt=UCt;function UCt(e,t){this.pdfViewer=e,this.pdfViewerBase=t,this.inputBoxElement=document.createElement("input"),this.inputBoxElement.addEventListener("focusout",this.onFocusOutInputBox.bind(this)),this.maxHeight=24.6,this.maxWidth=151,this.fontSize=16,this.isInFocus=!1,this.inputBoxElement.style.position="absolute",this.inputBoxElement.style.fontFamily="Helvetica"}var qCt=new Ti;function GCt(e,t,i){if(je(t)||""===t)return"";switch(e){case"Color":var n=t,o=7<n.length?n.slice(0,-2):n;break;case"Date":r=i.format,o=qCt.formatDate(t,{format:r,type:e,skeleton:N?"d":"yMd"});break;case"DateRange":var r=i.format,n=t;o=qCt.formatDate(n[0],{format:r,type:e,skeleton:N?"d":"yMd"})+" - "+qCt.formatDate(n[1],{format:r,type:e,skeleton:N?"d":"yMd"});break;case"DateTime":o=je(r=i.format)||""===r?qCt.formatDate(t,{format:r,type:e,skeleton:N?"d":"yMd"})+" "+qCt.formatDate(t,{format:r,type:e,skeleton:N?"t":"hm"}):qCt.formatDate(t,{format:r,type:e,skeleton:N?"d":"yMd"});break;case"Time":r=i.format,o=qCt.formatDate(t,{format:r,type:e,skeleton:N?"t":"hm"});break;case"Numeric":r=je(i.format)?"n2":i.format;n=je(t)?null:"number"==typeof t?t:qCt.parseNumber(t);o=qCt.formatNumber(n,{format:r});break;default:o=t.toString()}return o}function YCt(e,t){return je(t)||""===t||("Date"!==e&&"Time"!==e&&"DateTime"!==e||"string"!=typeof t?"DateRange"===e&&("object"==typeof t&&"string"==typeof t[0]?t=[new Date(t[0]),new Date(t[1])]:"string"==typeof t&&(e=t.split("-"),t=[new Date(e[0]),new Date(e[1])])):t=new Date(t)),t}function XCt(e){for(var t=[],i=e.length-1;0<=i;i--)t.unshift(["&#",e[i].charCodeAt(0),";"].join(""));return t.join("")}var KCt="render",JCt="update",ZCt="destroy",$Ct="set-focus",eSt="access-value",tSt="destroy-modules",iSt="show-popup";nSt=function(e,t){return(nSt=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])}))(e,t)};var nSt,oSt,W$e=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Det=(function(e,t){function i(){this.constructor=e}nSt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(rSt,oSt=n),W$e([e("")],rSt.prototype,"title",void 0),W$e([e(null)],rSt.prototype,"model",void 0),rSt);function rSt(){return null!==oSt&&oSt.apply(this,arguments)||this}var sSt={AutoComplete:"auto-complete",Color:"color-picker",ComboBox:"combo-box",DateRange:"date-range-picker",MultiSelect:"multi-select",RTE:"rte",Slider:"slider",Time:"time-picker"},aSt={Click:{editAreaClick:"Click to edit"},DblClick:{editAreaDoubleClick:"Double click to edit"},EditIconClick:{editAreaClick:"Click to edit"}},lSt="e-inplaceeditor",hSt="e-inplaceeditor-tip",dSt="e-editable-value-wrapper",pSt="e-editable-value",cSt="e-editable-overlay-icon",uSt="e-editable-tip-title",gSt="e-editable-title",mSt="e-editable-inline",fSt="e-editable-popup",ySt="e-editable-wrapper",vSt="e-editable-loading",bSt="e-editable-form",wSt="e-component-group",CSt="e-editable-component",SSt="e-editable-action-buttons",ASt="e-editable-error",xSt="e-editable-elements",ISt="e-editable-open",TSt="e-btn-save",ESt="e-btn-cancel",DSt="e-rte-spin-wrap",MSt="e-control-overlay",kSt="e-disable",PSt="e-show",BSt="e-hide",FSt="e-rtl",LSt="e-error",RSt="e-loading";OSt=function(e,t){return(OSt=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])}))(e,t)};var OSt,NSt,h=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},VSt=(function(e,t){function i(){this.constructor=e}OSt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(_St,NSt=Ji),_St.prototype.initializeValue=function(){this.initRender=!0,this.isTemplate=!1,this.isVue=!1,this.isExtModule=!1,this.submitBtn=void 0,this.cancelBtn=void 0,this.isClearTarget=!1,this.btnElements=void 0,this.dataManager=void 0,this.oldValue=void 0,this.divComponents=["RTE","Slider"],this.clearComponents=["AutoComplete","Mask","Text"],this.dateType=["Date","DateTime","Time"],this.inputDataEle=["Date","DateTime","DateRange","Time","Numeric"],this.dropDownEle=["AutoComplete","ComboBox","DropDownList","MultiSelect"],this.moduleList=["AutoComplete","Color","ComboBox","DateRange","MultiSelect","RTE","Slider","Time"]},_St.prototype.preRender=function(){this.initializeValue(),this.onScrollResizeHandler=this.scrollResizeHandler.bind(this),je(this.model)&&this.setProperties({model:{}},!0),this.titleEle=this.createElement("div",{className:gSt}),!je(this.popupSettings.model)&&this.popupSettings.model.afterOpen&&(this.afterOpenEvent=this.popupSettings.model.afterOpen)},_St.prototype.render=function(){je(this.element.getAttribute("tabindex"))&&(this.disabled?this.element.setAttribute("tabindex","-1"):this.element.setAttribute("tabindex","0")),this.checkIsTemplate(),this.disable(this.disabled),this.updateAdaptor(),this.appendValueElement(),this.updateValue(),"Never"===this.textOption?this.renderValue(this.checkValue(GCt(this.type,this.value,this.model))):this.renderInitialValue(),this.wireEvents(),this.setRtl(this.enableRtl),this.enableEditor(this.enableEditMode,!0),this.setClass("add",this.cssClass),this.renderComplete()},_St.prototype.setClass=function(e,t){if(!this.isEmpty(t))for(var i=t.split(" "),n=0;n<i.length;n++)""!==i[n].trim()&&("add"===e?U:q)([this.element],[i[n]])},_St.prototype.appendValueElement=function(){this.valueWrap=this.createElement("div",{id:this.element.id+"_wrap",className:dSt}),N||(this.element.innerHTML=""),this.valueEle=this.createElement("span",{className:pSt}),this.editIcon=this.createElement("span",{className:cSt+" e-icons",attrs:{title:this.getLocale({editIcon:"Click to edit"},"editIcon")}}),this.valueWrap.appendChild(this.valueEle),this.valueWrap.appendChild(this.editIcon),this.element.appendChild(this.valueWrap)},_St.prototype.renderInitialValue=function(){!(-1<["AutoComplete","ComboBox","DropDownList","MultiSelect"].indexOf(this.type))||je(this.value)||this.isEmpty(this.value.toString())||je(this.model.fields)||je(this.model.dataSource)?this.renderValue(this.checkValue(GCt(this.type,this.value,this.model))):(this.renderValue(this.getLocale({loadingText:"Loading..."},"loadingText")),this.valueWrap.classList.add(RSt),mA({target:this.valueWrap,width:10}),kA(this.valueWrap),this.getInitFieldMapValue())},_St.prototype.getInitFieldMapValue=function(){var t=this,e=this.model,i=e.fields.text,n=e.fields.value,o=je(e.query)?new ya:e.query;e.dataSource instanceof me?e.dataSource.executeQuery(this.getInitQuery(e,o)).then(function(e){t.updateInitValue(i,n,e.result)}):this.updateInitValue(i,n,new me(e.dataSource).executeLocal(this.getInitQuery(e,o)))},_St.prototype.getInitQuery=function(e,t){var i=e.fields.value,e=this.value;if("MultiSelect"!==this.type||"object"!=typeof this.value)a=new ba(i,"equal",this.value);else for(var n=0,o=0,r=e;o<r.length;o++){var s=r[o],a=0===n?new ba(i,"equal",s):a.or(i,"equal",s);n++}return t.where(a)},_St.prototype.updateInitValue=function(e,t,i){if(!(i.length<=0)){if(1===i.length)this.valueEle.innerHTML=this.checkValue(R(je(e)?t:e,i[0]));else{for(var n=[],o=0,r=i;o<r.length;o++){var s=r[o];n.push(R(je(e)?t:e,s))}this.valueEle.innerHTML=this.checkValue(n.toString())}BA(this.valueWrap),this.valueWrap.classList.remove(RSt)}},_St.prototype.renderValue=function(e){this.enableHtmlSanitizer&&"RTE"!==this.type&&"MultiSelect"!==this.type?this.valueEle.innerText=e:this.valueEle.innerHTML=this.enableHtmlParse?e:XCt(e),"Color"===this.type&&gt(this.valueEle,{color:e}),"Inline"===this.mode&&this.isEditorOpen()&&q([this.valueWrap],[BSt])},_St.prototype.isEditorOpen=function(){return!(this.isVue&&(this.enableEditMode||!(je(this.valueWrap)||this.valueWrap.classList.contains(BSt)||this.valueWrap.classList.contains("e-tooltip"))))},_St.prototype.renderEditor=function(){var e,t,i;this.prevValue=this.value,this.beginEditArgs={mode:this.mode,cancelFocus:!1,cancel:!1},this.trigger("beginEdit",this.beginEditArgs),this.beginEditArgs.cancel||(e=void 0,t=ge("."+dSt,this.element),"EditIconClick"!==this.editableOn&&t.parentElement.removeAttribute("title"),this.valueWrap.classList.contains(ISt))||("Inline"===this.mode?(U([this.valueWrap],[BSt]),this.inlineWrapper=this.createElement("div",{className:mSt}),this.element.appendChild(this.inlineWrapper),-1<["AutoComplete","ComboBox","DropDownList","MultiSelect"].indexOf(this.type)?this.checkRemoteData(this.model):this.renderAndOpen()):(!je(this.popupSettings.model)&&this.popupSettings.model.afterOpen&&(this.popupSettings.model.afterOpen=this.afterOpenHandler.bind(this)),i=this.createElement("div",{className:fSt}),this.isEmpty(this.popupSettings.title)||(this.titleEle.innerHTML=this.popupSettings.title,i.appendChild(this.titleEle)),e={content:i,opensOn:"Custom",enableRtl:this.enableRtl,cssClass:hSt,afterOpen:this.afterOpenHandler.bind(this)},i.appendChild(this.renderControl(document.body)),Pe(e,this.popupSettings.model,e,!0),this.tipObj=new NS(e),this.tipObj.appendTo(t),this.tipObj.open(t)),"Ignore"!==this.actionOnBlur&&this.wireDocEvent(),U([this.valueWrap],[ISt]),this.setProperties({enableEditMode:!0},!0),this.isReact&&this.renderReactTemplates())},_St.prototype.renderAndOpen=function(){this.renderControl(this.inlineWrapper),this.afterOpenHandler(null)},_St.prototype.checkRemoteData=function(e){var t=this;e.dataSource instanceof me?(e.dataBound=function(){t.afterOpenHandler(null)},this.renderControl(this.inlineWrapper),(je(e.value)&&je(this.value)||e.value===this.value&&!je(e.value)&&0===e.value.length)&&this.showDropDownPopup()):this.renderAndOpen()},_St.prototype.showDropDownPopup=function(){"DropDownList"===this.type?(this.model.allowFiltering||this.componentObj.focusIn(),this.componentObj.showPopup()):this.isExtModule&&this.notify("MultiSelect"===this.type?$Ct:iSt,{})},_St.prototype.setAttribute=function(t,e){var i=this.name&&0!==this.name.length?this.name:this.element.id;e.forEach(function(e){t.setAttribute(e,"id"===e?i+"_editor":i)})},_St.prototype.renderControl=function(e){this.containerEle=this.createElement("div",{className:ySt}),this.loader=this.createElement("div",{className:vSt}),this.formEle=this.createElement("form",{className:bSt});var t,i=this.createElement("div",{className:wSt}),n=this.createElement("div",{className:CSt});return e.appendChild(this.containerEle),this.loadSpinner(),this.containerEle.appendChild(this.formEle),this.formEle.appendChild(i),this.isTemplate?this.appendTemplate(n,this.template):(-1<Array.prototype.indexOf.call(this.divComponents,this.type)?(t=this.createElement("div"),this.setAttribute(t,["id"])):(t=this.createElement("input"),this.setAttribute(t,["id","name"])),this.componentRoot=t,n.appendChild(t),n.appendChild(this.loader)),i.appendChild(n),i.appendChild(this.createElement("div",{className:ASt})),this.appendButtons(this.formEle),this.isTemplate||this.renderComponent(t),this.removeSpinner(),this.submitOnEnter&&this.wireEditorKeyDownEvent(this.containerEle),this.containerEle},_St.prototype.appendButtons=function(e){this.showButtons&&e&&(this.btnElements=this.renderButtons(),e.appendChild(this.btnElements),this.wireBtnEvents())},_St.prototype.renderButtons=function(){var e=this.createElement("div",{className:SSt}),t=je(this.saveButton.content)||0===this.saveButton.content.length?"":" e-primary";return this.submitBtn=this.createButtons({constant:"save",type:"submit",container:e,title:{save:"Save"},model:this.saveButton,className:TSt+t}),this.cancelBtn=this.createButtons({type:"button",constant:"cancel",title:{cancel:"Cancel"},container:e,model:this.cancelButton,className:ESt}),e},_St.prototype.createButtons=function(e){var t,i=void 0;return 0<Object.keys(e.model).length&&(t=this.createElement("button",{className:e.className,attrs:{type:e.type,title:"save"==e.constant?je(this.saveButton.content)?this.getLocale(e.title,e.constant):this.saveButton.content:je(this.cancelButton.content)?this.getLocale(e.title,e.constant):this.cancelButton.content}}),e.container.appendChild(t),i=new zv(e.model,t)),i},_St.prototype.renderComponent=function(e){var t;if(this.isExtModule=-1<Array.prototype.indexOf.call(this.moduleList,this.type),t=je(this.model.cssClass)?xSt:this.model.cssClass.indexOf(xSt)<0?""===this.model.cssClass?xSt:this.model.cssClass+" "+xSt:this.model.cssClass,Pe(this.model,this.model,{cssClass:t,enableRtl:this.enableRtl,locale:this.locale,change:this.changeHandler.bind(this)}),je(this.value)||this.updateModelValue(!1),this.isExtModule)this.notify(KCt,{module:sSt[this.type],target:e,type:this.type});else{switch(je(this.model.showClearButton)&&!N&&(this.model.showClearButton=!0),this.type){case"Date":this.componentObj=new o9(this.model);break;case"DateTime":this.componentObj=new jq(this.model);break;case"DropDownList":this.componentObj=new qz(this.model);break;case"Mask":this.componentObj=new LR(this.model);break;case"Numeric":this.model.value&&(new RegExp("[eE][-+]?([0-9]+)").test(this.model.value)?this.model.value=this.model.value:this.model.value=this.model.value.toString().replace(/[`~!@#$%^&*()_|\=?;:'",<>\{\}\[\]\\\/]/gi,"")),this.componentObj=new NL(this.model);break;case"Text":this.componentObj=new fV(this.model)}this.componentObj.appendTo(e)}},_St.prototype.updateAdaptor=function(){switch(this.adaptor){case"UrlAdaptor":this.dataAdaptor=new Ba;break;case"WebApiAdaptor":this.dataAdaptor=new za;break;case"ODataV4Adaptor":this.dataAdaptor=new Va}},_St.prototype.loadSpinner=function(e){U([this.loader],[PSt]),"validate"!==e||"RTE"!==this.type&&"Color"!==this.type&&"Slider"!==this.type?this.spinObj={target:this.loader,width:F.isDevice?"16px":"14px"}:(U([this.loader],[DSt]),U([this.getEditElement()],[MSt]),this.spinObj={target:this.loader}),this.formEle&&U([this.formEle],[RSt]),this.btnElements&&U([this.btnElements],[BSt]),gt(this.loader,{width:"100%"}),mA(this.spinObj),kA(this.spinObj.target)},_St.prototype.removeSpinner=function(e){this.loader.removeAttribute("style"),BA(this.spinObj.target),G(this.spinObj.target.firstChild),"submit"!==e||"RTE"!==this.type&&"Color"!==this.type&&"Slider"!==this.type||(q([this.loader],[DSt]),q([this.getEditElement()],[MSt])),this.formEle&&q([this.formEle],[RSt]),this.btnElements&&q([this.btnElements],[BSt]),q([this.loader],[PSt])},_St.prototype.getEditElement=function(){return ge("."+xSt,this.formEle)},_St.prototype.getLocale=function(e,t){return new Cn("inplace-editor",e,this.locale).getConstant(t)},_St.prototype.checkValue=function(e){return this.isEmpty(e)?this.emptyText:e},_St.prototype.extendModelValue=function(e){var t=this.model;Pe(t,{value:e}),this.setProperties({model:t},!0)},_St.prototype.updateValue=function(){this.oldValue=this.value,this.enableHtmlSanitizer&&"string"==typeof this.value&&(this.oldValue=this.sanitizeHelper(this.value)),je(this.value)||(this.setProperties({value:YCt(this.type,this.oldValue)},!0),this.extendModelValue(YCt(this.type,this.oldValue)))},_St.prototype.updateModelValue=function(e){"MultiSelect"!==this.type||this.isEmpty(this.value)?this.model.value=e?this.oldValue:this.value:this.model.value=(e?this.oldValue:this.value).slice()},_St.prototype.setValue=function(){this.isExtModule?this.notify(JCt,{type:this.type}):this.componentObj&&("Numeric"===this.type&&null===this.componentObj.value&&this.componentObj.setProperties({value:null},!0),this.setProperties({value:this.componentObj.value},!0),this.extendModelValue(this.componentObj.value))},_St.prototype.getDropDownsValue=function(e){var t;return-1<Array.prototype.indexOf.call(this.dropDownEle,this.type)&&"MultiSelect"!==this.type?t=e?ge(".e-"+this.type.toLocaleLowerCase(),this.containerEle).value:this.value.toString():"MultiSelect"===this.type&&(this.notify(eSt,{type:this.type}),t=e?this.printValue:this.value.join()),t},_St.prototype.getSendValue=function(){return this.isEmpty(this.value)?"":-1<Array.prototype.indexOf.call(this.dropDownEle,this.type)?this.getDropDownsValue(!1):-1<Array.prototype.indexOf.call(this.dateType,this.type)?this.value.toISOString():"DateRange"===this.type?this.value[0].toISOString()+" - "+this.value[1].toISOString():this.value.toString()},_St.prototype.getRenderValue=function(){return"Mask"===this.type&&0!==this.componentObj.value.length?this.componentObj.getMaskedValue():-1<Array.prototype.indexOf.call(this.inputDataEle,this.type)?this.componentRoot.value:-1<Array.prototype.indexOf.call(this.dropDownEle,this.type)?this.getDropDownsValue(!0):GCt(this.type,this.value,this.model)},_St.prototype.setRtl=function(e){(e?U:q)([this.element],[FSt])},_St.prototype.setFocus=function(){this.isTemplate||(this.isExtModule?this.notify($Ct,{}):"dropdownlist"===this.componentObj.getModuleName()?this.componentObj.focusIn():this.componentObj.element.focus())},_St.prototype.removeEditor=function(e){N&&!this.isStringTemplate&&so(this.element.id+"template"),this.tipObj&&this.formEle&&z(this.formEle,"."+hSt).classList.add(BSt),this.unWireDocEvent(),this.destroyComponents(),this.formEle=void 0,je(ge("."+mSt,this.element))?this.tipObj&&("MultiSelect"===this.type&&(E.remove(this.containerEle,"mousedown",this.popMouseDown),E.remove(this.containerEle,"click",this.popClickHandler)),this.tipObj.close(),this.tipObj.destroy(),this.tipObj=void 0):(G(this.inlineWrapper),this.inlineWrapper=void 0),this.containerEle=void 0,q([this.valueWrap],[ISt,BSt]),e||this.setProperties({enableEditMode:!1},!0),je(this.editableOn)||"EditIconClick"===this.editableOn||(e="DblClick"===this.editableOn?"editAreaDoubleClick":"editAreaClick",je(this.valueWrap.parentElement))||this.valueWrap.parentElement.setAttribute("title",this.getLocale(aSt[this.editableOn],e)),this.isReact&&this.clearTemplate()},_St.prototype.destroyComponents=function(){this.showButtons&&this.destroyButtons(),this.isExtModule?this.notify(tSt,{}):(this.templateEle&&(document.body.appendChild(this.templateEle),this.templateEle.style.display="none",this.templateEle=void 0),je(this.componentObj)||(this.componentObj.destroy(),this.componentObj=void 0)),this.formValidate&&(this.formValidate=void 0),this.submitOnEnter&&this.containerEle&&this.unWireEditorKeyDownEvent(this.containerEle)},_St.prototype.destroyButtons=function(){je(this.submitBtn)||(E.remove(this.submitBtn.element,"mousedown",this.submitHandler),E.remove(this.submitBtn.element,"click",this.submitPrevent),E.remove(this.submitBtn.element,"keydown",this.btnKeyDownHandler),this.submitBtn.destroy(),this.submitBtn=void 0),je(this.cancelBtn)||(E.remove(this.cancelBtn.element,"mousedown",this.cancelBtnClick),E.remove(this.cancelBtn.element,"keydown",this.btnKeyDownHandler),this.cancelBtn.destroy(),this.cancelBtn=void 0),this.btnElements=void 0},_St.prototype.getQuery=function(t){var i=new ya;return Object.keys(t).forEach(function(e){i.addParams(e,t[e])}),i},_St.prototype.sendValue=function(){var i=this,e={data:{name:this.name,primaryKey:this.primaryKey,value:this.getSendValue()}};this.trigger("actionBegin",e,function(e){var t;e.cancel?(i.removeSpinner("submit"),"Popup"===i.mode&&i.updateArrow()):(i.isEmpty(i.url)||i.isEmpty(i.primaryKey)||!i.initRender&&(i.initRender||i.prevValue===i.value)?(t={data:{},value:e.data.value},i.triggerSuccess(t)):(i.dataManager=new me({url:i.url,adaptor:i.dataAdaptor}),"UrlAdaptor"===i.adaptor?i.dataManager.executeQuery(i.getQuery(e.data),i.successHandler.bind(i),i.failureHandler.bind(i)):i.dataManager.insert(e.data).then(function(e){return i.successHandler(e)}).catch(function(e){return i.failureHandler(e)})),i.dataManager=void 0)})},_St.prototype.isEmpty=function(e){return!(!je(e)&&0!==e.length)},_St.prototype.checkIsTemplate=function(){this.isTemplate=!je(this.template)&&""!==this.template},_St.prototype.templateCompile=function(t,e){var i,n=oo(e="string"==typeof e?e.trim():e);je(n)||(i=!(N&&"function"!=typeof e&&!this.isStringTemplate&&0===e.indexOf("<div>Blazor"))||this.isStringTemplate,i=n({},this,"template",this.element.id+"template",i)),!je(n)&&0<i.length&&([].slice.call(i).forEach(function(e){t.appendChild(e)}),N)&&!this.isStringTemplate&&"function"!=typeof e&&0===e.indexOf("<div>Blazor")&&ro(this.element.id+"template","Template",this)},_St.prototype.sanitizeHelper=function(t){var i;return this.enableHtmlSanitizer&&(Pe(i=go.beforeSanitize(),i,{cancel:!1,helper:null}),this.trigger("beforeSanitizeHtml",i,function(e){i.cancel&&!je(i.helper)?t=i.helper(t):i.cancel||(t=go.serializeValue(i,t))})),t},_St.prototype.appendTemplate=function(e,t){t="string"==typeof t?this.sanitizeHelper(t):t,this.setProperties({template:t},!0),"function"==typeof t?this.templateCompile(e,t):"string"==typeof t||je(t.innerHTML)?("."===t[0]||"#"===t[0])&&document.querySelectorAll(t).length?(this.templateEle=document.querySelector(t),e.appendChild(this.templateEle),this.templateEle.style.display=""):this.templateCompile(e,t):(this.templateEle=t,e.appendChild(this.templateEle))},_St.prototype.disable=function(e){(e?U:q)([this.element],[kSt])},_St.prototype.enableEditor=function(e,t){t&&!e||(e?this.renderEditor():this.cancelHandler("cancel"))},_St.prototype.checkValidation=function(i,n){var e,t,o,r,s=this;this.validationRules?(t=Object.keys(this.validationRules),o=Object.keys(this.validationRules[t[0]]).length,o="validateHidden"in this.validationRules[t[0]]?o-1:o,r=0,this.formValidate=new nN(this.formEle,{rules:this.validationRules,validationBegin:function(e){var t;"RTE"===s.type&&((t=document.createElement("div")).innerHTML=e.value,e.value=t.innerText)},validationComplete:function(t){r+=1,e={errorMessage:t.message,data:{name:s.name,primaryKey:s.primaryKey,value:s.checkValue(s.getSendValue())}},s.trigger("validating",e,function(e){"failure"===t.status?(t.errorElement.innerText=e.errorMessage,s.toggleErrorClass(!0)):s.toggleErrorClass(!1),je(i)||!i||o!==r&&"failure"!==t.status||(i=!1,s.afterValidation(n),r=0)})},customPlacement:function(e,t){s.formEle&&ge("."+ASt,s.formEle).appendChild(t)}}),r=0,this.formValidate.validate()):""!==this.template?(e={errorMessage:"",data:{name:this.name,primaryKey:this.primaryKey,value:this.checkValue(this.getSendValue())}},this.trigger("validating",e,function(e){e.errorMessage?(ge("."+ASt,s.formEle).innerHTML=e.errorMessage,s.toggleErrorClass(!0)):s.toggleErrorClass(!1),s.afterValidation(n)})):this.afterValidation(n)},_St.prototype.afterValidation=function(e){!this.formEle.classList.contains(LSt)&&e&&(this.loadSpinner("validate"),"Popup"===this.mode&&this.updateArrow(),this.sendValue())},_St.prototype.toggleErrorClass=function(e){var t,i,n;je(this.formEle)||(t=ge(".e-input-group",this.formEle),t=[this.formEle,t],i=LSt,n=e?"add":"remove",[].slice.call(t).forEach(function(e){e&&("add"===n?U:q)([e],[i])}))},_St.prototype.updateArrow=function(){var e=this.tipObj.tipPointerPosition;this.tipObj.tipPointerPosition="Middle"===e?"Auto":"Middle",this.tipObj.tipPointerPosition=e,this.tipObj.dataBind()},_St.prototype.triggerSuccess=function(e){var t=this,i=e.value;this.trigger("actionSuccess",e,function(e){t.oldValue=i,t.removeSpinner("submit"),e.cancel||t.renderValue(t.checkValue(e.value!==i?e.value:t.getRenderValue())),e.cancel&&"Inline"===t.mode&&q([t.valueWrap],[BSt]),t.removeEditor()})},_St.prototype.triggerEndEdit=function(e){var t=this,e={cancel:!1,mode:this.mode,action:e};this.trigger("endEdit",e,function(e){e.cancel||(t.formEle&&t.formEle.classList.contains(LSt)&&(t.updateModelValue(!0),t.setProperties({value:t.oldValue},!0)),t.removeEditor())})},_St.prototype.wireEvents=function(){je(this.editableOn)||this.wireEditEvent(this.editableOn),E.add(this.editIcon,"click",this.clickHandler,this),E.add(this.element,"keydown",this.valueKeyDownHandler,this),document.addEventListener("scroll",this.onScrollResizeHandler),window.addEventListener("resize",this.onScrollResizeHandler),-1<Array.prototype.indexOf.call(this.clearComponents,this.type)&&E.add(this.element,"mousedown",this.mouseDownHandler,this)},_St.prototype.wireDocEvent=function(){E.add(document,"mousedown",this.docClickHandler,this)},_St.prototype.wireEditEvent=function(e){"EditIconClick"!==e&&(this.element.setAttribute("title",this.getLocale(aSt[e],"Click"===e?"editAreaClick":"editAreaDoubleClick")),F.isDevice&&F.isIos&&"DblClick"===e?this.touchModule=new Mn(this.valueWrap,{tap:this.doubleTapHandler.bind(this)}):E.add(this.valueWrap,e.toLowerCase(),this.clickHandler,this))},_St.prototype.wireEditorKeyDownEvent=function(e){E.add(e,"keydown",this.enterKeyDownHandler,this)},_St.prototype.wireBtnEvents=function(){je(this.submitBtn)||(E.add(this.submitBtn.element,"mousedown",this.submitHandler,this),E.add(this.submitBtn.element,"click",this.submitPrevent,this),E.add(this.submitBtn.element,"keydown",this.btnKeyDownHandler,this)),je(this.cancelBtn)||(E.add(this.cancelBtn.element,"mousedown",this.cancelBtnClick,this),E.add(this.cancelBtn.element,"keydown",this.btnKeyDownHandler,this))},_St.prototype.cancelBtnClick=function(e){this.cancelHandler("cancel"),this.trigger("cancelClick",e)},_St.prototype.unWireEvents=function(){je(this.editableOn)||this.unWireEditEvent(this.editableOn),E.remove(this.editIcon,"click",this.clickHandler),document.removeEventListener("scroll",this.onScrollResizeHandler),window.removeEventListener("resize",this.onScrollResizeHandler),E.remove(this.element,"keydown",this.valueKeyDownHandler),-1<Array.prototype.indexOf.call(this.clearComponents,this.type)&&E.remove(this.element,"mousedown",this.mouseDownHandler)},_St.prototype.unWireDocEvent=function(){E.remove(document,"mousedown",this.docClickHandler)},_St.prototype.unWireEditEvent=function(e){"EditIconClick"!==e&&(this.element.removeAttribute("title"),F.isDevice&&F.isIos&&"DblClick"===e?(this.touchModule.destroy(),this.touchModule=void 0):E.remove(this.valueWrap,e.toLowerCase(),this.clickHandler))},_St.prototype.unWireEditorKeyDownEvent=function(e){E.remove(e,"keydown",this.enterKeyDownHandler)},_St.prototype.submitPrevent=function(e){e.preventDefault()},_St.prototype.btnKeyDownHandler=function(e){var t=e.target;(13===e.keyCode&&13===e.which||32===e.keyCode&&32===e.which)&&(t.classList.contains(TSt)?this.save():t.classList.contains(ESt)&&this.cancelHandler("cancel")),9!==e.keyCode||!1!==e.shiftKey||!je(e.target.nextElementSibling)&&"BUTTON"===e.target.nextElementSibling.tagName||("Submit"===this.actionOnBlur?this.save():"Cancel"===this.actionOnBlur&&this.cancelHandler("cancel"))},_St.prototype.afterOpenHandler=function(e){"Popup"===this.mode&&"MultiSelect"===this.type&&(E.add(this.containerEle,"mousedown",this.popMouseDown,this),E.add(this.containerEle,"click",this.popClickHandler,this)),"Popup"!==this.mode||this.isEmpty(this.titleEle.innerHTML)||e.element.classList.add(uSt),"RTE"===this.type?(this.rteModule.refresh(),this.setAttribute(ge(".e-richtexteditor textarea",this.containerEle),["name"])):"Slider"===this.type&&(this.sliderModule.refresh(),this.setAttribute(ge(".e-slider-input",this.containerEle),["name"])),this.beginEditArgs.cancelFocus||("Inline"===this.mode&&-1<["AutoComplete","ComboBox","DropDownList","MultiSelect"].indexOf(this.type)&&this.model.dataSource instanceof me?this.showDropDownPopup():this.setFocus()),this.afterOpenEvent&&(this.tipObj.setProperties({afterOpen:this.afterOpenEvent},!0),this.tipObj.trigger("afterOpen",e))},_St.prototype.popMouseDown=function(e){e=e.target.classList;e.contains("e-chips-close")&&!e.contains("e-close-hooker")&&this.updateArrow()},_St.prototype.doubleTapHandler=function(e){1<e.tapCount&&this.clickHandler(e.originalEvent)},_St.prototype.clickHandler=function(e){"EditIconClick"!==this.editableOn&&e.stopPropagation(),this.renderEditor()},_St.prototype.submitHandler=function(e){e.preventDefault(),this.save(),this.trigger("submitClick",e)},_St.prototype.cancelHandler=function(e){this.triggerEndEdit(e)},_St.prototype.popClickHandler=function(e){var t=ge("."+dSt,this.element);e.target.classList.contains("e-chips-close")&&this.tipObj.refresh(t)},_St.prototype.successHandler=function(e){this.initRender=!1;e={data:e,value:this.getSendValue()};this.triggerSuccess(e)},_St.prototype.failureHandler=function(e){var t=this,e={data:e,value:this.getSendValue()};this.trigger("actionFailure",e,function(e){t.removeSpinner("submit"),"Popup"===t.mode&&t.updateArrow()})},_St.prototype.enterKeyDownHandler=function(e){z(e.target,"."+CSt+" .e-richtexteditor")||e.currentTarget.getElementsByTagName("textarea")[0]||(13===e.keyCode&&13===e.which&&z(e.target,"."+CSt)?(this.save(),this.trigger("submitClick",e)):27===e.keyCode&&27===e.which&&this.cancelHandler("cancel"))},_St.prototype.valueKeyDownHandler=function(e){9===e.keyCode&&!0===e.shiftKey&&"BUTTON"!==e.target.tagName&&("Submit"===this.actionOnBlur?this.save():"Cancel"===this.actionOnBlur&&this.cancelHandler("cancel")),13!==e.keyCode||13!==e.which||!e.target.classList.contains(lSt)||this.valueWrap.classList.contains(ISt)||this.element.classList.contains(kSt)||(e.preventDefault(),this.renderEditor())},_St.prototype.mouseDownHandler=function(e){e.target.classList.contains("e-clear-icon")&&(this.isClearTarget=!0)},_St.prototype.scrollResizeHandler=function(){"Popup"===this.mode&&this.tipObj&&!F.isDevice&&this.triggerEndEdit("cancel")},_St.prototype.docClickHandler=function(e){var t,i,n,o,e=e.target;this.isClearTarget?this.isClearTarget=!1:(t=z(e,"."+lSt),i=z(e,"."+hSt),n=z(e,"."+xSt),o=z(e,".e-rte-elements"),!je(t)&&t.isEqualNode(this.element)||!je(i)&&this.tipObj&&-1<i.id.indexOf(this.valueWrap.id)||!je(n)||!je(o)||e.classList.contains("e-chips-close")||("Submit"===this.actionOnBlur?this.save():"Cancel"===this.actionOnBlur&&this.cancelHandler("cancel")))},_St.prototype.changeHandler=function(e){var t={previousValue:void 0===this.compPrevValue?this.value:this.compPrevValue,value:e.value};"AutoComplete"!==this.type&&"ComboBox"!==this.type&&"DropDownList"!==this.type||(t.itemData=e.itemData,t.previousItemData=e.previousItemData),this.compPrevValue=t.value,this.trigger("change",t)},_St.prototype.validate=function(){this.checkValidation(!0,!1)},_St.prototype.save=function(){var e,t=this;this.formEle&&(this.element.focus(),this.editEle=ge("."+CSt,this.formEle),ge("."+LSt,this.editEle),this.isTemplate||this.setValue(),e={cancel:!1,mode:this.mode,action:"submit"},this.trigger("endEdit",e,function(e){e.cancel||t.checkValidation(!0,!0)}))},_St.prototype.destroy=function(){var t=this;for(this.removeEditor(N),this.isExtModule&&this.notify(ZCt,{}),this.unWireEvents(),[kSt,FSt].forEach(function(e){q([t.element],[e])});this.element.firstElementChild;)this.element.removeChild(this.element.firstElementChild);N&&this.isServerRendered||NSt.prototype.destroy.call(this),this.isReact&&this.clearTemplate()},_St.prototype.getPersistData=function(){return this.addOnPersist(["value"])},_St.prototype.requiredModules=function(){var e=[];return-1<Array.prototype.indexOf.call(this.moduleList,this.type)&&e.push({member:sSt[this.type],args:[this]}),e},_St.prototype.getModuleName=function(){return"inplaceeditor"},_St.prototype.onPropertyChanged=function(e,t){var i;if(!this.validationRules||!(!je(this.element.querySelectorAll("."+LSt))&&0<this.element.querySelectorAll("."+LSt).length)){this.isEditorOpen()&&((i="enableEditMode"in e)&&t.enableEditMode&&!e.enableEditMode||!i&&this.enableEditMode?this.triggerEndEdit("cancel"):this.removeEditor());for(var n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"showButtons":e.showButtons?this.appendButtons(this.formEle):this.destroyButtons();break;case"value":this.updateValue(),"Never"===this.textOption?this.renderValue(this.checkValue(GCt(this.type,this.value,this.model))):this.renderInitialValue();break;case"emptyText":"Never"===this.textOption?this.renderValue(this.checkValue(GCt(this.type,this.value,this.model))):this.renderInitialValue();break;case"template":this.checkIsTemplate();break;case"disabled":this.disable(e.disabled),e.disabled?this.element.tabIndex=-1:this.element.tabIndex=0;break;case"enableRtl":this.setRtl(e.enableRtl);break;case"cssClass":this.setClass("remove",t.cssClass),this.setClass("add",e.cssClass);break;case"mode":this.enableEditor(this.enableEditMode);break;case"enableEditMode":this.enableEditor(e.enableEditMode);break;case"editableOn":this.unWireEditEvent(t.editableOn),"EditIconClick"!==e.editableOn&&this.wireEditEvent(e.editableOn)}}},h([e("")],_St.prototype,"name",void 0),h([e(null)],_St.prototype,"value",void 0),h([e("")],_St.prototype,"template",void 0),h([e(!0)],_St.prototype,"enableHtmlSanitizer",void 0),h([e(!0)],_St.prototype,"enableHtmlParse",void 0),h([e("")],_St.prototype,"cssClass",void 0),h([e("")],_St.prototype,"primaryKey",void 0),h([e("Empty")],_St.prototype,"emptyText",void 0),h([e("")],_St.prototype,"url",void 0),h([e("Popup")],_St.prototype,"mode",void 0),h([e("UrlAdaptor")],_St.prototype,"adaptor",void 0),h([e("Text")],_St.prototype,"type",void 0),h([e("Click")],_St.prototype,"editableOn",void 0),h([e("Never")],_St.prototype,"textOption",void 0),h([e("Submit")],_St.prototype,"actionOnBlur",void 0),h([e(!1)],_St.prototype,"enablePersistence",void 0),h([e(!1)],_St.prototype,"disabled",void 0),h([e(!0)],_St.prototype,"showButtons",void 0),h([e(!1)],_St.prototype,"enableEditMode",void 0),h([e(!0)],_St.prototype,"submitOnEnter",void 0),h([t({},Det)],_St.prototype,"popupSettings",void 0),h([e(null)],_St.prototype,"model",void 0),h([e({iconCss:"e-icons e-save-icon"})],_St.prototype,"saveButton",void 0),h([e({iconCss:"e-icons e-cancel-icon"})],_St.prototype,"cancelButton",void 0),h([e(null)],_St.prototype,"validationRules",void 0),h([i()],_St.prototype,"created",void 0),h([i()],_St.prototype,"beforeSanitizeHtml",void 0),h([i()],_St.prototype,"actionBegin",void 0),h([i()],_St.prototype,"actionSuccess",void 0),h([i()],_St.prototype,"actionFailure",void 0),h([i()],_St.prototype,"validating",void 0),h([i()],_St.prototype,"beginEdit",void 0),h([i()],_St.prototype,"endEdit",void 0),h([i()],_St.prototype,"change",void 0),h([i()],_St.prototype,"submitClick",void 0),h([i()],_St.prototype,"cancelClick",void 0),h([i()],_St.prototype,"destroyed",void 0),h([Bt],_St));function _St(e,t){e=NSt.call(this,e,t)||this;return e.needsID=!0,e}zSt.prototype.render=function(e){this.module.render(e)},zSt.prototype.showPopup=function(){this.module.showPopup()},zSt.prototype.focus=function(){this.module.focus()},zSt.prototype.update=function(e){this.module.updateValue(e)},zSt.prototype.getValue=function(){this.module.getRenderValue()},zSt.prototype.destroyComponent=function(){je(this.module.compObj)||(this.module.compObj.destroy(),this.module.compObj=void 0)},zSt.prototype.destroy=function(){this.destroyComponent(),this.removeEventListener()},zSt.prototype.addEventListener=function(){this.parent.on(KCt,this.render,this),this.parent.on($Ct,this.focus,this),this.parent.on(iSt,this.showPopup,this),this.parent.on(JCt,this.update,this),this.parent.on(eSt,this.getValue,this),this.parent.on(tSt,this.destroyComponent,this),this.parent.on(ZCt,this.destroy,this)},zSt.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(KCt,this.render),this.parent.off($Ct,this.focus),this.parent.off(iSt,this.showPopup),this.parent.off(JCt,this.update),this.parent.off(eSt,this.getValue),this.parent.off(tSt,this.destroyComponent),this.parent.off(ZCt,this.destroy))};var HSt=zSt;function zSt(e,t){this.parent=e,this.module=t,this.addEventListener()}jSt.prototype.render=function(e){this.compObj=new lU(this.parent.model),this.compObj.appendTo(e.target)},jSt.prototype.showPopup=function(){this.compObj.focusIn(),this.compObj.showPopup()},jSt.prototype.focus=function(){this.compObj.element.focus()},jSt.prototype.updateValue=function(e){this.compObj&&"AutoComplete"===e.type&&(this.parent.setProperties({value:this.compObj.value},!0),this.parent.extendModelValue(this.compObj.value))},jSt.prototype.destroy=function(){this.base.destroy()},jSt.prototype.getModuleName=function(){return"auto-complete"};wce=jSt;function jSt(e){this.compObj=void 0,this.parent=e,(this.parent.atcModule=this).base=new HSt(this.parent,this)}WSt.prototype.render=function(e){this.compObj=new cV(this.parent.model),this.compObj.appendTo(e.target)},WSt.prototype.focus=function(){this.compObj.element.focus()},WSt.prototype.updateValue=function(e){this.compObj&&"Color"===e.type&&(this.parent.setProperties({value:this.compObj.value},!0),this.parent.extendModelValue(this.compObj.value))},WSt.prototype.destroy=function(){this.base.destroy()},WSt.prototype.getModuleName=function(){return"color-picker"};tte=WSt;function WSt(e){this.compObj=void 0,this.parent=e,(this.parent.colorModule=this).base=new HSt(this.parent,this)}QSt.prototype.render=function(e){this.compObj=new oU(this.parent.model),this.compObj.appendTo(e.target)},QSt.prototype.focus=function(){this.compObj.element.focus()},QSt.prototype.showPopup=function(){this.compObj.focusIn(),this.compObj.showPopup()},QSt.prototype.destroy=function(){this.base.destroy()},QSt.prototype.updateValue=function(e){this.compObj&&"ComboBox"===e.type&&(this.parent.setProperties({value:this.compObj.value},!0),this.parent.extendModelValue(this.compObj.value))},QSt.prototype.getModuleName=function(){return"combo-box"};pJ=QSt;function QSt(e){this.compObj=void 0,this.parent=e,(this.parent.comboBoxModule=this).base=new HSt(this.parent,this)}USt.prototype.render=function(e){this.compObj=new Z9(this.parent.model),this.compObj.appendTo(e.target)},USt.prototype.focus=function(){this.compObj.element.focus()},USt.prototype.getModuleName=function(){return"date-range-picker"},USt.prototype.updateValue=function(e){this.compObj&&"DateRange"===e.type&&(this.parent.setProperties({value:this.compObj.value},!0),this.parent.extendModelValue(this.compObj.value))},USt.prototype.destroy=function(){this.base.destroy()};P$e=USt;function USt(e){this.compObj=void 0,this.parent=e,(this.parent.dateRangeModule=this).base=new HSt(this.parent,this)}var qSt=function(){return(qSt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},H$e=(GSt.prototype.render=function(e){var t=qSt({},this.parent.model);this.openEvent=t.open,this.closeEvent=t.close,t.open=this.openHandler.bind(this),t.close=this.closeHandler.bind(this),this.compObj=new zU(t),this.compObj.appendTo(e.target)},GSt.prototype.openHandler=function(e){this.isPopOpen=!0,this.openEvent&&(this.compObj.setProperties({open:this.openEvent},!0),this.compObj.trigger("open",e))},GSt.prototype.closeHandler=function(e){this.isPopOpen=!1,this.closeEvent&&(this.compObj.setProperties({close:this.closeEvent},!0),this.compObj.trigger("close",e))},GSt.prototype.focus=function(){var e;this.isPopOpen||((e=document.createEvent("MouseEvent")).initEvent("mousedown",!0,!0),z(this.compObj.element,".e-multi-select-wrapper").dispatchEvent(e))},GSt.prototype.updateValue=function(e){this.compObj&&"MultiSelect"===e.type&&(this.parent.setProperties({value:this.compObj.value},!0),this.parent.extendModelValue(this.compObj.value))},GSt.prototype.getRenderValue=function(){this.parent.printValue=this.compObj.text},GSt.prototype.destroy=function(){this.base.destroy()},GSt.prototype.getModuleName=function(){return"multi-select"},GSt);function GSt(e){this.isPopOpen=!1,this.compObj=void 0,this.parent=e,(this.parent.multiSelectModule=this).base=new HSt(this.parent,this)}YSt.prototype.render=function(e){this.compObj=new Ket(this.parent.model),this.compObj.appendTo(e.target)},YSt.prototype.focus=function(){this.compObj.focusIn()},YSt.prototype.updateValue=function(e){this.compObj&&"RTE"===e.type&&(this.parent.setProperties({value:this.getRteValue()},!0),this.parent.extendModelValue(this.compObj.value))},YSt.prototype.getRteValue=function(){var e;return"Markdown"===this.compObj.editorMode?""===(e=this.compObj.contentModule.getEditPanel().value)?"":e:"<p><br></p>"===(e=this.compObj.contentModule.getEditPanel().innerHTML)||"&lt;p&gt;&lt;br&gt;&lt;/p&gt;"===e||""===e?"":e},YSt.prototype.refresh=function(){this.compObj.refresh()},YSt.prototype.destroy=function(){this.base.destroy()},YSt.prototype.getModuleName=function(){return"rte"};set=YSt;function YSt(e){this.compObj=void 0,Ket.Inject(oit,Ytt,att,G9e,X9e,ptt,hqe,hit,sit,uit,J9e,$9e,pit,utt),this.parent=e,(this.parent.rteModule=this).base=new HSt(this.parent,this)}XSt.prototype.render=function(e){this.compObj=new KO(this.parent.model),this.compObj.appendTo(e.target)},XSt.prototype.focus=function(){this.compObj.element.focus()},XSt.prototype.updateValue=function(e){this.compObj&&"Slider"===e.type&&(this.parent.setProperties({value:this.compObj.value},!0),this.parent.extendModelValue(this.compObj.value))},XSt.prototype.refresh=function(){this.compObj.refresh()},XSt.prototype.destroy=function(){this.base.destroy()},XSt.prototype.getModuleName=function(){return"slider"};tn=XSt;function XSt(e){this.compObj=void 0,this.parent=e,(this.parent.sliderModule=this).base=new HSt(this.parent,this)}KSt.prototype.render=function(e){this.compObj=new wq(this.parent.model),this.compObj.appendTo(e.target)},KSt.prototype.focus=function(){this.compObj.focusIn()},KSt.prototype.updateValue=function(e){this.compObj&&"Time"===e.type&&(this.parent.setProperties({value:this.compObj.value},!0),this.parent.extendModelValue(this.compObj.value))},KSt.prototype.getModuleName=function(){return"time-picker"},KSt.prototype.destroy=function(){this.base.destroy()};Kmt=KSt;function KSt(e){this.compObj=void 0,this.parent=e,(this.parent.timeModule=this).base=new HSt(this.parent,this)}JSt.prototype.setAnnotationMode=function(e,t,i,n){var o,r,s=this.pdfViewer.allowServerDataBinding;this.pdfViewer.enableServerDataBinding(!1),"Stamp"===this.pdfViewer.tool&&this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.updateStampItems(),this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule.resetFreeTextAnnot(),"None"!==e&&this.triggerAnnotationUnselectEvent(),this.pdfViewer.tool="",this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.deSelectCommentAnnotation(),"None"===e?this.clearAnnotationMode():"Highlight"===e||"Strikethrough"===e||"Underline"===e?this.textMarkupAnnotationModule&&(this.textMarkupAnnotationModule.isSelectionMaintained=!1,this.textMarkupAnnotationModule.drawTextMarkupAnnotations(e.toString())):"Line"===e||"Arrow"===e||"Rectangle"===e||"Circle"===e||"Polygon"===e?this.shapeAnnotationModule&&this.shapeAnnotationModule.setAnnotationType(e):"Distance"===e||"Perimeter"===e||"Area"===e||"Radius"===e||"Volume"===e?this.measureAnnotationModule&&this.measureAnnotationModule.setAnnotationType(e):"FreeText"===e&&this.freeTextAnnotationModule?(this.freeTextAnnotationModule.setAnnotationType("FreeText"),this.freeTextAnnotationModule.isNewFreeTextAnnot=!0,this.freeTextAnnotationModule.isNewAddedAnnot=!0):"HandWrittenSignature"===e?this.pdfViewerBase.signatureModule.setAnnotationMode():"Initial"===e?this.pdfViewerBase.signatureModule.setInitialMode():"Ink"===e?this.inkAnnotationModule.setAnnotationMode():"StickyNotes"===e?(this.pdfViewerBase.isCommentIconAdded=!0,this.pdfViewerBase.isAddComment=!0,(o=document.getElementById(this.pdfViewer.element.id+"_pageDiv_"+(this.pdfViewerBase.currentPageNumber-1)))&&o.addEventListener("mousedown",this.pdfViewer.annotationModule.stickyNotesAnnotationModule.drawIcons.bind(this))):"Stamp"===e&&(this.pdfViewer.annotation.stampAnnotationModule.isStampAddMode=!0,this.pdfViewer.annotationModule.stampAnnotationModule.isStampAnnotSelected=!0,this.pdfViewerBase.stampAdded=!0,t?(r=kCt[t],this.pdfViewerBase.isDynamicStamp=!0,this.stampAnnotationModule.retrieveDynamicStampAnnotation(r)):i?(r=PCt[i],this.pdfViewerBase.isDynamicStamp=!1,this.stampAnnotationModule.retrievestampAnnotation(r)):n&&(r=BCt[n],this.pdfViewerBase.isDynamicStamp=!1,this.stampAnnotationModule.retrievestampAnnotation(r))),this.pdfViewer.enableServerDataBinding(s,!0),this.pdfViewerBase.initiateTextSelection()},JSt.prototype.deleteAnnotationById=function(e){e&&(this.isAnnotDeletionApiCall=!0,this.annotationSelected=!1,this.selectAnnotation(e),this.deleteAnnotation(),this.isAnnotDeletionApiCall=!1,this.pdfViewer.textSelectionModule)&&this.pdfViewer.textSelectionModule.clearTextSelection()},JSt.prototype.clearAnnotationMode=function(){var e;this.textMarkupAnnotationModule&&(this.textMarkupAnnotationModule.isTextMarkupAnnotationMode=!1),this.freeTextAnnotationModule&&(this.freeTextAnnotationModule.isNewFreeTextAnnot=!1,this.freeTextAnnotationModule.isNewAddedAnnot=!1),this.pdfViewerBase.isTextMarkupAnnotationModule()&&(this.pdfViewer.annotation.textMarkupAnnotationModule.currentTextMarkupAddMode=""),this.pdfViewerBase.isShapeAnnotationModule()&&(this.pdfViewer.annotation.shapeAnnotationModule.currentAnnotationMode=""),this.pdfViewerBase.isCalibrateAnnotationModule()&&(this.pdfViewer.annotation.measureAnnotationModule.currentAnnotationMode=""),this.pdfViewer.annotationModule.inkAnnotationModule&&(e=parseInt(this.pdfViewer.annotationModule.inkAnnotationModule.currentPageNumber,10),this.pdfViewer.annotationModule.inkAnnotationModule.drawInkAnnotation(e))},JSt.prototype.deleteAnnotation=function(){this.textMarkupAnnotationModule&&this.textMarkupAnnotationModule.deleteTextMarkupAnnotation();var e=this.pdfViewer.selectedItems.annotations[0];if(e){var t=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_formfields"),i=JSON.parse(t),n=[];if(i){for(var o=0;o<i.length;o++){if(i[parseInt(o.toString(),10)].uniqueID==e.id){i[parseInt(o.toString(),10)].Value="";for(var r=0;r<i.length;r++)"ink"===i[parseInt(r.toString(),10)].Name&&(i[parseInt(r.toString(),10)].Value=""),i[parseInt(o.toString(),10)].FieldName===i[parseInt(r.toString(),10)].FieldName&&"ink"===i[parseInt(r.toString(),10)].Name&&i.splice(r,1)}n.push(i[parseInt(o.toString(),10)])}ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_formfields",JSON.stringify(n))}}var t=!1,s=!1;if(0<this.pdfViewer.selectedItems.annotations.length){var a=this.pdfViewer.selectedItems.annotations[0],l=a.shapeAnnotationType;if("Path"!==l&&"SignatureField"!==a.formFieldAnnotationType&&"InitialField"!==a.formFieldAnnotationType&&"HandWrittenSignature"!==l&&"SignatureText"!==l&&"SignatureImage"!==l||(l=document.getElementById(a.id))&&l.disabled&&(s=!0),!(t=a.annotationSettings&&(t=a.annotationSettings.isLock)&&this.checkAllowedInteractions("Delete",a)?!1:t)&&!s){var l=a.pageIndex,s=a.shapeAnnotationType,h=void 0,d=("Line"===s||"LineWidthArrowHead"===s||"Polygon"===s||"Ellipse"===s||"Rectangle"===s||"Radius"===s||"Distance"===s?(je(a.measureType)||""===a.measureType?(this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(a,"shape"),this.updateImportAnnotationCollection(a,l,"shapeAnnotation")):(this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(a,"measure"),this.updateImportAnnotationCollection(a,l,"measureShapeAnnotation")),h=this.modifyInCollections(a,"delete")):"FreeText"===s?(this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(a,"FreeText","delete"),h=this.modifyInCollections(a,"delete"),this.updateImportAnnotationCollection(a,l,"freeTextAnnotation")):"HandWrittenSignature"===s||"SignatureImage"===s||"SignatureText"===s?h=this.modifyInCollections(a,"delete"):"Ink"===s?(this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(a,"Ink","delete"),h=this.modifyInCollections(a,"delete"),this.updateImportAnnotationCollection(a,l,"signatureInkAnnotation")):(h=this.pdfViewer.selectedItems.annotations[0],this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(h,h.shapeAnnotationType,"delete"),this.pdfViewer.annotation.stampAnnotationModule.updateSessionStorage(a,null,"delete")),"StickyNotes"===s&&this.updateImportAnnotationCollection(a,l,"stickyNotesAnnotation"),"Stamp"!==s&&"Image"!==s||this.updateImportAnnotationCollection(a,l,"stampAnnotations"),this.pdfViewer.nameTable[a.id.split("_")[0]]),p=((je(d)||"SignatureField"!==d.formFieldAnnotationType&&"InitialField"!==d.formFieldAnnotationType)&&this.pdfViewer.annotation.addAction(l,null,a,"Delete","",h,a),void 0),c=(""!==a.annotName?p=document.getElementById(a.annotName):h&&""!==h.annotName&&(p=document.getElementById(h.annotName)),this.removeCommentPanelDiv(p),this.pdfViewer.selectedItems.annotations[0]),u=c.annotName,g=this.getAnnotationType(c.shapeAnnotationType,c.measureType);if("Path"===s||"SignatureField"===c.formFieldAnnotationType||"InitialField"===c.formFieldAnnotationType||"HandWrittenSignature"===s||"SignatureText"===s||"SignatureImage"===s){var m=this.pdfViewer.retrieveFormFields(),f=void 0;-1<(b=m.findIndex(function(e){return e.id===a.id}))&&(f=m[parseInt(b.toString(),10)].name);for(var y,v=0;v<m.length;v++)(c.id===m[parseInt(v.toString(),10)].id||je(f)&&f===m[parseInt(v.toString(),10)].name)&&(m[parseInt(v.toString(),10)].value="",m[parseInt(v.toString(),10)].signatureType="",y=this.getAnnotationsFromCollections(m[parseInt(v.toString(),10)].id),this.updateInputFieldDivElement(y),h=this.modifyInCollections(y,"delete"),this.pdfViewer.annotation.addAction(y.pageIndex,null,y,"Delete","",h,y),this.pdfViewer.formDesignerModule&&c.formFieldAnnotationType?this.updateFormFieldCollection(y):this.updateAnnotationCollection(y),this.pdfViewer.remove(y));this.pdfViewer.formDesignerModule&&c.formFieldAnnotationType?this.updateFormFieldCollection(a):this.updateAnnotationCollection(a)}if(this.pdfViewer.formDesignerModule&&c.formFieldAnnotationType?this.updateFormFieldCollection(a):this.updateAnnotationCollection(a),null!=d&&("SignatureField"===d.formFieldAnnotationType||"InitialField"===d.formFieldAnnotationType)){var b,f=void 0;-1<(b=this.pdfViewer.formFieldCollections.findIndex(function(e){return e.id===a.id.split("_")[0]}))&&(f=this.pdfViewer.formFieldCollections[parseInt(b.toString(),10)].name);for(var w,C,S=0;S<this.pdfViewer.formFieldCollections.length;S++)f===this.pdfViewer.formFieldCollections[parseInt(S.toString(),10)].name&&(w=this.pdfViewer.formFieldCollections[parseInt(S.toString(),10)],this.pdfViewer.fireFormFieldPropertiesChangeEvent("formFieldPropertiesChange",w,w.pageIndex,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,w.value,""),w.value="",w.signatureType="",this.pdfViewer.formDesignerModule.updateFormFieldCollections(w),je(w=this.getAnnotationsFromCollections(w.id+"_content"))||(h=this.modifyInCollections(w,"delete"),this.pdfViewer.annotation.addAction(w.pageIndex,null,w,"Delete","",h,w),this.updateInputFieldDivElement(w),(C=this.pdfViewer.nameTable[w.id.split("_")[0]]).wrapper.children.splice(C.wrapper.children.indexOf(w.wrapper.children[0]),1),this.pdfViewer.remove(w)))}this.pdfViewer.remove(a),this.pdfViewer.renderDrawing(),this.pdfViewer.clearSelection(l),this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner"),this.pdfViewerBase.updateDocumentEditedProperty(!0),this.pdfViewerBase.tool=null,this.pdfViewer.tool=null,"HandWrittenSignature"===c.shapeAnnotationType||"SignatureText"===c.shapeAnnotationType||"SignatureImage"===c.shapeAnnotationType||"Path"===c.shapeAnnotationType?(s={left:c.bounds.x,top:c.bounds.y,width:c.bounds.width,height:c.bounds.height},this.pdfViewer.fireSignatureRemove(l,c.id,c.shapeAnnotationType,s)):this.pdfViewer.annotationModule&&this.pdfViewer.fireAnnotationRemove(l,u,g,c.bounds),this.pdfViewer.textSelectionModule&&this.pdfViewer.textSelectionModule.enableTextSelectionMode()}}else this.nonRenderSelectedAnnotation&&this.nonRenderSelectedAnnotation.annotationId&&this.isAnnotDeletionApiCall&&(u=this.nonRenderSelectedAnnotation.annotationId,d=this.nonRenderSelectedAnnotation.pageNumber||this.nonRenderSelectedAnnotation.pageIndex,(b=this.updateCollectionForNonRenderedPages(this.nonRenderSelectedAnnotation,u,d)).pageIndex=d,this.pdfViewer.annotation.addAction(d,null,b,"Delete","",b,b),this.undoCommentsElement.push(b),p=document.getElementById(u),this.removeCommentPanelDiv(p),this.nonRenderSelectedAnnotation=null);this.updateToolbar(!0),this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule&&!t&&(this.pdfViewer.toolbarModule.annotationToolbarModule.selectAnnotationDeleteItem(!1,!0),this.pdfViewer.toolbarModule.annotationToolbarModule.enableTextMarkupAnnotationPropertiesTools(!1))},JSt.prototype.getAnnotationsFromCollections=function(e){var t=this.pdfViewer.annotations;if(t&&e)for(var i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].id===e)return t[parseInt(i.toString(),10)];return null},JSt.prototype.updateInputFieldDivElement=function(e){var t=document.getElementById(e.id),i=document.getElementById(e.id+"_html_element");(t=null!==t||je(i)?t:i.children[0].children[0])&&t.classList.contains("e-pdfviewer-signatureformfields-signature")&&(t.className="e-pdfviewer-signatureformfields",t.style.pointerEvents="",t.parentElement.style.pointerEvents=""),this.pdfViewer.formDesignerModule?this.pdfViewer.formDesignerModule.updateSignatureValue(e.id):this.pdfViewer.formFieldsModule&&this.pdfViewer.formFieldsModule.updateDataInSession(t,"")},JSt.prototype.storeAnnotationCollections=function(e,t,i,n){var o,r;this.isFormFieldShape?(o=this.checkFormDesignCollection(e),(r=owt(e)).formFieldId=e.annotName,r.pageNumber=t,delete r.annotName,e.id&&(r.uniqueKey=e.id,delete r.id),o.isExisting?this.pdfViewer.formFieldCollection.splice(o.position,0,r):this.pdfViewer.formFieldCollection.push(r)):(o=this.checkAnnotationCollection(e),(r=owt(e)).annotationId=e.annotName,r.pageNumber=t,delete r.annotName,"stamp"===e.shapeAnnotationType&&(r.uniqueKey=e.randomId,delete r.randomId),"sticky"===e.shapeAnnotationType&&(r.uniqueKey=e.annotName),e.id&&(r.uniqueKey=e.id,delete r.id),r.customData&&e.customData&&JSON.stringify(r.customData)!==JSON.stringify(e.customData)&&(r.customData=e.customData),o.isExisting?this.pdfViewer.annotationCollection.splice(o.position,0,r):!je(i)&&i?this.pdfViewer.annotationCollection.splice(n,0,r):this.pdfViewer.annotationCollection.push(r))},JSt.prototype.checkFormDesignCollection=function(e){var t=this.pdfViewer.formFieldCollection;if(t&&e)for(var i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].formFieldId===e.annotName)return this.pdfViewer.formFieldCollection.splice(i,1),{isExisting:!0,position:i};return{isExisting:!1,position:null}},JSt.prototype.updateFormFieldCollection=function(e){var t=this.pdfViewer.formFieldCollection;if(t&&e)for(var i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].formFieldId===e.annotName){this.removedAnnotationCollection.push(t[parseInt(i.toString(),10)]),this.pdfViewer.formFieldCollection.splice(i,1);break}},JSt.prototype.getCustomData=function(e){var t;return e.ExistingCustomData&&!e.CustomData?t=JSON.parse(e.ExistingCustomData):null===e.CustomData?("sticky"===e.shapeAnnotationType&&(t=this.pdfViewer.stickyNotesSettings.customData),"Stamp"===e.shapeAnnotationType&&(t=this.pdfViewer.stampSettings.customData),"FreeText"===e.shapeAnnotationType&&(t=this.pdfViewer.freeTextSettings.customData),"shape"===e.id&&(t=this.getShapeData(e.ShapeAnnotationType,e.subject)),"measure"===e.id&&(t=this.getMeasureData(e.Subject)),"textMarkup"===e.shapeAnnotationType&&(t=this.getTextMarkupData(e.subject)),"Ink"===e.shapeAnnotationType&&(t=this.pdfViewer.inkAnnotationSettings.customData)):je(e=e.CustomData||e.customData)||(t="string"==typeof e?JSON.parse(e):e),t},JSt.prototype.getShapeData=function(e,t){var i;return"Line"===e&&"Arrow"!==t&&this.pdfViewer.lineSettings.customData?i=this.pdfViewer.lineSettings.customData:"LineWidthArrowHead"!==e&&"Arrow"!==t||!this.pdfViewer.arrowSettings.customData?"Rectangle"!==e&&"Square"!==e||!this.pdfViewer.rectangleSettings.customData?"Ellipse"!==e&&"Circle"!==e||!this.pdfViewer.circleSettings.customData?"Polygon"===e&&this.pdfViewer.polygonSettings.customData?i=this.pdfViewer.polygonSettings.customData:this.pdfViewer.annotationSettings.customData&&(i=this.pdfViewer.annotationSettings.customData):i=this.pdfViewer.circleSettings.customData:i=this.pdfViewer.rectangleSettings.customData:i=this.pdfViewer.arrowSettings.customData,i},JSt.prototype.getMeasureData=function(e){var t;return"Distance"!==e&&"Distance calculation"!==e||!this.pdfViewer.distanceSettings.customData?"Line"!==e&&"Perimeter calculation"!==e||!this.pdfViewer.lineSettings.customData?"Polygon"!==e&&"Area calculation"!==e&&"Volume calculation"!==e||!this.pdfViewer.polygonSettings.customData?"Radius"!==e&&"Radius calculation"!==e||!this.pdfViewer.radiusSettings.customData?this.pdfViewer.annotationSettings.customData&&(t=this.pdfViewer.annotationSettings.customData):t=this.pdfViewer.radiusSettings.customData:t=this.pdfViewer.polygonSettings.customData:t=this.pdfViewer.lineSettings.customData:t=this.pdfViewer.distanceSettings.customData,t},JSt.prototype.getTextMarkupData=function(e){var t;return"Highlight"===e&&this.pdfViewer.highlightSettings.customData?t=this.pdfViewer.highlightSettings.customData:"Underline"===e&&this.pdfViewer.underlineSettings.customData?t=this.pdfViewer.underlineSettings.customData:"Strikethrough"===e&&this.pdfViewer.strikethroughSettings.customData?t=this.pdfViewer.strikethroughSettings.customData:this.pdfViewer.annotationSettings.customData&&(t=this.pdfViewer.annotationSettings.customData),t},JSt.prototype.getData=function(e){var t;return"FreeText"===e&&this.pdfViewer.freeTextSettings.customData?t=this.pdfViewer.freeTextSettings.customData:"image"!==e&&"Stamp"!==e||!this.pdfViewer.stampSettings.customData?"sticky"===e&&this.pdfViewer.stickyNotesSettings.customData?t=this.pdfViewer.stickyNotesSettings.customData:this.pdfViewer.annotationSettings.customData&&(t=this.pdfViewer.annotationSettings.customData):t=this.pdfViewer.stampSettings.customData,t},JSt.prototype.clearAnnotationStorage=function(){var e=ARt.sessionStorageManager.getWindowSessionStorageSize(),t=4500;if((t=this.pdfViewerBase.isDeviceiOS||this.pdfViewerBase.isMacSafari?2e3:t)<e){for(var i=ARt.sessionStorageManager.getSessionLength(),n=[],o=0;o<i;o++)ARt.sessionStorageManager.getKey(o)&&ARt.sessionStorageManager.getKey(o).split("_")[3]&&"annotations"===ARt.sessionStorageManager.getKey(o).split("_")[3]&&(this.pdfViewerBase.annotationStorage[ARt.sessionStorageManager.getKey(o)]=ARt.sessionStorageManager.getItem(ARt.sessionStorageManager.getKey(o)),n.push(ARt.sessionStorageManager.getKey(o)));if(n)for(o=0;o<n.length;o++)ARt.sessionStorageManager.removeItem(n[parseInt(o.toString(),10)])}},JSt.prototype.checkAnnotationCollection=function(e){var t=this.pdfViewer.annotationCollection;if(t&&e)for(var i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].annotationId===e.annotName)return this.pdfViewer.annotationCollection.splice(i,1),{isExisting:!0,position:i};return{isExisting:!1,position:null}},JSt.prototype.updateAnnotationCollection=function(e){var t=this.pdfViewer.annotationCollection;if(t&&e)for(var i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].annotationId===e.annotName||t[parseInt(i.toString(),10)].annotationId===e.annotationId){this.removedAnnotationCollection.push(t[parseInt(i.toString(),10)]),this.pdfViewer.annotationCollection.splice(i,1);break}},JSt.prototype.updateImportAnnotationCollection=function(t,e,i){this.pdfViewerBase.isImportAction&&this.pdfViewerBase.importedAnnotation&&this.pdfViewerBase.importedAnnotation[parseInt(e.toString(),10)]&&(this.pdfViewerBase.importedAnnotation[parseInt(e.toString(),10)][""+i]&&!je(this.pdfViewerBase.importedAnnotation[parseInt(e.toString(),10)].annotationOrder)&&(this.pdfViewerBase.importedAnnotation[parseInt(e.toString(),10)].annotationOrder=this.pdfViewerBase.importedAnnotation[parseInt(e.toString(),10)].annotationOrder.filter(function(e){return!(t.annotName===e.AnnotName||t.annotName===e.annotName)})),je(this.pdfViewerBase.importedAnnotation)||je(this.pdfViewerBase.importedAnnotation[parseInt(e.toString(),10)])||je(this.pdfViewerBase.importedAnnotation[parseInt(e.toString(),10)][""+i])||(this.pdfViewerBase.importedAnnotation[parseInt(e.toString(),10)][""+i]=this.pdfViewerBase.importedAnnotation[parseInt(e.toString(),10)][""+i].filter(function(e){return t.annotName!==e.AnnotName})));var n=this.pdfViewerBase.documentAnnotationCollections;if(n&&n[parseInt(e.toString(),10)]){var o=n[parseInt(e.toString(),10)];if(o&&o[""+i])for(var r=0;r<o[""+i].length;r++)if(t.annotName===o[""+i][parseInt(r.toString(),10)].AnnotName){this.pdfViewerBase.documentAnnotationCollections[parseInt(e.toString(),10)][""+i].splice(r,1);break}}},JSt.prototype.selectAnnotation=function(e){var t,i,n,o,r,s;"object"==typeof e&&(i=(t=e).annotationId,t=this.getAnnotationsFromAnnotationCollections(i)),"string"==typeof e&&(t=this.getAnnotationsFromAnnotationCollections(e),i=e),t&&(e=je(t.pageNumber)?t.pageIndex:t.pageNumber,n=!1,n=this.findRenderPageList(e),s=this.pdfViewer.annotationSelectorSettings,t)&&0<=e&&("textMarkup"===t.shapeAnnotationType?t.rect||t.bounds?(r=this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].top*this.pdfViewerBase.getZoomFactor()+this.getAnnotationTop(t)*this.pdfViewerBase.getZoomFactor(),this.isAnnotDeletionApiCall||(o=(r-20).toString(),this.pdfViewerBase.viewerContainer.scrollTop=parseInt(o,10),this.pdfViewerBase.viewerContainer.scrollLeft=this.getAnnotationLeft(t)*this.pdfViewerBase.getZoomFactor())):this.pdfViewer.navigation&&this.pdfViewer.navigation.goToPage(e+1):t.bounds?(r=this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].top*this.pdfViewerBase.getZoomFactor()+t.bounds.top*this.pdfViewerBase.getZoomFactor(),o=t.bounds.left*this.pdfViewerBase.getZoomFactor(),"Ink"===t.shapeAnnotationType&&(r=this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].top*this.pdfViewerBase.getZoomFactor()+t.bounds.y*this.pdfViewerBase.getZoomFactor(),o=t.bounds.x*this.pdfViewerBase.getZoomFactor()),this.isAnnotDeletionApiCall||(r=(r-20).toString(),this.pdfViewerBase.viewerContainer.scrollTop=parseInt(r,10),this.pdfViewerBase.viewerContainer.scrollLeft=o)):this.pdfViewer.navigation&&this.pdfViewer.navigation.goToPage(e+1),n?(this.previousIndex&&this.pdfViewer.clearSelection(this.previousIndex),this.pdfViewer.clearSelection(e),this.previousIndex=e,"textMarkup"===t.shapeAnnotationType?(this.pdfViewer.annotationModule.textMarkupAnnotationModule.clearCurrentAnnotationSelection(e,!0),o="_blendAnnotationsIntoCanvas_"==(r="Highlight"===t.textMarkupAnnotationType?"_blendAnnotationsIntoCanvas_":"_annotationCanvas_")?this.pdfViewerBase.getElement(r+e):this.pdfViewerBase.getAnnotationCanvas(r,e),(r=this.getTextMarkupAnnotations(e,t))&&(this.textMarkupAnnotationModule.currentTextMarkupAnnotation=null,this.textMarkupAnnotationModule.isSelectedAnnotation=!0,this.textMarkupAnnotationModule.showHideDropletDiv(!0),this.textMarkupAnnotationModule.annotationClickPosition=null,this.textMarkupAnnotationModule.selectAnnotation(r,o,e,null,!0),this.textMarkupAnnotationModule.currentTextMarkupAnnotation=r,this.textMarkupAnnotationModule.selectTextMarkupCurrentPage=e,this.textMarkupAnnotationModule.enableAnnotationPropertiesTool(!0),this.textMarkupAnnotationModule.isSelectedAnnotation=!1,this.pdfViewer.toolbarModule)&&this.pdfViewer.enableAnnotationToolbar&&(this.pdfViewer.toolbarModule.annotationToolbarModule.isToolbarHidden=!0,this.pdfViewer.toolbarModule.annotationToolbarModule.showAnnotationToolbar(this.pdfViewer.toolbarModule.annotationItem))):"stamp"===t.shapeAnnotationType||"stamp"===t.ShapeAnnotationType?(this.pdfViewer.select([t.uniqueKey],s),this.pdfViewer.annotation.onAnnotationMouseDown()):"sticky"===t.shapeAnnotationType||"sticky"===t.ShapeAnnotationType?(this.pdfViewer.select([t.annotationId],s),this.pdfViewer.annotation.onAnnotationMouseDown()):t.uniqueKey?(this.pdfViewer.select([t.uniqueKey],s),this.pdfViewer.annotation.onAnnotationMouseDown()):(this.selectAnnotationId=i,this.isAnnotationSelected=!0,this.annotationPageIndex=e,this.annotationType=t.stampAnnotationType),(o=document.getElementById(this.pdfViewer.element.id+"_commantPanel"))&&"block"===o.style.display&&((r=document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+this.pdfViewer.currentPageNumber))&&r.ej2_instances[0].expandItem(!0),s=document.getElementById(i))&&!s.classList.contains("e-pv-comments-border")&&s.firstChild.click()):t.uniqueKey||"textMarkup"===t.shapeAnnotationType&&"Imported Annotation"===t.annotationAddMode||!this.isAnnotDeletionApiCall?(this.selectAnnotationId=i,this.isAnnotationSelected=!0,this.annotationPageIndex=e,this.annotationType=t.stampAnnotationType,(t.uniqueKey||"textMarkup"===t.shapeAnnotationType&&"Imported Annotation"===t.annotationAddMode)&&this.selectAnnotationFromCodeBehind()):n||t.uniqueKey||!this.isAnnotDeletionApiCall||(this.nonRenderSelectedAnnotation=t))},JSt.prototype.updateCollectionForNonRenderedPages=function(e,t,i){var n,o=this.pdfViewer.annotationCollection,r=(o.length&&(n=(o=o.filter(function(e){return e.annotationId===t}))[0],this.updateAnnotationCollection(o[0])),this.getTypeOfAnnotation(e)),s=this.pdfViewerBase.documentAnnotationCollections[parseInt(i.toString(),10)];if(s[""+r].length)for(var a=0;a<s[""+r].length;a++)if(s[""+r][parseInt(a.toString(),10)].AnnotName===e.annotationId){var l=s[""+r][parseInt(a.toString(),10)];this.removedDocumentAnnotationCollection.push(l),s[""+r].splice(a,1);break}return n},JSt.prototype.getTypeOfAnnotation=function(e){var t;return e.id&&"shape"===e.id.toLowerCase()?t="shapeAnnotation":e.id&&"measure"===e.id.toLowerCase()?t="measureShapeAnnotation":e.id&&"freetext"===e.id.toLowerCase()?t="freeTextAnnotation":e.shapeAnnotationType&&"textmarkup"===e.shapeAnnotationType.toLowerCase()?t="textMarkupAnnotation":e.shapeAnnotationType&&"stamp"===e.shapeAnnotationType.toLowerCase()?t="stampAnnotations":e.shapeAnnotationType&&"ink"===e.shapeAnnotationType.toLowerCase()?t="signatureInkAnnotation":e.shapeAnnotationType&&"sticky"===e.shapeAnnotationType.toLowerCase()&&(t="stickyNotesAnnotation"),t},JSt.prototype.removeCommentPanelDiv=function(e){e&&(1===e.parentElement.childElementCount?this.stickyNotesAnnotationModule.updateAccordionContainer(e):e.remove())},JSt.prototype.clearSelection=function(){var e;this.textMarkupAnnotationModule&&this.textMarkupAnnotationModule.currentTextMarkupAnnotation?(this.textMarkupAnnotationModule.clearCurrentSelectedAnnotation(),this.textMarkupAnnotationModule.clearCurrentAnnotationSelection(this.textMarkupAnnotationModule.selectTextMarkupCurrentPage)):this.pdfViewer.selectedItems&&this.pdfViewer.selectedItems.annotations[0]?(e=this.pdfViewer.selectedItems.annotations[0],this.pdfViewer.clearSelection(e.pageIndex)):this.pdfViewer.clearSelection(this.pdfViewer.currentPageNumber-1)},JSt.prototype.getAnnotationTop=function(e){return e.rect&&(e.rect.Top||e.rect.top)?e.rect.Top||e.rect.top:e.bounds[0].Top||e.bounds[0].top},JSt.prototype.getAnnotationLeft=function(e){return e.rect?e.rect.Left||e.rect.left:e.bounds[0].Left||e.bounds[0].left},JSt.prototype.selectAnnotationFromCodeBehind=function(){var e,t,i,n,o,r;this.isAnnotationSelected&&this.selectAnnotationId&&(e=this.getAnnotationsFromAnnotationCollections(this.selectAnnotationId),t=this.selectAnnotationId,r=e.pageNumber,i=this.pdfViewer.annotationSelectorSettings,e&&0<=this.annotationPageIndex&&this.annotationPageIndex===r&&(this.previousIndex&&this.pdfViewer.clearSelection(this.previousIndex),this.pdfViewer.clearSelection(r),this.previousIndex=r,"textMarkup"===e.shapeAnnotationType?(this.pdfViewer.annotationModule.textMarkupAnnotationModule.clearCurrentAnnotationSelection(r,!0),n="_blendAnnotationsIntoCanvas_"==(n="Highlight"===e.textMarkupAnnotationType?"_blendAnnotationsIntoCanvas_":"_annotationCanvas_")?this.pdfViewerBase.getElement(n+r):this.pdfViewerBase.getAnnotationCanvas(n,r),(o=this.getTextMarkupAnnotations(r,e))&&(this.textMarkupAnnotationModule.currentTextMarkupAnnotation=null,this.textMarkupAnnotationModule.isSelectedAnnotation=!0,this.textMarkupAnnotationModule.showHideDropletDiv(!0),this.textMarkupAnnotationModule.annotationClickPosition=null,this.textMarkupAnnotationModule.selectAnnotation(o,n,r),this.textMarkupAnnotationModule.currentTextMarkupAnnotation=o,this.textMarkupAnnotationModule.selectTextMarkupCurrentPage=r,this.textMarkupAnnotationModule.enableAnnotationPropertiesTool(!0),this.textMarkupAnnotationModule.isSelectedAnnotation=!1,this.pdfViewer.toolbarModule)&&this.pdfViewer.enableAnnotationToolbar&&(this.pdfViewer.toolbarModule.annotationToolbarModule.isToolbarHidden=!0,this.pdfViewer.toolbarModule.annotationToolbarModule.showAnnotationToolbar(this.pdfViewer.toolbarModule.annotationItem))):("stamp"===e.shapeAnnotationType||"stamp"===e.ShapeAnnotationType||"sticky"!==e.shapeAnnotationType&&"sticky"!==e.ShapeAnnotationType&&e.uniqueKey?this.pdfViewer.select([e.uniqueKey],i):this.pdfViewer.select([e.annotationId],i),this.pdfViewer.annotation.onAnnotationMouseDown()),n=document.getElementById(this.pdfViewer.element.id+"_commantPanel"))&&"block"===n.style.display&&((o=document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+this.pdfViewer.currentPageNumber))&&o.ej2_instances[0].expandItem(!0),r=document.getElementById(t))&&!r.classList.contains("e-pv-comments-border")&&r.firstChild.click(),this.isAnnotationSelected=!1,this.selectAnnotationId=null,this.annotationPageIndex=null)},JSt.prototype.findRenderPageList=function(e){var t=!1,i=this.pdfViewerBase.renderedPagesList;if(i)for(var n=0;n<i.length;n++)if(i[parseInt(n.toString(),10)]===e)return t=!0;return t},JSt.prototype.getAnnotationsFromAnnotationCollections=function(e){var t=this.pdfViewer.annotationCollection;if(t&&e)for(var i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].annotationId===e)return t[parseInt(i.toString(),10)];0===this.pdfViewer.selectedItems.annotations.length&&this.pdfViewer.selectedItems.annotations.push(this.pdfViewer.nameTable[""+e])},JSt.prototype.getTextMarkupAnnotations=function(e,t){var i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_textMarkup");if(i=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_textMarkup"]:i){var n=JSON.parse(i),o=this.getPageCollection(n,e);if(null!=o&&n[parseInt(o.toString(),10)])for(var r=0;r<n[parseInt(o.toString(),10)].annotations.length;r++)if(n[parseInt(o.toString(),10)].annotations[parseInt(r.toString(),10)].annotName===t.annotationId)return n[parseInt(o.toString(),10)].annotations[parseInt(r.toString(),10)]}return null},JSt.prototype.getAnnotationType=function(e,t){var i;if(""===t||je(t))switch(e){case"Line":i="Line";break;case"LineWidthArrowHead":i="Arrow";break;case"Rectangle":i="Rectangle";break;case"Ellipse":i="Circle";break;case"Polygon":i="Polygon";break;case"Stamp":i="Stamp";break;case"Image":i="Image";break;case"FreeText":i="FreeText";break;case"Ink":i="Ink";break;case"StickyNotes":i="StickyNotes"}else switch(t){case"Distance":i="Distance";break;case"Perimeter":i="Perimeter";break;case"Area":i="Area";break;case"Radius":i="Radius";break;case"Volume":i="Volume"}return i},JSt.prototype.getAnnotationIndex=function(e,t){for(var i=this.pdfViewer.drawing.getPageObjects(e),n=null,o=0;o<i.length;o++)if(i[parseInt(o.toString(),10)].id===t){n=o;break}return n},JSt.prototype.initializeCollection=function(){this.actionCollection=[],this.redoCollection=[],this.popupNote||this.createNote()},JSt.prototype.showCommentsPanel=function(){var e,t,i;this.pdfViewer.enableCommentPanel&&(e=document.getElementById(this.pdfViewer.element.id+"_commantPanel"))&&"none"===e.style.display&&(e.style.display="block",F.isDevice&&!N&&document.getElementById(this.pdfViewer.element.id+"_viewerMainContainer").insertBefore(this.pdfViewerBase.navigationPane.commentPanelContainer,this.pdfViewer.toolbarModule.toolbarElement),this.pdfViewerBase.navigationPane.commentPanelResizer&&(this.pdfViewerBase.navigationPane.commentPanelResizer.style.display="block"),this.pdfViewerBase.navigationPane.setCommentPanelResizeIconTop(),this.pdfViewer.annotation.stickyNotesAnnotationModule.updateCommentPanelTextTop(),t=document.getElementById(this.pdfViewer.element.id+"_viewerContainer"),i=document.getElementById(this.pdfViewer.element.id+"_pageViewContainer"),t&&(this.pdfViewer.enableRtl?t.style.left=this.pdfViewerBase.navigationPane.getViewerContainerRight()+"px":t.style.right=this.pdfViewerBase.navigationPane.getViewerContainerRight()+"px",t.style.width=this.pdfViewer.element.clientWidth-this.pdfViewerBase.navigationPane.getViewerContainerLeft()-this.pdfViewerBase.navigationPane.getViewerContainerRight()+"px",i.style.width=t.offsetWidth-this.pdfViewerBase.navigationPane.getViewerContainerScrollbarWidth()+"px"),this.pdfViewerBase.updateZoomValue(),this.pdfViewer.annotation&&this.pdfViewer.annotation.textMarkupAnnotationModule&&this.pdfViewer.annotation.textMarkupAnnotationModule.showHideDropletDiv(!0),!F.isDevice||this.pdfViewer.enableDesktopMode||N||(e.style.height=this.pdfViewerBase.viewerMainContainer.clientHeight+"px",0<this.pdfViewer.selectedItems.annotations.length&&((i=document.getElementById(this.pdfViewer.selectedItems.annotations[0].annotName))&&i.lastElementChild.children[1]&&i.lastElementChild.children[1].ej2_instances?i.lastElementChild.children[1].ej2_instances[0].enableEditMode=!0:i&&i.lastElementChild.ej2_instances&&(i.lastElementChild.ej2_instances[0].enableEditMode=!0,i.lastElementChild.style.display="block",i.lastElementChild.children[1])&&(i.lastElementChild.children[1].style.display="block")),this.pdfViewer.toolbarModule.annotationToolbarModule.toolbar&&(this.pdfViewer.toolbarModule.annotationToolbarModule.toolbar.element.style.display="none",this.pdfViewer.toolbarModule.annotationToolbarModule.propertyToolbar)&&(this.pdfViewer.toolbarModule.annotationToolbarModule.propertyToolbar.element.style.display="none")),je(this.pdfViewerBase.navigationPane)||this.pdfViewerBase.navigationPane.calculateCommentPanelWidth())},JSt.prototype.addAction=function(e,t,i,n,o,r,s){this.actionCollection.push({pageIndex:e,index:t,annotation:i,action:n,modifiedProperty:o,undoElement:r,redoElement:s}),this.updateToolbar()},JSt.prototype.undo=function(){var i=this,n=this.actionCollection.pop();if(n){var e=n.annotation.shapeAnnotationType;switch(this.isUndoRedoAction=!0,this.isUndoAction=!0,n.action){case"Text Markup Added":case"Text Markup Deleted":this.textMarkupAnnotationModule&&this.textMarkupAnnotationModule.undoTextMarkupAction(n.annotation,n.pageIndex,n.index,n.action);break;case"Text Markup Property modified":this.textMarkupAnnotationModule&&(n.annotation=this.textMarkupAnnotationModule.undoRedoPropertyChange(n.annotation,n.pageIndex,n.index,n.modifiedProperty,!0));break;case"Drag":case"Resize":$bt(n.annotation)?this.pdfViewer.nodePropertyChange(n.annotation,{bounds:n.undoElement.bounds,vertexPoints:n.undoElement.vertexPoints,leaderHeight:n.undoElement.leaderHeight}):this.pdfViewer.nodePropertyChange(n.annotation,{bounds:n.undoElement.bounds}),"Distance"!==n.annotation.measureType&&"Perimeter"!==n.annotation.measureType&&"Area"!==n.annotation.measureType&&"Radius"!==n.annotation.measureType&&"Volume"!==n.annotation.measureType||(this.pdfViewer.nodePropertyChange(n.annotation,{notes:n.undoElement.notes}),this.updateCalibrateValues(n.annotation)),n.annotation.formFieldAnnotationType&&this.pdfViewer.formDesigner.updateHTMLElement(n.annotation),this.pdfViewer.clearSelection(this.pdfViewerBase.activeElements.activePageID),this.pdfViewer.select([n.annotation.id]),"Line"!==n.annotation.shapeAnnotationType&&"Rectangle"!==n.annotation.shapeAnnotationType&&"Ellipse"!==n.annotation.shapeAnnotationType&&"Polygon"!==n.annotation.shapeAnnotationType&&"LineWidthArrowHead"!==n.annotation.shapeAnnotationType&&"Radius"!==n.annotation.shapeAnnotationType&&"FreeText"!==n.annotation.shapeAnnotationType&&"HandWrittenSignature"!==n.annotation.shapeAnnotationType&&"SignatureText"!==n.annotation.shapeAnnotationType&&"SignatureImage"!==n.annotation.shapeAnnotationType&&"Ink"!==n.annotation.shapeAnnotationType||this.modifyInCollections(n.annotation,"bounds");break;case"Addition":this.pdfViewer.formDesigner&&n.annotation.formFieldAnnotationType?this.pdfViewer.formDesigner.deleteFormField(n.undoElement.id,!1):(d=!1,"Line"!==e&&"LineWidthArrowHead"!==e&&"Polygon"!==e&&"Ellipse"!==e&&"Rectangle"!==e&&"Radius"!==e&&"Distance"!==e||(""===n.annotation.measureType||je(n.annotation.measureType)?this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(n.annotation,"shape",null,!0):this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(n.annotation,"measure",null,!0),d=!0,(t=n.annotation.wrapper||null)&&t.bounds&&(n.annotation.bounds=t.bounds),n.duplicate=this.modifyInCollections(n.annotation,"delete")),"Stamp"!==e&&"Image"!==e||(this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(n.annotation,n.annotation.shapeAnnotationType,"delete",!0),this.stampAnnotationModule.updateSessionStorage(n.annotation,null,"delete"),n.duplicate=this.modifyInCollections(n.annotation,"delete"),d=!0),"FreeText"!==e&&"HandWrittenSignature"!==e&&"SignatureImage"!==e&&"SignatureText"!==e&&"Ink"!==e||(this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(n.annotation,n.annotation.shapeAnnotationType,"delete",d=!0),n.duplicate=this.modifyInCollections(n.annotation,"delete")),d||this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(n.annotation,n.annotation.shapeAnnotationType,"delete",!0),this.pdfViewer.clearSelection(je(this.pdfViewerBase.activeElements.activePageID)||isNaN(this.pdfViewerBase.activeElements.activePageID)?n.annotation.pageIndex:this.pdfViewerBase.activeElements.activePageID),this.pdfViewer.remove(n.annotation),this.pdfViewer.annotationCollection.filter(function(e){var t=e.annotationId!==n.annotation.annotName;return t&&(e=document.getElementById(e.annotName))&&(1===e.parentElement.childElementCount?i.stickyNotesAnnotationModule.updateAccordionContainer(e):e.parentElement.removeChild(e)),!t}),this.pdfViewer.renderDrawing(null,n.annotation.pageIndex),(t=document.getElementById(n.annotation.annotName))&&(1===t.parentElement.childElementCount?this.stickyNotesAnnotationModule.updateAccordionContainer(t):t.parentElement.removeChild(t)),F.isDevice&&!this.pdfViewer.enableDesktopMode&&(d=document.getElementById(this.pdfViewer.element.id+"_propertyToolbar"))&&0<d.children.length&&(this.pdfViewer.toolbarModule.annotationToolbarModule.toolbarCreated=!1,this.pdfViewer.toolbarModule.annotationToolbarModule.createAnnotationToolbarForMobile()));break;case"Delete":if(this.pdfViewer.formDesigner&&n.annotation.formFieldAnnotationType)n.undoElement.bounds.x=n.undoElement.wrapper.bounds.x,n.undoElement.bounds.y=n.undoElement.wrapper.bounds.y,this.pdfViewer.formDesigner.drawFormField(n.undoElement);else{"Line"!==e&&"LineWidthArrowHead"!==e&&"Polygon"!==e&&"Ellipse"!==e&&"Rectangle"!==e&&"Radius"!==e&&"Distance"!==e||(""===n.annotation.measureType||je(n.annotation.measureType)?(e="shape",this.shapeAnnotationModule):(e="shape_measure",this.measureAnnotationModule)).addInCollection(n.annotation.pageIndex,n.undoElement),"Stamp"===e||"Image"===e?this.stampAnnotationModule.updateDeleteItems(n.annotation.pageIndex,n.annotation):"FreeText"===e?this.freeTextAnnotationModule.addInCollection(n.annotation.pageIndex,n.undoElement):"Ink"===e?this.inkAnnotationModule.addInCollection(n.annotation.pageIndex,n.undoElement):"HandWrittenSignature"!==e&&"SignatureText"!==e&&"SignatureImage"!==e||this.pdfViewerBase.signatureModule.addInCollection(n.annotation.pageIndex,n.undoElement),n.annotation.annotationId||(t=this.pdfViewer.add(n.annotation),("FreeText"===e||t.enableShapeLabel)&&t&&this.pdfViewer.nodePropertyChange(t,{}));var t,o=void 0;if(null!=(o=n.annotation.id?this.pdfViewer.nameTable[n.annotation.id.split("_")[0]]:o)&&("SignatureField"===o.formFieldAnnotationType||"InitialField"===o.formFieldAnnotationType)){o.wrapper.children.push(n.annotation.wrapper.children[0]),"SignatureText"===n.annotation.shapeAnnotationType&&o.wrapper.children.push(n.annotation.wrapper.children[1]);var r=n.annotation.id.split("_")[0]+"_content",s=null;if(s=this.pdfViewer.formDesignerModule?this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"):s){for(var a,l=JSON.parse(s),h=0;h<l.length;h++)l[parseInt(h.toString(),10)].Key===r&&("SignatureText"===n.annotation.shapeAnnotationType?(l[parseInt(h.toString(),10)].FormField.signatureType="Text",l[parseInt(h.toString(),10)].FormField.value=n.annotation.data,this.pdfViewerBase.formFieldCollection[parseInt(h.toString(),10)].FormField.value=n.annotation.data,this.pdfViewerBase.formFieldCollection[parseInt(h.toString(),10)].FormField.signatureType="Text"):"SignatureImage"===n.annotation.shapeAnnotationType?(l[parseInt(h.toString(),10)].FormField.signatureType="Image",l[parseInt(h.toString(),10)].FormField.value=n.annotation.data,this.pdfViewerBase.formFieldCollection[parseInt(h.toString(),10)].FormField.value=n.annotation.data,this.pdfViewerBase.formFieldCollection[parseInt(h.toString(),10)].FormField.signatureType="Image"):(l[parseInt(h.toString(),10)].FormField.signatureType="Path",this.pdfViewerBase.formFieldCollection[parseInt(h.toString(),10)].FormField.signatureType="Path",a=cbt(rbt(n.annotation.data)),l[parseInt(h.toString(),10)].FormField.value=JSON.stringify(a),this.pdfViewerBase.formFieldCollection[parseInt(h.toString(),10)].FormField.value=JSON.stringify(a)));this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")}}this.pdfViewer.renderDrawing(null,n.annotation.pageIndex),this.pdfViewer.annotationModule.stickyNotesAnnotationModule.addAnnotationComments(n.annotation.pageIndex,e,!0),n.annotation.annotationId&&(d=this.removedAnnotationCollection[this.removedAnnotationCollection.length-1],t=this.getTypeOfAnnotation(d),this.pdfViewer.annotationCollection.push(d),this.removedAnnotationCollection.splice(this.removedAnnotationCollection.length-1),d=0<=n.annotation.pageNumber?n.annotation.pageNumber:n.annotation.pageIndex,this.pdfViewerBase.documentAnnotationCollections[parseInt(d.toString(),10)][""+t].push(this.removedDocumentAnnotationCollection[this.removedDocumentAnnotationCollection.length-1]),this.removedDocumentAnnotationCollection.splice(this.removedDocumentAnnotationCollection.length-1))}break;case"stampOpacity":this.pdfViewer.nodePropertyChange(n.annotation,{opacity:n.undoElement.opacity}),this.stickyNotesAnnotationModule.updateAnnotationModifiedDate(n.annotation,null,!0),n.annotation.modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime();break;case"Shape Stroke":this.pdfViewer.nodePropertyChange(n.annotation,{strokeColor:n.undoElement.strokeColor}),this.modifyInCollections(n.annotation,"stroke"),this.pdfViewer.renderDrawing();break;case"Shape Fill":this.pdfViewer.nodePropertyChange(n.annotation,{fillColor:n.undoElement.fillColor}),this.modifyInCollections(n.annotation,"fill"),this.pdfViewer.renderDrawing();break;case"Shape Opacity":this.pdfViewer.nodePropertyChange(n.annotation,{opacity:n.undoElement.opacity}),"StickyNotes"===n.annotation.shapeAnnotationType?(this.stickyNotesAnnotationModule.updateOpacityValue(n.annotation),this.stickyNotesAnnotationModule.updateAnnotationModifiedDate(n.annotation,null,!0),n.annotation.modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime()):this.modifyInCollections(n.annotation,"opacity"),this.pdfViewer.renderDrawing();break;case"Shape Thickness":this.pdfViewer.nodePropertyChange(n.annotation,{thickness:n.undoElement.thickness}),this.modifyInCollections(n.annotation,"thickness"),this.pdfViewer.renderDrawing();break;case"Line properties change":this.pdfViewer.nodePropertyChange(n.annotation,{fillColor:n.undoElement.fillColor,borderDashArray:n.undoElement.borderDashArray,borderStyle:n.undoElement.borderStyle,strokeColor:n.undoElement.strokeColor,opacity:n.undoElement.opacity,thickness:n.undoElement.thickness,sourceDecoraterShapes:this.getArrowType(n.undoElement.lineHeadStart),taregetDecoraterShapes:this.getArrowType(n.undoElement.lineHeadEnd)}),this.updateCollectionForLineProperty(n.annotation),this.pdfViewer.renderDrawing();break;case"Text Property Added":n.annotation=this.pdfViewer.annotationModule.stickyNotesAnnotationModule.undoAction(n.annotation,n.action,n.undoElement),this.stickyNotesAnnotationModule.updateAnnotationModifiedDate(n.annotation,null,!0),n.annotation.modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime();break;case"Comments Property Added":case"Status Property Added":case"Comments Reply Deleted":n.annotation=this.pdfViewer.annotationModule.stickyNotesAnnotationModule.undoAction(n.annotation,n.action,n.undoElement);break;case"dynamicText Change":this.pdfViewer.annotation.freeTextAnnotationModule.isFreeTextValueChange=!0,n.annotation.dynamicText=n.undoElement.dynamicText,this.pdfViewer.selectedItems.annotations[0]&&(this.pdfViewer.selectedItems.annotations[0].dynamicText=n.undoElement.dynamicText),this.pdfViewer.annotationModule.stickyNotesAnnotationModule.undoAction(n.annotation,n.action,n.undoElement),this.stickyNotesAnnotationModule.updateAnnotationModifiedDate(n.annotation,null,!0),this.modifyInCollections(n.annotation,"dynamicText"),this.pdfViewer.selectedItems.annotations[0]?this.pdfViewer.nodePropertyChange(this.pdfViewer.selectedItems.annotations[0],{}):this.pdfViewer.nodePropertyChange(n.annotation,{}),this.pdfViewer.annotation.freeTextAnnotationModule.isFreeTextValueChange=!1,this.pdfViewer.clearSelection(this.pdfViewerBase.activeElements.activePageID);break;case"fontColor":this.pdfViewer.nodePropertyChange(n.annotation,{fontColor:n.undoElement.fontColor}),this.modifyInCollections(n.annotation,"fontColor"),this.pdfViewer.renderDrawing();break;case"fontSize":this.isFreeTextFontsizeChanged=!0,this.pdfViewer.nodePropertyChange(n.annotation,{fontSize:n.undoElement.fontSize}),this.modifyInCollections(n.annotation,"fontSize"),this.pdfViewer.renderDrawing();break;case"fontFamily":this.pdfViewer.nodePropertyChange(n.annotation,{fontFamily:n.undoElement.fontFamily}),this.modifyInCollections(n.annotation,"fontFamily"),this.pdfViewer.renderDrawing();break;case"textAlign":this.pdfViewer.nodePropertyChange(n.annotation,{textAlign:n.undoElement.textAlign}),this.modifyInCollections(n.annotation,"textAlign"),this.pdfViewer.renderDrawing();break;case"textPropertiesChange":this.pdfViewer.nodePropertyChange(n.annotation,{font:n.undoElement.font}),this.modifyInCollections(n.annotation,"textPropertiesChange"),this.pdfViewer.renderDrawing();break;case"Rotate":this.pdfViewer.nodePropertyChange(n.annotation.annotations[0],{bounds:n.undoElement.bounds,rotateAngle:n.undoElement.rotateAngle}),this.modifyInCollections(n.annotation.annotations[0],"bounds"),this.pdfViewer.renderDrawing();break;case"FormDesigner Properties Change":n.undoElement&&n.undoElement.isMultiline!==n.redoElement.isMultiline&&this.undoRedoMultiline(n.undoElement),this.updateFormFieldPropertiesChanges(n.undoElement.formFieldAnnotationType,n.undoElement);break;case"FormField Value Change":if(n.annotation.formFieldAnnotationType)"RadioButton"===n.annotation.formFieldAnnotationType?(this.updateFormFieldValueChange(n.annotation.formFieldAnnotationType,n.undoElement,!1),this.updateFormFieldValueChange(n.annotation.formFieldAnnotationType,n.redoElement,!0)):this.updateFormFieldValueChange(n.annotation.formFieldAnnotationType,n.annotation,n.undoElement);else{document.getElementById(n.annotation.id+"_html_element").children[0].children[0].className="e-pdfviewer-signatureformfields";var o=this.pdfViewer.nameTable[n.annotation.id.split("_")[0]],d=this.pdfViewer.nameTable[n.annotation.id],r=("SignatureField"!==n.annotation.annotName&&"SignatureText"!==n.annotation.annotName||(n.annotation.bounds=d.wrapper.bounds),o.wrapper.children.splice(o.wrapper.children.indexOf(d.wrapper.children[0]),1),"SignatureText"===n.annotation.shapeAnnotationType&&o.wrapper.children.splice(o.wrapper.children.indexOf(d.wrapper.children[1]),1),n.annotation.id.split("_")[0]+"_content"),s=null;if(s=this.pdfViewer.formDesignerModule?this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"):s){for(l=JSON.parse(s),h=0;h<l.length;h++)l[parseInt(h.toString(),10)].Key===r&&(l[parseInt(h.toString(),10)].FormField.value="",l[parseInt(h.toString(),10)].FormField.signatureType="",this.pdfViewerBase.formFieldCollection[parseInt(h.toString(),10)].FormField.value="",this.pdfViewerBase.formFieldCollection[parseInt(h.toString(),10)].FormField.signatureType="");this.pdfViewer.remove(n.annotation),this.pdfViewer.renderDrawing(),this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")}}}this.redoCollection.push(n),this.updateToolbar(),this.isUndoRedoAction=!1,this.isUndoAction=!1}},JSt.prototype.redo=function(){var e=this.redoCollection.pop(),t=this.pdfViewer.nameTable[e.annotation.id];if(e){var i=e.annotation.shapeAnnotationType;switch(this.isUndoRedoAction=!0,e.action){case"Text Markup Property modified":this.textMarkupAnnotationModule&&(e.annotation=this.textMarkupAnnotationModule.undoRedoPropertyChange(e.annotation,e.pageIndex,e.index,e.modifiedProperty));break;case"Text Markup Added":case"Text Markup Deleted":this.textMarkupAnnotationModule&&this.textMarkupAnnotationModule.redoTextMarkupAction(e.annotation,e.pageIndex,e.index,e.action);break;case"Drag":case"Resize":$bt(e.annotation)?this.pdfViewer.nodePropertyChange(t,{bounds:e.redoElement.bounds,vertexPoints:e.redoElement.vertexPoints,leaderHeight:e.redoElement.leaderHeight}):this.pdfViewer.nodePropertyChange(t,{bounds:e.redoElement.bounds}),"Distance"!==e.annotation.measureType&&"Perimeter"!==e.annotation.measureType&&"Area"!==e.annotation.measureType&&"Radius"!==e.annotation.measureType&&"Volume"!==e.annotation.measureType||(this.pdfViewer.nodePropertyChange(t,{notes:e.redoElement.notes}),this.updateCalibrateValues(t)),e.annotation.formFieldAnnotationType&&this.pdfViewer.formDesigner.updateHTMLElement(e.annotation),this.pdfViewer.clearSelection(this.pdfViewerBase.activeElements.activePageID),this.pdfViewer.select([t.id]),"Line"!==e.annotation.shapeAnnotationType&&"Rectangle"!==e.annotation.shapeAnnotationType&&"Ellipse"!==e.annotation.shapeAnnotationType&&"Polygon"!==e.annotation.shapeAnnotationType&&"LineWidthArrowHead"!==e.annotation.shapeAnnotationType&&"Radius"!==e.annotation.shapeAnnotationType&&"FreeText"!==e.annotation.shapeAnnotationType&&"HandWrittenSignature"!==e.annotation.shapeAnnotationType&&"SignatureText"!==e.annotation.shapeAnnotationType&&"SignatureImage"!==e.annotation.shapeAnnotationType&&"Ink"!==e.annotation.shapeAnnotationType||this.modifyInCollections(t,"bounds");break;case"Addition":this.pdfViewer.formDesigner&&e.annotation.formFieldAnnotationType?(e.redoElement.bounds.x=e.redoElement.wrapper.bounds.x,e.redoElement.bounds.y=e.redoElement.wrapper.bounds.y,this.pdfViewer.formDesigner.drawFormField(e.redoElement)):("Line"!==i&&"LineWidthArrowHead"!==i&&"Polygon"!==i&&"Ellipse"!==i&&"Rectangle"!==i&&"Radius"!==i&&"Distance"!==i||(""===e.annotation.measureType||je(e.annotation.measureType)?(i="shape",this.shapeAnnotationModule):(i="shape_measure",this.measureAnnotationModule)).addInCollection(e.annotation.pageIndex,e.duplicate),"FreeText"===i&&this.freeTextAnnotationModule.addInCollection(e.annotation.pageIndex,e.duplicate),"Stamp"!==i&&"Image"!==i||this.stampAnnotationModule.updateDeleteItems(e.annotation.pageIndex,e.redoElement),"HandWrittenSignature"!==i&&"SignatureText"!==i&&"SignatureImage"!==i||this.pdfViewerBase.signatureModule.addInCollection(e.annotation.pageIndex,e.duplicate),"Ink"===i&&this.inkAnnotationModule.addInCollection(e.annotation.pageIndex,e.duplicate),n=this.pdfViewer.add(e.annotation),this.pdfViewer.select([e.annotation.id]),("FreeText"===i||n.enableShapeLabel)&&n&&this.pdfViewer.nodePropertyChange(n,{}),this.pdfViewer.renderDrawing(null,e.annotation.pageIndex),this.pdfViewer.annotationModule.stickyNotesAnnotationModule.addAnnotationComments(e.annotation.pageIndex,i,!1),F.isDevice&&!this.pdfViewer.enableDesktopMode&&(n=document.getElementById(this.pdfViewer.element.id+"_propertyToolbar"))&&0<n.children.length&&(this.pdfViewer.toolbarModule.annotationToolbarModule.toolbarCreated=!1,this.pdfViewer.toolbarModule.annotationToolbarModule.createAnnotationToolbarForMobile()));break;case"Delete":if(this.pdfViewer.formDesigner&&e.annotation.formFieldAnnotationType)this.pdfViewer.formDesigner.deleteFormField(e.redoElement.id,!1);else{var n=!1,o=e.annotation.shapeAnnotationType,o=("Line"!==i&&"LineWidthArrowHead"!==i&&"Polygon"!==i&&"Ellipse"!==i&&"Rectangle"!==i&&"Radius"!==i&&"Distance"!==i||(o=""===e.annotation.measureType||je(e.annotation.measureType)?"shape":"measure",this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(e.annotation,o,"delete"),this.modifyInCollections(e.annotation,"delete"),n=!0),"Stamp"!==i&&"Image"!==i||(this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(e.annotation,o,"delete"),this.stampAnnotationModule.updateSessionStorage(e.annotation,null,"delete"),this.modifyInCollections(e.annotation,"delete"),n=!0),"FreeText"!==i&&"HandWrittenSignature"!==i&&"SignatureText"!==i&&"SignatureImage"!==i||(this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(e.annotation,o,"delete"),this.modifyInCollections(e.annotation,"delete")),n||this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(e.annotation,o,"delete"),void 0);if(null!=(o=e.annotation.id?this.pdfViewer.nameTable[e.annotation.id.split("_")[0]]:o)&&("SignatureField"===o.formFieldAnnotationType||"InitialField"===o.formFieldAnnotationType)){o.wrapper.children.splice(o.wrapper.children.indexOf(e.annotation.wrapper.children[0]),1),"SignatureText"===e.annotation.shapeAnnotationType&&o.wrapper.children.splice(o.wrapper.children.indexOf(e.annotation.wrapper.children[1]),1);var r=e.annotation.id.split("_")[0]+"_content",s=null;if(s=this.pdfViewer.formDesignerModule?this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"):s){for(var a=JSON.parse(s),l=0;l<a.length;l++)a[parseInt(l.toString(),10)].Key===r&&(a[parseInt(l.toString(),10)].FormField.value="",a[parseInt(l.toString(),10)].FormField.signatureType="",this.pdfViewerBase.formFieldCollection[parseInt(l.toString(),10)].FormField.value="",this.pdfViewerBase.formFieldCollection[parseInt(l.toString(),10)].FormField.signatureType="");this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")}}this.pdfViewer.clearSelection(e.annotation.pageIndex),this.pdfViewer.remove(e.annotation),this.pdfViewer.renderDrawing(null,e.annotation.pageIndex);var n=e.annotation.annotName||e.annotation.annotationId,h=document.getElementById(n);this.removeCommentPanelDiv(h),e.annotation.annotationId&&(h=this.updateCollectionForNonRenderedPages(e.annotation,n,e.annotation.pageIndex),this.undoCommentsElement.push(h))}break;case"stampOpacity":this.pdfViewer.nodePropertyChange(t,{opacity:e.redoElement.opacity}),this.stickyNotesAnnotationModule.updateAnnotationModifiedDate(t,null,!0);break;case"Shape Stroke":this.pdfViewer.nodePropertyChange(t,{strokeColor:e.redoElement.strokeColor}),this.modifyInCollections(t,"stroke"),this.pdfViewer.renderDrawing();break;case"Shape Fill":this.pdfViewer.nodePropertyChange(t,{fillColor:e.redoElement.fillColor}),this.modifyInCollections(t,"fill"),this.pdfViewer.renderDrawing();break;case"Shape Opacity":this.pdfViewer.nodePropertyChange(t,{opacity:e.redoElement.opacity}),"StickyNotes"===e.annotation.shapeAnnotationType?(this.stickyNotesAnnotationModule.updateOpacityValue(t),this.stickyNotesAnnotationModule.updateAnnotationModifiedDate(t,null,!0)):this.modifyInCollections(t,"opacity"),this.pdfViewer.renderDrawing();break;case"Shape Thickness":this.pdfViewer.nodePropertyChange(t,{thickness:e.redoElement.thickness}),this.modifyInCollections(t,"thickness"),this.pdfViewer.renderDrawing();break;case"Line properties change":this.pdfViewer.nodePropertyChange(t,{fillColor:e.redoElement.fillColor,strokeColor:e.redoElement.strokeColor,opacity:e.redoElement.opacity,thickness:e.redoElement.thickness,sourceDecoraterShapes:this.getArrowType(e.redoElement.lineHeadStart),taregetDecoraterShapes:this.getArrowType(e.redoElement.lineHeadEnd),borderDashArray:e.redoElement.borderDashArray,borderStyle:e.redoElement.borderStyle}),this.updateCollectionForLineProperty(t),this.pdfViewer.renderDrawing();break;case"Text Property Added":e.annotation=this.pdfViewer.annotationModule.stickyNotesAnnotationModule.redoAction(e.annotation,e.action,e.undoElement),this.stickyNotesAnnotationModule.updateAnnotationModifiedDate(e.annotation,null,!0);break;case"Comments Property Added":e.annotation=this.pdfViewer.annotationModule.stickyNotesAnnotationModule.redoAction(e.annotation,e.action,e.undoElement);break;case"Status Property Added":case"Comments Reply Deleted":e.annotation=this.pdfViewer.annotationModule.stickyNotesAnnotationModule.redoAction(e.annotation,e.action);break;case"dynamicText Change":this.pdfViewer.annotation.freeTextAnnotationModule.isFreeTextValueChange=!0,t.dynamicText=e.redoElement.dynamicText;n=this.pdfViewer.selectedItems.annotations[0];n&&(n.dynamicText=e.redoElement.dynamicText,n.bounds.height=e.redoElement.bounds.height),this.pdfViewer.annotationModule.stickyNotesAnnotationModule.redoAction(e.annotation,e.action,e.undoElement),this.stickyNotesAnnotationModule.updateAnnotationModifiedDate(t,null,!0),this.modifyInCollections(t,"dynamicText"),n?this.pdfViewer.nodePropertyChange(n,{}):this.pdfViewer.nodePropertyChange(t,{}),this.pdfViewer.annotation.freeTextAnnotationModule.isFreeTextValueChange=!1,this.pdfViewer.clearSelection(this.pdfViewerBase.activeElements.activePageID),this.pdfViewer.select([t.id]);break;case"fontColor":this.pdfViewer.nodePropertyChange(t,{fontColor:e.redoElement.fontColor}),this.modifyInCollections(t,"fontColor"),this.pdfViewer.renderDrawing();break;case"fontSize":this.isFreeTextFontsizeChanged=!0,this.pdfViewer.nodePropertyChange(t,{fontSize:e.redoElement.fontSize}),this.modifyInCollections(t,"fontSize"),this.pdfViewer.renderDrawing();break;case"textAlign":this.pdfViewer.nodePropertyChange(t,{textAlign:e.redoElement.textAlign}),this.modifyInCollections(t,"textAlign"),this.pdfViewer.renderDrawing();break;case"textPropertiesChange":this.pdfViewer.nodePropertyChange(t,{font:e.redoElement.font}),this.modifyInCollections(t,"textPropertiesChange"),this.pdfViewer.renderDrawing();break;case"Rotate":this.pdfViewer.nodePropertyChange(e.annotation.annotations[0],{bounds:e.redoElement.bounds,rotateAngle:e.redoElement.rotateAngle}),this.modifyInCollections(e.annotation.annotations[0],"bounds"),this.pdfViewer.renderDrawing();break;case"FormDesigner Properties Change":e.redoElement&&e.undoElement.isMultiline!==e.redoElement.isMultiline&&this.undoRedoMultiline(e.redoElement),this.updateFormFieldPropertiesChanges(e.redoElement.formFieldAnnotationType,e.redoElement);break;case"FormField Value Change":if(e.annotation.formFieldAnnotationType)"RadioButton"===e.annotation.formFieldAnnotationType?(this.updateFormFieldValueChange(e.annotation.formFieldAnnotationType,e.undoElement,!0),this.updateFormFieldValueChange(e.annotation.formFieldAnnotationType,e.redoElement,!1)):this.updateFormFieldValueChange(e.annotation.formFieldAnnotationType,e.annotation,e.redoElement);else{document.getElementById(e.annotation.id+"_html_element").children[0].children[0].className="e-pdfviewer-signatureformfields-signature";o=this.pdfViewer.nameTable[e.annotation.id.split("_")[0]],h=this.pdfViewer.nameTable[e.annotation.id],r=(o.wrapper.children.push(h.wrapper.children[0]),"SignatureText"===e.annotation.shapeAnnotationType&&o.wrapper.children.push(h.wrapper.children[1]),e.annotation.id.split("_")[0]+"_content"),s=null;if(s=this.pdfViewer.formDesignerModule?this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"):s){for(var d,a=JSON.parse(s),l=0;l<a.length;l++)a[parseInt(l.toString(),10)].Key===r&&("SignatureText"===e.annotation.shapeAnnotationType?(a[parseInt(l.toString(),10)].FormField.signatureType="Text",a[parseInt(l.toString(),10)].FormField.value=e.annotation.data,this.pdfViewerBase.formFieldCollection[parseInt(l.toString(),10)].FormField.value=e.annotation.data,this.pdfViewerBase.formFieldCollection[parseInt(l.toString(),10)].FormField.signatureType="Text"):"SignatureImage"===e.annotation.shapeAnnotationType?(a[parseInt(l.toString(),10)].FormField.signatureType="Image",a[parseInt(l.toString(),10)].FormField.value=e.annotation.data,this.pdfViewerBase.formFieldCollection[parseInt(l.toString(),10)].FormField.value=e.annotation.data,this.pdfViewerBase.formFieldCollection[parseInt(l.toString(),10)].FormField.signatureType="Image"):(a[parseInt(l.toString(),10)].FormField.signatureType="Path",this.pdfViewerBase.formFieldCollection[parseInt(l.toString(),10)].FormField.signatureType="Path",d=cbt(rbt(e.annotation.data)),a[parseInt(l.toString(),10)].FormField.value=JSON.stringify(d),this.pdfViewerBase.formFieldCollection[parseInt(l.toString(),10)].FormField.value=JSON.stringify(d)));this.pdfViewer.add(e.annotation);n=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",e.pageIndex);this.pdfViewer.renderDrawing(n,e.pageIndex),this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")}}}e.redoElement&&void 0!==e.redoElement.modifiedDate&&(e.annotation.modifiedDate=e.redoElement.modifiedDate),this.actionCollection.push(e),this.updateToolbar(),this.isUndoRedoAction=!1}},JSt.prototype.undoRedoMultiline=function(e){e.isMultiline&&"Textbox"===e.formFieldAnnotationType?this.pdfViewer.formDesignerModule.renderMultilineText(e,!0):"Textbox"===e.formFieldAnnotationType&&this.pdfViewer.formDesignerModule.renderTextbox(e,!0)},JSt.prototype.updateFormFieldValueChange=function(e,t,i){if(t){var n=this.pdfViewer.formDesigner.getFormField(t.id.split("_")[0]),o=null;if(o=this.pdfViewer.formDesignerModule?this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"):o){var r=JSON.parse(o),s=this.pdfViewer.formDesigner.getFormFiledIndex(t.id.split("_")[0]);switch(e){case"Textbox":case"PasswordField":case"RadioButton":case"DropdownList":case"ListBox":var a=document.getElementById(t.id.split("_")[0]+"_content_html_element").firstElementChild.firstElementChild;if("Textbox"===e||"PasswordField"===e)n.value=i,this.pdfViewer.formDesigner.updateValuePropertyChange(n,a,!0,s,r);else if("RadioButton"===e)n.isSelected=i,this.pdfViewer.formDesigner.updateIsSelectedPropertyChange(n,a.firstElementChild,!0,s,r);else if("DropdownList"===e||"ListBox"===e)if(n.selectedIndex=i,r[parseInt(s.toString(),10)].FormField.selectedIndex=i,this.pdfViewerBase.formFieldCollection[parseInt(s.toString(),10)].FormField.selectedIndex=i,this.pdfViewer.nameTable[r[parseInt(s.toString(),10)].Key.split("_")[0]].selectedIndex=i,"ListBox"===e)for(var l=0;l<a.options.length;l++)a.options[parseInt(l.toString(),10)].selected=!!i.includes(l);else a.selectedIndex=i;break;case"Checkbox":var h=document.getElementById(t.id.split("_")[0]+"_content_html_element").firstElementChild.firstElementChild.lastElementChild;n.isChecked=i,this.pdfViewer.formDesigner.updateIsCheckedPropertyChange(n,h,!0,s,r)}this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")}}},JSt.prototype.updateFormFieldPropertiesChanges=function(e,t){switch(e){case"Textbox":case"PasswordField":this.pdfViewer.formDesigner.updateTextboxFormDesignerProperties(t,!0);break;case"Checkbox":this.pdfViewer.formDesigner.updateCheckboxFormDesignerProperties(t,!0,!0);break;case"RadioButton":this.pdfViewer.formDesigner.updateRadioButtonDesignerProperties(t,!0,!0);break;case"DropdownList":this.pdfViewer.formDesigner.updateDropdownFormDesignerProperties(t,!0);break;case"ListBox":this.pdfViewer.formDesigner.updateListBoxFormDesignerProperties(t,!0);break;case"SignatureField":case"InitialField":this.pdfViewer.formDesigner.updateSignatureTextboxProperties(t,!0)}},JSt.prototype.updateCollectionForLineProperty=function(e){this.modifyInCollections(e,"fill"),this.modifyInCollections(e,"stroke"),this.modifyInCollections(e,"opacity"),this.modifyInCollections(e,"thickness"),this.modifyInCollections(e,"dashArray"),this.modifyInCollections(e,"startArrow"),this.modifyInCollections(e,"endArrow")},JSt.prototype.updateToolbar=function(e){this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.updateUndoRedoButtons(),this.actionCollection&&0===this.actionCollection.length?this.pdfViewerBase.updateDocumentEditedProperty(!1):this.pdfViewerBase.updateDocumentEditedProperty(!0),e&&this.pdfViewerBase.updateDocumentEditedProperty(!0)},JSt.prototype.createNote=function(){this.popupNote=Q("div",{id:this.pdfViewer.element.id+"_annotation_note",className:"e-pv-annotation-note",styles:"display:none"}),this.popupNoteAuthor=Q("div",{id:this.pdfViewer.element.id+"_annotation_note_author",className:"e-pv-annotation-note-author"}),this.popupNote.appendChild(this.popupNoteAuthor),this.popupNoteContent=Q("div",{id:this.pdfViewer.element.id+"_annotation_note_content",className:"e-pv-annotation-note-content"}),this.popupNote.appendChild(this.popupNoteContent),this.pdfViewerBase.mainContainer&&this.pdfViewerBase.mainContainer.appendChild(this.popupNote)},JSt.prototype.showPopupNote=function(e,t,i,n,o){var r=this.pdfViewerBase.mainContainer.getBoundingClientRect(),s=this.popupNote.getBoundingClientRect(),i=(i&&(this.popupNoteAuthor.textContent=i),this.popupNoteContent.textContent=n,"Highlight"===o?this.popupNote.style.backgroundColor="rgb(237, 232, 177)":"Underline"===o?this.popupNote.style.backgroundColor="rgb(187, 241, 191)":"Strikethrough"===o&&(this.popupNote.style.backgroundColor="rgb(242, 188, 207)"),this.popupNote.style.display="block",e.pageY-r.top+5),n=e.pageX-r.left+5;n+s.width>r.width&&(n-=s.width),i+s.height>r.height&&(i-=s.height),this.popupNote.style.top=i+"px",this.popupNote.style.left=n+"px"},JSt.prototype.hidePopupNote=function(){this.popupNote&&(this.popupNote.style.display="none")},JSt.prototype.createTextMarkupPopup=function(){var e=this,t=this.pdfViewer.element.id,i=(this.popupElement=Q("div",{id:t+"_popup_annotation_note",className:"e-pv-annotation-popup-menu",styles:"display:none"}),Q("div",{id:t+"_popup_header",className:"e-pv-annotation-popup-header"})),n=(this.authorPopupElement=Q("div",{id:t+"_popup_author",className:"e-pv-annotation-popup-author"}),i.appendChild(this.authorPopupElement),Q("span",{id:t+"_popup_close",className:"e-pv-annotation-popup-close e-pv-icon"})),i=(i.appendChild(n),this.popupElement.appendChild(i),this.modifiedDateElement=Q("div",{id:t+"_popup_modified_time",className:"e-pv-annotation-modified-time"}),this.popupElement.appendChild(this.modifiedDateElement),Q("div",{id:t+"_popup_content_container",className:"e-pv-annotation-popup-note-container"}));this.noteContentElement=Q("div",{id:t+"_popup_content",className:"e-pv-annotation-popup-content"}),this.noteContentElement.contentEditable="true",i.appendChild(this.noteContentElement),this.popupElement.appendChild(i),this.pdfViewerBase.viewerContainer.appendChild(this.popupElement),n.addEventListener("click",this.saveClosePopupMenu.bind(this)),n.addEventListener("touchend",this.saveClosePopupMenu.bind(this)),this.popupElement.addEventListener("mousedown",this.onPopupElementMoveStart.bind(this)),this.popupElement.addEventListener("mousemove",this.onPopupElementMove.bind(this)),window.addEventListener("mouseup",this.onPopupElementMoveEnd.bind(this)),this.popupElement.addEventListener("touchstart",this.onPopupElementMoveStart.bind(this)),this.popupElement.addEventListener("touchmove",this.onPopupElementMove.bind(this)),window.addEventListener("touchend",this.onPopupElementMoveEnd.bind(this)),this.noteContentElement.addEventListener("mousedown",function(){e.noteContentElement.focus()})},JSt.prototype.onPopupElementMoveStart=function(e){var t;(e="touchstart"===e.type?e.changedTouches[0]:e).target.id===this.noteContentElement.id&&e.target.contains(this.noteContentElement.childNodes[0])||(this.isPopupMenuMoved=!0,t=this.popupElement.getBoundingClientRect(),this.clientX=e.clientX-t.left,this.clientY=e.clientY-t.top+this.pdfViewerBase.pageSize[this.currentAnnotPageNumber].top*this.pdfViewerBase.getZoomFactor())},JSt.prototype.onPopupElementMove=function(e){var t,i,n;"touchmove"===e.type&&(e=e.changedTouches[0]),!this.isPopupMenuMoved||e.target.id===this.noteContentElement.id&&e.target.contains(this.noteContentElement.childNodes[0])||(t=e.clientX-this.clientX+parseFloat(this.popupElement.style.left),i=e.clientY-this.clientY+parseFloat(this.popupElement.style.top),this.clientX=e.clientX,this.clientY=e.clientY,e=this.popupElement.getBoundingClientRect(),n=document.getElementById(this.pdfViewer.element.id+"_pageDiv_"+this.currentAnnotPageNumber),t>parseFloat(n.style.left)&&t+e.width<parseFloat(n.style.left)+parseFloat(n.style.width)?this.popupElement.style.left=t+"px":this.popupElement.style.left=parseFloat(this.popupElement.style.left)+"px",i>parseFloat(n.style.top)&&i+e.height<parseFloat(n.style.top)+parseFloat(n.style.height)?this.popupElement.style.top=i+"px":this.popupElement.style.top=parseFloat(this.popupElement.style.top)+"px")},JSt.prototype.onPopupElementMoveEnd=function(){this.isPopupMenuMoved=!1},JSt.prototype.saveClosePopupMenu=function(){this.textMarkupAnnotationModule&&this.textMarkupAnnotationModule.saveNoteContent(this.currentAnnotPageNumber,this.noteContentElement.innerText),this.closePopupMenu()},JSt.prototype.closePopupMenu=function(){this.popupElement&&(this.popupElement.parentElement.removeChild(this.popupElement),this.popupElement=null,this.isPopupNoteVisible=!1)},JSt.prototype.showAnnotationPopup=function(e){var t,i,n;this.textMarkupAnnotationModule&&(this.currentAnnotPageNumber=this.getEventPageNumber(e),this.textMarkupAnnotationModule)&&(e.target!==this.noteContentElement||e.target.contains(this.noteContentElement.childNodes[0]))&&(this.hidePopupNote(),this.popupElement||(this.createTextMarkupPopup(),this.popupElement.style.display="block",this.authorPopupElement.textContent=this.textMarkupAnnotationModule.currentTextMarkupAnnotation.author,this.modifiedDateElement.textContent=this.getProperDate(this.textMarkupAnnotationModule.currentTextMarkupAnnotation.modifiedDate),this.noteContentElement.textContent=this.textMarkupAnnotationModule.currentTextMarkupAnnotation.note,t=this.popupElement.getBoundingClientRect(),n=(i=document.getElementById(this.pdfViewer.element.id+"_pageDiv_"+this.currentAnnotPageNumber)).getBoundingClientRect(),n=e.clientY-n.top+parseFloat(i.style.top),(e=e.clientX)+t.width>parseFloat(i.style.left)+parseFloat(i.style.width)?this.popupElement.style.left=e-t.width+"px":this.popupElement.style.left=e+"px",n+t.height>parseFloat(i.style.top)+parseFloat(i.style.height)?this.popupElement.style.top=n-t.height+"px":this.popupElement.style.top=n+"px",this.isPopupNoteVisible=!0))},JSt.prototype.modifyOpacity=function(e,t){var i=this.pdfViewer.selectedItems.annotations[0],n=owt(i),o=owt(i),r=1,r=t?e/100:e.value/100;i.opacity!==r&&(o.opacity=r,this.pdfViewer.nodePropertyChange(i,{opacity:r}),"StickyNotes"===i.shapeAnnotationType?this.stickyNotesAnnotationModule.updateOpacityValue(i):this.modifyInCollections(i,"opacity"),"HandWrittenSignature"===i.shapeAnnotationType||"SignatureImage"===i.shapeAnnotationType||"SignatureText"===i.shapeAnnotationType?this.pdfViewer.fireSignaturePropertiesChange(i.pageIndex,i.signatureName,i.shapeAnnotationType,!1,!0,!1,n.opacity,o.opacity):this.triggerAnnotationPropChange(i,!1,!1,!1,!0),this.pdfViewer.annotation.addAction(i.pageIndex,null,i,"Shape Opacity","",n,o),this.pdfViewer.renderDrawing())},JSt.prototype.modifyFontColor=function(e){var t=this.pdfViewer.selectedItems.annotations[0],i=owt(t),n=owt(t);n.fontColor=e,this.pdfViewer.nodePropertyChange(t,{fontColor:e}),this.modifyInCollections(t,"fontColor"),this.triggerAnnotationPropChange(t,!1,!1,!1,!0),this.pdfViewer.annotation.addAction(t.pageIndex,null,t,"fontColor","",i,n),this.pdfViewer.renderDrawing()},JSt.prototype.modifyFontFamily=function(e){var t=this.pdfViewer.selectedItems.annotations[0],i=owt(t),n=owt(t);n.fontFamily=e,this.pdfViewer.freeTextSettings.enableAutoFit?this.updateFontFamilyRenderSize(t,e):this.pdfViewer.nodePropertyChange(t,{fontFamily:e}),this.modifyInCollections(t,"fontFamily"),this.triggerAnnotationPropChange(t,!1,!1,!1,!0),this.pdfViewer.annotation.addAction(t.pageIndex,null,t,"fontFamily","",i,n),this.pdfViewer.renderDrawing()},JSt.prototype.modifyFontSize=function(e,t){var i,n,o=this.pdfViewer.selectedItems.annotations[0],r=owt(o),s=owt(o),a=(s.fontSize=e,this.freeTextAnnotationModule),l=o.bounds.x,h=o.bounds.y,d=(o.fontSize=e,a&&!a.isNewFreeTextAnnot&&""!==o.dynamicText&&(a.addInuptElemet({x:l,y:h},o),o&&(o.previousFontSize!==e&&(a.inputBoxElement.style.height="auto",t||this.isFreeTextFontsizeChanged||a.inputBoxElement.scrollHeight+5>o.bounds.height?(this.isFreeTextFontsizeChanged=!1,a.inputBoxElement.style.height=a.inputBoxElement.scrollHeight+5+"px"):a.inputBoxElement.style.height=o.bounds.height+"px"),l=parseFloat(a.inputBoxElement.style.height),h=parseFloat(a.inputBoxElement.style.width),h/=n=this.pdfViewerBase.getZoomFactor(),i=void 0,i=0<(n=(l/=n)-o.bounds.height)?0<(i=o.wrapper.offsetY+n/2)?i:void 0:(n=Math.abs(n),0<(i=o.wrapper.offsetY-n/2)?i:void 0),n=void 0,n=0<(d=h-o.bounds.width)?0<(n=o.wrapper.offsetX+d/2)?n:void 0:(d=Math.abs(d),o.wrapper.offsetX-d/2),o.bounds.width=h,o.bounds.height=l,this.pdfViewer.nodePropertyChange(o,{fontSize:e,bounds:{width:o.bounds.width,height:o.bounds.height,y:i,x:n}}),this.pdfViewer.renderSelector(o.pageIndex,this.pdfViewer.annotationSelectorSettings),o.previousFontSize=e),this.modifyInCollections(o,"fontSize"),this.modifyInCollections(o,"bounds"),this.triggerAnnotationPropChange(o,!1,!1,!1,!0),t&&this.pdfViewer.annotation.addAction(o.pageIndex,null,o,"fontSize","",r,s),a.inputBoxElement.blur()),this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",o.pageIndex));this.pdfViewer.drawing.refreshCanvasDiagramLayer(d,o.pageIndex)},JSt.prototype.handleFontSizeUpdate=function(e){1===this.pdfViewer.selectedItems.annotations.length&&e?this.isUndoRedoAction?this.modifyFontSize(e,!1):this.modifyFontSize(e,!0):this.freeTextAnnotationModule&&(this.pdfViewer.freeTextSettings.fontSize=e,this.freeTextAnnotationModule.updateTextProperties())},JSt.prototype.modifyTextAlignment=function(e){var t=this.pdfViewer.selectedItems.annotations[0];this.pdfViewer.nodePropertyChange(t,{textAlign:e}),this.modifyInCollections(t,"textAlign"),this.triggerAnnotationPropChange(t,!1,!1,!1,!0),this.pdfViewer.renderDrawing()},JSt.prototype.modifyTextProperties=function(e,t){var i=this.pdfViewer.selectedItems.annotations[0],n=owt(i),o=owt(i);"bold"===t?o.font.isBold=e.isBold:"italic"===t?o.font.isItalic=e.isItalic:"underline"===t?(o.font.isUnderline=e.isUnderline,o.font.isUnderline&&o.font.isStrikeout&&(o.font.isStrikeout=!1)):"strikeout"===t&&(o.font.isStrikeout=e.isStrikeout,o.font.isUnderline)&&o.font.isStrikeout&&(o.font.isUnderline=!1),this.pdfViewer.nodePropertyChange(i,{font:e}),this.modifyInCollections(i,"textPropertiesChange"),this.triggerAnnotationPropChange(i,!1,!1,!1,!0),this.pdfViewer.annotation.addAction(i.pageIndex,null,i,"textPropertiesChange","",n,o),this.pdfViewer.renderDrawing()},JSt.prototype.modifyThickness=function(e){var t,i,n=this.pdfViewer.selectedItems.annotations[0];n.thickness!==e&&(t=owt(n),(i=owt(n)).thickness=e,this.pdfViewer.nodePropertyChange(n,{thickness:e}),this.modifyInCollections(n,"thickness"),"HandWrittenSignature"===n.shapeAnnotationType||"SignatureText"===n.shapeAnnotationType||"SignatureImage"===n.shapeAnnotationType?this.pdfViewer.fireSignaturePropertiesChange(n.pageIndex,n.signatureName,n.shapeAnnotationType,!1,!1,!0,t.thickness,i.thickness):this.triggerAnnotationPropChange(n,!1,!1,!0,!1),this.pdfViewer.annotation.addAction(n.pageIndex,null,n,"Shape Thickness","",t,i),this.pdfViewer.renderDrawing())},JSt.prototype.modifyStrokeColor=function(e){var t=this.pdfViewer.selectedItems.annotations[0],i=owt(t),n=owt(t);n.strokeColor=e,this.pdfViewer.nodePropertyChange(t,{strokeColor:e}),this.modifyInCollections(t,"stroke"),"HandWrittenSignature"===t.shapeAnnotationType||"SignatureText"===t.shapeAnnotationType||"SignatureImage"===t.shapeAnnotationType?this.pdfViewer.fireSignaturePropertiesChange(t.pageIndex,t.signatureName,t.shapeAnnotationType,!0,!1,!1,i.strokeColor,n.strokeColor):this.triggerAnnotationPropChange(t,!1,!0,!1,!1),this.pdfViewer.annotation.addAction(t.pageIndex,null,t,"Shape Stroke","",i,n),this.pdfViewer.renderDrawing()},JSt.prototype.modifyFillColor=function(e){var t=this.pdfViewer.selectedItems.annotations[0],i=owt(t),n=owt(t);n.fillColor=e,this.pdfViewer.nodePropertyChange(this.pdfViewer.selectedItems.annotations[0],{fillColor:e}),this.modifyInCollections(t,"fill"),this.triggerAnnotationPropChange(t,!0,!1,!1,!1),this.pdfViewer.annotation.addAction(t.pageIndex,null,t,"Shape Fill","",i,n),this.pdfViewer.renderDrawing()},JSt.prototype.modifyDynamicTextValue=function(e,t){var i,n,o=null;(o=this.pdfViewer.annotations.filter(function(e){return e.annotName===t})[0])&&(i=owt(o),n=owt(o),o.dynamicText=e,n.dynamicText=e,""===i.dynamicText&&(i.dynamicText=this.freeTextAnnotationModule.previousText),this.pdfViewer.nodePropertyChange(o,{dynamicText:e}),this.pdfViewer.renderSelector(o.pageIndex,o.annotationSelectorSettings),i.dynamicText!==n.dynamicText&&(this.pdfViewer.annotation.addAction(o.pageIndex,null,o,"dynamicText Change","",i,n),this.modifyInCollections(o,"dynamicText")),je(this.freeTextAnnotationModule)||this.freeTextAnnotationModule.previousText===o.dynamicText||this.triggerAnnotationPropChange(o,!1,!1,!1,!1,!1,!1,!1,!0,this.freeTextAnnotationModule.previousText,o.dynamicText),this.pdfViewer.renderDrawing())},JSt.prototype.modifyInCollections=function(e,t){var i;return""===e.measureType||je(e.measureType)?i="FreeText"===e.shapeAnnotationType?this.freeTextAnnotationModule.modifyInCollection(t,e.pageIndex,e):"HandWrittenSignature"===e.shapeAnnotationType||"SignatureText"===e.shapeAnnotationType||"SignatureImage"===e.shapeAnnotationType?this.pdfViewerBase.signatureModule.modifySignatureCollection(t,e.pageIndex,e):"Stamp"===e.shapeAnnotationType||"Image"===e.shapeAnnotationType?this.stampAnnotationModule.modifyInCollection(t,e.pageIndex,e,null):"Ink"===e.shapeAnnotationType?this.inkAnnotationModule.modifySignatureInkCollection(t,e.pageIndex,e):this.shapeAnnotationModule.modifyInCollection(t,e.pageIndex,e,null):"Distance"!==e.measureType&&"Perimeter"!==e.measureType&&"Radius"!==e.measureType&&"Area"!==e.measureType&&"Volume"!==e.measureType||(i=this.measureAnnotationModule.modifyInCollection(t,e.pageIndex,e)),this.isUndoRedoAction?(this.stickyNotesAnnotationModule.updateAnnotationModifiedDate(e,null,!0),this.isUndoAction&&(e.modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime())):"bounds"!==t&&this.stickyNotesAnnotationModule.updateAnnotationModifiedDate(e),this.isUndoRedoAction&&"delete"===t&&this.updateAnnotationCollection(e),i},JSt.prototype.createPropertiesWindow=function(){var e,t,i,n,o=this;N?(i=100*this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.opacity,n=this.getArrowString(this.pdfViewer.selectedItems.annotations[0].sourceDecoraterShapes),e=this.getArrowString(this.pdfViewer.selectedItems.annotations[0].taregetDecoraterShapes),t=void 0,3<=parseInt(this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeDashArray,10)?t="Dashed":"2"===this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeDashArray?t="Dotted":"0"===this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeDashArray&&(t="Solid"),this.pdfViewer._dotnetInstance.invokeMethodAsync("OpenPropertiesDialog",i,n,e,t)):(i=Q("div",{id:this.pdfViewer.element.id+"_properties_window",className:"e-pv-properties-window"}),n=this.createAppearanceTab(),this.pdfViewerBase.pageContainer.appendChild(i),this.propertiesDialog=new pS({showCloseIcon:!0,closeOnEscape:!1,isModal:!0,header:this.pdfViewer.localeObj.getConstant("Line Properties"),target:this.pdfViewer.element,content:n,close:function(){o.destroyPropertiesWindow()}}),!F.isDevice||this.pdfViewer.enableDesktopMode?this.propertiesDialog.buttons=[{buttonModel:{content:this.pdfViewer.localeObj.getConstant("OK"),isPrimary:!0},click:this.onOkClicked.bind(this)},{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Cancel")},click:this.onCancelClicked.bind(this)}]:this.propertiesDialog.buttons=[{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Cancel")},click:this.onCancelClicked.bind(this)},{buttonModel:{content:this.pdfViewer.localeObj.getConstant("OK"),isPrimary:!0},click:this.onOkClicked.bind(this)}],this.pdfViewer.enableRtl&&(this.propertiesDialog.enableRtl=!0),this.propertiesDialog.appendTo(i),this.pdfViewer.selectedItems.annotations[0]&&"Line"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&(document.getElementById(this.pdfViewer.element.id+"_properties_fill_color").disabled=!0),this.startArrowDropDown.content=this.createContent(this.getArrowString(this.pdfViewer.selectedItems.annotations[0].sourceDecoraterShapes)).outerHTML,this.endArrowDropDown.content=this.createContent(this.getArrowString(this.pdfViewer.selectedItems.annotations[0].taregetDecoraterShapes)).outerHTML,this.thicknessBox.value=this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeWidth,this.fillColorPicker.value=this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.fill,this.refreshColorPicker(this.fillColorPicker),this.strokeColorPicker.value=this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeColor,this.refreshColorPicker(this.strokeColorPicker),this.updateColorInIcon(this.fillDropDown.element,this.fillColorPicker.value),this.updateColorInIcon(this.strokeDropDown.element,this.strokeColorPicker.value),this.opacitySlider.value=100*this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.opacity,this.updateOpacityIndicator(),3<=parseInt(this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeDashArray,10)?this.lineStyleDropDown.content=this.createDropDownContent("dashed").outerHTML:"2"===this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeDashArray?this.lineStyleDropDown.content=this.createDropDownContent("dotted").outerHTML:"0"===this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeDashArray&&(this.lineStyleDropDown.content=this.createDropDownContent("solid").outerHTML),this.selectedLineStyle=this.pdfViewer.selectedItems.annotations[0].borderStyle,this.selectedLineDashArray=this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeDashArray,"Distance"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&(this.leaderLengthBox.value=this.pdfViewer.selectedItems.annotations[0].leaderHeight))},JSt.prototype.destroyPropertiesWindow=function(){this.strokeColorPicker&&(this.strokeColorPicker.destroy(),this.strokeColorPicker=null),this.fillColorPicker&&(this.fillColorPicker.destroy(),this.fillColorPicker=null),this.endArrowDropDown&&(this.endArrowDropDown.destroy(),this.endArrowDropDown=null),this.startArrowDropDown&&(this.startArrowDropDown.destroy(),this.startArrowDropDown=null),this.opacitySlider&&(this.opacitySlider.destroy(),this.opacitySlider=null),this.thicknessBox&&(this.thicknessBox.destroy(),this.thicknessBox=null),this.lineStyleDropDown&&(this.lineStyleDropDown.destroy(),this.lineStyleDropDown=null),this.leaderLengthBox&&(this.leaderLengthBox.destroy(),this.leaderLengthBox=null),this.propertiesDialog&&(this.propertiesDialog.destroy(),this.propertiesDialog=null);var e=this.pdfViewerBase.getElement("_properties_window");e&&e.parentElement.removeChild(e)},JSt.prototype.refreshColorPicker=function(e){e.setProperties({value:e.value},!0),e.refresh()},JSt.prototype.createAppearanceTab=function(){var t=this,e=this.pdfViewer.element.id,i=[{text:this.pdfViewer.localeObj.getConstant("None")},{text:this.pdfViewer.localeObj.getConstant("Open Arrow")},{text:this.pdfViewer.localeObj.getConstant("Closed Arrow")},{text:this.pdfViewer.localeObj.getConstant("Round Arrow")},{text:this.pdfViewer.localeObj.getConstant("Square Arrow")},{text:this.pdfViewer.localeObj.getConstant("Diamond Arrow")}],n=Q("div",{id:e+"_properties_appearance"}),o=Q("div",{className:"e-pv-properties-line-style-prop"}),r=(n.appendChild(o),this.createInputElement(this.pdfViewer.localeObj.getConstant("Start Arrow"),o,"text","button",!0,"e-pv-properties-line-start",e+"_properties_line_start")),r=(this.startArrowDropDown=new u2({items:i,cssClass:"e-pv-properties-line-start",select:this.onStartArrowHeadStyleSelect.bind(this)},r),this.createInputElement(this.pdfViewer.localeObj.getConstant("End Arrow"),o,"text","button",!0,"e-pv-properties-line-end",e+"_properties_line_end")),o=Q("div",{className:"e-pv-properties-border-style"}),i=(n.appendChild(o),this.endArrowDropDown=new u2({items:i,cssClass:"e-pv-properties-line-end",select:this.onEndArrowHeadStyleSelect.bind(this)},r),this.createInputElement(this.pdfViewer.localeObj.getConstant("Line Style"),o,"text","button",!0,"e-pv-properties-line-style",e+"_properties_line_style")),r=this.createStyleList(),r=(this.lineStyleDropDown=new u2({cssClass:"e-pv-properties-line-style",target:r},i),this.createInputElement(this.pdfViewer.localeObj.getConstant("Line Thickness"),o,"text","input",!0,"e-pv-properties-line-thickness",e+"_properties_thickness")),i=(this.thicknessBox=new NL({value:0,format:"## pt",cssClass:"e-pv-properties-line-thickness",min:0,max:12},r),Q("div",{className:"e-pv-properties-color-style"})),o=(n.appendChild(i),this.createInputElement(this.pdfViewer.localeObj.getConstant("Fill Color"),i,"color","button",!0,"e-pv-properties-line-fill-color",e+"_properties_fill_color")),r=(this.fillColorPicker=this.createColorPicker(e+"_properties_fill_color",!0),this.fillColorPicker.change=function(e){e=""===e.currentValue.hex?"#ffffff00":e.currentValue.hex;t.fillDropDown.toggle(),t.updateColorInIcon(t.fillDropDown.element,e)},this.fillDropDown=this.createDropDownButton(o,"e-pv-properties-fill-color-icon",this.fillColorPicker.element.parentElement),this.fillDropDown.beforeOpen=this.onFillDropDownBeforeOpen.bind(this),this.fillDropDown.open=function(){t.fillColorPicker.refresh()},this.createInputElement(this.pdfViewer.localeObj.getConstant("Line Color"),i,"color","button",!0,"e-pv-properties-line-stroke-color",e+"_properties_stroke_color")),o=(this.strokeColorPicker=this.createColorPicker(e+"_properties_stroke_color",!1),this.strokeColorPicker.change=function(e){e=""===e.currentValue.hex?"#ffffff00":e.currentValue.hex;t.strokeDropDown.toggle(),t.updateColorInIcon(t.strokeDropDown.element,e)},this.strokeDropDown=this.createDropDownButton(r,"e-pv-properties-stroke-color-icon",this.strokeColorPicker.element.parentElement),this.strokeDropDown.beforeOpen=this.onStrokeDropDownBeforeOpen.bind(this),this.strokeDropDown.open=function(){t.strokeColorPicker.refresh()},Q("div",{className:"e-pv-properties-opacity-style"})),i=(n.appendChild(o),this.createInputElement(this.pdfViewer.localeObj.getConstant("Opacity"),o,"","div",!0,"e-pv-properties-line-opacity",e+"_properties_opacity"));return this.opacitySlider=new KO({type:"MinRange",max:100,min:0,cssClass:"e-pv-properties-line-opacity",change:function(){t.updateOpacityIndicator()}},i),"Distance"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&(r=this.createInputElement(this.pdfViewer.localeObj.getConstant("Leader Length"),o,"text","input",!0,"e-pv-properties-line-leader-length",e+"_properties_leader_length"),this.leaderLengthBox=new NL({value:0,format:"## pt",cssClass:"e-pv-properties-line-leader-length",min:0,max:100},r)),n},JSt.prototype.createContent=function(e){var t=Q("div",{className:"e-pv-properties-line-style-content"});return t.textContent=e,t},JSt.prototype.onStrokeDropDownBeforeOpen=function(){1===this.pdfViewer.selectedItems.annotations.length&&(this.strokeColorPicker.value=this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeColor),this.strokeColorPicker.refresh()},JSt.prototype.onFillDropDownBeforeOpen=function(){1===this.pdfViewer.selectedItems.annotations.length&&(this.fillColorPicker.value=this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeColor),this.fillColorPicker.refresh()},JSt.prototype.createStyleList=function(){var e=this,t=Q("ul"),i=(document.body.appendChild(t),this.createListForStyle("solid")),i=(i.addEventListener("click",function(){e.setThickness("0","solid")}),t.appendChild(i),this.createListForStyle("dotted")),i=(i.addEventListener("click",function(){e.setThickness("2","dotted")}),t.appendChild(i),this.createListForStyle("dashed"));return i.addEventListener("click",function(){e.setThickness("3","dashed")}),t.appendChild(i),t},JSt.prototype.createColorPicker=function(e,t){e=Q("input",{id:e+"_target"}),document.body.appendChild(e),t=new cV({inline:!0,mode:"Palette",enableOpacity:!1,value:"#000000",showButtons:!1,modeSwitcher:!1,noColor:t});return this.pdfViewer.enableRtl&&(t.enableRtl=!0),t.appendTo(e),t},JSt.prototype.createDropDownButton=function(e,t,i){t=new u2({iconCss:t+" e-pv-icon",target:i});return this.pdfViewer.enableRtl&&(t.enableRtl=!0),t.appendTo(e),t},JSt.prototype.updateColorInIcon=function(e,t){e.childNodes[0].style.borderBottomColor=t},JSt.prototype.onFillColorChange=function(e){var t=document.querySelector("#"+this.pdfViewer.element.id+"_properties_fill_color_button");"transparent"!==e&&(t.children[0].style.borderBottomColor=e)},JSt.prototype.onStrokeColorChange=function(e){var t=document.querySelector("#"+this.pdfViewer.element.id+"_properties_stroke_color_button");"transparent"!==e&&(t.children[0].style.borderBottomColor=e)},JSt.prototype.setThickness=function(e,t,i){i||(this.lineStyleDropDown.content=this.createDropDownContent(t).outerHTML),"0"===(this.selectedLineDashArray=e)?this.selectedLineStyle="Solid":"2"!==e&&"3"!==e||(this.selectedLineStyle="Dashed")},JSt.prototype.createDropDownContent=function(e){var t=Q("div",{className:"e-pv-line-styles-content-container"}),e=Q("span",{className:"e-pv-line-styles-content",styles:"border-bottom-style:"+e});return t.appendChild(e),t},JSt.prototype.createListForStyle=function(e){var t=Q("li",{className:"e-menu-item"}),i=Q("div",{className:"e-pv-line-styles-container"}),e=Q("span",{className:"e-pv-line-styles-item",styles:"border-bottom-style:"+e});return i.appendChild(e),t.appendChild(i),t},JSt.prototype.onStartArrowHeadStyleSelect=function(e){this.startArrowDropDown.content=this.createContent(e.item.text).outerHTML},JSt.prototype.onEndArrowHeadStyleSelect=function(e){this.endArrowDropDown.content=this.createContent(e.item.text).outerHTML},JSt.prototype.createInputElement=function(e,t,i,n,o,r,s){var a=Q("div",{id:s+"_container",className:r+"-container"}),r=(o&&((o=Q("div",{id:s+"_label",className:r+"-label"})).textContent=e,a.appendChild(o)),this.pdfViewer.localeObj.getConstant("Opacity")===e&&(this.opacityIndicator=Q("span",{className:"e-pv-properties-opacity-indicator"}),a.appendChild(this.opacityIndicator)),Q(n,{id:s}));return"input"===n&&(r.type=i),a.appendChild(r),t.appendChild(a),r},JSt.prototype.updateOpacityIndicator=function(){this.opacityIndicator.textContent=this.opacitySlider.value+"%"},JSt.prototype.onOkClicked=function(e){N?(s=document.querySelector("#"+this.pdfViewer.element.id+"_properties_line_start"),n=document.querySelector("#"+this.pdfViewer.element.id+"_properties_line_end"),o=document.querySelector("#"+this.pdfViewer.element.id+"_line_thickness"),a=document.querySelector("#"+this.pdfViewer.element.id+"_properties_style"),t=document.querySelector("#"+this.pdfViewer.element.id+"_properties_fill_color_button"),r=document.querySelector("#"+this.pdfViewer.element.id+"_properties_stroke_color_button"),i=document.querySelector("#"+this.pdfViewer.element.id+"_properties_opacity"),s=this.getArrowTypeFromDropDown(s.value,!0),n=this.getArrowTypeFromDropDown(n.value,!0),o=parseInt(o.value,10),r=""===(r=this.getValue(r.children[0].style.borderBottomColor,"hex"))?"#ffffff00":r,t=""===(t=this.getValue(t.children[0].style.borderBottomColor,"hex"))?"#ffffff00":t,i=e?e/100:i.value/100,a.value&&("Solid"===a.value?this.setThickness("0","solid",!0):"Dotted"===a.value?this.setThickness("2","dotted",!0):"Dashed"===a.value&&this.setThickness("3","dashed",!0))):(s=this.getArrowTypeFromDropDown(this.startArrowDropDown.content),n=this.getArrowTypeFromDropDown(this.endArrowDropDown.content),o=this.thicknessBox.value,r=""===(r=this.strokeColorPicker.getValue(this.strokeColorPicker.value,"hex"))?"#ffffff00":r,t=""===(t=this.fillColorPicker.getValue(this.fillColorPicker.value,"hex"))||"#transp"===t||"#ffffff00"===this.fillColorPicker.value?"#ffffff00":t,i=this.opacitySlider.value/100);var t,i,n,o,r,s,e=this.pdfViewer.selectedItems.annotations[0],a=owt(e),l=owt(e),h={},d=!1,p=!1,c=!1,u=!1,g=!1,m=!1,f=!1;s!==e.sourceDecoraterShapes&&(h.sourceDecoraterShapes=s,l.lineHeadStart=this.getArrowString(s),g=!0),n!==e.taregetDecoraterShapes&&(h.taregetDecoraterShapes=n,l.lineHeadEnd=this.getArrowString(n),m=!0),o!==e.wrapper.children[0].style.strokeWidth&&(h.thickness=o,l.thickness=o,c=!0),r!==e.wrapper.children[0].style.strokeColor&&(h.strokeColor=r,l.strokeColor=r,p=!0),t!==e.wrapper.children[0].style.fill&&(h.fillColor=t,l.fillColor=t,d=!0),i!==e.wrapper.children[0].style.opacity&&(h.opacity=i,l.opacity=i,u=!0),this.selectedLineDashArray!==e.wrapper.children[0].style.strokeDashArray&&(h.borderDashArray=this.selectedLineDashArray,h.borderStyle=this.selectedLineStyle,l.borderDashArray=h.borderDashArray,l.borderStyle=h.borderStyle,f=!0),N?(s=document.querySelector("#"+this.pdfViewer.element.id+"_properties_leader_length"),"Distance"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&parseInt(s.value,10)!==this.pdfViewer.selectedItems.annotations[0].leaderHeight&&(h.leaderHeight=parseInt(s.value,10))):"Distance"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&this.leaderLengthBox.value!==this.pdfViewer.selectedItems.annotations[0].leaderHeight&&(h.leaderHeight=this.leaderLengthBox.value),this.pdfViewer.nodePropertyChange(this.pdfViewer.selectedItems.annotations[0],h),this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.fill=t,this.triggerAnnotationPropChange(this.pdfViewer.selectedItems.annotations[0],d,p,c,u,g,m,f),this.modifyInCollections(this.pdfViewer.selectedItems.annotations[0],"thickness"),this.modifyInCollections(this.pdfViewer.selectedItems.annotations[0],"stroke"),this.modifyInCollections(this.pdfViewer.selectedItems.annotations[0],"fill"),this.modifyInCollections(this.pdfViewer.selectedItems.annotations[0],"opacity"),this.modifyInCollections(this.pdfViewer.selectedItems.annotations[0],"dashArray"),this.modifyInCollections(this.pdfViewer.selectedItems.annotations[0],"startArrow"),this.modifyInCollections(this.pdfViewer.selectedItems.annotations[0],"endArrow"),"Distance"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&this.modifyInCollections(this.pdfViewer.selectedItems.annotations[0],"leaderLength"),this.pdfViewer.annotation.addAction(e.pageIndex,null,e,"Line properties change","",a,l),this.renderAnnotations(e.pageIndex,null,null,null),N||this.propertiesDialog.hide()},JSt.prototype.onCancelClicked=function(){this.propertiesDialog.hide()},JSt.prototype.getArrowTypeFromDropDown=function(e,t){var i="None";switch(e=t?e:e.split("</div>")[0].split('">')[1]){case this.pdfViewer.localeObj.getConstant("None"):i="None";break;case this.pdfViewer.localeObj.getConstant("Open Arrow"):i="OpenArrow";break;case this.pdfViewer.localeObj.getConstant("Closed Arrow"):i="Arrow";break;case this.pdfViewer.localeObj.getConstant("Round Arrow"):i="Circle";break;case this.pdfViewer.localeObj.getConstant("Square Arrow"):i="Square";break;case this.pdfViewer.localeObj.getConstant("Diamond Arrow"):i="Diamond";break;case this.pdfViewer.localeObj.getConstant("Butt"):i="Butt"}return i},JSt.prototype.getArrowString=function(e){var t=this.pdfViewer.localeObj.getConstant("None");switch(e){case"Arrow":t=this.pdfViewer.localeObj.getConstant("Closed");break;case"OpenArrow":t=this.pdfViewer.localeObj.getConstant("Open Arrow");break;case"Circle":t=this.pdfViewer.localeObj.getConstant("Round");break;case"None":case"Square":case"Diamond":t=this.pdfViewer.localeObj.getConstant(e);break;case"Butt":t=this.pdfViewer.localeObj.getConstant("Butt")}return t},JSt.prototype.onAnnotationMouseUp=function(){var e;0!==this.pdfViewer.selectedItems.annotations.length?(this.pdfViewer.toolbar&&this.pdfViewer.toolbar.annotationToolbarModule&&(this.enableBasedOnType(),this.pdfViewer.toolbar.annotationToolbarModule.selectAnnotationDeleteItem(!0),F.isDevice||this.pdfViewer.toolbar.annotationToolbarModule.updateAnnnotationPropertyItems()),this.pdfViewer.textSelectionModule&&!this.pdfViewer.textSelectionModule.isTextSelection&&this.pdfViewerBase.disableTextSelectionMode()):(!this.pdfViewer.textSelectionModule||this.pdfViewerBase.isPanMode||this.pdfViewer.designerMode||this.pdfViewer.textSelectionModule.enableTextSelectionMode(),this.pdfViewer.toolbar&&this.pdfViewer.toolbar.annotationToolbarModule&&(!F.isDevice||this.pdfViewer.enableDesktopMode)&&(e=this.pdfViewer.toolbar.annotationToolbarModule.inkAnnotationSelected,!this.pdfViewer.annotation.freeTextAnnotationModule||this.pdfViewer.annotation.freeTextAnnotationModule.isInuptBoxInFocus||e||(this.pdfViewer.toolbar.annotationToolbarModule.enableAnnotationPropertiesTools(!1),this.pdfViewer.toolbar.annotationToolbarModule.enableFreeTextAnnotationPropertiesTools(!1)),this.pdfViewer.toolbar.annotationToolbarModule.updateAnnnotationPropertyItems(),this.pdfViewer.toolbar.annotationToolbarModule.selectAnnotationDeleteItem(!1)))},JSt.prototype.onShapesMouseup=function(e,t){e=je(this.pdfViewer.selectedItems.annotations[0])?e:this.pdfViewer.selectedItems.annotations[0];var i=!1;this.pdfViewerBase.prevPosition.x===this.pdfViewerBase.currentPosition.x&&this.pdfViewerBase.prevPosition.y===this.pdfViewerBase.currentPosition.y||(i=!0),e&&(this.textMarkupAnnotationModule&&this.textMarkupAnnotationModule.currentTextMarkupAnnotation&&(this.textMarkupAnnotationModule.currentTextMarkupAnnotation=null,this.textMarkupAnnotationModule.selectTextMarkupCurrentPage=null),(this.pdfViewerBase.tool instanceof nCt||this.pdfViewerBase.tool instanceof hCt)&&!this.pdfViewerBase.tool.dragging?(e.opacity,e.fillColor,e.strokeColor,e.thickness,e.author,e.subject,e.modifiedDate,this.getAnnotationIndex(e.pageIndex,e.id),this.pdfViewerBase.tool instanceof hCt&&(this.getArrowString(e.sourceDecoraterShapes),this.getArrowString(e.taregetDecoraterShapes),e.borderDashArray),this.pdfViewerBase.isAnnotationAdded&&"Distance"!==e.measureType||(""===e.measureType||je(e.measureType)?this.shapeAnnotationModule.renderShapeAnnotations(e,this.pdfViewer.annotation.getEventPageNumber(t)):"Distance"!==e.measureType&&"Perimeter"!==e.measureType&&"Radius"!==e.measureType||this.measureAnnotationModule.renderMeasureShapeAnnotations(e,this.pdfViewer.annotation.getEventPageNumber(t))),this.pdfViewerBase.updateDocumentEditedProperty(!0)):this.pdfViewerBase.tool instanceof jwt||this.pdfViewerBase.tool instanceof eCt?(i&&this.pdfViewerBase.updateDocumentEditedProperty(!0),""===e.measureType||je(e.measureType)?"FreeText"===e.shapeAnnotationType?this.pdfViewer.annotation.freeTextAnnotationModule.modifyInCollection("bounds",this.pdfViewer.annotation.getEventPageNumber(t),e):"HandWrittenSignature"===e.shapeAnnotationType||"SignatureImage"===e.shapeAnnotationType||"SignatureText"===e.shapeAnnotationType?this.pdfViewerBase.signatureModule.modifySignatureCollection("bounds",this.pdfViewer.annotation.getEventPageNumber(t),e):"Ink"===e.shapeAnnotationType?this.inkAnnotationModule.modifySignatureInkCollection("bounds",this.pdfViewer.annotation.getEventPageNumber(t),e):("Stamp"===e.shapeAnnotationType||"Image"===e.shapeAnnotationType?this.stampAnnotationModule:this.pdfViewer.annotation.shapeAnnotationModule).modifyInCollection("bounds",this.pdfViewer.annotation.getEventPageNumber(t),e,i):"Distance"!==e.measureType&&"Perimeter"!==e.measureType&&"Radius"!==e.measureType&&"Area"!==e.measureType&&"Volume"!==e.measureType||this.pdfViewer.annotation.measureAnnotationModule.modifyInCollection("bounds",this.pdfViewer.annotation.getEventPageNumber(t),e),this.pdfViewerBase.tool instanceof eCt&&(e.formFieldAnnotationType||this.triggerAnnotationResize(e)),this.pdfViewerBase.tool instanceof jwt&&("Select"===this.pdfViewerBase.action||e.formFieldAnnotationType||this.triggerAnnotationMove(e))):this.pdfViewerBase.tool instanceof Jwt&&(i&&this.pdfViewerBase.updateDocumentEditedProperty(!0),""===e.measureType||je(e.measureType)?"Line"!==e.shapeAnnotationType&&"LineWidthArrowHead"!==e.shapeAnnotationType&&"Polygon"!==e.shapeAnnotationType||this.pdfViewer.annotation.shapeAnnotationModule.modifyInCollection("bounds",this.pdfViewer.annotation.getEventPageNumber(t),e,i):"Distance"!==e.measureType&&"Perimeter"!==e.measureType&&"Area"!==e.measureType&&"Volume"!==e.measureType||("Distance"===e.measureType&&this.pdfViewer.annotation.measureAnnotationModule.modifyInCollection("leaderLength",this.pdfViewer.annotation.getEventPageNumber(t),e),this.pdfViewer.annotation.measureAnnotationModule.modifyInCollection("bounds",this.pdfViewer.annotation.getEventPageNumber(t),e)),this.triggerAnnotationResize(e)),this.pdfViewerBase.navigationPane&&this.pdfViewerBase.navigationPane.annotationMenuObj&&this.pdfViewer.isSignatureEditable&&("HandWrittenSignature"===e.shapeAnnotationType||"SignatureText"===e.shapeAnnotationType||"SignatureImage"===e.shapeAnnotationType)&&(this.pdfViewerBase.navigationPane.annotationMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Export Annotations")],!0),this.pdfViewerBase.navigationPane.annotationMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Export XFDF")],!0)),this.pdfViewer.toolbarModule)&&this.pdfViewer.toolbarModule.annotationToolbarModule&&this.pdfViewer.enableAnnotationToolbar&&(this.pdfViewer.toolbarModule.annotationToolbarModule.clearTextMarkupMode(),""===e.measureType||je(e.measureType)?this.pdfViewer.toolbarModule.annotationToolbarModule.clearMeasureMode():"Distance"!==e.measureType&&"Perimeter"!==e.measureType&&"Area"!==e.measureType&&"Volume"!==e.measureType&&"Radius"!==e.measureType||this.pdfViewer.toolbarModule.annotationToolbarModule.clearShapeMode(),1===this.pdfViewer.selectedItems.annotations.length&&null===this.pdfViewer.selectedItems.annotations[0].formFieldAnnotationType&&this.pdfViewer.toolbarModule.annotationToolbarModule.enableAnnotationPropertiesTools(!0),N||1!==this.pdfViewer.selectedItems.annotations.length||this.pdfViewer.designerMode||(this.pdfViewer.toolbarModule.annotationToolbarModule.selectAnnotationDeleteItem(!0),this.pdfViewer.toolbarModule.annotationToolbarModule.setCurrentColorInPicker(),this.pdfViewer.toolbarModule.annotationToolbarModule.isToolbarHidden=!0,!this.pdfViewer.formDesignerModule&&""!=e.id&&null!=e.id&&"sign"!=e.id.slice(0,4)&&(t=(i=document.getElementById(e.id))&&i.disabled)?this.pdfViewer.annotation&&t&&this.pdfViewer.annotation.clearSelection():this.pdfViewer.toolbarModule.annotationToolbarModule.showAnnotationToolbar(this.pdfViewer.toolbarModule.annotationItem),this.pdfViewer.isAnnotationToolbarVisible&&this.pdfViewer.isFormDesignerToolbarVisible&&(document.getElementById(this.pdfViewer.element.id+"_formdesigner_toolbar").style.display="none",this.pdfViewer.toolbarModule)&&(this.pdfViewer.toolbarModule.formDesignerToolbarModule.isToolbarHidden=!1,this.pdfViewer.toolbarModule.formDesignerToolbarModule.showFormDesignerToolbar(this.pdfViewer.toolbarModule.formDesignerItem),this.pdfViewer.toolbarModule.annotationToolbarModule.adjustViewer(!0))))},JSt.prototype.updateCalibrateValues=function(e,t){"Distance"===e.measureType?(e.notes=ywt(e,e.vertexPoints,this.measureAnnotationModule),!0===e.enableShapeLabel&&(e.labelContent=e.notes),this.pdfViewer.annotation.measureAnnotationModule.modifyInCollection("notes",e.pageIndex,e,t),this.pdfViewer.annotation.stickyNotesAnnotationModule.addTextToComments(e.annotName,e.notes),this.renderAnnotations(e.pageIndex,null,null,null,null)):"Radius"===e.measureType?(e.notes=vwt(e,this.measureAnnotationModule),!0===e.enableShapeLabel&&(e.labelContent=e.notes),this.pdfViewer.annotation.measureAnnotationModule.modifyInCollection("notes",e.pageIndex,e,t),this.pdfViewer.annotation.stickyNotesAnnotationModule.addTextToComments(e.annotName,e.notes),this.renderAnnotations(e.pageIndex,null,null,null,null)):"Perimeter"===e.measureType?(e.notes=wwt(e,e.vertexPoints,this.measureAnnotationModule),!0===e.enableShapeLabel&&(e.labelContent=e.notes),this.pdfViewer.annotation.measureAnnotationModule.modifyInCollection("notes",e.pageIndex,e,t),this.pdfViewer.annotation.stickyNotesAnnotationModule.addTextToComments(e.annotName,e.notes),this.renderAnnotations(e.pageIndex,null,null,null,null)):"Area"===e.measureType?(e.notes=this.measureAnnotationModule.calculateArea(e.vertexPoints,e.id,e.pageIndex),!0===e.enableShapeLabel&&(e.labelContent=e.notes,Cwt(e)),this.pdfViewer.annotation.measureAnnotationModule.modifyInCollection("notes",e.pageIndex,e,t),this.pdfViewer.annotation.stickyNotesAnnotationModule.addTextToComments(e.annotName,e.notes),this.renderAnnotations(e.pageIndex,null,null,null,null)):"Volume"===e.measureType&&(e.notes=this.measureAnnotationModule.calculateVolume(e.vertexPoints,e.id,e.pageIndex),!0===e.enableShapeLabel&&(e.labelContent=e.notes,Cwt(e)),this.pdfViewer.annotation.measureAnnotationModule.modifyInCollection("notes",e.pageIndex,e,t),this.pdfViewer.annotation.stickyNotesAnnotationModule.addTextToComments(e.annotName,e.notes),this.renderAnnotations(e.pageIndex,null,null,null,null))},JSt.prototype.onAnnotationMouseDown=function(){var e;1===this.pdfViewer.selectedItems.annotations.length&&null===this.pdfViewer.selectedItems.annotations[0].formFieldAnnotationType&&this.pdfViewer.toolbar&&this.pdfViewer.toolbar.annotationToolbarModule&&(N||!F.isDevice||this.pdfViewer.enableDesktopMode||"none"===document.getElementById(this.pdfViewer.element.id+"_commantPanel").style.display&&(this.pdfViewer.enableToolbar&&this.pdfViewer.enableAnnotationToolbar&&!je(this.pdfViewer.annotationModule.textMarkupAnnotationModule)&&this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation?this.pdfViewer.toolbarModule.annotationToolbarModule.createPropertyTools(""):this.pdfViewer.enableToolbar&&this.pdfViewer.enableAnnotationToolbar&&!this.pdfViewerBase.isAddComment&&(this.pdfViewer.toolbarModule.annotationToolbarModule.createAnnotationToolbarForMobile(),this.pdfViewer.toolbarModule.annotationToolbarModule.createPropertyTools(this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType),e=document.getElementById(this.pdfViewer.element.id+"_annotationIcon"))&&!e.parentElement.classList.contains("e-pv-select")&&e.parentElement.classList.add("e-pv-select")),this.enableBasedOnType(),this.pdfViewer.toolbar.annotationToolbarModule.selectAnnotationDeleteItem(!0))},JSt.prototype.enableBasedOnType=function(){var e=!1,t=this.pdfViewer.selectedItems.annotations[0];t&&t.annotationSettings&&(e=t.annotationSettings.isLock)&&this.checkAllowedInteractions("PropertyChange",t)&&(e=!1),!F.isDevice||this.pdfViewer.enableDesktopMode?e||("Stamp"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"Image"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"StickyNotes"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?this.pdfViewer.toolbar.annotationToolbarModule.enableStampAnnotationPropertiesTools(!0):"Path"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"SignatureImage"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"SignatureText"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?this.pdfViewer.toolbar.annotationToolbarModule.enableAnnotationPropertiesTools(!1):"FreeText"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?this.pdfViewer.toolbar.annotationToolbarModule.enableFreeTextAnnotationPropertiesTools(!0):"HandWrittenSignature"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"Ink"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?this.pdfViewer.toolbar.annotationToolbarModule.enableSignaturePropertiesTools(!0):1===this.pdfViewer.selectedItems.annotations.length&&null===this.pdfViewer.selectedItems.annotations[0].formFieldAnnotationType&&this.pdfViewer.toolbar.annotationToolbarModule.enableAnnotationPropertiesTools(!0)):je(this.pdfViewer.annotationModule.textMarkupAnnotationModule)||this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation||"annotations"===this.pdfViewer.selectedItems.annotations[0].propName||!F.isDevice||this.pdfViewer.enableDesktopMode||this.pdfViewer.toolbarModule.annotationToolbarModule.createMobileAnnotationToolbar(!0,!0)},JSt.prototype.getProperDate=function(e){var t=new Date(e.toString());return isNaN(t.getFullYear())&&(e=(e=e.slice(2,16)).slice(0,4)+"/"+e.slice(4,6)+"/"+e.slice(6,8)+" "+e.slice(8,10)+":"+e.slice(10,12)+":"+e.slice(12,14),t=new Date(e)),t.getMonth()+1+"/"+t.getDate()+"/"+t.getFullYear()+" "+t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()},JSt.prototype.getPageCollection=function(e,t){for(var i=null,n=0;n<e.length;n++)if(e[parseInt(n.toString(),10)].pageIndex===t){i=n;break}return i},JSt.prototype.getAnnotationWithId=function(e,t){for(var i,n=0;n<e.length;n++)t===e[parseInt(n.toString(),10)].id&&(i=e[parseInt(n.toString(),10)]);return i},JSt.prototype.getEventPageNumber=function(e){var t,i=e.target,n=e.target.parentElement;return i.classList.contains("e-pv-hyperlink")?i=n:n&&n.classList.contains("foreign-object")&&n.parentElement&&n.parentElement.parentElement&&n.parentElement.parentElement.parentElement?i=n.parentElement.parentElement.parentElement:i.classList.contains("e-pdfviewer-formFields")&&(i=n),i&&(t=i.id.split("_text_")[1]||i.id.split("_textLayer_")[1]||i.id.split("_annotationCanvas_")[1]||i.id.split("_pageDiv_")[1]),isNaN(parseInt(t,10))&&((i=(e=this.pdfViewerBase.annotationEvent&&this.pdfViewerBase.annotationEvent.target.id===i.id?this.pdfViewerBase.annotationEvent:e).target)&&i.id&&(t=i.id.split("_text_")[1]||i.id.split("_textLayer_")[1]||i.id.split("_annotationCanvas_")[1]||i.id.split("_pageDiv_")[1]),je(this.pdfViewerBase.annotationEvent)||je(this.pdfViewerBase.annotationEvent.target)||!je(t)||(t=this.pdfViewerBase.annotationEvent.target.id.split("_textLayer_")[1])),parseInt(t,10)},JSt.prototype.getAnnotationComments=function(e,t,i){var n=[];if(e&&0<e.length)for(var o=0;o<e.length;o++){var r=e[parseInt(o.toString(),10)],r={shapeAnnotationType:"sticky",author:r.Author,modifiedDate:r.ModifiedDate,note:r.Note,state:r.state,stateModel:r.stateModel,comments:[],review:{state:r.State,stateModel:r.StateModel,modifiedDate:r.ModifiedDate,author:r.Author},annotName:r.AnnotName,parentId:t.AnnotName,subject:r.Subject,isLock:r.IsLock};n[n.length]=r}return n},JSt.prototype.getRandomNumber=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){return(16*Math.random()|0).toString(16)})},JSt.prototype.createGUID=function(){return this.getRandomNumber()},JSt.prototype.createBlendAnnotationsIntoCanvas=function(e,t,i,n,o){var r=this.pdfViewerBase.getElement("_blendAnnotationsIntoCanvas_"+n);return r?(this.pdfViewerBase.updateCanvas(r,t,i,n),r):(r=Q("canvas",{id:this.pdfViewer.element.id+"_blendAnnotationsIntoCanvas_"+n,className:"e-pv-annotation-canvas"}),this.pdfViewerBase.updateCanvas(r,t,i,n),r.style.mixBlendMode="multiply",e.appendChild(r),r)},JSt.prototype.resizeAnnotations=function(t,i,n){var o=this;["_annotationCanvas_","_blendAnnotationsIntoCanvas_"].forEach(function(e){e=o.pdfViewerBase.getElement(e+n);e&&(e.style.width=t+"px",e.style.height=i+"px",o.pdfViewerBase.applyElementStyles(e,n))})},JSt.prototype.clearAnnotationCanvas=function(n){var o=this,r=this.pdfViewerBase.getZoomFactor(),s=this.pdfViewerBase.getZoomRatio(r);["_annotationCanvas_","_blendAnnotationsIntoCanvas_"].forEach(function(e){var t,i,e=o.pdfViewerBase.getElement(e+n);e&&(t=o.pdfViewerBase.pageSize[parseInt(n.toString(),10)].width,i=o.pdfViewerBase.pageSize[parseInt(n.toString(),10)].height,e.width=t*s,e.height=i*s,e.style.width=t*r+"px",e.style.height=i*r+"px")})},JSt.prototype.renderAnnotations=function(e,t,i,n,o,r,s,a,l){if(this.clearAnnotationCanvas(e),this.shapeAnnotationModule&&(r?this.shapeAnnotationModule.renderShapeAnnotations(t,e,!0):this.shapeAnnotationModule.renderShapeAnnotations(t,e,null,s)),this.measureAnnotationModule&&(r?this.measureAnnotationModule.renderMeasureShapeAnnotations(i,e,!0):this.measureAnnotationModule.renderMeasureShapeAnnotations(i,e,null,s)),this.freeTextAnnotationModule&&(r?this.freeTextAnnotationModule.renderFreeTextAnnotations(a,e,!0):this.freeTextAnnotationModule.renderFreeTextAnnotations(a,e,null,s)),this.inkAnnotationModule&&(r?this.inkAnnotationModule.renderExistingInkSignature(l,e,!0):this.inkAnnotationModule.renderExistingInkSignature(l,e,null,s)),this.pdfViewer.drawing.refreshCanvasDiagramLayer(o,e),this.pdfViewerBase.getElement("_blendAnnotationsIntoCanvas_"+e)&&this.pdfViewer.drawing.refreshCanvasDiagramLayer(o,e),!this.pdfViewerBase.isInkAdded&&"Ink"===this.pdfViewer.tool&&this.pdfViewer.currentPageNumber-1===e){var t=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",this.pdfViewer.currentPageNumber-1),i=this.pdfViewerBase.getZoomFactor(),a=this.pdfViewerBase.getWindowDevicePixelRatio(),h=t.getContext("2d"),l=this.pdfViewer.inkAnnotationSettings.thickness||1,s=this.pdfViewer.inkAnnotationSettings.opacity||1,o=this.pdfViewer.inkAnnotationSettings.strokeColor||"#ff0000";(!F.isDevice||F.isDevice&&i<=.7)&&h.setTransform(a,0,0,a,0,0),h.beginPath(),h.lineJoin="round",h.lineCap="round",h.lineWidth=1<l*i?l*i:l,h.strokeStyle=o,h.globalAlpha=s;for(var d=cbt(rbt(this.pdfViewer.annotationModule.inkAnnotationModule.updateInkDataWithZoom())),p=0;p<d.length;p++){var c=d[parseInt(p.toString(),10)];switch(c.command){case"M":h.moveTo(c.x,c.y);break;case"L":h.lineTo(c.x,c.y)}}h.stroke(),h.closePath(),je(this.pdfViewer.toolbarModule)||je(this.pdfViewer.toolbarModule.annotationToolbarModule)||(this.pdfViewer.toolbar.annotationToolbarModule.inkAnnotationSelected=!0)}this.textMarkupAnnotationModule&&(r?this.textMarkupAnnotationModule.renderTextMarkupAnnotationsInPage(n,e,!0):this.textMarkupAnnotationModule.renderTextMarkupAnnotationsInPage(n,e))},JSt.prototype.storeAnnotations=function(e,i,t){4500<ARt.sessionStorageManager.getWindowSessionStorageSize()&&(this.clearAnnotationStorage(),this.pdfViewerBase.isStorageExceed=!0,this.pdfViewerBase.isFormStorageExceed||this.pdfViewer.formFieldsModule&&this.pdfViewer.formFieldsModule.clearFormFieldStorage());var n,o,r=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+t),s=0;return r=(r=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+t]:r)?(this.storeAnnotationCollections(i,e),n=JSON.parse(r),this.pdfViewerBase.isStorageExceed||ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+t),null!=(o=this.pdfViewer.annotationModule.getPageCollection(n,e))&&n[parseInt(o.toString(),10)]?(n[parseInt(o.toString(),10)].annotations.filter(function(e,t){e.annotName===i.annotName&&n[parseInt(o.toString(),10)].annotations.splice(t,1)}),n[parseInt(o.toString(),10)].annotations.push(i),s=n[parseInt(o.toString(),10)].annotations.indexOf(i)):((r={pageIndex:e,annotations:[]}).annotations.push(i),s=r.annotations.indexOf(i),n.push(r)),JSON.stringify(n)):(this.storeAnnotationCollections(i,e),(r={pageIndex:e,annotations:[]}).annotations.push(i),s=r.annotations.indexOf(i),(e=[]).push(r),JSON.stringify(e)),this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+t]=r:ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+t,r),s},JSt.prototype.getArrowType=function(e){var t="None";switch(e){case"ClosedArrow":case"Closed":t="Arrow";break;case"OpenArrow":case"Open":t="OpenArrow";break;case"Square":t="Square";break;case"Circle":case"Round":t="Circle";break;case"Diamond":t="Diamond";break;case"Butt":t="Butt"}return t},JSt.prototype.getArrowTypeForCollection=function(e){var t;switch(e){case"Arrow":t="ClosedArrow";break;case"OpenArrow":case"Square":case"Circle":case"Diamond":case"None":t=e.toString();break;case"Butt":t="Butt"}return t},JSt.prototype.getBounds=function(e,t){t=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)];return t?1===t.rotation?{left:e.top,top:t.width-(e.left+e.width),width:e.height,height:e.width}:2===t.rotation?{left:t.width-e.left-e.width,top:t.height-e.top-e.height,width:e.width,height:e.height}:3===t.rotation?{left:t.height-e.top-e.height,top:e.left,width:e.height,height:e.width}:e:e},JSt.prototype.getInkBounds=function(e,t){t=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)];return t?1===t.rotation?{x:e.y,y:t.width-(e.x+e.width),width:e.height,height:e.width}:2===t.rotation?{x:t.width-e.x-e.width,y:t.height-e.y-e.height,width:e.width,height:e.height}:3===t.rotation?{x:t.height-e.y-e.height,y:e.x,width:e.height,height:e.width}:e:e},JSt.prototype.getVertexPoints=function(e,t){if(e){var i=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)];if(1===i.rotation){for(var n=[],o=0;o<e.length;o++){var r={x:e[parseInt(o.toString(),10)].y,y:i.width-e[parseInt(o.toString(),10)].x};n.push(r)}return n}if(2===i.rotation){for(var s=[],o=0;o<e.length;o++){r={x:i.width-e[parseInt(o.toString(),10)].x,y:i.height-e[parseInt(o.toString(),10)].y};s.push(r)}return s}if(3!==i.rotation)return e;for(var a=[],o=0;o<e.length;o++){r={x:i.height-e[parseInt(o.toString(),10)].y,y:e[parseInt(o.toString(),10)].x};a.push(r)}return a}},JSt.prototype.getStoredAnnotations=function(e,t,i){var n=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+i);return(n=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+i]:n)&&(i=JSON.parse(n),null!=(n=this.pdfViewer.annotationModule.getPageCollection(i,e)))&&i[parseInt(n.toString(),10)]?i[parseInt(n.toString(),10)].annotations:null},JSt.prototype.triggerAnnotationPropChange=function(e,t,i,n,o,r,s,a,l,h,d){this.getAnnotationIndex(e.pageIndex,e.id);var p=this.getAnnotationType(e.shapeAnnotationType,e.measureType),e={name:"annotationPropertiesChange",pageIndex:e.pageIndex,annotationId:e.annotName,annotationType:p,isColorChanged:t,isOpacityChanged:o,isThicknessChanged:n,isStrokeColorChanged:i};l&&(e.isFreeTextChanged=l,e.previousText=h,e.currentText=d),r&&(e.isLineHeadStartStyleChanged=r),s&&(e.isLineHeadEndStyleChanged=s),a&&(e.isBorderDashArrayChanged=a),this.pdfViewer.trigger("annotationPropertiesChange",e)},JSt.prototype.triggerAnnotationAdd=function(e){var t,i={opacity:e.opacity,fillColor:e.fillColor,strokeColor:e.strokeColor,thickness:e.thickness,author:e.author,subject:e.subject,modifiedDate:e.modifiedDate},n={left:e.wrapper.bounds.x,top:e.wrapper.bounds.y,width:e.wrapper.bounds.width,height:e.wrapper.bounds.height},o=this.getAnnotationType(e.shapeAnnotationType,e.measureType);"Line"!==o&&"Arrow"!==o&&"Distance"!==o&&"Perimeter"!==o||(i.lineHeadStartStyle=this.getArrowString(e.sourceDecoraterShapes),i.lineHeadEndStyle=this.getArrowString(e.taregetDecoraterShapes),i.borderDashArray=e.borderDashArray),this.pdfViewer.enableShapeLabel?(t={fontColor:e.fontColor,fontSize:e.fontSize,fontFamily:e.fontFamily,opacity:e.labelOpacity,labelContent:e.labelContent,fillColor:e.labelFillColor},this.pdfViewer.fireAnnotationAdd(e.pageIndex,e.annotName,o,n,i,null,null,null,t)):this.pdfViewer.fireAnnotationAdd(e.pageIndex,e.annotName,o,n,i)},JSt.prototype.triggerAnnotationResize=function(e){var t,i={opacity:e.opacity,fillColor:e.fillColor,strokeColor:e.strokeColor,thickness:e.thickness,author:e.author,subject:e.subject,modifiedDate:e.modifiedDate},n=e.bounds,o={left:n.x,top:n.y,x:n.x,y:n.y,width:n.width,height:n.height},n={left:n.oldProperties.x,top:n.oldProperties.y,width:n.oldProperties.width,height:n.oldProperties.height},r=this.getAnnotationType(e.shapeAnnotationType,e.measureType);"Line"!==r&&"Arrow"!==r&&"Distance"!==r&&"Perimeter"!==r||(i.lineHeadStartStyle=this.getArrowString(e.sourceDecoraterShapes),i.lineHeadEndStyle=this.getArrowString(e.taregetDecoraterShapes),i.borderDashArray=e.borderDashArray),this.pdfViewer.enableShapeLabel&&"HandWrittenSignature"!==e.shapeAnnotationType?(t={fontColor:e.fontColor,fontSize:e.fontSize,fontFamily:e.fontFamily,opacity:e.labelOpacity,labelContent:e.labelContent,fillColor:e.labelFillColor,notes:e.notes},this.pdfViewer.fireAnnotationResize(e.pageIndex,e.annotName,r,o,i,null,null,null,t)):"HandWrittenSignature"===e.shapeAnnotationType||"SignatureText"===e.shapeAnnotationType||"SignatureImage"===e.shapeAnnotationType?this.pdfViewer.fireSignatureResize(e.pageIndex,e.signatureName,e.shapeAnnotationType,e.opacity,e.strokeColor,e.thickness,o,n):this.pdfViewer.fireAnnotationResize(e.pageIndex,e.annotName,r,o,i)},JSt.prototype.triggerAnnotationMove=function(e,t){var i={opacity:e.opacity,fillColor:e.fillColor,strokeColor:e.strokeColor,thickness:e.thickness,author:e.author,subject:e.subject,modifiedDate:e.modifiedDate},n=e.bounds,o={left:n.x,top:n.y,x:n.x,y:n.y,width:n.width,height:n.height},n={left:n.oldProperties.x||n.x,top:n.oldProperties.y||n.y,width:n.width,height:n.height},r=this.getAnnotationType(e.shapeAnnotationType,e.measureType);"Line"!==r&&"Arrow"!==r&&"Distance"!==r&&"Perimeter"!==r||(i.lineHeadStartStyle=this.getArrowString(e.sourceDecoraterShapes),i.lineHeadEndStyle=this.getArrowString(e.taregetDecoraterShapes),i.borderDashArray=e.borderDashArray),"HandWrittenSignature"===e.shapeAnnotationType||"SignatureText"===e.shapeAnnotationType||"SignatureImage"===e.shapeAnnotationType?this.pdfViewer.fireSignatureMove(e.pageIndex,e.signatureName,e.shapeAnnotationType,e.opacity,e.strokeColor,e.thickness,n,o):t?this.pdfViewer.fireAnnotationMoving(e.pageIndex,e.annotName,r,i,n,o):this.pdfViewer.fireAnnotationMove(e.pageIndex,e.annotName,r,i,n,o)},JSt.prototype.annotationSelect=function(e,t,i,n,o,r){"textMarkup"===i.shapeAnnotationType?s={type:"TextMarkup",subType:i.subject,opacity:i.opacity,color:i.color,textMarkupContent:i.textMarkupContent,textMarkupStartIndex:i.textMarkupStartIndex,textMarkupEndIndex:i.textMarkupEndIndex,customData:i.customData}:"StickyNotes"===i.shapeAnnotationType?s={type:"StickyNotes",opacity:i.opacity,customData:i.customData}:"Stamp"===i.shapeAnnotationType||"Image"===i.shapeAnnotationType?s={type:"Stamp",opacity:i.opacity,customData:i.customData}:"Ink"===i.shapeAnnotationType?s={type:"Ink",opacity:i.opacity,strokeColor:i.strokeColor,thickness:i.thickness,modifiedDate:i.modifiedDate,width:i.bounds.width,height:i.bounds.height,left:i.bounds.x,top:i.bounds.y,data:i.data,customData:i.customData}:"FreeText"===i.shapeAnnotationType?s={type:"FreeText",opacity:i.opacity,fillColor:i.fillColor,strokeColor:i.strokeColor,thickness:i.thickness,content:i.dynamicText,fontFamily:i.fontFamily,fontSize:i.fontSize,fontColor:i.fontColor,textAlign:i.textAlign,fontStyle:this.updateFreeTextFontStyle(i.font),customData:i.customData}:""===i.measureType?"Line"===i.shapeAnnotationType?s={type:"Shape",subType:"Line",opacity:i.opacity,fillColor:i.fillColor,strokeColor:i.strokeColor,thickness:i.thickness,borderDashArray:i.borderDashArray,lineHeadStartStyle:i.sourceDecoraterShapes,lineHeadEndStyle:i.taregetDecoraterShapes,customData:i.customData}:"Arrow"===i.shapeAnnotationType||"LineWidthArrowHead"===i.shapeAnnotationType?s={type:"Shape",subType:"Arrow",opacity:i.opacity,fillColor:i.fillColor,strokeColor:i.strokeColor,thickness:i.thickness,borderDashArray:i.borderDashArray,lineHeadStartStyle:i.sourceDecoraterShapes,lineHeadEndStyle:i.taregetDecoraterShapes,customData:i.customData}:"Rectangle"===i.shapeAnnotationType?s={type:"Shape",subType:"Rectangle",opacity:i.opacity,fillColor:i.fillColor,strokeColor:i.strokeColor,thickness:i.thickness,customData:i.customData}:"Circle"===i.shapeAnnotationType||"Ellipse"===i.shapeAnnotationType?s={type:"Shape",subType:"Circle",opacity:i.opacity,fillColor:i.fillColor,strokeColor:i.strokeColor,thickness:i.thickness,customData:i.customData}:"Polygon"===i.shapeAnnotationType&&(s={type:"Shape",subType:"Polygon",opacity:i.opacity,fillColor:i.fillColor,strokeColor:i.strokeColor,thickness:i.thickness,customData:i.customData}):""!==i.measureType&&("Distance"===i.measureType?s={type:"Measure",subType:"Distance",opacity:i.opacity,fillColor:i.fillColor,strokeColor:i.strokeColor,thickness:i.thickness,borderDashArray:i.borderDashArray,lineHeadStartStyle:i.sourceDecoraterShapes,lineHeadEndStyle:i.taregetDecoraterShapes,customData:i.customData}:"Perimeter"===i.measureType?s={type:"Measure",subType:"Perimeter",opacity:i.opacity,fillColor:i.fillColor,strokeColor:i.strokeColor,thickness:i.thickness,borderDashArray:i.borderDashArray,lineHeadStartStyle:i.sourceDecoraterShapes,lineHeadEndStyle:i.taregetDecoraterShapes,customData:i.customData}:"Area"===i.measureType?s={type:"Measure",subType:"Area",opacity:i.opacity,fillColor:i.fillColor,strokeColor:i.strokeColor,thickness:i.thickness,customData:i.customData}:"Radius"===i.measureType?s={type:"Measure",subType:"Radius",opacity:i.opacity,fillColor:i.fillColor,strokeColor:i.strokeColor,thickness:i.thickness,customData:i.customData}:"Volume"===i.measureType&&(s={type:"Measure",subType:"Volume",opacity:i.opacity,fillColor:i.fillColor,strokeColor:i.strokeColor,thickness:i.thickness,calibrate:i.calibrate,annotationId:i.annotName,customData:i.customData}));var s,a=[],l=this.getOverlappedAnnotations(i,t);if(l&&this.overlappedCollections){for(var h=[],d=0;d<l.length;d++)if("textMarkup"!==l[parseInt(d.toString(),10)].shapeAnnotationType&&this.overlappedCollections||r){for(var p=0;p<this.overlappedCollections.length;p++)if(l[parseInt(d.toString(),10)].annotName===this.overlappedCollections[parseInt(p.toString(),10)].annotName){h.push(l[parseInt(d.toString(),10)]);break}}else h.push(l[parseInt(d.toString(),10)]);l=h}if(this.pdfViewer.enableMultiLineOverlap)for(d=0;d<l.length;d++)if("textMarkup"===l[parseInt(d.toString(),10)].shapeAnnotationType){for(var c=!1,p=0;p<l[parseInt(d.toString(),10)].bounds.length;p++){var u=this.orderTextMarkupBounds(l[parseInt(d.toString(),10)].bounds[parseInt(p.toString(),10)]),g=this.textMarkupAnnotationModule.annotationClickPosition;(!g||!g.x&&!g.y||u.left<=g.x&&u.left+u.width>=g.x&&u.top<=g.y&&u.top+u.height>=g.y)&&(c=!0)}c||l.splice(d,1)}if(l&&0<l.length){n=l;for(d=0;d<n.length;d++){var m=owt(n[parseInt(d.toString(),10)]);m.annotationId=n[parseInt(d.toString(),10)].annotName,e===n[parseInt(d.toString(),10)].annotName&&i.measureType&&"Volume"===i.measureType&&(s.calibrate=n[parseInt(d.toString(),10)].calibrate),delete m.annotName,a.push(m)}}else a=null;this.addFreeTextProperties(i,s);var f=i.annotationAddMode;o?("Stamp"===i.shapeAnnotationType||"Image"===i.shapeAnnotationType)&&this.pdfViewerBase.isNewStamp||this.pdfViewer.fireAnnotationDoubleClick(e,t,s):"Stamp"===i.shapeAnnotationType||"Image"===i.shapeAnnotationType?!this.pdfViewerBase.isNewStamp&&this.annotationSelected&&(a?this.pdfViewer.fireAnnotationSelect(e,t,s,a,null,null,f):this.pdfViewer.fireAnnotationSelect(e,t,s,null,null,null,f)):((o=(o=this.textMarkupAnnotationModule)&&o.multiPageCollectionList(i))&&0===o.length&&(o=null),this.annotationSelected&&(a?this.pdfViewer.fireAnnotationSelect(e,t,s,a,o,r=!1,f):this.pdfViewer.fireAnnotationSelect(e,t,s,null,o,r=!0,f))),this.annotationSelected=!0},JSt.prototype.selectSignature=function(e,t,i){var n=i.bounds,n={height:n.height,width:n.width,x:n.x,y:n.y};this.pdfViewerBase.signatureAdded||"ink"===i.signatureName||(n={bounds:n,opacity:i.opacity,thickness:i.thickness,strokeColor:i.strokeColor},this.pdfViewer.fireSignatureSelect(e,t,n))},JSt.prototype.unselectSignature=function(e,t,i){var n=i.bounds,n={height:n.height,width:n.width,x:n.x,y:n.y};this.pdfViewerBase.signatureAdded||(n={bounds:n,opacity:i.opacity,thickness:i.thickness,strokeColor:i.strokeColor},this.pdfViewer.fireSignatureUnselect(e,t,n))},JSt.prototype.editSignature=function(e){var t,i,n=e.uniqueKey?this.pdfViewer.nameTable[e.uniqueKey]:this.pdfViewer.selectedItems.annotations[0],o=n.pageIndex;"HandWrittenSignature"!==n.shapeAnnotationType&&"SignatureText"!==n.shapeAnnotationType&&"SignatureImage"!==n.shapeAnnotationType||(t=owt(n),i=owt(n),je(e.opacity)&&n.opacity===e.opacity||(i.opacity=e.opacity,this.pdfViewer.nodePropertyChange(n,{opacity:e.opacity}),this.pdfViewer.fireSignaturePropertiesChange(n.pageIndex,n.signatureName,n.shapeAnnotationType,!1,!0,!1,t.opacity,i.opacity),this.pdfViewer.annotation.addAction(n.pageIndex,null,n,"Shape Opacity","",t,i)),n.strokeColor!==e.strokeColor&&(i.strokeColor=e.strokeColor,this.pdfViewer.nodePropertyChange(n,{strokeColor:e.strokeColor}),this.pdfViewer.fireSignaturePropertiesChange(n.pageIndex,n.signatureName,n.shapeAnnotationType,!0,!1,!1,t.strokeColor,i.strokeColor),this.pdfViewer.annotation.addAction(n.pageIndex,null,n,"Shape Stroke","",t,i)),n.thickness!==e.thickness&&(i.thickness=e.thickness,this.pdfViewer.nodePropertyChange(n,{thickness:e.thickness}),this.pdfViewer.fireSignaturePropertiesChange(n.pageIndex,n.signatureName,n.shapeAnnotationType,!1,!1,!0,t.thickness,i.thickness),this.pdfViewer.annotation.addAction(n.pageIndex,null,n,"Shape Thickness","",t,i)),n.modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),this.pdfViewer.renderDrawing(),this.pdfViewerBase.signatureModule.modifySignatureCollection(null,o,n,!0))},JSt.prototype.deletComment=function(e){e.parentElement.firstChild===e?this.deleteAnnotation():this.pdfViewer.annotationModule.stickyNotesAnnotationModule.modifyCommentDeleteProperty(e.parentElement,e)},JSt.prototype.addReplyComments=function(e,t,i){if("add"===i){var n=document.getElementById(e.annotName);this.pdfViewer.annotationModule.stickyNotesAnnotationModule.createCommentDiv(n);for(var o=0;o<t.length;o++)this.pdfViewer.annotationModule.stickyNotesAnnotationModule.saveCommentDiv(n,t[parseInt(o.toString(),10)])}else"next"===i&&(n=document.getElementById(e.annotationId),this.selectAnnotation(e),this.pdfViewer.annotationModule.stickyNotesAnnotationModule.saveCommentDiv(n,t))},JSt.prototype.editComments=function(e,t){document.getElementById(e).childNodes[1].ej2_instances[0].value=t},JSt.prototype.editAnnotation=function(e){var t,i,n,o=!1;if(!(l=je(this.pdfViewer.annotationModule.textMarkupAnnotationModule)||je(this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation)?l:this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation)||e.annotationId&&e.uniqueKey||e.annotationId!==l.annotName?this.pdfViewer.selectedItems.annotations[0]&&(t=(a=this.pdfViewer.selectedItems.annotations[0]).annotName,n=a.pageIndex):(t=(a=this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation).annotName,n=this.pdfViewer.annotationModule.textMarkupAnnotationModule.selectTextMarkupCurrentPage),void 0!==e.uniqueKey){if((a=this.pdfViewer.nameTable[e.uniqueKey])&&a.annotationSettings&&!je(a.annotationSettings.isLock)&&(a.annotationSettings.isLock=e.annotationSettings.isLock,this.isEdited=!0),t=a.annotName,n=a.pageIndex,N&&e.allowedInteractions)for(var r=e.allowedInteractions.length,s=0;s<r;s++)0===e.allowedInteractions[parseInt(s.toString(),10)]&&(e.allowedInteractions[parseInt(s.toString(),10)]=FCt.Select),1===e.allowedInteractions[parseInt(s.toString(),10)]&&(e.allowedInteractions[parseInt(s.toString(),10)]=FCt.Move),2===e.allowedInteractions[parseInt(s.toString(),10)]&&(e.allowedInteractions[parseInt(s.toString(),10)]=FCt.Resize),3===e.allowedInteractions[parseInt(s.toString(),10)]&&(e.allowedInteractions[parseInt(s.toString(),10)]=FCt.Delete),4===e.allowedInteractions[parseInt(s.toString(),10)]&&(e.allowedInteractions[parseInt(s.toString(),10)]=FCt.PropertyChange),5===e.allowedInteractions[parseInt(s.toString(),10)]&&(e.allowedInteractions[parseInt(s.toString(),10)]=FCt.None);e.allowedInteractions&&a.allowedInteractions!==e.allowedInteractions&&(this.isEdited=!0),a.allowedInteractions=e.allowedInteractions||this.updateAnnotationAllowedInteractions(e)}if(a||"sticky"===e.shapeAnnotationType&&void 0!==e.annotationId&&(a=this.pdfViewer.nameTable[e.annotationId])&&(a.annotationSettings.isLock=e.annotationSettings.isLock,t=a.annotName,n=a.pageIndex,this.isEdited=!0),"textMarkup"===e.shapeAnnotationType)for(var a=this.pdfViewer.annotationModule.textMarkupAnnotationModule.getAnnotations(e.pageNumber,e),s=0;s<a.length;s++)if(e.annotationId===a[parseInt(s.toString(),10)].annotName){o=!0,(a=a[parseInt(s.toString(),10)]).isPrint=e.isPrint,this.textMarkupAnnotationModule.currentTextMarkupAnnotation=a,this.textMarkupAnnotationModule.selectTextMarkupCurrentPage=a.pageNumber,a.allowedInteractions=e.allowedInteractions,n=a.pageNumber,t=e.annotationId,this.isEdited=!0;break}if(a){var l=owt(a),h=owt(a);if("textMarkup"===e.shapeAnnotationType&&(i="textMarkup"),e&&!0===e.isCommentLock&&(a.isCommentLock=e.isCommentLock,this.isEdited=!0),e&&JSON.stringify(a.annotationSelectorSettings)!==JSON.stringify(e.annotationSelectorSettings)&&(!je(e.type)&&"TextMarkup"!==e.type||!je(e.shapeAnnotationType)&&"textMarkup"!==e.shapeAnnotationType)&&(a.annotationSelectorSettings=e.annotationSelectorSettings,h.annotationSelectorSettings=e.annotationSelectorSettings,this.isEdited=!0,this.pdfViewer.nodePropertyChange(a,{annotationSelectorSettings:e.annotationSelectorSettings}),this.triggerAnnotationPropChange(a,!1,!0,!1,!1)),e.comments)for(var d=0;d<e.comments.length;d++)!0===e.comments[parseInt(d.toString(),10)].isLock&&(i?(a.comments=e.comments,a.comments[parseInt(d.toString(),10)].isLock=e.comments[parseInt(d.toString(),10)].isLock):(a.properties.comments=e.comments,a.properties.comments[parseInt(d.toString(),10)].isLock=e.comments[parseInt(d.toString(),10)].isLock),this.isEdited=!0);if(e&&""!==e.note&&void 0!==e.note?(i?(a.note=e.note,this.pdfViewer.annotationModule.stickyNotesAnnotationModule.addTextToComments(a.annotName,a.note)):(a.notes=e.note,this.pdfViewer.annotationModule.stickyNotesAnnotationModule.addTextToComments(a.annotName,a.notes)),this.isEdited=!0):e&&e.isCommentLock&&(e.type&&"FreeText"!==e.type||"FreeText"!==e.shapeAnnotationType)&&(this.pdfViewer.annotationModule.stickyNotesAnnotationModule.addTextToComments(a.annotName,"  "),this.isEdited=!0),e.commentId&&e.editComment&&"edit"===e.commentType&&(this.editComments(e.commentId,e.editComment),this.isEdited=!0),e.replyComment&&"add"===e.commentType&&(this.addReplyComments(a,e.replyComment,e.commentType),this.pdfViewer.annotationCollection[0].note=e.note,this.isEdited=!0),e.nextComment&&"next"===e.commentType&&(this.addReplyComments(e,e.nextComment,e.commentType),this.isEdited=!0),""===e.note&&"delete"===e.commentType&&(m=document.getElementById(e.annotationId),this.deletComment(m),this.isEdited=!0),e.comments&&"delete"===e.commentType&&""!==e.note){var p=document.querySelectorAll(".e-pv-more-options-button");if(p)for(s=0;s<p.length;s++)if("visible"===p[parseInt(s.toString(),10)].style.visibility){var c=p[parseInt(s.toString(),10)].parentElement.nextSibling,u=this.pdfViewer.annotationModule.stickyNotesAnnotationModule.checkIslockProperty(c);c&&!u&&(this.deletComment(c.parentElement),this.isEdited=!0);break}}if("TextMarkup"===e.type||"textMarkup"===e.shapeAnnotationType)a.annotationSettings&&e.annotationSettings&&a.annotationSettings.isLock!==e.annotationSettings.isLock&&(f=this.textMarkupAnnotationModule.modifyAnnotationProperty("AnnotationSettings",e.annotationSettings.isLock,null),this.isEdited=!0,this.textMarkupAnnotationModule.manageAnnotations(f,this.textMarkupAnnotationModule.selectTextMarkupCurrentPage)),e&&JSON.stringify(a.annotationSelectorSettings)!==JSON.stringify(e.annotationSelectorSettings)&&(f=this.textMarkupAnnotationModule.modifyAnnotationProperty("AnnotationSelectorSettings",e.annotationSelectorSettings,null),this.isEdited=!0,this.textMarkupAnnotationModule.manageAnnotations(f,this.textMarkupAnnotationModule.selectTextMarkupCurrentPage)),a.opacity!==e.opacity&&(this.pdfViewer.annotationModule.textMarkupAnnotationModule.modifyOpacityProperty(null,e.opacity),this.isEdited=!0),a.color!==e.color&&(this.pdfViewer.annotationModule.textMarkupAnnotationModule.modifyColorProperty(e.color),this.isEdited=!0),JSON.stringify(a.bounds)!==JSON.stringify(e.bounds)&&(this.pdfViewer.annotationModule.textMarkupAnnotationModule.modifyBoundsProperty(e.bounds),this.isEdited=!0),i="textMarkup",o&&(this.textMarkupAnnotationModule.selectTextMarkupCurrentPage=null);else if(e&&"image"===e.stampAnnotationType&&"stamp"===e.shapeAnnotationType&&e.stampAnnotationPath)i="stamp",a.data!==e.stampAnnotationPath&&(a.data=e.stampAnnotationPath,a.wrapper.children[0].imageSource=e.stampAnnotationPath,this.pdfViewer.renderDrawing(null,n),this.isEdited=!0),je(e.opacity)||a.opacity===e.opacity||(h.opacity=e.opacity,this.annotationPropertyChange(a,e.opacity,"Shape Opacity",l,h),this.isEdited=!0),this.calculateAnnotationBounds(a,e);else if("StickyNotes"===e.type||"Stamp"===e.type||"sticky"===e.shapeAnnotationType||"stamp"===e.shapeAnnotationType)je(e.opacity)||a.opacity===e.opacity||(h.opacity=e.opacity,this.isEdited=!0,this.annotationPropertyChange(a,e.opacity,"Shape Opacity",l,h)),this.calculateAnnotationBounds(a,e),i="StickyNotes"===e.type||"sticky"===e.shapeAnnotationType?"sticky":"stamp";else if("Ink"===e.type||"Shape"===e.type||"Measure"===e.type||"Line"===e.shapeAnnotationType||"Square"===e.shapeAnnotationType||"Circle"===e.shapeAnnotationType||"Polygon"===e.shapeAnnotationType||"Polyline"===e.shapeAnnotationType||"Ink"===e.shapeAnnotationType)"Square"!==e.shapeAnnotationType&&"Circle"!==e.shapeAnnotationType&&"Radius"!==e.shapeAnnotationType&&"Ink"!==e.shapeAnnotationType||this.calculateAnnotationBounds(a,e),je(e.opacity)||a.opacity===e.opacity||(h.opacity=e.opacity,this.isEdited=!0,this.annotationPropertyChange(a,e.opacity,"Shape Opacity",l,h)),e.fillColor&&a.fillColor!==e.fillColor&&(h.fillColor=e.fillColor,this.isEdited=!0,e.labelSettings&&e.labelSettings.fillColor&&(e.labelSettings.fillColor=e.fillColor),this.pdfViewer.nodePropertyChange(a,{fillColor:e.fillColor}),this.triggerAnnotationPropChange(a,!0,!1,!1,!1),this.pdfViewer.annotation.addAction(a.pageIndex,null,a,"Shape Fill","",l,h)),e.strokeColor&&a.strokeColor!==e.strokeColor&&(h.strokeColor=e.strokeColor,this.isEdited=!0,this.pdfViewer.nodePropertyChange(a,{strokeColor:e.strokeColor}),this.triggerAnnotationPropChange(a,!1,!0,!1,!1),this.pdfViewer.annotation.addAction(a.pageIndex,null,a,"Shape Stroke","",l,h)),e.leaderLength&&a.leaderHeight!==e.leaderLength&&(h.leaderHeight=e.leaderLength,this.isEdited=!0,this.pdfViewer.nodePropertyChange(a,{leaderHeight:e.leaderLength})),e.thickness&&a.thickness!==e.thickness&&(h.thickness=e.thickness,this.isEdited=!0,this.pdfViewer.nodePropertyChange(a,{thickness:e.thickness}),this.triggerAnnotationPropChange(a,!1,!1,!0,!1),this.pdfViewer.annotation.addAction(a.pageIndex,null,a,"Shape Thickness","",l,h)),a.author!==e.author&&(h.author=e.author,this.isEdited=!0,this.pdfViewer.nodePropertyChange(a,{author:e.author}),this.triggerAnnotationPropChange(a,!1,!0,!1,!1)),a.subject!==e.subject&&(h.subject=e.subject,this.isEdited=!0,this.pdfViewer.nodePropertyChange(a,{subject:e.subject}),this.triggerAnnotationPropChange(a,!1,!0,!1,!1)),a.modifiedDate!==e.modifiedDate&&(h.modifiedDate=e.modifiedDate,this.isEdited=!0,this.pdfViewer.nodePropertyChange(a,{modifiedDate:e.modifiedDate})),a.subject!==e.subject&&(h.subject=e.subject,this.isEdited=!0,this.pdfViewer.nodePropertyChange(a,{subject:e.subject}),this.triggerAnnotationPropChange(a,!1,!0,!1,!1),this.pdfViewer.annotation.addAction(a.pageIndex,null,a,"Shape Stroke","",l,h)),this.pdfViewer.enableShapeLabel&&a.fontColor!==e.fontColor&&(h.fontColor=e.fontColor,this.isEdited=!0,this.pdfViewer.nodePropertyChange(a,{fontColor:e.fontColor})),this.pdfViewer.enableShapeLabel&&e.labelSettings&&e.labelSettings.fillColor&&a.labelFillColor!==e.labelSettings.fillColor&&(h.labelFillColor=e.labelSettings.fillColor,this.isEdited=!0,this.pdfViewer.nodePropertyChange(a,{labelFillColor:e.labelSettings.fillColor})),"Line"!==e.shapeAnnotationType&&"Polyline"!==e.shapeAnnotationType&&"Polygon"!==e.shapeAnnotationType||JSON.stringify(a.vertexPoints)!==JSON.stringify(e.vertexPoints)&&(a.vertexPoints=e.vertexPoints,this.isEdited=!0,this.pdfViewer.nodePropertyChange(a,{vertexPoints:e.vertexPoints})),"Line"!==e.subType&&"Arrow"!==e.subType&&"Distance"!==e.subType&&"Perimeter"!==e.subType||(y=f=m=!1,l.lineHeadStart=a.sourceDecoraterShapes,l.lineHeadEnd=a.taregetDecoraterShapes,h.lineHeadStart=e.lineHeadStartStyle,h.lineHeadEnd=e.lineHeadEndStyle,h.borderDashArray=e.borderDashArray,this.isEdited=!0,a.taregetDecoraterShapes!==e.lineHeadEndStyle&&(f=!0),a.sourceDecoraterShapes!==e.lineHeadStartStyle&&(m=!0),a.borderDashArray!==e.borderDashArray&&(y=!0),this.pdfViewer.nodePropertyChange(a,{sourceDecoraterShapes:e.lineHeadStartStyle,taregetDecoraterShapes:e.lineHeadEndStyle,borderDashArray:e.borderDashArray}),this.triggerAnnotationPropChange(a,!1,!1,!1,!1,m,f,y),this.pdfViewer.annotation.addAction(a.pageIndex,null,a,"Line properties change","",l,h)),"Shape"!==e.type&&"Line"!==e.shapeAnnotationType&&"Square"!==e.shapeAnnotationType&&"Circle"!==e.shapeAnnotationType&&"Polygon"!==e.shapeAnnotationType||(i="shape"),"Ink"!==e.type&&"Ink"!==e.shapeAnnotationType||(i="ink"),"Measure"!==e.type&&"LineDimension"!==e.indent&&"PolyLineDimension"!==e.indent&&"PolygonDimension"!==e.indent&&"PolygonRadius"!==e.indent&&"PolygonVolume"!==e.indent||(i="shape_measure"),e.labelSettings&&this.pdfViewer.enableShapeLabel&&(this.updateFreeTextProperties(a),this.pdfViewer.nodePropertyChange(a,{labelOpacity:e.labelSettings.opacity,fontColor:e.labelSettings.fontColor,fontSize:e.labelSettings.fontSize,fontFamily:e.labelSettings.fontFamily,labelContent:a.notes,labelFillColor:e.labelSettings.fillColor}),this.isEdited=!0),this.pdfViewer.enableShapeLabel&&e.calibrate&&e.calibrate.depth&&this.pdfViewer.annotationModule.measureAnnotationModule.volumeDepth!==e.calibrate.depth&&(this.pdfViewer.annotationModule.measureAnnotationModule.volumeDepth=e.calibrate.depth,a.notes=this.pdfViewer.annotationModule.measureAnnotationModule.calculateVolume(a.vertexPoints,a.id,a.pageIndex),a.labelContent=a.notes,this.isEdited=!0,e.labelSettings&&e.labelSettings.labelContent&&(e.labelSettings.labelContent=a.notes),this.pdfViewer.nodePropertyChange(a,{labelContent:a.labelContent}),this.pdfViewer.annotationModule.stickyNotesAnnotationModule.addTextToComments(a.annotName,a.notes));else if("FreeText"===e.type||"FreeText"===e.shapeAnnotationType){if(i="freetext",this.pdfViewer.freeTextSettings.enableAutoFit&&a.dynamicText!==e.content){var g=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",a.pageIndex).getContext("2d"),m=e.fontSize,f=void 0,y=e.fontFamily,v=this.pdfViewerBase.getZoomFactor(),f=e.font.isBold?"bold "+m+"px "+y:m+"px "+y,b=(g.font=f,""),m=e.content||e.dynamicText;if(-1<m.indexOf("\n"))for(var w=m.split("\n"),d=0;d<w.length;d++){var C=g.measureText(w[parseInt(d.toString(),10)]),S=g.measureText(b);C.width>S.width&&(b=w[parseInt(d.toString(),10)])}else b=m;y=g.measureText(b);e.bounds.width=Math.ceil(y.width+18);f=this.pdfViewerBase.getElement("_pageDiv_"+e.pageIndex).clientWidth-e.bounds.left*v,m=(e.bounds.width>f&&(e.bounds.width=f/v),e.bounds.height);e.bounds.height=m>=a.bounds.height?m:a.bounds.height}this.calculateAnnotationBounds(a,e),e.opacity&&a.opacity!==e.opacity&&this.triggerAnnotationPropChange(a,!1,!1,!1,!0),e.fillColor&&a.fillColor!==e.fillColor&&(h.fillColor=e.fillColor,this.isEdited=!0,this.pdfViewer.annotation.addAction(a.pageIndex,null,a,"Shape Fill","",l,h),this.triggerAnnotationPropChange(a,!0,!1,!1,!1)),e.fontColor&&a.fontColor!==e.fontColor&&(h.fontColor=e.fontColor,this.isEdited=!0,this.pdfViewer.annotation.addAction(a.pageIndex,null,a,"fontColor","",l,h),this.triggerAnnotationPropChange(a,!1,!1,!1,!1)),e.strokeColor&&a.strokeColor!==e.strokeColor&&this.triggerAnnotationPropChange(a,!1,!0,!1,!1),e.thickness&&a.thickness!==e.thickness&&this.triggerAnnotationPropChange(a,!1,!1,!0,!1);y=a.isLock,f=(je(e.isLock)?je(e.annotationSettings.isLock)||(y=e.annotationSettings.isLock,this.isEdited=!0):(y=e.isLock,this.isEdited=!0),a.annotationSettings.isLock=y,a.isLock=y,e.content=e.content&&e.content===e.dynamicText?e.content:e.dynamicText,e.content&&a.dynamicText!==e.content&&this.triggerAnnotationPropChange(a,!1,!1,!1,!1,!1,!1,!1,!0,a.dynamicText,e.content),this.pdfViewer.nodePropertyChange(a,{opacity:e.opacity,fontColor:e.fontColor,fontSize:e.fontSize,fontFamily:e.fontFamily,dynamicText:e.content,fillColor:e.fillColor,textAlign:e.textAlign,strokeColor:e.strokeColor,thickness:e.thickness,font:e.fontStyle?this.setFreeTextFontStyle(e.fontStyle):this.setFreeTextFontStyle(e.font),isReadonly:e.isReadonly}),e.content&&a&&this.updateAnnotationComments(a.annotName,e.content),document.getElementById(this.pdfViewer.element.id+"_commenttextbox_editor"));new VSt({value:e.content}).appendTo(f)}a.modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),a.customData!==e.customData&&(a.customData=e.customData,this.isEdited=!0),a.isPrint!==e.isPrint&&(a.isPrint=e.isPrint,this.isEdited=!0),"TextMarkup"!==e.type&&"textMarkup"!==e.shapeAnnotationType&&this.pdfViewer.renderDrawing(),this.updateCollection(t,n,e,i),this.isEdited&&this.pdfViewerBase.updateDocumentEditedProperty(!0)}this.isEdited=!1},JSt.prototype.annotationPropertyChange=function(e,t,i,n,o){this.pdfViewer.nodePropertyChange(e,{opacity:t}),this.triggerAnnotationPropChange(e,!1,!1,!1,!0),this.pdfViewer.annotation.addAction(e.pageIndex,null,e,i,"",n,o)},JSt.prototype.calculateAnnotationBounds=function(e,t){var i=this.pdfViewerBase.convertBounds(e.wrapper.bounds),t=this.pdfViewerBase.convertBounds(t.bounds);i&&t&&(JSON.stringify(i)!==JSON.stringify(t)&&2<Math.abs(i.Y-t.Y)||2<Math.abs(i.X-t.X)||2<Math.abs(i.Width-t.Width)||2<Math.abs(i.Height-t.Height))&&(i={x:t.X+t.Width/2,y:t.Y+t.Height/2,width:t.Width,height:t.Height},this.pdfViewer.nodePropertyChange(e,{bounds:i}),this.triggerAnnotationPropChange(e,!1,!1,!1,!1),this.pdfViewer.renderSelector(e.pageIndex,this.pdfViewer.annotationSelectorSettings),this.isEdited=!0)},JSt.prototype.updateFreeTextProperties=function(e){e.labelSettings&&(e.labelSettings.fillColor&&(e.labelFillColor=e.labelSettings.fillColor),e.labelSettings.fontColor&&(e.fontColor=e.labelSettings.fontColor),e.labelSettings.fontSize&&(e.fontSize=e.labelSettings.fontSize),e.labelSettings.fontFamily&&(e.fontFamily=e.labelSettings.fontFamily),e.labelSettings.opacity&&(e.labelOpacity=e.labelSettings.opacity),e.labelSettings.labelContent)&&(e.labelContent=e.labelSettings.labelContent)},JSt.prototype.updateAnnotationComments=function(e,t){e=document.getElementById(e);e&&e.childNodes&&(e.childNodes[0].ej2_instances?e.childNodes[0].ej2_instances[0].value=t:e.childNodes[0].childNodes&&e.childNodes[0].childNodes[1].ej2_instances&&(e.childNodes[0].childNodes[1].ej2_instances[0].value=t))},JSt.prototype.addFreeTextProperties=function(e,t){this.pdfViewer.enableShapeLabel&&e&&t&&(t.labelSettings={fontColor:e.fontColor,fontSize:e.fontSize,fontFamily:e.fontFamily,opacity:e.labelOpacity,labelContent:e.labelContent,fillColor:e.labelFillColor})},JSt.prototype.updateMeasurementSettings=function(){var e;this.pdfViewer.enableAnnotation&&this.pdfViewer.enableMeasureAnnotation&&(e="1 "+this.pdfViewer.measurementSettings.conversionUnit+" = "+this.pdfViewer.measurementSettings.scaleRatio+" "+this.pdfViewer.measurementSettings.displayUnit,this.measureAnnotationModule.updateMeasureValues(e,this.pdfViewer.measurementSettings.displayUnit,this.pdfViewer.measurementSettings.conversionUnit,this.pdfViewer.measurementSettings.depth))},JSt.prototype.updateCollection=function(e,t,i,n){var o,r=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_"+n);if(r=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_"+n]:r){var r=JSON.parse(r),s=this.getPageCollection(r,t);if(null!=s&&r[parseInt(s.toString(),10)]&&null!==(o=r[parseInt(s.toString(),10)].annotations)){for(var a,l=0;l<o.length;l++)o[parseInt(l.toString(),10)].annotName===e&&(a=this.modifyAnnotationProperties(o[parseInt(l.toString(),10)],i,n),o[parseInt(l.toString(),10)]=a,this.storeAnnotationCollections(a,t));this.pdfViewerBase.isStorageExceed||ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_"+n),r[parseInt(s.toString(),10)]&&(r[parseInt(s.toString(),10)].annotations=o);s=JSON.stringify(r);this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_"+n]=s:ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_"+n,s)}}},JSt.prototype.modifyAnnotationProperties=function(e,t,i){var n,o=!1;if(t&&!0===t.isCommentLock&&(e.isCommentLock=t.isCommentLock),je(t)||je(t.annotationSettings)||!0!==t.annotationSettings.isLock||!0!==t.isCommentLock||(o=!0),t.comments)for(var r=0;r<t.comments.length;r++)je(t.comments[parseInt(r.toString(),10)].isLock)||je(e.comments[parseInt(r.toString(),10)])||(e.comments[parseInt(r.toString(),10)].isLock=t.comments[parseInt(r.toString(),10)].isLock);if(t&&""!==t.note&&void 0!==t.note&&(e.note=t.note),t.commentId&&t.editComment&&"edit"===t.commentType){var s=document.getElementById(t.commentId);t.annotationId===t.commentId&&(e.note=s.childNodes[1].ej2_instances[0].value);for(r=0;r<t.comments.length;r++)t.comments[parseInt(r.toString(),10)].annotName===t.commentId&&(e.comments[parseInt(r.toString(),10)].note=s.childNodes[1].ej2_instances[0].value)}return"textMarkup"===i?(e.opacity=t.opacity,e.color=t.color,e.allowedInteractions=t.allowedInteractions,e.annotationSettings=t.annotationSettings):"sticky"===i||"stamp"===i?(t.bounds&&(e.bounds=t.bounds),e.opacity=t.opacity,e.annotationSettings=t.annotationSettings,e.allowedInteractions=t.allowedInteractions,t.stampAnnotationPath&&e.stampAnnotationPath!==t.stampAnnotationPath&&(e.stampAnnotationPath=t.stampAnnotationPath,e.template="")):"ink"===i?(t.bounds&&(e.bounds=t.bounds),e.opacity=t.opacity,e.strokeColor=t.strokeColor,e.thickness=t.thickness,e.annotationSettings=t.annotationSettings,e.allowedInteractions=t.allowedInteractions):"shape"===i||"shape_measure"===i?("Line"===t.subType||"Arrow"===t.subType||"Distance"===t.subType||"Perimeter"===t.subType?(t.bounds&&(e.bounds=t.bounds),t.vertexPoints&&(e.vertexPoints=t.vertexPoints),e.opacity=t.opacity,e.fillColor=t.fillColor,e.strokeColor=t.strokeColor,e.thickness=t.thickness,e.borderDashArray=t.borderDashArray,e.lineHeadStart=this.getArrowTypeForCollection(t.lineHeadStartStyle),e.lineHeadEnd=this.getArrowTypeForCollection(t.lineHeadEndStyle),e.annotationSettings=t.annotationSettings,e.allowedInteractions=t.allowedInteractions):(t.bounds&&(e.bounds=t.bounds),t.vertexPoints&&(e.vertexPoints=t.vertexPoints),e.opacity=t.opacity,e.fillColor=t.fillColor,e.strokeColor=t.strokeColor,e.thickness=t.thickness,e.annotationSettings=t.annotationSettings,e.allowedInteractions=t.allowedInteractions,t.calibrate&&e.annotName===t.annotationId&&e.calibrate.depth!==t.calibrate.depth&&(e.calibrate.depth=t.calibrate.depth,this.pdfViewer.annotationModule.measureAnnotationModule.volumeDepth=t.calibrate.depth,e.note=this.pdfViewer.annotationModule.measureAnnotationModule.calculateVolume(e.vertexPoints))),this.pdfViewer.enableShapeLabel&&t.labelSettings&&(n=t.labelSettings.labelContent,e.note=n,e.fontSize=t.labelSettings.fontSize,e.labelFillColor=t.labelSettings.fillColor,e.labelContent&&(e.labelContent=n),e.labelSettings&&(e.labelSettings=t.labelSettings),this.updateAnnotationComments(e.annotName,n))):"freetext"===i&&(t.bounds&&(e.bounds=t.bounds),e.opacity=t.opacity,e.strokeColor=t.strokeColor,e.thickness=t.thickness,t.content&&(e.dynamicText=t.content),e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontColor=t.fontColor,e.fillColor=t.fillColor,e.font=t.font||t.fontStyle,e.textAlign=t.textAlign,e.annotationSettings=t.annotationSettings,e.allowedInteractions=t.allowedInteractions,e.isReadonly=t.isReadonly),e.author=t.author,e.customData=t.customData,e.subject=t.subject,e.modifiedDate=o?t.modifiedDate:this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),e.isPrint=t.isPrint,t.annotationSettings&&!je(t.annotationSettings.isLock)&&(e.isLocked=t.annotationSettings.isLock),je(t.annotationSelectorSettings)||e.annotationSelectorSettings===t.annotationSelectorSettings||(e.annotationSelectorSettings=t.annotationSelectorSettings),e},JSt.prototype.updateAnnotationAuthor=function(e,t){var i;return"sticky"===e?"Guest"!==(i="Guest"!==this.pdfViewer.stickyNotesSettings.author?this.pdfViewer.stickyNotesSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"stamp"===e?"Guest"!==(i="Guest"!==this.pdfViewer.stampSettings.author?this.pdfViewer.stampSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"shape"===e?"Line"===t?"Guest"!==(i="Guest"!==this.pdfViewer.lineSettings.author?this.pdfViewer.lineSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"LineWidthArrowHead"===t||"Arrow"===t?"Guest"!==(i="Guest"!==this.pdfViewer.arrowSettings.author?this.pdfViewer.arrowSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"Circle"===t||"Ellipse"===t||"Oval"===t?"Guest"!==(i="Guest"!==this.pdfViewer.circleSettings.author?this.pdfViewer.circleSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"Rectangle"===t||"Square"===t?"Guest"!==(i="Guest"!==this.pdfViewer.rectangleSettings.author?this.pdfViewer.rectangleSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"Polygon"===t&&"Guest"!==(i="Guest"!==this.pdfViewer.polygonSettings.author?this.pdfViewer.polygonSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"measure"===e?"Distance"===t||"Distance calculation"===t?"Guest"!==(i="Guest"!==this.pdfViewer.distanceSettings.author?this.pdfViewer.distanceSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"Perimeter"===t||"Perimeter calculation"===t?"Guest"!==(i="Guest"!==this.pdfViewer.perimeterSettings.author?this.pdfViewer.perimeterSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"Radius"===t||"Radius calculation"===t?"Guest"!==(i="Guest"!==this.pdfViewer.radiusSettings.author?this.pdfViewer.radiusSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"Area"===t||"Area calculation"===t?"Guest"!==(i="Guest"!==this.pdfViewer.areaSettings.author?this.pdfViewer.areaSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"Volume"!==t&&"Volume calculation"!==t||"Guest"!==(i="Guest"!==this.pdfViewer.volumeSettings.author?this.pdfViewer.volumeSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"textMarkup"===e?"Highlight"===t?"Guest"!==(i="Guest"!==this.pdfViewer.highlightSettings.author?this.pdfViewer.highlightSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"Underline"===t?"Guest"!==(i="Guest"!==this.pdfViewer.underlineSettings.author?this.pdfViewer.underlineSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"Strikethrough"===t?"Guest"!==(i="Guest"!==this.pdfViewer.strikethroughSettings.author?this.pdfViewer.strikethroughSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):i=this.pdfViewer.annotationSettings.author:"freeText"===e?"Guest"!==(i="Guest"!==this.pdfViewer.freeTextSettings.author?this.pdfViewer.freeTextSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)):"ink"===e&&"Guest"!==(i="Guest"!==this.pdfViewer.inkAnnotationSettings.author?this.pdfViewer.inkAnnotationSettings.author:this.pdfViewer.annotationSettings.author||"Guest")&&this.pdfViewer.enableHtmlSanitizer&&(i=go.sanitize(i)),i=i||this.pdfViewer.annotationSettings.author},JSt.prototype.nameToHash=function(e){var t={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",yellow:"#ffff00",yellowgreen:"#9acd32",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkred:"#8b0000",darksalmon:"#e9967a",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",indigo:"#4b0082",ivory:"#fffff0",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",pink:"#ffc0cb",plum:"#dda0dd",steelblue:"#4682b4",violet:"#ee82ee",powderblue:"#b0e0e6",purple:"#800080",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0"};return void 0!==t[e.toLowerCase()]?t[e.toLowerCase()]:""},JSt.prototype.updateFreeTextFontStyle=function(e){return 1===e.isBold?1:2===e.isItalic?2:4===e.isUnderline?4:8===e.isStrikeout?8:{isBold:e.isBold,isItalic:e.isItalic,isUnderline:e.isUnderline,isStrikeout:e.isStrikeout}},JSt.prototype.setFreeTextFontStyle=function(e){return 1===e?{isBold:!0}:2===e?{isItalic:!0}:4===e?{isUnderline:!0}:8===e?{isStrikeout:!0}:{isBold:e.isBold,isItalic:e.isItalic,isUnderline:e.isUnderline,isStrikeout:e.isStrikeout}},JSt.prototype.findAnnotationSettings=function(e,t){var i=this.pdfViewer.annotationSettings,n=(e&&("StickyNotes"===(n=e.shapeAnnotationType)&&this.pdfViewer.stickyNotesSettings?i=this.pdfViewer.stickyNotesSettings:"Stamp"===n||"Image"===n?(i=this.pdfViewer.stampSettings,"Image"===n&&(i=this.pdfViewer.customStampSettings)):"FreeText"===n?i=this.pdfViewer.freeTextSettings:""===e.measureType?"Line"===n?i=this.pdfViewer.lineSettings:"Arrow"===n||"LineWidthArrowHead"===n?i=this.pdfViewer.arrowSettings:"Rectangle"===n?i=this.pdfViewer.rectangleSettings:"Circle"===n||"Ellipse"===n?i=this.pdfViewer.circleSettings:"Polygon"===n&&this.pdfViewer.polygonSettings&&(i=this.pdfViewer.polygonSettings):""!==e.measureType&&("Distance"===e.measureType?i=this.pdfViewer.distanceSettings:"Perimeter"===e.measureType?i=this.pdfViewer.perimeterSettings:"Area"===e.measureType?i=this.pdfViewer.areaSettings:"Radius"===e.measureType?i=this.pdfViewer.radiusSettings:"Volume"===e.measureType&&(i=this.pdfViewer.volumeSettings))),e?e.annotationSettings:{});return n&&(n.minWidth||n.maxWidth||n.minHeight||n.maxHeight)?this.updateSettings(n):t?this.updateSettings(i):i},JSt.prototype.updateAnnotationSettings=function(e){var t=this.pdfViewer.annotationSettings;return"sticky"===e.AnnotType?t=this.pdfViewer.stickyNotesSettings:"stamp"===e.AnnotType||"image"===e.AnnotType||"Image"===e.AnnotType?(t=this.pdfViewer.stampSettings,"image"!==e.Subject&&"Image"!==e.Subject||(t=this.pdfViewer.customStampSettings)):"freeText"===e.AnnotType?t=this.pdfViewer.freeTextSettings:"ink"===e.AnnotType||"Ink"===e.AnnotationType?t=this.pdfViewer.inkAnnotationSettings:"shape"===e.AnnotType?"Line"===e.Subject?t=this.pdfViewer.lineSettings:"Arrow"===e.Subject||"LineWidthArrowHead"===e.Subject?t=this.pdfViewer.arrowSettings:"Rectangle"===e.Subject||"Square"===e.Subject?t=this.pdfViewer.rectangleSettings:"Circle"===e.Subject||"Ellipse"===e.Subject||"Oval"===e.Subject?t=this.pdfViewer.circleSettings:"Polygon"===e.Subject&&(t=this.pdfViewer.polygonSettings):"shape_measure"===e.AnnotType?"Distance"===e.Subject||"Distance calculation"===e.Subject?t=this.pdfViewer.distanceSettings:"Perimeter"===e.Subject||"Perimeter calculation"===e.Subject?t=this.pdfViewer.perimeterSettings:"Area"===e.Subject||"Area calculation"===e.Subject?t=this.pdfViewer.areaSettings:"Radius"===e.Subject||"Radius calculation"===e.Subject?t=this.pdfViewer.radiusSettings:"Volume"!==e.Subject&&"Volume calculation"!==e.Subject||(t=this.pdfViewer.volumeSettings):"textMarkup"===e.shapeAnnotationType&&("Highlight"===e.subject?t=this.pdfViewer.highlightSettings:"Underline"===e.subject?t=this.pdfViewer.underlineSettings:"Strikethrough"===e.subject&&(t=this.pdfViewer.strikethroughSettings)),this.updateSettings(t)},JSt.prototype.updateSettings=function(e){var t=0,i=0,n=0,o=0,r=this.pdfViewer.annotationSettings;return e.minWidth||e.maxWidth||e.minHeight||e.maxHeight?(t=e.maxHeight||2e3,i=e.maxWidth||2e3,n=e.minHeight||0,o=e.minWidth||0):(r.minWidth||r.maxWidth||r.minHeight||r.maxHeight)&&(t=r.maxHeight||2e3,i=r.maxWidth||2e3,n=r.minHeight||0,o=r.minWidth||0),{minWidth:o,maxWidth:i,minHeight:n,maxHeight:t,isLock:e.isLock||r.isLock||!1,isPrint:e.isPrint}},JSt.prototype.getOverlappedAnnotations=function(e,t){for(var i,n=this.getPageShapeAnnotations(t),o=0;o<n.length;o++)if(e.annotName===n[parseInt(o.toString(),10)].annotName){i=n[parseInt(o.toString(),10)];break}return this.findOverlappedAnnotations(i,n)},JSt.prototype.getPageShapeAnnotations=function(e){var t=[],i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_ink");if(i){i=JSON.parse(i);if(i)if(null!=(d=this.getPageCollection(i,e))&&i[parseInt(d.toString(),10)]){var n=i[parseInt(d.toString(),10)].annotations;if(n&&0<n.length)for(var o=0;o<n.length;o++)t.push(n[parseInt(o.toString(),10)])}}i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_shape");if(i){i=JSON.parse(i);if(i)if(null!=(d=this.getPageCollection(i,e))&&i[parseInt(d.toString(),10)]){var r=i[parseInt(d.toString(),10)].annotations;if(r&&0<r.length)for(o=0;o<r.length;o++)t.push(r[parseInt(o.toString(),10)])}}i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_shape_measure");if(i){i=JSON.parse(i);if(i)if(null!=(d=this.getPageCollection(i,e))&&i[parseInt(d.toString(),10)]){var s=i[parseInt(d.toString(),10)].annotations;if(s&&0<s.length)for(o=0;o<s.length;o++)t.push(s[parseInt(o.toString(),10)])}}i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_stamp");if(i){i=JSON.parse(i);if(i)if(null!=(d=this.getPageCollection(i,e))&&i[parseInt(d.toString(),10)]){var a=i[parseInt(d.toString(),10)].annotations;if(a&&0<a.length)for(o=0;o<a.length;o++)t.push(a[parseInt(o.toString(),10)])}}i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_freetext");if(i){i=JSON.parse(i);if(i)if(null!=(d=this.getPageCollection(i,e))&&i[parseInt(d.toString(),10)]){var l=i[parseInt(d.toString(),10)].annotations;if(l&&0<l.length)for(o=0;o<l.length;o++)t.push(l[parseInt(o.toString(),10)])}}i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_sticky");if(i){i=JSON.parse(i);if(i)if(null!=(d=this.getPageCollection(i,e))&&i[parseInt(d.toString(),10)]){var h=i[parseInt(d.toString(),10)].annotations;if(h&&0<h.length)for(o=0;o<h.length;o++)t.push(h[parseInt(o.toString(),10)])}}i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_textMarkup");if(i){var d,i=JSON.parse(i);if(i)if(null!=(d=this.getPageCollection(i,e))&&i[parseInt(d.toString(),10)]){var p=i[parseInt(d.toString(),10)].annotations;if(p&&0<p.length)for(o=0;o<p.length;o++)t.push(p[parseInt(o.toString(),10)])}}return t},JSt.prototype.findOverlappedAnnotations=function(e,t){if(this.overlappedAnnotations=[],e&&e.bounds)if("textMarkup"===e.shapeAnnotationType)for(var i=0;i<e.bounds.length;i++){var n=this.orderTextMarkupBounds(e.bounds[parseInt(i.toString(),10)]);this.calculateOverlappedAnnotationBounds(e,n,t)}else this.calculateOverlappedAnnotationBounds(e,e.bounds,t);return this.overlappedAnnotations},JSt.prototype.calculateOverlappedAnnotationBounds=function(e,t,i){for(var n=t,o=("Ink"===e.shapeAnnotationType&&(n={left:t.x,top:t.y,height:t.height,width:t.width}),parseInt(n.left,10)),r=parseInt(n.top,10),s=parseInt(n.top+n.height,10),a=parseInt(n.left+n.width,10),l=0;l<i.length;l++)if(e.annotName===i[parseInt(l.toString(),10)].annotName)this.checkOverlappedCollections(i[parseInt(l.toString(),10)],this.overlappedAnnotations);else{var h=1;"textMarkup"===i[parseInt(l.toString(),10)].shapeAnnotationType&&(h=i[parseInt(l.toString(),10)].bounds.length);for(var d=0;d<h;d++){var p=void 0,c=i[parseInt(l.toString(),10)].bounds;"Ink"===i[parseInt(l.toString(),10)].shapeAnnotationType&&(c={left:c.x,top:c.y,height:c.height,width:c.width}),(p="textMarkup"!==i[parseInt(l.toString(),10)].shapeAnnotationType&&1===h?c:this.orderTextMarkupBounds(c[parseInt(d.toString(),10)]))&&(c=!1,c=(c=(c=(c=o<=parseInt(p.left,10)&&a>=parseInt(p.left,10)||o<=parseInt(p.left+p.width,10)&&a>=parseInt(p.left+p.width,10)?!0:c)&&(r<=parseInt(p.top,10)&&s>=parseInt(p.top,10)||r<=parseInt(p.top+p.height,10)&&s>=parseInt(p.top+p.height,10)))||((c=(c=parseInt(p.left,10)<=o&&parseInt(p.left+p.width,10)>=o||a>=parseInt(p.left,10)&&a<=parseInt(p.left+p.width,10)?!0:c)&&(parseInt(p.top,10)<=r&&parseInt(p.top+p.height,10)>=r||s>=parseInt(p.top,10)&&s<=parseInt(p.top+p.height,10)))||(c=o<=parseInt(p.left,10)&&a>=parseInt(p.left,10)||o<=parseInt(p.left+p.width,10)&&a>=parseInt(p.left+p.width,10)?!0:c)&&(parseInt(p.top,10)<=r&&parseInt(p.top+p.height,10)>=r||s>=parseInt(p.top,10)&&s<=parseInt(p.top+p.height,10))))||(c=parseInt(p.left,10)<=o&&parseInt(p.left+p.width,10)>=o||a>=parseInt(p.left,10)&&a<=parseInt(p.left+p.width,10)?!0:c)&&(r<=parseInt(p.top,10)&&s>=parseInt(p.top,10)||r<=parseInt(p.top+p.height,10)&&s>=parseInt(p.top+p.height,10)))&&this.checkOverlappedCollections(i[parseInt(l.toString(),10)],this.overlappedAnnotations)}}},JSt.prototype.findAnnotationMode=function(e,t,i){t=this.pdfViewer.viewerBase.importedAnnotation[parseInt(t.toString(),10)];if(t){var n=void 0;if("shape"===i?n=t.shapeAnnotation:"shape_measure"===i?n=t.measureShapeAnnotation:"freeText"===i?n=t.freeTextAnnotation:"stamp"===i?n=t.stampAnnotations:"sticky"===i?n=t.stickyNotesAnnotation:"textMarkup"===i&&(n=t.textMarkupAnnotation),n)for(var o=0;o<n.length;o++)if(n[parseInt(o.toString(),10)].AnnotName===e.AnnotName)return"Imported Annotation"}return"Existing Annotation"},JSt.prototype.checkOverlappedCollections=function(e,t){if(0<t.length){for(var i=!1,n=0;n<t.length;n++)if(e.annotName===t[parseInt(n.toString(),10)].annotName&&e.bounds===t[parseInt(n.toString(),10)].bounds){i=!0;break}i||t.push(e)}else t.push(e)},JSt.prototype.orderTextMarkupBounds=function(e){return e.Left||e.Width?{left:e.Left,top:e.Top,height:e.Height,width:e.Width}:{left:e.left,top:e.top,height:e.height,width:e.width}},JSt.prototype.updateModifiedDate=function(e){if(e.modifiedDate&&(e.modifiedDate=this.setAnnotationModifiedDate(e.modifiedDate)),e.comments&&0<e.comments.length)for(var t=0;t<e.comments.length;t++)e.comments[parseInt(t.toString(),10)].modifiedDate&&(e.comments[parseInt(t.toString(),10)].modifiedDate=this.setAnnotationModifiedDate(e.comments[parseInt(t.toString(),10)].modifiedDate),e.comments[parseInt(t.toString(),10)].review)&&e.comments[parseInt(t.toString(),10)].review.modifiedDate&&(e.comments[parseInt(t.toString(),10)].review.modifiedDate=this.setAnnotationModifiedDate(e.comments[parseInt(t.toString(),10)].review.modifiedDate));e.review&&e.review.modifiedDate&&(e.review.modifiedDate=this.setAnnotationModifiedDate(e.review.modifiedDate))},JSt.prototype.setAnnotationModifiedDate=function(e){var t,i;return""!==e&&(t=parseInt(e.split(" ")[1].split(":")[0],10),t=3===e.split(" ").length?t+":"+e.split(" ")[1].split(":")[1]+":"+e.split(" ")[1].split(":")[2]+" "+e.split(" ")[2]:12<=t?12===t?t+":"+e.split(" ")[1].split(":")[1]+":"+e.split(" ")[1].split(":")[2]+" PM":t-12+":"+e.split(" ")[1].split(":")[1]+":"+e.split(" ")[1].split(":")[2]+" PM":t+":"+e.split(" ")[1].split(":")[1]+":"+e.split(" ")[1].split(":")[2]+" AM",i=e.split(" ")[0],e=1<e.split(",").length?i+" "+t:i+", "+t,/\u0041\u004D|\u0050\u004D/i.test(e))?new Date(e).toISOString():e},JSt.prototype.clear=function(){this.shapeAnnotationModule&&(this.shapeAnnotationModule.shapeCount=0),this.measureAnnotationModule&&(this.measureAnnotationModule.measureShapeCount=0),this.textMarkupAnnotationModule&&this.textMarkupAnnotationModule.clear(),this.stickyNotesAnnotationModule&&this.stickyNotesAnnotationModule.clear(),this.pdfViewer.refresh(),this.undoCommentsElement=[],this.redoCommentsElement=[],this.overlappedAnnotations=[],this.previousIndex=null,this.pdfViewer.annotation&&this.pdfViewer.annotation.stampAnnotationModule&&(this.pdfViewer.annotation.stampAnnotationModule.stampPageNumber=[]),this.pdfViewer.annotation&&this.pdfViewer.annotation.freeTextAnnotationModule&&(this.pdfViewer.annotation.freeTextAnnotationModule.freeTextPageNumbers=[],this.freeTextAnnotationModule.previousText="Type Here"),this.pdfViewer.annotation&&this.pdfViewer.annotation.inkAnnotationModule&&(this.pdfViewer.annotation.inkAnnotationModule.inkAnnotationindex=[]),ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_shape"),ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_shape_measure"),ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_stamp"),ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_sticky")},JSt.prototype.retrieveAnnotationCollection=function(){return this.pdfViewer.annotationCollection},JSt.prototype.checkAllowedInteractions=function(e,t){var i=this.updateAnnotationAllowedInteractions(t);if(i&&0<i.length)for(var n=0;n<i.length;n++)if("Select"===e){if("Move"===i[parseInt(n.toString(),10)]||"Resize"===i[parseInt(n.toString(),10)]||"Delete"===i[parseInt(n.toString(),10)]||"PropertyChange"===i[parseInt(n.toString(),10)]||"Select"===i[parseInt(n.toString(),10)])return!0}else if(i[parseInt(n.toString(),10)]===e)return!0;return!1},JSt.prototype.checkContextMenuDeleteItem=function(e){var t=this.findCurrentAnnotation();t&&t.annotationSettings&&(!t.annotationSettings.isLock||this.checkAllowedInteractions("Delete",t)?e.enableItems([this.pdfViewer.localeObj.getConstant("Delete Context")],!0):e.enableItems([this.pdfViewer.localeObj.getConstant("Delete Context")],!1))},JSt.prototype.isEnableDelete=function(){var e=this.findCurrentAnnotation();return!(!e||!e.annotationSettings||e.annotationSettings.isLock&&!this.checkAllowedInteractions("Delete",e))},JSt.prototype.findCurrentAnnotation=function(){return this.textMarkupAnnotationModule&&this.textMarkupAnnotationModule.currentTextMarkupAnnotation?this.textMarkupAnnotationModule.currentTextMarkupAnnotation:this.pdfViewer.selectedItems.annotations&&this.pdfViewer.selectedItems.annotations[0]?this.pdfViewer.selectedItems.annotations[0]:null},JSt.prototype.updateAnnotationAllowedInteractions=function(e){var t=["None"];return e&&("FreeText"===e.shapeAnnotationType&&this.pdfViewer.freeTextSettings.allowedInteractions?t=this.checkAllowedInteractionSettings(this.pdfViewer.freeTextSettings.allowedInteractions,e.allowedInteractions):"Ink"===e.shapeAnnotationType&&this.pdfViewer.inkAnnotationSettings.allowedInteractions?t=this.checkAllowedInteractionSettings(this.pdfViewer.inkAnnotationSettings.allowedInteractions,e.allowedInteractions):"StickyNotes"===e.shapeAnnotationType&&this.pdfViewer.stickyNotesSettings.allowedInteractions?t=this.checkAllowedInteractionSettings(this.pdfViewer.stickyNotesSettings.allowedInteractions,e.allowedInteractions):"Stamp"===e.shapeAnnotationType&&this.pdfViewer.stampSettings.allowedInteractions?t=this.checkAllowedInteractionSettings(this.pdfViewer.stampSettings.allowedInteractions,e.allowedInteractions):"Image"===e.shapeAnnotationType&&this.pdfViewer.customStampSettings.allowedInteractions?t=this.checkAllowedInteractionSettings(this.pdfViewer.customStampSettings.allowedInteractions,e.allowedInteractions):"textMarkup"===e.shapeAnnotationType?"Highlight"===e.textMarkupAnnotationType&&this.pdfViewer.highlightSettings.allowedInteractions?t=this.checkAllowedInteractionSettings(this.pdfViewer.highlightSettings.allowedInteractions,e.allowedInteractions):"Underline"===e.textMarkupAnnotationType&&this.pdfViewer.underlineSettings.allowedInteractions?t=this.checkAllowedInteractionSettings(this.pdfViewer.underlineSettings.allowedInteractions,e.allowedInteractions):"Strikethrough"===e.textMarkupAnnotationType&&this.pdfViewer.strikethroughSettings.allowedInteractions&&(t=this.checkAllowedInteractionSettings(this.pdfViewer.strikethroughSettings.allowedInteractions,e.allowedInteractions)):""!==e.measureType?"Distance"===e.measureType&&this.pdfViewer.distanceSettings.allowedInteractions?t=this.checkAllowedInteractionSettings(this.pdfViewer.distanceSettings.allowedInteractions,e.allowedInteractions):"Perimeter"===e.measureType&&this.pdfViewer.perimeterSettings.allowedInteractions?t=this.checkAllowedInteractionSettings(this.pdfViewer.perimeterSettings.allowedInteractions,e.allowedInteractions):"Radius"===e.measureType&&this.pdfViewer.radiusSettings.allowedInteractions?t=this.checkAllowedInteractionSettings(this.pdfViewer.radiusSettings.allowedInteractions,e.allowedInteractions):"Area"===e.measureType&&this.pdfViewer.areaSettings.allowedInteractions?t=this.checkAllowedInteractionSettings(this.pdfViewer.areaSettings.allowedInteractions,e.allowedInteractions):"Volume"===e.measureType&&this.pdfViewer.volumeSettings.allowedInteractions&&(t=this.checkAllowedInteractionSettings(this.pdfViewer.volumeSettings.allowedInteractions,e.allowedInteractions)):"Line"===e.shapeAnnotationType&&this.pdfViewer.lineSettings.allowedInteractions?t=this.checkAllowedInteractionSettings(this.pdfViewer.lineSettings.allowedInteractions,e.allowedInteractions):"Arrow"!==e.shapeAnnotationType&&"LineWidthArrowHead"!==e.shapeAnnotationType||!this.pdfViewer.arrowSettings.allowedInteractions?"Circle"!==e.shapeAnnotationType&&"Ellipse"!==e.shapeAnnotationType&&"Oval"!==e.shapeAnnotationType||!this.pdfViewer.circleSettings.allowedInteractions?"Rectangle"!==e.shapeAnnotationType&&"Square"!==e.shapeAnnotationType||!this.pdfViewer.rectangleSettings.allowedInteractions?"Polygon"===e.shapeAnnotationType&&this.pdfViewer.polygonSettings.allowedInteractions&&(t=this.checkAllowedInteractionSettings(this.pdfViewer.polygonSettings.allowedInteractions,e.allowedInteractions)):t=this.checkAllowedInteractionSettings(this.pdfViewer.rectangleSettings.allowedInteractions,e.allowedInteractions):t=this.checkAllowedInteractionSettings(this.pdfViewer.circleSettings.allowedInteractions,e.allowedInteractions):t=this.checkAllowedInteractionSettings(this.pdfViewer.arrowSettings.allowedInteractions,e.allowedInteractions)),t},JSt.prototype.checkIsLockSettings=function(e){var t=!1;return e&&("FreeText"===e.shapeAnnotationType?t=this.checkLockSettings(this.pdfViewer.freeTextSettings.isLock):"Ink"===e.shapeAnnotationType?t=this.checkLockSettings(this.pdfViewer.inkAnnotationSettings.isLock):"StickyNotes"===e.shapeAnnotationType?t=this.checkLockSettings(this.pdfViewer.stickyNotesSettings.isLock):"Stamp"===e.shapeAnnotationType?t=this.checkLockSettings(this.pdfViewer.stampSettings.isLock):"Image"===e.shapeAnnotationType?t=this.checkLockSettings(this.pdfViewer.customStampSettings.isLock):"textMarkup"===e.shapeAnnotationType?"Highlight"===e.textMarkupAnnotationType?t=this.checkLockSettings(this.pdfViewer.highlightSettings.isLock):"Underline"===e.textMarkupAnnotationType?t=this.checkLockSettings(this.pdfViewer.underlineSettings.isLock):"Strikethrough"===e.textMarkupAnnotationType&&(t=this.checkLockSettings(this.pdfViewer.strikethroughSettings.isLock)):""!==e.measureType?"Distance"===e.measureType?t=this.checkLockSettings(this.pdfViewer.distanceSettings.isLock):"Perimeter"===e.measureType?t=this.checkLockSettings(this.pdfViewer.perimeterSettings.isLock):"Radius"===e.measureType?t=this.checkLockSettings(this.pdfViewer.radiusSettings.isLock):"Area"===e.measureType?t=this.checkLockSettings(this.pdfViewer.areaSettings.isLock):"Volume"===e.measureType&&(t=this.checkLockSettings(this.pdfViewer.volumeSettings.isLock)):"Line"===e.shapeAnnotationType?t=this.checkLockSettings(this.pdfViewer.lineSettings.isLock):"Arrow"===e.shapeAnnotationType||"LineWidthArrowHead"===e.shapeAnnotationType?t=this.checkLockSettings(this.pdfViewer.arrowSettings.isLock):"Circle"===e.shapeAnnotationType||"Ellipse"===e.shapeAnnotationType||"Oval"===e.shapeAnnotationType?t=this.checkLockSettings(this.pdfViewer.circleSettings.isLock):"Rectangle"===e.shapeAnnotationType||"Square"===e.shapeAnnotationType?t=this.checkLockSettings(this.pdfViewer.rectangleSettings.isLock):"Polygon"===e.shapeAnnotationType&&(t=this.checkLockSettings(this.pdfViewer.polygonSettings.isLock))),t},JSt.prototype.checkLockSettings=function(e){var t=!1;return t=e||this.pdfViewer.annotationSettings.isLock?!0:t},JSt.prototype.restrictContextMenu=function(){var e=!1,t=this.findCurrentAnnotation();return e=t&&this.checkIsLockSettings(t)&&this.checkAllowedInteractions("Select",t)?!0:e},JSt.prototype.checkAllowedInteractionSettings=function(e,t){if(t){if(1!==t.length)return t;if("None"!==t[0])return t}if(e){if(1!==e.length)return e;if("None"!==e[0])return e}return this.pdfViewer.annotationSettings.allowedInteractions||["None"]},JSt.prototype.getValue=function(e,t){var i,n;return t=t?t.toLowerCase():"hex","r"===e[0]?(i=this.convertRgbToNumberArray(e),"hex"===t||"hexa"===t?(n=this.rgbToHex(i),"hex"===t?n.slice(0,7):n):"hsv"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"):"h"===e[0]?(i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(e)),"rgba"===t?this.convertToRgbString(i):"hex"===t||"hexa"===t?(n=this.rgbToHex(i),"hex"===t?n.slice(0,7):n):"rgb"===t?this.convertToRgbString(i.slice(0,3)):"null"):(e=this.roundValue(e),n=this.hexToRgb(e),"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")},JSt.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)})},JSt.prototype.convertToRgbString=function(e){return e.length?4===e.length?"rgba("+e.join()+")":"rgb("+e.join()+")":""},JSt.prototype.convertToHsvString=function(e){return 4===e.length?"hsva("+e.join()+")":"hsv("+e.join()+")"},JSt.prototype.roundValue=function(e){if(!e)return"";var t=(e="#"!==e[0]?"#"+e:e).length;if(4===t&&(e+="f",t=5),5===t){for(var i="",n=1,o=e.length;n<o;n++)i+=e.charAt(n)+e.charAt(n);e="#"+i,t=9}return 7===t&&(e+="ff"),e},JSt.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=e.slice(1,7),parseInt(e,16)),i=[];return i.push(e>>16&255),i.push(e>>8&255),i.push(255&e),i.push(t),i},JSt.prototype.rgbToHsv=function(e,t,i,n){e/=255,t/=255,i/=255;var o,r=Math.max(e,t,i),s=Math.min(e,t,i),a=r,l=r-s,h=0===r?0:l/r;if(r===s)o=0;else{switch(r){case e:o=(t-i)/l+(t<i?6:0);break;case t:o=(i-e)/l+2;break;case i:o=(e-t)/l+4}o/=6}s=[Math.round(360*o),Math.round(1e3*h)/10,Math.round(1e3*a)/10];return je(n)||s.push(n),s},JSt.prototype.hsvToRgb=function(e,t,i,n){var o,r,s;if(i/=100,0===(t/=100))return o=r=s=i,[Math.round(255*o),Math.round(255*r),Math.round(255*s),n];e/=60;var a=Math.floor(e),e=e-a,l=i*(1-t),h=i*(1-t*e),d=i*(1-t*(1-e));switch(a){case 0:o=i,r=d,s=l;break;case 1:o=h,r=i,s=l;break;case 2:o=l,r=i,s=d;break;case 3:o=l,r=h,s=i;break;case 4:o=d,r=l,s=i;break;default:o=i,r=l,s=h}t=[Math.round(255*o),Math.round(255*r),Math.round(255*s)];return je(n)||t.push(n),t},JSt.prototype.rgbToHex=function(e){return e.length?"#"+this.hex(e[0])+this.hex(e[1])+this.hex(e[2])+(je(e[3])?"":0!==e[3]?(Math.round(255*e[3])+65536).toString(16).substr(-2):"00"):""},JSt.prototype.exportAnnotationsAsStream=function(i){var n=this;if(this.pdfViewer.annotationModule&&this.pdfViewer.viewerBase.updateExportItem())return new Promise(function(t,e){n.pdfViewer.viewerBase.createRequestForExportAnnotations(!0,i,!0).then(function(e){t(e)})});return null},JSt.prototype.hex=function(e){return je(e)?"0":("0"+e.toString(16)).slice(-2)},JSt.prototype.cloneObject=function(e){return JSON.parse(JSON.stringify(e))},JSt.prototype.destroy=function(){this.destroyPropertiesWindow(),this.textMarkupAnnotationModule&&this.textMarkupAnnotationModule.clear()},JSt.prototype.getModuleName=function(){return"Annotation"},JSt.prototype.getVertexPointsXY=function(e){for(var t=[],i=0;i<e.length;i++)t[parseInt(i.toString(),10)]={X:e[parseInt(i.toString(),10)].x,Y:e[parseInt(i.toString(),10)].y};return t},JSt.prototype.addAnnotation=function(e,t,i,n,o){var r={x:1,y:1},s=0,a=(t&&t.pageNumber&&0<t.pageNumber&&(s=t.pageNumber?t.pageNumber-1:0),null),l=[],a=(this.pdfViewer.annotation.triggerAnnotationUnselectEvent(),"FreeText"===e?(l[parseInt(s.toString(),10)]=this.pdfViewer.annotation.freeTextAnnotationModule.updateAddAnnotationDetails(t,r),this.pdfViewer.annotation.freeTextAnnotationModule.isAddAnnotationProgramatically=!0):"StickyNotes"===e?(l[parseInt(s.toString(),10)]=this.pdfViewer.annotation.stickyNotesAnnotationModule.updateAddAnnotationDetails(t,r),this.pdfViewer.annotation.stickyNotesAnnotationModule.isAddAnnotationProgramatically=!0):"Highlight"===e||"Underline"===e||"Strikethrough"===e?("Highlight"!==e&&"Underline"!==e&&"Strikethrough"!==e||(a=t),l[parseInt(s.toString(),10)]=this.pdfViewer.annotation.textMarkupAnnotationModule.updateAddAnnotationDetails(e,a),this.pdfViewer.annotation.textMarkupAnnotationModule.isAddAnnotationProgramatically=!0):"Line"===e||"Arrow"===e||"Rectangle"===e||"Circle"===e||"Polygon"===e?("Line"!==e&&"Arrow"!==e&&"Rectangle"!==e&&"Circle"!==e&&"Polygon"!==e||(a=t),l[parseInt(s.toString(),10)]=this.pdfViewer.annotation.shapeAnnotationModule.updateAddAnnotationDetails(e,a,r),this.pdfViewer.annotation.shapeAnnotationModule.isAddAnnotationProgramatically=!0):"Distance"===e||"Perimeter"===e||"Area"===e||"Radius"===e||"Volume"===e?("Distance"!==e&&"Perimeter"!==e&&"Area"!==e&&"Radius"!==e&&"Volume"!==e||(a=t),l[parseInt(s.toString(),10)]=this.pdfViewer.annotation.measureAnnotationModule.updateAddAnnotationDetails(e,a,r),this.pdfViewer.annotation.measureAnnotationModule.isAddAnnotationProgramatically=!0):"Stamp"===e?(t&&t.customStamps,l[parseInt(s.toString(),10)]=this.pdfViewer.annotation.stampAnnotationModule.updateAddAnnotationDetails(t,r,s,i,n,o),this.pdfViewer.annotation.stampAnnotationModule.isAddAnnotationProgramatically=!0):"Ink"===e?(l[parseInt(s.toString(),10)]=this.pdfViewer.annotation.inkAnnotationModule.updateAddAnnotationDetails(t,r,s),this.pdfViewer.annotation.inkAnnotationModule.isAddAnnotationProgramatically=!0):"HandWrittenSignature"!==e&&"Initial"!==e||(l[parseInt(s.toString(),10)]=this.pdfViewerBase.signatureModule.updateSignatureDetails(t,r,s),this.pdfViewerBase.signatureModule.isAddAnnotationProgramatically=!0),{pdfAnnotation:l});this.pdfViewerBase.isAddAnnotation=!0,this.pdfViewerBase.importAnnotations(a),this.pdfViewerBase.isAddAnnotation=!1},JSt.prototype.triggerAnnotationAddEvent=function(e){var t,i,n,o=e.shapeAnnotationType;"Stamp"===o||"Image"===o||"Path"===o||"FreeText"===o||"StickyNotes"===o||"Ink"===o?(t=void 0,t="FreeText"===o?{opacity:e.opacity,borderColor:e.strokeColor,borderWidth:e.thickness,author:e.author,subject:e.subject,modifiedDate:e.modifiedDate,fillColor:e.fillColor,fontSize:e.fontSize,width:e.bounds.width,height:e.bounds.height,fontColor:e.fontColor,fontFamily:e.fontFamily,defaultText:e.dynamicText,fontStyle:e.font,textAlignment:e.textAlign}:{opacity:e.opacity,fillColor:e.fillColor,strokeColor:e.strokeColor,thickness:e.thickness,author:e.author,subject:e.subject,modifiedDate:e.modifiedDate,data:e.data},i={left:e.bounds.x,top:e.bounds.y,width:e.bounds.width,height:e.bounds.height},n=this.getAnnotationType(e.shapeAnnotationType,e.measureType),this.pdfViewer.fireAnnotationAdd(e.pageIndex,e.annotName,n,i,t)):"SignatureText"===o||"SignatureImage"===o||"HandWrittenSignature"===o?(i={left:e.bounds.x,top:e.bounds.y,width:e.bounds.width,height:e.bounds.height},this.pdfViewer.fireSignatureAdd(e.pageIndex,e.signatureName,e.shapeAnnotationType,i,e.opacity,e.strokeColor,e.thickness,e.data)):(t={opacity:e.opacity,fillColor:e.fillColor,strokeColor:e.strokeColor,thickness:e.thickness,author:e.author,subject:e.subject,modifiedDate:e.modifiedDate},i={left:e.bounds.x,top:e.bounds.y,width:e.bounds.width,height:e.bounds.height},o=void("Line"!==(n=this.getAnnotationType(e.shapeAnnotationType,e.measureType))&&"Arrow"!==n&&"Distance"!==n&&"Perimeter"!==n||(t.lineHeadStartStyle=this.getArrowString(e.sourceDecoraterShapes),t.lineHeadEndStyle=this.getArrowString(e.taregetDecoraterShapes),t.borderDashArray=e.borderDashArray)),this.pdfViewer.enableShapeLabel?(o={fontColor:e.fontColor,fontSize:e.fontSize,fontFamily:e.fontFamily,opacity:e.labelOpacity,labelContent:e.labelContent,fillColor:e.labelFillColor},this.pdfViewer.fireAnnotationAdd(e.pageIndex,e.annotName,n,i,t,null,null,null,o)):this.pdfViewer.fireAnnotationAdd(e.pageIndex,e.annotName,n,i,t))},JSt.prototype.triggerAnnotationUnselectEvent=function(){var e;this.pdfViewer.selectedItems.annotations&&this.pdfViewer.selectedItems.annotations[0]&&"HandWrittenSignature"!==(e=this.pdfViewer.selectedItems.annotations[0]).shapeAnnotationType&&"SignatureText"!==e.shapeAnnotationType&&"SignatureImage"!==e.shapeAnnotationType&&"Path"!==e.shapeAnnotationType&&(this.pdfViewer.fireAnnotationUnSelect(e.annotName,e.pageIndex,e),this.pdfViewer.clearSelection(e.pageIndex))},JSt.prototype.triggerSignatureUnselectEvent=function(){if(this.pdfViewer.selectedItems.annotations&&this.pdfViewer.selectedItems.annotations[0]){var e=this.pdfViewer.selectedItems;if(e.annotations.length)for(var t=0;t<e.annotations.length;t++){var i=e.annotations[parseInt(t.toString(),10)];this.pdfViewer.annotationModule.unselectSignature(i.signatureName,i.pageIndex,i),this.pdfViewer.clearSelection(i.pageIndex)}}},JSt.prototype.updateFontFamilyRenderSize=function(e,t){var i=this.freeTextAnnotationModule,n=(i.inputBoxElement.style.fontFamily=t,i.autoFitFreeText(),this.pdfViewerBase.getZoomFactor()),o=(parseFloat(i.inputBoxElement.style.paddingLeft),e.bounds.height*n),i=parseFloat(i.inputBoxElement.style.width)-8,n=(i/=n,(o/=n)-e.bounds.height),r=void 0,r=0<n?0<(r=e.wrapper.offsetY+n/2)?r:void 0:(n=Math.abs(n),0<(r=e.wrapper.offsetY-n/2)?r:void 0),n=i-e.bounds.width,s=void 0,s=0<n?0<(s=e.wrapper.offsetX+n/2)?s:void 0:(n=Math.abs(n),e.wrapper.offsetX-n/2);e.bounds.width=i,e.bounds.height=o,this.pdfViewer.nodePropertyChange(e,{fontFamily:t,bounds:{width:e.bounds.width,height:e.bounds.height,y:r,x:s}}),this.pdfViewer.renderSelector(e.pageIndex,this.pdfViewer.annotationSelectorSettings),this.modifyInCollections(e,"bounds")},JSt.prototype.calculateFontSize=function(e,t){for(var i=document.createElement("canvas").getContext("2d"),n=10,o=0;t.width>o;)i.font=n+"px Helvetica",o=i.measureText(e).width,n++;return n};sft=JSt;function JSt(e,t){this.isUndoRedoAction=!1,this.isFreeTextFontsizeChanged=!1,this.isUndoAction=!1,this.annotationSelected=!0,this.isAnnotDeletionApiCall=!1,this.removedDocumentAnnotationCollection=[],this.nonRenderSelectedAnnotation=null,this.isShapeCopied=!1,this.actionCollection=[],this.redoCollection=[],this.isPopupNoteVisible=!1,this.undoCommentsElement=[],this.redoCommentsElement=[],this.selectAnnotationId=null,this.isAnnotationSelected=!1,this.annotationPageIndex=null,this.previousIndex=null,this.annotationType=null,this.overlappedAnnotations=[],this.overlappedCollections=[],this.isFormFieldShape=!1,this.removedAnnotationCollection=[],this.isEdited=!1,this.pdfViewer=e,this.pdfViewerBase=t,this.pdfViewer.enableTextMarkupAnnotation&&(this.textMarkupAnnotationModule=new hAt(this.pdfViewer,this.pdfViewerBase)),this.pdfViewer.enableShapeAnnotation&&(this.shapeAnnotationModule=new uAt(this.pdfViewer,this.pdfViewerBase)),this.pdfViewer.enableMeasureAnnotation&&(this.measureAnnotationModule=new pAt(this.pdfViewer,this.pdfViewerBase)),this.stampAnnotationModule=new mAt(this.pdfViewer,this.pdfViewerBase),this.stickyNotesAnnotationModule=new yAt(this.pdfViewer,this.pdfViewerBase),this.freeTextAnnotationModule=new jCt(this.pdfViewer,this.pdfViewerBase),this.inputElementModule=new QCt(this.pdfViewer,this.pdfViewerBase),this.inkAnnotationModule=new S1t(this.pdfViewer,this.pdfViewerBase)}function ZSt(){}function $St(){}function eAt(){}function tAt(){}function iAt(){}function nAt(){}function oAt(){}function rAt(){}var sAt=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},aAt=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},ist=(lAt.prototype.renderHyperlinkContent=function(e,t){var i,n;this.pdfViewer.enableHyperlink&&(i=e.hyperlinks,n=e.hyperlinkBounds,this.linkAnnotation=e.linkAnnotation,this.linkPage=e.linkPage,this.annotationY=e.annotationLocation,i&&0<i.length&&0<n.length&&this.renderWebLink(i,n,t),this.linkAnnotation)&&0<this.linkAnnotation.length&&0<this.linkPage.length&&this.renderDocumentLink(this.linkAnnotation,this.linkPage,this.annotationY,t)},lAt.prototype.disableHyperlinkNavigationUnderObjects=function(e,t,i){if(0<mCt(i,i.pdfViewer,t).length)t.target.classList.contains("e-pv-hyperlink")&&(e.style.cursor="move",e.style.pointerEvents="none",e.title="");else{var n=document.getElementsByClassName("e-pv-hyperlink");if(n&&0<n.length)for(var o=0;o<n.length;o++)"none"===n[parseInt(o.toString(),10)].style.pointerEvents&&(n[parseInt(o.toString(),10)].style.pointerEvents="all"),n[parseInt(o.toString(),10)].title||(n[parseInt(o.toString(),10)].title=n[parseInt(o.toString(),10)].href)}},lAt.prototype.renderWebLink=function(r,t,i){for(var s=this,a=this,l=!1,h=this,e=0;e<r.length;e++)!function(n){var o=Q("a",{id:"weblinkdiv_"+n+"_"+i}),e=t[parseInt(n.toString(),10)],e=((o=h.setHyperlinkProperties(o,e,i)).title=r[parseInt(n.toString(),10)],r[parseInt(n.toString(),10)]&&1===r[parseInt(n.toString(),10)].split("http").length?(e="http://"+r[parseInt(n.toString(),10)],o.setAttribute("href",e)):o.setAttribute("href",r[parseInt(n.toString(),10)]),"CurrentTab"===h.pdfViewer.hyperlinkOpenState?(o.target="_self",o.onclick=function(i){return sAt(s,void 0,void 0,function(){var t;return aAt(this,function(e){switch(e.label){case 0:return l?[3,4]:(i.preventDefault(),a.pdfViewerBase.tool instanceof hCt||a.pdfViewerBase.tool instanceof sCt?[2,!1]:[3,1]);case 1:return[4,a.pdfViewer.fireHyperlinkClick(r[parseInt(n.toString(),10)],o)];case 2:return(t=e.sent())&&0===this.pdfViewer.selectedItems.annotations.length&&0===this.pdfViewer.selectedItems.formFields.length&&(l=!0,o.click()),[2,t];case 3:return[3,5];case 4:return[2,!(l=!1)];case 5:return[2]}})})},o.onmouseover=function(){a.triggerHyperlinkEvent(o)}):"NewTab"===h.pdfViewer.hyperlinkOpenState?(o.target="_blank",o.onclick=function(i){return sAt(s,void 0,void 0,function(){var t;return aAt(this,function(e){switch(e.label){case 0:return l?[3,4]:(i.preventDefault(),a.pdfViewerBase.tool instanceof hCt||a.pdfViewerBase.tool instanceof sCt?[2,!1]:[3,1]);case 1:return[4,a.pdfViewer.fireHyperlinkClick(r[parseInt(n.toString(),10)],o)];case 2:return(t=e.sent())&&0===this.pdfViewer.selectedItems.annotations.length&&0===this.pdfViewer.selectedItems.formFields.length&&(l=!0,o.click()),[2,t];case 3:return[3,5];case 4:return[2,!(l=!1)];case 5:return[2]}})})},o.onmouseover=function(){a.triggerHyperlinkEvent(o)}):"NewWindow"===h.pdfViewer.hyperlinkOpenState&&(o.onclick=function(t){return sAt(s,void 0,void 0,function(){return aAt(this,function(e){switch(e.label){case 0:return(t.preventDefault(),a.pdfViewerBase.tool instanceof hCt||a.pdfViewerBase.tool instanceof sCt)?[2,!1]:[3,1];case 1:return[4,a.pdfViewer.fireHyperlinkClick(r[parseInt(n.toString(),10)],o)];case 2:return e.sent()&&0===this.pdfViewer.selectedItems.annotations.length&&0===this.pdfViewer.selectedItems.formFields.length&&window.open(o.href,"_blank","scrollbars=yes,resizable=yes"),[2,!1]}})})},o.onmouseover=function(){a.triggerHyperlinkEvent(o)}),document.getElementById(h.pdfViewer.element.id+"_pageDiv_"+i));je(e)||e.appendChild(o)}(e)},lAt.prototype.triggerHyperlinkEvent=function(e){return!(this.pdfViewerBase.tool instanceof hCt||this.pdfViewerBase.tool instanceof sCt||(this.pdfViewer.fireHyperlinkHover(e),0))},lAt.prototype.renderDocumentLink=function(n,l,h,d){for(var p=this,c=this,u=this,e=0;e<n.length;e++)!function(e){var o,r,s,t,a=Q("a",{id:"linkdiv_"+e+"_"+d}),i=n[parseInt(e.toString(),10)],i=((a=u.setHyperlinkProperties(a,i,d)).setAttribute("href","javascript:void(0)"),l[parseInt(e.toString(),10)]);void 0!==i&&0<=i&&(o=u.pdfViewerBase.pageSize[parseInt(d.toString(),10)].height,t=u.pdfViewerBase.pageSize[parseInt(i.toString(),10)],void 0!==(s=t?0!==h.length?(r=h[parseInt(e.toString(),10)],t.top*u.pdfViewerBase.getZoomFactor()+(o-r)*u.pdfViewerBase.getZoomFactor()):t.top*u.pdfViewerBase.getZoomFactor():s)?(a.name=s.toString(),a.setAttribute("aria-label",s.toString())):je(t)&&i>u.pdfViewerBase.pageSize.length&&(a.dataset.annotationY=JSON.stringify(h),a.dataset.pageIndex=JSON.stringify(i),a.dataset.index=JSON.stringify(e)),a.onclick=function(){var e,t,i,n;return c.pdfViewerBase.tool instanceof hCt||c.pdfViewerBase.tool instanceof sCt||(a.name||(a.dataset.pageIndex&&(e=c.pdfViewerBase.pageSize[JSON.parse(a.dataset.pageIndex)],t=JSON.parse(a.dataset.annotationY),i=JSON.parse(a.dataset.index),n=p.pdfViewerBase.getZoomFactor(),s=t&&0<t.length?(r=h[parseInt(i.toString(),10)],e.top*n+(o-r)*n):e.top*n),a.name=s.toString(),a.setAttribute("aria-label",s.toString())),c.pdfViewerBase.viewerContainer.scrollTop=parseInt(a.name,10)),!1},je(t=document.getElementById(u.pdfViewer.element.id+"_pageDiv_"+d))||t.appendChild(a))}(e)},lAt.prototype.setHyperlinkProperties=function(e,t,i){return e.className="e-pv-hyperlink",e.style.background="transparent",e.style.position="absolute",e.style.left=t.Left*this.pdfViewerBase.getZoomFactor()+"px",e.style.top=t.Top*this.pdfViewerBase.getZoomFactor()+"px",e.style.width=t.Width*this.pdfViewerBase.getZoomFactor()+"px",t.Height<0?(e.style.height=-t.Height*this.pdfViewerBase.getZoomFactor()+"px",e.style.top=(t.Top+t.Height)*this.pdfViewerBase.getZoomFactor()+"px"):e.style.height=(t.Height<0?-t.Height:t.Height)*this.pdfViewerBase.getZoomFactor()+"px",e.style.color="transparent",this.pdfViewerBase.applyElementStyles(e,i),e},lAt.prototype.modifyZindexForTextSelection=function(e,t){if(0<this.pdfViewerBase.pageCount){e=this.pdfViewerBase.getElement("_pageDiv_"+e);if(e)for(var i=e.childNodes,n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)];"A"===o.tagName&&(t?o.classList.add("e-pv-onselection"):o.classList.remove("e-pv-onselection"))}}},lAt.prototype.modifyZindexForHyperlink=function(e,t){t?e.classList.add("e-pv-onselection"):e.classList.remove("e-pv-onselection")},lAt.prototype.destroy=function(){for(var e=0;e<this.pdfViewerBase.pageCount-1;e++){var t=document.getElementById(this.pdfViewer.element.id+"_pageDiv_"+e);if(t){var i=t.getElementsByTagName("a");if(0!==i.length)for(var n=i.length-1;0<=n;n--)i[parseInt(n.toString(),10)].parentNode.removeChild(i[parseInt(n.toString(),10)])}}},lAt.prototype.getModuleName=function(){return"LinkAnnotation"},lAt);function lAt(e,t){this.pdfViewer=e,this.pdfViewerBase=t}dAt.prototype.createAnnotationSelectElement=function(){this.dropDivAnnotationLeft=Q("div",{id:this.pdfViewer.element.id+"_droplet_left",className:"e-pv-drop"}),this.dropDivAnnotationLeft.style.borderRight="2px solid",this.dropDivAnnotationRight=Q("div",{id:this.pdfViewer.element.id+"_droplet_right",className:"e-pv-drop"}),this.dropDivAnnotationRight.style.borderLeft="2px solid",this.dropElementLeft=Q("div",{className:"e-pv-droplet",id:this.pdfViewer.element.id+"_dropletspan_left"}),this.dropElementLeft.style.transform="rotate(0deg)",this.dropDivAnnotationLeft.appendChild(this.dropElementLeft),this.dropElementRight=Q("div",{className:"e-pv-droplet",id:this.pdfViewer.element.id+"_dropletspan_right"}),this.dropElementRight.style.transform="rotate(-90deg)",this.dropDivAnnotationRight.appendChild(this.dropElementRight),this.pdfViewerBase.pageContainer.appendChild(this.dropDivAnnotationLeft),this.pdfViewerBase.pageContainer.appendChild(this.dropDivAnnotationRight),this.dropElementLeft.style.top="20px",this.dropElementRight.style.top="20px",this.dropElementRight.style.left="-8px",this.dropElementLeft.style.left="-8px",this.dropDivAnnotationLeft.style.display="none",this.dropDivAnnotationRight.style.display="none",this.dropDivAnnotationLeft.addEventListener("mousedown",this.maintainSelection),this.dropDivAnnotationLeft.addEventListener("mousemove",this.annotationLeftMove),this.dropDivAnnotationLeft.addEventListener("mouseup",this.selectionEnd),this.dropDivAnnotationRight.addEventListener("mousedown",this.maintainSelection),this.dropDivAnnotationRight.addEventListener("mousemove",this.annotationRightMove),this.dropDivAnnotationRight.addEventListener("mouseup",this.selectionEnd)},dAt.prototype.textSelect=function(e,t,i){var n,o,r,s;this.isLeftDropletClicked?(o=this.dropDivAnnotationRight.getBoundingClientRect(),n=this.dropDivAnnotationLeft.getBoundingClientRect(),r=t,s=i,e.classList.contains("e-pv-text")&&(n.top-25>o.top?this.pdfViewer.textSelectionModule.textSelectionOnDrag(e,r,s,!0):this.pdfViewer.textSelectionModule.textSelectionOnDrag(e,r,s,!1),this.updateLeftposition(r,s))):this.isRightDropletClicked&&(o=this.dropDivAnnotationLeft.getBoundingClientRect(),r=t,s=i,e.classList.contains("e-pv-text"))&&(s>=o.top?this.pdfViewer.textSelectionModule.textSelectionOnDrag(e,r,s,!0):this.pdfViewer.textSelectionModule.textSelectionOnDrag(e,r,s,!1),this.updatePosition(r,s))},dAt.prototype.showHideDropletDiv=function(e){var t=this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAddMode;this.isEnableTextMarkupResizer(t)&&this.dropDivAnnotationLeft&&this.dropDivAnnotationRight&&(e?(this.dropDivAnnotationLeft.style.display="none",this.dropDivAnnotationRight.style.display="none"):(this.dropDivAnnotationLeft.style.display="",this.dropDivAnnotationRight.style.display="",this.updateDropletStyles(t)))},dAt.prototype.isEnableTextMarkupResizer=function(e){var t=!1;return e?("Highlight"===e&&this.pdfViewer.highlightSettings.enableTextMarkupResizer||"Underline"===e&&this.pdfViewer.underlineSettings.enableTextMarkupResizer||"Strikethrough"===e&&this.pdfViewer.strikethroughSettings.enableTextMarkupResizer||this.pdfViewer.enableTextMarkupResizer)&&(t=!0):(this.pdfViewer.enableTextMarkupResizer||this.pdfViewer.highlightSettings.enableTextMarkupResizer||this.pdfViewer.underlineSettings.enableTextMarkupResizer||this.pdfViewer.strikethroughSettings.enableTextMarkupResizer)&&(t=!0),t},dAt.prototype.updateDropletStyles=function(e){this.isEnableTextMarkupResizer(e)&&this.dropDivAnnotationLeft&&0<this.dropDivAnnotationLeft.offsetWidth&&(this.dropDivAnnotationLeft.style.width=this.dropletHeight*this.pdfViewerBase.getZoomFactor()+"px",this.dropDivAnnotationRight.style.width=this.dropletHeight*this.pdfViewerBase.getZoomFactor()+"px",this.dropElementLeft.style.width=this.dropletHeight*this.pdfViewerBase.getZoomFactor()+"px",this.dropElementRight.style.width=this.dropletHeight*this.pdfViewerBase.getZoomFactor()+"px",this.dropDivAnnotationLeft.style.height=this.dropletHeight*this.pdfViewerBase.getZoomFactor()+"px",this.dropDivAnnotationRight.style.height=this.dropletHeight*this.pdfViewerBase.getZoomFactor()+"px",this.dropElementLeft.style.height=this.dropletHeight*this.pdfViewerBase.getZoomFactor()+"px",this.dropElementRight.style.height=this.dropletHeight*this.pdfViewerBase.getZoomFactor()+"px",this.dropElementLeft.style.top=this.dropletHeight*this.pdfViewerBase.getZoomFactor()+"px",this.dropElementRight.style.top=this.dropletHeight*this.pdfViewerBase.getZoomFactor()+"px")},dAt.prototype.updateAnnotationBounds=function(){this.isSelectionMaintained=!1;var e=this.currentTextMarkupAnnotation;e&&e.isMultiSelect?(this.showHideDropletDiv(!0),this.updateMultiAnnotBounds(e)):e&&e.bounds&&(this.retreieveSelection(e,null),this.pdfViewer.textSelectionModule.maintainSelection(this.selectTextMarkupCurrentPage,!1),this.isSelectionMaintained=!0,window.getSelection().removeAllRanges())},dAt.prototype.updateMultiAnnotBounds=function(e){if(!e.annotpageNumbers&&(s=this.getAnnotations(e.pageNumber,null)))for(var t=0;t<s.length;t++)if(s[parseInt(t.toString(),10)].annotName===e.annotName){e=s[parseInt(t.toString(),10)];break}for(var i=e.annotpageNumbers[0],n=e.annotpageNumbers[0],o=0;o<e.annotpageNumbers.length;o++){var r=e.annotpageNumbers[parseInt(o.toString(),10)];n<=r&&(n=r),r<=i&&(i=r)}for(var s,a=i;a<=n;a++)if(s=this.getAnnotations(a,null))for(var l=0;l<e.annotNameCollection.length;l++)for(var h,d=e.annotNameCollection[parseInt(l.toString(),10)],t=0;t<s.length;t++)s[parseInt(t.toString(),10)].annotName===d&&(h=s[parseInt(t.toString(),10)],this.retreieveSelection(h,null),this.pdfViewer.textSelectionModule.maintainSelection(h.pageNumber,!1));this.isSelectionMaintained=!0,window.getSelection().removeAllRanges()},dAt.prototype.retreieveSelection=function(e,t){for(var i=0;i<e.bounds.length;i++){var n=e.bounds[parseInt(i.toString(),10)],o=(n.left||n.Left)*this.pdfViewerBase.getZoomFactor(),r=(n.top||n.Top)*this.pdfViewerBase.getZoomFactor(),n=(n.width||n.Width)*this.pdfViewerBase.getZoomFactor(),s=this.pdfViewerBase.getElement("_textLayer_"+e.pageNumber);if(s){for(var a=s.childNodes,l=0;l<a.length;l++)if(a[parseInt(l.toString(),10)]){var h=a[parseInt(l.toString(),10)].getBoundingClientRect(),d=this.getClientValueTop(h.top,e.pageNumber),p=h.left-this.pdfViewerBase.getElement("_pageDiv_"+e.pageNumber).getBoundingClientRect().left,h=p+h.width,c=parseInt(a[parseInt(l.toString(),10)].style.left,10),u=parseInt(a[parseInt(l.toString(),10)].style.top,10),p=this.pdfViewer.textSelectionModule.checkLeftBounds(p,c,h,o),c=this.pdfViewer.textSelectionModule.checkTopBounds(d,u,r);if(p&&c){t=a[parseInt(l.toString(),10)];break}}null!=t&&(s=this.pdfViewerBase.getElement("_textLayer_"+e.pageNumber).getBoundingClientRect(),this.pdfViewer.textSelectionModule.textSelectionOnMouseMove(t,o+s.left,r+s.top,!1),e.bounds.length-1===i)&&this.pdfViewer.textSelectionModule.textSelectionOnMouseMove(t,o+s.left+n,r+s.top,!1)}}},dAt.prototype.updatePosition=function(e,t,i){this.showHideDropletDiv(!1);var n=this.pdfViewerBase.pageSize[this.pdfViewerBase.currentPageNumber-1].top,t=this.getClientValueTop(t,this.pdfViewerBase.currentPageNumber-1),o=document.getElementById(this.pdfViewer.element.id+"_droplet_right");o.style.top=i?t*this.pdfViewerBase.getZoomFactor()+n*this.pdfViewerBase.getZoomFactor()+"px":t+n*this.pdfViewerBase.getZoomFactor()+"px",o.style.left=e+this.pdfViewerBase.viewerContainer.scrollLeft-this.pdfViewerBase.viewerContainer.getBoundingClientRect().left+"px"},dAt.prototype.updateLeftposition=function(e,t,i){this.showHideDropletDiv(!1);var n=this.pdfViewerBase.pageSize[this.pdfViewerBase.currentPageNumber-1].top,t=this.getClientValueTop(t,this.pdfViewerBase.currentPageNumber-1),o=document.getElementById(this.pdfViewer.element.id+"_droplet_left");o.style.display="",o.style.top=i?t*this.pdfViewerBase.getZoomFactor()+n*this.pdfViewerBase.getZoomFactor()+"px":t+n*this.pdfViewerBase.getZoomFactor()+"px",o.style.left=e+this.pdfViewerBase.viewerContainer.scrollLeft-this.pdfViewerBase.viewerContainer.getBoundingClientRect().left-this.dropletHeight*this.pdfViewerBase.getZoomFactor()+"px"},dAt.prototype.getClientValueTop=function(e,t){return this.pdfViewerBase.getElement("_pageDiv_"+t)?e-this.pdfViewerBase.getElement("_pageDiv_"+t).getBoundingClientRect().top:e},dAt.prototype.renderTextMarkupAnnotationsInPage=function(e,t,i,n){var o=e&&"Highlight"===e.textMarkupAnnotationType?"_blendAnnotationsIntoCanvas_":"_annotationCanvas_",o="_blendAnnotationsIntoCanvas_"==o?this.pdfViewerBase.getElement(o+t):this.pdfViewerBase.getAnnotationCanvas(o,t);i?(this.renderTextMarkupAnnotations(null,t,o,this.pdfViewerBase.getZoomFactor()),this.renderTextMarkupAnnotations(e,t,o,this.pdfViewerBase.getZoomFactor(),!0)):this.renderTextMarkupAnnotations(e,t,o,this.pdfViewerBase.getZoomFactor(),null,n)},dAt.prototype.renderTextMarkupAnnotations=function(e,t,i,n,o,r){var s=null;if(i){var a,l=i.getContext("2d");if(l.setTransform(1,0,0,1,0,0),l.setLineDash([]),a=o||r?e:this.getAnnotations(t,e),e&&e.forEach(function(t){a.some(function(e){return e.annotName===t.AnnotName})||a.push(t)}),a){for(var h=[],d=0;d<a.length;d++){for(var p=!1,c=0;c<h.length;c++)if(a[parseInt(d.toString(),10)].AnnotName===h[parseInt(c.toString(),10)].AnnotName&&a[parseInt(d.toString(),10)].annotName===h[parseInt(c.toString(),10)].annotName){p=!0;break}p||h.push(a[parseInt(d.toString(),10)])}a=h}if(a)for(d=0;d<a.length;d++){var u,g=a[parseInt(d.toString(),10)],m=null,f=void 0;if(g.TextMarkupAnnotationType){if(o&&this.pdfViewerBase.isJsonImported){for(var y=[],v=0;v<g.Bounds.length;v++)g.Bounds[parseInt(v.toString(),10)]=this.pdfViewerBase.importJsonForRotatedDocuments(g.Rotate,t,g.Bounds[parseInt(v.toString(),10)],g.AnnotationRotation),g.Bounds[parseInt(v.toString(),10)].left=g.Bounds[parseInt(v.toString(),10)].X,g.Bounds[parseInt(v.toString(),10)].top=g.Bounds[parseInt(v.toString(),10)].Y,y.push(g.Bounds[parseInt(v.toString(),10)]);g.Bounds=y,f=this.pdfViewerBase.isPageRotated}g.annotationAddMode=this.pdfViewer.annotationModule.findAnnotationMode(g,t,g.AnnotType),g.allowedInteractions=g.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(g),g.AnnotationSettings=g.AnnotationSettings||this.pdfViewer.annotationModule.updateAnnotationSettings(g),g.IsLocked&&(g.AnnotationSettings.isLock=g.IsLocked),m={textMarkupAnnotationType:g.TextMarkupAnnotationType,color:g.Color,allowedInteractions:g.allowedInteractions,opacity:g.Opacity,bounds:g.Bounds,author:g.Author,subject:g.Subject,modifiedDate:g.ModifiedDate,note:g.Note,rect:g.Rect,annotName:g.AnnotName,comments:this.pdfViewer.annotationModule.getAnnotationComments(g.Comments,g,g.Author),review:{state:g.State,stateModel:g.StateModel,modifiedDate:g.ModifiedDate,author:g.Author},shapeAnnotationType:"textMarkup",pageNumber:t,textMarkupContent:g.TextMarkupContent,textMarkupStartIndex:0,textMarkupEndIndex:0,annotationSelectorSettings:this.getSettings(g),customData:this.pdfViewer.annotation.getCustomData(g),annotationAddMode:g.annotationAddMode,annotationSettings:g.AnnotationSettings,isLocked:g.IsLocked,isPrint:g.IsPrint,isCommentLock:g.IsCommentLock,isAnnotationRotated:f,annotationRotation:g.AnnotationRotation},g.IsMultiSelect&&(m.annotNameCollection=g.AnnotNameCollection,m.annotpageNumbers=g.AnnotpageNumbers,m.isMultiSelect=g.IsMultiSelect),g.textMarkupContent&&""!==g.textMarkupContent&&(m.textMarkupContent=g.textMarkupContent,m.textMarkupStartIndex=g.textMarkupStartIndex,m.textMarkupEndIndex=g.textMarkupEndIndex),je(g.TextMarkupContent)&&je(g.textMarkupContent)&&(f=g.Bounds,je(u=this.pdfViewerBase.getStoredData(t,!0))?this.pdfViewerBase.requestForTextExtraction(t,m):(u=u.pageText.split(""),b=this.pdfViewerBase.textLayer.characterBound[parseInt(t.toString(),10)],f=this.pdfViewerBase.textMarkUpContent(f,u,b),m.textMarkupContent=f)),this.pdfViewer.annotationModule.storeAnnotations(t,m,"_annotations_textMarkup"),this.isAddAnnotationProgramatically&&(u={opacity:m.opacity,author:g.author,subject:g.subject,modifiedDate:g.modifiedDate,width:m.bounds.width,height:m.bounds.height},this.pdfViewer.fireAnnotationAdd(m.pageNumber,m.annotName,g.TextMarkupAnnotationType,m.bounds,u))}var b=g.TextMarkupAnnotationType||g.textMarkupAnnotationType,w=g.Bounds||g.bounds,C=g.Opacity||g.opacity,S=g.Color||g.color,A=g.AnnotationRotation||g.annotationRotation,x=!0;switch(g.TextMarkupAnnotationType&&(x=g.IsPrint),g.textMarkupAnnotationType&&(x=g.isPrint),"Highlight"===b&&je(s)&&(s=this.getHighlightCanvasContext(this.isPrintCanvas(i),t)),b){case"Highlight":this.renderHighlightAnnotation(w,C,S,s.context,n,x,t);break;case"Strikethrough":this.renderStrikeoutAnnotation(w,C,S,l,n,t,x,A,g.textMarkupContent);break;case"Underline":this.renderUnderlineAnnotation(w,C,S,l,n,t,x,A)}}var I=!1;if(this.currentTextMarkupAnnotation&&this.currentTextMarkupAnnotation.annotpageNumbers)for(var T=0;T<this.currentTextMarkupAnnotation.annotpageNumbers.length;T++)if(t===this.currentTextMarkupAnnotation.annotpageNumbers[parseInt(T.toString(),10)]){this.isAnnotationSelect=!(I=!0);break}t!==this.selectTextMarkupCurrentPage&&!I||(this.isAnnotationSelect?this.isAnnotationSelect=!1:this.maintainAnnotationSelection());r=void 0;return{annotImg:i.toDataURL(),highlightImg:r=s?s.canvas.toDataURL():r}}},dAt.prototype.getHighlightCanvasContext=function(e,t){e?je(o=this.pdfViewerBase.getElement(this.pdfViewer.element.id+"_print_blendAnnotations_canvas_"+t))&&((o=Q("canvas",{id:this.pdfViewer.element.id+"_print_blendAnnotations_canvas_"+t})).style.width="816px",o.style.height="1056px",i=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)].width,r=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)].height,n=void 0,n=e?1:this.pdfViewerBase.getZoomFactor(),e=this.pdfViewerBase.getZoomRatio(n),o.height=r*e,o.width=i*e):je(o=this.pdfViewerBase.getElement("_blendAnnotationsIntoCanvas_"+t))&&(n=document.getElementById(this.pdfViewer.element.id+"_pageDiv_"+t),o=this.pdfViewer.annotationModule.createBlendAnnotationsIntoCanvas(n,parseFloat(n.style.width),parseFloat(n.style.height),t));var i,n,o,r=o.getContext("2d");return r.setTransform(1,0,0,1,0,0),r.setLineDash([]),{context:r,canvas:o}},dAt.prototype.isPrintCanvas=function(e){return!(!e||-1===e.id.indexOf("_print_annotation_layer_"))},dAt.prototype.getSettings=function(e){e=e.AnnotationSelectorSettings?"string"==typeof e.AnnotationSelectorSettings?JSON.parse(e.AnnotationSelectorSettings):e.AnnotationSelectorSettings:this.getSelector(e.TextMarkupAnnotationType);return e},dAt.prototype.drawTextMarkupAnnotations=function(e){var t,i=!1,n=(this.isTextMarkupAnnotationMode=!0,this.pdfViewer.annotationModule.isFormFieldShape=!1,this.currentTextMarkupAddMode=e,!0),o=(this.multiPageCollection=[],this.pdfViewer.textSelectionModule?this.pdfViewer.textSelectionModule.selectionRangeArray:[]),o=(0<o.length&&!this.isSelectionMaintained&&(i=!0,this.convertSelectionToTextMarkup(e,o,this.pdfViewerBase.getZoomFactor())),window.getSelection());if(o&&o.anchorNode&&(t=o.anchorNode.parentElement),this.isEnableTextMarkupResizer(e)&&this.isExtended&&window.getSelection().toString()){if((a=this.getDrawnBounds())[0]&&a[0].bounds)for(var r=this.currentTextMarkupAnnotation,s=0;s<a.length;s++)r&&r.pageNumber===a[parseInt(s.toString(),10)].pageIndex?(this.currentTextMarkupAnnotation=r,this.selectTextMarkupCurrentPage=a[parseInt(s.toString(),10)].pageIndex,this.updateTextMarkupAnnotationBounds(a,s)):(r&&""===e&&(e=r.textMarkupAnnotationType),r.isMultiSelect?r.isMultiSelect&&r.annotNameCollection&&this.modifyCurrentAnnotation(r,a,s):(l=!1,this.isMultiAnnotation(e)&&(this.multiPageCollection.push(r),l=!0),this.drawTextMarkups(e,a[parseInt(s.toString(),10)].bounds,a[parseInt(s.toString(),10)].pageIndex,a[parseInt(s.toString(),10)].rect,this.pdfViewerBase.getZoomFactor(),a[parseInt(s.toString(),10)].textContent,a[parseInt(s.toString(),10)].startIndex,a[parseInt(s.toString(),10)].endIndex,l,t)))}else if(window.getSelection().toString()&&!i){var a=this.getDrawnBounds(),l=this.isMultiPageAnnotations(a,e);if(0<a.length)for(var h=0;h<a.length;h++)""===e&&(n=!1),this.drawTextMarkups(e,a[parseInt(h.toString(),10)].bounds,a[parseInt(h.toString(),10)].pageIndex,a[parseInt(h.toString(),10)].rect,this.pdfViewerBase.getZoomFactor(),a[parseInt(h.toString(),10)].textContent,a[parseInt(h.toString(),10)].startIndex,a[parseInt(h.toString(),10)].endIndex,l,t)}if(this.multiPageCollection)for(var d=0;d<this.multiPageCollection.length;d++)this.updateAnnotationNames(this.multiPageCollection[parseInt(d.toString(),10)],this.multiPageCollection[parseInt(d.toString(),10)].pageNumber);this.isExtended=!1,this.isSelectionMaintained=!1,n&&this.pdfViewer.textSelectionModule&&this.pdfViewer.textSelectionModule.clearTextSelection(),this.isEnableTextMarkupResizer(e)&&this.updateAnnotationBounds()},dAt.prototype.isMultiPageAnnotations=function(e,t){for(var i=!1,n=0;n<e.length;n++)if(e[parseInt(n.toString(),10)].pageIndex!==e[0].pageIndex&&this.isMultiAnnotation(t)){i=!0;break}return i},dAt.prototype.isMultiAnnotation=function(e){var t=!1;return t="Highlight"===e&&this.pdfViewer.highlightSettings.enableMultiPageAnnotation||"Underline"===e&&this.pdfViewer.underlineSettings.enableMultiPageAnnotation||"Strikethrough"===e&&this.pdfViewer.strikethroughSettings.enableMultiPageAnnotation||this.pdfViewer.enableMultiPageAnnotation?!0:t},dAt.prototype.modifyCurrentAnnotation=function(e,t,i){for(var n=0;n<e.annotNameCollection.length;n++){var o=e.annotNameCollection[parseInt(n.toString(),10)],r=this.getAnnotations(t[parseInt(i.toString(),10)].pageIndex,null);if(r)for(var s=0;s<r.length;s++)if(r[parseInt(s.toString(),10)].annotName===o){this.currentTextMarkupAnnotation=r[parseInt(s.toString(),10)],this.selectTextMarkupCurrentPage=t[parseInt(i.toString(),10)].pageIndex,this.updateTextMarkupAnnotationBounds(t,i);break}}},dAt.prototype.drawAnnotationSelector=function(e,t,i){for(var n=[],o=0,r=0;r<e.bounds.length;r++)if(a=e.bounds[parseInt(r.toString(),10)].top?e.bounds[parseInt(r.toString(),10)].top:e.bounds[parseInt(r.toString(),10)].Top,l=je(e.bounds[r+1])?0:e.bounds[r+1].top||e.bounds[r+1].Top,this.pdfViewerBase.clientSideRendering&&(e.bounds[parseInt(r.toString(),10)].left?e.bounds[parseInt(r.toString(),10)].left:e.bounds[parseInt(r.toString(),10)].Left,je(e.bounds[r+1])||(e.bounds[r+1].left||e.bounds[r+1].Left),e.bounds[parseInt(r.toString(),10)].rotation,je(e.bounds[r+1])||e.bounds[r+1].rotation),1<e.bounds.length&&r<e.bounds.length-1&&a===l)n.push(e.bounds[parseInt(r.toString(),10)]);else if((r===e.bounds.length-1||1<=e.bounds.length)&&n.push(e.bounds[parseInt(r.toString(),10)]),1<=n.length){for(var s,a=n[0].left||n[0].Left,l=n[0].top||n[0].Top,h=n[0].height||n[0].Height,d=0;d<n.length;d++)(!isNaN(n[parseInt(d.toString(),10)].width)&&0<n[parseInt(d.toString(),10)].width||!isNaN(n[parseInt(d.toString(),10)].Width)&&0<n[parseInt(d.toString(),10)].Width)&&(o+=n[parseInt(d.toString(),10)].width?n[parseInt(d.toString(),10)].width:n[parseInt(d.toString(),10)].Width);i||(i="_blendAnnotationsIntoCanvas_"==(s="Highlight"===e.textMarkupAnnotationType?"_blendAnnotationsIntoCanvas_":"_annotationCanvas_")?this.pdfViewerBase.getElement(s+e.pageNumber):this.pdfViewerBase.getAnnotationCanvas(s,e.pageNumber)),this.drawAnnotationSelectRect(i,this.getMagnifiedValue(a-.5,this.pdfViewerBase.getZoomFactor()),this.getMagnifiedValue(l-.5,this.pdfViewerBase.getZoomFactor()),this.getMagnifiedValue(o+.5,this.pdfViewerBase.getZoomFactor()),this.getMagnifiedValue(h+.5,this.pdfViewerBase.getZoomFactor()),t),n=[],o=0}},dAt.prototype.selectMultiPageAnnotations=function(e){for(var t=0;t<e.annotNameCollection.length;t++){var i=e.annotNameCollection[parseInt(t.toString(),10)];if(i!==e.annotName)for(var n=0;n<e.annotpageNumbers.length;n++){var o=e.annotpageNumbers[parseInt(n.toString(),10)],r=this.getAnnotations(o,null);if(r)for(var s,a=0;a<r.length;a++)r[parseInt(a.toString(),10)].annotName===i&&(s=r[parseInt(a.toString(),10)],this.drawAnnotationSelector(s,e))}}},dAt.prototype.deletMultiPageAnnotation=function(e){for(var t=0;t<e.annotNameCollection.length;t++){var i=e.annotNameCollection[parseInt(t.toString(),10)];if(i!==e.annotName)for(var n=0;n<e.annotpageNumbers.length;n++){var o=e.annotpageNumbers[parseInt(n.toString(),10)],r=this.getAnnotations(o,null);if(r)for(var s,a,l=0;l<r.length;l++)r[parseInt(l.toString(),10)].annotName===i&&(s=r[parseInt(l.toString(),10)],a=null,a=r.splice(l,1)[0],this.pdfViewer.annotationModule.addAction(o,l,a,"Text Markup Deleted",null),this.currentAnnotationIndex=l,this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(a,"textMarkup"),(a=document.getElementById(a.annotName))&&(1===a.parentElement.childElementCount?this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateAccordionContainer(a):a.remove()),this.pdfViewer.annotationModule.updateAnnotationCollection(s),this.manageAnnotations(r,o),this.pdfViewer.annotationModule.updateImportAnnotationCollection(s,s.pageNumber,"textMarkupAnnotation"),this.pdfViewer.annotationModule.renderAnnotations(o,null,null,null))}}},dAt.prototype.modifyMultiPageAnnotations=function(e,t,i){for(var n=0;n<e.annotNameCollection.length;n++){var o=e.annotNameCollection[parseInt(n.toString(),10)];if(o!==e.annotName)for(var r=0;r<e.annotpageNumbers.length;r++){var s=e.annotpageNumbers[parseInt(r.toString(),10)],a=this.getAnnotations(s,null);if(a)for(var l=0;l<a.length;l++)a[parseInt(l.toString(),10)].annotName===o&&("Color"===t?a[parseInt(l.toString(),10)].color=i:a[parseInt(l.toString(),10)].opacity=i,a[parseInt(l.toString(),10)].modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),this.currentAnnotationIndex=l,null!==status&&"changed"!==status||this.pdfViewer.annotationModule.addAction(a[parseInt(l.toString(),10)].pageNumber,l,a[parseInt(l.toString(),10)],"Text Markup Property modified",t),this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateAnnotationModifiedDate(a[parseInt(l.toString(),10)]),this.manageAnnotations(a,s),this.pdfViewer.annotationModule.renderAnnotations(s,null,null,null))}}},dAt.prototype.convertSelectionToTextMarkup=function(e,t,i){var n=!1;this.triggerAddEvent=!1,this.multiPageCollection=[];for(var o=0;o<t.length;o++){var r,s=t[parseInt(o.toString(),10)].textContent,a=void 0;if(a=t[parseInt(o.toString(),10)].startNode===t[parseInt(o.toString(),10)].endNode?(r=document.getElementById(t[parseInt(o.toString(),10)].startNode).textContent,this.getIndexNumbers(t[parseInt(o.toString(),10)].pageNumber,s,r)):this.getIndexNumbers(t[parseInt(o.toString(),10)].pageNumber,s),!n)for(var l=1;l<t.length;l++)if(t[parseInt(l.toString(),10)].pageNumber!==t[0].pageNumber&&this.isMultiAnnotation(e)){n=!0;break}this.isMultiAnnotation(e)&&t.length-1===o&&(this.triggerAddEvent=!0),this.drawTextMarkups(e,t[parseInt(o.toString(),10)].rectangleBounds,t[parseInt(o.toString(),10)].pageNumber,t[parseInt(o.toString(),10)].bound,i,s,a.startIndex,a.endIndex,n,document.getElementById(t[parseInt(o.toString(),10)].startNode))}},dAt.prototype.updateTextMarkupAnnotationBounds=function(e,t){if(this.currentTextMarkupAnnotation){var i=this.getAnnotations(e[parseInt(t.toString(),10)].pageIndex,null),n=null;if(i){for(var o,r,s=0;s<i.length;s++)JSON.stringify(this.currentTextMarkupAnnotation)===JSON.stringify(i[parseInt(s.toString(),10)])&&(i[parseInt(s.toString(),10)].bounds=e[parseInt(t.toString(),10)].bounds,i[parseInt(s.toString(),10)].textMarkupContent=e[parseInt(t.toString(),10)].textContent,i[parseInt(s.toString(),10)].textMarkupStartIndex=e[parseInt(t.toString(),10)].startIndex,i[parseInt(s.toString(),10)].textMarkupEndIndex=e[parseInt(t.toString(),10)].endIndex,i[parseInt(s.toString(),10)].modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),n=i[parseInt(s.toString(),10)]);this.manageAnnotations(i,e[parseInt(t.toString(),10)].pageIndex),this.currentTextMarkupAnnotation=null,this.pdfViewer.annotationModule.renderAnnotations(e[parseInt(t.toString(),10)].pageIndex,null,null,null),this.pdfViewerBase.updateDocumentEditedProperty(!0),n&&(o={opacity:n.opacity,color:n.color,author:n.author,subject:n.subject,modifiedDate:n.modifiedDate},0<(r=this.multiPageCollectionList(n)).length?e.length-1===t&&this.pdfViewer.fireAnnotationResize(e[parseInt(t.toString(),10)].pageIndex,n.annotName,n.textMarkupAnnotationType,n.bounds,o,n.textMarkupContent,n.textMarkupStartIndex,n.textMarkupEndIndex,null,r):this.pdfViewer.fireAnnotationResize(e[parseInt(t.toString(),10)].pageIndex,n.annotName,n.textMarkupAnnotationType,n.bounds,o,n.textMarkupContent,n.textMarkupStartIndex,n.textMarkupEndIndex,null)),this.currentAnnotationIndex=null,this.selectTextMarkupCurrentPage=null}}},dAt.prototype.multiPageCollectionList=function(e){var t=[];if(e.isMultiSelect&&e.annotNameCollection){t.push(e);for(var i=0;i<e.annotNameCollection.length;i++){var n=e.annotNameCollection[parseInt(i.toString(),10)];if(n!==e.annotName)for(var o=0;o<e.annotpageNumbers.length;o++){var r=e.annotpageNumbers[parseInt(o.toString(),10)],s=this.getAnnotations(r,null);if(s)for(var a=0;a<s.length;a++)s[parseInt(a.toString(),10)].annotName===n&&t.push(s[parseInt(a.toString(),10)])}}}return t},dAt.prototype.updateAnnotationNames=function(e,t){if(e){var i=this.getAnnotations(t,null);if(i){for(var n=0;n<i.length;n++)if(e.annotName===i[parseInt(n.toString(),10)].annotName){for(var o=[],r=[],s=0;s<this.multiPageCollection.length;s++)o.push(this.multiPageCollection[parseInt(s.toString(),10)].annotName),r.push(this.multiPageCollection[parseInt(s.toString(),10)].pageNumber);i[parseInt(n.toString(),10)].isMultiSelect=!0,i[parseInt(n.toString(),10)].annotNameCollection=o,i[parseInt(n.toString(),10)].annotpageNumbers=r,i[parseInt(n.toString(),10)]}this.manageAnnotations(i,t)}}},dAt.prototype.updateAnnotationContent=function(e,t){if(e){var i=this.getAnnotations(this.selectTextMarkupCurrentPage,null);if(i){for(var n=0;n<i.length;n++)JSON.stringify(this.currentTextMarkupAnnotation)===JSON.stringify(i[parseInt(n.toString(),10)])&&(i[parseInt(n.toString(),10)].textMarkupContent=t.textContent,i[parseInt(n.toString(),10)].textMarkupStartIndex=t.startIndex,i[parseInt(n.toString(),10)].textMarkupEndIndex=t.endIndex,i[parseInt(n.toString(),10)]),this.pdfViewer.annotationModule.storeAnnotationCollections(i[parseInt(n.toString(),10)],this.selectTextMarkupCurrentPage);this.manageAnnotations(i,this.selectTextMarkupCurrentPage)}}},dAt.prototype.drawTextMarkups=function(e,t,i,n,o,r,s,a,l,h){var d,p,c=null,u=(this.isNewAnnotation=!1,"Guest"),g="Highlight"===e?this.getPageContext(i,"_blendAnnotationsIntoCanvas_"):this.getPageContext(i,"_annotationCanvas_"),m=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),f=(this.highlightColor=this.highlightColor||this.pdfViewer.highlightSettings.color||"#FFDF56",this.underlineColor=this.underlineColor||this.pdfViewer.underlineSettings.color||"#00ff00",this.strikethroughColor=this.strikethroughColor||this.pdfViewer.strikethroughSettings.color||"#ff0000",this.highlightOpacity=this.highlightOpacity||this.pdfViewer.highlightSettings.opacity,this.underlineOpacity=this.underlineOpacity||this.pdfViewer.underlineSettings.opacity,this.strikethroughOpacity=this.strikethroughOpacity||this.pdfViewer.strikethroughSettings.opacity,this.annotationAddMode="UI Drawn Annotation",this.pdfViewerBase.pageSize[parseInt(i.toString(),10)]),y=0,v=this.pdfViewerBase.getAngle(f.rotation);if(je(g)&&(f=document.getElementById(this.pdfViewer.element.id+"_pageDiv_"+i),g=this.pdfViewer.annotationModule.createBlendAnnotationsIntoCanvas(f,parseFloat(f.style.width),parseFloat(f.style.height),i).getContext("2d")),g){switch(g.setLineDash([]),e){case"Highlight":this.isNewAnnotation=!0,d=""!==this.pdfViewer.highlightSettings.subject&&this.pdfViewer.highlightSettings.subject?this.pdfViewer.highlightSettings.subject:this.pdfViewer.annotationSettings.subject||"Highlight",u="Guest"!==this.pdfViewer.highlightSettings.author&&this.pdfViewer.highlightSettings.author?this.pdfViewer.highlightSettings.author:this.pdfViewer.annotationSettings.author||"Guest",p=this.pdfViewer.highlightSettings.allowedInteractions||["None"],je(this.highlightOpacity)&&(this.highlightOpacity=1),(c=this.getAddedAnnotation(e,this.highlightColor,this.highlightOpacity,t,u,d,m,"",!1,n,i,r,s,a,l,p,y))&&this.renderHighlightAnnotation(c.bounds,c.opacity,c.color,g,o,c.isPrint,i);break;case"Strikethrough":this.isNewAnnotation=!0,d=""!==this.pdfViewer.strikethroughSettings.subject&&this.pdfViewer.strikethroughSettings.subject?this.pdfViewer.strikethroughSettings.subject:this.pdfViewer.annotationSettings.subject||"Strikethrough",u="Guest"!==this.pdfViewer.strikethroughSettings.author&&this.pdfViewer.strikethroughSettings.author?this.pdfViewer.strikethroughSettings.author:this.pdfViewer.annotationSettings.author||"Guest",p=this.pdfViewer.strikethroughSettings.allowedInteractions||["None"],h&&""!==h.style.transform&&(y=h.style.transform.startsWith("rotate(90deg)")?Math.abs(v-90):h.style.transform.startsWith("rotate(180deg)")?Math.abs(v-180):h.style.transform.startsWith("rotate(-90deg)")?Math.abs(v-270):v),je(this.strikethroughOpacity)&&(this.strikethroughOpacity=1),(c=this.getAddedAnnotation(e,this.strikethroughColor,this.strikethroughOpacity,t,u,d,m,"",!1,n,i,r,s,a,l,p,y))&&this.renderStrikeoutAnnotation(c.bounds,c.opacity,c.color,g,o,i,c.isPrint,c.annotationRotation,c.textMarkupContent);break;case"Underline":this.isNewAnnotation=!0,d=""!==this.pdfViewer.underlineSettings.subject&&this.pdfViewer.underlineSettings.subject?this.pdfViewer.underlineSettings.subject:this.pdfViewer.annotationSettings.subject||"Underline",u="Guest"!==this.pdfViewer.underlineSettings.author&&this.pdfViewer.underlineSettings.author?this.pdfViewer.underlineSettings.author:this.pdfViewer.annotationSettings.author||"Guest",p=this.pdfViewer.underlineSettings.allowedInteractions||["None"],h&&""!==h.style.transform&&(y=h.style.transform.startsWith("rotate(90deg)")?Math.abs(v-90):h.style.transform.startsWith("rotate(180deg)")?Math.abs(v-180):h.style.transform.startsWith("rotate(-90deg)")?Math.abs(v-270):v),je(this.underlineOpacity)&&(this.underlineOpacity=1),(c=this.getAddedAnnotation(e,this.underlineColor,this.underlineOpacity,t,u,d,m,"",!1,n,i,r,s,a,l,p,y))&&this.renderUnderlineAnnotation(c.bounds,c.opacity,c.color,g,o,i,c.isPrint,c.annotationRotation)}this.isNewAnnotation=!1,c&&(this.pdfViewerBase.updateDocumentEditedProperty(!0),f={opacity:c.opacity,color:c.color,author:c.author,subject:c.subject,modifiedDate:c.modifiedDate},this.isMultiAnnotation(e)?this.triggerAddEvent&&this.pdfViewer.fireAnnotationAdd(i,c.annotName,e,c.bounds,f,r,s,a,null,this.multiPageCollection):this.pdfViewer.fireAnnotationAdd(i,c.annotName,e,c.bounds,f,r,s,a)),F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.pdfViewer.enableToolbar&&this.pdfViewer.enableAnnotationToolbar&&this.pdfViewer.toolbarModule.annotationToolbarModule.createPropertyTools(e)}},dAt.prototype.retreiveTextIndex=function(e){var t;return""===e.textMarkupContent&&(this.retreieveSelection(e,null),t=this.getDrawnBounds(),window.getSelection().removeAllRanges(),t[0])&&t[0].bounds&&(this.updateAnnotationContent(e,t[0]),e.textMarkupContent=t[0].textContent,e.textMarkupStartIndex=t[0].startIndex,e.textMarkupEndIndex=t[0].endIndex),e},dAt.prototype.renderHighlightAnnotation=function(e,t,i,n,o,r,s){for(var a=this.pdfViewerBase.getZoomRatio(o),l=0;l<e.length;l++){var h=e[parseInt(l.toString(),10)],d=(n.beginPath(),h.X||h.left),p=h.Y||h.top,c=h.Width||h.width,u=h.Height||h.height,g=h.Rotation||h.rotation,d=d||h.x,p=p||h.y;!this.pdfViewerBase.clientSideRendering||0===(g=0<=g?Math.abs(g)/90:g)||2===g?u-=1:1!==g&&3!==g||(c-=1),(n.canvas.id!==this.pdfViewer.element.id+"_print_annotation_layer_"+s&&n.canvas.id!==this.pdfViewer.element.id+"_print_blendAnnotations_canvas_"+s||r)&&(n.rect(d*a,p*a,c*a,u*a),n.globalAlpha=t,n.closePath(),n.fillStyle=i,n.msFillRule="nonzero",n.fill())}n.save()},dAt.prototype.renderStrikeoutAnnotation=function(e,t,i,n,o,r,s,a,l){for(var h=0;h<e.length;h++){var d,p=this.getProperBounds(e[parseInt(h.toString(),10)]),c=this.pdfViewerBase.pageSize[parseInt(r.toString(),10)],u=this.pdfViewerBase.getZoomRatio(o),c=c.rotation;(a||this.pdfViewerBase.clientSideRendering&&e[parseInt(h.toString(),10)].rotation)&&(d=this.pdfViewerBase.getAngle(c),c=this.pdfViewerBase.clientSideRendering?Math.abs(e[parseInt(h.toString(),10)].rotation)/90:Math.abs(a-d)/90),(n.canvas.id!==this.pdfViewer.element.id+"_print_annotation_layer_"+r||s)&&(1===c?this.drawLine(t,p.x+p.width/2,p.y,p.width,p.height,i,u,n,r,this.pdfViewerBase.clientSideRendering?e[parseInt(h.toString(),10)].rotation:a,l):2===c?this.drawLine(t,p.x,p.y+p.height/2,p.width,p.height,i,u,n,r,this.pdfViewerBase.clientSideRendering?e[parseInt(h.toString(),10)].rotation:a,l):3===c?this.drawLine(t,p.x,p.y,p.width/2,p.height,i,u,n,r,this.pdfViewerBase.clientSideRendering?e[parseInt(h.toString(),10)].rotation:a,l):this.drawLine(t,p.x,p.y,p.width,p.height/2,i,u,n,r,this.pdfViewerBase.clientSideRendering?e[parseInt(h.toString(),10)].rotation:a,l))}},dAt.prototype.renderUnderlineAnnotation=function(e,t,i,n,o,r,s,a){for(var l=0;l<e.length;l++){var h=this.getProperBounds(e[parseInt(l.toString(),10)]),d=this.pdfViewerBase.getZoomRatio(o);(n.canvas.id!==this.pdfViewer.element.id+"_print_annotation_layer_"+r||s)&&this.drawLine(t,h.x,h.y,h.width,h.height,i,d,n,r,this.pdfViewerBase.clientSideRendering?e[parseInt(l.toString(),10)].rotation:a)}},dAt.prototype.getProperBounds=function(e){var t=e.X||e.left,i=e.Y||e.top,n=e.Width||e.width,o=e.Height||e.height;return{x:t||e.x,y:i||e.y,width:n,height:o}},dAt.prototype.isChineseLanguage=function(e){return!!/[\u4e00-\u9fff]/.test(e)},dAt.prototype.drawLine=function(e,t,i,n,o,r,s,a,l,h,d){a.globalAlpha=e,N&&(i-=1),this.isChineseLanguage(d)&&(o-=1.5),this.pdfViewerBase.clientSideRendering||this.isChineseLanguage(d)||(o-=1),a.beginPath();e=this.pdfViewerBase.pageSize[parseInt(l.toString(),10)].rotation;(h||this.pdfViewerBase.clientSideRendering&&0<=h)&&(d=this.pdfViewerBase.getAngle(e),e=this.pdfViewerBase.clientSideRendering?Math.abs(h)/90:Math.abs(h-d)/90),this.pdfViewerBase.clientSideRendering&&(0===e||2===e?o-=1:1!==e&&3!==e||(n-=1)),1===e?(a.moveTo(t*s,i*s),a.lineTo(t*s,(i+o)*s)):2===e?(a.moveTo(t*s,i*s),a.lineTo((n+t)*s,i*s)):(3===e?a.moveTo((n+t)*s,i*s):a.moveTo(t*s,(i+o)*s),a.lineTo((n+t)*s,(i+o)*s)),a.lineWidth=1,a.strokeStyle=r,a.closePath(),a.msFillRule="nonzero",a.stroke()},dAt.prototype.printAnnotationsInCanvas=function(e,t,i,n,o,r,s,a){var l=Q("canvas",{id:this.pdfViewer.element.id+"_print_annotation_layer_"+t}),h=(l.style.width="816px",l.style.height="1056px",this.pdfViewerBase.pageSize[parseInt(t.toString(),10)].width),d=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)].height,p=this.pdfViewerBase.getZoomRatio(1),d=(l.height=d*p,l.width=h*p,this.getAnnotations(t,null,"_annotations_shape")),h=this.getAnnotations(t,null,"_annotations_shape_measure"),p=this.getAnnotations(t,null,"_annotations_stamp"),c=this.getAnnotations(t,null,"_annotations_sticky");return this.getAnnotations(t,null,"_annotations_ink")||p||d||c||h?(this.pdfViewer.renderDrawing(l,t),this.pdfViewer.annotation.renderAnnotations(t,null,null,null,l,null,null,s,a)):(this.pdfViewer.annotation.renderAnnotations(t,n,o,null,l,null,null,s,a),this.pdfViewer.annotation.stampAnnotationModule.renderStampAnnotations(i,t,l),this.pdfViewer.annotation.stickyNotesAnnotationModule.renderStickyNotesAnnotations(r,t,l)),this.renderTextMarkupAnnotations(null,t,l,1)},dAt.prototype.saveTextMarkupAnnotations=function(){for(var e=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_textMarkup"),t=(this.pdfViewerBase.isStorageExceed&&(e=this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_textMarkup"]),[]),i=0;i<this.pdfViewerBase.pageCount;i++)t[parseInt(i.toString(),10)]=[];if(e&&!this.pdfViewer.annotationSettings.skipDownload)for(var n=JSON.parse(e),o=0;o<n.length;o++){var r=[],s=n[parseInt(o.toString(),10)];if(s){for(var a=this,l=0;s.annotations.length>l;l++)!function(e){a.pdfViewer.annotationModule.updateModifiedDate(s.annotations[parseInt(e.toString(),10)]),a.pdfViewerBase.isJsonExported&&(s.annotations[parseInt(e.toString(),10)].isAnnotationRotated?s.annotations[parseInt(e.toString(),10)].bounds=a.getBoundsForSave(s.annotations[parseInt(e.toString(),10)].bounds,o):(i=a.pdfViewerBase.pageSize[s.pageIndex])&&(s.annotations[parseInt(e.toString(),10)].annotationRotation=i.rotation)),a.isChineseLanguage(s.annotations[parseInt(e.toString(),10)].textMarkupContent)&&0<s.annotations[parseInt(e.toString(),10)].bounds.length&&(t="Strikethrough"===s.annotations[parseInt(e.toString(),10)].textMarkupAnnotationType?a.strikeoutDifference:"Underline"===s.annotations[parseInt(e.toString(),10)].textMarkupAnnotationType?a.underlineDifference:0,s.annotations[parseInt(e.toString(),10)].bounds.forEach(function(e){e.height=e.height||e.Height,0<e.height&&(e.height+=t)})),s.annotations[parseInt(e.toString(),10)].bounds=JSON.stringify(a.getBoundsForSave(s.annotations[parseInt(e.toString(),10)].bounds,s.annotations[parseInt(e.toString(),10)].pageNumber));var t,i=s.annotations[parseInt(e.toString(),10)].color;s.annotations[parseInt(e.toString(),10)].color=JSON.stringify(a.getRgbCode(i)),s.annotations[parseInt(e.toString(),10)].rect=JSON.stringify(s.annotations[parseInt(e.toString(),10)].rect)}(l);r=s.annotations}t[s.pageIndex]=r}return JSON.stringify(t)},dAt.prototype.deleteTextMarkupAnnotation=function(){if(this.currentTextMarkupAnnotation){var e=!1;if(!(e=this.currentTextMarkupAnnotation.annotationSettings&&(e=this.currentTextMarkupAnnotation.annotationSettings.isLock,this.pdfViewer.annotationModule.checkAllowedInteractions("Delete",this.currentTextMarkupAnnotation))?!1:e)){var t=null,e=(this.showHideDropletDiv(!0),this.currentTextMarkupAnnotation),i=(this.currentTextMarkupAnnotation.isMultiSelect&&e.annotNameCollection&&this.deletMultiPageAnnotation(e),this.getAnnotations(this.selectTextMarkupCurrentPage,null));if(i){for(var n,o=0;o<i.length;o++)this.currentTextMarkupAnnotation.annotName===i[parseInt(o.toString(),10)].annotName&&(t=i.splice(o,1)[0],this.pdfViewer.annotationModule.addAction(this.selectTextMarkupCurrentPage,o,t,"Text Markup Deleted",null),this.currentAnnotationIndex=o,this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(t,"textMarkup"),n=document.getElementById(t.annotName))&&(1===n.parentElement.childElementCount?this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateAccordionContainer(n):n.remove());this.pdfViewer.annotationModule.updateAnnotationCollection(this.currentTextMarkupAnnotation),this.manageAnnotations(i,this.selectTextMarkupCurrentPage),this.pdfViewer.annotationModule.updateImportAnnotationCollection(this.currentTextMarkupAnnotation,this.currentTextMarkupAnnotation.pageNumber,"textMarkupAnnotation");var r=this.currentTextMarkupAnnotation.annotName,s=this.currentTextMarkupAnnotation.bounds,e=(this.currentTextMarkupAnnotation=null,this.pdfViewer.annotationModule.renderAnnotations(this.selectTextMarkupCurrentPage,null,null,null),this.pdfViewerBase.updateDocumentEditedProperty(!0),this.multiPageCollectionList(e));0<e.length?(e.push(t),this.pdfViewer.fireAnnotationRemove(this.selectTextMarkupCurrentPage,r,t.textMarkupAnnotationType,s,t.textMarkupContent,t.textMarkupStartIndex,t.textMarkupEndIndex,e)):je(t)||this.pdfViewer.fireAnnotationRemove(this.selectTextMarkupCurrentPage,r,t.textMarkupAnnotationType,s,t.textMarkupContent,t.textMarkupStartIndex,t.textMarkupEndIndex),this.currentAnnotationIndex=null,this.selectTextMarkupCurrentPage=null,F.isDevice&&!this.pdfViewer.enableDesktopMode&&(this.pdfViewer.toolbarModule.annotationToolbarModule.hideMobileAnnotationToolbar(),this.pdfViewer.toolbarModule.showToolbar(!0))}}}},dAt.prototype.modifyBoundsProperty=function(e){var t;this.currentTextMarkupAnnotation&&(e=this.modifyAnnotationProperty("Bounds",e,null),this.manageAnnotations(e,this.selectTextMarkupCurrentPage),this.pdfViewer.annotationModule.renderAnnotations(this.selectTextMarkupCurrentPage,null,null,null),this.pdfViewerBase.updateDocumentEditedProperty(!0),e=this.currentTextMarkupAnnotation,0<(t=this.multiPageCollectionList(e)).length?this.pdfViewer.fireAnnotationPropertiesChange(this.selectTextMarkupCurrentPage,e.annotName,e.textMarkupAnnotationType,!1,!1,!1,!1,e.textMarkupContent,e.textMarkupStartIndex,e.textMarkupEndIndex,t):this.pdfViewer.fireAnnotationPropertiesChange(this.selectTextMarkupCurrentPage,e.annotName,e.textMarkupAnnotationType,!1,!1,!1,!1,e.textMarkupContent,e.textMarkupStartIndex,e.textMarkupEndIndex),this.currentAnnotationIndex=null)},dAt.prototype.modifyColorProperty=function(e){var t;this.currentTextMarkupAnnotation&&(e=this.modifyAnnotationProperty("Color",e,null),this.manageAnnotations(e,this.selectTextMarkupCurrentPage),this.pdfViewer.annotationModule.renderAnnotations(this.selectTextMarkupCurrentPage,null,null,null),this.pdfViewerBase.updateDocumentEditedProperty(!0),e=this.currentTextMarkupAnnotation,0<(t=this.multiPageCollectionList(e)).length?this.pdfViewer.fireAnnotationPropertiesChange(this.selectTextMarkupCurrentPage,e.annotName,e.textMarkupAnnotationType,!0,!1,!1,!1,e.textMarkupContent,e.textMarkupStartIndex,e.textMarkupEndIndex,t):this.pdfViewer.fireAnnotationPropertiesChange(this.selectTextMarkupCurrentPage,e.annotName,e.textMarkupAnnotationType,!0,!1,!1,!1,e.textMarkupContent,e.textMarkupStartIndex,e.textMarkupEndIndex),this.currentAnnotationIndex=null)},dAt.prototype.modifyOpacityProperty=function(e,t){var i;this.currentTextMarkupAnnotation&&(i=void 0,i=je(t)?this.modifyAnnotationProperty("Opacity",e.value/100,e.name):this.modifyAnnotationProperty("Opacity",t,"changed"))&&(this.manageAnnotations(i,this.selectTextMarkupCurrentPage),this.pdfViewer.annotationModule.renderAnnotations(this.selectTextMarkupCurrentPage,null,null,null),je(t)&&"changed"!==e.name||(this.pdfViewerBase.updateDocumentEditedProperty(!0),i=this.currentTextMarkupAnnotation,0<(t=this.multiPageCollectionList(i)).length?this.pdfViewer.fireAnnotationPropertiesChange(this.selectTextMarkupCurrentPage,i.annotName,i.textMarkupAnnotationType,!1,!0,!1,!1,i.textMarkupContent,i.textMarkupStartIndex,i.textMarkupEndIndex,t):this.pdfViewer.fireAnnotationPropertiesChange(this.selectTextMarkupCurrentPage,i.annotName,i.textMarkupAnnotationType,!1,!0,!1,!1,i.textMarkupContent,i.textMarkupStartIndex,i.textMarkupEndIndex),this.currentAnnotationIndex=null))},dAt.prototype.modifyAnnotationProperty=function(e,t,i,n){var o=this.currentTextMarkupAnnotation,r=(this.pdfViewer.annotationModule.isFormFieldShape=!1,o.isMultiSelect&&o.annotNameCollection&&this.modifyMultiPageAnnotations(o,e,t),this.getAnnotations(this.selectTextMarkupCurrentPage,null));if(r)for(var s=0;s<r.length;s++)JSON.stringify(this.currentTextMarkupAnnotation)===JSON.stringify(r[parseInt(s.toString(),10)])&&("Color"===e?r[parseInt(s.toString(),10)].color=t:"Opacity"===e?r[parseInt(s.toString(),10)].opacity=t:"AnnotationSettings"===e?r[parseInt(s.toString(),10)].annotationSettings={isLock:t}:"Bounds"===e?r[parseInt(s.toString(),10)].bounds=t:"AnnotationSelectorSettings"===e&&(r[parseInt(s.toString(),10)].annotationSelectorSettings=t),r[parseInt(s.toString(),10)].modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),this.currentAnnotationIndex=s,null!==i&&"changed"!==i||this.pdfViewer.annotationModule.addAction(this.selectTextMarkupCurrentPage,s,this.currentTextMarkupAnnotation,"Text Markup Property modified",e),this.currentTextMarkupAnnotation=r[parseInt(s.toString(),10)],this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateAnnotationModifiedDate(r[parseInt(s.toString(),10)]),this.pdfViewer.annotationModule.storeAnnotationCollections(r[parseInt(s.toString(),10)],this.selectTextMarkupCurrentPage));return r},dAt.prototype.undoTextMarkupAction=function(e,t,i,n){var o,r=this.getAnnotations(t,null);r&&("Text Markup Added"===n?(this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(r[parseInt(i.toString(),10)],"textMarkup",null,!0),(o=document.getElementById(r[parseInt(i.toString(),10)].annotName))&&(1===o.parentElement.childElementCount?this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateAccordionContainer(o):o.parentElement.removeChild(o)),r.splice(i,1),this.pdfViewer.annotationCollection.splice(i,1)):"Text Markup Deleted"===n&&(this.pdfViewer.annotationModule.stickyNotesAnnotationModule.addAnnotationComments(t,e.shapeAnnotationType,!0),r.splice(i,0,e))),this.clearCurrentAnnotation(),this.pdfViewerBase.updateDocumentEditedProperty(!0),this.manageAnnotations(r,t),this.pdfViewer.annotationModule.renderAnnotations(t,null,null,null)},dAt.prototype.undoRedoPropertyChange=function(e,t,i,n,o){var r=this.getAnnotations(t,null);return r&&("Color"===n?(n=r[parseInt(i.toString(),10)].color,r[parseInt(i.toString(),10)].color=e.color,e.color=n):(n=r[parseInt(i.toString(),10)].opacity,r[parseInt(i.toString(),10)].opacity=e.opacity,e.opacity=n),this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateAnnotationModifiedDate(e,null,!0),o)&&(e.modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime()),this.clearCurrentAnnotation(),this.pdfViewerBase.updateDocumentEditedProperty(!0),this.manageAnnotations(r,t),this.pdfViewer.annotationModule.renderAnnotations(t,null,null,null),e},dAt.prototype.redoTextMarkupAction=function(e,t,i,n){var o=this.getAnnotations(t,null);o&&("Text Markup Added"===n?(this.pdfViewer.annotationModule.stickyNotesAnnotationModule.addAnnotationComments(t,e.shapeAnnotationType,!1),o.push(e)):"Text Markup Deleted"===n&&(this.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(o[parseInt(i.toString(),10)],"textMarkup"),(e=document.getElementById(o[parseInt(i.toString(),10)].annotName))&&(1===e.parentElement.childElementCount?this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateAccordionContainer(e):e.remove()),o.splice(i,1))),this.clearCurrentAnnotation(),this.pdfViewerBase.updateDocumentEditedProperty(!0),this.manageAnnotations(o,t),this.pdfViewer.annotationModule.renderAnnotations(t,null,null,null)},dAt.prototype.saveNoteContent=function(e,t){var i=this.getAnnotations(e,null);if(i)for(var n=0;n<i.length;n++)JSON.stringify(this.currentTextMarkupAnnotation)===JSON.stringify(i[parseInt(n.toString(),10)])&&(i[parseInt(n.toString(),10)].note=t);this.manageAnnotations(i,e),this.pdfViewerBase.updateDocumentEditedProperty(!0)},dAt.prototype.clearCurrentAnnotation=function(){var e;this.isExtended||(this.pdfViewer.isMaintainSelection&&!this.pdfViewer.textSelectionModule.isTextSelection||(this.selectTextMarkupCurrentPage=null,this.currentTextMarkupAnnotation=null),e=!1,e=!(!this.pdfViewer.annotation.freeTextAnnotationModule||!this.pdfViewer.annotation.freeTextAnnotationModule.isInuptBoxInFocus)||e)||this.enableAnnotationPropertiesTool(!1)},dAt.prototype.clearCurrentAnnotationSelection=function(e,t){this.isAnnotationSelect=!!t;for(var i=e+2<this.pdfViewerBase.pageCount?e+2:this.pdfViewerBase.pageCount-1,n=0<=e-2?e-2:0;n<=i;n++)this.clearAnnotationSelection(n)},dAt.prototype.getBoundsForSave=function(e,t){for(var i=[],n=0;n<e.length;n++){var o=this.getAnnotationBounds(e[parseInt(n.toString(),10)],t);i.push(o)}return i},dAt.prototype.getAnnotationBounds=function(e,t){var i=je(e.left)?e.Left:e.left,n=je(e.top)?e.Top:e.top,o=je(e.height)?e.Height:e.height,r=je(e.width)?e.Width:e.width,t=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)],i=i||e.x,n=n||e.y;return t?1===t.rotation?{left:n,top:t.width-(i+r),width:o,height:r}:2===t.rotation?{left:t.width-i-r,top:t.height-n-o,width:r,height:o}:3===t.rotation?{left:t.height-n-o,top:i,width:o,height:r}:{left:i,top:n,width:r,height:o}:{left:i,top:n,width:r,height:o}},dAt.prototype.getRgbCode=function(e){var t=(e=e.match(/#([a-z0-9]+)/gi)||e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/)?e:this.pdfViewer.annotationModule.nameToHash(e)).split(","),e=(je(t[1])&&(t=(e=this.pdfViewer.annotationModule.getValue(e,"rgba")).split(",")),parseInt(t[0].split("(")[1],10)),i=parseInt(t[1],10),n=parseInt(t[2],10);return{a:parseInt(t[3],10),r:e,g:i,b:n}},dAt.prototype.getDrawnBounds=function(){var e=[],t=window.getSelection();if(null!==t.anchorNode){var i=document.createRange(),n=this.pdfViewerBase.textLayer.isBackWardSelection(t);if(t.anchorNode===t.focusNode){var o=this.pdfViewerBase.textLayer.getPageIndex(t.anchorNode);isNaN(o)||(S=this.pdfViewerBase.getElement("_pageDiv_"+o).getBoundingClientRect(),this.pdfViewerBase.isMixedSizeDocument&&(S=this.pdfViewerBase.getElement("_textLayer_"+o).getBoundingClientRect()),n?(i.setStart(t.focusNode,t.focusOffset),i.setEnd(t.anchorNode,t.anchorOffset)):t.anchorOffset<t.focusOffset?(t.anchorOffset,t.focusOffset,i.setStart(t.anchorNode,t.anchorOffset),i.setEnd(t.focusNode,t.focusOffset)):(t.focusOffset,t.anchorOffset,i.setStart(t.focusNode,t.focusOffset),i.setEnd(t.anchorNode,t.anchorOffset)),D=i.getBoundingClientRect(),M=0,this.pdfViewerBase.clientSideRendering&&(E=this.pdfViewerBase.pageSize[parseInt(o.toString(),10)],this.pdfViewerBase.getAngle(E.rotation),x=void 0,x=i.startContainer.parentElement||i.startContainer.parentNode)&&""!==x.style.transform&&(M=x.style.transform.startsWith("rotate(90deg)")?90:x.style.transform.startsWith("rotate(180deg)")?180:x.style.transform.startsWith("rotate(-90deg)")||x.style.transform.startsWith("rotate(270deg)")?270:0),L=this.getIndexNumbers(o,i.toString(),i.commonAncestorContainer.textContent.toString()),k={left:this.getDefaultValue(D.left-S.left),top:this.getDefaultValue(D.top-S.top),width:this.getDefaultValue(D.width),height:this.getDefaultValue(D.height),right:this.getDefaultValue(D.right-S.left),bottom:this.getDefaultValue(D.bottom-S.top),rotation:M},(r=[]).push(k),R={left:k.left,top:k.top,right:k.right,bottom:k.bottom,rotation:M},e.push({pageIndex:o,bounds:r,rect:R,startIndex:L.startIndex,endIndex:L.endIndex,textContent:i.toString()}))}else for(var o=void 0,r=void 0,s=void 0,a=void 0,a=n?(o=t.focusNode,s=t.focusOffset,r=t.anchorNode,t.anchorOffset):(o=t.anchorNode,s=t.anchorOffset,r=t.focusNode,t.focusOffset),l=this.pdfViewerBase.textLayer.getPageIndex(o),h=this.pdfViewerBase.textLayer.getTextIndex(o,l),d=this.pdfViewerBase.textLayer.getPageIndex(r),p=this.pdfViewerBase.textLayer.getTextIndex(r,d),c=0,u=0,g=0,m=l;m<=d;m++){var f=[],y=void 0,v=void 0,b=void 0,w=void 0,C=this.pdfViewerBase.getElement("_textLayer_"+m).childNodes,S=this.pdfViewerBase.getElement("_pageDiv_"+m).getBoundingClientRect();this.pdfViewerBase.isMixedSizeDocument&&(S=this.pdfViewerBase.getElement("_textLayer_"+m).getBoundingClientRect());for(var A=g=m===l?h:0;A<C.length;A++){var x=C[parseInt(A.toString(),10)];A===g?(y=g,b=m===l?s:0):(v=A,w=m===d?a:x.textContent.length);for(var c=A===h&&m===l?s:0,u=A===p&&m===d?a:x.textContent.length,I=0;I<x.childNodes.length;I++){var T=x.childNodes[parseInt(I.toString(),10)];i.setStart(T,c),i.setEnd(T,u)}var E,D=i.getBoundingClientRect(),M=0,k=(this.pdfViewerBase.clientSideRendering&&(E=this.pdfViewerBase.pageSize[parseInt(m.toString(),10)],this.pdfViewerBase.getAngle(E.rotation),x)&&""!==x.style.transform&&(M=x.style.transform.startsWith("rotate(90deg)")?90:x.style.transform.startsWith("rotate(180deg)")?180:x.style.transform.startsWith("rotate(-90deg)")||x.style.transform.startsWith("rotate(270deg)")?270:0),{left:this.getDefaultValue(D.left-S.left),top:this.getDefaultValue(D.top-S.top),width:this.getDefaultValue(D.width),height:this.getDefaultValue(D.height),right:this.getDefaultValue(D.right-S.left),bottom:this.getDefaultValue(D.bottom-S.top),rotation:M});if(f.push(k),i.detach(),m===d&&A===p)break}var v=v||y,w=w||u,P=this.pdfViewerBase.getElement("_text_"+m+"_"+y).childNodes[0],B=this.pdfViewerBase.getElement("_text_"+m+"_"+v).childNodes[0],F=document.createRange(),P=(F.setStart(P,b),F.setEnd(B,w),F.getBoundingClientRect()),B=F.toString(),L=this.getIndexNumbers(m,B),F={left:this.getDefaultValue(P.left-S.left),top:this.getDefaultValue(P.top-S.top),width:this.getDefaultValue(P.width),height:this.getDefaultValue(P.height),right:this.getDefaultValue(P.right-S.left),bottom:this.getDefaultValue(P.bottom-S.top)},R={left:F.left,top:F.top,right:F.right,bottom:F.bottom};e.push({pageIndex:m,bounds:f,rect:R,startIndex:L.startIndex,endIndex:L.endIndex,textContent:B})}}return t.removeAllRanges(),e},dAt.prototype.getIndexNumbers=function(e,t,i){var n,o=this.pdfViewerBase.clientSideRendering?this.pdfViewerBase.getLinkInformation(e):this.pdfViewerBase.getStoredData(e);if(o){for(var r,s=0,o=o.pageText,a=0;a<e;a++)if(this.pdfViewer.isExtractText){var l=this.pdfViewer.textSearchModule.documentTextCollection[parseInt(a.toString(),10)][parseInt(a.toString(),10)],l=l.pageText||l.PageText;if(this.pdfViewer.textSearchModule&&this.pdfViewer.textSearchModule.documentTextCollection&&this.pdfViewer.textSearchModule.isTextRetrieved)this.pdfViewer.textSearchModule.documentTextCollection[parseInt(a.toString(),10)]&&(s+=l.length);else if(this.pdfViewer.textSearchModule&&this.pdfViewer.textSearchModule.documentTextCollection){if(!(e<=this.pdfViewer.textSearchModule.documentTextCollection.length)){s=0;break}this.pdfViewer.textSearchModule.documentTextCollection[parseInt(a.toString(),10)]&&(s+=l.length)}}n=(r=je(i)?o.indexOf(t)+s:o.indexOf(i)+i.indexOf(t)+s)+(t.length-1)}return{startIndex:r,endIndex:n}},dAt.prototype.rerenderAnnotationsPinch=function(i){var n=this;["_annotationCanvas_","_blendAnnotationsIntoCanvas_"].forEach(function(e){var t,e=n.pdfViewerBase.getElement(e+i);e&&((t=n.pdfViewerBase.getElement("_old_annotationCanvas_"+i))&&(e?(t.id=e.id,e.parentElement.removeChild(e)):t.id=n.pdfViewer.element.id+"_annotationCanvas_"+i,e=t),e.style.width="",e.style.height="",n.pdfViewer.restrictZoomRequest?(e.style.width=n.pdfViewerBase.pageSize[parseInt(i.toString(),10)].width*n.pdfViewerBase.getZoomFactor()+"px",e.style.height=n.pdfViewerBase.pageSize[parseInt(i.toString(),10)].height*n.pdfViewerBase.getZoomFactor()+"px"):(e.width=n.pdfViewerBase.pageSize[parseInt(i.toString(),10)].width*n.pdfViewerBase.getZoomFactor(),e.height=n.pdfViewerBase.pageSize[parseInt(i.toString(),10)].height*n.pdfViewerBase.getZoomFactor()),n.renderTextMarkupAnnotations(null,i,e,n.pdfViewerBase.getZoomFactor()))})},dAt.prototype.rerenderAnnotations=function(e){for(var t=this,i=document.querySelectorAll("#"+this.pdfViewer.element.id+"_old_annotationCanvas_"+e),n=0;n<i.length;n++)i[parseInt(n.toString(),10)]&&i[parseInt(n.toString(),10)].parentElement.removeChild(i[parseInt(n.toString(),10)]);["_annotationCanvas_"+e,"_blendAnnotationsIntoCanvas_"+e].forEach(function(e){e=t.pdfViewerBase.getElement(e);e&&(e.style.display="block")})},dAt.prototype.onTextMarkupAnnotationMouseUp=function(e){var t,i,n,o,r=this.pdfViewer.annotationModule.getEventPageNumber(e);je(r)||isNaN(r)?this.pdfViewerBase.isClickedOnScrollBar(e,!0)||(this.clearCurrentAnnotation(),this.clearCurrentAnnotationSelection(r)):(t=this.pdfViewerBase.getElement("_annotationCanvas_"+r),i=this.pdfViewerBase.getElement("_blendAnnotationsIntoCanvas_"+r),this.currentTextMarkupAnnotation?this.selectedTextMarkup=this.currentTextMarkupAnnotation:this.selectedTextMarkup=null,this.clearCurrentSelectedAnnotation(),n=this.getCurrentMarkupAnnotation(e.clientX,e.clientY,r,t),o=this.getCurrentMarkupAnnotation(e.clientX,e.clientY,r,i),n&&!window.getSelection().toString()?this.onTextMarkupMouseUp(n,e,t,r):o&&!window.getSelection().toString()?this.onTextMarkupMouseUp(o,e,i,r):this.clearCurrentAnnotation(),(!this.pdfViewer.isMaintainSelection||this.pdfViewer.textSelectionModule.isTextSelection||n||o)&&this.clearCurrentAnnotationSelection(r))},dAt.prototype.onTextMarkupMouseUp=function(e,t,i,n){var o,r=!1,s=!1;e.annotationSettings&&e.annotationSettings.isLock&&(r=e.annotationSettings.isLock)&&this.pdfViewer.annotationModule.checkAllowedInteractions("Select",e)&&(r=!1,s=!this.pdfViewer.annotationModule.checkAllowedInteractions("PropertyChange",e)),r||(r=i.parentElement.getBoundingClientRect(),o=t.clientX-r.left,r=t.clientY-r.top,this.annotationClickPosition={x:o,y:r},this.selectAnnotation(e,i,n,t),F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.pdfViewer.enableToolbar&&this.pdfViewer.enableAnnotationToolbar&&this.pdfViewer.toolbarModule.annotationToolbarModule.createPropertyTools(this.currentTextMarkupAnnotation.textMarkupAnnotationType),this.currentTextMarkupAnnotation=e,this.selectTextMarkupCurrentPage=n,s||this.enableAnnotationPropertiesTool(!0),(o=document.getElementById(this.pdfViewer.element.id+"_commantPanel"))&&"block"===o.style.display&&((r=document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+(n+1)))&&r.ej2_instances[0].expandItem(!0),i=document.getElementById(e.annotName))&&i.firstChild.click(),N)||this.pdfViewer.toolbarModule&&this.pdfViewer.enableAnnotationToolbar&&(this.pdfViewer.toolbarModule.annotationToolbarModule.isToolbarHidden=!0,this.pdfViewer.toolbarModule.annotationToolbarModule.showAnnotationToolbar(this.pdfViewer.toolbarModule.annotationItem))},dAt.prototype.onTextMarkupAnnotationTouchEnd=function(e){var t,i,n,o,r=this.pdfViewer.annotationModule.getEventPageNumber(e);je(r)||isNaN(r)?null!=this.selectTextMarkupCurrentPage&&F.isDevice&&!this.pdfViewer.enableDesktopMode?(t=this.selectTextMarkupCurrentPage,this.selectTextMarkupCurrentPage=null,this.clearAnnotationSelection(t)):(this.clearCurrentAnnotation(),this.clearCurrentAnnotationSelection(r)):(this.currentTextMarkupAnnotation?this.selectedTextMarkup=this.currentTextMarkupAnnotation:this.selectedTextMarkup=null,this.clearCurrentAnnotationSelection(r),t=this.pdfViewerBase.getElement("_annotationCanvas_"+r),i=this.pdfViewerBase.getElement("_blendAnnotationsIntoCanvas_"+r),this.clearCurrentSelectedAnnotation(),n=this.getCurrentMarkupAnnotation(e.touches[0].clientX,e.touches[0].clientY,r,t),o=this.getCurrentMarkupAnnotation(e.touches[0].clientX,e.touches[0].clientY,r,i),n?this.onTextMarkupTouchEnd(n,t,e,r):o?this.onTextMarkupTouchEnd(o,i,e,r):this.clearCurrentAnnotation(),this.clearCurrentAnnotationSelection(r))},dAt.prototype.onTextMarkupTouchEnd=function(e,t,i,n){var o,r=!1;!(r=e.annotationSettings&&e.annotationSettings.isLock?e.annotationSettings.isLock:r)&&(r=t.parentElement.getBoundingClientRect(),o=i.touches[0].clientX-r.left,r=i.touches[0].clientY-r.top,this.annotationClickPosition={x:o,y:r},this.selectAnnotation(e,t,n,i),F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.pdfViewer.enableToolbar&&this.pdfViewer.enableAnnotationToolbar&&this.pdfViewer.toolbarModule.annotationToolbarModule.createPropertyTools(this.currentTextMarkupAnnotation.textMarkupAnnotationType),this.currentTextMarkupAnnotation=e,this.selectTextMarkupCurrentPage=n,this.enableAnnotationPropertiesTool(!0),(o=document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+(n+1)))&&o.ej2_instances[0].expandItem(!0),r=document.getElementById(e.annotName))&&!F.isDevice&&r.firstChild.click()},dAt.prototype.clearCurrentSelectedAnnotation=function(){var e;this.currentTextMarkupAnnotation&&(this.clearAnnotationSelection(this.selectTextMarkupCurrentPage),e=this.currentTextMarkupAnnotation,this.pdfViewer.fireAnnotationUnSelect(e.annotName,e.pageNumber,e),this.currentTextMarkupAnnotation=null,this.clearCurrentAnnotation())},dAt.prototype.onTextMarkupAnnotationMouseMove=function(o){var r,s=this,a=o.target;parseInt(a.id.split("_text_")[1],10)||parseInt(a.id.split("_textLayer_")[1],10)||parseInt(a.id.split("_annotationCanvas_")[1],10);o.target&&(-1<a.id.indexOf("_text")||-1<a.id.indexOf("_annotationCanvas")||a.classList.contains("e-pv-hyperlink"))&&this.pdfViewer.annotation&&(r=this.pdfViewer.annotation.getEventPageNumber(o),["_annotationCanvas_","_blendAnnotationsIntoCanvas_"].forEach(function(e){var t,i,n,e=s.pdfViewerBase.getElement(e+r),e=s.getCurrentMarkupAnnotation(o.clientX,o.clientY,r,e);e?(o.target.style.cursor="pointer",i=s.pdfViewerBase.getMousePosition(o),t={left:(t=s.pdfViewerBase.relativePosition(o)).x,top:t.y},i={left:i.x,top:i.y},n={opacity:e.opacity,color:e.color,author:e.author,subject:e.subject,modifiedDate:e.modifiedDate},s.pdfViewerBase.isMousedOver=!0,s.pdfViewer.fireAnnotationMouseover(e.annotName,e.pageNumber,e.textMarkupAnnotationType,e.bounds,n,i,t)):(s.pdfViewer.annotationModule.hidePopupNote(),s.pdfViewerBase.isPanMode&&!s.pdfViewerBase.getAnnotationToolStatus()&&(a.style.cursor="grab"),s.pdfViewerBase.isMousedOver&&!s.pdfViewerBase.isFormFieldMousedOver&&(s.pdfViewer.fireAnnotationMouseLeave(r),s.pdfViewerBase.isMousedOver=!1))}))},dAt.prototype.showPopupNote=function(e,t){t.note&&this.pdfViewer.annotationModule.showPopupNote(e,t.color,t.author,t.note,t.textMarkupAnnotationType)},dAt.prototype.getCurrentMarkupAnnotation=function(e,t,i,n){var o=[];if(n){var r=n.parentElement.getBoundingClientRect(),s=e-(r=n.clientWidth!==n.parentElement.clientWidth?n.getBoundingClientRect():r).left,a=t-r.top,l=this.getAnnotations(i,null),h=!1;if(l)for(var d=0;d<l.length;d++)for(var p=l[parseInt(d.toString(),10)],c=0;c<p.bounds.length;c++){var u=p.bounds[parseInt(c.toString(),10)],g=u.left||u.Left,m=u.top||u.Top,f=u.width||u.Width,u=u.height||u.Height;if(s>=this.getMagnifiedValue(g,this.pdfViewerBase.getZoomFactor())&&s<=this.getMagnifiedValue(g+f,this.pdfViewerBase.getZoomFactor())&&a>=this.getMagnifiedValue(m,this.pdfViewerBase.getZoomFactor())&&a<=this.getMagnifiedValue(m+u,this.pdfViewerBase.getZoomFactor()))o.push(p),h=!0;else if(h){h=!1;break}}e=null;return 1<o.length?e=this.compareCurrentAnnotations(o):1===o.length&&(e=o[0]),e}return null},dAt.prototype.compareCurrentAnnotations=function(e){for(var t,i=null,n=0;n<e.length&&n!==e.length-1;n++){var o=e[parseInt(n.toString(),10)].bounds,r=o[0].left||o[0].Left,o=o[0].top||o[0].Top,s=e[n+1].bounds,a=s[0].left||s[0].Left,s=s[0].top||s[0].Top,i=r<a||o<s?(t=a,e[n+1]):(t=r,e[parseInt(n.toString(),10)]);t&&n===e.length-2&&t===r&&t===a&&(t=a,i=e[n+1])}return i},dAt.prototype.clearAnnotationSelection=function(t){var i=this;["_annotationCanvas_"+t,"_blendAnnotationsIntoCanvas_"+t].forEach(function(e){e=i.pdfViewerBase.getElement(e);e&&(e.getContext("2d").setLineDash([]),i.pdfViewer.annotationModule.renderAnnotations(t,null,null,null))})},dAt.prototype.selectAnnotation=function(e,t,i,n,o){this.pdfViewer.selectedItems.annotations[0]&&(this.pdfViewer.clearSelection(this.pdfViewer.selectedItems.annotations[0].pageIndex),this.pdfViewer.clearSelection(this.selectTextMarkupCurrentPage));var r=!1;(r=e.annotationSettings&&e.annotationSettings.isLock&&(r=e.annotationSettings.isLock)&&this.pdfViewer.annotationModule.checkAllowedInteractions("Select",e)?!1:r)||(r=!1,this.currentTextMarkupAnnotation||(r=!0),this.selectedTextMarkup&&e&&!o&&(r=this.selectedTextMarkup.annotName!==e.annotName),isNaN(i)||(this.selectTextMarkupCurrentPage=i,this.currentTextMarkupAnnotation=e,e=this.retreiveTextIndex(e),this.currentTextMarkupAnnotation=e),this.isSelectedAnnotation&&this.pdfViewer.textSelectionModule&&(this.pdfViewerBase.isSelection=!0,this.updateAnnotationBounds()),o=n,this.isEnableTextMarkupResizer(e.textMarkupAnnotationType)&&e&&o&&!o.touches&&this.updateCurrentResizerPosition(e),this.drawAnnotationSelector(e,this.currentTextMarkupAnnotation,t),e.isMultiSelect&&e.annotNameCollection&&this.selectMultiPageAnnotations(e),""===e.annotName||this.isNewAnnotation||r&&(this.pdfViewer.annotationModule.annotationSelect(e.annotName,this.selectTextMarkupCurrentPage,e,null,!1,!o),this.selectedTextMarkup=null),e&&this.isEnableTextMarkupResizer(e.textMarkupAnnotationType)&&(this.isTextMarkupAnnotationMode=!0))},dAt.prototype.updateCurrentResizerPosition=function(e){var t,i,n;(e=e||this.currentTextMarkupAnnotation)&&this.isEnableTextMarkupResizer(e.textMarkupAnnotationType)&&e&&(t=this.pdfViewerBase.getElement("_textLayer_"+this.selectTextMarkupCurrentPage))&&(t=t.getBoundingClientRect(),n=e.bounds[0].left||e.bounds[0].Left,i=e.bounds[0].top||e.bounds[0].Top,this.updateLeftposition(n*this.pdfViewerBase.getZoomFactor()+t.left,t.top+i,!0),i=(n=e.bounds[e.bounds.length-1]).left||n.Left,e=n.top||n.Top,n=n.width||n.Width,this.updatePosition((i+n)*this.pdfViewerBase.getZoomFactor()+t.left,e+t.top,!0))},dAt.prototype.drawAnnotationSelectRect=function(e,t,i,n,o,r){var s,a,l=this.pdfViewerBase.getZoomRatio();e&&((e=e.getContext("2d")).setTransform(1,0,0,1,0,0),e.beginPath(),"string"==typeof r.annotationSelectorSettings?(2<(s=0===JSON.parse(r.annotationSelectorSettings).selectorLineDashArray.length?[4]:JSON.parse(r.annotationSelectorSettings).selectorLineDashArray).length&&(s=[s[0],s[1]]),e.setLineDash(s),e.globalAlpha=1,e.rect(t*l,i*l,n*l,o*l),e.closePath(),a=""===JSON.parse(r.annotationSelectorSettings).selectionBorderColor?"#0000ff":JSON.parse(r.annotationSelectorSettings).selectionBorderColor,e.strokeStyle=a,e.lineWidth=1===JSON.parse(r.annotationSelectorSettings).selectionBorderThickness?1:r.annotationSelectorSettings.selectionBorderThickness):(2<(s=0===r.annotationSelectorSettings.selectorLineDashArray.length?[4]:r.annotationSelectorSettings.selectorLineDashArray).length&&(s=[s[0],s[1]]),e.setLineDash(s),e.globalAlpha=1,e.rect(t*l,i*l,n*l,o*l),e.closePath(),a=""===r.annotationSelectorSettings.selectionBorderColor?"#0000ff":r.annotationSelectorSettings.selectionBorderColor,e.strokeStyle=a,e.lineWidth=r.annotationSelectorSettings.selectionBorderThickness&&1),e.stroke(),e.save())},dAt.prototype.enableAnnotationPropertiesTool=function(e){this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule&&(this.pdfViewer.toolbarModule.annotationToolbarModule.colorDropDownElementInBlazor=this.pdfViewer.element.querySelector(".e-pv-annotation-color-container")),this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule&&(F.isDevice||this.pdfViewer.toolbarModule.annotationToolbarModule.createMobileAnnotationToolbar(e)),this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule.isMobileAnnotEnabled&&0===this.pdfViewer.selectedItems.annotations.length&&this.pdfViewer.toolbarModule.annotationToolbarModule&&(this.pdfViewer.toolbarModule.annotationToolbarModule.selectAnnotationDeleteItem(e),e=e,this.isTextMarkupAnnotationMode&&(e=!0),this.pdfViewer.toolbarModule.annotationToolbarModule.enableTextMarkupAnnotationPropertiesTools(e),this.currentTextMarkupAnnotation?N?this.pdfViewer.toolbarModule.annotationToolbarModule.updateColorInIcon(this.pdfViewer.toolbarModule.annotationToolbarModule.colorDropDownElementInBlazor,this.currentTextMarkupAnnotation.color):this.pdfViewer.toolbarModule.annotationToolbarModule.updateColorInIcon(this.pdfViewer.toolbarModule.annotationToolbarModule.colorDropDownElement,this.currentTextMarkupAnnotation.color):je(this.isTextMarkupAnnotationMode)||this.isTextMarkupAnnotationMode?this.pdfViewer.toolbarModule.annotationToolbarModule.setCurrentColorInPicker():N?this.pdfViewer.toolbarModule.annotationToolbarModule.updateColorInIcon(this.pdfViewer.toolbarModule.annotationToolbarModule.colorDropDownElementInBlazor,"#000000"):this.pdfViewer.toolbarModule.annotationToolbarModule.updateColorInIcon(this.pdfViewer.toolbarModule.annotationToolbarModule.colorDropDownElement,"#000000"))},dAt.prototype.maintainAnnotationSelection=function(){var e;this.currentTextMarkupAnnotation&&(e="_blendAnnotationsIntoCanvas_"==(e="Highlight"===this.currentTextMarkupAnnotation.textMarkupAnnotationType?"_blendAnnotationsIntoCanvas_":"_annotationCanvas_")?this.pdfViewerBase.getElement(e+this.selectTextMarkupCurrentPage):this.pdfViewerBase.getAnnotationCanvas(e,this.selectTextMarkupCurrentPage))&&this.selectAnnotation(this.currentTextMarkupAnnotation,e,this.selectTextMarkupCurrentPage)},dAt.prototype.manageAnnotations=function(e,t){var i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_textMarkup");(i=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_textMarkup"]:i)&&(i=JSON.parse(i),this.pdfViewerBase.isStorageExceed||ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_textMarkup"),null!=(t=this.pdfViewer.annotationModule.getPageCollection(i,t))&&i[parseInt(t.toString(),10)]&&(i[parseInt(t.toString(),10)].annotations=e),t=JSON.stringify(i),this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_textMarkup"]=t:ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_textMarkup",t))},dAt.prototype.getAnnotations=function(e,t,i){var n=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+(i=null!=i&&void 0!==i?i:"_annotations_textMarkup"));return(n=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+i]:n)&&(i=JSON.parse(n),null!=(n=this.pdfViewer.annotationModule.getPageCollection(i,e)))&&i[parseInt(n.toString(),10)]?i[parseInt(n.toString(),10)].annotations:t},dAt.prototype.getAddedAnnotation=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u,g,m,f){var s=s||this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),y=this.pdfViewer.annotation.createGUID(),v=this.pdfViewer.annotation.stickyNotesAnnotationModule.addComments("textMarkup",d+1,e),v=(v&&(document.getElementById(v).id=y),this.pdfViewer.annotationSettings),b=this.getIsPrintValue(e),t={textMarkupAnnotationType:e,color:t,opacity:i,bounds:n,author:o,allowedInteractions:m,subject:r,modifiedDate:s,note:a,rect:h,annotName:y,comments:[],review:{state:"",stateModel:"",author:o,modifiedDate:s},shapeAnnotationType:"textMarkup",pageNumber:d,textMarkupContent:p,textMarkupStartIndex:c,textMarkupEndIndex:u,isMultiSelect:g,annotationSelectorSettings:this.getSelector(e),customData:this.pdfViewer.annotation.getTextMarkupData(r),annotationAddMode:this.annotationAddMode,annotationSettings:v,isPrint:b,isCommentLock:l,isAnnotationRotated:!1,annotationRotation:f,isLocked:!1},i=(t.annotationSettings=this.pdfViewer.annotationModule.updateAnnotationSettings(t),g&&this.multiPageCollection.push(t),!1),n=(g&&this.isExtended&&(i=!0),document.getElementById(y)&&!i&&document.getElementById(y).addEventListener("mouseup",this.annotationDivSelect(t,d)),this.pdfViewer.annotationModule.storeAnnotations(d,t,"_annotations_textMarkup"));return this.pdfViewer.annotationModule.addAction(d,n,t,"Text Markup Added",null),t},dAt.prototype.getSelector=function(e){var t=this.pdfViewer.annotationSelectorSettings;return"Highlight"===e&&this.pdfViewer.highlightSettings.annotationSelectorSettings?t=this.pdfViewer.highlightSettings.annotationSelectorSettings:"Underline"===e&&this.pdfViewer.underlineSettings.annotationSelectorSettings?t=this.pdfViewer.underlineSettings.annotationSelectorSettings:"Strikethrough"===e&&this.pdfViewer.strikethroughSettings.annotationSelectorSettings&&(t=this.pdfViewer.strikethroughSettings.annotationSelectorSettings),t},dAt.prototype.getIsPrintValue=function(e){var t=!0;return"Highlight"===e&&(t=this.pdfViewer.highlightSettings.isPrint),"Underline"===e&&(t=this.pdfViewer.underlineSettings.isPrint),t=je(t="Strikethrough"===e?this.pdfViewer.strikethroughSettings.isPrint:t)?!0:t},dAt.prototype.annotationDivSelect=function(e,t){var i="Highlight"===e.textMarkupAnnotationType?"_blendAnnotationsIntoCanvas_":"_annotationCanvas_",i="_blendAnnotationsIntoCanvas_"==i?this.pdfViewerBase.getElement(i+t):this.pdfViewerBase.getAnnotationCanvas(i,t);this.selectAnnotation(e,i,t),this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule&&this.pdfViewer.enableAnnotationToolbar&&(this.pdfViewer.toolbarModule.annotationToolbarModule.clearShapeMode(),this.pdfViewer.toolbarModule.annotationToolbarModule.clearMeasureMode(),i=!1,(i=e.annotationSettings&&e.annotationSettings.isLock?e.annotationSettings.isLock:i)?(this.pdfViewer.annotationModule.checkAllowedInteractions("PropertyChange",e)&&(this.pdfViewer.toolbarModule.annotationToolbarModule.enableTextMarkupAnnotationPropertiesTools(!0),this.pdfViewer.toolbarModule.annotationToolbarModule.setCurrentColorInPicker()),this.pdfViewer.annotationModule.checkAllowedInteractions("Delete",e)&&this.pdfViewer.toolbarModule.annotationToolbarModule.selectAnnotationDeleteItem(!0)):(this.pdfViewer.toolbarModule.annotationToolbarModule.enableTextMarkupAnnotationPropertiesTools(!0),this.pdfViewer.toolbarModule.annotationToolbarModule.selectAnnotationDeleteItem(!0),this.pdfViewer.toolbarModule.annotationToolbarModule.setCurrentColorInPicker()),this.pdfViewer.toolbarModule.annotationToolbarModule.isToolbarHidden=!0,N||this.pdfViewer.toolbarModule.annotationToolbarModule.showAnnotationToolbar(this.pdfViewer.toolbarModule.annotationItem))},dAt.prototype.getPageContext=function(e,t){t="_annotationCanvas_"===t?this.pdfViewerBase.getAnnotationCanvas(t,e):this.pdfViewerBase.getElement(t+e),e=null;return e=t?t.getContext("2d"):e},dAt.prototype.getDefaultValue=function(e){return e/this.pdfViewerBase.getZoomFactor()},dAt.prototype.getMagnifiedValue=function(e,t){return e*t},dAt.prototype.saveImportedTextMarkupAnnotations=function(e,t){e.Author=this.pdfViewer.annotationModule.updateAnnotationAuthor("textMarkup",e.Subject),e.allowedInteractions=this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e),e.AnnotationSettings=e.AnnotationSettings||this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.customStampSettings),e={textMarkupAnnotationType:e.TextMarkupAnnotationType,color:e.Color,opacity:e.Opacity,allowedInteractions:e.allowedInteractions,bounds:e.Bounds,author:e.Author,subject:e.Subject,modifiedDate:e.ModifiedDate,note:e.Note,rect:e.Rect,annotName:e.AnnotName,isLocked:e.IsLocked,comments:this.pdfViewer.annotationModule.getAnnotationComments(e.Comments,e,e.Author),review:{state:e.State,stateModel:e.StateModel,modifiedDate:e.ModifiedDate,author:e.Author},shapeAnnotationType:"textMarkup",pageNumber:t,textMarkupContent:"",textMarkupStartIndex:0,textMarkupEndIndex:0,annotationSelectorSettings:this.getSettings(e),customData:this.pdfViewer.annotation.getCustomData(e),isMultiSelect:e.IsMultiSelect,annotNameCollection:e.AnnotNameCollection,annotpageNumbers:e.AnnotpageNumbers,annotationAddMode:this.annotationAddMode,annotationSettings:e.AnnotationSettings,isPrint:e.IsPrint,isCommentLock:e.IsCommentLock,isAnnotationRotated:!1},this.pdfViewer.annotationModule.storeAnnotations(t,e,"_annotations_textMarkup")},dAt.prototype.updateTextMarkupAnnotationCollections=function(e,t){return e.allowedInteractions=e.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e),e.AnnotationSettings=e.AnnotationSettings||this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.customStampSettings),e.IsLocked&&(e.AnnotationSettings.isLock=e.IsLocked),{textMarkupAnnotationType:e.TextMarkupAnnotationType,allowedInteractions:e.allowedInteractions,color:e.Color,opacity:e.Opacity,bounds:e.Bounds,author:e.Author,subject:e.Subject,modifiedDate:e.ModifiedDate,note:e.Note,rect:e.Rect,annotationId:e.AnnotName,comments:this.pdfViewer.annotationModule.getAnnotationComments(e.Comments,e,e.Author),review:{state:e.State,stateModel:e.StateModel,modifiedDate:e.ModifiedDate,author:e.Author},shapeAnnotationType:"textMarkup",pageNumber:t,isMultiSelect:e.IsMultiSelect,annotNameCollection:e.AnnotNameCollection,annotpageNumbers:e.AnnotpageNumbers,customData:this.pdfViewer.annotation.getCustomData(e),annotationSettings:e.AnnotationSettings,isLocked:e.IsLocked,isPrint:e.IsPrint,isCommentLock:e.IsCommentLock}},dAt.prototype.updateTextMarkupSettings=function(e){"highlightSettings"===e&&(this.highlightColor=this.pdfViewer.highlightSettings.color||this.highlightColor,this.highlightOpacity=this.pdfViewer.highlightSettings.opacity||this.highlightOpacity),"underlineSettings"===e&&(this.underlineColor=this.pdfViewer.underlineSettings.color||this.underlineColor,this.underlineOpacity=this.pdfViewer.underlineSettings.opacity||this.underlineOpacity),"strikethroughSettings"===e&&(this.strikethroughColor=this.pdfViewer.strikethroughSettings.color||this.strikethroughColor,this.strikethroughOpacity=this.pdfViewer.strikethroughSettings.opacity||this.strikethroughOpacity)},dAt.prototype.clear=function(){this.selectTextMarkupCurrentPage=null,this.currentTextMarkupAnnotation=null,this.annotationClickPosition=null,ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_textMarkup")},dAt.prototype.getOffsetPoints=function(e){for(var t=[],i=0;i<e.length;i++)t[parseInt(i.toString(),10)]={X:e[parseInt(i.toString(),10)].x,Y:e[parseInt(i.toString(),10)].y,Width:e[parseInt(i.toString(),10)].width,Height:e[parseInt(i.toString(),10)].height,Left:e[parseInt(i.toString(),10)].x,Top:e[parseInt(i.toString(),10)].y};return t},dAt.prototype.updateAddAnnotationDetails=function(e,t){t=t||{pageNumber:0};var i=null,n=null,o="",r=null,s="",a=[],l=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),h=this.pdfViewer.annotation.createGUID(),e=("Highlight"===e?(i=this.pdfViewer.highlightSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(i),r=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.highlightSettings),t.author=t.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("textMarkup",e),n=this.pdfViewer.highlightSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,o="Highlight",s=t.color||"#FFDF56"):"Underline"===e?(i=this.pdfViewer.underlineSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(i),r=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.underlineSettings),t.author=t.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("textMarkup",e),n=this.pdfViewer.underlineSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,o="Underline",s=t.color||"#00ff00"):"Strikethrough"===e&&(i=this.pdfViewer.strikethroughSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(i),r=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.strikethroughSettings),t.author=t.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("textMarkup",e),n=this.pdfViewer.strikethroughSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,o="Strikethrough",s=t.color||"#ff0000"),r.isLock=t.isLock||r.isLock,a=t.bounds?this.getOffsetPoints(t.bounds):[{X:1,Y:1,Width:100,Height:14,Left:1,Top:1,Location:{X:1,Y:1},Size:{Height:14,IsEmpty:!1,Width:100}}],[]),n={AllowedInteractions:t.allowedInteractions||n,AnnotName:h,AnnotNameCollection:null,AnnotType:"textMarkup",AnnotationSelectorSettings:t.annotationSelectorSettings||i,AnnotationSettings:r,Author:t.author||"Guest",Bounds:a,Color:t.color||s,Comments:null,CreatedDate:l,CustomData:t.customData||null,ExistingCustomData:null,EnableMultiPageAnnotation:t.enableMultiPageAnnotation||!1,EnableTextMarkupResizer:t.enableTextMarkupResizer||!1,IsCommentLock:!1,IsMultiSelect:!1,IsLocked:t.isLock||!1,IsLock:t.isLock||!1,IsPrint:!!je(t.isPrint)||t.isPrint,ModifiedDate:"",Note:"",Opacity:t.opacity||1,Rect:{},State:"",StateModel:"",Subject:t.subject||o,TextMarkupAnnotationType:o};return e[0]=n,{textMarkupAnnotation:e}};var hAt=dAt;function dAt(e,t){var i=this;this.currentTextMarkupAddMode="",this.selectTextMarkupCurrentPage=null,this.currentTextMarkupAnnotation=null,this.isAddAnnotationProgramatically=!1,this.currentAnnotationIndex=null,this.isAnnotationSelect=!1,this.isDropletClicked=!1,this.isRightDropletClicked=!1,this.isLeftDropletClicked=!1,this.isSelectionMaintained=!1,this.isExtended=!1,this.isNewAnnotation=!1,this.selectedTextMarkup=null,this.multiPageCollection=[],this.triggerAddEvent=!1,this.isSelectedAnnotation=!1,this.dropletHeight=20,this.strikeoutDifference=-3,this.underlineDifference=2,this.annotationClickPosition={},this.maintainSelection=function(){i.isDropletClicked=!0,i.pdfViewer.textSelectionModule.initiateSelectionByTouch(),i.isExtended=!0,i.pdfViewer.textSelectionModule.selectionRangeArray=[]},this.selectionEnd=function(){i.isDropletClicked&&(i.isDropletClicked=!1)},this.annotationLeftMove=function(){i.isDropletClicked&&(i.isLeftDropletClicked=!0)},this.annotationRightMove=function(){i.isDropletClicked&&(i.isRightDropletClicked=!0)},this.pdfViewer=e,this.pdfViewerBase=t}Object.defineProperty(cAt.prototype,"pixelToPointFactor",{get:function(){return.75},enumerable:!0,configurable:!0}),cAt.prototype.renderMeasureShapeAnnotations=function(e,t,i,n){if(e)if(1<=e.length){if(!this.pdfViewer.annotation.getStoredAnnotations(t,e,"_annotations_shape_measure")||i||n)for(var o=0;o<e.length;o++){var r=e[parseInt(o.toString(),10)],s=null,a=(this.measureShapeCount=this.measureShapeCount+1,r.annotationAddMode=this.pdfViewer.annotationModule.findAnnotationMode(r,t,r.AnnotType),void 0);if(r.ShapeAnnotationType){i&&this.pdfViewerBase.isJsonImported&&(r.Bounds=this.pdfViewerBase.importJsonForRotatedDocuments(r.Rotate,t,r.Bounds,r.AnnotationRotation),a=this.pdfViewerBase.isPageRotated);var l=null;if(r.VertexPoints)if(l=[],i&&this.pdfViewerBase.isJsonImported)l=this.pdfViewerBase.calculateVertexPoints(r.Rotate,t,r.VertexPoints,r.AnnotationRotation);else for(var h=0;h<r.VertexPoints.length;h++){var d=r.VertexPoints[parseInt(h.toString(),10)].X?r.VertexPoints[parseInt(h.toString(),10)].X:r.VertexPoints[parseInt(h.toString(),10)].x,p=r.VertexPoints[parseInt(h.toString(),10)].Y?r.VertexPoints[parseInt(h.toString(),10)].Y:r.VertexPoints[parseInt(h.toString(),10)].y;l.push({x:d,y:p})}r.Bounds&&!0===r.EnableShapeLabel&&(r.LabelBounds=this.pdfViewer.annotationModule.inputElementModule.calculateLabelBoundsFromLoadedDocument(r.Bounds),r.LabelBorderColor=r.LabelBorderColor||r.StrokeColor,r.FontColor=r.FontColor||r.StrokeColor,r.LabelFillColor=r.LabelFillColor||r.FillColor,r.FontSize=r.FontSize||16,r.LabelSettings=r.LabelSettings||this.pdfViewer.shapeLabelSettings),r.AnnotationSettings=r.AnnotationSettings||this.pdfViewer.annotationModule.updateAnnotationSettings(r),r.IsLocked&&(r.AnnotationSettings.isLock=r.IsLocked),r.allowedInteractions=r.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(r);var c=r.IsPrint,u={ratio:r.Calibrate.Ratio,x:this.getNumberFormatArray(r.Calibrate.X),distance:this.getNumberFormatArray(r.Calibrate.Distance),area:this.getNumberFormatArray(r.Calibrate.Area),angle:this.getNumberFormatArray(r.Calibrate.Angle),volume:this.getNumberFormatArray(r.Calibrate.Volume),targetUnitConversion:r.Calibrate.TargetUnitConversion},g=(r.Calibrate.Depth&&(u.depth=r.Calibrate.Depth),r.Bounds.X||r.Bounds.x),m=r.Bounds.Y||r.Bounds.y,f=r.Bounds.Width||r.Bounds.width,y=r.Bounds.Height||r.Bounds.height,g=(s={id:"measure"+this.measureShapeCount,shapeAnnotationType:r.ShapeAnnotationType,author:r.Author,allowedInteractions:r.allowedInteractions,modifiedDate:r.ModifiedDate,subject:r.Subject,note:r.Note,strokeColor:r.StrokeColor,fillColor:r.FillColor,opacity:r.Opacity,thickness:r.Thickness,rectangleDifference:r.RectangleDifference,borderStyle:r.BorderStyle,borderDashArray:r.BorderDashArray,rotateAngle:r.RotateAngle,isCloudShape:r.IsCloudShape,cloudIntensity:r.CloudIntensity,vertexPoints:l,lineHeadStart:r.LineHeadStart,lineHeadEnd:r.LineHeadEnd,isLocked:r.IsLocked,bounds:{left:g,top:m,width:f,height:y,right:r.Bounds.Right,bottom:r.Bounds.Bottom},caption:r.Caption,captionPosition:r.CaptionPosition,calibrate:u,leaderLength:r.LeaderLength,leaderLineExtension:r.LeaderLineExtension,leaderLineOffset:r.LeaderLineOffset,indent:r.Indent,annotName:r.AnnotName,comments:this.pdfViewer.annotationModule.getAnnotationComments(r.Comments,r,r.Author),review:{state:r.State,stateModel:r.StateModel,modifiedDate:r.ModifiedDate,author:r.Author},labelContent:r.LabelContent,enableShapeLabel:r.EnableShapeLabel,labelFillColor:r.LabelFillColor,fontColor:r.FontColor,labelBorderColor:r.LabelBorderColor,fontSize:r.FontSize,labelBounds:r.LabelBounds,annotationSelectorSettings:this.getSettings(r),labelSettings:r.LabelSettings,annotationSettings:r.AnnotationSettings,customData:this.pdfViewer.annotation.getCustomData(r),isPrint:r.IsPrint,isCommentLock:r.IsCommentLock,isAnnotationRotated:a}).vertexPoints,m=(null==l&&(g=[]),"string"==typeof r.AnnotationSelectorSettings?JSON.parse(r.AnnotationSelectorSettings):r.AnnotationSelectorSettings),f=(je(r.AnnotationSelectorSettings)?this.pdfViewerBase.annotationSelectorSettingLoad(r):r.AnnotationSelectorSettings=m,r.allowedInteractions=r.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(r),{id:"measure"+this.measureShapeCount,shapeAnnotationType:this.getShapeType(s),author:s.author,allowedInteractions:r.allowedInteractions,modifiedDate:s.modifiedDate,subject:s.subject,notes:s.note,fillColor:s.fillColor,strokeColor:s.strokeColor,opacity:s.opacity,thickness:s.thickness,borderStyle:s.borderStyle,borderDashArray:s.borderDashArray.toString(),rotateAngle:parseFloat(s.rotateAngle.split("Angle")[1]),isCloudShape:s.isCloudShape,cloudIntensity:s.cloudIntensity,taregetDecoraterShapes:this.pdfViewer.annotation.getArrowType(s.lineHeadEnd),sourceDecoraterShapes:this.pdfViewer.annotation.getArrowType(s.lineHeadStart),vertexPoints:g,bounds:{x:s.bounds.left,y:s.bounds.top,width:s.bounds.width,height:s.bounds.height},leaderHeight:s.leaderLength,pageIndex:t,annotName:s.annotName,comments:s.comments,review:s.review,measureType:this.getMeasureType(s),labelContent:r.LabelContent,enableShapeLabel:r.EnableShapeLabel,labelFillColor:r.LabelFillColor,fontColor:r.FontColor,labelBorderColor:r.LabelBorderColor,fontSize:r.FontSize,labelBounds:r.LabelBounds,annotationSelectorSettings:r.AnnotationSelectorSettings,annotationSettings:s.annotationSettings,annotationAddMode:r.annotationAddMode,isPrint:c,isCommentLock:s.isCommentLock,customData:s.customData});this.pdfViewer.annotation.storeAnnotations(t,s,"_annotations_shape_measure"),this.pdfViewer.add(f),this.isAddAnnotationProgramatically&&(y={opacity:f.opacity,strokeColor:f.strokeColor,thickness:f.thickness,modifiedDate:f.modifiedDate,width:f.bounds.width,height:f.bounds.height},this.pdfViewer.fireAnnotationAdd(f.pageIndex,f.annotName,r.ShapeAnnotationType,f.bounds,y))}}}else e.shapeAnnotationType&&(s=this.createAnnotationObject(e),this.pdfViewer.annotationModule.isFormFieldShape=!1,this.pdfViewer.annotationModule.storeAnnotations(t,s,"_annotations_shape_measure"),e&&(e.customData=s.customData),this.pdfViewer.annotationModule.triggerAnnotationAdd(e))},cAt.prototype.getSettings=function(e){this.pdfViewer.annotationSelectorSettings;return e.AnnotationSelectorSettings?"string"==typeof e.AnnotationSelectorSettings?JSON.parse(e.AnnotationSelectorSettings):e.AnnotationSelectorSettings:this.getSelector(e.Subject)},cAt.prototype.setAnnotationType=function(e){var t="Guest",i="";switch(this.updateMeasureproperties(),this.pdfViewerBase.disableTextSelectionMode(),e){case"Distance":this.currentAnnotationMode="Distance";this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime();var t="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.distanceSettings.author||"Guest",i=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.distanceSettings.subject||"Distance calculation":this.pdfViewer.annotationSettings.subject,n=je(this.pdfViewer.annotationSettings.customData)?this.pdfViewer.distanceSettings.customData||null:this.pdfViewer.annotationSettings.customData;this.pdfViewer.drawingObject={sourceDecoraterShapes:this.pdfViewer.annotation.getArrowType(this.distanceStartHead),taregetDecoraterShapes:this.pdfViewer.annotation.getArrowType(this.distanceEndHead),measureType:"Distance",fillColor:this.distanceFillColor,notes:"",strokeColor:this.distanceStrokeColor,leaderHeight:this.leaderLength,opacity:this.distanceOpacity,thickness:this.distanceThickness,borderDashArray:this.distanceDashArray.toString(),shapeAnnotationType:"Distance",author:t,subject:i,isCommentLock:!1,customData:n},this.pdfViewer.tool="Distance";break;case"Perimeter":this.currentAnnotationMode="Perimeter";this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime();t="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.perimeterSettings.author||"Guest",i=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.perimeterSettings.subject||"Perimeter calculation":this.pdfViewer.annotationSettings.subject,this.pdfViewer.drawingObject={shapeAnnotationType:"LineWidthArrowHead",fillColor:this.perimeterFillColor,notes:"",strokeColor:this.perimeterStrokeColor,opacity:this.perimeterOpacity,thickness:this.perimeterThickness,sourceDecoraterShapes:this.pdfViewer.annotation.getArrowType(this.perimeterStartHead),taregetDecoraterShapes:this.pdfViewer.annotation.getArrowType(this.perimeterEndHead),measureType:"Perimeter",borderDashArray:this.perimeterDashArray.toString(),author:t,subject:i,isCommentLock:!1,customData:n},this.pdfViewer.tool="Perimeter";break;case"Area":this.currentAnnotationMode="Area";var o=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime();t="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.areaSettings.author||"Guest",i=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.areaSettings.subject||"Area calculation":this.pdfViewer.annotationSettings.subject,this.pdfViewer.drawingObject={shapeAnnotationType:"Polygon",fillColor:this.areaFillColor,notes:"",strokeColor:this.areaStrokeColor,thickness:this.areaThickness,opacity:this.areaOpacity,measureType:"Area",modifiedDate:o,borderStyle:"",borderDashArray:"0",author:t,subject:i,isCommentLock:!1,customData:n},this.pdfViewer.tool="Polygon";break;case"Radius":this.currentAnnotationMode="Radius";o=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime();t="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.radiusSettings.author||"Guest",i=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.radiusSettings.subject||"Radius calculation":this.pdfViewer.annotationSettings.subject,n=je(this.pdfViewer.annotationSettings.customData)?this.pdfViewer.radiusSettings.customData||null:this.pdfViewer.annotationSettings.customData,this.pdfViewer.drawingObject={shapeAnnotationType:"Radius",fillColor:this.radiusFillColor,notes:"",strokeColor:this.radiusStrokeColor,opacity:this.radiusOpacity,thickness:this.radiusThickness,measureType:"Radius",modifiedDate:o,borderStyle:"",borderDashArray:"0",author:t,subject:i,isCommentLock:!1,customData:n},this.pdfViewer.tool="DrawTool";break;case"Volume":this.currentAnnotationMode="Volume";o=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime();t="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.volumeSettings.author||"Guest",i=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.volumeSettings.subject||"Volume calculation":this.pdfViewer.annotationSettings.subject,this.pdfViewer.drawingObject={shapeAnnotationType:"Polygon",notes:"",fillColor:this.volumeFillColor,strokeColor:this.volumeStrokeColor,opacity:this.volumeOpacity,thickness:this.volumeThickness,measureType:"Volume",modifiedDate:o,borderStyle:"",borderDashArray:"0",author:t,subject:i,isCommentLock:!1,customData:n},this.pdfViewer.tool="Polygon"}},cAt.prototype.updateMeasureproperties=function(){this.distanceFillColor=this.pdfViewer.distanceSettings.fillColor||"#ff0000",this.distanceStrokeColor=this.pdfViewer.distanceSettings.strokeColor||"#ff0000",this.distanceOpacity=this.pdfViewer.distanceSettings.opacity||1,this.distanceThickness=this.pdfViewer.distanceSettings.thickness||1,this.distanceDashArray=this.pdfViewer.distanceSettings.borderDashArray||0,this.leaderLength=null!=this.pdfViewer.distanceSettings.leaderLength?this.pdfViewer.distanceSettings.leaderLength:40,this.distanceStartHead=this.pdfViewer.distanceSettings.lineHeadStartStyle||"Closed",this.distanceEndHead=this.pdfViewer.distanceSettings.lineHeadEndStyle||"Closed",this.perimeterFillColor=this.pdfViewer.perimeterSettings.fillColor||"#ffffff00",this.perimeterStrokeColor=this.pdfViewer.perimeterSettings.strokeColor||"#ff0000",this.perimeterOpacity=this.pdfViewer.perimeterSettings.opacity||1,this.perimeterThickness=this.pdfViewer.perimeterSettings.thickness||1,this.perimeterDashArray=this.pdfViewer.perimeterSettings.borderDashArray||0,this.perimeterStartHead=this.pdfViewer.perimeterSettings.lineHeadStartStyle||"Open",this.perimeterEndHead=this.pdfViewer.perimeterSettings.lineHeadEndStyle||"Open",this.areaFillColor=this.pdfViewer.areaSettings.fillColor||"#ffffff00",this.areaStrokeColor=this.pdfViewer.areaSettings.strokeColor||"#ff0000",this.areaOpacity=this.pdfViewer.areaSettings.opacity||1,this.areaThickness=this.pdfViewer.areaSettings.thickness||1,this.radiusFillColor=this.pdfViewer.radiusSettings.fillColor||"#ffffff00",this.radiusStrokeColor=this.pdfViewer.radiusSettings.strokeColor||"#ff0000",this.radiusOpacity=this.pdfViewer.radiusSettings.opacity||1,this.radiusThickness=this.pdfViewer.radiusSettings.thickness||1,this.volumeFillColor=this.pdfViewer.volumeSettings.fillColor||"#ffffff00",this.volumeStrokeColor=this.pdfViewer.volumeSettings.strokeColor||"#ff0000",this.volumeOpacity=this.pdfViewer.volumeSettings.opacity||1,this.volumeThickness=this.pdfViewer.volumeSettings.thickness||1,this.unit=this.pdfViewer.measurementSettings.conversionUnit.toLowerCase(),this.displayUnit=this.pdfViewer.measurementSettings.displayUnit.toLowerCase(),!je(this.ratio)&&this.ratio===this.pdfViewer.measurementSettings.scaleRatio||(this.ratio=this.pdfViewer.measurementSettings.scaleRatio),this.volumeDepth=this.pdfViewer.measurementSettings.depth,this.scaleRatioString="1 "+this.unit+" = "+this.ratio.toString()+" "+this.displayUnit},cAt.prototype.createAnnotationObject=function(e){var t,i=this.pdfViewer.annotation.createGUID(),n=this.pdfViewer.annotation.stickyNotesAnnotationModule.addComments("shape_measure",e.pageIndex+1,e.measureType),o=(n&&(document.getElementById(n).id=i),e.annotName=i,e.author=e&&"Guest"!=e.author?e.author:this.pdfViewer.annotationModule.updateAnnotationAuthor("measure",e.subject),this.pdfViewer.annotation.stickyNotesAnnotationModule.addTextToComments(i,e.notes),n=e.wrapper.bounds?(t={left:e.wrapper.bounds.x,top:e.wrapper.bounds.y,height:e.wrapper.bounds.height,width:e.wrapper.bounds.width,right:e.wrapper.bounds.right,bottom:e.wrapper.bounds.bottom},this.pdfViewer.annotationModule.inputElementModule.calculateLabelBounds(e.wrapper.bounds)):(t={left:0,top:0,height:0,width:0,right:0,bottom:0},{left:0,top:0,height:0,width:0,right:0,bottom:0}),parseInt(e.borderDashArray,10)),o=isNaN(o)?0:o,r={ratio:this.scaleRatioString,x:[this.createNumberFormat("x")],distance:[this.createNumberFormat("d")],area:[this.createNumberFormat("a")]},s=("Volume"===e.measureType&&(r.depth=this.volumeDepth),this.pdfViewer.annotationModule.findAnnotationSettings(e,!0)),a=this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e),l=(e.isPrint=s.isPrint,this.pdfViewer.shapeLabelSettings),l={borderColor:e.strokeColor,fillColor:e.fillColor,fontColor:e.fontColor,fontSize:e.fontSize,labelContent:e.labelContent,labelHeight:l.labelHeight,labelWidth:l.labelMaxWidth,opacity:e.opacity};return{id:e.id,shapeAnnotationType:this.getShapeAnnotType(e.measureType),author:e.author,allowedInteractions:a,subject:e.subject,note:e.notes,strokeColor:e.strokeColor,fillColor:e.fillColor,opacity:e.opacity,thickness:e.thickness,borderStyle:e.borderStyle,borderDashArray:o,bounds:t,modifiedDate:this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),rotateAngle:"RotateAngle"+e.rotateAngle,isCloudShape:e.isCloudShape,cloudIntensity:e.cloudIntensity,vertexPoints:e.vertexPoints,lineHeadStart:this.pdfViewer.annotation.getArrowTypeForCollection(e.sourceDecoraterShapes),lineHeadEnd:this.pdfViewer.annotation.getArrowTypeForCollection(e.taregetDecoraterShapes),rectangleDifference:[],isLocked:s.isLock,leaderLength:e.leaderHeight,leaderLineExtension:2,leaderLineOffset:0,calibrate:r,caption:!0,captionPosition:"Top",indent:this.getIndent(e.measureType),annotName:i,comments:[],review:{state:"",stateModel:"",modifiedDate:this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),author:e.author},labelContent:e.labelContent,enableShapeLabel:e.enableShapeLabel,labelFillColor:e.labelFillColor,labelBorderColor:e.labelBorderColor,fontColor:e.fontColor,fontSize:e.fontSize,labelBounds:n,annotationSelectorSettings:this.getSelector(e.subject),labelSettings:l,annotationSettings:s,customData:this.pdfViewer.annotation.getMeasureData(e.subject),isPrint:e.isPrint,isCommentLock:e.isCommentLock,isAnnotationRotated:!1}},cAt.prototype.getSelector=function(e){var t=this.pdfViewer.annotationSelectorSettings;return"Distance calculation"===e&&this.pdfViewer.distanceSettings.annotationSelectorSettings?t=this.pdfViewer.distanceSettings.annotationSelectorSettings:"Perimeter calculation"===e&&this.pdfViewer.perimeterSettings.annotationSelectorSettings?t=this.pdfViewer.perimeterSettings.annotationSelectorSettings:"Area calculation"===e&&this.pdfViewer.areaSettings.annotationSelectorSettings?t=this.pdfViewer.areaSettings.annotationSelectorSettings:"Radius calculation"===e&&this.pdfViewer.radiusSettings.annotationSelectorSettings?t=this.pdfViewer.radiusSettings.annotationSelectorSettings:"Volume calculation"===e&&this.pdfViewer.volumeSettings.annotationSelectorSettings&&(t=this.pdfViewer.volumeSettings.annotationSelectorSettings),t},cAt.prototype.getShapeAnnotType=function(e){var t;switch(e){case"Distance":t="Line";break;case"Perimeter":t="Polyline";break;case"Area":case"Volume":t="Polygon";break;case"Radius":t="Circle"}return t},cAt.prototype.getShapeType=function(e){var t;return"Line"===e.shapeAnnotationType?t="Distance":"Polyline"===e.shapeAnnotationType?t="LineWidthArrowHead":"Polygon"===e.shapeAnnotationType&&"PolygonDimension"===e.indent?t="Polygon":"Polygon"===e.shapeAnnotationType&&"PolygonRadius"===e.indent||"Circle"===e.shapeAnnotationType?t="Radius":"Polygon"===e.shapeAnnotationType&&"PolygonVolume"===e.indent&&(t="Polygon"),t},cAt.prototype.getMeasureType=function(e){var t;return"Line"===e.shapeAnnotationType?t="Distance":"Polyline"===e.shapeAnnotationType?t="Perimeter":"Polygon"===e.shapeAnnotationType&&"PolygonDimension"===e.indent?t="Area":"Polygon"===e.shapeAnnotationType&&"PolygonRadius"===e.indent||"Circle"===e.shapeAnnotationType?t="Radius":"Polygon"===e.shapeAnnotationType&&"PolygonVolume"===e.indent&&(t="Volume"),t},cAt.prototype.getIndent=function(e){var t;switch(e){case"Distance":t="LineDimension";break;case"Perimeter":t="PolyLineDimension";break;case"Area":t="PolygonDimension";break;case"Radius":t="PolygonRadius";break;case"Volume":t="PolygonVolume"}return t},cAt.prototype.getNumberFormatArray=function(e){var t=[];if(e)for(var i=0;i<e.length;i++)t[parseInt(i.toString(),10)]={unit:e[parseInt(i.toString(),10)].Unit,fractionalType:e[parseInt(i.toString(),10)].FractionalType,conversionFactor:e[parseInt(i.toString(),10)].ConversionFactor,denominator:e[parseInt(i.toString(),10)].Denominator,formatDenominator:e[parseInt(i.toString(),10)].FormatDenominator};return t},cAt.prototype.createNumberFormat=function(e){var t=1,i=this.displayUnit;return"x"===e&&(t=this.getFactor(this.unit)),{unit:i="a"===e?"sq "+this.displayUnit:i,fractionalType:"D",conversionFactor:t,denominator:100,formatDenominator:!1}},cAt.prototype.saveMeasureShapeAnnotations=function(){for(var e=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_shape_measure"),t=(this.pdfViewerBase.isStorageExceed&&(e=this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_shape_measure"]),[]),i=0;i<this.pdfViewerBase.pageCount;i++)t[parseInt(i.toString(),10)]=[];if(e&&!this.pdfViewer.annotationSettings.skipDownload)for(var n=JSON.parse(e),o=0;o<n.length;o++){var r=[],s=n[parseInt(o.toString(),10)];if(s){for(var a=0;s.annotations.length>a;a++){this.pdfViewer.annotationModule.updateModifiedDate(s.annotations[parseInt(a.toString(),10)]),this.pdfViewerBase.isJsonExported&&(s.annotations[parseInt(a.toString(),10)].isAnnotationRotated?(s.annotations[parseInt(a.toString(),10)].bounds=this.pdfViewer.annotation.getBounds(s.annotations[parseInt(a.toString(),10)].bounds,s.pageIndex),s.annotations[parseInt(a.toString(),10)].vertexPoints=this.pdfViewer.annotation.getVertexPoints(s.annotations[parseInt(a.toString(),10)].vertexPoints,s.pageIndex)):(h=this.pdfViewerBase.pageSize[s.pageIndex])&&(s.annotations[parseInt(a.toString(),10)].annotationRotation=h.rotation)),s.annotations[parseInt(a.toString(),10)].bounds=JSON.stringify(this.pdfViewer.annotation.getBounds(s.annotations[parseInt(a.toString(),10)].bounds,s.pageIndex));var l,h=s.annotations[parseInt(a.toString(),10)].strokeColor,d=(s.annotations[parseInt(a.toString(),10)].strokeColor=JSON.stringify(this.getRgbCode(h)),s.annotations[parseInt(a.toString(),10)].fillColor);s.annotations[parseInt(a.toString(),10)].fillColor=JSON.stringify(this.getRgbCode(d)),s.annotations[parseInt(a.toString(),10)].vertexPoints=JSON.stringify(this.pdfViewer.annotation.getVertexPoints(s.annotations[parseInt(a.toString(),10)].vertexPoints,s.pageIndex)),null!==s.annotations[parseInt(a.toString(),10)].rectangleDifference&&(s.annotations[parseInt(a.toString(),10)].rectangleDifference=JSON.stringify(s.annotations[parseInt(a.toString(),10)].rectangleDifference)),s.annotations[parseInt(a.toString(),10)].calibrate=this.getStringifiedMeasure(s.annotations[parseInt(a.toString(),10)].calibrate),!0===s.annotations[parseInt(a.toString(),10)].enableShapeLabel&&(s.annotations[parseInt(a.toString(),10)].labelBounds=JSON.stringify(this.pdfViewer.annotationModule.inputElementModule.calculateLabelBounds(JSON.parse(s.annotations[parseInt(a.toString(),10)].bounds),s.pageIndex)),d=s.annotations[parseInt(a.toString(),10)].labelFillColor,s.annotations[parseInt(a.toString(),10)].labelFillColor=JSON.stringify(this.getRgbCode(d)),l=s.annotations[parseInt(a.toString(),10)].labelBorderColor,s.annotations[parseInt(a.toString(),10)].labelBorderColor=JSON.stringify(this.getRgbCode(l)),s.annotations[parseInt(a.toString(),10)].labelSettings.fillColor=d,l=s.annotations[parseInt(a.toString(),10)].labelSettings.fontColor,s.annotations[parseInt(a.toString(),10)].fontColor=JSON.stringify(this.getRgbCode(l)))}r=s.annotations}t[s.pageIndex]=r}return JSON.stringify(t)},cAt.prototype.createScaleRatioWindow=function(){var e,t,i=this;N?this.pdfViewer._dotnetInstance.invokeMethodAsync("OpenScaleRatioDialog"):(e=Q("div",{id:this.pdfViewer.element.id+"_scale_ratio_window",className:"e-pv-scale-ratio-window"}),this.pdfViewerBase.pageContainer.appendChild(e),t=this.createRatioUI(),this.scaleRatioDialog=new pS({showCloseIcon:!0,closeOnEscape:!1,isModal:!0,header:this.pdfViewer.localeObj.getConstant("Scale Ratio"),target:this.pdfViewer.element,content:t,close:function(){i.sourceTextBox.destroy(),i.convertUnit.destroy(),i.destTextBox.destroy(),i.dispUnit.destroy(),i.scaleRatioDialog.destroy();var e=i.pdfViewerBase.getElement("_scale_ratio_window");e.parentElement.removeChild(e)}}),!F.isDevice||this.pdfViewer.enableDesktopMode?this.scaleRatioDialog.buttons=[{buttonModel:{content:this.pdfViewer.localeObj.getConstant("OK"),isPrimary:!0},click:this.onOkClicked.bind(this)},{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Cancel")},click:this.onCancelClicked.bind(this)}]:this.scaleRatioDialog.buttons=[{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Cancel")},click:this.onCancelClicked.bind(this)},{buttonModel:{content:this.pdfViewer.localeObj.getConstant("OK"),isPrimary:!0},click:this.onOkClicked.bind(this)}],this.pdfViewer.enableRtl&&(this.scaleRatioDialog.enableRtl=!0),this.scaleRatioDialog.appendTo(e),this.convertUnit.content=this.createContent(this.pdfViewer.localeObj.getConstant(this.unit)).outerHTML,this.dispUnit.content=this.createContent(this.pdfViewer.localeObj.getConstant(this.displayUnit)).outerHTML,this.depthUnit.content=this.createContent(this.pdfViewer.localeObj.getConstant(this.displayUnit)).outerHTML)},cAt.prototype.createRatioUI=function(){var e=Q("div"),t=this.pdfViewer.element.id,i=[{text:this.pdfViewer.localeObj.getConstant("pt"),label:"pt"},{text:this.pdfViewer.localeObj.getConstant("in"),label:"in"},{text:this.pdfViewer.localeObj.getConstant("mm"),label:"mm"},{text:this.pdfViewer.localeObj.getConstant("cm"),label:"cm"},{text:this.pdfViewer.localeObj.getConstant("p"),label:"p"},{text:this.pdfViewer.localeObj.getConstant("ft"),label:"ft"},{text:this.pdfViewer.localeObj.getConstant("ft_in"),label:"ft_in"},{text:this.pdfViewer.localeObj.getConstant("m"),label:"m"}],n=Q("div",{id:t+"_scale_ratio_label",className:"e-pv-scale-ratio-text"}),n=(n.textContent=this.pdfViewer.localeObj.getConstant("Scale Ratio"),e.appendChild(n),Q("div",{id:t+"_scale_src_container"})),o=(e.appendChild(n),this.createInputElement("input","e-pv-scale-ratio-src-input",t+"_src_input",n)),o=(this.sourceTextBox=new NL({value:this.srcValue||1,format:"##",cssClass:"e-pv-scale-ratio-src-input",min:1,max:100},o),this.createInputElement("button","e-pv-scale-ratio-src-unit",t+"_src_unit",n)),n=(this.convertUnit=new u2({items:i,cssClass:"e-pv-scale-ratio-src-unit"},o),this.convertUnit.select=this.convertUnitSelect.bind(this),Q("div",{id:t+"_scale_dest_container"})),o=this.createInputElement("input","e-pv-scale-ratio-dest-input",t+"_dest_input",n),o=(this.destTextBox=new NL({value:this.destValue||1,format:"##",cssClass:"e-pv-scale-ratio-dest-input",min:1,max:100},o),this.createInputElement("button","e-pv-scale-ratio-dest-unit",t+"_dest_unit",n)),o=(this.dispUnit=new u2({items:i,cssClass:"e-pv-scale-ratio-dest-unit"},o),this.dispUnit.select=this.dispUnitSelect.bind(this),e.appendChild(n),Q("div",{id:t+"_depth_label",className:"e-pv-depth-text"})),n=(o.textContent=this.pdfViewer.localeObj.getConstant("Depth"),e.appendChild(o),Q("div",{id:t+"_depth_container"})),o=(e.appendChild(n),this.createInputElement("input","e-pv-depth-input",t+"_depth_input",n)),o=(this.depthTextBox=new NL({value:this.volumeDepth,format:"##",cssClass:"e-pv-depth-input",min:1},o),this.createInputElement("button","e-pv-depth-unit",t+"_depth_unit",n));return this.depthUnit=new u2({items:i,cssClass:"e-pv-depth-unit"},o),this.depthUnit.select=this.depthUnitSelect.bind(this),e},cAt.prototype.convertUnitSelect=function(e){this.convertUnit.content=this.createContent(e.item.text).outerHTML},cAt.prototype.dispUnitSelect=function(e){this.dispUnit.content=this.createContent(e.item.text).outerHTML,this.depthUnit.content=this.createContent(e.item.text).outerHTML},cAt.prototype.depthUnitSelect=function(e){this.depthUnit.content=this.createContent(e.item.text).outerHTML},cAt.prototype.createContent=function(e){var t=Q("div",{className:"e-pv-scale-unit-content"});return t.textContent=e,t},cAt.prototype.createInputElement=function(e,t,i,n){t=Q("div",{id:i+"_container",className:t+"-container"}),i=Q(e,{id:i});return"input"===e&&(i.type="text"),t.appendChild(i),n.appendChild(t),i},cAt.prototype.onOkClicked=function(){var e,t,i,n,o;N?(n=document.querySelector("#"+this.pdfViewer.element.id+"_src_unit"),o=document.querySelector("#"+this.pdfViewer.element.id+"_dest_unit"),e=document.querySelector("#"+this.pdfViewer.element.id+"_ratio_input"),t=document.querySelector("#"+this.pdfViewer.element.id+"_dest_input"),i=document.querySelector("#"+this.pdfViewer.element.id+"_depth_input"),n&&o&&e&&t&&i&&(this.unit=n.value,this.displayUnit=o.value,this.ratio=parseInt(t.value,10)/parseInt(e.value,10),this.volumeDepth=parseInt(i.value,10)),this.scaleRatioString=parseInt(e.value,10)+" "+this.unit+" = "+parseInt(t.value,10)+" "+this.displayUnit,this.updateMeasureValues(this.scaleRatioString,this.displayUnit,this.unit,this.volumeDepth)):(this.unit=this.getContent(this.convertUnit.content),this.displayUnit=this.getContent(this.dispUnit.content),this.ratio=this.destTextBox.value/this.sourceTextBox.value,this.volumeDepth=this.depthTextBox.value,this.scaleRatioString=this.sourceTextBox.value+" "+this.unit+" = "+this.destTextBox.value+" "+this.displayUnit,this.scaleRatioDialog.hide(),n=this.restoreUnit(this.convertUnit),o=this.restoreUnit(this.dispUnit),this.updateMeasureValues(this.scaleRatioString,o,n,this.volumeDepth))},cAt.prototype.restoreUnit=function(e){for(var t,i=0;i<e.items.length;i++){var n=e.items[parseInt(i.toString(),10)];this.unit===n.text&&(t=n.label)}return t},cAt.prototype.updateMeasureValues=function(e,t,i,n){this.scaleRatioString=e,this.displayUnit=t,this.unit=i,this.volumeDepth=n;for(var o=0;o<this.pdfViewerBase.pageCount;o++){if(s=this.getAnnotations(o,null))for(var r=0;r<s.length;r++){var s,a=(s=this.getAnnotations(o,null))[parseInt(r.toString(),10)];a.annotationSettings.isLock||(a.calibrate.ratio=e,a.calibrate.x[0].unit=t,a.calibrate.distance[0].unit=t,a.calibrate.area[0].unit=t,a.calibrate.x[0].conversionFactor=this.getFactor(i),"PolygonVolume"===a.indent&&(a.calibrate.depth=n),s[parseInt(r.toString(),10)]=a,this.manageAnnotations(s,o),this.pdfViewer.annotation.updateCalibrateValues(this.getAnnotationBaseModel(a.id)))}this.pdfViewer.annotation.renderAnnotations(o,null,null,null,null,!1)}},cAt.prototype.getAnnotationBaseModel=function(e){for(var t=null,i=0;i<this.pdfViewer.annotations.length;i++)if(e===this.pdfViewer.annotations[parseInt(i.toString(),10)].id){t=this.pdfViewer.annotations[parseInt(i.toString(),10)];break}return t},cAt.prototype.getContent=function(e){return e.split("</div>")[0].split('">')[1]},cAt.prototype.setConversion=function(e,t){var t=t&&(i=t.pageIndex,"diagram_helper"===t.id&&(i=t.pageIndex||this.pdfViewerBase.activeElements.activePageID,t=this.getCurrentObject(i,null,t.annotName)),t)?this.getCurrentValues(t.id,i):this.getCurrentValues(),i=e*t.ratio;return this.convertPointToUnits(t.factor,i,t.unit)},cAt.prototype.onCancelClicked=function(){this.scaleRatioDialog.hide()},cAt.prototype.modifyInCollection=function(e,t,i,n){je(i.formFieldAnnotationType)||""===i.formFieldAnnotationType?this.pdfViewer.annotationModule.isFormFieldShape=!1:this.pdfViewer.annotationModule.isFormFieldShape=!0;var o=null,r=!1,s=this.getAnnotations(t,null);if(null!=s&&i){for(var a=0;a<s.length;a++)if(i.id===s[parseInt(a.toString(),10)].id){if("bounds"===e)this.pdfViewerBase.isBounds=this.pdfViewerBase.boundsCalculation(s[parseInt(a.toString(),10)].bounds,i.wrapper.bounds),this.pdfViewerBase.isBounds&&(this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateAnnotationModifiedDate(i,!0),"Line"!==s[parseInt(a.toString(),10)].shapeAnnotationType&&"Polyline"!==s[parseInt(a.toString(),10)].shapeAnnotationType&&"Polygon"!==s[parseInt(a.toString(),10)].shapeAnnotationType||(s[parseInt(a.toString(),10)].vertexPoints=i.vertexPoints),s[parseInt(a.toString(),10)].bounds={left:i.bounds.x,top:i.bounds.y,width:i.bounds.width,height:i.bounds.height,right:i.bounds.right,bottom:i.bounds.bottom}),!0===s[parseInt(a.toString(),10)].enableShapeLabel&&i.wrapper&&(s[parseInt(a.toString(),10)].labelBounds=this.pdfViewer.annotationModule.inputElementModule.calculateLabelBounds(i.wrapper.bounds));else if("fill"===e)s[parseInt(a.toString(),10)].fillColor=i.wrapper.children[0].style.fill,this.pdfViewer.enableShapeLabel&&(s[parseInt(a.toString(),10)].labelFillColor=i.wrapper.children[0].style.fill);else if("stroke"===e)s[parseInt(a.toString(),10)].strokeColor=i.wrapper.children[0].style.strokeColor;else if("opacity"===e)s[parseInt(a.toString(),10)].opacity=i.wrapper.children[0].style.opacity;else if("thickness"===e)s[parseInt(a.toString(),10)].thickness=i.wrapper.children[0].style.strokeWidth;else if("dashArray"===e)s[parseInt(a.toString(),10)].borderDashArray=i.wrapper.children[0].style.strokeDashArray,s[parseInt(a.toString(),10)].borderStyle=i.borderStyle;else if("startArrow"===e)s[parseInt(a.toString(),10)].lineHeadStart=this.pdfViewer.annotation.getArrowTypeForCollection(i.sourceDecoraterShapes);else if("endArrow"===e)s[parseInt(a.toString(),10)].lineHeadEnd=this.pdfViewer.annotation.getArrowTypeForCollection(i.taregetDecoraterShapes);else if("leaderLength"===e)s[parseInt(a.toString(),10)].leaderLength=i.leaderHeight;else if("notes"===e)s[parseInt(a.toString(),10)].note=i.notes,!0===s[parseInt(a.toString(),10)].enableShapeLabel&&(r=!0,s[parseInt(a.toString(),10)].labelContent=i.notes);else{if("delete"===e){o=s.splice(a,1)[0];break}if("labelContent"===e){s[parseInt(a.toString(),10)].note=i.labelContent,s[parseInt(a.toString(),10)].labelContent=i.labelContent;break}"fontColor"===e?s[parseInt(a.toString(),10)].fontColor=i.fontColor:"fontSize"===e&&(s[parseInt(a.toString(),10)].fontSize=i.fontSize)}this.pdfViewerBase.isBounds&&(s[parseInt(a.toString(),10)].modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime()),this.pdfViewer.annotationModule.storeAnnotationCollections(s[parseInt(a.toString(),10)],t)}this.manageAnnotations(s,t)}return!n&&r&&this.pdfViewerBase.updateDocumentEditedProperty(!0),o},cAt.prototype.addInCollection=function(e,t){var i=this.getAnnotations(e,null);i&&i.push(t),this.manageAnnotations(i,e)},cAt.prototype.manageAnnotations=function(e,t){var i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_shape_measure");(i=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_shape_measure"]:i)&&(i=JSON.parse(i),this.pdfViewerBase.isStorageExceed||ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_shape_measure"),null!=(t=this.pdfViewer.annotationModule.getPageCollection(i,t))&&i[parseInt(t.toString(),10)]&&(i[parseInt(t.toString(),10)].annotations=e),t=JSON.stringify(i),this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_shape_measure"]=t:ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_shape_measure",t))},cAt.prototype.getAnnotations=function(e,t){var i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_shape_measure");return(i=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_shape_measure"]:i)&&(i=JSON.parse(i),null!=(e=this.pdfViewer.annotationModule.getPageCollection(i,e)))&&i[parseInt(e.toString(),10)]?i[parseInt(e.toString(),10)].annotations:t},cAt.prototype.getCurrentObject=function(e,t,i){var n=null,o=this.getAnnotations(e,null);if(null!=o)for(var r=0;r<o.length;r++)if(t){if(t===o[parseInt(r.toString(),10)].id){n=o[parseInt(r.toString(),10)];break}}else if(i&&i===o[parseInt(r.toString(),10)].annotName){n=o[parseInt(r.toString(),10)];break}return n},cAt.prototype.getCurrentValues=function(e,t){var i,n,o;return e=e&&!isNaN(t)&&(t=this.getCurrentObject(t,e))?(i=this.getCurrentRatio(t.calibrate.ratio),n=t.calibrate.x[0].unit,o=t.calibrate.x[0].conversionFactor,t.calibrate.depth):(i=this.ratio,n=this.displayUnit,o=this.getFactor(this.unit),this.volumeDepth),{ratio:i,unit:n,factor:o,depth:e}},cAt.prototype.getCurrentRatio=function(e){e=e.split(" ");return"="===e[3]?parseFloat(e[4])/parseFloat(e[0]):parseFloat(e[3])/parseFloat(e[0])},cAt.prototype.calculateArea=function(e,t,i){var n,t=this.getCurrentValues(t,i),i=this.getArea(e,t.factor,t.unit)*t.ratio;return"ft_in"===t.unit?12<=(e=Math.round(100*i)/100)?(e=(e=(Math.round(e/12*100)/100).toString()).split("."))[1]&&(n=0,n=e[1].charAt(1)?(n=parseInt(e[1].charAt(0),10)+"."+parseInt(e[1].charAt(1),10),Math.round(n)):e[1])?e[0]+" "+this.pdfViewer.localeObj.getConstant("sq")+" "+this.pdfViewer.localeObj.getConstant("ft")+" "+n+" "+this.pdfViewer.localeObj.getConstant("in"):e[0]+" "+this.pdfViewer.localeObj.getConstant("sq")+" "+this.pdfViewer.localeObj.getConstant("ft"):Math.round(100*i)/100+" "+this.pdfViewer.localeObj.getConstant("sq")+" "+this.pdfViewer.localeObj.getConstant("in"):"m"===t.unit?100*i/100+" "+this.pdfViewer.localeObj.getConstant("sq")+" "+this.pdfViewer.localeObj.getConstant(t.unit):Math.round(100*i)/100+" "+this.pdfViewer.localeObj.getConstant("sq")+" "+this.pdfViewer.localeObj.getConstant(t.unit)},cAt.prototype.getArea=function(e,t,i){for(var n=0,o=e.length-1,r=0;r<e.length;r++)n+=(e[parseInt(o.toString(),10)].x*this.pixelToPointFactor*t+e[parseInt(r.toString(),10)].x*this.pixelToPointFactor*t)*(e[parseInt(o.toString(),10)].y*this.pixelToPointFactor*t-e[parseInt(r.toString(),10)].y*this.pixelToPointFactor*t),o=r;return"ft_in"===i?Math.abs(2*n):Math.abs(n/2)},cAt.prototype.calculateVolume=function(e,t,i){var n,t=this.getCurrentValues(t,i),i=t.depth||this.volumeDepth,e=this.getArea(e,t.factor,t.unit)*(i*this.convertUnitToPoint(t.unit)*t.factor)*t.ratio;return"ft_in"===t.unit?12<=(i=Math.round(100*e)/100)?(i=(i=(Math.round(i/12*100)/100).toString()).split("."))[1]&&(n=0,n=i[1].charAt(1)?(n=parseInt(i[1].charAt(0),10)+"."+parseInt(i[1].charAt(1),10),Math.round(n)):i[1])?i[0]+" "+this.pdfViewer.localeObj.getConstant("cu")+" "+this.pdfViewer.localeObj.getConstant("ft")+" "+n+" "+this.pdfViewer.localeObj.getConstant("in"):i[0]+" "+this.pdfViewer.localeObj.getConstant("cu")+" "+this.pdfViewer.localeObj.getConstant("ft"):Math.round(100*e)/100+" "+this.pdfViewer.localeObj.getConstant("cu")+" "+this.pdfViewer.localeObj.getConstant("in"):Math.round(100*e)/100+" "+this.pdfViewer.localeObj.getConstant("cu")+" "+this.pdfViewer.localeObj.getConstant(t.unit)},cAt.prototype.calculatePerimeter=function(e){var t=Cbt.getLengthFromListOfPoints(e.vertexPoints);return this.setConversion(t*this.pixelToPointFactor,e)},cAt.prototype.getFactor=function(e){var t;switch(e){case"in":t=1/72;break;case"cm":t=1/28.346;break;case"mm":t=1/2.835;break;case"pt":t=1;break;case"p":t=1/12;break;case"ft":t=1/864;break;case"ft_in":t=1/72;break;case"m":t=1/2834.64567}return t},cAt.prototype.convertPointToUnits=function(e,t,i){var n,o;return"ft_in"===i?12<=(o=Math.round(t*e*100)/100)?(o=(o=(Math.round(o/12*100)/100).toString()).split("."))[1]&&(n=0,n=o[1].charAt(1)?(n=parseInt(o[1].charAt(0),10)+"."+parseInt(o[1].charAt(1),10),Math.round(n)):o[1])?o[0]+" "+this.pdfViewer.localeObj.getConstant("ft")+" "+n+" "+this.pdfViewer.localeObj.getConstant("in"):o[0]+" "+this.pdfViewer.localeObj.getConstant("ft"):Math.round(t*e*100)/100+" "+this.pdfViewer.localeObj.getConstant("in"):Math.round(t*e*100)/100+" "+this.pdfViewer.localeObj.getConstant(i)},cAt.prototype.convertUnitToPoint=function(e){var t;switch(e){case"in":t=72;break;case"cm":t=28.346;break;case"mm":t=2.835;break;case"pt":t=1;break;case"p":t=12;break;case"ft":t=864;break;case"ft_in":t=72;break;case"m":t=2834.64567}return t},cAt.prototype.getStringifiedMeasure=function(e){return je(e)||(e.angle=JSON.stringify(e.angle),e.area=JSON.stringify(e.area),e.distance=JSON.stringify(e.distance),e.volume=JSON.stringify(e.volume)),JSON.stringify(e)},cAt.prototype.getRgbCode=function(e){var t=(e=e.match(/#([a-z0-9]+)/gi)||e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/)?e:this.pdfViewer.annotationModule.nameToHash(e)).split(",");return je(t[1])&&(t=(e=this.pdfViewer.annotationModule.getValue(e,"rgba")).split(",")),{r:parseInt(t[0].split("(")[1],10),g:parseInt(t[1],10),b:parseInt(t[2],10),a:parseInt(t[3],10)}},cAt.prototype.saveImportedMeasureAnnotations=function(e,t){var i=null;if(e.VertexPoints)for(var i=[],n=0;n<e.VertexPoints.length;n++){var o={x:e.VertexPoints[parseInt(n.toString(),10)].X,y:e.VertexPoints[parseInt(n.toString(),10)].Y};i.push(o)}var r={ratio:e.Calibrate.Ratio,x:this.getNumberFormatArray(e.Calibrate.X),distance:this.getNumberFormatArray(e.Calibrate.Distance),area:this.getNumberFormatArray(e.Calibrate.Area),angle:this.getNumberFormatArray(e.Calibrate.Angle),volume:this.getNumberFormatArray(e.Calibrate.Volume),targetUnitConversion:e.Calibrate.TargetUnitConversion};e.Calibrate.Depth&&(r.depth=e.Calibrate.Depth),e.Bounds&&!0===e.EnableShapeLabel&&(e.LabelBounds=this.pdfViewer.annotationModule.inputElementModule.calculateLabelBoundsFromLoadedDocument(e.Bounds),e.LabelBorderColor=e.LabelBorderColor||e.StrokeColor,e.FontColor=e.FontColor||e.StrokeColor,e.LabelFillColor=e.LabelFillColor||e.FillColor,e.FontSize=e.FontSize||16,e.LabelSettings=e.LabelSettings||this.pdfViewer.shapeLabelSettings),e.allowedInteractions=e.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e),e.AnnotationSettings=e.AnnotationSettings||this.pdfViewer.annotationModule.updateAnnotationSettings(e),e.Author=this.pdfViewer.annotationModule.updateAnnotationAuthor("measure",e.Subject),r={id:"measure",shapeAnnotationType:e.ShapeAnnotationType,author:e.Author,allowedInteractions:e.allowedInteractions,modifiedDate:e.ModifiedDate,subject:e.Subject,note:e.Note,strokeColor:e.StrokeColor,fillColor:e.FillColor,opacity:e.Opacity,thickness:e.Thickness,rectangleDifference:e.RectangleDifference,borderStyle:e.BorderStyle,borderDashArray:e.BorderDashArray,rotateAngle:e.RotateAngle,isCloudShape:e.IsCloudShape,cloudIntensity:e.CloudIntensity,vertexPoints:i,lineHeadStart:e.LineHeadStart,lineHeadEnd:e.LineHeadEnd,isLocked:e.IsLocked,bounds:{left:e.Bounds.X,top:e.Bounds.Y,width:e.Bounds.Width,height:e.Bounds.Height,right:e.Bounds.Right,bottom:e.Bounds.Bottom},caption:e.Caption,captionPosition:e.CaptionPosition,calibrate:r,leaderLength:e.LeaderLength,leaderLineExtension:e.LeaderLineExtension,leaderLineOffset:e.LeaderLineOffset,indent:e.Indent,annotName:e.AnnotName,comments:this.pdfViewer.annotationModule.getAnnotationComments(e.Comments,e,e.Author),review:{state:e.State,stateModel:e.StateModel,modifiedDate:e.ModifiedDate,author:e.Author},labelContent:e.LabelContent,enableShapeLabel:e.EnableShapeLabel,labelFillColor:e.LabelFillColor,labelBorderColor:e.LabelBorderColor,fontColor:e.FontColor,fontSize:e.FontSize,labelBounds:e.LabelBounds,annotationSelectorSettings:this.getSettings(e),labelSettings:e.LabelSettings,annotationSettings:e.AnnotationSettings,customData:this.pdfViewer.annotation.getCustomData(e),isPrint:e.IsPrint,isCommentLock:e.IsCommentLock,isAnnotationRotated:!1},this.pdfViewer.annotationModule.storeAnnotations(t,r,"_annotations_shape_measure")},cAt.prototype.updateMeasureAnnotationCollections=function(e,t){var i=null;if(e.VertexPoints)for(var i=[],n=0;n<e.VertexPoints.length;n++){var o={x:e.VertexPoints[parseInt(n.toString(),10)].X,y:e.VertexPoints[parseInt(n.toString(),10)].Y};i.push(o)}var r,s={ratio:e.Calibrate.Ratio,x:this.getNumberFormatArray(e.Calibrate.X),distance:this.getNumberFormatArray(e.Calibrate.Distance),area:this.getNumberFormatArray(e.Calibrate.Area),angle:this.getNumberFormatArray(e.Calibrate.Angle),volume:this.getNumberFormatArray(e.Calibrate.Volume),targetUnitConversion:e.Calibrate.TargetUnitConversion};return e.Calibrate.Depth&&(s.depth=e.Calibrate.Depth),e.Bounds&&!0===e.EnableShapeLabel&&(e.LabelBounds=this.pdfViewer.annotationModule.inputElementModule.calculateLabelBoundsFromLoadedDocument(e.Bounds),e.LabelBorderColor=e.LabelBorderColor||e.StrokeColor,e.FontColor=e.FontColor||e.StrokeColor,e.LabelFillColor=e.LabelFillColor||e.FillColor,e.FontSize=e.FontSize||16,r=this.pdfViewer.shapeLabelSettings,r={borderColor:e.StrokeColor,fillColor:e.FillColor,fontColor:e.FontColor,fontSize:e.FontSize,labelContent:e.LabelContent,labelHeight:r.labelHeight,labelWidth:r.labelWidth,opacity:e.Opacity},e.LabelSettings=e.LabelSettings||r),e.allowedInteractions=e.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e),e.AnnotationSelectorSettings=e.AnnotationSelectorSettings||this.pdfViewerBase.annotationSelectorSettingLoad(e),e.AnnotationSettings=e.AnnotationSettings||this.pdfViewer.annotationModule.updateAnnotationSettings(e),e.IsLocked&&(e.AnnotationSettings.isLock=e.IsLocked),{id:"measure",shapeAnnotationType:e.ShapeAnnotationType,author:e.Author,allowedInteractions:e.allowedInteractions,modifiedDate:e.ModifiedDate,subject:e.Subject,note:e.Note,strokeColor:e.StrokeColor,fillColor:e.FillColor,opacity:e.Opacity,thickness:e.Thickness,rectangleDifference:e.RectangleDifference,borderStyle:e.BorderStyle,borderDashArray:e.BorderDashArray,rotateAngle:e.RotateAngle,isCloudShape:e.IsCloudShape,cloudIntensity:e.CloudIntensity,vertexPoints:i,lineHeadStart:e.LineHeadStart,lineHeadEnd:e.LineHeadEnd,isLocked:e.IsLocked,bounds:{left:e.Bounds.X,top:e.Bounds.Y,width:e.Bounds.Width,height:e.Bounds.Height,right:e.Bounds.Right,bottom:e.Bounds.Bottom},caption:e.Caption,captionPosition:e.CaptionPosition,calibrate:s,leaderLength:e.LeaderLength,leaderLineExtension:e.LeaderLineExtension,leaderLineOffset:e.LeaderLineOffset,indent:e.Indent,annotationId:e.AnnotName,comments:this.pdfViewer.annotationModule.getAnnotationComments(e.Comments,e,e.Author),review:{state:e.State,stateModel:e.StateModel,modifiedDate:e.ModifiedDate,author:e.Author},labelContent:e.LabelContent,enableShapeLabel:e.EnableShapeLabel,labelFillColor:e.LabelFillColor,labelBorderColor:e.LabelBorderColor,fontColor:e.FontColor,fontSize:e.FontSize,labelBounds:e.LabelBounds,pageNumber:t,annotationSelectorSettings:e.AnnotationSelectorSettings,labelSettings:e.labelSettings,annotationSettings:e.AnnotationSettings,customData:this.pdfViewer.annotation.getCustomData(e),isPrint:e.IsPrint,isCommentLock:e.IsCommentLock}},cAt.prototype.updateAddAnnotationDetails=function(e,t,i){i=t?t.offset||{x:10,y:10}:(t={offset:{x:10,y:10},pageNumber:0,width:void 0,height:void 0}).offset;var n=null,o=null,r=null,s="",a="",l="",h=!1,d=[],p=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),c=this.pdfViewer.annotation.createGUID();"Distance"===e?(n=this.pdfViewer.lineSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(n),r=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.lineSettings),t.author=t.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("measure",e),o=this.pdfViewer.lineSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,s="LineDimension",a="Line",l=""!==this.pdfViewer.lineSettings.subject?this.pdfViewer.lineSettings.subject:""!==this.pdfViewer.annotationSettings.subject?this.pdfViewer.annotationSettings.subject:"Distance calculation",h=!0,d=t.vertexPoints||[{x:i.x,y:i.y},{x:i.x+100,y:i.y}],t.width=t.width||1,t.height=t.height||1):"Perimeter"===e?(n=this.pdfViewer.arrowSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(n),r=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.arrowSettings),t.author=t.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("measure",e),o=this.pdfViewer.arrowSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,s="PolyLineDimension",a="Polyline",l=""!==this.pdfViewer.arrowSettings.subject?this.pdfViewer.arrowSettings.subject:""!==this.pdfViewer.annotationSettings.subject?this.pdfViewer.annotationSettings.subject:"Perimeter calculation",h=!0,d=t.vertexPoints||[{x:i.x,y:i.y},{x:i.x+85,y:i.y},{x:i.x+86,y:i.y+62}],t.width=t.width||1,t.height=t.height||1):"Area"===e?(n=this.pdfViewer.rectangleSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(n),r=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.rectangleSettings),t.author=t.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("measure",e),o=this.pdfViewer.rectangleSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,s="PolygonDimension",a="Polygon",l=""!==this.pdfViewer.rectangleSettings.subject?this.pdfViewer.rectangleSettings.subject:""!==this.pdfViewer.annotationSettings.subject?this.pdfViewer.annotationSettings.subject:"Area calculation",d=t.vertexPoints||[{x:i.x,y:i.y},{x:i.x+88,y:i.y-1},{x:i.x+89,y:i.y+53},{x:i.x,y:i.y}],t.width=t.width||1,t.height=t.height||1):"Radius"===e?(n=this.pdfViewer.circleSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(n),r=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.circleSettings),t.author=t.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("measure",e),o=this.pdfViewer.circleSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,s="PolygonRadius",a="Circle",l=""!==this.pdfViewer.circleSettings.subject?this.pdfViewer.circleSettings.subject:""!==this.pdfViewer.annotationSettings.subject?this.pdfViewer.annotationSettings.subject:"Radius calculation",t.width=t.width||100,t.height=t.height||100,d=null):"Volume"===e&&(n=this.pdfViewer.polygonSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(n),r=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.polygonSettings),t.author=t.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("measure",e),o=this.pdfViewer.polygonSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,s="PolygonVolume",a="Polygon",l=""!==this.pdfViewer.polygonSettings.subject?this.pdfViewer.polygonSettings.subject:""!==this.pdfViewer.annotationSettings.subject?this.pdfViewer.annotationSettings.subject:"Volume calculation",d=t.vertexPoints||[{x:i.x,y:i.y},{x:i.x,y:i.y+109},{x:i.x+120,y:i.y+109},{x:i.x+120,y:i.y-1},{x:i.x,y:i.y}],t.width=t.width||1,t.height=t.height||1),r.isLock=t.isLock||r.isLock,r.minHeight=t.minHeight||r.minHeight,r.minWidth=t.minWidth||r.minWidth,r.maxWidth=t.maxWidth||r.maxWidth,r.maxHeight=t.maxHeight||r.maxHeight;var u=96,g=.013888888888888888,m=1,f="in",y="";if(d||"Radius"===e||"Volume"===e)if("Distance"===e||"Perimeter"===e||"Radius"===e){var v=0;if("Radius"===e)v=t.width/2*this.pixelToPointFactor;else{for(var b=0;b<d.length-1;b++)v+=Math.sqrt(Math.pow(d[parseInt(b.toString(),10)].x-d[b+1].x,2)+Math.pow(d[parseInt(b.toString(),10)].y-d[b+1].y,2));v*=this.pixelToPointFactor}y=this.convertPointToUnits(g,v*m,f)}else if("Area"===e||"Volume"===e){for(var w=0,C=d.length-1,b=0;b<d.length;b++)w+=(d[parseInt(C.toString(),10)].x*this.pixelToPointFactor*g+d[parseInt(b.toString(),10)].x*this.pixelToPointFactor*g)*(d[parseInt(C.toString(),10)].y*this.pixelToPointFactor*g-d[parseInt(b.toString(),10)].y*this.pixelToPointFactor*g),C=b;w=Math.abs(w/2),y="Volume"===e?(w=w*(u*this.convertUnitToPoint(f)*g)*m,Math.round(100*w)/100+this.pdfViewer.localeObj.getConstant("cu")+" "+this.pdfViewer.localeObj.getConstant(f)):Math.round(100*w)/100+this.pdfViewer.localeObj.getConstant("sq")+" "+this.pdfViewer.localeObj.getConstant(f)}d=d&&this.pdfViewer.annotation.getVertexPointsXY(d),e=[],u={AllowedInteractions:t.allowedInteractions||o,AnnotName:c,AnnotType:"shape_measure",AnnotationSelectorSettings:t.annotationSelectorSettings||n,AnnotationSettings:r,Author:t.author||"Guest",BorderDashArray:t.borderDashArray||0,BorderStyle:"Solid",Bounds:{X:i.x,Y:i.y,Width:t.width,Height:t.height,Left:i.x,Top:i.y,Location:{X:i.x,Y:i.y},Size:{Height:t.height,IsEmpty:!1,Width:t.width}},Calibrate:{Area:[{ConversionFactor:1,Denominator:100,FormatDenominator:!1,FractionalType:"D",Unit:"sq in"}],Depth:t.depth||0,Distance:[{ConversionFactor:1,Denominator:100,FormatDenominator:!1,FractionalType:"D",Unit:"in"}],Ratio:"1 in = 1 in",TargetUnitConversion:0,Volume:null,X:[{ConversionFactor:.013888889,Denominator:100,FormatDenominator:!1,FractionalType:"D",Unit:"in"}]},Caption:!0,CaptionPosition:"Top",CloudIntensity:0,Comments:null,CustomData:t.customData||null,CreatedDate:p,EnableShapeLabel:!1,ExistingCustomData:null,FillColor:t.fillColor||"#ffffff00",FontColor:null,FontSize:0,Indent:s,IsCloudShape:!1,IsCommentLock:!1,IsLocked:t.isLock||!1,IsPrint:!!je(t.isPrint)||t.isPrint,LabelBorderColor:null,LabelBounds:{X:0,Y:0,Width:0,Height:0},LabelContent:null,LabelFillColor:null,LabelSettings:null,LeaderLength:t.leaderLength||0,LeaderLineExtension:0,LeaderLineOffset:0,LineHeadStart:t.lineHeadStartStyle||(h?"ClosedArrow":"None"),LineHeadEnd:t.lineHeadEndStyle||(h?"ClosedArrow":"None"),ModifiedDate:"",Note:y,Opacity:t.opacity||1,RectangleDifference:[],RotateAngle:"RotateAngle0",ShapeAnnotationType:a,State:"",StateModel:"",StrokeColor:t.strokeColor||"#ff0000",Subject:t.subject||l,Thickness:t.thickness||1,VertexPoints:d};return e[0]=u,{measureShapeAnnotation:e}};var pAt=cAt;function cAt(e,t){this.measureShapeCount=0,this.isAddAnnotationProgramatically=!1,this.pdfViewer=e,this.pdfViewerBase=t}gAt.prototype.renderShapeAnnotations=function(e,t,i,n){if(e)if(1<=e.length){if(!this.pdfViewer.annotation.getStoredAnnotations(t,e,"_annotations_shape")||n||i)for(var o=0;o<e.length;o++){var r=e[parseInt(o.toString(),10)],s=(r.annotationAddMode=this.pdfViewer.annotationModule.findAnnotationMode(r,t,r.AnnotType),null),a=(this.shapeCount=this.shapeCount+1,void 0);if(r.ShapeAnnotationType){i&&this.pdfViewerBase.isJsonImported&&(r.Bounds=this.pdfViewerBase.importJsonForRotatedDocuments(r.Rotate,t,r.Bounds,r.AnnotationRotation),a=this.pdfViewerBase.isPageRotated);var l=null;if(r.VertexPoints)if(l=[],i&&this.pdfViewerBase.isJsonImported)l=this.pdfViewerBase.calculateVertexPoints(r.Rotate,t,r.VertexPoints,r.AnnotationRotation);else for(var h=0;h<r.VertexPoints.length;h++){var d=r.VertexPoints[parseInt(h.toString(),10)].X?r.VertexPoints[parseInt(h.toString(),10)].X:r.VertexPoints[parseInt(h.toString(),10)].x,p=r.VertexPoints[parseInt(h.toString(),10)].Y?r.VertexPoints[parseInt(h.toString(),10)].Y:r.VertexPoints[parseInt(h.toString(),10)].y;l.push({x:d,y:p})}r.Bounds&&!0===r.EnableShapeLabel&&(r.LabelBounds=this.pdfViewer.annotationModule.inputElementModule.calculateLabelBoundsFromLoadedDocument(r.Bounds),r.LabelBorderColor=r.LabelBorderColor||r.StrokeColor,r.FontColor=r.FontColor||r.StrokeColor,r.LabelFillColor=r.LabelFillColor||r.FillColor,r.FontSize=r.FontSize||16,r.LabelSettings=r.LabelSettings||this.pdfViewer.shapeLabelSettings);var c="string"==typeof r.AnnotationSelectorSettings?JSON.parse(r.AnnotationSelectorSettings):r.AnnotationSelectorSettings,c=(je(c)?this.pdfViewerBase.annotationSelectorSettingLoad(r):r.AnnotationSelectorSettings=c,r.AnnotationSettings=r.AnnotationSettings||this.pdfViewer.annotationModule.updateAnnotationSettings(r),r.IsLocked&&(r.AnnotationSettings.isLock=r.IsLocked),r.allowedInteractions=r.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(r),r.Bounds.X||r.Bounds.x),u=r.Bounds.Y||r.Bounds.y,g=r.Bounds.Width||r.Bounds.width,m=r.Bounds.Height||r.Bounds.height,c=(s={id:"shape"+this.shapeCount,shapeAnnotationType:r.ShapeAnnotationType,author:r.Author,allowedInteractions:r.allowedInteractions,modifiedDate:r.ModifiedDate,subject:r.Subject,pageNumber:t,note:r.Note,strokeColor:r.StrokeColor,fillColor:r.FillColor,opacity:r.Opacity,thickness:r.Thickness,rectangleDifference:r.RectangleDifference,borderStyle:r.BorderStyle,borderDashArray:r.BorderDashArray,rotateAngle:r.RotateAngle,isCloudShape:r.IsCloudShape,cloudIntensity:r.CloudIntensity,vertexPoints:l,lineHeadStart:r.LineHeadStart,lineHeadEnd:r.LineHeadEnd,isLocked:r.IsLocked,comments:this.pdfViewer.annotationModule.getAnnotationComments(r.Comments,r,r.Author),review:{state:r.State,stateModel:r.StateModel,modifiedDate:r.ModifiedDate,author:r.Author},annotName:r.AnnotName,bounds:{left:c,top:u,width:g,height:m,right:r.Bounds.Right,bottom:r.Bounds.Bottom},labelContent:r.LabelContent,enableShapeLabel:r.EnableShapeLabel,labelFillColor:r.LabelFillColor,fontColor:r.FontColor,labelBorderColor:r.LabelBorderColor,fontSize:r.FontSize,labelBounds:r.LabelBounds,annotationSelectorSettings:this.getSettings(r),labelSettings:r.LabelSettings,annotationSettings:r.AnnotationSettings,customData:this.pdfViewer.annotation.getCustomData(r),isPrint:r.IsPrint,isCommentLock:r.IsCommentLock,isAnnotationRotated:a}).vertexPoints,u=(null==l&&(c=[]),r.AnnotationSelectorSettings=r.AnnotationSelectorSettings?"string"==typeof r.AnnotationSelectorSettings?JSON.parse(r.AnnotationSelectorSettings):r.AnnotationSelectorSettings:this.pdfViewer.annotationSelectorSettings,{id:"shape"+this.shapeCount,shapeAnnotationType:this.getShapeType(s),author:s.author,allowedInteractions:s.allowedInteractions,modifiedDate:s.modifiedDate,annotName:s.annotName,subject:s.subject,notes:s.note,fillColor:s.fillColor,strokeColor:s.strokeColor,opacity:s.opacity,thickness:s.thickness,borderStyle:s.borderStyle,borderDashArray:s.borderDashArray?s.borderDashArray.toString():"0",rotateAngle:parseFloat(s.rotateAngle.split("Angle")[1]),comments:s.comments,review:s.review,isCloudShape:s.isCloudShape,cloudIntensity:s.cloudIntensity,taregetDecoraterShapes:this.pdfViewer.annotation.getArrowType(s.lineHeadEnd),sourceDecoraterShapes:this.pdfViewer.annotation.getArrowType(s.lineHeadStart),vertexPoints:c,bounds:{x:s.bounds.left,y:s.bounds.top,width:s.bounds.width,height:s.bounds.height},pageIndex:s.pageNumber,labelContent:r.LabelContent,enableShapeLabel:r.EnableShapeLabel,labelFillColor:r.LabelFillColor,fontColor:r.FontColor,labelBorderColor:r.LabelBorderColor,fontSize:r.FontSize,labelBounds:r.LabelBounds,annotationSelectorSettings:r.AnnotationSelectorSettings,annotationSettings:s.annotationSettings,annotationAddMode:r.annotationAddMode,isPrint:r.IsPrint,isCommentLock:s.isCommentLock,customData:s.customData});this.pdfViewer.add(u);this.pdfViewer.annotationModule.storeAnnotations(t,s,"_annotations_shape"),this.isAddAnnotationProgramatically&&(g={opacity:u.opacity,strokeColor:u.strokeColor,thickness:u.thickness,modifiedDate:u.modifiedDate,width:u.bounds.width,height:u.bounds.height},this.pdfViewer.fireAnnotationAdd(u.pageIndex,u.annotName,r.ShapeAnnotationType,u.bounds,g))}}}else e.shapeAnnotationType&&(s=this.createAnnotationObject(e),je(e.formFieldAnnotationType)||""===e.formFieldAnnotationType?this.pdfViewer.annotationModule.isFormFieldShape=!1:this.pdfViewer.annotationModule.isFormFieldShape=!0,this.pdfViewer.annotationModule.storeAnnotations(t,s,"_annotations_shape"),e&&(e.customData=s.customData),this.pdfViewer.annotationModule.triggerAnnotationAdd(e))},gAt.prototype.getSettings=function(e){this.pdfViewer.annotationSelectorSettings;return e.AnnotationSelectorSettings?"string"==typeof e.AnnotationSelectorSettings?JSON.parse(e.AnnotationSelectorSettings):e.AnnotationSelectorSettings:this.getSelector(e.ShapeAnnotationType,e.Subject)},gAt.prototype.setAnnotationType=function(e){this.updateShapeProperties(),this.pdfViewerBase.disableTextSelectionMode();var t="Guest",i="";switch(e){case"Line":this.currentAnnotationMode="Line";var n=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),t="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.lineSettings.author||"Guest",i=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.lineSettings.subject||"Line":this.pdfViewer.annotationSettings.subject,o=je(this.pdfViewer.annotationSettings.customData)?this.pdfViewer.lineSettings.customData||null:this.pdfViewer.annotationSettings.customData;this.pdfViewer.drawingObject={shapeAnnotationType:this.setShapeType("Line"),fillColor:this.lineFillColor,notes:"",strokeColor:this.lineStrokeColor,opacity:this.lineOpacity,thickness:this.lineThickness,modifiedDate:n,borderDashArray:this.lineDashArray.toString(),sourceDecoraterShapes:this.pdfViewer.annotation.getArrowType(this.lineStartHead.toString()),taregetDecoraterShapes:this.pdfViewer.annotation.getArrowType(this.lineEndHead.toString()),author:t,subject:i,lineHeadStart:this.lineStartHead,lineHeadEnd:this.lineEndHead,isCommentLock:!1,customData:o},this.pdfViewer.tool="Line";break;case"Arrow":this.currentAnnotationMode="Arrow";n=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime();t="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.arrowSettings.author||"Guest",i=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.arrowSettings.subject||"Arrow":this.pdfViewer.annotationSettings.subject,o=je(this.pdfViewer.annotationSettings.customData)?this.pdfViewer.arrowSettings.customData||null:this.pdfViewer.annotationSettings.customData,this.pdfViewer.drawingObject={shapeAnnotationType:this.setShapeType("Arrow"),opacity:this.arrowOpacity,sourceDecoraterShapes:this.pdfViewer.annotation.getArrowType(this.arrowStartHead.toString()),taregetDecoraterShapes:this.pdfViewer.annotation.getArrowType(this.arrowEndHead.toString()),fillColor:this.arrowFillColor,strokeColor:this.arrowStrokeColor,notes:"",thickness:this.arrowThickness,borderDashArray:this.arrowDashArray.toString(),author:t,subject:i,modifiedDate:n,lineHeadStart:this.arrowStartHead,lineHeadEnd:this.arrowEndHead,isCommentLock:!1,customData:o},this.pdfViewer.tool="Line";break;case"Rectangle":this.currentAnnotationMode="Rectangle";n=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime();t="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.rectangleSettings.author||"Guest",i=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.rectangleSettings.subject||"Rectangle":this.pdfViewer.annotationSettings.subject,o=je(this.pdfViewer.annotationSettings.customData)?this.pdfViewer.rectangleSettings.customData||null:this.pdfViewer.annotationSettings.customData,this.pdfViewer.drawingObject={shapeAnnotationType:this.setShapeType("Rectangle"),strokeColor:this.rectangleStrokeColor,fillColor:this.rectangleFillColor,opacity:this.rectangleOpacity,notes:"",thickness:this.rectangleThickness,borderDashArray:"0",modifiedDate:n,author:t,subject:i,isCommentLock:!1,customData:o},this.pdfViewer.tool="DrawTool";break;case"Circle":this.currentAnnotationMode="Circle";n=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime();t="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.circleSettings.author||"Guest",i=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.circleSettings.subject||"Circle":this.pdfViewer.annotationSettings.subject,o=je(this.pdfViewer.annotationSettings.customData)?this.pdfViewer.circleSettings.customData||null:this.pdfViewer.annotationSettings.customData,this.pdfViewer.drawingObject={shapeAnnotationType:this.setShapeType("Circle"),strokeColor:this.circleStrokeColor,fillColor:this.circleFillColor,opacity:this.circleOpacity,notes:"",thickness:this.circleThickness,borderDashArray:"0",modifiedDate:n,author:t,subject:i,isCommentLock:!1,customData:o},this.pdfViewer.tool="DrawTool";break;case"Polygon":this.currentAnnotationMode="Polygon";n=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime();t="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.polygonSettings.author||"Guest",i=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.polygonSettings.subject||"Polygon":this.pdfViewer.annotationSettings.subject,o=je(this.pdfViewer.annotationSettings.customData)?this.pdfViewer.polygonSettings.customData||null:this.pdfViewer.annotationSettings.customData,this.pdfViewer.drawingObject={strokeColor:this.polygonStrokeColor,fillColor:this.polygonFillColor,opacity:this.polygonOpacity,thickness:this.polygonThickness,borderDashArray:"0",notes:"",author:t,subject:i,modifiedDate:n,borderStyle:"",isCommentLock:!1,customData:o},this.pdfViewer.tool="Polygon"}},gAt.prototype.updateShapeProperties=function(){this.lineFillColor=this.pdfViewer.lineSettings.fillColor||"#ffffff00",this.lineStrokeColor=this.pdfViewer.lineSettings.strokeColor||"#ff0000",this.lineThickness=this.pdfViewer.lineSettings.thickness||1,this.lineOpacity=this.pdfViewer.lineSettings.opacity||1,this.lineDashArray=this.pdfViewer.lineSettings.borderDashArray||0,this.lineStartHead=this.pdfViewer.lineSettings.lineHeadStartStyle||"None",this.lineEndHead=this.pdfViewer.lineSettings.lineHeadEndStyle||"None",this.arrowFillColor=this.pdfViewer.arrowSettings.fillColor||"#ffffff00",this.arrowStrokeColor=this.pdfViewer.arrowSettings.strokeColor||"#ff0000",this.arrowThickness=this.pdfViewer.arrowSettings.thickness||1,this.arrowOpacity=this.pdfViewer.arrowSettings.opacity||1,this.arrowDashArray=this.pdfViewer.arrowSettings.borderDashArray||0,this.arrowStartHead=this.pdfViewer.arrowSettings.lineHeadStartStyle||"Closed",this.arrowEndHead=this.pdfViewer.arrowSettings.lineHeadEndStyle||"Closed",this.rectangleFillColor=this.pdfViewer.rectangleSettings.fillColor||"#ffffff00",this.rectangleStrokeColor=this.pdfViewer.rectangleSettings.strokeColor||"#ff0000",this.rectangleThickness=this.pdfViewer.rectangleSettings.thickness||1,this.rectangleOpacity=this.pdfViewer.rectangleSettings.opacity||1,this.circleFillColor=this.pdfViewer.circleSettings.fillColor||"#ffffff00",this.circleStrokeColor=this.pdfViewer.circleSettings.strokeColor||"#ff0000",this.circleThickness=this.pdfViewer.circleSettings.thickness||1,this.circleOpacity=this.pdfViewer.circleSettings.opacity||1,this.polygonFillColor=this.pdfViewer.polygonSettings.fillColor||"#ffffff00",this.polygonStrokeColor=this.pdfViewer.polygonSettings.strokeColor||"#ff0000",this.polygonThickness=this.pdfViewer.polygonSettings.thickness||1,this.polygonOpacity=this.pdfViewer.polygonSettings.opacity||1},gAt.prototype.setShapeType=function(e){var t;switch(e){case"Line":t="Line";break;case"Circle":t="Ellipse";break;case"Square":t="Rectangle";break;case"Polyline":t="Line";break;case"Arrow":t="LineWidthArrowHead"}return t},gAt.prototype.getShapeType=function(e){var t;switch(e.shapeAnnotationType){case"Line":t="Line";break;case"Circle":t="Ellipse";break;case"Square":t="Rectangle";break;case"Polyline":t="Line";break;case"Polygon":t="Polygon"}return t="Line"!==e.shapeAnnotationType&&"Polyline"!==e.shapeAnnotationType||"None"===e.lineHeadStart&&"None"===e.lineHeadEnd?t:"LineWidthArrowHead"},gAt.prototype.getShapeAnnotType=function(e){var t;switch(e){case"Line":case"LineWidthArrowHead":t="Line";break;case"Rectangle":t="Square";break;case"Ellipse":t="Circle";break;case"Polygon":t="Polygon"}return t},gAt.prototype.modifyInCollection=function(e,t,i,n){je(i.formFieldAnnotationType)||""===i.formFieldAnnotationType?this.pdfViewer.annotationModule.isFormFieldShape=!1:this.pdfViewer.annotationModule.isFormFieldShape=!0,n&&this.pdfViewerBase.updateDocumentEditedProperty(!0);var o=null,r=(i&&"bounds"===e&&this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateAnnotationModifiedDate(i,!0),this.getAnnotations(t,null));if(null!=r&&i){for(var s,a,l,h=0;h<r.length;h++)if(i.id===r[parseInt(h.toString(),10)].id){if("bounds"===e)this.pdfViewerBase.isBounds=this.pdfViewerBase.boundsCalculation(r[parseInt(h.toString(),10)].bounds,i.wrapper.bounds),this.pdfViewerBase.isBounds&&("Line"!==r[parseInt(h.toString(),10)].shapeAnnotationType&&"Polygon"!==r[parseInt(h.toString(),10)].shapeAnnotationType||(r[parseInt(h.toString(),10)].vertexPoints=i.vertexPoints),r[parseInt(h.toString(),10)].bounds={left:i.bounds.x,top:i.bounds.y,width:i.bounds.width,height:i.bounds.height,right:i.bounds.right,bottom:i.bounds.bottom}),!0===r[parseInt(h.toString(),10)].enableShapeLabel&&i.wrapper&&(l=a=s=0,i.wrapper.bounds.width&&(l=0<(l=i.wrapper.bounds.width/2)&&l<151?l:151),i.wrapper.bounds.left&&(a=i.wrapper.bounds.left+i.wrapper.bounds.width/2-l/2),i.wrapper.bounds.top&&(s=i.wrapper.bounds.top+i.wrapper.bounds.height/2-12.3),r[parseInt(h.toString(),10)].labelBounds={left:a,top:s,width:l,height:24.6,right:0,bottom:0});else if("fill"===e)r[parseInt(h.toString(),10)].fillColor=i.wrapper.children[0].style.fill;else if("stroke"===e)r[parseInt(h.toString(),10)].strokeColor=i.wrapper.children[0].style.strokeColor;else if("opacity"===e)r[parseInt(h.toString(),10)].opacity=i.wrapper.children[0].style.opacity;else if("thickness"===e)r[parseInt(h.toString(),10)].thickness=i.wrapper.children[0].style.strokeWidth;else if("dashArray"===e)r[parseInt(h.toString(),10)].borderDashArray=i.wrapper.children[0].style.strokeDashArray,r[parseInt(h.toString(),10)].borderStyle=i.borderStyle;else if("startArrow"===e)r[parseInt(h.toString(),10)].lineHeadStart=this.pdfViewer.annotation.getArrowTypeForCollection(i.sourceDecoraterShapes);else if("endArrow"===e)r[parseInt(h.toString(),10)].lineHeadEnd=this.pdfViewer.annotation.getArrowTypeForCollection(i.taregetDecoraterShapes);else if("notes"===e)r[parseInt(h.toString(),10)].note=i.notes;else{if("delete"===e){o=r.splice(h,1)[0];break}if("labelContent"===e){r[parseInt(h.toString(),10)].note=i.labelContent,r[parseInt(h.toString(),10)].labelContent=i.labelContent;break}"fontColor"===e?r[parseInt(h.toString(),10)].fontColor=i.fontColor:"fontSize"===e&&(r[parseInt(h.toString(),10)].fontSize=i.fontSize)}this.pdfViewerBase.isBounds&&(r[parseInt(h.toString(),10)].modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime()),this.pdfViewer.annotationModule.storeAnnotationCollections(r[parseInt(h.toString(),10)],t)}this.manageAnnotations(r,t)}return o},gAt.prototype.addInCollection=function(e,t){var i=this.getAnnotations(e,null);i&&i.push(t),this.manageAnnotations(i,e)},gAt.prototype.saveShapeAnnotations=function(){for(var e=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_shape"),t=(this.pdfViewerBase.isStorageExceed&&(e=this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_shape"]),[]),i=0;i<this.pdfViewerBase.pageCount;i++)t[parseInt(i.toString(),10)]=[];if(e&&!this.pdfViewer.annotationSettings.skipDownload)for(var n=JSON.parse(e),o=0;o<n.length;o++){var r=[],s=n[parseInt(o.toString(),10)];if(s){for(var a,l,h,d=0;s.annotations.length>d;d++)this.pdfViewerBase.checkFormFieldCollection(s.annotations[parseInt(d.toString(),10)].id)?s.annotations[parseInt(d.toString(),10)]="":(this.pdfViewer.annotationModule.updateModifiedDate(s.annotations[parseInt(d.toString(),10)]),this.pdfViewerBase.isJsonExported&&(s.annotations[parseInt(d.toString(),10)].isAnnotationRotated?(s.annotations[parseInt(d.toString(),10)].bounds=this.pdfViewer.annotation.getBounds(s.annotations[parseInt(d.toString(),10)].bounds,s.pageIndex),s.annotations[parseInt(d.toString(),10)].vertexPoints=this.pdfViewer.annotation.getVertexPoints(s.annotations[parseInt(d.toString(),10)].vertexPoints,s.pageIndex)):(a=this.pdfViewerBase.pageSize[s.pageIndex])&&(s.annotations[parseInt(d.toString(),10)].annotationRotation=a.rotation)),s.annotations[parseInt(d.toString(),10)].bounds=JSON.stringify(this.pdfViewer.annotation.getBounds(s.annotations[parseInt(d.toString(),10)].bounds,s.pageIndex)),a=s.annotations[parseInt(d.toString(),10)].strokeColor,s.annotations[parseInt(d.toString(),10)].strokeColor=JSON.stringify(this.getRgbCode(a)),je(l=s.annotations[parseInt(d.toString(),10)].fillColor)?s.annotations[parseInt(d.toString(),10)].fillColor="transparent":s.annotations[parseInt(d.toString(),10)].fillColor=JSON.stringify(this.getRgbCode(l)),s.annotations[parseInt(d.toString(),10)].vertexPoints=JSON.stringify(this.pdfViewer.annotation.getVertexPoints(s.annotations[parseInt(d.toString(),10)].vertexPoints,s.pageIndex)),null!==s.annotations[parseInt(d.toString(),10)].rectangleDifference&&(s.annotations[parseInt(d.toString(),10)].rectangleDifference=JSON.stringify(s.annotations[parseInt(d.toString(),10)].rectangleDifference)),!0===s.annotations[parseInt(d.toString(),10)].enableShapeLabel&&(s.annotations[parseInt(d.toString(),10)].labelBounds=JSON.stringify(this.pdfViewer.annotationModule.inputElementModule.calculateLabelBounds(JSON.parse(s.annotations[parseInt(d.toString(),10)].bounds))),l=s.annotations[parseInt(d.toString(),10)].labelFillColor,s.annotations[parseInt(d.toString(),10)].labelFillColor=JSON.stringify(this.getRgbCode(l)),h=s.annotations[parseInt(d.toString(),10)].labelBorderColor,s.annotations[parseInt(d.toString(),10)].labelBorderColor=JSON.stringify(this.getRgbCode(h)),s.annotations[parseInt(d.toString(),10)].labelSettings.fillColor=l,h=s.annotations[parseInt(d.toString(),10)].labelSettings.fontColor,s.annotations[parseInt(d.toString(),10)].fontColor=JSON.stringify(this.getRgbCode(h))));s.annotations=s.annotations.filter(function(e){return e}),r=s.annotations}t[s.pageIndex]=r}return JSON.stringify(t)},gAt.prototype.manageAnnotations=function(e,t){var i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_shape");(i=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_shape"]:i)&&(i=JSON.parse(i),this.pdfViewerBase.isStorageExceed||ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_shape"),null!=(t=this.pdfViewer.annotationModule.getPageCollection(i,t))&&i[parseInt(t.toString(),10)]&&(i[parseInt(t.toString(),10)].annotations=e),t=JSON.stringify(i),this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_shape"]=t:ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_shape",t))},gAt.prototype.createAnnotationObject=function(e){var t,i,n=this.pdfViewer.annotation.createGUID(),o=(e.formFieldAnnotationType||(i=this.pdfViewer.annotation.stickyNotesAnnotationModule.addComments("shape",e.pageIndex+1,e.shapeAnnotationType))&&(document.getElementById(i).id=n),e.annotName=n,i=e.wrapper.bounds?(t={left:e.wrapper.bounds.x,top:e.wrapper.bounds.y,height:e.wrapper.bounds.height,width:e.wrapper.bounds.width,right:e.wrapper.bounds.right,bottom:e.wrapper.bounds.bottom},this.pdfViewer.annotationModule.inputElementModule.calculateLabelBounds(e.wrapper.bounds)):(t={left:0,top:0,height:0,width:0,right:0,bottom:0},{left:0,top:0,height:0,width:0,right:0,bottom:0}),"Line"===e.subject&&"Polygon"===e.shapeAnnotationType?e.author=this.pdfViewer.annotationModule.updateAnnotationAuthor("shape","Polygon"):e.author=e&&"Guest"!=e.author?e.author:this.pdfViewer.annotationModule.updateAnnotationAuthor("shape",e.subject),this.pdfViewer.annotation.stickyNotesAnnotationModule.addTextToComments(n,e.notes),parseInt(e.borderDashArray,10)),o=isNaN(o)?0:o,r=this.pdfViewer.annotationModule.findAnnotationSettings(e,!0),s=(e.isPrint=r.isPrint,this.pdfViewer.shapeLabelSettings),s={borderColor:e.strokeColor,fillColor:e.fillColor,fontColor:e.fontColor,fontSize:e.fontSize,labelContent:e.labelContent,labelHeight:s.labelHeight,labelWidth:s.labelMaxWidth,opacity:e.opacity};return{id:e.id,shapeAnnotationType:this.getShapeAnnotType(e.shapeAnnotationType),author:e.author,allowedInteractions:this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e),subject:e.subject,note:e.notes,strokeColor:e.strokeColor,annotName:n,comments:[],review:{state:"",stateModel:"",modifiedDate:this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),author:e.author},fillColor:e.fillColor,opacity:e.opacity,thickness:e.thickness,pageNumber:e.pageIndex,borderStyle:e.borderStyle,borderDashArray:o,bounds:t,modifiedDate:this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),rotateAngle:"RotateAngle"+e.rotateAngle,isCloudShape:e.isCloudShape,cloudIntensity:e.cloudIntensity,vertexPoints:e.vertexPoints,lineHeadStart:this.pdfViewer.annotation.getArrowTypeForCollection(e.sourceDecoraterShapes),lineHeadEnd:this.pdfViewer.annotation.getArrowTypeForCollection(e.taregetDecoraterShapes),rectangleDifference:[],isLocked:r.isLock,labelContent:e.labelContent,enableShapeLabel:e.enableShapeLabel,labelFillColor:e.labelFillColor,fontColor:e.fontColor,labelBorderColor:e.labelBorderColor,fontSize:e.fontSize,labelBounds:i,annotationSelectorSettings:this.getSelector(e.shapeAnnotationType,e.subject),labelSettings:s,annotationSettings:r,customData:this.pdfViewer.annotation.getShapeData(e.shapeAnnotationType,e.subject),isPrint:e.isPrint,isCommentLock:e.isCommentLock,isAnnotationRotated:!1}},gAt.prototype.getSelector=function(e,t){var i=this.pdfViewer.annotationSelectorSettings;return"Line"===e&&"Arrow"!==t&&this.pdfViewer.lineSettings.annotationSelectorSettings?i=this.pdfViewer.lineSettings.annotationSelectorSettings:"LineWidthArrowHead"!==e&&"Arrow"!==t||!this.pdfViewer.lineSettings.annotationSelectorSettings?"Rectangle"!==e&&"Square"!==e||!this.pdfViewer.rectangleSettings.annotationSelectorSettings?"Ellipse"!==e&&"Circle"!==e||!this.pdfViewer.circleSettings.annotationSelectorSettings?"Polygon"===e&&this.pdfViewer.polygonSettings.annotationSelectorSettings&&(i=this.pdfViewer.polygonSettings.annotationSelectorSettings):i=this.pdfViewer.circleSettings.annotationSelectorSettings:i=this.pdfViewer.rectangleSettings.annotationSelectorSettings:i=this.pdfViewer.arrowSettings.annotationSelectorSettings,i},gAt.prototype.getAnnotations=function(e,t){var i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_shape");return(i=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_shape"]:i)&&(i=JSON.parse(i),null!=(e=this.pdfViewer.annotationModule.getPageCollection(i,e)))&&i[parseInt(e.toString(),10)]?i[parseInt(e.toString(),10)].annotations:t},gAt.prototype.getRgbCode=function(e){var t=(e=e.match(/#([a-z0-9]+)/gi)||e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/)?e:this.pdfViewer.annotationModule.nameToHash(e)).split(",");return je(t[1])&&(t=(e=this.pdfViewer.annotationModule.getValue(e,"rgba")).split(",")),{r:parseInt(t[0].split("(")[1],10),g:parseInt(t[1],10),b:parseInt(t[2],10),a:parseFloat(t[3])}},gAt.prototype.saveImportedShapeAnnotations=function(e,t){var i,n=null;if(e.Author=this.pdfViewer.annotationModule.updateAnnotationAuthor("shape",e.Subject),e.VertexPoints)for(var n=[],o=0;o<e.VertexPoints.length;o++){var r={x:e.VertexPoints[parseInt(o.toString(),10)].X,y:e.VertexPoints[parseInt(o.toString(),10)].Y};n.push(r)}e.Bounds&&!0===e.EnableShapeLabel&&(e.LabelBounds=this.pdfViewer.annotationModule.inputElementModule.calculateLabelBoundsFromLoadedDocument(e.Bounds),e.LabelBorderColor=e.LabelBorderColor||e.StrokeColor,e.FontColor=e.FontColor||e.StrokeColor,e.LabelFillColor=e.LabelFillColor||e.FillColor,e.FontSize=e.FontSize||16,e.LabelSettings=e.LabelSettings||this.pdfViewer.shapeLabelSettings),e.AnnotationSettings=e.AnnotationSettings||this.pdfViewer.annotationModule.updateAnnotationSettings(e),e.allowedInteractions=e.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e),i={id:"shape",shapeAnnotationType:e.ShapeAnnotationType,author:e.Author,allowedInteractions:e.allowedInteractions,modifiedDate:e.ModifiedDate,subject:e.Subject,pageNumber:t,note:e.Note,strokeColor:e.StrokeColor,fillColor:e.FillColor,opacity:e.Opacity,thickness:e.Thickness,rectangleDifference:e.RectangleDifference,borderStyle:e.BorderStyle,borderDashArray:e.BorderDashArray,rotateAngle:e.RotateAngle,isCloudShape:e.IsCloudShape,cloudIntensity:e.CloudIntensity,vertexPoints:n,lineHeadStart:e.LineHeadStart,lineHeadEnd:e.LineHeadEnd,isLocked:e.IsLocked,comments:this.pdfViewer.annotationModule.getAnnotationComments(e.Comments,e,e.Author),review:{state:e.State,stateModel:e.StateModel,modifiedDate:e.ModifiedDate,author:e.Author},annotName:e.AnnotName,bounds:{left:e.Bounds.X,top:e.Bounds.Y,width:e.Bounds.Width,height:e.Bounds.Height,right:e.Bounds.Right,bottom:e.Bounds.Bottom},labelContent:e.LabelContent,enableShapeLabel:e.EnableShapeLabel,labelFillColor:e.LabelFillColor,labelBorderColor:e.LabelBorderColor,fontColor:e.FontColor,fontSize:e.FontSize,labelBounds:e.LabelBounds,annotationSelectorSettings:this.getSettings(e),labelSettings:e.LabelSettings,annotationSettings:e.AnnotationSettings,customData:this.pdfViewer.annotation.getCustomData(e),isPrint:e.IsPrint,isCommentLock:e.IsCommentLock,isAnnotationRotated:!1},this.pdfViewer.annotationModule.storeAnnotations(t,i,"_annotations_shape")},gAt.prototype.updateShapeAnnotationCollections=function(e,t){var i,n=null;if(e.VertexPoints)for(var n=[],o=0;o<e.VertexPoints.length;o++){var r={x:e.VertexPoints[parseInt(o.toString(),10)].X,y:e.VertexPoints[parseInt(o.toString(),10)].Y};n.push(r)}return e.Bounds&&!0===e.EnableShapeLabel&&(e.LabelBounds=this.pdfViewer.annotationModule.inputElementModule.calculateLabelBoundsFromLoadedDocument(e.Bounds),e.LabelBorderColor=e.LabelBorderColor||e.StrokeColor,e.FontColor=e.FontColor||e.StrokeColor,e.LabelFillColor=e.LabelFillColor||e.FillColor,e.FontSize=e.FontSize||16,i=this.pdfViewer.shapeLabelSettings,i={borderColor:e.StrokeColor,fillColor:e.FillColor,fontColor:e.FontColor,fontSize:e.FontSize,labelContent:e.LabelContent,labelHeight:i.labelHeight,labelWidth:i.labelWidth,opacity:e.Opacity},e.LabelSettings=e.LabelSettings||i),e.AnnotationSettings=e.AnnotationSettings||this.pdfViewer.annotationModule.updateAnnotationSettings(e),e.IsLocked&&(e.AnnotationSettings.isLock=e.IsLocked),e.allowedInteractions=e.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e),{id:"shape",shapeAnnotationType:e.ShapeAnnotationType,author:e.Author,allowedInteractions:e.allowedInteractions,modifiedDate:e.ModifiedDate,subject:e.Subject,note:e.Note,strokeColor:e.StrokeColor,fillColor:e.FillColor,opacity:e.Opacity,thickness:e.Thickness,rectangleDifference:e.RectangleDifference,borderStyle:e.BorderStyle,borderDashArray:e.BorderDashArray,rotateAngle:e.RotateAngle,isCloudShape:e.IsCloudShape,cloudIntensity:e.CloudIntensity,vertexPoints:n,lineHeadStart:e.LineHeadStart,lineHeadEnd:e.LineHeadEnd,isLocked:e.IsLocked,comments:this.pdfViewer.annotationModule.getAnnotationComments(e.Comments,e,e.Author),review:{state:e.State,stateModel:e.StateModel,modifiedDate:e.ModifiedDate,author:e.Author},annotationId:e.AnnotName,bounds:{left:e.Bounds.X,top:e.Bounds.Y,width:e.Bounds.Width,height:e.Bounds.Height,right:e.Bounds.Right,bottom:e.Bounds.Bottom},labelContent:e.LabelContent,enableShapeLabel:e.EnableShapeLabel,labelFillColor:e.LabelFillColor,labelBorderColor:e.LabelBorderColor,fontColor:e.FontColor,fontSize:e.FontSize,labelBounds:e.LabelBounds,pageNumber:t,labelSettings:e.LabelSettings,annotationSettings:e.AnnotationSettings,customData:this.pdfViewer.annotation.getCustomData(e),isPrint:e.IsPrint,isCommentLock:e.IsCommentLock}},gAt.prototype.updateAddAnnotationDetails=function(e,t,i){i=t?t.offset||{x:10,y:10}:(t={offset:{x:10,y:10},pageNumber:0,width:void 0,height:void 0}).offset;var n=null,o=null,r=null,s="",a=!1,l=null,h=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),d=this.pdfViewer.annotation.createGUID(),p=("Line"===e?(n=this.pdfViewer.lineSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(n),r=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.lineSettings),t.author=t.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("shape",e),o=this.pdfViewer.lineSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,s="Line",l=t.vertexPoints||[{x:i.x,y:i.y},{x:i.x+100,y:i.y}],t.width=t.width||1,t.height=t.height||1):"Arrow"===e?(n=this.pdfViewer.arrowSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(n),r=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.arrowSettings),t.author=t.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("shape",e),o=this.pdfViewer.arrowSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,s="Line",a=!0,l=t.vertexPoints||[{x:i.x,y:i.y},{x:i.x+100,y:i.y}],t.width=t.width||1,t.height=t.height||1):"Rectangle"===e?(n=this.pdfViewer.rectangleSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(n),r=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.rectangleSettings),t.author=t.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("shape",e),o=this.pdfViewer.rectangleSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,s="Square",t.width=t.width||150,t.height=t.height||75):"Circle"===e?(n=this.pdfViewer.circleSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(n),r=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.circleSettings),t.author=t.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("shape",e),o=this.pdfViewer.circleSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,s="Circle",t.width=t.width||100,t.height=t.height||90):"Polygon"===e&&(n=this.pdfViewer.polygonSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(n),r=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.polygonSettings),t.author=t.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("shape",e),o=this.pdfViewer.polygonSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,s="Polygon",l=t.vertexPoints||[{x:i.x,y:i.y},{x:i.x+42,y:i.y-29},{x:i.x+89,y:i.y-1},{x:i.x+78,y:i.y+42},{x:i.x+11,y:i.y+42},{x:i.x,y:i.y}],t.width=t.width||1,t.height=t.height||1),r.isLock=t.isLock||r.isLock,r.minHeight=t.minHeight||r.minHeight,r.minWidth=t.minWidth||r.minWidth,r.maxWidth=t.maxWidth||r.maxWidth,r.maxHeight=t.maxHeight||r.maxHeight,l=l&&this.pdfViewer.annotation.getVertexPointsXY(l),[]),o={AllowedInteractions:t.allowedInteractions||o,AnnotName:d,AnnotType:"shape",AnnotationSelectorSettings:t.annotationSelectorSettings||n,AnnotationSettings:r,Author:t.author||"Guest",BorderDashArray:t.borderDashArray||0,BorderStyle:"Solid",Bounds:{X:i.x,Y:i.y,Width:t.width,Height:t.height,Left:i.x,Top:i.y,Location:{X:i.x,Y:i.y},Size:{Height:t.height,IsEmpty:!1,Width:t.width}},CloudIntensity:0,Comments:null,CustomData:t.customData||null,CreatedDate:h,EnableShapeLabel:!1,ExistingCustomData:null,FillColor:t.fillColor||"#ffffff00",FontColor:null,FontSize:0,IsCloudShape:!1,IsCommentLock:!1,IsLocked:t.isLock||!1,IsPrint:!!je(t.isPrint)||t.isPrint,LabelBorderColor:null,LabelBounds:{X:0,Y:0,Width:0,Height:0},LabelContent:null,LabelFillColor:null,LabelSettings:null,LineHeadStart:t.lineHeadStartStyle||(a?"ClosedArrow":"None"),LineHeadEnd:t.lineHeadEndStyle||(a?"ClosedArrow":"None"),ModifiedDate:"",Note:"",Opacity:t.opacity||1,RectangleDifference:null,RotateAngle:"RotateAngle0",ShapeAnnotationType:s,State:"",StateModel:"",StrokeColor:t.strokeColor||"#ff0000",Subject:t.subject||e.toString(),Thickness:t.thickness||1,VertexPoints:l};return p[0]=o,{shapeAnnotation:p}};var uAt=gAt;function gAt(e,t){this.shapeCount=0,this.isAddAnnotationProgramatically=!1,this.pdfViewer=e,this.pdfViewerBase=t}fAt.prototype.renderStampAnnotations=function(g,m,f,y,o){var v=this;return new Promise(function(u){var e=!1;if(!y)for(var t=0;t<v.stampPageNumber.length;t++)if(v.stampPageNumber[parseInt(t.toString(),10)]===m){e=!0;break}if(y&&(e=!1),g&&(!e||o)){v.stampPageNumber.push(m);for(var i=function(e){var a=g[parseInt(e.toString(),10)],l=(a.annotationAddMode=v.pdfViewer.annotationModule.findAnnotationMode(a,m,a.AnnotType),a.Apperarance),h=a.Rect,d=a.Opacity,p=parseFloat(g[parseInt(e.toString(),10)].pageNumber),e=(isNaN(p)&&(p=g[parseInt(e.toString(),10)].PageNumber),a.IsDynamic),t=(a.AnnotationSettings=a.AnnotationSettings||v.pdfViewer.annotationModule.updateSettings(v.pdfViewer.stampSettings),a.IsLocked&&(a.AnnotationSettings.isLock=a.IsLocked),v.stampImageData(a));if(e&&a.IconName&&"Draft"!==a.IconName&&!t&&(je(a.template)||""===a.template)){v.retrieveDynamicStampAnnotation(a.IconName),v.isExistingStamp=!0;for(var i=v.calculateImagePosition(h,!0),n=a.RotateAngle,o=0;o<l.length;o++){var r,s=l[parseInt(o.toString(),10)];"string"===s.type&&void 0!==s.text&&(r=void 0,2===(r=!y&&1<s.text.split("(").length?s.text.split("(")[1].split(")")[0]:s.text).split("(").length?r.split("(")[1].split(")")[0].toLowerCase()!==a.IconName.toLowerCase()&&(v.dynamicText+=r.split("(")[1].split(")")[0]):r.toLowerCase()!==a.IconName.toLowerCase()&&(v.dynamicText+=r))}v.renderStamp(i.left,i.top,i.width,i.height,p,d,n,f,a,!0),u()}else if(!a.IconName||t||!je(a.template)&&""!==a.template){if(l){for(var c=0;c<l.length;c++)!function(e){var t,i,e=l[parseInt(e.toString(),10)],n=e.imagedata,o=e.CreationDate,r=e.ModifiedDate,s=e.RotateAngle;n&&(t=new Image,i=v,t.onload=function(){var e=i.calculateImagePosition(h,!0);a.AnnotationSettings=a.AnnotationSettings||i.pdfViewer.customStampSettings.annotationSettings,i.renderCustomImage(e,p,t,o,r,s,d,f,!0,a),"image"===i.pdfViewer.annotationModule.annotationType&&(i.pdfViewer.annotation.selectAnnotationFromCodeBehind(),i.pdfViewer.annotationModule.annotationType=null),u()},t.src=n)}(c);0===l.length&&u()}}else{v.retrievestampAnnotation(a.IconName),v.isExistingStamp=!0;i=v.calculateImagePosition(h,!0),n=a.RotateAngle;v.renderStamp(i.left,i.top,i.width,i.height,p,d,n,f,a),v.isExistingStamp=!1,u()}},n=0;n<g.length;n++)i(n);0===g.length&&u()}})},fAt.prototype.renderStampAnnotImage=function(a,e,l,t,i,h,d){var p=a.Apperarance,c=a.Rect,u=a.Opacity,g=(a.AnnotationSelectorSettings,parseFloat(a.pageNumber));if(p)for(var m=this,n=0;n<p.length;n++)!function(e){var t,i,e=p[parseInt(e.toString(),10)],n=e.imagedata,o=e.CreationDate,r=e.ModifiedDate,s=e.RotateAngle;n&&(t=new Image,i=m,t.onload=function(){var e=i.calculateImagePosition(c,!0);a.AnnotationSettings=a.AnnotationSettings||i.pdfViewer.customStampSettings.annotationSettings,i.renderCustomImage(e,g,t,o,r,s,u,l,!0,a,null,h,d)},t.src=n)}(n)},fAt.prototype.moveStampElement=function(e,t,i){var n,o=this.pdfViewerBase.getZoomFactor(),o=(e/=o,t/=o,je(this.pdfViewer.annotationSettings.author)||"Guest"===this.pdfViewer.annotationSettings.author?this.pdfViewer.stampSettings.author||"Guest":this.pdfViewer.annotationSettings.author),o=(this.pdfViewerBase.isDynamicStamp&&(this.pdfViewer.dateTimeFormat?(s=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTimeFormat(),this.dynamicText="By "+o+" at "+s+" "):(s=(new Date).toString().split(" ").splice(1,3).join(" "),r=(new Date).toLocaleTimeString(),this.dynamicText="By "+o+" at "+r+" , "+s+"   ")),this.currentStampAnnotation),r=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.stampSettings.subject||(je(o)?"":o.iconName):this.pdfViewer.annotationSettings.subject,s=this.pdfViewer.stampSettings.annotationSelectorSettings;return this.pdfViewerBase.updateSelectorSettings(s),o&&"Image"===o.shapeAnnotationType?n={id:"stamp"+this.pdfViewerBase.customStampCount,bounds:{x:e,y:t,width:o.bounds.width,height:o.bounds.height},pageIndex:i,data:o.data,modifiedDate:o.modifiedDate,shapeAnnotationType:"Image",opacity:o.opacity,rotateAngle:o.RotationAngle,annotName:o.annotationName,comments:[],review:{state:"",stateModel:"",modifiedDate:"",author:o.author}}:o&&(n={id:"stamp"+this.pdfViewerBase.customStampCount,bounds:{x:e,y:t,width:o.width,height:o.height},pageIndex:i,data:o.pathdata,shapeAnnotationType:"Stamp",strokeColor:o.strokeColor,fillColor:o.fillColor,opacity:.5,stampFillColor:o.stampFillColor,stampStrokeColor:o.stampStrokeColor,rotateAngle:o.RotateAngle,isDynamicStamp:this.pdfViewerBase.isDynamicStamp,dynamicText:this.dynamicText,subject:r,annotationSelectorSettings:s,icon:o.iconName}),n=this.pdfViewerBase.currentSignatureAnnot?"SignatureText"===(o=this.pdfViewerBase.currentSignatureAnnot).shapeAnnotationType?{id:"sign"+this.pdfViewerBase.signatureCount,bounds:{x:e,y:t,width:o.bounds.width,height:o.bounds.height},pageIndex:i,data:o.data,modifiedDate:"",shapeAnnotationType:"SignatureText",thickness:o.thickness,strokeColor:o.strokeColor,opacity:o.opacity,signatureName:o.signatureName,fontFamily:o.fontFamily,fontSize:Math.floor(o.bounds.height/2)}:"SignatureImage"===o.shapeAnnotationType?{id:"sign"+this.pdfViewerBase.signatureCount,bounds:{x:e,y:t,width:o.bounds.width,height:o.bounds.height},pageIndex:i,data:o.data,modifiedDate:"",shapeAnnotationType:"SignatureImage",thickness:o.thickness,strokeColor:o.strokeColor,opacity:o.opacity,signatureName:o.signatureName}:{id:"sign"+this.pdfViewerBase.signatureCount,bounds:{x:e,y:t,width:o.bounds.width,height:o.bounds.height},pageIndex:i,data:o.data,shapeAnnotationType:"HandWrittenSignature",thickness:o.thickness,strokeColor:o.strokeColor,opacity:o.opacity,signatureName:o.signatureName}:n},fAt.prototype.ConvertPointToPixel=function(e){return e*(96/72)},fAt.prototype.calculateImagePosition=function(e,t){var i=parseFloat(je(e.x)?e.X:e.x),n=parseFloat(je(e.y)?e.Y:e.y),o=parseFloat(e.width||e.Width),e=parseFloat(e.height||e.Height);return t?{width:this.ConvertPointToPixel(o),height:this.ConvertPointToPixel(e),left:this.ConvertPointToPixel(i),top:this.ConvertPointToPixel(n)}:{width:o,height:e,left:i,top:n}},fAt.prototype.createCustomStampAnnotation=function(e,n){var o=this,r=this.pdfViewerBase.currentPageNumber-1,s=new Image,a=this;s.onload=function(){var e=o.pdfViewer.customStampSettings,t=0<e.width?e.width:0,e=0<e.height?e.height:0,t={width:t=0<t||0<e?t:s.naturalHeight>=s.naturalWidth?(e=s.naturalHeight/s.naturalHeight*100,s.naturalWidth/s.naturalHeight*100):(e=s.naturalHeight/s.naturalWidth*100,s.naturalWidth/s.naturalWidth*100),height:e,left:o.pdfViewer.customStampSettings.left,top:o.pdfViewer.customStampSettings.top},e=(new Date).toLocaleDateString(),i=o.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime();a.renderCustomImage(t,r,s,e,i,0,1,null,null,null,n)},s.src=e},fAt.prototype.renderStamp=function(e,t,i,n,o,r,s,a,l,h){F.isDevice&&(this.pdfViewerBase.customStampCount+=1);var d,p,c,u="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.stampSettings.author||"Guest",u=(this.pdfViewerBase.isDynamicStamp&&(c=(new Date).toString().split(" ").splice(1,3).join(" "),d=(new Date).toLocaleTimeString(),this.dynamicText="By "+u+" at "+d+" , "+c+" "),h&&(this.dynamicText+=" ",this.pdfViewerBase.isDynamicStamp=!0),this.currentStampAnnotation);u&&(null!==i&&null!==n?(u.width=i,u.height=n,u.Opacity=r,u.RotateAngle=s,p=l.AnnotName,u.AnnotName=p,d=l.State,u.State=d,c=l.AnnotationSettings,u.AnnotationSettings=c||this.pdfViewer.annotationModule.updateAnnotationSettings(u),h="string"==typeof l.AnnotationSelectorSettings?JSON.parse(l.AnnotationSelectorSettings):l.AnnotationSelectorSettings,u.AnnotationSelectorSettings=h||this.pdfViewer.annotationSelectorSettings,i=l.ModifiedDate,u.ModifiedDate=i,n=l.StateNodel,u.StateModel=n,r=l.IsCommentLock,u.IsCommentLock=r,s=l.Note,u.Note=s,d=l.Author,u.Author=d,c=l.Subject,u.Subject=c,h=this.pdfViewer.annotation.getCustomData(l),u.allowedInteractions=l.AllowedInteractions||l.allowedInteractions||["None"],u.CustomData=h,i=!0,i=je(l.IsPrint)&&je(l.IsPrint)?l.AnnotationSettings.isPrint:l.IsPrint,u.isPrint=i,null===u.Author&&(u.Author="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.stampSettings.author||"Guest"),n=l.Comments,u.Comments=this.pdfViewer.annotationModule.getAnnotationComments(n,l,d)):(p=this.pdfViewer.annotation.createGUID(),(r=this.pdfViewer.annotation.stickyNotesAnnotationModule.addComments("stamp",o+1))&&(document.getElementById(r).id=p),u.AnnotationSettings=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.stampSettings),u.AnnotName=p,u.Comments=[],u.State="",u.StateModel="",u.Note="",u.Opacity=1,u.RotateAngle=0,u.ModifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),u.Author="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.stampSettings.author||"Guest",u.Subject=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.stampSettings.subject||u.iconName:this.pdfViewer.annotationSettings.subject),s=cbt(rbt(u.pathdata)),c=l?l.annotationAddMode:"UI Drawn Annotation",u.AnnotationSelectorSettings=u.AnnotationSelectorSettings||this.pdfViewer.annotationSelectorSettings,h={id:"stamp"+this.pdfViewerBase.customStampCount,bounds:{x:e,y:t,width:u.width,height:u.height},pageIndex:o,data:u.pathdata,modifiedDate:u.ModifiedDate,shapeAnnotationType:"Stamp",strokeColor:u.strokeColor,fillColor:u.fillColor,opacity:u.Opacity,stampFillColor:u.stampFillColor,stampStrokeColor:u.stampStrokeColor,rotateAngle:u.RotateAngle,isDynamicStamp:this.pdfViewerBase.isDynamicStamp,dynamicText:this.dynamicText,annotName:u.AnnotName,notes:u.Note,comments:u.Comments,review:{state:u.State,stateModel:u.StateModel,modifiedDate:u.ModifiedDate,author:u.Author},subject:u.Subject,annotationSelectorSettings:u.AnnotationSelectorSettings,annotationSettings:u.AnnotationSettings,allowedInteractions:u.allowedInteractions,annotationAddMode:c,isPrint:u.isPrint,isCommentLock:u.IsCommentLock},i={stampAnnotationType:"path",author:u.Author,modifiedDate:u.ModifiedDate,subject:u.Subject,note:u.Note,strokeColor:u.strokeColor,fillColor:u.fillColor,opacity:u.Opacity,stampFillcolor:u.stampFillColor,rotateAngle:u.RotateAngle,creationDate:u.creationDate,pageNumber:o,icon:u.iconName,stampAnnotationPath:s,randomId:"stamp"+this.pdfViewerBase.customStampCount,isDynamicStamp:this.pdfViewerBase.isDynamicStamp,dynamicText:this.dynamicText,bounds:{left:e,top:t,width:u.width,height:u.height},annotName:u.AnnotName,comments:u.Comments,review:{state:u.State,stateModel:u.StateModel,author:u.Author,modifiedDate:u.ModifiedDate},shapeAnnotationType:"stamp",annotationSelectorSettings:this.getSettings(u),annotationSettings:u.AnnotationSettings,customData:this.pdfViewer.annotation.getCustomData(u),allowedInteractions:u.allowedInteractions,isPrint:u.isPrint,isCommentLock:u.IsCommentLock,isMaskedImage:u.IsMaskedImage,customStampName:"",template:u?u.template:null,templateSize:u?u.templateSize:0},this.storeStampInSession(o,i),this.pdfViewer.add(h),this.isAddAnnotationProgramatically&&this.triggerAnnotationAdd(h,u),je(a)&&(a=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",o)),this.pdfViewer.renderDrawing(a,o),this.pdfViewerBase.stampAdded&&(this.triggerAnnotationAdd(h,u),this.pdfViewerBase.isNewStamp=!0,this.pdfViewer.annotation.addAction(o,null,h,"Addition","",h,h)),this.pdfViewerBase.stampAdded=!1,this.isExistingStamp||(u.creationDate=(new Date).toLocaleDateString(),u.modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime())),this.resetAnnotation()},fAt.prototype.getSettings=function(e){var t=this.pdfViewer.annotationSelectorSettings;return e.AnnotationSelectorSettings?t=e.AnnotationSelectorSettings:this.pdfViewer.stampSettings.annotationSelectorSettings&&(t=this.pdfViewer.stampSettings.annotationSelectorSettings),t},fAt.prototype.resetAnnotation=function(){this.pdfViewerBase.isDynamicStamp=!1,this.dynamicText="",this.currentStampAnnotation=null,F.isDevice||(this.pdfViewerBase.customStampCount+=1)},fAt.prototype.updateDeleteItems=function(e,t,i){this.pdfViewerBase.updateDocumentEditedProperty(!0);var n=null,o=!1,r=(t.modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),t.author="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.stampSettings.author||"Guest",i&&(s=this.pdfViewer.annotation.createGUID(),(r=this.pdfViewer.annotation.stickyNotesAnnotationModule.addComments("stamp",e+1))&&(document.getElementById(r).id=s),t.annotName=s,t.Comments=[],t.State="",t.StateModel="",t.Note="",t.Opacity=1,t.RotateAngle=0),"Stamp"===t.shapeAnnotationType&&(t.isPrint=this.pdfViewer.stampSettings.isPrint),this.pdfViewer.stampSettings.annotationSelectorSettings||this.pdfViewer.annotationSelectorSettings),s=this.pdfViewer.stampSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,n="Image"===t.shapeAnnotationType?(t.Author="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.customStampSettings.author||"Guest",t.Subject=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.customStampSettings.subject||"":this.pdfViewer.annotationSettings.subject,t.isPrint=this.pdfViewer.customStampSettings.isPrint,this.customStampName=this.customStampName||(this.currentStampAnnotation&&this.currentStampAnnotation.signatureName?this.currentStampAnnotation.signatureName:t.id),{stampAnnotationType:"image",author:t.author,modifiedDate:t.modifiedDate,subject:t.Subject,note:"",strokeColor:"",fillColor:"",opacity:i,rotateAngle:"0",creationDate:t.currentDate,pageNumber:e,icon:"",stampAnnotationPath:t.data,randomId:t.id,bounds:{left:t.bounds.x,top:t.bounds.y,width:t.bounds.width,height:t.bounds.height},stampFillcolor:"",isDynamicStamp:!1,annotName:t.annotName,comments:[],review:{state:"",stateModel:"",author:t.author,modifiedDate:t.modifiedDate},shapeAnnotationType:"stamp",annotationSelectorSettings:r,annotationSettings:this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.customStampSettings),customData:this.pdfViewer.annotationModule.getData("image"),isPrint:t.isPrint,allowedInteractions:s,isCommentLock:!1,isMaskedImage:t.isMaskedImage,customStampName:this.customStampName,template:t?t.template:null,templateSize:t?t.templateSize:0}):t.stampAnnotationType?{stampAnnotationType:t.stampAnnotationType,author:t.author,modifiedDate:t.modifiedDate,subject:t.Subject,note:t.Note,strokeColor:t.strokeColor,fillColor:t.fillColor,opacity:t.opacity,stampFillcolor:t.stampFillcolor,rotateAngle:t.rotateAngle,creationDate:t.creationDate,pageNumber:t.pageNumber,icon:t.icon,stampAnnotationPath:t.stampAnnotationPath,randomId:t.randomId,isDynamicStamp:t.isDynamicStamp,dynamicText:t.dynamicText,bounds:{left:t.bounds.left,top:t.bounds.top,width:t.bounds.width,height:t.bounds.height},annotName:t.annotName,comments:t.Comments,review:{state:t.State,stateModel:t.StateModel,author:t.author,modifiedDate:t.ModifiedDate},shapeAnnotationType:"stamp",annotationSelectorSettings:r,annotationSettings:this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.stampSettings),customData:this.pdfViewer.annotationModule.getData(t.stampAnnotationType),isPrint:t.isPrint,allowedInteractions:s,isCommentLock:t.isCommentLock,isMaskedImage:t.isMaskedImage,customStampName:"",template:t?t.template:null,templateSize:t?t.templateSize:0}:{stampAnnotationType:t.shapeAnnotationType,author:t.author,modifiedDate:t.modifiedDate,subject:t.subject,note:t.notes,strokeColor:t.strokeColor,fillColor:t.fillColor,opacity:t.opacity,stampFillcolor:t.stampFillColor,rotateAngle:t.rotateAngle,creationDate:t.creationDate,pageNumber:t.pageIndex,icon:t.icon,stampAnnotationPath:t.data,randomId:t.id,isDynamicStamp:t.isDynamicStamp,dynamicText:t.dynamicText,shapeAnnotationType:"stamp",bounds:{left:t.bounds.x,top:t.bounds.y,width:t.bounds.width,height:t.bounds.height},annotName:t.annotName,comments:t.Comments,review:{state:t.State,stateModel:t.StateModel,author:t.author,modifiedDate:t.ModifiedDate},annotationSelectorSettings:r,annotationSettings:this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.stampSettings),customData:this.pdfViewer.annotationModule.getData(t.shapeAnnotationType),isPrint:t.isPrint,allowedInteractions:s,isCommentLock:t.isCommentLock,isMaskedImage:t.isMaskedImage,customStampName:"",template:t?t.template:null,templateSize:t?t.templateSize:0};i&&("Image"!==t.shapeAnnotationType&&(r=cbt(rbt(t.data)),n.stampAnnotationPath=r),t.creationDate=(new Date).toLocaleDateString(),!F.isDevice&&t.wrapper&&(n.bounds.width=t.wrapper.actualSize.width,n.bounds.height=t.wrapper.actualSize.height,n.bounds.left=t.wrapper.bounds.x,n.bounds.top=t.wrapper.bounds.y),n.opacity=i,this.pdfViewerBase.stampAdded)&&(this.storeStampInSession(e,n),s={left:n.bounds.left,top:n.bounds.top,width:n.bounds.width,height:n.bounds.height},this.pdfViewerBase.updateDocumentEditedProperty(o=!0),r={opacity:n.opacity,author:n.author,modifiedDate:n.modifiedDate},"Image"===t.shapeAnnotationType?(this.pdfViewerBase.stampAdded=!1,this.pdfViewer.fireAnnotationAdd(n.pageNumber,n.annotName,"Image",s,r,null,null,null,null,null,this.customStampName),this.customStampName=null):this.pdfViewer.fireAnnotationAdd(n.pageNumber,n.annotName,"Stamp",s,r),this.pdfViewer.annotation.addAction(e,null,t,"Addition","",t,n)),o||this.storeStampInSession(e,n)},fAt.prototype.renderCustomImage=function(e,t,i,n,o,r,s,a,l,h,d,p,c){var u,g,m,f,y,v=0<this.pdfViewer.customStampSettings.left&&0<this.pdfViewer.customStampSettings.top,b=this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.customStampSettings),w=this.pdfViewer.stampSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,C=!(je(h)||!h.template),S=(F.isDevice&&(this.pdfViewerBase.customStampCount+=1),l?(u=h.AnnotName,g=h.Author,m=h.Subject,f=h.IsCommentLock,b=h.AnnotationSettings||this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.customStampSettings),w=h.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(h),null===g&&(g="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.customStampSettings.author||"Guest"),null===m&&(m=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.customStampSettings.subject||"":this.pdfViewer.annotationSettings.subject),h.IsLocked&&h.AnnotationSettings?h.AnnotationSettings.isLock=h.IsLocked:b.isLock=h.IsLocked):(u=this.pdfViewer.annotation.createGUID(),g="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.customStampSettings.author||"Guest",m=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.customStampSettings.subject||"":this.pdfViewer.annotationSettings.subject,f=!1),o=o||h.ModifiedDate||(new Date).toLocaleString(),h?h.annotationAddMode:"UI Drawn Annotation "),A=!0,r=(l?"Imported Annotation"===h.annotationAddMode?A=h.IsPrint:h.AnnotationSettings&&(A=h.AnnotationSettings.isPrint):A=this.pdfViewer.customStampSettings.isPrint,je(h)||je(h.AnnotationSelectorSettings)?(y=this.pdfViewer.stampSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(y)):y="string"==typeof h.AnnotationSelectorSettings?JSON.parse(h.AnnotationSelectorSettings):h.AnnotationSelectorSettings,{id:"stamp"+this.pdfViewerBase.customStampCount,allowedInteractions:w,bounds:{x:e.left,y:e.top,width:e.width,height:e.height},pageIndex:t,data:i.src,modifiedDate:o,shapeAnnotationType:"Image",opacity:s,rotateAngle:r,annotName:u,comments:[],review:{state:"",stateModel:"",modifiedDate:"",author:g},annotationSettings:b,annotationSelectorSettings:y,annotationAddMode:S,signatureName:d,isPrint:A,isCommentLock:f,subject:m,template:C?h.template:null,templateSize:h?h.templateSize:0});this.currentStampAnnotation=r,(l||v)&&(!h&&(this.isStampAnnotSelected=!1,(h=r).Note="",h.State="",h.StateModel="",S=this.pdfViewer.annotation.stickyNotesAnnotationModule.addComments("stamp",t+1))&&(document.getElementById(S).id=u),d={stampAnnotationType:"image",author:g,allowedInteractions:w,modifiedDate:o,subject:m,note:h.Note,strokeColor:"",fillColor:"",opacity:s,rotateAngle:"0",creationDate:n,pageNumber:t,icon:"",stampAnnotationPath:i.src,randomId:"stamp"+this.pdfViewerBase.customStampCount,bounds:{left:e.left,top:e.top,width:e.width,height:e.height},stampFillcolor:"",isDynamicStamp:!1,annotName:u,comments:this.pdfViewer.annotationModule.getAnnotationComments(h.Comments,h,h.Author),review:{state:h.State,stateModel:h.StateModel,author:g,modifiedDate:o},shapeAnnotationType:"stamp",annotationSelectorSettings:y,annotationSettings:b,customData:this.pdfViewer.annotation.getCustomData(h),isPrint:A,isCommentLock:f,isMaskedImage:h.IsMaskedImage,customStampName:h.CustomStampName,template:C?h.template:null,templateSize:h?h.templateSize:0},this.storeStampInSession(t,d,p,c),r.comments=this.pdfViewer.annotationModule.getAnnotationComments(h.Comments,h,h.Author),r.review={state:h.State,stateModel:h.StateModel,author:g,modifiedDate:o},this.pdfViewer.add(r),je(c)||this.adjustZIndexOrder(r,c),this.isAddAnnotationProgramatically&&(l={opacity:r.opacity,borderColor:r.strokeColor,borderWidth:r.thickness,author:h.author,subject:h.subject,modifiedDate:h.modifiedDate,fillColor:r.fillColor,fontSize:r.fontSize,width:r.bounds.width,height:r.bounds.height,fontColor:r.fontColor,fontFamily:r.fontFamily,defaultText:r.dynamicText,fontStyle:r.font,textAlignment:r.textAlign},this.customStampName=this.customStampName||this.currentStampAnnotation.signatureName||h.id,this.pdfViewer.fireAnnotationAdd(r.pageIndex,r.annotName,"Image",r.bounds,l,null,null,null,null,null,this.customStampName),this.customStampName=null),je(a)&&(a=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",t)),this.pdfViewer.renderDrawing(a,t),this.pdfViewerBase.stampAdded)&&this.pdfViewer.annotation.addAction(t,null,r,"Addition","",r,r),F.isDevice||(this.pdfViewerBase.customStampCount+=1)},fAt.prototype.adjustZIndexOrder=function(e,t){var i;je(this.pdfViewer.zIndexTable[e.pageIndex])||(e=this.pdfViewer.zIndexTable[e.pageIndex].objects)&&0<e.length&&(i=e[e.length-1],e.splice(e.length-1),e.splice(t,0,i))},fAt.prototype.retrieveDynamicStampAnnotation=function(e){var t;if(e){switch(e.trim()){case"Revised":t={iconName:"Revised",pathdata:"M19.68,21.22a3.94,3.94,0,0,1-1.1-1.9L16,11.87l-.21-.64a20.77,20.77,0,0,0,2.11-.58,7.24,7.24,0,0,0,2-1.09,5.65,5.65,0,0,0,1.72-2.12,5.4,5.4,0,0,0,.52-2.2A4.15,4.15,0,0,0,19.1,1.05a14.58,14.58,0,0,0-4.72-.6H5.31v.86a7,7,0,0,1,2,.33c.3.14.45.48.45,1a6.1,6.1,0,0,1-.14,1.08l-.21.8L3.31,19.32a3.35,3.35,0,0,1-.94,1.78,3.58,3.58,0,0,1-1.74.57v.86h9.83v-.86a6.22,6.22,0,0,1-2-.35c-.29-.15-.43-.52-.43-1.11,0-.1,0-.21,0-.31a2.36,2.36,0,0,1,0-.28l.28-1.14,1.95-6.86h.93l3.56,10.91h6.25v-.88A3.05,3.05,0,0,1,19.68,21.22ZM13.29,10.31a14,14,0,0,1-2.63.23l2-7.56a2.67,2.67,0,0,1,.52-1.17,1.4,1.4,0,0,1,1-.3,2.74,2.74,0,0,1,2.33.91,3.72,3.72,0,0,1,.69,2.3,6.4,6.4,0,0,1-.49,2.52,6.72,6.72,0,0,1-1.06,1.82A4.11,4.11,0,0,1,13.29,10.31ZM26,.45H43.74l-1.4,6.27-.88-.15a6,6,0,0,0-.78-3.4c-.84-1.12-2.54-1.69-5.11-1.69a2.9,2.9,0,0,0-1.68.32A2.34,2.34,0,0,0,33.26,3l-1.95,7.33a13.55,13.55,0,0,0,4.48-.56c.68-.32,1.44-1.3,2.27-2.92l.91.11-2.44,9-.91-.16a7.27,7.27,0,0,0,.09-.82q0-.35,0-.57a2.69,2.69,0,0,0-1-2.4A7.57,7.57,0,0,0,31,11.38l-2.17,8c0,.2-.09.38-.12.57a2.62,2.62,0,0,0,0,.43.92.92,0,0,0,.35.74,2.54,2.54,0,0,0,1.49.29,13.84,13.84,0,0,0,5.11-.84A9.85,9.85,0,0,0,40.73,16l.81.14-1.95,6.42h-18v-.9a3.43,3.43,0,0,0,1.42-.53A3.42,3.42,0,0,0,24,19.32L28,4.51c.1-.37.18-.72.25-1a4.23,4.23,0,0,0,.09-.78c0-.56-.15-.91-.44-1.06a6.85,6.85,0,0,0-2-.34ZM63.4,3.37,51,23.15H49.9L47.39,6.34a17.25,17.25,0,0,0-.93-4.24c-.25-.43-.93-.7-2.05-.79V.45h9.86v.86a5.47,5.47,0,0,0-1.72.19,1.14,1.14,0,0,0-.81,1.16,3,3,0,0,0,0,.31l0,.32L53.5,16.43l6.24-9.85c.49-.79.94-1.57,1.33-2.36a4.45,4.45,0,0,0,.6-1.85.88.88,0,0,0-.61-.9,6.11,6.11,0,0,0-1.52-.16V.45h6.34v.86a3.88,3.88,0,0,0-1.16.5A5.73,5.73,0,0,0,63.4,3.37ZM70.08,20c0,.11,0,.22,0,.31,0,.56.15.91.45,1.06a6.39,6.39,0,0,0,1.95.35v.86H62.63v-.86a3.58,3.58,0,0,0,1.74-.57,3.35,3.35,0,0,0,.94-1.78l4-14.81q.18-.63.27-1a3.78,3.78,0,0,0,.09-.75c0-.56-.16-.91-.47-1.06a7,7,0,0,0-2-.34V.45h9.83v.86a3.61,3.61,0,0,0-1.75.58,3.37,3.37,0,0,0-.91,1.78L70.4,18.48l-.26,1.14Zm19.26-7.23a6.37,6.37,0,0,1,1.07,3.62,6.58,6.58,0,0,1-2.06,4.71,7.54,7.54,0,0,1-5.65,2.1A10.15,10.15,0,0,1,80.89,23a11.42,11.42,0,0,1-1.8-.49l-.83-.3-.58-.2a2,2,0,0,0-.38,0,1,1,0,0,0-.78.26,3.89,3.89,0,0,0-.52.92H75l1.19-7.4,1,.07a14.63,14.63,0,0,0,.28,2.3,5.27,5.27,0,0,0,2.79,3.44,4.73,4.73,0,0,0,2.06.44,3.85,3.85,0,0,0,3.07-1.26,4.39,4.39,0,0,0,1.09-2.94q0-2.09-4.05-5.25c-2.7-2.22-4-4.26-4-6.14a6.31,6.31,0,0,1,1.78-4.53,6.51,6.51,0,0,1,5-1.87,9.67,9.67,0,0,1,1.82.18A6.54,6.54,0,0,1,88,.45l.84.28.56.13a2.59,2.59,0,0,0,.52.06,1.4,1.4,0,0,0,.88-.24,2.2,2.2,0,0,0,.53-.6h1L91,6.69l-.85-.12L90,5.49a6,6,0,0,0-1-2.62,3.82,3.82,0,0,0-3.38-1.73A3,3,0,0,0,82.9,2.53a3.6,3.6,0,0,0-.58,2,3.44,3.44,0,0,0,.59,2,6,6,0,0,0,1,1l2.85,2.33A12.75,12.75,0,0,1,89.34,12.72ZM110.27,16l.81.14-2,6.42H90.85v-.86a3.66,3.66,0,0,0,1.74-.57,3.42,3.42,0,0,0,.93-1.78l4-14.81c.1-.37.18-.72.25-1a4.23,4.23,0,0,0,.09-.78c0-.56-.14-.91-.44-1.06a6.85,6.85,0,0,0-2-.34V.45h17.77l-1.4,6.27L111,6.57a6,6,0,0,0-.78-3.4c-.84-1.12-2.54-1.69-5.1-1.69a2.92,2.92,0,0,0-1.69.32A2.34,2.34,0,0,0,102.8,3l-2,7.33a13.55,13.55,0,0,0,4.48-.56c.69-.32,1.44-1.3,2.27-2.92l.92.11-2.45,9-.91-.16a7.27,7.27,0,0,0,.09-.82q0-.35,0-.57a2.69,2.69,0,0,0-1-2.4,7.57,7.57,0,0,0-3.79-.64l-2.17,8c0,.2-.09.38-.12.57a2.62,2.62,0,0,0,0,.43.92.92,0,0,0,.35.74,2.54,2.54,0,0,0,1.49.29,13.84,13.84,0,0,0,5.11-.84A9.81,9.81,0,0,0,110.27,16Zm22.65-13Q130.39.45,125.52.45h-9.58v.86a7,7,0,0,1,2,.34c.31.15.47.5.47,1.06a3.61,3.61,0,0,1-.09.74c-.06.29-.15.64-.26,1.06L114,19.31a3.18,3.18,0,0,1-1.15,1.91,3.57,3.57,0,0,1-1.53.45v.86h9.47a14.87,14.87,0,0,0,10.95-4.14,12,12,0,0,0,3.75-8.77A8.94,8.94,0,0,0,132.92,2.94ZM129,15.36q-2.62,6.06-8.52,6.05a2.46,2.46,0,0,1-1.42-.29,1.05,1.05,0,0,1-.4-.93,2.24,2.24,0,0,1,0-.34,2.65,2.65,0,0,1,.08-.43l4.55-16.67a2,2,0,0,1,.54-.92,2.2,2.2,0,0,1,1.44-.35,4.74,4.74,0,0,1,4.47,2.22,7.9,7.9,0,0,1,.83,3.9A19.32,19.32,0,0,1,129,15.36Z",opacity:1,strokeColor:"",fillColor:"#192760",width:127.47,height:55.84601,stampFillColor:"#dce3ef",stampStrokeColor:""};break;case"Reviewed":t={iconName:"Reviewed",pathdata:"M17.37,18.25a3.47,3.47,0,0,1-1-1.67L14.17,10c0-.07-.1-.26-.19-.56A14.71,14.71,0,0,0,15.83,9a6.08,6.08,0,0,0,1.76-1A4.92,4.92,0,0,0,19.1,6.14a4.71,4.71,0,0,0,.46-1.93A3.65,3.65,0,0,0,16.86.52,12.83,12.83,0,0,0,12.72,0h-8V.75a6.62,6.62,0,0,1,1.72.3c.26.12.39.41.39.88a4.56,4.56,0,0,1-.13.94c0,.2-.1.44-.17.7L3,16.58a2.87,2.87,0,0,1-.82,1.56,3.15,3.15,0,0,1-1.53.51v.75H9.27v-.75a5.88,5.88,0,0,1-1.74-.31c-.25-.13-.37-.46-.37-1a2.53,2.53,0,0,1,0-.28,1.44,1.44,0,0,1,0-.24l.24-1,1.71-6H10l3.13,9.59h5.49v-.77A2.71,2.71,0,0,1,17.37,18.25ZM11.75,8.67a12.06,12.06,0,0,1-2.3.19L11.2,2.22a2.2,2.2,0,0,1,.46-1,1.19,1.19,0,0,1,.87-.27,2.41,2.41,0,0,1,2.05.8,3.29,3.29,0,0,1,.6,2A5.63,5.63,0,0,1,14.75,6a6.06,6.06,0,0,1-.93,1.59A3.65,3.65,0,0,1,11.75,8.67ZM22.9,0H38.52L37.29,5.51l-.78-.13a5.34,5.34,0,0,0-.68-3c-.74-1-2.24-1.48-4.49-1.48a2.68,2.68,0,0,0-1.49.27,2.09,2.09,0,0,0-.54,1L27.59,8.67a12.08,12.08,0,0,0,3.94-.5,5.69,5.69,0,0,0,2-2.56l.81.1-2.16,7.93-.79-.15c0-.27.06-.51.08-.71s0-.37,0-.5a2.34,2.34,0,0,0-.85-2.11A6.61,6.61,0,0,0,27.3,9.6l-1.91,7.08a4.91,4.91,0,0,0-.1.5,2,2,0,0,0,0,.38.83.83,0,0,0,.31.65,2.29,2.29,0,0,0,1.31.25,12.21,12.21,0,0,0,4.49-.73,8.69,8.69,0,0,0,4.51-4.09l.71.12L34.86,19.4H19.05v-.79a2.88,2.88,0,0,0,1.28-.47,2.94,2.94,0,0,0,.82-1.56l3.56-13q.13-.49.21-.9A3.26,3.26,0,0,0,25,2q0-.73-.39-.93A6.44,6.44,0,0,0,22.9.75ZM55.79,2.57,44.86,20h-.93L41.72,5.17a16.05,16.05,0,0,0-.81-3.73c-.22-.37-.82-.6-1.81-.69V0h8.67V.75a5,5,0,0,0-1.52.17,1,1,0,0,0-.7,1,2.53,2.53,0,0,0,0,.28l0,.27L47.09,14l5.48-8.66C53,4.69,53.4,4,53.75,3.32a4,4,0,0,0,.52-1.63.78.78,0,0,0-.54-.8A5.88,5.88,0,0,0,52.4.75V0H58V.75a3.55,3.55,0,0,0-1,.44A5.18,5.18,0,0,0,55.79,2.57ZM62,18.34a6,6,0,0,0,1.71.31v.75H55.12v-.75a3.15,3.15,0,0,0,1.53-.51,2.94,2.94,0,0,0,.82-1.56L61,3.57c.1-.37.18-.68.23-.93A2.81,2.81,0,0,0,61.34,2c0-.49-.13-.8-.41-.93a6.61,6.61,0,0,0-1.71-.3V0h8.63V.75a3.17,3.17,0,0,0-1.53.51,3,3,0,0,0-.8,1.57l-3.58,13-.22,1a2.74,2.74,0,0,0,0,.28,1.41,1.41,0,0,0,0,.28C61.64,17.9,61.78,18.21,62,18.34ZM69.13,0H84.75L83.52,5.51l-.78-.13a5.34,5.34,0,0,0-.68-3c-.74-1-2.24-1.48-4.49-1.48a2.68,2.68,0,0,0-1.49.27,2.09,2.09,0,0,0-.54,1L73.82,8.67a12.08,12.08,0,0,0,3.94-.5,5.69,5.69,0,0,0,2-2.56l.81.1L78.4,13.64l-.79-.15c0-.27.07-.51.08-.71s0-.37,0-.5a2.34,2.34,0,0,0-.85-2.11,6.61,6.61,0,0,0-3.33-.57l-1.91,7.08a4.91,4.91,0,0,0-.1.5,2,2,0,0,0,0,.38.83.83,0,0,0,.31.65,2.29,2.29,0,0,0,1.31.25,12.21,12.21,0,0,0,4.49-.73,8.69,8.69,0,0,0,4.51-4.09l.71.12L81.1,19.4H65v-.75a3.15,3.15,0,0,0,1.53-.51,2.94,2.94,0,0,0,.82-1.56l3.56-13q.14-.49.21-.9A3.26,3.26,0,0,0,71.24,2q0-.73-.39-.93a6.44,6.44,0,0,0-1.72-.3Zm39.15,2.83L100,20h-.84L97.41,5.85,90.67,20h-.84L87.58,3.13A3.83,3.83,0,0,0,87,1.23,2.84,2.84,0,0,0,85.33.71V0h8.06V.75A2.55,2.55,0,0,0,92.27,1a1.33,1.33,0,0,0-.66,1.31c0,.06,0,.13,0,.19s0,.15,0,.26l1.15,10.16,4.32-9a1,1,0,0,0,0-.27,3.33,3.33,0,0,0-.64-2.38A2.5,2.5,0,0,0,95.06.71V0h7.78V.71a2.9,2.9,0,0,0-1.4.34c-.27.19-.41.6-.41,1.24,0,.13,0,.32,0,.55,0,.4.08.88.14,1.47l1,8.47,4.51-9.42a7.12,7.12,0,0,0,.29-.74,2.48,2.48,0,0,0,.14-.79.9.9,0,0,0-.48-.93,3.25,3.25,0,0,0-1.34-.19V0h5.41V.71a2.34,2.34,0,0,0-1.1.35A4.56,4.56,0,0,0,108.28,2.83Zm16.45,10.81.71.12-1.71,5.64H107.66v-.75a3.15,3.15,0,0,0,1.53-.51,2.87,2.87,0,0,0,.82-1.56l3.57-13q.12-.49.21-.9a3.17,3.17,0,0,0,.08-.69q0-.73-.39-.93a6.44,6.44,0,0,0-1.72-.3V0h15.62l-1.23,5.51-.78-.13a5.26,5.26,0,0,0-.68-3C124,1.4,122.46.91,120.2.91a2.64,2.64,0,0,0-1.48.27,2.09,2.09,0,0,0-.55,1l-1.72,6.45a12,12,0,0,0,3.94-.5,5.62,5.62,0,0,0,2-2.56l.81.1L121,13.64l-.79-.15c0-.27.06-.51.07-.71s0-.37,0-.5a2.34,2.34,0,0,0-.86-2.11,6.57,6.57,0,0,0-3.32-.57l-1.91,7.08a5,5,0,0,0-.11.5,3.14,3.14,0,0,0,0,.38.8.8,0,0,0,.31.65,2.25,2.25,0,0,0,1.3.25,12.26,12.26,0,0,0,4.5-.73A8.67,8.67,0,0,0,124.73,13.64ZM144.64,2.19Q142.41,0,138.14,0h-8.42V.75a6.61,6.61,0,0,1,1.71.3c.28.13.41.44.41.93a2.81,2.81,0,0,1-.08.66c0,.25-.12.56-.23.93l-3.56,13a2.78,2.78,0,0,1-1,1.68,3.44,3.44,0,0,1-1.35.4v.75h8.32a13.06,13.06,0,0,0,9.63-3.64,10.49,10.49,0,0,0,3.3-7.7A7.87,7.87,0,0,0,144.64,2.19ZM141.2,13.1q-2.31,5.32-7.48,5.32a2.27,2.27,0,0,1-1.26-.25,1,1,0,0,1-.34-.82,1.62,1.62,0,0,1,0-.3,2.16,2.16,0,0,1,.08-.38l4-14.65a1.63,1.63,0,0,1,.47-.81A2,2,0,0,1,138,.91a4.16,4.16,0,0,1,3.93,1.95,7,7,0,0,1,.72,3.42A16.82,16.82,0,0,1,141.2,13.1Z",opacity:1,strokeColor:"",fillColor:"#192760",width:127.70402,height:55.84601,stampFillColor:"#dce3ef",stampStrokeColor:""};break;case"Received":t={iconName:"Received",pathdata:"M18.17,8.76a5,5,0,0,0,1.57-1.93,5,5,0,0,0,.47-2A3.76,3.76,0,0,0,17.42,1,13,13,0,0,0,13.13.48H4.89v.78a6.49,6.49,0,0,1,1.77.31c.27.12.41.43.41.91a5.87,5.87,0,0,1-.13,1c-.05.2-.12.44-.19.72L3.06,17.64a3,3,0,0,1-.84,1.61,3.36,3.36,0,0,1-1.59.53v.77H9.57v-.77a6.17,6.17,0,0,1-1.8-.32c-.26-.14-.39-.48-.39-1a2.46,2.46,0,0,1,0-.28,1.78,1.78,0,0,1,0-.26l.25-1,1.78-6.25h.84l3.24,9.92h5.66v-.8A2.76,2.76,0,0,1,18,19.36a3.57,3.57,0,0,1-1-1.72l-2.31-6.78c0-.07-.09-.27-.19-.58.87-.2,1.51-.38,1.92-.52A6.56,6.56,0,0,0,18.17,8.76Zm-2.93-2.1a6.19,6.19,0,0,1-1,1.65,3.85,3.85,0,0,1-2.14,1.14,12.92,12.92,0,0,1-2.39.2l1.81-6.87A2.5,2.5,0,0,1,12,1.72a1.27,1.27,0,0,1,.9-.27,2.5,2.5,0,0,1,2.12.83,3.35,3.35,0,0,1,.62,2.09A5.81,5.81,0,0,1,15.24,6.66ZM30.3,2.78,28.52,9.45a12.53,12.53,0,0,0,4.08-.51,5.91,5.91,0,0,0,2-2.66l.84.11-2.23,8.2-.82-.15c0-.28.07-.53.08-.74a5.17,5.17,0,0,0,0-.52A2.43,2.43,0,0,0,31.66,11a6.87,6.87,0,0,0-3.44-.58l-2,7.32a3.61,3.61,0,0,0-.11.51,2.31,2.31,0,0,0,0,.4.83.83,0,0,0,.32.67,2.32,2.32,0,0,0,1.35.26,12.58,12.58,0,0,0,4.65-.76,9,9,0,0,0,4.67-4.23l.73.13-1.77,5.83H19.8v-.83A2.83,2.83,0,0,0,21,19.25a3.09,3.09,0,0,0,.85-1.61L25.54,4.17c.09-.34.16-.65.22-.93a3.35,3.35,0,0,0,.09-.71c0-.5-.13-.82-.4-1a6.34,6.34,0,0,0-1.78-.31V.48H39.82l-1.27,5.7-.81-.13A5.44,5.44,0,0,0,37,3Q35.9,1.42,32.4,1.42a2.69,2.69,0,0,0-1.54.29A2.08,2.08,0,0,0,30.3,2.78ZM56.56,6.1c0-.07,0-.18,0-.33a4.89,4.89,0,0,0-1.12-3.53,3.75,3.75,0,0,0-2.82-1.16c-2.33,0-4.35,1.55-6.07,4.63a17.09,17.09,0,0,0-2.31,8.43c0,2.08.47,3.5,1.43,4.27a4.89,4.89,0,0,0,3.11,1.15,6.84,6.84,0,0,0,4.14-1.45A11.51,11.51,0,0,0,55,16l.91.66A10.08,10.08,0,0,1,52.26,20a9.33,9.33,0,0,1-4.34,1.11A8.56,8.56,0,0,1,42,19a7.25,7.25,0,0,1-2.35-5.67A13.53,13.53,0,0,1,43.22,4a11.19,11.19,0,0,1,8.56-4A12.34,12.34,0,0,1,55,.44,13.17,13.17,0,0,0,56.9.88a1,1,0,0,0,.71-.24A2.94,2.94,0,0,0,58.06,0H59L57.45,7l-.94-.18C56.54,6.42,56.55,6.17,56.56,6.1Zm18,8.49.74.13-1.78,5.83H56.87v-.77a3.31,3.31,0,0,0,1.58-.53,3.09,3.09,0,0,0,.85-1.61L63,4.17c.09-.34.16-.65.22-.93a3.35,3.35,0,0,0,.09-.71c0-.5-.14-.82-.4-1a6.34,6.34,0,0,0-1.78-.31V.48H77.26L76,6.18l-.81-.13A5.44,5.44,0,0,0,74.48,3q-1.14-1.54-4.64-1.54a2.69,2.69,0,0,0-1.54.29,2.08,2.08,0,0,0-.56,1.07L66,9.45A12.53,12.53,0,0,0,70,8.94a5.91,5.91,0,0,0,2-2.66l.84.11-2.23,8.2-.82-.15c0-.28.07-.53.08-.74a5.17,5.17,0,0,0,0-.52A2.43,2.43,0,0,0,69.1,11a6.87,6.87,0,0,0-3.44-.58l-2,7.32a3.61,3.61,0,0,0-.11.51,2.31,2.31,0,0,0,0,.4.83.83,0,0,0,.32.67,2.32,2.32,0,0,0,1.35.26,12.58,12.58,0,0,0,4.65-.76A8.91,8.91,0,0,0,74.52,14.59Zm31-11.45-11.31,18h-1L91,5.83A16.56,16.56,0,0,0,90.12,2c-.2-.34-.71-.56-1.51-.67a3,3,0,0,0-1.31.48,3.08,3.08,0,0,0-.82,1.62l-3.7,13.47-.24,1c0,.1,0,.2-.05.3s0,.2,0,.28c0,.51.14.83.41,1a6.21,6.21,0,0,0,1.77.32v.77H75.72v-.77a3.31,3.31,0,0,0,1.58-.53,3.09,3.09,0,0,0,.85-1.61L81.83,4.17c.11-.38.19-.7.25-.95a3.75,3.75,0,0,0,.08-.69c0-.5-.15-.82-.43-1A6.49,6.49,0,0,0,80,1.26V.48H97.22v.78a4.92,4.92,0,0,0-1.57.18,1,1,0,0,0-.73,1.05,2.81,2.81,0,0,0,0,.29l0,.28,1.56,12,5.67-9a24.21,24.21,0,0,0,1.21-2.14,4.07,4.07,0,0,0,.54-1.68.79.79,0,0,0-.55-.82A5.69,5.69,0,0,0,102,1.26V.48h5.76v.78a3.5,3.5,0,0,0-1,.46A5.16,5.16,0,0,0,105.52,3.14Zm16.83,11.45.73.13-1.77,5.83H104.69v-.77a3.31,3.31,0,0,0,1.58-.53,3,3,0,0,0,.85-1.61l3.69-13.47c.08-.34.16-.65.22-.93a4,4,0,0,0,.08-.71c0-.5-.13-.82-.4-1a6.34,6.34,0,0,0-1.78-.31V.48h16.16l-1.28,5.7-.8-.13A5.43,5.43,0,0,0,122.3,3q-1.14-1.54-4.64-1.54a2.67,2.67,0,0,0-1.53.29,2.16,2.16,0,0,0-.57,1.07l-1.78,6.67a12.53,12.53,0,0,0,4.08-.51,5.91,5.91,0,0,0,2.06-2.66l.83.11-2.22,8.2-.82-.15c0-.28.06-.53.08-.74s0-.38,0-.52a2.45,2.45,0,0,0-.88-2.18,6.9,6.9,0,0,0-3.44-.58l-2,7.32c-.05.18-.08.35-.11.51a3.58,3.58,0,0,0,0,.4.81.81,0,0,0,.32.67,2.28,2.28,0,0,0,1.35.26,12.62,12.62,0,0,0,4.65-.76A9,9,0,0,0,122.35,14.59ZM142.94,2.75Q140.63.48,136.21.48h-8.7v.78a6.66,6.66,0,0,1,1.77.31q.42.21.42,1a2.91,2.91,0,0,1-.08.68q-.08.39-.24,1L125.7,17.62a2.93,2.93,0,0,1-1,1.75,3.54,3.54,0,0,1-1.39.41v.77h8.61a13.5,13.5,0,0,0,10-3.76,10.84,10.84,0,0,0,3.41-8A8.14,8.14,0,0,0,142.94,2.75ZM139.38,14q-2.38,5.51-7.74,5.5a2.35,2.35,0,0,1-1.29-.26,1,1,0,0,1-.36-.85,1.78,1.78,0,0,1,0-.31,2.08,2.08,0,0,1,.08-.39l4.13-15.15a1.76,1.76,0,0,1,.49-.84A2,2,0,0,1,136,1.42a4.32,4.32,0,0,1,4.07,2A7.17,7.17,0,0,1,140.83,7,17.49,17.49,0,0,1,139.38,14Z",opacity:1,strokeColor:"",fillColor:"#192760",width:127.70402,height:55.84601,stampFillColor:"#dce3ef",stampStrokeColor:""};break;case"Approved":t={iconName:"Approved",pathdata:"M19,20.22H10.55v-.71a4.26,4.26,0,0,0,1.79-.41,1.37,1.37,0,0,0,.53-1.29c0-.22,0-.75-.16-1.58,0-.17-.11-.89-.29-2.15H6.06l-1.72,3a4,4,0,0,0-.31.66,2,2,0,0,0-.14.69c0,.41.12.67.37.78a5.42,5.42,0,0,0,1.53.3v.71H0v-.71A4,4,0,0,0,1.21,19a5.68,5.68,0,0,0,1.28-1.56L13.45.07h.76L17,17a4.35,4.35,0,0,0,.7,2.08,2.4,2.4,0,0,0,1.31.44Zm-6.83-7.31L11.13,5.73,6.76,12.91Zm7.18,6.52a3,3,0,0,0,1.33-.49,3,3,0,0,0,.84-1.59L25.19,4.11c.07-.3.14-.6.2-.9a3.14,3.14,0,0,0,.1-.72,1,1,0,0,0-.58-1,5.68,5.68,0,0,0-1.57-.23V.48h8.47a9.68,9.68,0,0,1,3.57.57,4,4,0,0,1,2.71,4,4.93,4.93,0,0,1-2.2,4.22,9.53,9.53,0,0,1-5.69,1.58l-.85,0-1.71-.11L26,16.6l-.25,1a1,1,0,0,0-.05.3,2.83,2.83,0,0,0,0,.29c0,.5.14.81.4.94a6.31,6.31,0,0,0,1.76.31v.76H19.39Zm8.52-9.66.54.06h.48a5.81,5.81,0,0,0,2.3-.36,3.47,3.47,0,0,0,1.4-1.18,6.24,6.24,0,0,0,.86-2,8.94,8.94,0,0,0,.3-2,3.29,3.29,0,0,0-.58-2,2.3,2.3,0,0,0-2-.79,1.23,1.23,0,0,0-.93.28,2.71,2.71,0,0,0-.46,1Zm8,9.69a3.19,3.19,0,0,0,1.55-.52,3,3,0,0,0,.84-1.59L42,4.11c.07-.3.14-.6.2-.9a3.14,3.14,0,0,0,.1-.72,1,1,0,0,0-.58-1,5.68,5.68,0,0,0-1.57-.23V.48h8.47a9.68,9.68,0,0,1,3.57.57,4,4,0,0,1,2.71,4,4.93,4.93,0,0,1-2.2,4.22A9.53,9.53,0,0,1,47,10.87l-.85,0-1.71-.11L42.79,16.6l-.25,1a1.45,1.45,0,0,0,0,.3,2.83,2.83,0,0,0,0,.29c0,.5.14.81.4.94a6.31,6.31,0,0,0,1.76.31v.76h-8.7Zm8.74-9.69.54.06h.48A5.81,5.81,0,0,0,48,9.48a3.41,3.41,0,0,0,1.4-1.18,6.24,6.24,0,0,0,.86-2,9,9,0,0,0,.31-2,3.29,3.29,0,0,0-.59-2,2.3,2.3,0,0,0-2-.79,1.23,1.23,0,0,0-.93.28,2.88,2.88,0,0,0-.46,1Zm7.95,9.69a3.27,3.27,0,0,0,1.56-.52A3.06,3.06,0,0,0,55,17.35L58.64,4.11l.18-.71a4.72,4.72,0,0,0,.13-1c0-.47-.13-.77-.4-.9a6.74,6.74,0,0,0-1.74-.3V.48h8.11A13,13,0,0,1,69.14,1a3.7,3.7,0,0,1,2.74,3.75,4.8,4.8,0,0,1-.46,2,5,5,0,0,1-1.54,1.9,6.55,6.55,0,0,1-1.79,1,19.35,19.35,0,0,1-1.89.52c.1.3.16.49.2.57l2.27,6.66a3.49,3.49,0,0,0,1,1.7,3.08,3.08,0,0,0,1.6.41v.76H65.33l-3.19-9.76h-.83L59.57,16.6l-.25,1a1.87,1.87,0,0,0,0,.25,2.64,2.64,0,0,0,0,.28q0,.8.39,1a5.88,5.88,0,0,0,1.76.32v.76H52.62ZM63.94,9.3a3.79,3.79,0,0,0,2.11-1.13A6,6,0,0,0,67,6.55a5.84,5.84,0,0,0,.44-2.26,3.31,3.31,0,0,0-.61-2,2.47,2.47,0,0,0-2.09-.81,1.25,1.25,0,0,0-.88.26,2.34,2.34,0,0,0-.47,1.05L61.59,9.5A13.42,13.42,0,0,0,63.94,9.3ZM76.39,4.53Q80.26,0,85,0a7.34,7.34,0,0,1,5.23,1.92,6.76,6.76,0,0,1,2,5.19,13.9,13.9,0,0,1-3.62,9.07q-3.86,4.61-8.88,4.6a7.06,7.06,0,0,1-5.13-1.92,6.86,6.86,0,0,1-2-5.14A14,14,0,0,1,76.39,4.53ZM77.3,18a2.56,2.56,0,0,0,2.57,1.78A4.62,4.62,0,0,0,83,18.47,14.42,14.42,0,0,0,86,13.54a27.18,27.18,0,0,0,1.52-4.83,20.67,20.67,0,0,0,.54-4.11,4.38,4.38,0,0,0-.73-2.55A2.62,2.62,0,0,0,85,1q-3.68,0-6.19,6.54a24.29,24.29,0,0,0-1.9,8.26A5.91,5.91,0,0,0,77.3,18ZM102.23.48v.76a5.19,5.19,0,0,0-1.55.17,1,1,0,0,0-.72,1,2.46,2.46,0,0,0,0,.28L100,3l1.52,11.76L107.11,6c.44-.71.84-1.41,1.2-2.11a4.06,4.06,0,0,0,.53-1.66.79.79,0,0,0-.55-.81,6.11,6.11,0,0,0-1.35-.14V.48h5.67v.76a3.31,3.31,0,0,0-1,.45,5.33,5.33,0,0,0-1.18,1.4L99.26,20.78h-.94l-2.25-15A15.49,15.49,0,0,0,95.24,2c-.22-.39-.84-.62-1.83-.71V.48Zm7.35,19a3.19,3.19,0,0,0,1.55-.52,3,3,0,0,0,.84-1.59l3.62-13.24c.09-.34.16-.64.22-.92a3.27,3.27,0,0,0,.09-.7c0-.5-.14-.81-.4-.94a6.13,6.13,0,0,0-1.75-.31V.48h15.89l-1.25,5.6L127.6,6a5.32,5.32,0,0,0-.7-3q-1.12-1.52-4.56-1.51a2.61,2.61,0,0,0-1.51.28,2.12,2.12,0,0,0-.56,1.06L118.52,9.3a12.1,12.1,0,0,0,4-.51,5.8,5.8,0,0,0,2-2.61l.82.1-2.19,8.07-.81-.14c0-.28.07-.52.08-.73s0-.37,0-.51a2.4,2.4,0,0,0-.87-2.15,6.76,6.76,0,0,0-3.38-.57l-1.94,7.2a3.34,3.34,0,0,0-.11.51,3.67,3.67,0,0,0,0,.39.81.81,0,0,0,.32.66,2.3,2.3,0,0,0,1.33.26,12.39,12.39,0,0,0,4.57-.75A8.84,8.84,0,0,0,127,14.35l.72.13-1.74,5.74H109.58Zm18.27,0a3.27,3.27,0,0,0,1.37-.41,2.85,2.85,0,0,0,1-1.71l3.63-13.23c.1-.38.18-.69.23-1a3,3,0,0,0,.09-.67c0-.5-.15-.81-.42-.94A6.38,6.38,0,0,0,132,1.24V.48h8.57c2.9,0,5.1.74,6.62,2.22a8,8,0,0,1,2.26,6,10.72,10.72,0,0,1-3.35,7.84,13.3,13.3,0,0,1-9.8,3.7h-8.47ZM144.4,3.39a4.23,4.23,0,0,0-4-2,2,2,0,0,0-1.29.31,1.74,1.74,0,0,0-.48.83l-4.07,14.9a3.24,3.24,0,0,0-.07.39,1.69,1.69,0,0,0,0,.3,1,1,0,0,0,.36.84,2.27,2.27,0,0,0,1.27.26q5.26,0,7.62-5.42a17.25,17.25,0,0,0,1.43-6.94A7,7,0,0,0,144.4,3.39Z",opacity:1,strokeColor:"",fillColor:"#516c30",width:127.70402,height:55.84601,stampFillColor:"#e6eddf",stampStrokeColor:""};break;case"Confidential":t={iconName:"Confidential",pathdata:"M13.71,0,12.63,6.9,12,6.73c0-.41,0-.66,0-.73s0-.18,0-.32a6.16,6.16,0,0,0-.79-3.47,2.37,2.37,0,0,0-2-1.14c-1.64,0-3.07,1.51-4.29,4.55a22,22,0,0,0-1.64,8.29c0,2,.34,3.44,1,4.2A3,3,0,0,0,6.5,19.24a4.08,4.08,0,0,0,2.93-1.43,10.47,10.47,0,0,0,1.5-2.09l.64.65A8.84,8.84,0,0,1,9,19.72a5.24,5.24,0,0,1-3.08,1.09,5.16,5.16,0,0,1-4.21-2.08A8.68,8.68,0,0,1,0,13.16,16.5,16.5,0,0,1,2.55,3.92Q5.1,0,8.61,0a6.35,6.35,0,0,1,2.25.43,6.62,6.62,0,0,0,1.38.43.55.55,0,0,0,.5-.23A2.61,2.61,0,0,0,13.06,0ZM27.49,7.11a17.19,17.19,0,0,1-2.61,9.07q-2.77,4.61-6.39,4.6a4.42,4.42,0,0,1-3.7-1.92,8.47,8.47,0,0,1-1.43-5.14A17.31,17.31,0,0,1,16,4.53C17.88,1.51,20,0,22.25,0A4.53,4.53,0,0,1,26,1.92,8.27,8.27,0,0,1,27.49,7.11ZM24.42,4.6a5.71,5.71,0,0,0-.53-2.55A1.76,1.76,0,0,0,22.24,1q-2.65,0-4.45,6.54a31.93,31.93,0,0,0-1.37,8.26A8.15,8.15,0,0,0,16.67,18c.34,1.19,1,1.78,1.85,1.78a2.9,2.9,0,0,0,2.28-1.29,15.85,15.85,0,0,0,2.13-4.93A34.08,34.08,0,0,0,24,8.71,28.5,28.5,0,0,0,24.42,4.6ZM42.75,1.3l.3-.06V.48H38.69v.76a2.55,2.55,0,0,1,1.16.33,1.8,1.8,0,0,1,.51,1.48,10.11,10.11,0,0,1-.13,1.34c-.06.41-.14.87-.24,1.39l-1.65,8.34L33.73.48H29.45v.76a2.66,2.66,0,0,1,1,.24,1.88,1.88,0,0,1,.65,1.06l.09.3L28.81,15a20.72,20.72,0,0,1-1,3.61,1.61,1.61,0,0,1-1.19.9v.76h4.42v-.76a2.55,2.55,0,0,1-1.13-.32,1.67,1.67,0,0,1-.56-1.44,7.13,7.13,0,0,1,.05-.79c.06-.43.17-1.09.34-2L31.89,4.38l5.52,16.33h.52l3-15a22.58,22.58,0,0,1,.87-3.42A1.42,1.42,0,0,1,42.75,1.3ZM55.53.48H44.23v.76a3.63,3.63,0,0,1,1.26.3c.19.13.29.42.29.9a7.08,7.08,0,0,1-.09,1c0,.2-.08.44-.13.71L43,17.34a3.47,3.47,0,0,1-.59,1.58,1.91,1.91,0,0,1-1.13.54v.76h6.29v-.76a2.13,2.13,0,0,1-1-.19A1.23,1.23,0,0,1,46,18.1c0-.1,0-.21,0-.31s0-.23.05-.35l1.4-7.21a3.15,3.15,0,0,1,2.37.64A3.21,3.21,0,0,1,50.38,13c0,.11,0,.28,0,.49s0,.46-.06.75l.58.14,1.58-8.07-.59-.1a5.79,5.79,0,0,1-1.43,2.59,6.17,6.17,0,0,1-2.77.52l1.26-6.54a2.06,2.06,0,0,1,.42-1.08,1.39,1.39,0,0,1,1-.26c1.62,0,2.7.51,3.24,1.54a7.11,7.11,0,0,1,.49,3l.57.13Zm3.69,17.71c0-.08,0-.17,0-.27s0-.2,0-.3l.17-1L62.06,3.36a3.44,3.44,0,0,1,.59-1.6,2,2,0,0,1,1.12-.52V.48H57.44v.76a3.47,3.47,0,0,1,1.26.31c.2.13.3.44.3.94a4.25,4.25,0,0,1-.06.67c0,.26-.09.57-.17,1L56.16,17.35a3.52,3.52,0,0,1-.6,1.59,2,2,0,0,1-1.12.52v.76h6.33v-.76a3.3,3.3,0,0,1-1.26-.32C59.32,19,59.22,18.69,59.22,18.19Zm18-9.51a13,13,0,0,1-2.42,7.84,8.31,8.31,0,0,1-7,3.7H61.6v-.76a2,2,0,0,0,1-.41,3.14,3.14,0,0,0,.73-1.71L65.93,4.11c.08-.38.13-.69.17-1a4.36,4.36,0,0,0,.06-.67c0-.5-.1-.81-.3-.94a3.47,3.47,0,0,0-1.26-.31V.48h6.17A5.52,5.52,0,0,1,75.53,2.7,9.91,9.91,0,0,1,77.17,8.68ZM74,6.87a9.22,9.22,0,0,0-.53-3.48,2.91,2.91,0,0,0-2.87-2,1.12,1.12,0,0,0-.93.31,1.81,1.81,0,0,0-.35.83l-2.93,14.9a3,3,0,0,0-.05.39c0,.11,0,.21,0,.3a1.17,1.17,0,0,0,.25.84,1.3,1.3,0,0,0,.92.26q3.8,0,5.49-5.42A23.26,23.26,0,0,0,74,6.87Zm11.3,11.65a6.72,6.72,0,0,1-3.29.75,1.3,1.3,0,0,1-1-.26,1,1,0,0,1-.23-.66,3.28,3.28,0,0,1,0-.39,4.88,4.88,0,0,1,.08-.51l1.4-7.2a3.73,3.73,0,0,1,2.43.57A2.87,2.87,0,0,1,85.43,13c0,.14,0,.31,0,.51s0,.45-.06.73l.59.14,1.57-8.07-.59-.1a5.79,5.79,0,0,1-1.46,2.61,6.5,6.5,0,0,1-2.89.51l1.26-6.56a2.41,2.41,0,0,1,.41-1.06c.16-.19.52-.28,1.08-.28,1.65,0,2.75.5,3.29,1.51a7,7,0,0,1,.5,3l.57.13.9-5.6H79.14v.76a3.35,3.35,0,0,1,1.26.31c.19.13.29.44.29.94a5,5,0,0,1-.07.7c0,.28-.09.58-.15.92L77.86,17.35a3.52,3.52,0,0,1-.6,1.59,2,2,0,0,1-1.13.52v.76H87.91l1.25-5.74-.52-.13A7.69,7.69,0,0,1,85.34,18.52ZM105.8,1.24V.48h-4.37v.76a2.55,2.55,0,0,1,1.16.33,1.77,1.77,0,0,1,.52,1.48A10.58,10.58,0,0,1,103,4.39c-.06.41-.13.87-.23,1.39l-1.66,8.34L96.47.48H92.19v.76a2.61,2.61,0,0,1,1,.24,1.83,1.83,0,0,1,.65,1.06l.1.3L91.55,15a19,19,0,0,1-1,3.61,1.61,1.61,0,0,1-1.19.9v.76h4.42v-.76a2.59,2.59,0,0,1-1.13-.32,1.67,1.67,0,0,1-.56-1.44,7.13,7.13,0,0,1,0-.79c.06-.43.17-1.09.35-2L94.63,4.38l5.52,16.33h.53l2.95-15a22.93,22.93,0,0,1,.86-3.42,1.42,1.42,0,0,1,1-1Zm11.4,4.9L118,.48H106.28l-.82,5,.55.2a8,8,0,0,1,1.87-3.16,3.7,3.7,0,0,1,2.7-1.06l-3.12,15.85a2.94,2.94,0,0,1-.87,1.85,2.48,2.48,0,0,1-1.34.26v.76h7v-.76a4.24,4.24,0,0,1-1.43-.3c-.23-.13-.34-.45-.34-.95a2.26,2.26,0,0,1,0-.26c0-.09,0-.2,0-.33l.18-1,3-15.1a2.73,2.73,0,0,1,1.79.63c.75.7,1.13,2,1.17,3.94Zm3.57,12.05c0-.08,0-.17,0-.27s0-.2,0-.3l.17-1,2.62-13.24a3.44,3.44,0,0,1,.59-1.6,2,2,0,0,1,1.12-.52V.48H119v.76a3.47,3.47,0,0,1,1.26.31c.2.13.3.44.3.94a4.25,4.25,0,0,1-.06.67c0,.26-.09.57-.17,1l-2.61,13.24a3.52,3.52,0,0,1-.6,1.59,2,2,0,0,1-1.12.52v.76h6.33v-.76a3.36,3.36,0,0,1-1.26-.32C120.87,19,120.77,18.69,120.77,18.19Zm28.86-3.71-1.24,5.74H130.3v-.71a2.48,2.48,0,0,0,1.3-.41,1.64,1.64,0,0,0,.37-1.29c0-.22,0-.75-.11-1.58,0-.17-.08-.89-.21-2.15h-4.58l-1.24,3a5.1,5.1,0,0,0-.22.66,2.45,2.45,0,0,0-.1.69c0,.41.09.67.26.78a3.05,3.05,0,0,0,1.11.3v.71h-4.17v-.71a2.66,2.66,0,0,0,.87-.53,5.79,5.79,0,0,0,.92-1.56L132.39.07h.55L135,17a5.53,5.53,0,0,0,.5,2.08,1.67,1.67,0,0,0,1.14.46v0a1.93,1.93,0,0,0,1.12-.52,3.52,3.52,0,0,0,.6-1.6l2.61-13.23c.08-.38.13-.69.17-1a4.36,4.36,0,0,0,.06-.67c0-.5-.1-.81-.3-.94a3.47,3.47,0,0,0-1.26-.31V.48h6.73v.76a3.23,3.23,0,0,0-1.49.48,3.06,3.06,0,0,0-.64,1.64l-2.77,14.08c0,.16-.05.3-.07.44s0,.29,0,.47a.79.79,0,0,0,.31.71,1.55,1.55,0,0,0,.87.21,6.83,6.83,0,0,0,3.79-1,8.42,8.42,0,0,0,2.81-3.88ZM131.5,12.91l-.78-7.18-3.14,7.18Z",opacity:1,strokeColor:"",fillColor:"#192760",width:127.70402,height:55.84601,stampFillColor:"#dce3ef",stampStrokeColor:""};break;case"NotApproved":case"Not Approved":t={iconName:"Not Approved",pathdata:"M0,19.46a1.56,1.56,0,0,0,1.16-.9A19.84,19.84,0,0,0,2.1,15L4.42,2.84l-.09-.3a1.82,1.82,0,0,0-.64-1.06,2.41,2.41,0,0,0-1-.24V.48H6.88l4.49,13.64L13,5.78c.09-.52.17-1,.22-1.39a10.11,10.11,0,0,0,.13-1.34,1.83,1.83,0,0,0-.49-1.48,2.49,2.49,0,0,0-1.13-.33V.48H16v.76l-.29.06a1.42,1.42,0,0,0-1,1,23.7,23.7,0,0,0-.84,3.42L11,20.71h-.51L5.1,4.38,3,15c-.17.87-.28,1.53-.33,2a5.32,5.32,0,0,0,0,.79,1.69,1.69,0,0,0,.54,1.44,2.48,2.48,0,0,0,1.1.32v.76H0ZM17.73,4.53C19.54,1.51,21.55,0,23.79,0a4.4,4.4,0,0,1,3.66,1.92,8.52,8.52,0,0,1,1.43,5.19,17.56,17.56,0,0,1-2.53,9.07q-2.7,4.61-6.21,4.6a4.24,4.24,0,0,1-3.6-1.92,8.6,8.6,0,0,1-1.39-5.14A17.68,17.68,0,0,1,17.73,4.53ZM18.37,18c.33,1.19.93,1.78,1.8,1.78a2.83,2.83,0,0,0,2.22-1.29,16.41,16.41,0,0,0,2.06-4.93,35.53,35.53,0,0,0,1.06-4.83A28.26,28.26,0,0,0,25.9,4.6a5.86,5.86,0,0,0-.52-2.55A1.7,1.7,0,0,0,23.78,1Q21.2,1,19.45,7.53a33,33,0,0,0-1.33,8.26A8.15,8.15,0,0,0,18.37,18Zm11.08,1.48a2.34,2.34,0,0,0,1.3-.26,3,3,0,0,0,.85-1.85l3-15.85A3.54,3.54,0,0,0,32,2.56a8,8,0,0,0-1.82,3.16l-.53-.2.8-5H41.81l-.74,5.66-.54-.07c0-1.92-.41-3.24-1.13-3.94a2.6,2.6,0,0,0-1.74-.63L34.79,16.6l-.17,1a2.43,2.43,0,0,0,0,.33,2.26,2.26,0,0,0,0,.26c0,.5.11.82.33.95a3.94,3.94,0,0,0,1.39.3v.76H29.45Zm26.65.76H50.18v-.71a2.28,2.28,0,0,0,1.25-.41,1.64,1.64,0,0,0,.37-1.29c0-.22,0-.75-.11-1.58,0-.17-.08-.89-.2-2.15H47l-1.2,3c-.08.2-.15.42-.22.66a2.84,2.84,0,0,0-.09.69c0,.41.08.67.25.78a2.91,2.91,0,0,0,1.08.3v.71H42.79v-.71a2.44,2.44,0,0,0,.85-.53,5.59,5.59,0,0,0,.9-1.56L52.21.07h.53l2,16.88A5.46,5.46,0,0,0,55.2,19a1.36,1.36,0,0,0,.9.43Zm-4.76-7.31-.76-7.18-3,7.18Zm4.95,6.53a1.82,1.82,0,0,0,1-.5,3.56,3.56,0,0,0,.58-1.59L60.42,4.11c.06-.3.1-.6.15-.9a5.46,5.46,0,0,0,.06-.72c0-.52-.13-.86-.4-1a2.88,2.88,0,0,0-1.1-.23V.48h5.93a5,5,0,0,1,2.5.57c1.26.73,1.9,2.07,1.9,4a5.81,5.81,0,0,1-1.54,4.22,5.32,5.32,0,0,1-4,1.58l-.59,0-1.2-.11L61,16.6l-.17,1a2.72,2.72,0,0,0,0,.3,2.81,2.81,0,0,0,0,.29c0,.5.09.81.28.94a3.26,3.26,0,0,0,1.23.31v.76h-6Zm6-9.67.38.06H63a3,3,0,0,0,1.62-.36,2.87,2.87,0,0,0,1-1.18,7.28,7.28,0,0,0,.6-2,11.67,11.67,0,0,0,.22-2,4.4,4.4,0,0,0-.41-2,1.44,1.44,0,0,0-1.39-.79.71.71,0,0,0-.65.28,3.7,3.7,0,0,0-.32,1Zm5.61,9.69A1.86,1.86,0,0,0,69,18.94a3.54,3.54,0,0,0,.59-1.59L72.15,4.11q.09-.45.15-.9a5.73,5.73,0,0,0,.07-.72,1.1,1.1,0,0,0-.41-1,2.88,2.88,0,0,0-1.1-.23V.48h5.93a5,5,0,0,1,2.5.57c1.27.73,1.9,2.07,1.9,4a5.77,5.77,0,0,1-1.54,4.22,5.31,5.31,0,0,1-4,1.58l-.6,0-1.2-.11L72.74,16.6l-.17,1a2.72,2.72,0,0,0,0,.3c0,.1,0,.19,0,.29,0,.5.1.81.29.94a3.15,3.15,0,0,0,1.23.31v.76h-6.1Zm6.12-9.69.38.06h.33a3,3,0,0,0,1.62-.36,3,3,0,0,0,1-1.18,7.67,7.67,0,0,0,.59-2,11.67,11.67,0,0,0,.22-2,4.4,4.4,0,0,0-.41-2,1.43,1.43,0,0,0-1.38-.79.73.73,0,0,0-.66.28,3.7,3.7,0,0,0-.32,1Zm5.57,9.69a1.9,1.9,0,0,0,1.09-.52,3.56,3.56,0,0,0,.58-1.59L83.84,4.11c0-.27.09-.51.13-.71a7.08,7.08,0,0,0,.09-1c0-.47-.1-.77-.28-.9a3.53,3.53,0,0,0-1.22-.3V.48h5.68a6.57,6.57,0,0,1,3,.53q1.92,1,1.92,3.75a6.79,6.79,0,0,1-.32,2,5.23,5.23,0,0,1-1.08,1.9,4.56,4.56,0,0,1-1.25,1,11.62,11.62,0,0,1-1.33.52c.07.3.12.49.14.57l1.59,6.66a4.07,4.07,0,0,0,.69,1.7,1.72,1.72,0,0,0,1.13.41v.76H88.52l-2.23-9.76h-.58L84.49,16.6l-.17,1a1,1,0,0,0,0,.25,2.62,2.62,0,0,0,0,.28c0,.53.09.86.26,1a3.11,3.11,0,0,0,1.24.32v.76H79.63ZM87.55,9.3A2.59,2.59,0,0,0,89,8.17a7.24,7.24,0,0,0,.66-1.62A8.18,8.18,0,0,0,90,4.29a4.32,4.32,0,0,0-.43-2,1.5,1.5,0,0,0-1.45-.81.71.71,0,0,0-.62.26,2.78,2.78,0,0,0-.33,1.05L85.91,9.5A6.63,6.63,0,0,0,87.55,9.3Zm8.72-4.77Q99,0,102.32,0A4.37,4.37,0,0,1,106,1.92a8.46,8.46,0,0,1,1.44,5.19,17.58,17.58,0,0,1-2.54,9.07q-2.7,4.61-6.21,4.6a4.27,4.27,0,0,1-3.6-1.92,8.67,8.67,0,0,1-1.38-5.14A17.68,17.68,0,0,1,96.27,4.53ZM96.9,18c.33,1.19.93,1.78,1.8,1.78a2.83,2.83,0,0,0,2.22-1.29A16.63,16.63,0,0,0,103,13.54a37.1,37.1,0,0,0,1.06-4.83,29.49,29.49,0,0,0,.38-4.11,5.86,5.86,0,0,0-.51-2.55A1.71,1.71,0,0,0,102.31,1C100.6,1,99.15,3.17,98,7.53a33.42,33.42,0,0,0-1.33,8.26A8.57,8.57,0,0,0,96.9,18ZM114.35.48v.76a2.57,2.57,0,0,0-1.08.17,1.07,1.07,0,0,0-.5,1,2.53,2.53,0,0,0,0,.28,2.64,2.64,0,0,0,0,.28l1.07,11.76L117.77,6c.31-.71.59-1.41.84-2.11A5.25,5.25,0,0,0,119,2.19a.85.85,0,0,0-.38-.81,3.09,3.09,0,0,0-.95-.14V.48h4v.76a2.08,2.08,0,0,0-.73.45,5.35,5.35,0,0,0-.82,1.4l-7.79,17.69h-.66L110,5.74A22,22,0,0,0,109.46,2c-.16-.39-.58-.62-1.28-.71V.48Zm5.15,19a1.83,1.83,0,0,0,1.08-.52,3.42,3.42,0,0,0,.59-1.59l2.54-13.24c.06-.34.11-.64.15-.92a4.83,4.83,0,0,0,.06-.7c0-.5-.09-.81-.28-.94a3.14,3.14,0,0,0-1.22-.31V.48h11.12l-.87,5.6L132.11,6a7,7,0,0,0-.49-3c-.52-1-1.59-1.51-3.19-1.51-.55,0-.9.09-1.06.28A2.44,2.44,0,0,0,127,2.74L125.76,9.3a6.21,6.21,0,0,0,2.81-.51A6,6,0,0,0,130,6.18l.58.1L129,14.35l-.56-.14c0-.28,0-.52,0-.73s0-.37,0-.51a2.92,2.92,0,0,0-.61-2.15,3.55,3.55,0,0,0-2.37-.57l-1.36,7.2a4.79,4.79,0,0,0-.07.51,3.28,3.28,0,0,0,0,.39,1,1,0,0,0,.22.66,1.24,1.24,0,0,0,.93.26,6.43,6.43,0,0,0,3.21-.75,7.67,7.67,0,0,0,3.21-4.17l.5.13-1.22,5.74H119.5Zm12.79,0a1.87,1.87,0,0,0,1-.41,3.23,3.23,0,0,0,.71-1.71L136.5,4.11c.07-.38.13-.69.17-1a5.89,5.89,0,0,0,.05-.67c0-.5-.1-.81-.29-.94a3.32,3.32,0,0,0-1.22-.31V.48h6a5.35,5.35,0,0,1,4.63,2.22,10.11,10.11,0,0,1,1.58,6,13.3,13.3,0,0,1-2.34,7.84,8,8,0,0,1-6.86,3.7h-5.93ZM143.87,3.39a2.84,2.84,0,0,0-2.79-2,1.08,1.08,0,0,0-.91.31,1.93,1.93,0,0,0-.34.83L137,17.44a3.1,3.1,0,0,0-.06.39c0,.11,0,.21,0,.3a1.22,1.22,0,0,0,.24.84,1.26,1.26,0,0,0,.9.26q3.67,0,5.33-5.42a23.91,23.91,0,0,0,1-6.94A9.45,9.45,0,0,0,143.87,3.39Z",opacity:1,strokeColor:"",fillColor:"#8a251a",width:127.70402,height:55.84601,stampFillColor:"#f6dedd",stampStrokeColor:""}}if(t)return t.modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),this.currentStampAnnotation=t}},fAt.prototype.retrievestampAnnotation=function(e){if(e){var t=void 0;switch(e.trim()){case"Approved":t={iconName:"Approved",pathdata:"M19,20.22H10.55v-.71a4.26,4.26,0,0,0,1.79-.41,1.37,1.37,0,0,0,.53-1.29c0-.22,0-.75-.16-1.58,0-.17-.11-.89-.29-2.15H6.06l-1.72,3a4,4,0,0,0-.31.66,2,2,0,0,0-.14.69c0,.41.12.67.37.78a5.42,5.42,0,0,0,1.53.3v.71H0v-.71A4,4,0,0,0,1.21,19a5.68,5.68,0,0,0,1.28-1.56L13.45.07h.76L17,17a4.35,4.35,0,0,0,.7,2.08,2.4,2.4,0,0,0,1.31.44Zm-6.83-7.31L11.13,5.73,6.76,12.91Zm7.18,6.52a3,3,0,0,0,1.33-.49,3,3,0,0,0,.84-1.59L25.19,4.11c.07-.3.14-.6.2-.9a3.14,3.14,0,0,0,.1-.72,1,1,0,0,0-.58-1,5.68,5.68,0,0,0-1.57-.23V.48h8.47a9.68,9.68,0,0,1,3.57.57,4,4,0,0,1,2.71,4,4.93,4.93,0,0,1-2.2,4.22,9.53,9.53,0,0,1-5.69,1.58l-.85,0-1.71-.11L26,16.6l-.25,1a1,1,0,0,0-.05.3,2.83,2.83,0,0,0,0,.29c0,.5.14.81.4.94a6.31,6.31,0,0,0,1.76.31v.76H19.39Zm8.52-9.66.54.06h.48a5.81,5.81,0,0,0,2.3-.36,3.47,3.47,0,0,0,1.4-1.18,6.24,6.24,0,0,0,.86-2,8.94,8.94,0,0,0,.3-2,3.29,3.29,0,0,0-.58-2,2.3,2.3,0,0,0-2-.79,1.23,1.23,0,0,0-.93.28,2.71,2.71,0,0,0-.46,1Zm8,9.69a3.19,3.19,0,0,0,1.55-.52,3,3,0,0,0,.84-1.59L42,4.11c.07-.3.14-.6.2-.9a3.14,3.14,0,0,0,.1-.72,1,1,0,0,0-.58-1,5.68,5.68,0,0,0-1.57-.23V.48h8.47a9.68,9.68,0,0,1,3.57.57,4,4,0,0,1,2.71,4,4.93,4.93,0,0,1-2.2,4.22A9.53,9.53,0,0,1,47,10.87l-.85,0-1.71-.11L42.79,16.6l-.25,1a1.45,1.45,0,0,0,0,.3,2.83,2.83,0,0,0,0,.29c0,.5.14.81.4.94a6.31,6.31,0,0,0,1.76.31v.76h-8.7Zm8.74-9.69.54.06h.48A5.81,5.81,0,0,0,48,9.48a3.41,3.41,0,0,0,1.4-1.18,6.24,6.24,0,0,0,.86-2,9,9,0,0,0,.31-2,3.29,3.29,0,0,0-.59-2,2.3,2.3,0,0,0-2-.79,1.23,1.23,0,0,0-.93.28,2.88,2.88,0,0,0-.46,1Zm7.95,9.69a3.27,3.27,0,0,0,1.56-.52A3.06,3.06,0,0,0,55,17.35L58.64,4.11l.18-.71a4.72,4.72,0,0,0,.13-1c0-.47-.13-.77-.4-.9a6.74,6.74,0,0,0-1.74-.3V.48h8.11A13,13,0,0,1,69.14,1a3.7,3.7,0,0,1,2.74,3.75,4.8,4.8,0,0,1-.46,2,5,5,0,0,1-1.54,1.9,6.55,6.55,0,0,1-1.79,1,19.35,19.35,0,0,1-1.89.52c.1.3.16.49.2.57l2.27,6.66a3.49,3.49,0,0,0,1,1.7,3.08,3.08,0,0,0,1.6.41v.76H65.33l-3.19-9.76h-.83L59.57,16.6l-.25,1a1.87,1.87,0,0,0,0,.25,2.64,2.64,0,0,0,0,.28q0,.8.39,1a5.88,5.88,0,0,0,1.76.32v.76H52.62ZM63.94,9.3a3.79,3.79,0,0,0,2.11-1.13A6,6,0,0,0,67,6.55a5.84,5.84,0,0,0,.44-2.26,3.31,3.31,0,0,0-.61-2,2.47,2.47,0,0,0-2.09-.81,1.25,1.25,0,0,0-.88.26,2.34,2.34,0,0,0-.47,1.05L61.59,9.5A13.42,13.42,0,0,0,63.94,9.3ZM76.39,4.53Q80.26,0,85,0a7.34,7.34,0,0,1,5.23,1.92,6.76,6.76,0,0,1,2,5.19,13.9,13.9,0,0,1-3.62,9.07q-3.86,4.61-8.88,4.6a7.06,7.06,0,0,1-5.13-1.92,6.86,6.86,0,0,1-2-5.14A14,14,0,0,1,76.39,4.53ZM77.3,18a2.56,2.56,0,0,0,2.57,1.78A4.62,4.62,0,0,0,83,18.47,14.42,14.42,0,0,0,86,13.54a27.18,27.18,0,0,0,1.52-4.83,20.67,20.67,0,0,0,.54-4.11,4.38,4.38,0,0,0-.73-2.55A2.62,2.62,0,0,0,85,1q-3.68,0-6.19,6.54a24.29,24.29,0,0,0-1.9,8.26A5.91,5.91,0,0,0,77.3,18ZM102.23.48v.76a5.19,5.19,0,0,0-1.55.17,1,1,0,0,0-.72,1,2.46,2.46,0,0,0,0,.28L100,3l1.52,11.76L107.11,6c.44-.71.84-1.41,1.2-2.11a4.06,4.06,0,0,0,.53-1.66.79.79,0,0,0-.55-.81,6.11,6.11,0,0,0-1.35-.14V.48h5.67v.76a3.31,3.31,0,0,0-1,.45,5.33,5.33,0,0,0-1.18,1.4L99.26,20.78h-.94l-2.25-15A15.49,15.49,0,0,0,95.24,2c-.22-.39-.84-.62-1.83-.71V.48Zm7.35,19a3.19,3.19,0,0,0,1.55-.52,3,3,0,0,0,.84-1.59l3.62-13.24c.09-.34.16-.64.22-.92a3.27,3.27,0,0,0,.09-.7c0-.5-.14-.81-.4-.94a6.13,6.13,0,0,0-1.75-.31V.48h15.89l-1.25,5.6L127.6,6a5.32,5.32,0,0,0-.7-3q-1.12-1.52-4.56-1.51a2.61,2.61,0,0,0-1.51.28,2.12,2.12,0,0,0-.56,1.06L118.52,9.3a12.1,12.1,0,0,0,4-.51,5.8,5.8,0,0,0,2-2.61l.82.1-2.19,8.07-.81-.14c0-.28.07-.52.08-.73s0-.37,0-.51a2.4,2.4,0,0,0-.87-2.15,6.76,6.76,0,0,0-3.38-.57l-1.94,7.2a3.34,3.34,0,0,0-.11.51,3.67,3.67,0,0,0,0,.39.81.81,0,0,0,.32.66,2.3,2.3,0,0,0,1.33.26,12.39,12.39,0,0,0,4.57-.75A8.84,8.84,0,0,0,127,14.35l.72.13-1.74,5.74H109.58Zm18.27,0a3.27,3.27,0,0,0,1.37-.41,2.85,2.85,0,0,0,1-1.71l3.63-13.23c.1-.38.18-.69.23-1a3,3,0,0,0,.09-.67c0-.5-.15-.81-.42-.94A6.38,6.38,0,0,0,132,1.24V.48h8.57c2.9,0,5.1.74,6.62,2.22a8,8,0,0,1,2.26,6,10.72,10.72,0,0,1-3.35,7.84,13.3,13.3,0,0,1-9.8,3.7h-8.47ZM144.4,3.39a4.23,4.23,0,0,0-4-2,2,2,0,0,0-1.29.31,1.74,1.74,0,0,0-.48.83l-4.07,14.9a3.24,3.24,0,0,0-.07.39,1.69,1.69,0,0,0,0,.3,1,1,0,0,0,.36.84,2.27,2.27,0,0,0,1.27.26q5.26,0,7.62-5.42a17.25,17.25,0,0,0,1.43-6.94A7,7,0,0,0,144.4,3.39Z",opacity:1,strokeColor:"",fillColor:"#516c30",width:149.474,height:20.783,stampFillColor:"#e6eddf",stampStrokeColor:""};break;case"Confidential":t={iconName:"Confidential",pathdata:"M13.71,0,12.63,6.9,12,6.73c0-.41,0-.66,0-.73s0-.18,0-.32a6.16,6.16,0,0,0-.79-3.47,2.37,2.37,0,0,0-2-1.14c-1.64,0-3.07,1.51-4.29,4.55a22,22,0,0,0-1.64,8.29c0,2,.34,3.44,1,4.2A3,3,0,0,0,6.5,19.24a4.08,4.08,0,0,0,2.93-1.43,10.47,10.47,0,0,0,1.5-2.09l.64.65A8.84,8.84,0,0,1,9,19.72a5.24,5.24,0,0,1-3.08,1.09,5.16,5.16,0,0,1-4.21-2.08A8.68,8.68,0,0,1,0,13.16,16.5,16.5,0,0,1,2.55,3.92Q5.1,0,8.61,0a6.35,6.35,0,0,1,2.25.43,6.62,6.62,0,0,0,1.38.43.55.55,0,0,0,.5-.23A2.61,2.61,0,0,0,13.06,0ZM27.49,7.11a17.19,17.19,0,0,1-2.61,9.07q-2.77,4.61-6.39,4.6a4.42,4.42,0,0,1-3.7-1.92,8.47,8.47,0,0,1-1.43-5.14A17.31,17.31,0,0,1,16,4.53C17.88,1.51,20,0,22.25,0A4.53,4.53,0,0,1,26,1.92,8.27,8.27,0,0,1,27.49,7.11ZM24.42,4.6a5.71,5.71,0,0,0-.53-2.55A1.76,1.76,0,0,0,22.24,1q-2.65,0-4.45,6.54a31.93,31.93,0,0,0-1.37,8.26A8.15,8.15,0,0,0,16.67,18c.34,1.19,1,1.78,1.85,1.78a2.9,2.9,0,0,0,2.28-1.29,15.85,15.85,0,0,0,2.13-4.93A34.08,34.08,0,0,0,24,8.71,28.5,28.5,0,0,0,24.42,4.6ZM42.75,1.3l.3-.06V.48H38.69v.76a2.55,2.55,0,0,1,1.16.33,1.8,1.8,0,0,1,.51,1.48,10.11,10.11,0,0,1-.13,1.34c-.06.41-.14.87-.24,1.39l-1.65,8.34L33.73.48H29.45v.76a2.66,2.66,0,0,1,1,.24,1.88,1.88,0,0,1,.65,1.06l.09.3L28.81,15a20.72,20.72,0,0,1-1,3.61,1.61,1.61,0,0,1-1.19.9v.76h4.42v-.76a2.55,2.55,0,0,1-1.13-.32,1.67,1.67,0,0,1-.56-1.44,7.13,7.13,0,0,1,.05-.79c.06-.43.17-1.09.34-2L31.89,4.38l5.52,16.33h.52l3-15a22.58,22.58,0,0,1,.87-3.42A1.42,1.42,0,0,1,42.75,1.3ZM55.53.48H44.23v.76a3.63,3.63,0,0,1,1.26.3c.19.13.29.42.29.9a7.08,7.08,0,0,1-.09,1c0,.2-.08.44-.13.71L43,17.34a3.47,3.47,0,0,1-.59,1.58,1.91,1.91,0,0,1-1.13.54v.76h6.29v-.76a2.13,2.13,0,0,1-1-.19A1.23,1.23,0,0,1,46,18.1c0-.1,0-.21,0-.31s0-.23.05-.35l1.4-7.21a3.15,3.15,0,0,1,2.37.64A3.21,3.21,0,0,1,50.38,13c0,.11,0,.28,0,.49s0,.46-.06.75l.58.14,1.58-8.07-.59-.1a5.79,5.79,0,0,1-1.43,2.59,6.17,6.17,0,0,1-2.77.52l1.26-6.54a2.06,2.06,0,0,1,.42-1.08,1.39,1.39,0,0,1,1-.26c1.62,0,2.7.51,3.24,1.54a7.11,7.11,0,0,1,.49,3l.57.13Zm3.69,17.71c0-.08,0-.17,0-.27s0-.2,0-.3l.17-1L62.06,3.36a3.44,3.44,0,0,1,.59-1.6,2,2,0,0,1,1.12-.52V.48H57.44v.76a3.47,3.47,0,0,1,1.26.31c.2.13.3.44.3.94a4.25,4.25,0,0,1-.06.67c0,.26-.09.57-.17,1L56.16,17.35a3.52,3.52,0,0,1-.6,1.59,2,2,0,0,1-1.12.52v.76h6.33v-.76a3.3,3.3,0,0,1-1.26-.32C59.32,19,59.22,18.69,59.22,18.19Zm18-9.51a13,13,0,0,1-2.42,7.84,8.31,8.31,0,0,1-7,3.7H61.6v-.76a2,2,0,0,0,1-.41,3.14,3.14,0,0,0,.73-1.71L65.93,4.11c.08-.38.13-.69.17-1a4.36,4.36,0,0,0,.06-.67c0-.5-.1-.81-.3-.94a3.47,3.47,0,0,0-1.26-.31V.48h6.17A5.52,5.52,0,0,1,75.53,2.7,9.91,9.91,0,0,1,77.17,8.68ZM74,6.87a9.22,9.22,0,0,0-.53-3.48,2.91,2.91,0,0,0-2.87-2,1.12,1.12,0,0,0-.93.31,1.81,1.81,0,0,0-.35.83l-2.93,14.9a3,3,0,0,0-.05.39c0,.11,0,.21,0,.3a1.17,1.17,0,0,0,.25.84,1.3,1.3,0,0,0,.92.26q3.8,0,5.49-5.42A23.26,23.26,0,0,0,74,6.87Zm11.3,11.65a6.72,6.72,0,0,1-3.29.75,1.3,1.3,0,0,1-1-.26,1,1,0,0,1-.23-.66,3.28,3.28,0,0,1,0-.39,4.88,4.88,0,0,1,.08-.51l1.4-7.2a3.73,3.73,0,0,1,2.43.57A2.87,2.87,0,0,1,85.43,13c0,.14,0,.31,0,.51s0,.45-.06.73l.59.14,1.57-8.07-.59-.1a5.79,5.79,0,0,1-1.46,2.61,6.5,6.5,0,0,1-2.89.51l1.26-6.56a2.41,2.41,0,0,1,.41-1.06c.16-.19.52-.28,1.08-.28,1.65,0,2.75.5,3.29,1.51a7,7,0,0,1,.5,3l.57.13.9-5.6H79.14v.76a3.35,3.35,0,0,1,1.26.31c.19.13.29.44.29.94a5,5,0,0,1-.07.7c0,.28-.09.58-.15.92L77.86,17.35a3.52,3.52,0,0,1-.6,1.59,2,2,0,0,1-1.13.52v.76H87.91l1.25-5.74-.52-.13A7.69,7.69,0,0,1,85.34,18.52ZM105.8,1.24V.48h-4.37v.76a2.55,2.55,0,0,1,1.16.33,1.77,1.77,0,0,1,.52,1.48A10.58,10.58,0,0,1,103,4.39c-.06.41-.13.87-.23,1.39l-1.66,8.34L96.47.48H92.19v.76a2.61,2.61,0,0,1,1,.24,1.83,1.83,0,0,1,.65,1.06l.1.3L91.55,15a19,19,0,0,1-1,3.61,1.61,1.61,0,0,1-1.19.9v.76h4.42v-.76a2.59,2.59,0,0,1-1.13-.32,1.67,1.67,0,0,1-.56-1.44,7.13,7.13,0,0,1,0-.79c.06-.43.17-1.09.35-2L94.63,4.38l5.52,16.33h.53l2.95-15a22.93,22.93,0,0,1,.86-3.42,1.42,1.42,0,0,1,1-1Zm11.4,4.9L118,.48H106.28l-.82,5,.55.2a8,8,0,0,1,1.87-3.16,3.7,3.7,0,0,1,2.7-1.06l-3.12,15.85a2.94,2.94,0,0,1-.87,1.85,2.48,2.48,0,0,1-1.34.26v.76h7v-.76a4.24,4.24,0,0,1-1.43-.3c-.23-.13-.34-.45-.34-.95a2.26,2.26,0,0,1,0-.26c0-.09,0-.2,0-.33l.18-1,3-15.1a2.73,2.73,0,0,1,1.79.63c.75.7,1.13,2,1.17,3.94Zm3.57,12.05c0-.08,0-.17,0-.27s0-.2,0-.3l.17-1,2.62-13.24a3.44,3.44,0,0,1,.59-1.6,2,2,0,0,1,1.12-.52V.48H119v.76a3.47,3.47,0,0,1,1.26.31c.2.13.3.44.3.94a4.25,4.25,0,0,1-.06.67c0,.26-.09.57-.17,1l-2.61,13.24a3.52,3.52,0,0,1-.6,1.59,2,2,0,0,1-1.12.52v.76h6.33v-.76a3.36,3.36,0,0,1-1.26-.32C120.87,19,120.77,18.69,120.77,18.19Zm28.86-3.71-1.24,5.74H130.3v-.71a2.48,2.48,0,0,0,1.3-.41,1.64,1.64,0,0,0,.37-1.29c0-.22,0-.75-.11-1.58,0-.17-.08-.89-.21-2.15h-4.58l-1.24,3a5.1,5.1,0,0,0-.22.66,2.45,2.45,0,0,0-.1.69c0,.41.09.67.26.78a3.05,3.05,0,0,0,1.11.3v.71h-4.17v-.71a2.66,2.66,0,0,0,.87-.53,5.79,5.79,0,0,0,.92-1.56L132.39.07h.55L135,17a5.53,5.53,0,0,0,.5,2.08,1.67,1.67,0,0,0,1.14.46v0a1.93,1.93,0,0,0,1.12-.52,3.52,3.52,0,0,0,.6-1.6l2.61-13.23c.08-.38.13-.69.17-1a4.36,4.36,0,0,0,.06-.67c0-.5-.1-.81-.3-.94a3.47,3.47,0,0,0-1.26-.31V.48h6.73v.76a3.23,3.23,0,0,0-1.49.48,3.06,3.06,0,0,0-.64,1.64l-2.77,14.08c0,.16-.05.3-.07.44s0,.29,0,.47a.79.79,0,0,0,.31.71,1.55,1.55,0,0,0,.87.21,6.83,6.83,0,0,0,3.79-1,8.42,8.42,0,0,0,2.81-3.88ZM131.5,12.91l-.78-7.18-3.14,7.18Z",opacity:1,strokeColor:"",fillColor:"#192760",width:149.633,height:20.811,stampFillColor:"#dce3ef",stampStrokeColor:""};break;case"Witness":t={iconName:"Witness",pathdata:"M19.63,2.67,12.77,16.84h-.69L10.63,5.17,5.05,16.84H4.36L2.5,2.92A3.13,3.13,0,0,0,2,1.35,2.38,2.38,0,0,0,.63.91V.33H7.3V1a2.27,2.27,0,0,0-.92.17A1.11,1.11,0,0,0,5.84,2.2v.16c0,.05,0,.13,0,.22L6.81,11l3.57-7.48a.79.79,0,0,0,0-.23,2.78,2.78,0,0,0-.53-2A2.23,2.23,0,0,0,8.68.91V.33h6.45V.91A2.42,2.42,0,0,0,14,1.2c-.23.16-.34.5-.34,1,0,.11,0,.26,0,.46s.07.73.12,1.21l.8,7L18.3,3.11c.09-.19.17-.4.25-.62a2.11,2.11,0,0,0,.11-.65.73.73,0,0,0-.4-.76,2.73,2.73,0,0,0-1.1-.17V.33h4.47V.91a1.92,1.92,0,0,0-.91.3A3.66,3.66,0,0,0,19.63,2.67ZM29.76.33H22.62V1A5.07,5.07,0,0,1,24,1.2c.23.11.34.36.34.77a2.86,2.86,0,0,1-.06.54c0,.21-.11.47-.19.77L21.17,14.05a2.47,2.47,0,0,1-.68,1.29,2.62,2.62,0,0,1-1.27.42v.62h7.15v-.62A5.09,5.09,0,0,1,25,15.51c-.22-.11-.33-.37-.33-.77a2,2,0,0,1,0-.23c0-.08,0-.16,0-.24l.19-.83,3-10.77a2.5,2.5,0,0,1,.66-1.3A2.76,2.76,0,0,1,29.76,1ZM41.9,4.88l.63,0,.86-4.6H30.2l-.93,4.1.62.16A6.6,6.6,0,0,1,32,2a5.22,5.22,0,0,1,3.06-.86L31.53,14.05a2.24,2.24,0,0,1-1,1.5,3.67,3.67,0,0,1-1.51.21v.62H37v-.62a6,6,0,0,1-1.62-.24c-.26-.1-.39-.36-.39-.77,0-.07,0-.14,0-.21s0-.16.05-.27l.2-.83L38.57,1.16a3.76,3.76,0,0,1,2,.52A3.69,3.69,0,0,1,41.9,4.88ZM59.24,1,59.58,1V.33H54.65V1A3.78,3.78,0,0,1,56,1.22a1.25,1.25,0,0,1,.58,1.2,6.26,6.26,0,0,1-.15,1.09c-.07.33-.16.71-.27,1.13l-1.87,6.79L49.05.33H44.21V1a3.51,3.51,0,0,1,1.13.2,1.51,1.51,0,0,1,.74.85l.1.25L43.49,12.1A13.5,13.5,0,0,1,42.4,15a1.87,1.87,0,0,1-1.35.72v.62h5v-.62a3.62,3.62,0,0,1-1.28-.26,1.19,1.19,0,0,1-.64-1.17,3.55,3.55,0,0,1,.06-.64q.11-.53.39-1.59L47,3.5,53.2,16.78h.59L57.13,4.6a15.29,15.29,0,0,1,1-2.78A1.51,1.51,0,0,1,59.24,1Zm7.26.31a2.11,2.11,0,0,1,1.23-.23c1.87,0,3.1.41,3.71,1.23A4.39,4.39,0,0,1,72,4.78l.64.11,1-4.56H60.75V1a5,5,0,0,1,1.42.25c.22.11.32.36.32.77a2.73,2.73,0,0,1-.07.57c0,.22-.1.47-.17.74l-3,10.77a2.47,2.47,0,0,1-.68,1.29,2.62,2.62,0,0,1-1.27.42v.62h13.3l1.42-4.66-.59-.11A7.1,7.1,0,0,1,67.75,15a10,10,0,0,1-3.72.61A1.86,1.86,0,0,1,63,15.4a.67.67,0,0,1-.26-.54,2.36,2.36,0,0,1,0-.32,3.38,3.38,0,0,1,.09-.41l1.58-5.86a5.48,5.48,0,0,1,2.75.47,2,2,0,0,1,.71,1.75c0,.11,0,.25,0,.41s0,.37-.06.6l.65.11L70.2,5.05,69.54,5a4.69,4.69,0,0,1-1.65,2.12,10.06,10.06,0,0,1-3.26.41l1.42-5.33A1.75,1.75,0,0,1,66.5,1.31ZM80.88.83a2.77,2.77,0,0,1,2.46,1.26A4.36,4.36,0,0,1,84,4l.08.78.62.08,1-4.8H85a1.77,1.77,0,0,1-.38.43A1,1,0,0,1,84,.67a2.76,2.76,0,0,1-.37,0l-.41-.1-.61-.2a4.78,4.78,0,0,0-.79-.2A6.71,6.71,0,0,0,80.46,0a4.76,4.76,0,0,0-3.62,1.36,4.61,4.61,0,0,0-1.29,3.29q0,2.05,2.94,4.47t2.94,3.82a3.19,3.19,0,0,1-.79,2.14,2.8,2.8,0,0,1-2.23.92,3.43,3.43,0,0,1-1.5-.33,3.82,3.82,0,0,1-2-2.5,10.33,10.33,0,0,1-.2-1.67L74,11.45l-.87,5.38h.73a2.85,2.85,0,0,1,.38-.67A.75.75,0,0,1,74.8,16a1.12,1.12,0,0,1,.27,0l.42.15.61.22a8.62,8.62,0,0,0,1.3.35,7.53,7.53,0,0,0,1.32.12,5.48,5.48,0,0,0,4.11-1.53,4.77,4.77,0,0,0,1.49-3.43,4.59,4.59,0,0,0-.77-2.63,9.31,9.31,0,0,0-1.87-2L79.61,5.5a4.31,4.31,0,0,1-.74-.77,2.55,2.55,0,0,1-.43-1.45,2.68,2.68,0,0,1,.42-1.44A2.23,2.23,0,0,1,80.88.83Zm12.31,0a2.8,2.8,0,0,1,2.47,1.26A4.49,4.49,0,0,1,96.35,4l.08.78.62.08,1-4.8h-.71a1.62,1.62,0,0,1-.39.43,1,1,0,0,1-.64.18,2.9,2.9,0,0,1-.38,0l-.41-.1-.61-.2a4.65,4.65,0,0,0-.78-.2A6.88,6.88,0,0,0,92.77,0a4.73,4.73,0,0,0-3.61,1.36,4.57,4.57,0,0,0-1.3,3.29q0,2.05,2.94,4.47c2,1.54,3,2.81,3,3.82a3.2,3.2,0,0,1-.8,2.14,2.78,2.78,0,0,1-2.23.92,3.36,3.36,0,0,1-1.49-.33A3.68,3.68,0,0,1,88,14.73a3.76,3.76,0,0,1-.81-1.56A10.6,10.6,0,0,1,87,11.5l-.7-.05-.86,5.38h.72a2.85,2.85,0,0,1,.38-.67.78.78,0,0,1,.57-.19,1.12,1.12,0,0,1,.27,0l.42.15.61.22a8.74,8.74,0,0,0,1.31.35,7.37,7.37,0,0,0,1.32.12,5.49,5.49,0,0,0,4.11-1.53,4.81,4.81,0,0,0,1.49-3.43,4.67,4.67,0,0,0-.77-2.63A9.57,9.57,0,0,0,94,7.2L91.93,5.5a4,4,0,0,1-.74-.77,2.48,2.48,0,0,1-.43-1.45,2.68,2.68,0,0,1,.42-1.44A2.2,2.2,0,0,1,93.19.83Z",opacity:1,strokeColor:"",fillColor:"#192760",width:97.39,height:16.84,stampFillColor:"#dce3ef",stampStrokeColor:""};break;case"InitialHere":case"Initial Here":t={iconName:"Initial Here",pathdata:"M6.36,15.51a5.09,5.09,0,0,0,1.42.25v.62H.63v-.62a2.62,2.62,0,0,0,1.27-.42,2.47,2.47,0,0,0,.68-1.29l3-10.77c.08-.3.15-.56.19-.77A2.86,2.86,0,0,0,5.78,2c0-.41-.11-.66-.34-.77A5.07,5.07,0,0,0,4,1V.33h7.14V1a2.76,2.76,0,0,0-1.27.42,2.5,2.5,0,0,0-.66,1.3l-3,10.77-.19.83c0,.08,0,.16,0,.24a2,2,0,0,0,0,.23C6,15.14,6.14,15.4,6.36,15.51ZM27,1,27.36,1V.33H22.43V1a3.78,3.78,0,0,1,1.31.27,1.25,1.25,0,0,1,.58,1.2,6.26,6.26,0,0,1-.15,1.09c-.07.33-.16.71-.27,1.13L22,11.43,16.83.33H12V1a3.49,3.49,0,0,1,1.12.2,1.51,1.51,0,0,1,.74.85l.11.25-2.7,9.85A13,13,0,0,1,10.18,15a1.85,1.85,0,0,1-1.35.72v.62h5v-.62a3.62,3.62,0,0,1-1.28-.26,1.19,1.19,0,0,1-.63-1.17,4.72,4.72,0,0,1,.05-.64q.1-.53.39-1.59l2.39-8.6L21,16.78h.6L24.91,4.6a15.29,15.29,0,0,1,1-2.78A1.51,1.51,0,0,1,27,1ZM35.78.33H28.64V1a5.16,5.16,0,0,1,1.41.25c.23.11.34.36.34.77a2.86,2.86,0,0,1-.06.54c0,.21-.11.47-.19.77L27.19,14.05a2.47,2.47,0,0,1-.68,1.29,2.66,2.66,0,0,1-1.27.42v.62h7.15v-.62A5.09,5.09,0,0,1,31,15.51c-.22-.11-.33-.37-.33-.77a2,2,0,0,1,0-.23,2,2,0,0,1,0-.24l.19-.83,3-10.77a2.5,2.5,0,0,1,.66-1.3A2.76,2.76,0,0,1,35.78,1Zm12.76,4.6.87-4.6H36.22l-.93,4.1.62.16A6.52,6.52,0,0,1,38,2a5.21,5.21,0,0,1,3-.86L37.55,14.05a2.24,2.24,0,0,1-1,1.5,3.7,3.7,0,0,1-1.51.21v.62H43v-.62a5.79,5.79,0,0,1-1.61-.24c-.26-.1-.39-.36-.39-.77a1.48,1.48,0,0,1,0-.21,2,2,0,0,1,0-.27l.2-.83L44.58,1.16a3.77,3.77,0,0,1,2,.52,3.74,3.74,0,0,1,1.31,3.2Zm4,9.81a.93.93,0,0,1,0-.23,2,2,0,0,1,0-.24l.18-.83,3-10.77a2.42,2.42,0,0,1,.67-1.3A2.72,2.72,0,0,1,57.72,1V.33H50.57V1A5.26,5.26,0,0,1,52,1.2c.23.11.34.36.34.77a2.28,2.28,0,0,1-.07.54,7.71,7.71,0,0,1-.19.77l-3,10.77a2.4,2.4,0,0,1-.68,1.29,2.58,2.58,0,0,1-1.26.42v.62h7.14v-.62a5.07,5.07,0,0,1-1.41-.25C52.69,15.4,52.58,15.14,52.58,14.74Zm32-3.13.57.11-1.4,4.66H63.34v-.57a3.65,3.65,0,0,0,1.46-.34c.29-.16.43-.51.43-1,0-.18,0-.61-.13-1.29,0-.14-.09-.73-.23-1.75H59.69l-1.4,2.44a3.38,3.38,0,0,0-.25.54,1.64,1.64,0,0,0-.11.56q0,.5.3.63a4.41,4.41,0,0,0,1.25.25v.57H54.76v-.57a3.36,3.36,0,0,0,1-.43,4.58,4.58,0,0,0,1-1.27L65.7,0h.62l2.3,13.72a3.49,3.49,0,0,0,.56,1.7,2.34,2.34,0,0,0,1.29.37v0a2.58,2.58,0,0,0,1.26-.42,2.46,2.46,0,0,0,.68-1.3L75.35,3.28c.09-.3.16-.56.2-.77A2.86,2.86,0,0,0,75.61,2c0-.41-.11-.66-.34-.77A5.17,5.17,0,0,0,73.85,1V.33h7.61V1a4.77,4.77,0,0,0-1.69.39A2.27,2.27,0,0,0,79,2.67L75.92,14.12c0,.13,0,.25-.07.36a2.21,2.21,0,0,0,0,.39.59.59,0,0,0,.35.57,2.33,2.33,0,0,0,1,.17,10.06,10.06,0,0,0,4.28-.84A7.67,7.67,0,0,0,84.6,11.61ZM64.7,10.44,63.81,4.6l-3.55,5.84Zm38,4.32a.71.71,0,0,1,0-.16s0-.16.07-.34l.2-.83L106,2.67a2.43,2.43,0,0,1,.79-1.39A2.78,2.78,0,0,1,107.9,1V.33h-7.15V1a4.45,4.45,0,0,1,1.27.19.81.81,0,0,1,.47.83,2.73,2.73,0,0,1-.07.57c0,.22-.1.47-.17.74l-1.14,4.16h-5.7L96.7,2.67a2.27,2.27,0,0,1,.73-1.33A4.77,4.77,0,0,1,99.12,1V.33H91.51V1a5.09,5.09,0,0,1,1.42.25c.22.11.33.36.33.77a2.93,2.93,0,0,1-.08.58c-.05.24-.1.48-.17.73L90.07,14a2.73,2.73,0,0,1-.65,1.29,2.47,2.47,0,0,1-1.3.43v.62h7.15v-.62a5.13,5.13,0,0,1-1.42-.24c-.21-.1-.31-.34-.31-.72a3.11,3.11,0,0,1,0-.57c0-.16.1-.43.19-.8L95.12,8.5h5.7L99.31,14a2.21,2.21,0,0,1-.74,1.33,4.36,4.36,0,0,1-1.69.39v.62h7.63v-.62a4.72,4.72,0,0,1-1.25-.17A.8.8,0,0,1,102.73,14.76Zm13.38.24a10.07,10.07,0,0,1-3.72.61,1.86,1.86,0,0,1-1.08-.21.67.67,0,0,1-.26-.54,2.36,2.36,0,0,1,0-.32,3.38,3.38,0,0,1,.09-.41l1.58-5.86a5.51,5.51,0,0,1,2.75.47,2,2,0,0,1,.7,1.75c0,.11,0,.25,0,.41s0,.37-.07.6l.66.11,1.78-6.56L117.89,5a4.63,4.63,0,0,1-1.65,2.12A10,10,0,0,1,113,7.5l1.43-5.33a1.6,1.6,0,0,1,.45-.86,2.07,2.07,0,0,1,1.23-.23c1.86,0,3.1.41,3.71,1.23a4.32,4.32,0,0,1,.56,2.47l.65.11,1-4.56H109.1V1a5.1,5.1,0,0,1,1.43.25c.21.11.32.36.32.77a3.63,3.63,0,0,1-.07.57c0,.22-.11.47-.18.74l-2.95,10.77a2.4,2.4,0,0,1-.68,1.29,2.58,2.58,0,0,1-1.26.42v.62H119l1.42-4.66-.58-.11A7.17,7.17,0,0,1,116.11,15ZM144.36,2.17,142.93,7.5a10.13,10.13,0,0,0,3.27-.41A4.69,4.69,0,0,0,147.84,5l.67.08-1.78,6.56-.66-.11c0-.23.06-.43.07-.6s0-.3,0-.41a2,2,0,0,0-.7-1.75,5.51,5.51,0,0,0-2.75-.47l-1.58,5.86a3.38,3.38,0,0,0-.09.41,2.36,2.36,0,0,0,0,.32.67.67,0,0,0,.26.54,1.86,1.86,0,0,0,1.08.21,10.07,10.07,0,0,0,3.72-.61,7.14,7.14,0,0,0,3.73-3.39l.58.11L149,16.38H131l-2.59-7.93h-.68l-1.42,5-.2.83,0,.2a1.77,1.77,0,0,0,0,.23c0,.43.1.7.31.81a4.87,4.87,0,0,0,1.43.25v.62h-7.14v-.62a2.58,2.58,0,0,0,1.26-.42,2.4,2.4,0,0,0,.68-1.29l3-10.77.15-.57a4.09,4.09,0,0,0,.1-.79c0-.38-.11-.62-.32-.72A4.8,4.8,0,0,0,124,1V.33h6.6a10.58,10.58,0,0,1,3.42.43,3,3,0,0,1,2.24,3.05,4,4,0,0,1-.38,1.6A4,4,0,0,1,134.66,7a5.47,5.47,0,0,1-1.45.8c-.33.11-.85.25-1.54.42a4.73,4.73,0,0,0,.16.46l1.85,5.42a2.81,2.81,0,0,0,.8,1.38,2.42,2.42,0,0,0,1.23.32,2.53,2.53,0,0,0,1.22-.41,2.47,2.47,0,0,0,.68-1.29l2.94-10.77c.07-.27.13-.52.18-.74A2.73,2.73,0,0,0,140.8,2c0-.41-.11-.66-.32-.77A5.1,5.1,0,0,0,139.05,1V.33H152l-1,4.56-.65-.11a4.32,4.32,0,0,0-.56-2.47c-.61-.82-1.85-1.23-3.71-1.23a2.07,2.07,0,0,0-1.23.23A1.67,1.67,0,0,0,144.36,2.17ZM131.54,6.59a5,5,0,0,0,.77-1.32,4.68,4.68,0,0,0,.36-1.84,2.74,2.74,0,0,0-.5-1.67,2,2,0,0,0-1.7-.66,1,1,0,0,0-.72.22,2,2,0,0,0-.38.85l-1.45,5.49a10.33,10.33,0,0,0,1.91-.16A3.07,3.07,0,0,0,131.54,6.59Z",opacity:1,strokeColor:"",fillColor:"#192760",width:151.345,height:16.781,stampFillColor:"#dce3ef",stampStrokeColor:""};break;case"SignHere":case"Sign Here":t={iconName:"Sign Here",pathdata:"M6.38,1.9A2.56,2.56,0,0,0,6,3.34a2.49,2.49,0,0,0,.44,1.45,3.9,3.9,0,0,0,.73.76l2.07,1.7a9.34,9.34,0,0,1,1.87,2.06,4.6,4.6,0,0,1,.78,2.63,4.78,4.78,0,0,1-1.5,3.43A5.46,5.46,0,0,1,6.23,16.9a7.34,7.34,0,0,1-1.31-.12,7.48,7.48,0,0,1-1.31-.36L3,16.2l-.42-.14a1.12,1.12,0,0,0-.27,0,.71.71,0,0,0-.57.19,2.85,2.85,0,0,0-.38.67H.63l.87-5.38.69,0a10.34,10.34,0,0,0,.2,1.68,3.82,3.82,0,0,0,2,2.5,3.42,3.42,0,0,0,1.5.32,2.76,2.76,0,0,0,2.23-.92A3.14,3.14,0,0,0,8.94,13c0-1-1-2.29-2.94-3.82S3.06,6.08,3.06,4.71A4.59,4.59,0,0,1,4.35,1.42,4.76,4.76,0,0,1,8,.06,6.71,6.71,0,0,1,9.29.19a4.78,4.78,0,0,1,.79.2l.61.2.41.1a2.76,2.76,0,0,0,.37,0,1,1,0,0,0,.65-.18A1.75,1.75,0,0,0,12.5.12h.72l-1,4.8-.62-.08-.09-.79a4.45,4.45,0,0,0-.69-1.91A2.78,2.78,0,0,0,8.39.89,2.2,2.2,0,0,0,6.38,1.9ZM22.8.39H15.66V1a4.71,4.71,0,0,1,1.41.25c.23.11.34.36.34.77a2.86,2.86,0,0,1-.06.54c0,.21-.11.47-.19.77L14.21,14.11a2.47,2.47,0,0,1-.68,1.29,2.62,2.62,0,0,1-1.27.42v.62h7.15v-.62A4.63,4.63,0,0,1,18,15.56c-.22-.1-.33-.36-.33-.77a1.8,1.8,0,0,1,0-.22c0-.08,0-.16,0-.24l.19-.83,3-10.77a2.5,2.5,0,0,1,.66-1.3A2.76,2.76,0,0,1,22.8,1ZM38.09,9.14V8.52H31.18v.62a5.05,5.05,0,0,1,1.44.28c.22.1.32.35.32.75a13.35,13.35,0,0,1-.54,2.54,19.13,19.13,0,0,1-.54,1.87A1.85,1.85,0,0,1,31,15.66a3.77,3.77,0,0,1-1.78.35A3.71,3.71,0,0,1,27,15.38c-1.09-.77-1.64-2.13-1.64-4.08a13.74,13.74,0,0,1,1.78-6.69q2.05-3.72,5-3.72a2.93,2.93,0,0,1,3,1.86,6.09,6.09,0,0,1,.4,2.48l.69.08L37.44,0h-.71a2.44,2.44,0,0,1-.41.53.82.82,0,0,1-.58.2A9.14,9.14,0,0,1,34.33.36,9.23,9.23,0,0,0,31.73,0a9.4,9.4,0,0,0-7.46,3.42,10.46,10.46,0,0,0-2.65,7,5.88,5.88,0,0,0,2.2,4.83,7.77,7.77,0,0,0,5,1.64A13.06,13.06,0,0,0,32,16.52a14.26,14.26,0,0,0,2.33-.75l.67-.3,1.2-4.36a4.15,4.15,0,0,1,.62-1.59A2.28,2.28,0,0,1,38.09,9.14ZM50.36,1a3.36,3.36,0,0,1,1.31.27,1.25,1.25,0,0,1,.58,1.2,6.26,6.26,0,0,1-.15,1.09c-.07.33-.16.7-.27,1.13L50,11.48,44.76.39H39.93V1a3.49,3.49,0,0,1,1.12.2,1.51,1.51,0,0,1,.74.85l.1.25L39.2,12.16a12.62,12.62,0,0,1-1.09,2.93,1.86,1.86,0,0,1-1.35.73v.62h5v-.62a3.62,3.62,0,0,1-1.28-.26,1.21,1.21,0,0,1-.63-1.17,4.72,4.72,0,0,1,0-.64q.1-.52.39-1.59l2.39-8.6,6.23,13.28h.6L52.84,4.66a15.29,15.29,0,0,1,1-2.78A1.52,1.52,0,0,1,55,1.05l.34,0V.39H50.36Zm22.33,13.8a.66.66,0,0,1,0-.15c0-.05,0-.16.07-.34l.2-.83L75.91,2.73a2.43,2.43,0,0,1,.79-1.39A2.78,2.78,0,0,1,77.86,1V.39H70.71V1A4.45,4.45,0,0,1,72,1.2a.81.81,0,0,1,.47.83,2.73,2.73,0,0,1-.07.57c0,.22-.1.47-.17.74L71.07,7.5h-5.7l1.29-4.77a2.27,2.27,0,0,1,.73-1.33A4.36,4.36,0,0,1,69.08,1V.39H61.47V1a4.73,4.73,0,0,1,1.42.25c.22.11.33.36.33.77a2.93,2.93,0,0,1-.08.58c0,.24-.1.48-.17.73L60,14.1a2.73,2.73,0,0,1-.65,1.29,2.47,2.47,0,0,1-1.3.43v.62h7.15v-.62a5.13,5.13,0,0,1-1.42-.24c-.21-.1-.31-.34-.31-.72a3,3,0,0,1,0-.57c0-.16.1-.43.19-.8l1.35-4.94h5.7L69.27,14.1a2.21,2.21,0,0,1-.74,1.33,4.77,4.77,0,0,1-1.69.39v.62h7.63v-.62a4.72,4.72,0,0,1-1.25-.17A.82.82,0,0,1,72.69,14.81Zm13.38.25a10.28,10.28,0,0,1-3.72.61,1.86,1.86,0,0,1-1.08-.21.67.67,0,0,1-.26-.54,2.23,2.23,0,0,1,0-.32,3.38,3.38,0,0,1,.09-.41l1.58-5.86a5.51,5.51,0,0,1,2.75.47,2,2,0,0,1,.7,1.75c0,.11,0,.24,0,.41s0,.37-.07.59l.66.12,1.78-6.56L87.85,5a4.75,4.75,0,0,1-1.64,2.12,10.13,10.13,0,0,1-3.27.41l1.43-5.33a1.56,1.56,0,0,1,.45-.86,2.07,2.07,0,0,1,1.23-.23c1.86,0,3.1.41,3.71,1.23a4.32,4.32,0,0,1,.56,2.47L91,5,92,.39H79.06V1a4.75,4.75,0,0,1,1.43.25c.21.11.32.36.32.77a2.73,2.73,0,0,1-.07.57c0,.22-.11.47-.18.74l-3,10.77a2.4,2.4,0,0,1-.68,1.29,2.58,2.58,0,0,1-1.26.42v.62H89l1.41-4.66-.58-.11A7.22,7.22,0,0,1,86.07,15.06ZM114.32,2.23l-1.43,5.33a10.13,10.13,0,0,0,3.27-.41A4.75,4.75,0,0,0,117.8,5l.67.08-1.78,6.56-.66-.12c0-.22.06-.42.07-.59s0-.3,0-.41a2,2,0,0,0-.71-1.75,5.51,5.51,0,0,0-2.75-.47l-1.58,5.86a3.38,3.38,0,0,0-.09.41,2.23,2.23,0,0,0,0,.32.67.67,0,0,0,.26.54,1.86,1.86,0,0,0,1.08.21,10.28,10.28,0,0,0,3.72-.61,7.22,7.22,0,0,0,3.73-3.39l.58.11-1.41,4.66h-18L98.33,8.51h-.68l-1.42,5-.2.83,0,.2a1.77,1.77,0,0,0,0,.23c0,.43.1.7.31.8a4.51,4.51,0,0,0,1.43.26v.62H90.59v-.62a2.58,2.58,0,0,0,1.26-.42,2.4,2.4,0,0,0,.68-1.29l3-10.77.15-.57a4.09,4.09,0,0,0,.1-.79c0-.38-.11-.62-.32-.73A5.3,5.3,0,0,0,94,1V.39h6.6A10.58,10.58,0,0,1,104,.82a3,3,0,0,1,2.24,3.05,4,4,0,0,1-.38,1.6A4.06,4.06,0,0,1,104.62,7a5.32,5.32,0,0,1-1.45.8c-.33.11-.84.25-1.54.42.08.24.13.4.16.46l1.85,5.42a2.81,2.81,0,0,0,.8,1.38,2.42,2.42,0,0,0,1.23.32,2.64,2.64,0,0,0,1.22-.41,2.47,2.47,0,0,0,.68-1.29l2.94-10.77c.07-.27.13-.52.18-.74a2.73,2.73,0,0,0,.07-.57c0-.41-.11-.66-.32-.77A4.75,4.75,0,0,0,109,1V.39h12.93l-1,4.56-.64-.11a4.39,4.39,0,0,0-.57-2.47c-.61-.82-1.85-1.23-3.71-1.23a2.07,2.07,0,0,0-1.23.23A1.7,1.7,0,0,0,114.32,2.23ZM101.5,6.64a4.76,4.76,0,0,0,.77-1.31,4.68,4.68,0,0,0,.36-1.84,2.72,2.72,0,0,0-.5-1.67,2,2,0,0,0-1.7-.66.94.94,0,0,0-.71.22,1.81,1.81,0,0,0-.39.85L97.88,7.72a10.33,10.33,0,0,0,1.91-.16A3,3,0,0,0,101.5,6.64Z",opacity:1,strokeColor:"",fillColor:"#192760",width:121.306,height:16.899,stampFillColor:"#dce3ef",stampStrokeColor:""};break;case"Accepted":t={iconName:"Accepted",pathdata:"M22.409,0.000 C22.647,0.006 25.364,2.818 27.458,4.112 28.000,4.448 28.015,5.227 23.803,7.927 12.881,15.464 9.475,23.800 8.332,24.542 6.069,21.014 1.899,14.526 0.095,11.832 0.081,11.023 1.967,10.824 6.581,9.529 7.847,11.400 8.402,13.832 8.952,14.781 16.385,3.230 21.985,0.106 21.985,0.106 21.985,0.106 22.266,-0.003 22.409,0.00021190348 z",opacity:1,strokeColor:"",fillColor:"#516c30",width:27.873,height:24.346,stampFillColor:"#e6eddf",stampStrokeColor:""};break;case"Rejected":t={iconName:"Rejected",pathdata:"M3.8779989,0 L11.294,7.4140023 18.710001,0 22.588001,3.8779911 15.172998,11.293032 22.588001,18.707033 18.710001,22.586 11.294,15.169985 3.8779989,22.586 0,18.707033 7.4150017,11.293032 0,3.8779911 z",opacity:1,strokeColor:"",fillColor:"#8a251a",width:22.588,height:22.586,stampFillColor:"#f6dedd",stampStrokeColor:""};break;case"Rejected_with_border":t={iconName:"Rejected_with_border",pathdata:"M3.8779989,0 L11.294,7.4140023 18.710001,0 22.588001,3.8779911 15.172998,11.293032 22.588001,18.707033 18.710001,22.586 11.294,15.169985 3.8779989,22.586 0,18.707033 7.4150017,11.293032 0,3.8779911 z",opacity:1,strokeColor:"",fillColor:"#192760",width:22.588,height:24.346,stampFillColor:"#dce3ef",stampStrokeColor:""};break;case"NotApproved":case"Not Approved":t={iconName:"Not Approved",pathdata:"M0,19.46a1.56,1.56,0,0,0,1.16-.9A19.84,19.84,0,0,0,2.1,15L4.42,2.84l-.09-.3a1.82,1.82,0,0,0-.64-1.06,2.41,2.41,0,0,0-1-.24V.48H6.88l4.49,13.64L13,5.78c.09-.52.17-1,.22-1.39a10.11,10.11,0,0,0,.13-1.34,1.83,1.83,0,0,0-.49-1.48,2.49,2.49,0,0,0-1.13-.33V.48H16v.76l-.29.06a1.42,1.42,0,0,0-1,1,23.7,23.7,0,0,0-.84,3.42L11,20.71h-.51L5.1,4.38,3,15c-.17.87-.28,1.53-.33,2a5.32,5.32,0,0,0,0,.79,1.69,1.69,0,0,0,.54,1.44,2.48,2.48,0,0,0,1.1.32v.76H0ZM17.73,4.53C19.54,1.51,21.55,0,23.79,0a4.4,4.4,0,0,1,3.66,1.92,8.52,8.52,0,0,1,1.43,5.19,17.56,17.56,0,0,1-2.53,9.07q-2.7,4.61-6.21,4.6a4.24,4.24,0,0,1-3.6-1.92,8.6,8.6,0,0,1-1.39-5.14A17.68,17.68,0,0,1,17.73,4.53ZM18.37,18c.33,1.19.93,1.78,1.8,1.78a2.83,2.83,0,0,0,2.22-1.29,16.41,16.41,0,0,0,2.06-4.93,35.53,35.53,0,0,0,1.06-4.83A28.26,28.26,0,0,0,25.9,4.6a5.86,5.86,0,0,0-.52-2.55A1.7,1.7,0,0,0,23.78,1Q21.2,1,19.45,7.53a33,33,0,0,0-1.33,8.26A8.15,8.15,0,0,0,18.37,18Zm11.08,1.48a2.34,2.34,0,0,0,1.3-.26,3,3,0,0,0,.85-1.85l3-15.85A3.54,3.54,0,0,0,32,2.56a8,8,0,0,0-1.82,3.16l-.53-.2.8-5H41.81l-.74,5.66-.54-.07c0-1.92-.41-3.24-1.13-3.94a2.6,2.6,0,0,0-1.74-.63L34.79,16.6l-.17,1a2.43,2.43,0,0,0,0,.33,2.26,2.26,0,0,0,0,.26c0,.5.11.82.33.95a3.94,3.94,0,0,0,1.39.3v.76H29.45Zm26.65.76H50.18v-.71a2.28,2.28,0,0,0,1.25-.41,1.64,1.64,0,0,0,.37-1.29c0-.22,0-.75-.11-1.58,0-.17-.08-.89-.2-2.15H47l-1.2,3c-.08.2-.15.42-.22.66a2.84,2.84,0,0,0-.09.69c0,.41.08.67.25.78a2.91,2.91,0,0,0,1.08.3v.71H42.79v-.71a2.44,2.44,0,0,0,.85-.53,5.59,5.59,0,0,0,.9-1.56L52.21.07h.53l2,16.88A5.46,5.46,0,0,0,55.2,19a1.36,1.36,0,0,0,.9.43Zm-4.76-7.31-.76-7.18-3,7.18Zm4.95,6.53a1.82,1.82,0,0,0,1-.5,3.56,3.56,0,0,0,.58-1.59L60.42,4.11c.06-.3.1-.6.15-.9a5.46,5.46,0,0,0,.06-.72c0-.52-.13-.86-.4-1a2.88,2.88,0,0,0-1.1-.23V.48h5.93a5,5,0,0,1,2.5.57c1.26.73,1.9,2.07,1.9,4a5.81,5.81,0,0,1-1.54,4.22,5.32,5.32,0,0,1-4,1.58l-.59,0-1.2-.11L61,16.6l-.17,1a2.72,2.72,0,0,0,0,.3,2.81,2.81,0,0,0,0,.29c0,.5.09.81.28.94a3.26,3.26,0,0,0,1.23.31v.76h-6Zm6-9.67.38.06H63a3,3,0,0,0,1.62-.36,2.87,2.87,0,0,0,1-1.18,7.28,7.28,0,0,0,.6-2,11.67,11.67,0,0,0,.22-2,4.4,4.4,0,0,0-.41-2,1.44,1.44,0,0,0-1.39-.79.71.71,0,0,0-.65.28,3.7,3.7,0,0,0-.32,1Zm5.61,9.69A1.86,1.86,0,0,0,69,18.94a3.54,3.54,0,0,0,.59-1.59L72.15,4.11q.09-.45.15-.9a5.73,5.73,0,0,0,.07-.72,1.1,1.1,0,0,0-.41-1,2.88,2.88,0,0,0-1.1-.23V.48h5.93a5,5,0,0,1,2.5.57c1.27.73,1.9,2.07,1.9,4a5.77,5.77,0,0,1-1.54,4.22,5.31,5.31,0,0,1-4,1.58l-.6,0-1.2-.11L72.74,16.6l-.17,1a2.72,2.72,0,0,0,0,.3c0,.1,0,.19,0,.29,0,.5.1.81.29.94a3.15,3.15,0,0,0,1.23.31v.76h-6.1Zm6.12-9.69.38.06h.33a3,3,0,0,0,1.62-.36,3,3,0,0,0,1-1.18,7.67,7.67,0,0,0,.59-2,11.67,11.67,0,0,0,.22-2,4.4,4.4,0,0,0-.41-2,1.43,1.43,0,0,0-1.38-.79.73.73,0,0,0-.66.28,3.7,3.7,0,0,0-.32,1Zm5.57,9.69a1.9,1.9,0,0,0,1.09-.52,3.56,3.56,0,0,0,.58-1.59L83.84,4.11c0-.27.09-.51.13-.71a7.08,7.08,0,0,0,.09-1c0-.47-.1-.77-.28-.9a3.53,3.53,0,0,0-1.22-.3V.48h5.68a6.57,6.57,0,0,1,3,.53q1.92,1,1.92,3.75a6.79,6.79,0,0,1-.32,2,5.23,5.23,0,0,1-1.08,1.9,4.56,4.56,0,0,1-1.25,1,11.62,11.62,0,0,1-1.33.52c.07.3.12.49.14.57l1.59,6.66a4.07,4.07,0,0,0,.69,1.7,1.72,1.72,0,0,0,1.13.41v.76H88.52l-2.23-9.76h-.58L84.49,16.6l-.17,1a1,1,0,0,0,0,.25,2.62,2.62,0,0,0,0,.28c0,.53.09.86.26,1a3.11,3.11,0,0,0,1.24.32v.76H79.63ZM87.55,9.3A2.59,2.59,0,0,0,89,8.17a7.24,7.24,0,0,0,.66-1.62A8.18,8.18,0,0,0,90,4.29a4.32,4.32,0,0,0-.43-2,1.5,1.5,0,0,0-1.45-.81.71.71,0,0,0-.62.26,2.78,2.78,0,0,0-.33,1.05L85.91,9.5A6.63,6.63,0,0,0,87.55,9.3Zm8.72-4.77Q99,0,102.32,0A4.37,4.37,0,0,1,106,1.92a8.46,8.46,0,0,1,1.44,5.19,17.58,17.58,0,0,1-2.54,9.07q-2.7,4.61-6.21,4.6a4.27,4.27,0,0,1-3.6-1.92,8.67,8.67,0,0,1-1.38-5.14A17.68,17.68,0,0,1,96.27,4.53ZM96.9,18c.33,1.19.93,1.78,1.8,1.78a2.83,2.83,0,0,0,2.22-1.29A16.63,16.63,0,0,0,103,13.54a37.1,37.1,0,0,0,1.06-4.83,29.49,29.49,0,0,0,.38-4.11,5.86,5.86,0,0,0-.51-2.55A1.71,1.71,0,0,0,102.31,1C100.6,1,99.15,3.17,98,7.53a33.42,33.42,0,0,0-1.33,8.26A8.57,8.57,0,0,0,96.9,18ZM114.35.48v.76a2.57,2.57,0,0,0-1.08.17,1.07,1.07,0,0,0-.5,1,2.53,2.53,0,0,0,0,.28,2.64,2.64,0,0,0,0,.28l1.07,11.76L117.77,6c.31-.71.59-1.41.84-2.11A5.25,5.25,0,0,0,119,2.19a.85.85,0,0,0-.38-.81,3.09,3.09,0,0,0-.95-.14V.48h4v.76a2.08,2.08,0,0,0-.73.45,5.35,5.35,0,0,0-.82,1.4l-7.79,17.69h-.66L110,5.74A22,22,0,0,0,109.46,2c-.16-.39-.58-.62-1.28-.71V.48Zm5.15,19a1.83,1.83,0,0,0,1.08-.52,3.42,3.42,0,0,0,.59-1.59l2.54-13.24c.06-.34.11-.64.15-.92a4.83,4.83,0,0,0,.06-.7c0-.5-.09-.81-.28-.94a3.14,3.14,0,0,0-1.22-.31V.48h11.12l-.87,5.6L132.11,6a7,7,0,0,0-.49-3c-.52-1-1.59-1.51-3.19-1.51-.55,0-.9.09-1.06.28A2.44,2.44,0,0,0,127,2.74L125.76,9.3a6.21,6.21,0,0,0,2.81-.51A6,6,0,0,0,130,6.18l.58.1L129,14.35l-.56-.14c0-.28,0-.52,0-.73s0-.37,0-.51a2.92,2.92,0,0,0-.61-2.15,3.55,3.55,0,0,0-2.37-.57l-1.36,7.2a4.79,4.79,0,0,0-.07.51,3.28,3.28,0,0,0,0,.39,1,1,0,0,0,.22.66,1.24,1.24,0,0,0,.93.26,6.43,6.43,0,0,0,3.21-.75,7.67,7.67,0,0,0,3.21-4.17l.5.13-1.22,5.74H119.5Zm12.79,0a1.87,1.87,0,0,0,1-.41,3.23,3.23,0,0,0,.71-1.71L136.5,4.11c.07-.38.13-.69.17-1a5.89,5.89,0,0,0,.05-.67c0-.5-.1-.81-.29-.94a3.32,3.32,0,0,0-1.22-.31V.48h6a5.35,5.35,0,0,1,4.63,2.22,10.11,10.11,0,0,1,1.58,6,13.3,13.3,0,0,1-2.34,7.84,8,8,0,0,1-6.86,3.7h-5.93ZM143.87,3.39a2.84,2.84,0,0,0-2.79-2,1.08,1.08,0,0,0-.91.31,1.93,1.93,0,0,0-.34.83L137,17.44a3.1,3.1,0,0,0-.06.39c0,.11,0,.21,0,.3a1.22,1.22,0,0,0,.24.84,1.26,1.26,0,0,0,.9.26q3.67,0,5.33-5.42a23.91,23.91,0,0,0,1-6.94A9.45,9.45,0,0,0,143.87,3.39Z",opacity:1,strokeColor:"",fillColor:"#8a251a",width:147.425,height:20.783,stampFillColor:"#f6dedd",stampStrokeColor:""};break;case"Draft":t={iconName:"Draft",pathdata:"M24.92,3Q22,.46,16.4.46h-11v.87a9.38,9.38,0,0,1,2.24.35q.54.23.54,1.08a3.24,3.24,0,0,1-.1.76c-.07.29-.17.65-.31,1.08L3.08,19.69a3.26,3.26,0,0,1-1.32,1.95A4.67,4.67,0,0,1,0,22.1V23H10.91q7.8,0,12.61-4.22a11.56,11.56,0,0,0,4.32-8.94A8.58,8.58,0,0,0,24.92,3ZM20.41,15.66a10.18,10.18,0,0,1-9.8,6.18A3.18,3.18,0,0,1,9,21.54a1,1,0,0,1-.46-.95,2.47,2.47,0,0,1,0-.35,3,3,0,0,1,.1-.44l5.24-17a1.91,1.91,0,0,1,.62-.95,2.81,2.81,0,0,1,1.66-.35c2.44,0,4.15.76,5.15,2.27a7.29,7.29,0,0,1,.94,4A17.63,17.63,0,0,1,20.41,15.66ZM49.75,9.74a5.84,5.84,0,0,0,2-2.16,5.1,5.1,0,0,0,.59-2.24c0-2.1-1.18-3.53-3.54-4.27A18.67,18.67,0,0,0,43.36.46H32.92v.87a8.79,8.79,0,0,1,2.24.35c.35.14.52.48.52,1a5.36,5.36,0,0,1-.17,1.11c-.06.23-.14.5-.23.8L30.61,19.7a3.26,3.26,0,0,1-1.08,1.81,4.44,4.44,0,0,1-2,.59V23H38.85V22.1a8.54,8.54,0,0,1-2.28-.36c-.32-.15-.49-.53-.49-1.13,0-.11,0-.21,0-.32a1.15,1.15,0,0,1,.06-.28l.31-1.16,2.25-7h1.07L43.89,23h7.64V22.1a4.27,4.27,0,0,1-2.07-.47,3.91,3.91,0,0,1-1.27-1.93l-2.92-7.6a4.67,4.67,0,0,1-.25-.65c1.1-.23,1.91-.42,2.43-.59A8.49,8.49,0,0,0,49.75,9.74ZM46,7.39a6.73,6.73,0,0,1-1.21,1.84,5,5,0,0,1-2.72,1.29,19.56,19.56,0,0,1-3,.23L41.38,3A2.54,2.54,0,0,1,42,1.85a1.76,1.76,0,0,1,1.14-.31,3.38,3.38,0,0,1,2.69.93,3.52,3.52,0,0,1,.79,2.34A5.94,5.94,0,0,1,46,7.39Zm27.9,11.85L70.29,0h-1L55.21,19.78a6.61,6.61,0,0,1-1.66,1.78,5.3,5.3,0,0,1-1.55.6V23h7.45v-.81a8,8,0,0,1-2-.34.85.85,0,0,1-.47-.89,2,2,0,0,1,.17-.79,5.32,5.32,0,0,1,.4-.75L59.8,16H68c.22,1.44.35,2.25.37,2.45a16,16,0,0,1,.2,1.81,1.51,1.51,0,0,1-.67,1.47,6.38,6.38,0,0,1-2.31.46V23H77.1v-.81a4.28,4.28,0,0,1-2.28-.55A4.47,4.47,0,0,1,73.93,19.24ZM60.7,14.64l5.62-8.19,1.4,8.19ZM84,.46h20.2l-1.61,6.39-1-.15a5.61,5.61,0,0,0-.88-3.43Q99.2,1.52,94.86,1.51a3.56,3.56,0,0,0-1.76.3A2.05,2.05,0,0,0,92.34,3L90.1,10.5A16.53,16.53,0,0,0,95,9.91c.77-.33,1.62-1.32,2.56-3l1.06.12-2.82,9.2-1-.17c0-.33.08-.61.1-.85s0-.43,0-.56a2.76,2.76,0,0,0-1-2.38c-.66-.49-2.07-.73-4.23-.73l-2.5,8.22a3.56,3.56,0,0,0-.09.39,1.55,1.55,0,0,0,0,.37,1.32,1.32,0,0,0,1,1.33,5.52,5.52,0,0,0,1.78.21V23H78.58V22.1a4.35,4.35,0,0,0,2-.61,3.33,3.33,0,0,0,1.06-1.8L86.32,4.6c.09-.31.16-.58.23-.81a5.05,5.05,0,0,0,.16-1.1c0-.53-.17-.87-.52-1A8.7,8.7,0,0,0,84,1.33Zm24.1,0h20.89l-1.37,6.46-1-.08c-.07-2.2-.76-3.69-2.09-4.49a6.61,6.61,0,0,0-3.2-.72L116,18.84,115.7,20a2.63,2.63,0,0,0-.07.38,1.51,1.51,0,0,0,0,.3c0,.57.2.94.61,1.08a11.19,11.19,0,0,0,2.56.34V23H106.2V22.1a6.49,6.49,0,0,0,2.4-.3,3.19,3.19,0,0,0,1.56-2.1l5.58-18.07a9.07,9.07,0,0,0-4.83,1.2,9.52,9.52,0,0,0-3.34,3.61l-1-.23Z",opacity:1,strokeColor:"",fillColor:"#192760",width:128.941,height:22.97,stampFillColor:"#dce3ef",stampStrokeColor:""};break;case"Final":t={iconName:"Final",pathdata:"M24.94,6l-1.06-.13a4.37,4.37,0,0,0-.91-3q-1.51-1.54-6-1.54a4.28,4.28,0,0,0-1.83.26,1.8,1.8,0,0,0-.78,1.08L12,9.21a20.26,20.26,0,0,0,5.15-.52A6.49,6.49,0,0,0,19.8,6.1l1.1.1L18,14.27l-1.09-.15a6.34,6.34,0,0,0,.11-.74c0-.22,0-.38,0-.5a2.26,2.26,0,0,0-1-2.09c-.68-.42-2.15-.63-4.39-.63L9,17.37a3.09,3.09,0,0,0-.1.34,1.22,1.22,0,0,0,0,.32,1.18,1.18,0,0,0,1,1.17,7,7,0,0,0,1.86.18v.77H0v-.77a5.14,5.14,0,0,0,2.11-.53,3,3,0,0,0,1.1-1.58L8.06,4c.09-.27.17-.5.23-.7a3.74,3.74,0,0,0,.18-1,.83.83,0,0,0-.55-.89,10.94,10.94,0,0,0-2.33-.3V.4h21Zm8.54,12.11a1.49,1.49,0,0,1,0-.28,2.46,2.46,0,0,1,.07-.29l.3-1L38.76,3.29a2.93,2.93,0,0,1,1.09-1.6A5.42,5.42,0,0,1,42,1.17V.4H30.17v.77a10.52,10.52,0,0,1,2.34.31.88.88,0,0,1,.56.94,2.58,2.58,0,0,1-.11.67c-.07.26-.18.57-.32,1L27.79,17.28a2.94,2.94,0,0,1-1.12,1.59,5.28,5.28,0,0,1-2.09.51v.77H36.36v-.77A10.22,10.22,0,0,1,34,19.07.89.89,0,0,1,33.48,18.12ZM66.19,2.24a2.53,2.53,0,0,1,1.87-1l.56-.06V.4H60.5v.77a8,8,0,0,1,2.16.33,1.47,1.47,0,0,1,1,1.48,5.61,5.61,0,0,1-.25,1.34c-.11.4-.25.87-.43,1.38l-3.08,8.35L51.26.4h-8v.77a8.44,8.44,0,0,1,1.86.24,2.26,2.26,0,0,1,1.22,1.05l.17.31L42.11,14.88a13.74,13.74,0,0,1-1.8,3.61,3.36,3.36,0,0,1-2.22.89v.77h8.23v-.77a7.75,7.75,0,0,1-2.1-.31,1.45,1.45,0,0,1-1-1.44,3.56,3.56,0,0,1,.1-.79,16.15,16.15,0,0,1,.64-2L47.85,4.31,58.11,20.64h1l5.5-15A15.48,15.48,0,0,1,66.19,2.24Zm23,17.13v.78H78.08v-.71A7.47,7.47,0,0,0,80.49,19a1.25,1.25,0,0,0,.7-1.29A13.26,13.26,0,0,0,81,16.16c0-.18-.16-.89-.39-2.15H72.06l-2.3,3a3.7,3.7,0,0,0-.42.66,1.54,1.54,0,0,0-.18.69.74.74,0,0,0,.49.78,10.28,10.28,0,0,0,2.06.3v.71H63.94v-.71a6.43,6.43,0,0,0,1.63-.53,6.63,6.63,0,0,0,1.72-1.56L82,0h1l3.78,16.88A3.69,3.69,0,0,0,87.7,19,3.53,3.53,0,0,0,89.24,19.37Zm-8.93-6.53L78.86,5.65,73,12.84Zm32.8,1.44a11.51,11.51,0,0,1-5.23,3.88,21.36,21.36,0,0,1-7,1A4.88,4.88,0,0,1,99.22,19a.74.74,0,0,1-.58-.71,2.33,2.33,0,0,1,0-.48c0-.13.08-.28.13-.43L104,3.29a2.72,2.72,0,0,1,1.19-1.64,9.4,9.4,0,0,1,2.79-.48V.4H95.4v.77a10.42,10.42,0,0,1,2.34.31.88.88,0,0,1,.56.94,2.58,2.58,0,0,1-.11.67c-.07.25-.17.57-.31.94L93,17.27a2.92,2.92,0,0,1-1.12,1.6,4.59,4.59,0,0,1-1.71.47v.81h21.55l2.32-5.74Z",opacity:1,strokeColor:"",fillColor:"#516c30",width:114.058,height:20.639,stampFillColor:"#e6eddf",stampStrokeColor:""};break;case"Completed":t={iconName:"Completed",pathdata:"M16.37,0,15.08,6.9l-.79-.17c0-.41,0-.66,0-.73a2.73,2.73,0,0,0,0-.32,5.33,5.33,0,0,0-.94-3.47A3,3,0,0,0,11,1.07c-2,0-3.68,1.51-5.13,4.55a18.84,18.84,0,0,0-2,8.29q0,3.06,1.2,4.2a3.82,3.82,0,0,0,2.64,1.13,5.3,5.3,0,0,0,3.51-1.43,10.75,10.75,0,0,0,1.78-2.09l.77.65a9.32,9.32,0,0,1-3.12,3.35A7,7,0,0,1,7,20.81a6.66,6.66,0,0,1-5-2.08,7.72,7.72,0,0,1-2-5.57A14.57,14.57,0,0,1,3.05,3.92Q6.1,0,10.29,0A8.92,8.92,0,0,1,13,.43a9.09,9.09,0,0,0,1.65.43.72.72,0,0,0,.6-.23A2.55,2.55,0,0,0,15.6,0ZM32.83,7.11a15.24,15.24,0,0,1-3.11,9.07q-3.31,4.61-7.63,4.6a5.63,5.63,0,0,1-4.42-1.92A7.47,7.47,0,0,1,16,13.72a15.27,15.27,0,0,1,3.18-9.19Q22.46,0,26.57,0a5.82,5.82,0,0,1,4.5,1.92A7.35,7.35,0,0,1,32.83,7.11ZM29.16,4.6a4.92,4.92,0,0,0-.63-2.55,2.14,2.14,0,0,0-2-1.06Q23.4,1,21.24,7.53a27.45,27.45,0,0,0-1.63,8.26A6.68,6.68,0,0,0,19.92,18a2.24,2.24,0,0,0,2.2,1.78,3.71,3.71,0,0,0,2.73-1.29,15,15,0,0,0,2.54-4.93,30.56,30.56,0,0,0,1.3-4.83A23,23,0,0,0,29.16,4.6Zm21.2,13.62a3.83,3.83,0,0,1,.08-.75,8.6,8.6,0,0,1,.19-.88L53.75,3.31a3,3,0,0,1,.85-1.67,2.72,2.72,0,0,1,1.21-.4V.48H50.42L42.66,14.39,41.21.48h-5.8v.76a4.65,4.65,0,0,1,1.45.21c.26.11.38.37.38.78a4.57,4.57,0,0,1-.08.75c-.06.28-.13.61-.23,1L34.34,15a16.85,16.85,0,0,1-1.16,3.65,1.9,1.9,0,0,1-1.42.86v.76h5.3v-.76a3.22,3.22,0,0,1-1.32-.29A1.48,1.48,0,0,1,35,17.74a8.32,8.32,0,0,1,.17-1.42c.07-.37.17-.82.3-1.37L38.06,4.23l1.71,16.38h.71L50,3.76l-3.2,13.58A2.84,2.84,0,0,1,46,19a4.06,4.06,0,0,1-1.76.49v.76h7.93v-.76a4.79,4.79,0,0,1-1.49-.31Q50.36,19,50.36,18.22ZM67.69,9.29a7.39,7.39,0,0,1-4.89,1.58l-.73,0-1.48-.11L59.21,16.6l-.21,1a1,1,0,0,0,0,.3,2.83,2.83,0,0,0,0,.29c0,.5.12.81.35.94a4.74,4.74,0,0,0,1.51.31v.76H53.31v-.76a2.52,2.52,0,0,0,1.33-.52,3.18,3.18,0,0,0,.72-1.59L58.48,4.11q.1-.45.18-.9a4.48,4.48,0,0,0,.08-.72,1,1,0,0,0-.49-1,4.36,4.36,0,0,0-1.36-.23V.48h7.29a7.29,7.29,0,0,1,3.07.57,4,4,0,0,1,2.33,4A5.22,5.22,0,0,1,67.69,9.29Zm-1.8-5a3.65,3.65,0,0,0-.51-2,1.85,1.85,0,0,0-1.7-.79,1,1,0,0,0-.8.28,3.27,3.27,0,0,0-.4,1l-1.66,7,.47.06h.41a4.37,4.37,0,0,0,2-.36,3.14,3.14,0,0,0,1.2-1.18,6.51,6.51,0,0,0,.74-2A9.87,9.87,0,0,0,65.89,4.25Zm16.9,10.1a8.71,8.71,0,0,1-3.35,3.88,9.36,9.36,0,0,1-4.53,1,2.15,2.15,0,0,1-1-.21.75.75,0,0,1-.37-.71,3.18,3.18,0,0,1,0-.47c0-.14,0-.28.08-.44l3.3-14.08a2.94,2.94,0,0,1,.77-1.64,4.47,4.47,0,0,1,1.79-.48V.48h-8v.76a4.8,4.8,0,0,1,1.5.31c.23.13.35.44.35.94a4.36,4.36,0,0,1-.06.67c0,.26-.12.57-.21,1L69.9,17.34a3.18,3.18,0,0,1-.72,1.6,2.53,2.53,0,0,1-1.34.52v.76H81.91l1.49-5.74ZM85.73,1.24a4.59,4.59,0,0,1,1.5.31c.23.13.34.44.34.94a3.84,3.84,0,0,1-.07.7c0,.28-.11.58-.19.92L84.2,17.35a3.18,3.18,0,0,1-.72,1.59,2.27,2.27,0,0,1-1.06.47h-.07v.8H96.2l1.5-5.74-.62-.13a8.14,8.14,0,0,1-3.94,4.17,9.39,9.39,0,0,1-3.94.75A1.75,1.75,0,0,1,88.06,19a.87.87,0,0,1-.27-.66,3.28,3.28,0,0,1,0-.39,5,5,0,0,1,.09-.51l1.67-7.2a5.16,5.16,0,0,1,2.91.57A2.58,2.58,0,0,1,93.24,13c0,.14,0,.31,0,.51s0,.45-.07.73l.7.14,1.88-8.07L95,6.18a5.62,5.62,0,0,1-1.74,2.61,9.05,9.05,0,0,1-3.45.51l1.51-6.56a2.23,2.23,0,0,1,.47-1.06,2,2,0,0,1,1.3-.28c2,0,3.29.5,3.93,1.51a6.13,6.13,0,0,1,.6,3l.68.13L99.4.48H85.73ZM114,6.14l.92-5.66h-14l-1,5,.66.2a7.81,7.81,0,0,1,2.23-3.16,4.91,4.91,0,0,1,3.23-1.06l-3.73,15.85a2.84,2.84,0,0,1-1,1.85,3.48,3.48,0,0,1-1.6.26v.76h8.4v-.76a5.82,5.82,0,0,1-1.71-.3c-.27-.13-.41-.45-.41-.95a2.26,2.26,0,0,1,0-.26c0-.09,0-.2,0-.33l.21-1,3.53-15.1a3.65,3.65,0,0,1,2.14.63c.89.7,1.35,2,1.39,3.94Zm9.44,12.38a9.39,9.39,0,0,1-3.94.75,1.77,1.77,0,0,1-1.14-.26.87.87,0,0,1-.27-.66,3.28,3.28,0,0,1,0-.39,5,5,0,0,1,.09-.51l1.67-7.2a5.12,5.12,0,0,1,2.91.57,2.58,2.58,0,0,1,.75,2.15c0,.14,0,.31,0,.51s0,.45-.07.73l.7.14L126,6.28l-.7-.1a5.78,5.78,0,0,1-1.74,2.61,9.16,9.16,0,0,1-3.46.51l1.51-6.56a2.14,2.14,0,0,1,.48-1.06,2,2,0,0,1,1.3-.28c2,0,3.28.5,3.92,1.51a6,6,0,0,1,.6,3l.68.13,1.08-5.6H116v.76a4.67,4.67,0,0,1,1.51.31c.22.13.34.44.34.94a4,4,0,0,1-.08.7c0,.28-.11.58-.18.92l-3.12,13.24a3.18,3.18,0,0,1-.72,1.59,2.56,2.56,0,0,1-1.34.52v.76h14.06l1.5-5.74-.62-.13A8.14,8.14,0,0,1,123.39,18.52Zm23.32-9.84a11.62,11.62,0,0,1-2.89,7.84,10.6,10.6,0,0,1-8.42,3.7h-7.29v-.76a2.58,2.58,0,0,0,1.18-.41,2.94,2.94,0,0,0,.88-1.71l3.11-13.23c.09-.38.16-.69.21-1a4.49,4.49,0,0,0,.07-.67c0-.5-.12-.81-.36-.94a4.8,4.8,0,0,0-1.5-.31V.48h7.36a7.16,7.16,0,0,1,5.69,2.22A8.72,8.72,0,0,1,146.71,8.68ZM143,6.87a8,8,0,0,0-.64-3.48,3.52,3.52,0,0,0-3.44-2,1.52,1.52,0,0,0-1.11.31,1.75,1.75,0,0,0-.41.83l-3.5,14.9c0,.14,0,.27-.07.39s0,.21,0,.3a1.06,1.06,0,0,0,.3.84,1.75,1.75,0,0,0,1.1.26q4.53,0,6.55-5.42A19.84,19.84,0,0,0,143,6.87Z",opacity:1,strokeColor:"",fillColor:"#516c30",width:146.706,height:20.811,stampFillColor:"#e6eddf",stampStrokeColor:""};break;case"ForPublicRelease":case"For Public Release":t={iconName:"For Public Release",pathdata:"M10.33.48l-.65,5.6L9.27,6a9.74,9.74,0,0,0-.36-3A2.27,2.27,0,0,0,6.57,1.4a.85.85,0,0,0-.71.26,2.67,2.67,0,0,0-.3,1.08L4.65,9.28a3.45,3.45,0,0,0,2-.52,6.65,6.65,0,0,0,1-2.59l.43.1L7,14.34l-.42-.14c0-.29,0-.54,0-.75s0-.38,0-.49a4.17,4.17,0,0,0-.39-2.09,1.91,1.91,0,0,0-1.71-.64l-1,7.21c0,.13,0,.24,0,.35s0,.21,0,.31a1.45,1.45,0,0,0,.38,1.17,1.17,1.17,0,0,0,.72.19v.76H0v-.76a1.31,1.31,0,0,0,.82-.54,4.39,4.39,0,0,0,.42-1.58L3.13,4.11c0-.27.06-.51.09-.71,0-.41.07-.73.07-1a1.34,1.34,0,0,0-.21-.9,2.13,2.13,0,0,0-.91-.3V.48ZM20.5,7.11a22.43,22.43,0,0,1-1.88,9.07q-2,4.61-4.62,4.6a3,3,0,0,1-2.67-1.92,10.91,10.91,0,0,1-1-5.14,22.46,22.46,0,0,1,1.92-9.19Q14.23,0,16.71,0a3.11,3.11,0,0,1,2.72,1.92A10.72,10.72,0,0,1,20.5,7.11ZM18.28,4.6a7.7,7.7,0,0,0-.38-2.55c-.26-.7-.65-1-1.19-1-1.28,0-2.35,2.17-3.22,6.53a43.69,43.69,0,0,0-1,8.26,10.72,10.72,0,0,0,.19,2.2c.24,1.18.69,1.77,1.33,1.77s1.16-.43,1.65-1.29a19.35,19.35,0,0,0,1.54-4.93A48.7,48.7,0,0,0,18,8.71,38.21,38.21,0,0,0,18.28,4.6Zm11.59.16a8.73,8.73,0,0,1-.24,2,5.64,5.64,0,0,1-.8,1.9,3.49,3.49,0,0,1-.93,1,7.31,7.31,0,0,1-1,.52c0,.3.08.49.1.57l1.18,6.66a4.54,4.54,0,0,0,.52,1.7,1.1,1.1,0,0,0,.83.41v.76H26.46l-1.65-9.76h-.43l-.91,6.14-.13,1a2,2,0,0,0,0,.25,2.62,2.62,0,0,0,0,.28,1.57,1.57,0,0,0,.2,1,1.77,1.77,0,0,0,.92.32v.76H19.86v-.76a1.33,1.33,0,0,0,.81-.52,4.35,4.35,0,0,0,.43-1.59L23,4.11c0-.27.07-.51.09-.71a8.23,8.23,0,0,0,.07-1,1.3,1.3,0,0,0-.21-.9,2.08,2.08,0,0,0-.91-.3V.48h4.22A3.79,3.79,0,0,1,28.44,1C29.4,1.66,29.87,2.91,29.87,4.76Zm-2.31-.47a5.77,5.77,0,0,0-.32-2,1.12,1.12,0,0,0-1.09-.81.5.5,0,0,0-.46.26,3.87,3.87,0,0,0-.24,1.05L24.52,9.5a3.73,3.73,0,0,0,1.22-.2,2.1,2.1,0,0,0,1.1-1.13,8.41,8.41,0,0,0,.49-1.62A10.75,10.75,0,0,0,27.56,4.29Zm14.92.78a7.06,7.06,0,0,1-1.14,4.22,3.5,3.5,0,0,1-3,1.58l-.44,0-.89-.11-.84,5.86-.12,1a1.45,1.45,0,0,0,0,.3,2.81,2.81,0,0,0,0,.29,1.38,1.38,0,0,0,.21.94,1.93,1.93,0,0,0,.91.31v.76H32.65v-.76a1.28,1.28,0,0,0,.8-.52,4.3,4.3,0,0,0,.44-1.59L35.77,4.11c0-.3.08-.6.11-.9a5.21,5.21,0,0,0,0-.72,1.29,1.29,0,0,0-.3-1,1.82,1.82,0,0,0-.81-.23V.48h4.4a3,3,0,0,1,1.86.57C42,1.78,42.48,3.12,42.48,5.07Zm-2.23-.82a5.74,5.74,0,0,0-.3-2,1.07,1.07,0,0,0-1-.79.5.5,0,0,0-.49.28,5.11,5.11,0,0,0-.24,1l-1,7,.28.06h.25a1.79,1.79,0,0,0,1.2-.36,2.88,2.88,0,0,0,.73-1.18,10.56,10.56,0,0,0,.44-2A15.74,15.74,0,0,0,40.25,4.25Zm12.91-3V.48H50v.76a1.46,1.46,0,0,1,.82.32A2,2,0,0,1,51.24,3a15,15,0,0,1-.14,1.57q0-.17-.15,1.17l-.89,6.16a29.63,29.63,0,0,1-1,4.77c-.55,1.63-1.31,2.44-2.28,2.44a1.59,1.59,0,0,1-1.38-.77,4.16,4.16,0,0,1-.5-2.23q0-.63.15-2c.06-.5.15-1.14.27-1.93l1.26-8.84a4.13,4.13,0,0,1,.46-1.66,1.66,1.66,0,0,1,1-.46V.48H43.34v.76a2,2,0,0,1,.9.3,1.3,1.3,0,0,1,.21.9,7.27,7.27,0,0,1,0,.75c0,.29-.07.59-.11.92l-1,7.24c-.16,1.14-.27,1.93-.32,2.38a19.16,19.16,0,0,0-.12,2,6.13,6.13,0,0,0,1,3.71,2.93,2.93,0,0,0,2.43,1.33c1.39,0,2.45-.9,3.17-2.69a29.58,29.58,0,0,0,1.23-5.61l1-6.74A24.45,24.45,0,0,1,52.3,2.1,1.22,1.22,0,0,1,53.16,1.24Zm7.14,9.82a5.87,5.87,0,0,1,.68,3,8.55,8.55,0,0,1-1,4.27,3.68,3.68,0,0,1-3.48,1.84H51.82v-.76a1.3,1.3,0,0,0,.72-.4,3.94,3.94,0,0,0,.52-1.71L55,4.1c0-.39.09-.72.12-1s0-.46,0-.6c0-.53-.07-.86-.23-1A1.64,1.64,0,0,0,54,1.24V.48h4.17a3.4,3.4,0,0,1,2.67,1,4.91,4.91,0,0,1,1,3.38,5.33,5.33,0,0,1-1.17,3.61,4.8,4.8,0,0,1-1.68,1.22A4.84,4.84,0,0,1,60.3,11.06Zm-1.66,2.45a3.81,3.81,0,0,0-.73-2.74,2.63,2.63,0,0,0-1.58-.52l-1,7.2a4,4,0,0,0-.05.4c0,.15,0,.32,0,.51a.9.9,0,0,0,.33.82,1.13,1.13,0,0,0,.59.12c1,0,1.67-.87,2.1-2.59A13.54,13.54,0,0,0,58.64,13.51Zm.12-5.29A5.92,5.92,0,0,0,59.4,6.1a12.74,12.74,0,0,0,.13-1.74,6.54,6.54,0,0,0-.29-2.11,1.11,1.11,0,0,0-1.13-.81.49.49,0,0,0-.49.32,3.52,3.52,0,0,0-.23,1l-.94,6.62A7.45,7.45,0,0,0,58,9,1.8,1.8,0,0,0,58.76,8.22Zm11.71,6.14a8.78,8.78,0,0,1-2,3.87,4,4,0,0,1-2.74,1,.89.89,0,0,1-.63-.21.93.93,0,0,1-.22-.7,3.4,3.4,0,0,1,0-.48c0-.14,0-.28,0-.44l2-14.08a3.8,3.8,0,0,1,.47-1.64,1.94,1.94,0,0,1,1.08-.48V.48H63.6v.76a2,2,0,0,1,.91.31,1.36,1.36,0,0,1,.22.94c0,.2,0,.42,0,.67s-.07.57-.13,1L62.68,17.34a4.31,4.31,0,0,1-.44,1.6,1.28,1.28,0,0,1-.8.52v.76h8.5l.9-5.74ZM76.89.48H72.32v.76a1.92,1.92,0,0,1,.9.31c.15.13.22.44.22.94a5.56,5.56,0,0,1,0,.67c0,.26-.07.57-.12,1L71.39,17.35A4.35,4.35,0,0,1,71,18.94a1.33,1.33,0,0,1-.81.52v.76h4.57v-.76a1.81,1.81,0,0,1-.91-.32,1.39,1.39,0,0,1-.21-.94c0-.09,0-.18,0-.28l0-.3.12-1L75.65,3.36a4.43,4.43,0,0,1,.43-1.6,1.3,1.3,0,0,1,.81-.52Zm8.46.15A.38.38,0,0,1,85,.87a4.12,4.12,0,0,1-1-.44A3.51,3.51,0,0,0,82.37,0Q79.84,0,78,3.92a21.42,21.42,0,0,0-1.84,9.24,11.15,11.15,0,0,0,1.2,5.57,3.51,3.51,0,0,0,3.05,2.08,3.15,3.15,0,0,0,2.21-1.09,8.92,8.92,0,0,0,1.89-3.35L84,15.72A11.08,11.08,0,0,1,83,17.81a2.71,2.71,0,0,1-2.12,1.43,2,2,0,0,1-1.59-1.13,8.33,8.33,0,0,1-.74-4.2A29.46,29.46,0,0,1,79.7,5.62Q81,1.08,82.8,1.07c.59,0,1.07.38,1.45,1.14a8,8,0,0,1,.57,3.47,2.73,2.73,0,0,1,0,.32c0,.08,0,.32,0,.73l.48.17L86.05,0h-.47A2.93,2.93,0,0,1,85.35.63Zm21.41,13.73.37.12-.9,5.74H94.72l-1.66-9.76h-.43l-.91,6.14-.13,1c0,.08,0,.16,0,.25s0,.19,0,.28a1.57,1.57,0,0,0,.2,1,1.81,1.81,0,0,0,.92.32v.76H88.11v-.76a1.3,1.3,0,0,0,.81-.52,4.35,4.35,0,0,0,.43-1.59L91.24,4.11c0-.27.07-.51.09-.71a8.23,8.23,0,0,0,.07-1,1.3,1.3,0,0,0-.21-.9,2.08,2.08,0,0,0-.91-.3V.48h4.23A3.81,3.81,0,0,1,96.7,1c1,.65,1.43,1.9,1.43,3.75a8.73,8.73,0,0,1-.24,2,5.66,5.66,0,0,1-.81,1.9,3.49,3.49,0,0,1-.93,1,6.73,6.73,0,0,1-1,.52c0,.3.09.49.1.57l1.18,6.66a4.74,4.74,0,0,0,.52,1.7,1,1,0,0,0,.78.39,1.23,1.23,0,0,0,.78-.5A4.3,4.3,0,0,0,99,17.35l1.88-13.24c.05-.34.09-.64.12-.92a6.28,6.28,0,0,0,0-.7,1.45,1.45,0,0,0-.2-.94,2,2,0,0,0-.91-.31V.48h8.26l-.65,5.6L107.1,6a9.57,9.57,0,0,0-.36-3,2.3,2.3,0,0,0-2.38-1.51c-.41,0-.67.09-.78.28a2.87,2.87,0,0,0-.29,1.06l-.91,6.56a3.57,3.57,0,0,0,2.08-.51,6.59,6.59,0,0,0,1.06-2.61l.42.1-1.14,8.08-.42-.15c0-.28,0-.52.05-.73s0-.37,0-.51a3.6,3.6,0,0,0-.46-2.15,2.14,2.14,0,0,0-1.75-.57l-1,7.2a4.7,4.7,0,0,0-.06.51c0,.16,0,.29,0,.39a1.12,1.12,0,0,0,.17.66.77.77,0,0,0,.69.26,3.77,3.77,0,0,0,2.37-.75A7.71,7.71,0,0,0,106.76,14.36ZM95.09,8.17a7.75,7.75,0,0,0,.49-1.62,10.75,10.75,0,0,0,.23-2.26,5.77,5.77,0,0,0-.32-2,1.11,1.11,0,0,0-1.08-.81.48.48,0,0,0-.46.26,3.44,3.44,0,0,0-.25,1.05L92.78,9.5A3.78,3.78,0,0,0,94,9.3,2.08,2.08,0,0,0,95.09,8.17Zm21.32,6.19a8.67,8.67,0,0,1-2,3.87,4,4,0,0,1-2.73,1,.89.89,0,0,1-.63-.21.93.93,0,0,1-.23-.7c0-.19,0-.35,0-.48s0-.28,0-.44l2-14.08a3.84,3.84,0,0,1,.46-1.64,2,2,0,0,1,1.08-.48V.48h-4.86v.76a2,2,0,0,1,.91.31,1.38,1.38,0,0,1,.21.94,5.56,5.56,0,0,1,0,.67c0,.26-.07.57-.12,1l-1.89,13.23a4.16,4.16,0,0,1-.43,1.6,1.27,1.27,0,0,1-.81.52v.76h8.51l.9-5.74Zm8.64,0a7.71,7.71,0,0,1-2.38,4.16,3.82,3.82,0,0,1-2.38.75.77.77,0,0,1-.69-.26,1.2,1.2,0,0,1-.17-.66c0-.1,0-.23,0-.39a4.7,4.7,0,0,1,.06-.51l1-7.2a2.17,2.17,0,0,1,1.76.57,3.69,3.69,0,0,1,.45,2.15c0,.14,0,.31,0,.51s0,.45,0,.73l.42.15,1.13-8.08-.42-.1a6.79,6.79,0,0,1-1,2.61,3.63,3.63,0,0,1-2.09.51l.91-6.56a2.87,2.87,0,0,1,.29-1.06c.12-.19.38-.28.78-.28A2.3,2.3,0,0,1,125,2.91a9.57,9.57,0,0,1,.36,3l.41.13.65-5.6h-8.26v.76a1.93,1.93,0,0,1,.91.31,1.45,1.45,0,0,1,.2.94,6.28,6.28,0,0,1,0,.7c0,.28-.07.58-.11.92l-1.89,13.24a4.35,4.35,0,0,1-.43,1.59,1.33,1.33,0,0,1-.81.52v.76h8.5l.91-5.74Zm10.29,5.15v.71h-4.65v-.71a1.44,1.44,0,0,0,.93-.41,2.08,2.08,0,0,0,.27-1.29c0-.22,0-.75-.08-1.58,0-.17-.06-.89-.15-2.15h-3.31l-.89,3a5.32,5.32,0,0,0-.16.66,3.4,3.4,0,0,0-.08.69,1.06,1.06,0,0,0,.2.78,1.68,1.68,0,0,0,.79.3v.71h-3v-.71a1.8,1.8,0,0,0,.63-.53,6.45,6.45,0,0,0,.67-1.56L132.19.07h.4L134.06,17a7.15,7.15,0,0,0,.36,2.08A1.13,1.13,0,0,0,135.34,19.51Zm-3.79-6.6L131,5.73l-2.27,7.18Zm9.6-4-1.32-2.09a4.57,4.57,0,0,1-.47-.94,5.12,5.12,0,0,1-.28-1.78,5.57,5.57,0,0,1,.27-1.77c.27-.83.7-1.24,1.29-1.24s1.21.51,1.57,1.54A8.78,8.78,0,0,1,142.65,5l.06,1,.39.1.63-5.91h-.46a2.09,2.09,0,0,1-.25.54.46.46,0,0,1-.41.21.57.57,0,0,1-.24-.05,1.23,1.23,0,0,1-.26-.12l-.39-.24a2.34,2.34,0,0,0-.5-.25,2.41,2.41,0,0,0-.85-.16,2.55,2.55,0,0,0-2.31,1.67,9.11,9.11,0,0,0-.83,4.05,10.47,10.47,0,0,0,1.88,5.5A9.21,9.21,0,0,1,141,16a6.49,6.49,0,0,1-.5,2.63,1.59,1.59,0,0,1-1.43,1.14,1.42,1.42,0,0,1-1-.4,3.55,3.55,0,0,1-.78-1.16,7.09,7.09,0,0,1-.52-1.92c-.05-.43-.1-1.12-.13-2.06l-.44-.06-.55,6.62h.46a4.11,4.11,0,0,1,.25-.82.36.36,0,0,1,.36-.23.47.47,0,0,1,.17,0,2.38,2.38,0,0,1,.27.18l.39.27a3.52,3.52,0,0,0,.84.43,2.48,2.48,0,0,0,.84.15,2.91,2.91,0,0,0,2.63-1.88,9.24,9.24,0,0,0,1-4.21,9.85,9.85,0,0,0-.49-3.24A12.1,12.1,0,0,0,141.15,8.92Zm7.75-7.24c.12-.19.38-.28.78-.28a2.3,2.3,0,0,1,2.38,1.51,9.57,9.57,0,0,1,.36,3l.41.13.65-5.6h-8.26v.76a1.93,1.93,0,0,1,.91.31c.14.13.2.44.2.94a6.28,6.28,0,0,1,0,.7c0,.28-.07.58-.11.92l-1.89,13.24a4.35,4.35,0,0,1-.43,1.59,1.33,1.33,0,0,1-.81.52v.76h8.5l.91-5.74-.38-.12a7.71,7.71,0,0,1-2.38,4.16,3.82,3.82,0,0,1-2.38.75.77.77,0,0,1-.69-.26,1.2,1.2,0,0,1-.17-.66c0-.1,0-.23,0-.39a4.7,4.7,0,0,1,.06-.51l1-7.2a2.17,2.17,0,0,1,1.76.57,3.69,3.69,0,0,1,.45,2.15c0,.14,0,.31,0,.51s0,.45,0,.73l.42.15,1.14-8.08-.43-.1a6.79,6.79,0,0,1-1.05,2.61,3.63,3.63,0,0,1-2.09.51l.91-6.56A2.87,2.87,0,0,1,148.9,1.68Z",opacity:1,strokeColor:"",fillColor:"#192760",width:153.485,height:20.812,stampFillColor:"#dce3ef",stampStrokeColor:""};break;case"NotForPublicRelease":case"Not For Public Release":t={iconName:"Not For Public Release",pathdata:"M9,2.35q-.21.9-.51,3.48L6.69,21.05H6.38L3.11,4.45,1.85,15.19c-.1.89-.17,1.56-.2,2s0,.55,0,.81A2.39,2.39,0,0,0,2,19.45a1.09,1.09,0,0,0,.67.33v.77H0v-.77a1.22,1.22,0,0,0,.71-.91,33.91,33.91,0,0,0,.57-3.68L2.7,2.88l-.06-.3a2.09,2.09,0,0,0-.39-1.07,1,1,0,0,0-.59-.25V.48H4.2L6.93,14.36l1-8.49c.06-.53.11-1,.14-1.4.06-.63.08-1.08.08-1.37a2.67,2.67,0,0,0-.3-1.5,1.07,1.07,0,0,0-.69-.34V.48H9.73v.78l-.18.06C9.29,1.41,9.09,1.75,9,2.35ZM16.74,2a13.19,13.19,0,0,1,.87,5.28,27.45,27.45,0,0,1-1.54,9.22q-1.65,4.66-3.79,4.67-1.35,0-2.19-1.95a13.31,13.31,0,0,1-.85-5.23A27.59,27.59,0,0,1,10.82,4.6C11.91,1.53,13.15,0,14.51,0,15.41,0,16.16.65,16.74,2Zm-.95,2.73a9.33,9.33,0,0,0-.31-2.59c-.21-.72-.54-1.08-1-1.08-1.05,0-1.92,2.21-2.64,6.64a54.69,54.69,0,0,0-.81,8.4,14.21,14.21,0,0,0,.15,2.23c.2,1.2.57,1.8,1.1,1.8s.95-.43,1.35-1.31a22.84,22.84,0,0,0,1.26-5c.28-1.55.49-3.19.65-4.91S15.79,5.74,15.79,4.68Zm2.3.93.32.21A10.7,10.7,0,0,1,19.52,2.6a1.87,1.87,0,0,1,1.6-1.08L19.27,17.63a4,4,0,0,1-.52,1.88,1,1,0,0,1-.79.27v.77h4.17v-.77a1.72,1.72,0,0,1-.85-.3,1.56,1.56,0,0,1-.2-1,2.44,2.44,0,0,1,0-.27c0-.08,0-.2,0-.33l.11-1L23,1.52A1.31,1.31,0,0,1,24,2.17a8.49,8.49,0,0,1,.69,4l.33.07L25.5.48H18.57ZM28.75.48v.78a1.39,1.39,0,0,1,.74.31,1.44,1.44,0,0,1,.18.9q0,.36-.06,1c0,.2-.05.44-.07.71L28,17.62a5.34,5.34,0,0,1-.35,1.61,1.05,1.05,0,0,1-.67.55v.77H30.7v-.77a.82.82,0,0,1-.6-.2,1.69,1.69,0,0,1-.31-1.18c0-.11,0-.22,0-.32l0-.35.83-7.33a1.42,1.42,0,0,1,1.4.64,5,5,0,0,1,.33,2.13c0,.12,0,.28,0,.5s0,.47,0,.76l.34.15.94-8.21-.35-.1a8.12,8.12,0,0,1-.85,2.64,2.42,2.42,0,0,1-1.64.52l.74-6.65a3.34,3.34,0,0,1,.25-1.1.64.64,0,0,1,.59-.26A1.91,1.91,0,0,1,34.28,3a11.32,11.32,0,0,1,.29,3.06l.34.13.54-5.7Zm15,6.75a27.46,27.46,0,0,1-1.55,9.22q-1.65,4.66-3.79,4.67-1.35,0-2.19-1.95a13.49,13.49,0,0,1-.85-5.23A27.59,27.59,0,0,1,37,4.6Q38.65,0,40.69,0c.91,0,1.65.65,2.23,2A13.17,13.17,0,0,1,43.8,7.23ZM42,4.68a9.3,9.3,0,0,0-.32-2.59c-.21-.72-.53-1.08-1-1.08Q39.12,1,38,7.65a54.69,54.69,0,0,0-.81,8.4,13,13,0,0,0,.16,2.23c.2,1.2.56,1.8,1.09,1.8s1-.43,1.35-1.31a23.28,23.28,0,0,0,1.27-5c.27-1.55.49-3.19.64-4.91S42,5.74,42,4.68ZM50.32,1c.78.66,1.17,1.93,1.17,3.8a11,11,0,0,1-.19,2,7.2,7.2,0,0,1-.66,1.93,3.45,3.45,0,0,1-.77,1,5.58,5.58,0,0,1-.8.52c0,.31.07.51.08.58l1,6.78a5.63,5.63,0,0,0,.42,1.72.85.85,0,0,0,.69.42v.77H48.69l-1.36-9.92H47l-.75,6.25-.1,1c0,.08,0,.16,0,.26v.28a1.94,1.94,0,0,0,.16,1,1.39,1.39,0,0,0,.75.32v.77H43.27v-.77a1.07,1.07,0,0,0,.66-.53,4.83,4.83,0,0,0,.36-1.61L45.84,4.18c0-.28.06-.52.08-.72,0-.42,0-.75,0-1a1.48,1.48,0,0,0-.17-.91,1.39,1.39,0,0,0-.74-.31V.48h3.46A2.67,2.67,0,0,1,50.32,1Zm-.73,3.34a7.2,7.2,0,0,0-.26-2.09c-.18-.55-.47-.83-.89-.83a.4.4,0,0,0-.38.27,4.46,4.46,0,0,0-.2,1.06L47.1,9.65a2.39,2.39,0,0,0,1-.2A2,2,0,0,0,49,8.31a10,10,0,0,0,.4-1.65A12.71,12.71,0,0,0,49.59,4.37Zm11.1-3.3c.77.74,1.16,2.1,1.16,4.09a8.51,8.51,0,0,1-.94,4.28A2.78,2.78,0,0,1,58.48,11h-.36l-.73-.12-.69,6-.11,1c0,.1,0,.2,0,.3s0,.2,0,.3a1.7,1.7,0,0,0,.17.95,1.47,1.47,0,0,0,.75.32v.77H53.77v-.77a1.07,1.07,0,0,0,.66-.53,4.83,4.83,0,0,0,.36-1.61L56.34,4.17l.09-.9c0-.31,0-.55,0-.74a1.58,1.58,0,0,0-.25-1,1.33,1.33,0,0,0-.67-.23V.48h3.62A2.11,2.11,0,0,1,60.69,1.07ZM60,4.32a7,7,0,0,0-.25-2.06c-.17-.53-.45-.8-.84-.8a.4.4,0,0,0-.4.29,6.14,6.14,0,0,0-.2,1L57.5,9.93l.23.06h.21a1.3,1.3,0,0,0,1-.36,3.17,3.17,0,0,0,.6-1.2,12.69,12.69,0,0,0,.36-2A19.64,19.64,0,0,0,60,4.32Zm10.6-3.06V.48H68v.78a1.17,1.17,0,0,1,.68.32A2.43,2.43,0,0,1,69,3.05c0,.32,0,.85-.11,1.6,0-.12,0,.27-.12,1.18l-.73,6.26a36.28,36.28,0,0,1-.8,4.86c-.45,1.65-1.07,2.47-1.87,2.47a1.27,1.27,0,0,1-1.13-.78,5.05,5.05,0,0,1-.41-2.27c0-.43,0-1.1.13-2,.05-.51.12-1.17.21-2l1-9a4.69,4.69,0,0,1,.38-1.69,1.24,1.24,0,0,1,.8-.47V.48H62.55v.78a1.39,1.39,0,0,1,.74.31,1.56,1.56,0,0,1,.17.91c0,.21,0,.47,0,.76s-.06.6-.1.94l-.85,7.36c-.14,1.15-.23,2-.27,2.42-.06.76-.1,1.44-.1,2a7.4,7.4,0,0,0,.81,3.78,2.35,2.35,0,0,0,2,1.35c1.14,0,2-.91,2.6-2.74a35.69,35.69,0,0,0,1-5.7l.79-6.85a30.83,30.83,0,0,1,.58-3.7A1.15,1.15,0,0,1,70.61,1.26Zm5.86,10a7.16,7.16,0,0,1,.56,3.1,10.31,10.31,0,0,1-.86,4.34,2.93,2.93,0,0,1-2.86,1.87h-3.8v-.77a1.07,1.07,0,0,0,.59-.41,4.64,4.64,0,0,0,.43-1.73L72.08,4.17c0-.4.08-.73.1-1s0-.46,0-.61a1.83,1.83,0,0,0-.19-1,1.22,1.22,0,0,0-.73-.28V.48h3.43a2.58,2.58,0,0,1,2.19,1.06A5.92,5.92,0,0,1,77.69,5a6.3,6.3,0,0,1-1,3.67,4.18,4.18,0,0,1-1.39,1.24A4.36,4.36,0,0,1,76.47,11.24Zm-1.36,2.49a4.59,4.59,0,0,0-.6-2.79,2,2,0,0,0-1.3-.52l-.84,7.32c0,.12,0,.25,0,.4s0,.33,0,.52a1.06,1.06,0,0,0,.27.84.77.77,0,0,0,.48.11c.8,0,1.38-.87,1.73-2.63A17.3,17.3,0,0,0,75.11,13.73Zm.1-5.38a7.33,7.33,0,0,0,.52-2.15,15,15,0,0,0,.11-1.77,7.89,7.89,0,0,0-.24-2.14c-.16-.55-.46-.83-.93-.83a.42.42,0,0,0-.4.33,4.42,4.42,0,0,0-.19,1l-.77,6.73a5.23,5.23,0,0,0,1.27-.36A1.77,1.77,0,0,0,75.21,8.35Zm9.61,6.24a9.73,9.73,0,0,1-1.66,3.94,2.93,2.93,0,0,1-2.25,1,.64.64,0,0,1-.51-.21,1,1,0,0,1-.19-.71c0-.19,0-.35,0-.49s0-.29,0-.44L81.91,3.41a4.53,4.53,0,0,1,.38-1.66,1.47,1.47,0,0,1,.88-.49V.48h-4v.78a1.39,1.39,0,0,1,.75.32,1.59,1.59,0,0,1,.18.95c0,.2,0,.43,0,.68s0,.58-.1,1L78.42,17.62a5.28,5.28,0,0,1-.35,1.63,1.12,1.12,0,0,1-.67.53v.77h7l.73-5.83ZM90.09,1.26V.48H86.34v.78a1.38,1.38,0,0,1,.74.32,1.59,1.59,0,0,1,.18.95q0,.3,0,.69c0,.25-.06.57-.11.95L85.58,17.64a5.41,5.41,0,0,1-.36,1.61,1.07,1.07,0,0,1-.66.53v.77h3.75v-.77a1.47,1.47,0,0,1-.75-.32,1.78,1.78,0,0,1-.17-1c0-.08,0-.18,0-.28s0-.2,0-.3l.1-1L89.07,3.41a5.68,5.68,0,0,1,.35-1.62A1.1,1.1,0,0,1,90.09,1.26Zm7-.62a.33.33,0,0,1-.3.24,3.1,3.1,0,0,1-.82-.44A2.5,2.5,0,0,0,94.59,0Q92.51,0,91,4a26.57,26.57,0,0,0-1.51,9.39,13.57,13.57,0,0,0,1,5.67c.66,1.41,1.49,2.11,2.5,2.11A2.46,2.46,0,0,0,94.79,20a9.66,9.66,0,0,0,1.55-3.4L96,16a12.68,12.68,0,0,1-.89,2.13c-.54,1-1.12,1.45-1.74,1.45-.47,0-.91-.39-1.31-1.15a10.33,10.33,0,0,1-.6-4.27,36.59,36.59,0,0,1,1-8.43c.72-3.08,1.57-4.63,2.54-4.63.48,0,.88.39,1.19,1.16a10,10,0,0,1,.47,3.53V6.1c0,.07,0,.32,0,.74L97,7l.64-7h-.38A4.28,4.28,0,0,1,97,.64Zm17.57,14,.31.13-.75,5.83h-9.45l-1.35-9.92H103l-.74,6.25-.11,1c0,.08,0,.16,0,.26v.28a1.94,1.94,0,0,0,.16,1,1.39,1.39,0,0,0,.75.32v.77H99.3v-.77a1.12,1.12,0,0,0,.67-.53,5.18,5.18,0,0,0,.35-1.61l1.55-13.46c0-.28.06-.52.08-.72,0-.42,0-.75,0-1a1.48,1.48,0,0,0-.17-.91,1.39,1.39,0,0,0-.74-.31V.48h3.46a2.64,2.64,0,0,1,1.8.55c.78.66,1.17,1.93,1.17,3.8a11,11,0,0,1-.19,2,6.57,6.57,0,0,1-.66,1.93,3.61,3.61,0,0,1-.76,1,6.48,6.48,0,0,1-.81.52c0,.31.07.51.08.58l1,6.78a5.63,5.63,0,0,0,.42,1.72.84.84,0,0,0,.65.4,1.06,1.06,0,0,0,.64-.51,5.41,5.41,0,0,0,.36-1.61l1.54-13.47c0-.34.07-.65.1-.92s0-.52,0-.72a1.61,1.61,0,0,0-.17-.95,1.31,1.31,0,0,0-.74-.32V.48h6.78l-.53,5.7-.34-.13a11.8,11.8,0,0,0-.3-3.09,1.92,1.92,0,0,0-2-1.54c-.33,0-.55.1-.64.29a3.46,3.46,0,0,0-.24,1.07L111,9.45a2.6,2.6,0,0,0,1.72-.51,7.79,7.79,0,0,0,.86-2.66l.35.11-.93,8.2-.35-.15c0-.28,0-.53,0-.74v-.52a4.42,4.42,0,0,0-.37-2.18,1.56,1.56,0,0,0-1.44-.58l-.83,7.32c0,.18,0,.35,0,.51s0,.3,0,.4a1.45,1.45,0,0,0,.13.67c.09.18.28.26.57.26a2.72,2.72,0,0,0,2-.76A8.33,8.33,0,0,0,114.61,14.59ZM105,8.31a9.81,9.81,0,0,0,.41-1.65,13.72,13.72,0,0,0,.18-2.29,6.87,6.87,0,0,0-.26-2.09c-.17-.55-.47-.83-.89-.83a.4.4,0,0,0-.38.27,5.05,5.05,0,0,0-.2,1.06l-.76,6.87a2.39,2.39,0,0,0,1-.2A2,2,0,0,0,105,8.31Zm17.51,6.28a9.86,9.86,0,0,1-1.67,3.94,2.93,2.93,0,0,1-2.25,1,.64.64,0,0,1-.51-.21,1.1,1.1,0,0,1-.19-.71c0-.19,0-.35,0-.49s0-.29,0-.44l1.64-14.32A4.53,4.53,0,0,1,120,1.75a1.47,1.47,0,0,1,.89-.49V.48h-4v.78a1.39,1.39,0,0,1,.75.32,1.59,1.59,0,0,1,.18.95c0,.2,0,.43,0,.68s0,.58-.1,1l-1.55,13.45a5.28,5.28,0,0,1-.35,1.63,1.1,1.1,0,0,1-.66.53v.77h7l.74-5.83Zm7.09,0a8.33,8.33,0,0,1-2,4.23,2.73,2.73,0,0,1-2,.76c-.29,0-.48-.08-.57-.26a1.45,1.45,0,0,1-.13-.67c0-.1,0-.23,0-.4s0-.33,0-.51l.83-7.32a1.58,1.58,0,0,1,1.44.58,4.42,4.42,0,0,1,.37,2.18c0,.14,0,.31,0,.52s0,.46,0,.74l.34.15.94-8.2-.35-.11a7.71,7.71,0,0,1-.87,2.66,2.56,2.56,0,0,1-1.71.51l.75-6.67A3.46,3.46,0,0,1,127,1.71c.09-.19.31-.29.64-.29a1.92,1.92,0,0,1,2,1.54,11.8,11.8,0,0,1,.3,3.09l.33.13.54-5.7H124v.78a1.31,1.31,0,0,1,.75.32,1.7,1.7,0,0,1,.17.95,6.75,6.75,0,0,1,0,.72c0,.27-.05.58-.09.92l-1.55,13.47a5.18,5.18,0,0,1-.35,1.61,1.12,1.12,0,0,1-.67.53v.77h7l.75-5.83Zm8.45,5.24v.72h-3.83v-.72a1.11,1.11,0,0,0,.77-.41,2.52,2.52,0,0,0,.23-1.31c0-.23,0-.77-.07-1.62,0-.17-.05-.9-.13-2.18h-2.71l-.74,3c0,.2-.09.43-.13.67a4.44,4.44,0,0,0-.06.71,1.27,1.27,0,0,0,.16.79,1.35,1.35,0,0,0,.65.3v.72h-2.47v-.72a1.66,1.66,0,0,0,.52-.54,7.25,7.25,0,0,0,.55-1.58L135.49.07h.33L137,17.23a8.87,8.87,0,0,0,.3,2.11A.9.9,0,0,0,138.08,19.83ZM135,13.12l-.47-7.3-1.86,7.3Zm7.88-4-1.09-2.13a6.38,6.38,0,0,1-.39-1,6.65,6.65,0,0,1-.23-1.82,6.93,6.93,0,0,1,.23-1.8q.33-1.26,1-1.26c.57,0,1,.53,1.3,1.57a10.87,10.87,0,0,1,.36,2.39l0,1,.33.1.51-6h-.38a2.26,2.26,0,0,1-.2.54.38.38,0,0,1-.34.22.54.54,0,0,1-.19-.05l-.22-.13-.32-.25a2.36,2.36,0,0,0-.41-.25,1.82,1.82,0,0,0-.7-.16c-.81,0-1.44.57-1.9,1.7a11.21,11.21,0,0,0-.68,4.12,12.36,12.36,0,0,0,1.55,5.58,10.74,10.74,0,0,1,1.54,4.78,7.8,7.8,0,0,1-.41,2.67c-.28.76-.67,1.15-1.17,1.15a1.07,1.07,0,0,1-.79-.4,3.78,3.78,0,0,1-.64-1.18,7.79,7.79,0,0,1-.42-1.95c-.05-.44-.08-1.14-.11-2.1l-.36-.06-.46,6.73h.38a6.32,6.32,0,0,1,.2-.83.31.31,0,0,1,.3-.24.21.21,0,0,1,.14,0,1.06,1.06,0,0,1,.22.18l.32.27a3,3,0,0,0,.69.44,1.72,1.72,0,0,0,.69.15c.92,0,1.64-.63,2.16-1.91a11.22,11.22,0,0,0,.78-4.28,12.2,12.2,0,0,0-.4-3.29A14.21,14.21,0,0,0,142.85,9.07Zm6.36-7.36c.09-.19.31-.29.64-.29a1.92,1.92,0,0,1,2,1.54,11.8,11.8,0,0,1,.3,3.09l.33.13L153,.48h-6.79v.78a1.31,1.31,0,0,1,.75.32,1.7,1.7,0,0,1,.17.95,6.75,6.75,0,0,1,0,.72c0,.27-.05.58-.09.92l-1.55,13.47a5.18,5.18,0,0,1-.35,1.61,1.12,1.12,0,0,1-.67.53v.77h7l.75-5.83-.31-.13a8.33,8.33,0,0,1-2,4.23,2.73,2.73,0,0,1-2,.76c-.29,0-.48-.08-.57-.26a1.45,1.45,0,0,1-.13-.67c0-.1,0-.23,0-.4s0-.33.05-.51l.83-7.32a1.58,1.58,0,0,1,1.44.58,4.42,4.42,0,0,1,.37,2.18c0,.14,0,.31,0,.52s0,.46,0,.74l.34.15.94-8.2-.35-.11a7.71,7.71,0,0,1-.87,2.66,2.56,2.56,0,0,1-1.71.51L149,2.78A3.46,3.46,0,0,1,149.21,1.71Z",opacity:1,strokeColor:"",fillColor:"#192760",width:152.969,height:21.152,stampFillColor:"#dce3ef",stampStrokeColor:""};break;case"ForComment":case"For Comment":t={iconName:"For Comment",pathdata:"M14.1.48l-.89,5.6L12.65,6a7.14,7.14,0,0,0-.48-3c-.54-1-1.6-1.54-3.19-1.54a1.37,1.37,0,0,0-1,.26,2.06,2.06,0,0,0-.42,1.08L6.35,9.28a6,6,0,0,0,2.73-.52,5.92,5.92,0,0,0,1.41-2.59l.58.1L9.52,14.34,9,14.2c0-.29,0-.54.05-.75s0-.38,0-.49a3.15,3.15,0,0,0-.55-2.09,3.07,3.07,0,0,0-2.32-.64L4.77,17.44c0,.13,0,.24-.06.35s0,.21,0,.31a1.23,1.23,0,0,0,.53,1.17,2,2,0,0,0,1,.19v.76H0v-.76a1.91,1.91,0,0,0,1.12-.54,3.56,3.56,0,0,0,.58-1.58L4.27,4.11c.05-.27.09-.51.12-.71a7.42,7.42,0,0,0,.1-1c0-.48-.1-.77-.29-.9A3.54,3.54,0,0,0,3,1.24V.48ZM28,7.11a17.42,17.42,0,0,1-2.57,9.07q-2.75,4.61-6.3,4.6a4.33,4.33,0,0,1-3.65-1.92,8.53,8.53,0,0,1-1.41-5.14,17.56,17.56,0,0,1,2.62-9.19Q19.43,0,22.82,0a4.48,4.48,0,0,1,3.72,1.92A8.46,8.46,0,0,1,28,7.11ZM25,4.6a5.72,5.72,0,0,0-.52-2.55,1.72,1.72,0,0,0-1.63-1c-1.74,0-3.2,2.17-4.39,6.53a32.66,32.66,0,0,0-1.35,8.26,8.24,8.24,0,0,0,.26,2.2c.33,1.18.94,1.77,1.82,1.77a2.88,2.88,0,0,0,2.25-1.29,16.48,16.48,0,0,0,2.1-4.93,37.09,37.09,0,0,0,1.07-4.83A28.26,28.26,0,0,0,25,4.6Zm15.83.16a6.49,6.49,0,0,1-.33,2,5.12,5.12,0,0,1-1.09,1.9,4.65,4.65,0,0,1-1.27,1,11.5,11.5,0,0,1-1.35.52c.07.3.12.49.14.57l1.62,6.66a3.79,3.79,0,0,0,.7,1.7,1.75,1.75,0,0,0,1.14.41v.76H36.13l-2.26-9.76h-.59L32,16.6l-.17,1,0,.25a2.62,2.62,0,0,0,0,.28q0,.8.27,1a3,3,0,0,0,1.25.32v.76H27.11v-.76a1.93,1.93,0,0,0,1.11-.52,3.54,3.54,0,0,0,.59-1.59L31.38,4.11c.06-.27.1-.51.13-.71a6,6,0,0,0,.1-1c0-.47-.1-.77-.29-.9a3.54,3.54,0,0,0-1.24-.3V.48h5.76a6.77,6.77,0,0,1,3,.53Q40.79,2,40.79,4.76Zm-3.16-.47a4.35,4.35,0,0,0-.44-2,1.54,1.54,0,0,0-1.48-.81.75.75,0,0,0-.63.26,2.78,2.78,0,0,0-.33,1.05L33.48,9.5a6.85,6.85,0,0,0,1.67-.2,2.55,2.55,0,0,0,1.49-1.13,6.37,6.37,0,0,0,.67-1.62A7.81,7.81,0,0,0,37.63,4.29ZM58.49,0a2.61,2.61,0,0,1-.32.63.55.55,0,0,1-.49.24A7,7,0,0,1,56.31.43,6.15,6.15,0,0,0,54.1,0q-3.47,0-6,3.92a16.73,16.73,0,0,0-2.51,9.24,8.73,8.73,0,0,0,1.64,5.57,5,5,0,0,0,7.19,1A8.89,8.89,0,0,0,57,16.37l-.64-.65a10.47,10.47,0,0,1-1.47,2.09A4,4,0,0,1,52,19.24a2.89,2.89,0,0,1-2.17-1.13c-.67-.75-1-2.15-1-4.2a22.2,22.2,0,0,1,1.62-8.29q1.8-4.54,4.23-4.55a2.33,2.33,0,0,1,2,1.14,6.16,6.16,0,0,1,.78,3.47c0,.14,0,.25,0,.32s0,.32,0,.73l.66.17L59.12,0ZM72.71,7.11a17.33,17.33,0,0,1-2.57,9.07c-1.82,3.07-3.93,4.6-6.3,4.6a4.34,4.34,0,0,1-3.65-1.92,8.53,8.53,0,0,1-1.4-5.14A17.55,17.55,0,0,1,61.4,4.53Q64.15,0,67.54,0a4.48,4.48,0,0,1,3.72,1.92A8.39,8.39,0,0,1,72.71,7.11Zm-3-2.51a5.72,5.72,0,0,0-.52-2.55,1.72,1.72,0,0,0-1.63-1c-1.74,0-3.2,2.17-4.39,6.53a32.66,32.66,0,0,0-1.35,8.26,8.24,8.24,0,0,0,.26,2.2c.33,1.18.94,1.77,1.82,1.77a2.85,2.85,0,0,0,2.25-1.29,16,16,0,0,0,2.1-4.93,34.08,34.08,0,0,0,1.07-4.83A28.26,28.26,0,0,0,69.68,4.6Zm17.5,13.62a4.63,4.63,0,0,1,.07-.75c0-.3.09-.59.15-.88L90,3.31a3.32,3.32,0,0,1,.7-1.67,2,2,0,0,1,1-.4V.48H87.23l-6.4,13.91L79.63.48H74.84v.76a3.29,3.29,0,0,1,1.2.21c.21.11.31.37.31.78a4.35,4.35,0,0,1-.07.75c0,.28-.11.61-.18,1L74,15a19.63,19.63,0,0,1-1,3.65,1.54,1.54,0,0,1-1.17.86v.76H76.2v-.76a2.31,2.31,0,0,1-1.09-.29,1.6,1.6,0,0,1-.58-1.43,8.8,8.8,0,0,1,.14-1.42c0-.37.14-.82.24-1.37L77,4.24l1.41,16.37H79L86.89,3.76,84.25,17.34A2.94,2.94,0,0,1,83.61,19a2.87,2.87,0,0,1-1.44.49v.76h6.54v-.76a3.39,3.39,0,0,1-1.23-.31Q87.18,19,87.18,18.22Zm17.73,0a4.63,4.63,0,0,1,.07-.75c0-.3.1-.59.16-.88l2.58-13.28a3.24,3.24,0,0,1,.69-1.67,2,2,0,0,1,1-.4V.48H105l-6.4,13.91L97.36.48H92.57v.76a3.29,3.29,0,0,1,1.2.21c.21.11.32.37.32.78A5.65,5.65,0,0,1,94,3c0,.28-.11.61-.19,1L91.69,15a19.63,19.63,0,0,1-1,3.65,1.54,1.54,0,0,1-1.17.86v.76h4.38v-.76a2.33,2.33,0,0,1-1.1-.29,1.6,1.6,0,0,1-.58-1.43,10.12,10.12,0,0,1,.14-1.42c.06-.37.14-.82.25-1.37L94.76,4.24l1.41,16.37h.59l7.86-16.85L102,17.34a3.1,3.1,0,0,1-.64,1.63,3,3,0,0,1-1.45.49v.76h6.55v-.76a3.46,3.46,0,0,1-1.24-.31Q104.91,19,104.91,18.22Zm11.52.3a6.56,6.56,0,0,1-3.25.75,1.27,1.27,0,0,1-.94-.26,1,1,0,0,1-.22-.66,3,3,0,0,1,0-.39,4.88,4.88,0,0,1,.08-.51l1.38-7.2a3.65,3.65,0,0,1,2.4.57,2.92,2.92,0,0,1,.62,2.15c0,.14,0,.31,0,.51s0,.45-.06.73l.58.15,1.55-8.08-.58-.1a5.92,5.92,0,0,1-1.44,2.61,6.32,6.32,0,0,1-2.85.51L115,2.74a2.44,2.44,0,0,1,.39-1.06,1.43,1.43,0,0,1,1.07-.28c1.63,0,2.71.5,3.25,1.51a7.37,7.37,0,0,1,.49,3l.56.13.89-5.6H110.31v.76a3.28,3.28,0,0,1,1.25.31c.19.13.28.44.28.94a4.83,4.83,0,0,1-.06.7c0,.28-.09.58-.16.92l-2.57,13.24a3.54,3.54,0,0,1-.59,1.59,1.93,1.93,0,0,1-1.11.52v.76H119l1.24-5.74-.51-.12A7.7,7.7,0,0,1,116.43,18.52ZM136.6,1.24V.48h-4.3v.76a2.5,2.5,0,0,1,1.14.33A1.8,1.8,0,0,1,134,3.05a10.58,10.58,0,0,1-.14,1.34c-.05.41-.13.87-.22,1.39L132,14.12,127.41.48h-4.22v.76a2.53,2.53,0,0,1,1,.24,1.82,1.82,0,0,1,.64,1.06l.1.3L122.55,15a19.54,19.54,0,0,1-1,3.61,1.59,1.59,0,0,1-1.18.9v.76h4.37v-.76a2.5,2.5,0,0,1-1.12-.32,1.67,1.67,0,0,1-.55-1.44,5.32,5.32,0,0,1,0-.79c0-.43.17-1.09.34-2l2.08-10.57L131,20.71h.52l2.91-15a24.72,24.72,0,0,1,.85-3.42,1.42,1.42,0,0,1,1-1Zm.48-.76-.81,5,.54.2a8.1,8.1,0,0,1,1.85-3.16,3.63,3.63,0,0,1,2.66-1.06l-3.08,15.85a3,3,0,0,1-.86,1.85,2.42,2.42,0,0,1-1.32.26v.76H143v-.76a4,4,0,0,1-1.41-.3c-.23-.13-.34-.45-.34-.95a2.26,2.26,0,0,1,0-.26c0-.09,0-.2,0-.33l.17-1,2.92-15.1a2.64,2.64,0,0,1,1.76.63c.74.7,1.12,2,1.15,3.94l.55.07L148.6.48Z",opacity:1,strokeColor:"",fillColor:"#192760",width:148.603,height:20.812,stampFillColor:"#dce3ef",stampStrokeColor:""};break;case"Void":t={iconName:"Void",pathdata:"M27.88,1.72a6.53,6.53,0,0,0-1.81,1.42L9,21.12H7.54L4.09,5.83A11.83,11.83,0,0,0,2.82,2Q2.3,1.4,0,1.26V.48H13.54v.78a11,11,0,0,0-2.37.18q-1.11.27-1.11,1.05a1.43,1.43,0,0,0,0,.29c0,.09,0,.19,0,.28l2.35,12,8.56-9a25.11,25.11,0,0,0,1.83-2.14,3.15,3.15,0,0,0,.82-1.68c0-.41-.28-.69-.84-.82a12.57,12.57,0,0,0-2.08-.15V.48h8.7v.78A7.11,7.11,0,0,0,27.88,1.72ZM57.37,7.23q0,4.85-5.56,9.22a21.41,21.41,0,0,1-13.62,4.67,14.41,14.41,0,0,1-7.89-1.95,6,6,0,0,1-3-5.23q0-4.92,5.66-9.34A21.12,21.12,0,0,1,46.2,0a15,15,0,0,1,8,2A6,6,0,0,1,57.37,7.23ZM50.82,4.68a3.46,3.46,0,0,0-1.13-2.59A4.93,4.93,0,0,0,46.17,1q-5.64,0-9.49,6.64c-1.94,3.36-2.92,6.16-2.92,8.4a4.27,4.27,0,0,0,.56,2.23q1.08,1.8,3.93,1.8a9.24,9.24,0,0,0,4.87-1.31,15.24,15.24,0,0,0,4.54-5A21.81,21.81,0,0,0,50,8.85,14.23,14.23,0,0,0,50.82,4.68ZM66,18.49a1.49,1.49,0,0,1,0-.28c0-.1,0-.2.08-.3l.35-1L72,3.41a2.94,2.94,0,0,1,1.25-1.62,6.79,6.79,0,0,1,2.4-.53V.48H62.19v.78a13.27,13.27,0,0,1,2.67.32.88.88,0,0,1,.64.95,2.38,2.38,0,0,1-.12.69c-.08.25-.2.57-.36.95L59.45,17.64a3,3,0,0,1-1.28,1.61,6.84,6.84,0,0,1-2.39.53v.77H69.27v-.77a13.72,13.72,0,0,1-2.67-.32A.9.9,0,0,1,66,18.49Zm38.25-9.67q0,4.59-5.15,8-5.73,3.77-15,3.76h-13v-.77a7.4,7.4,0,0,0,2.1-.41,3.08,3.08,0,0,0,1.57-1.75L80.28,4.17c.16-.38.28-.7.37-1a2.27,2.27,0,0,0,.12-.68.89.89,0,0,0-.64-.95,13.41,13.41,0,0,0-2.68-.32V.48H90.6q6.68,0,10.15,2.27A6.92,6.92,0,0,1,104.23,8.82ZM97.58,7a5.28,5.28,0,0,0-1.13-3.54q-1.77-2-6.14-2a4.24,4.24,0,0,0-2,.32,1.77,1.77,0,0,0-.74.84L81.35,17.73a1.72,1.72,0,0,0-.12.39,1.89,1.89,0,0,0,0,.31.89.89,0,0,0,.54.85,5.1,5.1,0,0,0,2,.26q8.07,0,11.68-5.5A12.61,12.61,0,0,0,97.58,7Z",opacity:1,strokeColor:"",fillColor:"#8a251a",width:104.233,height:21.123,stampFillColor:"#f6dedd",stampStrokeColor:""};break;case"PreliminaryResults":case"Preliminary Results":t={iconName:"Preliminary Results",pathdata:"M9.23,5.08q0-3-1.32-4.08A2.6,2.6,0,0,0,6.17.41H2v.78a1.5,1.5,0,0,1,.76.23,1.39,1.39,0,0,1,.28,1c0,.19,0,.43,0,.73s-.07.61-.1.91L1.17,17.56a4.76,4.76,0,0,1-.41,1.62A1.18,1.18,0,0,1,0,19.7v.78H4.25V19.7a1.77,1.77,0,0,1-.86-.31,1.5,1.5,0,0,1-.2-1c0-.09,0-.19,0-.3a1.36,1.36,0,0,1,0-.29l.12-1,.78-6L5,11h.41a3.21,3.21,0,0,0,2.78-1.6A7.57,7.57,0,0,0,9.23,5.08ZM7,6.32a10,10,0,0,1-.42,2,3,3,0,0,1-.68,1.21,1.63,1.63,0,0,1-1.13.36H4.53l-.27-.06,1-7.15a4.75,4.75,0,0,1,.22-1,.45.45,0,0,1,.46-.29,1,1,0,0,1,1,.8,6.22,6.22,0,0,1,.29,2.06A18,18,0,0,1,7,6.32ZM23.4,18.75a3.35,3.35,0,0,1-2.23.76.68.68,0,0,1-.64-.26,1.27,1.27,0,0,1-.16-.68c0-.09,0-.23,0-.39s0-.34.05-.51l.95-7.33a1.92,1.92,0,0,1,1.65.59,4,4,0,0,1,.42,2.18c0,.14,0,.31,0,.52s0,.46,0,.74l.4.15,1.07-8.21-.4-.1a7,7,0,0,1-1,2.65,3.15,3.15,0,0,1-2,.52l.85-6.67a3,3,0,0,1,.28-1.08c.11-.19.35-.28.73-.28a2.16,2.16,0,0,1,2.23,1.54A10.27,10.27,0,0,1,26,6l.39.13L27,.41H19.2v.78a1.67,1.67,0,0,1,.86.31,1.52,1.52,0,0,1,.19,1,6.58,6.58,0,0,1,0,.71c0,.28-.07.59-.11.93L18.33,17.56a4.59,4.59,0,0,1-.4,1.62,1.22,1.22,0,0,1-.74.51,1,1,0,0,1-.73-.4A5.08,5.08,0,0,1,16,17.56l-1.1-6.77c0-.08,0-.27-.1-.58a5.14,5.14,0,0,0,.92-.53,3.23,3.23,0,0,0,.87-1,6,6,0,0,0,.76-1.93,9.63,9.63,0,0,0,.22-2c0-1.87-.44-3.14-1.34-3.81a3.4,3.4,0,0,0-2-.54h-4v.78a1.78,1.78,0,0,1,.85.3,1.4,1.4,0,0,1,.19.91c0,.24,0,.56-.06,1,0,.21-.05.45-.09.73L9.31,17.56a4.53,4.53,0,0,1-.41,1.62,1.15,1.15,0,0,1-.75.52v.78h4.28V19.7a1.62,1.62,0,0,1-.86-.32,1.72,1.72,0,0,1-.18-1v-.29c0-.09,0-.18,0-.25l.12-1,.86-6.24h.4l1.55,9.92h10.8L26,14.65l-.35-.13A7.9,7.9,0,0,1,23.4,18.75ZM13.67,9.38a3.35,3.35,0,0,1-1.15.2l.87-6.87a4,4,0,0,1,.23-1.06.45.45,0,0,1,.43-.27,1.05,1.05,0,0,1,1,.83,6.14,6.14,0,0,1,.3,2.08,11.74,11.74,0,0,1-.21,2.29,9,9,0,0,1-.47,1.65A2,2,0,0,1,13.67,9.38ZM35,14.65l-.84,5.83h-8V19.7a1.24,1.24,0,0,0,.76-.52,4.73,4.73,0,0,0,.4-1.63L29.15,4.1q.08-.57.12-1c0-.26,0-.48,0-.68a1.42,1.42,0,0,0-.21-1,1.67,1.67,0,0,0-.85-.31V.41h4.56v.78a1.67,1.67,0,0,0-1,.49,4.17,4.17,0,0,0-.44,1.66L29.49,17.65c0,.16,0,.31,0,.45a3.47,3.47,0,0,0,0,.48,1,1,0,0,0,.21.72.8.8,0,0,0,.59.21,3.54,3.54,0,0,0,2.56-1.05,9.24,9.24,0,0,0,1.91-3.94Zm2.79,4.73a1.61,1.61,0,0,0,.85.32v.78H34.39V19.7a1.18,1.18,0,0,0,.76-.52,4.76,4.76,0,0,0,.41-1.62L37.33,4.1c.05-.38.09-.7.11-1a5.83,5.83,0,0,0,0-.68,1.5,1.5,0,0,0-.2-1,1.71,1.71,0,0,0-.85-.31V.41h4.29v.78a1.22,1.22,0,0,0-.77.52,4.9,4.9,0,0,0-.39,1.63L37.78,16.8l-.11,1,0,.29c0,.11,0,.2,0,.29A1.52,1.52,0,0,0,37.83,19.38Zm12.2,0a1.81,1.81,0,0,0,.85.31v.78h-4.5V19.7a1.64,1.64,0,0,0,1-.49,4,4,0,0,0,.44-1.66l1.81-13.8-5.4,17.12h-.4l-1-16.64L41.39,15.12c-.07.56-.13,1-.17,1.39-.06.61-.09,1.09-.09,1.45a2,2,0,0,0,.4,1.45,1.19,1.19,0,0,0,.75.29v.78h-3V19.7a1.21,1.21,0,0,0,.81-.87,29.47,29.47,0,0,0,.66-3.71L42.21,4c0-.38.09-.71.12-1a5.41,5.41,0,0,0,.05-.75c0-.42-.07-.69-.21-.8a1.69,1.69,0,0,0-.83-.21V.41h3.29l.83,14.14L49.85.41h3.07v.78a1.12,1.12,0,0,0-.69.41,4.08,4.08,0,0,0-.48,1.69L50,16.79c0,.29-.08.59-.11.89s0,.56,0,.76A1.41,1.41,0,0,0,50,19.39Zm5,0a1.61,1.61,0,0,0,.85.32v.78H51.56V19.7a1.18,1.18,0,0,0,.76-.52,4.76,4.76,0,0,0,.41-1.62L54.5,4.1c0-.38.09-.7.11-1a5.83,5.83,0,0,0,0-.68,1.5,1.5,0,0,0-.2-1,1.71,1.71,0,0,0-.85-.31V.41h4.29v.78a1.22,1.22,0,0,0-.77.52,4.9,4.9,0,0,0-.39,1.63L55,16.8l-.11,1,0,.29c0,.11,0,.2,0,.29A1.52,1.52,0,0,0,55,19.38ZM66.13,5.75,64.13,21h-.36L60,4.38,58.6,15.12c-.12.89-.2,1.55-.23,2a7.32,7.32,0,0,0,0,.81,2.17,2.17,0,0,0,.38,1.46,1.32,1.32,0,0,0,.77.32v.78h-3V19.7a1.26,1.26,0,0,0,.81-.91,29,29,0,0,0,.65-3.67L59.56,2.81,59.5,2.5a2,2,0,0,0-.45-1.06,1.21,1.21,0,0,0-.67-.25V.41h2.9L64.4,14.28,65.52,5.8c.07-.53.12-1,.16-1.41.06-.62.09-1.08.09-1.36a2.45,2.45,0,0,0-.34-1.51,1.39,1.39,0,0,0-.79-.33V.41h3v.78l-.21.06c-.29.08-.52.43-.68,1A34.22,34.22,0,0,0,66.13,5.75ZM83.27,1A3.41,3.41,0,0,0,81.21.41h-4v.78a1.74,1.74,0,0,1,.85.3c.14.13.2.43.2.91,0,.24,0,.56-.06,1,0,.21-.06.45-.09.73L76.38,17.56A4.53,4.53,0,0,1,76,19.18a1.18,1.18,0,0,1-.76.52v0a1,1,0,0,1-.67-.45,8.11,8.11,0,0,1-.34-2.12L72.83,0h-.38L67.11,17.64a6.42,6.42,0,0,1-.63,1.58,1.84,1.84,0,0,1-.59.54v.72h2.83v-.72a1.68,1.68,0,0,1-.75-.31,1.16,1.16,0,0,1-.18-.79,3.46,3.46,0,0,1,.07-.7,5.16,5.16,0,0,1,.15-.67l.84-3H72c.08,1.28.13,2,.13,2.18.06.85.08,1.39.08,1.61a2.26,2.26,0,0,1-.25,1.31,1.43,1.43,0,0,1-.88.42v.72H79.5V19.7a1.58,1.58,0,0,1-.86-.32,1.7,1.7,0,0,1-.19-1c0-.1,0-.2,0-.29a1.81,1.81,0,0,1,0-.25l.12-1,.85-6.24h.41l1.55,9.92h2.9V19.7a1,1,0,0,1-.79-.41A5.15,5.15,0,0,1,83,17.56l-1.11-6.77c0-.08,0-.27-.09-.58a5.53,5.53,0,0,0,.92-.53,3.52,3.52,0,0,0,.87-1,6.16,6.16,0,0,0,.75-1.93,9.67,9.67,0,0,0,.23-2C84.61,2.89,84.16,1.62,83.27,1ZM69.19,13.05l2.13-7.3.53,7.3Zm13-6.47a8.39,8.39,0,0,1-.46,1.65,2,2,0,0,1-1,1.15,3.29,3.29,0,0,1-1.14.2l.87-6.87a3.61,3.61,0,0,1,.23-1.06.45.45,0,0,1,.43-.27,1.05,1.05,0,0,1,1,.83,6.14,6.14,0,0,1,.3,2.08A11,11,0,0,1,82.22,6.58ZM90.48.41h3v.78a1.07,1.07,0,0,0-.55.41,6.13,6.13,0,0,0-.77,1.62l-2.72,8-.72,5.55c0,.22-.07.51-.1.86a7.29,7.29,0,0,0-.06.73,1.46,1.46,0,0,0,.29,1.07,1.61,1.61,0,0,0,.83.25v.78H85V19.7a1.56,1.56,0,0,0,.93-.39,3.7,3.7,0,0,0,.53-1.76l.85-6.45-1.26-8a6.07,6.07,0,0,0-.36-1.47.81.81,0,0,0-.7-.4V.41h4v.78a1.32,1.32,0,0,0-.76.23c-.15.12-.23.4-.23.84a4.46,4.46,0,0,0,0,.48c0,.19,0,.39.07.6l1,6.54,1.88-5.55c.1-.29.18-.55.24-.79a4.68,4.68,0,0,0,.14-1.11,1.35,1.35,0,0,0-.31-1,1.14,1.14,0,0,0-.66-.2Zm18.61,1.22c.1-.19.35-.28.73-.28a2.16,2.16,0,0,1,2.23,1.54A10.27,10.27,0,0,1,112.39,6l.38.13.62-5.7h-7.76v.78a1.67,1.67,0,0,1,.86.31,1.59,1.59,0,0,1,.19,1,6.58,6.58,0,0,1,0,.71c0,.28-.07.59-.11.93l-1.77,13.46a4.53,4.53,0,0,1-.41,1.62,1.17,1.17,0,0,1-.73.51,1,1,0,0,1-.73-.4,5.08,5.08,0,0,1-.49-1.73l-1.1-6.77c0-.08,0-.27-.1-.58a5.14,5.14,0,0,0,.92-.53,3.4,3.4,0,0,0,.88-1,6.16,6.16,0,0,0,.75-1.93,9.63,9.63,0,0,0,.22-2c0-1.87-.44-3.14-1.34-3.81a3.38,3.38,0,0,0-2-.54h-4v.78a1.78,1.78,0,0,1,.85.3,1.4,1.4,0,0,1,.19.91c0,.24,0,.56-.06,1,0,.21,0,.45-.09.73L95.74,17.56a4.53,4.53,0,0,1-.41,1.62,1.15,1.15,0,0,1-.75.52v.78h4.28V19.7a1.62,1.62,0,0,1-.86-.32,1.72,1.72,0,0,1-.18-1v-.29c0-.09,0-.18,0-.25l.12-1,.86-6.24h.4l1.55,9.92h10.8l.85-5.83-.35-.13a7.9,7.9,0,0,1-2.24,4.23,3.35,3.35,0,0,1-2.23.76.71.71,0,0,1-.65-.26,1.37,1.37,0,0,1-.15-.68c0-.09,0-.23,0-.39s0-.34.05-.51l.95-7.33a1.92,1.92,0,0,1,1.65.59,4,4,0,0,1,.42,2.18c0,.14,0,.31,0,.52s0,.46,0,.74l.4.15,1.07-8.21-.41-.1a7,7,0,0,1-1,2.65,3.15,3.15,0,0,1-2,.52l.85-6.67A3,3,0,0,1,109.09,1.63Zm-9,7.75a3.35,3.35,0,0,1-1.15.2l.87-6.87a4,4,0,0,1,.23-1.06.45.45,0,0,1,.43-.27,1.05,1.05,0,0,1,1,.83,6.14,6.14,0,0,1,.3,2.08,11.74,11.74,0,0,1-.21,2.29,9,9,0,0,1-.47,1.65A2,2,0,0,1,100.1,9.38ZM120.18.07h.43l-.59,6-.37-.1-.05-1a10.11,10.11,0,0,0-.41-2.39c-.34-1-.83-1.57-1.48-1.57s-.95.42-1.21,1.26a6.17,6.17,0,0,0-.25,1.8,5.92,5.92,0,0,0,.26,1.82,5.23,5.23,0,0,0,.44,1L118.19,9a12.6,12.6,0,0,1,1.12,2.57,10.75,10.75,0,0,1,.47,3.29,10,10,0,0,1-.9,4.29,2.76,2.76,0,0,1-2.46,1.91,2.17,2.17,0,0,1-.79-.15,3.28,3.28,0,0,1-.79-.44l-.36-.28-.26-.18a.38.38,0,0,0-.16,0,.34.34,0,0,0-.34.23,5.5,5.5,0,0,0-.23.84h-.43l.52-6.73.41.06c0,1,.07,1.66.12,2.09a7.13,7.13,0,0,0,.49,1.95,3.52,3.52,0,0,0,.73,1.18,1.25,1.25,0,0,0,.9.41c.57,0,1-.39,1.34-1.15a7.13,7.13,0,0,0,.47-2.68,9.86,9.86,0,0,0-1.76-4.77,11.23,11.23,0,0,1-1.77-5.58,9.8,9.8,0,0,1,.78-4.12A2.41,2.41,0,0,1,117.46,0a2.06,2.06,0,0,1,.79.16,1.9,1.9,0,0,1,.47.25l.37.25a1.15,1.15,0,0,0,.25.12.47.47,0,0,0,.22,0A.44.44,0,0,0,120,.62,2.6,2.6,0,0,0,120.18.07Zm10,2a26.67,26.67,0,0,0-.66,3.7l-.9,6.85a32.12,32.12,0,0,1-1.16,5.7c-.68,1.83-1.67,2.74-3,2.74a2.7,2.7,0,0,1-2.28-1.36,6.67,6.67,0,0,1-.92-3.77,19.46,19.46,0,0,1,.11-2c0-.46.15-1.26.3-2.42l1-7.36c0-.33.08-.64.11-.93s0-.55,0-.77a1.38,1.38,0,0,0-.2-.91,1.74,1.74,0,0,0-.85-.3V.41h4.43v.78a1.39,1.39,0,0,0-.91.47,4.25,4.25,0,0,0-.44,1.68l-1.18,9c-.11.8-.19,1.46-.25,2q-.15,1.37-.15,2a4.41,4.41,0,0,0,.48,2.27,1.44,1.44,0,0,0,1.29.78c.91,0,1.62-.82,2.13-2.48a30.62,30.62,0,0,0,.91-4.85L129,5.76c.1-.91.14-1.3.13-1.19a14.64,14.64,0,0,0,.13-1.6,2.12,2.12,0,0,0-.38-1.46,1.35,1.35,0,0,0-.77-.32V.41H131v.78A1.18,1.18,0,0,0,130.23,2.06Zm8.41,12.59-.84,5.83h-8V19.7a1.24,1.24,0,0,0,.76-.52,4.73,4.73,0,0,0,.4-1.63L132.75,4.1q.08-.57.12-1c0-.26,0-.48,0-.68,0-.51-.06-.83-.2-1a1.67,1.67,0,0,0-.85-.31V.41h4.56v.78a1.67,1.67,0,0,0-1,.49A4.17,4.17,0,0,0,135,3.34l-1.87,14.31c0,.16,0,.31-.05.45s0,.3,0,.48a1,1,0,0,0,.21.72.8.8,0,0,0,.59.21,3.54,3.54,0,0,0,2.56-1.05,9.24,9.24,0,0,0,1.91-3.94Zm7.72-8.56a7.63,7.63,0,0,0-.79-4,1.53,1.53,0,0,0-1.21-.64l-2,15.35-.12,1a2.47,2.47,0,0,0,0,.34,2.35,2.35,0,0,0,0,.26c0,.52.08.84.23,1a2,2,0,0,0,1,.3v.78h-4.76V19.7a1.18,1.18,0,0,0,.9-.26,3.75,3.75,0,0,0,.6-1.88l2.11-16.11a2.17,2.17,0,0,0-1.83,1.08,9.57,9.57,0,0,0-1.27,3.21l-.37-.2.56-5.13h7.91l-.52,5.76Zm3.41-3.79a6.17,6.17,0,0,0-.25,1.8,5.63,5.63,0,0,0,.26,1.82,5.23,5.23,0,0,0,.44,1L151.46,9a13.19,13.19,0,0,1,1.13,2.57,11.08,11.08,0,0,1,.46,3.29,10,10,0,0,1-.9,4.29,2.76,2.76,0,0,1-2.46,1.91,2.21,2.21,0,0,1-.79-.15,3.28,3.28,0,0,1-.79-.44l-.36-.28-.26-.18a.38.38,0,0,0-.16,0,.34.34,0,0,0-.34.23,5.5,5.5,0,0,0-.23.84h-.43l.52-6.73.41.06c0,1,.07,1.66.12,2.09a7.13,7.13,0,0,0,.49,1.95,3.52,3.52,0,0,0,.73,1.18,1.25,1.25,0,0,0,.9.41c.57,0,1-.39,1.34-1.15a7.13,7.13,0,0,0,.47-2.68,9.86,9.86,0,0,0-1.76-4.77,11.23,11.23,0,0,1-1.77-5.58,9.8,9.8,0,0,1,.78-4.12A2.41,2.41,0,0,1,150.73,0a2.06,2.06,0,0,1,.79.16,1.9,1.9,0,0,1,.47.25l.37.25a1.34,1.34,0,0,0,.24.12.56.56,0,0,0,.23,0,.44.44,0,0,0,.39-.21,2.6,2.6,0,0,0,.23-.55h.43l-.59,6-.37-.1,0-1a10.11,10.11,0,0,0-.41-2.39c-.34-1-.83-1.57-1.48-1.57S150,1.46,149.77,2.3Z",opacity:1,strokeColor:"",fillColor:"#192760",width:153.879,height:21.051,stampFillColor:"#dce3ef",stampStrokeColor:""};break;case"InformationOnly":case"Information Only":t={iconName:"Information Only",pathdata:"M4,19.14a2,2,0,0,0,1,.32v.76H0v-.76a1.42,1.42,0,0,0,.87-.52,4,4,0,0,0,.47-1.59l2-13.24c.06-.38.1-.69.13-1a5.73,5.73,0,0,0,0-.67c0-.5-.08-.81-.24-.94a2.2,2.2,0,0,0-1-.31V.48H7.26v.76a1.48,1.48,0,0,0-.88.52,4.14,4.14,0,0,0-.45,1.6l-2,13.24-.13,1c0,.1,0,.19,0,.3a2.72,2.72,0,0,0,0,.28A1.32,1.32,0,0,0,4,19.14ZM18.17,1.3l.24-.06V.48H15v.76a1.66,1.66,0,0,1,.9.33,2.08,2.08,0,0,1,.4,1.48,12.85,12.85,0,0,1-.1,1.34c-.05.41-.11.87-.18,1.39l-1.29,8.34L11.15.48H7.83v.76a1.69,1.69,0,0,1,.77.24,1.9,1.9,0,0,1,.51,1.06l.07.3L7.33,15a24.86,24.86,0,0,1-.76,3.61,1.32,1.32,0,0,1-.92.9v.76H9.09v-.76a1.67,1.67,0,0,1-.88-.32,1.92,1.92,0,0,1-.44-1.44,7.09,7.09,0,0,1,0-.79c0-.43.13-1.09.27-2L9.72,4.38,14,20.71h.41l2.3-15a28.78,28.78,0,0,1,.67-3.42C17.57,1.72,17.83,1.38,18.17,1.3ZM19.33.48v.76a2.32,2.32,0,0,1,1,.3c.15.13.23.42.23.9,0,.23,0,.55-.07,1,0,.2-.06.44-.1.71l-2,13.23a4,4,0,0,1-.46,1.58,1.39,1.39,0,0,1-.88.54v.76h4.89v-.76a1.36,1.36,0,0,1-.78-.19,1.39,1.39,0,0,1-.41-1.17c0-.1,0-.21,0-.31s0-.22,0-.35l1.09-7.21a2.09,2.09,0,0,1,1.83.64A3.81,3.81,0,0,1,24.1,13c0,.11,0,.28,0,.49s0,.46,0,.75l.45.14,1.22-8.07-.46-.1a6.19,6.19,0,0,1-1.11,2.59A3.89,3.89,0,0,1,22,9.28l1-6.54a2.43,2.43,0,0,1,.33-1.08.93.93,0,0,1,.76-.26,2.45,2.45,0,0,1,2.52,1.54A9,9,0,0,1,27,6l.44.13.7-5.6ZM39.06,7.11a21,21,0,0,1-2,9.07q-2.16,4.61-5,4.6a3.28,3.28,0,0,1-2.88-1.92,10.29,10.29,0,0,1-1.11-5.14,21.08,21.08,0,0,1,2.07-9.19Q32.31,0,35,0a3.37,3.37,0,0,1,2.93,1.92A10.14,10.14,0,0,1,39.06,7.11ZM36.68,4.6a7,7,0,0,0-.42-2.55A1.37,1.37,0,0,0,35,1c-1.37,0-2.52,2.17-3.46,6.53a40.81,40.81,0,0,0-1.07,8.26,10,10,0,0,0,.21,2.2c.26,1.18.74,1.77,1.43,1.77s1.24-.43,1.78-1.29a18.75,18.75,0,0,0,1.65-4.93,43.28,43.28,0,0,0,.85-4.83A36.93,36.93,0,0,0,36.68,4.6ZM61,19.15a2.25,2.25,0,0,0,1,.31v.76H56.84v-.76A2,2,0,0,0,58,19a3.6,3.6,0,0,0,.5-1.63L60.56,3.76l-6.2,16.85H53.9L52.78,4.24,51.12,15c-.09.55-.15,1-.2,1.37a13,13,0,0,0-.11,1.42,1.8,1.8,0,0,0,.46,1.43,1.54,1.54,0,0,0,.86.29v.76H45.49l-1.78-9.76h-.47l-1,6.14-.13,1,0,.25c0,.09,0,.19,0,.28a1.47,1.47,0,0,0,.22,1,2,2,0,0,0,1,.32v.76H38.37v-.76a1.42,1.42,0,0,0,.88-.52,4.21,4.21,0,0,0,.46-1.59l2-13.24c0-.27.08-.51.11-.71a8.23,8.23,0,0,0,.07-1,1.23,1.23,0,0,0-.23-.9,2.32,2.32,0,0,0-1-.3V.48h4.54A4.34,4.34,0,0,1,47.62,1c1,.65,1.54,1.9,1.54,3.75a7.78,7.78,0,0,1-.26,2A5.56,5.56,0,0,1,48,8.62a3.87,3.87,0,0,1-1,1,8.06,8.06,0,0,1-1.06.52c.05.3.09.49.11.57l1.27,6.66a4.58,4.58,0,0,0,.55,1.7,1.23,1.23,0,0,0,.83.39,1.31,1.31,0,0,0,.86-.84A23,23,0,0,0,50.36,15L52.05,4c.06-.37.11-.7.15-1a7.42,7.42,0,0,0,0-.75c0-.41-.08-.67-.25-.78a2.09,2.09,0,0,0-.94-.21V.48h3.77l1,13.91,5-13.91h3.51v.76a1.46,1.46,0,0,0-.79.4A3.71,3.71,0,0,0,63,3.31L61,16.59c0,.29-.09.58-.13.88s-.05.55-.05.75Q60.79,19,61,19.15Zm-15.14-11a7.46,7.46,0,0,0,.53-1.62,9.54,9.54,0,0,0,.25-2.26,5.31,5.31,0,0,0-.35-2,1.18,1.18,0,0,0-1.16-.81.54.54,0,0,0-.5.26,3.37,3.37,0,0,0-.26,1.05l-1,6.76a4.28,4.28,0,0,0,1.31-.2A2.17,2.17,0,0,0,45.89,8.17ZM73.21,19.51v.71h-5v-.71a1.61,1.61,0,0,0,1-.41,1.92,1.92,0,0,0,.3-1.29c0-.22,0-.75-.09-1.58,0-.17-.06-.89-.16-2.15H65.68l-1,3c-.06.2-.12.42-.17.66a3.4,3.4,0,0,0-.08.69q0,.62.21.78a1.9,1.9,0,0,0,.86.3v.71H62.29v-.71A2,2,0,0,0,63,19a6.47,6.47,0,0,0,.72-1.56L69.82.07h.43L71.83,17A6.77,6.77,0,0,0,72.22,19,1.23,1.23,0,0,0,73.21,19.51Zm-4.08-6.6-.61-7.18-2.44,7.18ZM82.52,6.14l.6-5.66H74l-.63,5,.42.2a8.71,8.71,0,0,1,1.46-3.16,2.57,2.57,0,0,1,2.1-1.06L75,17.35a3.36,3.36,0,0,1-.68,1.85,1.57,1.57,0,0,1-1,.26v.76H78.7v-.76a2.69,2.69,0,0,1-1.11-.3c-.18-.13-.27-.45-.27-.95a2.26,2.26,0,0,1,0-.26c0-.09,0-.2,0-.33l.14-1L79.8,1.5a1.87,1.87,0,0,1,1.39.63c.58.7.88,2,.91,3.94ZM88.84.48H83.92v.76a2.31,2.31,0,0,1,1,.31c.15.13.23.44.23.94a5.56,5.56,0,0,1,0,.67c0,.26-.08.57-.14,1l-2,13.24a4,4,0,0,1-.47,1.59,1.36,1.36,0,0,1-.87.52v.76H86.5v-.76a2,2,0,0,1-1-.32,1.32,1.32,0,0,1-.23-.94c0-.09,0-.18,0-.28s0-.2,0-.3l.13-1,2-13.24A4.09,4.09,0,0,1,88,1.76a1.45,1.45,0,0,1,.87-.52ZM99.11,7.11a21,21,0,0,1-2,9.07q-2.16,4.61-5,4.6a3.28,3.28,0,0,1-2.88-1.92,10.29,10.29,0,0,1-1.11-5.14,21.08,21.08,0,0,1,2.07-9.19C91.63,1.51,93.25,0,95,0A3.36,3.36,0,0,1,98,1.92,10,10,0,0,1,99.11,7.11ZM96.72,4.6a7.18,7.18,0,0,0-.41-2.55c-.28-.7-.7-1-1.29-1-1.37,0-2.52,2.17-3.46,6.53a40.7,40.7,0,0,0-1.06,8.26,10,10,0,0,0,.2,2.2c.26,1.18.74,1.77,1.43,1.77a2.2,2.2,0,0,0,1.78-1.29,18.75,18.75,0,0,0,1.65-4.93,41.1,41.1,0,0,0,.85-4.83A34.65,34.65,0,0,0,96.72,4.6Zm11.1-3.36a1.66,1.66,0,0,1,.9.33,2.08,2.08,0,0,1,.4,1.48,12.85,12.85,0,0,1-.1,1.34c0,.41-.11.87-.18,1.39l-1.29,8.34L104,.48h-3.33v.76a1.7,1.7,0,0,1,.78.24,2,2,0,0,1,.51,1.06l.07.3L100.13,15a24,24,0,0,1-.75,3.61,1.35,1.35,0,0,1-.93.9v.76h3.45v-.76a1.67,1.67,0,0,1-.88-.32,1.88,1.88,0,0,1-.44-1.44,7.09,7.09,0,0,1,0-.79c0-.43.13-1.09.27-2l1.64-10.57,4.29,16.33h.41l2.3-15a28.78,28.78,0,0,1,.67-3.42c.18-.59.44-.93.78-1l.23-.06V.48h-3.39ZM125,7.11a21,21,0,0,1-2,9.07c-1.45,3.07-3.1,4.6-5,4.6a3.28,3.28,0,0,1-2.87-1.92A10.29,10.29,0,0,1,114,13.72a21.22,21.22,0,0,1,2.06-9.19Q118.22,0,120.91,0a3.36,3.36,0,0,1,2.92,1.92A10,10,0,0,1,125,7.11ZM122.59,4.6a7,7,0,0,0-.41-2.55,1.37,1.37,0,0,0-1.28-1c-1.37,0-2.53,2.17-3.46,6.53a40.11,40.11,0,0,0-1.07,8.26,10.65,10.65,0,0,0,.2,2.2q.39,1.77,1.44,1.77a2.2,2.2,0,0,0,1.77-1.29,18.29,18.29,0,0,0,1.66-4.93,45.71,45.71,0,0,0,.85-4.83A36.53,36.53,0,0,0,122.59,4.6Zm14.26-3.3.24-.06V.48h-3.4v.76a1.74,1.74,0,0,1,.91.33,2.13,2.13,0,0,1,.4,1.48c0,.28,0,.73-.11,1.34,0,.41-.11.87-.18,1.39l-1.29,8.34L129.83.48h-3.32v.76a1.69,1.69,0,0,1,.77.24,1.9,1.9,0,0,1,.51,1.06l.07.3L126,15a27,27,0,0,1-.75,3.61,1.35,1.35,0,0,1-.93.9v.76h3.44v-.76a1.67,1.67,0,0,1-.88-.32,1.92,1.92,0,0,1-.44-1.44c0-.26,0-.52,0-.79.05-.43.13-1.09.27-2l1.65-10.57,4.29,16.33h.41l2.29-15a31.07,31.07,0,0,1,.67-3.42C136.25,1.72,136.52,1.38,136.85,1.3Zm8.52,13.06a8.55,8.55,0,0,1-2.19,3.87,4.44,4.44,0,0,1-2.94,1,1,1,0,0,1-.68-.21.9.9,0,0,1-.24-.7,3.4,3.4,0,0,1,0-.48c0-.14,0-.28,0-.44l2.15-14.08a3.69,3.69,0,0,1,.5-1.64,2.22,2.22,0,0,1,1.16-.48V.48H138v.76a2.2,2.2,0,0,1,1,.31c.16.13.24.44.24.94a5.73,5.73,0,0,1-.05.67c0,.26-.07.57-.13,1l-2,13.23a4,4,0,0,1-.47,1.6,1.36,1.36,0,0,1-.87.52v.76h9.16l1-5.74ZM151.79.48v.76a1.52,1.52,0,0,1,.76.2,1.21,1.21,0,0,1,.37,1,4.09,4.09,0,0,1-.17,1.09c-.07.24-.16.5-.27.79L150.32,9.8l-1.18-6.44a4.51,4.51,0,0,1-.08-.6,4.37,4.37,0,0,1,0-.46c0-.43.09-.71.27-.83a1.75,1.75,0,0,1,.87-.23V.48h-4.63v.76a.94.94,0,0,1,.8.4,5.08,5.08,0,0,1,.42,1.44L148.2,11l-1,6.35a3.35,3.35,0,0,1-.61,1.73,1.91,1.91,0,0,1-1.06.39v.76h5.32v-.76a2,2,0,0,1-.95-.25,1.29,1.29,0,0,1-.33-1.05,7.29,7.29,0,0,1,.06-.73q.06-.51.12-.84l.82-5.46,3.12-7.89a5.54,5.54,0,0,1,.89-1.59,1.28,1.28,0,0,1,.63-.41V.48Z",opacity:1,strokeColor:"",fillColor:"#192760",width:155.237,height:20.783,stampFillColor:"#dce3ef",stampStrokeColor:""}}if(t)return t.modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),this.currentStampAnnotation=t}},fAt.prototype.saveStampAnnotations=function(){for(var e=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_stamp"),t=(this.pdfViewerBase.isStorageExceed&&(e=this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_stamp"]),[]),i=0;i<this.pdfViewerBase.pageCount;i++)t[parseInt(i.toString(),10)]=[];if(e&&!this.pdfViewer.annotationSettings.skipDownload)for(var n=JSON.parse(e),o=0;o<n.length;o++){var r=[],s=n[parseInt(o.toString(),10)];if(s){for(var a,l,h,d=0;s.annotations.length>d;d++)this.pdfViewer.annotationModule.updateModifiedDate(s.annotations[parseInt(d.toString(),10)]),this.pdfViewer.nameTable[s.annotations[parseInt(d.toString(),10)].randomId]&&(s.annotations[parseInt(d.toString(),10)].wrapperBounds=this.pdfViewer.nameTable[s.annotations[parseInt(d.toString(),10)].randomId].wrapper.bounds),!this.pdfViewerBase.clientSideRendering&&s.annotations[parseInt(d.toString(),10)].icon&&(a=s.annotations[parseInt(d.toString(),10)].bounds,l=this.pdfViewer.annotationModule.calculateFontSize(s.annotations[parseInt(d.toString(),10)].icon.toUpperCase(),a),s.annotations[parseInt(d.toString(),10)].iconFontSize=l,l=10,0!==(h=s.annotations[parseInt(d.toString(),10)].dynamicText).trim().length&&(l=this.pdfViewer.annotationModule.calculateFontSize(h,a)),s.annotations[parseInt(d.toString(),10)].textFontSize=l),s.annotations[parseInt(d.toString(),10)].bounds=JSON.stringify(this.pdfViewer.annotation.getBounds(s.annotations[parseInt(d.toString(),10)].bounds,s.pageIndex));r=s.annotations}t[s.pageIndex]=r}return JSON.stringify(t)},fAt.prototype.storeStampInSession=function(e,t,i,n){var o,r=ARt.sessionStorageManager.getWindowSessionStorageSize(),s=Math.round(JSON.stringify(t).length/1024),r=(this.pdfViewer.annotationModule.isFormFieldShape=!1,4500<r+s&&(this.pdfViewerBase.isStorageExceed=!0,this.pdfViewer.annotationModule.clearAnnotationStorage(),this.pdfViewerBase.isFormStorageExceed||je(this.pdfViewer.formFieldsModule)||this.pdfViewer.formFieldsModule.clearFormFieldStorage()),ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_stamp")),s=0;return i=(r=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_stamp"]:r)?(this.pdfViewer.annotationModule.storeAnnotationCollections(t,e,i,n),r=JSON.parse(r),this.pdfViewerBase.isStorageExceed||ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_stamp"),null!=(o=this.pdfViewer.annotationModule.getPageCollection(r,e))&&r[parseInt(o.toString(),10)]?(r[parseInt(o.toString(),10)].annotations.push(t),s=r[parseInt(o.toString(),10)].annotations.indexOf(t)):((o={pageIndex:e,annotations:[]}).annotations.push(t),s=o.annotations.indexOf(t),r.push(o)),JSON.stringify(r)):(this.pdfViewer.annotationModule.storeAnnotationCollections(t,e,i,n),(o={pageIndex:e,annotations:[]}).annotations.push(t),s=o.annotations.indexOf(t),(r=[]).push(o),JSON.stringify(r)),this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_stamp"]=i:ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_stamp",i),s},fAt.prototype.updateSessionStorage=function(e,t,i){if(null!=t&&e.annotations)for(var n=0;n<e.annotations.length;n++)if(e.annotations[parseInt(n.toString(),10)].id===t){e=e.annotations[parseInt(n.toString(),10)];break}"Rotate"===i&&(e=e.annotations[0]);var o=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_stamp");if(o=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_stamp"]:o)for(var r=e.bounds,s=JSON.parse(o),a=0;a<s.length;a++)for(var l=s[parseInt(a.toString(),10)],h=0;h<l.annotations.length;h++)if(null!=s[parseInt(a.toString(),10)].annotations[parseInt(h.toString(),10)]&&s[parseInt(a.toString(),10)].annotations[parseInt(h.toString(),10)].randomId===e.id){this.pdfViewerBase.isStorageExceed||ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_stamp");var d=this.pdfViewer.annotationModule.getPageCollection(s,s[parseInt(a.toString(),10)].annotations[parseInt(h.toString(),10)].pageNumber),d=("delete"!==i?null!=d&&s[parseInt(d.toString(),10)]&&(e.wrapper.children[1]?s[parseInt(a.toString(),10)].annotations[parseInt(h.toString(),10)].opacity=e.wrapper.children[1].style.opacity:s[parseInt(a.toString(),10)].annotations[parseInt(h.toString(),10)].opacity=e.wrapper.children[0].style.opacity,s[parseInt(a.toString(),10)].annotations[parseInt(h.toString(),10)].rotateAngle=e.rotateAngle,s[parseInt(a.toString(),10)].annotations[parseInt(h.toString(),10)].bounds={left:r.x,top:r.y,width:e.wrapper.actualSize.width,height:e.wrapper.actualSize.height,right:r.right,bottom:r.bottom}):s[parseInt(a.toString(),10)].annotations.splice(h,1),JSON.stringify(s));this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_stamp"]=d:ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_stamp",d);break}},fAt.prototype.saveImportedStampAnnotations=function(e,t){var i,n=null,o=!1,r=e.IsDynamic;e.AnnotationSettings=e.AnnotationSettings||this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.stampSettings),e.allowedInteractions=this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e),e.IconName&&r?(i=this.retrieveDynamicStampAnnotation(e.IconName),o=!0):e.IconName&&(i=this.retrievestampAnnotation(e.IconName),"Accepted"!==e.IconName&&"Rejected"!==e.IconName||(r=rbt(i.pathdata),i.pathdata=cbt(r),o=!0)),i?(n={stampAnnotationType:"path",author:e.Author,modifiedDate:e.ModifiedDate,subject:e.Subject,note:e.Note,strokeColor:i.strokeColor,fillColor:i.fillColor,opacity:e.Opacity,stampFillcolor:i.stampFillColor,rotateAngle:e.RotateAngle,creationDate:e.ModifiedDate,pageNumber:t,icon:i.iconName,stampAnnotationPath:i.pathdata,randomId:"stamp",isDynamicStamp:!1,dynamicText:this.dynamicText,bounds:this.calculateImagePosition(e.Rect,!0),annotName:e.AnnotName,comments:this.pdfViewer.annotationModule.getAnnotationComments(e.Comments,e,e.Author),review:{state:e.State,stateModel:e.StateModel,author:e.Author,modifiedDate:e.ModifiedDate},shapeAnnotationType:"stamp",annotationSelectorSettings:this.getSettings(e),annotationSettings:e.AnnotationSettings,customData:this.pdfViewer.annotation.getCustomData(e),isPrint:e.isPrint,isCommentLock:e.IsCommentLock,isMaskedImage:e.IsMaskedImage,customStampName:"",template:e?e.template:null,templateSize:e?e.templateSize:0},o&&(n.dynamicText=this.findDynamicText(e.Apperarance,e.IconName),""===n.dynamicText&&(n.dynamicText="By "+n.author+" at "+n.creationDate),n.isDynamicStamp=!0)):(e.AnnotationSettings=e.AnnotationSettings||this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.customStampSettings),n={stampAnnotationType:"image",author:e.Author,modifiedDate:e.ModifiedDate,subject:e.Subject,allowedInteractions:e.allowedInteractions,note:e.Note,strokeColor:e.StrokeColor,fillColor:e.FillColor,opacity:e.Opacity,stampFillcolor:e.FillColor,rotateAngle:e.RotateAngle,creationDate:e.ModifiedDate,pageNumber:t,icon:"",stampAnnotationPath:this.findImageData(e.Apperarance),randomId:"image",isDynamicStamp:this.pdfViewerBase.isDynamicStamp,dynamicText:" ",bounds:this.calculateImagePosition(e.Rect,!0),annotName:e.AnnotName,comments:this.pdfViewer.annotationModule.getAnnotationComments(e.Comments,e,e.Author),review:{state:e.State,stateModel:e.StateModel,author:e.Author,modifiedDate:e.ModifiedDate},shapeAnnotationType:"stamp",annotationSelectorSettings:this.getSettings(e),annotationSettings:e.annotationSettings,customData:this.pdfViewer.annotation.getCustomData(e),isPrint:e.isPrint,isCommentLock:e.IsCommentLock,isMaskedImage:e.IsMaskedImage,customStampName:e.CustomStampName,template:e?e.template:null,templateSize:e?e.templateSize:0}),this.pdfViewer.annotationModule.storeAnnotations(t,n,"_annotations_stamp")},fAt.prototype.updateStampAnnotationCollections=function(e,t){var i,n=e.IsDynamic,o=(e.allowedInteractions=e.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e),this.stampImageData(e));if(e.IconName&&n&&"Draft"!==e.IconName&&!o)i=this.retrieveDynamicStampAnnotation(e.IconName);else{if(!e.IconName||o)return e.AnnotationSettings=e.AnnotationSettings||this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.customStampSettings),e.IsLocked&&(e.AnnotationSettings.isLock=e.IsLocked),{stampAnnotationType:"image",author:e.Author,bounds:{left:e.Rect.X,top:e.Rect.Y,width:e.Rect.Width,height:e.Rect.Height},modifiedDate:e.ModifiedDate,allowedInteractions:e.allowedInteractions,note:e.Note,strokeColor:e.StrokeColor,fillColor:e.FillColor,opacity:e.Opacity,stampFillcolor:e.StampFillColor,rotateAngle:e.RotateAngle,pageNumber:t,randomId:"stamp",isDynamicStamp:this.pdfViewerBase.isDynamicStamp,dynamicText:this.dynamicText,annotationId:e.AnnotName,comments:this.pdfViewer.annotationModule.getAnnotationComments(e.Comments,e,e.Author),review:{state:e.State,stateModel:e.StateModel,author:e.Author,modifiedDate:e.ModifiedDate},shapeAnnotationType:"stamp",annotationSettings:e.AnnotationSettings,customData:this.pdfViewer.annotation.getCustomData(e),isPrint:e.isPrint,isMaskedImage:e.IsMaskedImage,customStampName:e.CustomStampName,subject:e.Subject,template:e?e.template:null,templateSize:e?e.templateSize:0};i=this.retrievestampAnnotation(e.IconName)}if(i)return e.AnnotationSettings=e.AnnotationSettings||this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.stampSettings),e.IsLocked&&(e.AnnotationSettings.isLock=e.IsLocked),e.allowedInteractions=e.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e),{stampAnnotationType:"path",author:e.Author,allowedInteractions:e.allowedInteractions,modifiedDate:e.ModifiedDate,subject:e.Subject,note:e.Note,strokeColor:e.StrokeColor,fillColor:e.FillColor,opacity:e.Opacity,stampFillcolor:e.StampFillColor,rotateAngle:e.RotateAngle,creationDate:i.creationDate,pageNumber:t,icon:i.iconName,stampAnnotationPath:i.pathdata,randomId:"stamp",isDynamicStamp:this.pdfViewerBase.isDynamicStamp,dynamicText:this.dynamicText,bounds:{left:e.Rect.X,top:e.Rect.Y,width:e.Rect.Width,height:e.Rect.Height},annotationId:e.AnnotName,comments:this.pdfViewer.annotationModule.getAnnotationComments(e.Comments,e,e.Author),review:{state:e.State,stateModel:e.StateModel,author:e.Author,modifiedDate:e.ModifiedDate},shapeAnnotationType:"stamp",customData:this.pdfViewer.annotation.getCustomData(e),isPrint:e.isPrint,isMaskedImage:e.IsMaskedImage,customStampName:"",template:e?e.template:null,templateSize:e?e.templateSize:0}},fAt.prototype.stampImageData=function(e){var t=!1;if(e&&e.Apperarance)for(var i=0;i<e.Apperarance.length;i++)if(e.Apperarance[parseInt(i.toString(),10)].imagedata){t=!0;break}return t},fAt.prototype.findImageData=function(e){if(e)for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)].imagedata;if(i)return i}return""},fAt.prototype.findDynamicText=function(e,t){var i="";if(e)for(var n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)],r=o.type,s=o.isImport;"string"===r&&void 0!==o.text&&(r=void 0,(r=!s&&(s=o.text.split("("))[1]?s[1].split(")")[0]:o.text).toLowerCase()!==t.toLowerCase())&&(i+=r)}return i},fAt.prototype.getAnnotations=function(e,t){var i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_stamp");return(i=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_stamp"]:i)&&(i=JSON.parse(i),null!=(e=this.pdfViewer.annotationModule.getPageCollection(i,e)))&&i[parseInt(e.toString(),10)]?i[parseInt(e.toString(),10)].annotations:t},fAt.prototype.modifyInCollection=function(e,t,i,n){je(i.formFieldAnnotationType)||""===i.formFieldAnnotationType?this.pdfViewer.annotationModule.isFormFieldShape=!1:this.pdfViewer.annotationModule.isFormFieldShape=!0,n&&this.pdfViewerBase.updateDocumentEditedProperty(!0);var o=null,r=this.getAnnotations(t,null);if(null!=r&&i){for(var s=0;s<r.length;s++)if(i.annotName===r[parseInt(s.toString(),10)].annotName){if("bounds"===e)this.pdfViewerBase.isBounds=this.pdfViewerBase.boundsCalculation(r[parseInt(s.toString(),10)].bounds,i.wrapper.bounds),this.pdfViewerBase.isBounds&&(r[parseInt(s.toString(),10)].bounds={left:i.wrapper.bounds.x,top:i.wrapper.bounds.y,width:i.wrapper.actualSize.width,height:i.wrapper.actualSize.height}),r[parseInt(s.toString(),10)].modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime();else if("delete"===e){o=r.splice(s,1)[0];break}this.pdfViewer.annotationModule.storeAnnotationCollections(r[parseInt(s.toString(),10)],t)}this.manageAnnotations(r,t)}return o},fAt.prototype.manageAnnotations=function(e,t){var i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_stamp");(i=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_stamp"]:i)&&(i=JSON.parse(i),this.pdfViewerBase.isStorageExceed||ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_stamp"),null!=(t=this.pdfViewer.annotationModule.getPageCollection(i,t))&&i[parseInt(t.toString(),10)]&&(i[parseInt(t.toString(),10)].annotations=e),t=JSON.stringify(i),this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_stamp"]=t:ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_stamp",t))},fAt.prototype.updateAddAnnotationDetails=function(e,t,i,n,o,r){t=e?e.offset||{x:10,y:10}:(e={offset:{x:10,y:10},pageNumber:0,width:void 0,height:void 0}).offset,n||o||r||(n=kCt.Approved);var s,a=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),l=this.pdfViewer.annotation.createGUID(),h=[],d="",p="Stamp",c=[],u=!1,g=e.author||"Guest",m=this.pdfViewer.stampSettings.annotationSelectorSettings,f=(this.pdfViewerBase.updateSelectorSettings(m),this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.stampSettings)),g=g||this.pdfViewer.annotationModule.updateAnnotationAuthor("stamp",f.annotationSubType),y=this.pdfViewer.stampSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,n=(f.isLock=e.isLock||f.isLock,f.minHeight=e.minHeight||f.minHeight,f.minWidth=e.minWidth||f.minWidth,f.maxWidth=e.maxWidth||f.maxWidth,f.maxHeight=e.maxHeight||f.maxHeight,e.customStamps&&e.customStamps[0].customStampName?(c[0]={imagedata:e.customStamps[0].customStampImageSource,isImport:!0},this.customStampName=e.customStamps[0].customStampName,this.pdfViewerBase.customStampCollection.push(e.customStamps[0]),p="Image",e.width=e.width||100,e.height=e.height||100):n?(s=[],s=a.split(" "),d=n.toString(),c[0]={baseFontName:"Helvetica-BoldOblique",currentFontname:"95b303ab-d397-438a-83af-e2ff8a9900f1",fontSize:10,isImport:!0,text:"By "+g+" at "+s[1]+s[2]+" , "+s[0],type:"string"},u=!0,e.width=e.width||170.33,e.height=e.height||56.88):o?(d=o.toString(),o===PCt.Accepted||o===PCt.Rejected?(e.width=e.width||35,e.height=e.height||35):o===PCt.SignHere?(e.width=e.width||110,e.height=e.height||30):o===PCt.Witness?(e.width=e.width||130,e.height=e.height||30):o===PCt.InitialHere&&(e.width=e.width||90,e.height=e.height||30)):r&&(d=r.toString(),r===BCt.Final||r===BCt.Draft?e.width=e.width||110:r===BCt.Void?e.width=e.width||100:e.width=e.width||130,e.height=e.height||30),{AllowedInteractions:e.allowedInteractions||y,AnnotName:l,AnnotType:"stamp",AnnotationSelectorSettings:e.annotationSelectorSettings||m,AnnotationSettings:f,Apperarance:c||null,Author:g,Comments:null,CreatedDate:a,CustomData:e.customData||null,ExistingCustomData:null,FillColor:"#192760",Icon:0,IsCommentLock:!1,IsDynamic:u,IsLocked:e.isLock||!1,IsPrint:!!je(e.isPrint)||e.isPrint,ModifiedDate:"",Name:null,Note:"",Opacity:e.opacity||1,Rect:{X:t.x,Y:t.y,Width:e.width,Height:e.height,Left:t.x,Top:t.y,Location:{X:t.x,Y:t.y},Size:{Height:e.height,IsEmpty:!1,Width:e.width}},RotateAngle:0,StampAnnotationtype:p,State:"",StateModel:"",StrokeColor:"#dce3ef",IconName:d,Subject:e.subject||d,matrix:null,CustomStampName:this.customStampName||"",pageNumber:i});return h[0]=n,{stampAnnotations:h}},fAt.prototype.triggerAnnotationAdd=function(e,t){t={opacity:e.opacity,borderColor:e.strokeColor,borderWidth:e.thickness,author:t.author,subject:t.subject,modifiedDate:t.modifiedDate,fillColor:e.fillColor,fontSize:e.fontSize,width:e.bounds.width,height:e.bounds.height,fontColor:e.fontColor,fontFamily:e.fontFamily,defaultText:e.dynamicText,fontStyle:e.font,textAlignment:e.textAlign};this.pdfViewer.fireAnnotationAdd(e.pageIndex,e.annotName,"Stamp",e.bounds,t)};var mAt=fAt;function fAt(e,t){this.isStampAddMode=!1,this.stampPageNumber=[],this.isAddAnnotationProgramatically=!1,this.customStampName=null,this.dynamicText="",this.pdfViewer=e,this.pdfViewerBase=t}vAt.prototype.renderStickyNotesAnnotations=function(e,t,i){if(e&&0<e.length)for(var n=0;n<e.length;n++){var o,r,s,a,l=e[parseInt(n.toString(),10)],h=!1,d=this.getAnnotations(t,null,"sticky");if(null!==d)for(var p=0;p<d.length;p++){var c=l.annotName||l.AnnotName,u=d[parseInt(p.toString(),10)].annotName?d[parseInt(p.toString(),10)].annotName:d[parseInt(p.toString(),10)].AnnotName;if(u&&c&&u===c){h=!0;break}}h||(l.annotationAddMode=this.pdfViewer.annotationModule.findAnnotationMode(l,t,l.AnnotType),o=null,r=l.Bounds,s=l.Author,l.AnnotationSettings=l.AnnotationSettings||this.pdfViewer.annotationModule.updateAnnotationSettings(l),l.allowedInteractions=l.AllowedInteraction||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(l),a=!0,a="Imported Annotation"===l.annotationAddMode?l.IsPrint:l.AnnotationSettings.isPrint,(l.IsLock||l.IsLocked)&&(l.AnnotationSettings.isLock=l.IsLock||l.IsLocked),o={shapeAnnotationType:"sticky",author:s,modifiedDate:l.ModifiedDate,subject:l.Subject,note:l.Note,opacity:l.Opacity,state:l.State,stateModel:l.StateModel,pathData:"",comments:this.pdfViewer.annotationModule.getAnnotationComments(l.Comments,l,s),review:{state:l.State,stateModel:l.StateModel,modifiedDate:l.ModifiedDate,author:s},pageNumber:t,bounds:{left:l.Bounds.X,top:l.Bounds.Y,width:l.Bounds.Width,height:l.Bounds.Height,right:l.Bounds.Right,bottom:l.Bounds.Bottom},annotName:l.AnnotName,color:l.color,annotationSelectorSettings:this.getSettings(l),customData:this.pdfViewer.annotation.getCustomData(l),annotationSettings:l.AnnotationSettings,allowedInteractions:l.allowedInteractions,isPrint:a,isCommentLock:l.IsCommentLock},l.AnnotationSelectorSettings=l.AnnotationSelectorSettings||this.pdfViewer.annotationSelectorSettings,s={author:s,modifiedDate:o.modifiedDate,annotName:o.annotName,pageIndex:t,bounds:{x:r.Left,y:r.Top,width:r.Width,height:r.Height},strokeColor:"transparent",stampStrokeColor:"",data:this.setImageSource(),shapeAnnotationType:"StickyNotes",subject:o.subject,notes:o.note,opacity:o.opacity,id:o.annotName,fillColor:o.color,annotationSelectorSettings:l.AnnotationSelectorSettings,annotationSettings:o.annotationSettings,annotationAddMode:l.annotationAddMode,isPrint:a,isCommentLock:o.isCommentLock},i?this.drawStickyNotes(r.Left,r.Top,r.Width,r.Height,t,s,i):(this.pdfViewer.add(s),this.drawStickyNotes(r.Left,r.Top,r.Width,r.Height,t,s),this.pdfViewer.annotationModule.storeAnnotations(t,o,"_annotations_sticky")),this.isAddAnnotationProgramatically&&(a={opacity:s.opacity,borderColor:s.strokeColor,borderWidth:s.thickness,author:l.author,subject:l.subject,modifiedDate:l.modifiedDate,fillColor:s.fillColor,fontSize:s.fontSize,width:s.bounds.width,height:s.bounds.height,fontColor:s.fontColor,fontFamily:s.fontFamily,defaultText:s.dynamicText,fontStyle:s.font,textAlignment:s.textAlign},this.pdfViewer.fireAnnotationAdd(s.pageIndex,s.annotName,"StickyNotes",s.bounds,a)))}},vAt.prototype.getSettings=function(e){var t=this.pdfViewer.annotationSelectorSettings;return e.AnnotationSelectorSettings?t="string"==typeof e.AnnotationSelectorSettings?JSON.parse(e.AnnotationSelectorSettings):e.AnnotationSelectorSettings:this.pdfViewer.stickyNotesSettings.annotationSelectorSettings&&(t=this.pdfViewer.stickyNotesSettings.annotationSelectorSettings),t},vAt.prototype.drawStickyNotes=function(a,l,h,d,p,c,u){var g,m=this,f=null,y=new Image,v=this;y.onload=function(){var e,t,i,n,o=("Guest"!==m.pdfViewer.annotationSettings.author?m.pdfViewer.annotationSettings:m.pdfViewer.stickyNotesSettings).author,r=""===m.pdfViewer.annotationSettings.subject||je(m.pdfViewer.annotationSettings.subject)?m.pdfViewer.stickyNotesSettings.subject||"Sticky Note":m.pdfViewer.annotationSettings.subject,s=m.pdfViewer.annotationModule.updateSettings(m.pdfViewer.stickyNotesSettings);c?g={author:c.author,modifiedDate:c.modifiedDate,annotName:c.annotName,annotationSettings:c.annotationSettings&&""!==c.annotationSettings?c.annotationSettings:s,data:y.src,bounds:{x:a,y:l,width:h,height:d},subject:c.subject,notes:c.notes,opacity:c.opacity,id:c.annotName,shapeAnnotationType:"StickyNotes",strokeColor:"transparent",stampStrokeColor:"",pageIndex:c.pageIndex,isPrint:c.isPrint}:(i=m.pdfViewer.annotation.createGUID(),(n=v.addComments("sticky",p+1))&&(document.getElementById(n).id=i),n=m.pdfViewer.stickyNotesSettings.annotationSelectorSettings||m.pdfViewer.annotationSelectorSettings,e=m.pdfViewer.stickyNotesSettings.isPrint,g={bounds:{x:a,y:l,width:h,height:d},pageIndex:p,data:y.src,modifiedDate:m.getDateAndTime(),annotationSettings:s,shapeAnnotationType:"StickyNotes",strokeColor:"transparent",stampStrokeColor:"",annotName:i,id:i,opacity:m.opacity,isPrint:e},s=m.pdfViewer.stickyNotesSettings.isLock||m.pdfViewer.annotationSettings.isLock,t=m.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(c),f={author:o,allowedInteractions:t,modifiedDate:m.getDateAndTime(),subject:r,shapeAnnotationType:"sticky",pageNumber:p,note:"",opacity:m.opacity,pathData:"",state:"",stateModel:"",color:"rgba(255,255,0)",comments:[],annotName:i,bounds:{left:a,top:l,width:h,height:d},review:{state:"",stateModel:"",modifiedDate:"",author:o},annotationSelectorSettings:n,customData:m.pdfViewer.annotationModule.getData("sticky"),annotationSettings:{isLock:s},isPrint:e,isCommentLock:!1}),c||(v.pdfViewer.annotation.addAction(p,null,g,"Addition","",g,g),v.pdfViewer.add(g),v.pdfViewer.annotationModule.storeAnnotations(p,f,"_annotations_sticky")),v.pdfViewerBase.isAddComment&&(t={left:g.bounds.x,top:g.bounds.y,width:g.bounds.width,height:g.bounds.height},m.pdfViewerBase.updateDocumentEditedProperty(!0),i={opacity:g.opacity,author:o,modifiedDate:g.modifiedDate,subject:r},m.pdfViewer.fireAnnotationAdd(g.pageIndex,g.annotName,"StickyNotes",t,i)),u?v.pdfViewer.renderDrawing(u,p):(n=m.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",p),v.pdfViewer.renderDrawing(n,p)),F.isDevice&&v.pdfViewer.select([g.id],g.annotationSelectorSettings),v.pdfViewerBase.isAddComment=!1},y.src=this.setImageSource()},vAt.prototype.setImageSource=function(){return"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgd2lkdGg9IjE2IgogICBoZWlnaHQ9IjE1IgogICB2aWV3Qm94PSIwIDAgNC4yMzMzMzMxIDMuOTY4NzQ5NyIKICAgdmVyc2lvbj0iMS4xIj4KICA8ZyBpZD0ibGF5ZXIxIj4KICAgIDxwYXRoCiAgICAgICBkPSJNIDMuODM4OSwwLjk0MTY3IEMgMy42NTM5LDAuNzAzNjcgMy40MTU5LDAuNTE3NjcgMy4xMjQ5LDAuMzg1NjcgMi44MDc5LDAuMjUzNjcgMi40ODk5LDAuMTczNjcgMi4xMTk5LDAuMTczNjcgMS43NDg5LDAuMTczNjcgMS40MzE5LDAuMjUzNjcgMS4xMTQyLDAuMzg1NjcgMC44MjMxNiwwLjUxNzY3IDAuNTg1MTYsMC43MDM2NyAwLjQwMDE2LDAuOTQxNjcgMC4yMTUxNiwxLjE3OTcgMC4xMzUxNiwxLjQxNzcgMC4xMzUxNiwxLjcwODcgMC4xMzUxNiwxLjk0NjcgMC4xODgxNiwyLjE1ODcgMC4zMjAxNiwyLjM0MzcgMC40NTMxNiwyLjU1NTcgMC42MTExNiwyLjcxMzcgMC44MjMxNiwyLjg0NjcgMC43OTIxNiwzLjE1NDcgMC42NTAxNiwzLjM4MjcgMC40NzkxNiwzLjU4NzcgMC40MjgxNiwzLjY2NzcgMC41MTcxNiwzLjc0MTcgMC42OTExNiwzLjcxOTcgMS4wODgyLDMuNjM5NyAxLjQwNDksMy40NTQ3IDEuNjQyOSwzLjE2MzcgMS44MDE5LDMuMTkwNyAxLjk2MDksMy4yMTY3IDIuMTE5OSwzLjIxNjcgMi40ODk5LDMuMjE2NyAyLjgwNzksMy4xMzc3IDMuMTI0OSwzLjAwNTcgMy40MTU5LDIuODcyNyAzLjY4MDksMi42ODc3IDMuODM4OSwyLjQ0OTcgNC4wMjQ5LDIuMjExNyA0LjEwMzksMS45NzM3IDQuMTAzOSwxLjY4MjcgNC4xMDM5LDEuNDE3NyA0LjAyNDksMS4xNTI3IDMuODM4OSwwLjk0MTY3IFoiCiAgICAgICBpZD0icGF0aDE1MjQiCiAgICAgICBzdHlsZT0iZmlsbDojZmZmNzAwO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDowLjI2NDU4MztzdHJva2Utb3BhY2l0eToxIiAvPgogICAgPHBhdGgKICAgICAgIGQ9Ik0gMy4wNDI5LDEuNDE2NyBIIDEuMTkxMiBDIDEuMTExMiwxLjQxNjcgMS4wNTkyLDEuMzYzNyAxLjA1OTIsMS4yODM3IDEuMDU5MiwxLjIwNDcgMS4xMTEyLDEuMTUxNyAxLjE5MTIsMS4xNTE3IEggMy4wNDI5IEMgMy4xMjE5LDEuMTUxNyAzLjE3NDksMS4yMDQ3IDMuMTc0OSwxLjI4MzcgMy4xNzQ5LDEuMzYzNyAzLjEyMTksMS40MTY3IDMuMDQyOSwxLjQxNjcgWiIKICAgICAgIGlkPSJwYXRoMTUzNiIKICAgICAgIHN0eWxlPSJzdHJva2Utd2lkdGg6MC4yNjQ1ODMiIC8+CiAgICA8cGF0aAogICAgICAgZD0iTSAzLjA0MjksMS45NDU3IEggMS4xOTEyIEMgMS4xMTEyLDEuOTQ1NyAxLjA1OTIsMS44OTI3IDEuMDU5MiwxLjgxMjcgMS4wNTkyLDEuNzMzNyAxLjExMTIsMS42ODA3IDEuMTkxMiwxLjY4MDcgSCAzLjA0MjkgQyAzLjEyMTksMS42ODA3IDMuMTc0OSwxLjczMzcgMy4xNzQ5LDEuODEyNyAzLjE3NDksMS44OTI3IDMuMTIxOSwxLjk0NTcgMy4wNDI5LDEuOTQ1NyBaIgogICAgICAgaWQ9InBhdGgxNTQwIgogICAgICAgc3R5bGU9InN0cm9rZS13aWR0aDowLjI2NDU4MyIgLz4KICA8L2c+Cjwvc3ZnPgo="},vAt.prototype.createRequestForComments=function(){var e,i=this,t=i.pdfViewerBase.pageCount,t=(i.isCommentsRendered||(20<t?t=20:i.isPageCommentsRendered=!0),this.isCommentsRendered?e={pageStartIndex:20..toString(),pageEndIndex:t.toString(),hashId:this.pdfViewerBase.hashId,action:"RenderAnnotationComments",elementId:this.pdfViewer.element.id,uniqueId:i.pdfViewerBase.documentId}:(e={pageStartIndex:0..toString(),pageEndIndex:t.toString(),hashId:this.pdfViewerBase.hashId,action:"RenderAnnotationComments",elementId:this.pdfViewer.element.id,uniqueId:i.pdfViewerBase.documentId},i.isCommentsRendered=!0),this.pdfViewerBase.jsonDocumentId&&(e.documentId=this.pdfViewerBase.jsonDocumentId),this.pdfViewer.serviceUrl+"/"+this.pdfViewer.serverActionSettings.renderComments);i.commentsRequestHandler=new DRt(i.pdfViewer),i.commentsRequestHandler.url=t,i.commentsRequestHandler.mode=!0,i.commentsRequestHandler.responseType="text",this.pdfViewerBase.clientSideRendering?(t=this.pdfViewer.pdfRendererModule.getAnnotationComments(e),this.renderCommentsOnSuccess(t,i)):(this.pdfViewerBase.requestCollection.push(this.commentsRequestHandler),i.commentsRequestHandler.send(e),i.commentsRequestHandler.onSuccess=function(t){var t=t.data,e=i.pdfViewerBase.checkRedirection(t);if(!e&&t){if("object"!=typeof t)try{"object"!=typeof(t="object"!=typeof(t=JSON.parse(t))?JSON.parse(t):t)&&(i.pdfViewerBase.onControlError(500,t,this.pdfViewer.serverActionSettings.renderComments),t=null)}catch(e){i.pdfViewerBase.onControlError(500,t,this.pdfViewer.serverActionSettings.renderComments),t=null}i.renderCommentsOnSuccess(t,i)}},i.commentsRequestHandler.onFailure=function(e){this.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText)},i.commentsRequestHandler.onError=function(e){i.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,i.pdfViewer.serverActionSettings.renderComments)})},vAt.prototype.renderCommentsOnSuccess=function(e,t){if(e){var i=!1;if(t.pdfViewerBase.annotationComments?t.pdfViewerBase.annotationComments=e.annotationDetails:(t.pdfViewerBase.annotationComments=e.annotationDetails,i=!0),e.annotationDetails&&e.uniqueId===t.pdfViewerBase.documentId){t.pdfViewer.fireAjaxRequestSuccess(this.pdfViewer.serverActionSettings.renderComments,e),t.isAnnotationRendered=!0;var n,o=void 0;o=t.pdfViewerBase.documentAnnotationCollections?t.updateAnnotationsInDocumentCollections(t.pdfViewerBase.annotationComments,t.pdfViewerBase.documentAnnotationCollections):(n=t.pdfViewerBase.createAnnotationsCollection(),t.updateAnnotationsInDocumentCollections(t.pdfViewerBase.annotationComments,n)),t.pdfViewerBase.annotationComments=o,t.pdfViewerBase.documentAnnotationCollections=o;for(var r=e.startPageIndex;r<e.endPageIndex;r++){var s=e.annotationDetails[parseInt(r.toString(),10)];t.pdfViewerBase.updateModifiedDateToLocalDate(s,"annotationOrder"),t.pdfViewerBase.updateModifiedDateToLocalDate(s,"freeTextAnnotation"),t.pdfViewerBase.updateModifiedDateToLocalDate(s,"measureShapeAnnotation"),t.pdfViewerBase.updateModifiedDateToLocalDate(s,"shapeAnnotation"),t.pdfViewerBase.updateModifiedDateToLocalDate(s,"signatureAnnotation"),t.pdfViewerBase.updateModifiedDateToLocalDate(s,"signatureInkAnnotation"),t.pdfViewerBase.updateModifiedDateToLocalDate(s,"stampAnnotations"),t.pdfViewerBase.updateModifiedDateToLocalDate(s,"stickyNotesAnnotation"),t.pdfViewerBase.updateModifiedDateToLocalDate(s,"textMarkupAnnotation")}for(var a=e.startPageIndex;a<e.endPageIndex;a++)e.annotationDetails[parseInt(a.toString(),10)]&&t.renderAnnotationCollections(e.annotationDetails[parseInt(a.toString(),10)],a,i);t.isPageCommentsRendered||(t.isPageCommentsRendered=!0,t.createRequestForComments())}}},vAt.prototype.updateAnnotationsInDocumentCollections=function(e,t){for(var i=0;i<this.pdfViewerBase.pageCount;i++)if(e[parseInt(i.toString(),10)]&&t[parseInt(i.toString(),10)]){if(e[parseInt(i.toString(),10)].textMarkupAnnotation&&0!==e[parseInt(i.toString(),10)].textMarkupAnnotation.length&&t[parseInt(i.toString(),10)].textMarkupAnnotation)for(var n=0;n<e[parseInt(i.toString(),10)].textMarkupAnnotation.length;n++)this.updateDocumentAnnotationCollections(e[parseInt(i.toString(),10)].textMarkupAnnotation[parseInt(n.toString(),10)],t[parseInt(i.toString(),10)].textMarkupAnnotation);if(e[parseInt(i.toString(),10)].shapeAnnotation&&0!==e[parseInt(i.toString(),10)].shapeAnnotation.length&&t[parseInt(i.toString(),10)].shapeAnnotation)for(n=0;n<e[parseInt(i.toString(),10)].shapeAnnotation.length;n++)this.updateDocumentAnnotationCollections(e[parseInt(i.toString(),10)].shapeAnnotation[parseInt(n.toString(),10)],t[parseInt(i.toString(),10)].shapeAnnotation);if(e[parseInt(i.toString(),10)].measureShapeAnnotation&&0!==e[parseInt(i.toString(),10)].measureShapeAnnotation.length&&t[parseInt(i.toString(),10)].measureShapeAnnotation)for(n=0;n<e[parseInt(i.toString(),10)].measureShapeAnnotation.length;n++)this.updateDocumentAnnotationCollections(e[parseInt(i.toString(),10)].measureShapeAnnotation[parseInt(n.toString(),10)],t[parseInt(i.toString(),10)].measureShapeAnnotation);if(e[parseInt(i.toString(),10)].stampAnnotations&&0!==e[parseInt(i.toString(),10)].stampAnnotations.length&&t[parseInt(i.toString(),10)].stampAnnotations)for(n=0;n<e[parseInt(i.toString(),10)].stampAnnotations.length;n++)this.updateDocumentAnnotationCollections(e[parseInt(i.toString(),10)].stampAnnotations[parseInt(n.toString(),10)],t[parseInt(i.toString(),10)].stampAnnotations);if(e[parseInt(i.toString(),10)].stickyNotesAnnotation&&0!==e[parseInt(i.toString(),10)].stickyNotesAnnotation.length&&t[parseInt(i.toString(),10)].stickyNotesAnnotation)for(n=0;n<e[parseInt(i.toString(),10)].stickyNotesAnnotation.length;n++)this.updateDocumentAnnotationCollections(e[parseInt(i.toString(),10)].stickyNotesAnnotation[parseInt(n.toString(),10)],t[parseInt(i.toString(),10)].stickyNotesAnnotation);if(e[parseInt(i.toString(),10)].freeTextAnnotation&&0!==e[parseInt(i.toString(),10)].freeTextAnnotation.length&&t[parseInt(i.toString(),10)].freeTextAnnotation)for(n=0;n<e[parseInt(i.toString(),10)].freeTextAnnotation.length;n++)this.updateDocumentAnnotationCollections(e[parseInt(i.toString(),10)].freeTextAnnotation[parseInt(n.toString(),10)],t[parseInt(i.toString(),10)].freeTextAnnotation);if(e[parseInt(i.toString(),10)].signatureAnnotation&&0!==e[parseInt(i.toString(),10)].signatureAnnotation.length&&t[parseInt(i.toString(),10)].signatureAnnotation)for(n=0;n<e[parseInt(i.toString(),10)].signatureAnnotation.length;n++)this.updateDocumentAnnotationCollections(e[parseInt(i.toString(),10)].signatureAnnotation[parseInt(n.toString(),10)],t[parseInt(i.toString(),10)].signatureAnnotation);if(e[parseInt(i.toString(),10)].signatureInkAnnotation&&0!==e[parseInt(i.toString(),10)].signatureInkAnnotation.length&&t[parseInt(i.toString(),10)].signatureInkAnnotation)for(n=0;n<e[parseInt(i.toString(),10)].signatureInkAnnotation.length;n++)this.updateDocumentAnnotationCollections(e[parseInt(i.toString(),10)].signatureInkAnnotation[parseInt(n.toString(),10)],t[parseInt(i.toString(),10)].signatureInkAnnotation)}return t},vAt.prototype.updateDocumentAnnotationCollections=function(e,t){if(0===t.length)t.push(e);else{for(var i=!1,n=0;n<t.length;n++)if(e.AnnotName&&t[parseInt(n.toString(),10)].AnnotName&&e.AnnotName===t[parseInt(n.toString(),10)].AnnotName){i=!0;break}i||t.push(e)}},vAt.prototype.renderAnnotationCollections=function(e,t,i){var n=[],o=e.annotationOrder;if(!je(o))for(var r=0;r<o.length;r++){var s=o[parseInt(r.toString(),10)],a=s.AnnotType||s.AnnotationType;switch(this.pdfViewer.dateTimeFormat&&(s.ModifiedDate=this.pdfViewer.annotationModule.stickyNotesAnnotationModule.getDateAndTime(s.ModifiedDate)),n.push(s),a){case"textMarkup":je(this.pdfViewer.annotationModule)||je(this.pdfViewer.annotationModule.textMarkupAnnotationModule)||this.updateCollections(this.pdfViewer.annotationModule.textMarkupAnnotationModule.updateTextMarkupAnnotationCollections(s,t));break;case"shape_measure":je(this.pdfViewer.annotationModule)||je(this.pdfViewer.annotationModule.measureAnnotationModule)||this.updateCollections(this.pdfViewer.annotationModule.measureAnnotationModule.updateMeasureAnnotationCollections(s,t));break;case"shape":je(this.pdfViewer.annotationModule)||je(this.pdfViewer.annotationModule.shapeAnnotationModule)||this.updateCollections(this.pdfViewer.annotationModule.shapeAnnotationModule.updateShapeAnnotationCollections(s,t));break;case"sticky":this.updateCollections(this.updateStickyNotesAnnotationCollections(s,t));break;case"stamp":je(this.pdfViewer.annotationModule)||je(this.pdfViewer.annotationModule.stampAnnotationModule)||this.updateCollections(this.pdfViewer.annotationModule.stampAnnotationModule.updateStampAnnotationCollections(s,t));break;case"Ink":je(this.pdfViewer.annotationModule)||je(this.pdfViewer.annotationModule.inkAnnotationModule)||this.updateCollections(this.pdfViewer.annotationModule.inkAnnotationModule.updateInkCollections(s,t));break;case"Text Box":je(this.pdfViewer.annotationModule)||je(this.pdfViewer.annotationModule.freeTextAnnotationModule)||this.updateCollections(this.pdfViewer.annotationModule.freeTextAnnotationModule.updateFreeTextAnnotationCollections(s,t))}}if(e.signatureAnnotation&&0!==e.signatureAnnotation.length)for(var l=0;l<e.signatureAnnotation.length;l++)this.pdfViewer.dateTimeFormat&&(e.signatureAnnotation[parseInt(l.toString(),10)].ModifiedDate=this.pdfViewer.annotationModule.stickyNotesAnnotationModule.getDateAndTime(e.signatureAnnotation[parseInt(l.toString(),10)].ModifiedDate)),this.updateCollections(this.pdfViewerBase.signatureModule.updateSignatureCollections(e.signatureAnnotation[parseInt(l.toString(),10)],t),!0);if(this.pdfViewer.toolbarModule&&this.renderAnnotationComments(n,t),i)for(l=0;l<this.pdfViewerBase.renderedPagesList.length;l++)this.pdfViewerBase.renderedPagesList[parseInt(l.toString(),10)]===t&&this.pdfViewerBase.renderAnnotations(t,e,!1)},vAt.prototype.updateCollections=function(e,t){var i=!1,n=t?this.pdfViewer.signatureCollection:this.pdfViewer.annotationCollection;if(n&&e)for(var o=0;o<n.length;o++)if(t){if(n[parseInt(o.toString(),10)].signatureName===e.signatureName){i=!0;break}}else if(n[parseInt(o.toString(),10)].annotationId===e.annotationId){i=!0;break}!i&&e&&(t?this.pdfViewer.signatureCollection:this.pdfViewer.annotationCollection).push(e)},vAt.prototype.renderAnnotationComments=function(e,t){if(t+=1,e&&0!==e.length){(1!==e.length||"Signature"!==e[0].AnnotationType&&"signature"!==e[0].AnnotationType)&&this.createPageAccordion(t);for(var i=0;i<e.length;i++)e[parseInt(i.toString(),10)].AnnotName&&1===e[parseInt(i.toString(),10)].AnnotName.split("freeText").length&&this.createCommentControlPanel(e[parseInt(i.toString(),10)],t);var n=document.querySelectorAll(".e-pv-new-comments-div");if(n)for(var o=0;o<n.length;o++)n[parseInt(o.toString(),10)].style.display="none"}},vAt.prototype.initializeAcccordionContainer=function(){var t=Q("div",{id:this.pdfViewer.element.id+"_commentsPanelText",className:"e-pv-comments-panel-text"});N?this.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_NoCommentsYet").then(function(e){t.textContent=e}):t.textContent=this.pdfViewer.localeObj.getConstant("No Comments Yet"),this.updateCommentPanelTextTop(),this.pdfViewerBase.navigationPane.commentsContentContainer.appendChild(t),this.accordionContentContainer=Q("div",{id:this.pdfViewer.element.id+"_accordionContentContainer",className:"e-pv-accordion-content-container"}),this.pdfViewerBase.navigationPane.commentsContentContainer.appendChild(this.accordionContentContainer),this.pdfViewerBase.navigationPane.annotationMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Export Annotations")],!1),this.pdfViewerBase.navigationPane.annotationMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Export XFDF")],!1)},vAt.prototype.updateCommentPanelTextTop=function(){var e=document.getElementById(this.pdfViewer.element.id+"_commentsPanelText");this.pdfViewerBase.navigationPane.commentPanelContainer&&this.pdfViewerBase.navigationPane.commentPanelContainer.clientHeight&&"none"!==e.style.display&&(e.style.paddingTop=this.pdfViewerBase.navigationPane.commentPanelContainer.clientHeight/2-47+"px",e.style.paddingLeft=this.pdfViewerBase.navigationPane.commentPanelContainer.clientWidth/3+"px")},vAt.prototype.createPageAccordion=function(e){if(null===document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+e))return this.accordionContent=Q("div",{id:this.pdfViewer.element.id+"_accordioncontent"+e}),this.accordionContent.style.zIndex="1000",this.accordionPageContainer=Q("div",{id:this.pdfViewer.element.id+"_accordionPageContainer"+e,className:"e-pv-accordion-page-container"}),this.accordionPageContainer.appendChild(this.accordionContent),this.pdfViewerBase.viewerMainContainer.appendChild(this.accordionPageContainer),this.accordionContainer=Q("div",{id:this.pdfViewer.element.id+"_accordionContainer"+e,className:"e-pv-accordion-container"}),new x4({items:[{header:this.pdfViewer.localeObj.getConstant("Page")+" "+e,expanded:!0,content:"#"+this.pdfViewer.element.id+"_accordioncontent"+e}]}).appendTo(this.accordionContainer),this.accordionContainer.style.order="pageIndex",this.alignAccordionContainer(this.accordionContainer,e),document.getElementById(this.pdfViewer.element.id+"_commentsPanelText")&&(this.pdfViewerBase.navigationPane.annotationMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Export Annotations")],!0),this.pdfViewerBase.navigationPane.annotationMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Export XFDF")],!0),document.getElementById(this.pdfViewer.element.id+"_commentsPanelText").style.display="none"),document.getElementById(this.pdfViewer.element.id+"_accordionContentContainer")&&(document.getElementById(this.pdfViewer.element.id+"_accordionContentContainer").style.display="block"),this.accordionContainer},vAt.prototype.alignAccordionContainer=function(e,t){var i=!0;if(this.accordionContentContainer){if(this.isAccordionContainer)this.accordionContentContainer.appendChild(e),i=!1;else for(var n=1;n<=this.pdfViewerBase.pageCount;n++){var o=document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+n);if(o&&t<n){this.accordionContentContainer.insertBefore(e,o),i=!1;break}}i&&(this.accordionContentContainer.appendChild(e),i=!1),this.isAccordionContainer=!1}},vAt.prototype.updateCommentPanelScrollTop=function(e){var e=document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+e);e&&(e=e.offsetTop+e.clientTop-35,this.pdfViewerBase.navigationPane.commentsContentContainer.scrollTop=e)},vAt.prototype.getButtonState=function(t,e){e.addEventListener("keyup",function(e){!t.element.querySelector(".e-btn-save")||""===e.srcElement.value&&""===e.srcElement.defaultValue||e.srcElement.defaultValue===e.srcElement.value||(t.element.querySelector(".e-btn-save").ej2_instances[0].disabled=!1)})},vAt.prototype.createCommentControlPanel=function(e,t,i,n,o){var r=document.getElementById(this.pdfViewer.element.id+"_accordioncontent"+t);if(r){var s=document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+t),a=(s&&s.ej2_instances[0].expandItem(!0),this.commentsContainer=Q("div",{id:this.pdfViewer.element.id+"commentscontainer_"+t+"_"+this.commentsCount,className:"e-pv-comments-container"}),this.commentsContainer.accessKey=t.toString()+"_"+this.commentsCount,!1);if(e){if(this.commentsContainer.id=e.AnnotName,e.AnnotName)for(var l=0;l<r.childElementCount;l++)if(r.children[parseInt(l.toString(),10)].id===e.AnnotName){a=!0;o&&(document.getElementById(r.children[parseInt(l.toString(),10)].id).remove(),a=!1);break}e.Name&&"freeText"===e.Name?this.commentsContainer.setAttribute("name","freeText"):this.commentsContainer.setAttribute("name",e.AnnotType)}i&&this.commentsContainer.setAttribute("name",i),this.commentsContainer.addEventListener("mousedown",this.commentsAnnotationSelect.bind(this));for(var s=Q("div",{id:this.pdfViewer.element.id+"_commentdiv_"+t+"_"+this.commentsCount,className:"e-pv-comments-div"}),h=(this.commentsCount=this.commentsCount+1,this.commentsContainer.appendChild(s),this.updateCommentPanelScrollTop(t),a||r.appendChild(this.commentsContainer),void 0),h=(e?("null"===(h=this.commentsContainer.getAttribute("name"))&&(h=e.AnnotationType),this.createTitleContainer(s,h,t,e.Subject,e.ModifiedDate,e.Author)):(h=this.commentsContainer.getAttribute("name"),this.createTitleContainer(s,h,t,n)),Q("div",{id:this.pdfViewer.element.id+"_commenttextbox_"+t+"_"+this.commentsCount,className:"e-pv-comment-textbox",attrs:{role:"textbox","aria-label":"comment textbox"}})),n=this.pdfViewer.enableAutoComplete?"on":"off",d=new VSt({mode:"Inline",type:"Text",model:{placeholder:this.pdfViewer.localeObj.getConstant("Add a comment")+"..",htmlAttributes:{autocomplete:n}},emptyText:"",editableOn:"EditIconClick",saveButton:{content:this.pdfViewer.localeObj.getConstant("Post"),cssClass:"e-outline",disabled:!0},cancelButton:{content:this.pdfViewer.localeObj.getConstant("Cancel"),cssClass:"e-outline"},submitOnEnter:!0}),p=(!e||je(e.Note)&&je(e.Text)||(d.created=function(){setTimeout(function(){d.element.querySelector(".e-editable-value").innerText=je(e.Note)?je(e.Text)?"":e.Text:e.Note})},d.beginEdit=function(){d.value=d.valueEle.innerText}),d.appendTo(h),document.querySelectorAll(".e-editable-inline")),l=0;l<p.length;l++)p[parseInt(l.toString(),10)].style.display="none";if(e||"freeText"===i||(d.enableEditMode=!0),this.getButtonState(d,h),d.actionSuccess=this.createCommentDiv.bind(this,d),s.appendChild(h),e){if(d.value=je(e.Note)?je(e.Text)?"":e.Text:e.Note,this.checkIslockProperty(e)&&null==e.Comments&&this.createCommentDiv(this.commentsContainer),"freeText"===e.Name&&(d.value=e.MarkupText),e.State&&(t=Q("div",{id:this.pdfViewer.element.id+"status_container",className:"e-pv-status-container"}),n=Q("div",{id:this.pdfViewer.element.id+"status_div",className:"e-pv-status-div"}),i=Q("span",{id:this.pdfViewer.element.id+"status_icon"}),n.appendChild(i),t.appendChild(n),s.appendChild(t),this.updateStatusContainer(e.State,i,n,t)),e.Comments){for(l=0;l<e.Comments.length;l++)this.renderComments(e.Comments[parseInt(l.toString(),10)],this.commentsContainer);" "!==e.Note&&""!==e.Note&&null!==e.Note&&this.createCommentDiv(this.commentsContainer),"Text Box"===e.AnnotType&&" "!==e.Text&&""!==e.Text&&null!==e.Text&&this.createCommentDiv(this.commentsContainer)}" "!==e.Note&&""!==e.Note&&null!==e.Note&&this.createCommentDiv(this.commentsContainer),"Text Box"===e.AnnotType&&" "!==e.Text&&""!==e.Text&&null!==e.Text&&this.createCommentDiv(this.commentsContainer)}return this.isNewcommentAdded=!0,s.addEventListener("click",this.commentsDivClickEvent.bind(this)),s.addEventListener("mouseover",this.commentDivMouseOver.bind(this)),s.addEventListener("mouseleave",this.commentDivMouseLeave.bind(this)),s.addEventListener("mouseout",this.commentDivMouseLeave.bind(this)),s.addEventListener("focusout",this.commentDivMouseLeave.bind(this)),h.addEventListener("dblclick",this.openEditorElement.bind(this)),h.addEventListener("focusin",this.commentDivFocus.bind(this)),this.commentsContainer.id}return""},vAt.prototype.commentDivFocus=function(e){var t,i;je(this.pdfViewer.freeTextSettings.defaultText)&&(this.pdfViewer.freeTextSettings.defaultText="Type here"),!je(e.target)&&!je(this.pdfViewer.freeTextSettings.defaultText)&&this.pdfViewer.selectedItems&&this.pdfViewer.selectedItems.annotations[0]&&"FreeText"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&e.target.value===this.pdfViewer.freeTextSettings.defaultText&&e.target.select(),this.isNewcommentAdded?(i=(t=this).pdfViewerBase.currentPageNumber,setTimeout(function(){t.updateScrollPosition(i)},500)):null!==e.relatedTarget&&e.relatedTarget.id===this.pdfViewer.element.id+"_viewerContainer"&&(e.preventDefault(),e.target.blur())},vAt.prototype.updateScrollPosition=function(e){var t,i,e=document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+e);e&&this.isNewcommentAdded&&(t=0,(i=document.querySelectorAll(".e-editable-inline"))[0]&&(t=i[0].getBoundingClientRect().height),i=e.offsetTop+e.clientTop+t,this.pdfViewerBase.navigationPane.commentsContentContainer.scrollTop<i&&(this.pdfViewerBase.navigationPane.commentsContentContainer.scrollTop=i),this.isNewcommentAdded=!1)},vAt.prototype.updateCommentsScrollTop=function(e){var t,i=document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+this.pdfViewerBase.currentPageNumber),n=document.querySelector(".e-pv-comments-border"),o=0;i&&n&&(o=n.getBoundingClientRect().height,t=void 0,t=e?i.offsetTop+n.offsetTop+o/4:i.offsetTop+n.offsetTop-70,this.pdfViewerBase.navigationPane.commentsContentContainer.scrollTop=t)},vAt.prototype.createCommentDiv=function(t){var e,i,n=this,o=Q("div",{id:this.pdfViewer.element.id+"_newcommentdiv_"+this.commentsCount+"_"+this.commentsreplyCount,className:"e-pv-new-comments-div"}),r=(t.localName?e=t:(e=t.valueEle.parentElement.parentElement.parentElement.parentElement,i=t.valueEle.parentElement.parentElement.previousSibling.childNodes[1]),this.pdfViewer.enableAutoComplete?"on":"off"),r=new VSt({mode:"Inline",type:"Text",value:"",editableOn:"Click",model:{placeholder:this.pdfViewer.localeObj.getConstant("Add a reply")+"..",htmlAttributes:{autocomplete:r}},emptyText:this.pdfViewer.localeObj.getConstant("Add a reply"),saveButton:{content:this.pdfViewer.localeObj.getConstant("Post"),cssClass:"e-outline",disabled:!0},cancelButton:{content:this.pdfViewer.localeObj.getConstant("Cancel"),cssClass:"e-outline"},submitOnEnter:!0});if(r.appendTo(o),o.lastChild.firstChild.click(),this.getButtonState(r,o),t.valueEle){if(this.pdfViewer.enableHtmlSanitizer&&t.value&&(t.value=go.sanitize(t.value)),null!==t.value&&""!==t.value&&" "!==t.value||""===t.value&&""!==t.prevValue){if(this.pdfViewer.selectedItems.annotations[0]&&"FreeText"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType)this.modifyTextProperty(t.value,t.prevValue,t.valueEle.parentNode.parentNode.parentNode.parentNode.id);else try{this.modifyTextProperty(t.value,t.prevValue,t.valueEle.parentNode.parentNode.parentNode.parentNode.id)}catch(e){this.modifyTextProperty(t.value,t.prevValue)}t.prevValue!=t.value&&this.updateModifiedDate(i)}1===t.valueEle.parentElement.parentElement.parentElement.parentElement.childElementCount&&null!=t.value&&""!==t.value&&(e.appendChild(o),setTimeout(function(){n.updateCommentsScrollTop(!0)},50))}else e.appendChild(o),setTimeout(function(){n.updateCommentsScrollTop(!0)},50);r.actionSuccess=this.saveCommentDiv.bind(this,r)},vAt.prototype.saveCommentDiv=function(e,t){var i,n,o,r;this.pdfViewer.enableHtmlSanitizer&&e.value&&(e.value=go.sanitize(e.value)),n=t.name&&""!==e.value?(i=e.valueEle.parentElement.parentElement.parentElement,o=e.valueEle.parentElement.parentElement,e.value):(o=(i=e).lastChild,t),i&&o&&(i.removeChild(o),e=Q("div",{id:this.pdfViewer.element.id+"_replytextbox_"+this.commentsCount+"_"+this.commentsreplyCount}),this.commentsreplyCount=this.commentsreplyCount+1,(t=Q("div",{id:this.pdfViewer.element.id+"replyDiv_"+this.commentsCount+"_"+this.commentsreplyCount,className:"e-pv-reply-div"})).id=this.pdfViewer.annotation.createGUID(),o=this.getAuthorName(this.pdfViewer.selectedItems.annotations[0],i),this.createReplyDivTitleContainer(t,null,o),t.addEventListener("mouseover",this.commentDivMouseOver.bind(this)),t.addEventListener("mouseleave",this.commentDivMouseLeave.bind(this)),t.addEventListener("click",this.commentDivOnSelect.bind(this)),e.addEventListener("dblclick",this.openEditorElement.bind(this)),t.style.border="1px",t.style.borderColor="black",t.style.zIndex=1002,o=this.pdfViewer.enableAutoComplete?"on":"off",(r=new VSt({mode:"Inline",type:"Text",emptyText:"",editableOn:"EditIconClick",model:{placeholder:this.pdfViewer.localeObj.getConstant("Add a reply")+"..",htmlAttributes:{autocomplete:o}},value:n,saveButton:{content:this.pdfViewer.localeObj.getConstant("Post"),cssClass:"e-outline",disabled:!0},cancelButton:{content:this.pdfViewer.localeObj.getConstant("Cancel"),cssClass:"e-outline"}})).created=function(){setTimeout(function(){r.element.querySelector(".e-editable-value").innerText=n})},r.beginEdit=function(){r.value=r.valueEle.innerText},r.appendTo(e),r.actionSuccess=this.modifyProperty.bind(this,r),t.appendChild(e),t.style.paddingLeft="24px",i.appendChild(t),this.getButtonState(r,e),t.addEventListener("click",this.commentsDivClickEvent.bind(this)),t.addEventListener("dblclick",this.commentsDivDoubleClickEvent.bind(this)),this.createCommentDiv(t.parentElement),this.modifyCommentsProperty(n,t.id,i.id))},vAt.prototype.renderComments=function(e,t,i,n,o){var r,s,a=Q("div",{id:this.pdfViewer.element.id+"_replytextbox_"+this.commentsCount+"_"+this.commentsreplyCount}),l=(this.commentsreplyCount=this.commentsreplyCount+1,Q("div",{id:"replyDiv_"+this.commentsCount+"_"+this.commentsreplyCount,className:"e-pv-reply-div"})),h=i?(l.id=e.annotName,e.author):(l.id=e.AnnotName,e.Author),h=(l.style.border="1px",l.style.borderColor="black",h=h||t.getAttribute("author"),i?void 0!==e.modifiedDate?this.createReplyDivTitleContainer(l,e.modifiedDate,h):this.createReplyDivTitleContainer(l,null,h):this.createReplyDivTitleContainer(l,e.ModifiedDate,h),l.addEventListener("mouseover",this.commentDivMouseOver.bind(this)),l.addEventListener("mouseleave",this.commentDivMouseLeave.bind(this)),l.addEventListener("click",this.commentDivOnSelect.bind(this)),a.addEventListener("dblclick",this.openEditorElement.bind(this)),this.pdfViewer.enableAutoComplete?"on":"off"),d=new VSt({mode:"Inline",type:"Text",emptyText:"",editableOn:"EditIconClick",model:{placeholder:this.pdfViewer.localeObj.getConstant("Add a reply")+"..",htmlAttributes:{autocomplete:h}},value:"",saveButton:{content:this.pdfViewer.localeObj.getConstant("Post"),cssClass:"e-outline",disabled:!0},cancelButton:{content:this.pdfViewer.localeObj.getConstant("Cancel"),cssClass:"e-outline"}});d.value=i?e.note:e.Note,d.created=function(){setTimeout(function(){d.element.querySelector(".e-editable-value").innerText=i?e?e.note:"":e?e.Note:""})},d.beginEdit=function(){d.value=d.valueEle.innerText},d.appendTo(a),l.appendChild(a),i&&(e.State=e.state),e.State&&(h=Q("div",{id:this.pdfViewer.element.id+"status_container",className:"e-pv-status-container"}),r=Q("div",{id:this.pdfViewer.element.id+"status_div",className:"e-pv-status-div"}),s=Q("span",{id:this.pdfViewer.element.id+"status_icon"}),r.appendChild(s),h.appendChild(r),l.appendChild(h),this.updateStatusContainer(e.State,s,r,h)),l.style.paddingLeft="24px",this.getButtonState(d,a),!i||o?t.appendChild(l):(s=document.getElementById(n),e.position?s.insertBefore(l,s.childNodes[e.position]):s&&(1<s.childElementCount?s.insertBefore(l,s.childNodes[s.childElementCount-1]):t.appendChild(l))),l.addEventListener("click",this.commentsDivClickEvent.bind(this)),l.addEventListener("dblclick",this.commentsDivDoubleClickEvent.bind(this)),d.actionSuccess=this.modifyProperty.bind(this,d)},vAt.prototype.createCommentsContainer=function(e,t,i){for(var n,o=document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+t),r=(!o&&((r=document.getElementById(this.pdfViewer.element.id+"_accordionPageContainer"+t))&&r.parentElement.removeChild(r),o=this.createPageAccordion(t))&&o.ej2_instances[0].expandItem(!0),document.getElementById(this.pdfViewer.element.id+"_accordioncontent"+t)),o=(this.commentsContainer=Q("div",{id:this.pdfViewer.element.id+"commentscontainer_"+t+"_"+this.commentsCount,className:"e-pv-comments-container"}),this.commentsContainer.accessKey=t.toString()+"_"+this.commentsCount,e&&(this.commentsContainer.id=e.annotName||e.annotationId),this.commentsContainer.addEventListener("mousedown",this.commentsAnnotationSelect.bind(this)),Q("div",{id:this.pdfViewer.element.id+"_commentdiv_"+t+"_"+this.commentsCount,className:"e-pv-comments-div"})),r=(this.commentsCount=this.commentsCount+1,this.commentsContainer.appendChild(o),this.updateCommentPanelScrollTop(t),e&&r&&(e.position||0===e.position?r.insertBefore(this.commentsContainer,r.children[e.position]):r.appendChild(this.commentsContainer)),e&&r&&(e.indent?(this.commentsContainer.setAttribute("name","shape_measure"),this.createTitleContainer(o,"shape_measure",t,e.subject,e.modifiedDate,e.author)):"sticky"===e.shapeAnnotationType||"stamp"===e.shapeAnnotationType?(r=this.createTitleContainer(o,e.shapeAnnotationType,t,null,e.modifiedDate,e.author),this.commentsContainer.setAttribute("name",r),"sticky"!==r||i||this.addStickyNotesAnnotations(t-1,e)):"textMarkup"===e.shapeAnnotationType?(this.commentsContainer.setAttribute("name","textMarkup"),this.createTitleContainer(o,"textMarkup",t,e.subject,e.modifiedDate,e.author)):"FreeText"===e.shapeAnnotationType?(e.note=e.dynamicText,this.commentsContainer.setAttribute("name","freetext"),this.createTitleContainer(o,"freeText",t,e.subject,e.modifiedDate)):"Ink"===e.shapeAnnotationType?(e.note=e.dynamicText,this.commentsContainer.setAttribute("name","ink"),this.createTitleContainer(o,"ink",t,e.subject,e.modifiedDate)):(this.commentsContainer.setAttribute("name","shape"),"Line"===e.shapeAnnotationType?this.createTitleContainer(o,"shape",t,e.subject,e.modifiedDate,e.author):this.createTitleContainer(o,"shape",t,e.shapeAnnotationType,e.modifiedDate,e.author))),Q("div",{id:this.pdfViewer.element.id+"_commenttextbox_"+t+"_"+this.commentsCount,className:"e-pv-comment-textbox",attrs:{role:"textbox","aria-label":"comment textbox"}})),i=this.pdfViewer.enableAutoComplete?"on":"off",s=new VSt({mode:"Inline",type:"Text",model:{placeholder:this.pdfViewer.localeObj.getConstant("Add a comment")+"..",htmlAttributes:{autocomplete:i}},emptyText:"",editableOn:"EditIconClick",saveButton:{content:this.pdfViewer.localeObj.getConstant("Post"),cssClass:"e-outline",disabled:!0},cancelButton:{content:this.pdfViewer.localeObj.getConstant("Cancel"),cssClass:"e-outline"},submitOnEnter:!0}),a=(s.appendTo(r),document.querySelectorAll(".e-editable-inline")),l=0;l<a.length;l++)a[parseInt(l.toString(),10)].style.display="none";if((r.addEventListener("keydown",function(e){s.element.querySelector(".e-btn-save")&&(""!==e.srcElement.value?s.element.querySelector(".e-btn-save").ej2_instances[0].disabled=!1:s.element.querySelector(".e-btn-save").ej2_instances[0].disabled=!0)}),s.actionSuccess=this.createCommentDiv.bind(this,s),o.appendChild(r),e)&&(s.value=e.note,e.state&&(t=Q("div",{id:this.pdfViewer.element.id+"status_container",className:"e-pv-status-container"}),i=Q("div",{id:this.pdfViewer.element.id+"status_div",className:"e-pv-status-div"}),n=Q("span",{id:this.pdfViewer.element.id+"status_icon"}),i.appendChild(n),t.appendChild(i),o.appendChild(t),this.updateStatusContainer(e.state,n,i,t)),e.comments)){for(l=0;l<e.comments.length;l++)this.renderComments(e.comments[parseInt(l.toString(),10)],this.commentsContainer,!0,null,!0);0<e.comments.length&&this.createCommentDiv(this.commentsContainer)}return o.addEventListener("click",this.commentsDivClickEvent.bind(this)),o.addEventListener("mouseover",this.commentDivMouseOver.bind(this)),o.addEventListener("mouseleave",this.commentDivMouseLeave.bind(this)),o.addEventListener("mouseout",this.commentDivMouseLeave.bind(this)),o.addEventListener("focusout",this.commentDivMouseLeave.bind(this)),r.addEventListener("dblclick",this.openEditorElement.bind(this)),this.commentsContainer.id},vAt.prototype.modifyProperty=function(e){var t=e.element.parentElement.id,i=e.element.parentElement.parentElement.id,n=e.element.previousSibling.firstChild;this.updateModifiedDate(n),this.modifyCommentsProperty(e.value,t,i,e.prevValue)},vAt.prototype.createTitleContainer=function(e,t,i,n,o,r,s){var t=this.getAnnotationType(t),a=Q("div",{id:this.pdfViewer.element.id+"_commentTitleConatiner_"+i+"_"+this.commentsCount,className:"e-pv-comment-title-container"}),l=Q("span",{id:this.pdfViewer.element.id+"_commenttype_icon"+i+"_"+this.commentsCount}),l=(l.style.opacity="0.6",this.updateCommentIcon(l,t,n),r=(r=r||this.pdfViewer.annotationModule.updateAnnotationAuthor(t,n)).replace(/(\r\n|\n|\r)/gm,""),l.style.padding="8px",l.style.cssFloat="left",a.appendChild(l),Q("div",{id:this.pdfViewer.element.id+"_commentTitle_"+i+"_"+this.commentsCount,className:"e-pv-comment-title"})),i=(l.textContent=o?r+" - "+this.convertUTCDateToLocalDate(o):r+" - "+this.setModifiedDate(),a.appendChild(l),this.moreButtonId=this.pdfViewer.element.id+"_more-options_"+this.commentsCount+"_"+this.commentsreplyCount,Q("button",{id:this.moreButtonId,className:"e-pv-more-options-button e-btn",attrs:{tabindex:"-1"}})),o=(i.style.visibility="hidden",i.style.zIndex="1001",i.setAttribute("type","button"),i.setAttribute("aria-label","more button"),Q("span",{id:this.pdfViewer.element.id+"_more-options_icon",className:"e-pv-more-icon e-pv-icon"})),r=(i.appendChild(o),o.style.opacity="0.87",a.appendChild(i),e.appendChild(a),e.parentElement);return r&&(o=this.pdfViewer.annotationModule.updateAnnotationAuthor(t,n),r.setAttribute("author",o)),this.isCreateContextMenu||this.createCommentContextMenu(),this.isCreateContextMenu=!0,l.parentElement&&0!==l.parentElement.clientWidth?l.style.maxWidth=l.parentElement.clientWidth-i.clientWidth+"px":l.style.maxWidth="237px",a.addEventListener("dblclick",this.openTextEditor.bind(this)),i.addEventListener("mouseup",this.moreOptionsClick.bind(this)),t},vAt.prototype.createReplyDivTitleContainer=function(e,t,i){var n=Q("div",{id:this.pdfViewer.element.id+"_replyTitleConatiner_"+this.commentsCount+"_"+this.commentsreplyCount,className:"e-pv-reply-title-container"}),o=Q("div",{id:this.pdfViewer.element.id+"_replyTitle_"+this.commentsCount+"_"+this.commentsreplyCount,className:"e-pv-reply-title"}),t=(i=i.replace(/(\r\n|\n|\r)/gm,""),o.textContent=t?i+" - "+this.setExistingAnnotationModifiedDate(t):i+" - "+this.setModifiedDate(),n.appendChild(o),this.moreButtonId=this.pdfViewer.element.id+"_more-options_"+this.commentsCount+"_"+this.commentsreplyCount,Q("button",{id:this.moreButtonId,className:"e-pv-more-options-button e-btn",attrs:{tabindex:"-1"}})),i=(t.style.visibility="hidden",t.style.zIndex="1001",t.setAttribute("type","button"),t.setAttribute("aria-label","more button"),Q("span",{id:this.pdfViewer.element.id+"_more-options_icon",className:"e-pv-more-icon e-pv-icon"})),i=(t.appendChild(i),i.style.opacity="0.87",n.appendChild(t),e.appendChild(n),document.querySelectorAll('[class="e-pv-comment-title"]')),e=document.querySelectorAll('[class="e-pv-more-options-button e-btn"]');i[0]&&e[0]&&i[0].parentElement&&0!==i[0].parentElement.clientWidth?o.style.maxWidth=i[0].parentElement.clientWidth-e[0].clientWidth+"px":o.style.maxWidth="237px",n.addEventListener("dblclick",this.openTextEditor.bind(this)),t.addEventListener("mouseup",this.moreOptionsClick.bind(this))},vAt.prototype.updateCommentIcon=function(e,t,i){"sticky"===t?e.className="e-pv-comment-icon e-pv-icon":"stamp"===t?e.className="e-pv-stamp-icon e-pv-icon":"shape"===t?e.className="Line"===i?"e-pv-shape-line-icon e-pv-icon":"LineWidthArrowHead"===i||"Arrow"===i?"e-pv-shape-arrow-icon e-pv-icon":"Circle"===i||"Ellipse"===i||"Oval"===i?"e-pv-shape-circle-icon e-pv-icon":"Rectangle"===i||"Square"===i?"e-pv-shape-rectangle-icon e-pv-icon":"Polygon"===i?"e-pv-shape-pentagon-icon e-pv-icon":"e-pv-annotation-shape-icon e-pv-icon":"measure"===t?e.className="Distance"===i||"Distance calculation"===i?"e-pv-calibrate-distance-icon e-pv-icon":"Perimeter"===i||"Perimeter calculation"===i?"e-pv-calibrate-perimeter-icon e-pv-icon":"Radius"===i||"Radius calculation"===i?"e-pv-calibrate-radius-icon e-pv-icon":"Area"===i||"Area calculation"===i?"e-pv-calibrate-area-icon e-pv-icon":"Volume"===i||"Volume calculation"===i?"e-pv-calibrate-volume-icon e-pv-icon":"e-pv-annotation-calibrate-icon e-pv-icon":"textMarkup"===t?e.className="Highlight"===i?"e-pv-highlight-icon e-pv-icon":"Underline"===i?"e-pv-underline-icon e-pv-icon":"Strikethrough"===i?"e-pv-strikethrough-icon e-pv-icon":"e-pv-annotation-icon e-pv-icon":"freeText"===t?e.className="e-pv-freetext-icon e-pv-icon":"ink"!==t&&"Ink"!==i||(e.className="e-pv-inkannotation-icon e-pv-icon")},vAt.prototype.updateStatusContainer=function(e,t,i,n){"Accepted"===e?(i.style.backgroundColor="rgb(24,169,85)",t.className="e-pv-accepted-icon"):"Completed"===e?(i.style.backgroundColor="rgb(0,122,255)",t.className="e-pv-completed-icon"):"Cancelled"===e?(i.style.backgroundColor="rgb(245,103,0)",t.className="e-pv-cancelled-icon"):"Rejected"===e?(i.style.backgroundColor="rgb(255,59,48)",t.className="e-pv-rejected-icon"):(t.className="",n.parentElement.removeChild(n))},vAt.prototype.updateAccordionContainer=function(e){e=parseInt(e.accessKey.split("_")[0],10),e=document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+e),e&&e.parentElement.removeChild(e),e=document.getElementById(this.pdfViewer.element.id+"_accordionContentContainer");e&&0===e.childElementCount&&(e.style.display="none",document.getElementById(this.pdfViewer.element.id+"_commentsPanelText"))&&(this.pdfViewerBase.navigationPane.annotationMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Export Annotations")],!1),this.pdfViewerBase.navigationPane.annotationMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Export XFDF")],!1),document.getElementById(this.pdfViewer.element.id+"_commentsPanelText").style.display="block",this.updateCommentPanelTextTop())},vAt.prototype.createCommentContextMenu=function(){this.commentContextMenu=[{text:this.pdfViewer.localeObj.getConstant("Edit")},{text:this.pdfViewer.localeObj.getConstant("Delete Context")},{text:this.pdfViewer.localeObj.getConstant("Set Status"),items:[{text:this.pdfViewer.localeObj.getConstant("None")},{text:this.pdfViewer.localeObj.getConstant("Accepted")},{text:this.pdfViewer.localeObj.getConstant("Cancelled")},{text:this.pdfViewer.localeObj.getConstant("Completed")},{text:this.pdfViewer.localeObj.getConstant("Rejected")}]}];var e=Q("ul",{id:this.pdfViewer.element.id+"_comment_context_menu"});this.pdfViewer.element.appendChild(e),this.commentMenuObj=new D4({target:"#"+this.moreButtonId,items:this.commentContextMenu,beforeOpen:this.contextMenuBeforeOpen.bind(this),select:this.commentMenuItemSelect.bind(this)}),this.pdfViewer.enableRtl&&(this.commentMenuObj.enableRtl=!0),this.commentMenuObj.appendTo(e),F.isDevice&&!this.pdfViewer.enableDesktopMode?this.commentMenuObj.animationSettings.effect="ZoomIn":this.commentMenuObj.animationSettings.effect="SlideDown"},vAt.prototype.contextMenuBeforeOpen=function(e){var t,i=document.querySelectorAll(".e-pv-more-options-button");if(i)for(var n=0;n<i.length;n++)"visible"===i[parseInt(n.toString(),10)].style.visibility&&(t=i[parseInt(n.toString(),10)].parentElement.nextSibling);this.checkIslockProperty(t)?(this.commentMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Edit")],!1),this.commentMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Delete Context")],!1)):(this.commentMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Edit")],!0),this.commentMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Delete Context")],!0))},vAt.prototype.commentMenuItemSelect=function(e){var t,i=document.querySelectorAll(".e-pv-more-options-button");if(i){for(var n=0;n<i.length;n++)"visible"===i[parseInt(n.toString(),10)].style.visibility&&(t=i[parseInt(n.toString(),10)].parentElement.nextSibling);if(e.item)switch(e.item.text){case this.pdfViewer.localeObj.getConstant("Edit"):for(var o=document.querySelectorAll(".e-pv-new-comments-div"),n=0;n<o.length;n++)o[parseInt(n.toString(),10)].style.display="none";t.ej2_instances[0].enableEditMode=!0;break;case this.pdfViewer.localeObj.getConstant("Delete Context"):t.parentElement.parentElement.firstChild===t.parentElement?(r=this.getAnnotationById(t.parentElement.parentElement))&&(s=r.annotation,r.pageIndex,s)&&this.handleCommentDeletion(s):this.modifyCommentDeleteProperty(t.parentElement.parentElement,t.parentElement);break;case this.pdfViewer.localeObj.getConstant("Set Status"):break;case this.pdfViewer.localeObj.getConstant("Accepted"):t.parentElement.lastChild.id===this.pdfViewer.element.id+"status_container"&&t.parentElement.lastChild.remove();var r=Q("div",{id:this.pdfViewer.element.id+"status_container",className:"e-pv-status-container"}),s=Q("div",{id:this.pdfViewer.element.id+"status_div",className:"e-pv-status-div"}),a=Q("span",{id:this.pdfViewer.element.id+"status_icon",className:"e-pv-accepted-icon"});s.style.backgroundColor="rgb(24,169,85)",s.appendChild(a),r.appendChild(s),t.parentElement.appendChild(r),this.modifyStatusProperty("Accepted",t.parentElement);break;case this.pdfViewer.localeObj.getConstant("Completed"):t.parentElement.lastChild.id===this.pdfViewer.element.id+"status_container"&&t.parentElement.lastChild.remove();a=Q("div",{id:this.pdfViewer.element.id+"status_container",className:"e-pv-status-container"}),s=Q("div",{id:this.pdfViewer.element.id+"status_div",className:"e-pv-status-div"}),r=Q("span",{id:this.pdfViewer.element.id+"status_icon",className:"e-pv-completed-icon"});s.style.backgroundColor="rgb(0,122,255)",s.appendChild(r),a.appendChild(s),t.parentElement.appendChild(a),this.modifyStatusProperty("Completed",t.parentElement);break;case this.pdfViewer.localeObj.getConstant("Cancelled"):t.parentElement.lastChild.id===this.pdfViewer.element.id+"status_container"&&t.parentElement.lastChild.remove();r=Q("div",{id:this.pdfViewer.element.id+"status_container",className:"e-pv-status-container"}),s=Q("div",{id:this.pdfViewer.element.id+"status_div",className:"e-pv-status-div"}),a=Q("span",{id:this.pdfViewer.element.id+"status_icon",className:"e-pv-cancelled-icon"});s.style.backgroundColor="rgb(245,103,0)",s.appendChild(a),r.appendChild(s),t.parentElement.appendChild(r),this.modifyStatusProperty("Cancelled",t.parentElement);break;case this.pdfViewer.localeObj.getConstant("Rejected"):t.parentElement.lastChild.id===this.pdfViewer.element.id+"status_container"&&t.parentElement.lastChild.remove();a=Q("div",{id:this.pdfViewer.element.id+"status_container",className:"e-pv-status-container"}),s=Q("div",{id:this.pdfViewer.element.id+"status_div",className:"e-pv-status-div"}),r=Q("span",{id:this.pdfViewer.element.id+"status_icon",className:"e-pv-rejected-icon"});s.style.backgroundColor="rgb(255,59,48)",s.appendChild(r),a.appendChild(s),t.parentElement.appendChild(a),this.modifyStatusProperty("Rejected",t.parentElement);break;case this.pdfViewer.localeObj.getConstant("None"):t.parentElement.lastChild.id===this.pdfViewer.element.id+"status_container"&&t.parentElement.lastChild.remove(),this.modifyStatusProperty("None",t.parentElement)}}},vAt.prototype.handleCommentDeletion=function(e){je(e.note)||""===e.note||this.pdfViewer.fireCommentDelete(e.annotName,e.note,e),this.pdfViewer.annotationModule.deleteAnnotation()},vAt.prototype.getAnnotationById=function(t){var e=parseInt(t.accessKey.split("_")[0],10)-1,i=t.getAttribute("name"),i=this.getAnnotations(e,null,i);return i?{annotation:i.find(function(e){return e.annotName===t.id})||null,pageIndex:e}:null},vAt.prototype.moreOptionsClick=function(e,t){"block"!==document.getElementById(this.pdfViewer.element.id+"_comment_context_menu").style.display&&(this.pdfViewer.annotationModule.checkContextMenuDeleteItem(this.commentMenuObj),this.commentMenuObj.open(e.clientY,e.clientX,e.currentTarget)),this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.inkAnnotationModule&&(e=parseInt(this.pdfViewer.annotationModule.inkAnnotationModule.currentPageNumber,10),this.pdfViewer.annotationModule.inkAnnotationModule.drawInkAnnotation(e))},vAt.prototype.openTextEditor=function(e){for(var t=document.querySelectorAll(".e-pv-new-comments-div"),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].style.display="none";this.checkIslockProperty(e.currentTarget.nextSibling)?e.currentTarget.nextSibling.ej2_instances[0].enableEditMode=!1:e.currentTarget&&e.target&&this.checkAnnotationSettings(e.currentTarget.id)||(e.currentTarget.nextSibling.ej2_instances[0].enableEditMode=!0)},vAt.prototype.checkIslockProperty=function(e){var t,i=this.pdfViewer.annotationCollection;if(e.IsCommentLock)return!0;this.pdfViewer.annotationModule.textMarkupAnnotationModule&&this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation?t=this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation:this.pdfViewer.selectedItems.annotations[0]&&(t=this.pdfViewer.selectedItems.annotations[0]);for(var n=0;n<i.length;n++){i[parseInt(n.toString(),10)].annotationSettings=je(i[parseInt(n.toString(),10)].annotationSettings)?{}:i[parseInt(n.toString(),10)].annotationSettings;var o=je(i[parseInt(n.toString(),10)].note)?i[parseInt(n.toString(),10)].notes:i[parseInt(n.toString(),10)].note;if(i[parseInt(n.toString(),10)].annotationSettings.isLock&&(e.textContent===o||i[parseInt(n.toString(),10)].dynamicText===e.textContent))return!0;if(i[parseInt(n.toString(),10)].isCommentLock&&(this.pdfViewer.selectedItems.annotations[parseInt(n.toString(),10)]&&this.pdfViewer.selectedItems.annotations[parseInt(n.toString(),10)].isCommentLock||this.pdfViewer.annotationModule.textMarkupAnnotationModule&&this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation&&this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation.isCommentLock))return!0;for(var r=0;r<i[parseInt(n.toString(),10)].comments.length;r++)if(t&&i[parseInt(n.toString(),10)].annotationId===t.annotName&&!0===i[parseInt(n.toString(),10)].comments[parseInt(r.toString(),10)].isLock&&e.textContent===i[parseInt(n.toString(),10)].comments[parseInt(r.toString(),10)].note)return!0}return!1},vAt.prototype.openEditorElement=function(e){for(var t=document.querySelectorAll(".e-pv-new-comments-div"),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].style.display="none";this.checkIslockProperty(e.currentTarget)?e.currentTarget.ej2_instances[0].enableEditMode=!1:e.currentTarget&&e.target?this.checkAnnotationSettings(e.currentTarget.id)||(!je(this.pdfViewer.selectedItems)&&this.pdfViewer.selectedItems.annotations[0]&&this.pdfViewer.selectedItems.annotations[0].isReadonly?e.currentTarget.ej2_instances[0].enableEditMode=!1:e.currentTarget.ej2_instances[0].enableEditMode=!0):e.currentTarget.ej2_instances[0].enableEditMode=!0},vAt.prototype.commentsDivClickEvent=function(e){var t=this.findAnnotationObject(e.currentTarget.parentElement.id);if(!(!je(t)&&(t.annotationSettings.isLock||t.isLock))){var i=!1;if(0===e.clientX&&0===e.clientY?this.isSetAnnotationType=!0:this.isSetAnnotationType=!1,"e-pv-more-icon e-pv-icon"===e.target.className)return null;for(var n=document.querySelectorAll(".e-pv-more-options-button"),o=0;o<n.length;o++)n[parseInt(o.toString(),10)].style.visibility="hidden";"none"===document.getElementById(this.pdfViewer.element.id+"_commantPanel").style.display&&this.pdfViewer.annotationModule.showCommentsPanel(),e.currentTarget.parentElement.classList.contains("e-pv-comments-border")&&(i=!0),e.currentTarget.firstChild.lastChild.style.visibility="visible";var r=document.querySelectorAll(".e-pv-comments-border");if(r)for(var s=0;s<r.length;s++)r[parseInt(s.toString(),10)].classList.remove("e-pv-comments-border");e.currentTarget.parentElement.classList.add("e-pv-comments-border");for(var a=document.querySelectorAll(".e-pv-new-comments-div"),o=0;o<a.length;o++)a[parseInt(o.toString(),10)].style.display="none";var l=e.currentTarget.parentElement.lastChild,h=e.currentTarget.parentElement;if(l){if(l.style.display="block",l.querySelector(".e-editable-inline")){this.isEditableElement||(l.querySelector(".e-editable-inline").style.display="block");for(o=0;o<h.childElementCount;o++){var d=h.childNodes[parseInt(o.toString(),10)].querySelector(".e-editable-inline");d&&""===d.style.display&&(l.style.display="none",l.querySelector(".e-editable-inline").style.display="none")}}!this.isSetAnnotationType||i||this.updateCommentsScrollTop()}1===e.currentTarget.parentElement.childElementCount&&(this.pdfViewer.enableShapeLabel&&(i=e.currentTarget.parentElement.getAttribute("name"),this.isSetAnnotationType)&&"shape"===i?e.currentTarget.childNodes[1].ej2_instances[0].enableEditMode=!1:e.currentTarget.childNodes[1].ej2_instances[0].enableEditMode=!0);i=void 0;e&&e.currentTarget&&e.currentTarget.childNodes[1]&&(i=e.currentTarget.childNodes[1].ej2_instances[0]),e.currentTarget&&e.currentTarget.id&&i&&(t&&t.isCommentLock&&(i.enableEditMode=!1,this.createCommentDiv(e.currentTarget)),this.pdfViewer.fireCommentSelect(e.currentTarget.id,e.currentTarget.childNodes[1].ej2_instances[0].value,t)),this.commentDivOnSelect(e),e.preventDefault()}},vAt.prototype.commentsDivDoubleClickEvent=function(e){for(var t=document.querySelectorAll(".e-pv-new-comments-div"),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].style.display="none";this.checkIslockProperty(e.currentTarget.children[1])?2===e.currentTarget.childElementCount?e.currentTarget.lastChild.ej2_instances[0].enableEditMode=!1:e.currentTarget.childNodes[1].ej2_instances[0].enableEditMode=!1:e.currentTarget&&e.target&&(this.checkAnnotationSettings(e.currentTarget.id)||(2===e.currentTarget.childElementCount?e.currentTarget.lastChild.ej2_instances[0].enableEditMode=!0:e.currentTarget.childNodes[1].ej2_instances[0].enableEditMode=!0))},vAt.prototype.commentDivOnSelect=function(e){for(var t=document.querySelectorAll(".e-pv-comments-select"),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].classList.remove("e-pv-comments-select");var n=document.getElementById(e.currentTarget.id);n&&(n.classList.remove("e-pv-comments-hover"),n.classList.remove("e-pv-comments-leave"),n.classList.add("e-pv-comments-select"),e.currentTarget.nextSibling)&&e.currentTarget.nextSibling.classList.contains("e-pv-new-comments-div")&&((n=document.getElementById(e.currentTarget.nextSibling.id)).classList.remove("e-pv-comments-hover"),n.classList.remove("e-pv-comments-leave"),n.classList.add("e-pv-comments-select"))},vAt.prototype.commentDivMouseOver=function(e){var t=document.getElementById(e.currentTarget.id);t&&(t.classList.remove("e-pv-comments-select"),t.classList.remove("e-pv-comments-leave"),t.classList.add("e-pv-comments-hover"),e.currentTarget.nextSibling)&&e.currentTarget.nextSibling.classList.contains("e-pv-new-comments-div")&&((t=document.getElementById(e.currentTarget.nextSibling.id)).classList.remove("e-pv-comments-select"),t.classList.remove("e-pv-comments-leave"),t.classList.add("e-pv-comments-hover"))},vAt.prototype.commentDivMouseLeave=function(e){var t=document.getElementById(e.currentTarget.id);t&&(t.classList.remove("e-pv-comments-hover"),t.classList.remove("e-pv-comments-select"),t.classList.add("e-pv-comments-leave"),e.currentTarget.nextSibling)&&e.currentTarget.nextSibling.classList.contains("e-pv-new-comments-div")&&((t=document.getElementById(e.currentTarget.nextSibling.id)).classList.remove("e-pv-comments-hover"),t.classList.remove("e-pv-comments-select"),t.classList.add("e-pv-comments-leave"))},vAt.prototype.drawIcons=function(e){var t,i,n;this.pdfViewerBase.isCommentIconAdded&&(t=this.pdfViewer.annotation.getEventPageNumber(e),n=this.pdfViewerBase.getElement("_pageDiv_"+t).getBoundingClientRect(),i=this.pdfViewerBase.getZoomFactor(),this.pdfViewer.annotationModule.isFormFieldShape=!1,this.pdfViewer.annotation.stickyNotesAnnotationModule.drawStickyNotes((e.clientX-n.left)/i,(e.clientY-n.top)/i,30,30,t,null),this.pdfViewerBase.isCommentIconAdded=!1,e=document.getElementById(this.pdfViewer.element.id+"_comment"),(e=N?e.children[0]:e)&&e.classList.contains("e-pv-select")?e.classList.remove("e-pv-select"):(n=document.getElementById(this.pdfViewer.element.id+"_commentIcon"))&&(this.pdfViewer.enableRtl?n.className="e-pv-comment-icon e-pv-icon e-icon-left e-right":n.className="e-pv-comment-icon e-pv-icon e-icon-left"))},vAt.prototype.addComments=function(e,t,i){document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+t)||this.pdfViewer.annotation.stickyNotesAnnotationModule.createPageAccordion(t);t=this.pdfViewer.annotation.stickyNotesAnnotationModule.createCommentControlPanel(null,t,e,i);return t},vAt.prototype.commentsAnnotationSelect=function(e){var t=e.currentTarget;if(this.checkAnnotationSettings(t.id)){r=parseInt(t.accessKey.split("_")[0],10);this.pdfViewer.navigation&&this.pdfViewer.navigationModule.goToPage(r),"null"!==(o=t.getAttribute("name"))&&"Ink"!==o||(o="ink"),this.isCommentsSelected=!1,this.setAnnotationType(t.id,o,r),this.isCommentsSelected||(this.selectAnnotationObj={id:t.id,annotType:o,pageNumber:r})}else{if(t.classList.contains("e-pv-comments-border")){for(var i=document.querySelectorAll(".e-pv-comments-div"),n=0;n<i.length;n++)i[parseInt(n.toString(),10)].style.minHeight="60px";1===e.currentTarget.childElementCount&&e.currentTarget.childNodes[0].querySelector(".e-editable-inline")&&(e.currentTarget.childNodes[0].style.minHeight=e.currentTarget.childNodes[0].clientHeight)}if("e-pv-more-icon e-pv-icon"===e.target.className||"e-pv-more-options-button e-btn"===e.target.className)return e.preventDefault(),null;var o,r=parseInt(t.accessKey.split("_")[0],10);if(t.classList.contains("e-pv-comments-border"))this.isSetAnnotationType=!0;else{var s=document.querySelectorAll(".e-pv-comments-border");if(s)for(n=0;n<s.length;n++)s[parseInt(n.toString(),10)].classList.remove("e-pv-comments-border");(i=document.getElementById(t.id))&&(document.querySelectorAll('.e-pv-more-options-button[style*="visibility: visible"]').forEach(function(e){return e.style.visibility="hidden"}),"e-editable-value-wrapper"===e.target.className?e.target.parentElement.parentElement.firstChild.lastChild.style.visibility="visible":"e-pv-reply-title"===e.target.className||"e-pv-comment-title"===e.target.className?e.target.parentElement.lastChild.style.visibility="visible":"e-editable-value"===e.target.className&&(e.target.parentElement.parentElement.parentElement.firstChild.lastChild.style.visibility="visible"),i.classList.add("e-pv-comments-border"));for(var a,l=document.querySelectorAll(".e-pv-new-comments-div"),n=0;n<l.length;n++)l[parseInt(n.toString(),10)].style.display="none";i&&(a=i.querySelector(".e-pv-new-comments-div"))&&(a.style.display="block");var h=t.lastChild;if(this.isEditableElement=!1,h.querySelector(".e-editable-inline")){h.style.display="block",h.querySelector(".e-editable-inline").style.display="block";for(var d=0;d<t.childElementCount;d++){var p=t.childNodes[parseInt(d.toString(),10)].querySelector(".e-editable-inline");p&&""===p.style.display&&h.classList.contains("e-pv-new-comments-div")&&(this.isEditableElement=!0,h.style.display="none",h.querySelector(".e-editable-inline").style.display="none")}}this.isSetAnnotationType=!1,1===e.currentTarget.childElementCount&&(e.currentTarget.childNodes[0].childNodes[1].ej2_instances[0].enableEditMode=!0)}this.isSetAnnotationType||("null"!==(o=t.getAttribute("name"))&&"Ink"!==o||(o="ink"),this.isCommentsSelected=!1,this.setAnnotationType(t.id,o,r),this.isCommentsSelected||(this.selectAnnotationObj={id:t.id,annotType:o,pageNumber:r}),this.pdfViewer.navigation&&this.pdfViewer.navigationModule.goToPage(r))}this.isSetAnnotationType=!1},vAt.prototype.findAnnotationObject=function(e){if(this.pdfViewer.annotationModule.textMarkupAnnotationModule&&this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation)return this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation;if(this.pdfViewer.selectedItems.annotations[0])return this.pdfViewer.selectedItems.annotations[0];if(i=this.pdfViewer.annotationCollection)for(var t=0;t<i.length;t++)if(i[parseInt(t.toString(),10)].annotationId&&i[parseInt(t.toString(),10)].annotationId===e){if("textMarkup"===i[parseInt(t.toString(),10)].shapeAnnotationType)return i[parseInt(t.toString(),10)];for(var i=this.pdfViewer.annotations,n=0;n<i.length;n++)if(i[parseInt(n.toString(),10)].annotName&&i[parseInt(n.toString(),10)].annotName===e)return i[parseInt(n.toString(),10)]}},vAt.prototype.checkAnnotationSettings=function(t){var e=this.pdfViewer.annotationCollection;return!!e&&!(!((e=e.find(function(e){return e.annotationId===t}))&&e.annotationSettings&&e.annotationSettings.isLock)||(e.isCommentLock||0!==e.comments.length||!je(e.note)&&""!==e.note||"FreeText"===e.shapeAnnotationType)&&!(!je(e.comments)&&0<e.comments.length&&e.comments[0].isLock||e.isCommentLock))},vAt.prototype.updateCommentsContainerWidth=function(){var e=document.getElementById(this.pdfViewer.element.id+"_accordionContentContainer"),t=document.getElementById(this.pdfViewer.element.id+"_commentscontentcontainer");e.style.width=t.clientWidth+"px"},vAt.prototype.selectCommentsAnnotation=function(e){this.selectAnnotationObj&&!this.isCommentsSelected&&this.selectAnnotationObj.pageNumber-1===e&&(this.setAnnotationType(this.selectAnnotationObj.id,this.selectAnnotationObj.annotType,this.selectAnnotationObj.pageNumber),this.selectAnnotationObj=null,this.isCommentsSelected=!0)},vAt.prototype.setAnnotationType=function(e,t,i){var n="measure"===t?"shape_measure":t,o=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_"+(n="freeText"===n?"freetext":n));if(o=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_"+n]:o){var n=JSON.parse(o),r=this.pdfViewer.selectedItems.annotations[0],o=this.pdfViewer.annotationModule.getPageCollection(n,i-1);if(null!=o&&n[parseInt(o.toString(),10)])for(var s=n[parseInt(o.toString(),10)].annotations,a=0;a<s.length;a++){var l,h,d=s[parseInt(a.toString(),10)].annotationSelectorSettings;s[parseInt(a.toString(),10)].annotName===e&&(r&&(this.pdfViewer.annotation.triggerAnnotationUnselectEvent(),this.pdfViewer.annotation.triggerSignatureUnselectEvent()),this.pdfViewer.clearSelection(i-1),"textMarkup"===t?(this.pdfViewer.annotationModule.textMarkupAnnotationModule.clearCurrentAnnotationSelection(i-1,!0),l=r&&"Highlight"===r.textMarkupAnnotationType?"_blendAnnotationsIntoCanvas_":"_annotationCanvas_",l=this.pdfViewerBase.getElement(l+(i-1)),this.pdfViewer.annotationModule.textMarkupAnnotationModule.selectAnnotation(s[parseInt(a.toString(),10)],l,i-1),this.pdfViewer.annotation.textMarkupAnnotationModule.currentTextMarkupAnnotation=s[parseInt(a.toString(),10)],this.pdfViewer.annotation.textMarkupAnnotationModule.selectTextMarkupCurrentPage=i-1,this.pdfViewer.annotation.textMarkupAnnotationModule.enableAnnotationPropertiesTool(!0),this.pdfViewer.toolbarModule&&this.pdfViewer.enableAnnotationToolbar&&(this.pdfViewer.toolbarModule.annotationToolbarModule.isToolbarHidden=!0,this.pdfViewer.toolbarModule.annotationToolbarModule.showAnnotationToolbar(this.pdfViewer.toolbarModule.annotationItem))):("stamp"===t?this.pdfViewer.select([s[parseInt(a.toString(),10)].randomId],d):"sticky"===t?this.pdfViewer.select([s[parseInt(a.toString(),10)].annotName],d):this.pdfViewer.select([s[parseInt(a.toString(),10)].id],d),this.pdfViewer.annotation.onAnnotationMouseDown()),"textMarkup"===t?(s[parseInt(a.toString(),10)].rect||s[parseInt(a.toString(),10)].bounds)&&(h=this.pdfViewerBase.pageSize[i-1].top*this.pdfViewerBase.getZoomFactor()+this.pdfViewer.annotationModule.getAnnotationTop(s[parseInt(a.toString(),10)])*this.pdfViewerBase.getZoomFactor())&&(l=(h-20).toString(),this.pdfViewerBase.viewerContainer.scrollTop=parseInt(l,10)):(d=s[parseInt(a.toString(),10)].bounds.top,"ink"===t&&(d=s[parseInt(a.toString(),10)].bounds.y),d=((h=this.pdfViewerBase.pageSize[i-1].top*this.pdfViewerBase.getZoomFactor()+d*this.pdfViewerBase.getZoomFactor())-20).toString(),this.pdfViewerBase.viewerContainer.scrollTop=parseInt(d,10)),this.isCommentsSelected=!0)}}},vAt.prototype.modifyTextProperty=function(e,t,i){var n,o=this.pdfViewer.annotationModule.textMarkupAnnotationModule;if((je(n=!(n=o&&o.currentTextMarkupAnnotation?this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation:n)||n.annotName!==i?this.pdfViewer.selectedItems.annotations[0]:n)&&i||!je(n)&&n.annotName!==i)&&(n=this.pdfViewer.annotationCollection.filter(function(e){return e.annotationId===i})[0]),i&&n.annotName!==i)for(var r=0;r<this.pdfViewer.annotations.length;r++)if(i===this.pdfViewer.annotations[parseInt(r.toString(),10)].annotName){n=this.pdfViewer.annotations[parseInt(r.toString(),10)];break}if(n){n.annotName=je(n.annotName)?n.annotationId:n.annotName;o=document.getElementById(n.annotName);if(o){var s=void 0,s=o.accessKey.split("_")[0]?parseInt(o.accessKey.split("_")[0],10):this.pdfViewerBase.currentPageNumber,o=o.getAttribute("name"),a=s-1,l=void 0,h=!1;if("FreeText"!==n.shapeAnnotationType&&(!this.pdfViewer.enableShapeLabel||"shape"!==o&&"shape_measure"!==o)||(s=!1,i&&n.annotName!==i&&(this.pdfViewer.annotation.modifyDynamicTextValue(e,i),s=!0),s)||("FreeText"===n.shapeAnnotationType?(n.dynamicText!==e&&(this.textFromCommentPanel=!0,this.pdfViewer.annotation.modifyDynamicTextValue(e,n.annotName)),n.dynamicText=e):(this.pdfViewer.annotation.modifyDynamicTextValue(e,n.annotName),n.labelContent=e,n.notes=e),this.pdfViewer.nodePropertyChange(n,{})),n.measureType&&""!==n.measureType?(l=this.getAnnotations(a,null,"shape_measure"),h=!0):l=this.getAnnotations(a,null,n.shapeAnnotationType),null!==l&&"FreeText"!==n.shapeAnnotationType)for(r=0;r<l.length;r++)if(l[parseInt(r.toString(),10)].annotName===n.annotName){var d=owt(l[parseInt(r.toString(),10)]);if((!je(e)&&""!==e||!je(e)&&""===e&&""!==t)&&l[parseInt(r.toString(),10)].note!==e)return this.pdfViewer.annotation.addAction(a,r,l[parseInt(r.toString(),10)],"Text Property Added","",d,l[parseInt(r.toString(),10)]),(n=l[parseInt(r.toString(),10)]).note=e,n.enableShapeLabel&&(n.labelContent=e),n.modifiedDate=this.getDateAndTime(),h?this.updateUndoRedoCollections(n,a,"shape_measure"):this.updateUndoRedoCollections(n,a),t&&""!==t?this.pdfViewer.fireCommentEdit(n.annotName,n.note,n):this.pdfViewer.fireCommentAdd(n.annotName,n.note,n),n}}}},vAt.prototype.getDateAndTime=function(e){e=e||new Date,this.globalize=new Ti;return this.globalize.formatDate(new Date(e),{format:"M/d/yyyy h:mm:ss a",type:"dateTime"})},vAt.prototype.getDateAndTimeFormat=function(e){e=e||new Date,this.globalize=new Ti;var t={format:this.pdfViewer.dateTimeFormat,type:"dateTime"};return this.globalize.formatDate(new Date(e),t)},vAt.prototype.modifyCommentsProperty=function(e,t,i,n){var o=this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation||this.pdfViewer.selectedItems.annotations[0];if(!o)for(var r=Object.keys(this.pdfViewer.nameTable),s=0;s<r.length;s++){var a=this.pdfViewer.nameTable[r[parseInt(s.toString(),10)]];if(i===a.annotName){o=a;break}}if(o){var l=document.getElementById(o.annotName),h=parseInt(l.accessKey.split("_")[0],10)-1,d=void 0,p=!1,l=this.getAuthorName(o,l),c=(o.measureType&&""!==o.measureType?(d=this.getAnnotations(h,null,"shape_measure"),p=!0):d=this.getAnnotations(h,null,o.shapeAnnotationType),o.notes||o.note);if(null!==d)for(s=0;s<d.length;s++)d[parseInt(s.toString(),10)].annotName===o.annotName&&(o=d[parseInt(s.toString(),10)]);var u=owt(o);if(0<o.comments.length){for(var g,m,f=!1,y=0;y<o.comments.length;y++)o.comments[parseInt(y.toString(),10)].annotName===t&&(f=!0,o.comments[parseInt(y.toString(),10)].note=e,o.comments[parseInt(y.toString(),10)].modifiedDate=this.getDateAndTime());o.annotName===i&&(g={annotName:t,parentId:i,subject:o.subject,comments:[],author:l,note:e,shapeAnnotationType:"",state:"",stateModel:"",modifiedDate:this.getDateAndTime(),review:{state:"",stateModel:"",modifiedDate:this.getDateAndTime(),author:l},isLock:!1},f||(o.comments[o.comments.length]=g)),je(c)||"note"!==(m=void 0!==o.note?"note":"notes")&&"notes"!==m||(o[""+m]=c,u[""+m]=c)}else o.annotName===i&&(g={annotName:t,parentId:i,subject:o.subject,comments:[],author:l,note:e,shapeAnnotationType:"",state:"",stateModel:"",modifiedDate:this.getDateAndTime(),review:{state:"",stateModel:"",modifiedDate:this.getDateAndTime(),author:l},isLock:!1},o.comments[o.comments.length]=g,je(c)||"note"!==(m=void 0!==o.note?"note":"notes")&&"notes"!==m||(o[""+m]=c,u[""+m]=c));this.pdfViewer.annotation.addAction(h,null,o,"Comments Property Added","",u,o),p?this.updateUndoRedoCollections(o,h,"shape_measure"):this.updateUndoRedoCollections(o,h)}void 0!==n?this.pdfViewer.fireCommentEdit(t,e,o):this.pdfViewer.fireCommentAdd(t,e,o)},vAt.prototype.modifyStatusProperty=function(e,t){var i=this.pdfViewer.annotation.textMarkupAnnotationModule.currentTextMarkupAnnotation||this.pdfViewer.selectedItems.annotations[0];if(i){var n=document.getElementById(i.annotName),o=parseInt(n.accessKey.split("_")[0],10)-1,r=void 0,s=!1,a=n.getAttribute("author");if(i.measureType&&""!==i.measureType?(r=this.getAnnotations(o,null,"shape_measure"),s=!0):r=this.getAnnotations(o,null,i.shapeAnnotationType),null!==r)for(var l=0;l<r.length;l++)r[parseInt(l.toString(),10)].annotName===i.annotName&&(i=r[parseInt(l.toString(),10)]);n=owt(i);if(t.parentElement.firstChild.id===t.id)i.review={state:e,stateModel:"Review",author:a,modifiedDate:this.getDateAndTime(),annotId:t.id},i.state=e,i.stateModel="Review",this.pdfViewer.annotation.addAction(o,null,i,"Status Property Added","",n,i),this.pdfViewer.fireCommentStatusChanged(t.id,i.note,i,i.state);else for(var h,d=0;d<i.comments.length;d++)i.comments[parseInt(d.toString(),10)].annotName===t.id&&(h=owt(i.comments[parseInt(d.toString(),10)]),i.comments[parseInt(d.toString(),10)].state=e,i.comments[parseInt(d.toString(),10)].stateModel="Review",i.comments[parseInt(d.toString(),10)].review={state:e,stateModel:"Review",author:a,modifiedDate:this.getDateAndTime(),annotId:t.id},this.pdfViewer.annotation.addAction(o,null,i,"Status Property Added","",h,i.comments[parseInt(d.toString(),10)]),this.pdfViewer.fireCommentStatusChanged(i.comments[parseInt(d.toString(),10)].annotName,i.comments[parseInt(d.toString(),10)].note,i,i.comments[parseInt(d.toString(),10)].state));s?this.updateUndoRedoCollections(i,o,"shape_measure"):this.updateUndoRedoCollections(i,o)}},vAt.prototype.modifyCommentDeleteProperty=function(e,t){var i=document.getElementById(e.id),e=this.getAnnotationById(e);if(i&&e){for(var n,o,r=e.annotation,e=e.pageIndex,s=void 0,a=void 0,l=1;l<i.childElementCount;l++)i.childNodes[parseInt(l.toString(),10)].id===t.id&&(o=r.comments[n=l-1],s=owt(r),a=owt(o),o.position=l,this.pdfViewer.fireCommentDelete(o.annotName,o.note,r),r.comments.splice(parseInt(n.toString(),10),1),t.remove());this.pdfViewer.annotation.addAction(e,null,s,"Comments Reply Deleted","",a,r),this.updateUndoRedoCollections(r,e)}},vAt.prototype.updateOpacityValue=function(e){var t=this.getAnnotations(e.pageIndex,null,e.shapeAnnotationType);if(this.pdfViewer.annotationModule.isFormFieldShape=!1,null!==t)for(var i=0;i<t.length;i++)t[parseInt(i.toString(),10)].annotName===e.annotName&&(t[parseInt(i.toString(),10)].opacity=e.opacity,this.updateUndoRedoCollections(t[parseInt(i.toString(),10)],e.pageIndex))},vAt.prototype.undoAction=function(e,t,i){var n;if("Text Property Added"===t){if(e&&(n=document.getElementById(e.annotName)))return r=parseInt(n.accessKey.split("_")[0],10)-1,s=owt(e),n.firstChild.firstChild.nextSibling.ej2_instances[0].value=i.note,l=i.note,e.note=l,2===n.childElementCount&&(n.lastChild.style.display="block"),this.updateUndoRedoCollections(e,r),s}else if("Comments Property Added"===t){if(0<e.comments.length)return o=document.getElementById(e.annotName),r=this.pdfViewerBase.currentPageNumber-1,o&&(r=parseInt(o.accessKey.split("_")[0],10)-1),s=owt(e),l=e.comments[e.comments.length-1],(l=document.getElementById(l.annotName))&&l.remove(),this.updateUndoRedoCollections(e=i,r),s}else if("Status Property Added"===t){if(e){var o=document.getElementById(e.annotName),r=this.pdfViewerBase.currentPageNumber-1,s=(o&&(r=parseInt(o.accessKey.split("_")[0],10)-1),owt(e));if(e.annotName===i.annotName)e.review=i.review,e.state=i.state,e.stateModel=i.stateModel,this.pdfViewer.annotation.redoCommentsElement.push(e);else for(var a=0;a<e.comments.length;a++)if(e.comments[parseInt(a.toString(),10)].annotName===i.annotName){e.comments[parseInt(a.toString(),10)].state=i.state,e.comments[parseInt(a.toString(),10)].stateModel=i.stateModel,e.comments[parseInt(a.toString(),10)].review=i.review,this.pdfViewer.annotation.redoCommentsElement.push(e.comments[parseInt(a.toString(),10)]);break}var l=document.getElementById(i.annotName);return l.lastChild.id===this.pdfViewer.element.id+"status_container"?l.lastChild.remove():l.firstChild.lastChild.id===this.pdfViewer.element.id+"status_container"&&l.firstChild.lastChild.remove(),this.updateUndoRedoCollections(e,r),s}}else if("Comments Reply Deleted"===t){if(o=document.getElementById(e.annotName))return r=parseInt(o.accessKey.split("_")[0],10)-1,this.renderComments(i,o,!0,e.annotName),this.pdfViewer.annotation.redoCommentsElement.push(i),this.updateUndoRedoCollections(e,r),e}else if("dynamicText Change"===t)if(e)if(n=document.getElementById(e.annotName))return n.firstChild.firstChild.nextSibling.ej2_instances[0].value=i.dynamicText,e},vAt.prototype.redoAction=function(e,t,i){var n;if("Text Property Added"===t){if(n=document.getElementById(e.annotName))return a=parseInt(n.accessKey.split("_")[0],10)-1,n.firstChild.firstChild.nextSibling.ej2_instances[0].value=e.note,n.lastChild.style.display="block",this.updateUndoRedoCollections(e,a),e}else if("Comments Property Added"===t){var o=e.comments[e.comments.length-1],r=document.getElementById(e.annotName);if(r)return a=parseInt(r.accessKey.split("_")[0],10)-1,this.renderComments(o,r,!0,e.annotName),this.updateUndoRedoCollections(e,a),e}else{if("Status Property Added"===t){var s=this.pdfViewer.annotation.redoCommentsElement.pop(),a=this.pdfViewerBase.currentPageNumber-1;if(s){var l=Q("div",{id:this.pdfViewer.element.id+"status_container",className:"e-pv-status-container"}),h=Q("div",{id:this.pdfViewer.element.id+"status_div",className:"e-pv-status-div"}),d=Q("span",{id:this.pdfViewer.element.id+"status_icon"});if(h.appendChild(d),l.appendChild(h),(g=document.getElementById(e.annotName))&&(a=parseInt(g.accessKey.split("_")[0],10)-1),e.annotName===s.annotName){this.updateStatusContainer(e.state,d,h,l);for(var p=0;p<g.firstChild.children.length;p++)g.firstChild.children[parseInt(p.toString(),10)].id===this.pdfViewer.element.id+"status_container"&&g.firstChild.children[parseInt(p.toString(),10)].parentElement.removeChild(g.firstChild.children[parseInt(p.toString(),10)]);g.firstChild.appendChild(l)}else for(p=0;p<e.comments.length;p++)if(e.comments[parseInt(p.toString(),10)].annotName===s.annotName){this.updateStatusContainer(e.comments[parseInt(p.toString(),10)].state,d,h,l);for(var c=document.getElementById(s.annotName),u=0;u<c.children.length;u++)c.children[parseInt(u.toString(),10)].id===this.pdfViewer.element.id+"status_container"&&c.children[parseInt(u.toString(),10)].parentElement.removeChild(c.children[parseInt(u.toString(),10)]);c&&c.appendChild(l)}}return this.updateUndoRedoCollections(e,a),e}if("Comments Reply Deleted"===t){for(var g,m,a=this.pdfViewerBase.currentPageNumber-1,s=((g=document.getElementById(e.annotName))&&(a=parseInt(g.accessKey.split("_")[0],10)-1),this.pdfViewer.annotation.redoCommentsElement.pop()),o=owt(e),p=0;p<e.comments.length;p++)e.comments[parseInt(p.toString(),10)].annotName===s.annotName&&(m=document.getElementById(s.annotName),e.comments.splice(p,1),m.remove());return this.updateUndoRedoCollections(e,a),o}if("dynamicText Change"===t&&e&&(n=document.getElementById(e.annotName)))return n.firstChild.firstChild.nextSibling.ej2_instances[0].value=e.dynamicText,e}},vAt.prototype.updateUndoRedoCollections=function(e,t,i,n){var i=i||e.shapeAnnotationType,o=(e.indent&&""!==e.indent&&(i="shape_measure"),this.getAnnotations(t,null,i));if(null!==o){for(var r=0;r<o.length;r++)e.annotName===o[parseInt(r.toString(),10)].annotName&&(o[parseInt(r.toString(),10)]=e,this.pdfViewer.annotationModule.storeAnnotationCollections(o[parseInt(r.toString(),10)],t),n)&&(o.splice(r,1),this.deleteStickyNotesAnnotations(o,t));"shape_measure"===i?this.manageAnnotations(o,t,"shape_measure"):this.manageAnnotations(o,t,e.shapeAnnotationType)}},vAt.prototype.addAnnotationComments=function(e,t,i){var n=e+1,i=(i?this.pdfViewer.annotation.undoCommentsElement:this.pdfViewer.annotation.redoCommentsElement).pop();i&&(this.createCommentsContainer(i,n),this.updateUndoRedoCollections(i,e,t),this.pdfViewer.annotationModule.storeAnnotationCollections(i,n-1))},vAt.prototype.findPosition=function(e,t,i,n){var o,r=document.getElementById(e.annotName);if(r){for(var s=parseInt(r.accessKey.split("_")[0],10)-1,a=r.parentElement,l=0;l<a.childElementCount;l++)a.childNodes[parseInt(l.toString(),10)].id===e.annotName&&(o=l);"Stamp"===t||"Image"===t?t="stamp":"FreeText"===t?t="freetext":"StickyNotes"===t||"sticky"===t?t="sticky":"Ink"===t&&(t="ink");var h=this.getAnnotations(s,null,t);if(null!==h)for(var d,l=0;l<h.length;l++)h[parseInt(l.toString(),10)].annotName===e.annotName&&(d=owt(h[parseInt(l.toString(),10)]),h[parseInt(l.toString(),10)].position=o,(n?this.pdfViewer.annotation.redoCommentsElement:this.pdfViewer.annotation.undoCommentsElement).push(h[parseInt(l.toString(),10)]),"sticky"===t)&&this.updateUndoRedoCollections(d,s,null,i)}},vAt.prototype.getAnnotations=function(e,t,i){var n=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_"+(i="Stamp"===i||"stamp"===i||"Image"===i?"stamp":"StickyNotes"===i||"sticky"===i?"sticky":"textMarkup"===i?"textMarkup":"shape"===i||"Line"===i||"Radius"===i||"Rectangle"===i||"Ellipse"===i||"Polygon"===i||"LineWidthArrowHead"===i||"Square"===i||"Circle"===i?"shape":"FreeText"===i||"freetext"===i||"freeText"===i?"freetext":"ink"===i||"Ink"===i?"ink":"shape_measure"));return(n=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_"+i]:n)&&(i=JSON.parse(n),null!=(n=this.pdfViewer.annotationModule.getPageCollection(i,e)))&&i[parseInt(n.toString(),10)]?i[parseInt(n.toString(),10)].annotations:t},vAt.prototype.manageAnnotations=function(e,t,i){var n=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_"+(i="Stamp"===i||"stamp"===i?"stamp":"Sticky"===i||"sticky"===i?"sticky":"textMarkup"===i?"textMarkup":"shape"===i||"Line"===i||"Radius"===i||"Rectangle"===i||"Ellipse"===i||"Polygon"===i||"LineWidthArrowHead"===i||"Square"===i||"Circle"===i?"shape":"FreeText"===i?"freetext":"ink"===i||"Ink"===i?"ink":"shape_measure"));(n=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_"+i]:n)&&(n=JSON.parse(n),this.pdfViewerBase.isStorageExceed||ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_"+i),null!=(t=this.pdfViewer.annotationModule.getPageCollection(n,t))&&n[parseInt(t.toString(),10)]&&(n[parseInt(t.toString(),10)].annotations=e),t=JSON.stringify(n),this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_"+i]=t:ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_"+i,t))},vAt.prototype.updateStickyNotes=function(e,t){var i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_sticky");if(i=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_sticky"]:i)for(var n=e.bounds,o=JSON.parse(i),r=0;r<o.length;r++)for(var s=o[parseInt(r.toString(),10)],a=0;a<s.annotations.length;a++)if(o[parseInt(r.toString(),10)].annotations[parseInt(a.toString(),10)].annotName===e.annotName){this.pdfViewerBase.isStorageExceed||ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_sticky");this.pdfViewer.annotationModule.getPageCollection(o,0);o[parseInt(r.toString(),10)]&&(o[parseInt(r.toString(),10)].annotations[parseInt(a.toString(),10)].bounds={left:n.x,top:n.y,width:n.width,height:n.height,right:n.right,bottom:n.bottom});var l=JSON.stringify(o);this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_sticky"]=l:ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_sticky",l);break}},vAt.prototype.saveStickyAnnotations=function(){for(var e=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_sticky"),t=(this.pdfViewerBase.isStorageExceed&&(e=this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_sticky"]),[]),i=0;i<this.pdfViewerBase.pageCount;i++)t[parseInt(i.toString(),10)]=[];if(e&&!this.pdfViewer.annotationSettings.skipDownload)for(var n=JSON.parse(e),o=0;o<n.length;o++){var r=[],s=n[parseInt(o.toString(),10)];if(s){for(var a=0;s.annotations.length>a;a++)this.pdfViewer.annotationModule.updateModifiedDate(s.annotations[parseInt(a.toString(),10)]),s.annotations[parseInt(a.toString(),10)].bounds=JSON.stringify(this.pdfViewer.annotation.getBounds(s.annotations[parseInt(a.toString(),10)].bounds,s.pageIndex));r=s.annotations}t[s.pageIndex]=r}return JSON.stringify(t)},vAt.prototype.deleteStickyNotesAnnotations=function(e,t){var i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_sticky");(i=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_sticky"]:i)&&(i=JSON.parse(i),this.pdfViewerBase.isStorageExceed||ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_sticky"),null!=(t=this.pdfViewer.annotationModule.getPageCollection(i,t))&&i[parseInt(t.toString(),10)]&&(i[parseInt(t.toString(),10)].annotations=e),t=JSON.stringify(i),this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_sticky"]=t:ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_sticky",t))},vAt.prototype.addStickyNotesAnnotations=function(e,t){var i=this.getAnnotations(e,null,"sticky");i&&i.push(t),this.manageAnnotations(i,e,"sticky")},vAt.prototype.addTextToComments=function(e,t){e=document.getElementById(e);e&&(e.firstChild.firstChild.nextSibling.ej2_instances[0].value=t)},vAt.prototype.updateAnnotationCollection=function(e,t,i){var n=this.findAnnotationType(t),o=this.getAnnotations(t.pageIndex,null,n);if(null!==(o=i?this.pdfViewer.annotationModule.removedAnnotationCollection:o))for(var r=0;r<o.length;r++)if(i&&!o[parseInt(r.toString(),10)].annotName&&(o[parseInt(r.toString(),10)].annotName=o[parseInt(r.toString(),10)].annotationId),o[parseInt(r.toString(),10)].annotName===t.annotName){var s=owt(o[parseInt(r.toString(),10)]);s.annotName=e.annotName,"shape"!==n&&"shape_measure"!==n&&"freetext"!==n&&"ink"!==n||(s.id=e.id),"stamp"===n&&(s.randomId=e.id),"ink"===n?(s.bounds.x=e.bounds.x,s.bounds.y=e.bounds.y):(s.bounds.left=e.bounds.x,s.bounds.top=e.bounds.y,s.bounds.x=e.bounds.x,s.bounds.y=e.bounds.y,s.vertexPoints=e.vertexPoints),s.note=s.note||"",s.comments=[],s.review={state:"",stateModel:"",modifiedDate:s.ModifiedDate,author:s.author},s.state="",s.stateModel="",s.pageNumber=t.pageIndex,this.pdfViewer.annotationModule.storeAnnotations(t.pageIndex,s,"_annotations_"+n),this.createCommentsContainer(s,t.pageIndex+1,!0),i&&(this.pdfViewer.annotationModule.removedAnnotationCollection=[]);break}},vAt.prototype.findAnnotationType=function(e){e=""!==e.measureType?"shape_measure":"StickyNotes"===e.shapeAnnotationType?"sticky":"Stamp"===e.shapeAnnotationType||"Image"===e.shapeAnnotationType?"stamp":"FreeText"===e.shapeAnnotationType?"freetext":"Ink"===e.shapeAnnotationType?"ink":"shape";return e},vAt.prototype.setExistingAnnotationModifiedDate=function(e){e=""!==e?this.setModifiedDate(e):this.setModifiedDate();return e},vAt.prototype.updateModifiedTime=function(e,t){e=12<=e?12===e?e+":"+t+" PM":e-12+":"+t+" PM":e+":"+t+" AM";return e},vAt.prototype.setModifiedDate=function(e){var t,e=e?this.getDateAndTimeFormat(e):this.getDateAndTimeFormat(),i=new Date(e),e=e.toString().split(" ").splice(0,4).join(" ");return 2===i.toLocaleTimeString().split(" ").length?(i.toLocaleTimeString().split(" ")[0].split(":").splice(0,2).join(":"),i.toLocaleTimeString().split(" ")[1]):(t=parseInt(i.toLocaleTimeString().split(":")[0],10),i=i.toLocaleTimeString().split(":")[1],this.updateModifiedTime(t,i)),e},vAt.prototype.convertUTCDateToLocalDate=function(e){this.globalize=new Ti;var t={format:this.pdfViewer.dateTimeFormat,type:"dateTime"};return this.globalize.formatDate(new Date(e),t)},vAt.prototype.updateModifiedDate=function(e){var t=(e=e.id===this.pdfViewer.element.id+"_commenttype_icon"?e.nextSibling:e).textContent.split("-")[0];e.textContent=t+" - "+this.setModifiedDate()},vAt.prototype.updateAnnotationModifiedDate=function(e,t,i){if(e){var n=document.getElementById(e.annotName);if(n){if(t){var t=this.findAnnotationType(e),o=this.getAnnotations(e.pageIndex,null,t);if(null!==o&&e)for(var r=0;r<o.length;r++)e.annotName!==o[parseInt(r.toString(),10)].annotName||e.bounds.x===o[parseInt(r.toString(),10)].bounds.left&&e.bounds.y===o[parseInt(r.toString(),10)].bounds.top&&e.bounds.height===o[parseInt(r.toString(),10)].bounds.height&&e.bounds.width===o[parseInt(r.toString(),10)].bounds.width||(a=(s=n.firstChild.firstChild.childNodes[1]).textContent.split("-")[0],s.textContent=a+" - "+this.setModifiedDate()),"sticky"===o[parseInt(r.toString(),10)].shapeAnnotationType&&this.pdfViewer.annotationModule.storeAnnotationCollections(o[parseInt(r.toString(),10)],e.pageIndex)}else{var s,a=(s=n.firstChild.firstChild.childNodes[1]).textContent.split("-")[0];s.textContent=a+" - "+this.setModifiedDate()}i&&(s=n.firstChild.firstChild.childNodes[1],void 0!==e.modifiedDate)&&(a=s.textContent.split("-")[0],s.textContent=a+" - "+this.setExistingAnnotationModifiedDate(e.modifiedDate))}}},vAt.prototype.saveImportedStickyNotesAnnotations=function(e,t){e.Author||(e.Author=("Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings:this.pdfViewer.stickyNotesSettings).author);var i=this.pdfViewer.stickyNotesSettings.isLock||this.pdfViewer.annotationSettings.isLock,n=this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e),n={shapeAnnotationType:"sticky",author:e.Author,allowedInteractions:n,modifiedDate:e.ModifiedDate,subject:e.Subject,note:e.Note,opacity:e.Opacity,state:e.State,stateModel:e.StateModel,pathData:"",comments:this.pdfViewer.annotationModule.getAnnotationComments(e.Comments,e,e.Author),review:{state:e.State,stateModel:e.StateModel,modifiedDate:e.ModifiedDate,author:e.Author},pageNumber:t,bounds:{left:e.Bounds.X,top:e.Bounds.Y,width:e.Bounds.Width,height:e.Bounds.Height,right:e.Bounds.Right,bottom:e.Bounds.Bottom},annotName:e.AnnotName,color:e.color,annotationSelectorSettings:this.getSettings(e),customData:this.pdfViewer.annotation.getCustomData(e),annotationSettings:{isLock:i},isPrint:e.IsPrint,isCommentLock:e.IsCommentLock};this.pdfViewer.annotationModule.storeAnnotations(t,n,"_annotations_sticky")},vAt.prototype.updateStickyNotesAnnotationCollections=function(e,t){e.Author||(e.Author=("Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings:this.pdfViewer.stickyNotesSettings).author);var i=this.pdfViewer.stickyNotesSettings.isLock||this.pdfViewer.annotationSettings.isLock,n=e.AllowedInteraction||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e);return e.IsLock&&(i=e.isLock),{shapeAnnotationType:"sticky",author:e.Author,allowedInteractions:n,modifiedDate:e.ModifiedDate,subject:e.Subject,note:e.Note,opacity:e.Opacity,state:e.State,stateModel:e.StateModel,pathData:"",comments:this.pdfViewer.annotationModule.getAnnotationComments(e.Comments,e,e.Author),review:{state:e.State,stateModel:e.StateModel,modifiedDate:e.ModifiedDate,author:e.Author},bounds:{left:e.Bounds.X,top:e.Bounds.Y,width:e.Bounds.Width,height:e.Bounds.Height,right:e.Bounds.Right,bottom:e.Bounds.Bottom},annotationId:e.AnnotName,color:e.color,pageNumber:t,customData:this.pdfViewer.annotation.getCustomData(e),annotationSettings:{isLock:i},isPrint:e.IsPrint,isCommentLock:e.IsCommentLock}},vAt.prototype.clear=function(){this.commentsCount=0,this.commentsreplyCount=0,this.isAccordionContainer=!0,this.isEditableElement=!1,this.isCreateContextMenu=!1,this.isPageCommentsRendered=!1,this.isCommentsRendered=!1,this.isAnnotationRendered=!1,this.commentMenuObj&&this.commentMenuObj.destroy();var e=document.querySelectorAll(".e-pv-accordion-page-container");if(e)for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].remove();this.commentsRequestHandler&&this.commentsRequestHandler.clear()},vAt.prototype.getModuleName=function(){return"StickyNotesAnnotation"},vAt.prototype.updateAddAnnotationDetails=function(e,t){t=e?e.offset||{x:1,y:1}:(e={offset:{x:1,y:1},pageNumber:0}).offset;var i=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),n=this.pdfViewer.annotation.createGUID(),o=this.pdfViewer.stickyNotesSettings.annotationSelectorSettings,r=(this.pdfViewerBase.updateSelectorSettings(o),this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.stickyNotesSettings)),s=(e.author=e.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("sticky",r.annotationSubType),this.pdfViewer.stickyNotesSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions),a=(r.isLock=e.isLock||r.isLock,[]),s={AllowedInteractions:e.allowedInteractions||s,AnnotName:n,AnnotType:"sticky",AnnotationFlags:null,AnnotationSelectorSettings:e.annotationSelectorSettings||o,AnnotationSettings:r,Author:e.author||"Guest",Bounds:{X:t.x,Y:t.y,Width:30,Height:30,Left:t.x,Top:t.y,Location:{X:t.x,Y:t.y},Size:{Height:30,IsEmpty:!1,Width:30}},Color:{IsEmpty:!1,B:51,Blue:.2,C:0,G:255},Comments:null,CreatedDate:i,CustomData:e.customData||null,ExistingCustomData:null,Icon:"Comment",IsCommentLock:!1,IsLock:e.isLock||!1,IsPrint:!!je(e.isPrint)||e.isPrint,ModifiedDate:"",Note:"",Opacity:e.opacity||1,Reference:null,Size:{IsEmpty:!0,Width:0,Height:0},State:"",StateModel:"",StrokeColor:null,SubType:null,Subject:e.subject||"Sticky Note",Type:null};return a[0]=s,{stickyNotesAnnotation:a}},vAt.prototype.getAnnotationType=function(e){var t;return"stamp"===e||"Stamp"===e?t="stamp":"shape"===e||"Line"===e||"Radius"===e||"Rectangle"===e||"Ellipse"===e||"Polygon"===e||"LineWidthArrowHead"===e||"Square"===e||"Circle"===e?t="shape":"textMarkup"===e?t="textMarkup":"freeText"===e||"FreeText"===e?t="freeText":"sticky"===e||"StickyNotes"===e?t="sticky":"measure"===e||"shape_measure"===e?t="measure":"ink"!==e&&"Ink"!==e||(t="ink"),t},vAt.prototype.getAuthorName=function(e,t){var i;return e?(e=e.shapeAnnotationType,i=this.getAnnotationType(e),this.pdfViewer.annotationModule.updateAnnotationAuthor(i,e)):t.getAttribute("author")};var yAt=vAt;function vAt(e,t){this.moreButtonId="",this.commentsCount=0,this.commentsreplyCount=0,this.commentContextMenu=[],this.isAccordionContainer=!0,this.isCreateContextMenu=!1,this.isCommentsSelected=!1,this.isAddAnnotationProgramatically=!1,this.isEditableElement=!1,this.isPageCommentsRendered=!1,this.isCommentsRendered=!1,this.isAnnotationRendered=!1,this.textFromCommentPanel=!1,this.pdfViewer=e,this.pdfViewerBase=t,this.opacity=this.pdfViewer.stickyNotesSettings.opacity||1}A1t.prototype.drawInk=function(){this.pdfViewerBase.disableTextSelectionMode(),this.pdfViewer.tool="Ink"},A1t.prototype.drawInkAnnotation=function(e){var t;this.pdfViewerBase.isToolbarInkClicked&&(this.pdfViewerBase.isInkAdded=!0,this.pdfViewer.annotationModule.isFormFieldShape=!1,e=isNaN(e)?this.pdfViewerBase.currentPageNumber-1:e,this.outputString&&""!==this.outputString||0<this.inkPathDataCollection.length?(t=this.addInk(e),this.pdfViewer.renderDrawing(void 0,e),this.pdfViewer.clearSelection(e),this.pdfViewer.select([t.id],t.annotationSelectorSettings),this.pdfViewer.toolbar&&this.pdfViewer.toolbar.annotationToolbarModule&&this.pdfViewer.toolbar.annotationToolbarModule.enableSignaturePropertiesTools(!0),F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.pdfViewer.enableToolbar&&this.pdfViewer.enableAnnotationToolbar&&this.pdfViewer.toolbarModule.annotationToolbarModule.createPropertyTools("Ink")):(this.outputString="",this.newObject=[],this.pdfViewerBase.isToolbarInkClicked=!1,this.pdfViewer.tool="",this.inkPathDataCollection=[]),this.pdfViewerBase.isInkAdded=!1)},A1t.prototype.updateInkDataWithZoom=function(){var e="";if(""!==this.outputString&&this.inkPathDataCollection.push({pathData:this.outputString,zoomFactor:this.inkAnnotationInitialZoom}),0<this.inkPathDataCollection.length)for(var t=0;t<this.inkPathDataCollection.length;t++)e+=this.updatePathDataWithZoom(this.inkPathDataCollection[parseInt(t.toString(),10)].pathData,this.inkPathDataCollection[parseInt(t.toString(),10)].zoomFactor);else e+=this.updatePathDataWithZoom(this.outputString,this.inkAnnotationInitialZoom);return e},A1t.prototype.updatePathDataWithZoom=function(e,t){for(var i="",n=this.pdfViewerBase.getZoomFactor(),o=cbt(rbt(e)),r=0;r<o.length;r++){var s=o[parseInt(r.toString(),10)];i+=s.command+s.x*(n/t)+","+s.y*(n/t)+" "}return i},A1t.prototype.storePathData=function(){this.convertToPath(this.newObject),this.newObject=[]},A1t.prototype.drawInkInCanvas=function(e,t){""!==this.currentPageNumber&&parseInt(this.currentPageNumber,10)!==t&&(this.drawInkAnnotation(parseInt(this.currentPageNumber,10)),this.pdfViewerBase.isToolbarInkClicked=!0,this.pdfViewer.tool="Ink");var i=this.pdfViewerBase.getZoomFactor(),n=(this.inkAnnotationInitialZoom=i,this.pdfViewerBase.getWindowDevicePixelRatio()),o=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",t).getContext("2d"),r=this.pdfViewer.inkAnnotationSettings.thickness||1,s=this.pdfViewer.inkAnnotationSettings.opacity||1,a=this.pdfViewer.inkAnnotationSettings.strokeColor||"#ff0000";(!F.isDevice||F.isDevice&&i<=.7)&&o.setTransform(n,0,0,n,0,0),o.beginPath(),o.lineJoin="round",o.lineCap="round",o.moveTo(e.prevPosition.x,e.prevPosition.y),o.lineTo(e.currentPosition.x,e.currentPosition.y),o.lineWidth=1<r*i?r*i:r,o.strokeStyle=a,o.globalAlpha=s,o.setLineDash([]),o.stroke(),o.arc(e.prevPosition.x,e.prevPosition.y,1,0,2*Math.PI,!0),o.closePath(),this.pdfViewerBase.prevPosition=e.currentPosition,this.newObject.push(e.currentPosition.x,e.currentPosition.y),this.currentPageNumber=t.toString()},A1t.prototype.convertToPath=function(e){this.movePath(e[0],e[1]),this.linePath(e[0],e[1]);for(var t=2;t<e.length;t+=2)this.linePath(e[parseInt(t.toString(),10)],e[t+1])},A1t.prototype.linePath=function(e,t){je(e)||je(t)||(this.outputString+="L"+e+","+t+" ")},A1t.prototype.movePath=function(e,t){je(e)||je(t)||(this.outputString+="M"+e+","+t+" ")},A1t.prototype.addInk=function(e){this.outputString=this.updateInkDataWithZoom();var t,i,n,o,r,s,a,l,h,d,p,c,u=this.calculateInkSize(this.outputString);return this.pdfViewerBase.isToolbarInkClicked&&(t=this.pdfViewer.annotation.createGUID(),i=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),e=isNaN(e)?this.pdfViewerBase.currentPageNumber-1:e,c=this.pdfViewer.inkAnnotationSettings.thickness||1,d=this.pdfViewer.inkAnnotationSettings.opacity||1,p=this.pdfViewer.inkAnnotationSettings.strokeColor||"#ff0000",n=this.pdfViewer.inkAnnotationSettings.isLock||this.pdfViewer.annotationSettings.isLock,o="Guest"!==this.pdfViewer.annotationSettings.author?this.pdfViewer.annotationSettings.author:this.pdfViewer.inkAnnotationSettings.author||"Guest",r=""===this.pdfViewer.annotationSettings.subject||je(this.pdfViewer.annotationSettings.subject)?this.pdfViewer.inkAnnotationSettings.subject||"Ink":this.pdfViewer.annotationSettings.subject,h=je(this.pdfViewer.annotationSettings.customData)?this.pdfViewer.inkAnnotationSettings.customData||null:this.pdfViewer.annotationSettings.customData,s=this.pdfViewer.inkAnnotationSettings.isPrint,a=this.pdfViewer.inkAnnotationSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions,l=this.pdfViewer.annotationSettings||this.pdfViewer.annotationModule.updateAnnotationSettings(this.pdfViewer.inkAnnotationSettings),h={id:"ink"+this.pdfViewerBase.inkCount,bounds:{x:u.x,y:u.y,width:u.width,height:u.height},pageIndex:e,data:this.outputString,customData:h,shapeAnnotationType:"Ink",opacity:d,strokeColor:p,thickness:c,annotName:t,comments:[],author:o,subject:r,notes:"",review:{state:"",stateModel:"",modifiedDate:i,author:o},annotationSelectorSettings:this.getSelector("Ink",""),modifiedDate:i,annotationSettings:l,isPrint:s,allowedInteractions:a,isCommentLock:!1,isLocked:n},u=this.pdfViewer.add(h),d={left:h.bounds.x,top:h.bounds.y,width:h.bounds.width,height:h.bounds.height},p={opacity:h.opacity,strokeColor:h.strokeColor,thickness:h.thickness,modifiedDate:h.modifiedDate,width:h.bounds.width,height:h.bounds.height,data:this.outputString},this.pdfViewerBase.inkCount++,(c=this.pdfViewer.annotation.stickyNotesAnnotationModule.addComments("ink",h.pageIndex+1,h.shapeAnnotationType))&&(document.getElementById(c).id=t),h.annotName=t,this.pdfViewer.annotation.addAction(e,null,u,"Addition","",u,u),this.pdfViewer.annotationModule.storeAnnotations(e,h,"_annotations_ink"),this.pdfViewer.fireAnnotationAdd(h.pageIndex,h.annotName,"Ink",d,p),this.pdfViewerBase.isInkAdded&&(this.outputString="",this.newObject=[],this.inkPathDataCollection=[]),this.pdfViewerBase.isToolbarInkClicked=!1,this.pdfViewer.tool=""),h},A1t.prototype.setAnnotationMode=function(){this.pdfViewerBase.isToolbarInkClicked?this.drawInkAnnotation():(this.pdfViewerBase.isToolbarInkClicked=!0,this.drawInk())},A1t.prototype.saveInkSignature=function(){for(var e=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_ink"),t=(this.pdfViewerBase.isStorageExceed&&(e=this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_ink"]),[]),i=0;i<this.pdfViewerBase.pageCount;i++)t[parseInt(i.toString(),10)]=[];if(e&&!this.pdfViewer.annotationSettings.skipDownload)for(var n=JSON.parse(e),o=0;o<n.length;o++){var r=[],s=n[parseInt(o.toString(),10)];if(s){for(var a=0;s.annotations.length>a;a++){this.pdfViewer.annotationModule.updateModifiedDate(s.annotations[parseInt(a.toString(),10)]);var l=s.annotations[parseInt(a.toString(),10)].strokeColor;s.annotations[parseInt(a.toString(),10)].strokeColor=JSON.stringify(this.pdfViewerBase.signatureModule.getRgbCode(l)),s.annotations[parseInt(a.toString(),10)].bounds=JSON.stringify(this.pdfViewer.annotation.getInkBounds(s.annotations[parseInt(a.toString(),10)].bounds,s.pageIndex));l=cbt(rbt(s.annotations[parseInt(a.toString(),10)].data));s.annotations[parseInt(a.toString(),10)].data=JSON.stringify(l)}r=s.annotations}t[s.pageIndex]=r}return JSON.stringify(t)},A1t.prototype.addInCollection=function(e,t){var i;t&&((i=this.getAnnotations(e,null))&&i.push(t),this.manageInkAnnotations(i,e))},A1t.prototype.calculateInkSize=function(e){for(var t=-1,i=-1,n=-1,o=-1,r=rbt(e),e=this.pdfViewerBase.getZoomFactor(),s=0;s<r.length;s++){var a,l=r[parseInt(s.toString(),10)];-1===t?(t=l.x,n=l.x,i=l.y,o=l.y):((a=l.x)<=t&&(t=a),(l=l.y)<=i&&(i=l),n<=a&&(n=a),o<=l&&(o=l))}return{x:t/e,y:i/e,width:(n-t)/e,height:(o-i)/e}},A1t.prototype.renderExistingInkSignature=function(e,t,i,n){var o=!1;if(!i)for(var r=0;r<this.inkAnnotationindex.length;r++)if(this.inkAnnotationindex[parseInt(r.toString(),10)]===t){o=!0;break}if(e&&(!o||n)){0<e.length&&-1===this.inkAnnotationindex.indexOf(t)&&this.inkAnnotationindex.push(t);for(var s=0;s<e.length;s++){var a,l,h,d,p,c,u,g,m,f=e[parseInt(s.toString(),10)];f&&(a=f.PathData,i&&a&&("object"==typeof a&&1<a.length?a=ubt(a):f.IsPathData||a.split("command").length<=1||(a=ubt(JSON.parse(a)))),this.outputString=a,h=this.calculateInkSize(this.outputString),this.outputString="",u=0,m=1,l=f.Bounds,h&&(h.height<1?(u=l.Height||l.height,m=l.Height||l.height):h.width<1&&(u=l.Width||l.width,m=l.Width||l.width)),h=je(l.X)?l.x+u/2:l.X+u/2,u=je(l.Y)?l.y+u/2:l.Y+u/2,g=l.Width?l.Width-(m-1):l.width-(m-1),m=l.Height?l.Height-(m-1):l.height-(m-1),!f.AnnotationSettings||f.AnnotationSettings.isLock,d=f.AnnotationSelectorSettings?"string"==typeof f.AnnotationSelectorSettings?JSON.parse(f.AnnotationSelectorSettings):f.AnnotationSelectorSettings:this.getSelector(f,"Ink"),p=this.pdfViewer.annotation.getCustomData(f),c=!0,c=(f.AnnotationSettings||this.pdfViewer.inkAnnotationSettings).isPrint,c=!!je(f.IsPrint)||f.IsPrint,f.IsLocked&&f.IsLocked,"Highlight"===f.Subject&&1===f.Opacity&&(f.Opacity=f.Opacity/2),f.allowedInteractions=f.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(f),f.AnnotationSettings=f.AnnotationSettings||this.pdfViewer.annotationModule.updateAnnotationSettings(f),h={id:"ink"+this.pdfViewerBase.inkCount,bounds:{x:h,y:u,width:g,height:m},pageIndex:t,data:a,shapeAnnotationType:"Ink",opacity:f.Opacity,strokeColor:f.StrokeColor,thickness:f.Thickness,annotName:f.AnnotName,comments:this.pdfViewer.annotationModule.getAnnotationComments(f.Comments,f,f.Author),author:f.Author,allowedInteractions:f.allowedInteractions,subject:f.Subject,modifiedDate:f.ModifiedDate,review:{state:"",stateModel:"",modifiedDate:f.ModifiedDate,author:f.Author},notes:f.Note,annotationSettings:f.AnnotationSettings,annotationSelectorSettings:d,customData:p,isPrint:c,isCommentLock:f.IsCommentLock},this.pdfViewer.add(h),u=f.pageIndex||f.PageNumber,g=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",u),this.pdfViewer.renderDrawing(g,h.pageIndex),this.pdfViewer.annotationModule.storeAnnotations(h.pageIndex,h,"_annotations_ink"),this.isAddAnnotationProgramatically&&(m={opacity:h.opacity,strokeColor:h.strokeColor,thickness:h.thickness,modifiedDate:h.modifiedDate,width:h.bounds.width,height:h.bounds.height,data:this.outputString},this.pdfViewer.fireAnnotationAdd(h.pageIndex,h.annotName,"Ink",l,m)),this.pdfViewerBase.currentSignatureAnnot=null,this.pdfViewerBase.signatureCount++,this.pdfViewerBase.inkCount++,this.pdfViewerBase.navigationPane)&&this.pdfViewerBase.navigationPane.annotationMenuObj&&this.pdfViewer.isSignatureEditable&&(this.pdfViewerBase.navigationPane.annotationMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Export Annotations")],!0),this.pdfViewerBase.navigationPane.annotationMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Export XFDF")],!0))}}},A1t.prototype.saveImportedInkAnnotation=function(e,t){var i=e.Bounds,i={x:i.X,y:i.Y,width:i.Width,height:i.Height},n=this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e),o=this.pdfViewer.annotation.getCustomData(e),r=this.pdfViewer.annotationModule.getAnnotationComments(e.Comments,e,e.Author),s={state:e.State,stateModel:e.StateModel,modifiedDate:e.ModifiedDate,author:e.Author},a=e.AnnotationSettings||this.pdfViewer.annotationModule.updateAnnotationSettings(e),l=this.getSettings(e),h=e.PathData;"object"==typeof h&&1<h.length?h=ubt(h):!e.IsPathData&&1<h.split("command").length&&(h=ubt(JSON.parse(h))),n={allowedInteractions:n,annotName:e.AnnotName,annotationSelectorSettings:l,annotationSettings:a,author:e.Author,bounds:i,customData:o,comments:r,data:h,id:"Ink",isCommentLock:e.IsCommentLock,isLocked:e.IsLocked,isPrint:e.IsPrint,modifiedDate:e.ModifiedDate,note:e.Note,opacity:e.Opacity,pageIndex:t,review:s,shapeAnnotationType:e.AnnotationType,strokeColor:e.StrokeColor,subject:e.Subject,thickness:e.Thickness},this.pdfViewer.annotationModule.storeAnnotations(t,n,"_annotations_ink")},A1t.prototype.getSettings=function(e){this.pdfViewer.annotationSelectorSettings;return e.AnnotationSelectorSettings||this.getSelector(e.ShapeAnnotationType,e.Subject)},A1t.prototype.storeInkSignatureData=function(e,t){this.pdfViewer.annotation.addAction(t.pageIndex,null,t,"Addition","",t,t);var i=t.bounds.left||t.bounds.x,n=t.bounds.top||t.bounds.y,n=(t.wrapper&&t.wrapper.bounds&&(i=t.wrapper.bounds.left,n=t.wrapper.bounds.top),i={id:t.id,bounds:{x:i,y:n,width:t.bounds.width,height:t.bounds.height},shapeAnnotationType:"Ink",opacity:t.opacity,thickness:t.thickness,strokeColor:t.strokeColor,pageIndex:t.pageIndex,data:t.data,annotName:t.annotName,comments:t.comments,author:t.author,subject:t.subject,modifiedDate:t.modifiedDate,review:{state:"",stateModel:"",modifiedDate:t.modifiedDate,author:t.author},notes:t.notes,annotationSelectorSettings:this.getSelector(t,"Ink"),isCommentLock:t.isCommentLock},ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_ink"));e=n?(t=JSON.parse(n),ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_ink"),null!=(n=this.pdfViewer.annotationModule.getPageCollection(t,e))&&t[parseInt(n.toString(),10)]?(t[parseInt(n.toString(),10)].annotations.push(i),t[parseInt(n.toString(),10)].annotations.indexOf(i)):((n={pageIndex:e,annotations:[]}).annotations.push(i),n.annotations.indexOf(i),t.push(n)),JSON.stringify(t)):((n={pageIndex:e,annotations:[]}).annotations.push(i),n.annotations.indexOf(i),(t=[]).push(n),JSON.stringify(t)),ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_ink",e)},A1t.prototype.getSelector=function(e,t){var i=this.pdfViewer.annotationSelectorSettings;return"Ink"!==e&&"Ink"!==t||!this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings||(i=this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings,this.pdfViewerBase.updateSelectorSettings(i)),i},A1t.prototype.getAnnotations=function(e,t){var i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_ink");return i&&(i=JSON.parse(i),null!=(e=this.pdfViewer.annotationModule.getPageCollection(i,e)))&&i[parseInt(e.toString(),10)]?i[parseInt(e.toString(),10)].annotations:t},A1t.prototype.modifySignatureInkCollection=function(e,t,i){je(i.formFieldAnnotationType)||""===i.formFieldAnnotationType?this.pdfViewer.annotationModule.isFormFieldShape=!1:this.pdfViewer.annotationModule.isFormFieldShape=!0,this.pdfViewerBase.updateDocumentEditedProperty(!0);var n=null,o=this.getAnnotations(t,null);if(null!=o&&i){for(var r=0;r<o.length;r++)if(i.id===o[parseInt(r.toString(),10)].id){if("bounds"===e)this.pdfViewerBase.isBounds=this.pdfViewerBase.boundsCalculation(o[parseInt(r.toString(),10)].bounds,i.wrapper.bounds),this.pdfViewerBase.isBounds&&(o[parseInt(r.toString(),10)].bounds={x:i.wrapper.bounds.left,y:i.wrapper.bounds.top,width:i.bounds.width,height:i.bounds.height});else if("stroke"===e)o[parseInt(r.toString(),10)].strokeColor=i.wrapper.children[0].style.strokeColor;else if("opacity"===e)o[parseInt(r.toString(),10)].opacity=i.wrapper.children[0].style.opacity;else if("thickness"===e)o[parseInt(r.toString(),10)].thickness=i.wrapper.children[0].style.strokeWidth;else if("notes"===e)o[parseInt(r.toString(),10)].notes=i.notes;else if("delete"===e){n=o.splice(r,1)[0];break}this.pdfViewerBase.isBounds&&(o[parseInt(r.toString(),10)].modifiedDate=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime()),this.pdfViewer.annotationModule.storeAnnotationCollections(o[parseInt(r.toString(),10)],t)}this.manageInkAnnotations(o,t)}return n},A1t.prototype.manageInkAnnotations=function(e,t){var i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_ink");i&&(i=JSON.parse(i),ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_ink"),null!=(t=this.pdfViewer.annotationModule.getPageCollection(i,t))&&i[parseInt(t.toString(),10)]&&(i[parseInt(t.toString(),10)].annotations=e),t=JSON.stringify(i),ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_ink",t))},A1t.prototype.updateInkCollections=function(e,t,i){var n,o,r,s,a,l,h;if(e)return n=(s=e.Bounds).X,o=s.Y,r=s.Width,s=s.Height,a=e.customData,l=e.isPrint,e.AllowedInteractions=e.AllowedInteractions||this.pdfViewer.annotationModule.updateAnnotationAllowedInteractions(e),e.AnnotationSettings=e.AnnotationSettings||this.pdfViewer.inkAnnotationSettings||this.pdfViewer.annotationSettings,e.IsLocked&&(e.AnnotationSettings.isLock=e.IsLocked),h=e.PathData,i&&(h=ubt(JSON.parse(e.PathData))),{id:"ink"+this.pdfViewerBase.signatureCount,bounds:{x:n,y:o,width:r,height:s},pageIndex:t,data:h,shapeAnnotationType:"Ink",opacity:e.Opacity,strokeColor:e.StrokeColor,thickness:e.Thickness,annotationId:e.AnnotName,customData:a,comments:this.pdfViewer.annotationModule.getAnnotationComments(e.Comments,e,e.Author),author:e.Author,allowedInteractions:e.AllowedInteractions,subject:e.Subject,modifiedDate:e.ModifiedDate,review:{state:"",stateModel:"",modifiedDate:e.ModifiedDate,author:e.Author},notes:e.Note,isPrint:l,isCommentLock:e.IsCommentLock,annotationSettings:e.AnnotationSettings,isLocked:e.AnnotationSettings.isLock}},A1t.prototype.updateAddAnnotationDetails=function(e,t,i){t=e?e.offset||{x:10,y:10}:(e={offset:{x:10,y:10},pageNumber:0,width:void 0,height:void 0}).offset;var n=this.pdfViewer.annotation.stickyNotesAnnotationModule.getDateAndTime(),o=this.pdfViewer.annotation.createGUID(),r=this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings,s=(this.pdfViewerBase.updateSelectorSettings(r),this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.inkAnnotationSettings)),a=(e.author=e.author||this.pdfViewer.annotationModule.updateAnnotationAuthor("ink",s.AnnotationType),this.pdfViewer.inkAnnotationSettings.allowedInteractions||this.pdfViewer.annotationSettings.allowedInteractions),l=(s.isLock=e.isLock||s.isLock,e.width=e.width||150,e.height=e.height||60,e.path||""),h=(je(l)||(l="M"===l[0]||"L"===l[0]?(h=cbt(rbt(l)),JSON.stringify(h)):ubt(JSON.parse(l))),e.path=l,[]),l={AllowedInteractions:e.allowedInteractions||a,AnnotName:o,AnnotType:"ink",AnnotationFlags:null,AnnotationSelectorSettings:e.annotationSelectorSettings||r,AnnotationSettings:s,AnnotationType:"Ink",Author:e.author||"Guest",Bounds:{X:t.x,Y:t.y,Width:e.width,Height:e.height,Left:t.x,Top:t.y,Location:{X:t.x,Y:t.y},Size:{Height:e.height,IsEmpty:!1,Width:e.width}},Comments:null,CreatedDate:n,CustomData:e.customData||null,ExistingCustomData:null,IsCommentLock:!1,IsLock:e.isLock||!1,IsPrint:!!je(e.isPrint)||e.isPrint,ModifiedDate:"",Note:"",Opacity:e.opacity||1,PathData:e.path,PageNumber:i,State:"",StateModel:"",StrokeColor:e.strokeColor||"rgba(255,0,0,1)",SubType:null,Subject:e.subject||"Ink",Type:null,Thickness:e.thickness||1};return h[0]=l,{signatureInkAnnotation:h}};var bAt,wAt,CAt,SAt,AAt,xAt,IAt,TAt,EAt,DAt,MAt,kAt,PAt,BAt,FAt,LAt,RAt,OAt,NAt,VAt,_At,HAt,zAt,jAt,WAt,QAt,UAt,qAt,GAt,YAt,XAt,KAt,JAt,ZAt,$At,e1t,t1t,i1t,n1t,o1t,r1t,s1t,a1t,l1t,h1t,d1t,p1t,c1t,u1t,g1t,m1t,f1t,y1t,v1t,b1t,w1t,C1t,S1t=A1t;function A1t(e,t){this.newObject=[],this.outputString="",this.inkAnnotationindex=[],this.isAddAnnotationProgramatically=!1,this.currentPageNumber="",this.inkAnnotationInitialZoom=1,this.inkPathDataCollection=[],this.pdfViewer=e,this.pdfViewerBase=t}(hft=bAt=bAt||{})[hft.default=0]="default",hft[hft.invisible=1]="invisible",hft[hft.hidden=2]="hidden",hft[hft.print=4]="print",hft[hft.noZoom=8]="noZoom",hft[hft.noRotate=16]="noRotate",hft[hft.noView=32]="noView",hft[hft.readOnly=64]="readOnly",hft[hft.locked=128]="locked",hft[hft.toggleNoView=256]="toggleNoView",(cft=wAt=wAt||{})[cft.none=0]="none",cft[cft.openArrow=1]="openArrow",cft[cft.closedArrow=2]="closedArrow",cft[cft.rOpenArrow=3]="rOpenArrow",cft[cft.rClosedArrow=4]="rClosedArrow",cft[cft.butt=5]="butt",cft[cft.diamond=6]="diamond",cft[cft.circle=7]="circle",cft[cft.square=8]="square",cft[cft.slash=9]="slash",(mft=CAt=CAt||{})[mft.lineArrow=0]="lineArrow",mft[mft.lineDimension=1]="lineDimension",(vft=SAt=SAt||{})[vft.start=0]="start",vft[vft.line=1]="line",vft[vft.bezier=3]="bezier",vft[vft.pathTypeMask=7]="pathTypeMask",vft[vft.dashMode=16]="dashMode",vft[vft.pathMarker=32]="pathMarker",vft[vft.closePath=128]="closePath",(Rft=AAt=AAt||{})[Rft.inline=0]="inline",Rft[Rft.top=1]="top",(Tft=xAt=xAt||{})[Tft.solid=0]="solid",Tft[Tft.dashed=1]="dashed",Tft[Tft.beveled=2]="beveled",Tft[Tft.inset=3]="inset",Tft[Tft.underline=4]="underline",Tft[Tft.dot=5]="dot",(Vft=IAt=IAt||{})[Vft.solid=0]="solid",Vft[Vft.cloudy=1]="cloudy",(Bft=TAt=TAt||{})[Bft.angle0=0]="angle0",Bft[Bft.angle90=1]="angle90",Bft[Bft.angle180=2]="angle180",Bft[Bft.angle270=3]="angle270",(d=EAt=EAt||{})[d.table=0]="table",d[d.stream=1]="stream",(Gmt=DAt=DAt||{})[Gmt.noHighlighting=0]="noHighlighting",Gmt[Gmt.invert=1]="invert",Gmt[Gmt.outline=2]="outline",Gmt[Gmt.push=3]="push",(i0=MAt=MAt||{})[i0.left=0]="left",i0[i0.center=1]="center",i0[i0.right=2]="right",i0[i0.justify=3]="justify",(X$e=kAt=kAt||{})[X$e.visible=0]="visible",X$e[X$e.hidden=1]="hidden",X$e[X$e.visibleNotPrintable=2]="visibleNotPrintable",X$e[X$e.hiddenPrintable=3]="hiddenPrintable",(Z$e=PAt=PAt||{})[Z$e.inch=0]="inch",Z$e[Z$e.pica=1]="pica",Z$e[Z$e.point=3]="point",Z$e[Z$e.centimeter=4]="centimeter",Z$e[Z$e.millimeter=6]="millimeter",(Wo=BAt=BAt||{})[Wo.diameter=0]="diameter",Wo[Wo.radius=1]="radius",(Met=FAt=FAt||{})[Met.approved=0]="approved",Met[Met.asIs=1]="asIs",Met[Met.confidential=2]="confidential",Met[Met.departmental=3]="departmental",Met[Met.draft=4]="draft",Met[Met.experimental=5]="experimental",Met[Met.expired=6]="expired",Met[Met.final=7]="final",Met[Met.forComment=8]="forComment",Met[Met.forPublicRelease=9]="forPublicRelease",Met[Met.notApproved=10]="notApproved",Met[Met.notForPublicRelease=11]="notForPublicRelease",Met[Met.sold=12]="sold",Met[Met.topSecret=13]="topSecret",Met[Met.completed=14]="completed",Met[Met.void=15]="void",Met[Met.informationOnly=16]="informationOnly",Met[Met.preliminaryResults=17]="preliminaryResults",(Cet=LAt=LAt||{})[Cet.check=0]="check",Cet[Cet.circle=1]="circle",Cet[Cet.cross=2]="cross",Cet[Cet.diamond=3]="diamond",Cet[Cet.square=4]="square",Cet[Cet.star=5]="star",(N$e=RAt=RAt||{})[N$e.highlight=0]="highlight",N$e[N$e.underline=1]="underline",N$e[N$e.squiggly=2]="squiggly",N$e[N$e.strikeOut=3]="strikeOut",(ts=OAt=OAt||{})[ts.note=0]="note",ts[ts.comment=1]="comment",ts[ts.help=2]="help",ts[ts.insert=3]="insert",ts[ts.key=4]="key",ts[ts.newParagraph=5]="newParagraph",ts[ts.paragraph=6]="paragraph",(d$=NAt=NAt||{})[d$.none=0]="none",d$[d$.accepted=1]="accepted",d$[d$.rejected=2]="rejected",d$[d$.cancel=3]="cancel",d$[d$.completed=4]="completed",d$[d$.marked=5]="marked",d$[d$.unmarked=6]="unmarked",d$[d$.unknown=7]="unknown",(zmt=VAt=VAt||{})[zmt.none=0]="none",zmt[zmt.marked=1]="marked",zmt[zmt.review=2]="review",(Qmt=_At=_At||{})[Qmt.pushPin=0]="pushPin",Qmt[Qmt.tag=1]="tag",Qmt[Qmt.graph=2]="graph",Qmt[Qmt.paperClip=3]="paperClip",(ost=HAt=HAt||{})[ost.none=0]="none",ost[ost.freeTextCallout=1]="freeTextCallout",ost[ost.freeTextTypeWriter=2]="freeTextTypeWriter",(jee=zAt=zAt||{})[jee.location=0]="location",jee[jee.fitToPage=1]="fitToPage",jee[jee.fitR=2]="fitR",jee[jee.fitH=3]="fitH",(Xet=jAt=jAt||{})[Xet.fdf=0]="fdf",Xet[Xet.xfdf=1]="xfdf",Xet[Xet.json=2]="json",Xet[Xet.xml=3]="xml",(det=WAt=WAt||{})[det.none=0]="none",det[det.row=1]="row",det[det.column=2]="column",det[det.structure=3]="structure",det[det.manual=4]="manual",det[det.widget=5]="widget",(q$e=QAt=QAt||{})[q$e.highlight=0]="highlight",q$e[q$e.underline=1]="underline",q$e[q$e.strikeOut=2]="strikeOut",q$e[q$e.squiggly=3]="squiggly",q$e[q$e.redactionAnnotation=4]="redactionAnnotation",q$e[q$e.textAnnotation=5]="textAnnotation",q$e[q$e.linkAnnotation=6]="linkAnnotation",q$e[q$e.documentLinkAnnotation=7]="documentLinkAnnotation",q$e[q$e.uriAnnotation=8]="uriAnnotation",q$e[q$e.fileLinkAnnotation=9]="fileLinkAnnotation",q$e[q$e.freeTextAnnotation=10]="freeTextAnnotation",q$e[q$e.lineAnnotation=11]="lineAnnotation",q$e[q$e.circleAnnotation=12]="circleAnnotation",q$e[q$e.ellipseAnnotation=13]="ellipseAnnotation",q$e[q$e.squareAnnotation=14]="squareAnnotation",q$e[q$e.rectangleAnnotation=15]="rectangleAnnotation",q$e[q$e.polygonAnnotation=16]="polygonAnnotation",q$e[q$e.polyLineAnnotation=17]="polyLineAnnotation",q$e[q$e.textMarkupAnnotation=18]="textMarkupAnnotation",q$e[q$e.caretAnnotation=19]="caretAnnotation",q$e[q$e.rubberStampAnnotation=20]="rubberStampAnnotation",q$e[q$e.popupAnnotation=21]="popupAnnotation",q$e[q$e.fileAttachmentAnnotation=22]="fileAttachmentAnnotation",q$e[q$e.soundAnnotation=23]="soundAnnotation",q$e[q$e.movieAnnotation=24]="movieAnnotation",q$e[q$e.screenAnnotation=25]="screenAnnotation",q$e[q$e.widgetAnnotation=26]="widgetAnnotation",q$e[q$e.printerMarkAnnotation=27]="printerMarkAnnotation",q$e[q$e.trapNetworkAnnotation=28]="trapNetworkAnnotation",q$e[q$e.watermarkAnnotation=29]="watermarkAnnotation",q$e[q$e.textWebLinkAnnotation=30]="textWebLinkAnnotation",q$e[q$e.inkAnnotation=31]="inkAnnotation",q$e[q$e.richMediaAnnotation=32]="richMediaAnnotation",q$e[q$e.angleMeasurementAnnotation=33]="angleMeasurementAnnotation",q$e[q$e.null=34]="null",(W$e=UAt=UAt||{})[W$e.centimeter=0]="centimeter",W$e[W$e.pica=1]="pica",W$e[W$e.pixel=2]="pixel",W$e[W$e.point=3]="point",W$e[W$e.inch=4]="inch",W$e[W$e.document=5]="document",W$e[W$e.millimeter=6]="millimeter",(h=qAt=qAt||{})[h.default=0]="default",h[h.readOnly=1]="readOnly",h[h.required=2]="required",h[h.noExport=4]="noExport",h[h.multiLine=4096]="multiLine",h[h.password=8192]="password",h[h.fileSelect=1048576]="fileSelect",h[h.doNotSpellCheck=4194304]="doNotSpellCheck",h[h.doNotScroll=8388608]="doNotScroll",h[h.comb=16777216]="comb",h[h.richText=33554432]="richText",h[h.noToggleToOff=16384]="noToggleToOff",h[h.radio=32768]="radio",h[h.pushButton=65536]="pushButton",h[h.radiosInUnison=33554432]="radiosInUnison",h[h.combo=131072]="combo",h[h.edit=262144]="edit",h[h.sort=524288]="sort",h[h.multiSelect=2097152]="multiSelect",h[h.commitOnSelectChange=67108864]="commitOnSelectChange",(hft=GAt=GAt||{})[hft.none=0]="none",hft[hft.signatureExists=1]="signatureExists",hft[hft.appendOnly=2]="appendOnly",(cft=YAt=YAt||{})[cft.unchecked=0]="unchecked",cft[cft.checked=1]="checked",cft[cft.pressedUnchecked=2]="pressedUnchecked",cft[cft.pressedChecked=3]="pressedChecked",(mft=XAt=XAt||{})[mft.default=0]="default",mft[mft.print=4]="print",mft[mft.editContent=8]="editContent",mft[mft.copyContent=16]="copyContent",mft[mft.editAnnotations=32]="editAnnotations",mft[mft.fillFields=256]="fillFields",mft[mft.accessibilityCopyContent=512]="accessibilityCopyContent",mft[mft.assembleDocument=1024]="assembleDocument",mft[mft.fullQualityPrint=2048]="fullQualityPrint",(vft=KAt=KAt||{})[vft.portrait=0]="portrait",vft[vft.landscape=1]="landscape",(Rft=JAt=JAt||{})[Rft.none=0]="none",Rft[Rft.leftToRight=1]="leftToRight",Rft[Rft.rightToLeft=2]="rightToLeft",(Tft=ZAt=ZAt||{})[Tft.none=0]="none",Tft[Tft.superScript=1]="superScript",Tft[Tft.subScript=2]="subScript",(Vft=$At=$At||{})[Vft.normal=0]="normal",Vft[Vft.multiply=1]="multiply",Vft[Vft.screen=2]="screen",Vft[Vft.overlay=3]="overlay",Vft[Vft.darken=4]="darken",Vft[Vft.lighten=5]="lighten",Vft[Vft.colorDodge=6]="colorDodge",Vft[Vft.colorBurn=7]="colorBurn",Vft[Vft.hardLight=8]="hardLight",Vft[Vft.softLight=9]="softLight",Vft[Vft.difference=10]="difference",Vft[Vft.exclusion=11]="exclusion",Vft[Vft.hue=12]="hue",Vft[Vft.saturation=13]="saturation",Vft[Vft.color=14]="color",Vft[Vft.luminosity=15]="luminosity",(Bft=e1t=e1t||{})[Bft.winding=0]="winding",Bft[Bft.alternate=1]="alternate",(d=t1t=t1t||{})[d.solid=0]="solid",d[d.dash=1]="dash",d[d.dot=2]="dot",d[d.dashDot=3]="dashDot",d[d.dashDotDot=4]="dashDotDot",d[d.custom=5]="custom",(Gmt=i1t=i1t||{})[Gmt.flat=0]="flat",Gmt[Gmt.round=1]="round",Gmt[Gmt.square=2]="square",(i0=n1t=n1t||{})[i0.miter=0]="miter",i0[i0.round=1]="round",i0[i0.bevel=2]="bevel",(X$e=o1t=o1t||{})[X$e.none=0]="none",X$e[X$e.word=1]="word",X$e[X$e.wordOnly=2]="wordOnly",X$e[X$e.character=3]="character",(Z$e=r1t=r1t||{})[Z$e.fixedPitch=1]="fixedPitch",Z$e[Z$e.serif=2]="serif",Z$e[Z$e.symbolic=4]="symbolic",Z$e[Z$e.script=8]="script",Z$e[Z$e.nonSymbolic=32]="nonSymbolic",Z$e[Z$e.italic=64]="italic",Z$e[Z$e.forceBold=262144]="forceBold",(Wo=s1t=s1t||{})[Wo.apple=0]="apple",Wo[Wo.microsoft=4]="microsoft",Wo[Wo.trimmed=6]="trimmed",(Met=a1t=a1t||{})[Met.unknown=0]="unknown",Met[Met.symbol=1]="symbol",Met[Met.unicode=2]="unicode",Met[Met.macintosh=3]="macintosh",(Cet=l1t=l1t||{})[Cet.appleUnicode=0]="appleUnicode",Cet[Cet.macintosh=1]="macintosh",Cet[Cet.iSO=2]="iSO",Cet[Cet.microsoft=3]="microsoft",(N$e=h1t=h1t||{})[N$e[void 0]=0]="undefined",N$e[N$e.unicode=1]="unicode",(ts=d1t=d1t||{})[ts.roman=0]="roman",ts[ts.japanese=1]="japanese",ts[ts.chinese=2]="chinese",(d$=p1t=p1t||{})[d$.Arg1And2AreWords=1]="Arg1And2AreWords",d$[d$.ArgsAreXyValues=2]="ArgsAreXyValues",d$[d$.RoundXyToGrid=4]="RoundXyToGrid",d$[d$.WeHaveScale=8]="WeHaveScale",d$[d$.Reserved=16]="Reserved",d$[d$.MoreComponents=32]="MoreComponents",d$[d$.WeHaveAnXyScale=64]="WeHaveAnXyScale",d$[d$.WeHaveTwoByTwo=128]="WeHaveTwoByTwo",d$[d$.WeHaveInstructions=256]="WeHaveInstructions",d$[d$.UseMyMetrics=512]="UseMyMetrics",(zmt=c1t=c1t||{})[zmt.unknown=0]="unknown",zmt[zmt.bmp=1]="bmp",zmt[zmt.emf=2]="emf",zmt[zmt.gif=3]="gif",zmt[zmt.jpeg=4]="jpeg",zmt[zmt.png=5]="png",zmt[zmt.wmf=6]="wmf",zmt[zmt.icon=7]="icon",(Qmt=u1t=u1t||{})[Qmt.none=0]="none",Qmt[Qmt.comment=1]="comment",Qmt[Qmt.number=2]="number",Qmt[Qmt.real=3]="real",Qmt[Qmt.string=4]="string",Qmt[Qmt.hexString=5]="hexString",Qmt[Qmt.unicodeString=6]="unicodeString",Qmt[Qmt.unicodeHexString=7]="unicodeHexString",Qmt[Qmt.name=8]="name",Qmt[Qmt.operator=9]="operator",Qmt[Qmt.beginArray=10]="beginArray",Qmt[Qmt.endArray=11]="endArray",Qmt[Qmt.eof=12]="eof",(ost=g1t=g1t||{})[ost.regular=0]="regular",ost[ost.italic=1]="italic",ost[ost.bold=2]="bold",(jee=m1t=m1t||{})[jee.rgb=0]="rgb",jee[jee.cmyk=1]="cmyk",jee[jee.grayScale=2]="grayScale",jee[jee.indexed=3]="indexed",(Xet=f1t=f1t||{})[Xet.none=0]="none",Xet[Xet.numeric=1]="numeric",Xet[Xet.lowerLatin=2]="lowerLatin",Xet[Xet.lowerRoman=3]="lowerRoman",Xet[Xet.upperLatin=4]="upperLatin",Xet[Xet.upperRoman=5]="upperRoman",(det=y1t=y1t||{})[det.none=0]="none",det[det.disk=1]="disk",det[det.square=2]="square",det[det.asterisk=3]="asterisk",det[det.circle=4]="circle",(q$e=v1t=v1t||{})[q$e.paginate=0]="paginate",q$e[q$e.onePage=1]="onePage",(W$e=b1t=b1t||{})[W$e.fitPage=0]="fitPage",W$e[W$e.fitElement=1]="fitElement",(h=w1t=w1t||{})[h.left=0]="left",h[h.right=1]="right",(hft=C1t=C1t||{})[hft.alwaysPrint=0]="alwaysPrint",hft[hft.neverPrint=1]="neverPrint",hft[hft.printWhenVisible=2]="printWhenVisible";I1t.prototype._writeOperator=function(e){this._stream.write(e),this._stream.write(this._newLine)},I1t.prototype._saveGraphicsState=function(){this._writeOperator("q")},I1t.prototype._restoreGraphicsState=function(){this._writeOperator("Q")},I1t.prototype._writeComment=function(e){e&&0<e.length&&this._writeOperator("% "+e)},I1t.prototype._setGraphicsState=function(e){this._stream.write("/"+KMt(e.name)+" "),this._writeOperator("gs")},I1t.prototype._modifyCtm=function(e){this._stream.write(e._toString()+" "),this._writeOperator("cm")},I1t.prototype._modifyTM=function(e){this._stream.write(e._toString()+" "),this._writeOperator("Tm")},I1t.prototype._setColorSpace=function(e,t,i){if("string"==typeof e&&"boolean"==typeof t)this._stream.write("/"+e+" "),this._writeOperator(t?"CS":"cs");else if(Array.isArray(e)&&"number"==typeof t&&"boolean"==typeof i){var n=void 0;switch(t){case m1t.rgb:n="DeviceRGB";break;case m1t.cmyk:n="DeviceCMYK";break;case m1t.grayScale:n="DeviceGray";break;default:n="DeviceRGB"}this._stream.write("/"+n+" "),this._writeOperator(i?"CS":"cs"),this._setColor(e,i)}},I1t.prototype._setColor=function(e,t){this._stream.write((e[0]/255).toFixed(3)+" "+(e[1]/255).toFixed(3)+" "+(e[2]/255).toFixed(3)+" "),this._writeOperator(t?"RG":"rg")},I1t.prototype._appendRectangle=function(e,t,i,n){this._writePoint(e,t),this._writePoint(i,n),this._writeOperator("re")},I1t.prototype._writePoint=function(e,t){this._stream.write(e.toFixed(3)+" "+(-t).toFixed(3)+" ")},I1t.prototype._clipPath=function(e){this._stream.write((e?"W*":"W")+" n"+this._newLine)},I1t.prototype._fillPath=function(e){this._writeOperator(e?"f*":"f")},I1t.prototype._closeFillPath=function(e){this._writeOperator("h"),this._fillPath(e)},I1t.prototype._strokePath=function(){this._writeOperator("S")},I1t.prototype._closeStrokePath=function(){this._writeOperator("s")},I1t.prototype._fillStrokePath=function(e){this._writeOperator(e?"B*":"B")},I1t.prototype._closeFillStrokePath=function(e){this._writeOperator(e?"b*":"b")},I1t.prototype._endPath=function(){this._writeOperator("n")},I1t.prototype._setFont=function(e,t){this._stream.write("/"+e+" "+t.toFixed(3)+" "),this._writeOperator("Tf")},I1t.prototype._setTextScaling=function(e){this._stream.write(e.toFixed(3)+" "),this._writeOperator("Tz")},I1t.prototype._closePath=function(){this._writeOperator("h")},I1t.prototype._startNextLine=function(e,t){void 0===e?this._writeOperator("T*"):(this._writePoint(e,t),this._writeOperator("Td"))},I1t.prototype._setLeading=function(e){this._write(e.toFixed(3)+" "),this._write(this._whiteSpace),this._writeOperator("TL")},I1t.prototype._showText=function(e){this._writeText(e),this._writeOperator("Tj")},I1t.prototype._write=function(e){var t="";this._writeOperator(t+e+"\r\n")},I1t.prototype._writeText=function(e){for(var t="",i=this._escapeSymbols(e),n=0;n<i.length;n++)t+=String.fromCharCode(i[n]);this._stream.write(t="("+t+")")},I1t.prototype._beginText=function(){this._writeOperator("BT")},I1t.prototype._endText=function(){this._writeOperator("ET")},I1t.prototype._beginPath=function(e,t){this._writePoint(e,t),this._writeOperator("m")},I1t.prototype._appendLineSegment=function(e,t){this._writePoint(e,t),this._writeOperator("l")},I1t.prototype._appendBezierSegment=function(e,t,i,n,o,r){this._writePoint(e,t),this._writePoint(i,n),this._writePoint(o,r),this._writeOperator("c")},I1t.prototype._setTextRenderingMode=function(e){this._stream.write(e.toString()+" "),this._writeOperator("Tr")},I1t.prototype._setCharacterSpacing=function(e){this._stream.write(e.toFixed(3)+" "),this._writeOperator("Tc")},I1t.prototype._setWordSpacing=function(e){this._stream.write(e.toFixed(3)+" "),this._writeOperator("Tw")},I1t.prototype._showNextLineText=function(e,t){null!=t&&t?this._writeText(e):this._stream.write(e),this._writeOperator("'")},I1t.prototype._setLineDashPattern=function(e,t){var i="[";if(1<e.length)for(var n=0;n<e.length;n++)n===e.length-1?i+=e[n].toString():i+=e[n].toString()+" ";i=(i+="] ")+t.toString(),this._writeOperator(i+=" d")},I1t.prototype._setMiterLimit=function(e){this._stream.write(e.toFixed(3)+" "),this._writeOperator("M")},I1t.prototype._setLineWidth=function(e){this._stream.write(e.toFixed(3)+" "),this._writeOperator("w")},I1t.prototype._setLineCap=function(e){this._stream.write(e+" "),this._writeOperator("J")},I1t.prototype._setLineJoin=function(e){this._stream.write(e+" "),this._writeOperator("j")},I1t.prototype._executeObject=function(e){this._stream.write("/"+e.name+" "),this._writeOperator("Do")},I1t.prototype._beginMarkupSequence=function(e){this._stream.write("/"+e+" "),this._writeOperator("BMC")},I1t.prototype._endMarkupSequence=function(){this._writeOperator("EMC")},I1t.prototype._clear=function(){this._stream._bytes=[]},I1t.prototype._escapeSymbols=function(e){for(var t=[],i=0;i<e.length;i++){var n=e.charCodeAt(i);switch(n){case 40:case 41:t.push(92),t.push(n);break;case 13:t.push(92),t.push(114);break;case 92:t.push(92),t.push(n);break;default:t.push(n)}}return t};var x1t=I1t;function I1t(e){this._newLine="\r\n",this._whiteSpace=" ",this._stream=e}Object.defineProperty(D1t.prototype,"paragraphIndent",{get:function(){return this._internalParagraphIndent},set:function(e){this._internalParagraphIndent=e,this.firstLineIndent=e},enumerable:!0,configurable:!0}),Object.defineProperty(D1t.prototype,"subSuperScript",{get:function(){return void 0===this._pdfSubSuperScript||null===this._pdfSubSuperScript?ZAt.none:this._pdfSubSuperScript},set:function(e){this._pdfSubSuperScript=e},enumerable:!0,configurable:!0}),Object.defineProperty(D1t.prototype,"_wordWrap",{get:function(){return this._wordWrapType},set:function(e){this._wordWrapType=e},enumerable:!0,configurable:!0});var T1t,E1t=D1t;function D1t(e,t){this.horizontalScalingFactor=100,this.rightToLeft=!1,this._wordWrapType=o1t.word,this._isList=!1,this.lineLimit=!0,void 0!==e&&(this.alignment=e),this.lineAlignment=void 0!==t?t:T1t.top,this.characterSpacing=0,this.wordSpacing=0,this.lineSpacing=0,this.clipPath=!1,this.firstLineIndent=0,this._internalParagraphIndent=0,this.measureTrailingSpaces=!1,this.noClip=!1}(cft=T1t=T1t||{})[cft.top=0]="top",cft[cft.middle=1]="middle",cft[cft.bottom=2]="bottom";M1t=function(e,t){return(M1t=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])}))(e,t)};var M1t,mft=function(e,t){function i(){this.constructor=e}M1t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},k1t=(P1t.prototype._getAscent=function(e){return.001*this._ascent*this._getSize(e)},P1t.prototype._getDescent=function(e){return.001*this._descent*this._getSize(e)},P1t.prototype._getLineGap=function(e){return.001*this._lineGap*this._getSize(e)},P1t.prototype._getHeight=function(e){for(var t=["cambria","candara","constantia","corbel","cariadings"],i=[],n=0;n<t.length;n++)i.push(t[Number.parseInt(n.toString(),10)]);return this._getDescent(e)<0?this._getAscent(e)-this._getDescent(e)+this._getLineGap(e):this._getAscent(e)+this._getDescent(e)+this._getLineGap(e)},P1t.prototype._getSize=function(e){var t=this._size;if(null!=e)switch(e.subSuperScript){case ZAt.subScript:t/=this._subScriptSizeFactor;break;case ZAt.superScript:t/=this._superscriptSizeFactor}return t},P1t);function P1t(){this._lineGap=0}function B1t(){}mft(R1t,F1t=B1t),R1t.prototype._itemAt=function(e){if(e<0||e>=this.widths.length)throw new Error("The character is not supported by the font.");return this.widths[Number.parseInt(e.toString(),10)]},R1t.prototype._toArray=function(){return this.widths};var F1t,L1t=R1t;function R1t(e){var t=F1t.call(this)||this;return t.widths=e,t}mft(V1t,O1t=B1t),V1t.prototype._itemAt=function(t){var i=this._defaultWidth;return this.widths.forEach(function(e){t>=e._from&&t<=e._to&&(i=e._itemAt(t))}),i},V1t.prototype._toArray=function(){var t=[];return this.widths.forEach(function(e){e._appendToArray(t)}),t},V1t.prototype._add=function(e){this.widths.push(e)};var O1t,N1t=V1t;function V1t(e){var t=O1t.call(this)||this;return t._defaultWidth=e,t.widths=[],t}function _1t(){}mft(j1t,H1t=_1t),Object.defineProperty(j1t.prototype,"_from",{get:function(){return this._widthFrom},enumerable:!0,configurable:!0}),Object.defineProperty(j1t.prototype,"_to",{get:function(){return this._widthTo},enumerable:!0,configurable:!0}),j1t.prototype._itemAt=function(e){if(e<this._from||e>this._to)throw new Error("Index is out of range.");return this._width},j1t.prototype._appendToArray=function(e){e.push(this._from,this._to,this._width)};var H1t,z1t=j1t;function j1t(e,t,i){var n=H1t.call(this)||this;return n._widthFrom=e,n._widthTo=t,n._width=i,n}mft(U1t,W1t=_1t),Object.defineProperty(U1t.prototype,"_from",{get:function(){return this._widthFrom},enumerable:!0,configurable:!0}),Object.defineProperty(U1t.prototype,"_to",{get:function(){return this._widthFrom+this._widths.length-1},enumerable:!0,configurable:!0}),U1t.prototype._itemAt=function(e){if(e<this._widthFrom||e>this._to)throw new Error("Index is out of range.");return this._widths[Number.parseInt(e.toString(),10)]},U1t.prototype._appendToArray=function(t){t.push(this._from),t.forEach(function(e){t.push(e)})};var W1t,Q1t=U1t;function U1t(e,t){var i=W1t.call(this)||this;return i._widthFrom=e,i._widths=t,i}G1t.prototype._layout=function(e,t,i,n){this._initialize(e,t,i,n);e=this._doLayout();return this._clear(),e},G1t.prototype._initialize=function(e,t,i,n){this._font=t,this._format=i,this._size=n,this._rectangle=[0,0,n[0],n[1]],this._reader=new Z1t(e),this._pageHeight=0},G1t.prototype._clear=function(){this._font=null,this._format=null,this._reader._close(),this._reader=null},G1t.prototype._doLayout=function(){for(var e=new Y1t,t=(new Y1t,[]),i=this._reader._peekLine(),n=this._getLineIndent(!0);null!==i;){if(null!=(o=this._layoutLine(i,n))){var o=this._copyToResult(e,o,t,0),r=o.success,o=o.flag;if(!r){this._reader._read(o);break}}this._reader._readLine(),i=this._reader._peekLine(),n=this._getLineIndent(!1)}return this._finalizeResult(e,t),e},G1t.prototype._getLineIndent=function(e){var t=0;return this._format&&(t=e?this._format.firstLineIndent:this._format.paragraphIndent,t=0<this._size[0]?Math.min(this._size[0],t):t),t},G1t.prototype._getLineHeight=function(){var e=this._font._metrics._getHeight();return e=this._format&&0!==this._format.lineSpacing?this._format.lineSpacing+this._font._metrics._getHeight():e},G1t.prototype._getLineWidth=function(e){return this._font.getLineWidth(e,this._format)},G1t.prototype._layoutLine=function(e,t){var i=new Y1t,n=(i._lineHeight=this._getLineHeight(),[]),o=this._size[0],r=this._getLineWidth(e)+t,s=K1t.firstParagraphLine,a=!0;if(o<=0||Math.round(r)<=Math.round(o))this._addToLineResult(i,n,e,r,K1t.newLineBreak|s);else{var l="",h="",r=t,d=t,p=new Z1t(e),c=p._peekWord();for(c.length!==p._length&&" "===c&&(h+=c,l+=c,p._position+=1,c=p._peekWord());null!==c;){h+=c;var u,g=this._getLineWidth(h.toString())+d;if(" "===h.toString()&&(h="",g=0),o<g){if(this._getWrapType()===o1t.none)break;if(h.length===c.length){if(this._getWrapType()===o1t.wordOnly){i._remainder=e.substring(p._position);break}if(1===h.length){l+=c;break}a=!1,h="",c=p._peek().toString()}else this._getLineWidth(c.toString())>o?void 0!==this._format&&null!==this._format&&(this._format._wordWrap=o1t.character):void 0!==this._format&&null!==this._format&&(this._format._wordWrap=o1t.word),this._getWrapType()===o1t.character&&a?(a=!1,h="",h+=l.toString(),c=p._peek().toString()):(" "!==(u=l.toString())&&this._addToLineResult(i,n,u,r,K1t.layoutBreak|s),l=h="",g=d=r=0,s=K1t.none,c=a?c:p._peekWord(),a=!0)}else l+=c,r=g,c=a?(p._readWord(),p._peekWord()):(p._read(),p._peek().toString())}0<l.length&&this._addToLineResult(i,n,l.toString(),r,K1t.newLineBreak|K1t.lastParagraphLine),p._close()}i._layoutLines=[];for(var m=0;m<n.length;m++)i._layoutLines.push(n[m]);return n=[],i},G1t.prototype._addToLineResult=function(e,t,i,n,o){var r=new J1t,i=(r._text=i,r._width=n,r._lineType=o,t.push(r),e._actualSize);i[1]=i[1]+this._getLineHeight(),i[0]=Math.max(i[0],n),e._size=i},G1t.prototype._copyToResult=function(e,t,i,n){var o=!0,r=this._format&&!this._format.lineLimit,s=e._actualSize[1],a=this._size[1];if(0<this._pageHeight&&a+this._rectangle[1]>this._pageHeight&&(a=this._rectangle[1]-this._pageHeight,a=Math.max(a,-a)),n=0,null!==t._lines)for(var l=0,h=t._lines.length;l<h;l++){var d=s+t._lineHeight;if(!(d<=a||a<=0||r)){o=!1;break}var p=t._lines[l],c=(n+=p._text.length,p=this._trimLine(p,0===i.length),i.push(p),e._actualSize);c[0]=Math.max(c[0],p._width),e._size=c,s=d}return s!==e._size[1]&&(e._size=[e._actualSize[0],s]),{success:o,flag:n}},G1t.prototype._finalizeResult=function(e,t){e._layoutLines=[];for(var i=0;i<t.length;i++)e._layoutLines.push(t[i]);e._lineHeight=this._getLineHeight(),this._reader._end||(e._remainder=this._reader._readToEnd())},G1t.prototype._trimLine=function(e,t){var i=e._text.trim(),n=e._width;return i.length!==e._text.length&&(n=this._getLineWidth(i),0<(e._lineType&K1t.firstParagraphLine))&&(n+=this._getLineIndent(t)),e._text=i,e._width=n,e},G1t.prototype._getWrapType=function(){return null!==this._format&&void 0!==this._format?this._format._wordWrap:o1t.word};var q1t=G1t;function G1t(){}Object.defineProperty(X1t.prototype,"_actualSize",{get:function(){return void 0===this._size&&(this._size=[0,0]),this._size},enumerable:!0,configurable:!0}),Object.defineProperty(X1t.prototype,"_lines",{get:function(){return this._layoutLines},enumerable:!0,configurable:!0}),Object.defineProperty(X1t.prototype,"_empty",{get:function(){return null===this._layoutLines||0===this._layoutLines.length},enumerable:!0,configurable:!0}),Object.defineProperty(X1t.prototype,"_lineCount",{get:function(){return this._empty?0:this._layoutLines.length},enumerable:!0,configurable:!0});var Y1t=X1t;function X1t(){}var K1t,J1t=function(){},Z1t=((vft=K1t=K1t||{})[vft.none=0]="none",vft[vft.newLineBreak=1]="newLineBreak",vft[vft.layoutBreak=2]="layoutBreak",vft[vft.firstParagraphLine=4]="firstParagraphLine",vft[vft.lastParagraphLine=8]="lastParagraphLine",Object.defineProperty($1t.prototype,"_length",{get:function(){return this._text.length},enumerable:!0,configurable:!0}),Object.defineProperty($1t.prototype,"_end",{get:function(){return this._position===this._text.length},enumerable:!0,configurable:!0}),$1t.prototype._readLine=function(){for(var e,t=this._position;t<this._length;){var i,n=this._text[t];switch(n){case"\r":case"\n":return i=this._text.substring(this._position,t),this._position=t+1,"\r"===n&&this._position<this._length&&"\n"===this._text[this._position]&&this._position++,i}t++}return t>this._position?(e=this._text.substring(this._position,t),this._position=t,e):null},$1t.prototype._peekLine=function(){var e=this._position,t=this._readLine();return this._position=e,t},$1t.prototype._readWord=function(){for(var e,t=this._position;t<this._length;){var i=this._text[t],n=void 0;switch(i){case"\r":case"\n":return n=this._text.substring(this._position,t-this._position),this._position=t+1,"\r"===i&&this._position<this._length&&"\n"===this._text[this._position]&&this._position++,n;case" ":case"\t":return t===this._position&&t++,n=this._text.substring(this._position,t),this._position=t,n}t++}return t>this._position?(e=this._text.substring(this._position,t),this._position=t,e):null},$1t.prototype._peekWord=function(){var e=this._position,t=this._readWord();return this._position=e,t},$1t.prototype._read=function(e){var t;if(void 0===e)return t="0",this._end||(t=this._text[this._position],this._position++),t;for(var i=0,n="";!this._end&&i<e;)n+=this._read(),i++;return n},$1t.prototype._peek=function(){return this._end?"0":this._text[this._position]},$1t.prototype._close=function(){this._text=null},$1t.prototype._readToEnd=function(){var e=0===this._position?this._text:this._text.substring(this._position);return this._position=this._length,e},$1t._spaces=[$1t._whiteSpace=" ",$1t._tab="\t"],$1t);function $1t(e){if(this._position=0,null==e)throw new Error("ArgumentNullException:text");this._text=e}Object.defineProperty(txt.prototype,"_empty",{get:function(){return this._offset===this._length&&this._length===this._checksum&&0===this._checksum},enumerable:!0,configurable:!0});var ext=txt;function txt(){}var ixt=function(){},nxt=function(){},oxt=function(){},rxt=function(){},sxt=function(){},axt=function(){},lxt=function(){},hxt=function(){},dxt=function(){},pxt=function(){},cxt=(Object.defineProperty(uxt.prototype,"macintosh",{get:function(){return null!==this._macintoshDictionary&&void 0!==this._macintoshDictionary||(this._macintoshDictionary=new uPt),this._macintoshDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(uxt.prototype,"_microsoft",{get:function(){return null!==this._microsoftDictionary&&void 0!==this._microsoftDictionary||(this._microsoftDictionary=new uPt),this._microsoftDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(uxt.prototype,"_macintoshGlyphs",{get:function(){return null!==this._internalMacintoshGlyphs&&void 0!==this._internalMacintoshGlyphs||(this._internalMacintoshGlyphs=new uPt),this._internalMacintoshGlyphs},enumerable:!0,configurable:!0}),Object.defineProperty(uxt.prototype,"_microsoftGlyphs",{get:function(){return null!==this._internalMicrosoftGlyphs&&void 0!==this._internalMicrosoftGlyphs||(this._internalMicrosoftGlyphs=new uPt),this._internalMicrosoftGlyphs},enumerable:!0,configurable:!0}),uxt.prototype._initialize=function(){void 0!==this._metrics&&null!==this._metrics||(this._metrics=new mxt),this._readFontDictionary();var e=this._readNameTable(),t=this._readHeadTable();this._initializeFontName(e),this._metrics._macStyle=t._macStyle},uxt.prototype._readFontDictionary=function(){this._offset=0,this._check();var e=this._readInt16(this._offset);this._readInt16(this._offset),this._readInt16(this._offset),this._readInt16(this._offset),void 0!==this._tableDirectory&&null!==this._tableDirectory||(this._tableDirectory=new uPt);for(var t=0;t<e;++t){var i=new ext,n=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(n,i)}this._lowestPosition=this._offset,this._isFont||this._fixOffsets()},uxt.prototype._fixOffsets=function(){for(var e=Number.MAX_VALUE,t=this._tableDirectory.keys(),i=0;i<t.length;i++){var n=(r=this._tableDirectory.getValue(t[Number.parseInt(i.toString(),10)]))._offset;if(n<e&&(e=n)<=this._lowestPosition)break}var o=e-this._lowestPosition;if(0!=o){for(var r,s=new uPt,i=0;i<t.length;i++)(r=this._tableDirectory.getValue(t[Number.parseInt(i.toString(),10)]))._offset-=o,s.setValue(t[Number.parseInt(i.toString(),10)],r);this._tableDirectory=s}},uxt.prototype._check=function(){var e=this._readInt32(this._offset);if(this._isMacTtf=1953658213===e,65536!==e&&1953658213!==e&&1330926671!==e){if(this._isFont=!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),e=this._readInt32(this._offset)}return e},uxt.prototype._readNameTable=function(){for(var e=this._getTable("name"),t=(void 0!==e._offset&&null!==e._offset&&(this._offset=e._offset),new oxt),i=(t._formatSelector=this._readUInt16(this._offset),t._recordsCount=this._readUInt16(this._offset),t._offset=this._readUInt16(this._offset),t._nameRecords=[],this._offset),n=0;n<t._recordsCount;n++){this._offset=i;var o=new gxt,r=(o._platformID=this._readUInt16(this._offset),o._encodingID=this._readUInt16(this._offset),o._languageID=this._readUInt16(this._offset),o._nameID=this._readUInt16(this._offset),o._length=this._readUInt16(this._offset),o._offset=this._readUInt16(this._offset),this._offset=e._offset+t._offset+o._offset,0===o._platformID||3===o._platformID);o._name=this._readString(o._length,r),t._nameRecords[Number.parseInt(n.toString(),10)]=o,i+=12}return t},uxt.prototype._readHeadTable=function(){var e=this._getTable("head"),e=(void 0!==e._offset&&null!==e._offset&&(this._offset=e._offset),new axt);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},uxt.prototype._readHorizontalHeaderTable=function(){var e=this._getTable("hhea"),e=(void 0!==e._offset&&null!==e._offset&&(this._offset=e._offset),new sxt);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},uxt.prototype._readOS2Table=function(){var e=this._getTable("OS/2"),e=(void 0!==e._offset&&null!==e._offset&&(this._offset=e._offset),new ixt);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),1<e._version?(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},uxt.prototype._readPostTable=function(){var e=this._getTable("post"),e=(void 0!==e._offset&&null!==e._offset&&(this._offset=e._offset),new nxt);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},uxt.prototype._readWidthTable=function(e,t){for(var i=this._getTable("hmtx"),n=(void 0!==i._offset&&null!==i._offset&&(this._offset=i._offset),[]),o=0;o<e;o++){var r=new yxt,r=(r._advanceWidth=this._readUInt16(this._offset),r._lsb=this._readInt16(this._offset),1e3*r._advanceWidth/t);n.push(Math.floor(r))}return n},uxt.prototype._readCmapTable=function(){for(var e=this._getTable("cmap"),t=(void 0!==e._offset&&null!==e._offset&&(this._offset=e._offset),new lxt),i=(t._version=this._readUInt16(this._offset),t._tablesCount=this._readUInt16(this._offset),this._offset),n=[],o=0;o<t._tablesCount;o++){this._offset=i;var r=new hxt;r._platformID=this._readUInt16(this._offset),r._encodingID=this._readUInt16(this._offset),r._offset=this._readUInt32(this._offset),i=this._offset,this._readCmapSubTable(r),n[Number.parseInt(o.toString(),10)]=r}return n},uxt.prototype._readCmapSubTable=function(e){var t=this._getTable("cmap"),t=(this._offset=t._offset+e._offset,this._readUInt16(this._offset)),i=this._getCmapEncoding(e._platformID,e._encodingID);if(i!==a1t.unknown)switch(t){case s1t.apple:this._readAppleCmapTable(e,i);break;case s1t.microsoft:this._readMicrosoftCmapTable(e,i);break;case s1t.trimmed:this._readTrimmedCmapTable(e,i)}},uxt.prototype._readAppleCmapTable=function(e,t){var i=this._getTable("cmap"),i=(this._offset=i._offset+e._offset,new dxt);i._format=this._readUInt16(this._offset),i._length=this._readUInt16(this._offset),i._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 vxt;o._index=this._readByte(this._offset),o._width=this._getWidth(o._index),o._charCode=n,this.macintosh.setValue(n,o),this._addGlyph(o,t),this._maxMacIndex=Math.max(n,this._maxMacIndex)}},uxt.prototype._readMicrosoftCmapTable=function(e,t){for(var i=this._getTable("cmap"),n=(this._offset=i._offset+e._offset,t===a1t.unicode?this._microsoft:this.macintosh),o=new rxt,r=(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),o._segCountX2/2),i=(o._endCount=this._readUShortArray(r),o._reservedPad=this._readUInt16(this._offset),o._startCount=this._readUShortArray(r),o._idDelta=this._readUShortArray(r),o._idRangeOffset=this._readUShortArray(r),o._length/2-8-4*r),s=(o._glyphID=this._readUShortArray(i),0),a=0,l=0;l<r;l++)for(var h=o._startCount[Number.parseInt(l.toString(),10)];h<=o._endCount[Number.parseInt(l.toString(),10)]&&65535!==h;h++){if(0===o._idRangeOffset[Number.parseInt(l.toString(),10)])s=h+o._idDelta[Number.parseInt(l.toString(),10)]&65535;else{if((a=l+o._idRangeOffset[Number.parseInt(l.toString(),10)]/2-r+h-o._startCount[Number.parseInt(l.toString(),10)])>=o._glyphID.length)continue;s=o._glyphID[Number.parseInt(a.toString(),10)]+o._idDelta[Number.parseInt(l.toString(),10)]&65535}var d=new vxt,p=(d._index=s,d._width=this._getWidth(d._index),t===a1t.symbol&&61440==(65280&h)?255&h:h);d._charCode=p,n.setValue(p,d),this._addGlyph(d,t)}},uxt.prototype._readTrimmedCmapTable=function(e,t){var i=this._getTable("cmap"),n=(this._offset=i._offset+e._offset,new pxt);n._format=this._readUInt16(this._offset),n._length=this._readUInt16(this._offset),n._version=this._readUInt16(this._offset),n._firstCode=this._readUInt16(this._offset),n._entryCount=this._readUInt16(this._offset);for(var o=0;o<n._entryCount;++o){var r=new vxt;r._index=this._readUInt16(this._offset),r._width=this._getWidth(r._index),r._charCode=o+n._firstCode,this.macintosh.setValue(o,r),this._addGlyph(r,t),this._maxMacIndex=Math.max(o,this._maxMacIndex)}},uxt.prototype._initializeFontName=function(e){for(var t=0;t<e._recordsCount;t++){var i=e._nameRecords[Number.parseInt(t.toString(),10)];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}},uxt.prototype._getTable=function(e){var t,i=new ext;return i=null!=(t=this._tableDirectory.containsKey(e)?this._tableDirectory.getValue(e):t)?t:i},uxt.prototype._getWidth=function(e){return e=e<this._width.length?e:this._width.length-1,this._width[Number.parseInt(e.toString(),10)]},uxt.prototype._getCmapEncoding=function(e,t){var i=a1t.unknown;return e===l1t.microsoft&&t===h1t.undefined?i=a1t.symbol:e===l1t.microsoft&&t===h1t.unicode?i=a1t.unicode:e===l1t.macintosh&&t===d1t.roman&&(i=a1t.macintosh),i},uxt.prototype._addGlyph=function(e,t){var i=null;switch(t){case a1t.unicode:i=this._microsoftGlyphs;break;case a1t.macintosh:case a1t.symbol:i=this._macintoshGlyphs}i.setValue(e._index,e)},uxt.prototype._initializeMetrics=function(e,t,i,n,o,r){this._initializeFontName(e);for(var s=!1,a=0;a<r.length;a++){var l=r[Number.parseInt(a.toString(),10)];if(this._getCmapEncoding(l._platformID,l._encodingID)===a1t.symbol){s=!0;break}}this._metrics._isSymbol=s,this._metrics._macStyle=t._macStyle,this._metrics._isFixedPitch=0!==o._isFixedPitch,this._metrics._italicAngle=o._italicAngle;var e=1e3/t._unitsPerEm,o=(this._metrics._winAscent=n._sTypoAscender*e,this._metrics._macAscent=i._ascender*e,this._metrics._capHeight=0!==n._sCapHeight?n._sCapHeight:.7*t._unitsPerEm*e,this._metrics._winDescent=n._sTypoDescender*e,this._metrics._macDescent=i._descender*e,this._metrics._leading=(n._sTypoAscender-n._sTypoDescender+n._sTypoLineGap)*e,this._metrics._lineGap=Math.ceil(i._lineGap*e),t._xMin*e),i=Math.ceil(this._metrics._macAscent+this._metrics._lineGap),e=t._xMax*e,h=this._metrics._macDescent;this._metrics._fontBox=[o,i,e,h],this._metrics._stemV=80,this._metrics._widthTable=this._updateWidth(),this._metrics._contains=this._tableDirectory.containsKey("CFF"),this._metrics._subScriptSizeFactor=t._unitsPerEm/n._ySubscriptYSize,this._metrics._superscriptSizeFactor=t._unitsPerEm/n._ySuperscriptYSize},uxt.prototype._updateWidth=function(){var e=[];if(this._metrics._isSymbol)for(var t=0;t<256;t++){var i=this._getGlyph(String.fromCharCode(Number.parseInt(t.toString(),10)));e[Number.parseInt(t.toString(),10)]=i._empty?0:i._width}else for(var n=[],o=String.fromCharCode(32),t=0;t<256;t++){n[0]=Number.parseInt(t.toString(),10);var r=this._getString(n,0,n.length),r=0<r.length?r[0]:"?";(i=this._getGlyph(r))._empty?(i=this._getGlyph(o),e[Number.parseInt(t.toString(),10)]=i._empty?0:i._width):e[Number.parseInt(t.toString(),10)]=i._width}return e},uxt.prototype._getDefaultGlyph=function(){return this._getGlyph(Z1t._whiteSpace)},uxt.prototype._getString=function(e,t,i){for(var n="",o=0;o<i;o++)n+=String.fromCharCode(e[o+t]);return n},uxt.prototype._setOffset=function(e){this._offset=e},uxt.prototype._readFontProgram=function(e){var t=this._getGlyphChars(e),i=this._readLocaTable(this._bIsLocaShort),e=(t&&t._size()<e._size()&&(this._missedGlyphs=e._size()-t._size()),this._updateGlyphChars(t,i),this._generateGlyphTable(t,i,null,null)),t=e.glyphTableSize,i=e.newLocaTable,e=e.newGlyphTable,i=this._updateLocaTable(i,this._bIsLocaShort),n=i.newLocaSize,i=i.newLocaUpdated;return this._getFontProgram(i,e,t,n)},uxt.prototype._generateGlyphTable=function(e,t,i,n){i=[];for(var o=e.keys(),r=(o.sort(function(e,t){return e-t}),0),s=0;s<o.length;s++){var a=o[Number.parseInt(s.toString(),10)];0<t._offsets.length&&(r+=t._offsets[a+1]-t._offsets[Number.parseInt(a.toString(),10)])}var l=this._align(r);n=[];for(s=0;s<l;s++)n.push(0);for(var h,d,p=0,c=0,u=this._getTable("glyf"),s=0;s<t._offsets.length;s++)i.push(p),c<o.length&&o[Number.parseInt(c.toString(),10)]===s&&(++c,i[Number.parseInt(s.toString(),10)]=p,h=t._offsets[Number.parseInt(s.toString(),10)],0<(d=t._offsets[s+1]-h))&&(this._offset=u._offset+h,n=this._read(n,p,d).buffer,p+=d);return{glyphTableSize:r,newLocaTable:i,newGlyphTable:n}},uxt.prototype._readLocaTable=function(e){var t=this._getTable("loca"),i=(this._offset=t._offset,new wxt),n=[];if(e)for(var o=t._length/2,n=[],r=0;r<o;r++)n[Number.parseInt(r.toString(),10)]=2*this._readUInt16(this._offset);else{o=t._length/4;n=[];for(r=0;r<o;r++)n[Number.parseInt(r.toString(),10)]=this._readUInt32(this._offset)}return i._offsets=n,i},uxt.prototype._updateGlyphChars=function(e,t){e.containsKey(0)||e.setValue(0,0);for(var i=new uPt,n=e.keys(),o=0;o<n.length;o++)i.setValue(n[Number.parseInt(o.toString(),10)],e.getValue(n[Number.parseInt(o.toString(),10)]));for(o=0;o<n.length;o++){var r=n[Number.parseInt(o.toString(),10)];this._processCompositeGlyph(e,r,t)}},uxt.prototype._processCompositeGlyph=function(e,t,i){if(t<i._offsets.length-1){var n=i._offsets[Number.parseInt(t.toString(),10)];if(n!==i._offsets[t+1]){i=this._getTable("glyf"),t=(this._offset=i._offset+n,new Cxt);if(t.numberOfContours=this._readInt16(this._offset),t.xMin=this._readInt16(this._offset),t.yMin=this._readInt16(this._offset),t.xMax=this._readInt16(this._offset),t.yMax=this._readInt16(this._offset),t.numberOfContours<0)for(var o=0;;){var r=this._readUInt16(this._offset),s=this._readUInt16(this._offset);if(e.containsKey(s)||e.setValue(s,0),0==(r&p1t.MoreComponents))break;o=0!=(r&p1t.Arg1And2AreWords)?4:2,0!=(r&p1t.WeHaveScale)?o+=2:0!=(r&p1t.WeHaveAnXyScale)?o+=4:0!=(r&p1t.WeHaveTwoByTwo)&&(o+=8),this._offset+=o}}}},uxt.prototype._updateLocaTable=function(e,t){for(var i=t?2*e.length:4*e.length,n=this._align(i),o=new Sxt(n),r=0;r<e.length;r++){var s=e[Number.parseInt(r.toString(),10)];t?(s/=2,o._writeShort(s)):o._writeInt(s)}return{newLocaUpdated:o._data,newLocaSize:i}},uxt.prototype._align=function(e){return e+3&-4},uxt.prototype._getFontProgram=function(e,t,i,n){var o=this._getFontProgramLength(e,t,0),r=o.fontProgramLength,o=o.table,r=new Sxt(r),s=(r._writeInt(65536),r._writeShort(o),this._entrySelectors[Number.parseInt(o.toString(),10)]);return r._writeShort(16*(1<<(31&s))),r._writeShort(s),r._writeShort(16*(o-(1<<(31&s)))),this._writeCheckSums(r,o,e,t,i,n),this._writeGlyphs(r,e,t),r._data},uxt.prototype._getFontProgramLength=function(e,t,i){var n=0;if(null!=e&&0<e.length&&null!=t&&0<t.length){i=2;for(var o=this._tableNames,r=0;r<o.length;r++){var s=o[Number.parseInt(r.toString(),10)];"glyf"===s||"loca"===s||(s=this._getTable(s))._empty||(++i,n+=this._align(s._length))}n=(n+=e.length)+t.length+(16*i+12)}return{fontProgramLength:n,table:i}},uxt.prototype._getGlyphChars=function(e){var t=new uPt;if(null!=e)for(var i=e.keys(),n=0;n<i.length;n++){var o=i[Number.parseInt(n.toString(),10)],r=this._getGlyph(o);r._empty||t.setValue(r._index,o.charCodeAt(0))}return t},uxt.prototype._writeCheckSums=function(e,t,i,n,o,r){if(null!=e&&null!=i&&0<i.length&&null!=n&&0<n.length)for(var s=this._tableNames,a=16*t+12,l=0,h=0;h<s.length;h++){var d,p=s[Number.parseInt(h.toString(),10)],c=this._getTable(p);c._empty||(e._writeString(p),l="glyf"===p?(d=this._calculateCheckSum(n),e._writeInt(d),o):"loca"===p?(d=this._calculateCheckSum(i),e._writeInt(d),r):(e._writeInt(c._checksum),c._length),e._writeUInt(a),e._writeUInt(l),a+=this._align(l))}},uxt.prototype._calculateCheckSum=function(e){var t=0,i=0,n=0,o=0,r=0,s=0;if(null!=e&&0<e.length){for(var a=0;a<(e.length+1)/4;a++)r+=255&e[t++],o+=255&e[t++],n+=255&e[t++],i+=255&e[t++];s=i,s=(s+=n<<8)+(o<<16)+(r<<24)}return s},uxt.prototype._writeGlyphs=function(e,t,i){if(null!=e&&null!=t&&0<t.length&&null!=i&&0<i.length)for(var n=this._tableNames,o=0;o<n.length;o++){var r=n[Number.parseInt(o.toString(),10)],s=this._getTable(r);if(!s._empty)if("glyf"===r)e._writeBytes(i);else if("loca"===r)e._writeBytes(t);else{for(var a=this._align(s._length),l=[],h=0;h<a;h++)l.push(0);this._offset=s._offset;r=this._read(l,0,s._length);e._writeBytes(r.buffer)}}},uxt.prototype._read=function(e,t,i){var n=0;if(null!=e&&0<e.length){var o;do{for(var r=0;r<i-n&&this._offset+r<this._fontData.length;r++)e[t+r]=this._fontData[this._offset+r]}while(this._offset+=o=i-n,(n+=o)<i)}return{buffer:e,written:n}},uxt.prototype._createInternals=function(){this._metrics=new mxt;var e=this._readNameTable(),t=this._readHeadTable(),i=(this._bIsLocaShort=0===t._indexToLocalFormat,this._readHorizontalHeaderTable()),n=this._readOS2Table(),o=this._readPostTable(),r=(this._width=this._readWidthTable(i._numberOfHMetrics,t._unitsPerEm),this._readCmapTable());this._initializeMetrics(e,t,i,n,o,r)},uxt.prototype._getGlyph=function(e){var t,i;return"number"==typeof e?(t=null,this._metrics._isSymbol||null===this._microsoftGlyphs?this._metrics._isSymbol&&null!==this._macintoshGlyphs&&this._macintoshGlyphs.containsKey(e)&&(t=this._macintoshGlyphs.getValue(e)):this._microsoftGlyphs.containsKey(e)&&(t=this._microsoftGlyphs.getValue(e)),null!==t?t:this._getDefaultGlyph()):(t=null,i=e.charCodeAt(0),this._metrics._isSymbol||null===this._microsoft?(this._metrics._isSymbol&&null!==this.macintosh||this._isMacFont)&&(0!==this._maxMacIndex?i%=this._maxMacIndex+1:i=61440==(65280&i)?255&i:i,this.macintosh.containsKey(i))&&(t=this.macintosh.getValue(i),this._isFontPresent=!0):this._microsoft.containsKey(i)?(t=this._microsoft.getValue(i),i!==Z1t._whiteSpace.charCodeAt(0)&&(this._isFontPresent=!0)):i!==Z1t._whiteSpace.charCodeAt(0)&&(this._isFontPresent=!1),null!==(t=e===Z1t._whiteSpace&&null===t?new vxt:t)?t:this._getDefaultGlyph())},uxt.prototype._readString=function(e,t){if(null==t)return this._readString(e,!1);var i="";if(t)for(var n=0;n<e;n++)n%2!=0&&(i+=String.fromCharCode(this._fontData[this._offset])),this._offset+=1;else for(n=0;n<e;n++)i+=String.fromCharCode(this._fontData[this._offset]),this._offset+=1;return i},uxt.prototype._readFixed=function(e){return this._readInt16(e)+this._readInt16(e+2)/16384},uxt.prototype._readInt32=function(e){var t=this._fontData[Number.parseInt(e.toString(),10)+3],i=this._fontData[Number.parseInt(e.toString(),10)+2],n=this._fontData[Number.parseInt(e.toString(),10)+1],e=this._fontData[Number.parseInt(e.toString(),10)];return this._offset+=4,t+(i<<8)+(n<<16)+(e<<24)},uxt.prototype._readUInt32=function(e){var t=this._fontData[Number.parseInt(e.toString(),10)+3],i=this._fontData[Number.parseInt(e.toString(),10)+2],n=this._fontData[Number.parseInt(e.toString(),10)+1],e=this._fontData[Number.parseInt(e.toString(),10)];return this._offset+=4,t|i<<8|n<<16|e<<24},uxt.prototype._readInt16=function(e){e=32768&(e=(this._fontData[Number.parseInt(e.toString(),10)]<<8)+this._fontData[Number.parseInt(e.toString(),10)+1])?e-65536:e;return this._offset+=2,e},uxt.prototype._readInt64=function(e){var t=this._readInt32(e+4),e=4294967296*this._readInt32(e)+t;return t<0&&(e+=4294967296),e},uxt.prototype._readUInt16=function(e){e=this._fontData[Number.parseInt(e.toString(),10)]<<8|this._fontData[Number.parseInt(e.toString(),10)+1];return this._offset+=2,e},uxt.prototype._readUShortArray=function(e){for(var t=[],i=0;i<e;i++)t[Number.parseInt(i.toString(),10)]=this._readUInt16(this._offset);return t},uxt.prototype._readBytes=function(e){for(var t=[],i=0;i<e;i++)t.push(this._fontData[Number.parseInt(this._offset.toString(),10)]),this._offset+=1;return t},uxt.prototype._readByte=function(e){e=this._fontData[Number.parseInt(e.toString(),10)];return this._offset+=1,e},uxt.prototype._getCharacterWidth=function(e){e=this._getGlyph(e);return(e=e._empty?this._getDefaultGlyph():e)._empty?0:e._width},uxt.prototype._convertString=function(e){var t="";if(null!=e&&0<e.length)for(var i=0;i<e.length;i++){var n=e[Number.parseInt(i.toString(),10)],n=this._getGlyph(n);n._empty||(t+=String.fromCharCode(n._index))}return t},uxt);function uxt(e){this._int32Size=4,this._isFont=!1,this._isMacTtf=!1,this._isMacFont=!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=e,this._initialize()}var gxt=function(){},mxt=(Object.defineProperty(fxt.prototype,"_isItalic",{get:function(){return 0!=(2&this._macStyle)},enumerable:!0,configurable:!0}),Object.defineProperty(fxt.prototype,"_isBold",{get:function(){return 0!=(1&this._macStyle)},enumerable:!0,configurable:!0}),fxt);function fxt(){}var yxt=function(){},vxt=(Object.defineProperty(bxt.prototype,"_empty",{get:function(){return this._index===this._width&&this._width===this._charCode&&0===this._charCode},enumerable:!0,configurable:!0}),bxt);function bxt(){}var wxt=function(){},Cxt=function(){},Sxt=(Object.defineProperty(Axt.prototype,"_data",{get:function(){if(this._buffer.length<this._bufferLength)for(var e=this._bufferLength-this._buffer.length,t=0;t<e;t++)this._buffer.push(0);return this._buffer},enumerable:!0,configurable:!0}),Object.defineProperty(Axt.prototype,"_position",{get:function(){return void 0!==this._internalPosition&&null!==this._internalPosition||(this._internalPosition=0),this._internalPosition},enumerable:!0,configurable:!0}),Axt.prototype._writeShort=function(e){this._flush([(65280&e)>>8,255&e])},Axt.prototype._writeInt=function(e){this._flush([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])},Axt.prototype._writeUInt=function(e){this._flush([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])},Axt.prototype._writeString=function(e){if(null!=e){for(var t=[],i=0;i<e.length;i++)t.push(e.charCodeAt(i));this._flush(t)}},Axt.prototype._writeBytes=function(e){this._flush(e)},Axt.prototype._flush=function(e){if(null!=e){for(var t=this._position,i=0;i<e.length;i++)this._buffer[Number.parseInt(t.toString(),10)]=e[Number.parseInt(i.toString(),10)],t++;this._internalPosition+=e.length}},Axt);function Axt(e){this.int32Size=4,this.int16Size=2,this.int64Size=8,this._bufferLength=e,this._buffer=[]}Ixt.prototype._beginSave=function(){this._descendantFontBeginSave(),this._cmapBeginSave(),this._fontDictionaryBeginSave(),this._fontProgramBeginSave(),this._fontDescriptor&&(this._fontDescriptor.update("FontFile2",this._fontProgram),this._fontDescriptor._updated=!0,this._fontDescriptor._isFont=!0)},Ixt.prototype._descendantFontBeginSave=function(){var e;null!==this._usedChars&&void 0!==this._usedChars&&0<this._usedChars._size()&&null!==(e=this._getDescendantWidth())&&this._descendantFont.set("W",e)},Ixt.prototype._fontDictionaryBeginSave=function(){null!==this._usedChars&&void 0!==this._usedChars&&0<this._usedChars._size()&&this._fontDictionary.update("ToUnicode",this._cmap)},Ixt.prototype._createInternals=function(){this._fontDictionary=new mPt,this._descendantFont=new mPt,this._metrics=new k1t,this._ttfReader._createInternals(),this._usedChars=null;var e=[];this._fontProgram=new IPt(e,new mPt),this._cmap=new IPt(e,new mPt),this._ttfMetrics=this._ttfReader._metrics,this._initializeMetrics(),this._subsetName=this._getFontName(),this._createDescendantFont(),this._createFontDictionary()},Ixt.prototype._getInternals=function(){return this._fontDictionary},Ixt.prototype._initializeMetrics=function(){var e=this._ttfReader._metrics;this._metrics._ascent=e._macAscent,this._metrics._descent=e._macDescent,this._metrics._height=e._macAscent-e._macDescent+e._lineGap,this._metrics._name=e._fontFamily,this._metrics._postScriptName=e._postScriptName,this._metrics._size=this._fontSize,this._metrics._widthTable=new L1t(e._widthTable),this._metrics._lineGap=e._lineGap,this._metrics._subScriptSizeFactor=e._subScriptSizeFactor,this._metrics._superscriptSizeFactor=e._superscriptSizeFactor,this._metrics._isBold=e._isBold},Ixt.prototype._getFontName=function(){for(var e="",t=0;t<6;t++){var i=Math.floor(26*Math.random())+0;e+=this._nameString[Number.parseInt(i.toString(),10)]}return(e=e+"+"+this._ttfReader._metrics._postScriptName).toString()},Ixt.prototype._createDescendantFont=function(){this._descendantFont=new mPt,this._descendantFont._updated=!0,this._descendantFont.set("Type",new k("Font")),this._descendantFont.set("Subtype",new k("CIDFontType2")),this._descendantFont.set("BaseFont",new k(this._subsetName)),this._descendantFont.set("CIDToGIDMap",new k("Identity")),this._descendantFont.set("DW",1e3),this._fontDescriptor=this._createFontDescriptor(),this._descendantFont.set("FontDescriptor",this._fontDescriptor);var e=this._createSystemInfo();this._descendantFont.set("CIDSystemInfo",e),this._descendantFont._isFont=!0},Ixt.prototype._createFontDescriptor=function(){var e=new mPt,t=this._ttfReader._metrics;return e.set("Type",new k("FontDescriptor")),e.set("FontName",new k(this._subsetName)),e.set("Flags",this._getDescriptorFlags()),e.set("FontBBox",this._getBoundBox()),e.set("MissingWidth",t._widthTable[32]),e.set("StemV",t._stemV),e.set("ItalicAngle",t._italicAngle),e.set("CapHeight",t._capHeight),e.set("Ascent",t._winAscent),e.set("Descent",t._winDescent),e.set("Leading",t._leading),e.set("AvgWidth",t._widthTable[32]),e.set("MaxWidth",t._widthTable[32]),e.set("XHeight",0),e.set("StemH",0),e._updated=!0,e},Ixt.prototype._generateFontProgram=function(){var e;this._usedChars=null===this._usedChars||void 0===this._usedChars?new uPt:this._usedChars,this._ttfReader._setOffset(0),e=this._ttfReader._readFontProgram(this._usedChars),this._fontProgram._clearStream(),this._fontProgram._writeBytes(e)},Ixt.prototype._getBoundBox=function(){var e=this._ttfReader._metrics._fontBox,t=Math.abs(e[2]-e[0]),i=Math.abs(e[1]-e[3]);return[e[0],e[3],t,i]},Ixt.prototype._cmapBeginSave=function(){this._generateCmap()},Ixt.prototype._fontProgramBeginSave=function(){this._generateFontProgram()},Ixt.prototype._toHexString=function(e,t){e=e.toString(16);return t&&(e=e.toUpperCase()),"<0000".substring(0,5-e.length)+e+">"},Ixt.prototype._generateCmap=function(){if(null!==this._usedChars&&void 0!==this._usedChars&&0<this._usedChars._size()){var e=this._ttfReader._getGlyphChars(this._usedChars);if(0<e._size()){for(var t=e.keys().sort(),i=t[0],n=t[t.length-1],i=this._toHexString(i,!1)+this._toHexString(n,!1)+"\r\n",o="",r=(o=(o+=this._cmapPrefix)+i+this._cmapEndCodeSpaceRange,0),s=0;s<t.length;s++){0===r&&(0!==s&&(o+=this._cmapEndRange),o=(o=o+(r=Math.min(100,t.length-s))+" ")+this._cmapBeginRange),--r;var a=t[Number.parseInt(s.toString(),10)],o=(o+=this._toHexString(a,!0)+this._toHexString(a,!0))+(this._toHexString(e.getValue(a),!0)+"\n")}o+=this._cmapSuffix,this._cmap._clearStream(),this._cmap._write(o)}}},Ixt.prototype._createFontDictionary=function(){this._fontDictionary._updated=!0,this._fontDictionary.set("Type",k.get("Font")),this._fontDictionary.set("Subtype",k.get("Type0")),this._fontDictionary.set("BaseFont",new k(this._subsetName)),this._fontDictionary.set("Encoding",k.get("Identity-H")),this._fontDictionary.set("DescendantFonts",this._descendantFont),this._fontDictionary._isFont=!0,this._fontDictionary._currentObj=this},Ixt.prototype._createSystemInfo=function(){var e=new mPt;return e._updated=!0,e.set("Registry","Adobe"),e.set("Ordering","Identity"),e.set("Supplement",0),e},Ixt.prototype._getDescriptorFlags=function(){var e=0,t=this._ttfReader._metrics;return t._isFixedPitch&&(e|=r1t.fixedPitch),t._isSymbol?e|=r1t.symbolic:e|=r1t.nonSymbolic,t._isItalic&&(e|=r1t.italic),t._isBold&&(e|=r1t.forceBold),e},Ixt.prototype._getCharacterWidth=function(e){return this._ttfReader._getCharacterWidth(e)},Ixt.prototype._setSymbols=function(e){if(null!=e){null!==this._usedChars&&void 0!==this._usedChars||(this._usedChars=new uPt);for(var t=0;t<e.length;t++){var i=e[Number.parseInt(t.toString(),10)];this._usedChars.setValue(i,String.fromCharCode(0))}}},Ixt.prototype._getDescendantWidth=function(){var e=new Array;if(null!==this._usedChars&&void 0!==this._usedChars&&0<this._usedChars._size()){for(var t=[],i=this._usedChars.keys(),n=0;n<i.length;n++){var o=i[Number.parseInt(n.toString(),10)],r=this._ttfReader._getGlyph(o);t.push(r)}t.sort(function(e,t){return e._index-t._index});for(var s=0,a=0,l=!1,h=new Array,n=0;n<t.length;n++){r=t[Number.parseInt(n.toString(),10)];l||(l=!0,s=r._index,a=r._index-1),(a+1!==r._index||n+1===t.length)&&1<t.length&&(e.push(Number(s)),0!==n&&e.push(h),s=r._index,h=new Array),h.push(Number(r._width)),n+1===t.length&&(e.push(Number(s)),e.push(h)),a=r._index}}return e};var xxt=Ixt;function Ixt(e,t){if(this._nameString="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this._isEmbedFont=!1,this._cmapPrefix="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\r\n/CIDSystemInfo << /Registry (Adobe)/Ordering (UCS)/Supplement 0>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 beginCodeSpacerange\r\n",this._cmapEndCodeSpaceRange="endCodeSpacerange\r\n",this._cmapBeginRange="beginbfrange\r\n",this._cmapEndRange="endbfrange\r\n",this._cmapSuffix="endbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend end\r\n",null==e)throw new Error("ArgumentNullException:base64String");this._fontSize=t,this._fontData="string"==typeof e?DMt(e):e,this._ttfReader=new cxt(this._fontData),this._ttfMetrics=this._ttfReader._metrics}Ext.prototype._getCharacterShape=function(e,t){if(e>=this._hamza&&e<=this._bwhb){if(this._arabicMapTable.get(e))return this._arabicMapTable.get(e)[t+1]}else if(e>=this._lwawm&&e<=this._lwa);return e},Ext.prototype._shape=function(e){for(var t="",i="",n=0;n<e.length;n++){var o=e[Number.parseInt(n.toString(),10)];"؀"<=o&&o<="ۿ"?i+=o:(0<i.length&&(t+=this._doShape(i.toString(),0),i=""),t+=o)}return 0<i.length&&(t+=this._doShape(i.toString(),0)),t.toString()},Ext.prototype._doShape=function(e,t){for(var i="",n=0,o=0,r=new Dxt,s=new Dxt;o<e.length;){var a,l=e[o++];0===this._ligature(l,s)&&(n=1===(a=this._getShapeCount(l))?0:2,2<r._shapes&&(n+=1),n%=s._shapes,s._shapeValue=this._getCharacterShape(s._shapeValue,n),i=this._append(i,r,t),r=s,(s=new Dxt)._shapeValue=l,s._shapes=a,s._shapeLigature++)}return n=2<r._shapes?1:0,n%=s._shapes,s._shapeValue=this._getCharacterShape(s._shapeValue,n),i=this._append(i,r,t),(i=this._append(i,s,t)).toString()},Ext.prototype._append=function(e,t,i){return""!==t._shapeValue&&(e+=t._shapeValue,--t._shapeLigature,""!==t._shapeType&&(0==(i&this._vowel)&&(e+=t._shapeType),--t._shapeLigature),""!==t._shapeVowel)&&(0==(i&this._vowel)&&(e+=t._shapeVowel),--t._shapeLigature),e},Ext.prototype._ligature=function(e,t){if(""===t._shapeValue)return 0;var i=0;if(e>=this._fathatan&&e<=this._hamzaBelow||e===this._superalef){if(i=1,""!==t._shapeVowel&&e!==this._shadda&&(i=2),e===this._shadda){if(""!==t._shapeType)return 0;t._shapeType=this._shadda}else e===this._hamzaBelow?t._shapeValue===this._alef?(t._shapeValue=this._alefHamzaBelow,i=2):t._shapeValue===this._lwa?(t._shapeValue=this._lwawhb,i=2):t._shapeType=this._hamzaBelow:e===this._hamzaAbove?t._shapeValue===this._alef?(t._shapeValue=this._alefHamza,i=2):t._shapeValue===this._lwa?(t._shapeValue=this._lwawh,i=2):t._shapeValue===this._waw?(t._shapeValue=this._wawHamza,i=2):t._shapeValue===this._yeh||t._shapeValue===this._alefsura||t._shapeValue===this._farsiYeh?(t._shapeValue=this._yehHamza,i=2):t._shapeType=this._hamzaAbove:e===this._madda?t._shapeValue===this._alef&&(t._shapeValue=this._alefMadda,i=2):t._shapeVowel=e;1===i&&t._shapeLigature++}else{if(""!==t._shapeVowel)return 0;t._shapeValue===this._lam&&(e===this._alef?(t._shapeValue=this._lwa,t._shapes=2,i=3):e===this._alefHamza?(t._shapeValue=this._lwawh,t._shapes=2,i=3):e===this._alefHamzaBelow?(t._shapeValue=this._lwawhb,t._shapes=2,i=3):e===this._alefMadda&&(t._shapeValue=this._lwawm,t._shapes=2,i=3))}return i},Ext.prototype._getShapeCount=function(e){if(e>=this._hamza&&e<=this._bwhb&&!(e>=this._fathatan&&e<=this._hamzaBelow||e===this._superalef)){if(this._arabicMapTable.get(e))return this._arabicMapTable.get(e).length-1}else if(e===this._zeroWidthJoiner)return 4;return 1};var Txt=Ext;function Ext(){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._alefsura="ى",this._yeh="ي",this._farsiYeh="ی",this._shadda="ّ",this._madda="ٓ",this._lwa="ﻻ",this._lwawh="ﻷ",this._lwawhb="ﻹ",this._lwawm="ﻵ",this._bwhb="ۓ",this._fathatan="ً",this._superalef="ٰ",this._vowel=1,this._arabicMapTable=new Map;for(var e=0;e<this._arabicCharTable.length;e++)this._arabicMapTable.set(this._arabicCharTable[Number.parseInt(e.toString(),10)][0],this._arabicCharTable[Number.parseInt(e.toString(),10)])}var Dxt=function(){this._shapeValue="",this._shapeType="",this._shapeVowel="",this._shapeLigature=0,this._shapes=1},Mxt=(kxt.prototype._doMirrorShaping=function(e){for(var t,i=[],n=0;n<e.length;n++)1==(1&this._indexLevels[Number.parseInt(n.toString(),10)])&&this._mirroringShape.containsKey(e[Number.parseInt(n.toString(),10)].charCodeAt(0))?(t=e[Number.parseInt(n.toString(),10)].charCodeAt(0),i[Number.parseInt(n.toString(),10)]=String.fromCharCode(this._mirroringShape.getValue(t))):i[Number.parseInt(n.toString(),10)]=e[Number.parseInt(n.toString(),10)].toString();for(var o="",r=0;r<i.length;r++)o+=i[Number.parseInt(r.toString(),10)];return o},kxt.prototype._getLogicalToVisualString=function(e,t){for(var i=new Pxt,n=(this._indexLevels=i._getVisualOrder(e,t),this._setDefaultIndexLevel(),this._doOrder(0,this._indexLevels.length-1),this._doMirrorShaping(e)),o="",r=0;r<this._indexes.length;r++){var s=this._indexes[Number.parseInt(r.toString(),10)];o+=n[Number.parseInt(s.toString(),10)]}return o.toString()},kxt.prototype._setDefaultIndexLevel=function(){for(var e=0;e<this._indexLevels.length;e++)this._indexes[Number.parseInt(e.toString(),10)]=e},kxt.prototype._doOrder=function(e,t){for(var i=this._indexLevels[Number.parseInt(e.toString(),10)],n=i,o=i,r=i,s=e+1;s<=t;++s){var a=this._indexLevels[Number.parseInt(s.toString(),10)];i<a?i=a:a<n&&(n=a),o&=a,r|=a}if(0!=(1&r))if(1==(1&o))this._reArrange(e,t+1);else for(n|=1;n<=i;){for(var l=e;;){for(;l<=t&&!(this._indexLevels[Number.parseInt(l.toString(),10)]>=i);)l+=1;if(t<l)break;for(var h=l+1;h<=t&&!(this._indexLevels[Number.parseInt(h.toString(),10)]<i);)h+=1;this._reArrange(l,h),l=h+1}--i}},kxt.prototype._reArrange=function(e,t){var i=(e+t)/2;for(--t;e<i;++e,--t){var n=this._indexes[Number.parseInt(e.toString(),10)];this._indexes[Number.parseInt(e.toString(),10)]=this._indexes[Number.parseInt(t.toString(),10)],this._indexes[Number.parseInt(t.toString(),10)]=n}},kxt.prototype._update=function(){this._mirroringShape.setValue(40,41),this._mirroringShape.setValue(41,40),this._mirroringShape.setValue(60,62),this._mirroringShape.setValue(62,60),this._mirroringShape.setValue(91,93),this._mirroringShape.setValue(93,91),this._mirroringShape.setValue(123,125),this._mirroringShape.setValue(125,123),this._mirroringShape.setValue(171,187),this._mirroringShape.setValue(187,171),this._mirroringShape.setValue(8249,8250),this._mirroringShape.setValue(8250,8249),this._mirroringShape.setValue(8261,8262),this._mirroringShape.setValue(8262,8261),this._mirroringShape.setValue(8317,8318),this._mirroringShape.setValue(8318,8317),this._mirroringShape.setValue(8333,8334),this._mirroringShape.setValue(8334,8333),this._mirroringShape.setValue(8712,8715),this._mirroringShape.setValue(8713,8716),this._mirroringShape.setValue(8714,8717),this._mirroringShape.setValue(8715,8712),this._mirroringShape.setValue(8716,8713),this._mirroringShape.setValue(8717,8714),this._mirroringShape.setValue(8725,10741),this._mirroringShape.setValue(8764,8765),this._mirroringShape.setValue(8765,8764),this._mirroringShape.setValue(8771,8909),this._mirroringShape.setValue(8786,8787),this._mirroringShape.setValue(8787,8786),this._mirroringShape.setValue(8788,8789),this._mirroringShape.setValue(8789,8788),this._mirroringShape.setValue(8804,8805),this._mirroringShape.setValue(8805,8804),this._mirroringShape.setValue(8806,8807),this._mirroringShape.setValue(8807,8806),this._mirroringShape.setValue(8808,8809),this._mirroringShape.setValue(8809,8808),this._mirroringShape.setValue(8810,8811),this._mirroringShape.setValue(8811,8810),this._mirroringShape.setValue(8814,8815),this._mirroringShape.setValue(8815,8814),this._mirroringShape.setValue(8816,8817),this._mirroringShape.setValue(8817,8816),this._mirroringShape.setValue(8818,8819),this._mirroringShape.setValue(8819,8818),this._mirroringShape.setValue(8820,8821),this._mirroringShape.setValue(8821,8820),this._mirroringShape.setValue(8822,8823),this._mirroringShape.setValue(8823,8822),this._mirroringShape.setValue(8824,8825),this._mirroringShape.setValue(8825,8824),this._mirroringShape.setValue(8826,8827),this._mirroringShape.setValue(8827,8826),this._mirroringShape.setValue(8828,8829),this._mirroringShape.setValue(8829,8828),this._mirroringShape.setValue(8830,8831),this._mirroringShape.setValue(8831,8830),this._mirroringShape.setValue(8832,8833),this._mirroringShape.setValue(8833,8832),this._mirroringShape.setValue(8834,8835),this._mirroringShape.setValue(8835,8834),this._mirroringShape.setValue(8836,8837),this._mirroringShape.setValue(8837,8836),this._mirroringShape.setValue(8838,8839),this._mirroringShape.setValue(8839,8838),this._mirroringShape.setValue(8840,8841),this._mirroringShape.setValue(8841,8840),this._mirroringShape.setValue(8842,8843),this._mirroringShape.setValue(8843,8842),this._mirroringShape.setValue(8847,8848),this._mirroringShape.setValue(8848,8847),this._mirroringShape.setValue(8849,8850),this._mirroringShape.setValue(8850,8849),this._mirroringShape.setValue(8856,10680),this._mirroringShape.setValue(8866,8867),this._mirroringShape.setValue(8867,8866),this._mirroringShape.setValue(8870,10974),this._mirroringShape.setValue(8872,10980),this._mirroringShape.setValue(8873,10979),this._mirroringShape.setValue(8875,10981),this._mirroringShape.setValue(8880,8881),this._mirroringShape.setValue(8881,8880),this._mirroringShape.setValue(8882,8883),this._mirroringShape.setValue(8883,8882),this._mirroringShape.setValue(8884,8885),this._mirroringShape.setValue(8885,8884),this._mirroringShape.setValue(8886,8887),this._mirroringShape.setValue(8887,8886),this._mirroringShape.setValue(8905,8906),this._mirroringShape.setValue(8906,8905),this._mirroringShape.setValue(8907,8908),this._mirroringShape.setValue(8908,8907),this._mirroringShape.setValue(8909,8771),this._mirroringShape.setValue(8912,8913),this._mirroringShape.setValue(8913,8912),this._mirroringShape.setValue(8918,8919),this._mirroringShape.setValue(8919,8918),this._mirroringShape.setValue(8920,8921),this._mirroringShape.setValue(8921,8920),this._mirroringShape.setValue(8922,8923),this._mirroringShape.setValue(8923,8922),this._mirroringShape.setValue(8924,8925),this._mirroringShape.setValue(8925,8924),this._mirroringShape.setValue(8926,8927),this._mirroringShape.setValue(8927,8926),this._mirroringShape.setValue(8928,8929),this._mirroringShape.setValue(8929,8928),this._mirroringShape.setValue(8930,8931),this._mirroringShape.setValue(8931,8930),this._mirroringShape.setValue(8932,8933),this._mirroringShape.setValue(8933,8932),this._mirroringShape.setValue(8934,8935),this._mirroringShape.setValue(8935,8934),this._mirroringShape.setValue(8936,8937),this._mirroringShape.setValue(8937,8936),this._mirroringShape.setValue(8938,8939),this._mirroringShape.setValue(8939,8938),this._mirroringShape.setValue(8940,8941),this._mirroringShape.setValue(8941,8940),this._mirroringShape.setValue(8944,8945),this._mirroringShape.setValue(8945,8944),this._mirroringShape.setValue(8946,8954),this._mirroringShape.setValue(8947,8955),this._mirroringShape.setValue(8948,8956),this._mirroringShape.setValue(8950,8957),this._mirroringShape.setValue(8951,8958),this._mirroringShape.setValue(8954,8946),this._mirroringShape.setValue(8955,8947),this._mirroringShape.setValue(8956,8948),this._mirroringShape.setValue(8957,8950),this._mirroringShape.setValue(8958,8951),this._mirroringShape.setValue(8968,8969),this._mirroringShape.setValue(8969,8968),this._mirroringShape.setValue(8970,8971),this._mirroringShape.setValue(8971,8970),this._mirroringShape.setValue(9001,9002),this._mirroringShape.setValue(9002,9001),this._mirroringShape.setValue(10088,10089),this._mirroringShape.setValue(10089,10088),this._mirroringShape.setValue(10090,10091),this._mirroringShape.setValue(10091,10090),this._mirroringShape.setValue(10092,10093),this._mirroringShape.setValue(10093,10092),this._mirroringShape.setValue(10094,10095),this._mirroringShape.setValue(10095,10094),this._mirroringShape.setValue(10096,10097),this._mirroringShape.setValue(10097,10096),this._mirroringShape.setValue(10098,10099),this._mirroringShape.setValue(10099,10098),this._mirroringShape.setValue(10100,10101),this._mirroringShape.setValue(10101,10100),this._mirroringShape.setValue(10197,10198),this._mirroringShape.setValue(10198,10197),this._mirroringShape.setValue(10205,10206),this._mirroringShape.setValue(10206,10205),this._mirroringShape.setValue(10210,10211),this._mirroringShape.setValue(10211,10210),this._mirroringShape.setValue(10212,10213),this._mirroringShape.setValue(10213,10212),this._mirroringShape.setValue(10214,10215),this._mirroringShape.setValue(10215,10214),this._mirroringShape.setValue(10216,10217),this._mirroringShape.setValue(10217,10216),this._mirroringShape.setValue(10218,10219),this._mirroringShape.setValue(10219,10218),this._mirroringShape.setValue(10627,10628),this._mirroringShape.setValue(10628,10627),this._mirroringShape.setValue(10629,10630),this._mirroringShape.setValue(10630,10629),this._mirroringShape.setValue(10631,10632),this._mirroringShape.setValue(10632,10631),this._mirroringShape.setValue(10633,10634),this._mirroringShape.setValue(10634,10633),this._mirroringShape.setValue(10635,10636),this._mirroringShape.setValue(10636,10635),this._mirroringShape.setValue(10637,10640),this._mirroringShape.setValue(10638,10639),this._mirroringShape.setValue(10639,10638),this._mirroringShape.setValue(10640,10637),this._mirroringShape.setValue(10641,10642),this._mirroringShape.setValue(10642,10641),this._mirroringShape.setValue(10643,10644),this._mirroringShape.setValue(10644,10643),this._mirroringShape.setValue(10645,10646),this._mirroringShape.setValue(10646,10645),this._mirroringShape.setValue(10647,10648),this._mirroringShape.setValue(10648,10647),this._mirroringShape.setValue(10680,8856),this._mirroringShape.setValue(10688,10689),this._mirroringShape.setValue(10689,10688),this._mirroringShape.setValue(10692,10693),this._mirroringShape.setValue(10693,10692),this._mirroringShape.setValue(10703,10704),this._mirroringShape.setValue(10704,10703),this._mirroringShape.setValue(10705,10706),this._mirroringShape.setValue(10706,10705),this._mirroringShape.setValue(10708,10709),this._mirroringShape.setValue(10709,10708),this._mirroringShape.setValue(10712,10713),this._mirroringShape.setValue(10713,10712),this._mirroringShape.setValue(10714,10715),this._mirroringShape.setValue(10715,10714),this._mirroringShape.setValue(10741,8725),this._mirroringShape.setValue(10744,10745),this._mirroringShape.setValue(10745,10744),this._mirroringShape.setValue(10748,10749),this._mirroringShape.setValue(10749,10748),this._mirroringShape.setValue(10795,10796),this._mirroringShape.setValue(10796,10795),this._mirroringShape.setValue(10797,10796),this._mirroringShape.setValue(10798,10797),this._mirroringShape.setValue(10804,10805),this._mirroringShape.setValue(10805,10804),this._mirroringShape.setValue(10812,10813),this._mirroringShape.setValue(10813,10812),this._mirroringShape.setValue(10852,10853),this._mirroringShape.setValue(10853,10852),this._mirroringShape.setValue(10873,10874),this._mirroringShape.setValue(10874,10873),this._mirroringShape.setValue(10877,10878),this._mirroringShape.setValue(10878,10877),this._mirroringShape.setValue(10879,10880),this._mirroringShape.setValue(10880,10879),this._mirroringShape.setValue(10881,10882),this._mirroringShape.setValue(10882,10881),this._mirroringShape.setValue(10883,10884),this._mirroringShape.setValue(10884,10883),this._mirroringShape.setValue(10891,10892),this._mirroringShape.setValue(10892,10891),this._mirroringShape.setValue(10897,10898),this._mirroringShape.setValue(10898,10897),this._mirroringShape.setValue(10899,10900),this._mirroringShape.setValue(10900,10899),this._mirroringShape.setValue(10901,10902),this._mirroringShape.setValue(10902,10901),this._mirroringShape.setValue(10903,10904),this._mirroringShape.setValue(10904,10903),this._mirroringShape.setValue(10905,10906),this._mirroringShape.setValue(10906,10905),this._mirroringShape.setValue(10907,10908),this._mirroringShape.setValue(10908,10907),this._mirroringShape.setValue(10913,10914),this._mirroringShape.setValue(10914,10913),this._mirroringShape.setValue(10918,10919),this._mirroringShape.setValue(10919,10918),this._mirroringShape.setValue(10920,10921),this._mirroringShape.setValue(10921,10920),this._mirroringShape.setValue(10922,10923),this._mirroringShape.setValue(10923,10922),this._mirroringShape.setValue(10924,10925),this._mirroringShape.setValue(10925,10924),this._mirroringShape.setValue(10927,10928),this._mirroringShape.setValue(10928,10927),this._mirroringShape.setValue(10931,10932),this._mirroringShape.setValue(10932,10931),this._mirroringShape.setValue(10939,10940),this._mirroringShape.setValue(10940,10939),this._mirroringShape.setValue(10941,10942),this._mirroringShape.setValue(10942,10941),this._mirroringShape.setValue(10943,10944),this._mirroringShape.setValue(10944,10943),this._mirroringShape.setValue(10945,10946),this._mirroringShape.setValue(10946,10945),this._mirroringShape.setValue(10947,10948),this._mirroringShape.setValue(10948,10947),this._mirroringShape.setValue(10949,10950),this._mirroringShape.setValue(10950,10949),this._mirroringShape.setValue(10957,10958),this._mirroringShape.setValue(10958,10957),this._mirroringShape.setValue(10959,10960),this._mirroringShape.setValue(10960,10959),this._mirroringShape.setValue(10961,10962),this._mirroringShape.setValue(10962,10961),this._mirroringShape.setValue(10963,10964),this._mirroringShape.setValue(10964,10963),this._mirroringShape.setValue(10965,10966),this._mirroringShape.setValue(10966,10965),this._mirroringShape.setValue(10974,8870),this._mirroringShape.setValue(10979,8873),this._mirroringShape.setValue(10980,8872),this._mirroringShape.setValue(10981,8875),this._mirroringShape.setValue(10988,10989),this._mirroringShape.setValue(10989,10988),this._mirroringShape.setValue(10999,11e3),this._mirroringShape.setValue(11e3,10999),this._mirroringShape.setValue(11001,11002),this._mirroringShape.setValue(11002,11001),this._mirroringShape.setValue(12296,12297),this._mirroringShape.setValue(12297,12296),this._mirroringShape.setValue(12298,12299),this._mirroringShape.setValue(12299,12298),this._mirroringShape.setValue(12300,12301),this._mirroringShape.setValue(12301,12300),this._mirroringShape.setValue(12302,12303),this._mirroringShape.setValue(12303,12302),this._mirroringShape.setValue(12304,12305),this._mirroringShape.setValue(12305,12304),this._mirroringShape.setValue(12308,12309),this._mirroringShape.setValue(12309,12308),this._mirroringShape.setValue(12310,12311),this._mirroringShape.setValue(12311,12310),this._mirroringShape.setValue(12312,12313),this._mirroringShape.setValue(12313,12312),this._mirroringShape.setValue(12314,12315),this._mirroringShape.setValue(12315,12314),this._mirroringShape.setValue(65288,65289),this._mirroringShape.setValue(65289,65288),this._mirroringShape.setValue(65308,65310),this._mirroringShape.setValue(65310,65308),this._mirroringShape.setValue(65339,65341),this._mirroringShape.setValue(65341,65339),this._mirroringShape.setValue(65371,65373),this._mirroringShape.setValue(65373,65371),this._mirroringShape.setValue(65375,65376),this._mirroringShape.setValue(65376,65375),this._mirroringShape.setValue(65378,65379),this._mirroringShape.setValue(65379,65378)},kxt);function kxt(){this._indexes=[],this._indexLevels=[],this._mirroringShape=new uPt,this._update()}Bxt.prototype._getVisualOrder=function(e,t){this._type=this._getCharacterCode(e),this._textOrder=t?this.lre:this.L,this._doVisualOrder();for(var i=[],n=0;n<this._levels.length;n++)i[Number.parseInt(n.toString(),10)]=this._levels[Number.parseInt(n.toString(),10)];return i},Bxt.prototype._getCharacterCode=function(e){for(var t=[],i=0;i<e.length;i++){var n=e[Number.parseInt(i.toString(),10)].charCodeAt(0);t[Number.parseInt(i.toString(),10)]=this._rtlCharacterTypes[Number.parseInt(n.toString(),10)]}return t},Bxt.prototype._setDefaultLevels=function(){for(var e=0;e<this._length;e++)this._levels[Number.parseInt(e.toString(),10)]=this._textOrder},Bxt.prototype._setLevels=function(){this._setDefaultLevels();for(var e=0;e<this._length;++e){var t=this._levels[Number.parseInt(e.toString(),10)];this._levels[Number.parseInt(e.toString(),10)]=t}},Bxt.prototype._updateLevels=function(e,t,i){if(0==(1&t))for(var n=e;n<i;++n)this._result[Number.parseInt(n.toString(),10)]===this.R?this._levels[Number.parseInt(n.toString(),10)]+=1:this._result[Number.parseInt(n.toString(),10)]!==this.L&&(this._levels[Number.parseInt(n.toString(),10)]+=2);else for(n=e;n<i;++n)this._result[Number.parseInt(n.toString(),10)]!==this.R&&(this._levels[Number.parseInt(n.toString(),10)]+=1)},Bxt.prototype._doVisualOrder=function(){this._length=this._type.length,this._result=this._type,this._levels=[],this._setLevels(),this._length=this._getEmbeddedCharactersLength();for(var e=this._textOrder,t=0;t<this._length;){for(var i=this._levels[Number.parseInt(t.toString(),10)],n=0==(1&Math.max(e,i))?this.L:this.R,o=t+1;o<this._length&&this._levels[Number.parseInt(o.toString(),10)]===i;)++o;var r=o<this._length?this._levels[Number.parseInt(o.toString(),10)]:this._textOrder,r=0==(1&Math.max(r,i))?this.L:this.R;this._check(t,o,i,n,r),this._updateLevels(t,i,o),e=i,t=o}this._checkEmbeddedCharacters(this._length)},Bxt.prototype._getEmbeddedCharactersLength=function(){for(var e=0,t=0;t<this._length;++t)this._type[Number.parseInt(t.toString(),10)]!==this.lre&&this._type[Number.parseInt(t.toString(),10)]!==this.rle&&this._type[Number.parseInt(t.toString(),10)]!==this.lro&&this._type[Number.parseInt(t.toString(),10)]!==this.rlo&&this._type[Number.parseInt(t.toString(),10)]!==this.pdf&&this._type[Number.parseInt(t.toString(),10)]!==this.BN&&(this._result[Number.parseInt(e.toString(),10)]=this._result[Number.parseInt(t.toString(),10)],this._levels[Number.parseInt(e.toString(),10)]=this._levels[Number.parseInt(t.toString(),10)],e++);return e},Bxt.prototype._checkEmbeddedCharacters=function(e){for(var t=this._type.length-1;0<=t;--t)this._type[Number.parseInt(t.toString(),10)]===this.lre||this._type[Number.parseInt(t.toString(),10)]===this.rle||this._type[Number.parseInt(t.toString(),10)]===this.lro||this._type[Number.parseInt(t.toString(),10)]===this.rlo||this._type[Number.parseInt(t.toString(),10)]===this.pdf||this._type[Number.parseInt(t.toString(),10)]===this.BN?(this._result[Number.parseInt(t.toString(),10)]=this._type[Number.parseInt(t.toString(),10)],this._levels[Number.parseInt(t.toString(),10)]=-1):(--e,this._result[Number.parseInt(t.toString(),10)]=this._result[Number.parseInt(e.toString(),10)],this._levels[Number.parseInt(t.toString(),10)]=this._levels[Number.parseInt(e.toString(),10)]);for(t=0;t<this._type.length;t++)-1===this._levels[Number.parseInt(t.toString(),10)]&&(this._levels[Number.parseInt(t.toString(),10)]=this._levels[t-1])},Bxt.prototype._check=function(e,t,i,n,o){for(var r=n,s=e;s<t;++s)this._result[Number.parseInt(s.toString(),10)]===this.nsm?this._result[Number.parseInt(s.toString(),10)]=r:r=this._result[Number.parseInt(s.toString(),10)];this._checkEuropeanDigits(e,t,i,n,o)},Bxt.prototype._checkEuropeanDigits=function(e,t,i,n,o){for(var r=e;r<t;++r)if(this._result[Number.parseInt(r.toString(),10)]===this.EN)for(var s=r-1;e<=s;--s)if(this._result[Number.parseInt(s.toString(),10)]===this.L||this._result[Number.parseInt(s.toString(),10)]===this.R||this._result[Number.parseInt(s.toString(),10)]===this.AL){this._result[Number.parseInt(s.toString(),10)]===this.AL&&(this._result[Number.parseInt(r.toString(),10)]=this.AN);break}this._checkArabicCharacters(e,t,i,n,o)},Bxt.prototype._checkArabicCharacters=function(e,t,i,n,o){for(var r=e;r<t;++r)this._result[Number.parseInt(r.toString(),10)]===this.AL&&(this._result[Number.parseInt(r.toString(),10)]=this.R);this._checkEuropeanNumberSeparator(e,t,i,n,o)},Bxt.prototype._checkEuropeanNumberSeparator=function(e,t,i,n,o){for(var r,s,a=e+1;a<t-1;++a)this._result[Number.parseInt(a.toString(),10)]!==this.ES&&this._result[Number.parseInt(a.toString(),10)]!==this.CS||(r=this._result[a-1],s=this._result[a+1],r===this.EN&&s===this.EN?this._result[Number.parseInt(a.toString(),10)]=this.EN:this._result[Number.parseInt(a.toString(),10)]===this.CS&&r===this.AN&&s===this.AN&&(this._result[Number.parseInt(a.toString(),10)]=this.AN));this._checkEuropeanNumberTerminator(e,t,i,n,o)},Bxt.prototype._checkEuropeanNumberTerminator=function(e,t,i,n,o){for(var r,s,a=e;a<t;++a)this._result[Number.parseInt(a.toString(),10)]===this.ET&&(r=a,(s=[]).push(this.ET),s=this._getLength(r,t,s),(r===e?n:this._result[r-1])!==this.EN&&(s===t||this._result[Number.parseInt(s.toString(),10)]),a=s);this._checkOtherNeutrals(e,t,i,n,o)},Bxt.prototype._checkOtherNeutrals=function(e,t,i,n,o){for(var r=e;r<t;++r)this._result[Number.parseInt(r.toString(),10)]!==this.ES&&this._result[Number.parseInt(r.toString(),10)]!==this.ET&&this._result[Number.parseInt(r.toString(),10)]!==this.CS||(this._result[Number.parseInt(r.toString(),10)]=this.ON);this._checkOtherCharacters(e,t,i,n,o)},Bxt.prototype._checkOtherCharacters=function(e,t,i,n,o){for(var r=e;r<t;++r)if(this._result[Number.parseInt(r.toString(),10)]===this.EN){for(var s=n,a=r-1;e<=a;--a)if(this._result[Number.parseInt(a.toString(),10)]===this.L||this._result[Number.parseInt(a.toString(),10)]===this.R){s=this._result[Number.parseInt(a.toString(),10)];break}s===this.L&&(this._result[Number.parseInt(r.toString(),10)]=this.L)}this._checkCharacters(e,t,i,n,o)},Bxt.prototype._getLength=function(e,t,i){for(--e;++e<t;){for(var n=this._result[Number.parseInt(e.toString(),10)],o=0;o<i.length;++o)n===i[Number.parseInt(o.toString(),10)]&&(e=this._getLength(++e,t,i));return e}return t},Bxt.prototype._checkCharacters=function(e,t,i,n,o){for(var r=e;r<t;++r)if(this._result[Number.parseInt(r.toString(),10)]===this.WS||this._result[Number.parseInt(r.toString(),10)]===this.ON||this._result[Number.parseInt(r.toString(),10)]===this.B||this._result[Number.parseInt(r.toString(),10)]===this.S){var s=r,a=[this.B,this.S,this.WS,this.ON],l=this._getLength(s,t,a),a=0,h=0,d=0;s===e?a=n:(a=this._result[s-1])!==this.AN&&a!==this.EN||(a=this.R),l===t?h=o:(h=this._result[Number.parseInt(l.toString(),10)])===this.AN&&(h=this.R);for(var d=a===h?a:0==(1&i)?this.L:this.R,p=s;p<l;++p)this._result[Number.parseInt(p.toString(),10)]=d;r=l}};var Pxt=Bxt;function Bxt(){this._type=[],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 e=0;e<this._charTypes.length;++e)for(var t=this._charTypes[Number.parseInt(e.toString(),10)],i=this._charTypes[++e],n=this._charTypes[++e];t<=i;)this._rtlCharacterTypes[t++]=n}Lxt.prototype._layout=function(e,t,i,n,o){var r=[];return null!=t&&null!=e&&(t._isUnicode?r=this._customLayout(e,i,o,t,n):(r=[])[0]=e),r},Lxt.prototype._splitLayout=function(e,t,i,n,o){var r=[];return null!=t&&null!=e&&(r=this._customSplitLayout(e,t,i,n,o)),r},Lxt.prototype._getGlyphIndex=function(e,t,i){if(i=[],null!=t&&null!=e){if(0===e.length)return{_result:!1,_glyphIndex:i};for(var n=(new Txt)._shape(e),o=t._fontInternal._ttfReader,r=(i=[n.length],0),s=0,a=n.length;s<a;s++){var l=n[Number.parseInt(s.toString(),10)],l=o._getGlyph(l);null!=l&&(i[r++]=l._index)}}e=new iIt;return e._result=!0,e._glyphIndex=i,e},Lxt.prototype._customLayout=function(e,t,i,n,o){if(null==o)return(s=null)!=e&&null!=i&&i.textDirection!==JAt.none?(new Mxt)._getLogicalToVisualString(e,t):s;var r="",s=[];if(null!=e&&null!=n)if(null!=i&&i.textDirection!==JAt.none&&(e=(new Txt)._shape(e),r=this._customLayout(e,t,i)),o){for(var a=r.split(""),l=a.length,h=0;h<l;h++)a[Number.parseInt(h.toString(),10)]=this._addCharacter(n,a[Number.parseInt(h.toString(),10)]);s=a}else(s=[])[0]=this._addCharacter(n,r);return s},Lxt.prototype._addCharacter=function(e,t){var i;return null!=e&&null!=t&&(i=e._fontInternal._ttfReader,e._setSymbols(t),t=CMt(AMt(t=i._convertString(t)))),t},Lxt.prototype._customSplitLayout=function(e,t,i,n,o){var r=[];return r=null!=e?this._customLayout(e,i,o).split(""):r};var Fxt=Lxt;function Lxt(){this._openBracket="(",this._closeBracket=")"}Rxt=function(e,t){return(Rxt=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])}))(e,t)};var Rxt,Rft=function(e,t){function i(){this.constructor=e}Rxt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Oxt=(Object.defineProperty(Nxt.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(Nxt.prototype,"style",{get:function(){return this._style},set:function(e){this._style=e},enumerable:!0,configurable:!0}),Object.defineProperty(Nxt.prototype,"isUnderline",{get:function(){return 0<(this.style&Jxt.underline)},enumerable:!0,configurable:!0}),Object.defineProperty(Nxt.prototype,"isStrikeout",{get:function(){return 0<(this.style&Jxt.strikeout)},enumerable:!0,configurable:!0}),Object.defineProperty(Nxt.prototype,"_metrics",{get:function(){return this._fontMetrics},set:function(e){this._fontMetrics=e},enumerable:!0,configurable:!0}),Object.defineProperty(Nxt.prototype,"isBold",{get:function(){return 0<(this.style&Jxt.bold)},enumerable:!0,configurable:!0}),Object.defineProperty(Nxt.prototype,"isItalic",{get:function(){return 0<(this.style&Jxt.italic)},enumerable:!0,configurable:!0}),Object.defineProperty(Nxt.prototype,"height",{get:function(){return this._metrics._getHeight()},enumerable:!0,configurable:!0}),Nxt.prototype._setInternals=function(e){if(!e)throw new Error("ArgumentNullException:internals");this._pdfFontInternals=e},Nxt.prototype._getCharacterCount=function(e,t){if("string"==typeof t){for(var i=0,n=0,n=e.indexOf(t,n);-1!==n;)i++,n=e.indexOf(t,++n);return i}for(var o=0,r=0;r<e.length;r++)-1!==t.indexOf(e[Number.parseInt(r.toString(),10)])&&o++;return o},Nxt.prototype.measureString=function(e,t,i,n,o){var r,s;return"string"==typeof e&&void 0===t?this.measureString(e,null):"string"==typeof e&&(t instanceof E1t||null===t)&&void 0===i&&void 0===n?this.measureString(e,r=t,0,0):"string"==typeof e&&(t instanceof E1t||null===t)&&"number"==typeof i&&"number"==typeof n?this.measureString(e,0,r=t,i,n):"string"==typeof e&&"number"==typeof t&&(i instanceof E1t||null===i)&&"number"==typeof n&&"number"==typeof o?this.measureString(e,[t,0],s=i,n,o):(r=t,s=i,t=(new q1t)._layout(e,this,s,r),n=e.length,o=t._empty?0:t._lines.length,t._actualSize)},Nxt.prototype._applyFormatSettings=function(e,t,i){var n=i;return null!=t&&0<i&&(0!==t.characterSpacing&&(n+=(e.length-1)*t.characterSpacing),0!==t.wordSpacing)&&(n+=this._getCharacterCount(e,[" ","\t"])*t.wordSpacing),n},Nxt);function Nxt(e,t){"number"==typeof e&&void 0===t?this._size=e:(this._size=e,this._style=t)}Rft(Hxt,Vxt=Oxt),Object.defineProperty(Hxt.prototype,"fontFamily",{get:function(){return this._fontFamily},enumerable:!0,configurable:!0}),Hxt.prototype._checkStyle=function(){this._fontFamily!==Zxt.symbol&&this._fontFamily!==Zxt.zapfDingbats||(this._style&=~(Jxt.bold|Jxt.italic))},Hxt.prototype.getLineWidth=function(e,t){for(var i=0,n=0,o=e.length;n<o;n++)i+=this._getCharacterWidthInternal(e[Number.parseInt(n.toString(),10)]);return i*=.001*this._metrics._size,i=this._applyFormatSettings(e,t,i)},Hxt.prototype._initializeInternals=function(){this._metrics=Gxt._getMetrics(this._fontFamily,this._style,this._size),this._dictionary=this._createInternals()},Hxt.prototype._createInternals=function(){var e=new mPt;return e._updated=!0,e.set("Type",k.get("Font")),e.set("Subtype",k.get("Type1")),e.set("BaseFont",new k(this._metrics._postScriptName)),this._fontFamily!==Zxt.symbol&&this._fontFamily!==Zxt.zapfDingbats&&e.set("Encoding",new k("WinAnsiEncoding")),e},Hxt.prototype._getCharacterWidthInternal=function(e){e=e.charCodeAt(0);return"Helvetica"!==this._metrics._name&&"Courier"!==this._metrics._name&&"TimesRoman"!==this._metrics._name&&"Symbol"!==this._metrics._name&&"ZapfDingbats"!==this._metrics._name||(e-=32),this._metrics._widthTable._itemAt(e=0<=e&&128!==e?e:0)};var Vxt,_xt=Hxt;function Hxt(e,t,i){t=Vxt.call(this,t,void 0===i?Jxt.regular:i)||this;return t._fontFamily=e,t._checkStyle(),t._initializeInternals(),t}Rft(Wxt,zxt=Oxt),Object.defineProperty(Wxt.prototype,"fontFamily",{get:function(){return this._fontFamily},enumerable:!0,configurable:!0}),Wxt.prototype._initializeInternals=function(){this._metrics=Xxt._getMetrics(this._fontFamily,this._style,this._size),this._dictionary=this._createInternals()},Wxt.prototype._createInternals=function(){var e=new mPt;return e._updated=!0,e.set("Type",k.get("Font")),e.set("Subtype",k.get("Type0")),e.set("BaseFont",new k(this._metrics._postScriptName)),e.set("Encoding",this._getEncoding(this._fontFamily)),e.set("DescendantFonts",this._getDescendantFont()),e},Wxt.prototype._getEncoding=function(e){var t="Unknown";switch(e){case $xt.hanyangSystemsGothicMedium:case $xt.hanyangSystemsShinMyeongJoMedium:t="UniKS-UCS2-H";break;case $xt.heiseiKakuGothicW5:case $xt.heiseiMinchoW3:t="UniJIS-UCS2-H";break;case $xt.monotypeHeiMedium:case $xt.monotypeSungLight:t="UniCNS-UCS2-H";break;case $xt.sinoTypeSongLight:t="UniGB-UCS2-H"}return new k(t)},Wxt.prototype._getDescendantFont=function(){var e=new mPt;return e._updated=!0,e.set("Type",k.get("Font")),e.set("Subtype",k.get("CIDFontType2")),e.set("BaseFont",new k(this._metrics._postScriptName)),e.set("DW",this._metrics._widthTable._defaultWidth),e.set("W",this._metrics._widthTable._toArray()),e.set("FontDescriptor",eIt._getFontDescriptor(this._fontFamily,this._style,this._metrics)),e.set("CIDSystemInfo",this._getSystemInformation()),[e]},Wxt.prototype._getSystemInformation=function(){var e=new mPt;switch(e._updated=!0,e.set("Registry","Adobe"),this._fontFamily){case $xt.hanyangSystemsGothicMedium:case $xt.hanyangSystemsShinMyeongJoMedium:e.set("Ordering","Korea1"),e.set("Supplement",1);break;case $xt.heiseiKakuGothicW5:case $xt.heiseiMinchoW3:e.set("Ordering","Japan1"),e.set("Supplement",2);break;case $xt.monotypeHeiMedium:case $xt.monotypeSungLight:e.set("Ordering","CNS1"),e.set("Supplement","0");break;case $xt.sinoTypeSongLight:e.set("Ordering","GB1"),e.set("Supplement",2)}return e},Wxt.prototype.getLineWidth=function(e,t){for(var i=0,n=0;n<e.length;n++)i+=this._getCharacterWidthInternal(e.charCodeAt(n));return i*=.001*this._metrics._size,i=this._applyFormatSettings(e,t,i)},Wxt.prototype._getCharacterWidthInternal=function(e){return this._metrics._widthTable._itemAt(e=0<=e?e:0)};var zxt,jxt=Wxt;function Wxt(e,t,i){i=zxt.call(this,t,void 0===i?Jxt.regular:i)||this;return i._fontFamily=e,i._size=t,i._initializeInternals(),i}Rft(qxt,Qxt=Oxt),Object.defineProperty(qxt.prototype,"isUnicode",{get:function(){return this._isUnicode},enumerable:!0,configurable:!0}),Object.defineProperty(qxt.prototype,"isEmbed",{get:function(){return this._isEmbedFont},enumerable:!0,configurable:!0}),qxt.prototype._createFontInternal=function(e,t){this._fontInternal=new xxt(e,this._size),this.style=t,this._initializeInternals()},qxt.prototype._initializeInternals=function(){var e;this._fontInternal instanceof xxt&&(this._fontInternal._isEmbed=this._isEmbedFont),this._fontInternal._createInternals(),e=this._fontInternal._getInternals(),this._metrics=this._fontInternal._metrics,this._metrics._isUnicodeFont=!0,this._setInternals(e)},qxt.prototype.getLineWidth=function(e,t){var i=0;if(null!=t&&t.textDirection!==JAt.none)i=this._getUnicodeLineWidth(e,i);else for(var n=0,o=e.length;n<o;n++)i+=this._getCharacterWidthInternal(e[Number.parseInt(n.toString(),10)]);return i*=.001*this._metrics._size,i=this._applyFormatSettings(e,t,i)},qxt.prototype._getUnicodeLineWidth=function(e,t){t=0;var i=[],e=(new Fxt)._getGlyphIndex(e,this,i),n=e._result,i=e._glyphIndex;if(n&&null!==i)for(var o=this._fontInternal._ttfReader,r=0,s=i.length;r<s;r++){var a=i[Number.parseInt(r.toString(),10)],a=o._getGlyph(a);null!=a&&(t+=a._width)}return t},qxt.prototype._getCharacterWidth=function(e,t){e=this._fontInternal._getCharacterWidth(e);return e*=.001*this._metrics._getSize(t)},qxt.prototype._setSymbols=function(e){var t=this._fontInternal;null!=t&&t._setSymbols(e)},qxt.prototype._getCharacterWidthInternal=function(e){e=e.charCodeAt(0);return this._metrics._widthTable._itemAt(0<=e&&128!==e?e:0)};var Qxt,Uxt=qxt;function qxt(e,t,i){t=Qxt.call(this,t,void 0===i?Jxt.regular:i)||this;return t._isEmbedFont=!1,t._isUnicode=!0,void 0!==i?t._createFontInternal(e,i):t._createFontInternal(e,Jxt.regular),t}Yxt._getMetrics=function(e,t,i){var n=null;switch(e){case Zxt.helvetica:(n=this._getHelveticaMetrics(t,i))._name="Helvetica";break;case Zxt.courier:(n=this._getCourierMetrics(t,i))._name="Courier";break;case Zxt.timesRoman:(n=this._getTimesMetrics(t,i))._name="TimesRoman";break;case Zxt.symbol:(n=this._getSymbolMetrics(i))._name="Symbol";break;case Zxt.zapfDingbats:(n=this._getZapfDingbatsMetrics(i))._name="ZapfDingbats";break;default:(n=this._getHelveticaMetrics(t,i))._name="Helvetica"}return n._subScriptSizeFactor=this._subSuperScriptFactor,n._superscriptSizeFactor=this._subSuperScriptFactor,n},Yxt._getHelveticaMetrics=function(e,t){var i=new k1t;return 0<(e&Jxt.bold)&&0<(e&Jxt.italic)?(i._ascent=this._helveticaBoldItalicAscent,i._descent=this._helveticaBoldItalicDescent,i._postScriptName=this._helveticaBoldItalicName,i._size=t,i._widthTable=new L1t(this._arialBoldWidth)):0<(e&Jxt.bold)?(i._ascent=this._helveticaBoldAscent,i._descent=this._helveticaBoldDescent,i._postScriptName=this._helveticaBoldName,i._size=t,i._widthTable=new L1t(this._arialBoldWidth)):(0<(e&Jxt.italic)?(i._ascent=this._helveticaItalicAscent,i._descent=this._helveticaItalicDescent,i._postScriptName=this._helveticaItalicName):(i._ascent=this._helveticaAscent,i._descent=this._helveticaDescent,i._postScriptName=this._helveticaName),i._size=t,i._widthTable=new L1t(this._arialWidth)),i._height=i._ascent-i._descent,i},Yxt._getCourierMetrics=function(e,t){var i=new k1t;return 0<(e&Jxt.bold)&&0<(e&Jxt.italic)?(i._ascent=this._courierBoldItalicAscent,i._descent=this._courierBoldItalicDescent,i._postScriptName=this._courierBoldItalicName):0<(e&Jxt.bold)?(i._ascent=this._courierBoldAscent,i._descent=this._courierBoldDescent,i._postScriptName=this._courierBoldName):0<(e&Jxt.italic)?(i._ascent=this._courierItalicAscent,i._descent=this._courierItalicDescent,i._postScriptName=this._courierItalicName):(i._ascent=this._courierAscent,i._descent=this._courierDescent,i._postScriptName=this._courierName),i._size=t,i._widthTable=new L1t(this._fixedWidth),i._height=i._ascent-i._descent,i},Yxt._getTimesMetrics=function(e,t){var i=new k1t;return 0<(e&Jxt.bold)&&0<(e&Jxt.italic)?(i._ascent=this._timesBoldItalicAscent,i._descent=this._timesBoldItalicDescent,i._postScriptName=this._timesBoldItalicName,i._size=t,i._widthTable=new L1t(this._timesRomanBoldItalicWidths)):0<(e&Jxt.bold)?(i._ascent=this._timesBoldAscent,i._descent=this._timesBoldDescent,i._postScriptName=this._timesBoldName,i._size=t,i._widthTable=new L1t(this._timesRomanBoldWidth)):0<(e&Jxt.italic)?(i._ascent=this._timesItalicAscent,i._descent=this._timesItalicDescent,i._postScriptName=this._timesItalicName,i._size=t,i._widthTable=new L1t(this._timesRomanItalicWidth)):(i._ascent=this._timesAscent,i._descent=this._timesDescent,i._postScriptName=this._timesName,i._size=t,i._widthTable=new L1t(this._timesRomanWidth)),i._height=i._ascent-i._descent,i},Yxt._getSymbolMetrics=function(e){var t=new k1t;return t._ascent=this._symbolAscent,t._descent=this._symbolDescent,t._postScriptName=this._symbolName,t._size=e,t._widthTable=new L1t(this._symbolWidth),t._height=t._ascent-t._descent,t},Yxt._getZapfDingbatsMetrics=function(e){var t=new k1t;return t._ascent=this._zapfDingbatsAscent,t._descent=this._zapfDingbatsDescent,t._postScriptName=this._zapfDingbatsName,t._size=e,t._widthTable=new L1t(this._zapfDingbatsWidth),t._height=t._ascent-t._descent,t},Yxt._subSuperScriptFactor=1.52,Yxt._helveticaAscent=931,Yxt._helveticaDescent=-225,Yxt._helveticaName="Helvetica",Yxt._helveticaBoldAscent=962,Yxt._helveticaBoldDescent=-228,Yxt._helveticaBoldName="Helvetica-Bold",Yxt._helveticaItalicAscent=931,Yxt._helveticaItalicDescent=-225,Yxt._helveticaItalicName="Helvetica-Oblique",Yxt._helveticaBoldItalicAscent=962,Yxt._helveticaBoldItalicDescent=-228,Yxt._helveticaBoldItalicName="Helvetica-BoldOblique",Yxt._courierAscent=805,Yxt._courierDescent=-250,Yxt._courierName="Courier",Yxt._courierBoldAscent=801,Yxt._courierBoldDescent=-250,Yxt._courierBoldName="Courier-Bold",Yxt._courierItalicAscent=805,Yxt._courierItalicDescent=-250,Yxt._courierItalicName="Courier-Oblique",Yxt._courierBoldItalicAscent=801,Yxt._courierBoldItalicDescent=-250,Yxt._courierBoldItalicName="Courier-BoldOblique",Yxt._timesAscent=898,Yxt._timesDescent=-218,Yxt._timesName="Times-Roman",Yxt._timesBoldAscent=935,Yxt._timesBoldDescent=-218,Yxt._timesBoldName="Times-Bold",Yxt._timesItalicAscent=883,Yxt._timesItalicDescent=-217,Yxt._timesItalicName="Times-Italic",Yxt._timesBoldItalicAscent=921,Yxt._timesBoldItalicDescent=-218,Yxt._timesBoldItalicName="Times-BoldItalic",Yxt._symbolAscent=1010,Yxt._symbolDescent=-293,Yxt._symbolName="Symbol",Yxt._zapfDingbatsAscent=820,Yxt._zapfDingbatsDescent=-143,Yxt._zapfDingbatsName="ZapfDingbats",Yxt._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],Yxt._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],Yxt._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],Yxt._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],Yxt._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],Yxt._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],Yxt._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],Yxt._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],Yxt._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];var Gxt=Yxt;function Yxt(){}Kxt._getHanyangSystemsGothicMedium=function(e,t){var i=new k1t,n=new N1t(1e3);return n._add(new z1t(1,127,500)),n._add(new z1t(8094,8190,500)),i._widthTable=n,i._ascent=880,i._descent=-120,i._size=t,i._height=i._ascent-i._descent,0!=(e&Jxt.bold)&&0!=(e&Jxt.italic)?i._postScriptName="HYGoThic-Medium,BoldItalic":0!=(e&Jxt.bold)?i._postScriptName="HYGoThic-Medium,Bold":0!=(e&Jxt.italic)?i._postScriptName="HYGoThic-Medium,Italic":i._postScriptName="HYGoThic-Medium",i},Kxt._getHanyangSystemsShinMyeongJoMedium=function(e,t){var i=new k1t,n=new N1t(1e3);return n._add(new z1t(1,95,500)),n._add(new z1t(8094,8190,500)),i._widthTable=n,i._ascent=880,i._descent=-120,i._size=t,i._height=i._ascent-i._descent,0!=(e&Jxt.bold)&&0!=(e&Jxt.italic)?i._postScriptName="HYSMyeongJo-Medium,BoldItalic":0!=(e&Jxt.bold)?i._postScriptName="HYSMyeongJo-Medium,Bold":0!=(e&Jxt.italic)?i._postScriptName="HYSMyeongJo-Medium,Italic":i._postScriptName="HYSMyeongJo-Medium",i},Kxt._getHeiseiKakuGothicW5=function(e,t){var i=new k1t,n=new N1t(1e3);return n._add(new z1t(1,95,500)),n._add(new z1t(231,632,500)),i._widthTable=n,i._ascent=857,i._descent=-125,i._size=t,i._height=i._ascent-i._descent,0!=(e&Jxt.bold)&&0!=(e&Jxt.italic)?i._postScriptName="HeiseiKakuGo-W5,BoldItalic":0!=(e&Jxt.bold)?i._postScriptName="HeiseiKakuGo-W5,Bold":0!=(e&Jxt.italic)?i._postScriptName="HeiseiKakuGo-W5,Italic":i._postScriptName="HeiseiKakuGo-W5",i},Kxt._getHeiseiMinchoW3=function(e,t){var i=new k1t,n=new N1t(1e3);return n._add(new z1t(1,95,500)),n._add(new z1t(231,632,500)),i._widthTable=n,i._ascent=857,i._descent=-143,i._size=t,i._height=i._ascent-i._descent,0!=(e&Jxt.bold)&&0!=(e&Jxt.italic)?i._postScriptName="HeiseiMin-W3,BoldItalic":0!=(e&Jxt.bold)?i._postScriptName="HeiseiMin-W3,Bold":0!=(e&Jxt.italic)?i._postScriptName="HeiseiMin-W3,Italic":i._postScriptName="HeiseiMin-W3",i},Kxt._getMonotypeHeiMedium=function(e,t){var i=new k1t,n=new N1t(1e3);return n._add(new z1t(1,95,500)),n._add(new z1t(13648,13742,500)),i._widthTable=n,i._ascent=880,i._descent=-120,i._size=t,i._height=i._ascent-i._descent,0!=(e&Jxt.bold)&&0!=(e&Jxt.italic)?i._postScriptName="MHei-Medium,BoldItalic":0!=(e&Jxt.bold)?i._postScriptName="MHei-Medium,Bold":0!=(e&Jxt.italic)?i._postScriptName="MHei-Medium,Italic":i._postScriptName="MHei-Medium",i},Kxt._getMonotypeSungLight=function(e,t){var i=new k1t,n=new N1t(1e3);return n._add(new z1t(1,95,500)),n._add(new z1t(13648,13742,500)),i._widthTable=n,i._ascent=880,i._descent=-120,i._size=t,i._height=i._ascent-i._descent,0!=(e&Jxt.bold)&&0!=(e&Jxt.italic)?i._postScriptName="MSung-Light,BoldItalic":0!=(e&Jxt.bold)?i._postScriptName="MSung-Light,Bold":0!=(e&Jxt.italic)?i._postScriptName="MSung-Light,Italic":i._postScriptName="MSung-Light",i},Kxt._getSinoTypeSongLight=function(e,t){var i=new k1t,n=new N1t(1e3);return n._add(new z1t(1,95,500)),n._add(new z1t(814,939,500)),n._add(new Q1t(7712,[500])),n._add(new Q1t(7716,[500])),i._ascent=880,i._descent=-120,i._size=t,i._height=i._ascent-i._descent,0!=(e&Jxt.bold)&&0!=(e&Jxt.italic)?i._postScriptName="STSong-Light,BoldItalic":0!=(e&Jxt.bold)?i._postScriptName="STSong-Light,Bold":0!=(e&Jxt.italic)?i._postScriptName="STSong-Light,Italic":i._postScriptName="STSong-Light",i._widthTable=n,i},Kxt._getMetrics=function(e,t,i){var n;switch(e){case $xt.hanyangSystemsGothicMedium:(n=this._getHanyangSystemsGothicMedium(t,i))._name="HanyangSystemsGothicMedium";break;case $xt.hanyangSystemsShinMyeongJoMedium:(n=this._getHanyangSystemsShinMyeongJoMedium(t,i))._name="HanyangSystemsShinMyeongJoMedium";break;case $xt.heiseiKakuGothicW5:(n=this._getHeiseiKakuGothicW5(t,i))._name="HeiseiKakuGothicW5";break;case $xt.heiseiMinchoW3:(n=this._getHeiseiMinchoW3(t,i))._name="HeiseiMinchoW3";break;case $xt.monotypeHeiMedium:(n=this._getMonotypeHeiMedium(t,i))._name="MonotypeHeiMedium";break;case $xt.monotypeSungLight:(n=this._getMonotypeSungLight(t,i))._name="MonotypeSungLight";break;case $xt.sinoTypeSongLight:(n=this._getSinoTypeSongLight(t,i))._name="SinoTypeSongLight"}return n._subScriptSizeFactor=this._subSuperScriptFactor,n._superscriptSizeFactor=this._subSuperScriptFactor,n},Kxt._subSuperScriptFactor=1.52;var Xxt=Kxt;function Kxt(){}tIt._fillMonotypeSungLight=function(e,t,i){this._fillFontBox(e,{x:-160,y:-249,width:1175,height:1137}),this._fillKnownInformation(e,t,i),e.set("StemV",93),e.set("StemH",93),e.set("AvgWidth",1e3),e.set("MaxWidth",1e3),e.set("CapHeight",880),e.set("XHeight",616),e.set("Leading",250)},tIt._fillHeiseiKakuGothicW5=function(e,t,i,n){(t&(Jxt.italic|Jxt.bold))!==Jxt.italic?this._fillFontBox(e,{x:-92,y:-250,width:1102,height:1172}):this._fillFontBox(e,{x:-92,y:-250,width:1102,height:1932}),this._fillKnownInformation(e,i,n),e.set("StemV",93),e.set("StemH",93),e.set("AvgWidth",689),e.set("MaxWidth",1e3),e.set("CapHeight",718),e.set("XHeight",500),e.set("Leading",250)},tIt._fillHanyangSystemsShinMyeongJoMedium=function(e,t,i){this._fillFontBox(e,{x:0,y:-148,width:1001,height:1028}),this._fillKnownInformation(e,t,i),e.set("StemV",93),e.set("StemH",93),e.set("AvgWidth",1e3),e.set("MaxWidth",1e3),e.set("CapHeight",880),e.set("XHeight",616),e.set("Leading",250)},tIt._fillHeiseiMinchoW3=function(e,t,i){this._fillFontBox(e,{x:-123,y:-257,width:1124,height:1167}),this._fillKnownInformation(e,t,i),e.set("StemV",93),e.set("StemH",93),e.set("AvgWidth",702),e.set("MaxWidth",1e3),e.set("CapHeight",718),e.set("XHeight",500),e.set("Leading",250)},tIt._fillSinoTypeSongLight=function(e,t,i){this._fillFontBox(e,{x:-25,y:-254,width:1025,height:1134}),this._fillKnownInformation(e,t,i),e.set("StemV",93),e.set("StemH",93),e.set("AvgWidth",1e3),e.set("MaxWidth",1e3),e.set("CapHeight",880),e.set("XHeight",616),e.set("Leading",250)},tIt._fillMonotypeHeiMedium=function(e,t,i){this._fillFontBox(e,{x:-45,y:-250,width:1060,height:1137}),this._fillKnownInformation(e,t,i),e.set("StemV",93),e.set("StemH",93),e.set("AvgWidth",1e3),e.set("MaxWidth",1e3),e.set("CapHeight",880),e.set("XHeight",616),e.set("Leading",250)},tIt._fillHanyangSystemsGothicMedium=function(e,t,i){this._fillFontBox(e,{x:-6,y:-145,width:1009,height:1025}),this._fillKnownInformation(e,t,i),e.set("Flags",4),e.set("StemV",93),e.set("StemH",93),e.set("AvgWidth",1e3),e.set("MaxWidth",1e3),e.set("CapHeight",880),e.set("XHeight",616),e.set("Leading",250)},tIt._fillFontBox=function(e,t){e.set("FontBBox",RMt(t))},tIt._fillKnownInformation=function(e,t,i){switch(e.set("FontName",k.get(i._postScriptName)),e.set("Type",k.get("FontDescriptor")),e.set("ItalicAngle",0),e.set("MissingWidth",i._widthTable._defaultWidth),e.set("Ascent",i._ascent),e.set("Descent",i._descent),t){case $xt.monotypeHeiMedium:case $xt.hanyangSystemsGothicMedium:case $xt.heiseiKakuGothicW5:e.set("Flags",4);break;case $xt.sinoTypeSongLight:case $xt.monotypeSungLight:case $xt.hanyangSystemsShinMyeongJoMedium:case $xt.heiseiMinchoW3:e.set("Flags",6)}},tIt._getFontDescriptor=function(e,t,i){var n=new mPt;switch(n._updated=!0,e){case $xt.hanyangSystemsGothicMedium:this._fillHanyangSystemsGothicMedium(n,e,i);break;case $xt.hanyangSystemsShinMyeongJoMedium:this._fillHanyangSystemsShinMyeongJoMedium(n,e,i);break;case $xt.heiseiKakuGothicW5:this._fillHeiseiKakuGothicW5(n,t,e,i);break;case $xt.heiseiMinchoW3:this._fillHeiseiMinchoW3(n,e,i);break;case $xt.monotypeHeiMedium:this._fillMonotypeHeiMedium(n,e,i);break;case $xt.monotypeSungLight:this._fillMonotypeSungLight(n,e,i);break;case $xt.sinoTypeSongLight:this._fillSinoTypeSongLight(n,e,i)}return n};var Jxt,Zxt,$xt,eIt=tIt;function tIt(){}(Tft=Jxt=Jxt||{})[Tft.regular=0]="regular",Tft[Tft.bold=1]="bold",Tft[Tft.italic=2]="italic",Tft[Tft.underline=4]="underline",Tft[Tft.strikeout=8]="strikeout",(Vft=Zxt=Zxt||{})[Vft.helvetica=0]="helvetica",Vft[Vft.courier=1]="courier",Vft[Vft.timesRoman=2]="timesRoman",Vft[Vft.symbol=3]="symbol",Vft[Vft.zapfDingbats=4]="zapfDingbats",(Bft=$xt=$xt||{})[Bft.heiseiKakuGothicW5=0]="heiseiKakuGothicW5",Bft[Bft.heiseiMinchoW3=1]="heiseiMinchoW3",Bft[Bft.hanyangSystemsGothicMedium=2]="hanyangSystemsGothicMedium",Bft[Bft.hanyangSystemsShinMyeongJoMedium=3]="hanyangSystemsShinMyeongJoMedium",Bft[Bft.monotypeHeiMedium=4]="monotypeHeiMedium",Bft[Bft.monotypeSungLight=5]="monotypeSungLight",Bft[Bft.sinoTypeSongLight=6]="sinoTypeSongLight";var iIt=function(){this._result=!1,this._glyphIndex=[]},nIt=(Object.defineProperty(oIt.prototype,"lastPoint",{get:function(){var e=[0,0],t=this._points.length;return 0<this._points.length&&(e[0]=this._points[t-1][0],e[1]=this._points[t-1][1]),e},enumerable:!0,configurable:!0}),Object.defineProperty(oIt.prototype,"pathPoints",{get:function(){return this._points},enumerable:!0,configurable:!0}),Object.defineProperty(oIt.prototype,"pathTypes",{get:function(){return this._pathTypes},enumerable:!0,configurable:!0}),Object.defineProperty(oIt.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this._fillMode=e},enumerable:!0,configurable:!0}),oIt.prototype.addPath=function(e,t){e instanceof oIt?this._addPath(e._points,e._pathTypes):Array.isArray(e)&&Array.isArray(t)&&this._addPath(e,t)},oIt.prototype._addPath=function(e,t){if(!e||0===e.length)throw new Error("Path points cannot be null or undefined.");if(!t||0===t.length)throw new Error("Path types cannot be null or undefined.");if(e.length!==t.length)throw new Error("The argument arrays should be of equal length.");for(var i=0;i<e.length;i++){if(i>=e.length||i<0)throw new Error("Index"+i+"is out of bounds.");this._points.push(e[Number.parseInt(i.toString(),10)].slice()),this._pathTypes.push(t[Number.parseInt(i.toString(),10)])}},oIt.prototype.addLine=function(e,t,i,n){this._addPoints([e,t,i,n],SAt.line)},oIt.prototype._addLines=function(e){var t=e[0];if(1===e.length)this._addPoint(e[0],SAt.line);else for(var i=1;i<e.length;i++){var n=e[Number.parseInt(i.toString(),10)];this.addLine(t[0],t[1],n[0],n[1]),t=n}},oIt.prototype._addPoints=function(e,t,i,n){for(var o=void 0!==i?i:0,r=void 0!==n?n:e.length,s=o;s<r;s+=2){var a=[e[Number.parseInt(s.toString(),10)],e[s+1]];s===o?0===this._points.length||this._isStart?(this._addPoint(a,SAt.start),this._isStart=!1):(this._isRoundedRectangle&&(a[0]!==this.lastPoint[0]||a[1]!==this.lastPoint[1])||a[0]!==this.lastPoint[0]&&a[1]!==this.lastPoint[1])&&this._addPoint(a,SAt.line):this._addPoint(a,t)}},oIt.prototype._addPoint=function(e,t){this._points.push(e),this._pathTypes.push(t)},oIt.prototype.addArc=function(e,t,i,n,o,r){for(var s=JMt(e,t,e+i,t+n,o,r),a=0;a<s.length;++a){var l=[s[Number.parseInt(a.toString(),10)],s[++a],s[++a],s[++a],s[++a],s[++a],s[++a],s[++a]];this._addPoints(l,SAt.bezier)}},oIt.prototype.addRectangle=function(e,t,i,n){this.startFigure(),this._addPoints([e,t,e+i,t,e+i,t+n,e,t+n],SAt.line),this.closeFigure()},oIt.prototype.addPolygon=function(e){var t=[];e.forEach(function(e){t.push(e[0],e[1])}),this.startFigure(),this._addPoints(t,SAt.line),this.closeFigure()},oIt.prototype.addEllipse=function(e,t,i,n){this.startFigure(),this.addArc(e,t,i,n,0,360),this.closeFigure()},oIt.prototype.addBezier=function(e,t,i,n,o,r,s,a){this._addPoints([e,t,i,n,o,r,s,a],SAt.bezier)},oIt.prototype._addBezierPoints=function(e){if(e.length<4)throw Error("Incorrect size of array points");var t=0,i=e[Number.parseInt(t.toString(),10)];for(t++;t+3<=e.length;){var n=e[Number.parseInt(t.toString(),10)],o=(t++,e[Number.parseInt(t.toString(),10)]),r=(t++,e[Number.parseInt(t.toString(),10)]);t++,this.addBezier(i[0],i[1],n[0],n[1],o[0],o[1],r[0],r[1]),i=r}},oIt.prototype.addPie=function(e,t,i,n,o,r){this.startFigure(),this.addArc(e,t,i,n,o,r),this._addPoint([e+i/2,t+n/2],SAt.line),this.closeFigure()},oIt.prototype.startFigure=function(){this._isStart=!0},oIt.prototype.closeFigure=function(e){var t;void 0!==e?(t=this._pathTypes[Number.parseInt(e.toString(),10)],t|=SAt.closePath,this._pathTypes[Number.parseInt(e.toString(),10)]=t):(0<this._points.length&&this.closeFigure(this._points.length-1),this.startFigure())},oIt.prototype.closeAllFigures=function(){for(var e=0;e<this._points.length;++e){var t=this._pathTypes[Number.parseInt(e.toString(),10)],i=!1;0!==e&&t===SAt.start?(this.closeFigure(e-1),i=!0):e===this._pathTypes.length-1&&!i&&this._isXps&&this._points[0][0]===this._points[Number.parseInt(e.toString(),10)][0]&&this._points[0][1]===this._points[Number.parseInt(e.toString(),10)][1]&&this.closeFigure(e)}},oIt.prototype._getBounds=function(){var e=[0,0,0,0];if(0<this._points.length){for(var t=this._points[0][0],i=this._points[0][0],n=this._points[0][1],o=this._points[0][1],r=1;r<this._points.length;++r)var s=this._points[Number.parseInt(r.toString(),10)],t=Math.min(s[0],t),i=Math.max(s[0],i),n=Math.min(s[1],n),o=Math.max(s[1],o);e=[t,n,i-t,o-n]}return e},oIt);function oIt(e,t){if(this._points=[],this._pathTypes=[],this._isRoundedRectangle=!1,this._fillMode=e1t.winding,this._isStart=!0,this._isXps=!1,this._brush=void 0,this._pen=void 0,e&&t){if(!Array.isArray(e)||!Array.isArray(t))throw new Error("Invalid constructor arguments.");this._points=e,this._pathTypes=t}else this._points=[],this._pathTypes=[]}Object.defineProperty(sIt.prototype,"width",{get:function(){return this._imageWidth},set:function(e){this._imageWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(sIt.prototype,"height",{get:function(){return this._imageHeight},set:function(e){this._imageHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(sIt.prototype,"physicalDimension",{get:function(){return this._imagePhysicalDimension=this._getPointSize(this.width,this.height,this._horizontalResolution),[this.width,this.height]},enumerable:!0,configurable:!0}),sIt.prototype.draw=function(e,t,i){null==t&&null==i&&(i=t=0);var n=0!==t||0!==i,o=null;n&&(o=e.save(),e.translateTransform(t,i)),e.drawImage(this,0,0),n&&e.restore(o)},sIt.prototype._getPointSize=function(e,t,i){var n;return null==i?this._getPointSize(e,t,96):(i=new vIt,n=new vIt,[i._convertUnits(e,UAt.pixel,UAt.point),n._convertUnits(t,UAt.pixel,UAt.point)])};var rIt=sIt;function sIt(){}Object.defineProperty(lIt.prototype,"clientSize",{get:function(){return[this._clipBounds[2],this._clipBounds[3]]},enumerable:!0,configurable:!0}),Object.defineProperty(lIt.prototype,"_matrix",{get:function(){return void 0===this._m&&(this._m=new hIt),this._m},enumerable:!0,configurable:!0}),Object.defineProperty(lIt.prototype,"_resources",{get:function(){var e,i=this;return void 0===this._resourceMap&&(this._resourceMap=new Map,this._resourceObject&&this._resourceObject.has("Font")&&(e=this._resourceObject.get("Font"))&&0<e.size&&e.forEach(function(e,t){null!=t&&t instanceof aPt&&i._resourceMap.set(t,k.get(e))}),this._resourceObject.has("XObject")&&(e=this._resourceObject.get("XObject"))&&0<e.size&&e.forEach(function(e,t){null!=t&&t instanceof aPt&&i._resourceMap.set(t,k.get(e))}),this._resourceObject.has("ExtGState"))&&(e=this._resourceObject.get("ExtGState"))&&0<e.size&&(this._transparencies||(this._transparencies=new Map),e.forEach(function(e,t){null!=t&&t instanceof aPt&&i._setTransparencyData(t,k.get(e))})),this._resourceMap},enumerable:!0,configurable:!0}),lIt.prototype.save=function(){var e=new gIt(this,this._matrix);return e._textRenderingMode=this._textRenderingMode,e._charSpacing=this._characterSpacing,e._textScaling=this._textScaling,e._wordSpacing=this._wordSpacing,e._currentBrush=this._currentBrush,e._currentPen=this._currentPen,e._currentFont=this._currentFont,this._graphicsState.push(e),this._sw._saveGraphicsState(),e},lIt.prototype.restore=function(e){if(0<this._graphicsState.length)if(void 0===e)this._doRestore();else if(0<this._graphicsState.length&&-1!==this._graphicsState.indexOf(e))for(;0<this._graphicsState.length&&this._doRestore()!==e;);},lIt.prototype._doRestore=function(){var e=this._graphicsState.pop();return this._m=e._transformationMatrix,this._currentBrush=e._currentBrush,this._currentPen=e._currentPen,this._currentFont=e._currentFont,this._characterSpacing=e._charSpacing,this._wordSpacing=e._wordSpacing,this._textScaling=e._textScaling,this._textRenderingMode=e._textRenderingMode,this._sw._restoreGraphicsState(),e},lIt.prototype.drawRectangle=function(e,t,i,n,o,r){this._beginMarkContent();o=this._setPenBrush(o,r);this._sw._appendRectangle(e,t,i,n),this._drawGraphicsPath(o.pen,o.brush),this._endMarkContent()},lIt.prototype.drawBezier=function(e,t,i,n,o,r,s,a,l){this._beginMarkContent(),this._stateControl(l,null,null),this._sw._beginPath(e,t),this._sw._appendBezierSegment(i,n,o,r,s,a),this._drawGraphicsPath(l),this._endMarkContent()},lIt.prototype.drawPie=function(e,t,i,n,o,r,s,a){this._beginMarkContent();s=this._setPenBrush(s,a);this._constructPiePath(e,t,e+i,t+n,o,r),this._sw._appendLineSegment(e+i/2,t+n/2),this._drawGraphicsPath(s.pen,s.brush,null,!0),this._endMarkContent()},lIt.prototype.drawPolygon=function(e,t,i){if(this._beginMarkContent(),0<e.length){t=this._setPenBrush(t,i);this._sw._beginPath(e[0][0],e[0][1]);for(var n=1;n<e.length;n++)this._sw._appendLineSegment(e[Number.parseInt(n.toString(),10)][0],e[Number.parseInt(n.toString(),10)][1]);this._drawGraphicsPath(t.pen,t.brush,e1t.winding,!0)}this._endMarkContent()},lIt.prototype.drawEllipse=function(e,t,i,n,o,r){this._beginMarkContent();o=this._setPenBrush(o,r);this._constructArcPath(e,t,e+i,t+n,0,360),this._drawGraphicsPath(o.pen,o.brush,e1t.winding,!0),this._endMarkContent()},lIt.prototype.drawArc=function(e,t,i,n,o,r,s){0!==r&&(this._beginMarkContent(),this._stateControl(s),this._constructArcPath(e,t,e+i,t+n,o,r),this._drawGraphicsPath(s,null,e1t.winding,!1),this._endMarkContent())},lIt.prototype._beginMarkContent=function(){this._layer&&this._layer._beginLayer(this)},lIt.prototype._endMarkContent=function(){if(this._layer){if(this._layer._isEndState&&0!==this._layer._parentLayer.length)for(var e=0;e<this._layer._parentLayer.length;e++)this._sw._write("EMC");this._layer._isEndState&&this._sw._write("EMC")}},lIt.prototype.drawImage=function(e,t,i,n,o){var r;this._beginMarkContent(),"number"==typeof t&&"number"==typeof i&&void 0===n?(r=e.physicalDimension,this.drawImage(e,t,i,r[0],r[1])):(e._save(),r=new hIt,this._getTranslateTransform(t,i+o,r),this._getScaleTransform(n,o,r),this._sw._write("q"),t=void this._sw._modifyCtm(r),n=!(i=void 0),(n=this._resourceObject.has("XObject")&&((o=this._resourceObject.getRaw("XObject"))instanceof mPt?t=o:o instanceof aPt&&this._crossReference&&(t=this._crossReference._fetch(o)),t)?!1:n)&&(t=new mPt(this._crossReference),this._resourceObject.update("XObject",t)),void 0===i&&(i=k.get(XMt())),this._crossReference?(this._updateImageResource(e,i,t,this._crossReference),this._source.update("Resources",this._resourceObject),this._source._updated=!0):this._pendingResource.push({resource:e,key:i,source:t}),this._sw._executeObject(i),this._sw._write("Q"),this._sw._write("\r\n"),YMt("ImageB",this._resourceObject),YMt("ImageC",this._resourceObject),YMt("ImageI",this._resourceObject),YMt("Text",this._resourceObject)),this._endMarkContent()},lIt.prototype.drawTemplate=function(n,e){var t,i,o,r,s,a,l,h,d,p,c,u,g,m,f=this;this._beginMarkContent(),void 0!==n&&((n._isExported||n._isResourceExport)&&(this._crossReference?(n._crossReference=this._crossReference,n._importStream(!0,n._isResourceExport)):(n._importStream(!1,n._isResourceExport),this._pendingResource.push(n))),t=n&&0<n._size[0]?e.width/n._size[0]:1,i=n&&0<n._size[1]?e.height/n._size[1]:1,o=!(Math.trunc(1e3*t)/1e3==1&&Math.trunc(1e3*i)/1e3==1),a=h=void 0,this._page&&(h=this._page.cropBox,a=this._page.mediaBox,this._page._pageDictionary.has("CropBox"))&&this._page._pageDictionary.has("MediaBox")&&0<h[0]&&0<h[1]&&a[0]<0&&a[1]<0&&(this.translateTransform(h[0],-h[1]),e.x=-h[0],e.y=h[1]),r=this.save(),s=new hIt,this._page?(h=this._page._pageDictionary.has("CropBox")&&this._page._pageDictionary.has("MediaBox")&&h&&a&&h[0]===a[0]&&h[1]===a[1]&&h[2]===a[2]&&h[3]===a[3]||this._page._pageDictionary.has("MediaBox")&&a&&0===a[3],s._translate(e.x,-(e.y+(0<=this._page._origin[0]||h?e.height:0)))):s._translate(e.x,-(e.y+e.height)),a=!1,n._content&&n._content.dictionary&&(h=n._content.dictionary).has("Matrix")&&h.has("BBox")&&(l=h.getArray("Matrix"),h=h.getArray("BBox"),l)&&h&&5<l.length&&3<h.length&&(p=Number.parseFloat(bMt(-l[1])),m=Number.parseFloat(bMt(l[2])),d=Number.parseFloat(bMt(t)),u=Number.parseFloat(bMt(i)),d===p&&u===m&&h[2]===n._size[0]&&h[3]===n._size[1]&&n._isAnnotationTemplate&&n._needScale&&o?((s=new hIt)._translate(e.x-l[4],-(e.y+l[5])),s._scale(1,1),a=!0):0!==h[0]&&0!==h[1]&&h[0]===e.x&&this._page&&n._isSignature&&(s._translate(e.x-h[0],-this._page.size[1]),s._scale(t,i),a=!0)),o&&!a&&s._scale(t,i),d=void this._sw._modifyCtm(s),u=!(p=!1),this._resourceObject.has("XObject")&&((m=this._resourceObject.getRaw("XObject"))&&(m instanceof aPt?(p=!0,d=this._crossReference._fetch(m)):m instanceof mPt&&(d=m)),d)&&(u=!1,this._resources.forEach(function(e,t){var i;t&&t instanceof aPt&&(i=f._crossReference._fetch(t))&&n&&i===n._content&&(c=e,g=t)})),u&&(d=new mPt(this._crossReference),this._resourceObject.update("XObject",d)),void 0===c&&(c=k.get(XMt()),n&&n._content.reference?g=n._content.reference:this._crossReference?g=this._crossReference._getNextReference():this._pendingResource.push({resource:n._content,key:c,source:d}),g&&this._crossReference&&(!this._crossReference._cacheMap.has(g)&&n&&n._content&&this._crossReference._cacheMap.set(g,n._content),d.update(c.name,g),this._resources.set(g,c)),this._resourceObject._updated=!0),p&&(this._resourceObject._updated=!0),this._hasResourceReference&&(this._source._updated=!0),this._sw._executeObject(c),this.restore(r),YMt("ImageB",this._resourceObject),YMt("ImageC",this._resourceObject),YMt("ImageI",this._resourceObject),YMt("Text",this._resourceObject)),this._endMarkContent()},lIt.prototype._processResources=function(e){if(this._crossReference=e,0<this._pendingResource.length){for(var t=0;t<this._pendingResource.length;t++){var i,n=this._pendingResource[Number.parseInt(t.toString(),10)];n instanceof _It?(n._crossReference=e,n._updatePendingResource(e)):n.resource instanceof SPt?(i=void 0,n.resource._reference?i=n.resource._reference:(i=e._getNextReference(),n.resource._reference=i),!e._cacheMap.has(i)&&n.resource&&e._cacheMap.set(i,n.resource),n.source.update(n.key.name,i),this._resources.set(i,n.key)):n.resource instanceof rIt?this._updateImageResource(n.resource,n.key,n.source,e):n.resource instanceof Oxt&&this._updateFontResource(n.resource,n.key,n.source,e),this._source.update("Resources",this._resourceObject),this._source._updated=!0}this._pendingResource=[]}},lIt.prototype._updateImageResource=function(e,t,i,n){var o,r;e._reference?o=e._reference:(o=n._getNextReference(),e._reference=o),n._cacheMap.has(o)||e&&e._imageStream&&e._imageStream.dictionary&&(n._cacheMap.set(o,e._imageStream),e._imageStream.dictionary._updated=!0,e._maskStream)&&e._maskStream.dictionary&&(r=void 0,e._maskReference?r=e._maskReference:(r=n._getNextReference(),e._maskReference=r),n._cacheMap.set(r,e._maskStream),e._maskStream.dictionary._updated=!0,e._imageStream.dictionary.set("SMask",r)),i.update(t.name,o),this._resources.set(o,t),this._resourceObject._updated=!0},lIt.prototype._updateFontResource=function(e,t,i,n){var o;e._reference?o=e._reference:(o=n._getNextReference(),e._reference=o),n._cacheMap.has(o)||(e._dictionary?(n._cacheMap.set(o,e._dictionary),i.update(t.name,o),this._resources.set(o,t)):e instanceof Uxt&&((e=e._fontInternal)&&e._fontDictionary&&n._cacheMap.set(o,e._fontDictionary),i.update(t.name,o),this._resources.set(o,t)))},lIt.prototype.drawPath=function(e,t,i){this._beginMarkContent();t=this._setPenBrush(t,i);(t.pen||t.brush)&&(this._buildUpPath(e._points,e._pathTypes),this._drawGraphicsPath(t.pen,t.brush,e.fillMode,!1)),this._endMarkContent()},lIt.prototype.drawRoundedRectangle=function(e,t,i,n,o,r,s){if(null===r)throw new Error("pen");if(null===s)throw new Error("brush");e=[e,t,i,n],t=2*o,i=[t,t],n=[e[0],e[1],i[0],i[1]],i=new nIt;0===o?i.addRectangle(e[0],e[1],e[2],e[3]):(i._isRoundedRectangle=!0,i.addArc(n[0],n[1],n[2],n[3],180,90),n[0]=e[0]+e[2]-t,i.addArc(n[0],n[1],n[2],n[3],270,90),n[1]=e[1]+e[3]-t,i.addArc(n[0],n[1],n[2],n[3],0,90),n[0]=e[0],i.addArc(n[0],n[1],n[2],n[3],90,90),i.closeFigure()),this.drawPath(i,r,s)},lIt.prototype._constructArcPath=function(e,t,i,n,o,r){var s=JMt(e,t,i,n,o,r);if(8!==s.length){var a=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]];this._sw._beginPath(a[0],a[1]);for(var l=0;l<s.length;l+=8)a=[s[Number.parseInt(l.toString(),10)],s[l+1],s[l+2],s[l+3],s[l+4],s[l+5],s[l+6],s[l+7]],this._sw._appendBezierSegment(a[2],a[3],a[4],a[5],a[6],a[7])}},lIt.prototype._constructPiePath=function(e,t,i,n,o,r){var s=JMt(e,t,i,n,o,r);if(8===s.length){var a=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]];this._sw._beginPath(a[0],a[1]);for(var l=0;l<s.length;l+=8)a=[s[Number.parseInt(l.toString(),10)],s[l+1],s[l+2],s[l+3],s[l+4],s[l+5],s[l+6],s[l+7]],this._sw._appendBezierSegment(a[2],a[3],a[4],a[5],a[6],a[7])}},lIt.prototype._writePen=function(e){for(var t=e._width,i=e._dashPattern,n=[],o=0;o<i.length;++o)n[o]=i[o]*e._width;this._sw._setLineDashPattern(n,e._dashOffset*t),this._sw._setLineWidth(e._width),this._sw._setLineJoin(e._lineJoin),this._sw._setLineCap(e._lineCap),0<e._miterLimit&&this._sw._setMiterLimit(e._miterLimit),this._sw._setColor(e._color,!0)},lIt.prototype.drawString=function(e,t,i,n,o,r){this._beginMarkContent();var s=new q1t,s=(r=r||new E1t,s._layout(e,t,r,[i[2],i[3]]));s._empty||(e=this._checkCorrectLayoutRectangle(s._actualSize,i[0],i[1],r),i[2]<=0&&(i[0]=e[0],i[2]=e[2]),i[3]<=0&&(i[1]=e[1],i[3]=e[3]),this._drawStringLayoutResult(s,t,n,o,i,r)),YMt("Text",this._resourceObject),this._endMarkContent()},lIt.prototype._buildUpPath=function(e,t){for(var i=0;i<e.length;i++){var n=e[Number.parseInt(i.toString(),10)];switch(15&t[Number.parseInt(i.toString(),10)]){case SAt.start:this._sw._beginPath(n[0],n[1]);break;case SAt.bezier:var o=this._getBezierPoint(e,t,i),i=o.index,r=o.point,o=(i=(o=this._getBezierPoint(e,t,i)).index,o.point);this._sw._appendBezierSegment(n[0],n[1],r[0],r[1],o[0],o[1]);break;case SAt.line:this._sw._appendLineSegment(n[0],n[1]);break;default:throw new Error("Incorrect path formation.")}(t[Number.parseInt(i.toString(),10)]&SAt.closePath)===SAt.closePath&&this._sw._closePath()}},lIt.prototype._getBezierPoint=function(e,t,i){if(t[Number.parseInt(i.toString(),10)]!==SAt.bezier)throw new Error("Malforming path.");return{index:++i,point:e[Number.parseInt(i.toString(),10)]}},lIt.prototype._initialize=function(){this._mediaBoxUpperRightBound=0,this._characterSpacing=-1,this._wordSpacing=-1,this._textScaling=-100,this._textRenderingMode=-1,this._graphicsState=[],this._clipBounds=[0,0,this._size[0],this._size[1]],this._colorSpaceInitialized=!1,this._startCutIndex=-1},lIt.prototype._initializeCurrentColorSpace=function(){this._colorSpaceInitialized||(this._sw._setColorSpace("DeviceRGB",!0),this._sw._setColorSpace("DeviceRGB",!1),this._colorSpaceInitialized=!0)},lIt.prototype._brushControl=function(e){this._sw._setColor(e._color,!1),this._currentBrush=e},lIt.prototype._penControl=function(e){this._currentPen=e,this._writePen(e),this._currentPen=e},lIt.prototype._fontControl=function(n,e){var t,o,i,r,s=this,e=n._metrics._getSize(e),a=(this._currentFont=n,!1),l=!0,h=!1;this._resourceObject.has("Font")&&(null!=(i=this._resourceObject.getRaw("Font"))&&(i instanceof aPt?(a=!0,t=this._crossReference._fetch(i)):i instanceof mPt&&(t=i)),null!=t)&&(l=!1,this._resources.forEach(function(e,t){var i;s._crossReference?null!=t&&(i=s._crossReference._fetch(t))&&(n instanceof _xt&&i===n._dictionary||n instanceof Uxt&&i===n._fontInternal._fontDictionary)&&(r=e,o=t,h=!0):n._reference&&n._reference===t&&(r=e,o=t,h=!0)})),l&&(t=new mPt(this._crossReference),this._resourceObject.update("Font",t)),void 0===r&&(r=k.get(XMt()),o||(n._reference?(o=n._reference,t.update(r.name,o)):this._crossReference?o=this._crossReference._getNextReference():this._pendingResource.push({resource:n,key:r,source:t})),o&&this._crossReference&&(n._reference||(n._reference=o),n._dictionary?(this._crossReference._cacheMap.set(o,n._dictionary),t.update(r.name,o)):n instanceof Uxt&&((i=n._fontInternal)&&i._fontDictionary&&this._crossReference._cacheMap.set(o,i._fontDictionary),t.update(r.name,o))),h||this._resources.set(o,r)),a&&(this._resourceObject._updated=!0),this._hasResourceReference&&(this._source._updated=!0),this._sw._setFont(r.name,e)},lIt.prototype._setPenBrush=function(e,t){var i,n;return e&&(e instanceof yIt?i=e:n=e),t&&t instanceof fIt&&(n=t),this._stateControl(i,n,null),{pen:i,brush:n}},lIt.prototype._stateControl=function(e,t,i,n){(e||t)&&this._initializeCurrentColorSpace(),e&&this._penControl(e),t&&this._brushControl(t),i&&this._fontControl(i,n)},lIt.prototype._drawStringLayoutResult=function(e,t,i,n,o,r){var s,a,l,h,d;e._empty||(s=r&&void 0!==r.lineLimit&&!r.lineLimit,l=void 0===r||r&&void 0!==r.noClip&&!r.noClip,a=void 0,(s=s&&l)&&(a=this.save(),l=[o[0],o[1],e._actualSize[0],e._actualSize[1]],0<o[2]&&(l[2]=o[2]),r.lineAlignment===T1t.middle?l[1]+=(o[3]-l[3])/2:r.lineAlignment===T1t.bottom&&(l[1]+=o[3]-l[3]),this.setClip(l)),t&&t instanceof Uxt&&t._fontInternal&&t._fontInternal instanceof xxt&&t.isItalic&&(t._fontInternal._ttfMetrics._isItalic||(a=this.save(),this._isItalic=!0)),this._applyStringSettings(t,i,n,r),(l=null!=r?r.horizontalScalingFactor:100)!==this._textScaling&&(this._sw._setTextScaling(l),this._textScaling=l),i=this._getTextVerticalAlignShift(e._actualSize[1],o[3],r),l=null==r||0===r.lineSpacing?t._metrics._getHeight(r):r.lineSpacing+t._metrics._getHeight(r),h=0,h=null!=r&&r.subSuperScript===ZAt.subScript?l-(t.height+t._metrics._getDescent(r)):l-t._metrics._getAscent(r),r&&r.lineAlignment===T1t.bottom&&o[3]-e._actualSize[1]!=0&&o[3]-e._actualSize[1]<t._metrics._size/2-1&&Number.parseFloat(bMt(o[3]))<=Number.parseFloat(bMt(t._metrics._getHeight(r)))&&(h=-(l/t._metrics._size)),d=new hIt,this._isItalic?(this.translateTransform(o[0]+t.size/5,o[1]-h+i),this._skewTransform(0,-11)):(d._translate(o[0],-(o[1]+t._metrics._getHeight(r))-(0<t._metrics._getDescent(r)?-t._metrics._getDescent(r):t._metrics._getDescent(r))-i),this._sw._modifyTM(d)),0!==(i=o[3]<t._metrics._size&&e._actualSize[1]-o[3]<t._metrics._size/2-1?0:i)&&null!==r&&r.lineAlignment===T1t.bottom&&o[3]-e._actualSize[1]!=0&&o[3]-e._actualSize[1]>t._metrics._size/2-1&&(i-=(h-(l-t._metrics._size))/2),this._isItalic&&(this._sw._startNextLine(0,0),this._sw._setLeading(+l)),this._drawLayoutResult(e,t,r,o),0!==i&&this._sw._startNextLine(0,-(i-e._lineHeight)),YMt("Text",this._resourceObject),this._sw._endText(),this._isItalic&&this.restore(a),this._underlineStrikeoutText(n,e,t,o,r),s&&this.restore(a))},lIt.prototype._getNextPage=function(){var e=this._crossReference._document.pageCount,e=this._page._pageIndex<=e-2?this._crossReference._document.getPage(this._page._pageIndex+1):this._crossReference._document.addPage();return e},lIt.prototype._applyStringSettings=function(e,t,i,n){var o=uIt.fill,r=!1,s=(t&&i?o=uIt.fillStroke:t?o=uIt.stroke:i&&(o=uIt.fill),e&&e instanceof Uxt&&(e.isUnicode||0!=(e._style&Jxt.bold))&&(a=!1,(s=e._fontInternal._metrics._postScriptName)&&s.toLocaleLowerCase().includes("bold")&&(a=!0),e._fontInternal)&&e._fontInternal._metrics&&e._fontInternal._metrics._isBold!==e.isBold&&!0===e.isBold&&!a&&(!t&&i&&(t=new yIt(i._color,1)),o=uIt.fillStroke,r=!0),n&&n.clipPath&&(o|=uIt.clipFlag),this._sw._beginText(),this._stateControl(t,i,e,n),o!==this._textRenderingMode&&(this._sw._setTextRenderingMode(o),this._textRenderingMode=o),null!=n?n.characterSpacing:0),a=(s!==this._characterSpacing&&(this._sw._setCharacterSpacing(s),this._characterSpacing=s),null!=n?n.wordSpacing:0);a!==this._wordSpacing&&(this._sw._setWordSpacing(a),this._wordSpacing=a),e&&r&&this._sw._setLineWidth(e.size/30)},lIt.prototype._drawLayoutResult=function(e,t,i,n){for(var o=null==i||0===i.lineSpacing?t._metrics._getHeight(i):i.lineSpacing+t._metrics._getHeight(i),r=e._lines,s=null!==t&&t.isUnicode,a=0,l=r.length;a<l&&a!==this._startCutIndex;a++){var h=r[Number.parseInt(a.toString(),10)],d=h._width,d=this._getHorizontalAlignShift(d,n[2],i)+this._getLineIndent(h,i,n[2],0===a);0!==d&&this._sw._startNextLine(d,0),s?this._drawUnicodeLine(h,n[2],t,i):this._drawAsciiLine(h,n[2],i,t),a+1!==l&&(d=this._getTextVerticalAlignShift(e._actualSize[1],n[3],i),h=new hIt,d=-(n[1]+t._metrics._getHeight(i))-t._metrics._getDescent(i)-d-o*(a+1),h._translate(n[0],d),this._sw._modifyTM(h))}},lIt.prototype._drawUnicodeLine=function(e,t,i,n){var o,r,s=e._text,a=null!=n&&n.rightToLeft,l=null!=n&&0<n.wordSpacing,e=this._justifyLine(e,t,n,i),t=new Fxt;a||null!=n&&n.textDirection!==JAt.none?(o=[],a=null!=n&&n.alignment===MAt.right,r=[],1<(o=null!=n&&n.textDirection!==JAt.none?t._layout(s,i,n.textDirection===JAt.rightToLeft,l,n):t._layout(s,i,a,l,n)).length?null!=n&&n.textDirection!==JAt.none&&(r=t._splitLayout(s,i,n.textDirection===JAt.rightToLeft,l,n)):r=[s],this._drawUnicodeBlocks(o,r,i,n,e)):l?(o=(a=this._breakUnicodeLine(s,i,null)).tokens,r=a.words,this._drawUnicodeBlocks(o,r,i,n,e)):(t=this._convertToUnicode(s,i),this._sw._showNextLineText(t,!0))},lIt.prototype._drawUnicodeBlocks=function(e,t,i,n,o){if(null!=e&&0<e.length&&null!=t&&0<t.length&&null!=i){this._sw._startNextLine();var r=0,s=0,a=0,l=0;try{null!=n&&(a=n.firstLineIndent,l=n.paragraphIndent,n.firstLineIndent=0,n.paragraphIndent=0);var h=i._getCharacterWidth(Z1t._whiteSpace,n)+o,d=null!==n?n.characterSpacing:0;h+=d+(null!=n&&0===o?n.wordSpacing:0);for(var p=0;p<e.length;p++){var c=e[p],u=t[p],g=0;0!==r&&this._sw._startNextLine(r,0),0<u.length&&(g=g+i.measureString(u,n)[0]+d,this._sw._showText(c)),p!==e.length-1&&(s+=r=g+h)}0<s&&this._sw._startNextLine(-s,0)}finally{null!=n&&(n.firstLineIndent=a,n.paragraphIndent=l)}}},lIt.prototype._breakUnicodeLine=function(e,t,i){var n=[];if(null!=e&&0<e.length){i=e.split(null);for(var o=0;o<i.length;o++){var r=i[o],r=this._convertToUnicode(r,t);n[Number.parseInt(o.toString(),10)]=r}}return{tokens:n,words:i}},lIt.prototype._convertToUnicode=function(e,t){var i,n=null;return null!=e&&null!=t&&t._fontInternal instanceof xxt&&(i=t._fontInternal._ttfReader,t._setSymbols(e),n=CMt(AMt(n=i._convertString(e)))),n},lIt.prototype._getTextVerticalAlignShift=function(e,t,i){var n=0;if(0<=t&&null!=i&&i.lineAlignment!==T1t.top)switch(i.lineAlignment){case T1t.middle:n=(t-e)/2;break;case T1t.bottom:n=t-e}return n},lIt.prototype._getHorizontalAlignShift=function(e,t,i){var n=0;if(0<=t&&null!=i&&i.alignment!==MAt.left)switch(i.alignment){case MAt.center:n=(t-e)/2;break;case MAt.right:n=t-e}return n},lIt.prototype._getLineIndent=function(e,t,i,n){var o=0,e=0<(e._lineType&K1t.firstParagraphLine);return t&&e&&(o=n?t.firstLineIndent:t.paragraphIndent,o=0<i?Math.min(i,o):o),o},lIt.prototype._drawAsciiLine=function(e,t,i,n){this._justifyLine(e,t,i,n);var o="";if(-1!==e._text.indexOf("(")||-1!==e._text.indexOf(")"))for(var r=0;r<e._text.length;r++)"("===e._text[Number.parseInt(r.toString(),10)]?o+="\\(":")"===e._text[Number.parseInt(r.toString(),10)]?o+="\\)":o+=e._text[Number.parseInt(r.toString(),10)];""===o&&(o=e._text),this._sw._showNextLineText("("+o+")")},lIt.prototype._justifyLine=function(e,t,i,n){var o=e._text,r=e._width,e=this._shouldJustify(e,t,i,n),s=i&&0!==i.wordSpacing,n=n._getCharacterCount(o,[" ","\t"]),o=0;return e?(s&&(r-=n*i.wordSpacing),this._sw._setWordSpacing(o=(t-r)/n)):i&&i.alignment===MAt.justify&&this._sw._setWordSpacing(0),o},lIt.prototype._shouldJustify=function(e,t,i,n){var o=e._text,r=e._width,i=i&&i.alignment===MAt.justify,r=0<=t&&r<t,t=0<n._getCharacterCount(o,[" ","\t"])&&" "!==o[0],n=0<(e._lineType&K1t.layoutBreak);return i&&r&&t&&n},lIt.prototype._underlineStrikeoutText=function(e,t,i,n,o){if(i.isUnderline||i.isStrikeout){var r=this._createUnderlineStrikeoutPen(e,i);if(null!=r)for(var e=this._getTextVerticalAlignShift(t._actualSize[1],n[3],o),s=n[1]+e+i._metrics._getAscent(o)+1.5*r._width,a=n[1]+e+i._metrics._getHeight(o)/2+1.5*r._width,l=t._lines,h=0;h<t._lineCount;h++){var d=l[Number.parseInt(h.toString(),10)],p=d._width,c=this._getHorizontalAlignShift(p,n[2],o),u=this._getLineIndent(d,o,n[2],0===h),c=n[0]+c,d=this._shouldJustify(d,n[2],o,i)?c+n[2]-u:c+p-u;i.isUnderline&&(this.drawLine(r,c,s,d,s),s+=t._lineHeight),i.isStrikeout&&(this.drawLine(r,c,a,d,a),a+=t._lineHeight)}}},lIt.prototype.drawLine=function(e,t,i,n,o){this._beginMarkContent(),this._stateControl(e),this._sw._beginPath(t,i),this._sw._appendLineSegment(n,o),this._sw._strokePath(),YMt("PDF",this._resourceObject),this._endMarkContent()},lIt.prototype._createUnderlineStrikeoutPen=function(e,t){return new yIt(e._color,t._metrics._size/20)},lIt.prototype._checkCorrectLayoutRectangle=function(e,t,i,n){var o=[t,i,e[0],e[0]];if(n){switch(n.alignment){case MAt.center:o[0]=o[0]-o[2]/2;break;case MAt.right:o[0]=o[0]-o[2]}switch(n.lineAlignment){case T1t.middle:o[1]=o[1]-o[3]/2;break;case T1t.bottom:o[1]=o[1]-o[3]}}return o},lIt.prototype._drawGraphicsPath=function(e,t,i,n){t=null!=t,e=null!=e,i=(i=void 0===i?e1t.winding:i)===e1t.alternate;e&&t?n?this._sw._closeFillStrokePath(i):this._sw._fillStrokePath(i):e||t?e?n?this._sw._closeStrokePath():this._sw._strokePath():n?this._sw._closeFillPath(i):this._sw._fillPath(i):this._sw._endPath()},lIt.prototype._initializeCoordinates=function(e){var t,i,n,o;e?(i=!(t=[0,0]),e._pageDictionary.has("CropBox")&&e._pageDictionary.has("MediaBox")&&(n=e._pageDictionary.getArray("CropBox"),o=e._pageDictionary.getArray("MediaBox"),n[0]===o[0]&&n[1]===o[1]&&n[2]===o[2]&&n[3]===o[3]&&(i=!0),0<n[0]&&0<n[3]&&o[0]<0&&o[1]<0?(this.translateTransform(n[0],-n[3]),t[0]=-n[0],t[1]=n[3]):e._pageDictionary.has("CropBox")||(i=!0),i)&&(this._sw._writeComment("Change co-ordinate system to left/top."),this._cropBox?this.translateTransform(this._cropBox[0],-this._cropBox[3]):-e._origin[1]<this._mediaBoxUpperRightBound||0===this._mediaBoxUpperRightBound?this.translateTransform(0,-this._size[1]):this.translateTransform(0,-this._mediaBoxUpperRightBound))):(this._sw._writeComment("Change co-ordinate system to left/top."),this._mediaBoxUpperRightBound!==-this._size[1]&&(this._cropBox&&(0<(n=this._cropBox)[0]||0<n[1]||this._size[0]===n[2]||this._size[1]===n[3])?this.translateTransform(n[0],-n[3]):this._mediaBoxUpperRightBound===this._size[1]||0===this._mediaBoxUpperRightBound?this.translateTransform(0,-this._size[1]):this.translateTransform(0,-this._mediaBoxUpperRightBound)))},lIt.prototype.scaleTransform=function(e,t){var i=new hIt;i._scale(e,t),this._sw._modifyCtm(i),this._matrix._multiply(i)},lIt.prototype.translateTransform=function(e,t){var i=new hIt;i._translate(e,-t),this._sw._modifyCtm(i),this._matrix._multiply(i)},lIt.prototype.rotateTransform=function(e){var t=new hIt;t._rotate(-e),this._sw._modifyCtm(t),this._matrix._multiply(t)},lIt.prototype.setClip=function(e,t){void 0===t&&(t=e1t.winding),this._sw._appendRectangle(e[0],e[1],e[2],e[3]),this._sw._clipPath(t===e1t.alternate)},lIt.prototype.setTransparency=function(e,t,i){void 0===t&&(t=e),void 0===i&&(i=$At.normal),void 0===this._transparencies&&(this._transparencies=new Map);var n,o,r="CA:"+e.toString()+"_ca:"+t.toString()+"_BM:"+i.toString();0<this._transparencies.size&&this._transparencies.forEach(function(e,t){e===r&&(n=t)}),n||(n=new mIt,(o=new mPt).update("CA",e),o.update("ca",t),o.update("BM",UMt(i)),e=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(e,o),n._dictionary=o,n._key=r,n._name=k.get(XMt()),t=void(n._reference=e),i=!1,this._resourceObject.has("ExtGState")?null!=(o=this._resourceObject.getRaw("ExtGState"))&&(o instanceof aPt?(i=!0,t=this._crossReference._fetch(o)):o instanceof mPt&&(t=o)):(t=new mPt(this._crossReference),this._resourceObject.update("ExtGState",t)),t.update(n._name.name,e),i&&(this._resourceObject._updated=!0),this._hasResourceReference&&(this._source._updated=!0)),this._sw._setGraphicsState(n._name)},lIt.prototype._setTransparencyData=function(e,t){this._resourceMap.set(e,t);var i=this._crossReference._fetch(e),n=0,o=0,r=0,n=(i&&(i.has("CA")&&(n=i.get("CA")),i.has("ca")&&(o=i.get("ca")),i.has("ca")&&(o=i.get("ca")),i.has("BM"))&&(r=qMt(i.get("BM"))),"CA:"+n.toString()+"_ca:"+o.toString()+"_BM:"+r.toString()),o=new mIt;o._dictionary=i,o._key=n,o._name=t,o._reference=e,this._transparencies.set(o,n)},lIt.prototype._getTranslateTransform=function(e,t,i){return i._translate(e,-t),i},lIt.prototype._getScaleTransform=function(e,t,i){return(i=null==i?new hIt:i)._scale(e,t),i},lIt.prototype._clipTranslateMargins=function(e){this._clipBounds=e,this._sw._writeComment("Clip margins."),this._sw._appendRectangle(e[0],e[1],e[2],e[3]),this._sw._closePath(),this._sw._clipPath(!1),this._sw._writeComment("Translate co-ordinate system."),this.translateTransform(e[0],e[1])},lIt.prototype._skewTransform=function(e,t){var i=new hIt;this._getSkewTransform(e,t,i),this._sw._modifyCtm(i),i._multiply(i)},lIt.prototype._getSkewTransform=function(e,t,i){return i._skew(-e,-t),i};var aIt=lIt;function lIt(e,t,i,n){this._pendingResource=[],this._isItalic=!1,this._hasResourceReference=!1,n instanceof PDt?(this._source=n._pageDictionary,this._page=n):n instanceof _It&&(this._source=n._content.dictionary,this._template=n),this._source&&this._source.has("Resources")?(n=this._source.getRaw("Resources"))&&(n instanceof aPt?(this._hasResourceReference=!0,this._resourceObject=i._fetch(n)):n instanceof mPt&&(this._resourceObject=n)):(this._resourceObject=new mPt,this._source.update("Resources",this._resourceObject)),this._crossReference=i,this._sw=new x1t(t),this._size=e,YMt("PDF",this._resourceObject),this._initialize()}dIt.prototype._translate=function(e,t){this._matrix._translate(e,t)},dIt.prototype._scale=function(e,t){this._matrix._elements[0]=e,this._matrix._elements[3]=t},dIt.prototype._rotate=function(e){e=e*Math.PI/180,this._matrix._elements[0]=Math.cos(e),this._matrix._elements[1]=Math.sin(e),this._matrix._elements[2]=-Math.sin(e),this._matrix._elements[3]=Math.cos(e)},dIt.prototype._multiply=function(e){this._matrix._multiply(e._matrix)},dIt.prototype._toString=function(){for(var e="",t=0,i=this._matrix._elements.length;t<i;t++)e+=GMt(this._matrix._elements[Number.parseInt(t.toString(),10)])+" ";return e},dIt.prototype._skew=function(e,t){e=Math.tan(this._degreeToRadians(e)),t=Math.tan(this._degreeToRadians(t)),e=new pIt(1,e,t,1,0,0);this._matrix._multiply(e)},dIt.prototype._degreeToRadians=function(e){return Math.PI/180*e};var hIt=dIt;function dIt(){this._matrix=new pIt(1,0,0,1,0,0)}Object.defineProperty(cIt.prototype,"_offsetX",{get:function(){return this._elements[4]},enumerable:!0,configurable:!0}),Object.defineProperty(cIt.prototype,"_offsetY",{get:function(){return this._elements[5]},enumerable:!0,configurable:!0}),cIt.prototype._clone=function(){return new cIt(this._elements.slice())},cIt.prototype._translate=function(e,t){this._elements[4]=e,this._elements[5]=t},cIt.prototype._transform=function(e){var t=e[0],e=e[1];return[t*this._elements[0]+e*this._elements[2]+this._offsetX,t*this._elements[1]+e*this._elements[3]+this._offsetY]},cIt.prototype._multiply=function(e){this._elements=[this._elements[0]*e._elements[0]+this._elements[1]*e._elements[2],this._elements[0]*e._elements[1]+this._elements[1]*e._elements[3],this._elements[2]*e._elements[0]+this._elements[3]*e._elements[2],this._elements[2]*e._elements[1]+this._elements[3]*e._elements[3],this._offsetX*e._elements[0]+this._offsetY*e._elements[2]+e._offsetX,this._offsetX*e._elements[1]+this._offsetY*e._elements[3]+e._offsetY]};var pIt=cIt;function cIt(e,t,i,n,o,r){this._elements=void 0===e?[]:"number"==typeof e?[e,t,i,n,o,r]:e}var uIt,gIt=function(e,t){e&&(this._g=e,this._transformationMatrix=t),this._charSpacing=0,this._wordSpacing=0,this._textScaling=100,this._textRenderingMode=uIt.fill},mIt=function(){},fIt=((d=uIt=uIt||{})[d.fill=0]="fill",d[d.stroke=1]="stroke",d[d.fillStroke=2]="fillStroke",d[d.none=3]="none",d[d.clipFlag=4]="clipFlag",d[d.clipFill=4]="clipFill",d[d.clipStroke=5]="clipStroke",d[d.clipFillStroke=6]="clipFillStroke",d[d.clip=7]="clip",function(e){this._color=void 0!==e?e:[0,0,0]}),yIt=function(e,t){this._color=e,this._width=t,this._dashOffset=0,this._dashPattern=[],this._dashStyle=t1t.solid,this._miterLimit=0,this._lineCap=i1t.flat,this._lineJoin=n1t.miter},vIt=(bIt.prototype._updateProportions=function(e){return[e/2.54,e/6,1,e/72,e,e/300,e/25.4]},bIt.prototype._convertUnits=function(e,t,i){return this._convertFromPixels(this._convertToPixels(e,t),i)},bIt.prototype._convertFromPixels=function(e,t){return e/this._proportions[Number.parseInt(t.toString(),10)]},bIt.prototype._convertToPixels=function(e,t){return e*this._proportions[Number.parseInt(t.toString(),10)]},bIt);function bIt(){this._horizontalResolution=96,this._proportions=this._updateProportions(this._horizontalResolution)}Object.defineProperty(CIt.prototype,"buffer",{get:function(){return this._flush(),this._buffer},enumerable:!0,configurable:!0}),CIt.prototype._writeStartDocument=function(e){if("Initial"!==this._currentState||void 0===this._buffer)throw new Error("InvalidOperationException: Wrong Token");this._currentState="StartDocument",this._rawText('<?xml version="1.0" encoding="utf-8'),null!=e&&(this._rawText('" standalone="'),this._rawText(e?"yes":"no")),this._rawText('"?>')},CIt.prototype._writeStartElement=function(e,t,i){if(void 0===this._buffer)throw new Error("InvalidOperationException: Wrong Token");if(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",null==t)null==(t=null!=i?this._lookupPrefix(i):t)&&(t="");else if(0<t.length&&(null==(i=null==i?this._lookupNamespace(t):i)||void 0!==i&&0===i.length))throw new Error("ArgumentException: Cannot use a prefix with an empty namespace");null==i&&(i=this._lookupNamespace(t)),this._writeStartElementInternal(t,e,i)},CIt.prototype._writeEndElement=function(){"StartElement"===this._currentState?(this._startElementContent(),this._currentState="ElementContent"):"ElementContent"===this._currentState&&(this._currentState="ElementContent"),this._currentState="EndElement";var e=this._elementStack.length-1;this._writeEndElementInternal(this._elementStack[Number.parseInt(e.toString(),10)]._prefix,this._elementStack[Number.parseInt(e.toString(),10)]._localName),this._namespaceStack.splice(this._elementStack[Number.parseInt(e.toString(),10)]._previousTop+1),this._elementStack.splice(e)},CIt.prototype._writeElementString=function(e,t,i,n){this._writeStartElement(e,i,n),null!=t&&0!==t.length&&this._writeString(t),this._writeEndElement()},CIt.prototype._writeAttributeString=function(e,t,i,n){this._writeStartAttribute(e,t,i,n),this._writeStringInternal(t,!0),this._writeEndAttribute()},CIt.prototype._writeString=function(e){this._writeInternal(e,!1)},CIt.prototype._writeRaw=function(e){this._writeInternal(e,!0)},CIt.prototype._writeInternal=function(e,t){if(null!=e){if("StartElement"!==this._currentState&&"ElementContent"!==this._currentState)throw new Error("InvalidOperationException: Wrong Token");"StartElement"===this._currentState&&this._startElementContent(),this._currentState="ElementContent",t?this._rawText(e):this._writeStringInternal(e,!1)}},CIt.prototype._save=function(){for(;0<this._elementStack.length-1;)this._writeEndElement();return""!==this._bufferText&&this._flush(),this._buffer},CIt.prototype._destroy=function(){this._buffer=void 0;for(var e=0;e<this._namespaceStack.length;e++)this._namespaceStack[Number.parseInt(e.toString(),10)]._destroy();this._namespaceStack=[];for(e=0;e<this._elementStack.length;e++)this._elementStack[Number.parseInt(e.toString(),10)]._destroy();this._elementStack=[],this._bufferText="",this._position=0},CIt.prototype._flush=function(){if(this._buffer&&this._bufferText&&""!==this._bufferText){if(0<this._buffer.length){for(var e=new Array(this._bufferText.length),t=0;t<this._bufferText.length;t++)e[Number.parseInt(t.toString(),10)]=255&this._bufferText.charCodeAt(t);var i=new Uint8Array(this._buffer.length+e.length);i.set(this._buffer),i.set(e,this._buffer.length),this._buffer=i}else this._buffer=yMt(this._bufferText);this._bufferText=""}},CIt.prototype._writeStartAttribute=function(e,t,i,n){if(null==e||0===e.length){if("xmlns"!==i)throw new Error("ArgumentException: localName cannot be undefined, null or empty");e="xmlns",i=""}if("StartElement"!==this._currentState)throw new Error("InvalidOperationException: Wrong Token");this._checkName(e),this._writeStartAttributePrefixAndNameSpace(e,t,i,n)},CIt.prototype._writeStartAttributePrefixAndNameSpace=function(e,t,i,n){null==i&&null==(i=null==n||"xmlns"===e&&"http://www.w3.org/2000/xmlns/"===n?i:this._lookupPrefix(n))&&(i=""),null==n&&null==(n=null!=i&&0<i.length?this._lookupNamespace(i):n)&&(n=""),this._writeStartAttributeSpecialAttribute(i,e,n,t)},CIt.prototype._writeStartAttributeSpecialAttribute=function(e,t,i,n){if(0===e.length){if("x"===t[0]&&"xmlns"===t)return this._skipPushAndWrite(e,t,i),void this._pushNamespaceExplicit("",n);0<i.length&&(e=this._lookupPrefix(i))}else{if("x"===e[0]){if("xmlns"===e)return this._skipPushAndWrite(e,t,i),void this._pushNamespaceExplicit(t,n);if("xml"===e&&("space"===t||"lang"===t))return void this._skipPushAndWrite(e,t,i)}0===i.length&&(e="")}null!=e&&0!==e.length&&this._pushNamespaceImplicit(e,i),this._skipPushAndWrite(e,t,i)},CIt.prototype._writeEndAttribute=function(){this._currentState="StartElement",this._bufferText+='"'},CIt.prototype._writeStartElementInternal=function(e,t,i){this._bufferText+="<",0<e.length&&(this._rawText(e),this._bufferText+=":"),this._rawText(t);var n=this._elementStack.length;this._elementStack.push(new xIt),this._elementStack[Number.parseInt(n.toString(),10)]._set(e,t,i,this._namespaceStack.length-1),this._pushNamespaceImplicit(e,i);for(var o=0;o<this._attributeStack.length;o++)this._attributeStack[Number.parseInt(o.toString(),10)]._destroy();this._attributeStack=[]},CIt.prototype._writeEndElementInternal=function(e,t){this._position!==this._bufferText.length+1?(this._bufferText+="</",null!=e&&0!==e.length&&(this._rawText(e),this._bufferText+=":"),this._rawText(t),this._bufferText+=">"):(this._bufferText=this._bufferText.substring(0,this._bufferText.length-1),this._bufferText+=" />")},CIt.prototype._writeStartAttributeInternal=function(e,t){this._bufferText+=" ",null!=e&&0<e.length&&(this._rawText(e),this._bufferText+=":"),this._rawText(t),this._bufferText+='="'},CIt.prototype._writeNamespaceDeclaration=function(e,t){this._skipNamespace||(this._writeStartNamespaceDeclaration(e),this._writeStringInternal(t,!0),this._bufferText+='"')},CIt.prototype._writeStartNamespaceDeclaration=function(e){null==e||0===e.length?this._rawText(' xmlns="'):(this._rawText(" xmlns:"),this._rawText(e),this._bufferText+="=",this._bufferText+='"')},CIt.prototype._writeStringInternal=function(e,t){e=(e=(e=(e=null==e?"":e).replace(/\&/g,"&amp;")).replace(/\</g,"&lt;")).replace(/\>/g,"&gt;"),t&&(e=e.replace(/\"/g,"&quot;")),this._bufferText+=e,t||(this._position=0)},CIt.prototype._startElementContent=function(){for(var e=this._elementStack[this._elementStack.length-1]._previousTop,t=this._namespaceStack.length-1;e<t;t--)"NeedToWrite"===this._namespaceStack[Number.parseInt(t.toString(),10)]._kind&&this._writeNamespaceDeclaration(this._namespaceStack[Number.parseInt(t.toString(),10)]._prefix,this._namespaceStack[Number.parseInt(t.toString(),10)]._namespaceUri);this._bufferText+=">",this._position=this._bufferText.length+1},CIt.prototype._rawText=function(e){this._bufferText+=e},CIt.prototype._addNamespace=function(e,t,i){var n=this._namespaceStack.length;this._namespaceStack.push(new SIt),this._namespaceStack[Number.parseInt(n.toString(),10)]._set(e,t,i)},CIt.prototype._lookupPrefix=function(e){for(var t=this._namespaceStack.length-1;0<=t;t--)if(this._namespaceStack[Number.parseInt(t.toString(),10)]._namespaceUri===e)return this._namespaceStack[Number.parseInt(t.toString(),10)]._prefix},CIt.prototype._lookupNamespace=function(e){for(var t=this._namespaceStack.length-1;0<=t;t--)if(this._namespaceStack[Number.parseInt(t.toString(),10)]._prefix===e)return this._namespaceStack[Number.parseInt(t.toString(),10)]._namespaceUri},CIt.prototype._lookupNamespaceIndex=function(e){for(var t=this._namespaceStack.length-1;0<=t;t--)if(this._namespaceStack[Number.parseInt(t.toString(),10)]._prefix===e)return t;return-1},CIt.prototype._pushNamespaceImplicit=function(e,t){var i,n=this._lookupNamespaceIndex(e),o=!0;if(-1!==n)if(n>this._elementStack[this._elementStack.length-1]._previousTop){if(this._namespaceStack[Number.parseInt(n.toString(),10)]._namespaceUri!==t)throw new Error("XmlException namespace Uri needs to be the same as the one that is already declared");o=!1}else if("Special"===this._namespaceStack[Number.parseInt(n.toString(),10)]._kind){if("xml"!==e)throw new Error('InvalidArgumentException: Prefix "xmlns" is reserved for use by XML.');if(t!==this._namespaceStack[Number.parseInt(n.toString(),10)]._namespaceUri)throw new Error("InvalidArgumentException: Xml String");i="Implied"}else i=this._namespaceStack[Number.parseInt(n.toString(),10)]._namespaceUri===t?"Implied":"NeedToWrite";else{if("http://www.w3.org/XML/1998/namespace"===t&&"xml"!==e||"http://www.w3.org/2000/xmlns/"===t&&"xmlns"!==e)throw new Error("InvalidArgumentException");i="NeedToWrite"}o&&this._addNamespace(e,t,i)},CIt.prototype._pushNamespaceExplicit=function(e,t){var i=this._lookupNamespaceIndex(e);-1!==i&&i>this._elementStack[this._elementStack.length-1]._previousTop?this._namespaceStack[Number.parseInt(i.toString(),10)]._kind="Written":this._addNamespace(e,t,"Written")},CIt.prototype._addAttribute=function(e,t,i){var n=this._attributeStack.length;this._attributeStack.push(new TIt),this._attributeStack[Number.parseInt(n.toString(),10)]._set(e,t,i);for(var o=0;o<n;o++)if(this._attributeStack[Number.parseInt(o.toString(),10)]._isDuplicate(e,t,i))throw new Error("XmlException: duplicate attribute name")},CIt.prototype._skipPushAndWrite=function(e,t,i){this._addAttribute(e,t,i),this._writeStartAttributeInternal(e,t)},CIt.prototype._checkName=function(e){if(/[ !@#$%^&*()+\=\[\]{};':"\\|,<>\/?]/.test(e))throw new Error("InvalidArgumentException: invalid name character")};var wIt=CIt;function CIt(e){void 0===e&&(e=!1),this._position=0,this._bufferText="",this._buffer=new Uint8Array(0),this._namespaceStack=[],this._elementStack=[],e?(this._currentState="StartDocument",this._skipNamespace=!0):(this._currentState="Initial",this._namespaceStack.push(new SIt),this._elementStack.push(new xIt),this._namespaceStack[0]._set("xmlns","http://www.w3.org/2000/xmlns/","Special"),this._namespaceStack.push(new SIt),this._namespaceStack[1]._set("xml","http://www.w3.org/XML/1998/namespace","Special"),this._namespaceStack.push(new SIt),this._namespaceStack[2]._set("","","Implied"),this._elementStack[0]._set("","","",this._namespaceStack.length-1)),this._attributeStack=[]}AIt.prototype._set=function(e,t,i){this._prefix=e,this._namespaceUri=t,this._kind=i},AIt.prototype._destroy=function(){this._prefix=void 0,this._namespaceUri=void 0,this._kind=void 0};var SIt=AIt;function AIt(){}IIt.prototype._set=function(e,t,i,n){this._previousTop=n,this._prefix=e,this._namespaceUri=i,this._localName=t},IIt.prototype._destroy=function(){this._previousTop=void 0,this._prefix=void 0,this._localName=void 0,this._namespaceUri=void 0};var xIt=IIt;function IIt(){}EIt.prototype._set=function(e,t,i){this._prefix=e,this._namespaceUri=i,this._localName=t},EIt.prototype._isDuplicate=function(e,t,i){return this._localName===t&&(this._prefix===e||this._namespaceUri===i)},EIt.prototype._destroy=function(){this._prefix=void 0,this._namespaceUri=void 0,this._localName=void 0};var TIt=EIt;function EIt(){}DIt=function(e,t){return(DIt=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])}))(e,t)};var DIt,Gmt=function(e,t){function i(){this.constructor=e}DIt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},i0=(MIt.prototype._exportFormFieldsData=function(e){var t="";if(null!=e&&e.export){var i=PMt(e._dictionary,"FT",!1,!0,"Parent");if(i&&null!==i.name&&void 0!==i.name){var n,o,r,s,a,l=this._getEncodedFontDictionary(e._dictionary),h=e.name,d=(null!=l&&(h=this._getEncodedValue(h,l)),void 0),p=void 0;switch(i.name){case"Tx":null!=(t=PMt(e._dictionary,"V",!1,!0,"Parent"))?(t=this._getEncodedValue(t,l),this._table.set(h,t)):this._exportEmptyFields&&this._table.set(h,t="");break;case"Ch":if(null!=(d=PMt(e._dictionary,"V",!0,!0,"Parent"))&&(p=this._getExportValue(d)),null!=(p=!d&&e._dictionary.has("I")&&(e instanceof fTt||e instanceof uTt)?e._obtainSelectedValue():p)){if("string"==typeof p&&""!==p)t=p=this._getEncodedValue(p,l),this._table.set(h,t);else if(p instanceof Array&&0<p.length){for(var c=[],u=0;u<p.length;u++)c.push(this._getEncodedValue(p[Number.parseInt(u.toString(),10)],l));return this._table.set(h,c),c}}else this._exportEmptyFields&&this._table.set(h,t="");break;case"Btn":null!=(d=PMt(e._dictionary,"V",!1,!0,"Parent"))?null!=(n=this._getExportValue(d,e))&&""!==n?(a=void 0,e instanceof aTt&&(a=e),(!e._dictionary.has("Opt")||null!=a&&-1===a.selectedIndex||e._dictionary.has("Opt")&&(o=e._dictionary.getArray("Opt"),null!=(r=Number.parseInt(n,10))&&!Number.isNaN(r)||(r=0),null!=o)&&(s=void 0,null!=(n=null!=(s=a?o[a.selectedIndex]:o[Number.parseInt(r.toString(),10)])?s:n))&&""!==n)&&(t=n=this._getEncodedValue(n,l),this._table.set(h,t))):(e instanceof aTt||e instanceof oTt)&&(t=this._exportEmptyFields?n:"Off",this._table.set(h,t)):e instanceof aTt?(t=(t=e._getAppearanceStateValue())||(this._exportEmptyFields?"":"Off"),this._table.set(h,t)):(a=void 0,(a=(e.itemAt(e._defaultIndex)||e)._dictionary)&&a.has("AS")?(t=a.get("AS").name,this._table.set(h,t)):this._exportEmptyFields&&this._table.set(h,t=""))}}}return t},MIt.prototype._exportFormFieldData=function(e){var t=PMt(e._dictionary,"FT",!1,!0,"Parent");if(t&&null!==t.name&&void 0!==t.name){var i,n,o,r,s,a=this._getEncodedFontDictionary(e._dictionary),l=e.name,h=(null!=a&&(l=this._getEncodedValue(l,a)),void 0),d=void 0;switch(t.name){case"Tx":h=PMt(e._dictionary,"V",!1,!0,"Parent"),this._asPerSpecification?e._dictionary.has("RV")?null!=(h=PMt(e._dictionary,"RV",!1,!0,"Parent"))&&(h+=this._key,this._formKey=this._key,this._table.set(l,h)):null!=h&&(s=h=this._getEncodedValue(h,a),e instanceof ZIt&&e.multiLine&&(h=s=(s=s.replace("\n","")).replace("\r","\r\n")),this._table.set(l,h)):null!=h?(h=this._getEncodedValue(h,a),this._table.set(l,h)):this._exportEmptyFields&&this._table.set(l,"");break;case"Ch":if(d=PMt(e._dictionary,"V",!0,!0,"Parent"),this._asPerSpecification){if(e instanceof dTt)if(Array.isArray(d))this._table.set(l,d);else if("string"==typeof d)d=this._getEncodedValue(d,a),this._table.set(l,d);else if(null==d&&e._dictionary.has("I"))if(null!=(u=e._obtainSelectedValue()))if("string"==typeof u&&""!==u)u=this._getEncodedValue(u,a),this._table.set(l,h);else if(u instanceof Array&&0<u.length){for(var p=[],c=0;c<u.length;c++)p.push(this._getEncodedValue(u[Number.parseInt(c.toString(),10)],a));this._table.set(l,p)}}else{var u=void 0;if(null!=d&&(u=this._getExportValue(d)),null!=(u=!d&&e._dictionary.has("I")&&(e instanceof fTt||e instanceof uTt)?e._obtainSelectedValue():u))if("string"==typeof u&&""!==u)u=this._getEncodedValue(u,a),this._table.set(l,u);else if(u instanceof Array&&0<u.length){for(p=[],c=0;c<u.length;c++)p.push(this._getEncodedValue(u[Number.parseInt(c.toString(),10)],a));this._table.set(l,p)}else this._exportEmptyFields&&this._table.set(l,"");else this._exportEmptyFields&&this._table.set(l,"")}break;case"Btn":null!=(d=PMt(e._dictionary,"V",!1,!0,"Parent"))?null!=(r=this._getExportValue(d,e))&&""!==r?(this._asPerSpecification&&"XML"!==this._format&&(r=TMt(r)),s=void 0,e instanceof aTt&&(s=e),(!e._dictionary.has("Opt")||null!=s&&-1===s.selectedIndex||e._dictionary.has("Opt")&&(i=e._dictionary.getArray("Opt"),null!=(n=Number.parseInt(r,10))&&!Number.isNaN(n)||(n=0),null!=i)&&(o=void 0,null!=(r=null!=(o=s?i[s.selectedIndex]:i[Number.parseInt(n.toString(),10)])?o:r))&&""!==r)&&(r=this._getEncodedValue(r,a),this._table.set(l,r))):(e instanceof aTt||e instanceof oTt)&&(this._exportEmptyFields?this._table.set(l,r):this._table.set(l,"Off")):e instanceof aTt?(r=(r=e._getAppearanceStateValue())||(this._exportEmptyFields?"":"Off"),this._table.set(l,r)):(s=void 0,(s=(e.itemAt(e._defaultIndex)||e)._dictionary)&&s.has("AS")?this._table.set(l,s.get("AS").name):this._exportEmptyFields&&this._table.set(l,""))}}},MIt.prototype._getAnnotationType=function(e){var t="";return t=e&&e.has("Subtype")&&(e=e.get("Subtype"))?e.name:t},MIt.prototype._getValue=function(e,t){void 0===t&&(t=!1);var i="";if(null!=e)if(e instanceof k)i=e.name;else if("boolean"==typeof e)i=e?t?"true":"yes":t?"false":"no";else if("string"==typeof e)i=this._getValidString(e);else if(Array.isArray(e)){var n=e;0<n.length&&(i=this._getValue(n[0],t));for(var o=1;o<n.length;o++)i+=","+this._getValue(n[Number.parseInt(o.toString(),10)],t)}else"number"==typeof e&&(i=e.toString());return i},MIt.prototype._getColor=function(e){var t,i,n="";return e&&Array.isArray(e)&&3<=e.length&&(t=Math.round(255*e[0]).toString(16).toUpperCase(),i=Math.round(255*e[1]).toString(16).toUpperCase(),e=Math.round(255*e[2]).toString(16).toUpperCase(),n="#"+(1===t.length?"0"+t:t)+(1===i.length?"0"+i:i)+(1===e.length?"0"+e:e)),n},MIt.prototype._getValidString=function(e){return e=-1!==(e=-1!==e.indexOf("\n")?e.replace(/\n/g,"\\n"):e).indexOf("\r")?e.replace(/\r/g,"\\r"):e},MIt.prototype._getEncodedFontDictionary=function(e){var t,i,n;return e.has("Kids")&&!e.has("AP")&&(n=e.getArray("Kids")),t=(e.has("AP")||null!=n&&Array.isArray(n))&&(i=void 0,null!=n&&0<n.length?null!=(n=n[0])&&n.has("AP")&&(i=n.get("AP")):i=e.get("AP"),null!=i)&&i.has("N")&&null!=(n=i.get("N"))&&n instanceof SPt&&n.dictionary.has("Resources")&&null!=(e=n.dictionary.get("Resources"))&&e.has("Font")?e.get("Font"):t},MIt.prototype._getEncodedValue=function(e,t){var n,o=this,r=e;if(null!==this._encodeDictionary&&void 0!==this._encodeDictionary)return n=new FIt(this._encodeDictionary),this._replaceNotUsedCharacters(r,n);var i=this._document.form._dictionary;if(null!=i&&i.has("DR")){i=i.get("DR");if(null!=i&&i.has("Encoding")){i=i.get("Encoding");if(null!=i&&i.has("PDFDocEncoding")){i=i.get("PDFDocEncoding");if(null!=i&&i.has("Differences")){var s=new mPt(this._crossReference),i=(s.set("Differences",i.get("Differences")),this._crossReference._getNextReference()),s=(this._crossReference._cacheMap.set(i,s),new mPt(this._crossReference));if(s.set("Subtype",k.get("Type1")),s.set("Encoding",i),null!=(n=new FIt(s))&&null!==n.differencesDictionary&&void 0!==n.differencesDictionary&&0<n.differencesDictionary.size)return this._encodeDictionary=s,this._replaceNotUsedCharacters(r,n)}}}}if(null!=e&&null!=t&&0<t.size){var a,l=!1;if(t.forEach(function(e,t){var i;l||null==t||(i=void 0,t instanceof mPt?i=t:t instanceof aPt&&null!=(t=o._crossReference._fetch(t))&&t instanceof mPt&&(i=t),i&&(n=new FIt(i),a=o._replaceNotUsedCharacters(r,n),l=!0))}),!l)return a}return r},MIt.prototype._replaceNotUsedCharacters=function(e,t){for(var i="",n=t.differencesDictionary,o=0;o<e.length;o++){var r,s=e[Number.parseInt(o.toString(),10)],a=e.charCodeAt(o);!n.has(s)||1<(r=n.get(s)).length&&"Type3"!==t._fontType||127<a&&a<=255&&"Type1"===t._fontType&&"WinAnsiEncoding"!==t._baseFontEncoding&&"Encoding"===t._fontEncoding&&"ZapfDingbats"===t._fontName?i+=s:i+=r}return i},MIt.prototype._getExportValue=function(e,t){var i;if(null!=e)if(null!=t)e instanceof k?i=e.name:"string"==typeof e&&(i=e),null!=i&&""!==i&&t instanceof aTt&&-1!==t.selectedIndex&&null!=(t=t.itemAt(t.selectedIndex))&&t.value===i&&(i=t.value);else if(e instanceof k)i=e.name;else if("string"==typeof e)i=e;else if(Array.isArray(e)){for(var n=[],o=0;o<e.length;o++){var r=e[Number.parseInt(o.toString(),10)];r instanceof k?n.push(r.name):"string"==typeof r&&n.push(r)}return n}return i},MIt.prototype._addReferenceToGroup=function(e,t){var i=t.get("NM");i&&""!==i?(this._groupReferences.set(i,e),t.has("IRT")&&this._groupHolders.push(t)):!i&&t.has("IRT")&&(i=t.get("IRT"))&&""!==i&&this._groupReferences.has(i)&&t.update("IRT",this._groupReferences.get(i))},MIt.prototype._handlePopup=function(e,t,i,n){var o;i&&i.has("Popup")&&(o=i.getRaw("Popup"),i=i.get("Popup"))&&i instanceof mPt&&(o&&i&&i.update("Parent",t),o=e._parseAnnotation(i),t=e._annotations.length,n.set("Annots",e._annotations),n._updated=!0,e._parsedAnnotations.set(t,o))},MIt.prototype._importField=function(){var n=this,o=this._document.form,r=o.count;r&&this._fields.forEach(function(e,t){0<n._richTextValues.size&&n._richTextValues.has(t)&&(i=n._richTextValues.get(t));var i,t=o._getFieldIndex(t);-1!==t&&t<r&&(t=o.fieldAt(t))&&null!=t&&(i&&""!==i&&t._dictionary.update("RV",i),n._importFieldData(t,e))})},MIt.prototype._importFieldData=function(e,t){if(null!=t&&0<t.length&&null!=e&&!e.readOnly){var i=t[0];if(e instanceof ZIt)null!=i&&(e instanceof ZIt&&e.multiLine&&(i=(i=i.replace("\r\n","\r")).replace("\n","\r")),e.text=i);else if(e instanceof fTt||e instanceof uTt){var n=1<t.length?t:this._xmlImport?-1!==i.indexOf(",")?i.split(","):[i]:[-1!==i.indexOf(",")?i.split(",")[0]:i],o=[],r=e._options;r&&0<r.length&&r.forEach(function(e){-1===n.indexOf(e[0])&&-1===n.indexOf(e[1])||o.push(r.indexOf(e))}),0<o.length&&(e.selectedIndex=o,e instanceof uTt)&&this._asPerSpecification&&e._dictionary.has("AP")&&(delete e._dictionary._map.AP,e._dictionary._updated=!0)}else if(e instanceof oTt){t=i.toLowerCase();this._containsExportValue(i,e)||"on"===t||"yes"===t?e.checked=!0:e.checked=!1}else if(e instanceof aTt){for(var s=-1,a=0;a<e._kidsCount;a++){var l=e.itemAt(a);if(l&&l.value&&l.value===i){s=a;break}}-1!==s&&e.selectedIndex!==s&&(e.selectedIndex=s)}}},MIt.prototype._containsExportValue=function(t,e){var i,n=!1;if(0<e._kidsCount)for(var o=0;o<e._kidsCount;o++){var r=e.itemAt(o);if(r&&this._checkSelected(r._dictionary,t))return!0}else!(n=this._checkSelected(e._dictionary,t))&&this._asPerSpecification&&e._dictionary.has("AS")&&(!(i=e._dictionary.get("AS"))||"Off"!==i.name&&"No"!==i.name?n=!0:e._dictionary.has("Opt")&&(i=e._dictionary.getArray("Opt"))&&0<i.length&&i.forEach(function(e){e===t&&(n=!0)}));return n},MIt.prototype._checkSelected=function(e,t){if(e&&e.has("AP")){e=e.get("AP");if(e&&e instanceof mPt&&e.has("N")){e=e.get("N");if(e&&e instanceof mPt&&e.has(t)&&"off"!==t.toLocaleLowerCase()&&"no"!==t.toLocaleLowerCase())return!0}}return!1},MIt.prototype._dispose=function(){this.exportAppearance=void 0,this._asPerSpecification=void 0,this._skipBorderStyle=void 0,this._fileName=void 0,this._document=void 0,this._crossReference=void 0,this._isAnnotationExport=void 0,this._isAnnotationImport=void 0,this._key=void 0,this._formKey=void 0,this._exportEmptyFields=void 0,this._groupReferences=void 0,this._groupHolders=void 0,this._encodeDictionary=void 0,this._annotationTypes=void 0,this._annotationAttributes=void 0,this._xmlDocument=void 0,this._parser=void 0,this._table=void 0,this._fields=void 0,this._richTextValues=void 0,this._jsonData=void 0},MIt);function MIt(){this._asPerSpecification=!1,this._fileName="",this._formKey="",this._exportEmptyFields=!1,this._groupReferences=new Map,this._groupHolders=[],this._richTextPrefix='<?xml version="1.0"?>',this._table=new Map,this._fields=new Map,this._richTextValues=new Map,this._jsonData=[],this._openingBrace=123,this._openingBracket=91,this._closingBrace=125,this._closingBracket=93,this._colon=58,this._doubleQuotes=34,this._comma=44,this._space=32,this.fdfString="",this._xmlImport=!1}Gmt(BIt,kIt=i0),BIt.prototype._exportAnnotations=function(e){return this._document=e,this._crossReference=e._crossReference,this._isAnnotationExport=!0,this._save()},BIt.prototype._exportFormFields=function(e){return this._document=e,this._crossReference=e._crossReference,this._isAnnotationExport=!1,this._key=XMt(),this._save()},BIt.prototype._save=function(){var e=new wIt;if(e._writeStartDocument(),e._writeStartElement("xfdf"),e._writeAttributeString(null,"http://ns.adobe.com/xfdf/","xmlns",null),e._writeAttributeString("space","preserve","xml",null),this._isAnnotationExport){if(e._writeStartElement("annots"),this._document)for(var t=0;t<this._document.pageCount;t++)for(var i=this._document.getPage(t).annotations,n=0;n<i.count;n++){var o=i.at(n);o&&(!this._annotationTypes||0===this._annotationTypes.length||this._annotationTypes&&0<this._annotationTypes.length&&this._checkAnnotationType(o))&&this._exportAnnotationData(o,e,t)}e._writeEndElement()}else{var r=this._document.form;if(null!=r){this._exportEmptyFields=r.exportEmptyFields;for(var s=this._document.form.count,t=0;t<s;t++){var a=this._document.form.fieldAt(t);null!=a&&a.export&&this._exportFormFieldData(a)}this._writeFormFieldData(e,this._asPerSpecification)}}this._asPerSpecification||(e._writeStartElement("f"),e._writeAttributeString("href",this._fileName));r=e._save();return e._destroy(),r},BIt.prototype._writeFormFieldData=function(i,e){var n,t,o=this;(e=void 0===e?!1:e)?(i._writeStartElement("f"),i._writeAttributeString("href",this._fileName),i._writeEndElement(),(e=this._getElements(this._table))&&0<e.size&&(i._writeStartElement("fields"),n=!1,e.forEach(function(e,t){i._writeStartElement("field"),i._writeAttributeString("name",t.toString()),Array.isArray(e)&&e.forEach(function(e){i._writeStartElement("value"),i._writeString(e.toString()),i._writeEndElement(),n=!0}),e instanceof Map?o._writeFieldName(e,i):!n&&!e.toString().endsWith(o._formKey)||!n&&""===o._formKey?(i._writeStartElement("value"),i._writeString(e.toString()),i._writeEndElement()):""!==o._formKey&&e.toString().endsWith(o._formKey)&&(i._writeStartElement("value-richtext"),e=(t=(t=e.toString()).startsWith('<?xml version="1.0"?>')?t.substring(21):t).length-o._formKey.length,t=t.substring(0,e)+t.substring(e+o._formKey.length),i._writeRaw(t),i._writeEndElement()),i._writeEndElement(),n=!1}),i._writeEndElement()),i._writeStartElement("ids"),e=!1,this._crossReference._root.has("ID")&&(t=this._crossReference._root.getArray("ID"))&&1<=t.length&&(i._writeAttributeString("original",t[0]),i._writeAttributeString("modified",t[1]),e=!0),e||(i._writeAttributeString("original",""),i._writeAttributeString("modified",""))):(i._writeStartElement("fields"),this._table.forEach(function(e,t){i._writeStartElement("field"),i._writeAttributeString("name",t.toString()),Array.isArray(e)?e.forEach(function(e){i._writeStartElement("value"),i._writeString(e.toString()),i._writeEndElement()}):(i._writeStartElement("value"),i._writeString(e.toString()),i._writeEndElement()),i._writeEndElement()})),i._writeEndElement()},BIt.prototype._writeFieldName=function(e,n){var o=this;e.forEach(function(e,t){var i;e instanceof Map?(n._writeStartElement("field"),n._writeAttributeString("name",t.toString()),o._writeFieldName(e,n)):(n._writeStartElement("field"),n._writeAttributeString("name",t.toString()),Array.isArray(e)?e.forEach(function(e){n._writeStartElement("value"),n._writeString(e.toString()),n._writeEndElement()}):(e.toString().endsWith(o._formKey)&&""!==o._formKey?(n._writeStartElement("value-richtext"),i=(t=(t=e.toString()).startsWith('<?xml version="1.0"?>')?t.substring(21):t).length-o._formKey.length,t=t.substring(0,i)+t.substring(i+o._formKey.length),n._writeRaw(t)):(n._writeStartElement("value"),n._writeString(e.toString())),n._writeEndElement())),n._writeEndElement()})},BIt.prototype._getElements=function(e){var a=this,l=new Map;return e.forEach(function(e,t){var i=l;if(-1!==t.toString().indexOf("."))for(var n=t.toString().split("."),o=0;o<n.length;o++){var r,s=n[Number.parseInt(o.toString(),10)];i.has(s)?(a._getElements(i[s]),i=i[s]):o===n.length-1?i.set(s,e):(r=new Map,i.set(s,r),i=r)}else i.set(t,e)}),l},BIt.prototype._checkAnnotationType=function(e){return void 0!==e._type&&-1!==this._annotationTypes.indexOf(e._type)},BIt.prototype._exportAnnotationData=function(e,t,i){e._dictionary&&!(e instanceof lEt||e instanceof yEt||e instanceof gEt||e instanceof pEt)&&this._writeAnnotationData(t,i,e)},BIt.prototype._writeAnnotationData=function(e,t,i){var n,o=!1,i=i instanceof TTt?(n=i)._dictionary:i,r=this._getAnnotationType(i);if(this._skipBorderStyle=!1,r&&""!==r){this._annotationAttributes||(this._annotationAttributes=[]),e._writeStartElement(r.toLowerCase()),e._writeAttributeString("page",t.toString()),this._annotationAttributes.push("page");var s=void 0;switch(r){case"Line":s=n.linePoints,e._writeAttributeString("start",s[0].toString()+","+s[1].toString()),e._writeAttributeString("end",s[2].toString()+","+s[3].toString());break;case"Stamp":case"Square":o=!0}i&&i.has("BE")&&i.has("BS")&&(r=i.get("BE"))&&r.has("S")&&(this._skipBorderStyle=!0),this._writeDictionary(i,t,e,o),e._writeEndElement(),this._annotationAttributes=[]}},BIt.prototype._writeDictionary=function(n,o,r,s){var e,t,i,a,l=this,h=!1;if(n.has("Type")&&(t=n.get("Type"),h=t&&"Border"===t.name&&this._skipBorderStyle),n.forEach(function(e,t){if((s||"AP"!==e)&&"P"!==e&&"Parent"!==e){var i=void 0;if((i=t instanceof aPt?n.get(e):i)&&i instanceof mPt)switch(e){case"BS":case"BE":l._writeDictionary(i,o,r,!1);break;case"IRT":i.has("NM")&&r._writeAttributeString("inreplyto",l._getValue(i.get("NM")))}else t instanceof mPt?l._writeDictionary(t,o,r,!1):h&&"S"===e||l._writeAttribute(r,e,t)}}),(this.exportAppearance||s)&&n.has("AP")&&(t=this._getAppearanceString(n.get("AP")))&&0<t.length&&(r._writeStartElement("appearance"),r._writeRaw(kMt(t)),r._writeEndElement()),n.has("Measure")&&this._exportMeasureDictionary(n.get("Measure"),r),n.has("Sound")?(t=n.get("Sound"))&&t.dictionary&&((i=t.dictionary).has("B")&&r._writeAttributeString("bits",this._getValue(i.get("B"))),i.has("C")&&r._writeAttributeString("channels",this._getValue(i.get("C"))),i.has("E")&&r._writeAttributeString("encoding",this._getValue(i.get("E"))),i.has("R")&&r._writeAttributeString("rate",this._getValue(i.get("R"))),i.has("Length"))&&0<i.get("Length")&&(a=xMt(t.getBytes()))&&""!==a&&(r._writeStartElement("data"),r._writeAttributeString("MODE","raw"),r._writeAttributeString("encoding","hex"),i.has("Length")&&r._writeAttributeString("length",this._getValue(i.get("Length"))),i.has("Filter")&&r._writeAttributeString("filter",this._getValue(i.get("Filter"))),r._writeRaw(a),r._writeEndElement()):n.has("FS")&&(t=n.get("FS"))&&(t.has("F")&&r._writeAttributeString("file",this._getValue(t.get("F"))),t.has("EF"))&&(i=t.get("EF"))&&i.has("F")&&(t=i.get("F"))&&t.dictionary&&((i=t.dictionary).has("Params")&&(e=i.get("Params"))&&(e.has("CreationDate")&&(c=this._getValue(e.get("CreationDate")),r._writeAttributeString("creation",c)),e.has("ModificationDate")&&(c=this._getValue(e.get("ModificationDate")),r._writeAttributeString("modification",c)),e.has("Size")&&r._writeAttributeString("size",this._getValue(e.get("Size"))),e.has("CheckSum"))&&(e=xMt(yMt(c=this._getValue(e.get("CheckSum")))),r._writeAttributeString("checksum",e)),a=xMt(t.getBytes()))&&""!==a&&(r._writeStartElement("data"),r._writeAttributeString("MODE","raw"),r._writeAttributeString("encoding","hex"),i.has("Length")&&r._writeAttributeString("length",this._getValue(i.get("Length"))),i.has("Filter")&&r._writeAttributeString("filter",this._getValue(i.get("Filter"))),r._writeRaw(a),r._writeEndElement()),n.has("Vertices")){r._writeStartElement("vertices");var d=n.getArray("Vertices");if(d&&0<d.length){var p=d.length;if(p%2==0){for(var c="",u=0;u<p-1;u++)c+=this._getValue(d[Number.parseInt(u.toString(),10)])+(u%2!=0?";":",");(c+=this._getValue(d[p-1]))&&""!==c&&r._writeRaw(c)}}r._writeEndElement()}if(n.has("Popup")&&(e=n.get("Popup"))&&this._writeAnnotationData(r,o,e),n.has("DA")&&(t=n.get("DA"))&&this._writeRawData(r,"defaultappearance",t),n.has("DS")&&(i=n.get("DS"))&&this._writeRawData(r,"defaultstyle",i),n.has("InkList")){var g=n.getArray("InkList");if(g&&0<g.length){r._writeStartElement("inklist");for(var m=0;m<g.length;m++)r._writeElementString("gesture",this._getValue(g[Number.parseInt(m.toString(),10)]));r._writeEndElement()}}n.has("RC")&&(c=n.get("RC"))&&""!==c&&(0<(a=c.indexOf("<body"))&&(c=c.substring(a)),this._writeRawData(r,"contents-richtext",c)),n.has("Contents")&&(c=n.get("Contents"))&&0<c.length&&(r._writeStartElement("contents"),r._writeString(c),r._writeEndElement())},BIt.prototype._getAppearanceString=function(e){var t=new wIt(!0),e=(t._writeStartElement("DICT"),t._writeAttributeString("KEY","AP"),this._writeAppearanceDictionary(t,e),t._writeEndElement(),t.buffer);return t._destroy(),e},BIt.prototype._writeAppearanceDictionary=function(i,n){var o=this;n&&0<n.size&&n.forEach(function(e,t){o._writeObject(i,t instanceof aPt?n.get(e):t,n,e)})},BIt.prototype._writeObject=function(e,t,i,n,o){var r,s;null!=t&&(t instanceof k?(this._writePrefix(e,"NAME",n),e._writeAttributeString("VAL",t.name),e._writeEndElement()):Array.isArray(t)?(this._writePrefix(e,"ARRAY",n),i.has(n)?this._writeArray(e,i.getArray(n),i):this._writeArray(e,t,i),e._writeEndElement()):"string"==typeof t?(this._writePrefix(e,"STRING",n),e._writeAttributeString("VAL",t),e._writeEndElement()):"number"==typeof t?(Number.isInteger(t)?(this._writePrefix(e,"INT",n),e._writeAttributeString("VAL",t.toString())):(this._writePrefix(e,"FIXED",n),e._writeAttributeString("VAL",t.toFixed(6))),e._writeEndElement()):"boolean"==typeof t?(this._writePrefix(e,"BOOL",n),e._writeAttributeString("VAL",t?"true":"false"),e._writeEndElement()):t instanceof mPt?(this._writePrefix(e,"DICT",n),this._writeAppearanceDictionary(e,t),e._writeEndElement()):null===t?(this._writePrefix(e,"NULL",n),e._writeEndElement()):t instanceof SPt&&t.dictionary?(r=t.dictionary,this._writePrefix(e,"STREAM",n),e._writeAttributeString("DEFINE",""),r.has("Subtype")&&"Image"===this._getValue(r.get("Subtype"))||!r.has("Type")&&!r.has("Subtype")?(s=void 0,s=!o||r.has("Filter")&&"DCTDecode"===r.get("Filter").name?t.getString(!0):Jkt(t,!0),!r.has("Length")&&s&&""!==s&&r.update("Length",t.length),this._writeAppearanceDictionary(e,r),e._writeStartElement("DATA"),e._writeAttributeString("MODE","RAW"),e._writeAttributeString("ENCODING","HEX")):(s=t.getString(),!r.has("Length")&&s&&""!==s&&r.update("Length",t.length),s=(s=s.replace(/</g,"&lt;")).replace(/>/g,"&gt;"),this._writeAppearanceDictionary(e,r),e._writeStartElement("DATA"),e._writeAttributeString("MODE","FILTERED"),e._writeAttributeString("ENCODING","ASCII")),s&&""!==s&&e._writeRaw(s),e._writeEndElement(),e._writeEndElement()):t instanceof aPt&&this._crossReference&&this._writeObject(e,this._crossReference._fetch(t),i,n,t._isNew))},BIt.prototype._writePrefix=function(e,t,i){e._writeStartElement(t),i&&e._writeAttributeString("KEY",i)},BIt.prototype._writeArray=function(t,e,i){var n=this;e.forEach(function(e){n._writeObject(t,e,i)})},BIt.prototype._getFormatedString=function(e,t){return e=(t=void 0===t?!1:t)?(e=(e=e.replace("&amp;","&")).replace("&lt;","<")).replace("&gt;",">"):(e=(e=e.replace("&","&amp;")).replace("<","&lt;")).replace(">","&gt;")},BIt.prototype._writeAttribute=function(e,t,i){var n;if(this._annotationAttributes&&-1===this._annotationAttributes.indexOf(t))switch(t){case"C":this._writeColor(e,i,"color","c");break;case"IC":this._writeColor(e,i,"interior-color");break;case"M":this._writeAttributeString(e,"date",i);break;case"NM":this._writeAttributeString(e,"name",i);break;case"Name":this._writeAttributeString(e,"icon",i);break;case"Subj":this._writeAttributeString(e,"subject",i);break;case"T":this._writeAttributeString(e,"title",i);break;case"Rotate":this._writeAttributeString(e,"rotation",i);break;case"W":this._writeAttributeString(e,"width",i);break;case"LE":i&&Array.isArray(i)?2===i.length&&(e._writeAttributeString("head",this._getValue(i[0])),e._writeAttributeString("tail",this._getValue(i[1]))):i instanceof k&&this._writeAttributeString(e,"head",i);break;case"S":if(-1===this._annotationAttributes.indexOf("style")){switch(this._getValue(i)){case"D":e._writeAttributeString("style","dash");break;case"C":e._writeAttributeString("style","cloudy");break;case"S":e._writeAttributeString("style","solid");break;case"B":e._writeAttributeString("style","bevelled");break;case"I":e._writeAttributeString("style","inset");break;case"U":e._writeAttributeString("style","underline")}this._annotationAttributes.push("style")}break;case"D":this._writeAttributeString(e,"dashes",i);break;case"I":this._writeAttributeString(e,"intensity",i);break;case"RD":this._writeAttributeString(e,"fringe",i);break;case"IT":this._writeAttributeString(e,"IT",i);break;case"RT":this._writeAttributeString(e,"replyType",i,!0);break;case"LL":this._writeAttributeString(e,"leaderLength",i);break;case"LLE":this._writeAttributeString(e,"leaderExtend",i);break;case"Cap":this._writeAttributeString(e,"caption",i);break;case"Q":this._writeAttributeString(e,"justification",i);break;case"CP":this._writeAttributeString(e,"caption-style",i);break;case"CL":this._writeAttributeString(e,"callout",i);break;case"QuadPoints":this._writeAttributeString(e,"coords",i);break;case"CA":this._writeAttributeString(e,"opacity",i);break;case"F":"number"==typeof i&&-1===this._annotationAttributes.indexOf("flags")&&(n=gMt(i),e._writeAttributeString("flags",n),this._annotationAttributes.push("flags"));break;case"InkList":case"Type":case"Subtype":case"P":case"Parent":case"L":case"Contents":case"RC":case"DA":case"DS":case"FS":case"MeasurementTypes":case"Vertices":case"GroupNesting":case"ITEx":break;case"TextMarkupContent":n=yMt(i),this._writeAttributeString(e,t.toLowerCase(),xMt(n));break;default:this._writeAttributeString(e,t.toLowerCase(),i)}},BIt.prototype._writeAttributeString=function(e,t,i,n){void 0===n&&(n=!1),-1===this._annotationAttributes.indexOf(t)&&(i=this._getValue(i),e._writeAttributeString(t,n?i.toLowerCase():i),this._annotationAttributes.push(t))},BIt.prototype._writeRawData=function(e,t,i){i&&""!==i&&(e._writeStartElement(t),e._writeRaw(i),e._writeEndElement())},BIt.prototype._writeColor=function(e,t,i,n){var o=this._getColor(t);"number"==typeof t&&n&&(t=this._getValue(t))&&""!==t&&-1===this._annotationAttributes.indexOf(n)&&(e._writeAttributeString(n,t),this._annotationAttributes.push(n)),o&&""!==o&&-1===this._annotationAttributes.indexOf(i)&&(e._writeAttributeString(i,o),this._annotationAttributes.push(i))},BIt.prototype._exportMeasureDictionary=function(e,t){var i;t._writeStartElement("measure"),e&&(e.has("R")&&t._writeAttributeString("rateValue",this._getValue(e.get("R"))),e.has("A")&&(i=e.getArray("A"),t._writeStartElement("area"),this._exportMeasureFormatDetails(i[0],t),t._writeEndElement()),e.has("D")&&(i=e.getArray("D"),t._writeStartElement("distance"),this._exportMeasureFormatDetails(i[0],t),t._writeEndElement()),e.has("X"))&&(i=e.getArray("X"),t._writeStartElement("xformat"),this._exportMeasureFormatDetails(i[0],t),t._writeEndElement()),t._writeEndElement()},BIt.prototype._exportMeasureFormatDetails=function(e,t){e.has("C")&&t._writeAttributeString("c",this._getValue(e.get("C"))),e.has("F")&&t._writeAttributeString("f",this._getValue(e.get("F"))),e.has("D")&&t._writeAttributeString("d",this._getValue(e.get("D"))),e.has("RD")&&t._writeAttributeString("rd",this._getValue(e.get("RD"))),e.has("U")&&t._writeAttributeString("u",this._getValue(e.get("U"))),e.has("RT")&&t._writeAttributeString("rt",this._getValue(e.get("RT"))),e.has("SS")&&t._writeAttributeString("ss",this._getValue(e.get("SS"))),e.has("FD")&&t._writeAttributeString("fd",this._getValue(e.get("FD")))},BIt.prototype._importAnnotations=function(e,t){this._document=e,this._crossReference=e._crossReference;e=CMt(t,!(this._isAnnotationExport=!1));this._xmlDocument=(new DOMParser).parseFromString(e,"text/xml"),this._isAnnotationImport=!0,this._readXmlData(this._xmlDocument.documentElement)},BIt.prototype._importFormData=function(e,t){this._document=e,this._crossReference=e._crossReference,this._isAnnotationExport=!1,this._xmlDocument=(new DOMParser).parseFromString(CMt(t,!0),"text/xml"),this._readXmlData(this._xmlDocument.documentElement)},BIt.prototype._readXmlData=function(e){if(e&&1===e.nodeType)if(this._checkXfdf(e),this._isAnnotationImport){var t=e.getElementsByTagName("annots");if(t&&0<t.length)for(var i=0;i<t.length;i++){var n=t.item(i);if(n&&"annots"===n.localName&&n.hasChildNodes())for(var o=n.childNodes,r=0;r<o.length;r++){var s=o.item(r);s&&1===s.nodeType&&s&&1===s.nodeType&&this._parseAnnotationData(s)}}if(0<this._groupHolders.length)for(i=0;i<this._groupHolders.length;i++){var a=this._groupHolders[Number.parseInt(i.toString(),10)],l=a.get("IRT");l&&""!==l&&(this._groupReferences.has(l)?a.update("IRT",this._groupReferences.get(l)):delete a._map.IRT)}this._groupHolders=[],this._groupReferences=new Map}else this._parseFormData(e);this._dispose()},BIt.prototype._checkXfdf=function(e){if("xfdf"!==e.nodeName)throw new Error("Invalid XFDF file.")},BIt.prototype._parseFormData=function(e){var t,i=e.getElementsByTagName("f"),n=(i&&0<i.length&&(t=i.item(0))&&"f"===t.localName&&t.hasAttribute("href")&&(t=t.getAttribute("href"))&&""!==t&&(this._fileName=t),(i=e.getElementsByTagName("ids"))&&0<i.length&&(this._asPerSpecification=!0),e.childNodes);if(n&&0<n.length)for(var o=0;o<n.length;o++){var r=n.item(o);if(r&&1===r.nodeType)if(r&&"fields"===r.localName&&r.hasChildNodes()){for(var s=r.childNodes,a=[],l=0;l<s.length;l++){var h=s.item(l);h&&1===h.nodeType&&h&&"field"===h.localName&&a.push(h)}this._importFormNodes(a)}}this._importField()},BIt.prototype._importFormNodes=function(e){for(var t=0;t<e.length;t++){var i=e[Number.parseInt(t.toString(),10)],n="";if(i&&(n=i.hasAttribute("name")?i.getAttribute("name"):n)&&""!==n){var o=i.getElementsByTagName("value");if(o&&0<o.length){for(var r=i,s="";"fields"!==r.localName;){0<s.length&&(s="."+s);var a,l=!1;r.hasAttribute("name")&&(a=r.getAttribute("name"))&&""!==a&&(s=a+s,l=!0),l||(s+=r.localName),r=r.parentElement}var n=s,h=void 0;h=this._fields.has(n)?this._fields.get(n):[];for(var d=0;d<o.length;d++)h.push(o.item(d).textContent);this._fields.set(n,h)}else if((o=i.getElementsByTagName("value-richtext"))&&0<o.length){var p=o.item(0);if(p){for(r=i,s="";"fields"!==r.localName;){0<s.length&&(s="."+s);var c,l=!1;r.hasAttribute("name")&&(c=r.getAttribute("name"))&&""!==c&&(s=c+s,l=!0),l||(s+=r.localName),r=r.parentElement}n=s;var u=p.textContent;if(p.childNodes&&0<p.childNodes.length){i=p.childNodes[0];if(i&&i.hasChildNodes()){for(var u="",g=i.childNodes,d=void 0;d<g.length;d++)u+=g.item(d).textContent+"\r";u=0<u.length?u.substring(0,u.length-1):p.textContent}}h=void 0;h=this._fields.has(n)?this._fields.get(n):[];for(d=0;d<o.length;d++)h.push(u);this._fields.set(n,h),this._richTextValues.has(n)||this._richTextValues.set(n,p.innerHTML)}}}}},BIt.prototype._parseAnnotationData=function(e){var t,i,n,o,r;e&&(r=-1,e.hasAttributes)&&e.hasAttribute("page")&&0<=(r=Number.parseInt(e.getAttribute("page"),10))&&r<this._document.pageCount&&(r=this._document.getPage(r),e=this._getAnnotationDictionary(r,e))&&0<e.size&&(t=r._pageDictionary)&&(i=(r=r.annotations)._parseAnnotation(e))&&(i._isImported=!0,n=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(n,e),(e.has("NM")||e.has("IRT"))&&this._addReferenceToGroup(n,e),i._ref=n,o=r._annotations.length,r._annotations.push(n),r._comments&&0<r._comments.length&&(r._comments=[]),t.set("Annots",r._annotations),t._updated=!0,r._parsedAnnotations.set(o,i),this._handlePopup(r,n,e,t))},BIt.prototype._getAnnotationDictionary=function(e,t){var i,n=new mPt(this._crossReference),o=(n.update("Type",k.get("Annot")),!0);switch(t.localName.toLowerCase()){case"line":n.update("Subtype",k.get("Line")),t.hasAttribute("start")&&t.hasAttribute("end")&&(i=[],t.getAttribute("start").split(",").forEach(function(e){i.push(Number.parseFloat(e))}),t.getAttribute("end").split(",").forEach(function(e){i.push(Number.parseFloat(e))}),4===i.length)&&n.update("L",i),this._addLineEndStyle(n,t);break;case"circle":n.update("Subtype",k.get("Circle"));break;case"square":n.update("Subtype",k.get("Square"));break;case"polyline":n.update("Subtype",k.get("PolyLine")),this._addLineEndStyle(n,t);break;case"polygon":n.update("Subtype",k.get("Polygon")),this._addLineEndStyle(n,t);break;case"ink":n.update("Subtype",k.get("Ink"));break;case"popup":n.update("Subtype",k.get("Popup"));break;case"text":n.update("Subtype",k.get("Text"));break;case"freetext":n.update("Subtype",k.get("FreeText")),this._addLineEndStyle(n,t);break;case"stamp":n.update("Subtype",k.get("Stamp"));break;case"highlight":n.update("Subtype",k.get("Highlight"));break;case"squiggly":n.update("Subtype",k.get("Squiggly"));break;case"underline":n.update("Subtype",k.get("Underline"));break;case"strikeout":n.update("Subtype",k.get("StrikeOut"));break;case"fileattachment":n.update("Subtype",k.get("FileAttachment"));break;case"sound":n.update("Subtype",k.get("Sound"));break;case"caret":n.update("Subtype",k.get("Caret"));break;case"redact":n.update("Subtype",k.get("Redact"));break;default:o=!1}return o&&this._addAnnotationData(n,t,e),n},BIt.prototype._addAnnotationData=function(e,t,i){this._addBorderStyle(e,t),this._applyAttributeValues(e,t.attributes),this._parseInnerElements(e,t,i),this._addMeasureDictionary(e,t)},BIt.prototype._addBorderStyle=function(e,t){var i=new mPt(this._crossReference),n=new mPt(this._crossReference),o=(t.hasAttribute("width")&&n.update("W",Number.parseFloat(t.getAttribute("width"))),!0);if(t.hasAttribute("style")){var r,s="";switch(t.getAttribute("style")){case"dash":s="D";break;case"solid":s="S";break;case"bevelled":s="B";break;case"inset":s="I";break;case"underline":s="U";break;case"cloudy":o=!(s="C")}""!==s&&((o?n:i).update("S",k.get(s)),!o&&t.hasAttribute("intensity")?i.update("I",Number.parseFloat(t.getAttribute("intensity"))):t.hasAttribute("dashes")&&(r=[],t.getAttribute("dashes").split(",").forEach(function(e){r.push(Number.parseFloat(e))}),n.update("D",r)))}0<i.size&&e.update("BE",i),0<n.size&&(n.update("Type","Border"),e.update("BS",n))},BIt.prototype._applyAttributeValues=function(e,t){for(var i=0;i<t.length;i++){var n,o=t[Number.parseInt(i.toString(),10)],r=o.value,s=void 0;switch(o.name.toLowerCase()){case"page":case"start":case"end":case"width":case"head":case"tail":case"style":case"intensity":case"itex":break;case"state":this._addString(e,"State",r);break;case"statemodel":this._addString(e,"StateModel",r);break;case"replytype":"group"===r&&e.update("RT",k.get("Group"));break;case"inreplyto":this._addString(e,"IRT",r);break;case"rect":(s=this._obtainPoints(r))&&4===s.length&&e.update("Rect",s);break;case"color":(s=NMt(r))&&3===s.length&&e.update("C",[s[0]/255,s[1]/255,s[2]/255]);break;case"interior-color":(s=NMt(r))&&3===s.length&&e.update("IC",[s[0]/255,s[1]/255,s[2]/255]);break;case"date":this._addString(e,"M",r);break;case"creationdate":this._addString(e,"CreationDate",r);break;case"name":this._addString(e,"NM",r);break;case"icon":r&&""!==r&&e.update("Name",k.get(r));break;case"subject":this._addString(e,"Subj",this._getFormatedString(r,!0));break;case"title":this._addString(e,"T",this._getFormatedString(r,!0));break;case"rotation":this._addInt(e,"Rotate",r);break;case"justification":this._addInt(e,"Q",r);break;case"fringe":this._addFloatPoints(e,this._obtainPoints(r),"RD");break;case"it":r&&""!==r&&e.update("IT",k.get(r));break;case"leaderlength":this._addFloat(e,"LL",r);break;case"leaderextend":void 0!==(n=Number.parseFloat(r))&&e.update("LLE",n);break;case"caption":r&&""!==r&&e.update("Cap","yes"===r.toLowerCase());break;case"caption-style":r&&""!==r&&e.update("CP",k.get(r));break;case"callout":this._addFloatPoints(e,this._obtainPoints(r),"CL");break;case"coords":this._addFloatPoints(e,this._obtainPoints(r),"QuadPoints");break;case"border":this._addFloatPoints(e,this._obtainPoints(r),"Border");break;case"opacity":this._addFloat(e,"CA",r);break;case"flags":if(r&&""!==r){for(var a=bAt.default,l=r.split(","),h=0;h<l.length;h++){var d=mMt(l[Number.parseInt(h.toString(),10)]);0===h?a=d:a|=d}e.update("F",a)}break;case"open":r&&""!==r&&e.update("Open","true"===r||"yes"===r);break;case"calibrate":this._addString(e,"Calibrate",r);break;case"customdata":this._addString(e,"CustomData",r);break;case"overlaytext":e.update("OverlayText",r);break;case"repeat":e.update("Repeat","true"===r||"yes"===r);break;default:this._document._allowImportCustomData&&this._addString(e,o.name,r)}}},BIt.prototype._obtainPoints=function(e){var t=[];return e.split(",").forEach(function(e){t.push(Number.parseFloat(e))}),t},BIt.prototype._parseInnerElements=function(c,u,g){if(u.hasChildNodes)for(var m=u.childNodes,e=function(e){var t=m[Number.parseInt(e.toString(),10)];if(1===t.nodeType){var i,n,o,r,s=t,a=t.textContent,l=s.innerHTML;switch(t.nodeName.toLowerCase()){case"popup":s&&s.hasAttributes&&0<(i=f._getAnnotationDictionary(g,s)).size&&(n=f._crossReference._getNextReference(),f._crossReference._cacheMap.set(n,i),c.update("Popup",n),i.has("NM"))&&f._addReferenceToGroup(n,i);break;case"contents":a&&""!==a&&c.update("Contents",f._getFormatedString(a,!0));break;case"contents-richtext":l&&""!==l&&c.update("RC",f._richTextPrefix+l);break;case"defaultstyle":f._addString(c,"DS",a);break;case"defaultappearance":f._addString(c,"DA",a);break;case"vertices":a&&""!==a&&(o=[],a.split(",").forEach(function(e){-1!==e.indexOf(";")?e.split(";").forEach(function(e){o.push(e)}):o.push(e)}),0<o.length)&&(r=[],o.forEach(function(e){r.push(Number.parseFloat(e))}),c.update("Vertices",r));break;case"appearance":f._addAppearanceData(t,c);break;case"inklist":if(t.hasChildNodes){for(var h=[],d=t.childNodes,p=0;p<d.length;p++)!function(e){var t,i,e=d[Number.parseInt(e.toString(),10)];e&&1===e.nodeType&&"gesture"===(e=e).nodeName.toLowerCase()&&e.textContent&&""!==e.textContent&&(t=[],e.textContent.split(",").forEach(function(e){-1!==e.indexOf(";")?e.split(";").forEach(function(e){t.push(e)}):t.push(e)}),0<t.length)&&(i=[],t.forEach(function(e){i.push(Number.parseFloat(e))}),h.push(i))}(p);c.update("InkList",h)}break;case"data":f._addStreamData(t,c,u)}}},f=this,t=0;t<m.length;t++)e(t)},BIt.prototype._addStreamData=function(e,t,i){var n;e&&e.textContent&&""!==e.textContent&&(e=IMt(e.textContent,!0))&&0<e.length&&t.has("Subtype")&&((n=t.get("Subtype"))&&"FileAttachment"===n.name?this._addFileAttachment(t,i,e):n&&"Sound"===n.name&&this._addSound(t,i,e))},BIt.prototype._addSound=function(e,t,i){var i=new DPt(i),n=(i.dictionary._crossReference=this._crossReference,i.dictionary.update("Type",k.get("Sound")),t.hasAttribute("bits")&&this._addInt(i.dictionary,"B",t.getAttribute("bits")),t.hasAttribute("rate")&&this._addInt(i.dictionary,"R",t.getAttribute("rate")),t.hasAttribute("channels")&&this._addInt(i.dictionary,"C",t.getAttribute("channels")),t.hasAttribute("encoding")&&(n=t.getAttribute("encoding"))&&""!==n&&i.dictionary.update("E",k.get(n)),t.hasAttribute("filter")&&i.dictionary.update("Filter",k.get("FlateDecode")),this._crossReference._getNextReference());this._crossReference._cacheMap.set(n,i),e.update("Sound",n)},BIt.prototype._addFileAttachment=function(e,t,i){var n=new mPt(this._crossReference),o=(n.update("Type",k.get("Filespec")),t.hasAttribute("file")&&(o=t.getAttribute("file"),this._addString(n,"F",o),this._addString(n,"UF",o)),new DPt(i)),i=(o.dictionary._crossReference=this._crossReference,new mPt(this._crossReference)),r=(t.hasAttribute("size")&&void 0!==(r=Number.parseInt(t.getAttribute("size"),10))&&(i.update("Size",r),o.dictionary.update("DL",r)),t.hasAttribute("modification")&&this._addString(i,"ModDate",t.getAttribute("modification")),t.hasAttribute("creation")&&this._addString(i,"CreationDate",t.getAttribute("creation")),o.dictionary.update("Params",i),t.hasAttribute("mimetype")&&this._addString(o.dictionary,"Subtype",t.getAttribute("mimetype")),o.dictionary.update("Filter",k.get("FlateDecode")),new mPt(this._crossReference)),i=this._crossReference._getNextReference(),t=(this._crossReference._cacheMap.set(i,o),r.update("F",i),n.update("EF",r),this._crossReference._getNextReference());this._crossReference._cacheMap.set(t,n),e.update("FS",t)},BIt.prototype._addAppearanceData=function(e,t){e=e.textContent;if(e&&""!==e){e=(new DOMParser).parseFromString(atob(e),"text/xml");if(e&&e.hasChildNodes)if((o=e.childNodes)&&1===o.length){e=o[0];if(e&&1===e.nodeType)if("DICT"===e.nodeName.toUpperCase()&&e.hasAttribute("KEY")){var i=e.getAttribute("KEY");if(i&&"AP"===i&&e.hasChildNodes){for(var n=new mPt(this._crossReference),o=e.childNodes,r=0;r<o.length;r++)this._getAppearance(n,o[Number.parseInt(r.toString(),10)]);0<n.size&&t.update("AP",n)}}}}},BIt.prototype._getAppearance=function(e,t){var i=e instanceof mPt?e:e.dictionary;if(t&&1===t.nodeType){var n=t;if(n&&n.localName){var o,r;switch(n.localName){case"STREAM":(r=this._getStream(n))&&(o=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(o,r),this._addKey(o,i,n));break;case"DICT":(r=this._getDictionary(n))&&(o=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(o,r),this._addKey(o,i,n));break;case"ARRAY":this._addKey(this._getArray(n),i,n);break;case"FIXED":this._addKey(this._getFixed(n),i,n);break;case"INT":this._addKey(this._getInt(n),i,n);break;case"STRING":this._addKey(this._getString(n),i,n);break;case"NAME":this._addKey(this._getName(n),i,n);break;case"BOOL":this._addKey(this._getBoolean(n),i,n);break;case"DATA":(r=this._getData(n))&&0<r.length&&e instanceof DPt&&(e._bytes=r,o=!1,(o=i&&i.has("Subtype")?(r=i.get("Subtype"))&&"Image"===r.name:o)?e._isCompress=!1:(e.dictionary.has("Length")&&delete e.dictionary._map.Length,e.dictionary.has("Filter")&&delete e.dictionary._map.Filter))}}}},BIt.prototype._getStream=function(e){var t=new DPt([]);if(t.dictionary._crossReference=this._crossReference,e.hasChildNodes)for(var i=e.childNodes,n=0;n<i.length;n++){var o=i[Number.parseInt(n.toString(),10)];o&&1===o.nodeType&&this._getAppearance(t,o)}return t},BIt.prototype._getDictionary=function(e){var t=new mPt(this._crossReference);if(e.hasChildNodes)for(var i=e.childNodes,n=0;n<i.length;n++){var o=i[Number.parseInt(n.toString(),10)];o&&1===o.nodeType&&this._getAppearance(t,o)}return t},BIt.prototype._getArray=function(e){var t=[];if(e.hasChildNodes)for(var i=e.childNodes,n=0;n<i.length;n++){var o=i[Number.parseInt(n.toString(),10)];o&&1===o.nodeType&&this._addArrayElements(t,o)}return t},BIt.prototype._getData=function(e){var t,i,n=[];return e&&e.textContent&&""!==e.textContent&&e.hasAttribute("MODE")&&e.hasAttribute("ENCODING")&&(t=e.getAttribute("MODE"),i=e.getAttribute("ENCODING"),t)&&i&&(e=this._getFormatedString(e.textContent,!0),"FILTERED"===t&&"ASCII"===i?n=yMt(e,!0):"RAW"===t&&"HEX"===i&&(n=IMt(e,!0))),n},BIt.prototype._addArrayElements=function(e,t){if(t&&1===t.nodeType){var i,n,o=t,r=void 0;switch(o.localName){case"STREAM":(r=this._getStream(o))&&(i=this._crossReference._getNextReference(),r.reference=i,this._crossReference._cacheMap.set(i,r),e.push(i));break;case"DICT":(n=this._getDictionary(o))&&(i=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(i,n),e.push(i));break;case"ARRAY":(n=this._getArray(o))&&e.push(n);break;case"FIXED":void 0===(i=this._getFixed(o))||isNaN(i)||e.push(i);break;case"INT":void 0===(n=this._getInt(o))||isNaN(n)||e.push(n);break;case"NAME":(i=this._getName(o))&&e.push(i);break;case"BOOL":null!=(n=this._getBoolean(o))&&e.push(n)}}},BIt.prototype._getFixed=function(e){var t;return t=e&&e.hasAttribute("VAL")?Number.parseFloat(e.getAttribute("VAL")):t},BIt.prototype._getInt=function(e){var t;return t=e&&e.hasAttribute("VAL")?Number.parseInt(e.getAttribute("VAL"),10):t},BIt.prototype._getString=function(e){var t;return t=e&&e.hasAttribute("VAL")?e.getAttribute("VAL"):t},BIt.prototype._getName=function(e){var t;return t=e&&e.hasAttribute("VAL")?k.get(e.getAttribute("VAL")):t},BIt.prototype._getBoolean=function(e){var t;return t=e&&e.hasAttribute("VAL")?"true"===e.getAttribute("VAL"):t},BIt.prototype._addMeasureDictionary=function(e,t){var i,n,o,r;if(t.hasChildNodes)for(var s=t.childNodes,a=0;a<s.length;a++)if((m=s[Number.parseInt(a.toString(),10)])&&"measure"===m.localName){i=m;break}var l,t=new mPt(this._crossReference),h=new mPt(this._crossReference),d=new mPt(this._crossReference),p=new mPt(this._crossReference),c=[],u=[],g=[];if(i&&(t.update("Type",k.get("Measure")),i.hasAttribute("rateValue")&&(l=i.getAttribute("rateValue"))&&""!==l&&t.update("R",l),i.hasChildNodes))for(s=i.childNodes,a=0;a<s.length;a++){var m,f=s[Number.parseInt(a.toString(),10)];if(f&&1===f.nodeType)switch((m=f).nodeName.toLowerCase()){case"distance":o=m;break;case"area":n=m;break;case"xformat":r=m}}r&&(this._addElements(r,p),g.push(p)),o&&(this._addElements(o,h),c.push(h)),n&&(this._addElements(n,d),u.push(d)),t.set("A",u),t.set("D",c),t.set("X",g),0<t.size&&t.has("Type")&&(l=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(l,t),e.update("Measure",l))},BIt.prototype._addElements=function(e,t){e.hasAttribute("d")&&this._addFloat(t,"D",e.getAttribute("d")),e.hasAttribute("c")&&this._addFloat(t,"C",e.getAttribute("c")),e.hasAttribute("rt")&&t.update("RT",e.getAttribute("rt")),e.hasAttribute("rd")&&t.update("RD",e.getAttribute("rt")),e.hasAttribute("ss")&&t.update("SS",e.getAttribute("ss")),e.hasAttribute("u")&&t.update("U",e.getAttribute("u")),e.hasAttribute("f")&&t.update("F",k.get(e.getAttribute("f"))),e.hasAttribute("fd")&&t.update("FD","yes"===e.getAttribute("fd"))},BIt.prototype._addString=function(e,t,i){i&&""!==i&&e.update(t,i)},BIt.prototype._addInt=function(e,t,i){i=Number.parseInt(i,10);void 0!==i&&e.update(t,i)},BIt.prototype._addFloat=function(e,t,i){i=Number.parseFloat(i);void 0!==i&&e.update(t,i)},BIt.prototype._addFloatPoints=function(e,t,i){t&&0<t.length&&e.update(i,t)},BIt.prototype._addKey=function(e,t,i){null!=e&&i.hasAttribute("KEY")&&t.update(i.getAttribute("KEY"),e)},BIt.prototype._addLineEndStyle=function(e,t){var i="",n=(t.hasAttribute("head")&&(i=t.getAttribute("head")),"");t.hasAttribute("tail")&&(n=t.getAttribute("tail")),i&&""!==i?n&&""!==n?((t=[]).push(k.get(i)),t.push(k.get(n)),e.update("LE",t)):e.update("LE",k.get(i)):n&&""!==n&&e.update("LE",k.get(n))};var kIt,PIt=BIt;function BIt(e){var t=kIt.call(this)||this;return null!=e&&(t._fileName=e),t}Object.defineProperty(LIt.prototype,"differencesDictionary",{get:function(){return this._differencesDictionary||(this._differencesDictionary=this._getDifferencesDictionary()),this._differencesDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(LIt.prototype,"baseFontEncoding",{get:function(){return this._baseFontEncoding},enumerable:!0,configurable:!0}),Object.defineProperty(LIt.prototype,"fontEncoding",{get:function(){return this._fontEncoding||(this._fontEncoding=this._getFontEncoding()),this._fontEncoding},enumerable:!0,configurable:!0}),Object.defineProperty(LIt.prototype,"fontName",{get:function(){return this._fontName||(this._fontName=this._getFontName()),this._fontName},enumerable:!0,configurable:!0}),LIt.prototype._getFontEncoding=function(){var e,t,i="";return null!==this._dictionary&&void 0!==this._dictionary&&this._dictionary.has("Encoding")&&((e=this._dictionary.get("Encoding"))instanceof k?i=e.name:e instanceof mPt&&(e.has("BaseEncoding")&&(t=e.get("BaseEncoding"))&&t instanceof k&&(this._baseFontEncoding=t.name),e.has("Type"))&&null!=(t=e.get("Type"))&&(i=t.name)),i="identity#2dh"!==i.toString()&&"CMap"!==i?i:"Identity-H"},LIt.prototype._getDifferencesDictionary=function(){var e=new Map;if(null!==this._dictionary&&void 0!==this._dictionary&&this._dictionary.has("Encoding")){var t=this._dictionary.get("Encoding");if(null!=t&&t instanceof mPt&&t.has("Differences")){var i=t.getArray("Differences"),n=0;if(null!=i)for(var o=0;o<i.length;o++){var r="",s=i[Number.parseInt(o.toString(),10)];"number"==typeof s?(r=s.toString(),n=Number.parseInt(r,10)):s instanceof k&&(r=s.name,"Type1"===this._fontType&&".notdef"===r?(r=" ",e.set(n.toString(),wkt(r))):(r=bkt(r=wkt(r)),e.has(n.toString())||e.set(n.toString(),wkt(r)),n++))}}}return e},LIt.prototype._getFontName=function(){var e,t,i,n="";return n=null!==this._dictionary&&void 0!==this._dictionary&&this._dictionary.has("BaseFont")&&(-1!==(i=(e=this._dictionary.get("BaseFont")).name).indexOf("#20")&&-1===i.indexOf("+")&&(t=i.lastIndexOf("#20"),i=i.substring(0,t),i+="+"),-1!==(n=-1!==e.name.indexOf("+")?e.name.split("+")[1]:e.name).indexOf("-")?n=n.split("-")[0]:-1!==n.indexOf(",")&&(n=n.split(",")[0]),-1!==(n=-1!==(n=-1!==n.indexOf("MT")?n.replace("MT",""):n).indexOf("#20")?n.replace("#20"," "):n).indexOf("#"))?this._decodeHexFontName(n):n},LIt.prototype._decodeHexFontName=function(e){for(var t=e,i=0;i<e.length;i++)if("#"===e[Number.parseInt(i.toString(),10)]){var n=e[i+1]+e[i+2],o=Number.parseInt(n,16);if(0!==o&&(t=t.replace("#"+n,String.fromCharCode(o)),i+=2),-1===t.indexOf("#"))break}return t};var FIt=LIt;function LIt(e){this._baseFontEncoding="",this._dictionary=e,this._fontType=this._dictionary.get("Subtype").name}RIt=function(e,t){return(RIt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}RIt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(VIt,OIt=i0),VIt.prototype._exportAnnotations=function(e){return this._document=e,this._crossReference=e._crossReference,this._isAnnotationExport=!0,this._exportAnnotationData(e,e.pageCount),this._save()},VIt.prototype._exportFormFields=function(e){this._document=e,this._crossReference=e._crossReference,this._isAnnotationExport=!1;e=this._document.form;if(null!=e){this._exportEmptyFields=e.exportEmptyFields;for(var t=this._document.form.count,i=0;i<t;i++){var n=this._document.form.fieldAt(i);this._exportFormFieldsData(n)}this._writeFormFieldData()}return this._save()},VIt.prototype._save=function(){var e=new Uint8Array(this._jsonData);return this._jsonData=[],e},VIt.prototype._writeFormFieldData=function(){var r=this,s=(this._jsonData.push(this._openingBrace),0);this._table.forEach(function(e,t){if(t=r._getValidString(t),r._jsonData.push(r._doubleQuotes),r._jsonData=yMt(t,!0,!1,r._jsonData),"string"==typeof e||Array.isArray(e)&&1===e.length)e=r._getValidString("string"==typeof e?e:e[0]),r._jsonData.push(r._doubleQuotes,r._colon,r._doubleQuotes),r._jsonData=yMt(e,!0,!1,r._jsonData),r._jsonData.push(r._doubleQuotes);else{r._jsonData.push(r._doubleQuotes,r._colon,r._openingBracket);for(var i=0;i<e.length;i++){r._jsonData.push(r._doubleQuotes);for(var n=e[Number.parseInt(i.toString(),10)],o=0;o<n.length;o++)r._jsonData.push(n.charCodeAt(o));r._jsonData.push(r._doubleQuotes),i<e.length-1&&r._jsonData.push(r._comma)}r._jsonData.push(r._closingBracket)}s<r._table.size-1&&r._jsonData.push(r._comma),s++}),this._jsonData.push(this._closingBrace)},VIt.prototype._exportAnnotationData=function(e,t){var i=this,n=!1;this._jsonData.push(this._openingBrace,this._doubleQuotes,112,100,102,65,110,110,111,116,97,116,105,111,110,this._doubleQuotes,this._colon,this._openingBrace);for(var o=0;o<t;o++){for(var r=e.getPage(o),s=(r&&0<r.annotations.count&&(this._jsonData.push(0!==o&&n?this._comma:this._space,this._doubleQuotes),yMt(o.toString(),!0,!1,[]).forEach(function(e){i._jsonData.push(e)}),this._jsonData.push(this._doubleQuotes,this._colon,this._openingBrace,this._doubleQuotes,115,104,97,112,101,65,110,110,111,116,97,116,105,111,110,this._doubleQuotes,this._colon,this._openingBracket),n=!0),0),a=0;a<r.annotations.count;a++){var l=r.annotations.at(a);l&&(0!==s&&this._jsonData.push(this._comma),s++,this._exportAnnotation(l,o),this._jsonData=yMt(this._convertToJson(this._table),!0,!1,this._jsonData),this._table.clear())}r&&0<r.annotations.count&&this._jsonData.push(this._closingBracket,this._closingBrace)}this._jsonData.push(this._closingBrace,this._closingBrace)},VIt.prototype._exportAnnotation=function(e,t){var i=!1,n=e._dictionary,o=this._getAnnotationType(e._dictionary);if(this._skipBorderStyle=!1,o&&""!==o){this._table.set("type",o),this._table.set("page",t.toString());var r=void 0;switch(o){case"Line":r=e.linePoints,this._table.set("start",r[0].toString()+","+r[1].toString()),this._table.set("end",r[2].toString()+","+r[3].toString());break;case"Stamp":case"Square":i=!0}n&&n.has("BE")&&n.has("BS")&&(o=n.get("BE"))&&o.has("S")&&(this._skipBorderStyle=!0),this._writeDictionary(n,t,i)}},VIt.prototype._writeDictionary=function(n,o,r){var e,t,i,s,a,l=this,h=!1;n&&n.has("Type")&&(e=n.get("Type"),h=e&&"Border"===e.name&&this._skipBorderStyle),n.forEach(function(e,t){if((r||"AP"!==e)&&"P"!==e&&"Parent"!==e&&"Measure"!==e){var i=void 0;if((i=t instanceof aPt?n.get(e):t)&&i instanceof mPt)switch(e){case"BS":case"BE":l._writeDictionary(i,o,!1);break;case"IRT":i.has("NM")&&l._table.set("inreplyto",l._getValue(i.get("NM"),!0));break;default:l._writeDictionary(i,o,!1)}else h&&"S"===e||l._writeAttribute(e,i,n)}}),n.has("Measure")&&this._exportMeasureDictionary(n.get("Measure")),(this.exportAppearance||r)&&n.has("AP")&&(e=this._getAppearanceString(n.get("AP")))&&0<e.length&&this._table.set("appearance",kMt(e)),n.has("Sound")?(e=n.get("Sound"))&&e.dictionary&&((t=e.dictionary).has("B")&&this._table.set("bits",this._getValue(t.get("B"),!0)),t.has("C")&&this._table.set("channels",this._getValue(t.get("C"),!0)),t.has("E")&&this._table.set("encoding",this._getValue(t.get("E"),!0)),t.has("R")&&this._table.set("rate",this._getValue(t.get("R"),!0)),t.has("Length"))&&0<t.get("Length")&&(a=xMt(e.getBytes()))&&""!==a&&(this._table.set("MODE","raw"),this._table.set("encoding","hex"),t.has("Length")&&this._table.set("length",this._getValue(t.get("Length"),!0)),t.has("Filter")&&this._table.set("filter",this._getValue(t.get("Filter"),!0)),this._table.set("data",a)):n.has("FS")&&(e=n.get("FS"))&&(e.has("F")&&this._table.set("file",this._getValue(e.get("F"),!0)),e.has("EF"))&&(t=e.get("EF"))&&t.has("F")&&(e=t.get("F"))&&e.dictionary&&((t=e.dictionary).has("Params")&&(s=t.get("Params"))&&(s.has("CreationDate")&&(i=this._getValue(s.get("CreationDate"),!0),this._table.set("creation",i)),s.has("ModificationDate")&&(i=this._getValue(s.get("ModificationDate"),!0),this._table.set("modification",i)),s.has("Size")&&this._table.set("size",this._getValue(s.get("Size"),!0)),s.has("CheckSum"))&&(s=xMt(yMt(i=this._getValue(s.get("CheckSum"),!0))),this._table.set("checksum",s)),a=xMt(e.getBytes()))&&""!==a&&(this._table.set("MODE","raw"),this._table.set("encoding","hex"),t.has("Length")&&this._table.set("length",this._getValue(t.get("Length"),!0)),t.has("Filter")&&this._table.set("filter",this._getValue(t.get("Filter"),!0)),this._table.set("data",a))},VIt.prototype._writeColor=function(e,t,i){var n=this._getColor(e);"number"==typeof e&&i&&(e=this._getValue(e,!0))&&""!==e&&this._table.set(i,e),n&&""!==n&&this._table.set(t,n)},VIt.prototype._writeAttributeString=function(e,t,i){void 0===i&&(i=!1);t=this._getValue(t,!0);this._table.set(e,i?t.toLowerCase():t)},VIt.prototype._writeAttribute=function(e,t,i){var n,o,r;switch(e){case"C":this._writeColor(t,"color","c");break;case"IC":this._writeColor(t,"interior-color");break;case"DA":(o=i.get("DA"))&&this._table.set("defaultappearance",o);break;case"M":this._writeAttributeString("date",t);break;case"NM":this._table.set("name",t);break;case"Name":this._writeAttributeString("icon",t);break;case"Subj":this._writeAttributeString("subject",t);break;case"T":this._table.has("title")||this._writeAttributeString("title",t);break;case"Rect":(o=this._getValue(t,!0))&&(r=o.split(","),(n=new Map).set("x",r[0]),n.set("y",r[1]),n.set("width",r[2]),n.set("height",r[3]),this._table.set(e.toLowerCase(),this._convertToJson(n)));break;case"CreationDate":this._writeAttributeString("creationdate",t);break;case"Rotate":this._writeAttributeString("rotation",t);break;case"W":this._writeAttributeString("width",t);break;case"LE":t&&Array.isArray(t)?2===t.length&&(this._table.set("head",this._getValue(t[0],!0)),this._table.set("tail",this._getValue(t[1],!0))):t instanceof k&&this._writeAttributeString("head",t);break;case"S":switch(this._getValue(t,!0)){case"D":this._table.set("style","dash");break;case"C":this._table.set("style","cloudy");break;case"S":this._table.set("style","solid");break;case"B":this._table.set("style","bevelled");break;case"I":this._table.set("style","inset");break;case"U":this._table.set("style","underline")}break;case"D":this._writeAttributeString("dashes",t);break;case"I":this._writeAttributeString("intensity",t);break;case"RD":this._writeAttributeString("fringe",t);break;case"IT":this._writeAttributeString("IT",t);break;case"RT":this._writeAttributeString("replyType",t,!0);break;case"LL":this._writeAttributeString("leaderLength",t);break;case"LLE":this._writeAttributeString("leaderExtend",t);break;case"Cap":this._writeAttributeString("caption",t);break;case"CP":this._writeAttributeString("caption-style",t);break;case"CL":this._writeAttributeString("callout",t);break;case"QuadPoints":this._writeAttributeString("coords",t);break;case"CA":this._writeAttributeString("opacity",t);break;case"F":"number"==typeof t&&(r=gMt(t),this._table.set("flags",r));break;case"Contents":(o=i.get("Contents"))&&0<o.length&&this._table.set("contents",this._getValidString(o));break;case"InkList":this._writeInkList(i);break;case"Vertices":this._writeVertices(i);break;case"DS":if(Kkt(o=i.get("DS"))){for(var s=new Map,a=o.split(";"),l=0;l<a.length;l++){var h=a[Number.parseInt(l.toString(),10)].split(":");h&&0<h.length&&h[0]&&1<h[0].length&&h[0].startsWith(" ")&&(h[0]=h[0].substring(1)),s.set(h[0],h[1])}this._table.set("defaultStyle",this._convertToJson(s))}break;case"AllowedInteractions":t&&(n=yMt(t),(s=new Map).set("unicodeData",xMt(n)),this._table.set(e,this._convertToJson(s)));break;case"RC":"string"==typeof(r=i.get("RC"))&&r.includes("<body")&&(0<(o=r.indexOf("<body"))&&(r=r.substring(o)),this._writeAttributeString("contents-richtext",r));break;case"Type":case"Subtype":case"P":case"Parent":case"L":case"FS":case"MeasurementTypes":case"GroupNesting":case"ITEx":break;case"TextMarkupContent":n=yMt(t),this._writeAttributeString(e,xMt(n));break;case"Border":case"A":case"R":case"X":case"ca":this._writeAttributeString(e.toLowerCase(),t);break;default:"string"==typeof t&&t.startsWith("{")&&t.endsWith("}")?this._table.set(e,t):this._writeAttributeString(e,t)}},VIt.prototype._writeVertices=function(e){var t=e.getArray("Vertices");if(Kkt(t)&&0<t.length){var i=t.length;if(i%2==0){for(var n="",o=0;o<i-1;o++)n+=this._getValue(t[Number.parseInt(o.toString(),10)],!0)+(o%2!=0?";":",");(n+=this._getValue(t[i-1],!0))&&""!==n&&this._table.set("vertices",n)}}},VIt.prototype._writeInkList=function(e){var t=e.getArray("InkList");if(t&&0<t.length){for(var e=new Map,i="[",n=0;n<t.length;n++)i+="["+this._getValue(t[Number.parseInt(n.toString(),10)],!0)+"]",n<t.length-1&&(i+=",");e.set("gesture",i+="]"),this._table.set("inklist",this._convertToJson(e))}},VIt.prototype._exportMeasureDictionary=function(e){var t;e&&(e.has("Type")&&this._table.set("type1","Measure"),e.has("R")&&this._table.set("ratevalue",this._getValue(e.get("R"),!0)),e.has("SubType")&&this._table.set("SubType",this._getValue(e.get("SubType"),!0)),e.has("TargetUnitConversion")&&this._table.set("TargetUnitConversion",this._getValue(e.get("TargetUnitConversion"),!0)),e.has("A")&&(t=e.getArray("A"))&&0<t.length&&t[0]&&this._exportMeasureFormatDetails("area",t[0]),e.has("D")&&(t=e.getArray("D"))&&0<t.length&&t[0]&&this._exportMeasureFormatDetails("distance",t[0]),e.has("X")&&(t=e.getArray("X"))&&0<t.length&&t[0]&&this._exportMeasureFormatDetails("xformat",t[0]),e.has("T")&&(t=e.getArray("T"))&&0<t.length&&t[0]&&this._exportMeasureFormatDetails("tformat",t[0]),e.has("V"))&&(t=e.getArray("V"))&&0<t.length&&t[0]&&this._exportMeasureFormatDetails("vformat",t[0])},VIt.prototype._exportMeasureFormatDetails=function(e,t){var i=new Map;t&&(t.has("C")&&i.set("c",this._getValue(t.get("C"),!0)),t.has("F")&&i.set("f",this._getValue(t.get("F"),!0)),t.has("D")&&i.set("d",this._getValue(t.get("D"),!0)),t.has("RD")&&i.set("rd",this._getValue(t.get("RD"),!0)),t.has("U")&&i.set("u",this._getValue(t.get("U"),!0)),t.has("RT")&&i.set("rt",this._getValue(t.get("RT"),!0)),t.has("SS")&&i.set("ss",this._getValue(t.get("SS"),!0)),t.has("FD"))&&i.set("fd",this._getValue(t.get("FD"),!0)),this._table.set(e,this._convertToJson(i))},VIt.prototype._getAppearanceString=function(e){var t=new Map,i=new Map;return this._writeAppearanceDictionary(i,e),t.set("ap",this._convertToJson(i)),yMt(this._convertToJson(t))},VIt.prototype._writeAppearanceDictionary=function(i,n){var o=this;n&&0<n.size&&n.forEach(function(e,t){("OC"===e&&t instanceof Array||"P"!==e&&"Parent"!==e&&"Dest"!==e&&"OC"!==e&&("AP"!==e||!o._isGroupingSupport))&&o._writeObject(i,t instanceof aPt?n.get(e):t,n,e)})},VIt.prototype._writeObject=function(e,t,i,n,o,r,s){var a,l,h,d,p,c,u,g,m;void 0===r&&(r=!1),void 0===s&&(s=!1),t instanceof k?(t.name=this._getValidString(t.name),this._writeTable("name",t.name,e,n,o)):Array.isArray(t)?(a=[],"ColorSpace"===n||r?this._writeArray(a,t,i,!0):this._writeArray(a,t,i),this._isColorSpace=!1,this._writeTable("array",this._convertToJsonArray(a),e,n,o)):"string"==typeof t?(a=!1,-1!==t.indexOf("\t")&&(a=!0),"AllowedInteractions"!==n&&(t=this._getValidString(t)),this._isColorSpace||"AllowedInteractions"===n||this._hasUnicodeCharacters(t)||a?(u=yMt(t),this._writeTable("unicodeData",xMt(u),e,n,o)):this._writeTable("string",t,e,n,o)):"number"==typeof t?this._writeTable(Number.isInteger(t)?"int":"fixed",t.toString(),e,n,o):"boolean"==typeof t?this._writeTable("boolean",t?"true":"false",e,n,o):t instanceof mPt?(a=new Map,this._writeAppearanceDictionary(a,t),this._writeTable("dict",this._convertToJson(a),e,n,o)):t instanceof SPt&&t.dictionary?(a=new Map,l=new Map,p=void 0,m=!1,(h=(d=t).dictionary).has("Subtype")&&"Image"===h.get("Subtype").name&&(m=!0),s&&m?p=t.dictionary.has("Filter")&&"DCTDecode"===t.dictionary.get("Filter").name?t.getString(!0):Jkt(t,!0):m&&d.stream?d.stream instanceof IPt?p="boolean"==typeof d._initialized&&d._cipher?(c=d.stream.end-d.stream.start,d.getBytes(c),u=d.buffer.subarray(0,d.bufferLength),d.getString(!0,u)):(g=d.stream,d.getString(!0,g.getByteRange(g.start,g.end))):d.stream.stream?(s=d.stream).stream instanceof IPt&&"boolean"==typeof s._initialized&&s._cipher?(c=s.stream.end-s.stream.start,s.getBytes(c),u=s.buffer.subarray(0,s.bufferLength),p=s.getString(!0,u)):s.stream instanceof IPt&&(g=s.stream,p=s.getString(!0,g.getByteRange(g.start,g.end))):p=t.getString(!0):p=t.getString(!0),!h.has("Length")&&p&&""!==p&&h.update("Length",t.length),m=void this._writeAppearanceDictionary(l,h),h.has("Subtype")&&(m=this._getValue(h.get("Subtype"))),!h.has("Type")&&!h.has("Subtype")||h.has("Subtype")&&("Image"===m||"Form"===m||"CIDFontType0C"===m||"OpenType"===m)?(a.set("mode","raw"),a.set("encoding","hex")):(a.set("mode","filtered"),a.set("encoding","ascii")),p&&""!==p&&a.set("bytes",p),l.set("data",this._convertToJson(a)),this._writeTable("stream",this._convertToJson(l),e,n,o)):t instanceof aPt&&this._crossReference?this._writeObject(e,this._crossReference._fetch(t),i,n,o,r,t._isNew):null==t&&this._writeTable("null","null",e,n,o)},VIt.prototype._writeTable=function(e,t,i,n,o){var r=new Map;r.set(e,t),n?i.set(n,this._convertToJson(r)):o&&o.push(r)},VIt.prototype._writeArray=function(e,t,i,n){void 0===n&&(n=!1);for(var o=0;o<t.length;o++)n&&"string"==typeof t[Number.parseInt(o.toString(),10)]&&(this._isColorSpace=!0),this._writeObject(null,t[Number.parseInt(o.toString(),10)],i,null,e,n)},VIt.prototype._convertToJson=function(i){var n=0,o="{";return i.forEach(function(e,t){e.startsWith("{")||e.startsWith("[")?o+='"'+t+'":'+e:(e.startsWith(" ")&&1<e.length&&("["===e[1]||"{"===e[1])&&(e=e.substring(1)),o+='"'+t+'":"'+e+'"'),n<i.size-1&&(o+=","),n++}),o+"}"},VIt.prototype._hasUnicodeCharacters=function(e){var t=/[^\x00-\x7F]/;return e.split("").some(function(e){return null!==t.exec(e)})},VIt.prototype._convertToJsonArray=function(e){for(var t="[",i=0;i<e.length;i++)t+=this._convertToJson(e[Number.parseInt(i.toString(),10)]),i<e.length-1&&(t+=",");return t+"]"},VIt.prototype._parseJson=function(e,t){this._document=e,this._crossReference=e._crossReference;var i=CMt(t,!0);if(i.startsWith("{")&&!i.endsWith("}"))for(;0<i.length&&!i.endsWith("}");)i=i.substring(0,i.length-1);return JSON.parse(i)},VIt.prototype._importFormData=function(e,t){var i=this,n=this._parseJson(e,t);if(n){var o=Object.keys(n);if(o&&0<o.length){for(var r=this,s=0;s<o.length;s++)!function(e){var t=o[Number.parseInt(e.toString(),10)],e=n[t];Array.isArray(e)?r._fields.has("key")?e.forEach(function(e){i._fields.get(t).push(e)}):r._fields.set(t,e):r._fields.has("key")?r._fields.get(t).push(e):r._fields.set(t,[e])}(s);this._importField()}}},VIt.prototype._importAnnotations=function(i,e){var l=this,e=(this._isImport=!0,this._parseJson(i,e));if(e&&-1!==Object.keys(e).indexOf("pdfAnnotation")){var n=e.pdfAnnotation,o=i.pageCount,e=Object.keys(n);if(e&&0<e.length&&e.forEach(function(e){var a,t=Number.parseInt(e,10);void 0!==t&&t<o&&(a=i.getPage(t),t=n[e])&&(e=Object.keys(t))&&0<e.length&&-1!==e.indexOf("shapeAnnotation")&&(e=t.shapeAnnotation)&&0<e.length&&e.forEach(function(e){var t=Object.keys(e);if(t&&0<t.length&&-1!==t.indexOf("type")){var i,n,o,r=new mPt(l._crossReference),s=(r.update("Type",k.get("Annot")),!0);switch(e.type.toLowerCase()){case"line":r.update("Subtype",k.get("Line"));break;case"circle":r.update("Subtype",k.get("Circle"));break;case"square":r.update("Subtype",k.get("Square"));break;case"polyline":r.update("Subtype",k.get("PolyLine"));break;case"polygon":r.update("Subtype",k.get("Polygon"));break;case"ink":r.update("Subtype",k.get("Ink"));break;case"popup":r.update("Subtype",k.get("Popup"));break;case"text":r.update("Subtype",k.get("Text"));break;case"freetext":r.update("Subtype",k.get("FreeText"));break;case"stamp":r.update("Subtype",k.get("Stamp"));break;case"highlight":r.update("Subtype",k.get("Highlight"));break;case"squiggly":r.update("Subtype",k.get("Squiggly"));break;case"underline":r.update("Subtype",k.get("Underline"));break;case"strikeout":r.update("Subtype",k.get("StrikeOut"));break;case"fileattachment":r.update("Subtype",k.get("FileAttachment"));break;case"sound":r.update("Subtype",k.get("Sound"));break;case"redact":r.update("Subtype",k.get("Redact"));break;case"caret":r.update("Subtype",k.get("Caret"));break;default:s=!1}s&&(l._addAnnotationData(r,e,t),e=a._pageDictionary)&&(i=(t=a.annotations)._parseAnnotation(r))&&(i._isImported=!0,n=l._crossReference._getNextReference(),l._crossReference._cacheMap.set(n,r),(r.has("NM")||r.has("IRT"))&&l._addReferenceToGroup(n,r),i._ref=n,o=t._annotations.length,t._annotations.push(n),t._comments&&0<t._comments.length&&(t._comments=[]),e.set("Annots",t._annotations),e._updated=!0,t._parsedAnnotations.set(o,i),l._handlePopup(t,n,r,e))}})}),0<this._groupHolders.length)for(var t=0;t<this._groupHolders.length;t++){var r=this._groupHolders[Number.parseInt(t.toString(),10)],s=r.get("IRT");s&&""!==s&&(this._groupReferences.has(s)?r.update("IRT",this._groupReferences.get(s)):delete r._map.IRT)}this._groupHolders=[],this._groupReferences=new Map}},VIt.prototype._addAnnotationData=function(u,g,e){var m,f,y,t,v=this,b=new mPt(this._crossReference),w=new mPt(this._crossReference),C=new Map,S=[],A="";e.forEach(function(e){var t,i,n,o,r,s=g[e];switch(e.toLowerCase()){case"start":case"end":v._addLinePoints(s,S),4===S.length&&(u.update("L",S),S=[]);break;case"itex":break;case"state":v._addString(u,"State",s);break;case"statemodel":v._addString(u,"StateModel",s);break;case"replytype":"group"===s.toLowerCase()&&u.update("RT",k.get("Group"));break;case"inreplyto":v._addString(u,"IRT",s);break;case"dashes":case"width":case"intensity":case"style":v._addBorderStyle(e,s,b,w);break;case"rect":(y=s)&&((r=[]).push(Number.parseFloat(y.x)),r.push(Number.parseFloat(y.y)),r.push(Number.parseFloat(y.width)),r.push(Number.parseFloat(y.height)),r)&&4===r.length&&u.update("Rect",r);break;case"color":(s=NMt(s))&&3===s.length&&u.update("C",[s[0]/255,s[1]/255,s[2]/255]);break;case"oc":s&&"Redact"===u.get("Subtype").name&&(y=s.split(","),t=[],y.forEach(function(e){t.push(Number.parseFloat(e))}),t)&&0<t.length&&u.update("OC",t);break;case"interior-color":(s=NMt(s))&&3===s.length&&u.update("IC",[s[0]/255,s[1]/255,s[2]/255]);break;case"date":v._addString(u,"M",s);break;case"creationdate":v._addString(u,"CreationDate",s);break;case"name":v._addString(u,"NM",s);break;case"icon":s&&u.update("Name",k.get(s));break;case"subject":v._addString(u,"Subj",s);break;case"title":v._addString(u,"T",s);break;case"rotation":u.update("Rotate",Number.parseFloat(s));break;case"fringe":v._addFloatPoints(u,"RD",v._parseFloatPoints(s));break;case"it":s&&u.update("IT",k.get(s));break;case"leaderlength":u.update("LL",Number.parseFloat(s));break;case"leaderextend":u.update("LLE",Number.parseFloat(s));break;case"caption":v._addBoolean(u,"Cap",s.toLowerCase());break;case"caption-style":s&&u.update("CP",k.get(s));break;case"callout":v._addFloatPoints(u,"CL",v._parseFloatPoints(s));break;case"coords":v._addFloatPoints(u,"QuadPoints",v._parseFloatPoints(s));break;case"border":v._addFloatPoints(u,"Border",v._parseFloatPoints(s));break;case"opacity":u.update("CA",Number.parseFloat(s));break;case"defaultstyle":s&&(i=Object.keys(s))&&0<i.length&&(n="",o=0,i.forEach(function(e){var t=s[e];n+=e+":"+t,o<i.length-1&&(n+=";"),o++}),v._addString(u,"DS",n));break;case"defaultappearance":v._addString(u,"DA",s);break;case"contents-richtext":"string"==typeof s&&v._addString(u,"RC",s);break;case"flags":if(s&&"string"==typeof s){for(var a=bAt.default,l=s.split(","),h=0;h<l.length;h++){var d=mMt(l[Number.parseInt(h.toString(),10)]);0===h?a=d:a|=d}u.update("F",a)}break;case"open":v._addBoolean(u,"Open",s.toLowerCase());break;case"repeat":v._addBoolean(u,"Repeat",s.toLowerCase());break;case"overlaytext":v._addString(u,"OverlayText",s);break;case"contents":"string"==typeof s&&(s=-1!==s.indexOf("\\r")?s.replace("\\r","\r"):s)&&v._addString(u,"Contents",s);break;case"q":u.update("Q",Number.parseInt(s,10));break;case"inklist":s&&(r=Object.keys(s))&&0<r.length&&-1!==r.indexOf("gesture")&&(r=s.gesture)&&0<r.length&&u.update("InkList",r);break;case"head":m=s;break;case"tail":f=s;break;case"creation":case"modification":case"file":case"bits":case"channels":case"encoding":case"rate":case"length":case"filter":case"mode":case"size":C.set(e,s);break;case"data":A=s;break;case"vertices":if(s&&"string"==typeof s){var p=s.split(/[,;]/);if(p&&0<p.length){for(var c=[],h=0;h<p.length;h++)c.push(Number.parseFloat(p[Number.parseInt(h.toString(),10)]));0<c.length&&c.length%2==0&&u.update("Vertices",c)}}break;case"appearance":v._addAppearanceData(u,s);break;case"allowedinteractions":s&&("string"==typeof s?v._addString(u,"AllowedInteractions",s):(r=Object.keys(s))&&0<r.length&&-1!==r.indexOf("unicodeData")&&(r=JSON.stringify(s.unicodeData),s=CMt(IMt(r=r.substring(1,r.length-1),!1),!0),v._addString(u,"AllowedInteractions",s)));break;default:v._document._allowImportCustomData&&"type"!==e&&"page"!==e&&v._addString(u,e,"string"==typeof s?s:JSON.stringify(s))}}),this._addMeasureDictionary(u,g,e),m?f?u.update("LE",[k.get(m),k.get(f)]):u.update("LE",m):f&&u.update("LE",f),0<w.size&&(w.update("Type",k.get("Border")),t=this._crossReference._getNextReference(),w.objId=t.objectNumber+" "+t.generationNumber,this._crossReference._cacheMap.set(t,w),u.update("BS",t)),0<b.size&&(t=this._crossReference._getNextReference(),w.objId=t.objectNumber+" "+t.generationNumber,this._crossReference._cacheMap.set(t,b),u.update("BE",t)),this._addStreamData(u,C,A)},VIt.prototype._addLinePoints=function(e,t){e&&-1!==e.indexOf(",")&&e.split(",").forEach(function(e){t.push(Number.parseFloat(e))})},VIt.prototype._addString=function(e,t,i){i&&e.update(t,i)},VIt.prototype._addBoolean=function(e,t,i){i&&e.update(t,"yes"===i||"true"===i)},VIt.prototype._addBorderStyle=function(e,t,i,n){var o="",r=!0;switch(t){case"dash":o="D";break;case"solid":o="S";break;case"bevelled":o="B";break;case"inset":o="I";break;case"underline":o="U";break;case"cloudy":r=!(o="C")}switch(e.toLowerCase()){case"width":n.update("W",Number.parseFloat(t));break;case"intensity":i.update("I",Number.parseFloat(t));break;case"dashes":t&&-1!==t.indexOf(",")&&n.update("D",this._parseFloatPoints(t))}o&&(r?n:i).update("S",k.get(o))},VIt.prototype._parseFloatPoints=function(e){var e=e.split(","),t=[];return e.forEach(function(e){t.push(Number.parseFloat(e))}),t},VIt.prototype._addFloatPoints=function(e,t,i){i&&0<i.length&&e.update(t,i)},VIt.prototype._addMeasureDictionary=function(e,t,i){var n=new mPt(this._crossReference),o=[],r=[],s=[],a=[],l=[];n.set("A",o),n.set("D",r),n.set("X",s),n.set("T",a),n.set("V",l),-1!==i.indexOf("ratevalue")&&this._addString(n,"R",t.ratevalue),-1!==i.indexOf("subtype")&&this._addString(n,"Subtype",t.subtype),-1!==i.indexOf("targetunitconversion")&&this._addString(n,"TargetUnitConversion",t.targetunitconversion),-1!==i.indexOf("area")&&o.push(this._readDictionaryElements(t.area)),-1!==i.indexOf("distance")&&r.push(this._readDictionaryElements(t.distance)),-1!==i.indexOf("xformat")&&s.push(this._readDictionaryElements(t.xformat)),-1!==i.indexOf("tformat")&&a.push(this._readDictionaryElements(t.tformat)),-1!==i.indexOf("vformat")&&l.push(this._readDictionaryElements(t.vformat)),-1!==i.indexOf("type1")&&(n.set("Type",k.get("Measure")),o=this._crossReference._getNextReference(),n.objId=o.objectNumber+" "+o.generationNumber,this._crossReference._cacheMap.set(o,n),e.update("Measure",o))},VIt.prototype._readDictionaryElements=function(i){var e=Object.keys(i),n=new mPt(this._crossReference);return e&&0<e.length&&e.forEach(function(e){var t=i[e];if(e&&t)switch(e){case"d":n.set("D",Number.parseFloat(t));break;case"c":n.set("C",Number.parseFloat(t));break;case"rt":n.set("RT",t);break;case"rd":n.set("RD",t);break;case"ss":n.set("SS",t);break;case"u":n.set("U",t);break;case"f":n.set("F",k.get(t));break;case"fd":n.set("FD",t);break;case"type":n.set("Type",k.get(t))}}),n},VIt.prototype._addStreamData=function(e,t,i){var n,o,r,s,a=this,l=e.get("Subtype").name,i=IMt(i,!0);"Sound"===l?((n=new DPt(i)).dictionary._crossReference=this._crossReference,n.dictionary.update("Type",k.get("Sound")),t.forEach(function(e,t){if(t&&e)switch(t){case"bits":case"rate":case"channels":n.dictionary.set(t,Number.parseInt(e,10));break;case"encoding":n.dictionary.set("E",k.get(e));break;case"filter":n.dictionary.set("Filter",k.get("FlateDecode"))}}),n.reference=this._crossReference._getNextReference(),n.dictionary.objId=n.reference.objectNumber+" "+n.reference.generationNumber,this._crossReference._cacheMap.set(n.reference,n),e.update("Sound",n.reference)):"FileAttachment"===l&&((o=new mPt(this._crossReference)).update("Type",k.get("Filespec")),(r=new DPt(i)).dictionary._crossReference=this._crossReference,s=new mPt(this._crossReference),t.forEach(function(e,t){if(t&&e){var i;switch(t){case"file":a._addString(o,"F",e),a._addString(o,"UF",e);break;case"size":void 0!==(i=Number.parseInt(e,10))&&(s.update("Size",i),r.dictionary.update("DL",i));break;case"creation":a._addString(s,"CreationDate",e);break;case"modification":a._addString(s,"ModificationDate",e)}}}),r.dictionary.update("Params",s),r.dictionary.update("Filter",k.get("FlateDecode")),r.reference=this._crossReference._getNextReference(),r.dictionary.objId=r.reference.objectNumber+" "+r.reference.generationNumber,this._crossReference._cacheMap.set(r.reference,r),(l=new mPt(this._crossReference)).update("F",r.reference),o.update("EF",l),i=this._crossReference._getNextReference(),o.objId=i.objectNumber+" "+i.generationNumber,this._crossReference._cacheMap.set(i,o),e.update("FS",i))},VIt.prototype._addAppearanceData=function(e,t){if(t){var i=CMt(DMt(t,!1));if(i.startsWith("{")&&!i.endsWith("}"))for(;0<i.length&&!i.endsWith("}");)i=i.substring(0,i.length-1);var n,t=JSON.parse(i);t&&(n=Object.keys(t))&&0<n.length&&-1!==n.indexOf("ap")&&e.update("AP",this._parseDictionary(t.ap))}},VIt.prototype._parseAppearance=function(e){var t,i,n=this,o=Object.keys(e);return-1!==o.indexOf("name")?t=k.get(e.name):-1!==o.indexOf("int")?t=Number.parseInt(e.int,10):-1!==o.indexOf("fixed")?t=Number.parseFloat(e.fixed):-1!==o.indexOf("string")?t=e.string:-1!==o.indexOf("boolean")?t="true"===e.boolean:-1!==o.indexOf("array")?(i=e.array,t=[],i.forEach(function(e){t.push(n._parseAppearance(e))})):-1!==o.indexOf("dict")?0<(i=this._parseDictionary(e.dict)).size?(t=this._crossReference._getNextReference(),i.objId=t.objectNumber+" "+t.generationNumber,this._crossReference._cacheMap.set(t,i)):t=new mPt(this._crossReference):-1!==o.indexOf("stream")?(i=this._parseStream(e.stream),t=this._crossReference._getNextReference(),i.reference=t,i.dictionary.objId=t.objectNumber+" "+t.generationNumber,this._crossReference._cacheMap.set(t,i)):t=-1!==o.indexOf("unicodeData")?CMt(IMt(e.unicodeData,!1),!0):null,t},VIt.prototype._parseDictionary=function(i){var e,n=this,o=new mPt(this._crossReference);return i&&(e=Object.keys(i))&&0<e.length&&e.forEach(function(e){var t=i[e];"data"!==e&&(t=n._parseAppearance(t),o.update(e,t))}),o},VIt.prototype._parseStream=function(e){var t,i,n=Object.keys(e);return e&&n.indexOf("data")&&(n=void 0,(i=e.data)&&(t=Object.keys(i))&&-1!==t.indexOf("bytes")&&(t=i.bytes)&&(n=IMt(t,!0)),i=new DPt(n=n||[]),this._crossReference?this._parseStreamElements(i,e):i._pendingResources=JSON.stringify(e),t=i),t},VIt.prototype._parseStreamElements=function(e,t){var i,n;(t=void 0===t&&e._pendingResources?JSON.parse(e._pendingResources):t)&&(n=!1,(n=(t=this._parseDictionary(t))&&t.has("Subtype")?(i=t.get("Subtype"))&&"Image"===i.name:n)||this._isImport&&e._isCompress?e._isCompress=!1:(t.has("Length")&&delete t._map.Length,t.has("Filter")&&delete t._map.Filter),e.dictionary=t)},VIt.prototype._getValidString=function(e){return e=-1!==(e=-1!==(e=-1!==(e=-1!==(e=-1!==(e=-1!==(e=-1!==(e=-1!==(e=-1!==e.indexOf("\\")?e.replace(/\\/g,"\\\\"):e).indexOf('"')?e.replace(/"/g,'\\"'):e).indexOf("[")?e.replace(/\[/g,"\\["):e).indexOf("]")?e.replace(/\[/g,"\\]"):e).indexOf("{")?e.replace(/\[/g,"\\{"):e).indexOf("}")?e.replace(/\}/g,"\\}"):e).indexOf("\n")?e.replace(/\n/g,"\\n"):e).indexOf("\r")?e.replace(/\r/g,"\\r"):e).indexOf("\0")?e.replace(/\u0000/g,""):e};var RIt,OIt,NIt=VIt;function VIt(e){var t=OIt.call(this)||this;return t._isImport=!1,t._isColorSpace=!1,t._isDuplicate=!1,t._isGroupingSupport=!1,null!=e&&(t._fileName=e),t}Object.defineProperty(HIt.prototype,"graphics",{get:function(){return this._isReadOnly?null:(void 0===this._g&&(this._g=new aIt(this._size,this._content,this._crossReference,this),this._writeTransformation&&this._g._initializeCoordinates(),this._g._isTemplateGraphics=!0),this._g)},enumerable:!0,configurable:!0}),Object.defineProperty(HIt.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(HIt.prototype,"_originalSize",{get:function(){return this._templateOriginalSize},enumerable:!0,configurable:!0}),HIt.prototype._initialize=function(){this._content.dictionary.set("Type",k.get("XObject")),this._content.dictionary.set("Subtype",k.get("Form"))},HIt.prototype._exportStream=function(e,t){var i=new NIt,t=(i._crossReference=t,i._isAnnotationExport=!0,new Map);i._writeObject(t,e.get("N"),e,"normal"),this._appearance=i._convertToJson(t),i._dispose()},HIt.prototype._importStream=function(e,t){var i=new NIt,n=(e&&(i._crossReference=this._crossReference),JSON.parse(this._appearance));n&&(n=n[t?"resources":"normal"])&&(t?(t=i._parseDictionary(n.dict),e&&this._content.dictionary.update("Resources",t)):(this._content=i._parseStream(n.stream),e&&(this._content.dictionary._crossReference=this._crossReference,this._content.dictionary._updated=!0))),i._dispose()},HIt.prototype._updatePendingResource=function(e){var t;this._content._pendingResources&&""!==this._content._pendingResources&&((t=new NIt)._crossReference=e,t._parseStreamElements(this._content),this._content._pendingResources="",t._dispose())};var _It=HIt;function HIt(e,t){this._isExported=!1,this._isResourceExport=!1,this._isSignature=!1,this._crossReference=t,e instanceof SPt?(this._content=e,this._content.dictionary.has("Type")&&this._content.dictionary.has("Subtype")||this._initialize(),(t=this._content.dictionary.getArray("BBox"))&&3<t.length&&(t=LMt(t),this._size=[t.width,t.height],this._templateOriginalSize=this._size),this._isReadOnly=!0):void 0!==e?(this._size=[e[2],e[3]],this._content=new DPt([]),this._content.dictionary._crossReference=this._crossReference,this._initialize(),this._content.dictionary.set("BBox",[e[0],e[1],e[0]+e[2],e[1]+e[3]])):this._isReadOnly=!0,this._writeTransformation=!0}zIt=function(e,t){return(zIt=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])}))(e,t)};var zIt,X$e=function(e,t){function i(){this.constructor=e}zIt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Z$e=(Object.defineProperty(jIt.prototype,"next",{get:function(){return this._next},set:function(e){this._next=e;var t=this._page._crossReference._getNextReference();this._page._crossReference._cacheMap.set(t,e._dictionary),e._dictionary.objId=t.toString(),this._dictionary.update("Next",t)},enumerable:!0,configurable:!0}),jIt);function jIt(){}X$e(UIt,WIt=Z$e),Object.defineProperty(UIt.prototype,"destination",{get:function(){return this._destination},set:function(e){this._destination=e},enumerable:!0,configurable:!0});var WIt,QIt=UIt;function UIt(e){var t=WIt.call(this)||this;return e instanceof FDt?(t._destination=e,t._page=e.page):(t._page=e,t._destination=new FDt(e,[0,0])),t._dictionary=new mPt,t._dictionary.update("Type",new k("Action")),t._dictionary.update("S",new k("GoTo")),t}Object.defineProperty(GIt.prototype,"mouseEnter",{get:function(){return this._mouseEnter||(this._mouseEnter=this._getPdfAction("E")),this._mouseEnter},set:function(e){e&&(this._mouseEnter=e,this._updateAction(this._mouseEnter,"E"))},enumerable:!0,configurable:!0}),Object.defineProperty(GIt.prototype,"mouseLeave",{get:function(){return this._mouseLeave||(this._mouseLeave=this._getPdfAction("X")),this._mouseLeave},set:function(e){e&&(this._mouseLeave=e,this._updateAction(this._mouseLeave,"X"))},enumerable:!0,configurable:!0}),Object.defineProperty(GIt.prototype,"mouseUp",{get:function(){return this._mouseUp||(this._mouseUp=this._getPdfAction("U")),this._mouseUp},set:function(e){e&&(this._mouseUp=e,this._updateAction(this._mouseUp,"U"))},enumerable:!0,configurable:!0}),Object.defineProperty(GIt.prototype,"mouseDown",{get:function(){return this._mouseDown||(this._mouseDown=this._getPdfAction("D")),this._mouseDown},set:function(e){e&&(this._mouseDown=e,this._updateAction(this._mouseDown,"D"))},enumerable:!0,configurable:!0}),Object.defineProperty(GIt.prototype,"gotFocus",{get:function(){return this._gotFocus||(this._gotFocus=this._getPdfAction("Fo")),this._gotFocus},set:function(e){e&&(this._gotFocus=e,this._updateAction(this._gotFocus,"Fo"))},enumerable:!0,configurable:!0}),Object.defineProperty(GIt.prototype,"lostFocus",{get:function(){return this._lostFocus||(this._lostFocus=this._getPdfAction("Bl")),this._lostFocus},set:function(e){e&&(this._lostFocus=e,this._updateAction(this._lostFocus,"Bl"))},enumerable:!0,configurable:!0}),GIt.prototype._updateAction=function(e,t){var i,n,o,r;0<this._field._kidsCount&&(r=this._field.itemAt(0))&&r._dictionary&&e instanceof QIt&&(i=new mPt,n=e._page,(o=e.destination)._destinationMode===zAt.location?e._dictionary.update("D",[n._ref,new k("XYZ"),o.location[0],n.size[1],o.zoom]):o._destinationMode===zAt.fitR?e._dictionary.update("D",[n._ref,new k("FitR"),0,0,0,0]):o._destinationMode===zAt.fitH?e._dictionary.update("D",[n._ref,new k("FitH"),n.size[1]]):o._destinationMode===zAt.fitToPage&&e._dictionary.update("D",[n._ref,new k("Fit")]),i.set(t,e._dictionary),i._updated=!0,r._dictionary.update("AA",i))},GIt.prototype._getPdfAction=function(e){var t,i,n=this._field.itemAt(0);return n&&n._dictionary&&n._dictionary.has("AA")&&(i=n._dictionary.get("AA"))&&i.has(e)&&(i=i.get(e))&&i.has("S")&&(e=i.get("S"))&&"GoTo"===e.name&&i.has("D")&&(i._crossReference||(i._crossReference=n._crossReference),t=new QIt(zkt(i,"D"))),t};var qIt=GIt;function GIt(e){this._field=e}YIt=function(e,t){return(YIt=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])}))(e,t)};var YIt,Wo=function(e,t){function i(){this.constructor=e}YIt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},XIt=(Object.defineProperty(KIt.prototype,"itemsCount",{get:function(){return this._kids?this._kids.length:0},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"form",{get:function(){return this._form},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"name",{get:function(){var e;return void 0===this._name&&(e=PMt(this._dictionary,"T",!1,!1,"Parent"))&&0<e.length&&(1===e.length?this._name=e[0]:this._name=e.join(".")),this._name},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"actualName",{get:function(){var e;return void 0===this._actualName&&this._dictionary&&this._dictionary.has("T")&&(e=this._dictionary.get("T"))&&"string"==typeof e&&(this._actualName=e),this._actualName},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"mappingName",{get:function(){var e;return void 0===this._mappingName&&this._dictionary.has("TM")&&(e=this._dictionary.get("TM"))&&"string"==typeof e&&(this._mappingName=e),this._mappingName},set:function(e){void 0!==this.mappingName&&this._mappingName===e||(this._mappingName=e,this._dictionary.update("TM",e))},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"toolTip",{get:function(){var e;return void 0===this._alternateName&&this._dictionary&&this._dictionary.has("TU")&&(e=this._dictionary.get("TU"))&&"string"==typeof e&&(this._alternateName=e),this._alternateName},set:function(e){void 0!==this.toolTip&&this._alternateName===e||(this._alternateName=e,this._dictionary.update("TU",e))},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"visibility",{get:function(){if(this._isLoaded){var e=kAt.visible,t=this.itemAt(this._defaultIndex),i=bAt.default;if(t&&t._hasFlags)i=t.flags;else{if(!this._dictionary.has("F"))return kAt.visibleNotPrintable;i=this._dictionary.get("F")}t=3;switch((i&bAt.hidden)===bAt.hidden&&(t=0),(i&bAt.noView)===bAt.noView&&(t=1),(i&bAt.print)!==bAt.print&&(t&=2),t){case 0:e=kAt.hidden;break;case 1:e=kAt.hiddenPrintable;break;case 2:e=kAt.visibleNotPrintable;break;case 3:e=kAt.visible}}else void 0===this._visibility&&(this._visibility=kAt.visible),e=this._visibility;return e},set:function(e){var t=this.itemAt(this._defaultIndex);if(this._isLoaded)!t||t._hasFlags&&this.visibility===e?this._dictionary.has("F")&&this.visibility===e||(Akt(this._dictionary,e),this._dictionary._updated=!0):(Akt(t._dictionary,e),this._dictionary._updated=!0);else if(this.visibility!==e)switch(this._visibility=e){case kAt.hidden:t.flags=bAt.hidden;break;case kAt.hiddenPrintable:t.flags=bAt.noView|bAt.print;break;case kAt.visible:t.flags=bAt.print;break;case kAt.visibleNotPrintable:t.flags=bAt.default}},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"bounds",{get:function(){var e,t=this.itemAt(this._defaultIndex);return t&&(t._page=this.page),t&&t.bounds?e=t.bounds:this._dictionary&&this._dictionary.has("Rect")&&(e=FMt(this._dictionary,this.page)),e=null==e?{x:0,y:0,width:0,height:0}:e},set:function(e){if(0===e.x&&0===e.y&&0===e.width&&0===e.height)throw new Error("Cannot set empty bounds");var t=this.itemAt(this._defaultIndex);this._isLoaded&&(void 0===t||this._dictionary.has("Rect"))?this._dictionary.update("Rect",OMt([e.x,e.y,e.width,e.height],this.page)):(t._page=this.page,t.bounds=e)},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"rotate",{get:function(){var e,t=this.itemAt(this._defaultIndex);if(t&&void 0!==t.rotate)e=t.rotate;else if(this._dictionary.has("R"))e=this._dictionary.get("R");else for(var i=0;i<this._kidsCount&&void 0===e;i++)i!==this._defaultIndex&&(t=this.itemAt(i))&&void 0!==t.rotate&&(e=t.rotate);return e=void 0===e?0:e},set:function(e){var t=this.itemAt(this._defaultIndex);t?t.rotate=e:this._dictionary.has("R")&&this._dictionary.get("R")===e||this._dictionary.update("R",e)},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"color",{get:function(){var e,t=this.itemAt(this._defaultIndex);return t&&t.color?e=t.color:this._defaultAppearance&&(e=this._da.color),e},set:function(e){var t=this.itemAt(this._defaultIndex);t&&t.color&&Kkt(e)?t.color=e:(t=!1,this._defaultAppearance||(this._da=new CTt(""),t=!0),!t&&this._da.color===e||(this._da.color=e,this._dictionary.update("DA",this._da.toString())))},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"backColor",{get:function(){return this._parseBackColor(!1)},set:function(e){this._updateBackColor(e)},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"borderColor",{get:function(){return this._parseBorderColor(!0)},set:function(e){this._updateBorderColor(e,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"readOnly",{get:function(){return 0!=(this._fieldFlags&qAt.readOnly)},set:function(e){e?this._fieldFlags|=qAt.readOnly:(this._fieldFlags===qAt.readOnly&&(this._fieldFlags|=qAt.default),this._fieldFlags&=~qAt.readOnly)},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"required",{get:function(){return 0!=(this._fieldFlags&qAt.required)},set:function(e){e?this._fieldFlags|=qAt.required:this._fieldFlags&=~qAt.required},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"visible",{get:function(){var e,t;return this._isLoaded?(e=this.itemAt(this._defaultIndex),t=bAt.default,e&&e._hasFlags?t=e.flags:this._dictionary.has("F")&&(t=this._dictionary.get("F")),t!==bAt.hidden):this._visible},set:function(e){this._isLoaded||this._visible===e||e||(this._visible=e,this.itemAt(this._defaultIndex).flags=bAt.hidden)},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"border",{get:function(){var e,t=this.itemAt(this._defaultIndex);if(t&&t._dictionary.has("BS"))e=t.border;else if(e=new lDt,this instanceof tTt||(e._width=0),e._dictionary=this._dictionary,null!==this._dictionary&&void 0!==this._dictionary&&this._dictionary.has("BS")){t=this._dictionary.get("BS");if(t){if(t.has("W")&&(e._width=t.get("W")),t.has("S")){var i=t.get("S");if(i)switch(i.name){case"D":e._style=xAt.dashed;break;case"B":e._style=xAt.beveled;break;case"I":e._style=xAt.inset;break;case"U":e._style=xAt.underline;break;default:e._style=xAt.solid}}t.has("D")&&(e._dash=t.getArray("D"))}}return e},set:function(e){var t=this.itemAt(this._defaultIndex);t?this._updateBorder(t._dictionary,e):this._updateBorder(this._dictionary,e)},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"rotationAngle",{get:function(){var e=TAt.angle0,t=this.itemAt(this._defaultIndex);return e=t?t.rotationAngle:e},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"export",{get:function(){return!(0!=(this._fieldFlags&qAt.noExport))},set:function(e){e?this._fieldFlags&=~qAt.noExport:this._fieldFlags|=qAt.noExport},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"tabIndex",{get:function(){if(this._isLoaded){var e=void 0;if(this.page._pageDictionary.has("Annots")&&(e=this.page._pageDictionary.get("Annots")),this._kids&&0<this._kids.length)for(var t=0;t<this._kids.length;t++){var i,n=this._kids[Number.parseInt(t.toString(),10)];if(n)if(this.page._pageDictionary.has("Annots"))if(e)if(-1!==(i=e.indexOf(n)))return i}else if(this._dictionary&&this._dictionary.has("Subtype")&&"Widget"===this._dictionary.get("Subtype").name)if(this._ref)if(e)if(-1!==(i=e.indexOf(this._ref)))return i;return-1}return this._tabIndex},set:function(e){var t,i;this._tabIndex=e,this._isLoaded&&(e=this.page)&&(e.tabOrder===WAt.manual||this.form&&this.form._tabOrder===WAt.manual)&&e._pageDictionary.has("Annots")&&(i=e._pageDictionary.get("Annots"),t=new yDt(i,this._crossReference,e),e._annotations=t,(t=i.indexOf(this._ref))<0&&(t=this._annotationIndex),i=e.annotations._reArrange(this._ref,this._tabIndex,t),e._pageDictionary.update("Annots",i),e._pageDictionary._updated=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"page",{get:function(){if(!this._page){var e,t=this.itemAt(this._defaultIndex),i=(void 0!==t?t:this)._dictionary,n=(this._crossReference&&(e=this._crossReference._document),void 0);if(i&&i.has("P")){var o=i.getRaw("P");if(o&&e)for(var r=0;r<e.pageCount;r++){var s=e.getPage(r);if(s&&s._ref===o){n=s;break}}}if(!n&&e){i=(void 0!==t?t:this)._ref;if(!(n=!n&&i?ZMt(e,i):n)&&this._kids&&0<this._kids.length)for(r=0;r<this._kids.length&&!(n=ZMt(e,this._kids[Number.parseInt(r.toString(),10)]));r++);}this._page=n}return this._page},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"flatten",{get:function(){return this._flatten},set:function(e){this._flatten=e},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"_grayBrush",{get:function(){return this._gray||(this._gray=new fIt([128,128,128])),this._gray},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"_silverBrush",{get:function(){return this._silver||(this._silver=new fIt([198,198,198])),this._silver},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"_whiteBrush",{get:function(){return this._white||(this._white=new fIt([255,255,255])),this._white},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"_blackBrush",{get:function(){return this._black||(this._black=new fIt([0,0,0])),this._black},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"_kidsCount",{get:function(){return this._kids?this._kids.length:0},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"_hasBackColor",{get:function(){var e,t;return this._isLoaded?((e=this._mkDictionary)||(t=this.itemAt(this._defaultIndex))&&t._dictionary.has("MK")&&(e=t._dictionary.get("MK")),e&&e.has("BG")):!this._isTransparentBackColor},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"_hasBorderColor",{get:function(){var e,t;return this._isLoaded?((e=this._mkDictionary)||(t=this.itemAt(this._defaultIndex))&&t._dictionary.has("MK")&&(e=t._dictionary.get("MK")),e&&e.has("BC")):!this._isTransparentBorderColor},enumerable:!0,configurable:!0}),KIt.prototype._parseBackColor=function(e){var t;return t=(!e||this._isLoaded&&this._hasBackColor||!this._isLoaded&&!this._isTransparentBackColor)&&((e=this.itemAt(this._defaultIndex))&&e.backColor?t=e.backColor:this._mkDictionary&&(e=this._mkDictionary)&&e.has("BG")&&(e=e.getArray("BG"))&&(t=VMt(e)),null==t)?[255,255,255]:t},KIt.prototype._parseBorderColor=function(e){var t;return t=(!e||this._isLoaded&&this._hasBorderColor||!this._isLoaded&&!this._isTransparentBorderColor)&&((e=this.itemAt(this._defaultIndex))&&e.borderColor?t=e.borderColor:this._mkDictionary&&(e=this._mkDictionary).has("BC")&&(e=e.getArray("BC"))&&(t=VMt(e)),null==t)?[0,0,0]:t},KIt.prototype._updateBackColor=function(e,t){var i;(t=void 0===t?!1:t)&&Kkt(e)&&4===e.length&&255!==e[3]?(this._isTransparentBackColor=!0,this._dictionary&&this._dictionary.has("BG")&&delete this._dictionary._map.BG,(i=this._mkDictionary)&&i.has("BG")&&(delete i._map.BG,this._dictionary._updated=!0),(t=this.itemAt(this._defaultIndex))&&(t.backColor=e)):(this._isTransparentBackColor=!1,(t=this.itemAt(this._defaultIndex))&&t.backColor!==e?t.backColor=e:void 0===(i=this._mkDictionary)?((t=new mPt(this._crossReference)).update("BG",[Number.parseFloat((e[0]/255).toFixed(3)),Number.parseFloat((e[1]/255).toFixed(3)),Number.parseFloat((e[2]/255).toFixed(3))]),this._dictionary.update("MK",t)):i.has("BG")&&VMt(i.getArray("BG"))===e||(i.update("BG",[Number.parseFloat((e[0]/255).toFixed(3)),Number.parseFloat((e[1]/255).toFixed(3)),Number.parseFloat((e[2]/255).toFixed(3))]),this._dictionary._updated=!0))},KIt.prototype._updateBorderColor=function(e,t){var i;(t=void 0===t?!1:t)&&4===e.length&&255!==e[3]?(this._isTransparentBorderColor=!0,this._dictionary.has("BC")&&delete this._dictionary._map.BC,(i=this._mkDictionary)&&i.has("BC")&&(delete i._map.BC,this._dictionary.has("BS")&&(t=this._dictionary.get("BS"))&&t.has("W")&&delete t._map.W,this._dictionary._updated=!0),(t=this.itemAt(this._defaultIndex))&&(t.borderColor=e)):(this._isTransparentBorderColor=!1,(t=this.itemAt(this._defaultIndex))&&t.borderColor!==e?t.borderColor=e:void 0===(i=this._mkDictionary)?((t=new mPt(this._crossReference)).update("BC",[Number.parseFloat((e[0]/255).toFixed(3)),Number.parseFloat((e[1]/255).toFixed(3)),Number.parseFloat((e[2]/255).toFixed(3))]),this._dictionary.update("MK",t)):i.has("BC")&&VMt(i.getArray("BC"))===e||(i.update("BC",[Number.parseFloat((e[0]/255).toFixed(3)),Number.parseFloat((e[1]/255).toFixed(3)),Number.parseFloat((e[2]/255).toFixed(3))]),this._dictionary._updated=!0))},KIt.prototype.itemAt=function(e){var t,i,n;return 0<=e&&e<this._kidsCount&&(this._parsedItems.has(e)?t=this._parsedItems.get(e):(i=void 0,(i=(n=this._kids[Number.parseInt(e.toString(),10)])&&n instanceof aPt?this._crossReference._fetch(n):i)&&((t=GEt._load(i,this._crossReference))._ref=n,this._parsedItems.set(e,t)))),t},KIt.prototype.setAppearance=function(e){this._setAppearance=e},KIt.prototype.getValue=function(e){var t;if(!this._dictionary||!this._dictionary.has(e))throw new Error("PdfException: "+e+" is not found");var i=this._dictionary.get(e);if(null!=i&&i instanceof k)t=i.name;else{if("string"!=typeof i)throw new Error("PdfException: "+e+" is not found");t=i}return t},KIt.prototype.setValue=function(e,t){e&&""!==e&&t&&""!==t&&this._dictionary.update(e,t)},KIt.prototype.removeItemAt=function(i){var e,t,n;null!==this._dictionary&&void 0!==this._dictionary&&this._dictionary.has("Kids")&&0<this.itemsCount&&(e=this.itemAt(i))&&e._ref&&((t=e._getPage())&&t._removeAnnotation(e._ref),this._kids.splice(i,1),this._dictionary.set("Kids",this._kids),this._dictionary._updated=!0,this._parsedItems.delete(i),0<this._parsedItems.size)&&(n=new Map,this._parsedItems.forEach(function(e,t){i<t?n.set(t-1,e):n.set(t,e)}),this._parsedItems=n)},KIt.prototype.removeItem=function(e){e&&e._ref&&-1!==(e=this._kids.indexOf(e._ref))&&this.removeItemAt(e)},Object.defineProperty(KIt.prototype,"_fieldFlags",{get:function(){return void 0===this._flags&&(this._flags=PMt(this._dictionary,"Ff",!1,!0,"Parent"),void 0===this._flags)&&(this._flags=qAt.default),this._flags},set:function(e){this._fieldFlags!==e&&(this._flags=e,this._dictionary.update("Ff",e))},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"_defaultAppearance",{get:function(){var e;return void 0===this._da&&(e=PMt(this._dictionary,"DA",!1,!0,"Parent"))&&""!==e&&(this._da=new CTt(e)),this._da},enumerable:!0,configurable:!0}),Object.defineProperty(KIt.prototype,"_mkDictionary",{get:function(){var e;return e=this._dictionary&&this._dictionary.has("MK")?this._dictionary.get("MK"):e},enumerable:!0,configurable:!0}),KIt.prototype._updateBorder=function(e,t){var i,n=!1;e&&e.has("BS")?i=e.get("BS"):(i=new mPt(this._crossReference),e.update("BS",i),n=!0),void 0!==t.width?(i.update("W",t.width),e._updated=!0):n&&i.update("W",0),void 0!==t.style?(i.update("S",_Mt(t.style)),e._updated=!0):n&&i.update("S",_Mt(xAt.solid)),void 0!==t.dash&&(i.update("D",t.dash),e._updated=!0)},KIt.prototype._checkFieldFlag=function(e){e=e.get("F");return void 0!==e&&6===e},KIt.prototype._initializeFont=function(e){this._font=e;var t,i,n,o,r=this._crossReference._document,s=!1,a=((t=r?r.form._dictionary.has("DR")?r.form._dictionary.get("DR"):new mPt(this._crossReference):t)&&t.has("Font")&&((a=t.getRaw("Font"))&&a instanceof aPt?(s=!0,i=this._crossReference._fetch(a)):a instanceof mPt&&(i=a)),i||(i=new mPt(this._crossReference),t.update("Font",i)),!1),l=(this._font&&null!==this._font._key&&void 0!==this._font._key&&this._font._reference?(n=k.get(this._font._key),o=this._font._reference,a=!0):(n=k.get(XMt()),o=this._crossReference._getNextReference(),this._font&&(this._font._key=n.name,this._font._reference=o)),o&&!a&&(e instanceof Uxt?this._font._pdfFontInternals&&(this._crossReference._cacheMap.set(o,this._font._pdfFontInternals),this._font._reference=o):this._font._dictionary&&(this._crossReference._cacheMap.set(o,this._font._dictionary),i.update(n.name,o),t._updated=!0,r.form._dictionary.update("DR",t),r.form._dictionary._updated=!0)),i.update(n.name,o),t._updated=!0,r.form._dictionary.update("DR",t),r.form._dictionary._updated=!0,this._fontName=n.name,new CTt);if(l.fontName=this._fontName,l.fontSize=this._font._size,l.color=this.color||[0,0,0],this._dictionary.has("Kids"))for(var h=this._dictionary.getArray("Kids"),d=0;d<h.length;d++){var p=this.itemAt(d);h[Number.parseInt(d.toString(),10)].update("DA",l.toString()),p&&(p._da=l)}else this._dictionary.has("Subtype")&&"Widget"===this._dictionary.get("Subtype").name&&this._dictionary.update("DA",l.toString());s&&(t._updated=!0)},KIt.prototype._drawRectangularControl=function(e,t){switch(e.drawRectangle(t.bounds[0],t.bounds[1],t.bounds[2],t.bounds[3],t.backBrush),this._drawBorder(e,t.bounds,t.borderPen,t.borderStyle,t.borderWidth),t.borderStyle){case xAt.inset:this._drawLeftTopShadow(e,t.bounds,t.borderWidth,this._grayBrush),this._drawRightBottomShadow(e,t.bounds,t.borderWidth,this._silverBrush);break;case xAt.beveled:this._drawLeftTopShadow(e,t.bounds,t.borderWidth,this._whiteBrush),this._drawRightBottomShadow(e,t.bounds,t.borderWidth,t.shadowBrush)}},KIt.prototype._drawBorder=function(e,t,i,n,o){i&&0<o&&(n===xAt.underline?e.drawLine(i,t[0],t[0]+t[3]-o/2,t[0]+t[2],t[1]+t[3]-o/2):e.drawRectangle(t[0]+o/2,t[1]+o/2,t[2]-o,t[3]-o,i))},KIt.prototype._drawLeftTopShadow=function(e,t,i,n){var o=new nIt,r=[];r.push([t[0]+i,t[1]+i]),r.push([t[0]+i,t[1]+t[3]-i]),r.push([t[0]+2*i,t[1]+t[3]-2*i]),r.push([t[0]+2*i,t[1]+2*i]),r.push([t[0]+t[2]-2*i,t[1]+2*i]),r.push([t[0]+t[2]-i,t[1]+i]),o.addPolygon(r),e.drawPath(o,n)},KIt.prototype._drawRightBottomShadow=function(e,t,i,n){var o=new nIt,r=[];r.push([t[0]+i,t[1]+t[3]-i]),r.push([t[0]+2*i,t[1]+t[3]-2*i]),r.push([t[0]+t[2]-2*i,t[1]+t[3]-2*i]),r.push([t[0]+t[2]-2*i,t[1]+2*i]),r.push([t[0]+t[2]-i,t[1]+i]),r.push([t[0]+t[2]-i,t[1]+t[3]-i]),o.addPolygon(r),e.drawPath(o,n)},KIt.prototype._drawRadioButton=function(e,t,i,n){if("l"===i){var o,r=t.bounds,s=r[2];switch(this._enableGrouping&&(s=Math.min(r[2],r[3])),n){case YAt.checked:case YAt.unchecked:e.drawEllipse(r[0],r[1],s,r[3],t.backBrush);break;case YAt.pressedChecked:case YAt.pressedUnchecked:t.borderStyle===xAt.beveled||t.borderStyle===xAt.underline?e.drawEllipse(r[0],r[1],r[2],r[3],t.backBrush):e.drawEllipse(r[0],r[1],s,r[3],t.shadowBrush)}this._drawRoundBorder(e,r,t.borderPen,t.borderWidth),this._drawRoundShadow(e,t,n),n!==YAt.checked&&n!==YAt.pressedChecked||(o=[r[0]+t.borderWidth/2,r[1]+t.borderWidth/2,s-t.borderWidth,r[3]-t.borderWidth],e.drawEllipse(o[0]+o[2]/4,o[1]+o[2]/4,o[2]-o[2]/2,o[3]-o[2]/2,t.foreBrush))}else this._drawCheckBox(e,t,i,n)},KIt.prototype._drawRoundBorder=function(e,t,i,n){0===t[0]&&0===t[1]&&0===t[2]&&0===t[3]||e.drawEllipse(t[0]+n/2,t[1]+n/2,(this._enableGrouping?Math.min(t[2],t[3]):t[2])-n,t[3]-n,i)},KIt.prototype._drawRoundShadow=function(e,t,i){var n=t.borderWidth,o=-1.5*n,r=t.bounds[0]+o,s=t.bounds[1]+o,a=t.bounds[2]+2*o,o=t.bounds[3]+2*o,l=t.shadowBrush;if(l){var h=l._color,d=void 0,p=void 0;switch(t.borderStyle){case xAt.beveled:switch(i){case YAt.pressedChecked:case YAt.pressedUnchecked:d=new yIt(h,n),p=new yIt([255,255,255],n);break;case YAt.checked:case YAt.unchecked:d=new yIt([255,255,255],n),p=new yIt(h,n)}break;case xAt.inset:switch(i){case YAt.pressedChecked:case YAt.pressedUnchecked:d=new yIt([0,0,0],n),p=new yIt([0,0,0],n);break;case YAt.checked:case YAt.unchecked:d=new yIt([128,128,128],n),p=new yIt([192,192,192],n)}}d&&p&&(e.drawArc(r,s,a,o,135,180,d),e.drawArc(r,s,a,o,-45,180,p))}},KIt.prototype._drawCheckBox=function(e,t,i,n,o){switch(n){case YAt.unchecked:case YAt.checked:(t.borderPen||t.backBrush)&&e.drawRectangle(t.bounds[0],t.bounds[1],t.bounds[2],t.bounds[3],t.backBrush);break;case YAt.pressedChecked:case YAt.pressedUnchecked:t.borderStyle===xAt.beveled||t.backBrush||t.borderStyle===xAt.underline?(t.borderPen||t.backBrush)&&e.drawRectangle(t.bounds[0],t.bounds[1],t.bounds[2],t.bounds[3],t.backBrush):(t.borderPen||t.shadowBrush)&&e.drawRectangle(t.bounds[0],t.bounds[1],t.bounds[2],t.bounds[3],t.shadowBrush)}var r=t.bounds;if(this._drawBorder(e,t.bounds,t.borderPen,t.borderStyle,t.borderWidth),n===YAt.pressedChecked||n===YAt.pressedUnchecked)switch(t.borderStyle){case xAt.inset:this._drawLeftTopShadow(e,t.bounds,t.borderWidth,this._blackBrush),this._drawRightBottomShadow(e,t.bounds,t.borderWidth,this._whiteBrush);break;case xAt.beveled:this._drawLeftTopShadow(e,t.bounds,t.borderWidth,t.shadowBrush),this._drawRightBottomShadow(e,t.bounds,t.borderWidth,this._whiteBrush)}else switch(t.borderStyle){case xAt.inset:this._drawLeftTopShadow(e,t.bounds,t.borderWidth,this._grayBrush),this._drawRightBottomShadow(e,t.bounds,t.borderWidth,this._silverBrush);break;case xAt.beveled:this._drawLeftTopShadow(e,t.bounds,t.borderWidth,this._whiteBrush),this._drawRightBottomShadow(e,t.bounds,t.borderWidth,t.shadowBrush)}var s,a,l,h,d=0,p=0;switch(n){case YAt.pressedChecked:case YAt.checked:o?o=new _xt(Zxt.zapfDingbats,o._size):(s=t.borderStyle===xAt.beveled||t.borderStyle===xAt.inset,a=t.borderWidth,s&&(a*=2),s=Math.max(s?2*t.borderWidth:t.borderWidth,1),a=Math.min(a,s),p=t.bounds[2]>t.bounds[3]?t.bounds[3]:t.bounds[2],o=new _xt(Zxt.zapfDingbats,p-2*a),t.bounds[2]>t.bounds[3]&&(d=(t.bounds[3]-o._metrics._getHeight())/2)),0===p&&(p=t.bounds[3]),(t.pageRotationAngle!==TAt.angle0||0<t.rotationAngle)&&(s=e.save(),a=e._size,t.pageRotationAngle!==TAt.angle0&&(t.pageRotationAngle===TAt.angle90?(e.translateTransform(a[1],0),e.rotateTransform(90),h=a[1]-(r[0]+r[2]),r=[r[1],h,r[3],r[2]]):t.pageRotationAngle===TAt.angle180?(e.translateTransform(a[0],a[1]),e.rotateTransform(-180),r=[a[0]-(r[0]+r[2]),h=a[1]-(r[1]+r[3]),r[2],r[3]]):t.pageRotationAngle===TAt.angle270&&(e.translateTransform(0,a[0]),e.rotateTransform(270),r=[a[0]-(r[1]+r[3]),h=r[0],r[3],r[2]])),0<t.rotationAngle?(90===t.rotationAngle?r=t.pageRotationAngle===TAt.angle90?(e.translateTransform(0,a[1]),e.rotateTransform(-90),[a[1]-(r[1]+r[3]),h=r[0],r[3],r[2]]):r[2]>r[3]?(e.translateTransform(0,a[1]),e.rotateTransform(-90),[t.bounds[0],t.bounds[1],t.bounds[2],t.bounds[3]]):(l=r[0],r[0]=-(r[1]+r[3]),r[1]=l,l=r[3],r[3]=r[2]>o._metrics._getHeight()?r[2]:o._metrics._getHeight(),r[2]=l,e.rotateTransform(-90),[r[0],r[1],r[2],r[3]]):270===t.rotationAngle?(e.translateTransform(a[0],0),e.rotateTransform(-270),r=[r[1],h=a[0]-(r[0]+r[2]),r[3],r[2]]):180===t.rotationAngle&&(e.translateTransform(a[0],a[1]),e.rotateTransform(-180),r=[a[0]-(r[0]+r[2]),h=a[1]-(r[1]+r[3]),r[2],r[3]]),e.drawString(i,o,[r[0],r[1]-d,r[2],r[3]],null,t.foreBrush,new E1t(MAt.center,T1t.middle)),e.restore(s)):e.drawString(i,o,[r[0],r[1]-d,r[2],r[3]],null,t.foreBrush,new E1t(MAt.center,T1t.middle)))}},KIt.prototype._addToKid=function(e){var t;this._dictionary&&this._dictionary.has("Kids")?this._kids=this._dictionary.get("Kids"):(this._kids=[],this._dictionary.update("Kids",this._kids),this._parsedItems=new Map),-1===this._kids.indexOf(e._ref)&&(t=this._kidsCount,e._index=t,this._kids.push(e._ref),this._parsedItems.set(t,e))},KIt.prototype._drawTemplate=function(e,t,i){var n;e&&t&&((n=t.graphics).save(),t.rotation===TAt.angle90?(n.translateTransform(n._size[1],0),n.rotateTransform(90)):t.rotation===TAt.angle180?(n.translateTransform(n._size[0],n._size[1]),n.rotateTransform(-180)):t.rotation===TAt.angle270&&(n.translateTransform(0,n._size[0]),n.rotateTransform(270)),n._sw._setTextRenderingMode(uIt.fill),n.drawTemplate(e,i),n.restore())},KIt.prototype._addToOptions=function(e,t){t instanceof fTt&&t._listValues.push(e._text),t._options.push([e._value,e._text]),t._dictionary.set("Opt",t._options),t._dictionary._updated=!0,!e._isFont&&e._pdfFont&&this._initializeFont(e._pdfFont)},KIt.prototype._addAppearance=function(e,t,i){var n=new mPt,e=(e&&e.has("AP")?(n=e.get("AP"),xkt(e.get("AP"),this._crossReference,i)):(n=new mPt(this._crossReference),e.update("AP",n)),this._crossReference._getNextReference());this._crossReference._cacheMap.set(e,t._content),n.update(i,e)},KIt.prototype._rotateTextBox=function(e,t,i){var n=[0,0,0,0];return i===TAt.angle180?n=[t[0]-(e[0]+e[2]),t[1]-(e[1]+e[3]),e[2],e[3]]:i===TAt.angle270?n=[e[1],t[0]-(e[0]+e[2]),e[3],e[2]]:i===TAt.angle90&&(n=[t[1]-(e[1]+e[3]),e[0],e[3],e[2]]),n},KIt.prototype._checkIndex=function(e,t){if(e<0||0!==e&&t<=e)throw Error("Index out of range.")},KIt.prototype._getAppearanceStateValue=function(){var e;if(this._dictionary&&this._dictionary.has("Kids"))for(var t=0;t<this._kidsCount;t++){var i,n=this.itemAt(t);if(n&&n._dictionary&&n._dictionary.has("AS"))if((i=n._dictionary.get("AS"))&&"Off"!==i.name){e=i.name;break}}else this._dictionary&&this._dictionary.has("AS")&&(i=this._dictionary.get("AS"))&&"Off"!==i.name&&(e=i.name);return e},KIt.prototype._getTextAlignment=function(){var e;return null!==this._textAlignment&&void 0!==this._textAlignment||(this._isLoaded?(e=this.itemAt(this._defaultIndex))&&e._dictionary&&e._dictionary.has("Q")?this._textAlignment=e._dictionary.get("Q"):this._dictionary.has("Q")?this._textAlignment=this._dictionary.get("Q"):this._textAlignment=MAt.left:this._textAlignment=MAt.left),this._textAlignment},KIt.prototype._setTextAlignment=function(e){var t=this.itemAt(this._defaultIndex);this._isLoaded&&!this.readOnly&&(t&&t._dictionary?t:this)._dictionary.update("Q",e),this._isLoaded||this._textAlignment===e||(t&&t._dictionary?t._dictionary.update("Q",e):this._dictionary&&this._dictionary.update("Q",e)),this._textAlignment=e,this._stringFormat=new E1t(e,T1t.middle)},KIt.prototype._parseItems=function(){for(var e=[],t=0;t<this.itemsCount;t++)e.push(this.itemAt(t));return e},KIt);function KIt(){this._enableGrouping=!1,this._isDuplicatePage=!1,this._visible=!0,this._isTransparentBackColor=!1,this._isTransparentBorderColor=!1,this._defaultFont=new _xt(Zxt.helvetica,8),this._appearanceFont=new _xt(Zxt.helvetica,10,Jxt.regular),this._defaultItemFont=new _xt(Zxt.timesRoman,12),this._flatten=!1,this._circleCaptionFont=new _xt(Zxt.helvetica,8,Jxt.regular),this._isUpdating=!1,this._isImport=!1}Wo($It,JIt=XIt),$It._load=function(e,t,i,n){var o=new $It;return o._isLoaded=!0,o._form=e,o._dictionary=t,o._crossReference=i,o._ref=n,o._dictionary.has("Kids")&&(o._kids=o._dictionary.get("Kids")),o._defaultIndex=0,o._parsedItems=new Map,o},Object.defineProperty($It.prototype,"text",{get:function(){var e,t;return void 0===this._text&&(this._isLoaded?((e=PMt(this._dictionary,"V",!1,!0,"Parent"))||(t=this.itemAt(this._defaultIndex))&&(e=t._dictionary.get("V")))&&(this._text=fMt(e)):this._text=""),this._text},set:function(e){var t;this._isLoaded?this.readOnly||(this._dictionary.has("V")&&this._dictionary.get("V")===e||this._dictionary.update("V",e),!(t=this.itemAt(this._defaultIndex)))||t._dictionary.has("V")&&t._dictionary.get("V")===e||t._dictionary.update("V",e):this._text!==e&&(this._dictionary.update("V",e),this._text=e)},enumerable:!0,configurable:!0}),Object.defineProperty($It.prototype,"textAlignment",{get:function(){return this._getTextAlignment()},set:function(e){this._textAlignment!==e&&this._setTextAlignment(e)},enumerable:!0,configurable:!0}),Object.defineProperty($It.prototype,"defaultValue",{get:function(){var e;return void 0===this._defaultValue&&(e=PMt(this._dictionary,"DV",!1,!0,"Parent"))&&(this._defaultValue=e),this._defaultValue},set:function(e){e!==this.defaultValue&&(this._dictionary.update("DV",e),this._defaultValue=e)},enumerable:!0,configurable:!0}),Object.defineProperty($It.prototype,"multiLine",{get:function(){return 0!=(this._fieldFlags&qAt.multiLine)},set:function(e){e?this._fieldFlags|=qAt.multiLine:this._fieldFlags&=~qAt.multiLine},enumerable:!0,configurable:!0}),Object.defineProperty($It.prototype,"password",{get:function(){return 0!=(this._fieldFlags&qAt.password)},set:function(e){e?this._fieldFlags|=qAt.password:this._fieldFlags&=~qAt.password},enumerable:!0,configurable:!0}),Object.defineProperty($It.prototype,"scrollable",{get:function(){return!(0!=(this._fieldFlags&qAt.doNotScroll))},set:function(e){e?this._fieldFlags&=~qAt.doNotScroll:this._fieldFlags|=qAt.doNotScroll},enumerable:!0,configurable:!0}),Object.defineProperty($It.prototype,"spellCheck",{get:function(){return!(0!=(this._fieldFlags&qAt.doNotSpellCheck))},set:function(e){e?this._fieldFlags&=~qAt.doNotSpellCheck:this._fieldFlags|=qAt.doNotSpellCheck},enumerable:!0,configurable:!0}),Object.defineProperty($It.prototype,"insertSpaces",{get:function(){var e=this._fieldFlags;return 0!=(qAt.comb&e)&&0==(e&qAt.multiLine)&&0==(e&qAt.password)&&0==(e&qAt.fileSelect)},set:function(e){e?this._fieldFlags|=qAt.comb:this._fieldFlags&=~qAt.comb},enumerable:!0,configurable:!0}),Object.defineProperty($It.prototype,"highlightMode",{get:function(){var e,t=this.itemAt(this._defaultIndex);return t&&void 0!==t.highlightMode?e=t.highlightMode:this._dictionary&&this._dictionary.has("H")&&(e=WMt(this._dictionary.get("H").name)),void 0!==e?e:DAt.noHighlighting},set:function(e){var t=this.itemAt(this._defaultIndex);!t||void 0!==t.highlightMode&&t.highlightMode===e?this._dictionary.has("H")&&WMt(this._dictionary.get("H"))===e||this._dictionary.update("H",QMt(e)):t.highlightMode=e},enumerable:!0,configurable:!0}),Object.defineProperty($It.prototype,"maxLength",{get:function(){var e;return void 0===this._maxLength&&(e=PMt(this._dictionary,"MaxLen",!1,!0,"Parent"),this._maxLength=void 0!==e&&Number.isInteger(e)?e:0),this._maxLength},set:function(e){this.maxLength!==e&&(this._dictionary.update("MaxLen",e),this._maxLength=e)},enumerable:!0,configurable:!0}),Object.defineProperty($It.prototype,"isAutoResizeText",{get:function(){return this._autoResizeText},set:function(e){this._autoResizeText=e;var t=this.itemAt(this._defaultIndex);t&&(t._isAutoResize=e)},enumerable:!0,configurable:!0}),Object.defineProperty($It.prototype,"font",{get:function(){var e;return this._font||(e=this.itemAt(this._defaultIndex),this._font=Rkt(this._form,e,this)),this._font},set:function(e){e&&e instanceof Oxt&&(this._font=e,this._initializeFont(e))},enumerable:!0,configurable:!0}),Object.defineProperty($It.prototype,"backColor",{get:function(){return this._parseBackColor(!0)},set:function(e){this._updateBackColor(e,!0)},enumerable:!0,configurable:!0}),$It.prototype._initialize=function(e,t,i){this._crossReference=e._crossReference,this._page=e,this._name=t,this._text="",this._defaultValue="",this._defaultIndex=0,this._spellCheck=!1,this._insertSpaces=!1,this._multiline=!1,this._password=!1,this._scrollable=!1,this._dictionary=new mPt(this._crossReference),this._ref=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(this._ref,this._dictionary),this._dictionary.objId=this._ref.toString(),this._dictionary.update("FT",k.get("Tx")),this._dictionary.update("T",t),this._fieldFlags|=qAt.doNotSpellCheck,this._createItem(i),this._initializeFont(this._defaultFont)},$It.prototype._createItem=function(e){var t=new GEt;t._create(this._page,e,this),t.textAlignment=MAt.left,this._stringFormat=new E1t(t.textAlignment,T1t.middle),t._dictionary.update("MK",new mPt(this._crossReference)),t._mkDictionary.update("BC",[0,0,0]),t._mkDictionary.update("BG",[1,1,1]),t._mkDictionary.update("CA",this.actualName),this._addToKid(t)},$It.prototype._doPostProcess=function(e){if((e=void 0===e?!1:e)||this._setAppearance||this._form._setAppearance){var t=this._kidsCount;if(this._isLoaded)if(0<t)for(var i=0;i<t;i++)(n=this.itemAt(i))&&this._postProcess(e,n);else(e||this._form._setAppearance||this._setAppearance)&&!this._checkFieldFlag(this._dictionary)&&this._postProcess(e);else if(e||this._form._setAppearance||this._setAppearance)for(var n,o,i=0;i<t;i++)(n=this.itemAt(i))&&!this._checkFieldFlag(n._dictionary)&&(o=this._createAppearance(e,n),e?this._drawTemplate(o,n._page,{x:n.bounds.x,y:n.bounds.y,width:o._size[0],height:o._size[1]}):this._addAppearance(n._dictionary,o,"N"),n._dictionary._updated=!e);e&&(this._dictionary._updated=!1)}},$It.prototype._postProcess=function(e,t){var i,n,o=t||this;null!=t&&t._setAppearance&&t._enableGrouping||this._form._setAppearance||this._setAppearance||e&&!o._dictionary.has("AP")?i=this._createAppearance(e,o):o._dictionary.has("AP")&&(t=void 0,n=o._dictionary.get("AP"))&&n.has("N")&&(t=n.get("N"),(n=n.getRaw("N"))&&(t.reference=n),t)&&(i=new _It(t,this._crossReference)),i&&(e?((n=o instanceof GEt?o._getPage():o.page)&&((t=n.graphics).save(),n.rotation===TAt.angle90?(t.translateTransform(t._size[0],t._size[1]),t.rotateTransform(90)):n.rotation===TAt.angle180?(t.translateTransform(t._size[0],t._size[1]),t.rotateTransform(-180)):n.rotation===TAt.angle270&&(t.translateTransform(t._size[0],t._size[1]),t.rotateTransform(270)),e={x:o.bounds.x,y:o.bounds.y,width:i._size[0],height:i._size[1]},t.drawTemplate(i,e),t.restore()),o._dictionary._updated=!1):this._addAppearance(o._dictionary,i,"N"))},$It.prototype._createAppearance=function(e,t){var i,n,o=t.bounds,r=new _It([0,0,o.width,o.height],this._crossReference),s=(nkt(r,null),r._writeTransformation=!1,r.graphics),a=new mDt,o=(a.bounds=[0,0,o.width,o.height],t.backColor),l=(o&&(a.backBrush=new fIt(o)),a.foreBrush=new fIt(t.color),t.border),h=(t.borderColor&&(0===l.width&&(t.borderColor=[255,255,255]),a.borderPen=new yIt(t.borderColor,l.width)),a.borderWidth=l.width,a.borderStyle=l.style,o&&(l=[o[0]-64,o[1]-64,o[2]-64],a.shadowBrush=new fIt([0<=l[0]?l[0]:0,0<=l[1]?l[1]:0,0<=l[2]?l[2]:0])),a.rotationAngle=t.rotate,a.insertSpaces=this.insertSpaces,this.text),o=!1;if(null==h&&(h=""),this.password){for(var d="",p=0;p<h.length;p++)d+="*";h=d}return this.maxLength&&h.length>this.maxLength&&(h=h.substring(0,this.maxLength)),a.required=this.required,this.required||(s._sw._beginMarkupSequence("Tx"),s._initializeCoordinates()),(o=null!=t&&t instanceof GEt&&t._enableGrouping?!0:o)&&null!==t.font&&void 0!==t.font?0===(i=t.font).size&&(i._size=8,i._fontMetrics._size=0):void 0!==this._font&&null!==this._font||(this._font=this._defaultFont),o&&null!==t.textAlignment&&void 0!==t.textAlignment?n=new E1t(t.textAlignment,T1t.middle):void 0!==this._stringFormat&&null!==this._stringFormat||(void 0===this.textAlignment||null===this.textAlignment?this._stringFormat=new E1t(this.textAlignment,T1t.middle):this._stringFormat=new E1t(MAt.left,T1t.middle)),Zkt(h)&&(this._stringFormat.textDirection=JAt.rightToLeft),o?this._drawTextBox(s,a,h,i,n,this.multiLine,this.scrollable,this.maxLength):this._drawTextBox(s,a,h,this._font,this._stringFormat,this.multiLine,this.scrollable,this.maxLength),this.required||s._sw._endMarkupSequence(),r},$It.prototype._drawTextBox=function(e,t,i,n,o,r,s,a){if(void 0!==a)if(t.insertSpaces){var l;if(void 0!==a&&0<a&&this.borderColor){l=t.bounds[2]/a,e.drawRectangle(t.bounds[0],t.bounds[1],t.bounds[2],t.bounds[3],t.borderPen,t.backBrush);for(var h=i,d=0;d<a;d++){i=o.alignment===MAt.right?a-h.length<=d?h[d-(a-h.length)]:"":o.alignment===MAt.center&&h.length<a?(p=Math.floor(a/2-Math.ceil(h.length/2)))<=d&&d<p+h.length?h[d-p]:"":h.length>d?h[Number.parseInt(d.toString(),10)]:"",t.bounds[2]=l;var p=new E1t(MAt.center,T1t.middle);this._drawTextBox(e,t,i,n,p,r,s),t.bounds[0]=t.bounds[0]+l,t.borderWidth&&e.drawLine(t.borderPen,t.bounds[0],t.bounds[1],t.bounds[0],t.bounds[1]+t.bounds[3])}}else this._drawTextBox(e,t,i,n,o,r,s)}else this._drawTextBox(e,t,i,n,o,r,s);else{e._isTemplateGraphics&&t.required&&(e.save(),e._initializeCoordinates()),t.insertSpaces||this._drawRectangularControl(e,t),e._isTemplateGraphics&&t.required&&(e.restore(),e.save(),e._sw._beginMarkupSequence("Tx"),e._initializeCoordinates());var c,u,g=[t.bounds[0],t.bounds[1],t.bounds[2],t.bounds[3]],m=this.rotate;null!=m&&90===m&&(g[1]=g[2]/2),t.borderStyle===xAt.beveled||t.borderStyle===xAt.inset?(g[0]=g[0]+4*t.borderWidth,g[2]=g[2]-8*t.borderWidth):(g[0]=g[0]+2*t.borderWidth,g[2]=g[2]-4*t.borderWidth),r&&(m=(null==o||0===o.lineSpacing?n._metrics._getHeight():o.lineSpacing)-n._metrics._getAscent(o),i.indexOf("\n"),0===g[0]&&1===g[1]&&(g[1]=-(g[1]-m)),t.isAutoFontSize)&&0!==t.borderWidth&&(g[1]=g[1]+2.5*t.borderWidth),e._page&&void 0!==e._page.rotation&&e._page.rotation!==TAt.angle0||0<t.rotationAngle?(m=e.save(),void 0!==t.pageRotationAngle&&t.pageRotationAngle!==TAt.angle0&&(t.pageRotationAngle===TAt.angle90?(e.translateTransform(e._size[1],0),e.rotateTransform(90),u=e._size[1]-(g[0]+g[2]),g=[g[1],u,g[3],g[2]]):t.pageRotationAngle===TAt.angle180?(e.translateTransform(e._size[0],e._size[1]),e.rotateTransform(-180),g=[e._size[0]-(g[0]+g[2]),u=e._size[1]-(g[1]+g[3]),g[2],g[3]]):t.pageRotationAngle===TAt.angle270&&(e.translateTransform(0,e._size[0]),e.rotateTransform(270),g=[e._size[0]-(g[1]+g[3]),u=g[0],g[3],g[2]])),t.rotationAngle&&(90===t.rotationAngle?t.pageRotationAngle===TAt.angle90?(e.translateTransform(0,e._size[1]),e.rotateTransform(-90),g=[e._size[1]-(g[1]+g[3]),u=g[0],g[3],g[2]],t.stringFormat=new E1t(MAt.center,T1t.middle)):g[2]>g[3]?(e.translateTransform(0,e._size[1]),e.rotateTransform(-90),(g=[t.bounds[0],t.bounds[1],t.bounds[2],t.bounds[3]])[1]=g[2]/2-8*t.borderWidth):(c=g[0],g[0]=-(g[1]+g[3]),g[1]=c,c=g[3],g[3]=g[2]>n._metrics._getHeight()?g[2]:n._metrics._getHeight(),g[2]=c,e.rotateTransform(-90)):270===t.rotationAngle?(e.translateTransform(e._size[0],0),e.rotateTransform(-270),(g=[t.bounds[0],t.bounds[1],t.bounds[2],t.bounds[3]])[1]=g[2]/2-8*t.borderWidth):180===t.rotationAngle&&(e.translateTransform(e._size[0],e._size[1]),e.rotateTransform(-180),g=[e._size[0]-(g[0]+g[2]),u=e._size[1]-(g[1]+g[3]),g[2],g[3]])),e.drawString(i,n,g,null,t.foreBrush,o),e.restore(m)):e.drawString(i,n,g,null,t.foreBrush,o),e._isTemplateGraphics&&t.required&&(e._sw._endMarkupSequence(),e.restore())}};var JIt,ZIt=$It;function $It(e,t,i){var n=JIt.call(this)||this;return n._autoResizeText=!1,e&&t&&i&&n._initialize(e,t,i),n}Wo(iTt,eTt=XIt),Object.defineProperty(iTt.prototype,"actions",{get:function(){return this._actions||(this._actions=new qIt(this)),this._actions},enumerable:!0,configurable:!0}),Object.defineProperty(iTt.prototype,"text",{get:function(){var e;return this._isLoaded&&(void 0===this._text&&((e=this.itemAt(this._defaultIndex))&&e._mkDictionary&&e._mkDictionary.has("CA")?this._text=e._mkDictionary.get("CA"):this._mkDictionary&&this._mkDictionary.has("CA")&&(this._text=this._mkDictionary.get("CA"))),void 0===this._text)&&(e=PMt(this._dictionary,"V",!1,!0,"Parent"))&&(this._text=e),void 0===this._text&&(this._text=""),this._text},set:function(e){var t;this._isLoaded&&!this.readOnly&&((t=this.itemAt(this._defaultIndex))&&t._dictionary?this._assignText(t._dictionary,e):this._assignText(this._dictionary,e)),this._isLoaded||this._text===e||(t=this.itemAt(this._defaultIndex),this._assignText(t._dictionary,e),this._text=e)},enumerable:!0,configurable:!0}),Object.defineProperty(iTt.prototype,"textAlignment",{get:function(){return this._getTextAlignment()},set:function(e){this._textAlignment!==e&&this._setTextAlignment(e)},enumerable:!0,configurable:!0}),Object.defineProperty(iTt.prototype,"highlightMode",{get:function(){var e,t=this.itemAt(this._defaultIndex);return t&&void 0!==t.highlightMode?e=t.highlightMode:this._dictionary&&this._dictionary.has("H")&&(e=WMt(this._dictionary.get("H").name)),void 0!==e?e:DAt.invert},set:function(e){var t=this.itemAt(this._defaultIndex);!t||void 0!==t.highlightMode&&t.highlightMode===e?this._dictionary.has("H")&&WMt(this._dictionary.get("H"))===e||this._dictionary.update("H",QMt(e)):t.highlightMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(iTt.prototype,"font",{get:function(){var e;return this._font||(e=this.itemAt(this._defaultIndex),this._font=Rkt(this._form,e,this)),this._font},set:function(e){e&&e instanceof Oxt&&(this._font=e,this._initializeFont(e))},enumerable:!0,configurable:!0}),Object.defineProperty(iTt.prototype,"backColor",{get:function(){return this._parseBackColor(!0)},set:function(e){this._updateBackColor(e,!0)},enumerable:!0,configurable:!0}),iTt.prototype._assignText=function(e,t){var i;e&&e.has("MK")?i=e.get("MK"):(i=new mPt(this._crossReference),e.set("MK",i)),i.update("CA",t),e._updated=!0},iTt._load=function(e,t,i,n){var o=new iTt;return o._isLoaded=!0,o._form=e,o._dictionary=t,o._crossReference=i,o._ref=n,o._dictionary.has("Kids")&&(o._kids=o._dictionary.get("Kids")),o._defaultIndex=0,o._parsedItems=new Map,o},iTt.prototype._initialize=function(e,t,i){this._crossReference=e._crossReference,this._page=e,this._name=t,this._defaultIndex=0,this._dictionary=new mPt(this._crossReference),this._ref=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(this._ref,this._dictionary),this._dictionary.objId=this._ref.toString(),this._dictionary.update("FT",k.get("Btn")),this._dictionary.update("T",t),this._fieldFlags|=qAt.pushButton,this._initializeFont(this._defaultFont),this._createItem(i)},iTt.prototype._createItem=function(e){var t=new GEt;t._create(this._page,e,this),t.textAlignment=MAt.center,this._stringFormat=new E1t(t.textAlignment,T1t.middle),t._dictionary.update("MK",new mPt(this._crossReference)),t._mkDictionary.update("BC",[0,0,0]),t._mkDictionary.update("BG",[.827451,.827451,.827451]),t._mkDictionary.update("CA",void 0!==this._name&&null!==this._name?this._name:this._actualName),this._addToKid(t)},iTt.prototype._doPostProcess=function(e){if((e=void 0===e?!1:e)||this._setAppearance||this._form._setAppearance){var t=this._kidsCount;if(this._isLoaded)if(0<t)for(var i=0;i<t;i++)(n=this.itemAt(i))&&this._postProcess(e,n);else(e||this._form._setAppearance||this._setAppearance)&&!this._checkFieldFlag(this._dictionary)&&this._postProcess(e);else if(e||this._form._setAppearance||this._setAppearance)for(var n,o,i=0;i<t;i++)(n=this.itemAt(i))&&!this._checkFieldFlag(n._dictionary)&&(o=this._createAppearance(n),e?this._drawTemplate(o,n._getPage(),{x:n.bounds.x,y:n.bounds.y,width:o._size[0],height:o._size[1]}):(this._addAppearance(n._dictionary,o,"N"),(o=this._createAppearance(n,!0))&&this._addAppearance(n._dictionary,o,"D")),n._dictionary._updated=!e);e&&(this._dictionary._updated=!1)}},iTt.prototype._postProcess=function(e,t){var i,n,o=t||this;null!=t&&t._setAppearance&&t._enableGrouping||this._form._setAppearance||this._setAppearance||e&&!o._dictionary.has("AP")?i=this._createAppearance(o):o._dictionary.has("AP")&&(t=void 0,n=o._dictionary.get("AP"))&&n.has("N")&&(t=n.get("N"),(n=n.getRaw("N"))&&(t.reference=n),t)&&(i=new _It(t,this._crossReference)),i&&(e?((n=o instanceof GEt?o._getPage():o.page)&&((t=n.graphics).save(),n.rotation===TAt.angle90?(t.translateTransform(t._size[0],t._size[1]),t.rotateTransform(90)):n.rotation===TAt.angle180?(t.translateTransform(t._size[0],t._size[1]),t.rotateTransform(-180)):n.rotation===TAt.angle270&&(t.translateTransform(t._size[0],t._size[1]),t.rotateTransform(270)),e={x:o.bounds.x,y:o.bounds.y,width:i._size[0],height:i._size[1]},t.drawTemplate(i,e),t.restore()),o._dictionary._updated=!1):this._addAppearance(o._dictionary,i,"N"))},iTt.prototype._createAppearance=function(e,t){void 0===t&&(t=!1);var i,n,o,r=e.bounds,s=new _It([0,0,r.width,r.height],this._crossReference),a=new mDt,r=!(a.bounds=[0,0,r.width,r.height]),l=!1,h=e.backColor,d=(h&&(a.backBrush=new fIt(h)),a.foreBrush=new fIt(e.color),e.border);if(e.borderColor&&(a.borderPen=new yIt(e.borderColor,d.width)),a.borderWidth=d.width,a.borderStyle=d.style,h&&(h=[h[0]-64,h[1]-64,h[2]-64],a.shadowBrush=new fIt([0<=h[0]?h[0]:0,0<=h[1]?h[1]:0,0<=h[2]?h[2]:0])),a.rotationAngle=e.rotate,(r=null!=e&&e instanceof GEt&&e._enableGrouping?!0:r)?(i=e._mkDictionary&&e._mkDictionary&&e._mkDictionary.has("CA")?e._mkDictionary.get("CA"):"",void 0!==e.font&&null!==e.font.size&&0!==e.font.size&&(n=e.font),o=new E1t(e.textAlignment,T1t.middle)):void 0!==this._font&&null!==this._font||(this._font=this._defaultFont),this._isLoaded&&e instanceof GEt&&null!=e&&e._defaultAppearance){var p,c,h=e._defaultAppearance.fontName,u=(null==h&&(h="Helvetica"),e._defaultAppearance.fontSize),g=(null==u?u=this._defaultFont.size:0===u&&(l=!0),void 0),m=(this._stringFormat=new E1t,this._stringFormat.lineAlignment=T1t.middle,this._stringFormat.alignment=MAt.center,(g=null!=(c=null!=u&&h?Nkt(h,u,Jxt.regular,e):c)?c:this._defaultFont).measureString(this.text,this._stringFormat));if(l&&g&&g instanceof _xt&&this._isLoaded&&!e._dictionary.has("AP")){for(var f=e.bounds.width-8*d.width,y=e.bounds.height-8*d.width;m[0]<f||m[1]<y;)if((m=(g=new _xt((p=g).fontFamily,g._size+1)).measureString(this.text,this._stringFormat))[0]>f||m[1]>y){g=p;break}this._font=g}}return r?t?this._drawPressedButton(s.graphics,a,i,n,o):this._drawButton(s.graphics,a,i,n,o):t?this._drawPressedButton(s.graphics,a,this.text,this._font,this._stringFormat):this._drawButton(s.graphics,a,this.text,this._font,this._stringFormat),s},iTt.prototype._drawButton=function(e,t,i,n,o){this._drawRectangularControl(e,t);var r,s,a,l=t.bounds;e._page&&void 0!==e._page.rotation&&e._page.rotation!==TAt.angle0||0<t.rotationAngle?(r=e.save(),void 0!==t.pageRotationAngle&&t.pageRotationAngle!==TAt.angle0&&(t.pageRotationAngle===TAt.angle90?(e.translateTransform(e._size[1],0),e.rotateTransform(90),a=e._size[1]-(l[0]+l[2]),l=[l[1],a,l[3],l[2]]):t.pageRotationAngle===TAt.angle180?(e.translateTransform(e._size[0],e._size[1]),e.rotateTransform(-180),l=[e._size[0]-(l[0]+l[2]),a=e._size[1]-(l[1]+l[3]),l[2],l[3]]):t.pageRotationAngle===TAt.angle270&&(e.translateTransform(0,e._size[0]),e.rotateTransform(270),l=[e._size[0]-(l[1]+l[3]),a=l[0],l[3],l[2]])),t.rotationAngle&&(90===t.rotationAngle?t.pageRotationAngle===TAt.angle90?(e.translateTransform(0,e._size[1]),e.rotateTransform(-90),l=[e._size[1]-(l[1]+l[3]),a=l[0],l[3],l[2]]):l[2]>l[3]?(e.translateTransform(0,e._size[1]),e.rotateTransform(-90),l=[t.bounds[0],t.bounds[1],t.bounds[2],t.bounds[3]]):(s=l[0],l[0]=-(l[1]+l[3]),l[1]=s,s=l[3],l[3]=l[2]>n._metrics._getHeight()?l[2]:n._metrics._getHeight(),l[2]=s,e.rotateTransform(-90)):270===t.rotationAngle?(e.translateTransform(e._size[0],0),e.rotateTransform(-270),l=[l[1],a=e._size[0]-(l[0]+l[2]),l[3],l[2]]):180===t.rotationAngle&&(e.translateTransform(e._size[0],e._size[1]),e.rotateTransform(-180),l=[e._size[0]-(l[0]+l[2]),a=e._size[1]-(l[1]+l[3]),l[2],l[3]])),e.drawString(i,n,l,null,t.foreBrush,o),e.restore(r)):e.drawString(i,n,l,null,t.foreBrush,o)},iTt.prototype._drawPressedButton=function(e,t,i,n,o){t.borderStyle===xAt.inset?e.drawRectangle(t.bounds[0],t.bounds[1],t.bounds[2],t.bounds[3],t.shadowBrush):e.drawRectangle(t.bounds[0],t.bounds[1],t.bounds[2],t.bounds[3],t.backBrush),this._drawBorder(e,t.bounds,t.borderPen,t.borderStyle,t.borderWidth);var r=[t.borderWidth,t.borderWidth,t.bounds[2]-t.borderWidth,t.bounds[3]-t.borderWidth];switch(e.drawString(i,n,r,null,t.foreBrush,o),t.borderStyle){case xAt.inset:this._drawLeftTopShadow(e,t.bounds,t.borderWidth,this._grayBrush),this._drawRightBottomShadow(e,t.bounds,t.borderWidth,this._silverBrush);break;case xAt.beveled:this._drawLeftTopShadow(e,t.bounds,t.borderWidth,t.shadowBrush),this._drawRightBottomShadow(e,t.bounds,t.borderWidth,this._whiteBrush);break;default:this._drawLeftTopShadow(e,t.bounds,t.borderWidth,t.shadowBrush)}};var eTt,tTt=iTt;function iTt(e,t,i){var n=eTt.call(this)||this;return e&&t&&i&&n._initialize(e,t,i),n}Wo(rTt,nTt=XIt),rTt._load=function(e,t,i,n){var o=new rTt;return o._isLoaded=!0,o._form=e,o._dictionary=t,o._crossReference=i,o._ref=n,o._defaultIndex=0,o._parsedItems=new Map,o._dictionary.has("Kids")?o._kids=o._dictionary.get("Kids"):((e=KEt._load(t,i,o))._isLoaded=!0,e._ref=n,o._parsedItems.set(0,e)),o},rTt.prototype.itemAt=function(e){if(e<0||0!==e&&e>=this._kidsCount)throw Error("Index out of range.");var t,i,n;return this._parsedItems.has(e)?t=this._parsedItems.get(e):(i=void 0,0<=e&&this._kids&&0<this._kids.length&&e<this._kids.length&&(i=(n=this._kids[Number.parseInt(e.toString(),10)])&&n instanceof aPt?this._crossReference._fetch(n):i)&&((t=KEt._load(i,this._crossReference,this))._isLoaded=!0,t._ref=n,this._parsedItems.set(e,t))),t},Object.defineProperty(rTt.prototype,"font",{get:function(){var e;return this._font||(e=this.itemAt(this._defaultIndex),this._font=Rkt(this._form,e,this)),this._font},set:function(e){e&&e instanceof Oxt&&(this._font=e,this._initializeFont(e))},enumerable:!0,configurable:!0}),Object.defineProperty(rTt.prototype,"checked",{get:function(){return 0<this._kidsCount?this.itemAt(this._defaultIndex).checked:$Mt(this._dictionary)},set:function(e){this.checked!==e&&(0<this._kidsCount&&(this.itemAt(this._defaultIndex).checked=e),e?this._isLoaded?(e=ekt((0<this._kidsCount?this.itemAt(this._defaultIndex):this)._dictionary),this._dictionary.update("V",k.get(e)),this._dictionary.update("AS",k.get(e))):(this._dictionary.update("V",k.get("Yes")),this._dictionary.update("AS",k.get("Yes"))):(this._dictionary.has("V")&&delete this._dictionary._map.V,this._dictionary.has("AS")&&delete this._dictionary._map.AS),this._dictionary._updated=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(rTt.prototype,"textAlignment",{get:function(){return this._getTextAlignment()},set:function(e){this._textAlignment!==e&&this._setTextAlignment(e)},enumerable:!0,configurable:!0}),Object.defineProperty(rTt.prototype,"backColor",{get:function(){return this._parseBackColor(!0)},set:function(e){this._updateBackColor(e,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(rTt.prototype,"borderColor",{get:function(){return this._parseBorderColor(!0)},set:function(e){this._updateBorderColor(e,!0),this._isLoaded&&(this._setAppearance=!0)},enumerable:!0,configurable:!0}),rTt.prototype._initialize=function(e,t,i){this._crossReference=e._crossReference,this._page=e,this._name=t,this._defaultIndex=0,this._dictionary=new mPt(this._crossReference),this._ref=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(this._ref,this._dictionary),this._dictionary.objId=this._ref.toString(),this._dictionary.update("FT",k.get("Btn")),this._dictionary.update("T",t),this._createItem(i)},rTt.prototype._createItem=function(e){var t=new KEt;t._create(this._page,e,this),t.textAlignment=MAt.center,this._stringFormat=new E1t(t.textAlignment,T1t.middle),t._dictionary.update("MK",new mPt(this._crossReference)),t._mkDictionary.update("BC",[0,0,0]),t._mkDictionary.update("BG",[1,1,1]),t.style=LAt.check,t._dictionary.update("DA","/TiRo 0 Tf 0 0 0 rg"),this._addToKid(t)},rTt.prototype._doPostProcess=function(e){void 0===e&&(e=!1);var t=this._kidsCount;if(this._isLoaded){if(e||this._setAppearance||this._dictionary._updated||this._isImport)if(0<t)for(s=0;s<t;s++)(n=this.itemAt(s))&&(this._checkFieldFlag(n._dictionary)||(e?(r=void 0,o=n.checked?YAt.checked:YAt.unchecked,r=this._setAppearance||this._form._setAppearance||!n._dictionary.has("AP")?this._createAppearance(n,o):tkt(o,n),this._drawTemplate(r,n._getPage(),n.bounds)):!this._setAppearance&&!this._form._setAppearance&&n._isLoaded||(n._postProcess(n.checked?"Yes":"Off"),this._drawAppearance(n))),n._dictionary._updated=!e);else{var i=this.checked?YAt.checked:YAt.unchecked;this._drawTemplate(tkt(i,this),this.page,this.bounds)}}else for(var n,o,r,s=0;s<t;s++)(n=this.itemAt(s))&&(o=n.checked?YAt.checked:YAt.unchecked,n._postProcess(n.checked?"Yes":"Off"),e?(r=this._createAppearance(n,o),this._drawTemplate(r,n._getPage(),n.bounds)):this._drawAppearance(n),n._dictionary._updated=!e);this._dictionary._updated=!e},rTt.prototype._createAppearance=function(e,t){var i=e.bounds,n=new mDt,i=(n.bounds=[0,0,i.width,i.height],e.backColor),o=(i&&(n.backBrush=new fIt(i)),n.foreBrush=new fIt(e.color),e.border),i=(e.borderColor&&(n.borderPen=new yIt(e.borderColor,o.width)),n.borderWidth=o.width,n.borderStyle=o.style,i&&(o=[i[0]-64,i[1]-64,i[2]-64],n.shadowBrush=new fIt([0<=o[0]?o[0]:0,0<=o[1]?o[1]:0,0<=o[2]?o[2]:0])),n.rotationAngle=e.rotate,new _It(n.bounds,this._crossReference)),o=i.graphics;return e._styleText?this._drawCheckBox(o,n,e._styleText,t):this._drawCheckBox(o,n,okt(e._style),t),i},rTt.prototype._drawAppearance=function(e,t){var i=new mPt,n=(e._dictionary.has("AP")?((i=e._dictionary.get("AP"))&&(i.has("N")&&Tkt(i.get("N"),this._crossReference,"Yes","Off"),i.has("D"))&&Tkt(i.get("D"),this._crossReference,"Yes","Off"),xkt(i,this._crossReference,"N"),xkt(i,this._crossReference,"D")):(n=this._crossReference._getNextReference(),i=new mPt(this._crossReference),this._crossReference._cacheMap.set(n,i),e._dictionary.update("AP",n)),this._createAppearance(e,YAt.checked)),o=this._crossReference._getNextReference(),n=(this._crossReference._cacheMap.set(o,n._content),this._createAppearance(e,YAt.unchecked)),r=this._crossReference._getNextReference(),n=(this._crossReference._cacheMap.set(r,n._content),new mPt(this._crossReference)),o=(null!=t?n.update(t,o):n.update("Yes",o),n.update("Off",r),this._crossReference._getNextReference()),r=(this._crossReference._cacheMap.set(o,n),i.update("N",o),this._createAppearance(e,YAt.pressedChecked)),n=this._crossReference._getNextReference(),o=(this._crossReference._cacheMap.set(n,r._content),this._createAppearance(e,YAt.pressedUnchecked)),r=this._crossReference._getNextReference(),o=(this._crossReference._cacheMap.set(r,o._content),new mPt(this._crossReference)),t=(null!=t?o.update(t,n):o.update("Yes",n),o.update("Off",r),this._crossReference._getNextReference());this._crossReference._cacheMap.set(t,o),i.update("D",t),e._dictionary._updated=!0};var nTt,oTt=rTt;function rTt(e,t,i){var n=nTt.call(this)||this;return i&&e&&t&&n._initialize(i,e,t),n}Wo(lTt,sTt=XIt),lTt._load=function(e,t,i,n){var o=new lTt;return o._isLoaded=!0,o._form=e,o._dictionary=t,o._crossReference=i,o._ref=n,o._dictionary.has("Kids")&&(o._kids=o._dictionary.get("Kids")),o._defaultIndex=0,o._parsedItems=new Map,0<o._kidsCount&&o._retrieveOptionValue(),o},Object.defineProperty(lTt.prototype,"checked",{get:function(){var e=!1;return e=0<this._kidsCount?this.itemAt(this._defaultIndex).checked:e},enumerable:!0,configurable:!0}),Object.defineProperty(lTt.prototype,"selectedIndex",{get:function(){return this._isLoaded&&-1===this._selectedIndex&&(this._selectedIndex=this._obtainSelectedIndex()),this._selectedIndex},set:function(e){if(this.selectedIndex!==e){this._selectedIndex=e;for(var t=0;t<this._kidsCount;t++){var i,n=this.itemAt(t);t===e?(n._dictionary.update("AS",k.get(n.value)),i=k.get(n.value),this._dictionary.update("V",i),this._dictionary.update("DV",i)):n._dictionary.update("AS",k.get("Off"))}}},enumerable:!0,configurable:!0}),Object.defineProperty(lTt.prototype,"borderColor",{get:function(){return this._parseBorderColor(!this._isLoaded)},set:function(e){this._updateBorderColor(e,!0)},enumerable:!0,configurable:!0}),lTt.prototype.itemAt=function(e){if(e<0||0!==e&&e>=this._kidsCount)throw Error("Index out of range.");var t,i,n;return this._parsedItems.has(e)?t=this._parsedItems.get(e):(i=void 0,0<=e&&this._kids&&0<this._kids.length&&e<this._kids.length&&(i=(n=this._kids[Number.parseInt(e.toString(),10)])&&n instanceof aPt?this._crossReference._fetch(n):i)&&((t=$Et._load(i,this._crossReference,this))._ref=n,t._index=e,this._parsedItems.set(e,t))),t},lTt.prototype.add=function(e,t){return e instanceof $Et?(e._field=this,e._dictionary.update("Parent",this._ref),e._setField(this),this._kidsCount):new $Et(e,t,this)},lTt.prototype.removeItemAt=function(i){var n,e,t=this.itemAt(i);t&&t._ref&&((e=t._getPage())&&e._removeAnnotation(t._ref),this._kids.splice(i,1),this._dictionary.set("Kids",this._kids),this._dictionary._updated=!0,this._parsedItems.delete(i),0<this._parsedItems.size&&(n=new Map,this._parsedItems.forEach(function(e,t){i<t?n.set(t-1,e):n.set(t,e)}),this._parsedItems=n),this._dictionary.has("Opt"))&&(e=this._dictionary.getArray("Opt"))&&0<e.length&&(e.splice(i,1),this._dictionary.set("Opt",e))},lTt.prototype.removeItem=function(e){e&&e._ref&&-1!==(e=this._kids.indexOf(e._ref))&&this.removeItemAt(e)},lTt.prototype._initialize=function(e,t){this._defaultIndex=0,this._crossReference=e._crossReference,this._page=e,this._name=t,this._dictionary=new mPt(this._crossReference),this._ref=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(this._ref,this._dictionary),this._dictionary.objId=this._ref.toString(),this._dictionary.update("FT",k.get("Btn")),this._dictionary.update("T",t),this._parsedItems=new Map,this._fieldFlags|=qAt.radio},lTt.prototype._retrieveOptionValue=function(){if(this._dictionary.has("Opt")){var e=this._dictionary.getArray("Opt");if(e&&0<e.length)for(var t=this._kidsCount,i=e.length<=t?e.length:t,n=0;n<i;n++)e[Number.parseInt(n.toString(),10)]&&(this.itemAt(n)._optionValue=e[Number.parseInt(n.toString(),10)])}},lTt.prototype._obtainSelectedIndex=function(){for(var e=-1,t=0;t<this._kidsCount;++t){var i=this.itemAt(t);if(i){var n=PMt(i._dictionary,"V",!1,!0,"Parent");if(n&&i._dictionary.has("AS")){var o=i._dictionary.get("AS");if(o&&"off"!==o.name.toLowerCase())if(n instanceof k&&"off"!==n.name.toLowerCase()){if(o.name===n.name||i._optionValue===n.name){e=t;break}}else if("string"==typeof n&&"off"!==n.toLowerCase()&&(o.name===n||i._optionValue===n)){e=t;break}}}}return e},lTt.prototype._doPostProcess=function(e){void 0===e&&(e=!1);var t=this._kidsCount;if(this._isLoaded)if(0<t)for(var i=0;i<t;i++)(r=this.itemAt(i))&&!this._checkFieldFlag(r._dictionary)&&(e?(o=void 0,s=this.selectedIndex===i?YAt.checked:YAt.unchecked,o=this._setAppearance||this._form._setAppearance||!r._dictionary.has("AP")?this._createAppearance(r,s):tkt(s,r),this._drawTemplate(o,r._getPage(),r.bounds)):!this._setAppearance&&!this._form._setAppearance&&r._isLoaded||(r._postProcess(this.selectedIndex===i?r.value:"Off"),this._drawAppearance(r)),r._dictionary._updated=!e);else{var n=-1!==this.selectedIndex?YAt.checked:YAt.unchecked;this._drawTemplate(tkt(n,this),this.page,this.bounds)}else for(i=0;i<t;i++){var o,r=this.itemAt(i),s=this.selectedIndex===i?YAt.checked:YAt.unchecked;this._isDuplicatePage||r._dictionary.update("AS",k.get(this.selectedIndex===i?r.value:"Off")),e?(o=this._createAppearance(r,s),this._drawTemplate(o,r._getPage(),r.bounds)):this._isDuplicatePage||(r._postProcess(this.selectedIndex===i?r.value:"Off"),this._drawAppearance(r)),r._dictionary._updated=!e}this._dictionary._updated=!e},lTt.prototype._createAppearance=function(e,t){var i=e.bounds,n=new mDt,i=(n.bounds=[0,0,i.width,i.height],e.backColor),o=(i&&(n.backBrush=new fIt(i)),n.foreBrush=new fIt(e.color),e.border),i=(e.borderColor&&(n.borderPen=new yIt(e.borderColor,o.width)),n.borderWidth=o.width,n.borderStyle=o.style,i&&(o=[i[0]-64,i[1]-64,i[2]-64],n.shadowBrush=new fIt([0<=o[0]?o[0]:0,0<=o[1]?o[1]:0,0<=o[2]?o[2]:0])),n.rotationAngle=e.rotate,new _It(n.bounds,this._crossReference)),o=i.graphics;return e._styleText?this._drawRadioButton(o,n,e._styleText,t):this._drawRadioButton(o,n,okt(e.style),t),i},lTt.prototype._drawAppearance=function(e){var t=new mPt,i=(e._dictionary.has("AP")?((t=e._dictionary.get("AP"))&&(t.has("N")&&Tkt(t.get("N"),this._crossReference,e.value,"Off"),t.has("D"))&&Tkt(t.get("D"),this._crossReference,e.value,"Off"),xkt(t,this._crossReference,"N"),xkt(t,this._crossReference,"D")):(i=this._crossReference._getNextReference(),t=new mPt(this._crossReference),this._crossReference._cacheMap.set(i,t),e._dictionary.update("AP",i)),this._createAppearance(e,YAt.checked)),n=this._crossReference._getNextReference(),i=(this._crossReference._cacheMap.set(n,i._content),this._createAppearance(e,YAt.unchecked)),o=this._crossReference._getNextReference(),i=(this._crossReference._cacheMap.set(o,i._content),new mPt(this._crossReference)),r=e.value,n=(!r&&e._enableGrouping&&(r="check"+e._index),i.update(r,n),i.update("Off",o),this._crossReference._getNextReference()),o=(this._crossReference._cacheMap.set(n,i),t.update("N",n),this._createAppearance(e,YAt.pressedChecked)),i=this._crossReference._getNextReference(),n=(this._crossReference._cacheMap.set(i,o._content),this._createAppearance(e,YAt.pressedUnchecked)),o=this._crossReference._getNextReference(),n=(this._crossReference._cacheMap.set(o,n._content),new mPt(this._crossReference)),r=(n.update(r,i),n.update("Off",o),this._crossReference._getNextReference());this._crossReference._cacheMap.set(r,n),t.update("D",r),e._dictionary._updated=!0};var sTt,aTt=lTt;function lTt(e,t){var i=sTt.call(this)||this;return i._selectedIndex=-1,e&&t&&i._initialize(e,t),i}Wo(pTt,hTt=XIt),Object.defineProperty(pTt.prototype,"itemsCount",{get:function(){return this._options.length},enumerable:!0,configurable:!0}),Object.defineProperty(pTt.prototype,"bounds",{get:function(){var e,t=this.itemAt(this._defaultIndex);return t&&(t._page=this.page),t&&t.bounds?e=t.bounds:this._dictionary.has("Rect")&&(e=FMt(this._dictionary,this.page)),e||this._bounds||e},set:function(e){if(0===e.x&&0===e.y&&0===e.width&&0===e.height)throw new Error("Cannot set empty bounds");var t=this.itemAt(this._defaultIndex);this._isLoaded?void 0===t||this._dictionary.has("Rect")?this._dictionary.update("Rect",OMt([e.x,e.y,e.width,e.height],this.page)):(t._page=this.page,t.bounds=e):t?(t._page=this.page,t.bounds=e):this._bounds=e},enumerable:!0,configurable:!0}),Object.defineProperty(pTt.prototype,"selectedIndex",{get:function(){var e=this._dictionary.get("I");return void 0===e?[]:1===e.length?e[0]:e},set:function(e){var t,i=this,n=this._options.length;"number"==typeof e?(this._checkIndex(e,n),this._dictionary.update("I",[e]),this._dictionary.update("V",[this._options[Number.parseInt(e.toString(),10)][0]])):(t=[],e.forEach(function(e){i._checkIndex(e,n),t.push(i._options[Number.parseInt(e.toString(),10)][0])}),this._dictionary.update("I",e),this._dictionary.update("V",t))},enumerable:!0,configurable:!0}),Object.defineProperty(pTt.prototype,"selectedValue",{get:function(){var e,t=this,i=[];return this._dictionary&&this._dictionary.has("V")&&void 0!==(e=this._dictionary.getArray("V"))&&(Array.isArray(e)?e.forEach(function(e){i.push(e)}):"string"==typeof e&&i.push(e)),0===i.length&&this._dictionary&&this._dictionary.has("I")&&(e=this._dictionary.get("I"))&&0<e.length&&e.forEach(function(e){i.push(t._options[Number.parseInt(e.toString(),10)][0])}),1===i.length?i[0]:i},set:function(e){var t,i,n,o=this;"string"==typeof e?-1!==(t=this._tryGetIndex(e))&&(this._dictionary.update("I",[t]),this._dictionary.update("V",[e])):(i=[],n=[],e.forEach(function(e){var t=o._tryGetIndex(e);-1!==t&&(n.push(t),i.push(e))}),0<i.length&&(this._dictionary.update("I",n),this._dictionary.update("V",i)))},enumerable:!0,configurable:!0}),Object.defineProperty(pTt.prototype,"multiSelect",{get:function(){return this._isLoaded?0!=(this._fieldFlags&qAt.multiSelect):this._multiSelect},set:function(e){this.multiSelect!==e&&((this._multiSelect=e)?this._fieldFlags|=qAt.multiSelect:this._fieldFlags&=~qAt.multiSelect)},enumerable:!0,configurable:!0}),Object.defineProperty(pTt.prototype,"editable",{get:function(){return this._isLoaded?0!=(this._fieldFlags&qAt.edit):this._editable},set:function(e){this._editable!==e&&((this._editable=e)?this._fieldFlags|=qAt.edit:this._fieldFlags&=~qAt.edit)},enumerable:!0,configurable:!0}),Object.defineProperty(pTt.prototype,"font",{get:function(){var e;return this._font||(e=this.itemAt(this._defaultIndex),this._font=Rkt(this._form,e,this)),this._font},set:function(e){e&&e instanceof Oxt&&(this._font=e,this._initializeFont(e))},enumerable:!0,configurable:!0}),Object.defineProperty(pTt.prototype,"textAlignment",{get:function(){return this._getTextAlignment()},set:function(e){this._textAlignment!==e&&this._setTextAlignment(e)},enumerable:!0,configurable:!0}),Object.defineProperty(pTt.prototype,"backColor",{get:function(){return this._parseBackColor(!0)},set:function(e){this._updateBackColor(e,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(pTt.prototype,"_options",{get:function(){return this._optionArray||(this._dictionary&&this._dictionary.has("Opt")?this._optionArray=this._dictionary.getArray("Opt"):(this._optionArray=[],this._dictionary.update("Opt",this._optionArray))),this._optionArray},enumerable:!0,configurable:!0}),pTt.prototype.itemAt=function(e){var t,i,n;return e<this._kidsCount?this._parsedItems.has(e)?t=this._parsedItems.get(e):(i=void 0,(i=(n=this._kids[Number.parseInt(e.toString(),10)])&&n instanceof aPt?this._crossReference._fetch(n):i)&&((t=iDt._load(i,this._crossReference,this))._index=e,t._ref=n,this._options&&0<this._options.length&&e<this._options.length?t._text=this._options[Number.parseInt(e.toString(),10)][1]:t._text="",this._parsedItems.set(e,t))):this._parsedItems.has(e)?t=this._parsedItems.get(e):0<this._kidsCount&&this._kids&&0<this._kids.length&&(n=i=void 0,i=(n=1===this._kidsCount?this._kids[0]:this._kids[Number.parseInt(e.toString(),10)])&&n instanceof aPt?this._crossReference._fetch(n):i)&&((t=iDt._load(i,this._crossReference,this))._index=e,t._ref=n,this._options&&0<this._options.length&&e<this._options.length?t._text=this._options[Number.parseInt(e.toString(),10)][1]:t._text="",this._parsedItems.set(e,t)),t},pTt.prototype.addItem=function(e){return this._addToOptions(e,this),this._listValues.length-1},pTt.prototype.removeItemAt=function(i){var n,e=this.itemAt(i);e&&e._ref&&(this._parsedItems.delete(i),0<this._parsedItems.size&&(n=new Map,this._parsedItems.forEach(function(e,t){i<t?n.set(t-1,e):n.set(t,e)}),this._parsedItems=n),this._dictionary)&&this._dictionary.has("Opt")&&(e=this._options)&&0<e.length&&(e.splice(i,1),this._dictionary.set("Opt",e),this._optionArray=e,this._dictionary._updated=!0)},pTt.prototype.removeItem=function(e){if(e&&e.text){for(var t=void 0,i=0;i<this.itemsCount;i++){var n=this.itemAt(i);if(n&&e===n&&n.text===e.text){t=i;break}}-1!==t&&this.removeItemAt(t)}},pTt.prototype._initialize=function(e,t,i){this._defaultIndex=0,this._crossReference=e._crossReference,this._page=e,this._name=t,this._dictionary=new mPt(this._crossReference),this._ref=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(this._ref,this._dictionary),this._dictionary.objId=this._ref.toString(),this._dictionary.update("FT",k.get("Ch")),this._dictionary.update("T",t),this._parsedItems=new Map,this._listValues=[],this._kids=[],this.bounds=i,this._addEmptyWidget()},pTt.prototype._obtainFont=function(e){var t="",i=1;if(e&&(e._dictionary.has("DS")||e._dictionary.has("DA"))){if(e._dictionary.has("DS"))for(var n=e._dictionary.get("DS").split(";"),o=0;o<n.length;o++){var r=n[Number.parseInt(o.toString(),10)].split(":");if(-1!==n[Number.parseInt(o.toString(),10)].indexOf("font-family"))t=r[1];else if(-1!==n[Number.parseInt(o.toString(),10)].indexOf("font-size"))r[1].endsWith("pt")&&(i=Number.parseFloat(r[1].replace("pt","")));else if(-1===n[Number.parseInt(o.toString(),10)].indexOf("font-style")&&-1!==n[Number.parseInt(o.toString(),10)].indexOf("font")){for(var s=r[1].split(" "),a=0;a<s.length;a++)""===s[Number.parseInt(a.toString(),10)]||s[Number.parseInt(a.toString(),10)].endsWith("pt")||(t+=s[Number.parseInt(a.toString(),10)]+" "),s[Number.parseInt(a.toString(),10)].endsWith("pt")&&(i=Number.parseFloat(s[Number.parseInt(a.toString(),10)].replace("pt","")));for(;" "!==t&&t.endsWith(" ");)t=t.substring(0,t.length-2);-1!==t.indexOf(",")&&(t=t.split(",")[0])}}else{e=e._dictionary.get("DA");if(e&&""!==e&&-1!==e.indexOf("Tf")){for(var l=e.split(" "),o=0;o<l.length;o++)if(-1!==l[Number.parseInt(o.toString(),10)].indexOf("Tf")){for(t=l[o-2];""!==t&&1<t.length&&"/"===t[0];)t=t.substring(1);i=Number.parseFloat(l[o-1])}var h,e=0;0===i&&null!==(h=new _xt(Zxt.helvetica,e))&&(e=this._getFontHeight(h._fontFamily),!Number.isNaN(e)&&0!==e||(e=12),i=h._size=e)}}switch(t=t.trim()){case"Helv":this._font=new _xt(Zxt.helvetica,i,Jxt.regular);break;case"Courier":case"Cour":this._font=new _xt(Zxt.courier,i,Jxt.regular);break;case"Symb":this._font=new _xt(Zxt.symbol,i,Jxt.regular);break;case"TiRo":this._font=new _xt(Zxt.timesRoman,i,Jxt.regular);break;case"ZaDb":this._font=new _xt(Zxt.zapfDingbats,i,Jxt.regular);break;default:this._font=new _xt(Zxt.helvetica,i,Jxt.regular)}}return this._font},pTt.prototype._obtainSelectedValue=function(){var e,t,i=this,n=[];return this._dictionary.has("V")?(t=this._dictionary.get("V"),e=this._dictionary.getArray("V"),null!=t&&("string"==typeof t?n.push(t):Array.isArray(t)&&e.forEach(function(e){n.push(e)}))):null!=(t=this._dictionary.get("I"))&&0<t.length&&-1<t[0]&&this._options&&0<this._options.length&&t.forEach(function(e){n.push(i._options[Number.parseInt(e.toString(),10)][0])}),n},pTt.prototype._doPostProcess=function(e){if((e=void 0===e?!1:e)||this._setAppearance||this._form._setAppearance){var t=this._kidsCount;if(this._kids&&0<this._kids.length)if(1<t)for(var i=0;i<t;i++)(o=this.itemAt(i))&&!this._checkFieldFlag(o._dictionary)&&(r=this._createAppearance(o),e?(n=o._getPage())&&this._drawTemplate(r,n,o.bounds):this._addAppearance(o._dictionary,r,"N"),o._dictionary._updated=!e);else{var n,o=this.itemAt(0),r=this._createAppearance();e?(n=this.page)&&this._drawTemplate(r,n,this.bounds):this._addAppearance(o._dictionary,r,"N"),o._dictionary._updated=!e}else this._dictionary&&(r=this._createAppearance(),e?(n=this.page)&&this._drawTemplate(r,n,this.bounds):this._addAppearance(this._dictionary,r,"N"));this._dictionary._updated=!e}},pTt.prototype._tryGetIndex=function(e){var t=-1;if(this._options&&0<this._options.length)for(var i=0;i<this._options.length;i++)if(e===this._options[Number.parseInt(i.toString(),10)][0]){t=i;break}return t},pTt.prototype._addEmptyWidget=function(){var e=new GEt;e._create(this._page,this.bounds,this),this._addToKid(e),e._dictionary.update("MK",new mPt(this._crossReference)),e._mkDictionary.update("BC",[0,0,0]),e._mkDictionary.update("BG",[1,1,1]),e._dictionary.update("DA","/TiRo 0 Tf 0 0 0 rg")};var hTt,dTt=pTt;function pTt(){return null!==hTt&&hTt.apply(this,arguments)||this}Wo(gTt,cTt=dTt),Object.defineProperty(gTt.prototype,"_isAutoFontSize",{get:function(){var e=!1;if(this._isLoaded&&this._form){var t=this._form._dictionary;if(t&&t.has("DA"))if(o=t.get("DA")){var i=new CTt(o);if(0===i.fontSize)if(this._kids&&0<this._kids.length){t=!1;if(!(t=this._dictionary.has("DA")&&(o=this._dictionary.get("DA"))&&(i=new CTt(o))&&0<i.fontSize?!0:t))for(var n=0;n<this._kids.length;n++){var o,r,s=void 0,a=this._kids[Number.parseInt(n.toString(),10)];!(s=a&&a instanceof aPt?this._crossReference._fetch(a):s)||s.has("DA")&&(r=0)!==(r=(o=s.get("DA"))&&(i=new CTt(o))?i.fontSize:r)||(e=!0)}}else this._dictionary.has("DA")&&(r=0)!==(r=(o=this._dictionary.get("DA"))&&(i=new CTt(o))?i.fontSize:r)||(e=!0)}}return e},enumerable:!0,configurable:!0}),gTt._load=function(e,t,i,n){var o=new gTt,e=(o._isLoaded=!0,o._form=e,o._dictionary=t,o._crossReference=i,o._ref=n,o._dictionary.has("Kids")&&(o._kids=o._dictionary.get("Kids")),o._dictionary.getArray("Opt"));return null!=e&&(o._listValues=new Array(e.length)),o._defaultIndex=0,o._parsedItems=new Map,0<o._kidsCount&&o._retrieveOptionValue(),o},gTt.prototype._retrieveOptionValue=function(){if(this._dictionary.has("Opt")){var e=this._dictionary.getArray("Opt");if(e&&0<e.length)for(var t=this._kidsCount,i=e.length<=t?e.length:t,n=0;n<i;n++){var o=e[Number.parseInt(n.toString(),10)][1];o&&(this.itemAt(n)._text=o||"")}}},gTt.prototype._createAppearance=function(e){var t,i,n,o=new mDt,r=(i=(t=e?(t=e.bounds,r=e._getPage(),e._isLoaded&&r&&void 0!==r.rotation&&r.rotation!==TAt.angle0?o.bounds=this._rotateTextBox([t.x,t.y,t.width,t.height],r.size,r.rotation):o.bounds=[0,0,t.width,t.height],(r=e.backColor)&&(o.backBrush=new fIt(r)),o.foreBrush=new fIt(e.color),i=e.border,e.borderColor&&(o.borderPen=new yIt(e.borderColor,i.width)),o.borderStyle=i.style,o.borderWidth=i.width,r&&(n=[0<=(s=[r[0]-64,r[1]-64,r[2]-64])[0]?s[0]:0,0<=s[1]?s[1]:0,0<=s[2]?s[2]:0],o.shadowBrush=new fIt(n)),void 0!==e.textAlignment?e.textAlignment:MAt.left):((t=this.bounds)&&(this._isLoaded&&this.page&&void 0!==this.page.rotation&&this.page.rotation!==TAt.angle0?o.bounds=this._rotateTextBox([t.x,t.y,t.width,t.height],this.page.size,this.page.rotation):o.bounds=[0,0,t.width,t.height]),(r=this.backColor)&&(o.backBrush=new fIt(r)),o.foreBrush=new fIt(this.color),i=this.border,this.borderColor&&(o.borderPen=new yIt(this.borderColor,i.width)),o.borderStyle=i.style,o.borderWidth=i.width,r&&(n=[0<=(s=[r[0]-64,r[1]-64,r[2]-64])[0]?s[0]:0,0<=s[1]?s[1]:0,0<=s[2]?s[2]:0],o.shadowBrush=new fIt(n)),o.rotationAngle=this.rotationAngle,null!==this.rotate&&void 0!==this.rotate&&(o.rotationAngle=this.rotate),void 0!==this.textAlignment?this.textAlignment:MAt.left),this.multiSelect?T1t.top:T1t.middle),o.stringFormat=new E1t(t,i),o.required=this.required,null!==o.bounds&&void 0!==o.bounds||(o.bounds=[0,0,0,0]),new _It(o.bounds,this._crossReference)),s=r.graphics;return s._sw._clear(),this.required||(s._sw._beginMarkupSequence("Tx"),s._initializeCoordinates()),this._isLoaded?(n=void 0,null==(n=e?this._obtainFont(e):n)&&(n=this._appearanceFont),this._drawComboBox(s,o,n,o.stringFormat)):(this._font||(this._font=new _xt(Zxt.timesRoman,this._getFontHeight(Zxt.helvetica))),this._drawComboBox(s,o,this._font,o.stringFormat)),this.required||s._sw._endMarkupSequence(),r},gTt.prototype._drawComboBox=function(e,t,i,n){e._isTemplateGraphics&&t.required&&(e.save(),e._initializeCoordinates()),this._drawRectangularControl(e,t),e._isTemplateGraphics&&t.required&&(e.restore(),e.save(),e._sw._beginMarkupSequence("Tx"),e._initializeCoordinates());var o,r,s,a,l,h,d,p,c,u=this._options,g=this._dictionary.get("I"),m=-1;0<=(m=g&&0<g.length?g[0]:m)&&m<u.length&&(g=u[Number.parseInt(m.toString(),10)],u=[0,0],o=2*(m=t.borderWidth),(r=t.borderStyle===xAt.inset||t.borderStyle===xAt.beveled)?(u[0]=2*o,u[1]=2*m):(u[0]=2+o,u[1]=+m+1),s=t.foreBrush,l=(a=t.bounds)[2]-o,(d=a)[3]-=r?o:m,e.setClip(d,e1t.winding),c=void(0===t.rotationAngle&&(p=a[0]+m,r&&(p+=m,l-=o),s=new fIt([153,193,218]),e.drawRectangle(p,u[1],l,a[3],s),s=new fIt([0,0,0]))),c=g&&Array.isArray(g)?g[1]||g[0]:g)&&(g=[u[0],u[1],l-u[0],a[3]],0<t.rotationAngle?(h=e.save(),90===t.rotationAngle?(e.translateTransform(0,e._size[1]),e.rotateTransform(-90),d=[e._size[1]-(d[1]+d[3]),d[0],d[3]+d[2],d[2]]):270===t.rotationAngle?(e.translateTransform(e._size[0],0),e.rotateTransform(-270),d=[d[1],e._size[0]-(d[0]+d[2]),d[3]+d[2],d[2]]):180===t.rotationAngle&&(e.translateTransform(e._size[0],e._size[1]),e.rotateTransform(-180),d=[e._size[0]-(d[0]+d[2]),e._size[1]-(d[1]+d[3]),d[2],d[3]]),p=a[0]+m,r&&(p+=m,l-=o),s=new fIt([153,193,218]),e.drawRectangle(p,u[1],l,a[3],s),s=new fIt([0,0,0]),e.drawString(c,i,g,null,s,n),e.restore(h)):e.drawString(c,i,g,null,s,n)),e._isTemplateGraphics&&t.required&&(e._sw._endMarkupSequence(),e.restore())},gTt.prototype._getFontHeight=function(e){var t,i=this._dictionary.get("I"),n=this.border.width;if(this._isLoaded){var o=new _xt(e,12),r=new E1t(MAt.center,T1t.middle),s=this._dictionary.getArray("Opt"),a=this.bounds,l=[];if(i&&0<i.length)i.forEach(function(e){l.push(o.measureString(s[Number.parseInt(e.toString(),10)][1],[0,0],r,0,0)[0])});else if(0<s.length)for(var h=o.measureString(s[0][1],[0,0],r,0,0)[0],d=1;d<s.length;++d){var p=o.measureString(s[Number.parseInt(d.toString(),10)][1],[0,0],r,0,0)[0],h=Math.max(h,p);l.push(h)}t=0<l.length?12*(a.width-4*n)/l.sort()[l.length-1]:12}else{if(t=0,!(i&&0<i.length))return t;o=new _xt(e,12),r=new E1t(MAt.center,T1t.middle),s=this._dictionary.getArray("Opt");var c=this.selectedValue,p=o.measureString(null!==c&&"string"==typeof c?c:s[i[0]][1],[0,0],r,0,0)[0];a=this.bounds,t=p?12*(a.width-4*n)/p:12}var u=0;if(i&&0<i.length){if(12!==t){o=new _xt(e,t);var g=null!==(c=this.selectedValue)&&"string"==typeof c?c:s[i[0]][1],c=o.measureString(g);if(c[0]>a.width||c[1]>a.height)for(var p=a.width-4*n,m=a.height-4*n,d=1;d<=a.height;d++){var f=(o=new _xt(e,d)).measureString(g);if(f[0]>a.width||f[1]>m){u=d;do{var y=(o=new _xt(e,u-=.001)).getLineWidth(g,r);if(u<.248){o._size=.248;break}if(f=o.measureString(g,[0,0],r,0,0),y<p&&f[1]<m){o._size=u;break}}while(.248<u);t=u;break}}}}else 12<t&&(t=12);return t};var cTt,uTt=gTt;function gTt(e,t,i){var n=cTt.call(this)||this;return e&&t&&i&&(n._initialize(e,t,i),n._fieldFlags|=qAt.combo),n}Wo(yTt,mTt=dTt),yTt._load=function(e,t,i,n){var o=new yTt;return o._isLoaded=!0,o._form=e,o._dictionary=t,o._crossReference=i,o._ref=n,o._dictionary.has("Kids")&&(o._kids=o._dictionary.get("Kids")),o._defaultIndex=0,o._parsedItems=new Map,0<o._kidsCount&&o._retrieveOptionValue(),o},yTt.prototype._retrieveOptionValue=function(){if(this._dictionary.has("Opt")){var e=this._dictionary.getArray("Opt"),t=this._kidsCount,i=e.length<=t?e.length:t;if(this._listValues=new Array(i),e&&0<e.length){var n=this._dictionary.get("I");Array.isArray(n)&&0<n.length&&(n=n[0],this._selectedIndex=n);for(var o=0;o<i;o++){var r,s=this.itemAt(o);s&&(Kkt(n)&&null!==this._listValues&&void 0!==this._listValues?(r=e[Number.parseInt(o.toString(),10)],Array.isArray(r)?this._listValues[Number.parseInt(o.toString(),10)]=r[1]:this._listValues[Number.parseInt(o.toString(),10)]=r,o===n?(s._text=this._listValues[Number.parseInt(o.toString(),10)],this._selectedIndex=o):s._text=this._listValues[Number.parseInt(o.toString(),10)]):s._text="")}}}},yTt.prototype._createAppearance=function(e){var t,i,n,o=new mDt,r=(i=(t=e?(t=e.bounds,r=e._getPage(),e._isLoaded&&r&&void 0!==r.rotation&&r.rotation!==TAt.angle0?o.bounds=this._rotateTextBox([t.x,t.y,t.width,t.height],r.size,r.rotation):o.bounds=[0,0,t.width,t.height],(r=e.backColor)&&(o.backBrush=new fIt(r)),o.foreBrush=new fIt(e.color),i=e.border,e.borderColor&&(o.borderPen=new yIt(e.borderColor,i.width)),o.borderStyle=i.style,o.borderWidth=i.width,r&&(n=[0<=(s=[r[0]-64,r[1]-64,r[2]-64])[0]?s[0]:0,0<=s[1]?s[1]:0,0<=s[2]?s[2]:0],o.shadowBrush=new fIt(n)),e._enableGrouping&&void 0===e.rotate?o.rotationAngle=0:o.rotationAngle=e.rotate,void 0!==e.textAlignment?e.textAlignment:MAt.left):(t=this.bounds,this._isLoaded&&this.page&&void 0!==this.page.rotation&&this.page.rotation!==TAt.angle0?o.bounds=this._rotateTextBox([t.x,t.y,t.width,t.height],this.page.size,this.page.rotation):o.bounds=[0,0,t.width,t.height],(r=this.backColor)&&(o.backBrush=new fIt(r)),o.foreBrush=new fIt(this.color),i=this.border,this.borderColor&&(o.borderPen=new yIt(this.borderColor,i.width)),o.borderStyle=i.style,o.borderWidth=i.width,r&&(n=[0<=(s=[r[0]-64,r[1]-64,r[2]-64])[0]?s[0]:0,0<=s[1]?s[1]:0,0<=s[2]?s[2]:0],o.shadowBrush=new fIt(n)),o.rotationAngle=this.rotationAngle,null!==this.rotate&&void 0!==this.rotate&&(o.rotationAngle=this.rotate),void 0!==this.textAlignment?this.textAlignment:MAt.left),this.multiSelect?T1t.top:T1t.middle),o.stringFormat=new E1t(t,i),o.required=this.required,new _It(o.bounds,this._crossReference)),s=r.graphics;return s._sw._clear(),this.required||(s._sw._beginMarkupSequence("Tx"),s._initializeCoordinates()),this._isLoaded?(null!=(n=this._obtainFont(e))&&(this._isLoaded||1!==n.size)||(n=this._appearanceFont),this._drawListBox(s,o,n,o.stringFormat)):(this._font||(this._font=this._defaultItemFont),this._drawListBox(s,o,this._font,o.stringFormat)),this.required||s._sw._endMarkupSequence(),r},yTt.prototype._drawListBox=function(g,m,f,y){g._isTemplateGraphics&&m.required&&(g.save(),g._initializeCoordinates()),this._drawRectangularControl(g,m),g._isTemplateGraphics&&m.required&&(g.restore(),g.save(),g._sw._beginMarkupSequence("Tx"),g._initializeCoordinates());for(var v=this._options,b=this,e=0;e<v.length;++e)!function(t){var e,i,n=v[Number.parseInt(t.toString(),10)],o=[],r=m.borderWidth,s=2*r,a=m.borderStyle===xAt.inset||m.borderStyle===xAt.beveled,l=(a?(o.push(2*s),o.push((t+2)*r+f._metrics._getHeight()*t)):(o.push(2+s),o.push((t+1)*r+f._metrics._getHeight()*t+1)),m.foreBrush),h=m.bounds,d=h[2]-s,p=h,c=(p[3]-=a?s:r,g.setClip(p,e1t.winding),!1),u=b._dictionary.get("I"),u=(null!=u&&0<u.length&&u.forEach(function(e){c=c||e===t}),0===m.rotationAngle&&c&&(i=h[0]+r,a&&(i+=r,d-=s),l=new fIt([153,193,218]),g.drawRectangle(i,o[1],d,f._metrics._getHeight(),l),l=new fIt([0,0,0])),n[1]||n[0]),n=[o[0],o[1],d-o[0],f._metrics._getHeight()];0<m.rotationAngle?(e=g.save(),90===m.rotationAngle?(g.translateTransform(0,g._size[1]),g.rotateTransform(-90),p=[i=g._size[1]-(p[1]+p[3]),p[0],p[3]+p[2],p[2]]):270===m.rotationAngle?(g.translateTransform(g._size[0],0),g.rotateTransform(-270),p=[i=p[1],g._size[0]-(p[0]+p[2]),p[3]+p[2],p[2]]):180===m.rotationAngle&&(g.translateTransform(g._size[0],g._size[1]),g.rotateTransform(-180),p=[i=g._size[0]-(p[0]+p[2]),g._size[1]-(p[1]+p[3]),p[2],p[3]]),c&&(i=h[0]+r,a&&(i+=r,d-=s),l=new fIt([153,193,218]),g.drawRectangle(i,o[1],d,f._metrics._getHeight(),l),l=new fIt([0,0,0])),g.drawString(u,f,n,null,l,y),g.restore(e)):g.drawString(u,f,n,null,l,y)}(e);g._isTemplateGraphics&&m.required&&(g._sw._endMarkupSequence(),g.restore())},yTt.prototype._getFontHeight=function(e){var t=new _xt(e,12,Jxt.regular),i=new E1t(MAt.left,T1t.middle),e=0;if(Kkt(this._listValues)&&0<this._listValues.length){for(var n=t.measureString(this._listValues[0],[0,0],i,0,0)[0],o=1;o<this._listValues.length;++o)var r=t.measureString(this._listValues[Number.parseInt(o.toString(),10)],[0,0],i,0,0)[0],n=r<n?n:r;e=12<(e=12*(this.bounds.width-4*this.border.width)/n)?12:e}return e};var mTt,fTt=yTt;function yTt(e,t,i){var n=mTt.call(this)||this;return e&&t&&i&&n._initialize(e,t,i),n}Wo(wTt,vTt=XIt),Object.defineProperty(wTt.prototype,"isSigned",{get:function(){return this._isSigned||this._checkSigned(),this._isSigned},enumerable:!0,configurable:!0}),Object.defineProperty(wTt.prototype,"backColor",{get:function(){return this._parseBackColor(!0)},set:function(e){this._updateBackColor(e,!0)},enumerable:!0,configurable:!0}),wTt._load=function(e,t,i,n){var o=new wTt;return o._isLoaded=!0,o._form=e,o._dictionary=t,o._crossReference=i,o._ref=n,o._dictionary.has("Kids")&&(o._kids=o._dictionary.get("Kids")),o._defaultIndex=0,o._parsedItems=new Map,o},wTt.prototype._initialize=function(e,t,i){this._crossReference=e._crossReference,this._page=e,this._name=t,this._dictionary=new mPt(this._crossReference),this._ref=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(this._ref,this._dictionary),this._dictionary.objId=this._ref.toString(),this._dictionary.update("FT",k.get("Sig")),this._dictionary.update("T",t),this._defaultIndex=0,this._initializeFont(this._defaultFont),this._createItem(i)},wTt.prototype._createItem=function(e){var t=new GEt;t._create(this._page,e,this),t._dictionary.update("MK",new mPt(this._crossReference)),t._mkDictionary.update("BC",[0,0,0]),t._mkDictionary.update("BG",[1,1,1]),t._dictionary.update("DA",this._fontName+" 8 Tf 0 0 0 rg"),this._addToKid(t)},wTt.prototype._doPostProcess=function(e){void 0===e&&(e=!1);var t,i=this._setAppearance||this._form._setAppearance;if((e||i)&&0<(t=this._kidsCount))for(var n,o=0;o<t;o++)(r=this.itemAt(o))&&r._dictionary&&(i||e&&!r._dictionary.has("AP"))&&(n=this._createAppearance(r,e),this._addAppearance(r._dictionary,n,"N"));if(e)if(0<(t=this._kidsCount))for(var r,s,a=void 0,o=0;o<t;o++)(r=this.itemAt(o))&&r._dictionary&&(s=r._getPage())&&(a||0!==o||(a=this._getItemTemplate(r._dictionary)),this._flattenSignature(r._dictionary,s,r.bounds,a));else this._flattenSignature(this._dictionary,this.page,this.bounds)},wTt.prototype._createAppearance=function(e,t){var i=e.bounds,n=new _It([0,0,i.width,i.height],this._crossReference),o=(nkt(n,null),n._writeTransformation=!1,n.graphics),r=new mDt,i=(r.bounds=[0,0,i.width,i.height],e.backColor),t=(t&&i&&(r.backBrush=new fIt(i)),r.foreBrush=new fIt(e.color),e.border);return e.borderColor&&(r.borderPen=new yIt(e.borderColor,t.width)),r.borderWidth=t.width,r.borderStyle=t.style,i&&(t=[i[0]-64,i[1]-64,i[2]-64],r.shadowBrush=new fIt([0<=t[0]?t[0]:0,0<=t[1]?t[1]:0,0<=t[2]?t[2]:0])),r.rotationAngle=e.rotate,o.save(),o._initializeCoordinates(),this._drawRectangularControl(o,r),o.restore(),n},wTt.prototype._flattenSignature=function(e,t,i,n){var o,r,s,a;e.has("AP")?(e=e.get("AP"))&&e.has("N")&&(o=e.get("N"),(e=e.getRaw("N"))&&o&&(o.reference=e),o)&&(r=n||new _It(o,this._crossReference))&&t&&(a=(s=t.graphics).save(),this.isSigned&&(r._isSignature=!0),t.rotation!==TAt.angle0?s.drawTemplate(r,this._calculateTemplateBounds(i,t,r,s)):s.drawTemplate(r,i),s.restore(a)):n&&t&&(r=n,a=(s=t.graphics).save(),t.rotation!==TAt.angle0?s.drawTemplate(r,this._calculateTemplateBounds(i,t,r,s)):s.drawTemplate(r,i),s.restore(a))},wTt.prototype._calculateTemplateBounds=function(e,t,i,n){var o,r=e.x,s=e.y;return t&&(90===(o=this._obtainGraphicsRotation(n._matrix))?(n.translateTransform(i._size[1],0),n.rotateTransform(90),r=e.x,s=-(t._size[1]-e.y-e.height)):180===o?(n.translateTransform(i._size[0],i._size[1]),n.rotateTransform(180),r=-(t._size[0]-(e.x+i._size[0])),s=-(t._size[1]-e.y-i._size[1])):270===o&&(n.translateTransform(0,i._size[0]),n.rotateTransform(270),r=-(t._size[0]-e.x-e.width),s=e.y)),{x:r,y:s,width:e.width,height:e.height}},wTt.prototype._obtainGraphicsRotation=function(e){var t=Math.round(180*Math.atan2(e._matrix._elements[2],e._matrix._elements[0])/Math.PI);switch(t){case-90:t=90;break;case-180:t=180;break;case 90:t=270}return t},wTt.prototype._getItemTemplate=function(e){var t,i;return t=e&&e.has("AP")&&(e=e.get("AP"))&&e.has("N")&&(i=e.get("N"),(e=e.getRaw("N"))&&(i.reference=e),i)?new _It(i,this._crossReference):t},wTt.prototype._checkSigned=function(){var e;this._dictionary&&this._dictionary.has("V")&&null!=(e=this._dictionary.get("V"))&&0<e.size&&(this._isSigned=!0)};var vTt,bTt=wTt;function wTt(e,t,i){var n=vTt.call(this)||this;return n._isSigned=!1,e&&t&&i&&n._initialize(e,t,i),n}STt.prototype.toString=function(){var e=[Number.parseFloat((this.color[0]/255).toFixed(3)),Number.parseFloat((this.color[1]/255).toFixed(3)),Number.parseFloat((this.color[2]/255).toFixed(3))];return"/"+this.fontName+" "+this.fontSize+" Tf "+e[0].toString()+" "+e[1].toString()+" "+e[2].toString()+" rg"};var CTt=STt;function STt(e){var t,i="",n=0;if(e&&"string"==typeof e&&""!==e)for(var o=e.split(" "),r=0;r<o.length;r++)switch(o[Number.parseInt(r.toString(),10)]){case"g":t=[Number.parseFloat(o[r-1])];break;case"rg":t=[Number.parseFloat(o[r-3]),Number.parseFloat(o[r-2]),Number.parseFloat(o[r-1])];break;case"k":t=[Number.parseFloat(o[r-4]),Number.parseFloat(o[r-3]),Number.parseFloat(o[r-2]),Number.parseFloat(o[r-1])];break;case"Tf":n=Number.parseFloat(o[r-1]),(i=o[r-2].substring(1)).includes("#2C")&&i.replace("#2C",",")}this.fontName=i,this.fontSize=n,this.color=void 0!==t?VMt(t):[0,0,0]}Object.defineProperty(xTt.prototype,"normal",{get:function(){return!this._templateNormal&&this._dictionary&&this._dictionary.has("AP")&&(this._templateNormal=this._dictionary.get("N")),this._templateNormal},set:function(e){e&&(this._templateNormal=e,this._dictionary.set("N",this._templateNormal))},enumerable:!0,configurable:!0}),xTt.prototype._initialize=function(){this.normal=new _It(this._bounds,this._crossReference)};var ATt=xTt;function xTt(e,t){this._dictionary=new mPt,Kkt(t)?this._bounds=t:this._bounds=[],this._annotations=e,this._crossReference=e._crossReference,this._initialize()}ITt=function(e,t){return(ITt=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])}))(e,t)};var ITt,Met=function(e,t){function i(){this.constructor=e}ITt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},TTt=(Object.defineProperty(ETt.prototype,"author",{get:function(){var e;return void 0===this._author&&this._dictionary.has("Author")&&(e=this._dictionary.get("Author"))&&(this._author=e),void 0===this._author&&this._dictionary.has("T")&&(e=this._dictionary.get("T"))&&(this._author=e),this._author},set:function(e){var t;this._isLoaded&&"string"==typeof e&&e!==this.author&&(t=!1,this._dictionary&&this._dictionary.has("T")&&(this._dictionary.update("T",e),this._author=e,t=!0),this._dictionary&&this._dictionary.has("Author")&&(this._dictionary.update("Author",e),this._author=e,t=!0),t||(this._dictionary.update("T",e),this._author=e)),this._isLoaded||"string"!=typeof e||this._dictionary.update("T",e)},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"border",{get:function(){if(void 0===this._border){var e,t=new pDt;if(t._dictionary=this._dictionary,this._dictionary&&this._dictionary.has("Border")&&(e=this._dictionary.getArray("Border"))&&3<=e.length&&(t._hRadius=e[0],t._vRadius=e[1],t._width=e[2]),this._dictionary&&this._dictionary.has("BS"))if(e=this._dictionary.get("BS")){if(!e.has("W")||void 0===(i=e.get("W"))||Number.isNaN(i)||(t._width=i),e.has("S")){var i=e.get("S");if(i)switch(i.name){case"D":t._style=xAt.dashed;break;case"B":t._style=xAt.beveled;break;case"I":t._style=xAt.inset;break;case"U":t._style=xAt.underline;break;default:t._style=xAt.solid}}e.has("D")&&(i=e.getArray("D"))&&(t._dash=i)}this._border=t}return this._border},set:function(e){var t,i,n,o,r,s=this.border;this._isLoaded&&(void 0===e.width||s.width===e.width)||(t=e.width),this._isLoaded&&(void 0===e.hRadius||s.hRadius===e.hRadius)||(i=e.hRadius),this._isLoaded&&(void 0===e.vRadius||s.vRadius===e.vRadius)||(n=e.vRadius),this._isLoaded&&(void 0===e.style||s.style===e.style)||(o=e.style),void 0!==e.dash&&s.dash!==e.dash&&(r=e.dash),(!this._isWidget&&this._dictionary&&this._dictionary.has("Border")||t||n||i)&&(this._border._hRadius=void 0!==i?i:s.hRadius,this._border._vRadius=void 0!==n?n:s.vRadius,this._border._width=void 0!==t?t:s.width,this._dictionary.update("Border",[this._border.hRadius,this._border.vRadius,this._border.width])),(null!==this._dictionary&&this._dictionary&&this._dictionary.has("BS")||t||o||r)&&(this._border._width=void 0!==t?t:s.width,this._border._style=void 0!==o?o:s.style,this._border._dash=void 0!==r?r:s.dash,(e=this._dictionary.has("BS")?this._dictionary.get("BS"):new mPt(this._crossReference)).update("Type",k.get("Border")),e.update("W",this._border.width),e.update("S",_Mt(this._border.style)),void 0!==this._border.dash&&e.update("D",this._border.dash),this._dictionary.update("BS",e),this._dictionary._updated=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"flags",{get:function(){return void 0===this._annotFlags&&(this._annotFlags=bAt.default,this._dictionary)&&this._dictionary.has("F")&&(this._annotFlags=this._dictionary.get("F")),this._annotFlags},set:function(e){void 0!==e&&e!==this._annotFlags&&(this._annotFlags=e,this._dictionary.update("F",e))},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"color",{get:function(){return void 0===this._color&&this._dictionary.has("C")&&(this._color=VMt(this._dictionary.getArray("C"))),this._color},set:function(e){var t;void 0!==e&&3===e.length&&(t=this.color,this._isLoaded&&void 0!==t&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]||(this._color=e,this._dictionary.update("C",[Number.parseFloat((e[0]/255).toFixed(7)),Number.parseFloat((e[1]/255).toFixed(7)),Number.parseFloat((e[2]/255).toFixed(7))])))},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"innerColor",{get:function(){return void 0===this._innerColor&&this._dictionary.has("IC")&&(this._innerColor=VMt(this._dictionary.getArray("IC"))),this._innerColor},set:function(e){var t;void 0!==e&&3===e.length&&(t=this.innerColor,this._isLoaded&&void 0!==t&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]||(this._innerColor=e,this._dictionary.update("IC",[Number.parseFloat((e[0]/255).toFixed(7)),Number.parseFloat((e[1]/255).toFixed(7)),Number.parseFloat((e[2]/255).toFixed(7))])))},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"creationDate",{get:function(){var e;return void 0!==this._creationDate&&null!==this._creationDate||!this._dictionary.has("CreationDate")||null!==(e=this._dictionary.get("CreationDate"))&&"string"==typeof e&&(this._creationDate=this._stringToDate(e)),this._creationDate},set:function(e){this._creationDate=e,this._dictionary.update("CreationDate",this._dateToString(e))},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"modifiedDate",{get:function(){var e;return void 0!==this._modifiedDate&&null!==this._modifiedDate||(e=void 0,this._dictionary&&this._dictionary.has("ModDate")?e=this._dictionary.get("ModDate"):this._dictionary.has("M")&&(e=this._dictionary.get("M")),null!==e&&"string"==typeof e&&(this._modifiedDate=this._stringToDate(e))),this._modifiedDate},set:function(e){this._modifiedDate=e,this._dictionary.update("M",this._dateToString(e))},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"bounds",{get:function(){return this._isLoaded&&(this._bounds=FMt(this._dictionary,this._page)),this._bounds},set:function(e){var t,i;e&&(this._isBounds=!0,this._isLoaded?e.x===this.bounds.x&&e.y===this.bounds.y&&e.width===this.bounds.width&&e.height===this.bounds.height||(t=this._page.size)&&(i=(t=t[1]-(e.y+e.height))+e.height,this._dictionary.update("Rect",[e.x,t,e.x+e.width,i]),this._bounds=e,this._isChanged=!0):(this._bounds=e,this._isChanged=!0))},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"caption",{get:function(){var e,t;return void 0===this._caption&&((e=new oDt)._dictionary=this._dictionary,this._dictionary&&this._dictionary.has("Cap")&&(e._cap=this._dictionary.get("Cap")),this._dictionary&&this._dictionary.has("CP")&&(t=this._dictionary.get("CP"))&&(e._type="Top"===t.name?AAt.top:AAt.inline),this._dictionary&&this._dictionary.has("CO")&&(e._offset=this._dictionary.getArray("CO")),this._caption=e),this._caption},set:function(e){var t=this.caption;e&&(this._isLoaded&&e.cap===t.cap||(this._caption.cap=e.cap),this._isLoaded&&e.type===t.type||(this._caption.type=e.type),this._isLoaded&&e.offset===t.offset||(this._caption.offset=e.offset))},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"opacity",{get:function(){var e;return this._dictionary&&this._dictionary.has("CA")&&void 0!==(e=this._dictionary.get("CA"))&&(this._opacity=e),this._opacity},set:function(e){void 0===e||Number.isNaN(e)||(0<=e&&e<=1?(this._dictionary.update("CA",e),this._opacity=e):e<0?this._dictionary.update("CA",0):this._dictionary.update("CA",1))},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"subject",{get:function(){return void 0===this._subject&&(this._subject=this._dictionary.get("Subject","Subj")),this._subject},set:function(e){"string"==typeof e&&this.subject!==e&&(this._dictionary.update("Subj",e),this._subject=e,this._dictionary.has("Subject"))&&this._dictionary.update("Subject",e)},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"name",{get:function(){return void 0===this._name&&this._dictionary.has("NM")&&(this._name=this._dictionary.get("NM")),this._name},set:function(e){"string"==typeof e&&(this._dictionary.update("NM",e),this._name=e)},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"text",{get:function(){return void 0===this._text&&this._dictionary.has("Contents")&&(this._text=this._dictionary.get("Contents")),this._text},set:function(e){"string"==typeof e&&(this._text=this._dictionary.get("Contents"),e!==this._text)&&(this._dictionary.update("Contents",e),this._text=e)},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"rotationAngle",{get:function(){return void 0===this._rotate&&this._dictionary&&this._dictionary.has("Rotate")&&(this._rotate=this._dictionary.get("Rotate")/90),null!==this._rotate&&void 0!==this._rotate||(this._rotate=TAt.angle0),this._rotate},set:function(e){var t=this.rotationAngle;this._dictionary.update("Rotate",90*(e=void 0!==e&&void 0!==t?(e+t)%4:e)),this._isRotated=!0,this._rotate=e},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"rotate",{get:function(){var e=this._getRotationAngle();return e=360<=(e=e<0?360+e:e)?360-e:e},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"flattenPopups",{get:function(){return this._isFlattenPopups},set:function(e){void 0!==e&&(this._isFlattenPopups=e)},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"flatten",{get:function(){return this._flatten},set:function(e){this._flatten=e},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"_hasFlags",{get:function(){return this._dictionary.has("F")},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"_degreeToRadian",{get:function(){return void 0===this._ratio&&(this._ratio=Math.PI/180),this._ratio},enumerable:!0,configurable:!0}),Object.defineProperty(ETt.prototype,"layer",{get:function(){return this._layer||(this._layer=this._getDocumentLayer()),this._layer},set:function(e){this._layer||(this._layer=e,this._layer?this._dictionary.update("OC",this._layer._referenceHolder):delete this._dictionary._map.OC)},enumerable:!0,configurable:!0}),ETt.prototype.setAppearance=function(e){(this._setAppearance=e)&&(this._dictionary._updated=!0)},ETt.prototype.getValues=function(e){var t=[];if(!this._dictionary||!this._dictionary.has(e))throw new Error("PdfException: "+e+" is not found");var i=this._dictionary.get(e);if(Array.isArray(i))for(var i=this._dictionary.getArray(e),n=0;n<i.length;n++){var o=i[Number.parseInt(n.toString(),10)];o instanceof k?t.push(o.name):"string"==typeof o?t.push(o):"number"==typeof o&&t.push(o.toString())}else if(i instanceof k)t.push(i.name);else{if("string"!=typeof i)throw new Error("PdfException: "+e+" is not found");t.push(i)}return t},ETt.prototype.setValues=function(e,t){e&&""!==e&&t&&""!==t&&this._dictionary.update(e,t)},ETt.prototype._initialize=function(e,t){this._page=e,this._crossReference=e._crossReference,t&&(this._dictionary=t),this._isLoaded||(this._dictionary.set("P",this._page._ref),this._dictionary.assignXref(this._crossReference))},ETt.prototype._getRotationAngle=function(){var e=0;return this._dictionary&&(this._dictionary.has("Rotate")?e=this._dictionary.get("Rotate"):this._dictionary.has("Rotation")&&(e=this._dictionary.get("Rotation"))),e},ETt.prototype._getMediaOrCropBox=function(e){var t;return e&&e._pageDictionary&&e._pageDictionary.has("MediaBox")?t=e._pageDictionary.get("MediaBox"):e&&e._pageDictionary&&e._pageDictionary.has("CropBox")&&(t=e._pageDictionary.get("CropBox")),t},ETt.prototype._getBoundsValue=function(e){var t=0,i=[],n=[];if(0<(t=Kkt(e)?e.length:t)){for(var o=[],r=0;r<e.length;r++){var s=e[Number.parseInt(r.toString(),10)];o.push(s)}for(var a=0,l=0,r=0;r<o.length;r++)r%2==0?(i[Number.parseInt(a.toString(),10)]=o[Number.parseInt(r.toString(),10)],a++):(n[Number.parseInt(l.toString(),10)]=o[Number.parseInt(r.toString(),10)],l++)}return i.sort(function(e,t){return t<e?1:-1}),n.sort(function(e,t){return t<e?1:-1}),{x:i[0],y:n[0],width:i[i.length-1]-i[0],height:n[n.length-1]-n[0]}},ETt.prototype._validateTemplateMatrix=function(e,t){var i,n,o,r,s,a,l=!1,h=!0;return null==t?(e&&e.has("Matrix")?(r=e.getArray("Matrix"))&&3<r.length&&void 0!==r[0]&&void 0!==r[1]&&void 0!==r[2]&&void 0!==r[3]&&1===r[0]&&0===r[1]&&0===r[2]&&1===r[3]&&(l=!0,i=a=s=o=0,n=void(4<r.length&&(a=-r[4],5<r.length)&&(i=-r[5])),this._dictionary&&this._dictionary.has("Rect")&&(n=this._dictionary.getArray("Rect"))&&1<n.length&&(o=n[0],s=n[1]),o===a&&s===i||0!==a||0!==i||(this._locationDisplaced=!0)):l=!0,l):(n=this.bounds,e&&e.has("Matrix")&&(o=e.getArray("BBox"),r=e.getArray("Matrix"))&&o&&3<r.length&&2<o.length&&void 0!==r[0]&&void 0!==r[1]&&void 0!==r[2]&&void 0!==r[3]&&1===r[0]&&0===r[1]&&0===r[2]&&1===r[3]&&void 0!==o[0]&&void 0!==o[1]&&void 0!==o[2]&&void 0!==o[3]&&(this._page&&o[0]!==-r[4]&&o[1]!==-r[5]||0===o[0]&&0==-r[4])&&(a=(s=this._page.graphics).save(),void 0!==this.opacity&&this._opacity<1&&s.setTransparency(this._opacity),n.x-=o[0],n.y+=o[1],s.drawTemplate(t,n),s.restore(a),this._page.annotations.remove(this),h=!1),h)},ETt.prototype._flattenAnnotationTemplate=function(e,t){var i,n,o,r,s,a,l=this._page.graphics,h=this.bounds;this instanceof BTt&&this._dictionary&&!this._dictionary.has("AP")&&(h=this._isLoaded||(!(this instanceof BTt)||this.measure)&&this._setAppearance&&this.flatten&&!this.measure?this._bounds:LMt([this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height]),this._page?(o=this._page.size,n=this._page.mediaBox,(i=this._page.cropBox)&&Array.isArray(i)&&4===i.length&&this._page._pageDictionary.has("CropBox")&&!this._isLoaded&&!this._flatten?0===i[0]&&0===i[1]&&o[0]!==i[2]&&o[1]!==i[3]||h.x===i[0]?h.y=o[1]-(h.y+h.height):(h.x-=i[0],h.y=i[3]-(h.y+h.height)):n&&Array.isArray(n)&&4===n.length&&this._page._pageDictionary.has("MediaBox")&&!this._isLoaded&&!this._flatten?0<n[0]||0<n[1]||o[0]===n[2]||o[1]===n[3]?(h.x-=n[0],h.y=n[3]-(h.y+h.height)):h.y=o[1]-(h.y+h.height):this instanceof BTt&&!this.measure&&!this._isLoaded?h.y=o[1]-(h.y+h.height):this._setAppearance&&this.flatten&&!this.measure?h=this.bounds:this._isLoaded||(h.y=o[1]-(h.y+h.height))):h.y=h.y+h.height),null!=h&&(i=l.save(),this._page._needInitializeGraphics=!0,this._type===QAt.rubberStampAnnotation&&(s=!0,this._dictionary)&&this._dictionary.has("AP")&&((n=this._dictionary.get("AP"))&&n.has("N")&&(n=n.get("N"),this.rotate===TAt.angle270)&&this._page.rotation===TAt.angle270&&n.dictionary.has("Matrix")&&(a=n.dictionary.getArray("Matrix"))&&6===a.length&&0===a[4]&&0!==a[5]&&(s=!1),!t)&&this.rotate!==TAt.angle180&&s&&(e._isAnnotationTemplate=!0,e._needScale=!0),t||this._type===QAt.rubberStampAnnotation||(e._isAnnotationTemplate=!0,e._needScale=!0),void 0!==this.opacity&&this._opacity<1&&l.setTransparency(this._opacity),n=this._calculateTemplateBounds(h,this._page,e,t,l),this._type===QAt.rubberStampAnnotation&&(o=void 0,o=this.rotate===TAt.angle0?[n.width,n.height]:e._size,t=!(h=[n.x,n.y]),this.rotate!==TAt.angle0&&e._content&&e._content.dictionary.has("Matrix")&&(a=e._content.dictionary.getArray("Matrix"))&&6===a.length&&0===a[4]&&0!==a[5]&&(t=!0),a=0<e._size[0]?n.width/e._size[0]:1,r=0<e._size[1]?n.height/e._size[1]:1,s=!(Math.trunc(1e3*a)/1e3==1&&Math.trunc(1e3*r)/1e3==1),this.rotate!==TAt.angle0)&&t&&(this.rotate===TAt.angle90?this._page&&this._page.rotation===TAt.angle270?!s||0===n.x&&0===n.y?(h[0]+=o[1],h[1]+=o[0]-o[1]+(o[0]-o[1])):(h[0]+=o[0]-o[1],h[1]+=o[0]):s||(h[0]+=o[1]):this.rotate===TAt.angle270?this._page&&this._page.rotation===TAt.angle270?s&&e._isAnnotationTemplate?h[1]=n.y-n.width:s&&(h[1]+=o[0]-o[1]):s||0===n.x&&0===n.y?h[1]+=-(o[0]-o[1]):h[1]+=-o[0]:this.rotate===TAt.angle180&&(h[0]+=o[0],h[1]+=-o[1])),!e._content.dictionary.has("Matrix")&&e._content.dictionary.has("BBox")&&(a=e._content.dictionary.getArray("BBox"),n.x-=a[0],n.y+=a[1]),this instanceof $Tt&&!this._isLoaded&&(n=FMt(this._dictionary,this._page)),l.drawTemplate(e,n),l.restore(i)),this._page.annotations.remove(this)},ETt.prototype._calculateTemplateBounds=function(e,t,i,n,o){var r,s=e,a=e.x,l=e.y,h=e.width,d=e.height;return n||(r=this._dictionary.getArray("Rect"))&&(s=LMt(r)),void 0!==t&&(90===(r=this._obtainGraphicsRotation(o._matrix))?(o.translateTransform(i._size[1],0),o.rotateTransform(90),n||void 0!==this._rotate&&this._rotate===TAt.angle180?(a=e.x,l=this._locationDisplaced?t._origin&&0!==t._o[1]?e.y+e.height:-(t.size[1]-(e.height+e.y)+(e.height-i._size[1])):-(t.size[1]-e.y-e.height)):(a=e.x,l=-(t.size[1]-(e.height+e.y)+(e.width-i._size[1])),h=e.height,d=e.width)):180===r?(o.translateTransform(i._size[0],i._size[1]),o.rotateTransform(180),n?(a=-(t.size[0]-(e.x+e.width)),l=-(t.size[1]-e.y-e.height)):(a=-(t.size[0]-(e.x+i._size[0])),l=-(t.size[1]-e.y-i._size[1]),void 0===this.rotationAngle||this._rotate!==TAt.angle90&&this._rotate!==TAt.angle270||(l=-(t.size[1]-e.y-i._size[1])-(e.width-e.height),h=e.height,d=e.width))):270===r?(o.translateTransform(0,i._size[0]),o.rotateTransform(270),n||void 0!==this.rotationAngle&&this._rotate===TAt.angle180?(a=-(t.size[0]-e.x-e.width),l=e.y):(a=-(t.size[0]-s.x-i._size[0]),o=i._content.dictionary.getArray("Matrix"),t=i._content.dictionary.getArray("BBox"),l=o&&t&&o[5]!==t[2]?e.y-(e.height-e.width):e.y+e.height-e.width,h=e.height,d=e.width)):0!==r||n||void 0===this.rotationAngle||this.rotationAngle!==TAt.angle90&&this.rotationAngle!==TAt.angle270||(a=e.x,l=e.y+e.height-e.width,h=e.height,d=e.width)),{x:a,y:l,width:h,height:d}},ETt.prototype._obtainGraphicsRotation=function(e){var e=Math.atan2(e._matrix._elements[2],e._matrix._elements[0]),t=Math.round(180*e/Math.PI);switch(t){case-90:t=90;break;case-180:t=180;break;case 90:t=270}return t},ETt.prototype._removeAnnotation=function(e,t){e&&t&&(e.annotations.remove(t),e._pageDictionary._updated=!0)},ETt.prototype._drawCloudStyle=function(e,t,i,n,o,r,s){if(Kkt(r)&&this._isClockWise(r)){for(var a=[],l=r.length-1;0<=l;l--)a.push(r[Number.parseInt(l.toString(),10)]);r=a}var h,d=[],p=2*n*o;Kkt(r)?h=r[r.length-1]:r=[];for(l=0;l<r.length;l++){var c=r[Number.parseInt(l.toString(),10)],u=c[0]-h[0],g=c[1]-h[1],m=Math.sqrt(u*u+g*g);u/=m,g/=m;for(var f=0;f+.1*p<m;f+=p){var y=new fDt;y.point=[h[0]+f*u,h[1]+f*g],d.push(y)}h=c}for(var v=d[d.length-1],l=0;l<d.length;l++){var b=d[Number.parseInt(l.toString(),10)],w=this._getIntersectionDegrees(v.point,b.point,n);v.endAngle=w[0],b.startAngle=w[1],v=b}for(var C=new nIt,l=0;l<d.length;l++){var S=(E=d[Number.parseInt(l.toString(),10)]).startAngle%360,A=E.endAngle%360,x=0;0<S&&A<0?x=180-S+(180-(A<0?-A:A)):S<0&&0<A?x=A-S:0<S&&0<A?x=A<S?360-(S-A):A-S:S<0&&A<0&&(x=A<S?360-(S-A):-(S-A)),x<0&&(x=-x),E.endAngle=x,C.addArc(E.point[0]-n,E.point[1]-n,2*n,2*n,S,x)}C.closeFigure();var I=[];if(s)for(l=0;l<C._points.length;l++)I.push([C._points[Number.parseInt(l.toString(),10)][0],-C._points[Number.parseInt(l.toString(),10)][1]]);(o=new nIt)._points=s?I:C._points,o._pathTypes=C._pathTypes,Kkt(t)&&e.drawPath(o,t);for(var T=180/(3*Math.PI),C=new nIt,l=0;l<d.length;l++){var E=d[Number.parseInt(l.toString(),10)];C.addArc(E.point[0]-n,E.point[1]-n,2*n,2*n,E.startAngle,E.endAngle+T)}if(C.closeFigure(),I=[],s)for(l=0;l<C._points.length;l++)I.push([C._points[Number.parseInt(l.toString(),10)][0],-C._points[Number.parseInt(l.toString(),10)][1]]);(o=new nIt)._points=s?I:C._points,o._pathTypes=C._pathTypes,e.drawPath(o,i)},ETt.prototype._isClockWise=function(e){var t=0;if(Kkt(e))for(var i=0;i<e.length;i++){var n=e[Number.parseInt(i.toString(),10)],o=e[(i+1)%e.length];t+=(o[0]-n[0])*(o[1]+n[1])}return 0<t},ETt.prototype._getIntersectionDegrees=function(e,t,i){var n=t[0]-e[0],t=t[1]-e[1],e=.5*Math.sqrt(n*n+t*t)/i,i=(e<-1?e=-1:1<e&&(e=1),Math.atan2(t,n)),t=Math.acos(e);return[(i-t)*(180/Math.PI),(Math.PI+i+t)*(180/Math.PI)]},ETt.prototype._obtainStyle=function(e,t,i,n){var o,r=this.border.dash;if(r&&0<r.length){for(var s=[],a=!1,l=0;l<r.length;l++)s[Number.parseInt(l.toString(),10)]=r[Number.parseInt(l.toString(),10)],0<s[Number.parseInt(l.toString(),10)]&&(a=!0);a&&this.border.style===xAt.dashed&&(e._dashStyle=t1t.dash,e._dashPattern=s)}return n?n instanceof mDt?(!this._isBounds&&this._dictionary.has("RD")?(o=this._dictionary.getArray("RD"))&&(t[0]=t[0]+o[0],t[1]=t[1]+i+o[1],t[2]=t[2]-(o[0]+o[2]),t[3]=t[3]-(o[1]+o[3])):(t[0]=t[0]+i,t[1]=t[1]+i,t[2]=t[2]-this.border.width,t[3]=t[3]-this.border.width),n.bounds=t):0!==n.intensity&&n.style===IAt.cloudy?(e=5*n.intensity,t[0]=t[0]+e+i,t[1]=t[1]+e+i,t[2]=t[2]-2*e-2*i,t[3]=t[3]-2*e-2*i):(t[0]=t[0]+i,t[1]=t[1]+i,t[2]=t[2]-this.border.width,t[3]=this.bounds.height-this.border.width):!this._isBounds&&this._dictionary&&this._dictionary.has("RD")?(o=this._dictionary.getArray("RD"))&&(t[0]=t[0]+o[0],t[1]=t[1]+i+o[1],t[2]=t[2]-2*o[2],t[3]=t[3]-this.border.width,t[3]=t[3]-2*o[3]):(t[1]=t[1]+i,t[3]=this.bounds.height-this.border.width),t},ETt.prototype._createRectangleAppearance=function(e){var t=this.border.width,i=this._dictionary.getArray("RD"),i=(i||null==e||0===e.intensity||e.style!==IAt.cloudy||(o={x:this.bounds.x-5*e.intensity-t/2,y:this.bounds.y-5*e.intensity-t/2,width:this.bounds.width+10*e.intensity+t,height:this.bounds.height+10*e.intensity+t},i=[(n=5*e.intensity)+t/2,n+t/2,n+t/2,n+t/2],this._dictionary.set("RD",i),this.bounds=o),!this._isBounds&&i&&(o={x:this.bounds.x+i[0],y:this.bounds.y+i[1],width:this.bounds.width-2*i[2],height:this.bounds.height-2*i[3]},0!==e.intensity&&e.style===IAt.cloudy?(o.x=o.x-5*e.intensity-t/2,o.y=o.y-5*e.intensity-t/2,o.width=o.width+10*e.intensity+t,o.height=o.height+10*e.intensity+t,n=5*e.intensity,this._dictionary.set("RD",[n+t/2,n+t/2,n+t/2,n+t/2])):delete this._dictionary._map.RD,this.bounds=o),t/2),n=[0,0,this.bounds.width,this.bounds.height],o=new _It(n,this._crossReference),r=(nkt(o,this._getRotationAngle()),0!==e.intensity&&e.style===IAt.cloudy&&(o._writeTransformation=!1),o.graphics),s=new mDt,t=(this.innerColor&&(s.backBrush=new fIt(this._innerColor)),0<t&&this.color&&(s.borderPen=new yIt(this._color,t)),this.color&&(s.foreBrush=new fIt(this._color)),this._obtainStyle(s.borderPen,n,i,e));return void 0!==this.opacity&&this._opacity<1&&(r.save(),r.setTransparency(this._opacity)),0!==e.intensity&&e.style===IAt.cloudy?this._drawRectangleAppearance(t,r,s,e.intensity):r.drawRectangle(t[0],t[1],t[2],t[3],s.borderPen,s.backBrush),void 0!==this.opacity&&this._opacity<1&&r.restore(),o},ETt.prototype._drawRectangleAppearance=function(e,t,i,n){var o=new nIt,r=(Kkt(e)&&4===e.length&&o.addRectangle(e[0],e[1],e[2],e[3]),0);if(0<(r=Kkt(n)?4.25*n:r)){for(var s=[],a=0;a<o._points.length;a++){var l=[o._points[Number.parseInt(a.toString(),10)][0],-o._points[Number.parseInt(a.toString(),10)][1]];s.push(l)}(o=new nIt).addPolygon(s),this._drawCloudStyle(t,i.backBrush,i.borderPen,r,.833,o._points,!1)}else t.drawRectangle(e[0],e[1],e[2],e[3],i.borderPen,i.backBrush)},ETt.prototype._createCircleAppearance=function(){var e=[0,0,this.bounds.width,this.bounds.height],t=new _It(e,this._crossReference),i=(nkt(t,this._getRotationAngle()),this._dictionary.has("BE")&&(t._writeTransformation=!1),void 0===this.color&&(this._isTransparentColor=!0),t.graphics),n=this.border.width,o=new yIt(this.color,n),r=new mDt,s=(this.innerColor&&(r.backBrush=new fIt(this._innerColor)),0<n&&(r.borderPen=o),this.color&&(r.foreBrush=new fIt(this._color)),(r.borderWidth=n)/2),o=this._obtainStyle(o,e,s);return void 0!==this.opacity&&this._opacity<1&&(i.save(),i.setTransparency(this._opacity)),this._dictionary.has("BE")?this._drawCircleAppearance(o,s,i,r):i.drawEllipse(o[0]+s,o[1],o[2]-n,o[3],r.borderPen,r.backBrush),void 0!==this._opacity&&this._opacity<1&&i.restore(),t},ETt.prototype._drawCircleAppearance=function(e,t,i,n){var o=0;if(0<(o=this._dictionary.has("RD")&&(r=this._dictionary.getArray("RD"))&&0<r.length?r[0]:o)){for(var r=[e[0]+t,-e[1]-e[3],e[2]-this.border.width,e[3]],s=r[0],a=r[1],l=r[0]+r[2],h=r[1]+r[3],d=[],p=(d.push([l,h]),d.push([s,h]),d.push([s,a]),d.push([l,a]),[]),c=(p.push([l,a+r[3]/2]),p.push([s+r[2]/2,h]),p.push([s,a+r[3]/2]),p.push([s+r[2]/2,a]),[]),u=(c.push([s+r[2]/2,h]),c.push([s,a+r[3]/2]),c.push([s+r[2]/2,a]),c.push([l,a+r[3]/2]),[]),g=0;g<d.length;g++)this._createBezier(p[Number.parseInt(g.toString(),10)],d[Number.parseInt(g.toString(),10)],c[Number.parseInt(g.toString(),10)],u);this._drawCloudStyle(i,n.backBrush,n.borderPen,o,.833,u,!1)}else i.drawEllipse(e[0]+t,-e[1],e[2]-this.border.width,-e[3],n.borderPen,n.backBrush)},ETt.prototype._createBezier=function(e,t,i,n){n.push(e),this._populateBezierPoints(e,t,i,0,n),n.push(i)},ETt.prototype._populateBezierPoints=function(e,t,i,n,o){var r,s;n<2&&(r=this._midPoint(e,t),t=this._midPoint(t,i),s=this._midPoint(r,t),this._populateBezierPoints(e,r,s,++n,o),o.push(s),this._populateBezierPoints(s,t,i,n,o))},ETt.prototype._midPoint=function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]},ETt.prototype._getAngle=function(e){var t=e[0],i=e[1],n=e[2],e=e[3],o=0;return n-t==0?o=i<e?90:270:(o=Math.atan((e-i)/(n-t))*(180/Math.PI),(n-t<0||e-i<0)&&(o+=180),0<n-t&&e-i<0&&(o-=180),o<0&&(o+=360)),o},ETt.prototype._getAxisValue=function(e,t,i){return[e[0]+Math.cos(t*this._degreeToRadian)*i,e[1]+Math.sin(t*this._degreeToRadian)*i]},ETt.prototype._drawLineEndStyle=function(e,t,i,n,o,r,s,a){var l,h,d,p,c,u;switch(r){case wAt.square:t.drawRectangle(e[0]-3*s,-(e[1]+3*s),6*s,6*s,n,o);break;case wAt.circle:t.drawEllipse(e[0]-3*s,-(e[1]+3*s),6*s,6*s,n,o);break;case wAt.openArrow:c=a?30:150,l=9*s,h=this._getAxisValue(e,i,a?s:-s),d=this._getAxisValue(h,i+c,l),p=this._getAxisValue(h,i-c,l),(u=new nIt)._pen=n,u.addLine(h[0],-h[1],d[0],-d[1]),u.addLine(h[0],-h[1],p[0],-p[1]),t._stateControl(n,null,null),t._buildUpPath(u._points,u._pathTypes),t._drawGraphicsPath(n,null,u._fillMode,!1);break;case wAt.closedArrow:c=a?30:150,l=9*s,h=this._getAxisValue(e,i,a?s:-s),d=this._getAxisValue(h,i+c,l),p=this._getAxisValue(h,i-c,l),t.drawPolygon([[h[0],-h[1]],[d[0],-d[1]],[p[0],-p[1]]],n,o);break;case wAt.rOpenArrow:c=a?150:30,l=9*s,h=this._getAxisValue(e,i,a?-s:s),d=this._getAxisValue(h,i+c,l),p=this._getAxisValue(h,i-c,l),(u=new nIt)._pen=n,u.addLine(h[0],-h[1],d[0],-d[1]),u.addLine(h[0],-h[1],p[0],-p[1]),t._stateControl(n,null,null),t._buildUpPath(u._points,u._pathTypes),t._drawGraphicsPath(n,null,u._fillMode,!1);break;case wAt.rClosedArrow:c=a?150:30,l=9*s,h=this._getAxisValue(e,i,a?-s:s),d=this._getAxisValue(h,i+c,l),p=this._getAxisValue(h,i-c,l),t.drawPolygon([[h[0],-h[1]],[d[0],-d[1]],[p[0],-p[1]]],n,o);break;case wAt.slash:d=this._getAxisValue(e,i+60,l=9*s),p=this._getAxisValue(e,i-120,l),t.drawLine(n,e[0],-e[1],d[0],-d[1]),t.drawLine(n,e[0],-e[1],p[0],-p[1]);break;case wAt.diamond:d=this._getAxisValue(e,180,l=3*s),p=this._getAxisValue(e,90,l),u=this._getAxisValue(e,0,l),c=this._getAxisValue(e,-90,l),t.drawPolygon([[d[0],-d[1]],[p[0],-p[1]],[u[0],-u[1]],[c[0],-c[1]]],n,o);break;case wAt.butt:d=this._getAxisValue(e,i+90,l=3*s),p=this._getAxisValue(e,i-90,l),t.drawLine(n,d[0],-d[1],p[0],-p[1])}},ETt.prototype._drawLineStyle=function(e,t,i,n,o,r,s,a){0===a&&(a=1,o=null),this._drawLineEndStyle(e,i,n,o,r,s.begin,a,!0),this._drawLineEndStyle(t,i,n,o,r,s.end,a,!1)},ETt.prototype._obtainFontDetails=function(){var e,t="",i=Jxt.regular;if(this._dictionary.has("DS")||this._dictionary.has("DA")){var n=void 0;if(this._dictionary.has("DS"))for(var o=this._dictionary.get("DS").split(";"),r=0;r<o.length;r++){var s=o[Number.parseInt(r.toString(),10)].split(":");if(-1!==o[Number.parseInt(r.toString(),10)].indexOf("font-family"))t=s[1];else if(-1!==o[Number.parseInt(r.toString(),10)].indexOf("font-size"))s[1].endsWith("pt")&&(e=Number.parseFloat(s[1].replace("pt","")));else if(-1!==o[Number.parseInt(r.toString(),10)].indexOf("font-style")||-1!==o[Number.parseInt(r.toString(),10)].indexOf("style"))n=s[1];else if(-1!==o[Number.parseInt(r.toString(),10)].indexOf("font")){for(var a=s[1].split(" "),l=0;l<a.length;l++)""===a[Number.parseInt(l.toString(),10)]||a[Number.parseInt(l.toString(),10)].endsWith("pt")||(t+=a[Number.parseInt(l.toString(),10)]+" "),a[Number.parseInt(l.toString(),10)].endsWith("pt")&&(e=Number.parseFloat(a[Number.parseInt(l.toString(),10)].replace("pt","")));for(;" "!==t&&t.endsWith(" ");)t=t.substring(0,t.length-1);-1!==t.indexOf(",")&&(t=t.split(",")[0])}}else{var h=this._dictionary.get("DA");if(h&&""!==h&&-1!==h.indexOf("Tf"))for(var d=h.split(" "),r=0;r<d.length;r++)if(-1!==d[Number.parseInt(r.toString(),10)].indexOf("Tf")){for(t=d[r-2];""!==t&&1<t.length&&"/"===t[0];)t=t.substring(1);e=Number.parseFloat(d[r-1])}}n&&""!==n&&(h=[n],n.includes(":")?h=n.split(":"):n.includes(",")&&(h=n.split(",")),h)&&h.forEach(function(e){switch((e=e.trim()).toLowerCase()){case"bold":i|=Jxt.bold;break;case"italic":i|=Jxt.italic;break;case"strikeout":i|=Jxt.strikeout;break;case"underline":i|=Jxt.underline}}),t=t&&t.trim()}return{name:t,size:e,style:i}},ETt.prototype._obtainFont=function(){var e=this._obtainFontDetails();return Nkt(e.name,e.size,e.style,this)},ETt.prototype._getEqualPdfGraphicsUnit=function(e,t){var i;switch(e){case PAt.inch:i=UAt.inch,t="in";break;case PAt.centimeter:i=UAt.centimeter,t="cm";break;case PAt.millimeter:i=UAt.millimeter,t="mm";break;case PAt.pica:i=UAt.pica,t="p";break;case PAt.point:i=UAt.point,t="pt";break;default:i=UAt.inch,t="in"}return{graphicsUnit:i,unitString:t}},ETt.prototype._createMeasureDictionary=function(e){var t=new mPt,i=(t.set("C",1),t.set("D",100),t.set("F",k.get("D")),t.set("RD","."),t.set("RT",""),t.set("SS",""),t.set("U",e),new mPt),n=(i.set("C",1),i.set("D",100),i.set("F",k.get("D")),i.set("RD","."),i.set("RT",""),i.set("SS",""),i.set("U","sq "+e),new mPt),o=("in"===e?n.set("C",.0138889):"cm"===e?n.set("C",.0352778):"mm"===e?n.set("C",.352778):"pt"===e?n.set("C",1):"p"===e&&n.set("C",.0833333),n.set("D",100),n.set("F",k.get("D")),n.set("RD","."),n.set("RT",""),n.set("SS",""),n.set("U",e),new mPt);return o.set("A",[i]),o.set("D",[t]),o.set("R","1 "+e+" = 1 "+e),o.set("Type",k.get("Measure")),o.set("X",[n]),o},ETt.prototype._colorToHex=function(e){return e?"#"+this._componentToHex(e[0])+this._componentToHex(e[1])+this._componentToHex(e[2]):"#"+this._componentToHex(0)+this._componentToHex(0)+this._componentToHex(0)},ETt.prototype._componentToHex=function(e){e=e.toString(16);return 1===e.length?"0"+e:e},ETt.prototype._getRotatedBounds=function(e,t){if(0<e.width&&0<e.height){var i=new hIt,n=(i._rotate(t),[]);n.push([e.x,e.y]),n.push([e.x+e.width,e.y]),n.push([e.x+e.width,e.y+e.height]),n.push([e.x,e.y+e.height]);for(var o=0;o<n.length;o++)n[Number.parseInt(o.toString(),10)]=i._matrix._transform(n[Number.parseInt(o.toString(),10)]);var r=new nIt;r.addRectangle(e.x,e.y,e.width,e.height);for(o=0;o<4;o++)r._points[Number.parseInt(o.toString(),10)]=n[Number.parseInt(o.toString(),10)];for(var s=n[0][0],a=n[3][0],l=n[0][1],h=n[3][1],o=0;o<4;o++)n[Number.parseInt(o.toString(),10)][0]<s&&(s=n[Number.parseInt(o.toString(),10)][0]),n[Number.parseInt(o.toString(),10)][0]>a&&(a=n[Number.parseInt(o.toString(),10)][0]),n[Number.parseInt(o.toString(),10)][1]<l&&(l=n[Number.parseInt(o.toString(),10)][1]),n[Number.parseInt(o.toString(),10)][1]>h&&(h=n[Number.parseInt(o.toString(),10)][1]);return{x:e.x,y:e.y,width:Math.round(a-s),height:Math.round(h-l)}}return e},ETt.prototype._flattenPopUp=function(){this._flattenPop(this._page,this.color,this.bounds,this.border,this.author,this.subject,this.text)},ETt.prototype._flattenPop=function(e,t,i,n,o,r,s){var a,l=[0,0],i=[(l=e&&e.size?e.size:l)[0]-180,i.y+142<l[1]?i.y:l[1]-142,180,142],h=(this._dictionary.has("Popup")&&this._dictionary.get("Popup")&&(l=this._dictionary.getArray("Rect"))&&4===l.length&&(i=[h=l[0],d=l[1],l[2]-h,l[3]-d]),new fIt(t=void 0===t?[0,0,0]:t)),l=n.width/2,d=new yIt([0,0,0],1),p=0,t=new fIt(this._getForeColor(t)),t=(null!=o&&""!==o?p=this._drawAuthor(o,r,i,h,t,e,p,n):null!=r&&""!==r?(a=[i[0]+l,i[1]+l,i[2]-n.width,40],this._saveGraphics(e,$At.hardLight),this._isTransparentColor?e.graphics.drawRectangle(a[0],a[1],a[2],a[3],d):e.graphics.drawRectangle(a[0],a[1],a[2],a[3],d,h),e.graphics.restore(),o=[(o=[a[0]+11,a[1],a[2],a[3]/2])[0],o[1]+o[3]-2,o[2],a[3]/2],this._saveGraphics(e,$At.normal),this._drawSubject(r,o,e),e.graphics.restore(),p=40):(this._saveGraphics(e,$At.hardLight),a=[i[0]+l,i[1]+l,i[2]-n.width,20],this._isTransparentColor?e.graphics.drawRectangle(a[0],a[1],a[2],a[3],d):e.graphics.drawRectangle(a[0],a[1],a[2],a[3],d,h),p=20,e.graphics.restore()),[i[0]+l,i[1]+l+p,i[2]-n.width,i[3]-(p+n.width)]);this._saveGraphics(e,$At.hardLight),e.graphics.drawRectangle(t[0],t[1],t[2],t[3],new yIt([0,0,0],1),new fIt([255,255,255])),t[0]+=11,t[1]+=5,t[2]-=22,e.graphics.restore(),this._saveGraphics(e,$At.normal),null!=s&&""!==s&&e.graphics.drawString(s,this._popUpFont,t,null,new fIt([0,0,0]),null),e.graphics.restore()},ETt.prototype._flattenLoadedPopUp=function(){var e,t,i,n,o,r,s="",a=(this._dictionary.has("Contents")&&(s=this._dictionary.get("Contents")),this.author),l=this.subject,h=new yIt([0,0,0],1);this._dictionary.has("Popup")?(e=this._getRectangleBoundsValue(),void 0===this.color&&(this.color=[0,0,0]),t=new fIt(this.color),i=this.border.width/2,n=0,r=new fIt(this._getForeColor(this.color)),void 0!==this.author&&null!==this.author&&""!==this.author?n=this._drawAuthor(this.author,this.subject,e,t,r,this._page,n,this.border):(n=void 0!==this.subject&&null!==this.subject&&""!==this.subject?(o=[e[0]+i,e[1]+i,e[2]-this.border.width,40],this._saveGraphics(this._page,$At.hardLight),this._page.graphics.drawRectangle(o[0],o[1],o[2],o[3],h,t),this._page.graphics.restore(),r=[(r=[o[0]+11,o[1],o[2],o[3]/2])[0],r[1]+r[3]-2,r[2],o[3]/2],this._saveGraphics(this._page,$At.normal),this._drawSubject(this.subject,r,this._page),40):(this._saveGraphics(this._page,$At.hardLight),o=[e[0]+i,e[1]+i,e[2]-this.border.width,20],this._page.graphics.drawRectangle(o[0],o[1],o[2],o[3],h,t),20),this._page.graphics.restore()),this._saveGraphics(this._page,$At.hardLight),r=[e[0]+i,e[1]+i+n,e[2]-this.border.width,e[3]-(n+this.border.width)],this._page.graphics.drawRectangle(r[0],r[1],r[2],r[3],h,new fIt([255,255,255])),r[0]+=11,r[1]+=5,r[2]-=22,this._page.graphics.restore(),this._saveGraphics(this._page,$At.normal),this._page.graphics.restore(),null!=s&&""!==s&&this._page.graphics.drawString(s,this._popUpFont,r,null,new fIt([0,0,0]),null),this._page.graphics.restore()):this._flattenPop(this._page,this.color,this.bounds,this.border,a,l,s),this._page.annotations.remove(this)},ETt.prototype._getRectangleBoundsValue=function(){var e;return this._dictionary.has("Popup")&&null!==(e=this._dictionary.get("Popup").getArray("Rect"))?(null!==this._page?0===e[1]&&0===e[3]?e[1]=e[1]+e[3]:e[1]=this._page._size[1]-(e[1]+e[3]):e[1]=e[1]-e[3],e):[0,0,0,0]},ETt.prototype._getForeColor=function(e){return 128<(e[0]+e[1]+e[2])/3?[0,0,0]:[255,255,255]},ETt.prototype._drawAuthor=function(e,t,i,n,o,r,s,a){var l,h=this.border.width/2,d=new yIt([0,0,0],1),p=new E1t(MAt.left,T1t.middle),h=[i[0]+h,i[1]+h,i[2]-a.width,20];return null!=t&&""!==t?(h[3]+=20,s=h[3],this._saveGraphics(r,$At.hardLight),this._isTransparentColor?r.graphics.drawRectangle(h[0],h[1],h[2],h[3],d):r.graphics.drawRectangle(h[0],h[1],h[2],h[3],d,n),r.graphics.restore(),l=[h[0]+11,h[1],h[2],h[3]/2],this._saveGraphics(this._page,$At.normal),r.graphics.drawString(e,this._authorBoldFont,l,null,o,p),l=[l[0],l[1]+l[3]-2,l[2],h[3]/2],this._drawSubject(t,l,r)):(this._saveGraphics(r,$At.hardLight),this._isTransparentColor?r.graphics.drawRectangle(h[0],h[1],h[2],h[3],d):r.graphics.drawRectangle(h[0],h[1],h[2],h[3],d,n),r.graphics.restore(),l=[h[0]+11,h[1],h[2],h[3]],this._saveGraphics(r,$At.normal),r.graphics.drawString(e,this._popUpFont,l,null,o,p),s=h[3]),r.graphics.restore(),s},ETt.prototype._drawSubject=function(e,t,i){var n=new E1t(MAt.left,T1t.middle);i.graphics.drawString(e,this._authorBoldFont,t,null,new fIt([0,0,0]),n)},ETt.prototype._saveGraphics=function(e,t){e.graphics.save(),e.graphics.setTransparency(.8,.8,t)},ETt.prototype._getBorderColorString=function(e){return(e[0]/255).toFixed(3)+" "+(e[1]/255).toFixed(3)+" "+(e[2]/255).toFixed(3)+" rg "},ETt.prototype._stringToDate=function(e){var t,i,n,o,r,s,a,l,h,d,p=new Date;return"D"===e[0]&&":"===e[1]?(r=e.substring(2,6),s=e.substring(6,8),a=e.substring(8,10),l=e.substring(10,12),h=e.substring(12,14),d=e.substring(14,16),n=0,23===e.length&&"+05'30'"!==(i=e.substring(16,22))&&(o=i[0],t=i.substring(1,3),i=i.substring(4,6),n=5.5-("-"===o?-1:1)*(parseInt(t,10)+parseInt(i,10)/60)),p=new Date(r+"-"+s+"-"+a+"T"+l+":"+h+":"+d),0!==n&&p.setTime(p.getTime()+60*n*60*1e3)):p=-1!==e.indexOf("/")?(r=(o=e.split("/"))[2].split(" ")[0],"10"!==(s=o[0])&&"11"!==s&&"12"!==s&&(s="0"+s),a=o[1],l=o[2].split(" ")[1].split(":")[0],h=o[2].split(" ")[1].split(":")[1],d=o[2].split(" ")[1].split(":")[2],new Date(r+"-"+s+"-"+a+"T"+l+":"+h+":"+d)):new Date(e),p},ETt.prototype._dateToString=function(e){var t=(e.getMonth()+1).toString(),i=("10"!==t&&"11"!==t&&"12"!==t&&(t="0"+t),e.getDate().toString()),n=(Number.parseInt(i)<10&&(i="0"+i),e.getHours().toString()),o=(Number.parseInt(n)<10&&(n="0"+n),e.getMinutes().toString()),r=(Number.parseInt(o)<10&&(o="0"+o),e.getSeconds().toString());return Number.parseInt(r)<10&&(r="0"+r),"D:"+e.getFullYear().toString()+t+i+n+o+r+"+05'30'"},ETt.prototype._obtainNativeRectangle=function(){var e,t=[this._bounds.x,this._bounds.y,this.bounds.x+this._bounds.width,this.bounds.y+this._bounds.height],i=this._getCropOrMediaBox();return this._page&&(e=this._page.size,t[1]=e[1]-t[3],i)&&2<i.length&&(0!==i[0]||0!==i[1])&&(t[0]+=i[0],t[1]+=i[1]),t},ETt.prototype._getPoints=function(e){var t=this._getCropOrMediaBox(),i=e;if(t&&3<t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&(0!==t[0]||0!==t[1])){for(var n=[],o=0;o<i.length;o++)n.push(i[Number.parseInt(o.toString(),10)]);for(var r=0;r<n.length;r+=2){var s=n[Number.parseInt(r.toString(),10)],a=n[r+1];t&&(i[Number.parseInt(r.toString(),10)]=s+t[0],this._page._pageDictionary.has("MediaBox")&&!this._page._pageDictionary.has("CropBox")&&0===t[3]&&0<t[1]?i[r+1]=a+t[3]:i[r+1]=a+t[1])}}return i},ETt.prototype._getCropOrMediaBox=function(){var e,t,i;return(e=!this._page||(e=this._page.cropBox)&&0!==e.length?e:this._page.mediaBox)&&e[3]<0&&(t=e[1],i=e[3],e[3]=t,e[1]=i),e},ETt.prototype._getDocumentLayer=function(){var e,t,i;return this._dictionary.has("OC")&&(e=this._dictionary.getRaw("OC"),t=this._page,e)&&t&&this._crossReference._document&&(i=this._crossReference._document.layers)&&this._isMatched(i,e,t),this.layer},ETt.prototype._isMatched=function(e,t,i){for(var n=0;n<e.count;n++){var o=e.at(n)._referenceHolder;if(o&&o===t){if(e.at(n).name){this._layer=e.at(n);break}}else e.at(n).layers&&0<e.at(n).layers.count&&this._isMatched(e.at(n).layers,t,i)}},ETt);function ETt(){this._isImported=!1,this._isLoaded=!1,this._setAppearance=!1,this._isExport=!1,this._opacity=1,this._isAllRotation=!0,this._flatten=!1,this._popUpFont=new _xt(Zxt.helvetica,10.5),this._authorBoldFont=new _xt(Zxt.helvetica,10.5,Jxt.bold),this._lineCaptionFont=new _xt(Zxt.helvetica,10,Jxt.regular),this._circleCaptionFont=new _xt(Zxt.helvetica,8,Jxt.regular),this._isTransparentColor=!1,this._isRotated=!1,this._isChanged=!1}Met(kTt,DTt=TTt),Object.defineProperty(kTt.prototype,"comments",{get:function(){return this._comments||(this._comments=new bDt(this,!1))},enumerable:!0,configurable:!0}),Object.defineProperty(kTt.prototype,"reviewHistory",{get:function(){return this._reviewHistory||(this._reviewHistory=new bDt(this,!0))},enumerable:!0,configurable:!0});var DTt,MTt=kTt;function kTt(){return null!==DTt&&DTt.apply(this,arguments)||this}Met(FTt,PTt=MTt),Object.defineProperty(FTt.prototype,"linePoints",{get:function(){var e;return void 0===this._linePoints&&this._dictionary.has("L")&&(e=this._dictionary.getArray("L"))&&(this._linePoints=e),this._linePoints},set:function(e){if(Array.isArray(e)&&(void 0===this._linePoints||wMt(e,this._linePoints))){if(4!==e.length)throw new Error("Line points length should be 4.");this._dictionary.update("L",e),this._linePoints=e}},enumerable:!0,configurable:!0}),Object.defineProperty(FTt.prototype,"leaderExt",{get:function(){var e;return void 0===this._leaderExt&&this._dictionary.has("LLE")&&void 0!==(e=this._dictionary.get("LLE"))&&(this._leaderExt=e),this._leaderExt},set:function(e){Number.isNaN(e)||(this._dictionary.update("LLE",e),this._leaderExt=e)},enumerable:!0,configurable:!0}),Object.defineProperty(FTt.prototype,"leaderLine",{get:function(){var e;return void 0===this._leaderLine&&this._dictionary.has("LL")&&void 0!==(e=this._dictionary.get("LL"))&&(this._leaderLine=e),this._leaderLine},set:function(e){Number.isNaN(e)||0===this.leaderExt||(this._dictionary.update("LL",e),this._leaderLine=e)},enumerable:!0,configurable:!0}),Object.defineProperty(FTt.prototype,"lineEndingStyle",{get:function(){var e,t;return void 0===this._lineEndingStyle&&((e=new sDt)._dictionary=this._dictionary,this._dictionary.has("LE")&&(t=this._dictionary.getArray("LE"))&&Array.isArray(t)&&(e._begin=jMt(t[0].name),e._end=jMt(t[1].name)),this._lineEndingStyle=e),this._lineEndingStyle},set:function(e){var t=this.lineEndingStyle;t.begin===e.begin&&t.end===e.end||(t.begin=e.begin,t.end=e.end)},enumerable:!0,configurable:!0}),Object.defineProperty(FTt.prototype,"leaderOffset",{get:function(){var e;return void 0===this._leaderOffset&&this._dictionary.has("LLO")&&void 0!==(e=this._dictionary.get("LLO"))&&0<=e&&(this._leaderOffset=e),this._leaderOffset},set:function(e){Number.isNaN(e)||(this._dictionary.update("LLO",e),this._leaderOffset=e)},enumerable:!0,configurable:!0}),Object.defineProperty(FTt.prototype,"lineIntent",{get:function(){var e;return void 0===this._lineIntent&&this._dictionary.has("IT")&&(e=this._dictionary.get("IT"))&&(this._lineIntent="LineDimension"===e.name?CAt.lineDimension:CAt.lineArrow),this._lineIntent},set:function(e){void 0!==e&&e!==this.lineIntent&&(this._lineIntent=e,this._dictionary.update("IT",k.get(e===CAt.lineDimension?"LineDimension":"LineArrow")))},enumerable:!0,configurable:!0}),Object.defineProperty(FTt.prototype,"measure",{get:function(){return void 0===this._measure&&(this._measure=this._dictionary.has("Measure")),this._measure},set:function(e){!e||this._isLoaded||(this._measure=e,this.caption.cap=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(FTt.prototype,"unit",{get:function(){var e;return(void 0===this._unit||this._isLoaded)&&(this._unit=PAt.centimeter,this._dictionary.has("Contents"))&&(e=this._dictionary.get("Contents"),this._unitString=e.substring(e.length-2),this._unit=skt(this._unitString)),this._unit},set:function(e){!this._measure||this._isLoaded||void 0===e||(this._unit=e)},enumerable:!0,configurable:!0}),FTt._load=function(e,t){var i=new FTt;return i._isLoaded=!0,i._initialize(e,t),i},FTt.prototype._initialize=function(e,t){PTt.prototype._initialize.call(this,e,t)},FTt.prototype._postProcess=function(e){if(void 0===this.linePoints||null===this.linePoints)throw new Error("Line points cannot be null or undefined");var t,i,n,o,r=this._getCropOrMediaBox();r&&3<r.length&&3<this.linePoints.length&&"number"==typeof r[0]&&"number"==typeof r[1]&&(0!==r[0]||0!==r[1])&&(this._linePoints[0]+=r[0],this._linePoints[1]+=r[1],this._linePoints[2]+=r[0],this._linePoints[3]+=r[1],this._dictionary.update("L",this._linePoints)),this._dictionary.has("Cap")||this._dictionary.set("Cap",!1),this._dictionary.has("CP")||this._dictionary.set("CP",k.get("Inline")),this._dictionary.has("LE")||(this.lineEndingStyle=new sDt),this._dictionary.has("LL")||(this.leaderLine=0),this._dictionary.has("LLE")||(this.leaderExt=0),this._dictionary.has("C")||(this.color=[0,0,0],this._isTransparentColor=!0),this._dictionary.has("BS")?t=this.border.width:((r=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",r)),void 0===t&&(t=1),null!==this.border.dash&&void 0!==this.border.dash||(this.border.dash=[],this.border.style===xAt.dashed?this.border.dash=[3,1]:this.border.style===xAt.dot&&(this.border.dash=[1,1])),this._measure?this._appearanceTemplate=this._createLineMeasureAppearance(e):(r=!1,this._setAppearance?(this._appearanceTemplate=this._createAppearance(),!this._page._isNew||this._flatten||e||(n={x:(i=this._obtainLineBounds())[0],y:i[1],width:i[2],height:i[3]},this._bounds=n,o=[this._bounds.x,this._bounds.y,this._bounds.x+this._bounds.width,this._bounds.y+this._bounds.height],this._dictionary.update("Rect",o),r=!0)):(t=RMt({x:(n=this._obtainLineBounds())[0],y:n[1],width:n[2],height:n[3]}),this._page._isNew&&this._page._pageSettings&&this._setAppearance&&!this.flatten&&(t=jkt(this,n)),this.bounds={x:t[0],y:t[1],width:t[2],height:t[3]},this._dictionary.update("Rect",t),r=!0),this._dictionary.has("Measure")&&!r&&(n={x:(i=this._obtainLineBounds())[0],y:i[1],width:i[2],height:i[3]},o=void(this._bounds=n),o=this._page&&this._page._isNew&&this._page._pageSettings&&!this._setAppearance&&!this.flatten?jkt(this):[this._bounds.x,this._bounds.y,this._bounds.x+this._bounds.width,this._bounds.y+this._bounds.height],this._dictionary.update("Rect",o),this.flatten)&&!this.measure&&this._page&&this._page.size&&Array.isArray(this._page.size)&&2<=this._page.size.length&&(this._bounds={x:i[0],y:this._page.size[1]-(i[1]+i[3]),width:i[2],height:i[3]}))},FTt.prototype._doPostProcess=function(e){var t,i,n,o;void 0===e&&(e=!1),this._isLoaded?((this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._dictionary.has("Measure")?this._appearanceTemplate=this._createLineMeasureAppearance(e):this._appearanceTemplate=this._createAppearance()),!this._appearanceTemplate&&e&&this._dictionary.has("AP")&&(i=this._dictionary.get("AP"))&&i.has("N")&&(t=i.get("N"))&&((o=i.getRaw("N"))&&(t.reference=o),this._appearanceTemplate=new _It(t,this._crossReference))):(this._postProcess(e),this._appearanceTemplate||e&&(this._dictionary.has("AP")?null!=(i=this._dictionary.get("AP"))&&i.has("N")&&(t=i.get("N"))&&((o=i.getRaw("N"))&&(t.reference=o),this._appearanceTemplate=new _It(t,this._crossReference)):this._appearanceTemplate=this._createAppearance())),void 0!==this.flattenPopups&&this.flattenPopups&&e&&(this._isLoaded?this._flattenLoadedPopUp():this._flattenPopUp()),e&&this._appearanceTemplate?(i=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary),this._flattenAnnotationTemplate(this._appearanceTemplate,i)):e&&this._page.annotations.remove(this),e||!this._setAppearance||this.measure?this.measure&&this._setAppearance&&!this._dictionary.has("AP")&&(o=this._crossReference._getNextReference(),n=new mPt(this._crossReference),this._crossReference._cacheMap.set(o,n),this._dictionary.update("AP",o)):this._dictionary.has("AP")?n=this._dictionary.get("AP"):(o=this._crossReference._getNextReference(),n=new mPt(this._crossReference),this._crossReference._cacheMap.set(o,n),this._dictionary.update("AP",o)),n&&this._appearanceTemplate&&this._appearanceTemplate._content&&(xkt(n,this._crossReference,"N"),o=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(o,this._appearanceTemplate._content),n.update("N",o))},FTt.prototype._createLineMeasureAppearance=function(e){for(var t=[0,0,0,0],i=this._convertToUnit(),n=this._obtainLinePoints(),o=[],r=0;r<n.length;r+=2)o.push([n[Number.parseInt(r.toString(),10)],n[r+1]]);var s,a,l,h,d=new nIt,d=(d._points=o,d._pathTypes=[0,1],d._getBounds()),d=(this._bounds={x:d[0],y:d[1],width:d[2],height:d[3]},new yIt(void 0!==this.color?this._color:[0,0,0],this.border.width)),p=(this.innerColor&&(a=new fIt(this._innerColor)),t=this._obtainLineBounds(),new _It(t,this._crossReference)),c=(nkt(p,0),new mDt),u=(p._writeTransformation=!1,p.graphics),g=(c.borderPen=d,this.border.style===xAt.dashed?(c.borderPen._dashStyle=t1t.dash,c.borderPen._dashPattern=[3,1]):this.border.style===xAt.dot&&(c.borderPen._dashStyle=t1t.dot,c.borderPen._dashPattern=[1,1]),c.backBrush=a,c.foreBrush=new fIt(this.color),this._obtainLinePoints()),m=this._obtainFont();if(null!=m&&(this._isLoaded||1!==m.size)||(m=this._lineCaptionFont,this._pdfFont=m),void 0!==g&&4===g.length&&(g=new E1t(MAt.center,T1t.middle),g=m.measureString(i.toFixed(2)+" "+this._unitString,[0,0],g,0,0),s=this._getAngle(this._linePoints),w=this.leaderLine<(w=C=0)?(C=-this.leaderLine,s+180):(C=this.leaderLine,s),A=void 0!==this.leaderOffset?C+this.leaderOffset:C,S=this._getAxisValue([this._linePoints[0],this._linePoints[1]],w+90,A),f=this._getAxisValue([this._linePoints[2],this._linePoints[3]],w+90,A),b=(x=Math.sqrt(Math.pow(f[0]-S[0],2)+Math.pow(f[1]-S[1],2)))/2-(g[0]/2+this.border.width),h=this._getAxisValue(S,s,b),b=this._getAxisValue(f,s+180,b),l=this.lineEndingStyle.begin===wAt.openArrow||this.lineEndingStyle.begin===wAt.closedArrow?this._getAxisValue(S,s,this.border.width):S,v=this.lineEndingStyle.end===wAt.openArrow||this.lineEndingStyle.end===wAt.closedArrow?this._getAxisValue(f,s,-this.border.width):f,y=void 0,this.opacity&&this._opacity<1&&(y=u.save(),u.setTransparency(this._opacity)),this.caption.type===AAt.top||!this.caption.cap&&this.caption.type===AAt.inline?u.drawLine(d,l[0],-l[1],v[0],-v[1]):(u.drawLine(d,l[0],-l[1],h[0],-h[1]),u.drawLine(d,v[0],-v[1],b[0],-b[1])),this.opacity&&this._opacity<1&&u.restore(y),this._drawLineStyle(S,f,u,s,d,a,this.lineEndingStyle,this.border.width),l=void 0!==this.leaderExt?this._leaderExt:0,h=this._getAxisValue(S,w+90,l),u.drawLine(d,S[0],-S[1],h[0],-h[1]),v=this._getAxisValue(f,w+90,l),u.drawLine(d,f[0],-f[1],v[0],-v[1]),b=this._getAxisValue(S,w-90,C),u.drawLine(d,S[0],-S[1],b[0],-b[1]),y=this._getAxisValue(f,w-90,C),u.drawLine(d,f[0],-f[1],y[0],-y[1]),a=this._getAxisValue(S,s,x/2),h=void 0,l=m._metrics._getHeight(),h=this.caption.type===AAt.top?this._getAxisValue(a,s+90,l):this._getAxisValue(a,s+90,l/2),u.translateTransform(h[0],-h[1]),u.rotateTransform(-s),u.drawString(i.toFixed(2)+" "+this._unitString,m,[-g[0]/2,0,0,0],null,c.foreBrush),u.restore()),void 0!==e&&!e||!this._isLoaded){p._content.dictionary._updated=!0;var f,y,v=this._crossReference._getNextReference(),b=(this._crossReference._cacheMap.set(v,p._content),p._content.reference=v,[this.bounds.x,this.bounds.y+this.bounds.height,this.bounds.width,this.bounds.height]),w=this._page.size,C=(b[1]=w[1]-(this.bounds.y+this.bounds.height),this._isBounds&&!this.measure?this._dictionary.update("Rect",[(t=b)[0],b[1],b[2],b[3]]):this._dictionary.update("Rect",[t[0],t[1],t[2],t[3]]),"font:"+m._metrics._postScriptName+" "+m._size+"pt; color:"+this._colorToHex(this.color)),S=(this._dictionary.update("DS",C),void 0===e||e||(this._dictionary.has("AP")&&xkt(this._dictionary.get("AP"),this._crossReference,"N"),(d=new mPt).set("N",v),d._updated=!0,this._dictionary.set("AP",d),f=this._createMeasureDictionary(this._unitString),y=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(y,f),f._updated=!0,this._dictionary.has("Measure")&&xkt(this._dictionary,this._crossReference,"Measure"),this._dictionary.update("Measure",y)),[]);if(S.push(k.get(zMt(this.lineEndingStyle.begin))),S.push(k.get(zMt(this.lineEndingStyle.end))),this._dictionary.update("LE",S),null===this._linePoints)throw new Error("LinePoints cannot be null");this._dictionary.update("L",this._linePoints),this._dictionary.update("C",[Number.parseFloat((this.color[0]/255).toFixed(3)),Number.parseFloat((this.color[1]/255).toFixed(3)),Number.parseFloat((this.color[2]/255).toFixed(3))]);var A=this._dictionary.has("LLO")?this.leaderOffset:0,x=(this._dictionary.update("Subtype",new k("Line")),this._text&&""!==this._text?this._dictionary.update("Contents",this._text+" "+i.toFixed(2)+" "+this._unitString):this._dictionary.update("Contents",i.toFixed(2)+" "+this._unitString),this._dictionary.update("IT",new k("LineDimension")),this._dictionary.update("LLE",this.leaderExt),this._dictionary.update("LLO",A),this._dictionary.update("LL",this.leaderLine),this._dictionary.update("CP",k.get(this.caption.type===AAt.top?"Top":"Inline")),this._dictionary.update("Cap",this.caption.cap),[t[0],t[1],t[0]+t[2],t[1]+t[3]]);this._dictionary.update("Rect",x),this._bounds={x:x[0],y:x[1],width:x[2],height:x[3]}}return p},FTt.prototype._calculateAngle=function(e,t,i,n){return-(Math.atan2(n-t,i-e)*(180/Math.PI))},FTt.prototype._calculateLineBounds=function(e,t,i,n,o,r){var s,a,l,h,d,p={x:0,y:0,width:0,height:0};return e&&4===e.length&&(l=this._getAngle(e),d=i<(d=h=0)?(h=-i,l+180):(h=i,l),i=[e[0],e[1]],l=[e[2],e[3]],0!==n&&(s=this._getAxisValue(i,d+90,n),a=this._getAxisValue(l,d+90,n),e[0]=s[0],e[1]=s[1],e[2]=a[0],e[3]=a[1]),s=this._getAxisValue(i,d+90,h+n),a=this._getAxisValue(l,d+90,h+n),i=this._getAxisValue(i,d+90,t+h+n),l=this._getAxisValue(l,d+90,t+h+n),t=this._getLinePoint(o.begin,r),h=this._getLinePoint(o.end,r),n=[],o=[],45<=d&&d<=135||225<=d&&d<=315?(n[0]=t.y,o[0]=t.x,n[1]=h.y,o[1]=h.x):(n[0]=t.x,o[0]=t.y,n[1]=h.x,o[1]=h.y),0===(d=Math.max(n[0],n[1]))&&(d=1),0===(t=Math.max(o[0],o[1]))&&(t=1),s[0]===Math.min(s[0],a[0])?(s[0]-=d*r,a[0]+=d*r,s[0]=Math.min(s[0],e[0]),s[0]=Math.min(s[0],i[0]),a[0]=Math.max(a[0],e[2]),a[0]=Math.max(a[0],l[0])):(s[0]+=d*r,a[0]-=d*r,s[0]=Math.max(s[0],e[0]),s[0]=Math.max(s[0],i[0]),a[0]=Math.min(a[0],e[2]),a[0]=Math.min(a[0],l[0])),s[1]===Math.min(s[1],a[1])?(s[1]-=t*r,a[1]+=t*r,s[1]=Math.min(s[1],e[1]),s[1]=Math.min(s[1],i[1]),a[1]=Math.max(a[1],e[3]),a[1]=Math.max(a[1],l[1])):(s[1]+=t*r,a[1]-=t*r,s[1]=Math.max(s[1],e[1]),s[1]=Math.max(s[1],i[1]),a[1]=Math.min(a[1],e[3]),a[1]=Math.min(a[1],l[1])),p=this._getBounds([{x:s[0],y:s[1]},{x:a[0],y:a[1]}])),p},FTt.prototype._getLinePoint=function(e,t){var i={x:0,y:0};if(e)switch(e){case wAt.square:case wAt.circle:case wAt.diamond:i.x=3,i.y=3;break;case wAt.openArrow:case wAt.closedArrow:i.x=1,i.y=5;break;case wAt.rOpenArrow:case wAt.rClosedArrow:i.x=9+t/2,i.y=5+t/2;break;case wAt.slash:i.x=5,i.y=9;break;case wAt.butt:i.x=1,i.y=3;break;default:i.x=0,i.y=0}return i},FTt.prototype._getBounds=function(e){var t={x:0,y:0,width:0,height:0};if(0<e.length){for(var i=e[0].x,n=e[0].x,o=e[0].y,r=e[0].y,s=1;s<e.length;++s)var a=e[Number.parseInt(s.toString(),10)],i=Math.min(a.x,i),n=Math.max(a.x,n),o=Math.min(a.y,o),r=Math.max(a.y,r);t.x=i,t.y=o,t.width=n-i,t.height=r-o}return t},FTt.prototype._obtainLineBounds=function(){var e,t,i,n=this.bounds;return void 0!==this.linePoints&&4===this._linePoints.length&&(e=this._dictionary.has("LLO")?this.leaderOffset:0,t=this._dictionary.has("LLE")?this.leaderExt:0,i=this._dictionary.has("LL")?this.leaderLine:0,n={x:(n=this._calculateLineBounds(this._linePoints,t,i,e,this.lineEndingStyle,this.border.width)).x-8,y:n.y-8,width:n.width+16,height:n.height+16}),[n.x,n.y,n.width,n.height]},FTt.prototype._createAppearance=function(){var e,t,i,n,o,r,s,a,l,h,d,p=new _It(this._obtainLineBounds(),this._crossReference),c=new mDt,u=(nkt(p,0),p._writeTransformation=!1,p.graphics),g=new yIt(void 0!==this.color?this._color:[0,0,0],this.border.width),m=(this.border.style===xAt.dashed?(g._dashStyle=t1t.dash,g._dashPattern=[3,1]):this.border.style===xAt.dot&&(g._dashStyle=t1t.dot,g._dashPattern=[1,1]),c.borderPen=g,c.foreBrush=new fIt(this.color),this.innerColor&&(s=new fIt(this._innerColor)),this._obtainFont()),f=(null!=m&&(this._isLoaded||1!==m.size)||(m=this._lineCaptionFont,this._pdfFont=m),this.text||this._dictionary.has("Contents")||(this.text=this.subject),new E1t(MAt.center,T1t.middle)),y=0;return this.caption.cap&&(y=m.measureString(this.text||"",[0,0],f,0,0)[0]),void 0!==this.linePoints&&4===this._linePoints.length&&(f=this._getAngle(this._linePoints),t=e=0,t=(n=null==(n=this.leaderLine)?this._leaderLine=0:n)<0?(e=-n,f+180):(e=n,f),n=void 0!==this.leaderOffset?e+this.leaderOffset:e,i=this._getAxisValue([this._linePoints[0],this._linePoints[1]],t+90,n),n=this._getAxisValue([this._linePoints[2],this._linePoints[3]],t+90,n),r=(o=Math.sqrt(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)))/2-(y/2+this.border.width),d=this._getAxisValue(i,f,r),r=this._getAxisValue(n,f+180,r),l=this.lineEndingStyle.begin===wAt.openArrow||this.lineEndingStyle.begin===wAt.closedArrow?this._getAxisValue(i,f,this.border.width):i,h=this.lineEndingStyle.end===wAt.openArrow||this.lineEndingStyle.end===wAt.closedArrow?this._getAxisValue(n,f,-this.border.width):n,this.opacity&&this._opacity<1?(a=u.save(),u.setTransparency(this._opacity),this._drawLine(u,g,l,h,d,r),u.restore(a)):this._drawLine(u,g,l,h,d,r),this._drawLineStyle(i,n,u,f,g,s,this.lineEndingStyle,this.border.width),a=void 0!==this.leaderExt?this._leaderExt:0,l=this._getAxisValue(i,t+90,a),u.drawLine(g,i[0],-i[1],l[0],-l[1]),h=this._getAxisValue(n,t+90,a),u.drawLine(g,n[0],-n[1],h[0],-h[1]),d=this._getAxisValue(i,t-90,e),u.drawLine(g,i[0],-i[1],d[0],-d[1]),r=this._getAxisValue(n,t-90,e),u.drawLine(g,n[0],-n[1],r[0],-r[1]),s=this._getAxisValue(i,f,o/2),l=void 0,a=m._metrics._getHeight(),l=this.caption.type===AAt.top?this._measure?this._getAxisValue(s,f+90,2*a):this._getAxisValue(s,f+90,a):this._measure?this._getAxisValue(s,f+90,a/2*3):this._getAxisValue(s,f+90,a/2),u.translateTransform(l[0],-l[1]),u.rotateTransform(-f),this.caption.cap&&u.drawString(this.text,m,[-y/2,0,0,0],null,c.foreBrush),u.restore(),d=RMt({x:(h=this._obtainLineBounds())[0],y:h[1],width:h[2],height:h[3]}),this.bounds={x:d[0],y:d[1],width:d[2],height:d[3]},this.measure||this._dictionary.has("Measure")||this._dictionary.update("Rect",[d[0],d[1],d[2],d[3]])),p},FTt.prototype._drawLine=function(e,t,i,n,o,r){void 0===this.text||""===this._text||this.caption.type===AAt.top||!this.caption.cap&&this.caption.type===AAt.inline?e.drawLine(t,i[0],-i[1],n[0],-n[1]):(e.drawLine(t,i[0],-i[1],o[0],-o[1]),e.drawLine(t,n[0],-n[1],r[0],-r[1]))},FTt.prototype._convertToUnit=function(){for(var e=this._obtainLinePoints(),t=new Array(e.length/2),i=0,n=0;n<e.length;n+=2)t[Number.parseInt(i.toString(),10)]=[e[Number.parseInt(n.toString(),10)],e[n+1]],i++;var o=Math.sqrt(Math.pow(t[1][0]-t[0][0],2)+Math.pow(t[1][1]-t[0][1],2)),r=this._getEqualPdfGraphicsUnit(this.unit,this._unitString);return this._unitString=r.unitString,(new vIt)._convertUnits(o,UAt.point,r.graphicsUnit)},FTt.prototype._obtainLinePoints=function(){var e=[];if(this.linePoints)for(var t=0;t<this._linePoints.length;t++)e[Number.parseInt(t.toString(),10)]=this._linePoints[Number.parseInt(t.toString(),10)];return e};var PTt,BTt=FTt;function FTt(e){var t=PTt.call(this)||this;return t._unit=PAt.centimeter,t._unitString="",t._dictionary=new mPt,t._dictionary.update("Type",k.get("Annot")),t._dictionary.update("Subtype",k.get("Line")),null!=e&&(t.linePoints=e),t._type=QAt.lineAnnotation,t}Met(OTt,LTt=MTt),Object.defineProperty(OTt.prototype,"measure",{get:function(){return void 0===this._measure&&this._dictionary.has("Measure")&&(this._measure=this._dictionary.get("Measure")),this._measure},set:function(e){!e||this._isLoaded||(this._measure=e)},enumerable:!0,configurable:!0}),Object.defineProperty(OTt.prototype,"unit",{get:function(){var e;return(void 0===this._unit||this._isLoaded)&&(this._unit=PAt.centimeter,this._dictionary.has("Contents"))&&(e=this._dictionary.get("Contents"),this._unitString=e.substring(e.length-2),this._unit=skt(this._unitString)),this._unit},set:function(e){!this._measure||this._isLoaded||void 0===e||(this._unit=e)},enumerable:!0,configurable:!0}),Object.defineProperty(OTt.prototype,"measureType",{get:function(){var e;return this._dictionary.has("Contents")&&(e=this._dictionary.get("Contents"),this._unitString=e.substring(e.length-2),this._unit=skt(this._unitString),e=e.substring(0,e.length-2),(new vIt)._convertUnits(this.bounds.width/2,UAt.point,hkt(this._unitString)).toString()===e?this._measureType=BAt.radius:this._measureType=BAt.diameter),this._measureType},set:function(e){!this._measure||this._isLoaded||void 0===e||(this._measureType=e)},enumerable:!0,configurable:!0}),OTt._load=function(e,t){var i=new OTt;return i._isLoaded=!0,i._initialize(e,t),i},OTt.prototype._initialize=function(e,t){LTt.prototype._initialize.call(this,e,t)},OTt.prototype._postProcess=function(e){if(void 0===this.bounds||null===this.bounds)throw new Error("Bounds cannot be null or undefined");var t,i;this._dictionary.has("BS")?t=this.border.width:((i=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",i)),this._dictionary.has("C")||(this.color=[0,0,0],this._isTransparentColor=!0),void 0===t&&(t=1),this._measure?this._appearanceTemplate=this._createCircleMeasureAppearance(e):(this._dictionary.update("Rect",jkt(this)),(this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._appearanceTemplate=this._createCircleAppearance()))},OTt.prototype._doPostProcess=function(e){var t,i,n;void 0===e&&(e=!1),this._isLoaded?((this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._dictionary.has("Measure")?this._appearanceTemplate=this._createCircleMeasureAppearance(e):this._appearanceTemplate=this._createCircleAppearance()),!this._appearanceTemplate&&e&&this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"),n=t.getRaw("N"),i)&&(n&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference))):(this._postProcess(e),!this._appearanceTemplate&&e&&(this._dictionary.has("AP")?null!=(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"),n=t.getRaw("N"),i)&&(n&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference)):this._appearanceTemplate=this._createCircleAppearance())),void 0!==this.flattenPopups&&this.flattenPopups&&e&&(this._isLoaded?this._flattenLoadedPopUp():this._flattenPopUp()),e&&this._appearanceTemplate?(t=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary),this._flattenAnnotationTemplate(this._appearanceTemplate,t)):e&&this._page.annotations.remove(this),e||!this._setAppearance||this.measure||(i=void 0,this._dictionary.has("AP")?i=this._dictionary.get("AP"):(t=this._crossReference._getNextReference(),i=new mPt(this._crossReference),this._crossReference._cacheMap.set(t,i),this._dictionary.update("AP",t)),xkt(i,this._crossReference,"N"),n=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(n,this._appearanceTemplate._content),i.update("N",n))},OTt.prototype._createCircleMeasureAppearance=function(e){var t,i=this.border.width,n=this._obtainFont(),o=(null!=n&&(this._isLoaded||1!==n.size)||(n=this._circleCaptionFont,this._pdfFont=n),this._convertToUnit()),r=new E1t(MAt.center,T1t.middle),s=o.toFixed(2)+" "+this._unitString,s=n.measureString(s,[0,0],r,0,0),r=this.color||[0,0,0],a=new yIt(r,i),l=[this.bounds.x,this.bounds.y+this.bounds.height,this.bounds.width,this.bounds.height],h=(l[1]=l[1]-l[3],new _It(l,this._crossReference)),d=new mDt,p=(h._writeTransformation=!1,h.graphics),c=i/2,a=(d.borderPen=a,this.innerColor&&(d.backBrush=new fIt(this._innerColor)),d.foreBrush=new fIt(r),[l[0],-l[1]-l[3],l[2],l[3]]);return p.save(),p.drawEllipse(a[0]+c,a[1]+c,a[2]-i,a[3]-i,new yIt(r,this.border.width)),this._measureType===BAt.diameter?(p.save(),p.translateTransform(l[0],-l[1]),t=l[3]/2-s[0]/2,p.drawLine(d.borderPen,0,-l[3]/2,l[0]+l[2],-l[3]/2)):(p.save(),p.translateTransform(l[0],-l[1]),t=l[2]/2+(l[2]/4-s[0]/2),p.drawLine(d.borderPen,l[2]/2,-l[3]/2,l[0]+l[2],-l[3]/2)),p.translateTransform(t,-l[3]/2-n._metrics._getHeight()),p.drawString(o.toFixed(2)+" "+this._unitString,n,[0,0,0,0],null,d.foreBrush),p.restore(),p.restore(),(void 0===e||e)&&this._isLoaded||(this._dictionary.has("AP")&&xkt(this._dictionary.get("AP"),this._crossReference,"N"),c=new mPt,p._template._content.dictionary._updated=!0,a=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(a,p._template._content),p._template._content.reference=a,c.set("N",a),c._updated=!0,this._dictionary.set("AP",c),this._dictionary.update("Rect",jkt(this)),this._dictionary.has("Measure")&&xkt(this._dictionary,this._crossReference,"Measure"),i=this._createMeasureDictionary(this._unitString),r=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(r,i),i._updated=!0,this._dictionary.update("Measure",r),this._dictionary.update("Subtype",new k("Circle")),this._text&&""!==this._text?this._dictionary.update("Contents",this._text+" "+o.toFixed(2)+" "+this._unitString):this._dictionary.update("Contents",o.toFixed(2)+" "+this._unitString),s="font:"+n._metrics._postScriptName+" "+n._size+"pt; color:"+this._colorToHex(this.color),this._dictionary.update("DS",s)),h},OTt.prototype._convertToUnit=function(){var e=new vIt,t=this._getEqualPdfGraphicsUnit(this.unit,this._unitString),e=(this._unitString=t.unitString,e._convertUnits(this.bounds.width/2,UAt.point,t.graphicsUnit));return this._measureType===BAt.diameter&&(e*=2),e};var LTt,RTt=OTt;function OTt(e,t,i,n){var o=LTt.call(this)||this;return o._unit=PAt.centimeter,o._measureType=BAt.diameter,o._unitString="",o._dictionary=new mPt,o._dictionary.update("Type",k.get("Annot")),o._dictionary.update("Subtype",k.get("Circle")),void 0!==e&&void 0!==t&&void 0!==i&&void 0!==n&&(o.bounds={x:e,y:t,width:i,height:n}),o._type=QAt.circleAnnotation,o}Met(_Tt,NTt=MTt),_Tt._load=function(e,t){var i=new _Tt;return i._isLoaded=!0,i._initialize(e,t),i},_Tt.prototype._initialize=function(e,t){NTt.prototype._initialize.call(this,e,t)},_Tt.prototype._postProcess=function(e){if(void 0===this.bounds||null===this.bounds)throw new Error("Bounds cannot be null or undefined");var t,i;this._dictionary.has("BS")?t=this.border.width:((i=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",i)),this._dictionary.has("C")||(this.color=[0,0,0],this._isTransparentColor=!0),void 0===t&&(t=1),(this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._appearanceTemplate=this._createCircleAppearance()),this._dictionary.update("Rect",jkt(this))},_Tt.prototype._doPostProcess=function(e){var t,i,n;void 0===e&&(e=!1),this._isLoaded?((this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._appearanceTemplate=this._createCircleAppearance()),!this._appearanceTemplate&&e&&this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"),n=t.getRaw("N"),i)&&(n&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference))):(this._postProcess(e),!this._appearanceTemplate&&e&&(this._dictionary.has("AP")?(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"),n=t.getRaw("N"),i)&&(n&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference)):this._appearanceTemplate=this._createCircleAppearance())),void 0!==this.flattenPopups&&this.flattenPopups&&(this._isLoaded?this._flattenLoadedPopUp():this._flattenPopUp()),e&&this._appearanceTemplate?(t=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary),this._flattenAnnotationTemplate(this._appearanceTemplate,t)):e&&this._page.annotations.remove(this),!e&&this._setAppearance&&(i=void 0,this._dictionary.has("AP")?i=this._dictionary.get("AP"):(t=this._crossReference._getNextReference(),i=new mPt(this._crossReference),this._crossReference._cacheMap.set(t,i),this._dictionary.update("AP",t)),xkt(i,this._crossReference,"N"),n=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(n,this._appearanceTemplate._content),i.update("N",n))};var NTt,VTt=_Tt;function _Tt(e,t,i,n){var o=NTt.call(this)||this;return o._dictionary=new mPt,o._dictionary.update("Type",k.get("Annot")),o._dictionary.update("Subtype",k.get("Circle")),void 0!==e&&void 0!==t&&void 0!==i&&void 0!==n&&(o.bounds={x:e,y:t,width:i,height:n}),o._type=QAt.ellipseAnnotation,o}Met(jTt,HTt=MTt),Object.defineProperty(jTt.prototype,"borderEffect",{get:function(){var e,t;return void 0===this._borderEffect&&((e=new uDt)._dictionary=this._dictionary,this._dictionary.has("BE")?(t=this._dictionary.get("BE"),e._intensity=t.get("I"),e._style=HMt(t.get("S").name)):e._style=IAt.solid,this._borderEffect=e),this._borderEffect},set:function(e){void 0!==e&&(this._borderEffect=e)},enumerable:!0,configurable:!0}),Object.defineProperty(jTt.prototype,"measure",{get:function(){return void 0===this._measure&&this._dictionary.has("Measure")&&(this._measure=this._dictionary.get("Measure")),this._measure},set:function(e){void 0===e||this._isLoaded||(this._measure=e)},enumerable:!0,configurable:!0}),Object.defineProperty(jTt.prototype,"unit",{get:function(){var e;return void 0===this._unit&&(this._unit=PAt.centimeter,this._dictionary.has("Contents"))&&(e=this._dictionary.get("Contents"),this._unitString=e.substring(e.length-2),this._unit=skt(this._unitString)),this._unit},set:function(e){!this._measure||this._isLoaded||void 0===e||(this._unit=e)},enumerable:!0,configurable:!0}),jTt._load=function(e,t){var i=new jTt;return i._isLoaded=!0,i._initialize(e,t),i},jTt.prototype._initialize=function(e,t){HTt.prototype._initialize.call(this,e,t)},jTt.prototype._postProcess=function(e){if(void 0===this.bounds||null===this.bounds)throw new Error("Bounds cannot be null or undefined");var t,i;this._dictionary.has("BS")?t=this.border.width:((i=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",i)),this._dictionary.has("C")||(this.color=[0,0,0],this._isTransparentColor=!0),void 0===t&&(t=1),this._measure?this._appearanceTemplate=this._createSquareMeasureAppearance(e):((this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._appearanceTemplate=this._createRectangleAppearance(this.borderEffect)),this._dictionary.update("Rect",jkt(this)),void 0===this._intensity&&void 0!==this._borderEffect&&this._borderEffect.style===IAt.cloudy&&((i=new mPt(this._crossReference)).set("I",this.borderEffect._intensity),this.borderEffect._style===IAt.cloudy&&i.set("S",k.get("C")),this._dictionary.update("BE",i)))},jTt.prototype._doPostProcess=function(e){var t,i,n;void 0===e&&(e=!1),this._isLoaded?((this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._dictionary.has("Measure")?this._appearanceTemplate=this._createSquareMeasureAppearance(e):this._appearanceTemplate=this._createRectangleAppearance(this.borderEffect)),!this._appearanceTemplate&&e&&this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"),n=t.getRaw("N"),i)&&(n&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference))):(this._postProcess(e),!this._appearanceTemplate&&e&&(this._dictionary.has("AP")?(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"),n=t.getRaw("N"),i)&&(n&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference)):this._appearanceTemplate=this._createRectangleAppearance(this.borderEffect))),void 0!==this.flattenPopups&&this.flattenPopups&&!this.measure&&(this._isLoaded&&!this._dictionary.has("Measure")?this._flattenLoadedPopUp():this._flattenPopUp()),e&&this._appearanceTemplate?(t=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary),this._flattenAnnotationTemplate(this._appearanceTemplate,t)):e&&this._page.annotations.remove(this),e||!this._setAppearance||this.measure||(i=void 0,this._dictionary.has("AP")?i=this._dictionary.get("AP"):(t=this._crossReference._getNextReference(),i=new mPt(this._crossReference),this._crossReference._cacheMap.set(t,i),this._dictionary.update("AP",t)),xkt(i,this._crossReference,"N"),n=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(n,this._appearanceTemplate._content),i.update("N",n))},jTt.prototype._createSquareMeasureAppearance=function(e){var t=this.border.width,i=this._obtainFont(),n=(null!=i&&(this._isLoaded||1!==i.size)||(i=this._circleCaptionFont,this._pdfFont=i),this._calculateAreaOfSquare()),o=new E1t(MAt.center,T1t.middle),r=n.toFixed(2)+" sq "+this._unitString,r=i.measureString(r,[0,0],o,0,0),o=new yIt(this.color,t),s=(this.innerColor&&(p=new fIt(this._innerColor)),[this.bounds.x,this.bounds.y+this.bounds.height,this.bounds.width,this.bounds.height]),a=[this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height],a=new ATt(this,a),l=(s[1]=s[1]-s[3],a.normal=new _It(s,this._crossReference),a.normal),h=new mDt,a=(l._writeTransformation=!1,a.normal.graphics),d=t/2,o=(h.borderPen=o,h.backBrush=p,h.foreBrush=new fIt(this.color),[s[0],-s[1]-s[3],s[2],s[3]]),p=(a.drawRectangle(o[0]+d,o[1]+d,o[2]-t,o[3]-t,new yIt(this.color,this.border.width)),a.save(),a.translateTransform(s[0],-s[1]),s[2]/2-r[0]/2),d=s[3]/2-r[1]/2;return a.translateTransform(p,-d-i._metrics._getHeight()),a.drawString(n.toFixed(2)+" sq "+this._unitString,i,[0,0,0,0],null,h.foreBrush),a.restore(),(void 0===e||e)&&this._isLoaded||(this._dictionary.has("AP")&&xkt(this._dictionary.get("AP"),this._crossReference,"N"),o=new mPt,(t=a._template._content).dictionary._updated=!0,r=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(r,t),a._template._content.reference=r,o.set("N",r),o._updated=!0,this._dictionary.set("AP",o),p=[this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height],d=this._page.size,p[1]=d[1]-(this.bounds.y+this.bounds.height),p[2]=this.bounds.x+this.bounds.width,p[3]=d[1]-this.bounds.y,this._isBounds&&(s=p),this._page._isNew&&this._page._pageSettings&&(p=jkt(this)),this._dictionary.update("Rect",[p[0],p[1],p[2],p[3]]),this._dictionary.has("Measure")&&xkt(this._dictionary,this._crossReference,"Measure"),h=this._crossReference._getNextReference(),e=this._createMeasureDictionary(this._unitString),this._crossReference._cacheMap.set(h,e),e._updated=!0,this._dictionary.update("Measure",h),t="font:"+i._metrics._postScriptName+" "+i._size+"pt; color:"+this._colorToHex(this.color),this._dictionary.update("DS",t),this._text&&""!==this._text?this._dictionary.update("Contents",this._text+" "+n.toFixed(2)+" sq "+this._unitString):this._dictionary.update("Contents",n.toFixed(2)+" sq "+this._unitString),this._dictionary.update("Subject","Area Measurement"),void 0===this.subject&&this._dictionary.update("Subject","Area Measurement"),this._dictionary.update("MeasurementTypes",129),this._dictionary.update("Subtype",new k("Square")),this._dictionary.update("IT",new k("SquareDimension")),a=this._dictionary.getArray("Rect"),(r=new Array(2*a.length))[0]=a[0],r[1]=a[3],r[2]=a[0],r[3]=a[1],r[4]=a[2],r[5]=a[1],r[6]=a[2],r[7]=a[3],this._dictionary.update("Vertices",r)),l},jTt.prototype._calculateAreaOfSquare=function(){var e,t,i=new vIt;return this.bounds.width===this.bounds.height?(t=this._getEqualPdfGraphicsUnit(this.unit,this._unitString),this._unitString=t.unitString,(e=i._convertUnits(this.bounds.width,UAt.point,t.graphicsUnit))*e):(t=this._getEqualPdfGraphicsUnit(this.unit,this._unitString),this._unitString=t.unitString,e=i._convertUnits(this.bounds.width,UAt.point,t.graphicsUnit),t=this._getEqualPdfGraphicsUnit(this.unit,this._unitString),this._unitString=t.unitString,e*i._convertUnits(this.bounds.height,UAt.point,t.graphicsUnit))};var HTt,zTt=jTt;function jTt(e,t,i,n){var o=HTt.call(this)||this;return o._unit=PAt.centimeter,o._dictionary=new mPt,o._dictionary.update("Type",k.get("Annot")),o._dictionary.update("Subtype",k.get("Square")),void 0!==e&&void 0!==t&&void 0!==i&&void 0!==n&&(o.bounds={x:e,y:t,width:i,height:n}),o._type=QAt.squareAnnotation,o}Met(UTt,WTt=MTt),Object.defineProperty(UTt.prototype,"borderEffect",{get:function(){var e,t;return void 0===this._borderEffect&&((e=new uDt)._dictionary=this._dictionary,this._dictionary.has("BE")?(t=this._dictionary.get("BE"),e._intensity=t.get("I"),e._style=HMt(t.get("S").name)):e._style=IAt.solid,this._borderEffect=e),this._borderEffect},set:function(e){void 0!==e&&(this._borderEffect=e)},enumerable:!0,configurable:!0}),UTt._load=function(e,t){var i=new UTt;return i._isLoaded=!0,i._initialize(e,t),i},UTt.prototype._initialize=function(e,t){WTt.prototype._initialize.call(this,e,t)},UTt.prototype._postProcess=function(e){if(void 0===this.bounds||null===this.bounds)throw new Error("Bounds cannot be null or undefined");var t,i;this._dictionary.has("BS")?t=this.border.width:((i=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",i)),this._dictionary.has("C")||(this.color=[0,0,0],this._isTransparentColor=!0),void 0===t&&(t=1),this._dictionary.update("Rect",jkt(this)),(this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._appearanceTemplate=this._createRectangleAppearance(this.borderEffect)),void 0===this._intensity&&void 0!==this._borderEffect&&this._borderEffect.style===IAt.cloudy&&((i=new mPt(this._crossReference)).set("I",this.borderEffect._intensity),this.borderEffect._style===IAt.cloudy&&i.set("S",k.get("C")),this._dictionary.update("BE",i))},UTt.prototype._doPostProcess=function(e){var t,i,n;void 0===e&&(e=!1),this._isLoaded?((this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._appearanceTemplate=this._createRectangleAppearance(this.borderEffect)),!this._appearanceTemplate&&e&&this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"),n=t.getRaw("N"),i)&&(n&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference))):(this._postProcess(e),!this._appearanceTemplate&&e&&(this._dictionary.has("AP")?(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"),n=t.getRaw("N"),i)&&(n&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference)):this._appearanceTemplate=this._createRectangleAppearance(this.borderEffect))),void 0!==this.flattenPopups&&this.flattenPopups&&(this._isLoaded?this._flattenLoadedPopUp():this._flattenPopUp()),e&&this._appearanceTemplate?((t=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary))&&this._page&&this._page.rotation!==TAt.angle0||this._isValidTemplateMatrix(this._appearanceTemplate._content.dictionary,this.bounds,this._appearanceTemplate))&&this._flattenAnnotationTemplate(this._appearanceTemplate,t):e&&this._page.annotations.remove(this),!e&&this._setAppearance&&(i=void 0,this._dictionary.has("AP")?i=this._dictionary.get("AP"):(t=this._crossReference._getNextReference(),i=new mPt(this._crossReference),this._crossReference._cacheMap.set(t,i),this._dictionary.update("AP",t)),xkt(i,this._crossReference,"N"),n=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(n,this._appearanceTemplate._content),i.update("N",n))},UTt.prototype._isValidTemplateMatrix=function(e,t,i){var n,o,r=!0;return e&&e.has("Matrix")&&(n=e.getArray("BBox"),e=e.getArray("Matrix"))&&n&&3<e.length&&2<n.length&&void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]&&1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&void 0!==n[0]&&void 0!==n[1]&&void 0!==n[2]&&void 0!==n[3]&&(Math.round(n[0])!==Math.round(-e[4])&&Math.round(n[1])!==Math.round(-e[5])||0===n[0]&&0===Math.round(-e[4]))&&(o=(e=this._page.graphics).save(),void 0!==this.opacity&&this._opacity<1&&e.setTransparency(this._opacity),t.x-=n[0],t.y+=n[1],e.drawTemplate(i,t),e.restore(o),this._page.annotations.remove(this),r=!1),r};var WTt,QTt=UTt;function UTt(e,t,i,n){var o=WTt.call(this)||this;return o._dictionary=new mPt,o._dictionary.update("Type",k.get("Annot")),o._dictionary.update("Subtype",k.get("Square")),void 0!==e&&void 0!==t&&void 0!==i&&void 0!==n&&(o.bounds={x:e,y:t,width:i,height:n}),o._type=QAt.rectangleAnnotation,o}Met(YTt,qTt=MTt),Object.defineProperty(YTt.prototype,"borderEffect",{get:function(){var e,t;return void 0===this._borderEffect&&((e=new uDt)._dictionary=this._dictionary,this._dictionary.has("BE")?(t=this._dictionary.get("BE"),e._intensity=t.get("I"),e._style=HMt(t.get("S").name)):e._style=IAt.solid,this._borderEffect=e),this._borderEffect},set:function(e){void 0!==e&&(this._borderEffect=e)},enumerable:!0,configurable:!0}),Object.defineProperty(YTt.prototype,"lineExtension",{get:function(){var e;return void 0===this._lineExtension&&this._dictionary.has("LLE")&&void 0!==(e=this._dictionary.get("LLE"))&&0<=e&&(this._lineExtension=e),this._lineExtension},set:function(e){if(!Number.isNaN(e)){if(!(0<=e))throw new Error("LineExtension should be non negative number");this._dictionary.update("LLE",e),this._lineExtension=e}},enumerable:!0,configurable:!0}),YTt._load=function(e,t){var i=new YTt;return i._isLoaded=!0,i._initialize(e,t),i},YTt.prototype._initialize=function(e,t){qTt.prototype._initialize.call(this,e,t)},YTt.prototype._postProcess=function(e){if(void 0===this._points||null===this._points)throw new Error("Points cannot be null or undefined");this._dictionary.has("LLE")||(this.lineExtension=0),this._dictionary.has("C")||(this.color=[0,0,0],this._isTransparentColor=!0),this._dictionary.has("BS")?r=this.border.width:((o=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",o)),void 0===r&&(r=1);for(var t=[],i=0;i<this._points.length;i++){var n=this._points[Number.parseInt(i.toString(),10)];t.push(n)}this._points=this._getPoints(this._points),t[0]===t[t.length-2]&&t[1]===t[t.length-1]||(this._points.push(this._points[0]),this._points.push(this._points[1]));var o,r=this._getBoundsValue(this._points),r=[r.x,r.y,r.x+r.width,r.y+r.height];this._dictionary.update("Rect",r),this._dictionary.update("LLE",this._lineExtension),(this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._appearanceTemplate=this._createPolygonAppearance(e)),this._dictionary.update("Vertices",this._points),void 0===this._intensity&&void 0!==this._borderEffect&&this._borderEffect.style===IAt.cloudy&&((o=new mPt(this._crossReference)).set("I",this.borderEffect._intensity),this.borderEffect._style===IAt.cloudy&&o.set("S",k.get("C")),this._dictionary.update("BE",o))},YTt.prototype._doPostProcess=function(e){var t,i,n;this._flatten=e=void 0===e?!1:e,this._isLoaded?(this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._appearanceTemplate=this._createPolygonAppearance(e)):this._postProcess(e),!this._appearanceTemplate&&e&&this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"),n=t.getRaw("N"),i)&&(n&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference)),void 0!==this.flattenPopups&&this.flattenPopups&&this._isLoaded&&this._flattenLoadedPopUp(),e&&(this._appearanceTemplate?(t=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary),this._appearanceTemplate._content.dictionary.has("Matrix")||(i=this._appearanceTemplate._content.dictionary.getArray("BBox"))&&2<=i.length&&this._appearanceTemplate._content.dictionary.update("Matrix",[1,0,0,1,-i[0],-i[1]]),this._flattenAnnotationTemplate(this._appearanceTemplate,t)):this._page.annotations.remove(this)),!e&&this._setAppearance&&(i=void 0,this._dictionary.has("AP")?i=this._dictionary.get("AP"):(t=this._crossReference._getNextReference(),i=new mPt(this._crossReference),this._crossReference._cacheMap.set(t,i),this._dictionary.update("AP",t)),xkt(i,this._crossReference,"N"),n=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(n,this._appearanceTemplate._content),i.update("N",n))},YTt.prototype._createPolygonAppearance=function(e){var t,i,n,o,r;return void 0!==e&&e?(e=void 0,t=void(this.color&&0<this.border.width&&(e=new yIt(this.color,this.border.width))),this.innerColor&&(t=new fIt(this.innerColor)),i=this._page.graphics,(e||t)&&((n=void 0)!==this.opacity&&this._opacity<1&&(n=i.save(),i.setTransparency(this._opacity)),0!==this.borderEffect.intensity&&this.borderEffect.style===IAt.cloudy?(o=4*this.borderEffect.intensity+.5*this.border.width,(r=new nIt).addPolygon(this._getLinePoints()),this._drawCloudStyle(i,t,e,o,.833,r._points,!1)):i.drawPolygon(this._getLinePoints(),e,t),void 0!==this.opacity)&&this._opacity<1&&i.restore(n),i._template):(e={x:0,y:0,width:0,height:0},(t=void 0)===this._points&&this._dictionary.has("Vertices")&&(this._points=this._dictionary.get("Vertices")),t=this._getBoundsValue(this._points),void 0!==this._borderEffect&&void 0!==this.borderEffect.intensity&&0!==this.borderEffect.intensity&&this._borderEffect.style===IAt.cloudy?(e.x=t.x-5*this.borderEffect.intensity-this.border.width,e.y=t.y-5*this.borderEffect.intensity-this.border.width,e.width=t.width+10*this.borderEffect.intensity+2*this.border.width,e.height=t.height+10*this.borderEffect.intensity+2*this.border.width):(e.x=t.x-this.border.width,e.y=t.y-this.border.width,e.width=t.width+2*this.border.width,e.height=t.height+2*this.border.width),(n=new ATt(this,[e.x,e.y,e.width,e.height])).normal=new _It([e.x,e.y,e.width,e.height],this._crossReference),nkt(t=n.normal,this._getRotationAngle()),t._writeTransformation=!1,i=n.normal.graphics,n=new mDt,this.innerColor&&(n.backBrush=new fIt(this._innerColor)),0<this.border.width&&this.color&&(n.borderPen=new yIt(this._color,this.border.width)),this.color&&(n.foreBrush=new fIt(this._color)),void 0!==this.opacity&&this._opacity<1?(i.save(),i.setTransparency(this._opacity)):i.save(),Kkt(this.borderEffect)&&Kkt(this.borderEffect.intensity)&&0!==this.borderEffect.intensity&&this.borderEffect.style===IAt.cloudy?(o=4*this.borderEffect.intensity+.5*this.border.width,(r=new nIt).addPolygon(this._getLinePoints()),this._drawCloudStyle(i,n.backBrush,n.borderPen,o,.833,r._points,!1)):i.drawPolygon(this._getLinePoints(),n.borderPen,n.backBrush),void 0!==this.opacity&&this._opacity<1&&i.restore(),i.restore(),this._isBounds&&(t._content.dictionary._updated=!0,this._dictionary.update("LLE",this.lineExtension),this._dictionary.update("Vertices",this._points)),this._dictionary.update("Rect",[e.x,e.y,e.x+e.width,e.y+e.height]),t)},YTt.prototype._getLinePoints=function(){var e=this._page.size,t=e[1],i=e[0];if(this._dictionary.has("Vertices")&&!this._isBounds){var e=void 0,n=(this._page._pageDictionary.has("Rotate")&&(e=this._page._pageDictionary.get("Rotate")),this._page&&this._page.rotation&&(this._page.rotation===TAt.angle90?e=90:this._page.rotation===TAt.angle180?e=180:this._page.rotation===TAt.angle270&&(e=270)),this._dictionary.getArray("Vertices"));if(n){var o=[];n.forEach(function(e){o.push(e)});for(var r=[],s=0;s<o.length;s+=2)this.flatten?r.push([o[Number.parseInt(s.toString(),10)],t-o[s+1]]):r.push([o[Number.parseInt(s.toString(),10)],-o[s+1]]);if(e)if(270===e)for(var a=0;a<r.length;a++){var l=r[Number.parseInt(a.toString(),10)][0];r[Number.parseInt(a.toString(),10)][0]=r[Number.parseInt(a.toString(),10)][1],r[Number.parseInt(a.toString(),10)][1]=i-l}else if(90===e)for(a=0;a<r.length;a++){l=r[Number.parseInt(a.toString(),10)][0];0!==this._page._origin[1]?r[Number.parseInt(a.toString(),10)][0]=t-(r[Number.parseInt(a.toString(),10)][1]-t):r[Number.parseInt(a.toString(),10)][0]=t-r[Number.parseInt(a.toString(),10)][1],r[Number.parseInt(a.toString(),10)][1]=l}else if(180===e)for(a=0;a<r.length;a++){l=r[Number.parseInt(a.toString(),10)][0];r[Number.parseInt(a.toString(),10)][0]=i-l,r[Number.parseInt(a.toString(),10)][1]=t-r[Number.parseInt(a.toString(),10)][1]}}}else if(this._points){var h=[];this._points.forEach(function(e){h.push(e)}),r=[];for(s=0;s<this._points.length;s+=2)this.flatten?r.push([h[Number.parseInt(s.toString(),10)],t-h[s+1]]):r.push([h[Number.parseInt(s.toString(),10)],-h[s+1]])}return r};var qTt,GTt=YTt;function YTt(e){var t=qTt.call(this)||this;return t._dictionary=new mPt,t._dictionary.update("Type",k.get("Annot")),t._dictionary.update("Subtype",k.get("Polygon")),void 0!==e&&(t._points=e),t._type=QAt.polygonAnnotation,t}Met(JTt,XTt=MTt),Object.defineProperty(JTt.prototype,"beginLineStyle",{get:function(){var e;return this._dictionary.has("LE")&&(e=this._dictionary.getArray("LE"))&&Array.isArray(e)&&(this._beginLine=jMt(e[0].name)),this._beginLine},set:function(e){var t;e!==this._beginLine&&(this._beginLine=e,this._dictionary)&&((t=[]).push(k.get(zMt(e))),t.push(k.get(zMt(this.endLineStyle))),this._dictionary.update("LE",t))},enumerable:!0,configurable:!0}),Object.defineProperty(JTt.prototype,"endLineStyle",{get:function(){var e;return this._dictionary.has("LE")&&(e=this._dictionary.getArray("LE"))&&Array.isArray(e)&&(this._endLine=jMt(e[1].name)),this._endLine},set:function(e){var t;e!==this._endLine&&(this._endLine=e,this._dictionary)&&((t=[]).push(k.get(zMt(this.beginLineStyle))),t.push(k.get(zMt(e))),this._dictionary.update("LE",t))},enumerable:!0,configurable:!0}),Object.defineProperty(JTt.prototype,"lineExtension",{get:function(){var e;return void 0===this._lineExtension&&this._dictionary.has("LLE")&&void 0!==(e=this._dictionary.get("LLE"))&&0<=e&&(this._lineExtension=e),this._lineExtension},set:function(e){if(!Number.isNaN(e)){if(!(0<=e))throw new Error("LineExtension should be non negative number");this._dictionary.update("LLE",e),this._lineExtension=e}},enumerable:!0,configurable:!0}),JTt._load=function(e,t){var i=new JTt;return i._isLoaded=!0,i._initialize(e,t),i},JTt.prototype._initialize=function(e,t){XTt.prototype._initialize.call(this,e,t)},JTt.prototype._postProcess=function(e){if(void 0===this._points||null===this._points)throw new Error("Points cannot be null or undefined");this._dictionary.has("LLE")||(this.lineExtension=0),this._dictionary.has("C")||(this.color=[0,0,0],this._isTransparentColor=!0),this._dictionary.has("BS")?r=this.border.width:((o=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",o)),void 0===r&&(r=1);var t=this._getLinePoints(),i=[];i.push(0);for(var n=1;n<t.length;n++)i.push(1);this._polylinePoints=t,this._pathTypes=i;var o=new nIt,r=(o._points=t,o._pathTypes=i,this._dictionary.update("Vertices",this._points),[]),o=(r.push(k.get(zMt(this.beginLineStyle))),r.push(k.get(zMt(this.endLineStyle))),this._dictionary.update("LE",r),this._dictionary.update("LLE",this._lineExtension),this._getBoundsValue(this._points)),r=[o.x,o.y,o.x+o.width,o.y+o.height];this._dictionary.update("Rect",r),(this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._appearanceTemplate=this._createPolyLineAppearance(e))},JTt.prototype._doPostProcess=function(e){var t,i,n;this._flatten=e=void 0===e?!1:e,this._isLoaded?((this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._appearanceTemplate=this._createPolyLineAppearance(e)),!this._appearanceTemplate&&e&&this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"),n=t.getRaw("N"),i)&&(n&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference))):(this._postProcess(e),!this._appearanceTemplate&&e&&(this._dictionary.has("AP")?(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"),n=t.getRaw("N"),i)&&(n&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference)):this._appearanceTemplate=this._createPolyLineAppearance(e))),void 0!==this.flattenPopups&&this.flattenPopups&&this._isLoaded&&this._flattenLoadedPopUp(),e&&(this._appearanceTemplate?(t=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary),this._appearanceTemplate._content.dictionary.has("Matrix")||(i=this._appearanceTemplate._content.dictionary.getArray("BBox"))&&this._appearanceTemplate._content.dictionary.update("Matrix",[1,0,0,1,-i[0],-i[1]]),this._flattenAnnotationTemplate(this._appearanceTemplate,t)):this._page.annotations.remove(this)),!e&&this._setAppearance&&(i=void 0,this._dictionary.has("AP")?i=this._dictionary.get("AP"):(t=this._crossReference._getNextReference(),i=new mPt(this._crossReference),this._crossReference._cacheMap.set(t,i),this._dictionary.update("AP",t)),xkt(i,this._crossReference,"N"),n=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(n,this._appearanceTemplate._content),i.update("N",n))},JTt.prototype._createPolyLineAppearance=function(e){var t=this.color||[0,0,0];if(void 0!==e&&e){var e=void 0,i=(0<this.border.width&&(e=new yIt(t,this.border.width)),this._page.graphics);if(e){var n=void 0,o=(void 0!==this.opacity&&this._opacity<1&&(n=i.save(),i.setTransparency(this._opacity)),this._getLinePoints()),r=[];if(r.push(0),o&&0<o.length){for(var s=1;s<o.length;s++)r.push(1);(l=new nIt)._points=o,l._pathTypes=r,i.drawPath(l,e),void 0!==this.opacity&&this._opacity<1&&i.restore(n)}}return i._template}var e=void 0,n={x:0,y:0,width:0,height:0},e=(void 0===this._points&&this._dictionary.has("Vertices")&&(this._points=this._dictionary.get("Vertices")),this._getBoundsValue(this._points)),e=(n.x=e.x-this.border.width,n.y=e.y-this.border.width,n.width=e.width+2*this.border.width,n.height=e.height+2*this.border.width,new ATt(this,[n.x,n.y,n.width,n.height])),a=(e.normal=new _It([n.x,n.y,n.width,n.height],this._crossReference),e.normal),i=(nkt(a,this._getRotationAngle()),a._writeTransformation=!1,e.normal.graphics),e=new mDt,l=(this.innerColor&&(e.backBrush=new fIt(this._innerColor)),0<this.border.width&&t&&(e.borderPen=new yIt(t,this.border.width)),t&&(e.foreBrush=new fIt(t)),void 0!==this.opacity&&this._opacity<1?(i.save(),i.setTransparency(this._opacity)):i.save(),new nIt);if(void 0!==this._polylinePoints&&null!==this._polylinePoints?l._points=this._polylinePoints:l._points=this._getLinePoints(),void 0===this._pathTypes||null===this._polylinePoints){this._pathTypes=[],this._pathTypes.push(0);for(s=1;s<l._points.length;s++)this._pathTypes.push(1)}return l._pathTypes=this._pathTypes,i.drawPath(l,e.borderPen,e.backBrush),void 0!==this.opacity&&this._opacity<1&&i.restore(),i.restore(),this._isBounds&&(a._content.dictionary._updated=!0,(t=[]).push(k.get(zMt(this.beginLineStyle))),t.push(k.get(zMt(this.endLineStyle))),this._dictionary.update("LE",t),this._dictionary.update("LLE",this.lineExtension),this._dictionary.update("Vertices",this._points)),this._dictionary.update("Rect",[n.x,n.y,n.x+n.width,n.y+n.height]),a},JTt.prototype._getLinePoints=function(){var e=this._page.size[1];if(this._dictionary.has("Vertices")&&!this._isBounds&&(!this._setAppearance||this._setAppearance&&this.flatten)){var t=this._dictionary.getArray("Vertices");if(t)for(var i=[],n=0;n<t.length;n+=2)i.push([t[Number.parseInt(n.toString(),10)],e-t[n+1]])}else if(this._points){this._points=this._getPoints(this._points);var o=[];this._points.forEach(function(e){o.push(e)}),i=[];for(n=0;n<o.length;n+=2)this.flatten?i.push([o[Number.parseInt(n.toString(),10)],e-o[n+1]]):i.push([o[Number.parseInt(n.toString(),10)],-o[n+1]])}return i};var XTt,KTt=JTt;function JTt(e){var t=XTt.call(this)||this;return t._beginLine=wAt.none,t._endLine=wAt.none,t._dictionary=new mPt,t._dictionary.update("Type",k.get("Annot")),t._dictionary.update("Subtype",k.get("PolyLine")),t._points=void 0!==e?e:[],t._type=QAt.polyLineAnnotation,t}Met(eEt,ZTt=MTt),Object.defineProperty(eEt.prototype,"measure",{get:function(){return void 0===this._measure&&this._dictionary.has("Measure")&&(this._measure=this._dictionary.get("Measure")),this._measure},set:function(e){e&&!this._isLoaded&&(this._measure=e,this.caption.cap=!0)},enumerable:!0,configurable:!0}),eEt._load=function(e,t){var i=new eEt;return i._isLoaded=!0,i._initialize(e,t),i},eEt.prototype._initialize=function(e,t){ZTt.prototype._initialize.call(this,e,t)},eEt.prototype._postProcess=function(){if(!this._pointArray)throw new Error("Points cannot be null or undefined");var e,t;this._dictionary.has("BS")?e=this.border.width:((t=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",t)),this._dictionary.has("C")||(this.color=[0,0,0],this._isTransparentColor=!0),void 0===e&&(e=1),this._appearanceTemplate=this._createAngleMeasureAppearance()},eEt.prototype._doPostProcess=function(e){var t,i,n;void 0===e&&(e=!1),this._isLoaded?(!e&&this._setAppearance&&(this._appearanceTemplate=this._createAngleMeasureAppearance()),!this._appearanceTemplate&&e&&this._dictionary.has("AP")&&(i=this._dictionary.get("AP"))&&i.has("N")&&(t=i.get("N"),n=i.getRaw("N"),t)&&(n&&(t.reference=n),this._appearanceTemplate=new _It(t,this._crossReference))):(this._postProcess(),this._appearanceTemplate||e&&(this._dictionary.has("AP")?(i=this._dictionary.get("AP"))&&i.has("N")&&(t=i.get("N"),n=i.getRaw("N"),t)&&(n&&(t.reference=n),this._appearanceTemplate=new _It(t,this._crossReference)):this._appearanceTemplate=this._createAngleMeasureAppearance())),e&&this._appearanceTemplate?(i=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary),this._appearanceTemplate._content.dictionary.has("Matrix")||(n=this._appearanceTemplate._content.dictionary.getArray("BBox"))&&this._appearanceTemplate._content.dictionary.update("Matrix",[1,0,0,1,-n[0],-n[1]]),this._flattenAnnotationTemplate(this._appearanceTemplate,i)):e&&this._page.annotations.remove(this)},eEt.prototype._createAngleMeasureAppearance=function(){var e=this.border.width,t=this._obtainFont(),i=(null!=t&&(this._isLoaded||1!==t.size)||(t=this._circleCaptionFont,this._pdfFont=t),new E1t(MAt.center,T1t.middle)),n=this._calculateAngle()*(180/Math.PI),o=(180<(n=n<0?-n:n)&&(n=360-n),this._dictionary.update("Vertices",this._linePoints),"font:"+t._metrics._postScriptName+" "+t._size+"pt; color:"+this._colorToHex(this.color)),o=(this._dictionary.update("DS",o),(this.text===" "+n.toFixed(2)+"°"||this.text)&&this._dictionary.update("Contents",this.text),void 0===this.subject&&this._dictionary.update("Subject","Angle Measurement"),this._dictionary.update("MeasurementTypes",1152),this._dictionary.update("Subtype",new k("PolyLine")),this._dictionary.update("IT",new k("PolyLineAngle")),new mPt),r=[],s=[],a=[],l=[],h=[],d=(o.set("Type",k.get("measureDictionary")),o.set("R","1 in = 1 in"),o.set("Subtype","RL"),o.set("TargetUnitConversion",.1388889),new mPt),d=(d.set("U","in"),d.set("Type","NumberFormat"),d.set("C",1),d.set("D",1),d.set("SS",""),r.push(d),new mPt),d=(d.set("U","°"),d.set("Type","NumberFormat"),d.set("C",1),d.set("D",1),d.set("FD",!0),d.set("SS",""),s.push(d),new mPt),d=(d.set("U","sq in"),d.set("Type","NumberFormat"),d.set("C",1),d.set("D",1),d.set("FD",!0),d.set("SS",""),a.push(d),new mPt),d=(d.set("U","cu in"),d.set("Type","NumberFormat"),d.set("C",1),d.set("D",1),d.set("FD",!0),d.set("SS",""),h.push(d),new mPt),d=(d.set("U","in"),d.set("Type","NumberFormat"),d.set("C",1),d.set("D",1),d.set("SS",""),l.push(d),o.set("D",r),o.set("T",s),o.set("A",a),o.set("X",l),o.set("V",h),this._dictionary.has("Measure")&&xkt(this._dictionary,this._crossReference,"Measure"),this._crossReference._getNextReference()),r=(this._crossReference._cacheMap.set(d,o),o._updated=!0,this._dictionary.update("Measure",d),[0,0,0,0]),s=this._getAngleBoundsValue(),p=this._obtainLinePoints(),c=[];c.push(0);for(var u=1;u<p.length;u++)c.push(1);(new nIt).addRectangle(p[1][0]-this._radius,-(p[1][1]+this._radius),2*this._radius,2*this._radius);var a=t.measureString(n.toString()+"°",[0,0],i,0,0),l=[(this._firstIntersectionPoint[0]+this._secondIntersectionPoint[0])/2,(this._firstIntersectionPoint[1]+this._secondIntersectionPoint[1])/2],h=[p[1][0],-p[1][1]],o=p[1][0]+this._radius*Math.cos((this._startAngle+this._sweepAngle/2)*(Math.PI/180)),d=p[1][1]+this._radius*Math.sin((this._startAngle+this._sweepAngle/2)*(Math.PI/180)),i=[l[0],l[1]],l=Math.atan2(i[1]-h[1],i[0]-h[0])*(180/Math.PI),i=!1,h=!1,g=!1,m=!1,l=(0<l?l<45?h=!0:45<=l&&l<135?g=!0:i=!0:0==(l=-l)?(new nIt).addRectangle(s[0],s[1],s[2],s[3]):l<45?h=!0:45<=l&&l<135?m=!0:i=!0,0===r[0]&&0===r[1]&&0===r[2]&&0===r[3]&&(this.bounds={x:(r=s)[0],y:s[1],width:s[2],height:s[3]}),new nIt),s=(l._pathTypes=c,l._points=p,this._dictionary.set("Rect",[r[0],r[1],r[0]+r[2],r[1]+r[3]]),new ATt(this,s)),r=(s.normal=new _It(r,this._crossReference),s.normal),s=(r._writeTransformation=!1,s.normal.graphics),e=new yIt(this._color,e/2),f=(this.border.style===xAt.dashed&&(e._dashStyle=t1t.dash),new fIt(this._color)),e=(s.save(),s.drawPath(l,e),l.addArc(p[1][0]-this._radius,p[1][1]-this._radius,2*this._radius,2*this._radius,this._startAngle,this._sweepAngle),g?s.drawString(n.toString()+"°",t,[o-a[0]/2,-(-d+t._metrics._getHeight()+2),0,0],null,f):h?s.drawString(n.toString()+"°",t,[o+2,-(-d+t._metrics._getHeight()/2),0,0],null,f):i?s.drawString(n.toString()+"°",t,[o-a[0]-2,-(-d+t._metrics._getHeight()/2),0,0],null,f):m&&s.drawString(n.toString()+"°",t,[o-a[0]/2,d+2,0,0],null,f),s.restore(),s._template._content.dictionary._updated=!0,this._crossReference._getNextReference()),l=(this._crossReference._cacheMap.set(e,s._template._content),s._template._content.reference=e,this._dictionary.has("AP")&&xkt(this._dictionary.get("AP"),this._crossReference,"N"),new mPt);return l.set("N",e),l._updated=!0,this._dictionary.set("AP",l),r},eEt.prototype._getAngleBoundsValue=function(){for(var e=this._obtainLinePoints(),t=0;t<e.length;t++)e[Number.parseInt(t.toString(),10)][1]=-e[Number.parseInt(t.toString(),10)][1];var i=new nIt;return i._points=e,i._pathTypes=[0,1,1],i._getBounds()},eEt.prototype._obtainLinePoints=function(){if(this._linePoints){for(var e=new Array(this._linePoints.length),t=0;t<this._linePoints.length;t++)e[Number.parseInt(t.toString(),10)]=this._linePoints[Number.parseInt(t.toString(),10)];for(var i=new Array(e.length/2),n=0,o=0;o<e.length;o+=2)i[Number.parseInt(n.toString(),10)]=[e[Number.parseInt(o.toString(),10)],-e[o+1]],n++}return i},eEt.prototype._calculateAngle=function(){var e=[0,0];void 0!==this._linePoints&&0===this._linePoints.length&&this._isLoaded&&this._dictionary.has("Vertices")&&(this._linePoints=this._dictionary.get("Vertices"));for(var t=0;t<this._linePoints.length;t++)e[Number.parseInt(t.toString(),10)]=this._linePoints[Number.parseInt(t.toString(),10)];for(var i=[],n=0;n<e.length;n+=2)i.push([e[Number.parseInt(n.toString(),10)],e[n+1]]);var o=i[0],r=i[1],s=i[2],a=Math.sqrt(Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)),l=Math.sqrt(Math.pow(r[0]-s[0],2)+Math.pow(r[1]-s[1],2)),a=(this._radius=Math.min(a,l)/4,new nIt),l=(a._points=i,a._pathTypes=[0,1,1],this._findLineCircleIntersectionPoints(r[0],r[1],this._radius,o,r,void 0,void 0)),a=(l.first,l.second),l=(0===this._firstIntersectionPoint[0]&&0===this._firstIntersectionPoint[1]&&(this._firstIntersectionPoint=a),(l=this._findLineCircleIntersectionPoints(r[0],r[1],this._radius,s,r,[0,0],[0,0])).first,a=l.second,0===this._secondIntersectionPoint[0]&&0===this._secondIntersectionPoint[1]&&(this._secondIntersectionPoint=a),this._firstIntersectionPoint[0]-r[0]),a=this._firstIntersectionPoint[1]-r[1],h=Math.atan2(a,l)*(180/Math.PI),l=this._secondIntersectionPoint[0]-r[0],a=this._secondIntersectionPoint[1]-r[1],a=0<(a=Math.atan2(a,l)*(180/Math.PI))?360-a:-a;return 180===(h=0<h?360-h:-h)&&0===a?(this._startAngle=h,this._sweepAngle=180):0===h&&180===a?(this._startAngle=a,this._sweepAngle=180):h<180?a<h?(this._startAngle=a,this._sweepAngle=h-a):h+180<a?(this._startAngle=a,this._sweepAngle=360-a+h):(this._startAngle=h,this._sweepAngle=a-h):h<a?(this._startAngle=h,this._sweepAngle=a-h):a<h-180?(this._startAngle=h,this._sweepAngle=360-h+a):(this._startAngle=a,this._sweepAngle=h-a),Math.atan2(s[0]-r[0],s[1]-r[1])-Math.atan2(o[0]-r[0],o[1]-r[1])},eEt.prototype._findLineCircleIntersectionPoints=function(e,t,i,n,o,r,s){var a,l=o[0]-n[0],o=o[1]-n[1],h=l*l+o*o,d=2*(l*(n[0]-e)+o*(n[1]-t)),e=d*d-4*h*((n[0]-e)*(n[0]-e)+(n[1]-t)*(n[1]-t)-i*i);return s=h<=1e-7||e<0?(r=[Number.NaN,Number.NaN],[Number.NaN,Number.NaN]):0==e?(r=[n[0]+(a=-d/(2*h))*l,n[1]+a*o],[Number.NaN,Number.NaN]):(a=(-d+Math.sqrt(e))/(2*h),r=[n[0]+a*l,n[1]+a*o],a=(-d-Math.sqrt(e))/(2*h),[n[0]+a*l,n[1]+a*o]),{first:r,second:s}};var ZTt,$Tt=eEt;function eEt(e){var t=ZTt.call(this)||this;if(t._linePoints=[],t._firstIntersectionPoint=[0,0],t._secondIntersectionPoint=[0,0],t._dictionary=new mPt,t._dictionary.update("Type",k.get("Annot")),t._dictionary.update("Subtype",k.get("PolyLine")),void 0!==e&&0<e.length){if(6<e.length)throw new Error("Points length should not be greater than 3");t._pointArray=e;for(var i=0;i<e.length;i++)t._linePoints.push(e[Number.parseInt(i.toString(),10)][0]),t._linePoints.push(e[Number.parseInt(i.toString(),10)][1])}return t._type=QAt.angleMeasurementAnnotation,t}Met(nEt,tEt=MTt),Object.defineProperty(nEt.prototype,"inkPointsCollection",{get:function(){var e;return 0===this._inkPointsCollection.length&&this._dictionary.has("InkList")&&(e=this._dictionary.get("InkList"),Array.isArray(e))&&0<e.length&&(this._inkPointsCollection=e),this._inkPointsCollection},set:function(e){Array.isArray(e)&&0<e.length&&e!==this._inkPointsCollection&&(this._inkPointsCollection=e,this._isModified=!0,this._isLoaded)&&this._dictionary.update("InkList",e)},enumerable:!0,configurable:!0}),nEt._load=function(e,t){var i=new nEt;return i._isLoaded=!0,i._initialize(e,t),i},nEt.prototype._initialize=function(e,t){tEt.prototype._initialize.call(this,e,t)},nEt.prototype._postProcess=function(){if(void 0===this._points||null===this._points)throw new Error("Points cannot be null or undefined");this._dictionary.has("BS")?t=this.border.width:((e=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",e)),this._dictionary.has("C")||(this.color=[0,0,0],this._isTransparentColor=!0),void 0===t&&(t=1);var e,t=this._addInkPoints(),i=[t[0],t[1],t[0]+t[2],t[1]+t[3]];this._dictionary.update("Rect",i),this._setAppearance&&((i=new ATt(this,t)).normal=new _It(t,this._crossReference),nkt(t=i.normal,this._getRotationAngle()),t._writeTransformation=!1,this._appearanceTemplate=this._createInkAppearance(t),this._dictionary.has("AP")&&xkt(this._dictionary.get("AP"),this._crossReference,"N"),e=new mPt,this._appearanceTemplate._content.dictionary._updated=!0,i=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(i,this._appearanceTemplate._content),this._appearanceTemplate._content.reference=i,e.set("N",i),e._updated=!0,this._dictionary.set("AP",e))},nEt.prototype._doPostProcess=function(e){var t,i,n,o,r,s,a;this._isFlatten=e=void 0===e?!1:e,this._isLoaded?((this._setAppearance||e&&!this._dictionary.has("AP"))&&(0===this._inkPointsCollection.length&&(this._inkPointsCollection=this._obtainInkListCollection()),t=this._getInkBoundsValue(),o=(i=new _It(t,this._crossReference))._content.dictionary.getArray("BBox"),n=this._getRotationAngle(),o&&null!=n&&i._content.dictionary.set("Matrix",[1,0,0,1,-o[0],-o[1]]),i._writeTransformation=!1,this._appearanceTemplate=this._createInkAppearance(i),this._dictionary.update("Rect",[t[0],t[1],t[0]+t[2],t[1]+t[3]]),e||(this._dictionary.has("AP")&&xkt(this._dictionary.get("AP"),this._crossReference,"N"),s=new mPt,this._appearanceTemplate._content.dictionary._updated=!0,r=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(r,this._appearanceTemplate._content),this._appearanceTemplate._content.reference=r,s.set("N",r),s._updated=!0,this._dictionary.set("AP",s))),!this._appearanceTemplate&&e&&this._dictionary.has("AP")&&(s=this._dictionary.get("AP"))&&s.has("N")&&(a=s.get("N"),r=s.getRaw("N"),a)&&(r&&(a.reference=r),this._appearanceTemplate=new _It(a,this._crossReference))):(this._postProcess(),this._appearanceTemplate||e&&(this._dictionary.has("AP")?(s=this._dictionary.get("AP"))&&s.has("N")&&(a=s.get("N"),r=s.getRaw("N"),a)&&(r&&(a.reference=r),this._appearanceTemplate=new _It(a,this._crossReference)):(0===this._inkPointsCollection.length&&(this._inkPointsCollection=this._obtainInkListCollection()),t=this._getInkBoundsValue(),nkt(i=new _It(t,this._crossReference),this._getRotationAngle()),i._writeTransformation=!1,this._appearanceTemplate=this._createInkAppearance(i),this._dictionary.update("Rect",[t[0],t[1],t[0]+t[2],t[1]+t[3]])))),void 0!==this.flattenPopups&&this.flattenPopups&&(this._isLoaded?this._flattenLoadedPopUp():this._flattenPopUp()),e&&this._appearanceTemplate&&null!==this._appearanceTemplate._size&&void 0!==this._appearanceTemplate._size?(n=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary),this._appearanceTemplate._content.dictionary.has("Matrix")||(o=this._appearanceTemplate._content.dictionary.getArray("BBox"))&&this._appearanceTemplate._content.dictionary.update("Matrix",[1,0,0,1,-o[0],-o[1]]),this._flattenAnnotationTemplate(this._appearanceTemplate,n)):e&&this._page.annotations.remove(this),e&&!this.flattenPopups&&this._dictionary.has("Popup")&&(r=this._dictionary.getRaw("Popup"),this._page._pageDictionary.has("Annots"))&&(s=this._page._pageDictionary.getRaw("Annots"))&&Array.isArray(s)&&0<s.length&&0<=(a=s.indexOf(r))&&this._page.annotations.removeAt(a)},nEt.prototype._createInkAppearance=function(e){var t=e.graphics;if(null!==this._inkPointsCollection&&0<this._inkPointsCollection.length&&null!==this.color&&void 0!==this._color){for(var i=0;i<this._inkPointsCollection.length;i++){var n=!1;if(this._inkPointsCollection[Number.parseInt(i.toString(),10)].length%2==0){for(var o=this._inkPointsCollection[Number.parseInt(i.toString(),10)],r=(2===o.length&&(o=[o[0]-.5,o[1]-.5,o[0]+.5,o[1]+.5],n=!0),new Array(o.length/2)),s=0,a=0;a<o.length;a+=2)r[Number.parseInt(s.toString(),10)]=[o[Number.parseInt(a.toString(),10)],o[a+1]],s++;var l=s+2*s-2,h=new Array(l);if(this._isEnableControlPoints)for(var d=this._getControlPoints(r,[],[]),p=d.controlP1,c=d.controlP2,u=0,g=0;g<l-1;g+=3)h[Number.parseInt(g.toString(),10)]=r[Number.parseInt(u.toString(),10)],h[g+1]=p[Number.parseInt(u.toString(),10)],h[g+2]=c[Number.parseInt(u.toString(),10)],u++;else if(s%3==1)l=s,h=new Array(l),h=r;else if(s%3==0)for(l=s+1,h=new Array(l),g=0;g<r.length;g++)h[Number.parseInt(g.toString(),10)]=r[Number.parseInt(g.toString(),10)];else{l=s+2,h=new Array(l);for(g=0;g<r.length;g++)h[Number.parseInt(g.toString(),10)]=r[Number.parseInt(g.toString(),10)];h[l-2]=r[r.length-2]}if(h[l-1]=r[r.length-1],null!==h){for(var m=h,f=0;f<m.length;f++){var y=m[Number.parseInt(f.toString(),10)];m[Number.parseInt(f.toString(),10)]=[y[0],-y[1]]}var v,d=new nIt,b=null,n=(n?(n=r[1][0]-r[0][0],v=r[1][1]-r[0][1],d.addEllipse(r[0][0]+.5,-(r[0][1]+v+.5),n,v),(b=new nIt)._pathTypes=d._pathTypes,b._points=d._points):2===r.length?(d.addLine(r[0][0],-r[0][1],r[1][0],-r[1][1]),(b=new nIt)._pathTypes=d._pathTypes,b._points=d._points):(d._addBezierPoints(m),(b=new nIt)._pathTypes=d._pathTypes,b._points=m),new yIt(this.color,this.border.width));this._isLoaded&&(n._lineCap=i1t.round),void 0!==this.opacity&&this._opacity<1?(v=t.save(),t.setTransparency(this._opacity),t.drawPath(b,n),t.restore(v)):t.drawPath(b,n)}}}this._isFlatten&&(this.bounds={x:this.bounds.x,y:this._page.size[1]-(this.bounds.y+this.bounds.height),width:this.bounds.width,height:this.bounds.height})}return e},nEt.prototype._getControlPoints=function(e,t,i){if(null===e)throw new Error("pointCollection");var n=e.length-1;if(n<1)throw new Error("At least two knot PointFs required pointCollection");1===n&&(i=[[2*(t=[[(2*e[0][0]+e[1][0])/3,(2*e[0][1]+e[1][1])/3]])[0][0]-e[0][0],2*t[0][1]-e[0][1]]]);for(var o=[],r=1;r<n-1;++r)o[Number.parseInt(r.toString(),10)]=4*e[Number.parseInt(r.toString(),10)][0]+2*e[r+1][0];o[0]=e[0][0]+2*e[1][0],o[n-1]=(8*e[n-1][0]+e[Number.parseInt(n.toString(),10)][0])/2;for(var s=this._getSingleControlPoint(o),r=1;r<n-1;++r)o[Number.parseInt(r.toString(),10)]=4*e[Number.parseInt(r.toString(),10)][1]+2*e[r+1][1];o[0]=e[0][1]+2*e[1][1],o[n-1]=(8*e[n-1][1]+e[Number.parseInt(n.toString(),10)][1])/2;var a=this._getSingleControlPoint(o);t=new Array(n),i=new Array(n);for(var l,h,r=0;r<n;++r)t[Number.parseInt(r.toString(),10)]=[s[Number.parseInt(r.toString(),10)],a[Number.parseInt(r.toString(),10)]],r<n-1?i[Number.parseInt(r.toString(),10)]=[2*e[r+1][0]-s[r+1],2*e[r+1][1]-a[r+1]]:(l=(e[Number.parseInt(n.toString(),10)][0]+s[n-1])/2,h=(e[Number.parseInt(n.toString(),10)][1]+a[n-1])/2,i[Number.parseInt(r.toString(),10)]=[l,h]);return{controlP1:t,controlP2:i}},nEt.prototype._getSingleControlPoint=function(e){var t=e.length,i=[],n=[],o=2;i[0]=e[0]/o;for(var r=1;r<t;r++)n[Number.parseInt(r.toString(),10)]=1/o,o=(r<t-1?4:3.5)-n[Number.parseInt(r.toString(),10)],i[Number.parseInt(r.toString(),10)]=(e[Number.parseInt(r.toString(),10)]-i[r-1])/o;for(r=1;r<t;r++)i[t-r-1]-=n[t-r]*i[t-r];return i},nEt.prototype._addInkPoints=function(){var t=this,e=[],i=(null===this._linePoints||0!==this._previousCollection.length&&!this._isModified||this._inkPointsCollection.unshift(this._linePoints),Hkt(this._inkPointsCollection,this._previousCollection));if(null!==this._inkPointsCollection&&!i){for(var n=0;n<this._inkPointsCollection.length;n++){var o=this._inkPointsCollection[Number.parseInt(n.toString(),10)].slice();e.push(o)}this._dictionary.update("InkList",e)}0<this._inkPointsCollection.length&&(!i||this._isModified)&&this._inkPointsCollection.forEach(function(e){t._previousCollection.push(e),t._isModified=!1});var r=this._getCropOrMediaBox(),i=!1;if(r&&3<r.length&&"number"==typeof r[0]&&"number"==typeof r[1]&&(0!==r[0]||0!==r[1])){for(i=!0,n=0;n<e.length;n++)for(var s=o=e[Number.parseInt(n.toString(),10)],a=0;a<o.length;a+=2){var l=o[Number.parseInt(a.toString(),10)],h=o[a+1];l+=r[0],this._page._pageDictionary.has("MediaBox")&&!this._page._pageDictionary.has("CropBox")&&0===r[3]&&0<r[1]?h+=r[3]:h+=r[1],s[Number.parseInt(a.toString(),10)]=l,s[a+1]=h,e[Number.parseInt(n.toString(),10)]=s}this._dictionary.update("InkList",e)}return this._isEnableControlPoints||i?this._getInkBoundsValue(e):(this._isFlatten||this._updateInkListCollection(e),[this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height])},nEt.prototype._updateInkListCollection=function(e){for(var t=0;t<e.length;t++){for(var i=[],n=0;n<e[Number.parseInt(t.toString(),10)].length;n++)i.push(e[Number.parseInt(t.toString(),10)][Number.parseInt(n.toString(),10)]);this._inkPointsCollection[Number.parseInt(t.toString(),10)]=i}},nEt.prototype._getInkBoundsValue=function(e){var t=[0,0,0,0],i=(this._points&&(this.bounds={x:this._points[0],y:this._points[1],width:this._points[2],height:this._points[3]}),t=[this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height],this.border.width);if(null!==this._inkPointsCollection&&0<this._inkPointsCollection.length){for(var n=[],o=0;o<this._inkPointsCollection.length;o++){var r=this._inkPointsCollection[Number.parseInt(o.toString(),10)];if(null!==r&&r.length%2==0)for(var s=0;s<r.length;s++)n.push(r[Number.parseInt(s.toString(),10)])}for(var a=!1,l=(this._isLoaded||2!==n.length||(a=!0,n.push(n[0]+1),n.push(n[1]+1)),new Array(n.length/2)),h=0,s=0;s<n.length;s+=2)l[Number.parseInt(h.toString(),10)]=[n[Number.parseInt(s.toString(),10)],n[s+1]],h++;if(this._isLoaded)if(0<l.length){for(var d=0,p=0,c=0,u=0,g=!0,o=0;o<l.length;o++){var m=l[Number.parseInt(o.toString(),10)];g?(d=m[0],p=m[1],g=!1):(m[0]<d?d=m[0]:m[0]>c&&(c=m[0]),m[1]<p?p=m[1]:m[1]>u&&(u=m[1]))}this.bounds={x:(t=[d,p,c-d,u-p])[0],y:t[1],width:t[2],height:t[3]},(this._isFlatten||this._setAppearance)&&(t[0]=this.bounds.x-i,t[1]=this.bounds.y-i,t[2]=this.bounds.width+2*i,t[3]=this.bounds.height+2*i)}else t=this._points||(0<l.length?this._dictionary.get("Rect"):[this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height]);else t=e?this._calculateInkBounds(l,t,i,a,e):this._calculateInkBounds(l,t,i,a);this.bounds={x:t[0],y:t[1],width:t[2],height:t[3]}}return t},nEt.prototype._calculateInkBounds=function(e,t,i,n,o){if(5<e.length){for(var r=0,s=0,a=0,l=0,h=!0,d=0;d<e.length;d++){var p=e[Number.parseInt(d.toString(),10)];h?(r=p[0],s=p[1],a=p[0],l=p[1],h=!1):(p[0]<r?r=p[0]:p[0]>a&&(a=p[0]),p[1]<s?s=p[1]:p[1]>l&&(l=p[1]))}var c=this._getCropOrMediaBox();t[2]<a?a=t[2]:c&&(a-=r),t[3]<l?l=t[3]:c&&(l-=s),c&&(r+=c[0],s+=c[1]),t=[r,s,a,l],(this._isFlatten||this._setAppearance)&&(c=n?2:3,t[0]=t[0]-i,t[1]=t[1]-i,t[2]=t[2]+c*i,t[3]=t[3]+c*i)}else t=void 0===this._points&&0<e.length?this._dictionary.get("Rect"):this._points;return!this._isFlatten&&o&&this._updateInkListCollection(o),t},nEt.prototype._obtainInkListCollection=function(){var e=[];if(this._dictionary.has("InkList"))for(var t=this._dictionary.getArray("InkList"),i=[],n=0;n<t.length;n++){for(var o=t[Number.parseInt(n.toString(),10)],r=0;r<o.length;r++)i.push(o[Number.parseInt(r.toString(),10)]);e.push(i),i.length===o.length&&(i=[])}return e};var tEt,iEt=nEt;function nEt(e,t){var i=tEt.call(this)||this;return i._inkPointsCollection=[],i._previousCollection=[],i._isModified=!1,i._isEnableControlPoints=!0,i._dictionary=new mPt,i._dictionary.update("Type",k.get("Annot")),i._dictionary.update("Subtype",k.get("Ink")),void 0!==e&&(i._points=e,i.bounds={x:e[0],y:e[1],width:e[2],height:e[3]}),void 0!==t&&(i._linePoints=t),i._type=QAt.inkAnnotation,i}Met(sEt,oEt=MTt),Object.defineProperty(sEt.prototype,"open",{get:function(){return this._dictionary.has("Open")&&(this._open=this._dictionary.get("Open")),this._open},set:function(e){void 0!==e&&(this._open=e,this._dictionary.update("Open",this._open))},enumerable:!0,configurable:!0}),Object.defineProperty(sEt.prototype,"icon",{get:function(){return this._dictionary.has("Name")&&(this._icon=pkt(this._dictionary.get("Name").name)),this._icon},set:function(e){void 0!==e&&(this._icon=e,this._dictionary.update("Name",k.get(this._obtainIconName(this._icon))))},enumerable:!0,configurable:!0}),Object.defineProperty(sEt.prototype,"stateModel",{get:function(){return this._dictionary.has("StateModel")&&(this._stateModel=mkt(this._dictionary.get("StateModel"))),this._stateModel},set:function(e){void 0!==e&&(this._stateModel=e,this._dictionary.update("StateModel",gkt(this._stateModel)))},enumerable:!0,configurable:!0}),Object.defineProperty(sEt.prototype,"state",{get:function(){return this._dictionary.has("State")&&(this._state=ukt(this._dictionary.get("State"))),this._state},set:function(e){void 0!==e&&(this._state=e,this._dictionary.update("State",ckt(this._state)))},enumerable:!0,configurable:!0}),sEt._load=function(e,t){var i=new sEt;return i._isLoaded=!0,i._initialize(e,t),t.has("IRT")&&(i._isReview=Ckt(t),i._isReview||(i._isComment=Skt(t))),i},sEt.prototype._initialize=function(e,t){oEt.prototype._initialize.call(this,e,t)},sEt.prototype._postProcess=function(){void 0!==this.bounds&&null!==this.bounds||(this._bounds={x:0,y:0,width:0,height:0}),this._dictionary.has("BS")?t=this.border.width:((e=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",e)),void 0===t&&(t=1);var e,t=[this.bounds.x,this.bounds.y,this.bounds.x+this.bounds.width,this.bounds.y+this.bounds.height];this._dictionary.update("Rect",t),this._setAppearance&&(this._appearanceTemplate=this._createPopupAppearance(),this._appearanceTemplate)&&(this._dictionary.has("AP")&&xkt(this._dictionary.get("AP"),this._crossReference,"N"),e=new mPt,this._appearanceTemplate._content.dictionary._updated=!0,t=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(t,this._appearanceTemplate._content),this._appearanceTemplate._content.reference=t,e.set("N",t),e._updated=!0,this._dictionary.set("AP",e)),this._dictionary.update("Rect",jkt(this))},sEt.prototype._doPostProcess=function(e){var t,i,n,o;void 0===e&&(e=!1),this._isLoaded?!this._appearanceTemplate&&this._isFlattenPopups&&this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"),n=t.getRaw("N"),i&&(n&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference)),null!==this._appearanceTemplate)&&(o=this._page.graphics.save(),this.opacity<1&&this._page.graphics.setTransparency(this.opacity),this._page.graphics.drawTemplate(this._appearanceTemplate,this.bounds),this._page.graphics.restore(o)):(this._postProcess(),this._appearanceTemplate||e&&(this._dictionary.has("AP")?(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"),n=t.getRaw("N"),i)&&(n&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference)):this._appearanceTemplate=this._createPopupAppearance())),void 0!==this.flattenPopups&&this.flattenPopups&&this.flatten&&(this._isLoaded?this._flattenLoadedPopUp():this._flattenPopUp()),e&&this._appearanceTemplate&&(o=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary),this._flattenAnnotationTemplate(this._appearanceTemplate,o)),e&&this._removeAnnotation(this._page,this)},sEt.prototype._createPopupAppearance=function(){var e=[0,0,this.bounds.width,this.bounds.height],e=new _It(e,this._crossReference),t=e.graphics;switch(t._sw._clear(),this.opacity<1&&(t.save(),t.setTransparency(this.opacity)),this.icon){case OAt.comment:t._sw._write(this._comment),t._sw._setColorSpace(this.color,m1t.rgb,!1),t._sw._write(this._commentSecondHalf);break;case OAt.paragraph:t._sw._write(this._paragraph),t._sw._setColorSpace(this.color,m1t.rgb,!1),t._sw._write(this._paragraphSecondHalf);break;case OAt.help:t._sw._write(this._help),t._sw._setColorSpace(this.color,m1t.rgb,!1),t._sw._write(this._helpSecondHalf);break;case OAt.note:t._sw._setColorSpace(this.color,m1t.rgb,!1),t._sw._write(this._note);break;case OAt.insert:t._sw._write("0 G "),t._sw._setColorSpace(this.color,m1t.rgb,!1),t._sw._write(this._insert);break;case OAt.key:t._sw._write(this._key),t._sw._setColorSpace(this.color,m1t.rgb,!1),t._sw._write(this._keySecondHalf);break;case OAt.newParagraph:t._sw._write(this._newParagraph),t._sw._setColorSpace(this.color,m1t.rgb,!1),t._sw._write(this._newParagraphSecondHalf)}return this.opacity<1&&t.restore(),e},sEt.prototype._obtainIconName=function(e){switch(e){case OAt.note:this._iconString="Note";break;case OAt.comment:this._iconString="Comment";break;case OAt.help:this._iconString="Help";break;case OAt.insert:this._iconString="Insert";break;case OAt.key:this._iconString="Key";break;case OAt.newParagraph:this._iconString="NewParagraph";break;case OAt.paragraph:this._iconString="Paragraph"}return this._iconString};var oEt,rEt=sEt;function sEt(e,t,i,n,o){var r=oEt.call(this)||this;return r._icon=OAt.note,r._iconString="",r._stateModel=VAt.none,r._state=NAt.none,r._open=!1,r._isReview=!1,r._isComment=!1,r._comment="q 1 1 1 rg 0 i 1 w 4 M 1 j 0 J []0 d 1 0 0 1 9 5.0908 cm 7.74 12.616 m -7.74 12.616 l -8.274 12.616 -8.707 12.184 -8.707 11.649 c h f Q 0 G ",r._commentSecondHalf="0 i 0.60 w 4 M 1 j 0 J [0 100]1 d  1 0 0 1 9 5.0908 cm 4.1 1.71 m -0.54 -2.29 l  -0.54 1.71 l  -5.5 1.71 l  -5.5 14.42 l  10.5 14.42 l  10.5 1.71 l  4.1 1.71 l -2.33 9.66 m 7.34 9.66 l 7.34 8.83 l -2.33 8.83 l -2.33 9.66 l -2.33 7.28 m 5.88 7.28 l 5.88 6.46 l -2.33 6.46 l -2.33 7.28 l 14.9 23.1235 m -14.9 23.1235 l -14.9 -20.345 l 14.9 -20.345 l 14.9 23.1235 l b ",r._note="0 G 0 i 0.61 w 4 M 0 j 0 J []0 d  q 1 0 0 1 16.959 1.3672 cm 0 0 m 0 -0.434 -0.352 -0.785 -0.784 -0.785 c -14.911 -0.785 l -15.345 -0.785 -15.696 -0.434 -15.696 0 c -15.696 17.266 l -15.696 17.699 -15.345 18.051 -14.911 18.051 c -0.784 18.051 l -0.352 18.051 0 17.699 0 17.266 c h b Q q 1 0 0 1 4.4023 13.9243 cm 0 0 m 9.418 0 l S Q q 1 0 0 1 4.4019 11.2207 cm 0 0 m 9.418 0 l S Q q 1 0 0 1 4.4023 8.5176 cm 0 0 m 9.418 0 l S Q q 1 0 0 1 4.4023 5.8135 cm 0 0 m 9.418 0 l S Q ",r._help="q 1 1 1 rg 0 i 1 w 4 M 1 j 0 J []0 d 1 0 0 1 12.1465 10.5137 cm -2.146 9.403 m -7.589 9.403 -12.001 4.99 -12.001 -0.453 c -12.001 -5.895 -7.589 -10.309 -2.146 -10.309 c 3.296 -10.309 7.709 -5.895 7.709 -0.453 c 7.709 4.99 3.296 9.403 -2.146 9.403 c h f Q ",r._helpSecondHalf=" 0 G 0 i 0.59 w 4 M 1 j 0 J []0 d  1 0 0 1 12.1465 10.5137 cm 0 0 m -0.682 -0.756 -0.958 -1.472 -0.938 -2.302 c -0.938 -2.632 l -3.385 -2.632 l -3.403 -2.154 l -3.459 -1.216 -3.147 -0.259 -2.316 0.716 c -1.729 1.433 -1.251 2.022 -1.251 2.647 c -1.251 3.291 -1.674 3.715 -2.594 3.751 c -3.202 3.751 -3.937 3.531 -4.417 3.2 c -5.041 5.205 l -4.361 5.591 -3.274 5.959 -1.968 5.959 c 0.46 5.959 1.563 4.616 1.563 3.089 c 1.563 1.691 0.699 0.771 0 0 c -2.227 -6.863 m -2.245 -6.863 l -3.202 -6.863 -3.864 -6.146 -3.864 -5.189 c -3.864 -4.196 -3.182 -3.516 -2.227 -3.516 c -1.233 -3.516 -0.589 -4.196 -0.57 -5.189 c -0.57 -6.146 -1.233 -6.863 -2.227 -6.863 c -2.146 9.403 m -7.589 9.403 -12.001 4.99 -12.001 -0.453 c -12.001 -5.895 -7.589 -10.309 -2.146 -10.309 c 3.296 -10.309 7.709 -5.895 7.709 -0.453 c 7.709 4.99 3.296 9.403 -2.146 9.403 c b ",r._insert=" 0 i 0.59 w 4 M 0 j 0 J []0 d  1 0 0 1 8.5386 19.8545 cm 0 0 m -8.39 -19.719 l 8.388 -19.719 l h B ",r._key="q 1 1 1 rg 0 i 1 w 4 M 1 j 0 J []0 d 1 0 0 1 6.5 12.6729 cm 0.001 5.138 m -2.543 5.138 -4.604 3.077 -4.604 0.534 c -4.604 -1.368 -3.449 -3.001 -1.802 -3.702 c -1.802 -4.712 l -0.795 -5.719 l -1.896 -6.82 l -0.677 -8.039 l -1.595 -8.958 l -0.602 -9.949 l -1.479 -10.829 l -0.085 -12.483 l 1.728 -10.931 l 1.728 -3.732 l 1.737 -3.728 1.75 -3.724 1.76 -3.721 c 3.429 -3.03 4.604 -1.385 4.604 0.534 c 4.604 3.077 2.542 5.138 0.001 5.138 c f Q ",r._keySecondHalf=" 0 G 0 i 0.59 w 4 M 1 j 0 J []0 d  q 1 0 0 1 6.4995 20 cm 0 0 m -6.205 -12.713 l 6.205 -12.713 l h b Q q 1 0 0 1 1.1909 6.2949 cm 0 0 m 1.278 0 l 1.353 0 1.362 -0.02 1.391 -0.066 c 2.128 -1.363 3.78 -4.275 3.966 -4.713 c 3.985 -4.713 l 3.976 -4.453 3.957 -3.91 3.957 -3.137 c 3.957 -0.076 l 3.957 -0.02 3.976 0 4.041 0 c 4.956 0 l 5.021 0 5.04 -0.029 5.04 -0.084 c 5.04 -6.049 l 5.04 -6.113 5.021 -6.133 4.947 -6.133 c 3.695 -6.133 l 3.621 -6.133 3.611 -6.113 3.574 -6.066 c 3.052 -4.955 1.353 -2.063 0.971 -1.186 c 0.961 -1.186 l 0.999 -1.68 0.999 -2.146 1.008 -3.025 c 1.008 -6.049 l 1.008 -6.104 0.989 -6.133 0.933 -6.133 c 0.009 -6.133 l -0.046 -6.133 -0.075 -6.123 -0.075 -6.049 c -0.075 -0.066 l -0.075 -0.02 -0.056 0 0 0 c f Q q 1 0 0 1 9.1367 3.0273 cm 0 0 m 0.075 0 0.215 -0.008 0.645 -0.008 c 1.4 -0.008 2.119 0.281 2.119 1.213 c 2.119 1.969 1.633 2.381 0.737 2.381 c 0.354 2.381 0.075 2.371 0 2.361 c h -1.146 3.201 m -1.146 3.238 -1.129 3.268 -1.082 3.268 c -0.709 3.275 0.02 3.285 0.729 3.285 c 2.613 3.285 3.248 2.314 3.258 1.232 c 3.258 -0.27 2.007 -0.914 0.607 -0.914 c 0.327 -0.914 0.057 -0.914 0 -0.904 c 0 -2.789 l 0 -2.836 -0.019 -2.865 -0.074 -2.865 c -1.082 -2.865 l -1.119 -2.865 -1.146 -2.846 -1.146 -2.799 c h f Q ",r._newParagraph="1 0.819611 0 rg 0 G 0 i 0.58 w 4 M 0 j 0 J []0 d ",r._newParagraphSecondHalf=" 0 G 0 i 0.59 w 4 M 1 j 0 J []0 d  q 1 0 0 1 6.4995 20 cm 0 0 m -6.205 -12.713 l 6.205 -12.713 l h b Q q 1 0 0 1 1.1909 6.2949 cm 0 0 m 1.278 0 l 1.353 0 1.362 -0.02 1.391 -0.066 c 2.128 -1.363 3.78 -4.275 3.966 -4.713 c 3.985 -4.713 l 3.976 -4.453 3.957 -3.91 3.957 -3.137 c 3.957 -0.076 l 3.957 -0.02 3.976 0 4.041 0 c 4.956 0 l 5.021 0 5.04 -0.029 5.04 -0.084 c 5.04 -6.049 l 5.04 -6.113 5.021 -6.133 4.947 -6.133 c 3.695 -6.133 l 3.621 -6.133 3.611 -6.113 3.574 -6.066 c 3.052 -4.955 1.353 -2.063 0.971 -1.186 c 0.961 -1.186 l 0.999 -1.68 0.999 -2.146 1.008 -3.025 c 1.008 -6.049 l 1.008 -6.104 0.989 -6.133 0.933 -6.133 c 0.009 -6.133 l -0.046 -6.133 -0.075 -6.123 -0.075 -6.049 c -0.075 -0.066 l -0.075 -0.02 -0.056 0 0 0 c f Q q 1 0 0 1 9.1367 3.0273 cm 0 0 m 0.075 0 0.215 -0.008 0.645 -0.008 c 1.4 -0.008 2.119 0.281 2.119 1.213 c 2.119 1.969 1.633 2.381 0.737 2.381 c 0.354 2.381 0.075 2.371 0 2.361 c h -1.146 3.201 m -1.146 3.238 -1.129 3.268 -1.082 3.268 c -0.709 3.275 0.02 3.285 0.729 3.285 c 2.613 3.285 3.248 2.314 3.258 1.232 c 3.258 -0.27 2.007 -0.914 0.607 -0.914 c 0.327 -0.914 0.057 -0.914 0 -0.904 c 0 -2.789 l 0 -2.836 -0.019 -2.865 -0.074 -2.865 c -1.082 -2.865 l -1.119 -2.865 -1.146 -2.846 -1.146 -2.799 c h f Q ",r._paragraph="q 1 1 1 rg 0 i 1 w 4 M 1 j 0 J []0 d 1 0 0 1 19.6973 10.0005 cm 0 0 m 0 -5.336 -4.326 -9.662 -9.663 -9.662 c -14.998 -9.662 -19.324 -5.336 -19.324 0 c -19.324 5.335 -14.998 9.662 -9.663 9.662 c -4.326 9.662 0 5.335 0 0 c h f Q ",r._paragraphSecondHalf="0 G 0 i 0.59 w 4 M 1 j 0 J []0 d  q 1 0 0 1 19.6973 10.0005 cm 0 0 m 0 -5.336 -4.326 -9.662 -9.663 -9.662 c -14.998 -9.662 -19.324 -5.336 -19.324 0 c -19.324 5.335 -14.998 9.662 -9.663 9.662 c -4.326 9.662 0 5.335 0 0 c h S Q q 1 0 0 1 11.6787 2.6582 cm 0 0 m -1.141 0 l -1.227 0 -1.244 0.052 -1.227 0.139 c -0.656 1.157 -0.52 2.505 -0.52 3.317 c -0.52 3.594 l -2.833 3.783 -5.441 4.838 -5.441 8.309 c -5.441 10.778 -3.714 12.626 -0.57 13.024 c -0.535 13.508 -0.381 14.129 -0.242 14.389 c -0.207 14.44 -0.174 14.475 -0.104 14.475 c 1.088 14.475 l 1.156 14.475 1.191 14.458 1.175 14.372 c 1.105 14.095 0.881 13.127 0.881 12.402 c 0.881 9.431 0.932 7.324 0.95 4.06 c 0.95 2.298 0.708 0.813 0.189 0.07 c 0.155 0.034 0.103 0 0 0 c b Q ",r._dictionary=new mPt,r._dictionary.update("Type",k.get("Annot")),r._dictionary.update("Subtype",k.get("Text")),void 0!==e&&(r.text=e),void 0!==t&&void 0!==i&&void 0!==n&&void 0!==o&&(r.bounds={x:t,y:i,width:n,height:o}),r._type=QAt.popupAnnotation,r}Met(hEt,aEt=TTt),Object.defineProperty(hEt.prototype,"action",{get:function(){if(void 0===this._action&&this._dictionary.has("A")){var e=this._dictionary.get("A");if(e&&e.has("Next")){var t=e.get("Next");if(Array.isArray(t))for(var i=0;i<t.length;i++){var n=t[Number.parseInt(i.toString(),10)];n&&n instanceof aPt&&(n=this._crossReference._fetch(n)).has("JS")&&(this._action=n.get("JS"))}}}return this._action},set:function(e){if(this._isLoaded||"string"!=typeof e||(this._action=e),this._isLoaded&&"string"==typeof e&&this.action!==e&&this._dictionary.has("A")){var t=this._dictionary.get("A");if(t&&t.has("Next")){var i=t.get("Next");if(Array.isArray(i))for(var n=0;n<i.length;n++){var o=i[Number.parseInt(n.toString(),10)];o&&o instanceof aPt&&(o=this._crossReference._fetch(o)).has("JS")&&(o.update("JS",e),this._action=e,this._dictionary._updated=!0)}}}},enumerable:!0,configurable:!0}),hEt._load=function(e,t){var i=new hEt;return i._isLoaded=!0,i._initialize(e,t),i},hEt.prototype._initialize=function(e,t){aEt.prototype._initialize.call(this,e,t)},hEt.prototype._postProcess=function(){if(void 0===this.bounds||null===this.bounds)throw new Error("Bounds cannot be null or undefined");var e,t;this._dictionary.has("BS")?e=this.border.width:((t=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",t)),void 0===e&&(e=1),this._addAction(),this._dictionary.update("Rect",jkt(this))},hEt.prototype._addAction=function(){var e,t=this,i=(this._dictionary.has("A")&&((n=this._dictionary.get("A"))&&(void 0!==this._action&&null!==this._action&&n.has("Next")&&(i=n.get("Next"),Array.isArray(i))&&0<i.length&&i.forEach(function(e){e&&e instanceof aPt&&e._isNew&&t._crossReference._cacheMap.delete(e)}),n.has("F"))&&xkt(n,this._crossReference,"F"),xkt(this._dictionary,this._crossReference,"A")),new mPt),n=(i.set("Type",k.get("Action")),i.set("S",k.get("Launch")),new mPt),o=(n.set("Type",k.get("Filespec")),n.set("UF",this._fileName),void 0!==this._action&&null!==this._action&&((o=new mPt).set("Type",k.get("Action")),o.set("S",k.get("JavaScript")),o.set("JS",this._action),e=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(e,o),o._updated=!0,i.set("Next",[e])),this._crossReference._getNextReference());this._crossReference._cacheMap.set(o,n),n._updated=!0,i.set("F",o),i._updated=!0,this._dictionary.set("A",i)},hEt.prototype._doPostProcess=function(e){var t;void 0===e&&(e=!1),this._isLoaded||this._postProcess(),e&&(e=void 0,this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(e=t.get("N"),t=t.getRaw("N"))&&e&&(e.reference=t),e?(t=new _It(e,this._crossReference),e=this._validateTemplateMatrix(t._content.dictionary),this._flattenAnnotationTemplate(t,e)):this._removeAnnotation(this._page,this))};var aEt,lEt=hEt;function hEt(e,t,i,n,o){var r=aEt.call(this)||this;return r._dictionary=new mPt,r._dictionary.update("Type",k.get("Annot")),r._dictionary.update("Subtype",k.get("Link")),void 0!==e&&void 0!==t&&void 0!==i&&void 0!==n&&(r.bounds={x:e,y:t,width:i,height:n}),null!=o&&(r._fileName=o),r._type=QAt.fileLinkAnnotation,r}Met(cEt,dEt=TTt),Object.defineProperty(cEt.prototype,"uri",{get:function(){var e;return void 0===this._uri&&this._dictionary.has("A")&&(e=this._dictionary.get("A")).has("URI")&&(this._uri=e.get("URI")),this._uri},set:function(e){var t;"string"==typeof e&&(this._isLoaded&&this._dictionary.has("A")&&e!==this.uri?(t=this._dictionary.get("A")).has("URI")&&(this._uri=e,t.update("URI",e),this._dictionary._updated=!0):this._uri=e)},enumerable:!0,configurable:!0}),cEt._load=function(e,t){var i=new cEt;return i._isLoaded=!0,i._initialize(e,t),i},cEt.prototype._initialize=function(e,t){dEt.prototype._initialize.call(this,e,t)},cEt.prototype._postProcess=function(){if(void 0===this.bounds||null===this.bounds)throw new Error("Bounds cannot be null or undefined");var e,t;this._dictionary.has("BS")?e=this.border.width:((t=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",t)),void 0===e&&(e=1),this._addAction(),this._dictionary.update("Rect",jkt(this))},cEt.prototype._addAction=function(){var e=new mPt;e.set("Type",k.get("Action")),e.set("S",k.get("URI")),void 0!==this._uri&&e.set("URI",this._uri),e._updated=!0,this._dictionary.set("A",e),this._dictionary.update("Border",[this.border.hRadius,this.border.vRadius,this.border.width])},cEt.prototype._doPostProcess=function(e){var t;void 0===e&&(e=!1),this._isLoaded||this._postProcess(),e&&(e=void 0,this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(e=t.get("N"),t=t.getRaw("N"))&&e&&(e.reference=t),e?(t=new _It(e,this._crossReference),e=this._validateTemplateMatrix(t._content.dictionary),this._flattenAnnotationTemplate(t,e)):this._removeAnnotation(this._page,this))};var dEt,pEt=cEt;function cEt(e,t,i,n,o){var r=dEt.call(this)||this;return r._dictionary=new mPt,r._dictionary.update("Type",k.get("Annot")),r._dictionary.update("Subtype",k.get("Link")),void 0!==e&&void 0!==t&&void 0!==i&&void 0!==n&&(r.bounds={x:e,y:t,width:i,height:n}),null!=o&&(r._uri=o),r._type=QAt.uriAnnotation,r}Met(mEt,uEt=TTt),Object.defineProperty(mEt.prototype,"destination",{get:function(){return this._isLoaded&&!this._destination&&(this.destination=this._obtainDestination()),this._destination},set:function(e){e&&(this._destination=e,this._isLoaded)&&this._destination._initializePrimitive()},enumerable:!0,configurable:!0}),mEt._load=function(e,t){var i=new mEt;return i._isLoaded=!0,i._initialize(e,t),i},mEt.prototype._initialize=function(e,t){uEt.prototype._initialize.call(this,e,t)},mEt.prototype._postProcess=function(){if(void 0===this.bounds||null===this.bounds)throw new Error("Bounds cannot be null or undefined");this._addDocument(),this._dictionary.update("Rect",jkt(this))},mEt.prototype._obtainDestination=function(){var e,t,i,n,o,r,s,a,l;return this._dictionary.has("Dest")?(n=void 0,null==(n=(e="string"==typeof(e=this._dictionary.get("Dest"))?this._getDestination(e):e)&&e[0]instanceof aPt?e[0]:n)&&e&&"number"==typeof e[0]&&0<=(a=e[0])&&a<this._crossReference._document.pageCount&&(t=this._crossReference._document.getPage(a))&&("XYZ"===(i=e[1]).name?(r=e[2],a=e[3],o=e[4],l=null!=a?t.size[1]-a:0,this._destination=new FDt(t,[null!=r?r:0,l]),null!=o&&(this._destination.zoom=o),(void 0===r&&null===r||void 0===a&&null===a||void 0===o&&null===o)&&this._destination._setValidation(!1)):(this._destination=new FDt(t),this._destination.mode=zAt.fitToPage)),n&&(0<=(s=uMt(this._crossReference._document,this._crossReference._fetch(n)))&&s<this._crossReference._document.pageCount?(t=this._crossReference._document.getPage(s))&&e[1]instanceof k&&(i=e[1])&&("XYZ"===i.name?(r=e[2],a=e[3],o=e[4],l=null!=a?t.size[1]-a:0,this._destination=new FDt(t,[null!=r?r:0,l]),null!=o&&(this._destination.zoom=o),(void 0===r&&null===r||void 0===a&&null===a||void 0===o&&null===o)&&this._destination._setValidation(!1)):"Fit"===i.name&&(this._destination=new FDt(t),this._destination.mode=zAt.fitToPage)):(this._destination=new FDt,o=e[4],i=e[1],null!=o&&(this._destination.zoom=o),"Fit"===i.name?this._destination.mode=zAt.fitToPage:"XYZ"===i.name&&(r=e[2],l=e[3],void 0===r&&null===r||void 0===l&&null===l||void 0===o&&null===o)&&this._destination._setValidation(!1),this._destination._index=s))):this._dictionary.has("A")&&!this._destination&&(n=this._dictionary.get("A")).has("D")&&null!=(a=n.get("D"))&&(e=void 0,Array.isArray(a)?e=a:a&&a instanceof aPt?(n=this._crossReference._fetch(a),Array.isArray(n)&&(e=n)):"string"==typeof a&&(e=this._getDestination(a)),e)&&(e[0]instanceof aPt||"number"==typeof e[0])&&(n=this._crossReference._document,s=void 0,0<=(s=e[0]instanceof aPt?uMt(n,this._crossReference._fetch(e[0])):e[0]))&&s<this._crossReference._document.pageCount&&(t=n.getPage(s))&&("FitBH"===(i=e[1]).name||"FitH"===i.name?(l=null!=(a=e[2])?t.size[1]-a:0,this._destination=new FDt(t,[0,l]),null==a&&this._destination._setValidation(!1)):"XYZ"===i.name?(r=e[2],n=e[3],o=e[4],l=null!=n?t.size[1]-n:0,this._destination=new FDt(t,[null!=r?r:0,l]),null!=o&&(this._destination.zoom=o),null==r&&null==n&&null==o||this._destination._setValidation(!1)):"FitR"===i.name?6===e.length&&(r=e[2],s=e[3],a=e[4],l=e[5],this._destination=new FDt(t,[r,s,a,l])):"Fit"===i.name&&(this._destination=new FDt(t),this._destination.mode=zAt.fitToPage)),this._destination},mEt.prototype._getDestination=function(e){var t,i=this._crossReference._document;return t=i?this._getNamedDestination(i,e):t},mEt.prototype._getNamedDestination=function(e,t){var i,n=e._catalog;return n&&n._catalogDictionary&&n._catalogDictionary.has("Names")&&(n=n._catalogDictionary.get("Names"))&&n.has("Dests")&&(n=n.get("Dests"))&&(n=this._getNamedObjectFromTree(n,t),i=this._extractDestination(n,e)),i},mEt.prototype._extractDestination=function(e,t){var i,n;return(i=e&&e instanceof aPt?t._crossReference._fetch(e):i)&&(i instanceof mPt&&i.has("D")?n=i.getRaw("D"):Array.isArray(i)&&(n=i)),n||e},mEt.prototype._getNamedObjectFromTree=function(e,t){for(var i,n=!1,o=e;!n&&o;)o&&o.has("Kids")?o=this._getProperKid(o,t):o&&o.has("Names")&&(i=this._findName(o,t),n=!0);return i},mEt.prototype._findName=function(e,t){for(var i,n=e.get("Names"),o=0,r=n.length/2-1,s=0,a=!1;!(a||(s=Math.floor((o+r)/2),r<o));){var l=n[2*Number.parseInt(s.toString(),10)],l=(l&&l instanceof aPt&&(l=e._crossReference._fetch(l)),this._stringCompare(t,l));if(0<l)o=s+1;else{if(!(l<0)){a=!0;break}r=s-1}}return i=a?n[2*s+1]:i},mEt.prototype._getProperKid=function(e,t){var i;if((n=e&&e.has("Kids")?e.getRaw("Kids"):n)&&Array.isArray(n)&&0!==n.length)for(var n=e.getArray("Kids"),o=0;o<n.length&&(i=n[Number.parseInt(o.toString(),10)],!this._checkLimits(i,t));o++);return i},mEt.prototype._checkLimits=function(e,t){var i,n=!1;return n=e&&e.has("Limits")&&(i=(e=e.get("Limits"))[0],e=e[1],i=this._stringCompare(i,t),e=this._stringCompare(e,t),0===i||0===e||i<0&&0<e)?!0:n},mEt.prototype._stringCompare=function(e,t){for(var i=yMt(e),n=yMt(t),o=Math.min(i.length,n.length),r=0,s=0;s<o&&0===(r=i[Number.parseInt(s.toString(),10)]-n[Number.parseInt(s.toString(),10)]);s++);return r=0===r?i.length-n.length:r},mEt.prototype._addDocument=function(){this.destination&&this._dictionary.set("Dest",this.destination._array)},mEt.prototype._doPostProcess=function(e){var t;void 0===e&&(e=!1),this._isLoaded?this._destination&&this._dictionary.update("Dest",this._destination._array):this._postProcess(),e&&(e=void 0,this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(e=t.get("N"),t=t.getRaw("N"))&&e&&(e.reference=t),e?(t=new _It(e,this._crossReference),e=this._validateTemplateMatrix(t._content.dictionary),this._flattenAnnotationTemplate(t,e)):this._removeAnnotation(this._page,this))};var uEt,gEt=mEt;function mEt(e,t,i,n){var o=uEt.call(this)||this;return o._dictionary=new mPt,o._dictionary.update("Type",k.get("Annot")),o._dictionary.update("Subtype",k.get("Link")),void 0!==e&&void 0!==t&&void 0!==i&&void 0!==n&&(o.bounds={x:e,y:t,width:i,height:n}),o._type=QAt.documentLinkAnnotation,o}Met(vEt,fEt=TTt),Object.defineProperty(vEt.prototype,"font",{get:function(){return this._font},set:function(e){this._font=e},enumerable:!0,configurable:!0}),Object.defineProperty(vEt.prototype,"url",{get:function(){var e;return void 0===this._url&&this._dictionary.has("A")&&(e=this._dictionary.get("A")).has("URI")&&(this._url=e.get("URI")),this._url},set:function(e){var t,i;"string"==typeof e&&(this._isLoaded&&this._dictionary.has("A")?(t=this._dictionary._get("A"),(i=this._dictionary.get("A"))&&i.has("URI")&&(this._url=e,i.update("URI",e),t instanceof aPt||(this._dictionary._updated=i._updated))):this._url=e)},enumerable:!0,configurable:!0}),vEt._load=function(e,t){var i=new vEt;return i._isLoaded=!0,i._initialize(e,t),i},vEt.prototype._initialize=function(e,t){fEt.prototype._initialize.call(this,e,t)},vEt.prototype._postProcess=function(){if(void 0===this.bounds||null===this.bounds)throw new Error("Bounds cannot be null or undefined");this._isActionAdded||(this._addAction(),this._isActionAdded=!0),this._dictionary.update("Rect",jkt(this))},vEt.prototype._addAction=function(){var e=[this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height],t=(void 0!==this.font&&null!==this.font||(this.font=this._lineCaptionFont),new E1t(MAt.left,T1t.top)),e=(this._page.graphics.drawString(this._textWebLink,this.font,e,this._pen,this._brush,t),new mPt);e.set("Type",k.get("Action")),e.set("S",k.get("URI")),void 0!==this._url&&e.set("URI",this._url),e._updated=!0,this._dictionary.set("A",e),this._dictionary.update("Border",[0,0,0])},vEt.prototype._doPostProcess=function(e){var t;void 0===e&&(e=!1),this._isLoaded||this._postProcess(),e&&(e=void 0,this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(e=t.get("N"),t=t.getRaw("N"))&&e&&(e.reference=t),e?(t=new _It(e,this._crossReference),e=this._validateTemplateMatrix(t._content.dictionary),this._flattenAnnotationTemplate(t,e)):this._removeAnnotation(this._page,this))};var fEt,yEt=vEt;function vEt(e,t,i,n,o,r,s,a){var l=fEt.call(this)||this;return l._isActionAdded=!1,l._dictionary=new mPt,l._dictionary.update("Type",k.get("Annot")),l._dictionary.update("Subtype",k.get("Link")),void 0!==e&&void 0!==t&&void 0!==i&&void 0!==n&&(l.bounds={x:e,y:t,width:i,height:n}),l._textWebLink=null!=a?a:"",null!=o&&(l._brush=new fIt(o)),null!=r&&(l._pen=new yIt(r,s||1)),l._type=QAt.textWebLinkAnnotation,l}Met(CEt,bEt=MTt),Object.defineProperty(CEt.prototype,"icon",{get:function(){return this._dictionary.has("Name")&&(this._icon=fkt(this._dictionary.get("Name").name)),this._icon},set:function(e){void 0!==e&&(this._icon=e,this._dictionary.update("Name",k.get(this._obtainIconName(this._icon))))},enumerable:!0,configurable:!0}),CEt._load=function(e,t){var i=new CEt;return i._isLoaded=!0,i._initialize(e,t),i},CEt.prototype._initialize=function(e,t){bEt.prototype._initialize.call(this,e,t)},CEt.prototype._postProcess=function(){if(void 0===this.bounds||null===this.bounds)throw new Error("Bounds cannot be null or undefined");this._dictionary.update("Rect",jkt(this)),this._addAttachment()},CEt.prototype._addAttachment=function(){this._dictionary.has("FS")&&((e=this._dictionary.get("FS"))&&e.has("EF")&&(e=e.get("EF"))&&e.has("F")&&xkt(e,this._crossReference,"F"),xkt(this._dictionary,this._crossReference,"FS"));var e=new mPt,t=(e.set("Type",k.get("Filespec")),e.set("Desc",this._fileName),e.set("F",this._fileName),e.set("UF",this._fileName),new mPt),i=(t.set("Type",k.get("EmbeddedFile")),new mPt),n=new Date,n=(i.set("CreationDate",n.toTimeString()),i.set("ModDate",(new Date).toTimeString()),i.set("Size",this._stream.length),t.set("Params",i),this._stream.dictionary=new mPt,(this._stream.dictionary=t)._crossReference=this._crossReference,this._crossReference._newLine.charCodeAt(0)),i=this._crossReference._newLine.charCodeAt(1),n=(t._crossReference._writeObject(this._stream,[n,i,37,80,68,70,45]),this._crossReference._getNextReference()),i=(this._crossReference._cacheMap.set(n,this._stream),t._updated=!0,new mPt),t=(i.set("F",n),e.set("EF",i),this._crossReference._getNextReference());this._crossReference._cacheMap.set(t,e),e._updated=!0,this._dictionary.update("FS",t)},CEt.prototype._doPostProcess=function(e){var t;void 0===e&&(e=!1),this._isLoaded||this._postProcess(),e&&(e=void 0,this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(e=t.get("N"),t=t.getRaw("N"))&&e&&(e.reference=t),e?(t=new _It(e,this._crossReference),e=this._validateTemplateMatrix(t._content.dictionary),this._flattenAnnotationTemplate(t,e)):this._removeAnnotation(this._page,this))},CEt.prototype._obtainIconName=function(e){switch(e){case _At.pushPin:this._iconString="PushPin";break;case _At.tag:this._iconString="Tag";break;case _At.graph:this._iconString="Graph";break;case _At.paperClip:this._iconString="Paperclip"}return this._iconString};var bEt,wEt=CEt;function CEt(e,t,i,n,o,r){var s=bEt.call(this)||this;return s._icon=_At.pushPin,s._iconString="",s._dictionary=new mPt,s._dictionary.update("Type",k.get("Annot")),s._dictionary.update("Subtype",k.get("FileAttachment")),void 0!==e&&void 0!==t&&void 0!==i&&void 0!==n&&(s.bounds={x:e,y:t,width:i,height:n}),void 0!==o&&(s._fileName=o),s._stream=new IPt("string"==typeof r?DMt(r):r),s._type=QAt.fileAttachmentAnnotation,s}Met(xEt,SEt=TTt),xEt._load=function(e,t){var i=new xEt;return i._isLoaded=!0,i._initialize(e,t),i},xEt.prototype._initialize=function(e,t){SEt.prototype._initialize.call(this,e,t)},xEt.prototype._doPostProcess=function(e){var t;(e=void 0===e?!1:e)&&(e=void 0,this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(e=t.get("N"),t=t.getRaw("N"))&&e&&(e.reference=t),e?(t=new _It(e,this._crossReference),e=this._validateTemplateMatrix(t._content.dictionary),this._flattenAnnotationTemplate(t,e)):this._removeAnnotation(this._page,this))};var SEt,AEt=xEt;function xEt(){var e=SEt.call(this)||this;return e._type=QAt.movieAnnotation,e}Met(EEt,IEt=MTt),Object.defineProperty(EEt.prototype,"bounds",{get:function(){return this._isLoaded&&(this._bounds=FMt(this._dictionary,this._page)),this._bounds},set:function(e){var t,i;e&&(this._isLoaded?e.x===this.bounds.x&&e.y===this.bounds.y&&e.width===this.bounds.width&&e.height===this.bounds.height||(i=this._page.size)&&(t=(i=i[1]-(e.y+e.height))+e.height,this._dictionary.update("Rect",[e.x,i,e.x+e.width,t]),this._bounds=e,this._isChanged=!0):(this._bounds=e,i=this._obtainNativeRectangle(),this._dictionary.update("Rect",RMt({x:i[0],y:i[1],width:i[2],height:i[3]})),this._isChanged=!0))},enumerable:!0,configurable:!0}),Object.defineProperty(EEt.prototype,"textMarkUpColor",{get:function(){return void 0===this._textMarkUpColor&&this._dictionary.has("C")&&(this._textMarkUpColor=VMt(this._dictionary.getArray("C"))),this._textMarkUpColor},set:function(e){var t;void 0!==e&&3===e.length&&(t=this.color,this._isLoaded&&void 0!==t&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]||(this._color=e,this._textMarkUpColor=e,this._dictionary.update("C",[Number.parseFloat((e[0]/255).toFixed(3)),Number.parseFloat((e[1]/255).toFixed(3)),Number.parseFloat((e[2]/255).toFixed(3))])))},enumerable:!0,configurable:!0}),Object.defineProperty(EEt.prototype,"textMarkupType",{get:function(){var e;return this._dictionary.has("Subtype")&&(e=this._dictionary.get("Subtype"),this._textMarkupType=akt(e.name)),this._textMarkupType},set:function(e){void 0!==e&&(this._textMarkupType=e,this._dictionary.update("Subtype",k.get(lkt(e))))},enumerable:!0,configurable:!0}),Object.defineProperty(EEt.prototype,"boundsCollection",{get:function(){if(this._isLoaded){var e=[];if(this._dictionary.has("QuadPoints")){var t=this._dictionary.getArray("QuadPoints");if(t&&0<t.length)for(var i=t.length/8,n=0;n<i;n++){var o=t[4+8*n]-t[8*n],r=t[5+8*n]-t[1+8*n],s=Math.sqrt(o*o+r*r),o=t[6+8*n]-t[4+8*n],r=t[7+8*n]-t[5+8*n],o=Math.sqrt(o*o+r*r),r=[t[8*n],this._page.size[1]-t[1+8*n],o,s];e.push(r)}}return e}return this._boundsCollection},set:function(e){if(!this._isLoaded&&void 0!==e){if(0<e.length){this._quadPoints=new Array(8*e.length);for(var t=0;t<e.length;t++)this._boundsCollection.push(e[Number.parseInt(t.toString(),10)])}else this._quadPoints=new Array(8),this._boundsCollection=e;this._isChanged=!0}if(this._isLoaded&&void 0!==e){var i=!1;if(this.boundsCollection.length===e.length){for(t=0;t<e.length;t++)for(var n=e[Number.parseInt(t.toString(),10)],o=0;o<n.length;o++)if(e[Number.parseInt(t.toString(),10)][Number.parseInt(o.toString(),10)]!==this.boundsCollection[Number.parseInt(t.toString(),10)][Number.parseInt(o.toString(),10)]){i=!0;break}}else i=!0;if(i){this._quadPoints=new Array(8*e.length);for(var r=this._page.size[1],t=0;t<e.length;t++)this._quadPoints[0+8*Number.parseInt(t.toString(),10)]=e[Number.parseInt(t.toString(),10)][0],this._quadPoints[1+8*Number.parseInt(t.toString(),10)]=r-e[Number.parseInt(t.toString(),10)][1],this._quadPoints[2+8*Number.parseInt(t.toString(),10)]=e[Number.parseInt(t.toString(),10)][0]+e[Number.parseInt(t.toString(),10)][2],this._quadPoints[3+8*Number.parseInt(t.toString(),10)]=r-e[Number.parseInt(t.toString(),10)][1],this._quadPoints[4+8*Number.parseInt(t.toString(),10)]=e[Number.parseInt(t.toString(),10)][0],this._quadPoints[5+8*Number.parseInt(t.toString(),10)]=this._quadPoints[1+8*t]-e[Number.parseInt(t.toString(),10)][3],this._quadPoints[6+8*Number.parseInt(t.toString(),10)]=e[Number.parseInt(t.toString(),10)][0]+e[Number.parseInt(t.toString(),10)][2],this._quadPoints[7+8*Number.parseInt(t.toString(),10)]=this._quadPoints[5+8*Number.parseInt(t.toString(),10)];this._dictionary.update("QuadPoints",this._quadPoints),this._isChanged=!0}}},enumerable:!0,configurable:!0}),EEt._load=function(e,t){var i=new EEt;return i._isLoaded=!0,i._initialize(e,t),i},EEt.prototype._obtainNativeRectangle=function(){var e,t,i,n=[this._bounds.x,this._bounds.y+this._bounds.height,this._bounds.width,this._bounds.height];return this._page&&(e=this._page.size,n[1]=e[1]-n[1],e=this._getCropOrMediaBox()),e&&(e[3]<0&&(t=e[1],i=e[3],e[1]=i,e[3]=t),2<e.length)&&(0!==e[0]||0!==e[1])&&(n[0]+=e[0],this._page&&this._page._pageDictionary.has("MediaBox")&&!this._page._pageDictionary.has("CropBox")&&0<e[1]&&0===e[3]?n[1]+=e[3]:n[1]+=e[1]),n},EEt.prototype._initialize=function(e,t){IEt.prototype._initialize.call(this,e,t)},EEt.prototype._postProcess=function(){if(void 0===this.bounds||null===this.bounds)throw new Error("Bounds cannot be null or undefined");this._dictionary.has("BS")?t=this.border.width:((e=new mPt(this._crossReference)).set("Type",k.get("Border")),e.set("W",this.border.width),this._dictionary.set("BS",e)),void 0===t&&(t=1),this._dictionary.has("C")||(this._isTransparentColor=!0);var e,t=this._page.size;this._dictionary.update("Subtype",k.get(lkt(this._textMarkupType))),this._isChanged&&(this._setQuadPoints(t),this._dictionary.update("Rect",jkt(this))),this._setAppearance&&(this._appearanceTemplate=this._createMarkupAppearance(),!this._isLoaded&&1<this._boundsCollection.length&&this._isChanged&&(t=this._obtainNativeRectangle(),this._dictionary.update("Rect",[t[0],t[1],t[0]+t[2],t[1]+t[3]])),this._dictionary.has("AP")&&xkt(this._dictionary.get("AP"),this._crossReference,"N"),e=new mPt,this._appearanceTemplate._content.dictionary._updated=!0,t=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(t,this._appearanceTemplate._content),this._appearanceTemplate._content.reference=t,e.set("N",t),e._updated=!0,this._dictionary.set("AP",e)),void 0!==this._text&&null!==this._text&&this._dictionary.set("Contents",this._text),this._isChanged=!1},EEt.prototype._doPostProcess=function(e){var t,i,n;void 0===e&&(e=!1),this._isLoaded?((this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._appearanceTemplate=this._createMarkupAppearance(),e||(this._dictionary.has("AP")&&xkt(this._dictionary.get("AP"),this._crossReference,"N"),i=new mPt,this._appearanceTemplate._content.dictionary._updated=!0,n=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(n,this._appearanceTemplate._content),this._appearanceTemplate._content.reference=n,i.set("N",n),i._updated=!0,this._dictionary.set("AP",i))),!this._appearanceTemplate&&e&&this._dictionary.has("AP")&&(i=this._dictionary.get("AP"))&&i.has("N")&&(t=i.get("N"))&&((n=i.getRaw("N"))&&(t.reference=n),this._appearanceTemplate=new _It(t,this._crossReference))):(this._postProcess(),this._appearanceTemplate||e&&(this._dictionary.has("AP")?(i=this._dictionary.get("AP"))&&i.has("N")&&(t=i.get("N"))&&((n=i.getRaw("N"))&&(t.reference=n),this._appearanceTemplate=new _It(t,this._crossReference)):this._appearanceTemplate=this._createMarkupAppearance())),void 0!==this.flattenPopups&&this.flattenPopups&&(this._isLoaded?this._flattenLoadedPopUp():this._flattenPopUp()),e&&this._appearanceTemplate?(i=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary),this._appearanceTemplate._content.dictionary.has("Matrix")||this._isLoaded||(n=this._appearanceTemplate._content.dictionary.getArray("BBox"))&&this._appearanceTemplate._content.dictionary.update("Matrix",[1,0,0,1,-n[0],-n[1]]),(i&&void 0!==this._page.rotation&&this._page.rotation!==TAt.angle0||i&&this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary,this._appearanceTemplate)||!this._dictionary.has("AP")&&this._appearanceTemplate)&&this._flattenAnnotationTemplate(this._appearanceTemplate,i)):e&&this._page.annotations.remove(this)},EEt.prototype._createMarkupAppearance=function(){var e=0,t=0;if(1<this.boundsCollection.length){for(var i=new nIt,n=0;n<this.boundsCollection.length;n++)(C=[])[0]=this.boundsCollection[Number.parseInt(n.toString(),10)][0],C[1]=this.boundsCollection[Number.parseInt(n.toString(),10)][1],C[2]=this.boundsCollection[Number.parseInt(n.toString(),10)][2],C[3]=this.boundsCollection[Number.parseInt(n.toString(),10)][3],i.addRectangle(C[0],C[1],C[2],C[3]);var o={x:(f=i._getBounds())[0],y:f[1],width:f[2],height:f[3]},e=(this.bounds=o).width,t=o.height}else if(this._dictionary.has("QuadPoints")){var r=this._dictionary.get("QuadPoints");if(null!==this._quadPoints)for(n=0;n<r.length/8;n++)if(this._isLoaded){for(var s=new Array,a=0,l=0;l<r.length;){var h=r[Number.parseInt(l.toString(),10)],d=r[l+1];s[Number.parseInt(a.toString(),10)]=[h,d],l+=2,a++}var p=new nIt;p._addLines(s),e=(o={x:(f=p._getBounds())[0],y:f[1],width:f[2],height:f[3]}).width,t=o.height}else{var p=Math.floor(r[4+8*n])-Math.floor(r[0+8*n]),c=Math.floor(r[5+8*n])-Math.floor(r[1+8*n]);t=Math.sqrt(p*p+c*c),p=Math.floor(r[6+8*n])-Math.floor(r[4+8*n]),c=Math.floor(r[7+8*n])-Math.floor(r[5+8*n]),e=Math.sqrt(p*p+c*c),this.bounds={x:this.bounds.x,y:this.bounds.y,width:e,height:t}}}var u=new _It([0,0,e,t],this._crossReference),g=(nkt(u,this._getRotationAngle()),u.graphics);if(void 0!==this.opacity&&g.setTransparency(this.opacity,this.opacity,$At.multiply),this.textMarkUpColor){var m,f,y=new yIt(this.textMarkUpColor,this.border.width),v=new fIt(this.textMarkUpColor),h=0,d=0,b=0,w=0;if(1<this.boundsCollection.length)for(var C,n=0;n<this.boundsCollection.length;n++)(C=[])[0]=this.boundsCollection[Number.parseInt(n.toString(),10)][0],C[1]=this.boundsCollection[Number.parseInt(n.toString(),10)][1],C[2]=this.boundsCollection[Number.parseInt(n.toString(),10)][2],C[3]=this.boundsCollection[Number.parseInt(n.toString(),10)][3],this.textMarkupType===RAt.highlight?g.drawRectangle(C[0]-o.x,C[1]-o.y,C[2],C[3],v):this.textMarkupType===RAt.underline?(h=C[0]-o.x,d=C[1]-o.y+(C[3]-C[3]/2/3),b=C[2]+(C[0]-o.x),w=C[1]-o.y+(C[3]-C[3]/2/3),g.drawLine(y,h,d,b,w)):this.textMarkupType===RAt.strikeOut?(h=C[0]-o.x,d=C[1]-o.y+(C[3]-C[3]/2),b=C[2]+(C[0]-o.x),w=C[1]-o.y+(C[3]-C[3]/2),g.drawLine(y,h,d,b,w)):this.textMarkupType===RAt.squiggly&&(y._width=.02*C[3],g.save(),g.translateTransform(C[0]-o.x,C[1]-o.y),g.setClip([0,0,C[2],C[3]]),g.drawPath(this._drawSquiggly(C[2],C[3]),y),g.restore());else this.textMarkupType===RAt.highlight?g.drawRectangle(0,0,e,t,v):this.textMarkupType===RAt.underline?g.drawLine(y,0,t-t/2/3,e,t-t/2/3):this.textMarkupType===RAt.strikeOut?g.drawLine(y,0,t/2,e,t/2):this.textMarkupType===RAt.squiggly&&(y._width=.02*t,g.drawPath(this._drawSquiggly(Math.round(e),Math.round(t)),y)),this._isLoaded&&(m=[o.x,o.y,o.x+o.width,o.y+o.height],f=this._setAppearance?jkt(this):m,this._dictionary.update("Rect",f))}return u},EEt.prototype._drawSquiggly=function(e,t){(Math.floor(e)%2!=0||Math.round(e)>e)&&(e=Math.floor(e)+1);for(var i=new nIt,n=new Array,o=Math.ceil(e/t*16),r=e/(o/2),s=parseFloat((.6*(r+r)).toFixed(2)),a=s,l=0,h=0;h<o;h++){var d=[l,parseFloat((t-s+a-.02*t).toFixed(2))];n.push(d),a=0===a?s:0,l+=r}return i._addLines(n),i},EEt.prototype._setQuadPoints=function(e){var t,i=[],n=e[1],o=(t=this._page&&this._page._isNew&&this._page._pageSettings&&this._page._pageSettings.margins?{left:(e=this._page._pageSettings.margins).left,top:e.top,right:e.right,bottom:e.bottom}:{left:0,top:0,right:0,bottom:0},0!==this.bounds.x&&0!==this.bounds.y&&0!==this.bounds.width&&0!==this.bounds.height&&(this._boundsCollection[0]=[this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height]),this._quadPoints.length/8),e=this._getMediaOrCropBox(this._page),r=!1;if(!this._isLoaded&&e&&3<e.length&&!this.flatten){var s=e[0],a=e[1];if(0!==s||0!==a){for(var l=0;l<o;l++){var h=this._boundsCollection[Number.parseInt(l.toString(),10)][0]+t.left+s,d=a+t.top;i[0+8*l]=h+t.left,i[1+8*l]=n- -d-t.top-this._boundsCollection[Number.parseInt(l.toString(),10)][1],i[2+8*l]=h+this._boundsCollection[Number.parseInt(l.toString(),10)][2]+t.left,i[3+8*l]=n- -d-t.top-this._boundsCollection[Number.parseInt(l.toString(),10)][1],i[4+8*l]=h+t.left,i[5+8*l]=i[1+8*l]-this._boundsCollection[Number.parseInt(l.toString(),10)][3],i[6+8*l]=h+this._boundsCollection[Number.parseInt(l.toString(),10)][2]+t.left,i[7+8*l]=i[5+8*l]}r=!0}}if(!r)for(l=0;l<o;l++){h=this._boundsCollection[Number.parseInt(l.toString(),10)][0],d=this._boundsCollection[Number.parseInt(l.toString(),10)][1];i[0+8*l]=h+t.left,i[1+8*l]=n-d-t.top,i[2+8*l]=h+this._boundsCollection[Number.parseInt(l.toString(),10)][2]+t.left,i[3+8*l]=n-d-t.top,i[4+8*l]=h+t.left,i[5+8*l]=i[1+8*l]-this._boundsCollection[Number.parseInt(l.toString(),10)][3],i[6+8*l]=h+this._boundsCollection[Number.parseInt(l.toString(),10)][2]+t.left,i[7+8*l]=i[5+8*l]}this._points=i,this._dictionary.set("QuadPoints",this._points)};var IEt,TEt=EEt;function EEt(e,t,i,n,o){var r=IEt.call(this)||this;return r._textMarkupType=RAt.highlight,r._quadPoints=new Array(8),r._boundsCollection=[],r._dictionary=new mPt,r._dictionary.update("Type",k.get("Annot")),void 0!==e&&(r._text=e),void 0!==t&&void 0!==i&&void 0!==n&&void 0!==o&&(r.bounds={x:t,y:i,width:n,height:o}),r._type=QAt.textMarkupAnnotation,r}Met(kEt,DEt=TTt),kEt._load=function(e,t){var i=new kEt;return i._isLoaded=!0,i._initialize(e,t),i},kEt.prototype._initialize=function(e,t){DEt.prototype._initialize.call(this,e,t)},kEt.prototype._postProcess=function(){if(void 0===this.bounds||null===this.bounds)throw new Error("Bounds cannot be null or undefined");var e,t;this._dictionary.has("BS")?e=this.border.width:((t=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",t)),void 0===e&&(e=1),void 0===this.color&&(this.color=[0,0,0]),this._appearanceTemplate=this._createWatermarkAppearance(),this._dictionary.update("Rect",jkt(this)),void 0!==this.opacity&&1!==this._opacity&&this._dictionary.set("CA",this._opacity)},kEt.prototype._createWatermarkAppearance=function(){var e=this._obtainFont(),t=((null==e||(!this._isLoaded||this._page&&this._page._isDuplicate)&&1===e.size)&&(e=this._lineCaptionFont,this._pdfFont=e),this._rotateAngle=this._getRotationAngle(),(void 0!==this.rotationAngle&&this._rotate!==TAt.angle0||this._rotateAngle!==TAt.angle0)&&(0===this._rotateAngle&&(this._rotateAngle=90*this.rotationAngle),this.bounds=this._getRotatedBounds(this.bounds,this._rotateAngle)),[0,0,this.bounds.width,this.bounds.height]),i=new ATt(this,t),t=(i.normal=new _It(t,this._crossReference),i.normal),i=(nkt(t,this._rotateAngle),i.normal.graphics),n=this.border.width/2,o=new E1t(MAt.left,T1t.top),n=new yIt(this.color,n),n=(this.innerColor&&(r=new fIt(this._innerColor)),this._isLoaded&&this._dictionary.has("Contents")&&(this._watermarkText=this._dictionary.get("Contents")),this._dictionary.update("Contents",this._watermarkText),void 0!==this._watermarkText&&i.drawString(this._watermarkText,e,[0,0,0,0],n,r,o),this._dictionary.has("AP")&&(e=this._dictionary.get("AP"))&&e instanceof mPt&&xkt(e,this._crossReference,"N"),new mPt),r=(i._template._content.dictionary._updated=!0,this._crossReference._getNextReference());return this._crossReference._cacheMap.set(r,i._template._content),i._template._content.reference=r,n.set("N",r),n._updated=!0,this._dictionary.set("AP",n),t},kEt.prototype._doPostProcess=function(e){var t,i,n;void 0===e&&(e=!1),this._isLoaded?(e||(this._appearanceTemplate=this._createWatermarkAppearance()),!this._appearanceTemplate&&e&&this._dictionary.has("AP")&&(i=this._dictionary.get("AP"))&&i.has("N")&&(t=i.get("N"))&&((n=i.getRaw("N"))&&(t.reference=n),this._appearanceTemplate=new _It(t,this._crossReference))):(this._postProcess(),this._appearanceTemplate||e&&(this._dictionary.has("AP")?(i=this._dictionary.get("AP"))&&i.has("N")&&(t=i.get("N"))&&((n=i.getRaw("N"))&&(t.reference=n),this._appearanceTemplate=new _It(t,this._crossReference)):this._appearanceTemplate=this._createWatermarkAppearance())),e&&this._appearanceTemplate?(i=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary),this._appearanceTemplate._content.dictionary.has("Matrix")||(n=this._appearanceTemplate._content.dictionary.getArray("BBox"))&&this._appearanceTemplate._content.dictionary.update("Matrix",[1,0,0,1,-n[0],-n[1]]),this._flattenAnnotationTemplate(this._appearanceTemplate,i)):e&&this._page.annotations.remove(this)};var DEt,MEt=kEt;function kEt(e,t,i,n,o){var r=DEt.call(this)||this;return r._watermarkText="",r._dictionary=new mPt,r._dictionary.update("Type",k.get("Annot")),r._dictionary.update("Subtype",k.get("Watermark")),void 0!==e&&(r._watermarkText=e,r.text=e),void 0!==t&&void 0!==i&&void 0!==n&&void 0!==o&&(r.bounds={x:t,y:i,width:n,height:o}),r._type=QAt.watermarkAnnotation,r}Met(FEt,PEt=MTt),Object.defineProperty(FEt.prototype,"icon",{get:function(){return this._dictionary.has("Name")&&(this._icon=dkt(this._dictionary.get("Name").name)),this._icon},set:function(e){void 0!==e&&(this._icon=e,this._dictionary.update("Name",k.get("#"+this._obtainIconName(this._icon))))},enumerable:!0,configurable:!0}),Object.defineProperty(FEt.prototype,"appearance",{get:function(){var e;return this._isLoaded?null:(void 0===this._appearance&&(e=[0,0,this.bounds.width,this.bounds.height],this._appearance=new ATt(this,e),this._appearance.normal=new _It(e,this._crossReference)),this._appearance)},enumerable:!0,configurable:!0}),FEt.prototype.createTemplate=function(){var e;if(this._isLoaded)if(this._dictionary.has("AP")){var t=this._dictionary.get("AP");if(t&&t.has("N")){var i=t.get("N");if(i){(e=new _It)._isExported=!0;var i=i.dictionary,n=i.getArray("Matrix"),o=i.getArray("BBox");if(n){for(var r,s,a=[],l=0;l<n.length;l++){var h=n[Number.parseInt(l.toString(),10)];a[Number.parseInt(l.toString(),10)]=h}o&&3<o.length&&(r=LMt(o),s=this._transformBBox(r,a),e._size=[s[2],s[3]],e._templateOriginalSize=[r.width,r.height])}else o&&(i.update("Matrix",[1,0,0,1,-o[0],-o[1]]),e._size=[o[2],o[3]]);e._exportStream(t,this._crossReference)}}}else e=this._createRubberStampAppearance();return e},Object.defineProperty(FEt.prototype,"_innerTemplateBounds",{get:function(){var e;return this._isLoaded&&((e=this._obtainInnerBounds()).x=this.bounds.x,e.y=this.bounds.y),e},enumerable:!0,configurable:!0}),FEt._load=function(e,t){var i=new FEt;return i._isLoaded=!0,i._initialize(e,t),i},FEt.prototype._initialize=function(e,t){PEt.prototype._initialize.call(this,e,t)},FEt.prototype._postProcess=function(){var e,t;this._dictionary.has("BS")?e=this.border.width:((t=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",t)),void 0===e&&(e=1),this._dictionary.has("C")||(this._isTransparentColor=!0),this._dictionary.has("AP")&&this._isLoaded&&!this._isRotated?this._parseStampAppearance():this._appearanceTemplate=this._createRubberStampAppearance()},FEt.prototype._transformBBox=function(e,t){var i=[],n=[],o=this._transformPoint(e.x,e.y+e.height,t),o=(i[0]=o[0],n[0]=o[1],this._transformPoint(e.x+e.width,e.y,t)),o=(i[1]=o[0],n[1]=o[1],this._transformPoint(e.x,e.y,t)),o=(i[2]=o[0],n[2]=o[1],this._transformPoint(e.x+e.width,e.y+e.height,t));return i[3]=o[0],n[3]=o[1],[this._minValue(i),this._minValue(n),this._maxValue(i),this._maxValue(n)]},FEt.prototype._transformPoint=function(e,t,i){var n=[];return n[0]=e*i[0]+t*i[2]+i[4],n[1]=e*i[1]+t*i[3]+i[5],n},FEt.prototype._minValue=function(e){for(var t=e[0],i=1;i<e.length;i++)e[Number.parseInt(i.toString(),10)]<t&&(t=e[Number.parseInt(i.toString(),10)]);return t},FEt.prototype._maxValue=function(e){for(var t=e[0],i=1;i<e.length;i++)e[Number.parseInt(i.toString(),10)]>t&&(t=e[Number.parseInt(i.toString(),10)]);return t},FEt.prototype._doPostProcess=function(e){void 0===e&&(e=!1);var t,i,n=!1;this._isLoaded&&(this._setAppearance||e||this._isExport)?((!e&&!this._isExport||this._setAppearance||this._isRotated)&&(this._appearanceTemplate=this._createRubberStampAppearance()),!this._appearanceTemplate&&(this._isExport||e)&&this._dictionary.has("AP")&&(n=this._parseStampAppearance())):(this._isImported&&this._dictionary.has("AP")||this._postProcess(),this._appearanceTemplate||!e&&!this._isImported||(this._dictionary.has("AP")?(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"))&&((t=t.getRaw("N"))&&(i.reference=t),this._appearanceTemplate=new _It(i,this._crossReference)):this._appearanceTemplate=this._createRubberStampAppearance())),void 0!==this.flattenPopups&&this.flattenPopups&&(this._isLoaded?this._flattenLoadedPopUp():this._flattenPopUp()),e&&this._appearanceTemplate?(t=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary),this._appearanceTemplate._content.dictionary.has("Matrix")||(i=this._appearanceTemplate._content.dictionary.getArray("BBox"))&&this._appearanceTemplate._content.dictionary.update("Matrix",[1,0,0,1,-i[0],-i[1]]),n?this._flattenAnnotationTemplate(this._appearanceTemplate,n):this._flattenAnnotationTemplate(this._appearanceTemplate,t)):e&&this._page.annotations.remove(this)},FEt.prototype._parseStampAppearance=function(){var e=!1,t=this._dictionary.get("AP");if(t&&t.has("N")){var i=t.get("N");if(i){t=t.getRaw("N"),t=(t&&(i.reference=t),!1);if(this._type===QAt.rubberStampAnnotation){var n=!1,o=void 0,r=void 0;if(i&&(n=(n=this._page.rotation===TAt.angle0&&this.rotationAngle===TAt.angle0)||this._page.rotation!==TAt.angle0&&this.rotationAngle===TAt.angle0),this._appearanceTemplate=new _It(i,this._crossReference),t=!0,e=!!n){var s=i.dictionary.getArray("Matrix");if(s){for(var a=[],l=0;l<s.length;l++){var h=s[Number.parseInt(l.toString(),10)];a[Number.parseInt(l.toString(),10)]=h}var n=i.dictionary.getArray("BBox");n&&3<n.length?(r=LMt(n),o=[(n=this._transformBBox(r,a))[2],n[3]],this._appearanceTemplate._size=o):o=[r.width,r.height]}}else r&&(o=[r.width,r.height])}t||(this._appearanceTemplate=new _It(i,this._crossReference))}}return e},FEt.prototype._createRubberStampAppearance=function(){var e=[0,0,this.bounds.width,this.bounds.height],e=(this._appearance?(t=this._appearance,this._dictionary.has("Name")||this._dictionary.update("Name",k.get("#23CustomStamp"))):(this._iconString=this._obtainIconName(this.icon),this._dictionary.update("Name",k.get("#23"+this._iconString)),(t=new ATt(this,e)).normal=new _It(e,this._crossReference)),t.normal),t=(!this._alterRotateBounds||void 0===this._rotate||this._rotate===TAt.angle0&&0===this._getRotationAngle()?this.rotateAngle=this._getRotationAngle():(this.rotateAngle=this._getRotationAngle(),0===this.rotateAngle&&(this.rotateAngle=90*this.rotationAngle),this.bounds=this._getRotatedBounds(this.bounds,this.rotateAngle)),nkt(e,this.rotateAngle),this._appearance||this._drawStampAppearance(e),this._dictionary.has("AP")&&xkt(this._dictionary.get("AP"),this._crossReference,"N"),new mPt),i=(e._content.dictionary._updated=!0,this._crossReference._getNextReference());return this._crossReference._cacheMap.set(i,e._content),e._content.reference=i,t.set("N",i),t._updated=!0,this._dictionary.set("AP",t),this._dictionary.set("Border",[this.border.hRadius,this.border.vRadius,this.border.width]),this._dictionary.update("Rect",jkt(this)),e},FEt.prototype._drawStampAppearance=function(e){var t=new E1t,i=(t.alignment=MAt.center,t.lineAlignment=T1t.middle,new fIt(this._obtainBackGroundColor())),n=new yIt(this._obtainBorderColor(),this.border.width),o=e.graphics,e=(o.save(),o.scaleTransform(e._size[0]/(this._stampWidth+4),e._size[1]/28),this._stampAppearanceFont);this._drawRubberStamp(o,n,i,e,t),o.restore()},FEt.prototype._obtainIconName=function(e){switch(e){case FAt.approved:this._iconString="Approved",this._stampWidth=126;break;case FAt.asIs:this._iconString="AsIs",this._stampWidth=75;break;case FAt.confidential:this._iconString="Confidential",this._stampWidth=166;break;case FAt.departmental:this._iconString="Departmental",this._stampWidth=186;break;case FAt.draft:this._iconString="Draft",this._stampWidth=90;break;case FAt.experimental:this._iconString="Experimental",this._stampWidth=176;break;case FAt.expired:this._iconString="Expired",this._stampWidth=116;break;case FAt.final:this._iconString="Final",this._stampWidth=90;break;case FAt.forComment:this._iconString="ForComment",this._stampWidth=166;break;case FAt.forPublicRelease:this._iconString="ForPublicRelease",this._stampWidth=240;break;case FAt.notApproved:this._iconString="NotApproved",this._stampWidth=186;break;case FAt.notForPublicRelease:this._iconString="NotForPublicRelease",this._stampWidth=290;break;case FAt.sold:this._iconString="Sold",this._stampWidth=75;break;case FAt.topSecret:this._iconString="TopSecret",this._stampWidth=146;break;case FAt.completed:this._iconString="Completed",this._stampWidth=136;break;case FAt.void:this._iconString="Void",this._stampWidth=75;break;case FAt.informationOnly:this._iconString="InformationOnly",this._stampWidth=230;break;case FAt.preliminaryResults:this._iconString="PreliminaryResults",this._stampWidth=260}return this._iconString},FEt.prototype._obtainBackGroundColor=function(){return this._icon===FAt.notApproved||this._icon===FAt.void?[251,222,221]:this._icon===FAt.approved||this._icon===FAt.final||this._icon===FAt.completed?[229,238,222]:[219,227,240]},FEt.prototype._obtainBorderColor=function(){return this._icon===FAt.notApproved||this._icon===FAt.void?[151,23,15]:this._icon===FAt.approved||this._icon===FAt.final||this._icon===FAt.completed?[73,110,38]:[24,37,100]},FEt.prototype._drawRubberStamp=function(e,t,i,n,o){e.drawRoundedRectangle(2,1,this._stampWidth,26,3,t,i);t=new fIt(this._obtainBorderColor());e.drawString(this._iconString.toUpperCase(),n,[this._stampWidth/2+1,15,0,0],null,t,o)},FEt.prototype._obtainInnerBounds=function(){var e,t={x:0,y:0,width:0,height:0};return t=this._dictionary&&this._dictionary.has("AP")&&(e=this._dictionary.get("AP"))&&e.has("N")&&(e=e.get("N"))&&void 0!==e.dictionary&&(e=e.dictionary).has("BBox")&&(e=e.getArray("BBox"))&&4===e.length?LMt(e):t};var PEt,BEt=FEt;function FEt(e,t,i,n){var o=PEt.call(this)||this;return o._icon=FAt.draft,o._stampWidth=0,o._iconString="",o.rotateAngle=0,o._alterRotateBounds=!0,o._stampAppearanceFont=new _xt(Zxt.helvetica,20,Jxt.italic|Jxt.bold),o._dictionary=new mPt,o._dictionary.update("Type",k.get("Annot")),o._dictionary.update("Subtype",k.get("Stamp")),void 0!==e&&void 0!==t&&void 0!==i&&void 0!==n&&(o.bounds={x:e,y:t,width:i,height:n}),o._type=QAt.rubberStampAnnotation,o}Met(OEt,LEt=MTt),OEt._load=function(e,t){var i=new OEt;return i._isLoaded=!0,i._initialize(e,t),i},OEt.prototype._initialize=function(e,t){LEt.prototype._initialize.call(this,e,t)},OEt.prototype._doPostProcess=function(e){var t;(e=void 0===e?!1:e)&&(e=void 0,this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(e=t.get("N"),t=t.getRaw("N"))&&e&&(e.reference=t),e?(t=new _It(e,this._crossReference),e=this._validateTemplateMatrix(t._content.dictionary),this._flattenAnnotationTemplate(t,e)):this._removeAnnotation(this._page,this))};var LEt,REt=OEt;function OEt(){var e=LEt.call(this)||this;return e._type=QAt.soundAnnotation,e}Met(_Et,NEt=MTt),Object.defineProperty(_Et.prototype,"calloutLines",{get:function(){return void 0===this._calloutLines&&(this._calloutLines=this._getCalloutLinePoints()),this._calloutLines},set:function(e){this._isLoaded||(this._calloutLines=e);var t=!1;if(this._isLoaded&&2<=e.length)if(this._calloutLines.length===e.length){for(var i=0;i<e.length;i++)for(var n=e[Number.parseInt(i.toString(),10)],o=0;o<n.length;o++)if(e[Number.parseInt(i.toString(),10)][Number.parseInt(o.toString(),10)]!==this._calloutLines[Number.parseInt(i.toString(),10)][Number.parseInt(o.toString(),10)]){t=!0;break}}else t=!0;if(t){for(var r=this._page.size[1],s=[],i=0;i<e.length&&i<e.length;i++)s.push(e[Number.parseInt(i.toString(),10)][0]+this._cropBoxValueX),s.push(r+this._cropBoxValueY-e[Number.parseInt(i.toString(),10)][1]);this._calloutLines=e,this._dictionary.update("CL",s)}},enumerable:!0,configurable:!0}),Object.defineProperty(_Et.prototype,"lineEndingStyle",{get:function(){return this._isLoaded?this._lineEndingStyle=this._obtainLineEndingStyle():void 0===this._lineEndingStyle&&(this._lineEndingStyle=wAt.none),this._lineEndingStyle},set:function(e){void 0!==e&&this._dictionary.update("LE",k.get(zMt(e))),this._lineEndingStyle=e},enumerable:!0,configurable:!0}),Object.defineProperty(_Et.prototype,"textMarkUpColor",{get:function(){if(void 0===this._textMarkUpColor){var e,t=void 0;if(this._dictionary.has("TextColor"))return this._textMarkUpColor=VMt(this._dictionary.getArray("TextColor")),this._textMarkUpColor;if(this._dictionary.has("DS"))for(var i=this._dictionary.get("DS").split(";"),n=0;n<i.length;n++)if(-1!==i[Number.parseInt(n.toString(),10)].indexOf("color"))return(t=i[Number.parseInt(n.toString(),10)].split(":")[1]).startsWith("#")&&(t=t.substring(1)),this._textMarkUpColor=NMt(t),this._textMarkUpColor;!this._textMarkUpColor&&this._dictionary.has("RC")&&(e=[],0<this._parsedXMLData.length)&&this._parsedXMLData[3]&&(e=this._parsedXMLData[3]._color,this._textMarkUpColor=e)}return this._textMarkUpColor},set:function(e){void 0!==e&&3===e.length&&(this._textMarkUpColor=e,this._updateStyle(this.font,e,this.textAlignment)),this._isContentUpdated=!0},enumerable:!0,configurable:!0}),Object.defineProperty(_Et.prototype,"textAlignment",{get:function(){var e;return this._dictionary.has("Q")?this._textAlignment=this._dictionary.get("Q"):this._dictionary.has("RC")&&(e=void 0,0<this._parsedXMLData.length)&&this._parsedXMLData[1]&&(e=this._parsedXMLData[1],this._textAlignment=e),this._textAlignment},set:function(e){this._textAlignment!==e&&this._dictionary.update("Q",e),this._textAlignment=e,this._isContentUpdated=!0},enumerable:!0,configurable:!0}),Object.defineProperty(_Et.prototype,"font",{get:function(){return!this._font&&(this._font=this._obtainFont(),null===this._font||void 0===this._font||!this._isLoaded&&1===this._font.size)&&(this._font=this._markUpFont),this._font},set:function(e){this._font=e,this._isContentUpdated=!0},enumerable:!0,configurable:!0}),Object.defineProperty(_Et.prototype,"borderColor",{get:function(){return void 0===this._borderColor&&this._dictionary.has("DA")&&(this._borderColor=this._obtainColor()),this._borderColor},set:function(e){void 0!==e&&3===e.length&&(this._borderColor=e,this._dictionary.update("DA",this._getBorderColorString(this.borderColor)))},enumerable:!0,configurable:!0}),Object.defineProperty(_Et.prototype,"annotationIntent",{get:function(){return this._dictionary.has("IT")?this._annotationIntent=ykt(this._dictionary.get("IT").name):this._annotationIntent=HAt.none,this._annotationIntent},set:function(e){void 0!==e&&((this._annotationIntent=e)===HAt.none?this._dictionary.update("Subj","Text Box"):this._dictionary.update("IT",k.get(this._obtainAnnotationIntent(this._annotationIntent))))},enumerable:!0,configurable:!0}),Object.defineProperty(_Et.prototype,"_mkDictionary",{get:function(){var e;return e=this._dictionary.has("MK")?this._dictionary.get("MK"):e},enumerable:!0,configurable:!0}),_Et._load=function(e,t){var i=new _Et;return i._isLoaded=!0,i._initialize(e,t),t.has("RC")&&(i._parsedXMLData=i._parseMarkupLanguageData(t.get("RC"))),i},_Et.prototype._setPaddings=function(e){this._paddings=e},_Et.prototype._initialize=function(e,t){NEt.prototype._initialize.call(this,e,t)},_Et.prototype._postProcess=function(e){if(void 0===this.bounds||null===this.bounds)throw new Error("Bounds cannot be null or undefined");this._dictionary.has("BS")?t=this.border.width:((i=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",i)),void 0===t&&(t=1),this._dictionary.has("C")||(this._isTransparentColor=!0);var t,i=this._getCropOrMediaBox();i&&3<i.length&&"number"==typeof i[0]&&"number"==typeof i[1]&&(0!==i[0]||0!==i[1])&&(this._cropBoxValueX=i[0],this._cropBoxValueY=i[1]),(e||this._setAppearance)&&(this._appearanceTemplate=this._createAppearance()),e||(this._dictionary.update("Rect",jkt(this)),this._saveFreeTextDictionary())},_Et.prototype._doPostProcess=function(e){var t,i,n;void 0===e&&(e=!1),this._isLoaded?((this._setAppearance||e&&!this._dictionary.has("AP"))&&(this._appearanceTemplate=this._createAppearance()),!this._appearanceTemplate&&e&&this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"))&&((n=t.getRaw("N"))&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference))):(this._postProcess(e),!this._appearanceTemplate&&e&&(this._dictionary.has("AP")?(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"))&&((n=t.getRaw("N"))&&(i.reference=n),this._appearanceTemplate=new _It(i,this._crossReference)):this._appearanceTemplate=this._createAppearance())),void 0!==this.flattenPopups&&this.flattenPopups&&(this._isLoaded?this._flattenLoadedPopUp():this._flattenPopUp()),e&&this._appearanceTemplate?(t=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary),this._appearanceTemplate._content.dictionary.has("Matrix")||this._isLoaded||(i=this._appearanceTemplate._content.dictionary.getArray("BBox"))&&this._appearanceTemplate._content.dictionary.update("Matrix",[1,0,0,1,-i[0],-i[1]]),(t&&void 0!==this._page.rotation&&this._page.rotation!==TAt.angle0||this._appearanceTemplate&&!this._dictionary.has("AP")||this._dictionary.has("AP")&&this._isValidTemplateMatrix(this._appearanceTemplate._content.dictionary,this.bounds,this._appearanceTemplate))&&this._flattenAnnotationTemplate(this._appearanceTemplate,t)):e&&this._page.annotations.remove(this),this._dictionary.has("RC")&&this._isContentUpdated&&this._updateStyle(this.font,this._textMarkUpColor,this.textAlignment),!e&&this._setAppearance&&(i=void 0,this._dictionary.has("AP")?i=this._dictionary.get("AP"):(t=this._crossReference._getNextReference(),i=new mPt(this._crossReference),this._crossReference._cacheMap.set(t,i),this._dictionary.update("AP",t)),xkt(i,this._crossReference,"N"),n=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(n,this._appearanceTemplate._content),i.update("N",n))},_Et.prototype._isValidTemplateMatrix=function(e,t,i){var n,o,r=!0;return e&&e.has("Matrix")&&(n=e.getArray("BBox"),e=e.getArray("Matrix"))&&n&&3<e.length&&2<n.length&&void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]&&1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&void 0!==n[0]&&void 0!==n[1]&&void 0!==n[2]&&void 0!==n[3]&&(Math.round(n[0])!==Math.round(-e[4])&&Math.round(n[1])!==Math.round(-e[5])||0===n[0]&&0===Math.round(-e[4]))&&(o=(e=this._page.graphics).save(),void 0!==this.opacity&&this._opacity<1&&e.setTransparency(this._opacity),t.x-=n[0],t.y+=n[1],e.drawTemplate(i,t),e.restore(o),this._page.annotations.remove(this),r=!1),r},_Et.prototype._createAppearance=function(){for(var e=this.border.width/2,t=this._obtainAppearanceBounds(),i=this.rotate,n=(0!==i&&90!==i&&180!==i&&270!==i||(this._isAllRotation=!1),(i=0<i&&this._isAllRotation?new _It([0,0,t[2],t[3]],this._crossReference):new _It(t,this._crossReference))._content.dictionary.getArray("BBox")),o=this._getRotationAngle(),o=(n&&null!=o&&i._content.dictionary.set("Matrix",[1,0,0,1,-n[0],-n[1]]),new mDt),n=this._obtainText(),r=(i._writeTransformation=!1,i.graphics),s=this._obtainTextAlignment(),a=this._obtainColor(),a=new yIt(a,this.border.width),t=(0<this.border.width&&(o.borderPen=a),this._obtainStyle(a,t,e,o)),e=(this.color&&(o.foreBrush=new fIt(this._color)),this.textMarkUpColor&&(o.backBrush=new fIt(this._textMarkUpColor)),o.borderWidth=this.border.width,this.calloutLines&&2<=this._calloutLines.length?(this._drawCallOuts(r,a),this._isLoaded&&void 0===this._lineEndingStyle&&(this._lineEndingStyle=this.lineEndingStyle),this._lineEndingStyle!==wAt.none&&(e=this._obtainLinePoints(),d=this._getAngle(e),e=this._getAxisValue([e[2],e[3]],90,0),this._drawLineEndStyle(e,r,d,a,o.foreBrush,this.lineEndingStyle,this.border.width,!1)),(t=this._dictionary.has("RD")?[t[0],-t[1],t[2],-t[3]]:[this.bounds.x,-(this._page.size[1]-(this.bounds.y+this.bounds.height)),this.bounds.width,-this.bounds.height])[0]=t[0]+this._cropBoxValueX,t[1]=t[1]-this._cropBoxValueY,this._calculateRectangle(t)):t=[t[0],-t[1],t[2],-t[3]],o.bounds=t,this._obtainAppearanceBounds()),l=[t[0]-e[0],-t[1]-e[1],t[2]-e[2],-t[1]-e[1]-t[3]-e[3]],h=0;h<l.length;h++)l[Number.parseInt(h.toString(),10)]<0&&(l[Number.parseInt(h.toString(),10)]=-l[Number.parseInt(h.toString(),10)]);this._dictionary.update("RD",l),this.opacity&&this._opacity<1&&(r.save(),r.setTransparency(this._opacity)),this.rotationAngle&&this._rotate!==TAt.angle0&&r.save(),this._drawFreeTextRectangle(r,o,t,s),n&&this._drawFreeMarkUpText(r,o,t,n,s),this.opacity&&this._opacity<1&&r.restore(),this.rotationAngle&&this._rotate!==TAt.angle0&&r.restore();var d=this._obtainAppearanceBounds();return this.flatten&&(this._bounds={x:d[0],y:this._page.size[1]-(d[1]+d[3]),width:d[2],height:d[3]}),this._dictionary.set("Rect",[d[0],d[1],d[0]+d[2],d[1]+d[3]]),i},_Et.prototype._calculateRectangle=function(e){for(var t=this._obtainAppearanceBounds(),i=[e[0]-t[0],-e[1]-t[1],e[2]-t[2],-e[1]-t[1]-e[3]-t[3]],n=0;n<4;n++)i[Number.parseInt(n.toString(),10)]<0&&(i[Number.parseInt(n.toString(),10)]=-i[Number.parseInt(n.toString(),10)]);this._dictionary.set("RD",i)},_Et.prototype._obtainAnnotationIntent=function(e){switch(e){case HAt.freeTextCallout:this._intentString="FreeTextCallout";break;case HAt.freeTextTypeWriter:this._intentString="FreeTextTypeWriter"}return this._intentString},_Et.prototype._obtainFont=function(){var e,t=this._obtainFontDetails();return!t.size&&this._dictionary.has("RC")&&(e=void 0,(e=0<this._parsedXMLData.length&&this._parsedXMLData[0]?this._parsedXMLData[0]:e)instanceof _xt||e instanceof jxt)&&(e=e,t.size=e.size,t.style=e.style,t.name=e._fontFamily.toString()),Nkt(t.name,t.size,t.style,this)},_Et.prototype._updateStyle=function(e,t,i){var n,o,r="font:"+e._metrics._name+" "+e.size+"pt;style:"+vkt(e.style)+";color:"+this._colorToHex(t),r=(this._dictionary.update("DS",r),'<?xml version="1.0"?><body xmlns="http://www.w3.org/1999/xhtml" style="font:'+e._metrics._name+" "+e.size+"pt;font-weight:"+(e.isBold?"bold":"normal")+";color:"+this._colorToHex(t)+'"><p dir="ltr">');if(null!=i){switch(i){case MAt.left:o="left";break;case MAt.center:o="center";break;case MAt.right:o="right";break;case MAt.justify:o="justify"}o&&(n="text-align:"+o+";")}var t="",i="font-style:italic",s="font-style:bold";e.isUnderline?(t=e.isStrikeout?"text-decoration:word line-through":"text-decoration:word",e.isItalic?t+=";"+i:e.isBold&&(t+=";"+s)):e.isStrikeout?(t="text-decoration:line-through",e.isItalic?t+=";"+i:e.isBold&&(t+=";"+s)):e.isItalic?t+=i:e.isBold&&(t+=s),i=""!==t?'<span style = "'+n+t+'">'+(this.text?this._getXmlFormattedString(this.text):"")+"</span>":'<span style = "'+n+'">'+(this.text?this._getXmlFormattedString(this.text):"")+"</span>",this._dictionary.update("RC",r+i+"</p></body>")},_Et.prototype._drawFreeMarkUpText=function(e,t,i,n,o){var r,s,a=!1,l=this.rotate,h=(this.rotationAngle!==TAt.angle90||this._isAllRotation?this.rotationAngle!==TAt.angle180||this._isAllRotation?this.rotationAngle!==TAt.angle270||this._isAllRotation?0!==l||this._isAllRotation||(i=[i[0],i[1]+i[3],i[2],i[3]]):i=[i[1]+i[3],-(i[0]+i[2]),-i[3],i[2]]:i=[-(i[2]+i[0]),-i[1],i[2],-i[3]]:i=[-i[1],i[0],-i[3],i[2]],void 0!==this._font&&null!==this._font&&(this._isLoaded||1!==this._font.size)||(this._font=this._markUpFont),0<l&&this._isAllRotation&&(a=!0,h=this.bounds,d=new E1t(MAt.center,T1t.middle),d=this._font.measureString(n,[0,0],d,0,0),0<l&&l<=91?e.translateTransform(d[1],-h.height):91<l&&l<=181?e.translateTransform(h.width-d[1],-(h.height-d[1])):181<l&&l<=271?e.translateTransform(h.width-d[1],-d[1]):271<l&&l<360&&e.translateTransform(d[1],-d[1]),e.rotateTransform(l),t.bounds=[0,0,t.bounds[2],t.bounds[3]]),[i[0],i[1],i[2],i[3]]),d=(this._paddings&&!this._isLoaded?(d=this._paddings._left,l=this._paddings._top,r=this._paddings._right+this._paddings._left,s=this._paddings._top+this._paddings._bottom,i=0<t.borderWidth?[i[0]+(t.borderWidth+d),i[1]+(t.borderWidth+l),i[2]-(2*t.borderWidth+r),0<i[3]?i[3]-(2*t.borderWidth+s):-i[3]-(2*t.borderWidth+s)]:[i[0]+d,i[1]+l,i[2]-r,0<i[3]?i[3]-s:-i[3]-s]):0<t.borderWidth&&(i=[i[0]+1.5*t.borderWidth,i[1]+1.5*t.borderWidth,i[2]-3*t.borderWidth,0<i[3]?i[3]-3*t.borderWidth:-i[3]-3*t.borderWidth]),this._font._metrics._getHeight()>(0<i[3]?i[3]:-i[3])),l=this._font._metrics._getHeight()<=(0<h[3]?h[3]:-h[3]);this._drawFreeTextAnnotation(e,t,n,this._font,d&&l?h:i,!0,o,a)},_Et.prototype._drawFreeTextRectangle=function(e,t,i,n){if(this._dictionary.has("BE")){for(var o=0;o<i.length;o++)i[Number.parseInt(o.toString(),10)]<0&&(i[Number.parseInt(o.toString(),10)]=-i[Number.parseInt(o.toString(),10)]);this._drawAppearance(e,t,i),this.rotationAngle!==TAt.angle90||this._isAllRotation?this.rotationAngle!==TAt.angle180||this._isAllRotation?this.rotationAngle!==TAt.angle270||this._isAllRotation||e.rotateTransform(-270):e.rotateTransform(-180):e.rotateTransform(-90)}else this.rotationAngle!==TAt.angle90||this._isAllRotation?this.rotationAngle!==TAt.angle180||this._isAllRotation?this.rotationAngle!==TAt.angle270||this._isAllRotation||(e.rotateTransform(-270),t.bounds=[i[1]+i[3],-i[0],-i[3],-i[2]]):(e.rotateTransform(-180),t.bounds=[-(i[2]+i[0]),-(i[3]+i[1]),i[2],i[3]]):(e.rotateTransform(-90),t.bounds=[-i[1],i[2]+i[0],-i[3],-i[2]]),0<t.borderWidth&&!this._isAllRotation&&(i=t.bounds),this._drawFreeTextAnnotation(e,t,"",this._font,i,!1,n,!1)},_Et.prototype._drawAppearance=function(e,t,i){var n=new nIt;n.addRectangle(i[0],i[1],i[2],i[3]),this._dictionary.has("BE")&&(i=this._dictionary.get("BE"))&&i.has("I")&&(i=i.get("I"),this._drawCloudStyle(e,t.foreBrush,t.borderPen,1===i?4:9,.833,n._points,!0))},_Et.prototype._drawFreeTextAnnotation=function(e,t,i,n,o,r,s,a){r?((r=new E1t).lineAlignment=T1t.top,r.alignment=s,r.lineSpacing=0,a?e.drawString(i,n,t.bounds,null,t.backBrush,r):e.drawString(i,n,o,null,t.backBrush,r)):e.drawRectangle(o[0],o[1],o[2],o[3],t.borderPen,t.foreBrush)},_Et.prototype._getCalloutLinePoints=function(){if(this._dictionary.has("CL")){var e=this._dictionary.getArray("CL");if(e){this._calloutLines=[];for(var t=0;t<e.length;t+=2){var i=[e[Number.parseInt(t.toString(),10)],this._page.size[1]-e[t+1]];this._calloutLines.push(i)}}}return this._calloutLines},_Et.prototype._obtainAppearanceBounds=function(){var e=[0,0,0,0];if(this.calloutLines&&0<this._calloutLines.length){for(var t=new nIt,i=[],n=2===this._calloutLines.length?2:3,o=0;o<n;o++)i.push([0,0]);if(2<=this._calloutLines.length){this._obtainCallOutsNative();for(o=0;o<this._calloutLines.length&&o<3;o++)i[Number.parseInt(o.toString(),10)]=[this._calloutsClone[Number.parseInt(o.toString(),10)][0],this._calloutsClone[Number.parseInt(o.toString(),10)][1]]}0<i.length&&(this.lineEndingStyle!==wAt.none&&this._expandAppearance(i),t._addLines(i)),t.addRectangle(this.bounds.x+this._cropBoxValueX-2,this._page.size[1]+this._cropBoxValueY-(this.bounds.y+this.bounds.height)-2,this.bounds.width+4,this.bounds.height+4),e=t._getBounds()}else e=[this.bounds.x+this._cropBoxValueX,this._page.size[1]+this._cropBoxValueY-(this.bounds.y+this.bounds.height),this.bounds.width,this.bounds.height];return e},_Et.prototype._obtainCallOutsNative=function(){if(this.calloutLines&&0<this._calloutLines.length){var e=this._page.size;this._calloutsClone=[];for(var t=0;t<this._calloutLines.length;t++)this._calloutsClone.push([this._calloutLines[Number.parseInt(t.toString(),10)][0]+this._cropBoxValueX,e[1]+this._cropBoxValueY-this._calloutLines[Number.parseInt(t.toString(),10)][1]])}},_Et.prototype._obtainLinePoints=function(){var e=this._page.size[1];return[this.calloutLines[1][0]+this._cropBoxValueX,e+this._cropBoxValueY-this.calloutLines[1][1],this.calloutLines[0][0]+this._cropBoxValueX,e+this._cropBoxValueY-this.calloutLines[0][1]]},_Et.prototype._obtainLineEndingStyle=function(){var e=wAt.square;return e=this._dictionary.has("LE")?jMt(this._dictionary.get("LE").name,e):e},_Et.prototype._obtainText=function(){var e,t="",i=this._dictionary.has("Contents");return i?((t=(e=this._dictionary.get("Contents"))?e:t)&&""!==t&&(this._text=t),t):this._dictionary.has("RC")&&!i&&null===t?this._rcText:t},_Et.prototype._obtainTextAlignment=function(){var e,t=MAt.left;if(this._dictionary.has("Q")?void 0!==(i=this._dictionary.get("Q"))&&(t=i,e=!0):this._dictionary.has("RC")&&0<this._parsedXMLData.length&&this._parsedXMLData[1]&&(t=this._parsedXMLData[1],e=!0),!e&&this._dictionary.has("DS"))for(var i,n=(i=this._dictionary.get("DS")).split(";"),o=0;o<n.length;o++)if(-1!==n[Number.parseInt(o.toString(),10)].indexOf("text-align"))switch(n[Number.parseInt(o.toString(),10)]){case"left":t=MAt.left;break;case"right":t=MAt.right;break;case"center":t=MAt.center;break;case"justify":t=MAt.justify}return t},_Et.prototype._obtainColor=function(){var e,t;return this._isLoaded?this._dictionary.has("DA")?(t=this._dictionary.get("DA"),Array.isArray(t)&&0<t.length?e=[t[0],t[1],t[2]]:"string"==typeof t&&(this._da=new CTt(t),e=this._da.color)):this._dictionary.has("MK")?(t=this._mkDictionary)&&t.has("BC")&&(e=VMt(t.getArray("BC"))):e=[0,0,0]:e=this._borderColor||[0,0,0],e},_Et.prototype._expandAppearance=function(e){var t=e[0][1],i=e[0][0];(t=this._isLoaded?t:this._page.size[1]-t)>this.bounds.y?this.lineEndingStyle!==wAt.openArrow&&(e[0][1]-=11*this.border.width):e[0][1]+=11*this.border.width,i<=this.bounds.x?e[0][0]-=11*this.border.width:e[0][0]+=11*this.border.width},_Et.prototype._drawCallOuts=function(e,t){for(var i=new nIt,n=[],o=2===this._calloutLines.length?2:3,r=0;r<o;r++)n.push([0,0]);if(2<=this._calloutLines.length){this._obtainCallOutsNative();for(r=0;r<this._calloutLines.length&&r<3;r++)n[Number.parseInt(r.toString(),10)]=[this._calloutsClone[Number.parseInt(r.toString(),10)][0],-this._calloutsClone[Number.parseInt(r.toString(),10)][1]]}0<n.length&&i._addLines(n),e.drawPath(i,t)},_Et.prototype._saveFreeTextDictionary=function(){if(void 0!==this.font&&null!==this.font&&(this._isLoaded||1!==this.font.size)||(this.font=this._markUpFont),"string"==typeof this.text&&null!==this.text&&this._dictionary.update("Contents",this.text),this._isLoaded&&(this._textAlignment=this.textAlignment),this._dictionary.update("Q",this._textAlignment),this.annotationIntent===HAt.none?this._dictionary.update("Subj","Text Box"):this._dictionary.update("IT",k.get(this._obtainAnnotationIntent(this._annotationIntent))),this._updateStyle(this.font,this.textMarkUpColor,this._textAlignment),this._dictionary.update("DA",this._getBorderColorString(this.borderColor?this._borderColor:[0,0,0])),this._calloutLines&&2<=this._calloutLines.length){for(var e=this._page.size[1],t=[],i=0;i<this._calloutLines.length&&i<3;i++)t.push(this._calloutLines[Number.parseInt(i.toString(),10)][0]+this._cropBoxValueX),t.push(e+this._cropBoxValueY-this._calloutLines[Number.parseInt(i.toString(),10)][1]);this._dictionary.update("CL",t)}var n;this._setAppearance&&(n=this._obtainAppearanceBounds(),this._dictionary.update("Rect",[n[0],n[1],n[0]+n[2],n[1]+n[3]]))},_Et.prototype._getXmlFormattedString=function(e){return e=(e=(e=e.replace("&","&amp;")).replace("<","&lt;")).replace(">","&gt;")},_Et.prototype._parseMarkupLanguageData=function(e){var t,i,n=this,o=Jxt.regular,r=[];return(this._dictionary.has("Contents")?this._dictionary.get("Contents"):"").split("").some(function(e){return n._isSymbol(e)})||null!=e&&(t=(e=(new DOMParser).parseFromString(e,"text/xml").documentElement)&&e.namespaceURI||"",e)&&0<(e=this._collectStyles(e)).size&&(e=this._extractStylesToInput(e),e=this._getFontDetails(e,this.font.size,this.textAlignment,o,null),o=(e=this._updateFontProperties(e,"",o,null)).fontName,i=e.fontStyle,e=e.brush,o=Nkt(o,this.font._size,i,this),r=this._fontCollection(r,o,t,this._textAlignment,e)),this._parsedXMLData=r},_Et.prototype._collectStyles=function(e,t){if(void 0===t&&(t=new Map),e){var i=null;try{i=window.getComputedStyle(e)}catch(e){return t}t.set(e.tagName.toLowerCase(),i);for(var n=e.firstElementChild;n;)this._collectStyles(n,t),n=n.nextElementSibling}return t},_Et.prototype._extractStylesToInput=function(e){var o=[];return e.forEach(function(e){if(e&&0<e.length)for(var t=0;t<e.length;t++){var i,n=e.item(Number.parseInt(t.toString(),10));null!=n&&(i=e.getPropertyValue(n),o.push(n+": "+i))}}),o},_Et.prototype._isSymbol=function(e){var t=e.charCodeAt(0);return"_"!==e&&"+"!==e&&"-"!==e&&"*"!==e&&"="!==e&&(8352<=t&&t<=8399||8704<=t&&t<=8959||10752<=t&&t<=11007||8448<=t&&t<=8527||8960<=t&&t<=9215||11088===t)},_Et.prototype._updateFontProperties=function(e,i,n,o){var r=this;return e.forEach(function(e,t){switch(t){case"font-family":i=e;break;case"font-size":r.font._size=parseFloat(e);break;case"font-style":case"font-weight":case"text-decoration":n=r._obtainFontStyle(e,t);break;case"text-align":r._textAlignment=r._parseTextAlignment(e);break;case"color":o=e;break;case"xfa-spacerun":r._rcText=e}}),{fontName:i,fontStyle:n,brush:o}},_Et.prototype._obtainFontStyle=function(e,t){var i=parseFloat(e);switch(t){case"font-style":return 0===i?Jxt.regular:1===i?Jxt.bold:2===i?Jxt.italic:8===i?Jxt.strikeout:4===i?Jxt.underline:Jxt.regular;case"font-weight":return 1===i?Jxt.bold:Jxt.regular;case"text-decoration":return 8===i?Jxt.strikeout:4===i?Jxt.underline:Jxt.regular;default:return Jxt.regular}},_Et.prototype._parseTextAlignment=function(e){switch(parseFloat(e)){case 0:return MAt.left;case 1:return MAt.center;case 2:return MAt.right;case 3:return MAt.justify;default:return MAt.left}},_Et.prototype._getFontDetails=function(e,n,o,r,s){var a=this,l=new Map;return e.forEach(function(e){var e=e.split(":").map(function(e){return e.trim()}),t=e[0],i=e[1];if(t&&i)switch(t.toLowerCase()){case"font":a._parseFont(i,l);break;case"font-size":n=a._parseFontSize(i),l.set("font-size",n);break;case"font-weight":r=a._parseFontWeight(i,r),l.set("font-weight",r);break;case"font-family":l.set("font-family",a._parseFontFamily(i));break;case"color":s=new fIt(a._rgbStringToArray(i)),l.set("color",s);break;case"font-style":r=a._parseFontStyle(i,r),l.set("font-style",r);break;case"text-decoration":r=a._parseTextDecoration(i,r),l.set("text-decoration",r);break;case"text-align":o=a._parseTextAlign(i),l.set("text-align",o);break;case"xfa-spacerun":a._rcText=1<i.length&&i.includes("yes")?a._rcText+" ":a._rcText,l.set("xfa-spacerun",a._rcText)}}),l},_Et.prototype._parseFont=function(e,t){var e=e.split(" ").map(function(e){return e.trim()}),i="";e.forEach(function(e){e&&!e.endsWith("pt")?i+=e+" ":e.endsWith("pt")&&t.set("font-size",parseFloat(e.replace("pt","").replace(",",".").trim()))}),t.set("font-family",i.trim().replace(/['",]/g,""))},_Et.prototype._parseFontSize=function(e){return e.endsWith("pt")?parseFloat(e.replace("pt","").replace(",",".").trim()):0},_Et.prototype._parseFontWeight=function(e,t){return e.includes("bold")&&(t|=Jxt.bold),t},_Et.prototype._parseFontFamily=function(e){return e.replace(/^'+|'+$/g,"").trim()},_Et.prototype._parseFontStyle=function(e,t){return e.includes("normal")||e.includes("regular")?Jxt.regular:e.includes("underline")?Jxt.underline:e.includes("strikeout")?Jxt.strikeout:e.includes("italic")?Jxt.italic:e.includes("bold")?Jxt.bold:t},_Et.prototype._parseTextDecoration=function(e,t){return e.includes("word")?Jxt.underline:e.includes("line-through")?Jxt.strikeout:t},_Et.prototype._parseTextAlign=function(e){switch(e.trim().toLowerCase()){case"left":return MAt.left;case"right":return MAt.right;case"center":return MAt.center;case"justify":return MAt.justify;default:return MAt.left}},_Et.prototype._rgbStringToArray=function(e){e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(e)return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)];throw new Error("Invalid RGB string format")},_Et.prototype._fontCollection=function(e,t,i,n,o){return e.concat([t,n,i,o])};var NEt,VEt=_Et;function _Et(e,t,i,n){var o=NEt.call(this)||this;return o._intentString="",o._markUpFont=new _xt(Zxt.helvetica,7,Jxt.regular),o._textAlignment=MAt.left,o._cropBoxValueX=0,o._cropBoxValueY=0,o._dictionary=new mPt,o._dictionary.update("Type",k.get("Annot")),o._dictionary.update("Subtype",k.get("FreeText")),void 0!==e&&void 0!==t&&void 0!==i&&void 0!==n&&(o.bounds={x:e,y:t,width:i,height:n}),o._isContentUpdated=!1,o._type=QAt.freeTextAnnotation,o._parsedXMLData=[],o}Met(jEt,HEt=TTt),Object.defineProperty(jEt.prototype,"repeatText",{get:function(){return void 0===this._repeat&&this._dictionary.has("Repeat")&&(this._repeat=this._dictionary.get("Repeat")),this._repeat},set:function(e){e!==this._repeat&&(this._repeat=e,this._dictionary)&&this._dictionary.update("Repeat",e)},enumerable:!0,configurable:!0}),Object.defineProperty(jEt.prototype,"textAlignment",{get:function(){return this._dictionary.has("Q")&&(this._textAlignment=this._dictionary.get("Q")),this._textAlignment},set:function(e){this._textAlignment!==e&&this._dictionary.update("Q",e),this._textAlignment=e},enumerable:!0,configurable:!0}),Object.defineProperty(jEt.prototype,"textColor",{get:function(){return void 0===this._textColor&&this._dictionary.has("C")&&(this._textColor=VMt(this._dictionary.getArray("C"))),this._textColor},set:function(e){var t;void 0!==e&&3===e.length&&(t=this.textColor,this._isLoaded&&void 0!==t&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]||(this._textColor=e,this._dictionary.update("C",[Number.parseFloat((e[0]/255).toFixed(3)),Number.parseFloat((e[1]/255).toFixed(3)),Number.parseFloat((e[2]/255).toFixed(3))])))},enumerable:!0,configurable:!0}),Object.defineProperty(jEt.prototype,"borderColor",{get:function(){return void 0===this._borderColor&&this._dictionary.has("OC")&&(this._borderColor=VMt(this._dictionary.getArray("OC"))),this._borderColor},set:function(e){var t;void 0!==e&&3===e.length&&(t=this.borderColor,this._isLoaded&&void 0!==t&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]||(this._borderColor=e,this._dictionary.update("OC",[Number.parseFloat((e[0]/255).toFixed(3)),Number.parseFloat((e[1]/255).toFixed(3)),Number.parseFloat((e[2]/255).toFixed(3))])))},enumerable:!0,configurable:!0}),Object.defineProperty(jEt.prototype,"overlayText",{get:function(){return void 0===this._overlayText&&this._dictionary.has("OverlayText")&&(this._overlayText=this._dictionary.get("OverlayText")),this._overlayText},set:function(e){"string"==typeof e&&(this._dictionary.update("OverlayText",e),this._overlayText=e)},enumerable:!0,configurable:!0}),Object.defineProperty(jEt.prototype,"font",{get:function(){return this._font},set:function(e){this._font=e},enumerable:!0,configurable:!0}),jEt._load=function(e,t){var i=new jEt;return i._isLoaded=!0,i._initialize(e,t),i},jEt.prototype._initialize=function(e,t){HEt.prototype._initialize.call(this,e,t)},jEt.prototype._postProcess=function(e){if(void 0===this.bounds||null===this.bounds)throw new Error("Bounds cannot be null or undefined");var t,i;this._dictionary.has("BS")?t=this.border.width:((i=new mPt(this._crossReference)).set("Type",k.get("Border")),this._dictionary.set("BS",i)),void 0===t&&(t=1),this._setAppearance&&(this._appearanceTemplate=this._createRedactionAppearance(e)),this._dictionary.update("Rect",jkt(this))},jEt.prototype._doPostProcess=function(e){var t,i;void 0===e&&(e=!1),this._isImported||(this._isLoaded?this._appearanceTemplate=this._createRedactionAppearance(e):(this._postProcess(e),this._appearanceTemplate||e&&(this._dictionary.has("AP")?(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"))&&((t=t.getRaw("N"))&&(i.reference=t),this._appearanceTemplate=new _It(i,this._crossReference)):this._appearanceTemplate=this._createRedactionAppearance(e))),e&&this._appearanceTemplate?(t=this._validateTemplateMatrix(this._appearanceTemplate._content.dictionary),this._appearanceTemplate._content.dictionary.has("Matrix")||(i=this._appearanceTemplate._content.dictionary.getArray("BBox"))&&this._appearanceTemplate._content.dictionary.update("Matrix",[1,0,0,1,-i[0],-i[1]]),this._flattenAnnotationTemplate(this._appearanceTemplate,t)):e&&this._page.annotations.remove(this))},jEt.prototype._createRedactionAppearance=function(e){var t,i,n=this._createNormalAppearance();return e?this._isLoaded&&null!==this._page&&this._page.annotations.remove(this):(e=this._createBorderAppearance(),this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t instanceof mPt&&(xkt(t,this._crossReference,"N"),xkt(t,this._crossReference,"R")),t=new mPt(this._crossReference),e._content.dictionary._updated=!0,i=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(i,e._content),e._content.reference=i,t.set("N",i),n._content.dictionary._updated=!0,e=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(e,n._content),n._content.reference=e,t.set("R",e),t._updated=!0,this._dictionary.set("AP",t)),n},jEt.prototype._createBorderAppearance=function(){var e,t,i=[0,0,this.bounds.width,this.bounds.height],n=new _It(i,this._crossReference),o=this.border.width/2,r=n.graphics,s=this.border.width,i=(0<this.border.width&&this.borderColor&&(e=new yIt(this.borderColor,s)),[i[0],i[1],i[2],i[3]]);return this.opacity<1?(t=r.save(),r.setTransparency(this.opacity),r.drawRectangle(i[0]+o,i[1]+o,i[2]-s,i[3]-s,e,null),r.restore(t)):r.drawRectangle(i[0]+o,i[1]+o,i[2]-s,i[3]-s,e,null),n},jEt.prototype._createNormalAppearance=function(){var e,t,i,n=[0,0,this.bounds.width,this.bounds.height],o=new _It(n,this._crossReference),r=(nkt(o,this._getRotationAngle()),this.border.width/2),s=o.graphics,a=new mDt,a=(this.textColor&&0<this.border.width&&(e=new yIt(this.textColor,this.border.width)),this.innerColor&&(t=new fIt(this.innerColor)),i=this.textColor?new fIt(this.textColor):new fIt([128,128,128]),a.backBrush=t,a.borderWidth=r,this.border.width),n=[n[0],n[1],n[2],n[3]];if(this.opacity<1?(c=s.save(),s.setTransparency(this.opacity),s.drawRectangle(n[0]+r,n[1]+r,n[2]-a,n[3]-a,e,t),s.restore(c)):s.drawRectangle(n[0]+r,n[1]+r,n[2]-a,n[3]-a,e,t),s.restore(),this.overlayText&&Kkt(this.overlayText)&&""!==this._overlayText){void 0!==this.font&&null!==this.font||(this.font=this._lineCaptionFont);var l,h,d=0,p=0,c=0,u=void 0,r=(this._isLoaded&&(this._textAlignment=this.textAlignment),new E1t(this._textAlignment,T1t.top)),g=this.font.measureString(this.overlayText,[0,0],r,0,0);if(this._isLoaded&&void 0===this._repeat&&(this._repeat=this.repeatText),this._repeat){g[0]<=0&&(g[0]=1),l=this.bounds.width/g[0],h=Math.floor(this.bounds.height/this.font._size),c=Math.abs(this.bounds.width-Math.floor(l)*g[0]),this._textAlignment===MAt.center&&(p=c/2),this._textAlignment===MAt.right&&(p=c);for(var m=1;m<l;m++){for(var f=0;f<h;f++)s.drawString(this.overlayText,this.font,u=[p,d,0,0],null,i,null),d+=this.font._size;p+=g[0],d=0}}else c=Math.abs(this.bounds.width-g[0]),this._textAlignment===MAt.center&&(p=c/2),u=[p=this._textAlignment===MAt.right?c:p,0,this.bounds.width-this.border.width,this.bounds.height-this.border.width],s.drawString(this.overlayText,this.font,u,null,i,r)}return o};var HEt,zEt=jEt;function jEt(e,t,i,n){var o=HEt.call(this)||this;return o._textAlignment=MAt.left,o._dictionary=new mPt,o._dictionary.update("Type",k.get("Annot")),o._dictionary.update("Subtype",k.get("Redact")),void 0!==e&&void 0!==t&&void 0!==i&&void 0!==n&&(o.bounds={x:e,y:t,width:i,height:n}),o._type=QAt.redactionAnnotation,o}Met(UEt,WEt=TTt),UEt._load=function(e,t){var i=new UEt;return i._isLoaded=!0,i._initialize(e,t),i},UEt.prototype._initialize=function(e,t){WEt.prototype._initialize.call(this,e,t)},UEt.prototype._doPostProcess=function(e){var t;void 0===e&&(e=!1),void 0!==this.flattenPopups&&this.flattenPopups&&this._flattenPopUp(),e&&(e=void 0,this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(e=t.get("N"),t=t.getRaw("N"))&&e&&(e.reference=t),e?(t=new _It(e,this._crossReference),e=this._validateTemplateMatrix(t._content.dictionary),this._flattenAnnotationTemplate(t,e)):this._removeAnnotation(this._page,this))};var WEt,QEt=UEt;function UEt(){var e=WEt.call(this)||this;return e._type=QAt.richMediaAnnotation,e}Met(YEt,qEt=TTt),YEt._load=function(e,t){var i=new YEt;return i._isLoaded=!0,i._dictionary=e,i._crossReference=t,i},Object.defineProperty(YEt.prototype,"page",{get:function(){return this._getPage()},enumerable:!0,configurable:!0}),Object.defineProperty(YEt.prototype,"color",{get:function(){return void 0===this._color&&this._defaultAppearance&&(this._color=this._da.color),this._color},set:function(e){void 0!==this.color&&this._color===e||(this._color=e);var t=!1;this._defaultAppearance||(this._da=new CTt(""),t=!0),!t&&this._da.color===e||(this._da.color=e,this._dictionary.update("DA",this._da.toString()))},enumerable:!0,configurable:!0}),Object.defineProperty(YEt.prototype,"backColor",{get:function(){return this._parseBackColor()},set:function(e){this._updateBackColor(e)},enumerable:!0,configurable:!0}),Object.defineProperty(YEt.prototype,"_hasBackColor",{get:function(){var e;return this._isLoaded?(e=this._mkDictionary)&&e.has("BG"):!this._isTransparentBackColor},enumerable:!0,configurable:!0}),Object.defineProperty(YEt.prototype,"_hasBorderColor",{get:function(){var e;return this._isLoaded?(e=this._mkDictionary)&&e.has("BC"):!this._isTransparentBorderColor},enumerable:!0,configurable:!0}),Object.defineProperty(YEt.prototype,"borderColor",{get:function(){return this._parseBorderColor()},set:function(e){this._updateBorderColor(e)},enumerable:!0,configurable:!0}),Object.defineProperty(YEt.prototype,"rotate",{get:function(){return void 0===this._rotationAngle&&(this._mkDictionary&&this._mkDictionary.has("R")?this._rotationAngle=this._mkDictionary.get("R"):this._dictionary.has("R")&&(this._rotationAngle=this._dictionary.get("R"))),this._rotationAngle},set:function(e){void 0!==this.rotate&&this._rotationAngle===e||(void 0===this._mkDictionary&&this._dictionary.update("MK",new mPt(this._crossReference)),this._mkDictionary.update("R",e),this._rotationAngle=e,this._dictionary._updated=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(YEt.prototype,"highlightMode",{get:function(){var e;return void 0===this._highlightMode&&this._dictionary.has("H")&&(e=this._dictionary.get("H"),this._highlightMode=WMt(e.name)),this._highlightMode},set:function(e){this._highlightMode!==e&&this._dictionary.update("H",QMt(e))},enumerable:!0,configurable:!0}),Object.defineProperty(YEt.prototype,"bounds",{get:function(){return this._isLoaded&&void 0===this._bounds&&(this._bounds=FMt(this._dictionary,this._getPage())),void 0!==this._bounds&&null!==this._bounds||(this._bounds={x:0,y:0,width:0,height:0}),this._bounds},set:function(e){if(0===e.x&&0===e.y&&0===e.width&&0===e.height)throw new Error("Cannot set empty bounds");this._bounds=e,this._page&&this._page._isNew&&this._page._pageSettings?this._dictionary.update("Rect",jkt(this)):this._dictionary.update("Rect",OMt([e.x,e.y,e.width,e.height],this._getPage()))},enumerable:!0,configurable:!0}),Object.defineProperty(YEt.prototype,"textAlignment",{get:function(){return void 0===this._textAlignment&&this._dictionary.has("Q")&&(this._textAlignment=this._dictionary.get("Q")),this._textAlignment},set:function(e){void 0!==this._textAlignment&&this._textAlignment===e||this._dictionary.update("Q",e)},enumerable:!0,configurable:!0}),Object.defineProperty(YEt.prototype,"visibility",{get:function(){if(!this._isLoaded)return this._visibility;var e=kAt.visible;bAt.default;if(this._hasFlags){var t,i=3;switch(((t=this.flags)&bAt.hidden)===bAt.hidden&&(i=0),(t&bAt.noView)===bAt.noView&&(i=1),(t&bAt.print)!==bAt.print&&(i&=2),i){case 0:e=kAt.hidden;break;case 1:e=kAt.hiddenPrintable;break;case 2:e=kAt.visibleNotPrintable;break;case 3:e=kAt.visible}}else e=kAt.visibleNotPrintable;return e},set:function(e){if(this._isLoaded)Akt(this._dictionary,e),this._dictionary._updated=!0;else{switch(e){case kAt.hidden:this.flags=bAt.hidden;break;case kAt.hiddenPrintable:this.flags=bAt.noView|bAt.print;break;case kAt.visible:this.flags=bAt.print;break;case kAt.visibleNotPrintable:this.flags=bAt.default}this._visibility=e}},enumerable:!0,configurable:!0}),Object.defineProperty(YEt.prototype,"font",{get:function(){var e,t,i,n;return this._pdfFont||(e=void 0,this._crossReference&&(i=this._crossReference._document.form,t=this._obtainFontDetails(),i)&&i._dictionary.has("DR")&&(i=i._dictionary.get("DR")).has("Font")&&(i=i.get("Font")).has(t.name)&&(i=i.get(t.name))&&t.name&&i.has("BaseFont")&&(i=i.get("BaseFont"),n=Jxt.regular,i)&&(e=i.name,n=Okt(i.name),e.includes("-")&&(e=e.substring(0,e.indexOf("-"))),this._pdfFont=Nkt(e,t.size,n,this))),null!==this._pdfFont&&void 0!==this._pdfFont&&(this._isLoaded||1!==this._pdfFont.size)||(this._pdfFont=this._circleCaptionFont),this._pdfFont},set:function(e){e&&e instanceof Oxt&&(this._pdfFont=e,this._initializeFont(e))},enumerable:!0,configurable:!0}),Object.defineProperty(YEt.prototype,"_defaultAppearance",{get:function(){var e;return void 0===this._da&&this._dictionary.has("DA")&&(e=this._dictionary.get("DA"))&&""!==e&&(this._da=new CTt(e)),this._da},enumerable:!0,configurable:!0}),Object.defineProperty(YEt.prototype,"_mkDictionary",{get:function(){var e;return e=this._dictionary.has("MK")?this._dictionary.get("MK"):e},enumerable:!0,configurable:!0}),YEt.prototype._create=function(e,t,i){return this._page=e,this._crossReference=e._crossReference,this._ref=this._crossReference._getNextReference(),this._dictionary=new mPt(this._crossReference),this._crossReference._cacheMap.set(this._ref,this._dictionary),(this._dictionary._currentObj=this)._dictionary.objId=this._ref.toString(),this._dictionary.update("Type",k.get("Annot")),this._dictionary.update("Subtype",k.get("Widget")),this.flags|=bAt.print,this._dictionary.update("P",e._ref),e._addWidget(this._ref),this.border=new pDt,this.bounds=t,i&&(this._field=i,this._dictionary.update("Parent",this._field._ref)),this._dictionary},YEt.prototype._doPostProcess=function(e,t){var i,n,o,r;void 0===t&&(t=!1),((e=void 0===e?!1:e)||t)&&(i=void 0,t||e&&this._dictionary.has("AP"),!i&&this._dictionary.has("AP")&&(t=this._dictionary.get("AP"))&&t.has("N")&&(i=t.get("N"),r=t.getRaw("N"))&&i&&(i.reference=r),i&&(t=void 0,e?(e=new _It(i,this._crossReference),(o=this._getPage())&&((n=o.graphics).save(),o.rotation===TAt.angle90?(n.translateTransform(n._size[0],n._size[1]),n.rotateTransform(90)):o.rotation===TAt.angle180?(n.translateTransform(n._size[0],n._size[1]),n.rotateTransform(-180)):o.rotation===TAt.angle270&&(n.translateTransform(n._size[0],n._size[1]),n.rotateTransform(270)),t={x:this.bounds.x,y:this.bounds.y,width:e._size[0],height:e._size[1]},n.drawTemplate(e,t),n.restore())):(o=void 0,this._dictionary.has("AP")?o=this._dictionary.get("AP"):(e=this._crossReference._getNextReference(),o=new mPt(this._crossReference),this._crossReference._cacheMap.set(e,o),this._dictionary.update("AP",e)),xkt(o,this._crossReference,"N"),r=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(r,i),o.update("N",r))),this._dictionary._updated=!1)},YEt.prototype._initializeFont=function(e){var t,i,n,o,r,s;this._pdfFont=e,this._crossReference&&(n=i=void 0,o=!1,(i=(t=this._crossReference._document)?t.form._dictionary.has("DR")?t.form._dictionary.get("DR"):new mPt(this._crossReference):i).has("Font")&&((r=i.getRaw("Font"))&&r instanceof aPt?(o=!0,n=this._crossReference._fetch(r)):r instanceof mPt&&(n=r)),n||(n=new mPt(this._crossReference),i.update("Font",n)),r=k.get(XMt()),s=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(s,this._pdfFont._dictionary),e instanceof Uxt?this._pdfFont._pdfFontInternals&&this._crossReference._cacheMap.set(s,this._pdfFont._pdfFontInternals):this._pdfFont._dictionary&&this._crossReference._cacheMap.set(s,this._pdfFont._dictionary),n.update(r.name,s),i._updated=!0,t.form._dictionary.update("DR",i),t.form._dictionary._updated=!0,this._fontName=r.name,(e=new CTt).fontName=this._fontName,e.fontSize=this._pdfFont._size,e.color=this.color||[0,0,0],this._dictionary.update("DA",e.toString()),o&&(i._updated=!0),this._isFont=!0)},YEt.prototype._getPage=function(){if(!this._page){this._crossReference&&(e=this._crossReference._document);var e,t=void 0;if(this._dictionary.has("P")){var i=this._dictionary.getRaw("P");if(i&&e)for(var n=0;n<e.pageCount;n++){var o=e.getPage(n);if(o&&o._ref===i){t=o;break}}}!t&&e&&this._ref&&(t=ZMt(e,this._ref)),this._page=t}return this._page},YEt.prototype._beginSave=function(){var e;this._isLoaded||this._page._isNew||(e=this._bounds,this._dictionary.update("Rect",OMt([e.x,e.y,e.width,e.height],this._page)))},YEt.prototype._parseBackColor=function(){var e;return(this._isLoaded&&this._hasBackColor||!this._isLoaded&&!this._isTransparentBackColor)&&(void 0===this._backColor&&(e=this._mkDictionary)&&e.has("BG")&&(e=e.getArray("BG"))&&(this._backColor=VMt(e)),void 0!==this._backColor&&null!==this._backColor||(this._backColor=[255,255,255]),e=this._backColor),e},YEt.prototype._parseBorderColor=function(){var e;return(this._isLoaded&&this._hasBorderColor||!this._isLoaded&&!this._isTransparentBorderColor)&&(void 0===this._borderColor&&(e=this._mkDictionary)&&e.has("BC")&&(e=e.getArray("BC"))&&(this._borderColor=VMt(e)),void 0!==this._borderColor&&null!==this._borderColor||(this._borderColor=[0,0,0]),e=this._borderColor),e},YEt.prototype._updateBackColor=function(e,t){void 0===t&&(t=!1);var i,n=!1;4===e.length&&255!==e[3]?(this._isTransparentBackColor=!0,this._dictionary.has("BG")&&(delete this._dictionary._map.BG,n=!0),(i=this._mkDictionary)&&i.has("BG")&&(delete i._map.BG,n=this._dictionary._updated=!0)):(this._isTransparentBackColor=!1,void 0!==this.backColor&&this._backColor===e||(void 0===this._mkDictionary&&this._dictionary.update("MK",new mPt(this._crossReference)),this._mkDictionary.update("BG",[Number.parseFloat((e[0]/255).toFixed(3)),Number.parseFloat((e[1]/255).toFixed(3)),Number.parseFloat((e[2]/255).toFixed(3))]),this._backColor=[e[0],e[1],e[2]],n=this._dictionary._updated=!0)),t&&n&&this._field&&(this._field._setAppearance=!0)},YEt.prototype._updateBorderColor=function(e){var t;4===e.length&&255!==e[3]?(this._isTransparentBorderColor=!0,this._dictionary.has("BC")&&delete this._dictionary._map.BC,(t=this._mkDictionary)&&t.has("BC")&&(delete t._map.BC,this._dictionary.has("BS")&&(t=this._dictionary.get("BS"))&&t.has("W")&&delete t._map.W,this._dictionary._updated=!0)):(this._isTransparentBorderColor=!1,void 0!==this.borderColor&&this.borderColor===e||(void 0===this._mkDictionary&&this._dictionary.update("MK",new mPt(this._crossReference)),this._mkDictionary.update("BC",[Number.parseFloat((e[0]/255).toFixed(3)),Number.parseFloat((e[1]/255).toFixed(3)),Number.parseFloat((e[2]/255).toFixed(3))]),this._borderColor=[e[0],e[1],e[2]],this._dictionary._updated=!0))};var qEt,GEt=YEt;function YEt(){var e=qEt.call(this)||this;return e._isAutoResize=!1,e._visibility=kAt.visible,e._isFont=!1,e._isTransparentBackColor=!1,e._isTransparentBorderColor=!1,e._isWidget=!0,e._type=QAt.widgetAnnotation,e}Met(JEt,XEt=GEt),JEt._load=function(e,t,i){var n=new JEt;return n._isLoaded=!0,n._dictionary=e,n._crossReference=t,n._field=i,n},Object.defineProperty(JEt.prototype,"checked",{get:function(){return $Mt(this._dictionary)},set:function(e){this.checked!==e&&(this._field&&(this._setCheckedStatus(e),this._field._setAppearance=!0),this._dictionary.update("AS",k.get(e?"Yes":"Off")))},enumerable:!0,configurable:!0}),Object.defineProperty(JEt.prototype,"style",{get:function(){var e;return this._isLoaded&&((e=this._mkDictionary)&&e.has("CA")?this._style=rkt(e.get("CA")):this._style=LAt.check),this._style},set:function(e){var t;this.style!==e&&(this._style=e,(t=this._mkDictionary)||(t=new mPt(this._crossReference),this._dictionary.update("MK",t)),t.update("CA",okt(e)))},enumerable:!0,configurable:!0}),JEt.prototype._setCheckedStatus=function(e){var t=e,i=this._getItemValue(this._dictionary);this._unCheckOthers(this,i,e),t?(this._field._dictionary.update("V",i=i||"Yes"),this._dictionary.update("AS",k.get(i)),this._dictionary.update("V",k.get(i))):this._field._dictionary&&(this._field._dictionary.has("V")&&(e=this._field._dictionary.get("V"))&&e.name===i&&delete this._field._dictionary._map.V,this._field._dictionary.update("AS",k.get("Off")))},JEt.prototype._unCheckOthers=function(e,t,i){if(!this._field._isUpdating){this._field._isUpdating=!0;for(var n=this._field.itemsCount,o=0;o<n;++o){var r=this._field.itemAt(o);r&&(r!==e?r.checked=this._getItemValue(r._dictionary)===t&&i:r.checked||(r.checked=!0))}}},JEt.prototype._getItemValue=function(e){var t="";if(""===(t=e&&e.has("AS")&&(i=e.get("AS"))&&"Off"!==i.name?"Off":t)&&e&&e.has("AP")){var i=e.get("AP");if(i&&i.has("N")){var e=i.get("N"),n=[];if(e.forEach(function(e,t){n.push(e)}),0<n.length)for(var o=0;o<n.length;o++){var r=n[Number.parseInt(o.toString(),10)];if(r&&"Off"!==r){t=r;break}}}}return t},JEt.prototype._doPostProcess=function(){var e,t,i=tkt(this.checked?YAt.checked:YAt.unchecked,this);i&&(e=this._getPage())&&((t=e.graphics).save(),e.rotation===TAt.angle90?(t.translateTransform(t._size[0],t._size[1]),t.rotateTransform(90)):e.rotation===TAt.angle180?(t.translateTransform(t._size[0],t._size[1]),t.rotateTransform(-180)):e.rotation===TAt.angle270&&(t.translateTransform(t._size[0],t._size[1]),t.rotateTransform(270)),t._sw._setTextRenderingMode(uIt.fill),t.drawTemplate(i,this.bounds),t.restore()),this._dictionary._updated=!1},JEt.prototype._postProcess=function(e){var t=this._field;e=e||(t&&t.checked?"Yes":"Off"),this._dictionary.update("AS",k.get(e))},JEt.prototype._setField=function(e){this._field=e,this._field._stringFormat=new E1t(this.textAlignment,T1t.middle),this._field._addToKid(this)};var XEt,KEt=JEt;function JEt(){return XEt.call(this)||this}Met(eDt,ZEt=KEt),eDt._load=function(e,t,i){var n=new eDt;return n._isLoaded=!0,n._dictionary=e,n._crossReference=t,n._field=i,n},Object.defineProperty(eDt.prototype,"selected",{get:function(){return this._index===this._field.selectedIndex},enumerable:!0,configurable:!0}),Object.defineProperty(eDt.prototype,"value",{get:function(){return this._isLoaded&&!this._optionValue&&(this._optionValue=ekt(this._dictionary)),this._optionValue},set:function(e){this._optionValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(eDt.prototype,"backColor",{get:function(){return this._parseBackColor()},set:function(e){this._updateBackColor(e,!0)},enumerable:!0,configurable:!0}),eDt.prototype._initializeItem=function(e,t,i,n){this._optionValue=e,this._page=i,this._create(this._page,t,this._field),this.textAlignment=MAt.left,this._dictionary.update("MK",new mPt(this._crossReference)),this._mkDictionary.update("BC",[0,0,0]),this._mkDictionary.update("BG",[1,1,1]),this.style=LAt.circle,this._dictionary.update("DA","/TiRo 0 Tf 0 0 0 rg"),n&&(this._setField(n),this._dictionary.update("Parent",n._ref))},eDt.prototype._postProcess=function(e){var t=this._field;!e&&t&&-1!==t.selectedIndex&&(e=t.itemAt(t.selectedIndex).value),this.value===e?this._dictionary.update("AS",k.get(this.value)):this._dictionary.update("AS",k.get("Off"))};var ZEt,$Et=eDt;function eDt(e,t,i){var n=ZEt.call(this)||this;return i&&e&&t&&(i instanceof XIt?n._initializeItem(e,t,i.page,i):n._initializeItem(e,t,i)),n}Met(nDt,tDt=KEt),nDt._load=function(e,t,i){var n=new nDt;return n._isLoaded=!0,n._dictionary=e,n._crossReference=t,n._field=i,n},Object.defineProperty(nDt.prototype,"text",{get:function(){return void 0===this._text&&void 0!==this._field&&(this._field instanceof fTt||this._field instanceof uTt)&&(this._text=this._field._options[Number.parseInt(this._index.toString(),10)][1]),this._text},set:function(e){"string"==typeof e&&void 0!==this._field&&(this._field instanceof fTt||this._field instanceof uTt)&&e!==this._field._options[Number.parseInt(this._index.toString(),10)][1]&&(this._field._options[Number.parseInt(this._index.toString(),10)][1]=e,this._text=e,this._field._dictionary._updated=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(nDt.prototype,"selected",{get:function(){return this._index===this._field.selectedIndex},enumerable:!0,configurable:!0}),nDt.prototype._initializeItem=function(e,t,i){this._text=e,this._value=t,i&&i instanceof fTt&&i._addToOptions(this,i)};var tDt,iDt=nDt;function nDt(e,t,i){var n=tDt.call(this)||this;return e&&t&&n._initializeItem(e,t,i),n}Object.defineProperty(rDt.prototype,"cap",{get:function(){return this._cap},set:function(e){e!==this._cap&&(this._cap=e,this._dictionary)&&this._dictionary.update("Cap",e)},enumerable:!0,configurable:!0}),Object.defineProperty(rDt.prototype,"type",{get:function(){return this._type},set:function(e){e!==this._type&&(this._type=e,this._dictionary)&&this._dictionary.update("CP",k.get(e===AAt.top?"Top":"Inline"))},enumerable:!0,configurable:!0}),Object.defineProperty(rDt.prototype,"offset",{get:function(){return this._offset},set:function(e){wMt(e,this._offset)&&(this._offset=e,this._dictionary)&&this._dictionary.update("CO",e)},enumerable:!0,configurable:!0});var oDt=rDt;function rDt(e,t,i){this._cap=void 0!==e&&e,this._type=void 0!==t?t:AAt.inline,this._offset=void 0!==i?i:[0,0]}Object.defineProperty(aDt.prototype,"begin",{get:function(){return this._begin},set:function(e){e!==this._begin&&(this._begin=e,this._dictionary)&&this._dictionary.update("LE",[k.get(zMt(e)),k.get(zMt(this._end))])},enumerable:!0,configurable:!0}),Object.defineProperty(aDt.prototype,"end",{get:function(){return this._end},set:function(e){e!==this._end&&(this._end=e,this._dictionary)&&this._dictionary.update("LE",[k.get(zMt(this._begin)),k.get(zMt(e))])},enumerable:!0,configurable:!0});var sDt=aDt;function aDt(e,t){this._begin=void 0!==e?e:wAt.none,this._end=void 0!==t?t:wAt.none}Object.defineProperty(hDt.prototype,"width",{get:function(){return this._width},set:function(e){e!==this._width&&(this._width=e,this._dictionary)&&((e=this._dictionary.has("BS")?this._dictionary.get("BS"):new mPt(this._crossReference)).update("Type",k.get("Border")),e.update("W",this._width),e.update("S",_Mt(this._style)),this._dash&&e.update("D",this._dash),this._dictionary.update("BS",e),this._dictionary._updated=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(hDt.prototype,"style",{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._dictionary)&&((e=this._dictionary.has("BS")?this._dictionary.get("BS"):new mPt(this._crossReference)).update("Type",k.get("Border")),e.update("W",this._width),e.update("S",_Mt(this._style)),this._dash&&e.update("D",this._dash),this._dictionary.update("BS",e),this._dictionary._updated=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(hDt.prototype,"dash",{get:function(){return this._dash},set:function(e){(void 0===this._dash||wMt(e,this._dash))&&(this._dash=e,this._dictionary)&&((e=this._dictionary.has("BS")?this._dictionary.get("BS"):new mPt(this._crossReference)).update("Type",k.get("Border")),e.update("W",this._width),e.update("S",_Mt(this._style)),e.update("D",this._dash),this._dictionary.update("BS",e),this._dictionary._updated=!0)},enumerable:!0,configurable:!0});var lDt=hDt;function hDt(e,t,i){this._width=void 0!==e?e:1,this._style=void 0!==t?t:xAt.solid,void 0!==i&&Array.isArray(i)&&(this._dash=i)}Met(cDt,dDt=lDt),Object.defineProperty(cDt.prototype,"width",{get:function(){return this._width},set:function(e){e!==this._width&&(this._width=e,this._dictionary)&&(this._dictionary.update("Border",[this._hRadius,this._vRadius,this._width]),(e=this._dictionary.has("BS")?this._dictionary.get("BS"):new mPt(this._crossReference)).update("Type",k.get("Border")),e.update("W",this._width),e.update("S",_Mt(this._style)),this._dash&&e.update("D",this._dash),this._dictionary.update("BS",e),this._dictionary._updated=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(cDt.prototype,"hRadius",{get:function(){return this._hRadius},set:function(e){e!==this._hRadius&&(this._hRadius=e,this._dictionary)&&this._dictionary.update("Border",[this._hRadius,this._vRadius,this._width])},enumerable:!0,configurable:!0}),Object.defineProperty(cDt.prototype,"vRadius",{get:function(){return this._vRadius},set:function(e){e!==this._vRadius&&(this._vRadius=e,this._dictionary)&&this._dictionary.update("Border",[this._hRadius,this._vRadius,this._width])},enumerable:!0,configurable:!0});var dDt,pDt=cDt;function cDt(e,t,i,n,o){e=dDt.call(this,e,n,o)||this;return e._hRadius=void 0!==t?t:0,e._vRadius=void 0!==i?i:0,e}Object.defineProperty(gDt.prototype,"intensity",{get:function(){return this._intensity},set:function(e){e!==this._intensity&&(this._intensity=e,this._dictionary&&((e=this._dictionary.has("BE")?this._dictionary.get("BE"):new mPt(this._crossReference)).update("I",this._intensity),e.update("S",this._styleToEffect(this._style)),this._dictionary.update("BE",e),this._dictionary._updated=!0),this._dictionary._updated=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(gDt.prototype,"style",{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._dictionary)&&((e=this._dictionary.has("BE")?this._dictionary.get("BE"):new mPt(this._crossReference)).update("I",this._intensity),e.update("S",this._styleToEffect(this._style)),this._dictionary.update("BE",e),this._dictionary._updated=!0)},enumerable:!0,configurable:!0}),gDt.prototype._getBorderEffect=function(e){return"/C"===e?IAt.cloudy:IAt.solid},gDt.prototype._styleToEffect=function(e){return e===IAt.cloudy?"C":"S"};var uDt=gDt;function gDt(e){this._intensity=0,null!=e?e.has("BE")&&(e=this._dictionary.get("BE"))&&(e.has("I")&&(this._intensity=e.get("I")),e.has("S"))&&(this._style=this._getBorderEffect(e.get("S"))):(this._dictionary=new mPt,this._dictionary.set("I",this._intensity),this._dictionary.set("S",this._styleToEffect(this._style)))}var mDt=function(){this.borderWidth=1},fDt=function(){this.startAngle=0,this.endAngle=0},yDt=(Object.defineProperty(vDt.prototype,"count",{get:function(){return this._annotations.length},enumerable:!0,configurable:!0}),vDt.prototype.at=function(e){if(e<0||e>=this._annotations.length)throw Error("Index out of range.");var t;return this._parsedAnnotations.has(e)||(t=(t=this._annotations[Number.parseInt(e.toString(),10)])&&t instanceof aPt?this._crossReference._fetch(t):t)&&t instanceof mPt&&(t=this._parseAnnotation(t))&&(t._ref=this._annotations[Number.parseInt(e.toString(),10)],this._parsedAnnotations.set(e,t)),this._parsedAnnotations.get(e)},vDt.prototype.add=function(e){if(null==e)throw Error("annotation cannot be null or undefined");if(e._isLoaded)throw Error("cannot add an existing annotation");e._initialize(this._page),void 0!==e._ref&&e._ref._isNew?t=e._ref:(t=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(t,e._dictionary),e._ref=t);var t,i,n=this._annotations.length,o=(this._annotations.push(t),this._parsedAnnotations.set(n,e),!1);return this._page&&this._page._pageDictionary.has("Annots")&&null!=(i=this._page._pageDictionary.get("Annots"))&&-1===i.indexOf(t)&&(i.push(t),this._page._pageDictionary.set("Annots",i),o=!0),o||this._page._pageDictionary.set("Annots",this._annotations),this._page._pageDictionary._updated=!0,e&&e instanceof MTt&&this._addCommentsAndReview(e,e._dictionary.get("F")),this._updateCustomAppearanceResource(e),n},vDt.prototype.remove=function(e){e&&e._ref&&-1<(e=this._annotations.lastIndexOf(e._ref))&&this.removeAt(e)},vDt.prototype.removeAt=function(e){if(e<0||e>=this._annotations.length)throw Error("Index out of range.");var t,i,n=this._annotations[Number.parseInt(e.toString(),10)];n&&this._page&&(-1<(i=(t=this._page._getProperty("Annots")).indexOf(n))&&t.splice(i,1),this._page._pageDictionary.set("Annots",t),this._page._pageDictionary._updated=!0,-1<this._annotations.indexOf(n)&&this._annotations.splice(e,1),this._parsedAnnotations.has(e)&&(this._parsedAnnotations.delete(e),this._reorderParsedAnnotations(e)),i=this._page._crossReference)&&i._cacheMap.has(n)&&i._cacheMap.delete(n)},vDt.prototype._reorderParsedAnnotations=function(i){var n=new Map;this._parsedAnnotations.forEach(function(e,t){i<t?n.set(t-1,e):n.set(t,e)}),this._parsedAnnotations=n},vDt.prototype._updateCustomAppearanceResource=function(e){e&&e instanceof BEt&&void 0!==e._appearance&&e._appearance.normal.graphics._processResources(e._crossReference)},vDt.prototype._addCommentsAndReview=function(e,t){this._updateChildReference(e,e.comments,t),this._updateChildReference(e,e.reviewHistory,t)},vDt.prototype._updateChildReference=function(e,t,i){if(t&&0<t.count){if(30===i)throw new Error("Could not add comments/reviews to the review");for(var n=0;n<t.count;n++){var o=t._collection[Number.parseInt(n.toString(),10)];o&&!o._dictionary.has("IRT")&&(0!==n&&t._isReview?o._dictionary.update("IRT",t._collection[n-1]._ref):o._dictionary.update("IRT",e._ref),t._isReview?o._isReview=!0:o._isComment=!0,this.add(o))}}},vDt.prototype._parseAnnotation=function(e){if(e&&e.has("Subtype")&&null!==this._page&&void 0!==this._page){var t=e.get("Subtype"),i=e.get("Rect");if(t){var n,o,r,s=void 0;switch(t.name){case"Line":n=BTt._load(this._page,e);break;case"Circle":n=(e.has("Measure")||i[2]-i[0]==i[3]-i[1]?RTt:VTt)._load(this._page,e);break;case"Square":n=(i[2]===i[3]?zTt:QTt)._load(this._page,e);break;case"Polygon":n=GTt._load(this._page,e);break;case"PolyLine":n=(n=e.has("Measure")&&e.has("IT")&&(o=e.get("IT"))&&"PolyLineAngle"===o.name?$Tt._load(this._page,e):n)||KTt._load(this._page,e);break;case"Ink":n=iEt._load(this._page,e);break;case"Popup":case"Text":n=rEt._load(this._page,e);break;case"Link":(s=e.has("A")?e.get("A"):s)&&s.has("S")?(o=s.get("S").name)&&(r=this._hasValidBorder(e.getArray("Border")),"URI"===o?n=r?yEt._load(this._page,e):this._getLinkAnnotation(e):"Launch"===o?n=lEt._load(this._page,e):"GoToR"===o?n=this._getLinkAnnotation(e):"GoTo"===o&&(n=gEt._load(this._page,e))):"Link"===t.name&&(n=gEt._load(this._page,e));break;case"FileAttachment":n=wEt._load(this._page,e);break;case"3D":n=AEt._load(this._page,e);break;case"FreeText":n=VEt._load(this._page,e);break;case"Redact":n=zEt._load(this._page,e);break;case"RichMedia":n=QEt._load(this._page,e);break;case"Watermark":n=MEt._load(this._page,e);break;case"Stamp":n=BEt._load(this._page,e);break;case"Sound":n=REt._load(this._page,e);break;case"Highlight":case"Squiggly":case"StrikeOut":case"Underline":n=TEt._load(this._page,e)}}}return n},vDt.prototype._getLinkAnnotation=function(e){var t,i,n;return this._page&&(e&&e.has("A")?(i=e.get("A"))&&i.has("S")&&((n=i.get("S"))&&"GoToR"===n.name&&i.has("F")?t=lEt._load(this._page,e):n&&"URI"===n.name&&(t=pEt._load(this._page,e))):t=pEt._load(this._page,e)),t},vDt.prototype._hasValidBorder=function(e){if(null==e)return!1;for(var t=0;t<e.length;t++){var i=0,n=e[Number.parseInt(t.toString(),10)];if(0<(i=null!=n?n:i))return!1}return!0},vDt.prototype._doPostProcess=function(e){for(var t=0;t<this.count;){var i,n=this.at(t);n&&(i=n.flatten||e,n._isExport=this._isExport,i&&-1===this._annotations.lastIndexOf(n._ref)&&t++,n._doPostProcess(i),i)||t++}},vDt.prototype._reArrange=function(e,t,i){var n;return this._annotations&&(t>this._annotations.length&&(t=0),i>=this._annotations.length&&(i=this._annotations.indexOf(e)),n=this._crossReference._fetch(this._annotations[Number.parseInt(i.toString(),10)]))&&n.has("Parent")&&((n=n.getRaw("Parent"))&&n===e||e===this._annotations[Number.parseInt(i.toString(),10)])&&(n=this._annotations[Number.parseInt(i.toString(),10)],this._annotations[Number.parseInt(i.toString(),10)]=this._annotations[Number.parseInt(t.toString(),10)],this._annotations[Number.parseInt(t.toString(),10)]=n),this._annotations},vDt.prototype._clear=function(){this._annotations=[],this._parsedAnnotations=new Map,this._comments=[]},vDt);function vDt(e,t,i){this._isExport=!1,Kkt(e)?this._annotations=e:this._annotations=[],this._page=i,this._crossReference=t,this._parsedAnnotations=new Map,this._comments=[]}Object.defineProperty(wDt.prototype,"count",{get:function(){return this._collection.length},enumerable:!0,configurable:!0}),wDt.prototype.at=function(e){if(e<0||e>=this._collection.length)throw Error("Index out of range.");return this._collection[Number.parseInt(e.toString(),10)]},wDt.prototype.add=function(e){if(30===this._annotation._dictionary.get("F"))throw new Error("Could not add comments/reviews to the review");var t;e._dictionary.update("F",this._annotation.flags===bAt.locked?128:this._isReview?30:28),this._annotation&&(this._annotation._isLoaded||this._page&&this._annotation._ref)&&(this._page.annotations.add(e),0!==(t=this._collection.length)&&this._isReview?e._dictionary.update("IRT",this._collection[Number.parseInt((t-1).toString(),10)]._ref):e._dictionary.update("IRT",this._annotation._ref),this._isReview?e._isReview=!0:e._isComment=!0),this._collection.push(e)},wDt.prototype.remove=function(e){e=this._collection.indexOf(e);-1<e&&this.removeAt(e)},wDt.prototype.removeAt=function(e){if(!(-1<e&&e<this._collection.length))throw new Error("Index out of range.");var t,i,n=this._collection[Number.parseInt(e.toString(),10)];this._isReview&&e<this._collection.length-1&&(t=this._collection[Number.parseInt((e+1).toString(),10)],i=n._dictionary._get("IRT"),t._dictionary.set("IRT",i),t._dictionary._updated=!0),this._collection.splice(e,1),this._page.annotations.remove(n)},wDt.prototype._parseCommentsOrReview=function(){this._isReview?this._parseReview():this._parseComments()},wDt.prototype._parseReview=function(){this._page&&(e=this._page.annotations);var e,t=new Map;if(t.set(this._annotation._ref,this._annotation),e&&e._comments&&0<e._comments.length){for(var i=[],n=0;n<e._comments.length;n++){var o=(r=e._comments[Number.parseInt(n.toString(),10)])._dictionary._get("IRT");r._isReview&&o&&t.has(o)?(this._collection.push(r),t.set(r._ref,r)):i.push(r)}e._comments=0<i.length?i:[]}else if(e)for(var r,s,a=e.count,n=0;n<a;n++)(r=e.at(n))&&r instanceof rEt&&(s=r._dictionary,r._dictionary.has("IRT"))&&(o=s._get("IRT"),r._isReview&&o&&t.has(o)?(this._collection.push(r),t.set(r._ref,r)):e._comments.push(r));t.clear()},wDt.prototype._parseComments=function(){var e;if((e=this._page?this._page.annotations:e)&&e._comments&&0<e._comments.length){for(var t=[],i=0;i<e._comments.length;i++){var n=Ckt(r=(o=e._comments[Number.parseInt(i.toString(),10)])._dictionary);((s=r._get("IRT"))&&s===this._annotation._ref&&!n?this._collection:t).push(o)}e._comments=0<t.length?t:[]}else if(e)for(var o,r,s,a=e.count,i=0;i<a;i++)(o=e.at(i))&&o instanceof rEt&&(r=o._dictionary,o._dictionary.has("IRT"))&&(n=Ckt(r),((s=r._get("IRT"))&&s===this._annotation._ref&&!n?this._collection:e._comments).push(o))};var bDt=wDt;function wDt(e,t){this._collection=[],e&&(this._annotation=e),this._isReview=t,(e&&this._annotation._isLoaded||e._page)&&(this._page=e._page,this._parentDictionary=e._dictionary,this._annotation._isLoaded)&&this._parseCommentsOrReview()}CDt=function(e,t){return(CDt=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])}))(e,t)};var CDt,Cet=function(e,t){function i(){this.constructor=e}CDt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},SDt=(Object.defineProperty(ADt.prototype,"count",{get:function(){return this._isLoadedBookmark&&0===this._bookMarkList.length&&this._reproduceTree(),this._bookMarkList.length},enumerable:!0,configurable:!0}),Object.defineProperty(ADt.prototype,"isExpanded",{get:function(){return this._dictionary&&this._dictionary.has("Count")?0<=this._dictionary.get("Count"):this._isExpanded},set:function(e){this._isExpanded=e,0<this.count&&this._dictionary&&this._dictionary.update("Count",e?this._bookMarkList.length:-this._bookMarkList.length)},enumerable:!0,configurable:!0}),ADt.prototype.at=function(e){var t;if(e<0||e>=this.count)throw Error("Index out of range.");return t=Kkt(this._bookMarkList)&&0<this._bookMarkList.length&&e<this._bookMarkList.length?this._bookMarkList[Number.parseInt(e.toString(),10)]:t},ADt.prototype.contains=function(e){return-1!==this._bookMarkList.indexOf(e)},ADt.prototype.add=function(e,t){var i;if(this._dictionary){var n,o=new mPt(this._crossReference),r=(o.update("Parent",this._reference),this._crossReference._getNextReference());if(this._crossReference._cacheMap.set(r,o),(i=new IDt(o,this._crossReference))._reference=r,i.title=e,void 0===t)0===this.count?(this._dictionary.update("First",r),this._dictionary.update("Last",r)):(n=this.at(this.count-1),this._dictionary.update("Last",r),n&&n._reference&&(o.update("Prev",n._reference),n._dictionary.update("Next",r))),this._bookMarkList.push(i);else{if(t<0||t>this.count)throw new Error("Index out of range");0===this.count?(this._dictionary.update("First",r),this._dictionary.update("Last",r),this._bookMarkList.push(i)):t===this.count?(n=this.at(this.count-1),this._dictionary.update("Last",r),n&&n._reference&&(o.update("Prev",n._reference),n._dictionary.update("Next",r)),this._bookMarkList.push(i)):(0===t?(e=this.at(0),this._dictionary.update("First",r),e&&e._reference&&(o.update("Next",e._reference),e._dictionary.update("Prev",r))):(n=this.at(t),(e=this.at(t-1))&&e._reference&&n&&n._reference&&(o.update("Prev",e._reference),e._dictionary.update("Next",r),n._dictionary.update("Prev",r),o.update("Next",n._reference))),this._updateBookmarkList(t,i))}this._updateCount()}return i},ADt.prototype.remove=function(e){var t,i;if("string"==typeof e)for(var n=this._bookMarkList.length-1;0<=n;n--){var o=this.at(n);o.title===e?this.remove(n):0<o.count&&o.remove(e)}else 0<=e&&e<this.count&&(1===this.count?(this._removeFirst(this._dictionary),this._removeLast(this._dictionary),this._removeCount(this._dictionary),this._bookMarkList=[]):(0===e?(i=this.at(e+1),this._dictionary&&i&&i._reference&&(this._removePrevious(i._dictionary),this._dictionary.update("First",i._reference))):e===this.count-1?(t=this.at(e-1),this._dictionary&&t&&t._reference&&(this._removeNext(t._dictionary),this._dictionary.update("Last",t._reference))):(t=this.at(e-1),i=this.at(e+1),t&&t._reference&&i&&i._reference&&(t._dictionary.update("Next",i._reference),i._dictionary.update("Prev",t._reference))),this._updateBookmarkList(e),this._dictionary&&this._updateCount()))},ADt.prototype.clear=function(){this._removeFirst(this._dictionary),this._removeLast(this._dictionary),this._removeCount(this._dictionary),this._bookMarkList=[]},ADt.prototype._removeFirst=function(e){e&&e.has("First")&&(delete e._map.First,e._updated=!0)},ADt.prototype._removeLast=function(e){e&&e.has("Last")&&(delete e._map.Last,e._updated=!0)},ADt.prototype._removeNext=function(e){e&&e.has("Next")&&(delete e._map.Next,e._updated=!0)},ADt.prototype._removePrevious=function(e){e&&e.has("Prev")&&(delete e._map.Prev,e._updated=!0)},ADt.prototype._removeCount=function(e){e&&e.has("Count")&&(delete e._map.Count,e._updated=!0)},ADt.prototype._updateBookmarkList=function(e,t){var i=[];if(void 0===t)for(var n=0;n<this.count;n++){var o=this._bookMarkList[Number.parseInt(n.toString(),10)];n!==e?i.push(o):(o=o._reference)&&this._crossReference._cacheMap.has(o)&&(this._crossReference._cacheMap.get(o)._updated=!1)}else for(n=0;n<this.count;n++)n===e&&i.push(t),i.push(this._bookMarkList[Number.parseInt(n.toString(),10)]);this._bookMarkList=i},ADt.prototype._updateCount=function(){this.isExpanded||!this._dictionary.has("Count")?this._dictionary.update("Count",this._bookMarkList.length):this._dictionary.update("Count",-this._bookMarkList.length)},ADt.prototype._reproduceTree=function(){for(var e=this._getBookmark(this),t=!!e;t&&e._dictionary;)this._bookMarkList.push(e),t=!!(e=e._next)},ADt.prototype._getBookmark=function(e,t){void 0===t&&(t=!0);var i,e=e._dictionary;return e&&e.has(t?"First":"Last")&&Kkt(e=e._get(t?"First":"Last"))&&(t=this._crossReference._fetch(e))&&((i=new IDt(t,this._crossReference))._reference=e),i},ADt);function ADt(e,t){this._bookMarkList=[],this._isExpanded=!1,this._isLoadedBookmark=!1,this._dictionary=e,this._crossReference=t}Cet(TDt,xDt=SDt),Object.defineProperty(TDt.prototype,"destination",{get:function(){return this._destination||null==this._obtainNamedDestination()&&(this._destination=zkt(this._dictionary,"Dest")),this._destination},set:function(e){e&&((e._parent=this)._destination=e,this._destination._initializePrimitive())},enumerable:!0,configurable:!0}),Object.defineProperty(TDt.prototype,"namedDestination",{get:function(){return null!==this._namedDestination&&void 0!==this._namedDestination||(this._namedDestination=this._obtainNamedDestination()),this._namedDestination},set:function(e){var t;this._namedDestination!==e&&this._dictionary&&(this._namedDestination=e,(t=new mPt(this._crossReference)).update("D",e.title),t.update("S",k.get("GoTo")),e=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(e,t),this._dictionary.update("A",e))},enumerable:!0,configurable:!0}),Object.defineProperty(TDt.prototype,"title",{get:function(){return null!==this._title&&void 0!==this._title||(this._dictionary&&this._dictionary.has("Title")?this._title=this._dictionary.get("Title"):this._title=""),this._title},set:function(e){this._title=e,this._dictionary&&this._dictionary.update("Title",e)},enumerable:!0,configurable:!0}),Object.defineProperty(TDt.prototype,"color",{get:function(){return null!==this._color&&void 0!==this._color||this._dictionary&&this._dictionary.has("C")&&(this._color=VMt(this._dictionary.getArray("C"))),this._color||[0,0,0]},set:function(e){this._color=e,this._dictionary&&this._dictionary.update("C",[Number.parseFloat((e[0]/255).toFixed(7)),Number.parseFloat((e[1]/255).toFixed(7)),Number.parseFloat((e[2]/255).toFixed(7))])},enumerable:!0,configurable:!0}),Object.defineProperty(TDt.prototype,"textStyle",{get:function(){return null!==this._textStyle&&void 0!==this._textStyle||(this._textStyle=this._obtainTextStyle()),this._textStyle},set:function(e){this._textStyle=e,this._updateTextStyle(e)},enumerable:!0,configurable:!0}),Object.defineProperty(TDt.prototype,"_next",{get:function(){var e,t,i;return this._dictionary&&this._dictionary.has("Next")&&Kkt(t=this._dictionary._get("Next"))&&(i=this._crossReference._fetch(t))&&((e=new TDt(i,this._crossReference))._reference=t),e},enumerable:!0,configurable:!0}),TDt.prototype._updateTextStyle=function(e){e===g1t.regular?this._dictionary&&this._dictionary.has("F")&&delete this._dictionary._map.F:this._dictionary&&this._dictionary.update("F",e)},TDt.prototype._obtainTextStyle=function(){var e,t=g1t.regular;return this._dictionary&&this._dictionary.has("F")&&(t|=null!=(e=this._dictionary.get("F"))?e:0),t},TDt.prototype._obtainNamedDestination=function(){var e,t,i,n=this._crossReference._document;if(e=n?n._destinationCollection:e){var o,n=this._dictionary;if(n&&(n.has("A")?(o=n.get("A"))&&o.has("D")&&(t=o.get("D")):n.has("Dest")&&(t=n.get("Dest"))),t){var r=void 0;if(t instanceof k?r=t.name:"string"==typeof t&&(r=t),r)for(var s=e._namedDestinations,a=0;a<s.length;a++){var l=s[Number.parseInt(a.toString(),10)];if(l._title===r){i=t=l;break}}}}return i};var xDt,IDt=TDt;function TDt(e,t){e=xDt.call(this,e,t)||this;return e._dictionary&&!e._dictionary.has("Dest")&&e._dictionary.has("A")&&(t=e._dictionary.get("A"))&&t.has("D")&&(t=t.getRaw("D"),e._dictionary.update("Dest",t)),e._isLoadedBookmark=!0,e}Object.defineProperty(DDt.prototype,"destination",{get:function(){return this._destination},set:function(e){e&&((e._parent=this)._destination=e,this._destination._initializePrimitive())},enumerable:!0,configurable:!0}),Object.defineProperty(DDt.prototype,"title",{get:function(){return this._title},set:function(e){var t;e!==this._title&&this._dictionary&&(t=this._title,this._title=e,this._dictionary.update("Title",e),this._dictionary._updated=!0,this._updateNamedDestinationTitle(e,t))},enumerable:!0,configurable:!0}),DDt.prototype._updateNamedDestinationTitle=function(e,t){var i,n=this._crossReference;n&&n._document&&(n=n._document._catalog._catalogDictionary)&&n.has("Names")&&(n=n.get("Names"))&&n.has("Dests")&&(n=n.get("Dests"))&&n.has("Names")&&-1!==(t=(i=n.get("Names")).indexOf(t))&&(i.splice(t,1,e),delete n._map.Names,n.update("Names",i),n._updated=!0)},DDt.prototype._initialize=function(){this._dictionary=new mPt,this._dictionary.update("S",k.get("GoTo"))};var EDt=DDt;function DDt(e,t){"string"==typeof e?(this._initialize(),this.title=e):(this._dictionary=e,this._crossReference=t)}kDt.prototype._findDestination=function(e){if(e)if(e.has("Names"))this._addCollection(e);else if(e.has("Kids")){var t=e.getArray("Kids");if(t&&Array.isArray(t)&&0<t.length)for(var i=0;i<t.length;i++)this._findDestination(t[Number.parseInt(i.toString(),10)])}},kDt.prototype._addCollection=function(e){var t,i,n=e.getRaw("Names");if((n=(t=n&&n instanceof aPt?this._crossReference._fetch(n):t)&&Array.isArray(t)&&0<t.length?t:n)&&Array.isArray(n)&&0<n.length)for(var o=1;o<n.length;o+=2){var r=n[o];if(r&&r instanceof aPt?(l=this._crossReference._fetch(r))&&Array.isArray(l)&&0<l.length?(i=new mPt).update("D",l):i=this._crossReference._fetch(r):null==i&&Array.isArray(r)&&(i=new mPt).update("D",r),i){var s,a,l=new EDt(i,this._crossReference),r=n[o-1],h=void 0,d=void 0;if(r&&(l._title=r,i.has("D"))&&(d=i.get("D"),h=new FDt,r=d[0])&&d&&d[0]instanceof aPt&&(r=this._crossReference._fetch(r),a=void 0,s=this._crossReference._document)&&r&&null!=(a=uMt(s,r))&&0<=a&&(h._index=a,h.page=s.getPage(a)),d[1]instanceof k){var p,c,u=void 0,g=void 0,m=void 0,r=d[1].name,f=h.page;switch(r){case"Fit":h._destinationMode=zAt.fitToPage;break;case"XYZ":h._destinationMode=zAt.location,2<d.length&&(u=d[2]),3<d.length&&(g=d[3]),4<d.length&&(m=d[4]),f&&(p=f.size,c=null==g?0:p[1]-g,h._location=[null==u?0:u,c],f.rotation!==TAt.angle0&&(c=cMt(f,g,u)),h._zoom=null!=m?m:0,null!==u&&null!==g&&null!==m&&void 0!==u&&void 0!==g&&void 0!==m||(h._isValid=!1));break;case"FitH":case"FitBH":h._destinationMode=zAt.fitH,3<=d.length&&(g=d[2]),f&&(p=f.size,c=null==g?0:p[1]-g,h._location=[0,c]),null==g&&(h._isValid=!1);break;case"FitR":h._destinationMode=zAt.fitR}}(h._parent=l)._destination=h,this._namedDestinations.push(l)}}};var MDt=kDt;function kDt(e,t){if(this._namedDestinations=[],e&&(this._dictionary=e),t&&(this._crossReference=t),e&&e.has("Dests")){t=e.get("Dests");if(t)if(t.has("Names"))this._addCollection(t);else if(t.has("Kids"))for(var i=t.getArray("Kids"),n=0;n<i.length;n++)this._findDestination(i[Number.parseInt(n.toString(),10)])}}Object.defineProperty(BDt.prototype,"annotations",{get:function(){var e,t,i;return void 0===this._annotations&&(this._pageDictionary&&this._pageDictionary.has("Annots")&&Kkt(e=this._getProperty("Annots"))&&Array.isArray(e)&&((t=this._crossReference._document._catalog._catalogDictionary.has("AcroForm")?this._crossReference._document.form._parseWidgetReferences():t)&&0<t.length?(i=[],e.forEach(function(e){-1===t.indexOf(e)&&i.push(e)}),this._annotations=new yDt(i,this._crossReference,this)):this._annotations=new yDt(e,this._crossReference,this)),void 0===this._annotations)&&(this._annotations=new yDt([],this._crossReference,this)),this._annotations},enumerable:!0,configurable:!0}),Object.defineProperty(BDt.prototype,"size",{get:function(){var e,t,i,n,o;return void 0===this._size&&(e=PMt(this._pageDictionary,"MediaBox",!1,!0,"Parent","P"),o=PMt(this._pageDictionary,"CropBox",!1,!0,"Parent","P"),n=i=0,t=this._pageDictionary&&this._pageDictionary.has("Rotate")?PMt(this._pageDictionary,"Rotate",!1,!0,"Parent"):0,o&&null!=t?(i=o[2]-o[0],n=o[3]-o[1],o=!(e&&e[2]-e[0]<i),(0===t||180===t)&&i<n||(90===t||270===t)&&n<i||o||0!==t||!e||(i=e[2]-e[0],n=0!==e[3]?e[3]-e[1]:e[1])):n=e?(i=e[2]-e[0],0!==e[3]?e[3]-e[1]:e[1]):(this._pageDictionary.update("MediaBox",[0,0,612,792]),i=612,792),this._size=[Math.abs(i),Math.abs(n)]),this._size},enumerable:!0,configurable:!0}),Object.defineProperty(BDt.prototype,"rotation",{get:function(){var e=0;return void 0===this._rotation&&((e=PMt(this._pageDictionary,"Rotate",!1,!0,"Parent"))<0&&(e+=360),this._rotation=void 0!==e?e/90%4:TAt.angle0),this._rotation},set:function(e){this._isNew||(this._rotation=e,360<=(e=90*Math.floor(this._rotation))&&(e%=360),this._pageDictionary.update("Rotate",e))},enumerable:!0,configurable:!0}),Object.defineProperty(BDt.prototype,"tabOrder",{get:function(){return this._obtainTabOrder()},set:function(e){this._tabOrder=e;e="";this._tabOrder!==WAt.none&&(this._tabOrder===WAt.row?e="R":this._tabOrder===WAt.column?e="C":this._tabOrder===WAt.structure&&(e="S")),this._pageDictionary.update("Tabs",k.get(e))},enumerable:!0,configurable:!0}),Object.defineProperty(BDt.prototype,"cropBox",{get:function(){return void 0===this._cBox&&(this._cBox=PMt(this._pageDictionary,"CropBox",!1,!0,"Parent","P")),void 0===this._cBox&&(this._cBox=[0,0,0,0]),this._cBox},enumerable:!0,configurable:!0}),Object.defineProperty(BDt.prototype,"mediaBox",{get:function(){return void 0===this._mBox&&(this._mBox=PMt(this._pageDictionary,"MediaBox",!1,!0,"Parent","P")),void 0===this._mBox&&(this._mBox=[0,0,0,0]),this._mBox},enumerable:!0,configurable:!0}),Object.defineProperty(BDt.prototype,"orientation",{get:function(){var e;return void 0===this._orientation&&void 0!==this.size&&((e=this.size)[0]>e[1]?this._orientation=KAt.landscape:this._orientation=KAt.portrait),this._orientation},enumerable:!0,configurable:!0}),Object.defineProperty(BDt.prototype,"_origin",{get:function(){return(void 0===this._o||0===this._o[0]&&0===this._o[1])&&(this._o=[this.mediaBox[0],this._mBox[1]]),this._o},enumerable:!0,configurable:!0}),Object.defineProperty(BDt.prototype,"graphics",{get:function(){return void 0!==this._g&&!this._needInitializeGraphics||this._parseGraphics(),this._g},enumerable:!0,configurable:!0}),BDt.prototype._addWidget=function(e){var t,i;this._pageDictionary.has("Annots")&&(t=this._pageDictionary.getRaw("Annots"),i=this._getProperty("Annots"),t)&&t instanceof aPt&&(delete this._pageDictionary._map.Annots,this._pageDictionary.update("Annots",i)),i&&Array.isArray(i)?i.push(e):this._pageDictionary.update("Annots",[e]),this._pageDictionary._updated=!0},BDt.prototype._getProperty=function(e,t){e=PMt(this._pageDictionary,e,t=void 0===t?!1:t,!1);return Array.isArray(e)?1!==e.length&&e[0]instanceof mPt?mPt.merge(this._crossReference,e):e[0]:e},BDt.prototype._parseGraphics=function(){this._loadContents();var e=new DPt([32,113,32,10]),t=this._crossReference._getNextReference(),e=(this._crossReference._cacheMap.set(t,e),this._contents.splice(0,0,t),new DPt([32,81,32,10])),t=this._crossReference._getNextReference(),e=(this._crossReference._cacheMap.set(t,e),this._contents.push(t),new DPt([])),t=this._crossReference._getNextReference();this._crossReference._cacheMap.set(t,e),this._contents.push(t),this._pageDictionary.set("Contents",this._contents),this._pageDictionary._updated=!0,this._initializeGraphics(e)},BDt.prototype._loadContents=function(){var e,t=this._pageDictionary.getRaw("Contents");null!=t&&t instanceof aPt&&(e=t,t=this._crossReference._fetch(e)),t&&t instanceof SPt?this._contents=[e]:t&&Array.isArray(t)?this._contents=t:this._contents=[]},BDt.prototype._initializeGraphics=function(e){var t,i,n,o=!1,r=0,s=0,a=0,l=0,h=this.size,d=this.mediaBox,p=(d&&4<=d.length&&(r=d[0],s=d[1],a=d[2],l=d[3]),this._pageDictionary.has("CropBox")?(d=this.cropBox)&&4<=d.length?(t=d[0],p=d[1],i=d[2],n=d[3],(t<0||p<0||i<0||n<0)&&Math.floor(Math.abs(p))===Math.floor(Math.abs(h[1]))&&Math.floor(Math.abs(t))===Math.floor(Math.abs(h[0]))?this._g=new aIt([Math.max(t,i),Math.max(p,n)],e,this._crossReference,this):(this._g=new aIt(h,e,this._crossReference,this),this._g._cropBox=d)):this._g=new aIt(h,e,this._crossReference,this):(r<0||s<0||a<0||l<0)&&Math.floor(Math.abs(s))===Math.floor(Math.abs(h[1]))&&Math.floor(Math.abs(a))===Math.floor(Math.abs(h[0]))?(t=Math.max(r,a),i=Math.max(s,l),(t<=0||i<=0)&&(o=!0,r<0&&(r=-r),s<0&&(s=-s),a<0&&(a=-a),l<0&&(l=-l),t=Math.max(r,a),i=Math.max(s,l)),this._g=new aIt([t,i],e,this._crossReference,this)):this._g=new aIt(h,e,this._crossReference,this),this._pageDictionary.has("MediaBox")&&(this._g._mediaBoxUpperRightBound=o?-s:l),this._graphicsState=this._g.save(),this._origin);0<=p[0]&&0<=p[1]||Math.sign(p[0])!==Math.sign(p[1])?this._g._initializeCoordinates():this._g._initializeCoordinates(this),this._isNew||(n=this.rotation,Number.isNaN(n))||n===TAt.angle0&&!this._pageDictionary.has("Rotate")||(d=void 0,d=this._pageDictionary.has("Rotate")?this._pageDictionary.get("Rotate"):90*n,r=this._g._clipBounds,90===d?(this._g.translateTransform(0,h[1]),this._g.rotateTransform(-90),this._g._clipBounds=[r[0],r[1],h[0],h[1]]):180===d?(this._g.translateTransform(h[0],h[1]),this._g.rotateTransform(-180)):270===d&&(this._g.translateTransform(h[0],0),this._g.rotateTransform(-270),this._g._clipBounds=[r[0],r[1],h[1],h[0]])),this._isNew&&this._pageSettings&&(a=this._getActualBounds(this._pageSettings),this._g._clipTranslateMargins(a)),this._needInitializeGraphics=!1},BDt.prototype._getActualBounds=function(e){var t=e._getActualSize();return[e.margins.left,e.margins.top,t[0],t[1]]},BDt.prototype._fetchResources=function(){var e;return void 0===this._resourceObject&&(this._pageDictionary&&this._pageDictionary.has("Resources")?null!=(e=this._pageDictionary.getRaw("Resources"))&&e instanceof aPt?(this._hasResourceReference=!0,this._resourceObject=this._crossReference._fetch(e)):e&&e instanceof mPt&&(this._resourceObject=e):(this._resourceObject=new mPt(this._crossReference),this._pageDictionary.update("Resources",this._resourceObject))),this._resourceObject},BDt.prototype._getCropOrMediaBox=function(){var e;return this._pageDictionary&&(this._pageDictionary.has("CropBox")?e=this._pageDictionary.getArray("CropBox"):this._pageDictionary.has("MediaBox")&&(e=this._pageDictionary.getArray("MediaBox"))),e},BDt.prototype._beginSave=function(){void 0!==this._graphicsState&&(this.graphics.restore(this._graphicsState),this._graphicsState=null,this._needInitializeGraphics=!0)},BDt.prototype._destroy=function(){this._pageDictionary=void 0,this._size=void 0,this._mBox=void 0,this._cBox=void 0,this._o=void 0,this._g=void 0,this._graphicsState=void 0,this._contents=void 0},BDt.prototype._obtainTabOrder=function(){var e;return this._pageDictionary&&this._pageDictionary.has("Tabs")&&((e=this._pageDictionary.get("Tabs"))===k.get("R")?this._tabOrder=WAt.row:e===k.get("C")?this._tabOrder=WAt.column:e===k.get("S")?this._tabOrder=WAt.structure:e===k.get("W")&&(this._tabOrder=WAt.widget)),null!==this._tabOrder&&void 0!==this._tabOrder||(this._tabOrder=WAt.none),this._tabOrder},BDt.prototype._removeAnnotation=function(e){var t;this._pageDictionary&&this._pageDictionary.has("Annots")&&Kkt(t=this._getProperty("Annots"))&&Array.isArray(t)&&(0<=(e=t.indexOf(e))&&t.splice(e,1),this._pageDictionary.set("Annots",t),this._pageDictionary._updated=!0)},Object.defineProperty(BDt.prototype,"_contentTemplate",{get:function(){this._fetchResources();var e=this._combineContent(),e=new DPt(Array.from(e)),e=new _It(e,this._crossReference);return e._content.dictionary.set("Resources",this._resourceObject),0<this.cropBox[0]||0<this.cropBox[1]?(e._content.dictionary.set("BBox",this.cropBox),e._size=[this.cropBox[0],this.cropBox[1]]):0<this.mediaBox[0]||0<this.mediaBox[1]?(e._content.dictionary.set("BBox",this.mediaBox),e._size=[this.mediaBox[0],this.mediaBox[1]]):(e._content.dictionary.set("BBox",[0,0,this.size[0],this.size[1]]),e._size=[this.size[0],this.size[1]]),e},enumerable:!0,configurable:!0}),BDt.prototype._combineIntoSingleArray=function(e){var t=e.reduce(function(e,t){return e+t.length},0),i=new Uint8Array(t),n=0;return e.forEach(function(e){i.set(e,n),n+=e.length}),i},BDt.prototype._combineContent=function(){var e,t=[],i=(this._loadContents(),this._contents.length);t.push(new Uint8Array([32,113,32,10]));for(var n=0;n<i;n++){var o=this._contents[Number.parseInt(n.toString(),10)],o=this._crossReference._fetch(o);o&&(o instanceof DPt?e=new Uint8Array(o._bytes):o instanceof SPt&&(e=o.getBytes()),e)&&(t.push(e),t.push(new Uint8Array([13,10])))}return t.push(new Uint8Array([32,81,32,10])),t.push(new Uint8Array([13,10])),this._combineIntoSingleArray(t)};var PDt=BDt;function BDt(e,t,i,n){this._isAnnotationParsed=!1,this._isNew=!1,this._isDuplicate=!1,this._pageIndex=t,this._pageDictionary=i,this._crossReference=e,this._ref=n}Object.defineProperty(LDt.prototype,"zoom",{get:function(){return this._zoom},set:function(e){e!==this._zoom&&(this._zoom=e,this._initializePrimitive())},enumerable:!0,configurable:!0}),Object.defineProperty(LDt.prototype,"page",{get:function(){return this._page},set:function(e){e!==this._page&&(this._page=e,this._initializePrimitive(),this._index=e._pageIndex)},enumerable:!0,configurable:!0}),Object.defineProperty(LDt.prototype,"pageIndex",{get:function(){return this._index},enumerable:!0,configurable:!0}),Object.defineProperty(LDt.prototype,"mode",{get:function(){return this._destinationMode},set:function(e){e!==this._destinationMode&&(this._destinationMode=e,this._initializePrimitive())},enumerable:!0,configurable:!0}),Object.defineProperty(LDt.prototype,"location",{get:function(){return this._location},set:function(e){e!==this._location&&(this._location=e,this._initializePrimitive())},enumerable:!0,configurable:!0}),Object.defineProperty(LDt.prototype,"destinationBounds",{get:function(){return this._destinationBounds},set:function(e){e!==this._destinationBounds&&(this._destinationBounds=e,this._initializePrimitive())},enumerable:!0,configurable:!0}),Object.defineProperty(LDt.prototype,"isValid",{get:function(){return this._isValid},enumerable:!0,configurable:!0}),LDt.prototype._setValidation=function(e){this._isValid=e},LDt.prototype._initializePrimitive=function(){this._array=[];var e=this._page;if(e&&e._pageDictionary){var t=e._pageDictionary;switch(null!=t&&this._array.push(this._page._ref),this._destinationMode){case zAt.location:this._array.push(k.get("XYZ")),null!=e?(this._array.push(this._location[0]),this._array.push(this._page.graphics._size[1]-this._location[1])):(this._array.push(0),this._array.push(0)),this._array.push(this._zoom);break;case zAt.fitToPage:this._array.push(k.get("Fit"));break;case zAt.fitR:this._array.push(k.get("FitR")),this._array.push(this._destinationBounds[0]),this._array.push(this._destinationBounds[1]),this._array.push(this._destinationBounds[2]),this._array.push(this._destinationBounds[3]);break;case zAt.fitH:this._array.push(k.get("FitH")),this._array.push(null!=e?e._size[1]-this._location[1]:0)}this._parent&&(this._parent._dictionary.set(this._parent instanceof EDt?"D":"Dest",this._array),this._parent._dictionary._updated=!0)}};var FDt=LDt;function LDt(e,t){this._location=[0,0],this._destinationMode=zAt.location,this._zoom=0,this._isValid=!0,this._index=0,this._destinationBounds=[0,0,0,0],this._array=Array(),null!=e&&(e.rotation===TAt.angle180?this._location=[e.graphics._size[0],this._location[1]]:e.rotation===TAt.angle90?this._location=[0,0]:e.rotation===TAt.angle270?this._location=[e.graphics._size[0],0]:this._location=[0,this._location[1]],this._page=e,this._index=e._pageIndex),void 0!==t&&2===t.length&&(this._location=t),void 0!==t&&4===t.length&&(this._location=[t[0],t[1]],this._destinationBounds=t)}RDt.prototype._reset=function(){this._position=0},RDt.prototype._getBuffer=function(e){return this._stream[Number.parseInt(e.toString(),10)]},RDt.prototype._read=function(e,t,i,n){if(n&&Array.isArray(n)){var o=0;if(i<=n.length&&n.length-t>=i)for(var r=0;r<i;r++)e[Number.parseInt(r.toString(),10)]=n[Number.parseInt(t.toString(),10)],t++,o++;return{outputBuffer:e,offset:t,length:o}}for(var s=t;s<i;s++){var a=this._position;e[Number.parseInt(s.toString(),10)]=this._getBuffer(a),this._position++}},RDt.prototype._readString=function(e){for(var t="",i=0;i<e;i++)t+=String.fromCharCode(this._readByte());return t},RDt.prototype._seek=function(e){this._position+=e},RDt.prototype._readByte=function(){var e;if(this._position<this._stream.byteLength)return e=this._getBuffer(this._position),this._position+=1,e;throw new Error("Error decoding JPEG image. Invalid offset.")},RDt.prototype._toUnsigned16=function(e){return(e&=65535)<0?e+65536:e},RDt.prototype._readUnsigned32=function(e){return this._getBuffer(e+3)|this._getBuffer(e+2)<<8|this._getBuffer(e+1)<<16|this._getBuffer(e)<<24};N$e=RDt;function RDt(){this._format=c1t.unknown,this._height=0,this._width=0,this._bitsPerComponent=8,this._position=0,this._noOfComponents=-1}ODt=function(e,t){return(ODt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}ODt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(zDt,NDt=N$e),Object.defineProperty(zDt.prototype,"_imageDataAsNumberArray",{get:function(){return this._imageData},enumerable:!0,configurable:!0}),zDt.prototype._initialize=function(){this._format=c1t.jpeg,this._readHeader(),this._reset(),this._imageData=new Uint8Array(this._stream.byteLength),this._read(this._imageData,0,this._imageData.byteLength)},zDt.prototype._readHeader=function(){this._reset();for(var e=new Uint8Array(this._stream.byteLength),t=(this._read(e,0,e.byteLength),4),i=256*this._getBuffer(t)+this._getBuffer(t+1),n=!1;t<e.byteLength;){if(!((t+=i)<e.byteLength)){n=!0;break}if(192===this._getBuffer(t+1)){if(this._height=256*this._getBuffer(t+5)+this._getBuffer(t+6),this._width=256*this._getBuffer(t+7)+this._getBuffer(t+8),this._noOfComponents=this._getBuffer(t+9),0!==this._width&&0!==this._height)return}else t+=2,i=256*this._getBuffer(t)+this._getBuffer(t+1)}n&&(this._reset(),this._seek(2),this._readExceededJpegImage())},zDt.prototype._getImageDictionary=function(){this._imageStream=new IPt([],new mPt),this._imageStream.isImageStream=!0;for(var e="",t="",i=0;i<this._imageDataAsNumberArray.byteLength;i++)e+=" "+String.fromCharCode(this._getBuffer(i));for(i=0;i<e.length;i++)i%2!=0&&(t+=e[Number.parseInt(i.toString(),10)]);this._imageStream.data=[t],this._imageStream._isCompress=!1;var n=new mPt;n.set("Type",new k("XObject")),n.set("Subtype",new k("Image")),n.set("Width",this._width),n.set("Height",this._height),n.set("BitsPerComponent",this._bitsPerComponent),n.set("Filter",new k("DCTDecode")),n.set("ColorSpace",new k(this._getColorSpace())),n.set("DecodeParms",this._getDecodeParams()),this._imageStream.dictionary=n,this._imageStream.bytes=new Uint8Array(this._imageStream.data[0].length);for(i=0;i<this._imageStream.data[0].length;i++)this._imageStream.bytes[Number.parseInt(i.toString(),10)]=this._imageStream.data[0].charCodeAt(i);return this._imageStream.end=this._imageStream.bytes.length,this._imageStream.dictionary._updated=!0,this._imageStream},zDt.prototype._getColorSpace=function(){return 1===this._noOfComponents?"DeviceGray":4===this._noOfComponents?"DeviceCMYK":"DeviceRGB"},zDt.prototype._getDecodeParams=function(){var e=new mPt;return e.set("Columns",this._width),e.set("BlackIs1",!0),e.set("K",-1),e.set("Predictor",15),e.set("BitsPerComponent",this._bitsPerComponent),e},zDt.prototype._skipStream=function(){var e=this._getBuffer(this._position)<<8|this._getBuffer(this._position+1);if(this._seek(2),e<2)throw new Error("Error decoding JPEG image");0<e&&this._seek(e-2)},zDt.prototype._readExceededJpegImage=function(){for(var e=!0;e;)switch(this._getMarker()){case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:this._seek(3),this._height=this._getBuffer(this._position)<<8|this._getBuffer(this._position+1),this._seek(2),this._width=this._getBuffer(this._position)<<8|this._getBuffer(this._position+1),this._seek(2),this._noOfComponents=this._getBuffer(this._position),this._seek(1),e=!1;break;default:this._skipStream()}},zDt.prototype._getMarker=function(){for(var e=0,t=this._readByte();255!==t;)e++,t=this._readByte();for(;255===(t=this._readByte()););if(0!==e)throw new Error("Error decoding JPEG image");return this._toUnsigned16(t)};var ODt,NDt,VDt,_Dt,HDt=zDt;function zDt(e){var t=NDt.call(this)||this;return t._stream=e,t._initialize(),t}(ts=VDt=VDt||{})[ts.readingHeader=0]="readingHeader",ts[ts.readingBFinal=1]="readingBFinal",ts[ts.readingBType=2]="readingBType",ts[ts.readingNlCodes=3]="readingNlCodes",ts[ts.readingNdCodes=4]="readingNdCodes",ts[ts.readingCodes=5]="readingCodes",ts[ts.readingClCodes=6]="readingClCodes",ts[ts.readingTcBefore=7]="readingTcBefore",ts[ts.readingTcAfter=8]="readingTcAfter",ts[ts.decodeTop=9]="decodeTop",ts[ts.iLength=10]="iLength",ts[ts.fLength=11]="fLength",ts[ts.dCode=12]="dCode",ts[ts.unCompressedAligning=13]="unCompressedAligning",ts[ts.unCompressedByte1=14]="unCompressedByte1",ts[ts.unCompressedByte2=15]="unCompressedByte2",ts[ts.unCompressedByte3=16]="unCompressedByte3",ts[ts.unCompressedByte4=17]="unCompressedByte4",ts[ts.decodeUnCompressedBytes=18]="decodeUnCompressedBytes",ts[ts.srFooter=19]="srFooter",ts[ts.rFooter=20]="rFooter",ts[ts.vFooter=21]="vFooter",ts[ts.done=22]="done",(d$=_Dt=_Dt||{})[d$.unCompressedType=0]="unCompressedType",d$[d$.staticType=1]="staticType",d$[d$.dynamicType=2]="dynamicType";Object.defineProperty(WDt.prototype,"_unusedBytes",{get:function(){return WDt._dOutSize-this._usedBytes},enumerable:!0,configurable:!0}),WDt.prototype._write=function(e){this._dOutput[this._end++]=e,this._end&=WDt._dOutMask,++this._usedBytes},WDt.prototype._writeLD=function(e,t){this._usedBytes+=e;var i=this._end-t&WDt._dOutMask,n=WDt._dOutSize-e;if(i<=n&&this._end<n)if(e<=t)hMt(this._dOutput,this._end,this._dOutput,i,i+e),this._end+=e;else for(;0<e--;)this._dOutput[this._end++]=this._dOutput[i++];else for(;0<e--;)this._dOutput[this._end++]=this._dOutput[i++],this._end&=WDt._dOutMask,i&=WDt._dOutMask},WDt.prototype._copyFrom=function(e,t){t=Math.min(Math.min(t,WDt._dOutSize-this._usedBytes),e._bytes);var i,n=WDt._dOutSize-this._end;return n<t?(i=e._copyTo(this._dOutput,this._end,n))===n&&(i+=e._copyTo(this._dOutput,0,t-n)):i=e._copyTo(this._dOutput,this._end,t),this._end=this._end+i&WDt._dOutMask,this._usedBytes+=i,i},WDt.prototype._copyTo=function(e,t,i){i>this._usedBytes?(n=this._end,i=this._usedBytes):n=this._end-this._usedBytes+i&WDt._dOutMask;var n,o=i,r=i-n,s=WDt._dOutSize-r;if(0<r){for(var a=0;a<r&&a+s<this._dOutput.length&&a+t<e.length;a++)e[t+a]=this._dOutput[s+a];var l=WDt._dOutSize-r;hMt(e,t,this._dOutput,l,l+r),t+=r,i=n}s=n-i;return hMt(e,t,this._dOutput,n-i,n),this._usedBytes-=o,{count:o,data:e}},WDt._dOutSize=32768,WDt._dOutMask=32767;var jDt=WDt;function WDt(){this._end=0,this._usedBytes=0,this._dOutput=Array(WDt._dOutSize).fill(0),this._end=0,this._usedBytes=0}Object.defineProperty(UDt.prototype,"_bytes",{get:function(){return this._end-this._begin+Math.floor(this._bInBuffer/8)},enumerable:!0,configurable:!0}),UDt.prototype._needsInput=function(){return this._begin===this._end},UDt.prototype._availableBits=function(e){if(this._bInBuffer<e){if(this._needsInput())return!1;if(this._bBuffer|=sMt(this._buffer[this._begin++],32)<<this._bInBuffer,this._bInBuffer+=8,this._bInBuffer<e){if(this._needsInput())return!1;this._bBuffer|=sMt(this._buffer[this._begin++],32)<<this._bInBuffer,this._bInBuffer+=8}}return!0},UDt.prototype._load16Bits=function(){return this._bInBuffer<8?(this._begin<this._end&&(this._bBuffer|=sMt(this._buffer[this._begin++],32)<<this._bInBuffer,this._bInBuffer+=8),this._begin<this._end&&(this._bBuffer|=sMt(this._buffer[this._begin++],32)<<this._bInBuffer,this._bInBuffer+=8)):this._bInBuffer<16&&this._begin<this._end&&(this._bBuffer|=sMt(this._buffer[this._begin++],32)<<this._bInBuffer,this._bInBuffer+=8),this._bBuffer},UDt.prototype._getBitMask=function(e){return(sMt(1,32)<<e)-1},UDt.prototype._getBits=function(e){var t;return this._availableBits(e)?(t=this._bBuffer&this._getBitMask(e),this._bBuffer>>=e,this._bInBuffer-=e,t):-1},UDt.prototype._copyTo=function(e,t,i){for(var n=0;0<this._bInBuffer&&0<i;)e[t++]=sMt(this._bBuffer,8),this._bBuffer>>=8,this._bInBuffer-=8,i--,n++;if(0===i)return n;var o=this._end-this._begin;o<i&&(i=o);for(var r=0;r<i&&r+this._begin<this._buffer.length&&r+t<e.length;r++)e[t+r]=this._buffer[this._begin+r];return this._begin+=i,n+i},UDt.prototype._setInput=function(e,t,i){this._buffer=e,this._begin=t,this._end=t+i},UDt.prototype._skipBits=function(e){this._bBuffer>>=e,this._bInBuffer-=e},UDt.prototype._skipByteBoundary=function(){this._bBuffer>>=this._bInBuffer%8,this._bInBuffer=this._bInBuffer-this._bInBuffer%8};var QDt=UDt;function UDt(){this._bBuffer=0,this._bInBuffer=0,this._begin=0,this._end=0}GDt.prototype._load=function(e){this._clArray=e,this._initialize()},GDt.prototype._loadTree=function(e){this._clArray=e?this._getLengthTree():this._getDepthTree(),this._initialize()},GDt.prototype._initialize=function(){this._clArray.length===GDt._maxLengthTree?this._tBits=9:this._tBits=7,this._tMask=(1<<this._tBits)-1,this._createTable()},GDt.prototype._getLengthTree=function(){for(var e=Array(GDt._maxLengthTree).fill(0),t=0;t<=143;t++)e[Number.parseInt(t.toString(),10)]=sMt(8,8);for(t=144;t<=255;t++)e[Number.parseInt(t.toString(),10)]=sMt(9,8);for(t=256;t<=279;t++)e[Number.parseInt(t.toString(),10)]=sMt(7,8);for(t=280;t<=287;t++)e[Number.parseInt(t.toString(),10)]=sMt(8,8);return e},GDt.prototype._getDepthTree=function(){return Array(GDt._maxDepthTree).fill(5)},GDt.prototype._calculateHashCode=function(){for(var e=Array(17).fill(0),t=0;t<this._clArray.length;t++)e[this._clArray[Number.parseInt(t.toString(),10)]]++;e[0]=0;for(var i=Array(17).fill(0),n=0,o=1;o<=16;o++)n=n+e[o-1]<<1,i[Number.parseInt(o.toString(),10)]=n;for(var r=Array(GDt._maxLengthTree).fill(0),t=0;t<this._clArray.length;t++){var s=this._clArray[Number.parseInt(t.toString(),10)];0<s&&(r[Number.parseInt(t.toString(),10)]=this._bitReverse(i[Number.parseInt(s.toString(),10)],s),i[Number.parseInt(s.toString(),10)]++)}return r},GDt.prototype._bitReverse=function(e,t){for(var i=0;i=(i|1&e)<<1,e>>=1,0<--t;);return i>>1},GDt.prototype._createTable=function(){for(var e=this._calculateHashCode(),t=(this._table=Array(1<<this._tBits).fill(0),this._left=Array(2*this._clArray.length).fill(0),this._right=Array(2*this._clArray.length).fill(0),aMt(this._clArray.length)),i=0;i<this._clArray.length;i++){var n=this._clArray[Number.parseInt(i.toString(),10)];if(0<n){var o=e[Number.parseInt(i.toString(),10)];if(n<=this._tBits){var r=1<<n;if(r<=o)throw new Error("Invalid Data.");for(var s=1<<this._tBits-n,a=0;a<s;a++)this._table[Number.parseInt(o.toString(),10)]=aMt(i),o+=r}else{var l=n-this._tBits,h=1<<this._tBits,d=o&(1<<this._tBits)-1,p=this._table;do{var c=aMt(p[Number.parseInt(d.toString(),10)]);if(0===c&&(p[Number.parseInt(d.toString(),10)]=aMt(-t),c=aMt(-t),t++),0<c)throw new Error("Invalid Data.")}while(p=0==(o&h)?this._left:this._right,d=-c,h<<=1,0!==--l);p[Number.parseInt(d.toString(),10)]=aMt(i)}}}},GDt.prototype._getNextSymbol=function(e){var t=e._load16Bits();if(0===e._bInBuffer)return-1;var i=this._table[t&this._tMask];if(i<0)for(var n=sMt(1<<this._tBits,32);i=-i,i=(0==(t&n)?this._left:this._right)[Number.parseInt(i.toString(),10)],n<<=1,i<0;);var o=this._clArray[Number.parseInt(i.toString(),10)];if(o<=0)throw new Error("Invalid Data.");return o>e._bInBuffer?-1:(e._skipBits(o),i)},GDt._maxLengthTree=288,GDt._maxDepthTree=32,GDt._nCLength=19;var qDt=GDt;function GDt(){}Object.defineProperty(XDt.prototype,"_finished",{get:function(){return this._inflaterState===VDt.done||this._inflaterState===VDt.vFooter},enumerable:!0,configurable:!0}),XDt.prototype._setInput=function(e,t,i){this._input._setInput(e,t,i)},XDt.prototype._inflate=function(e,t,i){var n=0;do{var o=this._output._copyTo(e,t,i),r=o.count}while((e=o.data,0<r&&(t+=r,n+=r,i-=r),0!==i)&&(!this._finished&&this._decode()));return{count:n,data:e}},XDt.prototype._decode=function(){var e,t=!1,i=!1;if(this._finished)return!0;if(this._inflaterState===VDt.readingBFinal){if(!this._input._availableBits(1))return!1;this._bfinal=this._input._getBits(1),this._inflaterState=VDt.readingBType}if(this._inflaterState===VDt.readingBType){if(!this._input._availableBits(2))return this._inflaterState=VDt.readingBType,!1;this._blockType=this._getBlockType(this._input._getBits(2)),this._blockType===_Dt.dynamicType?this._inflaterState=VDt.readingNlCodes:this._blockType===_Dt.staticType?(this._llTree=new qDt,this._llTree._loadTree(!0),this._distanceTree=new qDt,this._distanceTree._loadTree(!1),this._inflaterState=VDt.decodeTop):this._blockType===_Dt.unCompressedType&&(this._inflaterState=VDt.unCompressedAligning)}return this._blockType===_Dt.dynamicType?this._getInflaterStateValue(this._inflaterState)<this._getInflaterStateValue(VDt.decodeTop)?i=this._decodeDynamicBlockHeader():(i=(e=this._decodeBlock(t)).result,t=e.eob,this._output=e.output):this._blockType===_Dt.staticType?(i=(e=this._decodeBlock(t)).result,t=e.eob,this._output=e.output):this._blockType===_Dt.unCompressedType&&(i=(e=this._decodeUncompressedBlock(t)).result,t=e.eob,this._output=e.output),t&&0!==this._bfinal&&(this._inflaterState=VDt.done),i},XDt.prototype._decodeUncompressedBlock=function(e){for(e=!1;;)switch(this._inflaterState){case VDt.unCompressedAligning:if(this._input._skipByteBoundary(),this._inflaterState=VDt.unCompressedByte1,this._unCompressedByte())break;return{result:!1,eob:e,output:this._output};case VDt.unCompressedByte1:case VDt.unCompressedByte2:case VDt.unCompressedByte3:case VDt.unCompressedByte4:if(this._unCompressedByte())break;return{result:!1,eob:e,output:this._output};case VDt.decodeUnCompressedBytes:return this._bLength-=this._output._copyFrom(this._input,this._bLength),0===this._bLength?(this._inflaterState=VDt.readingBFinal,{result:e=!0,eob:e,output:this._output}):0===this._output._unusedBytes?{result:!0,eob:e,output:this._output}:{result:!1,eob:e,output:this._output}}},XDt.prototype._unCompressedByte=function(){var e=this._input._getBits(8);if(e<0)return!1;var t=this._getInflaterStateValue(this._inflaterState),i=this._getInflaterStateValue(VDt.unCompressedByte1);if(this._blBuffer[t-i]=sMt(e,8),this._inflaterState===VDt.unCompressedByte4&&(this._bLength=this._blBuffer[0]+256*this._blBuffer[1],sMt(this._bLength,16)!==sMt(~(this._blBuffer[2]+256*this._blBuffer[3]),16)))throw new Error("Ivalid block length.");return this._inflaterState=this._getInflaterState(this._getInflaterStateValue(this._inflaterState)+1),!0},XDt.prototype._decodeBlock=function(e){e=!1;for(var t=this._output._unusedBytes;258<t;){var i,n=void 0,o=void 0;switch(this._inflaterState){case VDt.decodeTop:if((n=this._llTree._getNextSymbol(this._input))<0)return{result:!1,eob:e,output:this._output};if(n<256)this._output._write(sMt(n,8)),--t;else{if(256===n)return e=!0,this._inflaterState=VDt.readingBFinal,{result:!0,eob:e,output:this._output};if((n-=257)<8)n+=3,this._extraBits=0;else if(28===n)n=258,this._extraBits=0;else{if(n<0||n>=this._extraLengthBits.length)throw new Error("Invalid data.");this._extraBits=this._extraLengthBits[Number.parseInt(n.toString(),10)]}if(this._length=n,t=(o=this._inLength(t)).fb,!o.value)return{result:!1,eob:e,output:this._output}}break;case VDt.iLength:if(t=(o=this._inLength(t)).fb,o.value)break;return{result:!1,eob:e,output:this._output};case VDt.fLength:if(t=(i=this._fLength(t)).fb,i.value)break;return{result:!1,eob:e,output:this._output};case VDt.dCode:if(t=(i=this._dcode(t)).fb,i.value)break;return{result:!1,eob:e,output:this._output}}}return{result:!0,eob:e,output:this._output}},XDt.prototype._inLength=function(e){if(0<this._extraBits){this._inflaterState=VDt.iLength;var t=this._input._getBits(this._extraBits);if(t<0)return{value:!1,fb:e};if(this._length<0||this._length>=this._lengthBase.length)throw new Error("Invalid data.");this._length=this._lengthBase[this._length]+t}this._inflaterState=VDt.fLength;t=this._fLength(e);return e=t.fb,t.value?{value:!0,fb:e}:{value:!1,fb:e}},XDt.prototype._fLength=function(e){if(this._blockType===_Dt.dynamicType?this._distanceCode=this._distanceTree._getNextSymbol(this._input):(this._distanceCode=this._input._getBits(5),0<=this._distanceCode&&(this._distanceCode=this._staticDistanceTreeTable[this._distanceCode])),this._distanceCode<0)return{value:!1,fb:e};this._inflaterState=VDt.dCode;var t=this._dcode(e);return e=t.fb,t.value?{value:!0,fb:e}:{value:!1,fb:e}},XDt.prototype._dcode=function(e){if(3<this._distanceCode){this._extraBits=this._distanceCode-2>>1;var t=this._input._getBits(this._extraBits);if(t<0)return{value:!1,fb:e};t=this._distanceBasePosition[this._distanceCode]+t}else t=this._distanceCode+1;return this._output._writeLD(this._length,t),e-=this._length,this._inflaterState=VDt.decodeTop,{value:!0,fb:e}},XDt.prototype._decodeDynamicBlockHeader=function(){switch(this._inflaterState){case VDt.readingNlCodes:if(this._llCodeCount=this._input._getBits(5),this._llCodeCount<0||(this._llCodeCount+=257,this._inflaterState=VDt.readingNdCodes,!this._readingNDCodes()))return!1;break;case VDt.readingNdCodes:if(this._readingNDCodes())break;return!1;case VDt.readingCodes:if(this._readingCodes())break;return!1;case VDt.readingClCodes:if(this._readingCLCodes())break;return!1;case VDt.readingTcBefore:case VDt.readingTcAfter:if(this._readingTCBefore())break;return!1}var e=Array(qDt._maxLengthTree).fill(0),t=(hMt(e,0,this._codeList,0,this._llCodeCount),Array(qDt._maxDepthTree).fill(0));return hMt(t,0,this._codeList,this._llCodeCount,this._llCodeCount+this._dCodeCount),this._llTree=new qDt,this._llTree._load(e),this._distanceTree=new qDt,this._distanceTree._load(t),this._inflaterState=VDt.decodeTop,!0},XDt.prototype._readingNDCodes=function(){return this._dCodeCount=this._input._getBits(5),!(this._dCodeCount<0||(this._dCodeCount+=1,this._inflaterState=VDt.readingCodes,!this._readingCodes()))},XDt.prototype._readingCodes=function(){return this._clCodeCount=this._input._getBits(4),!(this._clCodeCount<0||(this._clCodeCount+=4,this._loopCounter=0,this._inflaterState=VDt.readingClCodes,!this._readingCLCodes()))},XDt.prototype._readingCLCodes=function(){for(;this._loopCounter<this._clCodeCount;){var e=this._input._getBits(3);if(e<0)return!1;this._cltcl[this._codeOrder[this._loopCounter]]=sMt(e,8),++this._loopCounter}for(var t=this._clCodeCount;t<this._codeOrder.length;t++)this._cltcl[this._codeOrder[Number.parseInt(t.toString(),10)]]=0;return this._clTree=new qDt,this._clTree._load(this._cltcl),this._caSize=this._llCodeCount+this._dCodeCount,this._loopCounter=0,this._inflaterState=VDt.readingTcBefore,!!this._readingTCBefore()},XDt.prototype._readingTCBefore=function(){for(;this._loopCounter<this._caSize;){if(this._inflaterState===VDt.readingTcBefore&&(this._lengthCode=this._clTree._getNextSymbol(this._input),this._lengthCode<0))return!1;if(this._lengthCode<=15)this._codeList[this._loopCounter++]=sMt(this._lengthCode,8);else{if(!this._input._availableBits(7))return this._inflaterState=VDt.readingTcAfter,!1;var e=void 0;if(16===this._lengthCode){if(0===this._loopCounter)throw new Error("Invalid data.");var t=sMt(this._codeList[this._loopCounter-1],8),e=this._input._getBits(2)+3;if(this._loopCounter+e>this._caSize)throw new Error("Invalid data.");for(var i=0;i<e;i++)this._codeList[this._loopCounter++]=t}else{if(17===this._lengthCode){if(e=this._input._getBits(3)+3,this._loopCounter+e>this._caSize)throw new Error("Invalid data.")}else if(e=this._input._getBits(7)+11,this._loopCounter+e>this._caSize)throw new Error("Invalid data.");for(i=0;i<e;i++)this._codeList[this._loopCounter++]=0}}this._inflaterState=VDt.readingTcBefore}return!0},XDt.prototype._getBlockType=function(e){return e===_Dt.unCompressedType?_Dt.unCompressedType:e===_Dt.staticType?_Dt.staticType:_Dt.dynamicType},XDt.prototype._getInflaterState=function(e){switch(e){case 0:return VDt.readingHeader;case 2:return VDt.readingBFinal;case 3:return VDt.readingBType;case 4:return VDt.readingNlCodes;case 5:return VDt.readingNdCodes;case 6:return VDt.readingCodes;case 7:return VDt.readingClCodes;case 8:return VDt.readingTcBefore;case 9:return VDt.readingTcAfter;case 10:return VDt.decodeTop;case 11:return VDt.iLength;case 12:return VDt.fLength;case 13:return VDt.dCode;case 15:return VDt.unCompressedAligning;case 16:return VDt.unCompressedByte1;case 17:return VDt.unCompressedByte2;case 18:return VDt.unCompressedByte3;case 19:return VDt.unCompressedByte4;case 20:return VDt.decodeUnCompressedBytes;case 21:return VDt.srFooter;case 22:return VDt.rFooter;case 23:return VDt.vFooter;case 24:return VDt.done;default:return VDt.readingHeader}},XDt.prototype._getInflaterStateValue=function(e){switch(e){case VDt.readingHeader:return 0;case VDt.readingBFinal:return 2;case VDt.readingBType:return 3;case VDt.readingNlCodes:return 4;case VDt.readingNdCodes:return 5;case VDt.readingCodes:return 6;case VDt.readingClCodes:return 7;case VDt.readingTcBefore:return 8;case VDt.readingTcAfter:return 9;case VDt.decodeTop:return 10;case VDt.iLength:return 11;case VDt.fLength:return 12;case VDt.dCode:return 13;case VDt.unCompressedAligning:return 15;case VDt.unCompressedByte1:return 16;case VDt.unCompressedByte2:return 17;case VDt.unCompressedByte3:return 18;case VDt.unCompressedByte4:return 19;case VDt.decodeUnCompressedBytes:return 20;case VDt.srFooter:return 21;case VDt.rFooter:return 22;case VDt.vFooter:return 23;case VDt.done:return 24;default:return 0}};var YDt=XDt;function XDt(){this._extraLengthBits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],this._staticDistanceTreeTable=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31],this._lengthBase=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],this._distanceBasePosition=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],this._codeOrder=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],this._bfinal=0,this._bLength=0,this._blBuffer=[0,0,0,0],this._blockType=_Dt.unCompressedType,this._caSize=0,this._clCodeCount=0,this._extraBits=0,this._lengthCode=0,this._length=0,this._llCodeCount=0,this._output=new jDt,this._input=new QDt,this._loopCounter=0,this._codeList=Array(qDt._maxLengthTree+qDt._maxDepthTree).fill(0),this._cltcl=Array(qDt._nCLength).fill(0),this._inflaterState=VDt.readingBFinal}JDt.prototype._read=function(e,t,i){for(var n=t,o=i;;){var r=this._inflater._inflate(e,n,o),s=r.count;if(e=r.data,n+=s,0===(o-=s))break;if(this._inflater._finished)break;r=this._readBytes(),s=r.count;if(this._buffer=r.buffer,0===s)break;this._inflater._setInput(this._buffer,0,s)}return{count:i-o,data:e}},JDt.prototype._readBytes=function(){if(Kkt(this._offset)&&this._offset>=this._data.length)return{buffer:[],count:0};for(var e=0,t=0;t<this._buffer.length&&t+this._offset<this._data.length;t++)this._buffer[Number.parseInt(t.toString(),10)]=this._data[this._offset+t],e++;return this._offset+=e,{buffer:this._buffer,count:e}};var KDt=JDt;function JDt(e,t,i){Kkt(e)?this._data=e:this._data=[],Kkt(i)&&(this._leaveOpen=i),this._offset=t,this._inflater=new YDt,this._buffer=Array(8192).fill(0)}ZDt=function(e,t){return(ZDt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}ZDt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(tMt,$Dt=N$e),tMt.prototype._initialize=function(){for(var e,t=this._hasValidChunkType(void 0);t.hasValidChunk;){switch(e=t.type){case iMt.iHDR:this._readHeader();break;case iMt.iDAT:this._readImageData();break;case iMt.sRGB:this._isRedGreenBlue=!0,this._ignoreChunk();break;case iMt.pLTE:this._readPhotoPlate();break;case iMt.iEND:this._decodeImageData();break;case iMt.tRNS:this._readTransparency();break;case iMt.tEXt:case iMt.iTXt:case iMt.zTXt:case iMt.hIST:case iMt.sBIT:case iMt.iCCP:case iMt.pHYs:case iMt.tIME:case iMt.bKGD:case iMt.gAMA:case iMt.cHRM:case iMt.unknown:this._ignoreChunk()}t=this._hasValidChunkType(e)}},tMt.prototype._hasValidChunkType=function(e){var t;return e=iMt.unknown,this._position+8<=this._stream.byteLength?(this._currentChunkLength=this._readUnsigned32(this._position),this._seek(4),t=this._readString(4),null!=(t=this._getChunkType(t))?{type:e=t,hasValidChunk:!0}:this._stream.byteLength===this._position?{type:e,hasValidChunk:!1}:{type:e,hasValidChunk:!0}):{type:e,hasValidChunk:!1}},tMt.prototype._ignoreChunk=function(){0<this._currentChunkLength&&this._seek(this._currentChunkLength+4)},tMt.prototype._readHeader=function(){this._header=new rMt,this._header._width=this._readUnsigned32(this._position),this._seek(4),this._header._height=this._readUnsigned32(this._position),this._seek(4),this._header._bitDepth=this._readByte(),this._header._colorType=this._readByte(),this._header._compression=this._readByte(),this._header._filter=this._getFilterType(this._readByte()),this._header._interlace=this._readByte(),this._colors=3===this._header._colorType||0==(2&this._header._colorType)?1:3,this._width=this._header._width,this._height=this._header._height,this._bitsPerComponent=this._header._bitDepth,this._setBitsPerPixel(),this._seek(4)},tMt.prototype._setBitsPerPixel=function(){this._bitsPerPixel=16===this._header._bitDepth?2:1,0===this._header._colorType?(this._idatLength=Number.parseInt(((this._bitsPerComponent*this._width+7)/8).toString(),10)*this._height,this._inputBands=1):2===this._header._colorType?(this._idatLength=this._width*this._height*3,this._inputBands=3,this._bitsPerPixel*=3):3===this._header._colorType?(1!==this._header._interlace&&0!==this._header._interlace||(this._idatLength=Number.parseInt(((this._header._bitDepth*this._width+7)/8).toString(),10)*this._height),this._inputBands=1,this._bitsPerPixel=1):4===this._header._colorType?(this._idatLength=this._width*this._height,this._inputBands=2,this._bitsPerPixel*=2):6===this._header._colorType&&(this._idatLength=3*this._width*this._height,this._inputBands=4,this._bitsPerPixel*=4)},tMt.prototype._readImageData=function(){if(this._encodedStream&&0!==this._encodedStream.length||(this._encodedStream=[]),this._currentChunkLength<=this._stream.byteLength&&this._stream.byteLength-this._position>=this._currentChunkLength)for(var e=0;e<this._currentChunkLength;e++)this._encodedStream.push(this._readByte());this._seek(4)},tMt.prototype._readPhotoPlate=function(){var e;3===this._header._colorType?(this._colorSpace=[],this._colorSpace.push(k.get("Indexed")),this._colorSpace.push(this._getPngColorSpace()),this._colorSpace.push(this._currentChunkLength/3-1),e=new Uint8Array(this._currentChunkLength),this._read(e,0,this._currentChunkLength),this._colorSpace.push(CMt(e)),this._seek(4)):this._ignoreChunk()},tMt.prototype._readTransparency=function(){if(3===this._header._colorType){var e=new Uint8Array(this._currentChunkLength);this._read(e,0,this._currentChunkLength),this._seek(4),this._alpha=[];for(var t=0;t<e.length;t++){this._alpha.push(e[Number.parseInt(t.toString(),10)]);var i=255&e[Number.parseInt(t.toString(),10)];0!=i&&255!=i&&(this._shades=!0)}}else this._ignoreChunk()},tMt.prototype._getPngColorSpace=function(){var e,t,i,n,o,r,s,a,l,h,d,p;return this._isRedGreenBlue?(e=[],p=[1,1,1],(t=new mPt).set("Gamma",[2.2,2.2,2.2]),this._isRedGreenBlue&&(n=.64*(i=.2126390058715103)/.33,s=.3*(r=-.0527286/(l=-.0737289))/.6,h=.15*(l=-.005321898/l)/.06,o=i*(.36/.33-1),a=r*(.7/.6-1),d=l*(.85/.06-1),p=[.9504300891509299,1,1.088921671149305],t.set("Matrix",[n,i,o,s,r,a,h,l,d])),t.set("WhitePoint",p),e.push(k.get("CalRGB")),e.push(t),e):0==(2&this._header._colorType)?k.get("DeviceGray"):k.get("DeviceRGB")},tMt.prototype._decodeImageData=function(){var e=this._header;this._isDecode=1===e._interlace||16===e._bitDepth||0!=(4&e._colorType)||this._shades,this._isDecode&&(0==(4&e._colorType)&&!this._shades||(this._maskData=Array(this._width*this._height).fill(0)),this._encodedStream&&(this._dataStream=this._getDeflatedData(this._encodedStream),this._dataStreamOffset=0),0<this._idatLength&&(this._decodedImageData=Array(this._idatLength).fill(0)),this._readDecodeData(),!this._decodedImageData||0!==this._decodedImageData.length||!this._shades)||(this._ideateDecode=!1,this._decodedImageData=this._encodedStream)},tMt.prototype._getDeflatedData=function(e){var e=e.slice(2,e.length-4),t=new KDt(e,0,!0),i=Array(4096).fill(0),n=[];do{for(var o=t._read(i,0,i.length),r=o.count,i=o.data,s=0;s<r;s++)n.push(i[Number.parseInt(s.toString(),10)])}while(0<r);return n},tMt.prototype._readDecodeData=function(){1!==this._header._interlace?this._decodeData(0,0,1,1,this._width,this._height):(this._decodeData(0,0,8,8,Math.floor((this._width+7)/8),Math.floor((this._height+7)/8)),this._decodeData(4,0,8,8,Math.floor((this._width+3)/8),Math.floor((this._height+7)/8)),this._decodeData(0,4,4,8,Math.floor((this._width+3)/4),Math.floor((this._height+3)/8)),this._decodeData(2,0,4,4,Math.floor((this._width+1)/4),Math.floor((this._height+3)/4)),this._decodeData(0,2,2,4,Math.floor((this._width+1)/2),Math.floor((this._height+1)/4)),this._decodeData(1,0,2,2,Math.floor(this._width/2),Math.floor((this._height+1)/2)),this._decodeData(0,1,1,2,this._width,Math.floor(this._height/2)))},tMt.prototype._decodeData=function(e,t,i,n,o,r){if(0!==o&&0!==r)for(var s=Math.floor((this._inputBands*o*this._header._bitDepth+7)/8),a=Array(s).fill(0),l=Array(s).fill(0),h=0,d=t;h<r;h++,d+=n){var p=this._dataStream[this._dataStreamOffset];switch(this._dataStreamOffset=this._dataStreamOffset+1,this._dataStreamOffset=this._readStream(this._dataStream,this._dataStreamOffset,a,s),this._getFilterType(p)){case nMt.none:break;case nMt.sub:this._decompressSub(a,s,this._bitsPerPixel);break;case nMt.up:this._decompressUp(a,l,s);break;case nMt.average:this._decompressAverage(a,l,s,this._bitsPerPixel);break;case nMt.paeth:this._decompressPaeth(a,l,s,this._bitsPerPixel);break;default:throw new Error("Unknown PNG filter")}this._processPixels(a,e,i,d,o);p=l,l=a,a=p}},tMt.prototype._readStream=function(e,t,i,n){n=this._read(i,t,n,e);if(i=n.outputBuffer,t=n.offset,n.length<=0)throw new Error("Insufficient data");return t},tMt.prototype._decompressSub=function(e,t,i){for(var n=i;n<t;n++)e[Number.parseInt(n.toString(),10)]=sMt((255&e[Number.parseInt(n.toString(),10)])+(255&e[n-i]),8)},tMt.prototype._decompressUp=function(e,t,i){for(var n=0;n<i;n++)e[Number.parseInt(n.toString(),10)]=sMt((255&e[Number.parseInt(n.toString(),10)])+(255&t[Number.parseInt(n.toString(),10)]),8)},tMt.prototype._decompressAverage=function(e,t,i,n){for(var o,r,s,a=0;a<n;a++)o=255&e[Number.parseInt(a.toString(),10)],s=255&t[Number.parseInt(a.toString(),10)],e[Number.parseInt(a.toString(),10)]=sMt(Math.floor(o+s/2),8);for(a=n;a<i;a++)o=255&e[Number.parseInt(a.toString(),10)],r=255&e[a-n],s=255&t[Number.parseInt(a.toString(),10)],e[Number.parseInt(a.toString(),10)]=sMt(Math.floor(o+Math.floor((r+s)/2)),8)},tMt.prototype._decompressPaeth=function(e,t,i,n){for(var o,r,s,a,l=0;l<n;l++)o=255&e[Number.parseInt(l.toString(),10)],s=255&t[Number.parseInt(l.toString(),10)],e[Number.parseInt(l.toString(),10)]=sMt(o+s,8);for(l=n;l<i;l++)o=255&e[Number.parseInt(l.toString(),10)],r=255&e[l-n],s=255&t[Number.parseInt(l.toString(),10)],a=255&t[l-n],e[Number.parseInt(l.toString(),10)]=sMt(o+this._paethPredictor(r,s,a),8)},tMt.prototype._paethPredictor=function(e,t,i){var n=e+t-i,o=Math.abs(n-e),r=Math.abs(n-t),n=Math.abs(n-i);return o<=r&&o<=n?e:r<=n?t:i},tMt.prototype._processPixels=function(e,t,i,n,o){var r=0,s=0,a=0,l=this._getPixel(e);if(0===this._header._colorType||3===this._header._colorType||4===this._header._colorType?a=1:2!==this._header._colorType&&6!==this._header._colorType||(a=3),this._decodedImageData&&0<this._decodedImageData.length)for(var s=t,e=16===this._header._bitDepth?8:this._header._bitDepth,h=Math.floor((a*o*e+7)/8),r=0;r<o;r++)this._decodedImageData=this._setPixel(this._decodedImageData,l,this._inputBands*r,a,s,n,this._header._bitDepth,h),s+=i;if(0!=(4&this._header._colorType)||this._shades)if(0!=(4&this._header._colorType)){if(16===this._header._bitDepth)for(var d=0;d<o;++d){var p=d*this._inputBands+a,c=sMt(l[Number.parseInt(p.toString(),10)],32);l[Number.parseInt(p.toString(),10)]=c>>8<<0}h=o;for(s=t,r=0;r<o;r++)this._maskData=this._setPixel(this._maskData,l,this._inputBands*r+a,1,s,n,8,h),s+=i}else{var h=o,u=[0];for(s=t,r=0;r<o;r++){var g=l[Number.parseInt(r.toString(),10)];g<this._alpha.length?u[0]=this._alpha[Number.parseInt(g.toString(),10)]:u[0]=255,this._maskData=this._setPixel(this._maskData,u,0,1,s,n,8,h),s+=i}}},tMt.prototype._getPixel=function(e){if(8===this._header._bitDepth)for(var t=Array(e.length).fill(0),i=0;i<t.length;++i)t[Number.parseInt(i.toString(),10)]=255&e[Number.parseInt(i.toString(),10)];else if(16===this._header._bitDepth)for(t=Array(Math.floor(e.length/2)).fill(0),i=0;i<t.length;++i)t[Number.parseInt(i.toString(),10)]=((255&e[2*i])<<8)+(255&e[2*i+1]);else for(var t=Array(Math.floor(8*e.length/this._header._bitDepth)).fill(0),n=0,o=Math.floor(8/this._header._bitDepth),r=(1<<this._header._bitDepth)-1,s=0;s<e.length;++s)for(i=o-1;0<=i;--i){var a=this._header._bitDepth*i,l=e[Number.parseInt(s.toString(),10)];t[n++]=(a<1?l:sMt(l,32)>>a<<0)&r}return t},tMt.prototype._setPixel=function(e,t,i,n,o,r,s,a){if(8===s)for(var l=a*r+n*o,h=0;h<n;++h)e[l+h]=sMt(t[h+i],8);else if(16===s)for(l=a*r+n*o,h=0;h<n;++h)e[l+h]=sMt(t[h+i]>>8,8);else{l=Math.floor((a*r+o)/(8/s)),a=t[Number.parseInt(i.toString(),10)]<<Number.parseInt((8-s*(o%(8/s))-s).toString(),10);e[Number.parseInt(l.toString(),10)]=e[Number.parseInt(l.toString(),10)]|sMt(a,8)}return e},tMt.prototype._getImageDictionary=function(){this._imageStream=new IPt([],new mPt),this._imageStream.isImageStream=!0;for(var e="",t=0;t<this._decodedImageData.length;t++)e+=String.fromCharCode(this._decodedImageData[Number.parseInt(t.toString(),10)]);this._imageStream.data=[e],this._imageStream._isCompress=this._isDecode&&this._ideateDecode;var i=new mPt;i.set("Type",new k("XObject")),i.set("Subtype",new k("Image")),i.set("Width",this._width),i.set("Height",this._height),16===this._bitsPerComponent?i.set("BitsPerComponent",8):i.set("BitsPerComponent",this._bitsPerComponent),this._isDecode&&this._ideateDecode||i.set("Filter",new k("FlateDecode")),0==(2&this._header._colorType)?i.set("ColorSpace",k.get("DeviceGray")):i.set("ColorSpace",k.get("DeviceRGB")),this._isDecode&&(!this._shades||this._ideateDecode)||i.set("DecodeParms",this._getDecodeParams()),this._imageStream.dictionary=i,this._imageStream.bytes=new Uint8Array(this._imageStream.data[0].length);for(t=0;t<this._imageStream.data[0].length;t++)this._imageStream.bytes[Number.parseInt(t.toString(),10)]=this._imageStream.data[0].charCodeAt(t);return this._imageStream.end=this._imageStream.bytes.length,this._imageStream.dictionary._updated=!0,this._setMask(),this._imageStream},tMt.prototype._setMask=function(){var e;this._maskData&&0<this._maskData.length&&(this._maskStream=new IPt(this._maskData,new mPt),this._maskStream._isCompress=this._isDecode&&this._ideateDecode,(e=new mPt).set("Type",new k("XObject")),e.set("Subtype",new k("Image")),e.set("Width",this._width),e.set("Height",this._height),16===this._bitsPerComponent?e.set("BitsPerComponent",8):e.set("BitsPerComponent",this._bitsPerComponent),e.set("ColorSpace",k.get("DeviceGray")),this._maskStream.dictionary=e,this._maskStream.bytes=new Uint8Array(this._maskData),this._maskStream.end=this._maskStream.bytes.length,this._maskStream.dictionary._updated=!0)},tMt.prototype._getDecodeParams=function(){var e=new mPt;return e.set("Columns",this._width),e.set("Colors",this._colors),e.set("Predictor",15),e.set("BitsPerComponent",this._bitsPerComponent),e},tMt.prototype._getChunkType=function(e){switch(e){case"IHDR":return iMt.iHDR;case"PLTE":return iMt.pLTE;case"IDAT":return iMt.iDAT;case"IEND":return iMt.iEND;case"bKGD":return iMt.bKGD;case"cHRM":return iMt.cHRM;case"gAMA":return iMt.gAMA;case"hIST":return iMt.hIST;case"pHYs":return iMt.pHYs;case"sBIT":return iMt.sBIT;case"tEXt":return iMt.tEXt;case"tIME":return iMt.tIME;case"tRNS":return iMt.tRNS;case"zTXt":return iMt.zTXt;case"sRGB":return iMt.sRGB;case"iCCP":return iMt.iCCP;case"iTXt":return iMt.iTXt;case"Unknown":return iMt.unknown;default:return null}},tMt.prototype._getFilterType=function(e){switch(e){case 1:return nMt.sub;case 2:return nMt.up;case 3:return nMt.average;case 4:return nMt.paeth;default:return nMt.none}};var ZDt,$Dt,eMt=tMt;function tMt(e){var t=$Dt.call(this)||this;return t._stream=e,t._format=c1t.png,t._isRedGreenBlue=!1,t._isDecode=!1,t._shades=!1,t._ideateDecode=!0,t._colors=0,t._bitsPerPixel=0,t._idatLength=0,t._inputBands=0,t._position=8,t._initialize(),t}var iMt,nMt,oMt,rMt=function(){this._width=0,this._height=0,this._colorType=0,this._compression=0,this._bitDepth=0,this._interlace=0,this._filter=nMt.none},ost=((zmt=iMt=iMt||{})[zmt.iHDR=0]="iHDR",zmt[zmt.pLTE=1]="pLTE",zmt[zmt.iDAT=2]="iDAT",zmt[zmt.iEND=3]="iEND",zmt[zmt.bKGD=4]="bKGD",zmt[zmt.cHRM=5]="cHRM",zmt[zmt.gAMA=6]="gAMA",zmt[zmt.hIST=7]="hIST",zmt[zmt.pHYs=8]="pHYs",zmt[zmt.sBIT=9]="sBIT",zmt[zmt.tEXt=10]="tEXt",zmt[zmt.tIME=11]="tIME",zmt[zmt.tRNS=12]="tRNS",zmt[zmt.zTXt=13]="zTXt",zmt[zmt.sRGB=14]="sRGB",zmt[zmt.iCCP=15]="iCCP",zmt[zmt.iTXt=16]="iTXt",zmt[zmt.unknown=17]="unknown",(Qmt=nMt=nMt||{})[Qmt.none=0]="none",Qmt[Qmt.sub=1]="sub",Qmt[Qmt.up=2]="up",Qmt[Qmt.average=3]="average",Qmt[Qmt.paeth=4]="paeth",oMt=function(e,t){return(oMt=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])}))(e,t)},function(e,t){function i(){this.constructor=e}oMt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});function sMt(e,t){return e&Math.pow(2,t)-1}function aMt(e){return e<<16>>16}function lMt(e){return e<<0}function hMt(e,t,i,n,o){null==n&&(n=0),o=void 0===o?i.length:o,n=Math.max(0,Math.min(i.length,n)),t+((o=Math.max(0,Math.min(i.length,o)))-n)>e.length&&(e.length=t+(o-n));for(var r=n,s=t;r<o;r++,s++)e[Number.parseInt(s.toString(),10)]=i[Number.parseInt(r.toString(),10)]}function dMt(e,t){for(var i=0;i<t.length;i++)if(t[Number.parseInt(i.toString(),10)]!==e[Number.parseInt(i.toString(),10)])return!1;return!0}function pMt(e){var t;if(dMt(e,[255,216]))t=new HDt(e);else{if(!dMt(e,[137,80,78,71,13,10,26,10]))throw new Error("Unsupported image format");t=new eMt(e)}return t}function cMt(e,t,i){var n=0;return i=null==i?0:i,e.rotation===TAt.angle90?n=null==t?0:i:e.rotation===TAt.angle180?n=null==t?0:t:e.rotation===TAt.angle270&&(e=e.size,n=null==t?0:e[0]-i),n}function uMt(e,t){for(var i=-1,n=0;n<e.pageCount;n++){var o=e.getPage(n);if(o._pageDictionary===t||o._pageDictionary.objId===t.objId){i=n;break}}return i}function gMt(e){var t=[];return 0!=(e&bAt.hidden)&&t.push("hidden"),0!=(e&bAt.invisible)&&t.push("invisible"),0!=(e&bAt.locked)&&t.push("locked"),0!=(e&bAt.noRotate)&&t.push("norotate"),0!=(e&bAt.noView)&&t.push("noview"),0!=(e&bAt.noZoom)&&t.push("nozoom"),0!=(e&bAt.print)&&t.push("print"),0!=(e&bAt.readOnly)&&t.push("readonly"),0!=(e&bAt.toggleNoView)&&t.push("togglenoview"),0!=(e&bAt.default)&&t.push("default"),t.join(",")}function mMt(e){switch(e){case"hidden":return bAt.hidden;case"invisible":return bAt.invisible;case"locked":return bAt.locked;case"norotate":return bAt.noRotate;case"noview":return bAt.noView;case"nozoom":return bAt.noZoom;case"print":return bAt.print;case"readonly":return bAt.readOnly;case"togglenoview":return bAt.toggleNoView;default:return bAt.default}}function fMt(e){if("string"==typeof e&&0<e.length&&e.charCodeAt(0)>="ï".charCodeAt(0)){var t=void 0;if("ï"===e[0]&&"»"===e[1]&&"¿"===e[2]?t="utf-8":"ÿ"===e[0]&&"þ"===e[1]?t="utf-16le":"þ"===e[0]&&"ÿ"===e[1]&&(t="utf-16be"),t)try{return new TextDecoder(t,{fatal:!0}).decode(yMt(e))}catch(e){}}for(var i=[],n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364],o=0;o<e.length;o++){var r=n[e.charCodeAt(o)];i.push(r?String.fromCharCode(r):e.charAt(o))}return i.join("")}function yMt(e,t,i,n){void 0===t&&(t=!1);var o=n?n:[];if(i=void 0===i?!1:i)for(var r=0;r<e.length;r++)o.push(e.charCodeAt(r));else for(r=0;r<e.length;r++){var s=e.charCodeAt(r);s<128?o.push(s):(s<2048?o.push(s>>6|192):(s<55296||57344<=s?o.push(s>>12|224):(r++,s=65536+((1023&s)<<10|1023&e.charCodeAt(r)),o.push(s>>18|240),o.push(s>>12&63|128)),o.push(s>>6&63|128)),o.push(63&s|128))}return t?o:new Uint8Array(o)}function vMt(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(e[Number.parseInt(i.toString(),10)]!==t[Number.parseInt(i.toString(),10)])return!1;return!0}function bMt(e){return Number.isInteger(e)?e.toString():e.toFixed(7)}function wMt(e,t){var i=!1;if(e.length!==t.length)return!0;for(var n=0;n<e.length;n++)if(e[n]!==t[n]){i=!0;break}return i}function CMt(e,t){void 0===t&&(t=!1);var i=e.length,n=[];if(i<8192)return t?SMt(e):String.fromCharCode.apply(null,e);for(var o=0;o<i;o+=8192){var r=Math.min(o+8192,i),r=e.subarray(o,r);n.push(t?SMt(r):String.fromCharCode.apply(null,r))}return n.join("")}function SMt(e){for(var t="",i=0;i<e.length;){var n=e[i++];n<128?t+=String.fromCharCode(n):n<224?t+=String.fromCharCode((31&n)<<6|63&e[i++]):n<240?t+=String.fromCharCode((15&n)<<12|(63&e[i++])<<6|63&e[i++]):(n=(7&n)<<18|(63&e[i++])<<12|(63&e[i++])<<6|(63&e[i++])-65536,t+=String.fromCharCode(55296+(n>>10),56320+(1023&n)))}return t}function AMt(e){var t=[];if(null!=e)for(var i=0;i<e.length;i++){var n=e.charCodeAt(i);t.push(n/256>>>0),t.push(255&n)}return new Uint8Array(t)}function xMt(e){for(var t,i=[],n=0;n<e.length;n++)(t=e[Number.parseInt(n.toString(),10)].toString(16).toUpperCase()).length<2&&(t="0"+t),i.push(t);return i.join("")}function IMt(e,t){void 0===t&&(t=!1);var i=[];if(e)for(var n=0;n<e.length;n+=2)i.push(Number.parseInt(e.substring(n,n+2),16));return t?i:new Uint8Array(i)}function TMt(e){var t="";if(e&&"#"===e[0]){e=e.substring(1);for(var i=0;i<e.length;i+=2)t+=String.fromCharCode(Number.parseInt(e.substring(i,i+2),16));return t}return e}function EMt(e){return 32===e||9===e||13===e||10===e}function DMt(e,t){void 0===t&&(t=!1);if(3e6<=e.length){e=e.replace(/[^A-Za-z0-9+/=]/g,"");for(var i=[],n=0,o=0;o<e.length;o+=3e6){var r=function(e){for(var t,i,n,o,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,a=0,l=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4,h=(e.charAt(e.length-1)===r.charAt(64)&&l--,new Array(0|l));s<e.length;)i=r.indexOf(e.charAt(s++)),t=(15&(n=r.indexOf(e.charAt(s++))))<<4|(o=r.indexOf(e.charAt(s++)))>>2,o=(3&o)<<6|r.indexOf(e.charAt(s++)),a<l&&(h[a++]=i<<2|n>>4),a<l&&(h[a++]=t),a<l&&(h[a++]=o);return new Uint8Array(h)}(d=e.substring(o,o+3e6));i.push(r),n+=r.length}for(var s=new Uint8Array(n),a=0,l=0,h=i;l<h.length;l++){var d=h[l];s.set(d,a),a+=d.length}return t?Array.from(s):s}for(var p,c,u,g,m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=0,f=0,n=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4,s=(e.charAt(e.length-1)===m.charAt(64)&&n--,new Array(0|n));o<e.length;)c=m.indexOf(e.charAt(o++)),p=(15&(u=m.indexOf(e.charAt(o++))))<<4|(g=m.indexOf(e.charAt(o++)))>>2,g=(3&g)<<6|m.indexOf(e.charAt(o++)),f<n&&(s[f++]=c<<2|u>>4),f<n&&(s[f++]=p),f<n&&(s[f++]=g);return t?s:new Uint8Array(s)}function MMt(e,t){void 0===t&&(t=!1);for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=[],o=e.length,r=0;r<o;){var s=e[r++],a=r<o?e[r++]:0,l=r<o?e[r++]:0,h=s>>2,s=(3&s)<<4|a>>4,a=(15&a)<<2|l>>6,l=63&l;n.push(i[Number.parseInt(h.toString(),10)],i[Number.parseInt(s.toString(),10)],o<r-1?"=":i[Number.parseInt(a.toString(),10)],o<r?"=":i[Number.parseInt(l.toString(),10)])}return t&&(o%3==1?(n[n.length-1]="=",n[n.length-2]="="):o%3==2&&(n[n.length-1]="=")),n.join("")}function kMt(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=e.length;if(3e6<=i){var n=[];if(3e6<i)for(var o=0;o<i;o+=3e6){var r=e.subarray(o,Math.min(o+3e6,i));i<=o+3e6?n.push(MMt(r,!0)):n.push(MMt(r))}else n.push(MMt(e,!0));return n.join("")}for(var n="",s=0,a=0;a<e.length;a++)a%3==0?(s=e[Number.parseInt(a.toString(),10)]>>2,n+=t[Number.parseInt(s.toString(),10)],s=e[Number.parseInt(a.toString(),10)]<<4&63):a%3==1?(s+=e[Number.parseInt(a.toString(),10)]>>4,n+=t[Number.parseInt(s.toString(),10)],s=e[Number.parseInt(a.toString(),10)]<<2&63):a%3==2&&(s+=e[Number.parseInt(a.toString(),10)]>>6,n+=t[Number.parseInt(s.toString(),10)],s=63&e[Number.parseInt(a.toString(),10)],n+=t[Number.parseInt(s.toString(),10)]);return e.length%3==1&&(n+=t[Number.parseInt(s.toString(),10)]+"=="),e.length%3==2&&(n+=t[Number.parseInt(s.toString(),10)]+"="),n}function PMt(e,t,i,n){void 0===i&&(i=!1),void 0===n&&(n=!0);for(var o,r=[],s=4;s<arguments.length;s++)r[s-4]=arguments[s];for(var a=new Set;e instanceof mPt&&e.objId&&!a.has(e.objId);){e.objId&&a.add(e.objId);var l=i?e.getArray(t):e.get(t);if(void 0!==l){if(n)return l;(o=o||[]).push(l)}for(var h=0,d=!1;h<r.length;){var p=r[h];if(e.has(p)){e=e.get(p),d=!0;break}h++}if(!d)break}return o}function BMt(e,t){var i,n,o,r,s={x:0,y:0,width:0,height:0},e=e.getArray("Rect");return e&&Array.isArray(e)&&(i=e[0],n=e[1],o=e[2],r=e[3],void 0!==i)&&void 0!==n&&void 0!==o&&void 0!==r&&(s.x=Math.min(i,o),s.y=Math.min(n,r),s.width=Math.max(i,o)-s.x,s.height=Math.max(n,r)-s.y,t)&&(s.height=parseFloat(s.height.toFixed(3)),e[1]<0)&&(s.y=e[1],e[1]>e[3])&&(s.y-=s.height),s}function FMt(e,t){var i,n,o;return e.has("Rect")&&(o=BMt(e),t?(e=t.size,i=t.mediaBox,(n=t.cropBox)&&Array.isArray(n)&&4===n.length&&t._pageDictionary.has("CropBox")?0===n[0]&&0===n[1]&&e[0]!==n[2]&&e[1]!==n[3]||o.x===n[0]?o.y=e[1]-(o.y+o.height):(o.x-=n[0],o.y=n[3]-(o.y+o.height)):i&&Array.isArray(i)&&4===i.length&&t._pageDictionary.has("MediaBox")&&(0<i[0]||0<i[1]||e[0]===i[2]||e[1]===i[3])?(o.x-=i[0],o.y=i[3]-(o.y+o.height)):o.y=e[1]-(o.y+o.height)):o.y=o.y+o.height),o}function LMt(e){return{x:Math.min(e[0],e[2]),y:Math.min(e[1],e[3]),width:Math.abs(e[0]-e[2]),height:Math.abs(e[1]-e[3])}}function RMt(e){return[e.x,e.y,e.x+e.width,e.y+e.height]}function OMt(e,t){var i,n,o,r=e[0],s=e[1],a=e[2],e=e[3];return t&&(i=(n=t.size)[0],n=n[1],o=t.mediaBox,s=(t=t.cropBox)&&Array.isArray(t)&&4===t.length?0!==t[0]||0!==t[1]||i===t[2]||n===t[3]?(r+=t[0],t[3]-(s+e)):n-(s+e):o&&Array.isArray(o)&&4===o.length&&(0<o[0]||0<o[1]||i===o[2]||n===o[3])?(r-=o[0],o[3]-(s+e)):n-(s+e)),[r,s,r+a,s+e]}function NMt(e){var t=ikt(e);return t||(e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e))&&(t=[Number.parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]),t}function VMt(e){var t,i,n,o;return e&&(1===e.length?void 0!==(i=e[0])&&(t=[i=Math.round(255*i),i,i]):3===e.length?(i=e[0],n=e[1],o=e[2],void 0!==i&&void 0!==n&&void 0!==o&&(t=[Math.round(255*i),Math.round(255*n),Math.round(255*o)])):4===e.length&&(i=e[0],n=e[1],o=e[2],e=e[3],void 0!==i)&&void 0!==n&&void 0!==o&&void 0!==e&&(e=255*e,t=[Math.round(255-Math.min(255,i*(255-e)+e)),Math.round(255-Math.min(255,n*(255-e)+e)),Math.round(255-Math.min(255,o*(255-e)+e))])),t}function _Mt(e){var t="S";switch(e){case xAt.dot:case xAt.dashed:t="D";break;case xAt.beveled:t="B";break;case xAt.inset:t="I";break;case xAt.underline:t="U"}return k.get(t)}function HMt(e){var t=IAt.solid;return t="C"===e?IAt.cloudy:t}function zMt(e){var t="None";if(void 0!==e)switch(e){case wAt.openArrow:t="OpenArrow";break;case wAt.closedArrow:t="ClosedArrow";break;case wAt.rOpenArrow:t="ROpenArrow";break;case wAt.rClosedArrow:t="RClosedArrow";break;case wAt.butt:t="Butt";break;case wAt.diamond:t="Diamond";break;case wAt.circle:t="Circle";break;case wAt.square:t="Square";break;case wAt.slash:t="Slash"}return t}function jMt(e,t){var i=void 0!==t?t:wAt.none;switch(e.toLowerCase()){case"openarrow":i=wAt.openArrow;break;case"closedarrow":i=wAt.closedArrow;break;case"ropenarrow":i=wAt.rOpenArrow;break;case"rclosedarrow":i=wAt.rClosedArrow;break;case"butt":i=wAt.butt;break;case"diamond":i=wAt.diamond;break;case"circle":i=wAt.circle;break;case"square":i=wAt.square;break;case"slash":i=wAt.slash}return i}function WMt(e){switch(e){case"P":return DAt.push;case"N":return DAt.noHighlighting;case"O":return DAt.outline;default:return DAt.invert}}function QMt(e){switch(e){case DAt.push:return k.get("P");case DAt.noHighlighting:return k.get("N");case DAt.outline:return k.get("O");default:return k.get("I")}}function UMt(e){var t="Normal";switch(e){case $At.multiply:t="Multiply";break;case $At.screen:t="Screen";break;case $At.overlay:t="Overlay";break;case $At.darken:t="Darken";break;case $At.lighten:t="Lighten";break;case $At.colorDodge:t="ColorDodge";break;case $At.colorBurn:t="ColorBurn";break;case $At.hardLight:t="HardLight";break;case $At.softLight:t="SoftLight";break;case $At.difference:t="Difference";break;case $At.exclusion:t="Exclusion";break;case $At.hue:t="Hue";break;case $At.saturation:t="Saturation";break;case $At.color:t="Color";break;case $At.luminosity:t="Luminosity";break;default:t="Normal"}return k.get(t)}function qMt(e){var t=$At.normal;switch(e.name){case"Multiply":t=$At.multiply;break;case"Screen":t=$At.screen;break;case"Overlay":t=$At.overlay;break;case"Darken":t=$At.darken;break;case"Lighten":t=$At.lighten;break;case"ColorDodge":t=$At.colorDodge;break;case"ColorBurn":t=$At.colorBurn;break;case"HardLight":t=$At.hardLight;break;case"SoftLight":t=$At.softLight;break;case"Difference":t=$At.difference;break;case"Exclusion":t=$At.exclusion;break;case"Hue":t=$At.hue;break;case"Saturation":t=$At.saturation;break;case"Color":t=$At.color;break;case"Luminosity":t=$At.luminosity;break;default:t=$At.normal}return t}function GMt(e){e=e.toFixed(2);return e="0.00"===e?".00":e}function YMt(e,t){var i,e=k.get(e);t.has("ProcSet")?(i=t.getArray("ProcSet"))&&-1===i.indexOf(e)&&(i.push(e),t.update("ProcSet",i)):t.update("ProcSet",[e])}function XMt(){return"aaaaaaaa-aaaa-4aaa-baaa-aaaaaaaaaaaa".replace(/[ab]/g,function(e){var t=16*Math.random()|0;return("a"===e?t:3&t|8).toString(16)})}function KMt(e){for(var t=[],i=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);(o<33||126<o||35===o||40===o||41===o||60===o||62===o||91===o||93===o||123===o||125===o||47===o||37===o)&&(i<n&&t.push(e.substring(i,n)),t.push("#"+o.toString(16)),i=n+1)}return 0===t.length?e:(i<e.length&&t.push(e.substring(i,e.length)),t.join(""))}function JMt(e,t,i,n,o,r){i<e&&(c=e,e=i,i=c),t<n&&(c=t,t=n,n=c),Math.abs(r)<=90?(s=r,a=1):s=r/(a=Math.ceil(Math.abs(r)/90));for(var s,a,l=(e+i)/2,h=(t+n)/2,d=(i-e)/2,p=(n-t)/2,c=s*(Math.PI/360),u=Math.abs(4/3*(1-Math.cos(c))/Math.sin(c)),g=[],m=0;m<a;m++){var f=(o+m*s)*(Math.PI/180),y=(o+(m+1)*s)*(Math.PI/180),v=Math.cos(f),b=Math.cos(y),f=Math.sin(f),y=Math.sin(y);0<s?(g.push(l+d*v),g.push(h-p*f),g.push(l+d*(v-u*f)),g.push(h-p*(f+u*v)),g.push(l+d*(b+u*y)),g.push(h-p*(y-u*b))):(g.push(l+d*v),g.push(h-p*f),g.push(l+d*(v+u*f)),g.push(h-p*(f-u*v)),g.push(l+d*(b-u*y)),g.push(h-p*(y+u*b))),g.push(l+d*b),g.push(h-p*y)}return g}function ZMt(e,t){for(var i,n=0;n<e.pageCount&&void 0===i;n++){var o=e.getPage(n);if(o&&o._pageDictionary.has("Annots")){var r=o._pageDictionary.get("Annots");if(null!=r&&0<r.length)for(var s=0;s<r.length&&void 0===i;s++){var a=r[Number.parseInt(s.toString(),10)];null!=a&&a instanceof aPt&&a===t&&(i=o)}}}return i}function $Mt(e){var t,i=!1;return e.has("AS")&&((t=e.get("AS"))?i="Off"!==t.name:(t=e.get("V"))&&(i=t.name===ekt(e))),i}function ekt(e){var t="";if(""===(t=e.has("AS")&&null!==(i=e.get("AS"))&&"Off"!==i.name?i.name:t)&&e.has("AP")){var i=e.get("AP");if(i&&i.has("N")){e=i.get("N");if((e=e instanceof SPt?e.dictionary:e)&&e instanceof mPt){var n=[];e.forEach(function(e,t){n.push(e)});for(var o=0;o<n.length;o++)if("Off"!==n[Number.parseInt(o.toString(),10)]){t=n[Number.parseInt(o.toString(),10)];break}}}}return t}function tkt(e,t){var i,n,o,e=e===YAt.checked?ekt(t._dictionary):"Off";return i=t._dictionary.has("AP")&&(o=t._dictionary.get("AP"))&&o.has("N")&&(o=(o=o.get("N"))&&o instanceof SPt?o.dictionary:o)&&o instanceof mPt&&e&&""!==e&&o.has(e)&&(n=o.get(e),(o=o.getRaw(e))&&(n.reference=o),n)?new _It(n,t._crossReference):i}function ikt(e){var t;switch(e){case"transparent":t=[255,255,255];break;case"aliceblue":t=[240,248,255];break;case"antiquewhite":t=[250,235,215];break;case"aqua":t=[0,255,255];break;case"aquamarine":t=[127,255,212];break;case"azure":t=[240,255,255];break;case"beige":t=[245,245,220];break;case"bisque":t=[255,228,196];break;case"black":t=[0,0,0];break;case"blanchedalmond":t=[255,235,205];break;case"blue":t=[0,0,255];break;case"blueviolet":t=[138,43,226];break;case"brown":t=[165,42,42];break;case"burlywood":t=[222,184,135];break;case"cadetBlue":t=[95,158,160];break;case"chartreuse":t=[127,255,0];break;case"chocolate":t=[210,105,30];break;case"coral":t=[255,127,80];break;case"cornflowerblue":t=[100,149,237];break;case"cornsilk":t=[255,248,220];break;case"crimson":t=[220,20,60];break;case"cyan":t=[0,255,255];break;case"darkblue":t=[0,0,139];break;case"darkcyan":t=[0,139,139];break;case"darkgoldenrod":t=[184,134,11];break;case"darkgray":t=[169,169,169];break;case"darkgreen":t=[0,100,0];break;case"darkkhaki":t=[189,183,107];break;case"darkmagenta":t=[139,0,139];break;case"darkolivegreen":t=[85,107,47];break;case"darkorange":t=[255,140,0];break;case"darkorchid":t=[153,50,204];break;case"darkred":t=[139,0,0];break;case"darksalmon":t=[233,150,122];break;case"darkseagreen":t=[143,188,139];break;case"darkslateblue":t=[72,61,139];break;case"darkslategray":t=[47,79,79];break;case"darkturquoise":t=[0,206,209];break;case"darkviolet":t=[148,0,211];break;case"deeppink":t=[255,20,147];break;case"deepskyblue":t=[0,191,255];break;case"dimgray":t=[105,105,105];break;case"dodgerblue":t=[30,144,255];break;case"firebrick":t=[178,34,34];break;case"floralwhite":t=[255,250,240];break;case"forestgreen":t=[34,139,34];break;case"fuchsia":t=[255,0,255];break;case"gainsboro":t=[220,220,220];break;case"ghostwhite":t=[248,248,255];break;case"gold":t=[255,215,0];break;case"goldenrod":t=[218,165,32];break;case"gray":t=[128,128,128];break;case"green":t=[0,128,0];break;case"greenyellow":t=[173,255,47];break;case"honeydew":t=[240,255,240];break;case"hotpink":t=[255,105,180];break;case"indianred":t=[205,92,92];break;case"indigo":t=[75,0,130];break;case"ivory":t=[255,255,240];break;case"khaki":t=[240,230,140];break;case"lavender":t=[230,230,250];break;case"lavenderblush":t=[255,240,245];break;case"lawngreen":t=[124,252,0];break;case"lemonchiffon":t=[255,250,205];break;case"lightblue":t=[173,216,230];break;case"lightcoral":t=[240,128,128];break;case"lightcyan":t=[224,255,255];break;case"lightgoldenrodyellow":t=[250,250,210];break;case"lightgreen":t=[144,238,144];break;case"lightgray":t=[211,211,211];break;case"LightPink":t=[255,182,193];break;case"lightsalmon":t=[255,160,122];break;case"lightseagreen":t=[32,178,170];break;case"lightskyblue":t=[135,206,250];break;case"lightslategray":t=[119,136,153];break;case"lightsteelblue":t=[176,196,222];break;case"lightyellow":t=[255,255,224];break;case"lime":t=[0,255,0];break;case"limeGreen":t=[50,205,50];break;case"linen":t=[250,240,230];break;case"magenta":t=[255,0,255];break;case"maroon":t=[128,0,0];break;case"mediumaquamarine":t=[102,205,170];break;case"mediumblue":t=[0,0,205];break;case"mediumorchid":t=[186,85,211];break;case"mediumpurple":t=[147,112,219];break;case"mediumseagreen":t=[60,179,113];break;case"mediumslateblue":t=[123,104,238];break;case"mediumspringgreen":t=[0,250,154];break;case"mediumturquoise":t=[72,209,204];break;case"mediumvioletred":t=[199,21,133];break;case"midnightblue":t=[25,25,112];break;case"mintcream":t=[245,255,250];break;case"mistyrose":t=[255,228,225];break;case"moccasin":t=[255,228,181];break;case"navajowhite":t=[255,222,173];break;case"navy":t=[0,0,128];break;case"oldLace":t=[253,245,230];break;case"olive":t=[128,128,0];break;case"olivedrab":t=[107,142,35];break;case"orange":t=[255,165,0];break;case"orangered":t=[255,69,0];break;case"orchid":t=[218,112,214];break;case"palegoldenrod":t=[238,232,170];break;case"palegreen":t=[152,251,152];break;case"paleturquoise":t=[175,238,238];break;case"palebioletred":t=[219,112,147];break;case"papayawhip":t=[255,239,213];break;case"peachpuff":t=[255,218,185];break;case"peru":t=[205,133,63];break;case"pink":t=[255,192,203];break;case"plum":t=[221,160,221];break;case"powderblue":t=[176,224,230];break;case"purple":t=[128,0,128];break;case"red":t=[255,0,0];break;case"rosybrown":t=[188,143,143];break;case"royalblue":t=[65,105,225];break;case"saddlebrown":t=[139,69,19];break;case"salmon":t=[250,128,114];break;case"sandybrown":t=[244,164,96];break;case"seagreen":t=[46,139,87];break;case"seashell":t=[255,245,238];break;case"sienna":t=[160,82,45];break;case"silver":t=[192,192,192];break;case"skyblue":t=[135,206,235];break;case"slateblue":t=[106,90,205];break;case"slategray":t=[112,128,144];break;case"snow":t=[255,250,250];break;case"springgreen":t=[0,255,127];break;case"steelblue":t=[70,130,180];break;case"tan":t=[210,180,140];break;case"teal":t=[0,128,128];break;case"thistle":t=[216,191,216];break;case"tomato":t=[255,99,71];break;case"turquoise":t=[64,224,208];break;case"violet":t=[238,130,238];break;case"wheat":t=[245,222,179];break;case"white":t=[255,255,255];break;case"whitesmoke":t=[245,245,245];break;case"yellow":t=[255,255,0];break;case"yellowgreen":t=[154,205,50]}return t}function nkt(e,t){var i,n=e._content.dictionary.getArray("BBox");n&&null!=t&&(0===t?e._content.dictionary.set("Matrix",[1,0,0,1,-n[0],-n[1]]):(i=new hIt,90===t?i._translate(n[3],-n[0]):180===t?i._translate(n[2],n[3]):270===t&&i._translate(-n[1],n[2]),i._rotate(t),e._content.dictionary.set("Matrix",i._matrix._elements)))}function okt(e){var t="4";switch(e){case LAt.circle:t="l";break;case LAt.cross:t="8";break;case LAt.diamond:t="u";break;case LAt.square:t="n";break;case LAt.star:t="H"}return t}function rkt(e){var t=LAt.check;switch(e){case"l":t=LAt.circle;break;case"8":t=LAt.cross;break;case"u":t=LAt.diamond;break;case"n":t=LAt.square;break;case"H":t=LAt.star}return t}function skt(e){var t;switch(e){case"cm":t=PAt.centimeter;break;case"in":t=PAt.inch;break;case"mm":t=PAt.millimeter;break;case"p":t=PAt.pica;break;case"pt":t=PAt.point;break;default:t=PAt.centimeter}return t}function akt(e){var t;switch(e){case"Highlight":t=RAt.highlight;break;case"Squiggly":t=RAt.squiggly;break;case"StrikeOut":t=RAt.strikeOut;break;case"Underline":t=RAt.underline;break;default:t=RAt.highlight}return t}function lkt(e){var t="Highlight";switch(e){case RAt.highlight:t="Highlight";break;case RAt.squiggly:t="Squiggly";break;case RAt.strikeOut:t="StrikeOut";break;case RAt.underline:t="Underline";break;default:t="Highlight"}return t}function hkt(e){var t;switch(e){case"cm":t=UAt.centimeter;break;case"in":t=UAt.inch;break;case"mm":t=UAt.millimeter;break;case"p":t=UAt.pica;break;case"pt":t=UAt.point;break;default:t=UAt.centimeter}return t}function dkt(e){var t;switch(e){case"#Approved":case"SBApproved":t=FAt.approved;break;case"#AsIs":case"SBAsIs":t=FAt.asIs;break;case"#Completed":case"SBCompleted":t=FAt.completed;break;case"#Confidential":case"SBConfidential":t=FAt.confidential;break;case"#Departmental":case"SBDepartmental":t=FAt.departmental;break;case"#Draft":case"SBDraft":t=FAt.draft;break;case"#Experimental":case"SBExperimental":t=FAt.experimental;break;case"#Expired":case"SBExpired":t=FAt.expired;break;case"#Final":case"SBFinal":t=FAt.final;break;case"#ForComment":case"SBForComment":t=FAt.forComment;break;case"#ForPublicRelease":case"SBForPublicRelease":t=FAt.forPublicRelease;break;case"#InformationOnly":case"SBInformationOnly":t=FAt.informationOnly;break;case"#NotApproved":case"SBNotApproved":t=FAt.notApproved;break;case"#NotForPublicRelease":case"SBNotForPublicRelease":t=FAt.notForPublicRelease;break;case"#PreliminaryResults":case"SBPreliminaryResults":t=FAt.preliminaryResults;break;case"#Sold":case"SBSold":t=FAt.sold;break;case"#TopSecret":case"SBTopSecret":t=FAt.topSecret;break;case"#Void":case"SBVoid":t=FAt.void;break;default:t=FAt.draft}return t}function pkt(e){var t;switch(e){case"Note":t=OAt.note;break;case"Comment":t=OAt.comment;break;case"Help":t=OAt.help;break;case"Insert":t=OAt.insert;break;case"Key":t=OAt.key;break;case"NewParagraph":t=OAt.newParagraph;break;case"Paragraph":t=OAt.paragraph;break;default:t=OAt.note}return t}function ckt(e){var t="None";switch(e){case NAt.none:t="None";break;case NAt.accepted:t="Accepted";break;case NAt.rejected:t="Rejected";break;case NAt.cancel:t="Cancelled";break;case NAt.completed:t="Completed";break;case NAt.marked:t="Marked";break;case NAt.unmarked:t="Unmarked";break;case NAt.unknown:t="Unknown";break;default:t="None"}return t}function ukt(e){var t=NAt.none;switch(e){case"None":t=NAt.none;break;case"Accepted":t=NAt.accepted;break;case"Rejected":t=NAt.rejected;break;case"Cancelled":t=NAt.cancel;break;case"Completed":t=NAt.completed;break;case"Marked":t=NAt.marked;break;case"Unmarked":t=NAt.unmarked;break;case"Unknown":t=NAt.unknown}return t}function gkt(e){var t="None";switch(e){case VAt.none:t="None";break;case VAt.marked:t="Marked";break;case VAt.review:t="Review";break;default:t="None"}return t}function mkt(e){var t=VAt.none;switch(e){case"None":t=VAt.none;break;case"Marked":t=VAt.marked;break;case"Review":t=VAt.review}return t}function fkt(e){var t;switch(e){case"PushPin":t=_At.pushPin;break;case"Tag":t=_At.tag;break;case"Graph":t=_At.graph;break;case"Paperclip":t=_At.paperClip;break;default:t=_At.pushPin}return t}function ykt(e){var t;switch(e){case"None":t=HAt.none;break;case"FreeTextCallout":t=HAt.freeTextCallout;break;case"FreeTextTypeWriter":t=HAt.freeTextTypeWriter;break;default:t=HAt.none}return t}function vkt(e){var t=[];return 0<(e&Jxt.bold)&&t.push("Bold"),0<(e&Jxt.italic)&&t.push("Italic"),0<(e&Jxt.underline)&&t.push("Underline"),0<(e&Jxt.strikeout)&&t.push("Strikeout"),0===t.length?"Regular":t.join(", ")}function bkt(e){var t;switch(e){case"head2right":t="➢";break;case"aacute":t="á";break;case"eacute":t="é";break;case"iacute":t="í";break;case"oacute":t="ó";break;case"uacute":t="ú";break;case"circleright":t="➲";break;case"bleft":t="⇦";break;case"bright":t="⇨";break;case"bup":t="⇧";break;case"bdown":t="⇩";break;case"barb4right":t="➔";break;case"bleftright":t="⬄";break;case"bupdown":t="⇳";break;case"bnw":t="⬀";break;case"bne":t="⬁";break;case"bsw":t="⬃";break;case"bse":t="⬂";break;case"bdash1":t="▭";break;case"bdash2":t="▫";break;case"xmarkbld":t="✗";break;case"checkbld":t="✓";break;case"boxxmarkbld":t="☒";break;case"boxcheckbld":t="☑";break;case"space":t=" ";break;case"pencil":t="✏";break;case"scissors":t="✂";break;case"scissorscutting":case"readingglasses":case"bell":case"book":case"telephonesolid":case"telhandsetcirc":case"envelopeback":t="✁";break;case"hourglass":t="⌛";break;case"keyboard":t="⌨";break;case"tapereel":t="✇";break;case"handwrite":t="✍";break;case"handv":t="✌";break;case"handptleft":t="☜";break;case"handptright":t="☞";break;case"handptup":t="☝";break;case"handptdown":t="☟";break;case"smileface":t="☺";break;case"frownface":t="☹";break;case"skullcrossbones":t="☠";break;case"flag":t="⚐";break;case"pennant":t="Ὢ9";break;case"airplane":t="✈";break;case"sunshine":t="☼";break;case"droplet":t="Ὂ7";break;case"snowflake":t="❄";break;case"crossshadow":t="✞";break;case"crossmaltese":t="✠";break;case"starofdavid":t="✡";break;case"crescentstar":t="☪";break;case"yinyang":t="☯";break;case"om":t="ॐ";break;case"wheel":t="☸";break;case"aries":t="♈";break;case"taurus":t="♉";break;case"gemini":t="♊";break;case"cancer":t="♋";break;case"leo":t="♌";break;case"virgo":t="♍";break;case"libra":t="♎";break;case"scorpio":t="♏";break;case"saggitarius":t="♐";break;case"capricorn":t="♑";break;case"aquarius":t="♒";break;case"pisces":t="♓";break;case"ampersanditlc":case"ampersandit":t="&";break;case"circle6":t="●";break;case"circleshadowdwn":t="❍";break;case"square6":t="■";break;case"box3":t="□";break;case"boxshadowdwn":t="❑";break;case"boxshadowup":t="❒";break;case"lozenge4":t="⬧";break;case"lozenge6":t="⧫";break;case"rhombus6":t="◆";break;case"xrhombus":t="❖";break;case"rhombus4":t="⬥";break;case"clear":t="⌧";break;case"escape":t="⍓";break;case"command":t="⌘";break;case"rosette":t="❀";break;case"rosettesolid":t="✿";break;case"quotedbllftbld":t="❝";break;case"quotedblrtbld":t="❞";break;case".notdef":t="▯";break;case"zerosans":t="⓪";break;case"onesans":t="①";break;case"twosans":t="②";break;case"threesans":t="③";break;case"foursans":t="④";break;case"fivesans":t="⑤";break;case"sixsans":t="⑥";break;case"sevensans":t="⑦";break;case"eightsans":t="⑧";break;case"ninesans":t="⑨";break;case"tensans":t="⑩";break;case"zerosansinv":t="⓿";break;case"onesansinv":t="❶";break;case"twosansinv":t="❷";break;case"threesansinv":t="❸";break;case"foursansinv":t="❹";break;case"circle2":t="·";break;case"circle4":t="•";break;case"square2":t="▪";break;case"ring2":t="○";break;case"ringbutton2":t="◉";break;case"target":t="◎";break;case"square4":t="▪";break;case"box2":t="◻";break;case"crosstar2":t="✦";break;case"pentastar2":t="★";break;case"hexstar2":t="✶";break;case"octastar2":t="✴";break;case"dodecastar3":t="✹";break;case"octastar4":t="✵";break;case"registercircle":t="⌖";break;case"cuspopen":t="⟡";break;case"cuspopen1":t="⌑";break;case"circlestar":t="★";break;case"starshadow":t="✰";break;case"deleteleft":t="⌫";break;case"deleteright":t="⌦";break;case"scissorsoutline":t="✄";break;case"telephone":t="☏";break;case"telhandset":t="ὍE";break;case"handptlft1":t="☜";break;case"handptrt1":t="☞";break;case"handptlftsld1":t="☚";break;case"handptrtsld1":t="☛";break;case"handptup1":t="☝";break;case"handptdwn1":t="☟";break;case"xmark":t="✗";break;case"check":t="✓";break;case"boxcheck":t="☑";break;case"boxx":case"boxxbld":t="☒";break;case"circlex":t="=⌔";break;case"circlexbld":t="⌔";break;case"prohibit":case"prohibitbld":t="⦸";break;case"ampersanditaldm":case"ampersandbld":case"ampersandsans":case"ampersandsandm":t="&";break;case"interrobang":case"interrobangdm":case"interrobangsans":case"interrobngsandm":t="‽";break;case"sacute":t="ś";break;case"Sacute":t="Ś";break;case"eogonek":t="ę";break;case"cacute":t="ć";break;case"aogonek":t="ą";break;default:t=e}return t}function wkt(e){var t;switch(e){case"zero":t="0";break;case"one":t="1";break;case"two":t="2";break;case"three":t="3";break;case"four":t="4";break;case"five":t="5";break;case"six":t="6";break;case"seven":t="7";break;case"eight":t="8";break;case"nine":t="9";break;case"aacute":t="á";break;case"asciicircum":t="^";break;case"asciitilde":t="~";break;case"asterisk":t="*";break;case"at":t="@";break;case"atilde":t="ã";break;case"backslash":t="\\";break;case"bar":t="|";break;case"braceleft":t="{";break;case"braceright":t="}";break;case"bracketleft":t="[";break;case"bracketright":t="]";break;case"breve":t="˘";break;case"brokenbar":t="|";break;case"bullet3":case"bullet":t="•";break;case"caron":t="ˇ";break;case"ccedilla":t="ç";break;case"cedilla":t="¸";break;case"cent":t="¢";break;case"circumflex":t="ˆ";break;case"colon":t=":";break;case"comma":t=",";break;case"copyright":t="©";break;case"currency1":t="¤";break;case"dagger":t="†";break;case"daggerdbl":t="‡";break;case"degree":t="°";break;case"dieresis":t="¨";break;case"divide":t="÷";break;case"dollar":t="$";break;case"dotaccent":t="˙";break;case"dotlessi":t="ı";break;case"eacute":t="é";break;case"middot":t="˙";break;case"edieresis":t="ë";break;case"egrave":t="è";break;case"ellipsis":t="...";break;case"emdash":t="—";break;case"endash":t="–";break;case"equal":t="=";break;case"eth":t="ð";break;case"exclam":t="!";break;case"exclamdown":t="¡";break;case"florin":t="ƒ";break;case"fraction":t="⁄";break;case"germandbls":t="ß";break;case"grave":t="`";break;case"greater":t=">";break;case"guillemotleft4":t="«";break;case"guillemotright4":t="»";break;case"guilsinglleft":t="‹";break;case"guilsinglright":t="›";break;case"hungarumlaut":t="˝";break;case"hyphen5":t="-";break;case"iacute":t="í";break;case"icircumflex":t="î";break;case"idieresis":t="ï";break;case"igrave":t="ì";break;case"less":t="<";break;case"logicalnot":t="¬";break;case"lslash":t="ł";break;case"Lslash":t="Ł";break;case"macron":t="¯";break;case"minus":t="−";break;case"mu":t="μ";break;case"multiply":t="×";break;case"ntilde":t="ñ";break;case"numbersign":t="#";break;case"oacute":t="ó";break;case"ocircumflex":t="ô";break;case"odieresis":t="ö";break;case"oe":t="oe";break;case"ogonek":t="˛";break;case"ograve":t="ò";break;case"onehalf":t="1/2";break;case"onequarter":t="1/4";break;case"onesuperior":t="¹";break;case"ordfeminine":t="ª";break;case"ordmasculine":t="º";break;case"otilde":t="õ";break;case"paragraph":t="¶";break;case"parenleft":t="(";break;case"parenright":t=")";break;case"percent":t="%";break;case"period":t=".";break;case"periodcentered":t="·";break;case"perthousand":t="‰";break;case"plus":t="+";break;case"plusminus":t="±";break;case"question":t="?";break;case"questiondown":t="¿";break;case"quotedbl":t="'";break;case"quotedblbase":t="„";break;case"quotedblleft":t="“";break;case"quotedblright":t="”";break;case"quoteleft":t="‘";break;case"quoteright":t="’";break;case"quotesinglbase":t="‚";break;case"quotesingle":t="'";break;case"registered":t="®";break;case"ring":t="˚";break;case"scaron":t="š";break;case"section":t="§";break;case"semicolon":t=";";break;case"slash":t="/";break;case"space6":case"space":t=" ";break;case"udieresis":t="ü";break;case"uacute":t="ú";break;case"Ecircumflex":t="Ê";break;case"hyphen":t="-";break;case"underscore":t="_";break;case"adieresis":t="ä";break;case"ampersand":t="&";break;case"Adieresis":t="Ä";break;case"Udieresis":t="Ü";break;case"ccaron":t="č";break;case"Scaron":t="Š";break;case"zcaron":t="ž";break;case"sterling":t="£";break;case"agrave":t="à";break;case"ecircumflex":t="ê";break;case"acircumflex":t="â";break;case"Oacute":t="Ó";break;default:t=e}return t}function Ckt(e){var t=e.get("F");return(e.has("State")||e.has("StateModel"))&&(30===t||128===t)}function Skt(e){var t=e.get("F");return!(e.has("State")||e.has("StateModel")||28!==t&&128!==t)}function Akt(e,t){switch(e.has("F")&&(delete e._map.F,e._updated=!0),t){case kAt.hidden:e.update("F",bAt.hidden);break;case kAt.hiddenPrintable:e.update("F",bAt.noView|bAt.print);break;case kAt.visible:var i;e.has("DV")&&(delete e._map.DV,e._updated=!0),e.has("MK")&&(i=e.get("MK"))&&i.has("BG")&&(delete i._map.BG,i._updated=!0)}}function xkt(e,t,i){var n;e&&e.has(i)&&(n=e.getRaw(i))&&n instanceof aPt&&n._isNew&&((e=e.get(i))&&(i=void 0,(e=e instanceof aPt?t._fetch(e):e)instanceof mPt?i=e:e instanceof SPt&&(i=e.dictionary),i)&&i.has("Resources")&&Ikt(i.get("Resources"),t),t._cacheMap.delete(n))}function Ikt(o,r){o&&0<o.size&&o.forEach(function(e,t){var i,n;void 0!==e&&void 0!==t&&(t instanceof aPt?(i=t)._isNew&&(n=o.get(e))&&n instanceof mPt&&("XObject"===e&&n.has("Resources")&&Ikt(n.get("Resources"),r),r._cacheMap.delete(i)):t instanceof mPt&&(t.has("Resources")&&Ikt(t.get("Resources"),r),"Font"!==e&&"XObject"!==e&&"ExtGState"!==e||Ikt(t,r)))})}function Tkt(e,t,i,n){var o;e&&(e instanceof mPt?o=e:e instanceof IPt&&(o=e.dictionary)),o&&(xkt(o,t,i),xkt(o,t,n))}var Ekt,Dkt=function(e,t){this.message=e,this.name=t},Mkt=(ost(kkt,Ekt=Dkt),kkt);function kkt(e){return Ekt.call(this,e,"FormatError")||this}ost(Fkt,Pkt=Dkt);var Pkt,Bkt=Fkt;function Fkt(e){return Pkt.call(this,e,"ParserEndOfFileException")||this}function Lkt(e){return"[object String]"===Object.prototype.toString.call(e)?"$s"+e:"$o"+e.toString()}function Rkt(e,t,i){var n,o,r,s,a,l="";if((r=t&&t._dictionary.has("DA")||i._dictionary.has("DA")?(t&&t._dictionary.has("DA")?t:i)._dictionary.get("DA"):r)&&""!==r&&-1!==r.indexOf("Tf"))for(var h=r.split(" "),d=0;d<h.length;d++)if(-1!==h[Number.parseInt(d.toString(),10)].indexOf("Tf")){for(l=h[d-2];""!==l&&1<l.length&&"/"===l[0];)l=l.substring(1);n=Number.parseFloat(h[d-1])}return l=l&&l.trim(),e&&e._dictionary.has("DR")&&(e=e._dictionary.get("DR")).has("Font")&&(e=e.get("Font")).has(l)&&(e=e.get(l))&&l&&e.has("BaseFont")&&(s=e.get("BaseFont"),a=Jxt.regular,s)&&(r=s.name,a=Okt(s.name),r.includes("-")&&(r=r.substring(0,r.indexOf("-"))),t&&t._dictionary.has("DA")?o=t._dictionary.has("AP")?Nkt(r,n,a,t):Nkt(r,n,a,t,e):i&&i._dictionary.has("DA")&&(o=i._dictionary.has("AP")?Nkt(r,n,a,i):Nkt(r,n,a,i,e))),(null==(o=null==o&&n?new _xt(Zxt.helvetica,n,Jxt.regular):o)||o&&1===o.size)&&(t?o=t._circleCaptionFont:i&&(o=i._circleCaptionFont)),o}function Okt(e){var t=e.indexOf("-"),i=(t<0&&(t=e.indexOf(",")),Jxt.regular);if(0<=t)switch(e.substring(t+1,e.length)){case"Bold":case"BoldMT":i=Jxt.bold;break;case"Italic":case"ItalicMT":case"Oblique":case"It":i=Jxt.italic;break;case"BoldItalic":case"BoldItalicMT":case"BoldOblique":i=Jxt.bold|Jxt.italic}return i}function Nkt(e,t,i,n,o){var r,s,a=e||"",l=(a.includes("-")&&(a=a.substring(0,a.indexOf("-"))),void 0!==(t=void 0===t&&n instanceof BTt&&n._isLoaded?10:t)?t:1);if(n._dictionary.has("DS")||n._dictionary.has("DA"))switch(a){case"Helv":case"Helvetica":r=new _xt(Zxt.helvetica,l,i);break;case"Cour":case"Courier":r=new _xt(Zxt.courier,l,i);break;case"Symb":case"Symbol":r=new _xt(Zxt.symbol,l,i);break;case"Times":case"TiRo":case"TimesRoman":r=new _xt(Zxt.timesRoman,l,i);break;case"ZaDb":case"ZapfDingbats":r=new _xt(Zxt.zapfDingbats,l,i);break;case"MonotypeSungLight":r=new jxt($xt.monotypeSungLight,l,i);break;case"SinoTypeSongLight":r=new jxt($xt.sinoTypeSongLight,l,i);break;case"MonotypeHeiMedium":r=new jxt($xt.monotypeHeiMedium,l,i);break;case"HanyangSystemsGothicMedium":r=new jxt($xt.hanyangSystemsGothicMedium,l,i);break;case"HanyangSystemsShinMyeongJoMedium":r=new jxt($xt.hanyangSystemsShinMyeongJoMedium,l,i);break;case"HeiseiKakuGothicW5":r=new jxt($xt.heiseiKakuGothicW5,l,i);break;case"HeiseiMinchoW3":r=new jxt($xt.heiseiMinchoW3,l,i);break;default:n._dictionary.has("AP")?s=Vkt(n._dictionary,n._crossReference,n,e):o&&(s=_kt(o)),s&&0<s.length&&(r=new Uxt(s,l,i))}return null==r&&(n instanceof TTt?r=n._type!==QAt.widgetAnnotation?new _xt(Zxt.helvetica,l,i):n._circleCaptionFont:n instanceof XIt&&(r=n._circleCaptionFont)),r}function Vkt(e,i,t,n){var o,r,s,e=e.get("AP");return e&&e instanceof mPt&&e.has("N")&&(r=void 0,(e=e.get("N"))&&(e instanceof IPt?r=e:(t instanceof XIt||t instanceof GEt)&&e.stream&&e.stream instanceof IPt&&(r=e.stream)),r)&&r instanceof IPt&&r.dictionary.has("Resources")&&(e=r.dictionary.get("Resources"))&&e.has("Font")&&(s=e.get("Font"))&&s instanceof mPt&&s.forEach(function(e,t){t&&(t=i._fetch(t),o=_kt(t))}),o=!o&&t&&t instanceof XIt&&t._form&&t._form._dictionary.has("DR")&&null!=n&&(r=t._form._dictionary.get("DR"))&&r.has("Font")&&(e=r.get("Font"))&&e.has(n)&&(s=e.get(n))&&s.has("FontDescriptor")?_kt(s):o}function _kt(e){var t,i,n;if(e&&e.has("DescendantFonts")){var o=e.getArray("DescendantFonts");if(o&&0<o.length)for(var r=0;r<o.length;r++){var s=o[Number.parseInt(r.toString(),10)];s&&s instanceof mPt&&s.has("FontDescriptor")&&(i=s.get("FontDescriptor"))}}else e&&e.has("FontDescriptor")&&(i=e.get("FontDescriptor"));return i&&i.has("FontFile2")&&((e=i.get("FontFile2"))instanceof IPt&&0<e.length?t=e.getByteRange(e.start,e.end):e.stream instanceof IPt&&0<e.stream.length&&e.dictionary&&(e.dictionary.has("Length1")||e.dictionary.has("Length"))&&(n=e.dictionary.get(e.dictionary.has("Length1")?"Length1":"Length"),e.getBytes(n),t=e.buffer.subarray(0,n))),t}function Hkt(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!vMt(e[Number.parseInt(i.toString(),10)],t[Number.parseInt(i.toString(),10)]))return!1;return!0}function zkt(e,t){var i,n,o,r,s,a,l,h,d,p,c,u;return e&&(n=void 0,e.has(t)&&(n=e.getArray(t)),t=e._crossReference._document,o=void 0,n)&&Array.isArray(n)&&0<n.length&&(d=h=l=a=s=void 0,"number"==typeof(r=n[0])&&0<=(p=n[0])&&((e=e._crossReference._document)&&e.pageCount>p&&(i=e.getPage(p)),o=1<n.length?n[1]:o)&&"XYZ"===o.name&&(2<n.length&&(s=n[2]),3<n.length&&(a=n[3]),4<n.length&&(d=n[4]),i)&&(c=null==a?0:i.size[1]-a,i.rotation!==TAt.angle0&&cMt(i,a,s),(u=new FDt(i,[null==s?0:s,c]))._index=p,u.zoom=null!=d?d:0,null!==s&&null!==a&&null!==d&&void 0!==s&&void 0!==a&&void 0!==d||u._setValidation(!1)),r instanceof mPt)&&(e=void 0,null!=(e=t&&r?uMt(t,r):e)&&0<=e&&(i=t.getPage(e)),o=1<n.length?n[1]:o)&&("XYZ"===o.name?(2<n.length&&(s=n[2]),3<n.length&&(a=n[3]),4<n.length&&(d=n[4]),i&&(c=null==a?0:i.size[1]-a,i.rotation!==TAt.angle0&&(c=cMt(i,a,s)),(u=new FDt(i,[null==s?0:s,c]))._index=e,u.zoom=null!=d?d:0,null!==s&&null!==a&&null!==d&&void 0!==s&&void 0!==a&&void 0!==d||u._setValidation(!1))):"FitR"===o.name?(2<n.length&&(s=n[2]),3<n.length&&(l=n[3]),4<n.length&&(h=n[4]),5<n.length&&(a=n[5]),i&&((u=new FDt(i,[s=null==s?0:s,l=null==l?0:l,h=null==h?0:h,a=null==a?0:a]))._index=e,u.mode=zAt.fitR)):"FitBH"===o.name||"FitH"===o.name?(3<=n.length&&(a=n[2]),(i=null!=e&&0<=e?t.getPage(e):i)&&i.size&&(c=null==a?0:i.size[1]-a,(u=new FDt(i,[0,c]))._index=e,u.mode=zAt.fitH,null==a)&&u._setValidation(!1)):i&&"Fit"===o.name&&((u=new FDt(i))._index=e,u.mode=zAt.fitToPage)),u}function jkt(e,t){var i,n;return t&&(e._bounds={x:t[0],y:t[1],width:t[2],height:t[3]}),e._page&&e.bounds?(n=[e.bounds.x,e.bounds.y+e.bounds.height,e.bounds.width,e.bounds.height],e._page._isNew&&e._page._pageSettings?(i=[(t=e._page._pageSettings).margins.left,t.margins.top,t.size[0]-(t.margins.left+t.margins.right),t.size[1]-(t.margins.top+t.margins.bottom)],n[0]+=i[0],n[1]=t.size[1]-(i[1]+n[1])):(t=e._page.size,n[1]=t[1]-(e.bounds.y+e.bounds.height),(i=e._getCropOrMediaBox())&&2<i.length&&(0!==i[0]||0!==i[1])&&(n[0]+=i[0],n[1]+=i[1])),[n[0],n[1],n[0]+n[2],n[1]+n[3]]):n}function Wkt(e,t,i){if(e&&"string"==typeof e&&!t&&!i&&e.startsWith("þÿ")){for(var n=yMt(e=(e=e.substring(2)).endsWith("ÿý")?e.substring(0,e.length-2):e,!1,!0),o="",r=0;r<n.length;r+=2){var s=n[Number.parseInt(r.toString(),10)]<<8,a=n[Number.parseInt((r+1).toString(),10)];o+=String.fromCharCode(s|a)}e=o}return e}function Qkt(e){return e<=4294967295?e<=65535?e<=255?1:2:e<=16777215?3:4:8}function Ukt(e){for(var t=[],i=0;i<e.length;i++){var n=e.charCodeAt(Number.parseInt(i.toString(),10));n<=65535&&(t.push(n>>8&255),t.push(255&n))}return t}function qkt(e,t){switch(t){case f1t.none:return"";case f1t.numeric:return e.toString();case f1t.lowerLatin:return Ykt(e).toLowerCase();case f1t.lowerRoman:return Gkt(e).toLowerCase();case f1t.upperLatin:return Ykt(e);case f1t.upperRoman:return Gkt(e)}}function Gkt(e){for(var t="",i=0,n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];i<n.length;i++)for(var o=n[i],r=o[0],s=o[1];r<=e;)t+=s,e-=r;return t}function Ykt(e){for(var t="";0<e;){var i=e%26;e=Math.floor(e/26),0===i&&(e--,i=26),t=Xkt(i)+t}return t}function Xkt(e){if(e<=0||26<e)throw new Error("Value can not be less 0 and greater 26");return String.fromCharCode(64+e)}function Kkt(e){return null!=e}function Jkt(e,t){void 0===t&&(t=!1);for(var i=e.getString(),n=[],o=0;o<i.length;o++)n.push(i.charCodeAt(o));var r=new Uint8Array(n),s=new lh;if(s.write(r,0,r.length),s.close(),i=s.getCompressedString,e.dictionary.update("Filter",k.get("FlateDecode")),t){for(var a=[],o=0;o<i.length;o++)a.push(255&i.charCodeAt(o));return xMt(new Uint8Array(a))}return i}function Zkt(e){return/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/.test(e)}function $kt(e,t){e.update("Count",e.get("Count")+t),e.has("Parent")&&(e=e.get("Parent"))&&"Pages"===e.get("Type").name&&$kt(e,t)}function ePt(e,t){var i=[0,0,t.size[0],t.size[1]],i=(e.update("MediaBox",i),e.update("CropBox",i),90*Math.floor(t.rotation));360<=i&&(i%=360),e.update("Rotate",i)}var tPt=Object.create(null),iPt=Object.create(null),nPt=Object.create(null),k=(oPt.get=function(e){return tPt[e]||(tPt[e]=new oPt(e))},oPt);function oPt(e){this.name=e}sPt.get=function(e){return iPt[e]||(iPt[e]=new sPt(e))};var rPt=sPt;function sPt(e){this.command=e}lPt.prototype.toString=function(){return this.objectNumber+" "+this.generationNumber},lPt.get=function(e,t){var i=0===t?e+"R":e+"R"+t;return nPt[i]||(nPt[i]=new lPt(e,t))};var aPt=lPt;function lPt(e,t){this._isNew=!1,this.objectNumber=e,this.generationNumber=t}dPt.prototype.has=function(e){return this._set.has(e.toString())},dPt.prototype.put=function(e){this._set.add(e.toString())},dPt.prototype.remove=function(e){this._set.delete(e.toString())},dPt.prototype.clear=function(){this._set.clear()};var hPt=dPt;function dPt(e){void 0===e&&(e=null),this._set=new Set(e&&e._set)}Object.defineProperty(cPt.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),cPt.prototype.get=function(e){return this._map.get(e.toString())},cPt.prototype.has=function(e){return this._map.has(e.toString())},cPt.prototype.put=function(e,t){this._map.set(e.toString(),t)},cPt.prototype.set=function(e,t){this._map.set(e,t)},cPt.prototype.clear=function(){this._map.clear()};var pPt=cPt;function cPt(){this._map=new Map}gPt.prototype.getValue=function(e){e=this.table["$"+this.toStr(e)];if(void 0!==e)return e.value},gPt.prototype.setValue=function(e,t){var i="$"+this.toStr(e);this.table[i];this.nElements++,this.table[i]={key:e,value:t}},gPt.prototype.keys=function(){for(var e=[],t=Object.keys(this.table),i=0;i<t.length;i++){var n=this.table[t[i]];e.push(n.key)}return e},gPt.prototype.containsKey=function(e){return!(void 0===this.getValue(e))},gPt.prototype._size=function(){return this.nElements};var uPt=gPt;function gPt(e){this.table={},this.nElements=0,this.toStr=e||Lkt}Object.defineProperty(fPt.prototype,"size",{get:function(){return Object.keys(this._map).length},enumerable:!0,configurable:!0}),fPt.prototype.assignXref=function(e){this._crossReference=e},fPt.prototype.getRaw=function(e){return this._map[e]},fPt.prototype.getRawValues=function(){return this._map.values},fPt.prototype.get=function(e,t,i){e=this._get(e,t,i);return e=this._crossReference&&void 0!==e&&e instanceof aPt?this._crossReference._fetch(e):e},fPt.prototype.getArray=function(e,t,i){var n=this.get(e,t,i);if(this._crossReference&&void 0!==n&&Array.isArray(n))for(var n=n.slice(),o=0;o<n.length;o++){var r=n[Number.parseInt(o.toString(),10)];null!=r&&r instanceof aPt&&(n[Number.parseInt(o.toString(),10)]=this._crossReference._fetch(r))}return n},fPt.prototype.set=function(e,t){this._map[e]=t},fPt.prototype.has=function(e){return void 0!==this._map[e]},fPt.prototype.forEach=function(e){for(var t in this._map)e(t,this.getRaw(t))},fPt.prototype.update=function(e,t){var i;this.has(e)&&(i=null!=(i=this._map[e])&&i instanceof aPt&&this._crossReference?this._crossReference._fetch(i):i)===t||(this._map[e]=t,this._updated=!0)},fPt.getEmpty=function(e){e=new fPt(e);return e.set=function(e,t){throw new Error("Should not call set on the empty dictionary.")},e},fPt.merge=function(e,t,i){void 0===i&&(i=!1);for(var n=new fPt(e),o=Object.create(null),r=0,s=t;r<s.length;r++)if((b=s[r])instanceof fPt)for(var a=0,l=b._map;a<l.length;a++){var h=l[a],d=h[0],p=h[1],h=o.get(d);if(void 0===h)o.set(d,h=[]);else if(!(i&&p instanceof fPt))continue;h.push(p)}for(var c=0,u=o;c<u.length;c++){var g=u[c],m=g[0],g=g[1];if(1!==g.length&&g[0]instanceof fPt){for(var f=new fPt(e),y=0,v=g;y<v.length;y++)for(var b,w=0,C=(b=v[y])._map;w<C.length;w++){var S=C[w],d=S[0],p=S[1];void 0===f._map[d]&&(f._map[d]=p)}0<f.size&&(n._map[m]=f)}else n._map[m]=g[0]}return o.clear(),0<n.size?n:fPt.getEmpty(e)},fPt.prototype._initialize=function(e){this._map=Object.create(null),this.suppressEncryption=!1,this._updated=!1,this.isCatalog=!1,this._isNew=!1,e&&(this._crossReference=e)},fPt.prototype._get=function(e,t,i){e=this._map[e];return void 0===e&&(e=this._map[t],null!=t?e=this._map[t]:null!=i&&(e=this._map[i])),e};var mPt=fPt;function fPt(e){this._isFont=!1,this._initialize(e)}function yPt(e){this.value=e=void 0===e?[]:e}function vPt(){tPt=Object.create(null),iPt=Object.create(null),nPt=Object.create(null)}function bPt(e,t){return e instanceof k&&(void 0===t||e.name===t)}function wPt(e,t){return e instanceof rPt&&(void 0===t||e.command===t)}CPt=function(e,t){return(CPt=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])}))(e,t)};var CPt,jee=function(e,t){function i(){this.constructor=e}CPt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},SPt=(APt.prototype.getByte=function(){return null},APt.prototype.getBytes=function(e){return null},Object.defineProperty(APt.prototype,"length",{get:function(){throw new Error("Abstract getter `length` accessed")},enumerable:!0,configurable:!0}),Object.defineProperty(APt.prototype,"isEmpty",{get:function(){throw new Error("Abstract getter `isEmpty` accessed")},enumerable:!0,configurable:!0}),Object.defineProperty(APt.prototype,"isDataLoaded",{get:function(){return!0},enumerable:!0,configurable:!0}),APt.prototype.peekByte=function(){var e=this.getByte();return-1!==e&&this.offset--,e},APt.prototype.peekBytes=function(e){e=this.getBytes(e);return this.offset-=e.length,e},APt.prototype.getUnsignedInteger16=function(){var e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t},APt.prototype.getInt32=function(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()},APt.prototype.getByteRange=function(e,t){return null},APt.prototype.makeSubStream=function(e,t,i){return null},APt.prototype.readBlock=function(){return null},APt.prototype.reset=function(){return null},APt.prototype.moveStart=function(){return null},APt.prototype.getString=function(e,t){return((e=void 0===e?!1:e)?xMt:CMt)(t=null==t?this.getBytes():t)},APt.prototype.skip=function(e){this.offset+=e||1},APt.prototype.getBaseStreams=function(){return null},APt);function APt(){this._isCompress=!0,this._isImage=!1}jee(TPt,xPt=SPt),Object.defineProperty(TPt.prototype,"position",{get:function(){return this.offset},set:function(e){this.offset=e},enumerable:!0,configurable:!0}),Object.defineProperty(TPt.prototype,"length",{get:function(){return this.end-this.start},enumerable:!0,configurable:!0}),Object.defineProperty(TPt.prototype,"isEmpty",{get:function(){return 0===this.length},enumerable:!0,configurable:!0}),Object.defineProperty(TPt.prototype,"data",{get:function(){return this.dataStream2},set:function(e){this.dataStream2=[],this.dataStream2=e},enumerable:!0,configurable:!0}),TPt.prototype.getByte=function(){return this.position>=this.end?-1:this.bytes[this.position++]},TPt.prototype.getBytes=function(e){var t=this.bytes,i=this.position,n=this.end;return e?(this.position=e=n<(e=i+e)?n:e,t.subarray(i,e)):t.subarray(i,n)},TPt.prototype.getByteRange=function(e,t){return t>this.end&&(t=this.end),this.bytes.subarray(e=e<0?0:e,t)},TPt.prototype.reset=function(){this.position=this.start},TPt.prototype.moveStart=function(){this.start=this.position},TPt.prototype.makeSubStream=function(e,t,i){return new TPt(this.bytes.buffer,i=void 0===i?null:i,e,t)},TPt.prototype.readBlock=function(){throw new Error("Abstract method `readBlock` called")},TPt.prototype._clearStream=function(){null!==this.dictionary&&void 0!==this.dictionary&&this.dictionary.has("Filter")&&delete this.dictionary._map.Filter,this._isCompress=!0,this.dictionary._updated=!0},TPt.prototype._write=function(e){this.bytes=new Uint8Array(e.length);for(var t=0;t<e.length;t++)this.bytes[Number.parseInt(t.toString(),10)]=e.charCodeAt(t);this.end=this.bytes.length,this.dictionary._updated=!0},TPt.prototype._writeBytes=function(e){for(var t=0;t<e.length;t++)String.fromCharCode(e[Number.parseInt(t.toString(),10)]);this.bytes=new Uint8Array(e),this.end=this.bytes.length,this.dictionary._updated=!0};var xPt,IPt=TPt;function TPt(e,t,i,n){var o=xPt.call(this)||this;return o.isImageStream=!1,o.bytes=e instanceof Uint8Array?e:new Uint8Array(e),o.start=void 0!==i?i:0,o.position=o.start,o.end=i+n||o.bytes.length,o.dictionary=t,o}jee(MPt,EPt=SPt),Object.defineProperty(MPt.prototype,"length",{get:function(){return this._bytes.length},enumerable:!0,configurable:!0}),MPt.prototype.write=function(e){if("string"==typeof e)for(var t=0;t<e.length;t++)this._bytes.push(e.charCodeAt(t));else for(t=0;t<e.length;t++)this._bytes.push(e[Number.parseInt(t.toString(),10)]);this.dictionary._updated=!0},MPt.prototype.getString=function(e){void 0===e&&(e=!1);var t=new Uint8Array(this._bytes);if(null==t||void 0===t.length)throw new Error("Invalid argument for bytesToString");if(e)return xMt(t);var i=t.length;if(i<8192)return String.fromCharCode.apply(null,t);for(var n=[],o=0;o<i;o+=8192)n.push(String.fromCharCode.apply(null,t.subarray(o,Math.min(o+8192,i))));return n.join("")};var EPt,DPt=MPt;function MPt(e){var t=EPt.call(this)||this;return Kkt(e)?t._bytes=e:t._bytes=[],t.dictionary=new mPt,t.dictionary._updated=!0,t}jee(BPt,kPt=IPt);var kPt,PPt=BPt;function BPt(){return kPt.call(this,new Uint8Array(0))||this}LPt.prototype._readContent=function(){return this._parseObject(u1t.eof),this._recordCollection},LPt.prototype._parseObject=function(e){for(var t;(t=this._getNextToken())!==u1t.eof;){if(t===e||t===u1t.none)return;switch(t){case u1t.comment:break;case u1t.number:"-"===this._lexer._operatorParams?this._operands.push("0"):this._operands.push(this._lexer._operatorParams);break;case u1t.real:this._operands.push(this._lexer._operatorParams);break;case u1t.string:case u1t.hexString:case u1t.unicodeHexString:case u1t.unicodeString:case u1t.name:this._operands.push(this._lexer._operatorParams);break;case u1t.operator:this._createRecord(),this._operands=[];break;case u1t.beginArray:break;case u1t.endArray:throw new Error("Error while parsing content")}}},LPt.prototype._createRecord=function(){var e=this._lexer._operatorParams,e=new NPt(e,this._operands);e._splittedText=this._lexer._text,this._recordCollection.push(e)},LPt.prototype._getNextToken=function(){return this._lexer._getNextToken()};var FPt=LPt;function LPt(e){this._recordCollection=[],this._operands=[],this._lexer=new RPt(e)}OPt.prototype._getNextToken=function(){this._operatorParams="";var e=this._moveToNextChar();switch(e){case"%":return this._tokenType=this._getComment();case"/":return this._tokenType=this._getName();case"[":case"(":return this._tokenType=this._getLiteralString();case"+":case"-":return this._tokenType=this._getNumber();case"<":return this._tokenType=this._getEncodedDecimalString();case".":return this._tokenType=this._getNumber();case'"':case"'":return this._tokenType=this._getOperator()}return isNaN(parseInt(e,10))?/[a-zA-Z]/.test(e)?this._tokenType=this._getOperator():e===String.fromCharCode(65535)?this._tokenType=u1t.eof:this._tokenType=u1t.none:this._tokenType=this._getNumber()},OPt.prototype._getComment=function(){this._operatorParams="";for(var e,t="\n"!==(e=this._consumeValue())&&e!==String.fromCharCode(65535);t;)t="\n"!==(e=this._consumeValue())&&e!==String.fromCharCode(65535);return u1t.comment},OPt.prototype._getName=function(){this._operatorParams="";for(var e=!1;!e;)switch(this._consumeValue()){case"\0":case"\t":case"\n":case"\f":case"\r":case"\b":case" ":case"%":case"(":case")":case"<":case">":case"[":case"]":case"/":return e=!0,u1t.name}return u1t.none},OPt.prototype._getNumber=function(){var e=this._currentCharacter;for("+"!==e&&"-"!==e||(this._operatorParams+=this._currentCharacter,e=this._getNextChar());!isNaN(parseInt(e,10))||"."===e;){if(isNaN(parseInt(e,10))){if("."===e){if(this._operatorParams.includes("."))break;this._operatorParams+=this._currentCharacter}}else this._operatorParams+=this._currentCharacter;e=this._getNextChar()}return u1t.number},OPt.prototype._getOperator=function(){this._operatorParams="";for(var e=this._currentCharacter;this._isOperator(e);)e=this._consumeValue();return u1t.operator},OPt.prototype._isOperator=function(e){if(/[a-zA-Z]/.test(e))return!0;switch(e){case"*":case"'":case'"':case"1":case"0":return!0}return!1},OPt.prototype._getLiteralString=function(){this._operatorParams="";var e,t=this._currentCharacter,i=this._consumeValue(),n=!0,o=0,r="";for(this._text=[];n;){if("("===t){e=this._getLiteralStringValue(i),this._operatorParams+=e,i=this._getNextChar(),n=!1;break}if("("===i)""!==r&&(this._text[Number.parseInt(o.toString(),10)]=r.slice(0,-1),r="",o++),i=this._consumeValue(),e=this._getLiteralStringValue(i),this._text[Number.parseInt(o.toString(),10)]="("+e,o++,this._operatorParams+=e,r+=i=this._getNextChar();else{if("]"===i){n=!1,i=this._consumeValue();break}">"===i?(this._text[Number.parseInt(o.toString(),10)]="<"+r,o++,r=""):"<"===i&&(""!==r&&(this._text[Number.parseInt(o.toString(),10)]=r.slice(0,-1),o++),r=""),r+=i=this._consumeValue()}}return u1t.string},OPt.prototype._getEncodedDecimalString=function(){for(var e=0,t=this._consumeValue(),i=!0;i;)if("<"===t)e++,t=this._consumeValue();else if(">"===t){if(0===e){this._consumeValue(),i=!1;break}if(1===e){if(">"===(t=this._consumeValue())&&e--,1===e&&" "===t){i=!1;break}}else">"===t&&e--,t=this._consumeValue()}else if((t=this._consumeValue())===String.fromCharCode(65535)){i=!1;break}return u1t.hexString},OPt.prototype._getLiteralStringValue=function(e){for(var t=0,i="",n=!0;n;)if("\\"===e)i=(i+=e)+(e=this._getNextChar()),e=this._getNextChar();else if("("===e)t++,i+=e,e=this._getNextChar();else if(")"===e&&0!==t)i+=e,e=this._getNextChar(),t--;else{if(")"===e&&0===t)return n=!1,i+=e;i+=e,e=this._getNextChar()}return i},OPt.prototype._consumeValue=function(){return this._operatorParams+=this._currentCharacter,this._getNextChar()},OPt.prototype._moveToNextChar=function(){for(;this._currentCharacter!==String.fromCharCode(65535);)switch(this._currentCharacter){case"\0":case"\t":case"\n":case"\f":case"\r":case"\b":case" ":this._getNextChar();break;default:return this._currentCharacter}return this._currentCharacter},OPt.prototype._getNextChar=function(){if(this._data.length<=this._offset){if("Q"===this._nextCharacter||"D"===this._currentCharacter&&"o"===this._nextCharacter)return this._currentCharacter=this._nextCharacter,this._nextCharacter=String.fromCharCode(65535),this._currentCharacter;this._currentCharacter=String.fromCharCode(65535),this._nextCharacter=String.fromCharCode(65535)}else this._currentCharacter=this._nextCharacter,this._nextCharacter=String.fromCharCode(this._data[this._offset++]),"\r"===this._currentCharacter&&("\n"===this._nextCharacter?(this._currentCharacter=this._nextCharacter,this._data.length<=this._offset?this._nextCharacter=String.fromCharCode(65535):this._nextCharacter=String.fromCharCode(this._data[this._offset++])):this._currentCharacter="\n");return this._currentCharacter};var RPt=OPt;function OPt(e){this._tokenType=u1t.none,this._currentCharacter="\0",this._nextCharacter="\0",this._offset=0,this._text=[],this._data=e instanceof Uint8Array?e:new Uint8Array(e)}var NPt=function(e,t){this._operator=e,this._operands=t};VPt=function(e,t){return(VPt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}VPt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(HPt,_Pt=SPt),Object.defineProperty(HPt.prototype,"isEmpty",{get:function(){for(;!this.eof&&0===this.bufferLength;)this.readBlock();return 0===this.bufferLength},enumerable:!0,configurable:!0}),HPt.prototype.ensureBuffer=function(e){var t=this.buffer;if(e<=t.byteLength)return t;for(var i=this.minBufferLength;i<e;)i*=2;var n=new Uint8Array(i);return n.set(t),this.buffer=n,this.buffer},HPt.prototype.getByte=function(){for(var e=this.offset;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.offset++]},HPt.prototype.getBytes=function(e){var t,i=this.offset;if(e){for(this.ensureBuffer(i+e),t=i+e;!this.eof&&this.bufferLength<t;)this.readBlock();e=this.bufferLength;e<t&&(t=e)}else{for(;!this.eof;)this.readBlock();t=this.bufferLength}return this.offset=t,this.buffer.subarray(i,t)},HPt.prototype.reset=function(){this.offset=0},HPt.prototype.makeSubStream=function(e,t,i){if(void 0===t)for(;!this.eof;)this.readBlock();else for(var n=e+t;this.bufferLength<=n&&!this.eof;)this.readBlock();return new IPt(this.buffer,i,e,t)},HPt.prototype.getBaseStreams=function(){return this.stream?this.stream.getBaseStreams():null},HPt.prototype.moveStart=function(){throw new Error("Invalid call from decode stream")},HPt.prototype.getByteRange=function(e,t){throw new Error("Invalid call from decode stream. begin: "+e+", end: "+t)},HPt.prototype.readBlock=function(){throw new Error("Invalid call from decode stream")};var VPt,_Pt,Xet=HPt;function HPt(e){var t=_Pt.call(this)||this;if(t._rawMinBufferLength=e||0,t.offset=0,t.bufferLength=0,t.eof=!1,t.buffer=new Uint8Array(0),t.minBufferLength=512,e)for(;t.minBufferLength<e;)t.minBufferLength*=2;return t}zPt=function(e,t){return(zPt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}zPt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(QPt,jPt=Xet),QPt.prototype.readBlock=function(){if(this._initialized?t=this._nextChunk:(t=this.stream.getBytes(this._chunkSize),this._initialized=!0),t&&0!==t.length){this._nextChunk=this.stream.getBytes(this._chunkSize);for(var e=this._nextChunk&&0<this._nextChunk.length,t=this._cipher._decryptBlock(t,!e),i=this.bufferLength,n=t.length,o=this.ensureBuffer(i+n),r=0;r<n;r++)o[i++]=t[Number.parseInt(r.toString(),10)];this.bufferLength=i}else this.eof=!0};var zPt,jPt,WPt=QPt;function QPt(e,t,i){t=jPt.call(this,t)||this;return t._chunkSize=512,t.stream=e,t.dictionary=e.dictionary,t._cipher=i,t._nextChunk=null,t._initialized=!1,t}UPt=function(e,t){return(UPt=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])}))(e,t)};var UPt,qPt,det=function(e,t){function i(){this.constructor=e}UPt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},GPt=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),YPt=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),XPt=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),KPt=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],JPt=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5],ZPt=(det($Pt,qPt=Xet),$Pt.prototype.getBits=function(e){for(var t,i=this.stream,n=this.codeSize,o=this.codeBuffer;n<e;)o|=(t=i.getByte())<<n,n+=8;return t=o&(1<<e)-1,this.codeBuffer=o>>e,this.codeSize=n-=e,t},$Pt.prototype.getCode=function(e){for(var t=this.stream,i=e[0],n=e[1],o=this.codeSize,r=this.codeBuffer;o<n;)r|=t.getByte()<<o,o+=8;e=i[r&(1<<n)-1],i=e>>16,e&=65535;return i<1||o<i||(this.codeBuffer=r>>i,this.codeSize=o-i),e},$Pt.prototype.generateHuffmanTable=function(e){var t=e.length,i=0;for(p=0;p<t;++p)e[p]>i&&(i=e[p]);for(var n=1<<i,o=new Int32Array(n),r=1,s=0,a=2;r<=i;++r,s<<=1,a<<=1)for(var l=0;l<t;++l)if(e[l]===r){for(var h=0,d=s,p=0;p<r;++p)h=h<<1|1&d,d>>=1;for(p=h;p<n;p+=a)o[p]=r<<16|l;++s}return[o,i]},$Pt.prototype.readBlock=function(){var e,t,i=this.stream,n=this.getBits(3);if(1&n&&(this.eof=!0),0==(n>>=1)){var o,r,s=i.getByte(),a=(s|=i.getByte()<<8,i.getByte());if((a|=i.getByte()<<8)==(65535&~s)||0==s&&0==a)return this.codeBuffer=0,this.codeSize=0,a=this.bufferLength,r=this.ensureBuffer(o=a+s),this.bufferLength=o,void(0==s?-1===i.peekByte()&&(this.eof=!0):(o=i.getBytes(s),r.set(o,a),o.length<s&&(this.eof=!0)))}if(1==n)e=KPt,t=JPt;else if(2==n){for(var i=this.getBits(5)+257,a=this.getBits(5)+1,l=this.getBits(4)+4,h=new Uint8Array(GPt.length),d=void 0,d=0;d<l;++d)h[GPt[d]]=this.getBits(3);var p=this.generateHuffmanTable(h),c=0;d=0;for(var u=i+a,g=new Uint8Array(u),m=void 0,f=void 0,y=void 0;d<u;){var v=this.getCode(p);if(16===v)m=2,f=3,y=c;else{if(17===v)f=m=3;else{if(18!==v){g[d++]=c=v;continue}m=7,f=11}y=c=0}for(var b=this.getBits(m)+f;0<b--;)g[d++]=y}e=this.generateHuffmanTable(g.subarray(0,i)),t=this.generateHuffmanTable(g.subarray(i,u))}for(var w=(r=this.buffer)?r.length:0,C=this.bufferLength;;)if((S=this.getCode(e))<256)w<=C+1&&(w=(r=this.ensureBuffer(C+1)).length),r[C++]=S;else{if(256===S)return void(this.bufferLength=C);var S,A=(S=YPt[S-=257])>>16,x=(c=(65535&S)+(A=0<A?this.getBits(A):A),S=this.getCode(t),(65535&(S=XPt[S]))+(A=0<(A=S>>16)?this.getBits(A):A));w<=C+c&&(w=(r=this.ensureBuffer(C+c)).length);for(var I=0;I<c;++I,++C)r[C]=r[C-x]}},$Pt);function $Pt(e,t){var t=qPt.call(this,t)||this,i=(t.stream=e,t.dictionary=e.dictionary,e.getByte()),e=e.getByte();if(8!=(15&i))throw new Mkt("Unknown compression method in flate stream: "+i+", "+e);if(((i<<8)+e)%31!=0)throw new Mkt("Bad flag check in flate stream: "+i+", "+e);if(32&e)throw new Mkt("Bad flag bit set in flate stream: "+i+", "+e);return t.codeSize=0,t.codeBuffer=0,t}Object.defineProperty(tBt.prototype,"version",{get:function(){var e,t;return e=this._catalogDictionary.has("Version")&&(t=this._catalogDictionary.get("Version"))?t.name:e},enumerable:!0,configurable:!0}),Object.defineProperty(tBt.prototype,"pageCount",{get:function(){var e=this._topPagesDictionary.get("Count");if(void 0!==e&&Number.isInteger(e))return e;throw new Mkt("Invalid page count")},enumerable:!0,configurable:!0}),Object.defineProperty(tBt.prototype,"acroForm",{get:function(){var e;return e=null==(e=this._catalogDictionary.has("AcroForm")?this._catalogDictionary.get("AcroForm"):e)?this._createForm():e},enumerable:!0,configurable:!0}),tBt.prototype._createForm=function(){var e=new mPt(this._crossReference),t=this._crossReference._getNextReference();return this._crossReference._cacheMap.set(t,e),this._catalogDictionary.set("AcroForm",t),this._catalogDictionary._updated=!0,this._crossReference._allowCatalog=!0,e._updated=!0,e},tBt.prototype.getPageDictionary=function(e){for(var t=[this._topPagesDictionary],i=new hPt,n=this._catalogDictionary.getRaw("Pages"),o=(n&&n instanceof aPt&&i.put(n),this._crossReference),r=this.pageKidsCountCache,s=this.pageIndexCache,a=0;0<t.length;){var l=t.pop();if(null!=l&&l instanceof aPt){var h=r.get(l);if(0<=h&&a+h<=e)a+=h;else{if(i.has(l))throw new Mkt("Pages tree contains circular reference.");i.put(l);h=o._fetch(l);if(h&&h instanceof mPt&&(bPt(p=null!=(p=h.getRaw("Type"))&&p instanceof aPt?o._fetch(p):p,"Page")||!h.has("Kids"))){if(r.has(l)||r.put(l,1),s.has(l)||s.put(l,a),a===e)return{dictionary:h,reference:l};a++}else t.push(h)}}else{if(!(l instanceof mPt))throw new Mkt("Page dictionary kid reference points to wrong type of object.");var h=l.objId,d=l.get("Count");if(null!=(d=null!=d&&d instanceof aPt?o._fetch(d):d)&&Number.isInteger(d)&&0<=d&&(h&&!r.has(h)&&r.set(h,d),a+d<=e))a+=d;else{var p,c=l.getRaw("Kids");if(null!=c&&c instanceof aPt&&(c=o._fetch(c)),Array.isArray(c))for(var u=c.length-1;0<=u;u--)t.push(c[u]);else{if(!bPt(p=null!=(p=l.getRaw("Type"))&&p instanceof aPt?o._fetch(p):p,"Page")&&l.has("Kids"))throw new Mkt("Page dictionary kids object is not an array.");if(a===e)return{dictionary:l,reference:null};a++}}}}throw new Error("Page index "+e+" not found.")},tBt.prototype._destroy=function(){this._catalogDictionary&&(this._catalogDictionary=void 0),this._topPagesDictionary&&(this._topPagesDictionary=void 0),this.pageIndexCache&&(this.pageIndexCache.clear(),this.pageIndexCache=void 0),this.pageKidsCountCache&&(this.pageKidsCountCache.clear(),this.pageKidsCountCache=void 0)};var eBt=tBt;function tBt(e){if(this._crossReference=e,this._catalogDictionary=e._getCatalogObj(),!(this._catalogDictionary instanceof mPt))throw new Mkt("Catalog object is not a dictionary.");this._catalogDictionary.isCatalog=!0,this._topPagesDictionary=this._catalogDictionary.get("Pages"),this.pageKidsCountCache=new pPt,this.pageIndexCache=new pPt}iBt=function(e,t){return(iBt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}iBt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(rBt,nBt=Xet),rBt.prototype.readBlockTiff=function(){var e=this.rowBytes,t=this.bufferLength,i=this.ensureBuffer(t+e),n=this.bits,o=this.colors,r=this.stream.getBytes(e);if(this.eof=!r.length,!this.eof){var s=0,a=0,l=0,h=0,d=t;if(1===n&&1===o)for(u=0;u<e;++u){var p=r[u]^s,s=(1&(p=(p=(p^=p>>1)^p>>2)^p>>4))<<7;i[d++]=p}else if(8===n){for(u=0;u<o;++u)i[d++]=r[u];for(;u<e;++u)i[d]=i[d-o]+r[u],d++}else if(16===n){for(var c=2*o,u=0;u<c;++u)i[d++]=r[u];for(;u<e;u+=2){var g=((255&r[u])<<8)+(255&r[u+1])+((255&i[d-c])<<8)+(255&i[d-c+1]);i[d++]=g>>8&255,i[d++]=255&g}}else{var m=new Uint8Array(o+1),f=(1<<n)-1,y=0,v=t,b=this.columns;for(u=0;u<b;++u)for(var w=0;w<o;++w)l<n&&(s=s<<8|255&r[y++],l+=8),m[w]=m[w]+(s>>l-n)&f,l-=n,a=a<<n|m[w],8<=(h+=n)&&(i[v++]=a>>h-8&255,h-=8);0<h&&(i[v++]=(a<<8-h)+(s&(1<<8-h)-1))}this.bufferLength+=e}},rBt.prototype.readBlockPng=function(){var e=this.rowBytes,t=this.pixBytes,i=this.stream.getByte(),n=this.stream.getBytes(e);if(this.eof=!n.length,!this.eof){var o,r,s=this.bufferLength,a=this.ensureBuffer(s+e),l=a.subarray(s-e,s),h=(0===l.length&&(l=new Uint8Array(e)),s);switch(i){case 0:for(o=0;o<e;++o)a[h++]=n[o];break;case 1:for(o=0;o<t;++o)a[h++]=n[o];for(;o<e;++o)a[h]=a[h-t]+n[o]&255,h++;break;case 2:for(o=0;o<e;++o)a[h++]=l[o]+n[o]&255;break;case 3:for(o=0;o<t;++o)a[h++]=(l[o]>>1)+n[o];for(;o<e;++o)a[h]=(l[o]+a[h-t]>>1)+n[o]&255,h++;break;case 4:for(o=0;o<t;++o)d=l[o],r=n[o],a[h++]=d+r;for(;o<e;++o){var d=l[o],p=l[o-t],c=a[h-t],u=c+d-p,g=u-c,m=(g<0&&(g=-g),u-d),u=(m<0&&(m=-m),u-p);u<0&&(u=-u),r=n[o],a[h++]=g<=m&&g<=u?c+r:m<=u?d+r:p+r}break;default:throw new Mkt("Unsupported predictor: "+i)}this.bufferLength+=e}};var iBt,nBt,oBt=rBt;function rBt(e,t,i){t=nBt.call(this,t)||this;if(!(i instanceof mPt))return e;var n=t.predictor=i.get("Predictor")||1;if(n<=1)return e;if(2!==n&&(n<10||15<n))throw new Mkt("Unsupported predictor: "+n);t.readBlock=2===n?t.readBlockTiff:t.readBlockPng,t.stream=e,t.dictionary=e.dictionary;n=t.colors=i.get("Colors")||1,e=t.bits=i.get("BPC","BitsPerComponent")||8,i=t.columns=i.get("Columns")||1;return t.pixBytes=n*e+7>>3,t.rowBytes=i*n*e+7>>3,t}sBt=function(e,t){return(sBt=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])}))(e,t)};var sBt,q$e=function(e,t){function i(){this.constructor=e}sBt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},aBt=(Object.defineProperty(lBt.prototype,"_md5",{get:function(){return void 0===this._messageDigest&&(this._messageDigest=new hBt),this._messageDigest},enumerable:!0,configurable:!0}),lBt.prototype._createEncryptionKey=function(e,t,i,n,o,r,s,a){return e?a._getUserKey(t,o,s):a._getOwnerKey(t,i,n,r)},lBt.prototype._prepareKeyData=function(e,t,i,n,o,r,s,a){var l=new Uint8Array(40+i.length+e.length),h=0,d=0;if(t)for(m=Math.min(32,t.length);h<m;++h)l[Number.parseInt(h.toString(),10)]=t[Number.parseInt(h.toString(),10)];for(;h<32;)l[h++]=this._defaultPasswordBytes[d++];for(d=0,m=i.length;d<m;++d)l[h++]=i[Number.parseInt(d.toString(),10)];for(l[h++]=255&o,l[h++]=o>>8&255,l[h++]=o>>16&255,l[h++]=o>>>24&255,d=0,m=e.length;d<m;++d)l[h++]=e[Number.parseInt(d.toString(),10)];4<=r&&!a&&(l[h++]=255,l[h++]=255,l[h++]=255,l[h++]=255);var p=this._md5.hash(l,0,h),c=s>>3;if(3<=r)for(d=0;d<50;++d)p=this._md5.hash(p,0,c);var u=p.subarray(0,c);if(3<=r){for(h=0;h<32;++h)l[Number.parseInt(h.toString(),10)]=this._defaultPasswordBytes[Number.parseInt(h.toString(),10)];for(d=0,m=e.length;d<m;++d)l[h++]=e[Number.parseInt(d.toString(),10)];for(var g=new TBt(u)._encryptBlock(this._md5.hash(l,0,h)),m=u.length,f=new Uint8Array(m),d=1;d<=19;++d){for(var y=0;y<m;++y)f[Number.parseInt(y.toString(),10)]=u[Number.parseInt(y.toString(),10)]^d;g=new TBt(f)._encryptBlock(g)}for(d=0,m=g.length;d<m;++d)if(n[Number.parseInt(d.toString(),10)]!==g[Number.parseInt(d.toString(),10)])return null}else for(d=0,m=(g=new TBt(u)._encryptBlock(this._defaultPasswordBytes)).length;d<m;++d)if(n[Number.parseInt(d.toString(),10)]!==g[Number.parseInt(d.toString(),10)])return null;return u},lBt.prototype._decodeUserPassword=function(e,t,i,n){for(var o=new Uint8Array(32),r=0,s=0,a=Math.min(32,e.length);r<a;++r)o[Number.parseInt(r.toString(),10)]=e[Number.parseInt(r.toString(),10)];for(;r<32;)o[r++]=this._defaultPasswordBytes[s++];var l=this._md5.hash(o,0,r),h=n>>3;if(3<=i)for(s=0;s<50;++s)l=this._md5.hash(l,0,l.length);if(3<=i)for(var d=t,p=new Uint8Array(h),s=19;0<=s;s--){for(var c=0;c<h;++c)p[Number.parseInt(c.toString(),10)]=l[Number.parseInt(c.toString(),10)]^s;d=new TBt(p)._encryptBlock(d)}else d=new TBt(l.subarray(0,h))._encryptBlock(t);return d},lBt.prototype._createCipherTransform=function(e,t){var i,n;return 4===this._algorithm||5===this._algorithm?(n=this._buildCipherConstructor(this._cipherDictionary,this._string,e,t,this._encryptionKey),i=this._buildCipherConstructor(this._cipherDictionary,this._stream,e,t,this._encryptionKey),new HBt(n,i)):(n=this._buildObjectKey(e,t,this._encryptionKey,!1),new HBt(new TBt(n),new TBt(n)))},lBt.prototype._buildCipherConstructor=function(e,t,i,n,o){var r,e=e.get(t.name);if(!(r=e?e.get("CFM"):r))return new VBt;switch(r.name){case"None":return new VBt;case"AESV2":return new BBt(this._buildObjectKey(i,n,o,!0));case"AESV3":return new RBt(o);case"V2":return new TBt(this._buildObjectKey(i,n,o,!1))}throw new Mkt("Unknown cryptography method")},lBt.prototype._buildObjectKey=function(e,t,i,n){void 0===n&&(n=!1);for(var o=new Uint8Array(i.length+9),r=0;r<i.length;++r)o[Number.parseInt(r.toString(),10)]=i[Number.parseInt(r.toString(),10)];return o[r++]=255&e,o[r++]=e>>8&255,o[r++]=e>>16&255,o[r++]=255&t,o[r++]=t>>8&255,n&&(o[r++]=115,o[r++]=65,o[r++]=108,o[r++]=84),this._md5.hash(o,0,r).subarray(0,Math.min(i.length+5,16))},lBt);function lBt(e,t,i){void 0===i&&(i=""),this._isUserPassword=!0,this._hasUserPasswordOnly=!1,this._encryptOnlyAttachment=!1,this._encryptMetaData=!0,this._defaultPasswordBytes=new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]);var n=e.get("Filter");if(!bPt(n,"Standard"))throw new Mkt("unknown encryption method");this._filterName=n.name;n=(this._dictionary=e).get("V");if(!Number.isInteger(n)||1!==n&&2!==n&&4!==n&&5!==n)throw new Mkt("unsupported encryption algorithm");this._algorithm=n;var o=e.get("Length");if(o||(n<=3?o=40:(y=e.get("CF"),f=e.get("StmF"),y&&f&&(y.suppressEncryption=!0,(o=(y=y.get(f.name))&&y.get("Length")||128)<40)&&(o<<=3))),!Number.isInteger(o)||o<40||o%8!=0)throw new Mkt("invalid key length");var r,s,a,l,h,d,p,c,u,g,m,f=yMt(e.get("O"),!1,!0).subarray(0,32),y=yMt(e.get("U"),!1,!0).subarray(0,32),v=e.get("P"),b=e.get("R"),t=(this._encryptMetaData=(4===n||5===n)&&!1!==e.get("EncryptMetadata"),yMt(t,!1,!0));if(i&&(r=yMt(i=6===b?encodeURIComponent(i):i,!1,!0)),5!==n?(s=this._prepareKeyData(t,r,f,y,v,b,o,this._encryptMetaData))&&(this._isUserPassword=!0,i)&&(w=this._decodeUserPassword(r,f,b,o),a=this._prepareKeyData(t,w,f,y,v,b,o,this._encryptMetaData))&&vMt(a,s)&&(this._hasUserPasswordOnly=!0):(m=(a=yMt(e.get("O"),!1,!0)).subarray(32,40),a=a.subarray(40,48),l=(h=yMt(e.get("U"),!1,!0)).subarray(0,48),u=h.subarray(32,40),h=h.subarray(40,48),d=yMt(e.get("OE"),!1,!0),p=yMt(e.get("UE"),!1,!0),c=new(6===b?SBt:bBt),g=void 0,g=r?r.subarray(0,Math.min(127,r.length)):new Uint8Array([]),c._checkUserPassword(g,u,y)?(s=this._createEncryptionKey(!0,g,a,l,h,d,p,c),this._isUserPassword=!0,i.length&&c._checkOwnerPassword(g,m,l,f)&&(this._hasUserPasswordOnly=!0)):i.length&&c._checkOwnerPassword(g,m,l,f)&&(s=this._createEncryptionKey(!1,r,a,l,h,d,p,c),this._isUserPassword=!1)),!s){if(!i)throw new Error("Cannot open an encrypted document. The password is invalid.");var w=this._decodeUserPassword(r,f,b,o);s=this._prepareKeyData(t,w,f,y,v,b,o,this._encryptMetaData),this._isUserPassword=!1}if(4<=n&&((u=e.get("CF"))&&(u.suppressEncryption=!0,u.has("StdCF"))&&(g=u.get("StdCF"))&&g.has("AuthEvent")&&(m=g.get("AuthEvent"))&&"EFOpen"===m.name&&(this._encryptOnlyAttachment=!0),this._cipherDictionary=u,this._stream=e.get("StmF")||k.get("Identity"),this._string=e.get("StrF")||k.get("Identity"),this._eff=e.get("EFF")||this._stream),!s&&!this._encryptOnlyAttachment)throw new Error("Cannot open an encrypted document. The password is invalid.");this._encryptionKey=s}dBt.prototype.hash=function(e,t,i){for(var n=1732584193,o=-271733879,r=-1732584194,s=271733878,a=i+72&-64,l=new Uint8Array(a),h=0,d=0;h<i;++h)l[Number.parseInt(h.toString(),10)]=e[t++];l[h++]=128;for(var p=a-8;h<p;)l[h++]=0;l[h++]=i<<3&255,l[h++]=i>>5&255,l[h++]=i>>13&255,l[h++]=i>>21&255,l[h++]=i>>>29&255,l[h++]=0,l[h++]=0,l[h++]=0;for(var c=new Int32Array(16),h=0;h<a;){for(d=0;d<16;++d,h+=4)c[Number.parseInt(d.toString(),10)]=l[Number.parseInt(h.toString(),10)]|l[h+1]<<8|l[h+2]<<16|l[h+3]<<24;for(var u=n,g=o,m=r,f=s,y=void 0,v=void 0,d=0;d<64;++d)var v=d<16?(y=g&m|~g&f,d):d<32?(y=f&g|~f&m,5*d+1&15):d<48?(y=g^m^f,3*d+5&15):(y=m^(g|~f),7*d&15),b=f,w=u+y+this._k[Number.parseInt(d.toString(),10)]+c[Number.parseInt(v.toString(),10)]|0,C=this._r[Number.parseInt(d.toString(),10)],f=m,m=g,g=g+(w<<C|w>>>32-C)|0,u=b;n=n+u|0,o=o+g|0,r=r+m|0,s=s+f|0}return new Uint8Array([255&n,n>>8&255,n>>16&255,n>>>24&255,255&o,o>>8&255,o>>16&255,o>>>24&255,255&r,r>>8&255,r>>16&255,r>>>24&255,255&s,s>>8&255,s>>16&255,s>>>24&255])};var hBt=dBt;function dBt(){this._r=new Uint8Array([7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]),this._k=new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551])}cBt.prototype._rotateRight=function(e,t){return e>>>t|e<<32-t},cBt.prototype._sigma=function(e){return this._rotateRight(e,2)^this._rotateRight(e,13)^this._rotateRight(e,22)},cBt.prototype._sigmaPrime=function(e){return this._rotateRight(e,6)^this._rotateRight(e,11)^this._rotateRight(e,25)},cBt.prototype._littleSigma=function(e){return this._rotateRight(e,7)^this._rotateRight(e,18)^e>>>3},cBt.prototype._littleSigmaPrime=function(e){return this._rotateRight(e,17)^this._rotateRight(e,19)^e>>>10},cBt.prototype._hash=function(e,t,i){for(var n=1779033703,o=3144134277,r=1013904242,s=2773480762,a=1359893119,l=2600822924,h=528734635,d=1541459225,p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],c=64*Math.ceil((i+9)/64),u=new Uint8Array(c),g=0;g<i;++g)u[Number.parseInt(g.toString(),10)]=e[t++];u[g++]=128;for(var m=c-8;g<m;)u[g++]=0;u[g++]=0,u[g++]=0,u[g++]=0,u[g++]=i>>>29&255,u[g++]=i>>21&255,u[g++]=i>>13&255,u[g++]=i>>5&255,u[g++]=i<<3&255;for(var f=new Uint32Array(64),g=0;g<c;){for(E=0;E<16;++E)f[Number.parseInt(E.toString(),10)]=u[Number.parseInt(g.toString(),10)]<<24|u[g+1]<<16|u[g+2]<<8|u[g+3],g+=4;for(E=16;E<64;++E)f[Number.parseInt(E.toString(),10)]=this._littleSigmaPrime(f[E-2])+f[E-7]+this._littleSigma(f[E-15])+f[E-16]|0;for(var y,v,b=n,w=o,C=r,S=s,A=a,x=l,I=h,T=d,E=0;E<64;++E)y=T+this._sigmaPrime(A)+(A&x^~A&I)+p[Number.parseInt(E.toString(),10)]+f[Number.parseInt(E.toString(),10)],v=this._sigma(b)+(b&w^b&C^w&C),T=I,I=x,x=A,A=S+y|0,S=C,C=w,w=b,b=y+v|0;n=n+b|0,o=o+w|0,r=r+C|0,s=s+S|0,a=a+A|0,l=l+x|0,h=h+I|0,d=d+T|0}return new Uint8Array([n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,r>>24&255,r>>16&255,r>>8&255,255&r,s>>24&255,s>>16&255,s>>8&255,255&s,a>>24&255,a>>16&255,a>>8&255,255&a,l>>24&255,l>>16&255,l>>8&255,255&l,h>>24&255,h>>16&255,h>>8&255,255&h,d>>24&255,d>>16&255,d>>8&255,255&d])};var pBt=cBt;function cBt(){}gBt.prototype._sigma=function(e,t,i){e.assign(t),e.rotateRight(28),i.assign(t),i.rotateRight(34),e.xor(i),i.assign(t),i.rotateRight(39),e.xor(i)},gBt.prototype._sigmaPrime=function(e,t,i){e.assign(t),e.rotateRight(14),i.assign(t),i.rotateRight(18),e.xor(i),i.assign(t),i.rotateRight(41),e.xor(i)},gBt.prototype._littleSigma=function(e,t,i){e.assign(t),e.rotateRight(1),i.assign(t),i.rotateRight(8),e.xor(i),i.assign(t),i.shiftRight(7),e.xor(i)},gBt.prototype._littleSigmaPrime=function(e,t,i){e.assign(t),e.rotateRight(19),i.assign(t),i.rotateRight(61),e.xor(i),i.assign(t),i.shiftRight(6),e.xor(i)},gBt.prototype._hash=function(e,t,i,n){p=(n=void 0===n?!1:n)?(o=new mBt(3418070365,3238371032),r=new mBt(1654270250,914150663),s=new mBt(2438529370,812702999),a=new mBt(355462360,4144912697),l=new mBt(1731405415,4290775857),h=new mBt(2394180231,1750603025),d=new mBt(3675008525,1694076839),new mBt(1203062813,3204075428)):(o=new mBt(1779033703,4089235720),r=new mBt(3144134277,2227873595),s=new mBt(1013904242,4271175723),a=new mBt(2773480762,1595750129),l=new mBt(1359893119,2917565137),h=new mBt(2600822924,725511199),d=new mBt(528734635,4215389547),new mBt(1541459225,327033209));for(var o,r,s,a,l,h,d,p,c=128*Math.ceil((i+17)/128),u=new Uint8Array(c),g=0;g<i;++g)u[Number.parseInt(g.toString(),10)]=e[t++];u[g++]=128;for(var m=c-16;g<m;)u[g++]=0;u[g++]=0,u[g++]=0,u[g++]=0,u[g++]=0,u[g++]=0,u[g++]=0,u[g++]=0,u[g++]=0,u[g++]=0,u[g++]=0,u[g++]=0,u[g++]=i>>>29&255,u[g++]=i>>21&255,u[g++]=i>>13&255,u[g++]=i>>5&255,u[g++]=i<<3&255;var f=new Array(80);for(g=0;g<80;g++)f[Number.parseInt(g.toString(),10)]=new mBt(0,0);var y,v,b=new mBt(0,0),w=new mBt(0,0),C=new mBt(0,0),S=new mBt(0,0),A=new mBt(0,0),x=new mBt(0,0),I=new mBt(0,0),T=new mBt(0,0),E=new mBt(0,0),D=new mBt(0,0),M=new mBt(0,0),k=new mBt(0,0);for(g=0;g<c;){for(var P=void 0,P=0;P<16;++P)f[Number.parseInt(P.toString(),10)].high=u[Number.parseInt(g.toString(),10)]<<24|u[g+1]<<16|u[g+2]<<8|u[g+3],f[Number.parseInt(P.toString(),10)].low=u[g+4]<<24|u[g+5]<<16|u[g+6]<<8|u[g+7],g+=8;for(P=16;P<80;++P)y=f[Number.parseInt(P.toString(),10)],this._littleSigmaPrime(y,f[P-2],k),y.add(f[P-7]),this._littleSigma(M,f[P-15],k),y.add(M),y.add(f[P-16]);for(b.assign(o),w.assign(r),C.assign(s),S.assign(a),A.assign(l),x.assign(h),I.assign(d),T.assign(p),P=0;P<80;++P)E.assign(T),this._sigmaPrime(M,A,k),E.add(M),M.assign(A),M.and(x),k.assign(A),k.not(),k.and(I),M.xor(k),E.add(M),E.add(this._k[Number.parseInt(P.toString(),10)]),E.add(f[Number.parseInt(P.toString(),10)]),this._sigma(D,b,k),M.assign(b),M.and(w),k.assign(b),k.and(C),M.xor(k),k.assign(w),k.and(C),M.xor(k),D.add(M),y=T,T=I,I=x,x=A,S.add(E),A=S,S=C,C=w,w=b,y.assign(E),y.add(D),b=y;o.add(b),r.add(w),s.add(C),a.add(S),l.add(A),h.add(x),d.add(I),p.add(T)}return n?(v=new Uint8Array(48),o.copyTo(v,0),r.copyTo(v,8),s.copyTo(v,16),a.copyTo(v,24),l.copyTo(v,32),h.copyTo(v,40)):(v=new Uint8Array(64),o.copyTo(v,0),r.copyTo(v,8),s.copyTo(v,16),a.copyTo(v,24),l.copyTo(v,32),h.copyTo(v,40),d.copyTo(v,48),p.copyTo(v,56)),v};var uBt=gBt;function gBt(){this._k=[new mBt(1116352408,3609767458),new mBt(1899447441,602891725),new mBt(3049323471,3964484399),new mBt(3921009573,2173295548),new mBt(961987163,4081628472),new mBt(1508970993,3053834265),new mBt(2453635748,2937671579),new mBt(2870763221,3664609560),new mBt(3624381080,2734883394),new mBt(310598401,1164996542),new mBt(607225278,1323610764),new mBt(1426881987,3590304994),new mBt(1925078388,4068182383),new mBt(2162078206,991336113),new mBt(2614888103,633803317),new mBt(3248222580,3479774868),new mBt(3835390401,2666613458),new mBt(4022224774,944711139),new mBt(264347078,2341262773),new mBt(604807628,2007800933),new mBt(770255983,1495990901),new mBt(1249150122,1856431235),new mBt(1555081692,3175218132),new mBt(1996064986,2198950837),new mBt(2554220882,3999719339),new mBt(2821834349,766784016),new mBt(2952996808,2566594879),new mBt(3210313671,3203337956),new mBt(3336571891,1034457026),new mBt(3584528711,2466948901),new mBt(113926993,3758326383),new mBt(338241895,168717936),new mBt(666307205,1188179964),new mBt(773529912,1546045734),new mBt(1294757372,1522805485),new mBt(1396182291,2643833823),new mBt(1695183700,2343527390),new mBt(1986661051,1014477480),new mBt(2177026350,1206759142),new mBt(2456956037,344077627),new mBt(2730485921,1290863460),new mBt(2820302411,3158454273),new mBt(3259730800,3505952657),new mBt(3345764771,106217008),new mBt(3516065817,3606008344),new mBt(3600352804,1432725776),new mBt(4094571909,1467031594),new mBt(275423344,851169720),new mBt(430227734,3100823752),new mBt(506948616,1363258195),new mBt(659060556,3750685593),new mBt(883997877,3785050280),new mBt(958139571,3318307427),new mBt(1322822218,3812723403),new mBt(1537002063,2003034995),new mBt(1747873779,3602036899),new mBt(1955562222,1575990012),new mBt(2024104815,1125592928),new mBt(2227730452,2716904306),new mBt(2361852424,442776044),new mBt(2428436474,593698344),new mBt(2756734187,3733110249),new mBt(3204031479,2999351573),new mBt(3329325298,3815920427),new mBt(3391569614,3928383900),new mBt(3515267271,566280711),new mBt(3940187606,3454069534),new mBt(4118630271,4000239992),new mBt(116418474,1914138554),new mBt(174292421,2731055270),new mBt(289380356,3203993006),new mBt(460393269,320620315),new mBt(685471733,587496836),new mBt(852142971,1086792851),new mBt(1017036298,365543100),new mBt(1126000580,2618297676),new mBt(1288033470,3409855158),new mBt(1501505948,4234509866),new mBt(1607167915,987167468),new mBt(1816402316,1246189591)]}fBt.prototype.and=function(e){this.high&=e.high,this.low&=e.low},fBt.prototype.or=function(e){this.high|=e.high,this.low|=e.low},fBt.prototype.not=function(){this.high=~this.high,this.low=~this.low},fBt.prototype.xor=function(e){this.high^=e.high,this.low^=e.low},fBt.prototype.shiftRight=function(e){32<=e?(this.low=this.high>>>e-32|0,this.high=0):(this.low=this.low>>>e|this.high<<32-e,this.high=this.high>>>e|0)},fBt.prototype.shiftLeft=function(e){32<=e?(this.high=this.low<<e-32,this.low=0):(this.high=this.high<<e|this.low>>>32-e,this.low<<=e)},fBt.prototype.rotateRight=function(e){var t,i;32&e?(i=this.low,t=this.high):(t=this.low,i=this.high),this.low=t>>>(e&=31)|i<<32-e,this.high=i>>>e|t<<32-e},fBt.prototype.add=function(e){var t=(this.low>>>0)+(e.low>>>0),e=(this.high>>>0)+(e.high>>>0);4294967295<t&&(e+=1),this.low=0|t,this.high=0|e},fBt.prototype.copyTo=function(e,t){e[Number.parseInt(t.toString(),10)]=this.high>>>24&255,e[t+1]=this.high>>16&255,e[t+2]=this.high>>8&255,e[t+3]=255&this.high,e[t+4]=this.low>>>24&255,e[t+5]=this.low>>16&255,e[t+6]=this.low>>8&255,e[t+7]=255&this.low},fBt.prototype.assign=function(e){this.high=e.high,this.low=e.low};var mBt=fBt;function fBt(e,t){this.high=0|e,this.low=0|t}Object.defineProperty(yBt.prototype,"_sha256",{get:function(){return void 0===this._sha256Obj&&(this._sha256Obj=new pBt),this._sha256Obj},enumerable:!0,configurable:!0}),Object.defineProperty(yBt.prototype,"_sha512",{get:function(){return void 0===this._sha512Obj&&(this._sha512Obj=new uBt),this._sha512Obj},enumerable:!0,configurable:!0});W$e=yBt;function yBt(){}q$e(wBt,vBt=W$e),wBt.prototype._checkOwnerPassword=function(e,t,i,n){var o=new Uint8Array(e.length+56);return o.set(e,0),o.set(t,e.length),o.set(i,e.length+t.length),vMt(this._sha256._hash(o,0,o.length),n)},wBt.prototype._checkUserPassword=function(e,t,i){var n=new Uint8Array(e.length+8);return n.set(e,0),n.set(t,e.length),vMt(this._sha256._hash(n,0,n.length),i)},wBt.prototype._getOwnerKey=function(e,t,i,n){var o=new Uint8Array(e.length+56),i=(o.set(e,0),o.set(t,e.length),o.set(i,e.length+t.length),this._sha256._hash(o,0,o.length));return new RBt(i)._decryptBlock(n,!1,new Uint8Array(16))},wBt.prototype._getUserKey=function(e,t,i){var n=new Uint8Array(e.length+8),t=(n.set(e,0),n.set(t,e.length),this._sha256._hash(n,0,n.length));return new RBt(t)._decryptBlock(i,!1,new Uint8Array(16))};var vBt,bBt=wBt;function wBt(){return null!==vBt&&vBt.apply(this,arguments)||this}q$e(ABt,CBt=W$e),ABt.prototype._checkOwnerPassword=function(e,t,i,n){var o=new Uint8Array(e.length+56);return o.set(e,0),o.set(t,e.length),o.set(i,e.length+t.length),vMt(this._hash(e,o,i),n)},ABt.prototype._checkUserPassword=function(e,t,i){var n=new Uint8Array(e.length+8);return n.set(e,0),n.set(t,e.length),vMt(this._hash(e,n,new Uint8Array([])),i)},ABt.prototype._getOwnerKey=function(e,t,i,n){var o=new Uint8Array(e.length+56),t=(o.set(e,0),o.set(t,e.length),o.set(i,e.length+t.length),this._hash(e,o,i));return new RBt(t)._decryptBlock(n,!1,new Uint8Array(16))},ABt.prototype._getUserKey=function(e,t,i){var n=new Uint8Array(e.length+8),t=(n.set(e,0),n.set(t,e.length),this._hash(e,n,new Uint8Array([])));return new RBt(t)._decryptBlock(i,!1,new Uint8Array(16))},ABt.prototype._hash=function(e,t,i){for(var n=this._sha256._hash(t,0,t.length).subarray(0,32),o=new Uint8Array([0]),r=0;r<64||o[o.length-1]>r-32;){for(var s=e.length+n.length+i.length,a=new Uint8Array(s),l=0,h=(a.set(e,0),l+=e.length,a.set(n,l),l+=n.length,a.set(i,l),new Uint8Array(64*s)),d=0,p=0;d<64;d++)h.set(a,p),p+=s;for(var o=new BBt(n.subarray(0,16))._encrypt(h,n.subarray(16,32)),c=0,u=0;u<16;u++)c=((c=+c%3)+(o[Number.parseInt(u.toString(),10)]>>>0)%3)%3;2===c?n=this._sha512._hash(o,0,o.length):1===c?n=this._sha512._hash(o,0,o.length,!0):0===c&&(n=this._sha256._hash(o,0,o.length)),r++}return n.subarray(0,32)};var CBt,SBt=ABt;function ABt(){return null!==CBt&&CBt.apply(this,arguments)||this}function xBt(){}q$e(EBt,IBt=xBt),EBt.prototype._encryptBlock=function(e){for(var t=this._a,i=this._b,n=this._s,o=e.length,r=new Uint8Array(o),s=0;s<o;++s){var t=t+1&255,a=n[Number.parseInt(t.toString(),10)],i=i+a&255,l=n[Number.parseInt(i.toString(),10)];n[Number.parseInt(t.toString(),10)]=l,n[Number.parseInt(i.toString(),10)]=a,r[Number.parseInt(s.toString(),10)]=e[Number.parseInt(s.toString(),10)]^n[a+l&255]}return this._a=t,this._b=i,r},EBt.prototype._decryptBlock=function(e){return this._encryptBlock(e)},EBt.prototype._encrypt=function(e){return this._encryptBlock(e)};var IBt,TBt=EBt;function EBt(e){for(var t=IBt.call(this)||this,i=(t._a=0,t._b=0,new Uint8Array(256)),n=0;n<256;++n)i[Number.parseInt(n.toString(),10)]=n;for(var o=e.length,n=0,r=0;n<256;++n){var s=i[Number.parseInt(n.toString(),10)],r=r+s+e[n%o]&255;i[Number.parseInt(n.toString(),10)]=i[Number.parseInt(r.toString(),10)],i[Number.parseInt(r.toString(),10)]=s}return t._s=i,t}q$e(kBt,DBt=xBt),Object.defineProperty(kBt.prototype,"_mixCol",{get:function(){if(void 0===this._mixC){this._mixC=new Uint8Array(256);for(var e=0;e<256;e++)this._mixC[Number.parseInt(e.toString(),10)]=e<128?e<<1:e<<1^27}return this._mixC},enumerable:!0,configurable:!0}),kBt.prototype._decrypt=function(e,t){var i,n,o=new Uint8Array(16);o.set(e);for(var r=0,s=this._keySize;r<16;++r,++s)o[Number.parseInt(r.toString(),10)]^=t[Number.parseInt(s.toString(),10)];for(var a=this._cyclesOfRepetition-1;1<=a;--a){c=o[13],o[13]=o[9],o[9]=o[5],o[5]=o[1],o[1]=c,c=o[14],i=o[10],o[14]=o[6],o[10]=o[2],o[6]=c,o[2]=i,c=o[15],i=o[11],n=o[7],o[15]=o[3],o[11]=c,o[7]=i,o[3]=n;for(r=0;r<16;++r)o[Number.parseInt(r.toString(),10)]=this._inverseS[o[Number.parseInt(r.toString(),10)]];for(r=0,s=16*a;r<16;++r,++s)o[Number.parseInt(r.toString(),10)]^=t[Number.parseInt(s.toString(),10)];for(r=0;r<16;r+=4){var l=this._mix[o[Number.parseInt(r.toString(),10)]],h=this._mix[o[r+1]],d=this._mix[o[r+2]],p=this._mix[o[r+3]],c=l^h>>>8^h<<24^d>>>16^d<<16^p>>>24^p<<8;o[Number.parseInt(r.toString(),10)]=c>>>24&255,o[r+1]=c>>16&255,o[r+2]=c>>8&255,o[r+3]=255&c}}c=o[13],o[13]=o[9],o[9]=o[5],o[5]=o[1],o[1]=c,c=o[14],i=o[10],o[14]=o[6],o[10]=o[2],o[6]=c,o[2]=i,c=o[15],i=o[11],n=o[7],o[15]=o[3],o[11]=c,o[7]=i,o[3]=n;for(r=0;r<16;++r)o[Number.parseInt(r.toString(),10)]=this._inverseS[o[Number.parseInt(r.toString(),10)]],o[Number.parseInt(r.toString(),10)]^=t[Number.parseInt(r.toString(),10)];return o},kBt.prototype._encryptBlock=function(e,t){var i,n,o=this._s,r=new Uint8Array(16);r.set(e);for(var s=0;s<16;++s)r[Number.parseInt(s.toString(),10)]^=t[Number.parseInt(s.toString(),10)];for(var a=1;a<this._cyclesOfRepetition;a++){for(s=0;s<16;++s)r[Number.parseInt(s.toString(),10)]=o[r[Number.parseInt(s.toString(),10)]];n=r[1],r[1]=r[5],r[5]=r[9],r[9]=r[13],r[13]=n,n=r[2],i=r[6],r[2]=r[10],r[6]=r[14],r[10]=n,r[14]=i,n=r[3],i=r[7],c=r[11],r[3]=r[15],r[7]=n,r[11]=i,r[15]=c;for(s=0;s<16;s+=4){var l=r[s+0],h=r[s+1],d=r[s+2],p=r[s+3],c=l^h^d^p;r[s+0]^=c^this._mixCol[l^h],r[s+1]^=c^this._mixCol[h^d],r[s+2]^=c^this._mixCol[d^p],r[s+3]^=c^this._mixCol[p^l]}for(var s=0,u=16*a;s<16;++s,++u)r[Number.parseInt(s.toString(),10)]^=t[Number.parseInt(u.toString(),10)]}for(s=0;s<16;++s)r[Number.parseInt(s.toString(),10)]=o[r[Number.parseInt(s.toString(),10)]];n=r[1],r[1]=r[5],r[5]=r[9],r[9]=r[13],r[13]=n,n=r[2],i=r[6],r[2]=r[10],r[6]=r[14],r[10]=n,r[14]=i,n=r[3],i=r[7],c=r[11],r[3]=r[15],r[7]=n,r[11]=i,r[15]=c;for(s=0,u=this._keySize;s<16;++s,++u)r[Number.parseInt(s.toString(),10)]^=t[Number.parseInt(u.toString(),10)];return r},kBt.prototype._decryptBlockHelper=function(e,t){for(var i=e.length,n=this._buffer,o=this._position,r=[],s=this._iv,a=0;a<i;++a)if(n[Number.parseInt(o.toString(),10)]=e[Number.parseInt(a.toString(),10)],!(++o<16)){for(var l=this._decrypt(n,this._key),h=0;h<16;++h)l[Number.parseInt(h.toString(),10)]^=s[Number.parseInt(h.toString(),10)];s=n,r.push(l),n=new Uint8Array(16),o=0}if(this._buffer=n,this._bufferLength=o,this._iv=s,0===r.length)return new Uint8Array(0);var d=16*r.length;if(t){var p=r[r.length-1],c=p[15];if(c<=16){for(var a=15,u=16-c;u<=a;--a)if(p[Number.parseInt(a.toString(),10)]!==c){c=0;break}d-=c,r[r.length-1]=p.subarray(0,16-c)}}for(var g=new Uint8Array(d),a=0,h=0;a<r.length;++a,h+=16)g.set(r[Number.parseInt(a.toString(),10)],h);return g},kBt.prototype._decryptBlock=function(e,t,i){var n=e.length,o=this._buffer,r=this._position;if(i)this._iv=i;else{for(var s=0;r<16&&s<n;++s,++r)o[Number.parseInt(r.toString(),10)]=e[Number.parseInt(s.toString(),10)];if(r<16)return this._bufferLength=r,new Uint8Array(0);this._iv=o,e=e.subarray(16)}return this._buffer=new Uint8Array(16),this._bufferLength=0,this._decryptBlock=this._decryptBlockHelper,this._decryptBlock(e,t)},kBt.prototype._encrypt=function(e,t){var i=e.length,n=this._buffer,o=this._position,r=[];t=t||new Uint8Array(16);for(var s=0;s<i;++s)if(n[Number.parseInt(o.toString(),10)]=e[Number.parseInt(s.toString(),10)],!(++o<16)){for(var a=0;a<16;++a)n[Number.parseInt(a.toString(),10)]^=t[Number.parseInt(a.toString(),10)];var l=this._encryptBlock(n,this._key);r.push(t=l),n=new Uint8Array(16),o=0}if(this._buffer=n,this._bufferLength=o,this._iv=t,0===r.length)return new Uint8Array(0);for(var h=new Uint8Array(16*r.length),s=0,a=0;s<r.length;++s,a+=16)h.set(r[Number.parseInt(s.toString(),10)],a);return h};var DBt,MBt=kBt;function kBt(){var e=null!==DBt&&DBt.apply(this,arguments)||this;return e._buffer=new Uint8Array(16),e._position=0,e._s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),e._inverseS=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]),e._mix=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795]),e}q$e(FBt,PBt=MBt),FBt.prototype._expandKey=function(e){var t=this._s,i=this._key,n=new Uint8Array(176);n.set(e);for(var o=16,r=1;o<176;++r){var s=n[o-3],a=n[o-2],l=n[o-1],h=n[o-4],s=t[Number.parseInt(s.toString(),10)],a=t[Number.parseInt(a.toString(),10)],l=t[Number.parseInt(l.toString(),10)],h=t[Number.parseInt(h.toString(),10)];s^=i[Number.parseInt(r.toString(),10)];for(var d=0;d<4;++d)n[Number.parseInt(o.toString(),10)]=s^=n[o-16],n[o+1]=a^=n[o-15],n[o+2]=l^=n[o-14],n[o+3]=h^=n[o-13],o+=4}return n};var PBt,BBt=FBt;function FBt(e){var t=PBt.call(this)||this;return t._cyclesOfRepetition=10,t._keySize=160,t._key=new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141]),t._key=t._expandKey(e),t}q$e(OBt,LBt=MBt),OBt.prototype._expandKey=function(e){for(var t,i,n,o,r=this._s,s=new Uint8Array(240),a=(s.set(e),1),l=32;l<240;){l%32==16?(t=r[Number.parseInt(t.toString(),10)],i=r[Number.parseInt(i.toString(),10)],n=r[Number.parseInt(n.toString(),10)],o=r[Number.parseInt(o.toString(),10)]):l%32==0&&(t=s[l-3],i=s[l-2],n=s[l-1],o=s[l-4],t=r[Number.parseInt(t.toString(),10)],i=r[Number.parseInt(i.toString(),10)],n=r[Number.parseInt(n.toString(),10)],o=r[Number.parseInt(o.toString(),10)],t^=a,256<=(a<<=1))&&(a=255&(27^a));for(var h=0;h<4;++h)s[Number.parseInt(l.toString(),10)]=t^=s[l-32],s[l+1]=i^=s[l-31],s[l+2]=n^=s[l-30],s[l+3]=o^=s[l-29],l+=4}return s};var LBt,RBt=OBt;function OBt(e){var t=LBt.call(this)||this;return t._cyclesOfRepetition=14,t._keySize=224,t._key=t._expandKey(e),t}q$e(_Bt,NBt=xBt),_Bt.prototype._decryptBlock=function(e){return e},_Bt.prototype._encrypt=function(e){return e};var NBt,VBt=_Bt;function _Bt(){return null!==NBt&&NBt.apply(this,arguments)||this}zBt.prototype.createStream=function(e,t){return new WPt(e,t,this._streamCipher)},zBt.prototype.decryptString=function(e){e=yMt(e,!1,!0);return CMt(this._stringCipher._decryptBlock(e,!0))},zBt.prototype.encryptString=function(e){if(this._stringCipher instanceof MBt){var t=16-e.length%16,i=(e+=String.fromCharCode(t).repeat(t),new Uint8Array(16));if("undefined"!=typeof crypto)crypto.getRandomValues(i);else for(var n=0;n<16;n++)i[Number.parseInt(n.toString(),10)]=Math.floor(256*Math.random());var t=this._stringCipher._encrypt(yMt(e,!1,!0),i),o=new Uint8Array(16+t.length);return o.set(i),o.set(t,16),CMt(o)}return CMt(this._stringCipher._encrypt(yMt(e,!1,!0)))};var HBt=zBt;function zBt(e,t){this._stringCipher=e,this._streamCipher=t}var jBt="EOF",WBt=[1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],QBt=(UBt.prototype.nextChar=function(){return this.currentChar=this.stream.getByte()},UBt.prototype.peekChar=function(){return this.stream.peekByte()},UBt.prototype.getNumber=function(){var e=!1,t=0,i=0;if(45===(s=this.currentChar)?(i=-1,45===(s=this.nextChar())&&(s=this.nextChar())):43===s&&(i=1,s=this.nextChar()),10===s||13===s)for(;10===(s=this.nextChar())||13===s;);if(46===s&&(t=10,s=this.nextChar()),s<48||57<s){if(EMt(s)||-1===s){if(10===t&&0===i)return 0;if(0===t&&-1===i)return 0}throw new Mkt("Invalid number: "+String.fromCharCode(s)+" (charCode "+s+")")}for(var i=i||1,n=s-48,o=0,r=1,s=this.nextChar();0<=s;){if(48<=s&&s<=57){var a=s-48;e?o=10*o+a:(0!==t&&(t*=10),n=10*n+a)}else if(46===s){if(0!==t)break;t=1}else{if(45===s){s=this.nextChar();continue}if(69!==s&&101!==s)break;if(43===(s=this.peekChar())||45===s)r=45===s?-1:1,this.nextChar();else if(s<48||57<s)break;e=!0}s=this.nextChar()}return 0!==t&&(n/=t),e&&(n*=Math.pow(10,r*o)),i*n},UBt.prototype.getString=function(){for(var e=1,t=!1,i=this.stringBuffer,n=(i.length=0,this.nextChar());;){var o=!1;switch(0|n){case-1:t=!0;break;case 40:++e,i.push("(");break;case 41:0==--e?(this.nextChar(),t=!0):i.push(")");break;case 92:switch(n=this.nextChar()){case-1:t=!0;break;case 110:i.push("\n");break;case 114:i.push("\r");break;case 116:i.push("\t");break;case 98:i.push("\b");break;case 102:i.push("\f");break;case 92:case 40:case 41:i.push(String.fromCharCode(n));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:var r=15&n,o=!0;48<=(n=this.nextChar())&&n<=55&&(r=(r<<3)+(15&n),48<=(n=this.nextChar()))&&n<=55&&(o=!1,r=(r<<3)+(15&n)),i.push(String.fromCharCode(r));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:i.push(String.fromCharCode(n))}break;default:i.push(String.fromCharCode(n))}if(t)break;o||(n=this.nextChar())}return i.join("")},UBt.prototype.getName=function(){var e=this.stringBuffer;for(e.length=0,n=this.nextChar();0<=n&&!WBt[n];){if(35===n){if(n=this.nextChar(),WBt[n]){e.push("#");break}var t=this._toHexDigit(n);if(-1!==t){var i=n,n=this.nextChar(),o=this._toHexDigit(n);if(-1===o){if(e.push("#",String.fromCharCode(i)),WBt[n])break;e.push(String.fromCharCode(n)),n=this.nextChar();continue}e.push(String.fromCharCode(t<<4|o))}else e.push("#",String.fromCharCode(n))}else e.push(String.fromCharCode(n));n=this.nextChar()}return k.get(e.join(""))},UBt.prototype.getHexString=function(){var e,t,i=this.stringBuffer,n=(i.length=0,this.currentChar),o=!0;for(this._hexStringNumber=0;;){if(n<0)break;if(62===n){this.nextChar();break}if(1!==WBt[n]){if(o){if(-1===(e=this._toHexDigit(n))){n=this.nextChar();continue}}else{if(-1===(t=this._toHexDigit(n))){n=this.nextChar();continue}i.push(String.fromCharCode(e<<4|t))}o=!o}n=this.nextChar()}return i.join("")},UBt.prototype.getObject=function(){for(var e=!1,t=this.currentChar;;){if(t<0)return jBt;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(1!==WBt[t])break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:return this.nextChar(),rPt.get("[");case 93:return this.nextChar(),rPt.get("]");case 60:return 60===(t=this.nextChar())?(this.nextChar(),rPt.get("<<")):this.getHexString();case 62:return 62===(t=this.nextChar())?(this.nextChar(),rPt.get(">>")):rPt.get(">");case 123:return this.nextChar(),rPt.get("{");case 125:return this.nextChar(),rPt.get("}");case 41:throw this.nextChar(),new Mkt("Illegal character: "+t)}var i=String.fromCharCode(t);if(t<32||127<t){var n=this.peekChar();if(32<=n&&n<=127)return this.nextChar(),rPt.get(i)}for(t=this.nextChar();0<=t&&!WBt[t];){var o=i+String.fromCharCode(t);if(128===i.length)throw new Mkt("Command token too long: "+i.length);i=o,t=this.nextChar()}return"true"===i||"false"!==i&&("null"===i?null:("BI"===i&&(this.beginInlineImagePosition=this.stream.position),rPt.get(i)))},UBt.prototype.peekObj=function(){var e,t=this.stream.position,i=this.currentChar,n=this.beginInlineImagePosition;try{e=this.getObject()}catch(e){}return this.stream.position=t,this.currentChar=i,this.beginInlineImagePosition=n,e},UBt.prototype.skipToNextLine=function(){for(var e=this.currentChar;0<=e;){if(13===e){10===(e=this.nextChar())&&this.nextChar();break}if(10===e){this.nextChar();break}e=this.nextChar()}},UBt.prototype._toHexDigit=function(e){return 48<=e&&e<=57?15&e:65<=e&&e<=70||97<=e&&e<=102?9+(15&e):-1},UBt);function UBt(e){this.stream=e,this.nextChar(),this.stringBuffer=[],this._hexStringNumber=0,this.beginInlineImagePosition=-1}GBt.prototype.refill=function(){this.first=this.lexicalOperator.getObject(),this.second=this.lexicalOperator.getObject()},GBt.prototype.shift=function(){this.second instanceof rPt&&"ID"===this.second.command?(this.first=this.second,this.second=null):(this.first=this.second,this.second=this.lexicalOperator.getObject())},GBt.prototype.tryShift=function(){try{return this.shift(),!0}catch(e){return!1}},GBt.prototype.getObject=function(e,t,i){var n,o,r=this.first;if(this.shift(),r instanceof rPt)switch(r.command){case"BI":return"number"==typeof e&&"number"==typeof t?this.makeInlineImage(e,t,i):e instanceof HBt?this.makeInlineImage(e):this.makeInlineImage();case"[":for(var s=[];!wPt(this.first,"]")&&this.first!==jBt;){var a=void 0,a="number"==typeof e&&"number"==typeof t?(n=this._encryptor._createCipherTransform(e,t),this.getObject(e,t,i)):e instanceof HBt?this.getObject(n=e):this.getObject(e);0===s.length&&bPt(a,"Indexed")&&(this._isColorSpace=!0),a=Wkt(a,this._isColorSpace,this._isPassword),s.push(a)}if(this.first!==jBt)return this._isColorSpace=!1,this.shift(),s;if(this.recoveryMode)return s;throw new Bkt("End of file inside array.");case"<<":for(var l=new mPt(this.xref);!wPt(this.first,">>")&&this.first!==jBt;)if(this.first instanceof k){var h=this.first.name;if("U"!==h&&"O"!==h&&"ID"!==h||(this._isPassword=!0),this.shift(),this._checkEnd())break;"number"==typeof e&&"number"==typeof t&&(n=this._encryptor._createCipherTransform(e,t));var d=void 0;d=Wkt(d="number"==typeof e&&"number"==typeof t?this.getObject(e,t,i):e instanceof HBt?this.getObject(e):this.getObject(),this._isColorSpace,this._isPassword),this._isPassword=!1,l.set(h,d)}else this.shift();if(this.first!==jBt)return wPt(this.second,"stream")?!0===this.allowStreams?(e instanceof HBt?n=e:i&&"number"==typeof t&&(n=this._encryptor._createCipherTransform(e,t)),"boolean"==typeof t&&t?this.makeStream(l,n,t):this.makeStream(l,n)):l:(this.shift(),l);if(this.recoveryMode)return l;throw new Bkt("End of file inside dictionary.");default:return r}return Number.isInteger(r)?Number.isInteger(this.first)&&wPt(this.second,"R")?(o=aPt.get(r,this.first),this.shift(),this.shift(),o):r:"string"==typeof r&&(e instanceof HBt?n=e:"number"==typeof e&&"number"==typeof t&&(n=this._encryptor._createCipherTransform(e,t)),n)?n.decryptString(r):r},GBt.prototype.findDiscreteDecodeInlineStreamEnd=function(e){for(var t,i=e.position,n=!1,o=e.getByte();-1!==o;){if(255!==o);else{switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:n=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:2<(t=e.getUnsignedInteger16())?e.skip(t-2):e.skip(-2)}if(n)break}o=e.getByte()}i=e.position-i;return-1===o?(e.skip(-i),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),i)},GBt.prototype.findDecodeInlineStreamEnd=function(e){for(var t=e.position;-1!==(n=e.getByte());)if(126===n){for(var i=e.position,n=e.peekByte();EMt(n);)e.skip(),n=e.peekByte();if(62===n){e.skip();break}if(e.position>i){i=e.peekBytes(2);if(69===i[0]&&73===i[1])break}}t=e.position-t;return-1===n?(e.skip(-t),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),t)},GBt.prototype.findHexDecodeInlineStreamEnd=function(e){for(var t=e.position,i=e.getByte();-1!==i&&62!==i;)i=e.getByte();t=e.position-t;return-1===i?(e.skip(-t),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),t)},GBt.prototype.inlineStreamSkipEI=function(e){for(var t=0,i=e.getByte();-1!==i;){if(0===t)t=69===i?1:0;else if(1===t)t=73===i?2:0;else if(2===t)break;i=e.getByte()}},GBt.prototype.makeInlineImage=function(e,t,i){var n,o=this.lexicalOperator,r=o.stream,s=new mPt(this.xref);for(i&&(n=e instanceof HBt?e:this._encryptor._createCipherTransform(e,t));!wPt(this.first,"ID")&&this.first!==jBt;){if(!(this.first instanceof k))throw new Mkt("Dictionary key must be a name object");var a=this.first.name;if(this.shift(),this.first.name===jBt)break;e instanceof HBt?s.set(a,this.getObject(e)):s.set(a,this.getObject(e,t,i))}-1!==o.beginInlineImagePosition&&(c=r.position-o.beginInlineImagePosition);var l,h=s.get("F","Filter"),h=(h instanceof k?d=h.name:Array.isArray(h)&&(h=null!=(h=h[0])&&h instanceof aPt?this.xref._fetch(h):h)&&(d=h.name),r.position);switch(d){case"DCT":case"DCTDecode":l=this.findDiscreteDecodeInlineStreamEnd(r);break;case"A85":case"ASCII85Decode":l=this.findDecodeInlineStreamEnd(r);break;case"AHx":case"ASCIIHexDecode":l=this.findHexDecodeInlineStreamEnd(r);break;default:l=this.findDefaultInlineStreamEnd(r)}var d=r.makeSubStream(h,l,s);if(l<1e3&&c<5552){var h=d.getBytes(),p=(d.reset(),r.position),o=(r.position=o.beginInlineImagePosition,r.getBytes(c)),c=(r.position=p,p=this._computeMaxNumber(h)+"_"+this._computeMaxNumber(o),this.imageCache.get(p));if(void 0!==c)return this.second=rPt.get("EI"),this.shift(),c.reset(),c}return n&&(d=n.createStream(d,l)),(d=this.filter(d,s,l)).dictionary=s,void 0!==p&&this.imageCache.set(p,d),this.second=rPt.get("EI"),this.shift(),d},GBt.prototype._computeMaxNumber=function(e){for(var t=e.length,i=1,n=0,o=0;o<t;++o)n+=i+=255&e[o];return n%65521<<16|i%65521},GBt.prototype.makeStream=function(e,t,i){void 0===i&&(i=!1);var n=this.lexicalOperator,o=n.stream,r=(n.skipToNextLine(),o.position-1),s=e.get("Length");if(Number.isInteger(s)||(s=0),o.position=r+s,n.nextChar(),!this.tryShift()||!wPt(this.second,"endstream")){var a=new Uint8Array([101,110,100,115,116,114,101,97,109]),l=this._findStreamLength(r,a);if(l<0){var h=a.length-1,a=a.slice(0,h),a=this._findStreamLength(r,a);if((l=0<=a&&EMt(o.peekBytes(1+h)[h])?a:l)<0)throw new Mkt("Missing endstream command.")}s=l,n.nextChar(),this.shift()}return this.shift(),this.shift(),o=o.makeSubStream(r,s,e),i||(t&&(o=t.createStream(o,s)),o=this.filter(o,e,s)),o.dictionary=e,o},GBt.prototype.filter=function(e,t,i){var n=t.get("F","Filter"),o=t.get("DP","DecodeParms");if(n instanceof k)return this.makeFilter(e,n.name,i,o);if(Array.isArray(n)){t=n[0];if(t instanceof k)return this.makeFilter(e,t.name,i,o);if(t instanceof rPt)return this.makeFilter(e,t.command,i,o)}var r=i;if(Array.isArray(n))for(var s=n,a=o,l=0;l<s.length;++l){var h=s[Number.parseInt(l.toString(),10)];if(!((n=h instanceof aPt?this.xref._fetch(h):h)instanceof k||n instanceof rPt))throw new Mkt("Bad filter name '"+n+"'");o=null,Array.isArray(a)&&l in a&&(o=(h=a[Number.parseInt(l.toString(),10)])instanceof aPt?this.xref._fetch(h):h),n instanceof k?e=this.makeFilter(e,n.name,r,o):n instanceof rPt&&(e=this.makeFilter(e,n.command,r,o)),r=null}return e},GBt.prototype.makeFilter=function(e,t,i,n){if(0===i)return new PPt;try{return"Fl"===t||"FlateDecode"===t?n?new oBt(new ZPt(e,i),i,n):new ZPt(e,i):e}catch(e){return new PPt}},GBt.prototype._findStreamLength=function(e,t){for(var i=this.lexicalOperator.stream,n=(i.position=e,t.length);i.position<i.end;){var o=i.peekBytes(2048),r=o.length-n;if(r<=0)break;for(var s=0;s<r;){for(var a=0;a<n&&o[s+a]===t[a];)a++;if(n<=a)return i.position+=s,i.position-e;s++}i.position+=r}return-1},GBt.prototype.findDefaultInlineStreamEnd=function(e){for(var t=e.position,i=0,n=e.getByte();-1!==n;){if(0===i)i=69===n?1:0;else if(1===i)i=73===n?2:0;else{if(2!==i)throw new Error("findDefaultInlineStreamEnd - invalid state.");if(32===n||10===n||13===n){for(var o=e.position,r=e.peekBytes(10),s=0,a=r.length;s<a;s++)if((0!==(n=r[s])||0===r[s+1])&&10!==n&&13!==n&&(n<32||127<n)){i=0;break}if(2!==i){n=e.getByte();continue}if(2===i)break}else i=0}n=e.getByte()}-1===n&&void 0!==o&&e.skip(-(e.position-o));var l=4;return e.skip(-l),n=e.peekByte(),e.skip(l),EMt(n)||l--,e.position-l-t},GBt.prototype._checkEnd=function(){return this.first===jBt};var qBt=GBt;function GBt(e,t,i,n,o){void 0===i&&(i=!1),void 0===n&&(n=!1),this._isColorSpace=!1,this._isPassword=!1,this.lexicalOperator=e,this.xref=t,this.allowStreams=i,this.recoveryMode=n,this.imageCache=new Map,this._encryptor=o,this.refill()}XBt.prototype.getInt=function(e,t,i){void 0===i&&(i=!1);e=e.get(t);if(void 0!==e&&Number.isInteger(e)&&(i?0<=e:0<e))return e;throw new Error("The '"+t+"' parameter in the linearization dictionary is invalid.")},XBt.prototype.getHints=function(e){var t=e.getArray("H"),i=t.length;if(!t||2!==i&&4!==i)throw new Error("Hint array in the linearization dictionary is invalid.");for(var n=0;n<i;n++){var o=t[n];if(!(Number.isInteger(o)&&0<o))throw new Error("Hint ("+n+") in the linearization dictionary is invalid.")}return t};var YBt=XBt;function XBt(e){this.isValid=!1;var t=new qBt(new QBt(e),null),i=t.getObject(),n=t.getObject(),o=t.getObject(),t=t.getObject();if(this.isValid=Number.isInteger(i)&&Number.isInteger(n)&&wPt(o,"obj")&&void 0!==t,this.isValid&&(i=t.get("Linearized"),this.isValid=void 0!==i&&0<i),this.isValid){n=this.getInt(t,"L");if(n!==e.length)throw new Error("The L parameter in the linearization dictionary does not equal the stream length.");this.length=n,this.hints=this.getHints(t),this.objectNumberFirst=this.getInt(t,"O"),this.endFirst=this.getInt(t,"E"),this.pageCount=this.getInt(t,"N"),this.mainXRefEntriesOffset=this.getInt(t,"T"),this.pageFirst=t.has("P")?this.getInt(t,"P",!0):0}}JBt.prototype._setStartXRef=function(e){this._startXRefQueue=[e],this._prevStartXref=e,void 0!==this._prevXRefOffset&&null!==this._prevXRefOffset||(this._prevXRefOffset=e)},JBt.prototype._parse=function(e){var t,i=e?this._indexObjects():this._readXRef(),n=(i.assignXref(this),i.get("Size")),n=(this._entries.length<n||this._entries.length===n?this._nextReferenceNumber=n:this._entries.length>n&&(this._nextReferenceNumber=0<this._entries.length?this._entries.length:1),(this._trailer=i).get("Encrypt")),o=(n&&(this._document._isEncrypted=!0,this._ids=i.get("ID"),this._permissionFlags=n.get("P"),o=this._ids&&this._ids.length?this._ids[0]:"",n.suppressEncryption=!0,this._encrypt=new aBt(n,o,this._password),this._document._isUserPassword=this._encrypt._isUserPassword,this._document._encryptOnlyAttachment=this._encrypt._encryptOnlyAttachment,this._document.fileStructure.isIncrementalUpdate?this._document.fileStructure.crossReferenceType=EAt.stream:this._document.fileStructure.crossReferenceType=EAt.table,this._encrypt._encryptOnlyAttachment?(this._document._hasUserPasswordOnly=!0,this._document._encryptMetaData=!1):(this._document._hasUserPasswordOnly=this._encrypt._hasUserPasswordOnly,this._document._encryptMetaData=!n.has("EncryptMetadata")||n.get("EncryptMetadata"))),!1);try{t=i.get("Root")}catch(e){throw new Dkt("Invalid cross reference","XRefParseException")}if(t)try{t.get("Pages")&&(this._root=t,o=!0)}catch(e){throw new Dkt("Invalid cross reference","InvalidXRef")}if(!o)throw new Dkt("Invalid cross reference",e?"InvalidXRef":"XRefParseException")},JBt.prototype._getEntry=function(e){e=this._entries[e];return e&&!e.free&&e.offset?e:null},JBt.prototype._fetch=function(t,e){var i;if(!(t instanceof aPt))throw new Error("ref object is not a reference");var n=t.objectNumber,o=this._cacheMap.get(t);if(void 0!==o)return o instanceof mPt&&!o.objId&&(o.objId=n),o;o=this._getEntry(n);if(null===o)return this._cacheMap.set(t,o),o;if(this._pendingRefs.has(t))throw this._pendingRefs.remove(t),new Error("circular reference");this._pendingRefs.put(t);try{i=o.uncompressed?this._fetchUncompressed(t,o,e):this._fetchCompressed(t,o),this._pendingRefs.remove(t)}catch(e){throw this._pendingRefs.remove(t),e}return i},JBt.prototype._fetchUncompressed=function(e,t,i){var n=e.generationNumber,o=e.objectNumber;if(t.gen!==n)throw new Dkt("Inconsistent generation in XRef: "+e,"XRefEntryException");var t=this._stream.makeSubStream(t.offset+this._stream.start,void 0),t=new qBt(new QBt(t),this,!0,!1,this._encrypt),r=t.getObject(),s=t.getObject(),a=t.getObject();if(r!==o||s!==n||void 0===a)throw new Dkt("Bad (uncompressed) XRef entry: "+e,"XRefEntryException");return(r=this._encrypt&&!i?t.getObject(e.objectNumber,e.generationNumber,!0):t.getObject(null,i))instanceof SPt||this._cacheMap.set(e,r),r instanceof mPt?r.objId=e.toString():r instanceof SPt&&(r.dictionary.objId=e.toString()),r},JBt.prototype._fetchCompressed=function(e,t){var i=t.offset,n=this._fetch(aPt.get(i,0));if(void 0===n)throw new Mkt("bad ObjStm stream");var o=n.dictionary.get("First"),r=n.dictionary.get("N"),s=e.generationNumber;if(!Number.isInteger(o)||!Number.isInteger(r))throw new Mkt("invalid first and n parameters for ObjStm stream");for(var a=new qBt(new QBt(n),this,!0),l=new Array(r),h=new Array(r),d=0;d<r;++d){var p=a.getObject();if(!Number.isInteger(p))throw new Mkt("invalid object number in the ObjStm stream: "+p);var c=a.getObject();if(!Number.isInteger(c))throw new Mkt("invalid object offset in the ObjStm stream: "+c);l[d]=p,h[d]=c}for(var u=(n.start||0)+o,g=new Array(r),d=0;d<r;++d){var m=d<r-1?h[d+1]-h[d]:void 0;if(m<0)throw new Mkt("Invalid offset in the ObjStm stream.");var f,m=(a=new qBt(new QBt(n.makeSubStream(u+h[d],m,n.dictionary)),this,!0)).getObject();(g[d]=m)instanceof SPt||(p=l[d],(f=this._entries[p])&&f.offset===i&&f.gen===d&&(f=p+" "+s,this._cacheMap.set(aPt.get(p,s),m),m instanceof mPt)&&(m.objId=f))}o=g[t.gen];if(void 0===o)throw new Dkt("Bad (compressed) XRef entry: "+e,"XRefEntryException");return o},JBt.prototype._readXRef=function(e){void 0===e&&(e=!1);var t=this._stream,i=new Set;try{for(;this._startXRefQueue.length;){var n=this._startXRefQueue[0];if(this._prevStartXref<n&&(this._prevStartXref=n),i.has(n));else{i.add(n),t.position=n+t.start;var o,r=new qBt(new QBt(t),this,!0),s=r.getObject(),a=void 0;if(wPt(s,"xref"))void 0===this._document._fileStructure._crossReferenceType&&(this._document._fileStructure._crossReferenceType=EAt.table),a=this._processXRefTable(r),this._topDictionary||(this._topDictionary=a),s=a.get("XRefStm"),!Number.isInteger(s)||(o=s)in this._crossReferencePosition||(this._crossReferencePosition[o]=1,this._startXRefQueue.push(o));else{if(!Number.isInteger(s))throw new Mkt("Invalid XRef stream header");void 0===this._document._fileStructure._crossReferenceType&&(this._document._fileStructure._crossReferenceType=EAt.stream);var l=r.getObject(),h=r.getObject(),s=r.getObject();if(!(void 0!==l&&Number.isInteger(l)&&wPt(h,"obj")&&s instanceof SPt))throw new Mkt("Invalid cross reference stream");if(a=this._processXRefStream(s),this._topDictionary||(this._topDictionary=a),!a)throw new Mkt("Failed to read XRef stream")}s=a.get("Prev"),Number.isInteger(s)?this._startXRefQueue.push(s):s instanceof aPt&&this._startXRefQueue.push(s.objectNumber)}this._startXRefQueue.shift()}return this._topDictionary}catch(e){this._startXRefQueue.shift()}if(!e)throw new Dkt("Invalid cross reference","XRefParseException")},JBt.prototype._readToken=function(e,t){for(var i="",n=e[t];10!==n&&13!==n&&60!==n&&!(++t>=e.length);)i+=String.fromCharCode(n),n=e[t];return i},JBt.prototype._skipUntil=function(e,t,i){for(var n=i.length,o=e.length,r=0;t<o;){for(var s=0;s<n&&e[t+s]===i[s];)++s;if(n<=s)break;t++,r++}return r},JBt.prototype._indexObjects=function(){for(var e=/^(\d+)\s+(\d+)\s+obj\b/,t=/\bendobj[\b\s]$/,i=/\s+(\d+\s+\d+\s+obj[\b\s<])$/,n=new Uint8Array([116,114,97,105,108,101,114]),o=new Uint8Array([115,116,97,114,116,120,114,101,102]),r=new Uint8Array([111,98,106]),s=new Uint8Array([47,88,82,101,102]),a=(this._entries.length=0,this._cacheMap.clear(),this._stream),l=(a.position=0,a.getBytes()),h=l.length,d=a.start,p=[],c=[];d<h;){var u=l[d];if(9===u||10===u||13===u||32===u)++d;else if(37===u)for(;!(h<=++d)&&10!==(u=l[d])&&13!==u;);else{var g=this._readToken(l,d);if(g.startsWith("xref")&&(4===g.length||/\s/.test(g[4])))d+=this._skipUntil(l,d,n),p.push(d),d+=this._skipUntil(l,d,o);else if(f=e.exec(g)){var m=0|Number.parseInt(f[1]),f=0|Number.parseInt(f[2]),y=void 0,v=d+g.length,b=!1;if(this._entries[m]){if(this._entries[m].gen===f)try{var w=a.makeSubStream(v,a.length-v),C=new QBt(w);(T=new qBt(C,null)).getObject(),b=!0}catch(e){b=!(e instanceof Bkt)}}else b=!0;for(b&&((b=new ZBt).offset=d-a.start,b.gen=f,b.uncompressed=!0,this._entries[m]=b);v<l.length;){var S=v+this._skipUntil(l,v,r)+4,y=S-d,A=Math.max(S-25,v),A=CMt(l.subarray(A,S));if(t.test(A))break;A=i.exec(A);if(A&&A[1]){y-=A[1].length;break}v=S}f=l.subarray(d,d+y),m=this._skipUntil(f,0,s);m<y&&f[m+5]<64&&(c.push(d-a.start),this._crossReferencePosition[d-a.start]=1),d+=y}else g.startsWith("trailer")&&(7===g.length||/\s/.test(g[7]))?(p.push(d),d+=this._skipUntil(l,d,o)):d+=g.length+1}}for(var x,I=0;I<c.length;++I)this._startXRefQueue.push(c[I]),this._readXRef(!0);for(var T,I=0;I<p.length;++I)if(a.position=p[I],wPt((T=new qBt(new QBt(a),this,!0,!0)).getObject(),"trailer")){var E=T.getObject();if(E instanceof mPt){try{var D=E.get("Root");if(!(D instanceof mPt))continue;var M=D.get("Pages");if(!(M instanceof mPt))continue;var k=M.get("Count");if(void 0===k||!Number.isInteger(k))continue}catch(e){continue}if(E.has("ID"))return E;x=E}}if(x)return x;if(this._topDictionary)return this._topDictionary;throw new Dkt("Invalid PDF structure.","InvalidPDFException")},JBt.prototype._processXRefTable=function(e){if(void 0===this._tableState&&((i=new $Bt).entryNum=0,i.streamPos=e.lexicalOperator.stream.position,i.parserBuf1=e.first,i.parserBuf2=e.second,this._tableState=i),!wPt(this._readXRefTable(e),"trailer"))throw new Mkt("Invalid XRef table: could not find trailer dictionary");var t,i=e.getObject();if(i&&(i instanceof mPt?t=i:i instanceof SPt&&i.dictionary&&(t=i.dictionary)),t)return this._tableState=void 0,t;throw new Mkt("Invalid cross reference: could not parse trailer dictionary")},JBt.prototype._readXRefTable=function(e){var t,i=e.lexicalOperator.stream;for(i.position=this._tableState.streamPos,e.first=this._tableState.parserBuf1,e.second=this._tableState.parserBuf2;;){if(void 0===this._tableState.firstEntryNum||void 0===this._tableState.entryCount){if(wPt(t=e.getObject(),"trailer"))break;this._tableState.firstEntryNum=t,this._tableState.entryCount=e.getObject()}var n=this._tableState.firstEntryNum,o=this._tableState.entryCount;if(!Number.isInteger(n)||!Number.isInteger(o))throw new Mkt("Invalid cross reference: wrong types in subsection header");for(var r=this._tableState.entryNum;r<o;r++){this._tableState.streamPos=i.position,this._tableState.entryNum=r,this._tableState.parserBuf1=e.first,this._tableState.parserBuf2=e.second;var s=new ZBt,a=(s.offset=e.getObject(),s.gen=e.getObject(),e.getObject());if(a)switch(a.command){case"f":s.free=!0;break;case"n":s.uncompressed=!0}if(!Number.isInteger(s.offset)||!Number.isInteger(s.gen)||!s.free&&!s.uncompressed)throw new Mkt("Invalid entry in cross reference subsection: "+n+", "+o);0===r&&s.free&&1===n&&(n=0),this._entries[r+n]||(this._entries[r+n]=s)}this._tableState.entryNum=0,this._tableState.streamPos=i.position,this._tableState.parserBuf1=e.first,this._tableState.parserBuf2=e.second,this._tableState.firstEntryNum=void 0,this._tableState.entryCount=void 0}if(this._entries[0]&&!this._entries[0].free)throw new Mkt("Invalid XRef table: unexpected first object");return t},JBt.prototype._processXRefStream=function(e){var t,i,n;return void 0===this._streamState&&(t=e.dictionary,i=new eFt,n=(n=t.getArray("Index"))||[0,t.get("Size")],i.entryRanges=n,i.byteWidths=t.getArray("W"),i.entryNum=0,i.streamPos=e.position,this._streamState=i),this._readXRefStream(e),this._streamState=void 0,e.dictionary},JBt.prototype._readXRefStream=function(e){e.position=this._streamState.streamPos;for(var t=this._streamState.byteWidths[0],i=this._streamState.byteWidths[1],n=this._streamState.byteWidths[2],o=this._streamState.entryRanges;0<o.length;){var r=o[0],s=o[1];if(!Number.isInteger(r)||!Number.isInteger(s))throw new Mkt("Invalid XRef range fields: "+r+", "+s);if(!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(n))throw new Mkt("Invalid XRef entry fields length: "+r+", "+s);for(var a=this._streamState.entryNum;a<s;++a){this._streamState.entryNum=a,this._streamState.streamPos=e.position;for(var l=0,h=0,d=0,p=0;p<t;++p){var c=e.getByte();if(-1===c)throw new Mkt("invalid cross reference byte width type.");l=l<<8|c}0===t&&(l=1);for(p=0;p<i;++p){var u=e.getByte();if(-1===u)throw new Mkt("invalid cross reference byte width offset.");h=h<<8|u}for(p=0;p<n;++p){var g=e.getByte();if(-1===g)throw new Mkt("invalid cross reference byte width generation.");d=d<<8|g}var m=new ZBt;switch(m.offset=h,m.gen=d,l){case 0:m.free=!0;break;case 1:m.uncompressed=!0;break;case 2:break;default:throw new Mkt("Invalid XRef entry type: "+l)}this._entries[r+a]||(this._entries[r+a]=m)}this._streamState.entryNum=0,this._streamState.streamPos=e.position,o.splice(0,2)}},JBt.prototype._getCatalogObj=function(){return this._root},JBt.prototype._save=function(){var e,t,i=[37,80,68,70,45];return this._writeString(""+this._version+this._newLine,i),i.push(37,131,146,250,254),this._writeString(this._newLine,i),this._document.fileStructure.isIncrementalUpdate?(this._currentLength=this._stream.length,this._writeString(""+this._version+this._newLine,e=[37,80,68,70,45]),e.push(37,131,146,250,254),this._writeString(this._newLine,e),this._document._fileStructure._crossReferenceType===EAt.stream?this._saveAsStream(this._currentLength,e):this._saveAsTable(this._currentLength,e),(t=new Uint8Array(this._stream.length+e.length)).set(this._stream.bytes),t.set(e,this._stream.length)):(this._currentLength=0,e=new nFt(this),this._writeObjectCollection(e._mainObjectCollection,i),e=new IPt(i),this._stream=e,this._document._stream=e,(t=new Uint8Array(this._stream.length)).set(this._stream.bytes),t.set(i,0)),t},JBt.prototype._saveAsStream=function(n,o){var r=this,s=new Map;this._indexes=[],this._indexes.push(0,1),this._offsets=[],this._cacheMap.forEach(function(e,t){var i;(i=e instanceof SPt?e.dictionary:i)&&i._updated&&(!i.isCatalog||r._allowCatalog)&&(i=void 0,r._encrypt&&(i=r._encrypt._createCipherTransform(t.objectNumber,t.generationNumber)),r._updatedDictionary(n,t,o,e,i))}),this._cacheMap.forEach(function(e,t){var i;e instanceof mPt?!e._updated||e.isCatalog&&!r._allowCatalog||r._writeArchiveStream(s,t,e):e instanceof SPt&&(i=e.dictionary)&&i._updated&&(!i.isCatalog||r._allowCatalog)&&r._updatedDictionary(n,t,o,e)}),this._objectStream=void 0,this._objectStreamCollection=s,this._writeXrefStream(o)},JBt.prototype._updatedDictionary=function(e,t,i,n,o){this._indexes.push(t.objectNumber,1),this._offsets.push(e+i.length),this._writeObject(n,i,t,o),n._updated=!1},JBt.prototype._writeXrefStream=function(n){var o=this,r=(this._objectStreamCollection.forEach(function(e,t){e._save(n,o._currentLength);for(var i=0;i<e._collection.length;i++)o._indexes.push(e._collection[Number.parseInt(i.toString(),10)]);o._indexes.push(t.objectNumber,1)}),Math.max(Qkt(this._currentLength+n.length),Qkt(this._nextReferenceNumber))),e=this._getNextReference(),t=(this._indexes.push(e.objectNumber,1),this._currentLength+n.length),i=new mPt(this),s=(i.set("Type",k.get("XRef")),i.set("Index",this._indexes),i.set("W",[1,r,1]),this._copyTrailer(i),this._ids&&0<this._ids.length&&i.update("ID",[this._ids[0],this._computeMessageDigest(t)]),[]);if(this._writeLong(0,1,s),this._writeLong(0,r,s),this._writeLong(-1,1,s),0<this._offsets.length)for(var a=0;a<this._offsets.length;a++)this._writeLong(1,1,s),this._writeLong(this._offsets[a],r,s),this._writeLong(0,1,s);0<this._objectStreamCollection.size&&this._objectStreamCollection.forEach(function(e,t){for(var i=0;i<e._length;i++)o._writeLong(2,1,s),o._writeLong(t.objectNumber,r,s),o._writeLong(i,1,s);o._writeLong(1,1,s),o._writeLong(e._archiveOffset,r,s),o._writeLong(0,1,s)}),this._writeLong(1,1,s),this._writeLong(t,r,s),this._writeLong(0,1,s),i.set("Length",s.length);var l,i=new IPt(s,i,0,s.length);this._encrypt&&(l=this._encrypt._createCipherTransform(e.objectNumber,e.generationNumber)),this._writeObject(i,n,e,l,!0),this._writeString("startxref"+this._newLine+t+this._newLine+"%%EOF"+this._newLine,n)},JBt.prototype._saveAsTable=function(o,r){var s=this,a="",e=(this._cacheMap.forEach(function(e,t){var i,n;e instanceof mPt?i=e:e instanceof SPt&&(i=e.dictionary),i&&i._updated&&(!i.isCatalog||s._allowCatalog)&&(i=s._processString((o+r.length).toString(),10),n=s._processString(t.generationNumber.toString(),5),a+=t.objectNumber+" 1"+s._newLine+i+" "+n+" n"+s._newLine,s._writeObject(e,r,t))}),r.length+o);this._writeString("xref"+this._newLine+"0 1"+this._newLine+"0000000000 65535 f"+this._newLine,r),this._writeXref(r,a,e)},JBt.prototype._writeXref=function(e,t,i){this._writeString(t,e),this._writeString("trailer"+this._newLine,e);t=new mPt(this);this._copyTrailer(t),this._writeDictionary(t,e,this._newLine),this._writeString("startxref"+this._newLine+i+this._newLine+"%%EOF"+this._newLine,e)},JBt.prototype._writeXrefTable=function(e){var n=this,o="",t=this._getSortedReferences(this._offsetReference),i=(t.forEach(function(e,t){var i=n._processString(e.toString(),10),t=n._processString(t.generationNumber?"0":"",5);o+=0!==e?i+" "+t+" n"+n._newLine:i+" "+t+" f"+n._newLine}),e.length),r="xref"+this._newLine,t="0 "+(t.size+1)+this._newLine,s="0000000000 65535 f"+this._newLine;this._writeString(r+t+s,e),this._writeXref(e,o,i)},JBt.prototype._processString=function(e,t){for(;e.length<t;)e="0"+e;return e},JBt.prototype._copyTrailer=function(e){var t=this._getNextReference(),t=(e.set("Size",t.objectNumber),this._document.fileStructure.isIncrementalUpdate&&e.set("Prev",this._prevXRefOffset),this._trailer.getRaw("Root")),t=(null!=t&&e.set("Root",t),this._trailer.getRaw("Info")),t=(null!=t&&e.set("Info",t),this._trailer.getRaw("Encrypt"));null!=t&&e.set("Encrypt",t)},JBt.prototype._computeMessageDigest=function(e){var t=this,i=[Math.floor(Date.now()/1e3).toString(),"",e.toString()],e=this._trailer.getRaw("Info"),n=new mPt,o=(e&&e instanceof mPt&&e.forEach(function(e,t){t&&"string"==typeof t&&n.set(e,fMt(t))}),n.forEach(function(e,t){i.push(t)}),[]);return i.forEach(function(e){t._writeString(e,o)}),CMt((new hBt).hash(new Uint8Array(o)))},JBt.prototype._getNextReference=function(){var e=new aPt(this._nextReferenceNumber++,0);return e._isNew=!0,e},JBt.prototype._writeObject=function(i,n,e,o,r){var s=this;e&&e instanceof aPt&&this._writeString(e.objectNumber+" "+e.generationNumber+" obj"+this._newLine,n),i instanceof mPt?this._writeDictionary(i,n,this._newLine,o,r):i instanceof SPt?this._writeStream(i,n,o,r):Array.isArray(i)&&0<i.length?(this._writeString("[ ",n),i.forEach(function(e,t){e instanceof aPt?s._writeString(e.objectNumber+" "+e.generationNumber+" R",n):Array.isArray(e)?(s._writeString("[ ",n),e.forEach(function(e){e instanceof aPt?s._writeString(e.objectNumber+" "+e.generationNumber+" R",n):e instanceof k?s._writeString("/"+e.name,n):s._writeString(e+" ",n)}),s._writeString("]",n)):e instanceof k?s._writeString("/"+e.name,n):e instanceof mPt?s._writeDictionary(e,n,s._newLine,o,r):s._writeString(e+"\n",n),t<i.length-1&&s._writeString(" ",n)}),this._writeString("]",n),this._writeString("\n",n)):"number"==typeof i&&this._writeString(i+"\n",n),e&&e instanceof aPt&&this._writeString("endobj"+this._newLine,n)},JBt.prototype._writeDictionary=function(e,i,n,o,r){var s=this;e._currentObj&&e._currentObj._beginSave(),e._isFont&&this._writeFontDictionary(e),this._writeString("<<"+n,i),e.forEach(function(e,t){s._writeString("/"+KMt(e)+" ",i),s._writeValue(t,i,o,r),s._writeString(n,i)}),this._writeString(">>"+this._newLine,i)},JBt.prototype._writeFontDictionary=function(e){var t,i;e.has("DescendantFonts")&&(t=e.get("DescendantFonts"),i=this._getNextReference(),this._cacheMap.set(i,t),e.update("DescendantFonts",[i])),e.has("ToUnicode")&&(t=e.get("ToUnicode"),i=this._getNextReference(),this._cacheMap.set(i,t),e.update("ToUnicode",i)),e.has("FontFile2")&&(t=e.get("FontFile2"),i=this._getNextReference(),this._cacheMap.set(i,t),e.update("FontFile2",i)),e.has("FontDescriptor")&&(t=e.get("FontDescriptor"),i=this._getNextReference(),this._cacheMap.set(i,t),e.update("FontDescriptor",i))},JBt.prototype._writeStream=function(e,t,i,n){var o,r=[];n?o=e.getString():(o=e._isCompress&&!e._isImage?Jkt(e):e.getString(),i&&(o=i.encryptString(o))),this._writeString(o,r),e.dictionary.update("Length",r.length),this._writeDictionary(e.dictionary,t,this._newLine,i,n),this._writeString("stream"+this._newLine,t),this._writeBytes(r,t),this._writeString(this._newLine+"endstream"+this._newLine,t)},JBt.prototype._writeValue=function(e,t,i,n){if(e instanceof k)-1!==e.name.indexOf(" ")&&(e.name=e.name.replace(/ /g,"#20")),this._writeString("/"+e.name,t);else if(e instanceof aPt)this._writeString(e.toString()+" R",t);else if(Array.isArray(e)){this._writeString("[",t);for(var o=!0,r=0,s=e;r<s.length;r++){var a=s[r];o?o=!1:this._writeString(" ",t),this._writeValue(a,t,i,n)}this._writeString("]",t)}else if("string"==typeof e){!n&&i&&(e=i.encryptString(e));for(var l=!1,h=0;h<e.length;h++)if(255<e.charCodeAt([h])){l=!0;break}l?this._writeUnicodeString(e,t):this._writeString("("+this._escapeString(e)+")",t)}else"number"==typeof e?this._writeString(bMt(e),t):"boolean"==typeof e?this._writeString(e.toString(),t):e instanceof mPt?this._writeDictionary(e,t,this._newLine,i,n):e instanceof SPt?this._writeStream(e,t,i,n):null===e&&this._writeString("null",t)},JBt.prototype._writeUnicodeString=function(e,t){for(var i=Ukt(e),n=(i.unshift(254,255),[]),o=0;o<i.length;o++){var r=i[Number.parseInt(o.toString(),10)];switch(r){case 40:case 41:n.push(92),n.push(r);break;case 13:n.push(92),n.push(114);break;case 92:n.push(92),n.push(r);break;default:n.push(r)}}t.push(255&"(".charCodeAt(0));for(o=0;o<n.length;o++)t.push(255&n[Number.parseInt(o.toString(),10)]);t.push(255&")".charCodeAt(0))},JBt.prototype._writeString=function(e,t){for(var i=0;i<e.length;i++)t.push(255&e.charCodeAt(i))},JBt.prototype._writeBytes=function(e,t){for(var i=0;i<e.length;i++)t.push(e[i])},JBt.prototype._writeLong=function(e,t,i){for(var n=t-1;0<=n;--n)i.push(e>>(n<<3)&255)},JBt.prototype._escapeString=function(e){return e.replace(/([()\\\n\r])/g,function(e){return"\n"===e?"\\n":"\r"===e?"\\r":"\\"+e})},JBt.prototype._destroy=function(){this._entries=void 0,this._pendingRefs&&(this._pendingRefs.clear(),this._pendingRefs=void 0),this._cacheMap&&this._cacheMap.clear(),this._offsetReference&&this._offsetReference.clear(),this._objectStreamCollection&&this._objectStreamCollection.clear(),this._offsets=[],this._startXRefQueue=[],this._root=void 0,this._startXRefQueue=void 0,this._stream=void 0,this._streamState=void 0,this._tableState=void 0,this._topDictionary=void 0,this._trailer=void 0,this._version=void 0,this._crossReferencePosition=void 0},JBt.prototype._writeObjectCollection=function(i,n){var o=this,r=new Map;this._indexes=[],this._indexes.push(0,1),i.forEach(function(e,t){o._writeObjectToBuffer(t,e,n,r)}),this._cacheMap.size>i.size&&this._cacheMap.forEach(function(e,t){i.has(t)||o._writeObjectToBuffer(t,e,n,r)}),this._document.fileStructure._crossReferenceType===EAt.stream?(this._objectStream=void 0,this._objectStreamCollection=r,this._writeXrefStream(n)):this._writeXrefTable(n)},JBt.prototype._writeArchiveStream=function(e,t,i){var n;void 0!==this._objectStream&&100!==this._objectStream._length||(n=new tFt(this),e.set(n._reference,n),this._objectStream=n),this._objectStream._writeObject(t,i)},JBt.prototype._writeObjectToBuffer=function(e,t,i,n){var o;if(t instanceof mPt&&t.isCatalog)this._writeToBuffer(i,e,t);else if(t instanceof mPt){var r=t.get("Filter"),r=r&&"Standard"===r.name;this._document.fileStructure._crossReferenceType===EAt.stream?r?this._writeToBuffer(i,e,t):this._writeArchiveStream(n,e,t):(this._offsetReference.set(e,i.length),this._indexes.push(e.objectNumber,1),this._writeObject(t,i,e))}else{if(t instanceof SPt){r=t.dictionary;r&&r._updated&&!r.isCatalog&&(this._encrypt&&(o=this._encrypt._createCipherTransform(e.objectNumber,e.generationNumber)),r._updated=!1)}else if((!Array.isArray(t)||0===t.length)&&"number"!=typeof t)return;this._writeToBuffer(i,e,t,o)}},JBt.prototype._writeToBuffer=function(e,t,i,n){this._offsets.push(e.length),this._offsetReference.set(t,e.length),this._indexes.push(t.objectNumber,1),this._writeObject(i,e,t,n)},JBt.prototype._getSortedReferences=function(e){for(var i=[],t=(e.forEach(function(e,t){i.push([t,e])}),i.sort(function(e,t){return e[0].objectNumber-t[0].objectNumber}),new Map),n=1,o=0,r=i;o<r.length;o++){for(var s=r[o],a=s[0],s=s[1],l=a.objectNumber;n<l;)t.set({objectNumber:n},0),n++;t.set(a,s),n=l+1}return t};var KBt=JBt;function JBt(e,t){this._version="",this._newLine="\r\n",this._password=t,this._document=e,this._stream=e._stream,this._entries=[],this._crossReferencePosition=Object.create(null),this._cacheMap=new Map,this._offsetReference=new Map,this._pendingRefs=new hPt,this._offsets=[]}var ZBt=function(){},$Bt=function(){},eFt=function(){},tFt=(iFt.prototype._writeObject=function(e,t){this._archiveXRef+=e.objectNumber+" "+this._updatedStream.length+this._crossReference._newLine,this._collection.push(e.objectNumber,1),this._crossReference._writeObject(t,this._updatedStream),this._length++},iFt.prototype._save=function(e,t){var i,n=[],o=(this._crossReference._writeString(this._archiveXRef,n),this._crossReference._writeBytes(this._updatedStream,n),new mPt(this._crossReference)),o=(o.set("Type",k.get("ObjStm")),o.set("N",this._length),o.set("First",this._archiveXRef.length),o.set("Length",n.length),new IPt(n,o,0,n.length));this._archiveOffset=t+e.length,this._crossReference._encrypt&&(i=this._crossReference._encrypt._createCipherTransform(this._reference.objectNumber,this._reference.generationNumber)),this._crossReference._writeObject(o,e,this._reference,i)},iFt);function iFt(e){this._indexes="",this._length=0,this._crossReference=e,this._reference=e._getNextReference(),this._archiveXRef="",this._updatedStream=[],this._collection=[]}oFt.prototype._parseObjectCollection=function(){for(var o=this,e=this;this._pointer<this._mainObjectCollection.size;)!function(){var i=new Map,n=0;e._mainObjectCollection.forEach(function(e,t){n===o._pointer&&(i.set(t,e),o._parse(t,e)),n++}),e._pointer++}();return this._addReferencesToMainCollection(),this._mainObjectCollection},oFt.prototype._addToMainObjectCollection=function(e,t){this._reference.push(e),this._mainObjectCollection.set(e,t)},oFt.prototype._parseFetchValue=function(e){var t=this._crossReference._fetch(e);this._parse(e,t)},oFt.prototype._parse=function(e,t){var i=this;t instanceof mPt?this._parseDictionary(t):t instanceof SPt?this._parseStream(e,t):t instanceof aPt?this._parseFetchValue(t):Array.isArray(t)&&0<t.length?t.every(function(e){return e instanceof aPt})?t.forEach(function(e){return i._parseFetchValue(e)}):(t.forEach(function(e){e instanceof aPt&&i._parseFetchValue(e)}),-1!==this._reference.indexOf(e)||this._mainObjectCollection.has(e)||this._addToMainObjectCollection(e,t)):"number"!=typeof t||-1!==this._reference.indexOf(e)||this._mainObjectCollection.has(e)||this._addToMainObjectCollection(e,t)},oFt.prototype._addReferencesToMainCollection=function(){var i=this,n=[];this._cache.forEach(function(e,t){i._mainObjectCollection.has(t)||n.push({key:t,value:e})}),n.forEach(function(e){var t=e.key,e=e.value;i._addToMainObjectCollection(t,e)})},oFt.prototype._parseDictionary=function(e){var n=this;e.forEach(function(e,t){function i(e){var t;n._mainObjectCollection.has(e)||-1!==n._reference.indexOf(e)||((t=(t=n._crossReference._fetch(e))instanceof aPt?n._crossReference._fetch(t):t)instanceof SPt?n._parseStream(e,t):n._addToMainObjectCollection(e,t))}t instanceof aPt?i(t):Array.isArray(t)?t.forEach(function(e){e instanceof aPt?i(e):e instanceof mPt&&n._parseDictionary(e)}):t instanceof mPt&&n._parseDictionary(t)})},oFt.prototype._parseStream=function(e,t){var i,n,o;this._parseDictionary(t.dictionary),-1!==this._reference.indexOf(e)||this._mainObjectCollection.has(e)||(i=t.dictionary.get("Type"),n=t.dictionary.get("Subtype"),o=void 0,t.dictionary._updated||i&&("XObject"===i.name||"Metadata"===i.name)&&("Form"===n.name||"XML"===n.name)?o=this._crossReference._fetch(e):(o=this._crossReference._fetch(e,!0))._isCompress=!1,this._addToMainObjectCollection(e,o))};var nFt=oFt;function oFt(e){var i=this;if(this._pointer=0,!(e._cacheMap instanceof Map))throw new Error("Expected _cacheMap to be a Map.");this._reference=[],this._cache=e._cacheMap,this._mainObjectCollection=new Map;var n=!1;this._crossReference=e,this._cache.forEach(function(e,t){!n&&e instanceof mPt&&e.isCatalog&&(i._addToMainObjectCollection(t,e),n=!0)}),this._parseObjectCollection()}Object.defineProperty(sFt.prototype,"count",{get:function(){return this._fields.length},enumerable:!0,configurable:!0}),Object.defineProperty(sFt.prototype,"needAppearances",{get:function(){return this._dictionary.has("NeedAppearances")&&(this._needAppearances=this._dictionary.get("NeedAppearances")),this._needAppearances},enumerable:!0,configurable:!0}),Object.defineProperty(sFt.prototype,"exportEmptyFields",{get:function(){return this._exportEmptyFields},set:function(e){this._exportEmptyFields=e},enumerable:!0,configurable:!0}),Object.defineProperty(sFt.prototype,"_signatureFlag",{get:function(){return this._signFlag},set:function(e){e!==this._signFlag&&(this._signFlag=e,this._dictionary.update("SigFlags",e))},enumerable:!0,configurable:!0}),sFt.prototype.fieldAt=function(e){if(e<0||e>=this._fields.length)throw Error("Index out of range.");var t,i,n;return this._parsedFields.has(e)?(t=this._parsedFields.get(e),this._isNeedAppearances=!0):(i=void 0,(i=(n=this._fields[e])&&n instanceof aPt?this._crossReference._fetch(n):i)&&(t=this._parseFields(i,n),this._parsedFields.set(e,t),t)&&t instanceof XIt&&(t._annotationIndex=e)),t},sFt.prototype._parseFields=function(e,t){var i;if(e){var n=PMt(e,"FT",!1,!0,"Parent"),o=0,r=PMt(e,"Ff",!1,!0,"Parent");if(void 0!==r&&(o=r),n)switch(n.name.toLowerCase()){case"tx":i=ZIt._load(this,e,this._crossReference,t);break;case"btn":i=(0!=(o&qAt.pushButton)?tTt:0!=(o&qAt.radio)?aTt:oTt)._load(this,e,this._crossReference,t);break;case"ch":i=(0!=(o&qAt.combo)?uTt:fTt)._load(this,e,this._crossReference,t);break;case"sig":i=bTt._load(this,e,this._crossReference,t)}}return i},sFt.prototype.add=function(e){return this._fields.push(e._ref),this._dictionary.update("Fields",this._fields),this._parsedFields.set(this._fields.length-1,e),(e._form=this)._crossReference._root._updated=!0,e instanceof bTt&&(e._form._signatureFlag=GAt.signatureExists|GAt.appendOnly),this._isNeedAppearances=!0,this._fields.length-1},sFt.prototype.removeField=function(e){e=this._fields.indexOf(e._ref);0<=e&&this.removeFieldAt(e)},sFt.prototype.removeFieldAt=function(e){var t=this.fieldAt(e);if(t){if(0<t._kidsCount)for(var i=t._kidsCount-1;0<=i;i--){var n=t.itemAt(i),o=void 0;n&&(o=n._getPage())&&o._removeAnnotation(n._ref)}else t._dictionary.has("Subtype")&&"Widget"===t._dictionary.get("Subtype").name&&(o=t.page)&&o._removeAnnotation(t._ref);this._parsedFields.delete(e),this._reorderParsedAnnotations(e)}this._fields.splice(e,1);var e=this._crossReference._document,r=e._catalog;0===this._fields.length&&e&&r&&r._catalogDictionary&&(r._catalogDictionary._updated=!0,this._crossReference._allowCatalog=!0),this._dictionary.set("Fields",this._fields),this._dictionary._updated=!0},sFt.prototype._reorderParsedAnnotations=function(i){var n=new Map;this._parsedFields.forEach(function(e,t){i<t?n.set(t-1,e):n.set(t,e)}),this._parsedFields=n},sFt.prototype.setDefaultAppearance=function(e){this._setAppearance=!e,this._needAppearances=e,this._isDefaultAppearance=e},sFt.prototype.orderFormFields=function(e){var s=this;if(null==e)this.orderFormFields(new Map);else{var t=void 0,i=this._crossReference._document,n=void 0;if(e&&e instanceof Map){var o=!0,r=(0<e.size||(o=!1),this._tabCollection=e,new Map);if(this._fieldCollection=this._getFields(),Kkt(this._fieldCollection)&&0<this._fieldCollection.length)if(this._fieldCollection[0].page&&i){for(var a=0;a<this._fieldCollection.length;a++){var l,h=this._fieldCollection[Number.parseInt(a.toString(),10)];h.page&&0<=(l=uMt(i,this._sortItemByPageIndex(h,!0)._pageDictionary))&&(r.has(l)?(n=r.get(l)).push(h):((n=[]).push(h),r.set(l,n)),h=i.getPage(l),this._tabCollection.has(l)||this._tabCollection.set(l,h.tabOrder),o)&&(h.tabOrder=this._tabCollection.get(l))}var d=0;r.forEach(function(e,t){if(s._tabOrder=s._tabCollection.get(t),s._tabOrder!==WAt.structure){var i=e;i.sort(function(e,t){return s._compareFields(e,t)});for(var n=0;n<i.length;n++){var o,r=s._fieldCollection.indexOf(i[Number.parseInt(n.toString(),10)]);-1!==r&&r!==d+n&&(o=s._fieldCollection[Number.parseInt(r.toString(),10)],s._fieldCollection.splice(r,1),s._fieldCollection.splice(d+n,0,o))}}d+=e.length})}}else this._tabOrder=e,t=this._getOrder(this._tabOrder),this._fieldCollection=this._getFields(),this._fieldCollection.sort(function(e,t){return s._compareFields(e,t)});this._parsedFields.clear();for(a=0;a<this._fieldCollection.length;a++)this._parsedFields.set(Number.parseInt(a.toString(),10),this._fieldCollection[Number.parseInt(a.toString(),10)]),this._fields[Number.parseInt(a.toString(),10)]=this._fieldCollection[Number.parseInt(a.toString(),10)]._ref,t&&this._fieldCollection[Number.parseInt(a.toString(),10)].page._pageDictionary.update("Tabs",t);this._dictionary.update("Fields",this._fields)}},sFt.prototype._createFields=function(){this._dictionary.has("Fields")&&(p=this._dictionary.get("Fields"));for(var e=!1,t=0,i=[];null!=p;){for(;t<p.length;t++){var n=p[t],o=void 0,r=0,s=PMt(o=n&&n instanceof aPt?this._crossReference._fetch(n):o,"Ff",!1,!0,"Parent"),a=(void 0!==s&&(r=s),void 0);if(o&&o.has("Kids")&&void 0!==(a=o.get("Kids"))&&0<a.length)for(var l=0;l<a.length;l++){var h=a[Number.parseInt(l.toString(),10)];h&&h instanceof aPt?void 0===(h=this._crossReference._fetch(h))||h.has("Parent")||h.update("Parent",n):0!=(r&qAt.radio)&&(e=!0)}void 0===a?o&&-1===this._fields.indexOf(n)&&this._fields.push(n):!o.has("FT")||this._isNode(a)?(i.push({fields:p,count:t}),this._hasKids=!0,t=-1,p=a):e&&0!=(r&qAt.radio)||this._fields.push(n)}if(0===i.length)break;var d=i.pop(),p=d.fields,t=d.count+1}},sFt.prototype._isNode=function(e){var t,i=!1;return i=Kkt(e)&&0<e.length&&(t=void 0,Kkt(e=e[0])&&(e instanceof mPt?t=e:e instanceof aPt&&(t=this._crossReference._fetch(e))),t)&&t.has("Subtype")&&(e=t.get("Subtype"))&&"Widget"!==e.name?!0:i},sFt.prototype._parseWidgetReferences=function(){var i=this;return void 0===this._widgetReferences&&0<this.count&&(this._widgetReferences=[],this._fields.forEach(function(e){var t=i._crossReference._fetch(e);t&&(t.has("Kids")?(t=t.get("Kids"))&&0<t.length&&t.forEach(function(e){var t;e&&e instanceof mPt?t=e:e&&e instanceof aPt&&(t=i._crossReference._fetch(e)),t&&t.has("Subtype")&&(t=t.get("Subtype"))&&"Widget"===t.name&&i._widgetReferences.push(e)}):i._widgetReferences.push(e))})),this._widgetReferences},sFt.prototype._doPostProcess=function(e,t){for(var i=this.count-1;0<=i;i--){var n=this.fieldAt(i);if(n&&!n._isLoaded&&void 0!==n._tabIndex&&0<=n._tabIndex){var o=n._page;if(o&&o._pageDictionary.has("Annots")&&(o.tabOrder===WAt.manual||this._tabOrder===WAt.manual)){var r=o._pageDictionary.get("Annots"),s=new yDt(r,this._crossReference,o);o._annotations=s;for(var a=0;a<n.itemsCount;a++){var l=n.itemAt(a);l&&l instanceof GEt&&0<=(l=(l=r.indexOf(l._ref))<0?n._annotationIndex:l)&&(l=o.annotations._reArrange(n._ref,n._tabIndex,l),o._pageDictionary.update("Annots",l),o._pageDictionary._updated=!0)}}}n&&(t&&n.page===t||!t)&&(t&&(n._isImport=!0),n._doPostProcess(e||n.flatten),!e&&n.flatten||e&&t&&n.page===t)&&this.removeFieldAt(i)}},sFt.prototype._getFieldIndex=function(e){var t=-1;if(0<this.count){this._fieldNames||(this._fieldNames=[]),this._indexedFieldNames||(this._indexedFieldNames=[]),this._actualFieldNames||(this._actualFieldNames=[]),this._indexedActualFieldNames||(this._indexedActualFieldNames=[]);for(var i=0;i<this.count;i++){var n,o=this.fieldAt(i);o&&((n=o.name)&&(this._fieldNames.push(n),this._indexedFieldNames.push(n.split("[")[0])),n=o.actualName)&&(this._actualFieldNames.push(n),this._indexedActualFieldNames.push(n.split("[")[0]))}var r=this._fieldNames.indexOf(e);-1===r&&-1===(r=this._indexedFieldNames.indexOf(e))&&-1===(r=this._actualFieldNames.indexOf(e))&&-1===(r=this._indexedActualFieldNames.indexOf(e))||(t=r)}return t},sFt.prototype._getFields=function(){for(var e=[],t=0;t<this._fields.length;t++){var i=this.fieldAt(t);i&&i instanceof XIt&&e.push(i)}return e},sFt.prototype._getOrder=function(e){var t;return e!==WAt.none?(t="",e===WAt.row?t="R":e===WAt.column?t="C":e===WAt.structure&&(t="S"),k.get(t)):null},sFt.prototype._compareFields=function(e,t){var i,n,o,r,s,a,l,h=0,d=e.page,p=t.page;return d&&!d._isNew&&d instanceof PDt&&p&&!p._isNew&&p instanceof PDt&&(d=this._sortItemByPageIndex(e,!1)._pageIndex,p=this._sortItemByPageIndex(t,!1)._pageIndex,o=void 0,o=e._dictionary.has("Kids")?this._getItemRectangle(e):this._getRectangle(e._dictionary),s=void 0,s=t._dictionary.has("Kids")?this._getItemRectangle(t):this._getRectangle(t._dictionary),l=o[3]-o[1],i=s[3]-s[1],o)&&2<=o.length&&s&&2<=s.length&&(n=o[0],o=o[1],r=s[0],s=s[1],"number"==typeof n)&&"number"==typeof r&&"number"==typeof o&&"number"==typeof s&&(d=d-p,this._tabOrder===WAt.row?(0!==(a=this._compare(s,o))&&(-1===a&&s<o&&o-l/2<s||1===a&&o<s&&s-i/2<o)&&(a=0),h=0!=d?d:0!==a?a:this._compare(n,r)):this._tabOrder===WAt.column?(a=this._compare(n,r),h=0!=d?d:0!==a?a:this._compare(s,o)):this._tabOrder!==WAt.manual&&this._tabOrder!==WAt.none&&this._tabOrder!==WAt.structure&&this._tabOrder!==WAt.widget||e instanceof XIt&&t instanceof XIt&&(p=e.tabIndex,l=t.tabIndex,a=this._compare(p,l),h=0!=d?d:a)),h},sFt.prototype._getRectangle=function(e){var t;return t=e&&e.has("Rect")?e.getArray("Rect"):t},sFt.prototype._getItemRectangle=function(e){var t,i=e._dictionary;return t=i.has("Kids")&&Kkt(i=i.getArray("Kids"))&&1<=i.length?1!==i.length&&e&&1<e.itemsCount?this._getRectangle(e.itemAt(0)._dictionary):this._getRectangle(i[0]):t},sFt.prototype._compare=function(e,t){return t<e?1:e<t?-1:0},sFt.prototype._compareKidsElement=function(e,t){e=this._crossReference._fetch(e),t=this._crossReference._fetch(t),e=this._getRectangle(e),t=this._getRectangle(t);if(e&&2<=e.length&&t&&2<=t.length){var i,n,o=e[0],e=e[1],r=t[0],t=t[1];if("number"==typeof o&&"number"==typeof r&&"number"==typeof e&&"number"==typeof t)return i=void 0,this._tabOrder===WAt.row?0!==(i=this._compare(t,e))?i:this._compare(o,r):this._tabOrder===WAt.column?0!==(i=this._compare(o,r))?i:this._compare(t,e):0}return n},sFt.prototype._sortItemByPageIndex=function(e,t){var i=e.page,n=this._tabOrder;return this._tabOrder=t?e.page.tabOrder:n,this._sortFieldItems(e),e._isLoaded&&1<e._kidsCount&&(i=e.itemAt(0).page),this._tabOrder=n,i=void 0===i?e.page:i},sFt.prototype._sortFieldItems=function(e){var i=this;if(e._isLoaded&&(e instanceof ZIt||e instanceof fTt||e instanceof oTt||e instanceof aTt)){var t=e._parseItems();t.sort(function(e,t){return i._compareFieldItem(e,t)}),e._parsedItems.clear();for(var n=0;n<t.length;n++)e._parsedItems.set(n,t[Number.parseInt(n.toString(),10)])}},sFt.prototype._compareFieldItem=function(e,t){var i,n,o,r,s,a=0;return void 0!==e&&void 0!==t&&(i=e.page,n=t.page,e=this._getRectangle(e._dictionary),t=this._getRectangle(t._dictionary),e)&&t&&(o=e[0],e=e[1],r=t[0],t=t[1],s=void 0,this._tabOrder===WAt.row?a=0!==(s=this._compare(i._pageIndex,n._pageIndex))||0!==(s=this._compare(t,e))?s:this._compare(o,r):this._tabOrder===WAt.column&&(a=0!==(s=this._compare(i._pageIndex,n._pageIndex))||0!==(s=this._compare(o,r))?s:this._compare(t,e))),a},sFt.prototype._clear=function(){this._fields=[],this._parsedFields=new Map};var rFt=sFt;function sFt(e,t){this._isDefaultAppearance=!1,this._hasKids=!1,this._setAppearance=!1,this._exportEmptyFields=!1,this._fieldCollection=[],this._signFlag=GAt.none,this._isNeedAppearances=!1,this._dictionary=e,this._crossReference=t,this._parsedFields=new Map,this._fields=[],this._createFields()}aFt=function(e,t){return(aFt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}aFt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(dFt,lFt=i0),dFt.prototype._exportAnnotations=function(e){return this._document=e,this._crossReference=e._crossReference,this._isAnnotationExport=!0,this._exportAnnotationData(e,e.pageCount),this._save()},dFt.prototype._exportFormFields=function(e){return this._document=e,this._crossReference=e._crossReference,this._isAnnotationExport=!1,this._key=XMt(),this._save()},dFt.prototype._save=function(){var i=this,e=0,t=[];if(!this._isAnnotationExport){this._asPerSpecification?(this.fdfString+="%FDF-1.2\n%"+this._specialCharacters+"\r\n1 0 obj\r<</FDF<</F(",this.fdfString+=this._fileName+")",this.fdfString+="/Fields["):this.fdfString+="%FDF-1.2\n";var n=this._document.form;if(null!=n){this._exportEmptyFields=n.exportEmptyFields;for(var o=this._document.form.count,r=0;r<o;r++){var s=this._document.form.fieldAt(r),a=this._exportFormFieldsData(s);if((s instanceof ZIt||s instanceof fTt||s instanceof uTt||s instanceof aTt||s instanceof oTt)&&e++,this._asPerSpecification)if(s instanceof ZIt||s instanceof fTt||s instanceof uTt){if(t.push(e),this.fdfString+="<</T("+s.name+")/V","string"==typeof a||Array.isArray(a)&&1===a.length)this.fdfString+="("+(Array.isArray(a)?a[0]:a)+")";else if(Array.isArray(a)){this.fdfString+="[";for(l=0;l<a.length;l++)this.fdfString+="("+a[Number.parseInt(l.toString(),10)]+")",l!==a.length-1&&(this.fdfString+=" ");this.fdfString+="]"}this.fdfString+=">>"}else(s instanceof aTt||s instanceof oTt)&&(t.push(e),this.fdfString+="<</T("+s.name+")/V/"+a+">>");else if(s instanceof ZIt||s instanceof fTt||s instanceof uTt){if(t.push(e),this.fdfString+=e+" 0 obj<</T <"+this._stringToHexString(s.name)+"> /V ","string"==typeof a||Array.isArray(a)&&1===a.length)this.fdfString+="<"+this._stringToHexString(Array.isArray(a)?a[0]:a)+">";else if(Array.isArray(a)){this.fdfString+="[";for(var l=0;l<a.length;l++)this.fdfString+="<"+this._stringToHexString(a[Number.parseInt(l.toString(),10)])+">",l!==a.length-1&&(this.fdfString+=" ");this.fdfString+="]"}this.fdfString+=" >>endobj\n"}else(s instanceof aTt||s instanceof oTt)&&(t.push(e),this.fdfString+=e+" 0 obj<</T <"+this._stringToHexString(s.name)+"> /V /",this.fdfString+=a+" >>endobj\n")}}if(this._asPerSpecification)this.fdfString+="]",this.fdfString+="/ID[]/UF("+this._fileName+")>>/Type/Catalog>>\rendobj\rtrailer\r\n<</Root 1 0 R>>\r\n",this.fdfString+="%%EOF\r\n";else{this.fdfString+=this._table.size+1+" 0 obj<</F <"+this._stringToHexString(this._fileName)+">  /Fields [";for(r=0;r<this._table.size;r++)null!=(s=this._document.form.fieldAt(r))&&s.export&&(this.fdfString+=t[Number.parseInt(r.toString(),10)]+" 0 R ");this.fdfString+="]>>endobj\n",this.fdfString+=t.length+2+" 0 obj<</Version /1.4 /FDF "+(t.length+1)+" 0 R>>endobj\n",this.fdfString+="trailer\n<</Root "+(t.length+2)+" 0 R>>"}}var n=new ArrayBuffer(+this.fdfString.length),h=new Uint8Array(n);return h.forEach(function(e,t){h[t]=i.fdfString.charCodeAt(t)}),h},dFt.prototype._importAnnotations=function(e,t){this._document=e,this._crossReference=e._crossReference,this._isAnnotationExport=!1,this._checkFdf(CMt(t));e=new IPt(t),this._isAnnotationImport=!0,t=new qBt(new QBt(e),null,!0,!1);this._readFdfData(t),Kkt(this._annotationObjects)&&0<this._annotationObjects.size&&this._annotationObjects.clear(),Kkt(this._table)&&0<this._table.size&&this._table.clear()},dFt.prototype._importFormData=function(e,t){this._document=e,this._crossReference=e._crossReference,this._isAnnotationExport=!1,this._checkFdf(CMt(t));e=new IPt(t),t=new qBt(new QBt(e),null,!1,!1);this._readFdfData(t)},dFt.prototype._readFdfData=function(e){var a=this,t=e.getObject();if(this._isAnnotationImport){for(var i="";null!=t&&"EOF"!==t;)t instanceof mPt||t instanceof IPt||t instanceof ZPt?(this._table.set(i,t),i=""):null!==t&&Number.isInteger(t)&&0!==t?0<=e.first&&(i=t.toString()+" "+e.first.toString()):t instanceof rPt&&null!==t.command&&void 0!==t.command&&"trailer"===t.command&&(i=t.command),t=e.getObject();if(this._annotationObjects=this._parseAnnotationData(),this._annotationObjects.forEach(function(e,t){var i,n,o,r,s;e._crossReference=a._crossReference,e._updated=!0,e&&e.has("Page")&&null!=(n=e.get("Page"))&&n<a._document.pageCount&&(i=(n=a._document.getPage(n))._pageDictionary)&&null!=(o=(n=n.annotations)._parseAnnotation(e))&&(o._isImported=!0,r=a._crossReference._getNextReference(),a._crossReference._cacheMap.set(r,e),(e.has("NM")||e.has("IRT"))&&a._addReferenceToGroup(r,e),o._ref=r,s=n._annotations.length,n._annotations.push(r),n._comments&&0<n._comments.length&&(n._comments=[]),i.set("Annots",n._annotations),i._updated=!0,n._parsedAnnotations.set(s,o),a._handlePopup(n,r,e,i))}),this._groupHolders&&0<this._groupHolders.length)for(var n=0;n<this._groupHolders.length;n++){var o,r=this._groupHolders[Number.parseInt(n.toString(),10)];r&&r.has("IRT")&&(o=r.get("IRT"))&&(this._groupReferences&&this._groupReferences.has(o)?r.update("IRT",this._groupReferences.get(o)):delete r._map.IRT)}this._groupHolders=[],this._groupReferences=new Map}else{if(t=e.getObject(),this._asPerSpecification)for(;null!=t&&"EOF"!==t;){if(t instanceof mPt&&null!==t&&null!==t._map.FDF&&void 0!==t._map.FDF&&(t=t._map.FDF)instanceof mPt&&null!==t._map.Fields&&void 0!==t._map.Fields&&null!=(t=t._map.Fields))for(n=0;n<t.length;n++){var s,l,h=t[Number.parseInt(n.toString(),10)];h instanceof mPt&&null!=h&&(s=h.getArray("T"),l=void 0,l=h._map.V instanceof k?h.getArray("V").name:h.getArray("V"),null!=s)&&0<s.length&&this._table.set(s,l)}t=e.getObject()}else for((t=e.getObject())instanceof rPt&&null!==t.command&&(t=t.command);null!=t&&"EOF"!==t;)t instanceof mPt&&(s=t.getArray("T"),l=void 0,l=t._map.V instanceof k?t.getArray("V").name:t.getArray("V"),null!=s)&&0<s.length&&this._table.set(s,l),t=e.getObject();this._importField()}},dFt.prototype._parseAnnotationData=function(){var e=new Map,t=new Map;if(null!=(e=this._table)&&0<e.size&&e.has("trailer")){var i=e.get("trailer");if(i instanceof mPt&&null!=i&&i.has("Root")){i=i.getRaw("Root");if(null!=i){i=i.objectNumber.toString()+" "+i.generationNumber.toString();if(e.has(i)){var n=e.get(i);if(null!=n&&n.has("FDF")){n=n.get("FDF");if(null!=n&&n.has("Annots"))for(var o=0,r=n.get("Annots")||[];o<r.length;o++){var s=r[o],a=s.objectNumber+" "+s.generationNumber,l=e.get(a);if(l){if(l instanceof mPt&&l.has("Parent")&&l.has("Subtype")){var h=l.get("Subtype"),d=l._get("Parent");if("Popup"===h.name&&d.objectNumber===s.objectNumber)continue}t.set(a,l)}e.delete(a)}}}e.delete(i)}}e.delete("trailer")}return t},dFt.prototype._importField=function(){var n=this,o=this._document.form,r=o.count;r&&this._table.forEach(function(e,t){0<n._table.size&&n._table.has(t)&&(i=n._table.get(t));var i,t=o._getFieldIndex(t);-1!==t&&t<r&&(t=o.fieldAt(t))&&(i&&""!==i&&t._dictionary.update("RV",i),i=[],Array.isArray(e)?i=e:i.push(e),n._importFieldData(t,i))})},dFt.prototype._exportAnnotationData=function(e,t){for(var i=Z1t._whiteSpace+"0"+Z1t._whiteSpace,n=(this.fdfString+="%FDF-1.2\r\n",2),o=new Array,r=this.exportAppearance,s=0;s<t;s++){var a=e.getPage(s);if(null!=a&&0<a.annotations.count)for(var l=0;l<a.annotations.count;l++){var h=a.annotations.at(l);null==h||h instanceof lEt||h instanceof yEt||h instanceof gEt||h instanceof pEt||(o=(n=(h=h instanceof BEt||h instanceof QTt?this._exportAnnotation(h,this.fdfString,n,o,s,!0):this._exportAnnotation(h,this.fdfString,n,o,s,r)).index,h.annot))}}if(2!==n){var d="1"+i;this.fdfString+=d+"obj\r\n<</FDF<</Annots[";for(s=0;s<o.length-1;s++)this.fdfString+=o[Number.parseInt(s.toString(),10)]+i+"R ";this.fdfString+=o[o.length-1]+i+"R]/F("+this._fileName+")/UF(",this.fdfString+=this._fileName+")>>/Type/Catalog>>\r\nendobj\r\n",this.fdfString+="trailer\r\n<</Root "+d+"R>>\r\n%%EOF\r\n"}},dFt.prototype._exportAnnotation=function(e,t,o,r,s,a){this.fdfString=t;for(var t=new pFt,l=e._dictionary,h=Z1t._whiteSpace+"0"+Z1t._whiteSpace+"obj\r\n",d="\r\nendobj\r\n",p=(this._annotationID=o.toString(),this.fdfString+=o+h+"<<",new Map),c=new Array,e=(r.push(this._annotationID),l.set("Page",s),this._getEntries(p,c,o,l,this.fdfString,a)),u=(o=e.index,p=e.list,c=e.streamReference,delete l._map.Page,this.fdfString+=">>"+d,this);0<p.size;)!function(){var i=Array();p.forEach(function(e,t){i.push(t)});for(var e=0;e<i.length;e++){var t,n=i[Number.parseInt(e.toString(),10)];(p.get(n)instanceof mPt||p.get(n)instanceof IPt||p.get(n)instanceof ZPt)&&null!=(l=p.get(n)instanceof mPt?p.get(n):p.get(n).dictionary)&&(l instanceof mPt&&l.has("Type")&&null!=(t=l.get("Type"))&&"Annot"===t.name&&(r.push(n.toString()),l.set("Page",s)),u.fdfString+=n+h+"<<",t=u._getEntries(p,c,o,l,u.fdfString,a),p=t.list,c=t.streamReference,o=t.index,l instanceof mPt&&l.has("Page")&&delete l._map.Page,u.fdfString+=">>",null!=c&&-1!==c.indexOf(n)&&u._appendStream(p.get(n),u.fdfString),u.fdfString+=d),p.delete(n)}}();return o++,t.index=o,t.annot=r,t},dFt.prototype._appendStream=function(e,t){var i=e;this.fdfString=t,(e instanceof ZPt||e instanceof IPt)&&(i=e instanceof ZPt?e.stream:e),(e instanceof ZPt||e instanceof IPt)&&(t=i.getBytes(),e=new Uint8Array(t),(i=new lh).write(e,0,e.length),i.close(),t=i.getCompressedString,this.fdfString+="stream\r\n",this.fdfString+=t,this.fdfString+="\r\nendstream")},dFt.prototype._getEntries=function(e,n,o,r,t,s){var a=this,l=!1,i=new pFt,h=(this.fdfString=t,e);return r.forEach(function(e,t){var i;!s&&"AP"===e||("P"!==e&&(a.fdfString+="/"+e),"Sound"!==e&&"F"!==e&&!s||(l=!0),"string"==typeof(t=t)?a.fdfString+="("+a._getFormattedString(t)+")":t instanceof k?a.fdfString+="/"+t.name:t instanceof Array?(i=a._appendArray(t,a.fdfString,o,l,h,n),h=i.list,n=i.streamReference,o=i.index):"number"==typeof t?a.fdfString+=" "+t.toString():"boolean"==typeof t?a.fdfString+=" "+(t?"true":"false"):t instanceof mPt?(a.fdfString+="<<",i=a._getEntries(h,n,o,t,a.fdfString,s),h=i.list,n=i.streamReference,o=i.index,a.fdfString+=">>"):t instanceof aPt&&(i=r.get("Page"),"Parent"===e?(a.fdfString+=" "+a._annotationID+" 0 R",a.fdfString+="/Page "+i):"IRT"===e?a._crossReference&&a._crossReference._fetch&&t&&(i=a._crossReference._fetch(t))&&i.has("NM")&&null!=(i=i.get("NM"))&&(a.fdfString+="("+a._getFormattedString(i)+")"):"P"!==e&&null!=t&&(o++,a.fdfString+=" "+o+" 0 R",l&&n.push(o),h.set(o,r.get(e)))),l=!1)}),i.list=h,i.streamReference=n,i.index=o,i},dFt.prototype._appendArray=function(e,t,i,n,o,r){this.fdfString=t,this.fdfString+="[";var t=new pFt,s=o;if(Kkt(e)&&0<e.length)for(var a=e.length,l=0;l<a;l++){var h=e[Number.parseInt(l.toString(),10)],h=(0!==l&&("number"==typeof h||h instanceof aPt||"boolean"==typeof h)&&(this.fdfString+=" "),this._appendElement(h,this.fdfString,i,n,s,r)),s=h.list;r=h.streamReference,i=h.index}return this.fdfString+="]",t.list=s,t.streamReference=r,t.index=i,t},dFt.prototype._appendElement=function(e,t,i,n,o,r){this.fdfString=t;var s,t=new pFt;return"number"==typeof e?this.fdfString+=e.toString():e instanceof k?this.fdfString+=e.name.toString():e instanceof Array?(o=(s=this._appendArray(e,this.fdfString,i,n,o,r)).list,r=s.streamReference,i=s.index):e instanceof mPt&&(this.fdfString+="<<",o=(s=this._getEntries(o,r,i,e,this.fdfString,n)).list,r=s.streamReference,i=s.index,this.fdfString+=">>"),t.list=o,t.streamReference=r,t.index=i,t},dFt.prototype._getFormattedString=function(e){for(var t="",i=0;i<e.length;i++){var n=e.charCodeAt(i);40!==n&&41!==n||(t+="'"),t+=String.fromCharCode(n)}return t},dFt.prototype._checkFdf=function(e){if(((e.includes(this._specialCharacters)||e.includes("Ã¢Ã£ÃÃ"))&&(this._asPerSpecification=!0),e.startsWith("%"))&&"FDF-"!==e.substring(1,5))throw new Error("Invalid FDF file.")},dFt.prototype._stringToHexString=function(e){var t="";return t=null!=e&&0<e.length?xMt(yMt(e)):t};var aFt,lFt,hFt=dFt;function dFt(e){var t=lFt.call(this)||this;return t._annotationObjects=new Map,t._specialCharacters="âãÏÓ",null!=e&&(t._fileName=e),t}var pFt=function(){};cFt=function(e,t){return(cFt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}cFt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(mFt,uFt=i0),mFt.prototype._exportAnnotations=function(){throw new Error("Method not implemented.")},mFt.prototype._exportFormFields=function(e){return this._document=e,this._crossReference=e._crossReference,this._isAnnotationExport=!1,this._format="XML",this._key=XMt(),this._save()},mFt.prototype._save=function(){var e=new wIt,t=(e._writeStartDocument(),this._asPerSpecification?(e._writeStartElement("fields"),e._writeAttributeString("xfdf","http://ns.adobe.com/xfdf-transition/","xmlns",null)):e._writeStartElement("Fields"),this._document.form);if(null!=t){this._exportEmptyFields=t.exportEmptyFields;for(var i=this._document.form.count,n=0;n<i;n++){var o=this._document.form.fieldAt(n);null!=o&&o.export&&this._exportFormFieldData(o)}this._writeFormFieldData(e,this._asPerSpecification)}t=e._save();return e._destroy(),t},mFt.prototype._writeFormFieldData=function(n,e){(e=void 0===e?!1:e)?this._table.forEach(function(e,t){var i;t.includes(" ")?(i=t.replace(/ /g,""),n._writeStartElement(i.toString()),n._writeAttributeString("original",t.toString(),"xfdf",null)):n._writeStartElement(t.toString()),n._writeString(e.toString()),n._writeEndElement()}):this._table.forEach(function(e,t){t.includes(" ")&&(t=t.replace(/ /g,"_x0020_")),n._writeStartElement(t.toString()),n._writeString(e.toString()),n._writeEndElement()}),n._writeEndElement()},mFt.prototype._importFormData=function(e,t){this._document=e,this._crossReference=e._crossReference,this._isAnnotationExport=!1;e=CMt(t);e=(e=e.replace(/(\r\n|\n|\r)/gm,"")).replace(/[^\x20-\x7E]/g,""),this._xmlDocument=(new DOMParser).parseFromString(e,"text/xml"),this._checkXml(this._xmlDocument),this._xmlImport=!0,this._parseFormData(this._xmlDocument.documentElement),this._xmlImport=!1},mFt.prototype._parseFormData=function(e){var t=e.childNodes;if(null!=t&&0<t.length)for(var i=0;i<t.length;i++){var n,o,r=t.item(i);null!=r&&1===r.nodeType&&(n="",null!==(r=r).attributes&&void 0!==r.attributes&&0<r.attributes.length?null!=(o=r.attributes.item(0))&&"xfdf:original"===o.name&&(n=o.value):n=r.tagName,o=r.textContent,null!=n)&&0<n.length&&this._table.set(n,o)}this._importField()},mFt.prototype._importField=function(){var n=this,o=this._document.form,r=o.count;r&&this._table.forEach(function(e,t){0<n._table.size&&n._table.has(t)&&(i=n._table.get(t));var i,t=t.toString(),t=(-1!==t.indexOf("_x0020_")&&(t=t.replace(/_x0020_/g," ")),o._getFieldIndex(t));-1!==t&&t<r&&(t=o.fieldAt(t))&&null!=t&&(i&&""!==i&&t._dictionary.update("RV",i),(i=[]).push(e),n._importFieldData(t,i))})},mFt.prototype._checkXml=function(e){if(0<e.getElementsByTagName("parsererror").length)throw new Error("Invalid XML file.")};var cFt,uFt,gFt=mFt;function mFt(e){var t=uFt.call(this)||this;return null!=e&&(t._fileName=e),t}Object.defineProperty(yFt.prototype,"crossReferenceType",{get:function(){return this._crossReferenceType},set:function(e){this._crossReferenceType=e},enumerable:!0,configurable:!0}),Object.defineProperty(yFt.prototype,"isIncrementalUpdate",{get:function(){return this._incrementalUpdate},set:function(e){this._incrementalUpdate=e},enumerable:!0,configurable:!0});var fFt=yFt;function yFt(){this._incrementalUpdate=!0}Object.defineProperty(bFt.prototype,"targetIndex",{get:function(){return this._targetIndex},set:function(e){this._targetIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(bFt.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation=e},enumerable:!0,configurable:!0}),Object.defineProperty(bFt.prototype,"optimizeResources",{get:function(){return this._optimizeResources},set:function(e){this._optimizeResources=e},enumerable:!0,configurable:!0}),Object.defineProperty(bFt.prototype,"groupFormFields",{get:function(){return this._groupFormFields},set:function(e){this._groupFormFields=e},enumerable:!0,configurable:!0});var vFt=bFt;function bFt(){this._optimizeResources=!0,this._groupFormFields=!1}CFt.prototype._importPages=function(e,t,i,n,o,s){var a,l,h=this,r=e._pageDictionary;if(this._isDuplicatePage=n,this._options.rotation=(o||e).rotation,a="number"==typeof t?this._insertNewPage(e,t):this._isDuplicatePage?this._insertNewPage(e,e._pageIndex+1):this._insertNewPage(e),(n||s)&&this._options.optimizeResources?(l=[],r.forEach(function(e,t){if("Contents"===e&&0===l.length){var i=t;if(i instanceof aPt){var n=s?h._copier._copy(i):i;a._pageDictionary.update(e,n)}else if(i instanceof Array){for(var o=0;o<i.length;o++){var r=s?h._copier._copy(i[Number.parseInt(o.toString(),10)]):i[Number.parseInt(o.toString(),10)];l.push(r)}a._pageDictionary.update(e,l)}}else"Resources"===e&&t?(n=s?h._copier._copy(t):t)&&a._pageDictionary.update(e,n):"Resources"!==e&&"MediaBox"!==e&&"CropBox"!==e&&"Parent"!==e&&"Annots"!==e&&"Contents"!==e&&"Rotate"!==e&&a._pageDictionary.update(e,t)})):(o=e._contentTemplate,a.graphics.drawTemplate(o,{x:0,y:0,width:o._size[0],height:o._size[1]}),o._content.dictionary.update("Resources",this._copier._copy(r.getRaw("Resources"))),this._pageReference.set(r,a),n||this._bookmarksPageLinkReference.set(e._ref,a._pageIndex)),r.has("Annots")&&(this._importAnnotation(e,a),void 0!==this._options&&this._options.groupFormFields&&this._sourceDocument._catalog._catalogDictionary.has("AcroForm")?this._formFieldsGroupingSupport(this._sourceDocument.form,e,a):this._sourceDocument._catalog._catalogDictionary.has("AcroForm")&&this._importFormField(e,this._sourceDocument.form,a,this._sourceDocument._crossReference)),!n){t=this._sourceDocument._parseBookmarkDestination();if(t&&t.has(e))for(var d=t.get(e),p=0;p<d.length;p++)this._bookmarks.push(d[Number.parseInt(p.toString(),10)])}(n||!i)&&this._options.optimizeResources||this._mergeLayer(a._pageDictionary,r,this._sourceDocument._crossReference),a._pageDictionary._updated=!0},CFt.prototype._importAnnotation=function(e,t){for(var i=[],n=!1,o=e.annotations,r=o.count,s=0;s<r;s++){var a=o._annotations[Number.parseInt(s.toString(),10)];if(a){var l=this._sourceDocument._crossReference._fetch(a);if(l){if(l.has("Dest")){var h=[],d=l.get("Dest"),p=l._get("Dest");if(d instanceof Array){for(var c=d,u=0;u<c.length;u++)h.push(c[Number.parseInt(u.toString(),10)]);n=!0}else p instanceof aPt&&h.push(p)}h&&0<h.length&&this._destination.push(h),l.has("OC")&&(d=l.getRaw("OC"))instanceof aPt&&this._annotationLayer.set(s,d);p=this._copier._copy(a),l=this._destinationDocument._crossReference._fetch(p);n&&l.update("Dest",h),l.update("P",t._ref),this._crossReference._cacheMap.set(p,l),i.push(p)}}n=!1,h=[]}0<i.length&&t._pageDictionary.update("Annots",i)},CFt.prototype._formFieldsGroupingSupport=function(e,t,i){var n,o=[],r=[],s=[],a=e._dictionary.get("DR");if(e._dictionary.has("DR")&&(a=e._dictionary.get("DR")),i._pageDictionary.has("Annots")&&(o=i._pageDictionary.get("Annots")),t._pageDictionary.has("Annots")&&(s=t._pageDictionary.get("Annots")),!this._isDuplicatePage){n=this._destinationDocument.form,this._fieldCount=n.count;for(var l=0;l<this._fieldCount;l++)r.push(n.fieldAt(l).name)}for(var h=0;h<e.count;h++){var d=e.fieldAt(h),p=void 0,c=[],u=d._dictionary.get("Kids");if(-1!==r.indexOf(d.name)||this._isDuplicatePage){if(this._isDuplicatePage?(p=d,c=u):(p=n.fieldAt(r.indexOf(d.name)))._dictionary.get("Kids")&&(c=p._dictionary.get("Kids")),d._isDuplicatePage=!0,d instanceof bTt&&p instanceof bTt||!(d instanceof bTt))if(void 0!==u&&0<u.length)for(var g=0;g<u.length;g++){var m=d.itemAt(g);m.page===t&&(p._page=i,o=this._groupFormFieldsKids(p,d,s,c,u,i._ref,o,g,h,a,m))}else o=this._groupFormFieldsKids(p,d,s,c,u,i._ref,o,0,h,a)}else o=this._insertFormFields(h,e._crossReference,d,e,i._ref,o,s)}0<o.length&&i._pageDictionary.update("Annots",o)},CFt.prototype._groupFormFieldsKids=function(e,t,i,n,o,r,s,a,l,h,d){var p,c,u;return t._dictionary.has("Kids")&&e._dictionary.has("Kids")?-1!==i.indexOf(o[Number.parseInt(a.toString(),10)])&&(i=t._crossReference._fetch(o[Number.parseInt(a.toString(),10)]),(u=this._copier._copyDictionary(i,!this._isDuplicatePage)).update("P",r),p=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(p,u),s.push(p),u.update("Parent",e._ref),n.push(p),u._updated=!0,e._dictionary._updated=!0,this._isDuplicatePage||((e instanceof ZIt||e instanceof tTt||e instanceof uTt)&&u.has("AS")&&delete u._map.AS,this._createAppearance(e,t,i,u,h,d))):t._dictionary.has("Kids")&&!e._dictionary.has("Kids")||this._isDuplicatePage?(c=this._copier._copyDictionary(e._dictionary,!this._isDuplicatePage),this._updateFieldsWithKids(e,t,c,a,l,r,o,s,h,e._dictionary)):!t._dictionary.has("Kids")&&e._dictionary.has("Kids")?(i=this._copier._copyDictionary(t._dictionary),this._updateFieldDictionary(i,r,e._ref),p=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(p,i),n.push(p),s.push(p),e._dictionary._updated=!0,this._createAppearance(e,t,t._dictionary,i,h,d)):t._dictionary.has("Kids")||e._dictionary.has("Kids")||(c=this._copier._copyDictionary(e._dictionary),u=this._copier._copyDictionary(t._dictionary,!this._isDuplicatePage),this._removeFieldDictionary(u,["Parent","FT","T","Ff"]),u.update("P",r),this._updateFieldsWithKids(e,t,c,a,l,r,o,s,h,u)),s},CFt.prototype._updateFieldsWithKids=function(e,t,i,n,o,r,s,a,l,h){var d=this._crossReference._getNextReference(),p=this._createNewFieldDictionary(i,e._dictionary),c=(p.objId=d.toString(),this._crossReference._cacheMap.set(d,p),this._destinationDocument.form._parseFields(p,d)),s=(e._dictionary.update("Parent",d),c._dictionary._updated=!0,this._updateFieldDictionary(i,r,d),this._destinationDocument.form._dictionary._updated=!0,i=void 0!==s&&0<s.length?t._crossReference._fetch(s[Number.parseInt(n.toString(),10)]):h,this._copier._copyDictionary(i,!this._isDuplicatePage)),n=((e instanceof ZIt||e instanceof tTt||e instanceof uTt)&&s.has("AS")&&delete s._map.AS,this._crossReference._getNextReference()),h=(this._crossReference._cacheMap.set(n,s),s.update("P",r),a.push(n),s.update("Parent",c._ref),[]);h.push(e._ref),h.push(n),s._updated=!0,e._dictionary._updated=!0,p.update("Kids",h),c._kids=h,this._formFieldsCollection.set(o,d),this._destinationDocument.form._parsedFields.set(o,c),this._isDuplicatePage||this._createAppearance(c,t,i,s,l),p._updated=!0},CFt.prototype._removeFieldDictionary=function(t,e){return e.forEach(function(e){t.has(e)&&delete t._map[e]}),t},CFt.prototype._updateFieldDictionary=function(e,t,i){(e=this._removeFieldDictionary(e,["Parent","FT","T","Ff"])).update("P",t),e.update("Parent",i),e._updated=!0},CFt.prototype._createNewFieldDictionary=function(t,i){var n=new mPt(this._crossReference);return["Parent","FT","T","V","Ff","TU","Opt","I"].forEach(function(e){t.has(e)&&(n.update(e,t.get(e)),delete t._map[e],delete i._map[e])}),n},CFt.prototype._getItemStyle=function(e,t){var i=e._dictionary.get("MK");i&&i.has("CA")?e._styleText=i.get("CA").charAt(0):e._styleText=t instanceof aTt?"l":"4"},CFt.prototype._createAppearance=function(e,t,i,n,o,r){var s,a,l=e._kidsCount-1;e instanceof oTt?((s=e.itemAt(l))._enableGrouping=!0,this._getItemStyle(s,e),t instanceof aTt?(s._dictionary.update("AS",k.get("Off")),a=ekt(i)):s._postProcess(e.checked?"Yes":"Off"),e._drawAppearance(s,a)):e instanceof aTt?(s=e.itemAt(l),this._getItemStyle(s,e),s._dictionary.has("AS")?s._postProcess(s._dictionary.get("AS").name):s._postProcess("Off"),s._enableGrouping=!0,e._enableGrouping=!0,e._drawAppearance(s)):e instanceof dTt?(s=e.itemAt(l),void 0!==r&&(s.rotationAngle=r.rotationAngle),s&&!e._checkFieldFlag(s._dictionary)&&(s._enableGrouping=!0,t=e._createAppearance(s),e._addAppearance(s._dictionary,t,"N"),s._dictionary._updated=!0)):(e instanceof ZIt||e instanceof tTt||e instanceof bTt)&&(i=GEt._load(n,this._crossReference),null!=r&&e instanceof bTt?e._createAppearance(r,!1):(i.setAppearance(!0),i._enableGrouping=!0,a=void 0,a=null!=r?this._obtainFont(r._dictionary,o):this._obtainFont(n,o),i._pdfFont=a,e instanceof bTt?e._createAppearance(i,!1):e._postProcess(!1,i)))},CFt.prototype._obtainFont=function(e,t){var i,n="",o=8;if(e&&(e.has("DS")||e.has("DA")))if(e.has("DS"))for(var r=e.get("DS").split(";"),s=0;s<r.length;s++){var a=r[Number.parseInt(s.toString(),10)].split(":");if(-1!==r[Number.parseInt(s.toString(),10)].indexOf("font-family"))n=a[1];else if(-1===r[Number.parseInt(s.toString(),10)].indexOf("font-style")&&-1!==r[Number.parseInt(s.toString(),10)].indexOf("font")){for(var l=a[1].split(" "),h=0;h<l.length;h++)""===l[Number.parseInt(h.toString(),10)]||l[Number.parseInt(h.toString(),10)].endsWith("pt")||(n+=l[Number.parseInt(h.toString(),10)]+" ");for(;" "!==n&&n.endsWith(" ");)n=n.substring(0,n.length-2);-1!==n.indexOf(",")&&(n=n.split(",")[0])}}else{e=e.get("DA");if(e&&""!==e&&-1!==e.indexOf("Tf")){for(var d=e.split(" "),s=0;s<d.length;s++)if(-1!==d[Number.parseInt(s.toString(),10)].indexOf("Tf")){for(n=d[s-2];""!==n&&1<n.length&&"/"===n[0];)n=n.substring(1);o=Number.parseFloat(d[s-1])}0===o&&(o=8)}}var n=n.trim(),p=Jxt.regular;switch(void 0!==t&&t.has("Font")&&void 0!==(e=t.get("Font").get(n))&&(t=e.get("BaseFont").name,p=this._getFontStyle(t)),n){case"Helv":i=new _xt(Zxt.helvetica,o,p);break;case"Courier":case"Cour":i=new _xt(Zxt.courier,o,p);break;case"Symb":i=new _xt(Zxt.symbol,o,p);break;case"TiRo":case"TiIt":i=new _xt(Zxt.timesRoman,o,p);break;case"ZaDb":i=new _xt(Zxt.zapfDingbats,o,p);break;default:i=new _xt(Zxt.helvetica,o,p)}return i},CFt.prototype._getFontStyle=function(e){var t=Jxt.regular;return e.includes("Bold")?t=Jxt.bold:e.includes("Italic")&&(t=Jxt.italic),t},CFt.prototype._importFormField=function(e,t,i,n){var o,r=this._destinationDocument.form,s=[],a=(i&&i._pageDictionary&&i._pageDictionary.has("Annots")&&(s=i._pageDictionary.get("Annots")),[]);if(this._destinationDocument.form._dictionary.has("Fields")){var l=this._destinationDocument.form;this._fieldCount=l.count;for(var h=0;h<this._fieldCount;h++){var d=l.fieldAt(h).name;this._fieldNames.push(d)}}e._pageDictionary.has("Annots")&&(a=e._pageDictionary.get("Annots"));for(var p,c,u,g,m=t.count,f=0;f<m;++f){var y=t.fieldAt(f);if(y._dictionary.has("Kids"))if(1<(o=y._dictionary.get("Kids")).length){for(var v=0;v<o.length;v++)if(y.itemAt(v).page===e){s=this._insertFormFields(f,n,y,r,i._ref,s,a);break}}else 1===o.length&&y.page===e&&(s=this._insertFormFields(f,n,y,r,i._ref,s,a));else y.page===e&&(s=this._insertFormFields(f,n,y,r,i._ref,s,a))}t._dictionary.has("DR")&&(p=t._dictionary.get("DR"),c=void 0,(p=this._copier._copyDictionary(p)).has("Font")&&(c=p.get("Font")),this._destinationDocument.form._dictionary.has("DR")?(u=this._destinationDocument.form._dictionary.get("DR")).has("Font")&&(g=u.get("Font"),c&&c.forEach(function(e,t){g.set(e,t)}),g._updated=!0):this._destinationDocument.form._dictionary.update("DR",p)),0<s.length&&i._pageDictionary.update("Annots",s)},CFt.prototype._insertFormFields=function(e,t,i,n,o,r,s){var a=new mPt,l=(i._dictionary.has("Kids")?i._dictionary.forEach(function(e,t){"Kids"!==e&&a.update(e,t)}):a=this._copier._copyDictionary(i._dictionary),this._crossReference._getNextReference()),h=(a.objId=l.toString(),n._parseFields(a,o));if(this._crossReference._cacheMap.set(l,h._dictionary),i._dictionary.has("Kids")){for(var d,p,c=i._dictionary.get("Kids"),u=[],g=0;g<c.length;g++)-1!==s.indexOf(c[Number.parseInt(g.toString(),10)])&&(d=i._crossReference._fetch(c[Number.parseInt(g.toString(),10)]),(d=this._copier._copyDictionary(d)).update("P",o),d.update("Parent",l),d._updated=!0,p=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(p,d),r.push(p),u.push(p));a.update("Kids",u),h._kids=u}else h._dictionary.update("P",o),r.push(l);h._dictionary._updated=!0;for(var m=0,f=h.name,y=!1;-1!==this._fieldNames.indexOf(f);)f=h.name+m,y=!0,++m;return y&&(h._dictionary.update("T",f),h._name=f),h._dictionary._updated=!0,0<this._fieldCount?(this._destinationDocument.form._parsedFields.set(this._fieldCount,h),h._annotationIndex=this._fieldCount,this._fieldCount++):(this._destinationDocument.form._parsedFields.set(e,h),h._annotationIndex=e),this._destinationDocument.form._fields.push(l),r},CFt.prototype._mergeFormFieldsWithDocument=function(){var i;0<this._formFieldsCollection.size?(i=this._destinationDocument.form._dictionary.get("Fields"),this._formFieldsCollection.forEach(function(e,t){i[Number.parseInt(t.toString(),10)]=e})):i=this._destinationDocument.form._fields,this._destinationDocument.form._dictionary.get("NeedAppearances")&&this._destinationDocument.form._dictionary.set("NeedAppearances",!1),this._destinationDocument.form._dictionary.set("Fields",i),this._destinationDocument.form._fields=i,this._destinationDocument.form._dictionary._updated=!0},CFt.prototype._importLayers=function(e,t){if(this._isLayersPresent=t,this._isLayersPresent&&this._destinationDocument._catalog._catalogDictionary.has("OCProperties")){var t=this._destinationDocument._catalog._catalogDictionary.get("OCProperties"),i=e.get("OCProperties");if(t.has("OCGs")){var n=t.get("OCGs"),o=i.get("OCGs");if(0<n.length)for(var r=0;r<o.length;r++)n.push(o[Number.parseInt(r.toString(),10)])}if(t._updated=!0,t.has("D")&&i.has("D")){var s=t.get("D"),a=i.get("D");if(s&&a){if(s.has("Order")&&a.has("Order")){var l=s.get("Order"),h=a.get("Order");if(0<l.length&&0<h.length)for(r=0;r<h.length;r++)l.push(h[Number.parseInt(r.toString(),10)])}else a.has("Order")&&s.set("Order",a.get("Order"));if(s.has("RBGroups")&&a.has("RBGroups")){var d=s.get("RBGroups"),p=a.get("RBGroups");if(0<d.length&&0<p.length)for(r=0;r<p.length;r++)d.push(p[Number.parseInt(r.toString(),10)])}else a.has("RBGroups")&&(s.set("RBGroups",a.get("RBGroups")),s._updated=!0);if(s.has("ON")&&a.has("ON")){var c=s.get("ON"),u=a.get("ON");if(0<c.length&&0<u.length)for(r=0;r<u.length;r++)c.push(u[Number.parseInt(r.toString(),10)])}else a.has("ON")&&s.set("ON",a.get("ON"));if(s.has("AS")&&a.has("AS")){var g=s.get("AS"),m=a.get("AS");if(0<g.length&&0<m.length){var f=m[0],y=g[0];if(f instanceof aPt&&y instanceof aPt&&(f=this._crossReference._fetch(f),y=this._crossReference._fetch(y)),f.has("OCGs")&&y.has("OCGs")){var v=f.get("OCGs"),b=y.get("OCGs");if(0<v.length&&0<b.length)for(r=0;r<v.length;r++)b.push(v[Number.parseInt(r.toString(),10)])}for(r=0;r<m.length;r++)g.push(m[Number.parseInt(r.toString(),10)])}}else a.has("AS")&&s.set("AS",a.get("AS"));if(s.has("OFF")&&a.has("OFF")){var w=s.get("OFF"),C=a.get("OFF");if(0<w.length&&0<C.length)for(r=0;r<C.length;r++)w.push(C[Number.parseInt(r.toString(),10)])}else a.has("OFF")&&s.set("OFF",a.get("OFF"))}if(s.has("Locked")&&a.has("Locked")){var S=s.get("Locked"),A=a.get("Locked");if(0<S.length&&0<A.length)for(r=0;r<A.length;r++)S.push(A[Number.parseInt(r.toString(),10)])}else a.has("Locked")&&s.set("Locked",a.get("Locked"))}else i.has("D")&&t.set("D",i.get("D"));t._updated=!0,this._destinationDocument._catalog._catalogDictionary._updated=!0,this._crossReference._allowCatalog=!0}else this._isLayersPresent&&(this._destinationDocument._catalog._catalogDictionary.update("OCProperties",e.get("OCProperties")),this._destinationDocument._catalog._catalogDictionary._updated=!0,this._crossReference._allowCatalog=!0)},CFt.prototype._mergeLayer=function(e,t,i){var n,o,r,s,a,l=this,h=e.get("Resources").get("XObject"),d=(h&&h.forEach(function(e,t){n=l._crossReference._fetch(t)}),n&&(o=n.dictionary.get("Resources")),new Map),h=t.get("Resources");h.has("Properties")?(h.get("Properties").forEach(function(e,t){d.set(e,t)}),s=new mPt(this._crossReference),d.forEach(function(i,n){l._newList.forEach(function(e,t){i===t&&s.set(n,e)})}),o.set("Properties",s),o._updated=!0,s._updated=!0):h.has("XObject")&&(r=o.get("XObject"),h.get("XObject").forEach(function(o,e){e instanceof aPt&&i._fetch(e).dictionary.forEach(function(i,n){"OC"===i&&l._newList.forEach(function(e,t){t===n&&r.has(o)&&((t=r.get(o)).dictionary.set(i,e),t._updated=!0)})})})),0<this._annotationLayer.size&&(a=e._get("Annots"),this._annotationLayer.forEach(function(i,e){var e=a[Number.parseInt(e.toString(),10)],n=l._crossReference._fetch(e);l._newList.forEach(function(e,t){i===t&&n.set("OC",e)})}))},CFt.prototype._exportBookmarks=function(p,c){var u=this;if(0<this._bookmarks.length){var g=this._bookmarks,m=this._destinationDocument.bookmarks,f=p.bookmarks,y=void 0;if(f){var v=[],b={index:0,base:m,kids:f._bookMarkList};p.pageCount!==c&&(b={index:0,base:m,kids:g},y=[]);do{for(var w=this;b.index<b.kids.length;)!function(){var i,n,e,t,o,r,s,a,l,h,d;f=b.kids[b.index],-1!==g.indexOf(f)&&void 0!==y&&-1===y.indexOf(f.title)?(e=f,a=m.add(e.title),t=e.destination,a.color=e.color,a.textStyle=e.textStyle,n=i=o=null,(s=e.namedDestination)?s.destination&&(n=s.destination.page,w._bookmarksPageLinkReference.forEach(function(e,t){n._ref===t&&(i=u._destinationDocument.getPage(e))}),i)&&(l=w._getNamedDestination(s,i),a.namedDestination=l,delete a._dictionary._map.C,w._namedDestinations.push(l._title),h=w._crossReference._getNextReference(),w._crossReference._cacheMap.set(h,l._dictionary),w._namedDestinations.push(h)):t&&(n=t.page,w._bookmarksPageLinkReference.forEach(function(e,t){n._ref===t&&(i=u._destinationDocument.getPage(e))}),i)&&((o=new FDt(i,t.location)).mode=t.mode,o.zoom=t.zoom,o.location=t.location,a.destination=o),m=a,y.push(a.title)):(void 0===y||void 0!==y&&-1===y.indexOf(f.title))&&(t=(e=f).destination,d=r=o=null,s=e.namedDestination,p.pageCount===c)&&(a=m.add(e.title),e._dictionary.has("A")&&a._dictionary.update("A",e._dictionary.get("A")),a.textStyle=e.textStyle,a.color=e.color,s?s._destination&&(d=s.destination.page,w._bookmarksPageLinkReference.forEach(function(e,t){d._ref===t&&(r=u._destinationDocument.getPage(e))}),r)&&(l=w._getNamedDestination(s,r),a.namedDestination=l,delete a._dictionary._map.C,w._namedDestinations.push(l._title),h=w._crossReference._getNextReference(),w._crossReference._cacheMap.set(h,l._dictionary),w._namedDestinations.push(h)):t&&(d=t.page,w._bookmarksPageLinkReference.forEach(function(e,t){d._ref===t&&(r=u._destinationDocument.getPage(e))}),r)&&((o=new FDt(r,t.location)).mode=t.mode,o.zoom=t.zoom,o.location=t.location,a.destination=o),m=a),b.index+=1,0<f.count?(v.push(b),b={index:0,base:m,kids:f._bookMarkList}):m=b.base}();if(0<v.length){for(b=v.pop();b.index===b.kids.length&&0<v.length;)b=v.pop();m=b.base}}while(b.index<b.kids.length)}var e,t;0<this._namedDestinations.length&&((t=new mPt(this._crossReference)).update("Names",this._namedDestinations),e=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(e,t),(t=new mPt(this._crossReference)).update("Dests",e),e=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(e,t),this._destinationDocument._catalog._catalogDictionary.set("Names",e)),this._destinationDocument._catalog._catalogDictionary._updated=!0,this._destinationDocument._catalog._catalogDictionary.isCatalog=!0,this._crossReference._allowCatalog=!0}},CFt.prototype._getNamedDestination=function(e,t){var i=new EDt(e.title);return i.destination=this._getDestination(t,e.destination),i},CFt.prototype._getDestination=function(e,t){e=new FDt(e,t.location);return e._location=t._location,e.mode=t.mode,e.zoom=t.zoom,e.location=t.location,e},CFt.prototype._writeObject=function(e,t,i,n,o,r,s){var a;i instanceof k||"string"==typeof i||"number"==typeof i||"boolean"==typeof i?this._writeDictionary(i,t,o,r,s,null):Array.isArray(i)?(this._writeArray(e,a=[],i,n),this._writeDictionary(null,t,o,r,s,a)):i instanceof mPt?(a=new mPt(this._crossReference),this._writePropertiesDictionary(e,a,i),this._writeDictionary(null,t,o,r,s,a)):i instanceof aPt&&this._crossReference?this._writeObject(e,t,e._crossReference._fetch(i),n,o,r,i):null==i&&this._writeDictionary("null",t,o,r,s,null)},CFt.prototype._writeDictionary=function(e,t,i,n,o,r){var s;i&&e?t.set(i,e):i&&r?t.set(i,r):r&&!o?n.push(r):e?n.push(e):o&&(this._newList&&0<this._newList.size&&this._newList.forEach(function(e,t){t===o&&(s=e)}),s?n.push(s):(t=r,s=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(s,t),t._updated=!0,n.push(s),this._newList.set(o,s)))},CFt.prototype._writeArray=function(e,t,i,n){for(var o=0;o<i.length;o++)this._writeObject(e,null,i[Number.parseInt(o.toString(),10)],n,null,t)},CFt.prototype._writePropertiesDictionary=function(i,n,o){var r=this;o&&0<o.size&&o.forEach(function(e,t){r._writeObject(i,n,t instanceof aPt?o.get(e):t,o,e)})},CFt.prototype._fixDestinations=function(e){var t=this._pageReference;if(0<this._destination.length)for(var i=0;i<this._destination.length;i++){var n,o,r=this._destination[Number.parseInt(i.toString(),10)];r instanceof Array&&0<(r=r).length&&r[0]&&r[0]instanceof aPt&&(n=e._crossReference._fetch(r[0]),o=t.get(n),n&&t.has(n)&&null!==o&&(r[0]=o._ref),n)&&t.has(n)&&null===o&&(r[0]=null)}},CFt.prototype._insertNewPage=function(e,t){var i,n=new OFt,n=(n.size=e.size,n.margins.left=0,n.margins.top=0,n.margins.right=0,void(n.margins.bottom=0)!==this._options&&void 0!==this._options.rotation?n.rotation=this._options.rotation:n.rotation=e.rotation,n.orientation=e.size[0]>e.size[1]?KAt.landscape:KAt.portrait,t=void 0!==t?this._destinationDocument.addPage(t,n):this._destinationDocument.addPage(n),e._pageDictionary);return n._get("MediaBox")&&(i=n._get("MediaBox"),t._pageDictionary.update("MediaBox",i)),n._get("CropBox")&&(i=n._get("CropBox"),t._pageDictionary.update("CropBox",i)),void 0===this._options.rotation&&!e._pageDictionary.has("Rotate")||(n=(n=void 0)!==this._options.rotation?90*Math.floor(this._options.rotation):90*Math.floor(e.rotation),t._pageDictionary.update("Rotate",n=360<=n?n%360:n)),t},CFt.prototype._objectDispose=function(){this._bookmarkHashTable=new Map,this._namedDestinations=[],this._bookmarks=[],this._pageReference=new Map,this._bookmarksPageLinkReference.clear(),this._destination=[],this._newList=new Map,this._annotationLayer=new Map,this._fieldNames=[],this._destinationDocument&&this._destinationDocument._form&&this._destinationDocument._form._widgetReferences&&(this._destinationDocument._form._widgetReferences=[])};var wFt=CFt;function CFt(e,t,i,n,o){this._namedDestinations=[],this._bookmarks=[],this._fields=[],this._pageReference=new Map,this._bookmarksPageLinkReference=new Map,this._destination=[],this._newList=new Map,this._annotationLayer=new Map,this._isLayersPresent=!1,this._fieldNames=[],this._options=new vFt,this._kidsReference=[],this._formFieldsCollection=new Map,this._formFields=[],this._isDuplicatePage=!1,this._fieldCount=0,this._crossReference=e,this._destinationDocument=t,this._sourceDocument=i,this._pageReference=n,void 0!==o&&(this._options=o),this._copier=new SFt(this._crossReference,this._sourceDocument._crossReference)}AFt.prototype._copy=function(e){var t;return e instanceof mPt?t=this._copyDictionary(e):Array.isArray(e)?t=this._copyArray(e):e instanceof SPt?t=this._copyStream(e):e instanceof aPt?t=this._copyReference(e):(e instanceof k||"number"==typeof e||"string"==typeof e||"boolean"==typeof e)&&(t=e),t},AFt.prototype._copyDictionary=function(e,i){var n=this,o=new mPt(this._targetCrossReference);return e&&0<e.size&&e.forEach(function(e,t){("OC"===e&&t instanceof Array||"P"!==e&&"Parent"!==e&&"Dest"!==e&&"OC"!==e&&("AP"!==e||!i))&&null!=(t=n._copy(t))&&o.update(e,t)}),o._updated=!0,o},AFt.prototype._copyArray=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this._copy(e[Number.parseInt(i.toString(),10)]));return t},AFt.prototype._copyStream=function(e){var t,i,n=!1,o=e,r=(e.dictionary.has("Subtype")&&"Image"===e.dictionary.get("Subtype").name?(n=!0,e instanceof IPt?t=e.getByteRange(e.offset,e.end):e&&o.stream&&o.stream instanceof IPt?t="boolean"==typeof o._initialized&&o._cipher?(r=o.stream.end-o.stream.start,o.getBytes(r),o.buffer.subarray(0,o.bufferLength)):(i=o.stream).getByteRange(i.start,i.end):o.stream&&o.stream.stream?t=(o=o.stream).stream instanceof IPt&&"boolean"==typeof o._initialized&&o._cipher?(r=o.stream.end-o.stream.start,o.getBytes(r),o.buffer.subarray(0,o.bufferLength)):o.stream&&o.stream instanceof IPt?(i=o.stream).getByteRange(i.start,i.end):[]:(!(t=e.getBytes())||0===t.length)&&e instanceof DPt&&(t=e._bytes)):(!(t=e.getBytes())||0===t.length)&&e instanceof DPt&&(t=e._bytes),new DPt(Array.from(t)));return r._isImage=n,r.dictionary=this._copyDictionary(e.dictionary),r.dictionary._updated=!0,r},AFt.prototype._copyReference=function(e){var t,i;return this._traversedObjects.has(e)?this._traversedObjects.get(e):(this._traversedObjects.set(e,null),t=this._sourceCrossReference._fetch(e),(t=this._copy(t))instanceof mPt||t instanceof SPt?(i=this._addToDestination(t),this._traversedObjects.set(e,i),i):(this._traversedObjects.set(e,t),t))},AFt.prototype._addToDestination=function(e){var t=this._targetCrossReference._getNextReference();return this._targetCrossReference._cacheMap.set(t,e),e.objId=t.objectNumber+" "+t.generationNumber,t};var SFt=AFt;function AFt(e,t){this._traversedObjects=new Map,this._isGroupingSupport=!1,this._targetCrossReference=e,this._sourceCrossReference=t}Object.defineProperty(IFt.prototype,"_layerPage",{get:function(){return this._pageParsed||this._parseLayerPage(),this._page},enumerable:!0,configurable:!0}),Object.defineProperty(IFt.prototype,"_layerId",{get:function(){return this._pageParsed||this._parseLayerPage(),this._id},set:function(e){this._id=e},enumerable:!0,configurable:!0}),Object.defineProperty(IFt.prototype,"name",{get:function(){return this._name||""},set:function(e){this._name=e,this._dictionary&&this._name&&""!==this.name&&this._dictionary.update("Name",this._name)},enumerable:!0,configurable:!0}),Object.defineProperty(IFt.prototype,"visible",{get:function(){var e;return this._dictionary&&"boolean"==typeof(e=this._dictionary.get("Visible"))&&(this._visible=e),this._visible},set:function(e){this._visible=e,this._dictionary&&this._dictionary.update("Visible",e),this._setVisibility(e),this._document._catalog._catalogDictionary._updated=!0,this._crossReference._allowCatalog=!0},enumerable:!0,configurable:!0}),Object.defineProperty(IFt.prototype,"locked",{get:function(){return this._locked},set:function(e){"boolean"==typeof(this._locked=e)&&this._setLock(e),this._document._catalog._catalogDictionary._updated=!0,this._crossReference._allowCatalog=!0},enumerable:!0,configurable:!0}),Object.defineProperty(IFt.prototype,"printState",{get:function(){return this._printState},set:function(e){this._printState=e,this._printOption?this.printState===C1t.alwaysPrint?this._printOption.update("PrintState",new k("ON")):this.printState===C1t.neverPrint&&this._printOption.update("PrintState",new k("OFF")):this._setPrintState()},enumerable:!0,configurable:!0}),Object.defineProperty(IFt.prototype,"layers",{get:function(){return this._layers||(this._layers=new TFt(this._document,this._layer),this._layers._subLayer=!0),this._layers},enumerable:!0,configurable:!0}),IFt.prototype.createGraphics=function(e){return this._graphics&&!this._needInitializeGraphics||(this._page=e,this._crossReference=e._crossReference,this._parseGraphics()),this._graphics},IFt.prototype._parseGraphics=function(){this._loadContents();var e=new DPt([32,113,32,10]),t=this._crossReference._getNextReference(),e=(this._crossReference._cacheMap.set(t,e),this._page._contents.splice(0,0,t),new DPt([32,81,32,10])),t=this._crossReference._getNextReference(),e=(this._crossReference._cacheMap.set(t,e),this._page._contents.push(t),new DPt([])),t=this._crossReference._getNextReference();this._crossReference._cacheMap.set(t,e),this._page._contents.push(t),this._page._pageDictionary.set("Contents",this._page._contents),this._page._pageDictionary._updated=!0,this._initializeGraphics(e),this._initializeProperties()},IFt.prototype._initializeProperties=function(){var e,t,i=this._graphics._resourceObject;i&&i.has("Properties")?(t=i.get("Properties"))?t.update(this._id,this._referenceHolder):((e=new mPt).update(this._id,this._referenceHolder),i.update("Properties",e)):((t=new mPt).update(this._id,this._referenceHolder),i.update("Properties",t))},IFt.prototype._loadContents=function(){var e,t=this._page._pageDictionary.getRaw("Contents");t&&t instanceof aPt&&(e=t,t=this._crossReference._fetch(e)),t&&t instanceof SPt?this._page._contents=[e]:t&&Array.isArray(t)?this._page._contents=t:this._page._contents=[]},IFt.prototype._initializeGraphics=function(e){var t,i,n,o=!1,r=0,s=0,a=0,l=0,h=this._page.size,d=this._page.mediaBox,p=(d&&4<=d.length&&(r=d[0],s=d[1],a=d[2],l=d[3]),this._page._pageDictionary.has("CropBox")?(d=this._page.cropBox)&&4<=d.length?(t=d[0],p=d[1],i=d[2],n=d[3],(t<0||p<0||i<0||n<0)&&Math.floor(Math.abs(p))===Math.floor(Math.abs(h[1]))&&Math.floor(Math.abs(t))===Math.floor(Math.abs(h[0]))?this._graphics=new aIt([Math.max(t,i),Math.max(p,n)],e,this._crossReference,this._page):(this._graphics=new aIt(h,e,this._crossReference,this._page),this._graphics._cropBox=d)):this._graphics=new aIt(h,e,this._crossReference,this._page):(r<0||s<0||a<0||l<0)&&Math.floor(Math.abs(s))===Math.floor(Math.abs(h[1]))&&Math.floor(Math.abs(a))===Math.floor(Math.abs(h[0]))?(t=Math.max(r,a),i=Math.max(s,l),(t<=0||i<=0)&&(o=!0,r<0&&(r=-r),s<0&&(s=-s),a<0&&(a=-a),l<0&&(l=-l),t=Math.max(r,a),i=Math.max(s,l)),this._graphics=new aIt([t,i],e,this._crossReference,this._page)):this._graphics=new aIt(h,e,this._crossReference,this._page),this._page._pageDictionary.has("MediaBox")&&(this._graphics._mediaBoxUpperRightBound=o?-s:l),this._graphicsState=this._graphics.save(),this._page._origin);0<=p[0]&&0<=p[1]||Math.sign(p[0])!==Math.sign(p[1])?this._graphics._initializeCoordinates():this._graphics._initializeCoordinates(this._page),this._page._isNew||(n=this._page.rotation,Number.isNaN(n))||n===TAt.angle0&&!this._page._pageDictionary.has("Rotate")||(d=void 0,d=this._page._pageDictionary.has("Rotate")?this._page._pageDictionary.get("Rotate"):90*n,r=this._graphics._clipBounds,90===d?(this._graphics.translateTransform(0,h[1]),this._graphics.rotateTransform(-90),this._graphics._clipBounds=[r[0],r[1],h[0],h[1]]):180===d?(this._graphics.translateTransform(h[0],h[1]),this._graphics.rotateTransform(-180)):270===d&&(this._graphics.translateTransform(h[0],0),this._graphics.rotateTransform(-270),this._graphics._clipBounds=[r[0],r[1],h[1],h[0]])),this._page._isNew&&this._page._pageSettings&&(a=this._page._getActualBounds(this._page._pageSettings),this._graphics._clipTranslateMargins(a)),this._needInitializeGraphics=!1,this._graphicsCollection.has(this._graphics)||this._graphicsCollection.set(this._graphics,this._graphics),this._pageGraphics.has(this._page)||this._pageGraphics.set(this._page,this._graphics),-1===this._pages.indexOf(this._page)&&this._pages.push(this._page),this._graphics._layer=this},IFt.prototype._beginLayer=function(e){if(this._graphicsCollection&&(this._graphicsCollection.has(e)?this._graphics=this._graphicsCollection.get(e):this._graphics=e),this._graphics&&this._name&&""!==this._name){if(this._graphics._isEmptyLayer=!0,0!==this._parentLayer.length)for(var t=0;t<this._parentLayer.length;t++)this._parentLayer[Number.parseInt(t.toString(),10)]._id&&""!==this._parentLayer[Number.parseInt(t.toString(),10)]._layerId&&this._graphics._sw._write("/OC /"+this._parentLayer[Number.parseInt(t.toString(),10)]._id+" BDC");e="/OC /"+this._id+" BDC";this.name&&""!==this.name?(this._graphics._sw._write(e),this._isEndState=!0):this._content.write(e)}},IFt.prototype._setVisibility=function(e){var t,i,n,o,r=this._document._catalog._catalogDictionary;(t=r.has("OCProperties")?(t=r.get("OCProperties"))||new mPt(this._crossReference):t)&&(i=r=void 0,(o=(o=t.get("D"))||new mPt(this._crossReference))&&(o.has("ON")&&(i=(i=o.get("ON"))||[]),o.has("OFF")&&(r=(r=o.get("OFF"))||[]),this._referenceHolder&&(e?(r&&-1!==(n=r.indexOf(this._referenceHolder))&&r.splice(n,1),i&&-1!==(n=i.indexOf(this._referenceHolder))&&i.splice(n),i):(i&&-1!==(n=i.indexOf(this._referenceHolder))&&i.splice(n,1),r&&-1!==(n=r.indexOf(this._referenceHolder))&&r.splice(n),r)).push(this._referenceHolder),o._updated=!0),t._updated=!0)},IFt.prototype._setLock=function(e){var t,i,n=this._document._catalog._catalogDictionary;(t=n.has("OCProperties")?(t=n.get("OCProperties"))||new mPt(this._crossReference):t)&&((n=(n=t.get("D"))||new mPt(this._crossReference))&&(i=n.get("Locked"),this._referenceHolder&&(e?i?-1===i.indexOf(this._referenceHolder)&&i.push(this._referenceHolder):(this._lock=[],this._lock.push(this._referenceHolder),n.update("Locked",this._lock)):i&&-1!==(e=i.indexOf(this._referenceHolder))&&i.splice(e,1)),n._updated=!0),t._updated=!0)},IFt.prototype._parseLayerPage=function(){if(this._document)for(var e=0;e<this._document.pageCount;e++){var t=this._document.getPage(e)._pageDictionary,i=this._document.getPage(e);if(t.has("Resources")){t=t.get("Resources");if(t&&(t.has("Properties")||t.has("XObject"))){var n,o,r=t.get("Properties"),t=t.get("XObject");if(r)for(o in n=r._map)if(n[String(o)]instanceof aPt){var s=n[String(o)],a=this._crossReference._fetch(s),l=o;if(this._parseDictionary(a,s,i,l))break}if(t)for(o in n=t._map)if(n[String(o)]instanceof aPt){s=n[String(o)];if((a=this._crossReference._fetch(s).dictionary).has("OC")){var h=o,d=a.getRaw("OC");if(a=this._crossReference._fetch(d),this._parseDictionary(a,d,i,h)){this._layer._xObject.push(h);break}}}}}}},IFt.prototype._parseDictionary=function(e,t,i,n){var o=!1;if(e.has("Name")&&e.has("OCGs")){var r=e.get("OCGs");if(r)for(var s=0;s<r.length;s++)r[Number.parseInt(s.toString(),10)]instanceof aPt&&(t=r[Number.parseInt(s.toString(),10)],e=this._crossReference._fetch(t),o=this._setLayerPage(t,i,n));else t=e.getArray("OCGs"),(e=e.get("OCGs"))&&e.has("Name")&&(o=this._setLayerPage(t,i,n))}else e.has("Name")&&(o=this._setLayerPage(t,i,n));return o},IFt.prototype._setLayerPage=function(e,t,i){var n=!1;return this._layer._referenceHolder&&this._layer._referenceHolder===e&&(n=this._layer._pageParsed=!0,this._layer._layerId=i,this._layer._page=t,-1===this._layer._pages.indexOf(t))&&this._layer._pages.push(t),n},IFt.prototype._setPrintState=function(){var e,t=this._document._catalog._catalogDictionary,t=(t=(e=t.has("OCProperties")?(e=t.get("OCProperties"))||new mPt(this._crossReference):e).get("OCGs"))||[],i=this._dictionary.has("Usage")?this._dictionary.get("Usage"):new mPt,n=(this._layer._printOption=new mPt,this._layer._printOption.update("Subtype",new k("Print")),this._layer._printState===C1t.neverPrint?this._layer._printOption.update("PrintState",new k("OFF")):this._layer.printState===C1t.alwaysPrint&&this._layer._printOption.update("PrintState",new k("ON")),this._crossReference._getNextReference()),i=(this._crossReference._cacheMap.set(n,this._layer._printOption),i.update("Print",n),this._layer._usage=i,this._dictionary.update("Usage",this._layer._usage),[]),o=(i.push(new k("Print")),new mPt),i=(o.update("Category",i),o.update("OCGs",t),o.update("Event",new k("Print")),[]),n=this._crossReference._getNextReference();this._crossReference._cacheMap.set(n,o),i.push(n),(e.get("D")||new mPt(this._crossReference)).update("D",i)};var xFt=IFt;function IFt(){this._visible=!0,this._printState=C1t.printWhenVisible,this._isEndState=!1,this._dictionary=new mPt,this._pages=[],this._subLayer=[],this._locked=!1,this._parentLayer=[],this._child=[],this._graphicsCollection=new Map,this._pageGraphics=new Map,this._pageParsed=!1,this._xObject=[],this._content=new DPt([])}Object.defineProperty(EFt.prototype,"_isSkip",{get:function(){return 0<this._bdcCount},enumerable:!0,configurable:!0}),Object.defineProperty(EFt.prototype,"count",{get:function(){return this._list.length},enumerable:!0,configurable:!0}),EFt.prototype.at=function(e){return this._list[Number.parseInt(e.toString(),10)]},EFt.prototype.add=function(e,t){var i=new xFt;return i._document=this._document,i._crossReference=this._document._crossReference,i.name=e,null!=t&&(i.visible=t),i._layerId="OCG_"+XMt(),i._subLayerPosition=0,i._layer=i,this._addLayer(i),i},EFt.prototype.contains=function(e){if(!e)throw new Error("Layer cannot be null or undefined");if("string"==typeof e){for(var t=0;t<this._list.length;t++)if(this._list[Number.parseInt(t.toString(),10)].name===e)return!0}else if(e instanceof xFt&&-1!==this._list.indexOf(e))return!0;return!1},EFt.prototype.clear=function(){for(var e=this._list.length-1;-1<e;e--){var t=this._list[Number.parseInt(e.toString(),10)];this._removeLayer(t,!0)}this._list.length=0},EFt.prototype.indexOf=function(e){if(e)return this._list.indexOf(e);throw new Error("Layer cannot be null or undefined")},EFt.prototype.move=function(e,t){if(e<0||e>=this._list.length)throw new Error("Index cannot be less than 0 or greater than array length");if(!t)throw new Error("Layer cannot be null or undefined");for(var i,n=0;n<this._list.length;n++)if(this._list[Number.parseInt(n.toString(),10)]===t){i=this.indexOf(this._list[Number.parseInt(n.toString(),10)]);break}null!=i&&i!==e&&(this._list.splice(i,1),this._list.splice(e,0,t),this._insertLayer(e,t))},EFt.prototype.removeAt=function(e,t){if(e<0||e>=this._list.length)throw new Error("Index cannot be less than 0 or greater than array length");var i=this._list[Number.parseInt(e.toString(),10)];if(this._list.splice(e,1),i&&(this._removeLayer(i,t||!1),0<i._child.length))for(var n=0;n<i._child.length;n++){this._removeLayer(i._child[Number.parseInt(n.toString(),10)],!1);var o=this._list.indexOf(i._child[Number.parseInt(n.toString(),10)]);-1!==o&&this._list.splice(o,1)}},EFt.prototype.remove=function(e,t){if(e instanceof xFt){var i=e;-1!==(o=this._list.indexOf(i))&&this.removeAt(o,t||!1)}else if("string"==typeof e)for(var n=0;n<this._list.length;n++){var i=this._list[Number.parseInt(n.toString(),10)],o=this._list.indexOf(i);i.name===e&&-1!==o&&(this.removeAt(o,t||!1),n-=1)}},EFt.prototype._setPrintState=function(e,t){e=e.get("PrintState");e&&e instanceof k&&("ON"===e.name?t.printState=C1t.alwaysPrint:t.printState=C1t.neverPrint)},EFt.prototype._addLayer=function(e){this._list.push(e);var t=this._list.length-1;return this._document instanceof kFt&&this._createLayer(e),e._layer=e,t},EFt.prototype._createLayer=function(e){var t=new mPt(this._crossReference),i=this._createOptionalContentDictionary(e),n=!1;if(this._document&&this._document._catalog&&this._document._catalog._catalogDictionary.has("OCProperties")&&this._isLayerContainsResource){var o=this._document._catalog._catalogDictionary.get("OCProperties");if(o&&o.has("OCGs")){var r=o.get("OCGs");if(r&&i)for(var n=!0,s=0,a=i;s<a.length;s++){var l=a[s];-1===r.indexOf(l)&&r.push(l)}if(o.has("D")){o=o.get("D");if(o){var h=void 0,d=void 0,p=void 0;if(o.has("Order")||o.update("Order",this._document._order),o.has("OFF")&&(d=o.get("OFF")),o.has("ON")&&(h=o.get("ON")),p=o.has("AS")?o.get("AS"):p)for(var c=0;c<p.length;c++){var u=void 0,g=p[Number.parseInt(c.toString(),10)];g instanceof aPt&&(u=this._crossReference._fetch(g))&&u instanceof mPt&&(g=u.get("OCGs"))&&i&&-1===g.indexOf(e._referenceHolder)&&g.push(e._referenceHolder)}e.visible?h&&i&&-1===h.indexOf(e._referenceHolder)&&h.push(e._referenceHolder):d&&i&&-1===d.indexOf(e._referenceHolder)&&d.push(e._referenceHolder)}}this._document._catalog._catalogDictionary._updated=!0}}n||(t.update("OCGs",i),t.update("D",this._createOptionalContentViews()),this._catalog._catalogDictionary.update("OCProperties",t)),this._crossReference._allowCatalog=!0},EFt.prototype._createOptionalContentDictionary=function(e){var t=new mPt(this._crossReference),i=this._crossReference._getNextReference(),n=(this._crossReference._cacheMap.set(i,t),t.update("Name",e.name),t.update("Type",new k("OCG")),t.update("LayerID",new k(e._layerId)),t.update("Visible",e.visible),e.printState!==C1t.alwaysPrint&&e.printState!==C1t.neverPrint&&e.printState!==C1t.printWhenVisible||(n=this._setPrintOption(e),t.update("Usage",n),this._document._printLayer.push(i)),this._document._optionalContentDictionaries.push(i),e._dictionary=t,e._referenceHolder=i,this._document._catalog._catalogDictionary.get("OCProperties"));return this._createSublayer(n,i,e),(e.visible?this._document._on:this._document._off).push(i),this._isLayerContainsResource=!0,this._document._optionalContentDictionaries},EFt.prototype._createOptionalContentViews=function(){var e=new mPt,t=(e.update("Name","Layers"),e.update("Order",this._document._order),e.update("ON",this._document._on),e.update("OFF",this._document._off),[]),i=(t.push(new k("Print")),new mPt),t=(i.update("Category",t),i.update("OCGs",this._document._printLayer),i.update("Event",new k("Print")),this._crossReference._getNextReference());return this._crossReference._cacheMap.set(t,i),this._document._as.push(t),e.update("AS",this._document._as),e},EFt.prototype._setPrintOption=function(e){var t=new mPt,i=new mPt,n=this._crossReference._getNextReference(),o=this._crossReference._getNextReference();return this._crossReference._cacheMap.set(n,t),this._crossReference._cacheMap.set(o,i),i.update("Subtype",new k("Print")),e.printState===C1t.neverPrint?i.update("PrintState",new k("OFF")):e.printState===C1t.alwaysPrint&&i.update("PrintState",new k("ON")),e._usage=t,e._printOption=i,t.update("Print",o),n},EFt.prototype._createSublayer=function(e,t,i){if(this._subLayer){var n;if(i._parent=this._parent,e&&(a=void 0,(l=e.get("D"))&&(a=l.get("Order")),this._document._order)&&a&&(this._document._order=a),0!==this._parent._child.length&&-1!==this._document._order.indexOf(this._parent._referenceHolder)&&(o=this._document._order.indexOf(this._parent._referenceHolder),this._document._order.splice(o+1,1)),this._parent._subLayer.push(t),-1!==this._document._order.indexOf(this._parent._referenceHolder)){var o=this._document._order.indexOf(this._parent._referenceHolder);this._document._order.splice(o+1,0,this._parent._subLayer)}else if(this._parent._parent)-1!==this._parent._parent._subLayer.indexOf(this._parent._referenceHolder)&&(o=this._parent._parent._subLayer.indexOf(this._parent._referenceHolder),1===this._parent._subLayer.length&&this._parent._parent._subLayer.splice(o+1,0,this._parent._subLayer),-1!==this._document._order.indexOf(this._parent._parent._referenceHolder))&&(n=this._document._order.indexOf(this._parent._parent._referenceHolder),this._document._order.splice(n+1,1),this._document._order.splice(n+1,0,this._parent._parent._subLayer));else if(document instanceof kFt)for(var r=0;r<document._order.length;r++)if(Array.isArray(document._order[Number.parseInt(r.toString(),10)])){var s=document._order[Number.parseInt(r.toString(),10)];if(-1!==s.indexOf(this._parent._referenceHolder)){o=s.indexOf(this._parent._referenceHolder);if(1===this._parent._subLayer.length){s.splice(o+1,0,this._parent._subLayer);break}}}if(-1===this._parent._child.indexOf(i)&&this._parent._child.push(i),0===this._parent._parentLayer.length)i._parentLayer.push(this._parent);else{for(r=0;r<this._parent._parentLayer.length;r++)-1===i._parentLayer.indexOf(this._parent._parentLayer[Number.parseInt(r.toString(),10)])&&i._parentLayer.push(this._parent._parentLayer[Number.parseInt(r.toString(),10)]);-1===i._parentLayer.indexOf(this._parent)&&i._parentLayer.push(this._parent)}}else{var a,l;e&&(a=void 0,a=(l=e.get("D"))?l.get("Order"):a)&&(this._document._order=a),this._document._order.push(t)}},EFt.prototype._checkLayerLock=function(e){var t,e=e.get("D");if(t=e&&e.has("Locked")?e.get("Locked"):t)for(var i=0;i<t.length;i++){var n=t[Number.parseInt(i.toString(),10)];n&&n instanceof aPt&&(n=this._layerDictionary.get(n))&&(n.locked=!0)}},EFt.prototype._checkLayerVisible=function(e){var t,i=this._document;if(i._catalog&&i._catalog._catalogDictionary.has("OCProperties")){i=e.get("D");if(t=i&&i.has("OFF")?i.get("OFF"):t)for(var n=0;n<t.length;n++){var o,r=t[Number.parseInt(n.toString(),10)];r instanceof aPt&&(o=this._layerDictionary)&&0<o.size&&r&&o.has(r)&&(o=o.get(r))&&(o.visible=!1,o._dictionary)&&o._dictionary.has("Visible")&&o._dictionary.set("Visible",!1)}}},EFt.prototype._checkParentLayer=function(e){var e=e.get("D");e&&(e=e.get("Order"))&&this._parsingLayerOrder(null,e,this._layerDictionary)},EFt.prototype._parsingLayerOrder=function(e,t,i){for(var n,o=0;o<t.length;o++)if((s=t[Number.parseInt(o.toString(),10)])instanceof aPt){if(n=i.has(s)?i.get(s):n){if(e){if(-1===e._child.indexOf(n)&&e._child.push(n),0!==e._parentLayer.length)for(var r=0;r<e._parentLayer.length;r++)-1!==n._parentLayer.indexOf(e._parentLayer[Number.parseInt(r.toString(),10)])||e._parentLayer[Number.parseInt(r.toString(),10)]instanceof xFt||!e._parentLayer[Number.parseInt(r.toString(),10)]||n._parentLayer.push(e._parentLayer[Number.parseInt(r.toString(),10)]);n._parentLayer.push(e),n._parent=e}t.length>o+1&&Array.isArray(t[o+1])&&(s=t[++o],n._subLayer=s,this._parsingLayerOrder(n,s,i))}}else if(Array.isArray(t[Number.parseInt(o.toString(),10)])){var s=t[Number.parseInt(o.toString(),10)];if(!s||0===s.length)return;"string"==typeof s[0]?this._parsingLayerOrder(e=null,s,i):this._parsingLayerOrder(e=null,t[o],i)}},EFt.prototype._createLayerHierarchical=function(e){var i=this,e=e.get("D");e&&e.has("Order")&&this._layerDictionary&&0<this._layerDictionary.size&&(this._list.splice(0,this._list.length),this._layerDictionary.forEach(function(e,t){e instanceof xFt&&t instanceof aPt&&(e._parent||-1!==i._list.indexOf(e)?0<e._child.length?i._addChildLayer(e._parent):e._parent&&0===e._child.length&&!e._parent.layers.contains(e)&&e._parent.layers._addNestedLayer(e):i._list.push(e))}))},EFt.prototype._addChildLayer=function(e){for(var t=0;t<e._child.length;t++){var i=e._child[Number.parseInt(t.toString(),10)];-1===e.layers.indexOf(i)&&e.layers._addNestedLayer(i)}},EFt.prototype._addNestedLayer=function(e){this._list.push(e);var t=this._list.length-1;return e._layer=e,t},EFt.prototype._removeLayer=function(e,t){var i,n,o,r,s,a;e&&this._document&&((a=this._document._catalog._catalogDictionary)&&a.has("OCProperties")&&((i=a.get("OCProperties"))&&((s=i.get("OCGs"))&&this._removeOCG(e,s),i.has("D")&&((s=i.get("D"))&&(n=r=void 0,s.has("Order")&&(o=s.get("Order"))&&this._removeOrder(e,o,[]),s.has("Locked")&&(o=s.get("Locked"))&&this._removeLocked(e,o),s.has("OFF")&&(n=s.get("OFF")),s.has("ON")&&(r=s.get("ON")),s.has("AS")&&(o=s.get("AS"))&&this._removeUsage(e,o),this._removeVisible(e,r,n)),s._updated=!0),e._layerPage&&(o=e._layerPage._pageDictionary.get("Resources")).has("Properties")&&(r=o.get("Properties"))&&r.has(e._layerId)&&delete r._map[e._layerId],(n=this._crossReference._cacheMap).has(e._referenceHolder)&&(s=this._crossReference._cacheMap.get(e._referenceHolder))&&(o=s.getRaw("Usage"))instanceof aPt&&(s=this._crossReference._cacheMap.get(o))&&(r=s.getRaw("Print"),n.delete(e._referenceHolder),n.delete(o),n.delete(r)),i._updated=!0,a._updated=!0),this._crossReference._allowCatalog=!0),t)&&this._removeLayerContent(e)},EFt.prototype._removeOCG=function(e,t){t&&-1!==t.indexOf(e._referenceHolder)&&t.splice(t.indexOf(e._referenceHolder),1)},EFt.prototype._removeUsage=function(e,t){if(t)for(var i=!1,n=0;n<t.length;n++){var o=t[Number.parseInt(n.toString(),10)];if(o){var r=void 0;if(o instanceof aPt&&(r=this._crossReference._fetch(t[Number.parseInt(n.toString(),10)])),r=o instanceof mPt?o:r){o=r.get("OCGs");if(o&&(-1!==o.indexOf(e._referenceHolder)&&(o.splice(o.indexOf(e._referenceHolder),1),i=!0),i))break}}}},EFt.prototype._removeOrder=function(e,t,i){var n=!1;if(t)for(var o=0;o<t.length;o++){var r=t[Number.parseInt(o.toString(),10)];if(r&&r instanceof aPt&&r===e._referenceHolder){if(o!==t.length-1){if(Array.isArray(t[Number.parseInt(o.toString(),10)+1])){t.splice(o,2),n=!0;break}t.splice(o,1),n=!0;break}t.splice(o,1),n=!0;break}Array.isArray(r)&&i.push(t[Number.parseInt(o.toString(),10)])}if(!n&&i)for(o=0;o<i.length;o++)t=i[Number.parseInt(o.toString(),10)],i.splice(o,1),--o,this._removeOrder(e,t,i)},EFt.prototype._removeVisible=function(e,t,i){var n;e.visible?t&&-1!==t.indexOf(e._referenceHolder)&&-1<(n=t.indexOf(e._referenceHolder))&&t.splice(n,1):i&&-1!==i.indexOf(e._referenceHolder)&&-1<(n=i.indexOf(e._referenceHolder))&&i.splice(n,1)},EFt.prototype._removeLocked=function(e,t){t&&-1!==t.indexOf(e._referenceHolder)&&t.splice(t.indexOf(e._referenceHolder),1)},EFt.prototype._removeLayerContent=function(e){var t,i,n=!1;if(e._layerPage)for(var o=0;o<e._pages.length;o++){var r=e._pages[Number.parseInt(o.toString(),10)]._pageDictionary.get("Resources");if(r&&(t=r.get("Properties"),i=r.get("XObject"),t&&0<e._layerId.trim().length&&t.has(e._layerId)&&delete t._map[e._layerId],i)&&0<e._xObject.length){for(var s=i._map,a=0,l=s;a<l.length;a++){var h=l[a];if(-1!==e._xObject.indexOf(s[String(h)])){delete i._map[String(h)];break}}-1!==e._xObject.indexOf(e._layerId)&&e._xObject.splice(e._xObject.indexOf(e._layerId),1)}for(var d=e._pages[o]._pageDictionary.getArray("Contents"),p=0;p<d.length;p++){for(var c=new DPt([]),u=d[Number.parseInt(p.toString(),10)],g=u.dictionary.objId,m=u.getBytes(),f=(u instanceof DPt?new FPt(u._bytes):new FPt(m))._readContent(),y=0;y<f.length;y++){var v,b=f[Number.parseInt(y.toString(),10)],w=b._operator;"BMC"!==w&&"EMC"!==w&&"BDC"!==w||(v=b._operands,this._processBeginMarkContent(e,w,v,c,g),n=!0),"Do"===w&&-1!==e._xObject.indexOf(b._operands[0])&&(n=!0),n=("q"===w||"Q"===w||"w"===w||"J"===w||"j"===w||"M"===w||"d"===w||"ri"===w||"i"===w||"gs"===w||"g"===w||"cm"===w||"G"===w||"rg"===w||"RG"===w||"k"===w||"K"===w||"cs"===w||"CS"===w||"scn"===w||"SCN"===w||"sc"===w||"SC"===w?n||this._streamWrite(b._operands,w,!1,c):n||this._streamWrite(b._operands,w,!0,c),!1)}0<c.length&&!g&&(u=e._pages[Number.parseInt(o.toString(),10)]._contents[Number.parseInt(p.toString(),10)],(m=this._crossReference._fetch(u))._bytes.length=0,m.write(c.getString()))}e._pages[Number.parseInt(o.toString(),10)]._pageDictionary._updated=!0}},EFt.prototype._processBeginMarkContent=function(e,t,i,n,o){if("BDC"===t){var r=void 0;if(1<i.length&&"OC"===i[0].substring(1)&&(r=i[1].substring(1)),0<this._bdcCount)return void this._bdcCount++;r&&r===e._layerId&&(this._bdcCount++,r=e._pages[0]._pageDictionary.getRaw("Contents"),o)&&(o=o.split(" "),r=r.indexOf(aPt.get(Number(o[0]),Number(o[1]))),e._pages[0]._pageDictionary.getRaw("Contents").splice(r,1))}this._streamWrite(i,t,!0,n),"EMC"===t&&0<this._bdcCount&&this._bdcCount--},EFt.prototype._streamWrite=function(e,t,i,n){if(!i||!this._isSkip){if(e)for(var o=0,r=e;o<r.length;o++){var s=r[o];n.write(s),n.write(" ")}n.write(s=t),n.write("\r\n")}},EFt.prototype._insertLayer=function(e,t){var i,n,o,t=t._referenceHolder;this._document&&(n=this._document._catalog._catalogDictionary).has("OCProperties")&&(n=n.get("OCProperties"))&&(i=n.get("OCGs"),n.has("D"))&&(n=n.get("D"))&&(n=n.get("Order"))&&i&&-1!==n.indexOf(t)&&e<n.length&&n[Number.parseInt(e.toString(),10)]instanceof aPt&&e+1<n.length&&e+2<n.length&&(o=e+2,n[Number.parseInt((e+1).toString(),10)]instanceof aPt)&&n[Number.parseInt(o.toString(),10)]instanceof aPt&&(o=n.indexOf(t),n.splice(o,1),n.splice(e,0,t),-1!==i.indexOf(t))&&(o=i.indexOf(t),i.splice(o,1),i.splice(e,0,t))};var TFt=EFt;function EFt(e,t){if(this._subLayer=!1,this._isLayerContainsResource=!1,this._layerDictionary=new Map,this._bdcCount=0,this._list||(this._list=[]),this._crossReference=e._crossReference,this._catalog=e._catalog,this._document=e,t)this._parent=t;else{var i=void 0;if(this._document&&this._document._catalog&&this._document._catalog._catalogDictionary&&this._document._catalog._catalogDictionary.has("OCProperties")){t=this._document._catalog._catalogDictionary.get("OCProperties");if(t&&t.has("OCGs")){var n=t.get("OCGs");if(n&&Array.isArray(n))for(var o,r,s,a,l,h=0;h<n.length;h++)(l=n[Number.parseInt(h.toString(),10)])instanceof aPt&&(i=this._crossReference._fetch(l),o=new xFt,i)&&(i.has("Name")&&(r=i.get("Name"),o.name=r,o._dictionary=i,o._crossReference=this._document._crossReference,o._referenceHolder=l,(r=i.get("LayerID"))&&(o._layerId=r.name),(r=i.getRaw("Usage"))&&r instanceof mPt&&((a=r.get("Print"))&&a instanceof mPt&&(o._printOption=a).has("PrintState")&&this._setPrintState(a,o),a=r.get("View"))&&a instanceof mPt&&a.has("ViewState")&&"OFF"===a.get("ViewState").name&&(o.visible=!1),r)&&r instanceof aPt&&(r=this._crossReference._fetch(r))&&r instanceof mPt&&((s=r.getRaw("Print"))&&s instanceof aPt&&(s=this._crossReference._fetch(s))&&s instanceof mPt&&(o._printOption=s).has("PrintState")&&this._setPrintState(s,o),s=r.getRaw("View"))&&s instanceof aPt&&(a=this._crossReference._fetch(s))&&a instanceof mPt&&a.has("ViewState")&&"OFF"===a.get("ViewState").name&&(o.visible=!1),o._document=e,o._layer=o,this._layerDictionary.set(l,o),this._list.push(o));this._checkLayerLock(t),this._checkLayerVisible(t),this._checkParentLayer(t),this._createLayerHierarchical(t)}}}}MFt.prototype.addPage=function(){var e=0===this._document.pageCount?0:this._document.pageCount,t=new mPt(this._crossReference),i=(t.update("Type",k.get("Page")),this._crossReference._getNextReference()),n=(this._crossReference._cacheMap.set(i,t),t.objId=i.toString(),t.update("Parent",this._reference),this._dictionary.has("Kids")?(n=this._dictionary.get("Kids"))&&(n.push(i),this._dictionary.update("Kids",n),$kt(this._dictionary,1),this._document._pageCount++):(this._dictionary.update("Kids",[i]),$kt(this._dictionary,1),this._document._pageCount=1),this._pageCount++,new PDt(this._crossReference,e,t,i));return n._pageSettings=this._pageSettings,n._isNew=!0,this._document._pages.set(e,n),n};var DFt=MFt;function MFt(e,t){this._pageCount=0,this._document=e,this._crossReference=e._crossReference;var i,n,o,e=new mPt(this._crossReference),t=(e.update("Type",k.get("Pages")),ePt(e,this._pageSettings=t),this._crossReference._getNextReference()),r=(this._crossReference._cacheMap.set(t,e),e.objId=t.toString(),e.update("Kids",[]),e.update("Count",0),this._dictionary=e,this._reference=t,this._document.pageCount);0===r?(n=this._document._catalog._catalogDictionary._get("Pages"),(i=this._document._catalog._topPagesDictionary)&&(i.has("Kids")?(o=i.get("Kids"))&&(o.push(t),i.update("Kids",o),e.update("Parent",n)):(i.update("Kids",[t]),e.update("Parent",n)))):(i=this._document.getPage(r-1))&&i._pageDictionary&&(n=i._pageDictionary._get("Parent"),r=this._crossReference._fetch(n))&&r.has("Kids")&&(o=r.get("Kids"))&&(o.push(t),r.update("Kids",o),e.update("Parent",n))}Object.defineProperty(PFt.prototype,"_allowImportCustomData",{get:function(){return this._allowCustomData},set:function(e){this._allowCustomData=e},enumerable:!0,configurable:!0}),Object.defineProperty(PFt.prototype,"_linearization",{get:function(){if(!this._linear){var e=void 0;try{e=new YBt(this._stream)}catch(e){}this._linear=e}return this._linear},enumerable:!0,configurable:!0}),Object.defineProperty(PFt.prototype,"_startXRef",{get:function(){var e=this._stream,t=0;if(this._linearization&&this._linearization.isValid)e.reset(),this._find(e,this._endObjSignature)&&(t=e.position+6-e.start);else{for(var i=this._startXrefSignature.length,n=!1,o=e.end;!n&&0<o;)(o-=1024-i)<0&&(o=0),e.position=o,n=this._find(e,this._startXrefSignature,1024,!0);if(n){e.skip(9);for(var r=void 0;EMt(r=e.getByte()););for(var s="";32<=r&&r<=57;)s+=String.fromCharCode(r),r=e.getByte();t=parseInt(s,10),isNaN(t)&&(t=0)}}return t},enumerable:!0,configurable:!0}),Object.defineProperty(PFt.prototype,"isEncrypted",{get:function(){return this._isEncrypted},enumerable:!0,configurable:!0}),Object.defineProperty(PFt.prototype,"isUserPassword",{get:function(){return this._isUserPassword},enumerable:!0,configurable:!0}),Object.defineProperty(PFt.prototype,"pageCount",{get:function(){return void 0===this._pageCount&&(this._pageCount=0,this._linearization&&this._linearization.isValid?this._pageCount=this._linearization.pageCount:this._pageCount=this._catalog.pageCount),this._pageCount},enumerable:!0,configurable:!0}),Object.defineProperty(PFt.prototype,"form",{get:function(){return void 0===this._form&&(this._form=new rFt(this._catalog.acroForm,this._crossReference)),this._form},enumerable:!0,configurable:!0}),Object.defineProperty(PFt.prototype,"flatten",{get:function(){return this._flatten},set:function(e){this._flatten=e},enumerable:!0,configurable:!0}),Object.defineProperty(PFt.prototype,"permissions",{get:function(){var e;return this._crossReference&&void 0!==(e=this._crossReference._permissionFlags)&&(this._permissions=3903&e),this._permissions},enumerable:!0,configurable:!0}),Object.defineProperty(PFt.prototype,"bookmarks",{get:function(){var e,t,i=this._catalog;return i&&(i._catalogDictionary.has("Outlines")?(t=i._catalogDictionary._get("Outlines"),(e=i._catalogDictionary.get("Outlines"))&&(this._bookmarkBase=new SDt(e,this._crossReference),this._bookmarkBase._reference=t,e.has("First"))&&this._bookmarkBase._reproduceTree()):(e=new mPt(this._crossReference),t=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(t,e),i._catalogDictionary.update("Outlines",t),this._crossReference._allowCatalog=!0,this._bookmarkBase=new SDt(e,this._crossReference),this._bookmarkBase._reference=t)),this._bookmarkBase},enumerable:!0,configurable:!0}),Object.defineProperty(PFt.prototype,"fileStructure",{get:function(){return this._fileStructure},enumerable:!0,configurable:!0}),Object.defineProperty(PFt.prototype,"layers",{get:function(){return this._layers||(this._layers=new TFt(this)),this._layers},enumerable:!0,configurable:!0}),PFt.prototype.getPage=function(e){if(e<0||e>=this.pageCount)throw new Error("Invalid page index");var t,i=this._pages.get(e);return i||(i=this._catalog,t=(t=this._linearization)&&t.isValid&&t.pageFirst===e?this._getLinearizationPage(e):i.getPageDictionary(e),i=new PDt(this._crossReference,e,t.dictionary,t.reference),this._pages.set(e,i),i)},PFt.prototype.addPage=function(e,t){void 0!==t?(i=t,this._checkPageNumber(n=e)):void 0===e?(i=new OFt,n=this.pageCount):e instanceof OFt?(i=e,n=this.pageCount):(i=new OFt,this._checkPageNumber(n=e));var i,n,o,r,s,a,t=new mPt(this._crossReference),l=(t.update("Type",k.get("Pages")),t.update("Count",1),ePt(t,i),this._crossReference._getNextReference()),e=(this._crossReference._cacheMap.set(l,t),t.objId=l.toString(),new mPt(this._crossReference)),h=(e.update("Type",k.get("Page")),this._crossReference._getNextReference()),d=(this._crossReference._cacheMap.set(h,e),e.objId=h.toString(),e.update("Parent",l),t.update("Kids",[h]),0===this.pageCount?((r=this._catalog._catalogDictionary._get("Pages"))&&this._catalog._topPagesDictionary?(s=!1,this._catalog._topPagesDictionary.has("Kids")&&(d=this._catalog._topPagesDictionary.get("Kids"))&&(d.push(l),this._catalog._topPagesDictionary.update("Kids",d),s=!0),s||this._catalog._topPagesDictionary.update("Kids",[l]),this._catalog._topPagesDictionary.update("Count",1),t.update("Parent",r)):this._catalog._catalogDictionary.update("Pages",l),this._pages=new Map,this._pageCount=1):(o=this.getPage(n===this.pageCount?n-1:n))&&o._pageDictionary&&(r=o._pageDictionary._get("Parent"),s=this._crossReference._fetch(r))&&s.has("Kids")&&(d=s.get("Kids"))&&(n===this.pageCount?d.push(l):(a=[],d.forEach(function(e){e===o._ref&&a.push(l),a.push(e)}),d=a,this._updatePageCache(n)),s.update("Kids",d),t.update("Parent",r),$kt(s,1),this._pageCount=this.pageCount+1),new PDt(this._crossReference,n,e,h));return d._pageSettings=i,d._isNew=!0,this._pages.set(n,d),d},PFt.prototype.addSection=function(e){var t;return this._isLoaded||(e=e||new OFt,t=new DFt(this,e)),t},PFt.prototype.removePage=function(e){e=e instanceof PDt?e:this.getPage(e);this._removePage(e)},PFt.prototype._checkPageNumber=function(e){if(e<0||e>this.pageCount)throw new Error("Index out of range")},PFt.prototype._updatePageCache=function(e,t){void 0===t&&(t=!0);for(var i=new Map,n=this.pageCount-1;0<=n;n--){var o=this.getPage(n);t?e<=n?(i.set(n+1,o),o._pageIndex=n+1):i.set(n,o):e<n?(i.set(n-1,o),o._pageIndex=n-1):n!==e&&i.set(n,o)}this._pages=i,t||(this._pageCount=this._pages.size)},PFt.prototype._removePage=function(e){var t=this._parseBookmarkDestination();if(t&&t.has(e)){var i=t.get(e);if(i)for(var n=0;n<i.length;n++){var o=i[Number.parseInt(n.toString(),10)];o&&(o=o._dictionary)&&(o.has("A")&&o.update("A",null),o.update("Dest",null))}}this._removePageTemplates(e);for(n=this.form.count-1;0<=n;--n){var r=this.form.fieldAt(n);r&&r.page===e&&this.form.removeFieldAt(n)}this._updatePageCache(e._pageIndex,!1),this._removeParent(e._ref,e._pageDictionary),this._crossReference._cacheMap.has(e._ref)&&(e._pageDictionary._updated=!1),0===this.pageCount&&this._catalog._topPagesDictionary.update("Kids",[])},PFt.prototype._removeParent=function(t,e){var i,n;e.has("Parent")&&(e=e._get("Parent"),i=this._crossReference._fetch(e))&&i.has("Kids")&&(Kkt(n=i.get("Kids"))&&1===n.length&&i&&"Pages"===i.get("Type").name?this._removeParent(e,i):(n=n.filter(function(e){return e!==t}),i.update("Kids",n),$kt(i,-1)))},PFt.prototype._parseBookmarkDestination=function(){var e=this.bookmarks;if(void 0===this._bookmarkHashTable&&e){this._bookmarkHashTable=new Map;var t=[],i={index:0,kids:e._bookMarkList};do{for(;i.index<i.kids.length;){var n,o,r=(e=i.kids[i.index]).namedDestination;r?r.destination&&(n=r.destination.page,(o=(o=this._bookmarkHashTable.get(n))||[]).push(e),this._bookmarkHashTable.set(n,o)):(r=e.destination)&&(n=r.page,(o=(o=this._bookmarkHashTable.get(n))||[]).push(e),this._bookmarkHashTable.set(n,o)),i.index+=1,0<e.count&&(t.push(i),i={index:0,kids:e._bookMarkList})}if(0<t.length)for(i=t.pop();i.index===i.kids.length&&0<t.length;)i=t.pop()}while(i.index<i.kids.length)}return this._bookmarkHashTable},PFt.prototype._removePageTemplates=function(e){var t;this._catalog._catalogDictionary.has("Names")&&(t=this._catalog._catalogDictionary.get("Names"))&&(this._removeInternalTemplates(t,"Pages",e),this._removeInternalTemplates(t,"Templates",e))},PFt.prototype._removeInternalTemplates=function(e,t,i){var n;e.has(t)&&(n=e.get(t))&&n.has("Names")&&(n=n.getArray("Names"))&&0<n.length&&(n=this._getUpdatedPageTemplates(n,i),(i=new mPt(this._crossReference)).update("Names",n),n=this._crossReference._getNextReference(),this._crossReference._cacheMap.set(n,i),i.objId=n.toString(),e.update(t,n))},PFt.prototype._getUpdatedPageTemplates=function(e,t){if(0<e.length)for(var i=1;i<=e.length;i+=2){var n=e[Number.parseInt(i.toString(),10)];if(n&&t._pageDictionary===n)return e.pop(),e.pop(),e}return e},PFt.prototype.reorderPages=function(e){for(var o=this,r=(e.forEach(function(e){o._checkPageNumber(e)}),this._sortedArray(e)),s=e.slice().sort(function(e,t){return e-t}),t=Array.from({length:this.pageCount},function(e,t){return t}).filter(function(e){return-1===r.indexOf(e)}),i=t.length-1;0<=i;i--)this.removePage(t[Number.parseInt(i.toString(),10)]);for(var a=[],l=new Map,h=this._catalog._catalogDictionary._get("Pages"),d=this,i=0;i<r.length;i++)!function(e){for(var t=d.getPage(s.indexOf(r[Number.parseInt(e.toString(),10)])),i=(t._pageIndex=e,l.set(e,t),new mPt(d._crossReference)),e=(i.update("Type",k.get("Pages")),i.update("Count",1),i.update("Parent",h),d._crossReference._getNextReference()),n=(i.objId=e.toString(),i.update("Kids",[t._ref]),a.push(e),t._pageDictionary.get("Parent"));n&&"Pages"===n.get("Type").name&&(n.forEach(function(e,t){switch(e){case"Parent":case"Kids":case"Type":case"Count":break;case"Resources":o._cloneResources(n.get("Resources"),i);break;default:i.has(e)||i.update(e,t)}}),n.has("Parent"));)n=n.get("Parent");d._crossReference._cacheMap.set(e,i),d._crossReference._fetch(t._ref).update("Parent",e)}(i);this._pages=l,this._catalog&&(e=this._catalog._topPagesDictionary)&&e.has("Kids")&&(e.get("Kids"),e.update("Kids",a))},PFt.prototype._sortedArray=function(e){var t=[];return e.forEach(function(e){-1===t.indexOf(e)&&t.push(e)}),t},PFt.prototype._cloneResources=function(e,t){var i,n=this;t.has("Resources")?(i=t.get("Resources"),e.forEach(function(e,t){i.has(e)?n._cloneInnerResources(e,t,i):i.update(e,t)})):t.update("Resources",e)},PFt.prototype._cloneInnerResources=function(e,t,i){var n,o,r,s;t instanceof mPt?(n=i.get(e))?(o=!1,n.forEach(function(e,t){n.has(e)||(n.update(e,t),o=!0)}),o&&(i._updated=!0)):i.update(e,t):Array.isArray(t)&&((r=i.get(e))?(s=!1,t.forEach(function(e){-1===r.indexOf(e)&&(r.push(e),s=!0)}),s&&(i._updated=!0)):i.update(e,t))},PFt.prototype.save=function(e){if(this._isLoaded||0!==this.pageCount||this.addSection().addPage(),this._doPostProcess(this._flatten),"string"!=typeof e)return this._crossReference._save();Ll.save(e,new Blob([this._crossReference._save()],{type:"application/pdf"}))},PFt.prototype.saveAsBlob=function(){var t=this;return new Promise(function(e){e({blobData:new Blob([t._crossReference._save()],{type:"application/pdf"})})})},PFt.prototype.exportAnnotations=function(e,t){var i,n;if(this._isExport=!0,this._doPostProcessOnAnnotations(),e&&e instanceof BFt?n=e:t&&t instanceof BFt&&(n=t),n){if(n.dataFormat===jAt.xfdf)i=new PIt;else if(n.dataFormat===jAt.json)i=new NIt;else{if(n.dataFormat!==jAt.fdf)return;i=new hFt}i.exportAppearance=n.exportAppearance}else i=new PIt;t=i._exportAnnotations(this);if(!e||"string"!=typeof e)return t;Ll.save(e,new Blob([t],{type:"text/plain"}))},PFt.prototype.exportFormData=function(e,t){var i,n;if(this._doPostProcessOnFormFields(),e&&e instanceof LFt?n=e:t&&t instanceof LFt&&(n=t),n){if(n.dataFormat===jAt.xfdf)i=new PIt(n.exportName);else if(n.dataFormat===jAt.json)i=new NIt(n.exportName);else if(n.dataFormat===jAt.fdf)i=new hFt(n.exportName);else{if(n.dataFormat!==jAt.xml)return;i=new gFt(n.exportName)}i._asPerSpecification=n.asPerSpecification}else(i=new PIt)._asPerSpecification=!1;if(!e||"string"!=typeof e)return i._exportFormFields(this);Ll.save(e,new Blob([i._exportFormFields(this)],{type:"text/plain"}))},PFt.prototype.importAnnotations=function(e,t){t===jAt.xfdf?(new PIt)._importAnnotations(this,"string"==typeof e?DMt(e):e):t===jAt.json?(new NIt)._importAnnotations(this,"string"==typeof e?DMt(e):e):t===jAt.fdf&&(new hFt)._importAnnotations(this,"string"==typeof e?DMt(e):e)},PFt.prototype.importFormData=function(e,t){0<this.form.count&&(t===jAt.xfdf?(new PIt)._importFormData(this,"string"==typeof e?DMt(e):e):t===jAt.json?(new NIt)._importFormData(this,"string"==typeof e?DMt(e):e):t===jAt.fdf?(new hFt)._importFormData(this,"string"==typeof e?DMt(e):e):t===jAt.xml&&(new gFt)._importFormData(this,"string"==typeof e?DMt(e):e))},PFt.prototype.destroy=function(){this._crossReference&&(this._crossReference._destroy(),this._crossReference=void 0),this._catalog&&(this._catalog._destroy(),this._catalog=void 0),this._endObjSignature=void 0,this._headerSignature=void 0,this._pages&&0<this._pages.size&&this._pages.forEach(function(e){e._destroy()}),this._pages&&(this._pages.clear(),this._pages=void 0),this._startXrefSignature=void 0,this._stream=void 0,this._form=void 0,vPt(),this._mergeHelperCache&&(0<this._mergeHelperCache.size&&this._mergeHelperCache.forEach(function(e){e&&e._objectDispose()}),this._mergeHelperCache.clear(),this._mergeHelperCache=void 0)},Object.defineProperty(PFt.prototype,"_destinationCollection",{get:function(){var e;return null!==this._namedDestinationCollection&&void 0!==this._namedDestinationCollection||(this._catalog._catalogDictionary.has("Names")?(e=this._catalog._catalogDictionary.get("Names"),this._namedDestinationCollection=new MDt(e,this._crossReference)):this._namedDestinationCollection=new MDt),this._namedDestinationCollection},enumerable:!0,configurable:!0}),PFt.prototype._getLinearizationPage=function(t){var i=this._catalog,e=this._linearization,n=this._crossReference,e=aPt.get(e.objectNumberFirst,0);try{var o=n._fetch(e);if(o instanceof mPt)if(bPt(o.get("Type"),"Page")||!o.has("Type")&&!o.has("Kids"))return i.pageKidsCountCache.has(e)||i.pageKidsCountCache.put(e,1),i.pageIndexCache.has(e)||i.pageIndexCache.put(e,0),{dictionary:o,reference:e};throw new Mkt("The Linearization dictionary does not point to a valid Page dictionary.")}catch(e){return i.getPageDictionary(t)}},PFt.prototype._checkHeader=function(){var e=this._stream;if(e.reset(),this._find(e,this._headerSignature)){e.moveStart();for(var t="",i=e.getByte();32<i&&!(12<=t.length);)t+=String.fromCharCode(i),i=e.getByte();this._version||(this._version=t.substring(5))}},PFt.prototype._parse=function(e){this._crossReference._parse(e),this._catalog=new eBt(this._crossReference),this._catalog.version&&(this._version=this._catalog.version)},PFt.prototype._find=function(e,t,i,n){void 0===n&&(n=!1);var o=t.length,r=e.peekBytes(i=void 0===i?1024:i),s=r.length-o;if(!(s<=0))if(n)for(var a=o-1,l=r.length-1;a<=l;){for(var h=0;h<o&&r[l-h]===t[a-h];)h++;if(o<=h)return e.position+=l-a,!0;l--}else for(l=0;l<=s;){for(h=0;h<o&&r[l+h]===t[h];)h++;if(o<=h)return e.position+=l,!0;l++}return!1},PFt.prototype._doPostProcess=function(e){this._doPostProcessOnFormFields(e=void 0===e?!1:e),this._doPostProcessOnAnnotations(e)},PFt.prototype._doPostProcessOnFormFields=function(e){var t;void 0===e&&(e=!1),this._catalog._catalogDictionary.has("AcroForm")&&(this.form._doPostProcess(e),e&&(e=this._catalog._catalogDictionary.getRaw("AcroForm"),(t=new mPt(this._crossReference))._updated=!0,e instanceof aPt?this._crossReference._cacheMap.set(e,t):(this.form._dictionary=t,this._crossReference._allowCatalog=!0),this.form._clear()),this.form._isDefaultAppearance?this.form._dictionary.update("NeedAppearances",this.form._isDefaultAppearance):!this.form._isDefaultAppearance&&this.form._dictionary.has("NeedAppearances")&&this.form._isNeedAppearances?this.form._dictionary.update("NeedAppearances",!1):!this.form._isDefaultAppearance&&this.form._dictionary.has("NeedAppearances")&&this.form._dictionary.update("NeedAppearances",this.form.needAppearances))},PFt.prototype._doPostProcessOnAnnotations=function(e){void 0===e&&(e=!1);for(var t=0;t<this.pageCount;t++){var i=this.getPage(t);i.annotations._isExport=this._isExport,i.annotations._doPostProcess(e),e&&(i._pageDictionary.has("Annots")&&(delete i._pageDictionary._map.Annots,i._pageDictionary._updated=!0),i.annotations._clear())}},PFt.prototype._addWatermarkText=function(){if(0<this.pageCount)for(var e=0;e<this._pageCount;e++){var t=this.getPage(e);if(t)try{var i=t.graphics,n=(i.save(),i.setTransparency(.2),i.drawRectangle(0,0,t.size[0],33.75,new fIt([255,255,255])),i.restore(),i.save(),i.setTransparency(.5),new _xt(Zxt.helvetica,12,Jxt.regular)),o=new E1t(MAt.center,T1t.middle);i.drawString("Created with a trial version of Syncfusion Essential PDF",n,[0,0,t.size[0],33.75],null,new fIt([0,0,0]),o),i.restore()}catch(e){}}},PFt.prototype.importPageRange=function(e,t,i,n){if(i<t||t>=e.pageCount)throw new Error("The start index is greater then the end index, which might indicate the error in the program.");this._importPages(e,t,i,n)},PFt.prototype._importPages=function(e,t,i,n){var o,r,s=0;if(void 0!==n&&"number"==typeof n.targetIndex){if(n.targetIndex>this.pageCount)throw new Error("The target index is out of range.");this._targetIndex=n.targetIndex}var a,l=new Map;if(!this._isDuplicatePage)for(var h=0;h<e.pageCount;h++){var d=e.getPage(h);l.set(d._pageDictionary,null)}this._mergeHelperCache||(this._mergeHelperCache=new Map),e._uniqueID||(e._uniqueID=XMt()),this._mergeHelperCache.has(e._uniqueID)?a=this._mergeHelperCache.get(e._uniqueID):(a=new wFt(this._crossReference,this,e,l,n),this._mergeHelperCache.set(e._uniqueID,a));var p=!1;(!this._isDuplicatePage&&e._catalog._catalogDictionary.has("OCProperties")||void 0!==n&&!n.optimizeResources)&&(p=!0,o=e._catalog._catalogDictionary.get("OCProperties"),r=new mPt(this._crossReference),a._writeObject(e,r,o,o,"OCProperties",null,null),r._updated=!0);for(var c=t;c<=i;c++){var u=e.getPage(c);e.form._doPostProcess(e.flatten,u),0<u.annotations.count&&(u.annotations._doPostProcess(e.flatten),e.flatten)&&(u._pageDictionary.has("Annots")&&(delete u._pageDictionary._map.Annots,u._pageDictionary._updated=!0),u.annotations._clear()),e._isSplitDocument?a._importPages(u,this._targetIndex,p,this._isDuplicatePage,n,e._isSplitDocument):a._importPages(u,this._targetIndex,p,this._isDuplicatePage,n),s++,"number"==typeof this._targetIndex&&++this._targetIndex}this._isDuplicatePage||a._fixDestinations(e),a._exportBookmarks(e,s),a._mergeFormFieldsWithDocument(),(p&&!this._isDuplicatePage||void 0!==n&&!n.optimizeResources)&&a._importLayers(r,!0),a._objectDispose(),this._isDuplicatePage=!1},PFt.prototype.importPage=function(e,t,i){"number"==typeof e?(this._isDuplicatePage=!0,t instanceof vFt?this._importPages(this,e,e,t):this._importPages(this,e,e)):e instanceof PDt&&t instanceof PFt&&(e=e._pageIndex,this.importPageRange(t,e,e,i))},PFt.prototype.split=function(){this.splitByFixedNumber(1)},PFt.prototype.splitByFixedNumber=function(e){var t=this.pageCount;if(!(this.splitEvent&&e<=t&&0<e))throw new Error("Invalid split number. Split number should be greater than zero and less than or equal to page count.");for(var i=0,n=0;n<t;n+=e){var o=Math.min(n+e-1,t-1),o=this._importDocumentPages(n,o);this._invokeSplitEvent(i,o),i++}},PFt.prototype.splitByPageRanges=function(e){var t=this.pageCount;if(this.splitEvent)for(var i=0,n=0;n<e.length;n++){var o=e[Number.parseInt(n.toString(),10)];if(Array.isArray(o)&&o.length<2)throw new Error("Invalid page range. Start and end page indexes should be specified.");var r=o[0],o=o[1];if(r<0||o<0||t<=r||t<=o||o<r)throw new Error("Invalid page range: start (${start}) and end (${end}).");r=this._importDocumentPages(r,o);this._invokeSplitEvent(i,r),i++}},PFt.prototype._importDocumentPages=function(e,t){this._isSplitDocument=!0;for(var i=new PFt,n=e;n<=t;n++){var o=this.getPage(n);i.importPage(o,this)}e=i.save();return i.destroy(),e},PFt.prototype._invokeSplitEvent=function(e,t){e=new HFt(e,t);this.splitEvent(this,e)};var kFt=PFt;function PFt(e,t){if(this._headerSignature=new Uint8Array([37,80,68,70,45]),this._startXrefSignature=new Uint8Array([115,116,97,114,116,120,114,101,102]),this._endObjSignature=new Uint8Array([101,110,100,111,98,106]),this._version="",this._permissions=XAt.default,this._isEncrypted=!1,this._isUserPassword=!1,this._hasUserPasswordOnly=!1,this._encryptOnlyAttachment=!1,this._encryptMetaData=!1,this._isExport=!1,this._allowCustomData=!1,this._isDuplicatePage=!1,this._isSplitDocument=!1,this._optionalContentDictionaries=[],this._order=[],this._on=[],this._off=[],this._as=[],this._printLayer=[],this._isLoaded=!0,e){this._stream=new IPt("string"==typeof e?DMt(e):e),this._fileStructure=new fFt,this._crossReference=new KBt(this,t),this._pages=new Map,this._checkHeader(),this._crossReference._setStartXRef(this._startXRef);try{this._parse(!1)}catch(e){if("XRefParseException"!==e.name)throw e;this._parse(!0)}this._crossReference._version=this._version}else{this._isLoaded=!1,this._stream=new IPt([]),this._version="1.4",this._fileStructure=new fFt,this._fileStructure.isIncrementalUpdate=!1,this._crossReference=new KBt(this),this._crossReference._version=this._version,this._crossReference._nextReferenceNumber=1;var e=new mPt(this._crossReference),t=(e.update("Type",k.get("Catalog")),this._crossReference._getNextReference()),i=(this._crossReference._cacheMap.set(t,e),new mPt),t=(i.update("Root",t),this._crossReference._trailer=i,this._crossReference._root=e,new mPt(this._crossReference)),i=(t.update("Type",k.get("Pages")),t.update("Kids",[]),t.update("Count",0),this._crossReference._getNextReference());this._crossReference._cacheMap.set(i,t),e.update("Pages",i),this._catalog=new eBt(this._crossReference),this._pages=new Map}}Object.defineProperty(FFt.prototype,"dataFormat",{get:function(){return this._format},set:function(e){this._format=e},enumerable:!0,configurable:!0}),Object.defineProperty(FFt.prototype,"exportAppearance",{get:function(){return this._exportAppearance},set:function(e){this._exportAppearance=e},enumerable:!0,configurable:!0});var BFt=FFt;function FFt(){this._format=jAt.xfdf,this._exportAppearance=!1}Object.defineProperty(RFt.prototype,"dataFormat",{get:function(){return this._format},set:function(e){this._format=e},enumerable:!0,configurable:!0}),Object.defineProperty(RFt.prototype,"exportName",{get:function(){return this._exportName},set:function(e){this._exportName=e},enumerable:!0,configurable:!0}),Object.defineProperty(RFt.prototype,"asPerSpecification",{get:function(){return this._asPerSpecification},set:function(e){this._asPerSpecification=e},enumerable:!0,configurable:!0});var LFt=RFt;function RFt(){this._format=jAt.xfdf,this._exportName="",this._asPerSpecification=!0}Object.defineProperty(NFt.prototype,"orientation",{get:function(){return this._orientation},set:function(e){this._isOrientation=!0,this._orientation!==e&&(this._orientation=e,this._updateSize(e))},enumerable:!0,configurable:!0}),Object.defineProperty(NFt.prototype,"size",{get:function(){return this._size},set:function(e){this._isOrientation?this._updateSize(e):(this._size=e,this._updateOrientation())},enumerable:!0,configurable:!0}),Object.defineProperty(NFt.prototype,"margins",{get:function(){return this._margins},set:function(e){this._margins=e},enumerable:!0,configurable:!0}),Object.defineProperty(NFt.prototype,"rotation",{get:function(){return this._rotation},set:function(e){4<=(this._rotation=e)&&(this._rotation=e%4)},enumerable:!0,configurable:!0}),NFt.prototype._updateSize=function(e){var t,e=Array.isArray(e)?(t=this.orientation,e):(t=e,this._size);t===KAt.portrait?this._size=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]:this._size=[Math.max(e[0],e[1]),Math.min(e[0],e[1])]},NFt.prototype._updateOrientation=function(){this._orientation=this._size[1]>=this._size[0]?KAt.portrait:KAt.landscape},NFt.prototype._getActualSize=function(){return[this._size[0]-(this._margins._left+this._margins._right),this._size[1]-(this._margins._top+this._margins._bottom)]};var OFt=NFt;function NFt(){this._size=[595,842],this._isOrientation=!1,this._orientation=KAt.portrait,this._size=[595,842],this._margins=new VFt,this._rotation=TAt.angle0}Object.defineProperty(_Ft.prototype,"left",{get:function(){return this._left},set:function(e){this._left=e},enumerable:!0,configurable:!0}),Object.defineProperty(_Ft.prototype,"right",{get:function(){return this._right},set:function(e){this._right=e},enumerable:!0,configurable:!0}),Object.defineProperty(_Ft.prototype,"top",{get:function(){return this._top},set:function(e){this._top=e},enumerable:!0,configurable:!0}),Object.defineProperty(_Ft.prototype,"bottom",{get:function(){return this._bottom},set:function(e){this._bottom=e},enumerable:!0,configurable:!0});var VFt=_Ft;function _Ft(e){this._left=this._right=this._top=this._bottom=void 0===e?40:e}Object.defineProperty(zFt.prototype,"pdfData",{get:function(){return this._pdfData},enumerable:!0,configurable:!0}),Object.defineProperty(zFt.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0});var HFt=zFt;function zFt(e,t){this._index=e,this._pdfData=t}function jFt(e,t,i,n){this._left=0,this._right=0,this._top=0,void(this._bottom=0)===e?(this._left=.5,this._right=.5,this._top=.5,this._bottom=.5):(this._left=e,this._right=i,this._top=t,this._bottom=n)}Object.defineProperty(QFt.prototype,"layout",{get:function(){return this._layout},set:function(e){this._layout=e},enumerable:!0,configurable:!0}),Object.defineProperty(QFt.prototype,"break",{get:function(){return this._break},set:function(e){this._break=e},enumerable:!0,configurable:!0}),Object.defineProperty(QFt.prototype,"paginateBounds",{get:function(){return this._paginateBounds},set:function(e){this._paginateBounds=e,this._boundSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(QFt.prototype,"usePaginateBounds",{get:function(){return this._boundSet},enumerable:!0,configurable:!0});var WFt=QFt;function QFt(e){this._boundSet=!1,this._paginateBounds=[],e?(this.break=e.break,this.layout=e.layout,this.paginateBounds=e.paginateBounds,this._boundSet=e._boundSet):(this.layout=v1t.paginate,this.break=b1t.fitPage)}Object.defineProperty(qFt.prototype,"Page",{get:function(){return this._page},enumerable:!0,configurable:!0}),Object.defineProperty(qFt.prototype,"bounds",{get:function(){return this._bounds},enumerable:!0,configurable:!0});var UFt=qFt;function qFt(e,t){this._page=e,this._bounds=t}var GFt=function(){this.markerWrote=!1,this.markerWidth=0,this.markerX=0},YFt=function(){};XFt=function(e,t){return(XFt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}XFt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ZFt,KFt=rIt),ZFt.prototype._initializeAsync=function(e){var t=new Uint8Array(e.length);null!=e&&"string"==typeof e?t=DMt(e,!1):e instanceof Uint8Array&&(t=e),this._decoder=pMt(t),this.height=this._decoder._height,this.width=this._decoder._width,this._bitsPerComponent=this._decoder._bitsPerComponent},ZFt.prototype._save=function(){var e;this._imageStatus=!0,this._imageStream=this._decoder._getImageDictionary(),this._decoder&&this._decoder instanceof eMt&&(e=this._decoder,this._maskStream=e._maskStream,e._isDecode)&&!e._colorSpace||this._setColorSpace()},ZFt.prototype._setColorSpace=function(){var e,t=this._imageStream.dictionary,i=t.get("ColorSpace");switch("DeviceCMYK"===i.name?e=m1t.cmyk:"DeviceGray"===i.name&&(e=m1t.grayScale),e=this._decoder instanceof eMt&&null!=this._decoder._colorSpace?m1t.indexed:e){case m1t.cmyk:t.update("Decode",[1,0,1,0,1,0,1,0]),t.update("ColorSpace",k.get("DeviceCMYK"));break;case m1t.grayScale:t.update("Decode",[0,1]),t.update("ColorSpace",k.get("DeviceGray"));break;case m1t.rgb:t.update("Decode",[0,1,0,1,0,1]),t.update("ColorSpace",k.get("DeviceRGB"));break;case m1t.indexed:t.update("ColorSpace",this._decoder._colorSpace)}};var XFt,KFt,JFt=ZFt;function ZFt(e){var t=KFt.call(this)||this;return t._imageStatus=!0,t._initializeAsync(e),t}Object.defineProperty(eLt.prototype,"brush",{get:function(){return this._brush},set:function(e){this._brush=e},enumerable:!0,configurable:!0}),Object.defineProperty(eLt.prototype,"pen",{get:function(){return this._pen},set:function(e){this._pen=e},enumerable:!0,configurable:!0}),Object.defineProperty(eLt.prototype,"font",{get:function(){return this._font},set:function(e){this._font=e},enumerable:!0,configurable:!0}),Object.defineProperty(eLt.prototype,"stringFormat",{get:function(){return this._stringFormat},set:function(e){this._stringFormat=e},enumerable:!0,configurable:!0}),Object.defineProperty(eLt.prototype,"text",{get:function(){return this._text},set:function(e){this._text=e},enumerable:!0,configurable:!0}),Object.defineProperty(eLt.prototype,"textIndent",{get:function(){return this._textIndent},set:function(e){this._textIndent=e},enumerable:!0,configurable:!0}),Object.defineProperty(eLt.prototype,"subList",{get:function(){return this._subList},set:function(e){this._subList=e},enumerable:!0,configurable:!0});var $Ft=eLt;function eLt(e,t){if(this._textIndent=0,null==e)throw new Error("Text cannot be null or undenfied.");this._text=e,t&&(t.font&&(this._font=t.font),t.format&&(this._stringFormat=t.format),t.pen&&(this._pen=t.pen),t.brush)&&(this._brush=t.brush)}Object.defineProperty(iLt.prototype,"count",{get:function(){return this._listItems.length},enumerable:!0,configurable:!0}),iLt.prototype.add=function(e,t){if(!e)throw new Error("item should not be null");this._listItems.push(e),t&&(e.textIndent=t)},iLt.prototype.at=function(e){if(null===e)throw new Error("index should not be null");return this._listItems[Number.parseInt(e.toString(),10)]},iLt.prototype.remove=function(e){if(!e)throw new Error("item should not be null");for(var t=!1,i=0;i<this._listItems.length;i++)if(this._listItems[Number.parseInt(i.toString(),10)]===e){t=!0,this._listItems.splice(Number.parseInt(i.toString(),10),1);break}if(!t)throw new Error("item collection does not contain the given content")},iLt.prototype.removeAt=function(e){if(e<0||e>=this._listItems.length)throw new Error("The index should be less than items count or equal to 0");this._listItems.splice(e,1)},iLt.prototype.clear=function(){this._listItems=[]},iLt.prototype.insert=function(e,t,i){if(e<0||e>this._listItems.length)throw new Error("Index should be within the range of items count (inclusive).");if(!t)throw new Error("Item cannot be null.");i&&(t.textIndent=i),this._listItems.splice(e,0,t)},iLt.prototype.indexOf=function(e){if(e)return this._listItems.indexOf(e);throw new Error("Item should be defined.")};var tLt=iLt;function iLt(e){var t=this;this._listItems||(this._listItems=[]),e&&e.forEach(function(e){t.add(new $Ft(e))})}nLt=function(e,t){return(nLt=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])}))(e,t)};var nLt,h=function(e,t){function i(){this.constructor=e}nLt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},oLt=(Object.defineProperty(rLt.prototype,"brush",{get:function(){return this._brush},set:function(e){this._brush=e},enumerable:!0,configurable:!0}),Object.defineProperty(rLt.prototype,"pen",{get:function(){return this._pen},set:function(e){this._pen=e},enumerable:!0,configurable:!0}),Object.defineProperty(rLt.prototype,"font",{get:function(){return this._font},set:function(e){this._font=e},enumerable:!0,configurable:!0}),Object.defineProperty(rLt.prototype,"stringFormat",{get:function(){return this._stringFormat},set:function(e){this._stringFormat=e},enumerable:!0,configurable:!0}),Object.defineProperty(rLt.prototype,"indent",{get:function(){return this._indent},set:function(e){this._indent=e},enumerable:!0,configurable:!0}),Object.defineProperty(rLt.prototype,"textIndent",{get:function(){return this._textIndent},set:function(e){this._textIndent=e},enumerable:!0,configurable:!0}),Object.defineProperty(rLt.prototype,"delimiter",{get:function(){return this._delimiter},set:function(e){this._delimiter=e},enumerable:!0,configurable:!0}),Object.defineProperty(rLt.prototype,"suffix",{get:function(){return this._suffix},set:function(e){this._suffix=e},enumerable:!0,configurable:!0}),Object.defineProperty(rLt.prototype,"enableHierarchy",{get:function(){return this._enableHierarchy},set:function(e){this._enableHierarchy=e},enumerable:!0,configurable:!0}),Object.defineProperty(rLt.prototype,"alignment",{get:function(){return this._alignment},set:function(e){this._alignment=e},enumerable:!0,configurable:!0}),Object.defineProperty(rLt.prototype,"items",{get:function(){return this._itemCollection},set:function(e){this._itemCollection=e},enumerable:!0,configurable:!0}),Object.defineProperty(rLt.prototype,"_markerRightToLeft",{get:function(){return this._alignment===w1t.right},enumerable:!0,configurable:!0}),rLt.prototype.draw=function(e,t,i,n,o,r){if(e instanceof PDt){if(e._isNew)return this._drawInternal(e,t,i,n,o,r);new cLt(this).layout(e.graphics,[t,i,0,0])}else new cLt(this).layout(e,[t,i,0,0])},rLt.prototype._drawInternal=function(e,t,i,n,o,r){var s=new YFt;return s._page=e,null==n?(s._bounds=[t,i,0,0],s._format=new WFt):"number"==typeof n?(s._bounds=[t,i,n,o],s._format=r||new WFt):n instanceof WFt&&(s._bounds=[t,i,0,0],s._format=n),this._layout(s)},rLt.prototype._layout=function(e){return new cLt(this).layoutInternal(e)},rLt);function rLt(){this._textIndent=5,this._indent=10,this._alignment=w1t.left,this._delimiter=".",this._suffix=".",this._enableHierarchy=!1,this._currentIndex=0,this._size=[0,0],this._defaultFont=new _xt(Zxt.helvetica,8)}h(lLt,sLt=oLt),Object.defineProperty(lLt.prototype,"style",{get:function(){return this._style},set:function(e){this._style=e},enumerable:!0,configurable:!0}),Object.defineProperty(lLt.prototype,"startNumber",{get:function(){return this._startNumber},set:function(e){if(e<=0)throw new Error("Start number should be greater than 0.");this._startNumber=e},enumerable:!0,configurable:!0}),lLt.prototype._getNumber=function(){return qkt(this._startNumber+this._currentIndex,this._style)};var sLt,aLt=lLt;function lLt(e,t){var i=sLt.call(this)||this;return i._startNumber=1,i._itemCollection=e||new tLt,t?(t.font&&(i._font=t.font),t.format&&(i._stringFormat=t.format),t.pen&&(i._pen=t.pen),t.brush&&(i._brush=t.brush),t.style?i._style=t.style:i._style=f1t.numeric,t.indent&&(i._indent=t.indent),t.textIndent&&(i._textIndent=t.textIndent),t.alignment&&(i._alignment=t.alignment),t.delimiter&&(i._delimiter=t.delimiter),t.suffix&&(i._suffix=t.suffix)):i._style=f1t.numeric,i}h(dLt,hLt=oLt),Object.defineProperty(dLt.prototype,"style",{get:function(){return this._style},set:function(e){this._style=e},enumerable:!0,configurable:!0}),dLt.prototype._getStyledText=function(){switch(this._style){case y1t.disk:return"l";case y1t.square:return"n";case y1t.asterisk:return"]";case y1t.circle:return"m";default:return""}},dLt.prototype._draw=function(e,t,i,n,o){var r=new _It([0,0,this._size[0],this._size[1]],e._crossReference),s=[0,0,0,0];o&&(s[0]=s[0]+o._width,s[1]=s[1]+o._width),r.graphics.drawString(this._getStyledText(),this._unicodeFont,s,o,n),e.drawTemplate(r,{x:t,y:i,width:r.size[0],height:r.size[1]})};var hLt,hft=dLt;function dLt(e,t){var i=hLt.call(this)||this;return i._itemCollection=e||new tLt,t?(t.font&&(i._font=t.font),t.format&&(i._stringFormat=t.format),t.pen&&(i._pen=t.pen),t.brush&&(i._brush=t.brush),t.style?i._style=t.style:i._style=y1t.disk,t.indent&&(i._indent=t.indent),t.textIndent&&(i._textIndent=t.textIndent),t.alignment&&(i._alignment=t.alignment),t.delimiter&&(i._delimiter=t.delimiter),t.suffix&&(i._suffix=t.suffix)):i._style=y1t.disk,i}var pLt=function(e,t,i){this._list=e,this._index=t,this._number=i},cLt=(uLt.prototype.layout=function(e,t){this._graphics=e;e=new YFt;e._bounds=t,e._format=new WFt,e._format.layout=v1t.onePage,this.layoutInternal(e)},uLt.prototype.layoutInternal=function(e){this._currentPage=e._page,this._bounds=e._bounds.slice(),this._currentPage&&(0===e._bounds[2]&&0===e._bounds[3]&&(t=this._currentPage.graphics.clientSize,this._bounds[2]=t[0]-this._bounds[0],this._bounds[3]=t[1]-this._bounds[1]),this._graphics=this._currentPage.graphics);for(var t,i=new GFt,n=(i.broken=!1,i.y=this._bounds[1],this._curList=this._element,this._indent=this._curList.indent,this._setCurrentParameters(this._curList),this._curList.brush||(this._currentBrush=new fIt([0,0,0])),this._curList.font||(this._currentFont=this._curList._defaultFont),this._curList instanceof aLt&&(this._markerMaxWidth=this._getMarkerMaxWidth(this._curList,this._information)),e._format.layout===v1t.onePage);!this._finish&&(i.y=this._bounds[1],i=this._layoutOnPage(i),!n);)this._currentPage&&!this._finish&&(this._currentPage=this._getNextPage(this._currentPage)),this._graphics=this._currentPage.graphics,0===e._bounds[2]&&0===e._bounds[3]&&(t=this._currentPage.graphics.clientSize,this._bounds[2]=t[0]-this._bounds[0],this._bounds[3]=t[1]-this._bounds[1]),e._format&&e._format.usePaginateBounds&&this._usePaginateBounds&&(this._bounds=e._format._paginateBounds);this._information=[];var o=[this._bounds[0],i.y,this._bounds[2],this._resultHeight],o=new UFt(this._currentPage,o);return this._currentFormat&&(this._currentFormat._isList=!1),o},uLt.prototype._layoutOnPage=function(e){var t=0,i=0,n=this._bounds[1],o=this._bounds[0];for(this._size=[this._bounds[2]-this._indent,this._bounds[3]];;){for(;this._index<this._curList.items.count;++this._index){var r,s=this._curList.items.at(this._index),a=this._drawItem(e,o,this._curList,this._index,this._indent,this._information,s,t,n);if(e=a.pageResult,t=a.height,n=a.y,i+=t,e.broken)return e;e.markerWrote=!1,s.subList&&0<s.subList.items.count&&(this._curList instanceof aLt?((a=this._curList)._currentIndex=this._index,(r=new pLt(this._curList,this._index,a._getNumber()))._brush=this._currentBrush,r._font=this._currentFont,r._format=this._currentFormat,r._pen=this._currentPen,r._markerWidth=this._markerMaxWidth):((r=new pLt(this._curList,this._index))._brush=this._currentBrush,r._font=this._currentFont,r._format=this._currentFormat,r._pen=this._currentPen),this._information.push(r),this._curList=s.subList,this._curList instanceof aLt&&(this._markerMaxWidth=this._getMarkerMaxWidth(this._curList,this._information)),this._index=-1,this._indent+=this._curList.indent,this._size[0]=this._size[0]-this._curList.indent,this._setCurrentParameters(s),this._setCurrentParameters(this._curList))}if(0===this._information.length){this._resultHeight=i,this._finish=!0;break}var l=this._information.pop();this._index=l._index+1,this._indent-=this._curList.indent,this._size[0]=this._size[0]+this._curList.indent,this._markerMaxWidth=l._markerWidth,this._currentBrush=l._brush,this._currentPen=l._pen,this._currentFont=l._font,this._currentFormat=l._format,this._curList=l._list}return e},uLt.prototype._drawItem=function(e,t,i,n,o,r,s,a,l){var h,d=new q1t,p=i.textIndent,c=a+l,u=o+t,t=0,g=this._size,m=s.text,f=this._currentBrush,y=0,v=(s.brush&&(f=s.brush),this._currentPen),b=(s.pen&&(v=s.pen),this._currentFont),w=(s.font&&(b=s.font),this._currentFormat);if(s.stringFormat&&(w=s.stringFormat),(this._size[0]<=0||this._size[0]<b.size)&&this._currentPage)throw new Error("There is not enough space to layout list.");this._size[1]=this._size[1]-a,e.broken&&(m=e.itemText,S=e.markerText);var C=!0,n=this._createMarkerResult(n,i,r,s);if(n?(i instanceof aLt?(u+=this._markerMaxWidth,e.markerWidth=this._markerMaxWidth):(u+=n._actualSize[0],e.markerWidth=n._actualSize[0]),y=n._actualSize[1],this._currentPage&&(C=y<this._size[1]),n._empty&&(C=!1)):(u+=i._size[0],e.markerWidth=i._size[0],y=i._size[1],this._currentPage&&(C=y<this._size[1])),S&&""!==S||(C=!0),m&&C){if((g=this._size)[0]=g[0]-e.markerWidth,0===s.textIndent?g[0]=g[0]-p:g[0]=g[0]-s.textIndent,(g[0]<=0||g[0]<b.size)&&this._currentPage)throw new Error("Not enough space to layout the text. The marker is too long or there is not enough space to draw it.");var r=u,S=(i._markerRightToLeft?(r-=e.markerWidth,!w||w.alignment!==MAt.right&&w.alignment!==MAt.center||(r-=o)):0===s.textIndent?r+=p:r+=s.textIndent,!this._currentPage&&w&&((w=Object.assign({},w)).alignment=MAt.left),h=d._layout(m,b,w,g),[r,c,g[0],g[1]]);this._graphics._drawStringLayoutResult(h,b,v,f,S,w),l=c,t=h._actualSize[1]}if(a=t<y?y:t,h&&h._remainder&&""!==h._remainder||n&&n._remainder&&""!==n._remainder||!C?(a=l=0,h?(e.itemText=h._remainder,h._remainder===s.text&&(C=!1)):e.itemText=C?void 0:s.text,e.markerText=n?n._remainder:void 0,e.broken=!0,e.y=0,this._bounds[1]=0):e.broken=!1,h){if(e.markerX=u,w)switch(w.alignment){case MAt.right:e.markerX=u+g[0]-h._actualSize[0];break;case MAt.center:e.markerX=u+g[0]/2-h._actualSize[0]/2}i._markerRightToLeft&&(e.markerX+=h._actualSize[0],0===s.textIndent?e.markerX+=p:e.markerX+=s.textIndent,!w||w.alignment!==MAt.right&&w.alignment!==MAt.center||(e.markerX-=o))}return C&&!e.markerWrote&&(e.markerWrote=this._drawMarker(i,s,n,c,e.markerX),i instanceof aLt?e.markerWidth=n._actualSize[0]:e.markerWidth=i._size[0]),{pageResult:e,height:a,y:l}},uLt.prototype._createMarkerResult=function(e,t,i,n){return t instanceof aLt?this._createOrderedMarkerResult(t,n,e,i,!1):this._createUnorderedMarkerResult(t,n)},uLt.prototype._drawMarker=function(e,t,i,n,o){return e instanceof aLt?e.font&&i&&(e.font.size>i._actualSize[1]&&(n+=e.font.size/2-i._actualSize[1]/2,i._actualSize[1]=i._actualSize[1]+n),this._drawOrderedMarker(e,i,t,o,n)):(e.font&&i&&e.font.size>i._actualSize[1]&&(n+=e.font.size/2-i._actualSize[1]/2,i._actualSize[1]=i._actualSize[1]+n),this._drawUnorderedMarker(e,i,t,o,n)),!0},uLt.prototype._drawUnorderedMarker=function(e,t,i,n,o){var r=this._getMarkerFont(e,i),s=this._getMarkerPen(e,i),i=this._getMarkerBrush(e,i);t?(e._size=t._actualSize,e._unicodeFont=new _xt(Zxt.zapfDingbats,r.size),e._draw(this._graphics,n-t._actualSize[0],o,i,s)):(e._size=[r.size,r.size],e._draw(this._graphics,n-r.size,o,i,s))},uLt.prototype._drawOrderedMarker=function(e,t,i,n,o){var r=this._getMarkerFont(e,i),s=this._getMarkerPen(e,i),a=this._getMarkerBrush(e,i),n=[n-this._markerMaxWidth,o,this._markerMaxWidth,t._actualSize[1]],o=this._setMarkerStringFormat(e,this._getMarkerFormat(e,i));this._graphics._drawStringLayoutResult(t,r,s,a,n,o)},uLt.prototype._setCurrentParameters=function(e){e.brush&&(this._currentBrush=e.brush),e.pen&&(this._currentPen=e.pen),e.font&&(this._currentFont=e.font),e.stringFormat&&(this._currentFormat=e.stringFormat,e instanceof oLt)&&(this._currentFormat._isList=!0)},uLt.prototype._getMarkerMaxWidth=function(e,t){for(var i=-1,n=0;n<e.items.count;n++){var o=this._createOrderedMarkerResult(e,e.items.at(n),n+e.startNumber,t,!0);i<o._actualSize[0]&&(i=o._actualSize[0])}return i},uLt.prototype._createUnorderedMarkerResult=function(e,t){var t=this._getMarkerFont(e,t),i=new q1t,t=new _xt(Zxt.zapfDingbats,t.size),i=i._layout(e._getStyledText(),t,null,this._size);return e._size=i._actualSize,e.pen&&(i._size=[i._actualSize[0]+2*e.pen._width,i._actualSize[1]+2*e.pen._width]),i},uLt.prototype._createOrderedMarkerResult=function(e,t,i,n,o){e._currentIndex=i;var r="";if(e.style!==f1t.none&&(r=e._getNumber()+e.suffix),e.enableHierarchy)for(var s=n.slice(),a=0;a<s.length;a++){var l=s[Number.parseInt(a.toString(),10)],h=l._list;if(!(h&&h instanceof aLt&&h.style!==f1t.none))break;if(r=l._number+h.delimiter+r,!h.enableHierarchy)break}var i=new q1t,n=this._getMarkerFont(e,t),t=this._getMarkerFormat(e,t),d=[0,0];return o||(d[0]=this._markerMaxWidth,t=this._setMarkerStringFormat(e,t)),i._layout(r,n,t,d)},uLt.prototype._setMarkerStringFormat=function(e,t){return t=t?Object.assign({},t):new E1t,e.stringFormat||(t.alignment=MAt.right,e._markerRightToLeft&&(t.alignment=MAt.left)),!this._currentPage&&t&&((t=Object.assign({},t)).alignment=MAt.left),t},uLt.prototype._getMarkerFont=function(e,t){var i=(i=(i=e.font)||t.font)||this._currentFont;return e.font=i},uLt.prototype._getMarkerFormat=function(e,t){e=e.stringFormat;return e=(e=e||t.stringFormat)||this._currentFormat},uLt.prototype._getMarkerPen=function(e,t){e=e.pen;return e=(e=e||t.pen)||this._currentPen},uLt.prototype._getMarkerBrush=function(e,t){e=e.brush;return e=(e=e||t.brush)||this._currentBrush},uLt.prototype._getNextPage=function(e){var t=e._crossReference._document;return e._pageIndex<t.pageCount-1?t.getPage(e._pageIndex+1):t.addPage()},uLt);function uLt(e){this._indent=0,this._information=[],this._markerMaxWidth=0,this._finish=!1,this._usePaginateBounds=!0,this._resultHeight=0,this._size=[0,0],this._index=0,this._element=e}mLt.prototype.initializeNavigationPane=function(){!F.isDevice||this.pdfViewer.enableDesktopMode?this.createNavigationPane():(this.commentPanelContainer=Q("div",{id:this.pdfViewer.element.id+"_commantPanel",className:"e-pv-mobile-comments-container"}),this.pdfViewerBase.mainContainer.appendChild(this.commentPanelContainer),this.pdfViewer.enableRtl?this.commentPanelContainer.style.left="0px":this.commentPanelContainer.style.right="0px",this.commentPanelContainer.style.bottom="0px",this.createCommentPanelTitleContainer(),this.commentPanelContainer.style.display="none",this.commentsContentContainer=Q("div",{id:this.pdfViewer.element.id+"_commentscontentcontainer",className:"e-pv-comments-content-container"}),this.commentPanelContainer.appendChild(this.commentsContentContainer),this.createFileElement(this.commentPanelContainer),this.createXFdfFileElement(this.commentPanelContainer))},mLt.prototype.createNavigationPane=function(){N?(this.sideBarToolbar=this.pdfViewer.element.querySelector(".e-pv-sidebar-toolbar"),this.sideBarToolbarSplitter=this.pdfViewer.element.querySelector(".e-pv-sidebar-toolbar-splitter"),this.sideBarContentContainer=this.pdfViewer.element.querySelector(".e-pv-sidebar-content-container"),this.sideBarContentSplitter=this.pdfViewer.element.querySelector(".e-pv-sidebar-content-splitter"),this.sideBarContent=this.pdfViewer.element.querySelector(".e-pv-sidebar-content"),this.sideBarTitleContainer=this.pdfViewer.element.querySelector(".e-pv-sidebar-title-container"),this.sideBarTitle=this.pdfViewer.element.querySelector(".e-pv-sidebar-title"),this.sideBarResizer=this.pdfViewer.element.querySelector(".e-pv-sidebar-resizer")):(this.sideBarToolbar=Q("div",{id:this.pdfViewer.element.id+"_sideBarToolbar",className:"e-pv-sidebar-toolbar",attrs:{role:"toolbar","aria-orientation":"vertical",tabindex:"-1","aria-label":"Sidebar Toolbar"}}),this.sideBarToolbarSplitter=Q("div",{id:this.pdfViewer.element.id+"_sideBarToolbarSplitter",className:"e-pv-sidebar-toolbar-splitter"}),this.sideBarContentContainer=Q("div",{id:this.pdfViewer.element.id+"_sideBarContentContainer",className:"e-pv-sidebar-content-container"}),this.sideBarContentSplitter=Q("div",{id:this.pdfViewer.element.id+"_sideBarContentSplitter",className:"e-pv-sidebar-content-splitter"}),this.sideBarContent=Q("div",{id:this.pdfViewer.element.id+"_sideBarContent",className:"e-pv-sidebar-content"}),this.sideBarTitleContainer=Q("div",{id:this.pdfViewer.element.id+"_sideBarTitleContainer",className:"e-pv-sidebar-title-container"}),this.sideBarTitle=Q("div",{id:this.pdfViewer.element.id+"_sideBarTitle",className:"e-pv-sidebar-title",attrs:{tabindex:"-1"}}),this.sideBarResizer=Q("div",{id:this.pdfViewer.element.id+"_sideBarResizer",className:"e-pv-sidebar-resizer"})),this.pdfViewerBase.mainContainer.appendChild(this.sideBarToolbar),this.pdfViewer.enableRtl&&(this.sideBarToolbar.style.cssFloat="right",this.sideBarToolbar.style.right="1px",this.sideBarToolbar.style.position="relative"),this.pdfViewerBase.mainContainer.appendChild(this.sideBarToolbarSplitter),this.pdfViewer.enableRtl?this.sideBarToolbarSplitter.classList.add("e-right"):this.sideBarToolbarSplitter.classList.add("e-left"),this.pdfViewer.enableRtl?this.sideBarContentContainer.classList.add("e-right"):this.sideBarContentContainer.classList.add("e-left"),this.pdfViewerBase.mainContainer.appendChild(this.sideBarContentContainer),this.pdfViewer.enableRtl&&(this.sideBarContentSplitter.style.right="0px"),this.sideBarContentContainer.appendChild(this.sideBarContentSplitter),this.pdfViewer.enableRtl&&(this.sideBarContent.style.right="0px",this.sideBarContent.style.direction="rtl"),this.sideBarContentContainer.appendChild(this.sideBarContent),this.pdfViewer.enableRtl&&(this.sideBarTitleContainer.style.right="0px"),this.pdfViewer.enableRtl?this.sideBarTitle.classList.add("e-right"):this.sideBarTitle.classList.add("e-left"),this.sideBarTitleContainer.appendChild(this.sideBarTitle),this.sideBarContentContainer.appendChild(this.sideBarTitleContainer),this.sideBarResizer.addEventListener("mousedown",this.resizePanelMouseDown),this.pdfViewerBase.mainContainer.addEventListener("mousemove",this.resizePanelMouseMove),this.pdfViewerBase.mainContainer.addEventListener("mouseup",this.resizeViewerMouseLeave),this.pdfViewer.enableRtl?this.sideBarResizer.classList.add("e-right"):this.sideBarResizer.classList.add("e-left"),this.sideBarContentContainer.appendChild(this.sideBarResizer),this.createCommentPanel();var e=this.getViewerContainerLeft(),t=this.getViewerContainerRight();this.pdfViewer.enableRtl||(this.pdfViewerBase.viewerContainer.style.left=e+"px",this.pdfViewerBase.viewerContainer.style.right=t+"px"),this.pdfViewerBase.viewerContainer.style.width=this.pdfViewer.element.clientWidth-e-this.commentPanelContainer.clientWidth+"px",this.sideBarContentContainer.style.display="none",this.pdfViewer.enableNavigationToolbar||(this.pdfViewer.enableRtl?this.sideBarContentContainer.style.right="0px":this.sideBarContentContainer.style.left="0px"),this.createSidebarToolBar(),this.createSidebarTitleCloseButton(),this.createResizeIcon(),this.sideBarToolbar.addEventListener("mouseup",this.sideToolbarOnMouseup.bind(this)),this.sideBarContentContainer.addEventListener("mouseup",this.sideBarTitleOnMouseup.bind(this))},mLt.prototype.adjustPane=function(){var e,t,i,n,o;N?(i=this.pdfViewer.element.querySelector(".e-pv-sidebar-toolbar-splitter"),e=this.pdfViewer.element.querySelector(".e-pv-sidebar-toolbar"),t=this.pdfViewer.element.querySelector(".e-pv-sidebar-content-container"),0===(o=(n=this.pdfViewer.element.querySelector(".e-pv-toolbar")).getBoundingClientRect().height)&&(o=parseFloat(window.getComputedStyle(n).height)+1),this.pdfViewer.enableToolbar||(o=0),e.style.top=o+"px",t.style.top=o+"px",i.style.top=o+"px",e.style.height=this.getSideToolbarHeight(o),t.style.height=this.getSideToolbarHeight(o),i.style.height=this.getSideToolbarHeight(o),this.pdfViewerBase.viewerContainer.style.height=this.getSideToolbarHeight(o)):(i=this.pdfViewerBase.getElement("_sideBarToolbarSplitter"),0===(o=(n=this.pdfViewerBase.getElement("_toolbarContainer")).clientHeight)&&(o=parseFloat(window.getComputedStyle(n).height)+1),this.sideBarToolbar.style.top=o+"px",this.sideBarContentContainer.style.top=o+"px",i.style.top=o+"px")},mLt.prototype.getSideToolbarHeight=function(e){var t=this.pdfViewer.element.getBoundingClientRect().height;return 0!==t?t-e+"px":""},mLt.prototype.createCommentPanel=function(){this.commentPanelContainer=Q("div",{id:this.pdfViewer.element.id+"_commantPanel",className:"e-pv-comment-panel"}),this.pdfViewerBase.mainContainer.appendChild(this.commentPanelContainer),this.pdfViewer.enableRtl?this.commentPanelContainer.style.left="0px":this.commentPanelContainer.style.right="0px",this.commentPanelContainer.style.bottom="0px",this.createCommentPanelTitleContainer(),this.commentPanelContainer.style.display="none",this.commentsContentContainer=Q("div",{id:this.pdfViewer.element.id+"_commentscontentcontainer",className:"e-pv-comments-content-container"}),this.commentPanelContainer.appendChild(this.commentsContentContainer),this.commentPanelResizer=Q("div",{id:this.pdfViewer.element.id+"_commentPanelResizer",className:"e-pv-comment-panel-resizer"}),this.pdfViewer.enableRtl?this.commentPanelResizer.classList.add("e-left"):this.commentPanelResizer.classList.add("e-right"),this.commentPanelResizer.style.display="none",this.commentPanelResizer.addEventListener("mousedown",this.commentPanelMouseDown),this.pdfViewerBase.mainContainer.appendChild(this.commentPanelResizer),this.createCommentPanelResizeIcon(),this.createFileElement(this.commentPanelContainer),this.createXFdfFileElement(this.commentPanelContainer)},mLt.prototype.createCommentPanelTitleContainer=function(){var e,t=Q("div",{id:this.pdfViewer.element.id+"_commentPanelTitleContainer",className:"e-pv-comment-panel-title-container"}),i=Q("div",{id:this.pdfViewer.element.id+"_commentPanelTitle",className:"e-pv-comment-panel-title",attrs:{tabindex:"-1"}}),n=(N?this.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_Comments").then(function(e){i.innerText=e}):i.innerText=this.pdfViewer.localeObj.getConstant("Comments"),Q("button",{id:this.pdfViewer.element.id+"_annotations_btn"})),o=(n.setAttribute("aria-label","annotation button"),n.setAttribute("type","button"),n.className="e-btn e-pv-tbar-btn e-pv-comment-panel-title-close-div e-btn",Q("span",{id:this.pdfViewer.element.id+"_annotation_more_icon",className:"e-pv-more-icon e-pv-icon"}));n.appendChild(o),!F.isDevice||this.pdfViewer.enableDesktopMode||N||((o=Q("button")).setAttribute("aria-label","annotation button"),o.setAttribute("type","button"),o.style.borderColor="transparent",o.style.paddingTop="11px",o.style.paddingBottom="11px",o.style.backgroundColor="transparent",o.addEventListener("click",this.closeCommentPanelContainer.bind(this)),i.style.left="37px",e=Q("span",{className:"e-pv-annotation-tools-close-icon e-pv-icon"}),o.appendChild(e),t.appendChild(o)),t.appendChild(i),t.appendChild(n),this.commentPanelContainer.appendChild(t),this.createAnnotationContextMenu(),n.addEventListener("click",this.openAnnotationContextMenu.bind(this))},mLt.prototype.createCommentPanelResizeIcon=function(){this.commentPanelResizeIcon=Q("div",{id:this.pdfViewer.element.id+"_commentPanel_resize",className:"e-pv-resize-icon e-pv-icon"}),this.setCommentPanelResizeIconTop(),this.commentPanelResizeIcon.style.position="absolute",this.commentPanelResizer.appendChild(this.commentPanelResizeIcon)},mLt.prototype.openAnnotationContextMenu=function(e){this.annotationMenuObj.open(e.clientY,e.clientX,e.currentTarget)},mLt.prototype.createAnnotationContextMenu=function(){this.annotationContextMenu=[{text:this.pdfViewer.localeObj.getConstant("Export Annotations")},{text:this.pdfViewer.localeObj.getConstant("Import Annotations")},{text:this.pdfViewer.localeObj.getConstant("Export XFDF")},{text:this.pdfViewer.localeObj.getConstant("Import XFDF")}];var e=Q("ul",{id:this.pdfViewer.element.id+"_annotation_context_menu"});this.pdfViewer.element.appendChild(e),this.annotationMenuObj=new D4({target:"#"+this.pdfViewer.element.id+"_annotations_btn",items:this.annotationContextMenu,select:this.annotationMenuItemSelect.bind(this)}),this.pdfViewer.enableRtl&&(this.annotationMenuObj.enableRtl=!0),this.annotationMenuObj.appendTo(e),F.isDevice&&!this.pdfViewer.enableDesktopMode?this.annotationMenuObj.animationSettings.effect="ZoomIn":this.annotationMenuObj.animationSettings.effect="SlideDown"},mLt.prototype.annotationMenuItemSelect=function(e){var t;if(this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.inkAnnotationModule&&(t=parseInt(this.pdfViewer.annotationModule.inkAnnotationModule.currentPageNumber,10),this.pdfViewer.annotationModule.inkAnnotationModule.drawInkAnnotation(t)),e.item)switch(e.item.text){case this.pdfViewer.localeObj.getConstant("Export Annotations"):this.pdfViewerBase.exportAnnotations(LCt.Json);break;case this.pdfViewer.localeObj.getConstant("Import Annotations"):this.importAnnotationIconClick(e);break;case this.pdfViewer.localeObj.getConstant("Export XFDF"):this.pdfViewerBase.exportAnnotations(LCt.Xfdf);break;case this.pdfViewer.localeObj.getConstant("Import XFDF"):this.importXFdfAnnotationIconClick(e)}},mLt.prototype.createFileElement=function(e){this.annotationInputElement=Q("input",{id:this.pdfViewer.element.id+"_annotationUploadElement",styles:"position:fixed; left:-100em",attrs:{type:"file","aria-label":"upload elements"}}),this.annotationInputElement.setAttribute("accept",".json"),e.appendChild(this.annotationInputElement),this.annotationInputElement.addEventListener("change",this.loadImportAnnotation)},mLt.prototype.createXFdfFileElement=function(e){this.annotationXFdfInputElement=Q("input",{id:this.pdfViewer.element.id+"_annotationXFdfUploadElement",styles:"position:fixed; left:-100em",attrs:{type:"file","aria-label":"upload elements"}}),this.annotationXFdfInputElement.setAttribute("accept",".xfdf"),e.appendChild(this.annotationXFdfInputElement),this.annotationXFdfInputElement.addEventListener("change",this.loadImportAnnotation)},mLt.prototype.importAnnotationIconClick=function(e){this.annotationInputElement.click()},mLt.prototype.importXFdfAnnotationIconClick=function(e){this.annotationXFdfInputElement.click()},mLt.prototype.closeCommentPanelContainer=function(){var e=this,t=document.getElementById(this.pdfViewer.element.id+"_viewerContainer"),i=document.getElementById(this.pdfViewer.element.id+"_pageViewContainer"),n=document.getElementById(this.pdfViewer.element.id+"_commantPanel");n&&(n.style.display="none",e.commentPanelResizer&&(e.commentPanelResizer.style.display="none"),t&&(this.pdfViewer.enableRtl?t.style.left=e.getViewerContainerRight()+"px":t.style.right=e.getViewerContainerRight()+"px",t.style.width=e.pdfViewer.element.clientWidth-e.getViewerContainerLeft()-e.getViewerContainerRight()+"px",i.style.width=e.pdfViewerBase.viewerContainer.offsetWidth-e.getViewerContainerScrollbarWidth()+"px"),e.pdfViewerBase&&e.pdfViewerBase.updateZoomValue(),this.pdfViewer.annotation&&this.pdfViewer.annotation.textMarkupAnnotationModule&&this.pdfViewer.annotation.textMarkupAnnotationModule.showHideDropletDiv(!0),F.isDevice)&&!N&&this.pdfViewer.toolbarModule.annotationToolbarModule.toolbar&&(this.pdfViewer.toolbarModule.annotationToolbarModule.toolbar.element.style.display="block",this.pdfViewer.toolbarModule.annotationToolbarModule.propertyToolbar)&&(this.pdfViewer.toolbarModule.annotationToolbarModule.propertyToolbar.element.style.display="block")},mLt.prototype.createNavigationPaneMobile=function(e){var t,i,n=this;this.isNavigationToolbarVisible=!0,this.toolbarElement=Q("div",{id:this.pdfViewer.element.id+"_navigationToolbar",className:"e-pv-nav-toolbar"}),this.pdfViewerBase.viewerMainContainer.insertBefore(this.toolbarElement,this.pdfViewerBase.viewerContainer),i="search"===e?(i='<div class="e-input-group e-pv-text-search-input-mobile" id="'+this.pdfViewer.element.id+'_search_input_container"><input class="e-input" type="text" placeholder="'+this.pdfViewer.localeObj.getConstant("Find in document")+'" id="'+this.pdfViewer.element.id+'_search_input"></input></div>',t='\n                <span class="e-pv-search-count" id="'+this.pdfViewer.element.id+'_search_count"></span>\n            ',[{prefixIcon:"e-pv-backward-icon e-pv-icon",tooltipText:this.pdfViewer.localeObj.getConstant("Go Back"),id:this.pdfViewer.element.id+"_backward",click:this.goBackToToolbar.bind(this)},{template:i},{prefixIcon:"e-pv-search-icon e-pv-icon",id:this.pdfViewer.element.id+"_search_box-icon",click:function(){var e=n.pdfViewerBase.getElement("_search_box-icon").firstElementChild;e.classList.contains("e-pv-search-close")&&n.enableSearchItems(!1),n.pdfViewer.textSearchModule.searchButtonClick(e,n.searchInput,!0),n.setSearchInputWidth()}},{template:t},{prefixIcon:this.pdfViewer.enableRtl?"e-pv-next-search-icon e-pv-icon":"e-pv-prev-search-icon e-pv-icon",id:this.pdfViewer.element.id+"_prev_occurrence",click:function(e){n.pdfViewer.textSearchModule.searchPrevious(),n.setSearchInputWidth()}},{prefixIcon:this.pdfViewer.enableRtl?"e-pv-prev-search-icon e-pv-icon":"e-pv-next-search-icon e-pv-icon",id:this.pdfViewer.element.id+"_next_occurrence",click:function(e){n.pdfViewer.textSearchModule.searchNext(),n.setSearchInputWidth()}}]):[{prefixIcon:"e-pv-backward-icon e-pv-icon",id:this.pdfViewer.element.id+"_backward",click:this.goBackToToolbar.bind(this)},{text:this.pdfViewer.localeObj.getConstant("Bookmarks")}],this.toolbar=new U3({items:i,width:"",height:"",overflowMode:"Popup"}),this.pdfViewer.enableRtl&&(this.toolbar.enableRtl=!0),this.toolbar.isStringTemplate=!0,this.toolbar.appendTo(this.toolbarElement),"search"===e?((t=this.pdfViewerBase.getElement("_toolbarContainer"))&&(0===(i=t.clientHeight)&&(i=parseFloat(window.getComputedStyle(t).height)+1),this.pdfViewerBase.toolbarHeight=i),this.initiateSearchBox()):this.initiateBookmarks()},mLt.prototype.initiateSearchBox=function(){var t=this;this.searchInput=this.pdfViewerBase.getElement("_search_input"),this.pdfViewer.textSearchModule.searchBtn=this.pdfViewerBase.getElement("_search_box-icon").firstElementChild,this.searchInput.addEventListener("keyup",function(e){t.enableSearchItems(!0);t.searchInput.value;13===e.which?(t.initiateTextSearch(),t.setSearchInputWidth()):t.pdfViewer.textSearchModule.resetVariables()});var e=document.getElementById(this.pdfViewer.element.id+"_search_count").parentElement;e&&(e.style.display="none"),this.pdfViewer.textSearchModule.searchInput=this.searchInput,this.setSearchInputWidth(),this.enableSearchItems(!1),this.searchInput.focus()},mLt.prototype.enableSearchItems=function(e){N?this.pdfViewer._dotnetInstance.invokeMethodAsync("EnableSearchItems",e):(this.toolbar.enableItems(this.pdfViewerBase.getElement("_prev_occurrence").parentElement,e),this.toolbar.enableItems(this.pdfViewerBase.getElement("_next_occurrence").parentElement,e))},mLt.prototype.initiateBookmarks=function(){if(F.isDevice&&!this.pdfViewer.enableDesktopMode){this.pdfViewerBase.mobileScrollerContainer.style.display="none";for(var e=document.querySelectorAll(".e-pv-mobile-annotation-toolbar"),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].style.display="none"}var i=Q("div",{id:this.pdfViewer.element.id+"_bookmarks_container",className:"e-pv-bookmark-container"});i.style.width="100%",i.style.height=this.pdfViewerBase.viewerContainer.style.height,this.pdfViewerBase.getElement("_viewerMainContainer").appendChild(i),this.pdfViewerBase.viewerContainer.style.display="none",this.isBookmarkListOpen=!0,this.pdfViewer.bookmarkViewModule.renderBookmarkContentMobile()},mLt.prototype.initiateTextSearch=function(){var e=this.searchInput.value;this.pdfViewer.textSearchModule.initiateSearch(e,!0)},mLt.prototype.goBackToToolbar=function(){var e;this.isNavigationToolbarVisible=!1,(!N||F.isDevice&&!this.pdfViewer.enableDesktopMode)&&N||this.pdfViewer.textSearchModule.cancelTextSearch(),this.searchInput=null,0!==this.pdfViewer.bookmarkViewModule.childNavigateCount?(this.pdfViewer.bookmarkViewModule.bookmarkList.back(),this.pdfViewer.bookmarkViewModule.childNavigateCount--):(null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null),(e=this.pdfViewerBase.getElement("_bookmarks_container"))&&(e.parentElement.removeChild(e),F.isDevice)&&!this.pdfViewer.enableDesktopMode&&(this.pdfViewerBase.mobileScrollerContainer.style.display=""),this.toolbarElement&&null!=this.toolbarElement.parentElement&&this.toolbarElement.parentElement.removeChild(this.toolbarElement),this.pdfViewerBase.viewerContainer.style.display="block",this.isBookmarkListOpen=!1,N?this.pdfViewerBase.onWindowResize():this.pdfViewer.toolbar.annotationToolbarModule.isMobileAnnotEnabled||this.pdfViewer.toolbarModule.showToolbar(!0))},mLt.prototype.setSearchInputWidth=function(){var e=this.searchInput.parentElement,t=window.getComputedStyle(e.parentElement,null).getPropertyValue("padding-left"),i=(N&&F.isDevice&&!this.pdfViewer.enableDesktopMode&&(this.toolbarElement=this.pdfViewerBase.getElement("_navigationToolbar")),this.toolbarElement.clientWidth-this.getParentElementSearchBox("_backward").clientWidth-this.getParentElementSearchBox("_search_box-icon").clientWidth-this.getParentElementSearchBox("_prev_occurrence").clientWidth-this.getParentElementSearchBox("_next_occurrence").clientWidth-this.getParentElementSearchBox("_search_count").clientWidth-6);""!==t&&(i-=2*parseFloat(t)),e.style.width=i+"px"},mLt.prototype.getParentElementSearchBox=function(e){return this.pdfViewerBase.getElement(e).parentElement},mLt.prototype.createTooltipMobile=function(e){var t;this.isTooltipCreated?this.toastObject&&(this.toastObject.title=e,(t=this.pdfViewerBase.getElement("_container_tooltip").firstElementChild)?(t.style.width="auto",t.firstElementChild.firstElementChild.textContent=e):(this.isTooltipCreated=!1,t=this.pdfViewerBase.getElement("_container_tooltip"),this.toastObject&&this.toastObject.destroy(),t.parentElement.removeChild(t),this.toastObject=null,this.createMobileTooltip(e))):this.createMobileTooltip(e)},mLt.prototype.createMobileTooltip=function(e){var t=Q("div",{className:"e-pv-container-tooltip",id:this.pdfViewer.element.id+"_container_tooltip"}),e=(this.pdfViewer.element.appendChild(t),this.toastObject=new hz({title:e,target:this.pdfViewer.element,close:this.onTooltipClose.bind(this),position:{X:0,Y:0},animation:{hide:{duration:200,effect:"FadeOut"}}}),this.toastObject.appendTo(t),.65*this.pdfViewer.element.clientHeight),i=(this.pdfViewer.element.clientWidth-t.clientWidth)/2,i=(this.isTooltipCreated=!0,this.toastObject.show({position:{X:i,Y:e}}),t.firstElementChild);i&&(i.style.width="auto")},mLt.prototype.onTooltipClose=function(e){var t;this.pdfViewer.textSearchModule&&(this.isTooltipCreated=!1,t=this.pdfViewerBase.getElement("_container_tooltip"),this.pdfViewer.textSearchModule.isMessagePopupOpened=!1,this.toastObject&&this.toastObject.destroy(),t.parentElement.removeChild(t),this.toastObject=null)},mLt.prototype.toolbarResize=function(){this.searchInput&&(this.searchInput.style.width="auto",this.setSearchInputWidth())},mLt.prototype.createSidebarToolBar=function(){var e,t;N?(this.thumbnailButton=this.pdfViewer.element.querySelector(".e-pv-thumbnail-view-button"),this.bookmarkButton=this.pdfViewer.element.querySelector(".e-pv-bookmark-button")):(e=!!navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i),this.thumbnailButton=Q("button",{id:this.pdfViewer.element.id+"_thumbnail-view",attrs:{disabled:"disabled","aria-label":"Page Thumbnails",tabindex:"-1"}}),this.thumbnailButton.className="e-pv-tbar-btn e-pv-thumbnail-view-button e-btn",this.thumbnailButton.setAttribute("type","button"),t=Q("span",{id:this.pdfViewer.element.id+"_thumbnail-view_icon",className:"e-pv-thumbnail-view-disable-icon e-pv-icon"}),this.thumbnailButton.appendChild(t),new NS({content:ao(function(){return this.pdfViewer.localeObj.getConstant("Page Thumbnails")+(e?" (⌘+⌥+1)":" (Ctrl+Alt+1)")},this),opensOn:"Hover",beforeOpen:this.onTooltipBeforeOpen.bind(this)}).appendTo(this.thumbnailButton),this.bookmarkButton=Q("button",{id:this.pdfViewer.element.id+"_bookmark",attrs:{disabled:"disabled","aria-label":"Bookmarks",tabindex:"-1"}}),this.bookmarkButton.setAttribute("type","button"),this.bookmarkButton.className="e-pv-tbar-btn e-pv-bookmark-button e-btn",t=Q("span",{id:this.pdfViewer.element.id+"_bookmark_icon",className:"e-pv-bookmark-disable-icon e-pv-icon"}),this.bookmarkButton.appendChild(t),new NS({content:ao(function(){return this.pdfViewer.localeObj.getConstant("Bookmarks")+(e?" (⌘+⌥+2)":" (Ctrl+Alt+2)")},this),opensOn:"Hover",beforeOpen:this.onTooltipBeforeOpen.bind(this)}).appendTo(this.bookmarkButton),this.organizePageButton=Q("button",{id:this.pdfViewer.element.id+"_organize-view",attrs:{disabled:"disabled","aria-label":"Organize Pages",tabindex:"-1"}}),this.organizePageButton.className="e-pv-tbar-btn e-pv-organize-view-button e-btn",this.organizePageButton.setAttribute("type","button"),t=Q("span",{id:this.pdfViewer.element.id+"_organize-view_icon",className:"e-pv-organize-view-disable-icon e-pv-icon"}),this.organizePageButton.appendChild(t),new NS({content:ao(function(){return this.pdfViewer.localeObj.getConstant("Organize Pages")+(e?" (⌘+⌥+3)":" (Ctrl+Alt+3)")},this),opensOn:"Hover",beforeOpen:this.onTooltipBeforeOpen.bind(this)}).appendTo(this.organizePageButton),this.sideBarToolbar.appendChild(this.thumbnailButton),this.sideBarToolbar.appendChild(this.bookmarkButton),je(this.pdfViewer.pageOrganizer)||this.sideBarToolbar.appendChild(this.organizePageButton)),this.thumbnailButton.addEventListener("click",this.sideToolbarOnClick),this.bookmarkButton.addEventListener("click",this.bookmarkButtonOnClick),this.organizePageButton.addEventListener("click",this.organizeButtonOnClick)},mLt.prototype.onTooltipBeforeOpen=function(e){this.pdfViewer.toolbarSettings.showTooltip||(e.cancel=!0)},mLt.prototype.enableOrganizeButton=function(e){this.organizePageButton&&(e?(this.organizePageButton.removeAttribute("disabled"),this.organizePageButton.children[0].classList.remove("e-pv-organize-view-disable-icon"),this.organizePageButton.children[0].classList.add("e-pv-organize-view-icon"),this.organizePageButton.setAttribute("tabindex","0")):(this.organizePageButton.setAttribute("disabled","disabled"),this.organizePageButton.children[0].classList.remove("e-pv-organize-view-icon"),this.organizePageButton.children[0].classList.add("e-pv-organize-view-disable-icon"),this.organizePageButton.setAttribute("tabindex","-1")))},mLt.prototype.enableThumbnailButton=function(){this.thumbnailButton&&(this.thumbnailButton.removeAttribute("disabled"),this.thumbnailButton.children[0].classList.remove("e-pv-thumbnail-view-disable-icon"),this.thumbnailButton.children[0].classList.add("e-pv-thumbnail-view-icon"),this.thumbnailButton.setAttribute("tabindex","0"))},mLt.prototype.enableBookmarkButton=function(){this.bookmarkButton&&(this.bookmarkButton.removeAttribute("disabled"),this.bookmarkButton.children[0].classList.remove("e-pv-bookmark-disable-icon"),this.bookmarkButton.children[0].classList.add("e-pv-bookmark-icon"),this.bookmarkButton.setAttribute("tabindex","0"))},mLt.prototype.createSidebarTitleCloseButton=function(){this.closeDiv=Q("button",{id:this.pdfViewer.element.id+"_close_btn"}),this.closeDiv.setAttribute("aria-label","close button"),this.closeDiv.setAttribute("type","button"),this.closeDiv.className="e-btn e-pv-tbar-btn e-pv-title-close-div e-btn",this.pdfViewer.enableRtl?this.closeDiv.style.left="8px":this.closeDiv.style.left=this.closeButtonLeft+"px";var e=Q("span",{id:this.pdfViewer.element.id+"_close_icon",className:"e-pv-title-close-icon e-pv-icon"});this.closeDiv.appendChild(e),this.sideBarTitleContainer.appendChild(this.closeDiv),this.closeDiv.addEventListener("click",this.sideToolbarOnClose)},mLt.prototype.createResizeIcon=function(){this.resizeIcon=Q("div",{id:this.pdfViewer.element.id+"_resize",className:"e-pv-resize-icon e-pv-icon"}),this.setResizeIconTop(),this.resizeIcon.style.position="absolute",this.resizeIcon.addEventListener("click",this.sideToolbarOnClose),this.resizeIcon.addEventListener("mouseover",this.resizeIconMouseOver),this.sideBarResizer.appendChild(this.resizeIcon)},mLt.prototype.setResizeIconTop=function(){this.sideBarToolbar&&this.sideBarToolbar.clientHeight&&""===this.resizeIcon.style.top&&(this.resizeIcon.style.top=this.sideBarToolbar.clientHeight/2+"px")},mLt.prototype.setCommentPanelResizeIconTop=function(){this.commentPanelContainer&&this.commentPanelContainer.clientHeight&&this.commentPanelResizeIcon&&""===this.commentPanelResizeIcon.style.top&&(this.commentPanelResizeIcon.style.top=this.commentPanelContainer.clientHeight/2+"px")},Object.defineProperty(mLt.prototype,"outerContainerWidth",{get:function(){return this.mainContainerWidth||(this.mainContainerWidth=this.pdfViewerBase.mainContainer.clientWidth),this.mainContainerWidth},enumerable:!0,configurable:!0}),mLt.prototype.getViewerContainerScrollbarWidth=function(){return this.pdfViewerBase.viewerContainer.offsetWidth+this.pdfViewerBase.viewerContainer.offsetLeft-(this.pdfViewerBase.viewerContainer.clientWidth+this.pdfViewerBase.viewerContainer.offsetLeft)},Object.defineProperty(mLt.prototype,"sideToolbarWidth",{get:function(){return this.sideBarToolbar?this.sideBarToolbar.clientWidth:0},enumerable:!0,configurable:!0}),Object.defineProperty(mLt.prototype,"sideBarContentContainerWidth",{get:function(){return this.sideBarContentContainer?this.sideBarContentContainer.clientWidth:0},enumerable:!0,configurable:!0}),Object.defineProperty(mLt.prototype,"commentPanelContainerWidth",{get:function(){return this.commentPanelContainer?this.commentPanelContainer.offsetWidth:0},enumerable:!0,configurable:!0}),mLt.prototype.updateViewerContainerOnClose=function(){var e;(e=this).sideBarContentContainer&&(e.sideBarContentContainer.style.display="none",this.pdfViewer.enableRtl?e.pdfViewerBase.viewerContainer.style.right=e.sideToolbarWidth+"px":e.pdfViewerBase.viewerContainer.style.left=e.sideToolbarWidth+"px",e.pdfViewerBase.viewerContainer.style.width=e.pdfViewer.element.clientWidth-e.sideToolbarWidth-e.getViewerContainerRight()+"px",e.pdfViewerBase.pageContainer.style.width=e.pdfViewerBase.viewerContainer.offsetWidth-e.getViewerContainerScrollbarWidth()+"px",this.restrictUpdateZoomValue)&&e.pdfViewerBase.updateZoomValue()},mLt.prototype.updateViewerContainerOnExpand=function(){var e;(e=this).sideBarContentContainer&&(je(this.pdfViewer.thumbnailViewModule)||this.pdfViewer.thumbnailViewModule.isThubmnailOpen||(e.sideBarContentContainer.style.display="block"),(e.pdfViewer.isBookmarkPanelOpen||this.isBookmarkOpen)&&(e.sideBarContentContainer.style.display="block"),this.pdfViewer.enableRtl?e.pdfViewerBase.viewerContainer.style.right=e.getViewerContainerLeft()+"px":e.pdfViewerBase.viewerContainer.style.left=e.getViewerContainerLeft()+"px",e.pdfViewerBase.viewerContainer.style.width=e.pdfViewer.element.clientWidth-this.getViewerContainerLeft()-this.getViewerContainerRight()+"px",e.pdfViewerBase.pageContainer.style.width=e.pdfViewerBase.viewerContainer.clientWidth+"px",e.pdfViewerBase.updateZoomValue(),e.pdfViewer.enableThumbnail)&&(e.pdfViewer.thumbnailViewModule.gotoThumbnailImage(e.pdfViewerBase.currentPageNumber-1),e.pdfViewer.thumbnailViewModule.renderViewPortThumbnailImage())},mLt.prototype.getViewerContainerLeft=function(){return this.sideToolbarWidth?this.sideToolbarWidth+this.sideBarContentContainerWidth:0!==this.sideToolbarWidth||this.pdfViewer.enableNavigationToolbar?0:this.sideBarContentContainerWidth},mLt.prototype.getViewerContainerRight=function(){return this.commentPanelResizer?this.commentPanelContainerWidth+this.commentPanelResizer.clientWidth:0!==this.sideToolbarWidth||this.pdfViewer.enableNavigationToolbar?0:this.sideBarContentContainerWidth},mLt.prototype.getViewerMainContainerWidth=function(){return this.pdfViewer.element.clientWidth-this.sideToolbarWidth},mLt.prototype.setThumbnailSelectionIconTheme=function(){this.thumbnailButton&&(this.thumbnailButton.children[0].classList.remove("e-pv-thumbnail-view-icon"),this.thumbnailButton.children[0].classList.add("e-pv-thumbnail-view-selection-icon"),this.thumbnailButton.classList.add("e-pv-thumbnail-view-button-selection"))},mLt.prototype.removeThumbnailSelectionIconTheme=function(){this.thumbnailButton&&this.thumbnailButton.children[0]&&(this.thumbnailButton.children[0].classList.add("e-pv-thumbnail-view-icon"),this.thumbnailButton.children[0].classList.remove("e-pv-thumbnail-view-selection-icon"),this.thumbnailButton.classList.remove("e-pv-thumbnail-view-button-selection"))},mLt.prototype.resetThumbnailIcon=function(){this.thumbnailButton&&this.thumbnailButton.children[0]&&(this.thumbnailButton.children[0].classList.remove("e-pv-thumbnail-view-icon"),this.thumbnailButton.children[0].classList.add("e-pv-thumbnail-view-disable-icon"))},mLt.prototype.resetThumbnailView=function(){this.sideBarContentContainer&&(this.sideBarContentContainer.style.display="none",this.pdfViewer.enableRtl?this.pdfViewerBase.viewerContainer.style.left="1px":this.pdfViewerBase.viewerContainer.style.left=this.sideToolbarWidth+"px",this.pdfViewerBase.viewerContainer.style.width=this.pdfViewer.element.clientWidth-this.sideToolbarWidth-this.getViewerContainerRight()+"px",this.pdfViewerBase.pageContainer&&(this.pdfViewerBase.pageContainer.style.width=this.pdfViewerBase.viewerContainer.clientWidth+"px"),this.thumbnailButton.setAttribute("disabled","disabled"),this.removeThumbnailSelectionIconTheme(),this.resetThumbnailIcon())},mLt.prototype.setBookmarkSelectionIconTheme=function(){this.bookmarkButton&&(this.bookmarkButton.children[0].classList.remove("e-pv-bookmark-icon"),this.bookmarkButton.children[0].classList.add("e-pv-bookmark-selection-icon"),this.bookmarkButton.classList.add("e-pv-bookmark-button-selection"))},mLt.prototype.removeBookmarkSelectionIconTheme=function(){this.bookmarkButton&&this.bookmarkButton.children[0]&&(this.bookmarkButton.children[0].classList.add("e-pv-bookmark-icon"),this.bookmarkButton.children[0].classList.remove("e-pv-bookmark-selection-icon"),this.bookmarkButton.classList.remove("e-pv-bookmark-button-selection"))},mLt.prototype.sideToolbarOnMouseup=function(e){e.target===this.sideBarToolbar&&this.pdfViewerBase.focusViewerContainer()},mLt.prototype.sideBarTitleOnMouseup=function(e){this.pdfViewerBase.focusViewerContainer()},mLt.prototype.openBookmarkcontentInitially=function(e){var t=this;document.getElementById(t.pdfViewer.element.id+"_thumbnail_view")&&(document.getElementById(t.pdfViewer.element.id+"_thumbnail_view").style.display="none"),t.removeThumbnailSelectionIconTheme(),t.sideBarTitle.textContent=t.pdfViewer.localeObj.getConstant("Bookmarks"),t.sideBarContent.setAttribute("aria-label","Bookmark View Panel"),t.sideBarContent.setAttribute("role","navigation"),t.pdfViewer.bookmarkViewModule.renderBookmarkcontent(),!t.sideBarContentContainer||!e&&t.isBookmarkOpenProgrammatically||("none"!==t.sideBarContentContainer.style.display?t.isThumbnailOpen?(t.setBookmarkSelectionIconTheme(),t.isBookmarkOpen=!0,t.updateViewerContainerOnExpand(),t.isThumbnail=!1,t.isThumbnailAddedProgrammatically=!1,t.isBookmarkOpenProgrammatically=!0,t.pdfViewer.isThumbnailViewOpen=!1):(t.removeBookmarkSelectionIconTheme(),t.isBookmarkOpen=!1,t.updateViewerContainerOnClose(),t.isBookmarkOpenProgrammatically=!1):(t.sideBarContent.focus(),t.setBookmarkSelectionIconTheme(),t.isBookmarkOpen=!0,t.updateViewerContainerOnExpand(),t.isBookmarkOpenProgrammatically=!0,t.pdfViewer.isThumbnailViewOpen=!1)),t.isThumbnailOpen=!1,t.pdfViewer.annotationModule&&t.pdfViewer.annotationModule.inkAnnotationModule&&(e=parseInt(t.pdfViewer.annotationModule.inkAnnotationModule.currentPageNumber,10),t.pdfViewer.annotationModule.inkAnnotationModule.drawInkAnnotation(e))},mLt.prototype.disableBookmarkButton=function(){var e;this.sideBarContentContainer&&this.bookmarkButton&&this.bookmarkButton.children[0]&&((e=this.pdfViewer.element.querySelector(".e-pv-bookmark-view"))&&(e.style.display="none"),this.bookmarkButton.setAttribute("disabled","disabled"),this.bookmarkButton.children[0].classList.add("e-pv-bookmark-disable-icon"))},mLt.prototype.calculateCommentPanelWidth=function(){for(var e=document.getElementsByClassName("e-pv-comment-title"),t=document.getElementsByClassName("e-pv-more-options-button e-btn"),i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)],o=t[parseInt(i.toString(),10)];n.style.maxWidth=n.parentElement.clientWidth-o.clientWidth+"px"}for(var r=document.getElementsByClassName("e-pv-reply-title"),s=document.getElementsByClassName("e-pv-more-options-button e-btn"),a=0;a<r.length;a++){var l=r[parseInt(a.toString(),10)],h=s[parseInt(a.toString(),10)];l.style.maxWidth=l.parentElement.clientWidth-h.clientWidth+"px"}},mLt.prototype.clear=function(){F.isDevice||(this.removeBookmarkSelectionIconTheme(),this.removeThumbnailSelectionIconTheme(),this.closeCommentPanelContainer()),this.commentsContentContainer&&(this.commentsContentContainer.innerHTML="")},mLt.prototype.destroy=function(){var e=this.bookmarkButton,t=this.thumbnailButton,i=this.organizePageButton;e&&e.ej2_instances&&0<e.ej2_instances.length&&e.ej2_instances[0].destroy(),t&&t.ej2_instances&&0<t.ej2_instances.length&&t.ej2_instances[0].destroy(),i&&i.ej2_instances&&0<i.ej2_instances.length&&i.ej2_instances[0].destroy(),this.annotationMenuObj&&(e=this.annotationMenuObj.element)&&e.ej2_instances&&0<e.ej2_instances.length&&this.annotationMenuObj.destroy()},mLt.prototype.getModuleName=function(){return"NavigationPane"};var gLt=mLt;function mLt(e,t){var s=this;this.thumbnailWidthMin=200,this.contentContainerScrollWidth=33,this.closeButtonLeft=170,this.isTooltipCreated=!1,this.annotationContextMenu=[],this.isCommentPanelShow=!1,this.commentPanelWidthMin=300,this.isThumbnail=!1,this.isThumbnailAddedProgrammatically=!1,this.isBookmarkOpenProgrammatically=!1,this.isNavigationToolbarVisible=!1,this.isBookmarkListOpen=!1,this.isNavigationPaneResized=!1,this.isBookmarkOpen=!1,this.isThumbnailOpen=!1,this.restrictUpdateZoomValue=!0,this.loadImportAnnotation=function(e){var t,i,n=e.target.files;null!==e.target.files[0]&&((n=n[0])&&(s.pdfViewer.fireImportStart(n),t=n.type,1<n.name.split(".json").length&&t.includes("json")?((i=new FileReader).readAsDataURL(n),i.onload=function(e){var t,i;e.currentTarget.result&&(e=e.currentTarget.result.split(",")[1],t=atob(e))&&(i=(t=JSON.parse(t)).pdfAnnotation[Object.keys(t.pdfAnnotation)[0]],1<=Object.keys(t.pdfAnnotation).length&&(i.textMarkupAnnotation||i.measureShapeAnnotation||i.freeTextAnnotation||i.stampAnnotations||i.signatureInkAnnotation||i.shapeAnnotation&&i.shapeAnnotation[0].Bounds)?(s.pdfViewerBase.isPDFViewerJson=!0,s.pdfViewerBase.importAnnotations(t,LCt.Json)):(s.pdfViewerBase.isPDFViewerJson=!1,s.pdfViewerBase.clientSideRendering?s.pdfViewerBase.importAnnotations(DMt(e),LCt.Json):s.pdfViewerBase.importAnnotations(e,LCt.Json)))}):1<n.name.split(".xfdf").length&&(t.includes("xfdf")||e.target.accept.includes("xfdf"))?(i=new FileReader,s.pdfViewerBase.clientSideRendering?i.readAsArrayBuffer(n):i.readAsDataURL(n),i.onload=function(e){var t;e.currentTarget.result&&(s.pdfViewerBase.clientSideRendering?(t=new Uint8Array(e.currentTarget.result))&&s.pdfViewerBase.importAnnotations(t,LCt.Xfdf,!0):(t=e.currentTarget.result.split(",")[1],atob(t)&&s.pdfViewerBase.importAnnotations(t,LCt.Xfdf,!0)))}):(s.pdfViewer.fireImportFailed(n,s.pdfViewer.localeObj.getConstant("Import Failed")),N?s.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_ImportFailed").then(function(e){s.pdfViewerBase.openImportExportNotificationPopup(e)}):s.pdfViewerBase.openImportExportNotificationPopup(s.pdfViewer.localeObj.getConstant("Import Failed")))),e.target.value="")},this.resizeIconMouseOver=function(e){e.srcElement.style.cursor="e-resize"},this.resizePanelMouseDown=function(e){var t=null;(t=s).offset=[t.sideBarResizer.offsetLeft-e.clientX,t.sideBarResizer.offsetTop-e.clientY,t.sideBarResizer.offsetParent.clientWidth],s.previousX=e.clientX,t.isDown=!0,t.isNavigationPaneResized=!0,t.pdfViewerBase.viewerContainer.style.cursor="e-resize",t.sideBarContentContainer&&(t.sideBarContentContainer.style.cursor="e-resize")},this.resizeViewerMouseLeave=function(e){var t=null;(t=s).isDown&&setTimeout(function(){t.pdfViewerBase.onWindowResize()},200),t.isDown=!1,t.isNavigationPaneResized&&t.sideBarContentContainer&&(t.pdfViewerBase.viewerContainer.style.cursor="default",t.sideBarContentContainer.style.cursor="default",t.isNavigationPaneResized=!1),t.commentPanelContainer&&t.isCommentPanelShow&&(s.commentPanelMouseLeave(e),t.isCommentPanelShow=!1)},this.resizePanelMouseMove=function(e){var t,i,n,o=null,o=s;s.pdfViewerBase.getPopupNoteVisibleStatus()||(n=e.target,s.pdfViewerBase.skipPreventDefault(n)&&e.preventDefault(),o.isDown&&s.sideBarContentContainer?(s.pdfViewer.enableRtl?(t=s.previousX-e.clientX+o.offset[2],(t=(i=Math.floor(s.outerContainerWidth/2))<t?i:t)<s.thumbnailWidthMin&&(t=s.thumbnailWidthMin),o.sideBarResizer.style.right=t+"px",o.sideBarContentContainer.style.width=t+"px",o.sideBarContent.style.width=t+"px",o.sideBarContentSplitter.style.width=t+"px",o.sideBarTitleContainer.style.width=t+"px",o.pdfViewerBase.viewerContainer.style.right=o.getViewerContainerLeft()+"px",o.pdfViewerBase.viewerContainer.style.left=o.getViewerContainerRight()+"px"):(t=e.clientX+o.offset[0],(t=(i=Math.floor(s.outerContainerWidth/2))<t?i:t)<s.thumbnailWidthMin&&(t=s.thumbnailWidthMin),o.sideBarResizer.style.left=t+"px",o.closeDiv.style.left=t-o.contentContainerScrollWidth+"px",o.sideBarContentContainer.style.width=t+"px",o.sideBarContent.style.width=t+"px",o.sideBarContentSplitter.style.width=t+"px",o.sideBarTitleContainer.style.width=t+"px",o.pdfViewerBase.viewerContainer.style.left=o.getViewerContainerLeft()+"px",o.pdfViewerBase.viewerContainer.style.right=o.getViewerContainerRight()+"px"),n=o.pdfViewer.element.clientWidth-o.getViewerContainerLeft()-o.getViewerContainerRight(),o.pdfViewerBase.viewerContainer.style.width=n+"px",o.pdfViewerBase.pageContainer.style.width=o.pdfViewerBase.viewerContainer.clientWidth+"px",o.pdfViewer.thumbnailViewModule.gotoThumbnailImage(o.pdfViewerBase.currentPageNumber-1),o.pdfViewer.thumbnailViewModule.renderViewPortThumbnailImage(),o.pdfViewerBase.updateZoomValue(),o.bookmarkButton.children[0].classList.contains("e-pv-bookmark-disable-icon")||o.pdfViewer.bookmarkViewModule.setBookmarkContentHeight()):o.isCommentPanelShow&&s.commentPanelContainer&&s.updateCommentPanelContainer(e))},this.sideToolbarOnClose=function(e){var t=null;(t=s).removeThumbnailSelectionIconTheme(),t.removeBookmarkSelectionIconTheme(),t.updateViewerContainerOnClose(),t.isThumbnailAddedProgrammatically=!1,t.isBookmarkOpenProgrammatically=!1,t.isThumbnail=!1,t.isBookmarkOpen=!1},this.organizeButtonOnClick=function(e){je(s.pdfViewer.pageOrganizer)||s.pdfViewer.pageOrganizer.createOrganizeWindow()},this.sideToolbarOnClick=function(e){s.sideBarTitle.textContent=s.pdfViewer.localeObj.getConstant("Page Thumbnails"),s.sideBarContent.setAttribute("aria-label","Thumbnail View Panel");var t=null,t=s,i=document.getElementById(s.pdfViewer.element.id+"_bookmark_view");i&&(t.removeBookmarkSelectionIconTheme(),i.style.display="none"),document.getElementById(s.pdfViewer.element.id+"_thumbnail_view").style.display="flex",t.sideBarContentContainer&&("none"!==t.sideBarContentContainer.style.display?t.isBookmarkOpen?(t.isThumbnailOpen=!0,t.isThumbnail=!0,t.setThumbnailSelectionIconTheme(),t.updateViewerContainerOnExpand(),document.getElementById(t.pdfViewer.element.id+"_thumbnail_image_"+(t.pdfViewerBase.currentPageNumber-1)).focus(),t.isThumbnailAddedProgrammatically=!0):(t.isThumbnailOpen=!1,t.removeThumbnailSelectionIconTheme(),t.updateViewerContainerOnClose(),t.isThumbnailAddedProgrammatically=!1,t.isThumbnail=!1):(t.sideBarContent.focus(),t.isThumbnailOpen=!0,t.setThumbnailSelectionIconTheme(),t.updateViewerContainerOnExpand(),t.isThumbnail=!0,je(document.getElementById(t.pdfViewer.element.id+"_thumbnail_image_"+(t.pdfViewerBase.currentPageNumber-1)))||document.getElementById(t.pdfViewer.element.id+"_thumbnail_image_"+(t.pdfViewerBase.currentPageNumber-1)).focus(),t.isThumbnailAddedProgrammatically=!0)),t.isBookmarkOpen=!1,t.isBookmarkOpenProgrammatically=!1,s.pdfViewer.annotationModule&&s.pdfViewer.annotationModule.inkAnnotationModule&&(i=parseInt(s.pdfViewer.annotationModule.inkAnnotationModule.currentPageNumber,10),s.pdfViewer.annotationModule.inkAnnotationModule.drawInkAnnotation(i))},this.openThumbnailPane=function(){var e=null,e=s,t=document.getElementById(s.pdfViewer.element.id+"_sideBarContent"),i=document.getElementById(s.pdfViewer.element.id+"_sideBarContentContainer"),n=document.getElementById(s.pdfViewer.element.id+"_viewerContainer"),o=document.getElementById(s.pdfViewer.element.id+"_pageViewContainer"),r=(document.getElementById(s.pdfViewer.element.id+"_thumbnail_view").style.display="block",document.getElementById(s.pdfViewer.element.id+"_sideBarResizer").style.display="none",e.sideBarTitle.textContent=s.pdfViewer.localeObj.getConstant("Page Thumbnails"),e.sideBarContent.setAttribute("aria-label","Thumbnail View Panel"),e.sideBarContent.setAttribute("tabindex","0"),document.getElementById(s.pdfViewer.element.id+"_bookmark_view"));r&&(e.removeBookmarkSelectionIconTheme(),r.style.display="none"),i&&!s.isThumbnailAddedProgrammatically&&(e.isThumbnail?(i.style.display="none",n.style.width=e.pdfViewer.element.clientWidth+"px",o.style.width=n.clientWidth+"px",n.style.left=i.clientWidth+"px",e.pdfViewerBase.updateZoomValue(),e.removeThumbnailSelectionIconTheme(),e.isThumbnail=!1):(t.focus(),e.setThumbnailSelectionIconTheme(),e.updateViewerContainerOnExpand(),e.isThumbnail=!0,e.pdfViewerBase.updateZoomValue(),je(e.pdfViewer.thumbnailViewModule)||e.pdfViewer.thumbnailViewModule.gotoThumbnailImage(e.pdfViewerBase.currentPageNumber-1),e.isThumbnailAddedProgrammatically=!0,e.isThumbnailOpen=!0,e.isBookmarkOpen=!1,e.isBookmarkOpenProgrammatically=!1)),s.pdfViewer.annotationModule&&s.pdfViewer.annotationModule.inkAnnotationModule&&(r=parseInt(s.pdfViewer.annotationModule.inkAnnotationModule.currentPageNumber,10),s.pdfViewer.annotationModule.inkAnnotationModule.drawInkAnnotation(r))},this.closeThumbnailPane=function(){var e=null;((e=s).isThumbnail||e.isThumbnailAddedProgrammatically||e.pdfViewer.isThumbnailViewOpen)&&(e.sideBarContent.removeAttribute("tabindex"),e.removeThumbnailSelectionIconTheme(),e.isThumbnailOpen=!1,e.updateViewerContainerOnClose(),e.isThumbnailAddedProgrammatically=!1,e.isThumbnail=!1)},this.bookmarkButtonOnClick=function(e){s.openBookmarkcontentInitially(!0)},this.closeBookmarkPane=function(){var e=s;(e.isBookmarkOpen||e.isBookmarkOpenProgrammatically)&&(e.removeBookmarkSelectionIconTheme(),e.isBookmarkOpen=!1,e.updateViewerContainerOnClose(),e.isBookmarkOpenProgrammatically=!1,e.isBookmarkListOpen=!1)},this.commentPanelMouseDown=function(e){var t=null;(t=s).offset=[t.commentPanelResizer.offsetLeft-e.clientX,t.commentPanelResizer.offsetTop-e.clientY,t.getViewerContainerRight()],s.isCommentPanelShow=!0,s.previousX=e.clientX,t.pdfViewerBase.viewerContainer.style.cursor="e-resize",t.commentPanelResizer.style.cursor="e-resize"},this.updateCommentPanelContainer=function(e){var t,i,n=null,n=s,e=(s.pdfViewer.enableRtl?(t=e.clientX+n.offset[0],(t=(i=Math.floor(s.outerContainerWidth/2))<t?i:t)<s.commentPanelWidthMin&&(t=s.commentPanelWidthMin),n.commentPanelResizer.style.left=t+"px",n.commentPanelContainer.style.width=t+"px",n.pdfViewerBase.viewerContainer.style.left=n.getViewerContainerRight()+"px",n.pdfViewerBase.viewerContainer.style.right=n.getViewerContainerLeft()+"px"):(t=s.previousX-e.clientX+n.offset[2],(t=(i=Math.floor(s.outerContainerWidth/2))<t?i:t)<s.commentPanelWidthMin&&(t=s.commentPanelWidthMin),n.commentPanelResizer.style.right=t+"px",n.commentPanelContainer.style.width=t+"px",n.pdfViewerBase.viewerContainer.style.right=n.getViewerContainerRight()+"px",n.pdfViewerBase.viewerContainer.style.left=n.getViewerContainerLeft()+"px"),s.pdfViewer.annotation.stickyNotesAnnotationModule.updateCommentPanelTextTop(),n.pdfViewer.element.clientWidth-n.getViewerContainerLeft()-n.getViewerContainerRight());n.pdfViewerBase.viewerContainer.style.width=e+"px",n.pdfViewerBase.pageContainer.style.width=n.pdfViewerBase.viewerContainer.clientWidth+"px",n.calculateCommentPanelWidth(),n.pdfViewerBase.updateZoomValue()},this.commentPanelMouseLeave=function(e){var t=null;(t=s).commentPanelContainer&&(t.pdfViewerBase.viewerContainer.style.cursor="default",t.commentPanelContainer.style.cursor="default")},this.pdfViewer=e,this.pdfViewerBase=t}yLt.prototype.createContextMenu=function(){var e=document.getElementsByClassName(this.pdfViewer.element.id+"_context_menu");e&&(this.contextMenuElement=e[0],this.contextMenuElement.children)&&0<this.contextMenuElement.children.length&&((e=this.contextMenuElement.children[0]).className=e.className+" e-pv-context-menu")},yLt.prototype.open=function(e,t,i){this.pdfViewer._dotnetInstance.invokeMethodAsync("OpenContextMenu",e,t)},yLt.prototype.close=function(){this.pdfViewer._dotnetInstance.invokeMethodAsync("CloseContextMenu")},yLt.prototype.destroy=function(){this.previousAction="",this.contextMenuElement=null},yLt.prototype.OnItemSelected=function(e){"string"==typeof e?this.pdfViewerBase.OnItemSelected(e):this.pdfViewerBase.OnItemSelected(e[0])};var fLt=yLt;function yLt(e,t){this.pdfViewer=e,this.pdfViewerBase=t}var vLt={},bLt=null,wLt=null,CLt=30,SLt=30,ALt=30,xLt=30,ILt=36,TLt=30,ELt=30,DLt="e-spin-show",MLt="e-spin-hide",kLt="e-spin-material",PLt="e-spin-material3",BLt="e-spin-fabric",FLt="e-spin-bootstrap",LLt="e-spin-bootstrap4",RLt="e-spin-bootstrap5",OLt="e-spin-tailwind",NLt="e-spin-fluent",VLt="e-spin-fluent2",_Lt="e-spin-tailwind3",HLt="e-spin-high-contrast",zLt="e-spinner-pane",jLt="e-spinner-inner",WLt="e-path-circle",QLt="e-path-arc",ULt="e-spin-label",qLt="e-spin-template";function GLt(e,t){var i,n,o;e.target&&(t=je(t)?Q:t,i=e.target,(o=(n=t)("div",{})).classList.add(zLt),(n=n("div",{})).classList.add(jLt),i.appendChild(o),o.appendChild(n),i={wrap:o,innerWrap:n},je(e.cssClass)||i.wrap.classList.add(e.cssClass),je(e.template)&&je(bLt)?(n=je(e.type)?(o=i.wrap,window.getComputedStyle(o,":after").getPropertyValue("content").replace(/['"]+/g,"")):e.type,o=function(e,t){var i;switch(t){case"Material":i=CLt;break;case"Material3":i=SLt;break;case"Fabric":i=ALt;break;case"Fluent2":i=TLt;break;case"Tailwind3":i=ELt;break;case"Bootstrap4":i=ILt;break;default:i=xLt}return e=e?parseFloat(e+""):i,"Bootstrap"===t?e:e/2}(je(e.width)?void 0:e.width,n),YLt(n,i.wrap,o,t),je(e.label)||(n=i.innerWrap,o=e.label,(t=(t=t)("div",{})).classList.add(ULt),t.textContent=o,n.appendChild(t))):(o=je(e.template)?bLt:e.template,i.wrap.classList.add(qLt),n=i.wrap,t=o,je(e=wLt)||n.classList.add(e),n.querySelector(".e-spinner-inner").innerHTML=t),i.wrap.classList.add(MLt))}function YLt(e,t,i,n){var o,r,s,a,l,h,d,p,c,u,g,m,f,y,v,b,w,C,S,A=t.querySelector("."+jLt),t=A.querySelector("svg");switch(je(t)||A.removeChild(t),e){case"Material":b=A,w=i,C=n,S=JLt(),vLt[""+S]={timeOut:0,type:"Material",radius:w},$Lt(b,S,0,kLt),tRt(w,b,"Material",kLt);break;case"Material3":S=A,C=i,w=n,b=JLt(),vLt[""+b]={timeOut:0,type:"Material3",radius:C},$Lt(S,b,0,PLt),tRt(C,S,"Material3",PLt);break;case"Fabric":f=A,y=i,v=JLt(),vLt[""+v]={timeOut:0,type:"Fabric",radius:y},ZLt(f,v,BLt),rRt(y,f,BLt);break;case"Bootstrap":v=A,y=i,f=JLt(),vLt[""+f]={timeOut:0,type:"Bootstrap",radius:y};var x=v,I=f,T=document.createElementNS("http://www.w3.org/2000/svg","svg");T.setAttribute("id",I),T.setAttribute("class",FLt),T.setAttribute("viewBox","0 0 64 64"),x.insertBefore(T,x.firstChild);for(var E=0;E<=7;E++){var D=document.createElementNS("http://www.w3.org/2000/svg","circle");D.setAttribute("class",WLt+"_"+E),D.setAttribute("r","2"),D.setAttribute("transform","translate(32,32)"),T.appendChild(D)}for(var I=y,M=v.querySelector("svg.e-spin-bootstrap"),k=(M.style.width=M.style.height=I+"px",90),P=0;P<=7;P++){var B=sRt(0,0,24,k),F=M.querySelector("."+WLt+"_"+P);F.setAttribute("cx",B.x+""),F.setAttribute("cy",B.y+""),k=360<=k?0:k,k+=45}break;case"HighContrast":x=A,I=i,m=JLt(),vLt[""+m]={timeOut:0,type:"HighContrast",radius:I},ZLt(x,m,HLt),rRt(I,x,HLt);break;case"Bootstrap4":m=A,c=i,u=n,g=JLt(),vLt[""+g]={timeOut:0,type:"Bootstrap4",radius:c},$Lt(m,g,0,LLt),tRt(c,m,"Bootstrap4",LLt);break;case"Bootstrap5":g=A,u=i,c=n,p=JLt(),vLt[""+p]={timeOut:0,type:"Bootstrap5",radius:u},$Lt(g,p,0,RLt),tRt(u,g,"Bootstrap5",RLt);break;case"Tailwind":p=A,h=i,d=JLt(),vLt[""+d]={timeOut:0,type:"Tailwind",radius:h},ZLt(p,d,OLt),rRt(h,p,OLt);break;case"Fluent":d=A,h=i,l=JLt(),vLt[""+l]={timeOut:0,type:"Fluent",radius:h},ZLt(d,l,NLt),rRt(h,d,NLt);break;case"Fluent2":l=A,s=i,a=JLt(),vLt[""+a]={timeOut:0,type:"Fluent2",radius:s},ZLt(l,a,VLt),rRt(s,l,VLt);break;case"Tailwind3":a=A,s=i,o=n,r=JLt(),vLt[""+r]={timeOut:0,type:"Tailwind3",radius:s},$Lt(a,r,0,_Lt),tRt(s,a,"Tailwind3",_Lt)}}function XLt(e,t){var i=[],n=e,o=t,r=!1,s=1;return function e(t){i.push(t);t===o&&1!==s||(t<=n&&1<t&&!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))),++s,e(t))}(n),i}function KLt(e){for(var t=e.querySelector("svg.e-spin-bootstrap").getAttribute("id"),i=1;i<=8;i++)!function(t,e,i,n){var o=0;function r(e){vLt[""+n].isAnimate&&(++o,t.setAttribute("r",e+""),o>=i.length&&(o=0),vLt[""+n].timeOut=setTimeout(r.bind(null,i[parseInt(o.toString(),10)]),18))}r(e)}(e.getElementsByClassName("e-path-circle_"+(8===i?0:i))[0],i,XLt(i,i),t)}function JLt(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<5;i++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}function ZLt(e,t,i){var n=document.createElementNS("http://www.w3.org/2000/svg","svg"),t=(n.setAttribute("id",t),n.setAttribute("class",i),document.createElementNS("http://www.w3.org/2000/svg","path")),i=(t.setAttribute("class",WLt),document.createElementNS("http://www.w3.org/2000/svg","path"));i.setAttribute("class",QLt),e.insertBefore(n,e.firstChild),n.appendChild(t),n.appendChild(i)}function $Lt(e,t,i,n){var o=document.createElementNS("http://www.w3.org/2000/svg","svg"),n=(o.setAttribute("class",n),o.setAttribute("id",t),document.createElementNS("http://www.w3.org/2000/svg","path"));n.setAttribute("class",WLt),e.insertBefore(o,e.firstChild),o.appendChild(n)}function eRt(e){var s=1,t=149,a=oRt,l=1333,h=(e.globalInfo[e.uniqueID].count,75),i=e,d=++i.globalInfo[i.uniqueID].previousId,p=(new Date).getTime(),c=t-s,u=function(e){return parseFloat(e)}(2*i.globalInfo[i.uniqueID].radius+""),g=iRt(u),m=-90*(i.globalInfo[i.uniqueID].count||0);!je(vLt[i.uniqueID])&&vLt[i.uniqueID].timeOut&&(clearTimeout(vLt[i.uniqueID].timeOut),vLt[i.uniqueID].timeOut=null),function e(t){var i,n,o,r=Math.max(0,Math.min((new Date).getTime()-p,l));je(vLt[t.uniqueID])||je(vLt[t.uniqueID].timeOut)||(i=a(r,s,c,l),je((n=t.container).querySelector("svg.e-spin-material"))&&je(n.querySelector("svg.e-spin-material3"))||(o=void 0,je(n.querySelector("svg.e-spin-material"))||je(n.querySelector("svg.e-spin-material").querySelector("path.e-path-circle"))?je(n.querySelector("svg.e-spin-fluent2"))||je(n.querySelector("svg.e-spin-fluent2").querySelector("path.e-path-circle"))?je(n.querySelector("svg.e-spin-material3"))||je(n.querySelector("svg.e-spin-material3").querySelector("path.e-path-circle"))?je(n.querySelector("svg.e-spin-tailwind3"))||je(n.querySelector("svg.e-spin-tailwind3").querySelector("path.e-path-circle"))||(o=n.querySelector("svg.e-spin-tailwind3")):o=n.querySelector("svg.e-spin-material3"):o=n.querySelector("svg.e-spin-fluent2"):o=n.querySelector("svg.e-spin-material"),je(o))||((n=o.querySelector("path.e-path-circle")).setAttribute("stroke-dashoffset",nRt(u,g,i,h)+""),n.setAttribute("transform","rotate("+m+" "+u/2+" "+u/2+")")),d===t.globalInfo[t.uniqueID].previousId&&r<l?vLt[t.uniqueID].timeOut=requestAnimationFrame(function(){return e(t)}):(clearTimeout(vLt[t.uniqueID].timeOut),vLt[t.uniqueID].timeOut=null,eRt(t)))}(i),e.globalInfo[e.uniqueID].count=++e.globalInfo[e.uniqueID].count%4}function tRt(e,t,i,n){var e=2*e,t=t.querySelector("svg."+n),n=t.querySelector("path.e-path-circle"),o=iRt(e),r=e/2+"px";t.setAttribute("viewBox","0 0 "+e+" "+e),t.style.width=t.style.height=e+"px",t.style.transformOrigin=r+" "+r+" "+r,n.setAttribute("d",function(e,t){e/=2,t/=2;return"M"+e+","+t+"A"+(e-t)+","+(e-t)+" 0 1 1 "+t+","+e}(e,o)),"Material"!==i&&"Material3"!==i||(n.setAttribute("stroke-width",o+""),n.setAttribute("stroke-dasharray",(e-o)*Math.PI*.75+""),n.setAttribute("stroke-dashoffset",nRt(e,o,1,75)+"")),"Tailwind3"===i&&n.setAttribute("stroke-width",o+"")}function iRt(e){return.1*e}function nRt(e,t,i,n){return(e-t)*Math.PI*(3*n/100-i/100)}function oRt(e,t,i,n){n=(e/=n)*e,e*=n;return t+i*(6*e*n+-15*n*n+10*e)}function rRt(e,t,i){var n=e,o=e,r=2*e,t=t.querySelector("."+i),i=t.querySelector(".e-path-circle"),s=t.querySelector(".e-path-arc"),a=r/2+"px";i.setAttribute("d",["M",n,o,"m",-e,0,"a",e,e,0,1,0,2*e,0,"a",e,e,0,1,0,2*-e,0].join(" ")),s.setAttribute("d",function(e,t,i,n,o){o=sRt(e,t,i,o),e=sRt(e,t,i,n);return["M",o.x,o.y,"A",i,i,0,0,0,e.x,e.y].join(" ")}(n,o,e,315,45)),t.setAttribute("viewBox","0 0 "+r+" "+r),t.style.transformOrigin=a+" "+a+" "+a,t.style.width=t.style.height=r+"px"}function sRt(e,t,i,n){n=(n-90)*Math.PI/180;return{x:e+i*Math.cos(n),y:t+i*Math.sin(n)}}function aRt(e){lRt(e,!1)}function lRt(e,t){var i,n,o,r,s;if(e&&(i=e.classList.contains(zLt)?e:e.querySelector("."+zLt)),e&&i){var a=i.querySelector("."+jLt);if(t?!i.classList.contains(qLt)&&!i.classList.contains(MLt):!i.classList.contains(qLt)&&!i.classList.contains(DLt)){e=i.querySelector("svg");if(je(e))return;var l=e.getAttribute("id");switch(vLt[""+l].isAnimate=!t,vLt[""+l].type){case"Material":case"Material3":case"Fluent2":case"Tailwind3":t?clearTimeout(vLt[""+l].timeOut):(n=a,r=vLt[""+(o=l)].radius,s={},vLt[""+o].timeOut=0,s[""+o]={radius:r,count:0,previousId:0},eRt({uniqueID:o,container:n,globalInfo:s,timeOutVar:0}));break;case"Bootstrap":t?clearTimeout(vLt[""+l].timeOut):KLt(a)}}t?mt(i,[MLt],[DLt]):mt(i,[DLt],[MLt])}}function hRt(e){lRt(e,!0)}function dRt(e,t){for(var i,n,o,r,s,a=je(t)?Q:t,l=(void 0!==e.template&&(bLt=e.template,void 0!==e.template)&&(wLt=e.cssClass),document.querySelectorAll("."+zLt)),h=0;h<l.length;h++)if(i=e.template,n=l[parseInt(h.toString(),10)],o=e.type,r=e.cssClass,s=a,je(i)&&!n.classList.contains(qLt)){g=c=u=p=d=void 0;var d=n,p=o,c=s,u=(je(u=r)||d.classList.add(u),d.querySelector("svg")),g="Bootstrap"===p?parseFloat(u.style.height):parseFloat(u.style.height)/2;0<=u.getAttribute("class").split(/\s/).indexOf("e-spin-material")&&(u=u.getAttribute("id"),clearTimeout(vLt[""+u].timeOut)),YLt(p,d,g,c),(n.classList.contains(DLt)?(n.classList.remove(DLt),aRt):(n.classList.remove(MLt),hRt))(n)}else bLt=i,je(r)||(wLt=r)}cRt.prototype.findToolbarElements=function(){this.totalPageElement=this.pdfViewerBase.getElement("_totalPage").children[0],this.currentPageBoxElementContainer=this.pdfViewerBase.getElement("_currentPageInput"),this.currentPageBoxElement=this.pdfViewerBase.getElement("_currentPageInput").children[0].children[0],this.firstPageElement=this.pdfViewerBase.getElement("_firstPage"),this.previousPageElement=this.pdfViewerBase.getElement("_previousPage"),this.nextPageElement=this.pdfViewerBase.getElement("_nextPage"),this.lastPageElement=this.pdfViewerBase.getElement("_lastPage"),this.zommOutElement=this.pdfViewerBase.getElement("_zoomOut"),this.zoomInElement=this.pdfViewerBase.getElement("_zoomIn"),this.zoomDropDownElement=this.pdfViewerBase.getElement("_zoomDropDown"),this.selectToolElement=this.pdfViewerBase.getElement("_selectTool"),this.handToolElement=this.pdfViewerBase.getElement("_handTool"),this.undoElement=this.pdfViewerBase.getElement("_undo"),this.redoElement=this.pdfViewerBase.getElement("_redo"),this.commentElement=this.pdfViewerBase.getElement("_comment"),this.submitFormButton=this.pdfViewerBase.getElement("_submitFormButton"),this.searchElement=this.pdfViewerBase.getElement("_search"),this.annotationElement=this.pdfViewerBase.getElement("_annotation"),this.editAnnotationButtonElement=this.annotationElement.children[0],this.editAnnotationButtonElement.classList.add("e-pv-tbar-btn"),this.printElement=this.pdfViewerBase.getElement("_print"),this.downloadElement=this.pdfViewerBase.getElement("_download"),this.highlightElement=this.pdfViewerBase.getElement("_highLight"),this.underlineElement=this.pdfViewerBase.getElement("_underline"),this.strikeThroughElement=this.pdfViewerBase.getElement("_strikethrough"),this.shapeElement=this.pdfViewerBase.getElement("_annotation_shapes"),this.calibrateElement=this.pdfViewerBase.getElement("_annotation_calibrate"),this.stampElement=this.pdfViewerBase.getElement("_annotation_stamp"),this.freeTextElement=this.pdfViewerBase.getElement("_annotation_freeTextEdit"),this.signatureElement=this.pdfViewerBase.getElement("_annotation_signature"),this.inkElement=this.pdfViewerBase.getElement("_annotation_ink"),this.annotationFontSizeInputElement=this.pdfViewerBase.getElement("_annotation_fontsize").children[0].children[0],this.annotationFontFamilyInputElement=this.pdfViewerBase.getElement("_annotation_fontname").children[0].children[0],this.annotationColorElement=this.pdfViewerBase.getElement("_annotation_color"),this.annotationStrokeColorElement=this.pdfViewerBase.getElement("_annotation_stroke"),this.annotationThicknessElement=this.pdfViewerBase.getElement("_annotation_thickness"),this.annotationOpacityElement=this.pdfViewerBase.getElement("_annotation_opacity"),this.annotationFontColorElement=this.pdfViewerBase.getElement("_annotation_textcolor"),this.annotationFontFamilyElement=this.pdfViewerBase.getElement("_annotation_fontname"),this.annotationFontSizeElement=this.pdfViewerBase.getElement("_annotation_fontsize"),this.annotationTextAlignElement=this.pdfViewerBase.getElement("_annotation_textalign"),this.annotationTextColorElement=this.pdfViewerBase.getElement("_annotation_textcolor"),this.annotationTextPropertiesElement=this.pdfViewerBase.getElement("_annotation_textproperties"),this.annotationDeleteElement=this.pdfViewerBase.getElement("_annotation_delete"),this.annotationCommentPanelElement=this.pdfViewerBase.getElement("_annotation_commentPanel"),this.annotationCloseElement=this.pdfViewerBase.getElement("_annotation_close"),this.mobileToolbarContainerElement=this.pdfViewerBase.getElement("_mobileToolbarContainer"),this.mobileSearchPreviousOccurenceElement=this.pdfViewerBase.getElement("_prev_occurrence"),this.mobileSearchNextOccurenceElement=this.pdfViewerBase.getElement("_next_occurrence")},cRt.prototype.updateTotalPage=function(){this.totalPageElement.textContent=this.pdfViewer.localeObj.getConstant("of")+this.pdfViewerBase.pageCount.toString()},cRt.prototype.updateCurrentPage=function(e){this.currentPageBoxElement.value=e.toString()},cRt.prototype.loadDocument=function(){this.pdfViewer.enableNavigation&&(this.currentPageBoxElementContainer.classList.remove(this.cssClass),this.currentPageBoxElement.value="1",this.totalPageElement.textContent=this.pdfViewer.localeObj.getConstant("of")+this.pdfViewerBase.pageCount.toString(),this.isEnabled(this.firstPageElement)||(this.firstPageElement.className+=this.disableClass),this.isEnabled(this.previousPageElement)||(this.previousPageElement.className+=this.disableClass),this.nextPageElement.classList.remove(this.cssClass),this.lastPageElement.classList.remove(this.cssClass),1===this.pdfViewerBase.pageCount)&&(this.nextPageElement.classList.contains(this.cssClass)||(this.nextPageElement.className+=this.disableClass),this.lastPageElement.classList.contains(this.cssClass)||(this.lastPageElement.className+=this.disableClass)),this.pdfViewer.enableMagnification&&(this.zoomInElement.classList.remove(this.cssClass),this.zommOutElement.classList.remove(this.cssClass),this.zoomDropDownElement.classList.remove(this.cssClass)),this.pdfViewer.enableTextSelection&&(this.selectToolElement.classList.remove(this.cssClass),this.selectItem(this.pdfViewer.toolbar.SelectToolElement)),this.handToolElement.classList.remove(this.cssClass),this.pdfViewer.enableStickyNotesAnnotation&&this.commentElement.classList.remove(this.cssClass),this.pdfViewer.enableTextSearch&&this.searchElement.classList.remove(this.cssClass),this.pdfViewer.isFormFieldDocument&&this.submitFormButton.classList.remove(this.cssClass),this.pdfViewer.enableAnnotation&&this.pdfViewer.enableAnnotationToolbar&&this.annotationElement.classList.remove(this.cssClass),this.pdfViewer.enablePrint&&this.printElement.classList.remove(this.cssClass),this.pdfViewer.enableDownload&&this.downloadElement.classList.remove(this.cssClass),this.pdfViewer.enableAnnotation&&this.pdfViewer.enableTextMarkupAnnotation&&(this.highlightElement.classList.remove(this.cssClass),this.underlineElement.classList.remove(this.cssClass),this.strikeThroughElement.classList.remove(this.cssClass)),this.pdfViewer.enableAnnotation&&this.pdfViewer.enableShapeAnnotation&&this.shapeElement.classList.remove(this.cssClass),this.pdfViewer.enableAnnotation&&this.pdfViewer.enableMeasureAnnotation&&this.calibrateElement.classList.remove(this.cssClass),this.pdfViewer.enableAnnotation&&this.pdfViewer.enableStampAnnotations&&this.stampElement.classList.remove(this.cssClass),this.pdfViewer.enableFreeText&&this.freeTextElement.classList.remove(this.cssClass),this.pdfViewer.enableHandwrittenSignature&&this.signatureElement.classList.remove(this.cssClass),this.pdfViewer.enableInkAnnotation&&this.inkElement.classList.remove(this.cssClass),this.pdfViewer.enableCommentPanel&&this.annotationCommentPanelElement.classList.remove(this.cssClass)},cRt.prototype.selectItem=function(e){e&&e.classList.add("e-pv-select")},cRt.prototype.deselectItem=function(e){e&&e.classList.remove("e-pv-select")},cRt.prototype.showAnnotationToolbar=function(e){this.pdfViewer.toolbar.annotationToolbarModule.adjustViewer(e[0]),e[0]?this.pdfViewer.toolbar.selectItem(this.editAnnotationButtonElement):(this.pdfViewer.toolbar.deSelectItem(this.editAnnotationButtonElement),this.pdfViewerBase.focusViewerContainer())},cRt.prototype.closeAnnotationToolbar=function(){this.pdfViewer.toolbar.annotationToolbarModule.adjustViewer(!1),this.pdfViewer.toolbar.deSelectItem(this.editAnnotationButtonElement),this.pdfViewerBase.navigationPane.closeCommentPanelContainer()},cRt.prototype.resetToolbar=function(){this.pdfViewer.enableToolbar&&(this.currentPageBoxElement.value="0",this.totalPageElement.textContent=this.pdfViewer.localeObj.getConstant("of")+"0",this.isEnabled(this.currentPageBoxElementContainer)||(this.currentPageBoxElementContainer.className+=this.disableClass),this.isEnabled(this.firstPageElement)||(this.firstPageElement.className+=this.disableClass),this.isEnabled(this.previousPageElement)||(this.previousPageElement.className+=this.disableClass),this.isEnabled(this.nextPageElement)||(this.nextPageElement.className+=this.disableClass),this.isEnabled(this.lastPageElement)||(this.lastPageElement.className+=this.disableClass),this.isEnabled(this.zoomInElement)||(this.zoomInElement.className+=this.disableClass),this.isEnabled(this.zommOutElement)||(this.zommOutElement.className+=this.disableClass),this.isEnabled(this.zoomDropDownElement)||(this.zoomDropDownElement.className+=this.disableClass),this.isEnabled(this.selectToolElement)||(this.selectToolElement.className+=this.disableClass),this.isEnabled(this.handToolElement)||(this.handToolElement.className+=this.disableClass),this.isEnabled(this.undoElement)||(this.undoElement.className+=this.disableClass),this.isEnabled(this.redoElement)||(this.redoElement.className+=this.disableClass),this.isEnabled(this.commentElement)||(this.commentElement.className+=this.disableClass),this.isEnabled(this.searchElement)||(this.searchElement.className+=this.disableClass),this.isEnabled(this.submitFormButton)||(this.submitFormButton.className+=this.disableClass),this.isEnabled(this.annotationElement)||(this.annotationElement.className+=this.disableClass),this.isEnabled(this.printElement)||(this.printElement.className+=this.disableClass),this.isEnabled(this.downloadElement)||(this.downloadElement.className+=this.disableClass)),this.pdfViewer.enableAnnotationToolbar&&(this.isEnabled(this.highlightElement)||(this.highlightElement.className+=this.disableClass),this.isEnabled(this.underlineElement)||(this.underlineElement.className+=this.disableClass),this.isEnabled(this.strikeThroughElement)||(this.strikeThroughElement.className+=this.disableClass),this.isEnabled(this.shapeElement)||(this.shapeElement.className+=this.disableClass),this.isEnabled(this.calibrateElement)||(this.calibrateElement.className+=this.disableClass),this.isEnabled(this.stampElement)||(this.stampElement.className+=this.disableClass),this.isEnabled(this.freeTextElement)||(this.freeTextElement.className+=this.disableClass),this.isEnabled(this.signatureElement)||(this.signatureElement.className+=this.disableClass),this.isEnabled(this.inkElement)||(this.inkElement.className+=this.disableClass),this.isEnabled(this.annotationFontFamilyElement)||(this.annotationFontFamilyElement.className+=this.disableClass),this.isEnabled(this.annotationFontSizeElement)||(this.annotationFontSizeElement.className+=this.disableClass),this.isEnabled(this.annotationTextColorElement)||(this.annotationTextColorElement.className+=this.disableClass),this.isEnabled(this.annotationTextAlignElement)||(this.annotationTextAlignElement.className+=this.disableClass),this.isEnabled(this.annotationTextPropertiesElement)||(this.annotationTextPropertiesElement.className+=this.disableClass),this.isEnabled(this.annotationColorElement)||(this.annotationColorElement.className+=this.disableClass),this.isEnabled(this.annotationStrokeColorElement)||(this.annotationStrokeColorElement.className+=this.disableClass),this.isEnabled(this.annotationThicknessElement)||(this.annotationThicknessElement.className+=this.disableClass),this.isEnabled(this.annotationOpacityElement)||(this.annotationOpacityElement.className+=this.disableClass),this.isEnabled(this.annotationDeleteElement)||(this.annotationDeleteElement.className+=this.disableClass),this.isEnabled(this.annotationCommentPanelElement)||(this.annotationCommentPanelElement.className+=this.disableClass))},cRt.prototype.EnableDeleteOption=function(e){null!==this.annotationDeleteElement&&(e?this.annotationDeleteElement.classList.remove(this.cssClass):this.isEnabled(this.annotationDeleteElement)||(this.annotationDeleteElement.className+=this.disableClass))},cRt.prototype.pageChanged=function(e){this.pdfViewer.enableNavigation&&(this.currentPageBoxElement.value=e.toString()),e===this.pdfViewer.pageCount&&(this.isEnabled(this.nextPageElement)||(this.nextPageElement.className+=this.disableClass),this.previousPageElement.classList.remove(this.cssClass),this.isEnabled(this.lastPageElement)||(this.lastPageElement.className+=this.disableClass),this.firstPageElement.classList.remove(this.cssClass)),e<this.pdfViewer.pageCount&&1!==e&&(this.firstPageElement.classList.remove(this.cssClass),this.previousPageElement.classList.remove(this.cssClass),this.nextPageElement.classList.remove(this.cssClass),this.lastPageElement.classList.remove(this.cssClass)),1===e&&(this.nextPageElement.classList.remove(this.cssClass),this.lastPageElement.classList.remove(this.cssClass),this.isEnabled(this.firstPageElement)||(this.firstPageElement.className+=this.disableClass),this.isEnabled(this.previousPageElement)||(this.previousPageElement.className+=this.disableClass))},cRt.prototype.updateUndoRedoButton=function(e,t){"undo"===e&&(t?this.undoElement.classList.remove(this.cssClass):this.isEnabled(this.undoElement)||(this.undoElement.className+=this.disableClass)),"redo"===e&&(t?this.redoElement.classList.remove(this.cssClass):this.isEnabled(this.redoElement)||(this.redoElement.className+=this.disableClass))},cRt.prototype.disableUndoRedoButton=function(){this.isEnabled(this.undoElement)||(this.undoElement.className+=this.disableClass),this.isEnabled(this.redoElement)||(this.redoElement.className+=this.disableClass)},cRt.prototype.enableTextMarkupAnnotationPropertiesTools=function(e){e?(this.annotationColorElement.classList.remove(this.cssClass),this.annotationOpacityElement.classList.remove(this.cssClass)):(this.isEnabled(this.annotationOpacityElement)||(this.annotationOpacityElement.className+=this.disableClass),this.isEnabled(this.annotationColorElement)||(this.annotationColorElement.className+=this.disableClass)),this.isEnabled(this.annotationFontColorElement)||(this.annotationFontColorElement.className+=this.disableClass),this.isEnabled(this.annotationFontFamilyElement)||(this.annotationFontFamilyElement.className+=this.disableClass),this.isEnabled(this.annotationFontSizeElement)||(this.annotationFontSizeElement.className+=this.disableClass),this.isEnabled(this.annotationTextAlignElement)||(this.annotationTextAlignElement.className+=this.disableClass),this.isEnabled(this.annotationTextPropertiesElement)||(this.annotationTextPropertiesElement.className+=this.disableClass),this.isEnabled(this.annotationStrokeColorElement)||(this.annotationStrokeColorElement.className+=this.disableClass),this.isEnabled(this.annotationThicknessElement)||(this.annotationThicknessElement.className+=this.disableClass)},cRt.prototype.enableAnnotationPropertiesTool=function(e,t){t&&(e?(this.annotationColorElement.classList.remove(this.cssClass),this.annotationStrokeColorElement.classList.remove(this.cssClass),this.annotationThicknessElement.classList.remove(this.cssClass),this.annotationOpacityElement.classList.remove(this.cssClass),this.pdfViewer.enableShapeLabel&&(this.annotationFontColorElement.classList.remove(this.cssClass),this.annotationFontFamilyElement.classList.remove(this.cssClass),this.annotationFontSizeElement.classList.remove(this.cssClass)),this.isEnabled(this.annotationTextAlignElement)||(this.annotationTextAlignElement.className+=this.disableClass),this.isEnabled(this.annotationTextPropertiesElement)||(this.annotationTextPropertiesElement.className+=this.disableClass)):(this.isEnabled(this.annotationColorElement)||(this.annotationColorElement.className+=this.disableClass),this.isEnabled(this.annotationStrokeColorElement)||(this.annotationStrokeColorElement.className+=this.disableClass),this.isEnabled(this.annotationThicknessElement)||(this.annotationThicknessElement.className+=this.disableClass),this.isEnabled(this.annotationOpacityElement)||(this.annotationOpacityElement.className+=this.disableClass),this.isEnabled(this.annotationDeleteElement)||(this.annotationDeleteElement.className+=this.disableClass)))},cRt.prototype.enableFreeTextAnnotationPropertiesTools=function(e,t){t&&e&&(this.annotationColorElement.classList.remove(this.cssClass),this.annotationStrokeColorElement.classList.remove(this.cssClass),this.annotationThicknessElement.classList.remove(this.cssClass),this.annotationOpacityElement.classList.remove(this.cssClass),this.annotationFontColorElement.classList.remove(this.cssClass),this.annotationFontFamilyElement.classList.remove(this.cssClass),this.annotationFontSizeElement.classList.remove(this.cssClass),this.annotationTextAlignElement.classList.remove(this.cssClass),this.annotationTextPropertiesElement.classList.remove(this.cssClass),this.annotationDeleteElement.classList.remove(this.cssClass),this.annotationCommentPanelElement.classList.remove(this.cssClass))},cRt.prototype.enableStampAnnotationPropertiesTools=function(e,t){e?(this.annotationOpacityElement.classList.remove(this.cssClass),this.annotationDeleteElement.classList.remove(this.cssClass),this.annotationCommentPanelElement.classList.remove(this.cssClass)):(this.isEnabled(this.annotationOpacityElement)||(this.annotationOpacityElement.className+=this.disableClass),this.isEnabled(this.annotationDeleteElement)||(this.annotationDeleteElement.className+=this.disableClass),this.isEnabled(this.annotationCommentPanelElement)||(this.annotationCommentPanelElement.className+=this.disableClass)),this.isEnabled(this.annotationColorElement)||(this.annotationColorElement.className+=this.disableClass),this.isEnabled(this.annotationStrokeColorElement)||(this.annotationStrokeColorElement.className+=this.disableClass),this.isEnabled(this.annotationThicknessElement)||(this.annotationThicknessElement.className+=this.disableClass),this.isEnabled(this.annotationOpacityElement)||(this.annotationOpacityElement.className+=this.disableClass),this.isEnabled(this.annotationFontColorElement)||(this.annotationFontColorElement.className+=this.disableClass),this.isEnabled(this.annotationFontFamilyElement)||(this.annotationFontFamilyElement.className+=this.disableClass),this.isEnabled(this.annotationFontSizeElement)||(this.annotationFontSizeElement.className+=this.disableClass),this.isEnabled(this.annotationTextAlignElement)||(this.annotationTextAlignElement.className+=this.disableClass),this.isEnabled(this.annotationTextPropertiesElement)||(this.annotationTextPropertiesElement.className+=this.disableClass)},cRt.prototype.enableSignaturePropertiesTools=function(e,t){e?(this.annotationStrokeColorElement.classList.remove(this.cssClass),this.annotationThicknessElement.classList.remove(this.cssClass),this.annotationOpacityElement.classList.remove(this.cssClass),this.annotationDeleteElement.classList.remove(this.cssClass),this.annotationCommentPanelElement.classList.remove(this.cssClass)):(this.isEnabled(this.annotationStrokeColorElement)||(this.annotationStrokeColorElement.className+=this.disableClass),this.isEnabled(this.annotationThicknessElement)||(this.annotationThicknessElement.className+=this.disableClass),this.isEnabled(this.annotationOpacityElement)||(this.annotationOpacityElement.className+=this.disableClass),this.isEnabled(this.annotationDeleteElement)||(this.annotationDeleteElement.className+=this.disableClass),this.isEnabled(this.annotationCommentPanelElement)||(this.annotationCommentPanelElement.className+=this.disableClass)),this.isEnabled(this.annotationColorElement)||(this.annotationColorElement.className+=this.disableClass),this.isEnabled(this.annotationFontColorElement)||(this.annotationFontColorElement.className+=this.disableClass),this.isEnabled(this.annotationFontFamilyElement)||(this.annotationFontFamilyElement.className+=this.disableClass),this.isEnabled(this.annotationFontSizeElement)||(this.annotationFontSizeElement.className+=this.disableClass),this.isEnabled(this.annotationTextAlignElement)||(this.annotationTextAlignElement.className+=this.disableClass),this.isEnabled(this.annotationTextPropertiesElement)||(this.annotationTextPropertiesElement.className+=this.disableClass)},cRt.prototype.annotationAdd=function(){this.isEnabled(this.annotationColorElement)||(this.annotationColorElement.className+=this.disableClass),this.isEnabled(this.annotationStrokeColorElement)||(this.annotationStrokeColorElement.className+=this.disableClass),this.isEnabled(this.annotationThicknessElement)||(this.annotationThicknessElement.className+=this.disableClass),this.isEnabled(this.annotationOpacityElement)||(this.annotationOpacityElement.className+=this.disableClass),this.isEnabled(this.annotationFontColorElement)||(this.annotationFontColorElement.className+=this.disableClass),this.isEnabled(this.annotationFontFamilyElement)||(this.annotationFontFamilyElement.className+=this.disableClass),this.isEnabled(this.annotationFontSizeElement)||(this.annotationFontSizeElement.className+=this.disableClass),this.isEnabled(this.annotationTextAlignElement)||(this.annotationTextAlignElement.className+=this.disableClass),this.isEnabled(this.annotationTextPropertiesElement)||(this.annotationTextPropertiesElement.className+=this.disableClass)},cRt.prototype.annotationUnSelect=function(){this.isEnabled(this.annotationColorElement)||(this.annotationColorElement.className+=this.disableClass),this.isEnabled(this.annotationStrokeColorElement)||(this.annotationStrokeColorElement.className+=this.disableClass),this.isEnabled(this.annotationThicknessElement)||(this.annotationThicknessElement.className+=this.disableClass),this.isEnabled(this.annotationOpacityElement)||(this.annotationOpacityElement.className+=this.disableClass),this.isEnabled(this.annotationFontColorElement)||(this.annotationFontColorElement.className+=this.disableClass),this.isEnabled(this.annotationFontFamilyElement)||(this.annotationFontFamilyElement.className+=this.disableClass),this.isEnabled(this.annotationFontSizeElement)||(this.annotationFontSizeElement.className+=this.disableClass),this.isEnabled(this.annotationTextAlignElement)||(this.annotationTextAlignElement.className+=this.disableClass),this.isEnabled(this.annotationTextPropertiesElement)||(this.annotationTextPropertiesElement.className+=this.disableClass),this.isEnabled(this.annotationDeleteElement)||(this.annotationDeleteElement.className+=this.disableClass)},cRt.prototype.annotationSelect=function(e){"FreeText"===e&&(this.annotationColorElement.classList.remove(this.cssClass),this.annotationStrokeColorElement.classList.remove(this.cssClass),this.annotationThicknessElement.classList.remove(this.cssClass),this.annotationOpacityElement.classList.remove(this.cssClass),this.annotationFontColorElement.classList.remove(this.cssClass),this.annotationFontFamilyElement.classList.remove(this.cssClass),this.annotationFontSizeElement.classList.remove(this.cssClass),this.annotationTextAlignElement.classList.remove(this.cssClass),this.annotationTextPropertiesElement.classList.remove(this.cssClass)),"Shape"!==e&&"Measure"!==e||(this.annotationColorElement.classList.remove(this.cssClass),this.annotationStrokeColorElement.classList.remove(this.cssClass),this.annotationThicknessElement.classList.remove(this.cssClass),this.annotationOpacityElement.classList.remove(this.cssClass),this.isEnabled(this.annotationFontColorElement)||(this.annotationFontColorElement.className+=this.disableClass),this.isEnabled(this.annotationFontFamilyElement)||(this.annotationFontFamilyElement.className+=this.disableClass),this.isEnabled(this.annotationFontSizeElement)||(this.annotationFontSizeElement.className+=this.disableClass),this.isEnabled(this.annotationTextAlignElement)||(this.annotationTextAlignElement.className+=this.disableClass),this.isEnabled(this.annotationTextPropertiesElement))||(this.annotationTextPropertiesElement.className+=this.disableClass),"TextMarkup"===e&&(this.annotationColorElement.classList.remove(this.cssClass),this.isEnabled(this.annotationStrokeColorElement)||(this.annotationStrokeColorElement.className+=this.disableClass),this.isEnabled(this.annotationThicknessElement)||(this.annotationThicknessElement.className+=this.disableClass),this.annotationOpacityElement.classList.remove(this.cssClass),this.isEnabled(this.annotationFontColorElement)||(this.annotationFontColorElement.className+=this.disableClass),this.isEnabled(this.annotationFontFamilyElement)||(this.annotationFontFamilyElement.className+=this.disableClass),this.isEnabled(this.annotationFontSizeElement)||(this.annotationFontSizeElement.className+=this.disableClass),this.isEnabled(this.annotationTextAlignElement)||(this.annotationTextAlignElement.className+=this.disableClass),this.isEnabled(this.annotationTextPropertiesElement)||(this.annotationTextPropertiesElement.className+=this.disableClass)),this.annotationDeleteElement.classList.remove(this.cssClass),this.annotationCommentPanelElement.classList.remove(this.cssClass)},cRt.prototype.updateFontFamilyInIcon=function(e){this.annotationFontFamilyInputElement.value=e},cRt.prototype.updateFontSizeInIcon=function(e){e=e.toString()+"px";this.annotationFontSizeInputElement.value=e},cRt.prototype.enableSearchItems=function(e){e?(this.mobileSearchPreviousOccurenceElement.classList.remove(this.cssClass),this.mobileSearchNextOccurenceElement.classList.remove(this.cssClass)):(this.isEnabled(this.mobileSearchPreviousOccurenceElement)||(this.mobileSearchPreviousOccurenceElement.className+=this.disableClass),this.isEnabled(this.mobileSearchNextOccurenceElement)||(this.mobileSearchNextOccurenceElement.className+=this.disableClass))},cRt.prototype.tapOnMobileDevice=function(e){null!=this.mobileToolbarContainerElement&&(this.mobileToolbarContainerElement.style.display=e?"none":"block")},cRt.prototype.isEnabled=function(e){return e.classList.contains(this.cssClass)};var pRt=cRt;function cRt(e,t){this.pdfViewer=null,this.pdfViewerBase=null,this.totalPageElement=null,this.currentPageBoxElementContainer=null,this.currentPageBoxElement=null,this.firstPageElement=null,this.previousPageElement=null,this.nextPageElement=null,this.lastPageElement=null,this.zommOutElement=null,this.zoomInElement=null,this.zoomDropDownElement=null,this.selectToolElement=null,this.handToolElement=null,this.undoElement=null,this.redoElement=null,this.commentElement=null,this.submitFormButton=null,this.searchElement=null,this.annotationElement=null,this.printElement=null,this.downloadElement=null,this.highlightElement=null,this.underlineElement=null,this.strikeThroughElement=null,this.shapeElement=null,this.calibrateElement=null,this.stampElement=null,this.freeTextElement=null,this.signatureElement=null,this.inkElement=null,this.annotationFontSizeInputElement=null,this.annotationFontFamilyInputElement=null,this.annotationColorElement=null,this.annotationStrokeColorElement=null,this.annotationThicknessElement=null,this.annotationOpacityElement=null,this.annotationFontColorElement=null,this.annotationFontFamilyElement=null,this.annotationFontSizeElement=null,this.annotationTextAlignElement=null,this.annotationTextColorElement=null,this.annotationTextPropertiesElement=null,this.annotationDeleteElement=null,this.annotationCloseElement=null,this.annotationCommentPanelElement=null,this.mobileToolbarContainerElement=null,this.mobileSearchPreviousOccurenceElement=null,this.mobileSearchNextOccurenceElement=null,this.cssClass="e-overlay",this.disableClass=" e-overlay",this.editAnnotationButtonElement=null,this.pdfViewer=e,this.pdfViewerBase=t,this.findToolbarElements()}var uRt=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},gRt=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},mRt=(fRt.isSupportedFont=function(e,t){try{if(!je(e)&&!je(t)){for(var i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)];if(t._fontInternal._ttfReader._getGlyph(n),!t._fontInternal._ttfReader._isFontPresent&&" "!==n&&!this.hasEscapeSequences(n))return t._fontInternal._ttfReader._isFontPresent}return!0}}catch(e){}return!1},fRt.hasEscapeSequences=function(e){return/[\0\b\t\n\v\f\r'"\\]/.test(e)},fRt.processFontStream=function(e){return e instanceof Uint8Array?this.convertByteArrayToBase64(e):e},fRt.fetchCustomFonts=function(e,s){var t=this,a={},e=e.map(function(n){var e=n.startsWith("http://")||n.startsWith("https://")?n:s+"/"+n,o=e.split("/"),r=o.pop()||"";return-1===Object.keys(a).indexOf(r)?t.fetchData(e).then(function(i){return uRt(t,void 0,void 0,function(){var t;return gRt(this,function(e){return i?(a[-1!==o.indexOf("fallbackfonts")?"fallbackfonts_"+r.toLowerCase():r.toLowerCase()]=i,[2]):(t=s+"/fallbackfonts/"+n,[2,this.fetchData(t).then(function(e){e&&(a["fallbackfonts_"+r.toLowerCase()]=e)})])})})}):null});return Promise.all(e).then(function(){return a})},fRt.tryGetFontFromKeys=function(e,t,i,n){for(var o=0,r=Object.keys(e);o<r.length;o++){var s=r[o],s=this.processFontStream(e[""+s]),s=new Uxt(s,this.convertPixelToPoint(i),n||Jxt.regular);if(this.isSupportedFont(t,s))return s;0}return null},fRt.getFontKey=function(e,t){if(e[""+t]||e[t+".ttf"])return e[""+t]?t:t+".ttf";var i,n=t.endsWith(".ttf")?t:t+".ttf";for(i in e)if(i.toLowerCase().endsWith(n.toLowerCase()))return i},fRt.isHexRGBAAndTransparent=function(e){return!!/^#([A-Fa-f0-9]{8})$/.test(e)&&(e=e.slice(-2),0===parseInt(e,16))},fRt.setTransparencyToHex=function(e){return e.includes("#")&&(8<e.length&&"#00000000"!==e?e=e.slice(0,-2)+"60":e+="60"),e},fRt.removeAlphaValueFromHex=function(e){return e=e.includes("#")&&8<e.length?e.slice(0,-2):e},fRt.fetchData=function(e){return fetch(e).then(function(e){return e.ok?e.arrayBuffer().then(function(e){return new Uint8Array(e)}):null}).catch(function(){return null})},fRt.convertByteArrayToBase64=function(e){for(var t="",i=e.byteLength,n=0;n<i;n++)t+=String.fromCharCode(e[parseInt(n.toString(),10)]);return btoa(t)},fRt.convertPixelToPoint=function(e){return 72*e/96},fRt.cloneProxy=function(e){if(this.isProxy(e)){var t,i=Object.assign({},e);for(t in i)this.isProxy(i[t])&&(i[t]=this.cloneProxy(i[t]));return i}return e},fRt.isProxy=function(e){return"[object Object]"===Object.prototype.toString.call(e)},fRt.createGUID=function(){return this.getRandomNumber()},fRt.getRandomNumber=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){return(16*Math.random()|0).toString(16)})},fRt);function fRt(){}vRt.prototype.setItem=function(e,t){this.enableLocalStorage?this.localStorage[""+e]=t:window.sessionStorage.setItem(e,t)},vRt.prototype.getItem=function(e){return this.enableLocalStorage?e in this.localStorage?this.localStorage[""+e]:null:window.sessionStorage.getItem(e)},vRt.prototype.removeItem=function(e){this.enableLocalStorage?delete this.localStorage[""+e]:window.sessionStorage.removeItem(e)},vRt.prototype.getSessionLength=function(){return(this.enableLocalStorage?Object.keys(this.localStorage):window.sessionStorage).length},vRt.prototype.getKey=function(e){return this.enableLocalStorage?Object.keys(this.localStorage)[parseInt(e.toString(),10)]||null:window.sessionStorage.key(e)},vRt.prototype.getWindowSessionStorageSize=function(){return Math.round(JSON.stringify(window.sessionStorage).length/1024)},vRt.prototype.migrateToLocalStorage=function(e){if(this.enableLocalStorage=e,this.enableLocalStorage)for(var t=this.getRemovingItems(),i=0;i<t.length;i++){var n,o=t[parseInt(i.toString(),10)];!o||je(n=window.sessionStorage.getItem(o))||""===this.documentId||-1===o.indexOf(this.documentId)||(this.localStorage[""+o]=n,window.sessionStorage.removeItem(o))}},vRt.prototype.clear=function(){if(this.enableLocalStorage)this.localStorage={};else for(var e=this.getRemovingItems(),t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];-1!==i.indexOf("Sync_PdfViewer_")&&window.sessionStorage.removeItem(i)}},vRt.prototype.getRemovingItems=function(){for(var e=[],t=0;t<window.sessionStorage.length;t++){var i=window.sessionStorage.key(t);i&&e.push(i)}return e};var yRt,cft=vRt;function vRt(e){this.localStorage={},this.enableLocalStorage=!0,this.documentId="",this.enableLocalStorage=e}(mft=yRt=yRt||{})[mft.High=1]="High",mft[mft.Medium=2]="Medium",mft[mft.Low=3]="Low";wRt.prototype.addTask=function(e,t){"unloadFPDF"===e.message&&(this.taskQueue=[],this.functionManager={}),this.taskQueue.push({taskData:e,priority:t}),this.taskQueue.sort(function(e,t){return e.priority-t.priority}),this.processQueue()},wRt.prototype.processQueue=function(){var e;this.isProcessing||0===this.taskQueue.length||(e=this.taskQueue.shift(),this.isProcessing=!0,e=this.pdfViewer.isVue3||this.pdfViewer.parent&&this.pdfViewer.parent.isVue3?mRt.cloneProxy(e.taskData):e.taskData,this.worker.postMessage(e))},wRt.prototype.onMessage=function(e,t){var i=this;Object.prototype.hasOwnProperty.call(this.functionManager,e)||(this.functionManager[""+e]=t),this.worker.onmessage=function(e){if(""!==e.data.message)for(var t in i.functionManager)if(Object.prototype.hasOwnProperty.call(i.functionManager,t)&&t.includes(e.data.message)){i.functionManager[""+t](e);break}i.isProcessing=!1,i.processQueue()}},wRt.prototype.terminate=function(){this.worker.terminate(),this.functionManager={}};var bRt=wRt;function wRt(e,t){this.taskQueue=[],this.isProcessing=!1,this.functionManager={},this.worker=new Worker(e),this.taskQueue=[],this.isProcessing=!1,this.pdfViewer=t,this.functionManager={}}var CRt=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},SRt=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},ARt=(C.prototype.initializeComponent=function(){var e,t=document.getElementById(this.pdfViewer.element.id);t&&(this.blazorUIAdaptor=N?new pRt(this.pdfViewer,this):null,F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.pdfViewer.element.classList.add("e-pv-mobile-view"),e=void 0,this.viewerMainContainer=N?t.querySelector(".e-pv-viewer-main-container"):Q("div",{id:this.pdfViewer.element.id+"_viewerMainContainer",className:"e-pv-viewer-main-container"}),this.viewerContainer=N?t.querySelector(".e-pv-viewer-container"):Q("div",{id:this.pdfViewer.element.id+"_viewerContainer",className:"e-pv-viewer-container"}),F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.createMobilePageNumberContainer(),this.viewerContainer.tabIndex=-1,this.pdfViewer.enableRtl&&(this.viewerContainer.style.direction="rtl"),t.style.touchAction="pan-x pan-y",this.setMaximumHeight(t),this.mainContainer=N?t.querySelector(".e-pv-main-container"):Q("div",{id:this.pdfViewer.element.id+"_mainContainer",className:"e-pv-main-container"}),this.mainContainer.appendChild(this.viewerMainContainer),t.appendChild(this.mainContainer),this.applyViewerHeight(this.mainContainer),this.pdfViewer.toolbarModule?(this.navigationPane.initializeNavigationPane(),e=this.pdfViewer.toolbarModule.intializeToolbar("100%")):N&&(this.navigationPane.initializeNavigationPane(),e=this.pdfViewer.element.querySelector(".e-pv-toolbar"),this.pdfViewer.enableToolbar||(this.toolbarHeight=0,e.style.display="none"),!this.pdfViewer.enableNavigationToolbar)&&(F.isDevice&&this.pdfViewer.enableDesktopMode||!F.isDevice)&&(this.navigationPane.sideBarToolbar.style.display="none",this.navigationPane.sideBarToolbarSplitter.style.display="none",this.navigationPane.isBookmarkOpen||this.navigationPane.isThumbnailOpen)&&this.navigationPane.updateViewerContainerOnClose(),this.viewerContainer.style.height=e?this.updatePageHeight(this.pdfViewer.element.getBoundingClientRect().height,56):this.updatePageHeight(this.pdfViewer.element.getBoundingClientRect().height,0),t=this.pdfViewer.element.clientWidth,F.isDevice&&!this.pdfViewer.enableDesktopMode||(t=t-(this.navigationPane.sideBarToolbar?this.navigationPane.getViewerContainerLeft():0)-(this.navigationPane.commentPanelContainer?this.navigationPane.getViewerContainerRight():0)),this.viewerContainer.style.width=t+"px",this.viewerMainContainer.appendChild(this.viewerContainer),F.isDevice&&!this.pdfViewer.enableDesktopMode&&(this.mobileScrollerContainer.style.left=t-parseFloat(this.mobileScrollerContainer.style.width)+"px",this.mobilePageNoContainer.style.left=t/2-parseFloat(this.mobilePageNoContainer.style.width)/2+"px",this.mobilePageNoContainer.style.top=this.pdfViewer.element.clientHeight/2+"px",this.mobilePageNoContainer.style.display="none",this.mobilePageNoContainer.appendChild(this.mobilecurrentPageContainer),this.mobilePageNoContainer.appendChild(this.mobilenumberContainer),this.mobilePageNoContainer.appendChild(this.mobiletotalPageContainer),this.viewerContainer.appendChild(this.mobilePageNoContainer),this.viewerMainContainer.appendChild(this.mobileScrollerContainer),this.mobileScrollerContainer.appendChild(this.mobileSpanContainer),this.pdfViewer.isAnnotationToolbarVisible)&&this.pdfViewer.toolbarModule&&this.pdfViewer.toolbar.showAnnotationToolbar(!0),this.pageContainer=Q("div",{id:this.pdfViewer.element.id+"_pageViewContainer",className:"e-pv-page-container",attrs:{role:"document"}}),this.pdfViewer.enableRtl&&(this.pageContainer.style.direction="ltr"),this.viewerContainer.appendChild(this.pageContainer),this.pageContainer.style.width=this.viewerContainer.clientWidth+"px",e&&this.pdfViewer.thumbnailViewModule&&(!F.isDevice||this.pdfViewer.enableDesktopMode)&&this.pdfViewer.thumbnailViewModule.createThumbnailContainer(),this.createPrintPopup(),F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.createGoToPagePopup(),t=Q("div",{id:this.pdfViewer.element.id+"_loadingIndicator"}),this.viewerContainer.appendChild(t),GLt({target:t,cssClass:"e-spin-center"}),this.setLoaderProperties(t),N?(this.contextMenuModule=new fLt(this.pdfViewer,this),(e=document.getElementsByClassName(this.pdfViewer.element.id+"_spinner"))&&e[0]&&!e[0].classList.contains("e-spin-hide")&&(e[0].classList.remove("e-spin-show"),e[0].classList.add("e-spin-hide"))):this.contextMenuModule=new TRt(this.pdfViewer,this),this.contextMenuModule.createContextMenu(),this.createFileInputElement(),this.wireEvents(),!this.pdfViewer.textSearchModule||F.isDevice&&!this.pdfViewer.enableDesktopMode||this.pdfViewer.textSearchModule.createTextSearchBox(),this.pdfViewer.documentPath&&(this.pdfViewer.enableHtmlSanitizer&&(this.pdfViewer.documentPath=go.sanitize(this.pdfViewer.documentPath)),N?this.pdfViewer._dotnetInstance.invokeMethodAsync("LoadDocumentFromClient",this.pdfViewer.documentPath):this.pdfViewer.load(this.pdfViewer.documentPath,null)),this.pdfViewer.annotationModule)&&this.pdfViewer.annotationModule.initializeCollection(),F.isDevice&&this.pdfViewer.enableDesktopMode&&this.pdfViewer.toolbarModule&&(this.pdfViewer.interactionMode="Pan")},C.prototype.createMobilePageNumberContainer=function(){this.mobilePageNoContainer=Q("div",{id:this.pdfViewer.element.id+"_mobilepagenoContainer",className:"e-pv-mobilepagenoscroll-container"}),this.mobilecurrentPageContainer=Q("span",{id:this.pdfViewer.element.id+"_mobilecurrentpageContainer",className:"e-pv-mobilecurrentpage-container"}),this.mobilenumberContainer=Q("span",{id:this.pdfViewer.element.id+"_mobiledashedlineContainer",className:"e-pv-mobiledashedline-container"}),this.mobiletotalPageContainer=Q("span",{id:this.pdfViewer.element.id+"_mobiletotalpageContainer",className:"e-pv-mobiletotalpage-container"}),this.mobileScrollerContainer=Q("div",{id:this.pdfViewer.element.id+"_mobilescrollContainer",className:"e-pv-mobilescroll-container"}),this.mobileSpanContainer=Q("span",{id:this.pdfViewer.element.id+"_mobilespanContainer",className:"e-pv-mobilespanscroll-container"}),this.mobileSpanContainer.innerHTML="1",this.mobilecurrentPageContainer.innerHTML="1",this.mobilenumberContainer.innerHTML="&#x2015;&#x2015;&#x2015;&#x2015;&#x2015;",this.mobileScrollerContainer.style.cssFloat="right",this.mobileScrollerContainer.style.width="40px",this.mobileScrollerContainer.style.height="32px",this.mobileScrollerContainer.style.zIndex="100",this.mobilePageNoContainer.style.width="120px",this.mobilePageNoContainer.style.height="100px",this.mobilePageNoContainer.style.zIndex="100",this.mobilePageNoContainer.style.position="fixed",this.mobileScrollerContainer.addEventListener("touchstart",this.mobileScrollContainerDown.bind(this)),this.mobileScrollerContainer.addEventListener("touchend",this.mobileScrollContainerEnd.bind(this)),this.mobileScrollerContainer.style.display="none"},C.prototype.initiatePageRender=function(s,a,l){var e,h=this;void 0===l&&(l=!0),this.isPasswordProtected=!je(a)&&""!==a,this.clientSideRendering&&this.pdfViewer.unload(),this.loadedData=s,this.documentId=this.createGUID(),C.sessionStorageManager.documentId=this.documentId,this.viewerContainer&&(this.viewerContainer.scrollTop=0),this.showLoadingIndicator(!0),this.hashId=" ",this.isFileName=!1,this.saveDocumentInfo(),"Pan"===this.pdfViewer.interactionMode&&this.initiatePanning(),s instanceof Uint8Array?(this.pdfViewer.fileByteArray=s,this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.uploadedDocumentName&&this.setFileName(),this.clientSideRendering&&null===this.pdfViewer.fileName&&"string"==typeof this.loadedData&&this.setDocumentName(this.loadedData),this.pdfViewer.downloadFileName?this.downloadFileName=this.pdfViewer.downloadFileName:this.downloadFileName=this.pdfViewer.fileName,e=this.constructJsonObject(s,a,!1),this.createAjaxRequest(e,s,a)):this.getPdfByteArray(s).then(function(e){var t,i=!1,n=!0,o=!1,r=("string"==typeof s&&(s.startsWith("http://")||s.startsWith("https://"))&&(i=!0),"string"==typeof s&&(s.includes("pdf;base64,")||s.startsWith("blob:"))&&(o=!0),!1);"string"==typeof h.loadedData&&(r=h.loadedData.includes("pdf;base64,")),(i||o)&&h.clientSideRendering?(h.pdfViewer.fileByteArray=e,h.pdfViewer.uploadedFileByteArray=e,s=e):i||s.includes("pdf;base64,")||!h.clientSideRendering?s=h.checkDocumentData(h.loadedData,l):(t="URL"===h.identifyDataType(s),(n=h.isValidPDFBase64(s)||t)?(s=h.convertBase64(e),h.pdfViewer.fileByteArray=s,o=!0):h.invalidFilePopup()),n&&((h.pdfViewer.toolbarModule&&h.pdfViewer.toolbarModule.uploadedDocumentName||o||!o&&!i&&!s.includes("pdf;base64,"))&&h.setFileName(),i&&h.clientSideRendering&&null===h.pdfViewer.fileName&&h.setDocumentName(h.loadedData),h.pdfViewer.downloadFileName?h.downloadFileName=h.pdfViewer.downloadFileName:h.downloadFileName=h.pdfViewer.fileName,t=h.constructJsonObject(s,a,r),h.createAjaxRequest(t,s,a))})},C.prototype.initiateLoadDocument=function(e,t,i){e&&(this.documentId=e,C.sessionStorageManager.documentId=this.documentId),this.viewerContainer&&(this.viewerContainer.scrollTop=0),this.showLoadingIndicator(!0),this.hashId=" ",this.isFileName=t,this.saveDocumentInfo(),"Pan"===this.pdfViewer.interactionMode&&this.initiatePanning(),this.setFileName(),null===this.pdfViewer.fileName&&(t&&i?(this.pdfViewer.fileName=i,this.jsonDocumentId=this.pdfViewer.fileName):(this.pdfViewer.fileName="undefined.pdf",this.jsonDocumentId=null)),this.pdfViewer.downloadFileName?this.downloadFileName=this.pdfViewer.downloadFileName:this.downloadFileName=this.pdfViewer.fileName},C.prototype.convertBase64=function(e){return new Uint8Array(atob(e).split("").map(function(e){return e.charCodeAt(0)}))},C.prototype.loadSuccess=function(e,t){var i=e;if(i){if("object"!=typeof i)try{i=JSON.parse(i)}catch(e){this.onControlError(500,i,this.pdfViewer.serverActionSettings.load),i=null}if(i){for(;"object"!=typeof i;)if(i=JSON.parse(i),"number"==typeof parseInt(i,10)&&!isNaN(parseInt(i,10))){i=parseInt(i,10);break}i.StatusText&&"File Does not Exist"===i.StatusText&&this.showLoadingIndicator(!1),i.uniqueId!==this.documentId&&("number"!=typeof parseInt(i,10)||isNaN(parseInt(i,10)))||(this.pdfViewer.fireAjaxRequestSuccess(this.pdfViewer.serverActionSettings.load,i),this.requestSuccess(i,null,t))}}},C.prototype.mobileScrollContainerDown=function(e){var t;this.ispageMoved=!1,this.isThumb=!0,this.isScrollerMoving=!1,this.isTextMarkupAnnotationModule()&&null!=this.pdfViewer.annotationModule.textMarkupAnnotationModule.selectTextMarkupCurrentPage&&F.isDevice&&!this.pdfViewer.enableDesktopMode&&(t=this.pdfViewer.annotationModule.textMarkupAnnotationModule.selectTextMarkupCurrentPage,this.pdfViewer.annotationModule.textMarkupAnnotationModule.selectTextMarkupCurrentPage=null,this.pdfViewer.annotationModule.textMarkupAnnotationModule.clearAnnotationSelection(t),this.pdfViewer.toolbar.showToolbar(!0)),this.mobileScrollerContainer.addEventListener("touchmove",this.viewerContainerOnScroll.bind(this),!0)},C.prototype.relativePosition=function(e){var t=this.viewerContainer.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},C.prototype.getAnnotationCanvas=function(e,t){var i,n,o,e=this.getElement(e+t);return e||this.isPrint||je(t)||(i=this.getElement("_pageDiv_"+t),n=this.pageSize[parseInt(t.toString(),10)].width,o=this.pageSize[parseInt(t.toString(),10)].height,i&&(e=this.createAnnotationLayer(i,n,o,t),this.isShapeBasedAnnotationsEnabled())&&e&&(HCt(e.getBoundingClientRect(),"position:absolute;top:0px;left:0px;overflow:hidden;pointer-events:none;z-index:1000",e,t,this.pdfViewer),this.pdfViewer.renderSelector(t,this.pdfViewer.annotationSelectorSettings))),e},C.prototype.createAnnotationLayer=function(e,t,i,n,o){var r=this.getElement("_annotationCanvas_"+n);return r?(this.updateCanvas(r,t,i,n),r):(r=Q("canvas",{id:this.pdfViewer.element.id+"_annotationCanvas_"+n,className:"e-pv-annotation-canvas"}),this.updateCanvas(r,t,i,n),e.appendChild(r),r)},C.prototype.setMaximumHeight=function(e){var t=e.getBoundingClientRect();(!F.isDevice||this.pdfViewer.enableDesktopMode||t&&0===t.height)&&(e.style.minHeight="500px"),this.updateWidth(),this.updateHeight()},C.prototype.applyViewerHeight=function(e){var t=e.getBoundingClientRect();F.isDevice&&!this.pdfViewer.enableDesktopMode&&t&&0===t.height&&(e.style.minHeight="500px")},C.prototype.updateCanvas=function(e,t,i,n){var o=this.getZoomFactor(),r=this.getZoomRatio(o);e.width=t*r,e.height=i*r,e.style.width=t*o+"px",e.style.height=i*o+"px",e.style.position="absolute",e.style.zIndex="1",this.applyElementStyles(e,n)},C.prototype.updateWidth=function(){"auto"!==this.pdfViewer.width.toString()&&(this.pdfViewer.element.style.width=this.pdfViewer.width)},C.prototype.updateHeight=function(){"auto"!==this.pdfViewer.height.toString()&&(this.pdfViewer.element.style.height=this.pdfViewer.height)},C.prototype.updateViewerContainer=function(){var e,t=this.getElement("_sideBarContentContainer"),t=(t&&"none"===t.style.display?this.navigationPane.updateViewerContainerOnClose():t&&"block"===t.style.display?this.navigationPane.updateViewerContainerOnExpand():this.updateViewerContainerSize(),this.pdfViewer.toolbarModule);je(this.viewerContainer)||je(t)||je(t.toolbarElement)||("none"==t.toolbarElement.style.display?this.viewerContainer.style.height=this.updatePageHeight(this.pdfViewer.element.getBoundingClientRect().height,0):"block"==t.toolbarElement.style.display&&(e=document.getElementById(this.pdfViewer.element.id+"_toolbarContainer"))&&(e=e.getBoundingClientRect().height,this.viewerContainer.style.height=this.updatePageHeight(this.pdfViewer.element.getBoundingClientRect().height,e)),this.navigationPane.sideBarToolbar&&(this.navigationPane.sideBarToolbar.style.height=this.updatePageHeight(this.pdfViewer.element.getBoundingClientRect().height,0))),t&&(N?(this.pdfViewer.enableToolbar||this.pdfViewer.enableAnnotationToolbar)&&this.pdfViewer._dotnetInstance.invokeMethodAsync("RefreshToolbarItems"):(this.pdfViewer.enableToolbar&&!je(t.toolbar)&&t.toolbar.refreshOverflow(),this.pdfViewer.enableAnnotationToolbar&&t.annotationToolbarModule&&(je(t.annotationToolbarModule)||je(t.annotationToolbarModule.toolbar)||t.annotationToolbarModule.toolbar.refreshOverflow())))},C.prototype.updateViewerContainerSize=function(){je(this.viewerContainer)||(this.viewerContainer.style.width=this.pdfViewer.element.clientWidth+"px"),je(this.pageContainer)||(this.pageContainer.style.width=this.viewerContainer.offsetWidth+"px"),this.updateZoomValue()},C.prototype.mobileScrollContainerEnd=function(e){this.ispageMoved||this.goToPagePopup.show(),this.isThumb=!1,this.ispageMoved=!1,this.isScrollerMoving=!1,this.pageViewScrollChanged(this.currentPageNumber),this.mobileScrollerContainer.removeEventListener("touchmove",this.viewerContainerOnScroll.bind(this),!0),this.mobilePageNoContainer.style.display="none"},C.prototype.checkRedirection=function(e){var t=!1;return e&&"object"==typeof e&&(e.redirectUrl||e.redirectUri||""===e.redirectUrl||""===e.redirectUri)?""===e.redirectUrl||""===e.redirectUri?t=!0:e.redirectUrl?window.location.href=e.redirectUrl:window.location.href=e.redirectUri:e&&"string"==typeof e&&(e.includes("redirectUrl")||e.includes("redirectUri"))&&(""===JSON.parse(e).redirectUrl||""===JSON.parse(e).redirectUri?t=!0:je(JSON.parse(e).redirectUrl)&&je(JSON.parse(e).redirectUri)||(e.includes("redirectUrl")?window.location.href=JSON.parse(e).redirectUrl:window.location.href=JSON.parse(e).redirectUri)),t},C.prototype.getPdfByteArray=function(e){var t=this;return"string"==typeof e&&this.clientSideRendering&&(e.startsWith("http://")||e.startsWith("https://")||e.includes("pdf;base64,")||e.startsWith("blob:"))?fetch(e).then(function(e){if(e.ok)return e.arrayBuffer();throw new Error(e.statusText)}).then(function(e){return new Uint8Array(e)}).catch(function(e){throw t.openNotificationPopup("CORS policy error"),t.pdfViewer.fireDocumentLoadFailed(!1,null),e}):Promise.resolve(e)},C.prototype.getPdfBase64=function(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("blob:")?fetch(e).then(function(e){if(e.ok)return e.arrayBuffer();throw console.error("Error fetching PDF:",e.statusText),new Error(e.statusText)}).then(function(e){e=new Uint8Array(e).reduce(function(e,t){return e+String.fromCharCode(t)},"");return btoa(e)}).catch(function(e){throw console.error("Error fetching PDF:",e.message),e}):Promise.resolve(e)},C.prototype.isValidPDFBase64=function(e){if(e.length%4!=0||!/^[A-Za-z0-9+/]+={0,2}$/.test(e.replace(/\s/g,"")))return!1;try{return-1<atob(e).indexOf("%PDF-")}catch(e){return!1}},C.prototype.isUrl=function(e){try{return new URL(e),!0}catch(e){return!1}},C.prototype.isBase64=function(e){return/^[A-Za-z0-9+/=]+$/.test(e)},C.prototype.identifyDataType=function(e){return this.isUrl(e)?"URL":this.isBase64(e)?"Base64":"Unknown"},C.prototype.createAjaxRequest=function(t,i,n){this.corruptPopup&&this.closeCorruptPopup(),this.notifyDialog&&this.closeNotification();var o=this;if(this.pdfViewer.serverActionSettings)if(this.loadRequestHandler=new DRt(this.pdfViewer),this.loadRequestHandler.url=this.pdfViewer.serviceUrl+"/"+this.pdfViewer.serverActionSettings.load,this.loadRequestHandler.responseType="json",this.loadRequestHandler.mode=!0,t.action="Load",t.elementId=this.pdfViewer.element.id,this.clientSideRendering){var r=this.pdfViewer.pdfRendererModule.load(i,this.documentId,n,t);if(r){if("object"!=typeof r)try{r=JSON.parse(r)}catch(e){o.onControlError(500,r,this.pdfViewer.serverActionSettings.load),r=null}if(r){for(;"object"!=typeof r;)if(r=JSON.parse(r),"number"==typeof parseInt(r,10)&&!isNaN(parseInt(r,10))){r=parseInt(r,10);break}r.uniqueId!==o.documentId&&("number"!=typeof parseInt(r,10)||isNaN(parseInt(r,10)))||(o.updateFormFieldName(r),o.pdfViewer.fireAjaxRequestSuccess(this.pdfViewer.serverActionSettings.load,r),!je(r.isTaggedPdf)&&r.isTaggedPdf&&(o.isTaggedPdf=!0),o.requestSuccess(r,i,n))}}else o.invalidFilePopup()}else i.startsWith("blob:")?o.getPdfBase64(i).then(function(e){e&&(t.document=e,t.isFileName=!1),o.loadRequestHandler.send(t)}).catch(function(e){o.invalidFilePopup()}):o.loadRequestHandler.send(t),this.loadRequestHandler.onSuccess=function(e){var t=e.data;if(o.checkRedirection(t))o.showLoadingIndicator(!1);else if(t){if("object"!=typeof t)try{t=JSON.parse(t)}catch(e){o.onControlError(500,t,this.pdfViewer.serverActionSettings.load),t=null}if(t){for(;"object"!=typeof t;)if(t=JSON.parse(t),"number"==typeof parseInt(t,10)&&!isNaN(parseInt(t,10))){t=parseInt(t,10);break}t.uniqueId!==o.documentId&&("number"!=typeof parseInt(t,10)||isNaN(parseInt(t,10)))||(o.updateFormFieldName(t),o.pdfViewer.fireAjaxRequestSuccess(this.pdfViewer.serverActionSettings.load,t),!je(t.isTaggedPdf)&&t.isTaggedPdf&&(o.isTaggedPdf=!0),o.requestSuccess(t,i,n))}}else o.showLoadingIndicator(!1),o.openImportExportNotificationPopup(o.pdfViewer.localeObj.getConstant("Import PDF Failed"))},this.loadRequestHandler.onFailure=function(e){var t=e.status.toString().split("")[0];"4"===t?o.openNotificationPopup("Client error"):"5"===t?o.openNotificationPopup("CORS policy error"):o.openNotificationPopup(),o.showLoadingIndicator(!1),o.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,o.pdfViewer.serverActionSettings.load)},this.loadRequestHandler.onError=function(e){o.openNotificationPopup(),o.showLoadingIndicator(!1),o.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,o.pdfViewer.serverActionSettings.load)}},C.prototype.invalidFilePopup=function(){this.showLoadingIndicator(!1),this.openImportExportNotificationPopup(this.pdfViewer.localeObj.getConstant("Import PDF Failed"))},C.prototype.updateFormFieldName=function(e){if(e&&e.PdfRenderedFormFields&&0<e.PdfRenderedFormFields.length)for(var t=void 0,i=0;i<e.PdfRenderedFormFields.length;i++)(t=e.PdfRenderedFormFields[parseInt(i.toString(),10)])&&(t.ActualFieldName&&(t.FieldName=t.ActualFieldName),je(t.Value))&&(t.Value="")},C.prototype.createNotificationPopup=function(e){var t,i=this;this.isMessageBoxOpen||(t=Q("div",{id:this.pdfViewer.element.id+"_notify",className:"e-pv-notification-popup"}),(!je(this.pdfViewer.pageOrganizer)&&this.pdfViewer.pageOrganizer.dialogDivElement?this.pdfViewer.pageOrganizer.dialogDivElement:this.viewerContainer).appendChild(t),this.notifyDialog=new pS({showCloseIcon:!0,closeOnEscape:!1,isModal:!0,header:this.pdfViewer.localeObj.getConstant("PdfViewer"),buttons:[{buttonModel:{content:this.pdfViewer.localeObj.getConstant("OK"),isPrimary:!0},click:this.closeNotification.bind(this)}],content:'<div class="e-pv-notification-popup-content" tabindex = "0">'+e+"</div>",target:this.pdfViewer.element,beforeClose:function(){if(i.notifyDialog.destroy(),i.pdfViewer.pageOrganizerModule&&i.pdfViewer.pageOrganizerModule.showOrganizeLoadingIndicator(!1),i.pdfViewer.element)try{i.pdfViewer.element.removeChild(t)}catch(e){t.parentElement.removeChild(t)}i.pdfViewer.textSearchModule&&(i.pdfViewer.textSearch.isMessagePopupOpened=!1),i.isMessageBoxOpen=!1}}),this.pdfViewer.enableRtl&&(this.notifyDialog.enableRtl=!0),this.notifyDialog.appendTo(t),this.isMessageBoxOpen=!0)},C.prototype.openNotificationPopup=function(e){var t=this;this.pdfViewer.showNotificationDialog&&("Client error"===e?N?this.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_Clienterror").then(function(e){t.createNotificationPopup(e)}):this.createNotificationPopup(this.pdfViewer.localeObj.getConstant("Client error")):"CORS policy error"===e?this.createNotificationPopup(this.pdfViewer.localeObj.getConstant("Cors policy error")):N?this.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_Servererror").then(function(e){t.createNotificationPopup(e)}):this.createNotificationPopup(this.pdfViewer.localeObj.getConstant("Server error")),this.getElement("_notify"))&&this.getElement("_notify").classList.add("e-pv-notification-large-content")},C.prototype.showNotificationPopup=function(e){this.pdfViewer.showNotificationDialog||""===e||(this.createNotificationPopup(e),this.getElement("_notify")&&this.getElement("_notify").classList.add("e-pv-notification-large-content"))},C.prototype.requestSuccess=function(e,t,i){this.clientSideRendering&&(e.isDigitalSignaturePresent&&!je(e.digitialSignatureFile)&&e.digitialSignatureFile&&this.pdfViewer.pdfRenderer.digitialByteArray&&0<this.pdfViewer.pdfRenderer.digitialByteArray.length?(this.pdfViewer.fileByteArray=this.pdfViewer.pdfRenderer.digitialByteArray,this.pdfViewer.pdfRenderer.digitialByteArray=null):je(this.pdfViewer.fileByteArray)&&this.pdfViewer.uploadedFileByteArray?(this.pdfViewer.fileByteArray=this.pdfViewer.uploadedFileByteArray,this.pdfViewer.uploadedFileByteArray=null):this.pdfViewer.fileByteArray||je(this.pdfViewer.toolbarModule)||!this.pdfViewer.toolbarModule.uploadedFile?!this.pdfViewer.fileByteArray&&e.documentData&&(this.pdfViewer.fileByteArray=this.convertBase64(e.documentData)):"string"==typeof this.pdfViewer.toolbarModule.uploadedFile&&(this.pdfViewer.fileByteArray=this.convertBase64(this.pdfViewer.toolbarModule.uploadedFile.replace(/^data:+[a-zA-Z]+\/[a-zA-Z]+;base64,/g,"")))),e&&void 0!==e.pageCount?(N&&this.isPassword&&(this.isPassword=!1,this.isPasswordAvailable=!1,this.pdfViewer._dotnetInstance.invokeMethodAsync("ClosePasswordDialog")),i&&""!==i&&(this.passwordData=i),this.pdfViewer.allowServerDataBinding=!1,this.pageCount=e.pageCount,this.pdfViewer.pageCount=e.pageCount,this.hashId=e.hashId,this.documentLiveCount=e.documentLiveCount,this.isAnnotationCollectionRemoved=!1,this.saveDocumentHashData(),this.saveFormfieldsData(e),this.pdfViewer.allowServerDataBinding=!0,this.clientSideRendering?this.isDigitalSignaturePresent=e.isDigitalSignaturePresent:this.digitalSignaturePages=e.digitalSignaturePages,this.pageRender(e),n={pageCount:e.pageCount,pageSizes:e.pageSizes},C.sessionStorageManager.setItem(this.documentId+"_pagedata",JSON.stringify(n)),F.isDevice&&!this.pdfViewer.enableDesktopMode&&(this.mobileScrollerContainer.style.display="",n=this.pdfViewer.toolbarModule?this.toolbarHeight:0,this.mobileScrollerContainer.style.top=n+"px"),this.restrictionList=e.RestrictionSummary,this.RestrictionEnabled(this.restrictionList,!1)):(this.pageCount=0,this.currentPageNumber=0,F.isDevice&&!this.pdfViewer.enableDesktopMode&&(this.mobileScrollerContainer.style.display="none"),4===e?N||this.renderPasswordPopup(t,i,this.isImportDoc):3!==e||N||this.renderCorruptPopup(this.isImportDoc),this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.updateToolbarItems());var n=this.pdfViewer.annotationModule;n&&n.textMarkupAnnotationModule&&n.textMarkupAnnotationModule.isEnableTextMarkupResizer(n.textMarkupAnnotationModule.currentTextMarkupAddMode)&&n.textMarkupAnnotationModule.createAnnotationSelectElement()},C.prototype.RestrictionEnabled=function(e,t){if(e)for(var i=0;i<e.length;i++)this.EnableRestriction(e[parseInt(i.toString(),10)],t),N?this.pdfViewer.toolbarModule&&this.pdfViewer._dotnetInstance.invokeMethodAsync("RestrictToolbarItems",e,t):this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.DisableToolbarItems(e[parseInt(i.toString(),10)],t)},C.prototype.EnableRestriction=function(e,t){switch(e){case"Print":this.pdfViewer.enablePrint=t;break;case"CopyContent":this.pdfViewer.enableTextSelection=t;break;case"FillFields":this.pdfViewer.enableFormFields=t,this.enableFormFieldButton(t);break;case"EditAnnotations":this.pdfViewer.annotationSettings.isLock=!0}},C.prototype.pageRender=function(e){this.document=null,this.passwordDialogReset(),this.passwordPopup&&this.passwordPopup.hide(),this.initPageDiv(e)},C.prototype.loadPage=function(e){this.currentPageNumber=e+1,this.pdfViewer.currentPageNumber=e+1,this.previousZoomValue=this.pdfViewer.zoomValue;var t,i,n=!1;this.pdfViewer.magnificationModule&&(this.pdfViewer.magnificationModule.isAutoZoom=!0,this.pdfViewer.zoomValue&&0<this.pdfViewer.zoomValue&&(100!==this.pdfViewer.zoomValue&&(n=!0),this.isInitialPageMode=!0,this.pdfViewer.magnification.zoomTo(this.pdfViewer.zoomValue)),"FitToWidth"===this.pdfViewer.zoomMode?(n=this.isInitialPageMode=!0,this.pdfViewer.magnificationModule.fitToWidth()):"FitToPage"===this.pdfViewer.zoomMode&&(n=this.isInitialPageMode=!0,this.pdfViewer.magnificationModule.fitToPage()),this.documentLoaded=!0,this.pdfViewer.magnificationModule.isInitialLoading=!0,this.onWindowResize(),this.documentLoaded=!1,this.pdfViewer.magnificationModule.isInitialLoading=!1),this.isDocumentLoaded=!0,this.clientSideRendering?(!je(i=(t=this).pdfViewer.fileByteArray)&&0<i.length?(this.pdfViewerRunner.addTask({uploadedFile:i,message:"LoadPageCollection",password:this.passwordData,pageIndex:e,isZoomMode:n},yRt.High),i=null):this.renderCorruptPopup(!1),this.pdfViewerRunner.onMessage("PageLoaded,LoadedStampForFormFields,LoadedStamp",function(e){"PageLoaded"===e.data.message?t.initialPagesRendered(e.data.pageIndex,e.data.isZoomMode):"LoadedStampForFormFields"===e.data.message?t.initialPagesRenderedForSign(e.data):"LoadedStamp"===e.data.message&&t.pdfViewer.pdfRendererModule.renderer.initialPagesRendered(e.data)})):this.initialPagesRendered(e,n),this.showLoadingIndicator(!1),N||this.pdfViewer.toolbarModule&&(this.pdfViewer.toolbarModule.uploadedDocumentName=null,this.pdfViewer.toolbarModule.updateCurrentPage(this.currentPageNumber),this.pdfViewer.toolbarModule.updateToolbarItems(),this.pdfViewer.toolbar)&&this.pdfViewer.toolbar.annotationToolbarModule&&this.pdfViewer.toolbar.annotationToolbarModule.enableAnnotationAddTools(!0),F.isDevice&&!this.pdfViewer.enableDesktopMode&&(this.mobileSpanContainer.innerHTML=this.currentPageNumber.toString(),this.mobilecurrentPageContainer.innerHTML=this.currentPageNumber.toString())},C.prototype.initialPagesRenderedForSign=function(e){var t=document.createElement("canvas"),i=e.value,n=e.width,o=e.height,r=e.formFieldName,s=e.formFieldList,e=e.PageIndex,s=JSON.parse(s),a=(t.width=n,t.height=o,t.getContext("2d")),l=a.createImageData(n,o),i=(l.data.set(i),a.putImageData(l,0,0),t.toDataURL()),h=this.removeTrailingNumber(r),a=s.find(function(e){return e.FieldName===h}).LineBounds,l=Math.min(a.Height/this.pdfViewer.formFieldsModule.paddingDifferenceValue,a.Width/this.pdfViewer.formFieldsModule.paddingDifferenceValue),t=a.Height-l,s=a.Width-l,l=Math.min(s/n,t/o),s=n*l,t=o*l,n=a.X+(a.Width-s)/2,o=a.Y+(a.Height-t)/2,d=new aVt,l=(d.LineBounds={X:n,Y:o,Width:s,Height:t},d.Value=i,d.ActualFieldName=null,d.Name="SignatureImage",d.FieldName=r,d.PageIndex=e,this.pdfViewer.formFieldCollections.findIndex(function(e){return("SignatureField"===e.type||"InitialField"===e.type)&&d.FieldName&&d.FieldName.includes(e.name)&&d.FieldName.includes(e.name+"_")})),a=(0<=l&&(this.pdfViewer.formFieldCollections[parseInt(l.toString(),10)].value=d.Value),this.pdfViewer.pdfRendererModule.formFieldsBase.PdfRenderedFormFields.push(d),JSON.stringify(this.pdfViewer.pdfRendererModule.formFieldsBase.PdfRenderedFormFields));this.setItemInSessionStorage(a,"_formfields")},C.prototype.removeTrailingNumber=function(e){return e.replace(/_\d+$/,"")},C.prototype.initialPagesRendered=function(e,t){if(-1===this.renderedPagesList.indexOf(e)&&!t){this.createRequestForRender(e);for(var i=e+1,n=this.pdfViewer.initialRenderPages<=this.pageCount?this.pdfViewer.initialRenderPages>this.pageRenderCount?this.pdfViewer.initialRenderPages:2:this.pageCount,o=1;o<n;o++)this.createRequestForRender(o),i+=1;if(this.pageSize[parseInt(i.toString(),10)])for(var r=this.getPageTop(i),s=this.viewerContainer.clientHeight;r<s&&this.pageSize[parseInt(i.toString(),10)];)this.renderPageElement(i),this.createRequestForRender(i),r=this.getPageTop(i),i+=1}},C.prototype.renderPasswordPopup=function(e,t,i){var n,o,r=this;N?(n=document.getElementById(this.pdfViewer.element.id+"_prompt"),this.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_EnterPassword").then(function(e){n.textContent=e}),(o=document.querySelector("#"+this.pdfViewer.element.id+"_password_input")).addEventListener("keyup",function(){""===o.value&&r.passwordDialogReset()}),o.addEventListener("focus",function(){o.parentElement.classList.add("e-input-focus")}),o.addEventListener("blur",function(){o.parentElement.classList.remove("e-input-focus")}),this.isPasswordAvailable?(this.pdfViewer.fireDocumentLoadFailed(!0,t),n.classList.add("e-pv-password-error"),this.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_InvalidPassword").then(function(e){n.textContent=e}),n.focus(),this.isFileName?this.document=e:this.document="data:application/pdf;base64,"+e):(this.isFileName?this.document=e:this.document="data:application/pdf;base64,"+e,this.isPasswordAvailable=!0,this.pdfViewer.fireDocumentLoadFailed(!0,null)),this.pdfViewer._dotnetInstance.invokeMethodAsync("OpenPasswordDialog")):(this.isPasswordAvailable?(this.pdfViewer.fireDocumentLoadFailed(!0,t),this.promptElement.classList.add("e-pv-password-error"),this.promptElement.textContent=this.pdfViewer.localeObj.getConstant("Invalid Password"),this.promptElement.focus(),this.isFileName||e instanceof Uint8Array?this.document=e:this.document="data:application/pdf;base64,"+e):(this.isFileName||e instanceof Uint8Array?this.document=e:this.document="data:application/pdf;base64,"+e,this.isPasswordAvailable=!0,this.createPasswordPopup(i),this.pdfViewer.fireDocumentLoadFailed(!0,null)),this.passwordPopup.show())},C.prototype.renderCorruptPopup=function(e){this.pdfViewer.fireDocumentLoadFailed(!1,null),this.documentId=null,this.pdfViewer.showNotificationDialog&&(N?this.pdfViewer._dotnetInstance.invokeMethodAsync("OpenCorruptedDialog"):(this.createCorruptedPopup(e),this.corruptPopup.show()))},C.prototype.constructJsonObject=function(e,t,i){t=t?(this.isPasswordAvailable=!0,{document:e,password:this.passwordData=t,isClientsideLoading:i,zoomFactor:"1",isFileName:this.isFileName.toString(),uniqueId:this.documentId,showDigitalSignatureAppearance:this.pdfViewer.showDigitalSignatureAppearance}):(this.isPasswordAvailable=!1,this.passwordData="",{document:e,zoomFactor:"1",isClientsideLoading:i,isFileName:this.isFileName.toString(),uniqueId:this.documentId,hideEmptyDigitalSignatureFields:this.pdfViewer.hideEmptyDigitalSignatureFields,showDigitalSignatureAppearance:this.pdfViewer.showDigitalSignatureAppearance});return t},C.prototype.checkDocumentData=function(e,t){var i;return void 0===t&&(t=!0),void 0!==(i=this.isValidPDFBase64(e)?e:e.split("base64,")[1])&&this.isValidPDFBase64(i)?t&&(this.jsonDocumentId=null):(this.isFileName=!0,this.jsonDocumentId=e,i=(null===this.pdfViewer.fileName&&(e.startsWith("http://")||e.startsWith("https://")||e.endsWith(".pdf"))?this.setDocumentName(e):this.setFileName(),e)),i},C.prototype.setDocumentName=function(e){e=-1!==e.indexOf("\\")?e.split("\\"):e.split("/");this.pdfViewer.fileName=e[e.length-1],this.jsonDocumentId=this.pdfViewer.fileName},C.prototype.setFileName=function(){null===this.pdfViewer.fileName&&(this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.uploadedDocumentName?(this.pdfViewer.fileName=this.pdfViewer.toolbarModule.uploadedDocumentName,this.jsonDocumentId=this.pdfViewer.fileName):(this.pdfViewer.fileName="undefined.pdf",this.jsonDocumentId=null))},C.prototype.saveDocumentInfo=function(){C.sessionStorageManager.getWindowSessionStorageSize()+Math.round(JSON.stringify(this.documentId).length/1024)<5e3?(C.sessionStorageManager.setItem(this.documentId+"_currentDocument",this.documentId),C.sessionStorageManager.setItem(this.documentId+"_serviceURL",this.pdfViewer.serviceUrl),this.pdfViewer.serverActionSettings&&C.sessionStorageManager.setItem(this.documentId+"_unload",this.pdfViewer.serverActionSettings.unload)):(this.sessionStorage.push(this.documentId+"_currentDocument",this.documentId),this.sessionStorage.push(this.documentId+"_serviceURL",this.pdfViewer.serviceUrl),this.pdfViewer.serverActionSettings&&this.sessionStorage.push(this.documentId+"_unload",this.pdfViewer.serverActionSettings.unload))},C.prototype.saveDocumentHashData=function(){var e="",e=F.isIE||"edge"===F.info.name?encodeURI(this.hashId):this.hashId;C.sessionStorageManager.setItem(this.documentId+"_hashId",e),this.documentLiveCount&&C.sessionStorageManager.setItem(this.documentId+"_documentLiveCount",this.documentLiveCount.toString())},C.prototype.saveFormfieldsData=function(e){var t;if(this.clientSideRendering||(t=["ink","SignatureText","SignatureImage"],e.PdfRenderedFormFields=e.PdfRenderedFormFields.filter(function(e){return-1===t.indexOf(e.Name)}).concat(e.PdfRenderedFormFields.filter(function(e){return-1!==t.indexOf(e.Name)}))),this.pdfViewer.isFormFieldDocument=!1,this.enableFormFieldButton(!1),e&&e.PdfRenderedFormFields&&0<e.PdfRenderedFormFields.length){if(this.formfieldvalue)this.pdfViewer.formFieldsModule&&this.setItemInSessionStorage(this.formfieldvalue,"_formfields"),this.formfieldvalue=null;else if(this.pdfViewer.formFieldsModule){for(var i=0;i<e.PdfRenderedFormFields.length;i++)""===e.PdfRenderedFormFields[parseInt(i.toString(),10)].FieldName&&e.PdfRenderedFormFields.splice(i,1);this.setItemInSessionStorage(e.PdfRenderedFormFields,"_formfields")}this.pdfViewer.enableFormFields&&this.pdfViewer.formFieldsModule&&this.pdfViewer.formFieldsModule.formFieldCollections(),0<this.pdfViewer.formFieldCollections.length&&(this.pdfViewer.isFormFieldDocument=!0,this.enableFormFieldButton(!0))}},C.prototype.enableFormFieldButton=function(e){e&&(this.pdfViewer.isFormFieldDocument=!0),this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.submitItem&&this.pdfViewer.toolbarModule.toolbar.enableItems(this.pdfViewer.toolbarModule.submitItem.parentElement,e)},C.prototype.updateWaitingPopup=function(e){var t,i;null!=this.pageSize[parseInt(e.toString(),10)].top&&(t=this.getElement("_pageDiv_"+e).getBoundingClientRect(),i=this.getElement("_pageDiv_"+e).firstChild.firstChild,t.top<0?this.toolbarHeight+this.viewerContainer.clientHeight/2-t.top<t.height?i.style.top=this.getElement("_pageDiv_"+e).clientHeight/2-this.getElement("_pageDiv_"+e).clientTop-this.toolbarHeight+"px":this.toolbarHeight+t.bottom/2-t.top<t.height&&(i.style.top=t.bottom/2-this.getElement("_pageDiv_"+e).clientTop-this.toolbarHeight+"px"):i.style.top=this.getElement("_pageDiv_"+e).clientHeight/2+"px",F.isDevice&&!this.pdfViewer.enableDesktopMode&&t.width>this.viewerContainer.clientWidth?i.style.left=this.getElement("_pageDiv_"+e).clientWidth/2+this.viewerContainer.scrollLeft+"px":(1.25<this.getZoomFactor()&&(t.width,this.viewerContainer.clientWidth),i.style.left=this.getElement("_pageDiv_"+e).clientWidth/2+"px"))},C.prototype.getActivePage=function(e){return this.activeElements&&!je(this.activeElements.activePageID)?e?this.activeElements.activePageID+1:this.activeElements.activePageID:e?this.currentPageNumber:this.currentPageNumber-1},C.prototype.createWaitingPopup=function(e){e=document.getElementById(this.pdfViewer.element.id+"_pageDiv_"+e);e&&(GLt({target:e}),this.setLoaderProperties(e))},C.prototype.showLoadingIndicator=function(e){var t=this.getElement("_loadingIndicator");t&&(e?(t.style.display="block",aRt):(t.style.display="none",hRt))(t)},C.prototype.spinnerPosition=function(e,t){var e=e.querySelector(".e-spinner-inner"),i=this.getZoomFactor(),n=this.pageSize[parseInt(t.toString(),10)].width*i,t=this.pageSize[parseInt(t.toString(),10)].height*i,t=(e.style.top=t/2+"px",e.style.left=n/2+"px",e.children[0]);i<=.2?(t.style.width="20px",t.style.height="20px",t.style.transformOrigin="10px 10px 10px"):i<=.45?(t.style.width="30px",t.style.height="30px",t.style.transformOrigin="15px 15px 15px"):(t.style.width="48px",t.style.height="48px",t.style.transformOrigin="24px 24px 24px")},C.prototype.showPageLoadingIndicator=function(e,t){var i=this.getElement("_pageDiv_"+e);null!=i&&(this.spinnerPosition(i,e),(t?aRt:hRt)(i),je(this.pdfViewer.magnificationModule)||this.pdfViewer.magnificationModule.isWaitingPopupUpdated||this.updateWaitingPopup(e))},C.prototype.showPrintLoadingIndicator=function(e){var t=this.getElement("_printLoadingIndicator");null!=t&&(e?(this.printMainContainer.style.display="block",aRt):(this.printMainContainer.style.display="none",hRt))(t)},C.prototype.setLoaderProperties=function(e){e=e.firstChild.firstChild.firstChild;e&&(e.style.height="48px",e.style.width="48px",e.style.transformOrigin="24px 24px 24px")},C.prototype.updateScrollTop=function(t,e){var i=this;if(null!=this.pageSize[parseInt(t.toString(),10)]){this.renderElementsVirtualScroll(t),je(e)&&(this.viewerContainer.scrollTop=this.getPageTop(t)),-1===this.renderedPagesList.indexOf(t)&&this.createRequestForRender(t);var n=t+1;if(n<this.pdfViewer.pageCount&&-1===this.renderedPagesList.indexOf(n)&&this.createRequestForRender(n),this.pageSize[parseInt(n.toString(),10)])for(var o=this.getPageTop(n),r=this.viewerContainer.clientHeight+this.getPageTop(n-1);o<r&&this.pageSize[parseInt(n.toString(),10)];)this.renderPageElement(n),-1===this.renderedPagesList.indexOf(n)&&this.createRequestForRender(n),o=this.getPageTop(n),n+=1;setTimeout(function(){var e=t+1;e!==i.currentPageNumber&&(i.pdfViewer.currentPageNumber=e,i.currentPageNumber=e,i.pdfViewer.toolbarModule)&&i.pdfViewer.toolbarModule.updateCurrentPage(e)},100)}},C.prototype.getZoomFactor=function(){return this.pdfViewer.magnificationModule?this.pdfViewer.magnificationModule.zoomFactor:1},C.prototype.getCustomZoomValues=function(){this.pdfViewer.magnificationModule&&(this.pdfViewer.magnificationModule.isInitialCustomZoomValues=!1);var e,t,i=this.pdfViewer.minZoom,n=this.pdfViewer.maxZoom,o=[],r=[10,25,50,75,100,125,150,200,400];if(null!=i&&null!=n&&n<i&&(e=n,n=i,i=e),null!=i||null!=n){var s=0;null==i||o.some(function(e){return parseInt(e.id,10)===i})||(o.push({percent:i+"%",id:s.toString()}),this.customZoomValues.push(i),s++);for(var a=0;a<r.length;a++){var l=r[parseInt(a.toString(),10)];t=l,(null==i||i<=t)&&(null==n||t<=n)&&l!==i&&l!==n&&(o.push({percent:l+"%",id:s.toString()}),this.customZoomValues.push(l),s++)}null==n||o.some(function(e){return parseInt(e.id,10)===n})||n===i||(o.push({percent:n+"%",id:s.toString()}),this.customZoomValues.push(n),s++),o.sort(function(e,t){return parseInt(e.id,10)-parseInt(t.id,10)}),this.customZoomValues.sort(function(e,t){return parseInt(e.id,10)-parseInt(t.id,10)})}},C.prototype.getPinchZoomed=function(){return!!this.pdfViewer.magnificationModule&&this.pdfViewer.magnificationModule.isPinchZoomed},C.prototype.getMagnified=function(){return!!this.pdfViewer.magnificationModule&&this.pdfViewer.magnificationModule.isMagnified},C.prototype.getPinchScrolled=function(){return!!this.pdfViewer.magnificationModule&&this.pdfViewer.magnificationModule.isPinchScrolled},C.prototype.getPagesPinchZoomed=function(){return!!this.pdfViewer.magnificationModule&&this.pdfViewer.magnificationModule.isPagePinchZoomed},C.prototype.getPagesZoomed=function(){return!!this.pdfViewer.magnificationModule&&this.pdfViewer.magnificationModule.isPagesZoomed},C.prototype.getRerenderCanvasCreated=function(){return!!this.pdfViewer.magnificationModule&&this.pdfViewer.magnificationModule.isRerenderCanvasCreated},C.prototype.getDocumentId=function(){return this.documentId},C.prototype.download=function(){0<this.pageCount&&this.createRequestForDownload()},C.prototype.saveAsBlob=function(){var i=this;return 0<this.pageCount?new Promise(function(t,e){i.saveAsBlobRequest().then(function(e){t(e)})}):null},C.prototype.fireCustomCommands=function(e){var t,i=this.pdfViewer.commandManager,n=i.keyboardCommand.map(function(e){return{name:e.name,gesture:{pdfKeys:e.gesture.pdfKeys,modifierKeys:e.gesture.modifierKeys}}}),n=JSON.stringify(n);0!==Object.keys(i).length&&(i=JSON.parse(n),null!=(n=this.getModifiers(e)))&&e.keyCode&&(t={name:"",gesture:{pdfKeys:e.keyCode,modifierKeys:n}},null!=(e=i.find(function(e){return e.gesture&&e.gesture.pdfKeys===t.gesture.pdfKeys&&e.gesture.modifierKeys===t.gesture.modifierKeys})))&&(t.name=e.name,t.gesture.modifierKeys=e.gesture.modifierKeys,t.gesture.pdfKeys=e.gesture.pdfKeys,this.pdfViewer.fireKeyboardCustomCommands(t))},C.prototype.getModifiers=function(e){var t=!!navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i)&&e.metaKey,i=0;return(e.ctrlKey||t)&&(i|=1),e.altKey&&(i|=2),e.shiftKey&&(i|=4),e.metaKey&&(i|=8),i},C.prototype.saveAsBlobRequest=function(){var o=this,r=this;return new Promise(function(t,e){var i,n=r.constructJsonDownload();(r.clientSideRendering?r.isDigitalSignaturePresent:r.digitalSignaturePages&&0!==r.digitalSignaturePages.length)&&(r.pdfViewer.isDocumentEdited?n.digitalSignatureDocumentEdited=!0:n.digitalSignatureDocumentEdited=!1),r.pdfViewer.isDocumentEdited||!je(r.pdfViewer.pageOrganizer)&&r.pdfViewer.pageOrganizer.isDocumentModified?n.isPdfEdited=!0:n.isPdfEdited=!1,je(o.pdfViewer.pageOrganizer)||je(o.pdfViewer.pageOrganizer.organizePagesCollection)||!o.pdfViewer.pageOrganizer.isDocumentModified||(n.organizePages=JSON.stringify(o.pdfViewer.pageOrganizer.organizePagesCollection)),o.dowonloadRequestHandler=new DRt(o.pdfViewer),o.dowonloadRequestHandler.url=r.pdfViewer.serviceUrl+"/"+r.pdfViewer.serverActionSettings.download,o.dowonloadRequestHandler.responseType="text",o.validateForm&&o.pdfViewer.enableFormFieldsValidation?(o.pdfViewer.fireValidatedFailed(r.pdfViewer.serverActionSettings.download),o.validateForm=!1):o.clientSideRendering?(i=o.pdfViewer.pdfRendererModule.getDocumentAsBase64(n),i=r.saveAsBlobFile(i,r),t(i)):o.dowonloadRequestHandler.send(n),o.dowonloadRequestHandler.onSuccess=function(e){e=e.data,e=r.saveAsBlobFile(e,r);t(e)},o.dowonloadRequestHandler.onFailure=function(e){r.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,r.pdfViewer.serverActionSettings.download)},o.dowonloadRequestHandler.onError=function(e){r.openNotificationPopup(),r.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,r.pdfViewer.serverActionSettings.download)}})},C.prototype.saveAsBlobFile=function(t,i){return this.clientSideRendering?new Promise(function(e){t&&("object"!=typeof t&&(i.onControlError(500,t,i.pdfViewer.serverActionSettings.download),t=null),t)&&(i.clientSideRendering||i.pdfViewer.fireAjaxRequestSuccess(i.pdfViewer.serverActionSettings.download,t),e(new Blob([t],{type:"application/pdf"})))}):new Promise(function(e){t&&("object"!=typeof(t="object"==typeof t?JSON.parse(t):t)&&-1===t.indexOf("data:application/pdf")&&(i.onControlError(500,t,i.pdfViewer.serverActionSettings.download),t=null),t)&&(i.clientSideRendering||i.pdfViewer.fireAjaxRequestSuccess(i.pdfViewer.serverActionSettings.download,t),e(i.createBlobUrl(t.split("base64,")[1],"application/pdf")))})},C.prototype.clear=function(e){var t=this,i=t.pdfViewer,n=i.printModule,o=i.textSearchModule,r=i.bookmarkViewModule,s=i.thumbnailView,a=i.annotation,l=i.magnificationModule,h=i.textSelectionModule,d=i.formFieldsModule,p=t.signatureModule,c=i.pageOrganizer;if(t.isPasswordAvailable=!1,t.isDocumentLoaded=!1,t.isInitialLoaded=!1,t.isImportAction=!1,t.navigationPane.isThumbnailAddedProgrammatically=!1,t.navigationPane.isThumbnail=!1,t.annotationPageList=[],t.annotationComments=null,i.annotationCollection=[],i.signatureCollection=[],i.formFieldCollection=[],i.customContextMenuItems=[],t.isAnnotationCollectionRemoved=!1,t.documentAnnotationCollections=null,t.isDrawnCompletely=!1,t.annotationRenderredList=[],t.isImportAction=!1,t.isImportedAnnotation=!1,t.importedAnnotation=[],t.isStorageExceed=!1,t.annotationStorage={},t.formFieldStorage={},t.downloadCollections={},t.annotationEvent=null,t.highestWidth=0,t.highestHeight=0,t.requestLists=[],t.tilerequestLists=[],t.isToolbarInkClicked=!1,i.formFieldCollections=[],t.passwordData="",t.isFocusField=!1,t.focusField=[],t.modifiedPageIndex=[],t.isInkAnnot=!1,t.updateDocumentEditedProperty(!1),i.clipboardData.clipObject={},i.pdfRendererModule&&t.clientSideRendering&&(t.pdfViewer.pdfRendererModule.pageRotationCollection=[]),i.toolbar&&(i.toolbar.uploadedFile=null),t.isTaggedPdf=!1,i.formDesignerModule&&(i.formDesignerModule.formFieldIndex=0,t.activeElements&&i.clearSelection(t.activeElements.activePageID),i.zIndexTable=[]),t.initiateTextSelectMode(),t.RestrictionEnabled(t.restrictionList,!0),t.restrictionList=null,F.isDevice&&!i.enableDesktopMode||t.navigationPane.sideBarToolbar&&t.navigationPane.clear(),(N||!F.isDevice)&&i.enableDesktopMode||t.navigationPane.clear(),s&&s.clear(),r&&r.clear(),l&&(l.isMagnified=!1,l.isFormFieldPageZoomed=!1,l.clearIntervalTimer()),h&&h.clearTextSelection(),o&&o.resetTextSearch(!0),a&&(a.clear(),a.initializeCollection()),d&&(d.readOnlyCollection=[],d.signatureFieldCollection=[],d.renderedPageList=[],d.currentTarget=null),p&&(p.signAnnotationIndex=[]),c&&c.clear(),t.pageSize&&(t.pageSize=[]),t.renderedPagesList&&(t.renderedPagesList=[]),t.accessibilityTagsCollection&&(t.accessibilityTagsCollection=[]),t.pageRequestListForAccessibilityTags&&(t.pageRequestListForAccessibilityTags=[]),t.pageContainer)for(;t.pageContainer.hasChildNodes();)t.pageContainer.removeChild(t.pageContainer.lastChild);if(0<t.pageCount){if(t.unloadDocument(t),t.textLayer.characterBound=[],t.loadRequestHandler&&t.loadRequestHandler.clear(),t.requestCollection){for(var u=0;u<t.requestCollection.length;u++)t.requestCollection[parseInt(u.toString(),10)].clear();t.requestCollection=[]}t.virtualLoadRequestHandler&&t.virtualLoadRequestHandler.clear(),t.pageRequestHandler&&t.pageRequestHandler.clear(),t.dowonloadRequestHandler&&t.dowonloadRequestHandler.clear(),t.importAnnotationRequestHandler&&t.importAnnotationRequestHandler.clear(),t.exportAnnotationRequestHandler&&t.exportAnnotationRequestHandler.clear(),t.importFormFieldsRequestHandler&&t.importFormFieldsRequestHandler.clear(),t.exportFormFieldsRequestHandler&&t.exportFormFieldsRequestHandler.clear(),n&&n.printRequestHandler&&n.printRequestHandler.clear()}t.windowSessionStorageClear(),C.sessionStorageManager.clear(),t.pinchZoomStorage&&(t.pinchZoomStorage=[]),!t.previousZoomValue&&0!==t.previousZoomValue||t.previousZoomValue===i.zoomValue||(i.zoomValue=t.previousZoomValue),e&&0<t.pageCount&&i.fireDocumentUnload(this.pdfViewer.fileName),this.pdfViewer.fileName=null,window.customStampCollection instanceof Map&&window.customStampCollection.clear()},C.prototype.destroy=function(){var e;F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.pdfViewer.element.classList.remove("e-pv-mobile-view"),this.unWireEvents(),this.clear(!1),this.pageContainer&&this.pageContainer.parentNode&&this.pageContainer.parentNode.removeChild(this.pageContainer),this.viewerContainer&&this.viewerContainer.parentNode&&this.viewerContainer.parentNode.removeChild(this.viewerContainer),this.contextMenuModule&&(e=this.contextMenuModule.contextMenuElement)&&e.ej2_instances&&0<e.ej2_instances.length&&this.contextMenuModule.destroy(),this.pdfViewer.toolbarModule&&this.navigationPane.destroy(),document.getElementById("measureElement")},C.prototype.unloadDocument=function(e){if(!this.clientSideRendering){var t="",i=C.sessionStorageManager.getItem(this.documentId+"_hashId"),n=C.sessionStorageManager.getItem(this.documentId+"_documentLiveCount"),o=C.sessionStorageManager.getItem(this.documentId+"_serviceURL");if(null!==(t=F.isIE||"edge"===F.info.name?decodeURI(i):e.hashId||i)){var r,s,i={hashId:t,documentLiveCount:n,action:"Unload",elementId:e.pdfViewer.element.id},t=C.sessionStorageManager.getItem(this.documentId+"_unload");if("undefined"===o||"null"===o||""===o||je(o))N&&this.clearCache(t,i,e);else try{"keepalive"in new Request("")&&(r=this.setUnloadRequestHeaders(),s=this.pdfViewer.ajaxRequestSettings.withCredentials?"include":"omit",fetch(o+"/"+t,{method:"POST",credentials:s,headers:r,body:JSON.stringify(i)}))}catch(e){this.unloadRequestHandler=new DRt(this.pdfViewer),this.unloadRequestHandler.send(i)}}}this.pdfViewer.magnificationModule&&(this.pdfViewer.magnificationModule.zoomFactor=1),this.formFieldCollection=[],this.textrequestLists=[],!e.pdfViewer.textSearchModule||F.isDevice&&!this.pdfViewer.enableDesktopMode||(this.pdfViewer.textSearchModule.showSearchBox(!1),this.pdfViewer.textSearchModule.isDocumentTextCollectionReady=!1),C.sessionStorageManager.clear()},C.prototype.clearCache=function(t,e,i){this.unloadRequestHandler=new DRt(this.pdfViewer),this.unloadRequestHandler.url=C.sessionStorageManager.getItem(this.documentId+"_serviceURL")+"/"+t,this.unloadRequestHandler.mode=!1,this.unloadRequestHandler.responseType=null,this.unloadRequestHandler.send(e),this.unloadRequestHandler.onSuccess=function(e){e=e.data;e&&("object"!=typeof e&&-1===e.indexOf("Document")&&(i.onControlError(500,e,t),e=null),e)&&i.pdfViewer.fireAjaxRequestSuccess(i.pdfViewer.serverActionSettings.unload,e)},this.unloadRequestHandler.onFailure=function(e){i.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,t)},this.unloadRequestHandler.onError=function(e){i.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,t)}},C.prototype.setUnloadRequestHeaders=function(){var e=new Headers;if(e.append("Content-Type","application/json;charset=UTF-8"),!je(this.pdfViewer.ajaxRequestSettings)&&!je(this.pdfViewer.ajaxRequestSettings.ajaxHeaders))for(var t=0;t<this.pdfViewer.ajaxRequestSettings.ajaxHeaders.length;t++)e.append(this.pdfViewer.ajaxRequestSettings.ajaxHeaders[parseInt(t.toString(),10)].headerName,this.pdfViewer.ajaxRequestSettings.ajaxHeaders[parseInt(t.toString(),10)].headerValue);return e},C.prototype.windowSessionStorageClear=function(){C.sessionStorageManager.removeItem(this.documentId+"_currentDocument"),C.sessionStorageManager.removeItem(this.documentId+"_serviceURL"),C.sessionStorageManager.removeItem(this.documentId+"_unload");for(var e=0;e<this.sessionStorage.length;e++)C.sessionStorageManager.removeItem(this.sessionStorage[parseInt(e.toString(),10)])},C.prototype.updateCommentPanel=function(){for(var e=document.querySelectorAll(".e-pv-more-options-button"),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].style.visibility="hidden";for(var i=document.querySelectorAll(".e-pv-new-comments-div"),n=0;n<i.length;n++)i[parseInt(n.toString(),10)].style.display="none";for(var o=document.querySelectorAll(".e-pv-comments-border"),n=0;n<o.length;n++)o[parseInt(n.toString(),10)].classList.remove("e-pv-comments-border");for(var r=document.querySelectorAll(".e-editable-inline"),n=0;n<r.length;n++)r[parseInt(n.toString(),10)].style.display="none";for(var s=document.querySelectorAll(".e-pv-comments-select"),a=0;a<s.length;a++)s[parseInt(a.toString(),10)].classList.remove("e-pv-comments-select");for(var l=document.querySelectorAll(".e-pv-comments-div"),n=0;n<l.length;n++)l[parseInt(n.toString(),10)].style.minHeight="60px"},C.prototype.focusViewerContainer=function(e){var t=window.scrollX,i=window.scrollY,n=this.getScrollParent(this.viewerContainer),o=0,r=0;null!==n&&(o=n.scrollLeft,r=n.scrollTop),this.isgetFocused||this.viewerContainer.focus(),this.isgetFocused=!1,this.pdfViewer.annotation&&this.pdfViewer.annotation.stickyNotesAnnotationModule.accordionContainer&&this.updateCommentPanel(),(-1!==navigator.userAgent.indexOf("MSIE")||-1<navigator.appVersion.indexOf("Trident/")||-1!==navigator.userAgent.indexOf("Edge"))&&null!==n?(n.scrollLeft=o,n.scrollTop=r):null!==n&&n.scrollTo(o,r),window.scrollTo(t,i)},C.prototype.getScrollParent=function(e){var t;return null===e||"HTML"===e.nodeName?null:(t=getComputedStyle(e),this.viewerContainer.id===e.id||"scroll"!==t.overflowY&&"auto"!==t.overflowY?this.getScrollParent(e.parentNode):e)},C.prototype.createCorruptedPopup=function(t){var i=this,e=Q("div",{id:this.pdfViewer.element.id+"_corrupted_popup",className:"e-pv-corrupted-popup"});(t?this.pdfViewer.pageOrganizerModule.dialogDivElement:this.pageContainer).appendChild(e),this.corruptPopup=new pS({showCloseIcon:!0,closeOnEscape:!0,isModal:!0,header:'<div class="e-pv-corrupted-popup-header"> '+this.pdfViewer.localeObj.getConstant("File Corrupted")+"</div>",visible:!1,buttons:[{buttonModel:{content:this.pdfViewer.localeObj.getConstant("OK"),isPrimary:!0},click:this.closeCorruptPopup.bind(this)}],target:this.pdfViewer.element,beforeClose:function(){i.corruptPopup.destroy(),i.getElement("_corrupted_popup").remove(),i.corruptPopup=null;var e=i.getElement("_loadingIndicator");t&&null!=i.pdfViewer.pageOrganizerModule.waitingPopup?hRt(i.pdfViewer.pageOrganizerModule.waitingPopup):null!=e&&hRt(e)}}),this.pdfViewer.enableRtl?(this.corruptPopup.content='<div id="e-pv-corrupted-templatertl" class="e-pv-notification-icon-rtl"> <div class="e-pv-corrupted-popup-content-rtl" tabindex="0">'+this.pdfViewer.localeObj.getConstant("File Corrupted Content")+"</div></div>",this.corruptPopup.enableRtl=!0):this.corruptPopup.content='<div id="e-pv-corrupted-template" class="e-pv-notification-icon"> <div class="e-pv-corrupted-popup-content" tabindex="0">'+this.pdfViewer.localeObj.getConstant("File Corrupted Content")+"</div></div>",this.corruptPopup.appendTo(e)},C.prototype.hideLoadingIndicator=function(){var e=this.getElement("_loadingIndicator");null!==e&&hRt(e)},C.prototype.closeCorruptPopup=function(){this.corruptPopup.hide();var e=this.getElement("_loadingIndicator");this.isImportDoc&&null!=this.pdfViewer.pageOrganizerModule.waitingPopup?hRt(this.pdfViewer.pageOrganizerModule.waitingPopup):null!=e&&hRt(e)},C.prototype.createPrintPopup=function(){var e=document.getElementById(this.pdfViewer.element.id),e=(this.printMainContainer=Q("div",{id:this.pdfViewer.element.id+"_printcontainer",className:"e-pv-print-popup-container"}),e.appendChild(this.printMainContainer),this.printMainContainer.style.display="none",Q("div",{id:this.pdfViewer.element.id+"_printLoadingIndicator",className:"e-pv-print-loading-container"}));this.printMainContainer.appendChild(e),GLt({target:e,cssClass:"e-spin-center"}),this.setLoaderProperties(e)},C.prototype.createGoToPagePopup=function(){var t=this,e=Q("div",{id:this.pdfViewer.element.id+"_goTopage_popup",className:"e-pv-gotopage-popup"}),i=(this.goToPageElement=Q("span",{id:this.pdfViewer.element.id+"_prompt"}),this.goToPageElement.textContent=this.pdfViewer.localeObj.getConstant("Enter pagenumber"),e.appendChild(this.goToPageElement),Q("span",{className:"e-pv-text-input"}));this.goToPageInput=Q("input",{id:this.pdfViewer.element.id+"_page_input",className:"e-input"}),this.goToPageInput.type="text",this.goToPageInput.style.maxWidth="80%",this.pageNoContainer=Q("span",{className:".e-pv-number-ofpages"}),i.appendChild(this.goToPageInput),i.appendChild(this.pageNoContainer),e.appendChild(i),this.pageContainer.appendChild(e),this.goToPagePopup=new pS({showCloseIcon:!0,closeOnEscape:!1,isModal:!0,header:this.pdfViewer.localeObj.getConstant("GoToPage"),visible:!1,buttons:[{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Cancel")},click:this.GoToPageCancelClick.bind(this)},{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Apply"),disabled:!0,cssClass:"e-pv-gotopage-apply-btn",isPrimary:!0},click:this.GoToPageApplyClick.bind(this)}],close:this.closeGoToPagePopUp.bind(this)}),this.pdfViewer.enableRtl&&(this.goToPagePopup.enableRtl=!0),this.goToPagePopup.appendTo(e),N||new NL({format:"##",showSpinButton:!1}).appendTo(this.goToPageInput),this.goToPageInput.addEventListener("keyup",function(){var e=t.goToPageInput.value;""!==e&&0<parseFloat(e)&&t.pdfViewer.pageCount+1>parseFloat(e)?t.EnableApplyButton():t.DisableApplyButton()})},C.prototype.closeGoToPagePopUp=function(){this.goToPageInput.value="",this.DisableApplyButton()},C.prototype.EnableApplyButton=function(){document.getElementsByClassName("e-pv-gotopage-apply-btn")[0].removeAttribute("disabled")},C.prototype.DisableApplyButton=function(){document.getElementsByClassName("e-pv-gotopage-apply-btn")[0].setAttribute("disabled",!0)},C.prototype.GoToPageCancelClick=function(){this.goToPagePopup.hide()},C.prototype.GoToPageApplyClick=function(){this.goToPagePopup.hide();var e=this.goToPageInput.value;this.pdfViewer.navigation.goToPage(e),this.updateMobileScrollerPosition()},C.prototype.updateMobileScrollerPosition=function(){var e,t;F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.mobileScrollerContainer&&(e=(this.viewerContainer.scrollHeight-this.viewerContainer.clientHeight)/(this.viewerContainer.clientHeight-56),e=this.viewerContainer.scrollTop/e,t=this.pdfViewer.toolbarModule?this.toolbarHeight:0,this.mobileScrollerContainer.style.top=t+e+"px")},C.prototype.createPasswordPopup=function(t){var i=this,e=Q("div",{id:this.pdfViewer.element.id+"_password_popup",className:"e-pv-password-popup",attrs:{tabindex:"-1"}}),n=(this.promptElement=Q("span",{id:this.pdfViewer.element.id+"_prompt",attrs:{tabindex:"-1"}}),this.promptElement.textContent=this.pdfViewer.localeObj.getConstant("Enter Password"),e.appendChild(this.promptElement),Q("span",{className:"e-input-group e-pv-password-input"}));this.passwordInput=Q("input",{id:this.pdfViewer.element.id+"_password_input",className:"e-input"}),this.passwordInput.type="password",this.passwordInput.name="Required",n.appendChild(this.passwordInput),e.appendChild(n),(t?this.pdfViewer.pageOrganizerModule.dialogDivElement:this.pageContainer).appendChild(e),this.passwordPopup=new pS({showCloseIcon:!0,closeOnEscape:!1,isModal:!0,header:this.pdfViewer.localeObj.getConstant("Password Protected"),visible:!1,close:this.passwordCancel.bind(this),target:this.pdfViewer.element,beforeClose:function(){i.passwordPopup.destroy(),i.getElement("_password_popup").remove(),i.passwordPopup=null;var e=i.getElement("_loadingIndicator");t&&null!=i.pdfViewer.pageOrganizerModule.waitingPopup?hRt(i.pdfViewer.pageOrganizerModule.waitingPopup):null!=e&&hRt(e)}}),!F.isDevice||this.pdfViewer.enableDesktopMode?this.passwordPopup.buttons=[{buttonModel:{content:this.pdfViewer.localeObj.getConstant("OK"),isPrimary:!0},click:this.applyPassword.bind(this)},{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Cancel")},click:this.passwordCancelClick.bind(this)}]:this.passwordPopup.buttons=[{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Cancel")},click:this.passwordCancelClick.bind(this)},{buttonModel:{content:this.pdfViewer.localeObj.getConstant("OK"),isPrimary:!0},click:this.applyPassword.bind(this)}],this.pdfViewer.enableRtl&&(this.passwordPopup.enableRtl=!0),this.passwordPopup.appendTo(e),this.passwordInput.addEventListener("keyup",function(){""===i.passwordInput.value&&i.passwordDialogReset()}),this.passwordInput.addEventListener("focus",function(){i.passwordInput.parentElement.classList.add("e-input-focus")}),this.passwordInput.addEventListener("blur",function(){i.passwordInput.parentElement.classList.remove("e-input-focus")})},C.prototype.passwordCancel=function(e){e.isInteraction&&(this.isImportDoc||this.pdfViewer.pageOrganizerModule||this.clear(!1),this.passwordDialogReset(),this.passwordInput.value="");e=this.getElement("_loadingIndicator");this.isImportDoc&&null!=this.pdfViewer.pageOrganizerModule.waitingPopup?hRt(this.pdfViewer.pageOrganizerModule.waitingPopup):null!==e&&hRt(e)},C.prototype.passwordCancelClick=function(){this.isImportDoc||this.pdfViewer.pageOrganizerModule||this.clear(!1),this.passwordDialogReset(),this.passwordPopup.hide();var e=this.getElement("_loadingIndicator");this.isImportDoc&&null!=this.pdfViewer.pageOrganizerModule.waitingPopup?hRt(this.pdfViewer.pageOrganizerModule.waitingPopup):null!==e&&hRt(e)},C.prototype.passwordDialogReset=function(){N||this.promptElement&&(this.promptElement.classList.remove("e-pv-password-error"),this.promptElement.textContent=this.pdfViewer.localeObj.getConstant("Enter Password"),this.passwordInput.value="")},C.prototype.applyPassword=function(){var e;N||!je(e=this.passwordInput.value)&&0<e.length&&(this.isImportDoc&&this.pdfViewer.pageOrganizerModule?this.pdfViewer.pageOrganizerModule.loadImportDoc(this.pdfViewer.pageOrganizerModule.importedDocumentData,e,!0):(this.pdfViewer.load(this.document,e),this.focusViewerContainer()))},C.prototype.createFileInputElement=function(){this.pdfViewer.enableAnnotationToolbar&&this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule.createCustomStampElement(),this.signatureModule&&this.signatureModule.createSignatureFileElement()},C.prototype.wireEvents=function(){var e=this;this.isDeviceiOS=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,this.isMacSafari=-1<navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome")&&!this.isDeviceiOS,this.isWebkitMobile=/Chrome/.test(navigator.userAgent)||/Google Inc/.test(navigator.vendor)||-1!==navigator.userAgent.indexOf("Safari")||-1!==navigator.userAgent.indexOf("WebKit"),this.viewerContainer.addEventListener("scroll",this.viewerContainerOnScroll,!0),F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.viewerContainer.addEventListener("touchmove",this.viewerContainerOnScroll,!0),this.viewerContainer.addEventListener("mousedown",this.viewerContainerOnMousedown),this.viewerContainer.addEventListener("mouseup",this.viewerContainerOnMouseup),this.viewerContainer.addEventListener("wheel",this.detectTouchPad,!1),this.viewerContainer.addEventListener("wheel",this.viewerContainerOnMouseWheel),this.isMacSafari&&(window.addEventListener("gesturestart",function(e){return e.preventDefault()}),window.addEventListener("gesturechange",function(e){return e.preventDefault()}),window.addEventListener("gestureend",function(e){return e.preventDefault()}),this.viewerContainer.addEventListener("gesturestart",this.handleMacGestureStart,!1),this.viewerContainer.addEventListener("gesturechange",this.handleMacGestureChange,!1),this.viewerContainer.addEventListener("gestureend",this.handleMacGestureEnd,!1)),this.viewerContainer.addEventListener("mousemove",this.viewerContainerOnMousemove),this.viewerContainer.addEventListener("mouseleave",this.viewerContainerOnMouseLeave),this.viewerContainer.addEventListener("mouseenter",this.viewerContainerOnMouseEnter),this.viewerContainer.addEventListener("mouseover",this.viewerContainerOnMouseOver),this.viewerContainer.addEventListener("click",this.viewerContainerOnClick),this.viewerContainer.addEventListener("dblclick",this.viewerContainerOnClick),this.viewerContainer.addEventListener("dragstart",this.viewerContainerOnDragStart),this.pdfViewer.element.addEventListener("keydown",this.viewerContainerOnKeyDown),window.addEventListener("keydown",this.onWindowKeyDown),window.addEventListener("mouseup",this.onWindowMouseUp),window.addEventListener("touchend",this.onWindowTouchEnd),this.unload=function(){null!==e.pdfViewerRunner&&void 0!==e.pdfViewerRunner&&e.pdfViewerRunner.terminate()},this.unloadDocument(this),window.addEventListener("unload",this.unload),window.addEventListener("beforeunload",this.clearSessionStorage),window.addEventListener("resize",this.onWindowResize),-1!==navigator.userAgent.indexOf("MSIE")||-1!==navigator.userAgent.indexOf("Edge")||-1!==navigator.userAgent.indexOf("Trident")?(this.viewerContainer.addEventListener("pointerdown",this.viewerContainerOnPointerDown),this.viewerContainer.addEventListener("pointermove",this.viewerContainerOnPointerMove),this.viewerContainer.addEventListener("pointerup",this.viewerContainerOnPointerEnd),this.viewerContainer.addEventListener("pointerleave",this.viewerContainerOnPointerEnd)):(this.viewerContainer.addEventListener("touchstart",this.viewerContainerOnTouchStart),this.isWebkitMobile&&this.isDeviceiOS&&this.viewerContainer.addEventListener("touchmove",function(e){je(e.scale)||1===e.scale||e.preventDefault()},{passive:!1}),this.viewerContainer.addEventListener("touchmove",this.viewerContainerOnTouchMove),this.viewerContainer.addEventListener("touchend",this.viewerContainerOnTouchEnd),this.viewerContainer.addEventListener("touchleave",this.viewerContainerOnTouchEnd),this.viewerContainer.addEventListener("touchcancel",this.viewerContainerOnTouchEnd))},C.prototype.unWireEvents=function(){this.viewerContainer&&(this.viewerContainer.removeEventListener("scroll",this.viewerContainerOnScroll,!0),F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.viewerContainer.removeEventListener("touchmove",this.viewerContainerOnScroll,!0),this.viewerContainer.removeEventListener("mousedown",this.viewerContainerOnMousedown),this.viewerContainer.removeEventListener("mouseup",this.viewerContainerOnMouseup),this.viewerContainer.removeEventListener("wheel",this.detectTouchPad,!1),this.viewerContainer.removeEventListener("wheel",this.viewerContainerOnMouseWheel),this.isMacSafari&&(window.removeEventListener("gesturestart",function(e){return e.preventDefault()}),window.removeEventListener("gesturechange",function(e){return e.preventDefault()}),window.removeEventListener("gestureend",function(e){return e.preventDefault()}),this.viewerContainer.removeEventListener("gesturestart",this.handleMacGestureStart,!1),this.viewerContainer.removeEventListener("gesturechange",this.handleMacGestureChange,!1),this.viewerContainer.removeEventListener("gestureend",this.handleMacGestureEnd,!1)),this.viewerContainer.removeEventListener("mousemove",this.viewerContainerOnMousemove),this.viewerContainer.removeEventListener("mouseleave",this.viewerContainerOnMouseLeave),this.viewerContainer.removeEventListener("mouseenter",this.viewerContainerOnMouseEnter),this.viewerContainer.removeEventListener("mouseover",this.viewerContainerOnMouseOver),this.viewerContainer.removeEventListener("click",this.viewerContainerOnClick),this.viewerContainer.removeEventListener("dragstart",this.viewerContainerOnDragStart),this.viewerContainer.removeEventListener("contextmenu",this.viewerContainerOnContextMenuClick),this.pdfViewer.element.removeEventListener("keydown",this.viewerContainerOnKeyDown),window.addEventListener("keydown",this.onWindowKeyDown),window.removeEventListener("mouseup",this.onWindowMouseUp),window.removeEventListener("unload",this.unload),window.removeEventListener("resize",this.onWindowResize),-1!==navigator.userAgent.indexOf("MSIE")||-1!==navigator.userAgent.indexOf("Edge")||-1!==navigator.userAgent.indexOf("Trident")?(this.viewerContainer.removeEventListener("pointerdown",this.viewerContainerOnPointerDown),this.viewerContainer.removeEventListener("pointermove",this.viewerContainerOnPointerMove),this.viewerContainer.removeEventListener("pointerup",this.viewerContainerOnPointerEnd),this.viewerContainer.removeEventListener("pointerleave",this.viewerContainerOnPointerEnd)):(this.viewerContainer.removeEventListener("touchstart",this.viewerContainerOnTouchStart),this.isWebkitMobile&&this.isDeviceiOS&&this.viewerContainer.removeEventListener("touchmove",function(e){je(e.scale)||1===e.scale||e.preventDefault()},!1),this.viewerContainer.removeEventListener("touchmove",this.viewerContainerOnTouchMove),this.viewerContainer.removeEventListener("touchend",this.viewerContainerOnTouchEnd),this.viewerContainer.removeEventListener("touchleave",this.viewerContainerOnTouchEnd),this.viewerContainer.removeEventListener("touchcancel",this.viewerContainerOnTouchEnd)))},C.prototype.updateZoomValue=function(){this.pdfViewer.magnificationModule&&(this.pdfViewer.magnificationModule.isAutoZoom?this.pdfViewer.magnificationModule.fitToAuto():"FitToWidth"!==this.pdfViewer.zoomMode&&"fitToWidth"===this.pdfViewer.magnificationModule.fitType?this.pdfViewer.magnificationModule.fitToWidth():"FitToPage"!==this.pdfViewer.zoomMode&&"fitToPage"===this.pdfViewer.magnificationModule.fitType&&this.pdfViewer.magnificationModule.fitToPage());for(var e=0;e<this.pageCount;e++)this.applyLeftPosition(e)},C.prototype.updateFreeTextProperties=function(e){this.pdfViewer.enableShapeLabel&&(this.pdfViewer.shapeLabelSettings.fillColor&&(e.labelFillColor=this.pdfViewer.shapeLabelSettings.fillColor),this.pdfViewer.shapeLabelSettings.fontColor&&(e.fontColor=this.pdfViewer.shapeLabelSettings.fontColor),this.pdfViewer.shapeLabelSettings.fontSize&&(e.fontSize=this.pdfViewer.shapeLabelSettings.fontSize),this.pdfViewer.shapeLabelSettings.fontFamily&&(e.fontFamily=this.pdfViewer.shapeLabelSettings.fontFamily),this.pdfViewer.shapeLabelSettings.opacity&&(e.labelOpacity=this.pdfViewer.shapeLabelSettings.opacity),this.pdfViewer.shapeLabelSettings.labelContent)&&(e.labelContent=this.pdfViewer.shapeLabelSettings.labelContent)},C.prototype.mouseDownHandler=function(e){var t,i=!1,n=[],o=[],i=(e&&e.target&&(this.mouseDownEvent=e,this.contextMenuModule.currentTarget=e.target),(i=this.pdfViewer.annotationModule?this.pdfViewer.annotationModule.isEnableDelete():i)||o.push("DeleteContext"),"None"!==this.pdfViewer.contextMenuOption&&(this.pdfViewer.textSelectionModule||this.isShapeBasedAnnotationsEnabled())?(e?(i=this.isClickWithinSelectionBounds(e),this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.freeTextAnnotationModule&&this.pdfViewer.annotationModule.freeTextAnnotationModule.isInuptBoxInFocus?(this.isFreeTextContextMenu=!0,this.pdfViewer.annotation.freeTextAnnotationModule&&!this.pdfViewer.annotation.freeTextAnnotationModule.isTextSelected&&(o.push("Cut"),o.push("Copy")),this.pdfViewer.annotation.freeTextAnnotationModule&&""===this.pdfViewer.annotation.freeTextAnnotationModule.selectedText&&o.push("Paste"),n.push("HighlightContext"),n.push("UnderlineContext"),n.push("StrikethroughContext"),n.push("ScaleRatio"),n.push("Properties"),n.push("Comment"),n.push("DeleteContext")):i&&this.pdfViewer.textSelectionModule?(!e.target.classList.contains("e-pv-maintaincontent")&&e.target.classList.contains("e-pv-text")||e.target.classList.contains("e-pv-text-layer")?this.checkIsNormalText()&&(t=!0):(F.isIE||"edge"===F.info.name)&&e.target.classList.contains("e-pv-page-container")&&(t=!0),n.push("Cut"),n.push("Paste"),n.push("DeleteContext"),n.push("ScaleRatio"),n.push("Comment"),n.push("Properties")):0===this.pdfViewer.selectedItems.annotations.length||"HandWrittenSignature"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"SignatureText"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"SignatureImage"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?0!==this.pdfViewer.selectedItems.annotations.length&&"Path"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?this.shapeMenuItems(n,o,!0):this.pdfViewer.annotation&&this.pdfViewer.annotation.isShapeCopied&&(e.target.classList.contains("e-pv-text-layer")||e.target.classList.contains("e-pv-text"))&&!this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation?(n.push("Properties"),this.shapeMenuItems(n,o,!1)):this.isCalibrateAnnotationModule()&&this.pdfViewer.annotationModule.measureAnnotationModule.currentAnnotationMode?(n.push("HighlightContext"),n.push("UnderlineContext"),n.push("StrikethroughContext"),n.push("Properties"),o.push("Cut"),o.push("Copy"),o.push("Paste"),o.push("DeleteContext"),o.push("Comment")):this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation?(n.push("HighlightContext"),n.push("UnderlineContext"),n.push("StrikethroughContext"),n.push("Properties"),n.push("Cut"),n.push("Copy"),n.push("Paste"),n.push("ScaleRatio")):t=!0:this.shapeMenuItems(n,o,!1,!0)):this.pdfViewer.textSelectionModule&&"MouseUp"===this.pdfViewer.contextMenuOption?(n.push("Cut"),n.push("Paste"),n.push("DeleteContext"),n.push("ScaleRatio"),n.push("Comment"),n.push("Properties")):0===this.pdfViewer.selectedItems.annotations.length&&(n.push("Cut"),n.push("Paste"),n.push("DeleteContext"),n.push("ScaleRatio"),n.push("Properties")),this.pdfViewer.enableCommentPanel||o.push("Comment")):t=!0,{hidenItems:n,disabledItems:o,isCancel:t});this.pdfViewer._dotnetInstance.invokeMethodAsync("MouseDownHandler",i)},C.prototype.OnItemSelected=function(e){var t=this.contextMenuModule.currentTarget,i=document.getElementById(this.pdfViewer.element.id+"_commantPanel"),n=!(!i||"block"!==i.style.display);switch(e){case this.pdfViewer.localeObj.getConstant("Copy"):this.CopyItemSelected();break;case this.pdfViewer.localeObj.getConstant("Highlight context"):this.TextMarkUpSelected("Highlight"),n||this.focusViewerContainer();break;case this.pdfViewer.localeObj.getConstant("Underline context"):this.TextMarkUpSelected("Underline"),n||this.focusViewerContainer();break;case this.pdfViewer.localeObj.getConstant("Strikethrough context"):this.TextMarkUpSelected("Strikethrough"),n||this.focusViewerContainer();break;case this.pdfViewer.localeObj.getConstant("Properties"):this.PropertiesItemSelected();break;case this.pdfViewer.localeObj.getConstant("Cut"):this.CutItemSelected(t),this.focusViewerContainer();break;case this.pdfViewer.localeObj.getConstant("Paste"):this.pasteItemSelected(t);break;case this.pdfViewer.localeObj.getConstant("Delete Context"):this.DeleteItemSelected(),this.focusViewerContainer();break;case this.pdfViewer.localeObj.getConstant("Scale Ratio"):this.ScaleRatioSelected();break;case this.pdfViewer.localeObj.getConstant("Comment"):this.CommentItemSelected()}},C.prototype.CommentItemSelected=function(){var e,t;this.pdfViewer.annotation&&(this.pdfViewer.annotation.showCommentsPanel(),0===this.pdfViewer.selectedItems.annotations.length&&!this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation||(e=void 0,e=this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation||this.pdfViewer.selectedItems.annotations[0],(t=document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+this.pdfViewer.currentPageNumber))&&t.ej2_instances[0].expandItem(!0),(t=document.getElementById(e.annotName))&&!t.classList.contains("e-pv-comments-border")&&t.firstChild.click()))},C.prototype.ScaleRatioSelected=function(){this.isCalibrateAnnotationModule()&&this.pdfViewer.annotation.measureAnnotationModule.createScaleRatioWindow()},C.prototype.DeleteItemSelected=function(){this.pdfViewer.formDesignerModule&&0!==this.pdfViewer.selectedItems.formFields.length?this.pdfViewer.formDesignerModule.deleteFormField(this.pdfViewer.selectedItems.formFields[0].id):this.pdfViewer.annotation&&this.pdfViewer.annotation.deleteAnnotation()},C.prototype.pasteItemSelected=function(e){this.isFreeTextContextMenu||this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.freeTextAnnotationModule.isInuptBoxInFocus&&e&&"free-text-input"===e.className&&"TEXTAREA"===e.tagName?(this.pdfViewer.annotation.freeTextAnnotationModule.pasteSelectedText(e),this.contextMenuModule.close()):(this.pdfViewer.paste(),this.contextMenuModule.previousAction="Paste")},C.prototype.CutItemSelected=function(e){this.isFreeTextContextMenu||this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.freeTextAnnotationModule.isInuptBoxInFocus&&e&&"free-text-input"===e.className&&"TEXTAREA"===e.tagName?(this.pdfViewer.annotation.freeTextAnnotationModule.cutSelectedText(e),this.contextMenuModule.close()):1===this.pdfViewer.selectedItems.annotations.length?(this.pdfViewer.selectedItems.annotations[0].pageIndex,this.pdfViewer.cut(),this.contextMenuModule.previousAction="Cut"):1===this.pdfViewer.selectedItems.formFields.length&&(this.pdfViewer.cut(),this.contextMenuModule.previousAction="Cut")},C.prototype.CopyItemSelected=function(){var e=!1;this.isFreeTextContextMenu||this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.freeTextAnnotationModule.isInuptBoxInFocus?(this.pdfViewer.annotation.freeTextAnnotationModule.copySelectedText(),this.contextMenuModule.close(),e=!0):this.pdfViewer.textSelectionModule&&(this.pdfViewer.textSelectionModule.copyText(),this.contextMenuModule.close()),(this.pdfViewer.selectedItems.annotations.length&&!e||0<this.pdfViewer.selectedItems.formFields.length)&&(this.pdfViewer.copy(),this.contextMenuModule.previousAction="Copy")},C.prototype.PropertiesItemSelected=function(){0===this.pdfViewer.selectedItems.annotations.length||"Line"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"LineWidthArrowHead"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"Distance"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?0!==this.pdfViewer.selectedItems.formFields.length&&this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType&&this.pdfViewer.formDesigner.createPropertiesWindow():this.pdfViewer.annotation.createPropertiesWindow()},C.prototype.TextMarkUpSelected=function(e){this.pdfViewer.annotation&&this.pdfViewer.annotation.textMarkupAnnotationModule&&(this.pdfViewer.annotation.textMarkupAnnotationModule.isSelectionMaintained=!1,this.pdfViewer.annotation.textMarkupAnnotationModule.drawTextMarkupAnnotations(e),this.pdfViewer.annotation.textMarkupAnnotationModule.isTextMarkupAnnotationMode=!1,this.pdfViewer.annotation.textMarkupAnnotationModule.currentTextMarkupAddMode="",this.pdfViewer.annotation.textMarkupAnnotationModule.isSelectionMaintained=!0)},C.prototype.shapeMenuItems=function(e,t,i,n){this.pdfViewer.annotation&&!this.pdfViewer.annotation.isShapeCopied&&t.push("Paste"),e.push("HighlightContext"),e.push("UnderlineContext"),e.push("StrikethroughContext"),e.push("ScaleRatio"),i?"Line"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"LineWidthArrowHead"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"Distance"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&e.push("Properties"):(n?e.push("Properties"):(e.push("Cut"),e.push("Copy"),e.push("DeleteContext")),e.push("Comment"))},C.prototype.checkIsRtlText=function(e){return new RegExp("^[^A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02B8\\u0300-\\u0590\\u0800-\\u1FFF\\u2C00-\\uFB1C\\uFDFE-\\uFE6F\\uFEFD-\\uFFFF]*[\\u0591-\\u07FF\\uFB1D-\\uFDFD\\uFE70-\\uFEFC]").test(e)},C.prototype.isClickWithinSelectionBounds=function(e){var t,i=!1,n=this.currentPageNumber-5<0?0:this.currentPageNumber-5,o=this.currentPageNumber-5>this.pageCount?this.pageCount:this.currentPageNumber+5;if(this.pdfViewer.textSelectionModule){for(var r=n;r<o;r++)if(0<=r&&(t=this.pdfViewer.textSelectionModule.getCurrentSelectionBounds(r))){var s=t;if(this.getHorizontalValue(s.left,r)<e.clientX&&this.getHorizontalValue(s.right,r)>e.clientX&&this.getVerticalValue(s.top,r)<e.clientY&&this.getVerticalValue(s.bottom,r)>e.clientY||1===this.pdfViewer.textSelectionModule.selectionRangeArray[0].rectangleBounds.length&&0!==e.clientX&&!this.pdfViewer.annotationModule.textMarkupAnnotationModule.isTextMarkupAnnotationMode){i=!0;break}}(F.isDevice&&this.pdfViewer.textSelectionModule.selectionRangeArray&&1===this.pdfViewer.textSelectionModule.selectionRangeArray.length||(F.isIE||"edge"===F.info.name)&&t||this.pdfViewer.textSelectionModule.isTouchSelection)&&0<this.pdfViewer.textSelectionModule.selectionRangeArray.length&&!this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation&&(i=!0)}return i},C.prototype.getHorizontalClientValue=function(e){return e-this.getElement("_pageDiv_"+(this.currentPageNumber-1)).getBoundingClientRect().left},C.prototype.getVerticalClientValue=function(e){return e-this.getElement("_pageDiv_"+(this.currentPageNumber-1)).getBoundingClientRect().top},C.prototype.getHorizontalValue=function(e,t){t=this.getElement("_pageDiv_"+(t||this.currentPageNumber-1)).getBoundingClientRect();return e*this.getZoomFactor()+t.left},C.prototype.getVerticalValue=function(e,t){t=this.getElement("_pageDiv_"+(t||this.currentPageNumber-1)).getBoundingClientRect();return e*this.getZoomFactor()+t.top},C.prototype.checkIsNormalText=function(){var e=!0,t="",i=this.pdfViewer.textSelectionModule;return i&&i.selectionRangeArray&&1===i.selectionRangeArray.length?t=i.selectionRangeArray[0].textContent:window.getSelection()&&window.getSelection().anchorNode&&(t=window.getSelection().toString()),e=""!==t&&this.checkIsRtlText(t)?!1:e},C.prototype.isTextSearchBoxOpen=function(){var e,t=document.getElementById(this.pdfViewer.element.id+"_search_box");return e=t?"none"!==t.style.display:e},C.prototype.isTargetClassNameValid=function(e){return"e-pv-formfield-input"!==e.target.className&&"e-pv-formfield-textarea"!==e.target.className&&"e-pv-properties-name-edit-input e-input e-lib e-textbox e-control"!==e.target.className&&"e-pv-properties-value-input e-input e-lib e-textbox e-control"!==e.target.className&&e.target.id!==this.pdfViewer.element.id+"_search_input"&&"e-input-group e-pv-search-input e-input-focus"!==e.target.className&&"e-pdfviewer-formFields"!==e.target.className},C.prototype.DeleteKeyPressed=function(e){var t,i,n=document.getElementById(this.pdfViewer.element.id+"_search_box");n&&(t="none"!==n.style.display),this.pdfViewer.formDesignerModule&&!this.pdfViewer.formDesigner.isPropertyDialogOpen&&this.pdfViewer.designerMode&&0!==this.pdfViewer.selectedItems.formFields.length&&!t?this.pdfViewer.formDesignerModule.deleteFormField(this.pdfViewer.selectedItems.formFields[0].id):this.pdfViewer.annotation&&!this.pdfViewer.designerMode&&e.srcElement.parentElement.classList&&!e.srcElement.parentElement.classList.contains("e-input-focus")&&(!this.isTextMarkupAnnotationModule()||this.getPopupNoteVisibleStatus()||t||this.pdfViewer.annotationModule.deleteAnnotation(),0<this.pdfViewer.selectedItems.annotations.length)&&(n=!0,"Path"!==(i=(t=this.pdfViewer.selectedItems.annotations[0]).shapeAnnotationType)&&"SignatureField"!==t.formFieldAnnotationType&&"InitialField"!==t.formFieldAnnotationType&&"HandWrittenSignature"!==i&&"SignatureText"!==i&&"SignatureImage"!==i||(i=document.getElementById(t.id))&&i.disabled&&(n=!0),n||t.annotationSettings&&t.annotationSettings.isLock&&!this.pdfViewer.annotationModule.checkAllowedInteractions("Delete",t)||(this.pdfViewer.remove(t),this.pdfViewer.renderSelector(this.pdfViewer.annotation.getEventPageNumber(e))))},C.prototype.initiatePanning=function(){this.isPanMode=!0,this.textLayer.modifyTextCursor(!1),this.disableTextSelectionMode(),this.pdfViewer.toolbar&&this.pdfViewer.toolbar.annotationToolbarModule&&this.pdfViewer.toolbar.annotationToolbarModule.deselectAllItems()},C.prototype.initiateTextSelectMode=function(){this.isPanMode=!1,this.viewerContainer&&(this.viewerContainer.style.cursor="auto",this.pdfViewer.textSelectionModule&&(this.textLayer.modifyTextCursor(!0),this.pdfViewer.textSelectionModule.enableTextSelectionMode()),F.isDevice&&!this.pdfViewer.enableDesktopMode||N||this.enableAnnotationAddTools(!0))},C.prototype.initiateTextSelection=function(){this.pdfViewer.toolbar&&!this.pdfViewer.toolbar.isSelectionToolDisabled&&(this.initiateTextSelectMode(),this.pdfViewer.toolbar.updateInteractionTools(!0))},C.prototype.enableAnnotationAddTools=function(e){this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule.enableAnnotationAddTools(e)},C.prototype.applySelection=function(){null!==window.getSelection().anchorNode&&this.pdfViewer.textSelectionModule.applySpanForSelection(),this.isViewerContainerDoubleClick=!1},C.prototype.isDesignerMode=function(e){var t=!1;return(0!==this.pdfViewer.selectedItems.annotations.length&&("HandWrittenSignature"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"SignatureText"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"SignatureImage"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType)||0!==this.pdfViewer.selectedItems.annotations.length&&"Path"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||0!==this.pdfViewer.selectedItems.formFields.length&&this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType&&this.pdfViewer.designerMode||this.pdfViewer.annotation&&this.pdfViewer.annotation.isShapeCopied&&(e.classList.contains("e-pv-text-layer")||e.classList.contains("e-pv-text"))&&!this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation||this.pdfViewer.formDesigner&&this.pdfViewer.formDesigner.isShapeCopied&&(e.classList.contains("e-pv-text-layer")||e.classList.contains("e-pv-text")))&&(t=!0),this.designerModetarget=e,t},C.prototype.handleTaps=function(e,t){var i,n=this;this.isDeviceiOS?(t=gCt(t,this,this.pdfViewer),i=!je(this.pdfViewer.annotation)&&!je(this.pdfViewer.annotation.freeTextAnnotationModule)&&!this.pdfViewer.annotation.freeTextAnnotationModule.isNewFreeTextAnnot&&(!t||!this.pdfViewer.selectedItems.annotations[0]||t.id!==this.pdfViewer.selectedItems.annotations[0].id)&&document.activeElement.classList.contains("free-text-input")&&this.isFreeTextAnnotation(this.pdfViewer.selectedItems.annotations),this.singleTapTimer?this.pdfViewer.enablePinchZoom&&(this.tapCount++,2<this.tapCount&&(this.tapCount=2),clearTimeout(this.singleTapTimer),this.singleTapTimer=null,this.onDoubleTap(e)):(this.singleTapTimer=setTimeout(function(){!i||je(n.pdfViewer.selectedItems)||je(n.pdfViewer.selectedItems.annotations[0])||(n.pdfViewer.clearSelection(n.pdfViewer.selectedItems.annotations[0].pageIndex),n.focusViewerContainer(!0)),n.onSingleTap(e)},300),this.tapCount++)):this.singleTapTimer?this.pdfViewer.enablePinchZoom&&(this.tapCount++,2<this.tapCount&&(this.tapCount=2),clearTimeout(this.singleTapTimer),this.singleTapTimer=null,this.onDoubleTap(e)):(this.singleTapTimer=setTimeout(function(){n.onSingleTap(e)},300),this.tapCount++)},C.prototype.handleTextBoxTaps=function(e){var t=this;setTimeout(function(){t.inputTapCount=0},300),this.inputTapCount++,this.isDeviceiOS?this.onTextBoxDoubleTap(e):setTimeout(function(){t.onTextBoxDoubleTap(e)},200),2<this.inputTapCount&&(this.inputTapCount=0)},C.prototype.onTextBoxDoubleTap=function(e){var t;e[0].target;2===this.inputTapCount&&0!==this.pdfViewer.selectedItems.annotations.length&&(this.pdfViewer.annotationModule&&(e=this.pdfViewer.selectedItems.annotations[0],this.isDeviceiOS&&document.activeElement.classList.contains("free-text-input")&&this.isFreeTextAnnotation(this.pdfViewer.selectedItems.annotations)&&this.focusViewerContainer(!0),this.pdfViewer.annotationModule.annotationSelect(e.annotName,e.pageIndex,e,null,!0)),this.isFreeTextAnnotation(this.pdfViewer.selectedItems.annotations)&&!this.pdfViewer.annotationModule.freeTextAnnotationModule.isInuptBoxInFocus?((t={}).x=this.pdfViewer.selectedItems.annotations[0].bounds.x,e=void(t.y=this.pdfViewer.selectedItems.annotations[0].bounds.y),e="diagram_helper"===this.pdfViewer.selectedItems.annotations[0].id?this.pdfViewer.nameTable[this.eventArgs.source.id]:this.pdfViewer.selectedItems.annotations[0],this.pdfViewer.annotation.freeTextAnnotationModule.addInuptElemet(t,e)):this.pdfViewer.selectedItems.annotations[0]&&this.pdfViewer.selectedItems.annotations[0].enableShapeLabel&&!this.pdfViewer.annotationModule.freeTextAnnotationModule.isInuptBoxInFocus&&((t={}).x=this.pdfViewer.selectedItems.annotations[0].bounds.x,t.y=this.pdfViewer.selectedItems.annotations[0].bounds.y,this.pdfViewer.annotation.inputElementModule.editLabel(t,this.pdfViewer.selectedItems.annotations[0])))},C.prototype.onSingleTap=function(e){var t=e[0].target,i=!1;this.singleTapTimer=null,t&&(t.classList.contains("e-pdfviewer-formFields")||t.classList.contains("e-pdfviewer-ListBox")||t.classList.contains("e-pdfviewer-signatureformfields"))&&(i=!0),this.isLongTouchPropagated||this.navigationPane.isNavigationToolbarVisible||i||this.pdfViewer.toolbarModule&&(this.touchClientX>=e[0].clientX-10&&this.touchClientX<=e[0].clientX+10&&this.touchClientY>=e[0].clientY-10&&this.touchClientY<=e[0].clientY+10&&(this.isTapHidden?N&&(this.viewerContainer.scrollTop+=this.pdfViewer.element.querySelector(".e-pv-mobile-toolbar").clientHeight*this.getZoomFactor()):(N&&(this.viewerContainer.scrollTop-=this.pdfViewer.element.querySelector(".e-pv-mobile-toolbar").clientHeight*this.getZoomFactor()),this.pdfViewer.toolbar.moreDropDown&&(t=this.getElement("_more_option-popup")).firstElementChild&&(t.classList.remove("e-popup-open"),t.classList.add("e-popup-close"),t.removeChild(t.firstElementChild))),this.isTapHidden&&F.isDevice&&!this.pdfViewer.enableDesktopMode?(this.mobileScrollerContainer.style.display="",this.updateMobileScrollerPosition()):F.isDevice&&!this.pdfViewer.enableDesktopMode&&null==this.getSelectTextMarkupCurrentPage()&&(this.mobileScrollerContainer.style.display="none"),null==this.getSelectTextMarkupCurrentPage())&&(N?this.blazorUIAdaptor.tapOnMobileDevice(this.isTapHidden):this.pdfViewer.enableToolbar&&this.pdfViewer.toolbarModule.showToolbar(!0),this.isTapHidden=!this.isTapHidden),this.tapCount=0)},C.prototype.onDoubleTap=function(e){var t=e[0].target,i=!1;t&&(t.classList.contains("e-pdfviewer-formFields")||t.classList.contains("e-pdfviewer-ListBox")||t.classList.contains("e-pdfviewer-signatureformfields"))&&(i=!0),2!==this.tapCount||i||(this.tapCount=0,this.touchClientX>=parseInt((e[0].clientX-10).toString(),10)&&this.touchClientX<=e[0].clientX+10&&this.touchClientY>=e[0].clientY-10&&this.touchClientY<=e[0].clientY+30&&(this.pdfViewer.magnification&&1!==this.pdfViewer.selectedItems.annotations.length&&this.pdfViewer.magnification.onDoubleTapMagnification(),this.viewerContainer.style.height=this.updatePageHeight(this.pdfViewer.element.getBoundingClientRect().height,this.toolbarHeight),this.isTapHidden=!1,clearTimeout(this.singleTapTimer),this.singleTapTimer=null))},C.prototype.preventTouchEvent=function(e){!this.pdfViewer.textSelectionModule||this.isPanMode||!this.pdfViewer.enableTextSelection||this.isTextSelectionDisabled||null!=this.getSelectTextMarkupCurrentPage()||this.isWebkitMobile&&F.isDevice&&!this.pdfViewer.enableDesktopMode||(e.preventDefault(),e.stopPropagation())},C.prototype.renderStampAnnotation=function(e){var t,i,n,o,r,s;this.pdfViewer.annotation&&(t=this.getZoomFactor(),i=this.pdfViewer.annotation.getEventPageNumber(e),n=this.getElement("_pageDiv_"+i),this.pdfViewer.enableStampAnnotations&&((o=this.pdfViewer.annotationModule.stampAnnotationModule)&&o.isStampAnnotSelected&&n&&(s=n.getBoundingClientRect(),"touchend"===e.type&&"Image"===this.pdfViewer.annotationModule.stampAnnotationModule.currentStampAnnotation.shapeAnnotationType?((r=this.pdfViewer.annotationModule.stampAnnotationModule.currentStampAnnotation).pageIndex=i,r.bounds.x=(e.changedTouches[0].clientX-s.left)/t,r.bounds.y=(e.changedTouches[0].clientY-s.top)/t,o.updateDeleteItems(i,r,r.opacity),this.pdfViewer.add(r),r=this.getAnnotationCanvas("_annotationCanvas_",i),this.pdfViewer.renderDrawing(r,i)):o.renderStamp((e.changedTouches[0].clientX-s.left)/t,(e.changedTouches[0].clientY-s.top)/t,null,null,i,null,null,null,null),o.isStampAnnotSelected=!1),this.pdfViewer.annotation.onAnnotationMouseDown()),this.pdfViewer.enableHandwrittenSignature&&this.isSignatureAdded&&n&&(s=n.getBoundingClientRect(),this.currentSignatureAnnot.pageIndex=i,this.signatureModule.renderSignature((e.changedTouches[0].clientX-s.left)/t,(e.changedTouches[0].clientY-s.top)/t),this.isSignatureAdded=!1),1===e.touches.length)&&this.isTextMarkupAnnotationModule()&&!this.getPopupNoteVisibleStatus()&&this.pdfViewer.annotationModule.textMarkupAnnotationModule.onTextMarkupAnnotationTouchEnd(e)},C.prototype.focusOnViewerContainer=function(){var e=document.activeElement;return document.querySelector(".e-pv-viewer-container").contains(e)},C.prototype.initPageDiv=function(e){if(N||this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.updateTotalPage(),F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.mobiletotalPageContainer&&(this.mobiletotalPageContainer.innerHTML=this.pageCount.toString(),this.pageNoContainer.innerHTML="(1-"+this.pageCount.toString()+")"),0<this.pageCount){var t=this.getPageLimit();if(this.pageSizeCollection(e,0,t),this.pageCount<=100){for(var i=this.renderPageContainerLimit(t),n=0;n<i;n++)this.renderPageContainer(n,this.getPageWidth(n),this.getPageHeight(n),this.getPageTop(n));this.loadPage(0)}this.pageContainer.style.height=this.getPageTop(this.pageSize.length-1)+this.getPageHeight(this.pageSize.length-1)+"px",this.pageContainer.style.position="relative",100===this.pageLimit&&null===this.getElement("_pageDiv_"+this.pageLimit)&&this.pageLimit<this.pageCount&&Promise.all([this.renderPagesVirtually()])}},C.prototype.renderPageContainerLimit=function(e){var t;if(0<this.pageCount){for(var i=this.isMixedSizeDocument=!1,n=!1,o=!1,r=0;r<this.pageCount;r++){this.pageSize[parseInt(r.toString(),10)].height>this.pageSize[parseInt(r.toString(),10)].width&&(i=!0),this.pageSize[parseInt(r.toString(),10)].width>this.pageSize[parseInt(r.toString(),10)].height&&(n=!0),0<r&&this.pageSize[parseInt(r.toString(),10)].width!==this.pageSize[r-1].width&&(o=!0);var s=this.pageSize[parseInt(r.toString(),10)].width,s=(s>this.highestWidth&&(this.highestWidth=s),this.pageSize[parseInt(r.toString(),10)].height);s>this.highestHeight&&(this.highestHeight=s)}(i&&n||o)&&(this.isMixedSizeDocument=!0),t=10<this.pdfViewer.initialRenderPages?100<this.pdfViewer.initialRenderPages?e:this.pdfViewer.initialRenderPages<=this.pageCount?this.pdfViewer.initialRenderPages:this.pageCount:this.pageCount<10?this.pageCount:10}return t},C.prototype.pageSizeCollection=function(e,t,i){for(var n,o,r=0,s=t;s<i;s++)o="object"!=typeof e.pageSizes[parseInt(s.toString(),10)]?(o=e.pageSizes[parseInt(s.toString(),10)].split(","),r=null!==e.pageSizes[s-1]&&0!==s?(n=e.pageSizes[s-1].split(","),this.pageGap+parseFloat(n[1])+r):this.pageGap,{width:parseFloat(o[0]),height:parseFloat(o[1]),top:r,rotation:!je(e.pageRotation)&&(!je(e.pageRotation.length)&&0<e.pageRotation.length||!je(Object.keys(e.pageRotation).length)&&0<Object.keys(e.pageRotation).length)?e.pageRotation[parseInt(s.toString(),10)]:0}):(r=null!==e.pageSizes[s-1]&&0!==s?(n=e.pageSizes[s-1],this.pageGap+(parseFloat(n.height)?parseFloat(n.height):parseFloat(n.Height))+r):this.pageGap,{width:e.pageSizes[parseInt(s.toString(),10)].width?e.pageSizes[parseInt(s.toString(),10)].width:e.pageSizes[parseInt(s.toString(),10)].Width,height:e.pageSizes[parseInt(s.toString(),10)].height?e.pageSizes[parseInt(s.toString(),10)].height:e.pageSizes[parseInt(s.toString(),10)].Height,top:r,rotation:!je(e.pageRotation)&&(!je(e.pageRotation.length)&&0<e.pageRotation.length||!je(Object.keys(e.pageRotation).length)&&0<Object.keys(e.pageRotation).length)?e.pageRotation[parseInt(s.toString(),10)]:0}),this.pageSize.push(o)},C.prototype.getPageLimit=function(){var e=0;return 100<this.pageCount?this.pageLimit=e=100:e=this.pageCount,e},C.prototype.renderElementsVirtualScroll=function(e){var t=e+(this.pageStopValue<=200?4:2);t>this.pageCount&&(t=this.pageCount);for(var i=e-1;i<=t;i++)-1!==i&&this.renderPageElement(i);var n=e-3;n<0&&(n=0);for(i=e-1;n<=i;i--)-1!==i&&this.renderPageElement(i);for(var o,r,s,a,l,h=0;h<this.pageCount;h++)n<=h&&h<=t||(o=this.getElement("_pageDiv_"+h),r=this.getElement("_pageCanvas_"+h),s=this.getElement("_textLayer_"+h),a=this.pdfViewer.initialRenderPages>this.pageRenderCount?this.pdfViewer.initialRenderPages<=this.pageCount?this.pdfViewer.initialRenderPages-1:this.pageCount:-1,r&&a<h&&(r.onload=null,r.onerror=null,r.parentNode.removeChild(r),s&&(this.pdfViewer.textSelectionModule&&0!==s.childNodes.length&&!this.isTextSelectionDisabled&&this.pdfViewer.textSelectionModule.maintainSelectionOnScroll(h,!0),s.parentNode.removeChild(s)),-1!==(l=this.renderedPagesList.indexOf(h)))&&this.renderedPagesList.splice(l,1),o&&a<h&&(o.parentNode.removeChild(o),-1!==(l=this.renderedPagesList.indexOf(h)))&&this.renderedPagesList.splice(l,1));N&&this.pdfViewer._dotnetInstance.invokeMethodAsync("UpdateCurrentPageNumber",this.currentPageNumber)},C.prototype.renderPageElement=function(e){var t=this.getElement("_pageDiv_"+e);null==this.getElement("_pageCanvas_"+e)&&null==t&&e<this.pageSize.length&&this.renderPageContainer(e,this.getPageWidth(e),this.getPageHeight(e),this.getPageTop(e))},C.prototype.renderPagesVirtually=function(){return CRt(this,void 0,void 0,function(){var t,i=this;return SRt(this,function(e){return t=this,setTimeout(function(){i.initiateRenderPagesVirtually(t)},500),[2]})})},C.prototype.initiateRenderPagesVirtually=function(i){var e,t={hashId:i.hashId,isClientsideLoading:this.clientSideRendering,isCompletePageSizeNotReceived:!0,action:"VirtualLoad",elementId:i.pdfViewer.element.id,uniqueId:i.documentId,password:i.passwordData};i.jsonDocumentId&&(t.documentId=i.jsonDocumentId),this.virtualLoadRequestHandler=new DRt(this.pdfViewer),this.virtualLoadRequestHandler.url=i.pdfViewer.serviceUrl+"/"+i.pdfViewer.serverActionSettings.load,this.virtualLoadRequestHandler.responseType="json",this.virtualLoadRequestHandler.mode=!0,this.clientSideRendering?(e=this.pdfViewer.pdfRendererModule.load(null,this.documentId,null,t),this.viritualload(JSON.parse(e),this)):this.virtualLoadRequestHandler.send(t),this.virtualLoadRequestHandler.onSuccess=function(e){var t=e.data;if(t&&"object"!=typeof t)try{t=JSON.parse(t)}catch(e){i.onControlError(500,t,"VirtualLoad")}if(t){for(;"object"!=typeof t;)t=JSON.parse(t);i.viritualload(t,i)}},this.virtualLoadRequestHandler.onFailure=function(e){i.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText)},this.virtualLoadRequestHandler.onError=function(e){i.openNotificationPopup(),i.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText)}},C.prototype.viritualload=function(e,t){if(t.documentId===e.uniqueId){t.pdfViewer.fireAjaxRequestSuccess("VirtualLoad",e);var i=e;if(t.pageSize[t.pageLimit-1]){for(var n,o,r=t.pageSize[t.pageLimit-1].top,s=t.pageLimit;s<t.pageCount;s++)o="object"!=typeof i.pageSizes[parseInt(s.toString(),10)]?(o=i.pageSizes[parseInt(s.toString(),10)].split(","),null!==t.pageSize[s-1]&&0!==s&&(n=t.pageSize[s-1].height,r=t.pageGap+parseFloat(n)+r),{width:parseFloat(o[0]),height:parseFloat(o[1]),top:r,rotation:!je(i.pageRotation)&&(!je(i.pageRotation.length)&&0<i.pageRotation.length||!je(Object.keys(i.pageRotation).length)&&0<Object.keys(i.pageRotation).length)?i.pageRotation[parseInt(s.toString(),10)]:0}):(null!==t.pageSize[s-1]&&0!==s&&(n=t.pageSize[s-1].height,r=t.pageGap+parseFloat(n)+r),{width:parseFloat(i.pageSizes[parseInt(s.toString(),10)].width)?parseFloat(i.pageSizes[parseInt(s.toString(),10)].width):parseFloat(i.pageSizes[parseInt(s.toString(),10)].Width),height:parseFloat(i.pageSizes[parseInt(s.toString(),10)].height)?parseFloat(i.pageSizes[parseInt(s.toString(),10)].height):parseFloat(i.pageSizes[parseInt(s.toString(),10)].Height),top:r,rotation:!je(i.pageRotation)&&(!je(i.pageRotation.length)&&0<i.pageRotation.length||!je(Object.keys(i.pageRotation).length)&&0<Object.keys(i.pageRotation).length)?i.pageRotation[parseInt(s.toString(),10)]:0}),t.pageSize.push(o);e=t.getPageLimit();if(100<t.pageCount){for(var a=t.renderPageContainerLimit(e),s=0;s<a;s++)t.renderPageContainer(s,t.getPageWidth(s),t.getPageHeight(s),t.getPageTop(s));t.loadPage(0)}t.pageContainer.style.height=t.getPageTop(t.pageSize.length-1)+t.getPageHeight(t.pageSize.length-1)+"px";e=C.sessionStorageManager.getItem(t.documentId+"_pagedata");if(100<t.pageCount){if(100<this.pdfViewer.initialRenderPages)for(a=this.pdfViewer.initialRenderPages<=t.pageCount?this.pdfViewer.initialRenderPages:t.pageCount,s=100;s<a;s++)t.renderPageContainer(s,t.getPageWidth(s),t.getPageHeight(s),t.getPageTop(s)),t.createRequestForRender(s);t.pdfViewer.fireDocumentLoad(e);e=t.pdfViewer.linkAnnotationModule;e&&e.linkAnnotation&&0<e.linkAnnotation.length&&0<e.linkPage.length&&e.renderDocumentLink(e.linkAnnotation,e.linkPage,e.annotationY,t.currentPageNumber-1)}}}},C.prototype.tileRenderPage=function(r,s){var a=this,l=null,l=this;if(r&&this.pageSize[parseInt(s.toString(),10)]){var e=this.getPageWidth(s),t=this.getPageHeight(s),h=this.getElement("_pageCanvas_"+s),d=this.getElement("_pageDiv_"+s),i=r.tileX||0,n=r.tileY||0,e=(d&&(d.style.width=e+"px",d.style.height=t+"px",d.style.background="#fff",d.style.top=this.getPageTop(s)+"px",this.pdfViewer.enableRtl?d.style.right=this.updateLeftPosition(s)+"px":d.style.left=this.updateLeftPosition(s)+"px"),h&&(h.style.background="#fff"),r.image),t=this.retrieveCurrentZoomFactor(),p=document.querySelectorAll('img[id*="'+l.pdfViewer.element.id+"_tileimg_"+s+'_"]');if(0===p.length&&(this.isReRenderRequired=!0),this.isReRenderRequired){r.zoomFactor&&(t=r.zoomFactor);var o,c,u,g,m=this.documentId+"_"+s+"_"+t+"_"+r.tileX+"_"+r.tileY,m=(this.tilerequestLists.push(m),r.transformationMatrix),f=r.width;e&&(o=r.tileX||0,c=r.tileY||0,u=je(r.scaleFactor)?1.5:r.scaleFactor,(g=document.getElementById(this.pdfViewer.element.id+"_tileimg_"+s+"_"+this.getZoomFactor()+"_"+o+"_"+c))||((g=new Image).id=this.pdfViewer.element.id+"_tileimg_"+s+"_"+this.getZoomFactor()+"_"+o+"_"+c,g.style.userSelect="none",d&&d.append(g)),d)&&(g.src=e,g.setAttribute("alt",""),g.onload=function(){var e;if(l.showPageLoadingIndicator(s,!1),l.tileRenderCount=l.tileRenderCount+1,0===o&&0===c&&0===s&&a.isDocumentLoaded&&(l.renderPDFInformations(),l.isInitialLoaded=!0,e=C.sessionStorageManager.getItem(l.documentId+"_pagedata"),l.pageCount<=100&&l.pdfViewer.fireDocumentLoad(e),l.isDocumentLoaded=!1,!l.pdfViewer.textSearch||(!l.clientSideRendering||l.pdfViewer.thumbnailViewModule||l.pdfViewer.pageOrganizer)&&l.clientSideRendering||l.pdfViewer.textSearchModule.getPDFDocumentTexts()),l.tileRenderCount===l.tileRequestCount&&r.uniqueId===l.documentId){l.isTextMarkupAnnotationModule()&&l.pdfViewer.annotationModule.textMarkupAnnotationModule.rerenderAnnotations(s),h&&(h.style.display="none",h.src="#");for(var t=document.querySelectorAll('img[id*="'+l.pdfViewer.element.id+'_oldCanvas"]'),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].onload=null,t[parseInt(i.toString(),10)].onerror=null,d.removeChild(t[parseInt(i.toString(),10)]);l.isTileImageRendered=!1,l.tileRenderCount=0,l.pdfViewer.magnificationModule&&l.pdfViewer.magnificationModule.rerenderCountIncrement(),l.isDrawnCompletely=!0,l.pdfViewer.firePageRenderComplete(r)}g.setAttribute("alt","Page "+(s+1))},e=f*this.getZoomFactor()/t/u,m=(f=m?m.Elements||m.Values:[1,0,0,1,1,1])[5]*this.getZoomFactor()/t/u,f=f[4]*this.getZoomFactor()/t/u,g.width=e,g.style.width=e+"px",g.style.top=m+"px",g.style.left=f+"px",g.style.position="absolute"),0===i&&0===n&&this.onPageRender(r,s,d)}else{for(var y=this,v=0;v<p.length;v++)!function(e){var n,t=p[parseInt(e.toString(),10)].id.split("_"),i=l.retrieveCurrentZoomFactor(),o=void 0;(o=y.clientSideRendering?JSON.parse(l.getStoredTileImageDetails(s,parseFloat(t[t.length-2]),parseFloat(t[t.length-1]),i)):JSON.parse(l.getWindowSessionStorageTile(s,parseFloat(t[t.length-2]),parseFloat(t[t.length-1]),i)))&&o.zoomFactor&&o.zoomFactor,parseFloat(t[t.length-4])===s&&(n=p[parseInt(e.toString(),10)]).nodeType===Node.ELEMENT_NODE&&(n.onload=function(){var e;if(l.showPageLoadingIndicator(s,!1),l.tileRenderCount=l.tileRenderCount+1,0===b&&0===w&&0===s&&a.isDocumentLoaded&&(a.renderPDFInformations(),a.isInitialLoaded=!0,e=C.sessionStorageManager.getItem(l.documentId+"_pagedata"),l.pageCount<=100&&l.pdfViewer.fireDocumentLoad(e),l.isDocumentLoaded=!1,!l.pdfViewer.textSearch||(!l.clientSideRendering||l.pdfViewer.thumbnailViewModule||l.pdfViewer.pageOrganizer)&&l.clientSideRendering||l.pdfViewer.textSearchModule.getPDFDocumentTexts()),l.tileRenderCount===l.tileRequestCount&&r.uniqueId===l.documentId){h.style.display="none",h.src="#",l.isTextMarkupAnnotationModule()&&l.pdfViewer.annotationModule.textMarkupAnnotationModule.rerenderAnnotations(s);for(var t=document.querySelectorAll('img[id*="'+l.pdfViewer.element.id+'_oldCanvas"]'),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].onload=null,t[parseInt(i.toString(),10)].onerror=null,d.removeChild(t[parseInt(i.toString(),10)]);l.isTileImageRendered=!1,l.tileRenderCount=0,l.pdfViewer.magnificationModule&&l.pdfViewer.magnificationModule.rerenderCountIncrement(),l.isDrawnCompletely=!0,l.pdfViewer.firePageRenderComplete(r)}n.setAttribute("alt","Page "+(s+1))},o)&&(n.src=o.image)}(v);var b=r.tileX||0,w=r.tileY||0;0===b&&0===w&&this.onPageRender(r,s,d)}}},C.prototype.renderTileCanvas=function(e,t,i,n,o,r){var s=this.getElement("_pageTileCanvas_"+i);return s||((s=Q("canvas",{id:this.pdfViewer.element.id+"_pageTileCanvas_"+i,className:"e-pv-pageTile-canvas"})).style.width=e+"px",s.style.height=t+"px",s.style.display="none",s.style.backgroundColor="#fff",this.isMixedSizeDocument&&0<this.highestWidth&&(s.style.marginLeft="auto",s.style.marginRight="auto"),n.appendChild(s)),s},C.prototype.calculateImageWidth=function(e,t,i,n){e=e/this.getZoomFactor()*t*i;return n=(n=parseInt(n.toString(),10)===parseInt(e.toString(),10)?e:n)*this.getZoomFactor()/t},C.prototype.renderPage=function(e,s,t){var i,a,l,n,h=this,d=this;e&&this.pageSize[parseInt(s.toString(),10)]&&(i=this.getPageWidth(s),n=this.getPageHeight(s),a=this.getElement("_pageCanvas_"+s),(l=this.getElement("_pageDiv_"+s))&&(l.style.width=i+"px",l.style.height=n+"px",l.style.top=this.getPageTop(s)+"px",this.pdfViewer.enableRtl?l.style.right=this.updateLeftPosition(s)+"px":l.style.left=this.updateLeftPosition(s)+"px"),a)&&(a.style.background="#fff",a.style.display="block",a.style.width=i+"px",a.style.height=n+"px",i<parseFloat(l.style.width)&&(l.style.boxShadow="none"),(n=this.renderThumbnailImages&&!this.clientSideRendering?t:e.image)&&(a.onload=function(){for(var e=document.querySelectorAll('img[id*="'+d.pdfViewer.element.id+'_tileimg_"]'),t=d.getElement("_pageDiv_"+s),i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)].id.split("_");parseFloat(n[n.length-3])!==d.getZoomFactor()&&(s!==parseInt(n[n.length-4],10)?(e[parseInt(i.toString(),10)].onload=null,e[parseInt(i.toString(),10)].onerror=null,d.getElement("_pageDiv_"+n[n.length-4])):(e[parseInt(i.toString(),10)].onload=null,e[parseInt(i.toString(),10)].onerror=null,t)).removeChild(e[parseInt(i.toString(),10)])}for(var o,r=document.querySelectorAll('img[id*="'+d.pdfViewer.element.id+'_oldCanvas"]'),i=0;i<r.length;i++)r[parseInt(i.toString(),10)].onload=null,r[parseInt(i.toString(),10)].onerror=null,l.removeChild(r[parseInt(i.toString(),10)]);h.pdfViewer.magnificationModule&&h.pdfViewer.magnificationModule.rerenderCountIncrement(),h.showPageLoadingIndicator(s,!1),0===s&&h.isDocumentLoaded&&(h.renderPDFInformations(),h.isInitialLoaded=!0,o=C.sessionStorageManager.getItem(h.documentId+"_pagedata"),h.pageCount<=100&&h.pdfViewer.fireDocumentLoad(o),h.isDocumentLoaded=!1,!h.pdfViewer.textSearch||(!h.clientSideRendering||h.pdfViewer.thumbnailViewModule||h.pdfViewer.pageOrganizer)&&h.clientSideRendering||h.pdfViewer.textSearchModule.getPDFDocumentTexts()),h.pdfViewer.magnificationModule&&h.pdfViewer.magnificationModule.pushImageObjects(a),a.setAttribute("alt","Page "+(s+1))},a.src=n),this.onPageRender(e,s,l))},C.prototype.updateAnnotationsAndState=function(e,t,i,n){return!!t&&(e.shapeAnnotation=t.shapeAnnotation,e.measureShapeAnnotation=t.measureShapeAnnotation,e.textMarkupAnnotation=t.textMarkupAnnotation,e.freeTextAnnotation=t.freeTextAnnotation,e.stampAnnotations=t.stampAnnotations,e.stickyNotesAnnotation=t.stickyNotesAnnotation,e.signatureInkAnnotation=t.signatureInkAnnotation,n.push(i),!0)},C.prototype.isNeedToRenderAnnotations=function(e,t){return new Set(e.map(function(e){return je(e.pageNumber)?e.pageIndex:e.pageNumber})).has(t)},C.prototype.isFormFieldsNeedtoRender=function(e,t){return e.some(function(e){return e.FormField.pageNumber===t+1})},C.prototype.onPageRender=function(e,t,i){var n=i&&i.getElementsByTagName("a"),i=!1,o=this.isNeedToRenderAnnotations(this.pdfViewer.annotationCollection,t),r=this.isNeedToRenderAnnotations(this.pdfViewer.signatureCollection,t),s=this.isFormFieldsNeedtoRender(this.formFieldCollection,t);if(n&&0!==n.length)for(var a=n.length-1;0<=a;a--)n[parseInt(a.toString(),10)].parentNode.removeChild(n[parseInt(a.toString(),10)]);if((this.pdfViewer.textSearchModule||this.pdfViewer.textSelectionModule||this.pdfViewer.annotationModule)&&this.renderTextContent(e,t),!this.pdfViewer.formFieldsModule||this.pdfViewer.magnificationModule&&this.pdfViewer.magnificationModule.isFormFieldPageZoomed||(this.pdfViewer.viewerBase.existingFieldImport?this.pdfViewer.formFieldsModule.renderFormFields(t,!1):this.pdfViewer.formFieldsModule.renderFormFields(t,!0)),this.pdfViewer.accessibilityTagsModule&&this.pdfViewer.enableAccessibilityTags&&this.isTaggedPdf&&(this.accessibilityTagsCollection[t.toString()]?this.renderAccessibilityTags(t,this.accessibilityTagsCollection[t.toString()]):-1===this.pageRequestListForAccessibilityTags.indexOf(t)&&this.createRequestForAccessibilityTags(t)),this.pdfViewer.formDesignerModule&&!this.isDocumentLoaded&&this.pdfViewer.formDesignerModule.rerenderFormFields(t),!this.pdfViewer.formFieldsModule||this.isDocumentLoaded||this.pdfViewer.formDesignerModule||this.pdfViewer.formFieldsModule.renderFormFields(t,!1),this.pdfViewer.formDesignerModule&&this.isDocumentLoaded&&(!this.pdfViewer.magnificationModule||this.pdfViewer.magnificationModule.isFormFieldPageZoomed)&&this.pdfViewer.formFieldsModule&&(this.pdfViewer.formFieldsModule.renderFormFields(t,!1),this.pdfViewer.magnificationModule)&&(this.pdfViewer.magnificationModule.isFormFieldPageZoomed=!1),this.pdfViewer.enableHyperlink&&this.pdfViewer.linkAnnotationModule&&this.pdfViewer.linkAnnotationModule.renderHyperlinkContent(e,t),this.pdfViewer.textSelectionModule&&!this.isTextSelectionDisabled&&this.pdfViewer.textSelectionModule.applySelectionRangeOnScroll(t),this.documentAnnotationCollections){for(var l,h=!1,d=0;d<this.annotationRenderredList.length;d++)this.annotationRenderredList[parseInt(d.toString(),10)]===t&&(h=!0);(l=this.documentAnnotationCollections[parseInt(t.toString(),10)])&&!h&&(e.shapeAnnotation=l.shapeAnnotation,e.measureShapeAnnotation=l.measureShapeAnnotation,e.textMarkupAnnotation=l.textMarkupAnnotation,e.freeTextAnnotation=l.freeTextAnnotation,e.stampAnnotations=l.stampAnnotations,e.stickyNotesAnnotation=l.stickyNotesAnnotation,e.signatureAnnotation=l.signatureAnnotation,e.signatureInkAnnotation=l.signatureInkAnnotation,this.annotationRenderredList.push(t))}this.isImportAction&&(l=this.checkDocumentCollectionData(t),this.drawPageAnnotations(this.importedAnnotation[parseInt(t.toString(),10)],t),l)&&(e.shapeAnnotation=l.shapeAnnotation,e.measureShapeAnnotation=l.measureShapeAnnotation,e.textMarkupAnnotation=l.textMarkupAnnotation,e.freeTextAnnotation=l.freeTextAnnotation,e.stampAnnotations=l.stampAnnotations,e.stickyNotesAnnotation=l.stickyNotesAnnotation,e.signatureInkAnnotation=l.signatureInkAnnotation,this.annotationRenderredList.push(t),i=!0),this.isImportAction||(h=!1,(l=this.checkDocumentCollectionData(t))&&!h&&(i=this.updateAnnotationsAndState(e,l,t,this.annotationRenderredList)),this.pdfViewer.annotationModule&&(this.isTextMarkupAnnotationModule()||this.isShapeBasedAnnotationsEnabled())&&(this.isStampAnnotationModule()&&(l=e.stampAnnotations,i?this.pdfViewer.annotationModule.stampAnnotationModule.renderStampAnnotations(l,t,null,!0):this.pdfViewer.annotationModule.stampAnnotationModule.renderStampAnnotations(l,t)),i&&(0<e.shapeAnnotation.length||0<e.measureShapeAnnotation.length||0<e.textMarkupAnnotation.length||0<this.pdfViewer.signatureCollection.length&&r||0<this.formFieldCollection.length&&s)?this.pdfViewer.annotationModule.renderAnnotations(t,e.shapeAnnotation,e.measureShapeAnnotation,e.textMarkupAnnotation,null,!0):(!je(e.shapeAnnotation)&&0<e.shapeAnnotation.length||!je(e.measureShapeAnnotation)&&0<e.measureShapeAnnotation.length||!je(e.textMarkupAnnotation)&&0<e.textMarkupAnnotation.length||0<this.pdfViewer.annotationCollection.length&&o)&&this.pdfViewer.annotationModule.renderAnnotations(t,e.shapeAnnotation,e.measureShapeAnnotation,e.textMarkupAnnotation),this.pdfViewer.annotationModule.stickyNotesAnnotationModule.renderStickyNotesAnnotations(e.stickyNotesAnnotation,t)),this.isFreeTextAnnotationModule()&&e.freeTextAnnotation&&0<e.freeTextAnnotation.length&&(i?this.pdfViewer.annotationModule.freeTextAnnotationModule.renderFreeTextAnnotations(e.freeTextAnnotation,t,!0):this.pdfViewer.annotationModule.freeTextAnnotationModule.renderFreeTextAnnotations(e.freeTextAnnotation,t)),this.isInkAnnotationModule()&&e&&e.signatureInkAnnotation&&0<e.signatureInkAnnotation.length&&(this.pdfViewer.isSignatureEditable||(e.signatureInkAnnotation=this.canUpdateSignCollection(e.signatureInkAnnotation)),e.signatureInkAnnotation)&&this.pdfViewer.annotationModule.inkAnnotationModule.renderExistingInkSignature(e.signatureInkAnnotation,t,i)),this.pdfViewer.formDesignerModule&&!this.pdfViewer.annotationModule&&this.pdfViewer.formDesignerModule.updateCanvas(t),this.pdfViewer.textSearchModule&&(this.pdfViewer.textSearchModule.isDocumentTextCollectionReady?this.pdfViewer.textSearchModule.isTextSearch&&0!==this.pdfViewer.textSearchModule.currentOccurrence?this.pdfViewer.textSearchModule.highlightOtherOccurrences(t):this.pdfViewer.textSearchModule.programaticalSearch||this.pdfViewer.textSearchModule.isFiltering||this.pdfViewer.textSearchModule.highlightAfterComplete():this.pdfViewer.textSearchModule.isTextSearchHandled&&0!==this.pdfViewer.textSearchModule.currentOccurrence?this.pdfViewer.textSearchModule.hightlightSearchedTexts(this.pdfViewer.textSearchModule.searchPageIndex,!0):this.pdfViewer.textSearchModule.programaticalSearch||this.pdfViewer.textSearchModule.isFiltering||this.pdfViewer.textSearchModule.hightlightSearchedTexts(void 0,!0,!0)),this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.stickyNotesAnnotationModule.selectCommentsAnnotation(t),e&&e.signatureAnnotation&&0<e.signatureAnnotation.length&&this.signatureModule&&(this.pdfViewer.isSignatureEditable||(e.signatureAnnotation=this.canUpdateSignCollection(e.signatureAnnotation)),e.signatureAnnotation)&&this.signatureModule.renderExistingSignature(e.signatureAnnotation,t,!1),this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.isAnnotationSelected&&this.pdfViewer.annotationModule.annotationPageIndex===t&&"image"!==this.pdfViewer.annotationModule.annotationType&&this.pdfViewer.annotationModule.selectAnnotationFromCodeBehind(),this.isLoadedFormFieldAdded=!1},C.prototype.removeInkFromAnnotCollection=function(e){for(var t=this.pdfViewer.annotationCollection,i=0;i<t.length;i++){var n,o=e.Bounds;"Ink"!==t[parseInt(i.toString(),10)].shapeAnnotationType&&"ink"!==t[parseInt(i.toString(),10)].shapeAnnotationType||(n=t[parseInt(i.toString(),10)].bounds,Math.round(o.X)===Math.round(n.x)&&Math.round(o.Y)===Math.round(n.y)&&Math.round(o.Width)===Math.round(n.width)&&Math.round(o.Height)===Math.round(n.height)&&this.pdfViewer.annotationCollection.splice(i,1))}},C.prototype.canReduse=function(e,t,i){return e===t?i:i-1},C.prototype.isBoundsAreEqual=function(e,t){return Math.round(t.X)===Math.round(e.X)&&Math.round(t.Y)===Math.round(e.Y)&&Math.round(t.Width)===Math.round(e.Width)&&Math.round(t.Height)===Math.round(e.Height)},C.prototype.removeAnnotFromDoc=function(e,t){var i=e.Bounds,e=this.documentAnnotationCollections[parseInt(e.PageNumber.toString(),10)],n=e.signatureInkAnnotation,o=e.signatureAnnotation,r=0!==n.length?n:o;if(0!==n.length&&o.length)for(var s=0;s<n.length;s++)this.isBoundsAreEqual(n[0].Bounds,i)||(r=o);for(var a=0;a<r.length;a++){var l=r.length,h=r[parseInt(a.toString(),10)].Bounds;this.isBoundsAreEqual(h,i)&&(this.removeInkFromAnnotCollection(r[parseInt(a.toString(),10)]),r.splice(a,1),a=this.canReduse(l,r.length,a),t=r)}return t},C.prototype.isGroupedSignatureFields=function(t){var e=this.pdfViewer.retrieveFormFields(),i=!1;return i=je(t)?i:1<e.filter(function(e){return e.name===t}).length},C.prototype.isSignatureWithInRect=function(e,t){e=e[0],t=t[0];var i=e.x+e.width,n=t.x+t.width,o=e.y+e.height,r=t.y+t.height;return e.x-10<=t.x&&n<=i+10&&e.y-10<=t.y&&r<=o+10},C.prototype.canvasRectArray=function(e){var t,i,n,o=[];return e&&(n=je(e.x)?je(e.X)?je(e.left)?e.Left:e.left:e.X:e.x,t=je(e.y)?je(e.Y)?je(e.top)?e.Top:e.top:e.Y:e.y,i=je(e.width)?e.Width:e.width,e=je(e.height)?e.Height:e.height,n=new dvt(n+10,t+10,i-10,e-10),o.push(n)),o},C.prototype.isFormFieldSignature=function(e,t){var i=t;if(!this.pdfViewer.isSignatureEditable)for(var n=this.pdfViewer.retrieveFormFields(),o=0;o<n.length;o++)if("SignatureField"===n[parseInt(o.toString(),10)].type||"InitialField"===n[parseInt(o.toString(),10)].type){var r=n[parseInt(o.toString(),10)].bounds,s=n[parseInt(o.toString(),10)].name;if(this.isSignatureWithInRect(this.canvasRectArray(r),this.canvasRectArray(e.Bounds))&&!this.isGroupedSignatureFields(s)){i=t?this.removeAnnotFromDoc(e,t):this.removeAnnotFromDoc(e);""===n[parseInt(o.toString(),10)].value&&(r=je(e.PageNumber)?e.pageNumber:e.PageNumber,-1===this.modifiedPageIndex.indexOf(r)&&this.modifiedPageIndex.push(r),n[parseInt(o.toString(),10)].value=e.PathData,n[parseInt(o.toString(),10)].signatureType="Draw",s={x:e.Bounds.X,y:e.Bounds.Y,width:e.Bounds.Width,height:e.Bounds.Height},n[parseInt(o.toString(),10)].signatureBounds=s,this.pdfViewer.updateFormFieldsValue(n[parseInt(o.toString(),10)])),this.isInkAnnot=!0;break}}return i},C.prototype.canUpdateSignCollection=function(e){for(var t=0;t<e.length;t++){var i=e.length;e=this.isFormFieldSignature(e[parseInt(t.toString(),10)],e),t=this.canReduse(i,e.length,t)}return e},C.prototype.renderAnnotations=function(l,h,e){return CRt(this,void 0,void 0,function(){var t,i,n,o,r,s,a;return SRt(this,function(e){switch(e.label){case 0:if(t={},this.documentAnnotationCollections){for(i=!1,n=0;n<this.annotationRenderredList.length;n++)this.annotationRenderredList[parseInt(n.toString(),10)]===l&&(i=!0);(o=this.documentAnnotationCollections[parseInt(l.toString(),10)])&&!i&&(t.shapeAnnotation=o.shapeAnnotation,t.measureShapeAnnotation=o.measureShapeAnnotation,t.textMarkupAnnotation=o.textMarkupAnnotation,t.freeTextAnnotation=o.freeTextAnnotation,t.stampAnnotations=o.stampAnnotations,t.stickyNotesAnnotation=o.stickyNotesAnnotation,t.signatureAnnotation=o.signatureAnnotation,t.signatureInkAnnotation=o.signatureInkAnnotation,this.annotationRenderredList.push(l))}if(this.isAnnotationCollectionRemoved&&(t.shapeAnnotation=[],t.measureShapeAnnotation=[],t.textMarkupAnnotation=[],t.freeTextAnnotation=[],t.stampAnnotations=[],t.stickyNotesAnnotation=[],t.signatureInkAnnotation=[]),this.isImportAction){for(i=!1,n=0;n<this.annotationPageList.length;n++)this.annotationPageList[parseInt(n.toString(),10)]===l&&(i=!0);i||this.importedAnnotation&&(this.drawPageAnnotations(this.importedAnnotation,l,!0),this.annotationPageList[this.annotationPageList.length]=l)}if(o=[],je(r=h.annotationOrder))return[3,13];s=0,e.label=1;case 1:if(!(s<r.length))return[3,13];switch(this.isInkAnnot=!1,a=r[parseInt(s.toString(),10)].AnnotType?r[parseInt(s.toString(),10)].AnnotType:r[parseInt(s.toString(),10)].AnnotationType,o.push(r[parseInt(s.toString(),10)]),a){case"textMarkup":return[3,2];case"shape_measure":return[3,3];case"shape":return[3,4];case"sticky":return[3,5];case"stamp":return[3,6];case"Ink":return[3,8];case"Text Box":return[3,9]}return[3,10];case 2:return je(this.pdfViewer.annotationModule.textMarkupAnnotationModule)||this.pdfViewer.annotationModule.textMarkupAnnotationModule.renderTextMarkupAnnotationsInPage(o,l,null,!0),[3,11];case 3:return this.pdfViewer.annotationModule.renderAnnotations(l,null,o,null,null,null,!0),[3,11];case 4:return this.pdfViewer.annotationModule.renderAnnotations(l,o,null,null,null,null,!0),[3,11];case 5:return this.pdfViewer.annotationModule.stickyNotesAnnotationModule.renderStickyNotesAnnotations(o,l),[3,11];case 6:return[4,this.pdfViewer.annotationModule.stampAnnotationModule.renderStampAnnotations(o,l,null,null,!0)];case 7:return e.sent(),[3,11];case 8:return this.pdfViewer.isSignatureEditable||this.isFormFieldSignature(o[0]),this.isInkAnnot||this.pdfViewer.annotationModule.inkAnnotationModule.renderExistingInkSignature(o,l,!1,!0),[3,11];case 9:return this.pdfViewer.annotationModule.freeTextAnnotationModule.renderFreeTextAnnotations(o,l,void 0,!0),[3,11];case 10:return[3,11];case 11:o=[],e.label=12;case 12:return s++,[3,1];case 13:return t&&t.signatureAnnotation&&(this.pdfViewer.isSignatureEditable||(t.signatureAnnotation=this.canUpdateSignCollection(t.signatureAnnotation)),t.signatureAnnotation)&&this.signatureModule.renderExistingSignature(t.signatureAnnotation,l,!1),this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.isAnnotationSelected&&this.pdfViewer.annotationModule.selectAnnotationFromCodeBehind(),[2]}})})},C.prototype.renderTextContent=function(e,t){var i=e.textContent,n=e.textBounds,o=e.rotation,e=e.documentTextCollection?this.checkIsRtlText(e.documentTextCollection[0][parseInt(t.toString(),10)].PageText):this.checkIsRtlText(e.pageText),r=this.getElement("_textLayer_"+t);(r=r||this.textLayer.addTextLayer(t,this.getPageWidth(t),this.getPageHeight(t),this.getElement("_pageDiv_"+t)))&&i&&n&&(r.style.display="block",0===r.childNodes.length?this.textLayer.renderTextContents(t,i,n,o,e):this.textLayer.resizeTextContents(t,i,n,o,!0))},C.prototype.renderAccessibilityTags=function(e,t){this.accessibilityTags.renderAccessibilityTags(e,t)},C.prototype.returnPageListForAccessibilityTags=function(e){var t=[];if(!this.enableAccessibilityMultiPageRequest)return[e];for(var i=e+4<this.pageCount-1?e+4:this.pageCount-1,n=0<e-2?e-2:0;n<=i;n++)void 0===this.accessibilityTagsCollection[parseInt(n.toString(),10)]?t.push(parseInt(n.toString(),10)):i=i+1<this.pageCount-1?i+1:this.pageCount-1;return this.pageRequestListForAccessibilityTags=t},C.prototype.createRequestForAccessibilityTags=function(o){var r=this,e={action:"RenderTaggedContent",elementId:this.pdfViewer.element.id,hashId:this.hashId,uniqueId:this.documentId,pageList:JSON.stringify(this.returnPageListForAccessibilityTags(o))},t=(this.jsonDocumentId&&(e.document=this.jsonDocumentId),this.pdfViewer.serviceUrl+"/RenderTaggedContent");this.accessibilityTagsHandler=new DRt(this.pdfViewer),this.accessibilityTagsHandler.url=t,this.accessibilityTagsHandler.mode=!0,this.accessibilityTagsHandler.responseType="text",this.accessibilityTagsHandler.send(e),this.accessibilityTagsHandler.onSuccess=function(e){for(var t,i=JSON.parse(e.data),n=0;n<i.length;n++)t=i[parseInt(n.toString(),10)],r.accessibilityTagsCollection[t[0]]=t[1];r.pageRequestListForAccessibilityTags=[],r.accessibilityTagsCollection[parseInt(o.toString(),10)]&&r.renderAccessibilityTags(o,r.accessibilityTagsCollection[parseInt(o.toString(),10)]),r.accessibilityTagsCollection[o-1<=0?parseInt((o-1).toString(),10):0]&&r.renderAccessibilityTags(o-1<=0?o-1:0,r.accessibilityTagsCollection[o-1<=0?parseInt((o-1).toString(),10):0])}},C.prototype.renderPageContainer=function(e,t,i,n){var o=Q("div",{id:this.pdfViewer.element.id+"_pageDiv_"+e,className:"e-pv-page-div",attrs:{tabindex:"-1"}});F.isDevice&&!this.pdfViewer.enableDesktopMode&&o.classList.add("e-pv-text-selection-none"),o.style.width=t+"px",o.style.height=i+"px",this.pdfViewer.enableRtl?o.style.right=this.updateLeftPosition(e)+"px":o.style.left=this.updateLeftPosition(e)+"px",o.style.top=n+"px",this.pageContainer.appendChild(o),this.pageContainer.style.width=this.isMixedSizeDocument&&this.highestWidth*this.getZoomFactor()>this.viewerContainer.clientWidth?this.highestWidth*this.getZoomFactor()+"px":this.viewerContainer.clientWidth+"px",this.createWaitingPopup(e),this.orderPageDivElements(o,e),this.renderPageCanvas(o,t,i,e,"block"),!F.isDevice||this.pdfViewer.enableDesktopMode||this.isThumb||this.updateMobileScrollerPosition()},C.prototype.renderPDFInformations=function(){!this.pdfViewer.thumbnailViewModule||F.isDevice&&!this.pdfViewer.enableDesktopMode?!je(this.pdfViewer.pageOrganizer)&&this.pdfViewer.enablePageOrganizer&&this.pdfViewer.pageOrganizer.createRequestForPreview():this.pdfViewer.thumbnailViewModule.createRequestForThumbnails(),this.pdfViewer.bookmarkViewModule&&this.pdfViewer.bookmarkViewModule.createRequestForBookmarks(),this.pdfViewer.annotationModule&&(this.pdfViewer.toolbarModule&&this.pdfViewer.annotationModule.stickyNotesAnnotationModule.initializeAcccordionContainer(),this.pdfViewer.isCommandPanelOpen&&this.pdfViewer.annotation.showCommentsPanel(),this.pdfViewer.annotationModule.stickyNotesAnnotationModule.createRequestForComments())},C.prototype.orderPageDivElements=function(e,t){t=this.getElement("_pageDiv_"+(t+1));this.pageContainer&&e&&(t?this.pageContainer.insertBefore(e,t):this.pageContainer.appendChild(e))},C.prototype.renderPageCanvas=function(e,t,i,n,o){var r;if(e)return(r=this.getElement("_pageCanvas_"+n))?(r.width=t,r.height=i,r.style.display="block",this.isMixedSizeDocument&&0<this.highestWidth&&(r.style.marginLeft="auto",r.style.marginRight="auto")):((r=Q("img",{id:this.pdfViewer.element.id+"_pageCanvas_"+n,className:"e-pv-page-canvas"})).width=t,r.height=i,r.style.display=o,r.style.userSelect="none",this.isMixedSizeDocument&&0<this.highestWidth&&(r.style.marginLeft="auto",r.style.marginRight="auto"),e.appendChild(r)),r.setAttribute("alt",""),(this.pdfViewer.textSearchModule||this.pdfViewer.textSelectionModule||this.pdfViewer.formFieldsModule||this.pdfViewer.annotationModule)&&this.textLayer.addTextLayer(n,t,i,e),r},C.prototype.applyElementStyles=function(e,t){var i;this.isMixedSizeDocument&&e&&(i=document.getElementById(this.pdfViewer.element.id+"_pageCanvas_"+t),t=document.getElementById(this.pdfViewer.element.id+"_oldCanvas_"+t),e&&i&&0<i.offsetLeft?(e.style.marginLeft=i.offsetLeft+"px",e.style.marginRight=i.offsetLeft+"px"):t&&0<t.offsetLeft?(e.style.marginLeft=t.offsetLeft+"px",e.style.marginRight=t.offsetLeft+"px"):(e.style.marginLeft="auto",e.style.marginRight="auto"))},C.prototype.updateLeftPosition=function(e){var t,i,n=this.viewerContainer.getBoundingClientRect().width;return 0===n&&(n=parseFloat(this.pdfViewer.width.toString())),this.isMixedSizeDocument&&0<this.highestWidth?(t=0<this.viewerContainer.clientWidth?(this.viewerContainer.clientWidth-this.highestWidth*this.getZoomFactor())/2:(n-this.highestWidth*this.getZoomFactor())/2,i=(this.highestWidth*this.getZoomFactor()-this.getPageWidth(e))/2,0<t?t+=i:t=i,this.pageContainer.style.width=this.highestWidth*this.getZoomFactor()>this.viewerContainer.clientWidth?this.highestWidth*this.getZoomFactor()+"px":this.viewerContainer.clientWidth+"px"):t=0<this.viewerContainer.clientWidth?(this.viewerContainer.clientWidth-this.getPageWidth(e))/2:(n-this.getPageWidth(e))/2,this.pageSize[parseInt(e.toString(),10)].width,this.pageSize[parseInt(e.toString(),10)].height,(t<0||this.pdfViewer.magnificationModule&&(this.pdfViewer.magnificationModule.isAutoZoom&&this.getZoomFactor()<1||"fitToWidth"===this.pdfViewer.magnificationModule.fitType))&&0<(t=0<(i=t)&&F.isDevice&&!this.pdfViewer.enableDesktopMode?i:this.pageLeft)&&this.isMixedSizeDocument&&0<i&&(t=i),this.viewerContainer.clientHeight>=this.viewerContainer.scrollHeight&&0<this.previousScrollbarWidth&&(n=this.navigationPane.getViewerContainerScrollbarWidth(),t-=(this.previousScrollbarWidth-n)/2),t},C.prototype.applyLeftPosition=function(e){var t,i;this.pageSize[parseInt(e.toString(),10)]&&(this.isMixedSizeDocument&&0<this.highestWidth?(t=0<this.viewerContainer.clientWidth?(this.viewerContainer.clientWidth-this.highestWidth*this.getZoomFactor())/2:(this.viewerContainer.getBoundingClientRect().width-this.highestWidth*this.getZoomFactor())/2,i=(this.highestWidth*this.getZoomFactor()-this.getPageWidth(e))/2,0<t?t+=i:t=i):t=0<this.viewerContainer.clientWidth?(this.viewerContainer.clientWidth-this.pageSize[parseInt(e.toString(),10)].width*this.getZoomFactor())/2:(this.viewerContainer.getBoundingClientRect().width-this.pageSize[parseInt(e.toString(),10)].width*this.getZoomFactor())/2,this.pageSize[parseInt(e.toString(),10)].width,this.pageSize[parseInt(e.toString(),10)].height,(t<0||this.pdfViewer.magnificationModule&&(this.pdfViewer.magnificationModule.isAutoZoom&&this.getZoomFactor()<1||"fitToWidth"===this.pdfViewer.magnificationModule.fitType))&&(i=t,t=this.pageLeft,0<i)&&this.isMixedSizeDocument&&(t=i),i=document.getElementById(this.pdfViewer.element.id+"_pageDiv_"+e))&&(this.pdfViewer.enableRtl?i.style.right=t+"px":i.style.left=t+"px")},C.prototype.updatePageHeight=function(e,t){return(e-t)/e*100+"%"},C.prototype.getPageNumberFromClientPoint=function(e){for(var t=e.x+this.viewerContainer.scrollLeft,i=e.y+this.viewerContainer.scrollTop,n=0;n<this.pageCount;n++){var o=this.pageSize[parseInt(n.toString(),10)].height+this.viewerContainer.scrollTop;if(i<this.pageSize[parseInt(n.toString(),10)].top+o){var r=this.getElement("_pageViewContainer").getBoundingClientRect(),r=(r.width-this.pageSize[parseInt(n.toString(),10)].width)/2+r.x,s=0,s=i>this.pageSize[parseInt(n.toString(),10)].top?i-this.pageSize[parseInt(n.toString(),10)].top:this.pageSize[parseInt(n.toString(),10)].top-i;if(0<s&&null!=this.pageSize[parseInt(n.toString(),10)]){this.getPageHeight(n);if(0<=r&&(t<r||t>r+this.pageSize[parseInt(n.toString(),10)].width))return-1;if(s<=this.getPageTop(n)+o)return n+1}}}return-1},C.prototype.convertClientPointToPagePoint=function(e,t){var i;return-1!==t?(i=((i=this.getElement("_pageViewContainer").getBoundingClientRect()).width-this.pageSize[t-1].width)/2+i.x,{x:e.x+this.viewerContainer.scrollLeft-i,y:e.y+this.viewerContainer.scrollTop-this.pageSize[t-1].top}):null},C.prototype.convertPagePointToClientPoint=function(e,t){var i;return-1!==t?(i=((i=this.getElement("_pageViewContainer").getBoundingClientRect()).width-this.pageSize[t-1].width)/2+i.x,{x:e.x+i,y:e.y+this.pageSize[t-1].top}):null},C.prototype.convertPagePointToScrollingPoint=function(e,t){return-1!==t?{x:e.x+this.viewerContainer.scrollLeft,y:e.y+this.viewerContainer.scrollTop}:null},C.prototype.initiatePageViewScrollChanged=function(){this.scrollHoldTimer&&clearTimeout(this.scrollHoldTimer),this.scrollHoldTimer=null,this.scrollPosition*this.getZoomFactor()!==this.viewerContainer.scrollTop&&(this.scrollPosition=this.viewerContainer.scrollTop,this.pageViewScrollChanged(this.currentPageNumber))},C.prototype.renderCountIncrement=function(){this.pdfViewer.magnificationModule&&this.pdfViewer.magnificationModule.renderCountIncrement()},C.prototype.pageViewScrollChanged=function(e){this.isPanMode&&-1!==this.renderedPagesList.indexOf(e-1)||(this.reRenderedCount=0);var t=e-1;if(e!==this.previousPage&&e<=this.pageCount&&(i=!1,this.clientSideRendering?this.getLinkInformation(t):this.getStoredData(t),this.isDataExits&&!this.getStoredData(t)&&(i=!0),-1!==this.renderedPagesList.indexOf(t)||this.getMagnified()||i||this.isScrollerMoving||(this.renderCountIncrement(),this.createRequestForRender(t))),!this.getMagnified()&&!this.getPagesPinchZoomed()){var e=t-1,i=!1,n=this.getElement("_pageCanvas_"+e),o=(this.clientSideRendering?this.getLinkInformation(e):this.getStoredData(e),this.isDataExits&&!this.getStoredData(e)&&(i=!0),null===n||i||-1!==this.renderedPagesList.indexOf(e)||this.getMagnified()||this.isScrollerMoving||(this.renderCountIncrement(),this.createRequestForRender(e)),this.isMinimumZoom&&this.renderPreviousPagesInScroll(e),1+t),r=0;if(o<this.pageCount){r=this.getPageHeight(o);if((this.isMinimumZoom||-1===this.renderedPagesList.indexOf(o))&&!this.getMagnified()&&r)if(this.isDocumentLoaded&&this.pdfViewer.initialRenderPages>this.pageRenderCount&&this.getPageHeight(this.pdfViewer.initialRenderPages-1)+this.getPageTop(this.pdfViewer.initialRenderPages-1)>this.viewerContainer.clientHeight)for(var s=this.pdfViewer.initialRenderPages<=this.pageCount?this.pdfViewer.initialRenderPages:this.pageCount,a=1;a<s;a++)this.createRequestForRender(a);else if(!this.isScrollerMoving)for(this.createRequestForRender(o),this.renderCountIncrement();this.viewerContainer.clientHeight>r&&(o+=1)<this.pageCount;)this.renderPageElement(o),this.createRequestForRender(o),r+=this.getPageHeight(o),this.renderCountIncrement()}}},C.prototype.renderPreviousPagesInScroll=function(e){var e=e-1,t=e-1;0<e&&(-1!==this.renderedPagesList.indexOf(e)||this.getMagnified()||(this.createRequestForRender(e),this.renderCountIncrement()),0<t)&&(-1!==this.renderedPagesList.indexOf(t)||this.getMagnified()||(this.createRequestForRender(t),this.renderCountIncrement()))},C.prototype.downloadDocument=function(e){e=(URL||webkitURL).createObjectURL(e);var t,i=Q("a");i.click?(i.href=e,i.target="_parent","download"in i&&(je(this.downloadFileName)?i.download="Default.pdf":this.downloadFileName.endsWith(".pdf")?i.download=this.downloadFileName:(t=this.downloadFileName.split(".pdf")[0]+".pdf",i.download=t)),(document.body||document.documentElement).appendChild(i),i.click(),i.parentNode.removeChild(i)):(window.top===window&&e.split("#")[0]===window.location.href.split("#")[0]&&(t=-1===e.indexOf("?")?"?":"&",e=e.replace(/#|$/,t+"$&")),window.open(e,"_parent"))},C.prototype.downloadExportFormat=function(e,t,i,n){var o="Json"===t||"Json"===i,t=o?".json":"Fdf"===i?".fdf":"Xml"===i?".xml":"Xfdf"===t||"Xfdf"===i?".xfdf":null;je(t)||(e=(URL||webkitURL).createObjectURL(e),(i=Q("a")).click?(i.href=e,i.target="_parent","download"in i&&(null!==this.pdfViewer.exportAnnotationFileName?i.download=this.pdfViewer.exportAnnotationFileName.split(".")[0]+t:i.download=this.pdfViewer.fileName.split(".")[0]+t),(document.body||document.documentElement).appendChild(i),i.click(),i.parentNode.removeChild(i),n?this.pdfViewer.fireFormExportSuccess(e,i.download):this.pdfViewer.fireExportSuccess(e,i.download)):o&&(window.top===window&&e.split("#")[0]===window.location.href.split("#")[0]&&(i=-1===e.indexOf("?")?"?":"&",e=e.replace(/#|$/,i+"$&")),window.open(e,"_parent"),n?this.pdfViewer.fireFormExportSuccess(e,this.pdfViewer.fileName.split(".")[0]+t):this.pdfViewer.fireExportSuccess(e,this.pdfViewer.fileName.split(".")[0]+t)))},C.prototype.exportFormFields=function(e,t){this.createRequestForExportFormfields(!1,t,e)},C.prototype.importFormFields=function(e,t){this.createRequestForImportingFormfields(e,t)},C.prototype.createRequestForExportFormfields=function(r,s,a){var l=this,h=this,e=new Promise(function(i,e){var t,n=h.createFormfieldsJsonData(),o=!1;"Json"!==s&&"Fdf"!==s&&"Xfdf"!==s&&"Xml"!==s||(n.formFieldDataFormat=s,o=h.pdfViewer.fireFormExportStarted(n)),o&&(n.action="ExportFormFields",n.hashId=h.hashId,n.fileName=h.pdfViewer.fileName,a&&""!==a&&!r&&(n.filePath=a),n.elementId=l.pdfViewer.element.id,h.jsonDocumentId&&(n.document=h.jsonDocumentId),o=l.getFormFieldsPageList(n.formDesigner),n.formFieldsPageList=JSON.stringify(o),n.isFormFieldAnnotationsExist=l.isAnnotationsExist(n.formDesigner)||l.isFieldsDataExist(n.fieldsData)||0<o.length,o=h.pdfViewer.serviceUrl+"/"+h.pdfViewer.serverActionSettings.exportFormFields,h.exportFormFieldsRequestHandler=new DRt(l.pdfViewer),h.exportFormFieldsRequestHandler.url=o,h.exportFormFieldsRequestHandler.mode=!0,h.exportFormFieldsRequestHandler.responseType="text",h.validateForm&&h.pdfViewer.enableFormFieldsValidation?(h.pdfViewer.fireValidatedFailed(h.pdfViewer.serverActionSettings.download),h.validateForm=!1):h.clientSideRendering?(o=h.pdfViewer.pdfRendererModule.exportFormFields(n,r),t=new TextDecoder("utf-8").decode(o),r?(t=l.getDataOnSuccess(t),i(t)):h.exportFileDownload(o,h,s,n,r)):h.exportFormFieldsRequestHandler.send(n),h.exportFormFieldsRequestHandler.onSuccess=function(e){var t,e=e.data;h.checkRedirection(e)||e&&(r?(t=h.exportFileDownload(e,h,s,n,r),i(t)):h.exportFileDownload(e,h,s,n,r))},h.exportFormFieldsRequestHandler.onFailure=function(e){h.pdfViewer.fireFormExportFailed(n.pdfAnnotation,e.statusText)},h.exportFormFieldsRequestHandler.onError=function(e){h.pdfViewer.fireFormExportFailed(n.pdfAnnotation,e.statusText)})});return!r||e},C.prototype.exportFileDownload=function(t,i,n,o,r){return this.clientSideRendering?new Promise(function(e){t&&(i.clientSideRendering||i.pdfViewer.fireAjaxRequestSuccess(i.pdfViewer.serverActionSettings.exportFormFields,t),r?(e(e=decodeURIComponent(escape(atob(t.split(",")[1])))),i.pdfViewer.fireFormExportSuccess(e,i.pdfViewer.fileName)):t&&"string"!=typeof t&&(e=new Blob([t],{type:"application/json"}),F.isIE||"edge"===F.info.name?window.navigator.msSaveOrOpenBlob(e,i.pdfViewer.fileName.split(".")[0]+".json"):"Json"!==o.formFieldDataFormat&&"Fdf"!==o.formFieldDataFormat&&"Xfdf"!==o.formFieldDataFormat&&"Xml"!==o.formFieldDataFormat||i.downloadExportFormat(e,null,n,!0)))}):new Promise(function(e){t&&(i.clientSideRendering||i.pdfViewer.fireAjaxRequestSuccess(i.pdfViewer.serverActionSettings.exportFormFields,t),r?(e(e=decodeURIComponent(escape(atob(t.split(",")[1])))),i.pdfViewer.fireFormExportSuccess(e,i.pdfViewer.fileName)):t.split("base64,")[1]&&(e=i.createBlobUrl(t.split("base64,")[1],"application/json"),F.isIE||"edge"===F.info.name?window.navigator.msSaveOrOpenBlob(e,i.pdfViewer.fileName.split(".")[0]+".json"):"Json"!==o.formFieldDataFormat&&"Fdf"!==o.formFieldDataFormat&&"Xfdf"!==o.formFieldDataFormat&&"Xml"!==o.formFieldDataFormat||i.downloadExportFormat(e,null,n,!0)))})},C.prototype.getLastIndexValue=function(e,t){return e.slice(e.lastIndexOf(t)+1)},C.prototype.createRequestForImportingFormfields=function(n,e){var o=this,t={},i=this.getLastIndexValue(n,"."),i=("object"==typeof n||"json"!==i&&"fdf"!==i&&"xfdf"!==i&&"xml"!==i?(t.formFieldDataFormat=e,t.data="Json"===e?JSON.stringify(n):n):(t.data=n,t.fileName=o.pdfViewer.fileName,t.formFieldDataFormat=e),o.pdfViewer.fireFormImportStarted(n),t.hashId=o.hashId,t.elementId=this.pdfViewer.element.id,o.jsonDocumentId&&(t.document=o.jsonDocumentId),(t=Object.assign(t,this.constructJsonDownload())).action="ImportFormFields",o.pdfViewer.serviceUrl+"/"+o.pdfViewer.serverActionSettings.importFormFields);o.importFormFieldsRequestHandler=new DRt(this.pdfViewer),o.importFormFieldsRequestHandler.url=i,o.importFormFieldsRequestHandler.mode=!0,o.importFormFieldsRequestHandler.responseType="text",o.clientSideRendering?(e=o.pdfViewer.pdfRendererModule.importFormFields(t),this.importClientSideFormFields(e,n)):o.importFormFieldsRequestHandler.send(t),o.importFormFieldsRequestHandler.onSuccess=function(e){var t=e.data;if(!o.checkRedirection(t))if(t&&"null"!==t){if("object"!=typeof t)try{"object"!=typeof(t=JSON.parse(t))&&(o.onControlError(500,t,o.pdfViewer.serverActionSettings.importFormFields),o.pdfViewer.fireFormImportFailed(n,e.statusText),t=null)}catch(e){o.pdfViewer.fireFormImportFailed(n,o.pdfViewer.localeObj.getConstant("File not found")),N?this.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_FileNotFound").then(function(e){o.openImportExportNotificationPopup(e)}):o.openImportExportNotificationPopup(o.pdfViewer.localeObj.getConstant("File not found")),o.onControlError(500,t,o.pdfViewer.serverActionSettings.importFormFields),t=null}o.pdfViewer.fireAjaxRequestSuccess(o.pdfViewer.serverActionSettings.importFormFields,t),o.pdfViewer.fireFormImportSuccess(n),C.sessionStorageManager.removeItem(this.documentId+"_formfields"),this.pdfViewer.formFieldsModule&&this.pdfViewer.formFieldsModule.removeExistingFormFields(),C.sessionStorageManager.removeItem(this.documentId+"_formDesigner"),o.saveFormfieldsData(t);for(var i=0;i<o.renderedPagesList.length;i++)this.pdfViewer.formFieldsModule&&this.pdfViewer.formFieldsModule.renderFormFields(o.renderedPagesList[parseInt(i.toString(),10)],!0)}else o.pdfViewer.fireFormImportFailed(n,e.statusText),N?this.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_FileNotFound").then(function(e){o.openImportExportNotificationPopup(e)}):o.openImportExportNotificationPopup(o.pdfViewer.localeObj.getConstant("File not found"))},o.importFormFieldsRequestHandler.onFailure=function(e){o.pdfViewer.fireFormImportFailed(n,e.statusText)},o.importFormFieldsRequestHandler.onError=function(e){o.pdfViewer.fireFormImportFailed(n,e.statusText)}},C.prototype.importClientSideFormFields=function(e,t){if(je(e))this.pdfViewer.fireFormImportFailed(t,null),this.openImportExportNotificationPopup(this.pdfViewer.localeObj.getConstant("File not found"));else{this.pdfViewer.fireFormImportSuccess(t),this.pdfViewer.viewerBase.existingFieldImport=!1,C.sessionStorageManager.removeItem(this.documentId+"_formfields"),this.pdfViewer.formFieldsModule&&this.pdfViewer.formFieldsModule.removeExistingFormFields(),C.sessionStorageManager.removeItem(this.documentId+"_formDesigner"),this.saveFormfieldsData(e);for(var i=0;i<this.renderedPagesList.length;i++)this.pdfViewer.formFieldsModule&&this.pdfViewer.formFieldsModule.renderFormFields(this.renderedPagesList[parseInt(i.toString(),10)],!0)}},C.prototype.createFormfieldsJsonData=function(){var e,t={};return this.pdfViewer.formDesignerModule?(e=this.pdfViewer.formDesignerModule.downloadFormDesigner(),t.formDesigner=e):this.pdfViewer.formFieldsModule&&(e=this.pdfViewer.formFieldsModule.downloadFormFieldsData(),t.fieldsData=e),t},C.prototype.constructJsonDownload=function(){var e,t={hashId:this.hashId},i=(this.jsonDocumentId&&(t.documentId=this.jsonDocumentId),t.uniqueId=this.documentId,this.importPageList=[],this.pdfViewer.annotationModule&&this.saveImportedAnnotations(),this.isTextMarkupAnnotationModule()&&(this.isJsonExported=!1,i=this.pdfViewer.annotationModule.textMarkupAnnotationModule.saveTextMarkupAnnotations(),t.textMarkupAnnotations=i),this.isShapeAnnotationModule()&&(this.isJsonExported=!1,i=this.pdfViewer.annotationModule.shapeAnnotationModule.saveShapeAnnotations(),t.shapeAnnotations=i),this.isCalibrateAnnotationModule()&&(this.isJsonExported=!1,i=this.pdfViewer.annotationModule.measureAnnotationModule.saveMeasureShapeAnnotations(),t.measureShapeAnnotations=i),this.isStampAnnotationModule()&&(i=this.pdfViewer.annotationModule.stampAnnotationModule.saveStampAnnotations(),t.stampAnnotations=i),this.isCommentAnnotationModule()&&(i=this.pdfViewer.annotationModule.stickyNotesAnnotationModule.saveStickyAnnotations(),t.stickyNotesAnnotation=i),this.isImportAction&&(i=JSON.stringify(this.importPageList),t.importPageList=i),this.pdfViewer.formDesignerModule&&(e=this.pdfViewer.formDesignerModule.downloadFormDesigner(),t.formDesigner=e),this.pdfViewer.formFieldsModule&&je(t.formDesigner)&&(e=this.pdfViewer.formFieldsModule.downloadFormFieldsData(),t.fieldsData=e),this.signatureModule.saveSignature());return t.signatureData=i,this.pdfViewer.isSignatureEditable&&(t.isSignatureEdited=this.pdfViewer.isSignatureEditable),this.isFreeTextAnnotationModule()&&(e=this.pdfViewer.annotationModule.freeTextAnnotationModule.saveFreeTextAnnotations(),t.freeTextAnnotation=e),this.isInkAnnotationModule()&&(i=this.pdfViewer.annotationModule.inkAnnotationModule.saveInkSignature(),t.inkSignatureData=i),t.action="Download",t.elementId=this.pdfViewer.element.id,this.pdfViewer.annotationModule&&(e=this.getAnnotationsPageList(),t.isAnnotationsExist=this.isAnnotationsExist(t.textMarkupAnnotations)||this.isAnnotationsExist(t.shapeAnnotations)||this.isAnnotationsExist(t.measureShapeAnnotations)||this.isAnnotationsExist(t.stampAnnotations)||this.isAnnotationsExist(t.stickyNotesAnnotation)||this.isAnnotationsExist(t.signatureData)||this.isAnnotationsExist(t.freeTextAnnotation)||this.isAnnotationsExist(t.inkSignatureData)||0<e.length,t.annotationsPageList=JSON.stringify(e)),(this.pdfViewer.formDesignerModule||this.pdfViewer.formFieldsModule)&&(i=this.getFormFieldsPageList(t.formDesigner),t.isFormFieldAnnotationsExist=this.isAnnotationsExist(t.formDesigner)||this.isFieldsDataExist(t.fieldsData)||0<i.length,t.formFieldsPageList=JSON.stringify(i)),this.pdfViewer.annotationCollection&&(t.annotationCollection=JSON.stringify(this.pdfViewer.annotationCollection)),t},C.prototype.isAnnotationsExist=function(e){return!je(e)&&0<JSON.parse(e).flat(1).length},C.prototype.isFieldsDataExist=function(e){return!je(e)&&0!==Object.entries(JSON.parse(e)).length},C.prototype.getAnnotationsPageList=function(){var e=this.pdfViewer.annotationCollection.map(function(e){return e.pageNumber}),t=this.pdfViewer.annotationModule.actionCollection.filter(function(e){return"formFields"!==e.annotation.propName&&je(e.annotation.formFieldAnnotationType)}).map(function(e){return e.pageIndex});return e.concat(t,this.modifiedPageIndex).filter(function(e,t,i){return i.indexOf(e)===t&&void 0!==e})},C.prototype.getFormFieldsPageList=function(e){var t,i=this.pdfViewer.formFieldCollection.map(function(e){return je(e.properties)?e.pageNumber+1:e.properties.pageNumber}),n=je(this.pdfViewer.annotationModule)?[]:this.pdfViewer.annotationModule.actionCollection.filter(function(e){return"formFields"===e.annotation.propName||!je(e.annotation.formFieldAnnotationType)}).map(function(e){return e.pageIndex}),i=i.concat(n);return je(e)||(t=JSON.parse(e).map(function(e){return e.FormField.pageNumber})),i.concat(t).filter(function(e,t,i){return i.indexOf(e)===t&&!je(e)})},C.prototype.checkFormFieldCollection=function(e){var t,i=!1;if(t=this.getItemFromSessionStorage("_formDesigner"))for(var n=JSON.parse(t),o=0;o<n.length;o++)if("RadioButton"===n[parseInt(o.toString(),10)].FormField.formFieldAnnotationType){for(var r=0;r<n[parseInt(o.toString(),10)].FormField.radiobuttonItem.length;r++)if(e===n[parseInt(o.toString(),10)].FormField.radiobuttonItem[parseInt(r.toString(),10)].id.split("_")[0]){i=!0;break}}else if(n[parseInt(o.toString(),10)].Key.split("_")[0]===e){i=!0;break}return i},C.prototype.isFreeTextAnnotationModule=function(){return!!this.pdfViewer.annotation&&!(!this.pdfViewer.annotation||!this.pdfViewer.annotation.freeTextAnnotationModule)},C.prototype.createRequestForDownload=function(){var t,e,i;(t=this).pdfViewer.fireDownloadStart(t.downloadFileName)&&(e=this.constructJsonDownload(),(t.clientSideRendering?t.isDigitalSignaturePresent:t.digitalSignaturePages&&0!==t.digitalSignaturePages.length)&&(t.pdfViewer.isDocumentEdited?e.digitalSignatureDocumentEdited=!0:e.digitalSignatureDocumentEdited=!1),t.pdfViewer.isDocumentEdited||!je(t.pdfViewer.pageOrganizer)&&t.pdfViewer.pageOrganizer.isDocumentModified?e.isPdfEdited=!0:e.isPdfEdited=!1,je(this.pdfViewer.pageOrganizer)||je(this.pdfViewer.pageOrganizer.organizePagesCollection)||!this.pdfViewer.pageOrganizer.isDocumentModified||(e.organizePages=JSON.stringify(this.pdfViewer.pageOrganizer.organizePagesCollection)),this.dowonloadRequestHandler=new DRt(this.pdfViewer),this.dowonloadRequestHandler.url=t.pdfViewer.serviceUrl+"/"+t.pdfViewer.serverActionSettings.download,this.dowonloadRequestHandler.responseType="text",this.validateForm&&this.pdfViewer.enableFormFieldsValidation?(this.pdfViewer.fireValidatedFailed(t.pdfViewer.serverActionSettings.download),this.validateForm=!1):this.clientSideRendering?(i=this.pdfViewer.pdfRendererModule.getDocumentAsBase64(e),this.fileDownload(i,this)):this.dowonloadRequestHandler.send(e),this.dowonloadRequestHandler.onSuccess=function(e){e=e.data;t.checkRedirection(e)||(e?t.fileDownload(e,t):t.pdfViewer.fireDownloadEnd(t.downloadFileName,"PDF Document saved in server side successfully"))},this.dowonloadRequestHandler.onFailure=function(e){t.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,t.pdfViewer.serverActionSettings.download)},this.dowonloadRequestHandler.onError=function(e){t.openNotificationPopup(),t.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,t.pdfViewer.serverActionSettings.download)})},C.prototype.fileDownload=function(e,t,i){var n;void 0===i&&(i=!1),this.clientSideRendering?e&&("object"!=typeof e&&(t.onControlError(500,e,t.pdfViewer.serverActionSettings.download),e=null),e&&(t.pdfViewer.downloadFileName&&t.pdfViewer.downloadFileName!==t.downloadFileName&&(t.downloadFileName=t.pdfViewer.downloadFileName),this.pdfViewer.enableHtmlSanitizer&&t.pdfViewer.downloadFileName&&(t.pdfViewer.downloadFileName=go.sanitize(t.pdfViewer.downloadFileName)),t.clientSideRendering&&!i&&t.pdfViewer.fireAjaxRequestSuccess(t.pdfViewer.serverActionSettings.download,e),n=new Blob([e],{type:"application/pdf"}),F.isIE||"edge"===F.info.name?window.navigator.msSaveOrOpenBlob(n,t.downloadFileName):t.downloadDocument(n),i||t.pdfViewer.fireDownloadEnd(t.downloadFileName,e)),i||t.updateDocumentAnnotationCollections()):e&&("object"!=typeof e&&-1===e.indexOf("data:application/pdf")&&(t.onControlError(500,e,t.pdfViewer.serverActionSettings.download),e=null),(e="object"==typeof e?JSON.parse(e):e)&&(t.pdfViewer.downloadFileName&&t.pdfViewer.downloadFileName!==t.downloadFileName&&(t.downloadFileName=t.pdfViewer.downloadFileName),this.pdfViewer.enableHtmlSanitizer&&t.pdfViewer.downloadFileName&&(t.pdfViewer.downloadFileName=go.sanitize(t.pdfViewer.downloadFileName)),t.clientSideRendering&&!i&&t.pdfViewer.fireAjaxRequestSuccess(t.pdfViewer.serverActionSettings.download,e),n=t.createBlobUrl(e.split("base64,")[1],"application/pdf"),F.isIE||"edge"===F.info.name?window.navigator.msSaveOrOpenBlob(n,t.downloadFileName):t.downloadDocument(n),i||t.pdfViewer.fireDownloadEnd(t.downloadFileName,e)),i||t.updateDocumentAnnotationCollections())},C.prototype.getTileCount=function(e,t){var i;return e&&"number"==typeof e&&(i=1,i=2<this.getZoomFactor()&&e<=1200?2:e/816,!((e=Math.ceil(i))<=0))&&this.pdfViewer.tileRenderingSettings.enableTileRendering?e:1},C.prototype.createRequestForRender=function(e){var t,i,A,n=(A=this).getElement("_pageCanvas_"+e),o=A.getElement("_oldCanvas_"+e);if(this.pageSize&&this.pageSize[parseInt(e.toString(),10)]){var x=this.pageSize[parseInt(e.toString(),10)].width,r=this.pageSize[parseInt(e.toString(),10)].height,I=(this.getElement("_pageCanvas_"+e),1200),s=0<A.pdfViewer.element.clientHeight?A.pdfViewer.element.clientHeight:A.pdfViewer.element.style.height,a=(I=parseInt(I,10),s=parseInt(s,10)?parseInt(s,10):500,void 0),l=void 0,h=void 0,d=new Object,p=document.getElementById(this.pdfViewer.element.id+"_thumbnail_Selection_Ring_"+e),c=(this.isMinimumZoom&&p&&p.children[0]&&!je(p.children[0].src)&&""!==p.children[0].src?(this.renderThumbnailImages=!0,h=p.children[0].src):this.renderThumbnailImages=!1,this.getTileCount(x,r));if(n){isNaN(parseFloat(n.style.width))&&!o||A.isInitialLoaded&&A.showPageLoadingIndicator(e,!1);var u=A.getStoredData(e),a=l=c,p=A.pdfViewer.tileRenderingSettings,r=(p.enableTileRendering&&0<p.x&&0<p.y&&(I<x||2<this.getZoomFactor())&&(a=p.x,l=p.y),A.tileRequestCount=a*l,this.retrieveCurrentZoomFactor()),o=void 0;if(1===c?(u=A.getStoredData(e),o=A.pageRequestSent(e,0,0)):(p=JSON.parse(A.getWindowSessionStorageTile(e,0,0,r)),1<c&&(u=p)),u&&u.uniqueId===A.documentId&&(u.image||this.isMinimumZoom)){if(n.style.backgroundColor="#fff",A.pdfViewer.magnification&&A.pdfViewer.magnification.isPinchZoomed||!this.pageSize[parseInt(e.toString(),10)])return;var g=this.retrieveCurrentZoomFactor(),I=2<g&&x<=1200?700:1200;if(A.pdfViewer.tileRenderingSettings.enableTileRendering||(I=1200),(x<=I||!A.pdfViewer.tileRenderingSettings.enableTileRendering)&&1===c)this.renderThumbnailImages&&1===c?A.renderPage(u,e,h):A.renderPage(u,e);else if(A.isTileImageRendered=!0,A.tileRenderCount=0,this.renderThumbnailImages&&1===c)A.renderPage(u,e,h);else{A.tileRenderPage(u,e);for(var m=0;m<a;m++)for(var f=0;f<l;f++)0===m&&0===f||(u=this.clientSideRendering?JSON.parse(this.getStoredTileImageDetails(e,m,f,g)):JSON.parse(this.getWindowSessionStorageTile(e,m,f,g)))&&A.tileRenderPage(u,e)}u=null}else if(null===u||!o){if(this.renderThumbnailImages||(this.getPagesPinchZoomed()?A.showPageLoadingIndicator(e,!1):A.showPageLoadingIndicator(e,!0),A.getPagesZoomed()&&A.isInitialLoaded&&A.showPageLoadingIndicator(e,!1)),A.pdfViewer.magnification&&A.pdfViewer.magnification.isPinchZoomed)return;A.pdfViewer.tileRenderingSettings.enableTileRendering&&!this.renderThumbnailImages||(l=a=1),A.tileRenderCount=0,A.isTileImageRendered=!0;for(var y=0;y<a;y++)for(var v=0;v<l;v++){var b,w,C,S,T,E=null,D=this.retrieveCurrentZoomFactor();I=2<D&&x<=1200?700:1200,A.pdfViewer.tileRenderingSettings.enableTileRendering||(I=1200),this.renderThumbnailImages&&!this.clientSideRendering?(A.renderPage(d,e,h),-1===this.textrequestLists.indexOf(e)&&(E={pageStartIndex:e,pageEndIndex:e+1,documentId:A.getDocumentId(),hashId:A.hashId,action:"RenderPdfTexts",elementId:A.pdfViewer.element.id,uniqueId:A.documentId},this.jsonDocumentId&&(E.documentId=this.jsonDocumentId),this.textRequestHandler=new DRt(this.pdfViewer),this.textRequestHandler.url=this.pdfViewer.serviceUrl+"/"+this.pdfViewer.serverActionSettings.renderTexts,this.textRequestHandler.responseType="json",this.clientSideRendering||((i=JSON.parse(JSON.stringify(E))).action="pageRenderInitiate",A.pdfViewer.firePageRenderInitiate(i),this.textRequestHandler.send(E)),this.textrequestLists.push(e),A.textRequestHandler.onSuccess=function(t){if(!(A.pdfViewer.magnification&&A.pdfViewer.magnification.isPinchZoomed||!A.pageSize[parseInt(e.toString(),10)])){t=t.data;if(t&&"object"!=typeof t)try{t=JSON.parse(t)}catch(e){A.onControlError(500,t,A.pdfViewer.serverActionSettings.renderTexts),t=null}t&&A.pageTextRequestOnSuccess(t,A,e)}},this.textRequestHandler.onFailure=function(e){A.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,A.pdfViewer.serverActionSettings.renderTexts)},this.textRequestHandler.onError=function(e){A.openNotificationPopup(),A.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,A.pdfViewer.serverActionSettings.renderTexts)},this.clientSideRendering)&&this.pdfViewer.pdfRendererModule.getDocumentText(E,"pageTextRequest")):(E={xCoordinate:y.toString(),yCoordinate:v.toString(),viewPortWidth:I.toString(),viewPortHeight:s.toString(),pageNumber:e.toString(),hashId:A.hashId,tilecount:c.toString(),tileXCount:a.toString(),tileYCount:l.toString(),zoomFactor:D.toString(),action:"RenderPdfPages",uniqueId:this.documentId,elementId:A.pdfViewer.element.id,digitalSignaturePresent:A.digitalSignaturePresent(e)},this.jsonDocumentId&&(E.documentId=this.jsonDocumentId),A.pageRequestHandler=new DRt(this.pdfViewer),A.pageRequestHandler.url=A.pdfViewer.serviceUrl+"/"+A.pdfViewer.serverActionSettings.renderPages,A.pageRequestHandler.responseType="json",je(A.hashId)||(0==E.xCoordinate&&0==E.yCoordinate&&((i=JSON.parse(JSON.stringify(E))).action="pageRenderInitiate",this.clientSideRendering||A.pdfViewer.firePageRenderInitiate(i)),this.requestCollection.push(this.pageRequestHandler),this.clientSideRendering)||A.pageRequestHandler.send(E),A.requestLists.push(A.documentId+"_"+e+"_"+y+"_"+v+"_"+D),A.pageRequestHandler.onSuccess=function(t){if(!(A.pdfViewer.magnification&&A.pdfViewer.magnification.isPinchZoomed||!A.pageSize[parseInt(e.toString(),10)])){t=t.data;if(A.checkRedirection(t))A.showLoadingIndicator(!1);else{if(t&&"object"!=typeof t)try{t=JSON.parse(t)}catch(e){A.onControlError(500,t,A.pdfViewer.serverActionSettings.renderPages),t=null}t&&A.pageRequestOnSuccess(t,A,I,x,e)}}},this.pageRequestHandler.onFailure=function(e){A.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,A.pdfViewer.serverActionSettings.renderPages)},this.pageRequestHandler.onError=function(e){A.openNotificationPopup(),A.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,A.pdfViewer.serverActionSettings.renderPages)},this.clientSideRendering&&(b=A.documentId+"_"+e+"_textDetails",w=!A.pageTextDetails||!A.pageTextDetails[b],C=this.pdfViewer.pdfRenderer.loadedDocument.getPage(e),S=new dvt(0,0,0,0),T=new dvt(0,0,0,0),C&&C._pageDictionary&&C._pageDictionary._map&&C._pageDictionary._map.CropBox&&(t=C._pageDictionary._map.CropBox,S.x=t[0],S.y=t[1],S.width=t[2],S.height=t[3]),C&&C._pageDictionary&&C._pageDictionary._map&&C._pageDictionary._map.MediaBox&&(t=C._pageDictionary._map.MediaBox,T.x=t[0],T.y=t[1],T.width=t[2],T.height=t[3]),x<=I||!A.pdfViewer.tileRenderingSettings.enableTileRendering?((i=JSON.parse(JSON.stringify(E))).action="pageRenderInitiate",A.pdfViewer.firePageRenderInitiate(i),this.pdfViewerRunner.addTask({pageIndex:e,message:"renderPage",zoomFactor:D,isTextNeed:w,textDetailsId:b,cropBoxRect:S,mediaBoxRect:T},yRt.High)):(this.showPageLoadingIndicator(e,!0),0==E.xCoordinate&&0==E.yCoordinate&&((i=JSON.parse(JSON.stringify(E))).action="pageRenderInitiate",A.pdfViewer.firePageRenderInitiate(i)),this.pdfViewerRunner.addTask({pageIndex:e,message:"renderImageAsTile",zoomFactor:D,tileX:y,tileY:v,tileXCount:a,tileYCount:l,isTextNeed:w,textDetailsId:b,cropBoxRect:S,mediaBoxRect:T},yRt.High)),this.pdfViewerRunner.onMessage("imageRendered,renderTileImage,renderThumbnail,renderPreviewTileImage,printImage,textSearched",function(e){switch(e.data.message){case"imageRendered":"imageRendered"===e.data.message&&(c=document.createElement("canvas"),y=(l=e.data).value,d=l.width,p=l.height,l=l.pageIndex,c.width=d,c.height=p,(d=(h=c.getContext("2d")).createImageData(d,p)).data.set(y),h.putImageData(d,0,0),p=c.toDataURL(),A.releaseCanvas(c),c=e.data.textBounds,u=e.data.textContent,g=e.data.pageText,m=e.data.rotation,f=e.data.characterBounds,t=A.pdfViewer.pdfRendererModule.getHyperlinks(l),t={image:p,pageNumber:l,uniqueId:A.documentId,pageWidth:e.data.pageWidth,zoomFactor:e.data.zoomFactor,hyperlinks:t.hyperlinks,hyperlinkBounds:t.hyperlinkBounds,linkAnnotation:t.linkAnnotation,linkPage:t.linkPage,annotationLocation:t.annotationLocation,characterBounds:f},e.data.isTextNeed?(t.textBounds=c,t.textContent=u,t.rotation=m,A.storeTextDetails(l,c,u,t.pageText=g,m,f)):(b=JSON.parse(A.pageTextDetails[""+e.data.textDetailsId]),t.textBounds=b.textBounds,t.textContent=b.textContent,t.rotation=b.rotation,t.pageText=b.pageText,t.characterBounds=b.characterBounds),t)&&t.image&&!je(t.image.split("base64,")[1])&&t.uniqueId===A.documentId&&(A.pdfViewer.fireAjaxRequestSuccess(A.pdfViewer.serverActionSettings.renderPages,t),v=void 0!==t.pageNumber?t.pageNumber:l,w=A.createBlobUrl(t.image.split("base64,")[1],"image/png"),S={image:C=(URL||webkitURL).createObjectURL(w),width:t.pageWidth,uniqueId:t.uniqueId,zoomFactor:t.zoomFactor},A.storeImageData(v,S),A.pageRequestOnSuccess(t,A,I,x,l));break;case"renderTileImage":var t,i,n,o,r,s,a,l,h,d,p,c,u,g,m,f,y,v,b,w,C,S;"renderTileImage"===e.data.message&&(t=document.createElement("canvas"),y=(l=e.data).value,i=l.w,n=l.h,o=l.noTileX,r=l.noTileY,s=l.x,a=l.y,l=l.pageIndex,t.setAttribute("height",n),t.setAttribute("width",i),t.width=i,t.height=n,(d=(h=t.getContext("2d")).createImageData(i,n)).data.set(y),h.putImageData(d,0,0),p=t.toDataURL(),A.releaseCanvas(t),c=e.data.textBounds,u=e.data.textContent,g=e.data.pageText,m=e.data.rotation,f=e.data.characterBounds,y={image:p,noTileX:o,noTileY:r,pageNumber:l,tileX:s,tileY:a,uniqueId:A.documentId,pageWidth:x,width:i,transformationMatrix:{Values:[1,0,0,1,i*s,n*a,0,0,0]},zoomFactor:e.data.zoomFactor,characterBounds:f,isTextNeed:e.data.isTextNeed,textDetailsId:e.data.textDetailsId,textBounds:c,textContent:u,pageText:g})&&y.image&&y.uniqueId===A.documentId&&(y.pageWidth&&0<y.pageWidth&&y.pageWidth,A.pdfViewer.fireAjaxRequestSuccess(A.pdfViewer.serverActionSettings.renderPages,y),v=void 0!==y.pageNumber?y.pageNumber:l,S=0===s&&0===a?(w=A.createBlobUrl(y.image.split("base64,")[1],"image/png"),C=(URL||webkitURL).createObjectURL(w),y.isTextNeed?(y.textBounds=c,y.textContent=u,y.rotation=m,y.pageText=g,A.storeTextDetails(l,c,u,g,m,f)):(b=JSON.parse(A.pageTextDetails[""+y.textDetailsId]),y.textBounds=b.textBounds,y.textContent=b.textContent,y.rotation=b.rotation,y.pageText=b.pageText,y.characterBounds=b.characterBounds),{image:C,width:y.width,uniqueId:y.uniqueId,tileX:y.tileX,tileY:y.tileY,zoomFactor:y.zoomFactor,transformationMatrix:y.transformationMatrix,pageText:y.pageText,textContent:y.textContent,textBounds:y.textBounds}):(w=A.createBlobUrl(y.image.split("base64,")[1],"image/png"),{image:C=(URL||webkitURL).createObjectURL(w),width:y.width,uniqueId:y.uniqueId,tileX:y.tileX,tileY:y.tileY,zoomFactor:y.zoomFactor,transformationMatrix:y.transformationMatrix}),A.storeImageData(v,S,y.tileX,y.tileY),A.pageRequestOnSuccess(y,A,I,x,l,!0));break;case"renderThumbnail":A.clientSideRendering&&(A.pdfViewer.thumbnailViewModule.thumbnailOnMessage(e),A.pdfViewer.textSearch)&&A.pdfViewer.pdfRendererModule.textExtractionOnmessage(e);break;case"renderPreviewTileImage":A.pdfViewer.pageOrganizer.previewOnMessage(e),A.pdfViewer.textSearch&&A.pdfViewer.pdfRendererModule.textExtractionOnmessage(e);break;case"printImage":A.pdfViewer.printModule.printOnMessage(e);break;case"textSearched":A.pdfViewer.textSearchModule.searchTextAfteresult(e.data.resultPages,e.data.totalSearchCount,e.data.searchWord,e.data.matchCase,e.data.isRequestsend,e.data.isCompletedSearch,e.data.endIndex)}})))}}-1===this.renderedPagesList.indexOf(e)&&A.renderedPagesList.push(e)}}},C.prototype.pageRequestOnSuccess=function(e,t,i,n,o,r){for(;"object"!=typeof e;)e=JSON.parse(e);e.image&&e.uniqueId===t.documentId&&(n=e.pageWidth&&0<e.pageWidth?e.pageWidth:n,t.pdfViewer.fireAjaxRequestSuccess(t.pdfViewer.serverActionSettings.renderPages,e),o=je(e.pageNumber)?o:e.pageNumber,e.pageNumber=o+1,!(n<=i)&&t.pdfViewer.tileRenderingSettings.enableTileRendering||r?t.storeWinData(e,o,e.tileX,e.tileY):t.storeWinData(e,o),!(n<=i)&&t.pdfViewer.tileRenderingSettings.enableTileRendering||r?t.tileRenderPage(e,o):(t.renderPage(e,o),t.pdfViewer.firePageRenderComplete(e)))},C.prototype.pageTextRequestSuccess=function(e,t){this.pageTextRequestOnSuccess(e,this,t)},C.prototype.pageTextRequestOnSuccess=function(e,t,i){for(;"object"!=typeof e;)e=JSON.parse(e);var n;e.documentTextCollection&&e.uniqueId===t.documentId&&(t.pdfViewer.fireAjaxRequestSuccess(t.pdfViewer.serverActionSettings.renderTexts,e),t.pdfViewer.firePageRenderComplete(e),n=void 0!==e.pageNumber?e.pageNumber:i,t.storeWinData(e,n),t.renderPage(e,i))},C.prototype.requestForTextExtraction=function(e,i){var n=this,t={pageStartIndex:e,pageEndIndex:e+1,documentId:n.getDocumentId(),hashId:n.hashId,action:"RenderPdfTexts",elementId:n.pdfViewer.element.id,uniqueId:n.documentId};this.jsonDocumentId&&(t.documentId=this.jsonDocumentId),this.textRequestHandler=new DRt(this.pdfViewer),this.textRequestHandler.url=this.pdfViewer.serviceUrl+"/"+this.pdfViewer.serverActionSettings.renderTexts,this.textRequestHandler.responseType="json",this.clientSideRendering||this.textRequestHandler.send(t),this.textrequestLists.push(e),n.textRequestHandler.onSuccess=function(t){if(!(n.pdfViewer.magnification&&n.pdfViewer.magnification.isPinchZoomed||!n.pageSize[parseInt(e.toString(),10)])){t=t.data;if(!n.checkRedirection(t)){if(t&&"object"!=typeof t)try{t=JSON.parse(t)}catch(e){n.onControlError(500,t,n.pdfViewer.serverActionSettings.renderTexts),t=null}t&&n.textRequestOnSuccess(t,n,e,i)}}},this.textRequestHandler.onFailure=function(e){n.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,n.pdfViewer.serverActionSettings.renderTexts)},this.textRequestHandler.onError=function(e){n.openNotificationPopup(),n.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,n.pdfViewer.serverActionSettings.renderTexts)},this.clientSideRendering&&this.pdfViewer.pdfRendererModule.getDocumentText(t,"textRequest",i)},C.prototype.textRequestSuccess=function(e,t,i){this.textRequestOnSuccess(e,this,t,i)},C.prototype.textRequestOnSuccess=function(e,t,i,n){for(;"object"!=typeof e;)e=JSON.parse(e);var o,r,s;e.documentTextCollection&&e.uniqueId===t.documentId&&(t.pdfViewer.fireAjaxRequestSuccess(t.pdfViewer.serverActionSettings.renderTexts,e),o=void 0!==e.pageNumber?e.pageNumber:i,t.storeWinData(e,o),je(n)?t.renderPage(e,i):(o=n.bounds,r=e.documentTextCollection[0][parseInt(i.toString(),10)].PageText.split(""),s=e.characterBounds,t=t.textMarkUpContent(o,r,s),n.textMarkupContent=t,this.pdfViewer.annotationModule.storeAnnotations(i,n,"_annotations_textMarkup")))},C.prototype.textMarkUpContent=function(e,t,i){for(var n="",o=0;o<e.length;o++)for(var r=0;r<i.length;r++)i[parseInt(r.toString(),10)].Y>=e[parseInt(o.toString(),10)].Y-.5&&i[parseInt(r.toString(),10)].X>=e[parseInt(o.toString(),10)].X-.5&&i[parseInt(r.toString(),10)].Y<=e[parseInt(o.toString(),10)].Y+e[parseInt(o.toString(),10)].Height+.5&&i[parseInt(r.toString(),10)].X<=e[parseInt(o.toString(),10)].X+e[parseInt(o.toString(),10)].Width+.5&&(n+=t[parseInt(r.toString(),10)]);return n.replace(/(\r\n)/gm,"")},C.prototype.digitalSignaturePresent=function(e){var t=!1;return t=this.digitalSignaturePages&&0!==this.digitalSignaturePages.length&&-1!==this.digitalSignaturePages.indexOf(e)?!0:t},C.prototype.pageRequestSent=function(e,t,i){var n=this.retrieveCurrentZoomFactor(),e=this.documentId+"_"+e+"_"+t+"_"+i+"_"+n;return!!(this.requestLists&&-1<this.requestLists.indexOf(e))},C.prototype.onControlError=function(e,t,i){this.openNotificationPopup(),this.pdfViewer.fireAjaxRequestFailed(e,t,i)},C.prototype.getStoredData=function(e,t){var i=this.retrieveCurrentZoomFactor(),n=(this.pdfViewer.restrictZoomRequest&&!this.pdfViewer.tileRenderingSettings.enableTileRendering&&(i=this.initialZoomValue[parseInt(e.toString(),10)]),this.getWindowSessionStorage(e,i)?this.getWindowSessionStorage(e,i):this.getPinchZoomPage(e)),i=(!n&&t&&((t=this.clientSideRendering?this.getStoredTileImageDetails(e,0,0,i):this.getWindowSessionStorageTile(e,0,0,i))&&(n=t),t=JSON.parse(t))&&je(t.pageText)&&je(t.textContent)&&(je(e=JSON.parse(this.getWindowSessionStorageTile(e,0,0,i)))||e.uniqueId!==t.uniqueId||(n=JSON.stringify(e))),null);return n&&(i=n,this.isPinchZoomStorage||(i=JSON.parse(n)),this.isPinchZoomStorage=!1),i},C.prototype.storeWinData=function(e,t,i,n){var o,r;e.image?(o=this.createBlobUrl(e.image.split("base64,")[1],"image/png"),o=(URL||webkitURL).createObjectURL(o),isNaN(i)&&isNaN(n)||0===i&&0===n?(r={image:o,transformationMatrix:e.transformationMatrix,hyperlinks:e.hyperlinks,hyperlinkBounds:e.hyperlinkBounds,linkAnnotation:e.linkAnnotation,linkPage:e.linkPage,annotationLocation:e.annotationLocation,textContent:e.textContent,width:e.width,textBounds:e.textBounds,pageText:e.pageText,rotation:e.rotation,scaleFactor:e.scaleFactor,uniqueId:e.uniqueId,zoomFactor:e.zoomFactor,tileX:i,tileY:n},this.pageSize[parseInt(t.toString(),10)]&&(this.pageSize[parseInt(t.toString(),10)].rotation=parseFloat(e.rotation)),this.textLayer.characterBound[parseInt(t.toString(),10)]=e.characterBounds):r={image:o,transformationMatrix:e.transformationMatrix,tileX:i,tileY:n,width:e.width,zoomFactor:e.zoomFactor}):(o=e.documentTextCollection[0][parseInt(t.toString(),10)],r={textContent:e.textContent,textBounds:e.textBounds,pageText:o.PageText,rotation:e.rotation,uniqueId:e.uniqueId},this.pageSize[parseInt(t.toString(),10)]&&(this.pageSize[parseInt(t.toString(),10)].rotation=parseFloat(e.rotation)),this.textLayer.characterBound[parseInt(t.toString(),10)]=e.characterBounds);this.pageSize[parseInt(t.toString(),10)]&&this.pageSize[parseInt(t.toString(),10)].width,this.manageSessionStorage(t,r,i,n)},C.prototype.setCustomAjaxHeaders=function(e){for(var t=0;t<this.pdfViewer.ajaxRequestSettings.ajaxHeaders.length;t++)e.setRequestHeader(this.pdfViewer.ajaxRequestSettings.ajaxHeaders[parseInt(t.toString(),10)].headerName,this.pdfViewer.ajaxRequestSettings.ajaxHeaders[parseInt(t.toString(),10)].headerValue)},C.prototype.getPinchZoomPage=function(e){for(var t in this.pinchZoomStorage)if(Object.prototype.hasOwnProperty.call(this.pinchZoomStorage,t)&&this.pinchZoomStorage[t].index===e)return this.isPinchZoomStorage=!0,this.pinchZoomStorage[t].pinchZoomStorage;return null},C.prototype.getWindowSessionStorage=function(e,t){return C.sessionStorageManager.getItem(this.documentId+"_"+e+"_"+t)},C.prototype.getWindowSessionStorageTile=function(e,t,i,n){return C.sessionStorageManager.getItem(this.documentId+"_"+e+"_"+t+"_"+i+"_"+n)},C.prototype.getStoredTileImageDetails=function(e,t,i,n){return this.pageImageDetails[this.documentId+"_"+e+"_"+t+"_"+i+"_"+n+"_imageUrl"]||null},C.prototype.retrieveCurrentZoomFactor=function(){var e=this.getZoomFactor();return this.pdfViewer.enableZoomOptimization?(e<=1?e=1:1<e&&e<=2?e=2:2<e&&e<=3?e=3:3<e&&e<=4&&(e=4),e):e<=0?1:e},C.prototype.storeTextDetails=function(e,t,i,n,o,r){t={textBounds:t,textContent:i,rotation:o,pageText:n,characterBounds:r};this.pageSize[parseInt(e.toString(),10)]&&(this.pageSize[parseInt(e.toString(),10)].rotation=o),this.textLayer.characterBound[parseInt(e.toString(),10)]=r,this.pageTextDetails[this.documentId+"_"+e+"_textDetails"]=JSON.stringify(t)},C.prototype.storeImageData=function(e,t,i,n){var o=je(t.zoomFactor)?this.retrieveCurrentZoomFactor():t.zoomFactor;isNaN(i)&&isNaN(n)?this.pageImageDetails[this.documentId+"_"+e+"_"+o+"_imageUrl"]=JSON.stringify(t):this.pageImageDetails[this.documentId+"_"+e+"_"+i+"_"+n+"_"+o+"_imageUrl"]=JSON.stringify(t)},C.prototype.manageSessionStorage=function(e,t,i,n){var o=C.sessionStorageManager.getWindowSessionStorageSize()+Math.round(JSON.stringify(t).length/1024),r=5e3,s=200;if((this.isDeviceiOS||this.isMacSafari)&&(r=2e3,s=80),r<=o){if(!this.isStorageExceed){for(var a=[],l=[],h=0;h<C.sessionStorageManager.getSessionLength();h++)C.sessionStorageManager.getKey(h)&&C.sessionStorageManager.getKey(h).split("_")[3]&&("annotations"===C.sessionStorageManager.getKey(h).split("_")[3]?(this.annotationStorage[C.sessionStorageManager.getKey(h)]=C.sessionStorageManager.getItem(C.sessionStorageManager.getKey(h)),a.push(C.sessionStorageManager.getKey(h))):"formfields"!==C.sessionStorageManager.getKey(h).split("_")[3]&&"formDesigner"!==C.sessionStorageManager.getKey(h).split("_")[3]||(this.formFieldStorage[C.sessionStorageManager.getKey(h)]=C.sessionStorageManager.getItem(C.sessionStorageManager.getKey(h)),l.push(C.sessionStorageManager.getKey(h))));if(a)for(h=0;h<a.length;h++)C.sessionStorageManager.removeItem(a[parseInt(h.toString(),10)]);if(l)for(h=0;h<l.length;h++)C.sessionStorageManager.removeItem(l[parseInt(h.toString(),10)])}if(this.isStorageExceed=!0,r<=(o=C.sessionStorageManager.getWindowSessionStorageSize())){var d=C.sessionStorageManager.getSessionLength();s<d&&(d=s);for(h=0;h<d;h++)C.sessionStorageManager.getKey(h)&&C.sessionStorageManager.getKey(h).split("_")[3]&&"annotations"!==C.sessionStorageManager.getKey(h).split("_")[3]&&(C.sessionStorageManager.removeItem(C.sessionStorageManager.getKey(h)),d-=1,h-=1)}}s=this.retrieveCurrentZoomFactor();this.initialZoomValue[parseInt(e.toString(),10)]=s,isNaN(i)&&isNaN(n)?(o<r&&C.sessionStorageManager.setItem(this.documentId+"_"+e+"_"+s,JSON.stringify(t)),this.sessionStorage.push(this.documentId+"_"+e+"_"+s)):(this.sessionStorage.push(this.documentId+"_"+e+"_"+i+"_"+n+"_"+s),o<r&&C.sessionStorageManager.setItem(this.documentId+"_"+e+"_"+i+"_"+n+"_"+s,JSON.stringify(t)))},C.prototype.createBlobUrl=function(e,t){for(var i=atob(e),n=[],o=0;o<i.length;o+=512){for(var r=i.slice(o,o+512),s=new Array(r.length),a=0;a<r.length;a++)s[parseInt(a.toString(),10)]=r.charCodeAt(a);var l=new Uint8Array(s);n.push(l)}return new Blob(n,{type:t})},C.prototype.getRandomNumber=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){return(16*Math.random()|0).toString(16)})},C.prototype.createGUID=function(){return"Sync_PdfViewer_"+this.getRandomNumber()},C.prototype.isClickedOnScrollBar=function(e,t){var i=!1;return t&&this.setScrollDownValue(e.type,!1),this.viewerContainer.clientWidth+this.viewerContainer.offsetLeft<e.clientX&&e.clientX<this.viewerContainer.offsetWidth+this.viewerContainer.offsetLeft&&(i=!0,t)&&this.setScrollDownValue(e.type,!0),this.viewerContainer.clientHeight+this.viewerContainer.offsetTop<e.clientY&&e.clientY<this.viewerContainer.offsetHeight+this.viewerContainer.offsetTop&&(i=!0,t)&&this.setScrollDownValue(e.type,!0),i},C.prototype.setScrollDownValue=function(e,t){"mousedown"===e&&(this.isScrollbarMouseDown=t)},C.prototype.disableTextSelectionMode=function(){this.isTextSelectionDisabled=!0,je(this.viewerContainer)||this.viewerContainer.classList.remove("e-enable-text-selection"),this.pdfViewer.textSelectionModule&&this.pdfViewer.textSelectionModule.clearTextSelection(),je(this.viewerContainer)||(this.viewerContainer.classList.add("e-disable-text-selection"),this.viewerContainer.addEventListener("selectstart",function(){return!1}))},C.prototype.getElement=function(e){return document.getElementById(this.pdfViewer.element.id+e)},C.prototype.getPageWidth=function(e){return this.pageSize[parseInt(e.toString(),10)]?this.pageSize[parseInt(e.toString(),10)].width*this.getZoomFactor():0},C.prototype.getPageHeight=function(e){return this.pageSize[parseInt(e.toString(),10)]?this.pageSize[parseInt(e.toString(),10)].height*this.getZoomFactor():0},C.prototype.getPageTop=function(e){return this.pageSize[parseInt(e.toString(),10)]?this.pageSize[parseInt(e.toString(),10)].top*this.getZoomFactor():0},C.prototype.isAnnotationToolbarHidden=function(){return!this.pdfViewer.toolbarModule.annotationToolbarModule||this.pdfViewer.toolbarModule.annotationToolbarModule.isToolbarHidden},C.prototype.isFormDesignerToolbarHidded=function(){var e=this.pdfViewer.toolbarModule.formDesignerToolbarModule;return!e||e.isToolbarHidden},C.prototype.getTextMarkupAnnotationMode=function(){return!!this.isTextMarkupAnnotationModule()&&this.pdfViewer.annotationModule.textMarkupAnnotationModule.isTextMarkupAnnotationMode},C.prototype.isNewFreeTextAnnotation=function(){return!this.pdfViewer.annotationModule||!this.pdfViewer.annotationModule.freeTextAnnotationModule||!this.pdfViewer.annotationModule.freeTextAnnotationModule.isNewFreeTextAnnot},C.prototype.getCurrentTextMarkupAnnotation=function(){return!!this.isTextMarkupAnnotationModule()&&!!this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation},C.prototype.getSelectTextMarkupCurrentPage=function(){return this.isTextMarkupAnnotationModule()?this.pdfViewer.annotationModule.textMarkupAnnotationModule.selectTextMarkupCurrentPage:null},C.prototype.getAnnotationToolStatus=function(){return!!this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule.isAnnotationButtonsEnabled()},C.prototype.getPopupNoteVisibleStatus=function(){return!!this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.isPopupNoteVisible},C.prototype.isTextMarkupAnnotationModule=function(){return this.pdfViewer.annotationModule?this.pdfViewer.annotationModule.textMarkupAnnotationModule:null},C.prototype.isShapeAnnotationModule=function(){return!!this.pdfViewer.annotation&&!(!this.pdfViewer.annotation||!this.pdfViewer.annotation.shapeAnnotationModule)},C.prototype.isFormDesignerModule=function(){return!!this.pdfViewer.formDesignerModule},C.prototype.isFormFieldsModule=function(){return!!this.pdfViewer.formFieldsModule},C.prototype.isCalibrateAnnotationModule=function(){return!!this.pdfViewer.annotation&&!(!this.pdfViewer.annotation||!this.pdfViewer.annotation.measureAnnotationModule)},C.prototype.isStampAnnotationModule=function(){return!!this.pdfViewer.annotation&&!(!this.pdfViewer.annotation||!this.pdfViewer.annotation.stampAnnotationModule)},C.prototype.isInkAnnotationModule=function(){return!!this.pdfViewer.annotation&&!(!this.pdfViewer.annotation||!this.pdfViewer.annotation.inkAnnotationModule)},C.prototype.isCommentAnnotationModule=function(){return!!this.pdfViewer.annotation&&!(!this.pdfViewer.annotation||!this.pdfViewer.annotation.stickyNotesAnnotationModule)},C.prototype.isShapeBasedAnnotationsEnabled=function(){return!!(this.isShapeAnnotationModule()||this.isCalibrateAnnotationModule()||this.isStampAnnotationModule()||this.isCommentAnnotationModule()||this.isFormDesignerModule()||this.isFormFieldsModule())},C.prototype.getMousePosition=function(e){var t=e.target.parentElement;if(-1!==e.type.indexOf("touch")){var i,n,o,r=e;(this.pdfViewer.annotation||this.isDeviceiOS)&&(i=this.pdfViewer.currentPageNumber-1,this.pdfViewer.annotation&&!isNaN(this.pdfViewer.annotation.getEventPageNumber(e))&&(i=this.pdfViewer.annotation.getEventPageNumber(e)),isNaN(i)&&this.pdfViewer.formDesignerModule&&(i=this.pdfViewer.formDesignerModule.getEventPageNumber(e)),i=this.getElement("_pageDiv_"+i))&&(i=i.getBoundingClientRect(),n=r.changedTouches[0].clientX-i.left,o=r.changedTouches[0].clientY-i.top)}else if(e.target.classList.contains("e-pv-hyperlink"))n=e.offsetX+e.target.offsetLeft,o=e.offsetY+e.target.offsetTop;else if(e.target.classList.contains("e-pv-text")&&t){var s=t.getBoundingClientRect();n=e.clientX-s.left,o=e.clientY-s.top}else if(e.target&&e&&e.path&&t&&(t.classList.contains("foreign-object")||t.parentElement.classList.contains("foreign-object"))){var s=void 0;if("e-pv-page-div"===e.path[4].className)s=e.path[4].getBoundingClientRect();else for(var a=0;a<e.path.length;a++)if("e-pv-page-div"===e.path[parseInt(a.toString(),10)].className){s=e.path[parseInt(a.toString(),10)].getBoundingClientRect();break}n=e.clientX-s.left,o=e.clientY-s.top}else o=e.target&&t&&t.classList.contains("foreign-object")||e.target.classList.contains("e-pv-checkbox-div")?(s=void 0,s=(e.target.classList.contains("e-pv-checkbox-div")?e.target.offsetParent:e.target).offsetParent.offsetParent.offsetParent.getBoundingClientRect(),n=e.clientX-s.left,e.clientY-s.top):(n=e.offsetX,e.offsetY);return{x:n,y:o}},C.prototype.getMouseEventArgs=function(e,t,i,n){var o,r;return t.position=e,(o=n||"Drag"!==this.action&&"ConnectorSourceEnd"!==this.action&&"SegmentEnd"!==this.action&&"OrthoThumb"!==this.action&&"BezierSourceThumb"!==this.action&&"BezierTargetThumb"!==this.action&&"ConnectorTargetEnd"!==this.action&&-1===this.action.indexOf("Rotate")&&-1===this.action.indexOf("Resize")||(o=this.pdfViewer.selectedItems,"Drag"===this.action&&o&&0<this.pdfViewer.selectedItems.annotations.length)||"Drag"===this.action&&o&&0<this.pdfViewer.selectedItems.formFields.length?gCt(i,this,this.pdfViewer):o)&&(r=o.wrapper),n?(t.target=o,t.targetWrapper=r):(t.source=o,t.sourceWrapper=r),t.actualObject=this.eventArgs.actualObject,t},C.prototype.findToolToActivate=function(e,t){t={x:t.x/this.getZoomFactor(),y:t.y/this.getZoomFactor()};var i=this.pdfViewer.selectedItems.wrapper;if(i&&e){var n=i.bounds,n=new dvt(n.x,n.y,n.width,n.height);if("Line"===e.shapeAnnotationType||"LineWidthArrowHead"===e.shapeAnnotationType||"Distance"===e.shapeAnnotationType||"Polygon"===e.shapeAnnotationType){var o=this.pdfViewer.selectedItems.annotations[0];if(o)for(var r=0;r<o.vertexPoints.length;r++)if(Rbt(t,o.vertexPoints[parseInt(r.toString(),10)],10)&&0!==o.leaderHeight)return"ConnectorSegmentPoint_"+r}if("Distance"===e.shapeAnnotationType){var s=0,a=void 0;if(e&&e.wrapper)for(r=0;r<e.wrapper.children.length;r++){var l=Cbt.findAngle(e.sourcePoint,e.targetPoint);if(-1<e.wrapper.children[parseInt(r.toString(),10)].id.indexOf("leader")){var h=e.wrapper.children[0].bounds.center,h=0===s?(a={x:e.sourcePoint.x,y:e.sourcePoint.y-e.leaderHeight},e.sourcePoint):(a={x:e.targetPoint.x,y:e.targetPoint.y-e.leaderHeight},e.targetPoint),d=uvt();if(mvt(d,l,h.x,h.y),Rbt(t,gvt(d,{x:a.x,y:a.y}),10))return"Leader"+s;s++}}}var p=this.pdfViewer.touchPadding,c=(this.getZoomFactor()<=1.5&&(p/=this.getZoomFactor()),uvt()),u=(mvt(c,e.rotateAngle+i.parentTransform,i.offsetX,i.offsetY),i.offsetX-i.pivot.x*i.actualSize.width),g=i.offsetY-i.pivot.y*i.actualSize.height,m=gvt(c,{x:u+(.5===i.pivot.x?2*i.pivot.x:i.pivot.x)*i.actualSize.width/2,y:g-30/this.getZoomFactor()});if("Stamp"===e.shapeAnnotationType&&Rbt(t,m,p))return"Rotate";if((n=this.inflate(p,n)).containsPoint(t,0)){m=this.checkResizeHandles(this.pdfViewer,i,t,c,u,g);if(m)return m}return-1<this.pdfViewer.selectedItems.annotations.indexOf(e)?"Drag":-1<this.pdfViewer.selectedItems.formFields.indexOf(e)&&this.pdfViewer.designerMode?"Drag":"Select"}return this.pdfViewer.tool||"Select"},C.prototype.inflate=function(e,t){return t.x-=e,t.y-=e,t.width+=2*e,t.height+=2*e,t},C.prototype.checkResizeHandles=function(e,t,i,n,o,r){var s=s||this.checkForResizeHandles(e,t,i,n,o,r);return s||null},C.prototype.checkForResizeHandles=function(e,t,i,n,o,r){var s=+this.pdfViewer.touchPadding,e=(2<=this.getZoomFactor()&&!F.isDevice&&(s/=this.getZoomFactor()/1.9),(t.actualSize.width<40||t.actualSize.height<40&&F.isDevice)&&(s=s/2*this.getZoomFactor()),e.selectedItems,!1),a=!1,l=!1,h=!1,d=this.pdfViewer.annotationSelectorSettings.resizerLocation;if((d<1||3<d)&&(d=3),!this.pdfViewer.selectedItems.annotations[0]||"Stamp"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"FreeText"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"Image"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"HandWrittenSignature"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"SignatureText"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"SignatureImage"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||(e=!0),this.pdfViewer.selectedItems.annotations[0]&&"StickyNotes"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&(a=!0),this.pdfViewer.selectedItems.annotations[0]&&"Ink"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&(h=!0),!this.pdfViewer.selectedItems.annotations[0]||"Ellipse"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"Radius"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"Rectangle"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||(l=!0),!a){if(h||e||this.pdfViewer.selectedItems.annotations[0]&&("HandWrittenSignature"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"SignatureText"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"SignatureImage"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType)||40<=t.actualSize.width&&40<=t.actualSize.height&&l&&(1===d||3===d)){if(Rbt(i,gvt(n,{x:o+t.actualSize.width,y:r+t.actualSize.height}),s))return"ResizeSouthEast";if(Rbt(i,gvt(n,{x:o,y:r+t.actualSize.height}),s))return"ResizeSouthWest";if(Rbt(i,gvt(n,{x:o+t.actualSize.width,y:r}),s))return"ResizeNorthEast";if(Rbt(i,gvt(n,{x:o,y:r}),s))return"ResizeNorthWest"}if(h||!l||l&&(2===d||3===d||!(40<=t.actualSize.width&&40<=t.actualSize.height)&&1===d)){if(Rbt(i,gvt(n,{x:o+t.actualSize.width,y:r+t.actualSize.height/2}),s)&&!e)return"ResizeEast";if(Rbt(i,gvt(n,{x:o,y:r+t.actualSize.height/2}),s)&&!e)return"ResizeWest";if(Rbt(i,gvt(n,{x:o+t.actualSize.width/2,y:r+t.actualSize.height}),s)&&!e)return"ResizeSouth";if(Rbt(i,gvt(n,{x:o+t.actualSize.width/2,y:r}),s)&&!e)return"ResizeNorth"}}return null},C.prototype.checkSignatureFormField=function(e){var t=!1,e=(this.pdfViewer.formDesignerModule&&(e=e.split("_")[0]),this.pdfViewer.nameTable[""+e]);return t=!e||"SignatureField"!==e.formFieldAnnotationType&&"InitialField"!==e.formFieldAnnotationType&&"SignatureField"!==e.annotName?t:!0},C.prototype.diagramMouseMove=function(e){var t,i,n,o,r,s=this.pdfViewer.allowServerDataBinding,a=this.getElement("_pageDiv_"+(this.currentPageNumber-1)),l=(this.pdfViewer.enableServerDataBinding(!1),this.currentPosition=this.getMousePosition(e),this.pdfViewer.firePageMouseover(this.currentPosition.x,this.currentPosition.y),this.pdfViewer.annotation?this.activeElements.activePageID=this.pdfViewer.annotation.getEventPageNumber(e):this.pdfViewer.formDesignerModule&&(this.activeElements.activePageID=this.pdfViewer.formDesignerModule.getEventPageNumber(e)),gCt(e,this,this.pdfViewer)),h=((this.tool instanceof nCt||this.tool instanceof hCt)&&(l=this.pdfViewer.drawingObject),0<this.pdfViewer.selectedItems.annotations.length&&this.checkSignatureFormField(this.pdfViewer.selectedItems.annotations[0].id));!1!==Cbt.equals(this.currentPosition,this.prevPosition)&&!this.inAction||(!1===this.isMouseDown?(this.eventArgs={},l&&(this.tool=this.getTool(this.action),l.wrapper)&&l.wrapper.children[0]&&(i=l),t=e.target,this.action=this.findToolToActivate(l,this.currentPosition),l&&l.annotationSettings&&l.annotationSettings.isLock&&("Select"!==this.action||this.pdfViewer.annotationModule.checkAllowedInteractions("Select",l)||(this.action=""),"Drag"!==this.action||this.pdfViewer.annotationModule.checkAllowedInteractions("Move",l)||(this.action="Select"),"ResizeSouthEast"!==this.action&&"ResizeNorthEast"!==this.action&&"ResizeNorthWest"!==this.action&&"ResizeSouthWest"!==this.action&&"ResizeNorth"!==this.action&&"ResizeWest"!==this.action&&"ResizeEast"!==this.action&&"ResizeSouth"!==this.action&&!this.action.includes("ConnectorSegmentPoint")&&!this.action.includes("Leader")||this.pdfViewer.annotationModule.checkAllowedInteractions("Resize",l)||(this.action="Select")),this.pdfViewer.designerMode||(je(i)||je(i.formFieldAnnotationType))&&!h||("ResizeSouthEast"===this.action||"ResizeNorthEast"===this.action||"ResizeNorthWest"===this.action||"ResizeSouthWest"===this.action||"ResizeNorth"===this.action||"Drag"===this.action||"ResizeWest"===this.action||"ResizeEast"===this.action||"ResizeSouth"===this.action||this.action.includes("ConnectorSegmentPoint")||this.action.includes("Leader"))&&(this.action=""),this.tool=this.getTool(this.action),this.setCursor(t,e),this.pdfViewer.linkAnnotationModule&&0!==this.pdfViewer.selectedItems.annotations.length&&0!==this.pdfViewer.selectedItems.formFields.length&&this.pdfViewer.linkAnnotationModule.disableHyperlinkNavigationUnderObjects(t,e,this)):(!this.tool&&this.action&&"Rotate"===this.action&&(this.tool=this.getTool(this.action),e.target)&&this.setCursor(e.target,e),this.pdfViewer.designerMode||(je(i)||je(i.formFieldAnnotationType))&&!h||("ResizeSouthEast"===this.action||"ResizeNorthEast"===this.action||"ResizeNorthWest"===this.action||"ResizeSouthWest"===this.action||"ResizeNorth"===this.action||"Drag"===this.action||"ResizeWest"===this.action||"ResizeEast"===this.action||"ResizeSouth"===this.action||this.action.includes("ConnectorSegmentPoint")||this.action.includes("Leader"))&&(this.action="",this.tool=null),this.eventArgs&&this.eventArgs.source?(t=e.target,this.updateDefaultCursor(this.eventArgs.source,t,e)):this.setCursor(e.target,e),this.diagramMouseActionHelper(e),this.tool&&(l&&"FreeText"===l.shapeAnnotationType&&this.pdfViewer.freeTextSettings.allowEditTextOnly&&"Ink"!==this.action&&this.eventArgs.source&&"FreeText"===this.eventArgs.source.shapeAnnotationType&&((t=event.target).style.cursor="default",this.tool=null),null!=this.tool)&&(i={ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},this.eventArgs.info=i,this.tool.mouseMove(this.eventArgs))),this.pdfViewer.drawingObject&&this.pdfViewer.drawingObject.formFieldAnnotationType&&"Drag"!==this.action&&(this.tool instanceof eCt||(this.tool=this.getTool(this.action),this.tool instanceof nCt&&(h=this.pdfViewer.drawingObject,l=this.pdfViewer.formDesignerModule.updateFormFieldInitialSize(h,h.formFieldAnnotationType),t=this.pageContainer.firstElementChild.clientWidth-l.width,i=this.pageContainer.firstElementChild.clientHeight-l.height,this.pdfViewer.formDesignerModule&&h.formFieldAnnotationType&&this.currentPosition.x<t&&this.currentPosition.y<i?(o=document.getElementById("FormField_helper_html_element"))?(n=o.parentElement.id.split("_text_")[1]||o.parentElement.id.split("_textLayer_")[1]||o.parentElement.id.split("_annotationCanvas_")[1]||o.parentElement.id.split("_pageDiv_")[1],parseInt(n,10)!==this.activeElements.activePageID?o.remove("FormField_helper_html_element"):(r=this.getMousePosition(event),"Checkbox"===h.formFieldAnnotationType&&o.firstElementChild.firstElementChild.lastElementChild?o.firstElementChild.firstElementChild.lastElementChild.style.visibility="visible":"SignatureField"===h.formFieldAnnotationType||"InitialField"===h.formFieldAnnotationType?(o.firstElementChild.firstElementChild.style.visibility="visible",o.firstElementChild.lastElementChild.style.visibility="visible"):o.firstElementChild.firstElementChild.style.visibility="visible",o.setAttribute("style","height:"+l.height+"px; width:"+l.width+"px;left:"+r.x+"px; top:"+r.y+"px;position:absolute;opacity: 0.5;"))):this.pdfViewer.formDesignerModule.drawHelper(h.formFieldAnnotationType,h,e):(this.currentPosition.x>t||this.currentPosition.y>i)&&((o=document.getElementById("FormField_helper_html_element"))?(r=this.getMousePosition(event),o.setAttribute("style","height:"+l.height+"px; width:"+l.width+"px;left:"+r.x+"px; top:"+r.y+"px;position:absolute;opacity: 0.5;"),this.currentPosition.x+parseInt(o.style.width,10)>parseInt(a.style.width,10)?"Checkbox"===h.formFieldAnnotationType&&o.firstElementChild.firstElementChild.lastElementChild?o.firstElementChild.firstElementChild.lastElementChild.style.visibility="hidden":"SignatureField"===h.formFieldAnnotationType||"InitialField"===h.formFieldAnnotationType?(o.firstElementChild.firstElementChild.style.visibility="hidden",o.firstElementChild.lastElementChild.style.visibility="hidden"):o.firstElementChild.firstElementChild.style.visibility="hidden":"Checkbox"===h.formFieldAnnotationType&&o.firstElementChild.firstElementChild.lastElementChild?o.firstElementChild.firstElementChild.lastElementChild.style.visibility="visible":"SignatureField"===h.formFieldAnnotationType||"InitialField"===h.formFieldAnnotationType?(o.firstElementChild.firstElementChild.style.visibility="visible",o.firstElementChild.lastElementChild.style.visibility="visible"):o.firstElementChild.firstElementChild.style.visibility="visible"):this.pdfViewer.formDesignerModule.drawHelper(h.formFieldAnnotationType,h,e))))),this.prevPosition=this.currentPosition),this.pdfViewer.enableServerDataBinding(s,!0)},C.prototype.updateDefaultCursor=function(e,t,i){e&&void 0!==e.pageIndex&&e.pageIndex!==this.activeElements.activePageID&&t?this.isPanMode?t.style.cursor="grab":t.style.cursor="default":this.setCursor(t,i)},C.prototype.diagramMouseLeave=function(e){this.currentPosition=this.getMousePosition(e),this.pdfViewer.annotation&&(this.activeElements.activePageID=this.pdfViewer.annotation.getEventPageNumber(e)),isNaN(this.activeElements.activePageID)&&this.pdfViewer.formDesignerModule&&(this.activeElements.activePageID=this.pdfViewer.formDesignerModule.getEventPageNumber(e));var t=gCt(e,this,this.pdfViewer);!1!==Cbt.equals(this.currentPosition,this.prevPosition)&&!this.inAction||(!1===this.isMouseDown?(this.eventArgs={},t&&t.wrapper.children[0]):(this.diagramMouseActionHelper(e),this.tool&&"Drag"!==this.action&&"Stamp"!==this.pdfViewer.tool&&this.tool.currentElement&&"Stamp"!==this.tool.currentElement.shapeAnnotationType&&(this.tool.mouseLeave(this.eventArgs),this.tool=null,this.pdfViewer.annotation)&&this.pdfViewer.annotationModule.renderAnnotations(this.previousPage,null,null,null)),this.prevPosition=this.currentPosition)},C.prototype.diagramMouseActionHelper=function(e){this.eventArgs.position=this.currentPosition,"Drag"===this.action&&this.eventArgs.source instanceof Jbt&&this.getMouseEventArgs(this.currentPosition,this.eventArgs,e),this.getMouseEventArgs(this.currentPosition,this.eventArgs,e,this.eventArgs.source),this.inAction=!0,this.initialEventArgs=null},C.prototype.setCursor=function(e,t){var i,n=this.pdfViewer.annotationModule?this.pdfViewer.annotationModule.freeTextAnnotationModule:null;if(this.tool instanceof eCt)"ResizeNorthWest"===this.tool.corner?(c=this.setResizerCursorType(),e.style.cursor=je(c)?"nw-resize":c):"ResizeNorthEast"===this.tool.corner?(c=this.setResizerCursorType(),e.style.cursor=je(c)?"ne-resize":c):"ResizeSouthWest"===this.tool.corner?(c=this.setResizerCursorType(),e.style.cursor=je(c)?"sw-resize":c):"ResizeSouthEast"===this.tool.corner?(c=this.setResizerCursorType(),e.style.cursor=je(c)?"se-resize":c):"ResizeNorth"===this.tool.corner?(c=this.setResizerCursorType(),e.style.cursor=je(c)?"n-resize":c):"ResizeWest"===this.tool.corner?(c=this.setResizerCursorType(),e.style.cursor=je(c)?"w-resize":c):"ResizeEast"===this.tool.corner?(c=this.setResizerCursorType(),e.style.cursor=je(c)?"e-resize":c):"ResizeSouth"===this.tool.corner&&(c=this.setResizerCursorType(),e.style.cursor=je(c)?"s-resize":c);else if(this.isCommentIconAdded&&this.isAddComment)e.style.cursor="crosshair";else if(this.pdfViewer.enableHandwrittenSignature&&this.isNewSignatureAdded&&this.tool instanceof Uwt)e.style.cursor="crosshair";else if(this.tool instanceof jwt)e.style.cursor="move";else if(this.tool instanceof nCt||this.tool instanceof hCt||this.tool instanceof sCt||n&&n.isNewAddedAnnot||this.tool instanceof Ywt)e.style.cursor="crosshair";else if(this.tool instanceof Jwt)this.tool.endPoint&&this.tool.endPoint.indexOf("Leader0")?(c=this.setResizerCursorType(),e.style.cursor=je(c)?"nw-resize":c):this.tool.endPoint&&this.tool.endPoint.indexOf("Leader1")?(c=this.setResizerCursorType(),e.style.cursor=je(c)?"ne-resize":c):this.tool.endPoint&&this.tool.endPoint.indexOf("ConnectorSegmentPoint")&&(e.style.cursor="sw-resize");else if(e.classList.contains("e-pv-text"))e.style.cursor="text";else if(e.classList.contains("e-pv-hyperlink"))e.style.cursor="pointer";else if(this.isPanMode)this.isViewerMouseDown&&"mousemove"===t.type?e.style.cursor="grabbing":(i=gCt(t,this,this.pdfViewer))&&"mousemove"===t.type?(e.style.cursor="pointer",o=i,r=this.getMousePosition(t),s={left:(p=this.relativePosition(t)).x,top:p.y},a={left:r.x,top:r.y},l={opacity:o.opacity,fillColor:o.fillColor,strokeColor:o.strokeColor,thicknes:o.thickness,author:o.author,subject:o.subject,modifiedDate:o.modifiedDate},this.isMousedOver=!0,h=this.checkSignatureFormField(o.id),o.formFieldAnnotationType?(this.isFormFieldMousedOver=!0,g={id:o.id,name:o.name,value:o.value,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,color:o.color,backgroundColor:o.backgroundColor,borderColor:o.borderColor,thickness:o.thickness,alignment:o.alignment,isReadonly:o.isReadonly,visibility:o.visibility,maxLength:o.maxLength,isRequired:o.isRequired,isPrint:o.isPrint,rotation:o.rotateAngle,tooltip:o.tooltip,options:o.options,isChecked:o.isChecked,isSelected:o.isSelected},this.pdfViewer.fireFormFieldMouseoverEvent("formFieldMouseover",g,o.pageIndex,p.x,p.y,r.x,r.y)):h||this.pdfViewer.fireAnnotationMouseover(o.annotName,o.pageIndex,o.shapeAnnotationType,o.bounds,l,a,s)):(e.style.cursor="grab",this.isMousedOver&&(d=void 0,d=(this.pdfViewer.formDesignerModule||this.pdfViewer.annotation).getEventPageNumber(t),this.isFormFieldMousedOver?this.pdfViewer.fireFormFieldMouseLeaveEvent("formFieldMouseLeave",null,d):this.pdfViewer.fireAnnotationMouseLeave(d),this.isMousedOver=!1,this.isFormFieldMousedOver=!1));else if((i=gCt(t,this,this.pdfViewer))&&0===this.pdfViewer.selectedItems.annotations.length&&"mousemove"===t.type){var o=i,n=this.pdfViewer.nameTable[o.id],r=("HandWrittenSignature"!==n.shapeAnnotationType&&"Ink"!==n.shapeAnnotationType&&n.annotationSettings&&void 0!==n.annotationSettings.isLock&&(n.annotationSettings.isLock=JSON.parse(n.annotationSettings.isLock)),n.annotationSettings&&n.annotationSettings.isLock?e.style.cursor="default":e.style.cursor="pointer",this.getMousePosition(t)),s={left:(p=this.relativePosition(t)).x,top:p.y},a={left:r.x,top:r.y},l={opacity:o.opacity,fillColor:o.fillColor,strokeColor:o.strokeColor,thicknes:o.thickness,author:o.author,subject:o.subject,modifiedDate:o.modifiedDate},h=(this.isMousedOver=!0,this.checkSignatureFormField(o.id));o.formFieldAnnotationType?(this.isFormFieldMousedOver=!0,g={id:o.id,name:o.name,value:o.value,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,color:o.color,backgroundColor:o.backgroundColor,borderColor:o.borderColor,thickness:o.thickness,alignment:o.alignment,isReadonly:o.isReadonly,visibility:o.visibility,maxLength:o.maxLength,isRequired:o.isRequired,isPrint:o.isPrint,rotation:o.rotateAngle,tooltip:o.tooltip,options:o.options,isChecked:o.isChecked,isSelected:o.isSelected},this.fromTarget=o,this.pdfViewer.fireFormFieldMouseoverEvent("formFieldMouseover",g,o.pageIndex,p.x,p.y,r.x,r.y)):h||this.pdfViewer.fireAnnotationMouseover(o.annotName,o.pageIndex,o.shapeAnnotationType,o.bounds,l,a,s)}else if(!this.pdfViewer.formDesignerModule&&t.target.classList.contains("e-pdfviewer-formFields")){for(var d=void 0,r=(this.pdfViewer.annotation&&(d=this.pdfViewer.annotation.getEventPageNumber(t)),this.getMousePosition(t)),p=this.relativePosition(t),c=this.getItemFromSessionStorage("_formfields"),u=JSON.parse(c),g=void 0,m=0;m<u.length;m++)u[parseInt(m.toString(),10)].FieldName===t.target.name&&(g={name:u[parseInt(m.toString(),10)].FieldName,id:u[parseInt(m.toString(),10)].uniqueID});this.isMousedOver=!0,this.isFormFieldMousedOver=!0,this.pdfViewer.fireFormFieldMouseoverEvent("formFieldMouseover",g,d,p.x,p.y,r.x,r.y)}else this.isMousedOver&&(d=void 0,this.pdfViewer.formDesignerModule?d=this.pdfViewer.formDesignerModule.getEventPageNumber(t):this.pdfViewer.annotation&&(d=this.pdfViewer.annotation.getEventPageNumber(t)),this.isFormFieldMousedOver?this.fromTarget?(g={name:this.fromTarget.name,id:this.fromTarget.id,value:this.fromTarget.value,fontFamily:this.fromTarget.fontFamily,fontSize:this.fromTarget.fontSize,fontStyle:this.fromTarget.fontStyle,color:this.fromTarget.color,backgroundColor:this.fromTarget.backgroundColor,borderColor:this.fromTarget.borderColor,thickness:this.fromTarget.thickness,alignment:this.fromTarget.alignment,isReadonly:this.fromTarget.isReadonly,visibility:this.fromTarget.visibility,maxLength:this.fromTarget.maxLength,isRequired:this.fromTarget.isRequired,isPrint:this.fromTarget.isPrint,rotation:this.fromTarget.rotateAngle,tooltip:this.fromTarget.tooltip,options:this.fromTarget.options,isChecked:this.fromTarget.isChecked,isSelected:this.fromTarget.isSelected},this.pdfViewer.fireFormFieldMouseLeaveEvent("formFieldMouseLeave",g,d)):this.pdfViewer.fireFormFieldMouseLeaveEvent("formFieldMouseLeave",null,d):this.pdfViewer.fireAnnotationMouseLeave(d),this.isMousedOver=!1,this.isFormFieldMousedOver=!1,e.style.cursor="default"),i&&1===this.pdfViewer.selectedItems.annotations.length&&"mousemove"===t.type?e.style.cursor="pointer":e.style.cursor="default"},C.prototype.setResizerCursorType=function(){var e;return this.pdfViewer.selectedItems.annotations[0]&&je(this.pdfViewer.selectedItems.annotations[0].annotationSelectorSettings.resizerCursorType)?"FreeText"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?e=je(this.pdfViewer.freeTextSettings.annotationSelectorSettings)?null:this.pdfViewer.freeTextSettings.annotationSelectorSettings.resizerCursorType:"Stamp"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?e=je(this.pdfViewer.stampSettings.annotationSelectorSettings)?null:this.pdfViewer.stampSettings.annotationSelectorSettings.resizerCursorType:"HandWrittenSignature"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"SignatureText"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"SignatureImage"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?e=je(this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings)?null:this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings.resizerCursorType:"Ink"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?e=je(this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings)?null:this.pdfViewer.inkAnnotationSettings.annotationSelectorSettings.resizerCursorType:this.pdfViewer.selectedItems.annotations[0].measureType?this.pdfViewer.selectedItems.annotations[0].measureType&&("Distance calculation"===this.pdfViewer.selectedItems.annotations[0].subject?e=je(this.pdfViewer.distanceSettings.annotationSelectorSettings)?null:this.pdfViewer.distanceSettings.annotationSelectorSettings.resizerCursorType:"Perimeter calculation"===this.pdfViewer.selectedItems.annotations[0].subject?e=je(this.pdfViewer.perimeterSettings.annotationSelectorSettings)?null:this.pdfViewer.perimeterSettings.annotationSelectorSettings.resizerCursorType:"Area calculation"===this.pdfViewer.selectedItems.annotations[0].subject?e=je(this.pdfViewer.areaSettings.annotationSelectorSettings)?null:this.pdfViewer.areaSettings.annotationSelectorSettings.resizerCursorType:"Radius calculation"===this.pdfViewer.selectedItems.annotations[0].subject?e=je(this.pdfViewer.radiusSettings.annotationSelectorSettings)?null:this.pdfViewer.radiusSettings.annotationSelectorSettings.resizerCursorType:"Volume calculation"===this.pdfViewer.selectedItems.annotations[0].subject&&(e=je(this.pdfViewer.volumeSettings.annotationSelectorSettings)?null:this.pdfViewer.volumeSettings.annotationSelectorSettings.resizerCursorType)):"Line"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?e=je(this.pdfViewer.lineSettings.annotationSelectorSettings)?null:this.pdfViewer.lineSettings.annotationSelectorSettings.resizerCursorType:"LineWidthArrowHead"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?e=je(this.pdfViewer.arrowSettings.annotationSelectorSettings)?null:this.pdfViewer.arrowSettings.annotationSelectorSettings.resizerCursorType:"Rectangle"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?e=je(this.pdfViewer.rectangleSettings.annotationSelectorSettings)?null:this.pdfViewer.rectangleSettings.annotationSelectorSettings.resizerCursorType:"Ellipse"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?e=je(this.pdfViewer.circleSettings.annotationSelectorSettings)?null:this.pdfViewer.circleSettings.annotationSelectorSettings.resizerCursorType:"Polygon"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&(e=je(this.pdfViewer.polygonSettings.annotationSelectorSettings)?null:this.pdfViewer.polygonSettings.annotationSelectorSettings.resizerCursorType):this.pdfViewer.selectedItems.annotations[0]&&(e=this.pdfViewer.selectedItems.annotations[0].annotationSelectorSettings.resizerCursorType),e=e||this.pdfViewer.annotationSelectorSettings.resizerCursorType},C.prototype.getTool=function(e){switch(e){case"Select":return new _wt(this.pdfViewer,this);case"Drag":return new jwt(this.pdfViewer,this);case"ResizeSouthEast":case"ResizeSouthWest":case"ResizeNorthEast":case"ResizeNorthWest":case"ResizeSouth":case"ResizeNorth":case"ResizeWest":case"ResizeEast":return new eCt(this.pdfViewer,this,e);case"ConnectorSourceEnd":case"ConnectorTargetEnd":case"Leader":case"ConnectorSegmentPoint":return new Jwt(this.pdfViewer,this,e);case"DrawTool":return new nCt(this.pdfViewer,this,this.pdfViewer.drawingObject);case"Polygon":return new sCt(this.pdfViewer,this,"Polygon");case"Distance":return new hCt(this.pdfViewer,this,"Leader1",void 0);case"Line":return new hCt(this.pdfViewer,this,"ConnectorSegmentPoint_1",this.pdfViewer.drawingObject);case"Perimeter":return new sCt(this.pdfViewer,this,"Perimeter");case"Rotate":return new cCt(this.pdfViewer,this);case"Stamp":return new Uwt(this.pdfViewer,this);case"Ink":return new Ywt(this.pdfViewer,this,this.pdfViewer.drawingObject)}return-1<e.indexOf("ConnectorSegmentPoint")||-1<e.indexOf("Leader")?new Jwt(this.pdfViewer,this,e):null},C.prototype.diagramMouseUp=function(e){var t,i=this.pdfViewer.allowServerDataBinding,n=(this.pdfViewer.enableServerDataBinding(!1),this.action.toLowerCase().includes("resize")||this.action.toLowerCase().includes("connectorsegmentpoint")),n="Drag"===this.action||n||(this.tool instanceof nCt||this.tool instanceof hCt||this.tool instanceof sCt)&&this.tool.dragging&&this.tool.drawingObject,o=(this.tool&&(this.inAction||3===e.which||"Drag"===this.action&&(this.action="Select",t=gCt(e,this,this.pdfViewer)),this.tool instanceof sCt||this.tool instanceof hCt||this.tool instanceof nCt||(this.inAction=!1,this.isMouseDown=!1),this.currentPosition=this.getMousePosition(e),this.tool)&&(this.eventArgs.position=this.currentPosition,this.getMouseEventArgs(this.currentPosition,this.eventArgs,e,this.eventArgs.source),this.isMetaKey(e),o={ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},this.eventArgs.info=o,this.eventArgs.clickCount=e.detail,"touchend"===e.type?this.eventArgs.isTouchMode=!0:this.eventArgs.isTouchMode=!1,this.tool.mouseUp(this.eventArgs),this.isAnnotationMouseDown=!1,this.isFormFieldMouseDown=!1,(this.tool instanceof nCt||this.tool instanceof hCt||this.tool instanceof sCt)&&!this.tool.dragging&&(this.inAction=!1,this.isMouseDown=!1),n&&(t=gCt(e,this,this.pdfViewer),this.isShapeAnnotationModule()||this.isCalibrateAnnotationModule())&&this.pdfViewer.annotation.onShapesMouseup(t,e),this.isAnnotationDrawn=!1),e.target);e.cancelable&&(!this.isDeviceiOS||this.pdfViewer.annotationModule)&&this.skipPreventDefault(o)&&e.preventDefault(),this.eventArgs={},this.pdfViewer.enableServerDataBinding(i,!0),"MouseUp"===this.pdfViewer.contextMenuSettings.contextMenuAction&&this.pdfViewer.selectedItems&&(this.pdfViewer.selectedItems.annotations&&0<this.pdfViewer.selectedItems.annotations.length||this.pdfViewer.selectedItems.formFields&&0<this.pdfViewer.selectedItems.formFields.length)&&this.contextMenuModule.open(this.mouseY,this.mouseX,this.viewerContainer)},C.prototype.skipPreventDefault=function(e){var t=!1,i=!1;return this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.freeTextAnnotationModule&&this.pdfViewer.annotationModule.freeTextAnnotationModule.isInuptBoxInFocus&&(i=!0),t=!e.parentElement||"foreign-object"===e.parentElement.className||e.classList.contains("e-pv-radio-btn")||e.classList.contains("e-pv-radiobtn-span")||e.classList.contains("e-pv-checkbox-div")||e.classList.contains("e-pdfviewer-formFields")||e.classList.contains("e-pdfviewer-ListBox")||e.classList.contains("e-pdfviewer-signatureformfields")||"free-text-input"===e.className&&"TEXTAREA"===e.tagName||i||"e-pv-hyperlink"===e.className||!(0<e.parentElement.classList.length)||e.parentElement.classList.contains("e-editable-elements")||this.isAddComment?t:!0},C.prototype.isMetaKey=function(e){return navigator.platform.match("Mac")?e.metaKey:e.ctrlKey},C.prototype.diagramMouseDown=function(e){var t,i=this,n=(this.tool instanceof jwt&&!(this.tool instanceof Uwt)&&this.tool.inAction&&(this.diagramMouseUp(e),1===e.which)&&(this.preventContextmenu=!0,setTimeout(function(){i.preventContextmenu=!1},200)),this.pdfViewer.allowServerDataBinding),o=(this.pdfViewer.enableServerDataBinding(!1),e.touches),r=(this.isMouseDown=!0,this.isAnnotationAdded=!1,this.currentPosition=this.prevPosition=this.getMousePosition(e),!(this.eventArgs={})),s=("Stamp"===this.pdfViewer.tool&&(r=!(this.pdfViewer.tool="")),this.pdfViewer.annotation&&(s=this.pdfViewer.annotation.getEventPageNumber(e),this.activeElements.activePageID=0<=s?s:this.pdfViewer.currentPageNumber-1),gCt(e,this,this.pdfViewer));if(!je(s)||je(a=e.target)||je(a.id)||(a=a.id.split("_")[0],s=this.pdfViewer.nameTable[""+a]),je(s)||"SignatureField"!==s.formFieldAnnotationType&&"InitialField"!==s.formFieldAnnotationType&&"SignatureField"!==s.annotName&&"InitialField"!==s.annotName?this.isSignInitialClick=!1:this.isSignInitialClick=!0,!F.isDevice||this.pdfViewer.enableDesktopMode||!s||s instanceof Ubt||e.preventDefault(),this.pdfViewer.annotation&&this.pdfViewer.enableStampAnnotations){var a=this.pdfViewer.annotationModule.stampAnnotationModule;if(a&&a.isNewStampAnnot){var l=s;if(l=!l&&this.pdfViewer.selectedItems.annotations[0]?this.pdfViewer.selectedItems.annotations[0]:l){this.isViewerMouseDown=!1,l.opacity=this.pdfViewer.stampSettings.opacity,this.isNewStamp=!0;var h=void 0,h=("Image"===l.shapeAnnotationType?this.pdfViewer.customStampSettings:this.pdfViewer.stampSettings).opacity;if(this.pdfViewer.nodePropertyChange(l,{opacity:h}),this.pdfViewer.annotation.stampAnnotationModule.isStampAddMode=!1,"Image"===l.shapeAnnotationType&&!this.isAlreadyAdded){this.stampAdded=!0;for(var d=l.id,p=(a.currentStampAnnotation&&a.currentStampAnnotation.signatureName&&(d=a.currentStampAnnotation.signatureName),!1),c=0;c<this.customStampCollection.length;c++)if(this.customStampCollection[parseInt(c.toString(),10)].customStampName===d){p=!0;break}p&&(d=l.id),d=a.customStampName||a.currentStampAnnotation.signatureName,this.customStampCollection.push({customStampName:d,customStampImageSource:l.data}),N&&this.pdfViewer._dotnetInstance.invokeMethodAsync("UpdateCustomStampCollection",d,l.data)}this.pdfViewer.customStampSettings.enableCustomStamp&&this.pdfViewer.customStampSettings.isAddToMenu&&(this.stampAdded=!0),this.isAlreadyAdded=!1,a.updateDeleteItems(l.pageIndex,l,l.opacity),a.resetAnnotation(),a.isNewStampAnnot=!1}}}this.isNewSignatureAdded&&(this.signatureCount++,this.currentSignatureAnnot=null,(h=je(h=s)&&this.pdfViewer.selectedItems.annotations[0]?this.pdfViewer.selectedItems.annotations[0]:h)&&(this.signatureAdded=!(l=""),this.signatureModule.storeSignatureData(h.pageIndex,h),a={left:h.bounds.x,top:h.bounds.y,width:h.bounds.width,height:h.bounds.height},l="Draw"===this.signatureModule.signaturetype?this.signatureModule.saveImageString:h.data,this.pdfViewer.fireSignatureAdd(h.pageIndex,h.signatureName,h.shapeAnnotationType,a,h.opacity,h.strokeColor,h.thickness,l)),this.isNewSignatureAdded=!1),this.pdfViewer.annotationModule&&!0===(a=this.pdfViewer.annotationModule.freeTextAnnotationModule).isNewFreeTextAnnot&&(h=void 0,e.target&&(-1<e.target.id.indexOf("_text")||-1<e.target.id.indexOf("_annotationCanvas")||e.target.classList.contains("e-pv-hyperlink"))&&this.pdfViewer.annotation&&(t=this.pdfViewer.annotation.getEventPageNumber(e),l=this.getAnnotationCanvas("_annotationCanvas_",t))&&(g=(l=l.getBoundingClientRect()).x||l.left,u=l.y||l.top,h=new dvt(g+5,u+5,l.width-10,l.height-10)),o&&(this.mouseX=o[0].clientX,this.mouseY=o[0].clientY),h)&&h.containsPoint({x:this.mouseX,y:this.mouseY})&&a.isNewAddedAnnot&&(t=this.pdfViewer.annotation.getEventPageNumber(e),this.pdfViewer.freeTextSettings.enableAutoFit||(g=this.getZoomFactor(),u=this.currentPosition.x+a.defautWidth*g,(l=this.getPageWidth(t))<=u&&(this.currentPosition.x=l-a.defautWidth*g,this.currentPosition.x<=0&&(this.currentPosition.x=5),a.defautWidth=a.defautWidth*g>=l?l-10:a.defautWidth)),a.addInuptElemet(this.currentPosition,null,t),this.pdfViewer.toolbar&&this.pdfViewer.toolbar.annotationToolbarModule&&(o=this.pdfViewer.toolbar.annotationToolbarModule,N||o.primaryToolbar.deSelectItem(o.freeTextEditItem)),e.preventDefault(),a.isNewAddedAnnot=!1);s&&s.wrapper.children[0],this.tool&&(!this.tool||this.tool.drawingObject)||(r?(this.action="Select",this.tool=this.getTool(this.action)):(this.action=this.findToolToActivate(s,this.currentPosition),s&&s.annotationSettings&&s.annotationSettings.isLock&&("Select"!==this.action||this.pdfViewer.annotationModule.checkAllowedInteractions("Select",s)||(this.action=""),"Drag"!==this.action||this.pdfViewer.annotationModule.checkAllowedInteractions("Move",s)||(this.action="Select"),"Rotate"===this.action&&(this.action="Select"),"ResizeSouthEast"!==this.action&&"ResizeNorthEast"!==this.action&&"ResizeNorthWest"!==this.action&&"ResizeSouthWest"!==this.action&&"ResizeSouth"!==this.action&&"ResizeNorth"!==this.action&&"ResizeWest"!==this.action&&"ResizeEast"!==this.action&&!this.action.includes("ConnectorSegmentPoint")&&!this.action.includes("Leader")||this.pdfViewer.annotationModule.checkAllowedInteractions("Resize",s)||(this.action="Select")),this.tool=this.getTool(this.action),this.tool||(this.action=this.pdfViewer.tool||"Select",this.tool=this.getTool(this.action)))),this.getMouseEventArgs(this.currentPosition,this.eventArgs,e),this.eventArgs.position=this.currentPosition,this.tool&&(this.isAnnotationMouseDown=!1,this.isFormFieldMouseDown=!1,this.isAnnotationMouseMove=!1,this.isFormFieldMouseMove=!1,je(s)||"annotations"===s.propName||(this.eventArgs.source=s),this.tool.mouseDown(this.eventArgs),this.isAnnotationDrawn=!0,this.signatureAdded=!0),this.pdfViewer.annotation&&this.pdfViewer.annotation.onAnnotationMouseDown(),!this.pdfViewer.selectedItems||1!==this.pdfViewer.selectedItems.formFields.length||je(this.pdfViewer.toolbar)||je(this.pdfViewer.toolbar.formDesignerToolbarModule)||this.pdfViewer.toolbar.formDesignerToolbarModule.showHideDeleteIcon(!0);var u,g,m=(m=1===this.pdfViewer.selectedItems.annotations.length?this.pdfViewer.nameTable[this.pdfViewer.selectedItems.annotations[0].id.split("_")[0]+"_content"]:null)||(1===this.pdfViewer.selectedItems.annotations.length?this.pdfViewer.nameTable[this.pdfViewer.selectedItems.annotations[0].id]:null);this.eventArgs&&this.eventArgs.source&&(this.eventArgs.source.formFieldAnnotationType||m)&&!this.pdfViewer.designerMode&&(h=void 0,h=(h=m?this.pdfViewer.nameTable[this.pdfViewer.selectedItems.annotations[0].id.split("_")[0]]:this.eventArgs.source)||this.pdfViewer.formFieldCollections[this.pdfViewer.formFieldCollections.findIndex(function(e){return e.id===m.id})])&&(u={name:h.name,id:h.id,fontFamily:h.fontFamily,fontSize:h.fontSize,fontStyle:h.fontStyle,color:h.color,value:h.value,type:h.formFieldAnnotationType||h.type,backgroundColor:h.backgroundColor,alignment:h.alignment,bounds:h.bounds},g=(g=document.getElementById(h.id))||(document.getElementById(h.id+"_content_html_element")?document.getElementById(h.id+"_content_html_element").children[0].children[0]:null))&&(this.currentTarget=g,this.pdfViewer.fireFormFieldClickEvent("formFieldClicked",u,!1,0===e.button)),this.initialEventArgs={source:this.eventArgs.source,sourceWrapper:this.eventArgs.sourceWrapper},this.initialEventArgs.position=this.currentPosition,this.initialEventArgs.info=this.eventArgs.info,this.pdfViewer.enableServerDataBinding(n,!0)},C.prototype.exportAnnotationsAsObject=function(i){var n=this;if(this.pdfViewer.annotationModule&&this.updateExportItem())return new Promise(function(t,e){n.createRequestForExportAnnotations(!0,i).then(function(e){t(e)})})},C.prototype.getItemFromSessionStorage=function(e){return this.isStorageExceed?this.formFieldStorage[this.documentId+e]:C.sessionStorageManager.getItem(this.documentId+e)},C.prototype.setStyleToTextDiv=function(e,t,i,n,o,r,s){var a=this.getZoomFactor();s&&(a=1,e.style.position="absolute"),e.style.left=t*a+"px",e.style.top=i*a+"px",e.style.height=r*a+"px",e.style.width=o*a+"px",e.style.margin="0px",0<n&&(e.style.fontSize=n*a+"px")},C.prototype.ConvertPointToPixel=function(e){return e*(96/72)},C.prototype.getAngle=function(e){var t=0;if(e)switch(e){case 0:t=0;break;case 1:t=90;break;case 2:t=180;break;case 3:t=270}return t},C.prototype.setItemInSessionStorage=function(e,t){var i=Math.round(JSON.stringify(e).length/1024),n=C.sessionStorageManager.getWindowSessionStorageSize();4500<i&&(this.isStorageExceed=!0,this.pdfViewer.formFieldsModule)&&!this.isFormStorageExceed&&(this.pdfViewer.formFieldsModule.clearFormFieldStorage(),this.isFormStorageExceed=!0),this.isStorageExceed?this.formFieldStorage[this.documentId+t]=JSON.stringify(e):4500<i+n?(this.isStorageExceed=!0,this.pdfViewer.formFieldsModule&&this.pdfViewer.formFieldsModule.clearFormFieldStorage(),this.isFormStorageExceed=!0,this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.clearAnnotationStorage(),this.formFieldStorage[this.documentId+t]=JSON.stringify(e)):C.sessionStorageManager.setItem(this.documentId+t,JSON.stringify(e))},C.prototype.exportFormFieldsAsObject=function(i){var n=this;if(this.pdfViewer.formFieldsModule)return new Promise(function(t,e){n.createRequestForExportFormfields(!0,i).then(function(e){t(e)})})},C.prototype.importAnnotations=function(e,t,i){this.pdfViewer.annotationModule&&this.createRequestForImportAnnotations(e,t,i)},C.prototype.exportAnnotations=function(e){this.pdfViewer.annotationModule&&this.updateExportItem()&&this.createRequestForExportAnnotations(!1,e)},C.prototype.createRequestForExportAnnotations=function(o,r,s){var a=this,l=this,e=new Promise(function(t,e){var i,n=a.constructJsonDownload();n.annotationDataFormat=r,n.action="ExportAnnotations",l.pdfViewer.fireExportStart(n)&&(l.jsonDocumentId&&(n.document=l.jsonDocumentId),i=l.pdfViewer.serviceUrl+"/"+l.pdfViewer.serverActionSettings.exportAnnotations,l.exportAnnotationRequestHandler=new DRt(a.pdfViewer),l.exportAnnotationRequestHandler.url=i,l.exportAnnotationRequestHandler.mode=!0,l.exportAnnotationRequestHandler.responseType="text",a.clientSideRendering?(i=a.pdfViewer.pdfRendererModule.exportAnnotation(n,o),o?l.exportAnnotationFileDownload(i,l,r,n,o,s).then(function(e){t(e)}):l.exportAnnotationFileDownload(i,l,r,n,o,s).then(function(e){t(e)})):l.exportAnnotationRequestHandler.send(n),l.exportAnnotationRequestHandler.onSuccess=function(e){var e=e.data;l.checkRedirection(e)||(e?o?l.exportAnnotationFileDownload(e,l,r,n,o,s).then(function(e){t(e)}):l.exportAnnotationFileDownload(e,l,r,n,o,s).then(function(e){t(e)}):(e=void 0,e=null!==l.pdfViewer.exportAnnotationFileName?l.pdfViewer.exportAnnotationFileName:l.pdfViewer.fileName,l.pdfViewer.fireExportSuccess("Exported data saved in server side successfully",e)))},l.exportAnnotationRequestHandler.onFailure=function(e){l.pdfViewer.fireExportFailed(n.pdfAnnotation,e.statusText)},l.exportAnnotationRequestHandler.onError=function(e){l.pdfViewer.fireExportFailed(n.pdfAnnotation,e.statusText)})});return!o&&!s||e},C.prototype.handleServerSideExport=function(r,s,a,l,h,d){var p=this;return new Promise(function(e){if(r){if(r="object"==typeof r?JSON.parse(r):r){var t,i,n=s.pdfViewer.fireAjaxRequestSuccess(s.pdfViewer.serverActionSettings.exportAnnotations,r);if(h||d&&!N)r.split("base64,")[1]?(t=r,i=atob(r.split(",")[1]),h&&(t="Json"===l.annotationDataFormat?(i=s.getSanitizedString(i),JSON.parse(i)):i),null!==s.pdfViewer.exportAnnotationFileName?s.pdfViewer.fireExportSuccess(t,s.pdfViewer.exportAnnotationFileName):s.pdfViewer.fireExportSuccess(t,s.pdfViewer.fileName),s.updateDocumentAnnotationCollections(),e(d?r:i)):s.pdfViewer.fireExportFailed(l.pdfAnnotation,s.pdfViewer.localeObj.getConstant("Export Failed"));else if("Json"===a)if(r.split("base64,")[1]){if(n)return r;var o=s.createBlobUrl(r.split("base64,")[1],"application/json");F.isIE||"edge"===F.info.name?null!==s.pdfViewer.exportAnnotationFileName?window.navigator.msSaveOrOpenBlob(o,s.pdfViewer.exportAnnotationFileName.split(".")[0]+".json"):window.navigator.msSaveOrOpenBlob(o,s.pdfViewer.fileName.split(".")[0]+".json"):s.downloadExportFormat(o,a),s.updateDocumentAnnotationCollections()}else N?p.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_ExportFailed").then(function(e){s.openImportExportNotificationPopup(e)}):s.openImportExportNotificationPopup(s.pdfViewer.localeObj.getConstant("Export Failed")),s.pdfViewer.fireExportFailed(l.pdfAnnotation,s.pdfViewer.localeObj.getConstant("Export Failed"));else if(r.split("base64,")[1]){if(n)return r;o=s.createBlobUrl(r.split("base64,")[1],"application/vnd.adobe.xfdf");F.isIE||"edge"===F.info.name?window.navigator.msSaveOrOpenBlob(o,s.pdfViewer.fileName.split(".")[0]+".xfdf"):s.downloadExportFormat(o,a),s.updateDocumentAnnotationCollections()}else N?p.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_ExportFailed").then(function(e){s.openImportExportNotificationPopup(e)}):s.openImportExportNotificationPopup(s.pdfViewer.localeObj.getConstant("Export Failed")),s.pdfViewer.fireExportFailed(l,s.pdfViewer.localeObj.getConstant("Export Failed"))}if("string"!=typeof r)try{"string"==typeof r&&(s.onControlError(500,r,s.pdfViewer.serverActionSettings.exportAnnotations),r=null)}catch(e){s.pdfViewer.fireExportFailed(l.pdfAnnotation,s.pdfViewer.localeObj.getConstant("Export Failed")),s.onControlError(500,r,s.pdfViewer.serverActionSettings.exportAnnotations),r=null}}return""})},C.prototype.handleClientSideExport=function(r,s,a,l,h,d){var p=this;return new Promise(function(e){if(r){var t,i,n=s.pdfViewer.fireAjaxRequestSuccess(s.pdfViewer.serverActionSettings.exportAnnotations,r);if(h||d&&!N)r&&"string"!=typeof r?(t=r,i=new TextDecoder("utf-8").decode(r),h&&(t="Json"===l.annotationDataFormat?(i=s.getSanitizedString(i),JSON.parse(i)):i),null!==s.pdfViewer.exportAnnotationFileName?s.pdfViewer.fireExportSuccess(t,s.pdfViewer.exportAnnotationFileName):s.pdfViewer.fireExportSuccess(t,s.pdfViewer.fileName),s.updateDocumentAnnotationCollections(),e(d?r:i)):s.pdfViewer.fireExportFailed(l.pdfAnnotation,s.pdfViewer.localeObj.getConstant("Export Failed"));else if("Json"===a)if(r&&"string"!=typeof r){if(n)return r;var o=new Blob([r],{type:"application/json"});F.isIE||"edge"===F.info.name?null!==s.pdfViewer.exportAnnotationFileName?window.navigator.msSaveOrOpenBlob(o,s.pdfViewer.exportAnnotationFileName.split(".")[0]+".json"):window.navigator.msSaveOrOpenBlob(o,s.pdfViewer.fileName.split(".")[0]+".json"):s.downloadExportFormat(o,a),s.updateDocumentAnnotationCollections()}else N?p.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_ExportFailed").then(function(e){s.openImportExportNotificationPopup(e)}):s.openImportExportNotificationPopup(s.pdfViewer.localeObj.getConstant("Export Failed")),s.pdfViewer.fireExportFailed(l.pdfAnnotation,s.pdfViewer.localeObj.getConstant("Export Failed"));else if(r&&"string"!=typeof r){if(n)return r;o=new Blob([r],{type:"application/vnd.adobe.xfdf"});F.isIE||"edge"===F.info.name?window.navigator.msSaveOrOpenBlob(o,s.pdfViewer.fileName.split(".")[0]+".xfdf"):s.downloadExportFormat(o,a),s.updateDocumentAnnotationCollections()}else N?p.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_ExportFailed").then(function(e){s.openImportExportNotificationPopup(e)}):s.openImportExportNotificationPopup(s.pdfViewer.localeObj.getConstant("Export Failed")),s.pdfViewer.fireExportFailed(l,s.pdfViewer.localeObj.getConstant("Export Failed"))}else try{"string"==typeof r&&(s.onControlError(500,r,s.pdfViewer.serverActionSettings.exportAnnotations),r=null)}catch(e){s.pdfViewer.fireExportFailed(l.pdfAnnotation,s.pdfViewer.localeObj.getConstant("Export Failed")),s.onControlError(500,r,s.pdfViewer.serverActionSettings.exportAnnotations),r=null}return""})},C.prototype.exportAnnotationFileDownload=function(e,t,i,n,o,r){return this.clientSideRendering?this.handleClientSideExport(e,t,i,n,o,r):this.handleServerSideExport(e,t,i,n,o,r)},C.prototype.getDataOnSuccess=function(i){var n=this;return new Promise(function(e){var t=null;(t=n).pdfViewer.fireExportSuccess(i,t.pdfViewer.fileName),t.updateDocumentAnnotationCollections(),e(i)})},C.prototype.updateModifiedDateToLocalDate=function(e,t){if(e[""+t]&&0<e[""+t].length){var i=e[""+t];if(i)for(var n=0;n<i.length;n++)if(i[parseInt(n.toString(),10)].ModifiedDate=this.convertUTCDateTimeToLocalDateTime(i[parseInt(n.toString(),10)].ModifiedDate),i[parseInt(n.toString(),10)].Comments)for(var o=0;o<i[parseInt(n.toString(),10)].Comments.length;o++)i[parseInt(n.toString(),10)].Comments[parseInt(o.toString(),10)].ModifiedDate=this.convertUTCDateTimeToLocalDateTime(i[parseInt(n.toString(),10)].Comments[parseInt(o.toString(),10)].ModifiedDate)}},C.prototype.convertUTCDateTimeToLocalDateTime=function(e){return this.globalize=new Ti(this.pdfViewer.locale),e=null!=e&&""!==e?this.clientSideRendering?new Date(e):new Date(Date.parse(e+" UTC")):(e=new Date,e=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()),new Date(e)),this.globalize.formatDate(e,{format:"M/d/yyyy h:mm:ss a",type:"dateTime"})},C.prototype.createRequestForImportAnnotations=function(r,e,t){var s=this;if(!t&&s.isPDFViewerJson?this.isJsonImported=!0:this.isJsonImported=!1,"object"!=typeof r||r instanceof Uint8Array){s.pdfViewer.fireImportStart(r),t="Json"===e&&s.isPDFViewerJson?{fileName:r,action:"ImportAnnotations",elementId:s.pdfViewer.element.id,hashId:s.hashId,uniqueId:s.documentId,annotationDataFormat:e}:{importedData:r,action:"ImportAnnotations",elementId:s.pdfViewer.element.id,hashId:s.hashId,uniqueId:s.documentId,annotationDataFormat:e},(t=Object.assign(t,this.constructJsonDownload())).action="ImportAnnotations",s.jsonDocumentId&&(t.documentId&&delete t.documentId,t.document=s.jsonDocumentId);var e=s.pdfViewer.serviceUrl+"/"+s.pdfViewer.serverActionSettings.importAnnotations;s.importAnnotationRequestHandler=new DRt(s.pdfViewer),s.importAnnotationRequestHandler.url=e,s.importAnnotationRequestHandler.mode=!0,s.importAnnotationRequestHandler.responseType="text",this.clientSideRendering?(e=this.pdfViewer.pdfRendererModule.importAnnotations(t))&&this.addAnnotationOnImport(e,r):s.importAnnotationRequestHandler.send(t),s.importAnnotationRequestHandler.onSuccess=function(e){var t=e.data,e=s.checkRedirection(t);if(!e&&t){if("object"!=typeof t)try{"object"!=typeof(t=JSON.parse(t))&&(s.onControlError(500,t,s.pdfViewer.serverActionSettings.importAnnotations),t=null)}catch(e){s.pdfViewer.fireImportFailed(r,s.pdfViewer.localeObj.getConstant("File not found")),N?this.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_FileNotFound").then(function(e){s.openImportExportNotificationPopup(e)}):s.openImportExportNotificationPopup(s.pdfViewer.localeObj.getConstant("File not found")),s.onControlError(500,t,s.pdfViewer.serverActionSettings.importAnnotations),t=null}if(t&&(s.pdfViewer.fireAjaxRequestSuccess(s.pdfViewer.serverActionSettings.importAnnotations,t),t.pdfAnnotation)){for(var i,n=Object.keys(t.pdfAnnotation),o=0;o<Object.keys(t.pdfAnnotation).length;o++)i=t.pdfAnnotation[n[parseInt(o.toString(),10)]],s.updateModifiedDateToLocalDate(i,"annotationOrder"),s.updateModifiedDateToLocalDate(i,"freeTextAnnotation"),s.updateModifiedDateToLocalDate(i,"measureShapeAnnotation"),s.updateModifiedDateToLocalDate(i,"shapeAnnotation"),s.updateModifiedDateToLocalDate(i,"signatureAnnotation"),s.updateModifiedDateToLocalDate(i,"signatureInkAnnotation"),s.updateModifiedDateToLocalDate(i,"stampAnnotations"),s.updateModifiedDateToLocalDate(i,"stickyNotesAnnotation"),s.updateModifiedDateToLocalDate(i,"textMarkupAnnotation");s.reRenderAnnotations(t.pdfAnnotation),s.isImportedAnnotation=!0,s.updateDocumentEditedProperty(!0),s.pdfViewer.fireImportSuccess(t.pdfAnnotation)}}},s.importAnnotationRequestHandler.onFailure=function(e){s.pdfViewer.fireImportFailed(r,e.statusText)},s.importAnnotationRequestHandler.onError=function(e){s.pdfViewer.fireImportFailed(r,e.statusText)}}else{if(r&&r.pdfAnnotation)for(var i=Object.keys(r.pdfAnnotation),n=0;n<i.length;n++){var o=r.pdfAnnotation[i[parseInt(n.toString(),10)]];this.updateModifiedDateToLocalDate(o,"freeTextAnnotation"),this.updateModifiedDateToLocalDate(o,"measureShapeAnnotation"),this.updateModifiedDateToLocalDate(o,"shapeAnnotation"),this.updateModifiedDateToLocalDate(o,"signatureAnnotation"),this.updateModifiedDateToLocalDate(o,"signatureInkAnnotation"),this.updateModifiedDateToLocalDate(o,"stampAnnotations"),this.updateModifiedDateToLocalDate(o,"stickyNotesAnnotation"),this.updateModifiedDateToLocalDate(o,"textMarkupAnnotation")}s.reRenderAnnotations(r.pdfAnnotation),s.isImportedAnnotation=!0,s.updateDocumentEditedProperty(!0),this.isAddAnnotation||s.pdfViewer.fireImportSuccess(r.pdfAnnotation)}},C.prototype.addAnnotationOnImport=function(e,t){var i=this;if(e)if(i.pdfViewer.fireAjaxRequestSuccess(i.pdfViewer.serverActionSettings.importAnnotations,e),e.pdfAnnotation){for(var n,o=Object.keys(e.pdfAnnotation),r=0;r<Object.keys(e.pdfAnnotation).length;r++)n=e.pdfAnnotation[o[parseInt(r.toString(),10)]],i.updateModifiedDateToLocalDate(n,"annotationOrder"),i.updateModifiedDateToLocalDate(n,"freeTextAnnotation"),i.updateModifiedDateToLocalDate(n,"measureShapeAnnotation"),i.updateModifiedDateToLocalDate(n,"shapeAnnotation"),i.updateModifiedDateToLocalDate(n,"signatureAnnotation"),i.updateModifiedDateToLocalDate(n,"signatureInkAnnotation"),i.updateModifiedDateToLocalDate(n,"stampAnnotations"),i.updateModifiedDateToLocalDate(n,"stickyNotesAnnotation"),i.updateModifiedDateToLocalDate(n,"textMarkupAnnotation");i.reRenderAnnotations(e.pdfAnnotation),i.isImportedAnnotation=!0,i.updateDocumentEditedProperty(!0),i.pdfViewer.fireImportSuccess(e.pdfAnnotation)}else i.pdfViewer.fireImportFailed(t,i.pdfViewer.localeObj.getConstant("File not found"))},C.prototype.openImportExportNotificationPopup=function(e){this.pdfViewer.showNotificationDialog&&this.createNotificationPopup(e)},C.prototype.reRenderAnnotations=function(e){if(e){this.isImportAction=!0;var t=0;this.isImportedAnnotation?this.importedAnnotation=this.combineImportedData(this.importedAnnotation,e):0<this.pageCount&&(this.importedAnnotation=e),this.isImportedAnnotation||(t=0);for(var i,n=0;n<this.pageCount;n++)if(e[parseInt(n.toString(),10)]){var o=[],r=C.sessionStorageManager.getItem(this.documentId+"_annotations_textMarkup"),s=C.sessionStorageManager.getItem(this.documentId+"_annotations_shape"),a=C.sessionStorageManager.getItem(this.documentId+"_annotations_shape_measure"),l=C.sessionStorageManager.getItem(this.documentId+"_annotations_stamp"),h=C.sessionStorageManager.getItem(this.documentId+"_annotations_sticky"),d=C.sessionStorageManager.getItem(this.documentId+"_annotations_freetext"),p=C.sessionStorageManager.getItem(this.documentId+"_annotations_sign"),c=C.sessionStorageManager.getItem(this.documentId+"_annotations_ink");if(this.isStorageExceed&&(r=this.annotationStorage[this.documentId+"_annotations_textMarkup"],s=this.annotationStorage[this.documentId+"_annotations_shape"],a=this.annotationStorage[this.documentId+"_annotations_shape_measure"],l=this.annotationStorage[this.documentId+"_annotations_stamp"],h=this.annotationStorage[this.documentId+"_annotations_sticky"],d=this.annotationStorage[this.documentId+"_annotations_freetext"],c=this.annotationStorage[this.documentId+"_annotations_ink"]),this.drawPageAnnotations(e[parseInt(n.toString(),10)],n),this.isImportedAnnotation){for(var u=!1,g=0;g<this.annotationPageList.length;g++)this.annotationPageList[parseInt(g.toString(),10)]===n&&(u=!0);u&&(this.annotationPageList[parseInt(t.toString(),10)]=n,t+=1)}else this.annotationPageList[parseInt(t.toString(),10)]=n,t+=1;if(e[parseInt(n.toString(),10)].textMarkupAnnotation&&0!==e[parseInt(n.toString(),10)].textMarkupAnnotation.length&&(r&&(b=JSON.parse(r),e[parseInt(n.toString(),10)].textMarkupAnnotation=this.checkAnnotationCollections(b,e[parseInt(n.toString(),10)].textMarkupAnnotation,n)),e[parseInt(n.toString(),10)].textMarkupAnnotation=this.checkAnnotationCommentsCollections(e[parseInt(n.toString(),10)].textMarkupAnnotation,n),o.textMarkupAnnotation=e[parseInt(n.toString(),10)].textMarkupAnnotation),e[parseInt(n.toString(),10)].shapeAnnotation&&0!==e[parseInt(n.toString(),10)].shapeAnnotation.length&&(s&&(b=JSON.parse(s),e[parseInt(n.toString(),10)].shapeAnnotation=this.checkAnnotationCollections(b,e[parseInt(n.toString(),10)].shapeAnnotation,n)),e[parseInt(n.toString(),10)].shapeAnnotation=this.checkAnnotationCommentsCollections(e[parseInt(n.toString(),10)].shapeAnnotation,n),o.shapeAnnotation=e[parseInt(n.toString(),10)].shapeAnnotation),e[parseInt(n.toString(),10)].measureShapeAnnotation&&0!==e[parseInt(n.toString(),10)].measureShapeAnnotation.length&&(a&&(b=JSON.parse(a),e[parseInt(n.toString(),10)].measureShapeAnnotation=this.checkAnnotationCollections(b,e[parseInt(n.toString(),10)].measureShapeAnnotation,n)),e[parseInt(n.toString(),10)].measureShapeAnnotation=this.checkAnnotationCommentsCollections(e[parseInt(n.toString(),10)].measureShapeAnnotation,n),o.measureShapeAnnotation=e[parseInt(n.toString(),10)].measureShapeAnnotation),e[parseInt(n.toString(),10)].stampAnnotations&&0!==e[parseInt(n.toString(),10)].stampAnnotations.length&&(l&&(b=JSON.parse(l),e[parseInt(n.toString(),10)].stampAnnotations=this.checkAnnotationCollections(b,e[parseInt(n.toString(),10)].stampAnnotations,n)),e[parseInt(n.toString(),10)].stampAnnotations=this.checkAnnotationCommentsCollections(e[parseInt(n.toString(),10)].stampAnnotations,n),o.stampAnnotations=e[parseInt(n.toString(),10)].stampAnnotations),e[parseInt(n.toString(),10)].stickyNotesAnnotation&&0!==e[parseInt(n.toString(),10)].stickyNotesAnnotation.length&&(h&&(b=JSON.parse(h),e[parseInt(n.toString(),10)].stickyNotesAnnotation=this.checkAnnotationCollections(b,e[parseInt(n.toString(),10)].stickyNotesAnnotation,n)),e[parseInt(n.toString(),10)].stickyNotesAnnotation=this.checkAnnotationCommentsCollections(e[parseInt(n.toString(),10)].stickyNotesAnnotation,n),o.stickyNotesAnnotation=e[parseInt(n.toString(),10)].stickyNotesAnnotation),e[parseInt(n.toString(),10)].freeTextAnnotation&&0!==e[parseInt(n.toString(),10)].freeTextAnnotation.length&&(d&&(b=JSON.parse(d),e[parseInt(n.toString(),10)].freeTextAnnotation=this.checkAnnotationCollections(b,e[parseInt(n.toString(),10)].freeTextAnnotation,n)),e[parseInt(n.toString(),10)].freeTextAnnotation=this.checkAnnotationCommentsCollections(e[parseInt(n.toString(),10)].freeTextAnnotation,n),o.freeTextAnnotation=e[parseInt(n.toString(),10)].freeTextAnnotation),e[parseInt(n.toString(),10)].signatureAnnotation&&0!==e[parseInt(n.toString(),10)].signatureAnnotation.length&&(p&&(b=JSON.parse(p),e[parseInt(n.toString(),10)].signatureAnnotation=this.checkSignatureCollections(b,e[parseInt(n.toString(),10)].signatureAnnotation,n)),o.signatureAnnotation=e[parseInt(n.toString(),10)].signatureAnnotation),e[parseInt(n.toString(),10)].signatureInkAnnotation&&0!==e[parseInt(n.toString(),10)].signatureInkAnnotation.length&&(c&&(b=JSON.parse(c),e[parseInt(n.toString(),10)].signatureInkAnnotation=this.checkAnnotationCollections(b,e[parseInt(n.toString(),10)].signatureInkAnnotation,n)),e[parseInt(n.toString(),10)].signatureInkAnnotation=this.checkAnnotationCommentsCollections(e[parseInt(n.toString(),10)].signatureInkAnnotation,n),o.signatureInkAnnotation=e[parseInt(n.toString(),10)].signatureInkAnnotation),e[parseInt(n.toString(),10)].annotationOrder)for(var m=e[parseInt(n.toString(),10)].annotationOrder,f=[],y=0;y<m.length;y++){var v=m[parseInt(y.toString(),10)].AnnotType?m[parseInt(y.toString(),10)].AnnotType:m[parseInt(y.toString(),10)].AnnotationType,b=(f.push(m[parseInt(y.toString(),10)]),void 0);switch(v){case"textMarkup":if(0!==e[parseInt(n.toString(),10)].textMarkupAnnotation.length||0!==f.length){this.pdfViewer.annotationModule.stickyNotesAnnotationModule.renderAnnotationComments(f,n);for(g=0;g<f.length;g++)je(this.pdfViewer.annotationModule.textMarkupAnnotationModule)||this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateCollections(this.pdfViewer.annotationModule.textMarkupAnnotationModule.updateTextMarkupAnnotationCollections(m[parseInt(y.toString(),10)],n))}break;case"shape":if(0!==e[parseInt(n.toString(),10)].shapeAnnotation.length||0!==f.length){this.pdfViewer.annotationModule.stickyNotesAnnotationModule.renderAnnotationComments(f,n);for(g=0;g<f.length;g++)this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateCollections(this.pdfViewer.annotationModule.shapeAnnotationModule.updateShapeAnnotationCollections(m[parseInt(y.toString(),10)],n))}break;case"shape_measure":if(0!==e[parseInt(n.toString(),10)].measureShapeAnnotation.length||0!==f.length){this.pdfViewer.annotationModule.stickyNotesAnnotationModule.renderAnnotationComments(f,n);for(g=0;g<f.length;g++)this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateCollections(this.pdfViewer.annotationModule.measureAnnotationModule.updateMeasureAnnotationCollections(m[parseInt(y.toString(),10)],n))}break;case"stamp":if(0!==e[parseInt(n.toString(),10)].stampAnnotations.length||0!==f.length){this.pdfViewer.annotationModule.stickyNotesAnnotationModule.renderAnnotationComments(f,n);for(g=0;g<f.length;g++)this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateCollections(this.pdfViewer.annotationModule.stampAnnotationModule.updateStampAnnotationCollections(m[parseInt(y.toString(),10)],n))}break;case"Text Box":case"freeText":if(0!==e[parseInt(n.toString(),10)].freeTextAnnotation.length||0!==f.length){this.pdfViewer.annotationModule.stickyNotesAnnotationModule.renderAnnotationComments(f,n);for(g=0;g<f.length;g++)this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateCollections(this.pdfViewer.annotationModule.freeTextAnnotationModule.updateFreeTextAnnotationCollections(m[parseInt(y.toString(),10)],n))}break;case"sticky":if(0!==e[parseInt(n.toString(),10)].stickyNotesAnnotation.length||0!==f.length){this.pdfViewer.annotationModule.stickyNotesAnnotationModule.renderAnnotationComments(f,n);for(g=0;g<f.length;g++)this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateCollections(this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateStickyNotesAnnotationCollections(m[parseInt(y.toString(),10)],n))}break;case"signature":if(0!==e[parseInt(n.toString(),10)].signatureAnnotation.length||0!==f.length)for(g=0;g<f.length;g++)this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateCollections(this.signatureModule.updateSignatureCollections(m[parseInt(y.toString(),10)],n),!0);break;case"Ink":case"ink":if(0!==e[parseInt(n.toString(),10)].signatureInkAnnotation.length||0!==f.length){this.pdfViewer.annotationModule.stickyNotesAnnotationModule.renderAnnotationComments(f,n);for(g=0;g<e[parseInt(n.toString(),10)].annotationOrder[parseInt(y.toString(),10)].length;g++)this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateCollections(this.pdfViewer.annotationModule.inkAnnotationModule.updateInkCollections(m[parseInt(y.toString(),10)],n))}}f=[]}this.updateImportedAnnotationsInDocumentCollections(o,n)}0<this.pageCount&&this.pdfViewer.annotationModule.stickyNotesAnnotationModule&&!this.pdfViewer.annotationModule.stickyNotesAnnotationModule.isAnnotationRendered&&(i=this.createAnnotationsCollection())&&(this.documentAnnotationCollections=this.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateAnnotationsInDocumentCollections(this.importedAnnotation,i))}this.isImportAction=!1},C.prototype.updateImportedAnnotationsInDocumentCollections=function(e,t){if(this.documentAnnotationCollections){var i=this.documentAnnotationCollections[parseInt(t.toString(),10)];if(i){if(e.textMarkupAnnotation&&0!==e.textMarkupAnnotation.length)for(var n=0;n<e.textMarkupAnnotation.length;n++)i.textMarkupAnnotation.push(e.textMarkupAnnotation[parseInt(n.toString(),10)]);if(e.shapeAnnotation&&0!==e.shapeAnnotation.length)for(n=0;n<e.shapeAnnotation.length;n++)i.shapeAnnotation.push(e.shapeAnnotation[parseInt(n.toString(),10)]);if(e.measureShapeAnnotation&&0!==e.measureShapeAnnotation.length)for(n=0;n<e.measureShapeAnnotation.length;n++)i.measureShapeAnnotation.push(e.measureShapeAnnotation[parseInt(n.toString(),10)]);if(e.stampAnnotations&&0!==e.stampAnnotations.length)for(n=0;n<e.stampAnnotations.length;n++)i.stampAnnotations.push(e.stampAnnotations[parseInt(n.toString(),10)]);if(e.stickyNotesAnnotation&&0!==e.stickyNotesAnnotation.length)for(n=0;n<e.stickyNotesAnnotation.length;n++)i.stickyNotesAnnotation.push(e.stickyNotesAnnotation[parseInt(n.toString(),10)]);if(e.freeTextAnnotation&&0!==e.freeTextAnnotation.length)for(n=0;n<e.freeTextAnnotation.length;n++)i.freeTextAnnotation.push(e.freeTextAnnotation[parseInt(n.toString(),10)]);if(e.signatureAnnotation&&0!==e.signatureAnnotation.length)for(n=0;n<e.signatureAnnotation.length;n++)i.signatureAnnotation.push(e.signatureAnnotation[parseInt(n.toString(),10)]);if(e.signatureInkAnnotation&&0!==e.signatureInkAnnotation.length)for(n=0;n<e.signatureInkAnnotation.length;n++)i.signatureInkAnnotation.push(e.signatureInkAnnotation[parseInt(n.toString(),10)]);this.documentAnnotationCollections[parseInt(t.toString(),10)]=i}}},C.prototype.checkDocumentCollectionData=function(e,t){var i,n,o,r,s,a,l,h,d;if(t?i=t:this.documentAnnotationCollections&&(t=this.documentAnnotationCollections[parseInt(e.toString(),10)])&&(i=owt(t)),i)return t=C.sessionStorageManager.getItem(this.documentId+"_annotations_textMarkup"),n=C.sessionStorageManager.getItem(this.documentId+"_annotations_shape"),o=C.sessionStorageManager.getItem(this.documentId+"_annotations_shape_measure"),r=C.sessionStorageManager.getItem(this.documentId+"_annotations_stamp"),s=C.sessionStorageManager.getItem(this.documentId+"_annotations_sticky"),a=C.sessionStorageManager.getItem(this.documentId+"_annotations_freetext"),l=C.sessionStorageManager.getItem(this.documentId+"_annotations_ink"),h=C.sessionStorageManager.getItem(this.documentId+"_annotations_sign"),this.isStorageExceed&&(t=this.annotationStorage[this.documentId+"_annotations_textMarkup"],n=this.annotationStorage[this.documentId+"_annotations_shape"],o=this.annotationStorage[this.documentId+"_annotations_shape_measure"],r=this.annotationStorage[this.documentId+"_annotations_stamp"],s=this.annotationStorage[this.documentId+"_annotations_sticky"],a=this.annotationStorage[this.documentId+"_annotations_freetext"],l=this.annotationStorage[this.documentId+"_annotations_ink"],h=this.annotationStorage[this.documentId+"_annotations_sign"]),i.textMarkupAnnotation&&0!==i.textMarkupAnnotation.length&&t&&(d=JSON.parse(t))&&(i.textMarkupAnnotation=this.findImportedAnnotations(d,i.textMarkupAnnotation,e)),i.shapeAnnotation&&0!==i.shapeAnnotation.length&&n&&(d=JSON.parse(n))&&(i.shapeAnnotation=this.findImportedAnnotations(d,i.shapeAnnotation,e)),i.measureShapeAnnotation&&0!==i.measureShapeAnnotation.length&&o&&(d=JSON.parse(o))&&(i.measureShapeAnnotation=this.findImportedAnnotations(d,i.measureShapeAnnotation,e)),i.stampAnnotations&&0!==i.stampAnnotations.length&&r&&(d=JSON.parse(r))&&(i.stampAnnotations=this.findImportedAnnotations(d,i.stampAnnotations,e)),i.stickyNotesAnnotation&&0!==i.stickyNotesAnnotation.length&&s&&(d=JSON.parse(s))&&(i.stickyNotesAnnotation=this.findImportedAnnotations(d,i.stickyNotesAnnotation,e)),i.freeTextAnnotation&&0!==i.freeTextAnnotation.length&&a&&(d=JSON.parse(a))&&(i.freeTextAnnotation=this.findImportedAnnotations(d,i.freeTextAnnotation,e)),i.signatureInkAnnotation&&0!==i.signatureInkAnnotation.length&&l&&(d=JSON.parse(l))&&(i.signatureInkAnnotation=this.findImportedAnnotations(d,i.signatureInkAnnotation,e)),i.signatureAnnotation&&0!==i.signatureAnnotation.length&&h&&(d=JSON.parse(l))&&(i.signatureAnnotation=this.findImportedAnnotations(d,i.signatureAnnotation,e)),i},C.prototype.findImportedAnnotations=function(e,t,i){for(var n=null,o=0;o<e.length;o++)e[parseInt(o.toString(),10)].pageIndex===i&&(n=e[parseInt(o.toString(),10)].annotations);if(n)for(var r=0;r<n.length;r++)for(var s=0;s<t.length;s++)n[parseInt(r.toString(),10)].annotName===t[parseInt(s.toString(),10)].AnnotName&&(t.splice(s,1),s-=1);return n=null,t},C.prototype.setAnnotationSettings=function(e){je(e)||(e.AnnotationSettings=e.AnnotationSettings||this.pdfViewer.annotationModule.updateAnnotationSettings(e),e.IsLocked&&(e.AnnotationSettings.isLock=e.IsLocked))},C.prototype.drawPageAnnotations=function(t,i,e){var n=this;if((t=e?t[parseInt(i.toString(),10)]:t)&&!t.annotationOrder&&(e=["freeTextAnnotation","measureShapeAnnotation","shapeAnnotation","signatureAnnotation","signatureInkAnnotation","stampAnnotations","stickyNotesAnnotation","textMarkupAnnotation"].find(function(e){if(t[""+e]&&0!==t[""+e].length)return t[""+e]}))&&(t.annotationOrder=t[""+e]),t){var o=t.annotationOrder,r=[],s=!0;if(!je(o))for(var a=0;a<o.length;a++){var l=o[parseInt(a.toString(),10)].AnnotType?o[parseInt(a.toString(),10)].AnnotType:o[parseInt(a.toString(),10)].AnnotationType,h=(r.push(o[parseInt(a.toString(),10)]),void 0),d=void 0;switch(l){case"textMarkup":s=!1,h=C.sessionStorageManager.getItem(this.documentId+"_annotations_textMarkup"),(r=(h=this.isStorageExceed?this.annotationStorage[this.documentId+"_annotations_textMarkup"]:h)&&(d=JSON.parse(h))?this.checkAnnotationCollections(d,r,i):r)&&this.setAnnotationSettings(r[0]),t.textMarkupAnnotation=this.checkAnnotationCommentsCollections(t.textMarkupAnnotation,i),this.pdfViewer.annotationModule.renderAnnotations(i,null,null,r,null,!0);break;case"shape":s=!1,h=C.sessionStorageManager.getItem(this.documentId+"_annotations_shape"),(h=this.isStorageExceed?this.annotationStorage[this.documentId+"_annotations_shape"]:h)&&(d=JSON.parse(h),r=this.checkAnnotationCollections(d,r,i)),r&&this.setAnnotationSettings(r[0]),t.shapeAnnotation=this.checkAnnotationCommentsCollections(t.shapeAnnotation,i),this.pdfViewer.annotationModule.renderAnnotations(i,r,null,null,null,!0);break;case"shape_measure":s=!1,h=C.sessionStorageManager.getItem(this.documentId+"_annotations_shape_measure"),(h=this.isStorageExceed?this.annotationStorage[this.documentId+"_annotations_shape_measure"]:h)&&(d=JSON.parse(h),r=this.checkAnnotationCollections(d,r,i)),r&&this.setAnnotationSettings(r[0]),t.measureShapeAnnotation=this.checkAnnotationCommentsCollections(t.measureShapeAnnotation,i),this.pdfViewer.annotationModule.renderAnnotations(i,null,r,null,null,!0);break;case"stamp":h=C.sessionStorageManager.getItem(this.documentId+"_annotations_stamp"),(h=this.isStorageExceed?this.annotationStorage[this.documentId+"_annotations_stamp"]:h)&&(d=JSON.parse(h),r=this.checkAnnotationCollections(d,r,i)),r&&this.setAnnotationSettings(r[0]),t.stampAnnotations=this.checkAnnotationCommentsCollections(t.stampAnnotations,i),this.pdfViewer.annotationModule.stampAnnotationModule.renderStampAnnotations(r,i,null,!0);break;case"Text Box":case"freeText":h=C.sessionStorageManager.getItem(this.documentId+"_annotations_freetext"),(h=this.isStorageExceed?this.annotationStorage[this.documentId+"_annotations_freetext"]:h)&&(d=JSON.parse(h),r=this.checkAnnotationCollections(d,r,i)),r&&this.setAnnotationSettings(r[0]),t.freeTextAnnotation=this.checkAnnotationCommentsCollections(t.freeTextAnnotation,i),this.pdfViewer.annotationModule.freeTextAnnotationModule.renderFreeTextAnnotations(r,i,!0);break;case"sticky":h=C.sessionStorageManager.getItem(this.documentId+"_annotations_sticky"),(h=this.isStorageExceed?this.annotationStorage[this.documentId+"_annotations_sticky"]:h)&&(d=JSON.parse(h),r=this.checkAnnotationCollections(d,r,i)),r&&this.setAnnotationSettings(r[0]),t.stickyNotesAnnotation=this.checkAnnotationCommentsCollections(t.stickyNotesAnnotation,i),this.pdfViewer.annotationModule.stickyNotesAnnotationModule.renderStickyNotesAnnotations(r,i);break;case"signature":case"Signature":case"SignatureText":case"SignatureImage":h=C.sessionStorageManager.getItem(this.documentId+"_annotations_sign"),d=JSON.parse(h),r&&this.setAnnotationSettings(r[0]),d&&(t.signatureAnnotation=this.checkSignatureCollections(d,r,i)),this.signatureModule.renderExistingSignature(r,i,!0);break;case"Ink":case"ink":h=C.sessionStorageManager.getItem(this.documentId+"_annotations_ink"),(h=this.isStorageExceed?this.annotationStorage[this.documentId+"_annotations_ink"]:h)&&(d=JSON.parse(h),r=this.checkAnnotationCollections(d,r,i)),r&&this.setAnnotationSettings(r[0]),t.signatureInkAnnotation=this.checkAnnotationCommentsCollections(t.signatureInkAnnotation,i),this.pdfViewer.annotationModule.inkAnnotationModule.renderExistingInkSignature(r,i,!0)}r=[]}s&&["_annotationCanvas_"+i,"_blendAnnotationsIntoCanvas_"+i].forEach(function(e){e=n.getElement(e);e&&n.pdfViewer.drawing.refreshCanvasDiagramLayer(e,i)})}},C.prototype.checkSignatureCollections=function(e,t,i){for(var n=null,o=0;o<e.length;o++)e[parseInt(o.toString(),10)].pageIndex===i&&(n=e[parseInt(o.toString(),10)].annotations);if(n)for(var r=0;r<n.length;r++)for(var s=0;s<t.length;s++)n[parseInt(r.toString(),10)].signatureName===t[parseInt(s.toString(),10)].SignatureName&&(t.splice(s,1),s-=1);return n=null,t},C.prototype.checkAnnotationCollections=function(e,t,i){for(var n=null,o=0;o<e.length;o++)e[parseInt(o.toString(),10)].pageIndex===i&&(n=e[parseInt(o.toString(),10)].annotations);if(n)for(var r=0;r<n.length;r++)for(var s=0;s<t.length;s++)n[parseInt(r.toString(),10)].annotName===t[parseInt(s.toString(),10)].AnnotName&&(t.splice(s,1),s-=1);return n=null,t},C.prototype.checkAnnotationCommentsCollections=function(e,t){if(this.annotationComments){var i=this.annotationComments[parseInt(t.toString(),10)];if(i=this.selectAnnotationCollections(i))for(var n=0;n<i.length;n++)for(var o=0;o<e.length;o++)i[parseInt(n.toString(),10)].AnnotName===e[parseInt(o.toString(),10)].AnnotName&&(e.splice(o,1),o-=1);i=null}return e},C.prototype.selectAnnotationCollections=function(e){var t=[];if(e){if(e.textMarkupAnnotation&&0!==e.textMarkupAnnotation.length)for(var i=0;i<e.textMarkupAnnotation.length;i++)t.push(e.textMarkupAnnotation[parseInt(i.toString(),10)]);if(e.shapeAnnotation&&0!==e.shapeAnnotation.length)for(i=0;i<e.shapeAnnotation.length;i++)t.push(e.shapeAnnotation[parseInt(i.toString(),10)]);if(e.measureShapeAnnotation&&0!==e.measureShapeAnnotation.length)for(i=0;i<e.measureShapeAnnotation.length;i++)t.push(e.measureShapeAnnotation[parseInt(i.toString(),10)]);if(e.stampAnnotations&&0!==e.stampAnnotations.length)for(i=0;i<e.stampAnnotations.length;i++)t.push(e.stampAnnotations[parseInt(i.toString(),10)]);if(e.stickyNotesAnnotation&&0!==e.stickyNotesAnnotation.length)for(i=0;i<e.stickyNotesAnnotation.length;i++)t.push(e.stickyNotesAnnotation[parseInt(i.toString(),10)]);if(e.freeTextAnnotation&&0!==e.freeTextAnnotation.length)for(i=0;i<e.freeTextAnnotation.length;i++)t.push(e.freeTextAnnotation[parseInt(i.toString(),10)]);if(e.signatureInkAnnotation&&0!==e.signatureInkAnnotation.length)for(i=0;i<e.signatureInkAnnotation.length;i++)t.push(e.signatureInkAnnotation[parseInt(i.toString(),10)])}return t},C.prototype.saveImportedAnnotations=function(){var e=C.sessionStorageManager.getItem(this.documentId+"_annotations_textMarkup"),t=C.sessionStorageManager.getItem(this.documentId+"_annotations_shape"),i=C.sessionStorageManager.getItem(this.documentId+"_annotations_shape_measure"),n=C.sessionStorageManager.getItem(this.documentId+"_annotations_stamp"),o=C.sessionStorageManager.getItem(this.documentId+"_annotations_sticky"),r=C.sessionStorageManager.getItem(this.documentId+"_annotations_freetext"),s=C.sessionStorageManager.getItem(this.documentId+"_annotations_ink"),a=C.sessionStorageManager.getItem(this.documentId+"_annotations_sign");if(this.isStorageExceed&&(e=this.annotationStorage[this.documentId+"_annotations_textMarkup"],t=this.annotationStorage[this.documentId+"_annotations_shape"],i=this.annotationStorage[this.documentId+"_annotations_shape_measure"],n=this.annotationStorage[this.documentId+"_annotations_stamp"],o=this.annotationStorage[this.documentId+"_annotations_sticky"],r=this.annotationStorage[this.documentId+"_annotations_freetext"],s=this.annotationStorage[this.documentId+"_annotations_ink"],a=this.annotationStorage[this.documentId+"_annotations_sign"]),this.downloadCollections={textMarkupObject:e,shapeObject:t,measureShapeObject:i,stampObject:n,stickyObject:o,freeTextObject:r,inkObject:s,signatureObject:a},this.documentAnnotationCollections)for(var l,h=0;h<this.pageCount;h++)this.documentAnnotationCollections[parseInt(h.toString(),10)]&&(l=owt(this.documentAnnotationCollections[parseInt(h.toString(),10)]),l=this.checkDocumentCollectionData(h,l),this.savePageAnnotations(l,h))},C.prototype.savePageAnnotations=function(e,t){if(0!==e.textMarkupAnnotation.length)for(var i=0;i<e.textMarkupAnnotation.length;i++)je(this.pdfViewer.annotationModule.textMarkupAnnotationModule)||this.pdfViewer.annotationModule.textMarkupAnnotationModule.saveImportedTextMarkupAnnotations(e.textMarkupAnnotation[parseInt(i.toString(),10)],t);if(0!==e.shapeAnnotation.length)for(i=0;i<e.shapeAnnotation.length;i++)this.pdfViewer.annotationModule.shapeAnnotationModule.saveImportedShapeAnnotations(e.shapeAnnotation[parseInt(i.toString(),10)],t);if(0!==e.measureShapeAnnotation.length)for(i=0;i<e.measureShapeAnnotation.length;i++)this.pdfViewer.annotationModule.measureAnnotationModule.saveImportedMeasureAnnotations(e.measureShapeAnnotation[parseInt(i.toString(),10)],t);if(0!==e.stampAnnotations.length)for(i=0;i<e.stampAnnotations.length;i++)this.pdfViewer.annotationModule.stampAnnotationModule.saveImportedStampAnnotations(e.stampAnnotations[parseInt(i.toString(),10)],t);if(0!==e.stickyNotesAnnotation.length)for(i=0;i<e.stickyNotesAnnotation.length;i++)this.pdfViewer.annotationModule.stickyNotesAnnotationModule.saveImportedStickyNotesAnnotations(e.stickyNotesAnnotation[parseInt(i.toString(),10)],t);if(0!==e.freeTextAnnotation.length)for(i=0;i<e.freeTextAnnotation.length;i++)this.pdfViewer.annotationModule.freeTextAnnotationModule.saveImportedFreeTextAnnotations(e.freeTextAnnotation[parseInt(i.toString(),10)],t);if(0!==e.signatureInkAnnotation.length){this.pdfViewer.isSignatureEditable||(e.signatureInkAnnotation=this.canUpdateSignCollection(e.signatureInkAnnotation));for(i=0;i<e.signatureInkAnnotation.length;i++)this.pdfViewer.annotationModule.inkAnnotationModule.saveImportedInkAnnotation(e.signatureInkAnnotation[parseInt(i.toString(),10)],t)}0===e.signatureAnnotation.length||this.pdfViewer.isSignatureEditable||(e.signatureAnnotation=this.canUpdateSignCollection(e.signatureAnnotation))},C.prototype.updateDocumentAnnotationCollections=function(){C.sessionStorageManager.removeItem(this.documentId+"_annotations_textMarkup"),C.sessionStorageManager.removeItem(this.documentId+"_annotations_shape"),C.sessionStorageManager.removeItem(this.documentId+"_annotations_shape_measure"),C.sessionStorageManager.removeItem(this.documentId+"_annotations_stamp"),C.sessionStorageManager.removeItem(this.documentId+"_annotations_sticky"),C.sessionStorageManager.removeItem(this.documentId+"_annotations_freetext"),C.sessionStorageManager.removeItem(this.documentId+"_annotations_ink"),this.downloadCollections&&(this.isStorageExceed?(this.annotationStorage[this.documentId+"_annotations_textMarkup"]=this.downloadCollections.textMarkupObject,this.annotationStorage[this.documentId+"_annotations_shape"]=this.downloadCollections.shapeObject,this.annotationStorage[this.documentId+"_annotations_shape_measure"]=this.downloadCollections.measureShapeObject,this.annotationStorage[this.documentId+"_annotations_stamp"]=this.downloadCollections.stampObject,this.annotationStorage[this.documentId+"_annotations_sticky"]=this.downloadCollections.stickyObject,this.annotationStorage[this.documentId+"_annotations_freetext"]=this.downloadCollections.freeTextObject,this.annotationStorage[this.documentId+"_annotations_ink"]=this.downloadCollections.inkObject):(this.downloadCollections.textMarkupObject&&C.sessionStorageManager.setItem(this.documentId+"_annotations_textMarkup",this.downloadCollections.textMarkupObject),this.downloadCollections.shapeObject&&C.sessionStorageManager.setItem(this.documentId+"_annotations_shape",this.downloadCollections.shapeObject),this.downloadCollections.measureShapeObject&&C.sessionStorageManager.setItem(this.documentId+"_annotations_shape_measure",this.downloadCollections.measureShapeObject),this.downloadCollections.stampObject&&C.sessionStorageManager.setItem(this.documentId+"_annotations_stamp",this.downloadCollections.stampObject),this.downloadCollections.stickyObject&&C.sessionStorageManager.setItem(this.documentId+"_annotations_sticky",this.downloadCollections.stickyObject),this.downloadCollections.freeTextObject&&C.sessionStorageManager.setItem(this.documentId+"_annotations_freetext",this.downloadCollections.freeTextObject),this.downloadCollections.inkObject&&C.sessionStorageManager.setItem(this.documentId+"_annotations_ink",this.downloadCollections.inkObject)))},C.prototype.createAnnotationJsonData=function(){var e,t,i,n,o,r,s,a,l={};if(this.saveImportedAnnotations(),this.isTextMarkupAnnotationModule()&&(this.isJsonExported=!0,e=this.pdfViewer.annotationModule.textMarkupAnnotationModule.saveTextMarkupAnnotations()),this.isShapeAnnotationModule()&&(this.isJsonExported=!0,t=this.pdfViewer.annotationModule.shapeAnnotationModule.saveShapeAnnotations()),this.isCalibrateAnnotationModule()&&(this.isJsonExported=!0,i=this.pdfViewer.annotationModule.measureAnnotationModule.saveMeasureShapeAnnotations()),this.isStampAnnotationModule()&&(n=this.pdfViewer.annotationModule.stampAnnotationModule.saveStampAnnotations()),this.isCommentAnnotationModule()&&(o=this.pdfViewer.annotationModule.stickyNotesAnnotationModule.saveStickyAnnotations()),this.isFreeTextAnnotationModule()&&(r=this.pdfViewer.annotationModule.freeTextAnnotationModule.saveFreeTextAnnotations()),this.isInkAnnotationModule()&&(a=this.pdfViewer.annotationModule.inkAnnotationModule.saveInkSignature()),this.pdfViewer.isSignatureEditable)s=this.signatureModule.saveSignature();else{for(var h=[],d=0;d<this.pageCount;d++)h[parseInt(d.toString(),10)]=[];s=JSON.stringify(h)}for(var p=0;p<this.pageCount;p++){var c={textMarkupAnnotation:JSON.parse(e)[parseInt(p.toString(),10)],shapeAnnotation:JSON.parse(t)[parseInt(p.toString(),10)],measureShapeAnnotation:JSON.parse(i)[parseInt(p.toString(),10)],stampAnnotations:JSON.parse(n)[parseInt(p.toString(),10)],stickyNotesAnnotation:JSON.parse(o)[parseInt(p.toString(),10)],freeTextAnnotation:JSON.parse(r)[parseInt(p.toString(),10)],signatureAnnotation:JSON.parse(s)[parseInt(p.toString(),10)],signatureInkAnnotation:JSON.parse(a)[parseInt(p.toString(),10)]};l[parseInt(p.toString(),10)]=c}return JSON.stringify(l)},C.prototype.combineImportedData=function(e,t){for(var i,n=0;n<this.pageCount;n++)t[parseInt(n.toString(),10)]&&(e[parseInt(n.toString(),10)]?(t[parseInt(n.toString(),10)].textMarkupAnnotation&&0!==t[parseInt(n.toString(),10)].textMarkupAnnotation.length&&(e[parseInt(n.toString(),10)].textMarkupAnnotation?(t[parseInt(n.toString(),10)].textMarkupAnnotation=this.checkImportedData(e[parseInt(n.toString(),10)].textMarkupAnnotation,t[parseInt(n.toString(),10)].textMarkupAnnotation,n),0!==t[parseInt(n.toString(),10)].textMarkupAnnotation.length&&(e[parseInt(n.toString(),10)].textMarkupAnnotation=e[parseInt(n.toString(),10)].textMarkupAnnotation.concat(t[parseInt(n.toString(),10)].textMarkupAnnotation))):e[parseInt(n.toString(),10)].textMarkupAnnotation=t[parseInt(n.toString(),10)].textMarkupAnnotation),t[parseInt(n.toString(),10)].shapeAnnotation&&0!==t[parseInt(n.toString(),10)].shapeAnnotation.length&&(e[parseInt(n.toString(),10)].shapeAnnotation?(t[parseInt(n.toString(),10)].shapeAnnotation=this.checkImportedData(e[parseInt(n.toString(),10)].shapeAnnotation,t[parseInt(n.toString(),10)].shapeAnnotation,n),0!==t[parseInt(n.toString(),10)].shapeAnnotation.length&&(e[parseInt(n.toString(),10)].shapeAnnotation=e[parseInt(n.toString(),10)].shapeAnnotation.concat(t[parseInt(n.toString(),10)].shapeAnnotation))):e[parseInt(n.toString(),10)].shapeAnnotation=t[parseInt(n.toString(),10)].shapeAnnotation),t[parseInt(n.toString(),10)].measureShapeAnnotation&&0!==t[parseInt(n.toString(),10)].measureShapeAnnotation.length&&(e[parseInt(n.toString(),10)].measureShapeAnnotation?(t[parseInt(n.toString(),10)].measureShapeAnnotation=this.checkImportedData(e[parseInt(n.toString(),10)].measureShapeAnnotation,t[parseInt(n.toString(),10)].measureShapeAnnotation,n),0!==t[parseInt(n.toString(),10)].measureShapeAnnotation.length&&(e[parseInt(n.toString(),10)].measureShapeAnnotation=e[parseInt(n.toString(),10)].measureShapeAnnotation.concat(t[parseInt(n.toString(),10)].measureShapeAnnotation))):e[parseInt(n.toString(),10)].measureShapeAnnotation=t[parseInt(n.toString(),10)].measureShapeAnnotation),t[parseInt(n.toString(),10)].stampAnnotations&&0!==t[parseInt(n.toString(),10)].stampAnnotations.length&&(e[parseInt(n.toString(),10)].stampAnnotations?(t[parseInt(n.toString(),10)].stampAnnotations=this.checkImportedData(e[parseInt(n.toString(),10)].stampAnnotations,t[parseInt(n.toString(),10)].stampAnnotations,n),0!==t[parseInt(n.toString(),10)].stampAnnotations.length&&(e[parseInt(n.toString(),10)].stampAnnotations=e[parseInt(n.toString(),10)].stampAnnotations.concat(t[parseInt(n.toString(),10)].stampAnnotations))):e[parseInt(n.toString(),10)].stampAnnotations=t[parseInt(n.toString(),10)].stampAnnotations),t[parseInt(n.toString(),10)].stickyNotesAnnotation&&0!==t[parseInt(n.toString(),10)].stickyNotesAnnotation.length&&(e[parseInt(n.toString(),10)].stickyNotesAnnotation?(t[parseInt(n.toString(),10)].stickyNotesAnnotation=this.checkImportedData(e[parseInt(n.toString(),10)].stickyNotesAnnotation,t[parseInt(n.toString(),10)].stickyNotesAnnotation,n),0!==t[parseInt(n.toString(),10)].stickyNotesAnnotation.length&&(e[parseInt(n.toString(),10)].stickyNotesAnnotation=e[parseInt(n.toString(),10)].stickyNotesAnnotation.concat(t[parseInt(n.toString(),10)].stickyNotesAnnotation))):e[parseInt(n.toString(),10)].stickyNotesAnnotation=t[parseInt(n.toString(),10)].stickyNotesAnnotation),t[parseInt(n.toString(),10)].freeTextAnnotation&&0!==t[parseInt(n.toString(),10)].freeTextAnnotation.length&&(e[parseInt(n.toString(),10)].freeTextAnnotation?(t[parseInt(n.toString(),10)].freeTextAnnotation=this.checkImportedData(e[parseInt(n.toString(),10)].freeTextAnnotation,t[parseInt(n.toString(),10)].freeTextAnnotation,n),0!==t[parseInt(n.toString(),10)].freeTextAnnotation.length&&(e[parseInt(n.toString(),10)].freeTextAnnotation=e[parseInt(n.toString(),10)].freeTextAnnotation.concat(t[parseInt(n.toString(),10)].freeTextAnnotation))):e[parseInt(n.toString(),10)].freeTextAnnotation=t[parseInt(n.toString(),10)].freeTextAnnotation),t[parseInt(n.toString(),10)].signatureInkAnnotation&&0!==t[parseInt(n.toString(),10)].signatureInkAnnotation.length&&(e[parseInt(n.toString(),10)].signatureInkAnnotation?(t[parseInt(n.toString(),10)].signatureInkAnnotation=this.checkImportedData(e[parseInt(n.toString(),10)].signatureInkAnnotation,t[parseInt(n.toString(),10)].signatureInkAnnotation,n),0!==t[parseInt(n.toString(),10)].signatureInkAnnotation.length&&(e[parseInt(n.toString(),10)].signatureInkAnnotation=e[parseInt(n.toString(),10)].signatureInkAnnotation.concat(t[parseInt(n.toString(),10)].signatureInkAnnotation))):e[parseInt(n.toString(),10)].signatureInkAnnotation=t[parseInt(n.toString(),10)].signatureInkAnnotation)):(i={textMarkupAnnotation:t[parseInt(n.toString(),10)].textMarkupAnnotation,shapeAnnotation:t[parseInt(n.toString(),10)].shapeAnnotation,measureShapeAnnotation:t[parseInt(n.toString(),10)].measureShapeAnnotation,stampAnnotations:t[parseInt(n.toString(),10)].stampAnnotations,stickyNotesAnnotation:t[parseInt(n.toString(),10)].stickyNotesAnnotation,freeTextAnnotation:t[parseInt(n.toString(),10)].freeTextAnnotation,signatureInkAnnotation:t[parseInt(n.toString(),10)].signatureInkAnnotation},e[parseInt(n.toString(),10)]=i));return e},C.prototype.updateExportItem=function(){var e=C.sessionStorageManager.getItem(this.documentId+"_annotations_shape"),t=C.sessionStorageManager.getItem(this.documentId+"_annotations_shape_measure"),i=C.sessionStorageManager.getItem(this.documentId+"_annotations_stamp"),n=C.sessionStorageManager.getItem(this.documentId+"_annotations_sticky"),o=C.sessionStorageManager.getItem(this.documentId+"_annotations_textMarkup"),r=C.sessionStorageManager.getItem(this.documentId+"_annotations_freetext"),s=!1,a=C.sessionStorageManager.getItem(this.documentId+"_annotations_ink");return this.pdfViewer.isSignatureEditable&&C.sessionStorageManager.getItem(this.documentId+"_annotations_sign")&&(s=!0),!!(this.checkExportAnnotations(e)||this.checkExportAnnotations(t)||this.checkExportAnnotations(i)||this.checkExportAnnotations(n)||this.checkExportAnnotations(o)||this.checkExportAnnotations(r)||this.isImportAction||this.isStorageExceed||s||this.checkExportAnnotations(a)||0<this.pdfViewer.annotationCollection.length)},C.prototype.checkExportAnnotations=function(e){return!!e&&0<JSON.parse(e).filter(function(e){return 0<e.annotations.length}).length},C.prototype.isFreeTextAnnotation=function(e){var t=!1;return t=e&&0<e.length?e.some(function(e){return"FreeText"===e.shapeAnnotationType&&!je(e.subject)}):t},C.prototype.checkImportedData=function(e,t,i){for(var n=0;n<e.length;n++)for(var o=0;o<t.length;o++)if(e[parseInt(n.toString(),10)].AnnotName===t[parseInt(o.toString(),10)].AnnotName){for(var r=this.pdfViewer.annotationCollection.length,s=0;s<r;s++)if(this.pdfViewer.annotationCollection[parseInt(s.toString(),10)].annotationId===t[parseInt(o.toString(),10)].AnnotName){this.pdfViewer.annotationCollection[parseInt(s.toString(),10)].comments=this.pdfViewer.annotationModule.getAnnotationComments(t[parseInt(o.toString(),10)].Comments,t[parseInt(o.toString(),10)],t[parseInt(o.toString(),10)].Author),this.pdfViewer.annotationCollection[parseInt(s.toString(),10)].review={state:t[parseInt(o.toString(),10)].State,stateModel:t[parseInt(o.toString(),10)].StateModel,modifiedDate:t[parseInt(o.toString(),10)].ModifiedDate,author:t[parseInt(o.toString(),10)].Author},this.pdfViewer.annotationCollection[parseInt(s.toString(),10)].note=t[parseInt(o.toString(),10)].Note;var a=this.pdfViewer.annotationCollection[parseInt(s.toString(),10)];"shape"===e[parseInt(n.toString(),10)].AnnotType&&this.pdfViewer.annotationModule.shapeAnnotationModule?(this.documentAnnotationCollections[parseInt(i.toString(),10)].shapeAnnotation[parseInt(n.toString(),10)]=t[parseInt(o.toString(),10)],this.updateAnnotationsInSessionStorage(t[parseInt(o.toString(),10)],a,"_annotations_shape")):"textMarkup"===e[parseInt(n.toString(),10)].AnnotType&&this.pdfViewer.annotationModule.textMarkupAnnotationModule?(this.documentAnnotationCollections[parseInt(i.toString(),10)].textMarkupAnnotation[parseInt(n.toString(),10)]=t[parseInt(o.toString(),10)],this.updateAnnotationsInSessionStorage(t[parseInt(o.toString(),10)],a,"_annotations_textMarkup")):"shape_measure"===e[parseInt(n.toString(),10)].AnnotType&&this.pdfViewer.annotationModule.measureAnnotationModule?(this.documentAnnotationCollections[parseInt(i.toString(),10)].measureShapeAnnotation[parseInt(n.toString(),10)]=t[parseInt(o.toString(),10)],this.updateAnnotationsInSessionStorage(t[parseInt(o.toString(),10)],a,"_annotations_shape_measure")):"stamp"===e[parseInt(n.toString(),10)].AnnotType&&this.pdfViewer.annotationModule.stampAnnotationModule?(this.documentAnnotationCollections[parseInt(i.toString(),10)].stampAnnotations[parseInt(n.toString(),10)]=t[parseInt(o.toString(),10)],this.updateAnnotationsInSessionStorage(t[parseInt(o.toString(),10)],a,"_annotations_stamp")):"freeText"===e[parseInt(n.toString(),10)].AnnotType&&this.pdfViewer.annotationModule.freeTextAnnotationModule?(this.documentAnnotationCollections[parseInt(i.toString(),10)].freeTextAnnotation[parseInt(n.toString(),10)]=t[parseInt(o.toString(),10)],this.updateAnnotationsInSessionStorage(t[parseInt(o.toString(),10)],a,"_annotations_freetext")):"ink"===e[parseInt(n.toString(),10)].AnnotType&&this.pdfViewer.annotationModule.inkAnnotationModule?(this.documentAnnotationCollections[parseInt(i.toString(),10)].signatureInkAnnotation[parseInt(n.toString(),10)]=t[parseInt(o.toString(),10)],this.updateAnnotationsInSessionStorage(t[parseInt(o.toString(),10)],a,"_annotations_ink")):"sticky"===e[parseInt(n.toString(),10)].AnnotType&&(this.documentAnnotationCollections[parseInt(i.toString(),10)].stickyNotesAnnotation[parseInt(n.toString(),10)]=t[parseInt(o.toString(),10)],this.updateAnnotationsInSessionStorage(t[parseInt(o.toString(),10)],a,"_annotations_sticky"));break}this.pdfViewer.annotationModule.stickyNotesAnnotationModule.createCommentControlPanel(t[parseInt(o.toString(),10)],i+1,null,null,!0),t.splice(o,1),o-=1}if(this.annotationComments){var l=this.annotationComments[parseInt(i.toString(),10)];if(l=this.selectAnnotationCollections(l))for(n=0;n<l.length;n++)for(o=0;o<t.length;o++)l[parseInt(n.toString(),10)].AnnotName===t[parseInt(o.toString(),10)].AnnotName&&(t.splice(o,1),o-=1)}return t},C.prototype.updateAnnotationsInSessionStorage=function(e,t,i){var n=C.sessionStorageManager.getItem(this.documentId+i),o=JSON.parse(n);if(o){for(var r=0;r<o.length;r++)if(o[parseInt(r.toString(),10)].annotations)for(var s=0;s<o[parseInt(r.toString(),10)].annotations.length;s++)if(o[parseInt(r.toString(),10)].annotations[parseInt(s.toString(),10)].annotName===e.AnnotName){o[parseInt(r.toString(),10)].annotations[parseInt(s.toString(),10)].comments=t.comments,o[parseInt(r.toString(),10)].annotations[parseInt(s.toString(),10)].review=t.review,o[parseInt(r.toString(),10)].annotations[parseInt(s.toString(),10)].note=t.note;break}C.sessionStorageManager.setItem(this.documentId+i,JSON.stringify(o))}},C.prototype.checkAnnotationWidth=function(e){for(var t,i,n,o,r=0;r<e.length;r++)t?(t>e[parseInt(r.toString(),10)].x?t=e[parseInt(r.toString(),10)].x:i<e[parseInt(r.toString(),10)].x&&(i=e[parseInt(r.toString(),10)].x),n>e[parseInt(r.toString(),10)].y?n=e[parseInt(r.toString(),10)].y:o<e[parseInt(r.toString(),10)].y&&(o=e[parseInt(r.toString(),10)].y)):(t=e[parseInt(r.toString(),10)].x,i=e[parseInt(r.toString(),10)].x,n=e[parseInt(r.toString(),10)].y,o=e[parseInt(r.toString(),10)].y);return{width:i-t,height:o-n}},C.prototype.deleteAnnotations=function(){if(this.pdfViewer.annotationModule){this.updateAnnotationsUndoRedo(),this.updateSignatureUndoRedo(),je(this.pdfViewer.annotations)||(this.pdfViewer.annotations.length=0),this.pdfViewer.zIndexTable=[],this.pdfViewer.annotationCollection=[],this.pdfViewer.signatureCollection=[];var e=this.createAnnotationsCollection();this.annotationComments=e,this.documentAnnotationCollections=e,this.annotationRenderredList=[];for(var t=0;t<this.pageCount;t++){this.pdfViewer.annotationModule.renderAnnotations(t,null,null,null),this.pdfViewer.renderDrawing(void 0,t),this.pdfViewer.clearSelection(t);var i=document.getElementById(this.pdfViewer.element.id+"_accordionContainer"+(t+1)),i=(i&&i.remove(),document.getElementById(this.pdfViewer.element.id+"_accordionContentContainer"));i&&0===i.childElementCount&&(i.style.display="none",document.getElementById(this.pdfViewer.element.id+"_commentsPanelText"))&&(this.navigationPane.annotationMenuObj.enableItems([this.pdfViewer.localeObj.getConstant("Export Annotations")],!1),document.getElementById(this.pdfViewer.element.id+"_commentsPanelText").style.display="block")}this.isImportedAnnotation=!1,this.isImportAction=!1,this.importedAnnotation=[],this.annotationPageList=[],this.pdfViewer.annotationModule.freeTextAnnotationModule.freeTextPageNumbers=[],this.pdfViewer.annotationModule.stampAnnotationModule.stampPageNumber=[],this.pdfViewer.annotation.inkAnnotationModule.inkAnnotationindex=[],this.isAnnotationCollectionRemoved=!0}else this.getModuleWarningMessage("Annotation")},C.prototype.updateAnnotationsUndoRedo=function(){for(var l=this,e=0;e<this.pdfViewer.annotationCollection.length;e++)!function(t){var e=null,i=l;if("textMarkup"===i.pdfViewer.annotationCollection[parseInt(t.toString(),10)].shapeAnnotationType){var e=i.pdfViewer.annotationCollection[parseInt(t.toString(),10)],n=i.pdfViewer.annotation.textMarkupAnnotationModule.getAnnotations(e.pageNumber,null);if(n)for(var o,r=0;r<n.length;r++)e.annotationId===n[parseInt(r.toString(),10)].annotName&&(o=n.splice(parseInt(r.toString(),10),1)[0],i.pdfViewer.annotation.addAction(e.pageNumber,parseInt(r.toString(),10),o,"Text Markup Deleted",null),i.pdfViewer.annotation.stickyNotesAnnotationModule.findPosition(o,"textMarkup"),o=document.getElementById(o.annotName))&&(1===o.parentElement.childElementCount?i.pdfViewer.annotationModule.stickyNotesAnnotationModule.updateAccordionContainer(o):o.remove());i.pdfViewer.annotation.textMarkupAnnotationModule.manageAnnotations(n,e.pageNumber)}else{je(e=i.pdfViewer.annotations.filter(function(e){return e.annotName===i.pdfViewer.annotationCollection[parseInt(t.toString(),10)].annotationId})[0])&&((e=new jbt(l.pdfViewer,"annotations",i.pdfViewer.annotationCollection[parseInt(t.toString(),10)],!0)).id=i.pdfViewer.annotationCollection[parseInt(t.toString(),10)].uniqueId,e.annotName=i.pdfViewer.annotationCollection[parseInt(t.toString(),10)].annotationId,e.annotationId=null);var s=i.pdfViewer.annotation.modifyInCollections(e,"delete");if(je(s)&&((s=i.pdfViewer.annotationCollection[parseInt(t.toString(),10)]).annotName=i.pdfViewer.annotationCollection[parseInt(t.toString(),10)].annotationId,delete s.annotationId),i.pdfViewer.annotation.undoCommentsElement.push(s),i.pdfViewer.annotation.addAction(e.pageIndex,null,e,"Delete","",s,e),"Square"===e.shapeAnnotationType||"Line"===e.shapeAnnotationType||"Circle"===e.shapeAnnotationType||"Polygon"===e.shapeAnnotationType||"Polyline"===e.shapeAnnotationType)(e.calibrate?i.pdfViewer.annotation.measureAnnotationModule:i.pdfViewer.annotation.shapeAnnotationModule).manageAnnotations(e,e.pageNumber);else if("Stamp"===e.shapeAnnotationType||"Image"===e.shapeAnnotationType)i.pdfViewer.annotation.stampAnnotationModule.manageAnnotations(e,e.pageNumber);else if("FreeText"===e.shapeAnnotationType)i.pdfViewer.annotation.freeTextAnnotationModule.manageAnnotations(e,e.pageNumber);else if("Ink"===e.shapeAnnotationType)i.pdfViewer.annotation.inkAnnotationModule.manageInkAnnotations(e,e.pageNumber);else if("StickyNotes"===e.shapeAnnotationType){for(var a=i.pdfViewer.annotation.stickyNotesAnnotationModule.getAnnotations(e.pageIndex,null,"sticky"),r=0;r<a.length;r++)if(a[parseInt(r.toString(),10)].annotName===e.annotName){a.splice(r,1);break}i.pdfViewer.annotation.stickyNotesAnnotationModule.manageAnnotations(a,e.pageIndex,"sticky")}}}(e)},C.prototype.updateSignatureUndoRedo=function(){for(var e=0;e<this.pdfViewer.signatureCollection.length;e++){var t=this,i=void 0;if("HandWrittenSignature"===t.pdfViewer.signatureCollection[parseInt(e.toString(),10)].shapeAnnotationType||"SignatureText"===t.pdfViewer.signatureCollection[parseInt(e.toString(),10)].shapeAnnotationType||"SignatureImage"===t.pdfViewer.signatureCollection[parseInt(e.toString(),10)].shapeAnnotationType){for(var i=t.pdfViewer.signatureCollection[parseInt(e.toString(),10)],n=0,o=t.signatureModule.getAnnotations(i.pageNumber,null);n<o.length;n++){var r=o[n];if(r.id===i.uniqueKey){i=r;break}}var s=t.pdfViewer.annotation.modifyInCollections(i,"delete");je(s)&&((s=t.pdfViewer.signatureCollection[parseInt(e.toString(),10)]).annotName=t.pdfViewer.signatureCollection[parseInt(e.toString(),10)].annotationId,delete s.annotationId),t.pdfViewer.annotation.undoCommentsElement.push(s),t.pdfViewer.annotation.addAction(i.pageIndex,null,i,"Delete","",s,i),"HandWrittenSignature"!==i.shapeAnnotationType&&"SignatureText"!==i.shapeAnnotationType&&"SignatureImage"!==i.shapeAnnotationType||t.signatureModule.manageAnnotations(i,i.pageNumber)}e--}},C.prototype.createAnnotationsCollection=function(e,t){var i=[];if(t){o={textMarkupAnnotation:[],shapeAnnotation:[],measureShapeAnnotation:[],stampAnnotations:[],stickyNotesAnnotation:[],freeTextAnnotation:[],signatureAnnotation:[],signatureInkAnnotation:[]};(i={})[parseInt(e.toString(),10)]=o}else for(var n=0;n<this.pageCount;n++){var o={textMarkupAnnotation:[],shapeAnnotation:[],measureShapeAnnotation:[],stampAnnotations:[],stickyNotesAnnotation:[],freeTextAnnotation:[],signatureAnnotation:[],signatureInkAnnotation:[]};i.push(o)}return i},C.prototype.addAnnotation=function(e){var t={};if(e){for(var i=!1,n=1,o=!e.shapeAnnotationType&&!e.author&&e.length?(n=e.length,this.createAnnotationsCollection()):this.createAnnotationsCollection(e.pageNumber,i=!0),r=0;r<n;r++){var s,a,l,h=void 0,h=i?e:e[parseInt(r.toString(),10)],d={};if(d.ShapeAnnotationType=h.shapeAnnotationType,d.AnnotationAddMode=h.annotationAddMode,d.Author=h.author,d.AnnotationSelectorSettings=h.annotationSelectorSettings,d.AnnotationSettings=h.annotationSettings,d.PageNumber=h.pageNumber,d.ModifiedDate=h.modifiedDate,d.Subject=h.subject,d.Note=h.note,d.AnnotName=h.annotationId,d.IsCommentLock=h.isCommentLock,d.Comments=h.comments,h.comments&&0<h.comments.length){for(var p=[],c=0;c<h.comments.length;c++)p.push(this.updateComments(h,h.comments[parseInt(c.toString(),10)]));d.Comments=p}if(h.review&&(d.State=h.review.state,d.StateModel=h.review.stateModel),d.CustomData=h.customData,d.Opacity=h.opacity,"textMarkup"===h.shapeAnnotationType){if(d.AnnotType="textMarkup",d.Color=h.color,d.IsMultiSelect=h.isMultiSelect,d.TextMarkupAnnotationType=h.textMarkupAnnotationType,d.TextMarkupContent=h.textMarkupContent,d.TextMarkupStartIndex=h.textMarkupStartIndex,d.TextMarkupEndIndex=h.textMarkupEndIndex,h.rect&&(d.Rect=this.convertBounds(h.rect,!0)),h.bounds&&1<=h.bounds.length){for(var u=[],c=0;c<h.bounds.length;c++)u.push(this.convertBounds(h.bounds[parseInt(c.toString(),10)]));d.Bounds=u}o[h.pageNumber].textMarkupAnnotation.push(d)}else if("sticky"===h.shapeAnnotationType)d.AnnotType="sticky",d.Icon="Comment",d.Bounds=this.convertBounds(h.bounds),d.StrokeColor=h.strokeColor,d.Color=h.color,o[h.pageNumber].stickyNotesAnnotation.push(d);else if("FreeText"===h.shapeAnnotationType)d.AnnotType="freeText",d.Name=h.annotationId,d.MarkupText=h.dynamicText,d.Text=h.dynamicText,d.Note=h.dynamicText,d.TextAlign=h.textAlign,d.Thickness=h.thicknes,d.StrokeColor=h.strokeColor,d.FillColor=h.fillColor,d.FontColor=h.fontColor,d.FontSize=h.fontSize,d.FontFamily=h.fontFamily,d.Rotate=h.rotateAngle,d.Bounds=this.convertBounds(h.bounds),d.Font={Name:h.fontFamily,Size:h.fontSize,Bold:h.font.isBold,Italic:h.font.isItalic,Strikeout:h.font.isStrikeout,Underline:h.font.isUnderline},o[h.pageNumber].freeTextAnnotation.push(d);else if("stamp"===h.shapeAnnotationType)d.AnnotType="stamp",d.Icon=h.icon,d.isDynamic=!1,d.Rect=this.convertBounds(h.bounds,!1,!0),d.RotateAngle=h.rotateAngle,d.FillColor=h.fillColor,d.StrokeColor=h.strokeColor,d.StampAnnotationType=h.stampAnnotationType,d.CreationDate=h.creationDate,"image"===h.stampAnnotationType&&(a={imagedata:h.stampAnnotationPath},(s=[]).push(a),d.Apperarance=s),h.isDynamicStamp&&(d.IsDynamic=!0,d.StrokeColor=h.stampFillcolor,a={type:"string",text:h.dynamicText,currentFontname:"95b303ab-d397-438a-83af-e2ff8a9900f1",baseFontName:"Helvetica-BoldOblique",fontSize:10,isImport:!0},(s=[]).push(a),d.Apperarance=s),o[h.pageNumber].stampAnnotations.push(d);else if("Ink"===h.shapeAnnotationType||"Signature"===h.shapeAnnotationType)d.StrokeColor=h.strokeColor,d.FillColor=h.fillColor,d.Thickness=h.thickness,d.Bounds=this.convertBounds(h.bounds),d.PathData=h.data,d.pageIndex=h.pageNumber,"Ink"===h.shapeAnnotationType&&(d.AnnotType="Ink",d.IsPathData=!0,o[h.pageNumber].signatureInkAnnotation.push(d)),"Signature"===h.shapeAnnotationType&&(d.AnnotType="Signature",d.SignatureName=h.annotationId,d.IsSignature=!0,o[h.pageNumber].signatureAnnotation.push(d));else if("Line"===h.shapeAnnotationType||"LineWidthArrowHead"===h.shapeAnnotationType||"Polyline"===h.shapeAnnotationType||"Polygon"===h.shapeAnnotationType||"Polyline"===h.shapeAnnotationType||"Circle"===h.shapeAnnotationType||"Oval"===h.shapeAnnotationType||"Rectangle"===h.shapeAnnotationType||"Square"===h.shapeAnnotationType||"Ellipse"===h.shapeAnnotationType){if(d.AnnotType="shape",d.StrokeColor=h.strokeColor,d.FillColor=h.fillColor,d.Thickness=h.thickness,d.BorderStyle=h.borderStyle,d.BorderDashArray=h.borderDashArray,d.RotateAngle=h.rotateAngle,d.IsCloudShape=h.isCloudShape,d.CloudIntensity=h.cloudIntensity,d.RectangleDifference=h.rectangleDifference,d.LineHeadStart=h.lineHeadStart,d.LineHeadEnd=h.lineHeadEnd,d.IsLocked=h.isLocked,d.EnableShapeLabel=h.enableShapeLabel,d.LabelContent=h.labelContent,d.LabelFillColor=h.labelFillColor,d.LabelBorderColor=h.labelBorderColor,d.FontColor=h.fontColor,d.FontSize=h.fontSize,d.LabelBounds=this.convertBounds(h.labelBounds),d.LabelSettings=h.labelSettings,d.Bounds=this.convertBounds(h.bounds),d.LeaderLength=h.leaderLength,d.LeaderLineExtenstion=h.leaderLineExtension,h.vertexPoints&&1<=h.vertexPoints.length){for(var g=[],c=0;c<h.vertexPoints.length;c++)g.push(this.convertVertexPoints(h.vertexPoints[parseInt(c.toString(),10)]));d.VertexPoints=g}d.EnableShapeLabel=h.enableShapeLabel,("Distance calculation"===h.subject||"Perimeter calculation"===h.subject||"Area calculation"===h.subject||"Radius calculation"===h.subject||"Volume calculation"===h.subject?(d.AnnotType="shape_measure",(l=h.calibrate)&&(d.Calibrate={Ratio:l.ratio,X:[{Unit:l.x[0].unit,ConversionFactor:l.x[0].conversionFactor,FractionalType:l.x[0].fractionalType,Denominator:l.x[0].denominator,FormatDenominator:l.x[0].formatDenominator}],Distance:[{Unit:l.distance[0].unit,ConversionFactor:l.distance[0].conversionFactor,FractionalType:l.distance[0].fractionalType,Denominator:l.distance[0].denominator,FormatDenominator:l.distance[0].formatDenominator}],Area:[{Unit:l.area[0].unit,ConversionFactor:l.area[0].conversionFactor,FractionalType:l.area[0].fractionalType,Denominator:l.area[0].denominator,FormatDenominator:l.area[0].formatDenominator}],Angle:null,Volume:null,TargetUnitConversion:l.targetUnitConversion,Depth:l.depth}),d.Indent=h.indent,d.Caption=h.caption,d.CaptionPosition=h.captionPosition,d.LeaderLineExtension=h.leaderLineExtension,d.LeaderLength=h.leaderLength,d.LeaderLineOffset=h.leaderLineOffset,o[h.pageNumber].measureShapeAnnotation):o[h.pageNumber].shapeAnnotation).push(d)}}t.pdfAnnotation=o,this.pdfViewer.importAnnotation(t)}},C.prototype.convertBounds=function(e,t,i){var n,o;return e?t?{left:e.left||e.Left||0,right:e.right||e.Right||0,bottom:e.bottom||e.Bottom||0,top:e.top||e.Top||0}:(t=e.x||e.left||e.Left||0,n=e.y||e.top||e.Top||0,o=e.width||e.Width||0,e=e.height||e.Height||0,i?{X:this.ConvertPixelToPoint(t),Y:this.ConvertPixelToPoint(n),Left:this.ConvertPixelToPoint(t),Top:this.ConvertPixelToPoint(n),Height:this.ConvertPixelToPoint(e),Width:this.ConvertPixelToPoint(o)}:{X:t,Y:n,Left:t,Top:n,Height:e,Width:o}):null},C.prototype.ConvertPixelToPoint=function(e){return.75*e},C.prototype.convertVertexPoints=function(e){var t;if(e)return{X:t=e.x||e.X||0,Y:e=e.y||e.Y||0,Left:t,Top:e}},C.prototype.updateComments=function(e,t){var i;if(e&&t)return(i={}).ShapeAnnotationType=e.shapeAnnotationType,i.Author=t.author,i.AnnotationSelectorSettings=e.annotationSelectorSettings,i.AnnotationSettings=e.annotationSettings,i.PageNumber=e.pageNumber,i.ModifiedDate=t.modifiedDate,i.Subject=e.subject,i.Note=t.note,i.AnnotName=t.annotName,i.Comments=t.comments,i.State=t.review.state,i.StateModel=t.review.stateModel,i.CustomData=e.customData,i.IsLock=t.isLock,i},C.prototype.removeFocus=function(){var e;N&&(e=this.pdfViewer.element.querySelector("#"+this.pdfViewer.element.id+"_totalPage"))&&e.firstElementChild&&e.firstElementChild.firstElementChild&&e.firstElementChild.firstElementChild.blur()},C.prototype.updateDocumentEditedProperty=function(e){this.pdfViewer.allowServerDataBinding=!0,this.pdfViewer.isDocumentEdited=e,this.pdfViewer.allowServerDataBinding=!1},C.prototype.getWindowDevicePixelRatio=function(){var e=window.devicePixelRatio;return F.isDevice?2:e},C.prototype.getZoomRatio=function(e){var t=this.getZoomFactor(),e=e||1,i=this.getWindowDevicePixelRatio(),t=!F.isDevice||F.isDevice&&t<=.7?e*i:e;return t},C.prototype.importJsonForRotatedDocuments=function(e,t,i,n){var e=Math.abs(e),o=this.pageSize[parseInt(t.toString(),10)];return n!==o.rotation?(e=this.getRotationAngle(n,t),this.isPageRotated=!0):(e=0,this.isPageRotated=!1),1===e?{X:o.width-i.Y-i.Height,Y:i.X,Height:i.Width,Width:i.Height}:2===e?{X:o.width-i.X-i.Width,Y:o.height-i.Y-i.Height,Height:i.Height,Width:i.Width}:3===e?{X:i.Y,Y:o.height-i.X-i.Width,Height:i.Width,Width:i.Height}:i},C.prototype.getRotationAngle=function(e,t){t=this.pageSize[parseInt(t.toString(),10)];return 0===(e=Math.abs(e))?t.rotation:1===e||90===e?0===t.rotation?3:2===t.rotation?1:3===t.rotation?2:void 0:2===e||180===e?0===t.rotation?2:1===t.rotation?3:3===t.rotation?1:void 0:3===e||270===e?0===t.rotation?1:2===t.rotation?3:1===t.rotation?2:void 0:void 0},C.prototype.calculateVertexPoints=function(e,t,i,n){for(var o,r,s=Math.abs(e),a=[],l=this.pageSize[parseInt(t.toString(),10)],s=n!==l.rotation?this.getRotationAngle(n,t):0,h=0;h<i.length;h++)1===s?(o=i[parseInt(h.toString(),10)].Y?l.width-i[parseInt(h.toString(),10)].Y:l.width-i[parseInt(h.toString(),10)].y,r=i[parseInt(h.toString(),10)].X?i[parseInt(h.toString(),10)].X:i[parseInt(h.toString(),10)].x,a.push({x:o,y:r})):2===s?(o=i[parseInt(h.toString(),10)].X?l.width-i[parseInt(h.toString(),10)].X:l.width-i[parseInt(h.toString(),10)].x,r=i[parseInt(h.toString(),10)].Y?l.height-i[parseInt(h.toString(),10)].Y:l.height-i[parseInt(h.toString(),10)].y,a.push({x:o,y:r})):3===s?(o=i[parseInt(h.toString(),10)].Y?i[parseInt(h.toString(),10)].Y:i[parseInt(h.toString(),10)].y,r=i[parseInt(h.toString(),10)].X?l.height-i[parseInt(h.toString(),10)].X:l.height-i[parseInt(h.toString(),10)].x,a.push({x:o,y:r})):(o=i[parseInt(h.toString(),10)].X?i[parseInt(h.toString(),10)].X:i[parseInt(h.toString(),10)].x,r=i[parseInt(h.toString(),10)].Y?i[parseInt(h.toString(),10)].Y:i[parseInt(h.toString(),10)].y,a.push({x:o,y:r}));return a},C.prototype.isSignaturePathData=function(e){return/^([Mm]\s*\d+(\.\d+)?\s*,\s*\d+(\.\d+)?(\s+[Ll]\s*\d+(\.\d+)?\s*,\s*\d+(\.\d+)?)*\s*)+$/.test(e)},C.prototype.isSignatureImageData=function(e){return/^data:image\/([a-z]+);base64,/.test(e)},C.prototype.getSanitizedString=function(e){return e.replace(/[\x00-\x1F\x7F]/g,function(e){return"\\u"+e.charCodeAt(0).toString(16).padStart(4,"0")})},C.prototype.getLinkInformation=function(e,t){var i=this.retrieveCurrentZoomFactor(),n=(this.pdfViewer.restrictZoomRequest&&!this.pdfViewer.tileRenderingSettings.enableTileRendering&&(i=1),this.documentId+"_"+e),o=this.pageImageDetails&&this.pageImageDetails[n+"_"+i+"_imageUrl"]||this.getPinchZoomPage(e),r=this.hyperlinkAndLinkAnnotation&&this.hyperlinkAndLinkAnnotation[n+"_hyperlinkAndLinkAnnotation"]||this.getPinchZoomPage(e),n=this.pageTextDetails&&this.pageTextDetails[n+"_textDetails"]||this.getPinchZoomPage(e),i=(o||(e=this.getStoredTileImageDetails(e,0,0,i))&&(o=e),null);return o&&r&&(e=JSON.parse(o),o=JSON.parse(r),r=JSON.parse(n),i=Object.assign({},e,o,r),this.isPinchZoomStorage=!1),i},C.prototype.releaseCanvas=function(e){e.width=1,e.height=1;e=e.getContext("2d");e&&e.clearRect(0,0,1,1)},C.prototype.getModuleWarningMessage=function(e){console.warn("[WARNING] :: Module '"+e+"' is not available in PDF Viewer component! You either misspelled the module name or forgot to load it.")},C.prototype.updateSelectorSettings=function(e){this.pdfViewer.annotationSelectorSettings&&"#FF4081"!==this.pdfViewer.annotationSelectorSettings.resizerFillColor&&(e.resizerFillColor=this.pdfViewer.annotationSelectorSettings.resizerFillColor),this.pdfViewer.annotationSelectorSettings&&"black"!==this.pdfViewer.annotationSelectorSettings.resizerBorderColor&&(e.resizerBorderColor=this.pdfViewer.annotationSelectorSettings.resizerBorderColor),this.pdfViewer.annotationSelectorSettings&&""!==this.pdfViewer.annotationSelectorSettings.selectionBorderColor&&(e.selectionBorderColor=this.pdfViewer.annotationSelectorSettings.selectionBorderColor),this.pdfViewer.annotationSelectorSettings&&8!==this.pdfViewer.annotationSelectorSettings.resizerSize&&(e.resizerSize=this.pdfViewer.annotationSelectorSettings.resizerSize),this.pdfViewer.annotationSelectorSettings&&"Square"!==this.pdfViewer.annotationSelectorSettings.resizerShape&&(e.resizerShape=this.pdfViewer.annotationSelectorSettings.resizerShape),this.pdfViewer.annotationSelectorSettings&&null!==this.pdfViewer.annotationSelectorSettings.resizerCursorType&&(e.resizerCursorType=this.pdfViewer.annotationSelectorSettings.resizerCursorType),this.pdfViewer.annotationSelectorSettings&&1!==this.pdfViewer.annotationSelectorSettings.selectionBorderThickness&&(e.selectionBorderThickness=this.pdfViewer.annotationSelectorSettings.selectionBorderThickness),this.pdfViewer.annotationSelectorSettings&&0!==this.pdfViewer.annotationSelectorSettings.selectorLineDashArray.length&&(e.selectorLineDashArray=this.pdfViewer.annotationSelectorSettings.selectorLineDashArray)},C.prototype.annotationSelectorSettingLoad=function(e){"shape"===e.AnnotationType&&("Line"===e.ShapeAnnotationType?(e.AnnotationSelectorSettings=this.pdfViewer.lineSettings.annotationSelectorSettings||this.pdfViewer.annotationSelectorSettings,this.updateSelectorSettings(e.AnnotationSelectorSettings)):"Arrow"===e.ShapeAnnotationType?(e.AnnotationSelectorSettings=this.pdfViewer.arrowSettings.annotationSelectorSettings||this.pdfViewer.annotationSelectorSettings,this.updateSelectorSettings(e.AnnotationSelectorSettings)):"Rectangle"===e.ShapeAnnotationType||"Square"===e.ShapeAnnotationType?(e.AnnotationSelectorSettings=this.pdfViewer.rectangleSettings.annotationSelectorSettings||this.pdfViewer.annotationSelectorSettings,this.updateSelectorSettings(e.AnnotationSelectorSettings)):"Circle"===e.ShapeAnnotationType||"Ellipse"===e.ShapeAnnotationType?(e.AnnotationSelectorSettings=this.pdfViewer.circleSettings.annotationSelectorSettings||this.pdfViewer.annotationSelectorSettings,this.updateSelectorSettings(e.AnnotationSelectorSettings)):"Polygon"===e.ShapeAnnotationType&&(e.AnnotationSelectorSettings=this.pdfViewer.polygonSettings.annotationSelectorSettings||this.pdfViewer.annotationSelectorSettings,this.updateSelectorSettings(e.AnnotationSelectorSettings))),"shape_measure"===e.AnnotType&&("Circle"===e.ShapeAnnotationType?(e.AnnotationSelectorSettings=this.pdfViewer.radiusSettings.annotationSelectorSettings||this.pdfViewer.annotationSelectorSettings,this.updateSelectorSettings(e.AnnotationSelectorSettings)):"Line"===e.ShapeAnnotationType?(e.AnnotationSelectorSettings=this.pdfViewer.distanceSettings.annotationSelectorSettings||this.pdfViewer.annotationSelectorSettings,this.updateSelectorSettings(e.AnnotationSelectorSettings)):"Polyline"===e.ShapeAnnotationType?(e.AnnotationSelectorSettings=this.pdfViewer.perimeterSettings.annotationSelectorSettings||this.pdfViewer.annotationSelectorSettings,this.updateSelectorSettings(e.AnnotationSelectorSettings)):"Polygon"===e.ShapeAnnotationType&&"PolygonVolume"===e.Indent?(e.AnnotationSelectorSettings=this.pdfViewer.volumeSettings.annotationSelectorSettings||this.pdfViewer.annotationSelectorSettings,this.updateSelectorSettings(e.AnnotationSelectorSettings)):"Polygon"===e.ShapeAnnotationType&&(e.AnnotationSelectorSettings=this.pdfViewer.areaSettings.annotationSelectorSettings||this.pdfViewer.annotationSelectorSettings,this.updateSelectorSettings(e.AnnotationSelectorSettings)))},C.prototype.boundsCalculation=function(e,t){var i,n,o,r,s,a;return!(je(e)&&je(t.x)&&je(t.y)&&je(t.width)&&je(t.height)&&je(t)&&je(t.x)&&je(t.y)&&je(t.height)&&je(t.width))&&(i=parseFloat(t.x.toFixed(10)),n=parseFloat(t.y.toFixed(10)),o=parseFloat(t.width.toFixed(10)),t=parseFloat(t.height.toFixed(10)),r=e.x?parseFloat(e.x.toFixed(10)):parseFloat(e.left.toFixed(10)),s=e.y?parseFloat(e.y.toFixed(10)):parseFloat(e.top.toFixed(10)),a=parseFloat(e.width.toFixed(10)),e=parseFloat(e.height.toFixed(10)),i!==r||n!==s||o!==a||t!==e)},C.sessionStorageManager=new cft(!1),C);function C(e){var p=this;this.hyperlinkAndLinkAnnotation={},this.pageTextDetails={},this.pageImageDetails={},this.pageSize=[],this.existingFieldImport=!0,this.pageCount=0,this.customZoomValues=[],this.isReRenderRequired=!0,this.currentPageNumber=0,this.initialZoomValue={},this.activeElements=new VCt,this.mouseDownEvent=null,this.pngData=[],this.isDocumentLoaded=!1,this.renderedPagesList=[],this.pageGap=8,this.signatureAdded=!1,this.isSignInitialClick=!1,this.isFreeTextSelected=!1,this.pageLeft=5,this.sessionLimit=1e3,this.pageStopValue=300,this.toolbarHeight=56,this.pageLimit=0,this.previousPage=0,this.isViewerMouseDown=!1,this.isViewerMouseWheel=!1,this.scrollPosition=0,this.sessionStorage=[],this.isLoadedFormFieldAdded=!1,this.isInkAnnot=!1,this.modifiedPageIndex=[],this.pointerCount=0,this.pointersForTouch=[],this.isPasswordAvailable=!1,this.isBounds=!1,this.isImportDoc=!1,this.passwordData="",this.reRenderedCount=0,this.mouseX=0,this.mouseY=0,this.mouseLeft=0,this.mouseTop=0,this.touchClientX=0,this.touchClientY=0,this.previousTime=0,this.currentTime=0,this.isTouchScrolled=!1,this.isgetFocused=!1,this.isLongTouchPropagated=!1,this.longTouchTimer=null,this.isViewerContainerDoubleClick=!1,this.dblClickTimer=null,this.pinchZoomStorage=[],this.isTextSelectionDisabled=!1,this.isPanMode=!1,this.dragX=0,this.dragY=0,this.isScrollbarMouseDown=!1,this.scrollX=0,this.scrollY=0,this.ispageMoved=!1,this.isThumb=!1,this.isTapHidden=!1,this.singleTapTimer=null,this.tapCount=0,this.inputTapCount=0,this.isInitialLoaded=!1,this.annotationPageList=[],this.importPageList=[],this.isImportAction=!1,this.isImportedAnnotation=!1,this.isAnnotationCollectionRemoved=!1,this.tool=null,this.action="Select",this.eventArgs=null,this.inAction=!1,this.isMouseDown=!1,this.isStampMouseDown=!1,this.stampAdded=!1,this.customStampCount=0,this.isDynamicStamp=!1,this.isMixedSizeDocument=!1,this.highestWidth=0,this.highestHeight=0,this.customStampCollection=[],this.isAlreadyAdded=!1,this.isWebkitMobile=!1,this.isFreeTextContextMenu=!1,this.isSelection=!1,this.isAddAnnotation=!1,this.annotationComments=null,this.isToolbarSignClicked=!1,this.signatureCount=0,this.isSignatureAdded=!1,this.isNewSignatureAdded=!1,this.isInitialPageMode=!1,this.documentAnnotationCollections=null,this.annotationRenderredList=[],this.annotationStorage={},this.formFieldStorage={},this.isStorageExceed=!1,this.isFormStorageExceed=!1,this.isNewStamp=!1,this.downloadCollections={},this.isAnnotationAdded=!1,this.annotationEvent=null,this.isAnnotationDrawn=!1,this.isAnnotationSelect=!1,this.isAnnotationMouseDown=!1,this.isAnnotationMouseMove=!1,this.validateForm=!1,this.isMinimumZoom=!1,this.documentLoaded=!1,this.tileRenderCount=0,this.tileRequestCount=0,this.isTileImageRendered=!1,this.isDataExits=!1,this.requestLists=[],this.tilerequestLists=[],this.textrequestLists=[],this.renderThumbnailImages=!1,this.pageRenderCount=2,this.isInkAdded=!1,this.inkCount=0,this.isAddedSignClicked=!1,this.imageCount=0,this.isMousedOver=!1,this.isFormFieldSelect=!1,this.isFormFieldMouseDown=!1,this.isFormFieldMouseMove=!1,this.isFormFieldMousedOver=!1,this.isPassword=!1,this.digitalSignaturePages=[],this.isDigitalSignaturePresent=!1,this.isDrawnCompletely=!1,this.isAddComment=!1,this.drawSignatureWithTool=!1,this.formFieldCollection=[],this.requestCollection=[],this.nonFillableFields={},this.isInitialField=!1,this.isTouchDesignerMode=!1,this.isPrint=!1,this.isPDFViewerJson=!1,this.isJsonImported=!1,this.isJsonExported=!1,this.isPageRotated=!1,this.downloadFileName="",this.isFocusField=!1,this.isTouchPad=!1,this.isMacGestureActive=!1,this.macGestureStartScale=0,this.zoomInterval=5,this.isTaggedPdf=!1,this.accessibilityTagsHandler=null,this.accessibilityTagsCollection=[],this.pageRequestListForAccessibilityTags=[],this.enableAccessibilityMultiPageRequest=!0,this.clientSideRendering=!1,this.focusField=[],this.isSkipDocumentPath=!1,this.isScrollerMoving=!1,this.isScrollerMovingTimer=null,this.previousScrollbarWidth=0,this.closeNotification=function(){p.notifyDialog.hide()},this.clearSessionStorage=function(){var e,t,i,n,o;p.clientSideRendering||(o="",t=C.sessionStorageManager.getItem(p.documentId+"_hashId"),i=C.sessionStorageManager.getItem(p.documentId+"_documentLiveCount"),e=C.sessionStorageManager.getItem(p.documentId+"_serviceURL"),null!=(o=F.isIE||"edge"===F.info.name?decodeURI(t):t)&&(t={hashId:o,documentLiveCount:i,action:"Unload",elementId:p.pdfViewer.element.id},o=C.sessionStorageManager.getItem(p.documentId+"_unload"),je(e)?N&&p.clearCache(o,t,p):"keepalive"in new Request("")&&(i=p.setUnloadRequestHeaders(),n=p.pdfViewer.ajaxRequestSettings.withCredentials?"include":"omit",fetch(e+"/"+o,{method:"POST",credentials:n,headers:i,body:JSON.stringify(t)})))),C.sessionStorageManager.clear()},this.onWindowResize=function(e){var t=null,t=p;p.pdfViewer.enableRtl?(t.viewerContainer.style.right=(t.navigationPane.sideBarToolbar?t.navigationPane.getViewerContainerLeft():0)+"px",t.viewerContainer.style.left=(t.navigationPane.commentPanelContainer?t.navigationPane.commentPanelContainer.offsetWidth:0)+"px"):(t.viewerContainer.style.left=(t.navigationPane.sideBarToolbar?t.navigationPane.getViewerContainerLeft():0)+"px",t.viewerContainer.style.right=(t.navigationPane.commentPanelContainer?t.navigationPane.commentPanelContainer.offsetWidth:0)+"px");var i,n,o,r=(0<t.pdfViewer.element.clientWidth?t.pdfViewer.element.clientWidth:t.pdfViewer.element.style.width)-(t.navigationPane.sideBarToolbar?t.navigationPane.getViewerContainerLeft():0)-(t.navigationPane.commentPanelContainer?t.navigationPane.getViewerContainerRight():0);t.viewerContainer.style.width=r+"px",t.pdfViewer.toolbarModule?(o=i=0,(n=N?t.pdfViewer.element.querySelector(".e-pv-toolbar"):t.getElement("_toolbarContainer"))&&(i=n.getBoundingClientRect().height),t.isAnnotationToolbarHidden()||F.isDevice&&!p.pdfViewer.enableDesktopMode?(0===i&&p.navigationPane.isNavigationToolbarVisible&&(i=t.getElement("_navigationToolbar").getBoundingClientRect().height),t.isFormDesignerToolbarHidded()||(o=(n=t.getElement("_formdesigner_toolbar"))?n.getBoundingClientRect().height:0),t.viewerContainer.style.height=t.updatePageHeight(t.pdfViewer.element.getBoundingClientRect().height,i+o)):(n=0,(o=N?t.pdfViewer.element.querySelector(".e-pv-annotation-toolbar"):t.getElement("_annotation_toolbar"))&&(n=o.getBoundingClientRect().height),t.viewerContainer.style.height=t.updatePageHeight(t.pdfViewer.element.getBoundingClientRect().height,i+n))):t.viewerContainer.style.height=t.updatePageHeight(t.pdfViewer.element.getBoundingClientRect().height,0),t.pdfViewer.bookmarkViewModule&&F.isDevice&&!p.pdfViewer.enableDesktopMode&&(o=t.getElement("_bookmarks_container"))&&(o.style.height=t.updatePageHeight(t.pdfViewer.element.getBoundingClientRect().height,0)),"0px"===t.viewerContainer.style.height&&("auto"===t.pdfViewer.height.toString()?(t.pdfViewer.height=500,t.viewerContainer.style.height=t.pdfViewer.height+"px"):t.viewerContainer.style.height=t.pdfViewer.element.style.height),"0px"===t.viewerContainer.style.width&&("auto"===t.pdfViewer.width.toString()?(t.pdfViewer.width=500,t.viewerContainer.style.width=t.pdfViewer.width+"px"):t.viewerContainer.style.width=t.pdfViewer.element.style.width),t.pageContainer.style.width=t.viewerContainer.clientWidth+"px",0===t.viewerContainer.clientWidth&&(t.pageContainer.style.width=t.pdfViewer.element.style.width),N||t.pdfViewer.toolbarModule&&t.pdfViewer.toolbarModule.onToolbarResize(t.navigationPane.sideBarToolbar?t.navigationPane.getViewerMainContainerWidth():t.pdfViewer.element.clientWidth),p.pdfViewer.enableToolbar&&p.pdfViewer.thumbnailViewModule&&(t.pdfViewer.thumbnailViewModule.gotoThumbnailImage(t.currentPageNumber-1),t.navigationPane.sideBarToolbar)&&t.navigationPane.sideBarContentContainer&&(t.navigationPane.sideBarContentContainer.style.height=t.viewerContainer.style.height),!t.pdfViewer.textSearchModule||F.isDevice&&!p.pdfViewer.enableDesktopMode||t.pdfViewer.textSearchModule.textSearchBoxOnResize(),0==r||t.navigationPane.isBookmarkListOpen||t.updateZoomValue(),F.isDevice&&!p.pdfViewer.enableDesktopMode?(t.mobileScrollerContainer.style.left=r-parseFloat(t.mobileScrollerContainer.style.width)+"px",t.mobilePageNoContainer.style.left=r/2-parseFloat(t.mobilePageNoContainer.style.width)/2+"px",t.mobilePageNoContainer.style.top=t.pdfViewer.element.clientHeight/2+"px",t.updateMobileScrollerPosition()):(t.navigationPane.setResizeIconTop(),t.navigationPane.setCommentPanelResizeIconTop(),e&&"resize"===e.type&&t.signatureModule.updateCanvasSize()),t.navigationPane.sideBarToolbar&&(t.navigationPane.sideBarToolbar.style.height=t.viewerContainer.style.height)},this.viewerContainerOnMousedown=function(e){var t,i=p.isFreeTextContextMenu=!1,n=(p.isSelection=!0,e.target);0!==e.button||p.getPopupNoteVisibleStatus()||p.isClickedOnScrollBar(e,!1)||(p.isViewerMouseDown=!0,1===e.detail&&"e-pdfviewer-formFields"!==n.className&&"free-text-input"!==n.className&&p.focusViewerContainer(i=!0),p.scrollPosition=p.viewerContainer.scrollTop/p.getZoomFactor(),p.mouseX=e.clientX,p.mouseY=e.clientY,p.mouseLeft=e.clientX,p.mouseTop=e.clientY,t=!!document.documentMode,!p.pdfViewer.textSelectionModule)||p.isClickedOnScrollBar(e,!0)||p.isTextSelectionDisabled||(t||"e-pdfviewer-formFields"===n.className||"e-pdfviewer-ListBox"===n.className||-1!==n.className.indexOf("e-pv-formfield-dropdown")||"e-pv-formfield-listbox"===n.className||"e-pv-formfield-input"===n.className||"e-pv-formfield-textarea"===n.className||e.preventDefault(),"e-pv-droplet"!==n.className&&p.pdfViewer.textSelectionModule.clearTextSelection()),p.isClickedOnScrollBar(e,!1)&&(p.isViewerMouseDown=!0),p.isPanMode&&(p.dragX=e.pageX,p.dragY=e.pageY,p.viewerContainer.contains(e.target))&&e.target!==p.viewerContainer&&e.target!==p.pageContainer&&p.isPanMode&&(p.viewerContainer.style.cursor="grabbing"),!p.isShapeBasedAnnotationsEnabled()||!p.isAnnotationDrawn&&("e-pv-page-container"===n.className||"foreign-object"===n.className&&isNaN(p.activeElements.activePageID))||p.diagramMouseDown(e),p.pdfViewer.annotation&&p.pdfViewer.annotation.stickyNotesAnnotationModule.accordionContainer&&(i||(p.pdfViewer.annotationModule.stickyNotesAnnotationModule.isEditableElement=!1,p.updateCommentPanel(),i=!0)),N&&p.mouseDownHandler(e)},this.viewerContainerOnMouseup=function(e){var t,i,n,o,r,s;p.getPopupNoteVisibleStatus()||(p.isViewerMouseDown&&(p.scrollHoldTimer&&(clearTimeout(p.scrollHoldTimer),p.scrollHoldTimer=null),p.scrollPosition*p.getZoomFactor()!==p.viewerContainer.scrollTop)&&p.pageViewScrollChanged(p.currentPageNumber),r=!1,(r=e.target&&("e-pv-show-designer-name"===e.target.className&&""!==e.target.id.split("_",1)&&(r=document.getElementById(e.target.id.split("_",1)).disabled),"foreign-object"===e.target.className)&&e.target.children[0]?e.target.children[0].disabled:r)&&p.pdfViewer.annotation&&p.pdfViewer.annotation.clearSelection(),!p.isShapeBasedAnnotationsEnabled()||r||!p.isAnnotationDrawn&&"DrawTool"===p.action||(p.diagramMouseUp(e),p.pdfViewer.annotation&&p.pdfViewer.annotation.onAnnotationMouseUp()),0<p.pdfViewer.selectedItems.formFields.length?je(p.pdfViewer.toolbar)||je(p.pdfViewer.toolbar.formDesignerToolbarModule)||F.isDevice||p.pdfViewer.toolbar.formDesignerToolbarModule.showHideDeleteIcon(!0):je(p.pdfViewer.toolbar)||je(p.pdfViewer.toolbar.formDesignerToolbarModule)||F.isDevice||p.pdfViewer.toolbar.formDesignerToolbarModule.showHideDeleteIcon(!1),p.isSelection=!1,(r=document.getElementById(p.pdfViewer.element.id+"_commantPanel"))&&"block"===r.style.display&&p.pdfViewer.selectedItems&&0!==p.pdfViewer.selectedItems.annotations.length&&((r=document.getElementById(p.pdfViewer.element.id+"_accordionContainer"+p.pdfViewer.currentPageNumber))&&r.ej2_instances[0].expandItem(!0),r=document.getElementById(p.pdfViewer.selectedItems.annotations[0].annotName))&&!r.classList.contains("e-pv-comments-border")&&r.firstChild.click(),0!==e.button||p.isClickedOnScrollBar(e,!1)||(t=e.target,r=e.clientX,s=e.clientY,i=p.getZoomFactor(),n=p.currentPageNumber,t&&(o=t.id.split("_text_")[1]||t.id.split("_textLayer_")[1]||t.id.split("_annotationCanvas_")[1]||t.id.split("_pageDiv_")[1]||t.id.split("_freeText_")[1]||t.id.split("_")[1],n=parseInt(o,10),isNaN(n))&&p.pdfViewer.formFieldCollection&&0<(o=p.pdfViewer.formFieldCollection.filter(function(e){return e.id===t.id||e.id===t.id.split("_")[0]})).length&&(n=o[0].pageIndex),(o=p.getElement("_pageDiv_"+n))&&(o=o.getBoundingClientRect(),r=(e.clientX-o.left)/i,s=(e.clientY-o.top)/i),t&&t.classList&&!t.classList.contains("e-pv-hyperlink")&&!t.classList.contains("e-pv-page-container")&&(p.pdfViewer.firePageClick(r,s,n+1),p.pdfViewer.formFieldsModule)&&!p.pdfViewer.formDesignerModule&&p.signatureModule.removeFocus(),p.isTextMarkupAnnotationModule()&&!p.isToolbarInkClicked&&p.pdfViewer.annotationModule.textMarkupAnnotationModule.onTextMarkupAnnotationMouseUp(e),p.pdfViewer.formDesignerModule&&!p.pdfViewer.annotationModule&&p.pdfViewer.formDesignerModule.updateCanvas(n),p.viewerContainer.contains(e.target)&&e.target!==p.viewerContainer&&e.target!==p.pageContainer&&p.isPanMode&&(p.viewerContainer.style.cursor="move",p.viewerContainer.style.cursor="-webkit-grab",p.viewerContainer.style.cursor="-moz-grab",p.viewerContainer.style.cursor="grab")),p.isViewerMouseDown=!1)},this.detectTouchPad=function(e){p.isTouchPad=e.wheelDeltaY?e.wheelDeltaY===-3*e.deltaY||Math.abs(e.deltaY)<60:0===e.deltaMode},this.handleMacGestureStart=function(e){e.preventDefault(),e.stopPropagation(),p.macGestureStartScale=p.pdfViewer.magnification.zoomFactor},this.handleMacGestureChange=function(e){e.preventDefault(),e.stopPropagation();var t=e.clientX,i=e.clientY,e=Number((p.macGestureStartScale*e.scale).toFixed(2));p.isMacGestureActive||(p.isMacGestureActive=!0,p.pdfViewer.magnification.initiateMouseZoom(t,i,100*e),setTimeout(function(){p.isMacGestureActive=!1},50))},this.handleMacGestureEnd=function(e){e.preventDefault(),e.stopPropagation()},this.viewerContainerOnMouseWheel=function(e){var t;p.isViewerMouseWheel=!0,p.getRerenderCanvasCreated()&&e.preventDefault(),e.ctrlKey&&(t=25,(p.pdfViewer.magnificationModule?p.pdfViewer.magnification.zoomFactor:p.pdfViewer.zoomValue<1)&&(t=10),(p.pdfViewer.magnificationModule?p.pdfViewer.magnification.zoomFactor:2<=p.pdfViewer.zoomValue)&&(t=50),p.isTouchPad&&!p.isMacSafari&&(t/=p.zoomInterval),p.pdfViewer.magnificationModule&&(0<e.wheelDelta?p.pdfViewer.magnification.initiateMouseZoom(e.x,e.y,100*p.pdfViewer.magnification.zoomFactor+t):p.pdfViewer.magnification.initiateMouseZoom(e.x,e.y,100*p.pdfViewer.magnification.zoomFactor-t)),p.isTouchPad=!1),p.pdfViewer.magnificationModule&&(p.pdfViewer.magnificationModule.pageRerenderOnMouseWheel(),e.ctrlKey&&e.preventDefault(),p.pdfViewer.magnificationModule.fitPageScrollMouseWheel(e)),p.pdfViewer.textSelectionModule&&!p.isTextSelectionDisabled&&p.isViewerMouseDown&&!e.target.classList.contains("e-pv-text")&&p.pdfViewer.textSelectionModule.textSelectionOnMouseWheel(p.currentPageNumber-1)},this.onWindowKeyDown=function(e){var t,i,n,o=!!navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i)&&e.metaKey;if(!(p.isFreeTextAnnotationModule()&&p.pdfViewer.annotationModule&&(!0===p.pdfViewer.annotationModule.freeTextAnnotationModule.isInuptBoxInFocus||!0===p.pdfViewer.annotationModule.inputElementModule.isInFocus)||e.ctrlKey&&o))switch(e.keyCode){case 46:var r=document.activeElement;"INPUT"===r.tagName||"TEXTAREA"===r.tagName||r.isContentEditable||p.DeleteKeyPressed(e);break;case 27:p.pdfViewer.toolbar&&(p.pdfViewer.toolbar.addInkAnnotation(),p.pdfViewer.toolbar.deSelectCommentAnnotation(),p.pdfViewer.toolbar.updateStampItems(),p.pdfViewer.toolbar.annotationToolbarModule&&(N?p.pdfViewer.toolbar.annotationToolbarModule.deselectAllItemsInBlazor():p.pdfViewer.toolbar.annotationToolbarModule.deselectAllItems()),p.pdfViewer.isFormDesignerToolbarVisible&&document.getElementById("FormField_helper_html_element")&&(r=document.getElementById("FormField_helper_html_element"))&&r.remove(),p.pdfViewer.tool="",p.focusViewerContainer());break;case 13:if(p.pdfViewer.formDesignerModule&&"keydown"===e.type&&13===e.keyCode&&e.target&&(e.target.id||e.target.tabIndex)&&p.pdfViewer.formFieldCollections)for(var s=void 0,s=(e.target,(e.target.tabIndex&&!e.target.id?e.target.parentElement.id.split("_content_html_element"):e.target.id.split("_"))[0]),a=0;a<p.pdfViewer.formFieldCollections.length;a++){var l=p.pdfViewer.formFieldCollections[parseInt(a.toString(),10)];s!==l.id||"SignatureField"!==l.type&&"InitialField"!==l.type||(p.pdfViewer.fireFormFieldClickEvent("formFieldClicked",p.pdfViewer.formFieldCollections[parseInt(a.toString(),10)]),e.preventDefault())}break;case 32:if(p.pdfViewer.formDesignerModule&&"keydown"===e.type&&32===e.keyCode&&e.target&&e.target.id&&p.pdfViewer.formFields)for(a=0;a<p.pdfViewer.formFields.length;a++){var h=p.pdfViewer.formFields[parseInt(a.toString(),10)];if(e.target.id.split("_")[0]===h.id&&"Checkbox"===h.formFieldAnnotationType){p.pdfViewer.formDesignerModule.setCheckBoxState(e),e.preventDefault();break}}break;case 9:if(e.target&&(e.target.id||e.target.tabIndex)&&p.pdfViewer.formFieldCollections&&("e-pv-formfield-input"!==e.target.className&&"foreign-object"!==e.target.className&&e.target.id!==p.pdfViewer.element.id+"_viewerContainer"||(t=r=void 0,i=e.target,n=(e.target.tabIndex&&!e.target.id?(i=e.target.parentElement).id.split("_content_html_element"):(i=e.target).id.split("_input"))[0],p.pdfViewer.formDesignerModule&&(r=e.shiftKey&&"Tab"===e.key?0<(t=p.pdfViewer.formFieldCollections.findIndex(function(e){return e.id===n}))?p.pdfViewer.formFieldCollections[t-1]:p.pdfViewer.formFieldCollections[p.pdfViewer.formFieldCollections.length-1]:(t=p.pdfViewer.formFieldCollections.findIndex(function(e){return e.id===n}))+1<p.pdfViewer.formFieldCollections.length?p.pdfViewer.formFieldCollections[t+1]:p.pdfViewer.formFieldCollections[0],p.pdfViewer.focusFormField(r),e.preventDefault()),p.pdfViewer.formDesigner)||"e-pdfviewer-formFields"!==i.className&&(r=e.shiftKey&&"Tab"===e.key?0<(t=p.pdfViewer.formFieldCollections.findIndex(function(e){return e.id===i.id}))?p.pdfViewer.formFieldCollections[t-1]:p.pdfViewer.formFieldCollections[p.pdfViewer.formFieldCollections.length-1]:(t=p.pdfViewer.formFieldCollections.findIndex(function(e){return e.id===i.id}))+1<p.pdfViewer.formFieldCollections.length?p.pdfViewer.formFieldCollections[t+1]:p.pdfViewer.formFieldCollections[0],p.pdfViewer.focusFormField(r),e.preventDefault())),e.target&&e.target.id&&p.pdfViewer.formFields)for(a=0;a<p.pdfViewer.formFields.length;a++){var d,h=p.pdfViewer.formFields[parseInt(a.toString(),10)];e.target.id===h.id&&(d={value:h.value,fontFamily:h.fontFamily,fontSize:h.fontSize,fontStyle:h.fontStyle,color:h.color,backgroundColor:h.backgroundColor,alignment:h.alignment,isReadonly:h.isReadonly,visibility:h.visibility,maxLength:h.maxLength,isRequired:h.isRequired,isPrint:h.isPrint,rotation:h.rotateAngle,tooltip:h.tooltip,options:h.options,isChecked:h.isChecked,isSelected:h.isSelected},p.pdfViewer.fireFocusOutFormField(d,h.pageIndex))}}},this.viewerContainerOnKeyDown=function(e){var t,i=!!navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i),n=i&&e.metaKey,o=p.pdfViewer.commandManager;if(0!==Object.keys(o).length&&p.fireCustomCommands(e),(!p.pdfViewer.pageOrganizerModule||p.pdfViewer.pageOrganizerModule&&(!p.pdfViewer.pageOrganizerModule.isOrganizeWindowOpen||(e.ctrlKey||e.metaKey)&&e.altKey&&51===e.keyCode&&!e.shiftKey))&&(!p.isFreeTextAnnotationModule()||!p.pdfViewer.annotationModule||!0!==p.pdfViewer.annotationModule.freeTextAnnotationModule.isInuptBoxInFocus&&!0!==p.pdfViewer.annotationModule.inputElementModule.isInFocus)){if(e.shiftKey&&!(e.target.classList.contains("e-pv-formfield-input")||e.target.classList.contains("e-textbox")||e.target.classList.contains("e-pdfviewer-formFields")||e.target.classList.contains("e-pv-formfield-textarea")||e.target.id===p.pdfViewer.element.id+"_search_input"))switch(e.keyCode){case 72:e.preventDefault(),p.pdfViewer.toolbarModule&&p.pdfViewer.enableToolbar&&-1!==p.pdfViewer.toolbarSettings.toolbarItems.indexOf("PanTool")&&(p.pdfViewer.interactionMode="Pan",p.focusViewerContainer());break;case 86:e.preventDefault(),p.pdfViewer.toolbarModule&&p.pdfViewer.enableToolbar&&-1!==p.pdfViewer.toolbarSettings.toolbarItems.indexOf("SelectionTool")&&(p.pdfViewer.interactionMode="TextSelection",p.focusViewerContainer())}if(e.ctrlKey||n){if(e.shiftKey&&!i||i&&!e.shiftKey)switch(e.keyCode){case 38:case 33:e.preventDefault(),1!==p.currentPageNumber&&p.updateScrollTop(0);break;case 40:case 34:e.preventDefault(),p.currentPageNumber!==p.pageCount&&p.updateScrollTop(p.pageCount-1)}switch(e.keyCode){case 79:p.pdfViewer.toolbarModule&&p.pdfViewer.enableToolbar&&-1!==p.pdfViewer.toolbarSettings.toolbarItems.indexOf("OpenOption")?p.pdfViewer.toolbarModule.openFileDialogBox(e):e.preventDefault();break;case 67:p.pdfViewer.textSelectionModule&&p.pdfViewer.enableTextSelection&&!p.isTextSelectionDisabled&&p.isTargetClassNameValid(e)&&(e.preventDefault(),p.pdfViewer.textSelectionModule.copyText()),(p.pdfViewer.selectedItems.annotations.length||p.pdfViewer.selectedItems.formFields.length)&&(p.pdfViewer.copy(),p.contextMenuModule.previousAction="Copy");break;case 70:p.pdfViewer.textSearchModule&&p.pdfViewer.enableTextSearch&&(e.preventDefault(),p.pdfViewer.toolbarModule.textSearchButtonHandler());break;case 80:p.pdfViewer.printModule&&p.pdfViewer.enablePrint&&(e.preventDefault(),p.pdfViewer.firePrintStart());break;case 83:e.preventDefault(),p.pdfViewer.download();break;case 90:p.pdfViewer.textSearchModule&&p.isTextSearchBoxOpen()||p.pdfViewer.annotationModule&&p.focusOnViewerContainer()&&(!je(p.pdfViewer.annotationModule)&&p.pdfViewer.toolbarModule.annotationToolbarModule.inkAnnotationSelected&&p.pdfViewer.annotationModule.setAnnotationMode("None"),p.pdfViewer.annotationModule.undo());break;case 88:(p.pdfViewer.selectedItems.annotations.length||p.pdfViewer.selectedItems.formFields.length)&&(p.pdfViewer.cut(),p.contextMenuModule.previousAction="Cut");break;case 89:p.pdfViewer.textSearchModule&&p.isTextSearchBoxOpen()||p.pdfViewer.annotationModule&&p.focusOnViewerContainer()&&p.pdfViewer.annotationModule.redo();break;case 86:(p.pdfViewer.annotation&&p.pdfViewer.annotation.isShapeCopied||p.pdfViewer.formFields&&p.pdfViewer.formDesigner&&p.pdfViewer.formDesigner.isShapeCopied)&&(t=void 0,!(t=(r=document.getElementById(p.pdfViewer.element.id+"_search_box"))?"none"!==r.style.display:t))&&p.pdfViewer.formDesigner&&p.isTargetClassNameValid(e)&&"e-pv-properties-tooltip-prop-input e-input e-lib e-textbox e-control"!==e.target.className&&(p.pdfViewer.paste(),p.contextMenuModule.previousAction="Paste");break;case 71:e.preventDefault();var r=document.querySelector(".e-control.e-numerictextbox.e-lib.e-input");p.pdfViewer.toolbarModule&&p.pdfViewer.enableToolbar&&null!=r&&"none"!==r.style.display&&(r.blur(),r.focus());break;case 48:e.altKey&&(e.preventDefault(),t=document.getElementById(p.pdfViewer.element.id+"_commantPanel"),0<p.pageCount&&"none"===t.style.display?p.pdfViewer.annotationModule.showCommentsPanel():p.navigationPane.closeCommentPanelContainer());break;case 49:e.altKey&&(e.preventDefault(),0<p.pageCount)&&p.pdfViewer.enableThumbnail&&(e.preventDefault(),p.navigationPane.sideToolbarOnClick(e),p.focusViewerContainer());break;case 50:e.altKey&&(e.preventDefault(),0<p.pageCount)&&p.pdfViewer.enableBookmark&&(p.navigationPane.bookmarkButtonOnClick(e),p.focusViewerContainer());break;case 51:e.altKey&&(e.preventDefault(),!je(p.pdfViewer.pageOrganizer))&&0<p.pageCount&&p.pdfViewer.enablePageOrganizer&&(p.pdfViewer.pageOrganizer.switchPageOrganizer(),p.focusViewerContainer());break;case 65:e.shiftKey&&(e.preventDefault(),0<p.pageCount&&p.pdfViewer.enableAnnotationToolbar&&p.pdfViewer.toolbarModule&&p.pdfViewer.toolbarModule.annotationToolbarModule&&(p.pdfViewer.toolbarModule.initiateAnnotationMode(null,!0),p.focusViewerContainer()),r=document.getElementById(p.pdfViewer.toolbarModule.annotationToolbarModule.toolbar.items[0].id))&&r.focus()}}else p.pdfViewer.annotationModule&&!p.pdfViewer.textSearchModule&&"Delete"===e.key&&(o=document.activeElement,"e-pdfviewer-formFields"===e.target.className||"INPUT"===o.tagName||"TEXTAREA"===o.tagName||o.isContentEditable||p.DeleteKeyPressed(e));p.pdfViewer.magnificationModule&&p.pdfViewer.magnificationModule.magnifyBehaviorKeyDown(e)}},this.viewerContainerOnMousemove=function(e){p.mouseX=e.clientX,p.mouseY=e.clientY;var t,i,n,o,r=!!document.documentMode,s=e.target;"Drag"===p.action&&e.preventDefault(),p.isViewerMouseDown&&"Perimeter"!==p.action&&"Polygon"!==p.action&&"Line"!==p.action&&"DrawTool"!==p.action&&"Distance"!==p.action&&(p.pdfViewer.textSelectionModule&&p.pdfViewer.enableTextSelection&&!p.isTextSelectionDisabled&&!p.getPopupNoteVisibleStatus()?r?(r=window.getSelection()).type||r.isCollapsed||null===r.anchorNode||(p.pdfViewer.textSelectionModule.isTextSelection=!0):("e-pdfviewer-formFields"!==e.target.className&&e.preventDefault(),p.mouseX=e.clientX,p.mouseY=e.clientY,(r=p.pdfViewer.annotationModule)&&r.textMarkupAnnotationModule&&r.textMarkupAnnotationModule.isDropletClicked&&r.textMarkupAnnotationModule.isEnableTextMarkupResizer(r.textMarkupAnnotationModule.currentTextMarkupAddMode)?r.textMarkupAnnotationModule.textSelect(e.target,p.mouseX,p.mouseY):p.pdfViewer.textSelectionModule.textSelectionOnMouseMove(e.target,p.mouseX,p.mouseY)):p.skipPreventDefault(s)&&e.preventDefault()),p.isTextMarkupAnnotationModule()&&!p.getPopupNoteVisibleStatus()&&p.pdfViewer.annotationModule.textMarkupAnnotationModule.onTextMarkupAnnotationMouseMove(e),p.isPanMode&&p.panOnMouseMove(e),p.isShapeBasedAnnotationsEnabled()&&(r=void 0,e.target&&(-1<e.target.id.indexOf("_text")||e.target.parentElement.classList.contains("foreign-object")||-1<e.target.id.indexOf("_annotationCanvas")||e.target.classList.contains("e-pv-hyperlink"))&&p.pdfViewer.annotation||e.target.classList.contains("e-pdfviewer-formFields")||e.target.classList.contains("e-pv-text-layer")?(o=void 0,o=p.pdfViewer.annotation?p.pdfViewer.annotation.getEventPageNumber(e):(s=e.target.id.match(/\d+/))?parseInt(s[0],10):p.pdfViewer.currentPageNumber-1,(t=document.getElementById(p.pdfViewer.element.id+"_pageDiv_"+o))&&(n=(i=t.getBoundingClientRect()).x||i.left,s=i.y||i.top,r=p.pdfViewer.annotationModule&&p.pdfViewer.annotationModule.stampAnnotationModule.currentStampAnnotation&&"Image"===p.pdfViewer.annotationModule.stampAnnotationModule.currentStampAnnotation.shapeAnnotationType?new dvt(n,s,i.width-10,i.height-10):new dvt(n+1,s+1,i.width-3,i.height-3))):!p.pdfViewer.annotationModule&&p.pdfViewer.formDesignerModule&&(o=p.pdfViewer.formDesignerModule.getEventPageNumber(e),t=p.getAnnotationCanvas("_annotationCanvas_",o))&&(n=(i=t.getBoundingClientRect()).x||i.left,s=i.y||i.top,r=new dvt(n+10,s+10,i.width-10,i.height-10)),o=p.pdfViewer.annotationModule?p.pdfViewer.annotationModule.stampAnnotationModule:null,!r||!r.containsPoint({x:p.mouseX,y:p.mouseY})||o&&o.isStampAnnotSelected?(p.diagramMouseLeave(e),p.isAnnotationDrawn&&!p.pdfViewer.isFormDesignerToolbarVisible&&(p.diagramMouseUp(e),p.isAnnotationAdded=!0)):(p.diagramMouseMove(e),p.annotationEvent=e),p.pdfViewer.enableStampAnnotations&&o&&o.isStampAnnotSelected&&(p.pdfViewer.tool="Stamp",p.tool=new Uwt(p.pdfViewer,p),p.isMouseDown=!0,o.isStampAnnotSelected=!1,o.isNewStampAnnot=!0),p.isSignatureAdded)&&p.pdfViewer.enableHandwrittenSignature&&(p.pdfViewer.tool="Stamp",p.tool=new Uwt(p.pdfViewer,p),p.isMouseDown=!0,p.isSignatureAdded=!1,p.isNewSignatureAdded=!0)},this.panOnMouseMove=function(e){var t,i=!1;"Ink"!==p.action&&"Line"!==p.action&&"Perimeter"!==p.action&&"Polygon"!==p.action&&"DrawTool"!==p.action&&"Drag"!==p.action&&-1===p.action.indexOf("Rotate")&&-1===p.action.indexOf("Resize")||(i=!0),p.viewerContainer.contains(e.target)&&e.target!==p.viewerContainer&&e.target!==p.pageContainer&&!i?p.isViewerMouseDown?(i=p.dragX-e.pageX,t=p.dragY-e.pageY,p.viewerContainer.scrollTop=p.viewerContainer.scrollTop+t,p.viewerContainer.scrollLeft=p.viewerContainer.scrollLeft+i,p.viewerContainer.style.cursor="move",p.viewerContainer.style.cursor="-webkit-grabbing",p.viewerContainer.style.cursor="-moz-grabbing",p.viewerContainer.style.cursor="grabbing",p.dragX=e.pageX,p.dragY=e.pageY):p.navigationPane.isNavigationPaneResized||(p.viewerContainer.style.cursor="move",p.viewerContainer.style.cursor="-webkit-grab",p.viewerContainer.style.cursor="-moz-grab",p.viewerContainer.style.cursor="grab"):p.navigationPane.isNavigationPaneResized||(p.viewerContainer.style.cursor="auto")},this.viewerContainerOnMouseLeave=function(e){p.isViewerMouseDown&&p.pdfViewer.textSelectionModule&&!p.isTextSelectionDisabled&&p.pdfViewer.textSelectionModule.textSelectionOnMouseLeave(e),p.pdfViewer.textSelectionModule&&p.pdfViewer.textSelectionModule.isTextSelection&&e.preventDefault(),"Ink"===p.action&&(p.diagramMouseUp(e),p.isAnnotationAdded=!0)},this.viewerContainerOnMouseEnter=function(e){p.pdfViewer.textSelectionModule&&!p.isTextSelectionDisabled&&p.pdfViewer.textSelectionModule.clear()},this.viewerContainerOnMouseOver=function(e){var t=!!document.documentMode;p.isViewerMouseDown&&!t&&e.preventDefault()},this.viewerContainerOnClick=function(e){var t,i,n,o,r;"dblclick"===e.type?(!p.pdfViewer.textSelectionModule||p.isTextSelectionDisabled||p.getCurrentTextMarkupAnnotation()?p.getCurrentTextMarkupAnnotation():e.target.classList.contains("e-pv-text")&&(p.isViewerContainerDoubleClick=!0,p.getTextMarkupAnnotationMode()||(t=parseFloat(e.target.id.split("_")[2]),p.pdfViewer.fireTextSelectionStart(t+1)),p.pdfViewer.textSelectionModule.selectAWord(e.target,e.clientX,e.clientY,!1),"MouseUp"===p.pdfViewer.contextMenuSettings.contextMenuAction&&p.pdfViewer.textSelectionModule.calculateContextMenuPosition(e.clientY,e.clientX),p.getTextMarkupAnnotationMode()?p.isTextMarkupAnnotationModule()&&p.getTextMarkupAnnotationMode()&&p.pdfViewer.annotationModule.textMarkupAnnotationModule.drawTextMarkupAnnotations(p.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAddMode):(p.pdfViewer.textSelectionModule.maintainSelectionOnZoom(!0,!1),p.dblClickTimer=setTimeout(function(){p.applySelection()},100),p.pdfViewer.textSelectionModule.fireTextSelectEnd())),p.action&&("Perimeter"===p.action||"Polygon"===p.action)&&p.tool&&(p.eventArgs.position=p.currentPosition,p.getMouseEventArgs(p.currentPosition,p.eventArgs,e,p.eventArgs.source),p.isMetaKey(e),t={ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},p.eventArgs.info=t,p.eventArgs.clickCount=e.detail,p.eventArgs.isTouchMode=!1,p.tool.mouseUp(p.eventArgs,!0)),(p.pdfViewer.selectedItems||p.pdfViewer.annotation&&p.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation)&&!p.pdfViewer.annotationSettings.isLock&&(t=p.pdfViewer.selectedItems.annotations[0],0===p.pdfViewer.selectedItems.annotations.length||t.annotationSettings.isLock||t.isLock?(n=p.pdfViewer.annotation,r=p.pdfViewer.annotationModule,n&&r.textMarkupAnnotationModule&&r.textMarkupAnnotationModule.currentTextMarkupAnnotation&&(n=p.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation,p.pdfViewer.annotationModule.annotationSelect(n.annotName,p.pdfViewer.annotationModule.textMarkupAnnotationModule.selectTextMarkupCurrentPage,n,null,!0),(i=document.getElementById(p.pdfViewer.element.id+"_accordionContainer"+p.currentPageNumber))&&i.ej2_instances[0].expandItem(!0),r=document.getElementById(n.annotName))&&r.firstChild.click()):p.pdfViewer.annotationModule&&!t.formFieldAnnotationType&&(p.pdfViewer.annotationModule.annotationSelect(t.annotName,t.pageIndex,t,null,!0),!1===p.pdfViewer.annotationModule.freeTextAnnotationModule.isInuptBoxInFocus)&&(!0!==p.isFreeTextAnnotation(p.pdfViewer.selectedItems.annotations)||p.pdfViewer.selectedItems.annotations[0].isLock?!0===p.pdfViewer.selectedItems.annotations[0].enableShapeLabel?((o={}).x=p.pdfViewer.selectedItems.annotations[0].bounds.x,o.y=p.pdfViewer.selectedItems.annotations[0].bounds.y,p.pdfViewer.annotation.inputElementModule.editLabel(o,p.pdfViewer.selectedItems.annotations[0])):((i=document.getElementById(p.pdfViewer.element.id+"_accordionContainer"+p.pdfViewer.currentPageNumber))&&i.ej2_instances[0].expandItem(!0),p.pdfViewer.toolbarModule&&p.pdfViewer.isFormDesignerToolbarVisible&&p.pdfViewer.enableAnnotationToolbar&&!p.pdfViewer.isAnnotationToolbarVisible&&!je(p.pdfViewer.toolbarModule.annotationToolbarModule)&&p.pdfViewer.toolbarModule.annotationToolbarModule.showAnnotationToolbar(p.pdfViewer.toolbarModule.annotationItem),(n=document.getElementById(p.pdfViewer.selectedItems.annotations[0].annotName))&&!n.classList.contains("e-pv-comments-border")&&n.firstChild.click()):((o={}).x=p.pdfViewer.selectedItems.annotations[0].bounds.x,o.y=p.pdfViewer.selectedItems.annotations[0].bounds.y,p.pdfViewer.annotation.freeTextAnnotationModule.addInuptElemet(o,p.pdfViewer.selectedItems.annotations[0])))),p.pdfViewer.designerMode&&0<p.pdfViewer.selectedItems.formFields.length&&(r={name:"formFieldDoubleClick",field:p.pdfViewer.selectedItems.formFields[0],cancel:!1},p.pdfViewer.fireFormFieldDoubleClickEvent(r),r.cancel||p.pdfViewer.formDesigner.createPropertiesWindow())):3===e.detail&&(p.isViewerContainerDoubleClick&&(clearTimeout(p.dblClickTimer),p.isViewerContainerDoubleClick=!1),!p.pdfViewer.textSelectionModule||p.isTextSelectionDisabled||p.getTextMarkupAnnotationMode()||(p.pdfViewer.textSelectionModule.selectEntireLine(e),p.pdfViewer.textSelectionModule.maintainSelectionOnZoom(!0,!1),p.pdfViewer.textSelectionModule.fireTextSelectEnd(),p.applySelection()))},this.viewerContainerOnDragStart=function(e){!document.documentMode&&e.preventDefault()},this.viewerContainerOnContextMenuClick=function(e){p.isViewerMouseDown=!1},this.onWindowMouseUp=function(e){p.isFreeTextContextMenu=!1,p.isNewStamp=!1,p.signatureAdded=!1;var t,i=p.pdfViewer.annotationModule;if(i&&i.textMarkupAnnotationModule&&i.textMarkupAnnotationModule.isEnableTextMarkupResizer(i.textMarkupAnnotationModule.currentTextMarkupAddMode)&&((i=i.textMarkupAnnotationModule).isLeftDropletClicked=!1,i.isDropletClicked=!1,i.isRightDropletClicked=!1,i.currentTextMarkupAnnotation||null!==window.getSelection().anchorNode?i.currentTextMarkupAnnotation||""!==i.currentTextMarkupAddMode||(i.isTextMarkupAnnotationMode=!1):i.showHideDropletDiv(!0)),!p.getPopupNoteVisibleStatus())return 0===e.button?p.isNewFreeTextAnnotation()&&(!p.pdfViewer.textSelectionModule||p.isTextSelectionDisabled||p.getTextMarkupAnnotationMode()?p.getTextMarkupAnnotationMode()&&(i=p.pdfViewer.element,t=e.target,i)&&t&&i.id.split("_")[0]===t.id.split("_")[0]&&"commenttextbox"!==t.id.split("_")[1]&&p.pdfViewer.annotationModule.textMarkupAnnotationModule.drawTextMarkupAnnotations(p.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAddMode):(1!==e.detail||p.viewerContainer.contains(e.target)||p.contextMenuModule.contextMenuElement.contains(e.target)||null!==window.getSelection().anchorNode&&p.pdfViewer.textSelectionModule.textSelectionOnMouseup(e),i=e.target,p.viewerContainer.contains(e.target)&&"e-pdfviewer-formFields"!==i.className&&"e-pv-formfield-input"!==i.className&&"e-pv-formfield-textarea"!==i.className&&(p.isClickedOnScrollBar(e,!0)||p.isScrollbarMouseDown?null!==window.getSelection().anchorNode&&p.pdfViewer.textSelectionModule.applySpanForSelection():p.pdfViewer.textSelectionModule.textSelectionOnMouseup(e)))):2===e.button&&p.viewerContainer.contains(e.target)&&p.skipPreventDefault(e.target)&&p.checkIsNormalText()&&window.getSelection().removeAllRanges(),!p.isViewerMouseDown||(p.isViewerMouseDown=!1,p.pdfViewer.textSelectionModule&&!p.isTextSelectionDisabled&&(p.pdfViewer.textSelectionModule.clear(),p.pdfViewer.textSelectionModule.selectionStartPage=null),e.preventDefault(),e.stopPropagation(),!1)},this.onWindowTouchEnd=function(e){p.signatureAdded=!1,p.pdfViewer.element.contains(e.target)||p.contextMenuModule.contextMenuElement.contains(e.target)||p.pdfViewer.textSelectionModule&&!p.isTextSelectionDisabled&&p.pdfViewer.textSelectionModule.clearTextSelection()},this.viewerContainerOnTouchStart=function(e){var t=e.touches,i=(p.pdfViewer.magnificationModule&&p.pdfViewer.magnificationModule.setTouchPoints(t[0].clientX,t[0].clientY),e.target),t=(1===t.length&&!i.classList.contains("e-pv-hyperlink")&&p.skipPreventDefault(i)&&p.preventTouchEvent(e),1!==e.touches.length||!p.isTextMarkupAnnotationModule()||p.getPopupNoteVisibleStatus()||p.isToolbarInkClicked||p.pdfViewer.annotationModule.textMarkupAnnotationModule.onTextMarkupAnnotationTouchEnd(e),p.touchClientX=t[0].clientX,p.touchClientY=t[0].clientY,p.scrollY=t[0].clientY,p.previousTime=(new Date).getTime(),p.diagramMouseDown(e),1!==t.length||e.target.classList.contains("e-pv-touch-select-drop")||e.target.classList.contains("e-pv-touch-ellipse")||(F.isDevice&&!p.pdfViewer.enableDesktopMode&&0<p.pageCount&&!p.isThumb&&!e.target.classList.contains("e-pv-hyperlink")&&p.handleTaps(t,e),N&&F.isDevice&&!p.pdfViewer.enableDesktopMode||p.handleTextBoxTaps(t),p.isDesignerMode(i)?(p.contextMenuModule.close(),p.isLongTouchPropagated||(p.longTouchTimer=setTimeout(function(){p.isMoving||(p.isTouchDesignerMode=!0,p.contextMenuModule.open(p.touchClientY,p.touchClientX,p.viewerContainer))},1e3)),p.isLongTouchPropagated=!0,p.isMoving=!1):p.pdfViewer.textSelectionModule&&!p.isTextSelectionDisabled?(p.pdfViewer.textSelectionModule.clearTextSelection(),p.contextMenuModule.close(),p.isLongTouchPropagated||(p.longTouchTimer=setTimeout(function(){p.viewerContainerOnLongTouch(e)},1e3)),p.isLongTouchPropagated=!0):p.contextMenuModule.close()),p.pdfViewer.toolbarModule?p.pdfViewer.toolbarModule.annotationToolbarModule:"null");!i.classList.contains("e-pv-text")||t&&t.textMarkupToolbarElement&&0!==t.textMarkupToolbarElement.children.length||i.classList.add("e-pv-text-selection-none"),F.isDevice&&!p.pdfViewer.enableDesktopMode&&i.classList.remove("e-enable-text-selection"),"Perimeter"!==p.action&&"Distance"!==p.action&&"Line"!==p.action&&"Polygon"!==p.action&&"DrawTool"!==p.action&&"Drag"!==p.action&&-1===p.action.indexOf("Rotate")&&-1===p.action.indexOf("Resize")||e.preventDefault()},this.viewerContainerOnLongTouch=function(e){var t;p.touchClientX=e.touches[0].clientX,p.touchClientY=e.touches[0].clientY,e.preventDefault(),p.pdfViewer.textSelectionModule&&((t=e.target).classList.contains("e-pv-text-selection-none")&&t.classList.contains("e-pv-text")&&(t.classList.remove("e-pv-text-selection-none"),F.isDevice)&&!p.pdfViewer.enableDesktopMode&&t.classList.add("e-enable-text-selection"),p.pdfViewer.textSelectionModule.initiateTouchSelection(e,p.touchClientX,p.touchClientY),F.isDevice)&&!p.pdfViewer.enableDesktopMode&&(clearTimeout(p.singleTapTimer),p.tapCount=0)},this.viewerContainerOnPointerDown=function(e){"touch"===e.pointerType&&(p.pointerCount++,p.pointerCount<=2)&&(e.preventDefault(),p.pointersForTouch.push(e),2===p.pointerCount&&(p.pointerCount=0),p.pdfViewer.magnificationModule)&&p.pdfViewer.magnificationModule.setTouchPoints(e.clientX,e.clientY)},this.viewerContainerOnTouchMove=function(e){"Drag"===p.action&&(p.isMoving=!0),F.isDevice&&!p.pdfViewer.enableDesktopMode&&(clearTimeout(p.singleTapTimer),p.singleTapTimer=null,p.tapCount=0),p.preventTouchEvent(e),p.isToolbarInkClicked&&e.preventDefault();var t,i,n=e.touches;p.pdfViewer.magnificationModule&&(p.isTouchScrolled=!0,1<n.length&&0<p.pageCount?(F.isDevice&&!p.pdfViewer.enableDesktopMode&&(p.isTouchScrolled=!1),p.pdfViewer.enablePinchZoom&&p.pdfViewer.magnificationModule.initiatePinchMove(n[0].clientX,n[0].clientY,n[1].clientX,n[1].clientY)):1===n.length&&p.getPagesPinchZoomed()&&(F.isDevice&&!p.pdfViewer.enableDesktopMode&&(p.isTouchScrolled=!1),p.pdfViewer.magnificationModule.pinchMoveScroll())),p.mouseX=n[0].clientX,p.mouseY=n[0].clientY,e.target&&(-1<e.target.id.indexOf("_text")||-1<e.target.id.indexOf("_annotationCanvas")||e.target.classList.contains("e-pv-hyperlink"))&&p.pdfViewer.annotation&&(n=p.pdfViewer.annotation.getEventPageNumber(e),n=p.getAnnotationCanvas("_annotationCanvas_",n))&&(i=(n=n.getBoundingClientRect()).x||n.left,t=n.y||n.top,i=new dvt(i+10,t+10,n.width-10,n.height-10)),i&&i.containsPoint({x:p.mouseX,y:p.mouseY})||"Ink"===p.action?(p.diagramMouseMove(e),p.annotationEvent=e):(p.diagramMouseLeave(e),p.isAnnotationDrawn&&(p.diagramMouseUp(e),p.isAnnotationAdded=!0))},this.viewerContainerOnPointerMove=function(e){if("touch"===e.pointerType&&0<p.pageCount&&(e.preventDefault(),2===p.pointersForTouch.length)){for(var t=0;t<p.pointersForTouch.length;t++)if(e.pointerId===p.pointersForTouch[parseInt(t.toString(),10)].pointerId){p.pointersForTouch[parseInt(t.toString(),10)]=e;break}p.pdfViewer.magnificationModule&&p.pdfViewer.enablePinchZoom&&p.pdfViewer.magnificationModule.initiatePinchMove(p.pointersForTouch[0].clientX,p.pointersForTouch[0].clientY,p.pointersForTouch[1].clientX,p.pointersForTouch[1].clientY)}},this.viewerContainerOnTouchEnd=function(e){var t,i,n;p.pdfViewer.magnificationModule&&p.pdfViewer.magnificationModule.pinchMoveEnd(),e.cancelable&&!e.target.classList.contains("e-pv-touch-ellipse")&&p.pdfViewer.textSelectionModule&&p.pdfViewer.textSelectionModule.isTextSelection&&e.preventDefault(),p.isLongTouchPropagated=!1,clearInterval(p.longTouchTimer),p.longTouchTimer=null,F.isDevice&&!p.isDeviceiOS&&!p.pdfViewer.enableDesktopMode&&p.isTouchScrolled&&(p.currentTime=(new Date).getTime(),t=p.currentTime-p.previousTime,i=(n=p.scrollY-e.changedTouches[0].pageY)/t,1.5<Math.abs(i))&&0<(n=n+t*i)&&(p.viewerContainer.scrollTop+=n,p.updateMobileScrollerPosition()),p.diagramMouseUp(e),0!==p.pdfViewer.selectedItems.annotations.length?p.disableTextSelectionMode():p.pdfViewer.textSelectionModule&&p.pdfViewer.textSelectionModule.enableTextSelectionMode(),p.renderStampAnnotation(e),F.isDevice||(p.isgetFocused=!0,p.focusViewerContainer())},this.viewerContainerOnPointerEnd=function(e){"touch"===e.pointerType&&(e.preventDefault(),p.pdfViewer.magnificationModule&&p.pdfViewer.magnificationModule.pinchMoveEnd(),p.pointersForTouch=[],p.pointerCount=0)},this.viewerContainerOnScroll=function(e){for(var t=null,i=(t=p).pdfViewer.allowServerDataBinding,n=(t.pdfViewer.enableServerDataBinding(!1),0),o=0,r=(e.touches&&F.isDevice&&!p.pdfViewer.enableDesktopMode&&(h=(p.viewerContainer.scrollHeight-p.viewerContainer.clientHeight)/(p.viewerContainer.clientHeight-p.toolbarHeight),p.isThumb?(p.ispageMoved=!0,e.preventDefault(),p.isScrollerMoving=!0,p.mobilePageNoContainer.style.display="block",n=e.touches[0].pageX-p.scrollX,o=e.touches[0].pageY-p.viewerContainer.offsetTop,je(p.isScrollerMovingTimer)&&(p.isScrollerMovingTimer=setTimeout(function(){p.isScrollerMoving=!1,p.pageViewScrollChanged(p.currentPageNumber)},300)),10<Math.abs(p.viewerContainer.scrollTop-o*h)&&(clearTimeout(p.isScrollerMovingTimer),p.isScrollerMovingTimer=null),p.viewerContainer.scrollTop=o*h,h=e.touches[0].pageY,r=p.pdfViewer.toolbarModule?0:50,0!==p.viewerContainer.scrollTop&&h<=p.viewerContainer.clientHeight-r&&(p.mobileScrollerContainer.style.top=h+"px")):"e-pv-touch-ellipse"!==e.touches[0].target.className&&(p.isWebkitMobile&&F.isDevice&&!p.pdfViewer.enableDesktopMode||(p.mobilePageNoContainer.style.display="none",o=p.touchClientY-e.touches[0].pageY,n=p.touchClientX-e.touches[0].pageX,p.viewerContainer.scrollTop=p.viewerContainer.scrollTop+o,p.viewerContainer.scrollLeft=p.viewerContainer.scrollLeft+n),p.updateMobileScrollerPosition(),p.touchClientY=e.touches[0].pageY,p.touchClientX=e.touches[0].pageX)),p.scrollHoldTimer&&clearTimeout(p.scrollHoldTimer),p.currentPageNumber),s=(p.scrollHoldTimer=null,p.contextMenuModule.close(),p.viewerContainer.scrollTop),a=0;a<p.pageCount;a++)if(null!=p.pageSize[parseInt(a.toString(),10)]){var l=p.getPageHeight(a);if(p.pageStopValue=l<150?75:150<=l&&l<300?125:300<=l&&l<500?200:300,s+p.pageStopValue<=p.getPageTop(a)+l){p.currentPageNumber=a+1,p.pdfViewer.currentPageNumber=a+1;break}}p.pdfViewer.magnificationModule&&"fitToPage"===p.pdfViewer.magnificationModule.fitType&&0<p.currentPageNumber&&p.pageSize[p.currentPageNumber-1]&&!p.isPanMode&&!F.isDevice&&p.pdfViewer.enableDesktopMode&&(p.viewerContainer.scrollTop=p.pageSize[p.currentPageNumber-1].top*p.getZoomFactor()),p.renderElementsVirtualScroll(p.currentPageNumber),p.pdfViewer.toolbarModule&&(N||p.pdfViewer.toolbarModule.updateCurrentPage(p.currentPageNumber),N||F.isDevice&&!p.pdfViewer.enableDesktopMode||p.pdfViewer.toolbarModule.updateNavigationButtons()),F.isDevice&&!p.pdfViewer.enableDesktopMode&&(p.mobileSpanContainer.innerHTML=p.currentPageNumber.toString(),p.mobilecurrentPageContainer.innerHTML=p.currentPageNumber.toString()),r!==p.currentPageNumber&&(!t.pdfViewer.thumbnailViewModule||F.isDevice&&!p.pdfViewer.enableDesktopMode||(t.pdfViewer.thumbnailViewModule.gotoThumbnailImage(t.currentPageNumber-1),t.pdfViewer.thumbnailViewModule.isThumbnailClicked=!1),p.pdfViewer.firePageChange(r)),p.pdfViewer.magnificationModule&&!p.isPanMode&&!F.isDevice&&p.pdfViewer.enableDesktopMode&&p.pdfViewer.magnificationModule.updatePagesForFitPage(p.currentPageNumber-1);var h=p.getElement("_pageDiv_"+(p.currentPageNumber-1));h&&(h.style.visibility="visible"),!p.isViewerMouseDown&&(p.isViewerMouseDown||p.getPinchZoomed()||p.getPinchScrolled()||p.getPagesPinchZoomed())&&!p.isViewerMouseWheel||(p.getRerenderCanvasCreated()&&!p.isPanMode&&p.pdfViewer.magnificationModule.clearIntervalTimer(),(p.clientSideRendering?p.getLinkInformation(p.currentPageNumber):p.getStoredData(p.currentPageNumber))?(p.isDataExits=!0,p.initiatePageViewScrollChanged(),p.isDataExits=!1):(o=p.pdfViewer.scrollSettings.delayPageRequestTimeOnScroll||100,p.scrollHoldTimer=setTimeout(function(){p.initiatePageViewScrollChanged()},o))),p.pdfViewer.annotation&&p.navigationPane.commentPanelContainer&&p.pdfViewer.annotation.stickyNotesAnnotationModule.updateCommentPanelScrollTop(p.currentPageNumber),F.isDevice&&!p.pdfViewer.enableDesktopMode&&e.touches&&"e-pv-touch-ellipse"!==e.touches[0].target.className&&setTimeout(function(){p.updateMobileScrollerPosition()},500),t.pdfViewer.enableServerDataBinding(i,!0)},this.pdfViewer=e,this.navigationPane=new gLt(this.pdfViewer,this),this.textLayer=new xRt(this.pdfViewer,this),this.accessibilityTags=new U2t(this.pdfViewer,this),this.signatureModule=new kRt(this.pdfViewer,this)}IRt.prototype.addTextLayer=function(e,t,i,n){var o;return document.getElementById(this.pdfViewer.element.id+"_textLayer_"+e)||((o=Q("div",{id:this.pdfViewer.element.id+"_textLayer_"+e,className:"e-pv-text-layer"})).style.width=t+"px",o.style.height=i+"px",F.isDevice&&!this.pdfViewer.enableDesktopMode&&o.classList.add("e-pv-text-selection-none"),n&&n.appendChild(o)),this.pdfViewerBase.applyElementStyles(o,e),o},IRt.prototype.renderTextContents=function(e,t,i,n,o){var r,s,a,l=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+e),h=Q("canvas"),d=(this.pdfViewerBase.clientSideRendering&&(r=!1),[]),p=[],c=(1<i.length&&(a=(0===i[0].Width&&2<i.length?(s=i[1].Y,i[1]):(s=i[0].Y,i[0])).Height),0);if(h&&l&&0===l.childNodes.length){for(var u=0;u<t.length;u++)if(t[parseInt(u.toString(),10)].includes("\r\n")||t[parseInt(u.toString(),10)].includes("")||u===i.length-1||0!==n||o){d.push(i[parseInt(u.toString(),10)]),p.push(t[parseInt(u.toString(),10)]),s>i[parseInt(u.toString(),10)].Y&&0!==i[parseInt(u.toString(),10)].Width&&(s=i[parseInt(u.toString(),10)].Y),a<i[parseInt(u.toString(),10)].Height&&0!==i[parseInt(u.toString(),10)].Width&&(a=i[parseInt(u.toString(),10)].Height);for(var g=0;g<d.length;g++){var m=d[parseInt(g.toString(),10)],f=Q("div",{id:this.pdfViewer.element.id+"_text_"+e+"_"+c,className:"e-pv-text",attrs:{tabindex:"-1"}}),y=p[parseInt(g.toString(),10)];" "===y&&g!==d.length-1&&0!==g&&(m.Height=d[g-1].Height,m.Y=d[g-1].Y),f.textContent=y.replace(/&nbsp;/g," ");" "!==p[parseInt(g.toString(),10)].replace(/  +/g," ")&&(f.style.whiteSpace="pre"),this.pdfViewerBase.clientSideRendering&&(" "===y&&(f.style.whiteSpace="pre"),je(f.textContent)||" "===y||(r=this.pdfViewerBase.checkIsRtlText(f.textContent)),f.style.direction=r?"rtl":"ltr"),0===m.Width&&g!==d.length-1&&0!==g&&d[g+1].X-(d[g-1].X+d[g-1].Width)<30&&!p[g-1].includes("\r\n")&&!t[parseInt(g.toString(),10)].includes("")&&(m.Width=d[g+1].X-(d[g-1].X+d[g-1].Width),m.X=d[g-1].X+d[g-1].Width,m.Width<0?m.Width=0:f.style.whiteSpace="pre"),(0!==g||d.length-1==0||20<m.Y-s&&0!==m.Width)&&0!==c&&(11<i[c-1].Y-i[parseInt(c.toString(),10)].Y||11<i[parseInt(c.toString(),10)].Y-i[c-1].Y)&&" "!==p[parseInt(g.toString(),10)]&&(s=d[parseInt(g.toString(),10)].Y,a=d[parseInt(g.toString(),10)].Height),m&&(270!==m.Rotation&&(m.Y=s,m.Height=a),this.setStyleToTextDiv(f,m.X,m.Y,m.Bottom,m.Width,m.Height,m.Rotation)),this.setTextElementProperties(f);var v,y=h.getContext("2d"),y=(y.font=f.style.fontSize+" "+f.style.fontFamily,y.measureText(p[parseInt(g.toString(),10)].replace(/(\r\n|\n|\r)/gm,"")).width);m&&(v=void 0,v=90===m.Rotation||this.pdfViewerBase.clientSideRendering&&270===m.Rotation?m.Height*this.pdfViewerBase.getZoomFactor()/y:m.Width*this.pdfViewerBase.getZoomFactor()/y,this.applyTextRotation(v,f,n,m.Rotation,m)),l.appendChild(f),this.resizeExcessDiv(l,f),this.pdfViewer.textSelectionModule&&this.pdfViewer.enableTextSelection&&!this.pdfViewerBase.isTextSelectionDisabled&&"e-pdfviewer-formFields"!==f.className&&"e-pdfviewer-signatureformfields"!==f.className&&"e-pdfviewer-signatureformfields-signature"!==f.className&&f.classList.add("e-pv-cursor"),F.isDevice&&!this.pdfViewer.enableDesktopMode&&f.classList.add("e-enable-text-selection"),c++}d=[],p=[],u<i.length-1&&(a=(0!==i[u+1].Width||je(i[u+2])?(s=i[u+1].Y,i[u+1]):(s=i[u+2].Y,i[u+2])).Height)}else d.push(i[parseInt(u.toString(),10)]),p.push(t[parseInt(u.toString(),10)]),s>i[parseInt(u.toString(),10)].Y&&0!==i[parseInt(u.toString(),10)].Width&&(s=i[parseInt(u.toString(),10)].Y),a<i[parseInt(u.toString(),10)].Height&&0!==i[parseInt(u.toString(),10)].Width&&(a=i[parseInt(u.toString(),10)].Height);this.pdfViewerBase.releaseCanvas(h)}},IRt.prototype.resizeTextContents=function(e,t,i,n,o){var r=this.pdfViewerBase.getElement("_textLayer_"+e),s=Q("canvas");if(s){for(var a=0;a<r.childNodes.length;a++){var l=void 0,h=this.pdfViewerBase.getElement("_text_"+e+"_"+a);if(je(h))break;i&&(l=i[parseInt(a.toString(),10)])&&this.setStyleToTextDiv(h,l.X,l.Y,l.Bottom,l.Width,l.Height,l.Rotation),this.setTextElementProperties(h);var d,p=s.getContext("2d"),c=(p.font=h.style.fontSize+" "+h.style.fontFamily,void 0);t?(d=t[parseInt(a.toString(),10)])&&(c=p.measureText(d.replace(/(\r\n|\n|\r)/gm,"")).width):c=p.measureText(h.textContent.replace(/(\r\n|\n|\r)/gm,"")).width,l&&(d=void 0,d=90===l.Rotation||this.pdfViewerBase.clientSideRendering&&270===l.Rotation?l.Height*this.pdfViewerBase.getZoomFactor()/c:l.Width*this.pdfViewerBase.getZoomFactor()/c,this.applyTextRotation(d,h,n,l.Rotation,l)),this.resizeExcessDiv(r,h)}this.pdfViewerBase.releaseCanvas(s)}else r.parentElement.removeChild(r);this.pdfViewer.textSearch&&!o&&this.pdfViewer.textSearch.resizeSearchElements(e)},IRt.prototype.applyTextRotation=function(e,t,i,n,o){var r,e="scaleX("+e+")";this.pdfViewerBase.clientSideRendering?0===i?0===n?t.style.transform=e:90===n?(t.style.left=(o.X+o.Width)*this.pdfViewerBase.getZoomFactor()+"px",t.style.top=o.Y*this.pdfViewerBase.getZoomFactor()+"px",t.style.transform="rotate("+n+"deg) "+e):180===n?(t.style.left=(o.X+o.Width)*this.pdfViewerBase.getZoomFactor()+"px",t.style.top=(o.Y+o.Height)*this.pdfViewerBase.getZoomFactor()+"px",t.style.transform="rotate("+n+"deg) "+e):270===n?(t.style.left=o.X*this.pdfViewerBase.getZoomFactor()+"px",t.style.top=(o.Y+o.Height)*this.pdfViewerBase.getZoomFactor()+"px",t.style.transform="rotate("+n+"deg) "+e):t.style.transform=e:1===i?(360<=(r=n+90)&&(r-=360),0===n?t.style.transform="rotate(90deg) "+e:90===n?(t.style.left=o.X*this.pdfViewerBase.getZoomFactor()+"px",t.style.top=(o.Y+o.Width)*this.pdfViewerBase.getZoomFactor()+"px",t.style.transform="rotate("+r+"deg) "+e):180===n?(t.style.left=(o.X-o.Height)*this.pdfViewerBase.getZoomFactor()+"px",t.style.top=(o.Y+o.Width)*this.pdfViewerBase.getZoomFactor()+"px",t.style.transform="rotate("+r+"deg) "+e):270===n?(t.style.left=(o.X-o.Height)*this.pdfViewerBase.getZoomFactor()+"px",t.style.top=o.Y*this.pdfViewerBase.getZoomFactor()+"px",t.style.transform="rotate("+r+"deg) "+e):t.style.transform="rotate(90deg) "+e):2===i?(360<=(r=n+180)&&(r-=360),0===n?t.style.transform="rotate(180deg) "+e:90===n?(t.style.left=(o.X-o.Width)*this.pdfViewerBase.getZoomFactor()+"px",t.style.top=o.Y*this.pdfViewerBase.getZoomFactor()+"px",t.style.transform="rotate("+r+"deg) "+e):180===n?(t.style.left=(o.X-o.Width)*this.pdfViewerBase.getZoomFactor()+"px",t.style.top=(o.Y-o.Height)*this.pdfViewerBase.getZoomFactor()+"px",t.style.transform="rotate("+r+"deg) "+e):270===n?(t.style.left=o.X*this.pdfViewerBase.getZoomFactor()+"px",t.style.top=(o.Y-o.Height)*this.pdfViewerBase.getZoomFactor()+"px",t.style.transform="rotate("+r+"deg) "+e):t.style.transform="rotate(180deg) "+e):3===i&&(360<=(r=n+270)&&(r-=360),0===n?t.style.transform="rotate(270deg) "+e:90===n?(t.style.left=o.X*this.pdfViewerBase.getZoomFactor()+"px",t.style.top=(o.Y-o.Width)*this.pdfViewerBase.getZoomFactor()+"px",t.style.transform="rotate("+r+"deg) "+e):180===n?(t.style.left=(o.X+o.Height)*this.pdfViewerBase.getZoomFactor()+"px",t.style.top=(o.Y-o.Width)*this.pdfViewerBase.getZoomFactor()+"px",t.style.transform="rotate("+r+"deg) "+e):270===n?(t.style.left=(o.X+o.Height)*this.pdfViewerBase.getZoomFactor()+"px",t.style.top=o.Y*this.pdfViewerBase.getZoomFactor()+"px",t.style.transform="rotate("+r+"deg) "+e):t.style.transform="rotate(270deg) "+e):0===i?0<=n&&n<90?t.style.transform=e:(90!==n&&270!==n||(270===n?(t.style.left=o.X*this.pdfViewerBase.getZoomFactor()+"px",t.style.top=(o.Y+o.Width)*this.pdfViewerBase.getZoomFactor()+"px",t.style.height=o.Height*this.pdfViewerBase.getZoomFactor()+"px",t.style.fontSize=o.Height*this.pdfViewerBase.getZoomFactor()+"px"):(t.style.left=(o.X+o.Width)*this.pdfViewerBase.getZoomFactor()+"px",t.style.top=o.Y*this.pdfViewerBase.getZoomFactor()+"px",t.style.height=o.Width*this.pdfViewerBase.getZoomFactor()+"px",t.style.fontSize=o.Width*this.pdfViewerBase.getZoomFactor()+"px",t.style.transformOrigin="0% 0%")),t.style.transform="rotate("+n+"deg) "+e):1===i?t.style.transform=0===n?"rotate(90deg) "+e:-90===n?e:"rotate("+(n+=90)+"deg) "+e:2===i?t.style.transform=0===n?"rotate(180deg) "+e:180===n?e:"rotate("+n+"deg) "+e:3===i&&(t.style.transform=0===n?"rotate(-90deg) "+e:90===n?e:"rotate("+n+"deg) "+e)},IRt.prototype.setTextElementProperties=function(e){e.style.fontFamily="serif",e.style.transformOrigin=this.pdfViewerBase.clientSideRendering?"0% 0%":"0%"},IRt.prototype.resizeTextContentsOnZoom=function(t){var e,i=ARt.sessionStorageManager.getItem(this.pdfViewerBase.getDocumentId()+"_"+t+"_"+this.getPreviousZoomFactor()),n=[],o=[];i&&(n=(i=JSON.parse(i)).textBounds,o=i.textContent,e=i.rotation),0!==n.length?(this.textBoundsArray.push({pageNumber:t,textBounds:n}),this.resizeTextContents(t,o,n,e)):(i=this.textBoundsArray.filter(function(e){return e.pageNumber===t}))&&0!==i.length&&(n=i[0].textBounds,this.resizeTextContents(t,null,n,e))},IRt.prototype.resizeExcessDiv=function(e,t){},IRt.prototype.clearTextLayers=function(e){for(var t,i=0<(i=this.pdfViewerBase.currentPageNumber-3)?i:0,n=(n=this.pdfViewerBase.currentPageNumber+1)<this.pdfViewerBase.pageCount?n:this.pdfViewerBase.pageCount-1,o=document.querySelectorAll('div[id*="'+this.pdfViewer.element.id+'_textLayer_"]'),r=0;r<o.length;r++)o[parseInt(r.toString(),10)].style.display="block",this.pdfViewerBase.getMagnified()&&(this.getTextSelectionStatus()||this.getTextSearchStatus())?1+i<=(t=parseInt(o[parseInt(r.toString(),10)].id.split("_textLayer_")[1],10))&&t<=n-1||this.removeElement(o[parseInt(r.toString(),10)],e):(this.pdfViewerBase.getPinchZoomed(),this.removeElement(o[parseInt(r.toString(),10)],e))},IRt.prototype.removeElement=function(e,t){t?this.removeForeignObjects(e):F.isIE?e.parentElement?e.parentElement.removeChild(e):e.parentNode&&e.parentNode.removeChild(e):e.remove()},IRt.prototype.removeForeignObjects=function(e){var t=e.getElementsByClassName("foreign-object");if(t)for(var i=0;i<t.length;i++){var n,o=t[parseInt(i.toString(),10)],r=o.parentElement;F.isDevice?r.classList.contains("e-pv-text-layer")&&"e-pv-checkbox-outer-div"!==r.className?(e.removeChild(o),i--):"e-pv-checkbox-outer-div"===r.className&&(n=document.getElementById(o.id))&&(n.remove(),i--):"e-pv-text-layer"===r.className&&(e.removeChild(o),i--)}},IRt.prototype.convertToSpan=function(e,t,i,n,o,r,s){var e=this.pdfViewerBase.getElement("_text_"+e+"_"+t),t=o.substring(i,n),i=document.createTextNode(t);r?((t=Q("span")).className=r+" e-pv-text",this.pdfViewerBase.clientSideRendering&&s&&(n===o.length?(t.style.left="0px",t.style.top="0px"):"rtl"===e.style.direction&&(r=e.textContent,e.textContent=o.substring(n,o.length),s=e.getBoundingClientRect(),t.style.left=s.width+"px",t.style.top="0px",e.textContent=r)),t.style.height=e.style.height,t.appendChild(i),e.appendChild(t)):e.appendChild(i)},IRt.prototype.applySpanForSelection=function(e,t,i,n,o,r){if(this.pdfViewer.textSelectionModule)for(var s=e;s<=t;s++){var a=void 0,l=(this.pdfViewerBase.clientSideRendering&&(d=JSON.parse(this.pdfViewerBase.pageTextDetails[this.pdfViewerBase.documentId+"_"+s+"_textDetails"]).pageText,a=this.pdfViewerBase.checkIsRtlText(d)),void 0),h=void 0,d=this.pdfViewerBase.getElement("_textLayer_"+s).childNodes,h=s===e?(l=i,d.length-1):s===t?(l=0,n):(l=0,d.length-1);e===t&&(l=i,h=n);for(var p=l;p<=h;p++){var c,u=this.pdfViewerBase.getElement("_text_"+s+"_"+p),g=void 0,m=void 0,f=void 0;u&&u.textContent&&(f=u.textContent.length,c=u.textContent,u.textContent="",p===l?(m=f,this.convertToSpan(s,p,0,g=s===e?o:0,c,null,a)):m=p===h&&s===t?(g=0,r):(g=0,f),l===h&&e===t&&(g=o,m=r),this.convertToSpan(s,p,g,m,c,"e-pv-maintaincontent",a),p===h)&&s===t&&this.convertToSpan(s,p,m,c.length,c,null,a)}}},IRt.prototype.clearDivSelection=function(){for(var e=document.querySelectorAll('div[id*="'+this.pdfViewer.element.id+'_textLayer_"]'),t=0;t<e.length;t++)for(var i=e[parseInt(t.toString(),10)].childNodes,n=0;n<i.length;n++){var o,r=i[parseInt(n.toString(),10)];"e-pdfviewer-formFields"!==r.className&&"e-pdfviewer-signatureformfields"!==r.className&&"e-pdfviewer-signatureformfields-signature"!==r.className&&(o=r.textContent,1<r.childNodes.length||1===r.childNodes.length&&"SPAN"===r.childNodes[0].tagName)&&(r.textContent="",r.textContent=o)}},IRt.prototype.setStyleToTextDiv=function(e,t,i,n,o,r,s){e.style.left=t*this.pdfViewerBase.getZoomFactor()+"px",e.style.top=i*this.pdfViewerBase.getZoomFactor()+"px",t=90===s||this.pdfViewerBase.clientSideRendering&&270===s?o*this.pdfViewerBase.getZoomFactor():r*this.pdfViewerBase.getZoomFactor(),e.style.height=t+"px",e.style.fontSize=t+"px"},IRt.prototype.getTextSelectionStatus=function(){return!!this.pdfViewer.textSelectionModule&&this.pdfViewer.textSelectionModule.isTextSelection},IRt.prototype.modifyTextCursor=function(e){for(var t=document.querySelectorAll('div[id*="'+this.pdfViewer.element.id+'_textLayer_"]'),i=0;i<t.length;i++)for(var n=t[parseInt(i.toString(),10)].childNodes,o=0;o<n.length;o++){var r=n[parseInt(o.toString(),10)];e&&"e-pdfviewer-formFields"!==r.className&&"e-pdfviewer-signatureformfields"!==r.className&&"e-pdfviewer-signatureformfields-signature"!==r.className?r.classList.add("e-pv-cursor"):r.classList.remove("e-pv-cursor")}},IRt.prototype.isBackWardSelection=function(e){var t=e.anchorNode.compareDocumentPosition(e.focusNode),i=!1;return i=!t&&e.anchorOffset>e.focusOffset||t===Node.DOCUMENT_POSITION_PRECEDING?!0:i},IRt.prototype.getPageIndex=function(e){var t=e.parentElement,e="e-pv-text-layer"===(t=t||e.parentNode).className?parseInt(e.id.split("_text_")[1],10):parseInt(t.id.split("_text_")[1],10);return e},IRt.prototype.getTextIndex=function(e,t){var i=e.parentElement,e="e-pv-text-layer"===(i=i||e.parentNode).className?parseInt(e.id.split("_text_"+t+"_")[1],10):parseInt(i.id.split("_text_"+t+"_")[1],10);return e},IRt.prototype.getPreviousZoomFactor=function(){return this.pdfViewer.magnificationModule?this.pdfViewer.magnificationModule.previousZoomFactor:1},IRt.prototype.getTextSearchStatus=function(){return!!this.pdfViewer.textSearchModule&&this.pdfViewer.textSearchModule.isTextSearch};var xRt=IRt;function IRt(e,t){this.textBoundsArray=[],this.characterBound=[],this.pdfViewer=e,this.pdfViewerBase=t}ERt.prototype.createContextMenu=function(){this.contextMenuElement=Q("ul",{id:this.pdfViewer.element.id+"_context_menu",className:"e-pv-context-menu"}),this.pdfViewer.element.appendChild(this.contextMenuElement),this.contextMenuObj=new D4({target:"#"+this.pdfViewerBase.viewerContainer.id,items:this.copyContextMenu,beforeOpen:this.contextMenuOnBeforeOpen.bind(this),select:this.onMenuItemSelect.bind(this),created:this.contextMenuOnCreated.bind(this)}),this.pdfViewer.enableRtl&&(this.contextMenuObj.enableRtl=!0),this.contextMenuObj.appendTo(this.contextMenuElement),F.isDevice&&!this.pdfViewer.enableDesktopMode?this.contextMenuObj.animationSettings.effect="ZoomIn":this.contextMenuObj.animationSettings.effect="SlideDown"},ERt.prototype.contextMenuOnCreated=function(e){var t=[this.defaultHighlightId,this.defaultUnderlineId,this.defaultStrikethroughId];this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.textMarkupAnnotationModule||this.contextMenuObj.enableItems(t,!1,!0)},ERt.prototype.setTarget=function(e){var t=null;return e.event&&e.event.target&&(t=e.event.target,this.currentTarget=t),t},ERt.prototype.contextMenuOnBeforeOpen=function(e){var t,i,n=this,o=(this.pdfViewerBase.preventContextmenu&&(e.cancel=!0),this.copyContextMenu.length===this.defaultLength?((o=this.customMenuItems).push.apply(o,this.pdfViewer.customContextMenuItems),this.addCustomContextMenuItems()):this.copyContextMenu.length!==this.defaultLength&&this.copyShowCustomContextMenuBottom!==this.pdfViewer.showCustomContextMenuBottom&&(this.customMenuItems.forEach(function(t){var e=n.copyContextMenu.findIndex(function(e){return e.id===t.id});-1!==e&&n.copyContextMenu.splice(e,1)}),this.addCustomContextMenuItems()),this.setTarget(e)),r=0!==this.pdfViewer.selectedItems.annotations.length?this.pdfViewer.selectedItems.annotations[0].annotationSettings:null,o=(this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.freeTextAnnotationModule&&this.pdfViewer.annotationModule.freeTextAnnotationModule.isInuptBoxInFocus&&o&&"free-text-input"===o.className&&"TEXTAREA"===o.tagName&&(this.pdfViewerBase.isFreeTextContextMenu=!0),this.defaultContextMenuItems=[this.pdfViewer.localeObj.getConstant("Cut"),this.pdfViewer.localeObj.getConstant("Copy"),this.pdfViewer.localeObj.getConstant("Highlight context"),this.pdfViewer.localeObj.getConstant("Underline context"),this.pdfViewer.localeObj.getConstant("Strikethrough context"),this.pdfViewer.localeObj.getConstant("Paste"),this.pdfViewer.localeObj.getConstant("Delete Context"),this.pdfViewer.localeObj.getConstant("Scale Ratio"),this.pdfViewer.localeObj.getConstant("Comment"),this.pdfViewer.localeObj.getConstant("Properties")],0<this.customMenuItems.length?this.contextMenuObj.items.slice(this.pdfViewer.showCustomContextMenuBottom?-this.customMenuItems.length:0,(this.pdfViewer.showCustomContextMenuBottom?this.contextMenuObj.items:this.customMenuItems).length).map(function(e){return e.text}):[]);this.contextMenuObj.showItems(this.pdfViewer.showCustomContextMenuBottom?this.defaultContextMenuItems.concat(o):o.concat(this.defaultContextMenuItems)),this.pdfViewerBase.getElement("_context_menu_separator").classList.remove("e-menu-hide"),this.pdfViewerBase.getElement("_context_menu_comment_separator").classList.remove("e-menu-hide"),this.contextMenuObj.enableItems([this.defaultCutId,this.defaultCopyId,this.defaultPasteId,this.defaultDeleteId],!0,!0),je(o)||0===this.customMenuItems.length||(o=[],o=e.items.length<this.defaultLength?e.items.map(function(e){return e.id}):this.customMenuItems.map(function(e){return e.id}),this.filteredCustomItemsIds=o.filter(function(e){return!je(e)}),this.pdfViewer.firecustomContextMenuBeforeOpen(this.filteredCustomItemsIds)),this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.checkContextMenuDeleteItem(this.contextMenuObj),this.pdfViewer.textSelectionModule||this.pdfViewerBase.isShapeBasedAnnotationsEnabled()?(e.event||this.pdfViewerBase.isTouchDesignerMode?(o=this.pdfViewerBase.isClickWithinSelectionBounds(e.event),this.pdfViewerBase.isFreeTextContextMenu?(this.contextMenuObj.hideItems([this.defaultHighlightId,this.defaultUnderlineId,this.defaultStrikethroughId,this.defaultPropertiesId,this.defaultCommentId,this.defaultScaleratioId,this.defaultDeleteId],!0),this.pdfViewerBase.getElement("_context_menu_separator").classList.add("e-menu-hide"),this.pdfViewerBase.getElement("_context_menu_comment_separator").classList.add("e-menu-hide"),this.pdfViewer.annotation.freeTextAnnotationModule&&this.pdfViewer.annotation.freeTextAnnotationModule.isTextSelected?(this.contextMenuObj.enableItems([this.defaultCopyId],!0,!0),this.contextMenuObj.enableItems([this.defaultCutId],!0,!0)):(this.contextMenuObj.enableItems([this.defaultCopyId],!1,!0),this.contextMenuObj.enableItems([this.defaultCutId],!1,!0),window.getSelection().removeAllRanges()),this.pdfViewer.annotation.freeTextAnnotationModule&&""!==this.pdfViewer.annotation.freeTextAnnotationModule.selectedText?this.contextMenuObj.enableItems([this.defaultPasteId],!0,!0):this.contextMenuObj.enableItems([this.defaultPasteId],!1,!0)):o&&this.pdfViewer.textSelectionModule||this.pdfViewer.textSelectionModule&&0<this.pdfViewer.textSelectionModule.selectionRangeArray.length&&"MouseUp"===this.pdfViewer.contextMenuSettings.contextMenuAction?(!e.event.target.classList.contains("e-pv-maintaincontent")&&e.event.target.classList.contains("e-pv-text")||e.event.target.classList.contains("e-pv-text-layer")?this.pdfViewerBase.checkIsNormalText()&&(e.cancel=!0):(F.isIE||"edge"===F.info.name)&&e.event.target.classList.contains("e-pv-page-container")&&(e.cancel=!0),this.contextMenuObj.hideItems([this.defaultCutId,this.defaultPasteId,this.defaultDeleteId,this.defaultScaleratioId,this.defaultCommentId,this.defaultPropertiesId],!0),this.pdfViewerBase.getElement("_context_menu_separator").classList.add("e-menu-hide"),this.pdfViewerBase.getElement("_context_menu_comment_separator").classList.add("e-menu-hide")):0===this.pdfViewer.selectedItems.annotations.length||"HandWrittenSignature"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"SignatureText"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"SignatureImage"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"Path"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?0===this.pdfViewer.selectedItems.annotations.length||"Path"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||r.isLock?0!==this.pdfViewer.selectedItems.annotations.length&&"Path"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&r.isLock?this.hideDefaultContextMenu():0!==this.pdfViewer.selectedItems.formFields.length&&this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType&&this.pdfViewer.designerMode?(this.onOpeningForShape(!0),je(this.pdfViewer.toolbar)||je(this.pdfViewer.toolbar.formDesignerToolbarModule)||this.pdfViewer.toolbar.formDesignerToolbarModule.showHideDeleteIcon(!0)):(t=this.pdfViewerBase.designerModetarget,i=this.pdfViewer.annotationModule,e.event&&e.event.target&&(t=e.event.target),this.pdfViewer.annotation&&this.pdfViewer.annotation.isShapeCopied&&(t.classList.contains("e-pv-text-layer")||t.classList.contains("e-pv-text")||t.classList.contains("e-pv-viewer-container"))&&!this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation||this.pdfViewer.formDesigner&&this.pdfViewer.formDesigner.isShapeCopied&&(t.classList.contains("e-pv-text-layer")||t.classList.contains("e-pv-text"))?this.onOpeningForShape(!1):this.pdfViewerBase.isCalibrateAnnotationModule()&&this.pdfViewer.annotationModule.measureAnnotationModule.currentAnnotationMode&&!r?(this.contextMenuObj.hideItems([this.defaultHighlightId,this.defaultUnderlineId,this.defaultStrikethroughId,this.defaultPropertiesId],!0),this.pdfViewerBase.getElement("_context_menu_separator").classList.add("e-menu-hide"),this.pdfViewerBase.getElement("_context_menu_comment_separator").classList.remove("e-menu-hide"),this.contextMenuObj.enableItems([this.defaultCutId,this.defaultCopyId,this.defaultPasteId,this.defaultDeleteId,this.defaultCommentId],!1,!0)):i&&i.textMarkupAnnotationModule&&i.textMarkupAnnotationModule.currentTextMarkupAnnotation&&!i.textMarkupAnnotationModule.currentTextMarkupAnnotation.annotationSettings.isLock?(this.contextMenuObj.hideItems([this.defaultHighlightId,this.defaultUnderlineId,this.defaultStrikethroughId,this.defaultPropertiesId,this.defaultCutId,this.defaultCopyId,this.defaultPasteId,this.defaultScaleratioId],!0),this.pdfViewerBase.getElement("_context_menu_separator").classList.add("e-menu-hide"),this.pdfViewerBase.getElement("_context_menu_comment_separator").classList.remove("e-menu-hide"),this.contextMenuObj.showItems([this.defaultDeleteId,this.defaultCommentId],!0)):e.items&&0<e.items.length&&this.pdfViewer.textSelectionModule&&this.pdfViewer.textSelectionModule.isTextSelection&&o?(this.contextMenuObj.hideItems([this.defaultCutId,this.defaultPasteId,this.defaultDeleteId,this.defaultScaleratioId,this.defaultCommentId,this.defaultPropertiesId],!0),this.pdfViewerBase.getElement("_context_menu_separator").classList.add("e-menu-hide"),this.pdfViewerBase.getElement("_context_menu_comment_separator").classList.add("e-menu-hide")):e.cancel=!0):this.onOpeningForShape(!0):this.onOpeningForShape(!1,!0)):this.pdfViewer.textSelectionModule&&"MouseUp"===this.pdfViewer.contextMenuOption?(this.contextMenuObj.hideItems([this.defaultCutId,this.defaultPasteId,this.defaultDeleteId,this.defaultScaleratioId,this.defaultCommentId,this.defaultPropertiesId],!0),this.pdfViewerBase.getElement("_context_menu_separator").classList.add("e-menu-hide"),this.pdfViewerBase.getElement("_context_menu_comment_separator").classList.add("e-menu-hide")):this.hideContextItems(),this.enableCommentPanelItem()):e.cancel=!0,"None"===this.pdfViewer.contextMenuOption?e.cancel=!0:this.contextMenuItems(e),this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.restrictContextMenu()&&(e.cancel=!0),!0===this.pdfViewer.disableDefaultContextMenu&&this.hideDefaultContextMenu(),this.pdfViewerBase.isTouchDesignerMode=!1},ERt.prototype.contextMenuItems=function(e){if(this.pdfViewer.contextMenuSettings.contextMenuItems.length){for(var t=[],i=(this.contextMenuCollection(),this.contextMenuObj.getRootElement()),n=0;n<this.pdfViewer.contextMenuSettings.contextMenuItems.length;n++)for(var o=0;o<this.contextMenuList.length;o++){var r=this.contextMenuList[parseInt(o.toString(),10)].text;switch(r){case"Highlight":r="Highlight context";break;case"Underline":r="Underline context";break;case"Strikethrough":r="Strikethrough context";break;case"Delete":r="Delete Context";break;case"Scale Ratio":r="Scale Ratio";break;case"Comment":this.pdfViewerBase.getElement("_context_menu_comment_separator").classList.add("e-menu-hide");break;case"Properties":this.pdfViewerBase.getElement("_context_menu_separator").classList.add("e-menu-hide")}var s=this.contextMenuList[parseInt(o.toString(),10)].text;if(0===n&&s!==xCt[this.pdfViewer.contextMenuSettings.contextMenuItems[parseInt(n.toString(),10)]]&&t.push(s),0<n&&s===xCt[this.pdfViewer.contextMenuSettings.contextMenuItems[parseInt(n.toString(),10)]])for(var a=0;a<t.length;a++)if(t[parseInt(a.toString(),10)]===s)if(this.pdfViewer.disableContextMenuItems&&0<this.pdfViewer.disableContextMenuItems.length){for(var l=!1,h=0;h<this.pdfViewer.disableContextMenuItems.length;h++)t[parseInt(a.toString(),10)]===xCt[this.pdfViewer.disableContextMenuItems[parseInt(h.toString(),10)]]&&(l=!0);l||t.splice(a,1)}else t.splice(a,1)}var d=this.processLocaleContent(t);this.contextMenuObj.hideItems(d),0===this.getEnabledItemCount(i)&&(e.cancel=!0)}},ERt.prototype.processLocaleContent=function(e){var t=[];if(0<e.length)for(var i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)];switch(n){case"Highlight":n="Highlight context";break;case"Underline":n="Underline context";break;case"Strikethrough":n="Strikethrough context";break;case"Delete":n="Delete Context";break;case"ScaleRatio":n="Scale Ratio"}t.push(this.pdfViewer.localeObj.getConstant(n))}return t},ERt.prototype.contextMenuCollection=function(){return this.contextMenuList=[{text:"Cut"},{text:"Copy"},{text:"Highlight"},{text:"Underline"},{text:"Strikethrough"},{text:"Paste"},{text:"Delete"},{text:"ScaleRatio"},{text:"Comment"},{text:"Properties"}]},ERt.prototype.getEnabledItemCount=function(e){for(var t=this.copyContextMenu.length,i=e.children,n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)];(o.classList.contains("e-menu-hide")||o.classList.contains("e-disabled"))&&(t-=1)}return t},ERt.prototype.hideContextItems=function(){0===this.pdfViewer.selectedItems.annotations.length&&(this.contextMenuObj.hideItems([this.defaultCutId,this.defaultPasteId,this.defaultDeleteId,this.defaultScaleratioId,this.defaultPropertiesId],!0),this.pdfViewerBase.getElement("_context_menu_separator").classList.add("e-menu-hide"))},ERt.prototype.enableCommentPanelItem=function(){this.pdfViewer.enableCommentPanel?this.contextMenuObj.enableItems([this.defaultCommentId],!0,!0):this.contextMenuObj.enableItems([this.defaultCommentId],!1,!0),0!==this.pdfViewer.selectedItems.formFields.length&&this.contextMenuObj.enableItems([this.defaultCommentId],!1,!0)},ERt.prototype.onOpeningForShape=function(e,t){this.pdfViewer.annotation&&this.pdfViewer.annotation.isShapeCopied||this.pdfViewer.formDesigner&&this.pdfViewer.formDesigner.isShapeCopied?this.contextMenuObj.enableItems([this.defaultPasteId],!0,!0):this.contextMenuObj.enableItems([this.defaultPasteId],!1,!0),this.contextMenuObj.hideItems([this.defaultHighlightId,this.defaultUnderlineId,this.defaultStrikethroughId,this.defaultScaleratioId],!0),e?0===this.pdfViewer.selectedItems.annotations.length||"Line"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"LineWidthArrowHead"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&"Distance"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?0!==this.pdfViewer.selectedItems.formFields.length&&this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType?(this.contextMenuObj.hideItems([this.defaultCommentId],!0),this.pdfViewerBase.getElement("_context_menu_separator").classList.add("e-menu-hide"),this.contextMenuObj.showItems([this.defaultPropertiesId],!0)):(je(t)&&"Image"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&!this.pdfViewer.selectedItems.annotations[0].id.startsWith("stamp")?(this.contextMenuObj.hideItems([this.defaultPropertiesId,this.defaultCommentId,this.defaultCutId,this.defaultCopyId,this.defaultPasteId],!0),this.pdfViewerBase.getElement("_context_menu_separator").classList.add("e-menu-hide"),this.pdfViewerBase.getElement("_context_menu_comment_separator")):(this.contextMenuObj.hideItems([this.defaultPropertiesId],!0),this.pdfViewerBase.getElement("_context_menu_separator"))).classList.add("e-menu-hide"):this.contextMenuObj.showItems([this.defaultPropertiesId],!0):(t?"SignatureField"===this.pdfViewer.selectedItems.annotations[0].annotName||"InitialField"===this.pdfViewer.selectedItems.annotations[0].annotName||"SignatureText"===this.pdfViewer.selectedItems.annotations[0].annotName?this.contextMenuObj.hideItems([this.defaultPropertiesId,this.defaultCommentId,this.defaultCutId,this.defaultCopyId,this.defaultPasteId],!0):this.contextMenuObj.hideItems([this.defaultPropertiesId,this.defaultCommentId],!0):this.contextMenuObj.hideItems([this.defaultCutId,this.defaultCopyId,this.defaultDeleteId,this.defaultPropertiesId,this.defaultCommentId],!0),this.pdfViewerBase.getElement("_context_menu_separator").classList.add("e-menu-hide"),this.pdfViewerBase.getElement("_context_menu_comment_separator").classList.add("e-menu-hide"))},ERt.prototype.OnItemSelected=function(e){this.pdfViewerBase.OnItemSelected(e)},ERt.prototype.onMenuItemSelect=function(t){var e=this.filteredCustomItemsIds.find(function(e){return e===t.item.id}),e=je(e)?void 0:e.toString();e?this.pdfViewer.firecustomContextMenuSelect(e):this.pdfViewerBase.OnItemSelected(t.item.text)},ERt.prototype.destroy=function(){this.contextMenuObj&&(this.previousAction="",this.contextMenuObj.destroy())},ERt.prototype.close=function(){this.contextMenuObj.close()},ERt.prototype.open=function(e,t,i){this.contextMenuObj.open(e,t,i)},ERt.prototype.addCustomContextMenuItems=function(){var t=new Set,e=(this.customMenuItems=this.customMenuItems.reverse().filter(function(e){return!t.has(e.id)&&t.add(e.id)}).reverse(),this.customMenuItems.length);if(0<e){if(!0===this.pdfViewer.showCustomContextMenuBottom)for(var i=0;i<e;i++)this.copyContextMenu.push(this.customMenuItems[parseInt(i.toString(),10)]);else for(i=e-1;0<=i;i--)this.copyContextMenu.unshift(this.customMenuItems[parseInt(i.toString(),10)]);this.contextMenuObj.items=this.copyContextMenu,this.contextMenuObj.dataBind()}this.copyShowCustomContextMenuBottom=this.pdfViewer.showCustomContextMenuBottom},ERt.prototype.hideDefaultContextMenu=function(){this.contextMenuObj.hideItems(this.defaultContextMenuItems),this.pdfViewerBase.getElement("_context_menu_separator").classList.add("e-menu-hide"),this.pdfViewerBase.getElement("_context_menu_comment_separator").classList.add("e-menu-hide")};var TRt=ERt;function ERt(e,t){this.copyContextMenu=[],this.contextMenuList=[],this.customMenuItems=[],this.filteredCustomItemsIds=[],this.defaultContextMenuItems=[],this.pdfViewer=e,this.pdfViewerBase=t,this.defaultCutId=this.pdfViewer.element.id+"_contextmenu_cut",this.defaultCopyId=this.pdfViewer.element.id+"_contextmenu_copy",this.defaultPasteId=this.pdfViewer.element.id+"_contextmenu_paste",this.defaultDeleteId=this.pdfViewer.element.id+"_contextmenu_delete",this.defaultCommentId=this.pdfViewer.element.id+"_contextmenu_comment",this.defaultUnderlineId=this.pdfViewer.element.id+"_contextmenu_underline",this.defaultHighlightId=this.pdfViewer.element.id+"_contextmenu_highlight",this.defaultStrikethroughId=this.pdfViewer.element.id+"_contextmenu_strikethrough",this.defaultScaleratioId=this.pdfViewer.element.id+"_contextmenu_scaleratio",this.defaultPropertiesId=this.pdfViewer.element.id+"_contextmenu_properties",this.copyContextMenu=[{text:this.pdfViewer.localeObj.getConstant("Cut"),iconCss:"e-pv-cut-icon",id:this.defaultCutId},{text:this.pdfViewer.localeObj.getConstant("Copy"),iconCss:"e-pv-copy-icon",id:this.defaultCopyId},{text:this.pdfViewer.localeObj.getConstant("Highlight context"),iconCss:"e-pv-highlight-icon",id:this.defaultHighlightId},{text:this.pdfViewer.localeObj.getConstant("Underline context"),iconCss:"e-pv-underline-icon",id:this.defaultUnderlineId},{text:this.pdfViewer.localeObj.getConstant("Strikethrough context"),iconCss:"e-pv-strikethrough-icon",id:this.defaultStrikethroughId},{text:this.pdfViewer.localeObj.getConstant("Paste"),iconCss:"e-pv-paste-icon",id:this.defaultPasteId},{text:this.pdfViewer.localeObj.getConstant("Delete Context"),iconCss:"e-pv-delete-icon",id:this.defaultDeleteId},{text:this.pdfViewer.localeObj.getConstant("Scale Ratio"),iconCss:"e-pv-scale-ratio-icon",id:this.defaultScaleratioId},{separator:!0,id:this.pdfViewer.element.id+"_context_menu_comment_separator"},{text:this.pdfViewer.localeObj.getConstant("Comment"),iconCss:"e-pv-comment-icon",id:this.defaultCommentId},{separator:!0,id:this.pdfViewer.element.id+"_context_menu_separator"},{text:this.pdfViewer.localeObj.getConstant("Properties"),iconCss:"e-pv-property-icon",id:this.defaultPropertiesId}],this.defaultLength=this.copyContextMenu.length}MRt.prototype.send=function(i){var n=this;this.httpRequest=new XMLHttpRequest,this.httpRequest.timeout=this.retryTimeout,this.mode?this.sendRequest(i):setTimeout(function(){n.sendRequest(i)}),this.httpRequest.onreadystatechange=function(){var e=!1,t=n.pdfViewer.viewerBase;t&&t.isPasswordAvailable&&""===t.passwordData&&(e=!0,n.retryCount=0),(e=0<n.retryCount?n.resendRequest(n,i,!1):e)||n.stateChange(n)},this.httpRequest.ontimeout=function(){var e=!1,t=n.pdfViewer.viewerBase;t&&t.isPasswordAvailable&&""===t.passwordData&&(e=!0,n.retryCount=0),(e=0<n.retryCount?n.resendRequest(n,i,!0):e)||n.stateChange(n)},this.httpRequest.onerror=function(){n.error(n)}},MRt.prototype.clear=function(){this.httpRequest&&this.httpRequest.abort(),this.onSuccess=null,this.onFailure=null,this.onError=null},MRt.prototype.resendRequest=function(e,t,i){var n=!1,o=e.httpRequest.status,r=-1!==this.retryStatusCodes.indexOf(o);if(4===e.httpRequest.readyState&&200===o){var s=void 0,s=null!==this.responseType?e.httpRequest.response:e.httpRequest.responseText;if(s&&"object"!=typeof s)try{s=JSON.parse(s)}catch(e){"Document stream does not exist in the cache"!==s&&"Document Reference pointer does not exist in the cache"!==s||(n=!0)}}return(r||n||i)&&(n=!0,this.retryCount--,e.pdfViewer.fireAjaxRequestFailed(o,e.httpRequest.statusText,t.action,!0),e.send(t)),n},MRt.prototype.sendRequest=function(e){this.httpRequest.open(this.type,this.url,this.mode),this.httpRequest.withCredentials=this.pdfViewer.ajaxRequestSettings.withCredentials,this.httpRequest.setRequestHeader("Content-Type",this.contentType),e=this.addExtraData(e),this.setCustomAjaxHeaders(),null!==this.responseType&&(this.httpRequest.responseType=this.responseType),this.httpRequest.send(JSON.stringify(e))},MRt.prototype.addExtraData=function(e){return this.pdfViewer.viewerBase.ajaxData="",this.pdfViewer.fireAjaxRequestInitiate(e),e=this.pdfViewer.viewerBase.ajaxData&&""!==this.pdfViewer.viewerBase.ajaxData?this.pdfViewer.viewerBase.ajaxData:e},MRt.prototype.stateChange=function(e){var t,i=e.httpRequest.status,n=i.toString().split("")[0];4===e.httpRequest.readyState&&200===i?(t={name:"onSuccess",data:null!==this.responseType?e.httpRequest.response:e.httpRequest.responseText,readyState:e.httpRequest.readyState,status:e.httpRequest.status},e.successHandler(t)):4!==e.httpRequest.readyState||"4"!==n&&"5"!==n||(t={name:"onFailure",status:e.httpRequest.status,statusText:e.httpRequest.statusText},e.failureHandler(t))},MRt.prototype.error=function(e){var t={name:"onError",status:this.httpRequest.status,statusText:this.httpRequest.statusText};e.errorHandler(t)},MRt.prototype.successHandler=function(e){return this.onSuccess&&this.onSuccess(e),e},MRt.prototype.failureHandler=function(e){return this.onFailure&&this.onFailure(e),e},MRt.prototype.errorHandler=function(e){return this.onError&&this.onError(e),e},MRt.prototype.setCustomAjaxHeaders=function(){if(!je(this.pdfViewer.ajaxRequestSettings)&&!je(this.pdfViewer.ajaxRequestSettings.ajaxHeaders))for(var e=0;e<this.pdfViewer.ajaxRequestSettings.ajaxHeaders.length;e++)this.httpRequest.setRequestHeader(this.pdfViewer.ajaxRequestSettings.ajaxHeaders[parseInt(e.toString(),10)].headerName,this.pdfViewer.ajaxRequestSettings.ajaxHeaders[parseInt(e.toString(),10)].headerValue)};var DRt=MRt;function MRt(e){this.type="POST",this.mode=!0,this.contentType="application/json;charset=UTF-8",this.retryTimeout=0,this.pdfViewer=e,this.retryCount=e.retryCount,this.retryStatusCodes=e.retryStatusCodes,this.retryTimeout=1e3*e.retryTimeout}PRt.prototype.createSignaturePanel=function(){var e,t,i,n=this;this.imageSignatureDataUrl="",this.drawSignatureDataUrl="",N?((i=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_"))&&(this.pdfViewerBase.pageContainer.querySelector(".e-pv-signature-window")||((t=Q("div",{id:this.pdfViewer.element.id+"_signature_window",className:"e-pv-signature-window"})).style.display="block",this.pdfViewerBase.pageContainer.appendChild(t)),i.addEventListener("mousedown",this.signaturePanelMouseDown.bind(this)),i.addEventListener("mousemove",this.signaturePanelMouseMove.bind(this)),i.addEventListener("mouseup",this.signaturePanelMouseUp.bind(this)),i.addEventListener("mouseleave",this.signaturePanelMouseUp.bind(this)),i.addEventListener("touchstart",this.signaturePanelMouseDown.bind(this)),i.addEventListener("touchmove",this.signaturePanelMouseMove.bind(this)),i.addEventListener("touchend",this.signaturePanelMouseUp.bind(this)),this.clearSignatureCanvas()),this.pdfViewer._dotnetInstance.invokeMethodAsync("OpenSignaturePanel",this.pdfViewerBase.isToolbarSignClicked)):((t=Q("div",{id:this.pdfViewer.element.id+"_signature_window",className:"e-pv-signature-window"})).style.display="block",this.pdfViewerBase.pageContainer.appendChild(t),i=this.createSignatureCanvas(),e=void 0,e=this.pdfViewerBase.isToolbarSignClicked?this.pdfViewerBase.isInitialField?this.pdfViewer.localeObj.getConstant("InitialFieldDialogHeaderText"):this.pdfViewer.localeObj.getConstant("SignatureFieldDialogHeaderText"):this.pdfViewerBase.isInitialField?this.pdfViewer.localeObj.getConstant("HandwrittenInitialDialogHeaderText"):this.pdfViewer.localeObj.getConstant("HandwrittenSignatureDialogHeaderText"),this.signatureDialog?this.signatureDialog.content=i:(this.signatureDialog=new pS({showCloseIcon:!0,closeOnEscape:!1,isModal:!0,header:e,cssClass:"e-pv-signature-dialog-height",target:this.pdfViewerBase.mainContainer,content:i,width:"750px",visible:!0,allowDragging:!0,beforeClose:function(){n.clearSignatureCanvas(),n.signatureDialog.destroy(),n.signatureDialog=null,n.tabObj&&n.tabObj.destroy();var e=document.getElementById(n.pdfViewer.element.id+"_signature_window");e&&(e.parentNode||e.parentElement).removeChild(e),n.pdfViewerBase.isToolbarSignClicked||n.pdfViewerBase.drawSignatureWithTool||!n.pdfViewer.formFieldsModule||je(n.pdfViewer.formFieldsModule.currentTarget)||n.pdfViewer.fireFocusOutFormField(n.pdfViewer.formFieldsModule.currentTarget.name,""),n.pdfViewerBase.isToolbarSignClicked=!1,n.setFocus()}}),this.signatureDialog.buttons=[{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Clear"),disabled:!0,cssClass:"e-pv-clearbtn"},click:this.clearSignatureCanvas.bind(this)},{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Cancel"),cssClass:"e-pv-cancelbtn"},click:this.closeSignaturePanel.bind(this)},{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Create"),isPrimary:!0,disabled:!0,cssClass:"e-pv-createbtn"},click:this.addSignatureInPage.bind(this)}],this.signatureDialog.appendTo(t)),this.pdfViewer.element.offsetWidth<750&&this.updateCanvasSize(),this.pdfViewer.enableRtl&&(this.signatureDialog.enableRtl=this.pdfViewer.enableRtl),"DRAW"===(e=this.signatureDialog.content.ej2_instances[0].items[0]).header.label?(i=document.getElementById("checkbox"),this.hideSignatureCheckbox(i)):"TYPE"===e.header.label?(t=document.getElementById("checkbox1"),this.hideSignatureCheckbox(t)):(i=document.getElementById("checkbox2"),this.hideSignatureCheckbox(i)),this.setSignatureCanvasWidth()),this.drawSavedSignature()},PRt.prototype.setSignatureCanvasWidth=function(){var e,t=document.getElementById(this.pdfViewer.element.id+"Signature_appearance");t&&(t=t.clientWidth,(e=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_"))&&(e.width=t,e.style.width=t+"px"),(e=document.getElementById(this.pdfViewer.element.id+"_signatureuploadCanvas_"))&&(e.width=t,e.style.width=t+"px"),e=document.getElementById(this.pdfViewer.element.id+"_font_appearance"))&&(e.width=t,e.style.width=t+"px")},PRt.prototype.drawSavedSignature=function(){var e,t,i;this.pdfViewerBase.isToolbarSignClicked||!this.isSaveSignature&&!this.isSaveInitial||(!this.pdfViewerBase.isInitialField&&this.isSaveSignature?this.outputString=this.saveSignatureString:this.pdfViewerBase.isInitialField&&this.isSaveInitial&&(this.outputString=this.saveInitialString),e=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_").getContext("2d"),(t=new Image).onload=function(){e.drawImage(t,0,0)},!this.pdfViewerBase.isInitialField&&this.isSaveSignature?t.src=this.signatureDrawString:this.pdfViewerBase.isInitialField&&this.isSaveInitial&&(t.src=this.initialDrawString),(i=document.getElementById(this.pdfViewer.element.id+"_signatureCheckBox"))&&(i.checked=!0),this.enableCreateButton(!1),this.enableClearbutton(!1))},PRt.prototype.drawSavedTypeSignature=function(){var e="";return e=this.pdfViewerBase.isToolbarSignClicked||!this.issaveTypeSignature&&!this.issaveTypeInitial?e:!this.pdfViewerBase.isInitialField&&this.issaveTypeSignature?this.saveSignatureTypeString:this.saveInitialTypeString},PRt.prototype.drawSavedImageSignature=function(){var e="";return e=this.pdfViewerBase.isToolbarSignClicked||!this.issaveImageSignature&&!this.issaveImageInitial?e:!this.pdfViewerBase.isInitialField&&this.issaveImageSignature?this.saveSignatureUploadString:this.saveInitialUploadString},PRt.prototype.hideSignatureCheckbox=function(e){this.pdfViewerBase.isToolbarSignClicked?this.pdfViewerBase.isInitialField?this.pdfViewer.handWrittenSignatureSettings.initialDialogSettings&&this.pdfViewer.handWrittenSignatureSettings.initialDialogSettings.hideSaveSignature&&this.hideCheckboxParent(e):this.pdfViewer.handWrittenSignatureSettings.signatureDialogSettings&&this.pdfViewer.handWrittenSignatureSettings.signatureDialogSettings.hideSaveSignature&&this.hideCheckboxParent(e):this.pdfViewerBase.isInitialField?this.pdfViewer.initialFieldSettings.initialDialogSettings&&this.pdfViewer.initialFieldSettings.initialDialogSettings.hideSaveSignature&&this.hideCheckboxParent(e):this.pdfViewer.signatureFieldSettings.signatureDialogSettings&&this.pdfViewer.signatureFieldSettings.signatureDialogSettings.hideSaveSignature&&this.hideCheckboxParent(e)},PRt.prototype.saveSignatureCheckbox=function(){return!this.pdfViewerBase.isToolbarSignClicked&&(this.pdfViewerBase.isInitialField?(!this.pdfViewer.initialFieldSettings.initialDialogSettings||!this.pdfViewer.initialFieldSettings.initialDialogSettings.hideSaveSignature)&&this.isInitialFiledSaveSignature:(!this.pdfViewer.signatureFieldSettings.signatureDialogSettings||!this.pdfViewer.signatureFieldSettings.signatureDialogSettings.hideSaveSignature)&&this.isSignatureFieldsSaveSignature)},PRt.prototype.hideCheckboxParent=function(e){e&&(e.parentElement.style.display="none")},PRt.prototype.saveSignatureImage=function(){var e=document.getElementById(this.pdfViewer.element.id+"_signatureCheckBox");e&&e.checked?""!==this.outputString&&(this.pdfViewerBase.isInitialField?(this.isSaveInitial=!0,this.saveInitialString=this.outputString):(this.isSaveSignature=!0,this.saveSignatureString=this.outputString),e=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_"),this.saveImageString=e.toDataURL(),this.pdfViewerBase.isInitialField?this.initialImageString=this.saveImageString:this.signatureImageString=this.saveImageString):(this.isSaveSignature&&!this.pdfViewerBase.isInitialField?(this.isSaveSignature=!1,this.saveSignatureString="",this.saveImageString="",this.signatureImageString=""):this.isSaveInitial&&this.pdfViewerBase.isInitialField&&(this.isSaveInitial=!1,this.saveInitialString="",this.saveImageString="",this.initialImageString=""),this.clearSignatureCanvas())},PRt.prototype.addSignature=function(e){var t,i,n,o,r,s,a;this.pdfViewerBase.isToolbarSignClicked?(t=this.pdfViewer.annotation.createGUID(),this.pdfViewerBase.currentSignatureAnnot=null,this.pdfViewerBase.isSignatureAdded=!0,o=this.pdfViewerBase.currentPageNumber-1,i=this.pdfViewer.handWrittenSignatureSettings.thickness||1,r=this.pdfViewer.handWrittenSignatureSettings.opacity||1,s=this.pdfViewer.handWrittenSignatureSettings.strokeColor||"#000000",n=this.updateSignatureAspectRatio(this.outputString,!0),a=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_"),this.saveImageString=a.toDataURL(),this.pdfViewerBase.isInitialField?this.initialImageString=this.saveImageString:this.signatureImageString=this.saveImageString,n={id:"sign"+this.pdfViewerBase.signatureCount,bounds:n,pageIndex:o,data:this.outputString,fontFamily:"Helvetica",fontSize:16,shapeAnnotationType:"HandWrittenSignature",opacity:r,strokeColor:s,thickness:i,signatureName:t},o=void(this.pdfViewerBase.currentSignatureAnnot=n),(o=N?document.getElementById(this.pdfViewer.element.id+"_signatureCheckBox"):document.getElementById("checkbox"))&&o.checked&&this.addSignatureCollection(),this.hideSignaturePanel(),this.pdfViewerBase.isToolbarSignClicked=!1):(o=document.getElementById("checkbox"),r=document.getElementById("checkbox1"),s=document.getElementById("checkbox2"),a=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_"),this.saveImageString=a.toDataURL(),o&&(o.checked?(this.pdfViewerBase.isInitialField?(this.isSaveInitial=!0,this.initialDrawString=this.saveImageString,this.saveInitialString=this.outputString):(this.isSaveSignature=!0,this.signatureDrawString=this.saveImageString,this.saveSignatureString=this.outputString),this.checkSaveFiledSign(this.pdfViewerBase.isInitialField,!0)):(this.pdfViewerBase.isInitialField?(this.isSaveInitial=!1,this.saveInitialString=""):(this.isSaveSignature=!1,this.saveSignatureString=""),this.checkSaveFiledSign(this.pdfViewerBase.isInitialField,!1))),this.saveTypeSignature(r),this.saveUploadSignature(s),this.pdfViewerBase.isInitialField?this.initialImageString=this.saveImageString:this.signatureImageString=this.saveImageString,this.pdfViewer.formFieldsModule&&this.pdfViewer.formFieldsModule.drawSignature(null,null,this.pdfViewerBase.currentTarget,null))},PRt.prototype.updateSignatureAspectRatio=function(e,t,i,n){for(var o=cbt(rbt(e)),r=-1,s=-1,a=-1,l=-1,e=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_"),h=0;h<o.length;h++){var d,p=o[parseInt(h.toString(),10)];-1===r?(r=parseFloat(p.x.toString()),a=parseFloat(p.x.toString()),s=parseFloat(p.y.toString()),l=parseFloat(p.y.toString())):((d=parseFloat(p.x.toString()))<=r&&(r=d),(p=parseFloat(p.y.toString()))<=s&&(s=p),a<=d&&(a=d),l<=p&&(l=p))}var c=e?e.clientWidth:650,e=e?e.clientHeight:300,c=this.calculateSignatureBounds(c,e,a-r,l-s,t,i,n);return t?(e=this.pdfViewerBase.getZoomFactor(),i=this.pdfViewerBase.currentPageNumber-1,n=document.getElementById(this.pdfViewer.element.id+"_pageDiv_"+i),{x:(parseFloat(n.style.width)/2-c.currentWidth/2)/e,y:(parseFloat(n.style.height)/2-c.currentHeight/2)/e,width:c.currentWidth,height:c.currentHeight}):{left:c.currentLeftDiff,top:c.currentTopDiff,width:c.currentWidth,height:c.currentHeight}},PRt.prototype.calculateSignatureBounds=function(e,t,i,n,o,r,s){var a,l,h,d=i/e,p=n/t,c=this.pdfViewerBase.getZoomFactor(),u=0,g=0,m=!1,f=!1,y=0,v=0,b=(o?(u=this.pdfViewer.handWrittenSignatureSettings.width||150,g=this.pdfViewer.handWrittenSignatureSettings.height||100):(o=r?"100%"===r.style.width?r.clientWidth:parseFloat(r.style.width):this.ConvertPointToPixel(s.LineBounds.Width),b=(a=r?"100%"===r.style.height?r.clientHeight:parseFloat(r.style.height):this.ConvertPointToPixel(s.LineBounds.Height))/o,w=t/e,r=r?r.offsetParent.offsetParent.style.transform||r.style.transform:s.RotationAngle,(s=e/t)<(l=o/a)||s<b||Math.abs(l-b)<=1?(h=0,h=s<b||Math.abs(l-b)<=1?(f=!0,b/w):(m=!0,l/s),"rotate(90deg)"===r||"rotate(270deg)"===r?(u=a/c,g=o/c):(m&&(y=o/c,u=o/h/c,g=a/c),f&&(v=a/c,u=o/c,g=a/h/c))):g="rotate(90deg)"===r||"rotate(270deg)"===r?(u=a/c,o/c):(u=o/c,a/c)),(e-i)/2),w=(t-n)/2;return m?(b=b/e*y,b+=(y*d-u*d)/2,w=w/t*g):f?(b=b/e*u,w=w/t*v,w+=(v*p-g*p)/2):(b=b/e*u,w=w/t*g),"Stretch"!==this.pdfViewer.signatureFitMode&&(u*=d,g*=p),{currentLeftDiff:b,currentTopDiff:w,currentWidth:u,currentHeight:g}},PRt.prototype.setFocus=function(e){e?(this.removeFocus(),document.getElementById(e).classList.add("e-pv-signature-focus")):this.currentTarget&&document.getElementById(this.currentTarget.id).focus()},PRt.prototype.removeFocus=function(){if(this.signatureFieldCollection){0===this.signatureFieldCollection.length&&this.getSignField();for(var e=0;e<this.signatureFieldCollection.length;e++){var t=(this.pdfViewer.formDesignerModule?this.signatureFieldCollection[parseInt(e.toString(),10)].FormField:this.signatureFieldCollection[parseInt(e.toString(),10)]).uniqueID,t=document.getElementById(t);t&&t.classList.remove("e-pv-signature-focus")}this.pdfViewer.formFieldsModule.currentTarget&&this.pdfViewer.formFieldsModule.currentTarget.classList.remove("e-pv-signature-focus")}},PRt.prototype.getSignField=function(){return this.pdfViewer.formDesignerModule?this.signatureFieldCollection=this.pdfViewer.formDesignerModule.getFormDesignerSignField(this.signatureFieldCollection):this.signatureFieldCollection=this.getFormFieldSignField(),this.signatureFieldCollection},PRt.prototype.getFormFieldSignField=function(){var e,t=this.pdfViewerBase.getItemFromSessionStorage("_formfields");if(t)for(var i=JSON.parse(t),n=0;n<i.length;n++)"SignatureField"!==(e=i[parseInt(n.toString(),10)]).Name&&"InitialField"!==e.Name||(e.uniqueID=this.pdfViewer.element.id+"input_"+e.PageIndex+"_"+n,this.signatureFieldCollection.push(i[parseInt(n.toString(),10)]));return this.signatureFieldCollection},PRt.prototype.checkSaveFiledSign=function(e,t){e?this.isInitialFiledSaveSignature=t:this.isSignatureFieldsSaveSignature=t},PRt.prototype.addSignatureInPage=function(){"Draw"===this.signaturetype?this.addSignature():"Type"===this.signaturetype?this.typeAddSignature():this.imageAddSignature(),this.drawOutputString="",this.imageOutputString=""},PRt.prototype.typeAddSignature=function(e){var t,i,n,o,r,s,a,l,h,d,p,c;this.pdfViewerBase.isToolbarSignClicked?(l=this.pdfViewerBase.getZoomFactor(),t=null,i=this.pdfViewer.annotation.createGUID(),this.pdfViewerBase.currentSignatureAnnot=null,this.pdfViewerBase.isSignatureAdded=!0,n=this.pdfViewerBase.currentPageNumber-1,p=document.getElementById(this.pdfViewer.element.id+"_pageDiv_"+n),o=this.pdfViewer.handWrittenSignatureSettings.thickness||1,r=this.pdfViewer.handWrittenSignatureSettings.opacity||1,s=this.pdfViewer.handWrittenSignatureSettings.strokeColor||"#000000",d=h=0,a=65,c=200,je(this.pdfViewer.handWrittenSignatureSettings.height)||"Stretch"!==this.pdfViewer.signatureFitMode||(a=this.pdfViewer.handWrittenSignatureSettings.height),je(this.pdfViewer.handWrittenSignatureSettings.width)||"Stretch"!==this.pdfViewer.signatureFitMode||(c=this.pdfViewer.handWrittenSignatureSettings.width),h=(parseFloat(p.style.width)/2-c/2)/l,d=(parseFloat(p.style.height)/2-a/2)/l,p=this.pdfViewerBase.getZoomFactor(),this.signtypevalue||this.updateSignatureTypeValue(!0),l=this.signtypevalue,this.pdfViewer.enableHtmlSanitizer&&this.outputString&&(this.outputString=go.sanitize(this.outputString)),t={id:"Typesign"+this.pdfViewerBase.signatureCount,bounds:{left:h/p,top:d/p,x:h/p,y:d/p,width:c,height:a},pageIndex:n,dynamicText:l,data:this.pdfViewerBase.signatureModule.outputString,shapeAnnotationType:"SignatureText",opacity:r,strokeColor:s,thickness:o,fontSize:16,fontFamily:this.fontName,signatureName:i},h=void(this.pdfViewerBase.currentSignatureAnnot=t),(h=N?document.getElementById(this.pdfViewer.element.id+"_signatureCheckBox"):document.getElementById("checkbox1"))&&h.checked&&this.addSignatureCollection(),this.signtypevalue="",this.hideSignaturePanel(),this.pdfViewerBase.isToolbarSignClicked=!1):(h=document.getElementById("checkbox"),d=document.getElementById("checkbox1"),p=document.getElementById("checkbox2"),this.saveDrawSignature(h),this.saveUploadSignature(p),(c=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_"))&&(this.saveTypeString=c.toDataURL()),this.updateSignatureTypeValue(),this.pdfViewer.enableHtmlSanitizer&&this.textValue&&(this.textValue=go.sanitize(this.textValue)),d&&d.checked?this.pdfViewerBase.isInitialField?(this.isSaveInitial=!0,this.initialImageString=this.saveTypeString,this.saveInitialTypeString=this.textValue,this.issaveTypeInitial=!0):(this.isSaveSignature=!0,this.signatureImageString=this.saveTypeString,this.saveSignatureTypeString=this.textValue,this.issaveTypeSignature=!0):this.pdfViewerBase.isInitialField?(this.isSaveInitial=!1,this.saveInitialTypeString="",this.issaveTypeInitial=!1):(this.isSaveSignature=!1,this.saveSignatureTypeString="",this.issaveTypeSignature=!1),this.pdfViewerBase.isInitialField?this.initialTypeString=this.saveTypeString:this.signatureTypeString=this.saveTypeString,this.pdfViewer.formFieldsModule&&this.pdfViewer.formFieldsModule.drawSignature("Type",this.textValue,this.pdfViewerBase.currentTarget),this.hideSignaturePanel())},PRt.prototype.imageAddSignature=function(e){var t,i,n,o,r,s,a,l,h,d,p,c;this.pdfViewerBase.isToolbarSignClicked?(a=this.pdfViewerBase.getZoomFactor(),l=null,t=this.pdfViewer.annotation.createGUID(),this.pdfViewerBase.currentSignatureAnnot=null,this.pdfViewerBase.isSignatureAdded=!0,i=this.pdfViewerBase.currentPageNumber-1,p=document.getElementById(this.pdfViewer.element.id+"_pageDiv_"+i),n=this.pdfViewer.handWrittenSignatureSettings.thickness||1,o=this.pdfViewer.handWrittenSignatureSettings.opacity||1,r=this.pdfViewer.handWrittenSignatureSettings.strokeColor||"#000000",c=s=d=h=0,this.pdfViewer.enableHtmlSanitizer&&this.outputString&&(this.outputString=go.sanitize(this.outputString)),s=je(this.pdfViewer.handWrittenSignatureSettings.height)||"Stretch"!==this.pdfViewer.signatureFitMode?this.signatureImageHeight>=this.signatureImageWidth?this.signatureImageHeight/this.signatureImageHeight*100:this.signatureImageHeight/this.signatureImageWidth*100:this.pdfViewer.handWrittenSignatureSettings.height,c=je(this.pdfViewer.handWrittenSignatureSettings.width)||"Stretch"!==this.pdfViewer.signatureFitMode?this.signatureImageHeight>=this.signatureImageWidth?this.signatureImageWidth/this.signatureImageHeight*100:this.signatureImageWidth/this.signatureImageWidth*100:this.pdfViewer.handWrittenSignatureSettings.width,h=(parseFloat(p.style.width)/2-c/2)/a,d=(parseFloat(p.style.height)/2-s/2)/a,p=this.pdfViewerBase.getZoomFactor(),a=this.signtypevalue,l={id:"Typesign"+this.pdfViewerBase.signatureCount,bounds:{left:h/p,top:d/p,x:h/p,y:d/p,width:c,height:s},pageIndex:i,dynamicText:a,data:this.pdfViewerBase.signatureModule.outputString,shapeAnnotationType:"SignatureImage",opacity:o,strokeColor:r,thickness:n,fontSize:16,fontFamily:this.fontName,signatureName:t},h=void(this.pdfViewerBase.currentSignatureAnnot=l),(h=N?document.getElementById(this.pdfViewer.element.id+"_signatureCheckBox"):document.getElementById("checkbox2"))&&h.checked&&this.addSignatureCollection(),this.hideSignaturePanel(),this.pdfViewerBase.isToolbarSignClicked=!1):(h=document.getElementById("checkbox"),d=document.getElementById("checkbox1"),p=document.getElementById("checkbox2"),this.saveDrawSignature(h),this.saveTypeSignature(d),(c=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_"))&&(this.saveUploadString=c.toDataURL()),this.pdfViewer.enableHtmlSanitizer&&this.outputString&&(this.outputString=go.sanitize(this.outputString)),p&&p.checked?this.pdfViewerBase.isInitialField?(this.isSaveInitial=!0,this.initialImageString=this.saveUploadString,this.saveInitialUploadString=this.outputString,this.issaveImageInitial=!0):(this.isSaveSignature=!0,this.signatureImageString=this.saveUploadString,this.saveSignatureUploadString=this.outputString,this.issaveImageSignature=!0):this.pdfViewerBase.isInitialField?(this.isSaveInitial=!1,this.saveInitialUploadString="",this.issaveImageInitial=!1):(this.isSaveSignature=!1,this.saveSignatureUploadString="",this.issaveImageSignature=!1),this.pdfViewerBase.isInitialField?this.initialUploadString=this.saveUploadString:this.signatureUploadString=this.saveUploadString,this.pdfViewer.formFieldsModule&&this.pdfViewer.formFieldsModule.drawSignature("Image","",this.pdfViewerBase.currentTarget),this.hideSignaturePanel())},PRt.prototype.saveDrawSignature=function(e){e&&(e.checked?""!==this.drawOutputString&&(e=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_"),this.saveImageString=e.toDataURL(),this.pdfViewerBase.isInitialField?(this.saveInitialString=this.drawOutputString,this.initialDrawString=this.saveImageString):(this.saveSignatureString=this.drawOutputString,this.signatureDrawString=this.saveImageString),this.checkSaveFiledSign(this.pdfViewerBase.isInitialField,!0)):(this.pdfViewerBase.isInitialField?this.saveInitialString="":this.saveSignatureString="",this.checkSaveFiledSign(this.pdfViewerBase.isInitialField,!1)))},PRt.prototype.saveTypeSignature=function(e){e&&(e.checked?(this.updateSignatureTypeValue(),""!==this.textValue&&(this.pdfViewerBase.isInitialField?(this.issaveTypeInitial=!0,this.saveInitialTypeString=this.textValue):(this.issaveTypeSignature=!0,this.saveSignatureTypeString=this.textValue))):this.pdfViewerBase.isInitialField?(this.saveInitialTypeString="",this.issaveTypeInitial=!1):(this.saveSignatureTypeString="",this.issaveTypeSignature=!1))},PRt.prototype.saveUploadSignature=function(e){e&&(e.checked?(e=document.getElementById(this.pdfViewer.element.id+"_signatureuploadCanvas_").toDataURL(),""!==(e="hidden"===document.getElementById(this.pdfViewer.element.id+"_e-pv-upload-button").style.visibility?e:"")&&(this.pdfViewerBase.isInitialField?(this.issaveImageInitial=!0,this.saveInitialUploadString=e):(this.issaveImageSignature=!0,this.saveSignatureUploadString=e))):this.pdfViewerBase.isInitialField?(this.saveInitialUploadString="",this.issaveImageInitial=!1):(this.saveSignatureUploadString="",this.issaveImageSignature=!1))},PRt.prototype.updateSignatureTypeValue=function(e){var t=document.querySelectorAll(".e-pv-font-sign");if(t)for(var i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)]&&"red"===t[parseInt(i.toString(),10)].style.borderColor){this.pdfViewerBase.isToolbarSignClicked?(e&&(this.signtypevalue=t[parseInt(i.toString(),10)].textContent),this.outputString=t[parseInt(i.toString(),10)].textContent):(e&&(this.signtypevalue=t[parseInt(i.toString(),10)].textContent),this.textValue=t[parseInt(i.toString(),10)].textContent);try{this.fontName=JSON.parse(t[parseInt(i.toString(),10)].style.fontFamily)}catch(e){this.fontName=t[parseInt(i.toString(),10)].style.fontFamily}}},PRt.prototype.hideSignaturePanel=function(){this.signatureDialog&&this.signatureDialog.hide()},PRt.prototype.bindTypeSignatureClickEvent=function(){if(N)for(var e=0;e<4;e++){var t=document.querySelector("#"+this.pdfViewer.element.id+"_font_signature"+e);t&&t.addEventListener("click",this.typeSignatureclicked.bind(this))}},PRt.prototype.bindDrawSignatureClickEvent=function(){var e=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_");e&&(e.addEventListener("mousedown",this.signaturePanelMouseDown.bind(this)),e.addEventListener("mousemove",this.signaturePanelMouseMove.bind(this)),e.addEventListener("mouseup",this.signaturePanelMouseUp.bind(this)),e.addEventListener("mouseleave",this.signaturePanelMouseUp.bind(this)),e.addEventListener("touchstart",this.signaturePanelMouseDown.bind(this)),e.addEventListener("touchmove",this.signaturePanelMouseMove.bind(this)),e.addEventListener("touchend",this.signaturePanelMouseUp.bind(this)))},PRt.prototype.typeSignatureclicked=function(t){t=t.target;if(t){for(var e=0;e<4;e++){var i=document.querySelector("#"+this.pdfViewer.element.id+"_font_signature"+e);i&&(i.style.borderColor="")}t.style.borderColor="red",this.outputString=t.textContent;try{this.fontName=JSON.parse(t.style.fontFamily)}catch(e){this.fontName=t.style.fontFamily}this.enableCreateButton(!1)}},PRt.prototype.createSignatureCanvas=function(){var e,t,i,n,o=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_"),r=document.getElementById(this.pdfViewer.element.id+"Signature_appearance"),s=(o&&o.remove(),r&&r.remove(),305),o=this.pdfViewer.element.clientHeight,r=(o<=500?s=250:500<o&&o<=750&&(s=275),Q("div",{id:this.pdfViewer.element.id+"Signature_appearance",className:"e-pv-signature-apperance",styles:"margin-top:30px"})),o=Q("canvas",{id:this.pdfViewer.element.id+"_signatureCanvas_",className:"e-pv-signature-canvas"}),a=(o.classList.add("e-pv-canvas-signature"),o.height=s,o.style.height=s+"px",o.style.border="1px dotted #bdbdbd",o.style.backgroundColor="white",o.style.boxSizing="border-box",o.style.borderRadius="2px",o.addEventListener("mousedown",this.signaturePanelMouseDown.bind(this)),o.addEventListener("mousemove",this.signaturePanelMouseMove.bind(this)),o.addEventListener("mouseup",this.signaturePanelMouseUp.bind(this)),o.addEventListener("mouseleave",this.signaturePanelMouseLeave.bind(this)),o.addEventListener("touchstart",this.signaturePanelMouseDown.bind(this)),o.addEventListener("touchmove",this.signaturePanelMouseMove.bind(this)),o.addEventListener("touchend",this.signaturePanelMouseUp.bind(this)),r.appendChild(o),o=(!this.pdfViewerBase.isToolbarSignClicked||this.pdfViewerBase.isInitialField)&&this.pdfViewerBase.isInitialField?this.pdfViewer.localeObj.getConstant("Save Initial"):this.pdfViewer.localeObj.getConstant("Save Signature"),this.pdfViewer.hideSaveSignature||((t=document.createElement("input")).type="checkbox",t.id="checkbox",r.appendChild(t),(e=new ib({label:o,disabled:!1,checked:!1})).appendTo(t)),this.pdfViewerBase.isInitialField?this.isSaveInitial=this.saveSignatureCheckbox():this.isSaveSignature=this.saveSignatureCheckbox(),(this.isSaveSignature&&!this.pdfViewerBase.isInitialField||this.isSaveInitial&&this.pdfViewerBase.isInitialField)&&(e.checked=!0),Q("div",{id:this.pdfViewer.element.id+"type_appearance",className:"e-pv-signature-apperance",styles:"margin-top:6px"})),l=document.createElement("input"),h=((!this.pdfViewerBase.isInitialField&&this.issaveTypeSignature&&!this.pdfViewerBase.isToolbarSignClicked||this.pdfViewerBase.isInitialField&&this.issaveTypeInitial&&!this.pdfViewerBase.isToolbarSignClicked)&&(l.value=this.drawSavedTypeSignature()),l.type="text",l.id=this.pdfViewer.element.id+"_e-pv-Signtext-box",a.appendChild(l),new fV({placeholder:this.pdfViewer.localeObj.getConstant("Enter Signature as Name"),floatLabelType:"Auto"})),l=(h.appendTo(l),Q("div",{id:this.pdfViewer.element.id+"_font_appearance",className:"e-pv-font-appearance-style"})),l=(l.classList.add("e-pv-canvas-signature"),l.style.height=s-35+"px",l.style.border="1px dotted #bdbdbd",l.style.boxSizing="border-box",l.style.borderRadius="2px",l.style.backgroundColor="white",l.style.color="black",l.style.marginTop="8px",l.style.paddingRight="0px",a.appendChild(l),(t=document.createElement("input")).type="checkbox",t.id="checkbox1",a.appendChild(t),(e=new ib({label:o,disabled:!1,checked:!1})).appendTo(t),(this.issaveTypeSignature&&!this.pdfViewerBase.isInitialField&&!this.pdfViewerBase.isToolbarSignClicked||this.issaveTypeInitial&&this.pdfViewerBase.isInitialField&&!this.pdfViewerBase.isToolbarSignClicked)&&(e.checked=!0),h.addEventListener("input",this.renderSignatureText.bind(this)),this.enableCreateButton(!0),Q("div",{id:this.pdfViewer.element.id+"Signature_tab"})),h=Q("div",{id:this.pdfViewer.element.id+"upload_appearance",className:"e-pv-signature-apperance",styles:"padding-top:30px"}),d=document.createElement("div"),p=(d.id=this.pdfViewer.element.id+"_e-pv-upload-button",h.appendChild(d),new zv({cssClass:"e-pv-sign-upload",content:this.pdfViewer.localeObj.getConstant("Browse Signature Image")})),c=(p.appendTo(d),p.element.style.position="absolute",Q("canvas",{id:this.pdfViewer.element.id+"_signatureuploadCanvas_",className:"e-pv-signature-uploadcanvas"})),u=(750<this.pdfViewer.element.offsetWidth?c.width=714:c.width=this.pdfViewer.element.offsetWidth-35,c.classList.add("e-pv-canvas-signature"),c.height=s,c.style.height=s+"px",p.element.style.left=c.width/2-50+"px",p.element.style.top=parseFloat(c.style.height)/2+20+"px",c.style.border="1px dotted #bdbdbd",c.style.backgroundColor="transparent",c.style.boxSizing="border-box",c.style.borderRadius="2px",c.style.zIndex="0",""),g=(""===(u=!this.pdfViewerBase.isInitialField&&this.issaveImageSignature&&!this.pdfViewerBase.isToolbarSignClicked||this.pdfViewerBase.isInitialField&&this.issaveImageInitial&&!this.pdfViewerBase.isToolbarSignClicked?this.drawSavedImageSignature():u)||this.pdfViewerBase.isToolbarSignClicked||(this.clearUploadString=!1,i=c.getContext("2d"),(n=new Image).src=u,n.onload=function(){i.drawImage(n,0,0,c.width,c.height)},p.element.style.display="hidden"),h.appendChild(c),(t=document.createElement("input")).type="checkbox",t.id="checkbox2",h.appendChild(t),(e=new ib({label:o,disabled:!1,checked:!1})).appendTo(t),(this.issaveImageSignature&&!this.pdfViewerBase.isInitialField&&!this.pdfViewerBase.isToolbarSignClicked||this.issaveImageInitial&&this.pdfViewerBase.isInitialField&&!this.pdfViewerBase.isToolbarSignClicked)&&(e.checked=!0),d.addEventListener("click",this.uploadSignatureImage.bind(this)),this.signfontStyle=[{FontName:"Helvetica"},{FontName:"Times New Roman"},{FontName:"Courier"},{FontName:"Symbol"}],[]);if(this.pdfViewerBase.isToolbarSignClicked&&!je(this.pdfViewer.handWrittenSignatureSettings.typeSignatureFonts))for(var m=0;m<4;m++)je(this.pdfViewer.handWrittenSignatureSettings.typeSignatureFonts[parseInt(m.toString(),10)])||(this.signfontStyle[parseInt(m.toString(),10)].FontName=this.pdfViewer.handWrittenSignatureSettings.typeSignatureFonts[parseInt(m.toString(),10)]);this.setCustomFonts();for(var f=0;f<this.signfontStyle.length;f++)g[parseInt(f.toString(),10)]=document.createElement("div"),g[parseInt(f.toString(),10)].id="_font_signature"+f,g[parseInt(f.toString(),10)].classList.add("e-pv-font-sign"),275===s?(g[parseInt(f.toString(),10)].style.fontSize="13px",g[parseInt(f.toString(),10)].style.paddingTop="30px",g[parseInt(f.toString(),10)].style.height="78px"):250===s&&(g[parseInt(f.toString(),10)].style.fontSize="12px",g[parseInt(f.toString(),10)].style.paddingTop="25px",g[parseInt(f.toString(),10)].style.height="68px");this.fontsign=g;var y=this,u=[],u=this.pdfViewerBase.isToolbarSignClicked?this.pdfViewerBase.isInitialField?this.showHideSignatureTab((this.pdfViewer.handWrittenSignatureSettings.initialDialogSettings||this.pdfViewer.initialDialogSettings)&&(this.pdfViewer.handWrittenSignatureSettings.initialDialogSettings?this.pdfViewer.handWrittenSignatureSettings:this.pdfViewer).initialDialogSettings.displayMode,r,a,h):this.showHideSignatureTab((this.pdfViewer.handWrittenSignatureSettings.signatureDialogSettings||this.pdfViewer.signatureDialogSettings)&&(this.pdfViewer.handWrittenSignatureSettings.signatureDialogSettings?this.pdfViewer.handWrittenSignatureSettings:this.pdfViewer).signatureDialogSettings.displayMode,r,a,h):this.pdfViewerBase.isInitialField?this.showHideSignatureTab(this.pdfViewer.initialFieldSettings.initialDialogSettings?this.pdfViewer.initialFieldSettings.initialDialogSettings.displayMode:7,r,a,h):this.showHideSignatureTab(this.pdfViewer.signatureFieldSettings.signatureDialogSettings?this.pdfViewer.signatureFieldSettings.signatureDialogSettings.displayMode:7,r,a,h);return this.tabObj=new k5({selected:function(e){y.handleSelectEvent(e)},selecting:function(e){y.select(e)},items:u}),this.tabObj.appendTo(l),"DRAW"===u[0].header.label?this.signaturetype="Draw":"TYPE"===u[0].header.label?this.signaturetype="Type":this.signaturetype="Image",l},PRt.prototype.setCustomFonts=function(){if(!this.pdfViewerBase.isToolbarSignClicked&&!je(this.pdfViewer.signatureFieldSettings.typeSignatureFonts)&&!this.pdfViewerBase.isInitialField)for(var e=0;e<4;e++)je(this.pdfViewer.signatureFieldSettings.typeSignatureFonts[parseInt(e.toString(),10)])||(this.signfontStyle[parseInt(e.toString(),10)].FontName=this.pdfViewer.signatureFieldSettings.typeSignatureFonts[parseInt(e.toString(),10)]);if(!this.pdfViewerBase.isToolbarSignClicked&&!je(this.pdfViewer.initialFieldSettings.typeInitialFonts)&&this.pdfViewerBase.isInitialField)for(e=0;e<4;e++)je(this.pdfViewer.initialFieldSettings.typeInitialFonts[parseInt(e.toString(),10)])||(this.signfontStyle[parseInt(e.toString(),10)].FontName=this.pdfViewer.initialFieldSettings.typeInitialFonts[parseInt(e.toString(),10)])},PRt.prototype.handleSelectEvent=function(e){var t,i,n="",o=document.getElementById(this.pdfViewer.element.id+"Signature_tab").ej2_instances[0];if(o&&0<o.items.length)for(var r=0;r<o.items.length;r++)o.items[parseInt(r.toString(),10)].header.text===e.selectedItem.textContent&&(n=o.items[parseInt(r.toString(),10)].header.label);this.clearSignatureCanvas(e),"draw"===n.toLocaleLowerCase()?(this.signaturetype="Draw",this.enableCreateSignatureButton(),t=document.getElementById("checkbox"),this.hideSignatureCheckbox(t)):"type"===n.toLocaleLowerCase()?((i=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_"))&&(this.drawSignatureDataUrl=i.toDataURL()),this.updateSignatureTypeValue(),this.signaturetype="Type",this.enableCreateSignatureButton(),t=document.getElementById("checkbox1"),this.hideSignatureCheckbox(t),t=document.getElementById(this.pdfViewer.element.id+"_e-pv-Signtext-box"),(!this.pdfViewerBase.isInitialField&&""!==this.saveSignatureTypeString&&""!==t.value&&!this.pdfViewerBase.isToolbarSignClicked||this.pdfViewerBase.isInitialField&&""!==this.saveInitialTypeString&&""!==t.value&&!this.pdfViewerBase.isToolbarSignClicked)&&this.renderSignatureText()):"upload"===n.toLocaleLowerCase()&&((i=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_"))&&(this.drawSignatureDataUrl=i.toDataURL()),this.signaturetype="Image",this.enableCreateSignatureButton(),t=document.getElementById("checkbox2"),this.hideSignatureCheckbox(t),i=document.getElementById(this.pdfViewer.element.id+"_e-pv-upload-button"),""===this.saveSignatureUploadString||this.pdfViewerBase.isInitialField||this.clearUploadString||this.pdfViewerBase.isToolbarSignClicked||(this.enableCreateButton(!1),i.style.visibility="hidden",this.outputString=this.saveSignatureUploadString),""===this.saveInitialUploadString||!this.pdfViewerBase.isInitialField||this.clearUploadString||this.pdfViewerBase.isToolbarSignClicked||(this.enableCreateButton(!1),i.style.visibility="hidden",this.outputString=this.saveInitialUploadString)),this.pdfViewer.element.offsetWidth<750&&this.updateCanvasSize(),this.drawSignOnTabSwitch(),"upload"===n.toLocaleLowerCase()&&this.imageSignatureDataUrl&&this.imageSignOnTabSwitch()},PRt.prototype.enableCreateSignatureButton=function(){this.pdfViewerBase.isToolbarSignClicked||"Type"!==this.signaturetype?""!==this.outputString?this.enableCreateButton(!1):this.enableCreateButton(!0):""!==this.textValue?this.enableCreateButton(!1):this.enableCreateButton(!0)},PRt.prototype.showHideSignatureTab=function(e,t,i,n){var o=[];return e&DCt.Draw&&o.push({header:{text:this.pdfViewer.localeObj.getConstant("Draw-hand Signature"),label:"DRAW"},content:t}),e&DCt.Text&&o.push({header:{text:this.pdfViewer.localeObj.getConstant("Type Signature"),label:"TYPE"},content:i}),e&DCt.Upload&&o.push({header:{text:this.pdfViewer.localeObj.getConstant("Upload Signature"),label:"UPLOAD"},content:n}),o},PRt.prototype.createSignatureFileElement=function(){var e=Q("input",{id:this.pdfViewer.element.id+"_signElement",attrs:{type:"file"}});e.setAttribute("accept",".jpg,.jpeg,.png"),e.style.position="absolute",e.style.left="0px",e.style.top="0px",e.style.visibility="hidden",document.body.appendChild(e),e.addEventListener("change",this.addStampImage)},PRt.prototype.uploadSignatureImage=function(){var e=document.getElementById(this.pdfViewer.element.id+"_signElement");je(e)&&(this.createSignatureFileElement(),e=document.getElementById(this.pdfViewer.element.id+"_signElement")),e&&e.click()},PRt.prototype.renderSignatureText=function(){for(var e,t=document.getElementById(this.pdfViewer.element.id+"_font_appearance"),i=document.getElementById(this.pdfViewer.element.id+"_e-pv-Signtext-box"),n=0;n<this.signfontStyle.length;n++)this.fontsign[parseInt(n.toString(),10)].innerHTML=i.value,this.fontsign[parseInt(n.toString(),10)].style.fontFamily=this.signfontStyle[parseInt(n.toString(),10)].FontName,(""!==this.fontName&&this.signfontStyle[parseInt(n.toString(),10)].FontName===this.fontName||je(this.fontName)&&!je(this.signfontStyle[parseInt(n.toString(),10)].FontName)&&0===n)&&(this.fontsign[parseInt(n.toString(),10)].classList.add("e-pv-selected-fontdiv"),this.fontsign[parseInt(n.toString(),10)].style.borderColor="red"),t.appendChild(this.fontsign[parseInt(n.toString(),10)]);for(n=0;n<this.signfontStyle.length;n++)document.getElementById("_font_signature"+n).addEventListener("click",this.typeSignatureclick.bind(this));e=""===i.value.trim(),this.enableCreateButton(e),this.enableClearbutton(e),this.pdfViewer.element.offsetWidth<750&&this.updateCanvasSize(),this.drawSignOnTabSwitch()},PRt.prototype.typeSignatureclick=function(){var t=event.target;if(""!==t.textContent.trim()){document.getElementsByClassName("e-pv-createbtn")[0].disabled=!1;for(var e=0;e<4;e++){var i=document.getElementById("_font_signature"+e);i&&(i.style.borderColor="",i.classList.remove("e-pv-selected-fontdiv"))}t.classList.add("e-pv-selected-fontdiv"),t.style.borderColor="red",this.outputString=t.textContent;try{this.fontName=JSON.parse(t.style.fontFamily)}catch(e){this.fontName=t.style.fontFamily}}},PRt.prototype.addSignatureCollection=function(e,t){var i=-1,n=-1,o=-1,r=-1,s=rbt(this.outputString),a=document.createElement("canvas"),l=a.getContext("2d"),h=this.pdfViewerBase.currentSignatureAnnot.shapeAnnotationType;if("HandWrittenSignature"===h){if(0!==s.length){for(var d=0;d<s.length;d++){var p=s[parseInt(d.toString(),10)];-1===i?(i=p.x,o=p.x,n=p.y,r=p.y):((b=p.x)<=i&&(i=b),(w=p.y)<=n&&(n=w),o<=b&&(o=b),r<=w&&(r=w))}var c=o-i,u=r-n,g=c/100,m=u/100,f=0,y=0;e?(a.width=t.currentWidth,a.height=t.currentHeight,g=c/e.width,m=u/e.height,f=e.x-t.currentLeft,y=e.y-t.currentTop):(a.width=100,a.height=100),l.beginPath();for(var v=0;v<s.length;v++){var b=((p=s[parseInt(v.toString(),10)]).x-i)/g+f,w=(p.y-n)/m+y;"M"===p.command?l.moveTo(b,w):"L"===p.command&&l.lineTo(b,w)}l.stroke(),l.closePath(),c=a.toDataURL()}}else c=this.outputString;e?this.saveImageString=c:((u={})["sign_"+this.pdfViewerBase.imageCount]=this.outputString,this.outputcollection.push(u),(t={}).height=this.pdfViewerBase.currentSignatureAnnot.bounds.height,t.width=this.pdfViewerBase.currentSignatureAnnot.bounds.width,(a=[]).push({id:"sign_"+this.pdfViewerBase.imageCount,imageData:c,signatureType:h,fontFamily:this.pdfViewerBase.currentSignatureAnnot.fontFamily,bounds:t}),this.signaturecollection.push({image:a,isInitial:this.pdfViewerBase.isInitialField}),this.pdfViewerBase.imageCount++)},PRt.prototype.getSaveLimit=function(e){return e>this.maxSaveLimit?e=this.maxSaveLimit:e<1&&(e=1),e},PRt.prototype.RenderSavedSignature=function(){this.pdfViewerBase.signatureCount++;var e=this.pdfViewerBase.getZoomFactor();if(this.pdfViewerBase.isAddedSignClicked){for(var t=this.pdfViewer.annotation.createGUID(),i=(this.pdfViewerBase.currentSignatureAnnot=null,this.pdfViewerBase.isSignatureAdded=!0,this.pdfViewerBase.currentPageNumber-1),n=document.getElementById(this.pdfViewer.element.id+"_pageDiv_"+i),o=this.pdfViewer.handWrittenSignatureSettings.width||100,r=this.pdfViewer.handWrittenSignatureSettings.height||100,s=this.pdfViewer.handWrittenSignatureSettings.thickness||1,a=this.pdfViewer.handWrittenSignatureSettings.opacity||1,l=this.pdfViewer.handWrittenSignatureSettings.strokeColor||"#000000",h=(parseFloat(n.style.width)/2-o/2)/e,n=(parseFloat(n.style.height)/2-r/2)/e,d="",p=void 0,c=void 0,u=void 0,g=0;g<this.outputcollection.length;g++){var m=this.outputcollection[parseInt(g.toString(),10)];if((y=event.target)&&y.id==="sign_"+g||y&&y.id==="sign_border"+g){d=m["sign_"+g];break}}for(var f=0;f<this.signaturecollection.length;f++){var y=event.target,v=this.signaturecollection[parseInt(f.toString(),10)].image[0].id.split("_")[1];if(y&&y.id==="sign_"+v||y&&y.id==="sign_border"+v){p=this.signaturecollection[parseInt(f.toString(),10)].image[0].signatureType,c=this.signaturecollection[parseInt(f.toString(),10)].image[0].fontFamily,u=this.signaturecollection[parseInt(f.toString(),10)].image[0].bounds;break}}r="HandWrittenSignature"!==p||(e=this.updateSignatureAspectRatio(d,!0),u.width!==e.width&&u.height!==e.height)?(o=u.width,u.height):(o=e.width||o,e.height||r),e={id:"sign"+this.pdfViewerBase.signatureCount,bounds:{x:h,y:n,width:o,height:r},pageIndex:i,data:d,shapeAnnotationType:p,opacity:a,fontFamily:c,strokeColor:l,thickness:s,signatureName:t},this.pdfViewerBase.currentSignatureAnnot=e,this.pdfViewerBase.isAddedSignClicked=!1}else this.pdfViewer.formFieldsModule&&this.pdfViewer.formFieldsModule.drawSignature()},PRt.prototype.updateCanvasSize=function(){var e=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_"),e=(this.setTabItemWidth(e),document.getElementById(this.pdfViewer.element.id+"_signatureuploadCanvas_")),e=(this.setTabItemWidth(e),document.getElementById(this.pdfViewer.element.id+"_font_appearance"));this.setTabItemWidth(e)},PRt.prototype.setTabItemWidth=function(e){var t,i,n=2,o=document.querySelector(".e-dlg-content"),r=(o&&(o=getComputedStyle(o),n=n+parseInt(o.paddingLeft,10)+parseInt(o.paddingRight,10)),e&&this.signatureDialog&&this.signatureDialog.visible&&("DIV"!==e.tagName&&(t=e.getContext("2d"),o=e.toDataURL(),(i=new Image).src=o,i.onload=function(){t.drawImage(i,0,0,e.width,e.height)}),750<this.pdfViewer.element.parentElement.clientWidth?(e.width=714,e.style.width="714px"):(e.width=this.pdfViewer.element.parentElement.clientWidth-n,e.style.width=e.width+"px")),document.getElementsByClassName("e-pv-font-sign"));if(e&&r&&0<r.length)for(var s=0;s<r.length;s++)r[parseInt(s.toString(),10)].style.width=e.width/2-50+"px"},PRt.prototype.drawSignOnTabSwitch=function(){var t=this,i=new Image;i.onload=function(){var e=document.getElementById(t.pdfViewer.element.id+"_signatureCanvas_");e&&e.getContext("2d").drawImage(i,0,0)},i.src=this.drawSignatureDataUrl},PRt.prototype.imageSignOnTabSwitch=function(){var i=this,n=new Image;n.onload=function(){var e,t=document.getElementById(i.pdfViewer.element.id+"_signatureuploadCanvas_");t&&(e=t.getContext("2d"),document.getElementById(i.pdfViewer.element.id+"_e-pv-upload-button").style.visibility="hidden",e.drawImage(n,0,0,t.width,t.height),i.enableCreateButton(!1),i.signatureImageHeight=n.naturalHeight,i.signatureImageWidth=n.naturalWidth)},n.src=this.imageSignatureDataUrl},PRt.prototype.signaturePanelMouseDown=function(e){"contextmenu"!==e.type&&(e.preventDefault(),this.findMousePosition(e),this.mouseDetection=!0,this.oldX=this.mouseX,this.oldY=this.mouseY,this.newObject=[],this.drawMousePosition(e),this.mouseMoving=!0)},PRt.prototype.enableCreateButton=function(e){var t=document.getElementsByClassName("e-pv-createbtn")[0];t&&(t.disabled=e),this.enableClearbutton(e)},PRt.prototype.enableClearbutton=function(e){var t=document.getElementsByClassName("e-pv-clearbtn")[0];t&&(t.disabled=e)},PRt.prototype.signaturePanelMouseMove=function(e){this.mouseDetection&&"Draw"===this.signaturetype&&(this.findMousePosition(e),this.enableCreateButton(!1),this.drawMousePosition(e))},PRt.prototype.findMousePosition=function(e){var t;-1!==e.type.indexOf("touch")?(t=e.target.getBoundingClientRect(),this.mouseX=e.changedTouches[0].clientX-t.left,this.mouseY=e.changedTouches[0].clientY-t.top):(this.mouseX=e.offsetX,this.mouseY=e.offsetY)},PRt.prototype.drawMousePosition=function(e){this.mouseDetection&&(this.drawSignatureInCanvas(),this.oldX=this.mouseX,this.oldY=this.mouseY)},PRt.prototype.drawSignatureInCanvas=function(){var e=document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_").getContext("2d");e.beginPath(),e.moveTo(this.oldX,this.oldY),e.lineTo(this.mouseX,this.mouseY),e.stroke(),e.lineWidth=2,e.arc(this.oldX,this.oldY,1,0,2*Math.PI,!0),e.closePath(),this.newObject.push(this.mouseX,this.mouseY)},PRt.prototype.signaturePanelMouseUp=function(){this.mouseDetection&&this.convertToPath(this.newObject),this.mouseDetection=!1,"touchend"===event.type&&(this.canvasTouched=!0)},PRt.prototype.signaturePanelMouseLeave=function(){this.mouseDetection&&this.convertToPath(this.newObject),this.mouseDetection=!1,this.mouseMoving=!1},PRt.prototype.convertToPath=function(e){this.movePath(e[0],e[1]),this.linePath(e[0],e[1]);for(var t=2;t<e.length;t+=2)this.linePath(e[parseInt(t.toString(),10)],e[t+1])},PRt.prototype.linePath=function(e,t){this.outputString+="L"+e+","+t+" "},PRt.prototype.movePath=function(e,t){this.outputString+="M"+e+","+t+" "},PRt.prototype.clearSignatureCanvas=function(e){var t,i=!0,n=[],n=(!e||je(e.previousIndex)||je(e.selectedIndex)?(this.outputString="",this.newObject=[]):(i=!1,0===e.previousIndex?(this.drawOutputString=this.outputString,n=this.newObject):2===e.previousIndex&&(this.imageOutputString=this.outputString),this.outputString="",this.newObject=[],0===e.selectedIndex?(this.outputString=this.drawOutputString,this.newObject=n):2===e.selectedIndex&&(this.outputString=this.imageOutputString)),!1),o=!1,r=!1,e=(e&&e.currentTarget&&e.currentTarget.classList.contains("e-pv-clearbtn")&&(i=!1,"Draw"===this.signaturetype?(n=!0,t=document.getElementById("checkbox"),s=document.getElementById("checkbox"),t&&s.nextElementSibling&&(s.nextElementSibling.classList.remove("e-check"),t.checked=!1)):"Type"===this.signaturetype?(o=!0,t=document.getElementById("checkbox1"),s=document.getElementById("checkbox1"),t&&s.nextElementSibling&&(s.nextElementSibling.classList.remove("e-check"),t.checked=!1,this.textValue="")):(this.clearUploadString=r=!0,t=document.getElementById("checkbox2"),s=document.getElementById("checkbox2"),t&&s.nextElementSibling&&(s.nextElementSibling.classList.remove("e-check"),t.checked=!1))),document.getElementById(this.pdfViewer.element.id+"_signatureCanvas_")),s=((e&&i||n)&&e.getContext("2d").clearRect(0,0,e.width,e.height),document.getElementById(this.pdfViewer.element.id+"_signatureuploadCanvas_")),n=((s&&i||r)&&(s.getContext("2d").clearRect(0,0,s.width,s.height),t=document.getElementById(this.pdfViewer.element.id+"_e-pv-upload-button"))&&(t.style.visibility=""),document.getElementById(this.pdfViewer.element.id+"_font_appearance")),e=document.getElementById(this.pdfViewer.element.id+"_e-pv-Signtext-box");(n&&e&&i||o)&&(e.value="",N||(n.innerHTML="")),this.enableCreateButton(!0)},PRt.prototype.closeSignaturePanel=function(){this.pdfViewerBase.currentTarget&&(this.pdfViewerBase.drawSignatureWithTool=!0),this.clearSignatureCanvas(),N||this.signatureDialog.hide(),this.pdfViewerBase.isToolbarSignClicked=!1,this.pdfViewerBase.drawSignatureWithTool=!1,this.drawOutputString="",this.imageOutputString=""},PRt.prototype.saveSignature=function(){for(var e=null,e=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_sign"]:ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_sign"),t=[],i=0;i<this.pdfViewerBase.pageCount;i++)t[parseInt(i.toString(),10)]=[];if(e)for(var n=JSON.parse(e),o=0;o<n.length;o++){var r=[],s=n[parseInt(o.toString(),10)];if(s){for(var a=0;s.annotations.length>a;a++){this.pdfViewer.isSignatureEditable&&(l=this.pdfViewer.handWrittenSignatureSettings,u=this.pdfViewer.annotationSettings,l="Guest"!==l.author?l.author:u.author||"Guest",s.annotations[parseInt(a.toString(),10)].author=l);var l,h,d,p,c,u=s.annotations[parseInt(a.toString(),10)].strokeColor?s.annotations[parseInt(a.toString(),10)].strokeColor:"black";s.annotations[parseInt(a.toString(),10)].strokeColor=JSON.stringify(this.getRgbCode(u)),s.annotations[parseInt(a.toString(),10)].bounds=JSON.stringify(this.pdfViewer.annotation.getBounds(s.annotations[parseInt(a.toString(),10)].bounds,s.pageIndex)),"HandWrittenSignature"===s.annotations[parseInt(a.toString(),10)].shapeAnnotationType||"ink"===s.annotations[parseInt(a.toString(),10)].signatureName?(l=cbt(rbt(s.annotations[parseInt(a.toString(),10)].data)),s.annotations[parseInt(a.toString(),10)].data=JSON.stringify(l)):"SignatureText"!==s.annotations[parseInt(a.toString(),10)].shapeAnnotationType||this.checkDefaultFont(s.annotations[parseInt(a.toString(),10)].fontFamily)?s.annotations[parseInt(a.toString(),10)].data=JSON.stringify(s.annotations[parseInt(a.toString(),10)].data):(h=Q("canvas"),d=JSON.parse(s.annotations[parseInt(a.toString(),10)].bounds),h.width=d&&d.width||150,h.height=d&&d.height||2*s.annotations[parseInt(a.toString(),10)].fontSize,d=h.getContext("2d"),p=h.width/2,c=h.height/2+s.annotations[parseInt(a.toString(),10)].fontSize/2-10,d.textAlign="center",d.font=s.annotations[parseInt(a.toString(),10)].fontSize+"px "+s.annotations[parseInt(a.toString(),10)].fontFamily,d.fillText(s.annotations[parseInt(a.toString(),10)].data,p,c),s.annotations[parseInt(a.toString(),10)].data=JSON.stringify(h.toDataURL("image/png")),s.annotations[parseInt(a.toString(),10)].shapeAnnotationType="SignatureImage")}r=s.annotations}t[s.pageIndex]=r}return JSON.stringify(t)},PRt.prototype.checkDefaultFont=function(e){return"Helvetica"===e||"Times New Roman"===e||"Courier"===e||"Symbol"===e},PRt.prototype.getRgbCode=function(e){var t=(e=e.match(/#([a-z0-9]+)/gi)||e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/)?e:this.pdfViewer.annotationModule.nameToHash(e)).split(",");return je(t[1])&&(t=(e=this.pdfViewer.annotationModule.getValue(e,"rgba")).split(",")),{r:parseInt(t[0].split("(")[1],10),g:parseInt(t[1],10),b:parseInt(t[2],10),a:parseInt(t[3],10)}},PRt.prototype.renderSignature=function(e,t){var i,n="",o=this.pdfViewerBase.currentSignatureAnnot,r=o.signatureName;""!==r&&!je(r)||(r=this.pdfViewer.annotation.createGUID()),o&&("HandWrittenSignature"===this.pdfViewerBase.currentSignatureAnnot.shapeAnnotationType&&(i={id:o.id,bounds:{x:e,y:t,width:o.bounds.width,height:o.bounds.height},pageIndex:o.pageIndex,data:o.data,shapeAnnotationType:"HandWrittenSignature",opacity:o.opacity,fontFamily:o.fontFamily,fontSize:o.fontSize,strokeColor:o.strokeColor,thickness:o.thickness,signatureName:r}),"SignatureText"===this.pdfViewerBase.currentSignatureAnnot.shapeAnnotationType?i={id:o.id,bounds:{x:e,y:t,width:o.bounds.width,height:o.bounds.height},pageIndex:o.pageIndex,data:o.data,shapeAnnotationType:"SignatureText",opacity:o.opacity,fontFamily:o.fontFamily,fontSize:o.fontSize,strokeColor:o.strokeColor,thickness:o.thickness,signatureName:r}:"SignatureImage"===this.pdfViewerBase.currentSignatureAnnot.shapeAnnotationType&&(i={id:o.id,bounds:{x:e,y:t,width:o.bounds.width,height:o.bounds.height},pageIndex:o.pageIndex,data:o.data,shapeAnnotationType:"SignatureImage",opacity:o.opacity,fontFamily:o.fontFamily,fontSize:o.fontSize,strokeColor:o.strokeColor,thickness:o.thickness,signatureName:r}),e=this.pdfViewer.add(i),t=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",o.pageIndex),this.pdfViewer.renderDrawing(t,o.pageIndex),F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.pdfViewer.select([e.id]),this.pdfViewerBase.signatureAdded=!0,this.storeSignatureData(o.pageIndex,i),n="Draw"===this.signaturetype?this.saveImageString:o.data,this.pdfViewer.fireSignatureAdd(o.pageIndex,r,o.shapeAnnotationType,o.bounds,o.opacity,o.strokeColor,o.thickness,n),this.pdfViewer.annotation&&this.pdfViewer.annotation.onAnnotationMouseDown(),this.pdfViewerBase.currentSignatureAnnot=null,this.pdfViewerBase.signatureCount++)},PRt.prototype.renderExistingSignature=function(e,t,i){var n=!1;if(!i)for(var o=0;o<this.signAnnotationIndex.length;o++)if(this.signAnnotationIndex[parseInt(o.toString(),10)]===t){n=!0;break}if(e&&!n){0<e.length&&-1===this.signAnnotationIndex.indexOf(t)&&this.signAnnotationIndex.push(t);for(var r=0;r<e.length;r++){var s,a,l,h,d=e[parseInt(r.toString(),10)],p=(d&&(s=d.PathData,i&&(s=d.IsSignature?d.PathData:"SignatureImage"===d.AnnotationType||"SignatureText"===d.AnnotationType?JSON.parse(JSON.stringify(d.PathData)):s.includes("command")?ubt(JSON.parse(d.PathData)):d.PathData),this.outputString=s,p=this.pdfViewer.annotationModule.inkAnnotationModule.calculateInkSize(this.outputString),this.outputString="",c=0,h=1,l=d.Bounds,!p||"Ink"!==d.AnnotationType&&"signature"!==d.AnnotationType&&"Signature"!==d.AnnotationType||(p.height<1?(c=l.Height||l.height,h=l.Height||l.height):p.width<1&&(c=l.Width||l.width,h=l.Width||l.width)),p=je(l.X)?l.x+c/2:l.X+c/2,c=je(l.Y)?l.y+c/2:l.Y+c/2,a=l.Width?l.Width-(h-1):l.width-(h-1),l=l.Height?l.Height-(h-1):l.height-(h-1),h="SignatureText"===d.AnnotationType?{id:"sign"+this.pdfViewerBase.signatureCount,bounds:{x:p,y:c,width:a,height:l},pageIndex:t,data:s,fontFamily:d.FontFamily,fontSize:d.FontSize,shapeAnnotationType:"SignatureText",opacity:d.Opacity,strokeColor:d.StrokeColor,thickness:d.Thickness,signatureName:d.SignatureName}:"SignatureImage"===d.AnnotationType?{id:"sign"+this.pdfViewerBase.signatureCount,bounds:{x:p,y:c,width:a,height:l},pageIndex:t,data:s,shapeAnnotationType:"SignatureImage",opacity:d.Opacity,strokeColor:d.StrokeColor,thickness:d.Thickness,signatureName:d.SignatureName}:{id:"sign"+this.pdfViewerBase.signatureCount,bounds:{x:p,y:c,width:a,height:l},pageIndex:t,data:s,shapeAnnotationType:"HandWrittenSignature",opacity:d.Opacity,strokeColor:d.StrokeColor,thickness:d.Thickness,signatureName:d.SignatureName||"ink"}),this.pdfViewer.add(h),this.isAddAnnotationProgramatically&&this.pdfViewer.fireSignatureAdd(h.pageIndex,h.signatureName,h.shapeAnnotationType,h.bounds,h.opacity,h.strokeColor,h.thickness,h.data),d.pageIndex||d.PageNumber),c=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",p);this.pdfViewer.renderDrawing(c,h.pageIndex),this.storeSignatureData(h.pageIndex,h),this.pdfViewerBase.currentSignatureAnnot=null,this.pdfViewerBase.signatureCount++}}},PRt.prototype.storeSignatureData=function(e,t){this.pdfViewer.annotation.addAction(je(t.pageIndex)?t.PageIndex:t.pageIndex,null,t,"Addition","",t,t);var i,n,o,r,s=null,a=this.pdfViewerBase.getZoomFactor(),l=t.bounds?(i=t.bounds.left||t.bounds.x,n=t.bounds.top||t.bounds.y,o=t.bounds.width,r=t.bounds.height,t.pageIndex):(i=t.Bounds.left||t.Bounds.x,n=t.Bounds.top||t.Bounds.y,o=t.LineBounds.Width,r=t.LineBounds.Height,t.PageIndex),s=(t.wrapper&&t.wrapper.bounds&&(i=t.wrapper.bounds.left,n=t.wrapper.bounds.top),"SignatureText"===t.shapeAnnotationType&&t.wrapper&&t.wrapper.children&&1<t.wrapper.children.length&&t.wrapper.children[1]&&(i=i+t.wrapper.pivot.x+(this.signatureTextContentLeft-this.signatureTextContentTop*(a-a/this.signatureTextContentLeft)),n=n+(t.wrapper.children[1].bounds.y-n-(t.wrapper.children[1].bounds.y-n)/3)+t.wrapper.pivot.y+this.signatureTextContentTop*a),{id:t.id||null,bounds:{left:i,top:n,width:o,height:r},shapeAnnotationType:t.shapeAnnotationType||"ink",opacity:t.opacity||1,thickness:t.thickness||1,strokeColor:t.strokeColor||null,pageIndex:l,data:t.data||t.Value,fontSize:t.fontSize||null,fontFamily:t.fontFamily||null,signatureName:t.signatureName||t.Name}),a=(4500<ARt.sessionStorageManager.getWindowSessionStorageSize()+Math.round(JSON.stringify(s).length/1024)&&(this.pdfViewerBase.isStorageExceed=!0,this.pdfViewer.annotationModule.clearAnnotationStorage(),!this.pdfViewerBase.isFormStorageExceed)&&this.pdfViewer.formFieldsModule&&this.pdfViewer.formFieldsModule.clearFormFieldStorage(),ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_sign"));t=a?(this.storeSignatureCollections(s,e),i=JSON.parse(a),ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_sign"),!je(n=this.pdfViewer.annotationModule.getPageCollection(i,e))&&i[parseInt(n.toString(),10)]?(i[parseInt(n.toString(),10)].annotations.push(s),i[parseInt(n.toString(),10)].annotations.indexOf(s)):((o={pageIndex:e,annotations:[]}).annotations.push(s),o.annotations.indexOf(s),i.push(o)),JSON.stringify(i)):(this.storeSignatureCollections(s,e),(r={pageIndex:e,annotations:[]}).annotations.push(s),r.annotations.indexOf(s),(l=[]).push(r),JSON.stringify(l)),this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_sign"]=t:ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_sign",t)},PRt.prototype.modifySignatureCollection=function(e,t,i,n){this.pdfViewerBase.updateDocumentEditedProperty(!0);var o=null,r=this.getAnnotations(t,null),s=this.pdfViewerBase.getZoomFactor();if(null!=r&&i){for(var a=0;a<r.length;a++)if(i.id===r[parseInt(a.toString(),10)].id){if("bounds"===e){var l,h;"SignatureText"===i.shapeAnnotationType&&i.wrapper&&i.wrapper.children[1]?(l=i.wrapper.children[0].bounds.y,h=i.wrapper.children[0].bounds.x+i.wrapper.pivot.x+(this.signatureTextContentLeft-this.signatureTextContentTop*(s-s/this.signatureTextContentLeft)),l=l+(i.wrapper.children[1].bounds.y-l-(i.wrapper.children[1].bounds.y-l)/3)+i.wrapper.pivot.y+this.signatureTextContentTop*s,r[parseInt(a.toString(),10)].bounds={left:h,top:l,width:i.bounds.width,height:i.bounds.height}):r[parseInt(a.toString(),10)].bounds={left:i.wrapper.bounds.left,top:i.wrapper.bounds.top,width:i.bounds.width,height:i.bounds.height},r[parseInt(a.toString(),10)].fontSize=i.fontSize}else if("stroke"===e)r[parseInt(a.toString(),10)].strokeColor=i.wrapper.children[0].style.strokeColor;else if("opacity"===e)r[parseInt(a.toString(),10)].opacity=i.wrapper.children[0].style.opacity;else if("thickness"===e)r[parseInt(a.toString(),10)].thickness=i.wrapper.children[0].style.strokeWidth;else if("delete"===e){this.updateSignatureCollection(r[parseInt(a.toString(),10)]),o=r.splice(a,1)[0];break}if(e&&"delete"!==e&&this.storeSignatureCollections(r[parseInt(a.toString(),10)],t),n){r[parseInt(a.toString(),10)].opacity=i.wrapper.children[0].style.opacity,r[parseInt(a.toString(),10)].strokeColor=i.wrapper.children[0].style.strokeColor,r[parseInt(a.toString(),10)].thickness=i.wrapper.children[0].style.strokeWidth,this.storeSignatureCollections(r[parseInt(a.toString(),10)],t);break}}this.manageAnnotations(r,t)}return o},PRt.prototype.storeSignatureCollections=function(e,t){var i=this.checkSignatureCollection(e),n=owt(e);n.annotationId=e.signatureName,n.pageNumber=t,delete n.annotName,e.id&&(n.uniqueKey=e.id,delete n.id),i.isExisting?this.pdfViewer.signatureCollection.splice(i.position,0,n):this.pdfViewer.signatureCollection.push(n)},PRt.prototype.checkSignatureCollection=function(e){var t=this.pdfViewer.signatureCollection;if(t&&e)for(var i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].annotationId===e.signatureName)return this.pdfViewer.signatureCollection.splice(i,1),{isExisting:!0,position:i};return{isExisting:!1,position:null}},PRt.prototype.updateSignatureCollection=function(e){var t=this.pdfViewer.signatureCollection;if(t&&e)for(var i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].annotationId===e.signatureName){this.pdfViewer.signatureCollection.splice(i,1);break}},PRt.prototype.addInCollection=function(e,t){var i;t&&(this.storeSignatureCollections(t,e),(i=this.getAnnotations(e,null))&&i.push(t),this.manageAnnotations(i,e))},PRt.prototype.getAnnotations=function(e,t){var i=null;return(i=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_sign"]:ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_sign"))&&(i=JSON.parse(i),!je(e=this.pdfViewer.annotationModule.getPageCollection(i,e)))&&i[parseInt(e.toString(),10)]?i[parseInt(e.toString(),10)].annotations:t},PRt.prototype.manageAnnotations=function(e,t){var i=null;(i=this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_sign"]:ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_sign"))&&(i=JSON.parse(i),ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_annotations_sign"),null!=(t=this.pdfViewer.annotationModule.getPageCollection(i,t))&&i[parseInt(t.toString(),10)]&&(i[parseInt(t.toString(),10)].annotations=e),t=JSON.stringify(i),this.pdfViewerBase.isStorageExceed?this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_sign"]=t:ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_sign",t))},PRt.prototype.showSignatureDialog=function(e){e&&this.createSignaturePanel()},PRt.prototype.setAnnotationMode=function(){this.pdfViewerBase.isToolbarSignClicked=!0,this.pdfViewerBase.isInitialField=!1,this.showSignatureDialog(!0)},PRt.prototype.setInitialMode=function(){this.pdfViewerBase.isToolbarSignClicked=!0,this.pdfViewerBase.isInitialField=!0,this.showSignatureDialog(!0)},PRt.prototype.ConvertPointToPixel=function(e){return e*(96/72)},PRt.prototype.updateSignatureCollections=function(e,t,i){var n,o,r,s,a;if(e)return n=(s=e.Bounds).X,o=s.Y,r=s.Width,s=s.Height,a=e.PathData,i&&(a=ubt(JSON.parse(e.PathData))),{id:"sign"+e.SignatureName,bounds:{x:n,y:o,width:r,height:s},pageIndex:t,data:a,shapeAnnotationType:"HandWrittenSignature",opacity:e.Opacity,strokeColor:e.StrokeColor,thickness:e.Thickness,signatureName:e.SignatureName}},PRt.prototype.destroy=function(){ARt.sessionStorageManager.removeItem("_annotations_sign");var e=document.getElementById(this.pdfViewer.element.id+"_signElement");e&&(e.removeEventListener("change",this.addStampImage),e.parentElement)&&e.parentElement.removeChild(e),this.signatureDialog&&this.signatureDialog.destroy()},PRt.prototype.updateSignatureDetails=function(e,t,i){t=e?e.offset||{x:10,y:10}:(e={offset:{x:10,y:10},pageNumber:0,width:void 0,height:void 0}).offset;var n,o,r,s=this.pdfViewer.annotation.createGUID(),a=this.pdfViewer.annotation.updateSettings(this.pdfViewer.handWrittenSignatureSettings),l=this.pdfViewer.handWrittenSignatureSettings.annotationSelectorSettings,h=(this.pdfViewerBase.updateSelectorSettings(l),e.width=e.width||this.pdfViewer.handWrittenSignatureSettings.width||150,e.height=e.height||this.pdfViewer.handWrittenSignatureSettings.height||100,e.thickness=e.thickness||this.pdfViewer.handWrittenSignatureSettings.thickness||1,e.opacity=e.opacity||this.pdfViewer.handWrittenSignatureSettings.opacity||1,e.strokeColor=e.strokeColor||this.pdfViewer.handWrittenSignatureSettings.strokeColor||"#000000",e.path=e.path||this.pdfViewer.handWrittenSignatureSettings.path||"",e.canSave=e.canSave||!1,e.signatureItem=e.signatureItem||["Signature"],e.fontFamily=e.fontFamily||"Helvetica","Initial"===e.signatureItem[0]?(n=e.initialDialogSettings.displayMode||1,h=e.saveInitialLimit||this.pdfViewer.handWrittenSignatureSettings.saveInitialLimit,this.pdfViewer.handWrittenSignatureSettings.saveInitialLimit=this.pdfViewer.handWrittenSignatureSettings.saveInitialLimit<h?h:this.pdfViewer.handWrittenSignatureSettings.saveInitialLimit):(n=e.signatureDialogSettings.displayMode||1,h=e.saveSignatureLimit||this.pdfViewer.handWrittenSignatureSettings.saveSignatureLimit,this.pdfViewer.handWrittenSignatureSettings.saveSignatureLimit=this.pdfViewer.handWrittenSignatureSettings.saveSignatureLimit<h?h:this.pdfViewer.handWrittenSignatureSettings.saveSignatureLimit),[]),d=(1===n&&(o="signature",je(r=e.path||"")||(r="M"===r[0]||"L"===r[0]?(d=cbt(rbt(r)),JSON.stringify(d)):ubt(JSON.parse(r))),e.path=r),2===n&&(e.height=65,o="SignatureText"),{SignatureName:s,AnnotationSettings:a,AnnotationType:o=4===n?"SignatureImage":o,AnnotationSelectorSettings:e.annotationSelectorSettings||l,Opacity:e.opacity,PathData:e.path,PageNumber:i,FontFamily:e.fontFamily,FontSize:32,StrokeColor:e.strokeColor,Thickness:e.thickness,Bounds:{x:t.x,y:t.y,width:e.width,height:e.height}});return h[0]=d,e.canSave&&(r={x:t.x,y:t.y,width:e.width,height:e.height},this.pdfViewerBase.currentSignatureAnnot=null,this.outputString=e.path,a=void(this.pdfViewerBase.isInitialField="Initial"===e.signatureItem[0]),1===n?a={id:"sign"+this.pdfViewerBase.signatureCount,bounds:r,pageIndex:e.pageNumber,data:this.outputString,shapeAnnotationType:"HandWrittenSignature",opacity:e.opacity,strokeColor:e.strokeColor,thickness:e.thickness,signatureName:s}:2===n?a={id:"sign"+this.pdfViewerBase.signatureCount,bounds:r,pageIndex:e.pageNumber,data:this.outputString,fontFamily:e.fontFamily,fontSize:32,shapeAnnotationType:"SignatureText",signatureName:s}:4===n&&(a={id:"sign"+this.pdfViewerBase.signatureCount,bounds:r,pageIndex:e.pageNumber,data:this.outputString,shapeAnnotationType:"SignatureImage",signatureName:s}),this.pdfViewerBase.currentSignatureAnnot=a,this.addSignatureCollection(),this.outputString=""),{signatureAnnotation:h}};var kRt=PRt;function PRt(e,t){var r=this;this.mouseMoving=!0,this.canvasTouched=!1,this.imageSignatureDataUrl="",this.drawSignatureDataUrl="",this.newObject=[],this.outputString="",this.drawOutputString="",this.imageOutputString="",this.signaturecollection=[],this.outputcollection=[],this.signAnnotationIndex=[],this.fontsign=[],this.signfontStyle=[],this.isSaveSignature=!1,this.isSaveInitial=!1,this.isInitialFiledSaveSignature=!1,this.isSignatureFieldsSaveSignature=!1,this.issaveTypeSignature=!1,this.issaveImageSignature=!1,this.issaveTypeInitial=!1,this.issaveImageInitial=!1,this.saveSignatureTypeString="",this.saveInitialTypeString="",this.saveTypeString="",this.signatureTypeString="",this.initialTypeString="",this.saveUploadString="",this.saveSignatureUploadString="",this.saveInitialUploadString="",this.signatureUploadString="",this.initialUploadString="",this.clearUploadString=!1,this.textValue="",this.signatureDrawString="",this.initialDrawString="",this.signatureTextContentTop=.2,this.signatureTextContentLeft=.7,this.saveSignatureString="",this.saveInitialString="",this.saveImageString="",this.signatureFieldCollection=[],this.signatureImageString="",this.initialImageString="",this.maxSaveLimit=5,this.select=function(e){this.canvasTouched&&(this.mouseMoving=!0,this.canvasTouched=!1),e.isSwiped&&"Draw"===this.signaturetype&&this.mouseMoving&&(e.cancel=!0,this.mouseMoving=!1)},this.addStampImage=function(e){var t,i=e.target.files;null!==e.target.files[0]&&"image"===(i=i[0]).type.split("/")[0]&&((t=new FileReader).onload=function(e){var t=document.getElementById(r.pdfViewer.element.id+"_signatureuploadCanvas_"),i=t.getContext("2d"),n=new Image,o=r;n.onload=function(){document.getElementById(r.pdfViewer.element.id+"_e-pv-upload-button").style.visibility="hidden",i.drawImage(n,0,0,t.width,t.height),o.enableCreateButton(!1),o.outputString=n.src,o.signatureImageHeight=n.naturalHeight,o.signatureImageWidth=n.naturalWidth},n.src=e.currentTarget.result,o.outputString=e.currentTarget.result,o.switchTabImageSignature=e.currentTarget.result},t.readAsDataURL(i)),e.target.value="",e.currentTarget.value=""},this.pdfViewer=e,this.pdfViewerBase=t}BRt.prototype.zoomTo=function(e){var t,i=400,n=10,o=this.pdfViewer.minZoom,r=this.pdfViewer.maxZoom;null!=o&&null!=r&&r<o&&(t=r,r=o,o=t),null!=o||null!=r?(null!=o&&void 0!==o&&(n=o),null!=r&&void 0!==r&&(i=r)):(i=400,n=10),e<n?e=n:i<e&&(e=i),this.fitType=null,this.isNotPredefinedZoom=!1,this.isAutoZoom&&this.isInitialLoading?this.pdfViewerBase.onWindowResize():(this.isAutoZoom=!1,this.onZoomChanged(e)),this.isInitialLoading=!1},BRt.prototype.zoomIn=function(){var e,t;(this.fitType||this.isNotPredefinedZoom)&&(je(this.lowerZoomLevel)||(this.zoomLevel=this.lowerZoomLevel),this.fitType=null),this.isNotPredefinedZoom=!1,null!=this.pdfViewer.minZoom||null!=this.pdfViewer.maxZoom?((e=this.pdfViewerBase.customZoomValues.length)<=(t=this.zoomLevel)?t=e:t++,this.zoomLevel=t):8<=this.zoomLevel?this.zoomLevel=8:this.zoomLevel++,this.isAutoZoom=!1,null!=this.pdfViewer.minZoom||null!=this.pdfViewer.maxZoom?this.onZoomChanged(this.pdfViewerBase.customZoomValues[this.zoomLevel]):this.onZoomChanged(this.zoomPercentages[this.zoomLevel])},BRt.prototype.zoomOut=function(){(this.fitType||this.isNotPredefinedZoom)&&(je(this.higherZoomLevel)||(this.zoomLevel=this.higherZoomLevel),this.fitType=null),this.isNotPredefinedZoom=!1,this.zoomLevel<=0?this.zoomLevel=0:this.zoomLevel--,this.isAutoZoom=!1,null!=this.pdfViewer.minZoom||null!=this.pdfViewer.maxZoom?this.onZoomChanged(this.pdfViewerBase.customZoomValues[this.zoomLevel]):this.onZoomChanged(this.zoomPercentages[this.zoomLevel])},BRt.prototype.fitToWidth=function(){this.isAutoZoom=!1;var e=this.calculateFitZoomFactor("fitToWidth");this.onZoomChanged(e)},BRt.prototype.fitToAuto=function(){this.isAutoZoom=!0;var e=this.calculateFitZoomFactor("fitToWidth");this.onZoomChanged(e)},BRt.prototype.fitToPage=function(){var e=this.calculateFitZoomFactor("fitToPage");null!==e&&(this.isAutoZoom=!1,this.onZoomChanged(e),!F.isDevice||this.pdfViewer.enableDesktopMode||this.pdfViewerBase.isWebkitMobile?this.pdfViewerBase.viewerContainer.style.overflowY="auto":this.pdfViewerBase.viewerContainer.style.overflowY="hidden",this.pdfViewerBase.pageSize[this.pdfViewerBase.currentPageNumber-1])&&(this.pdfViewerBase.viewerContainer.scrollTop=this.pdfViewerBase.pageSize[this.pdfViewerBase.currentPageNumber-1].top*this.zoomFactor)},BRt.prototype.calculateFitZoomFactor=function(e){var t,i=this.pdfViewerBase.viewerContainer.getBoundingClientRect().width,n=this.pdfViewerBase.viewerContainer.getBoundingClientRect().height;return 0===i&&0===n&&(i=parseFloat(this.pdfViewer.width.toString()),n=parseFloat(this.pdfViewer.height.toString())),isNaN(n)||isNaN(i)?null:(this.fitType=e,"fitToWidth"===this.fitType?(t=(i-this.scrollWidth)/this.pdfViewerBase.highestWidth,this.isAutoZoom&&(this.fitType=null,1===(t=Math.min(1,t)))&&(this.zoomLevel=2),parseInt((100*t).toString(),10)):(this.isFitToPageMode=!0,e=0,(t=(i-this.scrollWidth-10)/this.pdfViewerBase.highestWidth)<(e=!this.pdfViewerBase.pageSize||1!==this.pdfViewerBase.pageSize.length||je(this.pdfViewerBase.pageSize[0].top)||this.isPinchZoomed?n/this.pdfViewerBase.highestHeight:(n-this.pdfViewerBase.pageSize[0].top)/this.pdfViewerBase.highestHeight)&&(e=t,this.isFitToPageMode=!1),parseInt((100*e).toString(),10)))},BRt.prototype.initiateMouseZoom=function(e,t,i){e=this.positionInViewer(e,t);this.mouseCenterX=e.x,this.mouseCenterY=e.y,this.zoomTo(i)},BRt.prototype.pinchIn=function(){this.fitType=null;var e=this.zoomFactor-this.pinchStep;(e=e<4&&2<e?this.zoomFactor-this.pinchStep:e)<=1.5&&(e=this.zoomFactor-this.pinchStep/1.5),null!=this.pdfViewer.minZoom&&e<this.pdfViewer.minZoom/100?e=this.pdfViewer.minZoom/100:e<.25&&(e=.25),this.isPinchZoomed=!0,this.onZoomChanged(100*e),this.isTapToFitZoom=!0,F.isDevice&&!this.pdfViewer.enableDesktopMode&&100*this.zoomFactor==50&&(e=this.calculateFitZoomFactor("fitToWidth"),this.fitType=null,e<=50)&&this.fitToWidth()},BRt.prototype.pinchOut=function(){this.fitType=null;var e=this.zoomFactor+this.pinchStep;F.isDevice&&!this.pdfViewer.enableDesktopMode||2<e&&(e-=this.pinchStep),null!=this.pdfViewer.maxZoom&&e>this.pdfViewer.maxZoom/100?e=this.pdfViewer.maxZoom/100:4<e&&(e=4),this.isTapToFitZoom=!0,this.isPinchZoomed=!0,this.onZoomChanged(100*e)},BRt.prototype.getZoomLevel=function(e){if(null!=this.pdfViewer.minZoom||null!=this.pdfViewer.maxZoom)for(var t=0,i=this.pdfViewerBase.customZoomValues,n=i.length-1;t<=n;){var o=Math.floor((t+n)/2);if(i[parseInt(o.toString(),10)]===e)return o;i[parseInt(o.toString(),10)]<e?t=o+1:n=o-1}else for(t=0,n=this.zoomPercentages.length-1;t<=n&&(0!==t||0!==n);){o=Math.round((t+n)/2);this.zoomPercentages[parseInt(o.toString(),10)]<=e?t=o+1:this.zoomPercentages[parseInt(o.toString(),10)]>=e&&(n=o-1)}return this.higherZoomLevel=t,this.lowerZoomLevel=n},BRt.prototype.checkZoomFactor=function(){return-1<this.zoomPercentages.indexOf(100*this.zoomFactor)},BRt.prototype.onZoomChanged=function(e){this.isInitialCustomZoomValues&&this.pdfViewerBase.getCustomZoomValues(),e&&(this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.closePopupMenu(),this.previousZoomFactor=this.zoomFactor,this.zoomLevel=this.getZoomLevel(e),this.zoomFactor=this.getZoomFactor(e),this.zoomFactor<=.25?this.pdfViewerBase.isMinimumZoom=!0:this.pdfViewerBase.isMinimumZoom=!1,je(this.pdfViewerBase.viewerContainer)||(!F.isDevice||this.pdfViewer.enableDesktopMode||this.pdfViewerBase.isWebkitMobile?this.pdfViewerBase.viewerContainer.style.overflowY="auto":this.pdfViewerBase.viewerContainer.style.overflowY="hidden"),0<this.pdfViewerBase.pageCount&&(this.previousZoomFactor===this.zoomFactor&&!this.pdfViewerBase.isInitialPageMode||(this.isPinchZoomed?(F.isDevice&&!this.pdfViewer.enableDesktopMode&&(this.pdfViewerBase.mobilePageNoContainer.style.left=this.pdfViewer.element.clientWidth/2-parseFloat(this.pdfViewerBase.mobilePageNoContainer.style.width)/2+"px"),this.responsivePages()):this.magnifyPages()),N||this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.updateZoomButtons(),this.isInitialLoading||this.previousZoomFactor!==this.zoomFactor&&(this.pdfViewer.zoomValue=parseInt((100*this.zoomFactor).toString(),10),this.pdfViewer.fireZoomChange())),this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.updateZoomPercentage(this.zoomFactor),this.isInitialLoading||this.previousZoomFactor!==this.zoomFactor&&(this.pdfViewer.zoomValue=parseInt((100*this.zoomFactor).toString(),10),this.pdfViewer.fireZoomChange()),F.isDevice)&&!this.pdfViewer.enableDesktopMode&&this.isPinchZoomed&&(e=parseInt((100*this.zoomFactor).toString(),10)+"%",this.pdfViewerBase.navigationPane.createTooltipMobile(e))},BRt.prototype.setTouchPoints=function(e,t){e=this.positionInViewer(e,t);this.touchCenterX=e.x,this.touchCenterY=e.y},BRt.prototype.initiatePinchMove=function(e,t,i,n){this.isPinchScrolled=!1,this.isMagnified=!1,this.reRenderPageNumber=this.pdfViewerBase.currentPageNumber;var o=this.positionInViewer((e+i)/2,(t+n)/2);this.touchCenterX=o.x,this.touchCenterY=o.y,this.zoomOverPages(e,t,i,n)},BRt.prototype.magnifyPages=function(){var e=this,t=(this.clearRerenderTimer(),document.querySelectorAll(".e-pv-page-div")),i=t[0].id.split("_pageDiv_")[1],n=t[t.length-1].id.split("_pageDiv_")[1];if(this.previousZoomFactor!==this.zoomFactor||this.pdfViewerBase.isInitialPageMode)for(var o=i;o<=n;o++)this.pdfViewerBase.showPageLoadingIndicator(o,!1);for(o=i;o<=n;o++)this.pdfViewerBase.showPageLoadingIndicator(o,!0);this.isWaitingPopupUpdated=!0,this.isPagesZoomed||(this.reRenderPageNumber=this.pdfViewerBase.currentPageNumber),this.pdfViewerBase.documentLoaded||this.pdfViewerBase.isInitialPageMode||(this.isPagesZoomed=!0);var r,t=this.pdfViewerBase.viewerContainer.scrollTop,i=(this.pdfViewer.textSelectionModule&&this.pdfViewer.textSelectionModule.maintainSelectionOnZoom(!1,!0),!this.pdfViewer.formDesignerModule||this.pdfViewerBase.documentLoaded||this.pdfViewerBase.isDocumentLoaded||(this.isFormFieldPageZoomed=!0),this.isInitialLoading||(this.isMagnified=!0),this.updatePageLocation(),this.resizeCanvas(this.reRenderPageNumber),this.calculateScrollValuesOnMouse(t),this.pdfViewer.textSelectionModule&&this.pdfViewer.textSelectionModule.resizeTouchElements(),this.pdfViewer.annotationModule);i&&i.textMarkupAnnotationModule&&this.pdfViewer.annotationModule.textMarkupAnnotationModule.updateCurrentResizerPosition(),0<this.pdfViewerBase.pageSize.length&&(this.pdfViewerBase.pageContainer.style.height=this.topValue+this.pdfViewerBase.getPageHeight(this.pdfViewerBase.pageSize.length-1)+"px",(r=this).pdfViewerBase.renderedPagesList=[],this.pdfViewerBase.pinchZoomStorage=[],this.pdfViewerBase.documentLoaded||(this.magnifyPageRerenderTimer=setTimeout(function(){r.rerenderMagnifiedPages(),e.pdfViewerBase.showPageLoadingIndicator(e.pdfViewerBase.currentPageNumber-1,!1)},800)))},BRt.prototype.updatePageLocation=function(){this.topValue=0;for(var e=1;e<this.pdfViewerBase.pageSize.length;e++)this.topValue+=(this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].height+this.pdfViewerBase.pageGap)*this.zoomFactor;for(var t=10<this.pdfViewer.initialRenderPages?this.pdfViewer.initialRenderPages<=this.pdfViewerBase.pageCount?this.pdfViewer.initialRenderPages:this.pdfViewerBase.pageCount:this.pdfViewerBase.pageCount<10?this.pdfViewerBase.pageCount:10,e=0;e<t;e++)this.updatePageContainer(e,this.pdfViewerBase.getPageWidth(e),this.pdfViewerBase.getPageHeight(e),this.pdfViewerBase.getPageTop(e),!0)},BRt.prototype.updatePageContainer=function(e,t,i,n,o){var r,s=this.pdfViewerBase.getElement("_pageDiv_"+e);s&&(s.style.width=t+"px",s.style.height=i+"px",(r=this.pdfViewerBase.getElement("_textLayer_"+e))&&(r.style.width=t+"px",r.style.height=i+"px"),s.style.width=t+"px",s.style.height=i+"px",this.pdfViewer.enableRtl?s.style.right=this.pdfViewerBase.updateLeftPosition(e)+"px":s.style.left=this.pdfViewerBase.updateLeftPosition(e)+"px",s.style.top=n+"px",this.pdfViewerBase.pageContainer.style.width=this.pdfViewerBase.viewerContainer.clientWidth+"px",this.pdfViewerBase.renderPageCanvas(s,t,i,e,"block"))},BRt.prototype.clearRerenderTimer=function(){clearTimeout(this.rerenderOnScrollTimer),clearTimeout(this.magnifyPageRerenderTimer),this.clearIntervalTimer(),this.isPinchScrolled=!1},BRt.prototype.clearIntervalTimer=function(){clearInterval(this.rerenderInterval),this.rerenderInterval=null,this.clearRendering();for(var e=document.querySelectorAll('canvas[id*="'+this.pdfViewer.element.id+'_oldCanvas_"]'),t=0;t<e.length;t++){var i=parseInt(e[parseInt(t.toString(),10)].id.split("_oldCanvas_")[1],10),n=this.pdfViewerBase.getElement("_pageCanvas_"+i);n?(e[parseInt(t.toString(),10)].id=n.id,n.parentElement.removeChild(n)):e[parseInt(t.toString(),10)].id=this.pdfViewer.element.id+"_pageCanvas_"+i,this.pdfViewerBase.isTextMarkupAnnotationModule()&&this.pdfViewer.annotationModule.textMarkupAnnotationModule.rerenderAnnotationsPinch(t)}this.isRerenderCanvasCreated=!1},BRt.prototype.pushImageObjects=function(e){je(this.imageObjects)||this.imageObjects&&this.imageObjects.push(e)},BRt.prototype.clearRendering=function(){if(this.imageObjects){for(var e=0;e<this.imageObjects.length;e++)this.imageObjects[parseInt(e.toString(),10)]&&(this.imageObjects[parseInt(e.toString(),10)].onload=null,this.imageObjects[parseInt(e.toString(),10)].onerror=null);this.imageObjects=[]}},BRt.prototype.rerenderMagnifiedPages=function(){!this.pdfViewerBase.isInitialLoaded&&!this.pdfViewerBase.isDocumentLoaded||this.pdfViewerBase.isInitialPageMode?this.pdfViewerBase.isInitialPageMode&&(this.pageRerenderCount=0,this.pdfViewerBase.renderedPagesList=[],this.pdfViewerBase.pinchZoomStorage=[],this.isMagnified=!1,this.pdfViewerBase.pageViewScrollChanged(this.reRenderPageNumber),this.pdfViewerBase.isInitialPageMode=!1):(this.renderInSeparateThread(this.reRenderPageNumber),this.isPagesZoomed=!1)},BRt.prototype.renderInSeparateThread=function(e){var t=this,i=(this.designNewCanvas(e),this.pageRerenderCount=0,this.pdfViewerBase.renderedPagesList=[],this.pdfViewerBase.pinchZoomStorage=[],this.isMagnified=!1,this.pdfViewerBase.pageViewScrollChanged(this.pdfViewerBase.currentPageNumber),this);this.rerenderInterval=setInterval(function(){t.initiateRerender(i)},1)},BRt.prototype.responsivePages=function(){this.isPagesZoomed=!0,this.clearRerenderTimer(),this.pdfViewer.textSelectionModule&&this.pdfViewer.textSelectionModule.clearTextSelection(),this.pdfViewer.textSearchModule&&this.pdfViewer.textSearchModule.clearAllOccurrences();var e,t=this.pdfViewerBase.viewerContainer.scrollTop;this.isAutoZoom=!1,this.updatePageLocation(),this.pdfViewerBase.pageContainer.style.height=this.topValue+this.pdfViewerBase.pageSize[this.pdfViewerBase.pageSize.length-1].height*this.zoomFactor+"px",this.resizeCanvas(this.pdfViewerBase.currentPageNumber),this.pdfViewerBase.textLayer&&this.pdfViewer.formDesignerModule&&this.pdfViewerBase.textLayer.clearTextLayers(!0),this.isPinchZoomed&&this.calculateScrollValues(t),this.pdfViewerBase.renderedPagesList=[],this.pdfViewerBase.pinchZoomStorage=[],!this.pdfViewer.formFieldsModule||this.pdfViewer.formDesignerModule||(e=this).pdfViewerBase.documentLoaded||(this.magnifyPageRerenderTimer=setTimeout(function(){e.rerenderMagnifiedPages()},800))},BRt.prototype.calculateScrollValues=function(e){var t,i,n,o=this.pdfViewerBase.currentPageNumber-1,o=this.pdfViewerBase.getElement("_pageDiv_"+o);o&&(n=void 0,o=o.getBoundingClientRect(),t=(n=this.pdfViewer.enableRtl&&!this.isDoubleTapZoom?this.positionInViewer(o.right,o.top):this.positionInViewer(o.left,o.top)).x,i=(n=n.y)*this.previousZoomFactor,e=e+this.touchCenterY,n=n*this.zoomFactor+(e-i<0?e-i:(e-i)*(this.zoomFactor/this.previousZoomFactor)),e=0<this.zoomFactor-this.previousZoomFactor?-this.pdfViewerBase.pageGap*(this.zoomFactor/this.previousZoomFactor):this.pdfViewerBase.pageGap*(this.previousZoomFactor/this.zoomFactor),this.pdfViewerBase.viewerContainer.scrollTop=n-this.touchCenterY+e/this.pdfViewerBase.zoomInterval,i=o.width*this.previousZoomFactor/o.width,n=this.zoomFactor/i-1,e=this.touchCenterX-t,this.pdfViewerBase.isMixedSizeDocument&&this.pdfViewerBase.highestWidth*this.pdfViewerBase.getZoomFactor()>this.pdfViewerBase.viewerContainer.clientWidth?this.pdfViewerBase.viewerContainer.scrollLeft=(this.pdfViewerBase.pageContainer.offsetWidth-this.pdfViewerBase.viewerContainer.clientWidth)/2:this.pdfViewerBase.viewerContainer.scrollLeft+=e*n)},BRt.prototype.calculateScrollValuesOnMouse=function(e){var t,i,n,o=this.pdfViewerBase.currentPageNumber-1,o=this.pdfViewerBase.getElement("_pageDiv_"+o);o&&(n=void 0,o=o.getBoundingClientRect(),t=(n=this.pdfViewer.enableRtl?this.positionInViewer(o.right,o.top):this.positionInViewer(o.left,o.top)).x,i=(n=n.y)*this.previousZoomFactor,e=e+this.mouseCenterY,n=n*this.zoomFactor+(e-i)*(this.zoomFactor/this.previousZoomFactor),e=this.pdfViewerBase.pageGap*(this.zoomFactor/this.previousZoomFactor),this.pdfViewerBase.isTouchPad&&!this.pdfViewerBase.isMacSafari&&(e/=this.pdfViewerBase.zoomInterval),this.pdfViewerBase.viewerContainer.scrollTop=n-this.mouseCenterY+(e=0==n?0:e),i=o.width*this.previousZoomFactor/o.width,n=this.zoomFactor/i-1,e=this.mouseCenterX-t,!(this.pdfViewerBase.isMixedSizeDocument&&this.pdfViewerBase.highestWidth*this.pdfViewerBase.getZoomFactor()>this.pdfViewerBase.viewerContainer.clientWidth)&&(o=document.getElementById(this.pdfViewerBase.pageContainer.id))&&o.children&&o.children[0].clientWidth>this.pdfViewer.viewerBase.viewerContainer.clientWidth?this.pdfViewerBase.viewerContainer.scrollLeft+=e*n:this.pdfViewerBase.viewerContainer.scrollLeft=(this.pdfViewerBase.pageContainer.offsetWidth-this.pdfViewerBase.viewerContainer.clientWidth)/2)},BRt.prototype.rerenderOnScroll=function(){var e=this;if(this.isPinchZoomed=!1,this.isPinchScrolled){this.rerenderOnScrollTimer=null,this.isPinchScrolled=!1,this.reRenderPageNumber=this.pdfViewerBase.currentPageNumber,this.pdfViewerBase.renderedPagesList=[],this.pdfViewerBase.pinchZoomStorage=[];for(var t=document.querySelectorAll('img[id*="'+this.pdfViewer.element.id+'_pageCanvas_"]'),i=0;i<t.length;i++){var n=parseInt(t[parseInt(i.toString(),10)].id.split("_pageCanvas_")[1],10),o=this.pdfViewerBase.pageSize[parseInt(n.toString(),10)].width;816<o&&this.pdfViewer.tileRenderingSettings.enableTileRendering&&(this.pdfViewer.restrictZoomRequest,t[parseInt(i.toString(),10)].style.width=o*this.pdfViewerBase.getZoomFactor()+"px",t[parseInt(i.toString(),10)].style.height=this.pdfViewerBase.pageSize[parseInt(n.toString(),10)].height*this.pdfViewerBase.getZoomFactor()+"px")}if(this.pdfViewerBase.textLayer)for(var r=document.querySelectorAll('div[id*="'+this.pdfViewer.element.id+'_textLayer_"]'),i=0;i<r.length;i++)r[parseInt(i.toString(),10)].style.display="none";if(this.pdfViewerBase.isTextMarkupAnnotationModule())for(var s=document.querySelectorAll('canvas[id*="'+this.pdfViewer.element.id+'_annotationCanvas_"]'),a=0;a<s.length;a++){n=s[parseInt(a.toString(),10)].id.split("_annotationCanvas_")[1];this.pdfViewer.annotationModule.textMarkupAnnotationModule.rerenderAnnotationsPinch(parseInt(n,10))}if(F.isDevice)if(this.pdfViewer.formDesignerModule)for(var l=this.pdfViewer.currentPageNumber,h=this.pdfViewer.formFieldCollection.filter(function(e){return e.pageNumber===l}),i=0;i<h.length;i++)document.querySelectorAll("[id^="+h[parseInt(i.toString(),10)].id+"]").forEach(function(e){return e.style.display="none"});else document.querySelectorAll('[id^="pdfViewerinput_"]').forEach(function(e){return e.parentElement.style.display="none"});if(this.pdfViewerBase.pageViewScrollChanged(this.reRenderPageNumber),this.isPagePinchZoomed=!1,this.rerenderOnScrollTimer=setTimeout(function(){e.pdfViewerBase.pageViewScrollChanged(e.reRenderPageNumber)},300),this.pdfViewerBase.textLayer)for(r=document.querySelectorAll('div[id*="'+this.pdfViewer.element.id+'_textLayer_"]'),i=0;i<r.length;i++)r[parseInt(i.toString(),10)].style.display="block"}},BRt.prototype.pinchMoveScroll=function(){var e=this;this.isRerenderCanvasCreated&&this.clearIntervalTimer(),(this.isPagesZoomed||!this.isRerenderCanvasCreated&&this.isPagePinchZoomed)&&(this.clearRendering(),this.isPagesZoomed=!1,clearTimeout(this.magnifyPageRerenderTimer),this.isPinchScrolled=!0,this.isFormFieldPageZoomed=!0,this.rerenderOnScrollTimer=setTimeout(function(){e.rerenderOnScroll()},100))},BRt.prototype.initiateRerender=function(e){var t=!1;(this.previousZoomFactor<.4||this.pdfViewerBase.isMinimumZoom)&&(t=!0),e.pageRerenderCount!==e.pdfViewerBase.reRenderedCount&&!t||0===e.pageRerenderCount||0===e.pdfViewerBase.reRenderedCount||(e.reRenderAfterPinch(this.reRenderPageNumber),e.isFormFieldPageZoomed=!1)},BRt.prototype.reRenderAfterPinch=function(e){this.pageRerenderCount=0;var t=e-3,i=e+1;this.pdfViewerBase.isMinimumZoom&&(t=e-4,i=e+4);for(var t=0<t?t:0,i=i<this.pdfViewerBase.pageCount?i:this.pdfViewerBase.pageCount-1,n=t;n<=i;n++){var o=this.pdfViewerBase.getElement("_pageDiv_"+n),r=this.pdfViewerBase.getElement("_oldCanvas_"+n);r&&(r.onload=null,r.onerror=null,r.parentNode.removeChild(r)),this.pdfViewerBase.isTextMarkupAnnotationModule()?this.pdfViewer.annotationModule.textMarkupAnnotationModule.rerenderAnnotations(n):this.pdfViewer.formDesignerModule&&(this.rerenderAnnotations(n),this.pdfViewer.renderDrawing(void 0,e)),o&&(o.style.visibility="visible")}this.isRerenderCanvasCreated=!1,this.isPagePinchZoomed=!1,0!==this.pdfViewerBase.reRenderedCount&&(this.pdfViewerBase.reRenderedCount=0,this.pageRerenderCount=0,clearInterval(this.rerenderInterval),this.rerenderInterval=null),this.imageObjects=[]},BRt.prototype.rerenderAnnotations=function(t){for(var i=this,e=document.querySelectorAll("#"+this.pdfViewer.element.id+"_old_annotationCanvas_"+t),n=0;n<e.length;n++)e[parseInt(n.toString(),10)]&&e[parseInt(n.toString(),10)].parentElement.removeChild(e[parseInt(n.toString(),10)]);["_annotationCanvas_","_blendAnnotationsIntoCanvas_"].forEach(function(e){i.pdfViewerBase.getElement(""+e+t).style.setProperty("display","block")})},BRt.prototype.designNewCanvas=function(e){this.pdfViewerBase.textLayer&&this.pdfViewerBase.textLayer.clearTextLayers();var t=e-3,i=e+1;this.pdfViewerBase.isMinimumZoom&&(t=e-4,i=e+4);for(var n,o,r,t=0<t?t:0,i=i<this.pdfViewerBase.pageCount?i:this.pdfViewerBase.pageCount-1,s=t;s<=i;s++)this.pdfViewerBase.pageSize[parseInt(s.toString(),10)]&&(n=this.pdfViewerBase.getElement("_pageCanvas_"+s),o=this.pdfViewerBase.pageSize[parseInt(s.toString(),10)].width*this.zoomFactor,r=this.pdfViewerBase.pageSize[parseInt(s.toString(),10)].height*this.zoomFactor,(!n||this.pdfViewer.restrictZoomRequest)&&this.pdfViewer.restrictZoomRequest||this.pdfViewerBase.renderPageCanvas(this.pdfViewerBase.getElement("_pageDiv_"+s),o,r,s,"none"));this.isRerenderCanvasCreated=!0},BRt.prototype.pageRerenderOnMouseWheel=function(){var e=this;this.isRerenderCanvasCreated&&(this.clearIntervalTimer(),clearTimeout(this.magnifyPageRerenderTimer),this.isPinchScrolled||(this.isPinchScrolled=!0,this.rerenderOnScrollTimer=setTimeout(function(){e.rerenderOnScroll()},100)))},BRt.prototype.renderCountIncrement=function(){this.isRerenderCanvasCreated&&this.pageRerenderCount++},BRt.prototype.rerenderCountIncrement=function(){0<this.pageRerenderCount&&this.pdfViewerBase.reRenderedCount++},BRt.prototype.resizeCanvas=function(e){var t,i=this.pdfViewer.annotationModule,n=(i&&i.inkAnnotationModule&&""!==i.inkAnnotationModule.outputString&&(i.inkAnnotationModule.inkPathDataCollection.push({pathData:i.inkAnnotationModule.outputString,zoomFactor:i.inkAnnotationModule.inkAnnotationInitialZoom}),i.inkAnnotationModule.outputString=""),i&&i.freeTextAnnotationModule&&(t={x:i.freeTextAnnotationModule.currentPosition[0],y:i.freeTextAnnotationModule.currentPosition[1],width:i.freeTextAnnotationModule.currentPosition[2],height:i.freeTextAnnotationModule.currentPosition[3]},i.freeTextAnnotationModule.addInputInZoom(t)),e-3),o=e+3;this.pdfViewerBase.isMinimumZoom&&(n=e-4,o=e+4);for(var o=this.pdfViewer.initialRenderPages>this.pdfViewerBase.pageRenderCount?(n=0,o<this.pdfViewer.initialRenderPages?this.pdfViewer.initialRenderPages<=this.pdfViewerBase.pageCount?this.pdfViewer.initialRenderPages:this.pdfViewerBase.pageCount:o<this.pdfViewerBase.pageCount?o:this.pdfViewerBase.pageCount-1):(n=0<n?n:0,o<this.pdfViewerBase.pageCount?o:this.pdfViewerBase.pageCount-1),r=n;r<=o;r++){var s=this.pdfViewerBase.getElement("_pageDiv_"+r);document.getElementById(this.pdfViewer.element.id+"_textLayer_"+r);if(s&&n<=r&&r<=o)if(this.pdfViewer.textSelectionModule&&this.pdfViewer.textSelectionModule.isSelectionAvailableOnScroll(r),null!=this.pdfViewerBase.pageSize[parseInt(r.toString(),10)]){var a=this.pdfViewerBase.pageSize[parseInt(r.toString(),10)].width*this.zoomFactor,l=this.pdfViewerBase.pageSize[parseInt(r.toString(),10)].height*this.zoomFactor,h=(s.style.width=a+"px",s.style.height=l+"px",s.style.top=this.pdfViewerBase.pageSize[parseInt(r.toString(),10)].top*this.zoomFactor+"px",this.pdfViewer.enableRtl?s.style.right=this.pdfViewerBase.updateLeftPosition(r)+"px":s.style.left=this.pdfViewerBase.updateLeftPosition(r)+"px",this.pdfViewerBase.getElement("_pageCanvas_"+r)),d=(h&&(h.style.width=a+"px",h.style.height=l+"px",this.pdfViewer.annotation?this.pdfViewer.annotationModule.resizeAnnotations(a,l,r):this.pdfViewer.formDesignerModule&&this.pdfViewer.formDesignerModule.resizeAnnotations(a,l,r)),this.pdfViewerBase.retrieveCurrentZoomFactor()),p=void 0,c=void 0,p=c=this.pdfViewerBase.getTileCount(this.pdfViewerBase.pageSize[parseInt(r.toString(),10)].width,this.pdfViewerBase.pageSize[parseInt(r.toString(),10)].height),u=this.pdfViewer.tileRenderingSettings;if(u.enableTileRendering&&0<u.x&&0<u.y&&(1200<this.pdfViewerBase.pageSize[parseInt(r.toString(),10)].width||2<this.pdfViewerBase.getZoomFactor())&&(p=u.x,c=u.y),1==p*c){u=void 0;if(u=this.pdfViewerBase.clientSideRendering?this.pdfViewerBase.getWindowSessionStorage(r,d)?this.pdfViewerBase.getWindowSessionStorage(r,d):this.pdfViewerBase.getPinchZoomPage(r):this.pdfViewerBase.getLinkInformation(r)?this.pdfViewerBase.getLinkInformation(r):this.pdfViewerBase.getWindowSessionStorage(r,d)){if(T=(u=this.pdfViewerBase.clientSideRendering&&"object"==typeof u?u:JSON.parse(u)).image){h.src=T,h.style.display="block";for(var g=document.querySelectorAll('img[id*="'+this.pdfViewer.element.id+"_tileimg_"+r+'_"]'),m=this.pdfViewerBase.getElement("_pageDiv_"+r),f=0;f<g.length;f++){var y=g[parseInt(f.toString(),10)].id.split("_");parseFloat(y[y.length-3])!==this.pdfViewerBase.getZoomFactor()&&(g[parseInt(f.toString(),10)].onload=null,g[parseInt(f.toString(),10)].onerror=null,m.removeChild(g[parseInt(f.toString(),10)]))}for(var v=document.querySelectorAll('img[id*="'+this.pdfViewer.element.id+'_oldCanvas"]'),b=0;b<v.length;b++)v[parseInt(b.toString(),10)].onload=null,v[parseInt(b.toString(),10)].onerror=null,s.removeChild(v[parseInt(b.toString(),10)])}this.pdfViewerBase.isReRenderRequired=!1}else this.pdfViewerBase.isReRenderRequired=!0}else{for(var g=document.querySelectorAll('img[id*="'+this.pdfViewer.element.id+"_tileimg_"+r+'_"]'),w=0;w<g.length;w++){var C,S,A,x,I,T,y=g[parseInt(w.toString(),10)].id.split("_"),E=parseFloat(y[y.length-2]),D=parseFloat(y[y.length-1]),M=this.pdfViewerBase.clientSideRendering?JSON.parse(this.pdfViewerBase.getStoredTileImageDetails(r,E,D,d)):JSON.parse(this.pdfViewerBase.getWindowSessionStorageTile(r,E,D,d));M&&M.zoomFactor&&(d=M.zoomFactor),parseFloat(y[y.length-4])===r&&(h.style.display="none",(C=g[parseInt(w.toString(),10)]).nodeType===Node.ELEMENT_NODE)&&(S=1.5,je(M)||(S=je(M.scaleFactor)?1.5:M.scaleFactor),x=this.pdfViewerBase.pageSize[parseInt(r.toString(),10)].width*d*S/p,I=this.pdfViewerBase.pageSize[parseInt(r.toString(),10)].height*d*S/c,A=x,x=parseFloat(y[y.length-2])*x,I=parseFloat(y[y.length-1])*I,C.width=A*this.pdfViewerBase.getZoomFactor()/d/S,C.style.width=A*this.pdfViewerBase.getZoomFactor()/d/S+"px",C.style.left=x*this.pdfViewerBase.getZoomFactor()/d/S+"px",C.style.top=I*this.pdfViewerBase.getZoomFactor()/d/S+"px",C.id=this.pdfViewer.element.id+"_tileimg_"+r+"_"+this.pdfViewerBase.getZoomFactor()+"_"+E+"_"+D,M?((T=M.image)&&(C.src=T),this.pdfViewerBase.isReRenderRequired=!1):this.pdfViewerBase.isReRenderRequired=!0)}0===g.length&&(this.pdfViewerBase.isReRenderRequired=!0)}var k,u=xvt(this.pdfViewer.element.id+"_textLayer_"+r);u&&((k=xvt(this.pdfViewer.element.id+r+"_diagramAdorner_svg"))&&(k.style.width=a+"px",k.style.height=l+"px"),(k=xvt(this.pdfViewer.element.id+r+"_diagramAdornerLayer"))&&(k.style.width=a+"px",k.style.height=l+"px"),u.style.width=a+"px",u.style.height=l+"px",this.pdfViewer.renderSelector(r,this.pdfViewer.annotationSelectorSettings),this.pdfViewerBase.applyElementStyles(k,r))}}},BRt.prototype.zoomOverPages=function(e,t,i,n){e=Math.sqrt(Math.pow(e-i,2)+Math.pow(t-n,2));-1<this.previousTouchDifference&&(e>this.previousTouchDifference?(this.pinchStep=this.getPinchStep(e,this.previousTouchDifference),this.pinchOut()):e<this.previousTouchDifference&&(this.pinchStep=this.getPinchStep(this.previousTouchDifference,e),this.pinchIn())),this.previousTouchDifference=e},BRt.prototype.pinchMoveEnd=function(){this.touchCenterX=0,this.touchCenterY=0,this.previousTouchDifference=-1,this.isPinchZoomed&&(this.isPinchScrolled=!1,this.isPagePinchZoomed=!0,this.pinchMoveScroll())},BRt.prototype.fitPageScrollMouseWheel=function(e){"fitToPage"===this.fitType&&(this.isMagnified=!1,e.preventDefault(),0<e.deltaY?this.downwardScrollFitPage(this.pdfViewerBase.currentPageNumber-1):this.upwardScrollFitPage(this.pdfViewerBase.currentPageNumber-1))},BRt.prototype.magnifyBehaviorKeyDown=function(e){var t=!!navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i)&&e.metaKey;switch((e.ctrlKey||t)&&"Equal"===e.code&&(e.preventDefault(),this.zoomIn()),(e.ctrlKey||t)&&"Minus"===e.code&&(e.preventDefault(),this.zoomOut()),e.keyCode){case 37:e.ctrlKey||t?(e.preventDefault(),this.pdfViewerBase.updateScrollTop(0)):this.focusOnViewerContainer()&&this.formElementcheck()&&(e.preventDefault(),this.upwardScrollFitPage(this.pdfViewerBase.currentPageNumber-1));break;case 38:case 33:e.ctrlKey||t?(e.preventDefault(),this.pdfViewerBase.updateScrollTop(0)):"fitToPage"!==this.fitType||(e.ctrlKey||t)&&e.shiftKey||(e.preventDefault(),this.upwardScrollFitPage(this.pdfViewerBase.currentPageNumber-1));break;case 39:e.ctrlKey||t?(e.preventDefault(),this.pdfViewerBase.updateScrollTop(this.pdfViewerBase.pageCount-1)):this.focusOnViewerContainer()&&this.formElementcheck()&&(e.preventDefault(),this.downwardScrollFitPage(this.pdfViewerBase.currentPageNumber-1));break;case 40:case 34:e.ctrlKey||t?(e.preventDefault(),this.pdfViewerBase.updateScrollTop(this.pdfViewerBase.pageCount-1)):"fitToPage"!==this.fitType||(e.ctrlKey||t)&&e.shiftKey||(e.preventDefault(),this.downwardScrollFitPage(this.pdfViewerBase.currentPageNumber-1));break;case 48:!e.ctrlKey&&!t||e.shiftKey||e.altKey||(e.preventDefault(),this.fitToPage());break;case 49:!e.ctrlKey&&!t||e.shiftKey||e.altKey||(e.preventDefault(),this.zoomTo(100))}},BRt.prototype.formElementcheck=function(){var e=event.target;return e.offsetParent&&0<e.offsetParent.classList.length&&!e.offsetParent.classList.contains("foreign-object")},BRt.prototype.focusOnViewerContainer=function(){var e=document.activeElement;return document.querySelector(".e-pv-viewer-container").contains(e)},BRt.prototype.upwardScrollFitPage=function(e){var t;0<e&&(t=this.pdfViewerBase.getElement("_pageDiv_"+(e-1)))&&(t.style.visibility="visible",this.pdfViewerBase.viewerContainer.scrollTop=this.pdfViewerBase.pageSize[e-1].top*this.zoomFactor,this.isFitToPageMode)&&(t=this.pdfViewerBase.getElement("_pageDiv_"+e))&&(t.style.visibility="hidden")},BRt.prototype.updatePagesForFitPage=function(e){"fitToPage"===this.fitType&&this.isFitToPageMode&&(0<e&&this.pdfViewerBase.getElement("_pageDiv_"+(e-1))&&(this.pdfViewerBase.getElement("_pageDiv_"+(e-1)).style.visibility="hidden"),e<this.pdfViewerBase.pageCount-1)&&this.pdfViewerBase.getElement("_pageDiv_"+(e+1))&&(this.pdfViewerBase.getElement("_pageDiv_"+(e+1)).style.visibility="hidden")},BRt.prototype.onDoubleTapMagnification=function(){var e,t=this,i=(this.pdfViewer.toolbarModule&&N&&this.pdfViewer.toolbarModule.showToolbar(!0),this.pdfViewerBase.viewerContainer.scrollTop);this.pdfViewer.selectedItems.annotations[0]?N&&this.pdfViewer.selectedItems.annotations[0]&&"FreeText"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&((e={}).x=this.pdfViewer.selectedItems.annotations[0].bounds.x,e.y=this.pdfViewer.selectedItems.annotations[0].bounds.y,this.pdfViewer.annotation.freeTextAnnotationModule.addInuptElemet(e,this.pdfViewer.selectedItems.annotations[0])):(this.isDoubleTapZoom=!0,!this.isTapToFitZoom&&this.zoomFactor<2?this.zoomTo(200):this.fitToWidth(),this.calculateScrollValues(i),this.isTapToFitZoom=!this.isTapToFitZoom,setTimeout(function(){t.isMagnified=!1},500),this.isDoubleTapZoom=!1)},BRt.prototype.downwardScrollFitPage=function(e){var t,i;e!==this.pdfViewerBase.pageCount-1&&((t=this.pdfViewerBase.getElement("_pageDiv_"+(e+1)))&&(t.style.visibility="visible"),this.pdfViewerBase.viewerContainer.scrollTop=this.pdfViewerBase.pageSize[e+1].top*this.zoomFactor,this.isFitToPageMode)&&(t=this.pdfViewerBase.getElement("_pageDiv_"+e),i=this.pdfViewerBase.getElement("_pageDiv_"+(e+2)),e+1===this.pdfViewerBase.pageCount-1?t&&(t.style.visibility="hidden"):i&&(i.style.visibility="hidden"))},BRt.prototype.getMagnifiedValue=function(e){return e/this.previousZoomFactor*this.zoomFactor},BRt.prototype.destroy=function(){this.imageObjects=void 0},BRt.prototype.getZoomFactor=function(e){return e/100},BRt.prototype.getModuleName=function(){return"Magnification"},BRt.prototype.getPinchStep=function(e,t){e=(e-t)/100;return e<.02?e=.02:1<e&&(e=.1),e},BRt.prototype.zoomToRect=function(e){var t,i,n,o,r,s=this.pdfViewerBase,a=s.viewerContainer,l=this.pdfViewer;0<e.width&&0<e.height&&(t={x:e.x,y:e.y},0<(t=l.getPageNumberFromClientPoint(t)))&&(r=(r=a.getBoundingClientRect().width/e.width)<(o=a.getBoundingClientRect().height/e.height)?r:o,o=100*s.getZoomFactor(),i=a.scrollTop,n=a.scrollLeft,this.zoomTo(o*r),a.scrollTop=i,a.scrollLeft=n,o=s.getZoomFactor(),r={x:e.x,y:e.y},r=l.convertClientPointToPagePoint(r,t),s.updateScrollTop(t-1),a.scrollLeft=(r.x-n)*o,a.scrollTop=(r.y+s.pageSize[t-1].top-i)*o)},BRt.prototype.positionInViewer=function(e,t){var i=this.pdfViewerBase.mainContainer.getBoundingClientRect();return{x:e-i.left,y:t-i.top}};vft=BRt;function BRt(e,t){this.zoomFactor=1,this.previousZoomFactor=1,this.scrollWidth=25,this.zoomPercentages=[10,25,50,75,100,125,150,200,400],this.isNotPredefinedZoom=!1,this.pinchStep=0,this.reRenderPageNumber=0,this.magnifyPageRerenderTimer=null,this.rerenderOnScrollTimer=null,this.rerenderInterval=null,this.touchCenterX=0,this.touchCenterY=0,this.mouseCenterX=0,this.mouseCenterY=0,this.pageRerenderCount=0,this.imageObjects=[],this.topValue=0,this.isTapToFitZoom=!1,this.isWaitingPopupUpdated=!1,this.isInitialCustomZoomValues=!0,this.fitType=null,this.isPinchZoomed=!1,this.isPagePinchZoomed=!1,this.isRerenderCanvasCreated=!1,this.isMagnified=!1,this.isPagesZoomed=!1,this.isPinchScrolled=!1,this.isAutoZoom=!1,this.isDoubleTapZoom=!1,this.isFormFieldPageZoomed=!1,this.isWebkitMobile=!1,this.isFitToPageMode=!0,this.pdfViewer=e,this.pdfViewerBase=t,this.zoomLevel=2}FRt.prototype.goToNextPage=function(){this.pageNumber=this.pdfViewerBase.currentPageNumber,this.pageNumber++,this.pageNumber<=this.pdfViewerBase.pageCount&&this.pdfViewerBase.updateScrollTop(this.pageNumber-1)},FRt.prototype.goToPreviousPage=function(){this.pageNumber=this.pdfViewerBase.currentPageNumber,this.pageNumber--,0<this.pageNumber&&this.pdfViewerBase.updateScrollTop(this.pageNumber-1)},FRt.prototype.goToPage=function(e){0<e&&e<=this.pdfViewerBase.pageCount&&this.pdfViewerBase.currentPageNumber!==e&&(this.pdfViewerBase.updateScrollTop(e-1),this.pdfViewer.enableThumbnail)&&this.pdfViewer.thumbnailViewModule&&this.pdfViewer.thumbnailViewModule.updateScrollTopForThumbnail(e-1),this.pdfViewer.magnificationModule&&this.pdfViewer.magnificationModule.resizeCanvas(e);e=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+(e-1));e&&(e.style.display="block")},FRt.prototype.goToFirstPage=function(){this.pageNumber=0,this.pdfViewerBase.updateScrollTop(this.pageNumber)},FRt.prototype.goToLastPage=function(){this.pageNumber=this.pdfViewerBase.pageCount-1,this.pdfViewerBase.updateScrollTop(this.pageNumber)},FRt.prototype.destroy=function(){this.pageNumber=0},FRt.prototype.getModuleName=function(){return"Navigation"};Rft=FRt;function FRt(e,t){this.pdfViewer=e,this.pdfViewerBase=t}LRt.prototype.createThumbnailContainer=function(){this.thumbnailView=Q("div",{id:this.pdfViewer.element.id+"_thumbnail_view",className:"e-pv-thumbnail-view e-pv-thumbnail-row"}),this.pdfViewerBase.navigationPane.sideBarContent.appendChild(this.thumbnailView),this.pdfViewerBase.navigationPane.sideBarContent.addEventListener("scrollend",this.thumbnailOnScroll)},LRt.prototype.openThumbnailPane=function(){this.pdfViewerBase.navigationPane&&this.pdfViewerBase.navigationPane.openThumbnailPane()},LRt.prototype.closeThumbnailPane=function(){this.pdfViewerBase.navigationPane&&this.pdfViewerBase.navigationPane.closeThumbnailPane()},LRt.prototype.createRequestForThumbnails=function(){for(var e,t=this,i=t.thumbnailLimit=0;i<t.pdfViewer.pageCount;i++)t.renderThumbnailEmptyPage(i);t.pdfViewer.isThumbnailViewOpen&&(this.isThubmnailOpen=!0,t.pdfViewerBase.navigationPane&&t.pdfViewerBase.navigationPane.sideBarTitle&&(t.pdfViewerBase.navigationPane.sideBarTitle.textContent=t.pdfViewer.localeObj.getConstant("Page Thumbnails")),document.getElementById(t.pdfViewer.element.id+"_thumbnail_view")&&(document.getElementById(t.pdfViewer.element.id+"_thumbnail_view").style.display="flex"),(e=t.pdfViewer.element.querySelector(".e-pv-bookmark-view"))&&(e.style.display="none"),t.pdfViewerBase.navigationPane.updateViewerContainerOnExpand(),this.isThubmnailOpen=!1,t.pdfViewerBase.navigationPane.isBookmarkOpen=!1),this.createRequestForThumbnailImages()},LRt.prototype.isThumbnailViewOpen=function(){var e=this;e.pdfViewer.isThumbnailViewOpen&&(e.pdfViewerBase.navigationPane.setThumbnailSelectionIconTheme(),e.pdfViewerBase.navigationPane.isThumbnailOpen=!0,this.pdfViewerBase.navigationPane.sideBarContentContainer.style.display="block",this.pdfViewer.enableRtl?e.pdfViewerBase.viewerContainer.style.right=this.pdfViewerBase.navigationPane.getViewerContainerLeft()+"px":e.pdfViewerBase.viewerContainer.style.left=this.pdfViewerBase.navigationPane.getViewerContainerLeft()+"px",e.pdfViewerBase.viewerContainer.style.width=e.pdfViewer.element.clientWidth-this.pdfViewerBase.navigationPane.getViewerContainerLeft()-this.pdfViewerBase.navigationPane.getViewerContainerRight()+"px",e.pdfViewerBase.pageContainer.style.width=e.pdfViewerBase.viewerContainer.clientWidth+"px",e.pdfViewerBase.updateZoomValue())},LRt.prototype.thumbnailsRequestedForPage=function(e){for(var t=0,i=this.list;t<i.length;t++)if(e===i[t])return!0;return!1},LRt.prototype.updateScrollTopForThumbnail=function(e){var t=this,i=this.thumbnailRequestsBatch,e=Math.floor((e+1)/i)*i;[e,e-i,e+i,this.pdfViewer.thumbnailViewModule.thumbnailLimit].forEach(function(e){e<0||t.thumbnailsRequestedForPage(e)||t.renderThumbnailImage(null,e)})},LRt.prototype.renderThumbnailEmptyPage=function(e){var t,i,n,o;this.thumbnailView&&(t=Q("a",{id:"page_"+e,attrs:{"aria-label":"Thumbnail of Page"+(e+1),tabindex:"-1",role:"link"},className:"e-pv-thumbnail-anchor-node"}),i=Q("div",{id:this.pdfViewer.element.id+"_thumbnail_"+e,className:"e-pv-thumbnail e-pv-thumbnail-column"}),this.thumbnailSelectionRing=Q("div",{id:this.pdfViewer.element.id+"_thumbnail_Selection_Ring_"+e,className:"e-pv-thumbnail-selection-ring"}),i.appendChild(this.thumbnailSelectionRing),(o=Q("div",{id:this.pdfViewer.element.id+"_thumbnail_pagenumber_"+e,className:"e-pv-thumbnail-number"})).textContent=(e+1).toString(),i.appendChild(o),n=180,this.thumbnailImage=Q("img",{id:this.pdfViewer.element.id+"_thumbnail_image_"+e,className:"e-pv-thumbnail-image"}),this.pdfViewerBase.pageSize[parseInt(e.toString(),10)]&&this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].height<this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].width&&(this.thumbnailImage.style.height="86px",this.thumbnailImage.style.width="126px",i.style.height="100px",i.style.width="140px",o.style.left="18px",t.style.marginRight="41px",i.style.marginLeft="-5px",i.style.marginRight="0px",n=140),o=(0!==e&&(this.thumbnailTop=this.thumbnailPageSize[e-1].top+this.thumbnailPageSize[e-1].height),{height:n,top:this.thumbnailTop}),this.thumbnailPageSize[parseInt(e.toString(),10)]=o,this.thumbnailSelectionRing.appendChild(this.thumbnailImage),t.appendChild(i),this.thumbnailView.appendChild(t),this.wireUpEvents(),0===e&&this.setMouseFocusToFirstPage(),this.pdfViewerBase.navigationPane.enableThumbnailButton())},LRt.prototype.renderViewPortThumbnailImage=function(e){var t=e||this;if(t.startIndex=t.thumbnailLimit,this.list.push(t.startIndex),this.pdfViewerBase.pageSize.length!==this.pdfViewerBase.pageCount||this.isRendered||this.renderDiv(),t.thumbnailLimit=t.startIndex+t.thumbnailThreshold<t.pdfViewer.pageCount?t.startIndex+t.thumbnailThreshold:t.pdfViewer.pageCount,this.pdfViewerBase.clientSideRendering){for(var i=t.startIndex;i<t.thumbnailLimit;i++){var n=this.getThumbnailImageElement(i),o={documentId:t.pdfViewerBase.getDocumentId(),hashId:t.pdfViewerBase.hashId,elementId:t.pdfViewer.element.id,uniqueId:t.pdfViewerBase.documentId},r=!!t.pdfViewer.textSearch,s=this.pdfViewer.extractTextOption===ECt.None||this.pdfViewer.extractTextOption===ECt.TextOnly;(n&&""===n.src||je(n)&&!je(this.pdfViewer.pageOrganizer))&&this.pdfViewerBase.pdfViewerRunner.addTask({pageIndex:i,message:"renderThumbnail",isTextNeed:r,jsonObject:o,isRenderText:r,requestType:r?"pdfTextSearchRequest":"",isSkipCharacterBounds:s},yRt.Low)}this.isThumbnailViewOpen()}else{for(var a=!1,l=t.startIndex;l<t.thumbnailLimit;l++)t.pdfViewerBase.digitalSignaturePresent(l)&&(a=!0);var e="",o=(a&&(e=t.pdfViewerBase.digitalSignaturePages.toString()),{startPage:t.startIndex.toString(),endPage:t.thumbnailLimit.toString(),sizeX:"99.7",sizeY:"141",hashId:t.pdfViewerBase.hashId,action:"RenderThumbnailImages",elementId:t.pdfViewer.element.id,uniqueId:t.pdfViewerBase.documentId,digitalSignaturePresent:a,digitalSignaturePageList:e});this.pdfViewerBase.jsonDocumentId&&(o.documentId=this.pdfViewerBase.jsonDocumentId),this.thumbnailRequestHandler=new DRt(this.pdfViewer),this.thumbnailRequestHandler.url=t.pdfViewer.serviceUrl+"/"+t.pdfViewer.serverActionSettings.renderThumbnail,this.thumbnailRequestHandler.responseType="json",t.startIndex.toString()!==t.thumbnailLimit.toString()&&0<t.thumbnailLimit&&!je(t.pdfViewerBase.hashId)&&(this.pdfViewerBase.requestCollection.push(this.thumbnailRequestHandler),this.thumbnailRequestHandler.send(o)),this.thumbnailRequestHandler.onSuccess=function(e){e=e.data;t.pdfViewerBase.checkRedirection(e)||t.updateThumbnailCollection(e)},this.thumbnailRequestHandler.onFailure=function(e){t.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,t.pdfViewer.serverActionSettings.renderThumbnail)},this.thumbnailRequestHandler.onError=function(e){t.pdfViewerBase.openNotificationPopup(),t.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,t.pdfViewer.serverActionSettings.renderThumbnail)}}},LRt.prototype.thumbnailOnMessage=function(e){var t,i,n,o,r;"renderThumbnail"===e.data.message&&(t=document.createElement("canvas"),o=(e=e.data).value,i=e.width,n=e.height,e=e.pageIndex,t.width=i,t.height=n,(i=(r=t.getContext("2d")).createImageData(i,n)).data.set(o),r.putImageData(i,0,0),n=t.toDataURL(),this.pdfViewerBase.releaseCanvas(t),(o=this.getThumbnailImageElement(e))&&(o.src=n),r={thumbnailImage:n,startPage:this.startIndex,endPage:this.thumbnailLimit,uniqueId:this.pdfViewerBase.documentId,pageIndex:e},!F.isDevice||this.pdfViewer.enableDesktopMode?this.updateThumbnailCollection(r):je(this.pdfViewer.pageOrganizer)||this.pdfViewer.pageOrganizer.updatePreviewCollection(r))},LRt.prototype.updateThumbnailCollection=function(t){if(t){if("object"!=typeof t)try{t=JSON.parse(t)}catch(e){this.pdfViewerBase.onControlError(500,t,this.pdfViewer.serverActionSettings.renderThumbnail),t=null}t&&t.uniqueId===this.pdfViewerBase.documentId&&(this.pdfViewer.fireAjaxRequestSuccess(this.pdfViewer.serverActionSettings.renderThumbnail,t),this.renderThumbnailImage(t))}},LRt.prototype.renderDiv=function(e){if(!(this.pdfViewerBase.pageSize.length!==this.pdfViewerBase.pageCount&&je(e)||this.isRendered)){for(var t=100;t<this.pdfViewer.pageCount;t++){var i=document.getElementById(this.pdfViewer.element.id+"_thumbnail_"+t),n=document.getElementById("page_"+t),o=document.getElementById(this.pdfViewer.element.id+"_thumbnail_pagenumber_"+t),r=this.getThumbnailImageElement(t),s=180;(this.pdfViewerBase.pageSize[parseInt(t.toString(),10)]&&this.pdfViewerBase.pageSize[parseInt(t.toString(),10)].height<this.pdfViewerBase.pageSize[parseInt(t.toString(),10)].width||e&&(1===e.pageRotation[parseInt(t.toString(),10)]||3===e.pageRotation[parseInt(t.toString(),10)]))&&(r.style.height="86px",r.style.width="126px",i.style.height="100px",i.style.width="140px",o.style.left="18px",n.style.marginRight="41px",i.style.marginLeft="-5px",i.style.marginRight="0px",s=140),0<this.thumbnailPageSize.length&&(this.thumbnailTop=this.thumbnailPageSize[t-1].top+this.thumbnailPageSize[t-1].height,r={height:s,top:this.thumbnailTop},this.thumbnailPageSize[parseInt(t.toString(),10)]=r)}this.isRendered=!0}},LRt.prototype.gotoThumbnailImage=function(e){var t,i,n=this.checkThumbnailScroll(e);this.thumbnailView&&(t=this.thumbnailView.children[parseInt(e.toString(),10)])&&(t=t.children[0],i=void 0,n&&(this.pdfViewerBase.pageSize.length!==this.pdfViewerBase.pageCount||this.isRendered||this.renderDiv(),i=t.offsetTop<=0?t.parentElement.offsetTop+t.clientTop-this.thumbnailTopMargin:t.offsetTop+t.clientTop-this.thumbnailTopMargin,this.pdfViewerBase.navigationPane.sideBarContent.scrollTop=i),this.isThumbnailClicked||(this.previousElement&&(this.previousElement.classList.remove("e-pv-thumbnail-selection"),this.previousElement.classList.remove("e-pv-thumbnail-focus"),this.previousElement.classList.remove("e-pv-thumbnail-hover"),this.previousElement.classList.add("e-pv-thumbnail-selection-ring")),this.setFocusStyle(t,e)),this.previousElement=t.children[0])},LRt.prototype.determineThumbnailsRequest=function(e){var t=this.pdfViewer.pageCount,i=this.thumbnailRequestsBatch,n=Math.ceil(t/i);if(this.list.length===n)return t;for(var o=0;o<this.list.length;o++)e===this.list[parseInt(o.toString(),10)]&&(e+=i,o=-1);return void 0!==e&&e<t?e:t},LRt.prototype.checkThumbnailScroll=function(i){var e,t,n,o=!1;return this.thumbnailView&&0<(n=(e=this.getVisibleThumbs()).views.length)&&(t=this.getPageNumberFromID(e.first.id),n=1<n?this.getPageNumberFromID(e.last.id):t,i<=t||n<=i?o=!0:e.views.some(function(e){var t=e.id.split("_"),t=t[t.length-1];return parseInt(t,10)===i&&(o=e.percent<100&&e.view.offsetWidth>e.view.offsetHeight&&e.percent<97,!0)})),o},LRt.prototype.getPageNumberFromID=function(e){e=e.split("_"),e=e[e.length-1];return parseInt(e,10)},LRt.prototype.setFocusStyle=function(e,t){e.children[0].id===this.pdfViewer.element.id+"_thumbnail_Selection_Ring_"+t&&this.setMouseFocusStyle(e.children[0])},LRt.prototype.renderThumbnailImage=function(e,t){this.thumbnailView&&e&&(this.pdfViewerBase.clientSideRendering?this.renderClientThumbnailImage(e):this.renderServerThumbnailImage(e)),je(e)||je(this.pdfViewer.pageOrganizer)||this.pdfViewer.pageOrganizer.getData(e,this.pdfViewerBase.clientSideRendering),this.thumbnailLimit=this.determineThumbnailsRequest(je(t)?this.thumbnailLimit:t),this.thumbnailLimit===this.pdfViewerBase.pageCount||!this.thumbnailView&&je(this.pdfViewer.pageOrganizer)||(!!document.documentMode?this.createRequestForThumbnailImages():Promise.all([this.createRequestForThumbnailImages()]))},LRt.prototype.createRequestForThumbnailImages=function(){var i=this;return!!document.documentMode?(this.renderViewPortThumbnailImage(i),null):new Promise(function(e,t){i.renderViewPortThumbnailImage(i)})},LRt.prototype.renderServerThumbnailImage=function(e){for(var t=je(e&&e.startPage)?this.startIndex:e.startPage,i=je(e&&e.endPage)?this.thumbnailLimit:e.endPage,n=t;n<i;n++)this.thumbnailImageRender(n,e);this.isThumbnailViewOpen()},LRt.prototype.renderClientThumbnailImage=function(e){var t=e.pageIndex;this.thumbnailImageRender(t,e)},LRt.prototype.thumbnailImageRender=function(e,t){!je(t.pageRotation)&&0<Object.keys(t.pageRotation).length&&!this.isRendered&&this.renderDiv(t);var i=document.getElementById(this.pdfViewer.element.id+"_thumbnail_"+e),n=document.getElementById("page_"+e),o=document.getElementById(this.pdfViewer.element.id+"_thumbnail_pagenumber_"+e),r=this.getThumbnailImageElement(e);je(i)||je(r)||(r.src=this.pdfViewerBase.clientSideRendering||"string"==typeof t.thumbnailImage||t.thumbnailImage instanceof String?t.thumbnailImage:t.thumbnailImage[parseInt(e.toString(),10)],r.alt=this.pdfViewer.element.id+"_thumbnail_page_"+e,n.setAttribute("aria-label","Thumbnail of Page "+(e+1)),this.pdfViewerBase.pageSize[parseInt(e.toString(),10)]&&this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].height<this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].width&&(r.style.height="86px",r.style.width="126px",i.style.height="100px",i.style.width="140px",o.style.left="18px",n.style.marginRight="41px",i.style.marginLeft="-5px",i.style.marginRight="0px"),0===e&&(this.pdfViewerBase.navigationPane.enableThumbnailButton(),this.isThumbnailViewOpen()))},LRt.prototype.wireUpEvents=function(){this.thumbnailSelectionRing&&(this.thumbnailSelectionRing.addEventListener("click",this.thumbnailClick),this.thumbnailImage.addEventListener("keydown",this.thumbnailKeydown),this.thumbnailSelectionRing.addEventListener("mouseover",this.thumbnailMouseOver),this.thumbnailSelectionRing.addEventListener("mouseleave",this.thumbnailMouseLeave))},LRt.prototype.unwireUpEvents=function(){this.thumbnailSelectionRing&&this.thumbnailImage&&(this.thumbnailSelectionRing.removeEventListener("click",this.thumbnailClick),this.thumbnailImage.removeEventListener("keydown",this.thumbnailKeydown),this.thumbnailSelectionRing.removeEventListener("mouseover",this.thumbnailMouseOver),this.thumbnailSelectionRing.removeEventListener("mouseleave",this.thumbnailMouseLeave))},LRt.prototype.goToThumbnailPage=function(e){0<e&&e<=this.pdfViewerBase.pageCount&&this.pdfViewerBase.currentPageNumber!==e?this.pdfViewerBase.updateScrollTop(e-1):this.isThumbnailClicked=!1},LRt.prototype.setSelectionStyle=function(e){e.classList.remove("e-pv-thumbnail-selection-ring"),e.classList.remove("e-pv-thumbnail-hover"),e.classList.remove("e-pv-thumbnail-focus"),e.classList.add("e-pv-thumbnail-selection")},LRt.prototype.setMouseOverStyle=function(e){e.classList.contains("e-pv-thumbnail-selection")||(e.classList.remove("e-pv-thumbnail-selection-ring"),e.classList.contains("e-pv-thumbnail-focus"))||e.classList.add("e-pv-thumbnail-hover")},LRt.prototype.setMouseLeaveStyle=function(e){e.classList.contains("e-pv-thumbnail-selection")?e.classList.contains("e-pv-thumbnail-selection")||(e.classList.remove("e-pv-thumbnail-selection"),e.classList.add("e-pv-thumbnail-focus")):(e.classList.contains("e-pv-thumbnail-focus")||e.classList.add("e-pv-thumbnail-selection-ring"),e.classList.remove("e-pv-thumbnail-hover"))},LRt.prototype.setMouseFocusStyle=function(e){e.classList.remove("e-pv-thumbnail-selection"),e.classList.remove("e-pv-thumbnail-hover"),e.classList.add("e-pv-thumbnail-focus")},LRt.prototype.setMouseFocusToFirstPage=function(){var e=this.thumbnailView.children[0];e&&(e=e.children[0].children[0],this.setMouseFocusStyle(e),this.previousElement=e)},LRt.prototype.clear=function(){if(this.startIndex=0,this.thumbnailLimit=0,this.list=[],this.thumbnailPageSize=[],this.thumbnailTop=0,this.isRendered=!1,this.pdfViewerBase.navigationPane&&this.pdfViewerBase.navigationPane.sideBarContentContainer&&(this.pdfViewerBase.navigationPane.sideBarContentContainer.style.display="block",this.pdfViewerBase.navigationPane.sideBarContent.scrollTop=0,this.pdfViewerBase.navigationPane.sideBarContentContainer.style.display="none"),this.thumbnailView)for(;this.thumbnailView.hasChildNodes();)this.thumbnailView.removeChild(this.thumbnailView.lastChild);this.pdfViewerBase.navigationPane&&this.pdfViewerBase.navigationPane.resetThumbnailView(),this.thumbnailRequestHandler&&this.thumbnailRequestHandler.clear(),this.unwireUpEvents()},LRt.prototype.getVisibleThumbs=function(){return this.getVisibleElements(this.pdfViewerBase.navigationPane.sideBarContent,this.thumbnailView.children)},LRt.prototype.getVisibleElements=function(e,t){var i=e.scrollTop,n=i+e.clientHeight,o=e.scrollLeft,r=o+e.clientWidth;for(var s,a,l,h,d,p,c,u=[],e=0===t.length?0:this.binarySearchFirstItem(t,function(e){return e=e.offsetTop+e.clientTop+e.clientHeight,i<e}),g=-1,m=e=0<t.length?this.backtrackBeforeAllVisibleElements(e,t,i):e,f=t.length;m<f;m++){if(d=(s=this.getThumbnailElement(m)).offsetLeft+s.clientLeft,a=s.offsetTop+s.clientTop,c=d+(p=s.clientWidth),h=a+(l=s.clientHeight),-1===g)n<=h&&(g=h);else if(g<a)break;h<=i||n<=a||c<=o||r<=d||(h=Math.max(0,i-a)+Math.max(0,h-n),c=Math.max(0,o-d)+Math.max(0,c-r),u.push({id:s.id,x:d,y:a,view:s,percent:(l-h)*(p-c)*100/l/p|0}))}return{first:u[0],last:u[u.length-1],views:u}},LRt.prototype.binarySearchFirstItem=function(e,t){var i=0,n=e.length-1;if(0===e.length||!t(this.getThumbnailElement(n)))return e.length-1;if(!t(this.getThumbnailElement(i)))for(;i<n;){var o=i+n>>1;t(this.getThumbnailElement(o))?n=o:i=1+o}return i},LRt.prototype.backtrackBeforeAllVisibleElements=function(e,t,i){if(!(e<2)){var n=this.getThumbnailElement(e),o=n.offsetTop+n.clientTop;i<=o&&(o=(n=this.getThumbnailElement(e-1)).offsetTop+n.clientTop);for(var r=e-2;0<=r&&!((n=this.getThumbnailElement(r)).offsetTop+n.clientTop+n.clientHeight<=o);--r)e=r}return e},LRt.prototype.getThumbnailElement=function(e){return this.thumbnailView.children[parseInt(e.toString(),10)].children[0]},LRt.prototype.getThumbnailLinkElement=function(e){return this.thumbnailView.children[parseInt(e.toString(),10)]},LRt.prototype.getThumbnailImageElement=function(e){return!je(this.thumbnailView)&&(e=this.thumbnailView.children[parseInt(e.toString(),10)])?e.children[0].children[0].children[0]:null},LRt.prototype.destroy=function(){this.clear()},LRt.prototype.getModuleName=function(){return"ThumbnailView"};Tft=LRt;function LRt(e,t){var o=this;this.thumbnailLimit=30,this.thumbnailThreshold=5,this.thumbnailRequestsBatch=5,this.thumbnailTopMargin=10,this.thumbnailTop=8,this.isRendered=!1,this.list=[],this.thumbnailPageSize=[],this.isThubmnailOpen=!1,this.isThumbnailClicked=!1,this.thumbnailOnScroll=function(e){for(var t=0;t<o.thumbnailPageSize.length&&"break"!==function(){var t=o.pdfViewerBase.navigationPane.sideBarContent.scrollTop,e=o.thumbnailPageSize.findIndex(function(e){return e.top>=t});if(-1!==e)return e=Math.floor(e/o.thumbnailRequestsBatch)*o.thumbnailRequestsBatch,o.updateScrollTopForThumbnail(e),"break"}();t++);},this.thumbnailClick=function(e,t){var i=o,e=e.target,n=i.getPageNumberFromID(e.id);i.previousElement&&(i.previousElement.classList.remove("e-pv-thumbnail-selection"),i.previousElement.classList.remove("e-pv-thumbnail-focus"),i.previousElement.classList.add("e-pv-thumbnail-selection-ring")),e.parentElement.id===i.pdfViewer.element.id+"_thumbnail_Selection_Ring_"+n?(i.setSelectionStyle(e.parentElement),i.previousElement=e.parentElement):e.id===i.pdfViewer.element.id+"_thumbnail_Selection_Ring_"+n&&(i.setSelectionStyle(e),i.previousElement=e),i.pdfViewer.fireThumbnailClick(n+1),i.isThumbnailClicked=!0,i.goToThumbnailPage(n+1),t||i.pdfViewerBase.focusViewerContainer(),o.pdfViewer.annotationModule&&o.pdfViewer.annotationModule.inkAnnotationModule&&(e=parseInt(o.pdfViewer.annotationModule.inkAnnotationModule.currentPageNumber,10),o.pdfViewer.annotationModule.inkAnnotationModule.drawInkAnnotation(e))},this.thumbnailKeydown=function(e){(e&&"Enter"===e.key||" "===e.key)&&(o.thumbnailClick(e,!0),e.preventDefault(),e.stopPropagation())},this.thumbnailMouseOver=function(e){var t=o,e=e.target,i=t.getPageNumberFromID(e.id);e.id===t.pdfViewer.element.id+"_thumbnail_Selection_Ring_"+i?t.setMouseOverStyle(e):e.id===t.pdfViewer.element.id+"_thumbnail_image_"+i&&t.setMouseOverStyle(e.parentElement)},this.thumbnailMouseLeave=function(e){var t=o,e=e.target,i=t.getPageNumberFromID(e.id);e.parentElement.id===t.pdfViewer.element.id+"_thumbnail_view"?t.setMouseLeaveStyle(e.children[0].children[0]):e.parentElement.id===t.pdfViewer.element.id+"_thumbnail_"+i&&t.setMouseLeaveStyle(e.parentElement.children[0])},this.pdfViewer=e,this.pdfViewerBase=t}ORt.prototype.initializeFormDesignerToolbar=function(){this.toolbarElement=Q("div",{id:this.pdfViewer.element.id+"_formdesigner_toolbar",className:"e-pv-formdesigner-toolbar"}),this.pdfViewerBase.viewerMainContainer.appendChild(this.toolbarElement),this.toolbar=new U3({width:"",height:"",overflowMode:"Popup",items:this.createToolbarItems(),clicked:this.onToolbarClicked.bind(this)}),this.pdfViewer.enableRtl&&(this.toolbar.enableRtl=!0),this.toolbar.appendTo(this.toolbarElement),this.afterToolbarCreation(),this.createSignContainer(),this.applyFormDesignerToolbarSettings(),this.showFormDesignerToolbar(null,!0)},ORt.prototype.resetFormDesignerToolbar=function(){this.pdfViewer.isFormDesignerToolbarVisible?(this.pdfViewer.designerMode=!0,this.pdfViewer.formDesignerModule.setMode("designer"),this.adjustViewer(!1),this.toolbarElement.style.display="",this.isToolbarHidden=!1,this.adjustViewer(!0),this.primaryToolbar.selectItem(this.primaryToolbar.formDesignerItem),this.pdfViewer.isFormDesignerToolbarVisible=!0):(this.toolbarElement.style.display="none",this.isToolbarHidden=!0,this.pdfViewer.isAnnotationToolbarVisible||this.adjustViewer(!0),this.primaryToolbar.deSelectItem(this.primaryToolbar.formDesignerItem),this.pdfViewer.isFormDesignerToolbarVisible=!1)},ORt.prototype.showFormDesignerToolbar=function(e,t){var i;this.isToolbarHidden?(i=this.toolbarElement.style.display,this.toolbarElement.style.display="block",this.pdfViewer.designerMode=!0,this.pdfViewer.formDesignerModule.setMode("designer"),t||(this.pdfViewer.isFormDesignerToolbarVisible=!0),e?this.primaryToolbar.selectItem(e):this.pdfViewer.enableToolbar&&this.primaryToolbar.selectItem(this.primaryToolbar.formDesignerItem),"none"===i&&this.adjustViewer(!0),this.pdfViewer.formFieldCollection&&this.pdfViewer.formFieldCollection.filter(function(e){return"Textbox"===e.formFieldAnnotationType&&e.isMultiline}).forEach(function(e){e=document.getElementById(e.id);e&&(e.style.pointerEvents="auto",e.style.resize="auto")})):(e?this.primaryToolbar.deSelectItem(e):this.pdfViewer.enableToolbar&&this.primaryToolbar.deSelectItem(this.primaryToolbar.formDesignerItem),this.adjustViewer(!1),this.pdfViewer.formFieldCollection&&this.pdfViewer.formFieldCollection.filter(function(e){return"Textbox"===e.formFieldAnnotationType&&e.isMultiline}).forEach(function(e){e=document.getElementById(e.id);e&&(e.style.pointerEvents="none",e.style.resize="none")}),this.toolbarElement.style.display="none",this.pdfViewer.formDesignerModule.setMode("edit"),this.pdfViewer.designerMode=!1,t||(this.pdfViewer.isFormDesignerToolbarVisible=!1)),this.pdfViewer.magnification&&"fitToPage"===this.pdfViewer.magnification.fitType&&this.pdfViewer.magnification.fitToPage(),this.isToolbarHidden=!this.isToolbarHidden},ORt.prototype.adjustViewer=function(e){i=N?(t=this.pdfViewer.element.querySelector(".e-pv-sidebar-toolbar-splitter"),n=this.pdfViewer.element.querySelector(".e-pv-toolbar"),i=this.pdfViewer.element.querySelector(".e-pv-formDesigner-toolbar"),this.getToolbarHeight(i)):(t=this.pdfViewerBase.getElement("_sideBarToolbarSplitter"),n=this.pdfViewerBase.getElement("_toolbarContainer"),this.getToolbarHeight(this.toolbarElement));var t,i,n=this.getToolbarHeight(n),o=this.pdfViewerBase.navigationPane.sideBarToolbar,r=this.pdfViewerBase.navigationPane.sideBarContentContainer,s=this.pdfViewerBase.navigationPane.commentPanelContainer,a=this.pdfViewerBase.navigationPane.commentPanelResizer,l="";e?(this.pdfViewer.enableToolbar?(o.style.top=n+i+"px",r.style.top=n+i+"px",t.style.top=n+i+"px",s.style.top=n+i+"px"):(o.style.top=i+"px",r.style.top=i+"px",t.style.top=i+"px",s.style.top=i+"px"),a.style.top=n+i+"px",this.pdfViewer.enableToolbar||(n=0),this.pdfViewerBase.viewerContainer.style.height=this.updateViewerHeight(this.getElementHeight(this.pdfViewerBase.viewerContainer),i+n)+"px",l=this.getNavigationToolbarHeight(i+n),o.style.height=l,t.style.height=l,a.style.height=l,r.style.height=l):(this.pdfViewer.enableToolbar?(o.style.top=n+"px",r.style.top=n+"px",t.style.top=n+"px",s.style.top=n+"px",a.style.top=n+"px"):(o.style.top="1px",o.style.height="100%",r.style.top="1px",r.style.height="100%",t.style.top="1px",t.style.height="100%",s.style.top="1px",s.style.height="100%",a.style.top="1px",a.style.height="100%"),this.pdfViewer.enableToolbar||(n=0),this.pdfViewerBase.viewerContainer.style.height=this.updateViewerHeight(this.getElementHeight(this.pdfViewerBase.viewerContainer),i)+"px",l=this.getNavigationToolbarHeight(n),o.style.height=l,t.style.height=l,a.style.height=l,r.style.height=l,"0px"===this.pdfViewerBase.viewerContainer.style.height&&(this.pdfViewerBase.viewerContainer.style.height=parseInt(this.pdfViewer.element.style.height,10)-parseInt(o.style.top,10)+"px"))},ORt.prototype.getElementHeight=function(e){try{return e.getBoundingClientRect().height}catch(e){return 0}},ORt.prototype.updateViewerHeight=function(e,t){return this.getElementHeight(this.pdfViewer.element)-t},ORt.prototype.resetViewerHeight=function(e,t){return e+t},ORt.prototype.getNavigationToolbarHeight=function(e){var t=this.pdfViewer.element.getBoundingClientRect().height;return 0!==t?t-e+"px":""},ORt.prototype.updateContentContainerHeight=function(e,t){t=t?(t=this.pdfViewer.element.querySelector(".e-pv-formDesigner-toolbar"),this.getToolbarHeight(t)):this.getToolbarHeight(this.toolbarElement);var i=this.pdfViewerBase.navigationPane.sideBarContentContainer.getBoundingClientRect();0!==i.height&&(this.pdfViewerBase.navigationPane.sideBarContentContainer.style.height=e?i.height-t+"px":i.height+t+"px")},ORt.prototype.getToolbarHeight=function(e){var t=e.getBoundingClientRect().height;return t=0===t&&e===this.pdfViewerBase.getElement("_toolbarContainer")?parseFloat(window.getComputedStyle(e).height)+this.toolbarBorderHeight:t},ORt.prototype.createToolbarItems=function(){var e=this.getTemplate("button","_formfield_signature","e-pv-annotation-handwritten-container"),t=[];return t.push({prefixIcon:"e-pv-textbox-icon e-pv-icon",className:"e-pv-annotation-shapes-container",id:this.pdfViewer.element.id+"_formdesigner_textbox",align:"Left",attr:{tabindex:0,"data-tabindex":0}}),t.push({prefixIcon:"e-pv-password-icon e-pv-icon",className:"e-pv-annotation-shapes-container",id:this.pdfViewer.element.id+"_formdesigner_passwordfield",align:"Left",attr:{tabindex:0,"data-tabindex":0}}),t.push({prefixIcon:"e-pv-checkbox-icon e-pv-icon",className:"e-pv-annotation-shapes-container",id:this.pdfViewer.element.id+"_formdesigner_checkbox",align:"Left",attr:{tabindex:0,"data-tabindex":0}}),t.push({prefixIcon:"e-pv-radiobutton-icon e-pv-icon",className:"e-pv-annotation-shapes-container",id:this.pdfViewer.element.id+"_formdesigner_radiobutton",align:"Left",attr:{tabindex:0,"data-tabindex":0}}),t.push({prefixIcon:"e-pv-dropdown-icon e-pv-icon",className:"e-pv-annotation-shapes-container",id:this.pdfViewer.element.id+"_formdesigner_dropdown",align:"Left",attr:{tabindex:0,"data-tabindex":0}}),t.push({prefixIcon:"e-pv-listbox-icon e-pv-icon",className:"e-pv-annotation-shapes-container",id:this.pdfViewer.element.id+"_formdesigner_listbox",align:"Left",attr:{tabindex:0,"data-tabindex":0}}),t.push({template:e,align:"Left",attr:{tabindex:0,"data-tabindex":0}}),t.push({type:"Separator",align:"Left",attr:{tabindex:0,"data-tabindex":0}}),t.push({prefixIcon:"e-pv-annotation-delete-icon e-pv-icon",className:"e-pv-annotation-delete-container",id:this.pdfViewer.element.id+"_formdesigner_delete",align:"Left",attr:{tabindex:0,"data-tabindex":0}}),t.push({prefixIcon:"e-pv-annotation-tools-close-icon e-pv-icon",className:"e-pv-annotation-tools-close-container",id:this.pdfViewer.element.id+"_formdesigner_close",align:"Right",attr:{tabindex:0,"data-tabindex":0}}),t},ORt.prototype.createSignContainer=function(){var i=this,e=(this.handWrittenSignatureItem=this.pdfViewerBase.getElement("_formfield_signature"),this.handWrittenSignatureItem.setAttribute("tabindex","0"),this.handWrittenSignatureItem.setAttribute("data-tabindex","0"),this.primaryToolbar.createTooltip(this.pdfViewerBase.getElement("_formfield_signature"),this.pdfViewer.localeObj.getConstant("HandwrittenSignatureDialogHeaderText")),new u2({items:[{text:"ADD SIGNATURE"},{separator:!0},{text:"ADD INITIAL"}],iconCss:"e-pv-handwritten-icon e-pv-icon",cssClass:"e-pv-handwritten-popup",beforeItemRender:function(e){var t;i.pdfViewer.clearSelection(i.pdfViewerBase.currentPageNumber-1),e.element&&-1!==e.element.className.indexOf("e-separator")&&(e.element.style.margin="8px 0",e.element.setAttribute("role","menuitem"),e.element.setAttribute("aria-label","separator")),"ADD SIGNATURE"===e.item.text&&(e.element.innerHTML="",(t=Q("button")).classList.add("e-control","e-btn","e-lib","e-outline","e-primary"),t.textContent=i.pdfViewer.localeObj.getConstant("SignatureFieldDialogHeaderText"),"en-US"===i.pdfViewer.locale?t.style.width="130px":t.style.width="auto",t.style.height="36px",t.addEventListener("click",i.clickSignature.bind(i)),e.element.appendChild(t),e.element.addEventListener("mouseover",i.hoverInitialBtn.bind(i)),e.element.style.width="206px",e.element.style.display="flex",e.element.style.flexDirection="column",e.element.style.height="auto",e.element.style.alignItems="center",e.element.setAttribute("role","menuitem")),"ADD INITIAL"===e.item.text&&(e.element.innerHTML="",(t=Q("button")).classList.add("e-control","e-btn","e-lib","e-outline","e-primary"),t.textContent=i.pdfViewer.localeObj.getConstant("InitialFieldDialogHeaderText"),"en-US"===i.pdfViewer.locale?t.style.width="130px":t.style.width="auto",t.style.height="36px",t.addEventListener("click",i.clickInitial.bind(i)),e.element.appendChild(t),e.element.addEventListener("mouseover",i.hoverInitialBtn.bind(i)),e.element.style.width="206px",e.element.style.display="flex",e.element.style.flexDirection="column",e.element.style.height="auto",e.element.style.alignItems="center",e.element.setAttribute("role","menuitem"))}}));this.pdfViewer.enableRtl&&(e.enableRtl=this.pdfViewer.enableRtl),e.appendTo(this.handWrittenSignatureItem)},ORt.prototype.hoverInitialBtn=function(e){var t=e.target,e=(je(e.path)?e.composedPath():e.path)[0].id;e!=="sign_"+e.split("_")[1]&&e!=="delete_"+e.split("_")[1]&&(null==(e=je(e=document.getElementById(t.id))?document.getElementById(t.parentElement.id):e)||t.id==="sign_"+t.id.split("_")[1]&&t.id==="sign_border_"+t.id.split("_")[2]?null==e.parentElement||t.id==="sign_"+t.id.split("_")[1]&&t.id==="sign_border_"+t.id.split("_")[2]||(e.parentElement.style.background="transparent",e.parentElement.style.cursor="default"):(e.style.background="transparent",e.style.cursor="default"))},ORt.prototype.getTemplate=function(e,t,i){e=Q(e,{id:this.pdfViewer.element.id+t});return i&&(e.className=i),e.outerHTML},ORt.prototype.onToolbarClicked=function(e){e&&e.item&&(-1!==e.item.id.indexOf("textbox")?this.pdfViewer.formDesignerModule.setFormFieldMode("Textbox"):-1!==e.item.id.indexOf("passwordfield")?this.pdfViewer.formDesignerModule.setFormFieldMode("Password"):-1!==e.item.id.indexOf("checkbox")?this.pdfViewer.formDesignerModule.setFormFieldMode("CheckBox"):-1!==e.item.id.indexOf("radiobutton")?this.pdfViewer.formDesignerModule.setFormFieldMode("RadioButton"):-1!==e.item.id.indexOf("dropdown")?this.pdfViewer.formDesignerModule.setFormFieldMode("DropDown"):-1!==e.item.id.indexOf("listbox")?this.pdfViewer.formDesignerModule.setFormFieldMode("ListBox"):-1!==e.item.id.indexOf("signature")?this.pdfViewer.formDesignerModule.setFormFieldMode("SignatureField"):-1!==e.item.id.indexOf("close")?this.pdfViewer.toolbarModule.formDesignerToolbarModule.showFormDesignerToolbar(this.pdfViewer.toolbarModule.formDesignerItem):-1!==e.item.id.indexOf("delete")&&(this.pdfViewer.formDesignerModule.deleteFormField(this.pdfViewer.selectedItems.formFields[0]),this.showHideDeleteIcon(!1)),0<this.pdfViewer.selectedItems.formFields.length)&&this.pdfViewer.clearSelection(this.pdfViewer.selectedItems.formFields[0].pageIndex)},ORt.prototype.clickSignature=function(e){this.pdfViewer.formDesignerModule.setFormFieldMode("SignatureField")},ORt.prototype.clickInitial=function(e){this.pdfViewer.isInitialFieldToolbarSelection=!0,this.pdfViewer.formDesignerModule.setFormFieldMode("InitialField"),this.pdfViewer.isInitialFieldToolbarSelection=!1},ORt.prototype.afterToolbarCreation=function(){this.textboxItem=this.primaryToolbar.addClassToolbarItem("_formdesigner_textbox","e-pv-formdesigner-textbox",this.pdfViewer.localeObj.getConstant("Textbox")),this.textboxItem.setAttribute("tabindex","0"),this.textboxItem.setAttribute("data-tabindex","0"),this.passwordItem=this.primaryToolbar.addClassToolbarItem("_formdesigner_passwordfield","e-pv-formdesigner-passwordfield",this.pdfViewer.localeObj.getConstant("Password")),this.passwordItem.setAttribute("tabindex","0"),this.passwordItem.setAttribute("data-tabindex","0"),this.checkboxItem=this.primaryToolbar.addClassToolbarItem("_formdesigner_checkbox","e-pv-formdesigner-checkbox",this.pdfViewer.localeObj.getConstant("Check Box")),this.checkboxItem.setAttribute("tabindex","0"),this.checkboxItem.setAttribute("data-tabindex","0"),this.radioButtonItem=this.primaryToolbar.addClassToolbarItem("_formdesigner_radiobutton","e-pv-formdesigner-radiobutton",this.pdfViewer.localeObj.getConstant("Radio Button")),this.radioButtonItem.setAttribute("tabindex","0"),this.radioButtonItem.setAttribute("data-tabindex","0"),this.dropdownItem=this.primaryToolbar.addClassToolbarItem("_formdesigner_dropdown","e-pv-formdesigner-dropdown",this.pdfViewer.localeObj.getConstant("Dropdown")),this.dropdownItem.setAttribute("tabindex","0"),this.dropdownItem.setAttribute("data-tabindex","0"),this.listboxItem=this.primaryToolbar.addClassToolbarItem("_formdesigner_listbox","e-pv-formdesigner-listbox",this.pdfViewer.localeObj.getConstant("List Box")),this.listboxItem.setAttribute("tabindex","0"),this.listboxItem.setAttribute("data-tabindex","0"),this.deleteItem=this.primaryToolbar.addClassToolbarItem("_formdesigner_delete","e-pv-formdesigner-delete",this.pdfViewer.localeObj.getConstant("Delete FormField")),this.closeItem=this.primaryToolbar.addClassToolbarItem("_formdesigner_close","e-pv-annotation-tools-close",null),this.closeItem.setAttribute("tabindex","0"),this.closeItem.setAttribute("data-tabindex","0"),this.showHideDeleteIcon(!1)},ORt.prototype.showHideDeleteIcon=function(e){this.toolbar&&(this.toolbar.enableItems(this.deleteItem.parentElement,e),this.deleteItem.setAttribute("tabindex",e?"0":"-1"),this.deleteItem.setAttribute("data-tabindex",e?"0":"-1"))},ORt.prototype.applyFormDesignerToolbarSettings=function(){this.pdfViewer.toolbarSettings.formDesignerToolbarItems&&(-1!==this.pdfViewer.toolbarSettings.formDesignerToolbarItems.indexOf("TextboxTool")?this.showTextboxTool(!0):this.showTextboxTool(!1),-1!==this.pdfViewer.toolbarSettings.formDesignerToolbarItems.indexOf("PasswordTool")?this.showPasswordTool(!0):this.showPasswordTool(!1),-1!==this.pdfViewer.toolbarSettings.formDesignerToolbarItems.indexOf("CheckBoxTool")?this.showCheckboxTool(!0):this.showCheckboxTool(!1),-1!==this.pdfViewer.toolbarSettings.formDesignerToolbarItems.indexOf("RadioButtonTool")?this.showRadioButtonTool(!0):this.showRadioButtonTool(!1),-1!==this.pdfViewer.toolbarSettings.formDesignerToolbarItems.indexOf("DropdownTool")?this.showDropdownTool(!0):this.showDropdownTool(!1),-1!==this.pdfViewer.toolbarSettings.formDesignerToolbarItems.indexOf("ListboxTool")?this.showListboxTool(!0):this.showListboxTool(!1),-1!==this.pdfViewer.toolbarSettings.formDesignerToolbarItems.indexOf("DrawSignatureTool")?this.showDrawSignatureTool(!0):this.showDrawSignatureTool(!1),-1!==this.pdfViewer.toolbarSettings.formDesignerToolbarItems.indexOf("DeleteTool")?this.showDeleteTool(!0):this.showDeleteTool(!1),this.showSeparator())},ORt.prototype.showTextboxTool=function(e){this.isTextboxBtnVisible=e,this.applyHideToToolbar(e,0,0)},ORt.prototype.showPasswordTool=function(e){this.isPasswordBtnVisible=e,this.applyHideToToolbar(e,1,1)},ORt.prototype.showCheckboxTool=function(e){this.isCheckboxBtnVisible=e,this.applyHideToToolbar(e,2,2)},ORt.prototype.showRadioButtonTool=function(e){this.isRadiobuttonBtnVisible=e,this.applyHideToToolbar(e,3,3)},ORt.prototype.showDropdownTool=function(e){this.isDropdownBtnVisible=e,this.applyHideToToolbar(e,4,4)},ORt.prototype.showListboxTool=function(e){this.isListboxBtnVisible=e,this.applyHideToToolbar(e,5,5)},ORt.prototype.showDrawSignatureTool=function(e){this.isSignatureBtnVisible=e,this.applyHideToToolbar(e,6,6)},ORt.prototype.showDeleteTool=function(e){this.isDeleteBtnVisible=e,this.applyHideToToolbar(e,8,8)},ORt.prototype.showSeparator=function(){this.isSignatureBtnVisible||this.isDeleteBtnVisible||this.applyHideToToolbar(!1,7,7)},ORt.prototype.applyHideToToolbar=function(e,t,i){for(var n=!e,o=t;o<=i;o++)this.toolbar.hideItem(o,n)},ORt.prototype.destroy=function(){for(var e=[this.textboxItem,this.passwordItem,this.checkboxItem,this.radioButtonItem,this.listboxItem,this.dropdownItem,this.handWrittenSignatureItem,this.deleteItem],t=0;t<e.length;t++)e[parseInt(t.toString(),10)]&&this.destroyDependentComponent(e[parseInt(t.toString(),10)])},ORt.prototype.destroyDependentComponent=function(e){if(e.ej2_instances)for(var t=e.ej2_instances.length-1;0<=t;t--)e.ej2_instances[parseInt(t.toString(),10)].destroy()};var RRt=ORt;function ORt(e,t,i){this.isToolbarHidden=!1,this.isTextboxBtnVisible=!0,this.isPasswordBtnVisible=!0,this.isCheckboxBtnVisible=!0,this.isRadiobuttonBtnVisible=!0,this.isDropdownBtnVisible=!0,this.isListboxBtnVisible=!0,this.isSignatureBtnVisible=!0,this.isDeleteBtnVisible=!0,this.toolbarBorderHeight=1,this.pdfViewer=e,this.pdfViewerBase=t,this.primaryToolbar=i}NRt.prototype.intializeToolbar=function(e){var t;return N?F.isDevice&&!this.pdfViewer.enableDesktopMode||(t=this.pdfViewer.element.querySelector(".e-pv-toolbar"),this.toolbarElement=t):t=this.createToolbar(e),!document.documentMode||(N?this.pdfViewerBase.blazorUIAdaptor.totalPageElement.classList.add("e-pv-total-page-ms"):F.isDevice||this.totalPageItem.classList.add("e-pv-total-page-ms")),this.createFileElement(t),this.wireEvent(),N?(F.isDevice&&!this.pdfViewer.enableDesktopMode||(this.initialEnableItems(),this.pdfViewerBase.navigationPane.adjustPane(),this.pdfViewer.enableToolbar&&this.bindOpenIconEvent()),this.PanElement=document.getElementById(this.pdfViewer.element.id+"_handTool").children[0],this.PanElement.classList.add("e-pv-tbar-btn"),this.SelectToolElement=document.getElementById(this.pdfViewer.element.id+"_selectTool").children[0],this.SelectToolElement.classList.add("e-pv-tbar-btn"),this.CommentElement=document.getElementById(this.pdfViewer.element.id+"_comment").children[0],this.CommentElement.classList.add("e-pv-tbar-btn"),this.annotationToolbarModule=new VRt(this.pdfViewer,this.pdfViewerBase,this),(this.pdfViewer.enableToolbar&&this.pdfViewer.enableAnnotationToolbar||this.pdfViewer.enableDesktopMode&&F.isDevice)&&this.annotationToolbarModule.afterAnnotationToolbarCreationInBlazor()):(this.updateToolbarItems(),!F.isDevice||this.pdfViewer.enableDesktopMode?(this.applyToolbarSettings(),this.initialEnableItems(),this.pdfViewerBase.navigationPane.adjustPane()):this.initialEnableItems(),this.pdfViewer.annotationModule&&(this.annotationToolbarModule=new VRt(this.pdfViewer,this.pdfViewerBase,this),F.isDevice&&!this.pdfViewer.enableDesktopMode||this.annotationToolbarModule.initializeAnnotationToolbar()),this.pdfViewer.formDesignerModule&&(this.formDesignerToolbarModule=new RRt(this.pdfViewer,this.pdfViewerBase,this),F.isDevice&&!this.pdfViewer.enableDesktopMode||this.formDesignerToolbarModule.initializeFormDesignerToolbar())),t},NRt.prototype.bindOpenIconEvent=function(){var e=document.getElementById(this.pdfViewer.element.id+"_open");e&&e.addEventListener("click",this.openFileDialogBox.bind(this))},NRt.prototype.InitializeMobileToolbarInBlazor=function(){var e=this.pdfViewer.element.querySelector(".e-pv-mobile-toolbar");this.createFileElement(e),this.wireEvent()},NRt.prototype.showToolbar=function(e){var t,i,n;je(this.toolbarElement)||(t=this.toolbarElement),e?(je(t)||this.pdfViewerBase.navigationPane&&this.pdfViewerBase.navigationPane.isNavigationToolbarVisible||(t.style.display="block"),(i=this.pdfViewerBase.getElement("_toolbarContainer"))&&(0===(n=i.clientHeight)&&(n=parseFloat(window.getComputedStyle(i).height)+1),this.pdfViewerBase.toolbarHeight=n),F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule.hideMobileAnnotationToolbar()):(this.pdfViewerBase.toolbarHeight=0,e&&(F.isDevice&&this.pdfViewer.toolbarModule.annotationToolbarModule.toolbar&&(this.annotationToolbarModule.toolbarCreated=!1,this.annotationToolbarModule.adjustMobileViewer(),this.pdfViewer.toolbarModule.annotationToolbarModule.toolbar.element.style.display="none"),F.isDevice)&&this.annotationToolbarModule.propertyToolbar&&(this.annotationToolbarModule.propertyToolbar.element.style.display="none"),je(t)||(t.style.display="none"))},NRt.prototype.showNavigationToolbar=function(e){var t,i;F.isDevice&&!this.pdfViewer.enableDesktopMode||(t=this.pdfViewerBase.navigationPane.sideBarToolbar,i=this.pdfViewerBase.navigationPane.sideBarToolbarSplitter,e?(je(t)||(t.style.display="block"),je(i)||(i.style.display="block"),(this.pdfViewerBase.navigationPane.isBookmarkOpen||this.pdfViewerBase.navigationPane.isThumbnailOpen)&&this.pdfViewerBase.navigationPane.clear()):(je(t)||(t.style.display="none"),je(i)||(i.style.display="none"),(this.pdfViewerBase.navigationPane.isBookmarkOpen||this.pdfViewerBase.navigationPane.isThumbnailOpen)&&this.pdfViewerBase.navigationPane.updateViewerContainerOnClose()))},NRt.prototype.showAnnotationToolbar=function(e){e?(this.annotationToolbarModule.isToolbarHidden=!0,this.annotationToolbarModule.showAnnotationToolbar(null,!1,!0)):(this.annotationToolbarModule.isToolbarHidden=!1,this.annotationToolbarModule.showAnnotationToolbar(null,!1,!1))},NRt.prototype.showToolbarItem=function(e,t){for(var i=0;i<e.length;i++)switch(e[parseInt(i.toString(),10)]){case"OpenOption":this.showOpenOption(t);break;case"PageNavigationTool":this.showPageNavigationTool(t);break;case"MagnificationTool":this.showMagnificationTool(t);break;case"SelectionTool":this.showSelectionTool(t);break;case"PanTool":this.showScrollingTool(t);break;case"DownloadOption":this.showDownloadOption(t);break;case"PrintOption":this.showPrintOption(t);break;case"SearchOption":this.showSearchOption(t);break;case"UndoRedoTool":this.showUndoRedoTool(t);break;case"AnnotationEditTool":this.showAnnotationEditTool(t);break;case"FormDesignerEditTool":this.showFormDesignerEditTool(t);break;case"CommentTool":this.showCommentOption(t);break;case"SubmitForm":this.showSubmitForm(t)}!F.isDevice||this.pdfViewer.enableDesktopMode?(this.applyHideToToolbar(!0,this.itemsIndexArray[0].endIndex+1,this.itemsIndexArray[0].endIndex+1),this.applyHideToToolbar(!0,this.itemsIndexArray[1].endIndex+1,this.itemsIndexArray[1].endIndex+1),this.applyHideToToolbar(!0,this.itemsIndexArray[2].endIndex+1,this.itemsIndexArray[2].endIndex+1),this.applyHideToToolbar(!0,this.itemsIndexArray[4].endIndex+1,this.itemsIndexArray[4].endIndex+1),this.applyHideToToolbar(!0,this.itemsIndexArray[5].endIndex+1,this.itemsIndexArray[5].endIndex+1)):(this.applyHideToToolbar(!0,1,1),this.applyHideToToolbar(!0,8,8),this.applyHideToToolbar(!0,12,12),this.applyHideToToolbar(!0,15,15)),this.showSeparator(e)},NRt.prototype.enableToolbarItem=function(e,t){for(var i=0;i<e.length;i++)switch(e[parseInt(i.toString(),10)]){case"OpenOption":this.enableOpenOption(t);break;case"PageNavigationTool":this.isPageNavigationToolDisabled=t,this.enablePageNavigationTool(t);break;case"MagnificationTool":this.isMagnificationToolDisabled=t,this.enableMagnificationTool(t);break;case"SelectionTool":this.isSelectionToolDisabled=t,this.enableSelectionTool(t);break;case"PanTool":this.isScrollingToolDisabled=t,this.enableScrollingTool(t);break;case"DownloadOption":this.enableDownloadOption(t);break;case"PrintOption":this.enablePrintOption(t);break;case"SearchOption":this.enableSearchOption(t);break;case"UndoRedoTool":this.enableUndoRedoTool(t);break;case"AnnotationEditTool":this.enableAnnotationEditTool(t);break;case"FormDesignerEditTool":this.enableFormDesignerEditTool(t);break;case"CommentTool":this.enableCommentsTool(t);break;case"OrganizePagesTool":this.enableOrganizePagesButton(t)}},NRt.prototype.DisableToolbarItems=function(e,t){switch(e){case"Print":this.enablePrintOption(t);break;case"CopyContent":this.isSelectionToolDisabled=t,this.enableSelectionTool(t),t?this.pdfViewerBase.initiateTextSelectMode():this.pdfViewerBase.initiatePanning(),this.updateInteractionTools(t);break;case"EditAnnotations":this.enableAnnotationEditTool(t),this.annotationToolbarModule&&!this.annotationToolbarModule.isToolbarHidden&&this.annotationToolbarModule.showAnnotationToolbar()}},NRt.prototype.showOpenOption=function(e){this.isOpenBtnVisible=e,this.applyHideToToolbar(e,je(this.itemsIndexArray[0])?0:this.itemsIndexArray[0].startIndex,je(this.itemsIndexArray[0])?0:this.itemsIndexArray[0].endIndex)},NRt.prototype.showPageNavigationTool=function(e){this.isNavigationToolVisible=e,this.applyHideToToolbar(e,je(this.itemsIndexArray[1])?2:this.itemsIndexArray[1].startIndex,je(this.itemsIndexArray[1])?7:this.itemsIndexArray[1].endIndex)},NRt.prototype.showMagnificationTool=function(e){this.isMagnificationToolVisible=e,this.applyHideToToolbar(e,je(this.itemsIndexArray[2])?9:this.itemsIndexArray[2].startIndex,je(this.itemsIndexArray[2])?11:this.itemsIndexArray[2].endIndex)},NRt.prototype.showSelectionTool=function(e){this.isSelectionBtnVisible=e,this.applyHideToToolbar(e,je(this.itemsIndexArray[3])?13:this.itemsIndexArray[3].startIndex,je(this.itemsIndexArray[3])?13:this.itemsIndexArray[3].endIndex)},NRt.prototype.showScrollingTool=function(e){this.isScrollingBtnVisible=e,this.applyHideToToolbar(e,je(this.itemsIndexArray[4])?14:this.itemsIndexArray[4].startIndex,je(this.itemsIndexArray[4])?14:this.itemsIndexArray[4].endIndex)},NRt.prototype.showDownloadOption=function(e){this.isDownloadBtnVisible=e,!F.isDevice||this.pdfViewer.enableDesktopMode?this.applyHideToToolbar(e,je(this.itemsIndexArray[12])?26:this.itemsIndexArray[12].startIndex,je(this.itemsIndexArray[12])?26:this.itemsIndexArray[12].endIndex):this.applyHideToToolbar(e,6,6)},NRt.prototype.showPageOrganizerToolbar=function(e){F.isDevice&&!this.pdfViewer.enableDesktopMode&&this.applyHideToToolbar(e,4,4)},NRt.prototype.showPrintOption=function(e){this.isPrintBtnVisible=e,this.applyHideToToolbar(e,je(this.itemsIndexArray[11])?25:this.itemsIndexArray[11].startIndex,je(this.itemsIndexArray[11])?25:this.itemsIndexArray[11].endIndex)},NRt.prototype.showSearchOption=function(e){this.isSearchBtnVisible=e,!F.isDevice||this.pdfViewer.enableDesktopMode?this.applyHideToToolbar(e,je(this.itemsIndexArray[8])?22:this.itemsIndexArray[8].startIndex,je(this.itemsIndexArray[8])?22:this.itemsIndexArray[8].endIndex):this.applyHideToToolbar(e,6,6)},NRt.prototype.showUndoRedoTool=function(e){this.isUndoRedoBtnsVisible=e,!F.isDevice||this.pdfViewer.enableDesktopMode?this.applyHideToToolbar(e,je(this.itemsIndexArray[5])?16:this.itemsIndexArray[5].startIndex,je(this.itemsIndexArray[5])?17:this.itemsIndexArray[5].endIndex):this.applyHideToToolbar(e,2,3)},NRt.prototype.showCommentOption=function(e){this.pdfViewer.enableStickyNotesAnnotation?(this.isCommentBtnVisible=e,this.applyHideToToolbar(e,je(this.itemsIndexArray[6])?18:this.itemsIndexArray[6].startIndex,je(this.itemsIndexArray[6])?19:this.itemsIndexArray[6].endIndex)):(this.isCommentBtnVisible=e,this.applyHideToToolbar(this.pdfViewer.enableStickyNotesAnnotation,je(this.itemsIndexArray[6])?18:this.itemsIndexArray[6].startIndex,je(this.itemsIndexArray[6])?19:this.itemsIndexArray[6].endIndex))},NRt.prototype.showAnnotationEditTool=function(e){this.isAnnotationEditBtnVisible=e,!F.isDevice||this.pdfViewer.enableDesktopMode?this.applyHideToToolbar(e,je(this.itemsIndexArray[9])?23:this.itemsIndexArray[9].startIndex,je(this.itemsIndexArray[9])?23:this.itemsIndexArray[9].endIndex):this.applyHideToToolbar(e,5,5)},NRt.prototype.showFormDesignerEditTool=function(e){this.isFormDesignerEditBtnVisible=e,this.applyHideToToolbar(e,je(this.itemsIndexArray[10])?24:this.itemsIndexArray[10].startIndex,je(this.itemsIndexArray[10])?24:this.itemsIndexArray[10].endIndex)},NRt.prototype.showSubmitForm=function(e){this.isSubmitbtnvisible=e,this.applyHideToToolbar(e,je(this.itemsIndexArray[7])?20:this.itemsIndexArray[7].startIndex,je(this.itemsIndexArray[7])?21:this.itemsIndexArray[7].endIndex)},NRt.prototype.enableOpenOption=function(e){this.enableItems(this.openDocumentItem.parentElement,e)},NRt.prototype.enablePageNavigationTool=function(e){this.enableItems(this.firstPageItem.parentElement,e),this.enableItems(this.previousPageItem.parentElement,e),this.enableItems(this.nextPageItem.parentElement,e),this.enableItems(this.lastPageItem.parentElement,e),this.currentPageBox.readonly=!e},NRt.prototype.enableMagnificationTool=function(e){this.enableItems(this.zoomInItem.parentElement,e),this.enableItems(this.zoomOutItem.parentElement,e),this.zoomDropDown.readonly=!e},NRt.prototype.enableSelectionTool=function(e){this.textSelectItem&&this.textSelectItem.parentElement&&this.enableItems(this.textSelectItem.parentElement,e)},NRt.prototype.enableScrollingTool=function(e){this.enableItems(this.panItem.parentElement,e)},NRt.prototype.enableDownloadOption=function(e){this.enableItems(this.downloadItem.parentElement,e)},NRt.prototype.enablePrintOption=function(e){this.enableItems(this.printItem.parentElement,e)},NRt.prototype.enableSearchOption=function(e){this.enableItems(this.textSearchItem.parentElement,e)},NRt.prototype.enableUndoRedoTool=function(e){this.enableItems(this.undoItem.parentElement,e),this.enableItems(this.redoItem.parentElement,e)},NRt.prototype.enableAnnotationEditTool=function(e){this.enableItems(this.annotationItem.parentElement,e)},NRt.prototype.enableFormDesignerEditTool=function(e){this.enableItems(this.formDesignerItem.parentElement,e)},NRt.prototype.enableCommentsTool=function(e){this.pdfViewer.enableStickyNotesAnnotation&&this.enableItems(this.annotationItem.parentElement,e)},NRt.prototype.enableOrganizePagesButton=function(e){je(this.organizePageItem)||je(this.organizePageItem.parentElement)||!this.pdfViewer.enablePageOrganizer||this.enableItems(this.organizePageItem.parentElement,e)},NRt.prototype.resetToolbar=function(){var e;F.isDevice&&!this.pdfViewer.enableDesktopMode||(je(this.currentPageBox)||(this.currentPageBox.min=0,this.currentPageBox.value=0),this.updateTotalPage(),this.updateToolbarItems(),this.pdfViewer.toolbarModule&&this.annotationToolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule.updateFontSizeInIcon(16),this.annotationToolbarModule?this.annotationToolbarModule.clear():this.annotationToolbarModule&&(this.annotationToolbarModule.propertyToolbar&&this.annotationToolbarModule.propertyToolbar.destroy(),e=document.getElementById(this.pdfViewer.element.id+"_commentscontentcontainer"))&&(e.innerHTML=""))},NRt.prototype.updateToolbarItems=function(){var e;!F.isDevice||this.pdfViewer.enableDesktopMode?this.toolbar&&(0===this.pdfViewerBase.pageCount?(this.enableItems(this.downloadItem.parentElement,!1),this.enableItems(this.printItem.parentElement,!1),this.enableItems(this.commentItem.parentElement,!1),this.updateUndoRedoButtons(),this.updateNavigationButtons(),this.enableItems(this.zoomInItem.parentElement,!1),this.enableItems(this.zoomOutItem.parentElement,!1),this.pdfViewer.magnificationModule&&(this.zoomDropDown.readonly=!0),this.enableItems(this.submitItem.parentElement,!1),this.toolbar.enableItems(this.pdfViewerBase.getElement("_currentPageInputContainer"),!1),this.enableItems(this.pdfViewerBase.getElement("_zoomDropDownContainer"),!1),this.enableItems(this.textSelectItem.parentElement,!1),this.enableItems(this.annotationItem.parentElement,!1),this.enableItems(this.formDesignerItem.parentElement,!1),this.enableItems(this.panItem.parentElement,!1),this.enableItems(this.textSearchItem.parentElement,!1),this.deSelectItem(this.annotationItem),this.annotationToolbarModule&&this.annotationToolbarModule.resetToolbar(),this.deSelectItem(this.formDesignerItem),this.formDesignerToolbarModule&&this.formDesignerToolbarModule.resetFormDesignerToolbar()):0<this.pdfViewerBase.pageCount&&this.pdfViewerBase.getElement("_currentPageInputContainer")&&(this.enableItems(this.downloadItem.parentElement,!0),this.enableItems(this.printItem.parentElement,!0),this.toolbar.enableItems(this.pdfViewerBase.getElement("_currentPageInputContainer"),!0),this.enableItems(this.pdfViewerBase.getElement("_zoomDropDownContainer"),!0),this.updateUndoRedoButtons(),this.updateNavigationButtons(),this.updateZoomButtons(),this.pdfViewer.magnificationModule&&(this.zoomDropDown.readonly=!1),this.updateInteractionItems(),this.pdfViewer.annotationModule&&this.pdfViewer.enableAnnotation&&this.enableItems(this.annotationItem.parentElement,!0),this.pdfViewer.formDesignerModule&&this.pdfViewer.enableFormDesigner&&this.enableItems(this.formDesignerItem.parentElement,!0),this.pdfViewer.textSearchModule&&this.pdfViewer.enableTextSearch&&this.enableItems(this.textSearchItem.parentElement,!0),this.pdfViewer.annotationModule)&&this.pdfViewer.enableStickyNotesAnnotation&&this.enableItems(this.commentItem.parentElement,!0),!this.pdfViewer.toolbarSettings.annotationToolbarItems||0!==this.pdfViewer.toolbarSettings.annotationToolbarItems.length&&this.pdfViewer.annotationModule&&this.pdfViewer.enableAnnotationToolbar||this.enableToolbarItem(["AnnotationEditTool"],!1),!this.pdfViewer.toolbarSettings.formDesignerToolbarItems||0!==this.pdfViewer.toolbarSettings.formDesignerToolbarItems.length&&this.pdfViewer.formDesignerModule&&this.pdfViewer.enableFormDesignerToolbar||this.enableToolbarItem(["FormDesignerEditTool"],!1),this.pdfViewer.enableDownload||this.enableDownloadOption(!1),this.pdfViewer.enablePrint||this.enablePrintOption(!1)):0===this.pdfViewerBase.pageCount?(this.enableItems(this.textSearchItem.parentElement,!1),this.enableItems(this.moreOptionItem.parentElement,!1),this.enableItems(this.annotationItem.parentElement,!1)):0<this.pdfViewerBase.pageCount&&(this.enableItems(this.textSearchItem.parentElement,!0),this.enableItems(this.moreOptionItem.parentElement,!0),this.pdfViewer.annotationModule&&this.pdfViewer.enableAnnotation&&this.enableItems(this.annotationItem.parentElement,!0),this.pdfViewer.annotationModule&&this.pdfViewer.enableAnnotationToolbar||this.enableToolbarItem(["AnnotationEditTool"],!1),this.updateUndoRedoButtons(),this.pdfViewer)&&this.pdfViewer.element&&this.pdfViewer.element.id&&this.pdfViewer.isAnnotationToolbarOpen&&(e=this.pdfViewer.element.id+"_annotationIcon",this.annotationToolbarModule.createAnnotationToolbarForMobile(e))},NRt.prototype.updateNavigationButtons=function(){this.pdfViewer.navigationModule&&!this.isPageNavigationToolDisabled?0===this.pdfViewerBase.pageCount||1===this.pdfViewerBase.currentPageNumber&&1===this.pdfViewerBase.pageCount?(this.enableItems(this.firstPageItem.parentElement,!1),this.enableItems(this.previousPageItem.parentElement,!1),this.enableItems(this.nextPageItem.parentElement,!1),this.enableItems(this.lastPageItem.parentElement,!1)):1===this.pdfViewerBase.currentPageNumber&&0<this.pdfViewerBase.pageCount?(this.enableItems(this.firstPageItem.parentElement,!1),this.enableItems(this.previousPageItem.parentElement,!1),this.enableItems(this.nextPageItem.parentElement,!0),this.enableItems(this.lastPageItem.parentElement,!0)):this.pdfViewerBase.currentPageNumber===this.pdfViewerBase.pageCount&&0<this.pdfViewerBase.pageCount?(this.enableItems(this.firstPageItem.parentElement,!0),this.enableItems(this.previousPageItem.parentElement,!0),this.enableItems(this.nextPageItem.parentElement,!1),this.enableItems(this.lastPageItem.parentElement,!1)):1<this.pdfViewerBase.currentPageNumber&&this.pdfViewerBase.currentPageNumber<this.pdfViewerBase.pageCount&&(this.enableItems(this.firstPageItem.parentElement,!0),this.enableItems(this.previousPageItem.parentElement,!0),this.enableItems(this.nextPageItem.parentElement,!0),this.enableItems(this.lastPageItem.parentElement,!0)):(this.enableItems(this.firstPageItem.parentElement,!1),this.enableItems(this.previousPageItem.parentElement,!1),this.enableItems(this.nextPageItem.parentElement,!1),this.enableItems(this.lastPageItem.parentElement,!1),this.currentPageBox.readonly=!0)},NRt.prototype.updateZoomButtons=function(){!this.pdfViewer.magnificationModule||this.isMagnificationToolDisabled||F.isDevice&&!this.pdfViewer.enableDesktopMode||(null!=this.pdfViewer.minZoom||null!=this.pdfViewer.maxZoom?this.pdfViewer.magnificationModule.zoomFactor<=this.pdfViewer.minZoom/100?(this.enableItems(this.zoomInItem.parentElement,!0),this.enableItems(this.zoomOutItem.parentElement,!1)):(this.pdfViewer.magnificationModule.zoomFactor>=this.pdfViewer.maxZoom/100?this.enableItems(this.zoomInItem.parentElement,!1):this.enableItems(this.zoomInItem.parentElement,!0),this.enableItems(this.zoomOutItem.parentElement,!0)):this.pdfViewer.magnificationModule.zoomFactor<=.1?(this.enableItems(this.zoomInItem.parentElement,!0),this.enableItems(this.zoomOutItem.parentElement,!1)):(4<=this.pdfViewer.magnificationModule.zoomFactor?this.enableItems(this.zoomInItem.parentElement,!1):this.enableItems(this.zoomInItem.parentElement,!0),this.enableItems(this.zoomOutItem.parentElement,!0)))},NRt.prototype.updateUndoRedoButtons=function(){this.pdfViewer.annotationModule&&0<this.pdfViewerBase.pageCount?N?(this.enableCollectionAvailableInBlazor(this.pdfViewer.annotationModule.actionCollection,"undo"),this.enableCollectionAvailableInBlazor(this.pdfViewer.annotationModule.redoCollection,"redo")):(je(this.undoItem)||je(this.undoItem.parentElement)||this.enableCollectionAvailable(this.pdfViewer.annotationModule.actionCollection,this.undoItem.parentElement),je(this.redoItem)||je(this.redoItem.parentElement)||this.enableCollectionAvailable(this.pdfViewer.annotationModule.redoCollection,this.redoItem.parentElement)):N?this.pdfViewerBase.blazorUIAdaptor.disableUndoRedoButton():this.disableUndoRedoButtons()},NRt.prototype.enableCollectionAvailable=function(e,t){0<e.length?this.toolbar.enableItems(t,!0):this.toolbar.enableItems(t,!1)},NRt.prototype.enableCollectionAvailableInBlazor=function(e,t){0<e.length?this.pdfViewerBase.blazorUIAdaptor.updateUndoRedoButton(t,!0):this.pdfViewerBase.blazorUIAdaptor.updateUndoRedoButton(t,!1)},NRt.prototype.disableUndoRedoButtons=function(){this.enableItems(this.undoItem.parentElement,!1),this.enableItems(this.redoItem.parentElement,!1)},NRt.prototype.destroy=function(){N||(this.unWireEvent(),this.destroyComponent(),this.moreDropDown&&this.moreDropDown.destroy(),this.annotationToolbarModule&&this.annotationToolbarModule.destroy(),this.formDesignerToolbarModule&&this.formDesignerToolbarModule.destroy(),this.toolbar&&this.toolbar.destroy(),this.toolbarElement&&this.toolbarElement.parentElement.removeChild(this.toolbarElement))},NRt.prototype.destroyComponent=function(){for(var e=[this.openDocumentItem,this.firstPageItem,this.previousPageItem,this.nextPageItem,this.lastPageItem,this.currentPageBoxElement,this.zoomOutItem,this.zoomInItem,this.zoomDropdownItem,this.textSelectItem,this.panItem,this.submitItem,this.undoItem,this.redoItem,this.commentItem,this.textSearchItem,this.annotationItem,this.formDesignerItem,this.printItem,this.downloadItem],t=0;t<e.length;t++)e[parseInt(t.toString(),10)]&&this.destroyDependentComponent(e[parseInt(t.toString(),10)])},NRt.prototype.destroyDependentComponent=function(e){if(e.ej2_instances)for(var t=e.ej2_instances.length-1;0<=t;t--)e.ej2_instances[parseInt(t.toString(),10)].destroy()},NRt.prototype.updateCurrentPage=function(e){!F.isDevice||this.pdfViewer.enableDesktopMode?(N?this.pdfViewerBase.blazorUIAdaptor.pageChanged(e):je(this.currentPageBox)||(this.currentPageBox.value===e&&(this.currentPageBoxElement.value=e.toString()),this.currentPageBox.value=e),this.pdfViewerBase.currentPageNumber=e,this.pdfViewer.currentPageNumber=e):(this.pdfViewerBase.mobileSpanContainer.innerHTML=e.toString(),this.pdfViewerBase.mobilecurrentPageContainer.innerHTML=e.toString())},NRt.prototype.updateTotalPage=function(){F.isDevice&&!this.pdfViewer.enableDesktopMode||(0<this.pdfViewerBase.pageCount&&(je(this.currentPageBox)||(this.currentPageBox.min=1)),je(this.totalPageItem))||(this.totalPageItem.textContent=this.pdfViewer.localeObj.getConstant("of")+this.pdfViewerBase.pageCount.toString())},NRt.prototype.openFileDialogBox=function(e){e.preventDefault(),this.fileInputElement.click()},NRt.prototype.createToolbar=function(e){var t=this;return this.toolbarElement=Q("div",{id:this.pdfViewer.element.id+"_toolbarContainer",className:"e-pv-toolbar"}),this.pdfViewerBase.viewerMainContainer.appendChild(this.toolbarElement),!F.isDevice||this.pdfViewer.enableDesktopMode?(this.toolbar=new U3({clicked:this.toolbarClickHandler,width:"",height:"",overflowMode:"Popup",cssClass:"e-pv-toolbar-scroll",items:this.createToolbarItems(),created:function(){t.createZoomDropdown(),t.createNumericTextBox(),t.toolbar.refreshOverflow()}}),this.toolbar.isStringTemplate=!0,this.pdfViewer.enableRtl&&(this.toolbar.enableRtl=!0),this.toolbar.appendTo(this.toolbarElement),this.applyToolbarSettings(),this.afterToolbarCreation(),this.updateTotalPage(),this.toolbarElement.addEventListener("keydown",this.onToolbarKeydown),this.toolbarElement.setAttribute("aria-label","Toolbar")):(this.createToolbarItemsForMobile(),this.afterToolbarCreationInMobile(),this.pdfViewer.enableRtl&&(this.toolbar.enableRtl=!0),this.applyToolbarSettingsForMobile(),this.disableUndoRedoButtons()),this.toolbarElement},NRt.prototype.createCustomItem=function(e){je(this.pdfViewer.toolbarSettings)||(je(this.pdfViewer.toolbarSettings.toolbarItems)&&(this.pdfViewer.toolbarSettings.toolbarItems=["OpenOption","PageNavigationTool","MagnificationTool","SelectionTool","PanTool","UndoRedoTool","CommentTool","SubmitForm","SearchOption","AnnotationEditTool","FormDesignerEditTool","PrintOption","DownloadOption"]),je(this.pdfViewer.toolbarSettings.annotationToolbarItems)&&(this.pdfViewer.toolbarSettings.annotationToolbarItems=["HighlightTool","UnderlineTool","StrikethroughTool","ColorEditTool","OpacityEditTool","AnnotationDeleteTool","StampAnnotationTool","HandWrittenSignatureTool","InkAnnotationTool","ShapeTool","CalibrateTool","StrokeColorEditTool","ThicknessEditTool","FreeTextAnnotationTool","FontFamilyAnnotationTool","FontSizeAnnotationTool","FontStylesAnnotationTool","FontAlignAnnotationTool","FontColorAnnotationTool","CommentPanelTool"]),je(this.pdfViewer.toolbarSettings.formDesignerToolbarItems)&&(this.pdfViewer.toolbarSettings.formDesignerToolbarItems=["TextboxTool","PasswordTool","CheckBoxTool","RadioButtonTool","DropdownTool","ListboxTool","DrawSignatureTool","DeleteTool"]),je(this.pdfViewer.toolbarSettings.showTooltip)&&(this.pdfViewer.toolbarSettings.showTooltip=!1));for(var t=e;t<this.pdfViewer.toolbarSettings.toolbarItems.length&&"object"==typeof this.pdfViewer.toolbarSettings.toolbarItems[parseInt(t.toString(),10)];t++){var i,n=this.pdfViewer.toolbarSettings.toolbarItems[parseInt(t.toString(),10)];je(n.prefixIcon)||""===n.prefixIcon||(n.prefixIcon+=" e-pv-icon"),(je(n.prefixIcon)||""===n.prefixIcon)&&je(n.template)&&(i=je(n.text)?"Custom Toolbar Item":n.text,n.template='<button id="Custom" class="e-tbar-btn" style="font-size:14px"><span>'+i+"</span></button>"),this.toolItems.push(n),!je(n.align)&&"left"!==n.align&&"Left"!==n.align||this.toolItems.push({type:"Separator",align:"Left"})}},NRt.prototype.createToolbarItems=function(){for(var e=this.createCurrentPageInputTemplate(),t=this.createTotalPageTemplate(),i=this.createZoomDropdownElement(),n='<button id="'+this.pdfViewer.element.id+'_submitForm" class="e-tbar-btn" style="font-size:15px"><span id="'+this.pdfViewer.element.id+'_submitFormSpan" class="e-tbar-btn-text e-pv-submitform-text">'+this.pdfViewer.localeObj.getConstant("SubmitForm")+"</span></button>",o=["OpenOption","PageNavigationTool","MagnificationTool","SelectionTool","PanTool","UndoRedoTool","CommentTool","SubmitForm","SearchOption","AnnotationEditTool","FormDesignerEditTool","PrintOption","DownloadOption"],r=0;r<o.length;r++){switch(0===r&&this.createCustomItem(r),r){case 0:this.itemsIndexArray.push({item:"OpenOption",startIndex:this.toolItems.length,endIndex:this.toolItems.length}),this.toolItems.push({prefixIcon:"e-pv-open-document-icon e-pv-icon",cssClass:"e-pv-open-document-container",id:this.pdfViewer.element.id+"_open",text:this.pdfViewer.localeObj.getConstant("Open text"),align:"Left"}),this.toolItems.push({type:"Separator",align:"Left",cssClass:"e-pv-open-separator-container"});break;case 1:this.pdfViewer.enableRtl?(this.toolItems.push({prefixIcon:"e-pv-last-page-navigation-icon e-pv-icon",cssClass:"e-pv-last-page-navigation-container",id:this.pdfViewer.element.id+"_firstPage",text:this.pdfViewer.localeObj.getConstant("First text"),align:"Left"}),this.toolItems.push({prefixIcon:"e-pv-next-page-navigation-icon e-pv-icon",cssClass:"e-pv-next-page-navigation-container",id:this.pdfViewer.element.id+"_previousPage",text:this.pdfViewer.localeObj.getConstant("Previous text"),align:"Left"}),this.toolItems.push({prefixIcon:"e-pv-previous-page-navigation-icon e-pv-icon",cssClass:"e-pv-previous-page-navigation-container",id:this.pdfViewer.element.id+"_nextPage",text:this.pdfViewer.localeObj.getConstant("Next text"),align:"Left"}),this.toolItems.push({prefixIcon:"e-pv-first-page-navigation-icon e-pv-icon",cssClass:"e-pv-first-page-navigation-container",id:this.pdfViewer.element.id+"_lastPage",text:this.pdfViewer.localeObj.getConstant("Last text"),align:"Left"}),this.toolItems.push({template:t,align:"Left",cssClass:"e-pv-total-page-container"}),this.toolItems.push({template:e,align:"Left",cssClass:"e-pv-current-page-container"})):(this.itemsIndexArray.push({item:"PageNavigationTool",startIndex:this.toolItems.length,endIndex:this.toolItems.length+5}),this.toolItems.push({prefixIcon:"e-pv-first-page-navigation-icon e-pv-icon",cssClass:"e-pv-first-page-navigation-container",id:this.pdfViewer.element.id+"_firstPage",text:this.pdfViewer.localeObj.getConstant("First text"),align:"Left"}),this.toolItems.push({prefixIcon:"e-pv-previous-page-navigation-icon e-pv-icon",cssClass:"e-pv-previous-page-navigation-container",id:this.pdfViewer.element.id+"_previousPage",text:this.pdfViewer.localeObj.getConstant("Previous text"),align:"Left"}),this.toolItems.push({prefixIcon:"e-pv-next-page-navigation-icon e-pv-icon",cssClass:"e-pv-next-page-navigation-container",id:this.pdfViewer.element.id+"_nextPage",text:this.pdfViewer.localeObj.getConstant("Next text"),align:"Left"}),this.toolItems.push({prefixIcon:"e-pv-last-page-navigation-icon e-pv-icon",cssClass:"e-pv-last-page-navigation-container",id:this.pdfViewer.element.id+"_lastPage",text:this.pdfViewer.localeObj.getConstant("Last text"),align:"Left"}),this.toolItems.push({template:e,align:"Left",cssClass:"e-pv-current-page-container"}),this.toolItems.push({template:t,align:"Left",cssClass:"e-pv-total-page-container"})),this.toolItems.push({type:"Separator",align:"Left",cssClass:"e-pv-navigation-separator-container"});break;case 2:this.itemsIndexArray.push({item:"MagnificationTool",startIndex:this.toolItems.length,endIndex:this.toolItems.length+2}),this.toolItems.push({prefixIcon:"e-pv-zoom-out-icon e-pv-icon",cssClass:"e-pv-zoom-out-container",id:this.pdfViewer.element.id+"_zoomOut",text:this.pdfViewer.localeObj.getConstant("Zoom out text"),align:"Left"}),this.toolItems.push({prefixIcon:"e-pv-zoom-in-icon e-pv-icon",cssClass:"e-pv-zoom-in-container",id:this.pdfViewer.element.id+"_zoomIn",text:this.pdfViewer.localeObj.getConstant("Zoom in text"),align:"Left"}),this.toolItems.push({template:i,cssClass:"e-pv-zoom-drop-down-container",align:"Left"}),this.toolItems.push({type:"Separator",align:"Left",cssClass:"e-pv-magnification-separator-container"});break;case 3:this.itemsIndexArray.push({item:"SelectionTool",startIndex:this.toolItems.length,endIndex:this.toolItems.length}),this.toolItems.push({prefixIcon:"e-pv-text-select-tool-icon e-pv-icon",cssClass:"e-pv-text-select-tool-container",id:this.pdfViewer.element.id+"_selectTool",text:this.pdfViewer.localeObj.getConstant("Selection text")});break;case 4:this.itemsIndexArray.push({item:"PanTool",startIndex:this.toolItems.length,endIndex:this.toolItems.length}),this.toolItems.push({prefixIcon:"e-pv-pan-tool-icon e-pv-icon",cssClass:"e-pv-pan-tool-container",id:this.pdfViewer.element.id+"_handTool",text:this.pdfViewer.localeObj.getConstant("Pan text")}),this.toolItems.push({type:"Separator",align:"Left",cssClass:"e-pv-pan-separator-container"});break;case 5:this.itemsIndexArray.push({item:"UndoRedoTool",startIndex:this.toolItems.length,endIndex:this.toolItems.length+1}),this.toolItems.push({prefixIcon:"e-pv-undo-icon e-pv-icon",cssClass:"e-pv-undo-container",id:this.pdfViewer.element.id+"_undo",text:this.pdfViewer.localeObj.getConstant("Undo"),align:"Left"}),this.toolItems.push({prefixIcon:"e-pv-redo-icon e-pv-icon",cssClass:"e-pv-redo-container",id:this.pdfViewer.element.id+"_redo",text:this.pdfViewer.localeObj.getConstant("Redo"),align:"Left"}),this.toolItems.push({type:"Separator",align:"Left",cssClass:"e-pv-undo-separator-container"});break;case 6:this.itemsIndexArray.push({item:"CommentTool",startIndex:this.toolItems.length,endIndex:this.toolItems.length+1}),this.toolItems.push({prefixIcon:"e-pv-comment-icon e-pv-icon",cssClass:"e-pv-comment-container",id:this.pdfViewer.element.id+"_comment",text:this.pdfViewer.localeObj.getConstant("Add Comments"),align:"Left"}),this.toolItems.push({type:"Separator",align:"Left",cssClass:"e-pv-comment-separator-container"});break;case 7:this.itemsIndexArray.push({item:"SubmitForm",startIndex:this.toolItems.length,endIndex:this.toolItems.length}),this.toolItems.push({template:n,cssClass:"e-pv-submit",align:"Left"});break;case 8:this.itemsIndexArray.push({item:"SearchOption",startIndex:this.toolItems.length,endIndex:this.toolItems.length}),this.toolItems.push({prefixIcon:"e-pv-text-search-icon e-pv-icon",cssClass:"e-pv-text-search-container",id:this.pdfViewer.element.id+"_search",text:this.pdfViewer.localeObj.getConstant("Search text"),align:"Right"});break;case 9:this.itemsIndexArray.push({item:"AnnotationEditTool",startIndex:this.toolItems.length,endIndex:this.toolItems.length}),this.toolItems.push({prefixIcon:"e-pv-annotation-icon e-pv-icon",cssClass:"e-pv-annotation-container",id:this.pdfViewer.element.id+"_annotation",text:this.pdfViewer.localeObj.getConstant("Annotation Edit text"),align:"Right"});break;case 10:this.itemsIndexArray.push({item:"FormDesignerEditTool",startIndex:this.toolItems.length,endIndex:this.toolItems.length}),this.toolItems.push({prefixIcon:"e-pv-formdesigner-icon e-pv-icon",cssClass:"e-pv-formdesigner-container",id:this.pdfViewer.element.id+"_formdesigner",text:this.pdfViewer.localeObj.getConstant("FormDesigner Edit text"),align:"Right"});break;case 11:this.itemsIndexArray.push({item:"PrintOption",startIndex:this.toolItems.length,endIndex:this.toolItems.length}),this.toolItems.push({prefixIcon:"e-pv-print-document-icon e-pv-icon",cssClass:"e-pv-print-document-container",id:this.pdfViewer.element.id+"_print",text:this.pdfViewer.localeObj.getConstant("Print text"),align:"Right"});break;case 12:this.itemsIndexArray.push({item:"DownloadOption",startIndex:this.toolItems.length,endIndex:this.toolItems.length}),this.toolItems.push({prefixIcon:"e-pv-download-document-icon e-pv-icon",cssClass:"e-pv-download-document-container",id:this.pdfViewer.element.id+"_download",text:this.pdfViewer.localeObj.getConstant("Download"),align:"Right"})}for(var s=0;s<this.pdfViewer.toolbarSettings.toolbarItems.length;s++)if(o[parseInt(r.toString(),10)]===this.pdfViewer.toolbarSettings.toolbarItems[parseInt(s.toString(),10)]){if("object"!=typeof this.pdfViewer.toolbarSettings.toolbarItems[s+1])break;this.createCustomItem(s+1)}}return this.toolItems},NRt.prototype.afterToolbarCreationInMobile=function(){this.itemsContainer=this.toolbar.element.childNodes[0],this.itemsContainer.id=this.pdfViewer.element.id+"_toolbarItemsContainer",this.openDocumentItem=this.addClassToolbarItem("_open","e-pv-open-document",this.pdfViewer.localeObj.getConstant("Open")),this.undoItem=this.addClassToolbarItem("_undo","e-pv-undo",this.pdfViewer.localeObj.getConstant("Undo")),this.redoItem=this.addClassToolbarItem("_redo","e-pv-redo",this.pdfViewer.localeObj.getConstant("Redo")),this.annotationItem=this.addClassToolbarItem("_annotation","e-pv-annotation",this.pdfViewer.localeObj.getConstant("Annotation")),this.textSearchItem=this.addClassToolbarItem("_search","e-pv-text-search",this.pdfViewer.localeObj.getConstant("Text Search"))},NRt.prototype.afterToolbarCreation=function(){var e=!!navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i);this.itemsContainer=this.toolbar.element.childNodes[0],this.itemsContainer.id=this.pdfViewer.element.id+"_toolbarItemsContainer",this.openDocumentItem=this.addClassToolbarItem("_open","e-pv-open-document",this.pdfViewer.localeObj.getConstant("Open")+(e?" (⌘+O)":" (Ctrl+O)")),this.undoItem=this.addClassToolbarItem("_undo","e-pv-undo",this.pdfViewer.localeObj.getConstant("Undo")+(e?" (⌘+Z)":" (Ctrl+Z)")),this.redoItem=this.addClassToolbarItem("_redo","e-pv-redo",this.pdfViewer.localeObj.getConstant("Redo")+(e?" (⌘+Y)":" (Ctrl+Y)")),this.pdfViewer.enableRtl?(this.firstPageItem=this.addClassToolbarItem("_firstPage","e-pv-last-page-navigation",this.pdfViewer.localeObj.getConstant("Go To First Page")+(e?" (⌘+← or ⌘+↑)":" (Ctrl+← or Ctrl+↑)")),this.previousPageItem=this.addClassToolbarItem("_previousPage","e-pv-next-page-navigation",this.pdfViewer.localeObj.getConstant("Previous Page")+" (←)"),this.nextPageItem=this.addClassToolbarItem("_nextPage","e-pv-previous-page-navigation",this.pdfViewer.localeObj.getConstant("Next Page")+" (→)"),this.lastPageItem=this.addClassToolbarItem("_lastPage","e-pv-first-page-navigation",this.pdfViewer.localeObj.getConstant("Go To Last Page")+(e?" (⌘+→ or ⌘+↓)":" (Ctrl+→ or Ctrl+↓)"))):(this.firstPageItem=this.addClassToolbarItem("_firstPage","e-pv-first-page-navigation",this.pdfViewer.localeObj.getConstant("Go To First Page")+(e?" (⌘+← or ⌘+↑)":" (Ctrl+← or Ctrl+↑)")),this.previousPageItem=this.addClassToolbarItem("_previousPage","e-pv-previous-page-navigation",this.pdfViewer.localeObj.getConstant("Previous Page")+" (←)"),this.nextPageItem=this.addClassToolbarItem("_nextPage","e-pv-next-page-navigation",this.pdfViewer.localeObj.getConstant("Next Page")+" (→)"),this.lastPageItem=this.addClassToolbarItem("_lastPage","e-pv-last-page-navigation",this.pdfViewer.localeObj.getConstant("Go To Last Page")+(e?" (⌘+→ or ⌘+↓)":" (Ctrl+→ or Ctrl+↓)"))),this.zoomOutItem=this.addClassToolbarItem("_zoomOut","e-pv-zoom-out",this.pdfViewer.localeObj.getConstant("Zoom Out")+(e?" (⌘+Minus)":" (Ctrl+Minus)")),this.zoomInItem=this.addClassToolbarItem("_zoomIn","e-pv-zoom-in",this.pdfViewer.localeObj.getConstant("Zoom In")+(e?" (⌘+Plus)":" (Ctrl+Plus)")),this.textSelectItem=this.addClassToolbarItem("_selectTool","e-pv-text-select-tool",this.pdfViewer.localeObj.getConstant("Text Selection")+(e?" (⇧+V)":" (Shift+V)")),this.panItem=this.addClassToolbarItem("_handTool","e-pv-pan-tool",this.pdfViewer.localeObj.getConstant("Panning")+(e?" (⇧+H)":" (Shift+H)")),this.commentItem=this.addClassToolbarItem("_comment","e-pv-comment",this.pdfViewer.localeObj.getConstant("Add Comments")),this.textSearchItem=this.addClassToolbarItem("_search","e-pv-text-search",this.pdfViewer.localeObj.getConstant("Text Search")+(e?" (⌘+F)":" (Ctrl+F)")),this.textSearchItem.setAttribute("aria-label",this.pdfViewer.localeObj.getConstant("Search text")),this.annotationItem=this.addClassToolbarItem("_annotation","e-pv-annotation",this.pdfViewer.localeObj.getConstant("Annotation")+(e?" (⌘+⇧+A)":" (Ctrl+Shift+A)")),this.annotationItem.setAttribute("aria-label",this.pdfViewer.localeObj.getConstant("Annotation Edit text")),this.formDesignerItem=this.addClassToolbarItem("_formdesigner","e-pv-formdesigner",this.pdfViewer.localeObj.getConstant("FormDesigner")),this.printItem=this.addClassToolbarItem("_print","e-pv-print-document",this.pdfViewer.localeObj.getConstant("Print")+(e?" (⌘+P)":" (Ctrl+P)")),this.downloadItem=this.addClassToolbarItem("_download","e-pv-download-document",this.pdfViewer.localeObj.getConstant("Download file")+(e?" (⌘+S)":" (Ctrl+S)")),this.zoomDropdownItem=this.pdfViewerBase.getElement("_zoomDropDown"),this.createTooltip(this.zoomDropdownItem,this.pdfViewer.localeObj.getConstant("Zoom")),this.zoomDropdownItem.setAttribute("aria-label",this.pdfViewer.localeObj.getConstant("Zoom")),this.addPropertiesToolItemContainer(this.zoomDropdownItem.parentElement.parentElement,null,"_zoomDropDownContainer"),this.createTooltip(this.currentPageBoxElement,this.pdfViewer.localeObj.getConstant("Page Number")+(e?" (⌘+G)":" (Ctrl+G)")),this.currentPageBoxElement.setAttribute("aria-label",this.pdfViewer.localeObj.getConstant("Page Number")),this.submitItem=this.pdfViewerBase.getElement("_submitForm"),this.addPropertiesToolItemContainer(this.submitItem.parentElement,"e-pv-submit","_submitFormContainer"),this.createTooltip(this.submitItem,this.pdfViewer.localeObj.getConstant("SubmitForm")),this.submitItem.setAttribute("aria-label",this.pdfViewer.localeObj.getConstant("SubmitForm")),this.addPropertiesToolItemContainer(this.currentPageBoxElement.parentElement.parentElement,"e-pv-current-page-container","_currentPageInputContainer"),this.pdfViewerBase.getElement("_currentPageInputContainer").style.minWidth="20px",this.totalPageItem=this.pdfViewerBase.getElement("_totalPage"),this.addPropertiesToolItemContainer(this.totalPageItem.parentElement,"e-pv-total-page-container","_totalPageContainer")},NRt.prototype.addClassToolbarItem=function(e,t,i){var n=this.pdfViewerBase.getElement(e);return n.classList.add(t),n.classList.add("e-pv-tbar-btn"),n.setAttribute("aria-label",i),n.parentElement.classList.add(t+"-container"),n.parentElement.classList.add("e-popup-text"),n.parentElement.id=this.pdfViewer.element.id+e+"Container",0<n.childNodes.length&&((t=n.childNodes[0]).id=this.pdfViewer.element.id+e+"Icon",t.classList.remove("e-icons"),t.classList.remove("e-btn-icon"),this.pdfViewer.enableRtl&&t.classList.add("e-right"),t=n.childNodes[1])&&t.classList.contains("e-tbar-btn-text")&&(t.id=this.pdfViewer.element.id+e+"Text"),n.style.width="",this.createTooltip(n,i),n},NRt.prototype.addPropertiesToolItemContainer=function(e,t,i){null!==t&&e.classList.add(t),e.classList.add("e-popup-text"),e.id=this.pdfViewer.element.id+i},NRt.prototype.createZoomDropdownElement=function(){return this.createToolbarItem("input",this.pdfViewer.element.id+"_zoomDropDown",null).outerHTML},NRt.prototype.createZoomDropdown=function(){var e,t,i=this,n=i.pdfViewer.minZoom,o=i.pdfViewer.maxZoom,r=[],s=[10,25,50,75,100,125,150,200,400];if(null!=n&&null!=o&&o<n&&(e=o,o=n,n=e),null!=n||null!=o){var a=0;null==n||r.some(function(e){return parseInt(e.id,10)===n})||(r.push({percent:n+"%",id:a.toString()}),a++);for(var l=0;l<s.length;l++){var h=s[parseInt(l.toString(),10)];t=h,(null==n||n<=t)&&(null==o||t<=o)&&h!==n&&h!==o&&(r.push({percent:h+"%",id:a.toString()}),a++)}null==o||r.some(function(e){return parseInt(e.id,10)===o})||o===n||(r.push({percent:o+"%",id:a.toString()}),a++),r.sort(function(e,t){return parseInt(e.id,10)-parseInt(t.id,10)})}else r.push({percent:"10%",id:"0"},{percent:"35%",id:"1"},{percent:"50%",id:"2"},{percent:"75%",id:"3"},{percent:"100%",id:"4"},{percent:"125%",id:"5"},{percent:"150%",id:"6"},{percent:"200%",id:"7"},{percent:"400%",id:"8"});r.push({percent:i.pdfViewer.localeObj.getConstant("Fit Page"),id:"fitPage"},{percent:i.pdfViewer.localeObj.getConstant("Fit Width"),id:"fitWidth"},{percent:i.pdfViewer.localeObj.getConstant("Automatic"),id:"automatic"}),i.pdfViewer.enableRtl?i.zoomDropDown=new oU({dataSource:r,text:"100%",enableRtl:!0,fields:{text:"percent",value:"id"},readonly:!0,cssClass:"e-pv-zoom-drop-down-rtl",popupHeight:"450px",showClearButton:!1,open:i.openZoomDropdown.bind(i),select:function(e){"keydown"===e.e.type&&e.itemData.percent!==i.zoomDropDown.element.value&&(i.zoomDropDownChange(i.zoomDropDown.element.value),e.cancel=!0)}}):i.zoomDropDown=new oU({dataSource:r,text:"100%",fields:{text:"percent",value:"id"},readonly:!0,cssClass:"e-pv-zoom-drop-down",popupHeight:"450px",showClearButton:!1,open:i.openZoomDropdown.bind(i),select:function(e){"keydown"===e.e.type&&e.itemData.percent!==i.zoomDropDown.element.value&&(i.zoomDropDownChange(i.zoomDropDown.element.value),e.cancel=!0)}}),i.zoomDropDown.appendTo(i.pdfViewerBase.getElement("_zoomDropDown"))},NRt.prototype.createCurrentPageInputTemplate=function(){return this.createToolbarItem("input",this.pdfViewer.element.id+"_currentPageInput",null).outerHTML},NRt.prototype.createTotalPageTemplate=function(){return this.createToolbarItem("span",this.pdfViewer.element.id+"_totalPage","e-pv-total-page").outerHTML},NRt.prototype.createNumericTextBox=function(){this.currentPageBox=new NL({value:0,format:"##",cssClass:"e-pv-current-page-box",showSpinButton:!1}),this.currentPageBoxElement=this.pdfViewerBase.getElement("_currentPageInput"),this.currentPageBox.appendTo(this.currentPageBoxElement)},NRt.prototype.createToolbarItemsForMobile=function(){this.toolbarElement.classList.add("e-pv-mobile-toolbar");var e='<button id="'+this.pdfViewer.element.id+'_more_option" class="e-tbar-btn"></button>';this.toolbar=new U3({items:[{prefixIcon:"e-pv-open-document-icon e-pv-icon",tooltipText:this.pdfViewer.localeObj.getConstant("Open"),id:this.pdfViewer.element.id+"_open"},{type:"Separator",align:"Left"},{prefixIcon:"e-pv-undo-icon e-pv-icon",tooltipText:this.pdfViewer.localeObj.getConstant("Undo"),id:this.pdfViewer.element.id+"_undo"},{prefixIcon:"e-pv-redo-icon e-pv-icon",tooltipText:this.pdfViewer.localeObj.getConstant("Redo"),id:this.pdfViewer.element.id+"_redo"},{tooltipText:"Organize PDF",id:this.pdfViewer.element.id+"_menu_organize",prefixIcon:"e-pv-organize-view-icon e-pv-icon",align:"Right",disabled:!0},{prefixIcon:"e-pv-annotation-icon e-pv-icon",cssClass:"e-pv-annotation-container",tooltipText:this.pdfViewer.localeObj.getConstant("Annotation"),id:this.pdfViewer.element.id+"_annotation",align:"Right"},{prefixIcon:"e-pv-text-search-icon e-pv-icon",tooltipText:this.pdfViewer.localeObj.getConstant("Text Search"),id:this.pdfViewer.element.id+"_search",align:"Right"},{template:e,align:"Right"}],clicked:this.toolbarClickHandler,width:"",height:"",overflowMode:"Popup"}),this.toolbar.isStringTemplate=!0,this.toolbar.appendTo(this.toolbarElement),this.openDocumentItem=this.pdfViewerBase.getElement("_open"),this.openDocumentItem.classList.add("e-pv-open-document"),this.openDocumentItem.firstElementChild.id=this.pdfViewer.element.id+"_openIcon",this.annotationItem=this.pdfViewerBase.getElement("_annotation"),this.annotationItem.classList.add("e-pv-annotation"),this.annotationItem.firstElementChild.id=this.pdfViewer.element.id+"_annotationIcon",this.organizePageItem=this.pdfViewerBase.getElement("_menu_organize"),this.organizePageItem.classList.add("e-pv-organize-view"),this.annotationItem.firstElementChild.id=this.pdfViewer.element.id+"_organize-view_icon",this.textSearchItem=this.pdfViewerBase.getElement("_search"),this.textSearchItem.classList.add("e-pv-text-search"),this.textSearchItem.firstElementChild.id=this.pdfViewer.element.id+"_searchIcon",this.undoItem=this.pdfViewerBase.getElement("_undo"),this.undoItem.classList.add("e-pv-undo"),this.redoItem=this.pdfViewerBase.getElement("_redo"),this.redoItem.classList.add("e-pv-redo"),this.redoItem.firstElementChild.id=this.pdfViewer.element.id+"_redoIcon",this.undoItem.firstElementChild.id=this.pdfViewer.element.id+"_undoIcon",this.createMoreOption(this.pdfViewer.element.id+"_more_option")},NRt.prototype.createMoreOption=function(e){var i=this,t=(this.moreOptionItem=document.getElementById(e),[{text:this.pdfViewer.localeObj.getConstant("Download"),id:this.pdfViewer.element.id+"_menu_download",iconCss:"e-icons e-pv-download-document-icon e-pv-icon"},{text:this.pdfViewer.localeObj.getConstant("Bookmarks"),id:this.pdfViewer.element.id+"_menu_bookmarks",iconCss:"e-icons e-pv-bookmark-icon e-pv-icon"}]);this.moreDropDown=new u2({items:t,iconCss:"e-pv-more-icon e-pv-icon",cssClass:"e-caret-hide",open:function(e){var t=i.moreDropDown.element.getBoundingClientRect();i.pdfViewer.enableRtl||(e.element.parentElement.style.left=t.left+t.width-e.element.parentElement.offsetWidth+"px")},select:function(e){switch(e.item.id){case i.pdfViewer.element.id+"_menu_download":i.pdfViewerBase.download();break;case i.pdfViewer.element.id+"_menu_bookmarks":i.showToolbar(!1),i.pdfViewerBase.navigationPane.createNavigationPaneMobile("bookmarks")}},beforeItemRender:function(e){e.item.id===i.pdfViewer.element.id+"_menu_bookmarks"?i.pdfViewer.bookmarkViewModule&&i.pdfViewer.bookmarkViewModule.bookmarks?e.element.classList.remove("e-disabled"):e.element.classList.add("e-disabled"):e.item.id===i.pdfViewer.element.id+"_menu_download"&&(i.pdfViewer.enableDownload?e.element.classList.remove("e-disabled"):e.element.classList.add("e-disabled"))},close:function(e){i.moreOptionItem.blur(),i.pdfViewerBase.focusViewerContainer()}}),this.moreDropDown.appendTo("#"+e)},NRt.prototype.createToolbarItem=function(e,t,i){var n=Q(e,{id:t});return null!==i&&(n.className=i),"input"===e&&t!==this.pdfViewer.element.id+"_zoomDropDown"&&(n.type="text"),n},NRt.prototype.createTooltip=function(e,t){null!==t&&new NS({content:ao(function(){return t}),opensOn:"Hover",beforeOpen:this.onTooltipBeforeOpen.bind(this)}).appendTo(e)},NRt.prototype.onTooltipBeforeOpen=function(e){!this.pdfViewer.toolbarSettings.showTooltip&&this.toolbarElement.contains(e.target)&&(e.cancel=!0),this.annotationToolbarModule&&!this.pdfViewer.toolbarSettings.showTooltip&&(this.annotationToolbarModule.toolbarElement&&this.annotationToolbarModule.toolbarElement.contains(e.target)||this.annotationToolbarModule.shapeToolbarElement&&this.annotationToolbarModule.shapeToolbarElement.contains(e.target))&&(e.cancel=!0),this.formDesignerToolbarModule&&!this.pdfViewer.toolbarSettings.showTooltip&&this.formDesignerToolbarModule.toolbarElement&&this.formDesignerToolbarModule.toolbarElement.contains(e.target)&&(e.cancel=!0)},NRt.prototype.createFileElement=function(e){e&&(N?this.fileInputElement=this.pdfViewer.element.querySelector(".e-pv-fileupload-element"):(this.fileInputElement=Q("input",{id:this.pdfViewer.element.id+"_fileUploadElement",styles:"position:fixed; left:-100em",attrs:{type:"file"}}),this.fileInputElement.setAttribute("accept",".pdf"),this.fileInputElement.setAttribute("aria-label","file upload element"),this.fileInputElement.setAttribute("tabindex","-1")),e)&&e.appendChild(this.fileInputElement)},NRt.prototype.wireEvent=function(){this.fileInputElement&&this.fileInputElement.addEventListener("change",this.loadDocument),N||F.isDevice&&!this.pdfViewer.enableDesktopMode||(this.toolbarElement.addEventListener("mouseup",this.toolbarOnMouseup.bind(this)),this.currentPageBoxElement.addEventListener("focusout",this.textBoxFocusOut),this.currentPageBoxElement.addEventListener("keypress",this.navigateToPage),this.zoomDropDown.change=this.zoomPercentSelect.bind(this),this.zoomDropDown.element.addEventListener("keypress",this.onZoomDropDownInput.bind(this)),this.zoomDropDown.element.addEventListener("click",this.onZoomDropDownInputClick.bind(this)))},NRt.prototype.unWireEvent=function(){this.fileInputElement&&this.fileInputElement.removeEventListener("change",this.loadDocument),F.isDevice&&!this.pdfViewer.enableDesktopMode||N||(je(this.toolbarElement)||this.toolbarElement.removeEventListener("mouseup",this.toolbarOnMouseup.bind(this)),je(this.currentPageBoxElement)||(this.currentPageBoxElement.removeEventListener("focusout",this.textBoxFocusOut),this.currentPageBoxElement.removeEventListener("keypress",this.navigateToPage)),je(this.zoomDropDown))||(this.zoomDropDown.removeEventListener("change",this.zoomPercentSelect),this.zoomDropDown.element.removeEventListener("keypress",this.onZoomDropDownInput),this.zoomDropDown.element.removeEventListener("click",this.onZoomDropDownInputClick))},NRt.prototype.onToolbarResize=function(e){F.isDevice&&!this.pdfViewer.enableDesktopMode?this.pdfViewerBase.navigationPane.toolbarResize():je(this.toolbar)||this.toolbar.refreshOverflow()},NRt.prototype.toolbarOnMouseup=function(e){e.target!==this.itemsContainer&&e.target!==this.toolbarElement||this.pdfViewerBase.focusViewerContainer()},NRt.prototype.applyHideToToolbar=function(e,t,i){for(var n,o=!e,r=t;r<=i;r++)!je(this.toolbar)&&this.toolbar.items[parseInt(r.toString(),10)]&&((n=this.toolbar.items[parseInt(r.toString(),10)].cssClass)&&""!==n?(n=this.toolbar.element.querySelector("."+n))&&this.toolbar.hideItem(n,o):this.toolbar.hideItem(r,o))},NRt.prototype.handleOpenIconClick=function(e,t){this.fileInputElement.click(),!F.isDevice||this.pdfViewer.enableDesktopMode||t||(N||e.originalEvent.target.blur(),this.pdfViewerBase.focusViewerContainer())},NRt.prototype.handleToolbarBtnClick=function(e,t){switch(this.addInkAnnotation(),this.deSelectCommentAnnotation(),e.originalEvent.target.id||!je(e.item)&&e.item.id){case this.pdfViewer.element.id+"_open":case this.pdfViewer.element.id+"_openIcon":case this.pdfViewer.element.id+"_openText":this.handleOpenIconClick(e,t);break;case this.pdfViewer.element.id+"_download":case this.pdfViewer.element.id+"_downloadIcon":case this.pdfViewer.element.id+"_downloadText":this.pdfViewerBase.download();break;case this.pdfViewer.element.id+"_print":case this.pdfViewer.element.id+"_printIcon":case this.pdfViewer.element.id+"_printText":this.pdfViewer.printModule&&this.pdfViewer.firePrintStart();break;case this.pdfViewer.element.id+"_undo":case this.pdfViewer.element.id+"_undoIcon":case this.pdfViewer.element.id+"_undoText":this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.undo();break;case this.pdfViewer.element.id+"_redo":case this.pdfViewer.element.id+"_redoIcon":case this.pdfViewer.element.id+"_redoText":this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.redo();break;case this.pdfViewer.element.id+"_firstPage":case this.pdfViewer.element.id+"_firstPageIcon":case this.pdfViewer.element.id+"_firstPageText":this.pdfViewer.navigationModule&&this.pdfViewer.navigationModule.goToFirstPage();break;case this.pdfViewer.element.id+"_previousPage":case this.pdfViewer.element.id+"_previousPageIcon":case this.pdfViewer.element.id+"_previousPageText":this.pdfViewer.navigationModule&&this.pdfViewer.navigationModule.goToPreviousPage();break;case this.pdfViewer.element.id+"_nextPage":case this.pdfViewer.element.id+"_nextPageIcon":case this.pdfViewer.element.id+"_nextPageText":this.pdfViewer.navigationModule&&this.pdfViewer.navigationModule.goToNextPage();break;case this.pdfViewer.element.id+"_lastPage":case this.pdfViewer.element.id+"_lastPageIcon":case this.pdfViewer.element.id+"_lastPageText":this.pdfViewer.navigationModule&&this.pdfViewer.navigationModule.goToLastPage();break;case this.pdfViewer.element.id+"_zoomIn":case this.pdfViewer.element.id+"_zoomInIcon":case this.pdfViewer.element.id+"_zoomInText":this.pdfViewer.magnificationModule.zoomIn();break;case this.pdfViewer.element.id+"_zoomOut":case this.pdfViewer.element.id+"_zoomOutIcon":case this.pdfViewer.element.id+"_zoomOutText":this.pdfViewer.magnificationModule.zoomOut();break;case this.pdfViewer.element.id+"_selectTool":case this.pdfViewer.element.id+"_selectToolIcon":case this.pdfViewer.element.id+"_selectToolText":this.isSelectionToolDisabled||(this.pdfViewerBase.initiateTextSelectMode(),this.updateInteractionTools(!0));break;case this.pdfViewer.element.id+"_handTool":case this.pdfViewer.element.id+"_handToolIcon":case this.pdfViewer.element.id+"_handToolText":this.isScrollingToolDisabled||this.getStampMode()||(this.pdfViewerBase.initiatePanning(),this.updateInteractionTools(!1));break;case this.pdfViewer.element.id+"_search":case this.pdfViewer.element.id+"_searchIcon":case this.pdfViewer.element.id+"_searchText":this.textSearchButtonHandler();break;case this.pdfViewer.element.id+"_annotation":case this.pdfViewer.element.id+"_annotationIcon":case this.pdfViewer.element.id+"_annotationText":this.initiateAnnotationMode(e.originalEvent.target.id,t);break;case this.pdfViewer.element.id+"_formdesigner":case this.pdfViewer.element.id+"_formdesignerIcon":case this.pdfViewer.element.id+"_formdesignerText":this.initiateFormDesignerMode(t),this.formDesignerToolbarModule.showHideDeleteIcon(!1);break;case this.pdfViewer.element.id+"_comment":case this.pdfViewer.element.id+"_commentIcon":case this.pdfViewer.element.id+"_commentText":this.pdfViewerBase.isAddComment=!0,this.pdfViewerBase.isCommentIconAdded=!0,this.annotationToolbarModule.deselectAllItems(),this.pdfViewer.annotation.triggerAnnotationUnselectEvent(),this.pdfViewer.annotation.triggerSignatureUnselectEvent(),this.addComments(e.originalEvent.target);break;case this.pdfViewer.element.id+"_submitForm":case this.pdfViewer.element.id+"_submitFormSpan":this.pdfViewerBase.exportFormFields(void 0,RCt.Json);break;case this.pdfViewer.element.id+"_menu_organize":je(this.pdfViewer.pageOrganizer)||this.pdfViewer.pageOrganizer.createOrganizeWindowForMobile();break;default:this.pdfViewer.fireCustomToolbarClickEvent(e)}},NRt.prototype.addInkAnnotation=function(){var e;this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.inkAnnotationModule&&(e=parseInt(this.pdfViewer.annotationModule.inkAnnotationModule.currentPageNumber,10),this.pdfViewer.annotationModule.inkAnnotationModule.drawInkAnnotation(e)),this.annotationToolbarModule&&(this.pdfViewer.toolbar.annotationToolbarModule.deselectInkAnnotation(),this.annotationToolbarModule.inkAnnotationSelected=!1)},NRt.prototype.deSelectCommentAnnotation=function(){N?this.pdfViewer.toolbar.deSelectItem(this.CommentElement):this.pdfViewer.toolbar.deSelectItem(this.commentItem),this.pdfViewerBase.isCommentIconAdded=!1},NRt.prototype.addComments=function(e){N?(this.pdfViewerBase.isCommentIconAdded=!0,this.pdfViewerBase.isAddComment=!0,this.annotationToolbarModule.deselectAllItemsInBlazor(),this.CommentElement.classList.add("e-pv-select")):e.id===this.pdfViewer.element.id+"_comment"||e.id===this.pdfViewer.element.id+"_commentIcon"||e.id===this.pdfViewer.element.id+"_commentText"?(e.id!==this.pdfViewer.element.id+"_commentIcon"&&e.id!==this.pdfViewer.element.id+"_commentText"||!e.parentElement?e:e.parentElement).classList.add("e-pv-select"):this.pdfViewer.enableRtl?e.className="e-pv-comment-selection-icon e-pv-icon e-icon-left e-right":e.className="e-pv-comment-selection-icon e-pv-icon e-icon-left",this.updateStampItems(),document.getElementById(this.pdfViewer.element.id+"_pageDiv_"+(this.pdfViewerBase.currentPageNumber-1)).addEventListener("mousedown",this.pdfViewer.annotationModule.stickyNotesAnnotationModule.drawIcons.bind(this))},NRt.prototype.openZoomDropdown=function(){var e,t,i=this;document.fullscreen&&(N?(e=document.fullscreenElement)&&"BODY"!==e.tagName&&"HTML"!==e.tagName&&setTimeout(function(){var e=document.getElementById(i.pdfViewer.element.id+"_zoomCombo_popup"),t=document.getElementById(i.toolbarElement.id);e&&t&&e.ej2_instances&&(t.appendChild(e),e.ej2_instances[0].refreshPosition())},100):(e=document.getElementById(this.pdfViewer.element.id+"_zoomDropDown_popup"),t=document.getElementById(this.toolbarElement.id),e&&t.appendChild(e)))},NRt.prototype.onZoomDropDownInput=function(e){return(e.which<48||57<e.which)&&8!==e.which&&13!==e.which&&32!==e.which?(e.preventDefault(),!1):(13===e.which&&(e.preventDefault(),e=this.zoomDropDown.element.value.trim(),this.zoomDropDownChange(e)),!0)},NRt.prototype.onZoomDropDownInputClick=function(){this.zoomDropDown.element.select()},NRt.prototype.zoomPercentSelect=function(e){0<this.pdfViewerBase.pageCount&&(e.isInteracted?e.itemData&&(e=e.itemData.percent,this.zoomDropDownChange(e)):this.updateZoomPercentage(this.pdfViewer.magnificationModule.zoomFactor))},NRt.prototype.zoomDropDownChange=function(e){e!==this.pdfViewer.localeObj.getConstant("Fit Width")&&e!==this.pdfViewer.localeObj.getConstant("Fit Page")&&e!==this.pdfViewer.localeObj.getConstant("Automatic")?(this.pdfViewer.magnificationModule.isAutoZoom=!1,this.pdfViewerBase.previousScrollbarWidth=this.pdfViewerBase.navigationPane.getViewerContainerScrollbarWidth(),this.pdfViewer.magnificationModule.zoomTo(parseFloat(e)),this.updateZoomPercentage(this.pdfViewer.magnificationModule.zoomFactor),this.zoomDropDown.focusOut()):e===this.pdfViewer.localeObj.getConstant("Fit Width")?(this.pdfViewer.magnificationModule.isAutoZoom=!1,this.pdfViewer.magnificationModule.fitToWidth(),this.zoomDropDown.focusOut()):e===this.pdfViewer.localeObj.getConstant("Fit Page")?(this.pdfViewer.magnificationModule.fitToPage(),this.zoomDropDown.focusOut()):e===this.pdfViewer.localeObj.getConstant("Automatic")&&(this.pdfViewer.magnificationModule.isAutoZoom=!0,this.pdfViewer.magnificationModule.fitToAuto(),this.zoomDropDown.focusOut())},NRt.prototype.updateZoomPercentage=function(e){var t,i;F.isDevice&&!this.pdfViewer.enableDesktopMode||(t=parseInt((100*e).toString(),10)+"%",N?(i=this.pdfViewerBase.getElement("_zoomDropDown"))&&0<i.children.length&&(i.children[0].children[0].value=t):je(this.zoomDropDown)||(this.zoomDropDown.text===t&&(this.zoomDropDown.element.value=t),11===this.zoomDropDown.index&&(this.zoomDropDown.value=4),this.pdfViewerBase.isMinimumZoom=e<=.25,this.zoomDropDown.text=t))},NRt.prototype.updateInteractionItems=function(){this.pdfViewer.textSelectionModule&&this.pdfViewer.enableTextSelection?this.enableItems(this.textSelectItem.parentElement,!0):this.enableItems(this.textSelectItem.parentElement,!1),this.enableItems(this.panItem.parentElement,!0),"TextSelection"===this.pdfViewer.interactionMode&&this.pdfViewer.enableTextSelection?(this.selectItem(this.textSelectItem),this.textSelectItem.setAttribute("tabindex","-1"),this.deSelectItem(this.panItem),this.panItem.setAttribute("tabindex","0")):(this.selectItem(this.panItem),this.panItem.setAttribute("tabindex","-1"),this.deSelectItem(this.textSelectItem),this.textSelectItem.setAttribute("tabindex","0"),this.pdfViewerBase.initiatePanning())},NRt.prototype.textSearchButtonHandler=function(e){var t;!F.isDevice||this.pdfViewer.enableDesktopMode?this.pdfViewer.textSearchModule&&0<this.pdfViewerBase.pageCount&&(this.isTextSearchBoxDisplayed=!this.isTextSearchBoxDisplayed,this.pdfViewer.textSearchModule.showSearchBox(this.isTextSearchBoxDisplayed),this.isTextSearchBoxDisplayed?(N||(this.selectItem(this.textSearchItem),this.textSearchItem.setAttribute("tabindex","0")),(t=document.getElementById(this.pdfViewer.element.id+"_search_input")).select(),t.focus()):N?(t=this.pdfViewerBase.getElement("_search"),e?t.firstElementChild.focus():(t.firstElementChild.blur(),this.pdfViewerBase.focusViewerContainer())):(this.deSelectItem(this.textSearchItem),this.textSearchItem.blur())):(this.showToolbar(!1),this.pdfViewerBase.navigationPane.createNavigationPaneMobile("search"))},NRt.prototype.initiateAnnotationMode=function(e,t){!F.isDevice||this.pdfViewer.enableDesktopMode?this.annotationToolbarModule&&this.pdfViewer.enableAnnotationToolbar&&(this.annotationToolbarModule.showAnnotationToolbar(this.annotationItem),this.pdfViewer.toolbarModule.annotationToolbarModule.toolbar.refreshOverflow(),(t||0<this.pdfViewer.toolbarModule.annotationToolbarModule.toolbar.items.length)&&document.getElementById(this.pdfViewer.toolbarModule.annotationToolbarModule.toolbar.items[0].id).focus(),this.pdfViewer.isAnnotationToolbarVisible)&&this.pdfViewer.isFormDesignerToolbarVisible&&(document.getElementById(this.pdfViewer.element.id+"_formdesigner_toolbar").style.display="none",this.formDesignerToolbarModule.isToolbarHidden=!1,this.formDesignerToolbarModule.showFormDesignerToolbar(this.formDesignerItem),this.annotationToolbarModule.adjustViewer(!0)):N||(e===this.pdfViewer.element.id+"_annotation"&&(e=this.pdfViewer.element.id+"_annotationIcon"),this.annotationToolbarModule.createAnnotationToolbarForMobile(e))},NRt.prototype.initiateFormDesignerMode=function(e){var t;this.formDesignerToolbarModule&&this.pdfViewer.enableFormDesignerToolbar&&(this.formDesignerToolbarModule.showFormDesignerToolbar(this.formDesignerItem),this.pdfViewer.isAnnotationToolbarVisible&&this.pdfViewer.isFormDesignerToolbarVisible&&(document.getElementById(this.pdfViewer.element.id+"_annotation_toolbar").style.display="none",je(t=document.getElementById(this.pdfViewer.element.id+"_commantPanel"))||je(this.pdfViewerBase.navigationPane)||"block"===t.style.display&&this.pdfViewerBase.navigationPane.closeCommentPanelContainer(),this.annotationToolbarModule.isToolbarHidden=!1,this.annotationToolbarModule.showAnnotationToolbar(this.annotationItem),this.formDesignerToolbarModule.adjustViewer(!0)),e)&&0<this.pdfViewer.toolbarModule.formDesignerToolbarModule.toolbar.items.length&&document.getElementById(this.pdfViewer.toolbarModule.formDesignerToolbarModule.toolbar.items[0].id).focus()},NRt.prototype.DisableInteractionTools=function(){this.deSelectItem(this.textSelectItem),this.deSelectItem(this.panItem)},NRt.prototype.selectItem=function(e){e&&e.classList.add("e-pv-select")},NRt.prototype.deSelectItem=function(e){e&&e.classList.remove("e-pv-select")},NRt.prototype.updateInteractionTools=function(e){var t=N;e?t?(this.selectItem(this.SelectToolElement),this.deSelectItem(this.PanElement)):(this.selectItem(this.textSelectItem),je(this.textSelectItem)||this.textSelectItem.setAttribute("tabindex","-1"),this.deSelectItem(this.panItem),je(this.panItem)||this.panItem.setAttribute("tabindex","0")):t?(this.selectItem(this.PanElement),this.deSelectItem(this.SelectToolElement)):(this.selectItem(this.panItem),je(this.panItem)||this.panItem.setAttribute("tabindex","-1"),this.deSelectItem(this.textSelectItem),je(this.textSelectItem)||this.textSelectItem.setAttribute("tabindex","0"))},NRt.prototype.initialEnableItems=function(){this.pdfViewer.enableToolbar?this.showToolbar(!0):this.showToolbar(!1),this.pdfViewer.enableNavigationToolbar?this.showNavigationToolbar(!0):this.showNavigationToolbar(!1),this.pdfViewer.pageOrganizer?this.showPageOrganizerToolbar(!0):this.showPageOrganizerToolbar(!1),N||(this.isPrintBtnVisible?this.showPrintOption(!0):this.showPrintOption(!1),this.isDownloadBtnVisible?this.showDownloadOption(!0):this.showDownloadOption(!1),this.isSearchBtnVisible?this.showSearchOption(!0):this.showSearchOption(!1),this.isCommentBtnVisible?this.showCommentOption(!0):this.showCommentOption(!1))},NRt.prototype.showSeparator=function(e){this.isOpenBtnVisible&&(this.isNavigationToolVisible||this.isMagnificationToolVisible||this.isSelectionBtnVisible||this.isScrollingBtnVisible||this.isUndoRedoBtnsVisible)||this.applyHideToToolbar(!1,je(this.itemsIndexArray[0])?1:this.itemsIndexArray[0].endIndex+1,je(this.itemsIndexArray[0])?1:this.itemsIndexArray[0].endIndex+1),(this.isNavigationToolVisible||this.isMagnificationToolVisible||this.isOpenBtnVisible)&&(!this.isOpenBtnVisible||this.isNavigationToolVisible)&&(this.isOpenBtnVisible||this.isNavigationToolVisible)&&(this.isMagnificationToolVisible||this.isScrollingBtnVisible||this.isSelectionBtnVisible)||this.applyHideToToolbar(!1,je(this.itemsIndexArray[1])?8:this.itemsIndexArray[1].endIndex+1,je(this.itemsIndexArray[1])?8:this.itemsIndexArray[1].endIndex+1),(this.isMagnificationToolVisible||this.isSelectionBtnVisible||this.isScrollingBtnVisible)&&(!this.isMagnificationToolVisible||this.isSelectionBtnVisible||this.isScrollingBtnVisible)&&(this.isMagnificationToolVisible||!this.isSelectionBtnVisible&&!this.isScrollingBtnVisible)||this.applyHideToToolbar(!1,je(this.itemsIndexArray[2])?12:this.itemsIndexArray[2].endIndex+1,je(this.itemsIndexArray[2])?12:this.itemsIndexArray[2].endIndex+1),(this.isMagnificationToolVisible||this.isNavigationToolVisible||this.isScrollingBtnVisible||this.isSelectionBtnVisible||!this.isUndoRedoBtnsVisible)&&this.isUndoRedoBtnsVisible||this.applyHideToToolbar(!1,je(this.itemsIndexArray[4])?15:this.itemsIndexArray[4].endIndex+1,je(this.itemsIndexArray[4])?15:this.itemsIndexArray[4].endIndex+1),this.isUndoRedoBtnsVisible&&(!this.isUndoRedoBtnsVisible||this.isCommentBtnVisible||this.isSubmitbtnvisible)||je(this.itemsIndexArray[5])||this.applyHideToToolbar(!1,this.itemsIndexArray[5].endIndex+1,this.itemsIndexArray[5].endIndex+1)},NRt.prototype.applyToolbarSettings=function(){var e=this.pdfViewer.toolbarSettings.toolbarItems;e&&(-1!==e.indexOf("OpenOption")?this.showOpenOption(!0):this.showOpenOption(!1),-1!==e.indexOf("PageNavigationTool")?this.showPageNavigationTool(!0):this.showPageNavigationTool(!1),-1!==e.indexOf("MagnificationTool")?this.showMagnificationTool(!0):this.showMagnificationTool(!1),-1!==e.indexOf("SelectionTool")?this.showSelectionTool(!0):this.showSelectionTool(!1),-1!==e.indexOf("PanTool")?this.showScrollingTool(!0):this.showScrollingTool(!1),-1!==e.indexOf("PrintOption")?this.showPrintOption(!0):this.showPrintOption(!1),-1!==e.indexOf("DownloadOption")?this.showDownloadOption(!0):this.showDownloadOption(!1),-1!==e.indexOf("SearchOption")?this.showSearchOption(!0):this.showSearchOption(!1),-1!==e.indexOf("UndoRedoTool")?this.showUndoRedoTool(!0):this.showUndoRedoTool(!1),-1!==e.indexOf("AnnotationEditTool")?this.showAnnotationEditTool(!0):this.showAnnotationEditTool(!1),-1!==e.indexOf("FormDesignerEditTool")?this.showFormDesignerEditTool(!0):this.showFormDesignerEditTool(!1),-1!==e.indexOf("CommentTool")?this.showCommentOption(!0):this.showCommentOption(!1),-1!==e.indexOf("SubmitForm")?this.showSubmitForm(!0):this.showSubmitForm(!1),this.showSeparator(e))},NRt.prototype.applyToolbarSettingsForMobile=function(){var e=this.pdfViewer.toolbarSettings.toolbarItems;e&&(-1!==e.indexOf("OpenOption")?this.showOpenOption(!0):this.showOpenOption(!1),-1!==e.indexOf("UndoRedoTool")?this.showUndoRedoTool(!0):this.showUndoRedoTool(!1),-1!==e.indexOf("AnnotationEditTool")?this.showAnnotationEditTool(!0):this.showAnnotationEditTool(!1),-1!==e.indexOf("SearchOption")?this.showSearchOption(!0):this.showSearchOption(!1))},NRt.prototype.getStampMode=function(){return!(!this.pdfViewer.annotation||!this.pdfViewer.annotation.stampAnnotationModule)&&this.pdfViewer.annotation.stampAnnotationModule.isStampAddMode},NRt.prototype.stampBeforeOpen=function(e){if(this.annotationToolbarModule.resetFreeTextAnnot(),""===e.ParentItem.Text&&this.pdfViewer.customStampSettings.isAddToMenu&&0<e.Items.length){for(var t=null,i=0;i<e.Items.length;i++)if("Custom Stamp"===e.Items[parseInt(i.toString(),10)].Text){e.Items[parseInt(i.toString(),10)].Items=[],t=e.Items[parseInt(i.toString(),10)];break}var n=this.pdfViewerBase.customStampCollection,o=this.pdfViewer.customStampSettings.customStamps;if(0===n.length&&o&&0<o.length)for(var r=0;r<o.length;r++)n.push({customStampName:o[parseInt(r.toString(),10)].customStampName,customStampImageSource:o[parseInt(r.toString(),10)].customStampImageSource});for(var s=0;s<n.length;s++)null!=t&&t.Items.push({text:n[parseInt(s.toString(),10)].customStampName})}},NRt.prototype.stampBeforeClose=function(e,t){e.ParentItem&&"Custom Stamp"!==e.ParentItem.Text&&"Standard Business"!==e.ParentItem.Text&&"Dynamic"!==e.ParentItem.Text&&"Sign Here"!==e.ParentItem.Text||e.ParentItem},NRt.prototype.updateStampItems=function(){this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.stampAnnotationModule&&this.pdfViewer.annotationModule.stampAnnotationModule.isNewStampAnnot&&(this.pdfViewer.selectedItems.annotations[0]&&(this.pdfViewer.remove(this.pdfViewer.selectedItems.annotations[0]),this.pdfViewer.clearSelection(this.pdfViewer.currentPageNumber-1),this.pdfViewer.renderDrawing(),this.pdfViewerBase.tool=null),this.pdfViewerBase.isAlreadyAdded=!1,this.pdfViewer.annotationModule.stampAnnotationModule.isNewStampAnnot=!1)},NRt.prototype.stampSelect=function(e,t){if(this.pdfViewerBase.isAlreadyAdded=!1,this.updateStampItems(),"Custom Stamp"===e.Item.Text){this.annotationToolbarModule.checkStampAnnotations(),this.pdfViewer.annotation.stampAnnotationModule.isStampAddMode=!0;var i=Q("input",{id:this.pdfViewer.element.id+"_stampElement",attrs:{type:"file"}});i.setAttribute("accept",".jpg,.jpeg,.png"),i.style.position="absolute",i.style.left="0px",i.style.top="0px",i.style.visibility="hidden",document.body.appendChild(i),i.click(),i.addEventListener("change",this.annotationToolbarModule.addStampImage),document.body.removeChild(i)}else if("Custom Stamp"===t&&""!==e.Item.Text)for(var n=this.pdfViewerBase.customStampCollection,o=0;o<n.length;o++)n[parseInt(o.toString(),10)].customStampName===e.Item.Text&&(this.pdfViewer.annotationModule.stampAnnotationModule.customStampName=e.Item.Text,this.annotationToolbarModule.checkStampAnnotations(),this.pdfViewer.annotation.stampAnnotationModule.isStampAddMode=!0,this.pdfViewer.annotationModule.stampAnnotationModule.isStampAnnotSelected=!0,this.pdfViewerBase.stampAdded=!0,this.pdfViewerBase.isAlreadyAdded=!0,this.pdfViewer.annotationModule.stampAnnotationModule.createCustomStampAnnotation(n[parseInt(o.toString(),10)].customStampImageSource),this.pdfViewerBase.stampAdded=!1);else"Dynamic"===e.Item.Text||""===e.Item.Text||"Standard Business"===e.Item.Text||"Sign Here"!==t&&"Sign Here"===e.Item.Text||(this.annotationToolbarModule.checkStampAnnotations(),this.pdfViewer.annotation.stampAnnotationModule.isStampAddMode=!0,this.pdfViewer.annotationModule.stampAnnotationModule.isStampAnnotSelected=!0,this.pdfViewerBase.stampAdded=!0,"Dynamic"===t?(this.pdfViewerBase.isDynamicStamp=!0,this.pdfViewer.annotationModule.stampAnnotationModule.retrieveDynamicStampAnnotation(e.Item.Text)):(this.pdfViewerBase.isDynamicStamp=!1,this.pdfViewer.annotationModule.stampAnnotationModule.retrievestampAnnotation(e.Item.Text)))},NRt.prototype.enableItems=function(e,t){this.toolbar.enableItems(e,t),e&&e.id===this.pdfViewer.element.id+"_zoomDropDownContainer"?(this.pdfViewerBase.getElement("_zoomDropDown").setAttribute("tabindex",t?"0":"-1"),this.pdfViewerBase.getElement("_zoomDropDown").setAttribute("data-tabindex",t?"0":"-1")):e.firstElementChild&&e.id!==this.pdfViewer.element.id+"_zoomDropDownContainer"&&(e.firstElementChild.setAttribute("tabindex",t?"0":"-1"),e.firstElementChild.setAttribute("data-tabindex",t?"0":"-1"))},NRt.prototype.getModuleName=function(){return"Toolbar"};Vft=NRt;function NRt(e,t){var o=this;this.isPageNavigationToolDisabled=!1,this.isMagnificationToolDisabled=!1,this.isSelectionToolDisabled=!1,this.isScrollingToolDisabled=!1,this.isOpenBtnVisible=!0,this.isNavigationToolVisible=!0,this.isMagnificationToolVisible=!0,this.isSelectionBtnVisible=!0,this.isScrollingBtnVisible=!0,this.isDownloadBtnVisible=!0,this.isPrintBtnVisible=!0,this.isSearchBtnVisible=!0,this.isTextSearchBoxDisplayed=!1,this.isUndoRedoBtnsVisible=!0,this.isAnnotationEditBtnVisible=!0,this.isFormDesignerEditBtnVisible=!0,this.isCommentBtnVisible=!0,this.isSubmitbtnvisible=!0,this.toolItems=[],this.itemsIndexArray=[],this.onToolbarKeydown=function(e){var t="Tab"===e.key||!0===e.shiftKey||"Enter"===e.key||" "===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key||"ArrowLeft"===e.key||"ArrowRight"===e.key,i=e.target.id,n=o.toolItems.filter(function(e){return e.id===i});i===o.pdfViewer.element.id+"_currentPageInput"||i===o.pdfViewer.element.id+"_zoomDropDown"||0<n.length||t||(e.preventDefault(),e.stopPropagation())},this.toolbarClickHandler=function(t){var e=t.originalEvent&&"mouse"!==t.originalEvent.pointerType&&"touch"!==t.originalEvent.pointerType,i=(F.isDevice&&!o.pdfViewer.enableDesktopMode||(t.originalEvent.target===o.zoomDropdownItem.parentElement.childNodes[1]||t.originalEvent.target===o.zoomDropdownItem.parentElement.childNodes[2]?t.cancel=!0:t.originalEvent.target.id===o.pdfViewer.element.id+"_openIcon"&&(i=t.originalEvent.target.parentElement.dataset)&&i.tooltipId&&(i=document.getElementById(i.tooltipId))&&(i.style.display="none")),o.handleToolbarBtnClick(t,e),t.originalEvent.target),n=[];je(t.item)||(n=o.toolItems.filter(function(e){return e.id===t.item.id})),(!F.isDevice||o.pdfViewer.enableDesktopMode)&&(t.originalEvent.target===o.zoomDropdownItem.parentElement.childNodes[1]||t.originalEvent.target===o.zoomDropdownItem.parentElement.childNodes[2]||t.originalEvent.target===o.currentPageBoxElement||t.originalEvent.target===o.textSearchItem.childNodes[0]||0<n.length||e||i.parentElement.id===o.pdfViewer.element.id+"_toolbarContainer_nav"||i.id===o.pdfViewer.element.id+"_toolbarContainer_nav")||(t.originalEvent.target.blur(),o.pdfViewerBase.focusViewerContainer())},this.loadDocument=function(t){var e,i=t.target.files;null!==t.target.files[0]&&(i=i[0])&&(o.uploadedDocumentName=i.name,e=new FileReader,o.pdfViewerBase.clientSideRendering?e.readAsArrayBuffer(i):e.readAsDataURL(i),e.onload=function(e){t.target.value=null;e=e.currentTarget.result;o.pdfViewer.uploadedFileByteArray=new Uint8Array(e),N?o.pdfViewer._dotnetInstance.invokeMethodAsync("LoadDocumentFromClient",e):(o.pdfViewerBase.clientSideRendering?(o.uploadedFile=o.pdfViewer.uploadedFileByteArray,o.pdfViewer.load(o.pdfViewer.uploadedFileByteArray,null),o.pdfViewerBase.isSkipDocumentPath=!0,o.pdfViewer.documentPath=o.pdfViewer.uploadedFileByteArray):(o.uploadedFile=e,o.pdfViewer.load(e,null),o.pdfViewerBase.isSkipDocumentPath=!0,o.pdfViewer.documentPath=e),o.pdfViewerBase.documentPathByteArray=o.pdfViewer.documentPath),je(o.fileInputElement)||(o.fileInputElement.value="")})},this.navigateToPage=function(e){13===e.which&&(null!==(e=parseInt(o.currentPageBoxElement.value,10))&&0<e&&e<=o.pdfViewerBase.pageCount?o.pdfViewer.navigationModule&&o.pdfViewer.navigationModule.goToPage(e):o.updateCurrentPage(o.pdfViewerBase.currentPageNumber),o.currentPageBoxElement.blur(),o.pdfViewerBase.focusViewerContainer())},this.textBoxFocusOut=function(){(null===o.currentPageBox.value||o.currentPageBox.value>=o.pdfViewerBase.pageCount||o.currentPageBox.value!==o.pdfViewerBase.currentPageNumber)&&o.updateCurrentPage(o.pdfViewerBase.currentPageNumber)},this.pdfViewer=e,this.pdfViewerBase=t}_Rt.prototype.initializeAnnotationToolbar=function(){var e=this;this.toolbarElement=Q("div",{id:this.pdfViewer.element.id+"_annotation_toolbar",className:"e-pv-annotation-toolbar"}),this.pdfViewerBase.viewerMainContainer.appendChild(this.toolbarElement),this.toolbar=new U3({width:"",height:"",overflowMode:"Popup",cssClass:"e-pv-toolbar-scroll",items:this.createToolbarItems(),clicked:this.onToolbarClicked.bind(this),created:function(){e.createDropDowns()}}),this.toolbar.isStringTemplate=!0,this.pdfViewer.enableRtl&&(this.toolbar.enableRtl=!0),this.toolbar.appendTo(this.toolbarElement),this.afterToolbarCreation(),this.createStampContainer(),this.createSignContainer(),this.applyAnnotationToolbarSettings(),this.updateToolbarItems(),this.showAnnotationToolbar(null,!0),this.toolbarElement.setAttribute("aria-label","Annotation Toolbar")},_Rt.prototype.createMobileAnnotationToolbar=function(e,t){var i=this;F.isDevice&&!this.pdfViewer.enableDesktopMode?null==this.toolbarElement&&e?(this.isMobileAnnotEnabled=!0,this.toolbarElement=Q("div",{id:this.pdfViewer.element.id+"_annotation_toolbar",className:"e-pv-annotation-toolbar"}),this.pdfViewerBase.viewerMainContainer.insertBefore(this.toolbarElement,this.pdfViewerBase.viewerContainer),this.toolbar=new U3({width:"",height:"",overflowMode:"Popup",items:this.createMobileToolbarItems(t),clicked:this.onToolbarClicked.bind(this),created:function(){i.createDropDowns(t)}}),this.toolbar.isStringTemplate=!0,this.pdfViewer.enableRtl&&(this.toolbar.enableRtl=!0),this.pdfViewerBase.navigationPane.goBackToToolbar(),this.pdfViewer.toolbarModule.showToolbar(!1),this.toolbar.appendTo(this.toolbarElement),this.deleteItem=this.pdfViewerBase.getElement("_annotation_delete"),this.deleteItem.firstElementChild.id=this.pdfViewer.element.id+"_annotation_delete"):null!=this.toolbarElement&&(e?(this.isMobileAnnotEnabled=!0,this.pdfViewerBase.navigationPane.goBackToToolbar(),this.pdfViewer.toolbarModule.showToolbar(!1),this.toolbarElement.style.display="block"):(this.isMobileAnnotEnabled=!1,this.pdfViewer.toolbarModule.showToolbar(!0),this.hideMobileAnnotationToolbar())):this.isMobileAnnotEnabled=!0},_Rt.prototype.hideMobileAnnotationToolbar=function(){var e;null!=this.toolbarElement?(0<this.pdfViewer.selectedItems.annotations.length||!je(this.pdfViewer.annotationModule.textMarkupAnnotationModule)&&this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation?this.propertyToolbar&&0<this.propertyToolbar.element.children.length&&(this.propertyToolbar.element.style.display="block",this.toolbarCreated=!0):(0<this.toolbar.element.children.length?this.toolbarCreated=!0:this.toolbarCreated=!1,this.propertyToolbar&&"none"!==this.propertyToolbar.element.style.display&&(this.propertyToolbar.element.style.display="none",this.toolbarCreated||(e=document.getElementById(this.pdfViewer.element.id+"_annotationIcon"))&&e.parentElement.classList.contains("e-pv-select")&&this.createAnnotationToolbarForMobile())),0<this.toolbarElement.children.length&&(this.toolbarElement.style.display="block"),this.adjustMobileViewer()):this.toolbarCreated&&this.propertyToolbar&&0<this.propertyToolbar.element.children.length&&(this.propertyToolbar.element.style.display="none",this.adjustMobileViewer(),this.toolbarCreated=!1)},_Rt.prototype.FreeTextForMobile=function(){var e=this,t=(this.hideExistingTool(),this.freetextToolbarElement=Q("div",{id:this.pdfViewer.element.id+"_freeTextToolbar",className:"e-pv-mobile-annotation-toolbar",styles:"bottom: 0px; position: absolute; width: 100%; float: left"}),this.pdfViewerBase.viewerMainContainer.appendChild(this.freetextToolbarElement),this.pdfViewer.toolbarModule.annotationToolbarModule.getTemplate("span","_annotation_color","e-pv-annotation-color-container")),i=this.pdfViewer.toolbarModule.annotationToolbarModule.getTemplate("span","_annotation_stroke","e-pv-annotation-stroke-container"),n=this.getTemplate("span","_annotation_thickness","e-pv-annotation-thickness-container"),o=this.getTemplate("span","_annotation_opacity","e-pv-annotation-opacity-container"),r=this.getTemplate("input","_annotation_fontname","e-pv-annotation-fontname-container"),s=this.getTemplate("input","_annotation_fontsize","e-pv-annotation-fontsize-container"),a=this.getTemplate("span","_annotation_textcolor","e-pv-annotation-textcolor-container"),l=this.getTemplate("span","_annotation_textalign","e-pv-annotation-textalign-container"),h=this.getTemplate("span","_annotation_textproperties","e-pv-annotation-textprop-container"),r=[{prefixIcon:"e-pv-backward-icon e-pv-icon",tooltipText:this.pdfViewer.localeObj.getConstant("Go Back"),id:this.pdfViewer.element.id+"_backward",click:this.goBackToToolbar.bind(this)},{type:"Separator",align:"Left",cssClass:"e-pv-hightlight-separator-container"},{template:r},{template:s},{template:a},{template:l},{template:h},{template:t},{template:i},{template:n},{template:o}];this.toolbar=new U3({items:r,width:"",height:"",overflowMode:"Scrollable",created:function(){e.pdfViewer.toolbarModule.annotationToolbarModule.mobileColorpicker(e.pdfViewer.element.id+"_annotation_freeTextEdit")}}),this.toolbar.appendTo(this.freetextToolbarElement),this.showFreeTextPropertiesTool()},_Rt.prototype.createPropertyTools=function(e){var t,i,n,o=this;""!==e&&(this.propertyToolbar&&this.propertyToolbar.destroy(),this.toolbar&&this.toolbar.destroy(),n=void 0,(n=document.getElementById(this.pdfViewer.element.id+"_propertyToolbar"))&&n.parentElement.removeChild(n),n=Q("div",{id:this.pdfViewer.element.id+"_propertyToolbar",className:"e-pv-mobile-annotation-toolbar",styles:"bottom: 0px; position: absolute; width: 100%; float: left"}),this.pdfViewerBase.viewerMainContainer.appendChild(n),(i=new U3({items:this.createPropertyToolbarForMobile(e),width:"",height:"",overflowMode:"Scrollable",created:function(){t=!je(o.pdfViewer.annotationModule.textMarkupAnnotationModule)&&o.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation?o.pdfViewer.element.id+"_underlineIcon":je(o.pdfViewer.selectedItems.annotations[0])?"Highlight"===e||"Underline"===e||"Strikethrough"===e?o.pdfViewer.element.id+"_highlightIcon":o.pdfViewer.element.id+"_annotation_shapesIcon":"FreeText"===o.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?o.pdfViewer.element.id+"_annotation_freeTextEdit":"Stamp"===o.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"StickyNotes"===o.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"Image"===o.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?o.pdfViewer.element.id+"_annotation_stamp":"HandWrittenSignature"===o.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"SignatureText"===o.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?o.pdfViewer.element.id+"_annotation_handwrittenSign":"SignatureImage"===o.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?o.pdfViewer.element.id+"_annotation_handwrittenImage":"Ink"===o.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||"Path"===o.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?o.pdfViewer.element.id+"_annotation_inkIcon":"Highlight"===e||"Underline"===e||"Strikethrough"===e?o.pdfViewer.element.id+"_highlightIcon":o.pdfViewer.element.id+"_annotation_shapesIcon",o.pdfViewer.toolbarModule.annotationToolbarModule.mobileColorpicker(t)}})).isStringTemplate=!0,i.appendTo(n),je(this.pdfViewer.annotationModule.textMarkupAnnotationModule)||this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation||("Line"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&this.enableItems(this.colorDropDownElement.parentElement,!1),"HandWrittenSignature"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&(n=document.getElementById(this.pdfViewer.element.id+"_annotation_commentPanel"),this.enableItems(n.parentElement,!1))),this.showPropertyTool(i,t))},_Rt.prototype.showPropertyTool=function(e,t){this.toolbar&&this.toolbar.destroy(),this.propertyToolbar=e,this.applyProperiesToolSettings(t),this.pdfViewer.selectedItems.annotations[0]&&("SignatureText"!==(e=this.pdfViewer.selectedItems.annotations[0]).shapeAnnotationType&&"HandWrittenSignature"!==e.shapeAnnotationType&&"Stamp"!==e.shapeAnnotationType&&"Image"!==e.shapeAnnotationType&&"Ink"!==e.shapeAnnotationType&&"Path"!==e.shapeAnnotationType&&"StickyNotes"!==e.shapeAnnotationType?(this.updateColorInIcon(this.colorDropDownElement,this.pdfViewer.selectedItems.annotations[0].fillColor),this.updateColorInIcon(this.strokeDropDownElement,this.pdfViewer.selectedItems.annotations[0].strokeColor),"FreeText"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&(this.fontFamilyElement.ej2_instances[0].value=this.pdfViewer.selectedItems.annotations[0].fontFamily,this.fontColorElement.children[0].style.borderBottomColor=this.pdfViewer.selectedItems.annotations[0].fontColor,this.pdfViewer.annotation.modifyTextAlignment(this.pdfViewer.selectedItems.annotations[0].textAlign),this.updateTextAlignInIcon(this.pdfViewer.selectedItems.annotations[0].textAlign))):this.strokeDropDownElement&&this.updateColorInIcon(this.strokeDropDownElement,this.pdfViewer.selectedItems.annotations[0].strokeColor)),this.toolbarCreated=!0,this.adjustMobileViewer()},_Rt.prototype.stampToolMobileForMobile=function(e){var t=this;this.hideExistingTool(),this.stampToolbarElement&&this.stampToolbarElement.parentElement.removeChild(this.stampToolbarElement),this.stampToolbarElement=Q("div",{id:this.pdfViewer.element.id+"_stampToolbar",className:"e-pv-mobile-annotation-toolbar",styles:"bottom: 0px; position: absolute; width: 100%; float: left"}),this.pdfViewerBase.viewerMainContainer.appendChild(this.stampToolbarElement),this.toolbar=new U3({items:this.createStampToolbarItemsForMobile(),width:"",height:"",overflowMode:"Scrollable",clicked:this.onShapeToolbarClicked.bind(this),created:function(){t.pdfViewer.toolbarModule.annotationToolbarModule.mobileColorpicker(e)}}),this.toolbar.isStringTemplate=!0,this.toolbar.appendTo(this.stampToolbarElement),this.showStampPropertiesTool()},_Rt.prototype.shapeToolMobile=function(e){var t=this;this.hideExistingTool(),this.shapeToolbarElement&&this.shapeToolbarElement.parentElement.removeChild(this.shapeToolbarElement),this.shapeToolbarElement=Q("div",{id:this.pdfViewer.element.id+"_shapeToolbar",className:"e-pv-mobile-annotation-toolbar",styles:"bottom: 0px; position: absolute; width: 100%; float: left"}),this.pdfViewerBase.viewerMainContainer.appendChild(this.shapeToolbarElement),this.toolbar=new U3({items:this.createShapeToolbarItemsForMobile(),width:"",height:"",overflowMode:"Scrollable",clicked:this.onShapeToolbarClicked.bind(this),created:function(){t.pdfViewer.toolbarModule.annotationToolbarModule.mobileColorpicker(e.originalEvent.target.id)}}),this.toolbar.isStringTemplate=!0,this.toolbar.appendTo(this.shapeToolbarElement),this.afterShapeToolbarCreationForMobile(),this.showShapeTool()},_Rt.prototype.calibrateToolMobile=function(e){var t=this;this.hideExistingTool(),this.calibrateToolbarElement&&this.calibrateToolbarElement.parentElement.removeChild(this.calibrateToolbarElement),this.calibrateToolbarElement=Q("div",{id:this.pdfViewer.element.id+"_calibrateToolbar",className:"e-pv-mobile-annotation-toolbar",styles:"bottom: 0px; position: absolute; width: 100%; float: left"}),this.pdfViewerBase.viewerMainContainer.appendChild(this.calibrateToolbarElement),this.toolbar=new U3({items:this.createCalibrateToolbarItemsForMobile(),width:"",height:"",overflowMode:"Scrollable",clicked:this.onCalibrateToolbarClicked.bind(this),created:function(){t.pdfViewer.toolbarModule.annotationToolbarModule.mobileColorpicker(e.originalEvent.target.id)}}),this.toolbar.isStringTemplate=!0,this.toolbar.appendTo(this.calibrateToolbarElement),this.afterCalibrateToolbarCreationForMobile(),this.showShapeTool()},_Rt.prototype.textMarkupForMobile=function(e){var t=this,i=(this.hideExistingTool(),this.textMarkupToolbarElement&&this.textMarkupToolbarElement.parentElement.removeChild(this.textMarkupToolbarElement),this.textMarkupToolbarElement=Q("div",{id:this.pdfViewer.element.id+"_mobileAnnotationToolbar",className:"e-pv-mobile-annotation-toolbar",styles:"bottom: 0px; position: absolute; width: 100%; float: left"}),this.pdfViewerBase.viewerMainContainer.appendChild(this.textMarkupToolbarElement),this.pdfViewer.toolbarModule.annotationToolbarModule.getTemplate("span","_annotation_color","e-pv-annotation-color-container")),n=this.getTemplate("span","_annotation_opacity","e-pv-annotation-opacity-container"),i=[{prefixIcon:"e-pv-backward-icon e-pv-icon",tooltipText:this.pdfViewer.localeObj.getConstant("Go Back"),id:this.pdfViewer.element.id+"_backward",click:this.goBackToToolbar.bind(this)},{type:"Separator",align:"Left",cssClass:"e-pv-hightlight-separator-container"},{template:i,align:"left"},{template:n,align:"left"}];this.propertyToolbar=new U3({items:i,width:"",height:"",overflowMode:"Scrollable",created:function(){t.pdfViewer.toolbarModule.annotationToolbarModule.mobileColorpicker(e.originalEvent.target.id)}}),this.propertyToolbar.isStringTemplate=!0,this.propertyToolbar.appendTo(this.textMarkupToolbarElement),this.showTextMarkupPropertiesTool()},_Rt.prototype.showShapeTool=function(){var e=this.pdfViewer.toolbarSettings.annotationToolbarItems;e&&(-1!==e.indexOf("ColorEditTool")?this.showColorEditTool(!0,7,7):this.showColorEditTool(!1,7,7),-1!==e.indexOf("StrokeColorEditTool")?this.showStrokeColorEditTool(!0,8,8):this.showStrokeColorEditTool(!1,8,8),-1!==e.indexOf("ThicknessEditTool")?this.showThicknessEditTool(!0,9,9):this.showThicknessEditTool(!1,9,9),-1!==e.indexOf("OpacityEditTool")?this.showOpacityEditTool(!0,10,10):this.showOpacityEditTool(!1,10,10))},_Rt.prototype.signatureInkForMobile=function(){var e=this,t=(this.hideExistingTool(),this.signatureInkToolbarElement&&this.signatureInkToolbarElement.parentElement.removeChild(this.signatureInkToolbarElement),this.signatureInkToolbarElement=Q("div",{id:this.pdfViewer.element.id+"_mobileAnnotationToolbar",className:"e-pv-mobile-annotation-toolbar",styles:"bottom: 0px; position: absolute; width: 100%; float: left"}),this.pdfViewerBase.viewerMainContainer.appendChild(this.signatureInkToolbarElement),this.getTemplate("span","_annotation_opacity","e-pv-annotation-opacity-container")),i=this.pdfViewer.toolbarModule.annotationToolbarModule.getTemplate("span","_annotation_stroke","e-pv-annotation-stroke-container"),n=this.getTemplate("span","_annotation_thickness","e-pv-annotation-thickness-container"),t=[{prefixIcon:"e-pv-backward-icon e-pv-icon",tooltipText:this.pdfViewer.localeObj.getConstant("Go Back"),id:this.pdfViewer.element.id+"_backward",click:this.goBackToToolbar.bind(this)},{template:t,align:"left"},{template:i,aign:"left"},{template:n,align:"left"}];this.toolbar=new U3({items:t,width:"",height:"",overflowMode:"Scrollable",created:function(){e.pdfViewer.toolbarModule.annotationToolbarModule.mobileColorpicker(e.pdfViewer.element.id+"_annotation_inkIcon")}}),this.toolbar.isStringTemplate=!0,this.toolbar.appendTo(this.signatureInkToolbarElement)},_Rt.prototype.hideExistingTool=function(){this.toolbar&&!this.pdfViewer.enableDesktopMode&&this.toolbar.destroy(),this.propertyToolbar&&!this.pdfViewer.enableDesktopMode&&this.propertyToolbar.destroy();var e=document.getElementById(this.pdfViewer.element.id+"_mobileAnnotationToolbar");e&&(e.style.display="none")},_Rt.prototype.applyProperiesToolSettings=function(e){switch(e){case this.pdfViewer.element.id+"_underlineIcon":case this.pdfViewer.element.id+"_highlightIcon":this.showTextMarkupPropertiesTool();break;case this.pdfViewer.element.id+"_annotation_freeTextEdit":this.showFreeTextPropertiesTool();break;case this.pdfViewer.element.id+"_annotation_shapesIcon":this.shapePropertiesTool();break;case"stampTool":case this.pdfViewer.element.id+"_annotation_stamp":this.showStampPropertiesTool();break;case this.pdfViewer.element.id+"_annotation_handwrittenSign":case this.pdfViewer.element.id+"_annotation_inkIcon":this.showInkPropertiesTool();break;case this.pdfViewer.element.id+"_annotation_handwrittenImage":this.showImagePropertyTool()}},_Rt.prototype.showImagePropertyTool=function(){var e=this.pdfViewer.toolbarSettings.annotationToolbarItems;e&&(-1!==e.indexOf("OpacityEditTool")?this.showOpacityEditTool(!0,0,0):this.showOpacityEditTool(!1,0,0),-1!==e.indexOf("CommentPanelTool")?this.showCommentPanelTool(!0,1,1):this.showCommentPanelTool(!1,1,1),-1!==e.indexOf("AnnotationDeleteTool")?this.showAnnotationDeleteTool(!0,2,2):this.showAnnotationDeleteTool(!1,2,2))},_Rt.prototype.showFreeTextPropertiesTool=function(){var e=this.pdfViewer.toolbarSettings.annotationToolbarItems;e&&(-1!==e.indexOf("FontFamilyAnnotationTool")?this.showFontFamilyAnnotationTool(!0,2,2):this.showFontFamilyAnnotationTool(!1,2,2),-1!==e.indexOf("FontSizeAnnotationTool")?this.showFontSizeAnnotationTool(!0,3,3):this.showFontSizeAnnotationTool(!1,3,3),-1!==e.indexOf("FontColorAnnotationTool")?this.showFontColorAnnotationTool(!0,4,4):this.showFontColorAnnotationTool(!1,4,4),-1!==e.indexOf("FontAlignAnnotationTool")?this.showFontAlignAnnotationTool(!0,5,5):this.showFontAlignAnnotationTool(!1,5,5),-1!==e.indexOf("FontStylesAnnotationTool")?this.showFontStylesAnnotationTool(!0,6,6):this.showFontStylesAnnotationTool(!1,6,6),-1!==e.indexOf("ColorEditTool")?this.showColorEditTool(!0,7,7):this.showColorEditTool(!1,7,7),-1!==e.indexOf("StrokeColorEditTool")?this.showStrokeColorEditTool(!0,8,8):this.showStrokeColorEditTool(!1,8,8),-1!==e.indexOf("ThicknessEditTool")?this.showThicknessEditTool(!0,9,9):this.showThicknessEditTool(!1,9,9),-1!==e.indexOf("OpacityEditTool")?this.showOpacityEditTool(!0,10,10):this.showOpacityEditTool(!1,10,10),-1!==e.indexOf("CommentPanelTool")?this.showCommentPanelTool(!0,11,11):this.showCommentPanelTool(!1,11,11),-1!==e.indexOf("AnnotationDeleteTool")?this.showAnnotationDeleteTool(!0,12,12):this.showAnnotationDeleteTool(!1,12,12),-1!==e.indexOf("FreeTextAnnotationTool")?this.showFreeTextAnnotationTool(!0,0,0):(this.showFreeTextAnnotationTool(!1,0,0),this.applyHideToToolbar(!1,1,1)))},_Rt.prototype.shapePropertiesTool=function(){var e=this.pdfViewer.toolbarSettings.annotationToolbarItems;e&&(-1!==e.indexOf("ColorEditTool")?this.showColorEditTool(!0,2,2):this.showColorEditTool(!1,2,2),-1!==e.indexOf("StrokeColorEditTool")?this.showStrokeColorEditTool(!0,3,3):this.showStrokeColorEditTool(!1,3,3),-1!==e.indexOf("ThicknessEditTool")?this.showThicknessEditTool(!0,4,4):this.showThicknessEditTool(!1,4,4),-1!==e.indexOf("OpacityEditTool")?this.showOpacityEditTool(!0,5,5):this.showOpacityEditTool(!1,5,5),-1!==e.indexOf("CommentPanelTool")?this.showCommentPanelTool(!0,6,6):this.showCommentPanelTool(!1,6,6),-1!==e.indexOf("AnnotationDeleteTool")?this.showAnnotationDeleteTool(!0,7,7):this.showAnnotationDeleteTool(!1,7,7),-1!==e.indexOf("ShapeTool")?this.showShapeAnnotationTool(!0,0,0):(this.showShapeAnnotationTool(!1,0,0),this.applyHideToToolbar(!1,1,1)))},_Rt.prototype.showStampPropertiesTool=function(){var e=this.pdfViewer.toolbarSettings.annotationToolbarItems;e&&(-1!==e.indexOf("OpacityEditTool")?this.showOpacityEditTool(!0,2,2):this.showOpacityEditTool(!1,2,2),-1!==e.indexOf("CommentPanelTool")?this.showCommentPanelTool(!0,3,3):this.showCommentPanelTool(!1,3,3),-1!==e.indexOf("AnnotationDeleteTool")?this.showAnnotationDeleteTool(!0,4,4):this.showAnnotationDeleteTool(!1,4,4),-1!==e.indexOf("StampAnnotationTool")?this.showStampAnnotationTool(!0,0,0):(this.showStampAnnotationTool(!1,0,0),this.applyHideToToolbar(!1,1,1)))},_Rt.prototype.showTextMarkupPropertiesTool=function(){var e=this.pdfViewer.toolbarSettings.annotationToolbarItems;e&&(-1!==e.indexOf("ColorEditTool")?this.showColorEditTool(!0,2,2):this.showColorEditTool(!1,2,2),-1!==e.indexOf("OpacityEditTool")?this.showOpacityEditTool(!0,3,3):this.showOpacityEditTool(!1,3,3),-1!==e.indexOf("CommentPanelTool")?this.showCommentPanelTool(!0,4,4):this.showCommentPanelTool(!1,4,4),-1!==e.indexOf("AnnotationDeleteTool")?this.showAnnotationDeleteTool(!0,5,5):this.showAnnotationDeleteTool(!1,5,5),e.includes("HighlightTool")||e.includes("UnderlineTool")||e.includes("StrikethroughTool")?this.applyHideToToolbar(!0,0,0):(this.applyHideToToolbar(!1,0,0),this.applyHideToToolbar(!1,1,1)))},_Rt.prototype.showInkPropertiesTool=function(){var e=this.pdfViewer.toolbarSettings.annotationToolbarItems;e&&(-1!==e.indexOf("StrokeColorEditTool")?this.showStrokeColorEditTool(!0,2,2):this.showStrokeColorEditTool(!1,2,2),-1!==e.indexOf("ThicknessEditTool")?this.showThicknessEditTool(!0,3,3):this.showThicknessEditTool(!1,3,3),-1!==e.indexOf("OpacityEditTool")?this.showOpacityEditTool(!0,4,4):this.showOpacityEditTool(!1,4,4),-1!==e.indexOf("CommentPanelTool")?this.showCommentPanelTool(!0,5,5):this.showCommentPanelTool(!1,5,5),-1!==e.indexOf("AnnotationDeleteTool")?this.showAnnotationDeleteTool(!0,6,6):this.showAnnotationDeleteTool(!1,6,6),-1!==e.indexOf("HandWrittenSignatureTool")?this.showSignatureTool(!0,0,0):(this.showSignatureTool(!1,0,0),this.applyHideToToolbar(!1,1,1)))},_Rt.prototype.createAnnotationToolbarForMobile=function(e){var t,i;return e&&((e=document.getElementById(e)).parentElement.classList.contains("e-pv-select")?(t=!0,e.parentElement.classList.remove("e-pv-select")):(t=!1,this.pdfViewer.toolbarModule.selectItem(e.parentElement))),t?(this.toolbarCreated=!1,this.adjustMobileViewer(),this.toolbar&&(this.toolbar.destroy(),this.deselectAllItemsForMobile()),this.propertyToolbar&&this.propertyToolbar.destroy(),(e=document.getElementById(this.pdfViewer.element.id+"_mobileAnnotationToolbar"))&&(e.style.display="none"),this.pdfViewer.isAnnotationToolbarVisible=!t,[]):(this.isToolbarCreated=!0,this.propertyToolbar&&this.propertyToolbar.destroy(),this.toolbarElement&&this.toolbarElement.parentElement.removeChild(this.toolbarElement),this.toolbarElement=Q("div",{id:this.pdfViewer.element.id+"_mobileAnnotationToolbar",className:"e-pv-mobile-annotation-toolbar",styles:"bottom: 0px; position: absolute; width: 100%; float: left;"}),this.pdfViewerBase.viewerMainContainer.appendChild(this.toolbarElement),e=this.getTemplate("span","_annotation_stamp","e-pv-annotation-stamp-container"),i=this.getTemplate("span","_annotation_signature","e-pv-annotation-handwritten-container"),e=[{prefixIcon:"e-pv-comment-icon e-pv-icon",className:"e-pv-comment-container",id:this.pdfViewer.element.id+"_comment"},{type:"Separator",align:"Left"},{prefixIcon:"e-pv-highlight-icon e-pv-icon",className:"e-pv-highlight-container",id:this.pdfViewer.element.id+"_highlight"},{prefixIcon:"e-pv-underline-icon e-pv-icon",className:"e-pv-underline-container",id:this.pdfViewer.element.id+"_underline"},{prefixIcon:"e-pv-strikethrough-icon e-pv-icon",className:"e-pv-strikethrough-container",id:this.pdfViewer.element.id+"_strikethrough"},{type:"Separator",align:"Left"},{prefixIcon:"e-pv-annotation-shape-icon e-pv-icon",className:"e-pv-annotation-shapes-container",id:this.pdfViewer.element.id+"_annotation_shapes"},{type:"Separator",align:"Left"},{prefixIcon:"e-pv-annotation-calibrate-icon e-pv-icon",className:"e-pv-annotation-calibrate-container",id:this.pdfViewer.element.id+"_annotation_calibrate"},{type:"Separator",align:"Left"},{prefixIcon:"e-pv-freetext-icon e-pv-icon",className:"e-pv-annotation-freetextedit-container",id:this.pdfViewer.element.id+"_annotation_freeTextEdit"},{type:"Separator",align:"Left"},{template:e},{type:"Separator",align:"Left"},{template:i,align:"Left"},{type:"Separator",align:"Left"},{prefixIcon:"e-pv-inkannotation-icon e-pv-icon",className:"e-pv-annotation-ink-container",id:this.pdfViewer.element.id+"_annotation_ink",align:"Left"},{type:"Separator",align:"Left"},{prefixIcon:"e-pv-comment-panel-icon e-pv-icon",className:"e-pv-comment-panel-icon-container",id:this.pdfViewer.element.id+"_annotation_commentPanel",align:"Right"}],this.toolbarCreated&&this.toolbar?(this.toolbar.destroy(),this.toolbarCreated=!1):(this.toolbar=new U3({items:e,width:"",height:"",overflowMode:"Scrollable",clicked:this.onToolbarClicked.bind(this)}),this.pdfViewer.enableRtl&&(this.toolbar.enableRtl=!0),this.toolbar.isStringTemplate=!0,this.toolbar.appendTo(this.toolbarElement),this.afterMobileToolbarCreation(),this.createStampContainer(),this.createSignContainer(),this.applyMobileAnnotationToolbarSettings(),this.toolbarCreated=!0),this.adjustMobileViewer(),this.pdfViewerBase.isTextSelectionDisabled||(this.isMobileHighlightEnabled?(this.primaryToolbar.selectItem(this.highlightItem),this.primaryToolbar.deSelectItem(this.underlineItem),this.primaryToolbar.deSelectItem(this.strikethroughItem),this.primaryToolbar.deSelectItem(this.freeTextEditItem),this.primaryToolbar.deSelectItem(this.inkAnnotationItem)):this.isMobileUnderlineEnabled?(this.primaryToolbar.selectItem(this.underlineItem),this.primaryToolbar.deSelectItem(this.highlightItem),this.primaryToolbar.deSelectItem(this.strikethroughItem),this.primaryToolbar.deSelectItem(this.freeTextEditItem),this.primaryToolbar.deSelectItem(this.inkAnnotationItem)):this.isMobileStrikethroughEnabled&&(this.primaryToolbar.selectItem(this.strikethroughItem),this.primaryToolbar.deSelectItem(this.highlightItem),this.primaryToolbar.deSelectItem(this.underlineItem),this.primaryToolbar.deSelectItem(this.freeTextEditItem),this.primaryToolbar.deSelectItem(this.inkAnnotationItem))),this.pdfViewer.isAnnotationToolbarVisible=!t,e)},_Rt.prototype.adjustMobileViewer=function(){this.toolbarElement&&(e=this.toolbarElement.clientHeight);var e,t=!1;this.toolbarElement&&0===this.toolbarElement.children.length&&this.propertyToolbar&&0<this.propertyToolbar.element.children.length?(e=this.propertyToolbar.element.clientHeight,"none"!==this.pdfViewer.toolbarModule.toolbarElement.style.display||this.pdfViewerBase.navigationPane&&this.pdfViewerBase.navigationPane.isNavigationToolbarVisible||(this.pdfViewer.toolbarModule.toolbarElement.style.display="block")):this.freetextToolbarElement&&0<this.freetextToolbarElement.children.length?e=this.freetextToolbarElement.clientHeight:0===e&&this.pdfViewer.toolbarModule.toolbar?(e=this.pdfViewer.toolbarModule.toolbarElement.clientHeight,t=!0):!e&&this.propertyToolbar&&0<this.propertyToolbar.element.children.length&&(e=this.propertyToolbar.element.clientHeight),this.pdfViewer.enableToolbar&&this.toolbarCreated?this.pdfViewerBase.viewerContainer.style.height=this.updateViewerHeight(this.getElementHeight(this.pdfViewerBase.viewerContainer),e+e)+"px":t||(1<this.pdfViewerBase.viewerContainer.style.height.split("%").length?this.pdfViewerBase.viewerContainer.style.height=this.resetViewerHeight(this.getElementHeight(this.pdfViewerBase.viewerContainer),-e)+"px":this.pdfViewerBase.viewerContainer.style.height=this.resetViewerHeight(this.getElementHeight(this.pdfViewerBase.viewerContainer),e)+"px")},_Rt.prototype.showToolbar=function(e){var t=this.toolbarElement;e?(t.style.display="block",F.isDevice&&this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule.hideMobileAnnotationToolbar()):t.style.display="none"},_Rt.prototype.createMobileToolbarItems=function(e){var t=this.getTemplate("span","_annotation_color","e-pv-annotation-color-container"),i=this.getTemplate("span","_annotation_opacity","e-pv-annotation-opacity-container"),n=[];return n.push({prefixIcon:"e-pv-backward-icon e-pv-icon",tooltipText:this.pdfViewer.localeObj.getConstant("Go Back"),id:this.pdfViewer.element.id+"_backward",click:this.goBackToToolbar.bind(this)}),e||(n.push({template:t,align:"right"}),n.push({template:i,align:"right"}),n.push({type:"Separator",align:"right"})),n.push({prefixIcon:"e-pv-annotation-delete-icon e-pv-icon",className:"e-pv-annotation-delete-container",id:this.pdfViewer.element.id+"_annotation_delete",align:"right"}),n},_Rt.prototype.goBackToToolbar=function(e){this.isMobileAnnotEnabled=!1,!F.isDevice&&this.pdfViewer.enableDesktopMode||"Polygon"===this.pdfViewerBase.action&&this.pdfViewerBase.tool.mouseUp(e,!0,!0),0<this.toolbarElement.children.length?this.toolbarElement.style.display="block":(this.toolbarCreated=!1,this.toolbar.destroy(),this.createAnnotationToolbarForMobile());e=this.pdfViewerBase.getSelectTextMarkupCurrentPage();e&&(this.pdfViewer.annotationModule.textMarkupAnnotationModule.selectTextMarkupCurrentPage=null,this.pdfViewer.annotationModule.textMarkupAnnotationModule.clearAnnotationSelection(e))},_Rt.prototype.createToolbarItems=function(){var e=this.getTemplate("button","_annotation_color","e-pv-annotation-color-container"),t=this.getTemplate("button","_annotation_stroke","e-pv-annotation-stroke-container"),i=this.getTemplate("button","_annotation_thickness","e-pv-annotation-thickness-container"),n=this.getTemplate("button","_annotation_opacity","e-pv-annotation-opacity-container"),o=this.getTemplate("button","_annotation_shapes","e-pv-annotation-shapes-container"),r=this.getTemplate("button","_annotation_calibrate","e-pv-annotation-calibrate-container"),s=this.getTemplate("span","_annotation_stamp","e-pv-annotation-stamp-container"),a=this.getTemplate("button","_annotation_fontname","e-pv-annotation-fontname-container"),l=this.getTemplate("button","_annotation_fontsize","e-pv-annotation-fontsize-container"),h=this.getTemplate("button","_annotation_textcolor","e-pv-annotation-textcolor-container"),d=this.getTemplate("button","_annotation_textalign","e-pv-annotation-textalign-container"),p=this.getTemplate("button","_annotation_textproperties","e-pv-annotation-textprop-container"),c=this.getTemplate("button","_annotation_signature","e-pv-annotation-handwritten-container"),u=[];return u.push({prefixIcon:"e-pv-highlight-icon e-pv-icon",className:"e-pv-highlight-container",id:this.pdfViewer.element.id+"_highlight",align:"Left"}),u.push({prefixIcon:"e-pv-underline-icon e-pv-icon",className:"e-pv-underline-container",id:this.pdfViewer.element.id+"_underline",align:"Left"}),u.push({prefixIcon:"e-pv-strikethrough-icon e-pv-icon",className:"e-pv-strikethrough-container",id:this.pdfViewer.element.id+"_strikethrough",align:"Left"}),u.push({type:"Separator",align:"Left",cssClass:"e-pv-hightlight-separator-container"}),u.push({template:o,align:"Left",cssClass:"e-pv-shape-template-container"}),u.push({type:"Separator",align:"Left",cssClass:"e-pv-shape-separator-container"}),u.push({template:r,align:"Left",cssClass:"e-pv-calibrate-template-container"}),u.push({type:"Separator",align:"Left",cssClass:"e-pv-calibrate-separator-container"}),u.push({prefixIcon:"e-pv-freetext-icon e-pv-icon",className:"e-pv-annotation-freetextedit-container",id:this.pdfViewer.element.id+"_annotation_freeTextEdit",align:"Left"}),u.push({type:"Separator",align:"Left",cssClass:"e-pv-freetext-separator-container"}),u.push({template:s,align:"Left",cssClass:"e-pv-stamp-template-container"}),u.push({type:"Separator",align:"Left",cssClass:"e-pv-stamp-separator-container"}),u.push({template:c,align:"Left",cssClass:"e-pv-sign-template-container"}),u.push({type:"Separator",align:"Left",cssClass:"e-pv-sign-separator-container"}),u.push({prefixIcon:"e-pv-inkannotation-icon e-pv-icon",className:"e-pv-annotation-ink-container",id:this.pdfViewer.element.id+"_annotation_ink",align:"Left"}),u.push({type:"Separator",align:"Left",cssClass:"e-pv-ink-separator-container"}),u.push({template:a,align:"Left",cssClass:"e-pv-fontfamily-container"}),u.push({template:l,align:"Left",cssClass:"e-pv-fontsize-container"}),u.push({template:h,align:"Left",cssClass:"e-pv-text-color-container"}),u.push({template:d,align:"Left",cssClass:"e-pv-alignment-container"}),u.push({template:p,align:"Left",cssClass:"e-pv-text-properties-container"}),u.push({type:"Separator",align:"Left",cssClass:"e-pv-text-separator-container"}),u.push({template:e,align:"Left",cssClass:"e-pv-color-template-container"}),u.push({template:t,align:"Left",cssClass:"e-pv-stroke-template-container"}),u.push({template:i,align:"Left",cssClass:"e-pv-thickness-template-container"}),u.push({template:n,align:"Left",cssClass:"e-pv-opacity-template-container"}),u.push({type:"Separator",align:"Left",cssClass:"e-pv-opacity-separator-container"}),u.push({prefixIcon:"e-pv-annotation-delete-icon e-pv-icon",className:"e-pv-annotation-delete-container",id:this.pdfViewer.element.id+"_annotation_delete",align:"Left"}),u.push({prefixIcon:"e-pv-comment-panel-icon e-pv-icon",className:"e-pv-comment-panel-icon-container",id:this.pdfViewer.element.id+"_annotation_commentPanel",align:"Right"}),u.push({prefixIcon:"e-pv-annotation-tools-close-icon e-pv-icon",className:"e-pv-annotation-tools-close-container",id:this.pdfViewer.element.id+"_annotation_close",align:"Right"}),u},_Rt.prototype.createSignContainer=function(){var d=this,t=(this.handWrittenSignatureItem=this.pdfViewerBase.getElement("_annotation_signature"),this.primaryToolbar.createTooltip(this.pdfViewerBase.getElement("_annotation_signature"),this.pdfViewer.localeObj.getConstant("SignatureFieldDialogHeaderText")),this.handWrittenSignatureItem.setAttribute("aria-label",this.pdfViewer.localeObj.getConstant("SignatureFieldDialogHeaderText")),this),e=[],e=this.pdfViewer.handWrittenSignatureSettings||0===this.pdfViewer.handWrittenSignatureSettings.signatureItem.length||2===this.pdfViewer.handWrittenSignatureSettings.signatureItem.length?[{text:"ADD SIGNATURE"},{separator:!0},{text:"ADD INITIAL"}]:"Signature"===this.pdfViewer.handWrittenSignatureSettings.signatureItem[0]?[{text:"ADD SIGNATURE"}]:[{text:"ADD INITIAL"}],e=new u2({items:e,iconCss:"e-pv-handwritten-icon e-pv-icon",cssClass:"e-pv-handwritten-popup",open:function(e){t.openSignature()},beforeItemRender:function(e){if(d.pdfViewer.annotation.triggerAnnotationUnselectEvent(),d.pdfViewer.annotation.triggerSignatureUnselectEvent(),d.pdfViewer.clearSelection(d.pdfViewerBase.currentPageNumber-1),e.element&&-1!==e.element.className.indexOf("e-separator")&&(e.element.style.margin="8px 0",e.element.setAttribute("role","menuitem"),e.element.setAttribute("aria-label","separator")),"ADD SIGNATURE"===e.item.text){e.element.innerHTML="",d.saveSignatureCount=0;for(var t=d.pdfViewerBase.signatureModule.signaturecollection.length;0<t;t--)d.saveSignatureCount<d.pdfViewerBase.signatureModule.getSaveLimit(d.pdfViewer.handWrittenSignatureSettings.saveSignatureLimit)&&(e.element.style.display="block",n=(i=d.pdfViewerBase.signatureModule.signaturecollection[t-1]).image[0].imageData,o=i.image[0].id.split("_")[1],i.isInitial||""===n||((r=Q("div")).id="s"+o,r.style.display="block",r.style.paddingBottom="10px",(s=Q("span")).id="sign_border_"+o,a=void s.classList.add("e-pv-align-border"),"SignatureText"===i.image[0].signatureType?((a=Q("div")).classList.add("e-pv-align-border-div"),a.innerText=n,a.style.fontFamily=i.image[0].fontFamily,a.style.fontSize="15px",a.style.display="inline-flex",a.style.alignItems="center",a.style.position="relative",a.id="sign_"+o,a.style.width="80px",a.style.height="53px",a.style.overflow="hidden",a.style.textOverflow="ellipsis",a.style.paddingLeft="11px"):((a=Q("img")).id="sign_"+o,a.src=n,a.width=80,a.height=32,a.classList.add("e-pv-signatureimage"),a.style.paddingLeft="20px",a.style.paddingRight="18px",a.style.paddingTop="12px",a.style.paddingBottom="12px",a.style.boxSizing="content-box",a.setAttribute("alt","Saved Signature")),a.addEventListener("mouseover",d.hoverSignatureImage.bind(d)),a.addEventListener("mouseleave",d.leaveSignatureImage.bind(d)),(l=Q("span")).id="delete_"+o,l.classList.add("e-pv-delete"),l.classList.add("e-pv-align"),s.append(a),s.append(l),r.append(s),e.element.appendChild(r),e.element.style.pointerEvents="auto",e.element.style.background="none",d.pdfViewerBase.getElement("_annotation_signature-popup").style.width="206px",d.saveSignatureCount++));(h=Q("button")).classList.add("e-control","e-btn","e-lib","e-outline","e-primary"),h.textContent=d.pdfViewer.localeObj.getConstant("HandwrittenSignatureDialogHeaderText"),"en-US"===d.pdfViewer.locale&&(h.style.minWidth="130px"),h.style.width="auto",h.style.height="36px",h.addEventListener("click",d.clickSignature.bind(d)),e.element.appendChild(h),e.element.addEventListener("mouseover",d.hoverInitialBtn.bind(d)),e.element.style.minWidth="206px",e.element.style.width="auto",e.element.style.display="flex",e.element.style.flexDirection="column",e.element.style.height="auto",e.element.style.alignItems="center",e.element.setAttribute("role","menuitem")}if("ADD INITIAL"===e.item.text){d.saveInitialCount=0,e.element.innerHTML="";for(var i,n,o,r,s,a,l,h,t=d.pdfViewerBase.signatureModule.signaturecollection.length;0<t;t--)d.saveInitialCount<d.pdfViewerBase.signatureModule.getSaveLimit(d.pdfViewer.handWrittenSignatureSettings.saveInitialLimit)&&(n=(i=d.pdfViewerBase.signatureModule.signaturecollection[t-1]).image[0].imageData,o=i.image[0].id.split("_")[1],i.isInitial)&&""!==n&&((r=Q("div")).id="s"+o,r.style.display="block",r.style.paddingBottom="10px",(s=Q("span")).id="sign_border_"+o,a=void s.classList.add("e-pv-align-border"),"SignatureText"===i.image[0].signatureType?((a=Q("div")).classList.add("e-pv-align-border-div"),a.innerText=n,a.style.fontFamily=i.image[0].fontFamily,a.style.fontSize="15px",a.style.display="inline-flex",a.style.alignItems="center",a.style.position="relative",a.id="sign_"+o,a.style.width="80px",a.style.height="53px",a.style.overflow="hidden",a.style.textOverflow="ellipsis",a.style.paddingLeft="11px"):((a=Q("img")).id="sign_"+o,a.src=n,a.width=80,a.height=32,a.classList.add("e-pv-signatureimage"),a.style.paddingLeft="20px",a.style.paddingRight="18px",a.style.paddingTop="12px",a.style.paddingBottom="12px",a.style.boxSizing="content-box",a.setAttribute("alt","Saved Initial")),a.addEventListener("mouseover",d.hoverSignatureImage.bind(d)),a.addEventListener("mouseleave",d.leaveSignatureImage.bind(d)),a.width=80,a.height=32,(l=Q("span")).id="delete_"+o,l.classList.add("e-pv-delete"),l.classList.add("e-pv-align"),s.append(a),s.append(l),r.append(s),e.element.appendChild(r),e.element.style.pointerEvents="auto",e.element.style.background="none",d.pdfViewerBase.getElement("_annotation_signature-popup").style.width="206px",d.saveInitialCount++);d.isSignatureIteam=!1,(h=Q("button")).classList.add("e-control","e-btn","e-lib","e-outline","e-primary"),h.textContent=d.pdfViewer.localeObj.getConstant("HandwrittenInitialDialogHeaderText"),"en-US"===d.pdfViewer.locale&&(h.style.minWidth="130px"),h.style.width="auto",h.style.height="36px",h.addEventListener("click",d.clickInitial.bind(d)),e.element.appendChild(h),e.element.addEventListener("mouseover",d.hoverInitialBtn.bind(d)),e.element.style.minWidth="206px",e.element.style.width="auto",e.element.style.display="flex",e.element.style.flexDirection="column",e.element.style.height="auto",e.element.style.alignItems="center",e.element.setAttribute("role","menuitem")}},select:function(e){d.pdfViewer.clearSelection(d.pdfViewerBase.currentPageNumber-1)}});this.pdfViewer.enableRtl&&(e.enableRtl=this.pdfViewer.enableRtl),e.appendTo(this.handWrittenSignatureItem)},_Rt.prototype.updateSignatureCount=function(){this.openSignaturePopup=!1;for(var e=this.pdfViewerBase.signatureModule.signaturecollection,t=0;t<e.length;t++)e[parseInt(t.toString(),10)].image[0].imageData},_Rt.prototype.openSignature=function(){this.saveInitialCount=0,this.saveSignatureCount=0;for(var e=this.pdfViewerBase.signatureModule.signaturecollection.length;0<e;e--)this.saveSignatureCount<this.pdfViewerBase.signatureModule.getSaveLimit(this.pdfViewer.handWrittenSignatureSettings.saveSignatureLimit)&&(""===(t=this.pdfViewerBase.signatureModule.signaturecollection[e-1]).image[0].imageData||t.isInitial||(this.saveSignatureCount++,i=document.getElementById("sign_border_"+t.image[0].id.split("_")[1]),(n=document.getElementById("delete_"+t.image[0].id.split("_")[1])).style.backgroundClip="content-box",i.addEventListener("click",this.renderAddedSignature.bind(this)),n.addEventListener("click",this.deleteSavedSign.bind(this)),n.addEventListener("mouseover",this.hoverSignatureDelete.bind(this)),n.addEventListener("mouseleave",this.leaveSignatureDelete.bind(this)),i.addEventListener("mouseover",this.hoverSignatureDelete.bind(this)),i.addEventListener("mouseleave",this.leaveSignatureDelete.bind(this))));for(var t,i,n,e=this.pdfViewerBase.signatureModule.signaturecollection.length;0<e;e--)this.saveInitialCount<this.pdfViewerBase.signatureModule.getSaveLimit(this.pdfViewer.handWrittenSignatureSettings.saveInitialLimit)&&""!==(t=this.pdfViewerBase.signatureModule.signaturecollection[e-1]).image[0].imageData&&t.isInitial&&(this.saveInitialCount++,i=document.getElementById("sign_border_"+t.image[0].id.split("_")[1]),(n=document.getElementById("delete_"+t.image[0].id.split("_")[1])).style.backgroundClip="content-box",i.addEventListener("click",this.renderAddedSignature.bind(this)),n.addEventListener("click",this.deleteSavedSign.bind(this)),n.addEventListener("mouseover",this.hoverSignatureDelete.bind(this)),n.addEventListener("mouseleave",this.leaveSignatureDelete.bind(this)),i.addEventListener("mouseover",this.hoverSignatureDelete.bind(this)),i.addEventListener("mouseleave",this.leaveSignatureDelete.bind(this)))},_Rt.prototype.hoverSignatureDelete=function(){var e=event.target;e.id!=="sign_"+e.id.split("_")[1]&&!e.classList.contains("e-pv-delete")||(e.classList.add("e-pv-signaturehover"),e.style.cursor="pointer")},_Rt.prototype.hoverInitialBtn=function(e){var t=e.target,i="";(i=(-1!==navigator.userAgent.indexOf("MSIE")||-1!==navigator.userAgent.indexOf("Trident")?t:(je(e.path)?e.composedPath():e.path)[0]).id)!=="sign_"+i.split("_")[1]&&i!=="delete_"+i.split("_")[1]&&(null==(e=je(e=document.getElementById(t.id))?document.getElementById(t.parentElement.id):e)||t.id==="sign_"+t.id.split("_")[1]&&t.id==="sign_border_"+t.id.split("_")[2]?null==e.parentElement||t.id==="sign_"+t.id.split("_")[1]&&t.id==="sign_border_"+t.id.split("_")[2]||(e.parentElement.style.background="transparent",e.parentElement.style.cursor="default"):(e.style.background="transparent",e.style.cursor="default"))},_Rt.prototype.hoverSignatureImage=function(){var e=event.target;e.id!=="sign_"+e.id.split("_")[1]&&!e.classList.contains("e-pv-delete")||(e.classList.add("e-pv-signaturehover"),e.classList.remove("e-pv-signatureimage"),e.style.cursor="pointer")},_Rt.prototype.leaveSignatureDelete=function(){var e=event.target;e.id!=="sign_"+e.id.split("_")[1]&&!e.classList.contains("e-pv-delete")||(e.classList.remove("e-pv-signaturehover"),e.children[0]&&"IMG"===e.children[0].tagName&&e.children[0].classList.remove("e-pv-signaturehover"),e.style.cursor="default")},_Rt.prototype.clickSignature=function(){this.pdfViewerBase.isInitialField=!1,this.addSignature()},_Rt.prototype.clickInitial=function(){this.pdfViewerBase.isInitialField=!0,this.addSignature()},_Rt.prototype.leaveSignatureImage=function(){var e=event.target;e.id!=="sign_"+e.id.split("_")[1]&&!e.classList.contains("e-pv-delete")||(e.classList.remove("e-pv-signaturehover"),"IMG"===e.tagName&&e.classList.add("e-pv-signatureimage"),e.children[0]&&"IMG"===e.children[0].tagName&&(e.children[0].classList.remove("e-pv-signaturehover"),e.children[0].classList.add("e-pv-signatureimage")),e.style.cursor="default")},_Rt.prototype.addSignature=function(){this.deselectAllItems(),this.deselectAllItemsForMobile(),this.showSignaturepanel()},_Rt.prototype.renderAddedSignature=function(){this.pdfViewerBase.isAddedSignClicked=!0,this.isSavedSignatureClicked=!0,this.pdfViewerBase.signatureModule.RenderSavedSignature()},_Rt.prototype.deleteSavedSign=function(e){e.stopPropagation();for(var t=this.pdfViewerBase.signatureModule.signaturecollection,i=t.length;0<i;i--)if(e.target.parentElement.children[0].id==="sign_"+t[i-1].image[0].id.split("_")[1]){t[i-1].image[0].imageData="",this.pdfViewerBase.signatureModule.signaturecollection.splice(i-1,1);break}e.target.parentElement.remove()},_Rt.prototype.getTemplate=function(e,t,i){e=Q(e,{id:this.pdfViewer.element.id+t});return i&&(e.className=i),e.outerHTML},_Rt.prototype.createStampContainer=function(){var i,n,o,h=this,e=(this.stampElement=this.pdfViewerBase.getElement("_annotation_stamp"),this.primaryToolbar.createTooltip(this.pdfViewerBase.getElement("_annotation_stamp"),this.pdfViewer.localeObj.getConstant("Add Stamp")),this.stampElement.setAttribute("aria-label",this.pdfViewer.localeObj.getConstant("Add Stamp")),this.stampElement.setAttribute("role","combobox"),this.stampElement.setAttribute("aria-expanded","false"),Q("ul",{id:this.pdfViewer.element.id+"contextMenuElement"})),t=(this.pdfViewerBase.getElement("_annotation_stamp").appendChild(e),[]),t=(this.pdfViewer.stampSettings&&(!je(this.pdfViewer.stampSettings.dynamicStamps)&&0!==this.pdfViewer.stampSettings.dynamicStamps.length||(this.pdfViewer.stampSettings.dynamicStamps=[kCt.Revised,kCt.Reviewed,kCt.Received,kCt.Confidential,kCt.Approved,kCt.NotApproved]),this.pdfViewer.stampSettings.dynamicStamps&&0<this.pdfViewer.stampSettings.dynamicStamps.length&&(i=[],t.push({text:this.pdfViewer.localeObj.getConstant("Dynamic"),label:"Dynamic",items:i}),this.pdfViewer.stampSettings.dynamicStamps.forEach(function(e,t){e=kCt[e];i.push({text:h.pdfViewer.localeObj.getConstant(e="NotApproved"===e?"Not Approved":e),label:e})})),!je(this.pdfViewer.stampSettings.signStamps)&&0!==this.pdfViewer.stampSettings.signStamps.length||(this.pdfViewer.stampSettings.signStamps=[PCt.Witness,PCt.InitialHere,PCt.SignHere,PCt.Accepted,PCt.Rejected]),this.pdfViewer.stampSettings.signStamps&&0<this.pdfViewer.stampSettings.signStamps.length&&(n=[],t.push({text:this.pdfViewer.localeObj.getConstant("Sign Here"),label:"Sign Here",items:n}),this.pdfViewer.stampSettings.signStamps.forEach(function(e,t){var i=PCt[e];switch(i){case"InitialHere":i="Initial Here";break;case"SignHere":i="Sign Here"}n.push({text:h.pdfViewer.localeObj.getConstant(i),label:i})})),!je(this.pdfViewer.stampSettings.standardBusinessStamps)&&0!==this.pdfViewer.stampSettings.standardBusinessStamps.length||(this.pdfViewer.stampSettings.standardBusinessStamps=[BCt.Approved,BCt.NotApproved,BCt.Draft,BCt.Final,BCt.Completed,BCt.Confidential,BCt.ForPublicRelease,BCt.NotForPublicRelease,BCt.ForComment,BCt.Void,BCt.PreliminaryResults,BCt.InformationOnly]),this.pdfViewer.stampSettings.standardBusinessStamps)&&0<this.pdfViewer.stampSettings.standardBusinessStamps.length&&(o=[],t.push({text:this.pdfViewer.localeObj.getConstant("Standard Business"),label:"Standard Business",items:o}),this.pdfViewer.stampSettings.standardBusinessStamps.forEach(function(e,t){var i=BCt[e];switch(i){case"NotApproved":i="Not Approved";break;case"ForPublicRelease":i="For Public Release";break;case"NotForPublicRelease":i="Not For Public Release";break;case"ForComment":i="For Comment";break;case"PreliminaryResults":i="Preliminary Results";break;case"InformationOnly":i="Information Only"}o.push({text:h.pdfViewer.localeObj.getConstant(i),label:i})})),je(this.pdfViewer.customStampSettings)||!this.pdfViewer.customStampSettings.enableCustomStamp&&!je(this.pdfViewer.customStampSettings.enableCustomStamp)||(0<t.length&&t.push({separator:!0}),t.push({text:this.pdfViewer.localeObj.getConstant("Custom Stamp"),label:"Custom Stamp",items:[]}),this.pdfViewerBase.customStampCollection=this.pdfViewer.customStampSettings.customStamps||[]),this.stampMenu=[{iconCss:"e-pv-stamp-icon e-pv-icon",items:t}],{items:this.stampMenu,cssClass:"e-custom-scroll",showItemOnClick:!0,enableScrolling:!0,beforeOpen:function(e){if(h.resetFreeTextAnnot(),""===e.parentItem.text&&h.pdfViewer.customStampSettings.isAddToMenu&&0<e.items.length){for(var t=null,i=0;i<e.items.length;i++)if(e.items[parseInt(i.toString(),10)].text===h.pdfViewer.localeObj.getConstant("Custom Stamp")){e.items[parseInt(i.toString(),10)].items=[],t=e.items[parseInt(i.toString(),10)];break}var n=h.pdfViewerBase.customStampCollection,o=h.pdfViewer.customStampSettings.customStamps;if(0===n.length&&o&&0<o.length)for(var r=0;r<o.length;r++)n.push({customStampName:o[parseInt(r.toString(),10)].customStampName,customStampImageSource:o[parseInt(r.toString(),10)].customStampImageSource});for(var s=0;s<n.length;s++)if(null!=t){t.items.push({text:n[parseInt(s.toString(),10)].customStampName});for(var a,l,i=0;i<e.items.length;i++)e.items[parseInt(i.toString(),10)].text===h.pdfViewer.localeObj.getConstant("Custom Stamp")&&(a=e.element.children[parseInt(i.toString(),10)])&&!a.childElementCount&&((l=document.createElement("span")).className="e-icons e-caret e-menu-caret-icon",a.appendChild(l),a.setAttribute("aria-haspopup","true"),a.setAttribute("aria-expanded","false"))}}e.parentItem.text===h.pdfViewer.localeObj.getConstant("Custom Stamp")&&(o=h.pdfViewer.customStampSettings.customStamps)&&10<o.length&&(z(e.element,".e-menu-wrapper").style.height="350px"),h.stampParentID=e.parentItem.text,h.menuItems.showItemOnClick=!1},beforeClose:function(e){(e.parentItem&&e.parentItem.text!==h.pdfViewer.localeObj.getConstant("Custom Stamp")&&"Standard Business"!==e.parentItem.text&&"Dynamic"!==e.parentItem.text&&"Sign Here"!==e.parentItem.text||!e.parentItem)&&(h.menuItems.showItemOnClick=!0)},select:function(e){if(h.pdfViewerBase.isAlreadyAdded=!1,e.item.text===h.pdfViewer.localeObj.getConstant("Custom Stamp")){h.updateInteractionTools(),h.checkStampAnnotations(),h.pdfViewer.annotation.stampAnnotationModule.isStampAddMode=!0;var t=document.getElementById(h.pdfViewer.element.id+"_stampElement");t&&t.click(),h.pdfViewer.annotation.triggerAnnotationUnselectEvent(),h.pdfViewer.annotation.triggerSignatureUnselectEvent()}else if(h.stampParentID===h.pdfViewer.localeObj.getConstant("Custom Stamp")&&""!==e.item.text)for(var i=h.pdfViewerBase.customStampCollection,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].customStampName===e.item.text&&(h.pdfViewer.annotationModule.stampAnnotationModule.customStampName=e.item.text,h.checkStampAnnotations(),h.pdfViewer.annotation.stampAnnotationModule.isStampAddMode=!0,h.pdfViewer.annotationModule.stampAnnotationModule.isStampAnnotSelected=!0,h.pdfViewerBase.stampAdded=!0,h.pdfViewerBase.isAlreadyAdded=!0,h.pdfViewer.annotationModule.stampAnnotationModule.createCustomStampAnnotation(i[parseInt(n.toString(),10)].customStampImageSource),h.pdfViewerBase.stampAdded=!1);else e.item.text===h.pdfViewer.localeObj.getConstant("Dynamic")||""===e.item.text||"Standard Business"===e.item.text||"Sign Here"!==h.stampParentID&&"Sign Here"===e.item.text||(h.updateInteractionTools(),h.checkStampAnnotations(),h.pdfViewer.annotation.stampAnnotationModule.isStampAddMode=!0,h.pdfViewer.annotationModule.stampAnnotationModule.isStampAnnotSelected=!0,h.pdfViewerBase.stampAdded=!0,h.pdfViewer.annotation.triggerAnnotationUnselectEvent(),h.pdfViewer.annotation.triggerSignatureUnselectEvent(),h.stampParentID===h.pdfViewer.localeObj.getConstant("Dynamic")?(h.pdfViewerBase.isDynamicStamp=!0,h.pdfViewer.annotationModule.stampAnnotationModule.retrieveDynamicStampAnnotation(e.item.label)):(h.pdfViewerBase.isDynamicStamp=!1,h.pdfViewer.annotationModule.stampAnnotationModule.retrievestampAnnotation(e.item.label)),F.isDevice&&h.stampToolMobileForMobile(h.pdfViewer.element.id+"_annotation_stamp"))}});return this.menuItems=new L4(t,"#"+this.pdfViewer.element.id+"contextMenuElement"),e.parentElement.classList.add("e-pv-stamp"),this.pdfViewer.enableRtl&&(this.menuItems.enableRtl=!0),e},_Rt.prototype.createCustomStampElement=function(){var e=Q("input",{id:this.pdfViewer.element.id+"_stampElement",attrs:{type:"file"}});e.setAttribute("accept",".jpg,.jpeg,.png"),e.style.position="absolute",e.style.left="0px",e.style.top="0px",e.style.visibility="hidden",document.body.appendChild(e),e.addEventListener("change",this.addStampImage)},_Rt.prototype.checkStampAnnotations=function(){if(this.pdfViewer.annotation.stampAnnotationModule.isStampAddMode&&this.pdfViewer.selectedItems&&this.pdfViewer.selectedItems.annotations)for(var e=0;e<this.pdfViewer.selectedItems.annotations.length;e++){var t=this.pdfViewer.selectedItems.annotations[parseInt(e.toString(),10)];!t||t.annotName||t.author||"Shape"===t.shapeAnnotationType&&"Image"===t.shapeAnnotationType||(this.pdfViewer.remove(t),this.pdfViewer.annotation.renderAnnotations(t.pageIndex,null,null,null),this.pdfViewer.clearSelection(t.pageIndex))}},_Rt.prototype.createDropDowns=function(e){var t,i=this;F.isDevice&&!this.pdfViewer.enableDesktopMode||(this.shapeElement=this.pdfViewerBase.getElement("_annotation_shapes"),t=this.createShapeOptions(this.shapeElement.id,!0),this.shapeDropDown=this.createDropDownButton(this.shapeElement,"e-pv-annotation-shape-icon",t.element,this.pdfViewer.localeObj.getConstant("Add Shapes")),this.calibrateElement=this.pdfViewerBase.getElement("_annotation_calibrate"),t=this.createShapeOptions(this.calibrateElement.id,!1),this.calibrateDropDown=this.createDropDownButton(this.calibrateElement,"e-pv-annotation-calibrate-icon",t.element,this.pdfViewer.localeObj.getConstant("Calibrate"))),e||(this.colorDropDownElement=this.pdfViewerBase.getElement("_annotation_color"),this.colorPalette=this.createColorPicker(this.colorDropDownElement.id),this.colorPalette.change=this.onColorPickerChange.bind(this),this.colorDropDown=this.createDropDownButton(this.colorDropDownElement,"e-pv-annotation-color-icon",this.colorPalette.element.parentElement,this.pdfViewer.localeObj.getConstant("Color edit")),this.colorDropDown.beforeOpen=this.colorDropDownBeforeOpen.bind(this),this.colorDropDown.open=this.colorDropDownOpen.bind(this),this.pdfViewerBase.getElement("_annotation_color-popup").addEventListener("click",this.onColorPickerCancelClick.bind(this))),F.isDevice&&!this.pdfViewer.enableDesktopMode||(this.strokeDropDownElement=this.pdfViewerBase.getElement("_annotation_stroke"),this.strokeColorPicker=this.createColorPicker(this.strokeDropDownElement.id),this.strokeColorPicker.change=this.onStrokePickerChange.bind(this),this.strokeDropDown=this.createDropDownButton(this.strokeDropDownElement,"e-pv-annotation-stroke-icon",this.strokeColorPicker.element.parentElement,this.pdfViewer.localeObj.getConstant("Stroke edit")),this.strokeDropDown.beforeOpen=this.strokeDropDownBeforeOpen.bind(this),this.strokeDropDown.open=this.strokeDropDownOpen.bind(this),this.pdfViewerBase.getElement("_annotation_stroke-popup").addEventListener("click",this.onStrokePickerCancelClick.bind(this)),this.thicknessElement=this.pdfViewerBase.getElement("_annotation_thickness"),t=this.createThicknessSlider(this.thicknessElement.id),this.thicknessDropDown=this.createDropDownButton(this.thicknessElement,"e-pv-annotation-thickness-icon",t,this.pdfViewer.localeObj.getConstant("Change thickness")),this.thicknessDropDown.beforeOpen=this.thicknessDropDownBeforeOpen.bind(this),this.thicknessSlider.change=this.thicknessChange.bind(this),this.thicknessSlider.changed=this.thicknessChange.bind(this),this.pdfViewer.enableRtl)||(this.thicknessDropDown.open=this.thicknessDropDownOpen.bind(this)),e||(this.opacityDropDownElement=this.pdfViewerBase.getElement("_annotation_opacity"),t=this.createSlider(this.opacityDropDownElement.id),this.opacityDropDown=this.createDropDownButton(this.opacityDropDownElement,"e-pv-annotation-opacity-icon",t,this.pdfViewer.localeObj.getConstant("Opacity edit")),this.opacityDropDown.beforeOpen=this.opacityDropDownBeforeOpen.bind(this),this.opacitySlider.change=this.opacityChange.bind(this),this.opacitySlider.changed=this.opacityChange.bind(this),this.pdfViewer.enableRtl)||(this.opacityDropDown.open=this.opacityDropDownOpen.bind(this)),F.isDevice&&!this.pdfViewer.enableDesktopMode||(this.fontFamilyElement=this.pdfViewerBase.getElement("_annotation_fontname"),this.createDropDownListForFamily(this.fontFamilyElement),this.fontFamilyElement.addEventListener("change",function(){i.onFontFamilyChange.bind(i)}),this.fontSizeElement=this.pdfViewerBase.getElement("_annotation_fontsize"),this.createDropDownListForSize(this.fontSizeElement),this.fontColorElement=this.pdfViewerBase.getElement("_annotation_textcolor"),this.fontColorPalette=this.createColorPicker(this.fontColorElement.id),this.fontColorPalette.change=this.onFontColorChange.bind(this),this.fontColorDropDown=this.createDropDownButton(this.fontColorElement,"e-pv-annotation-textcolor-icon",this.fontColorPalette.element.parentElement,this.pdfViewer.localeObj.getConstant("Font color")),this.textAlignElement=this.pdfViewerBase.getElement("_annotation_textalign"),this.alignmentToolbar=this.createShapeOptions(this.textAlignElement.id,void 0,!0),this.textAlignDropDown=this.createDropDownButton(this.textAlignElement,"e-pv-annotation-textalign-icon",this.alignmentToolbar.element,this.pdfViewer.localeObj.getConstant("Text Align")),this.textAlignDropDown.beforeOpen=this.textAlignDropDownBeforeOpen.bind(this),this.textPropElement=this.pdfViewerBase.getElement("_annotation_textproperties"),this.propertiesToolbar=this.createShapeOptions(this.textPropElement.id,void 0,!1,!0),this.textPropertiesDropDown=this.createPropDropDownButton(this.textPropElement,"e-pv-annotation-textprop-icon",this.propertiesToolbar.element,this.pdfViewer.localeObj.getConstant("Text Properties")),this.textPropertiesDropDown.beforeOpen=this.textPropertiesDropDownBeforeOpen.bind(this))},_Rt.prototype.mobileColorpicker=function(e){var t=this,i=(this.opacityDropDownElement=this.pdfViewerBase.getElement("_annotation_opacity"),this.createSlider(this.opacityDropDownElement.id));this.opacityDropDown=this.createDropDownButton(this.opacityDropDownElement,"e-pv-annotation-opacity-icon",i,this.pdfViewer.localeObj.getConstant("Opacity edit")),this.opacityDropDown.beforeOpen=this.opacityDropDownBeforeOpen.bind(this),this.opacitySlider.change=this.opacityChange.bind(this),this.opacitySlider.changed=this.opacityChange.bind(this),this.pdfViewer.enableRtl||(this.opacityDropDown.open=this.opacityDropDownOpen.bind(this)),e===this.pdfViewer.element.id+"_annotation_shapes"?e=this.pdfViewer.element.id+"_annotation_shapesIcon":e===this.pdfViewer.element.id+"_annotation_calibrate"?e=this.pdfViewer.element.id+"_annotation_calibrateIcon":e===this.pdfViewer.element.id+"_highlight"?e=this.pdfViewer.element.id+"_highlightIcon":e===this.pdfViewer.element.id+"_underline"?e=this.pdfViewer.element.id+"_underlineIcon":e===this.pdfViewer.element.id+"_strikethrough"&&(e=this.pdfViewer.element.id+"_strikethroughIcon"),e!==this.pdfViewer.element.id+"_annotation_shapesIcon"&&e!==this.pdfViewer.element.id+"_annotation_calibrateIcon"&&e!==this.pdfViewer.element.id+"_annotation_freeTextEdit"&&e!==this.pdfViewer.element.id+"_highlightIcon"&&e!==this.pdfViewer.element.id+"_underlineIcon"&&e!==this.pdfViewer.element.id+"_strikethroughIcon"&&e!==this.pdfViewer.element.id+"_annotation_inkIcon"&&e!==this.pdfViewer.element.id+"_annotation_handwrittenSign"||(e!==this.pdfViewer.element.id+"_annotation_handwrittenSign"&&e!==this.pdfViewer.element.id+"_annotation_inkIcon"&&(this.colorDropDownElement=this.pdfViewerBase.getElement("_annotation_color"),this.colorPalette=this.createColorPicker(this.colorDropDownElement.id),this.colorPalette.change=this.onColorPickerChange.bind(this),this.colorDropDown=this.createDropDownButton(this.colorDropDownElement,"e-pv-annotation-color-icon",this.colorPalette.element.parentElement,this.pdfViewer.localeObj.getConstant("Color edit")),this.colorDropDown.beforeOpen=this.colorDropDownBeforeOpen.bind(this),this.colorDropDown.open=this.colorDropDownOpen.bind(this),this.pdfViewerBase.getElement("_annotation_color-popup").addEventListener("click",this.onColorPickerCancelClick.bind(this))),e===this.pdfViewer.element.id+"_annotation_freeTextEdit"&&(this.fontFamilyElement=this.pdfViewerBase.getElement("_annotation_fontname"),this.createDropDownListForFamily(this.fontFamilyElement),this.fontFamilyElement.style.textAlign="left",this.fontFamilyElement.addEventListener("change",function(){t.onFontFamilyChange.bind(t)}),this.fontSizeElement=this.pdfViewerBase.getElement("_annotation_fontsize"),this.createDropDownListForSize(this.fontSizeElement),this.fontColorElement=this.pdfViewerBase.getElement("_annotation_textcolor"),this.fontColorPalette=this.createColorPicker(this.fontColorElement.id),this.fontColorPalette.change=this.onFontColorChange.bind(this),this.fontColorDropDown=this.createDropDownButton(this.fontColorElement,"e-pv-annotation-textcolor-icon",this.fontColorPalette.element.parentElement,this.pdfViewer.localeObj.getConstant("Font color")),this.textAlignElement=this.pdfViewerBase.getElement("_annotation_textalign"),this.alignmentToolbar=this.createShapeOptions(this.textAlignElement.id,void 0,!0),this.textAlignDropDown=this.createDropDownButton(this.textAlignElement,"e-pv-annotation-textalign-icon",this.alignmentToolbar.element,this.pdfViewer.localeObj.getConstant("Text Align")),this.textAlignDropDown.beforeOpen=this.textAlignDropDownBeforeOpen.bind(this),this.textPropElement=this.pdfViewerBase.getElement("_annotation_textproperties"),this.propertiesToolbar=this.createShapeOptions(this.textPropElement.id,void 0,!1,!0),this.textPropertiesDropDown=this.createPropDropDownButton(this.textPropElement,"e-pv-annotation-textprop-icon",this.propertiesToolbar.element,this.pdfViewer.localeObj.getConstant("Text Properties")),this.textPropertiesDropDown.beforeOpen=this.textPropertiesDropDownBeforeOpen.bind(this)),e!==this.pdfViewer.element.id+"_annotation_shapesIcon"&&e!==this.pdfViewer.element.id+"_annotation_calibrateIcon"&&e!==this.pdfViewer.element.id+"_annotation_freeTextEdit"&&e!==this.pdfViewer.element.id+"_annotation_inkIcon"&&e!==this.pdfViewer.element.id+"_annotation_handwrittenSign")||(this.thicknessElement=this.pdfViewerBase.getElement("_annotation_thickness"),i=this.createThicknessSlider(this.thicknessElement.id),this.thicknessDropDown=this.createDropDownButton(this.thicknessElement,"e-pv-annotation-thickness-icon",i,this.pdfViewer.localeObj.getConstant("Change thickness")),this.thicknessDropDown.beforeOpen=this.thicknessDropDownBeforeOpen.bind(this),this.thicknessSlider.change=this.thicknessChange.bind(this),this.thicknessSlider.changed=this.thicknessChange.bind(this),this.pdfViewer.enableRtl||(this.thicknessDropDown.open=this.thicknessDropDownOpen.bind(this)),this.strokeDropDownElement=this.pdfViewerBase.getElement("_annotation_stroke"),this.strokeColorPicker=this.createColorPicker(this.strokeDropDownElement.id),this.strokeColorPicker.change=this.onStrokePickerChange.bind(this),this.strokeDropDown=this.createDropDownButton(this.strokeDropDownElement,"e-pv-annotation-stroke-icon",this.strokeColorPicker.element.parentElement,this.pdfViewer.localeObj.getConstant("Stroke edit")),this.strokeDropDown.beforeOpen=this.strokeDropDownBeforeOpen.bind(this),this.strokeDropDown.open=this.strokeDropDownOpen.bind(this),this.pdfViewerBase.getElement("_annotation_stroke-popup").addEventListener("click",this.onStrokePickerCancelClick.bind(this)))},_Rt.prototype.opacityDropDownOpen=function(e){F.isDevice&&!this.pdfViewer.enableDesktopMode?(e.element.parentElement.style.left="0px",e.element.parentElement.style.top=this.pdfViewerBase.viewerContainer.clientHeight+"px"):this.calculateToolbarPosition(e)},_Rt.prototype.onColorPickerCancelClick=function(e){e.target.classList.contains("e-cancel")&&this.colorDropDown.toggle()},_Rt.prototype.onStrokePickerCancelClick=function(e){e.target.classList.contains("e-cancel")&&this.strokeDropDown.toggle()},_Rt.prototype.colorDropDownBeforeOpen=function(e){this.colorPalette.noColor=!1,this.pdfViewer.annotationModule.textMarkupAnnotationModule&&(this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation?this.colorPalette.value=this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation.color:this.setCurrentColorInPicker()),1===this.pdfViewer.selectedItems.annotations.length?(this.colorPalette.value=this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.fill,this.colorPalette.noColor=!0):this.setCurrentColorInPicker(),this.colorPalette.refresh(),this.updateColorInIcon(this.colorDropDownElement,this.colorPalette.value)},_Rt.prototype.setCurrentColorInPicker=function(){if(!N){if(this.pdfViewer.annotationModule.textMarkupAnnotationModule)switch(this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAddMode){case"Highlight":this.setColorInPicker(this.colorPalette,this.pdfViewer.annotationModule.textMarkupAnnotationModule.highlightColor);break;case"Underline":this.setColorInPicker(this.colorPalette,this.pdfViewer.annotationModule.textMarkupAnnotationModule.underlineColor);break;case"Strikethrough":this.setColorInPicker(this.colorPalette,this.pdfViewer.annotationModule.textMarkupAnnotationModule.strikethroughColor)}if(this.pdfViewer.annotation.shapeAnnotationModule)switch(this.pdfViewer.annotationModule.shapeAnnotationModule.currentAnnotationMode){case"Line":this.setColorInPicker(this.colorPalette,this.pdfViewer.annotationModule.shapeAnnotationModule.lineFillColor);break;case"Arrow":this.setColorInPicker(this.colorPalette,this.pdfViewer.annotationModule.shapeAnnotationModule.arrowFillColor);break;case"Rectangle":this.setColorInPicker(this.colorPalette,this.pdfViewer.annotationModule.shapeAnnotationModule.rectangleFillColor);break;case"Circle":this.setColorInPicker(this.colorPalette,this.pdfViewer.annotationModule.shapeAnnotationModule.circleFillColor);break;case"Polygon":this.setColorInPicker(this.colorPalette,this.pdfViewer.annotationModule.shapeAnnotationModule.polygonFillColor)}this.colorDropDownElement&&this.updateColorInIcon(this.colorDropDownElement,this.colorPalette.value)}},_Rt.prototype.colorDropDownOpen=function(e){F.isDevice&&!this.pdfViewer.enableDesktopMode&&(e.element.parentElement.style.top=this.pdfViewerBase.viewerContainer.clientHeight/2+"px"),this.popupPosition(e,this.colorDropDownElement),this.colorPalette.refresh()},_Rt.prototype.strokeDropDownBeforeOpen=function(e){1===this.pdfViewer.selectedItems.annotations.length?this.strokeColorPicker.value=this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeColor:this.setCurrentStrokeColorInPicker(),this.strokeColorPicker.refresh(),this.updateColorInIcon(this.strokeDropDownElement,this.strokeColorPicker.value),this.updateInkannotationItems()},_Rt.prototype.setCurrentStrokeColorInPicker=function(){if(!N&&this.pdfViewer.annotation.shapeAnnotationModule)switch(this.pdfViewer.annotationModule.shapeAnnotationModule.currentAnnotationMode){case"Line":this.setColorInPicker(this.strokeColorPicker,this.pdfViewer.annotationModule.shapeAnnotationModule.lineStrokeColor);break;case"Arrow":this.setColorInPicker(this.strokeColorPicker,this.pdfViewer.annotationModule.shapeAnnotationModule.arrowStrokeColor);break;case"Rectangle":this.setColorInPicker(this.strokeColorPicker,this.pdfViewer.annotationModule.shapeAnnotationModule.rectangleStrokeColor);break;case"Circle":this.setColorInPicker(this.strokeColorPicker,this.pdfViewer.annotationModule.shapeAnnotationModule.circleStrokeColor);break;case"Polygon":this.setColorInPicker(this.strokeColorPicker,this.pdfViewer.annotationModule.shapeAnnotationModule.polygonStrokeColor)}},_Rt.prototype.strokeDropDownOpen=function(e){F.isDevice&&!this.pdfViewer.enableDesktopMode&&(e.element.parentElement.style.top=this.pdfViewerBase.viewerContainer.clientHeight/2+"px"),this.popupPosition(e,this.strokeDropDownElement),this.strokeColorPicker.refresh()},_Rt.prototype.onFontColorChange=function(e){e=N?e[0]:""===e.currentValue.hex?"#ffffff00":e.currentValue.hex;1===this.pdfViewer.selectedItems.annotations.length?this.pdfViewer.annotation.modifyFontColor(e):(this.pdfViewer.freeTextSettings.fontColor=e,this.pdfViewer.annotationModule.freeTextAnnotationModule.updateTextProperties()),N?(this.fontColorElementInBlazor=this.pdfViewer.element.querySelector(".e-pv-annotation-textcolor-container"),this.updateColorInIcon(this.fontColorElementInBlazor,e)):(this.updateColorInIcon(this.fontColorElement,e),this.fontColorDropDown.toggle())},_Rt.prototype.onFontFamilyChange=function(e){e=N?e:e&&e.fontFamily&&e.fontFamily.value?e.fontFamily.value:"";1===this.pdfViewer.selectedItems.annotations.length&&e?this.pdfViewer.annotation.modifyFontFamily(e):(this.pdfViewer.freeTextSettings.fontFamily=e,this.pdfViewer.annotationModule.freeTextAnnotationModule.updateTextProperties())},_Rt.prototype.onFontSizeChange=function(e,t){var i,e=N?e:e&&e.fontSize&&e.fontSize.value?e.fontSize.value:"",n=parseFloat(e);1===this.pdfViewer.selectedItems.annotations.length&&e?(i=this.pdfViewer.selectedItems.annotations[0].id,(e=this.pdfViewer.annotationCollection.filter(function(e){return e.uniqueKey===i})[0])&&e.fontSize!==n&&this.pdfViewer.annotation.modifyFontSize(n,t)):(this.pdfViewer.freeTextSettings.fontSize=n,this.pdfViewer.annotationModule.freeTextAnnotationModule.updateTextProperties())},_Rt.prototype.textAlignDropDownBeforeOpen=function(e){if(1===this.pdfViewer.selectedItems.annotations.length&&e.element.getElementsByTagName("button")&&0<e.element.getElementsByTagName("button").length)for(var t=e.element.getElementsByTagName("button"),i=this.pdfViewer.selectedItems.annotations[0],n=0;n<t.length;n++)t[parseInt(n.toString(),10)]&&(t[parseInt(n.toString(),10)].classList.remove("textprop-option-active"),t[parseInt(n.toString(),10)].id===this.pdfViewer.element.id+"_left_align"&&"Left"===i.textAlign&&t[parseInt(n.toString(),10)].classList.add("textprop-option-active"),t[parseInt(n.toString(),10)].id===this.pdfViewer.element.id+"_right_align"&&"Right"===i.textAlign&&t[parseInt(n.toString(),10)].classList.add("textprop-option-active"),t[parseInt(n.toString(),10)].id===this.pdfViewer.element.id+"_center_align"&&"Center"===i.textAlign&&t[parseInt(n.toString(),10)].classList.add("textprop-option-active"),t[parseInt(n.toString(),10)].id===this.pdfViewer.element.id+"_justify_align")&&"Justify"===i.textAlign&&t[parseInt(n.toString(),10)].classList.add("textprop-option-active")},_Rt.prototype.textPropertiesDropDownBeforeOpen=function(e){if(1===this.pdfViewer.selectedItems.annotations.length&&e.element.getElementsByTagName("button")&&0<e.element.getElementsByTagName("button").length)for(var t=e.element.getElementsByTagName("button"),i=this.pdfViewer.selectedItems.annotations[0],n=0;n<t.length;n++)t[parseInt(n.toString(),10)]&&(t[parseInt(n.toString(),10)].classList.remove("textprop-option-active"),t[parseInt(n.toString(),10)].id===this.pdfViewer.element.id+"_bold"&&i.font.isBold&&t[parseInt(n.toString(),10)].classList.add("textprop-option-active"),t[parseInt(n.toString(),10)].id===this.pdfViewer.element.id+"_italic"&&i.font.isItalic&&t[parseInt(n.toString(),10)].classList.add("textprop-option-active"),t[parseInt(n.toString(),10)].id===this.pdfViewer.element.id+"_strikeout"&&i.font.isStrikeout&&t[parseInt(n.toString(),10)].classList.add("textprop-option-active"),t[parseInt(n.toString(),10)].id===this.pdfViewer.element.id+"_underline_textinput")&&i.font.isUnderline&&t[parseInt(n.toString(),10)].classList.add("textprop-option-active")},_Rt.prototype.onClickTextAlignment=function(e){var t=N?e[0]:e&&e.item&&e.item.value?e.item.value:"";1===this.pdfViewer.selectedItems.annotations.length&&t?this.pdfViewer.annotation.modifyTextAlignment(t):(this.pdfViewer.freeTextSettings.textAlignment=e.item.value,this.pdfViewer.annotationModule.freeTextAnnotationModule.updateTextProperties()),this.updateTextAlignInIcon(t)},_Rt.prototype.onClickTextProperties=function(e){var t,e=N?e[0]:e&&e.item&&e.item.value?e.item.value:"";1===this.pdfViewer.selectedItems.annotations.length&&e?(t={isBold:void 0,isItalic:void 0,isStrikeout:void 0,isUnderline:void 0},"bold"===e?t.isBold=!this.pdfViewer.selectedItems.annotations[0].font.isBold:"italic"===e?t.isItalic=!this.pdfViewer.selectedItems.annotations[0].font.isItalic:"underline"===e?t.isUnderline=!this.pdfViewer.selectedItems.annotations[0].font.isUnderline:"strikeout"===e&&(t.isStrikeout=!this.pdfViewer.selectedItems.annotations[0].font.isStrikeout),this.pdfViewer.annotation.modifyTextProperties(t,e)):"bold"===e?this.pdfViewer.annotationModule.freeTextAnnotationModule.isBold?this.pdfViewer.annotationModule.freeTextAnnotationModule.isBold=!1:(this.pdfViewer.freeTextSettings.fontStyle=1,this.pdfViewer.annotationModule.freeTextAnnotationModule.updateTextProperties()):"italic"===e?this.pdfViewer.annotationModule.freeTextAnnotationModule.isItalic?this.pdfViewer.annotationModule.freeTextAnnotationModule.isItalic=!1:(this.pdfViewer.freeTextSettings.fontStyle=2,this.pdfViewer.annotationModule.freeTextAnnotationModule.updateTextProperties()):"underline"===e?this.pdfViewer.annotationModule.freeTextAnnotationModule.isUnderline?this.pdfViewer.annotationModule.freeTextAnnotationModule.isUnderline=!1:(this.pdfViewer.freeTextSettings.fontStyle=4,this.pdfViewer.annotationModule.freeTextAnnotationModule.isStrikethrough=!1,this.pdfViewer.annotationModule.freeTextAnnotationModule.updateTextProperties()):"strikeout"===e&&(this.pdfViewer.annotationModule.freeTextAnnotationModule.isStrikethrough?this.pdfViewer.annotationModule.freeTextAnnotationModule.isStrikethrough=!1:(this.pdfViewer.freeTextSettings.fontStyle=8,this.pdfViewer.annotationModule.freeTextAnnotationModule.isUnderline=!1,this.pdfViewer.annotationModule.freeTextAnnotationModule.updateTextProperties())),this.updateTextPropertySelection(e)},_Rt.prototype.opacityChange=function(e){var t=1,t=e&&1===e.length?e[0]:e.value;if(this.pdfViewer.annotationModule.textMarkupAnnotationModule)if(this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation)N?this.pdfViewer.annotationModule.textMarkupAnnotationModule.modifyOpacityProperty(null,t):this.isCurrentAnnotationOpacitySet&&"changed"===e.name?this.isCurrentAnnotationOpacitySet=!1:this.pdfViewer.annotationModule.textMarkupAnnotationModule.modifyOpacityProperty(e);else switch(this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAddMode){case"Highlight":this.pdfViewer.annotationModule.textMarkupAnnotationModule.highlightOpacity=t/100;break;case"Underline":this.pdfViewer.annotationModule.textMarkupAnnotationModule.underlineOpacity=t/100;break;case"Strikethrough":this.pdfViewer.annotationModule.textMarkupAnnotationModule.strikethroughOpacity=t/100}if(1===this.pdfViewer.selectedItems.annotations.length){var i,n=this.pdfViewer.selectedItems.annotations[0];null==n||"Stamp"!==n.shapeAnnotationType&&"Image"!==n.shapeAnnotationType?N?this.pdfViewer.annotation.modifyOpacity(t,!0):"changed"===e.name&&e.value!==e.previousValue&&this.pdfViewer.annotation.modifyOpacity(e):(e=owt(n),(i=owt(n)).opacity=t/100,this.pdfViewer.nodePropertyChange(n,{opacity:t/100}),this.pdfViewer.annotation.triggerAnnotationPropChange(n,!1,!1,!1,!0),this.pdfViewer.annotation.addAction(this.pdfViewer.selectedItems.annotations[0].pageIndex,null,this.pdfViewer.selectedItems.annotations[0],"stampOpacity","",e,i),this.pdfViewer.annotation.stampAnnotationModule.updateSessionStorage(this.pdfViewer.selectedItems.annotations[0],null,"opacity"))}else{if(this.pdfViewer.annotation.shapeAnnotationModule)switch(this.pdfViewer.annotation.shapeAnnotationModule.currentAnnotationMode){case"Line":this.pdfViewer.annotation.shapeAnnotationModule.lineOpacity=t/100;break;case"Arrow":this.pdfViewer.annotation.shapeAnnotationModule.arrowOpacity=t/100;break;case"Rectangle":this.pdfViewer.annotation.shapeAnnotationModule.rectangleOpacity=t/100;break;case"Circle":this.pdfViewer.annotation.shapeAnnotationModule.circleOpacity=t/100;break;case"Polygon":this.pdfViewer.annotation.shapeAnnotationModule.polygonOpacity=t/100}n=this.pdfViewer.annotation;n&&n.inkAnnotationModule&&(this.pdfViewer.inkAnnotationSettings.opacity=t/100),this.pdfViewer.drawingObject&&(this.pdfViewer.drawingObject.opacity=t/100,"FreeText"===this.pdfViewer.drawingObject.shapeAnnotationType)&&(this.pdfViewer.annotation.freeTextAnnotationModule.opacity=t/100)}N||this.updateOpacityIndicator()},_Rt.prototype.opacityDropDownBeforeOpen=function(e){if(this.pdfViewer.annotationModule.textMarkupAnnotationModule)if(this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation)this.isCurrentAnnotationOpacitySet=!0,this.opacitySlider.value=100*this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation.opacity;else switch(this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAddMode){case"Highlight":this.opacitySlider.value=100*this.pdfViewer.annotationModule.textMarkupAnnotationModule.highlightOpacity;break;case"Underline":this.opacitySlider.value=100*this.pdfViewer.annotationModule.textMarkupAnnotationModule.underlineOpacity;break;case"Strikethrough":this.opacitySlider.value=100*this.pdfViewer.annotationModule.textMarkupAnnotationModule.strikethroughOpacity}if(1===this.pdfViewer.selectedItems.annotations.length)this.opacitySlider.value=100*this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.opacity;else if(this.pdfViewer.annotation.shapeAnnotationModule)switch(this.pdfViewer.annotation.shapeAnnotationModule.currentAnnotationMode){case"Line":this.opacitySlider.value=100*this.pdfViewer.annotation.shapeAnnotationModule.lineOpacity;break;case"Arrow":this.opacitySlider.value=100*this.pdfViewer.annotation.shapeAnnotationModule.arrowOpacity;break;case"Rectangle":this.opacitySlider.value=100*this.pdfViewer.annotation.shapeAnnotationModule.rectangleOpacity;break;case"Circle":this.opacitySlider.value=100*this.pdfViewer.annotation.shapeAnnotationModule.circleOpacity;break;case"Polygon":this.opacitySlider.value=100*this.pdfViewer.annotation.shapeAnnotationModule.polygonOpacity}this.updateOpacityIndicator(),this.updateInkannotationItems()},_Rt.prototype.thicknessDropDownBeforeOpen=function(){if(1===this.pdfViewer.selectedItems.annotations.length)this.thicknessSlider.value=this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeWidth;else if(this.pdfViewer.annotation.shapeAnnotationModule)switch(this.pdfViewer.annotation.shapeAnnotationModule.currentAnnotationMode){case"Line":this.thicknessSlider.value=this.pdfViewer.annotation.shapeAnnotationModule.lineThickness;break;case"Arrow":this.thicknessSlider.value=this.pdfViewer.annotation.shapeAnnotationModule.arrowThickness;break;case"Rectangle":this.thicknessSlider.value=this.pdfViewer.annotation.shapeAnnotationModule.rectangleThickness;break;case"Circle":this.thicknessSlider.value=this.pdfViewer.annotation.shapeAnnotationModule.circleThickness;break;case"Polygon":this.thicknessSlider.value=this.pdfViewer.annotation.shapeAnnotationModule.polygonThickness}this.updateThicknessIndicator(),this.updateInkannotationItems()},_Rt.prototype.thicknessDropDownOpen=function(e){F.isDevice&&!this.pdfViewer.enableDesktopMode?(e.element.parentElement.style.left="0px",e.element.parentElement.style.top=this.pdfViewerBase.viewerContainer.clientHeight+"px"):this.calculateToolbarPosition(e)},_Rt.prototype.calculateToolbarPosition=function(e){var t,i;e.element&&e.element.parentElement&&(t=parseFloat(e.element.parentElement.style.left))+(i=e.element.parentElement.offsetWidth)<this.pdfViewer.element.offsetWidth+10&&(e.element.parentElement.style.left=t-i+"px")},_Rt.prototype.thicknessChangeInBlazor=function(e){1===this.pdfViewer.selectedItems.annotations.length?this.pdfViewer.annotation.modifyThickness(e[0]):this.ShapeThickness(e[0])},_Rt.prototype.thicknessChange=function(e){var t,i;1===this.pdfViewer.selectedItems.annotations.length?"changed"===e.name&&(this.pdfViewer.annotation.modifyThickness(e.value),N||this.updateThicknessIndicator(),t=this.pdfViewer.annotation,i=this.pdfViewer.selectedItems.annotations[0],t)&&t.inkAnnotationModule&&i&&"Ink"===i.shapeAnnotationType&&(this.pdfViewer.inkAnnotationSettings.thickness=e.value):this.ShapeThickness(e.value)},_Rt.prototype.ShapeThickness=function(e){if(this.pdfViewer.annotation.shapeAnnotationModule){switch(this.pdfViewer.annotation.shapeAnnotationModule.currentAnnotationMode){case"Line":this.pdfViewer.annotation.shapeAnnotationModule.lineThickness=e;break;case"Arrow":this.pdfViewer.annotation.shapeAnnotationModule.arrowThickness=e;break;case"Rectangle":this.pdfViewer.annotation.shapeAnnotationModule.rectangleThickness=e;break;case"Circle":this.pdfViewer.annotation.shapeAnnotationModule.circleThickness=e;break;case"Polygon":this.pdfViewer.annotation.shapeAnnotationModule.polygonThickness=e}var t=this.pdfViewer.annotation;t&&t.inkAnnotationModule&&(this.pdfViewer.inkAnnotationSettings.thickness=e.value),this.pdfViewer.drawingObject&&(this.pdfViewer.drawingObject.thickness=e.value),this.pdfViewer.drawingObject&&"FreeText"===this.pdfViewer.drawingObject.shapeAnnotationType&&(this.pdfViewer.annotation.freeTextAnnotationModule.borderWidth=e.value)}t=this.pdfViewer.annotation;t&&t.inkAnnotationModule&&(this.pdfViewer.inkAnnotationSettings.thickness=e),this.pdfViewer.drawingObject&&(this.pdfViewer.drawingObject.thickness=e),this.pdfViewer.drawingObject&&"FreeText"===this.pdfViewer.drawingObject.shapeAnnotationType&&(this.pdfViewer.annotation.freeTextAnnotationModule.borderWidth=e),N||this.updateThicknessIndicator()},_Rt.prototype.createDropDownButton=function(e,t,i,n){t=new u2({iconCss:t+" e-pv-icon",target:i});return this.pdfViewer.enableRtl&&(t.enableRtl=!0),t.appendTo(e),this.primaryToolbar.createTooltip(e,n),e.setAttribute("aria-label",n),t},_Rt.prototype.createShapeOptions=function(e,t,i,n){var o,r=Q("div",{id:e+"_target",className:"e-pv-shapes-toolbar"});return document.body.appendChild(r),i?((o=new U3({items:this.textAlignmentToolbarItems(),overflowMode:"MultiRow"},r)).isStringTemplate=!0,this.afterAlignmentToolbarCreation()):n?((o=new U3({items:this.textPropertiesToolbarItems(),overflowMode:"MultiRow"},r)).isStringTemplate=!0,this.afterPropertiesToolbarCreation()):t?!F.isDevice||this.pdfViewer.enableDesktopMode?((o=new U3({items:this.createShapeToolbarItems(),overflowMode:"MultiRow",clicked:this.onShapeToolbarClicked.bind(this)},r)).isStringTemplate=!0,this.afterShapeToolbarCreation()):(this.toolbarElement=Q("div",{id:e+"_target",className:"e-pv-mobile-annotation-toolbar",styles:"bottom: 0px; position: absolute; width: 100%; float: left"}),this.pdfViewerBase.viewerMainContainer.appendChild(this.toolbarElement),(o=new U3({items:this.createShapeToolbarItemsForMobile(),overflowMode:"Scrollable",clicked:this.onShapeToolbarClicked.bind(this)},this.toolbarElement)).isStringTemplate=!0,this.afterShapeToolbarCreationForMobile()):((o=new U3({items:this.createCalibrateToolbarItems(),overflowMode:"MultiRow",clicked:this.onCalibrateToolbarClicked.bind(this)},r)).isStringTemplate=!0,this.afterCalibrateToolbarCreation()),o},_Rt.prototype.createPropertyToolbarForMobile=function(e){var t=this,i=this.pdfViewer.toolbarModule.annotationToolbarModule.getTemplate("span","_annotation_color","e-pv-annotation-color-container"),n=this.pdfViewer.toolbarModule.annotationToolbarModule.getTemplate("span","_annotation_stroke","e-pv-annotation-stroke-container"),o=this.getTemplate("span","_annotation_thickness","e-pv-annotation-thickness-container"),r=this.getTemplate("span","_annotation_opacity","e-pv-annotation-opacity-container"),s=this.getTemplate("input","_annotation_fontname","e-pv-annotation-fontname-container"),a=this.getTemplate("input","_annotation_fontsize","e-pv-annotation-fontsize-container"),l=this.getTemplate("span","_annotation_textcolor","e-pv-annotation-textcolor-container"),h=this.getTemplate("span","_annotation_textalign","e-pv-annotation-textalign-container"),d=this.getTemplate("span","_annotation_textproperties","e-pv-annotation-textprop-container"),p=[];return"Polygon"===e||"Rectangle"===e||"Ellipse"===e||"Line"===e||"LineWidthArrowHead"===e||"Distance"===e||"Perimeter"===e||"Radius"===e||"FreeText"===e?("FreeText"===e&&(p.push({prefixIcon:"e-pv-freetext-icon e-pv-icon",className:"e-pv-annotation-freetextedit-container"}),p.push({type:"Separator",align:"Left"}),p.push({template:s}),p.push({template:a}),p.push({template:l}),p.push({template:h}),p.push({template:d})),"Polygon"===e?("Area"===this.pdfViewer.selectedItems.annotations[0].measureType?p.push({prefixIcon:"e-pv-calibrate-area-icon e-pv-icon"}):"Volume"===this.pdfViewer.selectedItems.annotations[0].measureType?p.push({prefixIcon:"e-pv-calibrate-volume-icon e-pv-icon"}):p.push({prefixIcon:"e-pv-shape-pentagon-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})):"Rectangle"===e?(p.push({prefixIcon:"e-pv-shape-rectangle-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})):"Ellipse"===e?(p.push({prefixIcon:"e-pv-shape-circle-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})):"Line"===e?("Perimeter"===this.pdfViewer.selectedItems.annotations[0].measureType?p.push({prefixIcon:"e-pv-calibrate-perimeter-icon e-pv-icon"}):p.push({prefixIcon:"e-pv-shape-line-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})):"LineWidthArrowHead"===e?(p.push({prefixIcon:"e-pv-shape-arrow-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})):"Distance"===e?(p.push({prefixIcon:"e-pv-calibrate-distance-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})):"Perimeter"===e?(p.push({prefixIcon:"e-pv-calibrate-perimeter-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})):"Radius"===e&&(p.push({prefixIcon:"e-pv-calibrate-radius-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})),p.push({template:i}),p.push({template:n}),p.push({template:o})):"Path"===e||"Ink"===e||"HandWrittenSignature"===e||"SignatureText"===e?("Path"===e||"Ink"===e?(p.push({prefixIcon:"e-pv-inkannotation-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})):"HandWrittenSignature"!==e&&"SignatureText"!==e||(p.push({prefixIcon:"e-pv-handwritten-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})),p.push({template:n}),p.push({template:o})):"Underline"===e||"Highlight"===e||"Strikethrough"===e?("Highlight"===e?(p.push({prefixIcon:"e-pv-highlight-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})):"Underline"===e?(p.push({prefixIcon:"e-pv-underline-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})):"Strikethrough"===e&&(p.push({prefixIcon:"e-pv-strikethrough-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})),p.push({template:i})):"Stamp"===e||"Image"===e?(p.push({prefixIcon:"e-pv-stamp-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})):"StickyNotes"===e&&(p.push({prefixIcon:"e-pv-comment-icon e-pv-icon"}),p.push({type:"Separator",align:"Left"})),p.push({template:r}),p.push({prefixIcon:"e-pv-comment-panel-icon e-pv-icon",className:"e-pv-comment-panel-icon-container",id:this.pdfViewer.element.id+"_annotation_commentPanel",align:"Right",click:function(e){t.pdfViewer.annotationModule.showCommentsPanel()}}),p.push({prefixIcon:"e-pv-annotation-delete-icon e-pv-icon",className:"e-pv-annotation-delete-container",id:this.pdfViewer.element.id+"_annotation_delete",align:"Right",click:function(e){t.pdfViewer.annotationModule.deleteAnnotation(),t.propertyToolbar.destroy(),t.toolbarCreated=!1,t.createAnnotationToolbarForMobile(),t.adjustMobileViewer()}}),p},_Rt.prototype.createStampToolbarItemsForMobile=function(){var e=this.getTemplate("span","_annotation_opacity","e-pv-annotation-opacity-container"),t=[];return t.push({prefixIcon:"e-pv-backward-icon e-pv-icon",tooltipText:this.pdfViewer.localeObj.getConstant("Go Back"),id:this.pdfViewer.element.id+"_backward",click:this.goBackToToolbar.bind(this)}),t.push({type:"Separator",align:"Left"}),t.push({template:e}),t},_Rt.prototype.createShapeToolbarItemsForMobile=function(){var e=this.pdfViewer.toolbarModule.annotationToolbarModule.getTemplate("span","_annotation_color","e-pv-annotation-color-container"),t=this.pdfViewer.toolbarModule.annotationToolbarModule.getTemplate("span","_annotation_stroke","e-pv-annotation-stroke-container"),i=this.getTemplate("span","_annotation_thickness","e-pv-annotation-thickness-container"),n=this.getTemplate("span","_annotation_opacity","e-pv-annotation-opacity-container"),o=[];return o.push({prefixIcon:"e-pv-backward-icon e-pv-icon",tooltipText:this.pdfViewer.localeObj.getConstant("Go Back"),id:this.pdfViewer.element.id+"_backward",click:this.goBackToToolbar.bind(this)}),o.push({prefixIcon:"e-pv-shape-line-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_shape_line",text:this.pdfViewer.localeObj.getConstant("Line Shape"),align:"Left"}),o.push({prefixIcon:"e-pv-shape-arrow-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_shape_arrow",text:this.pdfViewer.localeObj.getConstant("Arrow Shape"),align:"Left"}),o.push({prefixIcon:"e-pv-shape-rectangle-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_shape_rectangle",text:this.pdfViewer.localeObj.getConstant("Rectangle Shape"),align:"Left"}),o.push({prefixIcon:"e-pv-shape-circle-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_shape_circle",text:this.pdfViewer.localeObj.getConstant("Circle Shape"),align:"Left"}),o.push({prefixIcon:"e-pv-shape-pentagon-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_shape_pentagon",text:this.pdfViewer.localeObj.getConstant("Pentagon Shape"),align:"Left"}),o.push({type:"Separator",align:"Left"}),o.push({template:e}),o.push({template:t}),o.push({template:i}),o.push({template:n}),o},_Rt.prototype.createCalibrateToolbarItemsForMobile=function(){var e=this.pdfViewer.toolbarModule.annotationToolbarModule.getTemplate("span","_annotation_color","e-pv-annotation-color-container"),t=this.pdfViewer.toolbarModule.annotationToolbarModule.getTemplate("span","_annotation_stroke","e-pv-annotation-stroke-container"),i=this.getTemplate("span","_annotation_thickness","e-pv-annotation-thickness-container"),n=this.getTemplate("span","_annotation_opacity","e-pv-annotation-opacity-container"),o=[];return o.push({prefixIcon:"e-pv-backward-icon e-pv-icon",tooltipText:this.pdfViewer.localeObj.getConstant("Go Back"),id:this.pdfViewer.element.id+"_backward",click:this.goBackToToolbar.bind(this)}),o.push({prefixIcon:"e-pv-calibrate-distance-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_calibrate_distance",text:this.pdfViewer.localeObj.getConstant(""),align:"Left"}),o.push({prefixIcon:"e-pv-calibrate-perimeter-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_calibrate_perimeter",text:this.pdfViewer.localeObj.getConstant(""),align:"Left"}),o.push({prefixIcon:"e-pv-calibrate-area-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_calibrate_area",text:this.pdfViewer.localeObj.getConstant(""),align:"Left"}),o.push({prefixIcon:"e-pv-calibrate-radius-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_calibrate_radius",text:this.pdfViewer.localeObj.getConstant(""),align:"Left"}),o.push({prefixIcon:"e-pv-calibrate-volume-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_calibrate_volume",text:this.pdfViewer.localeObj.getConstant(""),align:"Left"}),o.push({type:"Separator",align:"Left"}),o.push({template:e}),o.push({template:t}),o.push({template:i}),o.push({template:n}),o},_Rt.prototype.handleShapeTool=function(e){if(!N&&F.isDevice)for(var t=document.querySelectorAll(".e-pv-select"),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].id!==e&&t[parseInt(i.toString(),10)].id!==this.pdfViewer.element.id+"_annotation"&&t[parseInt(i.toString(),10)].classList.remove("e-pv-select")},_Rt.prototype.createPropDropDownButton=function(e,t,i,n){t=new u2({iconCss:t+" e-pv-icon",target:i,cssClass:"e-caret-hide"});return this.pdfViewer.enableRtl&&(t.enableRtl=!0),t.appendTo(e),this.primaryToolbar.createTooltip(e,n),e.setAttribute("aria-label",n),t},_Rt.prototype.textAlignmentToolbarItems=function(){var e=[];return e.push({prefixIcon:"e-pv-left-align-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_left_align",align:"Left",value:"Left",click:this.onClickTextAlignment.bind(this)}),e.push({prefixIcon:"e-pv-center-align-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_center_align",align:"Left",value:"Center",click:this.onClickTextAlignment.bind(this)}),e.push({prefixIcon:"e-pv-right-align-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_right_align",align:"Left",value:"Right",click:this.onClickTextAlignment.bind(this)}),e.push({prefixIcon:"e-pv-justfiy-align-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_justify_align",align:"Left",value:"Justify",click:this.onClickTextAlignment.bind(this)}),e},_Rt.prototype.afterAlignmentToolbarCreation=function(){this.alignLeftElement=this.primaryToolbar.addClassToolbarItem("_left_align","e-pv-left-align",this.pdfViewer.localeObj.getConstant("Align left")),this.alignRightElement=this.primaryToolbar.addClassToolbarItem("_right_align","e-pv-right-align",this.pdfViewer.localeObj.getConstant("Align right")),this.alignCenterElement=this.primaryToolbar.addClassToolbarItem("_center_align","e-pv-center-align",this.pdfViewer.localeObj.getConstant("Center")),this.alignJustifyElement=this.primaryToolbar.addClassToolbarItem("_justify_align","e-pv-justfiy-align",this.pdfViewer.localeObj.getConstant("Justify"))},_Rt.prototype.afterPropertiesToolbarCreation=function(){this.boldElement=this.primaryToolbar.addClassToolbarItem("_bold","e-pv-bold",this.pdfViewer.localeObj.getConstant("Bold")),this.italicElement=this.primaryToolbar.addClassToolbarItem("_italic","e-pv-italic",this.pdfViewer.localeObj.getConstant("Italic")),this.fontStyleStrikethroughItem=this.primaryToolbar.addClassToolbarItem("_strikeout","e-pv-strikeout",this.pdfViewer.localeObj.getConstant("Strikethroughs")),this.fontStyleUnderlineItem=this.primaryToolbar.addClassToolbarItem("_underline_textinput","e-pv-underlinetext",this.pdfViewer.localeObj.getConstant("Underlines"))},_Rt.prototype.createDropDownListForSize=function(e){var t=this,i=["8px","9px","10px","11px","12px","14px","16px","18px","20px","22px","24px","26px","28px","36px","48px","72px","96px"];this.pdfViewer.enableRtl?this.fontSize=new oU({dataSource:i,cssClass:"e-pv-prop-dropdown-rtl",allowCustom:!0,showClearButton:!1,width:"80px",popupWidth:"100px",enableRtl:!0}):this.fontSize=new oU({dataSource:i,cssClass:"e-pv-prop-dropdown",allowCustom:!0,showClearButton:!1,width:"80px",popupWidth:"100px"}),this.fontSize.value="16px",je(e)||(this.fontSize.appendTo(e),i=e.parentElement||e,this.primaryToolbar.createTooltip(i,this.pdfViewer.localeObj.getConstant("Font size")),e.setAttribute("aria-label",this.pdfViewer.localeObj.getConstant("Font size"))),this.fontSize.addEventListener("change",function(e){e=e.isInteracted;t.onFontSizeChange(t,e)})},_Rt.prototype.createDropDownListForFamily=function(e){var t=this,i=[{FontName:"Helvetica"},{FontName:"Courier"},{FontName:"Symbol"},{FontName:"Times New Roman"}];this.pdfViewer.enableRtl?this.fontFamily=new oU({dataSource:i,query:(new ya).select(["FontName"]),fields:{text:"FontName",value:"FontName"},cssClass:"e-pv-prop-dropdown-rtl",itemTemplate:ao(function(e){return'<span style="font-family: '+e.FontName+';">'+e.FontName+"</span>"}),allowCustom:!0,showClearButton:!1,width:"110px",popupWidth:"190px",enableRtl:!0}):this.fontFamily=new oU({dataSource:i,query:(new ya).select(["FontName"]),fields:{text:"FontName",value:"FontName"},cssClass:"e-pv-prop-dropdown",itemTemplate:ao(function(e){return'<span style="font-family: '+e.FontName+';">'+e.FontName+"</span>"}),allowCustom:!0,showClearButton:!1,width:"110px",popupWidth:"190px"}),this.fontFamily.isStringTemplate=!0,this.fontFamily.value="Helvetica",je(e)||(this.fontFamily.appendTo(e),i=e.parentElement||e,this.primaryToolbar.createTooltip(i,this.pdfViewer.localeObj.getConstant("Font family")),e.setAttribute("aria-label",this.pdfViewer.localeObj.getConstant("Font family"))),this.fontFamily.addEventListener("change",function(){t.onFontFamilyChange(t)})},_Rt.prototype.textPropertiesToolbarItems=function(){var e=[];return e.push({prefixIcon:"e-pv-bold-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_bold",align:"Left",value:"bold",click:this.onClickTextProperties.bind(this)}),e.push({prefixIcon:"e-pv-italic-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_italic",align:"Left",value:"italic",click:this.onClickTextProperties.bind(this)}),e.push({prefixIcon:"e-pv-strikeout-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_strikeout",align:"Left",value:"strikeout",click:this.onClickTextProperties.bind(this)}),e.push({prefixIcon:"e-pv-underlinetext-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_underline_textinput",align:"Left",value:"underline",click:this.onClickTextProperties.bind(this)}),e},_Rt.prototype.createShapeToolbarItems=function(){var e=[];return e.push({prefixIcon:"e-pv-shape-line-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_shape_line",text:this.pdfViewer.localeObj.getConstant("Line Shape"),align:"Left"}),e.push({prefixIcon:"e-pv-shape-arrow-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_shape_arrow",text:this.pdfViewer.localeObj.getConstant("Arrow Shape"),align:"Left"}),e.push({prefixIcon:"e-pv-shape-rectangle-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_shape_rectangle",text:this.pdfViewer.localeObj.getConstant("Rectangle Shape"),align:"Left"}),e.push({prefixIcon:"e-pv-shape-circle-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_shape_circle",text:this.pdfViewer.localeObj.getConstant("Circle Shape"),align:"Left"}),e.push({prefixIcon:"e-pv-shape-pentagon-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_shape_pentagon",text:this.pdfViewer.localeObj.getConstant("Pentagon Shape"),align:"Left"}),e},_Rt.prototype.createCalibrateToolbarItems=function(){var e=[];return e.push({prefixIcon:"e-pv-calibrate-distance-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_calibrate_distance",text:this.pdfViewer.localeObj.getConstant(""),align:"Left"}),e.push({prefixIcon:"e-pv-calibrate-perimeter-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_calibrate_perimeter",text:this.pdfViewer.localeObj.getConstant(""),align:"Left"}),e.push({prefixIcon:"e-pv-calibrate-area-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_calibrate_area",text:this.pdfViewer.localeObj.getConstant(""),align:"Left"}),e.push({prefixIcon:"e-pv-calibrate-radius-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_calibrate_radius",text:this.pdfViewer.localeObj.getConstant(""),align:"Left"}),e.push({prefixIcon:"e-pv-calibrate-volume-icon e-pv-icon",cssClass:"",id:this.pdfViewer.element.id+"_calibrate_volume",text:this.pdfViewer.localeObj.getConstant(""),align:"Left"}),e},_Rt.prototype.onCalibrateToolbarClicked=function(e){var t,i=this.pdfViewer.element.id,n=this.pdfViewer.annotation.measureAnnotationModule;switch(this.deselectAllItems(),this.deselectAllItemsForMobile(),this.resetFreeTextAnnot(),F.isDevice&&!N&&(t=e.originalEvent.target,this.pdfViewer.toolbarModule.selectItem(t.parentElement)),e.originalEvent.target.id){case i+"_calibrate_distance":case i+"_calibrate_distanceIcon":n.setAnnotationType("Distance"),this.onShapeDrawSelection(!1),this.updateColorInIcon(this.colorDropDownElement,n.distanceFillColor),this.updateColorInIcon(this.strokeDropDownElement,n.distanceStrokeColor),this.handleShapeTool(i+"_calibrate_distance");break;case i+"_calibrate_perimeter":case i+"_calibrate_perimeterIcon":n.setAnnotationType("Perimeter"),this.onShapeDrawSelection(!1),this.updateColorInIcon(this.colorDropDownElement,n.perimeterFillColor),this.updateColorInIcon(this.strokeDropDownElement,n.perimeterStrokeColor),this.handleShapeTool(i+"_calibrate_perimeter");break;case i+"_calibrate_area":case i+"_calibrate_areaIcon":n.setAnnotationType("Area"),this.onShapeDrawSelection(!1),this.updateColorInIcon(this.colorDropDownElement,n.areaFillColor),this.updateColorInIcon(this.strokeDropDownElement,n.areaStrokeColor),this.handleShapeTool(i+"_calibrate_area");break;case i+"_calibrate_radius":case i+"_calibrate_radiusIcon":n.setAnnotationType("Radius"),this.onShapeDrawSelection(!1),this.updateColorInIcon(this.colorDropDownElement,n.radiusFillColor),this.updateColorInIcon(this.strokeDropDownElement,n.radiusStrokeColor),this.handleShapeTool(i+"_calibrate_radius");break;case i+"_calibrate_volume":case i+"_calibrate_volumeIcon":n.setAnnotationType("Volume"),this.onShapeDrawSelection(!1),this.updateColorInIcon(this.colorDropDownElement,n.volumeFillColor),this.updateColorInIcon(this.strokeDropDownElement,n.volumeStrokeColor),this.handleShapeTool(i+"_calibrate_volume")}},_Rt.prototype.onShapeDrawSelection=function(e){F.isDevice||(this.updateInteractionTools(),this.enableAnnotationPropertiesTools(!0),(e?this.shapeDropDown:this.calibrateDropDown).toggle()),this.pdfViewer.annotation.triggerAnnotationUnselectEvent(),this.pdfViewer.annotation.triggerSignatureUnselectEvent()},_Rt.prototype.afterCalibrateToolbarCreationForMobile=function(){this.primaryToolbar.addClassToolbarItem("_calibrate_distance","e-pv-calibrate-distance",this.pdfViewer.localeObj.getConstant("Calibrate Distance")),this.primaryToolbar.addClassToolbarItem("_calibrate_perimeter","e-pv-calibrate-perimeter",this.pdfViewer.localeObj.getConstant("Calibrate Perimeter")),this.primaryToolbar.addClassToolbarItem("_calibrate_area","e-pv-calibrate-area",this.pdfViewer.localeObj.getConstant("Calibrate Area")),this.primaryToolbar.addClassToolbarItem("_calibrate_radius","e-pv-calibrate-radius",this.pdfViewer.localeObj.getConstant("Calibrate Radius")),this.primaryToolbar.addClassToolbarItem("_calibrate_volume","e-pv-calibrate-volume",this.pdfViewer.localeObj.getConstant("Calibrate Volume"))},_Rt.prototype.afterShapeToolbarCreationForMobile=function(){this.primaryToolbar.addClassToolbarItem("_annotation_color","e-pv-annotation-color-container",this.pdfViewer.localeObj.getConstant("Change Color")),this.primaryToolbar.addClassToolbarItem("_annotation_stroke","e-pv-annotation-stroke-container",this.pdfViewer.localeObj.getConstant("Change Stroke Color")),this.primaryToolbar.addClassToolbarItem("_annotation_thickness","e-pv-annotation-thickness-container",this.pdfViewer.localeObj.getConstant("Chnage Border Thickness")),this.primaryToolbar.addClassToolbarItem("_annotation_opacity","e-annotation-opacity-container",this.pdfViewer.localeObj.getConstant("Change Opacity")),this.primaryToolbar.addClassToolbarItem("_shape_line","e-pv-shape-line",this.pdfViewer.localeObj.getConstant("Add line")),this.primaryToolbar.addClassToolbarItem("_shape_arrow","e-pv-shape-arrow",this.pdfViewer.localeObj.getConstant("Add arrow")),this.primaryToolbar.addClassToolbarItem("_shape_rectangle","e-pv-shape-rectangle",this.pdfViewer.localeObj.getConstant("Add rectangle")),this.primaryToolbar.addClassToolbarItem("_shape_circle","e-pv-shape-circle",this.pdfViewer.localeObj.getConstant("Add circle")),this.primaryToolbar.addClassToolbarItem("_shape_pentagon","e-pv-shape-pentagon",this.pdfViewer.localeObj.getConstant("Add polygon"))},_Rt.prototype.afterShapeToolbarCreation=function(){this.lineElement=this.primaryToolbar.addClassToolbarItem("_shape_line","e-pv-shape-line",this.pdfViewer.localeObj.getConstant("Add line")),this.arrowElement=this.primaryToolbar.addClassToolbarItem("_shape_arrow","e-pv-shape-arrow",this.pdfViewer.localeObj.getConstant("Add arrow")),this.rectangleElement=this.primaryToolbar.addClassToolbarItem("_shape_rectangle","e-pv-shape-rectangle",this.pdfViewer.localeObj.getConstant("Add rectangle")),this.circleElement=this.primaryToolbar.addClassToolbarItem("_shape_circle","e-pv-shape-circle",this.pdfViewer.localeObj.getConstant("Add circle")),this.polygonElement=this.primaryToolbar.addClassToolbarItem("_shape_pentagon","e-pv-shape-pentagon",this.pdfViewer.localeObj.getConstant("Add polygon"))},_Rt.prototype.afterCalibrateToolbarCreation=function(){this.calibrateDistance=this.primaryToolbar.addClassToolbarItem("_calibrate_distance","e-pv-calibrate-distance",this.pdfViewer.localeObj.getConstant("Calibrate Distance")),this.calibratePerimeter=this.primaryToolbar.addClassToolbarItem("_calibrate_perimeter","e-pv-calibrate-perimeter",this.pdfViewer.localeObj.getConstant("Calibrate Perimeter")),this.calibrateArea=this.primaryToolbar.addClassToolbarItem("_calibrate_area","e-pv-calibrate-area",this.pdfViewer.localeObj.getConstant("Calibrate Area")),this.calibrateRadius=this.primaryToolbar.addClassToolbarItem("_calibrate_radius","e-pv-calibrate-radius",this.pdfViewer.localeObj.getConstant("Calibrate Radius")),this.calibrateVolume=this.primaryToolbar.addClassToolbarItem("_calibrate_volume","e-pv-calibrate-volume",this.pdfViewer.localeObj.getConstant("Calibrate Volume"))},_Rt.prototype.afterMobileToolbarCreation=function(){var e=!!navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i);this.highlightItem=this.primaryToolbar.addClassToolbarItem("_highlight","e-pv-highlight",this.pdfViewer.localeObj.getConstant("Highlight")),this.underlineItem=this.primaryToolbar.addClassToolbarItem("_underline","e-pv-underline",this.pdfViewer.localeObj.getConstant("Underline")),this.strikethroughItem=this.primaryToolbar.addClassToolbarItem("_strikethrough","e-pv-strikethrough",this.pdfViewer.localeObj.getConstant("Strikethrough")),this.shapesItem=this.primaryToolbar.addClassToolbarItem("_annotation_shapes","e-pv-annotation-shapes",this.pdfViewer.localeObj.getConstant("Add Shapes")),this.calibrateItem=this.primaryToolbar.addClassToolbarItem("_annotation_calibrate","e-pv-annotation-calibrate",this.pdfViewer.localeObj.getConstant("Calibrate")),this.freeTextEditItem=this.primaryToolbar.addClassToolbarItem("_annotation_freeTextEdit","e-pv-annotation-freeTextEdit",this.pdfViewer.localeObj.getConstant("Free Text")),this.commentItem=this.primaryToolbar.addClassToolbarItem("_comment","e-pv-comment",this.pdfViewer.localeObj.getConstant("Add Comments")),this.commentItem=this.primaryToolbar.addClassToolbarItem("_annotation_commentPanel","e-pv-annotation-comment-panel",this.pdfViewer.localeObj.getConstant("Comment Panel")+(e?" (⌘+⌥+0)":" (Ctrl+Alt+0)")),this.inkAnnotationItem=this.primaryToolbar.addClassToolbarItem("_annotation_ink","e-pv-annotation-ink",this.pdfViewer.localeObj.getConstant("Draw Ink")),this.selectAnnotationDeleteItem(!1),this.enableCommentPanelTool(this.pdfViewer.enableCommentPanel)},_Rt.prototype.createColorPicker=function(e){var t=document.getElementById(e+"_target"),t=t||Q("input",{id:e+"_target"}),e=(document.body.appendChild(t),new cV({inline:!0,mode:"Palette",cssClass:"e-show-value",enableOpacity:!1,value:"#000000",showButtons:!1,modeSwitcher:!1}));return this.pdfViewer.enableRtl&&(e.enableRtl=!0),e.appendTo(t),e},_Rt.prototype.onColorPickerChange=function(e){var t=N?e[0]:""===e.currentValue.hex?"#ffffff00":e.currentValue.hex;if(this.pdfViewer.annotationModule.textMarkupAnnotationModule)if(this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation)this.pdfViewer.annotationModule.textMarkupAnnotationModule.modifyColorProperty(t);else switch(this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAddMode){case"Highlight":this.pdfViewer.annotationModule.textMarkupAnnotationModule.highlightColor=t;break;case"Underline":this.pdfViewer.annotationModule.textMarkupAnnotationModule.underlineColor=t;break;case"Strikethrough":this.pdfViewer.annotationModule.textMarkupAnnotationModule.strikethroughColor=t}if(1===this.pdfViewer.selectedItems.annotations.length)N?e[0]!==e[1]&&this.pdfViewer.annotation.modifyFillColor(t):e.currentValue.hex!==e.previousValue.hex&&this.pdfViewer.annotation.modifyFillColor(t);else{if(this.pdfViewer.annotation.shapeAnnotationModule)switch(this.pdfViewer.annotation.shapeAnnotationModule.currentAnnotationMode){case"Line":this.pdfViewer.annotation.shapeAnnotationModule.lineFillColor=t;break;case"Arrow":this.pdfViewer.annotation.shapeAnnotationModule.arrowFillColor=t;break;case"Rectangle":this.pdfViewer.annotation.shapeAnnotationModule.rectangleFillColor=t;break;case"Circle":this.pdfViewer.annotation.shapeAnnotationModule.circleFillColor=t;break;case"Polygon":this.pdfViewer.annotation.shapeAnnotationModule.polygonFillColor=t}this.pdfViewer.drawingObject&&(this.pdfViewer.drawingObject.fillColor=t,"FreeText"===this.pdfViewer.drawingObject.shapeAnnotationType)&&(this.pdfViewer.annotation.freeTextAnnotationModule.fillColor=t)}N?(this.colorDropDownElementInBlazor=this.pdfViewer.element.querySelector(".e-pv-annotation-color-container"),this.updateColorInIcon(this.colorDropDownElementInBlazor,t)):(this.updateColorInIcon(this.colorDropDownElement,t),this.colorDropDown.toggle())},_Rt.prototype.onStrokePickerChange=function(e){var t=N?e[0]:""===e.currentValue.hex?"#ffffff00":e.currentValue.hex;if(1===this.pdfViewer.selectedItems.annotations.length)N?e[0]!==e[1]&&this.pdfViewer.annotation.modifyStrokeColor(t):e.currentValue.hex!==e.previousValue.hex&&this.pdfViewer.annotation.modifyStrokeColor(t);else{if(this.pdfViewer.annotation.shapeAnnotationModule)switch(this.pdfViewer.annotation.shapeAnnotationModule.currentAnnotationMode){case"Line":this.pdfViewer.annotation.shapeAnnotationModule.lineStrokeColor=t;break;case"Arrow":this.pdfViewer.annotation.shapeAnnotationModule.arrowStrokeColor=t;break;case"Rectangle":this.pdfViewer.annotation.shapeAnnotationModule.rectangleStrokeColor=t;break;case"Circle":this.pdfViewer.annotation.shapeAnnotationModule.circleStrokeColor=t;break;case"Polygon":this.pdfViewer.annotation.shapeAnnotationModule.polygonStrokeColor=t}e=this.pdfViewer.annotation;e&&e.inkAnnotationModule&&(this.pdfViewer.inkAnnotationSettings.strokeColor=t),this.pdfViewer.drawingObject&&(this.pdfViewer.drawingObject.strokeColor=t),this.pdfViewer.drawingObject&&"FreeText"===this.pdfViewer.drawingObject.shapeAnnotationType&&(this.pdfViewer.annotation.freeTextAnnotationModule.borderColor=t)}N?(this.strokeDropDownElementInBlazor=this.pdfViewer.element.querySelector(".e-pv-annotation-stroke-container"),this.updateColorInIcon(this.strokeDropDownElementInBlazor,t)):(this.updateColorInIcon(this.strokeDropDownElement,t),this.strokeDropDown.toggle())},_Rt.prototype.updateColorInIcon=function(e,t){N?e&&(e.children[0].style.borderBottomColor=t):e&&e.childNodes[0]&&(e.childNodes[0].style.borderBottomColor=t)},_Rt.prototype.updateTextPropertySelection=function(e){"bold"===e?document.getElementById(this.pdfViewer.element.id+"_bold").classList.toggle("textprop-option-active"):"italic"===e?document.getElementById(this.pdfViewer.element.id+"_italic").classList.toggle("textprop-option-active"):"underline"===e?(document.getElementById(this.pdfViewer.element.id+"_underline_textinput").classList.toggle("textprop-option-active"),document.getElementById(this.pdfViewer.element.id+"_strikeout").classList.remove("textprop-option-active")):"strikeout"===e&&(document.getElementById(this.pdfViewer.element.id+"_strikeout").classList.toggle("textprop-option-active"),document.getElementById(this.pdfViewer.element.id+"_underline_textinput").classList.remove("textprop-option-active"))},_Rt.prototype.updateFontFamilyInIcon=function(e){this.fontFamily.value=e},_Rt.prototype.updateTextAlignInIcon=function(e){var t="e-btn-icon e-pv-left-align-icon e-pv-icon",i=document.getElementById(this.pdfViewer.element.id+"_left_align"),n=document.getElementById(this.pdfViewer.element.id+"_right_align"),o=document.getElementById(this.pdfViewer.element.id+"_center_align"),r=document.getElementById(this.pdfViewer.element.id+"_justify_align");N||(i.classList.remove("textprop-option-active"),n.classList.remove("textprop-option-active"),o.classList.remove("textprop-option-active"),r.classList.remove("textprop-option-active")),"Left"===e?i.classList.add("textprop-option-active"):"Right"===e?(t="e-btn-icon e-pv-right-align-icon e-pv-icon",n.classList.add("textprop-option-active")):"Center"===e?(t="e-btn-icon e-pv-center-align-icon e-pv-icon",o.classList.add("textprop-option-active")):"Justify"===e&&(t="e-btn-icon e-pv-justfiy-align-icon e-pv-icon",r.classList.add("textprop-option-active")),document.getElementById(this.pdfViewer.element.id+"_annotation_textalign").children[0].className=t},_Rt.prototype.updateFontSizeInIcon=function(e){je(this.fontSize)&&this.pdfViewer.annotationModule?this.pdfViewer.annotationModule.handleFontSizeUpdate(e):this.fontSize.value=e+"px"},_Rt.prototype.updateOpacityIndicator=function(){this.opacityIndicator.textContent=parseInt(Math.round(this.opacitySlider.value).toString(),10)+"%"},_Rt.prototype.updateThicknessIndicator=function(){this.thicknessIndicator.textContent=this.thicknessSlider.value+" pt"},_Rt.prototype.createSlider=function(e){var t=Q("div",{className:"e-pv-annotation-opacity-popup-container"}),i=(document.body.appendChild(t),Q("span",{id:e+"_label",className:"e-pv-annotation-opacity-label"})),n=(i.textContent=this.pdfViewer.localeObj.getConstant("Opacity"),Q("div",{id:e+"_slider"}));return this.opacitySlider=new KO({type:"MinRange",cssClass:"e-pv-annotation-opacity-slider",max:100,min:0}),this.opacityIndicator=Q("div",{id:e+"_opacity_indicator",className:"e-pv-annotation-opacity-indicator"}),this.opacityIndicator.textContent="100%",this.pdfViewer.enableRtl?(t.appendChild(this.opacityIndicator),t.appendChild(n),this.opacitySlider.enableRtl=!0,this.opacitySlider.appendTo(n),this.opacitySlider.element.parentElement.classList.add("e-pv-annotation-opacity-slider-container"),t.appendChild(i)):(t.appendChild(i),t.appendChild(n),this.opacitySlider.appendTo(n),this.opacitySlider.element.parentElement.classList.add("e-pv-annotation-opacity-slider-container"),t.appendChild(this.opacityIndicator)),t},_Rt.prototype.createThicknessSlider=function(e){var t=Q("div",{className:"e-pv-annotation-thickness-popup-container"}),i=(document.body.appendChild(t),Q("span",{id:e+"_label",className:"e-pv-annotation-thickness-label"})),n=(i.textContent=this.pdfViewer.localeObj.getConstant("Line Thickness"),Q("div",{id:e+"_slider"}));return this.thicknessSlider=new KO({type:"MinRange",cssClass:"e-pv-annotation-thickness-slider",max:12,min:0}),this.thicknessIndicator=Q("div",{id:e+"_thickness_indicator",className:"e-pv-annotation-thickness-indicator"}),this.thicknessIndicator.textContent="0 pt",this.pdfViewer.enableRtl?(t.appendChild(this.thicknessIndicator),t.appendChild(n),this.thicknessSlider.enableRtl=!0,this.thicknessSlider.appendTo(n),t.appendChild(i)):(t.appendChild(i),t.appendChild(n),this.thicknessSlider.appendTo(n),t.appendChild(this.thicknessIndicator)),this.thicknessSlider.element.parentElement.classList.add("e-pv-annotation-thickness-slider-container"),t},_Rt.prototype.afterToolbarCreation=function(){var e=!!navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i);this.highlightItem=this.primaryToolbar.addClassToolbarItem("_highlight","e-pv-highlight",this.pdfViewer.localeObj.getConstant("Highlight")),this.underlineItem=this.primaryToolbar.addClassToolbarItem("_underline","e-pv-underline",this.pdfViewer.localeObj.getConstant("Underline")),this.strikethroughItem=this.primaryToolbar.addClassToolbarItem("_strikethrough","e-pv-strikethrough",this.pdfViewer.localeObj.getConstant("Strikethrough")),this.deleteItem=this.primaryToolbar.addClassToolbarItem("_annotation_delete","e-pv-annotation-delete",this.pdfViewer.localeObj.getConstant("Delete")+" (delete)"),this.freeTextEditItem=this.primaryToolbar.addClassToolbarItem("_annotation_freeTextEdit","e-pv-annotation-freeTextEdit",this.pdfViewer.localeObj.getConstant("Free Text")),this.inkAnnotationItem=this.primaryToolbar.addClassToolbarItem("_annotation_ink","e-pv-annotation-ink",this.pdfViewer.localeObj.getConstant("Draw Ink")),this.pdfViewerBase.getElement("_annotation_shapes").setAttribute("aria-label",this.pdfViewer.localeObj.getConstant("Add Shapes")),this.pdfViewerBase.getElement("_annotation_calibrate").setAttribute("aria-label",this.pdfViewer.localeObj.getConstant("Calibrate")),this.pdfViewerBase.getElement("_comment").setAttribute("aria-label",this.pdfViewer.localeObj.getConstant("Add Comments")),this.commentItem=this.primaryToolbar.addClassToolbarItem("_annotation_commentPanel","e-pv-annotation-comment-panel",this.pdfViewer.localeObj.getConstant("Comment Panel")+(e?" (⌘+⌥+0)":" (Ctrl+Alt+0)")),this.closeItem=this.primaryToolbar.addClassToolbarItem("_annotation_close","e-pv-annotation-tools-close",null),this.pdfViewerBase.getElement("_annotation_close").setAttribute("aria-label","Close Annotation Toolbar"),this.selectAnnotationDeleteItem(!1),this.enableTextMarkupAnnotationPropertiesTools(!1),this.enableCommentPanelTool(this.pdfViewer.enableCommentPanel)},_Rt.prototype.onToolbarClicked=function(e){var t=this.pdfViewer.selectedItems.annotations[0],i=(e.originalEvent.target.id&&this.pdfViewer.toolbarModule.updateStampItems(),e.originalEvent&&"mouse"!==e.originalEvent.pointerType&&"touch"!==e.originalEvent.pointerType);switch(this.pdfViewer.toolbarModule.deSelectCommentAnnotation(),e.originalEvent.target.id){case this.pdfViewer.element.id+"_highlight":case this.pdfViewer.element.id+"_highlightIcon":this.pdfViewer.tool="",F.isDevice?this.isMobileHighlightEnabled?(this.deselectAllItemsForMobile(),this.pdfViewer.annotationModule.setAnnotationMode("None")):(this.pdfViewer.annotationModule.setAnnotationMode("Highlight"),this.primaryToolbar.selectItem(this.highlightItem),this.primaryToolbar.deSelectItem(this.underlineItem),this.primaryToolbar.deSelectItem(this.strikethroughItem),this.primaryToolbar.deSelectItem(this.freeTextEditItem),this.primaryToolbar.deSelectItem(this.inkAnnotationItem),this.textMarkupForMobile(e),this.isMobileHighlightEnabled=!0,this.isMobileUnderlineEnabled=!1,this.isMobileStrikethroughEnabled=!1):(this.pdfViewer.tool="",this.resetFreeTextAnnot(),this.handleHighlight()),this.pdfViewer.annotation.triggerAnnotationUnselectEvent(),this.pdfViewer.annotation.triggerSignatureUnselectEvent();break;case this.pdfViewer.element.id+"_underline":case this.pdfViewer.element.id+"_underlineIcon":this.pdfViewer.tool="",F.isDevice?this.isMobileUnderlineEnabled?(this.deselectAllItemsForMobile(),this.pdfViewer.annotationModule.setAnnotationMode("None")):(this.pdfViewer.annotationModule.setAnnotationMode("Underline"),this.primaryToolbar.selectItem(this.underlineItem),this.primaryToolbar.deSelectItem(this.highlightItem),this.primaryToolbar.deSelectItem(this.strikethroughItem),this.primaryToolbar.deSelectItem(this.freeTextEditItem),this.primaryToolbar.deSelectItem(this.inkAnnotationItem),this.textMarkupForMobile(e),this.isMobileUnderlineEnabled=!0,this.isMobileHighlightEnabled=!1,this.isMobileStrikethroughEnabled=!1):(this.pdfViewer.tool="",this.resetFreeTextAnnot(),this.handleUnderline()),this.pdfViewer.annotation.triggerAnnotationUnselectEvent(),this.pdfViewer.annotation.triggerSignatureUnselectEvent();break;case this.pdfViewer.element.id+"_strikethrough":case this.pdfViewer.element.id+"_strikethroughIcon":this.pdfViewer.tool="",F.isDevice?this.isMobileStrikethroughEnabled?(this.deselectAllItemsForMobile(),this.pdfViewer.annotationModule.setAnnotationMode("None")):(this.pdfViewer.annotationModule.setAnnotationMode("Strikethrough"),this.primaryToolbar.selectItem(this.strikethroughItem),this.primaryToolbar.deSelectItem(this.highlightItem),this.primaryToolbar.deSelectItem(this.underlineItem),this.primaryToolbar.deSelectItem(this.freeTextEditItem),this.primaryToolbar.deSelectItem(this.inkAnnotationItem),this.textMarkupForMobile(e),this.isMobileStrikethroughEnabled=!0,this.isMobileUnderlineEnabled=!1,this.isMobileHighlightEnabled=!1):(this.pdfViewer.tool="",this.resetFreeTextAnnot(),this.handleStrikethrough()),this.pdfViewer.annotation.triggerAnnotationUnselectEvent(),this.pdfViewer.annotation.triggerSignatureUnselectEvent();break;case this.pdfViewer.element.id+"_annotation_delete":case this.pdfViewer.element.id+"_annotation_deleteIcon":this.pdfViewer.annotationModule.deleteAnnotation(),this.resetFreeTextAnnot();break;case this.pdfViewer.element.id+"_annotation_commentPanel":case this.pdfViewer.element.id+"_annotation_commentPanelIcon":this.inkAnnotationSelected=!1;var n=document.getElementById(this.pdfViewer.element.id+"_commantPanel");this.pdfViewer.annotation&&this.pdfViewer.annotation.textMarkupAnnotationModule&&this.pdfViewer.annotation.textMarkupAnnotationModule.showHideDropletDiv(!0),"block"===n.style.display?this.pdfViewerBase.navigationPane.closeCommentPanelContainer():(this.pdfViewer.annotationModule.showCommentsPanel(),i&&!je(n.firstElementChild)&&!je(n.firstElementChild.lastElementChild)&&n.firstElementChild.lastElementChild instanceof HTMLButtonElement&&n.firstElementChild.lastElementChild.focus());break;case this.pdfViewer.element.id+"_annotation_close":case this.pdfViewer.element.id+"_annotation_closeIcon":this.inkAnnotationSelected=!1,"block"===document.getElementById(this.pdfViewer.element.id+"_commantPanel").style.display&&this.pdfViewerBase.navigationPane.closeCommentPanelContainer(),this.showAnnotationToolbar(this.primaryToolbar.annotationItem);break;case this.pdfViewer.element.id+"_annotation_freeTextEdit":case this.pdfViewer.element.id+"_annotation_freeTextEditIcon":F.isDevice?(this.pdfViewer.annotationModule.setAnnotationMode("FreeText"),this.FreeTextForMobile()):(this.resetFreeTextAnnot(),this.handleFreeTextEditor());break;case this.pdfViewer.element.id+"_annotation_signature":case this.pdfViewer.element.id+"_annotation_signatureIcon":this.inkAnnotationSelected=!1,this.updateSignatureCount();break;case this.pdfViewer.element.id+"_annotation_ink":case this.pdfViewer.element.id+"_annotation_inkIcon":t&&(this.pdfViewer.annotation.triggerAnnotationUnselectEvent(),this.pdfViewer.annotation.triggerSignatureUnselectEvent()),this.pdfViewer.clearSelection(this.pdfViewer.currentPageNumber-1),this.pdfViewer.annotationModule.inkAnnotationModule&&(F.isDevice||this.updateInteractionTools(),n=this.pdfViewer.annotationModule.inkAnnotationModule.currentPageNumber)&&""!==n&&(this.pdfViewer.annotationModule.inkAnnotationModule.drawInkAnnotation(parseInt(n,10)),this.primaryToolbar.deSelectItem(this.inkAnnotationItem)),this.inkAnnotationSelected?this.inkAnnotationSelected=!1:(this.deselectAllItems(),this.deselectAllItemsForMobile(),this.drawInkAnnotation());break;case this.pdfViewer.element.id+"_annotation_shapesIcon":case this.pdfViewer.element.id+"_annotation_shapes":F.isDevice&&this.shapeToolMobile(e);break;case this.pdfViewer.element.id+"_annotation_calibrateIcon":case this.pdfViewer.element.id+"_annotation_calibrate":F.isDevice&&this.calibrateToolMobile(e);break;case this.pdfViewer.element.id+"_commentIcon":case this.pdfViewer.element.id+"_comment":this.pdfViewerBase.isAddComment=!0,this.pdfViewerBase.isCommentIconAdded=!0;n=document.getElementById(this.pdfViewer.element.id+"_comment");this.deselectAllItemsForMobile(),n.classList.add("e-pv-select"),this.pdfViewer.toolbarModule.addComments(e)}},_Rt.prototype.addInkAnnotation=function(){var e;this.pdfViewer.clearSelection(this.pdfViewer.currentPageNumber-1),this.pdfViewer.annotationModule.inkAnnotationModule&&(e=this.pdfViewer.annotationModule.inkAnnotationModule.currentPageNumber)&&""!==e&&(this.pdfViewer.annotationModule.inkAnnotationModule.drawInkAnnotation(parseInt(e,10)),N?(this.primaryToolbar.deSelectItem(this.InkAnnotationElement),this.pdfViewerBase.focusViewerContainer()):this.primaryToolbar.deSelectItem(this.inkAnnotationItem)),this.inkAnnotationSelected?this.inkAnnotationSelected=!1:(this.deselectAllItemsInBlazor(),this.drawInkAnnotation())},_Rt.prototype.deselectInkAnnotation=function(){N?(this.primaryToolbar.deSelectItem(this.InkAnnotationElement),this.pdfViewerBase.focusViewerContainer()):this.primaryToolbar.deSelectItem(this.inkAnnotationItem)},_Rt.prototype.drawInkAnnotation=function(){this.inkAnnotationSelected=!0,N?this.primaryToolbar.selectItem(this.InkAnnotationElement):this.primaryToolbar.selectItem(this.inkAnnotationItem),this.enableSignaturePropertiesTools(!0),this.pdfViewerBase.isToolbarInkClicked=!0,this.pdfViewer.annotationModule.inkAnnotationModule.drawInk()},_Rt.prototype.resetFreeTextAnnot=function(){var e;this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.freeTextAnnotationModule&&(this.pdfViewer.annotation.freeTextAnnotationModule.isNewFreeTextAnnot=!1,this.pdfViewer.annotation.freeTextAnnotationModule.isNewAddedAnnot=!1,F.isDevice||(this.freeTextEditItem&&!N?this.primaryToolbar.deSelectItem(this.freeTextEditItem):N&&this.primaryToolbar.deSelectItem(this.FreeTextElement),this.enableFreeTextAnnotationPropertiesTools(!1))),this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.inkAnnotationModule&&(e=this.pdfViewer.annotationModule.inkAnnotationModule.currentPageNumber)&&""!==e&&(this.pdfViewer.annotationModule.inkAnnotationModule.drawInkAnnotation(parseInt(e,10)),N?this.primaryToolbar.deSelectItem(this.InkAnnotationElement):this.primaryToolbar.deSelectItem(this.inkAnnotationItem)),this.inkAnnotationSelected=!1},_Rt.prototype.updateInkannotationItems=function(){var e;this.pdfViewer.annotationModule&&this.pdfViewer.annotationModule.inkAnnotationModule&&this.inkAnnotationSelected&&(e=this.pdfViewer.annotationModule.inkAnnotationModule.currentPageNumber)&&""!==e&&(this.pdfViewer.annotationModule.inkAnnotationModule.drawInkAnnotation(parseInt(e,10)),this.pdfViewerBase.isToolbarInkClicked=!0,this.pdfViewer.tool="Ink",this.pdfViewer.clearSelection(e))},_Rt.prototype.showSignaturepanel=function(){this.pdfViewerBase.isToolbarSignClicked=!0,this.pdfViewerBase.signatureModule.showSignatureDialog(!0)},_Rt.prototype.handleFreeTextEditor=function(){var e=this.pdfViewer.selectedItems.annotations[0],e=(this.enableFreeTextAnnotationPropertiesTools(!0),e&&(this.pdfViewer.fireAnnotationUnSelect(e.annotName,e.pageIndex,e),this.pdfViewer.fireSignatureUnselect(e.annotName,e.pageIndex,e)),this.pdfViewer.clearSelection(this.pdfViewer.currentPageNumber-1),this.pdfViewer.annotationModule.textMarkupAnnotationModule&&(this.pdfViewer.annotationModule.textMarkupAnnotationModule.isTextMarkupAnnotationMode=!1),this.isStrikethroughEnabled=!1,this.isHighlightEnabled=!1,this.isUnderlineEnabled=!1,this.pdfViewer.annotation.freeTextAnnotationModule);e.setAnnotationType("FreeText"),e.isNewFreeTextAnnot=!0,e.isNewAddedAnnot=!0,this.updateInteractionTools(),this.primaryToolbar.deSelectItem(this.highlightItem),this.primaryToolbar.deSelectItem(this.underlineItem),this.primaryToolbar.deSelectItem(this.strikethroughItem),this.primaryToolbar.selectItem(this.freeTextEditItem),this.updateColorInIcon(this.colorDropDownElement,this.pdfViewer.annotationModule.freeTextAnnotationModule.fillColor),this.updateColorInIcon(this.strokeDropDownElement,this.pdfViewer.annotationModule.freeTextAnnotationModule.borderColor),this.updateColorInIcon(this.fontColorElement,this.pdfViewer.annotationModule.freeTextAnnotationModule.fontColor),this.updateFontFamilyInIcon(this.pdfViewer.annotationModule.freeTextAnnotationModule.fontFamily),this.updateFontSizeInIcon(this.pdfViewer.annotationModule.freeTextAnnotationModule.fontSize),this.updateTextAlignInIcon(this.pdfViewer.annotationModule.freeTextAnnotationModule.textAlign),this.updateFontFamily()},_Rt.prototype.updateFontFamily=function(){this.pdfViewer.annotationModule.freeTextAnnotationModule.isBold?this.updateFontFamilyIcon("_bold",!0):this.updateFontFamilyIcon("_bold",!1),this.pdfViewer.annotationModule.freeTextAnnotationModule.isItalic?this.updateFontFamilyIcon("_italic",!0):this.updateFontFamilyIcon("_italic",!1),this.pdfViewer.annotationModule.freeTextAnnotationModule.isUnderline?(this.updateFontFamilyIcon("_underline_textinput",!0),this.updateFontFamilyIcon("_strikeout",!1)):this.updateFontFamilyIcon("_underline_textinput",!1),this.pdfViewer.annotationModule.freeTextAnnotationModule.isStrikethrough?(this.updateFontFamilyIcon("_strikeout",!0),this.updateFontFamilyIcon("_underline_textinput",!1)):this.updateFontFamilyIcon("_strikeout",!1)},_Rt.prototype.updateFontFamilyIcon=function(e,t){e=document.getElementById(this.pdfViewer.element.id+e);t?e.classList.add("textprop-option-active"):e.classList.remove("textprop-option-active")},_Rt.prototype.showAnnotationToolbar=function(e,t,i){var n;!F.isDevice||this.pdfViewer.enableDesktopMode?(this.isToolbarHidden?(n=void 0,this.toolbarElement&&(n=this.toolbarElement.style.display,this.toolbarElement.style.display="block"),t||(this.pdfViewer.isAnnotationToolbarVisible=!0),e?this.primaryToolbar.selectItem(e):this.pdfViewer.enableToolbar&&this.primaryToolbar.selectItem(this.primaryToolbar.annotationItem),"none"===n&&this.adjustViewer(!0)):(n=this.pdfViewer.annotationModule,e?this.primaryToolbar.deSelectItem(e):this.pdfViewer.enableToolbar&&this.primaryToolbar.deSelectItem(this.primaryToolbar.annotationItem),this.adjustViewer(!1),n&&n.textMarkupAnnotationModule&&n.textMarkupAnnotationModule.currentTextMarkupAnnotation?this.enablePropertiesTool(n):(this.deselectAllItems(),this.deselectAllItemsForMobile()),this.toolbarElement.style.display="none",t||(this.pdfViewer.isAnnotationToolbarVisible=!1),this.pdfViewerBase.isPanMode?this.primaryToolbar.updateInteractionTools(!1):this.primaryToolbar.updateInteractionTools(!0)),this.pdfViewer.magnification&&"fitToPage"===this.pdfViewer.magnification.fitType&&this.pdfViewer.magnification.fitToPage(),this.enableAnnotationAddTools(!0),this.isToolbarHidden=!this.isToolbarHidden):(e=this.pdfViewer.element.id+"_annotationIcon",((n=document.getElementById(e)).parentElement.classList.contains("e-pv-select")&&!i||!n.parentElement.classList.contains("e-pv-select")&&i)&&(this.createAnnotationToolbarForMobile(e),this.pdfViewer.isAnnotationToolbarVisible=i))},_Rt.prototype.enablePropertiesTool=function(e){this.isHighlightEnabled=!1,this.isUnderlineEnabled=!1,this.isStrikethroughEnabled=!1,this.pdfViewerBase.isTextMarkupAnnotationModule()&&(e.textMarkupAnnotationModule.isTextMarkupAnnotationMode=!1),this.primaryToolbar.deSelectItem(this.highlightItem),this.primaryToolbar.deSelectItem(this.underlineItem),this.primaryToolbar.deSelectItem(this.strikethroughItem),this.enableTextMarkupAnnotationPropertiesTools(!0),this.updateColorInIcon(this.colorDropDownElement,e.textMarkupAnnotationModule.currentTextMarkupAnnotation.color),this.selectAnnotationDeleteItem(!0)},_Rt.prototype.applyAnnotationToolbarSettings=function(){var e=this.pdfViewer.toolbarSettings.annotationToolbarItems;e&&(-1!==e.indexOf("HighlightTool")?this.showHighlightTool(!0,0,0):this.showHighlightTool(!1,0,0),-1!==e.indexOf("UnderlineTool")?this.showUnderlineTool(!0,1,1):this.showUnderlineTool(!1,1,1),-1!==e.indexOf("StrikethroughTool")?this.showStrikethroughTool(!0,2,2):this.showStrikethroughTool(!1,2,2),-1!==e.indexOf("ShapeTool")?this.showShapeAnnotationTool(!0,4,4):this.showShapeAnnotationTool(!1,4,4),-1!==e.indexOf("CalibrateTool")?this.showCalibrateAnnotationTool(!0,6,6):this.showCalibrateAnnotationTool(!1,6,6),-1!==e.indexOf("ColorEditTool")?this.showColorEditTool(!0,22,22):this.showColorEditTool(!1,22,22),-1!==e.indexOf("StrokeColorEditTool")?this.showStrokeColorEditTool(!0,23,23):this.showStrokeColorEditTool(!1,23,23),-1!==e.indexOf("ThicknessEditTool")?this.showThicknessEditTool(!0,24,24):this.showThicknessEditTool(!1,24,24),-1!==e.indexOf("OpacityEditTool")?this.showOpacityEditTool(!0,25,25):this.showOpacityEditTool(!1,25,25),-1!==e.indexOf("AnnotationDeleteTool")?this.showAnnotationDeleteTool(!0,27,27):this.showAnnotationDeleteTool(!1,27,27),-1!==e.indexOf("StampAnnotationTool")?this.showStampAnnotationTool(!0,10,10):this.showStampAnnotationTool(!1,10,10),-1!==e.indexOf("HandWrittenSignatureTool")?this.showSignatureTool(!0,12,12):this.showSignatureTool(!1,12,12),-1!==e.indexOf("FreeTextAnnotationTool")?this.showFreeTextAnnotationTool(!0,8,8):this.showFreeTextAnnotationTool(!1,8,8),-1!==e.indexOf("FontFamilyAnnotationTool")?this.showFontFamilyAnnotationTool(!0,16,16):this.showFontFamilyAnnotationTool(!1,16,16),-1!==e.indexOf("FontSizeAnnotationTool")?this.showFontSizeAnnotationTool(!0,17,17):this.showFontSizeAnnotationTool(!1,17,17),-1!==e.indexOf("FontStylesAnnotationTool")?this.showFontStylesAnnotationTool(!0,20,20):this.showFontStylesAnnotationTool(!1,20,20),-1!==e.indexOf("FontAlignAnnotationTool")?this.showFontAlignAnnotationTool(!0,19,19):this.showFontAlignAnnotationTool(!1,19,19),-1!==e.indexOf("FontColorAnnotationTool")?this.showFontColorAnnotationTool(!0,18,18):this.showFontColorAnnotationTool(!1,18,18),-1!==e.indexOf("CommentPanelTool")?this.showCommentPanelTool(!0,28,28):this.showCommentPanelTool(!1,28,28),this.showInkAnnotationTool(),this.showSeparator())},_Rt.prototype.applyMobileAnnotationToolbarSettings=function(){var e,t=this.pdfViewer.toolbarSettings.annotationToolbarItems;t&&(-1!==t.indexOf("HighlightTool")?this.showHighlightTool(!0,2,2):this.showHighlightTool(!1,2,2),-1!==t.indexOf("UnderlineTool")?this.showUnderlineTool(!0,3,3):this.showUnderlineTool(!1,3,3),-1!==t.indexOf("StrikethroughTool")?this.showStrikethroughTool(!0,4,4):this.showStrikethroughTool(!1,4,4),-1!==t.indexOf("ShapeTool")?this.showShapeAnnotationTool(!0,6,6):this.showShapeAnnotationTool(!1,6,6),-1!==t.indexOf("CalibrateTool")?this.showCalibrateAnnotationTool(!0,8,8):this.showCalibrateAnnotationTool(!1,8,8),(e=this.pdfViewer.toolbarSettings.toolbarItems)&&-1!==e.indexOf("CommentTool")?this.showStickyNoteToolInMobile(!0):this.showStickyNoteToolInMobile(!1),-1!==t.indexOf("StampAnnotationTool")?this.showStampAnnotationTool(!0,12,12):this.showStampAnnotationTool(!1,12,12),-1!==t.indexOf("HandWrittenSignatureTool")?this.showSignatureTool(!0,14,14):this.showSignatureTool(!1,14,14),-1!==t.indexOf("FreeTextAnnotationTool")?this.showFreeTextAnnotationTool(!0,10,10):this.showFreeTextAnnotationTool(!1,10,10),-1!==t.indexOf("CommentPanelTool")?this.showCommentPanelTool(!0,18,18):this.showCommentPanelTool(!1,18,18),-1!==t.indexOf("InkAnnotationTool")?this.showInkTool(!0,16,16):this.showInkTool(!1,16,16),this.showSeparatorInMobile())},_Rt.prototype.showStickyNoteToolInMobile=function(e){this.isCommentBtnVisible=e,this.applyHideToToolbar(e,0,0)},_Rt.prototype.showSeparatorInMobile=function(){this.isCommentBtnVisible||this.applyHideToToolbar(!1,1,1),this.isHighlightBtnVisible||this.isUnderlineBtnVisible||this.isStrikethroughBtnVisible||this.applyHideToToolbar(!1,5,5),this.isShapeBtnVisible||this.applyHideToToolbar(!1,7,7),this.isCalibrateBtnVisible||this.applyHideToToolbar(!1,9,9),this.isFreeTextBtnVisible||this.applyHideToToolbar(!1,11,11),this.isStampBtnVisible||this.applyHideToToolbar(!1,13,13),this.isSignatureBtnVisible||this.applyHideToToolbar(!1,15,15),this.isInkBtnVisible||this.applyHideToToolbar(!1,17,17)},_Rt.prototype.showInkAnnotationTool=function(){-1!==this.pdfViewer.toolbarSettings.annotationToolbarItems.indexOf("InkAnnotationTool")?this.showInkTool(!0,14,14):this.showInkTool(!1,14,14)},_Rt.prototype.showSeparator=function(){this.isHighlightBtnVisible||this.isUnderlineBtnVisible||this.isStrikethroughBtnVisible||this.applyHideToToolbar(!1,3,3),this.isShapeBtnVisible||this.applyHideToToolbar(!1,5,5),this.isCalibrateBtnVisible||this.applyHideToToolbar(!1,7,7),this.isFreeTextBtnVisible||this.applyHideToToolbar(!1,9,9),this.isStampBtnVisible||this.applyHideToToolbar(!1,11,11),this.isSignatureBtnVisible||this.applyHideToToolbar(!1,13,13),this.isInkBtnVisible||this.applyHideToToolbar(!1,15,15),this.isFontFamilyToolVisible||this.isFontSizeToolVisible||this.isFontColorToolVisible||this.isFontAlignToolVisible||this.isFontStylesToolVisible||this.applyHideToToolbar(!1,21,21),(this.isColorToolVisible||this.isStrokeColorToolVisible||this.isThicknessToolVisible||this.isOpacityToolVisible)&&this.isDeleteAnnotationToolVisible||this.applyHideToToolbar(!1,26,26)},_Rt.prototype.showHighlightTool=function(e,t,i){this.isHighlightBtnVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showUnderlineTool=function(e,t,i){this.isUnderlineBtnVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showStrikethroughTool=function(e,t,i){this.isStrikethroughBtnVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showShapeAnnotationTool=function(e,t,i){this.isShapeBtnVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showCalibrateAnnotationTool=function(e,t,i){this.isCalibrateBtnVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showFreeTextAnnotationTool=function(e,t,i){this.isFreeTextBtnVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showStampAnnotationTool=function(e,t,i){this.isStampBtnVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showSignatureTool=function(e,t,i){this.isSignatureBtnVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showInkTool=function(e,t,i){this.isInkBtnVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showFontFamilyAnnotationTool=function(e,t,i){this.isFontFamilyToolVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showFontSizeAnnotationTool=function(e,t,i){this.isFontSizeToolVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showFontAlignAnnotationTool=function(e,t,i){this.isFontAlignToolVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showFontColorAnnotationTool=function(e,t,i){this.isFontColorToolVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showFontStylesAnnotationTool=function(e,t,i){this.isFontStylesToolVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showColorEditTool=function(e,t,i){this.isColorToolVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showStrokeColorEditTool=function(e,t,i){this.isStrokeColorToolVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showThicknessEditTool=function(e,t,i){this.isThicknessToolVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showOpacityEditTool=function(e,t,i){this.isOpacityToolVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showAnnotationDeleteTool=function(e,t,i){this.isDeleteAnnotationToolVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.showCommentPanelTool=function(e,t,i){this.isCommentPanelBtnVisible=e,this.applyHideToToolbar(e,t,i)},_Rt.prototype.applyHideToToolbar=function(e,t,i){for(var n=!e,o=t;o<=i;o++){var r=void 0,s=this.propertyToolbar&&this.propertyToolbar.element?this.propertyToolbar.element:null,a=this.toolbar&&this.toolbar.element?this.toolbar.element:null;a&&a.children&&0<a.children.length?r=this.toolbar:F.isDevice&&s&&s.children&&0<s.children.length&&(r=this.propertyToolbar),r&&r.items[parseInt(o.toString(),10)]&&((a=r.items[parseInt(o.toString(),10)].cssClass)&&""!==a?(s=r.element.querySelector("."+a))&&this.toolbar.hideItem(s,n):r.hideItem(o,n))}},_Rt.prototype.adjustViewer=function(e){i=N?(t=this.pdfViewer.element.querySelector(".e-pv-sidebar-toolbar-splitter"),n=this.pdfViewer.element.querySelector(".e-pv-toolbar"),i=this.pdfViewer.element.querySelector(".e-pv-annotation-toolbar"),this.getToolbarHeight(i)):(t=this.pdfViewerBase.getElement("_sideBarToolbarSplitter"),n=this.pdfViewerBase.getElement("_toolbarContainer"),this.getToolbarHeight(this.toolbarElement));var t,i,n=this.getToolbarHeight(n),o=this.pdfViewerBase.navigationPane.sideBarToolbar,r=this.pdfViewerBase.navigationPane.sideBarContentContainer,s=this.pdfViewerBase.navigationPane.commentPanelContainer,a=this.pdfViewerBase.navigationPane.commentPanelResizer,l="";e?(this.pdfViewer.enableToolbar?(je(o)||(o.style.top=n+i+"px"),je(r)||(r.style.top=n+i+"px"),je(t)||(t.style.top=n+i+"px"),je(s)||(s.style.top=n+i+"px"),je(a)||(a.style.top=n+i+"px")):(o.style.top=i+"px",r.style.top=i+"px",t.style.top=i+"px",s.style.top=i+"px",a.style.top=n+i+"px"),this.pdfViewer.enableToolbar||(n=0),this.pdfViewerBase.viewerContainer.style.height=this.updateViewerHeight(this.getElementHeight(this.pdfViewerBase.viewerContainer),i+n)+"px",l=this.getNavigationToolbarHeight(i+n),je(o)||(o.style.height=l),je(t)||(t.style.height=l),je(a)||(a.style.height=l),je(r)||(r.style.height=l)):(this.pdfViewer.enableToolbar?(o.style.top=n+"px",r.style.top=n+"px",t.style.top=n+"px",s.style.top=n+"px",a.style.top=n+"px"):(o.style.top="1px",o.style.height="100%",r.style.top="1px",r.style.height="100%",t.style.top="1px",t.style.height="100%",s.style.top="1px",s.style.height="100%",a.style.top="1px",a.style.height="100%"),this.pdfViewer.enableToolbar||(n=0),this.pdfViewerBase.viewerContainer.style.height=this.updateViewerHeight(this.getElementHeight(this.pdfViewerBase.viewerContainer),i)+"px",l=this.getNavigationToolbarHeight(n),je(o)||(o.style.height=l),je(t)||(t.style.height=l),je(a)||(a.style.height=l),je(r)||(r.style.height=l),"0px"===this.pdfViewerBase.viewerContainer.style.height&&(this.pdfViewerBase.viewerContainer.style.height=parseInt(this.pdfViewer.element.style.height,10)-parseInt(o.style.top,10)+"px"))},_Rt.prototype.updateContentContainerHeight=function(e,t){t=t?(t=this.pdfViewer.element.querySelector(".e-pv-annotation-toolbar"),this.getToolbarHeight(t)):this.getToolbarHeight(this.toolbarElement);var i=this.pdfViewerBase.navigationPane.sideBarContentContainer.getBoundingClientRect();0!==i.height&&(this.pdfViewerBase.navigationPane.sideBarContentContainer.style.height=e?i.height-t+"px":i.height+t+"px")},_Rt.prototype.getToolbarHeight=function(e){var t;return je(e)?null:0===(t=e.getBoundingClientRect().height)&&e===this.pdfViewerBase.getElement("_toolbarContainer")?parseFloat(window.getComputedStyle(e).height)+this.toolbarBorderHeight:t},_Rt.prototype.getNavigationToolbarHeight=function(e){var t=this.pdfViewer.element.getBoundingClientRect().height;return 0!==t?t-e+"px":""},_Rt.prototype.handleHighlight=function(){this.isHighlightEnabled?this.deselectAllItems():(this.updateInteractionTools(),this.clearShapeMode(),this.clearMeasureMode(),this.pdfViewer.annotationModule.textMarkupAnnotationModule.drawTextMarkupAnnotations("Highlight"),this.primaryToolbar.selectItem(this.highlightItem),this.primaryToolbar.deSelectItem(this.underlineItem),this.primaryToolbar.deSelectItem(this.strikethroughItem),this.primaryToolbar.deSelectItem(this.freeTextEditItem),this.primaryToolbar.deSelectItem(this.inkAnnotationItem),this.enableTextMarkupAnnotationPropertiesTools(!0),this.pdfViewer.annotationModule.textMarkupAnnotationModule.highlightColor=null,this.setCurrentColorInPicker(),this.updateColorInIcon(this.colorDropDownElement,this.pdfViewer.annotationModule.textMarkupAnnotationModule.highlightColor),this.isHighlightEnabled=!0,this.isUnderlineEnabled=!1,this.isStrikethroughEnabled=!1)},_Rt.prototype.handleUnderline=function(){this.isUnderlineEnabled?this.deselectAllItems():(this.updateInteractionTools(),this.clearShapeMode(),this.clearMeasureMode(),this.pdfViewer.annotationModule.textMarkupAnnotationModule.drawTextMarkupAnnotations("Underline"),this.primaryToolbar.selectItem(this.underlineItem),this.primaryToolbar.deSelectItem(this.highlightItem),this.primaryToolbar.deSelectItem(this.strikethroughItem),this.primaryToolbar.deSelectItem(this.freeTextEditItem),this.primaryToolbar.deSelectItem(this.inkAnnotationItem),this.enableTextMarkupAnnotationPropertiesTools(!0),this.pdfViewer.annotationModule.textMarkupAnnotationModule.underlineColor=null,this.setCurrentColorInPicker(),this.updateColorInIcon(this.colorDropDownElement,this.pdfViewer.annotationModule.textMarkupAnnotationModule.underlineColor),this.isUnderlineEnabled=!0,this.isHighlightEnabled=!1,this.isStrikethroughEnabled=!1)},_Rt.prototype.handleStrikethrough=function(){this.isStrikethroughEnabled?this.deselectAllItems():(this.updateInteractionTools(),this.clearShapeMode(),this.clearMeasureMode(),this.pdfViewer.annotationModule.textMarkupAnnotationModule.drawTextMarkupAnnotations("Strikethrough"),this.primaryToolbar.selectItem(this.strikethroughItem),this.primaryToolbar.deSelectItem(this.highlightItem),this.primaryToolbar.deSelectItem(this.underlineItem),this.primaryToolbar.deSelectItem(this.freeTextEditItem),this.primaryToolbar.deSelectItem(this.inkAnnotationItem),this.enableTextMarkupAnnotationPropertiesTools(!0),this.pdfViewer.annotationModule.textMarkupAnnotationModule.strikethroughColor=null,this.setCurrentColorInPicker(),this.updateColorInIcon(this.colorDropDownElement,this.pdfViewer.annotationModule.textMarkupAnnotationModule.strikethroughColor),this.isStrikethroughEnabled=!0,this.isHighlightEnabled=!1,this.isUnderlineEnabled=!1)},_Rt.prototype.deselectAllItemsInBlazor=function(){this.pdfViewerBase.isTextMarkupAnnotationModule()&&(this.pdfViewer.annotationModule.textMarkupAnnotationModule.isTextMarkupAnnotationMode=!1,this.pdfViewer.annotationModule.textMarkupAnnotationModule.showHideDropletDiv(!0)),F.isDevice&&!this.pdfViewer.enableDesktopMode||(this.primaryToolbar.deSelectItem(this.HighlightElement),this.primaryToolbar.deSelectItem(this.UnderlineElement),this.primaryToolbar.deSelectItem(this.StrikethroughElement),this.primaryToolbar.deSelectItem(this.FreeTextElement),this.primaryToolbar.deSelectItem(this.InkAnnotationElement),this.pdfViewer._dotnetInstance.invokeMethodAsync("UpdateTextMarkupButtons",!1,!1,!1)),this.resetFreeTextAnnot(),this.clearTextMarkupMode(),this.clearShapeMode(),this.clearMeasureMode(),this.pdfViewer.tool="",F.isDevice&&!this.pdfViewer.enableDesktopMode||(this.enableTextMarkupAnnotationPropertiesTools(!1),this.enableFreeTextAnnotationPropertiesTools(!1),this.updateColorInIcon(this.colorDropDownElement,"#000000"),this.updateColorInIcon(this.strokeDropDownElement,"#000000"),this.updateColorInIcon(this.fontColorElement,"#000000"),this.selectAnnotationDeleteItem(!1)),this.pdfViewer.annotationModule&&(this.pdfViewer.annotationModule.freeTextAnnotationModule.isNewFreeTextAnnot=!1)},_Rt.prototype.deselectAllItemsForMobile=function(){!F.isDevice&&this.pdfViewer.enableDesktopMode||(this.isMobileHighlightEnabled=!1,this.isMobileUnderlineEnabled=!1,this.isMobileStrikethroughEnabled=!1,this.pdfViewerBase.isTextMarkupAnnotationModule()&&(this.pdfViewer.annotationModule.textMarkupAnnotationModule.isTextMarkupAnnotationMode=!1,this.pdfViewer.annotationModule.textMarkupAnnotationModule.showHideDropletDiv(!0)),this.primaryToolbar.deSelectItem(this.highlightItem),this.primaryToolbar.deSelectItem(this.underlineItem),this.primaryToolbar.deSelectItem(this.strikethroughItem),this.primaryToolbar.deSelectItem(this.freeTextEditItem),this.primaryToolbar.deSelectItem(this.inkAnnotationItem),this.resetFreeTextAnnot(),this.clearTextMarkupMode(),this.clearShapeMode(),this.clearMeasureMode(),this.pdfViewer.tool="",this.selectAnnotationDeleteItem(!1),this.pdfViewer.annotationModule&&(this.pdfViewer.annotationModule.freeTextAnnotationModule.isNewFreeTextAnnot=!1))},_Rt.prototype.deselectAllItems=function(){var e=N;this.isHighlightEnabled=!1,this.isUnderlineEnabled=!1,this.isStrikethroughEnabled=!1,this.pdfViewerBase.isTextMarkupAnnotationModule()&&(this.pdfViewer.annotationModule.textMarkupAnnotationModule.isTextMarkupAnnotationMode=!1,this.pdfViewer.annotationModule.textMarkupAnnotationModule.showHideDropletDiv(!0)),F.isDevice&&!this.pdfViewer.enableDesktopMode||(e?(this.primaryToolbar.deSelectItem(this.pdfViewer.toolbar.SelectToolElement),this.primaryToolbar.selectItem(this.pdfViewer.toolbar.PanElement),this.primaryToolbar.deSelectItem(this.HighlightElement),this.primaryToolbar.deSelectItem(this.UnderlineElement),this.primaryToolbar.deSelectItem(this.StrikethroughElement),this.primaryToolbar.deSelectItem(this.FreeTextElement),this.primaryToolbar.deSelectItem(this.InkAnnotationElement)):(this.primaryToolbar.deSelectItem(this.highlightItem),this.primaryToolbar.deSelectItem(this.underlineItem),this.primaryToolbar.deSelectItem(this.strikethroughItem),this.primaryToolbar.deSelectItem(this.freeTextEditItem),this.primaryToolbar.deSelectItem(this.inkAnnotationItem))),this.resetFreeTextAnnot(),this.clearTextMarkupMode(),this.clearShapeMode(),this.clearMeasureMode(),this.pdfViewer.tool="",F.isDevice&&!this.pdfViewer.enableDesktopMode||(this.enableTextMarkupAnnotationPropertiesTools(!1),this.enableFreeTextAnnotationPropertiesTools(!1),this.updateColorInIcon(this.colorDropDownElement,"#000000"),this.updateColorInIcon(this.strokeDropDownElement,"#000000"),this.updateColorInIcon(this.fontColorElement,"#000000"),this.selectAnnotationDeleteItem(!1)),this.pdfViewer.annotationModule&&(this.pdfViewer.annotationModule.freeTextAnnotationModule.isNewFreeTextAnnot=!1)},_Rt.prototype.updateInteractionTools=function(){this.pdfViewer.enableTextSelection?(this.pdfViewerBase.initiateTextSelectMode(),F.isDevice||this.pdfViewer.toolbar.updateInteractionTools(!0)):F.isDevice||this.pdfViewer.toolbar.updateInteractionTools(!1)},_Rt.prototype.selectAnnotationDeleteItem=function(e,t){var i;N||F.isDevice?F.isDevice&&!this.pdfViewer.enableDesktopMode||(e?(i=this.pdfViewer.annotationModule.findCurrentAnnotation())&&(i.annotationSettings&&i.annotationSettings.isLock?this.pdfViewer.annotationModule.checkAllowedInteractions("Delete",i)?this.pdfViewerBase.blazorUIAdaptor.EnableDeleteOption(e):this.pdfViewerBase.blazorUIAdaptor.EnableDeleteOption(!1):this.pdfViewerBase.blazorUIAdaptor&&this.pdfViewerBase.blazorUIAdaptor.EnableDeleteOption(e)):this.pdfViewerBase.blazorUIAdaptor&&this.pdfViewerBase.blazorUIAdaptor.EnableDeleteOption(e),t&&this.pdfViewerBase.focusViewerContainer()):this.toolbar&&(e?(i=this.pdfViewer.annotationModule.findCurrentAnnotation())&&(!i.annotationSettings||!i.annotationSettings.isLock||this.pdfViewer.annotationModule.checkAllowedInteractions("Delete",i)?this.enableItems(this.deleteItem.parentElement,e):this.enableItems(this.deleteItem.parentElement,!1)):this.enableItems(this.deleteItem.parentElement,e))},_Rt.prototype.enableTextMarkupAnnotationPropertiesTools=function(e){F.isDevice||(N?this.pdfViewerBase.blazorUIAdaptor.enableTextMarkupAnnotationPropertiesTools(e):(this.enableItems(this.colorDropDownElement.parentElement,e),this.enableItems(this.opacityDropDownElement.parentElement,e),F.isDevice&&!this.pdfViewer.enableDesktopMode||(this.enableItems(this.strokeDropDownElement.parentElement,!1),this.enableItems(this.thicknessElement.parentElement,!1),this.enableItems(this.fontFamilyElement.parentElement,!1),this.enableItems(this.fontSizeElement.parentElement,!1),this.enableItems(this.fontColorElement.parentElement,!1),this.enableItems(this.textAlignElement.parentElement,!1),this.enableItems(this.textPropElement.parentElement,!1))))},_Rt.prototype.checkAnnotationPropertiesChange=function(){var e=this.pdfViewer.selectedItems.annotations[0];if(e&&e.annotationSettings&&e.annotationSettings.isLock)return!!this.pdfViewer.annotationModule.checkAllowedInteractions("PropertyChange",e);return!0},_Rt.prototype.enableAnnotationPropertiesTools=function(e){var t;F.isDevice||(t=this.checkAnnotationPropertiesChange(),e||(t=!0),N?this.pdfViewerBase.blazorUIAdaptor.enableAnnotationPropertiesTool(e,t):t&&(this.pdfViewer.selectedItems.annotations[0]&&"Line"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType?this.enableItems(this.colorDropDownElement.parentElement,!1):this.enableItems(this.colorDropDownElement.parentElement,e),this.enableItems(this.opacityDropDownElement.parentElement,e),this.enableItems(this.strokeDropDownElement.parentElement,e),this.enableItems(this.thicknessElement.parentElement,e),this.pdfViewer.enableShapeLabel&&(this.enableItems(this.fontFamilyElement.parentElement,e),this.enableItems(this.fontSizeElement.parentElement,e),this.enableItems(this.fontColorElement.parentElement,e)),this.enableItems(this.textAlignElement.parentElement,!1),this.enableItems(this.textPropElement.parentElement,!1)))},_Rt.prototype.enableSignaturePropertiesTools=function(e){var t;F.isDevice||(t=this.checkAnnotationPropertiesChange(),e||(t=!0),N?this.pdfViewerBase.blazorUIAdaptor.enableSignaturePropertiesTools(e,t):t&&(this.enableItems(this.colorDropDownElement.parentElement,!1),this.enableItems(this.opacityDropDownElement.parentElement,e),this.enableItems(this.strokeDropDownElement.parentElement,e),this.enableItems(this.thicknessElement.parentElement,e),this.enableItems(this.textAlignElement.parentElement,!1),this.enableItems(this.textPropElement.parentElement,!1),this.enableItems(this.fontFamilyElement.parentElement,!1),this.enableItems(this.fontSizeElement.parentElement,!1),this.enableItems(this.fontColorElement.parentElement,!1),this.enableItems(this.textAlignElement.parentElement,!1)))},_Rt.prototype.enableStampAnnotationPropertiesTools=function(e){var t=this.checkAnnotationPropertiesChange();e||(t=!0),N?this.pdfViewerBase.blazorUIAdaptor.enableStampAnnotationPropertiesTools(e,t):t&&(this.enableItems(this.opacityDropDownElement.parentElement,e),this.enableItems(this.colorDropDownElement.parentElement,!1),this.enableItems(this.strokeDropDownElement.parentElement,!1),this.enableItems(this.thicknessElement.parentElement,!1),this.enableItems(this.fontFamilyElement.parentElement,!1),this.enableItems(this.fontSizeElement.parentElement,!1),this.enableItems(this.fontColorElement.parentElement,!1),this.enableItems(this.textAlignElement.parentElement,!1),this.enableItems(this.textPropElement.parentElement,!1))},_Rt.prototype.enableFreeTextAnnotationPropertiesTools=function(e){var t=this.checkAnnotationPropertiesChange();e||(t=!0),N?this.pdfViewerBase.blazorUIAdaptor.enableFreeTextAnnotationPropertiesTools(e,t):t&&(this.enableItems(this.opacityDropDownElement.parentElement,e),this.enableItems(this.colorDropDownElement.parentElement,e),this.enableItems(this.strokeDropDownElement.parentElement,e),this.enableItems(this.thicknessElement.parentElement,e),this.enableItems(this.fontFamilyElement.parentElement,e),this.enableItems(this.fontSizeElement.parentElement,e),this.enableItems(this.fontColorElement.parentElement,e),this.enableItems(this.textAlignElement.parentElement,e),this.enableItems(this.textPropElement.parentElement,e))},_Rt.prototype.enableAnnotationAddTools=function(e){this.toolbar&&!F.isDevice&&(this.pdfViewer.enableTextMarkupAnnotation&&(this.enableItems(this.highlightItem.parentElement,e),this.enableItems(this.underlineItem.parentElement,e),this.enableItems(this.strikethroughItem.parentElement,e)),this.pdfViewer.enableShapeAnnotation&&this.enableItems(this.shapeElement.parentElement,e),this.pdfViewer.enableStampAnnotations&&this.toolbar.enableItems(this.stampElement.parentElement,e),this.pdfViewer.enableMeasureAnnotation&&this.pdfViewerBase.isCalibrateAnnotationModule()&&this.enableItems(this.calibrateElement.parentElement,e),this.pdfViewer.enableFreeText&&this.enableItems(this.freeTextEditItem.parentElement,e),this.pdfViewer.enableHandwrittenSignature&&this.enableItems(this.handWrittenSignatureItem.parentElement,e),this.pdfViewer.enableInkAnnotation&&this.enableItems(this.inkAnnotationItem.parentElement,e),this.pdfViewer.enableCommentPanel)&&this.enableCommentPanelTool(e)},_Rt.prototype.isAnnotationButtonsEnabled=function(){var e=!1;return e=this.isHighlightEnabled||this.isUnderlineEnabled||this.isStrikethroughEnabled?!0:e},_Rt.prototype.enableCommentPanelTool=function(e){this.toolbar&&this.enableItems(this.commentItem.parentElement,e)},_Rt.prototype.updateToolbarItems=function(){this.pdfViewer.enableTextMarkupAnnotation?this.enableTextMarkupAddTools(!0):this.enableTextMarkupAddTools(!1),this.enableItems(this.shapeElement.parentElement,this.pdfViewer.enableShapeAnnotation),this.toolbar.enableItems(this.stampElement.parentElement,this.pdfViewer.enableStampAnnotations),this.enableItems(this.calibrateElement.parentElement,this.pdfViewer.enableMeasureAnnotation),this.enableItems(this.freeTextEditItem.parentElement,this.pdfViewer.enableFreeText),this.enableItems(this.handWrittenSignatureItem.parentElement,this.pdfViewer.enableHandwrittenSignature),this.enableItems(this.inkAnnotationItem.parentElement,this.pdfViewer.enableInkAnnotation),this.closeItem.setAttribute("tabindex","0")},_Rt.prototype.enableTextMarkupAddTools=function(e){this.enableItems(this.highlightItem.parentElement,e),this.enableItems(this.underlineItem.parentElement,e),this.enableItems(this.strikethroughItem.parentElement,e)},_Rt.prototype.updateAnnnotationPropertyItems=function(){N?(this.colorDropDownElementInBlazor=this.pdfViewer.element.querySelector(".e-pv-annotation-color-container"),this.strokeDropDownElementInBlazor=this.pdfViewer.element.querySelector(".e-pv-annotation-stroke-container"),this.fontColorElementInBlazor=this.pdfViewer.element.querySelector(".e-pv-annotation-textcolor-container"),1===this.pdfViewer.selectedItems.annotations.length?(this.pdfViewer.toolbar.annotationToolbarModule.updateColorInIcon(this.colorDropDownElementInBlazor,this.getColorHexValue(this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.fill,"fillColor")),this.pdfViewer.toolbar.annotationToolbarModule.updateColorInIcon(this.strokeDropDownElementInBlazor,this.getColorHexValue(this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeColor,"strokeColor")),"FreeText"===this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType&&(this.pdfViewer.toolbar.annotationToolbarModule.updateColorInIcon(this.fontColorElementInBlazor,this.getColorHexValue(this.pdfViewer.selectedItems.annotations[0].fontColor,"fontColor")),this.pdfViewerBase.blazorUIAdaptor.updateFontFamilyInIcon(this.pdfViewer.selectedItems.annotations[0].fontFamily),this.pdfViewerBase.blazorUIAdaptor.updateFontSizeInIcon(this.pdfViewer.selectedItems.annotations[0].fontSize))):(this.pdfViewer.toolbar.annotationToolbarModule.updateColorInIcon(this.colorDropDownElementInBlazor,"#000000"),this.pdfViewer.toolbar.annotationToolbarModule.updateColorInIcon(this.strokeDropDownElementInBlazor,"#000000"),this.pdfViewer.toolbar.annotationToolbarModule.updateColorInIcon(this.fontColorElementInBlazor,"#000000"))):1===this.pdfViewer.selectedItems.annotations.length?(this.pdfViewer.toolbar.annotationToolbarModule.updateColorInIcon(this.colorDropDownElement,this.getColorHexValue(this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.fill,"fillColor")),this.pdfViewer.toolbar.annotationToolbarModule.updateColorInIcon(this.strokeDropDownElement,this.getColorHexValue(this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeColor,"strokeColor")),"FreeText"!==this.pdfViewer.selectedItems.annotations[0].shapeAnnotationType||this.pdfViewer.selectedItems.annotations[0].isLock||(this.pdfViewer.toolbar.annotationToolbarModule.updateColorInIcon(this.fontColorElement,this.getColorHexValue(this.pdfViewer.selectedItems.annotations[0].fontColor,"fontColor")),this.pdfViewer.toolbar.annotationToolbarModule.updateFontFamilyInIcon(this.pdfViewer.selectedItems.annotations[0].fontFamily),this.pdfViewer.toolbar.annotationToolbarModule.updateFontSizeInIcon(this.pdfViewer.selectedItems.annotations[0].fontSize),this.pdfViewer.toolbar.annotationToolbarModule.updateTextAlignInIcon(this.pdfViewer.selectedItems.annotations[0].textAlign))):(this.pdfViewer.toolbar.annotationToolbarModule.updateColorInIcon(this.colorDropDownElement,"#000000"),this.pdfViewer.toolbar.annotationToolbarModule.updateColorInIcon(this.strokeDropDownElement,"#000000"),this.pdfViewer.toolbar.annotationToolbarModule.updateColorInIcon(this.fontColorElement,"#000000"))},_Rt.prototype.getColorHexValue=function(e,t){return"transparent"!==(e="red"===(e="#ffffff00"===e?"#ffffff":e).toLowerCase()?"#FF0000":e)?N?e:this.colorPalette.getValue(e,"hex"):"fontColor"===t||"strokeColor"===t?"#000000":"#ffffff"},_Rt.prototype.setColorInPicker=function(e,t){e&&e.setProperties({value:t},!0)},_Rt.prototype.resetToolbar=function(){this.updateToolbarItems(),(this.pdfViewer.isAnnotationToolbarOpen||this.pdfViewer.isAnnotationToolbarVisible)&&this.pdfViewer.enableAnnotationToolbar?(this.adjustViewer(!1),this.toolbarElement.style.display="",this.isToolbarHidden=!1,this.adjustViewer(!0),this.primaryToolbar.selectItem(this.primaryToolbar.annotationItem),this.pdfViewer.toolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule&&this.pdfViewer.toolbarModule.annotationToolbarModule.toolbar.refreshOverflow(),this.pdfViewer.isAnnotationToolbarVisible=!0):(this.toolbarElement.style.display="none",this.isToolbarHidden=!0,this.pdfViewer.isAnnotationToolbarVisible=!1)},_Rt.prototype.clearTextMarkupMode=function(){this.pdfViewerBase.isTextMarkupAnnotationModule()&&(N&&(this.pdfViewer.annotationModule.textMarkupAnnotationModule.isTextMarkupAnnotationMode=!1),this.pdfViewer.annotation.textMarkupAnnotationModule.currentTextMarkupAddMode="")},_Rt.prototype.clearShapeMode=function(){this.pdfViewerBase.isShapeAnnotationModule()&&(this.pdfViewer.annotation.shapeAnnotationModule.currentAnnotationMode="")},_Rt.prototype.clearMeasureMode=function(){this.pdfViewerBase.isCalibrateAnnotationModule()&&(this.pdfViewer.annotation.measureAnnotationModule.currentAnnotationMode="")},_Rt.prototype.clear=function(){this.deselectAllItems(),this.deselectAllItemsForMobile()},_Rt.prototype.destroy=function(){this.destroyComponent(),this.shapeDropDown&&this.shapeDropDown.destroy(),this.calibrateDropDown&&this.calibrateDropDown.destroy(),this.fontColorDropDown&&this.fontColorDropDown.destroy(),this.textAlignDropDown&&this.textAlignDropDown.destroy(),this.colorDropDown&&this.colorDropDown.destroy(),this.strokeDropDown&&this.strokeDropDown.destroy(),this.thicknessDropDown&&this.thicknessDropDown.destroy(),this.opacityDropDown&&this.opacityDropDown.destroy(),this.textPropertiesDropDown&&this.textPropertiesDropDown.destroy(),this.toolbar&&this.toolbar.destroy();var e=document.getElementById(this.pdfViewer.element.id+"_stampElement");e&&e.parentElement.removeChild(e)},_Rt.prototype.destroyComponent=function(){for(var e=[this.highlightItem,this.underlineItem,this.strikethroughItem,this.lineElement,this.arrowElement,this.rectangleElement,this.circleElement,this.polygonElement,this.calibrateDistance,this.calibrateArea,this.calibrateRadius,this.calibrateVolume,this.calibratePerimeter,this.freeTextEditItem,this.stampElement,this.handWrittenSignatureItem,this.inkAnnotationItem,this.fontFamilyElement,this.fontSizeElement,this.alignLeftElement,this.alignRightElement,this.alignCenterElement,this.alignJustifyElement,this.boldElement,this.italicElement,this.fontStyleStrikethroughItem,this.fontStyleUnderlineItem,this.deleteItem,this.commentItem,this.shapeDropDown?this.shapeDropDown.activeElem[0]:null,this.calibrateDropDown?this.calibrateDropDown.activeElem[0]:null,this.fontColorDropDown?this.fontColorDropDown.activeElem[0]:null,this.textAlignDropDown?this.textAlignDropDown.activeElem[0]:null,this.colorDropDown?this.colorDropDown.activeElem[0]:null,this.strokeDropDown?this.strokeDropDown.activeElem[0]:null,this.thicknessDropDown?this.thicknessDropDown.activeElem[0]:null,this.opacityDropDown?this.opacityDropDown.activeElem[0]:null,this.textPropertiesDropDown?this.textPropertiesDropDown.activeElem[0]:null],t=0;t<e.length;t++)e[parseInt(t.toString(),10)]&&this.destroyDependentComponent(e[parseInt(t.toString(),10)])},_Rt.prototype.destroyDependentComponent=function(e){if(e.ej2_instances)for(var t=e.ej2_instances.length-1;0<=t;t--)e.ej2_instances[parseInt(t.toString(),10)].destroy()},_Rt.prototype.getElementHeight=function(e){try{return e.getBoundingClientRect().height}catch(e){return 0}},_Rt.prototype.updateViewerHeight=function(e,t){return this.getElementHeight(this.pdfViewer.element)-t},_Rt.prototype.resetViewerHeight=function(e,t){return e+t},_Rt.prototype.afterAnnotationToolbarCreationInBlazor=function(){this.HighlightElement=document.getElementById(this.pdfViewer.element.id+"_highLight").children[0],this.UnderlineElement=document.getElementById(this.pdfViewer.element.id+"_underline").children[0],this.StrikethroughElement=document.getElementById(this.pdfViewer.element.id+"_strikethrough").children[0],this.InkAnnotationElement=document.getElementById(this.pdfViewer.element.id+"_annotation_ink").children[0],this.InkAnnotationElement.classList.add("e-pv-tbar-btn"),this.FreeTextElement=document.getElementById(this.pdfViewer.element.id+"_annotation_freeTextEdit").children[0],this.HighlightElement=this.addClassToToolbarInBlazor(this.HighlightElement,"e-pv-highlight","_highLight"),this.UnderlineElement=this.addClassToToolbarInBlazor(this.UnderlineElement,"e-pv-underline","_underline"),this.StrikethroughElement=this.addClassToToolbarInBlazor(this.StrikethroughElement,"e-pv-strikethrough","_strikethrough")},_Rt.prototype.addClassToToolbarInBlazor=function(e,t,i){return e.classList.add(t),e.classList.add("e-pv-tbar-btn"),0<e.childNodes.length&&(t=e.childNodes[0])&&t.classList&&(t.id=this.pdfViewer.element.id+i+"Icon",t.classList.remove("e-icons"),t.classList.remove("e-btn-icon"),this.pdfViewer.enableRtl)&&t.classList.add("e-right"),e},_Rt.prototype.handleHighlightInBlazor=function(){this.HighlightElement.classList.contains("e-pv-select")?this.primaryToolbar.deSelectItem(this.HighlightElement):this.HighlightElement.classList.contains("e-pv-select")||this.primaryToolbar.selectItem(this.HighlightElement),this.StrikethroughElement.classList.contains("e-pv-select")&&this.primaryToolbar.deSelectItem(this.StrikethroughElement),this.UnderlineElement.classList.contains("e-pv-select")&&this.primaryToolbar.deSelectItem(this.UnderlineElement)},_Rt.prototype.handleUnderlineInBlazor=function(){this.UnderlineElement.classList.contains("e-pv-select")?this.primaryToolbar.deSelectItem(this.UnderlineElement):this.UnderlineElement.classList.contains("e-pv-select")||this.primaryToolbar.selectItem(this.UnderlineElement),this.StrikethroughElement.classList.contains("e-pv-select")&&this.primaryToolbar.deSelectItem(this.StrikethroughElement),this.HighlightElement.classList.contains("e-pv-select")&&this.primaryToolbar.deSelectItem(this.HighlightElement)},_Rt.prototype.handleStrikethroughInBlazor=function(){this.StrikethroughElement.classList.contains("e-pv-select")?this.primaryToolbar.deSelectItem(this.StrikethroughElement):this.StrikethroughElement.classList.contains("e-pv-select")||this.primaryToolbar.selectItem(this.StrikethroughElement),this.HighlightElement.classList.contains("e-pv-select")&&this.primaryToolbar.deSelectItem(this.HighlightElement),this.UnderlineElement.classList.contains("e-pv-select")&&this.primaryToolbar.deSelectItem(this.UnderlineElement)},_Rt.prototype.AnnotationSliderOpened=function(){var e,t;this.pdfViewer.selectedItems.annotations&&0<this.pdfViewer.selectedItems.annotations.length&&this.pdfViewer.selectedItems.annotations[0]&&this.pdfViewer.selectedItems.annotations[0].wrapper&&this.pdfViewer.selectedItems.annotations[0].wrapper.children[0]&&(e=100*this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.opacity,t=this.pdfViewer.selectedItems.annotations[0].wrapper.children[0].style.strokeWidth,this.pdfViewer._dotnetInstance.invokeMethodAsync("UpdateAnnotationSlider",e,t))},_Rt.prototype.DropDownOpened=function(e){var t,i;e&&e[0].element&&(t=e[0].element.getBoundingClientRect(),i=(i=this.pdfViewerBase.navigationPane.sideBarToolbar)?i.getBoundingClientRect().width:0,t.left>this.pdfViewerBase.viewerContainer.clientWidth+t.width+i)&&(e[0].element.style.left=t.left-this.pdfViewerBase.viewerContainer.clientHeight/2+"px")},_Rt.prototype.enableItems=function(e,t){this.toolbar.enableItems(e,t),e.firstElementChild&&(e.firstElementChild.setAttribute("tabindex",t?"0":"-1"),e.firstElementChild.setAttribute("data-tabindex",t?"0":"-1"))};var VRt=_Rt;function _Rt(e,t,i){var o=this;this.toolbarBorderHeight=1,this.isToolbarHidden=!1,this.isMobileAnnotEnabled=!1,this.isHighlightEnabled=!1,this.isMobileHighlightEnabled=!1,this.isUnderlineEnabled=!1,this.isMobileUnderlineEnabled=!1,this.isStrikethroughEnabled=!1,this.isMobileStrikethroughEnabled=!1,this.isHighlightBtnVisible=!0,this.isCommentBtnVisible=!0,this.isUnderlineBtnVisible=!0,this.isStrikethroughBtnVisible=!0,this.isColorToolVisible=!0,this.isOpacityToolVisible=!0,this.isDeleteAnnotationToolVisible=!0,this.isCurrentAnnotationOpacitySet=!1,this.isStampBtnVisible=!1,this.isShapeBtnVisible=!1,this.isSignatureBtnVisible=!1,this.isInkBtnVisible=!1,this.isFontFamilyToolVisible=!1,this.isFontSizeToolVisible=!1,this.isFontAlignToolVisible=!1,this.isFontColorToolVisible=!1,this.isFontStylesToolVisible=!1,this.isCommentPanelBtnVisible=!1,this.isFreeTextBtnVisible=!1,this.isCalibrateBtnVisible=!1,this.isStrokeColorToolVisible=!1,this.isThicknessToolVisible=!1,this.stampMenu=[],this.stampParentID="",this.inkAnnotationSelected=!1,this.openSignaturePopup=!1,this.isSavedSignatureClicked=!1,this.saveSignatureCount=0,this.saveInitialCount=0,this.isToolbarCreated=!1,this.addStampImage=function(e){var t,i=o,n=e.target.files;null!==e.target.files[0]&&(n=n[0],o.pdfViewer.annotationModule.stampAnnotationModule.customStampName=n.name.split(".")[0],"image"===n.type.split("/")[0])&&((t=new FileReader).onload=function(e){e=e.currentTarget.result;i.pdfViewer.annotation.stampAnnotationModule.isStampAddMode=!0,i.pdfViewer.annotationModule.stampAnnotationModule.isStampAnnotSelected=!0,i.pdfViewerBase.stampAdded=!0,o.pdfViewer.annotationModule.stampAnnotationModule.createCustomStampAnnotation(e),i.pdfViewerBase.stampAdded=!1},t.readAsDataURL(n)),e.target.value="",e.currentTarget.value=""},this.popupPosition=function(e,t){var i,n;e&&e.element&&(t=t.getBoundingClientRect(),i=e.element.getElementsByClassName("e-container e-color-palette")[0].getElementsByClassName("e-palette")[0].getBoundingClientRect(),n=this.pdfViewerBase.mainContainer.getBoundingClientRect(),i.left+i.width>n.width&&(e.element.parentElement.style.left=i.left-i.width+t.width+"px"),i.left-i.width+t.width<0)&&(e.element.parentElement.style.left=n.left+t.width+"px")},this.onShapeToolbarClicked=function(e){var t,i=o.pdfViewer.element.id,n=o.pdfViewer.annotation.shapeAnnotationModule;switch(!F.isDevice&&o.pdfViewer.enableDesktopMode||"Polygon"===o.pdfViewerBase.action&&o.pdfViewerBase.tool.mouseUp(e,!0,!0),F.isDevice?(t=e.originalEvent.target,o.pdfViewer.toolbarModule.selectItem(t.parentElement),o.deselectAllItemsForMobile()):(o.deselectAllItems(),o.resetFreeTextAnnot()),e.originalEvent.target.id){case i+"_shape_line":case i+"_shape_lineIcon":n.setAnnotationType("Line"),o.onShapeDrawSelection(!0),o.updateColorInIcon(o.colorDropDownElement,n.lineFillColor),o.updateColorInIcon(o.strokeDropDownElement,n.lineStrokeColor),o.handleShapeTool(i+"_shape_line");break;case i+"_shape_arrow":case i+"_shape_arrowIcon":n.setAnnotationType("Arrow"),o.onShapeDrawSelection(!0),o.updateColorInIcon(o.colorDropDownElement,n.arrowFillColor),o.updateColorInIcon(o.strokeDropDownElement,n.arrowStrokeColor),o.handleShapeTool(i+"_shape_arrow");break;case i+"_shape_rectangle":case i+"_shape_rectangleIcon":n.setAnnotationType("Rectangle"),o.onShapeDrawSelection(!0),o.updateColorInIcon(o.colorDropDownElement,n.rectangleFillColor),o.updateColorInIcon(o.strokeDropDownElement,n.rectangleStrokeColor),o.handleShapeTool(i+"_shape_rectangle");break;case i+"_shape_circle":case i+"_shape_circleIcon":n.setAnnotationType("Circle"),o.onShapeDrawSelection(!0),o.updateColorInIcon(o.colorDropDownElement,n.circleFillColor),o.updateColorInIcon(o.strokeDropDownElement,n.circleStrokeColor),o.handleShapeTool(i+"_shape_circle");break;case i+"_shape_pentagon":case i+"_shape_pentagonIcon":n.setAnnotationType("Polygon"),o.onShapeDrawSelection(!0),o.updateColorInIcon(o.colorDropDownElement,n.polygonFillColor),o.updateColorInIcon(o.strokeDropDownElement,n.polygonStrokeColor),o.handleShapeTool(i+"_shape_pentagon")}},this.pdfViewer=e,this.pdfViewerBase=t,this.primaryToolbar=i}HRt=function(e,t){return(HRt=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])}))(e,t)};var HRt,zRt,Bft=function(e,t){function i(){this.constructor=e}HRt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},d=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},jRt=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},WRt=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Gmt=(Bft(QRt,zRt=n),d([e(!0)],QRt.prototype,"showTooltip",void 0),d([e()],QRt.prototype,"toolbarItems",void 0),d([e()],QRt.prototype,"annotationToolbarItems",void 0),d([e()],QRt.prototype,"formDesignerToolbarItems",void 0),QRt);function QRt(){return null!==zRt&&zRt.apply(this,arguments)||this}Bft(qRt,URt=n),d([e("")],qRt.prototype,"prefixIcon",void 0),d([e("")],qRt.prototype,"tooltipText",void 0),d([e("")],qRt.prototype,"id",void 0),d([e("")],qRt.prototype,"text",void 0),d([e("")],qRt.prototype,"cssClass",void 0),d([e("left")],qRt.prototype,"align",void 0),d([e("")],qRt.prototype,"template",void 0),d([e("Button")],qRt.prototype,"type",void 0);var URt,X$e=qRt;function qRt(){return null!==URt&&URt.apply(this,arguments)||this}Bft(YRt,GRt=n),d([e()],YRt.prototype,"ajaxHeaders",void 0),d([e(!1)],YRt.prototype,"withCredentials",void 0);var GRt,Wo=YRt;function YRt(){return null!==GRt&&GRt.apply(this,arguments)||this}Bft(KRt,XRt=n),d([e("")],KRt.prototype,"customStampName",void 0),d([e("")],KRt.prototype,"customStampImageSource",void 0);var XRt,Met=KRt;function KRt(){return null!==XRt&&XRt.apply(this,arguments)||this}Bft(ZRt,JRt=n),d([e(!0)],ZRt.prototype,"showTooltip",void 0),d([e()],ZRt.prototype,"annotationToolbarItem",void 0);var JRt,Cet=ZRt;function ZRt(){return null!==JRt&&JRt.apply(this,arguments)||this}Bft(eOt,$Rt=n),d([e(!0)],eOt.prototype,"showTooltip",void 0),d([e()],eOt.prototype,"formDesignerToolbarItem",void 0);var $Rt,ts=eOt;function eOt(){return null!==$Rt&&$Rt.apply(this,arguments)||this}Bft(iOt,tOt=n),d([e({x:0,y:0,width:0,height:0})],iOt.prototype,"bounds",void 0),d([e("")],iOt.prototype,"name",void 0),d([e(!1)],iOt.prototype,"isReadOnly",void 0),d([e("visible")],iOt.prototype,"visibility",void 0),d([e(!1)],iOt.prototype,"isRequired",void 0),d([e(!1)],iOt.prototype,"isPrint",void 0),d([e("")],iOt.prototype,"tooltip",void 0),d([e(1)],iOt.prototype,"thickness",void 0),d([e(0)],iOt.prototype,"pageNumber",void 0),d([e()],iOt.prototype,"signatureDialogSettings",void 0),d([e()],iOt.prototype,"signatureIndicatorSettings",void 0),d([e(null)],iOt.prototype,"customData",void 0),d([e()],iOt.prototype,"typeSignatureFonts",void 0);var tOt,d$=iOt;function iOt(){return null!==tOt&&tOt.apply(this,arguments)||this}Bft(oOt,nOt=n),d([e({x:0,y:0,width:0,height:0})],oOt.prototype,"bounds",void 0),d([e("")],oOt.prototype,"name",void 0),d([e(!1)],oOt.prototype,"isReadOnly",void 0),d([e("visible")],oOt.prototype,"visibility",void 0),d([e(!1)],oOt.prototype,"isRequired",void 0),d([e(!1)],oOt.prototype,"isPrint",void 0),d([e("")],oOt.prototype,"tooltip",void 0),d([e(1)],oOt.prototype,"thickness",void 0),d([e(0)],oOt.prototype,"pageNumber",void 0),d([e(!1)],oOt.prototype,"isInitialField",void 0),d([e()],oOt.prototype,"initialDialogSettings",void 0),d([e()],oOt.prototype,"initialIndicatorSettings",void 0),d([e(null)],oOt.prototype,"customData",void 0),d([e()],oOt.prototype,"typeInitialFonts",void 0);var nOt,zmt=oOt;function oOt(){return null!==nOt&&nOt.apply(this,arguments)||this}Bft(sOt,rOt=n),d([e(1)],sOt.prototype,"opacity",void 0),d([e("orange")],sOt.prototype,"backgroundColor",void 0),d([e(19)],sOt.prototype,"width",void 0),d([e(10)],sOt.prototype,"height",void 0),d([e(10)],sOt.prototype,"fontSize",void 0),d([e(null)],sOt.prototype,"text",void 0),d([e("black")],sOt.prototype,"color",void 0);var rOt,Qmt=sOt;function sOt(){return null!==rOt&&rOt.apply(this,arguments)||this}Bft(lOt,aOt=n),d([e(DCt.Draw|DCt.Text|DCt.Upload)],lOt.prototype,"displayMode",void 0),d([e(!1)],lOt.prototype,"hideSaveSignature",void 0);var aOt,ost=lOt;function lOt(){return null!==aOt&&aOt.apply(this,arguments)||this}Bft(dOt,hOt=n),d([e("Load")],dOt.prototype,"load",void 0),d([e("Unload")],dOt.prototype,"unload",void 0),d([e("RenderPdfPages")],dOt.prototype,"renderPages",void 0),d([e("RenderPdfPages")],dOt.prototype,"print",void 0),d([e("Download")],dOt.prototype,"download",void 0),d([e("RenderThumbnailImages")],dOt.prototype,"renderThumbnail",void 0),d([e("RenderAnnotationComments")],dOt.prototype,"renderComments",void 0),d([e("ImportAnnotations")],dOt.prototype,"importAnnotations",void 0),d([e("ExportAnnotations")],dOt.prototype,"exportAnnotations",void 0),d([e("ImportFormFields")],dOt.prototype,"importFormFields",void 0),d([e("ExportFormFields")],dOt.prototype,"exportFormFields",void 0),d([e("RenderPdfTexts")],dOt.prototype,"renderTexts",void 0),d([e("ValidatePassword")],dOt.prototype,"validatePassword",void 0);var hOt,jee=dOt;function dOt(){return null!==hOt&&hOt.apply(this,arguments)||this}Bft(cOt,pOt=n),d([e(1)],cOt.prototype,"pageNumber",void 0),d([e(1)],cOt.prototype,"opacity",void 0),d([e("#ff0000")],cOt.prototype,"color",void 0),d([e("Guest")],cOt.prototype,"author",void 0),d([e("")],cOt.prototype,"annotationSelectorSettings",void 0),d([e(null)],cOt.prototype,"customData",void 0),d([e(!1)],cOt.prototype,"isLock",void 0),d([e(!1)],cOt.prototype,"enableMultiPageAnnotation",void 0),d([e(!1)],cOt.prototype,"enableTextMarkupResizer",void 0),d([e(["None"])],cOt.prototype,"allowedInteractions",void 0),d([e(!0)],cOt.prototype,"isPrint",void 0),d([e("")],cOt.prototype,"subject",void 0);var pOt,det=cOt;function cOt(){return null!==pOt&&pOt.apply(this,arguments)||this}Bft(gOt,uOt=n),d([e(1)],gOt.prototype,"pageNumber",void 0),d([e(1)],gOt.prototype,"opacity",void 0),d([e("#00ff00")],gOt.prototype,"color",void 0),d([e("Guest")],gOt.prototype,"author",void 0),d([e("")],gOt.prototype,"annotationSelectorSettings",void 0),d([e(null)],gOt.prototype,"customData",void 0),d([e(!1)],gOt.prototype,"isLock",void 0),d([e(!1)],gOt.prototype,"enableMultiPageAnnotation",void 0),d([e(!1)],gOt.prototype,"enableTextMarkupResizer",void 0),d([e(["None"])],gOt.prototype,"allowedInteractions",void 0),d([e(!0)],gOt.prototype,"isPrint",void 0),d([e("")],gOt.prototype,"subject",void 0);var uOt,q$e=gOt;function gOt(){return null!==uOt&&uOt.apply(this,arguments)||this}Bft(fOt,mOt=n),d([e(1)],fOt.prototype,"pageNumber",void 0),d([e(1)],fOt.prototype,"opacity",void 0),d([e("#FFDF56")],fOt.prototype,"color",void 0),d([e("Guest")],fOt.prototype,"author",void 0),d([e("")],fOt.prototype,"annotationSelectorSettings",void 0),d([e(null)],fOt.prototype,"customData",void 0),d([e(!1)],fOt.prototype,"isLock",void 0),d([e(!1)],fOt.prototype,"enableMultiPageAnnotation",void 0),d([e(!1)],fOt.prototype,"enableTextMarkupResizer",void 0),d([e(["None"])],fOt.prototype,"allowedInteractions",void 0),d([e(!0)],fOt.prototype,"isPrint",void 0),d([e("")],fOt.prototype,"subject",void 0);var mOt,h=fOt;function fOt(){return null!==mOt&&mOt.apply(this,arguments)||this}Bft(vOt,yOt=n),d([e({x:0,y:0})],vOt.prototype,"offset",void 0),d([e(1)],vOt.prototype,"pageNumber",void 0),d([e(1)],vOt.prototype,"opacity",void 0),d([e("#ffffff00")],vOt.prototype,"fillColor",void 0),d([e("#ff0000")],vOt.prototype,"strokeColor",void 0),d([e("Guest")],vOt.prototype,"author",void 0),d([e("1")],vOt.prototype,"thickness",void 0),d([e("None")],vOt.prototype,"lineHeadStartStyle",void 0),d([e("None")],vOt.prototype,"lineHeadEndStyle",void 0),d([e(0)],vOt.prototype,"borderDashArray",void 0),d([e("")],vOt.prototype,"annotationSelectorSettings",void 0),d([e(0)],vOt.prototype,"minHeight",void 0),d([e(0)],vOt.prototype,"minWidth",void 0),d([e(0)],vOt.prototype,"maxHeight",void 0),d([e(0)],vOt.prototype,"maxWidth",void 0),d([e(!1)],vOt.prototype,"isLock",void 0),d([e(null)],vOt.prototype,"customData",void 0),d([e(["None"])],vOt.prototype,"allowedInteractions",void 0),d([e(!0)],vOt.prototype,"isPrint",void 0),d([e("")],vOt.prototype,"subject",void 0);var yOt,mft=vOt;function vOt(){return null!==yOt&&yOt.apply(this,arguments)||this}Bft(wOt,bOt=n),d([e({x:0,y:0})],wOt.prototype,"offset",void 0),d([e(1)],wOt.prototype,"pageNumber",void 0),d([e(1)],wOt.prototype,"opacity",void 0),d([e("#ffffff00")],wOt.prototype,"fillColor",void 0),d([e("#ff0000")],wOt.prototype,"strokeColor",void 0),d([e("Guest")],wOt.prototype,"author",void 0),d([e("1")],wOt.prototype,"thickness",void 0),d([e("None")],wOt.prototype,"lineHeadStartStyle",void 0),d([e("None")],wOt.prototype,"lineHeadEndStyle",void 0),d([e(0)],wOt.prototype,"borderDashArray",void 0),d([e("")],wOt.prototype,"annotationSelectorSettings",void 0),d([e(0)],wOt.prototype,"minHeight",void 0),d([e(0)],wOt.prototype,"minWidth",void 0),d([e(0)],wOt.prototype,"maxHeight",void 0),d([e(0)],wOt.prototype,"maxWidth",void 0),d([e(!1)],wOt.prototype,"isLock",void 0),d([e(null)],wOt.prototype,"customData",void 0),d([e(["None"])],wOt.prototype,"allowedInteractions",void 0),d([e(!0)],wOt.prototype,"isPrint",void 0),d([e("")],wOt.prototype,"subject",void 0);var bOt,cft=wOt;function wOt(){return null!==bOt&&bOt.apply(this,arguments)||this}Bft(AOt,COt=n),d([e({x:0,y:0})],AOt.prototype,"offset",void 0),d([e(1)],AOt.prototype,"pageNumber",void 0),d([e(100)],AOt.prototype,"width",void 0),d([e(50)],AOt.prototype,"height",void 0),d([e(1)],AOt.prototype,"opacity",void 0),d([e("#ffffff00")],AOt.prototype,"fillColor",void 0),d([e("#ff0000")],AOt.prototype,"strokeColor",void 0),d([e("Guest")],AOt.prototype,"author",void 0),d([e("1")],AOt.prototype,"thickness",void 0),d([e("")],AOt.prototype,"annotationSelectorSettings",void 0),d([e(0)],AOt.prototype,"minHeight",void 0),d([e(0)],AOt.prototype,"minWidth",void 0),d([e(0)],AOt.prototype,"maxHeight",void 0),d([e(0)],AOt.prototype,"maxWidth",void 0),d([e(!1)],AOt.prototype,"isLock",void 0),d([e(null)],AOt.prototype,"customData",void 0),d([e(["None"])],AOt.prototype,"allowedInteractions",void 0),d([e(!0)],AOt.prototype,"isPrint",void 0),d([e("")],AOt.prototype,"subject",void 0);var COt,SOt=AOt;function AOt(){return null!==COt&&COt.apply(this,arguments)||this}Bft(TOt,xOt=n),d([e({x:0,y:0})],TOt.prototype,"offset",void 0),d([e(1)],TOt.prototype,"pageNumber",void 0),d([e(100)],TOt.prototype,"width",void 0),d([e(100)],TOt.prototype,"height",void 0),d([e(1)],TOt.prototype,"opacity",void 0),d([e("#ffffff00")],TOt.prototype,"fillColor",void 0),d([e("#ff0000")],TOt.prototype,"strokeColor",void 0),d([e("Guest")],TOt.prototype,"author",void 0),d([e("1")],TOt.prototype,"thickness",void 0),d([e("")],TOt.prototype,"annotationSelectorSettings",void 0),d([e(0)],TOt.prototype,"minHeight",void 0),d([e(0)],TOt.prototype,"minWidth",void 0),d([e(0)],TOt.prototype,"maxHeight",void 0),d([e(0)],TOt.prototype,"maxWidth",void 0),d([e(!1)],TOt.prototype,"isLock",void 0),d([e(null)],TOt.prototype,"customData",void 0),d([e(["None"])],TOt.prototype,"allowedInteractions",void 0),d([e(!0)],TOt.prototype,"isPrint",void 0),d([e("")],TOt.prototype,"subject",void 0);var xOt,IOt=TOt;function TOt(){return null!==xOt&&xOt.apply(this,arguments)||this}Bft(MOt,EOt=n),d([e(1)],MOt.prototype,"opacity",void 0),d([e("#ffffff00")],MOt.prototype,"fillColor",void 0),d([e("#000")],MOt.prototype,"fontColor",void 0),d([e(16)],MOt.prototype,"fontSize",void 0),d([e("Helvetica")],MOt.prototype,"fontFamily",void 0),d([e("Label")],MOt.prototype,"labelContent",void 0),d([e("")],MOt.prototype,"notes",void 0);var EOt,DOt=MOt;function MOt(){return null!==EOt&&EOt.apply(this,arguments)||this}Bft(BOt,kOt=n),d([e({x:0,y:0})],BOt.prototype,"offset",void 0),d([e(1)],BOt.prototype,"pageNumber",void 0),d([e(1)],BOt.prototype,"opacity",void 0),d([e("#ffffff00")],BOt.prototype,"fillColor",void 0),d([e("#ff0000")],BOt.prototype,"strokeColor",void 0),d([e("Guest")],BOt.prototype,"author",void 0),d([e("1")],BOt.prototype,"thickness",void 0),d([e("")],BOt.prototype,"annotationSelectorSettings",void 0),d([e(0)],BOt.prototype,"minHeight",void 0),d([e(0)],BOt.prototype,"minWidth",void 0),d([e(0)],BOt.prototype,"maxHeight",void 0),d([e(0)],BOt.prototype,"maxWidth",void 0),d([e(!1)],BOt.prototype,"isLock",void 0),d([e(null)],BOt.prototype,"customData",void 0),d([e(["None"])],BOt.prototype,"allowedInteractions",void 0),d([e(!0)],BOt.prototype,"isPrint",void 0),d([e("")],BOt.prototype,"subject",void 0);var kOt,POt=BOt;function BOt(){return null!==kOt&&kOt.apply(this,arguments)||this}Bft(ROt,FOt=n),d([e({x:0,y:0})],ROt.prototype,"offset",void 0),d([e(1)],ROt.prototype,"pageNumber",void 0),d([e(150)],ROt.prototype,"width",void 0),d([e(50)],ROt.prototype,"height",void 0),d([e(1)],ROt.prototype,"opacity",void 0),d([e("Guest")],ROt.prototype,"author",void 0),d([e("")],ROt.prototype,"annotationSelectorSettings",void 0),d([e(0)],ROt.prototype,"minHeight",void 0),d([e(0)],ROt.prototype,"minWidth",void 0),d([e(0)],ROt.prototype,"maxHeight",void 0),d([e(0)],ROt.prototype,"maxWidth",void 0),d([e(!1)],ROt.prototype,"isLock",void 0),d([e(null)],ROt.prototype,"customData",void 0),d([e([])],ROt.prototype,"dynamicStamps",void 0),d([e([])],ROt.prototype,"signStamps",void 0),d([e([])],ROt.prototype,"standardBusinessStamps",void 0),d([e(["None"])],ROt.prototype,"allowedInteractions",void 0),d([e(!0)],ROt.prototype,"isPrint",void 0),d([e("")],ROt.prototype,"subject",void 0);var FOt,LOt=ROt;function ROt(){return null!==FOt&&FOt.apply(this,arguments)||this}Bft(VOt,OOt=n),d([e({x:0,y:0})],VOt.prototype,"offset",void 0),d([e(1)],VOt.prototype,"pageNumber",void 0),d([e(1)],VOt.prototype,"opacity",void 0),d([e("Guest")],VOt.prototype,"author",void 0),d([e(0)],VOt.prototype,"width",void 0),d([e(0)],VOt.prototype,"height",void 0),d([e(0)],VOt.prototype,"left",void 0),d([e(0)],VOt.prototype,"top",void 0),d([e(!1)],VOt.prototype,"isAddToMenu",void 0),d([e(0)],VOt.prototype,"minHeight",void 0),d([e(0)],VOt.prototype,"minWidth",void 0),d([e(0)],VOt.prototype,"maxHeight",void 0),d([e(0)],VOt.prototype,"maxWidth",void 0),d([e(!1)],VOt.prototype,"isLock",void 0),d([e("")],VOt.prototype,"customStamps",void 0),d([e(!0)],VOt.prototype,"enableCustomStamp",void 0),d([e(["None"])],VOt.prototype,"allowedInteractions",void 0),d([e(!0)],VOt.prototype,"isPrint",void 0),d([e("")],VOt.prototype,"subject",void 0);var OOt,NOt=VOt;function VOt(){return null!==OOt&&OOt.apply(this,arguments)||this}Bft(zOt,_Ot=n),d([e({x:0,y:0})],zOt.prototype,"offset",void 0),d([e(1)],zOt.prototype,"pageNumber",void 0),d([e(1)],zOt.prototype,"opacity",void 0),d([e("#ff0000")],zOt.prototype,"fillColor",void 0),d([e("#ff0000")],zOt.prototype,"strokeColor",void 0),d([e("Guest")],zOt.prototype,"author",void 0),d([e("1")],zOt.prototype,"thickness",void 0),d([e("None")],zOt.prototype,"lineHeadStartStyle",void 0),d([e("None")],zOt.prototype,"lineHeadEndStyle",void 0),d([e(0)],zOt.prototype,"borderDashArray",void 0),d([e("")],zOt.prototype,"annotationSelectorSettings",void 0),d([e(0)],zOt.prototype,"minHeight",void 0),d([e(0)],zOt.prototype,"minWidth",void 0),d([e(0)],zOt.prototype,"maxHeight",void 0),d([e(0)],zOt.prototype,"maxWidth",void 0),d([e(!1)],zOt.prototype,"isLock",void 0),d([e(null)],zOt.prototype,"customData",void 0),d([e(40)],zOt.prototype,"leaderLength",void 0),d([e(MCt.move)],zOt.prototype,"resizeCursorType",void 0),d([e(["None"])],zOt.prototype,"allowedInteractions",void 0),d([e(!0)],zOt.prototype,"isPrint",void 0),d([e("")],zOt.prototype,"subject",void 0);var _Ot,HOt=zOt;function zOt(){return null!==_Ot&&_Ot.apply(this,arguments)||this}Bft(QOt,jOt=n),d([e({x:0,y:0})],QOt.prototype,"offset",void 0),d([e(1)],QOt.prototype,"pageNumber",void 0),d([e(1)],QOt.prototype,"opacity",void 0),d([e("#ffffff00")],QOt.prototype,"fillColor",void 0),d([e("#ff0000")],QOt.prototype,"strokeColor",void 0),d([e("Guest")],QOt.prototype,"author",void 0),d([e("1")],QOt.prototype,"thickness",void 0),d([e("None")],QOt.prototype,"lineHeadStartStyle",void 0),d([e("None")],QOt.prototype,"lineHeadEndStyle",void 0),d([e(0)],QOt.prototype,"borderDashArray",void 0),d([e(0)],QOt.prototype,"minHeight",void 0),d([e(0)],QOt.prototype,"minWidth",void 0),d([e(0)],QOt.prototype,"maxHeight",void 0),d([e(0)],QOt.prototype,"maxWidth",void 0),d([e(!1)],QOt.prototype,"isLock",void 0),d([e("")],QOt.prototype,"annotationSelectorSettings",void 0),d([e(["None"])],QOt.prototype,"allowedInteractions",void 0),d([e(!0)],QOt.prototype,"isPrint",void 0),d([e("")],QOt.prototype,"subject",void 0);var jOt,WOt=QOt;function QOt(){return null!==jOt&&jOt.apply(this,arguments)||this}Bft(GOt,UOt=n),d([e({x:0,y:0})],GOt.prototype,"offset",void 0),d([e(1)],GOt.prototype,"pageNumber",void 0),d([e(1)],GOt.prototype,"opacity",void 0),d([e("#ffffff00")],GOt.prototype,"fillColor",void 0),d([e("#ff0000")],GOt.prototype,"strokeColor",void 0),d([e("Guest")],GOt.prototype,"author",void 0),d([e("1")],GOt.prototype,"thickness",void 0),d([e(0)],GOt.prototype,"minHeight",void 0),d([e(0)],GOt.prototype,"minWidth",void 0),d([e(0)],GOt.prototype,"maxHeight",void 0),d([e(0)],GOt.prototype,"maxWidth",void 0),d([e(!1)],GOt.prototype,"isLock",void 0),d([e("")],GOt.prototype,"annotationSelectorSettings",void 0),d([e(["None"])],GOt.prototype,"allowedInteractions",void 0),d([e(!0)],GOt.prototype,"isPrint",void 0),d([e("")],GOt.prototype,"subject",void 0);var UOt,qOt=GOt;function GOt(){return null!==UOt&&UOt.apply(this,arguments)||this}Bft(KOt,YOt=n),d([e({x:0,y:0})],KOt.prototype,"offset",void 0),d([e(1)],KOt.prototype,"pageNumber",void 0),d([e(100)],KOt.prototype,"width",void 0),d([e(90)],KOt.prototype,"height",void 0),d([e(1)],KOt.prototype,"opacity",void 0),d([e("#ffffff00")],KOt.prototype,"fillColor",void 0),d([e("#ff0000")],KOt.prototype,"strokeColor",void 0),d([e("Guest")],KOt.prototype,"author",void 0),d([e("1")],KOt.prototype,"thickness",void 0),d([e("")],KOt.prototype,"annotationSelectorSettings",void 0),d([e(0)],KOt.prototype,"minHeight",void 0),d([e(0)],KOt.prototype,"minWidth",void 0),d([e(0)],KOt.prototype,"maxHeight",void 0),d([e(0)],KOt.prototype,"maxWidth",void 0),d([e(!1)],KOt.prototype,"isLock",void 0),d([e(null)],KOt.prototype,"customData",void 0),d([e(["None"])],KOt.prototype,"allowedInteractions",void 0),d([e(!0)],KOt.prototype,"isPrint",void 0),d([e("")],KOt.prototype,"subject",void 0);var YOt,XOt=KOt;function KOt(){return null!==YOt&&YOt.apply(this,arguments)||this}Bft($Ot,JOt=n),d([e({x:0,y:0})],$Ot.prototype,"offset",void 0),d([e(1)],$Ot.prototype,"pageNumber",void 0),d([e(1)],$Ot.prototype,"opacity",void 0),d([e("#ffffff00")],$Ot.prototype,"fillColor",void 0),d([e("#ff0000")],$Ot.prototype,"strokeColor",void 0),d([e("Guest")],$Ot.prototype,"author",void 0),d([e("1")],$Ot.prototype,"thickness",void 0),d([e(0)],$Ot.prototype,"minHeight",void 0),d([e(0)],$Ot.prototype,"minWidth",void 0),d([e(0)],$Ot.prototype,"maxHeight",void 0),d([e(0)],$Ot.prototype,"maxWidth",void 0),d([e(!1)],$Ot.prototype,"isLock",void 0),d([e("")],$Ot.prototype,"annotationSelectorSettings",void 0),d([e(["None"])],$Ot.prototype,"allowedInteractions",void 0),d([e(!0)],$Ot.prototype,"isPrint",void 0),d([e("")],$Ot.prototype,"subject",void 0);var JOt,ZOt=$Ot;function $Ot(){return null!==JOt&&JOt.apply(this,arguments)||this}Bft(iNt,eNt=n),d([e({x:0,y:0})],iNt.prototype,"offset",void 0),d([e(1)],iNt.prototype,"pageNumber",void 0),d([e(0)],iNt.prototype,"width",void 0),d([e(0)],iNt.prototype,"height",void 0),d([e(0)],iNt.prototype,"path",void 0),d([e(1)],iNt.prototype,"opacity",void 0),d([e("#ff0000")],iNt.prototype,"strokeColor",void 0),d([e(1)],iNt.prototype,"thickness",void 0),d([e("")],iNt.prototype,"annotationSelectorSettings",void 0),d([e(!1)],iNt.prototype,"isLock",void 0),d([e("Guest")],iNt.prototype,"author",void 0),d([e(["None"])],iNt.prototype,"allowedInteractions",void 0),d([e(null)],iNt.prototype,"customData",void 0),d([e(!0)],iNt.prototype,"isPrint",void 0),d([e("")],iNt.prototype,"subject",void 0);var eNt,tNt=iNt;function iNt(){return null!==eNt&&eNt.apply(this,arguments)||this}Bft(rNt,nNt=n),d([e({x:0,y:0})],rNt.prototype,"offset",void 0),d([e(1)],rNt.prototype,"pageNumber",void 0),d([e("Guest")],rNt.prototype,"author",void 0),d([e(1)],rNt.prototype,"opacity",void 0),d([e("")],rNt.prototype,"annotationSelectorSettings",void 0),d([e(null)],rNt.prototype,"customData",void 0),d([e(!1)],rNt.prototype,"isLock",void 0),d([e(["None"])],rNt.prototype,"allowedInteractions",void 0),d([e(!0)],rNt.prototype,"isPrint",void 0),d([e("")],rNt.prototype,"subject",void 0);var nNt,oNt=rNt;function rNt(){return null!==nNt&&nNt.apply(this,arguments)||this}Bft(lNt,sNt=n),d([e(1)],lNt.prototype,"scaleRatio",void 0),d([e("in")],lNt.prototype,"conversionUnit",void 0),d([e("in")],lNt.prototype,"displayUnit",void 0),d([e(96)],lNt.prototype,"depth",void 0);var sNt,aNt=lNt;function lNt(){return null!==sNt&&sNt.apply(this,arguments)||this}Bft(pNt,hNt=n),d([e({x:0,y:0})],pNt.prototype,"offset",void 0),d([e(1)],pNt.prototype,"pageNumber",void 0),d([e(1)],pNt.prototype,"opacity",void 0),d([e("#ffffff00")],pNt.prototype,"borderColor",void 0),d([e(1)],pNt.prototype,"borderWidth",void 0),d([e("solid")],pNt.prototype,"borderStyle",void 0),d([e("Guest")],pNt.prototype,"author",void 0),d([e("#ffffff00")],pNt.prototype,"fillColor",void 0),d([e(16)],pNt.prototype,"fontSize",void 0),d([e(151)],pNt.prototype,"width",void 0),d([e(24.6)],pNt.prototype,"height",void 0),d([e("#000")],pNt.prototype,"fontColor",void 0),d([e("Helvetica")],pNt.prototype,"fontFamily",void 0),d([e("TypeHere")],pNt.prototype,"defaultText",void 0),d([e("None")],pNt.prototype,"fontStyle",void 0),d([e("Left")],pNt.prototype,"textAlignment",void 0),d([e(!1)],pNt.prototype,"allowEditTextOnly",void 0),d([e("")],pNt.prototype,"annotationSelectorSettings",void 0),d([e(0)],pNt.prototype,"minHeight",void 0),d([e(0)],pNt.prototype,"minWidth",void 0),d([e(0)],pNt.prototype,"maxHeight",void 0),d([e(0)],pNt.prototype,"maxWidth",void 0),d([e(!1)],pNt.prototype,"isLock",void 0),d([e(null)],pNt.prototype,"customData",void 0),d([e(["None"])],pNt.prototype,"allowedInteractions",void 0),d([e(!0)],pNt.prototype,"isPrint",void 0),d([e(!1)],pNt.prototype,"isReadonly",void 0),d([e(!1)],pNt.prototype,"enableAutoFit",void 0),d([e("")],pNt.prototype,"subject",void 0);var hNt,dNt=pNt;function pNt(){return null!==hNt&&hNt.apply(this,arguments)||this}Bft(gNt,cNt=n),d([e("")],gNt.prototype,"selectionBorderColor",void 0),d([e("black")],gNt.prototype,"resizerBorderColor",void 0),d([e("#FF4081")],gNt.prototype,"resizerFillColor",void 0),d([e(8)],gNt.prototype,"resizerSize",void 0),d([e(1)],gNt.prototype,"selectionBorderThickness",void 0),d([e("Square")],gNt.prototype,"resizerShape",void 0),d([e("")],gNt.prototype,"selectorLineDashArray",void 0),d([e(TCt.Corners|TCt.Edges)],gNt.prototype,"resizerLocation",void 0),d([e(null)],gNt.prototype,"resizerCursorType",void 0);var cNt,uNt=gNt;function gNt(){return null!==cNt&&cNt.apply(this,arguments)||this}Bft(yNt,mNt=n),d([e("#fdd835")],yNt.prototype,"searchHighlightColor",void 0),d([e("#8b4c12")],yNt.prototype,"searchColor",void 0);var mNt,fNt=yNt;function yNt(){return null!==mNt&&mNt.apply(this,arguments)||this}Bft(wNt,vNt=n),d([e(0)],wNt.prototype,"pageIndex",void 0),d([e(0)],wNt.prototype,"width",void 0),d([e(0)],wNt.prototype,"height",void 0),d([e(0)],wNt.prototype,"rotation",void 0);var vNt,bNt=wNt;function wNt(){return null!==vNt&&vNt.apply(this,arguments)||this}Bft(ANt,CNt=n),d([e(1)],ANt.prototype,"opacity",void 0),d([e("#000000")],ANt.prototype,"strokeColor",void 0),d([e(1)],ANt.prototype,"thickness",void 0),d([e(150)],ANt.prototype,"width",void 0),d([e(100)],ANt.prototype,"height",void 0),d([e(1)],ANt.prototype,"saveSignatureLimit",void 0),d([e(1)],ANt.prototype,"saveInitialLimit",void 0),d([e([])],ANt.prototype,"signatureItem",void 0),d([e()],ANt.prototype,"typeSignatureFonts",void 0),d([e("")],ANt.prototype,"annotationSelectorSettings",void 0),d([e()],ANt.prototype,"signatureDialogSettings",void 0),d([e()],ANt.prototype,"initialDialogSettings",void 0),d([e({x:0,y:0})],ANt.prototype,"offset",void 0),d([e(1)],ANt.prototype,"pageNumber",void 0),d([e("")],ANt.prototype,"path",void 0),d([e("Helvetica")],ANt.prototype,"fontFamily",void 0),d([e(!1)],ANt.prototype,"canSave",void 0);var CNt,SNt=ANt;function ANt(){return null!==CNt&&CNt.apply(this,arguments)||this}Bft(TNt,xNt=n),d([e("Guest")],TNt.prototype,"author",void 0),d([e(0)],TNt.prototype,"minHeight",void 0),d([e(0)],TNt.prototype,"minWidth",void 0),d([e(0)],TNt.prototype,"maxHeight",void 0),d([e(0)],TNt.prototype,"maxWidth",void 0),d([e(!1)],TNt.prototype,"isLock",void 0),d([e(!1)],TNt.prototype,"skipPrint",void 0),d([e(!1)],TNt.prototype,"skipDownload",void 0),d([e(null)],TNt.prototype,"customData",void 0),d([e(["None"])],TNt.prototype,"allowedInteractions",void 0),d([e("")],TNt.prototype,"subject",void 0);var xNt,INt=TNt;function TNt(){return null!==xNt&&xNt.apply(this,arguments)||this}Bft(MNt,ENt=n),d([e()],MNt.prototype,"textData",void 0),d([e()],MNt.prototype,"pageText",void 0),d([e()],MNt.prototype,"pageSize",void 0);var ENt,DNt=MNt;function MNt(){return null!==ENt&&ENt.apply(this,arguments)||this}Bft(BNt,kNt=n),d([e()],BNt.prototype,"bounds",void 0),d([e()],BNt.prototype,"text",void 0);var kNt,PNt=BNt;function BNt(){return null!==kNt&&kNt.apply(this,arguments)||this}Bft(RNt,FNt=n),d([e()],RNt.prototype,"size",void 0),d([e()],RNt.prototype,"x",void 0),d([e()],RNt.prototype,"y",void 0),d([e()],RNt.prototype,"width",void 0),d([e()],RNt.prototype,"height",void 0),d([e()],RNt.prototype,"left",void 0),d([e()],RNt.prototype,"top",void 0),d([e()],RNt.prototype,"right",void 0),d([e()],RNt.prototype,"bottom",void 0),d([e()],RNt.prototype,"isEmpty",void 0);var FNt,LNt=RNt;function RNt(){return null!==FNt&&FNt.apply(this,arguments)||this}Bft(VNt,ONt=n),d([e(!0)],VNt.prototype,"enableTileRendering",void 0),d([e(0)],VNt.prototype,"x",void 0),d([e(0)],VNt.prototype,"y",void 0);var ONt,NNt=VNt;function VNt(){return null!==ONt&&ONt.apply(this,arguments)||this}Bft(zNt,_Nt=n),d([e(100)],zNt.prototype,"delayPageRequestTimeOnScroll",void 0);var _Nt,HNt=zNt;function zNt(){return null!==_Nt&&_Nt.apply(this,arguments)||this}Bft(QNt,jNt=n),d([e("")],QNt.prototype,"name",void 0),d([e(!1)],QNt.prototype,"isChecked",void 0),d([e(!1)],QNt.prototype,"isSelected",void 0),d([e("")],QNt.prototype,"id",void 0),d([e("")],QNt.prototype,"value",void 0),d([e("")],QNt.prototype,"type",void 0),d([e(!1)],QNt.prototype,"isReadOnly",void 0),d([e([""])],QNt.prototype,"signatureType",void 0),d([e("")],QNt.prototype,"fontName",void 0),d([e({x:0,y:0,width:0,height:0})],QNt.prototype,"bounds",void 0),d([e("Helvetica")],QNt.prototype,"fontFamily",void 0),d([e(10)],QNt.prototype,"fontSize",void 0),d([e("None")],QNt.prototype,"fontStyle",void 0),d([e("black")],QNt.prototype,"color",void 0),d([e("white")],QNt.prototype,"backgroundColor",void 0),d([e("Left")],QNt.prototype,"alignment",void 0),d([e("visible")],QNt.prototype,"visibility",void 0),d([e(0)],QNt.prototype,"maxLength",void 0),d([e(!1)],QNt.prototype,"isRequired",void 0),d([e(!1)],QNt.prototype,"isPrint",void 0),d([e("")],QNt.prototype,"tooltip",void 0),d([e("")],QNt.prototype,"options",void 0),d([e()],QNt.prototype,"signatureIndicatorSettings",void 0),d([e(1)],QNt.prototype,"thickness",void 0),d([e("#303030")],QNt.prototype,"borderColor",void 0),d([e(!1)],QNt.prototype,"isMultiline",void 0),d([e(!1)],QNt.prototype,"insertSpaces",void 0),d([e(-1)],QNt.prototype,"pageIndex",void 0),d([e(1)],QNt.prototype,"pageNumber",void 0),d([e(!1)],QNt.prototype,"isTransparent",void 0),d([e(0)],QNt.prototype,"rotateAngle",void 0),d([e("")],QNt.prototype,"selectedIndex",void 0),d([e(0)],QNt.prototype,"zIndex",void 0),d([e(null)],QNt.prototype,"customData",void 0);var jNt,WNt=QNt;function QNt(){return null!==jNt&&jNt.apply(this,arguments)||this}Bft(GNt,UNt=n),d([e("RightClick")],GNt.prototype,"contextMenuAction",void 0),d([e([])],GNt.prototype,"contextMenuItems",void 0);var UNt,qNt=GNt;function GNt(){return null!==UNt&&UNt.apply(this,arguments)||this}Bft(KNt,YNt=n),d([e({x:0,y:0,width:0,height:0})],KNt.prototype,"bounds",void 0),d([e("")],KNt.prototype,"name",void 0),d([e("")],KNt.prototype,"value",void 0),d([e("Helvetica")],KNt.prototype,"fontFamily",void 0),d([e(10)],KNt.prototype,"fontSize",void 0),d([e(0)],KNt.prototype,"pageNumber",void 0),d([e("None")],KNt.prototype,"fontStyle",void 0),d([e("black")],KNt.prototype,"color",void 0),d([e("white")],KNt.prototype,"backgroundColor",void 0),d([e("Left")],KNt.prototype,"alignment",void 0),d([e(!1)],KNt.prototype,"isReadOnly",void 0),d([e("visible")],KNt.prototype,"visibility",void 0),d([e(0)],KNt.prototype,"maxLength",void 0),d([e(!1)],KNt.prototype,"isRequired",void 0),d([e(!1)],KNt.prototype,"isPrint",void 0),d([e("")],KNt.prototype,"tooltip",void 0),d([e(1)],KNt.prototype,"thickness",void 0),d([e("#303030")],KNt.prototype,"borderColor",void 0),d([e(!1)],KNt.prototype,"isMultiline",void 0),d([e(null)],KNt.prototype,"customData",void 0);var YNt,XNt=KNt;function KNt(){return null!==YNt&&YNt.apply(this,arguments)||this}Bft($Nt,JNt=n),d([e({x:0,y:0,width:0,height:0})],$Nt.prototype,"bounds",void 0),d([e("")],$Nt.prototype,"name",void 0),d([e("")],$Nt.prototype,"value",void 0),d([e(0)],$Nt.prototype,"pageNumber",void 0),d([e("Helvetica")],$Nt.prototype,"fontFamily",void 0),d([e(10)],$Nt.prototype,"fontSize",void 0),d([e("None")],$Nt.prototype,"fontStyle",void 0),d([e("black")],$Nt.prototype,"color",void 0),d([e("white")],$Nt.prototype,"backgroundColor",void 0),d([e("Left")],$Nt.prototype,"alignment",void 0),d([e(!1)],$Nt.prototype,"isReadOnly",void 0),d([e("visible")],$Nt.prototype,"visibility",void 0),d([e(0)],$Nt.prototype,"maxLength",void 0),d([e(!1)],$Nt.prototype,"isRequired",void 0),d([e(!1)],$Nt.prototype,"isPrint",void 0),d([e("")],$Nt.prototype,"tooltip",void 0),d([e(1)],$Nt.prototype,"thickness",void 0),d([e("#303030")],$Nt.prototype,"borderColor",void 0),d([e(null)],$Nt.prototype,"customData",void 0);var JNt,ZNt=$Nt;function $Nt(){return null!==JNt&&JNt.apply(this,arguments)||this}Bft(i2t,e2t=n),d([e({x:0,y:0,width:0,height:0})],i2t.prototype,"bounds",void 0),d([e("")],i2t.prototype,"name",void 0),d([e("")],i2t.prototype,"value",void 0),d([e(!1)],i2t.prototype,"isChecked",void 0),d([e("white")],i2t.prototype,"backgroundColor",void 0),d([e(!1)],i2t.prototype,"isReadOnly",void 0),d([e("visible")],i2t.prototype,"visibility",void 0),d([e(!1)],i2t.prototype,"isPrint",void 0),d([e(0)],i2t.prototype,"pageNumber",void 0),d([e("")],i2t.prototype,"tooltip",void 0),d([e(!1)],i2t.prototype,"isRequired",void 0),d([e(1)],i2t.prototype,"thickness",void 0),d([e("#303030")],i2t.prototype,"borderColor",void 0),d([e(null)],i2t.prototype,"customData",void 0);var e2t,t2t=i2t;function i2t(){return null!==e2t&&e2t.apply(this,arguments)||this}Bft(r2t,n2t=n),d([e({x:0,y:0,width:0,height:0})],r2t.prototype,"bounds",void 0),d([e("")],r2t.prototype,"name",void 0),d([e("")],r2t.prototype,"value",void 0),d([e(!1)],r2t.prototype,"isSelected",void 0),d([e("white")],r2t.prototype,"backgroundColor",void 0),d([e(!1)],r2t.prototype,"isReadOnly",void 0),d([e(!1)],r2t.prototype,"isRequired",void 0),d([e(0)],r2t.prototype,"pageNumber",void 0),d([e("visible")],r2t.prototype,"visibility",void 0),d([e(!1)],r2t.prototype,"isPrint",void 0),d([e("")],r2t.prototype,"tooltip",void 0),d([e(1)],r2t.prototype,"thickness",void 0),d([e("#303030")],r2t.prototype,"borderColor",void 0),d([e(null)],r2t.prototype,"customData",void 0);var n2t,o2t=r2t;function r2t(){return null!==n2t&&n2t.apply(this,arguments)||this}Bft(l2t,s2t=n),d([e({x:0,y:0,width:0,height:0})],l2t.prototype,"bounds",void 0),d([e("")],l2t.prototype,"name",void 0),d([e("")],l2t.prototype,"value",void 0),d([e("Helvetica")],l2t.prototype,"fontFamily",void 0),d([e(10)],l2t.prototype,"fontSize",void 0),d([e(0)],l2t.prototype,"pageNumber",void 0),d([e("None")],l2t.prototype,"fontStyle",void 0),d([e("black")],l2t.prototype,"color",void 0),d([e("white")],l2t.prototype,"backgroundColor",void 0),d([e("Left")],l2t.prototype,"alignment",void 0),d([e(!1)],l2t.prototype,"isReadOnly",void 0),d([e("visible")],l2t.prototype,"visibility",void 0),d([e(!1)],l2t.prototype,"isRequired",void 0),d([e(!1)],l2t.prototype,"isPrint",void 0),d([e("")],l2t.prototype,"tooltip",void 0),d([e("")],l2t.prototype,"options",void 0),d([e(1)],l2t.prototype,"thickness",void 0),d([e("#303030")],l2t.prototype,"borderColor",void 0),d([e(null)],l2t.prototype,"customData",void 0);var s2t,a2t=l2t;function l2t(){return null!==s2t&&s2t.apply(this,arguments)||this}Bft(p2t,h2t=n),d([e({x:0,y:0,width:0,height:0})],p2t.prototype,"bounds",void 0),d([e("")],p2t.prototype,"name",void 0),d([e("")],p2t.prototype,"value",void 0),d([e("Helvetica")],p2t.prototype,"fontFamily",void 0),d([e(10)],p2t.prototype,"fontSize",void 0),d([e(0)],p2t.prototype,"pageNumber",void 0),d([e("None")],p2t.prototype,"fontStyle",void 0),d([e("black")],p2t.prototype,"color",void 0),d([e("white")],p2t.prototype,"backgroundColor",void 0),d([e("Left")],p2t.prototype,"alignment",void 0),d([e(!1)],p2t.prototype,"isReadOnly",void 0),d([e("visible")],p2t.prototype,"visibility",void 0),d([e(!1)],p2t.prototype,"isRequired",void 0),d([e(!1)],p2t.prototype,"isPrint",void 0),d([e("")],p2t.prototype,"tooltip",void 0),d([e([])],p2t.prototype,"options",void 0),d([e(1)],p2t.prototype,"thickness",void 0),d([e("#303030")],p2t.prototype,"borderColor",void 0);var h2t,d2t=p2t;function p2t(){return null!==h2t&&h2t.apply(this,arguments)||this}Bft(g2t,c2t=n),d([e("")],g2t.prototype,"itemName",void 0),d([e("")],g2t.prototype,"itemValue",void 0);var c2t,u2t=g2t;function g2t(){return null!==c2t&&c2t.apply(this,arguments)||this}Bft(y2t,m2t=n),d([e()],y2t.prototype,"pdfKeys",void 0),d([e()],y2t.prototype,"modifierKeys",void 0);var m2t,f2t=y2t;function y2t(){return null!==m2t&&m2t.apply(this,arguments)||this}Bft(w2t,v2t=n),d([e("")],w2t.prototype,"name",void 0),d([t({},f2t)],w2t.prototype,"gesture",void 0);var v2t,b2t=w2t;function w2t(){return null!==v2t&&v2t.apply(this,arguments)||this}Bft(A2t,C2t=n),d([kt([],b2t)],A2t.prototype,"keyboardCommand",void 0);var C2t,S2t=A2t;function A2t(){return null!==C2t&&C2t.apply(this,arguments)||this}Bft(T2t,x2t=n),d([e(!0)],T2t.prototype,"canDelete",void 0),d([e(!0)],T2t.prototype,"canInsert",void 0),d([e(!0)],T2t.prototype,"canRotate",void 0),d([e(!0)],T2t.prototype,"canCopy",void 0),d([e(!0)],T2t.prototype,"canRearrange",void 0),d([e(!0)],T2t.prototype,"canImport",void 0);var x2t,I2t=T2t;function T2t(){return null!==x2t&&x2t.apply(this,arguments)||this}Bft(M2t,E2t=n),d([e(0)],M2t.prototype,"pageIndex",void 0),d([e([])],M2t.prototype,"bounds",void 0);var E2t,D2t=M2t;function M2t(){return null!==E2t&&E2t.apply(this,arguments)||this}Bft(p,k2t=Ji),Object.defineProperty(p.prototype,"zoomPercentage",{get:function(){return 100*this.magnificationModule.zoomFactor},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"bookmark",{get:function(){return this.bookmarkViewModule},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"print",{get:function(){return this.printModule},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"magnification",{get:function(){return this.magnificationModule},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"navigation",{get:function(){return this.navigationModule},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"textSearch",{get:function(){return this.textSearchModule},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"toolbar",{get:function(){return this.toolbarModule},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"thumbnailView",{get:function(){return this.thumbnailViewModule},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"annotation",{get:function(){return this.annotationModule},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"formDesigner",{get:function(){return this.formDesignerModule},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"textSelection",{get:function(){return this.textSelectionModule},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"accessibilityTags",{get:function(){return this.accessibilityTagsModule},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"pdfRenderer",{get:function(){return this.pdfRendererModule},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"pageOrganizer",{get:function(){return this.pageOrganizerModule},enumerable:!0,configurable:!0}),p.prototype.preRender=function(){this.localeObj=new Cn(this.getModuleName(),this.defaultLocale,this.locale),je(this.element)||""!==this.element.id||(this.element.id=this.getUniqueElementId()),F.isDevice&&(this.touchPadding=16),this.updateLocalStorage(this.enableLocalStorage)},p.prototype.getUniqueElementId=function(){return"pdfViewer_"+Date.now().toString(36)+Math.random().toString(36).substring(2)},p.prototype.initializePdfiumModule=function(e){this.viewerBase.pdfViewerRunner.addTask({url:this.getScriptPathForPlatform(),fonts:e,message:"initialLoading"},yRt.High)},p.prototype.render=function(){var t,e,i=this;this.enableHtmlSanitizer&&this.serviceUrl&&(this.serviceUrl=go.sanitize(this.serviceUrl)),!je(this.serviceUrl)&&""!==this.serviceUrl||(this.viewerBase.clientSideRendering=!0),this.viewerBase.clientSideRendering?(t=this,e=new Blob([Y2t.toString().replace(/^[^{]*{([\s\S]*)}$/m,"$1")],{type:"text/javascript"}),e=URL.createObjectURL(e),window["pdfViewerRunner_"+this.element.id]=this.viewerBase.pdfViewerRunner=new bRt(e,t),this.customFonts&&0<this.customFonts.length?mRt.fetchCustomFonts(this.customFonts,this.getScriptPathForPlatform()).then(function(e){i.pdfRenderer.FallbackFontCollection=e,i.initializePdfiumModule(e)}):this.initializePdfiumModule({}),this.viewerBase.pdfViewerRunner.onMessage("loaded",function(e){"loaded"===e.data.message&&(t.renderComponent(),t.fireResourcesLoaded())})):this.renderComponent()},p.prototype.exportAsImage=function(e,t){e=je(t)?this.pdfRendererModule.exportAsImage(e):this.pdfRendererModule.exportAsImagewithSize(e,t);return e},p.prototype.exportAsImages=function(e,t,i){e=je(i)?this.pdfRendererModule.exportAsImages(e,t):this.pdfRendererModule.exportAsImagesWithSize(e,t,i);return e},p.prototype.extractText=function(e,t,i){var n,i="number"==typeof t?(n=t,i):t;return je(n)&&(n=e),this.pdfRendererModule.extractsText(e,n,i,!0)},p.prototype.getScriptPathForPlatform=function(){var e,t;return this.enableHtmlSanitizer&&this.resourceUrl&&(this.resourceUrl=go.sanitize(this.resourceUrl)),je(this.resourceUrl)||""===this.resourceUrl?(e=(e=document.location).protocol+"//"+e.host+e.pathname.replace(/\/+$/,""),this.isAngular||this.parent&&this.parent.isAngular?e+"/assets/ej2-pdfviewer-lib":this.isReact||this.parent&&this.parent.isReact?e+"/ej2-pdfviewer-lib":this.isVue||this.parent&&this.parent.isVue||this.isVue3||this.parent&&this.parent.isVue3?e+"/public/js/ej2-pdfviewer-lib":(window.getRunningScript=function(){return function(){var e=(new Error).stack,e=e&&e.match(/(?:http[s]?:\/\/(?:[^\/\s]+\/))(.*\.js)/);return e?e[0]:"src/pdfviewer/pdfviewer.js"}},t=(e=window.getRunningScript()()).split("/"),e.replace("/"+t[t.length-1],"")+"/ej2-pdfviewer-lib")):this.resourceUrl},p.prototype.renderComponent=function(){this.viewerBase.initializeComponent(),this.enableFormFields||(this.formFieldsModule=new z2t(this,this.viewerBase),this.formFieldsModule.formFieldsReadOnly(this.enableFormFields)),this.enableTextSelection&&this.textSelectionModule?this.textSelectionModule.enableTextSelectionMode():this.viewerBase.disableTextSelectionMode(),this.drawing.renderLabels(this),this.renderComplete()},p.prototype.getModuleName=function(){return"PdfViewer"},p.prototype.getLocaleConstants=function(){return this.defaultLocale},p.prototype.setJsonData=function(e){this.viewerBase.ajaxData=e},p.prototype.updateLocalStorage=function(e){e&&!ARt.sessionStorageManager.enableLocalStorage?ARt.sessionStorageManager.migrateToLocalStorage(!0):this.enableLocalStorage=ARt.sessionStorageManager.enableLocalStorage},p.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed)for(var i=0,n=Object.keys(e);i<n.length;i++){var o,r,s=n[i];switch(s){case"locale":this.viewerBase.loadedData&&(o=null,o=this.formFieldsModule?this.viewerBase.getItemFromSessionStorage("_formfields"):o)&&(this.viewerBase.formfieldvalue=JSON.parse(o),o=this.annotationCollection,r=this.viewerBase.jsonDocumentId,k2t.prototype.refresh.call(this),this.load(this.viewerBase.loadedData,null),this.addAnnotation(o),this.viewerBase.loadedData=null,this.downloadFileName=r,this.fileName=r);break;case"toolbarSettings":!F.isDevice||this.enableDesktopMode?(this.toolbar.applyToolbarSettings(),je(this.toolbar.annotationToolbarModule)||this.toolbar.annotationToolbarModule.applyAnnotationToolbarSettings(),je(this.toolbar.formDesignerToolbarModule)||this.toolbar.formDesignerToolbarModule.applyFormDesignerToolbarSettings()):(this.toolbar.applyToolbarSettingsForMobile(),this.toolbar.annotationToolbarModule.applyMobileAnnotationToolbarSettings());break;case"enableToolbar":this.notify("",{module:"toolbar",enable:this.enableToolbar});break;case"enableLocalStorage":this.updateLocalStorage(this.enableLocalStorage);break;case"enableCommentPanel":this.notify("",{module:"annotation",enable:this.enableCommentPanel}),this.toolbarModule&&this.toolbarModule.annotationToolbarModule&&this.toolbarModule.annotationToolbarModule.enableCommentPanelTool(this.enableCommentPanel),this.enableCommentPanel||this.viewerBase.navigationPane&&this.viewerBase.navigationPane.closeCommentPanelContainer();break;case"documentPath":this.viewerBase.isSkipDocumentPath?this.viewerBase.isSkipDocumentPath=!1:N?this._dotnetInstance.invokeMethodAsync("LoadDocumentFromClient",e.documentPath):this.load(e.documentPath,null);break;case"interactionMode":this.interactionMode=e.interactionMode,"Pan"===e.interactionMode?(this.viewerBase.initiatePanning(),this.toolbar&&this.toolbar.updateInteractionTools(!1)):"TextSelection"===e.interactionMode&&(this.viewerBase.initiateTextSelectMode(),this.toolbar)&&this.toolbar.updateInteractionTools(!0);break;case"height":this.height=e.height,this.viewerBase.updateHeight(),this.viewerBase.onWindowResize(),this.toolbar&&this.toolbar.annotationToolbarModule&&(this.toolbar.annotationToolbarModule.isToolbarHidden?this.toolbar.annotationToolbarModule.adjustViewer(!1):this.toolbar.annotationToolbarModule.adjustViewer(!0));break;case"width":this.width=e.width,this.viewerBase.updateWidth(),this.viewerBase.onWindowResize();break;case"customStamp":this.renderCustomerStamp(this.customStamp[0]);break;case"customStampSettings":if(e.customStampSettings.customStamps)for(var a=0;a<e.customStampSettings.customStamps.length;a++)this.viewerBase.customStampCollection.push({customStampName:this.customStampSettings.customStamps[parseInt(a.toString(),10)].customStampName,customStampImageSource:this.customStampSettings.customStamps[parseInt(a.toString(),10)].customStampImageSource});break;case"enableFormFields":if(this.enableFormFields&&this.formFieldsModule)for(var l=0;l<this.pageCount;l++)this.formFieldsModule.renderFormFields(l,!1);else this.formFieldsModule=new z2t(this,this.viewerBase),this.formFieldsModule.formFieldsReadOnly(this.enableFormFields);break;case"designerMode":this.designerMode?this.formDesignerModule.setMode("designer"):this.formDesignerModule.setMode("edit");break;case"highlightSettings":case"underlineSettings":case"strikethroughSettings":this.annotationModule&&this.annotationModule.textMarkupAnnotationModule&&this.annotationModule.textMarkupAnnotationModule.updateTextMarkupSettings(s);break;case"signatureFieldSettings":case"initialFieldSettings":this.formDesignerModule&&this.formDesignerModule.updateSignatureSettings(e[s],"initialFieldSettings"===s);break;case"textFieldSettings":this.formDesignerModule&&this.formDesignerModule.updateTextFieldSettings(e[s]);break;case"passwordFieldSettings":this.formDesignerModule&&this.formDesignerModule.updatePasswordFieldSettings(e[s]);break;case"checkBoxFieldSettings":this.formDesignerModule&&this.formDesignerModule.updateCheckBoxFieldSettings(e[s]);break;case"radioButtonFieldSettings":this.formDesignerModule&&this.formDesignerModule.updateRadioButtonFieldSettings(e[s]);break;case"DropdownFieldSettings":this.formDesignerModule&&this.formDesignerModule.updateDropDownFieldSettings(e[s]);break;case"listBoxFieldSettings":this.formDesignerModule&&this.formDesignerModule.updateListBoxFieldSettings(e[s]);break;case"isFormDesignerToolbarVisible":F.isDevice&&!this.enableDesktopMode||(this.toolbarModule&&this.formDesignerModule&&!t.isFormDesignerToolbarVisible&&e.isFormDesignerToolbarVisible?(this.toolbarModule.annotationToolbarModule&&this.isAnnotationToolbarVisible&&(this.isAnnotationToolbarVisible=!1,this.toolbarModule.annotationToolbarModule.showAnnotationToolbar()),this.toolbarModule.formDesignerToolbarModule.resetFormDesignerToolbar()):je(this.toolbarModule)||je(this.formDesignerModule)||!this.toolbarModule.formDesignerToolbarModule||this.isFormDesignerToolbarVisible||(this.isFormDesignerToolbarVisible=!1,this.formDesignerModule.setMode("edit"),this.toolbarModule.formDesignerToolbarModule.resetFormDesignerToolbar()));break;case"isAnnotationToolbarVisible":!F.isDevice||this.enableDesktopMode?this.toolbarModule&&this.annotationModule&&!t.isAnnotationToolbarVisible&&e.isAnnotationToolbarVisible&&(this.toolbarModule.formDesignerToolbarModule&&this.isFormDesignerToolbarVisible&&(this.isFormDesignerToolbarVisible=!1,this.toolbarModule.formDesignerToolbarModule.showFormDesignerToolbar()),this.toolbarModule.annotationToolbarModule.resetToolbar()):this.toolbarModule&&this.toolbar.showAnnotationToolbar(e.isAnnotationToolbarVisible);break;case"serviceUrl":je(e.serviceUrl)||""===e.serviceUrl?this.viewerBase.clientSideRendering=!0:this.viewerBase.clientSideRendering=!1;break;case"pageOrganizerSettings":je(e.pageOrganizerSettings)||(je(e.pageOrganizerSettings.canDelete)&&(this.pageOrganizerSettings.canDelete=!0),je(e.pageOrganizerSettings.canRotate)&&(this.pageOrganizerSettings.canRotate=!0),je(e.pageOrganizerSettings.canInsert)&&(this.pageOrganizerSettings.canInsert=!0),je(e.pageOrganizerSettings.canCopy)&&(this.pageOrganizerSettings.canCopy=!0),je(e.pageOrganizerSettings.canRearrange)&&(this.pageOrganizerSettings.canRearrange=!0),je(e.pageOrganizerSettings.canImport)&&(this.pageOrganizerSettings.canImport=!0))}}},p.prototype.renderCustomerStamp=function(e){this.annotation.stampAnnotationModule.isStampAddMode=!0,this.annotationModule.stampAnnotationModule.isStampAnnotSelected=!0,this.viewerBase.stampAdded=!0,this.viewerBase.isAlreadyAdded=!1,this.annotation.stampAnnotationModule.createCustomStampAnnotation(e.customStampImageSource,e.customStampName)},p.prototype.getPersistData=function(){return"PdfViewer"},p.prototype.requiredModules=function(){var e=[];return this.enableMagnification&&e.push({member:"Magnification",args:[this,this.viewerBase]}),this.enableNavigation&&e.push({member:"Navigation",args:[this,this.viewerBase]}),(this.enableToolbar||this.enableNavigationToolbar||this.enableAnnotationToolbar||this.enableFormDesignerToolbar)&&e.push({member:"Toolbar",args:[this,this.viewerBase]}),this.enableHyperlink&&e.push({member:"LinkAnnotation",args:[this,this.viewerBase]}),this.enableThumbnail&&e.push({member:"ThumbnailView",args:[this,this.viewerBase]}),this.enableBookmark&&e.push({member:"BookmarkView",args:[this,this.viewerBase]}),this.enableTextSelection&&e.push({member:"TextSelection",args:[this,this.viewerBase]}),this.enableTextSearch&&e.push({member:"TextSearch",args:[this,this.viewerBase]}),this.enablePrint&&e.push({member:"Print",args:[this,this.viewerBase]}),this.enableAnnotation&&e.push({member:"Annotation",args:[this,this.viewerBase]}),this.enableFormFields&&e.push({member:"FormFields",args:[this,this.viewerBase]}),this.enableFormDesigner&&!N&&e.push({member:"FormDesigner",args:[this,this.viewerBase]}),this.enableAccessibilityTags&&e.push({member:"AccessibilityTags",args:[this,this.viewerBase]}),!je(this.serviceUrl)&&""!==this.serviceUrl||e.push({member:"PdfRenderer",args:[this,this.viewerBase]}),this.enablePageOrganizer&&e.push({member:"PageOrganizer",args:[this,this.viewerBase]}),e},p.prototype.load=function(e,t){this.loadDocInternally(e,t)},p.prototype.loadDocInternally=function(e,t,i){var n;void 0===i&&(i=!0),0!==this.pageCount?this.viewerBase.clear(!0):this.viewerBase.clear(!1),this.pageCount=0,this.currentPageNumber=0,N?this.viewerBase.blazorUIAdaptor.resetToolbar():this.toolbarModule&&this.toolbarModule.resetToolbar(),this.isFormFieldsLoaded=!0,this.viewerBase.documentPathByteArray instanceof Uint8Array&&!this.viewerBase.clientSideRendering?(n=this.convertByteArrayToBase64(this.viewerBase.documentPathByteArray),this.viewerBase.initiatePageRender(n,t)):this.viewerBase.initiatePageRender(e,t,i)},p.prototype.convertByteArrayToBase64=function(e){for(var t="",i=e.byteLength,n=0;n<i;n++)t+=String.fromCharCode(e[parseInt(n.toString(),10)]);return btoa(t)},p.prototype.loadDocument=function(e,t,i){0!==this.pageCount?this.viewerBase.clear(!0):this.viewerBase.clear(!1),this.viewerBase.clear(!je(this.customContextMenuItems)),this.pageCount=0,this.currentPageNumber=0,this.viewerBase.blazorUIAdaptor.resetToolbar(),this.fileName=i,this.viewerBase.initiateLoadDocument(e,t,i)},p.prototype.loadSuccess=function(e,t){this.viewerBase.loadSuccess(e,t)},p.prototype.focusElement=function(e){e=document.getElementById(e);null!=e&&e.focus()},p.prototype.download=function(){this.enableDownload&&this.viewerBase.download()},p.prototype.saveAsBlob=function(){var i=this;return this.enableDownload?new Promise(function(e,t){e(i.viewerBase.saveAsBlob())}):null},p.prototype.updateViewerContainer=function(){this.viewerBase.updateViewerContainer()},p.prototype.getPageInfo=function(e){var t,i={};return!je(e)&&"number"==typeof e&&!je(this.viewerBase.pageSize)&&0!==this.viewerBase.pageSize.length&&0<=e&&e<this.viewerBase.pageSize.length&&(e=parseInt(e.toString(),10),t=this.viewerBase.pageSize[e],i.pageIndex=e,i.height=this.viewerBase.ConvertPixelToPoint(t.height),i.width=this.viewerBase.ConvertPixelToPoint(t.width),i.rotation=this.viewerBase.getAngle(t.rotation)),i},p.prototype.showNotificationPopup=function(e){this.viewerBase.showNotificationPopup(e)},p.prototype.focusFormField=function(t){var e,i=this;if("string"==typeof t)for(var n=this.retrieveFormFields(),o=0;o<n.length;o++)n[parseInt(o.toString(),10)].name===t&&(t=n[parseInt(o.toString(),10)]);t&&(this.viewerBase.isFocusField=!0,this.viewerBase.focusField=t,this.formDesignerModule?this.navigationModule.goToPage(t.pageIndex+1):(e=parseFloat(t.id.split("_")[1]),this.navigationModule.goToPage(e+1)),setTimeout(function(){var e=document.getElementById(t.id);(e=i.formDesignerModule&&"Checkbox"===t.type?document.getElementById(t.id+"_input"):e)&&(!i.formDesignerModule||"SignatureField"!==t.type&&"InitialField"!==t.type?(e.focus(),i.viewerBase.isFocusField=!1,i.viewerBase.focusField=[]):e.parentElement.focus())},100))},p.prototype.updateFormFieldsValue=function(n){var e=document.getElementById(n.id),t=!1;if(e)(e=e||document.getElementById(n.id+"_content_html_element").children[0].children[0])&&"Textbox"===n.type||"Password"===n.type||"PasswordField"===n.type?(e.value=n.value,e.multiline=n.isMultiline):"Checkbox"===n.type||"RadioButton"===n.type||"CheckBox"===n.type?("CheckBox"===n.type&&(e.style.appearance="auto"),this.formDesignerModule?"RadioButton"===n.type?(i={isSelected:n.isSelected},this.formDesignerModule.updateFormField(n,i)):(i={isChecked:n.isChecked},this.formDesignerModule.updateFormField(n,i)):"RadioButton"===n.type?e.selected=n.isSelected:e.checked=n.isChecked,e.value!=n.value&&(e.value=n.value)):"DropDown"!==n.type&&"ListBox"!==n.type&&"DropdownList"!==n.type||(this.formDesignerModule?(t=!0,i={options:n.value},this.formDesignerModule.updateFormField(n,i)):(e.value=n.value,e.selectedIndex=n.selectedIndex)),"SignatureField"===n.type||"InitialField"===n.type?((n.signatureType||n.initialType)&&"string"!=typeof n.signatureType&&(n.signatureType=n.initialType),n.fontName=n.fontName||n.fontFamily,i=n.value,s=this.getFormFieldByID(n.id),s=this.formDesignerModule?s.value===n.value:s.Value===n.value,e.classList.contains("e-pdfviewer-signatureformfields-signature")&&!s&&(this.formDesignerModule?this.annotation.deleteAnnotationById(n.id.split("_")[0]+"_content"):this.annotation.deleteAnnotationById(n.id)),n.signatureType&&n.value||(n.value=i,this.viewerBase.isSignaturePathData(n.value)?(n.signatureType="Path",e.signatureType="Path"):this.viewerBase.isSignatureImageData(n.value)?(n.signatureType="Image",e.signatureType="Image"):(n.signatureType="Type",e.signatureType="Type")),n.tooltip&&(e.tooltip=n.tooltip),e.Required=n.isRequired||!1,s||this.formFieldsModule.drawSignature(n.signatureType,n.value,e,n.fontName,n.signatureBounds)):t||this.formFieldsModule.updateDataInSession(e);else{var i=this.viewerBase.getItemFromSessionStorage("_formDesigner");if(!je(i)){var o,r=JSON.parse(i),s=this.viewerBase.formFieldCollection.filter(function(e){return e.FormField.id.split("_")[0]===n.id});"Path"===n.signatureType&&(o=cbt(rbt(n.value))),s.forEach(function(e){e.FormField.signatureType=n.signatureType,"Path"===n.signatureType?e.FormField.value=JSON.stringify(o):e.FormField.value=n.value});for(var a=0;a<r.length;a++)if(r[parseInt(a.toString(),10)].FormField.id.split("_")[0]===n.id){"Path"===n.signatureType?r[parseInt(a.toString(),10)].FormField.value=JSON.stringify(o):r[parseInt(a.toString(),10)].FormField.value=n.value,r[parseInt(a.toString(),10)].FormField.signatureType=n.signatureType,this.viewerBase.setItemInSessionStorage(r,"_formDesigner");break}}t=this.viewerBase.getItemFromSessionStorage("_formfields");if(!je(t)){for(var r=JSON.parse(t),l=this,a=0;a<r.length;a++)!function(e){var t=r[parseInt(e.toString(),10)],i="Checkbox"!==n.type&&"RadioButton"!==n.type&&"CheckBox"!==n.type&&("DropDown"===n.type||"ListBox"===n.type||"DropdownList"===n.type)?t.Text:t.FieldName,e=r.filter(function(e){return e.FieldName===t.FieldName.split("_")[0]});je(e)||je(e[0])||"SignatureField"!==e[0].Name&&"InitialField"!==e[0].Name||(i=t.FieldName.split("_")[0],t.LineBounds=r.filter(function(e){return e.FieldName===i})[0].LineBounds),i===n.name&&("Textbox"===n.type||"Password"===n.type||"PasswordField"===n.type?n.value&&(t.Text=n.value,t.Value=n.value):"Checkbox"===n.type||"RadioButton"===n.type||"CheckBox"===n.type?(n.isSelected||n.isChecked?t.Selected=!0:t.Selected=!1,t.Value=n.value):"DropDown"===n.type||"ListBox"===n.type||"DropdownList"===n.type?(t.SelectedValue=n.value,e=t.TextList?t.TextList.indexOf(n.value):0,t.selectedIndex=-1<e?e:0,"ListBox"===n.type?t.SelectedListed=[t.selectedIndex]:t.SelectedListed=[]):"SignatureField"!==n.type&&"InitialField"!==n.type||n.value&&(t.Value=n.value,t=l.updateSignatureValue(t,n,n.signatureBounds)),l.formFieldsModule.updateFormFieldsCollection(t))}(a);ARt.sessionStorageManager.removeItem(this.viewerBase.documentId+"_formfields"),this.viewerBase.setItemInSessionStorage(r,"_formfields")}}},p.prototype.getFormFieldByID=function(t){var e;return this.formDesignerModule?this.nameTable[t.split("_")[0]]:(e=ARt.sessionStorageManager.getItem(this.viewerBase.documentId+"_formfields"),(e=JSON.parse(e))[e.findIndex(function(e){return e.uniqueID===t})])},p.prototype.ConvertPointToPixel=function(e){return e*(96/72)},p.prototype.updateSignatureValue=function(e,t,i){t.signatureType||(t.signatureType=this.viewerBase.isSignatureImageData(t.value)?"Image":this.viewerBase.isSignaturePathData(t.value)?"Path":"Type");var n,o,r,s,a,l,h=e.LineBounds,d=this.ConvertPointToPixel(h.X),p=this.ConvertPointToPixel(h.Y),c=this.ConvertPointToPixel(h.Width),h=this.ConvertPointToPixel(h.Height);return"Type"===t.signatureType?(e.FontFamily||(e.FontFamily="Helvetica"),r=this.formFieldsModule.getSignBounds(e.pageIndex,e.RotationAngle,e.pageIndex,this.viewerBase.getZoomFactor(),d,p,c,h),"Default"===this.signatureFitMode&&(r=this.formFieldsModule.getDefaultBoundsforSign(r)),n=(e.Bounds=r).height/1.35,o=1,(l=this.formFieldsModule.getTextWidth(e.value,n,e.FontFamily))>r.width&&(o=r.width/l),e.FontSize=this.formFieldsModule.getFontSize(Math.floor(n*o))):"Image"===t.signatureType?(r=this.formFieldsModule.getSignBounds(e.pageIndex,e.RotationAngle,e.pageIndex,this.viewerBase.getZoomFactor(),d,p,c,h),(s=new Image).src=e.Value,a=this,s.onload=function(){a.imageOnLoad(r,s,e)}):(-1!==e.Value.indexOf("base64")?(r=this.formFieldsModule.getSignBounds(e.pageIndex,e.RotationAngle,e.pageIndex,this.viewerBase.getZoomFactor(),d,p,c,h),"Default"===this.signatureFitMode&&(r=this.formFieldsModule.getDefaultBoundsforSign(r))):je(i)?"Default"===this.signatureFitMode?(l=this.viewerBase.signatureModule.updateSignatureAspectRatio(e.Value,!1,null,e),(r=this.formFieldsModule.getSignBounds(e.pageIndex,e.RotationAngle,e.pageIndex,this.viewerBase.getZoomFactor(),d,p,l.width,l.height,!0)).x=r.x+l.left,r.y=r.y+l.top):r=this.formFieldsModule.getSignBounds(e.pageIndex,e.RotationAngle,e.pageIndex,this.viewerBase.getZoomFactor(),d,p,c,h):r=i,e.Bounds=r),e},p.prototype.imageOnLoad=function(e,t,i){if("Default"===this.signatureFitMode){var n=Math.min(e.height/this.paddingDifferenceValue,e.width/this.paddingDifferenceValue),o=e.height-n,n=e.width-n,r=t.width,t=t.height,s=e.width,a=e.height,n=Math.min(n/r,o/t),o=(e.width=r*n,e.height=t*n,e.x=e.x+(s-e.width)/2,e.y=e.y+(a-e.height)/2,this.viewerBase.getItemFromSessionStorage("_formfields"));if(o){for(var l=JSON.parse(o),h=0;h<l.length;h++)l[parseInt(h.toString(),10)].FieldName===i.FieldName&&(l[parseInt(h.toString(),10)].Bounds=e,this.formFieldsModule.updateFormFieldsCollection(l[parseInt(h.toString(),10)]));ARt.sessionStorageManager.removeItem(this.viewerBase.documentId+"_formfields"),this.viewerBase.setItemInSessionStorage(l,"_formfields")}}},p.prototype.undo=function(){this.annotationModule?this.annotationModule.undo():this.viewerBase.getModuleWarningMessage("Annotation")},p.prototype.redo=function(){this.annotationModule?this.annotationModule.redo():this.viewerBase.getModuleWarningMessage("Annotation")},p.prototype.unload=function(){je(this.viewerBase.pdfViewerRunner)||this.viewerBase.isPasswordProtected||this.viewerBase.pdfViewerRunner.addTask({message:"unloadFPDF"},yRt.High),this.viewerBase.clear(!0),this.pageCount=0,N?this.viewerBase.blazorUIAdaptor.resetToolbar():this.toolbarModule&&(this.viewerBase.pageCount=0,this.toolbarModule.resetToolbar()),this.fileByteArray&&(this.fileByteArray=null),this.magnificationModule&&this.magnificationModule.zoomTo(100),this.viewerBase.hyperlinkAndLinkAnnotation&&(this.viewerBase.hyperlinkAndLinkAnnotation={}),this.viewerBase.pageTextDetails&&(this.viewerBase.pageTextDetails={}),this.textSearchModule&&this.textSearchModule.showSearchBox(!1)},p.prototype.destroy=function(){k2t.prototype.destroy.call(this),je(this.element)||(this.refreshing||this.element.classList.remove("e-pdfviewer"),this.element.innerHTML=""),this.viewerBase.navigationPane&&(this.viewerBase.navigationPane.restrictUpdateZoomValue=!1),this.viewerBase.destroy(),this.viewerBase.navigationPane&&(this.viewerBase.navigationPane.restrictUpdateZoomValue=!0)},p.prototype.importAnnotation=function(e,t){if(this.annotationModule)if("string"==typeof e){var i=-1<e.indexOf(".xfdf")||-1<t.indexOf("Xfdf");t?-1<e.indexOf("</xfdf>")?this.viewerBase.importAnnotations(e,t,!1):"Json"==t?!e.includes("pdfAnnotation")&&"json"===e.split(".")[1]?(this.viewerBase.isPDFViewerJson=!0,this.viewerBase.importAnnotations(e,t,i)):this.importAnnotationsAsJson(e):this.viewerBase.importAnnotations(e,t,i):"json"===e.split(".")[1]?(e.includes("pdfAnnotation")||(t=e.split(",")[1]?e.split(",")[1]:e.split(",")[0],e=decodeURIComponent(escape(atob(t)))),this.importAnnotationsAsJson(e)):this.viewerBase.importAnnotations(e,LCt.Xfdf,i)}else{t=e.pdfAnnotation;if("object"==typeof e&&!je(t)&&!je(Object.keys(t))&&!je(Object.keys(t)[0])&&1<Object.keys(t[Object.keys(t)[0]]).length)this.viewerBase.importAnnotations(e);else if(e=JSON.stringify(e),this.viewerBase.isPDFViewerJson=!1,this.viewerBase.clientSideRendering){for(var n=(new TextEncoder).encode(e),o="",r=0;r<n.length;r+=65536)o+=String.fromCharCode.apply(String,Array.from(n.subarray(r,r+65536)));this.viewerBase.importAnnotations(btoa(o),LCt.Json)}else this.viewerBase.importAnnotations(btoa(e),LCt.Json)}else this.viewerBase.getModuleWarningMessage("Annotation")},p.prototype.importAnnotationsAsJson=function(e){var t=JSON.parse(e),i=t.pdfAnnotation[Object.keys(t.pdfAnnotation)[0]];1<=Object.keys(t.pdfAnnotation).length&&(i.textMarkupAnnotation||i.measureShapeAnnotation||i.freeTextAnnotation||i.stampAnnotations||i.signatureInkAnnotation||i.shapeAnnotation&&i.shapeAnnotation[0].Bounds)?(this.viewerBase.isPDFViewerJson=!0,this.viewerBase.importAnnotations(t,LCt.Json)):(this.viewerBase.isPDFViewerJson=!1,this.viewerBase.importAnnotations(btoa(e),LCt.Json))},p.prototype.exportAnnotation=function(e){this.annotationModule?e&&"Xfdf"===e?this.viewerBase.exportAnnotations(LCt.Xfdf):this.viewerBase.exportAnnotations(LCt.Json):this.viewerBase.getModuleWarningMessage("Annotation")},p.prototype.exportAnnotationsAsObject=function(i){var n=this,e=(void 0===i&&(i=LCt.Json),this.viewerBase.updateExportItem());return this.annotationModule&&e?new Promise(function(t,e){n.viewerBase.exportAnnotationsAsObject(i).then(function(e){t(e)})}):new Promise(function(e){e(null)})},p.prototype.exportAnnotationsAsBase64String=function(i){var n=this;return this.annotationModule?new Promise(function(t,e){n.viewerBase.createRequestForExportAnnotations(!1,i,!0).then(function(e){t(e)})}):null},p.prototype.addAnnotation=function(e){this.viewerBase&&this.viewerBase.addAnnotation(e)},p.prototype.importFormFields=function(e,t){this.formFieldsModule?(je(t)&&(t=RCt.Json),this.viewerBase.importFormFields(e,t)):this.viewerBase.getModuleWarningMessage("FormFields")},p.prototype.exportFormFields=function(e,t){this.formFieldsModule?this.viewerBase.exportFormFields(e,t):this.viewerBase.getModuleWarningMessage("FormFields")},p.prototype.exportFormFieldsAsObject=function(i){var n=this;return void 0===i&&(i=RCt.Json),this.formFieldsModule?new Promise(function(t,e){n.viewerBase.exportFormFieldsAsObject(i).then(function(e){t(e)})}):null},p.prototype.resetFormFields=function(){this.formFieldsModule.resetFormFields()},p.prototype.clearFormFields=function(e){this.formFieldsModule.clearFormFields(e)},p.prototype.deleteAnnotations=function(){this.annotationModule?this.viewerBase.deleteAnnotations():this.viewerBase.getModuleWarningMessage("Annotation")},p.prototype.retrieveFormFields=function(){return this.formFieldCollections},p.prototype.updateFormFields=function(e){this.updateFormFieldsValue(e),this.formFieldsModule.updateFormFieldValues(e)},p.prototype.fireResourcesLoaded=function(){this.trigger("resourcesLoaded")},p.prototype.fireAjaxRequestInitiate=function(e){this.trigger("ajaxRequestInitiate",{name:"ajaxRequestInitiate",JsonData:e})},p.prototype.firePageRenderInitiate=function(e){this.trigger("pageRenderInitiate",{name:"pageRenderInitiate",jsonData:e})},p.prototype.fireButtonFieldClickEvent=function(e,t,i){this.trigger("buttonFieldClick",{name:"buttonFieldClicked",buttonFieldValue:e,buttonFieldName:t,id:i})},p.prototype.fireFormFieldClickEvent=function(o,r,s,a){return jRt(this,void 0,void 0,function(){var t,i,n;return WRt(this,function(e){switch(e.label){case 0:return(t={name:o,field:r,cancel:s},N)?[4,this.triggerEvent("formFieldClick",t)]:[3,2];case 1:return(t=e.sent()||t).field.type=r.type,[3,3];case 2:this.triggerEvent("formFieldClick",t),e.label=3;case 3:return("SignatureField"===r.type||"InitialField"===r.type)&&("InitialField"===r.type?this.viewerBase.isInitialField=!0:this.viewerBase.isInitialField=!1,"hidden"===(i=document.getElementById(r.id)).style.visibility&&(i.disabled=!0),i=i||(document.getElementById(r.id+"_content_html_element")?document.getElementById(r.id+"_content_html_element").children[0].children[0]:null),n=this.formFieldCollections.filter(function(e){return e.id===r.id}))&&((n=n[0].isReadOnly)||t.cancel||!i||i.disabled||!i.classList.contains("e-pdfviewer-signatureformfields")||!a&&!je(a)?n&&(i.disabled=!0):this.viewerBase.signatureModule.showSignatureDialog(!0)),[2]}})})},p.prototype.fireFormFieldAddEvent=function(e,t,i){e={name:e,field:t,pageIndex:i};this.viewerBase.isFormFieldSelect=!1,this.trigger("formFieldAdd",e)},p.prototype.fireFormFieldRemoveEvent=function(e,t,i){this.trigger("formFieldRemove",{name:e,field:t,pageIndex:i})},p.prototype.fireFormFieldDoubleClickEvent=function(e){return this.trigger("formFieldDoubleClick",e),e},p.prototype.fireFormFieldPropertiesChangeEvent=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u,g,m,f,y,v,b,w,C){e={name:e,field:t,pageIndex:i,isValueChanged:n,isFontFamilyChanged:o,isFontSizeChanged:r,isFontStyleChanged:s,isColorChanged:a,isBackgroundColorChanged:l,isBorderColorChanged:h,isBorderWidthChanged:d,isAlignmentChanged:p,isReadOnlyChanged:c,isVisibilityChanged:u,isMaxLengthChanged:g,isRequiredChanged:m,isPrintChanged:f,isToolTipChanged:y,oldValue:b,newValue:w,isNameChanged:!je(C)&&C,isCustomDataChanged:v};this.trigger("formFieldPropertiesChange",e)},p.prototype.fireFormFieldMouseLeaveEvent=function(e,t,i){this.trigger("formFieldMouseLeave",{name:e,field:t,pageIndex:i})},p.prototype.fireFormFieldMouseoverEvent=function(e,t,i,n,o,r,s){this.trigger("formFieldMouseover",{name:e,field:t,pageIndex:i,pageX:n,pageY:o,X:r,Y:s})},p.prototype.fireFormFieldMoveEvent=function(e,t,i,n,o){this.trigger("formFieldMove",{name:e,field:t,pageIndex:i,previousPosition:n,currentPosition:o})},p.prototype.fireFormFieldResizeEvent=function(e,t,i,n,o){this.trigger("formFieldResize",{name:e,field:t,pageIndex:i,previousPosition:n,currentPosition:o})},p.prototype.fireFormFieldSelectEvent=function(e,t,i,n){this.trigger("formFieldSelect",{name:e,field:t,pageIndex:i,isProgrammaticSelection:n})},p.prototype.fireFormFieldUnselectEvent=function(e,t,i){this.trigger("formFieldUnselect",{name:e,field:t,pageIndex:i})},p.prototype.fireDocumentLoad=function(e){e={name:"documentLoad",documentName:this.fileName,pageData:e};this.trigger("documentLoad",e),N&&(this._dotnetInstance.invokeMethodAsync("LoadDocument",null),this.viewerBase.blazorUIAdaptor.loadDocument())},p.prototype.fireDocumentUnload=function(e){this.trigger("documentUnload",{name:"documentUnload",documentName:e})},p.prototype.fireDocumentLoadFailed=function(e,t){e={name:"documentLoadFailed",documentName:this.fileName,isPasswordRequired:e,password:t};this.trigger("documentLoadFailed",e)},p.prototype.fireAjaxRequestFailed=function(e,t,i,n){e={name:"ajaxRequestFailed",documentName:this.fileName,errorStatusCode:e,errorMessage:t,action:i};n&&(e.retryCount=!0),this.trigger("ajaxRequestFailed",e)},p.prototype.fireAjaxRequestSuccess=function(e,t){e={name:"ajaxRequestSuccess",documentName:this.fileName,action:e,data:t,cancel:!1};return this.trigger("ajaxRequestSuccess",e),!!e.cancel},p.prototype.firePageRenderComplete=function(e){e={name:"pageRenderComplete",documentName:this.fileName,data:e};this.trigger("pageRenderComplete",e)},p.prototype.fireValidatedFailed=function(e){var t;N?((t={}).documentName=this.fileName,t.formFields=this.formFieldCollections,t.nonFillableFields=this.viewerBase.nonFillableFields):t={formField:this.formFieldCollections,documentName:this.fileName,nonFillableFields:this.viewerBase.nonFillableFields},this.trigger("validateFormFields",t)},p.prototype.firePageClick=function(e,t,i){e={name:"pageClick",documentName:this.fileName,x:e,y:t,pageNumber:i};this.trigger("pageClick",e)},p.prototype.firePageChange=function(e){e={name:"pageChange",documentName:this.fileName,currentPageNumber:this.currentPageNumber,previousPageNumber:e};this.trigger("pageChange",e),N&&this.viewerBase.blazorUIAdaptor.pageChanged(this.currentPageNumber)},p.prototype.fireZoomChange=function(){var e={name:"zoomChange",zoomValue:100*this.magnificationModule.zoomFactor,previousZoomValue:100*this.magnificationModule.previousZoomFactor};this.trigger("zoomChange",e)},p.prototype.fireHyperlinkClick=function(i,n){return jRt(this,void 0,void 0,function(){var t;return WRt(this,function(e){switch(e.label){case 0:return(t={name:"hyperlinkClick",hyperlink:i,hyperlinkElement:n,cancel:!1},N)?[4,this.triggerEvent("hyperlinkClick",t)]:[3,2];case 1:return t=e.sent()||t,[3,3];case 2:this.triggerEvent("hyperlinkClick",t),e.label=3;case 3:return t.hyperlinkElement.href!==t.hyperlink&&(n.href=t.hyperlink),t.cancel?[2,!1]:[2,!0]}})})},p.prototype.fireHyperlinkHover=function(e){this.trigger("hyperlinkMouseOver",{name:"hyperlinkMouseOver",hyperlinkElement:e})},p.prototype.fireFocusOutFormField=function(e,t){this.trigger("formFieldFocusOut",{name:"formFieldFocusOut",fieldName:e,value:t})},p.prototype.fireAnnotationAdd=function(e,t,i,n,o,r,s,a,l,h,d){e={name:"annotationAdd",pageIndex:e,annotationId:t,annotationType:i,annotationBound:n,annotationSettings:o};r&&(N?(e.annotationSettings.textMarkupContent=r,e.annotationSettings.textMarkupStartIndex=s,e.annotationSettings.textMarkupEndIndex=a):(e.textMarkupContent=r,e.textMarkupStartIndex=s,e.textMarkupEndIndex=a)),l&&(e.labelSettings=l),h&&(e.multiplePageCollection=h),"Image"===i&&(e.customStampName=d),this.viewerBase.isAnnotationSelect=!1,this.trigger("annotationAdd",e),N&&this.viewerBase.blazorUIAdaptor.annotationAdd()},p.prototype.fireAnnotationRemove=function(e,t,i,n,o,r,s,a){e={name:"annotationRemove",pageIndex:e,annotationId:t,annotationType:i,annotationBounds:n};o&&(e.textMarkupContent=o,e.textMarkupStartIndex=r,e.textMarkupEndIndex=s),a&&(e.multiplePageCollection=a),this.trigger("annotationRemove",e)},p.prototype.fireBeforeAddFreeTextAnnotation=function(e){this.trigger("beforeAddFreeText",{name:"beforeAddFreeText",value:e})},p.prototype.fireCommentAdd=function(e,t,i){this.trigger("commentAdd",{name:"CommentAdd",id:e,text:t,annotation:i})},p.prototype.fireCommentEdit=function(e,t,i){this.trigger("commentEdit",{name:"CommentEdit",id:e,text:t,annotation:i})},p.prototype.fireCommentDelete=function(e,t,i){this.trigger("commentDelete",{name:"CommentDelete",id:e,text:t,annotation:i})},p.prototype.fireCommentSelect=function(e,t,i){this.trigger("commentSelect",{name:"CommentSelect",id:e,text:t,annotation:i})},p.prototype.fireCommentStatusChanged=function(e,t,i,n){this.trigger("commentStatusChanged",{name:"CommentStatusChanged",id:e,text:t,annotation:i,status:n})},p.prototype.fireAnnotationPropertiesChange=function(e,t,i,n,o,r,s,a,l,h,d){e={name:"annotationPropertiesChange",pageIndex:e,annotationId:t,annotationType:i,isColorChanged:n,isOpacityChanged:o,isTextChanged:r,isCommentsChanged:s};a&&(e.textMarkupContent=a,e.textMarkupStartIndex=l,e.textMarkupEndIndex=h),d&&(e.multiplePageCollection=d),this.trigger("annotationPropertiesChange",e)},p.prototype.fireSignatureAdd=function(e,t,i,n,o,r,s,a){e={pageIndex:e,id:t,type:i,bounds:n,opacity:o};s&&(e.thickness=s),r&&(e.strokeColor=r),a&&(e.data=a),this.trigger("addSignature",e)},p.prototype.fireSignatureRemove=function(e,t,i,n){this.trigger("removeSignature",{pageIndex:e,id:t,type:i,bounds:n})},p.prototype.fireSignatureMove=function(e,t,i,n,o,r,s,a){this.trigger("moveSignature",{pageIndex:e,id:t,type:i,opacity:n,strokeColor:o,thickness:r,previousPosition:s,currentPosition:a})},p.prototype.fireSignaturePropertiesChange=function(e,t,i,n,o,r,s,a){this.trigger("signaturePropertiesChange",{pageIndex:e,id:t,type:i,isStrokeColorChanged:n,isOpacityChanged:o,isThicknessChanged:r,oldValue:s,newValue:a})},p.prototype.fireSignatureResize=function(e,t,i,n,o,r,s,a){this.trigger("resizeSignature",{pageIndex:e,id:t,type:i,opacity:n,strokeColor:o,thickness:r,currentPosition:s,previousPosition:a})},p.prototype.fireSignatureSelect=function(e,t,i){this.trigger("signatureSelect",{id:e,pageIndex:t,signature:i})},p.prototype.fireSignatureUnselect=function(e,t,i){this.trigger("signatureUnselect",{id:e,pageIndex:t,signature:i})},p.prototype.fireAnnotationSelect=function(e,t,i,n,o,r,s){n=n?{name:"annotationSelect",annotationId:e,pageIndex:t,annotation:i,annotationCollection:n}:{name:"annotationSelect",annotationId:e,pageIndex:t,annotation:i};o&&(n.multiplePageCollection=o),r&&(n.isProgrammaticSelection=r),s&&(n.annotationAddMode=s),N&&("FreeText"===i.type&&(e={isBold:!1,isItalic:!1,isStrikeout:!1,isUnderline:!1},1===i.fontStyle?e.isBold=!0:2===i.fontStyle?e.isItalic=!0:3===i.fontStyle?e.isStrikeout=!0:4===i.fontStyle&&(e.isUnderline=!0),i.fontStyle=e),this.viewerBase.blazorUIAdaptor.annotationSelect(i.type)),this.trigger("annotationSelect",n)},p.prototype.fireAnnotationUnSelect=function(e,t,i){N&&this.viewerBase.blazorUIAdaptor.annotationUnSelect(),this.trigger("annotationUnSelect",{name:"annotationUnSelect",annotationId:e,pageIndex:t,annotation:i})},p.prototype.fireAnnotationDoubleClick=function(e,t,i){this.trigger("annotationDoubleClick",{name:"annotationDblClick",annotationId:e,pageIndex:t,annotation:i})},p.prototype.fireTextSelectionStart=function(e){this.isTextSelectionStarted=!0,this.trigger("textSelectionStart",{pageIndex:e})},p.prototype.fireTextSelectionEnd=function(e,t,i){this.isTextSelectionStarted&&(this.trigger("textSelectionEnd",{pageIndex:e,textContent:t,textBounds:i}),this.isTextSelectionStarted=!1)},p.prototype.renderDrawing=function(e,t){je(t)&&!je(this.viewerBase.activeElements.activePageID)&&0<=this.viewerBase.activeElements.activePageID&&!this.viewerBase.isPrint&&(t=this.viewerBase.activeElements.activePageID),this.annotation?this.annotation.renderAnnotations(t,null,null,null,e):this.formDesignerModule&&this.formDesignerModule.updateCanvas(t,e)},p.prototype.fireAnnotationResize=function(e,t,i,n,o,r,s,a,l,h){e={name:"annotationResize",pageIndex:e,annotationId:t,annotationType:i,annotationBound:n,annotationSettings:o};r&&(e.textMarkupContent=r,e.textMarkupStartIndex=s,e.textMarkupEndIndex=a),l&&(e.labelSettings=l),h&&(e.multiplePageCollection=h),this.trigger("annotationResize",e)},p.prototype.fireAnnotationMoving=function(e,t,i,n,o,r){this.trigger("annotationMoving",{name:"annotationMoving",pageIndex:e,annotationId:t,annotationType:i,annotationSettings:n,previousPosition:o,currentPosition:r})},p.prototype.fireAnnotationMove=function(e,t,i,n,o,r){this.trigger("annotationMove",{name:"annotationMove",pageIndex:e,annotationId:t,annotationType:i,annotationSettings:n,previousPosition:o,currentPosition:r})},p.prototype.fireAnnotationMouseover=function(e,t,i,n,o,r,s){e={name:"annotationMouseover",annotationId:e,pageIndex:t,annotationType:i,annotationBounds:n,annotation:o,pageX:r.left,pageY:r.top,X:s.left,Y:s.top};N&&("Perimeter calculation"===o.subject?e.annotationType="Perimeter":"Area calculation"===o.subject?e.annotationType="Area":"Volume calculation"===o.subject?e.annotationType="Volume":"Arrow"===o.subject?e.annotationType="Arrow":"Circle"===o.subject&&(e.annotationType="Circle")),this.trigger("annotationMouseover",e)},p.prototype.fireAnnotationMouseLeave=function(e){this.trigger("annotationMouseLeave",{name:"annotationMouseLeave",pageIndex:e})},p.prototype.firePageMouseover=function(e,t){this.trigger("pageMouseover",{pageX:e,pageY:t})},p.prototype.fireDownloadStart=function(e){e={fileName:e,cancel:!1};return this.trigger("downloadStart",e),!e.cancel},p.prototype.fireDownloadEnd=function(e,t){this.trigger("downloadEnd",{fileName:e,downloadDocument:t})},p.prototype.firePrintStart=function(){return jRt(this,void 0,void 0,function(){var t;return WRt(this,function(e){switch(e.label){case 0:return t={fileName:this.downloadFileName,cancel:!1},[4,this.triggerEvent("printStart",t)];case 1:return t=e.sent()||t,[3,3];case 2:this.triggerEvent("printStart",t),e.label=3;case 3:return t.cancel||this.printModule.print(),[2]}})})},p.prototype.triggerEvent=function(i,n){return jRt(this,void 0,void 0,function(){var t;return WRt(this,function(e){switch(e.label){case 0:return[4,this.trigger(i,n)];case 1:return[2,t="string"==typeof(t=e.sent())?JSON.parse(t):t]}})})},p.prototype.firePrintEnd=function(e){this.trigger("printEnd",{fileName:e})},p.prototype.fireThumbnailClick=function(e){this.trigger("thumbnailClick",{name:"thumbnailClick",pageNumber:e})},p.prototype.fireCustomToolbarClickEvent=function(t){return jRt(this,void 0,void 0,function(){return WRt(this,function(e){return this.trigger("toolbarClick",t),[2]})})},p.prototype.fireBookmarkClick=function(e,t,i,n){this.trigger("bookmarkClick",{name:"bookmarkClick",pageNumber:e,position:t,text:i,fileName:n})},p.prototype.fireImportStart=function(e){this.trigger("importStart",{name:"importAnnotationsStart",importData:e,formFieldData:null})},p.prototype.fireExportStart=function(e){e={name:"exportAnnotationsStart",exportData:e,formFieldData:null,cancel:!1};return this.trigger("exportStart",e),!e.cancel},p.prototype.fireImportSuccess=function(e){this.trigger("importSuccess",{name:"importAnnotationsSuccess",importData:e,formFieldData:null})},p.prototype.fireExportSuccess=function(e,t){this.trigger("exportSuccess",{name:"exportAnnotationsSuccess",exportData:e,fileName:t,formFieldData:null})},p.prototype.fireImportFailed=function(e,t){this.trigger("importFailed",{name:"importAnnotationsFailed",importData:e,errorDetails:t,formFieldData:null})},p.prototype.fireExportFailed=function(e,t){this.trigger("exportFailed",{name:"exportAnnotationsFailed",exportData:e,errorDetails:t,formFieldData:null})},p.prototype.fireFormImportStarted=function(e){this.trigger("importStart",{name:"importFormFieldsStart",importData:null,formFieldData:e})},p.prototype.fireFormExportStarted=function(e){e={name:"exportFormFieldsStart",exportData:null,formFieldData:e,cancel:!1};return this.trigger("exportStart",e),!e.cancel},p.prototype.fireFormImportSuccess=function(e){this.trigger("importSuccess",{name:"importFormFieldsSuccess",importData:e,formFieldData:e})},p.prototype.fireFormExportSuccess=function(e,t){this.trigger("exportSuccess",{name:"exportFormFieldsSuccess",exportData:e,fileName:t,formFieldData:e})},p.prototype.fireFormImportFailed=function(e,t){this.trigger("importFailed",{name:"importFormFieldsfailed",importData:e,errorDetails:t,formFieldData:e})},p.prototype.fireFormExportFailed=function(e,t){this.trigger("exportFailed",{name:"exportFormFieldsFailed",exportData:e,errorDetails:t,formFieldData:e})},p.prototype.fireTextExtractionCompleted=function(e){var t=[];if(this.extractTextOption===ECt.TextAndBounds)t=e;else if(this.extractTextOption===ECt.None)t=[];else for(var i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)][parseInt(i.toString(),10)];switch(t[parseInt(i.toString(),10)]||(t[parseInt(i.toString(),10)]={}),this.extractTextOption){case ECt.TextOnly:t[parseInt(i.toString(),10)][parseInt(i.toString(),10)]={PageSize:n.PageSize,PageText:n.PageText};break;case ECt.BoundsOnly:t[parseInt(i.toString(),10)][parseInt(i.toString(),10)]={PageSize:n.PageSize,TextData:n.TextData}}}this.trigger("extractTextCompleted",{documentTextCollection:t})},p.prototype.fireTextSearchStart=function(e,t){this.trigger("textSearchStart",{name:"textSearchStart",searchText:e,matchCase:t})},p.prototype.fireTextSearchComplete=function(e,t){this.trigger("textSearchComplete",{name:"textSearchComplete",searchText:e,matchCase:t})},p.prototype.fireTextSearchHighlight=function(e,t,i,n){this.trigger("textSearchHighlight",{name:"textSearchHighlight",searchText:e,matchCase:t,bounds:i,pageNumber:n})},p.prototype.firecustomContextMenuSelect=function(e){this.trigger("customContextMenuSelect",{id:e})},p.prototype.firecustomContextMenuBeforeOpen=function(e){this.trigger("customContextMenuBeforeOpen",{ids:e})},p.prototype.fireKeyboardCustomCommands=function(e){this.trigger("keyboardCustomCommands",{keyboardCommand:e})},p.prototype.firePageOrganizerSaveAsEventArgs=function(e,t){e={fileName:e,downloadDocument:t,cancel:!1};return this.trigger("pageOrganizerSaveAs",e),!e.cancel},p.prototype.renderAdornerLayer=function(e,t,i,n){HCt(e,t,i,n,this)},p.prototype.renderSelector=function(e,t){this.drawing.renderSelector(e,t)},p.prototype.select=function(e,t,i,n){var o,r,s=this.allowServerDataBinding;if(this.enableServerDataBinding(!1),this.annotationModule&&(o=(o=this.annotationModule.textMarkupAnnotationModule)&&o.selectTextMarkupCurrentPage,a=this.selectedItems.annotations[0],o&&(r=this.annotationModule.textMarkupAnnotationModule.currentTextMarkupAnnotation,this.annotationModule.textMarkupAnnotationModule.clearCurrentAnnotationSelection(o,!0),this.fireAnnotationUnSelect(r.annotName,r.pageNumber,r)),i||this.viewerBase.activeElements&&0<=this.viewerBase.activeElements.activePageID&&!this.viewerBase.isNewStamp&&a&&"HandWrittenSignature"!==a.shapeAnnotationType&&"SignatureText"!==a.shapeAnnotationType&&"SignatureImage"!==a.shapeAnnotationType&&this.fireAnnotationUnSelect(a.annotName,a.pageIndex,a)),this.viewerBase.signatureModule){var a=this.selectedItems.annotations[0];if(!i){var l=this.selectedItems;if(l.annotations.length)for(var h=0;h<l.annotations.length;h++){var d=l.annotations[parseInt(h.toString(),10)];this.viewerBase.activeElements&&0<=this.viewerBase.activeElements.activePageID&&(this.viewerBase.isNewSignatureAdded||"HandWrittenSignature"!==a.shapeAnnotationType&&"SignatureText"!==a.shapeAnnotationType&&"SignatureImage"!==a.shapeAnnotationType||this.annotationModule.unselectSignature(d.signatureName,d.pageIndex,d))}}}this.formDesignerModule&&(o=this.selectedItems.formFields[0])&&this.formDesignerModule&&o&&o.formFieldAnnotationType&&(r={name:o.name,id:o.id,value:o.value,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,color:o.color,backgroundColor:o.backgroundColor,borderColor:o.borderColor,thickness:o.thickness,alignment:o.alignment,isReadonly:o.isReadonly,visibility:o.visibility,maxLength:o.maxLength,isRequired:o.isRequired,isPrint:o.isPrint,rotation:o.rotateAngle,tooltip:o.tooltip,options:o.options,isChecked:o.isChecked,isSelected:o.isSelected},this.fireFormFieldUnselectEvent("formFieldUnselect",r,o.pageIndex));var p=this;this.viewerBase.renderedPagesList.forEach(function(e){p.clearSelection(e)}),this.drawing.select(e,t,i,n),this.enableServerDataBinding(s,!0)},p.prototype.getPageTable=function(e){return this.drawing.getPageTable(e)},p.prototype.dragSelectedObjects=function(e,t,i,n,o){return this.drawing.dragSelectedObjects(e,t,i,n,o)},p.prototype.scaleSelectedItems=function(e,t,i){return this.drawing.scaleSelectedItems(e,t,i)},p.prototype.dragConnectorEnds=function(e,t,i,n,o,r,s){return this.drawing.dragConnectorEnds(e,t,i,n,o,null,s)},p.prototype.clearSelection=function(e){var t=this.allowServerDataBinding,i=(this.enableServerDataBinding(!1),this.selectedItems);(0<i.annotations.length?this.selectedItems.annotations:this.selectedItems.formFields)[0];0<i.annotations.length?(i.offsetX=0,i.offsetY=0,i.width=0,i.height=0,i.rotateAngle=0,i.annotations=[],i.wrapper=null):0<i.formFields.length&&(i.offsetX=0,i.offsetY=0,i.width=0,i.height=0,i.rotateAngle=0,i.formFields=[],i.wrapper=null),this.drawing.clearSelectorLayer(e),this.viewerBase.isAnnotationSelect=!1,this.viewerBase.isFormFieldSelect=!1,this.annotationModule&&(i=this.annotationModule.textMarkupAnnotationModule)&&(e=i.selectTextMarkupCurrentPage,this.annotationModule.textMarkupAnnotationModule.clearCurrentSelectedAnnotation(),this.annotationModule.textMarkupAnnotationModule.clearCurrentAnnotationSelection(e)),this.enableServerDataBinding(t,!0)},p.prototype.getPageNumberFromClientPoint=function(e){return this.viewerBase.getPageNumberFromClientPoint(e)},p.prototype.convertClientPointToPagePoint=function(e,t){return this.viewerBase.convertClientPointToPagePoint(e,t)},p.prototype.convertPagePointToClientPoint=function(e,t){return this.viewerBase.convertPagePointToClientPoint(e,t)},p.prototype.convertPagePointToScrollingPoint=function(e,t){return this.viewerBase.convertPagePointToScrollingPoint(e,t)},p.prototype.zoomToRect=function(e){this.magnificationModule.zoomToRect(e)},p.prototype.add=function(e){return this.drawing.add(e)},p.prototype.remove=function(e){return this.drawing.remove(e)},p.prototype.copy=function(){return this.annotation?this.annotation.isShapeCopied=!0:this.formDesigner&&this.designerMode&&(this.formDesigner.isShapeCopied=!0),this.drawing.copy()},p.prototype.rotate=function(e,t){return this.drawing.rotate(this.selectedItems,e,null,t)},p.prototype.paste=function(e){var t;return this.viewerBase.activeElements.activePageID&&(t=this.viewerBase.activeElements.activePageID),this.drawing.paste(e,t||0)},p.prototype.refresh=function(){for(var e=0;e<this.annotations.length;e++){if(void 0!==this.zIndexTable.length){for(var t=0;t<this.zIndexTable.length;t++){for(var i=this.zIndexTable[parseInt(t.toString(),10)].objects,n=0;n<i.length;n++)i.splice(n,1);delete this.zIndexTable[parseInt(t.toString(),10)]}this.annotations[parseInt(e.toString(),10)]&&delete this.annotations[parseInt(e.toString(),10)],this.selectedItems.annotations&&this.selectedItems.annotations[parseInt(e.toString(),10)]&&delete this.selectedItems.annotations[parseInt(e.toString(),10)],this.zIndexTable=[],this.renderDrawing()}this.annotations&&0!==this.annotations.length&&(this.annotations.length=0,this.selectedItems.annotations.length=0)}},p.prototype.cut=function(){var e;return this.viewerBase.activeElements.activePageID&&(e=this.viewerBase.activeElements.activePageID),this.annotation?this.annotation.isShapeCopied=!0:this.formDesigner&&this.designerMode&&(this.formDesigner.isShapeCopied=!0),this.drawing.cut(e||0)},p.prototype.nodePropertyChange=function(e,t){this.drawing.nodePropertyChange(e,t)},p.prototype.enableServerDataBinding=function(e,t){void 0===t&&(t=!1),N&&(this.allowServerDataBinding=e,t)&&(this.bulkChanges={})},p.prototype.checkBoundaryConstraints=function(e,t,i,n,o,r){return this.drawing.checkBoundaryConstraints(e,t,i,n,o,r)},p.prototype.addCustomMenu=function(e,t,i){var n;je(e)||((n=this.customContextMenuItems).push.apply(n,e),this.showCustomContextMenuBottom=i),this.disableDefaultContextMenu=t},d([e()],p.prototype,"serviceUrl",void 0),d([e(0)],p.prototype,"pageCount",void 0),d([e(1)],p.prototype,"printScaleFactor",void 0),d([e(!1)],p.prototype,"isDocumentEdited",void 0),d([e(0)],p.prototype,"currentPageNumber",void 0),d([e()],p.prototype,"documentPath",void 0),d([e(null)],p.prototype,"exportAnnotationFileName",void 0),d([e()],p.prototype,"downloadFileName",void 0),d([e("auto")],p.prototype,"height",void 0),d([e("auto")],p.prototype,"width",void 0),d([e(!0)],p.prototype,"enableToolbar",void 0),d([e(1)],p.prototype,"retryCount",void 0),d([e([500])],p.prototype,"retryStatusCodes",void 0),d([e(0)],p.prototype,"retryTimeout",void 0),d([e(2)],p.prototype,"initialRenderPages",void 0),d([e(!0)],p.prototype,"showNotificationDialog",void 0),d([e(!0)],p.prototype,"enableNavigationToolbar",void 0),d([e(!0)],p.prototype,"enableCommentPanel",void 0),d([e(!1)],p.prototype,"isCommandPanelOpen",void 0),d([e(!1)],p.prototype,"enableTextMarkupResizer",void 0),d([e(!1)],p.prototype,"enableMultiLineOverlap",void 0),d([e(!1)],p.prototype,"isValidFreeText",void 0),d([e(!1)],p.prototype,"isAnnotationToolbarOpen",void 0),d([e(!1)],p.prototype,"isAnnotationToolbarVisible",void 0),d([e(!1)],p.prototype,"isFormDesignerToolbarVisible",void 0),d([e(!1)],p.prototype,"enableMultiPageAnnotation",void 0),d([e(!0)],p.prototype,"enableDownload",void 0),d([e(!0)],p.prototype,"enablePrint",void 0),d([e(!0)],p.prototype,"enablePrintRotation",void 0),d([e([])],p.prototype,"customFonts",void 0),d([e(!0)],p.prototype,"enableThumbnail",void 0),d([e(!0)],p.prototype,"enablePageOrganizer",void 0),d([e(!1)],p.prototype,"isPageOrganizerOpen",void 0),d([e({canDelete:!0,canInsert:!0,canRotate:!0,canCopy:!0,canRearrange:!0,canImport:!0})],p.prototype,"pageOrganizerSettings",void 0),d([e(!1)],p.prototype,"isThumbnailViewOpen",void 0),d([e(!1)],p.prototype,"isSignatureEditable",void 0),d([e(!0)],p.prototype,"enableBookmark",void 0),d([e("TextAndBounds")],p.prototype,"extractTextOption",void 0),d([e(!1)],p.prototype,"enableLocalStorage",void 0),d([e(!1)],p.prototype,"enableBookmarkStyles",void 0),d([e(!0)],p.prototype,"enableHyperlink",void 0),d([e(!0)],p.prototype,"enableHandwrittenSignature",void 0),d([e(!0)],p.prototype,"enableInkAnnotation",void 0),d([e(!1)],p.prototype,"restrictZoomRequest",void 0),d([e("CurrentTab")],p.prototype,"hyperlinkOpenState",void 0),d([e("RightClick")],p.prototype,"contextMenuOption",void 0),d([e([])],p.prototype,"disableContextMenuItems",void 0),d([e({name:"",id:"",type:"",isReadOnly:!1,isSelected:!1,isChecked:!1,value:"",signatureType:[""],fontName:"",fontFamily:"Helvetica",fontSize:10,fontStyle:"None",color:"black",backgroundColor:"white",alignment:"Left",visibility:"visible",maxLength:0,isRequired:!1,isPrint:!1,tooltip:"",pageIndex:-1,options:[],signatureIndicatorSettings:{opacity:1,backgroundColor:"orange",width:19,height:10,fontSize:10,text:null,color:"black",customData:""}})],p.prototype,"formFieldCollections",void 0),d([e(!0)],p.prototype,"enableNavigation",void 0),d([e(!0)],p.prototype,"enableAutoComplete",void 0),d([e(!0)],p.prototype,"enableMagnification",void 0),d([e(!1)],p.prototype,"enableShapeLabel",void 0),d([e(!0)],p.prototype,"enableImportAnnotationMeasurement",void 0),d([e(!0)],p.prototype,"enablePinchZoom",void 0),d([e(!0)],p.prototype,"enableTextSelection",void 0),d([e(!0)],p.prototype,"enableTextSearch",void 0),d([e(!0)],p.prototype,"enableAnnotation",void 0),d([e(!0)],p.prototype,"enableFormFields",void 0),d([e(!0)],p.prototype,"enableFormDesigner",void 0),d([e(!1)],p.prototype,"designerMode",void 0),d([e(!1)],p.prototype,"enableFormFieldsValidation",void 0),d([e(!1)],p.prototype,"isFormFieldDocument",void 0),d([e(!1)],p.prototype,"enableDesktopMode",void 0),d([e(!1)],p.prototype,"hideSaveSignature",void 0),d([e(!0)],p.prototype,"enableFreeText",void 0),d([e(!0)],p.prototype,"enableTextMarkupAnnotation",void 0),d([e(!0)],p.prototype,"enableShapeAnnotation",void 0),d([e(!0)],p.prototype,"enableMeasureAnnotation",void 0),d([e(!0)],p.prototype,"enableStampAnnotations",void 0),d([e(!0)],p.prototype,"enableStickyNotesAnnotation",void 0),d([e(!0)],p.prototype,"enableAnnotationToolbar",void 0),d([e(!0)],p.prototype,"enableFormDesignerToolbar",void 0),d([e(!1)],p.prototype,"isBookmarkPanelOpen",void 0),d([e(!1)],p.prototype,"isInitialFieldToolbarSelection",void 0),d([e("TextSelection")],p.prototype,"interactionMode",void 0),d([e("Default")],p.prototype,"zoomMode",void 0),d([e("Default")],p.prototype,"signatureFitMode",void 0),d([e("Default")],p.prototype,"printMode",void 0),d([e(0)],p.prototype,"zoomValue",void 0),d([e(10)],p.prototype,"minZoom",void 0),d([e(400)],p.prototype,"maxZoom",void 0),d([e(!0)],p.prototype,"enableZoomOptimization",void 0),d([e(!1)],p.prototype,"isExtractText",void 0),d([e(!1)],p.prototype,"isMaintainSelection",void 0),d([e(!1)],p.prototype,"hideEmptyDigitalSignatureFields",void 0),d([e(!0)],p.prototype,"showDigitalSignatureAppearance",void 0),d([e(!0)],p.prototype,"enableAccessibilityTags",void 0),d([e(!0)],p.prototype,"enableHtmlSanitizer",void 0),d([e("M/d/yyyy h:mm:ss a")],p.prototype,"dateTimeFormat",void 0),d([e("")],p.prototype,"resourceUrl",void 0),d([e({showTooltip:!0,toolbarItems:["OpenOption","UndoRedoTool","PageNavigationTool","MagnificationTool","PanTool","SelectionTool","CommentTool","SubmitForm","AnnotationEditTool","FormDesignerEditTool","FreeTextAnnotationOption","InkAnnotationOption","ShapeAnnotationOption","StampAnnotation","SignatureOption","SearchOption","PrintOption","DownloadOption"],annotationToolbarItems:["HighlightTool","UnderlineTool","StrikethroughTool","ColorEditTool","OpacityEditTool","AnnotationDeleteTool","StampAnnotationTool","HandWrittenSignatureTool","InkAnnotationTool","ShapeTool","CalibrateTool","StrokeColorEditTool","ThicknessEditTool","FreeTextAnnotationTool","FontFamilyAnnotationTool","FontSizeAnnotationTool","FontStylesAnnotationTool","FontAlignAnnotationTool","FontColorAnnotationTool","CommentPanelTool"],formDesignerToolbarItems:["TextboxTool","PasswordTool","CheckBoxTool","RadioButtonTool","DropdownTool","ListboxTool","DrawSignatureTool","DeleteTool"]})],p.prototype,"toolbarSettings",void 0),d([e({ajaxHeaders:[],withCredentials:!1})],p.prototype,"ajaxRequestSettings",void 0),d([e({customStampName:"",customStampImageSource:""})],p.prototype,"customStamp",void 0),d([e({load:"Load",renderPages:"RenderPdfPages",unload:"Unload",download:"Download",renderThumbnail:"RenderThumbnailImages",print:"PrintImages",renderComments:"RenderAnnotationComments",importAnnotations:"ImportAnnotations",exportAnnotations:"ExportAnnotations",importFormFields:"ImportFormFields",exportFormFields:"ExportFormFields",renderTexts:"RenderPdfTexts",validatePassword:"ValidatePassword"})],p.prototype,"serverActionSettings",void 0),d([e({name:"",isReadOnly:!1,visibility:"visible",isRequired:!1,isPrint:!0,tooltip:"",thickness:1,signatureIndicatorSettings:{opacity:1,backgroundColor:"orange",width:19,height:10,fontSize:10,text:null,color:"black"},signatureDialogSettings:{displayMode:DCt.Draw|DCt.Text|DCt.Upload,hideSaveSignature:!1}})],p.prototype,"signatureFieldSettings",void 0),d([e({name:"",isReadOnly:!1,visibility:"visible",isRequired:!1,isPrint:!0,tooltip:"",thickness:1,initialIndicatorSettings:{opacity:1,backgroundColor:"orange",width:19,height:10,fontSize:10,text:null,color:"black"},initialDialogSettings:{displayMode:DCt.Draw|DCt.Text|DCt.Upload,hideSaveSignature:!1}})],p.prototype,"initialFieldSettings",void 0),d([e({opacity:1,color:"#FFDF56",author:"Guest",annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges},isLock:!1,enableMultiPageAnnotation:!1,enableTextMarkupResizer:!1,allowedInteractions:["None"],isPrint:!0,subject:"Highlight"})],p.prototype,"highlightSettings",void 0),d([e({opacity:1,color:"#ff0000",author:"Guest",annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges},isLock:!1,enableMultiPageAnnotation:!1,enableTextMarkupResizer:!1,allowedInteractions:["None"],isPrint:!0,subject:"Strikethrough"})],p.prototype,"strikethroughSettings",void 0),d([e({opacity:1,color:"#00ff00",author:"Guest",annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges},isLock:!1,enableMultiPageAnnotation:!1,enableTextMarkupResizer:!1,allowedInteractions:["None"],isPrint:!0,subject:"Underline"})],p.prototype,"underlineSettings",void 0),d([e({opacity:1,fillColor:"#ffffff00",strokeColor:"#ff0000",author:"Guest",thickness:1,borderDashArray:0,lineHeadStartStyle:"None",lineHeadEndStyle:"None",annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},minHeight:0,minWidth:0,maxWidth:0,maxHeight:0,isLock:!1,allowedInteractions:["None"],isPrint:!0,subject:"Line"})],p.prototype,"lineSettings",void 0),d([e({opacity:1,fillColor:"#ffffff00",strokeColor:"#ff0000",author:"Guest",thickness:1,borderDashArray:0,lineHeadStartStyle:"Closed",lineHeadEndStyle:"Closed",annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},minHeight:0,minWidth:0,maxWidth:0,maxHeight:0,isLock:!1,allowedInteractions:["None"],isPrint:!0,subject:"Arrow"})],p.prototype,"arrowSettings",void 0),d([e({opacity:1,fillColor:"#ffffff00",strokeColor:"#ff0000",author:"Guest",thickness:1,annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},minHeight:0,minWidth:0,maxWidth:0,maxHeight:0,isLock:!1,allowedInteractions:["None"],isPrint:!0,subject:"Rectangle"})],p.prototype,"rectangleSettings",void 0),d([e({opacity:1,fillColor:"#ffffff00",borderColor:"#ff0000",fontColor:"#000",fontSize:16,labelHeight:24.6,labelMaxWidth:151,labelContent:"Label"})],p.prototype,"shapeLabelSettings",void 0),d([e({opacity:1,fillColor:"#ffffff00",strokeColor:"#ff0000",author:"Guest",thickness:1,annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},minHeight:0,minWidth:0,maxWidth:0,maxHeight:0,isLock:!1,allowedInteractions:["None"],isPrint:!0,subject:"Circle"})],p.prototype,"circleSettings",void 0),d([e({opacity:1,fillColor:"#ffffff00",strokeColor:"#ff0000",author:"Guest",thickness:1,annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},minHeight:0,minWidth:0,maxWidth:0,maxHeight:0,isLock:!1,allowedInteractions:["None"],isPrint:!0,subject:"Polygon"})],p.prototype,"polygonSettings",void 0),d([e({opacity:1,author:"Guest",annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},minHeight:0,minWidth:0,maxWidth:0,maxHeight:0,isLock:!1,dynamicStamps:[kCt.Revised,kCt.Reviewed,kCt.Received,kCt.Confidential,kCt.Approved,kCt.NotApproved],signStamps:[PCt.Witness,PCt.InitialHere,PCt.SignHere,PCt.Accepted,PCt.Rejected],standardBusinessStamps:[BCt.Approved,BCt.NotApproved,BCt.Draft,BCt.Final,BCt.Completed,BCt.Confidential,BCt.ForPublicRelease,BCt.NotForPublicRelease,BCt.ForComment,BCt.Void,BCt.PreliminaryResults,BCt.InformationOnly],allowedInteractions:["None"],isPrint:!0,subject:""})],p.prototype,"stampSettings",void 0),d([e({opacity:1,author:"Guest",width:0,height:0,left:0,top:0,minHeight:0,minWidth:0,maxWidth:0,maxHeight:0,isLock:!1,enableCustomStamp:!0,allowedInteractions:["None"],isPrint:!0,subject:""})],p.prototype,"customStampSettings",void 0),d([e({opacity:1,fillColor:"#ffffff00",strokeColor:"#ff0000",author:"Guest",thickness:1,borderDashArray:0,lineHeadStartStyle:"Closed",lineHeadEndStyle:"Closed",annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},minHeight:0,minWidth:0,maxWidth:0,maxHeight:0,isLock:!1,leaderLength:40,resizeCursorType:MCt.move,allowedInteractions:["None"],isPrint:!0,subject:"Distance calculation"})],p.prototype,"distanceSettings",void 0),d([e({opacity:1,fillColor:"#ffffff00",strokeColor:"#ff0000",author:"Guest",thickness:1,borderDashArray:0,lineHeadStartStyle:"Open",lineHeadEndStyle:"Open",minHeight:0,minWidth:0,maxWidth:0,maxHeight:0,isLock:!1,annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},allowedInteractions:["None"],isPrint:!0,subject:"Perimeter calculation"})],p.prototype,"perimeterSettings",void 0),d([e({opacity:1,fillColor:"#ffffff00",strokeColor:"#ff0000",author:"Guest",thickness:1,minHeight:0,minWidth:0,maxWidth:0,maxHeight:0,isLock:!1,annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},allowedInteractions:["None"],isPrint:!0,subject:"Area calculation"})],p.prototype,"areaSettings",void 0),d([e({opacity:1,fillColor:"#ffffff00",strokeColor:"#ff0000",author:"Guest",thickness:1,annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},minHeight:0,minWidth:0,maxWidth:0,maxHeight:0,isLock:!1,allowedInteractions:["None"],isPrint:!0,subject:"Radius calculation"})],p.prototype,"radiusSettings",void 0),d([e({opacity:1,fillColor:"#ffffff00",strokeColor:"#ff0000",author:"Guest",thickness:1,minHeight:0,minWidth:0,maxWidth:0,maxHeight:0,isLock:!1,annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},allowedInteractions:["None"],isPrint:!0,subject:"Volume calculation"})],p.prototype,"volumeSettings",void 0),d([e({author:"Guest",opacity:1,annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},isLock:!1,allowedInteractions:["None"],isPrint:!0,subject:"Sticky Note"})],p.prototype,"stickyNotesSettings",void 0),d([e({opacity:1,fillColor:"#ffffff00",borderColor:"#ffffff00",author:"Guest",borderWidth:1,width:151,fontSize:16,height:24.6,fontColor:"#000",fontFamily:"Helvetica",defaultText:"Type Here",textAlignment:"Left",fontStyle:ACt.None,allowTextOnly:!1,annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},minHeight:0,minWidth:0,maxWidth:0,maxHeight:0,isLock:!1,allowedInteractions:["None"],isPrint:!0,isReadonly:!1,enableAutoFit:!1,subject:"Text Box"})],p.prototype,"freeTextSettings",void 0),d([e({conversionUnit:"in",displayUnit:"in",scaleRatio:1,depth:96})],p.prototype,"measurementSettings",void 0),d([e({selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null})],p.prototype,"annotationSelectorSettings",void 0),d([e({searchHighlightColor:"#fdd835",searchColor:"#8b4c12"})],p.prototype,"textSearchColorSettings",void 0),d([e({displayMode:DCt.Draw|DCt.Text|DCt.Upload,hideSaveSignature:!1})],p.prototype,"signatureDialogSettings",void 0),d([e({displayMode:DCt.Draw|DCt.Text|DCt.Upload,hideSaveSignature:!1})],p.prototype,"initialDialogSettings",void 0),d([e({signatureItem:["Signature","Initial"],saveSignatureLimit:1,saveInitialLimit:1,opacity:1,strokeColor:"#000000",width:150,height:100,thickness:1,annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},allowedInteractions:["None"],signatureDialogSettings:{displayMode:DCt.Draw|DCt.Text|DCt.Upload,hideSaveSignature:!1},initialDialogSettings:{displayMode:DCt.Draw|DCt.Text|DCt.Upload,hideSaveSignature:!1}})],p.prototype,"handWrittenSignatureSettings",void 0),d([e({author:"Guest",opacity:1,strokeColor:"#ff0000",thickness:1,annotationSelectorSettings:{selectionBorderColor:"",resizerBorderColor:"black",resizerFillColor:"#FF4081",resizerSize:8,selectionBorderThickness:1,resizerShape:"Square",selectorLineDashArray:[],resizerLocation:TCt.Corners|TCt.Edges,resizerCursorType:null},isLock:!1,allowedInteractions:["None"],isPrint:!0,subject:"Ink"})],p.prototype,"inkAnnotationSettings",void 0),d([e({author:"Guest",minHeight:0,minWidth:0,maxWidth:0,maxHeight:0,isLock:!1,skipPrint:!1,skipDownload:!1,allowedInteractions:["None"],subject:""})],p.prototype,"annotationSettings",void 0),d([e({enableTileRendering:!0,x:0,y:0})],p.prototype,"tileRenderingSettings",void 0),d([e({delayPageRequestTimeOnScroll:100})],p.prototype,"scrollSettings",void 0),d([e({name:"",value:"",fontFamily:"Helvetica",fontSize:10,fontStyle:"None",color:"black",borderColor:"black",backgroundColor:"white",alignment:"Left",isReadOnly:!1,visibility:"visible",maxLength:0,isRequired:!1,isPrint:!0,tooltip:"",thickness:1,isMultiline:!1,customData:""})],p.prototype,"textFieldSettings",void 0),d([e({name:"",value:"",fontFamily:"Helvetica",fontSize:10,fontStyle:"None",color:"black",borderColor:"black",backgroundColor:"white",alignment:"Left",isReadOnly:!1,visibility:"visible",maxLength:0,isRequired:!1,isPrint:!0,tooltip:"",thickness:1,customData:""})],p.prototype,"passwordFieldSettings",void 0),d([e({name:"",value:"",isChecked:!1,backgroundColor:"white",isReadOnly:!1,visibility:"visible",isPrint:!0,tooltip:"",isRequired:!1,thickness:1,borderColor:"black",customData:""})],p.prototype,"checkBoxFieldSettings",void 0),d([e({name:"",value:"",isSelected:!1,backgroundColor:"white",isReadOnly:!1,visibility:"visible",isPrint:!0,tooltip:"",isRequired:!1,thickness:1,borderColor:"black",customData:""})],p.prototype,"radioButtonFieldSettings",void 0),d([e({name:"",fontFamily:"Helvetica",fontSize:10,fontStyle:"None",color:"black",backgroundColor:"white",alignment:"Left",isReadOnly:!1,visibility:"visible",isRequired:!1,isPrint:!0,tooltip:"",options:[],thickness:1,borderColor:"black",customData:""})],p.prototype,"DropdownFieldSettings",void 0),d([e({name:"",fontFamily:"Helvetica",fontSize:10,fontStyle:"None",color:"black",backgroundColor:"white",alignment:"Left",isReadOnly:!1,visibility:"visible",isRequired:!1,isPrint:!1,tooltip:"",options:[],thickness:1,borderColor:"black",customData:""})],p.prototype,"listBoxFieldSettings",void 0),d([e({contextMenuAction:"RightClick",contextMenuItems:[xCt.Comment,xCt.Copy,xCt.Cut,xCt.Delete,xCt.Highlight,xCt.Paste,xCt.Properties,xCt.ScaleRatio,xCt.Strikethrough,xCt.Underline]})],p.prototype,"contextMenuSettings",void 0),d([e([])],p.prototype,"customContextMenuItems",void 0),d([e(!1)],p.prototype,"disableDefaultContextMenu",void 0),d([e(!1)],p.prototype,"showCustomContextMenuBottom",void 0),d([t({},S2t)],p.prototype,"commandManager",void 0),d([t({},Jbt)],p.prototype,"selectedItems",void 0),d([i()],p.prototype,"created",void 0),d([i()],p.prototype,"resourcesLoaded",void 0),d([i()],p.prototype,"documentLoad",void 0),d([i()],p.prototype,"documentUnload",void 0),d([i()],p.prototype,"documentLoadFailed",void 0),d([i()],p.prototype,"ajaxRequestFailed",void 0),d([i()],p.prototype,"ajaxRequestSuccess",void 0),d([i()],p.prototype,"pageRenderComplete",void 0),d([i()],p.prototype,"validateFormFields",void 0),d([i()],p.prototype,"pageClick",void 0),d([i()],p.prototype,"pageChange",void 0),d([i()],p.prototype,"hyperlinkClick",void 0),d([i()],p.prototype,"hyperlinkMouseOver",void 0),d([i()],p.prototype,"zoomChange",void 0),d([i()],p.prototype,"annotationAdd",void 0),d([i()],p.prototype,"annotationRemove",void 0),d([i()],p.prototype,"annotationPropertiesChange",void 0),d([i()],p.prototype,"annotationResize",void 0),d([i()],p.prototype,"addSignature",void 0),d([i()],p.prototype,"removeSignature",void 0),d([i()],p.prototype,"moveSignature",void 0),d([i()],p.prototype,"signaturePropertiesChange",void 0),d([i()],p.prototype,"resizeSignature",void 0),d([i()],p.prototype,"signatureSelect",void 0),d([i()],p.prototype,"signatureUnselect",void 0),d([i()],p.prototype,"annotationSelect",void 0),d([i()],p.prototype,"annotationUnSelect",void 0),d([i()],p.prototype,"annotationDoubleClick",void 0),d([i()],p.prototype,"annotationMove",void 0),d([i()],p.prototype,"annotationMoving",void 0),d([i()],p.prototype,"annotationMouseover",void 0),d([i()],p.prototype,"annotationMouseLeave",void 0),d([i()],p.prototype,"pageMouseover",void 0),d([i()],p.prototype,"importStart",void 0),d([i()],p.prototype,"exportStart",void 0),d([i()],p.prototype,"importSuccess",void 0),d([i()],p.prototype,"exportSuccess",void 0),d([i()],p.prototype,"importFailed",void 0),d([i()],p.prototype,"exportFailed",void 0),d([i()],p.prototype,"extractTextCompleted",void 0),d([i()],p.prototype,"thumbnailClick",void 0),d([i()],p.prototype,"bookmarkClick",void 0),d([i()],p.prototype,"toolbarClick",void 0),d([i()],p.prototype,"textSelectionStart",void 0),d([i()],p.prototype,"textSelectionEnd",void 0),d([i()],p.prototype,"downloadStart",void 0),d([i()],p.prototype,"buttonFieldClick",void 0),d([i()],p.prototype,"formFieldClick",void 0),d([i()],p.prototype,"downloadEnd",void 0),d([i()],p.prototype,"printStart",void 0),d([i()],p.prototype,"printEnd",void 0),d([i()],p.prototype,"textSearchStart",void 0),d([i()],p.prototype,"textSearchComplete",void 0),d([i()],p.prototype,"textSearchHighlight",void 0),d([i()],p.prototype,"ajaxRequestInitiate",void 0),d([i()],p.prototype,"pageRenderInitiate",void 0),d([i()],p.prototype,"commentAdd",void 0),d([i()],p.prototype,"commentEdit",void 0),d([i()],p.prototype,"commentDelete",void 0),d([i()],p.prototype,"commentSelect",void 0),d([i()],p.prototype,"commentStatusChanged",void 0),d([i()],p.prototype,"beforeAddFreeText",void 0),d([i()],p.prototype,"formFieldFocusOut",void 0),d([i()],p.prototype,"formFieldAdd",void 0),d([i()],p.prototype,"formFieldRemove",void 0),d([i()],p.prototype,"formFieldPropertiesChange",void 0),d([i()],p.prototype,"formFieldMouseLeave",void 0),d([i()],p.prototype,"formFieldMouseover",void 0),d([i()],p.prototype,"formFieldMove",void 0),d([i()],p.prototype,"formFieldResize",void 0),d([i()],p.prototype,"formFieldSelect",void 0),d([i()],p.prototype,"formFieldUnselect",void 0),d([i()],p.prototype,"formFieldDoubleClick",void 0),d([i()],p.prototype,"customContextMenuSelect",void 0),d([i()],p.prototype,"customContextMenuBeforeOpen",void 0),d([i()],p.prototype,"keyboardCustomCommands",void 0),d([i()],p.prototype,"pageOrganizerSaveAs",void 0),d([kt([],jbt)],p.prototype,"annotations",void 0),d([kt([],Ubt)],p.prototype,"formFields",void 0),d([e()],p.prototype,"drawingObject",void 0);var k2t,Bft=d([Bt],p);function p(e,t){e=k2t.call(this,e,t)||this;return e.isFormFieldsLoaded=!1,e.signatureCollection=[],e.fileName=null,e.zIndex=-1,e.nameTable={},e.clipboardData={},e.zIndexTable=[],e.isTextSelectionStarted=!1,e.touchPadding=10,e.paddingDifferenceValue=10,e.defaultLocale={PdfViewer:"PDF Viewer",Cancel:"Cancel","Download file":"Download file",Download:"Download","Enter Password":"This document is password protected. Please enter a password.","File Corrupted":"File Corrupted","File Corrupted Content":"The file is corrupted and cannot be opened.","Fit Page":"Fit Page","Fit Width":"Fit Width",Automatic:"Automatic","Go To First Page":"Show first page","Invalid Password":"Incorrect Password. Please try again.","Next Page":"Show next page",OK:"OK",Open:"Open file","Page Number":"Current page number","Previous Page":"Show previous page","Go To Last Page":"Show last page",Zoom:"Zoom","Zoom In":"Zoom in","Zoom Out":"Zoom out","Page Thumbnails":"Page Thumbnails",Bookmarks:"Bookmarks",Print:"Print file","Organize Pages":"Organize Pages","Insert Right":"Insert Right","Insert Left":"Insert Left",Total:"Total",Pages:"Pages","Rotate Right":"Rotate Right","Rotate Left":"Rotate Left","Delete Page":"Delete Page","Delete Pages":"Delete Pages","Copy Page":"Copy Page","Copy Pages":"Copy Pages",Save:"Save","Save As":"Save As","Select All":"Select All","Import Document":"Import Document","Password Protected":"Password Required",Copy:"Copy","Text Selection":"Text selection tool",Panning:"Pan mode","Text Search":"Find text","Find in document":"Find in document","Match case":"Match case","Match any word":"Match any word",Apply:"Apply",GoToPage:"Go to Page","No Matches":"PDF Viewer has finished searching the document. No matches were found.","No More Matches":"PDF Viewer has finished searching the document. No more matches were found.","No Search Matches":"No matches found","No More Search Matches":"No more matches found","Exact Matches":"EXACT MATCHES","Total Matches":"TOTAL MATCHES",Undo:"Undo",Redo:"Redo",Annotation:"Add or Edit annotations",FormDesigner:"Add and Edit Form Fields",Highlight:"Highlight Text",Underline:"Underline Text",Strikethrough:"Strikethrough Text",Delete:"Delete annotation",Opacity:"Opacity","Color edit":"Change Color","Opacity edit":"Change Opacity","Highlight context":"Highlight","Underline context":"Underline","Strikethrough context":"Strikethrough","Server error":"Web-service is not listening. PDF Viewer depends on web-service for all it's features. Please start the web service to continue.","Client error":"Client-side error is found. Please check the custom headers provided in the AjaxRequestSettings property and web action methods in the ServerActionSettings property.","Cors policy error":"Unable to retrieve the document due to an invalid URL or access restrictions. Please check the document URL and try again.","Open text":"Open","First text":"First Page","Previous text":"Previous Page","Next text":"Next Page","Last text":"Last Page","Zoom in text":"Zoom In","Zoom out text":"Zoom Out","Selection text":"Selection","Pan text":"Pan","Print text":"Print","Search text":"Search","Annotation Edit text":"Edit Annotation","FormDesigner Edit text":"Add and Edit Form Fields","Line Thickness":"Line Thickness","Line Properties":"Line Properties","Start Arrow":"Start Arrow","End Arrow":"End Arrow","Line Style":"Line Style","Fill Color":"Fill Color","Line Color":"Line Color",None:"None","Open Arrow":"Open","Closed Arrow":"Closed","Round Arrow":"Round","Square Arrow":"Square","Diamond Arrow":"Diamond",Butt:"Butt",Cut:"Cut",Paste:"Paste","Delete Context":"Delete",Properties:"Properties","Add Stamp":"Add Stamp","Add Shapes":"Add Shapes","Stroke edit":"Change Stroke Color","Change thickness":"Change Border Thickness","Add line":"Add Line","Add arrow":"Add Arrow","Add rectangle":"Add Rectangle","Add circle":"Add Circle","Add polygon":"Add Polygon","Add Comments":"Add Comments",Comments:"Comments",SubmitForm:"Submit Form","No Comments Yet":"No Comments Yet",Accepted:"Accepted",Completed:"Completed",Cancelled:"Cancelled",Rejected:"Rejected","Leader Length":"Leader Length","Scale Ratio":"Scale Ratio",Calibrate:"Calibrate","Calibrate Distance":"Calibrate Distance","Calibrate Perimeter":"Calibrate Perimeter","Calibrate Area":"Calibrate Area","Calibrate Radius":"Calibrate Radius","Calibrate Volume":"Calibrate Volume",Depth:"Depth",Closed:"Closed",Round:"Round",Square:"Square",Diamond:"Diamond",Edit:"Edit",Comment:"Comment","Comment Panel":"Comment Panel","Set Status":"Set Status",Post:"Post",Page:"Page","Add a comment":"Add a comment","Add a reply":"Add a reply","Import Annotations":"Import annotations from JSON file","Export Annotations":"Export annotation to JSON file","Export XFDF":"Export annotation to XFDF file","Import XFDF":"Import annotations from XFDF file",Add:"Add",Clear:"Clear",Bold:"Bold",Italic:"Italic",Strikethroughs:"Strikethrough",Underlines:"Underline",Superscript:"Superscript",Subscript:"Subscript","Align left":"Align Left","Align right":"Align Right",Center:"Center",Justify:"Justify","Font color":"Font Color","Text Align":"Text Align","Text Properties":"Font Style",SignatureFieldDialogHeaderText:"Add Signature",HandwrittenSignatureDialogHeaderText:"Add Signature",InitialFieldDialogHeaderText:"Add Initial",HandwrittenInitialDialogHeaderText:"Add Initial","Draw Ink":"Draw Ink",Create:"Create","Font family":"Font Family","Font size":"Font Size","Free Text":"Free Text","Import Failed":"Invalid JSON file type or file name; please select a valid JSON file","Import PDF Failed":"Invalid PDF file type or PDF file not found. Please select a valid PDF file","File not found":"Imported JSON file is not found in the desired location","Export Failed":"Export annotations action has failed; please ensure annotations are added properly",of:"of ",Dynamic:"Dynamic","Standard Business":"Standard Business","Sign Here":"Sign Here","Custom Stamp":"Custom Stamp","Enter Signature as Name":"Enter your name","Draw-hand Signature":"DRAW","Type Signature":"TYPE","Upload Signature":"UPLOAD","Browse Signature Image":"BROWSE","Save Signature":"Save Signature","Save Initial":"Save Initial",Textbox:"Textbox",Password:"Password","Check Box":"Checkbox","Radio Button":"Radio Button",Dropdown:"Drop Down","List Box":"List Box",Signature:"Signature","Delete FormField":"Delete Form Field","Textbox Properties":"Textbox Properties",Name:"Name",Tooltip:"Tooltip",Value:"Value","Form Field Visibility":"Form Field Visibility","Read Only":"Read Only",Required:"Required",Checked:"Checked","Show Printing":"Show Printing",Formatting:"Format",Fill:"Fill",Border:"Border","Border Color":"Border Color",Thickness:"Thickness","Max Length":"Max Length","List Item":"Item Name","Export Value":"Item Value","Dropdown Item List":"Dropdown Item List","List Box Item List":"List Box Item List",General:"GENERAL",Appearance:"APPEARANCE",Options:"OPTIONS","Delete Item":"Delete",Up:"Up",Down:"Down",Multiline:"Multiline",Revised:"Revised",Reviewed:"Reviewed",Received:"Received",Confidential:"Confidential",Approved:"Approved","Not Approved":"Not Approved",Witness:"Witness","Initial Here":"Initial Here",Draft:"Draft",Final:"Final","For Public Release":"For Public Release","Not For Public Release":"Not For Public Release","For Comment":"For Comment",Void:"Void","Preliminary Results":"Preliminary Results","Information Only":"Information Only",in:"in",m:"m",ft_in:"ft_in",ft:"ft",p:"p",cm:"cm",mm:"mm",pt:"pt",cu:"cu",sq:"sq",Initial:"Initial"},e.viewerBase=new ARt(e),e.drawing=new Lwt(e),e.pdfRendererModule=new Z2t(e,e.viewerBase),e}P2t.prototype.openBookmarkPane=function(){this.pdfViewerBase.navigationPane&&this.pdfViewerBase.navigationPane.openBookmarkcontentInitially()},P2t.prototype.closeBookmarkPane=function(){this.pdfViewerBase.navigationPane&&this.pdfViewerBase.navigationPane.closeBookmarkPane()},P2t.prototype.createRequestForBookmarks=function(){var e,t=this,i={hashId:this.pdfViewerBase.hashId,action:"Bookmarks",elementId:this.pdfViewer.element.id,uniqueId:this.pdfViewerBase.documentId};this.pdfViewerBase.jsonDocumentId&&(i.documentId=this.pdfViewerBase.jsonDocumentId),this.pdfViewer.enableBookmarkStyles&&(i.bookmarkStyles=this.pdfViewer.enableBookmarkStyles),this.bookmarkRequestHandler=new DRt(this.pdfViewer),this.bookmarkRequestHandler.url=t.pdfViewer.serviceUrl+"/Bookmarks",this.bookmarkRequestHandler.responseType="json",this.pdfViewerBase.clientSideRendering?(e=this.pdfViewer.pdfRendererModule.getBookmarks(i),this.renderBookmarksOnSuccess(e,t)):(this.pdfViewerBase.requestCollection.push(this.bookmarkRequestHandler),this.bookmarkRequestHandler.send(i),this.bookmarkRequestHandler.onSuccess=function(e){t.pdfViewerBase.navigationPane&&t.pdfViewerBase.navigationPane.disableBookmarkButton();e=e.data;t.pdfViewerBase.checkRedirection(e)||t.renderBookmarksOnSuccess(e,t)},this.bookmarkRequestHandler.onFailure=function(e){t.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,"Bookmarks")},this.bookmarkRequestHandler.onError=function(e){t.pdfViewerBase.openNotificationPopup(),t.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,"Bookmarks")})},P2t.prototype.renderBookmarksOnSuccess=function(t,i){if(t){if("object"!=typeof t)try{t=JSON.parse(t)}catch(e){i.pdfViewerBase.onControlError(500,t,"Bookmarks"),t=null}t&&t.uniqueId===i.pdfViewerBase.documentId&&(i.pdfViewer.fireAjaxRequestSuccess("Bookmarks",t),i.bookmarks={bookMark:t.Bookmarks},i.bookmarkStyles=t.Bookmarkstyles,i.bookmarksDestination={bookMarkDestination:t.BookmarksDestination},N)&&(t={bookmarks:i.bookmarks,bookmarksDestination:i.bookmarksDestination},i.pdfViewer)&&i.pdfViewer._dotnetInstance&&i.pdfViewer._dotnetInstance.invokeMethodAsync("UpdateBookmarkCollection",t)}i.pdfViewerBase.navigationPane&&(null==i.bookmarks?(i.pdfViewerBase.navigationPane.disableBookmarkButton(),N&&i.pdfViewer._dotnetInstance&&i.pdfViewer._dotnetInstance.invokeMethodAsync("UpdateBookmarkCollection",null)):(i.pdfViewerBase.navigationPane.enableBookmarkButton(),i.isBookmarkViewDiv=!1,i.pdfViewer.isBookmarkPanelOpen&&i.pdfViewerBase.navigationPane.openBookmarkcontentInitially()))},P2t.prototype.renderBookmarkcontent=function(){var t=this;if(!this.isBookmarkViewDiv){for(var e=N,i=(this.bookmarkView=e?this.pdfViewer.element.querySelector(".e-pv-bookmark-view"):Q("div",{id:this.pdfViewer.element.id+"_bookmark_view",className:"e-pv-bookmark-view"}),this.pdfViewerBase.navigationPane.sideBarContent.appendChild(this.bookmarkView),Q("div",{id:this.pdfViewer.element.id+"_bookmark_iconview",className:"e-pv-bookmark-icon-view"})),n=(n=this.pdfViewer.enableRtl?Q("span",{id:this.pdfViewer.element.id+"_bookmark_icon",className:"e-pv-bookmark-icon e-pv-icon e-right"}):Q("span",{id:this.pdfViewer.element.id+"_bookmark_icon",className:"e-pv-bookmark-icon e-pv-icon"}),i.appendChild(n),Q("div",{id:this.pdfViewer.element.id+"_bookmark_Title",className:"e-pv-bookmark-title"})),o=(this.pdfViewer.enableRtl&&(n.style.paddingRight="26px"),n.innerText="${Title}",i.appendChild(n),e||(this.treeObj=new PW({fields:{dataSource:this.bookmarks.bookMark,id:"Id",text:"Title",child:"Child",hasChildren:"HasChild"},nodeTemplate:ao(function(e){return i.outerHTML.replace("${Title}",e.Title)}),nodeClicked:this.nodeClick.bind(this),keyPress:this.bookmarkKeypress.bind(this),drawNode:this.bookmarkPanelBeforeOpen.bind(this)}),this.treeObj.isStringTemplate=!0,this.pdfViewer.enableRtl&&(this.treeObj.enableRtl=!0),this.treeObj.appendTo(this.bookmarkView)),["mouseover","keydown"]),r=0;r<o.length;r++)this.bookmarkView.addEventListener(o[parseInt(r.toString(),10)],function(e){t.setHeight(e.target)});this.isBookmarkViewDiv=!0}this.bookmarkView.style.display="block"},P2t.prototype.renderBookmarkContentMobile=function(){null!=this.bookmarkView&&this.bookmarkView.remove(),this.bookmarkView=Q("div",{id:this.pdfViewer.element.id+"_bookmark_view",className:"e-pv-bookmark-view"}),this.pdfViewerBase.getElement("_bookmarks_container").appendChild(this.bookmarkView),this.bookmarkList=new MH({dataSource:this.bookmarks.bookMark,fields:{id:"Id",text:"Title",child:"Child"},showHeader:!1,select:this.bookmarkClick.bind(this)}),this.bookmarkList.isStringTemplate=!0,this.pdfViewer.enableRtl&&(this.bookmarkList.enableRtl=!0),this.bookmarkList.appendTo(this.bookmarkView)},P2t.prototype.setHeight=function(e){this.treeObj&&this.treeObj.fullRowSelect&&e.classList&&(e.classList.contains("e-treeview")&&e.classList.contains(".e-active")?e=e.querySelector(".e-active").querySelector(".e-fullrow"):e.classList.contains("e-treeview")||e.classList.contains("e-list-parent")?e=e.querySelector(".e-fullrow"):"e-fullrow"!==e.classList.value&&(e.closest&&e.closest(".e-list-item")?e=e.closest(".e-list-item").querySelector(".e-fullrow"):e.classList.contains("e-list-item")?e=e.querySelector(".e-fullrow"):e.classList.contains("e-icons")&&e.classList.contains("interaction")&&e.parentElement.parentElement.classList.contains("e-list-item")&&(e=e.parentElement.parentElement.querySelector(".e-fullrow"))),e.nextElementSibling)&&(e.style.height=e.nextElementSibling.offsetHeight+"px")},P2t.prototype.setBookmarkContentHeight=function(){var e;this.treeObj&&(e=this.treeObj.element,this.treeObj.fullRowSelect)&&(e.classList.contains("e-treeview")&&e.classList.contains(".e-active")?e=e.querySelector(".e-active").querySelector(".e-fullrow"):e.classList.contains("e-treeview")&&(e=e.querySelector(".e-fullrow")),e.nextElementSibling)&&(e.style.height=e.nextElementSibling.offsetHeight+"px")},P2t.prototype.navigateToBookmark=function(e,t,i){var n=this.bookmarksDestination.bookMarkDestination[parseInt(e.toString(),10)].PageIndex,e=this.bookmarksDestination.bookMarkDestination[parseInt(e.toString(),10)].Y;-1!==n&&this.goToBookmark(n,e),this.pdfViewer.fireBookmarkClick(-1!==n?n+1:n,e,t,i)},P2t.prototype.getBookmarks=function(){if(this.bookmarks&&this.bookmarksDestination)return{bookmarks:this.bookmarks,bookmarksDestination:this.bookmarksDestination}},P2t.prototype.goToBookmark=function(e,t){var i=this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].height,i=0===t?this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].top*this.pdfViewerBase.getZoomFactor():this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].top*this.pdfViewerBase.getZoomFactor()+(i-t)*this.pdfViewerBase.getZoomFactor(),t=i.toString();return this.pdfViewerBase.viewerContainer.scrollTop=parseInt(t,10),F.isDevice&&!this.pdfViewer.enableDesktopMode&&(this.pdfViewerBase.mobileScrollerContainer.style.display="",this.pdfViewerBase.updateMobileScrollerPosition()),this.isKeyboardNavigation||this.pdfViewerBase.focusViewerContainer(),0<e&&e<=this.pdfViewerBase.pageCount&&this.pdfViewerBase.currentPageNumber!==e+1&&this.pdfViewerBase.updateScrollTop(e,!1),this.isKeyboardNavigation=!1},P2t.prototype.clear=function(){if(this.pdfViewerBase.navigationPane&&(this.pdfViewerBase.navigationPane.disableBookmarkButton(),this.pdfViewerBase.navigationPane.updateViewerContainerOnClose()),this.bookmarks&&(this.bookmarks.bookMark=[],this.bookmarks=null),this.bookmarksDestination&&(this.bookmarksDestination.bookMarkDestination=[]),null!=this.bookmarkView&&!N)for(null!==this.bookmarkView.parentElement&&this.bookmarkView.parentElement.removeChild(this.bookmarkView);this.bookmarkView.hasChildNodes();)this.bookmarkView.removeChild(this.bookmarkView.lastChild);this.bookmarkRequestHandler&&this.bookmarkRequestHandler.clear()},P2t.prototype.destroy=function(){this.clear()},P2t.prototype.getModuleName=function(){return"BookmarkView"};d=P2t;function P2t(e,t){var s=this;this.isKeyboardNavigation=!1,this.childNavigateCount=0,this.bookmarkClick=function(e){var t,i;return e.event.target.classList.contains("e-icons")?s.childNavigateCount++:(t=e.data.Id,s.childNavigateCount=0,s.pdfViewerBase.navigationPane.goBackToToolbar(),i=s.bookmarkList.getSelectedItems(),s.navigateToBookmark(t,e.text,i.data.FileName)),!1},this.nodeClick=function(e){s.setHeight(e.node);var t=s.treeObj.getTreeData(e.node),i=Number(t[0].Id);return s.navigateToBookmark(i,e.node.textContent,t[0].FileName),s.pdfViewer.annotationModule&&s.pdfViewer.annotationModule.inkAnnotationModule&&(i=parseInt(s.pdfViewer.annotationModule.inkAnnotationModule.currentPageNumber,10),s.pdfViewer.annotationModule.inkAnnotationModule.drawInkAnnotation(i)),!1},this.bookmarkKeypress=function(e){!e.event||"mouse"===e.event.pointerType||"touch"===e.event.pointerType||"Enter"!==e.event.key&&" "!==e.event.key||(s.isKeyboardNavigation=!0,s.nodeClick(e),s.isKeyboardNavigation=!1)},this.bookmarkPanelBeforeOpen=function(e){if(s.pdfViewer.enableBookmarkStyles)for(var t=0;t<s.bookmarkStyles.length;t++)if(e.text.trim()===s.bookmarkStyles[parseInt(t.toString(),10)].Text.trim()){var i=e.node.lastElementChild;if(i){for(var n=s.bookmarkStyles[parseInt(t.toString(),10)].FontStyle.split(","),o=0;o<n.length;o++)switch(n[parseInt(o.toString(),10)].trim()){case"Italic":i.style.fontStyle="italic";break;case"Bold":i.style.fontWeight="Bold"}var r=i.getElementsByClassName("e-pv-bookmark-title")[0];r?r.style.color=s.bookmarkStyles[parseInt(t.toString(),10)].Color:i.children[0].style.color=s.bookmarkStyles[parseInt(t.toString(),10)].Color}break}},this.pdfViewer=e,this.pdfViewerBase=t}F2t.prototype.textSelectionOnMouseMove=function(e,t,i,n){var o=e;if(this.isTextSearched=!0,o.nodeType===o.TEXT_NODE){this.isSelectionStartTriggered||this.pdfViewerBase.getTextMarkupAnnotationMode()||(this.pdfViewer.fireTextSelectionStart(this.pdfViewerBase.currentPageNumber),this.isSelectionStartTriggered=!0),this.isBackwardPropagatedSelection=!1;for(var r=o.ownerDocument.createRange(),s=window.getSelection(),a=(null!==s.anchorNode&&(!(e=s.anchorNode.compareDocumentPosition(s.focusNode))&&s.anchorOffset>s.focusOffset||e===Node.DOCUMENT_POSITION_PRECEDING)&&(this.isBackwardPropagatedSelection=!0),r.selectNodeContents(o),0),l=r.endOffset;a<l;){r.setStart(o,a),r.setEnd(o,a+1);var h=(c=r.getBoundingClientRect()).right;n&&(h=parseInt(c.right.toString(),10)),c.left<=t&&t<=h&&parseInt(c.top.toString(),10)<=i&&c.bottom>=i&&(null!==s.anchorNode&&s.anchorNode.parentNode.classList.contains("e-pv-text")&&(s.anchorOffset>a?0!==this.backwardStart?r.setStart(s.anchorNode,this.backwardStart):r.setStart(s.anchorNode,s.anchorOffset+1):r.setStart(s.anchorNode,s.anchorOffset)),s.removeAllRanges(),s.addRange(r),this.isTextSelection||(this.selectionStartPage=this.pdfViewerBase.currentPageNumber-1),this.isTextSelection=!0,document.documentMode||(this.isBackwardPropagatedSelection||r.endOffset>a?(this.backwardStart!==r.startOffset&&r.startOffset>=a&&(this.backwardStart=r.endOffset),0===a&&1!==r.endOffset?s.extend(o,a):s.extend(o,a+1)):n?s.extend(o,a):s.extend(o,a+1)),r.detach()),a+=1}var d,p,e=this.pdfViewer.annotationModule;e&&e.textMarkupAnnotationModule&&e.textMarkupAnnotationModule.isEnableTextMarkupResizer(e.textMarkupAnnotationModule.currentTextMarkupAddMode)&&(e=document.getElementById(this.pdfViewer.element.id+"_droplet_left"),this.pdfViewerBase.isSelection&&s&&0<s.rangeCount?(d=(p=s.getRangeAt(0).getBoundingClientRect()).left,p=p.top,this.pdfViewer.annotation.textMarkupAnnotationModule.updateLeftposition(d,p),this.pdfViewerBase.isSelection=!1):e&&"none"===e.style.display&&this.pdfViewer.annotation.textMarkupAnnotationModule.updateLeftposition(t,i),this.pdfViewer.annotation.textMarkupAnnotationModule.updatePosition(t,i))}else for(var c,u=0;u<o.childNodes.length;u++)o.childNodes[parseInt(u.toString(),10)].nodeType===o.TEXT_NODE&&((c=(r=this.getSelectionRange(u,o)).getBoundingClientRect()).left<=t&&c.right>=parseInt(t.toString(),10)&&parseInt(c.top.toString(),10)<=i&&c.bottom>=i?(r.detach(),this.textSelectionOnMouseMove(o.childNodes[parseInt(u.toString(),10)],t,i,n)):r.detach())},F2t.prototype.textSelectionOnDrag=function(e,t,i,n){var o=e;if(this.isTextSearched=!0,o.nodeType===o.TEXT_NODE){this.isBackwardPropagatedSelection=!1;for(var r,s=o.ownerDocument.createRange(),a=window.getSelection(),l=(null!==a.anchorNode&&(!(e=a.anchorNode.compareDocumentPosition(a.focusNode))&&a.anchorOffset>a.focusOffset||e===Node.DOCUMENT_POSITION_PRECEDING)&&(this.isBackwardPropagatedSelection=!0),s.selectNodeContents(o),0),h=s.endOffset;l<h;){if(s.setStart(o,l),s.setEnd(o,l+1),(d=s.getBoundingClientRect()).left<=t&&d.right>=t&&parseInt(d.top.toString(),10)<=i&&d.bottom>=i)return n?(null!==a.anchorNode&&a.anchorNode.parentNode.classList.contains("e-pv-text")&&s.setStart(a.anchorNode,a.anchorOffset),a.removeAllRanges(),a.addRange(s),a.extend(o,l)):a.focusNode&&(s.setEnd(a.focusNode,a.focusOffset),a.removeAllRanges(),a.addRange(s)),this.isTextSelection||(this.selectionStartPage=this.pdfViewerBase.currentPageNumber-1),this.isTextSelection=!0,s.detach(),!0;l+=1}this.pdfViewerBase.isSelection&&(r=(e=a.getRangeAt(0).getBoundingClientRect()).left,e=e.top,this.pdfViewer.annotation.textMarkupAnnotationModule.updateLeftposition(r,e),this.pdfViewerBase.isSelection=!1),this.pdfViewer.annotation.textMarkupAnnotationModule.updatePosition(t,i)}else for(var d,p=0;p<o.childNodes.length;p++)o.childNodes[parseInt(p.toString(),10)].nodeType===o.TEXT_NODE&&((d=(s=this.getSelectionRange(p,o)).getBoundingClientRect()).left<=t&&d.right>=t&&parseInt(d.top.toString(),10)<=i&&d.bottom>=i?(s.detach(),this.textSelectionOnDrag(o.childNodes[parseInt(p.toString(),10)],t,i,n)):s.detach());return null},F2t.prototype.selectTextRegion=function(e,t){for(var i=null,n=e-1,o=0;o<t.length;o++){var r=t[parseInt(o.toString(),10)],s=(r.left||r.Left)*this.pdfViewerBase.getZoomFactor(),a=(r.top||r.Top)*this.pdfViewerBase.getZoomFactor(),r=(r.width||r.Width)*this.pdfViewerBase.getZoomFactor(),l=this.pdfViewerBase.getElement("_textLayer_"+n);if(l){for(var h=l.childNodes,d=0;d<h.length;d++)if(h[parseInt(d.toString(),10)]){var p=h[parseInt(d.toString(),10)].getBoundingClientRect(),c=this.getClientValueTop(p.top,n),u=p.left-this.pdfViewerBase.getElement("_pageDiv_"+n).getBoundingClientRect().left,p=u+p.width,g=parseInt(h[parseInt(d.toString(),10)].style.left,10),m=parseInt(h[parseInt(d.toString(),10)].style.top,10),u=this.checkLeftBounds(u,g,p,s),g=this.checkTopBounds(c,m,a);if(u&&g){i=h[parseInt(d.toString(),10)];break}}null!=i&&(l=this.pdfViewerBase.getElement("_textLayer_"+n).getBoundingClientRect(),this.textSelectionOnMouseMove(i,s+l.left,a+l.top,!1),t.length-1===o)&&this.textSelectionOnMouseMove(i,s+l.left+r,a+l.top,!1)}}},F2t.prototype.checkLeftBounds=function(e,t,i,n){var o=!1;return o=e===parseInt(n.toString(),10)||parseInt(e.toString(),10)===parseInt(n.toString(),10)||e+1===parseInt(n.toString(),10)||e-1===parseInt(n.toString(),10)||t===parseInt(n.toString(),10)||t===n||n<=i&&e<=n?!0:o},F2t.prototype.checkTopBounds=function(e,t,i){var n=!1;return n=e!==parseInt(i.toString(),10)&&parseInt(e.toString(),10)!==parseInt(i.toString(),10)&&parseInt((e+1).toString(),10)!==parseInt(i.toString(),10)&&parseInt((e-1).toString(),10)!==parseInt(i.toString(),10)&&t!==parseInt(i.toString(),10)&&t!==i?n:!0},F2t.prototype.textSelectionOnMouseLeave=function(e){var t=this,i=(e.preventDefault(),this.pdfViewerBase.viewerContainer.offsetTop);this.pdfViewer.magnificationModule&&"fitToPage"===this.pdfViewer.magnificationModule.fitType||(e.clientY>i?this.scrollMoveTimer=setInterval(function(){t.scrollForwardOnSelection()},500):this.scrollMoveTimer=setInterval(function(){t.scrollBackwardOnSelection()},500))},F2t.prototype.scrollForwardOnSelection=function(){this.pdfViewerBase.isSignInitialClick||(this.isMouseLeaveSelection=!0,this.pdfViewerBase.viewerContainer.scrollTop=this.pdfViewerBase.viewerContainer.scrollTop+200,this.stichSelectionOnScroll(this.pdfViewerBase.currentPageNumber-1))},F2t.prototype.scrollBackwardOnSelection=function(){this.isMouseLeaveSelection=!0,this.pdfViewerBase.viewerContainer.scrollTop=this.pdfViewerBase.viewerContainer.scrollTop-200,this.stichSelectionOnScroll(this.pdfViewerBase.currentPageNumber-1)},F2t.prototype.clear=function(){this.scrollMoveTimer&&(this.isMouseLeaveSelection=!1,clearInterval(this.scrollMoveTimer))},F2t.prototype.selectAWord=function(e,t,i,n){var o=0;if(F.isDevice&&!this.pdfViewer.enableDesktopMode&&(o=3),e.nodeType===e.TEXT_NODE)for(var r=window.getSelection(),s=((m=e.ownerDocument.createRange()).selectNodeContents(e),0),a=m.endOffset;s<a;){if(m.setStart(e,s),m.setEnd(e,s+1),(f=m.getBoundingClientRect()).left<=t+o&&f.right>=t-o&&f.top<=i+o&&f.bottom>=i-o){for(var l=e.textContent,h=[],d=void 0,p=void 0,c=0;c<l.length;c++)" "===l[parseInt(c.toString(),10)]&&h.push(c);for(var u=0;u<h.length;u++){if(s===h[parseInt(u.toString(),10)]&&(d=h[parseInt(u.toString(),10)],p=h[parseInt(u.toString(),10)]),s<h[0]){d=0,p=h[parseInt(u.toString(),10)];break}s>h[parseInt(u.toString(),10)]&&s<h[u+1]?(d=h[parseInt(u.toString(),10)],p=h[u+1]):s>h[parseInt(u.toString(),10)]&&(h[u+1]||(d=h[parseInt(u.toString(),10)]))}p=p||l.length,0===d?m.setStart(e,d):m.setStart(e,d+1),m.setEnd(e,p),r.removeAllRanges(),r.addRange(m),this.isTextSelection=!0;var g=je(m.startContainer.parentElement)?m.startContainer.parentNode:m.startContainer.parentElement;this.selectionStartPage=parseInt(g.id.split("_text_")[1],10),n&&(this.selectionAnchorTouch={anchorNode:r.anchorNode.parentElement.id,anchorOffset:r.anchorOffset},this.selectionFocusTouch={focusNode:r.focusNode.parentElement.id,focusOffset:r.focusOffset}),F.isIE||m.detach();break}s+=1}else for(var m,f,c=0;c<e.childNodes.length;c++)(f=(m=this.getSelectionRange(c,e)).getBoundingClientRect()).left<=t+o&&f.right>=t-o&&f.top<=i+o&&f.bottom>=i-o?(m.detach(),this.selectAWord(e.childNodes[parseInt(c.toString(),10)],t,i,n)):m.detach()},F2t.prototype.getSelectionRange=function(e,t){var i=t.childNodes[parseInt(e.toString(),10)].ownerDocument.createRange();return i.selectNodeContents(t.childNodes[parseInt(e.toString(),10)]),i},F2t.prototype.selectEntireLine=function(e){var t=[],i=e.target,n=i.getBoundingClientRect(),o=parseInt((n.top+n.height/2).toString(),10),r=parseInt(e.target.id.split("_text_")[1],10),s=document.querySelectorAll('div[id*="'+this.pdfViewer.element.id+"_text_"+r+'"]');if(i.classList.contains("e-pv-text")){this.pdfViewer.fireTextSelectionStart(r+1);for(var a=0;a<s.length;a++){var l=s[parseInt(a.toString(),10)].getBoundingClientRect(),h=parseInt(l.top.toString(),10),l=parseInt(l.bottom.toString(),10);h<=o&&o<l&&n.bottom+10>l&&""!==(h=s[parseInt(a.toString(),10)].id)&&t.push(h)}var i=window.getSelection(),r=(i.removeAllRanges(),document.createRange()),d=t.length-1,p=document.getElementById(t[0]),d=document.getElementById(t[parseInt(d.toString(),10)]);0<d.childNodes.length?(r.setStart(p.childNodes[0],0),r.setEnd(d.childNodes[0],d.textContent.length)):(r.setStart(p.childNodes[0],0),r.setEnd(d,1)),this.selectionStartPage=parseInt(r.startContainer.parentElement.id.split("_text_")[1],10),i.addRange(r),this.isTextSelection=!0,null!=i&&"MouseUp"===this.pdfViewer.contextMenuSettings.contextMenuAction&&this.calculateContextMenuPosition(e.clientY,e.clientY)}},F2t.prototype.enableTextSelectionMode=function(){this.pdfViewerBase.isTextSelectionDisabled=!1,je(this.pdfViewerBase.viewerContainer)||(this.pdfViewerBase.viewerContainer.classList.remove("e-disable-text-selection"),this.pdfViewerBase.viewerContainer.classList.add("e-enable-text-selection"),this.pdfViewerBase.viewerContainer.addEventListener("selectstart",function(e){return e.preventDefault(),!0}))},F2t.prototype.clearTextSelection=function(){if(this.isTextSelection){if(this.pdfViewerBase.textLayer.clearDivSelection(),window.getSelection&&window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges(),this.pdfViewer.linkAnnotationModule)for(var e=this.pdfViewerBase.currentPageNumber-3,t=(t=this.pdfViewer.currentPageNumber+1)<this.pdfViewerBase.pageCount-1?t:this.pdfViewerBase.pageCount-1,i=e<0?0:e;i<=t;i++)this.pdfViewer.linkAnnotationModule.modifyZindexForTextSelection(i,!1);this.pdfViewer.annotation&&this.pdfViewer.annotation.textMarkupAnnotationModule&&this.pdfViewer.annotation.textMarkupAnnotationModule.showHideDropletDiv(!0),this.selectionRangeArray=[],this.isTextSelection=!1,this.isTouchSelection=!1,this.pdfViewer.textSearchModule&&this.pdfViewer.textSearchModule.searchAfterSelection(),this.pdfViewerBase.contextMenuModule.close(),this.removeTouchElements()}},F2t.prototype.removeTouchElements=function(){this.dropDivElementLeft&&(this.dropDivElementLeft.parentElement.removeChild(this.dropDivElementLeft),this.dropDivElementLeft=null,this.dropElementLeft.style.transform="rotate(0deg)"),this.dropDivElementRight&&(this.dropDivElementRight.parentElement.removeChild(this.dropDivElementRight),this.dropDivElementRight=null,this.dropElementRight.style.transform="rotate(-90deg)")},F2t.prototype.resizeTouchElements=function(){var e,t,i,n=this.pdfViewerBase.viewerContainer.getBoundingClientRect().left;this.dropDivElementLeft&&(e=this.dropDivElementLeft.getBoundingClientRect(),t=0,i=this.pdfViewerBase.getElement("_pageDiv_"+this.topStoreLeft.pageNumber).getBoundingClientRect(),this.dropDivElementLeft.style.left=parseFloat(this.topStoreLeft.left.toString())*this.pdfViewerBase.getZoomFactor()+i.left-n-e.width/2+"px",this.topStoreLeft.isHeightNeeded&&(t=e.height/2*this.pdfViewerBase.getZoomFactor()),this.dropDivElementLeft.style.top=parseFloat(this.topStoreLeft.pageTop.toString())*this.pdfViewerBase.getZoomFactor()+parseFloat(this.topStoreLeft.topClientValue.toString())*this.pdfViewerBase.getZoomFactor()+t+"px"),this.dropDivElementRight&&(e=this.dropDivElementRight.getBoundingClientRect(),t=0,i=this.pdfViewerBase.getElement("_pageDiv_"+this.topStoreRight.pageNumber).getBoundingClientRect(),this.dropDivElementRight.style.left=parseFloat(this.topStoreRight.left.toString())*this.pdfViewerBase.getZoomFactor()+i.left-n-e.width/2+"px",this.topStoreRight.isHeightNeeded&&(t=e.height/2*this.pdfViewerBase.getZoomFactor()),this.dropDivElementRight.style.top=parseFloat(this.topStoreRight.pageTop.toString())*this.pdfViewerBase.getZoomFactor()+parseFloat(this.topStoreRight.topClientValue.toString())*this.pdfViewerBase.getZoomFactor()+t+"px")},F2t.prototype.textSelectionOnMouseup=function(e){if(this.clear(),null!==window.getSelection().anchorNode){if(this.isMouseLeaveSelection=!1,this.isSelectionStartTriggered=!1,this.maintainSelectionOnZoom(!0,!1),this.fireTextSelectEnd(),this.pdfViewerBase.textLayer.getTextSearchStatus()){this.pdfViewerBase.textLayer.clearDivSelection();for(var t=this.pdfViewer.textSearchModule.getIndexes(),i=parseFloat(t.lowerPageValue.toString()),n=parseFloat(t.higherPageValue.toString()),o=i;o<n;o++)this.applySelectionRangeOnScroll(o);this.pdfViewer.textSearchModule.searchAfterSelection()}else this.applySpanForSelection();this.pdfViewer.linkAnnotationModule&&this.pdfViewer.linkAnnotationModule.modifyZindexForTextSelection(this.pdfViewerBase.currentPageNumber-1,!1),this.isTextSearched&&"MouseUp"===this.pdfViewer.contextMenuSettings.contextMenuAction&&(this.calculateContextMenuPosition(e.clientY,e.clientX),this.isTextSearched=!1)}else this.pdfViewerBase.textLayer.clearDivSelection(),this.pdfViewer.textSearchModule&&this.pdfViewer.textSearchModule.searchAfterSelection(),this.pdfViewerBase.contextMenuModule.close(),this.removeTouchElements()},F2t.prototype.fireTextSelectEnd=function(){if(0!==this.selectionRangeArray.length){for(var e=0,t="",i=[],n=0;n<this.selectionRangeArray.length;n++){t+=this.selectionRangeArray[parseInt(n.toString(),10)].textContent;for(var o=0;o<this.selectionRangeArray[parseInt(n.toString(),10)].rectangleBounds.length;o++){var r=this.selectionRangeArray[parseInt(n.toString(),10)].rectangleBounds[parseInt(o.toString(),10)];i.push({left:r.left,right:r.right,top:r.top,bottom:r.bottom,width:r.width,height:r.height,pageIndex:this.selectionRangeArray[parseInt(n.toString(),10)].pageNumber+1})}(!this.selectionRangeArray[parseInt(n.toString(),10)].isBackward||0!==n)&&(this.selectionRangeArray[parseInt(n.toString(),10)].isBackward||n!==this.selectionRangeArray.length-1)||(e=this.selectionRangeArray[parseInt(n.toString(),10)].pageNumber+1)}this.pdfViewer.fireTextSelectionEnd(e,t,i)}},F2t.prototype.maintainSelectionOnZoom=function(e,t){var i=window.getSelection();if("Range"===i.type||!i.type&&!i.isCollapsed){var n=this.pdfViewerBase.textLayer.isBackWardSelection(i);if(null!=i.anchorNode){var o,r=parseInt(this.getNodeElementFromNode(i.anchorNode).id.split("_text_")[1],10),s=parseInt(this.getNodeElementFromNode(i.focusNode).id.split("_text_")[1],10);if(this.isTouchSelection&&isNaN(s)&&i.focusNode===this.pdfViewerBase.pageContainer&&((o=this.pdfViewerBase.pageContainer.lastChild).classList.contains("e-pv-touch-select-drop")?s=parseInt(o.previousSibling.previousSibling.id.split("_pageDiv_")[1],10):o.classList.contains("e-pv-page-div")&&(s=parseInt(o.id.split("_pageDiv_")[1],10))),n)for(a=r;s<=a;a--)this.maintainSelectionOnScroll(a,t);else for(var a=r;a<=s;a++)this.maintainSelectionOnScroll(a,t)}e||i.removeAllRanges()}},F2t.prototype.isSelectionAvailableOnScroll=function(e){for(var t=!1,i=this.selectionRangeArray,n=0;n<i.length;n++)if(null!==i[parseInt(n.toString(),10)]&&e===i[parseInt(n.toString(),10)].pageNumber){t=!0,this.isTouchSelection&&!this.pdfViewerBase.getMagnified()&&(t=!1);break}return t},F2t.prototype.applySelectionRangeOnScroll=function(e){this.isMouseLeaveSelection?this.applySelectionMouseScroll(e):this.applySelectionRange(e)},F2t.prototype.getSelectionRangeFromArray=function(e){for(var t=!1,i=null,n=this.selectionRangeArray,o=0;o<n.length;o++)if(null!==n[parseInt(o.toString(),10)]&&e===n[parseInt(o.toString(),10)].pageNumber){i=n[parseInt(o.toString(),10)],t=!0;break}return{isSelectionAvailable:t,selectionRange:i}},F2t.prototype.applySelectionRange=function(e){var t,i,n,o,r=this.getSelectionRangeFromArray(e),s=r.isSelectionAvailable,a=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+e);a&&s&&0!==a.childNodes.length&&(i=t=a=s=void 0,(r=r.selectionRange).isBackward?(n=parseInt(r.endNode.split("_text_")[1].split("_")[1],10))<(o=parseInt(r.startNode.split("_text_")[1].split("_")[1],10))?(s=n,t=r.endOffset,i=r.startOffset,a=o):(s=o,t=r.endOffset,a=n,i=r.startOffset):(s=parseInt(r.startNode.split("text_")[1].split("_")[1],10),a=parseInt(r.endNode.split("text_")[1].split("_")[1],10),t=r.startOffset,i=r.endOffset),window.getSelection().removeAllRanges(),this.pdfViewerBase.textLayer.applySpanForSelection(e,e,s,a,t,i),this.pdfViewer.textSearchModule)&&this.pdfViewer.textSearchModule.searchAfterSelection()},F2t.prototype.applySelectionMouseScroll=function(e){var t,i,n,o,r,s,a,l,h,d,e=this.getSelectionRangeFromArray(e);e.isSelectionAvailable&&(e=e.selectionRange,t=window.getSelection(),i=document.getElementById(e.startNode).childNodes[0],n=document.getElementById(e.endNode).childNodes[0],o=document.createRange(),null===t.anchorNode||(r=isNaN(parseInt(t.anchorNode.parentElement.id.split("_text_")[1],10))?parseInt(t.anchorNode.id.split("_pageDiv_")[1],10):parseInt(t.anchorNode.parentElement.id.split("_text_")[1],10),isNaN(r)&&(r=parseInt(t.anchorNode.id.split("_text_")[1],10)),s=isNaN(parseInt(t.focusNode.parentElement.id.split("_text_")[1],10))?parseInt(t.focusNode.id.split("_pageDiv_")[1],10):parseInt(t.focusNode.parentElement.id.split("_text_")[1],10),a=parseInt(e.startNode.split("_text_")[1],10),r===s&&r===a)?e.isBackward?(o.setStart(n,e.endOffset),o.setEnd(i,e.startOffset)):(o.setStart(i,e.startOffset),o.setEnd(n,e.endOffset)):isNaN(r)?isNaN(r)&&(e.isBackward?(o.setStart(n,e.endOffset),o.setEnd(i,e.startOffset)):(o.setStart(i,e.startOffset),o.setEnd(n,e.endOffset))):isNaN(r)||e.isBackward?(l=this.pdfViewerBase.textLayer.isBackWardSelection(t),a<r&&s<a&&r!==s||r<a&&a<s&&r!==s?l?t.extend(t.focusNode,t.focusOffset):(o.setStart(t.anchorNode,t.anchorOffset),o.setEnd(t.focusNode,t.focusOffset)):r<a?l?a!==this.selectionRangeArray[0].pageNumber?this.extendCurrentSelection(n.parentElement,e.endOffset,t,o):this.extendCurrentSelection(i.parentElement,e.startOffset,t,o):a!==this.selectionRangeArray[0].pageNumber?(o.setStart(t.anchorNode,t.anchorOffset),o.setEnd(n,e.endOffset)):(o.setStart(t.anchorNode,t.anchorOffset),o.setEnd(i,e.startOffset)):r===a?a===s?(o.setStart(i,e.startOffset),o.setEnd(i,e.startOffset),t.removeAllRanges(),t.addRange(o),o=document.createRange(),t.extend(n,e.endOffset)):l?this.extendCurrentSelection(n.parentElement,e.endOffset,t,o):(o.setStart(n,e.endOffset),o.setEnd(t.focusNode,t.focusOffset)):s===a?l?t.extend(t.focusNode,t.focusOffset):(o.setStart(t.anchorNode,t.anchorOffset),o.setEnd(t.focusNode,t.focusOffset)):a<r&&(h=parseInt(e.startNode.split("_"+a+"_")[1],10),d=parseInt(e.endNode.split("_"+a+"_")[1],10),l?a!==this.selectionRangeArray[0].pageNumber?h<d?this.extendCurrentSelection(i.parentElement,e.startOffset,t,o):(o.setStart(n.parentElement,e.endOffset),o.setEnd(t.anchorNode,t.anchorOffset)):this.extendCurrentSelection(n.parentElement,e.endOffset,t,o):(h<d?o.setStart(i,e.startOffset):o.setStart(n,e.endOffset),o.setEnd(t.focusNode,t.focusOffset)))):r<a&&a<s&&r!==s?(o.setStart(t.anchorNode,t.anchorOffset),o.setEnd(t.focusNode,t.focusOffset)):r<a?(o.setStart(t.anchorNode,t.anchorOffset),o.setEnd(n,e.endOffset)):(o.setStart(i,e.startOffset),o.setEnd(t.focusNode,t.focusOffset)),""!==o.toString())&&(t.removeAllRanges(),t.addRange(o))},F2t.prototype.maintainSelectionOnScroll=function(e,t){var i=this.isSelectionAvailableOnScroll(e);this.isTextSelection&&!i&&this.maintainSelection(e,t)},F2t.prototype.maintainSelection=function(e,t){var i,n,o,r,s,a,l,h,d=window.getSelection();!this.isTextSelection||"Range"!==d.type&&(d.type||d.isCollapsed)||(i=parseInt(this.getNodeElementFromNode(d.anchorNode).id.split("_text_")[1],10),n=parseInt(this.getNodeElementFromNode(d.focusNode).id.split("_text_")[1],10),isNaN(n)&&null!==d.anchorNode&&(n=this.pdfViewerBase.textLayer.isBackWardSelection(d)?parseInt(this.pdfViewerBase.pageContainer.firstChild.id.split("_pageDiv_")[1],10):(o=this.pdfViewerBase.pageContainer.lastChild).classList.contains("e-pv-touch-select-drop")?parseInt(o.previousSibling.previousSibling.id.split("_pageDiv_")[1],10):parseInt(o.id.split("_pageDiv_")[1],10)),o=this.pdfViewerBase.textLayer.isBackWardSelection(d),this.isTouchSelection&&n<e&&i<e)||(i===n?(h=null,r=this.getSelectionBounds(d.getRangeAt(0),e),s=this.getSelectionRectangleBounds(d.getRangeAt(0),e),a=1===this.getNodeElementFromNode(d.anchorNode).childNodes.length?d.anchorOffset:this.getCorrectOffset(d.anchorNode,d.anchorOffset),l=1===this.getNodeElementFromNode(d.focusNode).childNodes.length?d.focusOffset:this.getCorrectOffset(d.focusNode,d.focusOffset),h={isBackward:o,startNode:this.getNodeElementFromNode(d.anchorNode).id,startOffset:a,endNode:this.getNodeElementFromNode(d.focusNode).id,endOffset:l,textContent:this.allTextContent,pageNumber:e,bound:r,rectangleBounds:s},this.pushSelectionRangeObject(h,e)):(h=this.createRangeObjectOnScroll(e,i,n))&&(this.pushSelectionRangeObject(h,e),t)&&this.stichSelection(o,d,e))},F2t.prototype.getCorrectOffset=function(e,t){for(var i=0,n=this.getNodeElementFromNode(e),o=0;o<n.childNodes.length;o++){if(n.childNodes[parseInt(o.toString(),10)]===e){i+=t;break}i+=n.childNodes[parseInt(o.toString(),10)].textContent.length}return i},F2t.prototype.pushSelectionRangeObject=function(e,t){if(this.isTouchSelection){var i=this.selectionRangeArray.filter(function(e){return e.pageNumber===t});if(0<i.length)return i=this.selectionRangeArray.indexOf(i[0]),void this.selectionRangeArray.splice(i,1,e)}var n,i=this.selectionRangeArray.filter(function(e){return e.pageNumber===t+1});0===i.length?this.isTouchSelection&&0!==this.selectionRangeArray.length?0!==(n=this.selectionRangeArray.filter(function(e){return e.pageNumber===t-1})).length?(n=this.selectionRangeArray.indexOf(n[0]),this.selectionRangeArray.splice(n+1,0,e)):(n=this.selectionRangeArray[0],t<n.pageNumber?this.selectionRangeArray.splice(0,0,e):this.selectionRangeArray.push(e)):this.selectionRangeArray.push(e):(n=this.selectionRangeArray.indexOf(i[0]),this.selectionRangeArray.splice(n,0,e))},F2t.prototype.extendCurrentSelection=function(e,t,i,n){var o=i.focusOffset,r=i.focusNode.parentElement.id,s=isNaN(parseInt(r.split("_text_")[1],10))?parseInt(i.focusNode.id.split("_pageDiv_")[1],10):parseInt(r.split("_text_")[1],10);isNaN(parseInt(r.split("_text_")[1],10))&&(r=this.pdfViewerBase.getElement("_textLayer_"+(s+1)).firstChild.id),n.setStart(e.childNodes[0],t),n.setEnd(e.childNodes[0],t),i.removeAllRanges(),i.addRange(n),i.extend(document.getElementById(r).childNodes[0],o)},F2t.prototype.stichSelection=function(e,t,i){var n,o,r=document.createRange();e?(n=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+(i-1)))?(o=(o=n.lastChild)||(n=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+(i-2))).lastChild,this.extendCurrentSelection(o,this.getTextLastLength(o),t,r)):(o=(n=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+(i+1))).firstChild,this.extendCurrentSelection(o,0,t,r)):(n=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+(i+1)))&&(e=(e=n.firstChild)||(n=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+(i+2))).firstChild,r.setStart(e.childNodes[0],0),r.setEnd(t.focusNode,t.focusOffset),t.removeAllRanges(),t.addRange(r))},F2t.prototype.textSelectionOnMouseWheel=function(e){this.isMouseLeaveSelection=!0,this.stichSelectionOnScroll(e)},F2t.prototype.stichSelectionOnScroll=function(e){var t,i,n,o,r=window.getSelection();this.isTextSelection&&(o=parseInt(this.getNodeElementFromNode(r.anchorNode).id.split("_text_")[1],10),t=parseInt(this.getNodeElementFromNode(r.focusNode).id.split("_text_")[1],10),n=void 0,o!==e&&t!==e&&(this.pdfViewerBase.textLayer.isBackWardSelection(r)?(n=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+(e-1)))&&(i=n.firstChild)&&this.extendSelectionStich(i.childNodes[0],0,r):(n=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+(e-1)))&&((i=n.lastChild)?i.childNodes[0]?this.extendSelectionStich(i.childNodes[0],this.getTextLastLength(i),r):this.extendSelectionStich(i,this.getTextLastLength(i),r):(o=(n=this.pdfViewerBase.getElement("_textLayer_"+e)).firstChild,this.extendSelectionStich(o.childNodes[0],0,r)))),this.maintainSelectionArray())},F2t.prototype.extendSelectionStich=function(e,t,i){i.extend&&i.extend(e,t)},F2t.prototype.createRangeObjectOnScroll=function(e,t,i){var n=window.getSelection();if(null!==n.anchorNode){var o=this.pdfViewerBase.textLayer.isBackWardSelection(n),r=void 0,s=void 0,a=void 0,l=void 0,h=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+e);if(h.childNodes)return o?e===t?(r=this.getNodeElementFromNode(n.anchorNode),s=h.firstChild,a=this.getCorrectOffset(n.anchorNode,n.anchorOffset),l=0):e<t&&i<e?(r=h.firstChild,s=h.lastChild,a=0,l=this.getTextLastLength(s)):e===i&&(r=this.getNodeElementFromNode(n.focusNode),s=h.lastChild,a=this.getCorrectOffset(n.focusNode,n.focusOffset),l=this.getTextLastLength(s)):e===t?(r=this.getNodeElementFromNode(n.anchorNode),s=h.lastChild,a=this.getCorrectOffset(n.anchorNode,n.anchorOffset),l=this.getTextLastLength(s)):t<e&&e<i?(r=h.firstChild,s=h.lastChild,a=0,l=this.getTextLastLength(s)):e===i&&(r=h.firstChild,l=-1!==this.getNodeElementFromNode(n.focusNode).id.indexOf(i.toString())?(s=this.getNodeElementFromNode(n.focusNode),this.getCorrectOffset(n.focusNode,n.focusOffset)):(s=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+i).lastChild,this.getTextLastLength(s)),a=0),r&&s?(t=this.getSelectionRangeObject(r.id,a,s.id,l,e),h=this.getSelectionBounds(t,e),n=this.getSelectionRectangleBounds(t,e),{isBackward:o,startNode:r.id,startOffset:a,endNode:s.id,endOffset:l,textContent:this.allTextContent,pageNumber:e,bound:h,rectangleBounds:n}):null}return null},F2t.prototype.getSelectionRangeObject=function(e,t,i,n,o){var r=document.getElementById(e),s=document.getElementById(i),e=(r.childNodes[0]&&(r=r.childNodes[0]),s.childNodes[0]&&(s=s.childNodes[0]),parseInt(e.split("_"+o+"_")[1],10)),i=parseInt(i.split("_"+o+"_")[1],10),o=document.createRange();return e<=i?(o.setStart(r,t),o.setEnd(s,n)):(o.setStart(s,n),o.setEnd(r,t)),o},F2t.prototype.getSelectionBounds=function(e,t){var i;return this.getNodeElementFromNode(e.startContainer)!==this.getNodeElementFromNode(e.endContainer)?(i=document.createRange(),i=this.createRangeForSelection(e.startContainer,e.endContainer,e.startOffset,e.endOffset,i),this.normalizeBounds(i.getBoundingClientRect(),t)):this.normalizeBounds(e.getBoundingClientRect(),t)},F2t.prototype.getSelectionRectangleBounds=function(e,t){var i=[],n=this.getNodeElementFromNode(e.startContainer),o=this.getNodeElementFromNode(e.endContainer),r=null,s=[];if(this.allTextContent="",n!==o){for(var a=0,l=0,o=this.pdfViewerBase.textLayer.getPageIndex(e.startContainer),h=this.pdfViewerBase.textLayer.getTextIndex(e.startContainer,o),d=this.pdfViewerBase.textLayer.getPageIndex(e.endContainer),p=this.pdfViewerBase.textLayer.getTextIndex(e.endContainer,d),c=this.pdfViewerBase.getElement("_textLayer_"+d).childNodes,u=t===o?h:0;u<c.length;u++){var g=c[parseInt(u.toString(),10)];if(p<u)break;if(a=u===h?e.startOffset:0,l=u===p?e.endOffset:g.textContent.length,0!==a||0!==l){for(var m=document.createRange(),f=0;f<g.childNodes.length;f++){var y=g.childNodes[parseInt(f.toString(),10)];m.setStart(y,a),m.setEnd(y,l)}var v=void 0,v=(this.pdfViewerBase.clientSideRendering?(v=this.normalizeBounds(m.getBoundingClientRect(),t),C=0,g&&""!==g.style.transform&&(C=g.style.transform.startsWith("rotate(90deg)")?90:g.style.transform.startsWith("rotate(180deg)")?180:g.style.transform.startsWith("rotate(-90deg)")||g.style.transform.startsWith("rotate(270deg)")?270:0),v.rotation=C):v=this.normalizeBounds(m.getBoundingClientRect(),t),i.push(v),m.toString());if(s.push(v),m.detach(),"\r\n"===v||" "===v){if(u===p+1)break}else if(u===p)break}}for(var b=0;b<s.length;b++){var w=s[parseInt(b.toString(),10)];(w=0!==b&&" "===w&&s[b-1].includes("\r\n")||b!==s.length-1&&" "===s[parseInt(b.toString(),10)]&&"\r\n"===s[b+1]?"":w).slice(w.length-2),this.allTextContent+=w}}else{var C,r=this.normalizeBounds(e.getBoundingClientRect(),t);this.pdfViewerBase.clientSideRendering&&(C=0,n&&""!==n.style.transform&&(C=n.style.transform.startsWith("rotate(90deg)")?90:n.style.transform.startsWith("rotate(180deg)")?180:n.style.transform.startsWith("rotate(-90deg)")||n.style.transform.startsWith("rotate(270deg)")?270:0),r.rotation=C),this.allTextContent=e.toString(),i.push(r)}return i},F2t.prototype.getAngle=function(e){var t=0;if(e)switch(e){case 0:t=0;break;case 1:t=90;break;case 2:t=180;break;case 3:t=270}return t},F2t.prototype.getTextId=function(e){var t=e.lastIndexOf("_"),t=e.substring(t+1,e.length);return parseInt(t,10)},F2t.prototype.normalizeBounds=function(e,t){var i=this.pdfViewerBase.getElement("_pageDiv_"+t),t=(i=this.pdfViewerBase.isMixedSizeDocument&&(t=this.pdfViewerBase.getElement("_textLayer_"+t))?t:i).getBoundingClientRect();return{bottom:this.getMagnifiedValue(e.bottom-t.top),height:this.getMagnifiedValue(e.height),left:this.getMagnifiedValue(e.left-t.left),top:this.getMagnifiedValue(e.top-t.top),right:this.getMagnifiedValue(e.right-t.left),width:this.getMagnifiedValue(e.width)}},F2t.prototype.getMagnifiedValue=function(e){return e/this.pdfViewerBase.getZoomFactor()},F2t.prototype.getCurrentSelectionBounds=function(e){for(var t=null,i=this.selectionRangeArray,n=0;n<i.length;n++)null!==i[parseInt(n.toString(),10)]&&e===i[parseInt(n.toString(),10)].pageNumber&&(t=i[parseInt(n.toString(),10)].bound);return t},F2t.prototype.createRangeForSelection=function(e,t,i,n,o){return o.setStart(e,i),o.setEnd(t,n),o},F2t.prototype.maintainSelectionArray=function(){var t=this;if(0!==this.selectionRangeArray.length){var e=window.getSelection(),i=this.pdfViewerBase.textLayer.isBackWardSelection(e),n=isNaN(parseInt(this.getNodeElementFromNode(e.anchorNode).id.split("_text_")[1],10))?parseInt(e.anchorNode.id.split("_pageDiv_")[1],10):parseInt(this.getNodeElementFromNode(e.anchorNode).id.split("_text_")[1],10),o=(isNaN(n)&&(n=parseInt(e.anchorNode.id.split("_text_")[1],10)),isNaN(parseInt(this.getNodeElementFromNode(e.focusNode).id.split("_text_")[1],10))?parseInt(e.focusNode.id.split("_pageDiv_")[1],10):parseInt(this.getNodeElementFromNode(e.focusNode).id.split("_text_")[1],10)),r=(isNaN(o)&&(o=isNaN(parseInt(e.focusNode.id.split("_text_")[1],10))?parseInt(e.focusNode.id.split("_textLayer_")[1],10):parseInt(e.focusNode.id.split("_text_")[1],10)),[]);if(0<(r=i?this.selectionRangeArray.filter(function(e){return!(o<e.pageNumber&&e.pageNumber<=t.selectionStartPage)}):this.selectionRangeArray.filter(function(e){return!(t.selectionStartPage<=e.pageNumber&&e.pageNumber<o)})).length){for(var s=0;s<r.length;s++){var a=this.selectionRangeArray.indexOf(r[parseInt(s.toString(),10)]);-1!==a&&this.selectionRangeArray.splice(a,1)}1===this.selectionRangeArray.length&&this.selectionRangeArray[0].pageNumber!==n&&this.selectionRangeArray[0].pageNumber}}},F2t.prototype.applySpanForSelection=function(){var e,t,i,n,o,r,s,a,l,h,d,p=window.getSelection();p.anchorNode!==p.focusNode||p.anchorOffset!==p.focusOffset||p.isCollapsed||p.removeAllRanges(),null!==p.anchorNode&&this.pdfViewerBase.viewerContainer.contains(this.getNodeElementFromNode(p.anchorNode))&&(d=i=t=e=s=o=void 0,d=this.pdfViewerBase.textLayer.isBackWardSelection(p)?(o=parseInt(this.getNodeElementFromNode(p.focusNode).id.split("_text_")[1],10),s=parseInt(this.getNodeElementFromNode(p.anchorNode).id.split("_text_")[1],10),e=parseInt(this.getNodeElementFromNode(p.focusNode).id.split("_text_")[1].split("_")[1],10),t=parseInt(this.getNodeElementFromNode(p.anchorNode).id.split("_text_")[1].split("_")[1],10),i=p.focusOffset,p.anchorOffset):(n=this.getNodeElementFromNode(p.anchorNode),a=this.getNodeElementFromNode(p.focusNode),o=-1!==n.id.indexOf("text_")?parseInt(n.id.split("text_")[1],10):parseInt(n.id.split("_textLayer_")[1],10),s=-1!==a.id.indexOf("text_")?parseInt(a.id.split("text_")[1],10):parseInt(a.id.split("_textLayer_")[1],10),l=!1,this.isTouchSelection&&p.focusNode===this.pdfViewerBase.pageContainer&&((r=this.pdfViewerBase.pageContainer.lastChild).classList.contains("e-pv-touch-select-drop")?(h=r.previousSibling.previousSibling,s=parseInt(h.id.split("_pageDiv_")[1],10),a=this.pdfViewerBase.getElement("_textLayer_"+s).lastChild,l=!0):r.classList.contains("e-pv-page-div")&&(h=r,s=parseInt(h.id.split("_pageDiv_")[1],10),a=this.pdfViewerBase.getElement("_textLayer_"+s).lastChild,l=!0)),n.classList.contains("e-pv-maintaincontent")&&(n=this.getNodeElementFromNode(n),o=parseInt(n.id.split("text_")[1],10)),a.classList.contains("e-pv-maintaincontent")&&(a=this.getNodeElementFromNode(a),s=parseInt(a.id.split("text_")[1],10)),o===s&&(n.contains(a)&&(n=a),a.contains(n))&&(a=n),e=n.id.split("text_")[1]?parseInt(n.id.split("text_")[1].split("_")[1],10):null,t=a.id.split("text_")[1]?parseInt(a.id.split("text_")[1].split("_")[1],10):null,e=isNaN(e)?t:e,t=isNaN(t)?e:t,i=p.anchorOffset,l?a.textContent.length:p.focusOffset),this.pdfViewerBase.checkIsNormalText()&&(p.removeAllRanges(),this.pdfViewerBase.textLayer.clearDivSelection(),this.pdfViewerBase.textLayer.applySpanForSelection(o,s,e,t,i,d)),this.pdfViewer.textSearchModule)&&this.pdfViewer.textSearchModule.searchAfterSelection()},F2t.prototype.initiateTouchSelection=function(e,t,i){this.pdfViewerBase.isShapeBasedAnnotationsEnabled()&&0<this.pdfViewer.selectedItems.annotations.length&&this.pdfViewer.clearSelection(this.pdfViewer.selectedItems.annotations[0].pageIndex);var n=e.target,o=document.elementsFromPoint(e.touches[0].clientX,e.touches[0].clientY),o=(0!==o.length&&o[0].classList.contains("e-pv-hyperlink")&&o[1].classList.contains("e-pv-text")&&(n=o[1]),parseFloat(n.id.split("_")[2]));this.pdfViewer.fireTextSelectionStart(o+1),this.selectAWord(n,t,i,!0),this.createTouchSelectElement(e),this.maintainSelectionOnZoom(!0,!1),this.fireTextSelectEnd(),this.applySpanForSelection()},F2t.prototype.selectTextByTouch=function(e,t,i,n,o,r){var s=!1;if(e.nodeType===e.TEXT_NODE)for(var a=e.ownerDocument.createRange(),l=window.getSelection(),h=(a.selectNodeContents(e),0),d=a.endOffset;h<d;){if(a.setStart(e,h),a.setEnd(e,h+1),(c=a.getBoundingClientRect()).left<=t&&c.right>=t&&c.top<=i&&c.bottom>=i)return null!==l.anchorNode&&(n&&a.setStart(l.anchorNode,l.anchorOffset),a=this.setTouchSelectionStartPosition(l,a,n,o,e,h,r),n&&l.extend(e,h),s=!0),a.detach(),s;h+=1}else for(var p=0;p<e.childNodes.length;p++){var c,u=e.childNodes[parseInt(p.toString(),10)].ownerDocument.createRange();if(u.selectNodeContents(e.childNodes[parseInt(p.toString(),10)]),(c=u.getBoundingClientRect()).left<=t&&c.right>=t&&c.top<=i&&c.bottom>=i)return u.detach(),this.selectTextByTouch(e.childNodes[parseInt(p.toString(),10)],t,i,n,o,r);u.detach()}return s},F2t.prototype.setTouchSelectionStartPosition=function(e,t,i,n,o,r,s){var a;return i?"left"===n?(a=this.getTouchFocusElement(e,!0),t.setStart(a.focusNode,a.focusOffset),t.setEnd(o,r),this.selectionAnchorTouch={anchorNode:t.endContainer.parentElement.id,anchorOffset:t.endOffset}):"right"===n&&(a=this.getTouchAnchorElement(e,!1),t.setStart(a.anchorNode,a.anchorOffset),t.setEnd(o,r),this.selectionFocusTouch={focusNode:t.endContainer.parentElement.id,focusOffset:t.endOffset}):"left"===n?(!s&&(a=this.getTouchFocusElement(e,!1),t.setStart(o,r),t.setEnd(a.focusNode,a.focusOffset),""!==t.toString())||(t.setStart(o,r),t.setEnd(e.focusNode,e.focusOffset)),this.selectionAnchorTouch={anchorNode:t.startContainer.parentElement.id,anchorOffset:t.startOffset}):"right"===n&&(a=this.getTouchAnchorElement(e,!0),t.setStart(o,r),t.setEnd(a.anchorNode,a.anchorOffset),""===t.toString()&&(t.setStart(a.anchorNode,a.anchorOffset),t.setEnd(o,r)),this.selectionFocusTouch={focusNode:t.startContainer.parentElement.id,focusOffset:t.startOffset}),e.removeAllRanges(),e.addRange(t),t},F2t.prototype.getTouchAnchorElement=function(e,t){var i=document.getElementById(this.selectionAnchorTouch.anchorNode.toString()),n=null,o=0,o=i?(n=i.childNodes[0],parseInt(this.selectionAnchorTouch.anchorOffset.toString(),10)):t?(n=e.focusNode,e.focusOffset):(n=e.anchorNode,e.anchorOffset);return{anchorNode:n,anchorOffset:o}},F2t.prototype.getTouchFocusElement=function(e,t){var i=document.getElementById(this.selectionFocusTouch.focusNode.toString()),n=null,o=0,o=i?(n=i.childNodes[0],parseInt(this.selectionFocusTouch.focusOffset.toString(),10)):t?(n=e.anchorNode,e.anchorOffset):(n=e.focusNode,e.focusOffset);return{focusNode:n,focusOffset:o}},F2t.prototype.createTouchSelectElement=function(e){this.isTouchSelection=!0;var t,i,n,o,r,s=window.getSelection();"Range"===s.type&&(this.dropDivElementLeft=Q("div",{id:this.pdfViewer.element.id+"_touchSelect_droplet_left",className:"e-pv-touch-select-drop"}),this.dropDivElementRight=Q("div",{id:this.pdfViewer.element.id+"_touchSelect_droplet_right",className:"e-pv-touch-select-drop"}),this.dropElementLeft=Q("div",{className:"e-pv-touch-ellipse"}),this.dropElementLeft.style.transform="rotate(0deg)",this.dropDivElementLeft.appendChild(this.dropElementLeft),this.dropElementRight=Q("div",{className:"e-pv-touch-ellipse"}),this.dropElementRight.style.transform="rotate(-90deg)",this.dropElementRight.style.margin="0 9px 0 0",this.dropDivElementRight.appendChild(this.dropElementRight),this.pdfViewerBase.pageContainer.appendChild(this.dropDivElementLeft),this.pdfViewerBase.pageContainer.appendChild(this.dropDivElementRight),s=s.getRangeAt(0).getBoundingClientRect(),o=this.dropDivElementLeft.getBoundingClientRect(),t=this.pdfViewerBase.pageSize[this.pdfViewerBase.currentPageNumber-1].top,i=this.pdfViewerBase.viewerContainer.getBoundingClientRect().left,r=(n=this.getClientValueTop(s.top,this.pdfViewerBase.currentPageNumber-1))-(2<this.pdfViewerBase.getZoomFactor()?8:1<this.pdfViewerBase.getZoomFactor()?4:0)+t*this.pdfViewerBase.getZoomFactor()+o.height/2*this.pdfViewerBase.getZoomFactor()+"px",this.dropDivElementLeft.style.top=r,this.dropDivElementLeft.style.left=s.left-(i+o.width)+this.pdfViewerBase.viewerContainer.scrollLeft+"px",this.dropDivElementRight.style.top=r,this.dropDivElementRight.style.left=s.left+s.width-i+this.pdfViewerBase.viewerContainer.scrollLeft+"px",o=this.pdfViewerBase.getElement("_pageDiv_"+(this.pdfViewerBase.currentPageNumber-1)).getBoundingClientRect().left,r=s.left-o,this.topStoreLeft={pageTop:t,topClientValue:this.getMagnifiedValue(n),pageNumber:this.pdfViewerBase.currentPageNumber-1,left:this.getMagnifiedValue(r),isHeightNeeded:!0},this.topStoreRight={pageTop:t,topClientValue:this.getMagnifiedValue(n),pageNumber:this.pdfViewerBase.currentPageNumber-1,left:this.getMagnifiedValue(r+s.width),isHeightNeeded:!0},this.dropDivElementLeft.addEventListener("touchstart",this.onLeftTouchSelectElementTouchStart),this.dropDivElementLeft.addEventListener("touchmove",this.onLeftTouchSelectElementTouchMove),this.dropDivElementLeft.addEventListener("touchend",this.onLeftTouchSelectElementTouchEnd),this.dropDivElementRight.addEventListener("touchstart",this.onRightTouchSelectElementTouchStart),this.dropDivElementRight.addEventListener("touchmove",this.onRightTouchSelectElementTouchMove),this.dropDivElementRight.addEventListener("touchend",this.onRightTouchSelectElementTouchEnd),this.calculateContextMenuPosition(e.touches[0].clientY+this.dropDivElementLeft.clientHeight+10,parseInt(this.dropDivElementLeft.style.left,10)-10))},F2t.prototype.calculateContextMenuPosition=function(t,i){var e,n=this,o=(F.isDevice&&!this.pdfViewer.enableDesktopMode&&((e=t-this.contextMenuHeight)<this.pdfViewerBase.toolbarHeight?t+=this.contextMenuHeight:t=e,t+this.contextMenuHeight>window.innerHeight)&&(t-=this.contextMenuHeight),"MouseUp"===this.pdfViewer.contextMenuSettings.contextMenuAction&&(i-=50),this);setTimeout(function(){var e=document.getElementsByClassName("e-pv-maintaincontent").length,e=document.getElementsByClassName("e-pv-maintaincontent")[e-1]?document.getElementsByClassName("e-pv-maintaincontent")[e-1].getBoundingClientRect():null;e&&(t=e.bottom+o.contextMenuHeight+o.pdfViewerBase.toolbarHeight>window.innerHeight?e.top-(o.contextMenuHeight+o.pdfViewerBase.toolbarHeight-10):o.dropDivElementRight?e.bottom+o.dropDivElementRight.clientHeight:e.bottom,i=e.right,(e=n.pdfViewer.toolbarModule?n.pdfViewer.toolbarModule.annotationToolbarModule:"null")&&e.textMarkupToolbarElement&&0!==e.textMarkupToolbarElement.children.length||o.pdfViewerBase.contextMenuModule.open(t,i,o.pdfViewerBase.viewerContainer))})},F2t.prototype.initiateSelectionByTouch=function(){this.pdfViewerBase.textLayer.clearDivSelection(),this.pdfViewerBase.contextMenuModule.close();for(var e=this.pdfViewerBase.currentPageNumber-3,t=(t=this.pdfViewer.currentPageNumber+1)<this.pdfViewerBase.pageCount-1?t:this.pdfViewerBase.pageCount-1,i=e<0?0:e;i<=t;i++){var n=this.pdfViewerBase.getElement("_textLayer_"+i);n&&null!==n.childNodes&&this.applySelectionMouseScroll(i)}0<this.selectionRangeArray.length&&this.pdfViewer.fireTextSelectionStart(this.selectionRangeArray[0].pageNumber+1)},F2t.prototype.terminateSelectionByTouch=function(e){var t,i;this.maintainSelectionOnZoom(!0,!1),this.applySpanForSelection(),this.pdfViewerBase.getTextMarkupAnnotationMode()?this.pdfViewer.annotationModule.textMarkupAnnotationModule.drawTextMarkupAnnotations(this.pdfViewer.annotationModule.textMarkupAnnotationModule.currentTextMarkupAddMode):(this.fireTextSelectEnd(),t=e.changedTouches[0].clientY,(i=this.getSpanBounds())&&(i.bottom+this.contextMenuHeight+this.pdfViewerBase.toolbarHeight>window.innerHeight&&(t=i.top-(this.contextMenuHeight+this.pdfViewerBase.toolbarHeight)),this.pdfViewerBase.contextMenuModule.open(t,e.changedTouches[0].clientX,this.pdfViewerBase.viewerContainer)))},F2t.prototype.getSpanBounds=function(){var e=[],t=[],i=[],n=0,o=document.getElementsByClassName("e-pv-maintaincontent");if(0<o.length){for(var r=0;r<o.length;r++){var s=o[parseInt(r.toString(),10)].getBoundingClientRect();n+=s.height,e.push(s.width),t.push(s.right),i.push(s.left)}return{top:o[0].getBoundingClientRect().top,bottom:o[o.length-1].getBoundingClientRect().bottom,left:Math.min.apply(null,i),right:Math.max.apply(null,t),width:Math.max.apply(null,e),height:n}}},F2t.prototype.getNodeElement=function(e,t,i,n,o){var r;return document.caretRangeFromPoint?(e=document.caretRangeFromPoint(t,i),o=this.onTouchElementScroll(e,o,i,n)):document.caretPositionFromPoint&&(r=document.caretPositionFromPoint(t,i),t=document.caretPositionFromPoint(t,i),(e=document.createRange()).setStart(r.offsetNode,r.offset),e.setEnd(t.offsetNode,t.offset),o=this.onTouchElementScroll(e,o,i,n)),o},F2t.prototype.isTouchedWithinContainer=function(e){var t=!1;return t=0!==document.elementsFromPoint(e.touches[0].clientX,e.touches[0].clientY).length?!0:t},F2t.prototype.onTouchElementScroll=function(e,t,i,n){var o=this.pdfViewerBase.viewerContainer.scrollTop;return null!=e&&(t=e.startContainer,e=this.isScrolledOnScrollBar(n),this.pdfViewerBase.viewerContainer.contains(t.parentElement))&&!e||(i<this.pdfViewerBase.viewerContainer.clientHeight?this.pdfViewerBase.viewerContainer.scrollTop=o-30:this.pdfViewerBase.viewerContainer.scrollTop=o+30),t},F2t.prototype.isCloserTouchScroll=function(e){var t=!1;return t=this.previousScrollDifference>e?!0:t},F2t.prototype.getClientValueTop=function(e,t){return this.pdfViewerBase.getElement("_pageDiv_"+t)?e-this.pdfViewerBase.getElement("_pageDiv_"+t).getBoundingClientRect().top:e},F2t.prototype.isScrolledOnScrollBar=function(e){var t=!1;return t=e.touches&&this.pdfViewerBase.viewerContainer.clientHeight+this.pdfViewerBase.viewerContainer.offsetTop<e.touches[0].clientY&&e.touches[0].clientY<this.pdfViewerBase.viewerContainer.offsetHeight+this.pdfViewerBase.viewerContainer.offsetTop?!0:t},F2t.prototype.getTextLastLength=function(e){return e?e.textContent.length:0},F2t.prototype.getNodeElementFromNode=function(e){return e.parentElement||e.parentNode},F2t.prototype.copyText=function(){var e="";if(this.maintainSelectionOnZoom(!0,!1),0<this.selectionRangeArray.length)for(var t=0;t<this.selectionRangeArray.length;t++)e+=this.selectionRangeArray[parseInt(t.toString(),10)].textContent;if(0<e.length){this.pdfViewer.annotation&&(this.pdfViewer.annotation.isShapeCopied=!1);var i=document.createElement("textarea");i.contentEditable="true",i.textContent=e,this.pdfViewer.annotation&&this.pdfViewer.annotation.freeTextAnnotationModule&&(this.pdfViewer.annotation.freeTextAnnotationModule.selectedText=e),i.style.position="fixed",document.body.appendChild(i),i.select();try{document.execCommand("copy")}catch(e){console.warn("Copy to clipboard failed.",e)}finally{i&&document.body.removeChild(i)}}},F2t.prototype.destroy=function(){this.clear()},F2t.prototype.getModuleName=function(){return"TextSelection"};var B2t=F2t;function F2t(e,t){var l=this;this.isTextSelection=!1,this.selectionStartPage=null,this.isBackwardPropagatedSelection=!1,this.contextMenuHeight=144,this.backwardStart=0,this.selectionRangeArray=[],this.selectionAnchorTouch=null,this.selectionFocusTouch=null,this.scrollMoveTimer=0,this.isMouseLeaveSelection=!1,this.isTouchSelection=!1,this.previousScrollDifference=0,this.topStoreLeft=null,this.topStoreRight=null,this.isTextSearched=!1,this.isSelectionStartTriggered=!1,this.allTextContent="",this.onLeftTouchSelectElementTouchStart=function(e){l.initiateSelectionByTouch()},this.onRightTouchSelectElementTouchStart=function(e){l.initiateSelectionByTouch()},this.onLeftTouchSelectElementTouchEnd=function(e){l.terminateSelectionByTouch(e)},this.onRightTouchSelectElementTouchEnd=function(e){l.terminateSelectionByTouch(e)},this.onLeftTouchSelectElementTouchMove=function(e){e.preventDefault(),e.target.style.zIndex="0";var t,i,n,o,r,s=l.dropDivElementRight,a=l.isTouchedWithinContainer(e);s&&a&&(a=s.getBoundingClientRect(),s=e.changedTouches[0].clientX,t=e.changedTouches[0].clientY,e.target.style.zIndex="1000",r=l.getNodeElement(void 0,s,t,e,r))&&(e=Math.sqrt((t-a.top)*(t-a.top)+(s-a.left)*(s-a.left)),i=l.isCloserTouchScroll(e),o=l.pdfViewerBase.getZoomFactor(),n=Math.abs(t-a.top),o=1<o?15:.7<o?10:.5<o?8:4,parseInt(t.toString(),10)<=parseInt(a.top.toString(),10)&&parseInt(n.toString(),10)>=o||parseInt(s.toString(),10)<=parseInt(a.left.toString(),10)&&parseInt(n.toString(),10)<=o?(l.dropElementLeft.style.transform="rotate(0deg)",l.dropElementRight.style.transform="rotate(-90deg)",l.selectTextByTouch(r.parentElement,s,t,!1,"left",i)):(l.dropElementLeft.style.transform="rotate(-90deg)",l.dropElementRight.style.transform="rotate(0deg)",l.selectTextByTouch(r.parentElement,s,t,!0,"left",i)))&&(a=l.dropDivElementLeft.getBoundingClientRect(),n=l.pdfViewerBase.pageSize[l.pdfViewerBase.currentPageNumber-1].top,o=l.getClientValueTop(t,l.pdfViewerBase.currentPageNumber-1),r=s-l.pdfViewerBase.getElement("_pageDiv_"+(l.pdfViewerBase.currentPageNumber-1)).getBoundingClientRect().left,l.dropDivElementLeft.style.top=n*l.pdfViewerBase.getZoomFactor()+o+"px",l.topStoreLeft={pageTop:n,topClientValue:l.getMagnifiedValue(o),pageNumber:l.pdfViewerBase.currentPageNumber-1,left:l.getMagnifiedValue(r),isHeightNeeded:!1},l.dropDivElementLeft.style.left=s-l.pdfViewerBase.viewerContainer.getBoundingClientRect().left-a.width/2+l.pdfViewerBase.viewerContainer.scrollLeft+"px",l.previousScrollDifference=e)},this.onRightTouchSelectElementTouchMove=function(e){e.preventDefault(),e.target.style.zIndex="0";var t,i,n,o,r,s=l.dropDivElementLeft,a=l.isTouchedWithinContainer(e);s&&a&&(a=s.getBoundingClientRect(),s=e.changedTouches[0].clientX,t=e.changedTouches[0].clientY,e.target.style.zIndex="1000",r=l.getNodeElement(void 0,s,t,e,r))&&(e=Math.sqrt((t-a.top)*(t-a.top)+(s-a.left)*(s-a.left)),i=l.isCloserTouchScroll(e),o=l.pdfViewerBase.getZoomFactor(),n=Math.abs(t-a.top),o=1<o?25*o:.7<o?15:.5<o?8:7,parseInt(t.toString(),10)>=parseInt(a.top.toString(),10)&&parseInt(n.toString(),10)>=o||parseInt(n.toString(),10)<=o&&parseInt(s.toString(),10)>=parseInt(a.left.toString(),10)?(l.dropElementRight.style.transform="rotate(-90deg)",l.dropElementLeft.style.transform="rotate(0deg)",l.selectTextByTouch(r.parentElement,s,t,!0,"right",i)):(l.dropElementRight.style.transform="rotate(0deg)",l.dropElementLeft.style.transform="rotate(-90deg)",l.selectTextByTouch(r.parentElement,s,t,!1,"right",i)))&&(n=l.pdfViewerBase.pageSize[l.pdfViewerBase.currentPageNumber-1].top,o=l.getClientValueTop(t,l.pdfViewerBase.currentPageNumber-1),a=l.dropDivElementRight.getBoundingClientRect(),l.dropDivElementRight.style.top=n*l.pdfViewerBase.getZoomFactor()+o+"px",r=s-l.pdfViewerBase.getElement("_pageDiv_"+(l.pdfViewerBase.currentPageNumber-1)).getBoundingClientRect().left,l.topStoreRight={pageTop:n,topClientValue:l.getMagnifiedValue(o),pageNumber:l.pdfViewerBase.currentPageNumber-1,left:l.getMagnifiedValue(r),isHeightNeeded:!1},l.dropDivElementRight.style.left=s-l.pdfViewerBase.viewerContainer.getBoundingClientRect().left-a.width/2+l.pdfViewerBase.viewerContainer.scrollLeft+"px",l.previousScrollDifference=e)},this.pdfViewer=e,this.pdfViewerBase=t}var L2t=function(){return(L2t=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},R2t=[],O2t=(N2t.prototype.createTextSearchBox=function(){var t,n=this,e=(this.searchBox=Q("div",{id:this.pdfViewer.element.id+"_search_box",className:"e-pv-text-search-bar"}),(e=N?document.getElementById("toolbarContainer"):this.pdfViewerBase.getElement("_toolbarContainer"))&&(this.searchBox.style.top=e.clientHeight+"px"),Q("div",{id:this.pdfViewer.element.id+"_search_box_elements",className:"e-pv-text-search-bar-elements"})),i=(this.searchInputContainer=Q("div",{id:this.pdfViewer.element.id+"_search_input_container",className:"e-input-group e-pv-text-search-input"}),this.searchInput=Q("input",{id:this.pdfViewer.element.id+"_search_input",className:"e-input e-pv-search-input-ele"}),this.searchAutocompleteObj=new lU({dataSource:[{SearchString:"",Count:""}],fields:{value:"SearchString"},headerTemplate:'<div class="e-pv-automplete-header"><span class="e-pv-search-exact-matches">'+this.pdfViewer.localeObj.getConstant("Exact Matches")+'</span><span class="e-pv-total-exact-matches"></span></div>',itemTemplate:'<div class="e-pv-autocomplete-item"><span class="e-pv-autocomplete-word"> ${SearchString} </span><span class="e-pv-autocomplete-count">${Count}</span></div>',placeholder:this.pdfViewer.localeObj.getConstant("Find in document"),popupHeight:"200px",beforeOpen:function(e){Array.isArray(n.autompleteDataSource)&&0===n.autompleteDataSource.length&&(e.cancel=!0)},select:function(e){n.isSelectedFromPopup=!0,n.isSingleSearch=!0,n.isMultiSearch=!1,n.isExactMatch=!0,n.initiateSearch(e.itemData.SearchString)},filtering:function(t){n.isDocumentTextCollectionReady||(n.resetVariablesTextSearch(),n.clearAllOccurrences()),n.isSelectedFromPopup=!1,n.searchCountEle&&(n.searchCountEle.innerHTML="",n.adjustInputContainerWidth()),n.isSingleSearch=!1,n.isExactMatch=!1,n.isMultiSearch=n.matchAnyWordCheckBox.checked,n.initiateTextSearch(t.text),""===t.text&&(clearInterval(n.intervalId),n.showLoadingIndicator(!1)),n.searchString="",n.documentTextCollection.length===n.pdfViewerBase.pageCount&&(n.isDocumentTextCollectionReady=!0);var i=setInterval(function(){var e;n.documentTextCollection.length===n.pdfViewerBase.pageCount&&(t.updateData(n.autompleteDataSource,null),Array.isArray(n.autompleteDataSource)&&0!==n.autompleteDataSource.length?(e=n.autompleteDataSource.reduce(function(e,t){return e+parseInt(t.Count,10)},0),document.querySelector(".e-pv-total-exact-matches").innerHTML=e,n.isMultiSearch?document.querySelector(".e-pv-search-exact-matches").innerHTML=n.pdfViewer.localeObj.getConstant("Total Matches"):document.querySelector(".e-pv-search-exact-matches").innerHTML=n.pdfViewer.localeObj.getConstant("Exact Matches")):0===n.autompleteDataSource.length&&(je(e=document.querySelector(".e-pv-total-exact-matches"))||(e.innerHTML="0"),n.searchAutocompleteObj.hidePopup()),clearInterval(i),n.isDocumentTextCollectionReady=!0)},1e3)},created:function(e){n.searchAutocompleteObj.element.addEventListener("keydown",function(e){"Enter"===e.key&&(n.isSingleSearch=!0,n.isExactMatch=n.isSelectedFromPopup,n.isMultiSearch=!1,!n.isDocumentTextCollectionReady&&n.pdfViewerBase.clientSideRendering?(""!==n.searchInput.value&&n.searchInput.value!==n.searchString&&(n.isTextSearchHandled=!1,n.searchCount=0,n.searchIndex=0,n.searchPageIndex=0,n.textSearchWhileLoading(n.searchInput.value,n.isMatchCase),n.searchString=n.searchInput.value),n.isTextSearchHandled&&n.nextSearch()):n.initiateTextSearch(n.searchInput.value),0!==n.searchCount||n.isMessagePopupOpened||n.documentTextCollection.length!==n.pdfViewerBase.pageCount||n.onMessageBoxOpen())}),n.searchAutocompleteObj.element.parentElement.querySelector(".e-clear-icon").addEventListener("mousedown",function(e){n.showLoadingIndicator(!1),clearInterval(n.intervalId),n.searchInput.value="",n.resetTextSearch(),n.searchCountEle&&(n.searchCountEle.innerHTML="",n.adjustInputContainerWidth()),n.searchInput.focus(),n.searchString=""})}}),this.searchBtn=Q("span",{id:this.pdfViewer.element.id+"_search_box-icon",className:"e-input-group-icon e-input-search-group-icon e-pv-search-icon"}),this.searchBtn.setAttribute("tabindex","0"),this.searchInputContainer.appendChild(this.searchInput),this.searchAutocompleteObj.appendTo(this.searchInput),e.appendChild(this.searchInputContainer),this.searchCountEle=Q("span",{id:this.pdfViewer.element.id+"_search_count",className:"e-pv-search-count",innerHTML:""}),e.appendChild(this.searchCountEle),this.pdfViewer.enableRtl?this.prevSearchBtn=this.createSearchBoxButtons("prev_occurrence","e-pv-next-search"):this.prevSearchBtn=this.createSearchBoxButtons("prev_occurrence","e-pv-prev-search"),this.prevSearchBtn.setAttribute("aria-label","Previous Search text"),e.appendChild(this.prevSearchBtn),this.pdfViewer.enableRtl?this.nextSearchBtn=this.createSearchBoxButtons("next_occurrence","e-pv-prev-search"):this.nextSearchBtn=this.createSearchBoxButtons("next_occurrence","e-pv-next-search"),this.nextSearchBtn.setAttribute("aria-label","Next Search text"),e.appendChild(this.nextSearchBtn),Q("div",{id:this.pdfViewer.element.id+"_match_case_container",className:"e-pv-textsearch-match-case-container"})),o=Q("input",{id:this.pdfViewer.element.id+"_match_case"}),r=(o.type="checkbox",N&&(o.style.height="17px",o.style.width="17px",o.addEventListener("change",this.checkBoxOnChange.bind(this))),i.appendChild(o),Q("input",{id:this.pdfViewer.element.id+"_match_any_word"})),e=(r.type="checkbox",i.appendChild(r),this.searchBox.appendChild(e),this.searchBox.appendChild(i),this.pdfViewerBase.mainContainer.appendChild(this.searchBox),N?(t=Q("span",{id:this.pdfViewer.element.id+"_search_box_text",styles:"position: absolute; padding-top: 3px; padding-left: 8px; padding-right: 8px; font-size: 13px"}),this.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_Matchcase").then(function(e){t.textContent=e}),i.appendChild(t)):(new ib({cssClass:"e-pv-match-case",label:this.pdfViewer.localeObj.getConstant("Match case"),htmlAttributes:{tabindex:"0"},change:this.checkBoxOnChange.bind(this)}).appendTo(o),this.matchAnyWordCheckBox=new ib({cssClass:"e-pv-match-any-word",label:this.pdfViewer.localeObj.getConstant("Match any word"),htmlAttributes:{tabindex:"0"},change:function(){n.isMultiSearch=n.matchAnyWordCheckBox.checked}}),this.matchAnyWordCheckBox.appendTo(r)),i.firstElementChild.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.target.click(),e.preventDefault(),e.stopPropagation())}),r.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.target.click(),e.preventDefault(),e.stopPropagation())}),Q("div",{id:this.pdfViewer.element.id+"_textSearchLoadingIndicator"}));this.searchInputContainer.appendChild(e),e.style.position="absolute",e.style.top="15px",e.style.left=this.searchInputContainer.clientWidth-46+"px",GLt({target:e,cssClass:"e-spin-center"}),this.setLoaderProperties(e),this.showSearchBox(!1),this.pdfViewer.enableRtl?(this.searchBox.classList.add("e-rtl"),this.searchBox.style.left="88.3px"):(this.searchBox.classList.remove("e-rtl"),this.searchBox.style.right="88.3px"),this.searchBtn.addEventListener("click",this.searchClickHandler.bind(this)),this.searchBtn.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(n.searchClickHandler(e),e.preventDefault(),e.stopPropagation())}),this.nextSearchBtn.addEventListener("click",this.nextButtonOnClick.bind(this)),this.prevSearchBtn.addEventListener("click",this.prevButtonOnClick.bind(this))},N2t.prototype.setLoaderProperties=function(e){e=e.firstChild.firstChild.firstChild;e&&(e.style.height="18px",e.style.width="18px",e.style.transformOrigin="9px 9px 9px")},N2t.prototype.showLoadingIndicator=function(e){var t=document.getElementById(this.pdfViewer.element.id+"_textSearchLoadingIndicator");t&&(e?aRt:hRt)(t)},N2t.prototype.textSearchWhileLoading=function(e,t,i,n,o,r){var s,a,n=n||100,r=r||!1;n>=this.pdfViewerBase.pageCount&&(n=this.pdfViewerBase.pageCount,r=!0),this.pdfViewerBase.clientSideRendering||(a={text:e,matchCase:t,documentId:(s=this).pdfViewerBase.getDocumentId(),hashId:this.pdfViewerBase.hashId,action:"SearchTextPdf",elementId:this.pdfViewer.element.id,uniqueId:this.pdfViewerBase.documentId,startIndex:i||0,endIndex:n,isCompleted:r,isRequestsend:!!je(o)||o},this.textSearchHandleRequest=new DRt(this.pdfViewer),this.textSearchHandleRequest.url=this.pdfViewer.serviceUrl+"/SearchTextPdf",this.textSearchHandleRequest.responseType="json",this.textSearchHandleRequest.send(a),this.textSearchHandleRequest.onSuccess=function(e){e=e.data;if(e)try{s.searchTextAfteresult(e.resultPages,e.totalSearchCount,e.searchWord,e.matchCase,"true"===e.isRequestsend.toLowerCase(),"true"===e.isCompleted.toLowerCase(),e.endIndex)}catch(e){}}),this.pdfViewerBase.clientSideRendering&&this.pdfViewerBase.pdfViewerRunner.addTask({message:"searchText",zoomFactor:this.pdfViewerBase.getZoomFactor(),searchWord:e,matchCase:t,startIndex:i||0,endIndex:n,isCompleted:r,isRequestsend:!je(o)&&o},yRt.Medium)},N2t.prototype.searchTextAfteresult=function(e,t,i,n,o,r,s){var a;0===t&&0===this.searchCount?r&&(this.isTextSearchHandled=!0,this.pdfViewerBase.createNotificationPopup(this.pdfViewer.localeObj.getConstant("No Matches")),this.showLoadingIndicator(!1)):this.isSingleSearch&&this.searchString===i&&this.isMatchCase===n&&(this.textSearchOpen||this.programaticalSearch)&&(this.isTextSearchHandled=!0,a=this.getSearchTextDetails,this.getSearchTextDetails=L2t({},a,e),this.hightlightSearchedTexts(this.searchPageIndex,o),r?this.showLoadingIndicator(!1):this.showLoadingIndicator(!0),this.searchCount=this.searchCount+t,o||(this.currentOccurrence=1,this.searchedOccurrences.push(this.currentOccurrence),1===this.searchedOccurrences.length&&this.pdfViewer.fireTextSearchStart(this.searchString,this.isMatchCase)),this.searchCountEle.style.display="inline-block",this.getSearchCountText(),this.updateLoadingIndicator()),r||this.searchString!==i||!this.textSearchOpen&&!this.programaticalSearch||this.textSearchWhileLoading(i,n,s,s+100,0!==this.searchCount,r)},N2t.prototype.updateLoadingIndicator=function(){document.getElementById(this.pdfViewer.element.id+"_textSearchLoadingIndicator").style.left=this.searchInputContainer.clientWidth-46+"px"},N2t.prototype.hightlightSearchedTexts=function(e,t,i){this.clearAllOccurrences();var n,o,r=[];for(o in this.getSearchTextDetails)Object.prototype.hasOwnProperty.call(this.getSearchTextDetails,o)&&r.push(parseInt(o,10));if(r.sort(function(e,t){return e-t}),!je(e)){for(var s=r[r.length-1],a=r[0],l=0;l<r.length;l++)if(r[parseInt(l.toString(),10)]<e)s=r[parseInt(l.toString(),10)];else if(r[parseInt(l.toString(),10)]>e){a=r[parseInt(l.toString(),10)];break}this.getSearchTextDetails[parseInt(e.toString(),10)]||(e=a),(this.searchIndex+1>this.getSearchTextDetails[parseInt(e.toString(),10)].pageOccurrence||this.searchIndex<0)&&(this.searchIndex+1>this.getSearchTextDetails[parseInt(e.toString(),10)].pageOccurrence&&(e=e+1===r[r.length-1]?0:a,this.searchIndex=0),this.searchIndex<0)&&(e=e-1==-1?r[r.length-1]:s,this.searchIndex=this.getSearchTextDetails[parseInt(e.toString(),10)].pageOccurrence-1)}for(o in this.getSearchTextDetails)if(Object.prototype.hasOwnProperty.call(this.getSearchTextDetails,o)){var h,d=this.getSearchTextDetails[parseInt(o.toString(),10)],p=0;for(h in d.Bounds){if(Object.prototype.hasOwnProperty.call(d.Bounds,h))for(var c=d.Bounds[parseInt(h.toString(),10)],l=0;l<c.length;l++){var u,g=!0===this.pdfViewerBase.clientSideRendering?c[parseInt(l.toString(),10)].Left:this.pdfViewerBase.ConvertPointToPixel(c[parseInt(l.toString(),10)].Left),m=!0===this.pdfViewerBase.clientSideRendering?c[parseInt(l.toString(),10)].Top:this.pdfViewerBase.ConvertPointToPixel(c[parseInt(l.toString(),10)].Top),f=!0===this.pdfViewerBase.clientSideRendering?c[parseInt(l.toString(),10)].Height:this.pdfViewerBase.ConvertPointToPixel(c[parseInt(l.toString(),10)].Height),y=!0===this.pdfViewerBase.clientSideRendering?c[parseInt(l.toString(),10)].Width:this.pdfViewerBase.ConvertPointToPixel(c[parseInt(l.toString(),10)].Width),v=null;je(i)?v=e||r[0]:i&&(v=null),this.searchIndex===p&&v===Number(o)?(n=p,(je(t)||t)&&!je(t)||this.pdfViewerBase.updateScrollTop(Number(o)),v="_searchtext_"+Number(o)+"_"+p,u=void 0,(u=c.length<=1||0===l?document.getElementById(this.pdfViewer.element.id+v):document.getElementById(this.pdfViewer.element.id+v+"_"+l))&&u.parentElement.removeChild(u),this.searchPageIndex=Number(o),this.createSearchTextDiv(p,Number(o),f,y,m,g,"e-pv-search-text-highlight",!1,0,l)):this.createSearchTextDiv(p,Number(o),f,y,m,g,"e-pv-search-text-highlightother",!1,0,l)}p++}}(je(t)||t)&&!je(t)||(u=this.pdfViewerBase.getElement("_searchtext_"+this.searchPageIndex+"_"+n),this.scrollToSearchStr(u,{y:-100,x:-100}))},N2t.prototype.textSearchBoxOnResize=function(){var e;this.pdfViewer.toolbarModule&&this.pdfViewer.enableToolbar?(e=this.pdfViewerBase.getElement("_toolbarContainer_popup"))&&e.contains(this.pdfViewerBase.getElement("_search").parentElement)&&(this.searchBox.style.right="0px"):this.pdfViewerBase.viewerContainer.clientWidth+this.pdfViewerBase.viewerContainer.offsetLeft<this.searchBox.offsetLeft+this.searchBox.clientWidth?(this.searchBox.style.right="0px",this.searchBox.style.width=parseInt(this.searchBox.style.width,10)-(this.searchBox.offsetLeft+this.searchBox.clientWidth-this.pdfViewerBase.viewerContainer.clientWidth)+"px",this.searchInput.style.width=parseInt(this.searchInput.style.width,10)-(this.searchBox.offsetLeft+this.searchBox.clientWidth-this.pdfViewerBase.viewerContainer.clientWidth)+"px"):(this.searchBox.style.right="88.3px",this.searchBox.style.width="",this.searchInput.style.width="")},N2t.prototype.showSearchBox=function(e){je(this.searchBox)||(e?(this.searchBox.style.display="block",this.textSearchOpen=!0):(this.searchBox.style.display="none",this.searchInput.value="",this.searchCountEle.style.display="none",this.pdfViewer.toolbarModule&&(this.pdfViewer.toolbarModule.isTextSearchBoxDisplayed=!1),this.textSearchOpen=!1),this.onTextSearchClose())},N2t.prototype.searchAfterSelection=function(){0===this.currentOccurrence&&(this.searchPageIndex=this.pdfViewerBase.currentPageNumber-1,this.startSearchPageIndex=this.searchPageIndex),this.isTextSearch&&0!==this.currentOccurrence&&(this.initSearch(this.searchPageIndex,!0),this.highlightOthers())},N2t.prototype.calculateSearchCount=function(t,e){var i=this;if(this.searchCount=0,this.isTextSearchHandled||(this.currentOccurrence=0,this.resetVariables(),this.searchIndex=0),t&&""!==t.trim())if(this.isMultiSearch){this.searchCountEle&&(this.searchCountEle.innerHTML="",this.adjustInputContainerWidth());var n=t.split(" ");this.multiSearchCounts={};for(var o=0,r=n;o<r.length;o++){var s=(s=r[o]).trim();if(""!==s){for(var a=0,l=0;l<e.length;l++)for(var h=parseInt(Object.keys(e[parseInt(l.toString(),10)])[0],10),d=(u=e[parseInt(l.toString(),10)][parseInt(h.toString(),10)]).pageText||u.PageText,p=(this.isMatchCase||(d=d.toLowerCase(),s=s.toLowerCase()),d.indexOf(s));-1!==p;)a++,p=d.indexOf(s,p+1);this.multiSearchCounts[""+s]=a}}n=Object.keys(this.multiSearchCounts).map(function(e){return{SearchString:e,Count:i.multiSearchCounts[""+e].toString()}});this.autompleteDataSource=n}else{for(var c={},l=0;l<e.length;l++){var u,h=parseInt(Object.keys(e[parseInt(l.toString(),10)])[0],10),g=(d=(u=e[parseInt(l.toString(),10)][parseInt(h.toString(),10)]).pageText||u.PageText).replace(/(\s\r\n)/gm," ").replace(/(\r\n)/gm," "),m=d.replace(/(\s\r\n)/gm,"  ").replace(/(\r\n)/gm," "),f=g.replace(/[^a-zA-Z0-9]+/g," "),y=void 0,v=t.length,b=[],w=[],p=-v,C=-v,S=-v,A=-v,x=-v;for(this.isMatchCase||(t=t.toLowerCase(),d=d.toLowerCase(),g=g.toLowerCase(),m=m.toLowerCase(),f=f.toLowerCase());(0!==p||0===p&&0<b.length&&0===b[0])&&t&&" "!==t;){if(this.isExactMatch){for(var I=void 0,T=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),E=new RegExp("(?<!\\w)"+T+"(?!\\w)","g"),I=E.exec(d);null!==I;)b.push(I.index),I=E.exec(d);break}if(p=d.indexOf(t,p+v),-1!==t.indexOf(" ")&&(T=t.replace(" ","\r\n"),(C=d.indexOf(T,C+v))<=-1||C<p&&b.push(C)),p<=-1&&C<=-1)break;p<=-1||b.push(p),p<C&&!(C<=-1)&&b.push(C)}if(0===b.length){if(S=g.indexOf(t,S+v),A=m.indexOf(t,A+v),x=f.indexOf(t,x+v),-1!==S){p=-(y=this.correctLinetext(t,p,d))[0].length;for(var D=0;D<y.length;D++)p=d.indexOf(y[parseInt(D.toString(),10)].trim(),p+(void 0===y[D-1]?y[0]:y[D-1]).length),w.push(p),1<w.length&&(w[1]-(w[0]+y[0].length)<=3?(b.push(w),this.searchMatches[parseInt(h.toString(),10)]=b):(D=-1,p=w[0]+y[0].length,w.splice(0,w.length)))}else if(-1!==x){p=-(y=this.correctLinetext(t,p,d))[0].length;for(var M=0;M<y.length;M++)p=d.indexOf(y[parseInt(M.toString(),10)].trim(),p+(void 0===y[M-1]?y[0]:y[M-1]).length),w.push(p),1<w.length&&(w[1]-(w[0]+y[0].length)<=3?(b.push(w),this.searchMatches[parseInt(h.toString(),10)]=b):(M=-1,p=w[0]+y[0].length,w.splice(0,w.length)))}else if(-1!==A){p=-(y=this.correctLinetext(t,p,d))[0].length;for(var k=0;k<y.length;k++)p=d.indexOf(y[parseInt(k.toString(),10)].trim(),p+(void 0===y[k-1]?y[0]:y[k-1]).length),w.push(p),1<w.length&&(w[1]-(w[0]+y[0].length)<=3?(b.push(w),this.searchMatches[parseInt(h.toString(),10)]=b):(k=-1,p=w[0]+y[0].length,w.splice(0,w.length)))}1<b.length&&b.splice(1,b.length)}g=d.match(/[a-zA-Z]+|\d+/g);je(g)||g.forEach(function(e){e.startsWith(t)&&(c[""+e]?c[""+e]++:c[""+e]=1)}),0<b.length&&(this.searchCount=this.searchCount+b.length),this.searchMatches&&0<b.length&&(this.searchMatches[parseInt(h.toString(),10)]=b)}n=Object.keys(c).map(function(e){return{SearchString:e,Count:c[""+e].toString()}});this.isSingleSearch?(this.searchCountEle&&(-1!==this.searchedOccurrences.indexOf(this.currentOccurrence+1)||this.isTextSearchHandled||this.searchedOccurrences.push(this.currentOccurrence+1),this.adjustInputContainerWidth()),1===this.searchedOccurrences.length&&this.pdfViewer.fireTextSearchStart(this.searchString,this.isMatchCase),this.isTextSearchHandled||(this.currentOccurrence+=1)):this.searchAutocompleteObj&&(this.autompleteDataSource=n)}else this.searchCountEle&&(this.searchCountEle.innerHTML="",this.adjustInputContainerWidth())},N2t.prototype.getSearchCountText=function(){this.pdfViewer.enableRtl?this.searchCountEle.innerHTML=this.searchCount+" "+this.pdfViewer.localeObj.getConstant("of")+" "+this.currentOccurrence:this.searchCountEle.innerHTML=this.currentOccurrence+" "+this.pdfViewer.localeObj.getConstant("of")+" "+this.searchCount},N2t.prototype.adjustInputContainerWidth=function(){var e=this.searchCountEle.parentElement;0<this.searchCount?(F.isDevice&&!this.pdfViewer.enableDesktopMode&&e&&(e.style.display="block"),this.searchCountEle.style.display="inline-block"):(this.searchCountEle.style.display="none",F.isDevice&&!this.pdfViewer.enableDesktopMode&&e&&(e.style.display="none"))},N2t.prototype.initiateTextSearch=function(e,t){this.enableNextButton(!0),this.enablePrevButton(!0),this.autompleteDataSource=[],(e=this.pdfViewer.enableHtmlSanitizer&&"string"==typeof e?go.sanitize(e):e)&&0<e.length&&" "===e[e.length-1]&&(e=e.slice(0,e.length-1)),this.initiateSearch(e,t)},N2t.prototype.handleSearchAfterTextCollectionReady=function(e,t){var i;t&&(i=document.getElementById(this.pdfViewer.element.id+"_search_count"),this.searchCountEle=i),this.isSingleSearch=t||this.isSingleSearch,e===this.searchString&&!this.isLastOccurrenceCompleted||(this.isTextSearchHandled=!1,this.calculateSearchCount(e,this.documentTextCollection),this.isInitialSearch=!0,this.isLastOccurrenceCompleted=!1,0!==this.currentOccurrence)||(this.startSearchPageIndex=this.searchPageIndex),e===this.searchString&&null!==this.searchPageIndex&&null!==this.startSearchPageIndex||(this.isTextSearch=!1,this.isTextSearchHandled)||(this.searchPageIndex=this.pdfViewerBase.currentPageNumber-1,this.startSearchPageIndex=this.searchPageIndex),this.isTextSearchHandled||this.clearAllOccurrences(),""!==e&&!this.isMultiSearch&&this.isSingleSearch&&0<this.searchCount&&(this.searchMatches[this.searchPageIndex]&&e===this.searchString?0===this.searchMatches[this.searchPageIndex].length?this.initSearch(this.searchPageIndex,!1):this.nextSearch():je(this.searchMatches[this.searchPageIndex])&&e===this.searchString?this.initSearch(this.searchPageIndex,!1):this.textSearch(e)),""===e&&(this.searchString="")},N2t.prototype.initiateSearch=function(e,t){var i=this,n=this.pdfViewerBase.pageCount;je(this.intervalId)||clearInterval(this.intervalId);this.isDocumentTextCollectionReady?this.handleSearchAfterTextCollectionReady(e,t):this.intervalId=setInterval(function(){i.isTextSearchHandled||i.showLoadingIndicator(!0),i.documentTextCollection.length===n&&(clearInterval(i.intervalId),i.isDocumentTextCollectionReady=!0,i.calculateSearchCount(i.searchInput.value,i.documentTextCollection),i.getSearchTextDetails={},i.showLoadingIndicator(!1),i.intervalId=null,i.isTextSearchHandled||i.handleSearchAfterTextCollectionReady(e,t)),t&&i.pdfViewerBase.navigationPane&&i.pdfViewerBase.navigationPane.setSearchInputWidth()},1e3)},N2t.prototype.textSearch=function(e){if(""!==e||e){if(this.searchString=e,this.isTextSearch=!0,this.isSearchText=!0,this.searchPageIndex=this.pdfViewerBase.currentPageNumber-1,this.isTextSearchEventTriggered=!1,this.isTextSearchHandled||this.showLoadingIndicator(!0),this.pdfViewer.isExtractText)if(this.isTextRetrieved)for(var t=0;t<this.pdfViewerBase.pageCount;t++)this.initSearch(t,!1,!0);else{this.isTextSearched=!0;for(t=0;t<this.documentTextCollection.length;t++)this.initSearch(t,!1,!0)}this.isTextSearchHandled||(this.searchPageIndex=this.findNextPageWithText(this.searchPageIndex,!0),this.initSearch(this.searchPageIndex,!1),this.highlightOthers())}},N2t.prototype.nextSearch=function(){this.isPrevSearch=!1,this.isTextSearch=!0;var e,t=this.isSearchText=!1;this.isDocumentTextCollectionReady?(this.searchString?(this.clearAllOccurrences(),0!==this.currentOccurrence?(this.searchIndex=this.searchIndex+1,this.areAllOccurencesSearched()&&!this.isMessagePopupOpened&&this.onMessageBoxOpen()):(this.searchIndex=0,this.currentOccurrence+=1,t=!0,this.getSearchCountText(),-1===this.searchedOccurrences.indexOf(this.currentOccurrence)&&this.searchedOccurrences.push(this.currentOccurrence),1===this.searchedOccurrences.length&&this.pdfViewer.fireTextSearchStart(this.searchString,this.isMatchCase)),this.searchMatches[this.searchPageIndex]?(this.searchIndex>=this.searchMatches[this.searchPageIndex].length?(this.searchIndex=0,this.searchPageIndex=this.findNextPageWithText(this.searchPageIndex),0<this.pdfViewerBase.pageCount?this.initSearch(this.searchPageIndex,!1):(this.initSearch(this.searchPageIndex,!0),this.isMessagePopupOpened||this.onMessageBoxOpen(),this.pdfViewerBase.updateScrollTop(this.searchPageIndex)),this.showLoadingIndicator(!0)):(this.highlightSearchedTexts(this.searchPageIndex,!1,void 0),je(e=this.pdfViewerBase.getElement("_searchtext_"+this.searchPageIndex+"_"+this.searchIndex))||this.isScrollPages(e)&&this.pdfViewerBase.updateScrollTop(this.searchPageIndex),this.showLoadingIndicator(!1)),this.highlightOthers(!0),this.currentOccurrence<=this.searchCount&&!this.isMessagePopupOpened&&(this.currentOccurrence===this.searchCount?this.currentOccurrence=1:t||(this.currentOccurrence=this.currentOccurrence+1),this.searchCountEle)&&this.isSingleSearch&&(this.getSearchCountText(),-1===this.searchedOccurrences.indexOf(this.currentOccurrence)&&this.searchedOccurrences.push(this.currentOccurrence),this.adjustInputContainerWidth())):this.searchMatches[this.searchPageIndex]||this.isMessagePopupOpened?this.isMessagePopupOpened||this.initiateTextSearch(this.searchInput.value):1<this.pdfViewerBase.pageCount&&this.initSearch(this.searchPageIndex,!1)):this.initiateTextSearch(this.searchInput.value),je(e=this.pdfViewerBase.getElement("_searchtext_"+this.searchPageIndex+"_"+this.searchIndex))||this.scrollToSearch(e)):(this.clearAllOccurrences(),this.areAllOccurencesSearched()&&this.onMessageBoxOpen(),this.isMessagePopupOpened||(0!==this.currentOccurrence&&(this.searchIndex=this.searchIndex+1),this.currentOccurrence+1>this.searchCount?this.currentOccurrence=1:this.currentOccurrence=this.currentOccurrence+1,-1===this.searchedOccurrences.indexOf(this.currentOccurrence)&&this.searchedOccurrences.push(this.currentOccurrence),this.getSearchCountText(),this.hightlightSearchedTexts(this.searchPageIndex)))},N2t.prototype.findNextPageWithText=function(e,t){if(!(t&&(this.isInitialSearch=!1,this.searchMatches[parseInt(e.toString(),10)])&&0<this.searchMatches[parseInt(e.toString(),10)].length))for(var i=1;i<this.pdfViewerBase.pageCount;i++){var n=(e+i)%this.pdfViewerBase.pageCount;if(this.searchMatches[parseInt(n.toString(),10)]&&0<this.searchMatches[parseInt(n.toString(),10)].length)return this.searchedOccurrences.length!==this.searchCount||t?n:this.startSearchPageIndex}return e},N2t.prototype.findFirstNonEmptyPage=function(){for(var e=0;e<this.pdfViewerBase.pageCount;e++)if(this.searchMatches[parseInt(e.toString(),10)]&&0<this.searchMatches[parseInt(e.toString(),10)].length)return e;return null},N2t.prototype.prevSearch=function(){R2t.push(this.searchPageIndex),this.isPrevSearch=!0,this.isTextSearch=!0,this.isSearchText=!1,this.isDocumentTextCollectionReady?this.searchString?(this.clearAllOccurrences(),this.searchIndex=this.searchIndex-1,0===this.currentOccurrence&&(this.currentOccurrence=this.searchCount+1),this.areAllOccurencesSearched()&&!this.isMessagePopupOpened&&this.onMessageBoxOpen(),this.isMessagePopupOpened||(this.searchIndex<0?(this.searchPageIndex=this.findPreviousPageWithText(),this.initSearch(this.searchPageIndex,!1),this.showLoadingIndicator(!0)):(this.highlightSearchedTexts(this.searchPageIndex,!1,void 0),this.showLoadingIndicator(!1)),this.highlightOthers(!0)),0<=this.currentOccurrence-1&&!this.isMessagePopupOpened&&(this.currentOccurrence-1==0?this.currentOccurrence=this.searchCount:this.currentOccurrence=this.currentOccurrence-1,this.searchCountEle)&&this.isSingleSearch&&(this.getSearchCountText(),-1===this.searchedOccurrences.indexOf(this.currentOccurrence)&&this.searchedOccurrences.push(this.currentOccurrence),1===this.searchedOccurrences.length&&this.pdfViewer.fireTextSearchStart(this.searchString,this.isMatchCase),this.adjustInputContainerWidth())):(this.searchIndex=this.searchIndex-1,this.searchPageIndex=this.searchPageIndex-1<0?this.pdfViewerBase.pageCount-1:this.searchPageIndex-1,e=this.searchInput.value,this.textSearch(e)):(this.clearAllOccurrences(),this.areAllOccurencesSearched()&&this.onMessageBoxOpen(),this.isMessagePopupOpened||(0!==this.currentOccurrence&&(this.searchIndex=this.searchIndex-1),this.currentOccurrence-1<=0?(this.currentOccurrence=this.searchCount,e=Object.keys(this.getSearchTextDetails).pop(),this.pdfViewerBase.updateScrollTop(Number(e))):this.currentOccurrence=this.currentOccurrence-1,-1===this.searchedOccurrences.indexOf(this.currentOccurrence)&&this.searchedOccurrences.push(this.currentOccurrence),this.getSearchCountText(),this.hightlightSearchedTexts(this.searchPageIndex)));var e=this.pdfViewerBase.getElement("_searchtext_"+this.searchPageIndex+"_"+this.searchIndex);je(e)||this.scrollToSearch(e)},N2t.prototype.scrollToSearch=function(e){this.isScrollPages(e)&&this.scrollToSearchStr(e,{y:-100,x:-100})},N2t.prototype.isScrollPages=function(e){var t=this.pdfViewer.element.getBoundingClientRect(),e=e.getBoundingClientRect(),i=this.pdfViewer.enableToolbar&&!je(this.pdfViewer.toolbarModule)?this.pdfViewer.toolbar.toolbarElement.getBoundingClientRect().height:0;return!(e.top>=t.top+i&&e.left>=t.left&&e.bottom<=t.bottom&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=t.right)},N2t.prototype.findPreviousPageWithText=function(){for(var e=this.searchPageIndex,t=1;t<this.pdfViewerBase.pageCount;t++){var i=(e-t+this.pdfViewerBase.pageCount)%this.pdfViewerBase.pageCount;if(this.searchMatches[parseInt(i.toString(),10)]&&0<this.searchMatches[parseInt(i.toString(),10)].length)return this.searchedOccurrences.length===this.searchCount?0:i}return e},N2t.prototype.initSearch=function(e,t,i){var n,o=this.pdfViewerBase.getStoredData(e,!0);i?0!==this.documentTextCollection.length&&(n=(i=this.documentTextCollection[parseInt(e.toString(),10)][parseInt(e.toString(),10)]).pageText||i.PageText,this.documentTextCollection[parseInt(e.toString(),10)])&&i&&this.getSearchTextContent(e,this.searchString,n,null,t,this.documentTextCollection[parseInt(e.toString(),10)]):o?(i=o.pageText,n=o.textContent,o=this.pdfViewerBase.textLayer.characterBound[parseInt(e.toString(),10)],this.textContents[parseInt(e.toString(),10)]=n,this.getPossibleMatches(e,this.searchString,i,n,t,o),this.getSearchCountText()):t||je(e)||this.createRequestForSearch(e)},N2t.prototype.getPossibleMatches=function(e,t,i,n,o,r){for(var s,a=i,l=t,h=a.replace(/(\s\r\n)/gm," ").replace(/(\r\n)/gm," "),d=i.replace(/(\s\r\n)/gm,"  ").replace(/(\r\n)/gm," "),p=h.replace(/[^a-zA-Z0-9]+/g," "),c=t.length,u=(this.isMatchCase||(l=t.toLowerCase(),a=i.toLowerCase(),h=h.toLowerCase(),d=d.toLowerCase(),p=p.toLowerCase()),[]),g=[],m=-c,f=-c,y=-c,v=-c,b=-c;(0!==m||0===m)&&""!==l&&" "!==l&&l;){if(this.isExactMatch){for(var w=void 0,C=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),S=new RegExp("(?<!\\w)"+C+"(?!\\w)","g"),w=S.exec(a);null!==w;)u.push(w.index),w=S.exec(a);break}var A,m=a.indexOf(l,m+c),C=(i.substring(0,m),0);if(!this.isMatchCase&&/[^\u0000-\u007F]/.test(i)&&-1!==m&&(m-=C=a.substring(0,m+c).length-a.substring(0,m+c).replace(/[\u0300-\u036f]/g,"").length),-1!==l.indexOf(" ")&&(A=t.replace(" ","\r\n"),f=a.indexOf(A,f+c),(f=-1)<=-1||f<m&&u.push(f)),m<=-1&&f<=-1)break;m<=-1||u.push(m),m<f&&!(f<=-1)&&u.push(f),0<C&&(m+=C)}if(0===u.length){if(y=h.indexOf(l,y+c),v=d.indexOf(l,v+c),b=p.indexOf(l,b+c),-1!==y){m=-(s=this.correctLinetext(t,m,a))[0].length;for(var x=0;x<s.length;x++)m=a.indexOf(s[parseInt(x.toString(),10)].trim(),m+(void 0===s[x-1]?s[0]:s[x-1]).length),g.push(m),1<g.length&&(g[1]-(g[0]+s[0].length)<=3?(u.push(g),this.searchMatches[parseInt(e.toString(),10)]=u):(x=-1,m=g[0]+s[0].length,g.splice(0,g.length)))}else if(-1!==b){m=-(s=this.correctLinetext(t,m,a))[0].length;for(x=0;x<s.length;x++)m=a.indexOf(s[parseInt(x.toString(),10)].trim(),m+(void 0===s[x-1]?s[0]:s[x-1]).length),g.push(m),1<g.length&&(g[1]-(g[0]+s[0].length)<=3?(u.push(g),this.searchMatches[parseInt(e.toString(),10)]=u):(x=-1,m=g[0]+s[0].length,g.splice(0,g.length)))}else if(-1!==v){m=-(s=this.correctLinetext(t,m,a))[0].length;for(x=0;x<s.length;x++)m=a.indexOf(s[parseInt(x.toString(),10)].trim(),m+(void 0===s[x-1]?s[0]:s[x-1]).length),g.push(m),1<g.length&&(g[1]-(g[0]+s[0].length)<=3?(u.push(g),this.searchMatches[parseInt(e.toString(),10)]=u):(x=-1,m=g[0]+s[0].length,g.splice(0,g.length)))}1<u.length&&u.splice(1,u.length)}this.searchMatches&&0<u.length&&(this.searchMatches[parseInt(e.toString(),10)]=u),o||(-1===this.searchedPages.indexOf(e)&&(this.searchedPages.push(e),this.startIndex=this.searchedPages[0]),this.updateSearchInputIcon(!1)),this.searchMatches&&this.searchMatches[parseInt(e.toString(),10)]&&0!==this.searchMatches[parseInt(e.toString(),10)].length?(o||(this.isPrevSearch&&(this.searchIndex=this.searchMatches[parseInt(e.toString(),10)].length-1),this.pdfViewerBase.currentPageNumber-1!==this.searchPageIndex?0<this.searchMatches.length&&-1===this.searchIndex&&this.searchPageIndex===this.currentSearchIndex?(this.isMessagePopupOpened||this.isSearchText||this.onMessageBoxOpen(),this.searchPageIndex=this.getSearchPage(this.pdfViewerBase.currentPageNumber-1),this.searchedPages=[this.searchPageIndex]):this.isPrevSearch&&this.searchMatches&&0<this.searchMatches.length&&this.searchMatches[this.searchPageIndex]&&0<this.searchMatches[this.searchPageIndex].length&&this.searchedPages.length===this.pdfViewerBase.pageCount&&this.startIndex-1===this.searchPageIndex?(this.isMessagePopupOpened||this.onMessageBoxOpen(),this.searchedPages=[this.startIndex]):R2t[0]===this.searchPageIndex&&this.areAllOccurencesSearched()&&!this.isMessagePopupOpened&&this.onMessageBoxOpen():this.searchMatches&&this.searchMatches[this.searchPageIndex]&&0<this.searchMatches[this.searchPageIndex].length&&this.searchedPages.length===this.pdfViewerBase.pageCount&&this.startIndex===this.searchPageIndex&&1<this.pdfViewerBase.pageCount&&(this.isMessagePopupOpened||this.onMessageBoxOpen(),this.searchedPages=[this.startIndex])),this.highlightSearchedTexts(e,o,s)):o||(this.isPrevSearch?this.searchPageIndex=this.searchPageIndex-1<0?this.pdfViewerBase.pageCount-1:this.searchPageIndex-1:this.searchPageIndex=this.searchPageIndex+1<this.pdfViewerBase.pageCount?this.searchPageIndex+1:0,-1===this.searchedPages.indexOf(this.searchPageIndex)&&this.searchedPages.length!==this.pdfViewerBase.pageCount?(this.showLoadingIndicator(!0),this.searchPageIndex=this.findNextPageWithText(this.searchPageIndex,!0),this.initSearch(this.searchPageIndex,!1)):(h=this.getSearchPage(e),this.searchMatches&&je(this.searchMatches[this.searchPageIndex])&&this.searchedPages.length===this.pdfViewerBase.pageCount?(this.isMessagePopupOpened||this.onMessageBoxOpen(),this.pdfViewerBase.updateScrollTop(this.startIndex)):this.searchMatches&&0<this.searchMatches.length&&(0===this.searchIndex||-1===this.searchIndex)&&h===this.currentSearchIndex?(this.isPrevSearch?(this.isMessagePopupOpened||this.onMessageBoxOpen(),this.searchPageIndex=h,this.searchedPages=[h],this.searchIndex=-1):(this.isMessagePopupOpened||0===this.pdfViewerBase.currentPageNumber||this.isSearchText||this.onMessageBoxOpen(),this.searchPageIndex=h,this.searchedPages=[h],this.searchIndex=0),this.highlightSearchedTexts(this.searchPageIndex,o,void 0)):this.searchMatches&&this.searchMatches[this.searchPageIndex]&&0<this.searchMatches[this.searchPageIndex].length&&this.searchedPages.length===this.pdfViewerBase.pageCount&&(this.isMessagePopupOpened||this.onMessageBoxOpen(),this.searchPageIndex=this.startIndex,this.searchedPages=[this.searchPageIndex],this.searchIndex=0,this.pdfViewerBase.updateScrollTop(this.startIndex),this.highlightSearchedTexts(this.searchPageIndex,o,void 0))))},N2t.prototype.correctLinetext=function(e,t,i){var n=[],o=e.split(/[" "]+/),r=(this.isMatchCase||(o=e.toLowerCase().split(/\s+/)),t=0,""),s=(s=i.replace(/ \r\n/g," ")).replace(/\r\n/g," "),a=(s=(s=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/.test(s)?s.replace(/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g," "):s).replace(/[^a-zA-Z0-9 ]/g,""),e=e.replace(/[^a-zA-Z0-9 ]/g,""),s.match(e));if(!je(a=this.isMatchCase?a:s.match(e.toLowerCase())))for(var l=a=i.slice(a.index,i.length),h=0;h<o.length;h++){var d=r+o[parseInt(h.toString(),10)];t=i.indexOf(d,t),("\n"===(l=(l||i).replace(o[h-1],""))[l.indexOf(o[parseInt(h.toString(),10)])-1]&&"\n"===l[l.indexOf(o[h+1])-1]||"\n"===l[l.indexOf(o[parseInt(h.toString(),10)])-1]&&je(l[l.indexOf(o[h+1])-1]))&&(t=-1,""===r)&&(r=o[parseInt(h.toString(),10)],h+=1),-1!==t?r+=o[parseInt(h.toString(),10)]+" ":(n.push(r),r=o[parseInt(h.toString(),10)]+" ","\n"===l[l.indexOf(o[parseInt(h.toString(),10)])-1]&&"\n"===l[l.indexOf(o[h+1])-1]&&(n.push(r),r=o[h+1]+" ",l=(l||i).replace(o[h-1],""),h+=1)),h===o.length-1&&n.push(r)}return n},N2t.prototype.getSearchTextContent=function(e,t,i,n,o,r){for(var s=i,a=t,l=t.length,h=(this.isMatchCase||(a=t.toLowerCase(),s=i.toLowerCase()),[]),d=-l,p=-l;0!==d&&""!==a&&" "!==a&&a;){var c,d=s.indexOf(a,d+l);if(-1!==a.indexOf(" ")&&(c=t.replace(" ","\r\n"),(p=s.indexOf(c,p+l))<=-1||p<d&&h.push(p)),d<=-1&&p<=-1)break;d<=-1||h.push(d),d<p&&!(p<=-1)&&h.push(p)}0!==h.length&&(this.searchCount=this.searchCount+h.length),this.searchMatches&&0<h.length&&(this.searchMatches[parseInt(e.toString(),10)]=h)},N2t.prototype.getSearchPage=function(e){var t=null;if(this.isPrevSearch){for(var i=e;0<=i;i--)if(i!==e&&this.searchMatches[parseInt(i.toString(),10)]){t=i;break}if(!t)for(var n=this.pdfViewerBase.pageCount-1;e<n;n--)if(this.searchMatches[parseInt(n.toString(),10)]){t=n;break}}else{for(i=e;i<this.pdfViewerBase.pageCount;i++)if(i!==e&&this.searchMatches[parseInt(i.toString(),10)]){t=i;break}if(!t)if(0===e)t=e;else for(n=0;n<e;n++)if(this.searchMatches[parseInt(n.toString(),10)]){t=n;break}}return t},N2t.prototype.areAllNonEmptyPagesSearched=function(){for(var e=[],t=0;t<this.searchMatches.length;t++)this.searchMatches[parseInt(t.toString(),10)]&&0<this.searchMatches[parseInt(t.toString(),10)].length&&e.push(t);for(var i=0,n=e;i<n.length;i++)if(-1===this.searchedPages.indexOf(n[i]))return!1;return!0},N2t.prototype.areAllOccurencesSearched=function(){return this.searchedOccurrences.length===this.searchCount},N2t.prototype.highlightSearchedTexts=function(e,t,i){var n,o=this.searchMatches[parseInt(e.toString(),10)],r={y:-100,x:-100},s=this.searchString,a=this.pdfViewerBase.textLayer.characterBound[parseInt(e.toString(),10)];if(t&&this.pdfViewerBase.currentPageNumber-1!==this.searchPageIndex&&0<this.searchMatches.length&&this.getSearchPage(this.pdfViewerBase.currentPageNumber-1),a&&void 0!==o){for(var l,h=0;h<o.length;h++){if(void 0!==o[parseInt(h.toString(),10)].length&&void 0!==i)if(h===this.searchIndex&&e===this.searchPageIndex)for(var d=0;d<i.length;d++)n="e-pv-search-text-highlight",this.addDivForSearch(h,e,a,i[parseInt(d.toString(),10)].trim().length,n,d);else for(d=0;d<i.length;d++)n="e-pv-search-text-highlightother",this.addDivForSearch(h,e,a,i[parseInt(d.toString(),10)].trim().length,n,d);else n=h===this.searchIndex&&e===this.searchPageIndex?"e-pv-search-text-highlight":"e-pv-search-text-highlightother";je(o[parseInt(h.toString(),10)].length)&&this.addDivForSearch(h,e,a,this.searchString.length,n,void 0)}this.searchString=s,e!==this.searchPageIndex||t||((s=this.pdfViewerBase.getElement("_searchtext_"+e+"_"+this.searchIndex))?(l=this.getScrollElement(s),this.isScrollPages(l)&&this.scrollToSearchStr(s,r)):(this.pdfViewerBase.updateScrollTop(e),(t=this.pdfViewerBase.getElement("_searchtext_"+e+"_"+this.searchIndex))&&(l=this.getScrollElement(t),this.scrollToSearchStr(l,r))))}},N2t.prototype.addDivForSearch=function(e,t,i,n,o,r){je(this.pdfViewerBase.getElement("_textLayer_"+t))&&"e-pv-search-text-highlight"===o&&this.pdfViewer.navigation&&this.pdfViewer.navigation.goToPage(t+1);for(var s,a=s=void 0!==this.searchMatches[parseInt(t.toString(),10)][parseInt(e.toString(),10)].length?this.searchMatches[parseInt(t.toString(),10)][parseInt(e.toString(),10)][""+r]:this.searchMatches[parseInt(t.toString(),10)][parseInt(e.toString(),10)],l=0;s<a+n;)s=this.addDivElement(s,i,n,o,e,t,a,l,r),l++;"e-pv-search-text-highlight"===o&&this.showLoadingIndicator(!1)},N2t.prototype.addDivElement=function(e,t,i,n,o,r,s,a,l){var h=0,d=0,p=0,c=0,u=!1,g=(t[parseInt(e.toString(),10)]&&(c=t[parseInt(e.toString(),10)].X,p=t[parseInt(e.toString(),10)].Y),0);for(e-s!=0&&(g=e-s,i+=1);g<i;g++)t[parseInt(e.toString(),10)]&&(c>(v=t[parseInt(e.toString(),10)]).X+v.Width&&(u=!0),h=h>(b=(p=p<v.Y?p:v.Y)<v.Y?v.Y-p:p-v.Y)+v.Height?h:b+v.Height,e++);var m,f,y=!1;if(u){for(var v,b,c=(v=t[s+i-1]).X,d=t[parseInt(s.toString(),10)].X-t[s+i-1].X,w=(h=h>(b=(p=p<v.Y?p:v.Y)<v.Y?v.Y-p:p-v.Y)+v.Height?h:b+v.Height,0<s?t[s-1].Y-t[parseInt(s.toString(),10)].Y:0),C=s+i-1;s<=C;C--)0===(v=t[parseInt(C.toString(),10)]).Width&&(w=v.Y-t[C-1].Y);d+=w}else s+i!==e?(y=!0,t[e-1]&&(d=t[e-1].X-c)):(y=!1,f=null,(m=this.pdfViewerBase.clientSideRendering?this.pdfViewerBase.getLinkInformation(r,!0):this.pdfViewerBase.getStoredData(r,!0))?f=m.pageText:this.pdfViewer.isExtractText&&0!==this.documentTextCollection.length&&(f=(m=this.documentTextCollection[parseInt(r.toString(),10)][parseInt(r.toString(),10)]).pageText||m.PageText),t[parseInt(e.toString(),10)]?d=!f||""!==f[parseInt(e.toString(),10)]&&" "!==f[parseInt(e.toString(),10)]&&"\r"!==f[parseInt(e.toString(),10)]&&"\n"!==f[parseInt(e.toString(),10)]||0!==t[parseInt(e.toString(),10)].Width?t[parseInt(e.toString(),10)].X-c:t[e-1].X-c+t[e-1].Width:t[e-1]&&(d=t[e-1].X-c+t[e-1].Width));return this.createSearchTextDiv(o,r,h,d,p,c,n,y,a,l),e},N2t.prototype.createSearchTextDiv=function(e,t,i,n,o,r,s,a,l,h){var d,p,c,e="_searchtext_"+t+"_"+e,a=(a&&(e+="_"+l),document.getElementsByClassName("e-pv-search-text-highlight"));void 0!==h&&this.pdfViewerBase.getElement(e)&&!a[parseInt(h.toString(),10)]&&(d=Q("div",{id:this.pdfViewer.element.id+e+"_"+h}),p=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)],this.calculateBounds(d,i,n,o,r,p),d.classList.add(s),"e-pv-search-text-highlight"===s?(d.style.backgroundColor=""===this.pdfViewer.textSearchColorSettings.searchHighlightColor?"#fdd835":this.pdfViewer.textSearchColorSettings.searchHighlightColor,this.pdfViewer.fireTextSearchHighlight(this.searchString,this.isMatchCase,{left:r,top:o,width:n,height:i},t+1)):"e-pv-search-text-highlightother"===s&&(d.style.backgroundColor=""===this.pdfViewer.textSearchColorSettings.searchColor?"#8b4c12":this.pdfViewer.textSearchColorSettings.searchColor),c=this.pdfViewerBase.getElement("_textLayer_"+t),d.style.zIndex=this.searchTextDivzIndex,c)&&c.appendChild(d),this.pdfViewerBase.getElement(e)||(d=Q("div",{id:this.pdfViewer.element.id+e}),p=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)],this.calculateBounds(d,i,n,o,r,p),d.classList.add(s),"e-pv-search-text-highlight"===s?(d.style.backgroundColor=""===this.pdfViewer.textSearchColorSettings.searchHighlightColor?"#fdd835":this.pdfViewer.textSearchColorSettings.searchHighlightColor,this.pdfViewer.fireTextSearchHighlight(this.searchString,this.isMatchCase,{left:r,top:o,width:n,height:i},t+1)):"e-pv-search-text-highlightother"===s&&(d.style.backgroundColor=""===this.pdfViewer.textSearchColorSettings.searchColor?"#8b4c12":this.pdfViewer.textSearchColorSettings.searchColor),c=this.pdfViewerBase.getElement("_textLayer_"+t),d.style.zIndex=this.searchTextDivzIndex,c&&c.appendChild(d))},N2t.prototype.calculateBounds=function(e,t,i,n,o,r){0===r.rotation||2===r.rotation?(e.style.height=Math.ceil(t)*this.pdfViewerBase.getZoomFactor()+"px",e.style.width=i*this.pdfViewerBase.getZoomFactor()+"px",2===r.rotation?(e.style.top=(r.height-n-t)*this.pdfViewerBase.getZoomFactor()+"px",e.style.left=Math.ceil(r.width-o-i)*this.pdfViewerBase.getZoomFactor()+"px"):(e.style.top=n*this.pdfViewerBase.getZoomFactor()+"px",e.style.left=o*this.pdfViewerBase.getZoomFactor()+"px")):1===r.rotation?(e.style.height=i*this.pdfViewerBase.getZoomFactor()+"px",e.style.width=t*this.pdfViewerBase.getZoomFactor()+"px",e.style.top=o*this.pdfViewerBase.getZoomFactor()+"px",e.style.left=(r.height-n-t)*this.pdfViewerBase.getZoomFactor()+"px"):3===r.rotation&&(e.style.height=i*this.pdfViewerBase.getZoomFactor()+"px",e.style.width=t*this.pdfViewerBase.getZoomFactor()+"px",e.style.left=(r.width-r.height+n)*this.pdfViewerBase.getZoomFactor()+"px",e.style.top=(r.height-o-i)*this.pdfViewerBase.getZoomFactor()+"px")},N2t.prototype.isClassAvailable=function(){for(var e=!1,t=0;t<this.tempElementStorage.length;t++)if(this.tempElementStorage[parseInt(t.toString(),10)].classString&&("e-pv-search-text-highlight"===this.tempElementStorage[parseInt(t.toString(),10)].classString||"e-pv-search-text-highlightother"===this.tempElementStorage[parseInt(t.toString(),10)].classString)){e=!0;break}return e},N2t.prototype.getScrollElement=function(e){var t=e;if(0<e.childNodes.length)for(var i=0;i<e.childNodes.length;i++)e.childNodes[parseInt(i.toString(),10)].classList&&e.childNodes[parseInt(i.toString(),10)].classList.contains("e-pv-search-text-highlight")&&(t=e.childNodes[parseInt(i.toString(),10)]);return t},N2t.prototype.scrollToSearchStr=function(e,t){for(var i=e.offsetParent,n=e.offsetTop+e.clientTop,o=e.offsetLeft+e.clientLeft;i.id!==this.pdfViewerBase.viewerContainer.id;)n+=i.offsetTop,o+=i.offsetLeft,i=i.offsetParent;t&&(n+=t.y,o+=t.x,F.isDevice&&!this.pdfViewer.enableDesktopMode||1.5<this.pdfViewerBase.getZoomFactor())&&(i.scrollLeft=o),i.scrollTop=n,this.pdfViewerBase.updateMobileScrollerPosition()},N2t.prototype.resizeSearchElements=function(e){for(var t=document.querySelectorAll('div[id*="'+this.pdfViewer.element.id+"_searchtext_"+e+'"]'),i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)],o=1,r=e+"_"+(o=this.pdfViewer.magnificationModule?this.pdfViewer.magnificationModule.previousZoomFactor:o)+"_"+this.pdfViewerBase.getZoomFactor();n.getAttribute("name")!==r&&(n.style.width=parseFloat(n.style.width)/o*this.pdfViewerBase.getZoomFactor()+"px",n.style.height=parseFloat(n.style.height)/o*this.pdfViewerBase.getZoomFactor()+"px",n.style.top=parseFloat(n.style.top)/o*this.pdfViewerBase.getZoomFactor()+"px",n.style.left=parseFloat(n.style.left)/o*this.pdfViewerBase.getZoomFactor()+"px",n.setAttribute("name",r))}},N2t.prototype.highlightOtherOccurrences=function(e){this.initSearch(e,!0)},N2t.prototype.highlightOthers=function(e){for(var t=this.getIndexes(),i=parseFloat(t.lowerPageValue.toString()),n=parseFloat(t.higherPageValue.toString()),o=i;o<=n;o++)this.searchMatches[parseInt(o.toString(),10)]&&0<this.searchMatches[parseInt(o.toString(),10)].length&&this.highlightOtherOccurrences(o);e&&this.showLoadingIndicator(!1)},N2t.prototype.clearAllOccurrences=function(){for(var e=document.querySelectorAll('div[id*="'+this.pdfViewer.element.id+'_searchtext_"]'),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].parentElement.removeChild(e[parseInt(t.toString(),10)])},N2t.prototype.getIndexes=function(){var e=this.pdfViewerBase.currentPageNumber-3,t=this.pdfViewerBase.currentPageNumber+1;return{lowerPageValue:0<e?e:0,higherPageValue:t<this.pdfViewerBase.pageCount?t:this.pdfViewerBase.pageCount-1}},N2t.prototype.applyTextSelection=function(){if(this.pdfViewer.textSelectionModule&&!this.pdfViewerBase.isTextSelectionDisabled)for(var e=this.getIndexes(),t=parseFloat(e.lowerPageValue.toString()),i=parseFloat(e.higherPageValue.toString()),n=t;n<=i;n++)this.pdfViewer.textSelectionModule.applySelectionRangeOnScroll(n)},N2t.prototype.resetTextSearch=function(e){void 0===e&&(e=!1),this.resetVariables(),this.onTextSearchClose(),this.searchPageIndex=null,this.searchIndex=0,this.updateSearchInputIcon(!0),this.enableNextButton(!1),this.enablePrevButton(!1),e&&(this.documentTextCollection=[]),this.isTextRetrieved=!1,this.isTextSearched=!1,this.isSearchText=!1,this.searchRequestHandler&&this.searchRequestHandler.clear(),this.searchCount=0,this.searchString=""},N2t.prototype.onTextSearchClose=function(){this.isPrevSearch=!1,this.isTextSearch=!1,0<this.pdfViewerBase.pageCount&&this.clearAllOccurrences()},N2t.prototype.createRequestForSearch=function(a){for(var x=this,I=816,l=this.pdfViewer.element.clientHeight,T=this.pdfViewerBase.pageSize[parseInt(a.toString(),10)].width,e=this.pdfViewerBase.pageSize[parseInt(a.toString(),10)].height,h=this.pdfViewerBase.getTileCount(T,e),E=T<=I?1:h,D=T<=I?1:h,M=!1,e=this.pdfViewer.tileRenderingSettings,t=(e.enableTileRendering&&0<e.x&&0<e.y&&(E=T<=I?1:e.x,D=T<=I?1:e.y),1<E&&1<D&&(M=!0),function(A){for(var e=0;e<D;e++)!function(S){var e,t,i,n,o,r={xCoordinate:A,yCoordinate:S,pageNumber:a,viewPortWidth:I,viewPortHeight:l,documentId:x.pdfViewerBase.getDocumentId(),hashId:x.pdfViewerBase.hashId,zoomFactor:x.pdfViewerBase.getZoomFactor(),tilecount:h,action:"Search",elementId:x.pdfViewer.element.id,uniqueId:x.pdfViewerBase.documentId,tileXCount:E,tileYCount:D},s=(d.pdfViewerBase.jsonDocumentId&&(r.documentId=d.pdfViewerBase.jsonDocumentId),d.pdfViewerBase.retrieveCurrentZoomFactor());d.searchRequestHandler=new DRt(d.pdfViewer),d.searchRequestHandler.url=d.pdfViewer.serviceUrl+"/"+d.pdfViewer.serverActionSettings.renderPages,d.searchRequestHandler.responseType="json",d.pdfViewerBase.clientSideRendering||d.searchRequestHandler.send(r),d.searchRequestHandler.onSuccess=function(t){t=t.data;if(t){if("object"!=typeof t)try{t=JSON.parse(t)}catch(e){x.pdfViewerBase.onControlError(500,t,this.pdfViewer.serverActionSettings.renderPages),t=null}t&&x.searchRequestOnSuccess(t,x,I,T,M,a,A,S,E,D)}},d.searchRequestHandler.onFailure=function(e){x.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,this.pdfViewer.serverActionSettings.renderPages)},d.searchRequestHandler.onError=function(e){x.pdfViewerBase.openNotificationPopup(),x.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,this.pdfViewer.serverActionSettings.renderPages)},d.pdfViewerBase.clientSideRendering&&(r=d.pdfViewerBase.documentId+"_"+a+"_textDetails",t=!d.pdfViewerBase.pageTextDetails||!d.pdfViewerBase.pageTextDetails[r],i=new dvt(0,0,0,0),n=new dvt(0,0,0,0),(o=d.pdfViewer.pdfRenderer.loadedDocument.getPage(a))&&o._pageDictionary&&o._pageDictionary._map&&o._pageDictionary._map.CropBox&&(e=o._pageDictionary._map.CropBox,i.x=e[0],i.y=e[1],i.width=e[2],i.height=e[3]),o&&o._pageDictionary&&o._pageDictionary._map&&o._pageDictionary._map.MediaBox&&(e=o._pageDictionary._map.MediaBox,n.x=e[0],n.y=e[1],n.width=e[2],n.height=e[3]),T<=I||!d.pdfViewer.tileRenderingSettings.enableTileRendering?d.pdfViewerBase.pdfViewerRunner.addTask({pageIndex:a,message:"renderPageSearch",zoomFactor:x.pdfViewerBase.getZoomFactor(),isTextNeed:t,textDetailsId:r,cropBoxRect:i,mediaBoxRect:n},yRt.High):d.pdfViewerBase.pdfViewerRunner.addTask({pageIndex:a,message:"renderImageAsTileSearch",zoomFactor:s,tileX:A,tileY:S,tileXCount:E,tileYCount:D,isTextNeed:t,textDetailsId:r,cropBoxRect:i,mediaBoxRect:n},yRt.High),d.pdfViewerBase.pdfViewerRunner.onMessage("imageRenderedSearch,renderTileImageSearch",function(e){switch(e.data.message){case"imageRenderedSearch":"imageRenderedSearch"===e.data.message&&(t=document.createElement("canvas"),y=(n=e.data).value,i=n.width,d=n.height,n=n.pageIndex,t.width=i,t.height=d,(d=(h=t.getContext("2d")).createImageData(i,d)).data.set(y),h.putImageData(d,0,0),p=t.toDataURL(),x.pdfViewerBase.releaseCanvas(t),c=e.data.textBounds,u=e.data.textContent,g=e.data.pageText,m=e.data.rotation,f=e.data.characterBounds,l=x.pdfViewer.pdfRendererModule.getHyperlinks(n),i={image:p,pageNumber:n,uniqueId:x.pdfViewerBase.documentId,pageWidth:i,zoomFactor:e.data.zoomFactor,hyperlinks:l.hyperlinks,hyperlinkBounds:l.hyperlinkBounds,linkAnnotation:l.linkAnnotation,linkPage:l.linkPage,annotationLocation:l.annotationLocation,characterBounds:f},e.data.isTextNeed?(i.textBounds=c,i.textContent=u,i.rotation=m,x.pdfViewerBase.storeTextDetails(n,c,u,i.pageText=g,m,f)):(b=JSON.parse(x.pdfViewerBase.pageTextDetails[""+e.data.textDetailsId]),i.textBounds=b.textBounds,i.textContent=b.textContent,i.rotation=b.rotation,i.pageText=b.pageText,i.characterBounds=b.characterBounds),i)&&i.image&&i.uniqueId===x.pdfViewerBase.documentId&&(x.pdfViewer.fireAjaxRequestSuccess(x.pdfViewer.serverActionSettings.renderPages,i),v=void 0!==i.pageNumber?i.pageNumber:n,w=x.pdfViewerBase.createBlobUrl(i.image.split("base64,")[1],"image/png"),C={image:(URL||webkitURL).createObjectURL(w),width:i.pageWidth,uniqueId:i.uniqueId,zoomFactor:i.zoomFactor},x.pdfViewerBase.storeImageData(v,C),x.searchRequestOnSuccess(i,x,I,T,M,n,A,S,E,D));break;case"renderTileImageSearch":var t,i,n,o,r,s,a,l,h,d,p,c,u,g,m,f,y,v,b,w,C;"renderTileImageSearch"===e.data.message&&(t=document.createElement("canvas"),y=(l=e.data).value,i=l.w,n=l.h,o=l.noTileX,r=l.noTileY,s=l.x,a=l.y,l=l.pageIndex,t.setAttribute("height",n),t.setAttribute("width",i),t.width=i,t.height=n,(d=(h=t.getContext("2d")).createImageData(i,n)).data.set(y),h.putImageData(d,0,0),p=t.toDataURL(),x.pdfViewerBase.releaseCanvas(t),c=e.data.textBounds,u=e.data.textContent,g=e.data.pageText,m=e.data.rotation,f=e.data.characterBounds,y={image:p,noTileX:o,noTileY:r,pageNumber:l,tileX:s,tileY:a,uniqueId:x.pdfViewerBase.documentId,pageWidth:T,width:i,transformationMatrix:{Values:[1,0,0,1,i*s,n*a,0,0,0]},zoomFactor:e.data.zoomFactor,characterBounds:f,isTextNeed:e.data.isTextNeed,textDetailsId:e.data.textDetailsId})&&y.image&&y.uniqueId===x.pdfViewerBase.documentId&&(x.pdfViewer.fireAjaxRequestSuccess(x.pdfViewer.serverActionSettings.renderPages,y),v=void 0!==y.pageNumber?y.pageNumber:l,0===s&&0===a?(w=x.pdfViewerBase.createBlobUrl(y.image.split("base64,")[1],"image/png"),C={image:(URL||webkitURL).createObjectURL(w),width:y.pageWidth,uniqueId:y.uniqueId,tileX:y.tileX,tileY:y.tileY,zoomFactor:y.zoomFactor,transformationMatrix:y.transformationMatrix},y.isTextNeed?(y.textBounds=c,y.textContent=u,y.rotation=m,y.pageText=g,x.pdfViewerBase.storeTextDetails(l,c,u,g,m,f)):(b=JSON.parse(x.pdfViewerBase.pageTextDetails[""+y.textDetailsId]),y.textBounds=b.textBounds,y.textContent=b.textContent,y.rotation=b.rotation,y.pageText=b.pageText,y.characterBounds=b.characterBounds)):(w=x.pdfViewerBase.createBlobUrl(y.image.split("base64,")[1],"image/png"),C={image:(URL||webkitURL).createObjectURL(w),width:y.width,uniqueId:y.uniqueId,tileX:y.tileX,tileY:y.tileY,zoomFactor:y.zoomFactor,transformationMatrix:y.transformationMatrix}),x.pdfViewerBase.storeImageData(v,C,y.tileX,y.tileY),x.searchRequestOnSuccess(y,x,I,T,M,l,s,a,o,r))}}))}(e)}),d=this,i=0;i<E;i++)t(i)},N2t.prototype.searchRequestOnSuccess=function(e,t,i,n,o,r,s,a,l,h){var d;je(e.pageText)||e.uniqueId!==t.pdfViewerBase.documentId?o&&e.uniqueId===t.pdfViewerBase.documentId&&(t.pdfViewer.fireAjaxRequestSuccess(this.pdfViewer.serverActionSettings.renderPages,e),d=void 0!==e.pageNumber?e.pageNumber:r,t.pdfViewerBase.storeWinData(e,d,e.tileX,e.tileY),s===l-1)&&a===h-1&&t.initSearch(r,!1):(this.getSearchCountText(),t.pdfViewer.fireAjaxRequestSuccess(this.pdfViewer.serverActionSettings.renderPages,e),d=void 0!==e.pageNumber?e.pageNumber:r,n<=i?t.pdfViewerBase.storeWinData(e,d):t.pdfViewerBase.storeWinData(e,d,e.tileX,e.tileY),o?s!==l-1||a!==h-1||this.isMessagePopupOpened||t.initSearch(r,!1):this.isMessagePopupOpened||t.initSearch(r,!1))},N2t.prototype.getPDFDocumentTexts=function(){var e=50,t=this.pdfViewerBase.pageCount;this.createRequestForGetPdfTexts(0,e=t<=e?t:e)},N2t.prototype.createRequestForGetPdfTexts=function(e,i){var n=this,t={pageStartIndex:e,pageEndIndex:i,documentId:n.pdfViewerBase.getDocumentId(),hashId:n.pdfViewerBase.hashId,action:"RenderPdfTexts",elementId:n.pdfViewer.element.id,uniqueId:n.pdfViewerBase.documentId};this.pdfViewerBase.jsonDocumentId&&(t.documentId=this.pdfViewerBase.jsonDocumentId),this.searchRequestHandler=new DRt(this.pdfViewer),this.searchRequestHandler.url=this.pdfViewer.serviceUrl+"/"+this.pdfViewer.serverActionSettings.renderTexts,this.searchRequestHandler.responseType="json",this.pdfViewerBase.clientSideRendering||this.searchRequestHandler.send(t),this.searchRequestHandler.onSuccess=function(t){t=t.data;if(t){if("object"!=typeof t)try{t=JSON.parse(t)}catch(e){n.pdfViewerBase.onControlError(500,t,this.pdfViewer.serverActionSettings.renderTexts),t=null}t&&n.pdfTextSearchRequestOnSuccess(t,n,e,i)}},this.searchRequestHandler.onFailure=function(e){n.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,this.pdfViewer.serverActionSettings.renderTexts)},this.searchRequestHandler.onError=function(e){n.pdfViewerBase.openNotificationPopup(),n.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,this.pdfViewer.serverActionSettings.renderTexts)},this.pdfViewerBase.clientSideRendering&&this.pdfViewer.pdfRendererModule.getDocumentText(t,"pdfTextSearchRequest")},N2t.prototype.pdfTextSearchRequestSuccess=function(e,t,i){this.pdfTextSearchRequestOnSuccess(e,this,t,i)},N2t.prototype.pdfTextSearchRequestOnSuccess=function(e,t,i,n){e.documentTextCollection&&e.uniqueId===t.pdfViewerBase.documentId&&(e.isNeedToRender?(t.findTextDocumentCollection=this.updateDocumentCollection(t.findTextDocumentCollection,e.documentTextCollection),t.pdfViewer.pdfRendererModule.documentTextCollection=[]):(t.pdfViewer.fireAjaxRequestSuccess(this.pdfViewer.serverActionSettings.renderTexts,e),t.documentTextCollection=this.updateDocumentCollection(t.documentTextCollection,e.documentTextCollection),n!==(e=t.pdfViewerBase.pageCount)?(i=n,t.createRequestForGetPdfTexts(i,n=e<=(n+=50)?e:n)):(t.isTextRetrieved=!0,t.pdfViewer.pdfRendererModule.documentTextCollection=[],t.pdfViewer.fireTextExtractionCompleted(t.documentTextCollection),t.isTextSearched&&0<t.searchString.length&&(t.textSearch(t.searchString),t.isTextSearched=!1))))},N2t.prototype.updateDocumentCollection=function(e,t){return e=e&&0<e.length?this.pdfViewer.isVue&&!this.pdfViewer.isVue3?this.orderPdfTextCollections(JSON.parse("["+JSON.stringify(e).slice(1,-1)+","+JSON.stringify(t).slice(1,-1)+"]")):(e=t.concat(e),this.orderPdfTextCollections(e)):this.pdfViewer.isVue&&!this.pdfViewer.isVue3?JSON.parse("["+JSON.stringify(t).slice(1,-1)+"]"):t},N2t.prototype.orderPdfTextCollections=function(e){for(var t=[],i=0;i<e.length;i++)if(0===t.length)t.push(e[parseInt(i.toString(),10)]);else if(parseInt(Object.keys(e[parseInt(i.toString(),10)])[0],10)>parseInt(Object.keys(t[t.length-1])[0],10))t.push(e[parseInt(i.toString(),10)]);else for(var n=0;n<t.length;n++)if(parseInt(Object.keys(e[parseInt(i.toString(),10)])[0],10)<parseInt(Object.keys(t[parseInt(n.toString(),10)])[0],10)){t.splice(n,0,e[parseInt(i.toString(),10)]);break}return t},N2t.prototype.createSearchBoxButtons=function(e,t){var i=Q("button",{id:this.pdfViewer.element.id+"_"+e,className:"e-btn e-icon-btn e-pv-text-search-btn "+t}),e=(i.setAttribute("type","button"),Q("span",{id:this.pdfViewer.element.id+"_"+e+"Icon",className:"e-pv-icon-search "+t+"-icon"}));return i.disabled=!0,i.appendChild(e),i},N2t.prototype.enablePrevButton=function(e){F.isDevice&&!this.pdfViewer.enableDesktopMode||(e?this.prevSearchBtn.removeAttribute("disabled"):this.prevSearchBtn&&(this.prevSearchBtn.disabled=!0))},N2t.prototype.enableNextButton=function(e){F.isDevice&&!this.pdfViewer.enableDesktopMode||(e?this.nextSearchBtn.removeAttribute("disabled"):this.nextSearchBtn&&(this.nextSearchBtn.disabled=!0))},N2t.prototype.resetVariables=function(){this.searchedPages=[],this.searchMatches=[],this.searchedOccurrences=[]},N2t.prototype.resetVariablesTextSearch=function(){this.getSearchTextDetails={},this.isTextSearchHandled=!1},N2t.prototype.searchButtonClick=function(e,t,i){this.isMessagePopupOpened=!1,e.classList.contains("e-pv-search-icon")?this.initiateTextSearch(t.value,i):e.classList.contains("e-pv-search-close")&&(this.showLoadingIndicator(!1),t.value="",this.resetTextSearch(),this.searchCountEle&&(this.searchCountEle.innerHTML="",this.adjustInputContainerWidth()),t.focus())},N2t.prototype.updateSearchInputIcon=function(e){N&&this.searchBtn&&F.isDevice&&!this.pdfViewer.enableDesktopMode&&(this.searchBtn=this.pdfViewerBase.getElement("_search_box-icon").children[0].children[0]),this.searchBtn&&(e?(this.searchBtn.classList.remove("e-pv-search-close"),this.searchBtn.classList.add("e-pv-search-icon")):(this.searchBtn.classList.remove("e-pv-search-icon"),this.searchBtn.classList.add("e-pv-search-close")))},N2t.prototype.onMessageBoxOpen=function(){var t=this;this.pdfViewer.fireTextSearchComplete(this.searchString,this.isMatchCase),this.showLoadingIndicator(!1),this.isMessagePopupOpened=!0,this.pdfViewer.showNotificationDialog?!F.isDevice||this.pdfViewer.enableDesktopMode?N?this.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_Nomatches").then(function(e){t.pdfViewerBase.createNotificationPopup(e)}):0<this.searchMatches.length?this.pdfViewerBase.createNotificationPopup(this.pdfViewer.localeObj.getConstant("No More Matches")):this.pdfViewerBase.createNotificationPopup(this.pdfViewer.localeObj.getConstant("No Matches")):N?this.pdfViewer._dotnetInstance.invokeMethodAsync("GetLocaleText","PdfViewer_NoTextFound").then(function(e){t.pdfViewerBase.navigationPane.createTooltipMobile(e)}):0<this.searchMatches.length?this.pdfViewerBase.navigationPane.createTooltipMobile(this.pdfViewer.localeObj.getConstant("No More Search Matches")):this.pdfViewerBase.navigationPane.createTooltipMobile(this.pdfViewer.localeObj.getConstant("No Search Matches")):setTimeout(function(){t.isMessagePopupOpened=!1},100),this.currentOccurrence=this.searchCount,this.isLastOccurrenceCompleted=!0,this.currentOccurrence===this.searchCount&&(this.currentOccurrence=0),this.searchCountEle&&this.isSingleSearch&&(this.getSearchCountText(),this.adjustInputContainerWidth()),this.searchedPages=[],this.searchedOccurrences=[],this.searchIndex=0,this.programaticalSearch||(this.isDocumentTextCollectionReady?this.highlightAfterComplete():this.hightlightSearchedTexts(void 0,!0,!0)),this.searchString="",this.searchPageIndex=this.startSearchPageIndex,je(this.searchPageIndex)?this.pdfViewerBase.updateScrollTop(0):this.pdfViewerBase.updateScrollTop(this.searchPageIndex),this.showLoadingIndicator(!1)},N2t.prototype.highlightAfterComplete=function(){for(var e=0;e<this.searchMatches.length;e++)if(this.searchMatches[parseInt(e.toString(),10)]&&0<this.searchMatches[parseInt(e.toString(),10)].length){var t=this.searchMatches[parseInt(e.toString(),10)],i="e-pv-search-text-highlightother",n=this.pdfViewerBase.textLayer.characterBound[parseInt(e.toString(),10)];if(n&&void 0!==t)for(var o=0;o<t.length;o++){if(t[parseInt(o.toString(),10)].length)for(var r=this.documentTextCollection[parseInt(e.toString(),10)][parseInt(e.toString(),10)],r=r.pageText||r.PageText,s=this.searchInput.value,a=(this.isMatchCase||(s=s.toLowerCase(),r=r.toLowerCase()),this.correctLinetext(s,null,r)),l=0;l<a.length;l++){var h=void 0,h=0===l?"_searchtext_"+e+"_"+o:"_searchtext_"+e+"_"+o+"_"+l;this.pdfViewerBase.getElement(h)||this.addDivForSearch(o,e,n,a[parseInt(l.toString(),10)].trim().length,i,l)}je(t[parseInt(o.toString(),10)].length)&&this.addDivForSearch(o,e,n,this.searchInput.value.length,i,void 0)}}},N2t.prototype.searchText=function(e,t){var i,n=this;this.documentTextCollection.length===this.pdfViewerBase.pageCount?this.isDocumentTextCollectionReady=!0:i=setInterval(function(){n.documentTextCollection.length===n.pdfViewerBase.pageCount&&(clearInterval(i),n.calculateSearchCount(e,n.documentTextCollection),n.getSearchTextDetails={},n.isDocumentTextCollectionReady=!0)},1e3),this.isDocumentTextCollectionReady||!this.pdfViewerBase.clientSideRendering?(e&&0<e.length&&" "===e[e.length-1]&&(e=e.slice(0,e.length-1)),this.pdfViewer.enableHtmlSanitizer&&(e=e&&go.sanitize(e)),this.searchString=e,this.isMatchCase=t,this.searchIndex=0,this.programaticalSearch=!0,this.isSingleSearch=!0,this.isTextSearchHandled=!1,this.calculateSearchCount(e,this.documentTextCollection),this.textSearch(e)):this.searchString!==e&&(this.isSingleSearch=!0,this.searchString=e,this.isMatchCase=t,this.searchIndex=0,this.searchCount=0,this.searchPageIndex=0,this.programaticalSearch=!0,this.textSearchWhileLoading(e,t))},N2t.prototype.searchNext=function(){this.nextSearch()},N2t.prototype.searchPrevious=function(){this.prevSearch()},N2t.prototype.cancelTextSearch=function(){this.resetTextSearch()},N2t.prototype.destroy=function(){this.searchMatches=void 0},N2t.prototype.findText=function(e,t,i){var n=this,t=(this.isMatchCase=t,Array.isArray(e)?e:[e]),o=je(i)?0:i,i=je(i)?this.documentTextCollection.length:i+1,n=(r=i-1,n.documentTextCollection[parseInt(r.toString(),10)]?n.documentTextCollection[parseInt(r.toString(),10)][parseInt(r.toString(),10)]:null),r=[];return r=n&&0<n.TextData.length?this.getSearchResults(e,t,{},o,i,this.documentTextCollection):r},N2t.prototype.findTextAsync=function(s,e,t){var a=this,l=this,h=(this.isMatchCase=e,this.pdfViewer.pdfRenderer.searchResults={},Array.isArray(s)?s:[s]),d={},p=t||0,c=je(t)?this.pdfViewerBase.pageCount:t+1,u={pageStartIndex:p,pageEndIndex:c,documentId:l.pdfViewerBase.getDocumentId(),hashId:l.pdfViewerBase.hashId,action:"RenderPdfTexts",elementId:l.pdfViewer.element.id,uniqueId:l.pdfViewerBase.documentId};this.pdfViewerBase.jsonDocumentId&&(u.documentId=this.pdfViewerBase.jsonDocumentId);return this.pdfViewer.extractTextOption===ECt.None||this.pdfViewer.extractTextOption===ECt.TextOnly?new Promise(function(t,e){for(var i,n,o="extractText_"+mRt.createGUID(),r=p;r<c;r++)i=r,n=o,l.pdfViewerBase.pdfViewerRunner.addTask({pageIndex:i,message:n,zoomFactor:l.pdfViewer.magnificationModule.zoomFactor,isTextNeed:!0,isLayout:!0,isSkipCharacterBounds:!1,isNeedToRender:!0,jsonObject:u,isRenderText:!0,requestType:"pdfTextSearchRequest"},yRt.Medium),l.pdfViewerBase.pdfViewerRunner.onMessage(n,function(e){-1!==e.data.message.indexOf("extractText")&&(l.pdfViewer.pdfRendererModule.textExtractionOnmessage(e,null,null),e.data.pageIndex+1===c)&&(t(a.getSearchResults(s,h,d,p,c,l.findTextDocumentCollection)),l.findTextDocumentCollection=[])})}):Promise.resolve(this.getSearchResults(s,h,d,p,c,l.documentTextCollection))},N2t.prototype.getSearchResults=function(e,t,i,n,o,r){for(var s=0,a=t;s<a.length;s++){var l=a[s];this.calculateSearchCount(l,r),i[""+l]=[];for(var h=n;h<o;h++){var d=this.searchMatches[parseInt(h.toString(),10)];if(d){var p=parseInt(Object.keys(r[parseInt(h.toString(),10)])[0],10),p=r[parseInt(h.toString(),10)][parseInt(p.toString(),10)],c=p.textData||p.TextData;if(c){for(var u={pageIndex:h,bounds:[]},g=0,m=d;g<m.length;g++){var f=m[g],f=this.calculateTextBounds(l,f,c);u.bounds.push(f)}0<u.bounds.length&&i[""+l].push(u)}}}}return Array.isArray(e)?i:i[e]},N2t.prototype.calculateTextBounds=function(e,t,i){for(var n=i[parseInt(t.toString(),10)].Bounds,o=n.X,r=n.Y,s=n.Height,a=0,l=0;l<e.length;l++){var h=t&&!je(t.length)&&1<t.length?t[0]:t,h=i[parseInt((h+l).toString(),10)].Bounds,s=Math.max(s,h.Height);l===e.length-1&&(a=h.Right)}return{x:o,y:r,width:a-o,height:s}},N2t.prototype.getModuleName=function(){return"TextSearch"},N2t);function N2t(e,t){var i=this;this.isTextSearch=!1,this.searchCount=0,this.currentOccurrence=0,this.searchIndex=0,this.currentSearchIndex=0,this.startIndex=null,this.searchPageIndex=null,this.startSearchPageIndex=null,this.searchString=null,this.isMatchCase=!1,this.isMultiSearch=!1,this.isSingleSearch=!1,this.findTextDocumentCollection=[],this.searchRequestHandler=null,this.textSearchHandleRequest=null,this.isTextSearchHandled=!1,this.textSearchOpen=!1,this.programaticalSearch=!1,this.isFiltering=!1,this.textContents=[],this.searchMatches=[],this.multiSearchCounts={},this.getSearchTextDetails={},this.searchedPages=[],this.isPrevSearch=!1,this.isExactMatch=!1,this.autompleteDataSource=[],this.searchedOccurrences=[],this.isSelectedFromPopup=!1,this.isDocumentTextCollectionReady=!1,this.intervalId=null,this.searchTextDivzIndex="-1",this.tempElementStorage=[],this.isMessagePopupOpened=!1,this.isTextRetrieved=!1,this.isTextSearched=!1,this.isTextSearchEventTriggered=!1,this.isSearchText=!1,this.isLastOccurrenceCompleted=!1,this.checkBoxOnChange=function(e){e.checked?i.isMatchCase=!0:i.isMatchCase=!1,i.searchString="",i.searchInput.value&&""!==i.searchInput.value&&(i.isTextSearch=!0),i.isTextSearch&&i.isDocumentTextCollectionReady&&(i.resetVariables(),i.clearAllOccurrences(),e=i.searchInput.value,i.searchIndex=0,i.initiateTextSearch(e),0!==i.searchCount||i.isMessagePopupOpened||i.onMessageBoxOpen())},this.searchKeypressHandler=function(e){var t=String.fromCharCode(e.which||e.keyCode);/[a-zA-Z0-9]/.test(t);e.ctrlKey||e.altKey?i.resetVariables():(i.initiateTextSearch(i.searchInput.value),i.updateSearchInputIcon(!1))},this.searchClickHandler=function(e){i.searchButtonClick(i.searchBtn,i.searchAutocompleteObj)},this.nextButtonOnClick=function(e){i.searchString=i.searchInput.value,i.nextSearch()},this.prevButtonOnClick=function(e){i.searchString=i.searchInput.value,i.prevSearch()},this.pdfViewer=e,this.pdfViewerBase=t}_2t.prototype.print=function(){var o,r=this;0<this.pdfViewerBase.pageCount&&(this.printViewerContainer=Q("div",{id:this.pdfViewer.element.id+"_print_viewer_container",className:"e-pv-print-viewer-container"}),"Default"===this.pdfViewer.printMode?(this.pdfViewerBase.showPrintLoadingIndicator(!0),this.iframe=document.createElement("iframe"),this.iframe.className="iframeprint",this.iframe.id="iframePrint",this.iframe.style.position="fixed",this.iframe.style.top="-100000000px",document.body.appendChild(this.iframe),this.frameDoc=this.iframe.contentWindow||this.iframe.contentDocument,this.frameDoc.document.open()):(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),this.createPrintLoadingIndicator(this.printWindow.document.body)),setTimeout(function(){for(o=0;o<r.pdfViewerBase.pageCount;o++){var e=r.pdfViewerBase.pageSize[parseInt(o.toString(),10)].width,t=r.pdfViewerBase.pageSize[parseInt(o.toString(),10)].height,i=793,n=1122;r.printWidth=816,r.printHeight=1056,t<e&&(i=1122,n=793),i+10<=e||e<=i-10||n+10<=t||t<=n-10||(r.printWidth=783,r.printHeight=1110),r.pdfViewer.printModule.createRequestForPrint(o,e,t,r.pdfViewerBase.pageCount,r.pdfViewer.printScaleFactor)}r.pdfViewer.firePrintEnd(r.pdfViewer.downloadFileName)},100))},_2t.prototype.createRequestForPrint=function(t,i,n,e,o){var r=this,s={pageNumber:t.toString(),documentId:this.pdfViewerBase.documentId,hashId:this.pdfViewerBase.hashId,zoomFactor:"1",action:"PrintImages",elementId:this.pdfViewer.element.id,uniqueId:this.pdfViewerBase.documentId,digitalSignaturePresent:this.pdfViewerBase.digitalSignaturePresent(t),printScaleFactor:.5<=o&&o<=5?o:5<o?5:1};this.pdfViewerBase.jsonDocumentId&&(s.documentId=this.pdfViewerBase.jsonDocumentId),r.pdfViewerBase.createFormfieldsJsonData(),r.printRequestHandler=new DRt(r.pdfViewer),r.printRequestHandler.url=r.pdfViewer.serviceUrl+"/"+r.pdfViewer.serverActionSettings.print,r.printRequestHandler.responseType=null,r.printRequestHandler.mode=!1,this.pdfViewerBase.validateForm&&this.pdfViewer.enableFormFieldsValidation?(this.pdfViewer.fireValidatedFailed(r.pdfViewer.serverActionSettings.download),this.pdfViewerBase.validateForm=!1,this.pdfViewerBase.showPrintLoadingIndicator(!1)):r.pdfViewerBase.clientSideRendering?this.pdfViewerBase.pdfViewerRunner.addTask({pageIndex:t,message:"printImage",printScaleFactor:.5<=o&&o<=5?o:5<o?5:1},yRt.High):r.printRequestHandler.send(s),r.printRequestHandler.onSuccess=function(e){r.printSuccess(e,i,n,t)},this.printRequestHandler.onFailure=function(e){r.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,r.pdfViewer.serverActionSettings.print)},this.printRequestHandler.onError=function(e){r.pdfViewerBase.openNotificationPopup(),r.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,r.pdfViewer.serverActionSettings.print)}},_2t.prototype.printOnMessage=function(e){var t=document.createElement("canvas"),e=e.data,i=e.value,n=e.width,o=e.height,r=e.pageIndex,s=e.pageWidth,e=e.pageHeight,a=(t.width=n,t.height=o,t.getContext("2d")),o=a.createImageData(n,o),i=(o.data.set(i),a.putImageData(o,0,0),t.toDataURL()),a=(this.pdfViewerBase.releaseCanvas(t),{image:i,pageNumber:r,uniqueId:this.pdfViewerBase.documentId,pageWidth:n});this.printSuccess(a,s,e,r)},_2t.prototype.printSuccess=function(t,e,i,n){var o,r,s,a,l,h,d,p,c,u,g,m,f,y,v=this,t=(this.pdfViewerBase.isPrint=!0,this.pdfViewerBase.clientSideRendering?t:t.data);if(this.pdfViewerBase.checkRedirection(t))this.pdfViewerBase.showPrintLoadingIndicator(!1);else{if(t&&"object"!=typeof t)try{"object"!=typeof(t=JSON.parse(t))&&(this.pdfViewerBase.onControlError(500,t,this.pdfViewer.serverActionSettings.print),t=null)}catch(e){this.pdfViewerBase.onControlError(500,t,this.pdfViewer.serverActionSettings.print),t=null}t&&t.uniqueId===this.pdfViewerBase.documentId&&(this.pdfViewer.fireAjaxRequestSuccess(this.pdfViewer.serverActionSettings.print,t),this.pdfViewer.annotationSettings.skipPrint||((o=this.pdfViewerBase.documentAnnotationCollections)&&o[t.pageNumber]&&this.pdfViewerBase.isTextMarkupAnnotationModule()&&(o=o[t.pageNumber],a=this.pdfViewerBase.isImportAction?(h=o.textMarkupAnnotation,d=o.shapeAnnotation,c=o.measureShapeAnnotation,p=o.stampAnnotations,r=o.freeTextAnnotation,s=o.signatureInkAnnotation,u=o.stickyNotesAnnotation,this.pdfViewer.annotationModule.textMarkupAnnotationModule.printAnnotationsInCanvas(h,t.pageNumber,p,d,c,u,r,s)):this.pdfViewer.annotationModule.textMarkupAnnotationModule.printAnnotationsInCanvas(o.textMarkupAnnotation,t.pageNumber,o.stampAnnotations,o.shapeAnnotation,o.measureShapeAnnotation,o.stickyNotesAnnotation,o.freeTextAnnotation,o.signatureInkAnnotation)),this.pdfViewerBase.isAnnotationCollectionRemoved&&(a=this.pdfViewer.annotationModule.textMarkupAnnotationModule.printAnnotationsInCanvas(null,t.pageNumber,null,null,null,null,null,null))),l=t.pageNumber,this.printCanvas=Q("canvas",{id:this.pdfViewer.element.id+"_printCanvas_"+n,className:"e-pv-print-canvas"}),this.printCanvas.style.width=e+"px",this.printCanvas.style.height=i+"px",h=1<this.pdfViewer.printScaleFactor&&this.pdfViewer.printScaleFactor<=5?this.pdfViewer.printScaleFactor:5<this.pdfViewer.printScaleFactor?5:2,this.pdfViewerBase.clientSideRendering?("Width"==((p=i)<(d=e)?"Width":"Height")?4493===(d=4493<e?4493:e)&&(p=i/(e/4493)):4493===(p=4493<i?4493:i)&&(d=e/(i/4493)),i<e&&this.pdfViewer.enablePrintRotation?(this.printCanvas.height=e*h*window.devicePixelRatio,this.printCanvas.width=i*h*window.devicePixelRatio):(this.printCanvas.height=p*h*window.devicePixelRatio,this.printCanvas.width=d*h*window.devicePixelRatio)):(this.printCanvas.height=this.printHeight*h*window.devicePixelRatio,this.printCanvas.width=this.printWidth*h*window.devicePixelRatio),this.pdfViewerBase.isDeviceiOS&&(c=new avt(this.printCanvas.width,this.printCanvas.height),u=this.limitSize(c,this.maximumPixels),this.printCanvas.width=u.width,this.printCanvas.height=u.height),g=this.printCanvas.getContext("2d"),m=new Image,f=new Image,y=new Image,m.onload=function(){v.pdfViewerBase.isPrint=!0,e<i||!v.pdfViewer.enablePrintRotation?(g.drawImage(m,0,0,v.printCanvas.width,v.printCanvas.height),a&&a.annotImg&&g.drawImage(f,0,0,v.printCanvas.width,v.printCanvas.height)):(g.translate(.5*v.printCanvas.width,.5*v.printCanvas.height),g.rotate(-.5*Math.PI),g.translate(.5*-v.printCanvas.height,.5*-v.printCanvas.width),g.drawImage(m,0,0,v.printCanvas.height,v.printCanvas.width),a&&a.annotImg&&g.drawImage(f,0,0,v.printCanvas.height,v.printCanvas.width)),a&&a.highlightImg&&(g.save(),g.globalCompositeOperation="multiply",g.drawImage(y,0,0,v.printCanvas.width,v.printCanvas.height),g.restore()),l===v.pdfViewerBase.pageCount-1&&v.printWindowOpen(),v.pdfViewer.renderDrawing(null,n),v.pdfViewerBase.isPrint=!1},m.src=t.image,a&&!je(a.annotImg)&&(f.src=a.annotImg),a&&!je(a.highlightImg)&&(y.src=a.highlightImg),this.printViewerContainer.appendChild(this.printCanvas))}this.pdfViewerBase.isPrint=!1},_2t.prototype.limitSize=function(e,t){var i=e.width,n=e.height,o=i*n;return o<=t?new avt(e.width,e.height):(e=Math.sqrt(t)/Math.sqrt(o),new avt(Math.floor(i*e),Math.floor(n*e)))},_2t.prototype.renderFieldsForPrint=function(e,t,i){var n=null,o=("Default"===this.pdfViewer.printMode?this.frameDoc:this.printWindow).document.getElementById("fields_"+e);if(this.pdfViewer.formFieldsModule&&(n=this.pdfViewerBase.getItemFromSessionStorage("_formfields")),this.pdfViewer.formDesignerModule){var r=null;if(r=this.pdfViewer.formDesignerModule?this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"):r)for(var s=JSON.parse(r),a=0;a<s.length;a++)if((C=s[parseInt(a.toString(),10)].FormField).pageNumber-1===e&&C.isPrint){var l=(p=this.pdfViewer.nameTable[s[parseInt(a.toString(),10)].Key.split("_")[0]]).wrapper.children[0],h=void 0;if(l)if("RadioButton"===C.formFieldAnnotationType)for(var d=0;d<C.radiobuttonItem.length;d++){var p=this.pdfViewer.nameTable[C.radiobuttonItem[parseInt(d.toString(),10)].id.split("_")[0]];(h=this.createFormDesignerFields(C.radiobuttonItem[parseInt(d.toString(),10)],l,p))&&(g=C.radiobuttonItem[parseInt(d.toString(),10)].lineBound,m=C.radiobuttonItem[parseInt(d.toString(),10)].fontFamily,this.applyPosition(h,g,m,t,i,!0,C.radiobuttonItem[parseInt(d.toString(),10)].zoomValue,C.pageNumber-1),o.appendChild(h))}else(h=this.createFormDesignerFields(C,l,p))&&(g=C.lineBound,m=C.fontFamily,this.applyPosition(h,g,m,t,i,!0,C.zoomValue,C.pageNumber-1),!je(g))&&0<g.Width&&0<g.Height&&o.appendChild(h)}}else if(n)for(var c=JSON.parse(n),a=0;a<c.length;a++){var u,g,m,f,y,v,b,w,C=c[parseInt(a.toString(),10)];parseFloat(C.PageIndex)===e&&(u=this.pdfViewer.formFieldsModule.createFormFields(C,e,a,o).currentField)&&(g=C.LineBounds,m=C.Font,this.applyPosition(u,g,m,t,i),u.InsertSpaces=C.InsertSpaces,u.InsertSpaces&&(f=parseInt(u.style.width,10)/u.maxLength-parseFloat(u.style.fontSize)/2-.6,u.style.letterSpacing=f+"px",u.style.fontFamily="monospace"),(f=this.pdfViewerBase.pageSize[parseInt(e.toString(),10)]).width>f.height&&this.pdfViewer.enablePrintRotation&&(b=this.pdfViewer.formFieldsModule.ConvertPointToPixel(g.X),w=this.pdfViewer.formFieldsModule.ConvertPointToPixel(g.Y),y=this.pdfViewer.formFieldsModule.ConvertPointToPixel(g.Width),v=this.pdfViewer.formFieldsModule.ConvertPointToPixel(g.Height),b=f.width-b-v,w=w+v,u.style.transform="rotate(-90deg)",u.style.transformOrigin="left bottom",u.style.left=w+"px",u.style.top=b+"px",u.style.height=v+"px",u.style.width=y+"px"),u.style.backgroundColor="transparent",C.IsSignatureField||(u.style.borderColor="transparent"),o.appendChild(u))}},_2t.prototype.createFormDesignerFields=function(e,t,i){var n={id:"form_field_"+t.id+"_html_element",class:"foreign-object"},n=this.pdfViewer.formDesignerModule.createHtmlElement("div",n),o={id:t.id+"_html_element",class:"foreign-object"},o=this.pdfViewer.formDesignerModule.createHtmlElement("div",o);return"SignatureField"===e.formFieldAnnotationType||"InitialField"===e.formFieldAnnotationType?(this.pdfViewer.formDesignerModule.disableSignatureClickEvent=!0,t.template=o.appendChild(this.pdfViewer.formDesignerModule.createSignatureDialog(this.pdfViewer,i,null,!0)),this.pdfViewer.formDesignerModule.disableSignatureClickEvent=!1):"DropdownList"===e.formFieldAnnotationType?t.template=o.appendChild(this.pdfViewer.formDesignerModule.createDropDownList(t,i,!0)):"ListBox"===e.formFieldAnnotationType?t.template=o.appendChild(this.pdfViewer.formDesignerModule.createListBox(t,i,!0)):t.template=o.appendChild(this.pdfViewer.formDesignerModule.createInputElement(e.formFieldAnnotationType,i,null,!0)),n.appendChild(o),o},_2t.prototype.applyPosition=function(e,t,i,n,o,r,s,a){var l,h,d,p,c;t&&(p=d=l=void 0,c=(a=this.pdfViewerBase.pageSize[a])?a.width:0,a=a?a.height:0,r&&a<c&&this.pdfViewer.enablePrintRotation?(h=c-t.X/s-t.Height/s,l=(t.Y+t.Height)/s,d=t.Width/s,p=t.Height/s,e.style.transform="rotate(-90deg)",e.style.transformOrigin="left bottom"):(l=r?t.X/s/o:this.pdfViewer.formFieldsModule.ConvertPointToPixel(t.X)/o,h=r?t.Y/s/n:this.pdfViewer.formFieldsModule.ConvertPointToPixel(t.Y)/n,d=r?t.Width/s/o:this.pdfViewer.formFieldsModule.ConvertPointToPixel(t.Width)/o,p=r?t.Height/s/n:this.pdfViewer.formFieldsModule.ConvertPointToPixel(t.Height)/n),a=0,null!==i&&i.Height&&(e.style.fontFamily=i.Name,i.Italic&&(e.style.fontStyle="italic"),i.Bold&&(e.style.fontWeight="Bold"),a=this.pdfViewerBase.ConvertPointToPixel(i.Size)),F.isIE&&(h-=1),this.pdfViewerBase.setStyleToTextDiv(e,l,h,a,d,p,!0))},_2t.prototype.printWindowOpen=function(){for(var t=this,e=navigator.userAgent,i=("Default"===this.pdfViewer.printMode?this.frameDoc:this.printWindow).document,n=0;n<this.printViewerContainer.children.length;n++){var o,r,s,a=this.printViewerContainer.children[parseInt(n.toString(),10)].toDataURL("image/jpeg");i.write('<div style="margin:0mm;width:'+this.printWidth.toString()+"px;height:"+this.printHeight.toString()+'px;position:relative"><img src="'+a+'" id="image_'+n+'" /><div id="fields_'+n+'" style="margin:0px;top:0px;left:0px;position:absolute;width:'+this.printWidth.toString()+"px;height:"+this.printHeight.toString()+'px;z-index:2"></div></div>'),(this.pdfViewer.formFieldsModule||this.pdfViewer.formDesignerModule)&&(a=this.pdfViewerBase.pageSize[parseInt(n.toString(),10)].width,s=r=void 0,s=(o=this.pdfViewerBase.pageSize[parseInt(n.toString(),10)].height)<a&&this.pdfViewer.enablePrintRotation?(r=o/this.printWidth,a/this.printHeight):(r=o/this.printHeight,a/this.printWidth),this.renderFieldsForPrint(n,r,s)),0===n&&(-1!==e.indexOf("Chrome")||-1!==e.indexOf("Safari")||-1!==e.indexOf("Firefox")?(i.write("<!DOCTYPE html>"),i.write("<html moznomarginboxes mozdisallowselectionprint><head><style>html, body { height: 100%; width:100% } img { height: 100%; width: 100%; display: block; }@media print { body { margin: 0cm; } img { width:100%; width:100%; box-sizing: border-box; }br, button { display: none; } div{ page-break-inside: avoid; }} @page{margin:0mm;  size:"+this.printWidth.toString()+"px "+this.printHeight.toString()+"px; }</style></head><body>")):(i.write("<!DOCTYPE html>"),i.write("<html><head><style>html, body { height: 100%; } img { height: 100%; width: 100%; }@media print { body { margin: 0cm; }img { width:100%; width:100%; box-sizing: border-box; }br, button { display: none; } div{ page-break-inside: avoid; }} @page{margin:0mm;  size:"+this.printWidth.toString()+"px "+this.printHeight.toString()+"px; }</style></head><body>")))}if(F.isIE||"edge"===F.info.name)try{("Default"===this.pdfViewer.printMode?(this.pdfViewerBase.showPrintLoadingIndicator(!1),this.iframe.contentWindow):this.printWindow).document.execCommand("print",!1,null)}catch(e){("Default"===this.pdfViewer.printMode?(this.pdfViewerBase.showPrintLoadingIndicator(!1),this.iframe.contentWindow):this.printWindow).print()}else setTimeout(function(){var e;"Default"===t.pdfViewer.printMode?(t.pdfViewerBase.showPrintLoadingIndicator(!1),t.iframe.contentWindow.print(),t.iframe.contentWindow.focus(),t.pdfViewerBase.isDeviceiOS||F.isDevice?(e=t,window.onafterprint=function(){document.body.removeChild(e.iframe)}):document.body.removeChild(t.iframe)):t.printWindow&&(t.printWindow.print(),t.printWindow.focus(),F.isDevice&&!t.pdfViewerBase.isDeviceiOS||t.printWindow.close())},200)},_2t.prototype.createPrintLoadingIndicator=function(e){var t=Q("div",{id:this.pdfViewer.element.id+"_printWindowcontainer"}),e=(t.style.height="100%",t.style.width="100%",t.style.position="absolute",t.style.zIndex=2e3,t.style.left=0,t.style.top=0,t.style.overflow="auto",t.style.backgroundColor="rgba(0, 0, 0, 0.3)",e.appendChild(t),Q("div",{id:this.pdfViewer.element.id+"_printLoadingContainer"})),i=(e.style.position="absolute",e.style.width="50px",e.style.height="50px",e.style.left="46%",e.style.top="45%",t.style.zIndex=3e3,t.appendChild(e),new Image),e=(i.src="data:image/gif;base64,R0lGODlhNgA3APMAAP///wAAAHh4eBwcHA4ODtjY2FRUVNzc3MTExEhISIqKigAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAANgA3AAAEzBDISau9OOvNu/9gKI5kaZ4lkhBEgqCnws6EApMITb93uOqsRC8EpA1Bxdnx8wMKl51ckXcsGFiGAkamsy0LA9pAe1EFqRbBYCAYXXUGk4DWJhZN4dlAlMSLRW80cSVzM3UgB3ksAwcnamwkB28GjVCWl5iZmpucnZ4cj4eWoRqFLKJHpgSoFIoEe5ausBeyl7UYqqw9uaVrukOkn8LDxMXGx8ibwY6+JLxydCO3JdMg1dJ/Is+E0SPLcs3Jnt/F28XXw+jC5uXh4u89EQAh+QQJCgAAACwAAAAANgA3AAAEzhDISau9OOvNu/9gKI5kaZ5oqhYGQRiFWhaD6w6xLLa2a+iiXg8YEtqIIF7vh/QcarbB4YJIuBKIpuTAM0wtCqNiJBgMBCaE0ZUFCXpoknWdCEFvpfURdCcM8noEIW82cSNzRnWDZoYjamttWhphQmOSHFVXkZecnZ6foKFujJdlZxqELo1AqQSrFH1/TbEZtLM9shetrzK7qKSSpryixMXGx8jJyifCKc1kcMzRIrYl1Xy4J9cfvibdIs/MwMue4cffxtvE6qLoxubk8ScRACH5BAkKAAAALAAAAAA2ADcAAATOEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwyZKxhqhgJJeSQVdraBNFSsVUVPHsEAzJrEtnJNSELXRN2bKcwjw19f0QG7PjA7B2EGfn+FhoeIiYoSCAk1CQiLFQpoChlUQwhuBJEWcXkpjm4JF3w9P5tvFqZsLKkEF58/omiksXiZm52SlGKWkhONj7vAxcbHyMkTmCjMcDygRNAjrCfVaqcm11zTJrIjzt64yojhxd/G28XqwOjG5uTxJhEAIfkECQoAAAAsAAAAADYANwAABM0QyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/i8qmCoGQoacT8FZ4AXbFopfTwEBhhnQ4w2j0GRkgQYiEOLPI6ZUkgHZwd6EweLBqSlq6ytricICTUJCKwKkgojgiMIlwS1VEYlspcJIZAkvjXHlcnKIZokxJLG0KAlvZfAebeMuUi7FbGz2z/Rq8jozavn7Nev8CsRACH5BAkKAAAALAAAAAA2ADcAAATLEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwzJNCmPzheUyJuKijVrZ2cTlrg1LwjcO5HFyeoJeyM9U++mfE6v2+/4PD6O5F/YWiqAGWdIhRiHP4kWg0ONGH4/kXqUlZaXmJlMBQY1BgVuUicFZ6AhjyOdPAQGQF0mqzauYbCxBFdqJao8rVeiGQgJNQkIFwdnB0MKsQrGqgbJPwi2BMV5wrYJetQ129x62LHaedO21nnLq82VwcPnIhEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/g8Po7kX9haKoAZZ0iFGIc/iRaDQ40Yfj+RepSVlpeYAAgJNQkIlgo8NQqUCKI2nzNSIpynBAkzaiCuNl9BIbQ1tl0hraewbrIfpq6pbqsioaKkFwUGNQYFSJudxhUFZ9KUz6IGlbTfrpXcPN6UB2cHlgfcBuqZKBEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7yJEopZA4CsKPDUKfxIIgjZ+P3EWe4gECYtqFo82P2cXlTWXQReOiJE5bFqHj4qiUhmBgoSFho59rrKztLVMBQY1BgWzBWe8UUsiuYIGTpMglSaYIcpfnSHEPMYzyB8HZwdrqSMHxAbath2MsqO0zLLorua05OLvJxEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhfohELYHQuGBDgIJXU0Q5CKqtOXsdP0otITHjfTtiW2lnE37StXUwFNaSScXaGZvm4r0jU1RWV1hhTIWJiouMjVcFBjUGBY4WBWw1A5RDT3sTkVQGnGYYaUOYPaVip3MXoDyiP3k3GAeoAwdRnRoHoAa5lcHCw8TFxscduyjKIrOeRKRAbSe3I9Um1yHOJ9sjzCbfyInhwt3E2cPo5dHF5OLvJREAOwAAAAAAAAAAAA==",i.style.width="50px",i.style.height="50px",e.appendChild(i),Q("div",{id:this.pdfViewer.element.id+"_printLabelContainer"}));e.style.position="absolute",e.textContent="Loading ...",e.style.fontWeight="Bold",e.style.left="46%",e.style.top="54.5%",e.style.zIndex="3000",t.appendChild(e)},_2t.prototype.destroy=function(){this.printViewerContainer=void 0,this.frameDoc=void 0,this.printWindow=void 0},_2t.prototype.getModuleName=function(){return"Print"};var V2t=_2t;function _2t(e,t){this.printHeight=1056,this.printWidth=816,this.maximumPixels=16777216,this.pdfViewer=e,this.pdfViewerBase=t}var H2t=function(){return(H2t=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},z2t=(j2t.prototype.renderFormFields=function(b,e){if(this.maxTabIndex=0,(this.minTabIndex=-1)!==this.renderedPageList.indexOf(b)&&!e&&(this.data=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),this.data)&&"[]"!==this.data||(this.data=this.pdfViewerBase.getItemFromSessionStorage("_formfields")),this.data){this.formFieldsData=JSON.parse(this.data),"["===this.formFieldsData[0]&&(this.formFieldsData=JSON.parse(this.formFieldsData));var w=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+b),e=document.getElementById(this.pdfViewer.element.id+"_pageCanvas_"+b),C=void 0;if(null!==this.formFieldsData&&null!==e&&null!==w){for(var t=!1,i=0;i<this.formFieldsData.length;i++){var n=this.formFieldsData[parseInt(i.toString(),10)];!t&&je(n.ActualFieldName)&&n.PageIndex===b&&(C=parseInt(n.FieldName.slice(n.FieldName.lastIndexOf("_")+1),10),t=!0)}-1===this.renderedPageList.indexOf(b)&&this.renderedPageList.push(b);for(var S=this,i=0;i<this.formFieldsData.length;i++)!function(e){var t=S.formFieldsData[parseInt(e.toString(),10)];if(""!==t.FieldName){t.IsInitialField&&(t.Name="InitialField");var i,n,o,r,s,a=t.Font;if(S.pdfViewer.formDesigner)parseFloat(t.PageIndex)===b&&(y=s=r=void 0,!je(a)&&a.Height&&(r=a.Name,a.Italic&&(s="Italic"),a.Bold&&(s="Bold"),a.Strikeout&&(s="Strikethrough"),a.Underline&&(s="Underline"),y=S.ConvertPointToPixel(a.Size)),u=2===t.Alignment?"right":1===t.Alignment?"center":"left",l=t.BackColor,m=t.LineBounds,l="rgba("+l.R+","+l.G+","+l.B+",1)",!0===t.IsTransparent&&(l="rgba(0,0,0,0)"),"#000000ff"===(l=S.rgbaToHex(l))&&(l="#daeaf7ff"),d=t.FontColor,p=!(n={left:S.ConvertPointToPixel(m.X),top:S.ConvertPointToPixel(m.Y),width:S.ConvertPointToPixel(m.Width),height:S.ConvertPointToPixel(m.Height)}),(c=0)!==t.Rotation?-90!==t.RotationAngle&&-270!==t.RotationAngle&&-180!==t.RotationAngle||(n=S.getBounds(n,b,0,p)):(n=S.getBounds(n,b,0,p=!0),c=S.getAngle(b)),d="rgba("+d.R+","+d.G+","+d.B+",1)",d=S.rgbaToHex(d),f=t.BorderColor,g=void 0,g=t.IsTansparentBorderColor?"rgba("+f.R+","+f.G+","+f.B+",0)":"rgba("+f.R+","+f.G+","+f.B+",1)",g=S.rgbaToHex(g),f=t.BorderWidth,S.selectedIndex=[],o="",o="RadioButton"===t.Name||"CheckBox"===t.Name?t.Text||t.Value:t.Text,i="SignatureField"===t.Name?S.pdfViewer.signatureFieldSettings.signatureIndicatorSettings:S.pdfViewer.initialFieldSettings.initialIndicatorSettings,n={bounds:{X:n.left,Y:n.top,Width:n.width,Height:n.height},pageNumber:parseFloat(t.PageIndex)+1,name:t.ActualFieldName||t.FieldName,tooltip:t.ToolTip,value:o,insertSpaces:t.InsertSpaces,isChecked:t.Selected,isSelected:t.Selected,fontFamily:r,fontStyle:s,backgroundColor:l,color:d,borderColor:g,thickness:f,fontSize:y,isMultiline:t.Multiline,rotateAngle:c,isReadOnly:t.IsReadonly,isRequired:t.IsRequired,alignment:u,options:S.getListValues(t),selectedIndex:S.selectedIndex,maxLength:t.MaxLength,visibility:1===t.Visible?"hidden":"visible",font:{isItalic:!je(a)&&a.Italic,isBold:!je(a)&&a.Bold,isStrikeout:!je(a)&&a.Strikeout,isUnderline:!je(a)&&a.Underline},isTransparent:t.IsTransparent,customData:je(t.CustomData)?"":"object"==typeof t.CustomData?t.CustomData:""!==t.CustomData.trim()?JSON.parse(t.CustomData):"",signatureIndicatorSettings:i},t.id||!S.pdfViewer.formFieldCollections[parseInt(e.toString(),10)]||je(t.ActualFieldName)||(n.id=S.pdfViewer.formFieldCollections[parseInt(e.toString(),10)].id),"DropDown"!==t.Name&&"ListBox"!==t.Name||(n.value=t.SelectedValue),o=S.getFormFieldType(t),"SignatureText"===t.Name&&"SignatureImage"===t.Name||je(S.getFormFieldType(t))||(t.IsRequired&&(n.thickness=r=0<(r=n.thickness)?r:1),(s=S.pdfViewer.formDesignerModule.addField(o,n,!1,n.id))&&s.parentElement&&(t.id=s.parentElement.id.split("_")[0]),s&&"hidden"===s.style.visibility&&(s.childNodes[0].disabled=!0)),"SignatureField"!==o&&"InitialField"!==o||(S.addSignaturePath(t,C),je(t.Value))||""===t.Value||(S.renderExistingAnnnot(t,parseFloat(t.PageIndex)+1,null,p),S.isSignatureRendered=!0,C++),null!=t.ActualFieldName||je(t.FieldName)||0!==S.formFieldsData.filter(function(e){return!je(e.FieldName)&&e.FieldName.includes(t.FieldName.replace(/_\d$/,""))}).filter(function(e){return"ink"!==e.Name}).length||(S.renderExistingAnnnot(t,parseFloat(t.PageIndex)+1,null,p),S.pdfViewerBase.signatureModule.storeSignatureData(b,t),S.isSignatureRendered=!0,C++),S.pdfViewerBase.isLoadedFormFieldAdded=!0);else if(parseFloat(t.PageIndex)===b){var l=S.createFormFields(t,b,e,null,C),h=l.currentField,d=l.count,p=!1;if(null!==t.ActualFieldName||je(t.FieldName)||0!==S.formFieldsData.filter(function(e){return!je(e.FieldName)&&e.FieldName.includes(t.FieldName.replace(/_\d$/,""))}).filter(function(e){return"ink"!==e.Name}).length||(S.renderExistingAnnnot(t,parseFloat(t.PageIndex)+1,null,p),S.pdfViewerBase.signatureModule.storeSignatureData(b,t),S.isSignatureRendered=!0,C++),h){var c,u,g=S.createParentElement(t,b),m=t.LineBounds,f=t.Font,y=0;0===t.Rotation&&(p=!0,y=S.getAngle(b)),g?g.style.transform="rotate("+y+"deg)":h.style.transform="rotate("+y+"deg)",S.applyPosition(h,m,f,b,0,p),h.InsertSpaces=t.InsertSpaces,h.InsertSpaces&&(c=S.pdfViewerBase.getZoomFactor(),u=parseInt(h.style.width,10)/h.maxLength-parseFloat(h.style.fontSize)/2-.6*c,h.style.letterSpacing=u+"px",h.style.fontFamily="monospace",h.style.paddingLeft=u/2+"px"),t.uniqueID=S.pdfViewer.element.id+"input_"+b+"_"+e;for(var v=0;v<S.pdfViewer.formFieldCollections.length;v++)"text"!==h.type&&"password"!==h.type&&"textarea"!==h.type||"SignatureField"===t.Name||t.uniqueID===S.pdfViewer.formFieldCollections[parseInt(v.toString(),10)].id&&(S.pdfViewer.formFieldCollections[parseInt(v.toString(),10)].value=t.Text);je(t.Value)&&(t.Value=t.Text),t.ToolTip&&S.setToolTip(t.ToolTip,h),S.applyCommonProperties(h,b,e,t,p),S.checkIsReadonly(t,h),S.applyTabIndex(t,h,b),S.checkIsRequiredField(t,h),S.applyDefaultColor(h),S.updateFormFieldsCollection(t),g?(g.appendChild(h),w.appendChild(g)):(h.style.position="absolute",w.appendChild(h)),h.addEventListener("focus",S.focusFormFields.bind(S)),h.addEventListener("blur",S.blurFormFields.bind(S)),h.addEventListener("click",S.updateFormFields.bind(S)),h.addEventListener("change",S.changeFormFields.bind(S)),h.addEventListener("keydown",S.updateFormFieldsValue.bind(S)),h.addEventListener("keyup",S.updateSameFieldsValue.bind(S)),C=d}}}}(i);this.pdfViewer.formDesigner||(ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_formfields"),this.pdfViewerBase.setItemInSessionStorage(this.formFieldsData,"_formfields"))}}var o;this.pdfViewerBase.isFocusField&&this.pdfViewerBase.focusField&&(e=document.getElementById(this.pdfViewerBase.focusField.id))&&("SignatureField"!==this.pdfViewerBase.focusField.type&&"InitialField"!==this.pdfViewerBase.focusField.type||!this.pdfViewer.formDesignerModule?e.focus():(e=this.pdfViewerBase.focusField.bounds.y,o=this.pdfViewerBase.pageSize[parseInt(b.toString(),10)].height,this.pdfViewer.bookmark.goToBookmark(this.pdfViewerBase.focusField.pageIndex,o-e)),this.pdfViewerBase.isFocusField=!1,this.pdfViewerBase.focusField=[])},j2t.prototype.setToolTip=function(e,t){new NS({content:ao(function(){return e})}).appendTo(t)},j2t.prototype.trim=function(e){return e.replace(/^\s+|\s+$/gm,"")},j2t.prototype.rgbaToHex=function(e){var e=e.substring(e.indexOf("(")).split(","),t=parseInt(this.trim(e[0].substring(1)),10),i=parseInt(this.trim(e[1]),10),n=parseInt(this.trim(e[2]),10),e=parseFloat(parseFloat(this.trim(e[3].substring(0,e[3].length-1))).toFixed(2)),o=[t.toString(16),i.toString(16),n.toString(16),Math.round(255*e).toString(16).substring(0,2)];return o.forEach(function(e,t){1===e.length&&(o[parseInt(t.toString(),10)]="0"+e)}),"#"+o.join("")},j2t.prototype.getListValues=function(e){var t=e.TextList,i=[];if("DropDown"===this.getFormFieldType(e))for(var t=e.ComboBoxList,n=0;n<t.length;n++){var o=t[parseInt(n.toString(),10)].itemValue?t[parseInt(n.toString(),10)].itemValue:t[parseInt(n.toString(),10)].ItemValue,r=t[parseInt(n.toString(),10)].itemName?t[parseInt(n.toString(),10)].itemName:t[parseInt(n.toString(),10)].ItemName;r===e.SelectedValue&&this.selectedIndex.push(n),i.push({itemName:r,itemValue:o})}else for(n=0;n<t.length;n++)t[parseInt(n.toString(),10)]===e.SelectedValue&&this.selectedIndex.push(n),i.push({itemName:t[parseInt(n.toString(),10)],itemValue:t[parseInt(n.toString(),10)]});return"ListBox"===this.getFormFieldType(e)&&(this.selectedIndex=e.SelectedList),i},j2t.prototype.createParentElement=function(e,t){var i,n,o,r;return"Textbox"!==e.Name&&"Password"!==e.Name||((i=document.createElement("div")).style.background="white",e.InsertSpaces&&(i.style.background="transparent"),n=e.LineBounds,o=e.Font,r=!(i.style.position="absolute"),0===e.Rotation&&(r=!0),this.applyPosition(i,n,o,t,0,r)),i},j2t.prototype.getAngle=function(e){var t=0,e=this.pdfViewerBase.pageSize[parseInt(e.toString(),10)];if(e&&e.rotation)switch(e.rotation){case 0:t=0;break;case 1:t=90;break;case 2:t=180;break;case 3:t=270}return t},j2t.prototype.nextField=function(){this.signatureFieldNavigate(!0)},j2t.prototype.previousField=function(){this.signatureFieldNavigate(!1)},j2t.prototype.signatureFieldNavigate=function(e){var t,i=e,n=this.signatureFieldCollection,o=this.pdfViewer.formFieldCollections;if(0===n.length&&(n=this.pdfViewerBase.signatureModule.getSignField()),this.currentTarget){if(this.pdfViewer.formDesignerModule){for(var r=0;r<o.length;r++)if(t=o[parseInt(r.toString(),10)],this.currentTarget.id===t.id){this.currentTarget=document.getElementById(t.id),this.getSignatureIndex(r,o.length,i);break}}else for(r=0;r<n.length;r++)if(t=this.pdfViewer.formDesignerModule?n[parseInt(r.toString(),10)].FormField:n[parseInt(r.toString(),10)],this.currentTarget.id===t.uniqueID){this.currentTarget=document.getElementById(t.uniqueID),this.getSignatureIndex(r,n.length,i);break}}else e&&(this.pdfViewer.formDesignerModule?(t=n[0]).id&&(this.currentTarget=document.getElementById(t.id),this.getSignatureIndex(0,n.length,i,!0)):(t=n[0]).uniqueID&&(this.currentTarget=document.getElementById(t.uniqueID),this.getSignatureIndex(0,n.length,i,!0)))},j2t.prototype.getSignatureIndex=function(e,t,i,n){n||(i?e++:e--),1===t?this.renderSignatureField(0):e<t&&0<=e?this.renderSignatureField(e):i?t<=e&&this.renderSignatureField(0):e<=0&&this.renderSignatureField(t-1)},j2t.prototype.renderSignatureField=function(e){var t,i=e,n=this.signatureFieldCollection,o=this.pdfViewer.formFieldCollections;if(i<o.length){for(var r,s=0;s<o.length;s++)if(this.pdfViewer.formDesignerModule){if(o[parseInt(i.toString(),10)].id===(r=o[parseInt(s.toString(),10)]).id){var a=0<=r.pageIndex?r.pageIndex:r.pageNumber;this.pdfViewer.annotationModule.findRenderPageList(a)||(this.pdfViewer.navigation.goToPage(a+1),this.renderFormFields(a,!1)),this.currentTarget=document.getElementById(r.id),t=r;break}}else if((this.pdfViewer.formDesignerModule?n[parseInt(i.toString(),10)].FormField:n[parseInt(i.toString(),10)]).uniqueID===(r=this.pdfViewer.formDesignerModule?n[parseInt(s.toString(),10)].FormField:n[parseInt(s.toString(),10)]).uniqueID){var a=0<=r.PageIndex?r.PageIndex:r.pageNumber;this.pdfViewer.annotationModule.findRenderPageList(a)||(this.pdfViewer.navigation.goToPage(a+1),this.renderFormFields(a,!1)),this.currentTarget=document.getElementById(r.uniqueID),t=r;break}null===this.currentTarget&&(a=0<=t.PageIndex?t.PageIndex:t.pageNumber,this.pdfViewer.navigation.goToPage(a),this.currentTarget=document.getElementById(t.uniqueID)),this.currentTarget&&("e-pdfviewer-signatureformfields-signature"!==this.currentTarget.className||this.pdfViewer.formDesignerModule?"e-pdfviewer-signatureformfields"!==this.currentTarget.className&&"e-pdfviewer-signatureformfields-signature"!==this.currentTarget.className||(this.pdfViewer.formDesignerModule?document.getElementById(this.currentTarget.id).parentElement:document.getElementById(this.currentTarget.id)).focus():(document.getElementById(this.currentTarget.id).focus(),this.pdfViewer.select([this.currentTarget.id],null)))}},j2t.prototype.formFieldCollections=function(){var e=this.pdfViewerBase.getItemFromSessionStorage("_formfields");if(e)for(var s=JSON.parse(e),a=this,t=0;t<s.length;t++)!function(e){var t,i,n,o=s[parseInt(e.toString(),10)],r=o.Name;a.pdfViewer.formDesignerModule?"ink"!==o.Name&&"SignatureImage"!==o.Name&&"SignatureText"!==o.Name?a.retreiveFormFieldsData(o,!0):0<=(n=a.pdfViewer.formFieldCollections.findIndex(function(e){return("SignatureField"===e.type||"InitialField"===e.type)&&o.FieldName&&o.FieldName.includes(e.name)&&o.FieldName.includes(e.name+"_")}))&&(t=o.Value,"ink"===o.Name&&(i=cbt(rbt(t)),t=JSON.stringify(i)),a.pdfViewer.formFieldCollections[parseInt(n.toString(),10)].value=t):"ink"!==o.Name&&(i=void 0,o.LineBounds&&(i=je(o.Bounds)?a.updateBoundsValue(o.LineBounds):o.Bounds),n={name:a.retriveFieldName(o),id:a.pdfViewer.element.id+"input_"+parseFloat(o.PageIndex)+"_"+e,isReadOnly:!1,type:o.IsInitialField?"InitialField":r,value:a.retriveCurrentValue(o),fontName:"",isRequired:o.IsRequired,bounds:i},a.pdfViewer.formFieldCollections.push(n))}(t)},j2t.prototype.retreiveFormFieldsData=function(e,t){var i,n,o,r,s,a,l,h,d,p;return""!==e.FieldName?(e.IsInitialField&&(e.Name="InitialField"),!je(o=e.Font)&&o.Height&&(p=o.Name,o.Italic&&(i="Italic"),o.Bold&&(i="Bold"),o.Strikeout&&(i="Strikethrough"),o.Underline&&(i="Underline"),n=this.ConvertPointToPixel(o.Size)),r=2===e.Alignment?"right":1===e.Alignment?"center":"left",s=e.BackColor,d=e.LineBounds,s="rgba("+s.R+","+s.G+","+s.B+",1)",s=this.rgbaToHex(s),!0===e.IsTransparent?s="rgba(0,0,0,0)":"#000000ff"===s&&(s="#daeaf7ff"),a=e.FontColor,d={left:this.ConvertPointToPixel(d.X),top:this.ConvertPointToPixel(d.Y),width:this.ConvertPointToPixel(d.Width),height:this.ConvertPointToPixel(d.Height)},a="rgba("+a.R+","+a.G+","+a.B+",1)",a=this.rgbaToHex(a),l="rgba("+(l=e.BorderColor).R+","+l.G+","+l.B+",1)",l=this.rgbaToHex(l),!0===e.IsTansparentBorderColor&&(l="rgba(0,0,0,0)"),h=e.BorderWidth,this.selectedIndex=[],d={bounds:{X:d.left,Y:d.top,Width:d.width,Height:d.height},pageNumber:parseFloat(e.PageIndex)+1,name:e.ActualFieldName,tooltip:e.ToolTip,value:e.Text,isChecked:e.Selected,isSelected:e.Selected,fontFamily:p,fontStyle:i,backgroundColor:s,color:a,borderColor:l,thickness:h,fontSize:n,isMultiline:e.Multiline,isReadOnly:e.IsReadonly,isRequired:e.IsRequired,insertSpaces:e.InsertSpaces,alignment:r,options:this.getListValues(e),selectedIndex:this.selectedIndex,maxLength:e.MaxLength,visibility:1===e.Visible?"hidden":"visible",font:{isItalic:!je(o)&&o.Italic,isBold:!je(o)&&o.Bold,isStrikeout:!je(o)&&o.Strikeout,isUnderline:!je(o)&&o.Underline},pageIndex:e.PageIndex,isTransparent:e.IsTransparent,rotationAngle:e.RotationAngle,signatureType:e.SignatureType||"",signatureIndicatorSettings:e.SignatureIndicatorSettings,zIndex:e.zIndex,customData:je(e.CustomData)?"":"object"==typeof e.CustomData?e.CustomData:""!==e.CustomData.trim()?JSON.parse(e.CustomData):""},"DropDown"!==e.Name&&"ListBox"!==e.Name||(d.value=e.SelectedValue),"RadioButton"===e.Name&&(d.value=e.Value),"SignatureField"!==(p=this.getFormFieldType(e))&&"InitialField"!==p||(this.addSignaturePath(e),this.isSignatureField&&(d.value=e.Value)),this.pdfViewer.formDesignerModule.addField(p,d,t)):null},j2t.prototype.updateBoundsValue=function(e){return{x:this.ConvertPointToPixel(e.X),y:this.ConvertPointToPixel(e.Y),width:this.ConvertPointToPixel(e.Width),height:this.ConvertPointToPixel(e.Height)}},j2t.prototype.updateFormFieldsCollection=function(e){var t,i=e.Name,n=(e.LineBounds&&(t=je(e.Bounds)?this.updateBoundsValue(e.LineBounds):e.Bounds),"DropDown"===e.Name?e.ComboBoxList:e.TextList),o={name:this.retriveFieldName(e),id:e.uniqueID,isReadOnly:e.IsReadonly,isRequired:e.IsRequired,isSelected:e.Selected,isChecked:"RadioButton"!==i&&e.Selected,type:i,value:"ListBox"===i||"DropDown"===i?e.SelectedValue:e.Value,fontName:e.FontFamily||"",pageIndex:e.PageIndex,pageNumber:e.PageIndex+1,isMultiline:e.isMultiline||e.Multiline,insertSpaces:e.insertSpaces||e.InsertSpaces,isTransparent:e.isTransparent||e.IsTransparent,rotateAngle:e.rotateAngle||e.RotationAngle,selectedIndex:e.selectedIndex||e.SelectedList,options:e.options||n||[],bounds:t,signatureType:e.signatureType||"",zIndex:e.zIndex,tooltip:e.tooltip||e.ToolTip||"",signatureIndicatorSettings:e.signatureIndicatorSettings||""};this.pdfViewer.formFieldCollections[this.pdfViewer.formFieldCollections.findIndex(function(e){return e.id===o.id})]=o},j2t.prototype.updateFormFieldValues=function(e){var t;this.readOnlyCollection.push(e.id),e&&((t=document.getElementById(e.id))&&(e.isReadOnly?(t.disabled=!0,t.style.backgroundColor="",t.style.cursor="default"):(""===t.style.backgroundColor&&(t.style.backgroundColor="rgba(0, 20, 200, 0.2)"),t.disabled=!1,t.style.cursor="")),this.updateDataInSession(t))},j2t.prototype.retriveFieldName=function(e){var t;switch(e.Name){case"Textbox":case"Password":case"SignatureField":case"InitialField":t=e.FieldName;break;case"RadioButton":case"CheckBox":t=e.GroupName;break;case"DropDown":t=e.ActualFieldName;break;case"ListBox":t=e.Text}return t},j2t.prototype.retriveCurrentValue=function(e){var t;switch(e.Name){case"Textbox":case"Password":t=e.Text;break;case"SignatureField":t=e.Value;break;case"RadioButton":case"CheckBox":t=e.Selected;break;case"DropDown":t=e.SelectedValue;break;case"ListBox":t=e.SelectedList}return t},j2t.prototype.getSignatureBounds=function(e,t,i){var n=this.pdfViewerBase.pageSize[parseInt(i.toString(),10)],o=0;switch(n.rotation){case 0:o=t;break;case 1:o={x:t.x+e.Width+t.width/3.5,y:n.width-e.X+t.height/4};break;case 2:o={x:n.width-t.x-t.width,y:n.height-t.y-t.height};break;case 3:o={x:t.y-t.width/2+t.height,y:t.x+t.width/3}}return o},j2t.prototype.downloadFormFieldsData=function(){var e=this.pdfViewerBase.getItemFromSessionStorage("_formfields");if(e){for(var t=JSON.parse(e),i={},n=[],o=0;o<t.length;o++){var r,s,a=t[parseInt(o.toString(),10)],l=a.IsRequired;if("Textbox"===a.Name||"Password"===a.Name||a.Multiline)!l||""!==a.Text&&null!==a.Text?delete this.pdfViewerBase.nonFillableFields[a.FieldName]:(this.pdfViewerBase.validateForm=!0,this.pdfViewerBase.nonFillableFields[a.FieldName]=a.Text),n={fieldValue:a.Text,isReadOnly:a.IsReadonly},i[a.FieldName]=n;else if("RadioButton"===a.Name&&a.Selected)l&&!1===a.Selected?(this.pdfViewerBase.validateForm=!0,this.pdfViewerBase.nonFillableFields[a.GroupName]=a.Value):delete this.pdfViewerBase.nonFillableFields[a.GroupName],n={fieldValue:a.Value,isReadOnly:a.IsReadonly},i[a.GroupName]=n;else if("CheckBox"===a.Name){l&&!1===a.Selected?(this.pdfViewerBase.validateForm=!0,this.pdfViewerBase.nonFillableFields[a.GroupName]=a.Selected):delete this.pdfViewerBase.nonFillableFields[a.GroupName];var h=a.CheckBoxIndex||a.CheckboxIndex||null;h&&a.Selected?(n={isSelected:h,isReadOnly:a.IsReadonly,fieldValue:je(a.Value)?"":a.Value},i[a.GroupName]=n):void 0!==i[a.GroupName]&&null!==i[a.GroupName]||(n={isSelected:a.Selected,isReadOnly:a.IsReadonly,fieldValue:a.Value},i[a.GroupName]=n)}else if("DropDown"===a.Name)l&&""===a.SelectedValue?(this.pdfViewerBase.validateForm=!0,this.pdfViewerBase.nonFillableFields[a.Text]=a.SelectedValue):delete this.pdfViewerBase.nonFillableFields[a.Text],n={fieldValue:a.SelectedValue,isReadOnly:a.IsReadonly},i[a.FieldName]=n;else if("ListBox"===a.Name){for(var d=a.TextList,p=[],c=0;c<a.SelectedList.length;c++){var u=a.SelectedList[parseInt(c.toString(),10)];p.push(d[""+u])}n={fieldValue:JSON.stringify(p),isReadOnly:a.IsReadonly},i[a.Text]=n}else"SignatureField"!==a.Name&&"InitialField"!==a.Name||(h=void 0,!l||null!==a.Value&&""!==a.Value||this.addSignaturePath(a),a.Value&&""!==a.Value&&(h=a.Value,(r=a.fontFamily||a.FontFamily)?(i[a.FieldName+"fontName"]=r,i[a.FieldName+"fontSize"]=a.fontSize||a.FontSize):a.Value.split("base64,")[1]?i[a.FieldName+"ImageData"]=!0:h=cbt(rbt(a.Value))),!l||null!==a.Value&&""!==a.Value?delete this.pdfViewerBase.nonFillableFields[a.FieldName]:(this.pdfViewerBase.validateForm=!0,this.pdfViewerBase.nonFillableFields[a.FieldName]=JSON.stringify(h)),i[a.FieldName]=JSON.stringify(h),a.Bounds?(s=this.getSignatureBounds(a.LineBounds,a.Bounds,a.PageIndex),a.Bounds.x=s.x,a.Bounds.y=s.y,i[a.FieldName+"bounds"]=JSON.stringify(a.Bounds)):(r=a.LineBounds,s={x:this.ConvertPointToPixel(r.X),y:this.ConvertPointToPixel(r.Y),width:this.ConvertPointToPixel(r.Width),height:this.ConvertPointToPixel(r.Height)},i[a.FieldName+"bounds"]=JSON.stringify(s)),i[a.FieldName+"isReadOnly"]=a.IsReadonly)}return JSON.stringify(i)}},j2t.prototype.focusFormFields=function(e){var t,i,e=e.target;e&&"e-pdfviewer-signatureformfields"!==e.className&&"e-pdfviewer-signatureformfields e-pv-signature-focus"!==e.className?(t=(i=e.style.backgroundColor).lastIndexOf(","),i=i.slice(0,t+1)+0+")",e.style.backgroundColor=i,"checkbox"===e.type&&(e.style.webkitAppearance=""),e.style.boxShadow="0 0 5px "+("transparent"===e.style.borderColor?"#000000":e.style.borderColor)):!e||"e-pdfviewer-signatureformfields"!==e.className&&"e-pdfviewer-signatureformfields-signature"!==e.className&&"e-pdfviewer-signatureformfields e-pv-signature-focus"!==e.className&&"e-pdfviewer-signatureformfields-signature  e-pv-signature-focus"!==e.className||this.pdfViewerBase.signatureModule.setFocus(e.id)},j2t.prototype.blurFormFields=function(e){var e=e.target,t=(e.InsertSpaces&&this.isKeyDownCheck&&(t=parseInt(e.style.width,10)-parseInt(e.style.height,10)/2,e.style.width=t+"px",this.isKeyDownCheck=!1),"checkbox"===e.type?this.pdfViewer.fireFocusOutFormField(e.name,e.checked):this.pdfViewer.fireFocusOutFormField(e.name,e.value),e.style.backgroundColor),i=t.lastIndexOf(","),t=t.slice(0,i+1)+.2+")";e.style.backgroundColor=t,e.style.boxShadow="none","checkbox"!==e.type||e.checked?e.style.webkitAppearance="":e.style.webkitAppearance="none"},j2t.prototype.updateFormFields=function(e){var t=e.target;this.pdfViewerBase.isDeviceiOS&&"checkbox"===t.type&&t.focus(),"e-pdfviewer-ListBox"===t.className?(t=t.parentElement,this.updateDataInSession(t)):"e-pdfviewer-signatureformfields"===t.className||"e-pdfviewer-signatureformfields e-pv-signature-focus"===t.className?this.currentTarget=t:"e-pv-buttonItem"!==t.className&&"button"!==t.type||this.pdfViewer.fireButtonFieldClickEvent(t.value,t.name,t.id);for(var i=0;i<this.pdfViewer.formFieldCollections.length;i++)t.id===this.pdfViewer.formFieldCollections[parseInt(i.toString(),10)].id&&((this.pdfViewer.formDesignerModule||this.pdfViewer.annotationModule)&&this.pdfViewer.fireFormFieldClickEvent("formFieldClicked",this.pdfViewer.formFieldCollections[parseInt(i.toString(),10)]),"e-pdfviewer-signatureformfields"!==t.className&&"e-pdfviewer-signatureformfields-signature"!==t.className&&"e-pdfviewer-signatureformfields e-pv-signature-focus"!==t.className&&"e-pdfviewer-signatureformfields-signature  e-pv-signature-focus"!==t.className||this.pdfViewerBase.signatureModule.setFocus(t.id))},j2t.prototype.drawSignature=function(b,w,C,S,A){for(var x,I,T,E,D=this,e=this.pdfViewer.formDesigner?this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"):this.pdfViewerBase.getItemFromSessionStorage("_formfields"),M=JSON.parse(e),k=this.pdfViewer.formDesignerModule&&this.currentTarget&&this.currentTarget.offsetParent?this.currentTarget.offsetParent.name:this.currentTarget?this.currentTarget.name:C.name||C.offsetParent.name,P=this,t=0;t<M.length;t++)!function(e){var t,i,n,o,r,s,a,l,h,d,p,c,u,g,m,f,y,v=P.pdfViewer.formDesigner?M[parseInt(e.toString(),10)].FormField.name:M[parseInt(e.toString(),10)].FieldName;(P.pdfViewer.formDesigner?v!==k:v!==k||je(M[parseInt(e.toString(),10)].ActualFieldName))||(t=C=P.pdfViewer.formDesigner?document.getElementById(M[parseInt(e.toString(),10)].Key.split("_")[0]):document.getElementById(M[parseInt(e.toString(),10)].uniqueID),P.pdfViewer.annotations.filter(function(e){je(t)||(e.id,C.id)}),je(t))||(v=t.offsetParent.offsetParent.id.split("_")[0],i=P.pdfViewer.nameTable[""+v],C&&C.offsetParent&&i&&(T=C.getBoundingClientRect(),E=C.offsetParent.offsetParent.offsetParent.getBoundingClientRect(),P.pdfViewerBase.drawSignatureWithTool=!0,C.nextSibling)&&-1!==C.nextSibling.id.indexOf("initial")&&(P.pdfViewer.isInitialFieldToolbarSelection=!0),n=w||P.pdfViewerBase.signatureModule.outputString,"Path"!==b||P.pdfViewer.drawing.isPasted||w&&""===P.pdfViewerBase.signatureModule.outputString&&(n=ubt(cbt(JSON.parse(n)))),e=S||P.pdfViewerBase.signatureModule.fontName,v=P.pdfViewerBase.getZoomFactor(),o=P.pdfViewerBase.drawSignatureWithTool?T.width/v:parseFloat(t.style.width)/v,r=P.pdfViewerBase.drawSignatureWithTool?T.height/v:parseFloat(t.style.height)/v,s=P.pdfViewerBase.drawSignatureWithTool?(T.left-E.left)/v:parseFloat(t.style.left)/v,a=P.pdfViewerBase.drawSignatureWithTool?(T.top-E.top)/v:parseFloat(t.style.top)/v,l=P.pdfViewerBase.drawSignatureWithTool&&C.nextElementSibling?parseFloat(C.nextElementSibling.id.split("_")[1]):parseFloat(t.id.split("_")[1]),y=P.pdfViewerBase.drawSignatureWithTool&&C.nextElementSibling?parseFloat(C.nextElementSibling.id.split("_")[2]):parseFloat(t.id.split("_")[2]),h=P.pdfViewerBase.signatureModule.saveImageString,f=t.offsetParent.offsetParent.style.transform||t.style.transform,c=(f=f.substring(f.indexOf("(")+1,f.indexOf("d")))?parseInt(f,10):0,"Type"===b||"Text"===b?(e=e||"Helvetica",I=P.getSignBounds(y,c,l,v,s,a,o,r),"Default"===P.pdfViewer.signatureFitMode&&(I=P.getDefaultBoundsforSign(I)),"SignatureText"===(x={id:t.id,bounds:{x:I.x,y:I.y,width:I.width,height:I.height},pageIndex:l,data:n,modifiedDate:"",shapeAnnotationType:"SignatureText",opacity:1,rotateAngle:c,annotName:"SignatureText",comments:[],review:{state:"",stateModel:"",modifiedDate:"",author:""},fontFamily:e,fontSize:I.height/P.signatureFontSizeConstent}).shapeAnnotationType&&(f=1,(e=P.getTextWidth(x.data,x.fontSize,x.fontFamily))>I.width&&(f=I.width/e),x.fontSize=P.getFontSize(Math.floor(x.fontSize*f))),h=x.data,d=x.fontFamily,p=x.fontSize):"Image"===b?(I=P.getSignBounds(y,c,l,v,s,a,o,r),u=Object.freeze(I),g=new Image,m=C,g.src=n,g.onload=function(){var e=Object.isFrozen(u)?H2t({},u):u;D.imageOnLoad(e,g,n,l,c,t,i,h,d,p,m)}):-1!==n.indexOf("base64")?(I=P.getSignBounds(y,c,l,v,s,a,o,r),"Default"===P.pdfViewer.signatureFitMode&&(I=P.getDefaultBoundsforSign(I)),x={id:t.id,bounds:{x:I.x,y:I.y,width:I.width,height:I.height},pageIndex:l,data:n,modifiedDate:"",shapeAnnotationType:"SignatureImage",opacity:1,rotateAngle:c,annotName:"SignatureField",comments:[],review:{state:"",stateModel:"",modifiedDate:"",author:""}},h=x.data):(je(A)?"Default"===P.pdfViewer.signatureFitMode?(e=P.pdfViewerBase.signatureModule.updateSignatureAspectRatio(n,!1,t),(I=P.getSignBounds(y,c,l,v,s,a,e.width,e.height,!0)).x=I.x+e.left,I.y=I.y+e.top):I=P.getSignBounds(y,c,l,v,s,a,o,r):I=A,x={id:t.id,bounds:{x:I.x,y:I.y,width:I.width,height:I.height},pageIndex:l,data:n,modifiedDate:"",shapeAnnotationType:"Path",opacity:1,rotateAngle:c,annotName:"SignatureField",comments:[],review:{state:"",stateModel:"",modifiedDate:"",author:""}}),P.pdfViewerBase.drawSignatureWithTool&&i&&"Image"!==b?(x.id=i.id+"_content",f=P.pdfViewer.add(x),i.wrapper.children[1]&&f.wrapper.id===i.wrapper.children[1].id&&!je(i.wrapper.children[1])&&"Point"===i.wrapper.children[1].relativeMode&&i.wrapper.children.splice(1,1),i.wrapper.children.push(f.wrapper)):"Image"!==b&&P.pdfViewer.add(x),x&&"Path"===x.shapeAnnotationType&&""!==n&&(P.pdfViewerBase.currentSignatureAnnot=x,P.pdfViewerBase.signatureModule.addSignatureCollection(I,{currentHeight:r,currentWidth:o,currentLeft:s,currentTop:a}),h=P.pdfViewerBase.signatureModule.saveImageString,P.pdfViewerBase.currentSignatureAnnot=null),"Image"!==b&&(e=P.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",l),P.pdfViewer.renderDrawing(e,l),P.pdfViewerBase.signatureModule.showSignatureDialog(!1),"e-pdfviewer-signatureformfields e-pv-signature-focus"===t.className?t.className="e-pdfviewer-signatureformfields-signature e-pv-signature-focus":t.className="e-pdfviewer-signatureformfields-signature",P.pdfViewerBase.drawSignatureWithTool&&i?(y=C.offsetParent.offsetParent.id.split("_")[0]+"_content",x.bounds={x:I.x*v,y:I.y*v,width:I.width*v,height:I.height*v},P.updateSignatureDataInSession(x,y)):P.updateDataInSession(t,x.data,x.bounds,d,p),t.style.pointerEvents="none",P.pdfViewer.annotation&&P.pdfViewer.annotation.addAction(x.pageIndex,null,x,"FormField Value Change","",x,x),"Path"!==x.shapeAnnotationType&&"SignatureText"!==x.shapeAnnotationType||P.pdfViewer.fireSignatureAdd(x.pageIndex,x.id,x.shapeAnnotationType,x.bounds,x.opacity,null,null,h),P.pdfViewer.fireFocusOutFormField(t.name,n)))}(t);"Image"!==b&&(this.pdfViewerBase.signatureModule.hideSignaturePanel(),this.pdfViewerBase.drawSignatureWithTool=!1,this.pdfViewer.isInitialFieldToolbarSelection=!1)},j2t.prototype.imageOnLoad=function(e,t,i,n,o,r,s,a,l,h,d){d&&d.offsetParent&&s&&(this.pdfViewerBase.drawSignatureWithTool=!0,d.nextSibling)&&-1!==d.nextSibling.id.indexOf("initial")&&(this.pdfViewer.isInitialFieldToolbarSelection=!0),"Default"===this.pdfViewer.signatureFitMode&&(u=Math.min(e.height/this.paddingDifferenceValue,e.width/this.paddingDifferenceValue),m=e.height-u,u=e.width-u,c=t.width,t=t.height,g=e.width,p=e.height,u=Math.min(u/c,m/t),e.width=c*u,e.height=t*u,e.x=e.x+(g-e.width)/2,e.y=e.y+(p-e.height)/2);var p,c,u,g,m={id:r.id,bounds:{x:e.x,y:e.y,width:e.width,height:e.height},pageIndex:n,data:i,modifiedDate:"",shapeAnnotationType:"SignatureImage",opacity:1,rotateAngle:o,annotName:"SignatureField",comments:[],review:{state:"",stateModel:"",modifiedDate:"",author:""}},t=(a=m.data,this.pdfViewerBase.drawSignatureWithTool&&s?(m.id=s.id+"_content",c=this.pdfViewer.add(m),s.wrapper.children[1]&&c.wrapper.id===s.wrapper.children[1].id&&!je(s.wrapper.children[1])&&"Point"===s.wrapper.children[1].relativeMode&&s.wrapper.children.splice(1,1),s.wrapper.children.push(c.wrapper)):this.pdfViewer.add(m),this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",n));this.pdfViewer.renderDrawing(t,n),this.pdfViewerBase.signatureModule.showSignatureDialog(!1),"e-pdfviewer-signatureformfields e-pv-signature-focus"===r.className?r.className="e-pdfviewer-signatureformfields-signature e-pv-signature-focus":r.className="e-pdfviewer-signatureformfields-signature",this.pdfViewerBase.drawSignatureWithTool&&s?(u=this.pdfViewerBase.getZoomFactor(),g=d.offsetParent.offsetParent.id.split("_")[0]+"_content",m.bounds={x:e.x*u,y:e.y*u,width:e.width*u,height:e.height*u},this.updateSignatureDataInSession(m,g)):this.updateDataInSession(r,m.data,m.bounds,l,h),r.style.pointerEvents="none",this.pdfViewer.annotation&&this.pdfViewer.annotation.addAction(m.pageIndex,null,m,"FormField Value Change","",m,m),"SignatureImage"===m.shapeAnnotationType&&this.pdfViewer.fireSignatureAdd(m.pageIndex,m.id,m.shapeAnnotationType,m.bounds,m.opacity,null,null,a),this.pdfViewer.fireFocusOutFormField(r.name,i),this.pdfViewerBase.signatureModule.hideSignaturePanel(),this.pdfViewerBase.drawSignatureWithTool=!1,this.pdfViewer.isInitialFieldToolbarSelection=!1},j2t.prototype.updateSignatureDataInSession=function(n,o){var e=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),r=JSON.parse(e);if(!je(r))for(var s=this,t=0;t<r.length;t++)!function(t){var e,i;r[parseInt(t.toString(),10)].Key===o&&(e=s.pdfViewer.formFieldCollection.findIndex(function(e){return e.id===r[parseInt(t.toString(),10)].FormField.id.split("_")[0]}),"SignatureText"===n.shapeAnnotationType?(r[parseInt(t.toString(),10)].FormField.signatureType="Text",s.pdfViewer.nameTable[(""+o).split("_")[0]].signatureType="Text",s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.signatureType="Text",s.pdfViewer.nameTable[""+o].signatureType="Text",r[parseInt(t.toString(),10)].FormField.fontFamily="TimesRoman"===n.fontFamily?"Times New Roman":n.fontFamily,s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.fontFamily=n.fontFamily,s.pdfViewer.nameTable[""+o].fontFamily=n.fontFamily,s.pdfViewer.nameTable[(""+o).split("_")[0]].fontFamily=n.fontFamily,r[parseInt(t.toString(),10)].FormField.fontSize=n.fontSize,s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.fontSize=n.fontSize,s.pdfViewer.nameTable[""+o].fontSize=n.fontSize,s.pdfViewer.nameTable[(""+o).split("_")[0]].fontSize=n.fontSize,-1<e&&(s.pdfViewer.formFieldCollection[parseInt(e.toString(),10)].signatureType="Text")):"SignatureImage"===n.shapeAnnotationType?(r[parseInt(t.toString(),10)].FormField.signatureType="Image",s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.signatureType="Image",s.pdfViewer.nameTable[""+o].signatureType="Image",-1<e&&(s.pdfViewer.formFieldCollection[parseInt(e.toString(),10)].signatureType="Image")):(r[parseInt(t.toString(),10)].FormField.signatureType="Path",s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.signatureType="Path",s.pdfViewer.nameTable[""+o].signatureType="Path",-1<e&&(s.pdfViewer.formFieldCollection[parseInt(e.toString(),10)].signatureType="Path")),r[parseInt(t.toString(),10)].FormField.signatureBound=n.bounds,s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.signatureBound=n.bounds,s.pdfViewer.nameTable[""+o].signatureBound=n.bounds,-1<e&&(s.pdfViewer.formFieldCollection[parseInt(e.toString(),10)].signatureBound=n.bounds),"Path"===n.shapeAnnotationType?(i=cbt(rbt(n.data)),r[parseInt(t.toString(),10)].FormField.value=JSON.stringify(i),s.pdfViewer.nameTable[""+o].value=n.data,s.pdfViewer.nameTable[o.split("_")[0]].value=n.data,s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.value=JSON.stringify(i),-1<e&&(s.pdfViewer.formFieldCollection[parseInt(e.toString(),10)].value=JSON.stringify(i))):(r[parseInt(t.toString(),10)].FormField.value=n.data,s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.value=n.data,s.pdfViewer.nameTable[o.split("_")[0]].value=n.data,s.pdfViewer.nameTable[""+o].value=n.data,-1<e&&(s.pdfViewer.formFieldCollection[parseInt(e.toString(),10)].value=n.data)),s.pdfViewer.formDesigner.updateFormFieldCollections(r[parseInt(t.toString(),10)].FormField),s.pdfViewer.formDesigner.updateFormFieldPropertiesChanges("formFieldPropertiesChange",r[parseInt(t.toString(),10)].FormField,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,"",r[parseInt(t.toString(),10)].FormField.value)),r[parseInt(t.toString(),10)].Key===n.id&&(r[parseInt(t.toString(),10)].FormField.signatureBound=n.bounds)}(t);this.pdfViewerBase.setItemInSessionStorage(r,"_formDesigner")},j2t.prototype.getDefaultBoundsforSign=function(e){return{x:e.x+4,y:e.y+4,width:e.width-8,height:e.height-8}},j2t.prototype.getSignBounds=function(e,t,i,n,o,r,s,a,l){var h=this.pdfViewer.isInitialFieldToolbarSelection?"initialIcon":"signIcon",h=document.getElementById(h+"_"+i+"_"+e),i=o*n-(h?parseFloat(h.style.left)*n:0)/n;return 90===t||270===t?(this.rotateAngle=0,""!==h.style.left?l?{x:o-i/n-n,y:r+i/n+n,width:s,height:a}:{x:o-i/n-n,y:r+i/n+n,width:a,height:s}:l?{x:o-s,y:r+s,width:a,height:s}:{x:o-s-5,y:r+s+10,width:a,height:s}):(this.rotateAngle=0,{x:o,y:r,width:s,height:a})},j2t.prototype.updateSameFieldsValue=function(e){if(this.formFieldsData)for(var t=0;t<this.formFieldsData.length;t++){var i,n=this.formFieldsData[parseInt(t.toString(),10)];e.target.name===n.FieldName&&e.target.id!==n.uniqueID&&((i=document.getElementById(this.formFieldsData[parseInt(t.toString(),10)].uniqueID))?i.value=e.target.value:(n.Text=e.target.value,this.updateDataInSession(n,null,null,null,null,!0)))}},j2t.prototype.updateFormFieldsValue=function(e){var t,i=e.target;if(i.InsertSpaces&&!this.isKeyDownCheck&&(s=parseInt(i.style.width,10)+parseInt(i.style.height,10)/2,i.style.width=s+"px",this.isKeyDownCheck=!0),9===e.which&&i&&("e-pdfviewer-formFields"===i.className||"e-pdfviewer-signatureformfields e-pv-signature-focus"===i.className||"e-pdfviewer-signatureformfields-signature"===i.className)){var n=i.id.split("input_")[1].split("_")[0],o=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+parseInt(n,10)).getElementsByClassName("e-pdfviewer-formFields"),r=!0,s=this.pdfViewer.formFieldCollections.findIndex(function(e){return e.id===i.id});e.shiftKey||"Tab"!==e.key||(t=s+1<this.pdfViewer.formFieldCollections.length?this.pdfViewer.formFieldCollections[s+1]:this.pdfViewer.formFieldCollections[0]),this.pdfViewer.focusFormField(t),r=!0,e.preventDefault();for(var a=i.tabIndex+1;!r;){for(var l=0;l<o.length;l++)if(r=!1,o[parseInt(l.toString(),10)].tabIndex===a){o[parseInt(l.toString(),10)].focus(),r=!0,e.preventDefault();break}this.maintainTabIndex[""+n]===a&&(r=!0),a+=1}}if(e.shiftKey&&"Tab"===e.key&&(t=0<(s=this.pdfViewer.formFieldCollections.findIndex(function(e){return e.id===i.id}))?this.pdfViewer.formFieldCollections[s-1]:this.pdfViewer.formFieldCollections[this.pdfViewer.formFieldCollections.length-1],this.pdfViewer.focusFormField(t),e.preventDefault()),e.currentTarget.classList.contains("e-pdfviewer-signatureformfields")||e.currentTarget.classList.contains("e-pdfviewer-signatureformfields-signature"))if("Enter"===e.key)for(var h=e.target,d=0;d<this.pdfViewer.formFieldCollections.length;d++)h.id===this.pdfViewer.formFieldCollections[parseInt(d.toString(),10)].id&&(this.pdfViewerBase.signatureModule.setFocus(h.id),this.pdfViewer.fireFormFieldClickEvent("formFieldClicked",this.pdfViewer.formFieldCollections[parseInt(d.toString(),10)]));else e.preventDefault()},j2t.prototype.changeFormFields=function(e){e=e.target;this.updateDataInSession(e)},j2t.prototype.updateDataInSession=function(t,e,i,n,o,r){void 0===r&&(r=!1),this.pdfViewerBase.updateDocumentEditedProperty(!0);var s,a=" ",l=0,h=this.pdfViewerBase.getItemFromSessionStorage("_formfields");if(h&&!this.pdfViewer.formDesignerModule){var d=JSON.parse(h);0<(h=d.filter(function(e){return e.uniqueID===t.id})).length&&(a=h[0].FieldName,l=d.filter(function(e){return e.FieldName===a}).length);for(var p=0;p<d.length;p++){var c=d[parseInt(p.toString(),10)];if(c.uniqueID===t.id||a===c.FieldName){if(t&&"text"===t.type||"password"===t.type||"textarea"===t.type){var u,g,m,f,y=t;y.classList.contains("e-pdfviewer-signatureformfields")||y.classList.contains("e-pdfviewer-signatureformfields-signature")?(e&&(c.Value=e),i&&(je(c.uniqueID)||a!==c.FieldName||t.id!==c.uniqueID?(y=this.ConvertPointToPixel(c.LineBounds.Width),u=this.ConvertPointToPixel(c.LineBounds.Height),M=this.ConvertPointToPixel(c.LineBounds.X),g=this.ConvertPointToPixel(c.LineBounds.Y),m=i.height,f=i.width,c.Bounds={x:M+(y-f)/2,y:g+(u-m)/2,height:m,width:f}):c.Bounds=i),n&&(c.FontFamily=n,c.FontSize=o)):(c.Text=t.value,c.Value=t.value,c.Multiline=t.multiline)}else if("radio"===t.type){if(c.uniqueID===t.id){for(var v=t.id,b=d.filter(function(e){return e.GroupName===t.name&&"RadioButton"===e.Name}),w=0;w<b.length;w++)(C=b[parseInt(w.toString(),10)]).uniqueID!==v&&(C.Selected=!1),(S=document.getElementById(C.uniqueID))&&v!==S.id&&(S.Selected=!1);if(""!==c.Value&&c.Value===t.value||(c.Value=t.value),t.value===c.Value||t.id===c.uniqueID){c.Selected=!0;break}c.Selected=!1}}else if("checkbox"===t.type){for(var C,S,A=t.id,x=d.filter(function(e){return e.GroupName===t.name&&"CheckBox"===e.Name}),w=0;w<x.length;w++)(C=x[parseInt(w.toString(),10)]).uniqueID!==A&&(C.Selected=!1,C.checked=!1),(S=document.getElementById(C.uniqueID))&&A!==S.id&&(S.Selected=!1,S.checked=!1,S.style.webkitAppearance="none");t.checked&&t.id===c.uniqueID?c.Selected=!0:c.Selected=!1,""===c.Value&&(c.Value=t.value)}else if("select-one"===t.type&&0===t.size){t.selectedIndex<0&&(t.selectedIndex=c.selectedIndex);for(var I=t.options[t.selectedIndex].text,T=t.children,E=0;E<T.length;E++)T[parseInt(E.toString(),10)].text===I&&(c.SelectedValue=I,c.selectedIndex=t.selectedIndex)}else if("select-multiple"===t.type||0<t.size){I=t.selectedOptions;c.SelectedList=[];for(var D=0;D<I.length;D++)for(T=t.children,E=0;E<T.length;E++)T[parseInt(E.toString(),10)]===I[parseInt(D.toString(),10)]&&c.SelectedList.push(E);c.SelectedValue=t.value;var M=c.TextList?c.TextList.indexOf(t.value):0;c.selectedIndex=-1<M?M:0,c.SelectedList=[c.selectedIndex]}if(t.disabled&&(c.IsReadonly=!0),c.IsRequired=t.Required||t.required||!1,c.ToolTip=t.tooltip||"",this.updateFormFieldsCollection(c),0===--l)break}else r?c.SelectedValue=t.Text:t&&null!=t.getAttribute("list")&&"text"===t.type&&c.uniqueID===t.list.id&&(c.SelectedValue=t.value);this.updateFormFieldsCollection(c)}ARt.sessionStorageManager.removeItem(this.pdfViewerBase.documentId+"_formfields"),this.pdfViewerBase.setItemInSessionStorage(d,"_formfields")}this.pdfViewer.formDesignerModule&&t&&t.id&&(h=this.pdfViewer.nameTable[t.id.split("_")[0]])&&h.wrapper&&h.wrapper.children[0]&&(h.value=t.value,s=Pvt(h.wrapper.children[0]).topLeft,this.pdfViewer.formDesignerModule.updateFormDesignerFieldInSessionStorage(s,h.wrapper.children[0],h.formFieldAnnotationType,h))},j2t.prototype.removeExistingFormFields=function(){var e=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),t=je(e)?null:JSON.parse(e);if(t)for(var i=0;i<t.length;i++){if("RadioButton"===t[parseInt(i.toString(),10)].FormField.formFieldAnnotationType)for(var n=t[parseInt(i.toString(),10)].FormField.radiobuttonItem,o=t[parseInt(i.toString(),10)].FormField.id.split("_")[0],r=0;r<n.length;r++){var s=n[parseInt(r.toString(),10)];s.id.split("_")[0]!==o&&this.pdfViewer.formDesignerModule.deleteFormField(s.id.split("_")[0])}t[parseInt(i.toString(),10)].Key&&this.pdfViewer.formDesignerModule.deleteFormField(t[parseInt(i.toString(),10)].Key.split("_")[0])}},j2t.prototype.applyCommonProperties=function(e,t,i,n,o){var r,s=document.getElementById(this.pdfViewer.element.id+"input_"+t+"_"+i),a=(s&&(a=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+t),"text"===e.type&&s.parentElement!==a&&s.parentElement.remove(),"e-pdfviewer-signatureformfields e-pv-signature-focus"!==s.className)&&s.remove(),document.getElementById("signIcon_"+t+"_"+i)),s=parseFloat(e.style.left),l=parseInt(e.style.top,10),h=(parseFloat(e.style.width),parseFloat(e.style.height)),d=this.pdfViewerBase.getZoomFactor();a&&!o&&(o=parseFloat(a.style.width),parseFloat(a.style.height),"rotate(90deg)"===a.style.transform&&(a.style.transform="rotate(0deg)",a.style.left=s-(h/2-(r=o*d))+r/2+"px"),"rotate(180deg)"===a.style.transform&&(a.style.transform="rotate(0deg)",a.style.left=s+"px",a.style.top=l+"px"),"rotate(270deg)"===a.style.transform)&&(a.style.transform="rotate(0deg)",a.style.left=s-(h/2-(r=o*d))+r/2+"px",a.style.top=l+"px"),n.IsSignatureField&&this.isSignatureField?(e.className="e-pdfviewer-signatureformfields-signature",e.style.pointerEvents="none"):n.IsSignatureField?n.Value?(e.className="e-pdfviewer-signatureformfields-signature",e.style.pointerEvents="none"):e.className="e-pdfviewer-signatureformfields":"Button"!==n.Name&&(e.className="e-pdfviewer-formFields"),e.id=this.pdfViewer.element.id+"input_"+t+"_"+i,e.ariaLabel=this.pdfViewer.element.id+"input_"+t,e.style.zIndex=1e3},j2t.prototype.createFormFields=function(e,t,i,n,o){switch(e.Name){case"Textbox":r=this.createTextBoxField(e,t,"text");break;case"Password":r=this.createTextBoxField(e,t,"password");break;case"RadioButton":r=this.createRadioBoxField(e,t,"radio");break;case"CheckBox":r=this.createRadioBoxField(e,t,"checkbox",n);break;case"DropDown":r=this.createDropDownField(e,t,i,n);break;case"ListBox":r=this.createListBoxField(e,t);break;case"InitialField":case"SignatureField":var r=this.createSignatureField(e,t,i,n,o),s=!1;0===e.Rotation&&(s=!0),e.Value&&""!==e.Value&&(this.renderExistingAnnnot(e,i,n,s),this.isSignatureRendered=!0,o++);break;case"Button":r=this.createButtonField(e,t);break;case"ink":this.pdfViewer.formDesignerModule&&e.Value&&""!==e.Value&&!this.isSignatureRendered&&this.renderExistingAnnnot(e,i,n);break;case"SignatureText":case"SignatureImage":e.Value&&""!==e.Value&&!this.isSignatureRendered&&this.renderExistingAnnnot(e,i,n)}return{currentField:r,count:o}},j2t.prototype.getFormFieldType=function(e){var t;switch(e.Name){case"Textbox":t="Textbox";break;case"Password":t="Password";break;case"RadioButton":t="RadioButton";break;case"CheckBox":t="CheckBox";break;case"DropDown":t="DropDown";break;case"ListBox":t="ListBox";break;case"SignatureField":t="SignatureField",e.IsInitialField&&(t="InitialField");break;case"InitialField":t="InitialField"}return t},j2t.prototype.createButtonField=function(e,t){var i=document.createElement("input");return e.Value&&(this.isBase64(e.Value)||this.isURL(e.Value))?(i.type="image",i.src=e.Value):i.type="button",i.className="e-pv-buttonItem",""!==e.Text?i.value=e.Text:i.value="",i.name=e.FieldName,i},j2t.prototype.isBase64=function(e){return/^data:([a-zA-Z]*\/[a-zA-Z+.-]*);base64,/.test(e)},j2t.prototype.isURL=function(e){try{return new URL(e),!0}catch(e){return!1}},j2t.prototype.createTextBoxField=function(e,t,i){var n;if(1!==e.Visible)return e.Multiline?(n=document.createElement("textarea")).style.resize="none":(n=document.createElement("input")).type=i,0<e.MaxLength&&(n.maxLength=e.MaxLength),this.addAlignmentPropety(e,n),""!==e.Text?n.value=e.Text:n.value="",this.pdfViewer.enableAutoComplete||(n.autocomplete="off"),n.name=e.FieldName,n},j2t.prototype.checkIsReadonly=function(e,t){for(var i,n,o=!1,r=0;r<this.readOnlyCollection.length;r++)if(t.id===this.readOnlyCollection[parseInt(r.toString(),10)]){o=!0;break}this.pdfViewer.formDesignerModule||this.pdfViewer.annotationModule||!e.IsInitialField&&!e.IsSignatureField||(o=!0),e.IsReadonly||!this.pdfViewer.enableFormFields||o?(t.disabled=!0,t.style.cursor="default",t.style.backgroundColor="transparent"):(i=e.BackColor,"Button"!==e.Name?t.style.backgroundColor="rgba("+i.R+","+i.G+","+i.B+",0.2)":(n=e.Opacity,t.style.backgroundColor=n?"rgba("+i.R+","+i.G+","+i.B+","+n+")":"rgb("+i.R+","+i.G+","+i.B+")"),n=e.FontColor,t.style.color="rgba("+n.R+","+n.G+","+n.B+",1)")},j2t.prototype.formFieldsReadOnly=function(e){var t=document.getElementsByClassName("e-pdfviewer-formFields"),t=(this.makeformFieldsReadonly(t,e),document.getElementsByClassName("e-pdfviewer-signatureformfields"));this.makeformFieldsReadonly(t,e)},j2t.prototype.makeformFieldsReadonly=function(e,t){for(var i,n=0;n<e.length;n++)e[parseInt(n.toString(),10)]&&(i=e[parseInt(n.toString(),10)],t?i.disabled=!1:(i.disabled=!0,i.style.cursor="default"))},j2t.prototype.applyTabIndex=function(e,t,i){t.tabIndex=e.TabIndex,this.maxTabIndex=Math.max(this.maxTabIndex,t.tabIndex),-1===this.minTabIndex&&(this.minTabIndex=t.tabIndex),this.minTabIndex=Math.min(this.minTabIndex,t.tabIndex),this.maintainTabIndex[i.toString()]=this.maxTabIndex,this.maintanMinTabindex[i.toString()]=this.minTabIndex},j2t.prototype.checkIsRequiredField=function(e,t){var i;e.IsRequired?(t.required=!0,t.style.border="1px solid red"):(i=e.BorderColor,t.style.border=e.BorderWidth,t.style.borderColor="rgba("+i.R+","+i.G+","+i.B+",1)"),"checkbox"!==t.type&&"radio"!==t.type&&(i=e.BorderStyle,this.addBorderStylePropety(i,t))},j2t.prototype.applyDefaultColor=function(e){("button"===e.type||"rgba(255, 255, 255, 0.2)"!==e.style.backgroundColor&&"rgba(0, 0, 0, 0.2)"!==e.style.backgroundColor)&&"rgba(218, 234, 247, 0.2)"!==e.style.backgroundColor||(e.style.backgroundColor="rgba(0, 20, 200, 0.2)"),"rgba(255, 255, 255, 0.2)"===e.style.color&&(e.style.color="black")},j2t.prototype.addAlignmentPropety=function(e,t){switch(e.Alignment){case 0:t.style.textAlign="left";break;case 1:t.style.textAlign="center";break;case 2:t.style.textAlign="right";break;case 3:t.style.textAlign="justify"}},j2t.prototype.addBorderStylePropety=function(e,t){switch(e){case 0:t.style.borderStyle="solid";break;case 1:t.style.borderStyle="dashed";break;case 2:t.style.borderStyle="outset";break;case 3:t.style.borderStyle="inset";break;case 4:t.style.borderStyle="outset";break;case 5:t.style.borderStyle="dotted";break;case 6:t.style.borderStyle="inset"}},j2t.prototype.createRadioBoxField=function(e,t,i,n){var o=document.createElement("input");return o.type=i,e.Selected?o.checked=!0:"checkbox"!==i||n||(o.style.webkitAppearance="none"),o.name=e.GroupName,o.value=e.Value,o},j2t.prototype.createDropDownField=function(e,t,i,n){var o,r,s=document.createElement("select"),a="DropDown"===e.Name?e.ComboBoxList:e.TextList;e.Selected&&!n&&((o=document.getElementById("editableDropdown"+t+"_"+i))&&o.remove(),(o=document.createElement("input")).id="editableDropdown"+t+"_"+i,o.setAttribute("list",this.pdfViewer.element.id+"input_"+t+"_"+i),i=e.LineBounds,r=e.Font,o.style.position="absolute",o.style.border="0px",this.applyPosition(o,i,r,t,e.Rotation),o.style.backgroundColor="rgba(0, 20, 200, 0.2)",o.className="e-pdfviewer-formFields",-1===e.selectedIndex&&(o.value=e.SelectedValue),(n||document.getElementById(this.pdfViewer.element.id+"_textLayer_"+t)).appendChild(o),o.addEventListener("focus",this.focusFormFields.bind(this)),o.addEventListener("blur",this.blurFormFields.bind(this)),o.addEventListener("click",this.updateFormFields.bind(this)),o.addEventListener("change",this.changeFormFields.bind(this)),o.addEventListener("keydown",this.updateFormFieldsValue.bind(this)),s=document.createElement("DATALIST"));for(var l=0;l<a.length;l++){var h=document.createElement("option"),d=(h.className="e-dropdownSelect",a[parseInt(l.toString(),10)].itemName?a[parseInt(l.toString(),10)].itemName:a[parseInt(l.toString(),10)].ItemName),p=a[parseInt(l.toString(),10)].itemValue?a[parseInt(l.toString(),10)].itemValue:a[parseInt(l.toString(),10)].ItemValue;e.SelectedValue===d||e.selectedIndex===l?h.selected=!0:h.selected=!1,h.value=p,h.innerHTML=d,s.appendChild(h)}return s.name=e.Text,s},j2t.prototype.createListBoxField=function(e,t){var i=document.createElement("select"),n=e.TextList;e.MultiSelect?i.multiple=!0:(i.multiple=!1,i.size=n.length);for(var o=0;o<n.length;o++){var r=document.createElement("option");r.className="e-pdfviewer-ListBox";for(var s=0;s<e.SelectedList.length;s++)e.SelectedList[parseInt(s.toString(),10)]===o&&(r.selected=!0);r.innerHTML=n[parseInt(o.toString(),10)],i.appendChild(r)}return i.name=e.Text,i},j2t.prototype.createSignatureField=function(e,t,i,n,o){var r=document.createElement("input"),s=(r.type="text",r.name=e.FieldName,this.pdfViewerBase.getZoomFactor()),a=document.getElementById("signIcon_"+t+"_"+i),n=(a&&!n&&a.remove(),this.pdfViewerBase.isInitialField=e.IsInitialField,this.pdfViewerBase.isInitialField?"Initial":"Sign"),a=this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings?19===this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.width?this.pdfViewerBase.isInitialField?27:19:this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.width:19,l=document.createElement("span"),h=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+t),d=e.LineBounds,p=this.ConvertPointToPixel(d.X),c=this.ConvertPointToPixel(d.Y),u=this.ConvertPointToPixel(d.Width),d=this.ConvertPointToPixel(d.Height),g=!this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings||this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.height>d*s/2?d*s/2:this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.height,a=u*s/2<a?u*s/2:a,m=!this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings||this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.fontSize>g/2?10:this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.fontSize,m=a<m?a/2:g<m?g/2:m,i=(l.style.position="absolute",l.id="signIcon_"+t+"_"+i,this.getAngle(t)),p=this.getBounds({left:p,top:c,width:a,height:g},t);return l.style.transform="rotate("+i+"deg)",l.style.left=p.left*s+"px",l.style.top=p.top*s+"px",F.isDevice&&!this.pdfViewer.enableDesktopMode?(l.style.height="5px",l.style.width="10px",l.style.fontSize="3px"):(l.style.height=g+"px",l.style.width=a+"px",l.style.fontSize=m+"px",N&&(l.style.fontSize=m-1+"px")),g+this.indicatorPaddingValue>d*s||a+this.indicatorPaddingValue>u*s||(l.style.padding="2px"),l.style.textAlign="center",l.style.boxSizing="content-box",l.innerHTML=this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings&&this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.text||n,l.style.color=this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings&&this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.color||"black",l.style.backgroundColor=this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings&&this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.backgroundColor||"orange",l.style.opacity=this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings&&this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.opacity||1,je(h)||h.appendChild(l),this.addSignaturePath(e,o),r},j2t.prototype.addSignaturePath=function(e,t){this.isSignatureField=!1;var i=this.pdfViewerBase.getItemFromSessionStorage("_formfields");if(i){var n=JSON.parse(i);"string"==typeof n&&(n=JSON.parse(n));for(var o=0;o<n.length;o++){var r=n[parseInt(o.toString(),10)];if(null!==r.ActualFieldName||!t||"ink"!==r.Name&&"SignatureField"!==r.Name&&"SignatureImage"!==r.Name&&"SignatureText"!==r.Name||(this.pdfViewer.formDesigner?r.FieldName.split("_")[0]!==e.ActualFieldName&&r.FieldName.split("_")[0]!==e.FieldName:r.FieldName.split("_")[0]!==e.FieldName||je(e.ActualFieldName)||!r.Value||""===r.Value)||e.PageIndex===r.PageIndex&&(e.Value=r.Value,e.FontFamily=r.FontFamily,e.FontSize=r.FontSize,this.isSignatureField=!0,e.Bounds=r.LineBounds),null===r.ActualFieldName&&t&&("ink"===r.Name||"SignatureField"===r.Name||"SignatureImage"===r.Name||"SignatureText"===r.Name)&&this.pdfViewer.formDesigner?r.FieldName===e.ActualFieldName+"_"+t||r.FieldName===e.FieldName+"_"+t:(r.FieldName===e.FieldName+"_"+t||r.FieldName===e.ActualFieldName+"_"+t)&&!je(e.ActualFieldName)&&r.Value&&""!==r.Value){e.Value=r.Value,e.FontFamily=r.FontFamily,e.FontSize=r.FontSize,this.isSignatureField=!0,e.Bounds||(e.Bounds=r.LineBounds);break}}}return this.isSignatureField},j2t.prototype.getBounds=function(e,t,i,n){t=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)],i=0<i?this.getBoundsPosition(i,e,t,n):this.getBoundsPosition(t.rotation,e,t,n);return i},j2t.prototype.getBoundsPosition=function(e,t,i,n){var o;if(n)switch(e){case 0:o=t;break;case 1:o={left:i.width-t.top-t.height-(t.width/2-t.height/2),top:t.left+(t.width/2-t.height/2),width:t.width,height:t.height};break;case 2:o={left:i.width-t.left-t.width,top:i.height-t.top-t.height,width:t.width,height:t.height};break;case 3:o={left:t.top-(t.width/2-t.height/2),top:i.height-t.left-t.width+(t.width/2-t.height/2),width:t.width,height:t.height}}else switch(e){case 90:o={left:i.width-t.top-t.height,top:t.left,width:t.height,height:t.width};break;case 180:o={left:i.width-t.left-t.width,top:i.height-t.top-t.height,width:t.width,height:t.height};break;case 270:o={left:t.top,top:i.height-t.left-t.width,width:t.height,height:t.width};break;case 0:o=t;break;case 1:o={left:i.width-t.top-t.height,top:t.left,width:t.height,height:t.width};break;case 2:o={left:i.width-t.left-t.width,top:i.height-t.top-t.height,width:t.width,height:t.height};break;case 3:o={left:t.top,top:i.height-t.left-t.width,width:t.height,height:t.width}}return o=o||t},j2t.prototype.applyPosition=function(e,t,i,n,o,r){var s,a,l,h;t&&(h=this.ConvertPointToPixel(t.X),s=this.ConvertPointToPixel(t.Y),a=this.ConvertPointToPixel(t.Width),t=this.ConvertPointToPixel(t.Height),l=0,h=this.getBounds({left:h,top:s,width:a,height:t},n,o,r),!je(i)&&i.Height&&(e.style.fontFamily=i.Name,i.Italic&&(e.style.fontStyle="italic"),i.Bold&&(e.style.fontWeight="Bold"),l=this.ConvertPointToPixel(i.Size)),this.pdfViewerBase.setStyleToTextDiv(e,h.left,h.top,l,h.width,h.height,!1))},j2t.prototype.renderExistingAnnnot=function(e,t,i,n){var o,r,s,a,l,h,d,p,c;!i&&(a=s=r=o=i=void 0,a=(i=e.Bounds&&"ink"!==e.Name?e.Bounds:e.LineBounds).x||i.y||i.width||i.height?(o=i.x,r=i.y,s=i.width,i.height):(o=this.ConvertPointToPixel(i.X),r=this.ConvertPointToPixel(i.Y),s=this.ConvertPointToPixel(i.Width),this.ConvertPointToPixel(i.Height)),i=parseFloat(e.PageIndex),c=this.updateSignatureBounds({left:o,top:r,width:s,height:a},i,n),h=e.FontFamily||e.fontFamily,this.pdfViewerBase.isSignatureImageData(e.Value)?l={id:this.pdfViewer.element.id+"input_"+i+"_"+t,bounds:c,pageIndex:i,data:e.Value,modifiedDate:"",shapeAnnotationType:"SignatureImage",opacity:1,rotateAngle:n?this.getAngle(i):0,annotName:"SignatureField",comments:[],review:{state:"",stateModel:"",modifiedDate:"",author:""}}:this.pdfViewerBase.isSignaturePathData(e.Value)?(d={left:(p=c).x,top:c.y,width:c.width,height:c.height},p=this.updateSignatureBounds(d,i,!1),l={id:this.pdfViewer.element.id+"input_"+i+"_"+t,bounds:p,pageIndex:i,data:e.Value,modifiedDate:"",shapeAnnotationType:"Path",opacity:1,rotateAngle:0,annotName:"SignatureField",comments:[],review:{state:"",stateModel:"",modifiedDate:"",author:""}}):((l={id:this.pdfViewer.element.id+"input_"+i+"_"+t,bounds:c,pageIndex:i,data:e.Value,modifiedDate:"",shapeAnnotationType:"SignatureText",opacity:1,rotateAngle:n?this.getAngle(i):0,annotName:"SignatureField",comments:[],review:{state:"",stateModel:"",modifiedDate:"",author:""},fontFamily:e.FontFamily,fontSize:e.FontSize}).fontFamily="TimesRoman"===h?"Times New Roman":h,l.fontSize=e.FontSize||e.fontSize),"SignatureField"!==e.Name&&"InitialField"!==e.Name||je(e.id)?((d=document.getElementById(l.id))&&d.classList.contains("e-pdfviewer-signatureformfields-signature")&&this.pdfViewer.annotation.deleteAnnotationById(l.id),this.pdfViewer.add(l),d&&(this.updateDataInSession(d,l.data,l.bounds),this.pdfViewer.fireSignatureAdd(l.pageIndex,l.id,l.shapeAnnotationType,l.bounds,l.opacity,l.strokeColor,l.thickness,l.data))):(p=e.id,t=document.getElementById(p+"_content_html_element"),c=this.pdfViewer.nameTable[""+p],l.id=c.id+"_content",n=this.pdfViewer.add(l),c.wrapper.children.push(n.wrapper),(!je(t)&&this.isSignatureField||!je(t)&&e.Value)&&((h=t.children[0].children[0]).style.pointerEvents="none",h.className="e-pdfviewer-signatureformfields-signature",h.parentElement.style.pointerEvents="none")),e.Bounds=l.bounds,this.pdfViewer.formDesignerModule&&(d=this.pdfViewerBase.getZoomFactor(),l.bounds={x:o*d,y:r*d,width:s*d,height:a*d},this.updateSignatureDataInSession(l,l.id)),p=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",i),0<(c=this.pdfViewer.formFieldCollection.filter(function(e){return l.id.split("_")[0]===e.id})).length&&"hidden"!==c[0].visibility||!this.pdfViewer.formDesignerModule)&&this.pdfViewer.renderDrawing(p,i)},j2t.prototype.updateSignatureBounds=function(e,t,i){t=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)];return t?i?1===t.rotation?{x:t.width-e.top-e.height-(e.width/2-e.height/2),y:e.left+(e.width/2-e.height/2),width:e.width,height:e.height}:2===t.rotation?{x:t.width-e.left-e.width,y:t.height-e.top-e.height,width:e.width,height:e.height}:3===t.rotation?{x:e.top-(e.width/2-e.height/2),y:t.height-e.left-e.width+(e.width/2-e.height/2),width:e.width,height:e.height}:{x:e.left,y:e.top,width:e.width,height:e.height}:1===t.rotation?{x:t.width-e.top-e.height,y:e.left,width:e.height,height:e.width}:2===t.rotation?{x:t.width-e.left-e.width,y:t.height-e.top-e.height,width:e.width,height:e.height}:3===t.rotation?{x:e.top,y:t.height-e.left-e.width,width:e.height,height:e.width}:{x:e.left,y:e.top,width:e.width,height:e.height}:{x:e.left,y:e.top,width:e.width,height:e.height}},j2t.prototype.resetFormFields=function(){for(var e=this.pdfViewer.formFieldCollections,t=0;t<e.length;t++){var i,n=e[parseInt(t.toString(),10)];this.currentTarget=document.getElementById(n.id),"Textbox"===n.type?this.currentTarget.value=n.value:"RadioButton"===n.type?(this.currentTarget.checked=n.value,n.value&&this.updateDataInSession(this.currentTarget)):"DropDown"===n.type?this.currentTarget.value=n.value:"CheckBox"===n.type?this.currentTarget.checked=n.value:"SignatureField"===n.type&&(i=this.pdfViewer.nameTable[n.id])&&(this.currentTarget&&"e-pdfviewer-signatureformfields-signature"===this.currentTarget.className&&(this.currentTarget.className="e-pdfviewer-signatureformfields",this.currentTarget.style.pointerEvents="",this.updateDataInSession(this.currentTarget,"")),this.pdfViewer.remove(i),this.pdfViewer.renderDrawing()),"RadioButton"!==n.type&&"SignatureField"!==n.type&&this.updateDataInSession(this.currentTarget)}},j2t.prototype.clearFormFieldStorage=function(){ARt.sessionStorageManager.getWindowSessionStorageSize();if(this.pdfViewerBase.isDeviceiOS||this.pdfViewerBase.isMacSafari,this.pdfViewerBase.isStorageExceed){for(var e=ARt.sessionStorageManager.getSessionLength(),t=[],i=0;i<e;i++)ARt.sessionStorageManager.getKey(i)&&ARt.sessionStorageManager.getKey(i).split("_")[3]&&("formfields"===ARt.sessionStorageManager.getKey(i).split("_")[3]||"formDesigner"===ARt.sessionStorageManager.getKey(i).split("_")[3])&&(this.pdfViewerBase.formFieldStorage[ARt.sessionStorageManager.getKey(i)]=ARt.sessionStorageManager.getItem(ARt.sessionStorageManager.getKey(i)),t.push(ARt.sessionStorageManager.getKey(i)));if(t)for(i=0;i<t.length;i++)ARt.sessionStorageManager.removeItem(t[parseInt(i.toString(),10)])}},j2t.prototype.clearFormFields=function(e){var t=this.pdfViewerBase.getItemFromSessionStorage("_formfields");if(t)for(var i=void 0,i=e?[e]:JSON.parse(t),n=!0,o=0;o<i.length;o++){var r,s=i[parseInt(o.toString(),10)];e&&(s.uniqueID=e.id,s.Name=e.type),this.currentTarget=document.getElementById(s.uniqueID),"Textbox"===s.Name?this.currentTarget.value="":"RadioButton"===s.Name?n&&(this.currentTarget.checked=!0,this.updateDataInSession(this.currentTarget),n=!1):"DropDown"===s.Name?this.currentTarget.value=s.TextList[0]:"CheckBox"===s.Name?this.currentTarget.checked=!1:"SignatureField"!==s.Name&&"InitialField"!==s.Name||!(r="annotations"!==(r=this.pdfViewer.nameTable[s.uniqueID]).propName?this.pdfViewer.nameTable[s.uniqueID+"_content"]:r)||(this.currentTarget&&"e-pdfviewer-signatureformfields-signature"===this.currentTarget.className&&(this.currentTarget.className="e-pdfviewer-signatureformfields",this.currentTarget.style.pointerEvents="",this.currentTarget.parentElement.style.pointerEvents="",this.updateDataInSession(this.currentTarget,""),e)&&(e.value="",e.signatureType=[e.signatureType],e.signatureType[0]=""),this.pdfViewer.annotation.deleteAnnotationById(r.id),this.currentTarget=null),"SignatureField"!==s.Name&&"ink"!==s.Name&&"RadioButton"!==s.Name&&this.updateDataInSession(this.currentTarget)}},j2t.prototype.ConvertPointToPixel=function(e){return e*(96/72)},j2t.prototype.destroy=function(){this.currentTarget=null,this.readOnlyCollection=[],this.pdfViewerBase&&this.pdfViewerBase.signatureModule&&this.pdfViewerBase.signatureModule.destroy()},j2t.prototype.getModuleName=function(){return"FormFields"},j2t.prototype.getTextWidth=function(e,t,i){var n,o=document.createElement("canvas"),r=o.getContext("2d"),t=(r.font=(n=t?t+"px "+i:n)||getComputedStyle(document.body).font,r.measureText(e).width);return this.pdfViewerBase.releaseCanvas(o),t},j2t.prototype.getFontSize=function(e){return e},j2t);function j2t(e,t){this.maintainTabIndex={},this.maintanMinTabindex={},this.isSignatureField=!1,this.paddingDifferenceValue=10,this.indicatorPaddingValue=4,this.isKeyDownCheck=!1,this.signatureFontSizeConstent=1.35,this.readOnlyCollection=[],this.isSignatureRendered=!1,this.signatureFieldCollection=[],this.selectedIndex=[],this.renderedPageList=[],this.pdfViewer=e,this.pdfViewerBase=t}Q2t.prototype.drawHelper=function(e,t,i){var n,o,r,s=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+this.pdfViewerBase.activeElements.activePageID);null!==document.getElementById(this.pdfViewer.element.id+"_pageCanvas_"+this.pdfViewerBase.activeElements.activePageID)&&null!==s&&(n=this.pdfViewerBase.getZoomFactor(),o=this.updateFormFieldInitialSize(t,e),r=this.createHtmlElement("div",{id:"FormField_helper_html_element",class:"foreign-object"}),this.isDrawHelper=!0,"SignatureField"===e||"InitialField"===e?r.appendChild(this.createSignatureDialog(this.pdfViewer,t,o)):"DropdownList"===e?r.appendChild(this.createDropDownList({id:"dropdown_helper"},t)):"ListBox"===e?r.appendChild(this.createListBox({id:"listbox_helper"},t)):r.appendChild(this.createInputElement(e,t,o)),s.appendChild(r),e=this.pdfViewerBase.getMousePosition(i),r.setAttribute("style","height:"+o.height*n+"px; width:"+o.width*n+"px;left:"+e.x*n+"px; top:"+e.y*n+"px;position:absolute;opacity: 0.5;"))},Q2t.prototype.drawHTMLContent=function(e,t,i,n,o,r,s){var a=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+n),l=document.getElementById(this.pdfViewer.element.id+"_pageCanvas_"+n);if(null===document.getElementById("form_field_"+t.id+"_html_element")&&null!==t&&null!==l&&a){var l=this.pdfViewerBase.getZoomFactor(),h={id:"form_field_"+t.id+"_html_element",class:"foreign-object"},h=this.createHtmlElement("div",h),d={id:t.id+"_html_element",class:"foreign-object"},d=this.createHtmlElement("div",d),o=("TimesRoman"===i.fontFamily&&(i.fontFamily="Times New Roman"),t.template="SignatureField"===e||"InitialField"===e?d.appendChild(this.createSignatureDialog(o,i)):"DropdownList"===e?d.appendChild(this.createDropDownList(t,i)):"ListBox"===e?d.appendChild(this.createListBox(t,i)):d.appendChild(this.createInputElement(e,i)),document.createElement("div"));if(o.id=i.id+"_designer_name",o.style.fontSize=this.defaultFontSize+"px",o.className="e-pv-show-designer-name",this.pdfViewer.designerMode?(o.innerHTML=i.name,o.style.position="absolute"):(o.innerHTML="",o.style.position="initial"),("Checkbox"===e&&F.isDevice?(f=(p=i.bounds).height+this.increasedSize,g=p.width+this.increasedSize,(m=Q("div",{id:i.id+"_outer_div",className:"e-pv-checkbox-outer-div"})).setAttribute("style","height:"+f*l+"px; width:"+g*l+"px;left:"+p.x*l+"px; top:"+p.y*l+"px;position:absolute; opacity: 1;"),d.appendChild(o),m.addEventListener("click",this.setCheckBoxState.bind(this)),h.appendChild(d),a.appendChild(m),m):(d.appendChild(o),h.appendChild(d),a)).appendChild(h),"RadioButton"===e&&0<document.getElementsByClassName("e-pv-radiobtn-span").length)for(var p,c=document.getElementsByClassName("e-pv-radiobtn-span"),u=0;u<c.length;u++)c[parseInt(u.toString(),10)].id.split("_")[0]===i.id&&(p=this.getCheckboxRadioButtonBounds(i),c[parseInt(u.toString(),10)].style.width=p.width/2+"px",c[parseInt(u.toString(),10)].style.height=p.height/2+"px",parseInt(c[parseInt(u.toString(),10)].style.width,10)<=1||parseInt(c[parseInt(u.toString(),10)].style.height,10)<=1)&&(c[parseInt(u.toString(),10)].style.width="1px",c[parseInt(u.toString(),10)].style.height="1px",c[parseInt(u.toString(),10)].style.margin="1px");var g,m,f=Pvt(t).topLeft,h=("Checkbox"===e&&F.isDevice?d.setAttribute("style","height:"+t.actualSize.height*l+"px; width:"+t.actualSize.width*l+"px;left:"+f.x*l+"px; top:"+f.y*l+"px;transform:rotate("+(t.rotateAngle+t.parentTransform)+"deg);pointer-events:"+(this.pdfViewer.designerMode?"none":"all")+";visibility:"+(t.visible?"visible":"hidden")+";opacity:"+t.style.opacity+";"):d.setAttribute("style","height:"+t.actualSize.height*l+"px; width:"+t.actualSize.width*l+"px;left:"+f.x*l+"px; top:"+f.y*l+"px;position:absolute;transform:rotate("+(t.rotateAngle+t.parentTransform)+"deg);pointer-events:"+(this.pdfViewer.designerMode?"none":"all")+";visibility:"+(t.visible?"visible":"hidden")+";opacity:"+t.style.opacity+";"),this.updateFormDesignerFieldInSessionStorage(f,t,e,i),"SignatureField"!==e&&"InitialField"!==e||i.value&&(g=this.pdfViewer.drawing.copiedElementID+"_content",je(this.pdfViewer.nameTable[g])||(o=-1<(m=this.pdfViewer.nameTable[g].value).indexOf("base64")?"Image":m.startsWith("M")&&m.split(",")[1].split(" ")[1].startsWith("L")?"Path":"Type",this.pdfViewer.formFieldsModule&&this.pdfViewer.formFieldsModule.drawSignature(o,m,t.template,i.fontFamily))),this.getFormFieldAddEventArgs(i));this.pdfViewer.isFormFieldsLoaded&&!s||this.pdfViewerBase.updateDocumentEditedProperty(!0),(this.isSetFormFieldMode||s)&&(a=this.pdfViewerBase.activeElements.activePageID||h.pageNumber-1,this.pdfViewer.fireFormFieldAddEvent("formFieldAdd",h,a)),this.isSetFormFieldMode=!1}else{f=Pvt(t).topLeft;this.updateFormDesignerFieldInSessionStorage(f,t,e,i),s&&(h=this.getFormFieldAddEventArgs(i),this.pdfViewer.fireFormFieldAddEvent("formFieldAdd",h,n))}return t.template},Q2t.prototype.getFormFieldAddEventArgs=function(e){return{name:e.name,id:e.id,value:e.value,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,color:e.color,backgroundColor:e.backgroundColor,alignment:e.alignment,isReadonly:e.isReadonly,visibility:e.visibility,maxLength:e.maxLength,isRequired:e.isRequired,isPrint:e.isPrint,rotation:e.rotateAngle,tooltip:e.tooltip,borderColor:e.borderColor,thickness:e.thickness,options:e.options,pageNumber:e.pageNumber,isChecked:e.isChecked,isSelected:e.isSelected,customData:e.customData,bounds:e.bounds,formFieldAnnotationType:e.formFieldAnnotationType,isMultiline:e.isMultiline,insertSpaces:e.insertSpaces}},Q2t.prototype.updateFormDesignerFieldInSessionStorage=function(e,t,i,n){var o=this.pdfViewerBase.getZoomFactor(),r={id:t.id,lineBound:{X:e.x*o,Y:e.y*o,Width:t.actualSize.width*o,Height:t.actualSize.height*o},name:n.name,zoomValue:o,pageNumber:n.pageNumber,value:n.value,formFieldAnnotationType:i,isMultiline:n.isMultiline,signatureType:n.signatureType,signatureBound:n.signatureBound,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontColor:this.getRgbCode(n.color),borderColor:this.getRgbCode(n.borderColor),thickness:n.thickness,backgroundColor:this.getRgbCode(n.backgroundColor),textAlign:n.alignment,isChecked:n.isChecked,isSelected:n.isSelected,isReadonly:n.isReadonly,font:{isBold:n.font.isBold,isItalic:n.font.isItalic,isStrikeout:n.font.isStrikeout,isUnderline:n.font.isUnderline},selectedIndex:n.selectedIndex,radiobuttonItem:null,option:n.options||[],visibility:n.visibility,maxLength:n.maxLength,isRequired:n.isRequired,isPrint:n.isPrint,rotation:n.rotateAngle,tooltip:n.tooltip,insertSpaces:n.insertSpaces,customData:n.customData};if("RadioButton"===r.formFieldAnnotationType&&(r.radiobuttonItem=[],r.radiobuttonItem.push({id:t.id,lineBound:{X:e.x*o,Y:e.y*o,Width:t.actualSize.width*o,Height:t.actualSize.height*o},name:n.name,zoomValue:o,pageNumber:n.pageNumber,value:n.value,formFieldAnnotationType:i,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontColor:this.getRgbCode(n.color),borderColor:this.getRgbCode(n.borderColor),thickness:n.thickness,backgroundColor:this.getRgbCode(n.backgroundColor),textAlign:n.alignment,isChecked:n.isChecked,isSelected:n.isSelected,isReadonly:n.isReadonly,visibility:n.visibility,maxLength:n.maxLength,isRequired:n.isRequired,isPrint:n.isPrint,rotation:0,tooltip:n.tooltip})),!this.getRadioButtonItem(r,n)){for(var s=0;s<this.pdfViewerBase.formFieldCollection.length;s++)this.pdfViewerBase.formFieldCollection[parseInt(s.toString(),10)].Key===r.id&&(this.pdfViewerBase.formFieldCollection.splice(s,1),this.pdfViewerBase.formFieldCollection.push({Key:t.id,FormField:r}),this.isFormFieldExistingInCollection=!0);this.isFormFieldExistingInCollection||this.pdfViewerBase.formFieldCollection.push({Key:t.id,FormField:r}),this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner"),this.isFormFieldExistingInCollection=!1,0<this.pdfViewerBase.formFieldCollection.length?this.pdfViewerBase.enableFormFieldButton(!0):this.pdfViewerBase.enableFormFieldButton(!1)}},Q2t.prototype.getRadioButtonItem=function(e,t){var i=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),n=!1;if(i){for(var o=JSON.parse(i),r=0;r<o.length;r++){var s=o[parseInt(r.toString(),10)],a=void 0;if("RadioButton"===e.formFieldAnnotationType&&e.radiobuttonItem&&s.FormField.radiobuttonItem)for(var l=0;l<s.FormField.radiobuttonItem.length;l++){if(s.FormField.radiobuttonItem[parseInt(l.toString(),10)].id===e.id){a={lineBound:e.lineBound,id:e.id,name:e.name,zoomValue:e.zoomValue,pageNumber:e.pageNumber,value:e.value,formFieldAnnotationType:e.formFieldAnnotationType,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontColor:this.getRgbCode(t.color),borderColor:this.getRgbCode(t.borderColor),thickness:t.thickness,backgroundColor:this.getRgbCode(t.backgroundColor),textAlign:e.textAlign,isChecked:e.isChecked,isSelected:e.isSelected,isReadonly:e.isReadonly,visibility:e.visibility,maxLength:e.maxLength,isRequired:e.isRequired,isPrint:e.isPrint,rotation:0,tooltip:e.tooltip},s.FormField.radiobuttonItem.splice(l,1),s.FormField.radiobuttonItem.push(a),je(this.pdfViewerBase.formFieldCollection[parseInt(r.toString(),10)])||this.pdfViewerBase.formFieldCollection[parseInt(r.toString(),10)].FormField.name===s.FormField.name&&(this.pdfViewerBase.formFieldCollection[parseInt(r.toString(),10)].FormField.radiobuttonItem=s.FormField.radiobuttonItem,n=!0);break}if(e.formFieldAnnotationType===s.FormField.formFieldAnnotationType&&e.name===s.FormField.name){for(var a={lineBound:e.lineBound,id:e.id,name:e.name,zoomValue:e.zoomValue,pageNumber:e.pageNumber,value:e.value,formFieldAnnotationType:e.formFieldAnnotationType,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontColor:this.getRgbCode(t.color),borderColor:this.getRgbCode(t.borderColor),thickness:t.thickness,backgroundColor:this.getRgbCode(t.backgroundColor),textAlign:e.textAlign,isChecked:e.isChecked,isSelected:e.isSelected,isReadonly:e.isReadonly,visibility:e.visibility,maxLength:e.maxLength,isRequired:e.isRequired,isPrint:e.isPrint,rotation:0,tooltip:e.tooltip},h=!1,d=0;d<s.FormField.radiobuttonItem.length;d++)if(s.FormField.radiobuttonItem[parseInt(d.toString(),10)].id===a.id){s.FormField.radiobuttonItem[parseInt(d.toString(),10)]=a,h=!0;break}if(h||s.FormField.radiobuttonItem.push(a),!je(this.pdfViewerBase.formFieldCollection[parseInt(r.toString(),10)])){this.pdfViewerBase.formFieldCollection[parseInt(r.toString(),10)].FormField.radiobuttonItem=s.FormField.radiobuttonItem;for(var n=!0,p=0;p<this.pdfViewerBase.formFieldCollection.length;p++)this.pdfViewerBase.formFieldCollection[parseInt(p.toString(),10)].Key===a.id&&this.pdfViewerBase.formFieldCollection.splice(p,1)}}}}n&&this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")}return n},Q2t.prototype.getRgbCode=function(e){e.match(/#([a-z0-9]+)/gi)||e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/)||""!==(t=this.nameToHash(e))&&(e=t);var t=e.split(","),e=(je(t[1])&&(t=(e=this.getValue(e,"rgba")).split(",")),parseInt(t[0].split("(")[1],10)),i=parseInt(t[1],10),n=parseInt(t[2],10),t=100*parseFloat(t[3]);return{r:e,g:i,b:n,a:t=isNaN(t)?0:t}},Q2t.prototype.nameToHash=function(e){var t={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",yellow:"#ffff00",yellowgreen:"#9acd32",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkred:"#8b0000",darksalmon:"#e9967a",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",indigo:"#4b0082",ivory:"#fffff0",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",pink:"#ffc0cb",plum:"#dda0dd",steelblue:"#4682b4",violet:"#ee82ee",powderblue:"#b0e0e6",purple:"#800080",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0"};return void 0!==t[e.toLowerCase()]?t[e.toLowerCase()]:""},Q2t.prototype.getValue=function(e,t){var i,n;return t=t?t.toLowerCase():"hex","r"===e[0]?(i=this.convertRgbToNumberArray(e),"hex"===t||"hexa"===t?(n=this.rgbToHex(i),"hex"===t?n.slice(0,7):n):"hsv"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"):"h"===e[0]?(i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(e)),"rgba"===t?this.convertToRgbString(i):"hex"===t||"hexa"===t?(n=this.rgbToHex(i),"hex"===t?n.slice(0,7):n):"rgb"===t?this.convertToRgbString(i.slice(0,3)):"null"):(e=this.roundValue(e),n=this.hexToRgb(e),"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")},Q2t.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)})},Q2t.prototype.convertToRgbString=function(e){return e.length?4===e.length?"rgba("+e.join()+")":"rgb("+e.join()+")":""},Q2t.prototype.convertToHsvString=function(e){return 4===e.length?"hsva("+e.join()+")":"hsv("+e.join()+")"},Q2t.prototype.roundValue=function(e){if(!e)return"";var t=(e="#"!==e[0]?"#"+e:e).length;if(4===t&&(e+="f",t=5),5===t){for(var i="",n=1,o=e.length;n<o;n++)i+=e.charAt(n)+e.charAt(n);e="#"+i,t=9}return 7===t&&(e+="ff"),e},Q2t.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=e.slice(1,7),parseInt(e,16)),i=[];return i.push(e>>16&255),i.push(e>>8&255),i.push(255&e),i.push(t),i},Q2t.prototype.rgbToHsv=function(e,t,i,n){e/=255,t/=255,i/=255;var o,r=Math.max(e,t,i),s=Math.min(e,t,i),a=r,l=r-s,h=0===r?0:l/r;if(r===s)o=0;else{switch(r){case e:o=(t-i)/l+(t<i?6:0);break;case t:o=(i-e)/l+2;break;case i:o=(e-t)/l+4}o/=6}s=[Math.round(360*o),Math.round(1e3*h)/10,Math.round(1e3*a)/10];return je(n)||s.push(n),s},Q2t.prototype.hsvToRgb=function(e,t,i,n){var o,r,s;if(i/=100,0===(t/=100))return o=r=s=i,[Math.round(255*o),Math.round(255*r),Math.round(255*s),n];e/=60;var a=Math.floor(e),e=e-a,l=i*(1-t),h=i*(1-t*e),d=i*(1-t*(1-e));switch(a){case 0:o=i,r=d,s=l;break;case 1:o=h,r=i,s=l;break;case 2:o=l,r=i,s=d;break;case 3:o=l,r=h,s=i;break;case 4:o=d,r=l,s=i;break;default:o=i,r=l,s=h}t=[Math.round(255*o),Math.round(255*r),Math.round(255*s)];return je(n)||t.push(n),t},Q2t.prototype.rgbToHex=function(e){return e.length?"#"+this.hex(e[0])+this.hex(e[1])+this.hex(e[2])+(je(e[3])?"":0!==e[3]?(Math.round(255*e[3])+65536).toString(16).substr(-2):"00"):""},Q2t.prototype.updateCanvas=function(e,t){var i,n,o,r;je(t)&&(t=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",e),i=this.pdfViewerBase.getZoomFactor(),n=this.pdfViewerBase.getZoomRatio(i),t)&&(o=this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].width,r=this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].height,t.width=o*n,t.height=r*n,t.style.width=o*i+"px",t.style.height=r*i+"px"),this.pdfViewer.drawing.refreshCanvasDiagramLayer(t,e)},Q2t.prototype.rerenderFormFields=function(l){var h=this,d=this.pdfViewerBase.getZoomFactor(),e=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),p=!1;if(e){var c=JSON.parse(e),e=("["===c[0]&&(c=JSON.parse(c)),document.getElementById(this.pdfViewer.element.id+"_textLayer_"+l)),t=document.getElementById(this.pdfViewer.element.id+"_pageCanvas_"+l);if(null!==c&&null!==t&&null!==e)for(var u=this,i=0;i<c.length;i++)!function(e){var t=c[parseInt(e.toString(),10)].FormField;if(t.pageNumber===l+1&&!document.getElementById("form_field_"+t.id+"_html_element")){var i=u.pdfViewer.nameTable[c[parseInt(e.toString(),10)].Key.split("_")[0]],n=i.wrapper.children[0],o=u.pdfViewer.formFieldCollections.filter(function(e){return t.id.split("_")[0]===e.id});if(n&&0<o.length&&"visible"===o[0].visibility){if("RadioButton"===t.formFieldAnnotationType)for(var r=0;r<t.radiobuttonItem.length;r++)i=u.pdfViewer.nameTable[t.radiobuttonItem[parseInt(r.toString(),10)].id.split("_")[0]],n=i.wrapper.children[0],t.radiobuttonItem[parseInt(r.toString(),10)]=u.renderFormFieldsInZooming(n,t.radiobuttonItem[parseInt(r.toString(),10)],i,d),u.pdfViewerBase.formFieldCollection[parseInt(e.toString(),10)].FormField.radiobuttonItem[parseInt(r.toString(),10)].lineBound=t.radiobuttonItem[parseInt(r.toString(),10)].lineBound,u.pdfViewerBase.formFieldCollection[parseInt(e.toString(),10)].FormField.radiobuttonItem[parseInt(r.toString(),10)].zoomValue=d;else{var s,a=u.pdfViewerBase.formFieldCollection.filter(function(e){return e.FormField.id===t.id}),a=(t&&""===t.value&&(t.value=a[0]?a[0].FormField.value:"",t.signatureType=a[0]?a[0].FormField.signatureType:""),je(t)||(t.visibility=o[0].visibility,a[0].FormField.visibility=o[0].visibility),u.renderFormFieldsInZooming(n,t,i,d));"SignatureField"!==t.formFieldAnnotationType&&"InitialField"!==t.formFieldAnnotationType||(s=u,c.filter(function(e){e.FormField.name!==t.name||e.FormField.id===t.id||je(s.pdfViewer.nameTable[e.FormField.id])||""===s.pdfViewer.nameTable[e.FormField.id].value||(t.value=s.pdfViewer.nameTable[e.FormField.id].value,t.signatureType="Text"===e.FormField.signatureType?"Type":e.FormField.signatureType,""!==t.value&&(t.signatureBound=e.FormField.signatureBound))}),!je(s.pdfViewer.nameTable[t.id])&&""!==s.pdfViewer.nameTable[t.id].value)||""===t.value||(u.pdfViewer.formFieldsModule&&u.pdfViewer.formFieldsModule.drawSignature(t.signatureType,t.value,t),p=!0),t.lineBound=a.lineBound,t.signatureBound&&(t.signatureBound=a.signatureBound,u.pdfViewerBase.formFieldCollection[parseInt(e.toString(),10)].FormField.signatureBound=t.signatureBound,"SignatureField"!==t.formFieldAnnotationType&&"InitialField"!==t.formFieldAnnotationType||"Image"!==t.signatureType||!p?je(u.pdfViewer.nameTable[n.id.split("_")[0]+"_content"])||(u.pdfViewer.nameTable[n.id.split("_")[0]+"_content"].signatureBound=t.signatureBound):setTimeout(function(){je(h.pdfViewer.nameTable[n.id.split("_")[0]+"_content"])||(h.pdfViewer.nameTable[n.id.split("_")[0]+"_content"].signatureBound=t.signatureBound)},10)),u.pdfViewerBase.formFieldCollection[parseInt(e.toString(),10)].FormField.lineBound=t.lineBound,u.pdfViewerBase.formFieldCollection[parseInt(e.toString(),10)].FormField.zoomValue=d}u.pdfViewerBase.setItemInSessionStorage(u.pdfViewerBase.formFieldCollection,"_formDesigner")}}u.pdfViewerBase.isFocusField&&u.pdfViewerBase.focusField&&(o=document.getElementById(u.pdfViewerBase.focusField.id))&&(("SignatureField"!==u.pdfViewerBase.focusField.type&&"InitialField"!==u.pdfViewerBase.focusField.type||!u.pdfViewer.formDesignerModule?o:o.parentElement).focus(),u.pdfViewerBase.isFocusField=!1,u.pdfViewerBase.focusField=[])}(i)}},Q2t.prototype.renderFormFieldsInZooming=function(e,t,i,n){var o,r,s,a,l,h,d;return e&&(o={id:"form_field_"+e.id+"_html_element",class:"foreign-object"},o=this.createHtmlElement("div",o),r={id:e.id+"_html_element",class:"foreign-object"},r=this.createHtmlElement("div",r),je(t)||(i.visibility=t.visibility),"SignatureField"===t.formFieldAnnotationType||"InitialField"===t.formFieldAnnotationType?(this.disableSignatureClickEvent=!0,i.value=t.value,i.signatureType=t.signatureType,i.signatureBound=t.signatureBound,e.template=r.appendChild(this.createSignatureDialog(this.pdfViewer,i)),this.disableSignatureClickEvent=!1):"DropdownList"===t.formFieldAnnotationType?e.template=r.appendChild(this.createDropDownList(e,i)):"ListBox"===t.formFieldAnnotationType?e.template=r.appendChild(this.createListBox(e,i)):e.template=r.appendChild(this.createInputElement(t.formFieldAnnotationType,i)),(s=document.createElement("div")).id=i.id+"_designer_name",s.style.fontSize=.5<n?this.defaultFontSize+"px":"6px",s.className="e-pv-show-designer-name",this.pdfViewer.designerMode?(s.innerHTML=i.name,s.style.position="absolute"):(s.innerHTML="",s.style.position="initial"),r.appendChild(s),o.appendChild(r),(s=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+(t.pageNumber-1))).appendChild(o),"RadioButton"===i.formFieldAnnotationType&&document.getElementsByClassName("e-pv-radiobtn-span").length,a=Pvt(i.wrapper.children[0]).topLeft,"Checkbox"===t.formFieldAnnotationType&&F.isDevice?(d=e.actualSize.height+this.increasedSize,l=e.actualSize.width+this.increasedSize,(h=Q("div",{id:e.id+"_outer_div",className:"e-pv-checkbox-outer-div"})).setAttribute("style","height:"+d*n+"px; width:"+l*n+"px;left:"+a.x*n+"px; top:"+a.y*n+"px;position:absolute; opacity: 1;"),h.appendChild(o),h.addEventListener("click",this.setCheckBoxState.bind(this)),s.appendChild(h),r.setAttribute("style","height:"+e.actualSize.height*n+"px; width:"+e.actualSize.width*n+"px;left:"+a.x*n+"px; top:"+a.y*n+"px;transform:rotate("+(e.rotateAngle+e.parentTransform)+"deg);pointer-events:"+(this.pdfViewer.designerMode?"none":"all")+";visibility:"+(e.visible?"visible":"hidden")+";opacity:"+e.style.opacity+";")):r.setAttribute("style","height:"+e.actualSize.height*n+"px; width:"+e.actualSize.width*n+"px;left:"+a.x*n+"px; top:"+a.y*n+"px;position:absolute;transform:rotate("+(e.rotateAngle+e.parentTransform)+"deg);pointer-events:"+(this.pdfViewer.designerMode?"none":"all")+";visibility:"+(e.visible?"visible":"hidden")+";opacity:"+e.style.opacity+";"),t.lineBound={X:a.x*n,Y:a.y*n,Width:e.actualSize.width*n,Height:e.actualSize.height*n},t.signatureBound)&&i.wrapper.children[1]&&(d=i.wrapper.children[1].bounds,t.signatureBound.x=d.x*n,t.signatureBound.y=d.y*n,t.signatureBound.width=d.width*n,t.signatureBound.height=d.height*n),t},Q2t.prototype.updateFormFieldInitialSize=function(e,t){var i=this.pdfViewerBase.getZoomFactor();switch(t){case"Textbox":case"PasswordField":e.width=200*i,e.height=24*i;break;case"SignatureField":case"InitialField":e.width=200*i,e.height=63*i;break;case"Checkbox":case"RadioButton":e.width=20*i,e.height=20*i;break;case"DropdownList":e.width=200*i,e.height=24*i;break;case"ListBox":e.width=198*i,e.height=66*i}return{width:e.width,height:e.height}},Q2t.prototype.updateHTMLElement=function(e){var t=e.wrapper.children[0],i=this.pdfViewerBase.getZoomFactor();if(t){var n=document.getElementById(t.id+"_html_element");if(!je(n)){for(var o,r,s,a,l=Pvt(e.wrapper.children[0]).topLeft,h=(n.setAttribute("style","height:"+t.actualSize.height*i+"px; width:"+t.actualSize.width*i+"px;left:"+l.x*i+"px; top:"+l.y*i+"px;position:absolute;transform:rotate("+(t.rotateAngle+t.parentTransform)+"deg);pointer-events:"+(this.pdfViewer.designerMode?"none":"all")+";visibility:"+(t.visible?"visible":"hidden")+";opacity:"+t.style.opacity+";"),this.pdfViewerBase.getItemFromSessionStorage("_formDesigner")),d=("RadioButton"===e.formFieldAnnotationType&&(r=n.firstElementChild.firstElementChild,o=n.firstElementChild.firstElementChild.lastElementChild,t.actualSize.width>t.actualSize.height?(n.firstElementChild.style.display="inherit",r.style.width=r.style.height=t.actualSize.height*i+"px",o.style.width=o.style.height=t.actualSize.height/2+"px"):(n.firstElementChild.style.display="flex",r.style.width=r.style.height=t.actualSize.width*i+"px",o.style.width=o.style.height=t.actualSize.width/2+"px"),i<1&&r.style.width<=20&&r.style.height<=20?o.style.margin=Math.round(parseInt(r.style.width,10)/3.5)+"px":o.style.margin=Math.round(parseInt(r.style.width,10)/4)+"px"),"Checkbox"===e.formFieldAnnotationType&&(r=n.firstElementChild.firstElementChild,o=n.firstElementChild.firstElementChild.lastElementChild.firstElementChild,t.actualSize.width>t.actualSize.height?(n.firstElementChild.style.display="inherit",r.style.width=r.style.height=t.actualSize.height*i+"px",o.style.width=t.actualSize.height/5*i+"px",o.style.height=t.actualSize.height/2.5*i+"px",o.style.left=t.actualSize.height/2.5*i+"px",o.style.top=t.actualSize.height/5*i+"px"):(n.firstElementChild.style.display="flex",r.style.width=r.style.height=t.actualSize.width*i+"px",o.style.width=t.actualSize.width/5*i+"px",o.style.height=t.actualSize.width/2.5*i+"px",o.style.left=t.actualSize.width/2.5*i+"px",o.style.top=t.actualSize.width/5*i+"px"),-1!==o.className.indexOf("e-pv-cb-checked"))&&(r=parseInt(r.style.width,10),o.style.borderWidth=20<r?"3px":r<=15?"1px":"2px"),"SignatureField"!==e.formFieldAnnotationType&&"InitialField"!==e.formFieldAnnotationType||(r=(o=n.firstElementChild.firstElementChild).nextElementSibling,n=this.getBounds(r),r={height:t.actualSize.height,width:t.actualSize.width,signatureIndicatorSettings:{text:r.textContent,width:n.width,height:n.height},initialIndicatorSettings:{text:r.textContent,width:n.width,height:n.height}},this.updateSignatureandInitialIndicator(e,r,o)),JSON.parse(h)),p=0;p<d.length;p++)if("RadioButton"===d[parseInt(p.toString(),10)].FormField.formFieldAnnotationType){for(var c=0;c<d[parseInt(p.toString(),10)].FormField.radiobuttonItem.length;c++)if(t.id===d[parseInt(p.toString(),10)].FormField.radiobuttonItem[parseInt(c.toString(),10)].id){this.pdfViewerBase.formFieldCollection[parseInt(p.toString(),10)].FormField.radiobuttonItem[parseInt(c.toString(),10)].lineBound={X:l.x*i,Y:l.y*i,Width:t.actualSize.width*i,Height:t.actualSize.height*i},this.pdfViewerBase.formFieldCollection[parseInt(p.toString(),10)].FormField.radiobuttonItem[parseInt(c.toString(),10)].zoomValue=i;break}}else d[parseInt(p.toString(),10)].Key===t.id&&(d[parseInt(p.toString(),10)].FormField.lineBound={X:l.x*i,Y:l.y*i,Width:t.actualSize.width*i,Height:t.actualSize.height*i},d[parseInt(p.toString(),10)].FormField.signatureBound&&(s=l.x*i+t.actualSize.width*i/2,s-=d[parseInt(p.toString(),10)].FormField.signatureBound.width/2,a=l.y*i+t.actualSize.height*i/2,a-=d[parseInt(p.toString(),10)].FormField.signatureBound.height/2,d[parseInt(p.toString(),10)].FormField.signatureBound.x=s,d[parseInt(p.toString(),10)].FormField.signatureBound.y=a,this.pdfViewerBase.formFieldCollection[parseInt(p.toString(),10)].FormField.signatureBound=d[parseInt(p.toString(),10)].FormField.signatureBound,this.pdfViewer.nameTable[t.id.split("_")[0]+"_content"].signatureBound=d[parseInt(p.toString(),10)].FormField.signatureBound),this.pdfViewerBase.formFieldCollection[parseInt(p.toString(),10)].FormField.lineBound=d[parseInt(p.toString(),10)].FormField.lineBound);this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")}}},Q2t.prototype.getCheckboxRadioButtonBounds=function(e,t,i){var i=i?this.defaultZoomValue:this.pdfViewerBase.getZoomFactor(),n=0,o=0,r="";return t?r=t.width>t.height?(n=o=t.height*i,"inherit"):(n=o=t.width*i,"flex"):e&&(r=e.bounds.width>e.bounds.height?(n=o=e.bounds.height*i,"inherit"):(n=o=e.bounds.width*i,"flex")),{width:n,height:o,display:r}},Q2t.prototype.updateSessionFormFieldProperties=function(e){var t=this.pdfViewerBase.getZoomFactor(),i=e.wrapper.children[0],n=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),o=JSON.parse(n);if(!je(i))for(var r=0;r<o.length;r++)if("RadioButton"===o[parseInt(r.toString(),10)].FormField.formFieldAnnotationType){for(var s=0;s<o[parseInt(r.toString(),10)].FormField.radiobuttonItem.length;s++)if(i.id===o[parseInt(r.toString(),10)].FormField.radiobuttonItem[parseInt(s.toString(),10)].id){var a={id:i.id,lineBound:{X:i.bounds.x*t,Y:i.bounds.y*t,Width:i.bounds.width*t,Height:i.bounds.height*t},name:e.name,zoomValue:t,pageNumber:e.pageNumber,value:e.value,formFieldAnnotationType:e.formFieldAnnotationType,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontColor:this.getRgbCode(e.color),backgroundColor:this.getRgbCode(e.backgroundColor),borderColor:this.getRgbCode(e.borderColor),thickness:e.thickness,textAlign:e.alignment,isChecked:e.isChecked,isSelected:e.isSelected,isReadonly:e.isReadonly,visibility:e.visibility,maxLength:e.maxLength,isRequired:e.isRequired,isPrint:e.isPrint,rotation:0,tooltip:e.tooltip,isMultiline:e.isMultiline,insertSpaces:e.insertSpaces,isTransparent:e.isTransparent,zIndex:e.zIndex,customData:e.customData};o[parseInt(r.toString(),10)].FormField.radiobuttonItem[parseInt(s.toString(),10)]=a,this.pdfViewerBase.formFieldCollection[parseInt(r.toString(),10)]&&this.pdfViewerBase.formFieldCollection[parseInt(r.toString(),10)].FormField&&this.pdfViewerBase.formFieldCollection[parseInt(r.toString(),10)].FormField.radiobuttonItem[parseInt(s.toString(),10)]&&(this.pdfViewerBase.formFieldCollection[parseInt(r.toString(),10)].FormField.radiobuttonItem[parseInt(s.toString(),10)]=a,this.pdfViewerBase.formFieldCollection[parseInt(r.toString(),10)].FormField.tooltip=a.tooltip);break}}else if(o[parseInt(r.toString(),10)].Key===i.id){var l,h={id:i.id,lineBound:{X:i.bounds.x*t,Y:i.bounds.y*t,Width:i.bounds.width*t,Height:i.bounds.height*t},name:e.name,zoomValue:t,pageNumber:e.pageNumber,value:e.value,formFieldAnnotationType:e.formFieldAnnotationType,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontColor:this.getRgbCode(e.color),backgroundColor:this.getRgbCode(e.backgroundColor),borderColor:this.getRgbCode(e.borderColor),thickness:e.thickness,textAlign:e.alignment,isChecked:e.isChecked,isSelected:e.isSelected,isReadonly:e.isReadonly,font:{isBold:e.font.isBold,isItalic:e.font.isItalic,isStrikeout:e.font.isStrikeout,isUnderline:e.font.isUnderline},selectedIndex:e.selectedIndex,radiobuttonItem:null,option:e.options||[],visibility:e.visibility,maxLength:e.maxLength,isRequired:e.isRequired,isPrint:e.isPrint,rotation:0,tooltip:e.tooltip,isMultiline:e.isMultiline,insertSpaces:e.insertSpaces,isTransparent:e.isTransparent,zIndex:e.zIndex,customData:e.customData};"SignatureField"===o[parseInt(r.toString(),10)].FormField.formFieldAnnotationType||"InitialField"===o[parseInt(r.toString(),10)].FormField.formFieldAnnotationType?(l={id:i.id,lineBound:{X:i.bounds.x*t,Y:i.bounds.y*t,Width:i.bounds.width*t,Height:i.bounds.height*t},name:(l=e).name,zoomValue:t,pageNumber:e.pageNumber,value:e.value,formFieldAnnotationType:e.formFieldAnnotationType,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontColor:this.getRgbCode(e.color),backgroundColor:this.getRgbCode(e.backgroundColor),borderColor:this.getRgbCode(e.borderColor),thickness:e.thickness,textAlign:e.alignment,isChecked:e.isChecked,isSelected:e.isSelected,isReadonly:e.isReadonly,font:{isBold:e.font.isBold,isItalic:e.font.isItalic,isStrikeout:e.font.isStrikeout,isUnderline:e.font.isUnderline},selectedIndex:e.selectedIndex,radiobuttonItem:null,option:e.options||[],visibility:e.visibility,maxLength:e.maxLength,isRequired:e.isRequired,isPrint:e.isPrint,rotation:0,tooltip:e.tooltip,signatureType:e.signatureType,signatureBound:l.signatureBound,isMultiline:e.isMultiline,insertSpaces:e.insertSpaces,isTransparent:e.isTransparent,zIndex:e.zIndex,customData:e.customData},o[parseInt(r.toString(),10)].FormField=l,this.pdfViewerBase.formFieldCollection[parseInt(r.toString(),10)].FormField=l):(o[parseInt(r.toString(),10)].FormField=h,this.pdfViewerBase.formFieldCollection[parseInt(r.toString(),10)].FormField=h);break}0<this.pdfViewerBase.formFieldCollection.length?this.pdfViewerBase.enableFormFieldButton(!0):this.pdfViewerBase.enableFormFieldButton(!1),this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")},Q2t.prototype.createSignatureDialog=function(e,t,i,n){this.isInitialField=!je(t.isInitialField)&&t.isInitialField,this.pdfViewerBase.isInitialField=this.isInitialField,this.pdfViewerBase.isInitialField=t.isInitialField;var o=Q("div"),r=(o.className="foreign-object",o.style.position="absolute",o.style.width="100%",o.style.height="100%",o.addEventListener("focus",this.focusFormFields.bind(this)),o.addEventListener("blur",this.blurFormFields.bind(this)),Q("div")),r=(r.style.width="100%",r.style.height="100%",r.style.position="absolute",r.style.backgroundColor="transparent",je(t.thickness)||(r.className="e-pdfviewer-signatureformfields-signature",r.style.border=t.thickness+"px solid #303030"),je(t.value)||""===t.value?(r.className="e-pdfviewer-signatureformfields",r.style.pointerEvents=""):(r.className="e-pdfviewer-signatureformfields-signature",r.style.pointerEvents="none"),r.id=t.id,r.disabled=t.isReadonly,o.appendChild(r),this.pdfViewer.signatureFieldSettings),s=this.pdfViewer.initialFieldSettings,a=(r.signatureIndicatorSettings||(r.signatureIndicatorSettings={opacity:1,backgroundColor:"orange",width:19,height:10,fontSize:10,text:null,color:"black"}),r.signatureDialogSettings||(r.signatureDialogSettings={displayMode:DCt.Draw|DCt.Text|DCt.Upload,hideSaveSignature:!1}),s.initialIndicatorSettings||(s.initialIndicatorSettings={opacity:1,backgroundColor:"orange",width:19,height:10,fontSize:10,text:null,color:"black"}),s.initialDialogSettings||(s.initialDialogSettings={displayMode:DCt.Draw|DCt.Text|DCt.Upload,hideSaveSignature:!1}),r=t.isInitialField?t.signatureIndicatorSettings||s.initialIndicatorSettings:t.signatureIndicatorSettings||r.signatureIndicatorSettings,19===this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.width?t.isInitialField?30:25:this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.width),a=r.width||(t.signatureIndicatorSettings&&t.signatureIndicatorSettings.width?t.signatureIndicatorSettings.width:a),l=10===this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.height?13:this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.height,l=r.height||(t.signatureIndicatorSettings&&t.signatureIndicatorSettings.height?t.signatureIndicatorSettings.height:l),h=r.backgroundColor?"orange"===r.backgroundColor?"#FFE48559":r.backgroundColor:t.signatureIndicatorSettings&&t.signatureIndicatorSettings.backgroundColor?t.signatureIndicatorSettings.backgroundColor:"#FFE48559",d=(t.bounds||i).width,i=(t.bounds||i).height,p=i/2<l?i/2:l,c=d/2<a?d/2:a,u=10,u=t.signatureIndicatorSettings&&t.signatureIndicatorSettings.fontSize?t.signatureIndicatorSettings.fontSize>p/2?10:t.signatureIndicatorSettings.fontSize:this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.fontSize>p/2?10:this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.fontSize,g=Q("span"),s=(s.initialIndicatorSettings||(s.initialIndicatorSettings={opacity:1,backgroundColor:"orange",width:19,height:10,fontSize:10,text:null,color:"black"}),s.initialDialogSettings||(s.initialDialogSettings={displayMode:DCt.Draw|DCt.Text|DCt.Upload,hideSaveSignature:!1}),t.signatureIndicatorSettings?t.signatureIndicatorSettings.text:null),s=("InitialField"===t.formFieldAnnotationType?(g.id="initialIcon_"+t.pageIndex+"_"+this.setFormFieldIdIndex(),g.style.fontFamily="Helvetica",this.setIndicatorText(g,s,this.pdfViewer.initialFieldSettings.initialIndicatorSettings.text,"Initial")):(g.style.height="",g.style.width="",g.id="signIcon_"+t.pageIndex+"_"+this.setFormFieldIdIndex(),g.style.fontFamily="Helvetica",this.setIndicatorText(g,s,this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings.text,"Sign")),g.style.overflow="hidden",g.style.whiteSpace="nowrap",g.style.padding="2px 3px 2px 1px",g.style.boxSizing="border-box",this.pdfViewerBase.getZoomFactor()),m=(g.style.textAlign="left",g.style.fontSize=u*s+"px",this.getBounds(g)),h=(g.style.backgroundColor=h,g.style.color=r.color,g.style.opacity=r.opacity,g.style.height=l,g.style.width=a,g.style.position="absolute",this.setHeightWidth(d,c,m.width+u,s)),r=(g.style.width=h+"px",this.setHeightWidth(i,p,m.height,s));return g.style.height=r+"px",s<1&&(l=parseInt(g.style.height,10),g.style.fontSize=l-this.signIndicatorPadding<this.signIndicatorMinimunFontSize?this.signIndicatorMinimunFontSize+"px":l-this.signIndicatorPadding+"px"),n||o.appendChild(g),this.updateSignInitialFieldProperties(t,t.isInitialField,this.pdfViewer.isFormDesignerToolbarVisible,this.isSetFormFieldMode),je(t.tooltip)||""===t.tooltip||this.setToolTip(t.tooltip,o.firstElementChild),this.updateSignatureFieldProperties(t,o,n),o},Q2t.prototype.setIndicatorText=function(e,t,i,n){e.innerHTML=t||i||n},Q2t.prototype.getBounds=function(e){e=e.cloneNode(!0);e.style.height="",e.style.width="",e.id=e.id+"_clonedElement",document.body.appendChild(e);var t=document.getElementById(e.id).getBoundingClientRect();return document.body.removeChild(e),t},Q2t.prototype.updateSignatureandInitialIndicator=function(e,t,i){var n,o,r,s,a,l,h;if(null!==i)return n=i.getBoundingClientRect(),o=this.pdfViewerBase.getZoomFactor(),r=i.nextElementSibling,a=s=void 0,"SignatureField"===e.formFieldAnnotationType&&(s=e.signatureIndicatorSettings,a=t.signatureIndicatorSettings),"InitialField"===e.formFieldAnnotationType&&(s=e.signatureIndicatorSettings||this.pdfViewer.initialFieldSettings.initialIndicatorSettings,a=t.initialIndicatorSettings),r.style.width="",r.style.height="",a&&s&&(void 0!==a.text&&(this.setIndicatorText(r,a.text,a.text,"Sign"),s.text=a.text),a.fontSize&&(r.style.fontSize=a.fontSize>e.height/2?10:a.fontSize*o+"px",s.fontSize=a.fontSize),l=this.getBounds(r),a.color&&(r.style.color=a.color,s.color=this.nameToHash(a.color)),a.backgroundColor&&(r.style.backgroundColor=a.backgroundColor,s.backgroundColor=this.nameToHash(a.backgroundColor)),je(a.opacity)||(r.style.opacity=a.opacity,s.opacity=a.opacity),(a.width||t.width||a.text)&&(h=this.setHeightWidth(n.width,a.width,l.width,o),r.style.width=h+"px",s.width=h),a.height||t.height||a.text)&&(h=this.setHeightWidth(n.height,a.height,l.height,o),r.style.height=h+"px",s.height=h),this.updateSignatureFieldProperties(e,i,e.isPrint),e.signatureIndicatorSettings&&s&&(e.signatureIndicatorSettings=s),e},Q2t.prototype.setHeightWidth=function(e,t,i,n){t=t<e/2&&i<t?t*n:i<=e/2?i*n:e/2*n;return t},Q2t.prototype.createDropDownList=function(e,t,i){var n=Q("div"),o=(n.className="foreign-object",n.style.position="absolute",n.style.width="100%",n.style.height="100%",n.style.backgroundColor=t.backgroundColor,document.createElement("select")),r=(o.addEventListener("change",this.dropdownChange.bind(this)),o.addEventListener("focus",this.focusFormFields.bind(this)),o.addEventListener("blur",this.blurFormFields.bind(this)),o.id=t.id,o.name="editabledropdown"+this.pdfViewerBase.activeElements.activePageID+e.id,o.setAttribute("aria-label","editabledropdown"+this.pdfViewerBase.activeElements.activePageID+e.id),o.className="e-pv-formfield-dropdown",o.style.width="100%",o.style.height="100%",o.style.position="absolute",this.updateDropdownFieldSettingsProperties(t,this.pdfViewer.isFormDesignerToolbarVisible,this.isSetFormFieldMode),t.options||[]);this.updateDropdownListProperties(t,o,i);for(var s=0;s<r.length;s++){var a=document.createElement("option");a.className="e-pv-formfield-dropdown",a.value=r[parseInt(s.toString(),10)].itemValue,a.text=r[parseInt(s.toString(),10)].itemName,this.updateDropdownListProperties(t,a),o.appendChild(a)}return je(t.selectedIndex)||0===t.selectedIndex.length?o.selectedIndex=-1:o.selectedIndex=je(t.selectedIndex)?0:t.selectedIndex,n.appendChild(o),je(t.tooltip)||""===t.tooltip||this.setToolTip(t.tooltip,n.firstElementChild),n},Q2t.prototype.createListBox=function(e,t,i){var n=Q("div"),o=(n.className="foreign-object",n.style.position="absolute",n.style.width="100%",n.style.height="100%",n.style.backgroundColor=t.backgroundColor,document.createElement("select")),r=(o.addEventListener("click",this.listBoxChange.bind(this)),o.addEventListener("focus",this.focusFormFields.bind(this)),o.addEventListener("blur",this.blurFormFields.bind(this)),o.id=t.id,o.name="editabledropdown"+this.pdfViewerBase.activeElements.activePageID+e.id,o.setAttribute("aria-label","editabledropdown"+this.pdfViewerBase.activeElements.activePageID+e.id),o.className="e-pv-formfield-listbox",o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.multiple=!0,this.updatelistBoxFieldSettingsProperties(t,this.pdfViewer.isFormDesignerToolbarVisible,this.isSetFormFieldMode),t.options||[]);this.updateListBoxProperties(t,o,i);for(var s=0;s<r.length;s++){var a=document.createElement("option");if(a.className="e-pv-formfield-listbox",a.value=r[parseInt(s.toString(),10)].itemValue,a.text=r[parseInt(s.toString(),10)].itemName,!je(t.selectedIndex))for(var l=0;l<t.selectedIndex.length;l++)s===t.selectedIndex[parseInt(l.toString(),10)]&&(a.selected=!0);o.appendChild(a)}return n.appendChild(o),je(t.tooltip)||""===t.tooltip||this.setToolTip(t.tooltip,n.firstElementChild),n},Q2t.prototype.createInputElement=function(e,t,i,n){var o,r,s,a,l,h=this.pdfViewerBase.getZoomFactor(),d=Q("div"),p=(d.className="foreign-object",d.style.position="absolute",d.style.width="100%",d.style.height="100%",Q("input")),c=Q("textarea");return p.id=t.id,p.setAttribute("aria-label",this.pdfViewer.element.id+"formfilldesigner"),p.style.position="absolute","Textbox"===e?t.isMultiline?(c=this.createTextAreaElement(p.id),this.updateTextFieldSettingProperties(t,this.pdfViewer.isFormDesignerToolbarVisible,this.isSetFormFieldMode),this.updateTextboxProperties(t,c,n)):(p=this.createTextboxElement(p.id),this.updateTextFieldSettingProperties(t,this.pdfViewer.isFormDesignerToolbarVisible,this.isSetFormFieldMode),this.updateTextboxProperties(t,p,n)):"Checkbox"===e?(s=n?this.defaultZoomValue:this.pdfViewerBase.getZoomFactor(),d.style.display="flex",d.style.alignItems="center",l=this.getCheckboxRadioButtonBounds(t,i,n),d.style.display=l.display,(o=Q("label",{className:"e-pv-checkbox-container"})).style.width=t.bounds?t.bounds.width*s+"px":l.width+"px",o.style.height=t.bounds?t.bounds.height*s+"px":l.height+"px",this.isDrawHelper?o.style.cursor="crosshair":o.style.cursor="pointer",s=Q("div",{className:"e-pv-checkbox-div"}),F.isDevice||(s.addEventListener("click",this.setCheckBoxState.bind(this)),s.addEventListener("focus",this.focusFormFields.bind(this)),s.addEventListener("blur",this.blurFormFields.bind(this))),s.id=t.id+"_input",(r=t.isChecked?Q("span",{className:"e-pv-checkbox-span e-pv-cb-checked"}):Q("span",{className:"e-pv-checkbox-span e-pv-cb-unchecked"})).id=t.id+"_input_span",o.id=t.id+"_input_label",r.style.width=l.width/5+"px",r.style.height=l.height/2.5+"px",r.style.left=l.width/2.5+"px",r.style.top=l.height/5+"px",-1!==r.className.indexOf("e-pv-cb-checked")&&(a=parseInt(o.style.width,10),r.style.borderWidth=20<a?"3px":a<=15?"1px":"2px"),n&&(s.style.backgroundColor="rgb(218, 234, 247)",s.style.border="1px solid #303030",s.style.visibility="visible",s.style.height="100%",s.style.width="100%",s.style.position="absolute",-1!==r.className.indexOf("e-pv-cb-checked"))&&(r.style.border="solid #303030",r.style.position="absolute",r.style.borderLeft="transparent",r.style.borderTop="transparent",r.style.transform="rotate(45deg)",a=parseInt(o.style.width,10),r.style.borderWidth=20<a?"3px":a<=15?"1px":"2px"),p.type="checkbox",p.style.margin="0px",p.style.width=l.width+"px",p.style.height=l.height+"px",n||this.updateCheckBoxFieldSettingsProperties(t,this.pdfViewer.isFormDesignerToolbarVisible,this.isSetFormFieldMode),this.updateCheckboxProperties(t,s),p.appendChild(o),o.appendChild(s),s.appendChild(r),n&&(p.style.outlineWidth=t.thickness+"px",p.style.outlineColor=t.borderColor,p.style.outlineStyle="solid",p.style.background=t.backgroundColor)):"PasswordField"===e?(p.type="password",p.className="e-pv-formfield-input",p.style.width="100%",p.style.height="100%",p.style.borderStyle="solid",p.addEventListener("click",this.inputElementClick.bind(this)),p.addEventListener("focus",this.focusFormFields.bind(this)),p.addEventListener("blur",this.blurFormFields.bind(this)),p.addEventListener("change",this.getTextboxValue.bind(this)),this.updatePasswordFieldSettingProperties(t,this.pdfViewer.isFormDesignerToolbarVisible,this.isSetFormFieldMode),this.updatePasswordFieldProperties(t,p,n)):(d.style.display="flex",d.style.alignItems="center",l=this.getCheckboxRadioButtonBounds(t,i,n),d.style.display=l.display,(o=Q("label",{className:"e-pv-radiobtn-container"})).style.width=l.width+"px",o.style.height=l.height+"px",o.style.display="table",o.style.verticalAlign="middle",o.style.borderWidth=t.thickness+"px",o.style.boxShadow=t.borderColor+" 0px 0px 0px "+t.thickness+"px",o.style.borderRadius="50%",o.style.visibility=t.visibility,this.isDrawHelper?o.style.cursor="crosshair":o.style.cursor="pointer",o.style.background=t.backgroundColor,(r=Q("span",{className:"e-pv-radiobtn-span"})).id=t.id+"_input_span",r.style.width=Math.floor(l.width/2)+"px",r.style.height=Math.floor(l.height/2)+"px",h<1&&l.width<=20&&l.height<=20?r.style.margin=Math.round(parseInt(o.style.width,10)/3.5)+"px":r.style.margin=Math.round(parseInt(o.style.width,10)/4)+"px",o.addEventListener("click",this.setRadioButtonState.bind(this)),o.id=t.id+"_input_label",p.type="radio",n||(p.className="e-pv-radio-btn"),p.style.margin="0px",p.addEventListener("click",function(e){e.stopPropagation()}),p.addEventListener("focus",this.focusFormFields.bind(this)),p.addEventListener("blur",this.blurFormFields.bind(this)),p.style.width=l.width+"px",p.style.height=l.height+"px",this.updateRadioButtonFieldSettingProperties(t,this.pdfViewer.isFormDesignerToolbarVisible,this.isSetFormFieldMode),this.updateRadioButtonProperties(t,p,o),o.appendChild(p),o.appendChild(r),t.isRequired&&(o.style.boxShadow="red 0px 0px 0px "+t.thickness+"px")),!("Checkbox"!==e&&"RadioButton"!==e||n)||"Checkbox"===e&&n?d.appendChild(o):t.isMultiline?d.appendChild(c):d.appendChild(p),je(t.tooltip)||""===t.tooltip||("RadioButton"===e?this.setToolTip(t.tooltip,o):"Textbox"===e||"PasswordField"===e?this.setToolTip(t.tooltip,d.firstElementChild):"Checkbox"===e&&this.setToolTip(t.tooltip,d.firstElementChild.lastElementChild)),this.isDrawHelper=!1,d},Q2t.prototype.listBoxChange=function(a){for(var e=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),l=JSON.parse(e),h=null,d=this,t=0;t<l.length;t++)!function(t){if(l[parseInt(t.toString(),10)].Key.split("_")[0]===a.currentTarget.id.split("_")[0]||d.pdfViewer.nameTable[a.currentTarget.id.split("_")[0]].name===l[parseInt(t.toString(),10)].FormField.name){if(l[parseInt(t.toString(),10)].Key.split("_")[0]!==a.currentTarget.id.split("_")[0])for(var e=document.getElementById(l[parseInt(t.toString(),10)].Key.split("_")[0]+"_content_html_element").firstElementChild.firstElementChild,i=0;i<a.currentTarget.options.length;i++)e.options[parseInt(i.toString(),10)].selected=a.currentTarget.options[parseInt(i.toString(),10)].selected;l[parseInt(t.toString(),10)].FormField.selectedIndex=[];for(var n=d.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.selectedIndex,o=0;o<a.currentTarget.selectedOptions.length;o++){var r=a.currentTarget.selectedOptions[parseInt(o.toString(),10)].index,s=0,s=(d.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.selectedIndex&&0!==d.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.selectedIndex.length&&(0<=d.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.selectedIndex[0]&&(s=d.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.selectedIndex.pop()),d.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.selectedIndex.push(s)),l[parseInt(t.toString(),10)].FormField.option[parseInt(s.toString(),10)].itemValue),r=(l[parseInt(t.toString(),10)].FormField.selectedIndex.push(r),d.pdfViewer.nameTable[l[parseInt(t.toString(),10)].Key.split("_")[0]].selectedIndex=l[parseInt(t.toString(),10)].FormField.selectedIndex,d.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.selectedIndex=l[parseInt(t.toString(),10)].FormField.selectedIndex,l[parseInt(t.toString(),10)].FormField.option[parseInt(r.toString(),10)].itemValue);d.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.value=r,d.updateFormFieldCollections(d.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField),h=d.pdfViewer.formFieldCollections[d.pdfViewer.formFieldCollections.findIndex(function(e){return e.id+"_content"===l[parseInt(t.toString(),10)].FormField.id})],d.pdfViewer.fireFormFieldPropertiesChangeEvent("formFieldPropertiesChange",l[parseInt(t.toString(),10)].FormField,d.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.pageNumber,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,s,r)}d.pdfViewer.annotation&&d.pdfViewer.annotation.addAction(d.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.pageNumber,null,d.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField,"FormField Value Change","",n,d.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.selectedIndex)}}(t);this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner"),this.updateFormFieldSessions(h)},Q2t.prototype.dropdownChange=function(r){for(var e=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),s=JSON.parse(e),a=null,l=this,t=0;t<s.length;t++)!function(t){var e,i,n,o;s[parseInt(t.toString(),10)].Key.split("_")[0]!==r.target.id.split("_")[0]&&l.pdfViewer.nameTable[r.target.id.split("_")[0]].name!==s[parseInt(t.toString(),10)].FormField.name||(l.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.selectedIndex=[],e=document.getElementById(r.currentTarget.id).selectedIndex,(i=0)!==s[parseInt(t.toString(),10)].FormField.selectedIndex.length&&(i=s[parseInt(t.toString(),10)].FormField.selectedIndex.pop(),s[parseInt(t.toString(),10)].FormField.selectedIndex.push(i)),n=s[parseInt(t.toString(),10)].FormField.option[parseInt(i.toString(),10)].itemValue,l.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.selectedIndex.push(e),s[parseInt(t.toString(),10)].FormField.selectedIndex=l.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.selectedIndex,l.pdfViewer.nameTable[s[parseInt(t.toString(),10)].Key.split("_")[0]].selectedIndex=l.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.selectedIndex,o=s[parseInt(t.toString(),10)].FormField.option[parseInt(e.toString(),10)].itemValue,l.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.value=o,s[parseInt(t.toString(),10)].Key.split("_")[0]!==r.target.id.split("_")[0]&&(document.getElementById(s[parseInt(t.toString(),10)].Key.split("_")[0]+"_content_html_element").firstElementChild.firstElementChild.selectedIndex=e),l.updateFormFieldCollections(l.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField),a=l.pdfViewer.formFieldCollections[l.pdfViewer.formFieldCollections.findIndex(function(e){return e.id+"_content"===s[parseInt(t.toString(),10)].FormField.id})],l.pdfViewer.fireFormFieldPropertiesChangeEvent("formFieldPropertiesChange",s[parseInt(t.toString(),10)].FormField,l.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.pageNumber,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,n,o),l.pdfViewer.annotation&&l.pdfViewer.annotation.addAction(l.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.pageNumber,null,l.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField,"FormField Value Change","",i,e))}(t);this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner"),this.updateFormFieldSessions(a)},Q2t.prototype.setCheckBoxState=function(n){if((!F.isDevice||(n.target.classList.contains("")||n.target.classList.contains("e-pv-checkbox-outer-div")||n.target.classList.contains("e-pv-checkbox-div"))&&n.currentTarget.classList.contains("e-pv-checkbox-outer-div"))&&!this.pdfViewer.designerMode){var o=!1,e=void 0,r=null,e=F.isDevice?document.getElementById(n.target.id.split("_")[0]+"_input"):n.target;if("undefined_input"!==n.target.id&&!this.pdfViewer.nameTable[n.target.id.split("_")[0]].isReadonly&&!this.pdfViewer.designerMode){for(var t,o=e&&e.firstElementChild&&"e-pv-checkbox-span e-pv-cb-checked"===e.firstElementChild.className?(e.firstElementChild.classList.remove("e-pv-cb-checked"),e.firstElementChild.classList.add("e-pv-checkbox-span","e-pv-cb-unchecked"),!1):"e-pv-checkbox-span e-pv-cb-checked"===e.className?(e.classList.remove("e-pv-cb-checked"),e.classList.add("e-pv-checkbox-span","e-pv-cb-unchecked"),!1):(e.firstElementChild.classList.remove("e-pv-cb-unchecked"),e.firstElementChild.classList.add("e-pv-checkbox-span","e-pv-cb-checked"),!0),i=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),s=(o&&-1!==e.firstElementChild.className.indexOf("e-pv-cb-checked")&&(t=parseInt(n.target.parentElement.style.width,10),e.firstElementChild.style.borderWidth=20<t?"3px":t<=15?"1px":"2px"),JSON.parse(i)),a=this,l=0;l<s.length;l++)!function(t){var e,i;s[parseInt(t.toString(),10)].Key.split("_")[0]!==n.target.id.split("_")[0]&&a.pdfViewer.nameTable[n.target.id.split("_")[0]].name!==s[parseInt(t.toString(),10)].FormField.name||(a.pdfViewer.nameTable[s[parseInt(t.toString(),10)].Key.split("_")[0]].isChecked=o,e=a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.isChecked,s[parseInt(t.toString(),10)].FormField.isChecked=o,a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.isChecked=s[parseInt(t.toString(),10)].FormField.isChecked,s[parseInt(t.toString(),10)].Key.split("_")[0]!==n.target.id.split("_")[0]&&(i=document.getElementById(s[parseInt(t.toString(),10)].Key.split("_")[0]+"_input").firstElementChild,o?(i.classList.contains("e-pv-cb-unchecked")&&i.classList.remove("e-pv-cb-unchecked"),i.classList.add("e-pv-cb-checked")):(i.classList.contains("e-pv-cb-checked")&&i.classList.remove("e-pv-cb-checked"),i.classList.add("e-pv-cb-unchecked"))),a.updateFormFieldCollections(a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField),r=a.pdfViewer.formFieldCollections[a.pdfViewer.formFieldCollections.findIndex(function(e){return e.id+"_content"===s[parseInt(t.toString(),10)].FormField.id})],a.pdfViewer.fireFormFieldPropertiesChangeEvent("formFieldPropertiesChange",s[parseInt(t.toString(),10)].FormField,a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.pageNumber,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,e,o),a.pdfViewer.annotation&&a.pdfViewer.annotation.addAction(a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.pageNumber,null,a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField,"FormField Value Change","",e,o))}(l);this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner"),this.updateFormFieldSessions(r)}}},Q2t.prototype.setCheckedValue=function(e,t){t?(e.firstElementChild.classList.remove("e-pv-cb-unchecked"),e.firstElementChild.classList.add("e-pv-checkbox-span","e-pv-cb-checked")):(e.firstElementChild.classList.remove("e-pv-cb-checked"),e.firstElementChild.classList.add("e-pv-checkbox-span","e-pv-cb-unchecked"))},Q2t.prototype.setRadioButtonState=function(o){for(var e=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),r=JSON.parse(e),s=null,a=this,t=0;t<r.length;t++)!function(t){if(null!=r[parseInt(t.toString(),10)].FormField.radiobuttonItem){for(var e=void 0,i=void 0,n=0;n<r[parseInt(t.toString(),10)].FormField.radiobuttonItem.length;n++)r[parseInt(t.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)].id.split("_")[0]===o.currentTarget.id.split("_")[0]?a.pdfViewer.nameTable[o.currentTarget.id.split("_")[0]].isReadonly||(a.pdfViewer.nameTable[o.currentTarget.id.split("_")[0]].isSelected=!0,r[parseInt(t.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)].isSelected=!0,a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)].isSelected||(e=a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)]),a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)].isSelected=!0,a.pdfViewer.fireFormFieldPropertiesChangeEvent("formFieldPropertiesChange",r[parseInt(t.toString(),10)].FormField,a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.pageNumber,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0)):a.pdfViewer.nameTable[o.currentTarget.id.split("_")[0]].name===r[parseInt(t.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)].name&&(a.pdfViewer.nameTable[r[parseInt(t.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)].id.split("_")[0]].isSelected=!1,a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)].isSelected,r[parseInt(t.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)].isSelected=!1,a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)].isSelected&&(i=a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)]),a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)].isSelected=r[parseInt(t.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)].isSelected,a.pdfViewer.fireFormFieldPropertiesChangeEvent("formFieldPropertiesChange",r[parseInt(t.toString(),10)].FormField,a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.pageNumber,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!0,!1)),a.updateFormFieldCollections(a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)]),s=a.pdfViewer.formFieldCollections[a.pdfViewer.formFieldCollections.findIndex(function(e){return e.id+"_content"===r[parseInt(t.toString(),10)].FormField.id})];null==e&&null==i||!a.pdfViewer.annotation||a.pdfViewer.annotation.addAction(a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.pageNumber,null,a.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField,"FormField Value Change","",e,i)}}(t);this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner"),this.updateFormFieldSessions(s)},Q2t.prototype.getTextboxValue=function(n){for(var e=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),o=JSON.parse(e),r=null,s=this,t=0;t<o.length;t++)!function(t){var e,i;o[parseInt(t.toString(),10)].Key.split("_")[0]!==n.target.id.split("_")[0]&&s.pdfViewer.nameTable[n.target.id.split("_")[0]].name!==o[parseInt(t.toString(),10)].FormField.name||(e=s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.value,o[parseInt(t.toString(),10)].FormField.value=n.target.value,s.pdfViewer.enableHtmlSanitizer&&(o[parseInt(t.toString(),10)].FormField.value=go.sanitize(o[parseInt(t.toString(),10)].FormField.value)),s.pdfViewer.nameTable[o[parseInt(t.toString(),10)].Key.split("_")[0]].value=o[parseInt(t.toString(),10)].FormField.value,s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.value=o[parseInt(t.toString(),10)].FormField.value,o[parseInt(t.toString(),10)].Key.split("_")[0]!==n.target.id.split("_")[0]&&(i=document.getElementById(o[parseInt(t.toString(),10)].Key.split("_")[0]+"_content_html_element"))&&i.firstElementChild&&i.firstElementChild.firstElementChild&&(i.firstElementChild.firstElementChild.value=o[parseInt(t.toString(),10)].FormField.value),s.updateFormFieldCollections(s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField),r=s.pdfViewer.formFieldCollections[s.pdfViewer.formFieldCollections.findIndex(function(e){return e.id+"_content"===o[parseInt(t.toString(),10)].FormField.id})],s.pdfViewer.fireFormFieldPropertiesChangeEvent("formFieldPropertiesChange",s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField,s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.pageNumber,!0,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,e,n.target.value),s.pdfViewer.annotation&&s.pdfViewer.annotation.addAction(s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.pageNumber,null,s.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField,"FormField Value Change","",e,n.target.value))}(t);this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner"),this.updateFormFieldSessions(r)},Q2t.prototype.inputElementClick=function(e){e.target.focus()},Q2t.prototype.updateFormFieldSessions=function(e){var t=this.pdfViewerBase.getItemFromSessionStorage("_formfields"),i=JSON.parse(t);if(!je(i)&&!je(e)){for(var n=0;n<i.length;n++)i[parseInt(n.toString(),10)].ActualFieldName===e.name&&("Textbox"===e.type||"PasswordField"===e.type?i[parseInt(n.toString(),10)].Value=e.value:"Checkbox"===e.type?i[parseInt(n.toString(),10)].Selected=e.isChecked:"RadioButton"===e.type?i[parseInt(n.toString(),10)].Selected=e.isSelected:"DropdownList"!==e.type&&"ListBox"!==e.type||(i[parseInt(n.toString(),10)].Value=e.value));this.pdfViewerBase.setItemInSessionStorage(i,"_formfields")}},Q2t.prototype.focusFormFields=function(e){var t,e=e.target;!e&&"e-pv-checkbox-outer-div"!==e.className||(t="transparent"===e.style.borderColor?"#000000":e.style.borderColor,e.style.boxShadow="0 0 5px "+t),!e||"e-pv-radiobtn-container"!==e.className&&"e-pv-radio-btn"!==e.className&&"e-pv-radiobtn-span"!==e.className||"transparent"!==e.style.borderColor||(t="transparent"===e.style.borderColor?"#000000":e.style.borderColor,e.parentElement.style.boxShadow="0px 0px 5px "+t),!e||"e-pv-radiobtn-container"!==e.className&&"e-pv-radio-btn"!==e.className&&"e-pv-radiobtn-span"!==e.className||(e.parentElement.style.boxShadow=e.style.borderColor+"0px 0px 5px "+e.style.borderWidth)},Q2t.prototype.blurFormFields=function(e){var t,e=e.target;e.style.boxShadow="","radio"===e.type&&"transparent"===e.style.borderColor&&(t="transparent"===e.style.borderColor?"#000000":e.style.borderColor,e.parentElement.style.boxShadow="0px 0px 0px "+t),"radio"===e.type&&(e.parentElement.style.boxShadow=e.style.borderColor+"0px 0px 0px "+e.style.borderWidth)},Q2t.prototype.setTextBoxFontStyle=function(e){return{isBold:(e&ACt.Bold)===ACt.Bold,isItalic:(e&ACt.Italic)===ACt.Italic,isStrikeout:(e&ACt.Strikethrough)===ACt.Strikethrough,isUnderline:(e&ACt.Underline)===ACt.Underline}},Q2t.prototype.addFormField=function(e,t,i,n){return this.addField(e,t,i,n,!0)},Q2t.prototype.addField=function(e,t,i,n,o){var r={thickness:1,bounds:{x:t.bounds.X,y:t.bounds.Y,width:t.bounds.Width,height:t.bounds.Height},fontFamily:je(t.fontFamily)?"Helvetica":t.fontFamily,fontSize:je(t.fontSize)?10:t.fontSize,color:je(t.color)?"black":t.color,backgroundColor:je(t.backgroundColor)?"#daeaf7ff":t.backgroundColor,alignment:je(t.alignment)?"left":t.alignment,isReadonly:t.isReadOnly||!1,rotateAngle:t.rotateAngle||t.rotationAngle,isTransparent:t.isTransparent,insertSpaces:t.insertSpaces,isChecked:t.isChecked,isMultiline:t.isMultiline,isSelected:t.isSelected,options:t.options,selectedIndex:t.selectedIndex,signatureIndicatorSettings:t.signatureIndicatorSettings,signatureType:t.signatureType,zIndex:t.zIndex};switch(r.customData=je(t.customData)?"":t.customData,r.fontStyle=je(t.fontStyle)?"None":t.fontStyle,r.visibility=je(t.visibility)?"visible":t.visibility,r.value=je(t.value)?"":t.value,r.isRequired=t.isRequired||!1,r.isPrint=t.isPrint||!0,r.pageNumber=je(t.pageNumber)?this.pdfViewerBase.currentPageNumber:t.pageNumber,r.pageIndex=r.pageNumber-1,r.font=t.font,r.id=n,(i||je(i))&&this.setFormFieldIndex(),e){case"Textbox":r.formFieldAnnotationType=e,r.isMultiline=t.isMultiline,r.name=je(t.name)?"Textbox"+this.formFieldIndex:t.name,r.insertSpaces=t.insertSpaces,r.maxLength=t.maxLength,r.thickness=je(t.thickness)?1:t.thickness,r.borderColor=je(t.borderColor)?"#303030":t.borderColor,t.font?r.font=t.font:this.pdfViewer.textFieldSettings.fontStyle&&(r.font=this.setTextBoxFontStyle(this.pdfViewer.textFieldSettings.fontStyle));break;case"Password":r.formFieldAnnotationType="PasswordField",r.name=je(t.name)?"Password"+this.formFieldIndex:t.name,r.maxLength=t.maxLength,r.thickness=je(t.thickness)?1:t.thickness,r.borderColor=je(t.borderColor)?"#303030":t.borderColor;break;case"DropDown":r.formFieldAnnotationType="DropdownList",r.name=je(t.name)?"Dropdown"+this.formFieldIndex:t.name,r.options=t.options||[];for(var s=0;s<this.pdfViewer.formFieldCollection.length;s++)if("DropdownList"===(a=this.pdfViewer.formFieldCollection[parseInt(s.toString(),10)]).formFieldAnnotationType&&a.name===r.name){r.options=a.options;break}r.selectedIndex=je(t.selectedIndex)?[0]:t.selectedIndex,r.thickness=je(t.thickness)?1:t.thickness,r.borderColor=je(t.borderColor)?"#303030":t.borderColor,t.font?r.font=t.font:this.pdfViewer.DropdownFieldSettings.fontStyle&&(r.font=this.setTextBoxFontStyle(this.pdfViewer.DropdownFieldSettings.fontStyle));break;case"ListBox":r.formFieldAnnotationType=e,r.name=je(t.name)?"List Box"+this.formFieldIndex:t.name,r.options=t.options||[];for(var a,s=0;s<this.pdfViewer.formFieldCollection.length;s++)if((a=this.pdfViewer.formFieldCollection[parseInt(s.toString(),10)]).formFieldAnnotationType===e&&a.name===r.name){r.options=a.options;break}r.selectedIndex=t.selectedIndex,r.thickness=je(t.thickness)?1:t.thickness,r.borderColor=je(t.borderColor)?"#303030":t.borderColor,t.font?r.font=t.font:this.pdfViewer.listBoxFieldSettings.fontStyle&&(r.font=this.setTextBoxFontStyle(this.pdfViewer.listBoxFieldSettings.fontStyle));break;case"CheckBox":r.formFieldAnnotationType="Checkbox",r.bounds={x:t.bounds.X,y:t.bounds.Y,width:t.bounds.Width,height:t.bounds.Height},r.backgroundColor=je(t.backgroundColor)?"#daeaf7ff":t.backgroundColor,r.isReadonly=t.isReadOnly||!1,r.name=je(t.name)?"Check Box"+this.formFieldIndex:t.name,r.isChecked=t.isChecked||!1,r.visibility=t.visibility||"visible",r.isRequired=t.isRequired||!1,r.thickness=je(t.thickness)?1:t.thickness,r.borderColor=je(t.borderColor)?"#303030":t.borderColor;break;case"RadioButton":r.formFieldAnnotationType=e,r.bounds={x:t.bounds.X,y:t.bounds.Y,width:t.bounds.Width,height:t.bounds.Height},r.backgroundColor=je(t.backgroundColor)?"#daeaf7ff":t.backgroundColor,r.isReadonly=t.isReadOnly||!1,r.name=je(t.name)?"Radio Button"+this.formFieldIndex:t.name,r.isSelected=t.isSelected||!1,r.visibility=t.visibility||"visible",r.isRequired=t.isRequired||!1,r.thickness=je(t.thickness)?1:t.thickness,r.borderColor=je(t.borderColor)?"#303030":t.borderColor;break;case"SignatureField":r.formFieldAnnotationType=e,r.bounds={x:t.bounds.X,y:t.bounds.Y,width:t.bounds.Width,height:t.bounds.Height},r.isReadonly=this.pdfViewer.signatureFieldSettings.isReadOnly||t.isReadOnly||!1,r.backgroundColor=je(t.backgroundColor)?r.isReadonly?"trasnparent":"#daeaf7ff":mRt.setTransparencyToHex(this.colorNametoHashValue(t.backgroundColor)),r.borderColor=je(t.borderColor)?"#303030":t.borderColor,r.fontSize=je(t.fontSize)?10:t.fontSize,r.fontStyle=je(t.fontStyle)?"None":t.fontStyle,r.name=je(t.name)?"Signature"+this.formFieldIndex:t.name,r.isRequired=t.isRequired||!1,r.thickness=je(t.thickness)?1:t.thickness;var l=t.signatureIndicatorSettings||t.initialIndicatorSettings;r.signatureIndicatorSettings=l?{opacity:l.opacity||1,backgroundColor:l.backgroundColor||"orange",width:l.width||19,height:l.height||10,fontSize:l.fontSize||10,text:l.text||null,color:l.color||"black"}:null;break;case"InitialField":r.formFieldAnnotationType=e,r.bounds={x:t.bounds.X,y:t.bounds.Y,width:t.bounds.Width,height:t.bounds.Height},r.isReadonly=this.pdfViewer.initialFieldSettings.isReadOnly||t.isReadOnly||!1,r.backgroundColor=je(t.backgroundColor)?r.isReadonly?"trasnparent":"#daeaf7ff":mRt.setTransparencyToHex(this.colorNametoHashValue(t.backgroundColor)),r.borderColor=je(t.borderColor)?"#303030":t.borderColor,r.fontSize=je(t.fontSize)?10:t.fontSize,r.thickness=je(t.thickness)?1:t.thickness,r.fontStyle=je(t.fontStyle)?"None":t.fontStyle,r.name=je(t.name)?"Initial"+this.formFieldIndex:t.name,r.isRequired=t.isRequired||!1,r.isInitialField=!0;l=t.initialIndicatorSettings||t.signatureIndicatorSettings;r.signatureIndicatorSettings=l?{opacity:l.opacity||1,backgroundColor:l.backgroundColor||"orange",width:l.width||19,height:l.height||10,fontSize:l.fontSize||10,text:l.text||null,color:l.color||"black"}:null}r.tooltip=je(t.tooltip)?"":t.tooltip,this.setFormFieldIndex();n=null;return i?this.addFieldCollection(r):n=this.drawFormField(r,o),n},Q2t.prototype.addFieldCollection=function(e){e={id:kvt(),name:e.name,value:e.value,type:e.formFieldAnnotationType,isReadOnly:e.isReadonly,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,color:e.color,backgroundColor:e.backgroundColor,isMultiline:e.isMultiline,alignment:e.alignment,visibility:e.visibility,maxLength:e.maxLength,isRequired:e.isRequired,isPrint:e.isPrint,isSelected:e.isSelected,insertSpaces:e.insertSpaces,isChecked:e.isChecked,tooltip:e.tooltip,bounds:e.bounds,thickness:e.thickness,pageIndex:e.pageIndex,borderColor:e.borderColor,signatureIndicatorSettings:e.signatureIndicatorSettings,rotateAngle:e.rotateAngle,isTransparent:e.isTransparent,options:e.options,selectedIndex:e.selectedIndex,signatureType:e.signatureType,zIndex:e.zIndex,pageNumber:e.pageNumber,customData:e.customData};this.pdfViewer.formFieldCollections.push(e)},Q2t.prototype.drawFormField=function(e,t){var i=this.pdfViewer.add(e),n=this.pdfViewer.formFieldCollections.findIndex(function(e){return e.id===i.id}),o=(-1<n&&(o=this.pdfViewer.formFieldCollections[parseInt(n.toString(),10)],this.isFormFieldUpdated)&&this.updateNodeBasedOnCollections(i,o),this.pdfViewer.formFieldCollection.findIndex(function(e){return e.id===i.id})),o=(o<0?this.pdfViewer.formFieldCollection.push(i):-1<o&&(this.pdfViewer.formFieldCollection[parseInt(o.toString(),10)]=i),{id:i.id,name:i.name,value:i.value,type:i.formFieldAnnotationType,isReadOnly:i.isReadonly,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,color:i.color,backgroundColor:i.backgroundColor,isMultiline:i.isMultiline,alignment:i.alignment,visibility:i.visibility,maxLength:i.maxLength,isRequired:i.isRequired,isPrint:i.isPrint,isSelected:i.isSelected,isChecked:i.isChecked,tooltip:i.tooltip,bounds:i.bounds,pageIndex:i.pageIndex,thickness:i.thickness,borderColor:i.borderColor,signatureIndicatorSettings:i.signatureIndicatorSettings,insertSpaces:i.insertSpaces,rotateAngle:i.rotateAngle,isTransparent:i.isTransparent,options:i.options,selectedIndex:i.selectedIndex,signatureType:i.signatureType,zIndex:i.zIndex,pageNumber:i.pageNumber,customData:i.customData});return-1<n?this.pdfViewer.formFieldCollections[parseInt(n.toString(),10)]=o:this.pdfViewer.formFieldCollections.push(o),this.drawHTMLContent(i.formFieldAnnotationType,i.wrapper.children[0],i,e.pageNumber-1,this.pdfViewer,null,t)},Q2t.prototype.updateNodeBasedOnCollections=function(e,t){e.name=t.name,e.value=t.value,e.isReadonly=t.isReadOnly,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle.toString(),e.color=t.color,e.backgroundColor=t.backgroundColor,e.alignment=t.alignment,e.visibility=t.visibility,e.maxLength=t.maxLength,e.isRequired=t.isRequired,e.isPrint=t.isPrint,e.isSelected=t.isSelected,e.isChecked=t.isChecked,e.tooltip=t.tooltip,e.thickness=t.thickness,e.borderColor=t.borderColor,e.customData=t.customData},Q2t.prototype.setFormFieldMode=function(e,t){this.pdfViewer.selectedItems&&!je(this.pdfViewer.selectedItems.annotations)&&0<this.pdfViewer.selectedItems.annotations.length&&this.pdfViewerBase.activeElements&&!je(this.pdfViewerBase.activeElements.activePageID)&&this.pdfViewer.clearSelection(this.pdfViewerBase.activeElements.activePageID);var i=document.getElementById("FormField_helper_html_element");switch(this.pdfViewer.isFormDesignerToolbarVisible&&i&&i.remove(),this.isAddFormFieldUi=!0,e){case"Textbox":this.activateTextboxElement(e),this.isSetFormFieldMode=!0;break;case"Password":this.activatePasswordField("PasswordField"),this.isSetFormFieldMode=!0;break;case"CheckBox":this.activateCheckboxElement("Checkbox"),this.isSetFormFieldMode=!0;break;case"RadioButton":this.activateRadioButtonElement(e),this.isSetFormFieldMode=!0;break;case"DropDown":this.activateDropDownListElement("DropdownList",t),this.isSetFormFieldMode=!0;break;case"ListBox":this.activateListboxElement(e,t),this.isSetFormFieldMode=!0;break;case"SignatureField":case"InitialField":this.activateSignatureBoxElement(e),this.isSetFormFieldMode=!0}},Q2t.prototype.resetFormField=function(e){var t=this.getFormField(e);if(t){switch(t.formFieldAnnotationType){case"Textbox":this.resetTextboxProperties(t);break;case"PasswordField":this.resetPasswordProperties(t);break;case"Checkbox":this.resetCheckboxProperties(t);break;case"RadioButton":this.resetRadioButtonProperties(t);break;case"DropdownList":this.resetDropdownListProperties(t);break;case"ListBox":this.resetListBoxProperties(t);break;case"SignatureField":case"InitialField":this.resetSignatureTextboxProperties(t)}this.updateSessionFormFieldProperties(t)}},Q2t.prototype.selectFormField=function(e){e=this.getFormField(e);e&&(this.isProgrammaticSelection=!0,this.pdfViewer.select([e.id]),this.isProgrammaticSelection=!1)},Q2t.prototype.updateFormField=function(e,t){var i=this.getFormField(e),n=(this.isFormFieldUpdated=!0,this.pdfViewer.selectedItems.formFields[0]);if(i){if(!i.isReadonly||!je(t.isReadOnly)&&!t.isReadOnly)switch(i.formFieldAnnotationType){case"Textbox":case"PasswordField":case"DropdownList":case"ListBox":case"SignatureField":case"InitialField":var o=document.getElementById(i.id+"_content_html_element");o?(o=o.firstElementChild.firstElementChild,this.isAddFormFieldProgrammatically=!0,this.formFieldPropertyChange(i,t,o,n)):(this.updateFormFieldsInCollections(e,t),this.updateDesignerSession(e,t),this.rerenderFormFields(e.pageIndex));break;case"RadioButton":o=document.getElementById(i.id+"_content_html_element");o?(o=o.firstElementChild.firstElementChild.firstElementChild,this.formFieldPropertyChange(i,t,o)):(this.updateFormFieldsInCollections(e,t),this.updateDesignerSession(e,t));break;case"Checkbox":o=document.getElementById(i.id+"_content_html_element");o?(o=o.firstElementChild.firstElementChild.lastElementChild,this.formFieldPropertyChange(i,t,o)):(this.updateFormFieldsInCollections(e,t),this.updateDesignerSession(e,t))}}else this.updateFormFieldsInCollections(e,t),this.updateFormFieldsInFieldsSession(e,t)},Q2t.prototype.updateDesignerSession=function(e,t){var e="object"==typeof e?e.id:e,e=this.pdfViewer.nameTable[""+e],i=e.bounds,n=e.wrapper.children[0],o=e.formFieldAnnotationType;je(t.customData)||e.customData===t.customData||(e.customData=t.customData),je(t.name)||e.name===t.name||(e.name=t.name),je(t.borderColor)||e.borderColor===t.borderColor||(e.borderColor=t.borderColor),je(t.backgroundColor)||e.backgroundColor===t.backgroundColor||(e.backgroundColor=t.backgroundColor),je(t.value)||e.value===t.value||(e.value=t.value),this.updateFormDesignerFieldInSessionStorage(i,n,o,e)},Q2t.prototype.updateFormFieldsInFieldsSession=function(e,t){var i=this.pdfViewerBase.getItemFromSessionStorage("_formfields");if(!je(i)){for(var n=JSON.parse(i),o=0;o<n.length;o++)n[""+o].FieldName===e.name&&(je(t.customData)||n[""+o].CustomData===t.customData||(n[""+o].CustomData=t.customData),je(t.backgroundColor)||n[""+o].BackColor===t.backgroundColor||(n[""+o].BackColor=this.getRgbCode(t.backgroundColor)),je(t.borderColor)||n[""+o].BorderColor===t.borderColor||(n[""+o].BorderColor=this.getRgbCode(t.borderColor)),je(t.name)||n[""+o].Name===t.name||(n[""+o].Name=t.name),je(t.value)||n[""+o].Value===t.value||(n[""+o].Value=t.value));this.pdfViewerBase.setItemInSessionStorage(n,"_formfields")}},Q2t.prototype.updateFormFieldsInCollections=function(n,o){for(var r=this.pdfViewer.formFieldCollections,s=this,e=0;e<r.length;e++)!function(e){var t,e=r[parseInt(e.toString(),10)],i="object"==typeof n?n.id:n;e.id===i&&(s.updateFormFieldData(e,o),t=s.pdfViewer.formFieldCollections.findIndex(function(e){return e.id===i}),s.pdfViewer.formFieldCollections[parseInt(t.toString(),10)]=e)}(e)},Q2t.prototype.updateFormFieldData=function(e,t){var i,n;t.name&&e.name!==t.name&&(e.name=t.name),"SignatureField"===e.type&&"InitialField"===e.type||(t.thickness&&e.thickness!==t.thickness&&(e.thickness=t.thickness),t.borderColor&&(i=this.colorNametoHashValue(t.borderColor),e.borderColor!==i)&&(e.borderColor=i)),t.backgroundColor&&(i=this.colorNametoHashValue(t.backgroundColor),e.backgroundColor!==i)&&(e.backgroundColor=i,n=e.id,je(this.pdfViewer.nameTable[""+n])||(this.pdfViewer.nameTable[""+n].backgroundColor=i)),je(t.customData)||e.customData===t.customData||(e.customData=t.customData),je(t.isReadOnly)||e.isReadonly===t.isReadOnly||(e.isReadOnly=t.isReadOnly),je(t.isRequired)||e.isRequired===t.isRequired||(e.isRequired=t.isRequired),je(t.isPrint)||e.isPrint===t.isPrint||(e.isPrint=t.isPrint),t.visibility&&e.visibility!==t.visibility&&(e.visibility=t.visibility),t.tooltip&&e.tooltip!==t.tooltip&&(e.tooltip=t.tooltip),"Checkbox"!==e.type||je(t.isChecked)||e.isChecked!==t.isChecked||(e.isChecked=t.isChecked),"RadioButton"!==e.type||je(t.isSelected)||e.isSelected!==t.isSelected||(e.isSelected=t.isSelected),"DropdownList"!==e.type&&"ListBox"!==e.type||!t.options||(e.options=t.options),"Textbox"!==e.type&&"SignatureField"!==e.type&&"InitialField"!==e.type&&"DropdownList"!==e.type&&"ListBox"!==e.type&&"PasswordField"!==e.type||(t.value&&e.value!==t.value&&(e.value=t.value),t.fontSize&&e.fontSize!==t.fontSize&&(e.fontSize=t.fontSize),t.color&&(n=this.colorNametoHashValue(t.color),e.color!==n)&&(e.color=n),"SignatureField"!==e.type&&(t.alignment&&e.alignment!==t.alignment&&(e.alignment=t.alignment),t.maxLength)&&e.maxLength!==t.maxLength&&(e.maxLength=t.maxLength),"PasswordField"!==e.type&&(t.fontFamily&&e.fontFamily!==t.fontFamily&&(e.fontFamily=t.fontFamily),t.fontStyle)&&e.fontStyle!==t.fontStyle&&(e.fontStyle=t.fontStyle))},Q2t.prototype.formFieldPropertyChange=function(e,t,i,n){var o,r,s,a,l,h,d=!1,p=!1,c=!1,u=!1,g=!1,m=!1,f=!1,y=!1,v=!1,b=!1,w=!1,C=!1,S=!1,A=!1,x=!1,I=!1,T=!1,E=this.pdfViewerBase.getZoomFactor();if(t.name&&(e.name!==t.name&&(T=!0),e.name=t.name,(l=document.getElementById(e.id+"_designer_name")).innerHTML=e.name,l.style.fontSize=e.fontSize?e.fontSize*E+"px":10*E+"px",i.name=t.name,this.pdfViewer.nameTable[e.id.split("_")[0]].name=e.name,T)&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,o,r,T),e.formFieldAnnotationType&&(je(t.thickness)||(e.thickness!==t.thickness&&(y=!0,o=e.thickness,r=t.thickness),i.style.borderWidth=t.thickness.toString()+"px",e.thickness=t.thickness,this.pdfViewer.nameTable[e.id.split("_")[0]].thickness=t.thickness,y&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,y,!1,!1,!1,!1,!1,!1,!1,!1,o,r)),t.borderColor)&&(l=this.colorNametoHashValue(t.borderColor),e.borderColor!==l&&(f=!0,o=e.borderColor,r=l),e.borderColor=l,i.style.borderColor=l,"RadioButton"===e.formFieldAnnotationType&&(i.parentElement.style.boxShadow=l+" 0px 0px 0px "+e.thickness+"px",this.setToolTip(t.tooltip,i.parentElement)),this.pdfViewer.nameTable[e.id.split("_")[0]].borderColor=l,f)&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,f,!1,!1,!1,!1,!1,!1,!1,!1,!1,o,r),t.backgroundColor&&(l=this.colorNametoHashValue(t.backgroundColor),l="SignatureField"===e.formFieldAnnotationType||"InitialField"===e.formFieldAnnotationType?mRt.setTransparencyToHex(l):mRt.removeAlphaValueFromHex(l),e.backgroundColor!==l&&(m=!0,o=e.backgroundColor,r=l),e.backgroundColor=l,"SignatureField"===e.formFieldAnnotationType||"InitialField"===e.formFieldAnnotationType?i.parentElement.style.background=l:i.style.background=l,"RadioButton"===e.formFieldAnnotationType&&(i.parentElement.style.background=e.backgroundColor),this.pdfViewer.nameTable[e.id.split("_")[0]].backgroundColor=l,m)&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,m,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,o,r),t.bounds&&(e.bounds={x:t.bounds.X,y:t.bounds.Y,width:t.bounds.Width,height:t.bounds.Height},(l=this.pdfViewer.nameTable[e.id.split("_")[0]]).bounds={x:t.bounds.X,y:t.bounds.Y,width:t.bounds.Width,height:t.bounds.Height},l.wrapper.bounds=new dvt(t.bounds.X,t.bounds.Y,t.bounds.Width,t.bounds.Height),this.pdfViewer.drawing.nodePropertyChange(l,{bounds:{x:l.wrapper.bounds.x,y:l.wrapper.bounds.y,width:l.wrapper.bounds.width,height:l.wrapper.bounds.height}}),a=l.wrapper.children[0],s=Pvt(l.wrapper.children[0]).topLeft,je(h=document.getElementById(a.id+"_html_element"))||h.setAttribute("style","height:"+a.actualSize.height*E+"px; width:"+a.actualSize.width*E+"px;left:"+s.x*E+"px; top:"+s.y*E+"px;position:absolute;transform:rotate("+(a.rotateAngle+a.parentTransform)+"deg);pointer-events:"+(this.pdfViewer.designerMode?"none":"all")+";visibility:"+(a.visible?"visible":"hidden")+";opacity:"+a.style.opacity+";"),this.isFormFieldSizeUpdated=!0,this.pdfViewer.select([e.id]),"RadioButton"!==l.formFieldAnnotationType&&"Checkbox"!==l.formFieldAnnotationType||this.updateHTMLElement(e)),je(t.isRequired)||(e.isRequired!==t.isRequired&&(S=!0,o=e.isRequired,r=t.isRequired),e.isRequired=t.isRequired,this.setRequiredToElement(e,i,t.isRequired),this.setRequiredToFormField(e,t.isRequired),this.pdfViewer.nameTable[e.id.split("_")[0]].isRequired=t.isRequired,S&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,S,!1,!1,!1,o,r)),t.visibility&&(e.visibility!==t.visibility&&(w=!0,o=e.visibility,r=t.visibility),e.visibility=t.visibility,i.style.visibility=t.visibility,"RadioButton"===e.formFieldAnnotationType&&(i.parentElement.style.visibility=e.visibility),"SignatureField"!==e.formFieldAnnotationType&&"InitialField"!==e.formFieldAnnotationType||(i.parentElement.style.visibility=e.visibility,h=this.pdfViewer.nameTable[e.id.split("_")[0]+"_content"],M=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),k=JSON.parse(M),s=this.getFormFiledIndex(e.id.split("_")[0]),"hidden"===e.visibility?h&&this.hideSignatureValue(e,h,s,k):h&&this.showSignatureValue(e,o,h,s,k)),this.pdfViewer.nameTable[e.id.split("_")[0]].visibility=t.visibility,w)&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,w,!1,!1,!1,!1,!1,o,r),je(t.isPrint)||(e.isPrint!==t.isPrint&&(A=!0,o=e.isPrint,r=t.isPrint),e.isPrint=t.isPrint,this.pdfViewer.nameTable[e.id.split("_")[0]].isPrint=t.isPrint,A&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,A,!1,!1,o,r)),je(t.tooltip)||(e.tooltip!==t.tooltip&&(x=!0,o=e.tooltip,r=t.tooltip),e.tooltip=t.tooltip,je(t.tooltip)||("RadioButton"===e.formFieldAnnotationType?this.setToolTip(t.tooltip,i.parentElement):this.setToolTip(t.tooltip,i)),this.pdfViewer.nameTable[e.id.split("_")[0]].tooltip=t.tooltip,x&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,x,!1,o,r)),je(t.customData)||(e.customData!==t.customData&&(I=!0,o=e.customData,r=t.customData),e.customData=t.customData,this.pdfViewer.nameTable[e.id.split("_")[0]].customData=t.customData,I&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,I,o,r)),"Checkbox"!==e.formFieldAnnotationType||je(t.isChecked)&&!t.isChecked&&!t.value||(je(t.isChecked)||e.isChecked===this.checkboxCheckedState||(d=!0,o=e.isChecked,r=t.isChecked),e.isChecked=t.isChecked,i.checked=t.isChecked,this.setCheckedValue(i,t.isChecked),this.pdfViewer.nameTable[e.id.split("_")[0]].isChecked=t.isChecked,(t.value||t.isChecked)&&(e.value!==t.value&&(d=!0,o=e.value,r=t.value),e.value=t.value,this.pdfViewer.nameTable[e.id.split("_")[0]].value=t.value,d)&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,d,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,o,r)),"RadioButton"!==e.formFieldAnnotationType||je(t.isSelected)&&!t.isSelected&&!t.value||(je(t.isSelected)||e.isSelected===t.isSelected||(d=!0,o=e.isSelected,r=this.checkboxCheckedState),e.isSelected=t.isSelected,i.checked=t.isSelected,this.pdfViewer.nameTable[e.id.split("_")[0]].isSelected=t.isSelected,(t.value||t.isSelected)&&(e.value!==t.value&&(d=!0,o=e.value,r=t.value),e.value=t.value,this.pdfViewer.nameTable[e.id.split("_")[0]].value=t.value,d)&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,d,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,o,r)),"DropdownList"!==e.formFieldAnnotationType&&"ListBox"!==e.formFieldAnnotationType||t.options&&(e.options=t.options,e.selectedIndex=[],e.selectedIndex.push(0),this.updateDropDownListDataSource(e,i),this.pdfViewer.nameTable[e.id.split("_")[0]].options=e.options),"Textbox"===e.formFieldAnnotationType||"SignatureField"===e.formFieldAnnotationType||"InitialField"===e.formFieldAnnotationType||"DropdownList"===e.formFieldAnnotationType||"ListBox"===e.formFieldAnnotationType||"PasswordField"===e.formFieldAnnotationType){if(t.value||t.isMultiline){if(je(t.value)||e.value===t.value||(d=!0,o=e.value,r=t.value),e.value=t.value||e.value,"Textbox"===e.formFieldAnnotationType&&t.isMultiline&&(this.addMultilineTextbox(e,"e-pv-formfield-input",!0),this.multilineCheckboxCheckedState=!0,document.getElementById(e.id+"_content_html_element")?this.updateTextboxFormDesignerProperties(e):this.updateFormFieldPropertiesInCollections(e)),je(t.isMultiline)||e.isMultiline===t.isMultiline||(d=!0,e.isMultiline=t.isMultiline),"DropdownList"===e.formFieldAnnotationType||"ListBox"===e.formFieldAnnotationType||je(t.value)){if("DropdownList"===e.formFieldAnnotationType||"ListBox"===e.formFieldAnnotationType){e.selectedIndex=[];for(var D=0;D<i.options.length;D++)i.options[parseInt(D.toString(),10)].text===t.value&&(i.options.selectedIndex=D,e.selectedIndex.push(D));je(t.selectedIndex)||e.selectedIndex===t.selectedIndex||(e.selectedIndex=t.selectedIndex,i.options.selectedIndex=t.selectedIndex)}}else i.value=t.value;this.pdfViewer.nameTable[e.id.split("_")[0]].value=t.value||e.value,d&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,d,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,o,r)}else je(t)||je(t.isMultiline)||t.isMultiline||(this.renderTextbox(n),this.multilineCheckboxCheckedState=!0,document.getElementById(n.id+"_content_html_element")?this.updateTextboxFormDesignerProperties(n):this.updateFormFieldPropertiesInCollections(n));t.fontSize&&(e.fontSize!==t.fontSize&&(c=!0,o=e.fontSize,r=t.fontSize),e.fontSize=t.fontSize,i.style.fontSize=t.fontSize*E+"px",this.pdfViewer.nameTable[e.id.split("_")[0]].fontSize=t.fontSize,c)&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,c,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,o,r),t.color&&(a=this.colorNametoHashValue(t.color),e.color!==a&&(g=!0,o=e.color,r=a),e.color=a,i.style.color=a,this.pdfViewer.nameTable[e.id.split("_")[0]].color=a,g)&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,g,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,o,r),"SignatureField"!==e.formFieldAnnotationType&&(t.alignment&&(e.alignment!==t.alignment&&(v=!0,o=e.alignment,r=t.alignment),e.alignment=t.alignment,i.style.textAlign=t.alignment,this.pdfViewer.nameTable[e.id.split("_")[0]].alignment=t.alignment,v)&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,v,!1,!1,!1,!1,!1,!1,!1,o,r),t.maxLength)&&(e.maxLength!==t.maxLength&&(C=!0,o=e.maxLength,r=t.maxLength),e.maxLength=t.maxLength,i.maxLength=t.maxLength,this.pdfViewer.nameTable[e.id.split("_")[0]].maxLength=t.maxLength,C)&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,C,!1,!1,!1,!1,o,r),"PasswordField"!==e.formFieldAnnotationType&&(t.fontFamily&&(e.fontFamily!==t.fontFamily&&(p=!0,o=e.fontFamily,r=t.fontFamily),e.fontFamily=t.fontFamily,i.style.fontFamily=t.fontFamily,this.pdfViewer.nameTable[e.id.split("_")[0]].fontFamily=t.fontFamily,p)&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,p,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,o,r),h=l="",!je(t.fontStyle))&&(l=(l=(l=(l+=e.font.isBold?"Bold, ":"")+(e.font.isItalic?"Italic, ":""))+(e.font.isStrikeout?"Strikethrough, ":""))+(e.font.isUnderline?"Underline, ":""),je(t.fontStyle)||t.fontStyle!==ACt.None?(0!=(t.fontStyle&ACt.Bold)&&(i.style.fontWeight="bold",e.fontStyle="Bold",e.font.isBold=!0,this.pdfViewer.nameTable[e.id.split("_")[0]].font.isBold=!0,this.setDropdownFontStyleValue(i,"bold","bold")),h+=e.font.isBold?"Bold, ":"",0!=(t.fontStyle&ACt.Italic)&&(i.style.fontStyle="italic",e.fontStyle="Italic",e.font.isItalic=!0,this.pdfViewer.nameTable[e.id.split("_")[0]].font.isItalic=!0),h+=e.font.isItalic?"Italic, ":"",0!=(t.fontStyle&ACt.Strikethrough)&&(i.style.textDecoration="line-through",e.font.isStrikeout=!0,e.fontStyle="Strikethrough",this.pdfViewer.nameTable[e.id.split("_")[0]].font.isStrikeout=!0),h+=e.font.isStrikeout?"Strikethrough, ":"",0!=(t.fontStyle&ACt.Underline)&&(i.style.textDecoration="underline",e.fontStyle="Underline",e.font.isUnderline=!0,this.pdfViewer.nameTable[e.id.split("_")[0]].font.isUnderline=!0),h+=e.font.isUnderline?"Underline, ":""):(i.style.fontWeight="",i.style.fontStyle="",e.fontStyle="",i.style.textDecoration="",e.font.isBold=!1,e.font.isItalic=!1,e.font.isUnderline=!1,e.font.isStrikeout=!1,this.setDropdownFontStyleValue(i,"none",""),this.pdfViewer.nameTable[e.id.split("_")[0]].font.isBold=!1,this.pdfViewer.nameTable[e.id.split("_")[0]].font.isItalic=!1,this.pdfViewer.nameTable[e.id.split("_")[0]].font.isUnderline=!1,this.pdfViewer.nameTable[e.id.split("_")[0]].font.isStrikeout=!1,h=""),u=!0)&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,u,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,l,h)}if(!je(t.isReadOnly)){if(e.isReadonly!==t.isReadOnly&&(b=!0,o=e.isReadonly,r=t.isReadOnly),e.isReadonly=t.isReadOnly,this.setReadOnlyProperty(e,i),"RadioButton"===e.formFieldAnnotationType){i.parentElement.style.pointerEvents=t.isReadOnly?"none":"auto";for(var M=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),k=JSON.parse(M),D=0;D<k.length;D++)if(k[parseInt(D.toString(),10)].FormField.id.split("_")[0]===e.id){for(var P=0;P<k[parseInt(D.toString(),10)].FormField.radiobuttonItem.length;P++){var B=k[parseInt(D.toString(),10)].FormField.radiobuttonItem[parseInt(P.toString(),10)],F=document.getElementById(B.id+"_html_element").firstElementChild.firstElementChild.firstElementChild;F.parentElement.style.pointerEvents=t.isReadOnly?"none":"auto",B.isReadonly=e.isReadonly,this.pdfViewerBase.formFieldCollection[parseInt(D.toString(),10)].FormField.radiobuttonItem[parseInt(P.toString(),10)].isReadonly=e.isReadonly,this.setReadOnlyProperty(B,F),this.pdfViewerBase.formFieldCollection[parseInt(D.toString(),10)].FormField.radiobuttonItem[parseInt(P.toString(),10)].backgroundColor="object"!=typeof B.backgroundColor?this.getRgbCode(B.backgroundColor):B.backgroundColor}k[parseInt(D.toString(),10)].FormField.isReadonly=e.isReadonly,this.pdfViewerBase.formFieldCollection[parseInt(D.toString(),10)].FormField.isReadonly=e.isReadonly}}else i.style.pointerEvents=!t.isReadOnly||t.isMultiline?"auto":"none";b&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,b,!1,!1,!1,!1,!1,!1,o,r)}("SignatureField"===e.formFieldAnnotationType&&t.signatureIndicatorSettings||"InitialField"===e.formFieldAnnotationType&&t.initialIndicatorSettings)&&(e=this.updateSignatureandInitialIndicator(e,t,i)),this.updateSessionFormFieldProperties(e);var L={id:e.id,name:e.name,value:e.value,type:e.formFieldAnnotationType,isReadOnly:e.isReadonly,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,color:e.color,backgroundColor:e.backgroundColor,alignment:e.alignment,visibility:e.visibility,maxLength:e.maxLength,isRequired:e.isRequired,isPrint:e.isPrint,tooltip:e.tooltip,bounds:e.bounds,thickness:e.thickness,borderColor:e.borderColor,pageIndex:e.pageIndex,insertSpaces:e.insertSpaces,isTransparent:e.isTransparent,options:e.options,pageNumber:e.pageNumber,rotateAngle:e.rotateAngle,selectedIndex:e.selectedIndex,signatureIndicatorSettings:e.signatureIndicatorSettings,signatureType:e.signatureType,zIndex:e.zIndex,isChecked:e.isChecked,isMultiline:e.isMultiline,isSelected:e.isSelected,customData:e.customData};this.pdfViewer.formFieldCollections[this.pdfViewer.formFieldCollections.findIndex(function(e){return e.id===L.id})]=L,this.pdfViewer.formFieldCollection[this.pdfViewer.formFieldCollection.findIndex(function(e){return e.id===L.id})]=e,(d||p||c||u||g||m||f||y||v||b||w||S||A||x||I||T||C)&&this.pdfViewerBase.updateDocumentEditedProperty(!0)},Q2t.prototype.colorNametoHashValue=function(e){var t=e;return""!==(t=t.match(/#([a-z0-9]+)/gi)||t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/)?t:this.nameToHash(t))?t:e},Q2t.prototype.getFormField=function(e){var t,i;return"object"==typeof e&&(i=this.getAnnotationsFromAnnotationCollections(e.id))&&(t=this.pdfViewer.nameTable[i.id]),t="string"==typeof e&&(i=this.getAnnotationsFromAnnotationCollections(e))?this.pdfViewer.nameTable[i.id]:t},Q2t.prototype.resetTextboxProperties=function(e){var t=document.getElementById(e.id+"_content_html_element").firstElementChild.firstElementChild;t&&(e.name="textboxField",e.value="",e.fontFamily="Helvetica",e.fontSize=10,e.fontStyle="None",e.color="black",e.backgroundColor="#daeaf7ff",e.alignment="left",e.visibility="visible",e.isReadonly=!1,e.isRequired=!1,e.tooltip="",e.isPrint=!0,e.borderColor="#303030",e.thickness=1,e.maxLength=0,this.updateTextboxProperties(e,t))},Q2t.prototype.resetPasswordProperties=function(e){var t=document.getElementById(e.id+"_content_html_element").firstElementChild.firstElementChild;t&&(e.name="passswordField",e.value="",e.fontFamily="Helvetica",e.fontSize=10,e.fontStyle="None",e.color="black",e.backgroundColor="#daeaf7ff",e.alignment="left",e.visibility="visible",e.isReadonly=!1,e.isRequired=!1,e.tooltip="",e.isPrint=!0,e.borderColor="#303030",e.thickness=1,e.maxLength=0,this.updatePasswordFieldProperties(e,t))},Q2t.prototype.resetCheckboxProperties=function(e){var t=document.getElementById(e.id+"_content_html_element").firstElementChild.firstElementChild;t&&(e.name="checkboxField",e.isChecked=!1,e.backgroundColor="#daeaf7ff",e.visibility="visible",e.isReadonly=!1,e.isRequired=!1,e.tooltip="",e.isPrint=!0,e.borderColor="#303030",e.thickness=1,this.updateCheckboxProperties(e,t))},Q2t.prototype.resetRadioButtonProperties=function(e){var t=document.getElementById(e.id+"_content_html_element").firstElementChild.firstElementChild;t&&(e.name="RadioButtonField",e.isSelected=!1,e.backgroundColor="#daeaf7ff",e.visibility="visible",e.isReadonly=!1,e.isRequired=!1,e.tooltip="",e.isPrint=!0,e.borderColor="#303030",e.thickness=1,this.updateRadioButtonProperties(e,t))},Q2t.prototype.resetDropdownListProperties=function(e){var t=document.getElementById(e.id+"_content_html_element").firstElementChild.firstElementChild;t&&(e.name="dropDownField",e.value="",e.fontFamily="Helvetica",e.fontSize=10,e.fontStyle="None",e.color="black",e.backgroundColor="#daeaf7ff",e.alignment="left",e.visibility="visible",e.isReadonly=!1,e.isRequired=!1,e.tooltip="",e.isPrint=!0,e.borderColor="#303030",e.thickness=1,e.options=[],this.updateDropdownListProperties(e,t),e.options)&&this.updateDropDownListDataSource(e,t)},Q2t.prototype.resetListBoxProperties=function(e){var t=document.getElementById(e.id+"_content_html_element").firstElementChild.firstElementChild;t&&(e.name="listBoxField",e.value="",e.fontFamily="Helvetica",e.fontSize=10,e.fontStyle="None",e.color="black",e.backgroundColor="#daeaf7ff",e.alignment="left",e.visibility="visible",e.isReadonly=!1,e.isRequired=!1,e.tooltip="",e.isPrint=!0,e.borderColor="#303030",e.thickness=1,e.options=[],this.updateListBoxProperties(e,t),e.options)&&this.updateDropDownListDataSource(e,t)},Q2t.prototype.resetSignatureTextboxProperties=function(e){var t=document.getElementById(e.id+"_content_html_element").firstElementChild.firstElementChild;t&&(e.name="signatureField",e.value="",e.fontFamily="Helvetica",e.fontSize=10,e.fontStyle="None",e.color="black",e.backgroundColor="#daeaf7ff",e.isRequired=!1,e.isReadonly=!1,e.tooltip="",e.isPrint=!0,e.visibility="visible",this.updateSignatureFieldProperties(e,t))},Q2t.prototype.deleteFormField=function(t,e){void 0===e&&(e=!0);var i=this.getFormField(t);if(je(i)&&t){var n=this.pdfViewerBase.getItemFromSessionStorage("_formfields"),o=JSON.parse(n);this.pdfViewer.formFieldCollection=this.pdfViewer.formFieldCollection.filter(function(e){return t.id!==e.id});for(var r=0;r<this.pdfViewer.formFieldCollections.length;r++)if(t.id===this.pdfViewer.formFieldCollections[parseInt(r.toString(),10)].id)for(var s,a=0;a<o.length;a++)t.name===o[parseInt(a.toString(),10)].FieldName&&(o.splice(a,1),this.pdfViewer.formFieldCollections.splice(r,1),s=JSON.stringify(o),ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_formfields",s))}i&&(this.clearSelection(t),this.pdfViewer.remove(i),this.pdfViewer.renderDrawing(),je(this.pdfViewer.toolbar)||je(this.pdfViewer.toolbar.formDesignerToolbarModule)||this.pdfViewer.toolbar.formDesignerToolbarModule.showHideDeleteIcon(!1),0<this.pdfViewerBase.formFieldCollection.length?this.pdfViewerBase.enableFormFieldButton(!0):this.pdfViewerBase.enableFormFieldButton(!1),e)&&this.pdfViewer.annotation&&this.pdfViewer.annotation.addAction(this.pdfViewerBase.currentPageNumber,null,i,"Delete","",i,i)},Q2t.prototype.clearSelection=function(e){var t,i;"object"==typeof e&&(i=this.getAnnotationsFromAnnotationCollections(e.id),t=this.pdfViewer.nameTable[i.id]),"string"==typeof e&&(i=this.getAnnotationsFromAnnotationCollections(e),t=this.pdfViewer.nameTable[i.id]),t&&this.pdfViewer.selectedItems&&!je(this.pdfViewer.selectedItems.properties.formFields)&&0<this.pdfViewer.selectedItems.properties.formFields.length&&this.pdfViewer.selectedItems.properties.formFields[0].id===t.id&&(e=je(this.pdfViewerBase.activeElements.activePageID)?t.pageIndex:this.pdfViewerBase.activeElements.activePageID,this.pdfViewer.clearSelection(e))},Q2t.prototype.setMode=function(e){e&&-1!==e.indexOf("designer")?(this.enableDisableFormFieldsInteraction(!0),this.pdfViewerBase.disableTextSelectionMode()):(this.enableDisableFormFieldsInteraction(!1),this.pdfViewer.textSelectionModule&&this.pdfViewer.textSelectionModule.enableTextSelectionMode())},Q2t.prototype.enableDisableFormFieldsInteraction=function(e){var t=this.pdfViewer.formFieldCollection;if(t&&0<t.length)for(var i=0;i<t.length;i++){var n=document.getElementById(t[parseInt(i.toString(),10)].id+"_content_html_element"),o=document.getElementById(t[parseInt(i.toString(),10)].id+"_designer_name");if(n)if(e){this.pdfViewer.designerMode=!0,n.style.pointerEvents="none",o.innerHTML=t[parseInt(i.toString(),10)].name;this.pdfViewerBase.getZoomFactor();switch(o.style.fontSize=this.defaultFontSize+"px",o.style.position="absolute",t[parseInt(i.toString(),10)].formFieldAnnotationType){case"Textbox":case"PasswordField":case"DropdownList":case"ListBox":case"SignatureField":case"InitialField":case"RadioButton":document.getElementById(t[parseInt(i.toString(),10)].id+"_content_html_element").firstElementChild.firstElementChild.style.pointerEvents="none";break;case"Checkbox":document.getElementById(t[parseInt(i.toString(),10)].id+"_content_html_element").firstElementChild.firstElementChild.lastElementChild.style.pointerEvents="none"}}else{switch(this.pdfViewer.designerMode=!1,n.style.pointerEvents="all",o.innerHTML="",o.style.position="initial","RadioButton"===t[parseInt(i.toString(),10)].formFieldAnnotationType&&this.updateRadioButtonDesignerProperties(t[parseInt(i.toString(),10)],!0),"Checkbox"===t[parseInt(i.toString(),10)].formFieldAnnotationType&&this.updateCheckboxFormDesignerProperties(t[parseInt(i.toString(),10)],!0),t[parseInt(i.toString(),10)].formFieldAnnotationType){case"Textbox":case"PasswordField":case"DropdownList":case"ListBox":case"SignatureField":case"InitialField":case"RadioButton":document.getElementById(t[parseInt(i.toString(),10)].id+"_content_html_element").firstElementChild.firstElementChild.style.pointerEvents=!t[parseInt(i.toString(),10)].isReadonly||t[parseInt(i.toString(),10)].isMultiline?"auto":"none";break;case"Checkbox":document.getElementById(t[parseInt(i.toString(),10)].id+"_content_html_element").firstElementChild.firstElementChild.lastElementChild.style.pointerEvents=!t[parseInt(i.toString(),10)].isReadonly||t[parseInt(i.toString(),10)].isMultiline?"auto":"none"}this.pdfViewer.clearSelection(t[parseInt(i.toString(),10)].pageIndex)}}},Q2t.prototype.getAnnotationsFromAnnotationCollections=function(e){var t=this.pdfViewer.formFieldCollection;if(t&&e)for(var i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].id===e)return t[parseInt(i.toString(),10)]},Q2t.prototype.updateSignatureValue=function(e){for(var t=0;t<this.pdfViewerBase.formFieldCollection.length;t++)e===this.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.id&&(this.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.value="",this.pdfViewer.nameTable[this.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.id.split("_")[0]].value="",this.pdfViewer.nameTable[this.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.id].value="",this.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.signatureType="",this.pdfViewer.nameTable[this.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.id.split("_")[0]].signatureType="",this.pdfViewer.nameTable[this.pdfViewerBase.formFieldCollection[parseInt(t.toString(),10)].FormField.id].signatureType="")},Q2t.prototype.removeFieldsFromAnnotationCollections=function(e,t){var i,n=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),o=JSON.parse(n),n=this.pdfViewerBase.getItemFromSessionStorage("_formfields");je(n)||(i=JSON.parse(n));for(var r=0;r<o.length;r++)if(o[parseInt(r.toString(),10)].Key.split("_")[0]===e){o.splice(r,1),this.pdfViewerBase.formFieldCollection.splice(r,1);break}if(!je(i))for(r=0;r<i.length;r++)if(i[parseInt(r.toString(),10)].FieldName===t){i.splice(parseInt(r.toString(),10),1),sessionStorage.setItem(this.pdfViewerBase.documentId+"_formfields",JSON.stringify(i));break}this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner");n=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_shape");if(n){var s=JSON.parse(n),a=this.pdfViewer.annotationModule.getPageCollection(s,this.pdfViewerBase.currentPageNumber-1);if(null!=a&&s[parseInt(a.toString(),10)]){for(var l=0;l<s[parseInt(a.toString(),10)].annotations.length;l++)if(e===s[parseInt(a.toString(),10)].annotations[parseInt(l.toString(),10)].id){s[parseInt(a.toString(),10)].annotations.splice(l,1);break}n=JSON.stringify(s);ARt.sessionStorageManager.setItem(this.pdfViewerBase.documentId+"_annotations_shape",n)}}var h=this.pdfViewer.formFieldCollection;if(h&&e)for(r=0;r<h.length;r++)h[parseInt(r.toString(),10)].formFieldId===e&&this.pdfViewer.formFieldCollection.splice(r,1)},Q2t.prototype.setFormFieldIndex=function(){var e;return 0<this.pdfViewer.formFieldCollections.length?(e=(e=this.pdfViewer.formFieldCollections[this.pdfViewer.formFieldCollections.length-1])&&e.name?isNaN(parseInt(e.name.match(/\d+/),10))?this.pdfViewer.formFieldCollections.length:parseInt(e.name.match(/\d+/),10):null,this.isAddFormFieldUi?this.formFieldIndex=this.formFieldIndex>this.pdfViewer.formFieldCollections.length?e+1:this.pdfViewer.formFieldCollections.length+1:this.formFieldIndex=isNaN(e)?this.formFieldIndex+1:e+1):this.formFieldIndex++,this.formFieldIndex},Q2t.prototype.setFormFieldIdIndex=function(){return this.formFieldIdIndex=this.formFieldIdIndex+1,this.formFieldIdIndex},Q2t.prototype.activateTextboxElement=function(e){this.pdfViewer.drawingObject={formFieldAnnotationType:e,name:"Textbox"+this.setFormFieldIndex(),value:"",fontFamily:"Helvetica",fontSize:this.defaultFontSize,fontStyle:"None",color:"black",backgroundColor:"#daeaf7ff",thickness:1,borderColor:"#303030",alignment:"left",isReadonly:!1,visibility:"visible",isRequired:!1,isPrint:!0,rotateAngle:0,tooltip:"",customData:"",font:{isItalic:!1,isBold:!1,isStrikeout:!1,isUnderline:!1}},this.pdfViewer.tool="DrawTool"},Q2t.prototype.activatePasswordField=function(e){this.pdfViewer.drawingObject={formFieldAnnotationType:e,name:"Password"+this.setFormFieldIndex(),value:"",fontFamily:"Helvetica",fontSize:this.defaultFontSize,fontStyle:"None",color:"black",alignment:"left",backgroundColor:"#daeaf7ff",thickness:1,borderColor:"#303030",isReadonly:!1,visibility:"visible",isRequired:!1,isPrint:!0,rotateAngle:0,tooltip:"",customData:"",font:{isItalic:!1,isBold:!1,isStrikeout:!1,isUnderline:!1}},this.pdfViewer.tool="DrawTool"},Q2t.prototype.activateCheckboxElement=function(e){this.pdfViewer.drawingObject={formFieldAnnotationType:e,name:"Check Box"+this.setFormFieldIndex(),isChecked:!1,fontSize:this.defaultFontSize,backgroundColor:"#daeaf7ff",color:"black",thickness:1,borderColor:"#303030",isReadonly:!1,visibility:"visible",isPrint:!0,rotateAngle:0,tooltip:"",customData:""},this.pdfViewer.tool="DrawTool"},Q2t.prototype.activateRadioButtonElement=function(e){this.pdfViewer.drawingObject={formFieldAnnotationType:e,name:"Radio Button"+this.setFormFieldIndex(),isSelected:!1,fontSize:this.defaultFontSize,backgroundColor:"#daeaf7ff",color:"black",thickness:1,borderColor:"#303030",isReadonly:!1,visibility:"visible",isPrint:!0,rotateAngle:0,tooltip:"",customData:""},this.pdfViewer.tool="DrawTool"},Q2t.prototype.activateDropDownListElement=function(e,t){this.pdfViewer.drawingObject={formFieldAnnotationType:e,name:"Dropdown"+this.setFormFieldIndex(),fontFamily:"Helvetica",fontSize:this.defaultFontSize,fontStyle:"None",color:"black",backgroundColor:"#daeaf7ff",thickness:1,borderColor:"#303030",alignment:"left",isReadonly:!1,visibility:"visible",isRequired:!1,isPrint:!0,rotateAngle:0,tooltip:"",customData:"",options:t,isMultiSelect:!1,font:{isItalic:!1,isBold:!1,isStrikeout:!1,isUnderline:!1}},this.pdfViewer.tool="DrawTool"},Q2t.prototype.activateListboxElement=function(e,t){this.pdfViewer.drawingObject={formFieldAnnotationType:e,name:"List Box"+this.setFormFieldIndex(),fontFamily:"Helvetica",fontSize:this.defaultFontSize,fontStyle:"None",color:"black",backgroundColor:"#daeaf7ff",thickness:1,borderColor:"#303030",alignment:"left",isReadonly:!1,visibility:"visible",isRequired:!1,isPrint:!0,rotateAngle:0,tooltip:"",customData:"",options:t,isMultiSelect:!0,font:{isItalic:!1,isBold:!1,isStrikeout:!1,isUnderline:!1}},this.pdfViewer.tool="DrawTool"},Q2t.prototype.activateSignatureBoxElement=function(e){var t={opacity:1,backgroundColor:"rgba(255, 228, 133, 0.35)",width:19,height:10,fontSize:this.defaultFontSize,text:null,color:"black"};switch(e){case"SignatureField":je(this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings)||(t=this.pdfViewer.signatureFieldSettings.signatureIndicatorSettings);break;case"InitialField":je(this.pdfViewer.initialFieldSettings.initialIndicatorSettings)||(t=this.pdfViewer.initialFieldSettings.initialIndicatorSettings)}this.pdfViewer.drawingObject={formFieldAnnotationType:e,name:"InitialField"===e||this.pdfViewer.isInitialFieldToolbarSelection?"Initial"+this.setFormFieldIndex():"Signature"+this.setFormFieldIndex(),fontFamily:"Helvetica",fontSize:this.defaultFontSize,fontStyle:"None",color:"black",backgroundColor:"#daeaf7ff",alignment:"left",isReadonly:!1,visibility:"visible",isRequired:!1,isPrint:!0,rotateAngle:0,tooltip:"",customData:"",font:{isItalic:!1,isBold:!1,isStrikeout:!1,isUnderline:!1},isInitialField:"InitialField"===e||this.pdfViewer.isInitialFieldToolbarSelection,signatureIndicatorSettings:{opacity:t.opacity,backgroundColor:t.backgroundColor,width:t.width,height:t.height,fontSize:t.fontSize,text:t.text,color:t.color}},this.pdfViewer.tool="DrawTool"},Q2t.prototype.updateTextboxProperties=function(e,t,i){t.name=e.name||"Textbox"+this.setFormFieldIndex(),t.value=e.value||"";var n,i=i?this.defaultZoomValue:this.pdfViewerBase.getZoomFactor();e.insertSpaces?(n=e.bounds.width*i/e.maxLength-e.fontSize*i/2-.6*i,t.style.letterSpacing=n+"px",t.style.fontFamily="monospace",t.style.paddingLeft=n/2+"px"):t.style.fontFamily=e.fontFamily&&this.getFontFamily(e.fontFamily)?e.fontFamily:"Helvetica",t.style.fontSize=e.fontSize?e.fontSize*i+"px":10*i+"px",e.font.isBold&&(t.style.fontWeight="bold"),e.font.isItalic&&(t.style.fontStyle="italic"),e.font.isUnderline&&e.font.isStrikeout?t.style.textDecoration="underline line-through":e.font.isStrikeout?t.style.textDecoration="line-through":e.font.isUnderline&&(t.style.textDecoration="underline"),e.isTransparent&&"#ffffffff"===e.borderColor?(t.style.backgroundColor="transparent",t.style.borderColor="transparent"):(t.style.backgroundColor=e.backgroundColor||"#daeaf7ff",t.style.borderColor=e.borderColor||"#303030"),t.style.color=e.color||"black",t.style.borderWidth=je(e.thickness)?"1px":e.thickness+"px",t.style.textAlign=e.alignment?e.alignment.toLowerCase():"left",t.style.visibility=e.visibility||"visible",t.style.pointerEvents=!e.isReadonly||e.isMultiline?"default":"none",t.style.resize=e.isMultiline&&!this.pdfViewer.isFormDesignerToolbarVisible?"none":"default",e.isReadonly&&(t.disabled=!0,t.style.cursor="default",t.style.backgroundColor="#daeaf7ff"!==e.backgroundColor?e.backgroundColor:"transparent"),e.isRequired&&(t.required=!0,t.style.border="1px solid red",t.style.borderWidth=je(e.thickness)?"1px":e.thickness+"px"),je(e.maxLength)||(t.maxLength=0===e.maxLength?524288:e.maxLength),t.tabIndex=this.formFieldIndex,t.setAttribute("aria-label",this.pdfViewer.element.id+"formfilldesigner")},Q2t.prototype.updatePasswordFieldProperties=function(e,t,i){t.name=e.name||"Password"+this.setFormFieldIndex(),t.value=e.value||"",t.style.fontFamily=e.fontFamily||"Helvetica";i=i?this.defaultZoomValue:this.pdfViewerBase.getZoomFactor();t.style.fontSize=e.fontSize?e.fontSize*i+"px":10*i+"px",e.font.isBold&&(t.style.fontWeight="bold"),e.font.isItalic&&(t.style.fontStyle="italic"),e.font.isStrikeout&&(t.style.textDecoration="line-through"),e.font.isUnderline&&(t.style.textDecoration="underline"),t.style.borderWidth=je(e.thickness)?"1px":e.thickness+"px",t.style.color=e.color||"black",t.style.backgroundColor=e.backgroundColor||"#daeaf7ff",t.style.borderColor=e.borderColor||"#303030",t.style.textAlign=e.alignment?e.alignment.toLowerCase():"left",t.style.visibility=e.visibility||"visible",t.style.pointerEvents=e.isReadonly?"none":"default",e.isReadonly&&(t.disabled=!0,t.style.cursor="default",t.style.backgroundColor="#daeaf7ff"!==e.backgroundColor?e.backgroundColor:"transparent"),e.isRequired&&(t.required=!0,t.style.border="1px solid red",t.style.borderWidth=je(e.thickness)?"1px":e.thickness+"px"),je(e.maxLength)||(t.maxLength=0===e.maxLength?524288:e.maxLength),t.tabIndex=this.formFieldIndex},Q2t.prototype.updateCheckboxProperties=function(e,t){t.name=e.name||"Check Box"+this.setFormFieldIndex(),t.checked=!!e.isChecked,e.isTransparent&&"#ffffffff"===e.borderColor?(t.style.backgroundColor="transparent",t.style.borderColor="transparent"):(t.style.backgroundColor=e.backgroundColor||"#daeaf7ff",t.style.borderColor=e.borderColor||"#303030"),t.style.visibility=e.visibility||"visible",t.style.pointerEvents=e.isReadonly?"none":"default",t.style.borderWidth=je(e.thickness)?"1px":e.thickness+"px",e.isReadonly&&(t.disabled=!0,t.style.cursor="default",t.style.backgroundColor="#daeaf7ff"!==e.backgroundColor?e.backgroundColor:"transparent"),e.isRequired&&(t.required=!0,t.style.border="1px solid red",t.style.borderWidth=je(e.thickness)?"1px":e.thickness+"px"),t.tabIndex=this.formFieldIndex},Q2t.prototype.updateRadioButtonProperties=function(e,t,i){t.name=e.name||"Radio Button"+this.setFormFieldIndex(),t.checked=!!e.isSelected,t.style.backgroundColor=e.backgroundColor||"#daeaf7ff",t.style.borderColor=e.borderColor||"#303030",t.style.visibility=e.visibility||"visible",je(i)?t.style.pointerEvents=e.isReadonly?"none":"default":i.style.pointerEvents=e.isReadonly?"none":"default",t.style.borderWidth=je(e.thickness)?"1px":e.thickness+"px",e.isReadonly&&(t.disabled=!0,t.style.cursor="default",t.style.backgroundColor="#daeaf7ff"!==e.backgroundColor?e.backgroundColor:"transparent"),e.isRequired&&(t.required=!0,t.style.border="1px solid red",t.style.borderWidth=je(e.thickness)?"1px":e.thickness+"px"),t.tabIndex=this.formFieldIndex},Q2t.prototype.updateDropdownListProperties=function(e,t,i){t.name=e.name||"Dropdown"+this.setFormFieldIndex(),t.value=e.value||"",t.style.fontFamily=e.fontFamily||"Helvetica";i=i?this.defaultZoomValue:this.pdfViewerBase.getZoomFactor();t.style.fontSize=e.fontSize?e.fontSize*i+"px":10*i+"px",e.font.isBold&&(t.style.fontWeight="bold"),e.font.isItalic&&(t.style.fontStyle="italic"),e.font.isStrikeout&&(t.style.textDecoration="line-through"),e.font.isUnderline&&(t.style.textDecoration="underline"),t.style.borderWidth=je(e.thickness)?"1px":e.thickness+"px",t.style.color=e.color||"black",t.style.backgroundColor=e.backgroundColor||"#daeaf7ff",t.style.borderColor=e.borderColor||"#303030",t.style.textAlign=e.alignment?e.alignment.toLowerCase():"left",t.style.visibility=e.visibility||"visible",t.style.pointerEvents=e.isReadonly?"none":"default",e.isReadonly&&(t.disabled=!0,t.style.cursor="default",t.style.backgroundColor="#daeaf7ff"!==e.backgroundColor?e.backgroundColor:"transparent"),e.isRequired&&(t.required=!0,t.style.border="1px solid red",t.style.borderWidth=je(e.thickness)?"1px":e.thickness+"px"),t.tabIndex=this.formFieldIndex},Q2t.prototype.updateListBoxProperties=function(e,t,i){t.name=e.name||"List Box"+this.setFormFieldIndex(),t.value=e.value||"",t.style.fontFamily=e.fontFamily||"Helvetica";i=i?this.defaultZoomValue:this.pdfViewerBase.getZoomFactor();t.style.fontSize=e.fontSize?e.fontSize*i+"px":10*i+"px",e.font.isBold&&(t.style.fontWeight="bold"),e.font.isItalic&&(t.style.fontStyle="italic"),e.font.isStrikeout&&(t.style.textDecoration="line-through"),e.font.isUnderline&&(t.style.textDecoration="underline"),t.style.color=e.color||"black",t.style.backgroundColor=e.backgroundColor||"#daeaf7ff",t.style.borderColor=e.borderColor||"#303030",t.style.textAlign=e.alignment?e.alignment.toLowerCase():"left",t.style.visibility=e.visibility||"visible",t.style.pointerEvents=e.isReadonly?"none":"default",t.style.borderWidth=je(e.thickness)?"1px":e.thickness+"px",e.isReadonly&&(t.disabled=!0,t.style.cursor="default",t.style.backgroundColor="#daeaf7ff"!==e.backgroundColor?e.backgroundColor:"transparent"),e.isRequired&&(t.required=!0,t.style.border="1px solid red",t.style.borderWidth=je(e.thickness)?"1px":e.thickness+"px"),t.tabIndex=this.formFieldIndex},Q2t.prototype.updateSignatureFieldProperties=function(e,t,i){t.name=e.name||"Signature"+this.setFormFieldIndex(),t.value=e.value||"",t.style.fontFamily=e.fontFamily||"Helvetica",t.style.visibility=e.visibility||"visible";var n=this.pdfViewerBase.getZoomFactor(),n=(t.style.fontSize=e.fontSize?e.fontSize*n+"px":10*n+"px",e.font.isBold&&(t.style.fontWeight="bold"),e.font.isItalic&&(t.style.fontStyle="italic"),e.font.isStrikeout&&(t.style.textDecoration="line-through"),e.font.isUnderline&&(t.style.textDecoration="underline"),t.style.color=e.color||"black",t.style.borderWidth=je(e.thickness)?"1px":e.thickness+"px",e.backgroundColor||"#FFE48559"),n=mRt.setTransparencyToHex(n);e.isTransparent&&"#ffffffff"===e.borderColor?(t.style.backgroundColor="transparent",t.style.borderColor="transparent",t.firstElementChild&&(t.firstElementChild.style.borderColor="transparent")):(t.style.backgroundColor=i?"transparent":n,t.style.borderColor=e.borderColor||"#303030",t.firstElementChild&&(t.firstElementChild.style.borderColor=e.borderColor||"#303030")),t.style.pointerEvents=e.isReadonly?"none":"default",e.isReadonly&&(je(t.firstElementChild)||(t.firstElementChild.disabled=!0),t.style.cursor="default"),e.isRequired&&(t.required=!0,t.firstElementChild?(i=0<e.thickness?e.thickness:1,t.firstElementChild.style.border=i+"px solid red"):t.style.border="1px solid red",t.style.borderWidth=e.thickness?e.thickness+"px":"1px"),t.tabIndex=this.formFieldIndex},Q2t.prototype.createHtmlElement=function(e,t){e=Q(e);return this.setAttributeHtml(e,t),e},Q2t.prototype.setAttributeHtml=function(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++)"style"!==i[parseInt(n.toString(),10)]?e.setAttribute(i[parseInt(n.toString(),10)],t[i[parseInt(n.toString(),10)]]):this.applyStyleAgainstCsp(e,t[i[parseInt(n.toString(),10)]])},Q2t.prototype.applyStyleAgainstCsp=function(e,t){for(var i=t.split(";"),n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)].split(":");2===o.length&&(e.style[o[0].trim()]=o[1].trim())}},Q2t.prototype.getFieldBounds=function(e,t){var i,n=this.pdfViewerBase.pageSize[parseInt(t.toString(),10)];if(e={X:e.X||e.x,Y:e.Y||e.y,Width:e.Width||e.width,Height:e.Height||e.height},n)switch(n.rotation){case 0:i=e;break;case 1:i={X:e.Y-(e.Width/2-e.Height/2),Y:n.width-e.X-e.Height-(e.Width/2-e.Height/2),Width:e.Width,Height:e.Height};break;case 2:i={X:n.width-e.X-e.Width,Y:n.height-e.Y-e.Height,Width:e.Width,Height:e.Height};break;case 3:i={X:n.height-e.Y-e.Width+(e.Width/2-e.Height/2),Y:e.X+(e.Width/2-e.Height/2),Width:e.Height,Height:e.Width}}return i=i||e},Q2t.prototype.downloadFormDesigner=function(){var i=this,e=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner");if(e||this.pdfViewer.formDesignerModule&&0<this.pdfViewer.formFieldCollections.length){var g=je(e)?[]:JSON.parse(e);if(g&&g.length!==this.pdfViewer.formFieldCollections.length)for(var n=this.pdfViewer.formFieldCollections.filter(function(e){var t=e.id;return!i.pdfViewer.formFieldCollection.some(function(e){return e.id===t})}),o=this,t=0;t<n.length;t++)!function(e){var t=o.loadedFormFieldValue(n[parseInt(e.toString(),10)]);"RadioButton"===t.formFieldAnnotationType&&(e=g.findIndex(function(e){return e.FormField.name===t.name}))&&0<=e?g[parseInt(e.toString(),10)].FormField.radiobuttonItem.push(t):g.push({Key:t.id+"_content",FormField:t})}(t);for(var m=this,r=0;r<g.length;r++)!function(e){var t,i,n,o,r,s,a,l,h,d,p=g[parseInt(e.toString(),10)].FormField;if(je(p)||"SignatureField"!==p.formFieldAnnotationType&&"InitialField"!==p.formFieldAnnotationType||!je(p.signatureBound)||(t=m.pdfViewer.formFieldCollections.filter(function(e){return e.id===p.id.split("_")[0]}),je(p.signatureType)||""!==p.signatureType||(p.signatureType=t[0].signatureType),je(p.value)||""!==p.value||(p.value=t[0].value),"Image"===p.signatureType?(i=p.value.toString().split(",")[1],i=new JFt(i),n={x:p.lineBound.X,y:p.lineBound.Y,width:p.lineBound.Width,height:p.lineBound.Height},"Default"===m.pdfViewer.signatureFitMode&&(l=Math.min(n.height/m.pdfViewer.formFieldsModule.paddingDifferenceValue,n.width/m.pdfViewer.formFieldsModule.paddingDifferenceValue),o=n.height-l,l=n.width-l,r=i.width,a=i.height,d=n.width,h=n.height,l=Math.min(l/r,o/a),n.width=r*l,n.height=a*l,n.x=n.x+(d-n.width)/2,n.y=n.y+(h-n.height)/2),p.signatureBound=n,i=null):"Path"===p.signatureType?(n={x:p.lineBound.X,y:p.lineBound.Y,width:p.lineBound.Width,height:p.lineBound.Height},"Default"===m.pdfViewer.signatureFitMode&&(s=m.pdfViewerBase.getZoomFactor(),p.LineBounds={X:mRt.convertPixelToPoint(p.lineBound.X),Y:mRt.convertPixelToPoint(p.lineBound.Y),Width:mRt.convertPixelToPoint(p.lineBound.Width),Height:mRt.convertPixelToPoint(p.lineBound.Height)},o=m.pdfViewerBase.signatureModule.updateSignatureAspectRatio(t[0].value,!1,null,p),(n=m.pdfViewer.formFieldsModule?m.pdfViewer.formFieldsModule.getSignBounds(e,p.rotation,p.pageNumber,s,p.lineBound.X,p.lineBound.Y,o.width,o.height,!0):n).x=n.x+o.left,n.y=n.y+o.top),p.signatureBound=n,r=cbt(rbt(t[0].value)),p.value=JSON.stringify(r)):"Type"===p.signatureType&&(s=m.pdfViewerBase.getZoomFactor(),m.pdfViewer.formFieldsModule)&&(a=m.pdfViewer.formFieldsModule.getSignBounds(e,p.rotation,p.pageNumber,s,p.lineBound.X,p.lineBound.Y,p.lineBound.Width,p.lineBound.Height),"Default"===m.pdfViewer.signatureFitMode&&(a=m.pdfViewer.formFieldsModule.getDefaultBoundsforSign(a)),p.signatureBound=a,p.signatureType="Text",l=a.height/m.pdfViewer.formFieldsModule.signatureFontSizeConstent,d=1,(h=m.pdfViewer.formFieldsModule.getTextWidth(p.value,l,p.fontFamily))>a.width&&(d=a.width/h),p.fontSize=m.pdfViewer.formFieldsModule.getFontSize(Math.floor(l*d)))),p.Multiline=p.isMultiline,p.isRequired)if("Textbox"===p.formFieldAnnotationType||"PasswordField"===p.formFieldAnnotationType||p.Multiline)null===p.value||""===p.value?(m.pdfViewerBase.validateForm=!0,m.pdfViewerBase.nonFillableFields[p.name]=p.value):delete m.pdfViewerBase.nonFillableFields[p.name];else if("RadioButton"===p.formFieldAnnotationType){if(p.radiobuttonItem){for(var c=!1,u=0;u<p.radiobuttonItem.length;u++)if(p.radiobuttonItem[parseInt(u.toString(),10)].isSelected){c=!0;break}c?delete m.pdfViewerBase.nonFillableFields[p.name]:(m.pdfViewerBase.validateForm=!0,m.pdfViewerBase.nonFillableFields[p.name]=c)}}else"Checkbox"===p.formFieldAnnotationType?!1===p.isChecked?(m.pdfViewerBase.validateForm=!0,m.pdfViewerBase.nonFillableFields[p.name]=p.isChecked):delete m.pdfViewerBase.nonFillableFields[p.name]:"DropdownList"===p.formFieldAnnotationType||"ListBox"===p.formFieldAnnotationType?je(p.selectedIndex)||0===p.selectedIndex.length?(m.pdfViewerBase.validateForm=!0,m.pdfViewerBase.nonFillableFields[p.name]=p.selectedIndex):delete m.pdfViewerBase.nonFillableFields[p.name]:"SignatureField"!==p.formFieldAnnotationType&&"InitialField"!==p.formFieldAnnotationType||(null===p.value||""===p.value?(m.pdfViewerBase.validateForm=!0,m.pdfViewerBase.nonFillableFields[p.name]=p.value):delete m.pdfViewerBase.nonFillableFields[p.name]);!p||"SignatureField"!==p.formFieldAnnotationType&&"InitialField"!==p.formFieldAnnotationType||"Text"!==p.signatureType||m.pdfViewerBase.signatureModule.checkDefaultFont(p.fontFamily)||m.getTextToImage(p)}(r);return JSON.stringify(g)}return null},Q2t.prototype.getTextToImage=function(e){var t=Q("canvas"),i=(t.width=e.lineBound.Width/this.pdfViewerBase.getZoomFactor()||150,t.height=e.lineBound.Height/this.pdfViewerBase.getZoomFactor()||2*e.fontSize,t.getContext("2d")),n=t.width/2,o=t.height/2+e.fontSize/2-10;i.textAlign="center",i.font=e.fontSize+"px "+e.fontFamily,i.fillText(e.value,n,o),e.value=JSON.stringify(t.toDataURL("image/png")),e.signatureType="Image"},Q2t.prototype.loadedFormFieldValue=function(t){var e,i,n=this.getRgbCode(t.backgroundColor),o=t.bounds,n=t.backgroundColor?{r:n.r,g:n.g,b:n.b,a:n.a}:{r:218,g:234,b:247,a:100},r=this.hexToRgb(t.color),r=t.color?{r:r[0],g:r[1],b:r[2],a:100}:{r:0,g:0,b:0,a:100},s=this.hexToRgb(t.borderColor),s=t.borderColor?{r:s[0],g:s[1],b:s[2],a:100}:{r:48,g:48,b:48,a:100},a=[],l=[],h="";if(this.data=this.pdfViewerBase.getItemFromSessionStorage("_formfields"),!je(this.data)){if(this.formFieldsData=JSON.parse(this.data),"DropdownList"===t.type||"ListBox"===t.type){var d=this.formFieldsData.filter(function(e){return t.name===e.FieldName});if(0<d.length){e=d[0].TextList,je(d[0].selectedIndex)?l.push(d[0].SelectedList[0]):l.push(d[0].selectedIndex);for(var p=0;p<e.length;p++)a.push({itemName:e[parseInt(p.toString(),10)],itemValue:e[parseInt(p.toString(),10)]})}}if("InitialField"===t.type||"SignatureField"===t.type){this.formFieldsData=JSON.parse(this.data),"["===this.formFieldsData[0]&&(this.formFieldsData=JSON.parse(this.formFieldsData));var c=this.formFieldsData.filter(function(e){return t.name===e.FieldName});if(0<c.length)for(var u,g,m,f,y,v,b,w=this.formFieldsData.filter(function(e){return("ink"===e.Name||"SignatureField"===e.Name||"SignatureImage"===e.Name||"SignatureText"===e.Name)&&c[0].FieldName===e.FieldName.split("_")[0]}),p=0;p<w.length;p++)if(c[0].FieldName!==w[parseInt(p.toString(),10)].FieldName){b=w[parseInt(p.toString(),10)].Value,t.fontFamily=w[parseInt(p.toString(),10)].FontFamily,t.fontSize=w[parseInt(p.toString(),10)].FontSize,c.Bounds||(v=w[parseInt(p.toString(),10)].LineBounds,f=m=g=u=void 0,y=parseFloat(w[parseInt(p.toString(),10)].PageIndex),v.x||v.y||v.width||v.height?(u=v.x,g=v.y,m=v.width,f=v.height):this.pdfViewer.formFieldsModule&&(u=this.pdfViewer.formFieldsModule.ConvertPointToPixel(v.X),g=this.pdfViewer.formFieldsModule.ConvertPointToPixel(v.Y),m=this.pdfViewer.formFieldsModule.ConvertPointToPixel(v.Width),f=this.pdfViewer.formFieldsModule.ConvertPointToPixel(v.Height)),this.pdfViewer.formFieldsModule&&(i=this.pdfViewer.formFieldsModule.updateSignatureBounds({left:u,top:g,width:m,height:f},y,!1))),"SignatureImage"===w[parseInt(p.toString(),10)].Name&&(h="Image"),"ink"===w[parseInt(p.toString(),10)].Name&&(h="Path"),"Path"===(h="SignatureText"===w[parseInt(p.toString(),10)].Name?"Text":h)&&(v=cbt(rbt(w[parseInt(p.toString(),10)].Value)),b=JSON.stringify(v));break}}}d={lineBound:{X:o.x,Y:o.y,Width:o.width,Height:o.height},pageNumber:parseFloat(t.pageIndex)+1,name:t.name,tooltip:t.tooltip,value:b||t.value,radiobuttonItem:[],signatureType:t.signatureType||h,id:t.id,insertSpaces:t.insertSpaces||!1,isChecked:t.isChecked||!1,isSelected:t.isSelected||!1,fontFamily:t.fontFamily,fontStyle:t.fontStyle,backgroundColor:n,fontColor:r,borderColor:s,thickness:t.thickness,fontSize:t.fontSize,isMultiline:t.isMultiline||!1,rotation:0,isReadOnly:t.isReadOnly||!1,isRequired:t.isRequired||!1,textAlign:t.alignment,formFieldAnnotationType:t.type,zoomValue:1,option:a,maxLength:t.maxLength||0,visibility:t.visibility,font:{isItalic:!1,isBold:!1,isStrikeout:!1,isUnderline:!1},customData:t.customData};return i&&(d.signatureBound=i),0<l.length&&(d.selectedIndex=l),"RadioButton"===t.type?(l={lineBound:{X:o.x,Y:o.y,Width:o.width,Height:o.height},pageNumber:parseFloat(t.pageIndex)+1,name:t.name,tooltip:t.tooltip,value:t.value,signatureType:t.signatureType||"",id:t.id,isChecked:t.isChecked||!1,isSelected:t.isSelected||!1,fontFamily:t.fontFamily,fontStyle:t.fontStyle,backgroundColor:n,fontColor:r,borderColor:s,thickness:t.thickness,fontSize:t.fontSize,rotation:0,isReadOnly:t.isReadOnly||!1,isRequired:t.isRequired||!1,textAlign:t.alignment,formFieldAnnotationType:t.type,zoomValue:1,maxLength:t.maxLength||0,visibility:t.visibility,font:{isItalic:!1,isBold:!1,isStrikeout:!1,isUnderline:!1},customData:t.customData},d.radiobuttonItem.push(l)):d.radiobuttonItem=[],d},Q2t.prototype.createAnnotationLayer=function(e,t,i,n,o){var r=this.pdfViewerBase.getElement("_annotationCanvas_"+n);return r?(this.updateAnnotationCanvas(r,t,i,n),r):(r=Q("canvas",{id:this.pdfViewer.element.id+"_annotationCanvas_"+n,className:"e-pv-annotation-canvas"}),this.updateAnnotationCanvas(r,t,i,n),e.appendChild(r),r)},Q2t.prototype.resizeAnnotations=function(e,t,i){var n=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",i);n&&(n.style.width=e+"px",n.style.height=t+"px",this.pdfViewerBase.applyElementStyles(n,i))},Q2t.prototype.getEventPageNumber=function(e){var t=e.target,i=(t.classList.contains("e-pv-hyperlink")?t=t.parentElement:(t.parentElement.classList.contains("foreign-object")||t.parentElement.classList.contains("e-pv-radiobtn-container"))&&(t=t.closest(".e-pv-text-layer")),t.id.split("_text_")[1]||t.id.split("_textLayer_")[1]||t.id.split("_annotationCanvas_")[1]||t.id.split("_pageDiv_")[1]);return isNaN(i)&&(e=this.pdfViewerBase.annotationEvent)&&(i=(t=e.target).id.split("_text_")[1]||t.id.split("_textLayer_")[1]||t.id.split("_annotationCanvas_")[1]||t.id.split("_pageDiv_")[1]),parseInt(i,10)},Q2t.prototype.getPropertyPanelHeaderContent=function(e){switch(e){case"Textbox":return this.pdfViewer.localeObj.getConstant("Textbox");case"PasswordField":return this.pdfViewer.localeObj.getConstant("Password");case"Checkbox":return this.pdfViewer.localeObj.getConstant("Check Box");case"RadioButton":return this.pdfViewer.localeObj.getConstant("Radio Button");case"DropdownList":return this.pdfViewer.localeObj.getConstant("Dropdown");case"ListBox":return this.pdfViewer.localeObj.getConstant("List Box");case"InitialField":return this.pdfViewer.localeObj.getConstant("Initial");case"SignatureField":return this.pdfViewer.localeObj.getConstant("Signature")}},Q2t.prototype.createPropertiesWindow=function(){var e=this,t=Q("div",{id:this.pdfViewer.element.id+"_properties_window",className:"e-pv-properties-form-field-window"}),i=this.createAppearanceTab(),n=(this.pdfViewerBase.pageContainer.appendChild(t),n="DropdownList"!==this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType&&"ListBox"!==this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType?"430px":"505px",this.propertiesDialog=new pS({showCloseIcon:!0,closeOnEscape:!1,isModal:!0,header:'<div class="e-pv-form-field-property-header"> '+this.getPropertyPanelHeaderContent(this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType)+" "+this.pdfViewer.localeObj.getConstant("Properties")+"</div>",minHeight:n,target:this.pdfViewer.element,content:i,beforeOpen:function(){e.isPropertyDialogOpen=!0},allowDragging:!0,close:function(){e.destroyPropertiesWindow(),e.isPropertyDialogOpen=!1}}),F.isDevice&&this.pdfViewer.enableDesktopMode,this.propertiesDialog.buttons=[{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Cancel")},click:this.onCancelClicked.bind(this)},{buttonModel:{content:this.pdfViewer.localeObj.getConstant("OK"),isPrimary:!0},click:this.onOkClicked.bind(this)}],this.pdfViewer.enableRtl&&(this.propertiesDialog.enableRtl=!0),Q("div"));n.className="e-pv-properties-bottom-spliter",t.appendChild(n),this.propertiesDialog.appendTo(t)},Q2t.prototype.onOkClicked=function(e){var t=this.pdfViewer.selectedItems.formFields[0],i=owt(t);if(this.isAddFormFieldProgrammatically=!1,t){switch(t.formFieldAnnotationType){case"Textbox":case"PasswordField":if(this.formFieldMultiline&&this.formFieldMultiline.checked&&"Textbox"===t.formFieldAnnotationType&&this.multilineCheckboxCheckedState?this.renderMultilineText(t):"Textbox"===t.formFieldAnnotationType&&this.multilineCheckboxCheckedState&&this.renderTextbox(t),"PasswordField"===t.formFieldAnnotationType&&this.updateTextboxFormDesignerProperties(t),"Textbox"===t.formFieldAnnotationType){var n=this.checkTextboxName(t);if(n&&0<n.length)for(var o=0;o<n.length;o++){var r=n[parseInt(o.toString(),10)];r.id===t.id&&(t.isMultiline?this.renderMultilineText(r):this.renderTextbox(r),document.getElementById(r.id+"_content_html_element")?this.updateTextboxFormDesignerProperties(r):this.updateFormFieldPropertiesInCollections(r))}}this.multilineCheckboxCheckedState=!1;var s=Pvt(t.wrapper.children[0]).topLeft;this.updateFormDesignerFieldInSessionStorage(s,t.wrapper.children[0],t.formFieldAnnotationType,t);break;case"Checkbox":this.updateCheckboxFormDesignerProperties(t,!1);s=Pvt(t.wrapper.children[0]).topLeft;this.updateFormDesignerFieldInSessionStorage(s,t.wrapper.children[0],t.formFieldAnnotationType,t);break;case"RadioButton":this.updateRadioButtonDesignerProperties(t,!1);s=Pvt(t.wrapper.children[0]).topLeft;this.updateFormDesignerFieldInSessionStorage(s,t.wrapper.children[0],t.formFieldAnnotationType,t);break;case"SignatureField":case"InitialField":this.updateSignatureTextboxProperties(t);s=Pvt(t.wrapper.children[0]).topLeft;this.updateFormDesignerFieldInSessionStorage(s,t.wrapper.children[0],t.formFieldAnnotationType,t);break;case"DropdownList":this.updateDropdownFormDesignerProperties(t);s=Pvt(t.wrapper.children[0]).topLeft;this.updateFormDesignerFieldInSessionStorage(s,t.wrapper.children[0],t.formFieldAnnotationType,t);break;case"ListBox":this.updateListBoxFormDesignerProperties(t);s=Pvt(t.wrapper.children[0]).topLeft;this.updateFormDesignerFieldInSessionStorage(s,t.wrapper.children[0],t.formFieldAnnotationType,t)}this.updateFormFieldCollections(t);var a=owt(t);this.pdfViewer.annotation&&this.pdfViewer.annotation.addAction(this.pdfViewerBase.currentPageNumber,null,t,"FormDesigner Properties Change","",i,a)}this.propertiesDialog.hide()},Q2t.prototype.updateFormFieldPropertiesInCollections=function(t){for(var e=this.pdfViewer.formFieldCollections,i=0;i<e.length;i++){var n,o=e[parseInt(i.toString(),10)];o.id===t.id&&o.name===t.name&&(this.formFieldName&&this.formFieldName.value&&(o.name=this.formFieldName.value),this.formFieldValue&&t.value!==this.formFieldValue.value&&(o.value=this.formFieldValue.value),this.formFieldAlign&&t.alignment!==this.formFieldAlign&&(o.alignment=this.formFieldAlign),this.formFieldPrinting&&t.isPrint!==this.formFieldPrinting.checked&&(o.isPrint=this.formFieldPrinting.checked),this.formFieldTooltip&&t.tooltip!==this.formFieldTooltip.value&&(o.tooltip=this.formFieldTooltip.value),this.formFieldVisibility&&t.visibility!==this.formFieldVisibility.value&&(o.visibility=this.formFieldVisibility),this.formFieldFontFamily&&this.formFieldFontFamily.value&&(o.fontFamily=this.formFieldFontFamily.value),this.formFieldFontSize&&this.formFieldFontSize.value&&(o.fontSize=parseInt(this.formFieldFontSize.value.toString(),10)),this.fontColorValue&&t.color!==this.fontColorValue&&(o.color=this.fontColorValue),this.backgroundColorValue&&t.backgroundColor!==this.backgroundColorValue&&(o.backgroundColor=this.backgroundColorValue),this.borderColorValue&&t.borderColor!==this.borderColorValue&&(o.borderColor=this.borderColorValue),this.formFieldBorderWidth&&t.thickness!==parseInt(this.formFieldBorderWidth,10)&&(o.thickness=parseInt(this.formFieldBorderWidth,10)),this.formFieldReadOnly&&t.isReadonly!==this.formFieldReadOnly.checked&&(o.isReadOnly=this.formFieldReadOnly.checked),this.formFieldRequired&&t.isRequired!==this.formFieldRequired.checked&&(o.isRequired=this.formFieldRequired.checked),0!==i&&i<this.pdfViewer.formFieldCollection.length?o.fontStyle=this.pdfViewer.formFieldCollection[i-1].fontStyle:o.fontStyle=this.pdfViewer.formFieldCollection[i+1].fontStyle,n=this.pdfViewer.formFieldCollections.findIndex(function(e){return e.id===t.id}),this.pdfViewer.formFieldCollections[parseInt(n.toString(),10)]=o)}},Q2t.prototype.checkTextboxName=function(e){for(var t=[],i=0;i<this.pdfViewer.formFieldCollection.length;i++){var n=this.pdfViewer.formFieldCollection[parseInt(i.toString(),10)];n.name===e.name&&"Textbox"===n.formFieldAnnotationType&&t.push(n)}return t},Q2t.prototype.renderMultilineText=function(e,t){t?this.reRenderMultilineTextbox(e,"e-pv-formfield-input"):this.addMultilineTextbox(e,"e-pv-formfield-input",!0)},Q2t.prototype.renderTextbox=function(e,t){t?this.reRenderMultilineTextbox(e,"e-pv-formfield-textarea"):this.addMultilineTextbox(e,"e-pv-formfield-textarea",!1)},Q2t.prototype.addMultilineTextbox=function(e,t,i){var n,o=e.wrapper.children[0];e.isMultiline=i,document.getElementById(o.id+"_html_element")&&(n=(i=document.getElementById(o.id+"_html_element").children[0]).children[0].id,document.getElementById(i.children[0].id).remove(),-1!==t.indexOf("e-pv-formfield-textarea")?(t=this.createTextboxElement(n),o.template=i.appendChild(t)):((t=this.createTextAreaElement(n)).value=e.value,o.template=i.appendChild(t)),n=this.getFormFiledIndex(e.id.split("_")[0]),this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.isMultiline=e.isMultiline,this.pdfViewer.nameTable[e.id.split("_")[0]].isMultiline=e.isMultiline)},Q2t.prototype.reRenderMultilineTextbox=function(e,t){var i,n,e=document.getElementById(e.id+"_content_html_element");e&&(i=(n=e.firstElementChild.firstElementChild).id,n.remove(),n=-1!==t.indexOf("e-pv-formfield-textarea")?this.createTextboxElement(i):this.createTextAreaElement(i),e.firstElementChild.appendChild(n))},Q2t.prototype.createTextAreaElement=function(e){var t=Q("textarea");return t.id=e,t.className="e-pv-formfield-textarea",t.style.width="100%",t.style.height="100%",t.style.borderStyle="solid",t.addEventListener("click",this.inputElementClick.bind(this)),t.addEventListener("change",this.getTextboxValue.bind(this)),t},Q2t.prototype.createTextboxElement=function(e){var t=Q("input");return t.id=e,t.type="text",t.className="e-pv-formfield-input",t.autocomplete="off",t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.borderStyle="solid",t.addEventListener("click",this.inputElementClick.bind(this)),t.addEventListener("change",this.getTextboxValue.bind(this)),t.addEventListener("focus",this.focusFormFields.bind(this)),t.addEventListener("blur",this.blurFormFields.bind(this)),t},Q2t.prototype.updateFormFieldCollections=function(e){var t={id:e.id.split("_")[0],name:e.name,value:e.value,type:e.type||e.formFieldAnnotationType,isReadOnly:e.isReadonly,fontFamily:e.fontFamily,isMultiline:e.isMultiline,fontSize:e.fontSize,fontStyle:e.fontStyle,color:e.color||this.getRgbToHex(e.fontColor),backgroundColor:"string"==typeof e.backgroundColor?e.backgroundColor:this.getRgbToHex(e.backgroundColor),alignment:e.alignment||e.textAlign,visibility:e.visibility,maxLength:e.maxLength,isRequired:e.isRequired,isPrint:e.isPrint,isSelected:e.isSelected,isChecked:e.isChecked,tooltip:e.tooltip,bounds:e.bounds||e.lineBound,thickness:e.thickness,borderColor:"string"==typeof e.borderColor?e.borderColor:this.getRgbToHex(e.borderColor),pageIndex:je(e.pageNumber)?e.pageIndex:e.pageNumber-1,insertSpaces:e.insertSpaces,isTransparent:e.isTransparent||!1,options:e.option||e.options,pageNumber:e.pageNumber,rotateAngle:je(e.rotateAngle)?e.rotation:e.rotateAngle,selectedIndex:e.selectedIndex,signatureIndicatorSettings:e.signatureIndicatorSettings,signatureType:e.signatureType,zIndex:e.zIndex,customData:e.customData};this.pdfViewer.formFieldCollections[this.pdfViewer.formFieldCollections.findIndex(function(e){return e.id===t.id})]=t},Q2t.prototype.getRgbToHex=function(e){return"#"+this.hex(e.r)+this.hex(e.g)+this.hex(e.b)},Q2t.prototype.updateDropdownFormDesignerProperties=function(e,t){var i,n,o,r=document.getElementById(e.id+"_content_html_element").firstElementChild.firstElementChild;(this.pdfViewer.designerMode||t)&&(o=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),i=JSON.parse(o),n=this.getFormFiledIndex(e.id.split("_")[0]),e.options=this.createDropdownDataSource(e),this.updateDropDownListDataSource(e,r),e.selectedIndex=[],-1<n&&(i[parseInt(n.toString(),10)].FormField.option=e.options,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.option=e.options,!je(e.options))&&0<e.options.length&&(i[parseInt(n.toString(),10)]&&i[parseInt(n.toString(),10)].FormField.value?(o=e.options.findIndex(function(e){return e.itemValue===i[parseInt(n.toString(),10)].FormField.value}),e.selectedIndex.push(o)):e.selectedIndex.push(0)),this.pdfViewer.nameTable[e.id.split("_")[0]].options=e.options,(this.formFieldName&&this.formFieldName.value||t)&&this.updateNamePropertyChange(e,r,t,n,i),(this.formFieldValue&&i[parseInt(n.toString(),10)]&&i[parseInt(n.toString(),10)].FormField.value||t)&&this.updateValuePropertyChange(e,r,t,n,i),(this.formFieldPrinting||t)&&this.updateIsPrintPropertyChange(e,t,n,i),(this.formFieldTooltip||t)&&this.updateTooltipPropertyChange(e,r,t,n,i),(this.formFieldVisibility||t)&&this.updateVisibilityPropertyChange(e,r,t,n,i),(this.formFieldFontFamily&&this.formFieldFontFamily.value||t)&&this.updateFontFamilyPropertyChange(e,r,t,n,i),(this.formFieldFontSize&&this.formFieldFontSize.value||t)&&this.updateFontSizePropertyChange(e,r,t,n,i),this.updateFontStylePropertyChange(e,r,t,n,i),(this.formFieldAlign||t)&&this.updateAlignmentPropertyChange(e,r,t,n,i),(this.fontColorValue||t)&&this.updateColorPropertyChange(e,r,t,n,i),(this.backgroundColorValue||t)&&this.updateBackgroundColorPropertyChange(e,r,t,n,i),(this.borderColorValue||t)&&this.updateBorderColorPropertyChange(e,r,t,n,i),je(this.formFieldBorderWidth)&&!t||this.updateBorderThicknessPropertyChange(e,r,t,n,i),(this.formFieldReadOnly||t)&&this.updateIsReadOnlyPropertyChange(e,r,t,n,i),this.formFieldRequired||t)&&this.updateIsRequiredPropertyChange(e,r,t,n,i),t&&this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")},Q2t.prototype.updateListBoxFormDesignerProperties=function(e,t){var i,n,o,r=document.getElementById(e.id+"_content_html_element").firstElementChild.firstElementChild;(this.pdfViewer.designerMode||t)&&(i=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),n=JSON.parse(i),o=this.getFormFiledIndex(e.id.split("_")[0]),e.options=this.createDropdownDataSource(e),this.updateDropDownListDataSource(e,r),e.selectedIndex=[],-1<o&&(n[parseInt(o.toString(),10)].FormField.option=e.options,this.pdfViewerBase.formFieldCollection[parseInt(o.toString(),10)].FormField.option=e.options,!je(e.options))&&0<e.options.length&&(n[parseInt(o.toString(),10)]&&n[parseInt(o.toString(),10)].FormField.value?e.selectedIndex.push(e.options.findIndex(function(e){return e.itemValue===n[parseInt(o.toString(),10)].FormField.value})):e.selectedIndex.push(0)),this.pdfViewer.nameTable[e.id.split("_")[0]].options=e.options,(this.formFieldName&&this.formFieldName.value||t)&&this.updateNamePropertyChange(e,r,t,o,n),(this.formFieldPrinting||t)&&this.updateIsPrintPropertyChange(e,t,o,n),(this.formFieldTooltip||t)&&this.updateTooltipPropertyChange(e,r,t,o,n),(this.formFieldVisibility||t)&&this.updateVisibilityPropertyChange(e,r,t,o,n),(this.formFieldFontFamily&&this.formFieldFontFamily.value||t)&&this.updateFontFamilyPropertyChange(e,r,t,o,n),(this.formFieldFontSize&&this.formFieldFontSize.value||t)&&this.updateFontSizePropertyChange(e,r,t,o,n),this.updateFontStylePropertyChange(e,r,t,o,n),(this.formFieldAlign||t)&&this.updateAlignmentPropertyChange(e,r,t,o,n),(this.fontColorValue||t)&&this.updateColorPropertyChange(e,r,t,o,n),(this.backgroundColorValue||t)&&this.updateBackgroundColorPropertyChange(e,r,t,o,n),(this.borderColorValue||t)&&this.updateBorderColorPropertyChange(e,r,t,o,n),je(this.formFieldBorderWidth)&&!t||this.updateBorderThicknessPropertyChange(e,r,t,o,n),(this.formFieldReadOnly||t)&&this.updateIsReadOnlyPropertyChange(e,r,t,o,n),this.formFieldRequired||t)&&this.updateIsRequiredPropertyChange(e,r,t,o,n),t&&this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")},Q2t.prototype.updateDropDownListDataSource=function(e,t){for(;t.firstChild;)t.firstChild.remove();for(var i=0;i<e.options.length;i++){var n=document.createElement("option");n.className="e-pv-formfield-dropdown",n.value=e.options[parseInt(i.toString(),10)].itemValue,n.text=e.options[parseInt(i.toString(),10)].itemName,t.appendChild(n)}},Q2t.prototype.createDropdownDataSource=function(e){var t=document.getElementById(this.pdfViewer.element.id+"_ul_list_item");if(this.formFieldListItemDataSource=[],t&&t.children&&0<t.children.length)for(var i=0;i<t.children.length;i++){var n=t.children[parseInt(i.toString(),10)];this.formFieldListItemDataSource.push({itemName:n.innerHTML,itemValue:n.innerHTML})}else e&&0<e.options.length&&(this.formFieldListItemDataSource=e.options);return this.formFieldListItemDataSource},Q2t.prototype.updateSignatureTextboxProperties=function(e,t){var i=document.getElementById(e.id+"_content_html_element").firstElementChild.firstElementChild,n=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),n=JSON.parse(n),o=this.getFormFiledIndex(e.id.split("_")[0]);(this.pdfViewer.designerMode||t)&&((this.formFieldName&&this.formFieldName.value||t)&&this.updateNamePropertyChange(e,i,t,o,n),(this.formFieldPrinting||t)&&this.updateIsPrintPropertyChange(e,t,o,n),(this.formFieldTooltip||t)&&this.updateTooltipPropertyChange(e,i,t,o,n),je(this.formFieldBorderWidth)&&!t||this.updateBorderThicknessPropertyChange(e,i,t,o,n),(this.formFieldVisibility||t)&&this.updateVisibilityPropertyChange(e,i,t,o,n),(this.formFieldReadOnly||t)&&this.updateIsReadOnlyPropertyChange(e,i,t,o,n),this.formFieldRequired||t)&&this.updateIsRequiredPropertyChange(e,i,t,o,n),t&&this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")},Q2t.prototype.updateCheckboxFormDesignerProperties=function(e,t,i){var n=document.getElementById(e.id+"_content_html_element").firstElementChild.firstElementChild.lastElementChild,o=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),o=JSON.parse(o),r=this.getFormFiledIndex(e.id.split("_")[0]);(this.formFieldName&&this.formFieldName.value||i)&&this.updateNamePropertyChange(e,n,i,r,o),(this.formFieldValue||i)&&this.updateValuePropertyChange(e,n,i,r,o,t),(this.backgroundColorValue||i)&&this.updateBackgroundColorPropertyChange(e,n,i,r,o),(this.borderColorValue||i)&&this.updateBorderColorPropertyChange(e,n,i,r,o),je(this.formFieldBorderWidth)&&!i||this.updateBorderThicknessPropertyChange(e,n,i,r,o),this.formFieldChecked&&(this.checkboxCheckedState=this.formFieldChecked.checked),(this.formFieldPrinting||i)&&this.updateIsPrintPropertyChange(e,i,r,o),(this.formFieldTooltip||i)&&this.updateTooltipPropertyChange(e,n,i,r,o),(this.formFieldVisibility||i)&&this.updateVisibilityPropertyChange(e,n,i,r,o),je(this.checkboxCheckedState)&&!i||this.updateIsCheckedPropertyChange(e,n,i,r,o),(this.pdfViewer.designerMode&&this.borderColorValue||i)&&this.updateBorderColorPropertyChange(e,n,i,r,o),(this.pdfViewer.designerMode&&this.formFieldBorderWidth||i)&&this.updateBorderThicknessPropertyChange(e,n,i,r,o),(this.formFieldReadOnly||i)&&this.updateIsReadOnlyPropertyChange(e,n,i,r,o),(this.formFieldRequired||i)&&this.updateIsRequiredPropertyChange(e,n,i,r,o),i&&this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")},Q2t.prototype.updateRadioButtonDesignerProperties=function(e,t,i){var n=document.getElementById(e.id+"_content_html_element").firstElementChild.firstElementChild.firstElementChild,o=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),o=JSON.parse(o),r=this.getFormFiledIndex(e.id.split("_")[0]);(this.formFieldName&&this.formFieldName.value||i)&&this.updateNamePropertyChange(e,n,i,r,o),(this.formFieldValue||i)&&this.updateValuePropertyChange(e,n,i,r,o,t),this.formFieldChecked&&(this.checkboxCheckedState=this.formFieldChecked.checked),(this.formFieldPrinting||i)&&this.updateIsPrintPropertyChange(e,i,r,o),(this.formFieldTooltip||i)&&this.updateTooltipPropertyChange(e,n,i,r,o),(this.formFieldVisibility||i)&&this.updateVisibilityPropertyChange(e,n,i,r,o),(this.pdfViewer.designerMode&&!je(this.formFieldBorderWidth)||i)&&this.updateBorderThicknessPropertyChange(e,n,i,r,o),(this.backgroundColorValue||i)&&this.updateBackgroundColorPropertyChange(e,n,i,r,o),(this.borderColorValue||i)&&this.updateBorderColorPropertyChange(e,n,i,r,o),je(this.checkboxCheckedState)&&!i||this.updateIsSelectedPropertyChange(e,n,i,r,o),(this.formFieldReadOnly||i)&&this.updateIsReadOnlyPropertyChange(e,n,i,r,o),(this.formFieldRequired||i)&&this.updateIsRequiredPropertyChange(e,n,i,r,o),i&&(n=Pvt((t=this.pdfViewer.nameTable[e.id.split("_")[0]]).wrapper.children[0]).topLeft,this.updateFormDesignerFieldInSessionStorage(n,t.wrapper.children[0],t.formFieldAnnotationType,t))},Q2t.prototype.updateTextboxFormDesignerProperties=function(e,t){var i,n,o,r=document.getElementById(e.id+"_content_html_element").firstElementChild.firstElementChild,s=!1,a=this.pdfViewerBase.getItemFromSessionStorage("_formDesigner"),a=JSON.parse(a),l=this.getFormFiledIndex(e.id.split("_")[0]);(this.pdfViewer.designerMode||t||this.isAddFormFieldProgrammatically)&&((this.formFieldName&&this.formFieldName.value||t)&&this.updateNamePropertyChange(e,r,t,l,a),(this.isAddFormFieldProgrammatically?e.value:this.formFieldValue||t)&&this.updateValuePropertyChange(e,r,t,l,a),(this.formFieldPrinting||t)&&this.updateIsPrintPropertyChange(e,t,l,a),(this.formFieldTooltip||t)&&this.updateTooltipPropertyChange(e,r,t,l,a),(this.formFieldVisibility||t)&&this.updateVisibilityPropertyChange(e,r,t,l,a),((this.isAddFormFieldProgrammatically?e.fontFamily:this.formFieldFontFamily&&this.formFieldFontFamily.value)||t)&&this.updateFontFamilyPropertyChange(e,r,t,l,a),((this.isAddFormFieldProgrammatically?e.fontSize:this.formFieldFontSize&&this.formFieldFontSize.value)||t)&&this.updateFontSizePropertyChange(e,r,t,l,a),this.updateFontStylePropertyChange(e,r,t,l,a),(this.formFieldAlign||t||this.multilineCheckboxCheckedState)&&this.updateAlignmentPropertyChange(e,r,t,l,a),(this.maxLengthItem||t)&&(this.maxLengthItem&&e.maxLength!==this.maxLengthItem.value&&(s=!0,i=e.maxLength,n=this.maxLengthItem.value),je(this.maxLengthItem)||(o=0===this.maxLengthItem.value?524288:this.maxLengthItem.value,t&&0!==e.maxLength?r.maxLength=e.maxLength:(r.maxLength=o,e.maxLength=this.maxLengthItem.value)),-1<l&&(a[parseInt(l.toString(),10)].FormField.maxLength=e.maxLength,this.pdfViewerBase.formFieldCollection[parseInt(l.toString(),10)].FormField.maxLength=e.maxLength),this.pdfViewer.nameTable[e.id.split("_")[0]].maxLength=e.maxLength,s)&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,s,!1,!1,!1,!1,i,n),(this.fontColorValue||t||this.multilineCheckboxCheckedState)&&this.updateColorPropertyChange(e,r,t,l,a),(this.backgroundColorValue||t||this.multilineCheckboxCheckedState)&&this.updateBackgroundColorPropertyChange(e,r,t,l,a),(this.borderColorValue||t||this.multilineCheckboxCheckedState)&&this.updateBorderColorPropertyChange(e,r,t,l,a),je(this.formFieldBorderWidth)&&!t||this.updateBorderThicknessPropertyChange(e,r,t,l,a),(this.formFieldReadOnly||t)&&this.updateIsReadOnlyPropertyChange(e,r,t,l,a),this.isAddFormFieldProgrammatically||this.formFieldRequired||t)&&this.updateIsRequiredPropertyChange(e,r,t,l,a),this.pdfViewer.designerMode||this.formFieldVisibility&&this.formFieldVisibility.value&&(e.visibility=this.formFieldVisibility.value,document.getElementById(e.id+"_content_html_element").firstElementChild.firstElementChild.style.visibility=e.visibility),this.updateFormFieldCollections(e),t&&this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")},Q2t.prototype.updateIsCheckedPropertyChange=function(e,t,i,n,o){var r,s,a;(this.pdfViewer.designerMode||i)&&(r=!1,a=s=void 0,e.isChecked!==this.checkboxCheckedState&&(r=!0,s=e.isChecked,a=this.checkboxCheckedState),i||(e.isChecked=this.checkboxCheckedState),-1<n&&(o[parseInt(n.toString(),10)].FormField.isChecked=e.isChecked,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.isChecked=e.isChecked),this.pdfViewer.nameTable[e.id.split("_")[0]].isChecked=e.isChecked,r)&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,r,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,s,a),this.pdfViewer.designerMode&&!i||(o=document.getElementById(e.id+"_input").firstElementChild,e.isChecked?(o.classList.contains("e-pv-cb-unchecked")&&o.classList.remove("e-pv-cb-unchecked"),o.classList.add("e-pv-cb-checked")):(o.classList.contains("e-pv-cb-checked")&&o.classList.remove("e-pv-cb-checked"),o.classList.add("e-pv-cb-unchecked")))},Q2t.prototype.updateIsSelectedPropertyChange=function(e,t,i,n,o){if(this.pdfViewer.designerMode||i){var r=!1,s=void 0,a=void 0;if(e.isSelected!==this.checkboxCheckedState&&(r=!0,s=e.isSelected,a=this.checkboxCheckedState),i||(e.isSelected=this.checkboxCheckedState),-1<n){o[parseInt(n.toString(),10)].FormField.isSelected=e.isSelected;for(var l=0;l<o[parseInt(n.toString(),10)].FormField.radiobuttonItem.length;l++)o[parseInt(n.toString(),10)].FormField.radiobuttonItem[parseInt(l.toString(),10)].id.split("_")[0]===e.id.split("_")[0]&&(o[parseInt(n.toString(),10)].FormField.radiobuttonItem[parseInt(l.toString(),10)].isSelected=e.isSelected,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.radiobuttonItem[parseInt(l.toString(),10)].isSelected=e.isSelected)}this.pdfViewer.nameTable[e.id.split("_")[0]].isSelected=e.isSelected,r&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,r,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,s,a)}if(!this.pdfViewer.designerMode||i){if(t.checked=e.isSelected,-1<n){o[parseInt(n.toString(),10)].FormField.isSelected=e.isSelected,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.isSelected=e.isSelected;for(l=0;l<o[parseInt(n.toString(),10)].FormField.radiobuttonItem.length;l++)o[parseInt(n.toString(),10)].FormField.radiobuttonItem[parseInt(l.toString(),10)].id.split("_")[0]===e.id.split("_")[0]&&(o[parseInt(n.toString(),10)].FormField.radiobuttonItem[parseInt(l.toString(),10)].isSelected=e.isSelected,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.radiobuttonItem[parseInt(l.toString(),10)].isSelected=e.isSelected)}this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner"),this.pdfViewer.nameTable[e.id.split("_")[0]].isSelected=e.isSelected}},Q2t.prototype.updateValuePropertyChange=function(e,t,i,n,o,r){var s,a,l=!1;"DropdownList"!==e.formFieldAnnotationType&&this.formFieldValue&&e.value!==this.formFieldValue.value?(l=!0,s=e.value,a=this.formFieldValue.value):"DropdownList"===e.formFieldAnnotationType&&this.formFieldValue&&e.value!==o[parseInt(n.toString(),10)].FormField.value&&(l=!0,s=e.value,a=o[parseInt(n.toString(),10)].FormField.value),i?t.value=e.value:r?l=!1:this.isAddFormFieldProgrammatically?("DropdownList"===e.formFieldAnnotationType&&(e.value=o[parseInt(n.toString(),10)].FormField.value),"DropdownList"===e.formFieldAnnotationType?t.value=o[parseInt(n.toString(),10)].FormField.value:t.value=e.value):("DropdownList"===e.formFieldAnnotationType?e.value=o[parseInt(n.toString(),10)].FormField.value:e.value=(this.formFieldValue||e).value,"DropdownList"===e.formFieldAnnotationType?t.value=o[parseInt(n.toString(),10)].FormField.value:t.value=(this.formFieldValue||e).value),-1<n&&(o[parseInt(n.toString(),10)].FormField.value=e.value,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.value=e.value),this.pdfViewer.nameTable[e.id.split("_")[0]].value=e.value,l&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,l,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,s,a)},Q2t.prototype.updateFontStylePropertyChange=function(e,t,i,n,o){var t=this.updateFontStyle(t,e,i,n,o),i=t[0],r=t[1],t=t[2];-1<n&&(o[parseInt(n.toString(),10)].FormField.fontStyle=e.fontStyle,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.fontStyle=e.fontStyle),this.pdfViewer.nameTable[e.id.split("_")[0]].fontStyle=e.fontStyle,i&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,i,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,r,t)},Q2t.prototype.updateBorderThicknessPropertyChange=function(e,t,i,n,o){var r,s,a=!1,l=parseInt(this.formFieldBorderWidth,10);e.thickness!==l&&(a=!0,r=e.thickness,s=l||e.thickness),i?t.style.borderWidth=e.thickness.toString():(t.style.borderWidth=this.formFieldBorderWidth?this.formFieldBorderWidth+"px":e.thickness+"px",e.thickness=l),-1<n&&(o[parseInt(n.toString(),10)].FormField.thickness=e.thickness,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.thickness=e.thickness),this.pdfViewer.nameTable[e.id.split("_")[0]].thickness=e.thickness,a&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,a,!1,!1,!1,!1,!1,!1,!1,!1,r,s)},Q2t.prototype.updateBorderColorPropertyChange=function(e,t,i,n,o){var r,s,a=!1;e.borderColor!==this.borderColorValue&&(a=!0,r=e.borderColor,s=this.borderColorValue||e.borderColor),this.pdfViewer.enableHtmlSanitizer&&this.borderColorValue&&(this.borderColorValue=go.sanitize(this.borderColorValue)),i?t.style.borderColor=e.borderColor:(t.style.borderColor=this.borderColorValue||e.borderColor,e.borderColor=this.borderColorValue||e.borderColor),"RadioButton"===e.formFieldAnnotationType&&(t.parentElement.style.boxShadow=this.borderColorValue+" 0px 0px 0px "+e.thickness+"px"),-1<n&&(o[parseInt(n.toString(),10)].FormField.borderColor=this.getRgbCode(e.borderColor),this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.borderColor=this.getRgbCode(e.borderColor)),this.pdfViewer.nameTable[e.id.split("_")[0]].borderColor=e.borderColor,a&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,a,!1,!1,!1,!1,!1,!1,!1,!1,!1,r,s)},Q2t.prototype.updateBackgroundColorPropertyChange=function(e,t,i,n,o){var r,s,a=!1;e.backgroundColor!==this.backgroundColorValue&&(a=!0,r=e.backgroundColor,s=this.backgroundColorValue||e.backgroundColor),this.pdfViewer.enableHtmlSanitizer&&this.backgroundColorValue&&(this.backgroundColorValue=go.sanitize(this.backgroundColorValue)),i?"RadioButton"===e.formFieldAnnotationType?t.parentElement.style.background=e.backgroundColor:t.style.background=e.backgroundColor:("RadioButton"===e.formFieldAnnotationType?t.parentElement.style.background=this.backgroundColorValue||e.backgroundColor:t.style.background=this.backgroundColorValue||e.backgroundColor,e.backgroundColor=this.backgroundColorValue||e.backgroundColor),-1<n&&(o[parseInt(n.toString(),10)].FormField.backgroundColor=this.getRgbCode(e.backgroundColor),this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.backgroundColor=this.getRgbCode(e.backgroundColor)),this.pdfViewer.nameTable[e.id.split("_")[0]].backgroundColor=e.backgroundColor,a&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,a,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,r,s)},Q2t.prototype.updateColorPropertyChange=function(e,t,i,n,o){var r,s,a=!1;e.color!==this.fontColorValue&&(a=!0,r=e.color,s=this.fontColorValue||e.color),this.pdfViewer.enableHtmlSanitizer&&this.fontColorValue&&(this.fontColorValue=go.sanitize(this.fontColorValue)),i?t.style.color=e.color:(t.style.color=this.fontColorValue||e.color,e.color=this.fontColorValue||e.color),-1<n&&(o[parseInt(n.toString(),10)].FormField.color=this.getRgbCode(e.color),this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.color=this.getRgbCode(e.color)),this.pdfViewer.nameTable[e.id.split("_")[0]].color=e.color,a&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,a,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,r,s)},Q2t.prototype.updateAlignmentPropertyChange=function(e,t,i,n,o){var r,s,a=!1;if(e.alignment!==this.formFieldAlign&&(a=!0,r=e.alignment,s=this.formFieldAlign||e.alignment),i){if(t.style.textAlign=e.alignment,("ListBox"===e.formFieldAnnotationType||"DropdownList"===e.formFieldAnnotationType)&&0<t.children.length){t.style.textAlignLast=e.alignment;for(var l=0;l<t.children.length;l++)(h=t.children[parseInt(l.toString(),10)]).style.textAlignLast=e.alignment,h.style.textAlign=e.alignment}}else if(t.style.textAlign=this.formFieldAlign||e.alignment,e.alignment=this.formFieldAlign||e.alignment,("ListBox"===e.formFieldAnnotationType||"DropdownList"===e.formFieldAnnotationType)&&0<t.children.length){t.style.textAlignLast=this.formFieldAlign||e.alignment;for(var h,l=0;l<t.children.length;l++)(h=t.children[parseInt(l.toString(),10)]).style.textAlignLast=this.formFieldAlign||e.alignment,h.style.textAlign=this.formFieldAlign||e.alignment}-1<n&&(o[parseInt(n.toString(),10)].FormField.alignment=e.alignment,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.alignment=e.alignment),this.pdfViewer.nameTable[e.id.split("_")[0]].alignment=e.alignment,a&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,a,!1,!1,!1,!1,!1,!1,!1,r,s)},Q2t.prototype.updateFontSizePropertyChange=function(e,t,i,n,o){var r,s,a=!1,l=this.pdfViewerBase.getZoomFactor(),h=this.formFieldFontSize?parseInt(this.formFieldFontSize.value.toString(),10):e&&e.fontSize?parseInt(e.fontSize.toString(),10):10;parseInt(e.fontSize,10)!==h&&(a=!0,r=e.fontSize,s=h),i?t.style.fontSize=e.fontSize*l+"px".toString():(e.fontSize=h,t.style.fontSize=this.formFieldFontSize?parseInt(this.formFieldFontSize.value.toString(),10)+"px":parseInt(e.fontSize.toString(),10)+"px"),-1<n&&(o[parseInt(n.toString(),10)].FormField.fontSize=e.fontSize,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.fontSize=e.fontSize),this.pdfViewer.nameTable[e.id.split("_")[0]].fontSize=e.fontSize,a&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,a,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,r,s)},Q2t.prototype.updateFontFamilyPropertyChange=function(e,t,i,n,o){var r,s,a=!1,l=this.pdfViewer.enableHtmlSanitizer?go.sanitize(this.formFieldFontFamily?this.formFieldFontFamily.value.toString():""):this.formFieldFontFamily?this.formFieldFontFamily.value.toString():"";e.fontFamily!==l&&(a=!0,r=e.fontFamily,s=l),i?t.style.fontFamily=e.fontFamily:(""===l?l=e.fontFamily:e.fontFamily=l,t.style.fontFamily=l),-1<n&&(o[parseInt(n.toString(),10)].FormField.fontFamily=e.fontFamily,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.fontFamily=e.fontFamily),this.pdfViewer.nameTable[e.id.split("_")[0]].fontFamily=e.fontFamily,a&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,a,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,r,s)},Q2t.prototype.updateVisibilityPropertyChange=function(e,t,i,n,o){var r,s,a=!1;this.formFieldVisibility&&e.visibility!==this.formFieldVisibility.value&&(a=!0,r=e.visibility,s=this.formFieldVisibility.value),i||(e.visibility=this.formFieldVisibility.value),t.style.visibility=e.visibility,"RadioButton"===e.formFieldAnnotationType&&(t.parentElement.style.visibility=e.visibility),"SignatureField"!==e.formFieldAnnotationType&&"InitialField"!==e.formFieldAnnotationType||((i=document.getElementById(e.id+"_content_html_element").firstElementChild.children[1]).style.visibility=e.visibility,i.parentElement.style.visibility=e.visibility,t=this.pdfViewer.nameTable[e.id.split("_")[0]+"_content"],"hidden"===e.visibility?t&&this.hideSignatureValue(e,t,n,o):t&&this.showSignatureValue(e,r,t,n,o)),-1<n&&(o[parseInt(n.toString(),10)].FormField.visibility=e.visibility,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.visibility=e.visibility),this.pdfViewer.nameTable[e.id.split("_")[0]].visibility=e.visibility,a&&(this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner"),this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,a,!1,!1,!1,!1,!1,r,s))},Q2t.prototype.hideSignatureValue=function(e,t,i,n){e.wrapper.children.splice(e.wrapper.children.indexOf(t.wrapper.children[0]),1),this.pdfViewer.remove(t),this.pdfViewer.renderDrawing()},Q2t.prototype.showSignatureValue=function(e,t,i,n,o){var r;"SignatureText"===i.shapeAnnotationType?(e.value=i.data,e.signatureType="Text",o[parseInt(n.toString(),10)].FormField.signatureType="Text",o[parseInt(n.toString(),10)].FormField.value=i.data,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.value=i.data,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.signatureType="Text"):"SignatureImage"===i.shapeAnnotationType?(e.value=i.data,e.signatureType="Image",o[parseInt(n.toString(),10)].FormField.signatureType="Image",o[parseInt(n.toString(),10)].FormField.value=i.data,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.value=i.data,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.signatureType="Image"):(o[parseInt(n.toString(),10)].FormField.signatureType="Path",e.signatureType="Path",this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.signatureType="Path",r=cbt(rbt(i.data)),e.value=JSON.stringify(r),o[parseInt(n.toString(),10)].FormField.value=JSON.stringify(r),this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.value=JSON.stringify(r)),e.signatureBound=i.signatureBound,"hidden"===t&&(this.pdfViewer.add(i),e.wrapper.children.push(i.wrapper),o=this.pdfViewerBase.getAnnotationCanvas("_annotationCanvas_",e.pageIndex),this.pdfViewer.renderDrawing(o,e.pageIndex)),this.pdfViewer.renderDrawing()},Q2t.prototype.updateTooltipPropertyChange=function(e,t,i,n,o){var r,s,a=!1;this.formFieldTooltip&&e.tooltip!==this.formFieldTooltip.value&&(a=!0,r=e.tooltip,s=this.formFieldTooltip.value),this.pdfViewer.enableHtmlSanitizer&&!je(this.formFieldTooltip)&&this.formFieldTooltip.value&&(this.formFieldTooltip.value=go.sanitize(this.formFieldTooltip.value)),i?(this.formFieldTooltip=new fV,this.formFieldTooltip.value=e.tooltip):e.tooltip=this.formFieldTooltip?this.formFieldTooltip.value:e.tooltip,-1<n&&(o[parseInt(n.toString(),10)].FormField.tooltip=e.tooltip,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.tooltip=e.tooltip),this.pdfViewer.nameTable[e.id.split("_")[0]].tooltip=this.formFieldTooltip.value,je(this.formFieldTooltip.value)||""===this.formFieldTooltip.value||this.setToolTip(this.formFieldTooltip.value,"RadioButton"===e.formFieldAnnotationType?t.parentElement:t),a&&(this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner"),this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,a,!1,r,s))},Q2t.prototype.updateNamePropertyChange=function(e,t,i,n,o){var r,s=document.getElementById(e.id+"_designer_name");this.pdfViewerBase.getZoomFactor();if(this.pdfViewer.enableHtmlSanitizer&&!je(this.formFieldName)&&this.formFieldName.value&&(this.formFieldName.value=go.sanitize(this.formFieldName.value)),s.style.fontSize=this.defaultFontSize+"px",i||(e.name=this.formFieldName?this.formFieldName.value:e.name),s.innerHTML=e.name,-1<n&&(s=i=void 0,i=1<(r=e.options.length)?e.options.slice(0,r-1):"",s=e.options[r-1],("DropdownList"===o[parseInt(n.toString(),10)].FormField.formFieldAnnotationType||"ListBox"===o[parseInt(n.toString(),10)].FormField.formFieldAnnotationType)&&o[parseInt(n.toString(),10)].FormField.name===e.name&&0<o[parseInt(n.toString(),10)].FormField.option.length&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,i,s,!0,o[parseInt(n.toString(),10)].FormField.name),this.formFieldName&&e.name!==o[parseInt(n.toString(),10)].FormField.name&&(i=o[parseInt(n.toString(),10)].FormField.name,s=e.name),o[parseInt(n.toString(),10)].FormField.name!==e.name&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,i,s,!0,o[parseInt(n.toString(),10)].FormField.name),o[parseInt(n.toString(),10)].FormField.name=e.name,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.name=e.name),t.name=e.name,this.pdfViewer.nameTable[e.id.split("_")[0]].name=e.name,"DropdownList"===e.formFieldAnnotationType||"ListBox"===e.formFieldAnnotationType)for(var a=0;a<this.pdfViewer.formFieldCollection.length;a++){var l=this.pdfViewer.formFieldCollection[parseInt(a.toString(),10)];if(("DropdownList"===l.formFieldAnnotationType||"ListBox"===l.formFieldAnnotationType)&&l.name===e.name&&l.id!==e.id){e.options=l.options,this.updateDropDownListDataSource(e,t);break}}},Q2t.prototype.setReadOnlyProperty=function(e,t){this.pdfViewer.nameTable[e.id.split("_")[0]].isReadonly=e.isReadonly,this.setReadOnlyToElement(e,t,e.isReadonly),this.setReadOnlyToFormField(e,e.isReadonly)},Q2t.prototype.updateIsReadOnlyPropertyChange=function(e,t,i,n,o){var r,s,a=!1;if(this.formFieldReadOnly&&e.isReadonly!==this.formFieldReadOnly.checked&&(a=!0,r=e.isReadonly,s=this.formFieldReadOnly.checked),i?(this.formFieldReadOnly=new ib,this.formFieldReadOnly.checked=e.isReadonly):e.isReadonly=this.formFieldReadOnly.checked,-1<n&&(o[parseInt(n.toString(),10)].FormField.isReadonly=e.isReadonly,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.isReadonly=e.isReadonly,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.radiobuttonItem)){for(var l=0;l<this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.radiobuttonItem.length;l++){this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.radiobuttonItem[parseInt(l.toString(),10)].isReadonly=e.isReadonly,this.pdfViewer.nameTable[this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.radiobuttonItem[parseInt(l.toString(),10)].id.split("_")[0]].isReadonly=e.isReadonly;var h=document.getElementById(this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.radiobuttonItem[parseInt(l.toString(),10)].id.split("_")[0]),d=this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.radiobuttonItem[parseInt(l.toString(),10)];this.setReadOnlyProperty(d,h),a&&(this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.radiobuttonItem[parseInt(l.toString(),10)].backgroundColor="string"==typeof d.backgroundColor?this.getRgbCode(d.backgroundColor):d.backgroundColor)}this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")}this.setReadOnlyProperty(e,t),a&&(this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner"),this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,a,!1,!1,!1,!1,!1,!1,r,s))},Q2t.prototype.updateIsRequiredPropertyChange=function(e,t,i,n,o){var r,s,a=!1;if(this.formFieldRequired&&e.isRequired!==this.formFieldRequired.checked&&(a=!0,r=e.isRequired,s=this.formFieldRequired.checked),i?(this.formFieldRequired=new ib,this.formFieldRequired.checked=e.isRequired):e.isRequired=this.formFieldRequired?this.formFieldRequired.checked:e.isRequired,-1<n&&(o[parseInt(n.toString(),10)].FormField.isRequired=e.isRequired,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.isRequired=e.isRequired,this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.radiobuttonItem)){for(var l=0;l<this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.radiobuttonItem.length;l++)this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.radiobuttonItem[parseInt(l.toString(),10)].isRequired=e.isRequired,this.pdfViewer.nameTable[this.pdfViewerBase.formFieldCollection[parseInt(n.toString(),10)].FormField.radiobuttonItem[parseInt(l.toString(),10)].id.split("_")[0]].isRequired=e.isRequired;this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner")}this.pdfViewer.nameTable[e.id.split("_")[0]].isRequired=e.isRequired,this.setRequiredToElement(e,t,e.isRequired),this.setRequiredToFormField(e,e.isRequired),a&&(this.pdfViewerBase.setItemInSessionStorage(this.pdfViewerBase.formFieldCollection,"_formDesigner"),this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,a,!1,!1,!1,r,s))},Q2t.prototype.updateIsPrintPropertyChange=function(e,t,i,n){var o,r,s=!1;this.formFieldPrinting&&e.isPrint!==this.formFieldPrinting.checked&&(s=!0,o=e.isPrint,r=this.formFieldPrinting.checked),t?(this.formFieldPrinting=new ib,this.formFieldPrinting.checked=e.isPrint):e.isPrint=this.formFieldPrinting.checked,-1<i&&(n[parseInt(i.toString(),10)].FormField.isPrint=e.isPrint,this.pdfViewerBase.formFieldCollection[parseInt(i.toString(),10)].FormField.isPrint=e.isPrint),this.pdfViewer.nameTable[e.id.split("_")[0]].isPrint=e.isPrint,s&&this.updateFormFieldPropertiesChanges("formFieldPropertiesChange",e,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,s,!1,!1,o,r)},Q2t.prototype.getFormFiledIndex=function(t){if(null!=this.pdfViewerBase.formFieldCollection&&0!==this.pdfViewerBase.formFieldCollection.length){var e=this.pdfViewerBase.formFieldCollection.findIndex(function(e){return e.Key.split("_")[0]===t});if(-1<e)return e;for(var i=0;i<this.pdfViewerBase.formFieldCollection.length;i++)if("RadioButton"===this.pdfViewerBase.formFieldCollection[parseInt(i.toString(),10)].FormField.formFieldAnnotationType&&this.pdfViewerBase.formFieldCollection[parseInt(i.toString(),10)].FormField.radiobuttonItem)for(var n=0;n<this.pdfViewerBase.formFieldCollection[parseInt(i.toString(),10)].FormField.radiobuttonItem.length;n++)if(this.pdfViewerBase.formFieldCollection[parseInt(i.toString(),10)].FormField.radiobuttonItem[parseInt(n.toString(),10)].id.split("_")[0]===t)return i}return-1},Q2t.prototype.updateFontStyle=function(e,t,i,n,o){var r=!1,s="",a="";return this.formFieldBold?("Bold"!==t.fontStyle&&(r=!0,s+=t.font.isBold?"Bold, ":""),i?t.font.isBold?this.setFontStyleValues(t,"Bold",this.formFieldBold,e,!0,"bold",n,o):this.setFontStyleValues(t,"None",this.formFieldBold,e,!1,"",n,o):"bold"===this.formFieldBold?this.setFontStyleValues(t,"Bold",this.formFieldBold,e,!0,"bold",n,o):this.setFontStyleValues(t,"None","bold",e,!1,"",n,o)):t.font.isBold&&this.setFontStyleValues(t,"None","bold",e,!1,"",n,o),a+=t.font.isBold?"Bold, ":"",this.formFieldItalic?("Italic"!==t.fontStyle&&(r=!0,s+=t.font.isItalic?"Italic, ":""),i?t.font.isItalic?this.setFontStyleValues(t,"Italic",this.formFieldItalic,e,!0,"italic",n,o):this.setFontStyleValues(t,"None",this.formFieldItalic,e,!1,"",n,o):"italic"===this.formFieldItalic?this.setFontStyleValues(t,"Italic",this.formFieldItalic,e,!0,"italic",n,o):this.setFontStyleValues(t,"None","italic",e,!1,"",n,o)):t.font.isItalic&&this.setFontStyleValues(t,"None","italic",e,!1,"",n,o),a+=t.font.isItalic?"Italic, ":"",this.formFieldUnderline?("Underline"!==t.fontStyle&&(r=!0,s+=t.font.isUnderline?"Underline, ":""),i?t.font.isUnderline?this.setFontStyleValues(t,"Underline",this.formFieldUnderline,e,!0,"underline",n,o):this.setFontStyleValues(t,"None",this.formFieldUnderline,e,!1,"",n,o):"underline"===this.formFieldUnderline?this.setFontStyleValues(t,"Underline",this.formFieldUnderline,e,!0,"underline",n,o):this.setFontStyleValues(t,"None","underline",e,!1,"",n,o)):t.font.isUnderline&&this.setFontStyleValues(t,"None","underline",e,!1,"",n,o),a+=t.font.isUnderline?"Underline, ":"",this.formFieldStrikeOut?("Strikethrough"!==t.fontStyle&&(r=!0,s+=t.font.isStrikeout?"Strikethrough, ":""),i?t.font.isStrikeout?this.setFontStyleValues(t,"Strikethrough",this.formFieldStrikeOut,e,!0,"line-through",n,o):this.setFontStyleValues(t,"None",this.formFieldStrikeOut,e,!1,"",n,o):"line-through"===this.formFieldStrikeOut?this.setFontStyleValues(t,"Strikethrough",this.formFieldStrikeOut,e,!0,"line-through",n,o):this.setFontStyleValues(t,"None","line-through",e,!1,"",n,o)):t.font.isStrikeout&&this.setFontStyleValues(t,"None","line-through",e,!1,"",n,o),[r,s,a+=t.font.isStrikeout?"Strikethrough, ":""]},Q2t.prototype.setFontStyleValues=function(e,t,i,n,o,r,s,a){"bold"===i?(e.fontStyle=t,e.font.isBold=o,n.style.fontWeight=r,this.setDropdownFontStyleValue(n,i,r),-1<s&&(a[parseInt(s.toString(),10)].FormField.font.isBold=o,this.pdfViewerBase.formFieldCollection[parseInt(s.toString(),10)].FormField.font.isBold=o),this.pdfViewer.nameTable[e.id.split("_")[0]].font.isBold=o):"italic"===i?(n.style.fontStyle=r,this.setDropdownFontStyleValue(n,i,r),e.fontStyle=t,e.font.isItalic=o,-1<s&&(a[parseInt(s.toString(),10)].FormField.font.isItalic=o,this.pdfViewerBase.formFieldCollection[parseInt(s.toString(),10)].FormField.font.isItalic=o),this.pdfViewer.nameTable[e.id.split("_")[0]].font.isItalic=o):"underline"===i?(this.setDropdownFontStyleValue(n,i,r),n.style.textDecoration=r,e.fontStyle=t,e.font.isUnderline=o,-1<s&&(a[parseInt(s.toString(),10)].FormField.font.isUnderline=o,this.pdfViewerBase.formFieldCollection[parseInt(s.toString(),10)].FormField.font.isUnderline=o),this.pdfViewer.nameTable[e.id.split("_")[0]].font.isUnderline=o):"line-through"===i&&(this.setDropdownFontStyleValue(n,i,r),n.style.textDecoration=r,e.fontStyle=t,e.font.isStrikeout=o,-1<s&&(a[parseInt(s.toString(),10)].FormField.font.isStrikeout=o,this.pdfViewerBase.formFieldCollection[parseInt(s.toString(),10)].FormField.font.isStrikeout=o),this.pdfViewer.nameTable[e.id.split("_")[0]].font.isStrikeout=o)},Q2t.prototype.setDropdownFontStyleValue=function(e,t,i){if(0<e.length)for(var n=0;n<e.length;n++)"bold"===t?e[parseInt(n.toString(),10)].style.fontWeight=i:"italic"===t?e[parseInt(n.toString(),10)].style.fontStyle=i:"underline"===t||"line-through"===t?e[parseInt(n.toString(),10)].style.textDecoration=i:"none"===t&&(e[parseInt(n.toString(),10)].style.fontWeight=i)},Q2t.prototype.updateFormFieldPropertiesChanges=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u,g,m,f,y,v,b,w,C){C={name:t.name,id:t.id,value:t.value,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,color:t.color,backgroundColor:t.backgroundColor,alignment:t.alignment,isReadonly:t.isReadonly,visibility:t.visibility,maxLength:t.maxLength,isRequired:t.isRequired,isPrint:t.isPrint,rotation:t.rotateAngle,tooltip:t.tooltip,options:t.options,isChecked:t.isChecked,isSelected:t.isSelected,previousName:C,currentName:t.name,customData:t.customData};this.pdfViewer.fireFormFieldPropertiesChangeEvent("formFieldPropertiesChange",C,t.pageIndex,i,n,o,r,s,a,l,h,d,p,c,u,g,m,f,y,v,b,w)},Q2t.prototype.onCancelClicked=function(e){this.propertiesDialog.hide()},Q2t.prototype.select=function(e){e.isSwiped&&(e.cancel=!0)},Q2t.prototype.createAppearanceTab=function(){var e=Q("div",{id:this.pdfViewer.element.id+"_properties_appearance"}),t=("DropdownList"!==this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType&&"ListBox"!==this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType?e.style.height="260px":e.style.height="336px",Q("div")),t=(t.className="e-pv-properties-header-spliter",e.appendChild(t),Q("div",{className:"e-pv-properties-tab-style-prop"}));return e.appendChild(t),!this.pdfViewer.selectedItems||"ListBox"!==this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType&&"DropdownList"!==this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType?!this.pdfViewer.selectedItems||"SignatureField"!==this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType&&"InitialField"!==this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType?this.tabControl=new k5({items:[{header:{text:'<div class="e-pv-form-field-property-header-general"> '+this.pdfViewer.localeObj.getConstant("General")+"</div>"},content:this.createGeneralProperties()},{header:{text:'<div class="e-pv-form-field-property-header-general"> '+this.pdfViewer.localeObj.getConstant("Appearance")+"</div>"},content:this.createAppearanceProperties()}],selecting:this.select},t):this.tabControl=new k5({items:[{header:{text:'<div class="e-pv-form-field-property-header-general"> '+this.pdfViewer.localeObj.getConstant("General")+"</div>"},content:this.createGeneralProperties()}],selecting:this.select},t):this.tabControl=new k5({items:[{header:{text:'<div class="e-pv-form-field-property-header-general"> '+this.pdfViewer.localeObj.getConstant("General")+"</div>"},content:this.createGeneralProperties()},{header:{text:'<div class="e-pv-form-field-property-header-general"> '+this.pdfViewer.localeObj.getConstant("Appearance")+"</div>"},content:this.createAppearanceProperties()},{header:{text:'<div class="e-pv-form-field-property-header-general"> '+this.pdfViewer.localeObj.getConstant("Options")+"</div>"},content:this.createOptionProperties()}],selecting:this.select},t),t.children[1].style.height="100%",e},Q2t.prototype.createGeneralProperties=function(){var e=this.pdfViewer.selectedItems.formFields?this.pdfViewer.selectedItems.formFields[0]:null,t=Q("div",{id:this.pdfViewer.element.id+"_general_prop_appearance"}),i=Q("div",{className:"e-pv-properties-text-edit-prop"}),n=(t.appendChild(i),Q("div",{className:"e-pv-properties-form-field-name-main-div"})),o=Q("div",{className:"e-pv-properties-name-edit-prop"}),r=Q("input",{className:"e-pv-properties-name-edit-input e-input"}),o=(o.appendChild(r),n.appendChild(o),this.formFieldName=new fV({type:"text",floatLabelType:"Always",placeholder:this.pdfViewer.localeObj.getConstant("Name"),value:e.name,cssClass:"e-pv-properties-formfield-name"},r),i.appendChild(n),Q("div",{className:"e-pv-properties-form-field-tooltip-main-div"})),r=Q("div",{className:"e-pv-properties-tooltip-edit-prop"}),n=Q("input",{className:"e-pv-properties-tooltip-prop-input e-input"}),r=(r.appendChild(n),o.appendChild(r),this.formFieldTooltip=new fV({type:"text",floatLabelType:"Always",placeholder:this.pdfViewer.localeObj.getConstant("Tooltip"),value:e.tooltip,cssClass:"e-pv-properties-formfield-tooltip"},n),i.appendChild(o),Q("div",{className:"e-pv-properties-visibility-style-prop"})),n=(t.appendChild(r),Q("div",{className:"e-pv-properties-form-field-value-main-div"})),i=Q("div",{className:"e-pv-properties-value-edit-prop"}),o=Q("input",{className:"e-pv-properties-value-input e-input"}),i=(i.appendChild(o),n.appendChild(i),"PasswordField"===this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType?this.formFieldValue=new fV({type:"password",floatLabelType:"Always",placeholder:this.pdfViewer.localeObj.getConstant("Value"),value:e.value,cssClass:"e-pv-properties-formfield-value"},o):this.formFieldValue=new fV({type:"text",floatLabelType:"Always",placeholder:this.pdfViewer.localeObj.getConstant("Value"),value:e.value,cssClass:"e-pv-properties-formfield-value"},o),"Textbox"!==this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType&&"PasswordField"!==this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType&&"RadioButton"!==this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType&&"Checkbox"!==this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType&&(this.formFieldValue.enabled=!1,this.formFieldValue.value=""),r.appendChild(n),Q("div",{className:"e-pv-properties-form-field-visibility-main-div"})),o=Q("div",{className:"e-pv-properties-visibility-edit-prop"}),n=Q("input",{className:"e-pv-properties-formfield-visibility"}),o=(o.appendChild(n),i.appendChild(o),"visible"===e.visibility?0:1),o=(this.formFieldVisibility=new qz({dataSource:["visible","hidden"],floatLabelType:"Always",index:o,value:e.visibility,placeholder:this.pdfViewer.localeObj.getConstant("Form Field Visibility"),cssClass:"e-pv-properties-formfield-visibility"},n),r.appendChild(i),Q("div",{className:"e-pv-properties-checkbox-main-div-prop"})),n=Q("input",{className:"e-pv-properties-checkbox-readonly-input e-input"}),i=(o.appendChild(n),this.formFieldReadOnly=new ib({label:this.pdfViewer.localeObj.getConstant("Read Only"),checked:e.isReadonly,cssClass:"e-pv-properties-form-field-checkbox"},n),"Checkbox"!==this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType&&"RadioButton"!==this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType||(r=Q("input",{className:"e-pv-properties-checkbox-checked-input e-input"}),o.appendChild(r),this.formFieldChecked=new ib({label:this.pdfViewer.localeObj.getConstant("Checked"),cssClass:"e-pv-properties-form-field-checkbox",checked:e.isChecked||e.isSelected,change:this.checkBoxChange.bind(this)},r)),Q("input",{className:"e-pv-properties-checkbox-required-input e-input"})),n=(o.appendChild(i),this.formFieldRequired=new ib({label:this.pdfViewer.localeObj.getConstant("Required"),checked:e.isRequired,cssClass:"e-pv-properties-form-field-checkbox"},i),Q("input",{className:"e-pv-properties-checkbox-printing-input e-input"}));return o.appendChild(n),this.formFieldPrinting=new ib({label:this.pdfViewer.localeObj.getConstant("Show Printing"),checked:e.isPrint,cssClass:"e-pv-properties-form-field-checkbox"},n),"Textbox"===e.formFieldAnnotationType&&(r=Q("input",{className:"e-pv-properties-checkbox-multiline-input e-input"}),o.appendChild(r),this.formFieldMultiline=new ib({label:this.pdfViewer.localeObj.getConstant("Multiline"),checked:e.isMultiline,cssClass:"e-pv-properties-form-field-checkbox",change:this.multilineCheckboxChange.bind(this)},r)),t.appendChild(o),t},Q2t.prototype.checkBoxChange=function(e){this.checkboxCheckedState=e.checked},Q2t.prototype.multilineCheckboxChange=function(e){this.multilineCheckboxCheckedState=!0},Q2t.prototype.setToolTip=function(e,t){var i=new NS({content:ao(function(){return e})});i.appendTo(t),i.beforeOpen=this.tooltipBeforeOpen.bind(this),this.formFieldTooltips.push(i)},Q2t.prototype.tooltipBeforeOpen=function(e){var t=this.pdfViewer.nameTable[""!==e.target.id.split("_")[0]?e.target.id.split("_")[0]:je(e.target.firstElementChild)?"":e.target.firstElementChild.id.split("_")[0]];je(t)||(e.element.children[0].innerHTML=t.tooltip,""!==e.element.children[0].innerHTML?e.element.style.display="block":e.element.style.display="none")},Q2t.prototype.createAppearanceProperties=function(){var e=this.pdfViewer.selectedItems.formFields?this.pdfViewer.selectedItems.formFields[0]:null,t=this.pdfViewer.element.id,i=Q("div",{id:t+"_formatting_text_prop_appearance"}),n=Q("div",{className:"e-pv-properties-format-text-style-prop"}),n=(i.appendChild(n),this.createLabelElement(this.pdfViewer.localeObj.getConstant("Formatting"),n,!0,"e-pv-properties-formfield-label",t+"_properties_formfield_formatting"),Q("div",{className:"e-pv-properties-font-items-container"})),o=Q("div",{className:"e-pv-properties-font-family-container"}),r=Q("input",{className:"e-pv-properties-format-font-family-prop"}),r=(o.appendChild(r),n.appendChild(o),this.formFieldFontFamily=new qz({dataSource:["Helvetica","Courier","Times New Roman","Symbol","ZapfDingbats"],value:this.getFontFamily(e.fontFamily)?e.fontFamily:"Helvetica",cssClass:"e-pv-properties-formfield-fontfamily"},r),this.setToolTip(this.pdfViewer.localeObj.getConstant("Font family"),o),Q("div",{className:"e-pv-properties-font-size-container"})),s=Q("input",{className:"e-pv-properties-format-font-family-prop"}),s=(r.appendChild(s),n.appendChild(r),this.formFieldFontSize=new qz({dataSource:["6px","8px","10px","12px","14px","16px","18px","20px","24px","28px","32px","36px","40px"],value:e.fontSize+"px",cssClass:"e-pv-properties-formfield-fontsize"},s),this.setToolTip(this.pdfViewer.localeObj.getConstant("Font size"),r),Q("div",{className:"e-pv-properties-form-field-font-style"})),n=(s.onclick=this.fontStyleClicked.bind(this),s.appendChild(this.addClassFontItem("_formField_bold","e-pv-bold-icon",e.font.isBold)),s.appendChild(this.addClassFontItem("_formField_italic","e-pv-italic-icon",e.font.isItalic)),s.appendChild(this.addClassFontItem("_formField_underline_textinput","e-pv-underlinetext-icon",e.font.isUnderline)),s.appendChild(this.addClassFontItem("_formField_strikeout","e-pv-strikeout-icon",e.font.isStrikeout)),n.appendChild(s),this.getFontStyle(e.font),i.appendChild(n),Q("div",{className:"e-pv-properties-font-color-container"})),a=Q("div",{className:"e-pv-properties-form-field-font-align"}),l=(a.onclick=this.fontAlignClicked.bind(this),e.alignment.toLowerCase()),l=(a.appendChild(this.addClassFontItem("_formField_left_align","e-pv-left-align-icon","left"===l)),a.appendChild(this.addClassFontItem("_formField_center_align","e-pv-center-align-icon","center"===l)),a.appendChild(this.addClassFontItem("_formField_right_align","e-pv-right-align-icon","right"===l)),this.getAlignment(l),n.appendChild(a),this.fontColorElement=Q("div",{className:"e-pv-formfield-textcolor-icon",id:this.pdfViewer.element.id+"formField_textColor"}),this.fontColorElement.setAttribute("role","combobox"),this.fontColorPalette=this.createColorPicker(this.fontColorElement.id,e.color),"black"!==e.color?this.fontColorValue=e.color:this.fontColorValue=null,this.fontColorPalette.change=this.onFontColorChange.bind(this),this.fontColorDropDown=this.createDropDownButton(this.fontColorElement,"e-pv-annotation-textcolor-icon",this.fontColorPalette.element.parentElement),n.appendChild(this.fontColorElement),this.setToolTip(this.pdfViewer.localeObj.getConstant("Font color"),this.fontColorDropDown.element),this.updateColorInIcon(this.fontColorElement,this.pdfViewer.selectedItems.formFields[0].color),"Checkbox"!==e.formFieldAnnotationType&&"RadioButton"!==e.formFieldAnnotationType||(this.fontColorPalette.disabled=!0,this.fontColorDropDown.disabled=!0,this.fontColorElement.style.pointerEvents="none",this.fontColorElement.style.opacity="0.5",a.style.pointerEvents="none",a.style.opacity="0.5",this.formFieldFontSize.enabled=!1,this.formFieldFontFamily.enabled=!1,o.style.pointerEvents="none",r.style.pointerEvents="none",s.style.pointerEvents="none",s.style.opacity="0.5"),Q("div",{className:"e-pv-formfield-maxlength-group",id:this.pdfViewer.element.id+"formField_maxlength_group"})),a=Q("div",{className:"e-pv-formfield-maxlength-icon",id:this.pdfViewer.element.id+"formField_maxlength"}),o=(l.appendChild(a),this.createLabelElement(this.pdfViewer.localeObj.getConstant("Max Length"),a,!0,"e-pv-properties-formfield-label",t+"_properties_formfield_maxlength"),Q("div",{className:"e-pv-formfield-maxlength",id:this.pdfViewer.element.id+"formField_maxlength_container"})),r=Q("input",{className:"e-pv-formfield-maxlength-input e-input"}),s=(r.setAttribute("aria-label","Max Length"),o.appendChild(r),l.appendChild(o),this.maxLengthItem=new NL({format:"n",value:0!==e.maxLength?e.maxLength:0,min:0},r),n.appendChild(l),this.setToolTip(this.pdfViewer.localeObj.getConstant("Max Length"),this.maxLengthItem.element),"Textbox"!==e.formFieldAnnotationType&&"PasswordField"!==e.formFieldAnnotationType&&(this.maxLengthItem.enabled=!1,a.style.pointerEvents="none"),i.appendChild(n),Q("div",{className:"e-pv-properties-color-container-style-prop"})),o=Q("div",{className:"e-pv-properties-fill-color-style-prop"}),r=(i.appendChild(o),this.createLabelElement(this.pdfViewer.localeObj.getConstant("Fill"),o,!0,"e-pv-properties-formfield-label",t+"_properties_formfield_fontcolor"),this.colorDropDownElement=Q("div",{className:"e-pv-formfield-fontcolor-icon",id:this.pdfViewer.element.id+"formField_fontColor"}),this.colorDropDownElement.setAttribute("role","combobox"),this.colorPalette=this.createColorPicker(this.colorDropDownElement.id,e.backgroundColor),this.colorPalette.change=this.onColorPickerChange.bind(this),this.colorDropDown=this.createDropDownButton(this.colorDropDownElement,"e-pv-annotation-color-icon",this.colorPalette.element.parentElement),this.setToolTip(this.pdfViewer.localeObj.getConstant("Fill Color"),this.colorDropDown.element),o.appendChild(this.colorDropDownElement),s.appendChild(o),this.updateColorInIcon(this.colorDropDownElement,this.pdfViewer.selectedItems.formFields[0].backgroundColor),Q("div",{className:"e-pv-properties-stroke-color-style-prop"})),l=(this.createLabelElement(this.pdfViewer.localeObj.getConstant("Border"),r,!0,"e-pv-properties-formfield-label",t+"_properties_formfield_strokecolor"),this.strokeDropDownElement=Q("div",{className:"e-pv-formfield-strokecolor-icon",id:this.pdfViewer.element.id+"formField_strokeColor"}),this.strokeDropDownElement.setAttribute("role","combobox"),this.strokeColorPicker=this.createColorPicker(this.strokeDropDownElement.id,e.borderColor),this.strokeColorPicker.change=this.onStrokePickerChange.bind(this),this.strokeDropDown=this.createDropDownButton(this.strokeDropDownElement,"e-pv-annotation-stroke-icon",this.strokeColorPicker.element.parentElement),this.setToolTip(this.pdfViewer.localeObj.getConstant("Border Color"),this.strokeDropDown.element),r.appendChild(this.strokeDropDownElement),s.appendChild(r),this.updateColorInIcon(this.strokeDropDownElement,this.pdfViewer.selectedItems.formFields[0].borderColor),Q("div",{className:"e-pv-properties-stroke-thickness-style-prop"})),a=(this.createLabelElement(this.pdfViewer.localeObj.getConstant("Thickness"),l,!0,"e-pv-properties-formfield-label",t+"_properties_formfield_strokethickness"),this.thicknessElement=Q("div",{className:"e-pv-formfield-strokethickness-icon",id:this.pdfViewer.element.id+"formField_strokethickness"}),this.thicknessElement.setAttribute("role","combobox"),this.createThicknessSlider(this.thicknessElement.id));return this.thicknessDropDown=this.createDropDownButton(this.thicknessElement,"e-pv-annotation-thickness-icon",a),this.thicknessDropDown.beforeOpen=this.thicknessDropDownBeforeOpen.bind(this),this.setToolTip(this.pdfViewer.localeObj.getConstant("Thickness"),this.thicknessDropDown.element),this.thicknessSlider.change=this.thicknessChange.bind(this),this.thicknessSlider.changed=this.thicknessChange.bind(this),l.appendChild(this.thicknessElement),s.appendChild(l),i.appendChild(s),i},Q2t.prototype.thicknessChange=function(e){1===this.pdfViewer.selectedItems.formFields.length&&(this.formFieldBorderWidth=e.value,this.updateThicknessIndicator())},Q2t.prototype.thicknessDropDownBeforeOpen=function(){1===this.pdfViewer.selectedItems.formFields.length&&(this.formFieldBorderWidth=this.pdfViewer.selectedItems.formFields[0].thickness.toString(),this.thicknessSlider.value=this.pdfViewer.selectedItems.formFields[0].thickness),this.updateThicknessIndicator()},Q2t.prototype.updateThicknessIndicator=function(){this.thicknessIndicator.textContent=this.thicknessSlider.value+" pt"},Q2t.prototype.createOptionProperties=function(){var i=this,e=this.pdfViewer.element.id,t=Q("div",{id:e+"_option_prop_appearance"}),n=Q("div",{className:"e-pv-properties-form-field-list-add-div"}),o=Q("div",{className:"e-pv-properties-form-field-list-item-main-div"}),r=(this.createLabelElement(this.pdfViewer.localeObj.getConstant("List Item"),o,!0,"e-pv-properties-formfield-label",e+"_properties_formfield_listitem"),Q("div",{className:"e-pv-properties-list-item-edit-prop"})),s=Q("input",{className:"e-pv-properties-list-item-input e-input"}),r=(s.setAttribute("aria-label","Item Name"),s.addEventListener("keyup",function(e){if(i.formFieldAddButton.disabled=!0,i.formFieldListItem.value=e.target.value,e.target&&e.target.value)if(0<i.formFieldListItemCollection.length)for(var t=0;t<i.formFieldListItemCollection.length;t++){if(i.formFieldListItemCollection[parseInt(t.toString(),10)]===e.target.value){i.formFieldAddButton.disabled=!0;break}i.formFieldAddButton.disabled=!1}else i.formFieldAddButton.disabled=!1}),r.appendChild(s),o.appendChild(r),this.formFieldListItem=new fV({type:"text",cssClass:"e-pv-properties-formfield-listitem"},s),n.appendChild(o),t.appendChild(n),Q("div",{className:"e-pv-properties-form-field-list-btn-div"})),s=Q("button",{className:"e-btn"}),o=(s.addEventListener("click",this.addListItemOnClick.bind(this)),r.appendChild(s),this.formFieldAddButton=new zv({content:this.pdfViewer.localeObj.getConstant("Add"),disabled:!0,cssClass:"e-pv-properties-dropdown-btn"},s),n.appendChild(r),Q("div",{className:"e-pv-properties-form-field-export-value-div"})),s=Q("div",{className:"e-pv-properties-form-field-export-value-main-div"}),n=(this.createLabelElement(this.pdfViewer.localeObj.getConstant("Export Value"),s,!0,"e-pv-properties-formfield-label",e+"_properties_formfield_exportValue"),Q("div",{className:"e-pv-properties-export-value-edit-prop"})),r=Q("input",{className:"e-pv-properties-export-value-input e-input"}),n=(r.setAttribute("aria-label","Item Value"),n.appendChild(r),s.appendChild(n),this.formFieldListItem=new fV({type:"text",cssClass:"e-pv-properties-formfield-exportvalue"},r),o.appendChild(s),t.appendChild(o),Q("div",{className:"e-pv-properties-form-field-option-dropdown-list-div"})),r=Q("div",{className:"e-pv-properties-form-field-option-dropdown-list-item-div"}),s=("DropdownList"===this.pdfViewer.selectedItems.formFields[0].formFieldAnnotationType?this.createLabelElement(this.pdfViewer.localeObj.getConstant("Dropdown Item List"),r,!0,"e-pv-properties-formfield-label",e+"_properties_formfield_dropdown_listitem"):this.createLabelElement(this.pdfViewer.localeObj.getConstant("List Box Item List"),r,!0,"e-pv-properties-formfield-label",e+"_properties_formfield_dropdown_listitem"),n.appendChild(r),Q("div",{className:"e-pv-properties-form-field-btn-textarea-container"})),o=Q("div",{className:"e-pv-properties-formfield-textarea",styles:"width:300px;height:123px;border:1px solid #E0E0E0;margin-right:15px;overflow:auto"}),e=Q("ul",{id:this.pdfViewer.element.id+"_ul_list_item",className:"e-pv-form-designer-ul-list-items"}),r=this.createListElement(e),e=(o.appendChild(e),s.appendChild(o),Q("div",{className:"e-pv-properties-form-field-group-btn-div"})),o=Q("div",{className:"e-pv-properties-form-field-delete-btn-div"}),a=Q("button",{className:"e-btn"}),a=(a.addEventListener("click",this.deleteListItem.bind(this)),o.appendChild(a),this.formFieldDeleteButton=new zv({content:this.pdfViewer.localeObj.getConstant("Delete Item"),disabled:!(0<r),cssClass:"e-pv-properties-dropdown-btn"},a),e.appendChild(o),Q("div",{className:"e-pv-properties-form-field-up-btn-div"})),o=Q("button",{className:"e-btn"}),r=(o.addEventListener("click",this.moveUpListItem.bind(this)),a.appendChild(o),this.formFieldUpButton=new zv({content:this.pdfViewer.localeObj.getConstant("Up"),disabled:!(1<r),cssClass:"e-pv-properties-dropdown-btn"},o),e.appendChild(a),Q("div",{className:"e-pv-properties-form-field-down-btn-div"})),o=Q("button",{className:"e-btn"});return o.addEventListener("click",this.moveDownListItem.bind(this)),r.appendChild(o),this.formFieldDownButton=new zv({content:this.pdfViewer.localeObj.getConstant("Down"),disabled:!0,cssClass:"e-pv-properties-dropdown-btn"},o),e.appendChild(r),s.appendChild(e),n.appendChild(s),t.appendChild(n),t},Q2t.prototype.addListItemOnClick=function(){var e=this.formFieldListItem.value,t=(this.formFieldListItemCollection.push(e),document.getElementById(this.pdfViewer.element.id+"_ul_list_item"));if(t.children&&0<t.children.length)for(var i=0;i<t.children.length;i++){var n=t.children[parseInt(i.toString(),10)];n.classList.contains("e-pv-li-select")&&n.classList.remove("e-pv-li-select")}var o=Q("li",{className:"e-pv-formfield-li-element"});o.addEventListener("click",this.listItemOnClick.bind(this)),o.innerHTML=e,o.classList.add("e-pv-li-select"),t.appendChild(o),this.formFieldDeleteButton.disabled=!1,this.formFieldAddButton.disabled=!0,o.previousElementSibling&&(this.formFieldUpButton.disabled=!1),o.nextElementSibling||(this.formFieldDownButton.disabled=!0)},Q2t.prototype.listItemOnClick=function(e){var t=document.getElementById(this.pdfViewer.element.id+"_ul_list_item");if(t.children&&0<t.children.length)for(var i=0;i<t.children.length;i++){var n=t.children[parseInt(i.toString(),10)];n.classList.contains("e-pv-li-select")&&n.classList.remove("e-pv-li-select")}e.target&&e.target.classList.add("e-pv-li-select"),e.target.nextElementSibling?this.formFieldDownButton.disabled=!1:this.formFieldDownButton.disabled=!0,e.target.previousElementSibling?this.formFieldUpButton.disabled=!1:this.formFieldUpButton.disabled=!0},Q2t.prototype.deleteListItem=function(){var e=document.getElementById(this.pdfViewer.element.id+"_ul_list_item");if(e.children&&0<e.children.length)for(var t=0;t<e.children.length;t++){var i=e.children[parseInt(t.toString(),10)];i.classList.contains("e-pv-li-select")&&(i.classList.remove("e-pv-li-select"),this.formFieldListItemCollection.splice(t,1),i.previousElementSibling?(i.previousElementSibling.classList.add("e-pv-li-select"),i.previousElementSibling.previousElementSibling||(this.formFieldUpButton.disabled=!0)):i.nextElementSibling&&(i.nextElementSibling.classList.add("e-pv-li-select"),i.nextElementSibling.nextElementSibling||(this.formFieldDownButton.disabled=!0)),i.remove())}e.children&&0===e.children.length&&(this.formFieldDeleteButton.disabled=!0,this.formFieldUpButton.disabled=!0,this.formFieldDownButton.disabled=!0),e.children&&1===e.children.length&&(this.formFieldDeleteButton.disabled=!1,this.formFieldUpButton.disabled=!0,this.formFieldDownButton.disabled=!0)},Q2t.prototype.moveUpListItem=function(){var e=document.getElementById(this.pdfViewer.element.id+"_ul_list_item");if(e.children&&0<e.children.length)for(var t=0;t<e.children.length;t++){var i=e.children[parseInt(t.toString(),10)];i.classList.contains("e-pv-li-select")&&(i.previousElementSibling&&(i.parentNode.insertBefore(i,i.previousElementSibling),i.previousElementSibling)||(this.formFieldUpButton.disabled=!0),i.nextElementSibling)&&(this.formFieldDownButton.disabled=!1)}},Q2t.prototype.moveDownListItem=function(){var e,t=document.getElementById(this.pdfViewer.element.id+"_ul_list_item");if(t.children&&0<t.children.length)for(var i=0;i<t.children.length;i++)if((e=t.children[parseInt(i.toString(),10)]).classList.contains("e-pv-li-select")){if(e.nextElementSibling){e.parentNode.insertBefore(e.nextElementSibling,e);break}this.formFieldDownButton.disabled=!0}e.nextElementSibling||(this.formFieldDownButton.disabled=!0),e.previousElementSibling&&(this.formFieldUpButton.disabled=!1)},Q2t.prototype.createListElement=function(e){var t=this.pdfViewer.selectedItems.formFields[0];if(t&&t.options&&0<t.options.length){for(var i=0;i<t.options.length;i++){var n,o=t.options[parseInt(i.toString(),10)].itemName;this.formFieldListItemCollection[parseInt(i.toString(),10)]!==t.options[parseInt(i.toString(),10)].itemName&&(this.formFieldListItemCollection.push(o),(n=Q("li",{className:"e-pv-formfield-li-element"})).addEventListener("click",this.listItemOnClick.bind(this)),n.addEventListener("focus",this.focusFormFields.bind(this)),n.addEventListener("blur",this.blurFormFields.bind(this)),n.innerHTML=o,e.appendChild(n))}e.children[e.children.length-1].classList.add("e-pv-li-select")}return e.children.length},Q2t.prototype.createThicknessSlider=function(e){var t=Q("div",{className:"e-pv-annotation-thickness-popup-container"}),i=(document.body.appendChild(t),Q("span",{id:e+"_label",className:"e-pv-annotation-thickness-label"})),n=(i.textContent=this.pdfViewer.localeObj.getConstant("Line Thickness"),Q("div",{id:e+"_slider"}));return this.thicknessSlider=new KO({type:"MinRange",cssClass:"e-pv-annotation-thickness-slider",max:12,min:0}),this.thicknessIndicator=Q("div",{id:e+"_thickness_indicator",className:"e-pv-annotation-thickness-indicator"}),this.thicknessIndicator.textContent="0 pt",this.pdfViewer.enableRtl?(t.appendChild(this.thicknessIndicator),t.appendChild(n),this.thicknessSlider.enableRtl=!0,this.thicknessSlider.appendTo(n),t.appendChild(i)):(t.appendChild(i),t.appendChild(n),this.thicknessSlider.appendTo(n),t.appendChild(this.thicknessIndicator)),this.thicknessSlider.element.parentElement.classList.add("e-pv-annotation-thickness-slider-container"),t},Q2t.prototype.createColorPicker=function(e,t){e=Q("input",{id:e+"_target"}),document.body.appendChild(e),t=new cV({inline:!0,mode:"Palette",cssClass:"e-show-value",enableOpacity:!1,value:t,showButtons:!1,modeSwitcher:!1});return this.pdfViewer.enableRtl&&(t.enableRtl=!0),t.appendTo(e),t},Q2t.prototype.fontStyleClicked=function(e){var t;e.target&&(-1!==e.target.id.indexOf("formField_bold")?((t=-1!==e.target.id.indexOf("formField_bold_div")?e.target:e.target.parentElement).classList.contains("e-pv-li-select")&&(this.isBold=!0),this.isBold=!this.isBold,this.isBold?(this.formFieldBold="bold",t.classList.add("e-pv-li-select")):(this.formFieldBold="normal",t.classList.remove("e-pv-li-select"))):-1!==e.target.id.indexOf("formField_italic")?((t=-1!==e.target.id.indexOf("formField_italic_div")?e.target:e.target.parentElement).classList.contains("e-pv-li-select")&&(this.isItalic=!0),this.isItalic=!this.isItalic,this.isItalic?(this.formFieldItalic="italic",t.classList.add("e-pv-li-select")):(this.formFieldItalic="normal",t.classList.remove("e-pv-li-select"))):-1!==e.target.id.indexOf("formField_underline")?((t=-1!==e.target.id.indexOf("formField_underline_textinput_div")?e.target:e.target.parentElement).classList.contains("e-pv-li-select")&&(this.isUnderline=!0),this.isUnderline=!this.isUnderline,this.isUnderline?(this.formFieldUnderline="underline",this.isStrikeThrough=!1,t.classList.add("e-pv-li-select")):(this.formFieldUnderline="none",t.classList.remove("e-pv-li-select"))):-1!==e.target.id.indexOf("formField_strikeout")&&((t=-1!==e.target.id.indexOf("formField_strikeout_div")?e.target:e.target.parentElement).classList.contains("e-pv-li-select")&&(this.isStrikeThrough=!0),this.isStrikeThrough=!this.isStrikeThrough,this.isStrikeThrough?(this.formFieldStrikeOut="line-through",this.isUnderline=!1,t.classList.add("e-pv-li-select")):(this.formFieldStrikeOut="none",t.classList.remove("e-pv-li-select"))))},Q2t.prototype.clearFontAlignIconSelection=function(e){for(var t=0;t<e.children.length;t++)e.children[parseInt(t.toString(),10)].classList.contains("e-pv-li-select")&&e.children[parseInt(t.toString(),10)].classList.remove("e-pv-li-select")},Q2t.prototype.fontAlignClicked=function(e){var t;e.target&&(e.target.classList.remove("e-pv-li-select"),-1!==e.target.id.indexOf("_formField_left_align")?(t=-1!==e.target.id.indexOf("_formField_left_align_div")?e.target:e.target.parentElement,this.formFieldAlign="left"):-1!==e.target.id.indexOf("_formField_right_align")?(t=-1!==e.target.id.indexOf("_formField_right_align_div")?e.target:e.target.parentElement,this.formFieldAlign="right"):(t=-1!==e.target.id.indexOf("_formField_center_align_div")?e.target:e.target.parentElement,this.formFieldAlign="center"),this.clearFontAlignIconSelection(e.currentTarget),t.classList.add("e-pv-li-select"))},Q2t.prototype.onFontColorChange=function(e){this.fontColorValue=""===e.currentValue.hex?"#ffffff00":e.currentValue.hex,this.updateColorInIcon(this.fontColorElement,this.fontColorValue),this.fontColorDropDown.toggle()},Q2t.prototype.onColorPickerChange=function(e){this.backgroundColorValue=""===e.currentValue.hex?"#ffffff00":e.currentValue.hex,this.updateColorInIcon(this.colorDropDownElement,this.backgroundColorValue),this.colorDropDown.toggle()},Q2t.prototype.updateColorInIcon=function(e,t){e.childNodes[0].style.borderBottomColor=t},Q2t.prototype.onStrokePickerChange=function(e){this.borderColorValue=""===e.currentValue.hex?"#ffffff00":e.currentValue.hex,this.updateColorInIcon(this.strokeDropDownElement,this.borderColorValue),this.strokeDropDown.toggle()},Q2t.prototype.createDropDownButton=function(e,t,i){var n=document.getElementById(i.id+"-popup"),n=(n&&n.remove(),new u2({iconCss:t+" e-pv-icon",target:i}));return this.pdfViewer.enableRtl&&(n.enableRtl=!0),n.appendTo(e),n},Q2t.prototype.addClassFontItem=function(e,t,i){var n=Q("div",{id:this.pdfViewer.element.id+e+"_div"}),e=(n.classList.add(t+"-div"),Q("span",{id:this.pdfViewer.element.id+e+"_span"}));switch(e.classList.add(t),e.classList.add("e-pv-icon"),t){case"e-pv-bold-icon":this.setToolTip(this.pdfViewer.localeObj.getConstant("Bold"),n);break;case"e-pv-italic-icon":this.setToolTip(this.pdfViewer.localeObj.getConstant("Italic"),n);break;case"e-pv-underlinetext-icon":this.setToolTip(this.pdfViewer.localeObj.getConstant("Underlines"),n);break;case"e-pv-strikeout-icon":this.setToolTip(this.pdfViewer.localeObj.getConstant("Strikethroughs"),n);break;case"e-pv-left-align-icon":this.setToolTip(this.pdfViewer.localeObj.getConstant("Align left"),n);break;case"e-pv-center-align-icon":this.setToolTip(this.pdfViewer.localeObj.getConstant("Center"),n);break;case"e-pv-right-align-icon":this.setToolTip(this.pdfViewer.localeObj.getConstant("Align right"),n)}return i&&n.classList.add("e-pv-li-select"),n.appendChild(e),n},Q2t.prototype.createLabelElement=function(e,t,i,n,o){var r=Q("div",{id:o+"_container",className:n+"-container"}),s=null;i&&((s=Q("div",{id:o+"_label",className:n})).textContent=e,r.appendChild(s)),t.appendChild(s)},Q2t.prototype.setReadOnlyToFormField=function(e,t){for(var i=0;i<this.pdfViewer.formFieldCollection.length;i++){var n=this.pdfViewer.formFieldCollection[parseInt(i.toString(),10)];if(n.formFieldAnnotationType===e.formFieldAnnotationType&&n.name===e.name&&n.id===e.id)switch(n.isReadonly=t,n.formFieldAnnotationType){case"Textbox":case"PasswordField":case"DropdownList":case"ListBox":case"SignatureField":case"InitialField":case"RadioButton":var o=document.getElementById(n.id+"_content_html_element").firstElementChild.firstElementChild;this.setReadOnlyToElement(n,o,t);break;case"Checkbox":o=document.getElementById(n.id+"_content_html_element").firstElementChild.firstElementChild.lastElementChild;this.setReadOnlyToElement(n,o,t)}}},Q2t.prototype.getFormDesignerSignField=function(e){for(var t,i=this.pdfViewer.formFieldCollections,n=0;n<i.length;n++)"SignatureField"!==(t=i[parseInt(n.toString(),10)].type)&&"InitialField"!==t||e.push(i[parseInt(n.toString(),10)]);return e},Q2t.prototype.setRequiredToFormField=function(e,t){for(var i=0;i<this.pdfViewer.formFieldCollection.length;i++){var n=this.pdfViewer.formFieldCollection[parseInt(i.toString(),10)];if(n.formFieldAnnotationType===e.formFieldAnnotationType&&n.name===e.name&&n.id===e.id)switch(n.isRequired=t,n.formFieldAnnotationType){case"Textbox":case"PasswordField":case"DropdownList":case"SignatureField":case"InitialField":var o=document.getElementById(n.id+"_content_html_element").firstElementChild.firstElementChild;this.setRequiredToElement(n,o,t);break;case"RadioButton":o=document.getElementById(n.id+"_content_html_element").firstElementChild.firstElementChild.firstElementChild;this.setRequiredToElement(n,o,t),this.updateFormFieldCollections(n);break;case"Checkbox":var r=document.getElementById(n.id+"_content_html_element").firstElementChild.firstElementChild.lastElementChild;this.setRequiredToElement(n,r,t)}}},Q2t.prototype.isTransparentBackground=function(e){return"#00000000"===(e="object"==typeof e?JSON.stringify(e):e)||"transparent"===e||"rgba(0,0,0,0)"===e||'{"r":0,"g":0,"b":0,"a":0}'===e},Q2t.prototype.setReadOnlyToElement=function(e,t,i){var n,o="#daeaf7ff",r={r:218,g:234,b:247,a:100};"DropdownList"!==e.formFieldAnnotationType&&"ListBox"!==e.formFieldAnnotationType||(t.parentElement.style.backgroundColor=t.style.backgroundColor),!i&&t.disabled&&(t.disabled=!1),i&&("RadioButton"===e.formFieldAnnotationType?t.parentElement.style.cursor="default":"SignatureField"===e.formFieldAnnotationType||"InitialField"===e.formFieldAnnotationType?(n=je(e.thickness)?e.thickness:1,t.parentElement.style.borderWidth=n):t.style.cursor="default"),i&&this.isAddFormFieldProgrammatically&&(this.previousBackgroundColor=e.backgroundColor),"RadioButton"===e.formFieldAnnotationType?t.style.backgroundColor=e.isReadonly?e.backgroundColor!==o&&JSON.stringify(e.backgroundColor)!==JSON.stringify(r)?e.backgroundColor:"transparent":this.isTransparentBackground(e.backgroundColor)?o:e.backgroundColor:"SignatureField"===e.formFieldAnnotationType||"InitialField"===e.formFieldAnnotationType?je(e)||""!==e.value||(n=e.backgroundColor||"#FFE48559",t.parentElement.style.backgroundColor=i?n:mRt.setTransparencyToHex(n)):t.style.backgroundColor=e.isReadonly?e.backgroundColor!==o?e.backgroundColor:"transparent":this.isTransparentBackground(e.backgroundColor)?o:e.backgroundColor!==this.previousBackgroundColor?e.backgroundColor:this.previousBackgroundColor,e.backgroundColor=e.isReadonly?e.backgroundColor!==o&&JSON.stringify(e.backgroundColor)!==JSON.stringify(r)?e.backgroundColor:"transparent":this.isTransparentBackground(e.backgroundColor)?o:e.backgroundColor!==this.previousBackgroundColor?e.backgroundColor:this.previousBackgroundColor},Q2t.prototype.setRequiredToElement=function(e,t,i){var n;i?(t.required=!0,t.style.border="1px solid red","RadioButton"===e.formFieldAnnotationType?(n=0===e.thickness?1:e.thickness,t.parentElement.style.boxShadow="red 0px 0px 0px "+n+"px"):"SignatureField"!==e.formFieldAnnotationType&&"InitialField"!==e.formFieldAnnotationType||(n=0<e.thickness?e.thickness:1,t.style.border=n+"px solid red")):(t.required=!1,"SignatureField"===e.formFieldAnnotationType||"InitialField"===e.formFieldAnnotationType?t.style.borderWidth=e.thickness:t.style.borderWidth=e.thickness+"px",t.style.borderColor=e.borderColor,"RadioButton"===e.formFieldAnnotationType&&(t.parentElement.style.boxShadow=e.borderColor+" 0px 0px 0px "+e.thickness+"px"))},Q2t.prototype.destroyPropertiesWindow=function(){this.formFieldListItemCollection=[],this.formFieldListItemDataSource=[],this.formFieldFontFamily=null,this.formFieldFontSize=null,this.formFieldAlign=null,this.fontColorValue=null,this.backgroundColorValue=null,this.borderColorValue=null,this.formFieldBorderWidth=null,this.formFieldName=null,this.formFieldChecked=null,this.formFieldReadOnly=null,this.formFieldRequired=null,this.formFieldTooltip=null,this.formFieldPrinting=null,this.formFieldMultiline=null,this.formFieldVisibility=null,this.strokeColorPicker&&(this.strokeColorPicker.destroy(),this.strokeColorPicker=null),this.strokeDropDown&&(this.strokeDropDown.destroy(),this.strokeDropDown=null),this.strokeDropDownElement&&(this.strokeDropDownElement=null),this.colorDropDownElement&&(this.colorDropDownElement=null),this.colorPalette&&(this.colorPalette.destroy(),this.colorPalette=null),this.colorDropDown&&(this.colorDropDown.destroy(),this.colorDropDown=null),this.thicknessElement&&(this.thicknessElement=null),this.thicknessDropDown&&(this.thicknessDropDown.destroy(),this.thicknessDropDown=null),this.fontColorDropDown&&(this.fontColorDropDown.destroy(),this.fontColorDropDown=null),this.fontColorPalette&&(this.fontColorPalette.destroy(),this.fontColorPalette=null),this.maxLengthItem&&(this.maxLengthItem.destroy(),this.maxLengthItem=null);var e=this.pdfViewerBase.getElement("_properties_window");e&&e.parentElement.removeChild(e)},Q2t.prototype.destroy=function(){if(this.destroyPropertiesWindow(),null!=this.formFieldTooltips){for(var e=0;e<this.formFieldTooltips.length;e++)this.formFieldTooltips[parseInt(e.toString(),10)].destroy();this.formFieldTooltips=[]}},Q2t.prototype.hex=function(e){return("0"+e.toString(16)).slice(-2)},Q2t.prototype.getModuleName=function(){return"FormDesigner"},Q2t.prototype.updateAnnotationCanvas=function(e,t,i,n){var o=this.pdfViewerBase.getZoomRatio();e.width=t*o,e.height=i*o,e.style.width=t+"px",e.style.height=i+"px",e.style.position="absolute",e.style.zIndex="1",this.pdfViewerBase.applyElementStyles(e,n)},Q2t.prototype.getFontFamily=function(e){return-1<["Helvetica","Courier","Times New Roman","Symbol","ZapfDingbats"].indexOf(e)},Q2t.prototype.updateTextFieldSettingProperties=function(e,t,i){var n=this.pdfViewer.textFieldSettings;!je(n.isReadOnly)&&this.textFieldPropertyChanged.isReadOnlyChanged&&(e.isReadonly=n.isReadOnly),!je(n.isRequired)&&this.textFieldPropertyChanged.isRequiredChanged&&(e.isRequired=n.isRequired),n.value&&this.textFieldPropertyChanged.isValueChanged&&(e.value=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.value):n.value),n.backgroundColor&&"white"!==n.backgroundColor&&this.textFieldPropertyChanged.isBackgroundColorChanged&&(e.backgroundColor=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.backgroundColor):n.backgroundColor),n.borderColor&&"black"!==n.borderColor&&this.textFieldPropertyChanged.isBorderColorChanged&&(e.borderColor=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.borderColor):n.borderColor),n.alignment&&"Left"!==n.alignment&&this.textFieldPropertyChanged.isAlignmentChanged&&(e.alignment=n.alignment),n.color&&"black"!==n.color&&this.textFieldPropertyChanged.isColorChanged&&(e.color=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.color):n.color),n.fontFamily&&"Helvetica"!==n.fontFamily&&this.textFieldPropertyChanged.isFontFamilyChanged&&(e.fontFamily=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.fontFamily):n.fontFamily),n.fontSize&&10!==n.fontSize&&this.textFieldPropertyChanged.isFontSizeChanged&&(e.fontSize=n.fontSize),n.fontStyle&&this.textFieldPropertyChanged.isFontStyleChanged&&(e.fontStyle=this.getFontStyleName(n.fontStyle,e)),n.name&&this.textFieldPropertyChanged.isNameChanged&&(e.name=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.name):n.name),n.tooltip&&this.textFieldPropertyChanged.isToolTipChanged&&(e.tooltip=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.tooltip):n.tooltip),n.thickness&&1!==n.thickness&&this.textFieldPropertyChanged.isThicknessChanged&&(e.thickness=n.thickness),n.maxLength&&this.textFieldPropertyChanged.isMaxLengthChanged&&(e.maxLength=n.maxLength),n.visibility&&this.textFieldPropertyChanged.isVisibilityChanged&&(e.visibility=n.visibility),!je(n.isPrint)&&this.textFieldPropertyChanged.isPrintChanged&&(e.isPrint=n.isPrint),!je(n.isMultiline)&&this.textFieldPropertyChanged.isMultilineChanged&&(e.isMultiline=n.isMultiline),!je(n.customData)&&this.textFieldPropertyChanged.isCustomDataChanged&&(e.customData=n.customData)},Q2t.prototype.updatePasswordFieldSettingProperties=function(e,t,i){var n=this.pdfViewer.passwordFieldSettings;!je(n.isReadOnly)&&this.passwordFieldPropertyChanged.isReadOnlyChanged&&(e.isReadonly=n.isReadOnly),!je(n.isRequired)&&this.passwordFieldPropertyChanged.isRequiredChanged&&(e.isRequired=n.isRequired),n.value&&this.passwordFieldPropertyChanged.isValueChanged&&(e.value=n.value),n.backgroundColor&&"white"!==n.backgroundColor&&this.passwordFieldPropertyChanged.isBackgroundColorChanged&&(e.backgroundColor=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.backgroundColor):n.backgroundColor),n.borderColor&&"black"!==n.borderColor&&this.passwordFieldPropertyChanged.isBorderColorChanged&&(e.borderColor=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.borderColor):n.borderColor),n.alignment&&"Left"!==n.alignment&&this.passwordFieldPropertyChanged.isAlignmentChanged&&(e.alignment=n.alignment),n.color&&"black"!==n.color&&this.passwordFieldPropertyChanged.isColorChanged&&(e.color=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.color):n.color),n.fontFamily&&"Helvetica"!==n.fontFamily&&this.passwordFieldPropertyChanged.isFontFamilyChanged&&(e.fontFamily=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.fontFamily):n.fontFamily),n.fontSize&&10!==n.fontSize&&this.passwordFieldPropertyChanged.isFontSizeChanged&&(e.fontSize=n.fontSize),n.fontStyle&&this.passwordFieldPropertyChanged.isFontStyleChanged&&(e.fontStyle=this.getFontStyleName(n.fontStyle,e)),n.name&&this.passwordFieldPropertyChanged.isNameChanged&&(e.name=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.name):n.name),n.tooltip&&this.passwordFieldPropertyChanged.isToolTipChanged&&(e.tooltip=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.tooltip):n.tooltip),n.thickness&&1!==n.thickness&&this.passwordFieldPropertyChanged.isThicknessChanged&&(e.thickness=n.thickness),n.maxLength&&this.passwordFieldPropertyChanged.isMaxLengthChanged&&(e.maxLength=n.maxLength),n.visibility&&this.passwordFieldPropertyChanged.isVisibilityChanged&&(e.visibility=n.visibility),!je(n.isPrint)&&this.passwordFieldPropertyChanged.isPrintChanged&&(e.isPrint=n.isPrint),!je(n.customData)&&this.passwordFieldPropertyChanged.isCustomDataChanged&&(e.customData=n.customData)},Q2t.prototype.updateCheckBoxFieldSettingsProperties=function(e,t,i){var n=this.pdfViewer.checkBoxFieldSettings;!je(n.isReadOnly)&&this.checkBoxFieldPropertyChanged.isReadOnlyChanged&&(e.isReadonly=n.isReadOnly),!je(n.isRequired)&&this.checkBoxFieldPropertyChanged.isRequiredChanged&&(e.isRequired=n.isRequired),n.value&&this.checkBoxFieldPropertyChanged.isValueChanged&&(e.value=n.value),n.backgroundColor&&"white"!==n.backgroundColor&&this.checkBoxFieldPropertyChanged.isBackgroundColorChanged&&(e.backgroundColor=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.backgroundColor):n.backgroundColor),n.borderColor&&"black"!==n.borderColor&&this.checkBoxFieldPropertyChanged.isBorderColorChanged&&(e.borderColor=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.borderColor):n.borderColor),n.name&&this.checkBoxFieldPropertyChanged.isNameChanged&&(e.name=go.sanitize(n.name)),n.tooltip&&this.checkBoxFieldPropertyChanged.isToolTipChanged&&(e.tooltip=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.tooltip):n.tooltip),n.thickness&&1!==n.thickness&&this.checkBoxFieldPropertyChanged.isThicknessChanged&&(e.thickness=n.thickness),n.visibility&&this.checkBoxFieldPropertyChanged.isVisibilityChanged&&(e.visibility=n.visibility),!je(n.isPrint)&&this.checkBoxFieldPropertyChanged.isPrintChanged&&(e.isPrint=n.isPrint),!je(n.isChecked)&&this.checkBoxFieldPropertyChanged.isCheckedChanged&&(e.isChecked=n.isChecked),!je(n.customData)&&this.checkBoxFieldPropertyChanged.isCustomDataChanged&&(e.customData=n.customData)},Q2t.prototype.updateRadioButtonFieldSettingProperties=function(e,t,i){var n=this.pdfViewer.radioButtonFieldSettings;!je(n.isReadOnly)&&this.radioButtonFieldPropertyChanged.isReadOnlyChanged&&(e.isReadonly=n.isReadOnly),!je(n.isRequired)&&this.radioButtonFieldPropertyChanged.isRequiredChanged&&(e.isRequired=n.isRequired),n.value&&this.radioButtonFieldPropertyChanged.isValueChanged&&(e.value=n.value),n.backgroundColor&&"white"!==n.backgroundColor&&this.radioButtonFieldPropertyChanged.isBackgroundColorChanged&&(e.backgroundColor=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.backgroundColor):n.backgroundColor),n.borderColor&&"black"!==n.borderColor&&this.radioButtonFieldPropertyChanged.isBorderColorChanged&&(e.borderColor=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.borderColor):n.borderColor),n.name&&this.radioButtonFieldPropertyChanged.isNameChanged&&(e.name=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.name):n.name),n.tooltip&&this.radioButtonFieldPropertyChanged.isToolTipChanged&&(e.tooltip=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.tooltip):n.tooltip),n.thickness&&1!==n.thickness&&this.radioButtonFieldPropertyChanged.isThicknessChanged&&(e.thickness=n.thickness),n.visibility&&this.radioButtonFieldPropertyChanged.isVisibilityChanged&&(e.visibility=n.visibility),!je(n.isPrint)&&this.radioButtonFieldPropertyChanged.isPrintChanged&&(e.isPrint=n.isPrint),!je(n.isSelected)&&this.radioButtonFieldPropertyChanged.isSelectedChanged&&(e.isSelected=n.isSelected),!je(n.customData)&&this.radioButtonFieldPropertyChanged.isCustomDataChanged&&(e.customData=n.customData)},Q2t.prototype.updateDropdownFieldSettingsProperties=function(e,t,i){var n=this.pdfViewer.DropdownFieldSettings;!je(n.isReadOnly)&&this.dropdownFieldPropertyChanged.isReadOnlyChanged&&(e.isReadonly=n.isReadOnly),!je(n.isRequired)&&this.dropdownFieldPropertyChanged.isRequiredChanged&&(e.isRequired=n.isRequired),n.backgroundColor&&"white"!==n.backgroundColor&&this.dropdownFieldPropertyChanged.isBackgroundColorChanged&&(e.backgroundColor=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.backgroundColor):n.backgroundColor),n.borderColor&&"black"!==n.borderColor&&this.dropdownFieldPropertyChanged.isBorderColorChanged&&(e.borderColor=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.borderColor):n.borderColor),n.alignment&&"Left"!==n.alignment&&this.dropdownFieldPropertyChanged.isAlignmentChanged&&(e.alignment=n.alignment),n.color&&"black"!==n.color&&this.dropdownFieldPropertyChanged.isColorChanged&&(e.color=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.color):n.color),n.fontFamily&&"Helvetica"!==n.fontFamily&&this.dropdownFieldPropertyChanged.isFontFamilyChanged&&(e.fontFamily=go.sanitize(n.fontFamily)),n.fontSize&&10!==n.fontSize&&this.dropdownFieldPropertyChanged.isFontSizeChanged&&(e.fontSize=n.fontSize),n.fontStyle&&this.dropdownFieldPropertyChanged.isFontStyleChanged&&(e.fontStyle=this.getFontStyleName(n.fontStyle,e)),n.name&&this.dropdownFieldPropertyChanged.isNameChanged&&(e.name=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.name):n.name),n.tooltip&&this.dropdownFieldPropertyChanged.isToolTipChanged&&(e.tooltip=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.tooltip):n.tooltip),n&&1!==n.thickness&&this.dropdownFieldPropertyChanged.isThicknessChanged&&(e.thickness=n.thickness),n.visibility&&this.dropdownFieldPropertyChanged.isVisibilityChanged&&(e.visibility=n.visibility),!je(n.isPrint)&&this.dropdownFieldPropertyChanged.isPrintChanged&&(e.isPrint=n.isPrint),n.options&&this.dropdownFieldPropertyChanged.isOptionChanged&&(e.options=(e.options&&0<e.options.length?e:n).options),!je(n.customData)&&this.dropdownFieldPropertyChanged.isCustomDataChanged&&(e.customData=n.customData)},Q2t.prototype.updatelistBoxFieldSettingsProperties=function(e,t,i){var n=this.pdfViewer.listBoxFieldSettings;!je(n.isReadOnly)&&this.listBoxFieldPropertyChanged.isReadOnlyChanged&&(e.isReadonly=n.isReadOnly),!je(n.isRequired)&&this.listBoxFieldPropertyChanged.isRequiredChanged&&(e.isRequired=n.isRequired),n.backgroundColor&&"white"!==n.backgroundColor&&this.listBoxFieldPropertyChanged.isBackgroundColorChanged&&(e.backgroundColor=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.backgroundColor):n.backgroundColor),n.borderColor&&"black"!==n.borderColor&&this.listBoxFieldPropertyChanged.isBorderColorChanged&&(e.borderColor=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.borderColor):n.borderColor),n.alignment&&"Left"!==n.alignment&&this.listBoxFieldPropertyChanged.isAlignmentChanged&&(e.alignment=n.alignment),n.color&&"black"!==n.color&&this.listBoxFieldPropertyChanged.isColorChanged&&(e.color=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.color):n.color),n.fontFamily&&"Helvetica"!==n.fontFamily&&this.listBoxFieldPropertyChanged.isFontFamilyChanged&&(e.fontFamily=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.fontFamily):n.fontFamily),n.fontSize&&10!==n.fontSize&&this.listBoxFieldPropertyChanged.isFontSizeChanged&&(e.fontSize=n.fontSize),n.fontStyle&&this.listBoxFieldPropertyChanged.isFontStyleChanged&&(e.fontStyle=this.getFontStyleName(n.fontStyle,e)),n.name&&this.listBoxFieldPropertyChanged.isNameChanged&&(e.name=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.name):n.name),n.tooltip&&this.listBoxFieldPropertyChanged.isToolTipChanged&&(e.tooltip=this.pdfViewer.enableHtmlSanitizer?go.sanitize(n.tooltip):n.tooltip),n.thickness&&1!==n.thickness&&this.listBoxFieldPropertyChanged.isThicknessChanged&&(e.thickness=n.thickness),n.visibility&&this.listBoxFieldPropertyChanged.isVisibilityChanged&&(e.visibility=n.visibility),!je(n.isPrint)&&this.listBoxFieldPropertyChanged.isPrintChanged&&(e.isPrint=n.isPrint),n.options&&this.listBoxFieldPropertyChanged.isOptionChanged&&(e.options=(e.options&&0<e.options.length?e:n).options),!je(n.customData)&&this.listBoxFieldPropertyChanged.isCustomDataChanged&&(e.customData=n.customData)},Q2t.prototype.updateSignInitialFieldProperties=function(e,t,i,n){var o=this.pdfViewer.initialFieldSettings,r=this.pdfViewer.signatureFieldSettings;t?(!je(o.isReadOnly)&&this.initialFieldPropertyChanged.isReadOnlyChanged&&(e.isReadonly=o.isReadOnly),je(o.isRequired)||!this.initialFieldPropertyChanged.isRequiredChanged||this.pdfViewer.magnificationModule.isFormFieldPageZoomed||(e.isRequired=o.isRequired),o.visibility&&this.initialFieldPropertyChanged.isVisibilityChanged&&!this.pdfViewer.magnificationModule.isFormFieldPageZoomed&&(e.visibility=o.visibility),o.tooltip&&this.initialFieldPropertyChanged.isTooltipChanged&&!this.pdfViewer.magnificationModule.isFormFieldPageZoomed&&(e.tooltip=this.pdfViewer.enableHtmlSanitizer?go.sanitize(o.tooltip):o.tooltip),!je(o.thickness)&&!0===n&&this.initialFieldPropertyChanged.isThicknessChanged&&(e.thickness=o.thickness),o.name&&this.initialFieldPropertyChanged.isNameChanged&&!this.pdfViewer.magnificationModule.isFormFieldPageZoomed&&(e.name=this.pdfViewer.enableHtmlSanitizer?go.sanitize(o.name):o.name),je(o.isPrint)||!this.initialFieldPropertyChanged.isPrintChanged||this.pdfViewer.magnificationModule.isFormFieldPageZoomed||(e.isPrint=o.isPrint),!je(o.customData)&&this.initialFieldPropertyChanged.isCustomDataChanged&&(e.customData=o.customData)):(!je(r.isReadOnly)&&this.signatureFieldPropertyChanged.isReadOnlyChanged&&(e.isReadonly=r.isReadOnly),je(r.isRequired)||!this.signatureFieldPropertyChanged.isRequiredChanged||this.pdfViewer.magnificationModule.isFormFieldPageZoomed||(e.isRequired=r.isRequired),r.visibility&&this.signatureFieldPropertyChanged.isVisibilityChanged&&!this.pdfViewer.magnificationModule.isFormFieldPageZoomed&&(e.visibility=r.visibility),r.tooltip&&this.signatureFieldPropertyChanged.isTooltipChanged&&!this.pdfViewer.magnificationModule.isFormFieldPageZoomed&&(e.tooltip=this.pdfViewer.enableHtmlSanitizer?go.sanitize(r.tooltip):r.tooltip),!je(r.thickness)&&!0===n&&this.signatureFieldPropertyChanged.isThicknessChanged&&(e.thickness=r.thickness),r.name&&this.signatureFieldPropertyChanged.isNameChanged&&!this.pdfViewer.magnificationModule.isFormFieldPageZoomed&&(e.name=this.pdfViewer.enableHtmlSanitizer?go.sanitize(r.name):r.name),je(r.isPrint)||!this.signatureFieldPropertyChanged.isPrintChanged||this.pdfViewer.magnificationModule.isFormFieldPageZoomed||(e.isPrint=r.isPrint),!je(r.customData)&&this.signatureFieldPropertyChanged.isCustomDataChanged&&(e.customData=r.customData))},Q2t.prototype.updateSignatureSettings=function(e,t){(t=!je(t)&&t)?(this.initialFieldPropertyChanged.isReadOnlyChanged=!je(e.isReadOnly),this.initialFieldPropertyChanged.isRequiredChanged=!je(e.isRequired),this.initialFieldPropertyChanged.isVisibilityChanged=!je(e.visibility),this.initialFieldPropertyChanged.isTooltipChanged=!je(e.tooltip),this.initialFieldPropertyChanged.isNameChanged=!je(e.name),this.initialFieldPropertyChanged.isPrintChanged=!je(e.isPrint),this.initialFieldPropertyChanged.isThicknessChanged=!je(e.thickness),this.initialFieldPropertyChanged.isCustomDataChanged=!je(e.customData)):(this.signatureFieldPropertyChanged.isReadOnlyChanged=!je(e.isReadOnly),this.signatureFieldPropertyChanged.isRequiredChanged=!je(e.isRequired),this.signatureFieldPropertyChanged.isVisibilityChanged=!je(e.visibility),this.signatureFieldPropertyChanged.isTooltipChanged=!je(e.tooltip),this.signatureFieldPropertyChanged.isNameChanged=!je(e.name),this.signatureFieldPropertyChanged.isPrintChanged=!je(e.isPrint),this.signatureFieldPropertyChanged.isThicknessChanged=!je(e.thickness),this.signatureFieldPropertyChanged.isCustomDataChanged=!je(e.customData))},Q2t.prototype.updateTextFieldSettings=function(e){this.textFieldPropertyChanged.isReadOnlyChanged=!je(e.isReadOnly),this.textFieldPropertyChanged.isRequiredChanged=!je(e.isRequired),this.textFieldPropertyChanged.isValueChanged=!je(e.value),this.textFieldPropertyChanged.isBackgroundColorChanged=!je(e.backgroundColor),this.textFieldPropertyChanged.isBorderColorChanged=!je(e.borderColor),this.textFieldPropertyChanged.isAlignmentChanged=!je(e.alignment),this.textFieldPropertyChanged.isColorChanged=!je(e.color),this.textFieldPropertyChanged.isFontFamilyChanged=!je(e.fontFamily),this.textFieldPropertyChanged.isFontSizeChanged=!je(e.fontSize),this.textFieldPropertyChanged.isFontStyleChanged=!je(e.fontStyle),this.textFieldPropertyChanged.isNameChanged=!je(e.name),this.textFieldPropertyChanged.isToolTipChanged=!je(e.tooltip),this.textFieldPropertyChanged.isThicknessChanged=!je(e.thickness),this.textFieldPropertyChanged.isMaxLengthChanged=!je(e.maxLength),this.textFieldPropertyChanged.isVisibilityChanged=!je(e.visibility),this.textFieldPropertyChanged.isPrintChanged=!je(e.isPrint),this.textFieldPropertyChanged.isMultilineChanged=!je(e.isMultiline),this.textFieldPropertyChanged.isCustomDataChanged=!je(e.customData)},Q2t.prototype.updatePasswordFieldSettings=function(e){this.passwordFieldPropertyChanged.isReadOnlyChanged=!je(e.isReadOnly),this.passwordFieldPropertyChanged.isRequiredChanged=!je(e.isRequired),this.passwordFieldPropertyChanged.isValueChanged=!je(e.value),this.passwordFieldPropertyChanged.isBackgroundColorChanged=!je(e.backgroundColor),this.passwordFieldPropertyChanged.isBorderColorChanged=!je(e.borderColor),this.passwordFieldPropertyChanged.isAlignmentChanged=!je(e.alignment),this.passwordFieldPropertyChanged.isColorChanged=!je(e.color),this.passwordFieldPropertyChanged.isFontFamilyChanged=!je(e.fontFamily),this.passwordFieldPropertyChanged.isFontSizeChanged=!je(e.fontSize),this.passwordFieldPropertyChanged.isFontStyleChanged=!je(e.fontStyle),this.passwordFieldPropertyChanged.isNameChanged=!je(e.name),this.passwordFieldPropertyChanged.isToolTipChanged=!je(e.tooltip),this.passwordFieldPropertyChanged.isThicknessChanged=!je(e.thickness),this.passwordFieldPropertyChanged.isMaxLengthChanged=!je(e.maxLength),this.passwordFieldPropertyChanged.isVisibilityChanged=!je(e.visibility),this.passwordFieldPropertyChanged.isPrintChanged=!je(e.isPrint),this.passwordFieldPropertyChanged.isCustomDataChanged=!je(e.customData)},Q2t.prototype.updateCheckBoxFieldSettings=function(e){this.checkBoxFieldPropertyChanged.isReadOnlyChanged=!je(e.isReadOnly),this.checkBoxFieldPropertyChanged.isRequiredChanged=!je(e.isRequired),this.checkBoxFieldPropertyChanged.isBackgroundColorChanged=!je(e.backgroundColor),this.checkBoxFieldPropertyChanged.isBorderColorChanged=!je(e.borderColor),this.checkBoxFieldPropertyChanged.isNameChanged=!je(e.name),this.checkBoxFieldPropertyChanged.isValueChanged=!je(e.value),this.checkBoxFieldPropertyChanged.isToolTipChanged=!je(e.tooltip),this.checkBoxFieldPropertyChanged.isThicknessChanged=!je(e.thickness),this.checkBoxFieldPropertyChanged.isVisibilityChanged=!je(e.visibility),this.checkBoxFieldPropertyChanged.isPrintChanged=!je(e.isPrint),this.checkBoxFieldPropertyChanged.isCheckedChanged=!je(e.isChecked),this.checkBoxFieldPropertyChanged.isCustomDataChanged=!je(e.customData)},Q2t.prototype.updateRadioButtonFieldSettings=function(e){this.radioButtonFieldPropertyChanged.isReadOnlyChanged=!je(e.isReadOnly),this.radioButtonFieldPropertyChanged.isRequiredChanged=!je(e.isRequired),this.radioButtonFieldPropertyChanged.isBackgroundColorChanged=!je(e.backgroundColor),this.radioButtonFieldPropertyChanged.isBorderColorChanged=!je(e.borderColor),this.radioButtonFieldPropertyChanged.isNameChanged=!je(e.name),this.radioButtonFieldPropertyChanged.isValueChanged=!je(e.value),this.radioButtonFieldPropertyChanged.isToolTipChanged=!je(e.tooltip),this.radioButtonFieldPropertyChanged.isThicknessChanged=!je(e.thickness),this.radioButtonFieldPropertyChanged.isVisibilityChanged=!je(e.visibility),this.radioButtonFieldPropertyChanged.isPrintChanged=!je(e.isPrint),this.radioButtonFieldPropertyChanged.isSelectedChanged=!je(e.isSelected),this.radioButtonFieldPropertyChanged.isCustomDataChanged=!je(e.customData)},Q2t.prototype.updateDropDownFieldSettings=function(e){this.dropdownFieldPropertyChanged.isReadOnlyChanged=!je(e.isReadOnly),this.dropdownFieldPropertyChanged.isRequiredChanged=!je(e.isRequired),this.dropdownFieldPropertyChanged.isValueChanged=!je(e.value),this.dropdownFieldPropertyChanged.isBackgroundColorChanged=!je(e.backgroundColor),this.dropdownFieldPropertyChanged.isBorderColorChanged=!je(e.borderColor),this.dropdownFieldPropertyChanged.isAlignmentChanged=!je(e.alignment),this.dropdownFieldPropertyChanged.isColorChanged=!je(e.color),this.dropdownFieldPropertyChanged.isFontFamilyChanged=!je(e.fontFamily),this.dropdownFieldPropertyChanged.isFontSizeChanged=!je(e.fontSize),this.dropdownFieldPropertyChanged.isFontStyleChanged=!je(e.fontStyle),this.dropdownFieldPropertyChanged.isNameChanged=!je(e.name),this.dropdownFieldPropertyChanged.isToolTipChanged=!je(e.tooltip),this.dropdownFieldPropertyChanged.isThicknessChanged=!je(e.thickness),this.dropdownFieldPropertyChanged.isVisibilityChanged=!je(e.visibility),this.dropdownFieldPropertyChanged.isPrintChanged=!je(e.isPrint),this.dropdownFieldPropertyChanged.isOptionChanged=!je(e.options),this.dropdownFieldPropertyChanged.isCustomDataChanged=!je(e.customData)},Q2t.prototype.updateListBoxFieldSettings=function(e){this.listBoxFieldPropertyChanged.isReadOnlyChanged=!je(e.isReadOnly),this.listBoxFieldPropertyChanged.isRequiredChanged=!je(e.isRequired),this.listBoxFieldPropertyChanged.isBackgroundColorChanged=!je(e.backgroundColor),this.listBoxFieldPropertyChanged.isBorderColorChanged=!je(e.borderColor),this.listBoxFieldPropertyChanged.isAlignmentChanged=!je(e.alignment),this.listBoxFieldPropertyChanged.isColorChanged=!je(e.color),this.listBoxFieldPropertyChanged.isFontFamilyChanged=!je(e.fontFamily),this.listBoxFieldPropertyChanged.isFontSizeChanged=!je(e.fontSize),this.listBoxFieldPropertyChanged.isFontStyleChanged=!je(e.fontStyle),this.listBoxFieldPropertyChanged.isNameChanged=!je(e.name),this.listBoxFieldPropertyChanged.isToolTipChanged=!je(e.tooltip),this.listBoxFieldPropertyChanged.isThicknessChanged=!je(e.thickness),this.listBoxFieldPropertyChanged.isVisibilityChanged=!je(e.visibility),this.listBoxFieldPropertyChanged.isPrintChanged=!je(e.isPrint),this.listBoxFieldPropertyChanged.isOptionChanged=!je(e.options),this.listBoxFieldPropertyChanged.isCustomDataChanged=!je(e.customData)},Q2t.prototype.getFontStyleName=function(e,t){var i="None";return 1===e&&(t.font.isBold=!0,i="Bold"),2===e&&(t.font.isItalic=!0,i="Italic"),3===e&&(t.font.isBold=!0,t.font.isItalic=!0,i="Bold Italic"),4===e&&(t.font.isUnderline=!0,i="Underline"),5===e&&(t.font.isBold=!0,t.font.isUnderline=!0,i="Bold Underline"),6===e&&(t.font.isUnderline=!0,t.font.isItalic=!0,i="Underline Italic"),7===e&&(t.font.isBold=!0,t.font.isItalic=!0,t.font.isUnderline=!0,i="Bold Italic Underline"),8===e&&(t.font.isStrikeout=!0,i="Strikethrough"),9===e&&(t.font.isBold=!0,t.font.isStrikeout=!0,i="Bold Strikethrough"),10===e&&(t.font.isItalic=!0,t.font.isStrikeout=!0,i="Italic Strikethrough"),11===e&&(t.font.isBold=!0,t.font.isItalic=!0,t.font.isStrikeout=!0,i="Bold Italic Strikethrough"),12===e&&(t.font.isUnderline=!0,t.font.isStrikeout=!0,i="Underline Strikethrough"),13===e&&(t.font.isBold=!0,t.font.isUnderline=!0,t.font.isStrikeout=!0,i="Bold Underline Strikethrough"),14===e&&(t.font.isItalic=!0,t.font.isUnderline=!0,t.font.isStrikeout=!0,i="Italic Underline Strikethrough"),15===e&&(t.font.isBold=!0,t.font.isItalic=!0,t.font.isUnderline=!0,t.font.isStrikeout=!0,i="Bold Italic Underline Strikethrough"),i},Q2t.prototype.getAlignment=function(e){var t;"left"===e?t="left":"right"===e?t="right":"center"===e&&(t="center"),this.formFieldAlign=t},Q2t.prototype.getFontStyle=function(e){e.isBold&&(this.formFieldBold="bold"),e.isItalic&&(this.formFieldItalic="italic"),e.isUnderline&&(this.formFieldUnderline="underline"),e.isStrikeout&&(this.formFieldStrikeOut="line-through")};var W2t=Q2t;function Q2t(e,t){this.formFieldTooltips=[],this.isFormFieldExistingInCollection=!1,this.multilineCheckboxCheckedState=!1,this.formFieldListItemCollection=[],this.formFieldListItemDataSource=[],this.isInitialField=!1,this.isSetFormFieldMode=!1,this.isAddFormFieldProgrammatically=!1,this.isAddFormFieldUi=!1,this.increasedSize=5,this.defaultZoomValue=1,this.defaultFontSize=10,this.signIndicatorPadding=3,this.signIndicatorMinimunFontSize=1,this.signatureFieldPropertyChanged={isReadOnlyChanged:!1,isRequiredChanged:!1,isVisibilityChanged:!1,isNameChanged:!1,isPrintChanged:!1,isTooltipChanged:!1,isThicknessChanged:!1},this.initialFieldPropertyChanged={isReadOnlyChanged:!1,isRequiredChanged:!1,isVisibilityChanged:!1,isNameChanged:!1,isPrintChanged:!1,isTooltipChanged:!1,isThicknessChanged:!1},this.textFieldPropertyChanged={isReadOnlyChanged:!1,isRequiredChanged:!1,isBackgroundColorChanged:!1,isBorderColorChanged:!1,isAlignmentChanged:!1,isFontSizeChanged:!1,isNameChanged:!1,isToolTipChanged:!1,isThicknessChanged:!1,isVisibilityChanged:!1,isPrintChanged:!1,isSelected:!1,isFontFamilyChanged:!1,isFontStyle:!1,isValueChanged:!1,isMaXLength:!1,isColorChanged:!1,isMultilineChanged:!1},this.passwordFieldPropertyChanged={isReadOnlyChanged:!1,isRequiredChanged:!1,isBackgroundColorChanged:!1,isBorderColorChanged:!1,isAlignmentChanged:!1,isFontSizeChanged:!1,isNameChanged:!1,isToolTipChanged:!1,isThicknessChanged:!1,isVisibilityChanged:!1,isPrintChanged:!1,isSelected:!1,isFontFamilyChanged:!1,isFontStyle:!1,isValueChanged:!1,isMaXLength:!1,isColorChanged:!1},this.checkBoxFieldPropertyChanged={isReadOnlyChanged:!1,isRequiredChanged:!1,isBackgroundColorChanged:!1,isBorderColorChanged:!1,isNameChanged:!1,isToolTipChanged:!1,isThicknessChanged:!1,isVisibilityChanged:!1,isPrintChanged:!1,isCheckedChanged:!1,isValueChanged:!1},this.radioButtonFieldPropertyChanged={isReadOnlyChanged:!1,isRequiredChanged:!1,isBackgroundColorChanged:!1,isBorderColorChanged:!1,isNameChanged:!1,isToolTipChanged:!1,isThicknessChanged:!1,isVisibilityChanged:!1,isPrintChanged:!1,isSelectedChanged:!1,isValueChanged:!1},this.dropdownFieldPropertyChanged={isReadOnlyChanged:!1,isRequiredChanged:!1,isBackgroundColorChanged:!1,isBorderColorChanged:!1,isAlignmentChanged:!1,isFontSizeChanged:!1,isNameChanged:!1,isToolTipChanged:!1,isThicknessChanged:!1,isVisibilityChanged:!1,isPrintChanged:!1,isSelected:!1,isFontFamilyChanged:!1,isFontStyle:!1,isColorChanged:!1,isOptionChanged:!1},this.listBoxFieldPropertyChanged={isReadOnlyChanged:!1,isRequiredChanged:!1,isBackgroundColorChanged:!1,isBorderColorChanged:!1,isAlignmentChanged:!1,isFontSizeChanged:!1,isNameChanged:!1,isToolTipChanged:!1,isThicknessChanged:!1,isVisibilityChanged:!1,isPrintChanged:!1,isSelected:!1,isFontFamilyChanged:!1,isFontStyle:!1,isColorChanged:!1,isOptionChanged:!1},this.disableSignatureClickEvent=!1,this.formFieldIndex=0,this.formFieldIdIndex=0,this.isProgrammaticSelection=!1,this.isShapeCopied=!1,this.isFormFieldSizeUpdated=!1,this.isDrawHelper=!1,this.isFormFieldUpdated=!1,this.isPropertyDialogOpen=!1,this.pdfViewer=e,this.pdfViewerBase=t}q2t.prototype.addTaggedLayer=function(e){var t,i,n;return this.pdfViewer.enableAccessibilityTags&&this.pdfViewerBase.isTaggedPdf&&(t=document.getElementById(this.pdfViewer.element.id+"_pageDiv_"+e),i=document.getElementById(this.pdfViewer.element.id+"_taggedLayer_"+e),(n=document.getElementById(this.pdfViewer.element.id+"_textLayer_"+e))&&n.setAttribute("aria-hidden","true"),(i=i||Q("div",{id:this.pdfViewer.element.id+"_taggedLayer_"+e,className:"e-pv-tagged-layer e-pv-text-layer"})).innerHTML="",i.style.width=this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].width*this.pdfViewerBase.getZoomFactor()+"px",i.style.height=this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].height*this.pdfViewerBase.getZoomFactor()+"px",i.style.pointerEvents="none",t)&&t.appendChild(i),i},q2t.prototype.renderAccessibilityTags=function(e,t){for(var i=this.addTaggedLayer(e),n=0;n<t.length;n++){var o=Q("div",{id:this.pdfViewer.element.id+"_taggedText_"+e+"_"+parseInt(n.toString(),10),className:"e-pv-text",attrs:{tabindex:"-1"}}),r=t[parseInt(n.toString(),10)].Bounds;"Paragraph"===t[parseInt(parseInt(n.toString(),10).toString(),10)].TagType&&null===t[parseInt(n.toString(),10)].ChildElements&&""===t[parseInt(n.toString(),10)].Text.trim()||(o.appendChild(this.createTag(t[parseInt(n.toString(),10)])),o.style.display="inline",this.setStyleToTaggedTextDiv(o,r,t[parseInt(n.toString(),10)].FontSize,t[parseInt(n.toString(),10)].FontName,t[parseInt(n.toString(),10)].FontStyle),this.setTextElementProperties(o),i.appendChild(o))}},q2t.prototype.getTag=function(e){switch(e){case"Paragraph":return"p";case"Figure":return"img";case"Article":return"art";case"Annotation":return"annot";case"BibliographyEntry":return"bibentry";case"BlockQuotation":return"blockQuote";case"Caption":return"caption";case"Code":return"code";case"Division":return"div";case"Document":return"document";case"Form":return"form";case"Formula":return"formula";case"Index":return"index";case"Heading":return"h";case"HeadingLevel1":return"h1";case"HeadingLevel2":return"h2";case"HeadingLevel3":return"h3";case"HeadingLevel4":return"h4";case"HeadingLevel5":return"h5";case"HeadingLevel6":return"h6";case"Label":return"label";case"Link":return"a";case"List":return"ul";case"ListItem":return"li";case"ListBody":return"p";case"Note":return"note";case"Part":return"part";case"Quotation":return"quote";case"Reference":return"reference";case"Section":return"sect";case"Span":return"span";case"Table":return"table";case"TableDataCell":return"td";case"TableHeader":return"th";case"TableOfContent":return"toc";case"TableOfContentItem":return"toci";case"TableRow":return"tr";case"Image":return"img";default:return"p"}},q2t.prototype.setStyleToTaggedTextDiv=function(e,t,i,n,o){var r=this.pdfViewerBase.getZoomFactor(),t=(e.style.left=this.pdfViewerBase.ConvertPointToPixel(t.X)*r+"px",e.style.top=this.pdfViewerBase.ConvertPointToPixel(t.Y)*r+"px",e.style.width=this.pdfViewerBase.ConvertPointToPixel(t.Width)*r+"px",this.pdfViewerBase.ConvertPointToPixel(t.Height)*r);e.style.height=t+"px",e.style.fontSize=this.pdfViewerBase.ConvertPointToPixel(i)*r+"px",!n||"Wingdings"!==n&&"Symbol"!==n?n&&(e.style.fontFamily=n):e.style.fontFamily="Verdana",o&&(e.style.fontWeight=o),e.style.color="transparent"},q2t.prototype.setTextElementProperties=function(e){e.style.transformOrigin="0%"},q2t.prototype.getModuleName=function(){return"AccessibilityTags"},q2t.prototype.destroy=function(){return!0};var U2t=q2t;function q2t(e,t){this.createTag=function(e){var t=this,i=e.TagType,n=e.ParentTagType,o=e.Text,r=e.AltText,s=e.Bounds,a=e.ChildElements,l=document.createElement(this.getTag(i));return l.style.padding="0px",l.style.margin="0px","Document"!==n&&"Part"!==n&&(l.style.position="absolute"),s&&(this.setStyleToTaggedTextDiv(l,s,e.FontSize,e.FontName,e.FontStyle),this.setTextElementProperties(l)),""!==o.trim()&&(l.innerText=o),"Image"!==i&&"Figure"!==i||(r&&""!==r.trim()&&(l.alt=r),l.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNgYAAAAAMAASsJTYQAAAAASUVORK5CYII="),a&&0<a.length&&a.forEach(function(e){"Table"===i?e.ChildElements&&e.ChildElements.forEach(function(e){l.appendChild(t.createTag(e))}):l.appendChild(t.createTag(e))}),l},this.pdfViewer=e,this.pdfViewerBase=t}function G2t(e,t,i,n){this.X=e,this.Y=t,this.Width=i,this.Height=n,this.Location={X:e,Y:t},this.Size={IsEmpty:!1,Width:i,Height:n},this.Left=e,this.Top=t,this.Right=e+i,this.Bottom=t+n}function Y2t(){function y(n,o,r){return function(e){var t=w.heap(n,o),i=t[0],t=t.slice(1);return e.apply(void 0,t.map(function(e){return e.p}))?(e=t.map(function(e){return e.v}),i.free(),e):(i.free(),r)}}var v,b=!1,X={},w=w||{},C=void 0!==w.Module?w.Module:{},S=Float64Array;function e(){X.Init=C.cwrap("FPDF_InitLibrary"),X.RenderPageBitmap=C.cwrap("FPDF_RenderPageBitmap","",["number","number","number","number","number","number","number","number"]),X.Bitmap_FillRect=C.cwrap("FPDFBitmap_FillRect","",["number","number","number","number","number","number"]),X.Bitmap_CreateEx=C.cwrap("FPDFBitmap_CreateEx","number",["number","number","number","number","number"]),X.Bitmap_Destroy=C.cwrap("FPDFBitmap_Destroy","",["number"]),X.LoadPage=C.cwrap("FPDF_LoadPage","number",["number","number"]),X.ClosePage=C.cwrap("FPDF_ClosePage","",["number"]),X.LoadMemDocument=C.cwrap("FPDF_LoadMemDocument","number",["number","number","string"]),X.GetPageSizeByIndex=C.cwrap("FPDF_GetPageSizeByIndex","number",["number","number","number","number"]),X.GetLastError=C.cwrap("FPDF_GetLastError","number"),X.GetPageCount=C.cwrap("FPDF_GetPageCount","number",["number"]),X.CloseDocument=C.cwrap("FPDF_CloseDocument","",["number"]),X.DestroyLibrary=C.cwrap("FPDF_DestroyLibrary"),X.LoadTextPage=C.cwrap("FPDFText_LoadPage","number",["number"]),X.CloseTextPage=C.cwrap("FPDFText_ClosePage","",["number"]),X.TextCountChars=C.cwrap("FPDFText_CountChars","number",["number"]),X.GetUnicodeChar=C.cwrap("FPDFText_GetUnicode","number",["number"]),X.GetCharBox=C.cwrap("FPDFText_GetCharBox","number",["number","number","number","number","number"]),X.GetPageRotation=C.cwrap("FPDFPage_GetRotation","number",["number"]),X.GetCharAngle=C.cwrap("FPDFText_GetCharAngle","number",["number"]),X.TextFindStart=C.cwrap("FPDFText_FindStart","",["number","number","number","number"]),X.TextFindClose=C.cwrap("FPDFText_FindClose","",["number"]),X.TextFindNext=C.cwrap("FPDFText_FindNext","",["number"]),X.TextFindResultIndex=C.cwrap("FPDFText_GetSchResultIndex","",["number"]),X.TextFindCount=C.cwrap("FPDFText_GetSchCount","",["number"]),X.GetPageHeight=C.cwrap("FPDF_GetPageHeight","number",["number"]),X.GetPageHeight=C.cwrap("FPDF_GetPageHeight","number",["number"]),X.GetPageWidth=C.cwrap("FPDF_GetPageWidth","number",["number"]),w.heap=function(e,t){var i;switch(e){case Int8Array:i=C.HEAP8;break;case Int16Array:i=C.HEAP16;break;case Int32Array:i=C.HEAP32;break;case Uint8Array:i=C.HEAPU8;break;case Uint16Array:i=C.HEAPU16;break;case Uint32Array:i=C.HEAPU32;break;case Float32Array:i=C.HEAPF32;break;case Float64Array:i=C.HEAPF64}for(var n=e.BYTES_PER_ELEMENT,o=C.asm.malloc(t*n),r=Array(1+t),s=(r[0]={s:t,J:e,Z:n,E:i,m:o,free:function(){return C.asm.free(o)}},0);s<t;s++)!function(e){r[e+1]={p:o+e*n,get v(){return i[o/n+e]}}}(s);return r}}function A(){(!0||b)&&(e(),w.loaded)&&w.loaded()}Object.assign(X,{LCD_TEXT:2,NO_NATIVETEXT:4,GRAYSCALE:8,DEBUG_INFO:128,NO_CATCH:256,RENDER_LIMITEDIMAGECACHE:512,RENDER_FORCEHALFTONE:1024,PRINTING:2048,REVERSE_BYTE_ORDER:16,Bitmap_Gray:1,Bitmap_BGR:2,Bitmap_BGRx:3,Bitmap_BGRA:4,LAST_ERROR:{SUCCESS:0,UNKNOWN:1,FILE:2,FORMAT:3,PASSWORD:4,SECURITY:5,PAGE:6}}),C.onRuntimeInitialized=function(){b=!0,A()},w.onload=function(){A()},w.loaded=function(){x.postMessage({message:"loaded"})};var x=self,i=(x.onmessage=function(o){var e;if("initialLoading"===o.data.message?(importScripts(o.data.url+"/pdfium.js"),C.url=o.data.url,C.onRuntimeInitialized=function(){if(b=!0,A(),o.data.fonts&&0<Object.keys(o.data.fonts).length){var e,t="/usr/share/fonts/";for(e in C.FS.createPath("/",t,!0,!0),o.data.fonts)o.data.fonts[""+e]&&-1===e.indexOf("fallbackfonts")&&C.FS.createDataFile(t+e,null,o.data.fonts[""+e],!0,!0,!0)}},this.PDFiumModule(C)):"LoadPageCollection"===o.data.message?(w.fileByteArray=o.data.uploadedFile,r=w.fileByteArray.length,X.Init(),s=C.asm.malloc(r),C.HEAPU8.set(w.fileByteArray,s),w.fileByteArray=null,v=new I({wasm:X.LoadMemDocument(s,r,o.data.password),wasmBuffer:s}),i=X.GetPageCount(v.processor.wasmData.wasm),v.setPages(i),v.createAllPages(),x.postMessage({message:"PageLoaded",pageIndex:o.data.pageIndex,isZoomMode:o.data.isZoomMode})):"LoadPageStampCollection"===o.data.message&&(r=o.data.uploadedFile.length,X.Init(),s=C.asm.malloc(r),C.HEAPU8.set(o.data.uploadedFile,s),r=new I({wasm:X.LoadMemDocument(s,r,o.data.password),wasmBuffer:s}),i=X.GetPageCount(r.processor.wasmData.wasm),r.setPages(i),r.createAllPages(),t=r.getPage(o.data.pageIndex),s=o.data,(n=t.render(null,s.zoomFactor,!1,null,null,null,!0)).message="LoadedStamp",n.annotName=o.data.AnnotName,n.rubberStampAnnotationPageNumber=o.data.rubberStampAnnotationPageNumber,n.annotationOrder=o.data.annotationOrder,n.collectionOrder=o.data.collectionOrder,n.isFormField=o.data.isFormField,n.isFormField&&(n.message="LoadedStampForFormFields",n.formFieldName=o.data.formFieldName,n.formFieldList=o.data.formFieldList,n.formFields=o.data.rubberStampAnnotation,n.PageIndex=o.data.PageIndex),x.postMessage(n)),v)if("renderPage"===o.data.message){var t=v.getPage(o.data.pageIndex),i=o.data,n=t.render(null,i.zoomFactor,i.isTextNeed,null,null,i.textDetailsId,null,o.data.cropBoxRect,o.data.mediaBoxRect);x.postMessage(n)}else if("renderPageSearch"===o.data.message){var t=v.getPage(o.data.pageIndex),r=o.data;(n=t.render(null,r.zoomFactor,r.isTextNeed,null,null,r.textDetailsId,null,o.data.cropBoxRect)).message="imageRenderedSearch",x.postMessage(n)}else if(-1!==o.data.message.indexOf("extractText")){var t=v.getPage(o.data.pageIndex),s=o.data,i=o.data.isSkipCharacterBounds;(n=t.render("extractText",s.zoomFactor,s.isTextNeed,null,null,s.textDetailsId,null,null,null,null,i)).message=o.data.message,n.isLayout=o.data.isLayout,n.isRenderText=o.data.isRenderText,n.jsonObject=o.data.jsonObject,n.requestType=o.data.requestType,n.annotationObject=o.data.annotationObject,n.pageIndex=o.data.pageIndex,n.options=o.data.options,n.isAPI=o.data.isAPI,n.isNeedToRender=o.data.isNeedToRender,x.postMessage(n)}else if("searchText"===o.data.message){for(var r=X.GetPageCount(v.processor.wasmData.wasm),a=o.data.searchWord,l=new Uint16Array(a.length+1),h=0;h<a.length;h++)l[parseInt(h.toString(),10)]=a.charCodeAt(h);l[a.length]=0;for(var u=C.asm.malloc(l.length*l.BYTES_PER_ELEMENT),g=(C.HEAPU16.set(l,u/Uint16Array.BYTES_PER_ELEMENT),0),m=!0===o.data.matchCase?1:0,s=o.data.startIndex,d=o.data.endIndex,f={},p=function(l){for(var h=-1,e=X.LoadPage(v.processor.wasmData.wasm,l),d=X.LoadTextPage(e),p=X.TextFindStart(d,u,m,0),c=X.GetPageHeight(e),t=function(){g++,h++;for(var e=X.TextFindCount(p),r=X.TextFindResultIndex(p),i=(f[parseInt(l.toString(),10)]||(f[parseInt(l.toString(),10)]={Indices:[],Bounds:{},pageOccurrence:0}),f[parseInt(l.toString(),10)].Bounds[parseInt(h.toString(),10)]||(f[parseInt(l.toString(),10)].Bounds[parseInt(h.toString(),10)]=[]),f[parseInt(l.toString(),10)].Indices.push(r),Number.POSITIVE_INFINITY),n=0,s=Number.POSITIVE_INFINITY,a=0,t=0;t<e;t++)!function(o){var e,t=X.GetUnicodeChar(d,r+o),t=String.fromCharCode(t);"\r"!==t&&"\n"!==t&&(e=y(S,4,[-1,-1,-1,-1])(function(e,t,i,n){return X.GetCharBox(d,r+o,e,t,i,n)}),i=Math.min(i,e[0]),n=Math.max(n,e[1]),s=Math.min(s,e[2]),a=Math.max(a,e[3])),"\r"===t&&(e=new K(i*(96/72),96/72*(c-(a-s)-s),96/72*(n-i),96/72*(a-s),"",null),f[parseInt(l.toString(),10)].Bounds[parseInt(h.toString(),10)].push(e),f[parseInt(l.toString(),10)].Bounds[parseInt(h.toString(),10)].sort(function(e,t){return e.Top===t.Top?e.Left-t.Left:e.Top-t.Top}),i=Number.POSITIVE_INFINITY,n=0,s=Number.POSITIVE_INFINITY,a=0)}(t);var o=new K(i*(96/72),96/72*(c-(a-s)-s),96/72*(n-i),96/72*(a-s),"",null);f[parseInt(l.toString(),10)].Bounds[parseInt(h.toString(),10)].push(o),f[parseInt(l.toString(),10)].Bounds[parseInt(h.toString(),10)].sort(function(e,t){return e.Top===t.Top?e.Left-t.Left:e.Top-t.Top}),f[parseInt(l.toString(),10)].pageOccurrence=h+1};X.TextFindNext(p);)t();X.TextFindClose(p),X.ClosePage(e)},c=s;c<d;c++)p(c);i={totalSearchCount:g,resultPages:f,message:"textSearched",searchWord:a,matchCase:o.data.matchCase,isRequestsend:o.data.isRequestsend,isCompletedSearch:d===r,endIndex:d};x.postMessage(i),f={},C.asm.free(u)}else"renderThumbnail"===o.data.message?new Promise(function(e,t){try{var i,n=v.getPage(o.data.pageIndex);null!==n.processor&&void 0!==n.processor&&((i=n.render("thumbnail",null,o.data.isTextNeed,null,null,null,null,null,null,null,o.data.isSkipCharacterBounds)).isRenderText=o.data.isRenderText,i.jsonObject=o.data.jsonObject,i.requestType=o.data.requestType,e(i))}catch(e){t(e)}}).then(function(e){x.postMessage(e)}):"renderPreviewTileImage"===o.data.message?((n=(t=v.getPage(o.data.pageIndex)).render("thumbnail",null,o.data.isTextNeed,null,null,null,null,null,null,null,o.data.isSkipCharacterBounds)).message="renderPreviewTileImage",n.isRenderText=o.data.isRenderText,n.jsonObject=o.data.jsonObject,n.requestType=o.data.requestType,n.startIndex=o.data.startIndex,n.endIndex=o.data.endIndex,x.postMessage(n)):"printImage"===o.data.message?(n=(t=v.getPage(o.data.pageIndex)).render("print",null,!1,o.data.printScaleFactor,o.data.printDevicePixelRatio),x.postMessage(n)):"extractImage"===o.data.message||"extractImages"===o.data.message?(t=v.getPage(o.data.pageIndex),s=o.data,n=t.render(null,s.zoomFactor,s.isTextNeed,null,null,s.textDetailsId,null,null,null,o.data.size),"extractImage"===o.data.message&&(n.message="imageExtracted"),"extractImages"===o.data.message&&(n.message="imagesExtracted"),x.postMessage(n)):"renderImageAsTile"===o.data.message?(e=o.data,n=(t=v.getPage(o.data.pageIndex)).renderTileImage(e.tileX,e.tileY,e.tileXCount,e.tileYCount,e.zoomFactor,o.data.isTextNeed,o.data.textDetailsId,o.data.cropBoxRect,o.data.mediaBoxRect),x.postMessage(n)):"renderImageAsTileSearch"===o.data.message?(e=o.data,(n=(t=v.getPage(o.data.pageIndex)).renderTileImage(e.tileX,e.tileY,e.tileXCount,e.tileYCount,e.zoomFactor,o.data.isTextNeed,o.data.textDetailsId,o.data.cropBoxRect,o.data.mediaBoxRect)).message="renderTileImageSearch",x.postMessage(n)):"unloadFPDF"===o.data.message&&v&&(C.asm.free(v.processor.wasmData.wasmBuffer),X.CloseDocument(v.processor.wasmData.wasm),X.DestroyLibrary());"unloadFPDF"===o.data.message&&x.postMessage({message:""})},t.prototype.render=function(e,t,i,n,o,r,s,a,l,h,d){return this.processor.render(this.index,e,t,i,n,o,r,s,a,l,h,d)},t.prototype.renderTileImage=function(e,t,i,n,o,r,s,a,l){return this.processor.renderTileImage(this.index,e,t,i,n,o,r,s,a,l)},t);function t(e,t){this.index=e,this.src=null,this.processor=t}var K=function(e,t,i,n,o,r){this.X=e,this.Y=t,this.Width=i,this.Height=n,this.Bottom=this.Y+this.Height,this.Right=this.X+this.Width,this.Top=this.Y,this.Left=this.X,this.Rotation=r,this.Text=o},n=(o.prototype.getPageSize=function(i){var n=this;return void 0===i&&(i=0),y(S,2,[-1,-1])(function(e,t){return X.GetPageSizeByIndex(n.wasmData.wasm,i,e,t)}).map(function(e){return parseInt((e*(96/72)).toString(),10)})},o.prototype.getCharBounds=function(o,r){return void 0===r&&(r=0),y(S,4,[-1,-1,-1,-1])(function(e,t,i,n){return X.GetCharBox(o,r,e,t,i,n)})},o.prototype.getRender=function(e,t,i,n,o,r,s,a){void 0===e&&(e=0);var l=X.REVERSE_BYTE_ORDER,h=C.asm.malloc(t*i*4),d=(C.HEAPU8.fill(0,h,h+t*i*4),X.Bitmap_CreateEx(t,i,X.Bitmap_BGRA,h,4*t)),p=X.LoadPage(this.wasmData.wasm,e);return X.Bitmap_FillRect(d,0,0,t,i,o?16777215:4294967295),X.RenderPageBitmap(d,p,0,0,t,i,0,l),X.Bitmap_Destroy(d),this.textExtraction(p,e,n,r,s,a),X.ClosePage(p),h},o.prototype.textExtraction=function(O,N,V,e,_,H){var t;if(V){for(var V=this.getPageSize(N),i=V[0],n=V[1],o=(n+=this.pointerToPixelConverter(_&&_.y?_.y:0),X.LoadTextPage(O,N)),r=X.GetPageRotation(O),s=X.TextCountChars(o),a=(this.TextBounds=[],this.TextContent=[],""),l=0,h=0,d=0,p=0,c=[],u=[],g=[],m=[],f=[],y="",v=0,b=0,w=0,C=0,S=0,A=!0,z=!(this.CharacterBounds=[]),x=!1,j=!1,I=0;I<=s;I++)if(H){Q=X.GetUnicodeChar(o,I),T=String.fromCharCode(Q);I<s&&(a+=T)}else{var W,Q=X.GetUnicodeChar(o,I),U=X.GetCharAngle(o,I),T=String.fromCharCode(Q),q=this.getCharBounds(o,I),E=q[0],G=q[1],Y=q[2],D=q[3],M=this.pointerToPixelConverter(E)-this.pointerToPixelConverter(e&&e.x?e.x:0),k=n+this.pointerToPixelConverter(e&&e.y?e.y:0)-this.pointerToPixelConverter(D),P=this.pointerToPixelConverter(G-E),B=this.pointerToPixelConverter(D-Y),F=parseInt((180*U/Math.PI).toString(),10);switch(I<s&&(a+=T,W=new K(M,k,P,B,T,F),this.CharacterBounds.push(W)),1!==r&&3!==r||(k=i-this.pointerToPixelConverter(D)),T){case"\0":var l=Math.min.apply(Math,c),h=Math.max.apply(Math,u),d=Math.min.apply(Math,g),p=Math.max.apply(Math,m),L=new K(v,w,b-v,C-w,y,S);f.push(L),this.textBoundsCalculation(f,l,h,p,d,r,i,n,s),f=[],x=!(A=!0),y="",c=[],g=[],u=[],m=[],p=d=h=l=0;break;case"\r":I<s&&(R=new K(M,k,P,B,"\r\n",F),c.push(R.Top),u.push(R.Bottom),g.push(R.Left),m.push(R.Right),l=Math.min.apply(Math,c),h=Math.max.apply(Math,u),d=Math.min.apply(Math,g),L=void(p=Math.max.apply(Math,m)),!1===A&&(L=new K(v,w,b-v,C-w,y,S),f.push(L)),f.push(R),this.textBoundsCalculation(f,l,h,p,d,r,i,n,s),f=[],x=!(A=!0),y="",c=[],g=[],u=[],m=[],p=d=h=l=0,a+="\n",U=X.GetCharAngle(o,I),E=(t=this.getCharBounds(o,I))[0],G=t[1],Y=t[2],D=t[3],M=this.pointerToPixelConverter(E),k=n-this.pointerToPixelConverter(D),P=this.pointerToPixelConverter(G-E),B=this.pointerToPixelConverter(D-Y),F=parseInt((180*U/Math.PI).toString(),10),W=new K(M,k,P,B,T,F),this.CharacterBounds.push(W),I++);break;case"":case"￾":var R=new K(M,k,P,B,T,F),L=(c.push(R.Top),u.push(R.Bottom),g.push(R.Left),m.push(R.Right),l=Math.min.apply(Math,c),h=Math.max.apply(Math,u),d=Math.min.apply(Math,g),p=Math.max.apply(Math,m),void 0);!1===A&&(L=new K(v,w,b-v,C-w,y,S),f.push(L)),""===T&&f.push(R),this.textBoundsCalculation(f,l,h,p,d,r,i,n,s),f=[],x=!(A=!0),y="",c=[],g=[],u=[],m=[],p=d=h=l=0;break;default:x=A=0===P||0===B?(z=!0,l=Math.min.apply(Math,c),h=Math.max.apply(Math,u),d=Math.min.apply(Math,g),p=Math.max.apply(Math,m),L=new K(v,w,b-v,C-w,y,S),f.push(L),w=(R=new K(M,k,P,B,T,F)).Top,C=R.Bottom,v=R.Left,b=R.Right,S=f[f.length-1].Rotation,L=new K(v,w,b-v,C-w,y=T,S),f.push(L),y="",!(S=b=v=C=w=0)):(!0===A&&(C=(w=k)+B,b=(v=M)+P),R=new K(M,k,P,B,T,F)," "!==T?(x&&0<f.length&&F===f[0].Rotation&&((180===F||0===F)&&11<Math.abs(R.Y-f[0].Y)&&(j=!0),270===F||90===F)&&11<Math.abs(R.X-f[0].X)&&(j=!0),(z&&1<=f.length&&f[f.length-1].Rotation!==R.Rotation||j)&&(j=z=!1,l=Math.min.apply(Math,c),h=Math.max.apply(Math,u),d=Math.min.apply(Math,g),p=Math.max.apply(Math,m),L=void 0,!1===A&&(L=new K(v,w,b-v,C-w,y,S),f.push(L)),this.textBoundsCalculation(f,l,h,p,d,r,i,n,s),f=[],A=!0,y="",c=[],g=[],u=[],m=[],p=d=h=l=0),c.push(R.Top),u.push(R.Bottom),g.push(R.Left),m.push(R.Right),w=Math.min(w,R.Top),C=Math.max(C,R.Bottom),v=Math.min(v,R.Left),b=Math.max(b,R.Right),y+=T,S=R.Rotation,!1):(L=new K(v,w,b-v,C-w,y,S),f.push(L),w=R.Top,C=R.Bottom,v=R.Left,b=R.Right,S=R.Rotation,L=new K(v,w,b-v,C-w,y=T,S),f.push(L),y="",!(S=b=v=C=w=0)))}}X.CloseTextPage(o),this.Rotation=r,this.PageText=a}},o.prototype.pointerToPixelConverter=function(e){return e*(96/72)},o.prototype.textBoundsCalculation=function(p,e,t,i,n,o,r,s,a){var l,h=!1,d="",c=5,u=p.reduce(function(e,t){return e+t.Text},""),g=this.checkIsRtlText(u);if(5e3<=a){for(var m=[],f=0,y=function(e,t){t.minX=Math.min(t.minX,e.X),t.minY=Math.min(t.minY,e.Y),t.maxX=Math.max(t.maxX,e.X+e.Width),t.maxY=Math.max(t.maxY,e.Y+e.Height)},v=0;v<p.length;v++)!function(e){var t=0;if(e<p.length-1&&(t=p[parseInt((e+1).toString(),10)].Left-p[parseInt(e.toString(),10)].Right),c<=t&&"\r\n"!==p[parseInt(e.toString(),10)].Text){for(var i={minX:p[parseInt(f.toString(),10)].X,minY:p[parseInt(f.toString(),10)].Y,maxX:p[parseInt(f.toString(),10)].X,maxY:p[parseInt(f.toString(),10)].Y},n="",o=[],r=f;r<=e;r++){var s=p[parseInt(r.toString(),10)];y(s,i),o.push(s.Height),n+=s.Text}var a=i.maxX-i.minX,l=i.maxY-i.minY,t=new K(i.minX,i.minY,a,l,n,p[0].Rotation);m.push(t),f=e+1}else if(0===m.length&&e===p.length-1){var h={minX:p[0].X,minY:p[0].Y,maxX:p[0].X,maxY:p[0].Y},a=(p.forEach(function(e){y(e,h)}),h.maxX-h.minX),l=h.maxY-h.minY,t=p.map(function(e){return e.Text}).join(""),t=new K(h.minX,h.minY,a,l,t,p[0].Rotation);p=[t]}else if(e===p.length-1){for(var i={minX:p[parseInt(f.toString(),10)].X,minY:p[parseInt(f.toString(),10)].Y,maxX:p[parseInt(f.toString(),10)].X,maxY:p[parseInt(f.toString(),10)].Y},d="",o=[],r=f;r<=e;r++){s=p[parseInt(r.toString(),10)];y(s,i),o.push(s.Height),d+=s.Text}a=i.maxX-i.minX,l=i.maxY-i.minY,t=new K(i.minX,i.minY,a,l,d,p[0].Rotation);m.push(t)}}(v);0<m.length&&(p=m)}for(var b=0;b<p.length;b++){var w=p[parseInt(b.toString(),10)].Rotation;if(0===w||180===w?(h&&(this.TextBounds.push(l),this.TextContent.push(d),d=""),h=!1,0===o?l=new K(p[parseInt(b.toString(),10)].Left,e,p[parseInt(b.toString(),10)].Width,t-e,p[parseInt(b.toString(),10)].Text,w):1===o?l=new K(r-e,p[parseInt(b.toString(),10)].Left,p[parseInt(b.toString(),10)].Width,t-e,p[parseInt(b.toString(),10)].Text,w):2===o?l=new K(r-p[parseInt(b.toString(),10)].Left,s-e,p[parseInt(b.toString(),10)].Width,t-e,p[parseInt(b.toString(),10)].Text,w):3===o&&(l=new K(e,s-p[parseInt(b.toString(),10)].Left,p[parseInt(b.toString(),10)].Width,t-e,p[parseInt(b.toString(),10)].Text,w))):90===w||270===w?(h&&(this.TextBounds.push(l),this.TextContent.push(d),d=""),h=!1,0===o?l=new K(n,p[parseInt(b.toString(),10)].Top,i-n,p[parseInt(b.toString(),10)].Height,p[parseInt(b.toString(),10)].Text,w):1===o?l=new K(r-p[parseInt(b.toString(),10)].Top,n,i-n,p[parseInt(b.toString(),10)].Height,p[parseInt(b.toString(),10)].Text,w):2===o?l=new K(r-n,s-p[parseInt(b.toString(),10)].Top,i-n,p[parseInt(b.toString(),10)].Height,p[parseInt(b.toString(),10)].Text,w):3===o&&(l=new K(p[parseInt(b.toString(),10)].Top,s-n,i-n,p[parseInt(b.toString(),10)].Height,p[parseInt(b.toString(),10)].Text,w))):h?d+=p[parseInt(b.toString(),10)].Text:(h=!0,d+=p[parseInt(b.toString(),10)].Text,0===o?l=new K(p[parseInt(b.toString(),10)].Left,e,i-n,t-e,p[parseInt(b.toString(),10)].Text,w):1===o?l=new K(r-e,p[parseInt(b.toString(),10)].Left,i-n,t-e,p[parseInt(b.toString(),10)].Text,w):2===o?l=new K(r-p[parseInt(b.toString(),10)].Left,s-e,i-n,t-e,p[parseInt(b.toString(),10)].Text,w):3===o&&(l=new K(e,s-p[parseInt(b.toString(),10)].Left,i-n,t-e,p[parseInt(b.toString(),10)].Text,w))),!h&&" "===p[parseInt(b.toString(),10)].Text&&0!==b&&b+1<=p.length)if(g)b+1!==p.length?((30<(C=p[b-1].Left-(p[b+1].Left+p[b+1].Width))||C<0)&&(C=0),l=new K(p[b+1].Left+p[b+1].Width,e,C,t-e,p[parseInt(b.toString(),10)].Text,p[parseInt(b.toString(),10)].Rotation)):g&&(l=new K(p[b-1].Left-p[parseInt(b.toString(),10)].Width,e,p[parseInt(b.toString(),10)].Width,t-e,p[parseInt(b.toString(),10)].Text,p[parseInt(b.toString(),10)].Rotation));else if(b+1!==p.length){var C=0;switch(w){case 0:(30<(C=p[b+1].Left-(p[b-1].Left+p[b-1].Width))||C<0)&&(C=0),0===o?l=new K(p[b-1].Left+p[b-1].Width,e,C,t-e,p[parseInt(b.toString(),10)].Text,w):1===o?l=new K(r-e,p[b-1].Left+p[b-1].Width,C,t-e,p[parseInt(b.toString(),10)].Text,w):2===o?l=new K(r-(p[b-1].Left+p[b-1].Width),s-e,C,t-e,p[parseInt(b.toString(),10)].Text,w):3===o&&(l=new K(e,s-(p[b-1].Left+p[b-1].Width),C,t-e,p[parseInt(b.toString(),10)].Text,w));break;case 90:(30<(C=p[b+1].Top-(p[b-1].Top+p[b-1].Height))||C<0)&&(C=0),0===o?l=new K(n,p[b-1].Top+p[b-1].Height,i-n,C,p[parseInt(b.toString(),10)].Text,w):1===o?l=new K(r-(p[b-1].Top+p[b-1].Height),n,i-n,C,p[parseInt(b.toString(),10)].Text,w):2===o?l=new K(r-n,s-(p[b-1].Top+p[b-1].Height),i-n,C,p[parseInt(b.toString(),10)].Text,w):3===o&&(l=new K(p[b-1].Top+p[b-1].Height,s-n,i-n,C,p[parseInt(b.toString(),10)].Text,w));break;case 180:(30<(C=p[b-1].Left-(p[b+1].Left+p[b+1].Width))||C<0)&&(C=0),0===o?l=new K(p[b+1].Left+p[b+1].Width,e,C,t-e,p[parseInt(b.toString(),10)].Text,w):1===o?l=new K(r-e,p[b+1].Left+p[b+1].Width,C,t-e,p[parseInt(b.toString(),10)].Text,w):2===o?l=new K(r-(p[b+1].Left+p[b+1].Width),s-e,C,t-e,p[parseInt(b.toString(),10)].Text,w):3===o&&(l=new K(e,s-(p[b+1].Left+p[b+1].Width),C,t-e,p[parseInt(b.toString(),10)].Text,w));break;case 270:(30<(C=p[b-1].Top-(p[b+1].Top+p[b+1].Height))||C<0)&&(C=0),0===o?l=new K(n,p[b+1].Top+p[b+1].Height,i-n,C,p[parseInt(b.toString(),10)].Text,w):1===o?l=new K(r-(p[b+1].Top+p[b+1].Height),n,i-n,C,p[parseInt(b.toString(),10)].Text,w):2===o?l=new K(r-n,s-(p[b+1].Top+p[b+1].Height),i-n,C,p[parseInt(b.toString(),10)].Text,w):3===o&&(l=new K(p[b+1].Top+p[b+1].Height,s-n,i-n,C,p[parseInt(b.toString(),10)].Text,w))}}else switch(w){case 90:0===o?l=new K(n,p[b-1].Top+p[b-1].Height,i-n,p[parseInt(b.toString(),10)].Height,p[parseInt(b.toString(),10)].Text,w):1===o?l=new K(r-(p[b-1].Top+p[b-1].Height),n,i-n,p[parseInt(b.toString(),10)].Height,p[parseInt(b.toString(),10)].Text,w):2===o?l=new K(r-n,s-(p[b-1].Top+p[b-1].Height),i-n,p[parseInt(b.toString(),10)].Height,p[parseInt(b.toString(),10)].Text,w):3===o&&(l=new K(p[b-1].Top+p[b-1].Height,s-n,i-n,p[parseInt(b.toString(),10)].Height,p[parseInt(b.toString(),10)].Text,w));break;case 270:0===o?l=new K(n,p[b-1].Top-p[parseInt(b.toString(),10)].Height,i-n,p[parseInt(b.toString(),10)].Height,p[parseInt(b.toString(),10)].Text,w):1===o?l=new K(r-(p[b-1].Top-p[parseInt(b.toString(),10)].Height),n,i-n,p[parseInt(b.toString(),10)].Height,p[parseInt(b.toString(),10)].Text,w):2===o?l=new K(r-n,s-p[b-1].Top-p[parseInt(b.toString(),10)].Height,i-n,p[parseInt(b.toString(),10)].Height,p[parseInt(b.toString(),10)].Text,w):3===o&&(l=new K(p[b-1].Top-p[parseInt(b.toString(),10)].Height,s-n,i-n,p[parseInt(b.toString(),10)].Height,p[parseInt(b.toString(),10)].Text,w));break;case 180:0===o?l=new K(p[b-1].Left-p[parseInt(b.toString(),10)].Width,e,p[parseInt(b.toString(),10)].Width,t-e,p[parseInt(b.toString(),10)].Text,w):1===o?l=new K(r-e,p[b-1].Left-p[parseInt(b.toString(),10)].Width,p[parseInt(b.toString(),10)].Width,t-e,p[parseInt(b.toString(),10)].Text,w):2===o?l=new K(r-(p[b-1].Left-p[parseInt(b.toString(),10)].Width),s-e,p[parseInt(b.toString(),10)].Width,t-e,p[parseInt(b.toString(),10)].Text,w):3===o&&(l=new K(e,s-(p[b-1].Left-p[parseInt(b.toString(),10)].Width),p[parseInt(b.toString(),10)].Width,t-e,p[parseInt(b.toString(),10)].Text,w));break;case 0:0===o?l=new K(p[b-1].Left+p[b-1].Width,e,p[parseInt(b.toString(),10)].Width,t-e,p[parseInt(b.toString(),10)].Text,w):1===o?l=new K(r-e,p[b-1].Left+p[b-1].Width,p[parseInt(b.toString(),10)].Width,t-e,p[parseInt(b.toString(),10)].Text,w):2===o?l=new K(r-(p[b-1].Left+p[b-1].Width),s-e,p[parseInt(b.toString(),10)].Width,t-e,p[parseInt(b.toString(),10)].Text,w):3===o&&(l=new K(e,s-(p[b-1].Left+p[b-1].Width),p[parseInt(b.toString(),10)].Width,t-e,p[parseInt(b.toString(),10)].Text,w))}h||(this.TextBounds.push(l),this.TextContent.push(p[parseInt(b.toString(),10)].Text))}h&&(this.TextBounds.push(l),this.TextContent.push(d))},o.prototype.checkIsRtlText=function(e){return new RegExp("^[^A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02B8\\u0300-\\u0590\\u0800-\\u1FFF\\u2C00-\\uFB1C\\uFDFE-\\uFE6F\\uFEFD-\\uFFFF]*[\\u0591-\\u07FF\\uFB1D-\\uFDFD\\uFE70-\\uFEFC]").test(e)},o.prototype.getPageRender=function(e,t,i,n,o,r,s,a){e=this.getRender(e=void 0===e?0:e,t,i,n,o,r,s,a),n=C.HEAPU8.slice(e,e+t*i*4);return C.asm.free(e),n},o.prototype.render=function(e,t,i,n,o,r,s,a,l,h,d,p){var c,u=this.getPageSize(e=void 0===e?0:e),g=u[0],m=u[1];isNaN(g)&&isNaN(m)&&(v=X.LoadPage(this.wasmData.wasm,e),m=this.pointerToPixelConverter(X.GetPageHeight(v)),g=this.pointerToPixelConverter(X.GetPageWidth(v)));if("thumbnail"===t)return f=Math.round(149.55),y=Math.round(211.5),{value:b=this.getPageRender(e,f,y,n,null,null,null,p),width:f,height:y,pageIndex:e,message:"renderThumbnail",textBounds:this.TextBounds,textContent:this.TextContent,rotation:this.Rotation,pageText:this.PageText,characterBounds:this.CharacterBounds,zoomFactor:i,isTextNeed:n,textDetailsId:s};if("print"===t)return"Width"==((u=m)<(c=g)?"Width":"Height")?4493===(c=4493<g?4493:g)&&(u=m/(g/4493)):4493===(u=4493<m?4493:m)&&(c=g/(m/4493)),f=Math.round(c*o*1.5),y=Math.round(u*o*1.5),{value:b=this.getPageRender(e,f,y,!1,null,null,null,p),width:f,height:y,pageIndex:e,pageWidth:g,pageHeight:m,message:"printImage",printDevicePixelRatio:r};for(var f=Math.round(1.5*(d&&null!==d?d.width:g)*i),y=Math.round(1.5*(d&&null!==d?d.height:m)*i);2147483648<=f*y*4*2;)i-=.1,f=Math.round(this.pointerToPixelConverter(g)*i),y=Math.round(this.pointerToPixelConverter(m)*i);var v,b=null;return"extractText"===t?(v=X.LoadPage(this.wasmData.wasm,e),this.textExtraction(v,e,n,l,h,p),X.ClosePage(v)):b=this.getPageRender(e,f,y,n,a,l,h,p),{value:b,width:f,height:y,pageWidth:g,pageHeight:m,pageIndex:e,message:"imageRendered",textBounds:this.TextBounds,textContent:this.TextContent,rotation:this.Rotation,pageText:this.PageText,characterBounds:this.CharacterBounds,zoomFactor:i,isTextNeed:n,textDetailsId:s}},o.prototype.renderTileImage=function(e,t,i,n,o,r,s,a,l,h){var d=this.getPageSize(e=void 0===e?0:e),p=d[0],d=d[1],p=Math.round(1.5*p*r),d=Math.round(1.5*d*r),c=Math.round(p/n),u=Math.round(d/o),g=X.REVERSE_BYTE_ORDER,m=C.asm.malloc(c*u*4),f=(C.HEAPU8.fill(0,m,m+c*u*4),X.Bitmap_CreateEx(c,u,4,m,4*c)),y=X.LoadPage(this.wasmData.wasm,e),p=(X.Bitmap_FillRect(f,0,0,c,u,4294967295),X.RenderPageBitmap(f,y,-t*c,-i*u,p,d,0,g),X.Bitmap_Destroy(f),this.textExtraction(y,e,s,l,h),X.ClosePage(y),m),d=C.HEAPU8.slice(p,p+c*u*4);return C.asm.free(p),0===t&&0===i?{value:d,w:c,h:u,noTileX:n,noTileY:o,x:t,y:i,pageIndex:e,message:"renderTileImage",textBounds:this.TextBounds,textContent:this.TextContent,rotation:this.Rotation,pageText:this.PageText,characterBounds:this.CharacterBounds,textDetailsId:a,isTextNeed:s,zoomFactor:r}:{value:d,w:c,h:u,noTileX:n,noTileY:o,x:t,y:i,pageIndex:e,message:"renderTileImage",textDetailsId:a,isTextNeed:s,zoomFactor:r}},o.prototype.getLastError=function(){switch(X.GetLastError()){case X.LAST_ERROR.SUCCESS:return"success";case X.LAST_ERROR.UNKNOWN:return"unknown error";case X.LAST_ERROR.FILE:return"file not found or could not be opened";case X.LAST_ERROR.FORMAT:return"file not in PDF format or corrupted";case X.LAST_ERROR.PASSWORD:return"password required or incorrect password";case X.LAST_ERROR.SECURITY:return"unsupported security scheme";case X.LAST_ERROR.PAGE:return"page not found or content error";default:return"unknown error"}},o);function o(e){this.TextBounds=[],this.TextContent=[],this.CharacterBounds=[],this.PageText="",this.wasmData=e}r.prototype.setPages=function(e){this.pages=Array(e).fill(null)},r.prototype.createAllPages=function(){for(var e=0;e<this.pages.length;e++)this.pages[parseInt(e.toString(),10)]=new i(parseInt(e.toString(),10),this.processor)},r.prototype.getPage=function(e){var t=this.pages[parseInt(e.toString(),10)];return t||(t=new i(e),this.pages[parseInt(e.toString(),10)]=t),t};var I=r;function r(e){this.pages=[],this.processor=new n(e)}}K2t.prototype.exportAnnotationComments=function(e,t){var i=this.pdfViewer.pdfRendererModule.loadedDocument.getPage(parseInt(e.toString(),10)).rotation;return this.getAnnotationFromPDF(t.height,t.width,e,i)},K2t.prototype.IsStampExist=function(e){switch(e.trim()){case"Approved":case"Not Approved":case"Confidential":case"Draft":case"Final":case"Completed":case"For Public Release":case"Not For Public Release":case"For Comment":case"Void":case"Preliminary Results":case"Information Only":case"Witness":case"Initial Here":case"Sign Here":case"Accepted":case"Rejected":case"Revised":case"Reviewed":case"Received":return!0;default:return!1}},K2t.prototype.getAnnotationFromPDF=function(f,y,v,b){var w=this.pdfViewer.pdfRendererModule.loadedDocument.getPage(parseInt(v.toString(),10)),C=new lVt(this.pdfViewer,this.pdfViewerBase),S=[],A=[];if(this.isAnnotationPresent=!1,null!=w&&(A=this.getAllFreeTextAnnotations(w.annotations),this.annotationCount=0,null!=w.annotations)&&0<w.annotations.count){this.isAnnotationPresent=!0;for(var x=this,e=0;e<w.annotations.count;e++)!function(e){var t,i,e=w.annotations.at(e);if(e instanceof TEt?(p=C.loadTextMarkupAnnotation(e,f,y,b,w),x.textMarkupAnnotationList[x.textMarkupAnnotationList.length]=p,x.annotationOrder[x.annotationOrder.length]=p,!je(p=x.textMarkupAnnotationList[x.textMarkupAnnotationList.length-1].AnnotName)&&""!==p||(x.textMarkupAnnotationList[x.textMarkupAnnotationList.length-1].AnnotName=x.setAnnotationName(v))):e instanceof BTt?(je(c=x.getShapeFreeText(e.name,A))||S.push(c.name),!je(p=(h=C.loadLineAnnotation(e,f,y,b,c)).AnnotName)&&""!==p||(h.AnnotName=x.setAnnotationName(v)),je(h)||(h instanceof mVt?(x.measureAnnotationList[x.measureAnnotationList.length]=h,x.annotationOrder[x.annotationOrder.length]=h):h instanceof gVt&&(x.shapeAnnotationList[x.shapeAnnotationList.length]=h,x.annotationOrder[x.annotationOrder.length]=h))):e instanceof zTt||e instanceof QTt?(je(c=x.getShapeFreeText(e.name,A))||S.push(c.name),!je(p=(h=C.loadSquareAnnotation(e,f,y,b,c)).AnnotName)&&""!==p||(h.AnnotName=x.setAnnotationName(v)),je(h)||(h instanceof mVt?(x.measureAnnotationList[x.measureAnnotationList.length]=h,x.annotationOrder[x.annotationOrder.length]=h):h instanceof gVt&&(x.shapeAnnotationList[x.shapeAnnotationList.length]=h,x.annotationOrder[x.annotationOrder.length]=h))):e instanceof RTt?(je(c=x.getShapeFreeText(e.name,A))||S.push(c.name),je(h=C.loadEllipseAnnotation(e,f,y,b,c))||(h instanceof mVt?(x.measureAnnotationList[x.measureAnnotationList.length]=h,x.annotationOrder[x.annotationOrder.length]=h):h instanceof gVt&&(x.shapeAnnotationList[x.shapeAnnotationList.length]=h,x.annotationOrder[x.annotationOrder.length]=h))):e instanceof VTt?(je(c=x.getShapeFreeText(e.name,A))||S.push(c.name),je(h=C.loadEllipseAnnotation(e,f,y,b,c))||(h instanceof mVt?(x.measureAnnotationList[x.measureAnnotationList.length]=h,x.annotationOrder[x.annotationOrder.length]=h):h instanceof gVt&&(x.shapeAnnotationList[x.shapeAnnotationList.length]=h,x.annotationOrder[x.annotationOrder.length]=h))):e instanceof GTt?(je(c=x.getShapeFreeText(e.name,A))||S.push(c.name),!je(p=(h=C.loadPolygonAnnotation(e,f,y,b,c)).AnnotName)&&""!==p||(h.AnnotName=x.setAnnotationName(v)),je(h)||(h instanceof mVt?(x.measureAnnotationList[x.measureAnnotationList.length]=h,x.annotationOrder[x.annotationOrder.length]=h):h instanceof gVt&&(x.shapeAnnotationList[x.shapeAnnotationList.length]=h,x.annotationOrder[x.annotationOrder.length]=h))):(e instanceof KTt||e instanceof $Tt)&&(je(c=x.getShapeFreeText(e.name,A))||S.push(c.name),!je(p=(h=C.loadPolylineAnnotation(e,f,y,b,c)).AnnotName)&&""!==p||(h.AnnotName=x.setAnnotationName(v)),je(h)||(h instanceof mVt?(x.measureAnnotationList[x.measureAnnotationList.length]=h,x.annotationOrder[x.annotationOrder.length]=h):h instanceof gVt&&(x.shapeAnnotationList[x.shapeAnnotationList.length]=h,x.annotationOrder[x.annotationOrder.length]=h))),e instanceof BEt){x.htmldata=[];for(var n=e,o=[],r=0,s=x.pdfViewer.pdfRendererModule.formFieldsBase.PdfRenderedFormFields;r<s.length;r++){var a=s[r];if(a.ActualFieldName===n._dictionary._map.T){o.push(a);break}}if(n._dictionary.has("T")&&x.checkName(n))x.signatureAnnotationList.push(C.loadSignatureImage(n,v));else if(n._dictionary.has("M")||n._dictionary.has("NM")||n._dictionary.has("Name")&&!n._dictionary.has("F")||!n._dictionary.has("NM")&&!n._dictionary.has("T")||je(o[0])||!x.pdfViewerBase.isSignatureWithInRect(x.pdfViewerBase.canvasRectArray(o[0].LineBounds),x.pdfViewerBase.canvasRectArray(n.bounds))){var l=new J2t,h=(l.Author=n.author,l.Subject=n.subject,l.AnnotName=n.name,""!==l.AnnotName&&!je(l.AnnotName)||(l.AnnotName=x.setAnnotationName(v)),e._dictionary.has("rotateAngle")?void 0!==(c=e._dictionary.get("rotateAngle"))&&(l.RotateAngle=90*parseInt(c[0],10)):(l.RotateAngle=360-(Math.abs(n.rotate)-90*b),p=l.RotateAngle,360<=l.RotateAngle&&(l.RotateAngle=p-360)),!1),h=(0!==l.RotateAngle&&(h=Math.ceil(100*n._innerTemplateBounds.x)/100==Math.ceil(100*n.bounds.x)/100&&Math.ceil(100*n._innerTemplateBounds.y)/100==Math.ceil(100*n.bounds.y)/100&&Math.ceil(100*n._innerTemplateBounds.width)/100==Math.ceil(100*n.bounds.width)/100&&Math.ceil(100*n._innerTemplateBounds.height)/100==Math.ceil(100*n.bounds.height)/100),0!==l.RotateAngle&&h||0===l.RotateAngle?l.Rect=x.getBounds(n.bounds,f,y,b):(c=x.getRubberStampBounds(n._innerTemplateBounds,n.bounds,f,y,b),l.Rect=c),l.Rect.y<0&&(p=new dvt(l.Rect.x,w.cropBox[1]+l.Rect.y,l.Rect.width,l.Rect.height),l.Rect=x.getBounds(p,f,y,b)),l.Icon=n.icon,je(n.modifiedDate)?l.ModifiedDate=x.formatDate(new Date):l.ModifiedDate=x.formatDate(n.modifiedDate),l.Opacity=n.opacity,l.pageNumber=v,e._dictionary.get("AP"));if(x.pdfViewerBase.pngData.push(n),l.IsDynamic=!1,l.AnnotType="stamp",Object.prototype.hasOwnProperty.call(n._dictionary,"iconName")?l.IconName=n.getValues("iconName")[0]:null!==n.subject?l.IconName=n.subject:l.IconName="",je(n.text)?l.Note="":l.Note=n.text,C.updateIsLockProperty(l,n),!je(n.reviewHistory))for(var d=0;d<n.reviewHistory.count;d++)l.State=x.getStateString(n.reviewHistory.at(parseInt(d.toString(),10)).state),l.StateModel=x.getStateModelString(n.reviewHistory.at(parseInt(d.toString(),10)).stateModel);null!=l.State&&null!=l.StateModel||(l.State="Unmarked",l.StateModel="None"),l.Comments=new Array;for(var p,c,u,g=0;g<n.comments.count;g++){var m=C.loadPopupAnnotation(n.comments.at(g),f,y,b);l.Comments.push(m)}e._dictionary.has("Name")&&(l.Name=e._dictionary.get("Name"),e._dictionary.get("Name").name)&&(e._dictionary.get("Name").name.includes("#23D")||e._dictionary.get("Name").name.includes("#D"))&&(l.IsDynamic=!0),l.IsMaskedImage=x.isMaskedImage,l.Apperarance=x.htmldata,n._dictionary.has("CustomData")&&!je(c=n._dictionary.get("CustomData"))&&c.trim()&&(p=h.get("CustomData")?h.get("CustomData"):c)&&(l.CustomData=p),x.rubberStampAnnotationList.push(l),x.annotationOrder.push(l),je(h)?je(c=e._dictionary.get("AP"))||je(c.dictionary)||!c.dictionary.has("N")||je(c.dictionary)||(0===(u=e.createTemplate()).size[0]||0===u.size[1]||je(u._appearance)?x.findStampImage(e):x.findStampTemplate(e,l,b,x.annotationOrder.length-1)):h.has("N")&&(0===(u=e.createTemplate()).size[0]||0===u.size[1]||je(u._appearance)?x.findStampImage(e):x.findStampTemplate(e,l,b,x.annotationOrder.length-1))}}e instanceof rEt&&!e._dictionary.has("IRT")&&(p=C.loadPopupAnnotation(e,f,y,b),x.stickyAnnotationList[x.stickyAnnotationList.length]=p,je(c=(x.annotationOrder[x.annotationOrder.length]=p).AnnotName)||""===c)&&(p.AnnotName=x.setAnnotationName(v)),e instanceof VEt&&(t=e,x.isFreeTextAnnotationType(t)?(h=S.some(function(e){return e===t.name}),i=C.loadFreeTextAnnotation(t,f,y,b,w),h||(x.freeTextAnnotationList[x.freeTextAnnotationList.length]=i,x.annotationOrder[x.annotationOrder.length]=i)):(i=C.loadSignatureText(t,v,f,y,b),t._dictionary.has("T")||(x.signatureAnnotationList[x.signatureAnnotationList.length]=i,x.annotationOrder[x.annotationOrder.length]=i))),e instanceof iEt&&(c=C.loadSignature(u=e,f,y,b,v,w),p=C.loadInkAnnotation(u,f,y,b,v,w),u._dictionary.has("T")?u._dictionary.has("NM")?(x.signatureInkAnnotationList.push(p),x.annotationOrder.push(p)):!u._dictionary.has("T")||!u._dictionary.has("annotationSignature")||0<u.getValues("annotationSignature").length||(x.signatureAnnotationList.push(c),x.annotationOrder.push(c)):(x.signatureAnnotationList.push(c),x.annotationOrder.push(c)),u._dictionary.has("NM")||u._dictionary.has("annotationSignature")||(x.signatureAnnotationList.push(c),x.annotationOrder.push(c)))}(e)}return{shapeAnnotation:this.shapeAnnotationList,textMarkupAnnotation:this.textMarkupAnnotationList,measureShapeAnnotation:this.measureAnnotationList,stampAnnotations:this.rubberStampAnnotationList,stickyNotesAnnotation:this.stickyAnnotationList,freeTextAnnotation:this.freeTextAnnotationList,signatureAnnotation:this.signatureAnnotationList,signatureInkAnnotation:this.signatureInkAnnotationList,annotationOrder:this.annotationOrder}},K2t.prototype.formatDate=function(e){return this.datePadding(e.getMonth()+1)+"/"+this.datePadding(e.getDate())+"/"+e.getFullYear()+" "+this.datePadding(e.getHours())+":"+this.datePadding(e.getMinutes())+":"+this.datePadding(e.getSeconds())},K2t.prototype.datePadding=function(e){return e<10?"0"+e:e.toString()},K2t.prototype.findStampImage=function(e){var t,e=e._dictionary.get("AP").get("N");je(e)||(t=yMt(e.getString(),!0),t=new FPt(t)._readContent(),this.stampAnnoattionRender(t,e))},K2t.prototype.findStampTemplate=function(e,t,i,n,o,r,s,a){var e=e.createTemplate(),l=(t.template=e._appearance,t.templateSize=e.size,new kFt(this.readFromResources())),h=new OFt;h.margins=new VFt(0),h.rotation=i,h.size=e.size;l.addPage(h).graphics.drawTemplate(e,{x:0,y:0,width:e.size[0],height:e.size[1]}),l.removePage(0);i="data:application/pdf;base64,"+kMt(l.save()),i=this.pdfViewerBase.checkDocumentData(i,!1),h=this.pdfViewerBase.convertBase64(i);o?this.pdfViewerBase.pdfViewerRunner.addTask({uploadedFile:h,message:"LoadPageStampCollection",password:null,pageIndex:0,zoomFactor:this.pdfViewer.magnificationModule.zoomFactor,isTextNeed:!1,isZoomMode:!1,AnnotName:t.AnnotName,rubberStampAnnotationPageNumber:t.pageNumber,annotationOrder:JSON.stringify(this.annotationOrder),collectionOrder:n,isFormField:o,formFieldName:r,formFieldList:JSON.stringify(s),rubberStampAnnotation:t,PageIndex:a},yRt.High):this.pdfViewerBase.pdfViewerRunner.addTask({uploadedFile:h,message:"LoadPageStampCollection",password:null,pageIndex:0,zoomFactor:this.pdfViewer.magnificationModule.zoomFactor,isTextNeed:!1,isZoomMode:!1,AnnotName:t.AnnotName,rubberStampAnnotationPageNumber:t.pageNumber,annotationOrder:JSON.stringify(this.annotationOrder),collectionOrder:n},yRt.High)},K2t.prototype.initialPagesRendered=function(e){var t,i=document.createElement("canvas"),n=e.value,o=e.width,r=e.height,s=(i.width=o,i.height=r,i.getContext("2d")),o=s.createImageData(o,r),r=(o.data.set(n),s.putImageData(o,0,0),i.toDataURL()),n=(this.pdfViewerBase.releaseCanvas(i),{imagedata:r}),a=e.annotName,s=[],l=(0<JSON.parse(e.annotationOrder).length?s=JSON.parse(e.annotationOrder):this.pdfViewer.viewerBase.importedAnnotation&&this.pdfViewer.viewerBase.importedAnnotation[e.rubberStampAnnotationPageNumber]&&(s=this.pdfViewer.viewerBase.importedAnnotation[e.rubberStampAnnotationPageNumber].annotationOrder),s.find(function(e){return a===e.AnnotName}));if(l){je(l.Apperarance)||(l.Apperarance=[]),l.Apperarance.push(n),o=ARt.sessionStorageManager.getItem(this.pdfViewerBase.documentId+"_annotations_stamp"),this.pdfViewerBase.isStorageExceed&&(o=this.pdfViewerBase.annotationStorage[this.pdfViewerBase.documentId+"_annotations_stamp"]);var h=!0;if(o&&0<(t=JSON.parse(o)).length)for(var d=0;d<t.length;d++)for(var p=0;p<t[parseInt(d.toString(),10)].annotations.length;p++)t[parseInt(d.toString(),10)].annotations[parseInt(p.toString(),10)].annotName===l.AnnotName&&(h=!1);h&&this.pdfViewer.annotationModule.stampAnnotationModule.renderStampAnnotImage(l,0,null,null,!0,!0,e.collectionOrder)}this.Imagedata=r},K2t.prototype.readFromResources=function(){return"JVBERi0xLjUNCiWDkvr+DQo0IDAgb2JqDQo8PA0KL1R5cGUgL0NhdGFsb2cNCi9QYWdlcyA1IDAgUg0KL0Fjcm9Gb3JtIDYgMCBSDQo+Pg0KZW5kb2JqDQoxIDAgb2JqDQo8PA0KL0ZpbHRlciAvRmxhdGVEZWNvZGUNCi9MZW5ndGggMTINCj4+DQpzdHJlYW0NCnheUyhU4AIAAiEAvA0KZW5kc3RyZWFtDQplbmRvYmoNCjIgMCBvYmoNCjw8DQovRmlsdGVyIC9GbGF0ZURlY29kZQ0KL0xlbmd0aCAxMg0KPj4NCnN0cmVhbQ0KeF5TCFTgAgABwQCcDQplbmRzdHJlYW0NCmVuZG9iag0KMyAwIG9iag0KPDwNCi9GaWx0ZXIgL0ZsYXRlRGVjb2RlDQovTGVuZ3RoIDEzNQ0KPj4NCnN0cmVhbQ0KeF5tjs0KwjAQhO8L+w578diYSlu9+wSC4DnUbRvIT0324ttrogiih2UYlm9mbggbOi4mzExjbGK62mCEKd+zsCeJ5HiSrcRVIbRKa1Lv+5hDtytCo69Zzq7kTZptyE+k0+XXvKRv++r2QyUSIywIFwoFPCcTsivdvzv+dn9F1/YTwgN6hTPqDQplbmRzdHJlYW0NCmVuZG9iag0KOSAwIG9iag0KPDwNCi9GaXJzdCAyNg0KL04gNA0KL1R5cGUgL09ialN0bQ0KL0ZpbHRlciAvRmxhdGVEZWNvZGUNCi9MZW5ndGggMTk2DQo+Pg0Kc3RyZWFtDQp4Xm1PTQuCQBC9L+x/mF+Qu34H4qHCSwRi3cTDYkMI4YauUP++WcVM6rA784b35r0JQHAWgpQ+ZxFIL+QsBlcIzpKEM+fyeiA4ubphT+jYXHsoIxBQVAT3emgNSOoK7PXQ1dhDkqQpZzQ64bVRO/2EciME2BdsA1ti36Vi9YU2yqANMGlGx6zBu3WpVtPF6l+ieE6Uqw6JF1i80i+qhRVNLNrdGsK0R9oJuOPvzTu/b7PiTtdnNFA6+SH7hPy55Q19a1EBDQplbmRzdHJlYW0NCmVuZG9iag0KMTAgMCBvYmoNCjw8DQovUm9vdCA0IDAgUg0KL0luZGV4IFswIDExXQ0KL1NpemUgMTENCi9UeXBlIC9YUmVmDQovVyBbMSAyIDFdDQovRmlsdGVyIC9GbGF0ZURlY29kZQ0KL0xlbmd0aCA0NA0KPj4NCnN0cmVhbQ0KeF4Vw0ENACAMALG77cVzBvCFUEShAkaTAlcWstFCimD89uipB3PyAFuGA3QNCmVuZHN0cmVhbQ0KZW5kb2JqDQoNCnN0YXJ0eHJlZg0KNzk4DQolJUVPRg0KJVBERi0xLjUNCiWDkvr+DQoxMSAwIG9iag0KPDwNCi9GaXJzdCA1DQovTiAxDQovVHlwZSAvT2JqU3RtDQovRmlsdGVyIC9GbGF0ZURlY29kZQ0KL0xlbmd0aCA3MQ0KPj4NCnN0cmVhbQ0KeF4zVzDg5bKx4eXSd84vzStRMOTl0g+pLEhV0A9ITE8tBvK8M1OKFaItFAwUgmKB3IDEolSgOlMQn5fLzo6Xi5cLAEOtEAkNCmVuZHN0cmVhbQ0KZW5kb2JqDQoxMiAwIG9iag0KPDwNCi9Sb290IDQgMCBSDQovSW5kZXggWzAgMSA3IDEgMTEgMl0NCi9TaXplIDEzDQovVHlwZSAvWFJlZg0KL1cgWzEgMiAxXQ0KL1ByZXYgNzk4DQovTGVuZ3RoIDI0DQovRmlsdGVyIC9GbGF0ZURlY29kZQ0KPj4NCnN0cmVhbQ0KeF5jYGD4z8TAzcDIwsLAyLKbAQAPSwHWDQplbmRzdHJlYW0NCmVuZG9iag0KDQpzdGFydHhyZWYNCjEyMTENCiUlRU9GDQo="},K2t.prototype.getPageRotation=function(e){return 0===e.rotate?0:90===e.rotate?1:180===e.rotate?2:270===e.rotate?3:0},K2t.prototype.stampAnnoattionRender=function(e,t){if(!je(e))for(var i=0;i<e.length;i++){var n,o=e[parseInt(i.toString(),10)]._operands;switch(e[parseInt(i.toString(),10)]._operator){case"q":var r={restorecanvas:!1};this.htmldata.push(r);break;case"Q":var r={restorecanvas:!0};this.htmldata.push(r);break;case"Tr":this.renderingMode=parseInt(o[0],10);break;case"TJ":case"Tj":case"'":this.textString=e[parseInt(i.toString(),10)]._operands[0];r={type:"string",text:this.textString,currentFontname:this.currentFont,baseFontName:this.baseFont,fontSize:this.fontSize};this.htmldata.push(r);break;case"Tf":for(var s,a,l,h,d=0,d=0;d<o.length;d++)if(o[parseInt(d.toString(),10)].includes("/")){this.currentFont=o[parseInt(d.toString(),10)].replace("/","");break}this.fontSize=parseInt(o[d+1],10),!t.dictionary.has("Resources")||je(s=t.dictionary.get("Resources"))||je(a=s.get("Font"))||"Tf"!==e[parseInt(i.toString(),10)]._operator||(l=o[0].replace("/",""),je(l=a.get(l)))||je(l.dictionary)||(h=l.dictionary,this.baseFont=h.get("BaseFont"));break;case"Do":!t.dictionary.has("Resources")||je(s=t.dictionary.get("Resources"))||je(a=s.get("XObject"))||"Do"!==e[parseInt(i.toString(),10)]._operator||(n=o[0].replace("/",""),!a.has(n))||je(l=a.get(n))||je(l.dictionary)||("Image"===(h=l).dictionary.get("Subtype").name?je(n=new FVt(h,h.dictionary))||(n="data:image/png;base64,"+kMt(n.getImageStream()),this.htmldata.push(r={imagedata:n}),this.Imagedata=n):"Form"===h.dictionary.get("Subtype").name&&(n=yMt(h.getString(),!0),n=new FPt(n)._readContent(),this.stampAnnoattionRender(n,h)),this.IsMaskedImage=!1,h.dictionary.get("SMask")&&(this.IsMaskedImage=!0))}}},K2t.prototype.getStateModelString=function(e){switch(e){case VAt.review:return"Review";case VAt.marked:return"Marked";default:VAt.none;return"None"}},K2t.prototype.getStateString=function(e){switch(e){case NAt.accepted:return"Accepted";case NAt.rejected:return"Rejected";case NAt.cancel:return"Cancelled";case NAt.completed:return"Completed";case NAt.none:return"None";case NAt.unmarked:return"Unmarked";case NAt.marked:return"Marked";case NAt.unknown:return"Unknown";default:return null}},K2t.prototype.getBounds=function(e,t,i,n){var o;return 0===n?o=new dvt(e.x,e.y,e.width,e.height):1===n?o=new dvt(this.convertPixelToPoint(i-this.convertPointToPixel(e.y)-this.convertPointToPixel(e.height)),e.x,e.height,e.width):2===n?o=new dvt(this.convertPixelToPoint(i-this.convertPointToPixel(e.x)-this.convertPointToPixel(e.width)),this.convertPixelToPoint(t-this.convertPointToPixel(e.y)-this.convertPointToPixel(e.height)),e.width,e.height):3===n&&(o=new dvt(e.y,this.convertPixelToPoint(t-this.convertPointToPixel(e.x)-this.convertPointToPixel(e.width)),e.height,e.width)),o},K2t.prototype.getRubberStampBounds=function(e,t,i,n,o){var r,s,a=new dvt,l=0,h=0;return 0===o?(l=t.x+t.width/2,h=t.y+t.height/2,a=new dvt(l-e.width/2,h-e.height/2,e.width,e.height)):1===o?(r=this.convertPixelToPoint(n-this.convertPointToPixel(je(t.Y)?t.y:t.Y)-this.convertPointToPixel(t.height)),s=je(t.X)?t.x:t.X,l=r+t.height/2,h=s+t.width/2,a=new dvt(l-e.width/2,h-e.height/2,e.width,e.height)):2===o?(r=this.convertPixelToPoint(n-this.convertPointToPixel(je(t.X)?t.x:t.X)-this.convertPointToPixel(t.width)),s=this.convertPixelToPoint(i-this.convertPointToPixel(je(t.Y)?t.y:t.Y)-this.convertPointToPixel(t.height)),l=r+t.width/2,h=s+t.height/2,a=new dvt(l-e.width/2,h-e.height/2,e.width,e.height)):3===o&&(r=je(t.Y)?t.y:t.Y,s=this.convertPixelToPoint(i-this.convertPointToPixel(je(t.X)?t.x:t.X)-this.convertPointToPixel(t.width)),l=r+t.height/2,h=s+t.width/2,a=new dvt(l-e.width/2,h-e.height/2,e.width,e.height)),a},K2t.prototype.convertPixelToPoint=function(e){return 72*e/96},K2t.prototype.convertPointToPixel=function(e){return 96*e/72},K2t.prototype.getRotateAngleString=function(e){switch(e){case TAt.angle0:return"RotateAngle0";case TAt.angle90:return"RotateAngle90";case TAt.angle180:return"RotateAngle180";case TAt.angle270:return"RotateAngle270";default:return"RotateAngle0"}},K2t.prototype.checkName=function(e){if("Name"in e._dictionary){e=e.getValues("Name");if(!je(e)&&-1<e.indexOf("#"))return!0}return!1},K2t.prototype.getAllFreeTextAnnotations=function(e){for(var t=[],i=0;i<e.count;i++){var n=e.at(i);n instanceof VEt&&t.push(n)}return t},K2t.prototype.getShapeFreeText=function(t,e){return je(t)||""===t?null:e.find(function(e){return null!=e.name&&e.name.includes(t)})},K2t.prototype.setAnnotationName=function(e){e+=this.annotationCount.toString();return this.annotationCount++,e},K2t.prototype.isFreeTextAnnotationType=function(e){var t=!0;return t=e._dictionary.has("AnnotationType")&&!je(e=e.getValues("AnnotationType"))&&"Signature"===e[0]?!1:t};var X2t=K2t;function K2t(e,t){this.shapeAnnotationList=[],this.textMarkupAnnotationList=[],this.measureAnnotationList=[],this.stickyAnnotationList=[],this.rubberStampAnnotationList=[],this.freeTextAnnotationList=[],this.signatureAnnotationList=[],this.signatureInkAnnotationList=[],this.annotationOrder=[],this.hyperlinks=[],this.imageData="",this.isMaskedImage=!1,this.hyperlinkBounds=[],this.annotationDestPage=[],this.annotationList=[],this.annotationYPosition=[],this.digitalSignaturePresent=!1,this.annotationCount=0,this.isAnnotationPresent=!1,this.htmldata=[],this.renderingMode=0,this.textString="",this.baseFont="",this.fontSize=0,this.pdfViewer=e,this.pdfViewerBase=t}var J2t=function(){},Z2t=(Object.defineProperty($2t.prototype,"PageCount",{get:function(){return this.pageCount},enumerable:!0,configurable:!0}),Object.defineProperty($2t.prototype,"ReferencePath",{get:function(){return this.mReferencePath},enumerable:!0,configurable:!0}),Object.defineProperty($2t.prototype,"referencePath",{set:function(e){this.mReferencePath=e},enumerable:!0,configurable:!0}),Object.defineProperty($2t.prototype,"ScaleFactor",{get:function(){return this.scaleFactor},set:function(e){this.scaleFactor=e,this.scaleFactor<=0&&(this.scaleFactor=1)},enumerable:!0,configurable:!0}),Object.defineProperty($2t.prototype,"FallbackFontCollection",{get:function(){return this._fallbackFontCollection},set:function(e){this._fallbackFontCollection=e},enumerable:!0,configurable:!0}),$2t.prototype.load=function(e,t,i,n){try{"VirtualLoad"!==n.action&&(this.loadedDocument=new kFt(e,i||""),this.loadedByteArray=e,this.password=i,this.isCompletePageSizeNotReceieved=!0)}catch(e){return"Invalid PDF structure."===e.message?"3":"Cannot open an encrypted document. The password is invalid."===e.message||"Invalid cross reference"===e.message?"4":e.message}e=this.loadDocument(e,t,i,n);return this.bookmarkStyles=[],this.bookmarkCollection=[],this.bookmarkDictionary={},JSON.stringify(e)},$2t.prototype.loadImportDocument=function(e,t,i,n){try{"VirtualLoad"!==n.action&&(this.loadImportedDocument=new kFt(e,i||""),this.loadImportedBase64String=e,this.importedDocpassword=i)}catch(e){return"Invalid PDF structure."===e.message?"3":"Cannot open an encrypted document. The password is invalid."===e.message||"Invalid cross reference"===e.message?"4":e.message}n={uniqueId:t,password:this.importedDocpassword};return this.loadImportedDocument.destroy(),this.loadImportedDocument=null,JSON.stringify(n)},$2t.prototype.loadDocument=function(e,t,i,n){Object.prototype.hasOwnProperty.call(n,"isCompletePageSizeNotReceived")&&(this.isCompletePageSizeNotReceieved=!n.isCompletePageSizeNotReceived),this.pageCount=this.loadedDocument.pageCount,this.pageSizes=this.getPageSizes(this.pageCount);var o=[];if(this.formFieldsBase=new rVt(this.pdfViewer,this.pdfViewerBase,!1),this.restrictionList=[],je(this.loadedDocument)||this.documentSecurity(i),je(this.loadedDocument)||(Object.prototype.hasOwnProperty.call(n,"hideEmptyDigitalSignatureFields")&&(this.formFieldsBase.hideEmptyDigitalSignatureFields=n.hideEmptyDigitalSignatureFields),Object.prototype.hasOwnProperty.call(n,"showDigitalSignatureAppearance")&&(this.formFieldsBase.showDigitalSignatureAppearance=n.showDigitalSignatureAppearance)),!je(this.formFieldsBase)&&this.pageSizes&&Object.keys(this.pageSizes).length<=100&&(this.formFieldsBase.GetFormFields(),o=this.formFieldsBase.PdfRenderedFormFields),this.formFieldsBase.mIsDigitalSignaturePresent){var i=new kFt(e,""),r=i.form;if(!je(r)&&!je(r._fields))for(var s,a=0;a<r.count;a++)r.fieldAt(a)instanceof bTt&&(s=r.fieldAt(a)).isSigned&&this.formFieldsBase.showDigitalSignatureAppearance&&(s.flatten=!0);this.digitialByteArray=i.save(),i.destroy()}return{pageCount:this.pageCount,pageSizes:this.pageSizes,uniqueId:t,PdfRenderedFormFields:o,RestrictionSummary:this.restrictionList,isDigitalSignaturePresent:this.formFieldsBase.mIsDigitalSignaturePresent,digitialSignatureFile:!!this.digitialByteArray,isTaggedPdf:!1,pageRotation:this.pageRotationCollection}},$2t.prototype.documentSecurity=function(e){var t=this.loadedDocument.isEncrypted&&(!this.loadedDocument.isUserPassword||this.loadedDocument._hasUserPasswordOnly);!je(e)&&""!==e&&t?this.restrictionSummary(e,!0):this.restrictionSummary(e,!1)},$2t.prototype.restrictionSummary=function(e,t){var i=e||"",e=e||"",n=this.getPermissionArray(this.loadedDocument.permissions),o=this.loadedDocument.isEncrypted;if(1!==n.length||"Default"!==n[0]||o&&""===i&&""===e)for(var r=0;r<this.securityList.length;r++){for(var s=!1,a=0;a<n.length;a++)if(n[parseInt(a.toString(),10)].trim()===this.securityList[parseInt(r.toString(),10)].trim()){s=!0;break}s||t||this.restrictionList.push(this.securityList[parseInt(r.toString(),10)].trim())}else if(1===n.length&&"Default"===n[0]&&o&&!t)for(r=0;r<this.securityList.length;r++)this.restrictionList.push(this.securityList[parseInt(r.toString(),10)].trim())},$2t.prototype.getPermissionArray=function(e){var t=[];return e===XAt.default?t.push("Default"):(e&XAt.fullQualityPrint&&t.push("FullQualityPrint"),e&XAt.assembleDocument&&t.push("AssembleDocument"),e&XAt.accessibilityCopyContent&&t.push("AccessibilityCopyContent"),e&XAt.fillFields&&t.push("FillFields"),e&XAt.editAnnotations&&t.push("EditAnnotations"),e&XAt.copyContent&&t.push("CopyContent"),e&XAt.editContent&&t.push("EditContent"),e&XAt.print&&t.push("Print")),t},$2t.prototype.getPageSizes=function(e){var t={},i=100<e?100:e;if(this.isCompletePageSizeNotReceieved)for(var n=0;n<i;n++){t[n.toString()]=this.getPageSize(n);var o=this.loadedDocument.getPage(n).rotation%4;this.pageRotationCollection.push(o)}else for(n=i;n<e;n++){t[n.toString()]=this.getPageSize(n);o=this.loadedDocument.getPage(n).rotation%4;this.pageRotationCollection.push(o)}return t},$2t.prototype.getPageSize=function(e){var e=this.loadedDocument.getPage(e),t=e.size,e=e.rotation%4;return e===TAt.angle0||e===TAt.angle180?new avt(this.convertPointToPixel(t[0]),this.convertPointToPixel(t[1])):new avt(this.convertPointToPixel(t[1]),this.convertPointToPixel(t[0]))},$2t.prototype.convertPointToPixel=function(e){return 96*e/72},$2t.prototype.convertPixelToPoint=function(e){return.75*e},$2t.prototype.getDocumentAsBase64=function(e){this.loadedDocument=new kFt(this.loadedByteArray,this.password);var t,i,n=null;return Object.prototype.hasOwnProperty.call(e,"digitalSignatureDocumentEdited")&&!e.digitalSignatureDocumentEdited||Object.prototype.hasOwnProperty.call(e,"isPdfEdited")&&!e.isPdfEdited?this.loadedByteArray:(i=new lVt(this.pdfViewer,this.pdfViewerBase),t=new rVt(this.pdfViewer,this.pdfViewerBase),i.removeSignatureTypeAnnot(e,this.loadedDocument),this.orderAnnotations(e),Object.prototype.hasOwnProperty.call(e,"isFormFieldAnnotationsExist")&&e.isFormFieldAnnotationsExist&&(Object.prototype.hasOwnProperty.call(e,"formDesigner")&&!je(e.formDesigner)?t.saveFormFieldsDesignerData(e):Object.prototype.hasOwnProperty.call(e,"fieldsData")&&t.saveFormFieldsData(e)),Object.prototype.hasOwnProperty.call(e,"organizePages")&&(i=this.loadedDocument.save(),n=new kFt(i,this.password),0<(t=JSON.parse(e.organizePages)).length&&(i=this.rearrangePages(t),this.deletePdfPages(t,i),this.insertPdfPages(t),this.copyPages(t,n),this.rotatePages(t),this.importPages(t),this.isDummyInserted)&&(this.loadedDocument.removePage(this.loadedDocument.pageCount-1),this.isDummyInserted=!1),n.destroy(),n=null),e=this.loadedDocument.save(),null!=this.document&&(this.document.destroy(),this.document=null),e)},$2t.prototype.rearrangePages=function(e){var i=this,t=[];if(0<e.length){for(var n=JSON.parse(JSON.stringify(e)).sort(function(e,t){return i.pdfViewer.pageOrganizer.sorting(e.currentPageIndex,t.currentPageIndex)}),o=0;o<n.length;o++){var r=n[parseInt(o.toString(),10)];!r.isInserted&&!r.isCopied&&!r.isImportedDoc&&null!==r.currentPageIndex&&null!==r.pageIndex&&0<=parseInt(r.pageIndex.toString(),10)&&t.push(parseInt(r.pageIndex.toString(),10))}for(var s=n.filter(function(e){return e.isDeleted&&null===e.currentPageIndex}),o=0;o<s.length;o++)var a=s[parseInt(o.toString(),10)],t=t.slice(0,a.pageIndex).concat([a.pageIndex],t.slice(a.pageIndex));0<t.length&&this.loadedDocument.reorderPages(t)}return t},$2t.prototype.rotatePages=function(e){if(0<e.length)for(var t=0,i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)].pageIndex,o=e[parseInt(i.toString(),10)].currentPageIndex,r=e[parseInt(i.toString(),10)].isDeleted,s=e[parseInt(i.toString(),10)].isInserted,a=e[parseInt(i.toString(),10)].isCopied,l=e[parseInt(i.toString(),10)].isImportedDoc,h=e[parseInt(i.toString(),10)].rotateAngle;l&&t++,je(o)||je(h)||r||s||a||l||-1===n||(this.loadedDocument.getPage(o-t).rotation=this.getPdfRotationAngle(h))}},$2t.prototype.insertPdfPages=function(e){if(0<e.length)for(var t=0,i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)].pageIndex,o=e[parseInt(i.toString(),10)].currentPageIndex,r=e[parseInt(i.toString(),10)].isDeleted,s=e[parseInt(i.toString(),10)].isInserted,a=e[parseInt(i.toString(),10)].isCopied,l=e[parseInt(i.toString(),10)].isImportedDoc,h=void 0;je(e[parseInt(i.toString(),10)].pageSize)||(h=[this.convertPixelToPoint(e[parseInt(i.toString(),10)].pageSize.width),this.convertPixelToPoint(e[parseInt(i.toString(),10)].pageSize.height)]),(a||l)&&t++,je(o)||r||!s||-1!==n||(a=e[parseInt(i.toString(),10)].rotateAngle,(l=new OFt).rotation=this.getPdfRotationAngle(a),je(h)||(l.size=h),this.loadedDocument.addPage(o-t,l))}},$2t.prototype.copyPages=function(e,t){if(0<e.length)for(var i=0,n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)].pageIndex,r=e[parseInt(n.toString(),10)].currentPageIndex,s=e[parseInt(n.toString(),10)].copiedPageIndex,a=e[parseInt(n.toString(),10)].isDeleted,l=e[parseInt(n.toString(),10)].isInserted,h=e[parseInt(n.toString(),10)].isCopied,d=e[parseInt(n.toString(),10)].isImportedDoc,p=e[parseInt(n.toString(),10)].rotateAngle;d&&i++,je(r)||a||l||d||!h||-1!==o||((a=t.getPage(s)).rotation=this.getPdfRotationAngle(p),(l=new vFt).targetIndex=r-i,l.groupFormFields=!0,this.loadedDocument.importPage(a,t,l))}},$2t.prototype.importPages=function(e){if(0<e.length)for(var t=e.length-1;0<=t;t--){var i=e[parseInt(t.toString(),10)].pageIndex,n=e[parseInt(t.toString(),10)].currentPageIndex,o=e[parseInt(t.toString(),10)].isDeleted,r=e[parseInt(t.toString(),10)].isInserted,s=e[parseInt(t.toString(),10)].isCopied,a=e[parseInt(t.toString(),10)].isImportedDoc,l=e[parseInt(t.toString(),10)].documentData,h=e[parseInt(t.toString(),10)].password;if(!je(n)&&!o&&!r&&!s&&a&&-1===i){for(var d=0,p=0;p<t;p++)e[parseInt(p.toString(),10)].isImportedDoc&&d++;l=this.pdfViewerBase.convertBase64(l),this.document=null,this.document=new kFt(l,h);o=new vFt;o.targetIndex=n-d,o.groupFormFields=!0,this.loadedDocument.importPageRange(this.document,0,this.document.pageCount-1,o)}}},$2t.prototype.deletePdfPages=function(e,i){if(0<e.length){for(var n=JSON.parse(JSON.stringify(e)),o=[],t=0,r=this.loadedDocument.pageCount,s=0;s<n.length;s++)!function(t){n.find(function(e){return e.pageIndex===i[parseInt(t.toString(),10)]})&&(o[parseInt(t.toString(),10)]=n.find(function(e){return e.pageIndex===i[parseInt(t.toString(),10)]}))}(s);for(s=o.length-1;0<=s;s--){var a=0,l=o[parseInt(s.toString(),10)].pageIndex,h=o[parseInt(s.toString(),10)].isDeleted;if(!je(l)&&h){t+1===r&&(this.loadedDocument.addPage(),this.isDummyInserted=!0);for(var d=s-1;0<=d;d--)s!==o[parseInt(s.toString(),10)].pageIndex&&a++;a>o[parseInt(s.toString(),10)].pageIndex?(a-=o[parseInt(s.toString(),10)].pageIndex,this.loadedDocument.removePage(l+a)):this.loadedDocument.removePage(l),t++}}}},$2t.prototype.getPdfRotationAngle=function(e){switch(e){case 0:return TAt.angle0;case 90:return TAt.angle90;case 180:return TAt.angle180;case 270:return TAt.angle270;default:return TAt.angle0}},$2t.prototype.importAnnotations=function(e){try{var t=new lVt(this.pdfViewer,this.pdfViewerBase),i=e.importedData,n=(t.removeSignatureTypeAnnot(e,this.loadedDocument),e.annotationDataFormat);if("string"==typeof n){switch(this.loadedDocument._allowImportCustomData=!0,n.toLowerCase()){case"json":this.loadedDocument.importAnnotations(i,jAt.json);break;case"xfdf":this.loadedDocument.importAnnotations(i,jAt.xfdf)}for(var o=0;o<this.loadedDocument.pageCount;o++){var r=o,s=this.getPageSize(r),a=new X2t(this.pdfViewer,this.pdfViewerBase);a.exportAnnotationComments(r,s),this.annotationDetailCollection[o.toString()]=new nVt,this.annotationDetailCollection[parseInt(o.toString(),10)].textMarkupAnnotation=a.textMarkupAnnotationList,this.annotationDetailCollection[parseInt(o.toString(),10)].shapeAnnotation=a.shapeAnnotationList,this.annotationDetailCollection[parseInt(o.toString(),10)].measureShapeAnnotation=a.measureAnnotationList,this.annotationDetailCollection[parseInt(o.toString(),10)].stampAnnotations=a.rubberStampAnnotationList,this.annotationDetailCollection[parseInt(o.toString(),10)].stickyNotesAnnotation=a.stickyAnnotationList,this.annotationDetailCollection[parseInt(o.toString(),10)].freeTextAnnotation=a.freeTextAnnotationList,this.annotationDetailCollection[parseInt(o.toString(),10)].signatureAnnotation=a.signatureAnnotationList,this.annotationDetailCollection[parseInt(o.toString(),10)].signatureInkAnnotation=a.signatureInkAnnotationList,this.annotationDetailCollection[parseInt(o.toString(),10)].annotationOrder=a.annotationOrder,this.removeAnnotationsFromCollection(a)}var l=JSON.parse(JSON.stringify(this.annotationDetailCollection));return Object.prototype.hasOwnProperty.call(e,"uniqueId")?{pdfAnnotation:l,uniqueId:e.uniqueId}:{pdfAnnotation:l}}}catch(e){return e.message}},$2t.prototype.removeAnnotationsFromCollection=function(e){e.textMarkupAnnotationList=[],e.shapeAnnotationList=[],e.measureAnnotationList=[],e.rubberStampAnnotationList=[],e.stickyAnnotationList=[],e.freeTextAnnotationList=[],e.signatureAnnotationList=[],e.signatureInkAnnotationList=[],e.annotationOrder=[]},$2t.prototype.exportAnnotation=function(e,t){new lVt(this.pdfViewer,this.pdfViewerBase).removeSignatureTypeAnnot(e,this.loadedDocument),this.orderAnnotations(e);var i=new BFt,e=e.annotationDataFormat;if("string"==typeof e)switch(e.toLowerCase()){case"json":return i.dataFormat=jAt.json,t?i.exportAppearance=t:this.changeFileExtension(this.pdfViewer.fileName,"json"),this.loadedDocument.exportAnnotations(i);case"xfdf":return i.dataFormat=jAt.xfdf,t?i.exportAppearance=t:this.changeFileExtension(this.pdfViewer.fileName,"xfdf"),this.loadedDocument.exportAnnotations(i)}return null},$2t.prototype.changeFileExtension=function(e,t){var i=e.lastIndexOf(".");return-1===i?e+"."+t:e.slice(0,i)+"."+t},$2t.prototype.orderAnnotations=function(h){var d=new lVt(this.pdfViewer,this.pdfViewerBase),e=new DVt(this.pdfViewer,this.pdfViewerBase);if(Object.prototype.hasOwnProperty.call(h,"isAnnotationsExist")&&h.isAnnotationsExist&&Object.prototype.hasOwnProperty.call(h,"annotationCollection")){for(var p=JSON.parse(h.annotationCollection),t=p.length,c=this,i=0;i<t;i++)!function(e){var t,i,n,o,r,s,a=p[parseInt(e.toString(),10)].shapeAnnotationType,l=p[parseInt(e.toString(),10)];switch(!Object.prototype.hasOwnProperty.call(l,"calibrate")||"Circle"!==l.shapeAnnotationType&&"Line"!==l.shapeAnnotationType&&"Polygon"!==l.shapeAnnotationType&&"Polyline"!==l.shapeAnnotationType?Object.prototype.hasOwnProperty.call(l,"calibrate")||"Line"!==l.shapeAnnotationType&&"Circle"!==l.shapeAnnotationType&&"Polygon"!==l.shapeAnnotationType&&"Square"!==l.shapeAnnotationType&&"Polyline"!==l.shapeAnnotationType||(a="shapeAnnotation"):a="measureShapes",a){case"textMarkup":Object.prototype.hasOwnProperty.call(h,"textMarkupAnnotations")&&(o=JSON.parse(h.textMarkupAnnotations),n=l.pageNumber.toString(),i=(o=o[parseInt(n,10)]).find(function(e){return e.annotName.toString()===l.annotationId.toString()}))&&(l=i,d.addTextMarkup(l,c.loadedDocument));break;case"shapeAnnotation":Object.prototype.hasOwnProperty.call(h,"shapeAnnotations")&&(s=JSON.parse(h.shapeAnnotations),n=l.pageNumber.toString(),o=s[parseInt(n,10)],r=c.loadedDocument.getPage(parseInt(n,10)),t=o.find(function(e){return e.annotName.toString()===l.annotationId.toString()}))&&(l=t,d.addShape(l,r));break;case"stamp":Object.prototype.hasOwnProperty.call(h,"stampAnnotations")&&(i=JSON.parse(h.stampAnnotations),n=l.pageNumber.toString(),o=i[parseInt(n,10)],r=c.loadedDocument.getPage(parseInt(n,10)),i=o.find(function(e){return e.annotName.toString()===l.annotationId.toString()}))&&(l=i,d.addCustomStampAnnotation(l,r));break;case"measureShapes":Object.prototype.hasOwnProperty.call(h,"measureShapeAnnotations")&&(s=JSON.parse(h.measureShapeAnnotations),n=l.pageNumber.toString(),o=s[parseInt(n,10)],r=c.loadedDocument.getPage(parseInt(n,10)),t=o.find(function(e){return e.annotName.toString()===l.annotationId.toString()}))&&(l=t,d.addMeasure(l,r));break;case"sticky":Object.prototype.hasOwnProperty.call(h,"stickyNotesAnnotation")&&(s=JSON.parse(h.stickyNotesAnnotation),n=l.pageNumber.toString(),o=s[parseInt(n,10)],r=c.loadedDocument.getPage(parseInt(n,10)),t=o.find(function(e){return e.annotName.toString()===l.annotationId.toString()}))&&(l=t,d.addStickyNotes(l,r));break;case"Ink":Object.prototype.hasOwnProperty.call(h,"inkSignatureData")&&(s=JSON.parse(h.inkSignatureData),n=l.pageNumber.toString(),o=s[parseInt(n,10)],r=c.loadedDocument.getPage(parseInt(n,10)),t=o.find(function(e){return e.annotName.toString()===l.annotationId.toString()}))&&(l=t,d.saveInkSignature(l,r));break;case"FreeText":Object.prototype.hasOwnProperty.call(h,"freeTextAnnotation")&&(i=JSON.parse(h.freeTextAnnotation),n=l.pageNumber.toString(),o=i[parseInt(n,10)],r=c.loadedDocument.getPage(parseInt(n,10)),je(s=o.find(function(e){return e.annotName.toString()===l.annotationId.toString()}))||(l=s,je(c.FallbackFontCollection)||0===Object.keys(c.FallbackFontCollection).length?d.addFreeText(l,r):d.addFreeText(l,r,c.FallbackFontCollection)))}}(i);h.signatureData&&(h.isSignatureEdited?e.saveSignatureAsAnnotatation(h,this.loadedDocument):e.saveSignatureData(h,this.loadedDocument))}},$2t.prototype.getAnnotationComments=function(e){try{if(!Object.prototype.hasOwnProperty.call(e,"pageStartIndex")||je(e.pageStartIndex))return"";for(var t=parseInt(e.pageStartIndex,10),i=parseInt(e.pageEndIndex,10),n={},o=t;o<i;o++){var r=o,s=this.getPageSize(r);this.renderer=new X2t(this.pdfViewer,this.pdfViewerBase),n[r.toString()]=this.renderer.exportAnnotationComments(r,s)}return{uniqueId:e.uniqueId,annotationDetails:n,startPageIndex:t,endPageIndex:i,isAnnotationPresent:this.renderer.isAnnotationPresent}}catch(e){return e.message}},$2t.prototype.getBookmarks=function(e){try{var t=this.loadedDocument.bookmarks;if(!je(t)&&Object.prototype.hasOwnProperty.call(e,"bookmarkStyles"))for(var i=0;i<t.count;i++)this.retrieveFontStyles(t.at(i),!1);if(je(t)||je(t.count)||0===t.count)return null;for(i=0;i<t.count;i++){var n=t.at(i),o=new PVt,r=n.destination||n.namedDestination&&n.namedDestination.destination||null,s=(o.X=je(r)?0:r.location[0],o.PageIndex=je(r)?0:r.pageIndex,o.Zoom=je(r)?0:r.zoom,new kVt);s.Id=++this.id,s.Title=n.title,s.Child=[],s.FileName=je(n.action)?"":n.action.toString(),je(r)?o.Y=0:r.page.rotation===TAt.angle90?o.Y=this.convertPointToPixel(r.page.size[0])-this.convertPointToPixel(Math.abs(r.location[1])):r.page.rotation===TAt.angle270?o.Y=this.convertPointToPixel(Math.abs(r.location[1])):o.Y=this.convertPointToPixel(r.page.size[1])-this.convertPointToPixel(Math.abs(r.location[1])),this.bookmarkDictionary[this.id.toString()]=o,s.Child=this.getChildrenBookmark(n),0<s.Child.length&&(s.HasChild=!0),this.bookmarkCollection.push(s)}return Object.prototype.hasOwnProperty.call(e,"uniqueId")?{Bookmarks:JSON.parse(JSON.stringify(this.bookmarkCollection)),BookmarksDestination:JSON.parse(JSON.stringify(this.bookmarkDictionary)),uniqueId:e.uniqueId.toString(),Bookmarkstyles:JSON.parse(JSON.stringify(this.bookmarkStyles))}:{Bookmarks:JSON.parse(JSON.stringify(this.bookmarkCollection)),BookmarksDestination:JSON.parse(JSON.stringify(this.bookmarkDictionary)),Bookmarkstyles:JSON.parse(JSON.stringify(this.bookmarkStyles))}}catch(e){return e.message}},$2t.prototype.retrieveFontStyles=function(e,t){var i=e,n=new BVt;je(i)||(je(i.color)||(n.Color="rgba("+i.color[0]+","+i.color[1]+","+i.color[2]+",1)"),n.FontStyle=this.getPdfTextStyleString(i.textStyle),n.Text=i.title,n.IsChild=t,this.bookmarkStyles.push(n),this.getChildrenStyles(e))},$2t.prototype.getPdfTextStyleString=function(e){switch(e){case g1t.bold:return"Bold";case g1t.italic:return"Italic";default:g1t.regular;return"Regular"}},$2t.prototype.getChildrenStyles=function(e){for(var t=0;t<e.count;t++)this.retrieveFontStyles(e.at(t),!0)},$2t.prototype.getChildrenBookmark=function(e){var t=[];if(!je(e)&&!je(e.count)&&0<e.count)for(var i=0;i<e.count;i++){var n=e.at(i),o=n.destination||n.namedDestination&&n.namedDestination.destination||null,r=(this.id++,n.title),s=(this.pageIndex=je(o)?0:o.pageIndex,this.x=je(o)?0:o.location[0],je(o)?0:Math.abs(o.location[1])),s=(je(o)?(this.y=0,this.zoom=0):(o.page.rotation===TAt.angle90?this.y=this.convertPointToPixel(o.page.size[0])-this.convertPointToPixel(s):o.page.rotation===TAt.angle270?this.y=this.convertPointToPixel(s):this.y=this.convertPointToPixel(o.page.size[1])-this.convertPointToPixel(s),this.zoom=o.zoom),new kVt),o=(s.Title=r,s.Id=this.id,s.Child=[],s.FileName=je(n.action)?"":n.action.toString(),new PVt);o.X=this.x,o.Y=this.y,o.PageIndex=this.pageIndex,o.Zoom=this.zoom,this.bookmarkDictionary[this.id.toString()]=o,t.push(s),s.Child=this.getChildrenBookmark(n),0<s.Child.length&&(s.HasChild=!0)}return t},$2t.prototype.getHyperlinks=function(e){return je(this.renderer)&&(this.renderer=new X2t(this.pdfViewer,this.pdfViewerBase)),je(this.renderer.hyperlinks)&&(this.renderer.hyperlinks=[]),this.exportHyperlinks(e,this.getPageSize(e),!1,!0),{hyperlinks:this.renderer.hyperlinks,hyperlinkBounds:this.renderer.hyperlinkBounds,linkAnnotation:this.renderer.annotationList,linkPage:this.renderer.annotationDestPage,annotationLocation:this.renderer.annotationYPosition}},$2t.prototype.exportHyperlinks=function(e,t,i,n){var o=this.loadedDocument.getPage(e);this.renderer.hyperlinks=[],this.renderer.hyperlinkBounds=[],this.renderer.annotationDestPage=[],this.renderer.annotationList=[],this.renderer.annotationYPosition=[];for(var r,s,a,l,h=0;h<o.annotations.count;h++)o.annotations.at(h)instanceof pEt?(r=o.annotations.at(h),a=this.getHyperlinkBounds(r.bounds,t,o.rotation),je(this.renderer.hyperlinks)&&(this.renderer.hyperlinks=[],this.renderer.hyperlinkBounds=[]),this.renderer.hyperlinks.push(r.uri),this.renderer.hyperlinkBounds.push(a)):o.annotations.at(h)instanceof yEt?(r=o.annotations.at(h),a=this.getHyperlinkBounds(r.bounds,t,o.rotation),je(this.renderer.hyperlinks)&&(this.renderer.hyperlinks=[],this.renderer.hyperlinkBounds=[]),this.renderer.hyperlinks.push(r.url),this.renderer.hyperlinkBounds.push(a)):o.annotations.at(h)instanceof gEt&&(s=o.annotations.at(h),a=this.getHyperlinkBounds(s.bounds,t,o.rotation),je(this.renderer.annotationDestPage)&&(this.renderer.annotationDestPage=[],this.renderer.annotationList=[],this.renderer.annotationYPosition=[]),je(s.destination)||(l=s.destination.pageIndex,this.renderer.annotationDestPage.push(l),this.renderer.annotationList.push(a),o.rotation===TAt.angle180?this.renderer.annotationYPosition.push(this.convertPointToPixel(Math.abs(s.destination.location[1]))):o.rotation===TAt.angle90||o.rotation===TAt.angle270?this.renderer.annotationYPosition.push(t.width-this.convertPointToPixel(Math.abs(s.destination.location[1]))):this.renderer.annotationYPosition.push(t.height-this.convertPointToPixel(Math.abs(s.destination.location[1])))))},$2t.prototype.getHyperlinkBounds=function(e,t,i){var n;return i===TAt.angle0?n=new SVt(this.convertPointToPixel(e.x),this.convertPointToPixel(e.y),this.convertPointToPixel(e.width),this.convertPointToPixel(e.height)):i===TAt.angle90?n=new SVt(t.width-this.convertPointToPixel(e.y-e.height),this.convertPointToPixel(e.x),this.convertPointToPixel(e.height),this.convertPointToPixel(e.width)):i===TAt.angle180?n=new SVt(t.width-this.convertPointToPixel(e.x-e.width),t.height-this.convertPointToPixel(e.y-e.height),this.convertPointToPixel(e.width),this.convertPointToPixel(e.height)):i===TAt.angle270&&(n=new SVt(this.convertPointToPixel(e.y),t.height-this.convertPointToPixel(e.x-e.width),this.convertPointToPixel(e.height),this.convertPointToPixel(e.width))),n},$2t.prototype.exportFormFields=function(e,t){var i=new rVt(this.pdfViewer,this.pdfViewerBase),i=(i.saveFormFieldsData(e),i.saveFormFieldsDesignerData(e),Object.prototype.hasOwnProperty.call(e,"fileName")||(e.fileName="undefined.pdf"),this.loadedDocument.form.exportEmptyFields=!0,jAt.json),e=(Object.prototype.hasOwnProperty.call(e,"formFieldDataFormat")&&(i=this.exportDataFormat(e.formFieldDataFormat)),new LFt);return e.dataFormat=i,t||this.changeFileExtension(this.pdfViewer.fileName,this.fileFormat(i)),this.loadedDocument.exportFormData(e)},$2t.prototype.importFormFields=function(e){try{var t,i=new rVt(this.pdfViewer,this.pdfViewerBase),n=(i.saveFormFieldsDesignerData(e),this.exportDataFormat(e.formFieldDataFormat));this.isBase64(e.data)||this.isUint8Array(e.data)||("Json"===e.formFieldDataFormat&&(e.data=JSON.parse(e.data)),t=(new TextEncoder).encode(e.data),e.data=new Uint8Array(t)),Object.prototype.hasOwnProperty.call(e,"formFieldDataFormat")&&this.loadedDocument.importFormData(e.data,n),(i=new rVt(this.pdfViewer,this.pdfViewerBase)).GetFormFields();return{PdfRenderedFormFields:i.PdfRenderedFormFields}}catch(e){return null}},$2t.prototype.isUint8Array=function(e){return e instanceof Uint8Array},$2t.prototype.isBase64=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},$2t.prototype.exportDataFormat=function(e){var t;switch(e){case"Json":t=jAt.json;break;case"Xfdf":t=jAt.xfdf;break;case"Fdf":t=jAt.fdf;break;case"Xml":t=jAt.xml}return t},$2t.prototype.fileFormat=function(e){var t;switch(e){case 0:t="fdf";break;case 1:t="xfdf";break;case 2:t="json";break;case 3:t="xml"}return t},$2t.prototype.exportAsImage=function(i){var n=this;return new Promise(function(e,t){e(n.pdfiumExportAsImage(i))})},$2t.prototype.exportAsImages=function(i,n){var o=this;return new Promise(function(e,t){e(o.pdfiumExportAsImages(i,n))})},$2t.prototype.exportAsImagewithSize=function(i,n){var o=this;return new Promise(function(e,t){e(o.pdfiumExportAsImage(i,n))})},$2t.prototype.exportAsImagesWithSize=function(i,n,o){var r=this;return new Promise(function(e,t){e(r.pdfiumExportAsImages(i,n,o))})},$2t.prototype.pdfiumExportAsImage=function(t,i){var n=this,s=this;return new Promise(function(r,e){je(n.pdfViewerBase.pdfViewerRunner)||je(n.loadedDocument)?r(null):(i=je(i)?null:i,n.pdfViewerBase.pdfViewerRunner.addTask({pageIndex:t,message:"extractImage",zoomFactor:n.pdfViewer.magnificationModule.zoomFactor,isTextNeed:!1,size:i},yRt.Medium),n.pdfViewerBase.pdfViewerRunner.onMessage("imageExtracted",function(e){var t,i,n,o;"imageExtracted"===e.data.message&&(t=document.createElement("canvas"),i=(e=e.data).value,o=e.width,e=e.height,t.width=o,t.height=e,(o=(n=t.getContext("2d")).createImageData(o,e)).data.set(i),n.putImageData(o,0,0),e=t.toDataURL(),s.pdfViewerBase.releaseCanvas(t),r(e))}))})},$2t.prototype.pdfiumExportAsImages=function(i,n,o){var l=this,h=this;return new Promise(function(r,e){if(je(l.pdfViewerBase.pdfViewerRunner)||je(l.loadedDocument))r(null);else{i<0&&(i=0),(n=n>l.loadedDocument.pageCount-1?l.loadedDocument.pageCount-1:n)<i&&e("Invalid page index"),o=je(o)?null:o;for(var s=[],a=n-i+1,t=i;t<=n;t++)l.pdfViewerBase.pdfViewerRunner.addTask({pageIndex:t,message:"extractImages",zoomFactor:l.pdfViewer.magnificationModule.zoomFactor,isTextNeed:!1,size:o},yRt.Medium);l.pdfViewerBase.pdfViewerRunner.onMessage("imagesExtracted",function(e){var t,i,n,o;"imagesExtracted"===e.data.message&&(t=document.createElement("canvas"),i=(e=e.data).value,o=e.width,e=e.height,t.width=o,t.height=e,(o=(n=t.getContext("2d")).createImageData(o,e)).data.set(i),n.putImageData(o,0,0),e=t.toDataURL(),h.pdfViewerBase.releaseCanvas(t),s.push(e),s.length===a)&&r(s)})}})},$2t.prototype.textExtractionOnmessage=function(e,t,i){var n="",o=[];if(-1!==e.data.message.indexOf("extractText")||"renderThumbnail"===e.data.message||"renderPreviewTileImage"===e.data.message){for(var r,s=e.data.characterBounds,a=0;a<s.length;a++){e.data.isLayout||-1===s[parseInt(a.toString(),10)].Text.indexOf("\r")?n+=s[parseInt(a.toString(),10)].Text:n+="";var l=this.loadedDocument.getPage(e.data.pageIndex).cropBox,l=new SVt(this.convertPixelToPoint(s[parseInt(a.toString(),10)].X),this.convertPixelToPoint(s[parseInt(a.toString(),10)].Y+l[1]),this.convertPixelToPoint(s[parseInt(a.toString(),10)].Width),this.convertPixelToPoint(s[parseInt(a.toString(),10)].Height));o.push(new eVt(s[parseInt(a.toString(),10)].Text,l))}e.data.isAPI?-1!==e.data.message.indexOf("extractText")&&(n=e.data.pageText,this.textCollections.push((r=function(){return e.data.options===ECt.BoundsOnly?{textData:o}:e.data.options===ECt.TextOnly?{pageText:n}:{textData:o,pageText:n}})()),1===i?(t(r()),this.textCollections=[]):this.textCollections.length===i&&(t(this.textCollections),this.textCollections=[])):(r={},e.data.isRenderText?(r.extractedTextDetails={textDataCollection:o,extractedText:n},r.textBounds=e.data.textBounds,r.textContent=e.data.textContent,r.rotation=e.data.rotation,r.pageText=e.data.pageText,r.characterBounds=e.data.characterBounds,r.isRenderText=e.data.isRenderText,r.pageIndex=e.data.pageIndex,r.jsonObject=e.data.jsonObject,r.requestType=e.data.requestType,r.annotationObject=e.data.annotationObject,r.isNeedToRender=e.data.isNeedToRender):r={textDataCollection:o,extractedText:n,isRenderText:e.data.isRenderText,pageIndex:e.data.pageIndex,jsonObject:e.data.jsonObject,requestType:e.data.requestType,annotationObject:e.data.annotationObject,isNeedToRender:e.data.isNeedToRender},i=this.getPageTextDataCollection(r),je(t=this.getDocumentTextCollection(i))||("pageTextRequest"===t.requestType?this.pdfViewerBase.pageTextRequestSuccess(t,t.pageIndex):"textRequest"===t.requestType?this.pdfViewerBase.textRequestSuccess(t,t.pageIndex,t.annotationObject):"pdfTextSearchRequest"===t.requestType&&this.pdfViewer.textSearchModule.pdfTextSearchRequestSuccess(t,t.pageStartIndex,t.pageEndIndex)))}},$2t.prototype.extractsText=function(i,n,o,r){var s=this;return new Promise(function(e,t){e(s.textExtraction(i,n,o,!0,r))})},$2t.prototype.extractTextFromCharacterDetails=function(e,t,i,n,o){var r="",s=[];if(0<e.length)for(var a=0,l=e;a<l.length;a++){var h=l[a],d=h.Text;n!==ECt.BoundsOnly&&(i||-1===d.indexOf("\r")?r+=d:r+=""),n!==ECt.TextOnly&&(h=new SVt(this.convertPixelToPoint(h.X),this.convertPixelToPoint(h.Y+t[1]),this.convertPixelToPoint(h.Width),this.convertPixelToPoint(h.Height)),s.push(new eVt(d,h)))}return o&&(r=o),n===ECt.BoundsOnly?{textData:s}:n===ECt.TextOnly?{pageText:r}:{textData:s,pageText:r}},$2t.prototype.textExtraction=function(s,a,l,h,d,p,c,u,g){var m=this,f=!h&&(this.pdfViewer.extractTextOption===ECt.None||this.pdfViewer.extractTextOption===ECt.TextOnly);return h||(this.documentTextCollection=[]),new Promise(function(n,e){if(je(m.pdfViewerBase.pdfViewerRunner))n(null);else{var o=(a=Math.min(a,m.pdfViewer.pageCount-1))-s+1,t=function(e,t){i=e;var i=m.pdfViewer.textSearch.documentTextCollection[parseInt(i.toString(),10)]?m.pdfViewer.textSearch.documentTextCollection[parseInt(i.toString(),10)][parseInt(i.toString(),10)]:null;je(i)||!je(i)&&((l===ECt.BoundsOnly||l===ECt.TextAndBounds)&&!je(i.TextData)&&0===i.TextData.length||je(i.TextData))||l===ECt.TextOnly&&!je(i.PageText)&&""===i.PageText||je(i.PageText)?(m.pdfViewerBase.pdfViewerRunner.addTask({pageIndex:e,message:t,zoomFactor:m.pdfViewer.magnificationModule.zoomFactor,isTextNeed:!0,isLayout:d,isSkipCharacterBounds:f,options:l,isRenderText:p,jsonObject:c,requestType:u,annotationObject:g,isAPI:h},h?yRt.Medium:yRt.Low),m.pdfViewerBase.pdfViewerRunner.onMessage(t,function(e){-1!==e.data.message.indexOf("extractText")&&m.textExtractionOnmessage(e,n,o)})):(t=m.loadedDocument.getPage(e).cropBox,e=m.extractTextFromCharacterDetails(i.TextData,t,d,l,i.PageText),m.textCollections.push(e),1==o?(n(e),m.textCollections=[]):m.textCollections.length===o&&(n(m.textCollections),m.textCollections=[]))},i="extractText";if(h&&(i="extractText_"+mRt.createGUID()),!h&&m.pdfViewer.extractTextOption!==ECt.None||h)for(var r=s;r<=a;r++)t(r,i)}})},$2t.prototype.getCharacterBounds=function(e){e=this.pdfViewer.textSearchModule.documentTextCollection[parseInt(e.toString(),10)][parseInt(e.toString(),10)];return e.textData||e.TextData},$2t.prototype.getPageTextDataCollection=function(e){var t,i={};return je(e)?null:((t=e).isRenderText&&((t=e.extractedTextDetails).extractedText=e.pageText),i[e.pageIndex]=new tVt(new iVt(this.getPageSize(e.pageIndex).width,this.getPageSize(e.pageIndex).height),t.textDataCollection,t.extractedText),e.isRenderText?{pageTextDataCollection:i,textBounds:e.textBounds,textContent:e.textContent,rotation:e.rotation,characterBounds:e.characterBounds,jsonObject:e.jsonObject,requestType:e.requestType,pageIndex:e.pageIndex,annotationObject:e.annotationObject,isNeedToRender:e.isNeedToRender}:i)},$2t.prototype.getDocumentTextCollection=function(e){var t=je(e.jsonObject.pageStartIndex)?e.jsonObject.pageIndex:e.jsonObject.pageStartIndex,i=je(e.jsonObject.pageEndIndex)?e.jsonObject.pageIndex+1:e.jsonObject.pageEndIndex,n=this.loadedDocument.pageCount,o=je(e.jsonObject.pageStartIndex)?n:i-t;return je(e)?null:(this.documentTextCollection.push(e.pageTextDataCollection),this.documentTextCollection.length===o?{uniqueId:e.jsonObject.uniqueId,documentTextCollection:this.documentTextCollection,pageStartIndex:t,pageEndIndex:je(e.jsonObject.pageEndIndex)?n:i,textBounds:e.textBounds,textContent:e.textContent,rotation:e.rotation,characterBounds:e.characterBounds,requestType:e.requestType,pageIndex:e.pageIndex,annotationObject:e.annotationObject,isNeedToRender:e.isNeedToRender}:void 0)},$2t.prototype.extractTextWithPageSize=function(i){var n=this;return new Promise(function(e,t){e(n.extractTextDetailsWithPageSize(i))})},$2t.prototype.extractTextDetailsWithPageSize=function(e,t,i,n,o){this.textExtraction(e,e,null,!1,!0,t,i,n,o)},$2t.prototype.getDocumentText=function(e,t,i){var n=je(e.pageStartIndex)?e.pageIndex:e.pageStartIndex,o=je(e.pageEndIndex)?e.pageIndex+1:e.pageEndIndex;this.loadedDocument.pageCount;if(this.pdfViewer.extractTextOption!==ECt.None)for(var r=n;r<o;r++)this.extractTextDetailsWithPageSize(r,!0,e,t,i);else this.pdfViewer.fireTextExtractionCompleted([])},$2t.IsLinuxOS=!1,$2t.IsWindowsOS=!1,$2t);function $2t(e,t){this.bookmarkStyles=[],this.bookmarkCollection=[],this.pageRotationCollection=[],this.bookmarkDictionary={},this.annotationDetailCollection={},this.documentTextCollection=[],this.pageSizes={},this.isCompletePageSizeNotReceieved=!0,this.x=0,this.y=0,this.zoom=1,this.id=0,this.pageIndex=0,this.textCollections=[],this.scaleFactor=1.5,this.restrictionList=[],this.securityList=["Print","EditContent","CopyContent","EditAnnotations","FillFields","AccessibilityCopyContent","AssembleDocument","FullQualityPrint"],this._fallbackFontCollection={},this.document=null,this.searchResults={},this.isDummyInserted=!1,this.pdfViewer=e,this.pdfViewerBase=t}var eVt=function(e,t){this.Text=e,this.Bounds=t},tVt=function(e,t,i){this.PageSize=e,this.TextData=t,this.PageText=i},iVt=function(e,t){this.IsEmpty=!0,this.Width=e,this.Height=t,this.IsEmpty=!1},nVt=function(){};function oVt(){return"AAEAAAAXAQAABABwRFNJRyQ9+ecABX+MAAAafEdERUZeI11yAAV1GAAAAKZHU1VC1fDdzAAFdcAAAAmqSlNURm0qaQYABX9sAAAAHkxUU0iAZfo8AAAceAAABo5PUy8yDN8yawAAAfgAAABWUENMVP17PkMABXTgAAAANlZETVhQkmr1AAAjCAAAEZRjbWFw50BqOgAA0cQAABdqY3Z0IJYq0nYAAPqgAAAGMGZwZ23MeVmaAADpMAAABm5nYXNwABgACQAFdNAAAAAQZ2x5Zg73j+wAARr8AAPnYmhkbXi+u8OXAAA0nAAAnShoZWFkzpgmkgAAAXwAAAA2aGhlYRIzEv8AAAG0AAAAJGhtdHgONFhAAAACUAAAGihrZXJuN2E5NgAFAmAAABVgbG9jYQ5haTIAAQDQAAAaLG1heHALRwyoAAAB2AAAACBuYW1lwPJlOwAFF8AAABsNcG9zdI/p134ABTLQAABB/3ByZXBS/sTpAADvoAAACv8AAQAAAAMAAObouupfDzz1CBsIAAAAAACi4ycqAAAAALnVtPb6r/1nEAAIDAAAAAkAAQABAAAAAAABAAAHPv5OAEMQAPqv/iYQAAABAAAAAAAAAAAAAAAAAAAGigABAAAGigEAAD8AdgAHAAIAEAAvAFYAAAQNCv8AAwACAAEDiAGQAAUAAAWaBTMAAAEbBZoFMwAAA9EAZgISCAUCCwYEAgICAgIEAAB6h4AAAAAAAAAIAAAAAE1vbm8AQAAg//wF0/5RATMHPgGyQAAB////AAAAAAYAAQAAAAAAAjkAAAI5AAACOQCwAtcAXgRzABUEcwBJBx0AdwVWAFgBhwBaAqoAfAKqAHwDHQBABKwAcgI5AKoCqgBBAjkAugI5AAAEcwBVBHMA3wRzADwEcwBWBHMAGgRzAFUEcwBNBHMAYQRzAFMEcwBVAjkAuQI5AKoErABwBKwAcgSsAHAEcwBaCB8AbwVW//0FVgCWBccAZgXHAJ4FVgCiBOMAqAY5AG0FxwCkAjkAvwQAADcFVgCWBHMAlgaqAJgFxwCcBjkAYwVWAJ4GOQBYBccAoQVWAFwE4wAwBccAoQVWAAkHjQAZBVYACQVWAAYE4wApAjkAiwI5AAACOQAnA8EANgRz/+ECqgBZBHMASgRzAIYEAABQBHMARgRzAEsCOQATBHMAQgRzAIcBxwCIAcf/ogQAAIgBxwCDBqoAhwRzAIcEcwBEBHMAhwRzAEgCqgCFBAAAPwI5ACQEcwCDBAAAGgXHAAYEAAAPBAAAIQQAACgCrAA5AhQAvAKsAC8ErABXBVb//QVW//0FxwBoBVYAogXHAJwGOQBjBccAoQRzAEoEcwBKBHMASgRzAEoEcwBKBHMASgQAAFAEcwBLBHMASwRzAEsEcwBLAjkAvQI5ACMCOf/lAjkACQRzAIcEcwBEBHMARARzAEQEcwBEBHMARARzAIMEcwCDBHMAgwRzAIMEcwBJAzMAgARzAGsEcwAbBHMAUQLNAG0ETAABBOMAmQXlAAMF5QADCAAA4QKqAN4CqgA9BGQATggAAAEGOQBTBbQAmgRkAE4EZABNBGQATQRz//0EnACgA/QAOAW0AHoGlgChBGQAAAIxAAAC9gAvAuwALQYlAH8HHQBEBOMAgQTjAJ4CqgDoBKwAcgRkAFQEcwAuBGQAMwTlABoEcwCGBHMAjAgAAO8FVv/9BVb//QY5AGMIAACBB40AUgRz//wIAAAAAqoAUwKqAEcBxwCAAccAbARkAE4D9AAvBAAAIQVWAAYBVv45BHP/5AKqAFwCqgBcBAAAFwQAABcEcwBJAjkAuQHHAGwCqgBHCAAAJQVW//0FVgCiBVb//QVWAKIFVgCiAjkAjQI5/+ACOQAEAjkAFQY5AGMGOQBjBjkAYwXHAKEFxwChBccAoQI5AMYCqgAZAqoABgKqAB0CqgAuAqoA5QKqAKICqgBrAqoAOgKqALcCqgAoBHMAAAHHAAMFVgBcBAAAPwTjACkEAAAoAhQAvAXH//0EcwBJBVYABgQAACEFVgCeBHMAhwSsAHIErAChAqoAawKqABkCqgAhBqwAawasAGsGrAAhBHMAAAY5AG0EcwBCAjkAsQVWAFwEAAA/BccAZgQAAFAFxwBmBAAAUARzAEYEa//hAqoB8QVW//0EcwBKBVb//QRzAEoFxwCeBOsARwXH//0FVgCiBHMASwVWAKIEcwBLBHMAlgHHAEIEcwCWAlUAiARzAJoCrACDBccAnARzAIcFxwCcBHMAhwY5AGMEcwBEBccAoQKqAIUFxwChAqoAPAVWAFwEAAA/BOMAMAI5ACQE4wAwAwAAIwXHAKEEcwCDBccAoQRzAIME4wApBAAAKATjACkEAAAoBGgApAY5AGAGYgBVBKAASAR0AEgDkQBiBPAARAMpAC4FMABIBGv/4QQAALAC6wBSCMAAMwgAAE8EAACZCAAATwQAAJkIAABPBAAAmAQAAJgH1QFqBcAAngSrAHIE1QCdBKwAcQTVAiIE1QEFBav/6QUAAckFqwJ+Bav/6QWrAn4Fq//pBasCfgWr/+kFq//pBav/6QWr/+kFq//pBasBwAWrAn4FqwHABasBwAWr/+kFq//pBav/6QWrAn4FqwHABasBwAWr/+kFq//pBav/6QWrAn4FqwHABasBwAWr/+kFq//pBav/6QWr/+kFq//pBav/6QWr/+kFq//pBav/6QWr/+kFq//pBav/6QWr/+kFq//pBav/6QWr/+kFqwLWBasAZgWr/+oF1f//BNUAkggAAAAH6wEwB+sBIAfrATAH6wEgBNUAsgTVAIAE1QAqCCsBmAhrAbgHVQAQBgAA9AYAAG8EQAA6BUAANwTAAD8EFQBABAAAJQYAAFUF4QC/A40AiQTV/9kBgACAAtUAhgcVAGEClgAPBNUAkgLWAIMC1gCDBNUAsgLWAHAFVv/9BHMASgXHAGYEAABQBccAZgQAAFAFVgCiBHMASwVWAKIEcwBLBVYAogRzAEsGOQBtBHMAQgY5AG0EcwBCBjkAbQRzAEIFxwCkBHMAhwXHAB8EcwAGAjn/zgI5/84COf/kAjn/5AI5//YCOf/1AjkAowHHAGYEAAA3Acf/ogVWAJYEAACIBAAAhgRzAJYBx//6BccAnARzAIcFyQClBHMAiwY5AGMEcwBEBjkAYwRzAEQFxwChAqoAawVWAFwEAAA/BOMAMAI5AAwFxwChBHMAgwXHAKEEcwCDBccAoQRzAIMFxwChBHMAgweNABkFxwAGBVYABgQAACEBxwCJBVb//QRzAEoIAAABBx0ARAY5AFME4wCBAjkAuQeNABkFxwAGB40AGQXHAAYHjQAZBccABgVWAAYEAAAhAccAigKq/+EEcwAbBM0AWgasAGsGrAAiBqwAIgasAEoCqgDiAqoAawKqAN4Cqv/qBVf//wZG/6cGtP+oAxL/qAYy/6cG2P+nBgX/pwHH/3gFVv/9BVYAlgVY//4FVgCiBOMAKQXHAKQCOQC/BVYAlgVYAAsGqgCYBccAnAUzAG0GOQBjBccApAVWAJ4E8gCUBOMAMAVWAAYFVgAJBq8AfwX7AGECOQAEBVYABgSgAEgDkQBiBHMAiwHHAGsEYACIBJoAjAQAABkDhwBIBHMAiwRzAFwBxwCJBAAAhgQAABgEnACgBAAAGgOVAFwEcwBEBI0AgwPbAFYEYACIBDMAEQW0AHoGPwBXAcf/yQRgAIgEcwBIBGAAiAY/AFcFVwCiBusAMgRVAKEFwABkBVYAXAI5AL8COQAEBAAANwh1AA0IFQCkBtUAMQSpAKEFFQAKBcAAoAVW//0FQACnBVYAlgRVAKEFawAABVYAogdjAAcE1QBOBcAAoQXAAKEEqQChBUAAEgaqAJgFxwCkBjkAYwXAAKAFVgCeBccAZgTjADAFFQAKBhUAUgVWAAkF6wCfBVUAVwdVAKEHgAChBlUAAAcVAKgFQAClBcAAVQgVAKQFxwAaBHMASgSVAFsEQACIAusAiASrAAAEcwBLBVr/+wOrADIEeACHBHgAhwOAAIYEqwAYBYAAjARrAIgEcwBEBFUAiARzAIcEAABQA6oAJgQAACEGlQBLBAAADwSVAIoEKwBFBmsAjQaVAI0FAAAoBcAAiwQrAIQEFQAwBgAAiQRVAB8EcwBLBHMAAALrAIkEFQBLBAAAPwHHAIgCOQAJAcf/ogdAABMGgACDBHMAAAOAAIYEAAAhBGsAiAPpAKEDSgCICAAAQQiVAKAFhQAtAqoBAQKqAB4CqgAxAqoAMQKqAQECqgB+AqoAfgKqAIwCqgCMAqoBAQKqABACqgEBAqoBIQMQAH0CqgCMAjMA0gKqAwsCqv8EAjkAuQSBAGkEVgAyAzEAGQQRAC0E0QCWAfkAmwMPAF8EygCbBLgAjAH5AJsEEwAoA7AAUAO0ADwEygCbBM8AUAH5AJsC0gA8BJgAWgQ8ABkEiABuBF8AcwOxABkD1AAKBGYAlgQTACgFjgBkBSQAKAPyAJsD8gCbA/IAmwHjAFoDVgBaBoYAmwH5/6wEEwAoBBMAKAO0/1cDtP9XBEgALQWOAGQFjgBkBY4AZAWOAGQEgQBpBIEAaQSBAGkEVgAyAzEAGQQRAC0E0QCWAksAAANKAAAEuACMAksAAAQTACgDsABQA7QAPATPAFAC0gA8BJgAWgSIAG4EXwBzA9QACgRmAJYEEwAoBY4AZAUkACgB+QCbBFYAMgOwAFAEXwBzBJsAPAAA/9wAAP8lAAD/3AAA/lECjQCrAo0AoALaAEMDTQB5Aaj/ugGcAEYB5QBGAZwARgGcAEYBrQBIAZwARgGxAEYBUQBGBDUBfAQ1AS4ENQC3BDUAgQQ1ASwENQC+BDUArwQ1AIEENQCaBDUA2wQ1AIUCjQDBBDUAswYAAQAGAAEAAkIANgYAAQAENQCeBDUAmAQ1AMsGAAEABgABAAYAAQAGAAEABgABAAGxAEYGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAUb/7oGAAEABgABAAYAAQAFtQA6BbUAOgH0/7oB9P+6BgABAAYAAQAGAAEABgABAASBADYENQA2BD3/ugQ9/7oD6QBKA+kASgZ/ABQHdgAUAyf/ugQe/7oGfwAUB3YAFAMn/7oEHv+6BRsAMgS1ACQGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEAAc8AMAGxAEYBsQBGAbEAQAGxAEYGAAEABgABAAAA/9wAAP5RAAD/FgAA/xYAAP8WAAD/FgAA/xYAAP8WAAD/FgAA/xYAAP8WAAD/3AAA/xYAAP/cAAD/IAAA/9wEcwBKCAAAAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQACjQB/Ao0AXQYAAQAE7gAVA00AeQGoAA4B1v/cAagAVgHWABADdQAyA3UAMgGoAC0B1gATBRsAMgS1ACQB9P+6AfT/ugGoAJMB1gATBbUAOgW1ADoB9P+6AfT/ugJCAAADAP/3BbUAOgW1ADoB9P+6AfT/ugW1ADoFtQA6AfT/ugH0/7oEgQA2BDUANgQ9/7oEPf+6BIEANgQ1ADYEPf+6BD3/ugSBADYENQA2BD3/ugQ9/7oCswBfArMAXwKzAF8CswBfA+kASgPpAEoD6QBKA+kASgaSAD4GkgA+BD//ugQ//7oGkgA+BpIAPgQ//7oEP/+6CMkAPgjJAD4Gxf+6BsX/ugjJAD4IyQA+BsX/ugbF/7oEp/+6BKf/ugSn/7oEp/+6BKf/ugSn/7oEp/+6BKf/ugRaACoDmgA2BDX/ugMn/7oEWgAqA5oANgQ1/7oDJ/+6Bk8AJwZPACcCJP+6Ahr/ugSnAEYEpwBGAiT/ugIa/7oEzwAtBM8ALQMn/7oDJ/+6BA0ARwQNAEcBqP+6Aaj/ugK0ACMCtAAjAyf/ugMn/7oENQBFBDUARQH0/7oB9P+6AkIANgMA//cDmv+6Ayf/ugN1ADIDdQAyBRsAMgS1ACQFGwAyBLUAJAH0/7oB9P+6BFoAQATOAEkEWgAmBM4AOQRaAFMEzgBKBFoAUwTOAEoGAAEABgABAAGcAEYBnABGBgABAAYAAQAGAAEAAVEARgGxAEYGAAEABgABAAGtAEgB5QBGBgABAAYAAQAGAAEAAbEARgGxAEYBsQBGAbEARgGxAEABzwAwBgABAAGcAEYBnABGBgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEAAo0AygKNAMcCjQDGBgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEABgABAAYAAQAGAAEAAQD/uggA/7oQAP+6BtwAYwU/AEQG1QChBVsAgwAA/dwAAPwvAAD8pgAA/lQAAPzXAAD9cwAA/ikAAP4NAAD9EQAA/GcAAP2dAAD79QAA/HIAAP7VAAD+1QAA/wIEGwCgBqwAawasABkAAP62AAD9cwAA/ggAAPymAAD+UwAA/REAAPvIAAD69AAA+q8AAPxyAAD7qgAA+2oAAPzxAAD8fQAA+90AAPzBAAD7mAAA/eoAAP6EAAD9wgAA/PEAAP1fAAD+dgAA/rwAAPzrAAD9bAAA/VgAAPyQAAD9FQAA/CwAAPwTAAD8EgAA+5YAAPuWAccAiAVW//0EcwBKBVb//QRzAEoFVv/9BHMASgVW//0EcwBKBVb//QRzAEoFVv/9BHMASgVW//0EcwBKBVb//QRzAEoFVv/9BHMASgVW//0EcwBKBVb//QRzAEoFVv/9BHMASgVWAKIEcwBLBVYAogRzAEsFVgCiBHMASwVWAKIEcwBLBVYAogRzAEsFVgCiBHMASwVWAKIEcwBLBVYAogRzAEsCOQBjAccAHwI5ALoBxwB8BjkAYwRzAEQGOQBjBHMARAY5AGMEcwBEBjkAYwRzAEQGOQBjBHMARAY5AGMEcwBEBjkAYwRzAEQG3ABjBT8ARAbcAGMFPwBEBtwAYwU/AEQG3ABjBT8ARAbcAGMFPwBEBccAoQRzAIMFxwChBHMAgwbVAKEFWwCDBtUAoQVbAIMG1QChBVsAgwbVAKEFWwCDBtUAoQVbAIMFVgAGBAAAIQVWAAYEAAAhBVYABgQAACEFVv/9BHMASgI5/+IBx/+wBjkAYwRzAEQFxwChBHMAgwXHAKEEcwCDBccAoQRzAIMFxwChBHMAgwXHAKEEcwCDAAD+/gAA/v4AAP7+AAD+/gRV//0C6wAMB2MABwVa//sEqQChA4AAhgSpAKEDgACGBccApARrAIgEc//9BAAAFARz//0EAAAUBVYACQQAAA8FVQBXBCsARQVVAKEEcwCHBgUAYwRzAFUGOQBgBHMARAW1ADoB9P+6AiT/ugIa/7oEpwBGAfQAngH0ABAB9AAbAfQAEAH0AGsB9P/5Aif/zgGoAA8BqP/1AqoApAKqAKQBqAAOAagAVgGoAFYAAP/PAagADwHW/78BqP/1Adb/zQGoAB0B1v/1AagAkwHWABMDdQAyA3UAMgN1ADIDdQAyBRsAMgS1ACQFtQA6BbUAOgH0/7oB9P+6BbUAOgW1ADoB9P+6AfT/ugW1ADoFtQA6AfT/ugH0/7oFtQA6BbUAOgH0/7oB9P+6BbUAOgW1ADoB9P+6AfT/ugW1ADoFtQA6AfT/ugH0/7oFtQA6BbUAOgH0/7oB9P+6BIEANgQ1ADYEPf+6BD3/ugSBADYENQA2BD3/ugQ9/7oEgQA2BDUANgQ9/7oEPf+6BIEANgQ1ADYEPf+6BD3/ugSBADYENQA2BD3/ugQ9/7oEgQA2BDUANgQ9/7oEPf+6ArMAMgKzADICswBfArMAXwKzAF8CswBfArMAMgKzADICswBfArMAXwKzAF8CswBfArMAXwKzAF8CswA4ArMAOAKzAEkCswBJA+kASgPpAEoD6QBKA+kASgPpAEoD6QBKA+kASgPpAEoD6QBKA+kASgPpAEoD6QBKA+kASgPpAEoD6QBKA+kASgaSAD4GkgA+BD//ugQ//7oGkgA+BpIAPgQ//7oEP/+6BpIAPgaSAD4EP/+6BD//ugjJAD4IyQA+BsX/ugbF/7oIyQA+CMkAPgbF/7oGxf+6BKf/ugSn/7oEWgAqA5oANgQ1/7oDJ/+6Bk8AJwZPACcGTwAnAiT/ugIa/7oGTwAnBk8AJwIk/7oCGv+6Bk8AJwZPACcCJP+6Ahr/ugZPACcGTwAnAiT/ugIa/7oGTwAnBk8AJwIk/7oCGv+6BKcARgSnAEYEpwBGBKcARgZ/ABQHdgAUAyf/ugQe/7oGfwAUB3YAFAMn/7oEHv+6BM8ALQTPAC0DJ/+6Ayf/ugTPAC0EzwAtAyf/ugMn/7oEzwAtBM8ALQMn/7oDJ/+6Bn8AFAd2ABQDJ/+6BB7/ugZ/ABQHdgAUAyf/ugQe/7oGfwAUB3YAFAMn/7oEHv+6Bn8AFAd2ABQDJ/+6BB7/ugZ/ABQHdgAUAyf/ugQe/7oEDQBHBA0ARwGo/7oBqP+6BA0ARwQNAEcBqP+6Aaj/ugQNAEcEDQBHAaj/ugGo/7oEDQBHBA0ARwGo/7oBqP+6BDUARQQ1AEUB9P+6AfT/ugQ1AEUENQBFBDUARQQ1AEUENQBFBDUARQH0/7oB9P+6BDUARQQ1AEUEgQA2BDUANgQ9/7oEPf+6AkIANgMA//cDGgAaAxoAGgMaABoDdQAyA3UAMgN1ADIDdQAyA3UAMgN1ADIDdQAyA3UAMgN1ADIDdQAyA3UAMgN1ADIDdQAyA3UAMgN1ADIDdQAyBRv/ugS1/7oFGwAyBLUAJAH0/7oB9P+6A3UAMgN1ADIFGwAyBLUAJAH0/7oB9P+6BRsAMgS1ACQGfwBFBn8ARQZ/AEUGfwBFAagAKAAA/ikAAP6iAAD/MAAA/x0AAP8SAAD/kgAA/n4I/AAyCK0AMgAA/7UAAP+2AAD+7QAA/2QAAP5+AAD/nwGNAAAC9v/9AAD+ggAA/xAEzQAyAAD/WAAA/1gAAP9kBpIAPgaSAD4EP/+6BD//ugjJAD4IyQA+BsX/ugbF/7oEWgAqA5oANgQ1/7oDJ/+6A00AeQK0ACMCQgA2AfT/ugKQ/7oB9AAvAfQAOwH0ABIB9ACxAfQAbQZ/ABQHdgAUAfkAmwAA/tkCvAAAA/IAmwRa//UEzv/1BFoAUwTOAEoEWgBTBM4ASgRaAFMEzgBKBFoAUwTOAEoEWgBTBM4ASgRaAFMEzgBKBDUAcQQ1AK0EWgAPBM4ADwAABooHAQEBqwYGBgUFBgYGBgcHBgcHBgYGBgYGBgYGBgcHBwcHBgElBQwMDAwSHD4cBQZ1HBIcEhIFmhwfheCWEgcHB8IGBiY1BiMnZVM3OeVdOXE3JDVTBisSN8ak1cRjBv4GBwUFBgUGBwYGBgYGBgYGBgYGBgcHBwcGBgYGBgYGBgYGBgUGBgYGBhEGBgEGBgYBDAYGBgYGGAwMAQb/FhgBBSkM4QdSBgxNBgYBBQUHEQcGARQUBQUGAgYFAQYGBwEBBgcFFF8FBQUFBQcHBwcHBwcGBgb/BvwBAQEBBgEBAQEZBQYcY/4GBgUGBQYBBwYGBgwEDAESUz4BKy4LLgstBgYlJiUmLgEuDCcMJwE5ASUBAS43LjcSJC4BLgEBK5r+mgEuNy43HGMcYwESMAstJhIeHhQBJjIBAQEBAQEBGQEBGQEZGQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBGRkBMjIyMhkZGQEBKwEBAQEBMQEBEgEZARkxEhkBARkBJSYuCy4LDCcMJwwnElMSUxIBLjcuNz7/Pv8+/z45HOUBXRgBOS43AQESJBIkLgEBKxwSLjcuNy43LjeFpJXEOSUmAQEMKf+FpIWkhaSVxAEBAQwMDAwMAQEBASUBFhIBghTdJQENDBwuPgEQdS4fEi4cAZqVTScPPpULJindKQEeEikk3RgVGMYxJCQkKRUoKt0pJCkqDAElDAE+PhwBMTcMMRslJAElDAwYGQwMDBJ1LhIcHC6aMTFNGhwrFCUxFAExLiYxJCYBJygLNzcNNxY3JDc1CxTEMdUxASwxJAEqMQElJzcmMSs5/98kJDcNxDcBAQExDAEBAQEBAQEBAQEBAQEBAbMBAQEBAQwBAfcSAQz3AQEcAQH3DAwBECwMDB8BExbCwsIBAcr3AQEcHA8TExMTAQEBAQwBAQELDAEBARwBDAwQLAwfARMW9wEBLAEBAQEBAQEIAQEBFAEBIAEbBAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEbAQEBAQEBAQEBAQEBAQEsLAEBAQEBAQEBAQEJAQEjCQEBIwEBAQEBAQEBAQEBAQEBAQEBASsbGxsbAQEBAQEBAQEBAQEBAQEBAQEBDAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBLAEBAQEBAQEBAQEBLCwBAQEBLCwBAQEBLCwBASwsAQEBAQEBAQEBAQEBKSkpKQEBAQErKxERKysREQEBAQEBAQEBMjIyMjIyMjIjAQEBIwEBAQEBHQEyMh0BAQEBAQEBAQEBAQEBAQEsLAEBAQEBAQEBAQEsLCMBIwEjASMBAQEBAQEBAQQbAQEgFAEBARsbGxsbKwEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQERGQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBATklJiUmJSYlJiUmJSYlJiUmJSYlJiUmJSYMJwwnDCcMJwwnDCcMJwwnPgc+ORIkEiQSJBIkEiQSJBIkAREBEQERAREBERw3HDcZARkBGQEZARkBlsSWxJbEJSY+ORIkHDccNxw3HDccNwAAAAAlJgEBBwEHAS4UAQEBAQEBAQEBNwEBAQEBLB0BMiwsLCwsLCgBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEsLAEBLCwBASwsAQEsLAEBLCwBASwsAQEsLAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBASkpKSkpKSkpKSkpKSkpKSkpKQEBAQEBAQEBAQEBAQEBAQErKxERKysRESsrEREBAQEBAQEBATIyIwEBAQEBAR0BAQEdAQEBHQEBAR0BAQEdATIyMjIJAQEjCQEBIwEBAQEBAQEBAQEBAQkBASMJAQEjCQEBIwkBASMJAQEjAQEBAQEBAQEBAQEBAQEBAQEBLCwBAQEBAQEsLAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEsLAEBAQEsLAEBCQkJCQEBAQEBAQEBBQEBAQEBAQEyAQEBAQEBASsrEREBAQEBIwEBAQEBASwoLCwsLCwJAfcBFMIjASMBIwEjASMBIwEjAQEBIwEAAAAAAAMAAwEBAQEBBQMDAQIBAQAYBewLwAD4CP8ACAAI//4ACQAJ//0ACgAK//0ACwAL//0ADAAM//0ADQAN//0ADgAN//0ADwAO//0AEAAP//0AEQAP//wAEgAR//wAEwAS//wAFAAT//wAFQAT//sAFgAU//sAFwAV//sAGAAV//oAGQAX//sAGgAZ//oAGwAa//oAHAAa//oAHQAb//oAHgAc//kAHwAc//kAIAAd//kAIQAf//kAIgAg//kAIwAg//gAJAAh//gAJQAi//gAJgAi//cAJwAj//cAKAAk//cAKQAm//cAKgAm//cAKwAn//YALAAo//YALQAo//YALgAq//YALwAr//YAMAAt//YAMQAt//UAMgAu//UAMwAv//UANAAw//QANQAw//QANgAx//QANwAz//QAOAA0//MAOQA0//MAOgA1//MAOwA1//MAPAA2//MAPQA3//MAPgA4//MAPwA5//IAQAA6//IAQQA7//IAQgA8//IAQwA8//EARAA9//EARQA+//EARgA///AARwBA//AASABB//AASQBC//AASgBC//AASwBD//AATABE//AATQBG/+8ATgBG/+8ATwBH/+8AUABI/+8AUQBJ/+4AUgBJ/+4AUwBK/+4AVABL/+0AVQBN/+0AVgBN/+0AVwBO/+0AWABP/+wAWQBQ/+wAWgBQ/+0AWwBR/+wAXABT/+wAXQBU/+wAXgBU/+wAXwBV/+sAYABW/+sAYQBX/+sAYgBX/+oAYwBZ/+oAZABa/+oAZQBb/+oAZgBc/+kAZwBc/+kAaABd/+kAaQBe/+gAagBg/+kAawBg/+kAbABh/+kAbQBi/+gAbgBj/+gAbwBj/+gAcABk/+cAcQBl/+cAcgBn/+cAcwBn/+cAdABo/+YAdQBp/+YAdgBq/+YAdwBq/+UAeABr/+UAeQBt/+UAegBu/+UAewBu/+UAfABv/+UAfQBw/+UAfgBx/+QAfwBx/+QAgABz/+QAgQB0/+QAggB1/+MAgwB2/+MAhAB2/+MAhQB3/+IAhgB4/+IAhwB5/+IAiAB6/+IAiQB7/+EAigB8/+EAiwB9/+IAjAB9/+EAjQB+/+EAjgB//+EAjwCB/+EAkACB/+AAkQCC/+AAkgCD/+AAkwCE/98AlACE/98AlQCF/98AlgCH/98AlwCI/+AAmACI/98AmQCJ/98AmgCK/94AmwCL/94AnACM/94AnQCM/94AngCO/94AnwCP/94AoACQ/94AoQCQ/90AogCR/90AowCS/90ApACT/90ApQCU/9wApgCV/9sApwCW/9sAqACX/9sAqQCX/9sAqgCY/9sAqwCZ/9sArACb/9sArQCb/9sArgCc/9sArwCd/9sAsACe/9sAsQCe/9oAsgCf/9oAswCg/9oAtACi/9kAtQCj/9gAtgCj/9gAtwCk/9gAuACl/9gAuQCm/9gAugCm/9gAuwCo/9gAvACp/9cAvQCq/9cAvgCq/9cAvwCr/9cAwACs/9cAwQCt/9cAwgCu/9cAwwCv/9YAxACw/9YAxQCx/9UAxgCx/9UAxwCy/9UAyACz/9QAyQC0/9QAygC1/9QAywC2/9QAzAC3/9QAzQC4/9QAzgC5/9QAzwC5/9QA0AC6/9QA0QC8/9QA0gC9/9MA0wC9/9IA1AC+/9IA1QC//9IA1gDA/9EA1wDA/9EA2ADC/9EA2QDD/9EA2gDE/9EA2wDE/9EA3ADF/9EA3QDG/9EA3gDH/9AA3wDH/9AA4ADJ/88A4QDK/88A4gDL/88A4wDL/88A5ADM/88A5QDN/88A5gDO/88A5wDQ/84A6ADQ/84A6QDR/84A6gDS/80A6wDT/80A7ADT/80A7QDU/80A7gDW/8wA7wDX/8wA8ADX/8wA8QDY/8wA8gDZ/8wA8wDa/8wA9ADa/8wA9QDc/8sA9gDd/8sA9wDe/8sA+ADe/8oA+QDf/8oA+gDg/8oA+wDh/8oA/ADh/8oA/QDj/8kA/gDk/8kA/wDl/8kA+Aj/AAgACP/+AAkACf/9AAoACv/9AAsAC//9AAwADP/9AA0ADf/9AA4ADf/9AA8ADv/9ABAAD//9ABEAD//8ABIAEf/8ABMAEv/8ABQAE//8ABUAE//7ABYAFP/7ABcAFf/7ABgAFf/6ABkAF//7ABoAGf/6ABsAGv/6ABwAGv/6AB0AG//6AB4AHP/5AB8AHP/5ACAAHf/5ACEAH//5ACIAIP/5ACMAIP/4ACQAIf/4ACUAIv/4ACYAIv/3ACcAI//3ACgAJP/3ACkAJv/3ACoAJv/3ACsAJ//2ACwAKP/2AC0AKP/2AC4AKv/2AC8AK//2ADAALf/2ADEALf/1ADIALv/1ADMAL//1ADQAMP/0ADUAMP/0ADYAMf/0ADcAM//0ADgANP/zADkANP/zADoANf/zADsANf/zADwANv/zAD0AN//zAD4AOP/zAD8AOf/yAEAAOv/yAEEAO//yAEIAPP/xAEMAPP/xAEQAPf/xAEUAPv/xAEYAP//wAEcAQP/wAEgAQf/wAEkAQv/wAEoAQv/wAEsAQ//wAEwARP/wAE0ARv/vAE4ARv/vAE8AR//vAFAASP/vAFEASf/uAFIASf/uAFMASv/uAFQAS//tAFUATf/tAFYATf/tAFcATv/tAFgAT//sAFkAUP/sAFoAUP/tAFsAUf/sAFwAU//sAF0AVP/sAF4AVP/sAF8AVf/rAGAAVv/rAGEAV//rAGIAV//rAGMAWf/qAGQAWv/qAGUAW//qAGYAXP/pAGcAXP/pAGgAXf/pAGkAXv/pAGoAYP/pAGsAYP/pAGwAYf/pAG0AYv/pAG4AY//oAG8AY//oAHAAZP/oAHEAZf/nAHIAZ//nAHMAZ//nAHQAaP/nAHUAaf/mAHYAav/mAHcAav/mAHgAa//lAHkAbf/lAHoAbv/lAHsAbv/lAHwAb//lAH0AcP/kAH4Acf/kAH8Acv/kAIAAc//kAIEAdP/jAIIAdf/jAIMAdv/jAIQAdv/jAIUAd//jAIYAeP/jAIcAef/iAIgAev/iAIkAe//iAIoAfP/iAIsAff/iAIwAff/iAI0Afv/iAI4Af//iAI8Agf/hAJAAgf/hAJEAgv/gAJIAg//gAJMAhP/gAJQAhP/gAJUAhf/gAJYAh//fAJcAiP/gAJgAiP/fAJkAif/fAJoAiv/eAJsAi//eAJwAjP/eAJ0AjP/eAJ4Ajv/eAJ8Aj//eAKAAkP/eAKEAkP/dAKIAkf/dAKMAkv/dAKQAk//dAKUAlP/cAKYAlf/bAKcAlv/bAKgAl//bAKkAl//bAKoAmP/bAKsAmf/bAKwAm//bAK0Am//bAK4AnP/bAK8Anf/bALAAnv/bALEAnv/aALIAn//aALMAoP/ZALQAov/ZALUAo//YALYAo//YALcApP/YALgApf/YALkApv/YALoApv/YALsAqP/YALwAqf/XAL0Aqv/XAL4Aqv/XAL8Aq//XAMAArP/XAMEArf/XAMIArv/XAMMAr//WAMQAsP/WAMUAsf/VAMYAsf/VAMcAsv/UAMgAs//UAMkAtP/UAMoAtf/UAMsAtv/UAMwAt//UAM0AuP/UAM4Auf/UAM8Auf/UANAAuv/UANEAvP/UANIAvf/TANMAvf/SANQAvv/SANUAv//SANYAwP/RANcAwP/RANgAwv/RANkAw//RANoAxP/RANsAxP/RANwAxf/RAN0Axv/RAN4Ax//QAN8Ax//QAOAAyf/PAOEAyv/PAOIAy//PAOMAy//PAOQAzP/PAOUAzf/PAOYAzv/PAOcA0P/OAOgA0P/OAOkA0f/OAOoA0v/NAOsA0//NAOwA0//NAO0A1P/NAO4A1v/MAO8A1//MAPAA1//MAPEA2P/MAPIA2f/MAPMA2v/MAPQA2v/MAPUA3P/LAPYA3f/LAPcA3v/LAPgA3v/KAPkA3//KAPoA4P/KAPsA4f/KAPwA4f/KAP0A4//JAP4A5P/JAP8A5f/JAPgI/wAIAAj//gAJAAn//QAKAAr//QALAAv//QAMAAz//QANAA3//QAOAA3//QAPAA7//QAQAA///QARAA///AASABH//AATABL//AAUABP//AAVABP/+wAWABT/+wAXABX/+wAYABX/+gAZABf/+wAaABn/+gAbABr/+gAcABr/+gAdABv/+gAeABz/+QAfABz/+QAgAB3/+QAhAB//+QAiACD/+QAjACD/+AAkACH/+AAlACL/+AAmACL/9wAnACP/9wAoACT/9wApACb/9wAqACb/9wArACf/9gAsACj/9gAtACj/9gAuACr/9gAvACv/9gAwAC3/9gAxAC3/9QAyAC7/9QAzAC//9QA0ADD/9AA1ADD/9AA2ADH/9AA3ADP/9AA4ADT/8wA5ADT/8wA6ADX/8wA7ADX/8wA8ADb/8wA9ADf/8wA+ADj/8wA/ADn/8gBAADr/8gBBADv/8gBCADz/8gBDADz/8QBEAD3/8QBFAD7/8QBGAD//8ABHAED/8ABIAEH/8ABJAEL/8ABKAEL/8ABLAEP/8ABMAET/8ABNAEb/7wBOAEb/7wBPAEf/7wBQAEj/7wBRAEn/7gBSAEn/7gBTAEr/7gBUAEv/7QBVAE3/7QBWAE3/7QBXAE7/7QBYAE//7ABZAFD/7ABaAFD/7QBbAFH/7ABcAFP/7ABdAFT/7ABeAFT/7ABfAFX/6wBgAFb/6wBhAFf/6wBiAFf/6wBjAFn/6gBkAFr/6gBlAFv/6gBmAFz/6QBnAFz/6QBoAF3/6QBpAF7/6QBqAGD/6QBrAGD/6QBsAGH/6QBtAGL/6QBuAGP/6ABvAGP/6ABwAGT/6ABxAGX/5wByAGf/5wBzAGf/5wB0AGj/5wB1AGn/5gB2AGr/5gB3AGr/5gB4AGv/5QB5AG3/5QB6AG7/5QB7AG7/5QB8AG//5QB9AHD/5AB+AHH/5AB/AHL/5ACAAHP/5ACBAHT/5ACCAHX/4wCDAHb/4wCEAHb/4wCFAHf/4wCGAHj/4wCHAHn/4gCIAHr/4gCJAHv/4gCKAHz/4gCLAH3/4gCMAH3/4gCNAH7/4gCOAH//4gCPAIH/4QCQAIH/4QCRAIL/4ACSAIP/4ACTAIT/4ACUAIT/4ACVAIX/4ACWAIf/3wCXAIj/4ACYAIj/3wCZAIn/3wCaAIr/3gCbAIv/3gCcAIz/3gCdAIz/3gCeAI7/3gCfAI//3gCgAJD/3gChAJD/3QCiAJH/3QCjAJL/3QCkAJP/3QClAJT/3ACmAJX/2wCnAJb/2wCoAJf/2wCpAJf/2wCqAJj/2wCrAJn/2wCsAJv/2wCtAJv/2wCuAJz/2wCvAJ3/2wCwAJ7/2wCxAJ7/2gCyAJ//2gCzAKD/2QC0AKL/2QC1AKP/2AC2AKP/2AC3AKT/2AC4AKX/2AC5AKb/2AC6AKb/2AC7AKj/2AC8AKn/1wC9AKr/1wC+AKr/1wC/AKv/1wDAAKz/1wDBAK3/1wDCAK7/1wDDAK//1gDEALD/1gDFALH/1QDGALH/1QDHALL/1ADIALP/1ADJALT/1ADKALX/1ADLALb/1ADMALf/1ADNALj/1ADOALn/1ADPALn/1ADQALr/1ADRALz/1ADSAL3/0wDTAL3/0gDUAL7/0gDVAL//0gDWAMD/0QDXAMD/0QDYAML/0QDZAMP/0QDaAMT/0QDbAMT/0QDcAMX/0QDdAMb/0QDeAMf/0ADfAMj/0ADgAMn/zwDhAMr/zwDiAMv/zwDjAMv/zwDkAMz/zwDlAM3/zwDmAM7/zwDnAND/zgDoAND/zgDpANH/zgDqANL/zQDrANP/zQDsANP/zQDtANT/zQDuANb/zADvANf/zADwANf/zADxANj/zADyANn/zADzANr/zAD0ANr/zAD1ANz/ywD2AN3/ywD3AN7/ywD4AN7/ygD5AN//ygD6AOD/ygD7AOH/ygD8AOH/ygD9AOP/yQD+AOT/yQD/AOX/yQAAABgAAAaMCxYIAAMDAgQGBgoHAgQEBAYDBAMDBgYGBgYGBgYGBgMDBgYGBgsIBwcHBgYIBwIFBwYIBwgGCAcHBgcICgcIBwMDAwUGBAYGBgYGBAYGAgIFAggGBgYGBAYDBgYKBgYGBAIEBggIBwYHCAcGBgYGBgYGBgYGBgICAgIGBgYGBgYGBgYGBgQGBgYEBgcICAsEBAYLCAgGBgYGBgYHCQYDBAUICgYGAgYHBgcGBgYLCAgICwoGCwQEAgIGBQYIAgYEBAYGBgMCBAsIBggGBgICAgIICAgHBwcCBAQEBAQEBAQEBAYCBwYHBgIIBggGBwYGBgQEBAoJCgYIBgIHBgcGBwYGBgQIBggGBwcIBgYGBgYCBgQGBAcGBwYIBgcEBwQHBgYDBgQHBgcGBwYHBgYICAYGBQcEBwYGBAwLBgsGCwYGCwgGBwYHBwgHCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAcLCwsLCwcHBwsMCggIBgcHBgYICAUHAgQKBAcEBAcECAYHBgcGBgYGBgYGCAYIBggGBwYJBgICAgICAgICBQIHBQYGAgcGCAYIBggGBwQHBgYEBwYHBgcGCAYKCggGAggGCwoIBgMKCgoKCgoIBgIEBgYKCgoKBAQEBAgJCQUJCggCCAcIBgcHAgcICAcHCAcGBwYIBwgIAggGBQYCBgYGBQYGAgYGBgYFBgYFBgUICAIGBgYIBgoGBwcCAgUMCwkHBwcIBwcGCAYMBwkJBwcIBwgHBgcGBwgHBwYKCggJBwgLCAYGBwQGBggFBgYFBggGBgYGBgYGCAYGBggIBwgGBggGBgYEBgYCAgIKCQYFBgYFBQsNCQQEBAQEBAQEBAQEBAQEBAMEBAMGBgUGBwMDBwcDBgUFBwcDBQcGBgYGBgYGCQcGBgYDBQkDBgYFBQcJCQkJBgYGBgUGBwMFBwMGBQUHBQcGBgYGBgkHAwYFBgYAAAAABAQEBQICAwICAgICAgYGBgYGBgYGBgYGBAYICAMIBgYGCAgICAgCCAgICAgICAgHCAgICAgDAwgICAgGBgYGBQUJCgQGCQoEBgcGCAgICAgICAgICAgICAgICAICAgICCAgAAAAAAAAAAAAAAAAAAAAABwsICAgICAgICAgICAgICAgICAgICAgICAgICAgIBAQIBwUCAwIDBQUCAwcGAwMCAwgIAwMDBAgIAwMICAMDBgYGBgYGBgYGBgYGBAQEBAUFBQUJCQYGCQkGBgwMCQkMDAkJBgYGBgYGBgYGBQYEBgUGBAkJAwMGBgMDBwcEBAYGAgIEBAQEBgYDAwMEBQQFBQcGBwYDAwYHBgcGBwYHCAgCAggICAICCAgCAwgICAICAgICAggCAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAQEBAgICAgICAgICAgICAgICAgICAgICAgICAELFgkHCQcAAAAAAAAAAAAAAAAAAAAABgkJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIIBggGCAYIBggGCAYIBggGCAYIBggGCAYGBgYGBgYGBgYGBgYGBgYGAgICAggGCAYIBggGCAYIBggGCQcJBwkHCQcJBwcGBwYJBwkHCQcJBwkHCAYIBggGCAYCAggGBwYHBgcGBwYHBgAAAAAGBAoHBgUGBQgGBgYGBgcGBwYHBggGCQYIAwMDBgMDAwMDAwMCAgQEAgICAAIDAgMCAwIDBQUFBQcGCAgDAwgIAwMICAMDCAgDAwgIAwMICAMDCAgDAwYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgQEBAQEBAQEBAQEBAQEBAQEBAUFBQUFBQUFBQUFBQUFBQUJCQYGCQkGBgkJBgYMDAkJDAwJCQYGBgUGBAkJCQMDCQkDAwkJAwMJCQMDCQkDAwYGBgYJCgQGCQoEBgcHBAQHBwQEBwcEBAkKBAYJCgQGCQoEBgkKBAYJCgQGBgYCAgYGAgIGBgICBgYCAgYGAwMGBgYGBgYDAwYGBgYGBgMEBAQEBQUFBQUFBQUFBQUFBQUFBQcGBwYDAwUFBwYDAwcGCQkJCQIAAAAAAAAADAwAAAAAAAACBAAABwAAAAkJBgYMDAkJBgUGBAUEAwMEAwMDAwMJCgMABAYGBwYHBgcGBwYHBgcGBwYGBgcMGAkAAwMDBAcHCwgCBAQFBwMEAwMHBwcHBwcHBwcHAwMHBwcHDAcICQkIBwkJAwYIBwkJCQgJCQgHCQcLBwcHAwMDBQcEBwcGBwcDBwcDAwYDCwcHBwcEBwMHBQkFBQUEAwQHBwcJCAkJCQcHBwcHBwYHBwcHAwMDAwcHBwcHBwcHBwcHBQcHBwQGCAkJDAQEBwwJCQcHBwcHBgkKBwMEBAkLBwcDBwcHBwcHBwwHBwkMCwcMBAQDAwcGBQcCBwQEBgYHAwMECwcIBwgIAwMDAwkJCQkJCQMEBAQEBAQEBAQEBwMIBwcFAwkHBwUIBwcHBAQECgoKBwkHAwgHCQYJBgcHBAcHBwcJBwkIBwgHBwMHBAcECQcJBwkHCQQJBAgHBwMHBQkHCQcHBQcFBwkJBwcFBwUIBwYEDQwGDAYMBgYMCQcHBwcHCQgJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJBwwMDAwMBwcHDA0LCQkGCAcGBgkJBQcCBAsEBwQEBwQHBwkGCQYIBwgHCAcJBwkHCQcJBwkHAwMDAwMDAwMGAwgGBwcDCQcJBwkHCQcJBAgHBwMJBwkHCQcJBwsJBwUDBwcMCwkHAwsJCwkLCQcFAwQHBwoKCgoEBAQEBwkKBAkJCQMHCAcIBwkDCAcJCQgJCQgHBwcHCQkDBwcFBwMHBwUFBwcDBwUHBQUHBwYHBgkJAwcHBwkICgcJCAMDBg0MCgcICQcICAcICAsHCQkHCAkJCQkICQcICQcJCAsLCgoICQwJBwcGBAcHCQYHBwYHCQcHBwcGBQUJBQcGCQkICQcGCQcHBwQGBwMDAwsKBwYFBwYFDA0IBAQEBAQEBAQEBAQEBAUEAwQEAwcHBQYHAwUHBwMGBgYHBwMEBwYHBwYGBwYICAYGBgMFCQMGBgYGBggICAgHBwcHBQYHAwUHAwYGBgcEBwcHBgcGCAgDBwYHBwAAAAAEBAQFAgIDAgIDAgMCBgYGBgYGBgYGBgYEBgkJAwkGBgYJCQkJCQMJCQkJCQkJCQgJCQkJCQMDCQkJCQcGBgYGBgoLBQYKCwUGCAcJCQkJCQkJCQkJCQkJCQkJAwMDAwMJCQAAAAAAAAAAAAAAAAAAAAAHDAkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkEBAkHBQIDAgMFBQIDCAcDAwIDCQkDAwMFCQkDAwkJAwMHBgYGBwYGBgcGBgYEBAQEBgYGBgoKBgYKCgYGDQ0KCg0NCgoHBwcHBwcHBwcFBgUHBQYFCQkDAwcHAwMHBwUFBgYCAgQEBQUGBgMDAwUFBQUFCAcIBwMDBwcHBwcHBwcJCQICCQkJAgMJCQMDCQkJAwMDAwMDCQICCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJBAQECQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJAgwYCggKCAAAAAAAAAAAAAAAAAAAAAAGCgoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwgHCAcIBwgHCAcIBwgHCAcDAwMDCQcJBwkHCQcJBwkHCQcKCAoICggKCAoICQcJBwoICggKCAoICggHBQcFBwUHBwMDCQcJBwkHCQcJBwkHAAAAAAcECwgHBQcFCQcHBgcGCAYIBggHCQcJBwkDAwMHAwMDAwMDAwICBAQCAgIAAgMCAwIDAgMFBQUFCAcJCQMDCQkDAwkJAwMJCQMDCQkDAwkJAwMJCQMDBwYGBgcGBgYHBgYGBwYGBgcGBgYHBgYGBAQEBAQEBAQEBAQEBAQEBAQEBgYGBgYGBgYGBgYGBgYGBgoKBgYKCgYGCgoGBg0NCgoNDQoKBwcHBQYFCQkJAwMJCQMDCQkDAwkJAwMJCQMDBwcHBwoLBQYKCwUGBwcFBQcHBQUHBwUFCgsFBgoLBQYKCwUGCgsFBgoLBQYGBgICBgYCAgYGAgIGBgICBgYDAwYGBgYGBgMDBgYHBgYGAwUFBQUFBQUFBQUFBQUFBQUFBQUFCAcIBwMDBQUIBwMDCAcKCgoKAgAAAAAAAAANDQAAAAAAAAIEAAAHAAAACgoGBg0NCgoHBQYFBQQDAwQDAwMDAwoLAwAEBgcHBwcHBwcHBwcHBwcHBgYHBw0aCgAEBAMFBwcMCQIEBAUIBAQEBAcHBwcHBwcHBwcEBAgICAcNCQkJCQkICgkDBgkHCwkKCQoJCQcJCQ0HCQcEBAQFBwQHBwcHBwMHBwMDBwMLBwcHBwQHBAcFCQcHBwQDBAgJCQkJCQoJBwcHBwcHBwcHBwcDAwMDBwcHBwcHBwcHBwcFBwcHBQcJCgoNBAQHDQoJBwcHBwcGCQsHAwQFCgwHCAMICAcHCAcHDQkJCg0MBw0EBAMDBwYHCQIHBAQHBwcEAwQOCQkJCQkDAwMDCgoKCQkJAwQEBAQEBAQEBAQHAwkHBwcDCQcJBwkHCAgEBAQLCwsHCgcDCQcJBwkHBwcECQcJBwkICQkHCQcHAwcEBwQJBwkHCgcJBAkECQcHAwcFCQcJBwcHBwcHCgkIBwYIBQgHBwUPDQcNBw0HBw0JCAgICAgJCAkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkIDQ0NDQ0ICAgNDgwKCgcJCAcHCgoGCAIFDAUIBQUIBQkHCQcJBwkHCQcJBwoHCgcKBwkHCQcDAwMDAwMDAwYDCQcHBwMJBwkHCgcKBwkECQcIBAkHCQcJBwkHDQkJBwMJBw0MCgcDDQkNCQ0JCQcDBAcICwsLCwQEBAQJCgsFCgsKAwkJCQkHCQMJCQsJCAoJCQgHCQcJCgMJCAYHAwcHBwYHBwMHBwcFBgcHBgcHCQkDBwcHCQkLBwkJAwMGDg0LCAgJCQkJBwkJCwgJCQgJCwkKCQkJBwgLBwoJCwsKCwgJDQkHBwcFCAcJBgcHBgcJBwcHBwcFBwkHBwcLDAgJBwcKBwcHBQcHAwMDDAsHBgcHBgUNDgkEBAQEBAQEBAQEBAQEBQQDBAQEBwcFBwgDBQgIAwcGBggIAwUHBwcHBgYHBwkIBgYGAwUJAwcHBgYHCQkJCQcHBwcFBwgEBQgEBwYGCAUHBwcGBwcJCAMHBgcHAAAAAAQEBQUDAwMDAwMDAwIHBwcHBwcHBwcHBwQHCgoECgcHBwoKCgoKAwoKCgoKCgoKCAoKCgkJAwMKCgoKBwcHBwYGCwwFBwsMBQcICAoKCgoKCgoKCgoKCgoKCgoDAwMDAwoKAAAAAAAAAAAAAAAAAAAAAAcNCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgQECggFAwMDAwYGAwMICAMDAwMJCQMDBAUJCQMDCQkDAwcHBwcHBwcHBwcHBwQEBAQGBgYGCwsHBwsLBwcODgsLDg4LCwgICAgICAgIBwYHBQcGBwUKCgMDCAgDAwgIBQUHBwMDBAQFBQcHAwMEBQYFBgYICAgIAwMHCAcIBwgHCAoKAwMKCgoCAwoKAwMKCgoDAwMDAwMKAwMKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoEBAQKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoCDRoLCQsJAAAAAAAAAAAAAAAAAAAAAAcLCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADCQcJBwkHCQcJBwkHCQcJBwkHCQcJBwkHCQcJBwkHCQcJBwkHCQcJBwMDAwMKBwoHCgcKBwoHCgcKBwsJCwkLCQsJCwkJBwkHCwkLCQsJCwkLCQkHCQcJBwkHAwMKBwkHCQcJBwkHCQcAAAAABwUMCQgGCAYJBwcHBwcJBwkHCQcKBwoHCQMDAwgDAwMDAwMEAwMEBAMDAwADAwMDAwMDAwYGBgYICAkJAwMJCQMDCQkDAwkJAwMJCQMDCQkDAwkJAwMHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcEBAQEBAQEBAQEBAQEBAQEBAQGBgYGBgYGBgYGBgYGBgYGCwsHBwsLBwcLCwcHDg4LCw4OCwsICAcGBwUKCgoDAwoKAwMKCgMDCgoDAwoKAwMICAgICwwFBwsMBQcICAUFCAgFBQgIBQULDAUHCwwFBwsMBQcLDAUHCwwFBwcHAwMHBwMDBwcDAwcHAwMHBwMDBwcHBwcHAwMHBwcHBwcEBQUFBQYGBgYGBgYGBgYGBgYGBgYICAgIAwMGBggIAwMICAsLCwsDAAAAAAAAAA8OAAAAAAAAAwUAAAgAAAALCwcHDg4LCwcGBwUFBAQDBAMDAwMDCwwDAAQGBwgHCAcIBwgHCAcIBwgHBwcIDx4LAAQEBQUICA0KAwUFBgkEBQQECAgICAgICAgICAQECQkJCA8JCgsLCgkLCgMHCggLCgwKDAsKCQoJDwkJCAQEBAUIBQgICAgIBAgIAwMHAw0ICAgIBQgECAcLBwcIBQMFCQkJCwoKDAoICAgICAgICAgICAMDAwMICAgICAgICAgICAYICAgFCAkLCw8FBQgPDAsICAgICAcLDAgEBQUMDQgJBQkJCAgJCAgPCQkMDw4IDwUFAwMIBwcJAwgFBQgICAQDBQ4JCgkKCgMDAwMMDAwKCgoDBQQFBQUFBQUFBQgDCggICAMLCAkHCggJCQUFBQ0NDQgLCAMKCAsICwgICAUJCAkICwkLCggKCAgDCAQIBQoICggMCAsFCwUKCAkECQYKCAoICAgICAgMCwkIBwkFCggIBREPCA8IDwgIDwsJCQkJCQsJCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwkPDw8PDwkJCQ8QDgsLCAoJCAgLCwcJAwUNBQkFBQkFCQgLCAsICggKCAoICwgLCAsICggKCAMDAwMDAwMDBwMKBwgIAwoICwgMCAwICwUKCAkECggKCAoICwgPCwkHAwkIDw0MCAMPCw8LDwsJBwMFCAkNDQ0NBQUFBQkMDQYMDAsDCQoKCggKAwoLCwoKDAoKCQkJCQsLAwkJBwgDCAkHBwgIAwgHCAcHCAgHCAgLDAMICAgMCg0ICwoDAwcQDw0JCgsJCgoICgoOCQsLCQoLCgwKCgsJCgsJCwkODwwNCgsPCwgJCAUJCAkHCAgHCAoICAgICAcHCwcJCAsLCQsICAsICAgFCAgDAwMODAgHBwgHBg8QCgUFBQUFBQUFBQUFBQUGBQMFBQQICAYICQMGCQkDCAcHCQkDBQkICQgHBwgICgoGBgYEBgwDCAgHBwgKCgoKCAgICAYICQQGCQQIBwcJBQkJCAcICAoKAwgHCAkAAAAABQUFBgMDBAMDAwMDAggICAgICAgICAgIBQgLCwQLCAgICwsLCwsDCwsLCwsLCwsKCwsLCwsEBAsLCwsICAgIBwcMDgYIDA4GCAoJCwsLCwsLCwsLCwsLCwsLCwMDAwMDCwsAAAAAAAAAAAAAAAAAAAAACA8LCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLBQULCQYDAwMDBgYDAwoJBAQDAwsLBAQEBgsLBAQLCwQECAgICAgICAgICAgIBQUFBQcHBwcMDAgIDAwICBAQDQ0QEA0NCQkJCQkJCQkIBwgGCAcIBgwMBAQJCQQECQkGBggIAwMFBQYGCAgEBAQGBwYGBgoJCgkEBAgJCAkICQgJCwsDAwsLCwIDCwsDBAsLCwMDAwMDAwsDAwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwUFBQsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwIPHg0KDQoAAAAAAAAAAAAAAAAAAAAACA0NAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMJCAkICQgJCAkICQgJCAkICQgJCAkICQgKCAoICggKCAoICggKCAoIAwMDAwwIDAgMCAwIDAgMCAwIDQoNCg0KDQoNCgoICggNCg0KDQoNCg0KCQcJBwkHCQgDAwwICggKCAoICggKCAAAAAAIBQ4KCQcJBwsICAgICAoICggKCAsIDAgLBAQECQQEBAQEBAQDAwUFAwMDAAMDAwMDAwMDBgYGBgoJCwsEBAsLBAQLCwQECwsEBAsLBAQLCwQECwsEBAgICAgICAgICAgICAgICAgICAgICAgICAUFBQUFBQUFBQUFBQUFBQUFBQcHBwcHBwcHBwcHBwcHBwcMDAgIDAwICAwMCAgQEA0NEBANDQkJCAcIBgwMDAQEDAwEBAwMBAQMDAQEDAwEBAkJCQkMDgYIDA4GCAkJBgYJCQYGCQkGBgwOBggMDgYIDA4GCAwOBggMDgYICAgDAwgIAwMICAMDCAgDAwgIBAQICAgICAgEBAgICAgICAQGBgYGBgYGBgYGBgYGBgYGBgYGBgoJCgkEBAYGCgkEBAoJDAwMDAMAAAAAAAAAERAAAAAAAAADBgAACQAAAAwMCAgQEA0NCAcIBgYFBAQFBAQEBAQMDgMABQYICQgJCAkICQgJCAkICQgICAkQIAwABAQFBgkJDgsDBQUGCQQFBAQJCQkJCQkJCQkJBAQJCQkJEAsLDAwLCgwLAwgLCQ0LDAsMCwsJCwsPCwkJBAQEBwkFCQkICQkECQgEAwgDDQgJCQkFCAQIBwsHBwcFAwUJCwsMCwsMCwkJCQkJCQgJCQkJAwMDAwgJCQkJCQgICAgJBgkJCQYJCQwMEAUFCRAMCwkJCQkJCAsNCQQFBQwOCQoFCQkJCQkJCRALCwwRDwkQBQUEBAkIBwkDCQUFCAgJBAQFEQsLCwsLAwMDAwwMDAsLCwMFBAUFBQUFBQUFCQMLCAkHAwwJCQcLCQkJBQUFDQ0NCQwJAwsIDAgMCAkJBQsJCwkMCgwLCQsJCQMJBAkFCwgLCAwJCwULBQsICQQJBgsICwgJBwkHCQwLCQkHCgUKCQgGEhAIEAgQCAgQDAkKCQoKCwoLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsMChAQEBAQCgoKEBEPDAwJCwoICAwMBwoDBg4FCgYGCgYLCQwIDAgLCQsJCwkMCQwJDAkLCAsIAwMDAwMDAwQIAwsICAkDCwgMCQwJDAkLBQsICgQLCAsICwgMCA8LCQcDCwkQDgwJAw8LDwsPCwkHBAUJCg0NDQ0FBQUFCw0NBgwMDAMLCwsLCQsDCwsNCwoMCwsKCQkLCwwDCQkHCAMICQgHCAkDCAgJBwcJCQgICAsNAwgJCA0LDgkMCwMDCBEQDQkKDAsLCwkLCw4KDAwJCw0LDAsLDAkKCwsMCg0ODQ4LDBAMCQkJBgkJCgcICAcICwgJCAkIBwcNBwkICwsKDAkIDAkJCAYICAQDAw8NCAcHCAgHEBELBQUFBQUFBQUFBQUFBQYFAwUFBAkJBggKAwYKCQMIBwcKCgMGCQgJCQcICQgLCgYGBgQHDAMICAcHCQsLCwsJCQkJBggKBQcJBQgHBwoGCQkJCAkICwoDCQcJCQAAAAAFBQYHAwMEAwMDAwMDCAgICAgICAgICAgFCAwMBQwICAgMDAwMDAMMDAwMDAwMDAoMDAwLCwQEDAwMDAkICAgICA0PBggNDwYICgkMDAwMDAwMDAwMDAwMDAwMBAMDAwMMDAAAAAAAAAAAAAAAAAAAAAAJEAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwFBQwKBwMEAwQHBwMECgkEBAMECwsEBAUGCwsEBAsLBAQJCAgICQgICAkICAgFBQUFCAgICA0NCQkNDQkJEhIODhISDg4JCQkJCQkJCQkHCAYJBwgGDQ0EBAkJBAQKCgYGCAgDAwUFBgYICAQEBQYHBgcHCgkKCQQECQoJCgkKCQoMDAMDDAwMAwMMDAMEDAwMAwMDAwMEDAMDDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMBQUFDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAhAgDgsOCwAAAAAAAAAAAAAAAAAAAAAIDQ0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAsJCwkLCQsJCwkLCQsJCwkLCQsJCwkLCQsJCwkLCQsJCwkLCQsJCwkDBAMEDAkMCQwJDAkMCQwJDAkOCw4LDgsOCw4LCwgLCA4LDgsOCw4LDgsJBwkHCQcLCQMEDAkLCAsICwgLCAsIAAAAAAkGDwsJBwkHDAkJCAkICwgLCAsIDAkMCQsEBAQJBAQEBAQEBAMDBQUDAwMAAwQDBAMEAwQHBwcHCgkLCwQECwsEBAsLBAQLCwQECwsEBAsLBAQLCwQECQgICAkICAgJCAgICQgICAkICAgJCAgIBQUFBQUFBQUFBQUFBQUFBQUFCAgICAgICAgICAgICAgICA0NCQkNDQkJDQ0JCRISDg4SEg4OCQkJBwgGDQ0NBAQNDQQEDQ0EBA0NBAQNDQQECQkJCQ0PBggNDwYICgoGBgoKBgYKCgYGDQ8GCA0PBggNDwYIDQ8GCA0PBggICAMDCAgDAwgIAwMICAMDCAgEBAgICAgICAQECAgJCAgIBQYGBgYHBwcHBwcHBwcHBwcHBwcHCgkKCQQEBwcKCQQECgkNDQ0NAwAAAAAAAAASEQAAAAAAAAMGAAAKAAAADQ0JCRISDg4JBwgGBwUFBAUEBAQEBA0PAwAFBgkKCQoJCgkKCQoJCgkKCAgJChEiDQAFBQUGCQkPCwMGBgcKBQYFBQkJCQkJCQkJCQkFBQoKCgkRCwsMDAsKDAsFCQsJDQsMCwwLCwkLCxELCwkFBQUHCQYJCQkJCQUJCQQDCAMNCQkJCQYIBAkHCwcJCAYFBgoLCwwLCwwLCQkJCQkJCQkJCQkFBQUFCQkJCQkJCQkJCQkHCQkJBgkKDQ0RBgYJEQ0MCQkJCQkIDA4JBAUFDQ8JCgUKCgkJCwkJEQsLDBEQCREGBgQECQgJCwMJBgYJCQkFBAYRCwsLCwsFBQUFDAwMCwsLBQYEBgYGBgYGBgYJAwsICQgFDAkLCQsJCgoGBgYODg4JDAkFCwgMCQwJCgkGCwkLCQwKDAsJCwkJAwkECQYLCQsJDAkLBgsGCwgJBAkGCwkLCQkICQgJDA0KCQgLBgsJCQYTEQkRCREJCREMCgoKCgoMCwwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwKEREREREKCgoREhANDQkLCgkJDQ0ICgMGDwYKBgYKBgsJDAkMCQsJCwkLCQwJDAkMCQsJCwkFBQUFBQUFBAkDCwgICQMLCQwJDAkMCQsGCwgKBAsJCwkLCQwJEQsLCQQLCREPDQkEEQsRCxELCwkEBgkKDg4ODgYGBgYLDQ0GDQ4NAwsLCwsJCwULCw0LCwwLCwsJCwsNDQULCggJAwkKCQgJCQMICQkHCAkJCAkJCw0DCQkJDQsPCQwLBQUJEhEPCgsLCwsLCQwLDwoMDAoKDQsMCwsMCQsNCw0KDw8NDgoMEAwJCQkGCgkLCAkJBwoLCQkJCQkICQ0HCgkODgsMCQkNCQkJBgkIBAUDDw4JBwkJCAcREgwGBgYGBgYGBgYGBgYGBwYDBgYFCgkHCQoDBwoKAwkICAoKAwYKCQoJCAgJCQwLBwcHBAcMAwkJCAgJDAwMDAoKCgkHCQoFBwoFCQgICgYKCgkICQkMCwMJCAkKAAAAAAUFBgcEAwQDAwQDBAMJCQkJCQkJCQkJCQUJDQ0FDQkJCQ0NDQ0NBA0NDQ0NDQ0NCw0NDQwMBAQNDQ0NCgkJCQgIDhAHCQ4QBwkLCg0NDQ0NDQ0NDQ0NDQ0NDQ0EBAQEBA0NAAAAAAAAAAAAAAAAAAAAAAkRDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQUFDQoHBAQEBAcHBAQLCgQEBAQMDAQEBQYMDAQEDAwEBAoJCQkKCQkJCgkJCQYGBgYICAgIDg4JCQ4OCQkTEw4OExMODgoKCgoKCgoKCQgJBwkICQcNDQUECgoFBAoKBwcJCQQEBgYHBwkJBAQFBggHBwcLCgsKBAQJCgkKCQoJCg0NAwMNDQ0DBA0NBAQNDQ0EBAQEBAQNAwMNDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0FBQUNDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0CESIPCw8LAAAAAAAAAAAAAAAAAAAAAAkODgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAECwkLCQsJCwkLCQsJCwkLCQsJCwkLCQsJCwkLCQsJCwkLCQsJCwkLCQUEBQQMCQwJDAkMCQwJDAkMCQ8LDwsPCw8LDwsLCQsJDwsPCw8LDwsPCwsJCwkLCQsJBQQMCQsJCwkLCQsJCwkAAAAACQYQCwoHCgcMCQkJCQkLCQsJCwkNCQ0JDAQFBAoEBAQEBAQFBAQGBgQEBAAEBAQEBAQEBAcHBwcLCgwMBAQMDAQEDAwEBAwMBAQMDAQEDAwEBAwMBAQKCQkJCgkJCQoJCQkKCQkJCgkJCQoJCQkGBgYGBgYGBgYGBgYGBgYGBgYICAgICAgICAgICAgICAgIDg4JCQ4OCQkODgkJExMODhMTDg4KCgkICQcNDQ0FBA0NBQQNDQUEDQ0FBA0NBQQKCgoKDhAHCQ4QBwkKCgcHCgoHBwoKBwcOEAcJDhAHCQ4QBwkOEAcJDhAHCQkJBAQJCQQECQkEBAkJBAQJCQQECQkJCQkJBAQJCQoJCQkFBgcHBwcHBwcHBwcHBwcHBwcHBwcLCgsKBAQHBwsKBAQLCg4ODg4EAAAAAAAAABMSAAAAAAAAAwYAAAoAAAAODgkJExMODgkICQcHBgUEBQQEBAQEDhADAAYHCQoJCgkKCQoJCgkKCQoJCQkKEyYOAAUFBgcLCxENBAYGBwsFBgUFCwsLCwsLCwsLCwUFCwsLCxMNDQ4ODQwPDQYKDQsPDQ8NDw4NDA0NEw0MDAUFBQcLBgoLCgsLBgsKBAQJBBAKCwsLBgoFCgkNCQkJBgYGCw0NDg0NDw0KCgoKCgoKCwsLCwYGBgYKCwsLCwsKCgoKCwgLCwsHCgwODhMGBgoTDw4KCgoLCwkOEAoEBwcPEQsMBgsLCwoMCwsTDQ0PExILEwcHBAQKCQkMAwsGBgoKCwUEBxENDQ0NDQYGBgYPDw8NDQ0GBgUGBgYGBgYGBgsEDQoMCQYOCwwJDQsLCwYGBhAQEAsPCwYNCg4KDgoLCwYNCg0KDgwODQsNCwsECwYLBg0KDQoPCw4GDgYNCgwGDAcNCg0KDAkMCQoPDgsLCAwIDAsKBxUTChMKEwoKEw4LCwsLCw0MDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDgsTExMTEwsLCxMUEQ4OCgwLCgoODggLBAcRBgsHBwsHDQoOCg4KDQsNCw0LDwsPCw8LDQoNCgYGBgYGBgYECgQNCQoLBA0KDgsPCw8LDgYNCgwFDQoNCg0KDQoTDQwJBA0KExEPCwYTDRMNEw0MCQQGCwsQEBAQBgYGBg0PDwcPEA8EDQ0NDQwNBg0NDw0MDw0NDAwMDQ4OBgwLCAoECgsKCAoLBAoJCwkJCwsJCgoOEAQKCwoQDRAKDg0GBgoUEw8LDA4NDA0KDQ0SCw4OCwwPDQ8NDQ4MDA4NDg0REQ8RDQ4TDgoLCgcLCw4JCgoICg0KCwkLCggJEAkLCg4ODA4LCg4KCwoHCgoEBgQRDwoICQoJCBMUDQYGBgYGBgYGBgYGBgYHBgQGBgULCggKCwQHCwsECgkJCwsEBwsKCwoJCQoKDQwJCQkECBAECgoJCQoNDQ0NCwsLCggKCwUICwUKCQkLBwsLCgkKCg0MBAoJCgsAAAAABgYHCAQEBQQEBAQEAwoKCgoKCgoKCgoKBgoODgUOCgoKDg4ODg4EDg4ODg4ODg4MDg4ODg4FBQ4ODg4LCgoKCQkPEgcKDxIHCgwLDg4ODg4ODg4ODg4ODg4ODgQEBAQEDg4AAAAAAAAAAAAAAAAAAAAACxMODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OBgYODAgEBAQECAgEBAwLBQUEBA4OBQUFBw4OBQUODgUFCwoKCgsKCgoLCgoKBgYGBgkJCQkQEAoKEBAKChUVEBAVFRAQCwsLCwsLCwsKCQoHCgkKBw8PBQULCwUFCwsHBwoKBAQGBgcHCgoFBQUHCQcICAwLDAsFBQoLCgsKCwoLDg4EBA4ODgMEDg4EBQ4ODgQEBAQEBA4EBA4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODgYGBg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODgITJhAMEA0AAAAAAAAAAAAAAAAAAAAAChAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQNCg0KDQoNCg0KDQoNCg0KDQoNCg0KDQoNCw0LDQsNCw0LDQsNCw0LBgQGBA8LDwsPCw8LDwsPCw8LEAwQDBAMEAwQDA0KDQoQDRANEA0QDRANDAkMCQwJDQoGBA8LDQoNCg0KDQoNCgAAAAAKBxINCwgLCA4LCwoLCg0KDQoNCg4LDwsOBQUFCwUFBQUFBQUEBAYGBAQEAAQEBAQEBAQECAgICAwLDg4FBQ4OBQUODgUFDg4FBQ4OBQUODgUFDg4FBQsKCgoLCgoKCwoKCgsKCgoLCgoKCwoKCgYGBgYGBgYGBgYGBgYGBgYGBgkJCQkJCQkJCQkJCQkJCQkQEAoKEBAKChAQCgoVFRAQFRUQEAsLCgkKBw8PDwUFDw8FBQ8PBQUPDwUFDw8FBQsLCwsPEgcKDxIHCgsLBwcLCwcHCwsHBw8SBwoPEgcKDxIHCg8SBwoPEgcKCgoEBAoKBAQKCgQECgoEBAoKBQUKCgoKCgoFBQoKCwoKCgUHBwcHCAgICAgICAgICAgICAgICAwLDAsFBQgIDAsFBQwLDw8PDwQAAAAAAAAAFRUAAAAAAAAEBwAACwAAABAQCgoVFRAQCgkKBwgGBQUGBQUFBQUPEgQABwkKCwoLCgsKCwoLCgsKCwoKCgsVKhAABgYGBwwMEw4EBwcIDAYHBgYMDAwMDAwMDAwMBgYMDAwMFQ0ODw8ODRAOBgsODBEOEA4QDw4MDg0VDg4NBgYGCAwHDAsLCwwGCwsFBAoEEAsMCwsHCwYLCw8KCwkHBgcMDQ0PDg4QDgwMDAwMDAsMDAwMBgYGBgsMDAwMDAsLCwsMCAwMDAcLDQ8PFQcHDBUQDwwMDAwLCg8RDAYHCBATDA0GDAwMDA0MDBUNDRAVFAwVBwcFBQwKCw4EDAcHCwsMBgUHFQ0ODQ4OBgYGBhAQEA4ODgYHBwcHBwcHBwcHDAQOCw0JBg8MDgsODAwMBwcHEhISDBALBg4LDwsPCwwMBw0MDQwPDQ8ODA4MDAQMBgwHDgsOCxAMDwcPBw4LDAYMCA4LDgsNCQ0JDBAQDAwJDQgODAsIFxULFQsVCwsVDwwNDA0NDw0PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDRUVFRUVDQ0NFRYTEBALDgwLCxAPCQ0EBxMHDQcHDQcNDA8LDwsODA4MDgwQCxALEAwOCw4LBgYGBgYGBgULBA4KCgwEDgsPDBAMEAwPBw4LDQYOCw4LDgsOCxUPDgsFDQwVExAMBhUPFQ8VDw4LBQcMDRISEhIHBwcHDRARCBAREAQNDg4ODQ4GDg4RDg4QDg4NDA4OEhAGDgwJCwQKDAoJCwwECgsLCwkMDAoKCw4QBAoMChAOEgsPDgYGCxYVEgwNDw0ODgsODhMNDw8MDhEOEA4ODwwNEA4QDhIUERMODxUPDAwLCAwMDgoLCwkLDQsMCgsLCgsRCgwLEBANDwsLEAsMDAgLCwUGBBMRDAkLCwoJFRcOBwcHBwcHBwcHBwcHBwgHBgcHBgwLCAsNBggNDAYLCgoNDQYHDAsMCwoKDAsPDgsLCwUJEgYLCwoKCw8PDw8MDAwLCAsNBgkMBgsKCg0HDAwLCgwLDw4GCwoLDAAAAAAHBwcJBAQFBAQEBAQDCwsLCwsLCwsLCwsHCxAQBhALCwsQEBAQEAQQEBAQEBAQEA0QEBAPDwUFEBAQEAwLCwsKChEUCAsRFAgLDQwQEBAQEBAQEBAQEBAQEBAQBQQEBAQQEAAAAAAAAAAAAAAAAAAAAAAMFRAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAHBxANCQQFBAUJCQQFDQwFBQQFDw8FBQYIDw8FBQ8PBQUMCwsLDAsLCwwLCwsHBwcHCgoKChERCwsREQsLFxcSEhcXEhIMDAwMDAwMDAsJCwgLCQsIEREGBgwMBgYNDQgICwsEBAcHCAgLCwUFBggJCAkJDQwNDAUFCw0LDQsNCw0QEAQEEBAQAwQQEAQFEBAQBAQEBAQFEAQEEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBwcHEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAxUqEg4SDgAAAAAAAAAAAAAAAAAAAAALEhIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQ0MDQwNDA0MDQwNDA0MDQwNDA0MDQwNDA4MDgwODA4MDgwODA4MDgwGBQYFEAwQDBAMEAwQDBAMEAwSDhIOEg4SDhIODgsOCxIOEg4SDhIOEg4OCw4LDgsNDAYFEAwOCw4LDgsOCw4LAAAAAAsIEw4MCQwJDwwMCwwLDgsOCw4LEAwQDA8FBgYMBQUFBQUFBgQEBwcEBAQABAUEBQQFBAUJCQkJDQwPDwUFDw8FBQ8PBQUPDwUFDw8FBQ8PBQUPDwUFDAsLCwwLCwsMCwsLDAsLCwwLCwsMCwsLBwcHBwcHBwcHBwcHBwcHBwcHCgoKCgoKCgoKCgoKCgoKChERCwsREQsLERELCxcXEhIXFxISDAwLCQsIERERBgYREQYGEREGBhERBgYREQYGDAwMDBEUCAsRFAgLDQ0ICA0NCAgNDQgIERQICxEUCAsRFAgLERQICxEUCAsLCwQECwsEBAsLBAQLCwQECwsFBQsLCwsLCwUFCwsMCwsLBggICAgJCQkJCQkJCQkJCQkJCQkJDQwNDAUFCQkNDAUFDQwRERERBAAAAAAAAAAYFwAAAAAAAAQIAAANAAAAERELCxcXEhILCQsICQcGBQcFBQUFBREUBgAHCwsNCw0LDQsNCw0LDQsNCwsLDRgwEgAHBwgJDQ0VEAUICAkOBwgHBw0NDQ0NDQ0NDQ0HBw4ODg0YDxARERAPExEGDBANExETEBMREA4RDxcPEA8HBwcMDQgNDgwODQcODgUGDAYUDg0ODggMBw4LEQsMDAgGCA4PDxEQERMRDQ0NDQ0NDA0NDQ0GBgYGDg0NDQ0NDg4ODg0KDQ0NCA0PEhIYCAgNGBMRDQ0NDQ4MERQNBgkJEhUPDwgODQ0NDw0NGA8PExgXDRgICAUFDQwMEAQNCAgMDA0HBQgaDxAPEBAGBgYGExMTERERBggICAgICAgICAgNBhAMDwwGEQ0QDBANDg4ICAgUFBQNEw4GEAwRDBEMDQ0IDw0PDREPERANEA0NBg0HDQgRDhEOEw0RCBEIEAwOBw4JEQ4RDg8MDwwNExIODQsPCRANDAkaGAwYDBgMDBgRDg8ODw8RDxERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERIPGBgYGBgPDw8ZGRYSEg0QDgwMEhILDwUJFQgPCQkPCQ8NEQwRDBANEA0QDRMOEw4TDREOEQ4GBgYGBgYGBQwGEAwMDQYRDhENEw0TDREIEAwPBxEOEQ4RDhEOFxEQDAUPDRgVEw8GFxEXERcREAwFCA0OFBQUFAgICAgPExQJExQSBg8QEBAPEQYQEBMREBMREA8OEA8TEgYQDgsOBg4OCwsODQYMDA4LCw0ODA4NEhIGDg0OEhAVDREQBgYMGRgWDg8RDxAQDRAQFg8REQ4QExETERARDg8SDxIQFhcTFRARGBENDg0JDg0QCw0NCw4RDQ0NDgwLDBQLDg0TFA8RDQwSDQ0OCQwMBQYGFhQOCwwNDAoYGhEICAgICAgICAgICAgICQgGCAgHDg0KDA4GCQ4OBgwLCw4OBggODQ4NCwsNDBEPDAwMBgoVBgwMCwsNEREREQ4ODg0KDA4HCg4HDAsLDggODg0LDQwRDwYNCw0OAAAAAAgICQoFBQYFBQUFBQQNDQ0NDQ0NDQ0NDQgNEhIHEg0NDRISEhISBRISEhISEhISDxISEhERBgYSEhISDg0NDQwMExYJDBMWCQwPDhISEhISEhISEhISEhISEhIFBQUFBRISAAAAAAAAAAAAAAAAAAAAAA0YEhISEhISEhISEhISEhISEhISEhISEhISEhISEggIEg8KBQYFBgoKBQYPDgYGBQYREQYGBwkREQYGEREGBg4NDQ0ODQ0NDg0NDQgICAgMDAwMFBQNDRQUDQ0aGhQUGhoUFA4ODg4ODg4ODQsNCQ0LDQkTEwYGDg4GBg4OCQkMDAUFCAgJCQ0NBgYHCQsJCgoPDg8OBgYNDg0ODQ4NDhISBQUSEhIEBRISBQYSEhIFBQUFBQUSBQUSEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhIICAgSEhISEhISEhISEhISEhISEhISEhISEhIDGDAVEBUQAAAAAAAAAAAAAAAAAAAAAAwUFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFDw0PDQ8NDw0PDQ8NDw0PDQ8NDw0PDQ8NEA0QDRANEA0QDRANEA0QDQYFBgUTDRMNEw0TDRMNEw0TDRUQFRAVEBUQFRARDhEOFRAVEBUQFRAVEBAMEAwQDA8NBgUTDREOEQ4RDhEOEQ4AAAAADQkWEA4LDgsRDQ0MDQwQDBANEA4SDRMNEQYGBg4GBgYGBgYGBQUICAUFBQAFBgUGBQYFBgoKCgoPDhERBgYREQYGEREGBhERBgYREQYGEREGBhERBgYODQ0NDg0NDQ4NDQ0ODQ0NDg0NDQ4NDQ0ICAgICAgICAgICAgICAgICAgMDAwMDAwMDAwMDAwMDAwMFBQNDRQUDQ0UFA0NGhoUFBoaFBQODg0LDQkTExMGBhMTBgYTEwYGExMGBhMTBgYODg4OExYJDBMWCQwODgkJDg4JCQ4OCQkTFgkMExYJDBMWCQwTFgkMExYJDAwMBQUMDAUFDAwFBQwMBQUNDQYGDQ0NDQ0NBgYNDQ4NDQ0HCQkJCQoKCgoKCgoKCgoKCgoKCgoPDg8OBgYKCg8OBgYPDhMTExMFAAAAAAAAABsaAAAAAAAABQkAAA4AAAAUFA0NGhoUFA0LDQkKCAcGCAYGBgYGExYGAAgMDQ4NDg0ODQ4NDg0ODQ4NDQ0OGzYUAAgICAoPDxgSBQkJCxAICQgIDw8PDw8PDw8PDwgIEBAQDxsSEhQUEhEVEwgNEg8XExURFRQSEBMRHBESEQgICAwPCQ8PDg8PBw8PBgYOBhYPDw8PCQ4IDw0TDA4NCQYJEBISFBITFRMPDw8PDw8ODw8PDwYGBgYPDw8PDw8PDw8PDwsPDw8JDxEUFBsJCQ8bFRMPDw8PEA0TFg8HCgoVGBERCBAPDw8RDw8bEhIVGxkPGwkJBgYPDQ4SBQ8JCQ4ODwgGCR0SEhISEggICAgVFRUTExMGCQgJCQkJCQkJCQ8GEg4RDQYUDxIOEg8QEAkJCRcXFw8VDwgSDhQOFA4PDwkSDxIPFBEUEg8SDw8GDwgPCRMPEw8VDxQJFAkSDhAHEAoTDxMPEQ0RDQ8VFhAPDBELEg8OCh0bDhsOGw4OGhMQEBAQEBMRExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTFBAbGxsbGxAQEBwcGRQUDhIQDg4UFAwQBQoYCRAKChAKEg8UDhQOEg8SDxIPFQ8VDxUPEw8TDwgGCAYIBggGDQYSDg4PBhMPFA8VDxUPFAkSDhEIEw8TDxMPFA8cExIOBhIPGxgVEQYcExwTHBMSDgYJDxAXFxcXCQkJCRIVFwoVFhQGEhISEhETCBISFxMSFRMRERASERYUCBIQDA8GDxAODA8PBg4OEA0MDw8NDw4SFQYPDw8VEhcPExIICA0dGxcQERMSEhIPEhIZEBMTEBIXExUSERQQERQRFBEZGRUYEhMbFA8PDgoQDxIMDw8MEBMPDw8PDgwOFgwPDhYWERMODhQPDw8KDg4GBgYYFg8MDg8NCxsdEwkJCQkJCQkJCQkJCQkKCQYJCQgPDwsOEAYKEBAGDgwNEBAGChAODw8MDQ8OExEMDAwGCxUGDg4NDQ4TExMTDw8PDwsOEAgLEAgODA0QChAPDw0PDhMRBg8MDxAAAAAACQkKCwYFBgUFBgUGBA4ODg4ODg4ODg4OCQ4UFAgUDg4OFBQUFBQGFBQUFBQUFBQRFBQUExMHBxQUFBQPDg4ODQ0WGQsOFhkLDhEQFBQUFBQUFBQUFBQUFBQUFAYGBgYGFBQAAAAAAAAAAAAAAAAAAAAADxsUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUCQkUEQsGBgYGDAwGBhEQBwcGBhMTBwcIChMTBwcTEwcHDw4ODg8ODg4PDg4OCQkJCQ0NDQ0WFg4OFhYODh4eFxceHhcXEBAQEBAQEBAPDA4LDwwOCxUVBwcQEAcHEBALCw4OBgYJCQsLDg4HBwgKDAsMDBEQERAHBw8QDxAPEA8QFBQFBRQUFAQGFBQGBhQUFAYGBgYGBhQFBRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFAkJCRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFAMbNhcSFxIAAAAAAAAAAAAAAAAAAAAADhcXAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYSDxIPEg8SDxIPEg8SDxIPEg8SDxIPEg8SDxIPEg8SDxIPEg8SDxIPCAYIBhUPFQ8VDxUPFQ8VDxUPFxIXEhcSFxIXEhMPEw8XEhcSFxIXEhcSEg4SDhIOEg8IBhUPEw8TDxMPEw8TDwAAAAAPChkSEAwQDBQPDw4PDhIOEg4SDxQPFQ8TBwcHEAcHBwcHBwcGBgkJBgYGAAYGBgYGBgYGDAwMDBEQExMHBxMTBwcTEwcHExMHBxMTBwcTEwcHExMHBw8ODg4PDg4ODw4ODg8ODg4PDg4ODw4ODgkJCQkJCQkJCQkJCQkJCQkJCQ0NDQ0NDQ0NDQ0NDQ0NDQ0WFg4OFhYODhYWDg4eHhcXHh4XFxAQDwwOCxUVFQcHFRUHBxUVBwcVFQcHFRUHBxAQEBAWGQsOFhkLDhAQCwsQEAsLEBALCxYZCw4WGQsOFhkLDhYZCw4WGQsODg4GBg4OBgYODgYGDg4GBg4OBwcODg4ODg4HBw4ODw4ODggKCgoKDAwMDAwMDAwMDAwMDAwMDBEQERAHBwwMERAHBxEQFhYWFgYAAAAAAAAAHh0AAAAAAAAFCgAAEAAAABYWDg4eHhcXDwwOCwsJCAcJBwcHBwcWGQYACQwPEA8QDxAPEA8QDxAPEA4ODxAdOhYACAgJChAQGhMGCgoLEQgKCAgQEBAQEBAQEBAQCAgREREQHRMTFRUTEhcVBw8TEBcVFxMXFRMTFRMeExMSCAgIDhAKEBAPEBAIEBAHBw4HGRAQEBAKDwgQDRUNDQ4KCAoRExMVExUXFRAQEBAQEA8QEBAQCQkJCRAQEBAQEBAQEBAQDBAQEAoQEhUVHQoKEB0XFRAQEBARDhUYEAcLCxYaEhIJERAQEBIQEB0TExcdGxAdCgoGBhAODRMFEAoKDw8QCAYKHRMTExMTBwcHBxcXFxUVFQkKCQoKCgoKCgoKEAYTDxIOCBUQEw0TEBERCgoKGBgYEBcQBxMPFQ8VDxAQChMQExAVEhUTEBMQEAcQCRAKFRAVEBcQFQoVChMPEwgTCxUQFRASDhIOEBcWERANEgwSEA8LHx0PHQ8dDw8cFRESERISFRIVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVEh0dHR0dEhISHh8bFhYPExEPDxYVDRIFChoJEgoKEgoTEBUPFQ8TEBMQExAXEBcQFxAVEBUQBwkHCQcJBwcPBxMODxAHFRAVEBcQFxAVChMPEggVEBUQFRAVEB4VEw0HExAdGhcSCB4VHhUeFRMNBgoQERgYGBgKCgoKExcYCxYYFgcTExMTEhUHExMXFRMXFRMSExMTFxYHExENEAcQEQ4NEBAHDw8RDQ0QEQ4QDxUXBxAQEBcTGRAVEwcHDx8dGRESFRMTExAUExsSFRURExcVFxUTFRMSFhMVExsbFxoTFR0VEBEPCxEQFA0QEA0RFBAQEBAPDQ0YDREPFxgSFQ8PFhAQEAsPDwcJBxoYEA0NEA4MHR8UCgoKCgoKCgoKCgoKCgsKBwoKCBAQDA8RBwsREQcPDQ0REQcKEQ8QEA0OEA8UEw4ODgcMGQcPDw0NEBQUFBQQEBAQDA8RCAwRCA8NDREKERAQDhAPFBMHEA0QEQAAAAAJCQoMBgYHBgYGBgYFDw8PDw8PDw8PDw8JDxYWCBYPDw8WFhYWFgYWFhYWFhYWFhMWFhYVFQcHFhYWFhAPDw8ODhgbCw8YGwsPExEWFhYWFhYWFhYWFhYWFhYWBwYGBgYWFgAAAAAAAAAAAAAAAAAAAAAQHRYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYJCRYSDAYHBgcNDQYHExEHBwYHFRUHBwgLFRUHBxUVBwcQDw8PEA8PDxAPDw8KCgoKDg4ODhgYDw8YGA8PICAZGSAgGRkRERERERERERANDwsQDQ8LFxcICBERCAgREQsLDw8GBgoKCwsPDwcHCAsNCw0NExETEQcHEBEQERAREBEWFgYGFhYWBQYWFgYHFhYWBgYGBgYHFgYGFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWCQkJFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWBB06GRMZEwAAAAAAAAAAAAAAAAAAAAAPGBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABxMQExATEBMQExATEBMQExATEBMQExATEBMQExATEBMQExATEBMQExAHBwcHFxAXEBcQFxAXEBcQFxAZExkTGRMZExkTFRAVEBkTGRMZExkTGRMTDRMNEw0TEAcHFxAVEBUQFRAVEBUQAAAAABALGxMRDRENFRAQDxAPEw8TDxMQFhAXEBUHCAgRBwcHBwcHCAYGCgoGBgYABgcGBwYHBgcNDQ0NExEVFQcHFRUHBxUVBwcVFQcHFRUHBxUVBwcVFQcHEA8PDxAPDw8QDw8PEA8PDxAPDw8QDw8PCgoKCgoKCgoKCgoKCgoKCgoKDg4ODg4ODg4ODg4ODg4ODhgYDw8YGA8PGBgPDyAgGRkgIBkZEREQDQ8LFxcXCAgXFwgIFxcICBcXCAgXFwgIERERERgbCw8YGwsPERELCxERCwsREQsLGBsLDxgbCw8YGwsPGBsLDxgbCw8PDwYGDw8GBg8PBgYPDwYGDw8HBw8PDw8PDwcHDw8QDw8PCAsLCwsNDQ0NDQ0NDQ0NDQ0NDQ0NExETEQcHDQ0TEQcHExEYGBgYBgAAAAAAAAAhHwAAAAAAAAYLAAARAAAAGBgPDyAgGRkQDQ8LDAoIBwkHBwcHBxgbBwAKDhAREBEQERAREBEQERARDw8QESBAGAAJCQsLEhIcFQYLCwwTCQsJCRISEhISEhISEhIJCRMTExIgFRUXFxUUGRcJEBUSGxcZFRkXFRMXFSAVFRQJCQkOEgsRERAREQoREgcHEAcbEhEREQsQCRIPFw4PDwsICxMVFRcVFxkXEREREREREBEREREJCQkJEhEREREREhISEhINEhISCxEUGBggCwsSIBkXEhISEhIQFxoSBwwMGRwUFAsTERISFBISIBUVGSAeEiALCwcHEhAPFQUSCwsQEBIJBwsgFRUVFRUJCQkJGRkZFxcXCQsJCwsLCwsLCwsSBxUQFA8IFxIVDxUSExMLCwsbGxsSGREJFRAXEBcQEhILFREVERcUFxURFRESBxIJEgsXEhcSGREXCxcLFRATCRMMFxIXEhQPFA8SGRoTEg4UDRUSEAwjIBAgECAQEB8XExMTExMXFBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcTICAgICATExMhIh0YGBEVExAQGBgOEwYLHAoTCwsTCxURFxAXEBURFREVERkRGREZEhcSFxIJCQkJCQkJBxAHFRAQEgcXEhcSGREZERcLFRAUCRcSFxIXEhcSIBcVDwcVESAcGRQJIBcgFyAXFQ8HCxITGxsbGwsLCwsVGRsMGRoYBxUVFRUUFwkVFRsXFRkXFRQTFRUbGAkVEw4SBxISEA4SEQcQEBIPDhERDhIRFxgHEhESGBUcERcVCQkQIiAbExQXFRQVERYVHhMXFxMVGxcZFxUXExQYFRgVHR4ZHBUXIBcRERAMExEWDxISDhMWEhERERAPDxkOEhEaGhMXERAYERESDBAQBwkHHBkSDg8SEA0gIhYLCwsLCwsLCwsLCwsLDAsHCwsJEhENEBMHDBMTBxAPDxMTBwsSERIRDw8SEBYVDw8PCA0cBxAQDw8RFhYWFhISEhENEBMJDRMJEA8PEwsSEhEPEhAWFQcRDxESAAAAAAoKCw0HBggGBgcGBwUREREREREREREREQoRGBgJGBERERgYGBgYBxgYGBgYGBgYFBgYGBcXCAgYGBgYEhERERAQGh4NEBoeDRAUExgYGBgYGBgYGBgYGBgYGBgHBwcHBxgYAAAAAAAAAAAAAAAAAAAAABIgGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAoKGBQNBwcHBw4OBwcUEwgIBwcXFwgICQwXFwgIFxcICBIRERESEREREhEREQsLCwsQEBAQGhoRERoaEREjIxsbIyMbGxMTExMTExMTEQ4RDREOEQ0ZGQkIExMJCBMTDQ0QEAcHCwsNDRERCAgJDA4NDg4UExQTCAgRExETERMRExgYBgYYGBgFBxgYBwgYGBgHBwcHBwcYBgYYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgKCgoYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgEIEAbFRsVAAAAAAAAAAAAAAAAAAAAABAbGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFREVERURFREVERURFREVERURFREVERURFREVERURFREVERURFREVEQkHCQcZERkRGREZERkRGREZERsVGxUbFRsVGxUXEhcSGxUbFRsVGxUbFRUPFQ8VDxURCQcZERcSFxIXEhcSFxIAAAAAEQweFRMOEw4XEhIQEhAVEBURFRIYEhkSFwgJCBMICAgICAgJBwcLCwcHBwAHBwcHBwcHBw4ODg4UExcXCAgXFwgIFxcICBcXCAgXFwgIFxcICBcXCAgSEREREhERERIRERESEREREhERERIRERELCwsLCwsLCwsLCwsLCwsLCwsQEBAQEBAQEBAQEBAQEBAQGhoRERoaEREaGhERIyMbGyMjGxsTExEOEQ0ZGRkJCBkZCQgZGQkIGRkJCBkZCQgTExMTGh4NEBoeDRATEw0NExMNDRMTDQ0aHg0QGh4NEBoeDRAaHg0QGh4NEBAQBwcQEAcHEBAHBxAQBwcREQgIERERERERCAgRERIREREJDAwMDA4ODg4ODg4ODg4ODg4ODg4UExQTCAgODhQTCAgUExoaGhoHAAAAAAAAACQjAAAAAAAABgwAABMAAAAaGhERIyMbGxEOEQ0NCwkICggICAgIGh4HAAsPERMRExETERMRExETERMRERETIUIZAAkJCwwSEh0WBgsLDRMJCwkJEhISEhISEhISEgkJExMTEiIWFhgYFhQaGAkRFhIbGBoWGhgWFRgWIhUVFAkJCQ4SCxESERIRChISBwcQBxsSERISCxEJEg8XDw8QCwgLExYWGBYYGhgREREREREREREREQkJCQkSERERERESEhISEg0SEhIMEhQYGCELCxIhGhgSEhISExAYGxIHDAwZHRQUCxMTEhIUEhIhFhYaIR8SIQsLBwcSEA8VBhILCxEREgkHCyAWFhYWFgkJCQkaGhoYGBgJCwkLCwsLCwsLCxIHFhEUEAgYEhUPFhITEwsLCxwcHBIaEgkWERgRGBESEgsWERYRGBQYFhEWERIHEgoSCxgSGBIaERgLGAsWERUJFQwYEhgSFBAUEBIaGhMSDhQNFRIRDCQhESERIRERIBgTFBMUFBcVFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXGBQhISEhIRQUFCIjHhkZEhYUEREZGA8UBgwdCxQMDBQMFhEYERgRFhEWERYRGhIaEhoSGBIYEgkJCQkJCQkHEQcWEBESBxgSGBIaERoRGAsWERQJGBIYEhgSGBIiFxUPBxYRIR0aFAkiFyIXIhcVDwcLEhQcHBwcCwsLCxYaHA0aGxkHFhYWFhQYCRYWGxgVGhgWFBUVFRsZCRUTDhIHEhMRDxIRBxEREw8PERIPEhEXGQcSERIZFh0SGBYJCREjIRwTFRgWFRYSFhYeFBgYExYbGBoYFhgVFRkVGBYeHxodFhghGBESEQwTERUPEhIOExcSERISEQ8PGg8TERobFBgSERkSERIMEREHCQcdGhIODxIQDiEjFwsLCwsLCwsLCwsLCwsNCwcLCwkTEg0RFAcNFBMHEQ8PFBQHDBMRExIPEBIRFxUPDw8IDhwHEREPDxIXFxcXExMTEg0RFAkOEwkRDw8UDBMTEhASERcVBxIPEhMAAAAACwsMDgcHCAcHBwcHBRERERERERERERERCxEZGQkZERERGRkZGRkHGRkZGRkZGRkVGRkZGBgICBkZGRkTEREREBAbHw0RGx8NERUTGRkZGRkZGRkZGRkZGRkZGQcHBwcHGRkAAAAAAAAAAAAAAAAAAAAAEiEZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZCwsZFA4HCAcIDg4HCBUTCAgHCBgYCAgJDBgYCAgYGAgIExERERMRERETERERCwsLCxAQEBAbGxISGxsSEiQkHBwkJBwcExMTExMTExMSDxENEg8RDRoaCQkTEwkJFBQNDRERBwcLCw0NEREICAkMDw0ODhUTFRMICBIUEhQSFBIUGRkHBxkZGQUHGRkHCBkZGQcHBwcHBxkHBxkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGQsLCxkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGQQhQhwWHBYAAAAAAAAAAAAAAAAAAAAAERwcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcWERYRFhEWERYRFhEWERYRFhEWERYRFhEWERYRFhEWERYRFhEWERYRCQcJBxoRGhEaERoRGhEaERoRHBYcFhwWHBYcFhgSGBIcFhwWHBYcFhwWFQ8VDxUPFhEJBxoRGBIYEhgSGBIYEgAAAAASDB4WEw4TDhgSEhESERYRFhEWEhkSGhIYCAkJEwgICAgICAkHBwsLBwcHAAcIBwgHCAcIDg4ODhUTGBgICBgYCAgYGAgIGBgICBgYCAgYGAgIGBgICBMRERETERERExERERMRERETERERExEREQsLCwsLCwsLCwsLCwsLCwsLCxAQEBAQEBAQEBAQEBAQEBAbGxISGxsSEhsbEhIkJBwcJCQcHBMTEg8RDRoaGgkJGhoJCRoaCQkaGgkJGhoJCRMTExMbHw0RGx8NERQUDQ0UFA0NFBQNDRsfDREbHw0RGx8NERsfDREbHw0REREHBxERBwcREQcHEREHBxERCAgREREREREICBERExEREQkMDQ0NDg4ODg4ODg4ODg4ODg4ODhUTFRMICA4OFRMICBUTGxsbGwcAAAAAAAAAJSQAAAAAAAAGDAAAFAAAABsbEhIkJBwcEg8RDQ4LCQgLCAgICAgbHwcACw8SFBIUEhQSFBIUEhQSFBEREhQlShwACgoLDRUVIRkHDAwOFgoMCgoVFRUVFRUVFRUVCgoWFhYVJhkZGxsZFx0bCRMZFR8bHRkdGxkXGxkmGRcXCgoKERUMFBUTFRQKFRUHCRMHHxUVFRUMEgoVERsRERIMCQwWGRkbGRsdGxQUFBQUFBMUFBQUCQkJCRUVFRUVFRUVFRUVDxUVFQ0UFxsbJQwMFCUdGhQUFBUVEhoeFAkODhwhFxcLFhUVFBcVFSUZGR0lIxUlDAwICBQSERcGFQwMExMVCggMJRkZGRkZCQkJCR0dHRsbGwkMCwwMDAwMDAwMFQgZEhcSCRsVFxEZFRYWDAwMHx8fFR0VCRkSGxMbExUUDBkUGRQbFxsZFBkUFQcVCxUMGxUbFR0VGwwbDBkSFwoXDhsVGxUXEhcSFB0eFRURFw8YFBMOKCUTJRMlExMkGxYWFhYWGhcaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhobFiUlJSUlFhYWJiciHBwUGBYTExwbEBYHDSEMFg0NFg0ZFBsTGxMZFBkUGRQdFR0VHRUbFRsVCQkJCQkJCQcTCRkTExUHGxUbFR0VHRUbDBkSFwobFRsVGxUbFSYbFxEHGRQlIR0XCSYbJhsmGxcRCAwVFh8fHx8MDAwMGR0fDh0eHAgZGRkZFxsJGRkfGxgdGxkXFxcZHhwJFxURFQgUFRMQFRUIExMVEREVFRIUExodCBQVFB0ZIBQbGQkJEyclIBYYGxkYGRQZGSIWGxsWGB8bHRsZGxcYHBkbGSIjHSEYGyUbFBUUDhYUGREVFRAWGRQVFBUTEREeERUTHh4XGxQTHBQUFQ4TEgcJCSIeFRARFBIPJSgaDAwMDAwMDAwMDAwMDA4MCQwMChUUDxMWCQ4WFgkTEREWFgkNFRQVFBESFBMaGBISEgkPHgkTExERFBoaGhoVFRUUDxMWCw8WCxMRERYNFRUUEhQTGhgJFBEUFQAAAAAMDA0PCAcJBwcIBwgGExMTExMTExMTExMMExwcChwTExMcHBwcHAgcHBwcHBwcHBgcHBwaGgkJHBwcHBUTFBQSEh4jDxMeIw8TGBYcHBwcHBwcHBwcHBwcHBwcCAgICAgcHAAAAAAAAAAAAAAAAAAAAAAVJRwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwMDBwXDwgICAgQEAgIGBYJCQgIGhoJCQoOGhoJCRoaCQkVExQUFRMUFBUTFBQMDAwMEhISEh4eFBQeHhQUKSkfHykpHx8WFhYWFhYWFhQREw8UERMPHR0KChYWCgoWFg8PExMICA0NDw8TEwkJCg4RDxAQGBYYFgkJFBYUFhQWFBYcHAcHHBwcBggcHAgJHBwcCAgICAgIHAcHHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcDAwMHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcBSVKIBggGQAAAAAAAAAAAAAAAAAAAAATHx8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABxkUGRQZFBkUGRQZFBkUGRQZFBkUGRQZFBkUGRQZFBkUGRQZFBkUGRQJBwkHHRUdFR0VHRUdFR0VHRUgGCAYIBggGCAYGxUbFSAZIBkgGSAZIBkXERcRFxEZFAkHHRUbFRsVGxUbFRsVAAAAABQOIhkWEBYQGxQVExUTGRMZExkVHBUdFRoJCgoWCQkJCQkJCggIDAwICAgACAgICAgICAgQEBAQGBYaGgkJGhoJCRoaCQkaGgkJGhoJCRoaCQkaGgkJFRMUFBUTFBQVExQUFRMUFBUTFBQVExQUDAwMDAwMDAwMDAwMDAwMDAwMEhISEhISEhISEhISEhISEh4eFBQeHhQUHh4UFCkpHx8pKR8fFhYUERMPHR0dCgodHQoKHR0KCh0dCgodHQoKFhYWFh4jDxMeIw8TFhYPDxYWDw8WFg8PHiMPEx4jDxMeIw8THiMPEx4jDxMTEwgIExMICBMTCAgTEwgIExMJCRMTExMTEwkJExMVExQUCg4ODg4QEBAQEBAQEBAQEBAQEBAQGBYYFgkJEBAYFgkJGBYeHh4eCAAAAAAAAAAqKAAAAAAAAAcOAAAWAAAAHh4UFCkpHx8UERMPDw0KCQwJCQkJCR4jCQANEhQWFBYUFhQWFBYUFhQWExMUFipUIAAMDA4PFxclHAgODhAZDA4MDBcXFxcXFxcXFxcMDBkZGRcrHBweHhwaIR4MFRwXIx4hHCEeHBoeHCobHBoMDAwTFw4XFxUXFw0XFwoKFQokFxcXFw4UDBcXHRYVFQ4LDhkcHB4cHiEeFxcXFxcXFRcXFxcMDAwMFxcXFxcXFxcXFxcRFxcXDxcaHx8qDg4XKiEeFxcXFxgVHiMXChAPICUaGg4ZFxcXGhcXKhwcISooFyoODgkJFxUVHAcXDg4VFRcMCQ4rHBwcHBwMDAwMISEhHh4eDA4NDg4ODg4ODg4XCRwUGhULHhccFRwXGRkODg4jIyMXIRcMHBQeFR4VFxcOHBccFx4aHhwXHBcXChcMFw4eFx4XIRceDh4OHBQaDBoQHhceFxoVGhUXISIYFxMaERsXFQ8uKhUqFSoVFSkeGRkZGRkeGh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh8ZKioqKioZGRkrLCcgIBYcGRUVIB8TGQgPJQ4ZDw8ZDxwXHhUeFRwXHBccFyEXIRchFx4XHhcMDAwMDAwMChUKHBUVFwoeFx4XIRchFx4OHBQaDB4XHhceFx4XKh0cFQocFyolIRoMKh0qHSodHBUJDhcZIyMjIw4ODg4cISMQISMgChwcHBwaHgwcHCMeGyEeHBoaHBsjHwwcGBMXChcYFRMXFwoVFRgXExcYFBcWHiEKFxcXIRwkFx4cDAwVLCokGBseHBwcFxwcJxkeHhgcIx4hHhweGhsgGx8cJychJRweKh4XGBYPGRccExcXEhkdFxcXFxUTFSMWGBYiIxoeFhUgFxcXDxUUCgwKJiIXEhUXFREqLR0ODg4ODg4ODg4ODg4OEA4KDg4MGBcRFRkKEBkZChUTExkZCg8YFhgXExQXFR0bFBQUChIlChUVExMWHR0dHRgYGBcRFRkMERkMFRMTGQ8YGBcUFxUdGwoXExcYAAAAAA0NDxEJCAoICAkICQcWFhYWFhYWFhYWFg0WICAMIBYWFiAgICAgCSAgICAgICAgGyAgIB4eCgogICAgGBYWFhUVIicRFiInERYbGSAgICAgICAgICAgICAgICAKCQkJCSAgAAAAAAAAAAAAAAAAAAAAABcqICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0NIBoRCQoJChISCQobGQoKCQoeHgoKDBAeHgoKHh4KChgWFhYYFhYWGBYWFg4ODg4VFRUVIyMWFiMjFhYuLiQkLi4kJBgYGBgYGBgYFxMWERcTFhEhIQsLGBgLCxkZEREVFQkJDg4RERYWCgoMEBMREhIbGRsZCgoXGRcZFxkXGSAgCAggICAHCSAgCQogICAJCQkJCQogCAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICANDQ0gICAgICAgICAgICAgICAgICAgICAgICAFKlQkHCQcAAAAAAAAAAAAAAAAAAAAABYjIwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKHBccFxwXHBccFxwXHBccFxwXHBccFxwXHBccFxwXHBccFxwXHBccFwwKDAohFyEXIRchFyEXIRchFyQcJBwkHCQcJBweFx4XJBwkHCQcJBwkHBwVHBUcFRwXDAohFx4XHhceFx4XHhcAAAAAFw8nHBgSGBIeFxcVFxUcFRwWHBcgFyEXHgoLCxgKCgoKCgoLCQkODgkJCQAJCgkKCQoJChISEhIbGR4eCgoeHgoKHh4KCh4eCgoeHgoKHh4KCh4eCgoYFhYWGBYWFhgWFhYYFhYWGBYWFhgWFhYODg4ODg4ODg4ODg4ODg4ODg4VFRUVFRUVFRUVFRUVFRUVIyMWFiMjFhYjIxYWLi4kJC4uJCQYGBcTFhEhISELCyEhCwshIQsLISELCyEhCwsYGBgYIicRFiInERYZGRERGRkRERkZEREiJxEWIicRFiInERYiJxEWIicRFhUVCQkVFQkJFRUJCRUVCQkWFgoKFhYWFhYWCgoWFhgWFhYMEBAQEBISEhISEhISEhISEhISEhIbGRsZCgoSEhsZCgobGSIiIiIJAAAAAAAAAC8uAAAAAAAACBAAABkAAAAjIxYWLi4kJBcTFhERDgwKDQoKCgoKIicKAA4UFxkXGRcZFxkXGRcZFxkWFhcZLlwjAA0NDhAaGikfCQ8PEhsNDw0NGhoaGhoaGhoaGg0NGxsbGi8fHyEhHxwkIQwXHxolISQfJCEfHCEfLh8eHA0NDRUaDxoaFxoaDhoaCgoXCiYaGhoaDxcNGhchFxcXDwsPGx8fIR8hJCEaGhoaGhoXGhoaGgwMDAwaGhoaGhoaGhoaGhIaGhoQGRwiIi4PDxkuJCEZGRkaGxchJhkPEREjKRwcDhsZGhkcGhouHx8kLisaLg8PCgoZFxceCBoPDxcXGg0KDy4fHx8fHwwMDAwkJCQhISEMDw0PDw8PDw8PDxoKHxccFwshGh4XHxobGw8PDyYmJhokGgwfFyEXIRcaGQ8fGh8aIRwhHxofGhoKGg0aDyEaIRokGiEPIQ8fFxwNHBEhGiEaHBccFxkkJRsaFRwSHhkXETIuFy4XLhcXLSEbHBscHCEdISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhIhwuLi4uLhwcHC8wKiMjGB4bFxcjIhQcCRApDxwQEBwQHxohFyEXHxofGh8aJBokGiQaIRohGgwMDAwMDAwKFwofFxcaCiEaIRokGiQaIQ8fFxwNIRohGiEaIRouIR4XCh8aLikkHAwuIS4hLiEeFwoPGhwmJiYmDw8PDx8kJxIkJiMKHx8fHxwhDB8fJSEeJCEfHBweHyYiDB4bFRoKGRoXFBoaChcXGxcVGhoWGRghJAoZGhkkHygZIR8MDBcxLicbHSEfHh8ZHx8qHCEhGx4lISQhHyEcHSMfIh8qKyQpHiEuIRoaGBEbGh8VGhoUGyAZGhkaFxUXJhcaGCUmHSEYFyMZGhoRFxcKDAoqJRoUFxkWEy4xIA8PDw8PDw8PDw8PDw8SDwoPDw0aGRIXHAoSHBsKFxUVHBwKEBoYGhkVFhkXIB4VFRULEyUKFxcVFRkgICAgGhoaGRIXHA0TGw0XFRUcEBoaGRYZFyAeChkVGRoAAAAADw8QEwoJCwkJCgkKCBgYGBgYGBgYGBgYDxgjIw0jGBgYIyMjIyMKIyMjIyMjIyMdIyMjISELCyMjIyMaGBgYFhYlKxIYJSsSGB0bIyMjIyMjIyMjIyMjIyMjIwoKCgoKIyMAAAAAAAAAAAAAAAAAAAAAGi4jIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjDw8jHBMKCwoLFBQKCx0bCwsKCyEhCwsNESEhCwshIQsLGhgYGBoYGBgaGBgYEBAQEBYWFhYmJhgYJiYYGDMzJyczMycnGxsbGxsbGxsZFRgSGRUYEiQkDAwbGwwMHBwSEhcXCgoQEBISGBgLCw0RFRIUFB0bHRsLCxkcGRwZHBkcIyMJCSMjIwgKIyMKCyMjIwoKCgoKCiMJCSMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIw8PDyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIwYuXCceJx8AAAAAAAAAAAAAAAAAAAAAGCYmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAofGh8aHxofGh8aHxofGh8aHxofGh8aHxofGh8aHxofGh8aHxofGh8aDAoMCiQaJBokGiQaJBokGiQaJx4nHiceJx4nHiEaIRonHycfJx8nHycfHhceFx4XHxoMCiQaIRohGiEaIRohGgAAAAAZESofGxQbFCEZGhcaFx8XHxgfGiMaJBohCwwMGwsLCwsLCwwKCg8PCgoKAAoLCgsKCwoLFBQUFB0bISELCyEhCwshIQsLISELCyEhCwshIQsLISELCxoYGBgaGBgYGhgYGBoYGBgaGBgYGhgYGBAQEBAQEBAQEBAQEBAQEBAQEBYWFhYWFhYWFhYWFhYWFhYmJhgYJiYYGCYmGBgzMycnMzMnJxsbGRUYEiQkJAwMJCQMDCQkDAwkJAwMJCQMDBsbGxslKxIYJSsSGBwcEhIcHBISHBwSEiUrEhglKxIYJSsSGCUrEhglKxIYFxcKChcXCgoXFwoKFxcKChgYCwsYGBgYGBgLCxgYGhgYGA0REhISFBQUFBQUFBQUFBQUFBQUFB0bHRsLCxQUHRsLCx0bJSUlJQoAAAAAAAAANDIAAAAAAAAJEQAAHAAAACYmGBgzMycnGRUYEhMQDQsPCwsLCwslKwoAEBUZHBkcGRwZHBkcGRwZHBgYGRwyZCYADg4QEhwcLCEKERETHQ4RDg4cHBwcHBwcHBwcDg4dHR0cMyEhJCQhHyckDhkhHCkkJyEnJCEfJCEyISEfDg4OFhwRHBwZHBwOHBwMChkMKBwcHBwRGQ4cGSMYGRkRDBEdISEkISQnJBwcHBwcHBkcHBwcDg4ODhwcHBwcHBwcHBwcFBwcHBIbHyUlMhERGzInJBsbGxwdGSQpGxATEiYsHx8QHRscGx4cHDIhIScyLxwyERELCxsZGSEIHBERGRkcDgsRMiEhISEhDg4ODicnJyQkJA4RDxERERERERERHAshGR8ZDCQcIRkhHB0dERERKioqHCccDiEZJBkkGRwcESEcIRwkHyQhHCEcHAwcDxwRJBwkHCccJBEkESEZHw0fEyQcJBwfGR8ZHCcoHRwWHxQgHBkSNjIZMhkyGRkxJB0eHR4eIx8jIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMkHjIxMTExHh4eMzUuJiYbIR4aGSYlFh4JEiwQHhISHhIhHCQZJBkhHCEcIRwnHCccJxwkHCQcDg4ODg4ODgwZCiEZGRwMJBwkHCccJxwkESEZHw4kHCQcJBwkHDIjIRkMIRwyLCcfDDIjMiMyIyEZCxEcHioqKioRERERIScqEycqJgohISEhHyQOISEpJCEnJCEfHyEhKiUOIR0WHAobHRkWHBwKGRkdGRYcHBgbGiQnChscGychKxskIQ4OGTUzKx0gJCEhIRsiIS4eJCQdISkkJyQhJB8gJiElIS4vKCwhJDMkHB0bEh0cIRccHBYdIhwcGxwZFxkpGB0aKCkfJBoaJhscHBIaGQwOCi0pHBYZHBgVMjYjERERERERERERERERERMRDRERDhwbFBkeDRMeHg0ZFxceHg0SHRocGxcYGxkjIBoaGgwVKg0ZGRcXGyMjIyMcHBwbFBkeDhUeDhkXFx4SHRwbGBsZIyANGxcbHQAAAAAQEBIVCgoMCgoKCgsIGhoaGhoaGhoaGhoQGiYmDiYaGhomJiYmJgsmJiYmJiYmJiAmJiYkJAwMJiYmJhwaGhoYGCkvFBopLxQaIB0mJiYmJiYmJiYmJiYmJiYmCwsLCwsmJgAAAAAAAAAAAAAAAAAAAAAcMiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYQECYfFQoLCgsWFgoLIB0MDAoLJCQMDA4TJCQMDCQkDAwcGhoaHBoaGhwaGhoRERERGBgYGCkpGxspKRsbNzcqKjc3KiodHR0dHR0dHRsXGhQbFxoUJycNDR0dDQ0eHhQUGRkKChERFBQaGgwMDhMXFBYWIB0gHQwMGx4bHhseGx4mJgoKJiYmCAsmJgoMJiYmCwsLCwsLJgoKJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmEBAQJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmBjJkKyErIQAAAAAAAAAAAAAAAAAAAAAaKioAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADCEcIRwhHCEcIRwhHCEcIRwhHCEcIRwhHCEcIRwhHCEcIRwhHCEcIRwODA4MJxwnHCccJxwnHCccJxwrISshKyErISshJBwkHCshKyErISshKyEhGSEZIRkhHA4MJxwkHCQcJBwkHCQcAAAAABsSLiEdFh0WJBwcGRwZIRkhGiEcJhwnHCQMDQ0dDAwMDAwMDQoKEREKCgoACgsKCwoLCgsWFhYWIB0kJAwMJCQMDCQkDAwkJAwMJCQMDCQkDAwkJAwMHBoaGhwaGhocGhoaHBoaGhwaGhocGhoaERERERERERERERERERERERERGBgYGBgYGBgYGBgYGBgYGCkpGxspKRsbKSkbGzc3Kio3NyoqHR0bFxoUJycnDQ0nJw0NJycNDScnDQ0nJw0NHR0dHSkvFBopLxQaHh4UFB4eFBQeHhQUKS8UGikvFBopLxQaKS8UGikvFBoZGQoKGRkKChkZCgoZGQoKGhoMDBoaGhoaGgwMGhocGhoaDhMTExMWFhYWFhYWFhYWFhYWFhYWIB0gHQwMFhYgHQwMIB0pKSkpCgAAAAAAAAA4NgAAAAAAAAoTAAAeAAAAKSkbGzc3KiobFxoUFREODBAMDAwMDCkvDQARGhseGx4bHhseGx4bHhseGhobHjZsKQAPDxETHh4wJAoSEhUgDxIPDx4eHh4eHh4eHh4PDyAgIB43JCQnJyQhKicPGyQeLScqJConJCEnJDYjIyEPDw8YHhIeHhseHg8eHQ0NGw0tHR4eHhIbDx0bJxobGhIOEiAkJCckJyonHh4eHh4eGx4eHh4PDw8PHR4eHh4eHR0dHR4WHh4eEx0hKCg2EhIeNionHh4eHh8bJyweEBQUKTAhIREgHR4eIh4eNiQkKjYzHjYSEgwMHhsbIwkeEhIbGx4PDBI1JCQkJCQPDw8PKioqJycnDxIQEhISEhISEhIeDCQbIRoOJx4jGyQeICASEhItLS0eKh4PJBsnGycbHh4SJB4kHichJyQeJB4eDR4QHhInHScdKh4nEicSJBshDyEUJx0nHSEaIRoeKisfHhghFSMeGxQ7Nhs2GzYbGzUnICEgISEmIiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJichNjU1NTUhISE3OTEpKR0jIBwbKSgYIQoTMBEhExMhEyQeJxsnGyQeJB4kHioeKh4qHicdJx0PDw8PDw8PDRsNJBsbHg0nHSceKh4qHicSJBshDycdJx0nHScdNicjGw0kHjYwKiEPNic2JzYnIxsMEh4gLS0tLRISEhIkKi0VKiwpDSQkJCQhJw8kJC0nIyonJCEhIyMtKA8jHxgeDR4fGxgeHg0bGx8bGB4fGh4cJyoNHh4eKiQvHSckDw8bOTctHyInJCMkHSUkMiEnJx8jLScqJyQnISIpIygkMTMrMCMnNyceHx0UIB4kGR0dGB8lHR4cHhsZGywaHxwrLCInHBwpHR4dFBwbDQ8NMSwdGBsdGhY2OiUSEhISEhISEhISEhISFRINEhIPHh0WGyENFSAgDRwZGSAgDRMfHR8eGRoeHCYjGhoaDRcqDRwcGRkdJiYmJh4eHh0WGyEPFiAPHBkZIBMfHx4aHhwmIw0dGR4fAAAAABERExYLCw0LCwsLCwkcHBwcHBwcHBwcHBEcKSkPKRwcHCkpKSkpCykpKSkpKSkpIikpKScnDQ0pKSkpHhwdHRoaLDIVHCwyFRwiICkpKSkpKSkpKSkpKSkpKSkMCwsLCykpAAAAAAAAAAAAAAAAAAAAAB42KSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKRERKSEWCwwLDBcXCwwiIA0NCwwnJw0NDxQnJw0NJycNDR4cHR0eHB0dHhwdHRISEhIaGhoaLCwdHSwsHR07Oy4uOzsuLh8fHx8fHx8fHRgcFR0YHBUrKw4OHx8ODiAgFRUbGwsLEhIVFRwcDQ0PFBgVFxciICIgDQ0dIB0gHSAdICkpCwspKSkJCykpCw0pKSkLCwsLCwwpCwspKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkREREpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkHNmwuIy4kAAAAAAAAAAAAAAAAAAAAABwtLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANJB4kHiQeJB4kHiQeJB4kHiQeJB4kHiQeJB4kHiQeJB4kHiQeJB4kHg8NDw0qHioeKh4qHioeKh4qHi4jLiMuIy4jLiMnHScdLiQuJC4kLiQuJCMbIxsjGyQeDw0qHicdJx0nHScdJx0AAAAAHRQyJB8YHxgnHh4bHhskGyQcJB0pHioeJw0ODh8NDQ0NDQ0PCwsSEgsLCwALDAsMCwwLDBcXFxciICcnDQ0nJw0NJycNDScnDQ0nJw0NJycNDScnDQ0eHB0dHhwdHR4cHR0eHB0dHhwdHR4cHR0SEhISEhISEhISEhISEhISEhIaGhoaGhoaGhoaGhoaGhoaLCwdHSwsHR0sLB0dOzsuLjs7Li4fHx0YHBUrKysODisrDg4rKw4OKysODisrDg4fHx8fLDIVHCwyFRwgIBUVICAVFSAgFRUsMhUcLDIVHCwyFRwsMhUcLDIVHBsbCwsbGwsLGxsLCxsbCwscHA0NHBwcHBwcDQ0cHB4cHR0PFBUVFRcXFxcXFxcXFxcXFxcXFxciICIgDQ0XFyIgDQ0iICwsLCwLAAAAAAAAAD07AAAAAAAAChQAACAAAAAsLB0dOzsuLh0YHBUWEg8NEQ0NDQ0NLDINABIaHSAdIB0gHSAdIB0gHSAcHB0gOnQsABAQExUgIDQnCxMTFyIQExAQICAgICAgICAgIBAQIiIiIDsnJyoqJyMtKg8dJyAvKi0nLSonJConOiUmIxAQEBggEyAgHSAgECAgDQ0eDTEgICAgEx0QIB0pHBscEw4TIicnKicqLSogICAgICAdICAgIA8PDw8gICAgICAgICAgIBcgICAUHyMrKzoTEyA6LSkgICAgIR0pMCARFRUtNCMjEyIgICAkICA6JyctOjcgOhMTDQ0gHRsmCiATEx0dIBANEzknJycnJw8PDw8tLS0qKioPExETExMTExMTEyANJx0jHA4qICYbJyAiIhMTEzAwMCAtIA8nHSodKh0gIBMnICcgKiQqJyAnICANIBEgEyogKiAtICoTKhMnHSQQJBYqICogIxwjHCAtLiIgGiQXJiAdFT86HTodOh0dOSoiIyIjIykkKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKiM6OTk5OSMjIzs9NSwsHyYiHh0sKxojCxUzEyMVFSMVJyAqHSodJyAnICcgLSAtIC0gKiAqIA8PDw8PDw8NHQ0nHh0gDSogKiAtIC0gKhMnHSMQKiAqICogKiA6KSYbDScgOjQtIw86KTopOikmGw0TICMwMDAwExMTEyctMRYtMCwNJycnJyMqDycnLyomLSonJCQmJTArDyYiGiANICEdGiAgDR0dIR0aICEcIB4pLQ0gICAtJzIfKicPDx09OzIiJSonJicfJyc2IyoqIiYvKi0qJyokJSwlKyc1Ni4zJio7KiAhHxUiICcbICAZIiggIB8gHRsbMBwhHi8wJCoeHiwfICAVHh0NDw01LyAZGyAcGDo+KBMTExMTExMTExMTExMWEw4TExAhHxcdIw4WIyIOHhsbIyMOFCEfISAbHCAeKCUdHR0OGC4OHh4bGx8oKCgoISEhHxcdIxEYIhEeGxsjFCEhIBwgHiglDh8bICEAAAAAExMVGAwMDgwMDAwMCh8fHx8fHx8fHx8fEx8sLBAsHx8fLCwsLCwMLCwsLCwsLCwlLCwsKSkODiwsLCwhHx8fHBwvNhceLzYXHiUiLCwsLCwsLCwsLCwsLCwsLA0MDAwMLCwAAAAAAAAAAAAAAAAAAAAAIDosLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsExMsJBgMDQwNGRkMDSUiDg4MDSkpDg4QFikpDg4pKQ4OIR8fHyEfHx8hHx8fFBQUFBwcHBwwMB8fMDAfH0BAMTFAQDExIiIiIiIiIiIgGh8XIBofFy4uEA8iIhAPIyMXFx0dDAwUFBcXHx8ODhAWGhcZGSUiJSIODiAjICMgIyAjLCwMDCwsLAoMLCwMDiwsLAwMDAwMDSwMDCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLBMTEywsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLAc6dDImMicAAAAAAAAAAAAAAAAAAAAAHjAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0nICcgJyAnICcgJyAnICcgJyAnICcgJyAnICcgJyAnICcgJyAnICcgDw0PDS0gLSAtIC0gLSAtIC0gMiYyJjImMiYyJiogKiAyJzInMicyJzInJhsmGyYbJyAPDS0gKiAqICogKiAqIAAAAAAfFTYnIhkiGSogIB0gHScdJx4nICwgLSApDhAPIg4ODg4ODhAMDBMTDAwMAAwNDA0MDQwNGRkZGSUiKSkODikpDg4pKQ4OKSkODikpDg4pKQ4OKSkODiEfHx8hHx8fIR8fHyEfHx8hHx8fIR8fHxQUFBQUFBQUFBQUFBQUFBQUFBwcHBwcHBwcHBwcHBwcHBwwMB8fMDAfHzAwHx9AQDExQEAxMSIiIBofFy4uLhAPLi4QDy4uEA8uLhAPLi4QDyIiIiIvNhceLzYXHiMjFxcjIxcXIyMXFy82Fx4vNhceLzYXHi82Fx4vNhceHR0MDB0dDAwdHQwMHR0MDB8fDg4fHx8fHx8ODh8fIR8fHxAWFhYWGRkZGRkZGRkZGRkZGRkZGSUiJSIODhkZJSIODiUiLy8vLwwAAAAAAAAAQT8AAAAAAAALFQAAIwAAADAwHx9AQDExIBofFxgUEA4TDg4ODg4vNg4AFB0gIyAjICMgIyAjICMgIx8fICNDhjIAExMWGCUlPC0NFhYaJxMWExMlJSUlJSUlJSUlExMnJyclRC0tMDAtKTQwEyItJTcwNC00MC0pMC1CKy0pExMTHiUWJSUiJSUTJSUPDyIPOSUlJSUWIhMlIS8gISEWERYnLS0wLTA0MCUlJSUlJSIlJSUlEhISEiUlJSUlJSUlJSUlGyUlJRckKTExQxYWJUM0MCUlJSUnITA3JRQZGDM8KSkWJyUlJSklJUMtLTRDPyVDFhYPDyUhIS0LJRYWIiIlEw8WQy0tLS0tExMTEzQ0NDAwMBIWFBYWFhYWFhYWJQ8tIikhETAlLSEtJScnFhYWODg4JTQlEy0iMCIwIiUlFi0lLSUwKTAtJS0lJQ8lFCUWMCUwJTQlMBYwFi0iKRMpGTAlMCUpISkhJTQ1JyUeKRorJSIYSUMiQyJDIiJCMCcoJygoLyovLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8xKENCQkJCKCgoREc9MjIkLCgiIjIxHigNGDsWKBgYKBgtJTAiMCItJS0lLSU0JTQlNCUwJTAlExITEhMSEw8iDy0iIiUPMCUwJTQlNCUwFi0iKRMwJTAlMCUwJUIvLSEPLSVDPDQpEkIvQi9CLy0hDxYlKDg4ODgWFhYWLTU4GjQ4Mg8tLS0tKTATLS03MCw0MC0pKS0rODITLSceJQ8lJyIeJSUPIiInIR4lJiAlIzA0DyUlJTQtOiQwLRMTIkdEOScrMC0sLSQtLT4oMDAnLDcwNDAtMCkrMysyLT0/NTssMEQwJSYkGCclLR8lJR0nLiUlJCUiHyE3ICYjNjcqMCMiMiQlJRgiIg8SDz02JR0hJSEcQ0guFhYWFhYWFhYWFhYWFhoWERYWEyYkGyIoERooKBEiHx8oKBEYJiMmJR8gJSIvKyIiIhAcNxEiIh8fJC8vLy8mJiYkGyIoExwoEyIfHygYJiYlICUiLysRJB8lJwAAAAAVFRgcDg0QDQ0ODQ4LIyMjIyMjIyMjIyMVIzIyEzIjIyMyMjIyMg4yMjIyMjIyMisyMjIwMBAQMjIyMiYjJCQhITY+GiI2PhoiKycyMjIyMjIyMjIyMjIyMjIyDw4ODg4yMgAAAAAAAAAAAAAAAAAAAAAlQzIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIVFTIpHA4PDg8dHQ4PKycQEA4PMDAQEBMZMDAQEDAwEBAmIyQkJiMkJCYjJCQXFxcXISEhITc3JCQ3NyQkSko5OUpKOTknJycnJycnJyQeIxokHiMaNTUSEicnEhIoKBoaIiIODhcXGhojIxAQExkeGh0dKycrJxAQJCgkKCQoJCgyMg0NMjIyCw4yMg4QMjIyDg4ODg4PMg0NMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyFRUVMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyCEOGOSw5LQAAAAAAAAAAAAAAAAAAAAAiODgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADy0lLSUtJS0lLSUtJS0lLSUtJS0lLSUtJS0lLSUtJS0lLSUtJS0lLSUTDxMPNCU0JTQlNCU0JTQlNCU5LDksOSw5LDksMCUwJTktOS05LTktOS0tIS0hLSEtJRMPNCUwJTAlMCUwJTAlAAAAACQYPi0nHScdMCUlIiUiLSItIy0lMiU0JTAQEhInEBAQEBAQEg4OFhYODg4ADg8ODw4PDg8dHR0dKycwMBAQMDAQEDAwEBAwMBAQMDAQEDAwEBAwMBAQJiMkJCYjJCQmIyQkJiMkJCYjJCQmIyQkFxcXFxcXFxcXFxcXFxcXFxcXISEhISEhISEhISEhISEhITc3JCQ3NyQkNzckJEpKOTlKSjk5JyckHiMaNTU1EhI1NRISNTUSEjU1EhI1NRISJycnJzY+GiI2PhoiKCgaGigoGhooKBoaNj4aIjY+GiI2PhoiNj4aIjY+GiIiIg4OIiIODiIiDg4iIg4OIyMQECMjIyMjIxAQIyMmIyQkExkaGhodHR0dHR0dHR0dHR0dHR0dKycrJxAQHR0rJxAQKyc2NjY2DgAAAAAAAABLSQAAAAAAAA0ZAAAoAAAANzckJEpKOTkkHiMaHBcTEBUQEBAQEDY+EQAXIiQoJCgkKCQoJCgkKCQoIyMkKEuWOAAVFRcbKipDMg4ZGR0sFRkVFSoqKioqKioqKioVFSwsLCpMMjI2NjIuOjYVJjIqPTY6Mjo2Mi02MksxMS4VFRUiKhkqKiYqKhUqKhERJhE/KioqKhkmFSolNSQlJRkUGSwyMjYyNjo2KioqKioqJioqKioVFRUVKioqKioqKioqKioeKioqGiguNzdLGRkpSzo1KSkpKislNT4pFxwbOkMuLhcsKSopLioqSzIyOktHKksZGRERKSUlMQ0qGRkmJioVERlMMjIyMjIVFRUVOjo6NjY2FRkYGRkZGRkZGRkqETImLiUUNioxJTIqLCwZGRk/Pz8qOioVMiY2JjYmKikZMioyKjYuNjIqMioqESoWKhk2KjYqOio2GTYZMiYtFS0cNio2Ki4lLiUpOjwrKiEuHjEpJhtSSyZLJksmJkk2LC0sLS01LzU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTctS0pKSkotLS1NT0U4OCgxLSYmODchLQ4bQhgtGxstGzIqNiY2JjIqMioyKjoqOio6KjYqNioVFRUVFRUVESYRMiYmKhE2KjYqOio6KjYZMiYuFTYqNio2KjYqSzUxJREyKktDOi4VSzVLNUs1MSURGSotPz8/PxkZGRkyOz8dOj44ETIyMjIuNhUyMj02MTo2Mi4tMTE/OBUxKyEqESkrJiEqKhEmJislIiorJCknNTsRKSopOzJBKTYyFRUmT0xALDA2MjEyKTMyRS02NiwxPTY6NjI2LTA5MTcyRUY7QjE2TDYqKygbLCoyIioqISw0KSopKiYiJT4kKyc8Pi82JyY4KSoqGyYmERURRD0qISUpJR9LUDQZGRkZGRkZGRkZGRkZHRkTGRkVKikeJi0THS0sEyYjIy0tExorKCopIyQpJjQwJSUlEh88EyYmIyMoNDQ0NCoqKikeJi0WHywWJiMjLRorKikkKSY0MBMpIykrAAAAABgYGx8QDxIPDxAPEAwnJycnJycnJycnJxgnODgVOCcnJzg4ODg4EDg4ODg4ODg4MDg4ODY2EhI4ODg4KicoKCUlPUYeJz1GHicwLDg4ODg4ODg4ODg4ODg4ODgREBAQEDg4AAAAAAAAAAAAAAAAAAAAACpLODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OBgYOC4fEBEQESAgEBEwLBISEBE2NhISFRw2NhISNjYSEionKCgqJygoKicoKBkZGRklJSUlPj4oKD4+KChSUj8/UlI/PywsLCwsLCwsKSInHikiJx47OxQULCwUFC0tHh4mJhAQGRkeHicnEhIVHCIeICAwLDAsEhIpLSktKS0pLTg4Dw84ODgMEDg4EBI4ODgQEBAQEBE4Dw84ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODgYGBg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODgJS5ZAMUAyAAAAAAAAAAAAAAAAAAAAACY/PwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARMioyKjIqMioyKjIqMioyKjIqMioyKjIqMioyKjIqMioyKjIqMioyKhURFRE6KjoqOio6KjoqOio6KkAxQDFAMUAxQDE2KjYqQDJAMkAyQDJAMjElMSUxJTIqFRE6KjYqNio2KjYqNioAAAAAKRtFMiwhLCE2KSomKiYyJjInMio4KjoqNhIUFCwSEhISEhIUEBAZGRAQEAAQERAREBEQESAgICAwLDY2EhI2NhISNjYSEjY2EhI2NhISNjYSEjY2EhIqJygoKicoKConKCgqJygoKicoKConKCgZGRkZGRkZGRkZGRkZGRkZGRklJSUlJSUlJSUlJSUlJSUlPj4oKD4+KCg+PigoUlI/P1JSPz8sLCkiJx47OzsUFDs7FBQ7OxQUOzsUFDs7FBQsLCwsPUYeJz1GHictLR4eLS0eHi0tHh49Rh4nPUYeJz1GHic9Rh4nPUYeJyYmEBAmJhAQJiYQECYmEBAnJxISJycnJycnEhInJyonKCgVHB0dHSAgICAgICAgICAgICAgICAwLDAsEhIgIDAsEhIwLD09PT0QAAAAAAAAAFRRAAAAAAAADxwAAC0AAAA+PigoUlI/PykiJx4fGRUSGBISEhISPUYTABolKS0pLSktKS0pLSktKS0nJyktU6Y+ABcXGR0uLko3EBwcIDAXHBcXLi4uLi4uLi4uLhcXMDAwLlQ3Nzw8NzNBPBcqNy5FPEE3QTw3NDw3Uzg2MxcXFyYuHC4uKi4uGC4uEhMrEkcuLi4uHCoXLik7KicoHBQcMDc3PDc8QTwuLi4uLi4qLi4uLhcXFxcuLi4uLi4uLi4uLiEuLi4dLTM9PVMcHC5TQTsuLi4uMCk7RC4XHx5ASjMzGTAuLi4yLi5TNzdBU04uUxwcEhIuKSc2Di4cHCoqLhcSHFM3Nzc3NxcXFxdBQUE8PDwXHBgcHBwcHBwcHC4SNyozKBQ8LjYnNy4wMBwcHEVFRS5BLhc3KjwqPCouLhw3LjcuPDM8Ny43Li4SLhguHDwuPC5BLjwcPBw3KjQYNB88LjwuMygzKC5BQjAuJTMhNi4qHlpTKlMqUyoqUTwwMjAyMjs0Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7PTJTUlJSUjIyMlVXTD4+LDYxKio+PSUyEB1JGzIdHTIdNy48KjwqNy43LjcuQS5BLkEuPC48LhcXFxcXFxcSKhM3KyouEjwuPC5BLkEuPBw3KjMXPC48LjwuPC5TOzYnEjcuU0pBMxVTO1M7Uzs2JxIcLjJFRUVFHBwcHDdBRiBARD4SNzc3NzM8Fzc3RTw2QTw3MzQ2OEU+FzYwJS4SLTAqJS4uEioqMCklLi8oLSw7QRItLi1BN0gtPDcXFypYVEcwNTw3NjctODdNMjw8MDZFPEE8Nzw0NT84PTdMTkJJNjxUPC4wLB4wLjgmLi4kMDkuLi0uKiYnRCowK0NENDwrKj4tLi4eKioSFxNLQy4kJy4pIlNZORwcHBwcHBwcHBwcHBwgHBQcHBcvLSEqMhQgMjEUKiYmMjIUHTAsLy0mKC4qOjUpKSkUI0MUKiomJiw6Ojo6Ly8vLSEqMhgiMRgqJiYyHTAvLSguKjo1FC0mLTAAAAAAGhoeIhERFBERERESDiwsLCwsLCwsLCwsGiw+Phc+LCwsPj4+Pj4SPj4+Pj4+Pj41Pj4+OzsUFD4+Pj4vLCwsKSlDTSErQ00hKzUxPj4+Pj4+Pj4+Pj4+Pj4+PhMSEhISPj4AAAAAAAAAAAAAAAAAAAAALlM+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Gho+MyIRExETJCQREzUxFBQREzs7FBQXHzs7FBQ7OxQULywsLC8sLCwvLCwsHBwcHCkpKSlERCwsREQsLFtbRkZbW0ZGMDAwMDAwMDAtJSwhLSUsIUFBFhYwMBYWMjIhISoqEREcHCEhLCwUFBcfJSEkJDUxNTEUFC0yLTItMi0yPj4RET4+Pg4SPj4RFD4+PhISEhISEz4RET4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+PhoaGj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+PgpTpkc2RzgAAAAAAAAAAAAAAAAAAAAAK0VFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABI3LjcuNy43LjcuNy43LjcuNy43LjcuNy43LjcuNy43LjcuNy43LjcuFxIXEkEuQS5BLkEuQS5BLkEuRzZHNkc2RzZHNjwuPC5HOEc4RzhHOEc4Nic2JzYnNy4XEkEuPC48LjwuPC48LgAAAAAtHk04MCQwJDwuLiouKjcqNys3Lj4uQS47FBYWMBQUFBQUFBYRERwcERERABETERMRExETJCQkJDUxOzsUFDs7FBQ7OxQUOzsUFDs7FBQ7OxQUOzsUFC8sLCwvLCwsLywsLC8sLCwvLCwsLywsLBwcHBwcHBwcHBwcHBwcHBwcHCkpKSkpKSkpKSkpKSkpKSlERCwsREQsLERELCxbW0ZGW1tGRjAwLSUsIUFBQRYWQUEWFkFBFhZBQRYWQUEWFjAwMDBDTSErQ00hKzIyISEyMiEhMjIhIUNNIStDTSErQ00hK0NNIStDTSErKioRESoqEREqKhERKioRESwsFBQsLCwsLCwUFCwsLywsLBcfICAgJCQkJCQkJCQkJCQkJCQkJDUxNTEUFCQkNTEUFDUxQ0NDQxEAAAAAAAAAXVoAAAAAAAAQHwAAMgAAAERELCxbW0ZGLSUsISIcFxQbFBQUFBRDTRQAHCktMi0yLTItMi0yLTItMiwsLTJcuEUAGhoaITMzUj0SHx8kNhofGhozMzMzMzMzMzMzGho2NjYzXT09QkI9OEhCGi49M0tCSD1IQj05Qj1bPj04GhoaKTMfMzMuMzMbNDMUFS8UTTMzMzQfLhozLUEtLS0fFx82PT1CPUJIQjMzMzMzMy4zMzMzGBgYGDMzMzMzMzMzMzMzJTMzMyAxOEREXB8fM1xIQjMzMzM1LUJMMxkiIkdSODgcNjIzMzkzM1w9PUhcVzNcHx8UFDMtLT0PMx8fLi4zGhQfXT09PT09GhoaGkhISEJCQhgfHB8fHx8fHx8fMxQ9LjgtF0IzPS09MzY2Hx8fTU1NM0g0Gj0uQi5CLjMzHz0zPTNCOUI9Mz0zMxQzGzMfQjNCM0gzQh9CHz0uORo5I0IzQjM4LTgtM0hJNTMpOSQ8My4iZFwuXC5cLi5aQjY4Njg4QTpBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFDOFxbW1tbODg4XmFURUUxPDcvLkVEKTgRIVEeOCEhOCE9M0IuQi49Mz0zPTNINEg0SDNCM0IzGhgaGBoYGhQuFT0vLjMUQjNDM0gzSDNCHz0uOBpCM0IzQjNCM1tBPS0UPTNcUkg4GFtBW0FbQT0tFB8zN01NTU0fHx8fPUhNI0dNRRQ9PT09OEIaPT1LQjxIQj05OT0+TUUaPTUpMxQyNS4pMzMULi41LSkzNCwyMEJIFDIzMkg9UDJCPRoaLmFdTzY6Qj08PTI+PVU4QkI2PEtCSEI9Qjk6Rj5EPVRWSVE8Ql1CMzUxIjYzPiozMyg2PzMzMjMuKi1MLTUwSkw6QjAvRTIzMyIvLhQYFVNLMygtMy0mXGM/Hx8fHx8fHx8fHx8fHyMfFB8fGjQyJS83FyM3NhcvKis3NxcgNTE0MiosMy9AOy4uLhYmTBcvLysrMUBAQEA0NDQyJS83GiY2Gi8qKzcgNTQyLDMvQDsXMioyNQAAAAAdHSEmExMWExMTExMPMDAwMDAwMDAwMDAdMEVFGkUwMDBFRUVFRRNFRUVFRUVFRTtFRUVCQhYWRUVFRTQwMTEtLUtWJC9LViQvOzZFRUVFRUVFRUVFRUVFRUVFFRMTExNFRQAAAAAAAAAAAAAAAAAAAAAzXEVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUUdHUU5JhMVExUoKBMVOzYWFhMVQkIWFhojQkIWFkJCFhY0MDExNDAxMTQwMTEfHx8fLS0tLUxMMTFMTDExZWVOTmVlTk42NjY2NjY2NjIpMCQyKTAkSUkZGDY2GRg3NyQkLy8TEx8fJCQwMBYWGiMpJCgoOzY7NhYWMjcyNzI3MjdFRRMTRUVFDxNFRRMWRUVFExMTExMVRRMTRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFHR0dRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFDFy4TzxPPgAAAAAAAAAAAAAAAAAAAAAvTU0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFD0zPTM9Mz0zPTM9Mz0zPTM9Mz0zPTM9Mz0zPTM9Mz0zPTM9Mz0zPTMaFBoUSDNIM0gzSDNIM0gzSDNPPE88TzxPPE88QjNCM08+Tz5PPk8+Tz49LT0tPS09MxoUSDNCM0IzQjNCM0IzAAAAADIiVT42KDYoQjMzLjMuPS49MD0zRTNIM0IWGRg2FhYWFhYWGRMTHx8TExMAExUTFRMVExUoKCgoOzZCQhYWQkIWFkJCFhZCQhYWQkIWFkJCFhZCQhYWNDAxMTQwMTE0MDExNDAxMTQwMTE0MDExHx8fHx8fHx8fHx8fHx8fHx8fLS0tLS0tLS0tLS0tLS0tLUxMMTFMTDExTEwxMWVlTk5lZU5ONjYyKTAkSUlJGRhJSRkYSUkZGElJGRhJSRkYNjY2NktWJC9LViQvNzckJDc3JCQ3NyQkS1YkL0tWJC9LViQvS1YkL0tWJC8vLxMTLy8TEy8vExMvLxMTMDAWFjAwMDAwMBYWMDA0MDExGiMkJCQoKCgoKCgoKCgoKCgoKCgoOzY7NhYWKCg7NhYWOzZLS0tLEwAAAAAAAABnZAAAAAAAABIiAAA3AAAATEwxMWVlTk4yKTAkJh8aFh0WFhYWFktWFwAfLjI3MjcyNzI3MjcyNzI3MDAyN2TISwAcHBwkODhZQxMhISc6HCEcHDg4ODg4ODg4ODgcHDo6OjhmQ0NISEM9TkgcMkM4U0hOQ05IQz5IQ2NCQj0cHBwrOCE4ODI4OB03OBYWMhZUODg4NyEyHDgxRzExMSEaITpDQ0hDSE5IODg4ODg4Mjg4ODgbGxsbODg4ODg4ODg4ODgoODg4IzY9SkpkISE3ZE5HNzc3ODoxR1I3HSUlTVk9PR86Nzg3PTg4ZENDTmReOGQhIRYWNzExQhE4ISEyMjgcFiFkQ0NDQ0McHBwcTk5OSEhIGyEfISEhISEhISE4FkMyPTEaSDhCMUM4OjohISFTU1M4TjccQzJIMkgyODchQzhDOEg9SEM4Qzg4FjgdOCFIOEg4TjhIIUghQzI+HT4mSDhIOD0xPTE3TlA6OC0+KEE3MiRtZDJkMmQyMmJIOjw6PDxHP0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0k8ZGNjY2M8PDxmaVxLSzVCOzMyS0ksPBMjWSA8IyM8I0M4SDJIMkM4QzhDOE43TjdOOEg4SDgcGxwbHBscFjIWQzIyOBZIOEg4TjhOOEghQzI9HEg4SDhIOEg4Y0dCMRZDOGRZTj0bY0djR2NHQjEWITg8U1NTUyEhISFDTlQmTVNLF0NDQ0M9SBxDQ1NIQU5IQz4+QkJUSxxCOi04Fzc6Miw4OBcyMjoxLTg5MDc0R04XNzg3TkNWNkhDHBwyamVVOkBIQ0JDNkRDXDxISDpCU0hOSENIPkBMQkpDXF5PWUJIZUg4OTUkOjhDLjg4LDpFNzg2ODIuMVIxOTRQUj9INDNLNjg4JDMyFhsWW1E4LDE3MSlka0UhISEhISEhISEhISEhJiEbISEcODYoMzwYJjw7GDMuLjw8GCM5NTk3LjA3M0VAMTExGCpPGDMzLi42RUVFRTg4ODYoMzwdKTsdMy4uPCM5OTcwNzNFQBg2Ljc6AAAAACAgJCkVFBgUFBUUFRA1NTU1NTU1NTU1NSA1S0scSzU1NUtLS0tLFUtLS0tLS0tLQEtLS0dHGBhLS0tLODU1NTExUV0nM1FdJzNAO0tLS0tLS0tLS0tLS0tLS0sXFRUVFUtLAAAAAAAAAAAAAAAAAAAAADhkS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSyAgSz4pFRcVFysrFRdAOxgYFRdHRxgYHCZHRxgYR0cYGDg1NTU4NTU1ODU1NSIiIiIxMTExUlI1NVJSNTVublVVbm5VVTo6Ojo6Ojo6Ni01JzYtNSdPTxsaOjobGjw8JyczMxUVIiInJzU1GBgcJi0nKytAO0A7GBg2PDY8Njw2PEtLFBRLS0sQFUtLFRhLS0sVFRUVFRdLFBRLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0sgICBLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0sNZMhWQlVDAAAAAAAAAAAAAAAAAAAAADNTUwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWQzhDOEM4QzhDOEM4QzhDOEM4QzhDOEM4QzhDOEM4QzhDOEM4QzhDOBwWHBZOOE44TjhOOE44TjhOOFZCVkJWQlZCVkJIOEg4VUNVQ1VDVUNVQ0IxQjFCMUM4HBZOOEg4SDhIOEg4SDgAAAAANiRcQzosOixINzgyODJDMkM0QzhLOE44RxgbGjoYGBgYGBgbFRUhIRUVFQAVFxUXFRcVFysrKytAO0dHGBhHRxgYR0cYGEdHGBhHRxgYR0cYGEdHGBg4NTU1ODU1NTg1NTU4NTU1ODU1NTg1NTUiIiIiIiIiIiIiIiIiIiIiIiIxMTExMTExMTExMTExMTExUlI1NVJSNTVSUjU1bm5VVW5uVVU6OjYtNSdPT08bGk9PGxpPTxsaT08bGk9PGxo6Ojo6UV0nM1FdJzM8PCcnPDwnJzw8JydRXSczUV0nM1FdJzNRXSczUV0nMzMzFRUzMxUVMzMVFTMzFRU1NRgYNTU1NTU1GBg1NTg1NTUcJicnJysrKysrKysrKysrKysrKytAO0A7GBgrK0A7GBhAO1FRUVEVAAAAAAAAAHBsAAAAAAAAEyUAADwAAABSUjU1bm5VVTYtNScpIhwYIBgYGBgYUV0YACIxNjw2PDY8Njw2PDY8Njw1NTY8AAAAAwAAAAMAAAAcAAEAAAAAC0AAAwABAAAMRgAECyQAAAEcAQAABwAcAH4BfwGPAZIBoQGwAdwB/wJZAscCyQLdAwEDAwMJAyMDfgOKA4wDoQPOBAwETwRcBF8EkwSXBJ0EowSzBLsE2QTpBcMF6gX0BgwGGwYfBjoGVQbtBv4ehR75IA8gFSAeICIgJiAuIDAgMyA6IDwgPiBEIG8gfyCkIKcgrCEFIRMhFiEiISYhLiFUIV4hlSGoIgIiBiIPIhIiFSIaIh8iKSIrIkgiYSJlIwIjECMhJQAlAiUMJRAlFCUYJRwlJCUsJTQlPCVsJYAlhCWIJYwlkyWhJawlsiW6JbwlxCXLJc8l2SXmJjwmQCZCJmAmYyZmJmvoBegY6DrwAvAx+wL7IPs2+zz7PvtB+0T7sfvn+//8Yv0//fL+/P/8//8AAAAgAKABjwGSAaABrwHNAfoCWQLGAskC2AMAAwMDCQMjA34DhAOMA44DowQBBA4EUQReBJAElgSaBKIErgS4BNgE6AWwBdAF8AYMBhsGHwYhBkAGYAbwHoAeoCAMIBMgFyAgICYgKiAwIDIgOSA8ID4gRCBqIH8goyCnIKohBSETIRYhIiEmIS4hUyFbIZAhqCICIgYiDyIRIhUiGSIeIikiKyJIImAiZCMCIxAjICUAJQIlDCUQJRQlGCUcJSQlLCU0JTwlUCWAJYQliCWMJZAloCWqJbIluiW8JcQlyiXPJdgl5iY6JkAmQiZgJmMmZSZq6AHoGOg68AHwBPsB+x37Kvs4+z77QPtD+0b70/v8/F79Pv3y/oD//P///+MAAAOV/xQCygK9Ay//3ALMAAD+DwAAAZIBdwFrAXL8oAAA/mkAAAAA/iv+Kv4p/igAAAB8AHoAdgBsAGgATAA+AAD80PzL/OD80vzPAAAAAAAAAADjXQAA4twAAAAAAADghQAA4JXhW+CE4PnhqOB3AADgtwAA4JAAAOCK4H3hdd9q33nguuMs4I7fqN+W3pbeot6LAADepgAAAADfF95x3l8AAN4w3kDeM94k3EbcRdw83DncNtwz3DDcKdwi3BvcFNwB2+7b69vo2+Xb4gAAAADbxtu/277btwAA28Xbpduv20XbQttB2yTbItsh2x4awBr6GuEQvgAABb4AAAedB5wHmweaB5kAAAAAAAAG6QY+BY0FAANjAAEAAAEaAAAAAAAAAAAAAAAAAAACygAAAsoAAAAAAAAAAAAAAsoAAALUAvoAAAAAAAAAAANIAAAAAAAAAAAAAAAAAAADQAAAAAAAAAAAAAADXAOOA7gE0gAABOwAAAWcBaAFrgAABbAAAAAAAAAAAAAAAAAFrAAABbQAAAW0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFngAABZ4FoAAAAAAAAAWcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABXQFdgAAAAAAAAAABXIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVgAAAWwAAAAAAAAAAAAAAWsBoIGqgAAAAAAAAAAAAAAAAADAKMAhACFA14AlgDmAIYAjgCLAJ0AqQCkABAAigEAAIMAkwDwAPEAjQCXAIgAwgDcAO8AngCqAPMA8gD0AKIArADIAMYArQBiAGMAkABkAMoAZQDHAMkAzgDLAMwAzQDnAGYA0QDPANAArgBnAO4AkQDUANIA0wBoAOkA6wCJAGoAaQBrAG0AbABuAKAAbwBxAHAAcgBzAHUAdAB2AHcA6AB4AHoAeQB7AH0AfAC3AKEAfwB+AIAAgQDqAOwAuQGWAZcBAgEDAQQBBQD7APwBmAGZAZoBmwD9AP4BBgEHAQgA/wGcAZ0BngGfAaABoQEJAQoBCwEMAaIBowD2APcBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswD4ANUBigGLAbQBtQG2AbcBuAENAQ4BuQG6AQ8BEAERARIA4ADhARMBFAG7AbwBFQEWAYwBvQG+Ab8BwAHBAcIBFwEYAK8AsAEZARoBwwHEARsBHAEdAR4BxQHGAPkA+gDiAOMBHwEgASEBIgHHAcgByQHKAcsBzAHNAc4BIwEkASUBJgHPAdAB0QHSAdMB1AC6AScBKAEpASoA5ADlAdUA1gDfANkA2gDbAN4A1wDdAe8B8AHxAdwB8gHzAfQB9gH3AfgB+QH6ASsB+wH8Af0B/gEsAf8CAAIBAgICAwIEAgUCBgIHAggCCQIKAS0CCwIMAg0CDgIPAhACEQISAhMCFAEuAhUCFgEvATACFwIYAhkCGgIbAhwCHQIeAh8CIAKMAiECIgExATICIwEzAiQCJQImAicCKAIpAioCKwKIAokFEAURAo0CjgKPApACkQKSApMClAKVApYClgKXApgCmQKaApsCnAKdAp4CnwLvA4EDgwOFA4cDiQONA48DkwOVA5kDnQOhA6UDqQOrA60DrwOxA7UDuQO9A8EDxQPJA80C8APRA9UD2QPdA+ED5QPpA+0D7wPxAvEC8gLzAvQC9QL2AvcC+AU4BTkFOgL5AvoC+wL8Av0C/gL/AwADAQMCAwMDBALsAwUFKAUsBTsFPAU+BUAFOQVCBUQFRgVIBUoFTgVSBVYFWgMfBV4FYgVmBWoFbgVyBXYDJwV6BX4FgAWCBYQFhgWIBYoFjAWOBZAFkgWUBZYFmAWaBZwDKwWeBaAFpAWoBawFsAW0BbYFugW7Bb8FwwXHBcsFzwXRAy0F0wXXBdsF3wXjAzEF5wXrBe8F8wX3BfsF/wYDBgcGCwYPBhEGEwYXA+sGGQYdBh8GIAYhBiIGJAYmBigGKgYsBi4GMAM1BjIGNAY4BjoGPgZABkIGRAMIBkUGRgZHBkgGSQZKBksGTAZNBk4GTwZQBlEGUgZTBlQGVQZWBlcGWAZZBloGTgZbAvkC+gL7AvwDCgMLAwwDAAMBAwIGXAZgBmQGaAZpBKQEpQSmBKcEqASpBKoEqwSsBK0ErgSvBLAEsQSyBLMEtAS1BLYEtwS4BLkEugS7BLwEvQS+BL8EwATBBMIEwwTEBMUExgTHBMgEyQTKBMsEzATNBM4EzwTQBNEE0gTTBNQE1QTWBNcE2ATZBNoE2wTcBN0E3gTfBOAE4QTiBOME5ATlBOYE5wToBOkE6gTrBOwE7QTuBO8E8ATxBPIE8wT0BPUB4wHkBPYE9wT4BPkE+gT7ALEAsgKKATQAtQC2AMMB5QCzALQAxACCAMEAhwNOA08DUgNQA1EDVQNWA1cDWANTA1QA9QHnAsAEfgC8AJkA7QDCAKUAkgE/AI8BQQF2AZEBkgGTAXcAuAF8Ae0B7gRxBHIEgQRzA1kDWgNbA1wDXQSEBHUEdwSFBHYEhgR5BIcEiASJBIoEiwSMBHgElASNBI4EjwSQBJEElgSaBJsEnASdBJ4ElwSYBJkEfQSfBKAEoQSiBKMGdAZ1BncCxgLeAt8C4ALhAuIC4wLkAuUC5gLnBTwFPQVSBVMFVAVVAx8DIAMhAyIFYgVjBWQFZQVOBU8FUAVRBV4FXwVgBWEFSgVLBUwFTQXDBcQFxQXGBcsFzAXNBc4FcgVzBXQFdQVuBW8FcAVxAycDKAMpAyoFegV7BXwFfQWIBYkFhgWHBYoFiwV+BX8DKwMsBZAFkQMtAy4DLwMwAzEDMgMzAzQF8wX0BfUF9gXrBewF7QXuBg8GEAYRBhIFTAVNBh0GHgZqBh8GawZsA+sD6gPrA+wGQAZBBkIGQwXfBeAF4QXiBigGKQYmBicGKgYrBUYGMAYxBiQGJQYsBi0GOgY7BjwGPQM1AzYD8wP0AAABBgAAAQAAAAAAAAABAgAAAAIAAAAAAAAAAAAAAAAAAAABAAADBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYQBiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqqwOsra6vsLGys7S1tre4ubq7vL2+v8DBwsPExcbHyMnKy8zNzs/QANHS09TV1tfY2drb3N3e3wAECyQAAAEcAQAABwAcAH4BfwGPAZIBoQGwAdwB/wJZAscCyQLdAwEDAwMJAyMDfgOKA4wDoQPOBAwETwRcBF8EkwSXBJ0EowSzBLsE2QTpBcMF6gX0BgwGGwYfBjoGVQbtBv4ehR75IA8gFSAeICIgJiAuIDAgMyA6IDwgPiBEIG8gfyCkIKcgrCEFIRMhFiEiISYhLiFUIV4hlSGoIgIiBiIPIhIiFSIaIh8iKSIrIkgiYSJlIwIjECMhJQAlAiUMJRAlFCUYJRwlJCUsJTQlPCVsJYAlhCWIJYwlkyWhJawlsiW6JbwlxCXLJc8l2SXmJjwmQCZCJmAmYyZmJmvoBegY6DrwAvAx+wL7IPs2+zz7PvtB+0T7sfvn+//8Yv0//fL+/P/8//8AAAAgAKABjwGSAaABrwHNAfoCWQLGAskC2AMAAwMDCQMjA34DhAOMA44DowQBBA4EUQReBJAElgSaBKIErgS4BNgE6AWwBdAF8AYMBhsGHwYhBkAGYAbwHoAeoCAMIBMgFyAgICYgKiAwIDIgOSA8ID4gRCBqIH8goyCnIKohBSETIRYhIiEmIS4hUyFbIZAhqCICIgYiDyIRIhUiGSIeIikiKyJIImAiZCMCIxAjICUAJQIlDCUQJRQlGCUcJSQlLCU0JTwlUCWAJYQliCWMJZAloCWqJbIluiW8JcQlyiXPJdgl5iY6JkAmQiZgJmMmZSZq6AHoGOg68AHwBPsB+x37Kvs4+z77QPtD+0b70/v8/F79Pv3y/oD//P///+MAAAOV/xQCygK9Ay//3ALMAAD+DwAAAZIBdwFrAXL8oAAA/mkAAAAA/iv+Kv4p/igAAAB8AHoAdgBsAGgATAA+AAD80PzL/OD80vzPAAAAAAAAAADjXQAA4twAAAAAAADghQAA4JXhW+CE4PnhqOB3AADgtwAA4JAAAOCK4H3hdd9q33nguuMs4I7fqN+W3pbeot6LAADepgAAAADfF95x3l8AAN4w3kDeM94k3EbcRdw83DncNtwz3DDcKdwi3BvcFNwB2+7b69vo2+Xb4gAAAADbxtu/277btwAA28Xbpduv20XbQttB2yTbItsh2x4awBr6GuEQvgAABb4AAAedB5wHmweaB5kAAAAAAAAG6QY+BY0FAANjAAEAAAEaAAAAAAAAAAAAAAAAAAACygAAAsoAAAAAAAAAAAAAAsoAAALUAvoAAAAAAAAAAANIAAAAAAAAAAAAAAAAAAADQAAAAAAAAAAAAAADXAOOA7gE0gAABOwAAAWcBaAFrgAABbAAAAAAAAAAAAAAAAAFrAAABbQAAAW0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFngAABZ4FoAAAAAAAAAWcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABXQFdgAAAAAAAAAABXIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVgAAAWwAAAAAAAAAAAAAAWsBoIGqgAAAAAAAAAAAAAAAAADAKMAhACFA14AlgDmAIYAjgCLAJ0AqQCkABAAigEAAIMAkwDwAPEAjQCXAIgAwgDcAO8AngCqAPMA8gD0AKIArADIAMYArQBiAGMAkABkAMoAZQDHAMkAzgDLAMwAzQDnAGYA0QDPANAArgBnAO4AkQDUANIA0wBoAOkA6wCJAGoAaQBrAG0AbABuAKAAbwBxAHAAcgBzAHUAdAB2AHcA6AB4AHoAeQB7AH0AfAC3AKEAfwB+AIAAgQDqAOwAuQGWAZcBAgEDAQQBBQD7APwBmAGZAZoBmwD9AP4BBgEHAQgA/wGcAZ0BngGfAaABoQEJAQoBCwEMAaIBowD2APcBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswD4ANUBigGLAbQBtQG2AbcBuAENAQ4BuQG6AQ8BEAERARIA4ADhARMBFAG7AbwBFQEWAYwBvQG+Ab8BwAHBAcIBFwEYAK8AsAEZARoBwwHEARsBHAEdAR4BxQHGAPkA+gDiAOMBHwEgASEBIgHHAcgByQHKAcsBzAHNAc4BIwEkASUBJgHPAdAB0QHSAdMB1AC6AScBKAEpASoA5ADlAdUA1gDfANkA2gDbAN4A1wDdAe8B8AHxAdwB8gHzAfQB9gH3AfgB+QH6ASsB+wH8Af0B/gEsAf8CAAIBAgICAwIEAgUCBgIHAggCCQIKAS0CCwIMAg0CDgIPAhACEQISAhMCFAEuAhUCFgEvATACFwIYAhkCGgIbAhwCHQIeAh8CIAKMAiECIgExATICIwEzAiQCJQImAicCKAIpAioCKwKIAokFEAURAo0CjgKPApACkQKSApMClAKVApYClgKXApgCmQKaApsCnAKdAp4CnwLvA4EDgwOFA4cDiQONA48DkwOVA5kDnQOhA6UDqQOrA60DrwOxA7UDuQO9A8EDxQPJA80C8APRA9UD2QPdA+ED5QPpA+0D7wPxAvEC8gLzAvQC9QL2AvcC+AU4BTkFOgL5AvoC+wL8Av0C/gL/AwADAQMCAwMDBALsAwUFKAUsBTsFPAU+BUAFOQVCBUQFRgVIBUoFTgVSBVYFWgMfBV4FYgVmBWoFbgVyBXYDJwV6BX4FgAWCBYQFhgWIBYoFjAWOBZAFkgWUBZYFmAWaBZwDKwWeBaAFpAWoBawFsAW0BbYFugW7Bb8FwwXHBcsFzwXRAy0F0wXXBdsF3wXjAzEF5wXrBe8F8wX3BfsF/wYDBgcGCwYPBhEGEwYXA+sGGQYdBh8GIAYhBiIGJAYmBigGKgYsBi4GMAM1BjIGNAY4BjoGPgZABkIGRAMIBkUGRgZHBkgGSQZKBksGTAZNBk4GTwZQBlEGUgZTBlQGVQZWBlcGWAZZBloGTgZbAvkC+gL7AvwDCgMLAwwDAAMBAwIGXAZgBmQGaAZpBKQEpQSmBKcEqASpBKoEqwSsBK0ErgSvBLAEsQSyBLMEtAS1BLYEtwS4BLkEugS7BLwEvQS+BL8EwATBBMIEwwTEBMUExgTHBMgEyQTKBMsEzATNBM4EzwTQBNEE0gTTBNQE1QTWBNcE2ATZBNoE2wTcBN0E3gTfBOAE4QTiBOME5ATlBOYE5wToBOkE6gTrBOwE7QTuBO8E8ATxBPIE8wT0BPUB4wHkBPYE9wT4BPkE+gT7ALEAsgKKATQAtQC2AMMB5QCzALQAxACCAMEAhwNOA08DUgNQA1EDVQNWA1cDWANTA1QA9QHnAsAEfgC8AJkA7QDCAKUAkgE/AI8BQQF2AZEBkgGTAXcAuAF8Ae0B7gRxBHIEgQRzA1kDWgNbA1wDXQSEBHUEdwSFBHYEhgR5BIcEiASJBIoEiwSMBHgElASNBI4EjwSQBJEElgSaBJsEnASdBJ4ElwSYBJkEfQSfBKAEoQSiBKMGdAZ1BncCxgLeAt8C4ALhAuIC4wLkAuUC5gLnBTwFPQVSBVMFVAVVAx8DIAMhAyIFYgVjBWQFZQVOBU8FUAVRBV4FXwVgBWEFSgVLBUwFTQXDBcQFxQXGBcsFzAXNBc4FcgVzBXQFdQVuBW8FcAVxAycDKAMpAyoFegV7BXwFfQWIBYkFhgWHBYoFiwV+BX8DKwMsBZAFkQMtAy4DLwMwAzEDMgMzAzQF8wX0BfUF9gXrBewF7QXuBg8GEAYRBhIFTAVNBh0GHgZqBh8GawZsA+sD6gPrA+wGQAZBBkIGQwXfBeAF4QXiBigGKQYmBicGKgYrBUYGMAYxBiQGJQYsBi0GOgY7BjwGPQM1AzYD8wP0AABAQ1VUQUA/Pj08Ozo5ODc1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAsRSNGYCCwJmCwBCYjSEgtLEUjRiNhILAmYbAEJiNISC0sRSNGYLAgYSCwRmCwBCYjSEgtLEUjRiNhsCBgILAmYbAgYbAEJiNISC0sRSNGYLBAYSCwZmCwBCYjSEgtLEUjRiNhsEBgILAmYbBAYbAEJiNISC0sARAgPAA8LSwgRSMgsM1EIyC4AVpRWCMgsI1EI1kgsO1RWCMgsE1EI1kgsJBRWCMgsA1EI1khIS0sICBFGGhEILABYCBFsEZ2aIpFYEQtLAGxCwpDI0NlCi0sALEKC0MjQwstLACwFyNwsQEXPgGwFyNwsQIXRTqxAgAIDS0sRbAaI0RFsBkjRC0sIEWwAyVFYWSwUFFYRUQbISFZLSywAUNjI2KwACNCsA8rLSwgRbAAQ2BELSwBsAZDsAdDZQotLCBpsEBhsACLILEswIqMuBAAYmArDGQjZGFcWLADYVktLEWwESuwFyNEsBd65BgtLEWwESuwFyNELSywEkNYh0WwESuwFyNEsBd65BsDikUYaSCwFyNEioqHILCgUViwESuwFyNEsBd65BshsBd65FlZGC0sLSywAiVGYIpGsEBhjEgtLEtTIFxYsAKFWViwAYVZLSwgsAMlRbAZI0RFsBojREVlI0UgsAMlYGogsAkjQiNoimpgYSCwGoqwAFJ5IbIaGkC5/+AAGkUgilRYIyGwPxsjWWFEHLEUAIpSebMZQCAZRSCKVFgjIbA/GyNZYUQtLLEQEUMjQwstLLEOD0MjQwstLLEMDUMjQwstLLEMDUMjQ2ULLSyxDg9DI0NlCy0ssRARQyNDZQstLEtSWEVEGyEhWS0sASCwAyUjSbBAYLAgYyCwAFJYI7ACJTgjsAIlZTgAimM4GyEhISEhWQEtLEuwZFFYRWmwCUNgihA6GyEhIVktLAGwBSUQIyCK9QCwAWAj7ewtLAGwBSUQIyCK9QCwAWEj7ewtLAGwBiUQ9QDt7C0sILABYAEQIDwAPC0sILABYQEQIDwAPC0ssCsrsCoqLSwAsAdDsAZDCy0sPrAqKi0sNS0sdrgCIyNwECC4AiNFILAAUFiwAWFZOi8YLSwhIQxkI2SLuEAAYi0sIbCAUVgMZCNki7ggAGIbsgBALytZsAJgLSwhsMBRWAxkI2SLuBVVYhuyAIAvK1mwAmAtLAxkI2SLuEAAYmAjIS0stAABAAAAFbAIJrAIJrAIJrAIJg8QFhNFaDqwARYtLLQAAQAAABWwCCawCCawCCawCCYPEBYTRWhlOrABFi0sS1MjS1FaWCBFimBEGyEhWS0sS1RYIEWKYEQbISFZLSxLUyNLUVpYOBshIVktLEtUWDgbISFZLSywE0NYAxsCWS0ssBNDWAIbA1ktLEtUsBJDXFpYOBshIVktLLASQ1xYDLAEJbAEJQYMZCNkYWS4BwhRWLAEJbAEJQEgRrAQYEggRrAQYEhZCiEhGyEhWS0ssBJDXFgMsAQlsAQlBgxkI2RhZLgHCFFYsAQlsAQlASBGuP/wYEggRrj/8GBIWQohIRshIVktLEtTI0tRWliwOisbISFZLSxLUyNLUVpYsDsrGyEhWS0sS1MjS1FasBJDXFpYOBshIVktLAyKA0tUsAQmAktUWoqKCrASQ1xaWDgbISFZLSxLUliwBCWwBCVJsAQlsAQlSWEgsABUWCEgQ7AAVViwAyWwAyW4/8A4uP/AOFkbsEBUWCBDsABUWLACJbj/wDhZGyBDsABUWLADJbADJbj/wDi4/8A4G7ADJbj/wDhZWVlZISEhIS0sRiNGYIqKRiMgRopgimG4/4BiIyAQI4q5AsICwopwRWAgsABQWLABYbj/uosbsEaMWbAQYGgBOi0ssQIAQrEjAYhRsUABiFNaWLkQAAAgiFRYsgIBAkNgQlmxJAGIUVi5IAAAQIhUWLICAgJDYEKxJAGIVFiyAiACQ2BCAEsBS1JYsgIIAkNgQlkbuUAAAICIVFiyAgQCQ2BCWblAAACAY7gBAIhUWLICCAJDYEJZuUAAAQBjuAIAiFRYsgIQAkNgQlm5QAACAGO4BACIVFiyAkACQ2BCWVlZWVktLLACQ1RYS1MjS1FaWDgbISFZGyEhISFZLQAAsVQPQSIDFwDvAxcA/wMXAAMAHwMXAC8DFwBPAxcAXwMXAI8DFwCfAxcABgAPAxcAXwMXAG8DFwB/AxcAvwMXAPADFwAGAEADF7KSM0C4AxeyizNAuAMXs2psMkC4AxeyYTNAuAMXs1xdMkC4AxezV1kyQLgDF7NNUTJAuAMXs0RJMkC4AxeyOjNAuAMXszE0MkC4AxezLkIyQLgDF7MnLDJAuAMXsxIlMoC4AxezCg0ywEEWAxYA0AMWAAIAcAMWAAECxAAPAQEAHwCgAxUAsAMVAAIDBgAPAQEAHwBAAxKzJCYyn78DBAABAwIDAQBkAB//wAMBsg0RMkEKAv8C7wASAB8C7gLtAGQAH//AAu2zDhEyn0FKAuIArwLiAL8C4gADAuIC4gLhAuEAfwLgAAEAEALgAD8C4ACfAuAAvwLgAM8C4ADvAuAABgLgAuAC3wLfAt4C3gAPAt0ALwLdAD8C3QBfAt0AnwLdAL8C3QDvAt0ABwLdAt0AEALcAAEAAALcAAEAEALcAD8C3AACAtwC3AAQAtsAAQLbAtsADwLaAAEC2gLa/8AC07I3OTK5/8AC07IrLzK5/8AC07IfJTK5/8AC07IXGzK5/8AC07ISFjK4AtKy+SkfuALjsyArH6BBMALUALAC1AACAAAC1AAQAtQAIALUAFAC1ABgAtQAcALUAAYAYALWAHAC1gCAAtYAkALWAKAC1gCwAtYABgAAAtYAEALWACACygAgAswAIALWADAC1gBAAtYAUALWAAgC0LIgKx+4As+yJkIfQRYCzgLHABcAHwLNAsgAFwAfAswCxgAXAB8CywLFABcAHwLJAsUAHgAfAsoCxrIeHwBBCwLGAAACxwAQAsYAEALHAC8CxQAFAsGzJBIf/0ERAr8AAQAfAr8ALwK/AD8CvwBPAr8AXwK/AI8CvwAGAr8CIrJkHxJBCwK7AMoIAAAfArIA6QgAAB8CpgCiCABAah9AJkNJMkAgQ0kyQCY6PTJAIDo9Mp8gnyYCQCaWmTJAIJaZMkAmjpIyQCCOkjJAJoSMMkAghIwyQCZ6gTJAIHqBMkAmbHYyQCBsdjJAJmRqMkAgZGoyQCZaXzJAIFpfMkAmT1QyQCBPVDK4Ap63JCcfN09rASBBDwJ3ADACdwBAAncAUAJ3AAQCdwJ3AncA+QQAAB8Cm7IqKh+4AppAKykqH4C6AYC8AYBSAYCiAYBlAYB+AYCBAYA8AYBeAYArAYAcAYAeAYBAAYC7ATgAAQCAAUC0AYBAAYC7ATgAAQCAATlAGAGAygGArQGAcwGAJgGAJQGAJAGAIAE3QLgCIbJJM0C4AiGyRTNAuAIhs0FCMkC4AiGzPT4yD0EPAiEAPwIhAH8CIQADAL8CIQDPAiEA/wIhAAMAQAIhsyAiMkC4AiGzGR4yQLgCIrMqPzJAuAIhsy46Mm9BSALDAH8CwwCPAsMA3wLDAAQALwLDAGACwwDPAsMAAwAPAsMAPwLDAF8CwwDAAsMA7wLDAP8CwwAGAN8CIgABAI8CIgABAA8CIgAvAiIAPwIiAF8CIgB/AiIA7wIiAAYAvwIhAO8CIQACAG8CIQB/AiEArwIhAAMALwIhAD8CIQBPAiEAAwLDAsMCIgIiAiECIUAdEBwQKxBIA48cAQ8eAU8e/x4CNwAWFgAAABIRCBG4AQ229w349w0ACUEJAo4CjwAdAB8CkAKPAB0AHwKPsvkdH7gBmLImux9BFQGXAB4EAQAfATkAJgElAB8BOABzBAEAHwE1ABwIAQAfATQAHAKrAB8BMrIcVh+4AQ+yJiwfugEOAB4EAbYf+RzkH+kcuAIBth/oHLsf1yC4BAGyH9UcuAKrth/UHIkfyS+4CAGyH7wmuAEBsh+6ILgCAbYfuRw4H63KuAQBsh+BJrgBmrIffia4AZq2H30cRx9rHLgEAbIfZSa4AZqyH15zuAQBQA8fUiZaH0gciR9EHGIfQHO4CAG2Hz8cXh88JrgBmrIfNRy4BAG2HzAcux8rHLgEAbYfKhxWHykcuAEBsh8jHrgEAbIfVTe4AWhALAeWB1gHTwc2BzIHLAchBx8HHQcbBxQIEggQCA4IDAgKCAgIBggECAIIAAgUuP/gQCsAAAEAFAYQAAABAAYEAAABAAQQAAABABACAAABAAIAAAABAAACAQgCAEoAsBMDSwJLU0IBS7DAYwBLYiCw9lMjuAEKUVqwBSNCAbASSwBLVEKwOCtLuAf/UrA3K0uwB1BbWLEBAY5ZsDgrsAKIuAEAVFi4Af+xAQGOhRuwEkNYuQABARGFjRu5AAEBKIWNWVkAGBZ2Pxg/Ej4ROUZEPhE5RkQ+ETlGRD4ROUZEPhE5RmBEPhE5RmBEKysrKysrKysrKysYKysrKysrKysrKysYKx2wlktTWLCqHVmwMktTWLD/HVlLsJNTIFxYuQHyAfBFRLkB8QHwRURZWLkDPgHyRVJYuQHyAz5EWVlLuAFWUyBcWLkAIAHxRUS5ACYB8UVEWVi5CB4AIEVSWLkAIAgeRFlZS7gBmlMgXFi5ACUB8kVEuQAkAfJFRFlYuQkJACVFUli5ACUJCURZWUu4BAFTIFxYsXMkRUSxJCRFRFlYuRcgAHNFUli5AHMXIERZWUu4BAFTIFxYscolRUSxJSVFRFlYuRaAAMpFUli5AMoWgERZWUuwPlMgXFixHBxFRLEeHEVEWVi5ARoAHEVSWLkAHAEaRFlZS7BWUyBcWLEcHEVEsS8cRURZWLkBiQAcRVJYuQAcAYlEWVlLuAMBUyBcWLEcHEVEsRwcRURZWLkN4AAcRVJYuQAcDeBEWVkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK2VCKysBsztZY1xFZSNFYCNFZWAjRWCwi3ZoGLCAYiAgsWNZRWUjRSCwAyZgYmNoILADJmFlsFkjZUSwYyNEILE7XEVlI0UgsAMmYGJjaCCwAyZhZbBcI2VEsDsjRLEAXEVUWLFcQGVEsjtAO0UjYURZs0dQNDdFZSNFYCNFZWAjRWCwiXZoGLCAYiAgsTRQRWUjRSCwAyZgYmNoILADJmFlsFAjZUSwNCNEILFHN0VlI0UgsAMmYGJjaCCwAyZhZbA3I2VEsEcjRLEAN0VUWLE3QGVEskdAR0UjYURZAEtTQgFLUFixCABCWUNcWLEIAEJZswILChJDWGAbIVlCFhBwPrASQ1i5OyEYfhu6BAABqAALK1mwDCNCsA0jQrASQ1i5LUEtQRu6BAAEAAALK1mwDiNCsA8jQrASQ1i5GH47IRu6AagEAAALK1mwECNCsBEjQgArdHVzdQAYRWlERWlERWlEc3Nzc3R1c3R1KysrK3R1KysrKytzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3NzKysrRbBAYURzdAAAS7AqU0uwP1FaWLEHB0WwQGBEWQBLsDpTS7A/UVpYsQsLRbj/wGBEWQBLsC5TS7A6UVpYsQMDRbBAYERZAEuwLlNLsDxRWlixCQlFuP/AYERZKysrKysrKysrKysrKysrKysrdSsrKysrKytDXFi5AIACu7MBQB4BdABzWQOwHktUArASS1RasBJDXFpYugCfAiIAAQBzWQArdHMBKwFzKysrKysrKytzc3NzKwArKysrKysARWlEc0VpRHNFaURzdHVFaURzRWlERWlERWlEc3RFaURFaURzKysrKytzKwArcyt0dSsrKysrKysrKysrKysrc3R1KwAFugAZBboAGgWnABkEJgAYAAD/5wAA/+gAAP/n/mn/6AW6ABn+af/oAuoAAAC4AAAAuAAAAAAAqACtAWkArQC/AMIB8AAYAK8AuQC0AMgAFwBEAJwAfACUAIcABgBaAMgAiQBSAFIABQBEAJQBGf+0AC8AoQADAKEAzQAXAFcAfgC6ABYBGP/pAH8AhQPTAIcAhQANACIAQQBQAG8AjQFM/3UAXADfBIMANwBMAG4AcAGA/1j/jv+S/6QApQC5A8j//QALABoAYwBjAM3/7gXY/9wALQBcAJUAmQDfAZIJtQBAAFcAgAC5A50AcgCaA10EAf9n//oAAwAhAHcAzQAEAE0AzQHAAisATABlAOcBGAF8A0MF2P+j/7D/xAADABwAXQBoAJoAugE1AUcCIQVc/03/zQAWAC0AeACAAJkAsgC2ALYAuAC9ANoBDAXw/6T/8AAZACwASQB/ALQAzgHAA/79gf4/AAAABQAYACkAOQBJAG8AvgDHANABIwHBAm8FDAUyBUAFev/UABQAMQBVAFcApwC0AOYB9wJ+An4CfwPGBEb/QgAOAIUAkQC/AMIAxQDhARoBLwFPAVYCKQJvAp4DcgAIACwAMQAxAGQAaQCJAJgAxwDeASsBtgIMAs8DowSrBPsGHf7g/w4ABgAmAJsAnQDBAQ0BGAEgAXMBggHWAeMCQwJfApsC4gOUBKkE0gdhABwAXgBtAI0AqwD3ARIBOAFRAVsBaAF8AYcBkQGZAc0B0AHoAkECVAJrAu8DaANxA70EQgRCBFMEcwSDBYYFiwbo/lj+xP7R/vf/Mv+GAFEAfACBAJEAlQCeALQAuQDPANkA2QDfAOIBBQELAQ4BDgEgASEBVQF7AXsBfgGNAaIBqAGpAbQB0AHQAeIB6QHyAfUB+wIAAgACBgIbAiECIgIiAiMCcgJ3ApQCnALPAs8C0ALsAvkDFwMiAysDNQM8A1kDbwNxA4cDkAOQA7UD4QQaBM8E/wUyBTIFlgWfBagFqwXCBfAGDAeCCAAIzPyj/Sr93v4A/oj+lv6y/rT/4QAVABkAGgAcAB8APABRAGEAYQBqAHgAlgClAK8A0wEMARgBGgEqAT4BTAFRAV8BagFxAXgBggGEAZoBpQGoAakBrgG8Ac0B1wHvAgACDQIcAiECIgIuAjUCQgJPAk8CXgJlAnECkAKSArQC1gL6AwcDCwMPAxUDKgNHA10DZQN0A3kDlgOwA8wD3QPiA/YD/AP8A/8ECgQfBCIEJgQrBEcEXwR1BJ4E5wTnBVwFywXlBgoGbQaGBrgG8Qc2Bz4HUAdRB10Hjwe2B9QIYAC2AMMAtQC3AAAAAAAAAAAAAAAAAeADgQNFA7UAjgIzBBkCzgLOAC0AXwBkA00CPwAAAqgBiAJ9AbQCJAV4BjsCOwFOAPAEJgKUAsYCnwL2AjsDTQFLAVMAagIxAAAAAAAABhQEqgAAADwEwwDtBLwCZQLOA7UAeAYMAX4C7wYMALIBAAI5AAABxQMwBCsDywDaA98BBwShANsECgEXAe0CpwNQAQsBvQQ+BVgAIQOcAK4DcQF9ALUCRQAACvsIjAErAU4BqgCHAFQBMgH4A/8AAwJOALQANwPjAIMAawLYAO0AdwCIAJcBZARnAI4AMwF8AOcApgKeAykFbgYqBhUByQJpBIoCEwG0AAIEqQAAAjkBJAEDBRQAhAFdA5oG7wLZAHUAzwQKAN4DrAS8As8CrgNNBPAFUgFoAG0AfQCGAHH/gQB5BVgE0gFnAAMBVgAlBOAAlAB8AzIEIQCUAH8AcgBcAC8AtgAYALoAuABBA00AcgAYAB8ATAFqAVUAmQCaAJoAmACyAAQAeABpABQAVwBuAM4AtAZUArgAZwUOAWUA5wAABMv+UgBa/6YAmf9nAG7/kgAt/9QAh/98ALgAqADlAI8AqAGF/nsAcAAeANkA3gFMBUYCzwVG/y0CigLZAlMClgC3AAAAAAAAAAAAAAAAAAABJQEYAOoA6gCuAAAAPgW7AIoE1wBTAD//jP/VABUAKAAiAJkAYgBKAOQAbQDuAOUASAPAADP+TgKx/0YDcAB5Bd8AUf+n/x8BCgBo/2wATwC8AKUHBQBhBysAAAAAAAAAKgAAACoAAAAqAAAAKgAAANYAAAF+AAADIAAABaYAAAdOAAAJOAAACX4AAAn+AAAKpAAAC4QAAAvsAAAMZAAADKoAAAzmAAANVgAADxIAAA/uAAASGAAAE/IAABVSAAAXDAAAGOIAABmOAAAcIgAAHlYAAB6yAAAfcAAAH/IAACBiAAAg6AAAIdoAACPaAAAlhAAAJxwAAChWAAApngAAKmIAACsYAAAsqAAALa4AAC6SAAAvegAAMbAAADI6AAA1ZAAANw4AADhCAAA5SAAAOzwAAD2oAABAUgAAQQAAAEIkAABDmAAARdYAAEjiAABKiAAAS8gAAEwyAABMnAAATQAAAE2IAABNvAAATjgAAFEKAABS6AAAVJwAAFZQAABYDgAAWWIAAFtSAABc9gAAXeoAAF8CAABhmgAAYpYAAGTGAABmjAAAaE4AAGoSAABrqAAAbK4AAHBWAABxegAAcxgAAHU2AAB5oAAAe8QAAH4cAACABAAAgQIAAIFOAACCUAAAgvAAAIM8AACDcAAAg6wAAIPuAACEVAAAhJoAAITOAACFBAAAhToAAIWKAACFzAAAhh4AAIZWAACGqAAAht4AAIceAACHYAAAh54AAIfoAACIKAAAiFYAAIiOAACI3gAAiRQAAIlUAACJjgAAidIAAIocAACKWAAAiogAAIrMAACLBAAAi5QAAIwaAACOKAAAj7wAAJFsAACRuAAAkkwAAJRwAACWxAAAmLQAAJmgAACaIgAAmowAAJuqAACdBgAAn04AAKCwAAChPgAAoegAAKKsAACj9AAApZ4AAKaMAACnUgAAp7YAAKgkAACpTgAAqnIAAKsCAACs5AAArz4AALKQAACzhgAAtCwAALR8AAC1MgAAtlIAALfwAAC4igAAuU4AALoOAAC6dgAAurIAALsKAAC7WAAAvXAAAL+2AAC/7gAAwCAAAMFKAADCdgAAwyQAAMPIAADEagAAxTwAAMWQAADFxgAAxh4AAMdwAADH4gAAyDwAAMm0AADLIAAAzAAAAMwyAADMzgAAzfIAANBoAADQogAA0OYAANEiAADRhAAA0cYAANIMAADSWAAA0ooAANLeAADTHAAA00wAANOKAADT0AAA1BIAANRQAADU0gAA1UAAANYmAADWYgAA1uIAANcWAADXuAAA2EAAANisAADZOAAA2aQAANqQAADbggAA27YAANvqAADcGgAA3F4AANzWAADeUAAA4GoAAOCcAADg1gAA4dAAAONeAADjlAAA5PgAAOV0AADmVAAA50oAAOjaAADqRAAA7DIAAO0uAADtdAAA7agAAO3qAADuJAAA7ngAAO7AAADvCgAA7zoAAO9qAADxUgAA8ZAAAPHKAADx+gAA8i4AAPJeAADyigAA8tIAAPSIAAD2AgAA9i4AAPZwAAD2tAAA9uQAAPcUAAD3agAA+EgAAPlaAAD5ngAA+dQAAPouAAD6bAAA+qAAAPrQAAD7DAAA+0wAAPuKAAD7xgAA/AgAAPw+AAD8egAA/LoAAP3IAAD/NAAA/4QAAQDgAAEBNgABAWoAAQG4AAECBAABAkYAAQJ+AAECtAABAvwAAQOeAAEFOgABBwIAAQiEAAEKdgABC8gAAQ1MAAEOLgABD8gAARAyAAEQWgABEPgAARN6AAETugABE/oAARQ6AAEUeAABFNYAARU0AAEVogABFcIAARasAAEXTAABF4IAARfQAAEYGgABGGQAARiAAAEYnAABGLwAARjcAAEY/AABGRwAARlCAAEZaAABGY4AARm0AAEZ5AABGgwAARo0AAEaYAABGowAARrAAAEa6gABGxYAARtMAAEbdgABG6IAARvYAAEcAgABHCwAARxgAAEckAABHMQAAR0IAAEdOAABHWwAAR2uAAEd4gABHhQAAR5WAAEeigABHroAAR78AAEfQAABH4YAAR/iAAEf/gABIBoAASA2AAEgUgABIG4AASHcAAEkrAABJxwAASc4AAEnUgABJ24AASeKAAEnpgABJ8IAASgeAAEoWAABKMIAASmMAAEqLAABKwIAASuCAAEsCgABLHoAAS0QAAEtbgABLbQAAS4SAAEudAABLywAAS/qAAEwFgABMHIAATC2AAEyIgABMxYAATNAAAEzXAABM4gAATPAAAE0DAABNEwAATSAAAE0sAABNOAAATUQAAE1VAABNYQAATW0AAE19AABNiQAATZUAAE2hAABNsQAATb0AAE3JAABN1QAATeCAAE5hgABObYAATnmAAE7NgABPOwAAT0cAAE9SgABPXoAAT2oAAE92AABPgYAAT80AAFAYgABQJIAAUICAAFCOgABQmoAAUP8AAFEKgABRFgAAUSGAAFErgABRgwAAUekAAFH3AABSBwAAUhYAAFIiAABSLYAAUjSAAFJAgABSTIAAUoiAAFLigABS7oAAUv0AAFMNAABTGQAAUyUAAFM1gABTnYAAVBWAAFQlgABUNYAAVEGAAFRRgABUjAAAVKwAAFTlAABU8QAAVP0AAFUJAABVFQAAVSQAAFUwgABVPQAAVUkAAFVVAABVZoAAVXMAAFV/AABVjIAAVakAAFW2AABWKYAAVmoAAFbOAABXWgAAV+4AAFhSgABYa4AAWI4AAFiSAABYtYAAWTUAAFmAAABZ2wAAWhcAAFp4AABa/oAAW4mAAFvGAABbygAAW84AAFwUAABcGAAAXBwAAFwgAABcJAAAXCgAAFxvgABcc4AAXHeAAFyUgABcmIAAXMyAAFzQgABdFQAAXRkAAF0dAABdIQAAXXiAAF3wAABeAIAAXg4AAF4bgABeJ4AAXjOAAF5IgABeUoAAXrUAAF8HAABfXAAAX7YAAGAXAABgMAAAYJSAAGDbgABg34AAYOOAAGFFAABhSQAAYaKAAGH5AABiRgAAYp2AAGL5AABjaoAAY3qAAGOIgABjlgAAY5+AAGOrgABjtQAAZBKAAGQegABkbAAAZHAAAGR0AABkhIAAZIiAAGTtgABlWIAAZbsAAGXFAABl0QAAZigAAGYsAABmegAAZn4AAGakgABm/IAAZwCAAGeaAABn/IAAaFaAAGhigABowAAAaQyAAGkQgABpFIAAaRiAAGlPAABpUwAAaVcAAGlbAABpmQAAafeAAGn7gABqRYAAapKAAGrnAABrTAAAa5OAAGv2gABsOwAAbEiAAGzWAABs/gAAbQIAAG1ngABt0AAAbfEAAG5RgABuVYAAbu+AAG9PgABvr4AAb7uAAHAjgABwhQAAcPYAAHFBAABxRQAAcZEAAHGVAABxmQAAcckAAHHNAAByRoAAckqAAHKYAABy24AAc0aAAHO0AAB0BIAAdGCAAHSygAB0xwAAdT+AAHWegAB1rgAAdheAAHYggAB2cIAAdnSAAHZ4gAB2hoAAdoqAAHbtgAB3SQAAd6YAAHevAAB3uwAAeBaAAHhDAAB4coAAeH4AAHjrgAB5KYAAeU0AAHmYAAB5xQAAefuAAHoOAAB6LYAAel8AAHppAAB6e4AAepEAAHrMAAB63oAAeuuAAHr1gAB6/4AAewyAAHsdgAB7LoAAez4AAHuNgAB7u4AAfAOAAHwhAAB8VIAAfGkAAHyNgAB8uYAAfPaAAH0LgAB9MQAAfWCAAH2bAAB9x4AAfg+AAH4kAAB+ToAAfpwAAH7SAAB/C4AAf00AAH+GgAB/vwAAf/wAAIAjgACAZQAAgKOAAIDBgACA34AAgP0AAIEKgACBIYAAgVOAAIF2gACBhIAAgZYAAIGiAACBvIAAgeyAAIH5gACCBYAAghKAAIIegACCKoAAgjaAAIKegACCrIAAgryAAILKgACC2IAAgv+AAIM+AACDSgAAg3MAAIN+gACDjoAAg6KAAIOugACDwYAAhCeAAISBAACE2QAAhOqAAIT/gACFDYAAhWoAAIV3gACFnAAAhauAAIW3AACFxoAAhhKAAIYcgACGa4AAho+AAIa6AACG2oAAhwmAAIdPgACHkwAAh6AAAIfBgACIGIAAiDkAAIhLgACIjgAAiKAAAIjhAACJAAAAiRYAAIk3AACJcYAAibcAAIn2AACKIIAAilyAAIqRAACKy4AAiwWAAIsxgACLUgAAi+mAAIv0AACL/oAAjCyAAIw3AACMh4AAjMkAAI0DgACNDgAAjRiAAI0jAACNLYAAjTgAAI2YAACNooAAja0AAI23gACNwgAAjcyAAI3XAACN4YAAjewAAI35AACOA4AAjg4AAI4YgACOdwAAjnsAAI7BgACOxYAAjtAAAI7agACO5QAAju+AAI9aAACP4QAAkCyAAJAwgACQj4AAkJOAAJDlAACRWAAAkZmAAJH5gACSYYAAkuqAAJNBAACTuYAAlAqAAJRWAACUYIAAlGsAAJR1gACUgAAAlIqAAJSVAACUn4AAlKoAAJS0gACUvwAAlMmAAJTUAACU3oAAlOkAAJTzgACU/gAAlY0AAJXsAACWPQAAlrcAAJcJAACXE4AAlx4AAJcqAACXNgAAl0oAAJdeAACXbgAAl4qAAJefgACXtwAAl8yAAJfaAACX6oAAl/wAAJgOgACYGoAAmCiAAJg0gACYgoAAmVQAAJlegACZaQAAmXOAAJl+AACZiIAAmZMAAJmdgACZqAAAmbKAAJm9AACZx4AAmdIAAJncgACZ5wAAmfGAAJn8AACaBoAAmhEAAJobgACaJgAAmjCAAJo7AACaRYAAmlAAAJpagACaZQAAmm+AAJp6AACaoYAAmqcAAJqxgACbaYAAm22AAJu0AACb/IAAnEwAAJycgACdBgAAnQoAAJ1agACdroAAniqAAJ6fgACe5YAAnumAAJ8KAACfLYAAn22AAJ9xgACfmYAAn52AAJ/jAACgN4AAoIOAAKCHgACguwAAoL8AAKEcgAChIIAAoWWAAKFpgAChtoAAohwAAKJLAACiTwAAoo6AAKLlAACjCAAAowwAAKNWgACjuYAAo+iAAKPsgACkE4AApBeAAKRLAACkTwAApIUAAKSJAACkywAApM8AAKVAgAClRIAApZqAAKWegACmOQAApj0AAKa7gACmv4AApxoAAKceAACnWgAAp14AAKfEAACnyAAAqA+AAKgTgACoY4AAqGeAAKhrgACob4AAqM2AAKjRgACo1YAAqNmAAKkuAACpgYAAqbUAAKnuAACqTgAAqq6AAKrugACrM4AAq4SAAKuIgACrxAAAq/qAAKxhgACsZYAArK0AAKzugACtbgAArXIAAK12AACtegAArcyAAK3QgACt/oAArgKAAK5GAACuSgAAroUAAK6JAACu0IAArtSAAK78AACvAAAArwQAAK8/gACvnIAAr+eAALAmAACwKgAAsC4AALAyAACwmYAAsQgAALE7gACxP4AAsdeAALJpAACzCoAAs6OAALREgAC04QAAtVUAALXCgAC1zQAAtdeAALXbgAC134AAteoAALX0gAC1/wAAtgMAALYHAAC2EYAAthwAALYgAAC2JAAAti6AALY5AAC2Q4AAtkeAALZLgAC2T4AAtlOAALZXgAC2W4AAtmYAALZqAAC2bgAAtniAALaDAAC2jYAAtpgAALaigAC2rQAAtreAALbCAAC2zIAAttcAALbhgAC27AAAtvaAALcBAAC3C4AAtxYAALcggAC3KwAAtzWAALdAAAC3SoAAt1UAALdfgAC3agAAt3SAALd/AAC3iYAAt5QAALeegAC3qQAAt7OAALe+AAC3yIAAt9MAALfdgAC36AAAt/KAALf9AAC4B4AAuBIAALgcgAC4JwAAuDGAALg8AAC4RoAAuFEAALhbgAC4ZgAAuHCAALh7AAC4hYAAuJAAALiagAC4pQAAuM0AALjeAAC4+4AAuQYAALkQgAC5GwAAuSWAALkwAAC5OoAAuUUAALlPgAC5WgAAuWSAALlvAAC5eYAAuYQAALmOgAC5mQAAuaOAALmuAAC5uIAAucMAALnNgAC52AAAueKAALntAAC594AAugSAALoRgAC6HoAAuoMAALrqAAC7UQAAu7QAALvFgAC71wAAu/KAALwJgAC8HgAAvDoAALxwAAC8owAAvNkAAL0MAAC9NAAAvXqAAL2ngAC9yAAAvd6AAL3ugAC+NgAAvoiAAL7ugAC/BYAAvx0AAL80AAC/SwAAv3gAAL+lgAC/0IAAv/uAAMAmgADAVIAAwIKAAMCwgADAtQAAwLmAAMC+AADAwoAAwMcAAMDigADA/gAAwSwAAMEwgADBNQAAwTmAAME9gADBQgAAwUaAAMFLAADBT4AAwVQAAMFYgADBhAAAwa8AAMHagADCBYAAwiuAAMI6AADCRIAAwk8AAMJkAADCeIAAwpeAAMKqAADCyQAAwt4AAML/AADDE4AAwzEAAMNHAADDYIAAw3YAAMOMgADDrAAAw78AAMPWgADD74AAxAMAAMQWgADELIAAxD6AAMRJAADEVIAAxF4AAMRrAADEdwAAxIMAAMSXgADEswAAxMiAAMTlgADE+oAAxReAAMUpAADFQwAAxVSAAMVrgADFd4AAxYYAAMWPgADFm4AAxaUAAMWugADFuwAAxccAAMXbgADF9QAAxgqAAMYkAADGOQAAxlSAAMZlAADGfQAAxo2AAMaggADGrwAAxr4AAMbMgADG24AAxuiAAMb1AADHAQAAxw0AAMcXgADHIQAAxyuAAMc3AADHQYAAx1SAAMdlgADHcwAAx4IAAMePAADHmoAAx6oAAMe2AADHxIAAx88AAMfagADH5AAAx+2AAMf4gADID4AAyBuAAMgngADIM4AAyEGAAMhOgADIWgAAyGYAAMhyAADIfgAAyIoAAMiXAADIrIAAyLmAAMjRgADI3oAAyPSAAMkBgADJGIAAyUAAAMlzgADJu4AAye2AAMoRgADKNwAAyrIAAMsxAADLjwAAy+4AAMxYgADMxQAAzP8AAM1MgADNioAAzc8AAM4WgADOZAAAzr6AAM8aAADPf4AAz96AANAigADQJoAA0HGAANDAgADREQAA0XIAANGogADRxgAA0fOAANIdAADSeQAA0ocAANKlgADS1gAA0wSAANMegADTYAAA062AANPhAADUOIAA1FcAANR1gADUp4AA1NYAANUDAADVGgAA1TCAANVCgADVXoAA1X2AANWQAADVnoAA1bAAANXBAADV1YAA1eoAANYKgADWKwAA1juAANZLgADWWQAA1maAANZyAADWfYAA1oqAANaXgADWqAAA1riAANbHgADW1oAA1uUAANbzgADXAAAA1wyAANcZAADXJYAA1zQAANdCgADXUwAA12OAANd0AADXhIAA15gAANergADXvAAA18yAANfcgADX7IAA1/sAANgJgADYHIAA2C+AANg/AADYTwAA2GCAANhyAADYgQAA2JaAANilgADYtIAA2MSAANjUgADY44AA2PKAANkCgADZEoAA2SOAANk0gADZSYAA2W0AANl9gADZjgAA2agAANnCAADZzoAA2dsAANnpAADZ9wAA2hyAANpCAADaVIAA2mcAANp2AADahQAA2pqAANqwAADawoAA2tUAANrrAADbAQAA2xEAANshAADbLwAA2z0AANtPgADbYgAA23GAANuBAADbkYAA26IAANu3AADbzAAA292AANvvAADcAIAA3BIAANwngADcPQAA3FKAANxoAADcewAA3I4AANyhAADctAAA3NEAANzuAADdCwAA3SgAAN03gADdRwAA3VaAAN1mAADddYAA3YUAAN2WAADdpwAA3boAAN3NAADd5QAA3fgAAN4HgADeGwAA3l8AAN5zAADehwAA3pUAAN6jAADeuIAA3s4AAN7rAADfBAAA3xSAAN8lAADfOoAA304AAN9hAADfdAAA34QAAN+UAADfpgAA37gAAN/TAADf6YAA3/eAAOAFgADgFYAA4CWAAOBsAADgvYAA4PmAAOE9gADhUwAA4WiAAOF9AADhkgAA4asAAOHEAADh2YAA4e8AAOIMgADiKgAA4jqAAOJLAADiW4AA4mwAAOJ8gADijQAA4qKAAOK4AADizIAA4uGAAOMDgADjJAAA40wAAON0gADjhAAA45OAAOOjAADjsgAA48GAAOPRAADj4IAA4++AAOQogADkY4AA5KkAAOTwAADlIoAA5VUAAOWTgADl0gAA5hGAAOZRAADmmIAA5uAAAOcpgADncwAA57OAAOf0AADoGIAA6D0AAOhMgADoXAAA6HKAAOiJAADolwAA6KUAAOjpAADo7QAA6P8AAOkRAADpJwAA6T0AAOlJgADpVgAA6WaAAOl3AADphYAA6ZQAAOmlAADptgAA6dQAAOnygADqFoAA6ieAAOo3gADqWAAA6niAAOrOgADq0oAA6uYAAOr5gADrCIAA6xeAAOspAADrOoAA604AAOthgADrdYAA64mAAOuggADrt4AA7BUAAOxvAADsfQAA7IuAAOyegADssYAA7MYAAOzagADs7wAA7QSAAO0TgADtIoAA7TgAAO1NAADtmwAA7cMAAO3WgADt5oAA7fUAAO5agADu9IAA7yWAAO+LAADv4oAA8BYAAPB/gADxFIAA8aKAAPG0AADxwIAA8esAAPI0AADyPQAA8mOAAPKmgADy6oAA8y6AAPNyAADz04AA8+AAAPQIgAD0EoAA9CsAAPRDgAD0XAAA9HSAAPSEAAD0k4AA9KIAAPSwgAD0u4AA9M6AAPTdAAD064AA9UKAAPWXgAD1m4AA9csAAPYYgAD2MAAA9nYAAPbZgAD3AwAA91SAAPdkAAD3c4AA94MAAPeYAAD3ogAA97iAAPfRgAD344AA9/wAAPgUAAD4MIAA+E+AAPhugAD4jwAA+LIAAPjVAAD494AA+ReAAPkmAAD5NQAA+Y4AAPnAgAD5zIAA+diAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIAsAAAAY8FugAFAAkAfbEGAkNUWLICAAW4Aq9ACwg8BgoJOgQ8BjoBAS/k/eQAP/3mPxuxHAW4Aq9AJgg8BgIABgoLywMJOgU4BDwAOAY6AQM8AgIgAQEBywoKC4EhoZgYKytOEPRdPE0Q7RDk5P3k5BDuAD8/TRD95ktTWLMFBAABARA8EDxZWTEwEwMRMxEDAzUzFec33zSjzwFsAwkBRf67/Pf+lM3NAAACAF4DswJ3BboABQALAHW5AAD/+LMiJTQFuP/4QCImKTQLBgoHBQAEAQAFBQYL7gkICAMDAgAHCDwKDwmACQIJuP/AQBUNDzQJ3gEDBDwCAUANETQBGQxxpxgrThD0KzxN/TwQ/StdPP08AD88EDwQPP08PBA8ARESOTkREjk5MTABKysTAzUzFQMzAzUzFQOQMs0t3THNMAOzARfw8P7pARfw8P7pAAACABX/5wRZBdMAGwAfATFAhygdOB0CCQQJHQJXD7cTtxzHE8cc+B0GAQIVAAkEAxQACQUGEQAJCAcQAAkLBxAbCgwHEBgNDwcQFw4SBhEXDhMDFBcOFgIVFw4ZAhUYDRoCFRsKHAMUGwodAxQYDR4GERgNHwYRGwoKGxslAAkUAAAJDRgYJRcOFBcXDhUCJRQDAwAQByURBrgBtkA4Dg4NDQoKCQAbGBgXFwAKFRQUERA+DgcGBgMCPgAYlA0XlA0lDkAROU8Onw4CDnUhCpQbCZQbJQC4/8C1ETkgAAEAuAKhsyCpaBgrEPZdK+3kEOQQ9l0r7eQQ5BD0PDwQPBD0PDwQPAA/PBA8EDw/PBA8EDwQ/Tz9PBE5Lzz9PIcFLit9EMSHLhgrfRDEDw8PDw8PDw8PDw8PDw8PDzEwAV1dcRcTIzUzEyE1IRMzAyETMwMzFSMDIRUhAyMTIQMTIRMhZ1epx0r+7wEvV5ZXATtXl1ety0sBFv7MV5ZW/sZXdQE6S/7FGQGqlQFrlQGt/lMBrf5Tlf6Vlf5WAar+VgI/AWsAAwBJ/y0EEwZBACoAMQA4AdRAJXweAQQwLDY2L0YhVSFQL102agNjL3oDdyFzL3s2hyGAL442EDG4/963CzkeICAkNCy4/+BALCAjNGoIOCoWDDcgFiowIQsAFQw3MTAhABU3ITAwygw3FAwMNzAMITcEFzIGuAKktlAFAQXtARy6AqQAGwKtsxcf0yu4ATVAChQVFoAXFxQFACq4ATeyAQoyuAE1tCnTAQ0cugE4ABsCmLI1cya4/8BAChI5MCZAJoAmAya4AlJADyoWFxcfHyAgODgyMikpKrgBk0AWABUUFCsrMTELCwoKMABAAIAA0AAEALgCDEAJBS5zbxB/EAIQugGOAAYBOEAPPwVPBX8FjwUEBRk5x4sYK04Q9F1N7fRx7RD0XTwQPBA8EDwQPBA8EP08EDwQPBA8EDwQPBA8EPRdK+307QA/9P08EPQ8PzwQ9DwQ/eQQ/eQQ/V3kERIXOYcOLiuHDn3EDw8PDzEwGEN5QEohNwwTJCUjJSIlAwYSJg4PDQ8CBjchNU8BMyg1TwEsEy5PADAMLk8ANiU4TwEhIDc4NCcyTwAzMi0RK08BLCsTFC8PMU8AMDEMCwAQPBA8KxA8EDwrEDwrEDwQPCsBKysrKyorKoGBASsrACtdAV0FNS4CJzcWFxYXESYnJiY1NDc2NzUzFRYXFhcHJiYnERYXHgIVFAYHFQMGBhUUFhcTNjY1NCYnAf6HqXsKtRU1TGpvdFZdiFuzap1cdhi6EGVYiCxUajnuvWppeWd7ammJYZHTtBFXwowikURgCwI9FUEwqmzAd1ASVlYPTWKrHGpxEv35IhMlapJVu/oJtgYoEIhdXHwl/RYNnHNidy8AAAUAd//KBp8F0wALABcAGwAnADMBB0AKkBmQGgJoCBobG7gCmkAPGBkUGBgZGBsVDxkaMSsSvAKfAAkBZQAMAp9ACwMaGRkDARsYGCUovAKfAB8BZQAuAp+yJQscvAKaACsBAAAxApqzIqw1BrwCmgAVAQAADwKaQAkgAAEAdTRXWhgrEPZd7fTtEPbt9O0AP+397RA8EDw/PBA8EO397QEREjk5ERI5OYcuK30QxDEwGEN5QFIBMykeKx8AMyAxHwEtJisfAC8kMR8BDQIPHwAXBBUfAREKDx8AEwgVHwEqHSgfATIhKB8BLCcuHwAwIy4fAA4BDB8BFgUMHwEQCxIfABQHEh8AACsrKysrKysrASsrKysrKysrgQFdEzQ2MzIWFRQGIyImASIGFRQWMzI2NTQmAwEzAQE0NjMyFhUUBiMiJgEiBhUUFjMyNjU0Jneeloq1t4aFsQE5Q1laQkRZWkIDIpL84QHlnpeKtbeHhbEBOkRZWkJFWVoEWp3cxb+6ycYBxXSbjXN0mo5z+nMGCfn3AY6e28W/usnHAcR0m4x0dJqOcwADAFj/3gUnBdMAHwAsADYBPUDIehVyFnIXei56L4YWpi/dAAiWHaMWAokvgzYCgxyEIQK0FgFgF2EhAhYVQBZqAAOqHtoWAnMccx0CdRpyGwJ1AHsWAooXgxsCqRWuFgKDHoogAooKgxwCyyDGJwLNFsIbAroaxhQCaTa6FgJpF2UzAmUvAVYzXDYCRjNaHwJNFkIbAjAaOR8CJhskIAIALS0eLS4KCgAbFhYdFSAWFiAgugotFAoKLSYpEAE0KR46Awsbhh0jXmATcBOgEwMvE0ATAhPcHY8YARi4AlpAHBk+HnIgHQEdODgpXqANAQ2gMV4gBwEHajdxmBgrEPZd7fRd7RD0XeT07V0Q9F1d7RDkAD/k7T/thw4uKw59EMQHDjyHDhDEBw4QPDyHDhDEMTABXV1dXV1dXV1dXV1dXV1dXV1dXQBdXV1dXV1dJQYGIyInJjU0NjcmJjU0NjMyFhUUBQE2NxcGBxYXByYBNjY1NCYjIgYVFBYXAQEGBhUUFjMyNgPNWdJ64YRrr65jQs+dlr/+6wEHLRm7MFJlgHlt/h51RV9HSWEjIwFN/raSZo6CUa2tY2OYfJmI21NyjkKEw7iB0ZT+sVh0KMB8hluPRgOFRWg/S19eRCJLKv01AZlXlUlZwGUAAQBaA7MBJwW6AAUAJkAVAAUDAQXuAgADgSABkAECAWoGcacYKxD2Xe0AP+0BERI5OTEwEwM1MxUDiC7NMAOzARL19f7uAAEAfP5RAmAF0wAQAD1ACicPAQAQEgcIEBC4ATOzAJ8OCLgBM0ARB58OXgADEAMgAwMDrBGdjBgrEPZd/fbtEPbtAD88PzwxMAFdASYCETQ3NjczBgcGBwYVEAEB35XOTVq8gXknPSMrASv+UbwB+AEO7tr9+9BZipa7vf4f/iAAAQB8/lECYAXTABAAZUAMKAIoEAIJChABABIJuAEzswqfAwG4ATO0AJ8DXg64//C0EBACVQ64//i0Dw8CVQ64/+S0DQ0CVQ64/+xADwoKAlUPDh8OAg6sEp2MGCsQ9l0rKysr/fbtEPbtAD88PzwxMAFdEyMAETQnJicmJzMWFxYVEAL9gQErKyI9J3qBvFpNz/5RAeAB4by5lopa0vv92u7+8v4IAAEAQANjAtUF0wAYAIZASgsBCwobARsKBAoJDA4PEBEHBgsBAhgWFRQTBwAEAwgXEg0HBwYFGBcWFRMSERAPDQwLFAQHAwgBCgYFCwAAECAUARS/BgUAC6UGuAGVQA0FpQBAERM0ABkZcIwYK04Q9CtN9P3kAD88/V08OS88Ehc5Ehc5ARESFzkSFzkREhc5MTAAXRM3FhcmJzMGBzY3FwYHFhcHJicGByc2NyZALp9IEwGRAxRnhS5/ej1veDpPSjh2dDKBBK2OOCm1RGOVNCyOKg41iFVPiI1KVY8uGQAAAQByAO0EOgS2AAsAOEAfAG4JAvkIA24FBwYJbgoECvkFAW4/Ak8CAgIZDFdaGCtOEPRdTfQ87TwQ5Dw8AC/0PP089DEwJREhNSERMxEhFSERAgH+cQGPqgGP/nHtAZKoAY/+caj+bgABAKr+3gGDAM0ACgBOtQoDAAerBrgBUEAmAQM8AgIBCgE8AAoCAwEDPAAGOAc6TwBfAG8AfwCgAAUAoAuhmBgrEPRd9OQQ7TwQPAA/7TwQPBDtEP3tARESOTEwMzUzFRQGByc2Nje2zVBXMjk2A83NcYsmTRlhWwABAEEBuAJqAm0AAwAsQBlwAnADAk0BTQICASMAAhoFcAABABkEcI0YK04Q5F0Q5gAvTe0xMABxAV0TNSEVQQIpAbi1tQAAAQC6AAABhwDNAAMAJUAYAjwACgI8XwBvAH8ArwAEoAABAKAEoZgYKxD2XV3tAD/tMTAzNTMVus3NzQAAAQAA/+cCOQXTAAMAU7kAA//eshQ5Arj/3kAgFDmXAwECA58DrwMCA3YAARQAAAECAQADAAoD6AAC6AG4Aam1AAAEs3oYKxA8EPTtEO0APzw/PIcFLitdfRDEMTABXSsrFQEzAQGpkP5YGQXs+hQAAAIAVf/nBBEFwAAQAB0BVbECAkNUWEAKGh4EBRQeDQ0XCbj/6LQPDwJVCbj/6EAZDQ0CVQkRAAwPDwJVABYMDAJVAAwNDQJVAC8rKyvNLysrzQA/7T/tMTAbsQYCQ1RYQAoaHgQFFB4NDRcJuP/0tA8PBlUJuP/mtA0NBlUJuP/uQBkLCwZVCREAEA0NBlUAEAwMBlUAEAsLBlUALysrK80vKysrzQA/7T/tMTAbtAYgGRAcuP/wsgIgC77/4AAW/+AAEv/gAA//4EBiBAaHAogLiA/JDgUJBwsYAkUTTBVKGUMbVBNcFVwZUhtrB2sLYxNsFWsZYBt5AncGdgt6D4cGmAeWEMkY2gLWBtYL2w8aGh4EBRQeDQ0XcwlAISM0MAkBAAkQCQIJkB8RcwC4/8BADiEjNCAAQAACAJAex4sYKxD2XSvtEPZdcSvtAD/tP+0xMAFdcQBdADg4ODg4ATg4OFlZExASNjMyFhYSFRACBiMiJyYTEBYzMjYRECYjIgcGVWvToHaydEJq06HUeZG5qXx8qal+fEpdAtMBBAE9rF+z/v/a/v7+w62YtwGd/pfv8AFoAWruaYYAAAEA3wAAAvsFwAAKAK9AIANADRE0awR/Ao8CmQgErAQBCQAGBQIDCQUBDAIBygoAuP/AQAohIzQwAAEgAAEAuP/gtBAQAlUAuP/qQBEPDwJVABwMDAJVAA4NDQJVALj/8EAZDw8GVQAQDAwGVQAQDQ0GVQAaDAVADQ80Bbj/wEAOISM0MAUBIAVABQIFGQu6ATwBhQAYK04Q5F1xKysQ9isrKysrKytdcSs8Tf08AD8/FzkBETkxMAFdAF0rISMRBgYHNTY2NzMC+7RB01SX4i90BHs+fB+uR8pfAAABADwAAAQHBcAAHgHHsQYCQ1RYQAkREA0YExMGVQ24//S0EREGVQ24/+5ACRAQBlUNHhQFHrj/6EAXExMGVR4eEREGVR4cDhAGVR4MDQ0GVR64ArtADAIKFxcgHxARAgIgHxESOS/UzRESOS/NAC/tKysrKz/tKysrxDIxMBuxAgJDVFhACREQDQwSEgJVDbj/9EAJDxECVQ0eFAUeuP/gQAsSEwJVHhQPEQJVHrgCu7ICChe4/+i0CwsCVRe4/+xADg0NAlUXFyAfEBECAiAfERI5L9TNERI5LysrzQAv7SsrP+0rK8QyMTAbQDY7BTsGuwW/BrsHxwjJHAdJDFkMVA5rDGQOehJ6E4kSvBLlGuUb8BoMvwu3EwIbEBwQHRAeEAa+//AAB//gAAj/8AAJ//BAGh4KEAgGBsocGhQcHBoIHBoDAQIIGhwDDR4QuAKks08RARG4ARi1DR4UBQAeuAK7QA8BAgwKcxfTAAABQCEjNAG7AoEAIAAQAThADBG1PwJfAm8CfwIEAroCJAAfAY+xixgrEPZd9O0Q9is8EPTtAD88/Tw/7f1d5BESFzkBERIXOYcOLisOfRDEARESOTEwADg4ODgBODg4OABdAV1yWVklFSEmNzY2NzY2NTQmIyIGByc2NjMyFhUUBgYHBgYHBAf8NwIXJaOa76iZe4KcAbkT+NHT9kinwqJcHq2tQTxjwH7E5WZrk5yKE8/Z6q1YqrykiGExAAEAVv/mBBYFwAArAVmxAgJDVFhACxkYQA0NAlUYHAABuP/AQCsMDQJVASkjCg0PDA8eCgopFR4cBB4pHAUpDSMNDBgZAQASIBAMDAJVIAcmuP/otAwNAlUmLyvNLyvNL80vzS8AEjk/PxDtEO0SOS/txhDGEjkQxCsyEMQrMjEwG0AoBQ0WDUUNhg0ERRFXEXYbA1IWbBBqFGQWdQ15FIYNihSJG6UNCgUgA7j/4EALCwwNDgQHASMNDAG4AqSzQAABALsBGAApAA0BNbQMDBUEGLoCpAAZAmhAJxUeHAUEHikNEnNfIG8gAiAYDQ0GVSCAB3MmQCEjNDAmAQAmECYCJrj/9LcNDQZVJpAtGLgBOLIZ0wG6ATgAAP/AQAshIzQgAEAAAgCQLLgBkrGLGCsQ9l0r7fTtEPYrXXEr7fQrXe0AP+0/7f3kERI5L+0Q/V3kERI5ARESFzkxMAE4OAFdAF0BcVkTNxYWMzI2NTQmIyIHNxYzMjY1NCYjIgYHJzY2MzIWFhUUBgcWFhUUACMiJla0H5Vrf6+ifTNMFBILc7iGammMFLQh6q54ymtmZIKQ/ujWwf8BgxiZh7CCfKEUngJ4fWOChIQgtcdnsmRfnC4evY7A/vXmAAIAGgAABBAFugAKAA0BJkA2ElgMaAyaDKkMyQwFTANMDZQEAxIBAggADAYDBwUKCwMHAAwMDQ3KAwQUAwMEAw0AAgwNBAcDuwK7AAgAAgGgQAoABAQADAwAygoEuAJmtwUFCkAdHzQKuP/gtBAQAlUKuP/mtA0NAlUKuP/utA0NBlUKuAE3QA0HQCIjNAeAITUHkA8CuP/AQAsNFDQAAhACIAIDArj/4LQNDQJVArj/5LYNDQZVArUOuAGMsYsYKxDsKytdKxD2Kyv0KysrKzwQ5hD9PAA/PxD0PPY8ETk5ARESOTmHLisEfRDEDw8PMTABQ1xYuQAN/96yEjkNuP/UQAszOQMiLTkDBB0dPCsrKytZXQBdQ1xYQBQMQAs5DIBQOQxAJjkMIhw5DEAtOSsrKysrWSERITUBMxEzFSMRAxEBApb9hAKdk8bGtP41AV+lA7b8SqX+oQIEApX9awABAFX/5wQhBaYAHgFWsQICQ1RYuQAB/8BADQ0NAlUBHA4KHhUVHBK4ArtACw8EBB4cDQ4BAAcYuP/qtA8PAlUYuP/qtA0NAlUYLysrzS/NLwA/7T/tEjkv/cQQxCsxMBtAKRIMDQ0GVQ8MDQ0GVUsaeR2KHZYTpxPDDNYM2xsICRMYDioaAwkwBTALuv/gAAP/4EAQEwoVEhMTyg4PFA4TFA4PDbgCpEATDgoeFUAOoA4CDg4PQBUBFRUcErgCu7cPBAHTQAABALgBGEAgBB4cDRFfEG8QfxCPEAQQgAdzGEAhIzQwGAEAGBAYAhi4//S3DQ0GVRiQIBK8ATUADwGVAA0BOLIOtQG6ATgAAP/AQAshIzQgAEAAAgCQH7gBkrGLGCsQ9l0r7fTt9O0Q9itdcSvt9F08AD/t/V3kP+0SOS9dETkvXRDtEOSHCC4rBX0QxAAREjkxMAE4ODg4AXFdKytZEzcWFjMyNjU0JiMiBgcnEyEVIQM2MzIAFRQHBiMiJlW9FZlsgrStjFeMKKmOAtn9t0+EkcABCHSN9Mj9AYAQiovEopqyTz8WAvGs/nZc/vbRx5Gy4AAAAgBN/+cEFQXAAB0AKgFPsQICQ1RYQB8PAR8BXwEDARsoHkANAQ0NFAUeGwUiHhQNCh4BACUQuP/0QBkNDQJVEB4XEA8PAlUXEAwMAlUXDA0NAlUXLysrK80vK83UzRDFAD/tP+0SOS9d7RDEXTEwG0AtaxkBRAdAFUQZRCBaElQgawNkB2QIahJkIHQIdRyFCIYc1gjUFhEHIA0NBlUnuP/gtA0NBlUjuP/gQAsNDQZVISANDQZVB7j/4LQnICMgIbj/4EARKB5ADVANAg0NFBsB018AAQC4AmhACQUeGwUiHhQNAbgBOEASALUlcxBAISM0MBABABAQEAIQuP/wtwwMBlUQkCwKugE4AB4BOUAWPxdfF28XfxcEFxYMDAZVFxYNDQZVF7gCJLMrx4sYKxD2Kytd7e0Q9itdcSvt9O0AP+0/7f1d5BESOS9d7TEwATg4ODgrKysrAV0AXVkBByYnJiMiBwYGBzY2MzISFRQGBiMiABEQNzYzMhYBFBYWMzI2NTQmIyIGA/uzGCxJa1ZBVWICQbxntP130ITh/uSdieit3f03T45OcqSie3qqBFMOajBNMD7u3GNg/vfSiu1+AUsBfAGpwajC/N1dqlm4npivrwABAGEAAAQWBacADQBwQA7EDQEEDQEEAggECQMNALgCu0AwAgEECQwNcwMDAkAhIzRPAl8CbwIDAhoPCHMJ6wBPAV8BXwIDPwFfAW8BfwEEARkOuAGSsYsYK04Q9F1xPE307U4Q9nErPE0Q7QA/Pzz9PDkROQEREjkxMAFxXRM1IRUGAAMGByM2EhI3YQO1jP7tSzYPuQOC84kE+q2Mlf4S/vu4260B6gHHnAAAAwBT/+cEGQXAABcAIwAwAgCxAgJDVFi0DAAbHi64/8BAFxMTAlUuLhIhHgYFKB4SDR4JDAwMAlUJuP/0tg0NAlUJKw+4//C0Dw8CVQ+4/+i0CwsCVQ+4/+i2DQ0CVQ8YA7j/8LQQEAJVA7j/8LQPDwJVA7j/9EAZDQ0CVQMkFQwLCwJVFQwMDAJVFQwNDQJVFS8rKyvNLysrK80vKysrzS8rK80AP+0/7RI5LyvtOTkxMBuxBgJDVFi3HgkMDAwGVQm4//S2DQ0GVQkrD7j/5LQPDwZVD7j/5LYNDQZVDxgDuP/wtA8PBlUDuP/8QCINDQZVAyQVDAwMBlUVDA0NBlUVDAAbHi4uEiEeBgUoHhINAD/tP+0SOS/tOTkBLysrzS8rK80vKyvNLysrzTEwG0A3NRYBKRZJFkkm5gzpMAUJMAF9AH0BfAR0CHELcgx1DXoXiwCKAYwEhgiBC4QMhg2NF8wRxhMSIrj/4LIcIBq4/+CyICAvuP/gsi0gJrj/4EAeKSAMAB4YAAwbHi6gLgEuEiEeBgUoHhINHnO/CQEJuAJnQBArcw9AICM0MA8BAA8QDwIPuAGRtjIYc7ADAQO4AmeyJHMVuP/AQA4hIzQgFUAVAhWQMceLGCsQ9l0r7fRd7RD0XXEr7fRd7QA/7T/tEjldL+05OQEREjk5MTABODg4ODg4ODgBXXJxAHFZWQEmJjU0NjMyFhUUBgcWFhUUACMiADU0NhMUFjMyNjU0JiMiBgMUFhYzMjY1NCYjIgYBanBs5r/A6mtth43+9tnZ/vaRYoZraIWJZmeIOkmQU4GorYJ/pwMbKZhqoNrfoGaXKSzEiLz/AAEBwI/BAVRohINfY4eE/P9NkE+mgIKqqAAAAgBV/+cEGQXAAB4AKgGusQYCQ1RYtwsfGAEAJREYuP/2tA8PBlUYuP/0tA0NBlUYuP/wQCgMDAZVGBEMDQ0GVREQDAwGVREYESwrCygeDw4fDk8OAw4OFABQAQEBuP/AQA0QEQZVAQQeHA0iHhQFAD/tP+3EK10yEjkvXe0yARESOTkvKysvKysrEM3UzRDdxTEwG7ECAkNUWLcLHxgBACURGLj/6rQPDwJVGLj/6kAqDQ0CVRgRDAwMAlURGBEsKwsoHg8OHw5PDgMODhQAUAEBAQQeHA0iHhQFAD/tP+3EXTISOS9d7TIBERI5OS8rLysrEM3UzRDdxTEwG0A0OhpMFkAjWxZXI2YDbBZtGmcjehp9Howaix6aFqkavBrqFuYg9iATPRaeFq0WAzopZAYCJ7r/4AAj/+BAGCEgBiAoHk8OXw4CDg4cIh4UBQHTUAABALgCaLQEHhwNH7oBOQALAThAERhAISM0MBgBABgQGAIYkCwBuAE4tAC1JXMRuP/AQA4hIzQgEUARAhGQK8eLGCsQ9l0r7fTtEPZdcSvt7QA/7f1d5D/tEjkvXe0xMAE4ODg4AF1xAV1ZWRM3FhYzMj4CNTQnBgYjIgI1NAAzMhYSERACBiMiJgE0JiMiBhUUFjMyNnCtFnxhU31QNgE2u222/AEHxo/te3rxoqzaAsuldHiyqXx9oQFTEHpuTH/YcAwYVmsBCNjfARCa/uP+8v7n/rOuvwM0m7bEnIyvrwAAAgC5AAABhgQmAAMABwA4QCAEBQAGBwkCBjwEAzwBBgQKAjwvAD8AAiAAAQChCKGYGCsQ9F1x7QA/P+0Q7QEREjk5Ejk5MTATNTMVAzUzFbnNzc0DWc3N/KfNzQACAKr+3gGDBCYAAwAOAIVAL3MLgwuTC6ML8AsFAAsBJgo3CkYKVgplCrUK4goHCwoOBwQDPAEHPAYGBQ4EC6sKuAFQQCMFPAQBBgQKAoEAAAUGBzwECjgLOgUvBD8EAiAEAQShD6GYGCsQ9F1xPPTkEP08EDwQ7QA/PxD9/e0QPBA8EO0Q7QEREjkAEMkxMAFxAHJxEzUzFQM1MxUUBgcnNjY3ts3NzVBXMjk2AwNZzc38p83NcYsmTRlhWwAAAQBwAOIEOwTDAAYAWkAMjwOABQIDBQYDCAIFuwJaAAYAAwJasgJABroBUAACAVBAFQCrAasgBAIaCAQ8ASAAAQB1B1daGCsQ9l087U4Q9gAZLxpN7e3t7RgaEO0Q7QEREhc5MTAAXRM1ARUBARVwA8v8/gMCAoGoAZqz/sT+wbMAAAIAcgGhBDoEBgADAAcAR0AnBQYBBAcJACUDASUDAgclBAQGJTACAZ8CzwICAr8FABoJARkIV1oYK04Q5BDmAC9N7V1x7TwQ7RA87RDtARE5ORE5OTEwASE1IREhNSEEOvw4A8j8OAPIA16o/ZuoAAABAHAA4gQ7BMMABgBaQAyAAo8EAgQCAQMHBQK7AloAAQAEAlqyBUABugFQAAUBUEAVAKsGqyADAzwGABoIIAUBBXUHV1oYKxDmXU4Q9jxN7QAZLxrt7e3tGBoQ7RDtARESFzkxMABdAQE1AQE1AQQ7/DUDAfz/A8sCgf5hswE/ATyz/mYAAAIAWgAABAwF0wAeACIAhEAvjBqLGwJ8GnwbAmIaZRsCawxhDgJaDFQOAjYORA4CGxkIBwQAECcREQANKRQBHgC4Aq9AIyEiITwfCh88IiIgPCEhHgBeHm4KXhdqJBBeIBEBEWojV1oYKxD2Xe0Q9u307RA8EO08EP0AP+08EPY8P+0SOS/kERc5MTABXV1dXQBdXQEmNTQ3Njc+AjU0JiMiBgcnNjYzMgQVFAYHDgIHAzUzFQHYAR4WMSS7OKR3c5oYuRn3y9cBAFqDWDYaArjNAWkkEmpNOjsrpWI6aZ+QmRbN2uqmYKJ0TkpgbP6Xzc0AAgBv/lEH1QXVAEcAVwD3QFcEIRAgFiEhJTUNMw5FDkkYRCFGJEZJR1ZUDnopDhYlKQEmCSodJik1GjY5QyVWGFkdWyFWKVZJWVZlGGUlZil2GnodciSFGIQajB2LIYcmGQ4QUA4AA1O4ArtACg8nMAtQCwILBxa7AkgAQwBLAru0QzoDCh+4Aru3OgEgK3ArAiu6AU0AJwK7ti9IJA8HAQe4AoNADxBQPgAkEqAPJDAQcBACELoBqQAbAp60PzgqJCu6AQkAIwKeQAkgNQE1GVhXjBgrThD0XU3t/e307fRd7fT95BD9Xe0AL+3tXT/tP+TtEO0/XeTtEjk5ARESOTEwAF0BXSUGBiMiJiY1NBI2MzIWFzczAwYVFBYzMjc2EjU0AiQjIgQCFRQSBDMgJDczBgYEIyIkJCcmNTQ3EgAhMgQXFhUQBwYjIiYnJgEUFjMyPgI1NCYjIg4CBIlBoVFZqGmj8nJXnjkis5AeKR01VnKFq/6tzer+fdXVAZP1AQYBYli1M/j+qvHe/on++ENUZHoBwQFA+AGLcmHMtthFVRQN/haCVDh8cUiHYUBxakCjS1to2IGfAT+gW12b/WGMDxsnPVABDY+nASKu2/5n6vX+nqmwfmnaf3Lllb3b9N0BDwEgy8mty/7e4coqJxkBTImYQ4TLZoiWQZDOAAAC//0AAAVZBboABwAOAWe2AQ4PEAJVArj/8rQPEAJVArj/+LQNDQZVArj/9EBZDAwGVQkMDAwGVQUMDAwGVS8QMBBnCGgJYBCIA5AQyQXGBsAQ8BALCAVZAVYCUBBoC7AQ8wzzDfMOCQQMBA0EDgMLCgkFBAQMDQ4IBgcHDAkFBAgGDAcBAAC4//hADwwMAlUAIAcMFAcHDAIDA7j/+EAVDAwCVQMgBAwUBAQMCR4FBQgeBgMGuAJwQAkACAzpQAIBAgK6AQsAAQELQBIMIABlBwNSUATPBN8EA5AEAQS4AQFAC1AMwAffDAOQDAEMuAEBQBAPB88HAn8HgAcCB5MP1tcYKxD0XXEZ9F1x9F1xGO0Q7RoZEO3tABg/PBrtP+Q8EO08EO2HBS4rK30QxIcuGCsrfRDEARESOTkROTmHEMTEDsTEhwUQxMQOxMQxMAFLsAtTS7AeUVpYtAQPAwgHuv/wAAD/+Dg4ODhZAXJxXSsrKysrKyMBMwEjAyEDEyEDJicGBwMCM9ECWN2r/Zuh2QHxmUYiHDMFuvpGAbz+RAJaAZa5d42LAAADAJYAAATpBboAEQAdACoBE7kABP/0QEcLCwZVBARGI1YjZiNzCYQJBmkadQVwCXMLgwWDCwYnFgkDGCcqHhYdCQkTEh4qKikpABwdHgIBAh8eHhEACBgmBgwQEAJVBrj/5kAzDw8CVQYSDQ0CVQYGDAwCVQYICwsGVQYMDAwGVQYUDQ0GVQZUJSYMHBAQAlUMCg0NAlUMuP/0QBULCwZVDBosHR4gASAAAQAgEBACVQC4//a0Dw8CVQC4//a0DQ0CVQC4//q0DAwCVQC4//q0DAwGVQC4//BACg0NBlUAXSs7XBgrEPYrKysrKytdPP08ThD2KysrTe30KysrKysrK+0APzz9PD88/TwSOS88EP08OS8RORESOQESFzkxMAFdAF0rMxEhMhYWFRQGBxYWFRQOAiMBITI3NjY1NCYmIyERITI3PgI1NCYmIyGWAiaoy3NmZ4WPV4DBjP6TAT2BOEpLRoKe/tsBbV4mQ1o6VJWM/q0Fulm5ZV6mMye8gGexYDEDUhEWZk1Jbyn7oAcMOGtGUnkxAAABAGb/5wV2BdMAHQDTtWMCah0CAbj/6LQLCwZVALj/6EBfCwsGVSAAMg1jAHAAdB2AAIQdkACaBasDpQ25A7QNxw3QAOQd8x0RDhIdER0dAyoGKBEqHCAfRw1WFFcVVhloBWsdexKLEpoDmQ6aHKgBpAKoEdUOEwAUABoQFBAaBAK4/96yKDkBuP/AQC0oORAPAAEEGxMeDAMbHgQJECYPSgAmIAEBARofFyYgCAEIDAsLBlUIGR5jXBgrThD0K11N7U4Q9l1N7fTtAD/tP+0RFzkxMAErK11dcQBdKysBcgEXBgQjIiQCNTQSJDMyBBcHJiYjIgYCFRQSFjMyNgS0wj3+w+Xt/tebrwFDwtwBLDu/M8KTqeNcbeaGo+ICAjHv+8EBbtLlAVWx4MstoJKi/u+Ru/7pirwAAAIAngAABVoFugAPAB0A5UAvIB8BQwgcHR4CAQIREB4PAAgXJiAJAR9ADQ0CVQkgEBACVQkKDw8CVQkYDQ0CVQm4//RAFQwMBlUJGh8dECABIAABACAQEAJVALj/9rQPDwJVALj/9rQNDQJVALj/+rQMDAJVALj/97QMDAZVALj/+EAKDQ0GVQBdHjtcGCsQ9isrKysrK108/TwQ9isrKysrXe0APzz9PD88/TwxMEN5QDYDGwcIBggFCAQIBAYZGBoYAgYLCgwKDQoDBhUWFBYTFgMGGwMXIQESDhchARgIHCEBFgoRIQArKwErKyoqKiqBAV0zESEyFxYXFhIVFAIOAiMlITI2NzY2NTQmJyYjIZ4B+atafll0c056kc2F/rEBOZGlMUVNl2xOrf7MBboVHUxi/s/Ep/7+qWEyrTYxRemm5vcqHgABAKIAAAToBboACwCVQBUGBR4ICAcHAAMEHgIBAgoJHgsACAe4/8BAHRASNAdUA0ogCiANAgoaDQQJIAEgAAEAIBAQAlUAuP/2tA8PAlUAuP/2tA0NAlUAuP/6tAwMAlUAuP/6tAwMBlUAuP/wQAoNDQZVAF0MO1sYK04Q9CsrKysrK108Tf08ThD2XU305CsAPzz9PD88/TwSOS88EP08MTAzESEVIREhFSERIRWiBCT8ngMr/NUDhAW6rf4/rP4NrQAAAQCoAAAEhQW6AAkAjUArBgUeCAiPBwEHBwADBB4CAQIACAecIAIgCwICGgsECSABIAABACAQEAJVALj/9rQPDwJVALj/9rQNDQJVALj/+kALDAwCVQAMCwsGVQC4//60DAwGVQC4//BACg0NBlUAXQo7XBgrThD0KysrKysrK108Tf08ThD2XU3kAD8/PP08EjkvXTwQ/TwxMDMRIRUhESEVIRGoA9385QKw/VAFuq3+Oq39ZgABAG3/5wW5BdMAJQETQBobFBsVAmAnAV4IEwESAyQkACESFwIlAB4CAbj/wEAgDAwGVQEBBhceDgMhHgYJAQEmJyUkIAMDIAIgJ2ACAwK4/+S0Dw8CVQK4//K0DQ0CVQK4/9q0DAwCVQK4//RAGwwMBlUCcoAnAScdJiAKAQoQDAwGVQoZJmNbGCtOEPQrXU3tTRBd9isrKytdPE0Q/TwREjkvAD/tP+0SOS8rPP08ERI5ERI5ARESORI5MTBDeUBEBCMbHBocGRwDBgwmECUVJh8mCCUEJiMlGA0dIQAWDxMhARESFBMgBx0hACIFJSEBHAsXIQEUERchAR4JISEAJAMhIQAAKysrKwErKxA8EDwrKysrKysrKysqgQFdAF0BNSURBgQjIiQCNTQSJDMyBBYXBy4CIyIGBgcGFRQSBDMyNjcRA0wCbY/+0KDY/p+0swFQ258BAZImryFitm+FwnchOIcBApF+8D4CP6wB/eByc7kBXtjWAXO0Z7iUMHCATVGET4ifxP74gGE3AREAAQCkAAAFIgW6AAsA2LkADf/AQBoTFTQEAx4JCqAK0AoCCgUCAgsICAUIIAcHBrj/7rQPDwJVBrj/8kALDQ0CVQYQDAwCVQa4/+BAGAsLBlUGAQwMBlUGXYANAQ0CCyABIAABALj/wEAKExU0ACAQEAJVALj/9rQPDwJVALj/9rQNDQJVALj/+kALDAwCVQAICwsGVQC4//e0DAwGVQC4//hAFg0NBlUAXQwgDQEgDVANYA1wDQQ7WRgrXXEQ9isrKysrKysrXTz9PBBd9isrKysrPBD9PAA/PD88OV0vPP08MTABKzMRMxEhETMRIxEhEaTCAvrCwv0GBbr9pgJa+kYCs/1NAAEAvwAAAYEFugADAMy1AQIACAIFuP/Aszg9NAW4/8CzMzQ0Bbj/wLMtMDQFuP/AsygpNAW4/8CzIyU0Bbj/wLMdHjQFuP/AsxgaNAW4/8BAKg0QNCAFkAWvBQMDIAEAAI8AoACwAAQvAEAAUADfAPAABRIgAI8AkAADBbj/wEALDQ0CVQAYEBACVQC4/+y0Dw8CVQC4/+60DQ0CVQC4//ZAEAwMAlUAIAsLBlUAogTWWRgrEPYrKysrKytdQ1xYsoAAAQFdWXFyPP1dKysrKysrKys8AD8/MTAzETMRv8IFuvpGAAEAN//nA2EFugARAKlAEGUCZwZ0AnUGiA2IEQYJAgG4/8C0CwwGVQG4ARpACwQeDwkJJgoKCCYLuP/qtBAQAlULuP/qtA0NAlULuP/+tAwMAlULuP/otAsLBlULuP/+QBYMDAZVC10gEwEgE0ATUBNgEwQTASYAuP/otAwMAlUAuP/qtAwMBlUAuP/cQAoNDQZVAEsStlkYKxD2Kysr7RBdcfYrKysrK+08EO0AP+3tKz8xMABdEzcWFjMyNjY1ETMRFAYGIyImO68HcGNJaijCWcGCwc0BoBiofENzfgPy/Bm4ymreAAABAJYAAAVSBboACwH+QB4DIjc5CAk6Jwo1BjYKRwpXA4YD1wMHdgrZA9kKAwa4//RAGA0NAlUoBYwEigWqBOoIBQoEATUE1gQCCbj/4EAJEiE0AyASITQDuP/esww5Egm4/+CzEiE0CLj/4LMSITQEuP/gsx0hNAS4/8CzEhY0CLj/3kA9GTkICSUlPQgJGRk9BgYHCQoJCAoFAwQEIAUKFAUFCgkICCAHBhQHBwYKCgAFAgQBAgcLCAAICgMCCwEABLgCOkAPMAUBoAWwBcAF4AUEBUoIuAI6QAswBwEgB4AHsAcDB7gChkAMCyAgAAEAIBAQAlUAuP/2tA8PAlUAuP/2tA0NAlUAuP/6tAwMAlUAuP/6tAwMBlUAuP/yQAoNDQZVAF0MO6gYKxD0KysrKysrXe39XXHt9F1x7RA8EDw8PAA/PDw8Pzw8PBI5L4cFLisOfRDEhwUuGCsEfRDEBwgQPAg8AUuwGFNLsBtRWli5AAT/2DhZsQYCQ1RYuQAE//CzDBE0A7j/8EAXDBE0BhAOETQIEA4QNAkQDhE0ChANEDQAKysrKysrWTEwASsrKysrKytDXFhAEQkiGTkILBk5BCwZOQQiGzkFuP/ethY5BCIWOQa4/95ACxI5CCIUOQRAFDkIuP/etSU5BEAVOSsrKysrKysrKysrWQArKysBcXJdKwBxXSsrMxEzEQEhAQEhAQcRlsIC2AEH/ZkCgv8A/fbwBbr9KQLX/a78mALm6v4EAAEAlgAABCoFugAFAG1ADAECBAMeBQAIIAQBBLgCp0APBwIDIAEgAAEAIBAQAlUAuP/2tA8PAlUAuP/2tA0NAlUAuP/6tAwMAlUAuP/2tAwMBlUAuP/4QAoNDQZVAF0GO1wYKxD2KysrKysrXTz9PBDmXQA/PP08PzEwMxEzESEVlsIC0gW6+vOtAAEAmAAABg8FugAQAuSxAgJDVFi5AAj/9kALDAwCVQgODRECVQK4/+60DRECVQW4/+5AKA0RAlUMEgwMAlUFDwwDCQABAggJCw4ACAkCCgsGEBACVQsQDQ0CVQu4//q2DAwCVQsQALj/5rQQEAJVALj/+LQPDwJVALj//LQNDQJVAC8rKyvNLysrK80APz/AwBDQ0MAREhc5KysxMAErKysAG7EGAkNUWEAfByALCwZVBiALCwZVAyALCwZVBCALCwZVBSALCwZVCLj/8kAjCwsGVQIMCwsGVQMGDAwGVQIODAwGVQkMDAwGVQoMDAwGVQe4//i0DQ0GVQi4//hAHw0NBlUmBQEMIAoSNA8gChI0DwUMAwABDgsACAgBAgq4/+60CwsGVQq4/+60DAwGVQq7AlYAEgAQAlZADQAMCwsGVQAGDAwGVQC4//i0DQ0GVQABLysrK/Qv9CsrAD88Pzw8ERIXOSsrXTEwASsrKysrKysrACsrKysrG0B/AAIPCBQCGwgEdgyGDMgMAwkMSQxJDwMpBCUNLA5YA1sEdg14DocNCAsCBQg5DTYOTwJLA0QHQAhNDUIOCpgCmQOWB5YIqAOnBwYSAg8ODjAFAhQFBQIIDA0NMAUIFAUFCAxSD1IBQAECAggICQoLCw0NDg4QAAgJAmASgBICEroCqAANATGyBSAIuAExQAoMCQogQAx/CwELugJWAA4BC7IFIAK4AQtACQ8BACAPcBABELgCVrcgBWAFgAUDBbgCqLMRO1kYKxkQ9F30XTwY/TwQ7RoZEO30XTwaGP08EO0aGRDt5F0AGD8/PDwQPBA8EDwQPBA8EDwaEO3thwUuK4d9xIcuGCuHfcQxMABLsAtTS7AeUVpYvQAM//sACP/WAAL/1jg4OFkBS7AMU0uwKFFaWLkADf/4sQ4KODhZAUNcWLkADf/UtiE5DiwhOQ24/9S2NzkOMjc5Dbj/1LUtOQ4sLTkrKysrKytZcnFdAHFdAV1ZWTMRIQEWFzY3ASERIxEBIwERmAEkAVswFhk1AV8BBbv+Vq/+WAW6+/KRSFCbA/z6RgTL+zUE4PsgAAEAnAAABR8FugAJAX2xEgu4/8BAChMVNAgYDBYCVQO4/+hAIQwWAlUIAgMDIAcIFAcHCAIHAwMICQQCAgkHCAQDIAYGBbj/7LQPDwJVBbj/8kALDQ0CVQUSDAwCVQW4//dAGgsLBlUFXSALASALUAtgC3ALgAsFCwgJIAEAuP/AQA0TFTQgAAEAIBAQAlUAuP/2tA8PAlUAuP/2tA0NAlUAuP/6QAsMDAJVAAQLCwZVALj/97QMDAZVALj/+EAKDQ0GVQBdCjtZGCsQ9isrKysrKytdKzz9PBBdcfQrKysrPBD9PAA/PD88Ejk5ARE5OYcELiuHfcSxBgJDVFi5AAP/4LcMETQIIAwRNAArK1kxMCsrAStDXFi0CEBGOQO4/8C2RjkIQDI5A7j/wLYyOQciGTkCuP/ethk5ByIyOQK4/962MjkHIiM5Arj/3kALIzkHDhQ5Bw4TOQK4//S2EzkHDh05Arj/9LYdOQcOFTkCuP/4sRU5KysrKysrKwErKysrKysAKysrK1kzETMBETMRIwERnMcDArrH/P4FuvuBBH/6RgSA+4AAAAIAY//nBd0F1AAOABsAykBQGg8BFBAUFBsXGxsEBBAEFAsXCxsEqRe2DsYOAxcXGBsCIB1AEU8TTxdAGlgFWAlXEFURXxNaF18YVhpXG4sXmQIQGR4DAxIeCwkVJiAHAQe4/+i0EBACVQe4/+60DQ0CVQe4//C0DAwCVQe4/+q0CwsGVQe4//S0DQ0GVQe4//pAIQwMBlUHGoAdAR0PJiAAAQAGCwsGVQAGDAwGVQAZHGNcGCtOEPQrK11N7U4QXfYrKysrKytdTe0AP+0/7TEwAV1xAF1dXXETEAAhMgQSFRQCBCMiJAI3EAAzMgARNAImIyIAYwGIATbLAUartP62v8/+uqjIAR3X2wEbeemRzv7XAsoBbQGdwv6l3N/+oLXIAVq+/vf+zwE0ARuzAQuT/uUAAgCeAAAE/QW6AA0AGACyQCxlEWsUAksQSxRbEFsUBAsMHg8ODgAXGB4CAQIACBImCAoNDQJVCBALCwZVCLj/9EAbDAwGVQgaIBoBIBoBGhgNIAEgAAEAIBAQAlUAuP/2tA8PAlUAuP/2tA0NAlUAuP/6QAsMDAJVAAwLCwZVALj/+rQMDAZVALj/8EAKDQ0GVQBdGTtcGCsQ9isrKysrKytdPP08ThBxXfYrKytN7QA/Pzz9PBI5Lzz9PDEwAV0AXTMRITIXHgIVFAIhIRERITI2NTQmJyYjIZ4CKZJNbJJZ7v7J/ogBe7yeXUwxhP6JBboOEmW2bbv+/f2sAwGMf1yDFQ0AAAIAWP+OBe4F1AAVACgBaECVXyafJgIZGDcVAgscBB8EIxscFB8UIwYqBS0XKyY7BTwXOiZMBUwXSSZdBVUjWCZvBXsDegWMA4wFlQCaA6QAqwPVANUW5QDlF+UYGhwFKwAqBTsFBF0FkhiWJtUmBCUWKiY0FjkmSRhJHEUfRSNLJlYIWBFVFVocWh1WH1cgVyJpBWYVayZ7Jo4cjibbGNwmGQsYARW4/9SyGzkAuP/UQDgbOQQYFBgqBToFBAIDFigDBygmGBYFAAYhAxMaBQIoJhgWAAUkHh4PAwIIJB4HCRomExgPDwJVE7j/7rQNDQJVE7j/6LQMDAJVE7j/8LQLCwZVE7j/9LQNDQZVE7j/9EAlDAwGVRNKAhogKoAqAiohJiALAQsYCwsGVQsGDAwGVQsZKWNcGCtOEPQrK11N7U4QXfZN9CsrKysrK+0AP+0/P+0RFzkSOQEREjkSFzkAETMQyRDJXTEwASsrXV0AcnFdAV1xciUWFwcmJwYjIiQCNTQSJDMyBBIVFAIlFhc2ETQCJiMiABEQADMyNyYnBPWHcjmenaPFx/68r7ABRcnLAUarbv3mqG2reemR2f7iARvcaFxbZZ1dK4c5e1vAAVza2QFkusH+pdq1/t+NL12cATmyAQqT/tf+2f7i/s4nOxkAAgChAAAFrQW6ABgAIgH8QCESCw4BEjYcWh9mCG0fBAkQDQ0GVQgQDQ0GVQcQDQ0GVSS4/8C0DAwCVQ24//S0DAwCVQy4//S0DAwCVQu4//S0DAwCVRK4/+KzEho0Erj/8LMiJzQRuP/isx0nNBC4/+KzHSc0D7j/4rMdJzQSuP/Ysx0mNBG4/+KzEho0ELj/4rMSGjQPuP/iQEkSGjQlDkocSiBTC1wcbRxyCXgOeQ+FCogPlw2pD7gP6A7nDxAODAwgEQ8UEREPEQ8MCRIbAiEaFgoGEhEQDQwFGAkJFhcaGR4XuP/AQBkLCwZVFxcAISIeAgECABgYDw8OCB4mDpwGuP/otA8PAlUGuP/2tA0NAlUGuP/gQCIMDAJVBgYNDQZVBl0gJHAkgCQDJCIYIAEgAAEAIBAQAlUAuP/2tA8PAlUAuP/2tA0NAlUAuP/6QAsMDAJVAAYLCwZVALj/97QMDAZVALj/+EAKDQ0GVQBdIzuoGCtOEPQrKysrKysrXTxN/TwQXfYrKysrGeQY7QA/PBA8EDw/PP08EjkvK/08EDw5LxIXOQERFzmHDi4rBX0QxDEwAV0rKysrKysrKysrKysrACsrK11DXFhACghADzkPEDoREjorKytZAXFDXFi5AA7/3kAaGTkRIhk5EiIZOQ5AHDkQIhQ5ECIfORAiFTkrKysrKysrWTMRITIWFhUUBgcWFxYXEyMDLgInJiMjEREhMjY2NTQmIyGhAorEzHrK000oVUz/9MJVblctIUvhAaGFlk6Xo/4wBbpPyHmc1h0lJE51/nEBMYSMOAsH/XUDMzd5R2iGAAABAFz/5wTrBdMAMAIVQCdjA2MEcwN0BAQlJzUDORxDA0kHTB1FH0QkRidTA1kHXB1XKIkTDiO4//K0EBACVSS4//K0EBACVSW4//K0EBACVSa4//K0EBACVSe4//K0EBACVSO4//a0DRACVSS4//a0DRACVSW4//a0DRACVSa4//a0DRACVSe4//ZARg0QAlUoDSYkAiQDJyU2DzQjRCVFL1ogViNVJWwLag1rDmYUZRh5C3oNeg99EHUkcyWGA4oLiQ2KD40QhSSDJZINlg+WFR6xBgJDVFhALSEmEhsmGgkmKQEmAAApGhIEMjEmAGUAAgANLXkbiRsCGyUWDS0eJyUBJQUWBbj/9EAMDAwGVQUeLQkeHhYDAD/tP+0rERI5XRESORESOV0REjldARESFzkv7S/tL+0v7RtALSUkDg0LBSEcHR4bCAcGBAMCBgElJCIODQsGBR4bLRpADAwCVY8aARrtFgAtAbj/wEASDAwCVRABIAFQAWABcAGQAQYBuAGwQBMtHh4WAwUeLQkbJhpKCSYAKQEpuP/qtA4OAlUpuP/0QA0MDAJVKRoyISYSASYSuP/stA4OAlUSuP/2tA0NAlUSuP/4QA8MDAJVElQgAAEAGTFjWxgrThD0XU3kKysr7RDtThD2KytdTe307QA/7T/tEP1dK+QQ/V0r9BESFzkRFzkREjk5ARIXOVkxMABdcSsrKysrKysrKysBXXETNx4CMzI2NjU0JicmJCcmJjU0NjYzMhYWFwcmJiMiBhUUFxYEFxYWFRQGBiMiJCZctw1fyH1vqlNQXDv+bFFpZ37ylKP5hgW6D62psKE5OAHZWIB6hvudx/7zmQHXEG6NV0JzREVnIxdhKzejZW/BZGnMgQ6LjoFbTzMzayg7tXZ1z3N06QAAAQAwAAAEugW6AAcAiUANBQIeBAMCAAgHBgUECbgCc7MgBAEEuAEBtwYgAQIvAwEDuAEBtQEBIAABALj/6EALEBACVQAIDw8CVQC4//K0DAwCVQC4/+K0DQ0CVQC4//y0DAwGVQC4//60DQ0GVQC4AnOzCLaZGCsQ9isrKysrK108EPRdPBD95F3mEDwQPAA/Pzz9PDEwIREhNSEVIRECE/4dBIr+GwUNra368wAAAQCh/+cFIgW6ABQA2UAKJg9YBFgIyQgEFrj/wEAWExU0NAQ7CEYESgh2D6YF6A8HDAACEbgCu7QGCRQmArj/7LQPDwJVArj/8kALDQ0CVQIQDAwCVQK4/+BAHAsLBlUCXSAWASAWUBYCYBZwFoAWAxYNJiAKAQq4/8BAChMVNAogEBACVQq4//a0Dw8CVQq4//a0DQ0CVQq4//pACwwMAlUKBAsLBlUKuP/3tAwMBlUKuP/4QAoNDQZVCl0VO1kYK04Q9CsrKysrKysrXe1NEF1dcfYrKysrTe0AP+0/PDEwAV0rAF0BMxEUAgQjIiQCNREzERQWFjMyNhEEYMJk/vvUzv76cMJHrX3WtgW6/LHd/vyjjgEN6QNP/LK/tWLCARQAAAEACQAABUYFugAKAT6xAgJDVFhAEgUBAAgCAQIACAoABQkIBQECBS/dzRDdzREzMwA/Pz8REjkxMBtAJC8FASoAKAMlCi8MMAxgDIkIiQmQDMAM8AwLIAxQDAIEAgsIArEGAkNUWLcJAQwLAAgBAgA/PwEREjk5G0AkCgkJIAgFFAgIBQABASACBRQCAgUJAQIF6SAKAAgJZQgBZQIIuP/AQAsoOVAIAYAIkAgCCLgBAUANAkAoOV8CAY8CnwICArgBAUARIAVQBQIwBWAFkAXABfAFBQW4AoizC2CoGCsZEPRdceRdcSvkXXErGBDtEO0APzwaGe0YPzyHBS4rfRDEhy4YK30QxAFLsAtTS7AUUVpYsgAPCrj/8bIJEgG4//GyCBQCuP/uODg4ODg4WQFLsChTS7A2UVpYuQAA/8A4WVkxMAFdcV0AXVkhATMBFhc2NwEzAQJB/cjSAX0uHyItAYzG/cIFuvvXgHB4eAQp+kYAAAEAGQAAB3YFugAYAdtAJikAJhEpEiYYOQA2ETkSNhhJAEcRSRJHGFgAVxFYElcYEJgImA8CsQYCQ1RYQDMQARoZKxU0BTQMRAVEDEsVVAVUDFsVZAVkDGsVdAV0DHsVDwUVDAMAARIIAAgPAggCAQIAPz8/Pz8REhc5XQEREjk5G0AeAwQFBQIGBwgIBQoLDAwJDQ4PDwwUExISFRYXGBgVuP88swUAGCC4/zyzDBIRILj/PEBaFQgJIAAFAgIgAQAUAQEAGAUICB4VGBQVFRgSDAkJHhUSFBUVEhEMDw8gEBEUEBAREgkMCBgVBQ8REAwAAgUVDAUDGBAPDwkJCAgCAgECGBISEREACBoXFxoQQQkBUQAgAAwBUQAVAVEAQAAFAVG2ICABAQEZGbgBi7GoGCtOEPRdGhlN/RoY/f0aGf0YTkVlROYAPzwQPBA8PzwQPBA8EDwQPBIXOQESOTkREjk5ERI5ORE5OYdNLiuHfcSHLhgrh33Ehy4YK4d9xIcuGCuHfcQrKyuHDhDExIcOEDzEhw4QxMSHDhDExIcOEMTEhw4QxMQBS7APU0uwEVFaWLISChi4//Y4OFkBS7AlU0uwKlFaWLkAAP/AOFkAS7ALU0uwDlFaWLMMQAVAODhZWTEwAXJdIQEzExYXNjcBMxMSFzY3EzMBIwEmJwYHAQGe/nvH3yQaOAoBF+rSTyMcLebD/m67/ssnBxcU/skFuvw/l5XrJAPe/Rr+7POLtAOu+kYEXYwgZUf7owABAAkAAAVJBboAEwK1QCkmEgEZARYLAikSKRM4ATcDOAg4CTgNOg41EjcTChITIBIhNBIgEiE0Drj/4LMSITQNuP/gsxIhNAm4/+CzEiE0CLj/4EBsEiE0BCASITQDIBIhNHcBdwsCJgQpBygLKg4mEjYEOgg6CzoONRJICFQEXQhcC1oOVBJnAWUEaghrC2kOZRJ1BHoIeQt6DXcSdxOGBIoHigqVBLgItxLGBMkI1wTYCNkO1hLnBOgI6A7mEiwGuP/qQBEMEQJVEBYMEQJVCwgMEQJVAbj/+LMMEQJVsQYCQ1RYQAsMABUUEBgKEQZVBrj/6EAOChEGVRAGAAINAAgKAgIAPzw/PBESOTkrKwEREjk5G0BdBgcICQkBBgUEAwMLEBATDw4NDQEQEA0REhMTCwEACQINCwMMEwoLAQYQAhMJChMTIAAJFAAACQMCDQ0gDAMUDAwDCgkJAwMCAhMNDQwMAAgvFQEVFxcaIAxADAIMuAFftyAKkArACgMKuAG4tV8CnwICArgBuEAKBrRAEFAQzxADELgBX0AKIAAZFBXCIWCoGCsrTvQaGU39XRjlGe1d7V39XRhORWVE5l0APzwQPBA8PzwQPBA8hwVNLiuHfcSHLhgrh33EABESOTk5OQ8Phw4QPDwIxIcOEDw8CMSHDhA8PMSHDhDExMRZKysAKysxMAFdAF0BKysrKysrKytDXFi5AAv/3kALGTkBIhk5DhgbORK4/96yGzkTuP/eshs5BLj/6LYbOQgiGzkJuP/Ashw5Dbj/wEAfHDkTQBw5A0AcOQ0OFhc8ExIWFz0ICRYXPAMEFhc9C7j/3kAuEjkBIhI5CwwdIT0BAB0hPAsKHSE9AQIdITwLDBMXPQEAExc8CwoTFz0BAhMXPCsrKysrKysrKysrKysrASsrKysrKysrKysrWQFxAV1xMwEBMwEWFzY3ATMBASMBJicGBwEJAjf+DOcBClMjMUMBJ9P9/QIr8P6PHyExFf6QAvwCvv6IdT9QVwGF/U38+QILLTVQHv4BAAABAAYAAAVGBboADAFqtggJOgMEOwm4/+ezEhc0CLj/50AOEhc0BBkSFzQDGRIXNAm4/9izGCE0CLj/2EA7GCE0BCgYITQSJgQpCCoKLw4EaAFoBmgL3gYEBQQDAwYIBwkGBgkGAwkKDBACVQkgCgsUCgoLBgMGCQO4//ZAFgwQAlUDIAIBFAICAQYMCwYBAwIAAQu4AhlACQoKCQMCAgAIDrgCGEAJDAlSQAqACgIKuAG1QA0LCwwgAANSTwKPAgICuAG1QAkBAQAUEBACVQC4//ZACw8PAlUADA0NAlUAuP/itAwMAlUAuAIYtg0OwiFgqBgrK/YrKysrPBD0Xe0Q/TwQ9F3tEOYAPz88PDwQ9DwREhc5ARI5hy4rKwh9EMQFhy4YKysIfRDEhw7ExIcQDsTES7AXU0uwHFFaWLQIDAkMBLr/9AAD//QBODg4OFkxMABdAV1DXFhACQkiGTkIIhk5BLj/3rEZOSsrK1krKysrKysrKyshEQEzARYXNjcBMwERAjv9y+wBIVBFQl4BHOL9twJtA03+Rnx8c5ABr/yz/ZMAAAEAKQAABLAFugAMAQyxEg64/8BADw0RNEgBRwhICQMKCAsJArEGAkNUWEAODAAODQELHgwICAUeBgIAP/08P/3EARESOTkbQCurBAEDAgEBBAkKBAgKCiYdITQoCgH5CgEKIAEEFAEBBAooCxw0ASgLHDQIuP/YswscNAS4/9hAEwscNAEKBAgFHgcGAgsKHgwACAq7AbUAAQAEAbVAGwAHMAhACAIISgw/CwELGg4BAAUGUQAZDbaZGCtOEPRN9DwQPE4Q9l08TfRxPBDkEPwAPzz9PD88/Tw8ETkBKysrK4cFLitdcSuHfcQOEMSHDhDExAFyWTEwAXFdK0NcWEAJAiIhOQEYITkJuP/etRk5AiIZOSsrKytZMzUBNjchNSEVAQchFSkC71BI/M4EGvzJWQOotAOrZEqtrfwHZ60AAQCL/mkCGAW6AAcARkArBAMrAQIQBQYrAAcSAwICBwauBAUlAQAGDAwCVQAICQkCVSAAAQCsCJ1oGCsQ9l0rKzz9PPQ8PBA8AD88/Tw/PP08MTATESEVIxEzFYsBjdnZ/mkHUZX52ZUAAAEAAP/nAjkF0wADAExAJAEBIhQ5ACIUOZgAAQEAkACgAAIAdgMCFAMDAgIBAAMACgPoALgBqbcC6AEBBLN6GCsQPBDt9O0APzw/PIcFLitdfRDEMTABXSsrBQEzAQGp/leRAagZBez6FAABACf+aQG0BboABwA/QBcEBSsHBhADAisAARIGBQUBAq4EAyUHALj/7EAKDAwCVQCsCZtaGCsQ9Cs8/Tz0PDwQPAA/PP08Pzz9PDEwASE1MxEjNSEBtP5z2dkBjf5plQYnlQAAAQA2ArIDiwXTAAYAYbkAAP/AQBUUOQBAFDkmAikDAgYCCQMCBQEGPAG4AWVAFwIFPAQAPAEGBgMCCDgE3ANsAtwBaQcIvAEyACEBvwGBABgrK/b09vTkERI9OS8YEO0Q7QAv7e0QPDEwAXFxKysTIwEzASMD77kBYZEBY7X3ArIDIfzfAlUAAAH/4f5pBIr+6wADABpADAE/AAIaBQAZBENBGCtOEOQQ5gAvTe0xMAM1IRUfBKn+aYKCAAABAFkEqgHRBcIAAwBgQAsDOBcZNAJADxE0ALj/wLMXGTQDuP/AQBoWGTRQAVADAkADUAACAwIAAAEQAQIBhwIAALgCU7IBhgO4AmCzAhkEcbkBLwAYK04Q9E3t9O0AP/1dPBA8MTABXV0rKysrASMDMwHRkefxBKoBGAAAAgBK/+gEHAQ+ACgANwItQCwJDQkqGQ0aKikNKio5DTYVNxs6KkkqXQ1dKmoNaSpgMIoNhimaFpsaqQ0VKLj/6LQLCwZVJ7j/6EAZCwsGVaYZqii2GbsoxBnPKNIV3SgIRBYBHrj/9EARDAwGVRISDAwGVQUMDAwGVTW4/+BAVQwMBlUfFx8YKywqNDkEOSxJBEgsVghZK2YIaSt2DIcMyQz5DfkrETc0DgEEEC8kNBcyIRQYXylvKQIpHC8OPw6PDp8O/w4Fnw6vDu8OAw4MDw8CVQ64/+q0EBACVQ64//RAFRAQBlUODA0NBlUOBg8PBlUODhwDF7gCqrYYlRQcHAcAuP/0QBoMDAZVAEUnCjIcAwspYRBhAAYNDQJVACUhJLj/7LQQEAJVJLj/7EALDQ0CVSQEDAwCVSS4/+S0CwsCVSS4//S0CwsGVSS4/9xACxAQBlUkBg8PBlUkuP/8tAwMBlUkuAJbQA4nQAAmECYgJjAmryYFObj/wLQODgJVJrj/1rYODgJVJjE5uP/AQA0eIzQwOcA5AqA5ATkXuP/0QEEQEAZVFyUYIi8kvwbPBgIfBj8GAgYODw8CVQYMDQ0CVQYYDAwCVQYMCwsCVQYMCwsGVQYODQ0GVQYQDAwGVQYxOBD2KysrKysrK11x7fTtKxBdcSv2Kytd7fQrKysrKysrKzz9K+XlAD/tP+QrP+395BESOS8rKysrK11x7XEREjkREjk5ARESFzkxMABdKysrKwFxXSsrAHElBgYjIiY1NDY2NzY3Njc2NTQnJiMiBgcnPgIzMhYWFxYVFRQWFyMmAwYHDgIVFBYzMjY3NjUDPGS5aq+8R3NINWvaZwEzRYh/eR2wGG7QiYiqUBAJFyK8HBdixG9cMm1paKImHYNVRquFToFOFA4NGiQlCm4tPVlxGHGLS0BhSi548PuFPTgB3SgcEChNL0hgW089dwACAIb/6AQfBboAEAAdAYBAmwEFDA8kBTUFRQUFPx+wHwIfHyIcMxxCHHAfkB8GOhM8FjwaTBZMGl0IXQ1YD10WXhpqCGwNaA9uFm4awB/ZDNoX2hniE+wX7BnjHeAf/x8ZIAUvDy8UMAU/D0AFTA9QBWYF2h31BPoQDBAVDgQGAgAbHAYHAQoVHA4LGCTQCwEQC0ALYAuACwQfQA0NAlULDA8PAlULGA0NAlULuP/2tAwMAlULuP/wtAsLBlULuP/0tA8PBlULuP/gtAwMBlULuP/0QC8NDQZVC3QBETMABAwMAlUABA0NBlUAMwMlAgLAAQGQAaABsAHwAQQfAT8BTwEDAbj//rQQEAJVAbj//EAdDg4CVQEMDQ0CVQEQDAwCVQESCwsCVQEMCwsGVQG4//i0EBAGVQG4//xAFg8PBlUBGAwMBlUBFA0NBlUBGR5HNxgrThD0KysrKysrKysrK11xcjxNEP30KyvkEP0rKysrKysrK11x7QA/7T8/7T8RORESOTEwAF0BXXFyAHEhIxEzETYzMh4CFRAAIyInAxQXFjMyNjU0JiMiBgEtp7RysWKvcUD+8r28awI0VZF2rKV1dqwFuv31j0+PynP+7/7WnQGWv1WLzcvQxs0AAQBQ/+gD7QQ+ABoBWrECAkNUWEA0Dn8PAQ8LAUAAUABwAAMABBIcCwcYHAQLAQ4VBwgODgJVBwwNDQJVBwwMDAJVBxALCwJVBy8rKysrzdTGAD/tP+0QxF0yEMRdMjEwG0BHCQwBHxxDE0MXUxNTF2ATYBebApsDmg2kEKQaDAgNGQpqAmkDagV1DHANgA2mDLUJtgq1DAwWDIYM4wIDDiJfD28Pfw8DDwG4AqpAeTAAQABQAGAAcACQAKAA4ADwAAkADw8LAAAEEhwLBxgcBAscDwEPJA4IDQ0GVQ4iGwABACQLKx8BAQABAQFACwsGVQFAEBAGVQFIDAwGVQEaDQ0GVQFJHBUkzwcBHwc/BwIHDgsLBlUHChAQBlUHEgwMBlUHMRs0xBgrEPYrKytdce0Q9isrKytdcktTI0tRWli5AAH/wDhZ7XL0K+1yAD/tP+0SOS8ROS8QXeQQXeQxMABdcQFdcVkBFwYGIyIAETQSNjMyFhcHJiYjIgYVFBYzMjYDPLEd767a/vdy6Ymt3B+vGX9aiKqkhGqOAYUXt88BHQEKrAECga+hG2tsw9PWwoIAAAIARv/oA98FugARAB0BVUCkCgIEDSUNNA1EDQU1FDUcVwJUClIUUxxnAmQFZQljFGAcwB/UBdUT3RnlE+UU7xfrGeUd4B//HxYfHysaPBY8GksacB+QHwcuAiQNLhY6AjUNSwJFDUYUSRxXClYNZw3lBucW+gH0DhABFQMOCxAPABscCwcRAAoVHAMLGDMBACURDyUQENARARARQBFgEYARBB9ACwsCVR9ADQ0CVRESEBACVRG4//RAEQ8PAlURBg4OAlURGA0NAlURuP/yQAsLCwZVEQ4QEAZVEbj/7rQMDAZVEbj/+EBCDQ0GVRF0EiS/B88H3wf/BwQfBz8HTwcDBx4LCwJVBxgMDAJVBx4NDQJVBwwLCwZVBwwNDQZVBxoMDAZVBxkeNFAYK04Q9CsrKysrK11xTe39KysrKysrKysrK11xPBDtEP085AA/7T88P+0/PBE5ERI5MTAAXQFxXQBxITUGIyImJjU0EjYzMhYXETMRARQWMzI2NTQmIyIGAzhlxH/VdWrUg2CWL7P9IKx1dqWoe3ihhp6M+6OfAQOKUUECDvpGAhLMysHG2szEAAACAEv/6AQeBD4AFQAdAVNAFx8AHBUCVQNdBV0JVQtlA2sFbwllCwgVuP/ktA0NBlURuP/kQFINDQZVHRwNDQZVJxLZBfoU9hoEMRI6GTEcQRJNGkEcURJcGVIcYRJtGmEceAZ4FfYC9hgQABYBDw0XF1AWYBZwFgMWHA+QEKAQAhAQBBscCgcAugKqAAH/wLQQEAJVAbj/wEAQEBAGVRABAQGVExwECxdADbj/3LQNDQJVDbj/7rQNDQZVDbj/6rQMDAZVDbj/wEAJJyo0sA0BDRofuP/AsyUmNB+4/8BAQR4jNDAfAR8WMxAkB0AkKjQfBz8HTwcDByALCwJVBxgMDAJVBxwNDQJVBw4LCwZVBxwMDAZVBxYNDQZVBxkeNDcYK04Q9CsrKysrK10rTf3kThBxKyv2cSsrKytN7QA/7f1dKyvkP+0SOS9dPP1xPAEREjk5EjkxMAFdAF0rKysBcXIBFwYGIyIAERAAMzIAERQHIRYWMzI2ASEmJyYjIgYDXros7rnp/u8BFNzVAQ4B/OgKsoVjjP3aAlEMOFaJfKkBVhejtAEfAQMBDAEo/t7++RAgr7poAZWGQ2imAAEAEwAAAoAF0wAXAQ1AHhQJAQ8ZLxkwGUAZcBmbDJwNqQ0IGg0oDbAZwBkEGbj/wEAoGh80HQgNAwwPHAoBFQIrFBMEAwYACp8UART/E0AEFyUEAAMCkgEBALj/wLMxODQAuP/AQCscHzSQAAEZQA8PAlUZQA0OAlUAFBAQAlUAKA8PAlUAIg4OAlUALA0NAlUAuP/yQAsMDAJVABQLCwZVALj/6rQQEAZVALj/5rQPDwZVALj/+rcMDAZVAKMYGbwBugAhAPYBCgAYKyv2KysrKysrKysrKytdKys8EPQ8EDztEO3tXQA/Pzw8PP08P+05ETkxMEN5QBQQEQYJBwYIBgIGEAkSGwARBg8bASsBKyqBgQErcV0AcjMRIzUzNTQ3NjYzMhcHJiMiBhUVMxUjEbKfnxMag3ZMXBs4MlJEz88DmoxxazRGVxKdCkZgYoz8ZgACAEL+UQPqBD4AHgAqAW9AYAsLBRQsCyUUTAtFFAYJHRkdLAsmFCwjOQs2FEoLRhRWB1gLaAv6CvUVDi4jLCc+Iz4nTCeQLKAsBzYhNik/LEYLRiFFKVQhVClpB2MhYylgLIAs2ifoIe4j7ycRFxYGFbgCsbQoHBMHAbgCqkAQIAAwAGAAcACAAMAA0AAHALgCfUAyBRwcDwpFIhwMChYVMyUzCiUYGNAXARAXQBdgF4AXBCxACwwCVSxADQ0CVRcSEBACVRe4//RAEQ8PAlUXBg4OAlUXFg0NAlUXuP/qQAsLCwZVFxIQEAZVF7j/7rQMDAZVF7j//EBKDQ0GVRd0DwElACIfJL8Pzw/fD/8PBB8PPw9PDwMPIAsLAlUPGgwMAlUPIg0NAlUPHAsLBlUPDA0NBlUPGgwMBlUPGSssdCE0UBgrK070KysrKysrXXFN7fTtEP0rKysrKysrKysrXXE8EP3k9jwAP+3kP+39XeQ/7eQ/PDEwAV1xAF1xFxcWFxYzMjY3NicGIyICNTQSNjMyFzUzERQGBiMiJhMUFjMyNjU0JiMiBmavCzJDdH2IGA4BdrDb8G7Rjbx6pmXboL7qmaZ9fKitenioWBpRJTJkWjewiwE83ZgBAYyYgPxq+M94qwMq0cC/zMPGwwAAAQCHAAAD6AW6ABQBYbkAFv/AsxUXNAO4/+BADg0NBlUlBDUDRQO6DQQDuP/gQDoXGTQXCBEMERQDBQEADxwFBxQLCgwlCUAzNjT/CQHACQEWQAsLAlUWQBAQAlUJKBAQAlUJFA4OAlUJuP/sQBENDQJVCQQMDAJVCRoLCwJVCbj/9kALCwsGVQkUEBAGVQm4//hACw0NBlUJCg8PBlUJuP/2tgwMBlUJTha4/8BAFzQ2NLAW8BYCcBagFrAW/xYEFgIUJQEAuP/AQBAzNjTwAAEAACAA0ADgAAQAuP/6tBAQAlUAuP/6QBcODgJVAAQMDAJVAAgLCwJVAAQLCwZVALj/+kAWDw8GVQACDAwGVQACDQ0GVQBOFUdQGCsQ9isrKysrKysrXXErPP08EF1xK/QrKysrKysrKysrKytdcSvtAD88P+0/ETkROQESOTEwQ3lADgYOByUOBgwbAQ0IDxsBACsBKyuBACtdKwErMxEzETYzMhYWFREjETQmIyIGBhURh7R+wHauS7R1a1CNPAW6/fKSXaSc/V8CoYd7U459/bsAAgCIAAABPAW6AAMABwDNQF4JNgsLAlVPCZAJoAmwCcAJ3wnwCQcACR8JcAmACZ8JsAnACd8J4An/CQofCQEAAQcEAgMJBgN+AQAGBQYECgYHJQUABJ8EoASwBMAE4AQGwATwBAIABCAE0ATgBAQEuP/4tBAQAlUEuP/6QBcODgJVBAQMDAJVBAoLCwJVBBQLCwZVBLj/6rQQEAZVBLj//rQNDQZVBLj//EAKDAwGVQROCEdQGCsQ9isrKysrKysrXXFyPP08AD8/PD/tARESOTkREjk5MTABXXJxKxM1MxUDETMRiLS0tATrz8/7FQQm+9oAAAL/ov5RAToFugADABIA1UBFBAUlBTsEMwWGBQUXCAUFBwQEAgQFEwABDQsCAxQMBBEFCwcDfgEACwYHHBEPkBQBFBcXGgwMDSUKCpALAR8LPwtPCwMLuP/6QDcODgJVCxANDQJVCxAMDAJVCwwLCwJVCx4LCwZVCwwQEAZVCwgMDAZVCwwNDQZVCxkTFK0hR1AYKytO9CsrKysrKysrXXE8TRD9PE4QRWVE5nEAP03tPz/tERI5EjkBERI5ORESOTkRMzOHEAg8MTBDeUAOCBAPJggQChsBCQ4HGwAAKwErK4EBXRM1MxUBNxYzMjY1ETMRFAcGIyKGtP5oIjYfNza0M0GXSQTp0dH5e5kOSZIEXPugxE1kAAABAIgAAAP4BboACwJhQBsGDA0NBlUHBlYGWgkDDw3zBfYGAwkMEBACVQa4//S0DAwCVQq4//S0DAwCVQm4//S0DAwCVQO4/+hAEA0NBlVVA3cKAhIGIBMhNAi4//CzEic0Cbj/8LQSJzQSBbj/8LMSITQJuP/wQIQSJzQGBAQFBAY3CUcEBSUGLQpYCncDdQraA+MGB6YGASMGJgclCDkGOAk/DU8NWQRZBlgHWQl9BHkFmQnGBtIE1gbkBukH9wb5CBUSCgoFAwMEAgYGBwkJCAoKBQkICCUHBhQHBwYDBAQlBQoUBQUKCgkGAwQIAQIABAUGBwgICwsACgS4AQ9ACQUEDAwGVQUiCLgBD0AhIAc/BwIHEAwMBlUHGpANAQ0LJQACJQEBkAABPwBPAAIAuP/+QDEODgJVABANDQJVABAMDAJVAAoLCwJVABILCwZVABIMDAZVAAgNDQZVABkMDeEhR2YYKytO9CsrKysrKytdcTxNEO0Q7U4QcfYrXU3t9CvtAD88EDwQPD88PzwRFzmHBS4rBH0QxIcFLhgrDn0QxAcQCDwIPAMQCDwIPLEGAkNUWEANSwkBHwmEAwIJGA0RNAArXXFZMTABQ1xYQAoJLB05CQgdHTwGuP/esh05Brj/1LIgOQa4/9SxITkrKysrK1ldAHFdAXEAKytDXFi5AAb/wLIhOQO4/8CyFjkDuP/eshA5Brj/3rIQOQO4/96yDDkDuP/esQs5KysrKysrWQErKytDXFhAEt0EAQgUFjkJCBQUPAkIFBQ8Brj/9rIYOQa4/+yxGzkrKysrKwFdWQBdKysrKysBXXErMxEzEQEzAQEjAQcRiLQBqun+agG/3v6hfwW6/LwBsP52/WQCH3r+WwAAAQCDAAABNwW6AAMA47YFNgsLAlUFuP/Aszc4NAW4/8CzNDU0Bbj/wLMwMTQFuP/AsyIlNAW4/8BAJRUXNA8FHwWfBd8FBE8F3wXwBQMfBXAFgAX/BQQBAAAKAgMlAQC4/8CzNzg0ALj/wEAVMzU0nwABwADwAAIAACAA0ADgAAQAuP/4tBAQAlUAuP/6QB0ODgJVAAQMDAJVAAoLCwJVABQLCwZVAAgQEAZVALj//rQNDQZVALj//7QMDAZVALj//EAKDAwGVQBOBEdQGCsQ9isrKysrKysrK11xcisrPP08AD8/MTABXXFyKysrKysrMxEzEYO0Bbr6RgAAAQCHAAAGJgQ+ACMBx7kADf/0tA0NBlUIuP/0tA0NBlUJuP/YQE0LDTQlBOQE5AnhF+UgBdUF9iACFwggIwkYGyAJAwMjHhwGFRwLCwYHAQYjGhkQCtAlAZAloCUCJRcXGg4lkBEBEQQQEAJVERgPDwJVEbj/7EALDg4CVREUDAwCVRG4/+hAFwsLAlURAgsLBlURDBAQBlURBg8PBlURuP/6tAwMBlURuP/4tA0NBlURuAFdQAwYJZAbARsYDw8CVRu4/+xACw4OAlUbFAwMAlUbuP/uQBELCwJVGwQLCwZVGwoQEAZVG7j//kALDQ0GVRsMDw8GVRu4//y0DAwGVRu4AV1AFgACMyMlAdAAAZAAoAACHwA/AE8AAwC4//5AHQ4OAlUAEA0NAlUAEAwMAlUADAsLAlUAFgsLBlUAuP/8tBAQBlUAuP/0QBQPDwZVAAoMDAZVAA4NDQZVABkkJbgBeLMhR1AYKytO9CsrKysrKysrK11xcjxN/eQQ9CsrKysrKysrK13t9CsrKysrKysrKytd/U5FZUTmcXIAPzw8PD8/PE0Q7RDtERc5ARESORI5MTBDeUAODBQTJhQMERsBEg0VGwEAKwErK4EBXQBdKysrMxEzFTY2MzIWFzYzMhYVESMRNCYmIyIGFREjETQmIyIGBhURh6Eypmp2lx9+yp6qsyNcPnCUtFhkTIE6BCaVTl9iWLqvtv0nAp1sXzqVpP2XArJ4eFCakf3ZAAABAIcAAAPmBD4AFgF9QBMFAwYTAqgQuBDjA+cT8AP2EwYEuP/wQDwLDTR5EAGYENAY4Bj/GAQgCBQOFBYSHAUHAQYWDQoNDgwOJBhAEBACVRhACwsCVQsoEBACVQsUDg4CVQu4/+xAEQ0NAlULBAwMAlULIgsLAlULuP/0QAsLCwZVCxQQEAZVC7j/+UALDQ0GVQsKDw8GVQu4//ZAEgwMBlULQDM2NP8LAf8LAQtOGLj/wEAaNDY0sBjwGAJwGKAYsBjAGAQYAwIzFRYlAQC4//a0ERECVQC4//q0EBACVQC4//pAFw4OAlUABAwMAlUACgsLAlUABAsLBlUAuP/6QBEPDwZVAAIMDAZVAAQNDQZVALj/wEASMzY08AABAAAgANAA4AAEAE4XEPZdcSsrKysrKysrKys8/Tz0PBBdcSv2XXErKysrKysrKysrKysr7TwQPAA/PD8/7RE5ARI5MTBDeUAWBhEJCggKBwoDBhAmEQYOGwEPChIbAQArASsrKoEBXXEAK11xMxEzFTYzMhYWFxYVESMRNCYmIyIGFRGHonXdYKFQEAq0KmtIc6cEJpevRXBNMn39cwKGbm1Bksz9vAAAAgBE/+gEJwQ+AA0AGQFrthUYDQ0GVRO4/+i0DQ0GVQ+4/+hAcw0NBlUZGA0NBlUSBwoZDEcGSAhWBlkIZwZpCAg0EDoSOhY1GEUQSxJLFkUYXAVcCVIQXRJdFlIYbQVtCWQQbRJtFmQYdwEVCQYFDVsDVAVUClsMbANlBWUKbAwKFxwEBxEcCwsUJBtADQ0CVRtACwsCVQe4/+pAEQ8PAlUHGA0NAlUHEAsLAlUHuP/wtAsLBlUHuP/wtA0NBlUHuP/wtA8PBlUHuP/wtAwMBlUHuP/AQBMkJTQwBwEABxAHIAcDBzHfGwEbuP/AQEkeIzQwGwEbDiQADA4PAlUAEg0NAlUADAwMAlUAHAsLAlUADgsLBlUADg0NBlUADBAQBlUAFgwMBlUAQCQlNB8APwACADEaNDcYKxD2XSsrKysrKysrK+0QcStd9l1dKysrKysrKysrK+0AP+0/7TEwAXFdAHFDXFhACVMFUwliBWIJBAFdWQArKysrExA3NjMyABUUBgYjIgATFBYzMjY1NCYjIgZEpInF2wEWe+uL3/7tubKHhrKzhYeyAhMBJ452/uH9zeuCAR4BDczLzNHFy8oAAgCH/mkEIQQ+ABIAHgFiQI4MEC0QPRBLEAQ/ILAgAh8gKQwjHTIVMh1CHXAgkCAIOhc6G0oXShtZCFsMXBdcG2oIawxpEG0XaxvAINMU3RjdGtMe5BTkHuAg/yAWIwQrECsVNQQ6EEYEShBaEOUL6x3+EAsRDgMWHBwGBwEGFhwOCwAOGSTQCgEQCkAKYAqACgQgQAsLAlUgQA0NAlUKuP/mQAsPDwJVChgNDQJVCrj/+rQMDAJVCrj/7rQLCwZVCrj/9LQPDwZVCrj/6EAjDAwGVQp0ARMzAjMSJQAAwAEBkAGgAbAB8AEEHwE/AU8BAwG4//xAHQ4OAlUBEA0NAlUBEAwMAlUBEAsLAlUBDAsLBlUBuP/2tBAQBlUBuP/8QBYPDwZVAQwMDAZVARINDQZVARkfRzcYAStOEPQrKysrKysrKytdcXI8TRD99OQQ/SsrKysrKysrXXHtAD8/7T8/7RE5EjkxMABdAV1xcgBxExEzFTY2MzIWFhUUAgYjIiYnEQMUFjMyNjU0JiMiBoekOpJoiNBqdd97Wo8uEaZ2eKundHOx/mkFvYpRUYz/mKP++4tMOv37A6TNxMvVy8rXAAACAEj+aQPgBD4AEAAcATZAjgsCKwIqGDsCSwJ5DAY/FT8ZSxmQHqAeBTQTNBs/HkQTRBtTE1MbYxNjG2AegB7UBtUS5gbpDOoYECkCIgwrFTkCNQxJAkYMWgJpAtkM2xjjFukZ5hv8Ag8BBA0UGhwLBw4GFBwECwAOFw4zACUQENAPARAPQA9gD4APBB5ACwwCVR5ADQ0CVQ8SEBACVQ+4//RAEQ8PAlUPBg4OAlUPFg0NAlUPuP/+QAsMDAJVDxYQEAZVD7j/6LQMDAZVD7j/9EA/DQ0GVQ90ESS/B88H3wf/BwQfBz8HTwcDByQLCwJVBxoMDAJVByINDQJVBxYMDAZVBxoNDQZVBxkdHnQhNFAYKytO9CsrKysrXXFN7f0rKysrKysrKysrXXE8EP30PAA/P+0/P+0RORI5MTAAXQFdcQBxAREGBiMiABE0NjYzMhc1MxEBFBYzMjY1NCYjIgYDLCqXVb3+72/TfsVxov0hrHhzpq92daP+aQIIO04BLgEHoP6Dpo76QwOtzc3Dx9TWxwAAAQCFAAACxgQ+ABEAyUA7LxMBEAQBIwQ0BEMEUwRmBHQEBgkRCAkICQ0TEQkNAAMIAQscBgcBBgAKCSiQCAEIIiATARMCIhElAQC4/8BAEDM2NPAAAQAAIADQAOAABAC4//i0EBACVQC4//hAEQ4OAlUABAwMAlUABgsLAlUAuP/8tBAQBlUAuP/0QBYPDwZVAAYMDAZVAAgNDQZVAE4SR8QYKxD2KysrKysrKytdcSs8/eQQXfRy5AA/Pz/tETk5ETk5ARESOTkAEMmHDn3EMTAAXXIBXTMRMxU2NjMyFwcmIyIGBwYVEYWiPmk/W14+QkI7XhQeBCahcUg6pydHP2By/dQAAAEAP//oA7EEPgAwAxdAewQiFCI6CUoJRCRWImUifAmOCYQkphOrLMIDDQkXGhgXMEss1hcFGwJVAgIQMgEKGFwIXAlcClwLXAxcDWoIaglqCmoLagxqDbQmtCcPJyYkJyQpNiRaClkLZCZkKHQjdCSAJJMKnAySKJcslTCkCqkMoyekKLMmxSYWKLj/9LQNDQZVIrj/9LQNDQZVI7j/9LQNDQZVJLj/9LQNDQZVKLj/9LQMDAZVIrj/9LQMDAZVI7j/9LQMDAZVJLj/9LQMDAZVHbj/3kASHjlaCCclDAoEGiAmFQQLLh0auAKqQCIZLAsLAlUfGT8ZTxlfGa8ZzxkGDxkfGW8Z3xkEHxmPGQIZvQJVABUAAAKqAAH/wEAUCwsCVRABQAECEAHQAQIAARABAgG4/8CzFBY0Abj/wEAQDhE0AQEuXB1sHQIdHBUHBLj/9LQLCwJVBLj/5rQQEAZVBLj/5kATDw8GVQQcLgsfGgEaJBlAExg0Mrj/wEAvDw8CVRkYDw8CVRkYDQ0CVRkWDAwCVRkgEBAGVRkgDw8GVRkQDAwGVRkWDQ0GVRm4AluyByQquP/AtRw50CoBKrj/5rQMDAJVKrj/6LQPDwJVKrj/6LQMDAZVKrj/6rYNDQZVKhoyuP/AQCEnKjRgMsAyAj8ygDICMhABAQEkABgNDQJVABANDQZVACC4//S0DQ0CVSC4//S0EBAGVSC4//RAGQ8PBlUgJA8QCwsCVQ8WDAwCVQ8gDQ0CVQ+4//pAIA8PAlUPDgwMBlUPDA0NBlUPIt8AAT8ATwACABkxNDcYK04Q9F1xTfQrKysrKyvtKysrECsr7XJOEF1xK/YrKysrcStN7fQrKysrKysrKyvtcgA/7SsrKz/tcRI5LysrXXFyK+QQ/V1xcivkERI5ERI5ARESFzkxMEN5QEAnLR4jBRQsJhEQEhATEAMGIg0gGwAJKAcbAQUtBxsBHhQgGwAhDiMbACIjDQwIKQobASgnCQoGKwQbAB8QHRsBACsrEDwQPCsQPBA8KwErKysrKiuBgYEAKysrKysrKysrXXEBXXJxXRM3FhYzMjY1NCcmJy4CNTQ2NzY2MzIWFhcHJiYjIgYVFBcWFxYXHgIVFAYGIyImP7IPiXt8eDUlk8aZT0E4KpFTfb1aEbAMc2l8ahYWLxuEv5dWacZ9z9kBPRxrcmVEPSMYJTJJgU5HeSgfK0h7ZxhSXFI3IxwdEwokM0F8XFqfV6wAAAEAJP/yAioFmQAXANi5AAr/wLMjJjQJuP/AQEEjJjSAGQEAAQwNCgEDABYQCSsPCgYWHAMLDxAiACIBDRIlDAH/BwhFCUVgB3AHgAeQBwQAByAHoAewB8AH0AcGB7j/7rQQEAJVB7j/9LQPDwJVB7j/8rQODgJVB7j/+LQNDQJVB7j/+LQMDAJVB7j/+rQQEAZVB7j/8EALDw8GVQcGDAwGVQe4/+i0DQ0GVQe6AmoAGAE2sWYYKxD2KysrKysrKysrXXH05BDtPP08EOT0PAA/7T88/TwRORI5ETMzEMkxMAFdKyslFwYjIiYmNREjNTMRNxEzFSMRFBYWMzICEBpMPGJsLISEs7W1EysoHqGfED5logJjjAEHbP6NjP2TTSwaAAABAIP/6APgBCYAGAFPuQAa/8BACRUXNAIgExY0D7j/8EAzEhQ0KxMBJAgTFgwBExYLBgAKERwDCwAzFiUYF0AzNjQaQBAQAlUXKBAQAlUXEg4OAlUXuP/sQAsNDQJVFwQMDAJVF7j/9EALCwsGVRcUEBAGVRe4//hACw0NBlUXDA8PBlUXuP/2QA0MDAZV/xcBwBcBF04auP/AQBU0NjSwGvAaAnAaoBqwGv8aBBoMJQm4/8BAEDM2NPAJAQAJIAnQCeAJBAm4//i0EBACVQm4//hAEQ4OAlUJBAwMAlUJCgsLBlUJuP/2QBYPDwZVCQIMDAZVCQINDQZVCU4ZR1AYKxD2KysrKysrK11xK+0QXXEr9l1xKysrKysrKysrKys8/eQAP+0/Pzw5OQEREjkxMEN5QBoEEA4NDw0CBgcIBggFCAMGEAQMGwANCBEbAAArASsqKoEAXQErKyshNQYjIiYmJyY1ETMRFBcWFjMyNjY1ETMRAz981V6jTxALtAsRblFRjju0nLRIbU81cwKS/bONMUdRU4+IAjn72gABABoAAAPoBCYACgHqsQICQ1RYQBcFCAAKCAYBBgoABQkIBQECBSQPDwJVBS8r3c0Q3c0RMzMAPz8/EjkxMBu3NQUBACIROQq4/95ADRE5CRYSHDQIFhIcNAK4/+qzEhw0Abj/6rMSHDQKuP/YQAkeITQAKB4hNAq4/+hACSIlNAAWIiU0Crj/2kB+KC40ACAoLjQPDCkAKAkmCjkANQpIAEcKVgFWAlkIWAlmAWYCaQhpCXgAdwF3AnkIeAl3CocBhwKGA4kHiAiKCZ0AmAmRCqwAogq9ALcHsQrJAMUK2gDVCuwA4wr7APQKLAoABQoYABYKKAAmCjcKTwBACgkFQBIWNAVACw00sQYCQ1RYQAkFAQAIBgEGAAq4//RADw0NBlUKAAwNDQZVAAUJCLj/9EASDQ0GVQgFAQIMDQ0GVQIFBQwLERI5L90rzRDdK80QzSvNKwAvPz8REjkxMBtANwoHCAglCQoUCQkKAAMCAiUBABQBAQAFCgoACgkICAICAQYHCgkDAAEFLwwBDCIIQEBACYAJAgm4ARu1QAWABQIFuAEbQAkgAkABIgvq0hgrEPbtGhn9Xf1dGhjt5F0REjk5Ejk5AD88EDwQPD88ETmHBS4rh33Ehy4YK4d9xFkxMAArKwFxXSsrKysrKysrKysrKwBdWSEBMxMWFzY3EzMBAa7+bL7kJR8YK+y5/m4EJv2EZ29UdgKI+9oAAAEABgAABbcEJgASBB2xAgJDVFi5ABL/9EARDQ0CVQcGDQ0CVQAGDQ0CVQq4/9S0DA0CVQS4/+hACwwNAlURIAwNAlUKuP/AtA4QAlUEuP/AQC8OEAJVEUAOEAJVBAoRAwEADAYHBgEGDwoACg0MBgwMAlUMEQECBAoEEQoMDAJVEbj/+LQNDQJVES8rK83NENbNENQrzQA/Pz8/PxESFzkxMAArKysrKysBKysrG0AWDxQBKgQpCgJKEVsRjhEDESANDQZVCrj/4LQNDQZVBLj/4LQNDQZVEbj/8EAJHyE0EBwdJzQJuP/wQLcfJDQEBgwJEwYbCRkSBQQABAYLCQsOCBIQABMDFAccCBsLHQ4kACUHKggrDjQANQc6CDsORANHBkAHTQhLC0MPRxFKElsPUhJrB2QIZxJ5BnoHdAi5BroPthL1BvsJKAsRKAAoDScOKA8nEi8UOAA3EncIhgiYA5cMpwGoAqgLpgy1ALYGug7IBNYG2QnoBOgP5xL0BvoJHAsGDQ0GVQwGDQ0GVRAGDQ0GVQ4GDQ0GVQ8GDQ0GVRKxBgJDVFhAGwoODwQSABEIBwglBw8lDhIlAAAOBwMNAQwlDbj/1kA3CwsGVQ0CJQEqCwsGVQENARQTBgoLESYKKxFUBFIKXBFsEXwRihEKEQoEAwABDwoACgwGBwYBBgA/Pz8/PxESFzldARESOTkvK/QvK/QREhc5EOQQ5BDkERI5ERI5ERI5G0AUAwUFAgYHBwUJCgoICwwMChAREQ+4/0uzBQASILj/SUBmCg8OIMMRBwggBxESEisFBxQFBQcOCgwMJQ0OFA0NDggRDw8rCggUCgoIAAUCAiUBABQBAQAAAgEHEgQIDxEMDg0KEQoEAxINDAwICAcHAgIBBhIPDw4OAAoU9hANAWANcA2ADQMNuAGnQAogTwoBbwp/CgIKuAJVQAlPEQFvEX8RAhG4AlVACxAFAWAFcAWABQMFuAGntQH2E/ZmGCtOEPQZTfRdXRj9XXH9XXEaGf1dXRjmAD88EDwQPD88EDwQPBA8EDwSFzkBERI5ORI5ORE5ORI5OYdNLiuHfcSHLhgrh33Ehy4YK4d9xIcuGCuHfcQrKyuHDhDEBw4QPAcOEDyHDhDEhw4QxEuwH1NYtA0gDCACvP/gAAH/4AAO/9C0ADAPIBK4/+ABODg4ODg4ODhZS7A0U1i5AAj/0LEHMAE4OFlLsCFTS7AzUVpYuQAI/+CxByABODhZS7ASU0uwHlFaWLkADv/Qtg8gDSAMIAi4/9CyBzASuP/gsgA4Arr/4AAB/+ABODg4ODg4ODg4OFlLsBJTS7AXUVpYuQAR/+CzCiAEIAA4ODhZWTEwAUNcWLkADv/UthI5ACwSOQC4/9SxEzkrKytZKysrKytdcXIrKysAKysrcV0BXVkhATMTFzY3EzMTFzcTMwEjAycDAUv+u7qpPwQzqbmfNT22r/60u6kp1wQm/ZvkEcoCbv2Yy80CZvvaAny1/M8AAQAPAAAD8QQmABAB3LECAkNUWEAVDwELBgQCCQYCBg0KAAoPGA8PAlUPLysAPz8/PxEXOTEwG7cPEgEPIhk5Brj/3kBQGTlaD5YElgiZDpoPwAXABsAHyw8JD0AWORoDEwkVDRoQNQE6C4EBjgsILxJXBFkHWQtYDpcBmAqYC7cCuAzIC8oOzBDaA9UJ0Q3bEOUKEhKxBgJDVFhACwwAEhEPGA0QBlUGuP/oQA4NEAZVDwYAAg0ACgoCBgA/PD88ERI5OSsrARESOTkbQGYGBgMHCAkJAQYGCQUEAwMLDw8QDg0NAQ8PDRALAQAJAg0LAwwQCgYPAg8KEMYAxgkCECUACRQAAAkDAg3GDQENJQwDFAwMAwoJCQMDAgYQDQ0MDAAKTxIBEkkNfgwiCg9hBgl+QAq4ARu3QAZQBoAGAwa4AkNADiADfgIiTwABAEkRfMQYKxD2XfTtGhn9Xf0aGO0Q5RD07eZdAD88EDwQPD88EDwQPIcFLitdh33Ehy4YK119EMQAERI5OQ8PhwjEhw4QxAjEhw4QxMQIxAcOEDw8CDxZMTABQ1xYtA4YHTkLuP/eQAsdOQwiFzkDIhc5C7j/3rIhORC4/8BAChU5ASIhOQlAHDkrKysrKysrK1ldcQArXSsrAV1ZMwEBMxcWFzY3NzMBASMDJwEPAYT+meGjLhwsJbPX/pEBi93aOv7pAigB/vlHMEIz+/4M/c4BSln+XQABACH+UQPuBCYAGgH3sQICQ1RYQB0KFA8DCwMcGQ8SBgsGE0ASDyALQAwgDxgPDwJVDxkvKxrdGhjNGhkQ3RoYzQA/Pz/tEhc5MTAbsw8cAQ+4/95AbRw5KBRWD68KA0ANQA8CDyAoMDQQICgwNAcMCRIWDRgSJwsnDCcNNgw2DTUOmRELKBIoE0gWWRJZE1kVaRJpE2kVeQZ2DXkRehR6FYUNihGMEowTiRSYCqgLvBC7EboU6grnFPUN/RD5FP8cHhKxBgJDVFhAFhMLHBsED0QPhA8DDxkLAxwZDxIGCwYAPz8/7RESOV0BERI5ORtANw8PDBAREhIKAAMZFBMTJRIKFBISCg8MDxEMJQsKFAsLChMSEgwMCwYDHBkPABwQHAIvHL8cAhy4Aj+1DxNAEkAUuAJUQAs/EkASAl8SvxICErgBQrYPASIARRsKuAJUQBIPIAtAQCAMMAxPDANQDP8MAgy4AUKzLw8BD7gCP7QbIHxmGCsaGRD9cfRdcRoY7RoZEO0YEPTkGRDkXXHtGhgQ7RkQ5F1xABg/7T88EDwQPIcFLisIfRDEhwUuGCsOfRDEABESOYcOEDw8CMRLsA5TS7AYUVpYuwAM/+gAC//oATg4WVkxMAFDXFi5ABT/3rY3OQoiNzkOuP/otRU5ESIVOSsrKytZXXErKwBxXSsBXVkTJxYzMjY3Njc2NwEzExYXNjcTMwEGBwYGIyJ/FDssPEgXESYFC/5twt0rIh8r47T+bEEkMHxWNP5nqRAoJBtrDx0EKP2ZdYF8dgJr+8ivQllTAAABACgAAAPUBCYADgGvQA0SuALJCAISATISFzQIuP/OQAkSFzQBPh4hNAi4/8JASh4hNCkCKAkvEDkBOQpJAUYCRghJCU8QXAFUAlQIWglQEGwBYwJjCGoJewF0CHsJiwGFCIkJ+QH0AhsZCCYBKQgrCTkIpQjXAQcQuP/AtxAVNAIsEjkJuP/UQCMSOQECOgkKAggKCiUBAhQBAQIBDQ4IBgJhBSsHBgYKYQ0ADbj/9EAJCwsGVQ0rDgoCuAEPtAgIBwUGuwJbAAAAB//0QBYLCwZVByINoA4BAA5ADmAOgA7wDgUOuP/0QCQLCwZVDnQACn4BAa8AAU8AbwD/AAMAGAsLBlUAGQ8QdCF8xBgrK070K11xPE0Q7RD9K11xPOQrEPQ8EDwQ/QA/7Ss8EOU/PP3lETkREjmHBS4rh33EEA7EKzEwASsrK3FdACsrKytDXFi1KQEmCAIBuP/OQAkSFzQIMhIXNAG4/8K3HiE0CD4eITQAKysrKwFxWQFdQ1xYuQAI/96yDzkJuP/esg85Cbj/6LcbOQkIFhs9Cbj/8LIXOQm4//hAChY5AhQWOQIaFjkrKysrKysrK1kzNQEGIyE1IRUBBzYzIRUoAqRzWP5PA2T9wW95agHrkgMIBpJ3/V57CZsAAAEAOf5RAnwF0wAqAHtATUcPASgSDxE0AhIPETQHGAsONCUSCw40FicWACkqKgwfJSATDSUMEQ0MDB8grhsSESUFGTobJSYDOgWuKic6Jq4qKl8AjwACAGkrcGgYKxD2XTwQ9OQQ9OQQ/eQQ/TwQ9Dw8EDwAP+0/7RI5L+05ARI5MTArKysrAXETPgISNz4CNzYzMxUjIgYVEAcGBgcWFhUUFxYWMzMVIyInLgICJiYnOU1hIAIFCTFIOCZWOB9oRAsSV11uYwQIQV8fOGIsQFQZAiBhTQJkAk+KAU41VGY9EAqdS4L++kVrdC0uvdfDJUQ2nRAXZ54BaIpQAgAAAQC8/lEBWQXTAAMAMrkAAwF+QBgBAAWhAgKfA68DAgN2AAAgAQEBoQShmBgrThD0XTxNEP1dPBDuAD9N7TEwExEzEbyd/lEHgvh+AAEAL/5RAnIF0wAqAIG5AAP/7rMPETQpuP/usw8RNCa4/+izCw40CLj/7kA5Cw40FygXACkBAQ0gJSERDiUNEyEgIA4NrhIaOhwlJxQ6EiUGJzoorgEEOgauAFABgAECAWksm40YKxD0XTz05BD05BD95BD95BD0PDwQPAA/7T/tEjkv7TkBETkxMCsrKysBFQ4CAgcOAgcGIyM1MzI2NTQ3NjY3JiY1NCcmJiMjNTMyFx4CEhYWAnJNYSACBQkxSDgmVjgfaEQJEGBYc14FB0FfHzhiLEBUGQIgYQJkowJQif6yNVVlPRALnUuD+kNvhSU3tdfDJkM1nRAWaJ7+mIlQAAEAVwItBFYDdQAWAFVAFAsLBBYbCxQWBA0gKww7DAIMASAAuP/gQA4LDjQAECAJ1AwA1BQgA7gCWEAMDA0MGhgBABkXcYwYK04Q9DwQ9jwAL030/eQQ9O0QK+0QXe0xMABdEzU2MzIWFxYWMzI2NxUGBiMiJiYjIgZXaqw8hHpFRSNBizZAg1I8be1PQHECLc14IzQdEk471Dw2HGo3AP////0AAAVZBuECJgAkAAABBwCOAT4BHgAytQMCAgMCFroCIQApAWSFACsBsQYCQ1RYtQAPFgECQSsbQAoUQBIUNBQMZEgrKytZNTX////9AAAFWQb0AiYAJAAAAQcA2wE/AQcAGUAQAwL/EgESDABoKwIDAh4CKQArAStxNTUA//8AZv5bBXYF0wImACYAAAEHANwBlAAAACJAGQEAMCAwTzADLzB/MI8wAzAEAEgrAQEfCCkAKwErXXE1//8AogAABOgHLAImACgAAAEHAI0BVAFqAChAEAEADwHQD/APAi8PkA8CDwK4/gO0SCsBAQ+5AiEAKQArAStdXXE1//8AnAAABR8G+wImADEAAAEHANcBpwFRAEuxARu4/8C0Dw8GVRu4/8BAHQwMBlXgG/8bAm8brxsCTxsB4Bv/GwJfG5AbAhsEuP56tEgrAQEZugIhACkBZIUAKwErXV1xcXErKzUA//8AY//nBd0G4QImADIAAAEHAI4BxwEeACy1AwICAwIjuQIhACkAKwGxBgJDVFi1AB8gAwNBKxu3ryABIANkSCsrXVk1Nf//AKH/5wUiBuECJgA4AAABBwCOAYkBHgAZQAwCAQAVHAwAQQECAhy5AiEAKQArASs1NQD//wBK/+gEHAXCAiYARAAAAQcAjQDxAAAAG0AOAi87PzsCOxwASCsCATu5AiIAKQArAStxNQD//wBK/+gEHAXCAiYARAAAAQcAQwD6AAAAG0AOAp857zkCORwKSCsCATm5AiIAKQArAStdNQD//wBK/+gEHAXCAiYARAAAAQcA1gDeAAAANkAmAp86ASA6MDpwOoA6BJA6oDqwOuA68DoFOkAuMjQAOj0cHEECAT65AiIAKQArASsrXXFyNf//AEr/6AQcBcMCJgBEAAABBwCOAN4AAAAnQBgDAjxACgoGVXA8gDzwPAM8HGJIKwIDAj+5AiIAKQArAStdKzU1AP//AEr/6AQcBaoCJgBEAAABBwDXAN4AAAA4QB4CSUANDQZVSUAKCgZVSUAZGjRJQAsNNH9Jj0kCSRy4/9C0SCsCAUe5AiIAKQArAStdKysrKzX//wBK/+gEHAXtAiYARAAAAQcA2wDdAAAAHkAQAwIPQR9BAkEcAGgrAgMCQbkCIgApACsBK3E1Nf//AFD+bwPtBD4CJgBGAAABBwDcAMMAFAA3sQEcuP/AQBoUFAZVHxwvHAIQHAHvHP8cAhAcMBx/HAMcC7j/mLZIKwEBHAgpACsBK11dcXIrNQD//wBL/+gEHgXCAiYASAAAAQcAjQDzAAAAG0AOAuAh8CECIQoASCsCASG5AiIAKQArAStdNQD//wBL/+gEHgXCAiYASAAAAQcAQwDdAAAAJrECH7j/wEARCw00Dx8BcB8BHwoASCsCAR+5AiIAKQArAStdcSs1//8AS//oBB4FwgImAEgAAAEHANYA3wAAACdAGAIgQDs1IEAtMjQPIJ8gAgAgIwoKQQIBJLkCIgApACsBK3IrKzUA//8AS//oBB4FwwImAEgAAAEHAI4A3wAAACNAFAMCIkALCwJVryIBIgpkSCsCAwIluQIiACkAKwErXSs1NQD//wC9AAACLgXCAiYA1QAAAQYAjd8AADK3AQdACwsGVQe4/8CzFxk0B7j/wEAOIiU0LwcBBwFaSCsBAQe5AiIAKQArAStdKysrNf//ACMAAAGbBcICJgDVAAABBgBDygAAKEAQAQVAFxk0BUAiJTQgBQEFArj/prRIKwEBBbkCIgApACsBK10rKzX////vAAACaAXCAiYA1QAAAQYA1tYAABZACgEABgkBAkEBAQq5AiIAKQArASs1//8ACQAAAjoFwwImANUAAAEGAI7MAAAfQBECAQggCwsGVQgCAEgrAQICC7kCIgApACsBKys1NQD//wCHAAAD5gWqAiYAUQAAAQcA1wD/AAAANbMBAQEmuQIiACkAKwGxBgJDVFi1ABcjAQtBKxu5ACj/wLciJDRPKAEoErj/4rFIKytdK1k1AP//AET/6AQnBcICJgBSAAABBwCNAPQAAAAbQA4C4B3wHQIdBABIKwIBHbkCIgApACsBK101AP//AET/6AQnBcICJgBSAAABBwBDAN4AAAAmsQIbuP/AQBELDTQPGwFwGwEbBABIKwIBG7kCIgApACsBK11xKzX//wBE/+gEJwXCAiYAUgAAAQcA1gDgAAAAIEASAhxALjI0nxwBABwfAAdBAgEguQIiACkAKwErcis1//8ARP/oBCcFwwImAFIAAAEHAI4A4AAAACpACQMCHkAWFgZVHrj/wEANCgsGVR4EbkgrAgMCIbkCIgApACsBKysrNTX//wBE/+gEJwWqAiYAUgAAAQcA1wDgAAAAMEAXAi8rPysCfyv/KwJPK48rAi8rPysCKwS4/+y0SCsCASm5AiIAKQArAStdXV1xNf//AIP/6APgBcICJgBYAAABBwCNAOcAAAAhQBMBHEAOEDQfHE8cAhwRPEgrAQEcuQIiACkAKwErcSs1AP//AIP/6APgBcICJgBYAAABBwBDAQcAAAAVQAoBARoRAEgnAQEauQIiACkAKwErAP//AIP/6APgBcICJgBYAAABBwDWANwAAAApswEBAR+5AiIAKQArAbEGAkNUWLUAGx4LFkErG7ePGQEZESNIKytdWTUA//8Ag//oA+AFwwImAFgAAAEHAI4A3AAAAB1ADwIBcBkBABkfERFBAQICILkCIgApACsBK101NQAAAQBJ/qYEHgWYAAsAXkAzAgEJCgoBIAQLAAMECAcHBG4GBQAICQYHBwoKCW4LIAAFBAQBAQBuA0ACkAICAj4McIwYKxD0XTz0PBA8EDwQ/eQ8EDwQPBA8AD889DwQPBA8LzwQ/TwQPBA8MTABESE1IREzESEVIREB2P5xAY+0AZL+bv6mBLygAZb+aqD7RAAAAgCAA6gCqwXTAAsAFwA7uQAPAo21AAkBCYMVuAKNsgMBErgCjbUPBgEGgwy4Ao1ACSAAAQCsGJ15GCsQ9l3t/V3tAD/t/V3tMTATNDYzMhYVFAYjIiY3FBYzMjY1NCYjIgaAo3J0oqNzcqNtY0ZFY2NFRmMEvnOionNzo6J0RmNjRkZjYwACAGv+ZwQKBboAIAAqAYFAlhUbFBwCNgFdBFgQaA9oGGgheA9zHHUdiSmpIeYB6A/oG/gg+SH4IxFIGUodSSBoGWgdaCoGSglLIGkPayB5D6YApRGpKakq5g4KRR5mBWUeAx0IHxQQEAJVDw8QGCEqKikZGQ4AACABAQMMDAobGxwaGg0qIR8bGA8MAQAJJx4HBg8MASoHAx8eAAMhBhsYIxkaDRkaDbgCXkAXDhkUDg4ZDQ4OEg0ZJxoHBg4KDRoZFge4AqpAOAYGDBgZACEzIxwWBxgHDAsDHAoLDg4GJAcaLCckEgYNDQJVEgoMDAJVEhQLCwJVHxI/EgISGSvmugEwABgBHIUrThD0XSsrK03tThD2Te0APz/tPz8//eQ/ERI5L+QREjkREjkBERI5Ejk5ETkIhy4rCId9xAAREjkREhc5ERI5ORI5ARESORIXOYcQCDwIxAg8CDyHEAg8BTw8CDwBKzEwGEN5QBIkJhMVJSUUJiQVJx0AJhMjHQEAKwErKyuBgQBxXQFxXQByAQMWMzI2NxcGBiMiJwMnEyYCNTQ2NjMyFxMXAxYWFwcmJyYjIgYGFRQWFwLo3iEcaJcRsyH3qDE2dnBzc5J16XkkQHFucGNqFa8asCASUo9HQDsDfv0CCY6AFLnUDv51IAGONwEBwbL/gAgBgyD+fSuRbRtwaQNbv36EtiwAAQAb/+QEOgXTADkA7kBKbTd2K4YrAxYhARQHOhhJGAMpKCckBCIqOQADAwU4AgMDJCQlHiYBAAAnJyYmHi4yJ18xbzECMf5ANQE1KS4BCkAdIjQKQBIUNAq4AZWzLxsBG7gCuEAKFBAeEasOHhQLH7gCWrYeCzJeMTgQuAGPQCwgETARAhEaOwECpSJeIAUBBU04Xr8qzyrvKgMqch8mJScePq8fAR8ZOqmNGCtOEPRdGU3kGPQ8EPRd/fRd7fQ8ThD2XU3k9O0AP+0/7f3tEPRd7SsrP+1x/V3kERI5LzwQPBA8EP08EDwQPAEREhc5ERIXOTEwAV1xAF0BIRUhFhUUBgc2MzIXFjMyNxcGBiMiJyYmJyYjIgYHJzY2NTQnIzUzJiY1NDc2MzIWFwcmJiMiBhUUAYwBO/7kE1NfT0FTaKw9SnY6XGUyKisbzR4vL0ijQ0VghhHEmiESmnywtesbsw+VaG+TAymULCxXwmUWGSk4pScYCAU/BggyK601xY49P5RwZzHQdV3HtBt4io9lbwACAFH+UQQVBdMAOABKANRAagQwFDAkOWYvZTp1BnQReh15LXk+ez97QHtBc0lzSoQGhBGLHYktiz6LP4tAi0GDSINJg0qUKRspDSkTJCkiMQRIQxIMBEVCPzklCgUiOi8nAzwHSENCPzo5LyclEgwKDBwBNhwEhgEcJxu4ARNALR8cGAEAJwELHDwbPisHXjI+PClPKwErGkwiXhU+DwE8ADhFKU8PAQ8ZS3GnGCtOEPRdTe307RD07U4Q9l1N7fTtEPTtAD/kP+395BD07RESFzkBERIXORIXOREXOTEwAV0AXRc3FhYzMjY1NCcmJS4CNTQ2NyYmNTQ2MzIWFwcmJiMiBhUUFxYXFhcWFhUUBwYHFhYVFAYGIyImATY2NTQnJicmJwYGFRQXFhcWj7UcemlmcyQ+/uqUdUp4aUc6yKW70hW7FWlZXHEkOPqdN0dDSSpwUE9kvG2/4AIzSkk0NayJQ1FFLi6hhkYagmloRjMrS6pbZ4xMYJwfRHNBgLyyqRN6YGM8NCxEmGAtPIBLcVAuLz2MUFidU78B5CZlMDk/P2pUNi5cOD85OV9PAAABAG0B0AJoA8sACwAfuQADAVNADgkGzCAAMAACAHUMV6cYKxD2Xe0AL+0xMBM0NjMyFhUUBiMiJm2VaGmVlWlolQLOaZSUaWmVlQAAAQAB/mkEUwW6AA8AWkANTwpPC08OTw8ECwwBD7oB6gABAWlAIQcJDiMIBwANDCMKC3IRAfkADxAPAg8PEAgaEQQZELN6GCtOEOQQ5hI5L11N7RD0PP08AD88/TwQ7e0ROTkxMAFxAAERJiY1NDYzIRUjESMRIxEBlbvZ8egCeZCq3/5pBBUK363B5a35XAak+VwAAAEAmf/nBKMF0wA2AYpAhQstGy0/OEYKRhFFE084XC5qJGoucDgLSQgmJSUoERAlJyclEBIUECUnJyUQEhQQEBIXGBkaISAfHh0JGyIpKCcmJSQjDg8QERITFA4VKywtLgwLCgkICCoCAzMxBjAGLwAtLCclJhwbHRIREAsKMzQPHzIcBQEfHBgLNgAKLxwIpBUqJA24Ai1ADBUbyZ8cARwcNSIkFbj/9LQPDwZVFbj/9EAODAwGVQAVYBVwFYAVBBW4Aj22ADU2ATYlALj/+7QQEAZVALj/9LQPDwZVALj/7rQNDQZVALj/9UAKDAwGVSAAAQCSN7gBNrE3GCsQ9F0rKysr7TwQPBD9XSsr7RE5L13tEPTtEPTtAD88P+0/7REXOQEREhc5ERIXORIXORESFzmHDi4rDn0QxC4YKw59EMQQPIcOEMQxMBhDeUA0MDQWIQIHAyYgFyIbAR4ZHBsAHRwaGzMENR0AMQYvGwEhFh8bAB0aHxsANAIyHQEwBzIbAQArKysrASsrEDwQPCsrK4GBgQFdMxE0NjYzMhYVFA4CFRQXFhcWFxYVFAYjIiYnNxYWMzI2NTQnJicmJyY1ND4CNTQmIyIGFRGZWdCCrcYkXBgWFWSILUDNoH6+L5syZDdMbCAVW6YnKBtnIG1ba4gD57fFcK1yM2yhPxggHyBBWTZNaYvGh2pIXUhoRjgoGj5yOTk8J1CwWCI+X4Tc/CEABAAD/+4F6AXTAA8AHwA2AEABg0A2mhKUFpQamh7bEtQW1BrbHgi/LLktAiYnKS0pMCsxpwOoC6kNtivGK9YrCmUIMDEvZC90LwIvuP/QsyYtNC+4AmJAHy4sFC4uLC0sKyopBS4wMTIDNjAxKDMtLCsqCC8pKTW4AmK1NzcgIUA/uAJiQBwhACKPIgIilAAuLy82TyABDyBvIH8g7yAEIJQYuAJisggLELgCYrIAAzu4AmKyJlQvugJiAC4BFrYEQDc1NiE2vQJiACABSgAMABwCYrMEGkIUuAJitQwZQbN6GCtOEPRN7U4Q9k3tEPTtPBA8PDwQ9O307QA/7T/t9F1xPDwQPBD0XTz9PBESOS/9OS8SFzkBERc5Ehc5hy4rK3EOfRDEATkxMBhDeUBKPD4BJSQlPSYSJQ4mAiUeJhYmCiUGJholPiM7LAERDxQhAB8BHCEBFwkUIQAZBxwhATwlPywBEw0QIQEdAxAhARULGCEAGwUYIQAAKysrKysBKysrKysrKysrKysrKysrgYEBXXEAXQEyBBIVFAIEIyIkAjU0EiQXIgQCFRQSBDMyJBI1NAIkAREhMhYWFRQGBxYXFhcXIycmJyYjIxERMzI2NTQmJiMjAva+AWrKx/6ZxMT+mcjLAWq+n/7TqqcBLKOjASymqf7S/hcBF4+ATH9pKxoxR2OgSFU0JEVNn3JTKEdglQXTw/6VxcP+mMfHAWjDxQFrw32j/tGko/7Vp6cBK6OkAS+j++kDLC1wP1mECBIZMHGfgJcmHP6nAclEOCQ5HAADAAP/7gXoBdMADwAfADoBM0AglBKUFpsamx6mA6gLqA25MNQS1BbbGtse1TPWNg5wCCC4AquzIYckL7gCq7MwLgEuuwJgACsAOAJiQBBPJAEPJG8kfyTvJAQklAgyuAJiQAsAK48r/ysDK5QAGLgCYrIICxC4AmKyAAMvuAJisi7TILgCYrMhiAQ1vQJiACcCZAAMABwCYrMEGjwUuAJitQwZO7N6GCtOEPRN7U4Q9k3tEPTtEPTt9O0AP+0/7RD0Xe0Q9F1x7RD9XeQQ/eQxMEN5QFQzNyUqAR8pJhIlDiYCJR4mFiYKJQYmGiUzKjUfADclNR8AEQ8UIQAfARwhARcJFCEAGQccIQE0KDIfATYmOB8AEw0QIQEdAxAhARULGCEAGwUYIQArKysrKysBKysrKysrKysrKysrKysrgYGBAV0BMgQSFRQCBCMiJAI1NBIkFyIEAhUUEgQzMiQSNTQCJBMXBgYjIiY1NDY2MzIWFwcmJiMiBhUUFjMyNgL2vgFqysf+mcTE/pnIywFqvp/+06qnASyjowEspqn+0lR7HsOLsNxkuXeFsCB3HnVPc5WNcFqIBdPD/pXFw/6Yx8cBaMPFAWvDfaP+0aSj/tWnpwEro6QBL6P9ECR9leTKhMNjf20dSk+kmZmdaAAAAgDhAosG9wW6AAcAFACcQB9dCwE5ETUSShFGEgQLERIPDgcABBIREAsEFBMEAhQIuAFpsgkCBbgCYkAKDQwKCQQADQ4QDroCYgAPATuyEawSugE7ABQCYrIICAm4AgWyBaUHuAJiQA4ApQIgAzADYAMDAxkV2bkBLgAYKxD2XTz0/fT2PBD99vb27TwQPAA/PDw8PP08EP08ERI5Ehc5FzkBERI5MTABXQBdAREhNSEVIREhETMTEzMRIxEDIwMRAen++AKa/vYBZcjOx8R80nvbAosCtnl5/UoDL/11Aov80QKs/VQCtv1KAAABAN4EqgJPBcIAAwBluQAB/8izFxk0Arj/wLMXGTQDuP/AQCYXGTR/AYAC3wEDbwN/AH8DA28AbwECTwFQAgIAAAMQAwIDhwEEAbgCYLIChgO4AlO1ABkE2acYK04Q9E399P0AP/1dPDEwAV1dXV0rKysTEzMD3oXs3ASqARj+6AAAAgA9BPYCbgXDAAMABwBIQCMAAwIHPAUFAgAGBwUEAgMBAAc8BJ8DPF8AbwCPAJAAoAAFALgCJLMIcI0YK04Q9F1N/fb9EDwQPBA8EDwAPzwQ7RE5OTEwEzUzFTM1MxU9vLm8BPbNzc3NAAEATv/kBBYFwgATANFAgrcNtxACAAQTAQwDBBMCCwYFEgILBwgPAgsKCQ4CCw0JDgEMEAgPAQwRBRIBDAsMAQE/AgsUAgILDxAQBwcIJQkODQ0KCjAJAZ8JzwkCCb8EEhERBgYFJQQTAAADAwQMCwABAgoL6AwB6AIMDAQCAg4EDg8PEhNVFQkICAUEPhRxjBgrEPQ8PBA8EPY8PBA8ERI5LxE5LxDtEO0APzw/PC88EDwQPBD9PBA8EDwQ/V1xPBA8EDwQ/TwQPBA8hwUuK4d9xA8PDw8PDw8PMTABXQEDIxMhNSETITUhEzMDIRUhAyEVAe/CiMP+5gFkev4iAifEhsMBGv6ceQHdAaH+QwG9qAEVqAG8/kSo/uuoAAACAAEAAAeQBboADwATARBADwEYDREGVQ4QEw8OEAwAE7j/8bQNEQJVE7j/9kAeCwsCVRMPDyAAARQAAAETDwEDDAANDh4QEBERAAEQuAKnQCgIBgUeB38IjwgCCAgAAxMeAgECCgkeDAsPDAAIBAkgDAwSDBAQAlUSuP/2tA8PAlUSuP/uQAsNDQJVEgoMDAJVErj/6LQLCwJVErj/8LQQEAZVErj/60ALDQ0GVRIKDAwGVRK4/+VAFQsLBlUSEhQVB1QDSgoaFQAZFGBbGCsZThDkGBD2TfTkERI5LysrKysrKysrKzwQ/TwAPzw8PBD9PD88/TwSOS9dPP08EOYREjkvPBD9PAEREhc5hy4rfRDEKysBERI5OQc8PCsxMDMBIRUhESEVIREhFSERIQMBIREjAQLBBLP9HwKt/VMC/PxB/crIARoB5JEFuq3+Paz+D60Bp/5ZAlMCugADAFP/xQXtBfAAGwAmADABo0CAKQAqASUPAxACIgAiAzgPOhtFJkknRShSCVwhUiZULmkOgwCAAYACgwOEG4Ucuxv8APomFgscByYLJwM6BD0wSgFKBEkdRSBIJ0stWwBbA1kcVSBZIVsnUilaLWsBaQJ6MIsChSWLJ6IJ9AEYBAMLExQEGxMEBCALLRQgGy0EEgC4/+BAOwoKBlUPIAgKBlUDJygPEBACABwmEhERASooJiUEHRwnMAQiLyooJiUEHRwnMAQsHwIQEDARARQREQEfuAK7shkDLLgCu7ILCQG4AQu0Ai0vJge4/+i0EBACVQe4/+60DQ0CVQe4//C0DAwCVQe4//q0CwsGVQe4//S0DQ0GVQe4//pACwwMBlUHGiAyATIRugELABABMUAXIiYVBgsLBlUVBgwMBlUgFQEVGTFjXBgrThD0XSsrTe397U4QXfYrKysrKytN7fTtAD/tP/2HDi4rfRDEABESFzkXOQEREhc5FzkHEA48PDw8BxAOPDw8PAArKzEwAUNcWLkAKP/ethQ5HCIUOSi4/961EjkcIhI5KysrK1ldXV1xAF1xATcXBxYXFhUUAgQjIicmJwcnNyYmNTQSJDMyFgcmJiMiABEUFxYXAQEWFxYzMgARNATiqGOwVh4otv63uYpwVnOoY7BiQrQBRceGyQRejV/b/uIWEDMDPP0ZTUFVY9oBHAU0vFTGgGB+nOH+oLQnHlW8VMWV05TiAWG2R99KNv7X/tl0WkNiAtz8wD8ZIQE0ARbQAAMAmgGEBR4EFAAYACYAMQDOQEIkGSUaJSY7KDsxTChMMWMaYyZ1GnUmhBqEJg1ECBkHLScgFA8LIwAdBCcZDwAEIC0nGQ8ABDAqKhc4BDAqETgdKgu4AbxAESMqBAYgKgcaMy0qFBkynnkYK04Q9E3tThD2Te0AP+397fTtEPTtERc5ARESFzkAERI5ERI5ARESORESOTEwQ3lAMisvHiISFgUKCSYrFi0fACIFIB8BLxItHwAeCiAfASwVKh8BIQYjHwEuEzAfAB8IHR8AACsrKysBKysrKyuBgYGBAV0BNjc2MzIWFRQGBiMiJyYnBiMiJjU0NjMyExYXFjMyNjU0JiMiBwYHJiYjIgYVFBYzMgKxaTtQWWm3RJBMWVA7aYiZZZGRZZnNV0guOUxnaU4xKzr2UGAsOk1QOWUDLIQqOpipdodSOSuEq5lycZr+9ocyIXBmanAcJ5RkOVJIR1UAAAIATgAABBYEzQALAA8ATkAuCQIIAwBuAvkDbg8FAQUPDvkMDQUNCgwIbgYK+QUBDQFuPwKQAqACAwJVEHGMGCsQ9l3kPBA8/Tz0PAA/LxA8/TwQXfT95BA8EDwxMAERITUhETMRIRUhEQEhNSEB3f5xAY+qAY/+cQGP/DgDyAEEAZOnAY/+caf+bf78qAACAE0AagQYBTwABgAKAHZAFo4DgAUCCgkIBwQABgUDAwwCCAclCQq9AqwABQJaAAYAAwJasgJABroBUAACAVBAGgCrAasgBAJfAAgJOgQ8ATAAoAACABkLcYwYK04Q9F08Te30PBDtABkvGu3t7e0YGhDtEO32PP08ARESFzkSFzkxMABdEzUBFQEBFQchNSFNA8v8/gMCAvw4A8gC+qgBmrT+xf7Bs/GnAAIATQBqBBgFPAAGAAoAikAYgAKPBAIKCQgHBAAEAgEDCwUKCQcIJUAJuAKstwEAqwarAyACuwJaAEAAAQFQsgMgBLsCWgBAAAUBUEAJIAMHCjoDPAYFuAEiQAsfADAAAgAaDHGMGCtOEPZdTe087fQ8ABkvGv0YGu0ZGhD9GBrtGRoQ7e0YEPYa/TwQPAEREhc5Ehc5MTAAXQEBNQEBNQEDITUhBBj8NQMB/P8DywL8OAPIAvr+YbMBPwE7tP5m/MinAAAB//0AAARtBboAGgDpQDckCCQLKw8rEnkIdhKJCIUSCHQNhA0CEhERFQgJCQUMCwoKDQ4PEBANDRoNAAkZ6BYWBBUFAegEuAKvtwX5CAgfEgESuAFgQCARERAQCgoJAAAKGBcXFBQTOBECAwMGBgc4CRA8IBEBEbgBAEALFRUaIwAKPC8JAQm4AQBADwUFABAPDwZVABALCwZVALgBGbMbs3oYKxD2Kys8EPRd7RD9PBD0Xe0Q9DwQPBA8EPQ8EDwQPAA/PzwQPBA8EPRdPBD9/u0QPBA8EO0REjkBETmHDn0QxMSHDhDExIcFEMSHEMQxMABdAV0hESE1ITUhNSEBMwEWFzY3ATMBIRUhFSEVIREB3f5hAZ/+YQFV/mrIASIxGxc7ARLW/msBVf5kAZz+ZAFFi4+UAsf9/FhCNW4B+/05lI+L/rsAAQCg/mkD+gQmABkBVkA9KAQoBSgWOAQ4CjkLSARICkgLWQRbCWoEagl7BHsKigSKChESFhkMAwsCEhYZDwYCChQcBwsNDgIzGSUBG7j/9rQPDwJVG7j/9rQNDQJVALj/5LQQEAJVALj/5rQNDQJVALj//rQMDAJVALj/7rQLCwJVALj/50ALEBAGVQAbDg8GVQC4//20DQ0GVQC4//q0DAwGVQC4/+tAHAsLBlUAGmAbgBsCsBvAGwLQG+AbAhsPDCUNDQ64//S0EBACVQ64//i0Dw8CVQ64//i0DQ0CVQ64//y0DAwCVQ64//i0CwsCVQ64/++0EBAGVQ64//K0Dw8GVQ64//1AFgwMBlXgDgHADtAOAgAOIA6wDgMOGRq4ATaxUBgrThD0XV1dKysrKysrKys8TRD9PE4QXV1d9isrKysrKysrKysrPE395AA/P+0/Pzw5ORE5OQEREjk5MTAAXQERIzUGBwYjIicmJxEjETMRFBYWMzI2NjURA/qhNDNGXVNAMDqysjR1TFB+NAQm+9p+UB4pIRlK/f4Fvf4+9ZFUWIv0AcUAAgA4/+cDzQXTABsAJwBsQE93AnYVeB6GFQQJDAklCyZEDGQacx55JXsmigKEHooliSYMVRprGAI6JUUaAi8pNhoCHBUOGegEAyPoDgkc6BXoCj0pAOgBhiAmEWkom2gYKxD27fTtEPbt7QA/7T/tEjk5MTABXV1dXQBdASc2NjMyFhcWFhUQAgQjIiY1NDc2JS4CIyIGAQ4CFRQWMzI3NhIBqodGxF5Mex8vLa3+2o6Jq5nFAcQEKGBBPnYBffTjk2ZES1V1kwRyPJ2ITzNP2Iz+4P4/1ral4qHPCKiwX2P+LA5s9X5TbDdMAT0AAAEAev5RBWoF0wALAI1AIAQKAAgEAwQFAyALChQLCwoEBQQDBSAJChQJCQoCAx4LuAKmtgEAAgYFHgm4AqZADgcIDgECLQYHUSANAQ0EugI6AAoCcUALCQALLQkgCAEIVgy4ATOxXBgrEPZdPPQ8EPTtEF30PPQ8AD885v08Pzzm/TyHBS4rCH0QxIcFLhgrCH0QxAAREjk5MTATIRUhAQEhFSE1AQGLBNX8JAJf/XcEEPsQAmz9pQXTpPz5/MqhuwMUAwQAAAEAof5RBfMF0wAHAD5AIgIDAwYHDgQFAQUjAAIEugEBA7oCbAkFugAABroHdgieeRgrEPTtPBDtEPbtPBDtAD/tPBA8Pzw8EDwxMBMhESMRIREjoQVSv/wuwQXT+H4G1PksAAABAAAAAARkBCcACwBBQB4GBwILKwEABggFCgYFJQMEkgEaDQcIJQoJkgAZDPa5ApYAGCtOEPRN9Dz9PE4Q9k30PP08AD88Pzz9PDk5MTARIRUjESMRIREjESMEZKK9/la8nwQnnvx3A4n8dwOJAAEAAP8kAjAHRwAsAKVAFDMIJCUAIg0PCRcsKhYUBAwkECkGugGYAAwB6bIdKSa4AqJAICQkIwouFxcaCa4XJxknE6spJwEnAHYiGSAtLswhm3oYKysvTvRN9PT0/fT09E5FZUTmAD88TRD0/fT97RESFzkBERI5ORESOTkxMEN5QCQnKBocERICBRsmAwIEAgIGJxwpMgERBRMyACgaJjIAEgIQMgEAKysBKysqK4GBgYETEzY3NjYzMhYVFAYjIicmIyIGFRQXEhUUAwIHBiMiJjU0NjMyFjMyNjU0JwLJEQkpG18tMks1JyMpFxERFwklEAhSNlA0QjMnKDoUERYJJQO0AhOZZUFBQygvOSQUHSMqZ/5m/0P99/7ZaENENS02QBwhKk4BOwACAC8C6gLOBdMAIwAxAItADgAeCyYkKgsmEi0hIQItugJ8AAIBH7YZFSc/FgEWugK4ABICfEA1GQEOfyQdJOgw+R44IvkgIQEhaZAzAYAzwDMCYDNwMwJAM1AzAjMV6D8WARYnKikFaTKbjBgrEPbt9F3tEF1dXV32Xe307e08EOYAP/30XeQQ/e0QPDwREjk5ARESOTkROTEwAQYjIiY1NDY2NzY3NzY3LgIjIgYHJzY2MzIXFhUVBxQXIyYDBgcGBwYVFBYzMjY3NgIkeoZxhCA/MiNAk0gYARpHO09OCYkMmI2kREMBKZQUETWLWhscRD5JbBIHA1Vre2AwSDgRCwoWDgZGMCNBPCJZdz0+d/A9hjIoASwOFg4ZGiYpOk45FAAAAgAtAuQCvQXTAAsAFwBDsy8ZARK9AnwABgAGAR8ADAJ8QBoABhQAARUpA2nvGQFwGYAZAhkPKQlpGJtoGCsQ9u0QXV327QA/PxDt7RDtMTABXQEyFhUUBiMiJjU0NhciBhUUFjMyNjU0JgF1kbe4j5G4t5FRY2VPUGRlBdPIsK/IxK+0yIVygX51dYN6dAAAAQB/AAAFwwXfACoBWUAlOQ85GkUDSg9KGkYlWQFWEWkBZhF8AXoadCWKGYQmDzsCAS4IILgCSEApCQMrFjsWAvkWARY6EzoSKyc7JwKJJ/knAic6KjoAABIeFBUpKCgVCBK4AjqyFRYAuwI6ACcAKP/2QBELCwJVKBYKCwsCVS8WTxYCFrgCeEANExwmDUoUEygPDwJVE7j/+rQNDQJVE7j/8LQMDAJVE7j/4EAQCwsCVRATARNqLCAoQCgCKLgCeLUpJCYFSim4/+C0EBACVSm4/+q0Dw8CVSm4/+60DQ0CVSm4//ZAEgwMAlVgKQEAKSApAimsK52nGCsQ9l1xKysrK/TtEO1dEPZdKysrKzz27RDkXSsQKzztEDztAD88EDwQPP08EOTlXXEQ5OVdcT/tMTBDeUAgHSMGDCIlByYLJR4mIQgklgAfChyWASMGIJYBHQwglgErKwErKysrKyuBgQFxXSUmJyYCNTQSJDMgFxYRFAIHBgclFSE1Njc+AjU0AiYjIgcGERQSFxUhNQHwbDlXXp8BL8QBULSDbFc1YAFs/cFQLEhkM2PJj79pkrag/b+gQz9gAQOdxAFJsP66/vqo/v1dOj8GprEoJj2ovmeKAReSeKn+8dn+yUi0qAADAET/6AbKBD4ANQA8AEoBe0A1PTk9SEwpTzlaKV45egUHKEAwIjQlTAVDDkIlREhbBFYOVg9TJWkHZw5lD2QjdxB0JocQEiS4//+2DBACVRIcPbj/5rQQEAJVPbj/wEAuDA0CVQA9ED0CPT0XRjYckC6gLgIuLjI6HJUXHCA6HCcnIAdGHAkyHAAAEAACALgCfUAUAwMJCzYlEjM9JS43QC4KEBACVS64//ZAGw0NAlUuFQwMBlUuEAsLBlXfLgEfLj8ujy4DLrgBxLUrNSQAMyu4/+K0EBACVSu4//S0DQ0GVSu4/960DAwGVSu4//hADgsLBlUQKzArQCuAKwQruAHkQDsMGyUcIkMkDBgNDQJVDCIMDAJVDBQLCwJVDBQNDQZVDBwMDAZVDBALCwZV3wwBHww/DE8MAwwZSzQ3GCtOEPRdcSsrKysrK03t9O0Q/V0rKysrTfTtEORdcSsrKyvtEP3k7QA/PBDtXe0Q7T88EO0Q7e0REjkvXe0REjkvXSsr7SsxMABdAV0BBgYjIiYnBgYjIiY1NDY2NzY3NjU0JiMiBgYHJz4CMzIXFhc2NjMyFhIVFAchHgIzMjY3ASEmJiMiBgcGBwYHBhUUFjMyNjc2BsYy8LJ/v01o1Xusv2OxwpZmAWmDV3g5E68cacSDp2Y7KECic6LUYgL9AQJDk1hnjxv9vwJIDph6fqG5T/NtLDtqZXOrGg8BRae2YGZmYLF/VpdOGRQdGRB+ZSpNVRV1iU4yHUBGSZ3+/n0TKpCCV3ZrARyekqD0IicRIi9MR2FyVTQAAAMAgf+xBGQEZwAZACEAKwLCQP8YAxUFIgAsDSUZRgBUGWQZCBUZARsQEBACVSghARAEFAUcEBwRHBIVIkYDSQ1MEEwRRR1LJloaZhVkHmYiihqAIs8aExIaKywDKxovIjsABQwACwIEDxoCBLoR7AT7AfYPBD0ROCZUHboCBN8t6QDqAusDBFgJXBFeJooiBIUAig2KEIobBOkB6hr6APoCBMoh2gDaA+siBMoAygL5BAOfEZohqgOrIQR8G3kheSKrIwRqIWkjeg16EARsEWYabSZ1AAQXADsiRQJKDwQmGS0aLCI5GgSlAMQa2QLmDwRNDEMZSR5GJwR6InYjlBCVIgRkCW0VbR5oIosiBRIDIiNANw0ODgIAGiEQDwEBDw99DgIUDg4CISMaIgQoHwItAwEAAygHDywQDQ4DHxQAHBcNJQsPDhQCBwG4Alu0HBwXBw64Alu2JRwLCygkB7j/8LQQEAJVB7j/7LQMDAJVB7j/+LQLCwZVB7j/+rQMDAZVB7j//bQNDQZVB7j//EAWDw8GVQcQEBAGVc8H3wfvB/AHBAcaLbj/wLMSFTQtuP/AQDUNEDSQLaAt8C0DAC0gLYAt4C0ELR8kFAAQEAJVFAoLCwJVFAULCwZVFA4MDAZVFAQNDQZVFLj/9EARDw8GVR8U3xTvFAMfFAEUGSy6ATMCkQAYK04Q9F1xKysrKysrTe1OEF1xKyv2XSsrKysrKytN7QA/7eQ/7eQRORESORESORESOQEREhc5EjkREhc5EjkREhc5hw4uK30QxAcOPDw8PAcQDjw8PDwxMAFDXFi5AAD/3rIMOSG4/962HDkiIhI5I7j/3kAKGTkaIiU5GkAeOSsrKwArKytZXV1dXXFxAV1dXV1dXV1dXV1dXXFxQ1xYQB4pGSIaIyID6Q8BIwMkGiAiA+YA5QLkA+ME5CLvLQYBXXEAXXFZAV1xKwBxXQE3FwcWFxYVEAcGIyInByc3JicmNRAAMzIWByYjIgYVFBcBARYzMjY1NCcmA5djYGs/Fx+picGfemlebDsZKAEmxlKKF1tkhbQ0Ag/+P05ii7UMCAPngEaKVkZkhf7UjXFQh0eNRERtigEtAQ0qsUbMypZlAer9uT/MzEw5KgACAJ7+UwRPBCYAAwAiAIhAN4wfAXwfjB4Cax98HgJgEGseAl0eXR8CSx5SEAJMEksdAjoSRBACHx0LDAQEFCcVFQQRKRgPIgS4Aq9AIQICATwDBhReFWwgJAEkADwCIgReIogOXiAbARt2I56YGCsQ9F3t9O0QPO0QXfbtAD/9PBD2PD/tEjkv5BEXOTEwAV1dXV1dXV1dARUjNRMWFRQHBgcOAhUUFjMyNjcXBgYjIiY1NDY3PgI3At3NwQEeFjEkuzekd3KbGLgZ98rY/1mDWTYZAgQmzc3+lyIRbk06OyukYjpqnpCYFcvc6qZhoHRPSmBsAAACAOj+bAHHBCYAAwAJAHaxBgJDVFixBwS4Aq9ACwE8AwYAOgY8AzoHAS/k/eQAP/3mLzEwG7EcBLgCr0AjATwDBwMGC8sAOgQ4BQk4AzoIPAUFBjwgBwEHywoLgSHZ9RgrK/Zd/TwQ/eTkEOTk5gA/LxD95jEwS1NYswQFCQgBEDwQPFlZARUjNRMTESMREwG/z6A33zQEJs3N/pP8+P67AUUDCAAAAQByAagEOgQGAAUAL7YCAwEAAyUEuAEdQA4AAgElBQAaBwMZBldaGCtOEOQQ9jxN/TwAL/3tEDwQPDEwASMRITUhBDqq/OIDyAGoAbaoAAABAFT/sgRkB00ABwCHQDsEBhQGAgAHEAcCAwYHAwQHPwIDFAICAwcAAwQDAgRMBQYUBQUGBAUABwdMAgEUAgIBBwYDBAUHAgADAbgBZkARBgYGBggBGgkFGQgJeCFxehgrK07kEOYSOS8YAD9N5AEXORI5OQiHLisFfRDECIcuGCsIfRDECIcuGCsIh33EMTAAXQFdATMBAQcnJQEEGkr+yP4QxiIBLQGVB034ZQP9W0CX/MkAAAEALv5RBD0F1AAhALRAXmcGAQEJCQAHCgsLBhkcHRgAASIcGxkKCQcGCBITIxoAIAEIAxMJEhAVGB0dJQYLFAYGCx0YCwYEGgYdCAMLGAkVHBABGxwHCCsaGQoJBgMcIA8gGgEaGiMgCAEIGSK4AZ+x0hgrThDkXRDmXQA/Te0/PDw8/Tw8PD/tETk5ERI5OQERFzmHDi4rfRDEABESORI5ERI5EjkBERI5ORIXORE5OQc8PAcQDjw8BxAOPDEwAV0TNxYzMjY3EyM3Mzc2NzY2MzIXByYjIgYHBzMHIwMGBiMiLiNlMzY6ELHJGMkYFhcfc11QhyNnMzg4ExPMGcy/GnpwXv5rmxY4YAQSjIV4LT5GJpkYN2lnjPu8lHEAAAIAMwF4BDIEKgAWAC0BFUBjJAsjDisWJCIiJSstLy8HAAIPDgAZDSIPJRECHA4aDxEZGiEeIhwlGiYhAiEZNQI2BTUZNhxFAkYFRRlGHFYCVhllAmUZdgV2HIYFhhwfGwobEhspFC0ECwoLEgspBC0EJCAjuAKgtycgcCCAIAIguAKzshAgCbgCoLcNIAw6AxggF7gCoLcrIHAagBoCGrgCs7MUASAAuAKgtBQgAwYnuwE+ACQAIAE+syQjIxC7AT4ADQAJAT60DQxpLyu7AT4AFwAaAT6zFxgYFLsBPgAAAAMBPrcBAQBpLpuNGCsQ9jwQ7RDmPBA87RDmEPY85hDtPBA85hDtAD/99O0Q9l399O0Q9O30/fZd7fTtMTAAXV1dAV0TNTYzMhYXFhYzMjY3FQYGIyImJiMiBgM1NjMyFhcWFjMyNjcVBgYjIiYmIyIGM2qsPIN7RUUjQYs2QINSPGzuT0BxVGqsPIN7RUUjQYs2QINSPGzuT0BxAuLNeCI1HhFOO9Q8NhtrN/5FzXgiNR0STjvUPDYcajcAAAIAGgAABMoFawACAAUAckBBAgECAAFMBQQUBQUEAgACAQC6AwQUAwMEBQECAwAEBgMFTAEBAAoEBAUDCwABABoH6gH4AQJ5AQEBGQYH8SGpaBgrK07kcV0Q5l0ZERI5LwAYPzxNEP08PwESOTkSOYcuKwh9EMSHBS4YKwh9EMQxMCEhCQMEyvtQAnQBUP5x/kgFa/rnA8f8OQACAIYASAPfA9gABQALAIRACwkDDQkZAx0JBAoEuAHLQAsIAgj5BwcL+Qp1Brj/wLMZHDQGuP/AQBsPETQGrglAGRw0CUAOETQJnwAC6AE6BfkEdQC4/8CzGRw0ALj/wEASDxE0AK4AAxADIAMDA6wMr3kYKxD2Xf0rK/b99O0Q9isr/Ssr9v08EP0ALzz9PDEwAV0BASMBATMTASMBATMBVAEDkv7BAT+UfgEImP7HATmYAhD+OAHIAcj+OP44AcgByAAAAgCMAEgD5QPYAAUACwCAQAsGAwIJFgMSCQQBB7gBy0AYBQsKCPkHBwv5CnUGQBkcNAZADxE0Bq4JuP/AsxkcNAm4/8BAIw4RNAmfAAL5AToF6AR1AEAZHDQAQA8RNACuDwMfAwIDrA2duQGGABgrEPZd/Ssr9v307RD2Kyv9Kyv2/TwQ7RAALzz2PDEwAV0BATMBASMDATMBASMDF/77lAE//sGTf/74lwE6/saXAhAByP44/jgByAHI/jj+OAAAAwDvAAAHEgDNAAMABwALADxAEgYFAgEECjwICAcHBAQDCgo8CbgBGbIHPAW4ARm3AzwAywzZ9RgrEPb99v32/QA/PBA8EDwQ7RcyMTAzNTMVITUzFSE1MxXvzQHezQHdzs3Nzc3Nzf////0AAAVZBywCJgAkAAABBwBDAWcBagAhsQIQuP/AQAsLETQQDABIKwIBELoCIQApAWSFACsBKys1AP////0AAAVZBvsCJgAkAAABBwDXAVYBUQA9swICAR66AiEAKQFkhQArAbEGAkNUWLUADxsAA0ErG0AVDyAB/yABIEAYHTQgQAsQNCABUkgrKysrcXJZNQD//wBj/+cF3Qb7AiYAMgAAAQcA1wHLAVEAM7MCAgEruQIhACkAKwGxBgJDVFi1ABwoAwNBKxtACi8tPy0CXy0BLQO4/+KxSCsrXV1ZNQAAAgCB/+cHvwXTABcAJAGYQFAUGRQeGyAbJAQEGQQeCyALJARsIG4kAmUaYx4CMBkwHgIgGSAeAnkHAQUNAecLAbcGxgsCjwOADgJrBAFwDgF1C3MNAn4DfAQCIyAJEQJVIbj/4LQJEQJVDrj//EAzCxECVQMWFw4SFBMeFhYVFQIPGB4MAxESHhAPAgAXHgECCB8eBQkiLQ8CHhIXChAQAlUXuP/0tA8PAlUXuP/2QAsNDQJVFxYMDAJVF7j/+LQLCwJVF7j/9LQPDwZVF7j/9EALDQ0GVRcSDAwGVRe4//hALgsLBlUXMBdQFwIgF2AXAhclJhVUEUowAEAAAlAAYAACIABwAAIAGn8mASYcJgm4//K0EBACVQm4//RACw8PAlUJBAsLAlUJuP/otBAQBlUJuP/3QBAPDwZVCQQLCwZVIAkBCRkluAEzsZkYK04Q9F0rKysrKytN7U4QXfZdXV1N9OQREjldXS8rKysrKysrKys8/TzkAD/tPzz9PD88/Tw/7RESOS88EP08ETkREjkxMAArKytdXV1dXV1dcQFdXV1dXV1dJRUhNQYhICcmERAAISAXNSEVIREhFSERASIGAhUQEjMyEhEQAge//KKH/vf+05uIARwBNAEIiAM//XYCV/2p/bplwGLnoKHl562t1O3ozQFDAUIBst/Grf5ArP4MBImC/vfb/tH+4gEdAUkBMgEbAAADAFL/6AdDBD4AIAAuADUBnEBtJhVXCwJEFkQjSyZLKkQtSzJENFcFVwhTI18mXypTLWcIaA5gJGwmbCpjLRNcMlQ0AlIWWxkCMhYzIzsmOiozLT4yMjQHAA0oABUUJQ01My8ckBSgFAIUFAMrHAozHBAQCgclHAMXHAAbEBsCG7gCfUAmHh4DCy9AKEAUGkAbMxQKDw8CVRQKCwwCVRQMDAwGVd8UAT8UARS4AcSyMEATuP/stBAQAlUTuP/2tA8PAlUTuP/WtA0NAlUTuP/QtAwMAlUTuP/WtAsLAlUTuP/wtBAQBlUTuP/ztA8PBlUTuP/stA0NBlUTuP/LtAwMBlUTuP/xtwsLBlXQEwETuP/AswsRNBO4An9AQCEkBgYODwJVBhwNDQJVBhgMDAJVBiALCwJVBgoQEAZVBhkNDQZVBigMDAZVBhYLCwZV3wYBPwZPBgIGGTY0NxgrThD0XXErKysrKysrK03t/StxKysrKysrKysrK+3kXXErKyv07RD9/QA/PBDtXe0Q7T88EO0Q7RI5L13tETk5ERI5OQEROTkxMAFdXV1dAF0lBgYjIgARNBI2MzIWFzY2MzIAAyEWFjMyNjcXBgYjIiYBFBcWMzI2NTQmIyIGBgUhJiYjIgYD0kzGeuH+7XXvkorNM0DJfNwBEAL88AOzhmOPILQr67OG1Pz7R1yTgbi1hFeSTQMtAksMn3Z4p69jZAEeAQCpAQuEc1hdbv7S/tOmwW9vGqWzaQHEumF+1MfGzWLAEZecpAAB//wBygRvAlsAAwAeQA8BNQACGgUgAAEAGQSzehgrThDkXRDmAC9N7TEwAzUhFQQEcwHKkZEAAAEAAAHKCAACWwADABpADQE1AAIFIAABAASzehgrEDxdEDwAL+0xMBE1IRUIAAHKkZEAAgBTA/MCWgXTAAsAFwDYQFyfGa8ZAu8H7xMC3wffEwLPB88TAr8HvxMCrwevEwKfB58TAo8HjxMCfgd+EwL7CPsUAmwIbBQCWghaFAIMCAwUAhQTCAcXDA8LAAMP+Q4D+QIODQIBDDwNADwNAbgBUEAvE28HfwePBwMHARM4FDwODQw8Dw8OQBcaNA51AQc4CDwCAQA8AwOPAgECGRhxpxgrThD0XTxNEP08EP3kEPYrPBD9PBD95AA/XTz9PO0Q7RA8EDwQ7RDtARESORESOQAQyRDJMTAAcnFxcQFxcXFxcXFxcQFdARUjNTQ3NjcXBgYHIRUjNTQ3NjcXBgYHARTBICpbLDc0AwGUwSAqWyw3NAMExNGlhjxQKUYXW1fRpYY8UClGF1tXAAIARwPpAk4FyQALABcA20BOnxmvGQLwCPAUAgEIARQC4AfgEwLQB9ATAsAHwBMCsAewEwKiB6ITApIHkhMCggeCEwJwB3ATAmUIZRQCUwhTFAIUEwgHFw8MCwMAFKsTuAFQQAwND/kODgw8DQEIqwe4AVBAMAED+QICADwBAQ4PPAwTOBQnDRc+DAwNQBcaNA11AgIDPAAHOAgnACABAQFqGHGnGCsQ9l089OQQ/TwQ9is8EOQQ9OQQ/TwAP+08EO0Q/e0/7TwQ7RD97QEREjkREjkAEMkQyTEwAXFxcXFxcXFxcXEAcnEBXRM1MxUUBwYHJzY2NzM1MxUUBwYHJzY2N1fBHytbLDY1A9jBHytbLDY1AwT40aWGO1EpRxZfU9GlhjtRKUcWX1MAAAEAgAPzAVEF0wALAH5ANnsIjAgCDQgB/QcB3gfvBwK9B88HApsHrgcCWgdsBwIIBwsAA/kCAgELADwBCDhvAX8BjwEDAbgBUEAVBwABAAc4CCcAPAMDIAIBAhkMnXkYK04Q9F08TRD99OQQPAA/7V0B5AAQ/TwQPBDtARE5ABDJMTABcXFxcXEAcnEBFSM1NDc2NxcGBgcBQcEgKlssNzQDBMTRpYY8UClGF1tXAAEAbAPpAT0FyQALAHRAJtMH4wcCsQfDBwLyCAGTCKEIAnMIgggCVQhlCAICCAEICwMACKsHuAFQQB4BA/kCAgELADwBAAIDPAAHOAgnAAAgAQEBGQydeRgrThD0XTxNEPTkEP08AD/9PBA8EO0Q/e0BERI5AMkxMABycXFxcQFxcRM1MxUUBwYHJzY2N3zBHytbLDY1AwT40aWGO1EpRxZfUwAAAwBOAT8EFgRnAAMABwALAGy1CDwACQEJuAKpQAlABQEF+QAGAQa4AqlAMwA8sAEBMAGQAQLAAeABAlABcAECAQduAjwAbgYEbgs8CQYJbkAFUAWQBaAFBAVxDHGMGCtOEPRdTeQ8EP3kEPT95AAvXV1xcf32cf1x9nHtMTABNTMVASE1IQE1MxUBy80Bfvw4A8j9tc0Dms3N/uWo/hjNzQAAAgAvAAADxwWOAAUACQCXQF0JBgkIBoUAARQABgcAAQYHBgkHhQQFFAQHCAQFCQgJBgiFAgEUAggHAgEIBwgJB4UEAxQEBwYEAwUAAwIHCQYICAEECAYEBwkBBgMABQACAwgPAQEBaQsEaQqeeRgrEOYQ5l0APzw/PBIXOQEREhc5hwguKwh9EMSHCC4YKwh9EMSHCC4YKwh9EMSHCC4YKwh9EMQxMAkCIwEBFwkCAiUBov5eb/55AYc5/qwBVAFnBY79N/07AsUCyWH9mP2ZAmf//wAh/lED7gXDAiYAXAAAAQcAjgC2AAAAOrUCAQECAiK5AiIAKQArAbEGAkNUWLUAGyILE0ErG7kAH//AQA8rMDQPHx8f8B8DHw9iSCsrcStZNTX//wAGAAAFRgbhAiYAPAAAAQcAjgFQAR4AG0ALAgERCwBIKwECAhS6AiEAKQFkhQArASs1NQAAAf45/8cDIwXTAAMAOUAMAQAAPwMCFAMDAgADuAF9QAoCAQACGgUBGQTOuQGsABgrGU4Q5BDmABg/PE3tOYcFLit9EMQxMAUBMwH+OQRNnfuzOQYM+fQAAAH/5P/nBFMF0wAvAL6zZgIBErj/4LMNETQEuP/gswkRNBG4/+CzCRE0Lbj/zEAWDhw0LSsuLgAmFyAOHDQXGRYWHhQHJrgCU7QIjyUBJbgCU7IfDx64AlNALg4fHxQAHisDFB4ZCQ0QCQYEDh0gJCcECyYfIh4PDg4LCAcHCy0uLhcxJR4LJiIv7dQ8ENY8ETMROS8zEjkvMxESOTkRFzkSFzkAP+0/7RE5Lzz9PBD2XTz9PBESOS8SOSsAERI5GC8SOSsxMAErKytdASIHBgcGByEHIQYVFBchByEWFxYzMjcVBiMgAyYnIzczJjU0NyM3MxIlNjMyFwcmAxaockQ3OAoCqhv9YQEBAoQc/a0qoHOGu2l9l/48nyAXmRxpAwGDHHQ+AQWhwrp/KHoFLVEwWFtShhUTTQ+G5WBFYs46AXhMbIYqMRQVhgFGjlhRumUAAQBcAEgCLAPYAAUATLkAAP/ushY5ALj/7kAKFzkHABcApwADBLgBy0AWAgH5AnUABdUEdQA8IAMwA5ADAwNqBrgBS7FaGCsQ9l399u0Q9u0AL+0xMAFdKysBASMBATMBIwEJlf7FATuVAg/+OQHHAckAAQBcAEgCIQPYAAUANLUHAxcDAgK4ActAFwQF+QQB+QJ1BHUAPD8DnwMCA2oHcbIYKxD2Xf3m9u0Q7QAv7TEwAV0BATMBASMBZf73lQEw/tCVAhIBxv5A/jAAAwAXAAADdQXTABUAGQAdARxALRYICw0ZCggZfhgADRwIARMCKwMcEhIREQQEAwYaFQoXFhYbGxpAHRgZGRwcHbj/8EALDxACVR0QDQ0CVR24/+hACwwMAlUdDBAQBlUduP/qQCkLDAZVnx2/Hf8dAx0aH5AKsAoCCigSEhO7ERQUFUAABQQEAQEAkgICA7j/5LQOEAJVA7j/7LQNDQJVA7j/8rQMDAJVA7j/+rQLCwJVA7j/7LQNDQZVA7j/8kAKCwwGVQMZHnxQGCtOEPQrKysrKys8TRD0PBA8EDwQ/TwQPPQ8EORdThD2cSsrKysrPBA8EDxNEP08EDwQPAA/PD88EDwQPBA8EP08P+0/7RI5ERI5MTBDeUAODg8GBw4HEBsADwYNGwErASuBgTMRIzUzNTQ2MzIXByYjIgYVFTMVIxEBNTMVAxEzEbegoIiTY1QcNSxdRM7OAVa0tLQDm4tnnqgXmAlKeEWL/GUE68/P+xUEJvvaAAIAFwAAA3MF0wAVABkBHUAqFggLDQMKCBgYFwATFBQBAQIrAxIREQQEAwYNHAgBGRYWABUKFxZAGRkYuP/0QAsPEAJVGA4NDQJVGLj/6EALDAwCVRgMEBAGVRi4/+pALAsMBlWfGL8Y/xgDGBobkAqwCgIKKBISE7sUEBERFBQVQAAFBAQBAQCSAgIDuP/ktA4QAlUDuP/stA0NAlUDuP/ytAwMAlUDuP/6tAsLAlUDuP/stA0NBlUDuP/yQAoLDAZVAxkafFAYK04Q9CsrKysrKzxNEPQ8EDwQPBD9PBA8EDwQ9DwQ5F1OEPZxKysrKys8TRD9PAA/PDwQPD/tPzwQPBA8EP08EDwQPD88ERI5ERI5MTBDeUAODg8GBw4HEBsADwYNGwErASuBgTMRIzUzNTQ2MzIXByYjIgYVFTMVIxEhETMRt6CgiJNjVBw1LF1Ezs4BVLQDm4tnnqgXmAlKeEWL/GUFuvpGAAABAEn+pgQiBaYAEwCYQFENDg4FBQYgBwcMCwsIiAoJABAPDwQEAyABAgIREhIBiBMADA0NEBFuEwoLCw4ODw8SEhMgAAkICAUFBAQBAQBuAgcGBgICQAOQAwIDPhRwjBgrEPRdPBA8EDwQ9DwQPBA8EDwQPBD9PBA8EDwQPBA8EPQ8PBA8AC889DwQPDwQPP08EDwQPD889DwQPDwQ/TwQPBA8MTABESE1IREhNSERMxEhFSERIRUhEQHb/m4Bkv5uAZK0AZP+bQGT/m3+pgFyoQLVoQF3/omh/Suh/o4AAAEAuQJrAYYDOAADABpADgE8AAI8IAABAKAEoZgYKxD0Xf0AL+0xMBM1MxW5zQJrzc0AAQBs/vEBPQDRAAsAbkAo8wgBkQigCAJyCIQIAgMIAdIHAbQHwwcCVAdkBwIICwMACKsHA/kCB7gBUEAYAgELATwACAOBAAc4CCcBIAABABkMnXkYK04Q9F08TfTkEO0AP+08EDztEO0Q7QEREjkAyTEwAXFxcQBycXFxMzUzFRQHBgcnNjY3fMEfK1ssNjUD0aWGO1EpRxZfUwAAAgBH/vECTgDRAAsAFwDWQE6fGa8ZAgAIABQC4gfiEwLQB9ATAsAHwBMCsAewEwKgB6ATApEHkRMCggeCEwJzB3MTAvAI8BQCZAhkFAJUCFQUAhQTCAcXDwwLAwAUqxO4AVBACw0P+Q4ODTwMCAcHuAFQQCwBA/kCAgE8AAgODzwMEzgUJw0MQBcaNAx1AgIDPAAHOAgnAY8AAQAZGHGnGCtOEPRdPE305BD9PBD2Kzz05BD9PAA//TwQ7RD9PD/9PBDtEP3tARESORESOQAQyRDJMTAAcXFxAXFxcXFxcXFxAHIBXTM1MxUUBwYHJzY2NzM1MxUUBwYHJzY2N1fBHytbLDY1A9jBHytbLDY1A9GlhjtRKUcWX1PRpYY7USlHFl9TAAcAJf/KB9sF0wADAA8AHgAqADkARQBUAX5AC5gBlwMCswgBAgMDuAKaQA8AARQAAAECATIrAwAXEBO8Ap8ADQEfABsCn0ALBwIBOgcBAwAAKFG4Ap+yPT02vQKfACIBHwAoAEkCn7JDQy64Ap+0KAtWaU28ApoAQAG2AEYCmrI6ajK8ApoAJQG2ACsCmrIfbBe8ApoACgG2ABACmrMEaVVWuAHtsyGbaBgrK/bt/e327f3t9u397eYAP+08EO0Q/e08EO0QPBA8P/Q8EO397QEREjk5ERI5OYcuK4d9xDEwGEN5QIwFVFMlTyZLJTglNCYwJR0lGSYVJVI8Rh8AUD5NHwFIREYfAEpCTR8BNyErHwA1IzIfAS0pKx8ALycyHwEcBhAfABoIFx8BEg4QHwAUDBcfAVQ7UR8BTj9RHwFHRUkfAExBSR8AOSA2HwEzJDYfASwqLh8AMSYuHwAeBRsfARgJGx8BEQ8THwAWCxMfAAArKysrKysrKysrKysBKysrKysrKysrKysrKysrKysrKysrgQFdBQEzAQE0NjMyFhUUBiMiJjcUFjMyNzY1NCcmIyIHBgE0NjMyFhUUBiMiJjcUFjMyNzY1NCcmIyIHBgU0NjMyFhUUBiMiJjcUFjMyNzY1NCcmIyIHBgFAAlmD/aj+YZ2BgKCMkoCglE9BOyArLCI8PiEtAkKdgIChjJKAoJRPQTsgKy0iOz4hLQIOnYGAoIuTgKCUT0E7ICssIjw+IS02Bgn59wSBx7W2wsTHusWYai08m5g/Ly4//HLHtbbCxMa5xZdrLT2amT4vLj6Ux7W2wsTGucWXay09mpk+Ly4+/////QAABVkHLAImACQAAAEHANYBQAFqAB9ADwJvEZ8RAgARFAECQQIBFboCIQApAWSFACsBK3I1AP//AKIAAAToBywCJgAoAAABBwDWAWsBagAqQBIBDEAeIDQADK8MAi8MXwwCDAK4/f+0SCsBARK5AiEAKQArAStdcSs1/////QAABVkHLAImACQAAAEHAI0BPwFqACGxAhK4/8BACxIZNBIMAEgrAgEPugIhACkBZIUAKwErKzUA//8AogAABOgG4QImACgAAAEHAI4BbAEeAEeyAgEOuP/AQAoLDAZVDkAYHDQOuP/AQBQdIDQOQA8RNKAO7w4CoA6wDgIOBLgBDrVIKwECAhO5AiEAKQArAStdcSsrKys1NQD//wCiAAAE6AcsAiYAKAAAAQcAQwGBAWoAKEAQAZ8Nrw0Cbw1/DQJADQENArj9+7RIKwEBDbkCIQApACsBK11xcTX//wCNAAAB/gcsAiYALAAAAQcAjf+vAWoAK7EBB7j/wLMXGTQHuP/AQA4iJTQvBwEHAVpIKwEBB7kCIQApACsBK10rKzUA////4AAAAlkHLAImACwAAAEHANb/xwFqADKzAQEBCrkCIQApACsBsQYCQ1RYtQAGCQECQSsbQA8EQDM0NARAHR80BAFhSCsrKytZNf//AAQAAAI1BuECJgAsAAABBwCO/8cBHgAYQAsCAQgCAEgrAQICC7kCIQApACsBKzU1//8ANgAAAa4HLAImACwAAAEHAEP/3QFqADmzAQEBBbkCIQApACsBsQYCQ1RYtS0EBAICQSsbQA8FQBcZNAVAIiU0IAUBBQK4/6axSCsrXSsrWTUA//8AY//nBd0HLAImADIAAAEHAI0BxwFqACSxAh+4/8BAEBYZNHAf3x8CHwMASCsCAR+5AiEAKQArAStxKzX//wBj/+cF3QcsAiYAMgAAAQcA1gHGAWoAFkAKAgAeIQMDQQIBIrkCIQApACsBKzX//wBj/+cF3QcsAiYAMgAAAQcAQwHDAWoAJLECHbj/wEAQCww0UB3vHQIdAwBIKwIBHbkCIQApACsBK10rNf//AKH/5wUiBywCJgA4AAABBwCNAYgBagArQBsBGEAMDjRPGAEfGC8YAn8YjxgCGBEASCsBARi5AiEAKQArAStdcXErNQD//wCh/+cFIgcsAiYAOAAAAQcA1gGIAWoAJ7IBARu5AiEAKQArAbEGAkNUWLYBABcaCwFBKzUbtgEBFREUSCcrWQD//wCh/+cFIgcsAiYAOAAAAQcAQwGFAWoAI0AUARZAFxk0fxYBnxYBFhEASCsBARa5AiEAKQArAStdcSs1AAABAMYAAAF6BCYAAwBqtQIBBgAKBbj/5EAQDw8CVQWjAgMlAQAAIAACALj/5LQQEAJVALj/7LQNDwJVALj/8LQMDAJVALj/+rQLCwJVALj//EAQDAwGVQAdCwsGVQCjBOrSGCsQ9isrKysrK108/TzmKwA/PzwxMDMRMxHGtAQm+9oAAQAZBKoCkgXCAAYASUAUBQYBAAIQAgIChwBkBAMABTwGPQS4/8BAEQkMNARkAGQDfwE8AhkHqWgYKxlOEPQYTf0Z9hj9/SsZ9hjtAD887f1dPDw8MTABByMTMxMjAVhxztjA4cwFVKoBGP7oAAABAAYEwwKkBaoAFwCXQBGHDgFACBIQBwUECxcAOg8/CLgCuLITPwS4ArRAGQwAGRcXGgx2C4EQTRGdF3YAfxgZ4CGzehgrK/b99uT0/U5FZUTmAD9N5uz8/eQBERIXOTEwQ3lALBQWCQ4BAxUlAiYUAxYyABUWAgEUAxcyAAkOCzIBFQITMgEWARMyAQoNCDIAACsrKwErKxA8EDwrKyuBgYEBXRMmNzYzMhcWMzI2NzMGBiMiJyYjIgcGFwcBOjlZPms7IyAiB4IDbVQ/Z0MfIhUWAQTDaD4+Nh4jNHJyOCQYGC8AAAEAHQTLAo0FXwADACO5AAH/wEAPEhQ0ATUAAhoFABkEqWgYK04Q5BDmAC9N7SsxMBM1IRUdAnAEy5SUAAEALgS1An0FuAANAEuzVQIBC7gCn0AMEAR/BAIEBwgIAAAIuwKfAAcAAAKfQA9AAb0E7CAHGQ4QBAGbQRgrXU4Q9BoZTf39GhjtEO0APzwQPC9d7TEwAV0BMwYGIyImJzMWFjMyNgICew+Zf4CZD3sOU0ZRUwW4fYaFfkRDQQAAAQDlBKoBxAWKAAMAHEAOAgEDADwBAzwAywTZ9RgrEPbtAC/9PBA8MTATNTMV5d8EquDgAAIAogR/AgoF7QALABcAVkAOBoQSTQNNDIQAbBieeRgrEPb9GfT0GO0AsQYCQ1RYsg+ECbj/wEAJCw40CQkVhAMBP+0zLyv9G7QJhA9NBrgCtLUATRWEAwE//Rn0GPYZ9BjtWTEwEzQ2MzIWFRQGIyImNxQWMzI2NTQmIyIGomtJSmpqSUtqTD8rKz8+LCs/BTpJamtMTWprTy9AQC0tQD8AAAEAa/5bAhwAFwAVAEG0CwkMOgm4ArW1DpxPAAEAuAJaQA8CAQoMOgulBnYSTQECnAG4AT6zFld5GCsQ9v0Q9O305AA/PP1x9u30EDwxMBc3MwcWFhUUBiMiJzcWMzI3NjU0JibYNIYhVVaQkVI+C0AeXiYdFz6asWsKVTRLcwx1BBoUHRIcFAACADoEqgL7BcIAAwAHAEFAIQcEAAADEAMCA4cGAQUCAAY8BXIPBAEE3AACPAFyABkIcLkBkAAYK04Q9E307RD0XfT9AD88PDxN/V08PDwxMBMTMwMzEzMDOnnq08t/588EqgEY/ugBGP7oAAABALf+VgJtABgAEABVQAnZAgEOIA0TNAa4/8CzGRw0BrgCn0AODA8ACgggCTAJAglVEgO4/8BADhkcNAOsDwGsADgPnxGhuQGGABgrEPb07RDtKxD2XTwAPz/tKzEwACsBXTczBhUUFjMyNxUGBiMiJjU04HwnUj5NWzR6LWN4GFlLRFQudxsieGVWAAEAKASqAqEFwgAGAEhAEwUGAQ8CHwICAocAZAQDAjwBPQO4/8BAEQkMNANkAGQEfwY8BRkHm3oYKxlOEPQYTf0Z9hj9/SsZ9hjtAC887f1dPDw8MTABNzMDIwMzAWduzOHA2M4FGKr+6AEYAAEAAAAABCsFugANALNAFQABCAQNAwQNAgcGAgcFCgkBCAUKB7sBDgAIAAIBDrIBCwq4AQ5AJAwNCAEBBAgICgQCIAsBC1QPBwjdBQoCAQplBAFdDRwQEAJVDbj/8rQPDwJVDbj/8rQNDQJVDbj/+rQKDAJVDbj/9rQMDAZVDbj/9LcNDQZVIA0BDbgCsrMOO1wYKxD9XSsrKysrK+Y87RA8EDz0PBDkXQA/GRI5LxE5Lxg/PP08EO0Q7Q8PDw8xMBMHNTcRMxEBFQERIRUhkZGRwgFM/rQC2PxmAjV7p3wC3f3IARmn/uf90q0AAQADAAABvwW6AAsAw0BIHw1wDYANwA3QDf8NBgABCAQLAwQLAgcGAgcFCgkBCAUKB8kIAskBCgsKAQEECAgKBAAHCEUFCgIBCkAE3wEBAU4NNgsLAlULuP/4tBAQAlULuP/6QB0ODgJVCwQMDAJVCwoLCwJVCxQLCwZVCwgQEAZVC7j//rQNDQZVC7j/+0ARDAwGVQALIAvQCwMLTgxHUBgrEP1dKysrKysrKysr5l087RA8EDz0PAA/GRI5LxE5Lxg/PBDtEO0PDw8PMTABXRMHNTcRMxE3FQcRI4WCgrOHh7MCPm6ebgLe/bpznXP9Kf//AFz/5wTrByYCJgA2AAABBwDfASgBZAAZQAwB8DEBMRYSSCsBATS5AiEAKQArAStdNQD//wA//+gDsQXCAiYAVgAAAQcA3wCUAAAAGUAMAXAxATEVEkgrAQE1uQIiACkAKwErcTUA//8AKQAABLAHJgImAD0AAAEHAN8BFAFkABZACgEAEg8GB0EBARC5AiEAKQArASs1//8AKAAAA9QFwgImAF0AAAEHAN8AuAAAACmzAQEBE7oCIgApAWSFACsBsQYCQ1RYtQAUEQYHQSsbtQAUEQYOQStZNQAAAgC8/lEBWQXTAAMABwBPvQACAq4ABwFlAAYBfkAjAwAJoQADAgABAQUFnwSvBAIEdgYHByACAQKhCAgJ1SGhmBgrK04Q9F08EDxN/V08EDwQPBA8EO4AP039/eYxMAERIxETESMRAVmdnZ0F0/zqAxb7lfzpAxcAAv/9AAAFWgW6ABMAJQEDQC5DCCMDMCQCAgAgIR4GBQIVFB4TAAgkJCYnGyYNKBAQAlUNDg8PAlUNFA0NAlUNuP/4tAwMAlUNuP/4tAsLAlUNuP/rQBcMDAZVAA0BDRonIRQgBQI5ACAQEAJVALj/9rQPDwJVALj/9rQNDQJVALj/+rQMDAJVALj/97QMDAZVALj/+EAKDQ0GVQBdJmBbGCsQ9isrKysrK+Q8/TxOEPZdKysrKysrTe0REjkvAD88/Tw/PP08EjkvPP08MTBDeUA2Bx8LDAoMCQwIDAQGHRweHAIGDw4QDhEOAwYZGhgaFxoDBh8HGyEBFhIbIQEcDCAhARoOFSEAKysBKysqKioqgTMRIzUzESEyFxYXFhIVFAIGBwYjJSEyNjc2NjU0LgIjIREhFSGeoaEB+qpafll0c47GgUeP/rEBOZKkMEVOTXyYnf7MAZT+bAKbhAKbFR1MYv7PxOD+vZIfEa02MEXop6zOfDD+EoQAAgBJ/+cEIQW6ABwAKAGSQG0PGR8ZNwM6HlYDXRwGBAAUACoFJBhdAAUyCAIDAwEYGBYGBgcZGQUbGwAaAwMDARsbABoaBBwbGwAYFxUGAgUdIxUSIBgXBgIEABkbGhkEAwEAByMFCB0bGgUDBAAZIBwgEjASAhKPGQQBAAAZuP/AQA0ODgJVGQcmHAsLHSQIuP/stA8PAlUIuP/2tA0NAlUIuP/itAsLAlUIuP/wtAsLBlUIuP/ptA0NBlUIuP/wtA8PBlUIuP/mQDYMDAZVCBoqIyQPCg8PAlUPHgwMAlUPFAsLBlUPGw0NBlUPCBAQBlUPIAwMBlUfDwEPGSk0NxgrThD0XSsrKysrK03tThD2KysrKysrK03tAD/tPys/PDwQ9l3tERIXOQEREjkSFzkAERIXORESOQEREhc5BxAOPAcQCDwIPIcIPIcQCH3ECDwHEA48sQYCQ1RYtgkYGhhZGAMAXVkxMBhDeUAkISgJEQ0lIREjHQAlDCMdACcKHR0BIhAgHQEkDiYdACgJJh0AACsrKwErKysrgYEBXQBdATMWFzcXBwARFAAjIicmNRAAMzIWFyYmJwUnNyYBNCYjIgYVFBYzMjYBNNlINdYtrAFA/urX/49dAQLCOlhCJDY0/u0s72EBxLWEgqqvg4CzBbo2MGZmU/6Q/nj9/tvCf90BBQEcGCNJUTt/Z21a/KLAy8vRwsTP//8ABgAABUYHLAImADwAAAEHAI0BTQFqABhACgEBEAYaSCcBARC6AiEAKQFkhQArASv//wAh/lED7gXCAiYAXAAAAQcAjQDGAAAAH0ARAQAeAZAe4B4CHg8iSCsBAR65AiIAKQArAStdcTUAAAIAngAABP0FugAPABoAoUAWEBoUDxAeDtoAGRoeBAPaAQIACBQmCrj/8LQNDQZVCrj/8LQMDAZVCrj/6kAXCwsGVRAKIAoCCi4cAg8gAQAgEBACVQC4//a0Dw8CVQC4//a0DQ0CVQC4//q0DAwCVQC4//C0DQ0GVQC4//pADQwMBlUgAAEAXRs7XBgrEPZdKysrKysrPP08EPZdKysr7QA/P/Q8/TwQ9O0BERI5OTEwMxEzESEyFx4CFRQCISERESEyNjU0JicmIyGewgFnkk5sklju/sn+iAF7vJ5cTDGF/okFuv7WDhNltm26/v3+1gHXjH5bhBUOAAACAIf+aQQhBboAFAAgASVAKUggVwRYEmYEaBLrIAY3HwEpCBUUABMYDwMHAQAeHAcHGBwPCwAOGyQLuP/yQAsPDwJVCxINDQJVC7j/+kALDAwCVQsGCwsCVQu4//K0CwsGVQu4/+S0DAwGVQu4//q0DQ0GVQu4//tADhAQBlULGiICAxMUJQEAuP/8QBcODgJVABANDQJVABAMDAJVABALCwJVALj/9rQQEAZVALj//EAjDw8GVQASDQ0GVQAMDAwGVQAMCwsGVR8APwBPAAMAGSFHNxgrEPZdKysrKysrKysrPP08PDxOEPYrKysrKysrK03tAD8/7T/tPxE5ERI5ARESOTEwQ3lAHBkdCA4JJQ0mHQgbHQEZDhsdARwKHh0BGgwYHQAAKysBKysrK4GBAV0AXRMRMxE2NzYzMhYWFRQCBiMiJyYnEQMUFjMyNjU0JiMiBoe0STdIXIjQanXfelNHNkgRpnZ4q6d0c7H+aQdR/fxNGSKM/5ik/vyLIRpL/fsDpM3Ey9XLytcAAAEAcgJ/BDoDJwADABpADAIlAAAaBQEZBFdaGCtOEOQQ9gAvTe0xMAEhNSEEOvw4A8gCf6gAAAEAoQEgBAkEiAALASC1JwQBJAQBsQYCQ1RYQBELCgMRAyMDSQNVA2YDhQMHAwAvXTMwG7B8S1NYQBceEQoGCwIJBwYLAwgEAwgABQEABQIJBbsCdwAGAAMCd7MCBwEJuwJ3AAgACwJ3QBgABgKUKgEBAZQIMACQAAI/AFAAAgAKBAhBCgKSAAkABgKSAAUAAgKSAAMAAAKSQBYLCQWUBJQDsAvACwKfCwEgCwEL/AyeuQGBABgrEPZdXV08Gfz8PBgQ7BDsEOwQ7BA8AC9dcTwZ/F38PBgQ7BDsEDwQ7BDsDw8PD0tTWLIGKgi+/9YAB//gAAP/4AAL/+BADQEAAgMEBQYHCAkKCwsBFzg4ODgAODhZS1FYQAkCAQoJAAQFBAcBFzhZWVkxMABdAV0TAQE3AQEXAQEHAQGhATv+xnoBOgE5eP7IATp6/sb+xQGZATsBOnr+xgE5ef7H/sZ6ATr+xQAAAQBrAt0B3AXMAAkAUEAQASISOQMiEjkHCAABBAMJALgBH7MIA+gEuAKjQA8HBwgBCAk1AQDLBAN1Cle5AS8AGCsQ9jz2PP08AD88EPTtEP08ERI5ARESOTEwACsrAREGBzU2NjczEQFLZno+mC9sAt0CKlEgexRqPf0RAAEAGQLdAogFzAAcAIJAGwMEDBgCdRjlF+UY/AMECgUBGhkYAwcNGBkSGroCYQAcAR+2EQ0nPw4BDroCuAAKAmFAFBEBGxw6BykUvwANKQ4nABkdqWgYK04Q9E307RD97fQ8AD/99F3kEP39ETk5ARESFzmxBgJDVFi1GBEcAxEaABESORESOVkxMAFxXQBxEzY3NiQ3NjU0JiMiBgcnNjYzMhYVFAcGBwYHIRUZBik/ASAbJUZEQkEVlx2PhpeNOy2gUyMBggLdOTlW0R4pKzA+L0MQb2l2VVRLOHM9JHkAAQAhAssChgXMACsAdkARIwgQEyMQTQ8PFgUBJzAAAQC8ArgABQJhACkBH0AMHRknXxpvGgI/GgEaugK4ABYCYUAZHQEPoBMpICcIKSbfABkpGicBKQAZLKloGCtOEPRN7fTtEP3t9P30AD/99F1y5BD9/fRd5BESOS/8OQESORE5MTATNxYXFjMyNjU0JiMiBwYjNxY2NTQmIyIGByc2NjMyFhUUBgcWFhUUBiMiJiGSFCArO0dWSFcMFQ4IFlFLPDs4PxePKX14kINHQ1lUnpKMlAOhDzwWHk43MjwCAW4BPCslNCw6F2pUa1A3VhMWZURdim8AAwBr/8cGiAXTAAMADQAqAQBAGgYRAfYRAS8sMyE/JkQhVCGsKLwo7CgIAgMDuAKaQCEAARQAAAEoKQ8QEQMbDgADAQIELCsLDAQFCAccGBsH6Ai4AqOyCwQNuAEfQBALDDoCAQEfGy8bPxsDG00YvwJhAB8BHwAoAmEADgApAmFACyoqDicAAAMJDicbugJjABwBHUATFSkiOioqKWksBQQMDSkECAfLBLgBRLMrV2gYKxD29jwQ/TwQPBD2PBD07f3t5AA/PBD0PBDtEO39/fRdPzz0PP08EPT9ERI5ERI5ARESORESFzkREhc5ETmHLit9EMSxBgJDVFi1Jh8qER8pABESORESOVkxMAFdAF1xFwEzAQMRBgc1NjY3MxEBNjc2JDc2NTQmIyIGByc2NjMyFhUUBwYHBgchFeQETZ37szZmej6YL2wCPQYqPgEgGyVFRUJBFZcdkIWXjTstn1QjAYI5Bgz59AMWAipRIHsUaj39Ef0EODlX0B8pKzA9L0IPcGl2VVRLOHQ9I3kAAAQAa//HBo4F0wADAA0AGAAbAQFAIBYRASABIAIpESsbOhE6G1YAZgCGGwkbG2YbdhsDAQAAuAKaQB0DAhQDAwILDAQAAwECBB0cGxESGA4aERIbBQfoCLgCo7ILBA24AR9AFQwMCwILOgEBFhcXEA8bGRUUFBlkD7gCsLIOExK4AR9ALRgYDgADJw4LGjUTG/kREV8QARDuDjUTFk0gGAEYrB0MDTUFBAgHyyAEAQQZHLsBoQBoABgBDoUrThD0XU32PBA8/TwQ9l3kPO39XTwQ7RDtAD/0PBA8EP08EPT9PBA8EDwQPDwQPD/kPBA8EP08EPT9ORESOTkBERI5EjkREhc5ERI5hy4rfRDEMTABXV0AXRcBMwEDEQYHNTY2NzMRATUhNQEzETMVIxUDEQP8BE6c+7NOZno+mC9sA7r+gQGVemhokOY5Bgz59AMWAipRIHsUaj39Ef0EmnsB2v4XbJoBBgEH/vkABAAh/8cGjgXTAAMALQA4ADsBM7UvPQECAwO4AppAJwABFAAAARIVEQADAQIEPTwlDBUyMzolERIFBAkxOjIwEk0RERgJBbgCqkALEAQgBDAEAwSRCRu4AqpAFx8cLxw/HAN/HAFfHG8cAl8cbxwCHJEYvQJhAB8ACQJhACsBH0ASHzMCAQE1NDQ5Njc3Lzs5ZDAvuAKxsi4zMrgBH0AJODguAwCPLgsRuAIwQB0VO/kxMTDuODo1MzaRMy4pOE49FSkiIgwpMCgBKLgCKEANBBspHCIFKQQZPHxmGCtOEPRN7fTtEP1d7fTtEPbtPOQQ7RD9PBDtEPQAP/Y8EDwQ/TwQ9Dz9PBA8EDwQPBA8Pzz0/e0Q/fRycXFd5BD0XeQREjkv/BESOTkREjkREjkBERI5ERI5ERIXORESOYcuK30QxDEwAV0XATMBATcWFxYzMjY1NCYjBiM3FjY1NCYjIgYHJzY2MzIWFRQGBxYWFRQGIyImATUhNQEzETMVIxUDEQP8BE2d+7P+iJIUICs7R1ZIVDIIFlFLPDs4PxePKX14kINHQ1lUnpKMlAVf/oIBlHtoaJHlOQYM+fQD2g88Fh5ONzI8A24BPCslNCw6F2pUa1A3VhMWZURdim/8p5p7Adr+F2yaAQYBB/75AAABAAAAAAQNBboAEQC/QBQHHgUFBAkeC0ALCwJVC0AREQJVC7gCMUA1Dh4MHgIeAEANDQJVAIYQEQQCEQAODaUKCglNBgYFahMHCAsMDxAgBAMAEQIBdhEcEBACVRG4/+60Dw8CVRG4//K0DQ0CVRG4//a0DAwCVRG4//y0CwsCVRG4//K0DAwGVRG4//BACg0NBlURnxKhpxgrEPYrKysrKysr9DwQPDw8/Tw8PDw8EPY8EPQ8EPQ8AD8/EDz0K+397f4rK+0QPBDtMTA3IzUzESEVIREhFSERIRUhFSOoqKgDZf1dAjj9yAE7/sXC9pUEL63+Oq3+8ZX2AP//AG3/5wW5BxcCJgAqAAABBwDZAg4BXwAsswEBASq5AiEAKQArAbEGAkNUWLUALScODkErG0AKcCqgKgIqDgBoKytdWTX//wBC/lED6gW4AiYASgAAAQcA2QDkAAAAGUAMAsAvAS8TLGgrAgEvuQIiACkAKwErcTUA//8AsQAAAZAG9AImACwAAAEHANr/zAFqACeyAQEHuQIhACkAKwGxBgJDVFi2AQAFBgECQSs1G7YBAQcCCUgnK1kA//8AXP5lBOsF0wImADYAAAEHANwBUwAKACBAFgEfMwHAM/AzApAzATMtGUgrAQEyCCkAKwErXV1xNf//AD/+bwOxBD4CJgBWAAABBwDcAJ8AFAA6tQEBATIKKQArAbEGAkNUWLUAMjMuLkErG0AMEDMB4DPwMwKwMwEzuP/Atw8RNDMuPEgrKytdXXJZNf//AGb/5wV2BywCJgAmAAABBwCNAbkBagAutgEhQBARNCG4/8BAExMZNHAh3yECLyEBIQwASCsBASG5AiEAKQArAStdcSsrNf//AFD/6APtBcICJgBGAAABBwCNAMoAAAAwswEBAR65AiIAKQArAbEGAkNUWLUAHh4LC0ErG0ANAB6gHgJ/HgEeCwBIKytdcVk1//8AZv/nBXYHJgImACYAAAEHAN8BsAFkABZACgEAIyAID0EBASK5AiEAKQArASs1//8AUP/oA+0FwgImAEYAAAEHAN8AygAAABZACgEAIB0HDkEBAR+5AiIAKQArASs1AAIARv/oBHAFugAZACUBdkB2UxxQJI8nAz8nASkNJhgqHjkNNhg2HDolSg1FF0YbSSVaDVoUVxVWGA8MHRkWIwEAQB4rNADUAwgJQB4rNAnUB18GbwYCHwYvBj8GXwafBgUGkQUCXwNvAwIfAy8DPwNfA58DBQORBQQACgsKHRwOCyMcFgcCAbgCa0AxCAMEJQUgMwAZDAslCgdgCAGgCAGwCNAIAgiSBQYJJ0ALCwJVJ0ANDQJVChIQEAJVCrj/9EARDw8CVQoGDg4CVQoYDQ0CVQq4//JACwsLBlUKDhAQBlUKuP/utAwMBlUKuP/4QEINDQZVEApACoAKAwp0GiQSHgsLAlUSGAwMAlUSHg0NAlUSDAsLBlUSDA0NBlUSGgwMBlUfEj8STxJgEgQSGSY0UBgrThD0XSsrKysrK03t/V0rKysrKysrKysrPDw89F1xcjwQ/Tw8POQQ/TwQ/TwAP+0/7T88Pzz0XXE8EPRdcTz9KzwQ/Ss8ERI5EjkxMABdAXJdASE1ITUzFTMVIxEjNQYjIiYmNTQSNjMyFhcBFBYzMjY1NCYjIgYDLP6mAVqzkZGnZcR/1XVq1INgli/906x1dqWoe3ihBMOEc3OE+z2Gnoz7o58BA4pRQf5mzMrBxtrMxAAAAf/hBh4EigafAAMAJUANAjADAwEwAAMaBQAZBLoBiQGOABgrThDkEOYAL03tPBDtMTADNSEVHwSpBh6BgQABAfECfQK+A0oAAwAhQAsCAQMAPAEDPAAZBLgBT7FBGCtOEPRN/QAv/TwQPDEwATUzFQHxzQJ9zc3////9AAAFWQcXAiYAJAAAAQcA2QFSAV8AFUAKAgETDAloJwIBE7kCIQApACsBKwD//wBK/+gEHAW4AiYARAAAAQcA2QD1AAAAGUAMAs88ATwcA2grAgE8uQIiACkAKwErXTUA/////f5gBgwFugImACQAAAEHAN4DnwAKABZADAIBDwQASCcCAQ8IKbgBZIUAKwEr//8ASv5vBPQEPgImAEQAAAEHAN4ChwAZABJADAIBOCcASCcCATgKKQArASv//wCeAAAFWgcmAiYAJwAAAQcA3wDxAWQALUAVAh5AExMGVR5ADw8GVR5ADAwGVR4CuP/2tEgrAgEhuQIhACkAKwErKysrNQAAAwBH/+gE7gW6AAoAHAAoATRAMDYnUx9TJ2IfYicFNRg2HwItIToNSQ1DF0UeSShaDWoNCC0NIxgCBgoADCYgGRwWBrgCQ0A0AEABA0ACAgEAGxoAJkgWBxwLCiBIDgsKkQAAAQMCQAExGxscIzMLGRoMGgslHBIQEAJVHLj/9EAXDw8CVRwGDg4CVRwYDQ0CVRwLEBAGVRy4//i0Dw8GVRy4/+5ACw0NBlUcCQwMBlUcuP/nQD4LCwZVEBxAHGAcgBwEHHQdJBIeCwsCVRIYDAwCVRIeDQ0CVRIKDQ0GVRIiDAwGVRIHCwsGVT8STxICEhkpNLkClgAYK04Q9F0rKysrKytN7f1dKysrKysrKysr/Tw8EDwQ5BA8EP79PBA8TRDkAD/tPzw/7T88PzwQ7RDt7RESORESOQEREjkxMABdXQFdXQE1MxUUBgcnNjY3ATUGIyImJjU0EjYzMhYXETMRARQWMzI2NTQmIyIGBDa4SE4tMzEC/qhlxH/VdWrUg2CWL7P9IKx1dqWoe3ihBQG5uWV9IkQXV1L6/4aejPujnwEDilFBAg76RgISzMrBxtrMxAAAAv/9AAAFWgW6ABMAJQEDQC5DCCMDMCQCAgAgIR4GBQIVFB4TAAgkJCYnGyYNKBAQAlUNDg8PAlUNFA0NAlUNuP/4tAwMAlUNuP/4tAsLAlUNuP/rQBcMDAZVAA0BDRonIRQgBQI5ACAQEAJVALj/9rQPDwJVALj/9rQNDQJVALj/+rQMDAJVALj/97QMDAZVALj/+EAKDQ0GVQBdJmBbGCsQ9isrKysrK+Q8/TxOEPZdKysrKysrTe0REjkvAD88/Tw/PP08EjkvPP08MTBDeUA2Bx8LDAoMCQwIDAQGHRweHAIGDw4QDhEOAwYZGhgaFxoDBh8HGyEBFhIbIQEcDCAhARoOFSEAKysBKysqKioqgTMRIzUzESEyFxYXFhIVFAIGBwYjJSEyNjc2NjU0LgIjIREhFSGeoaEB+qpafll0c47GgUeP/rEBOZKkMEVOTXyYnf7MAZT+bAKbhAKbFR1MYv7PxOD+vZIfEa02MEXop6zOfDD+EoT//wCi/lYE6AW6AiYAKAAAAQcA3gJ4AAAAEkAMAQEUCwBIJwEBDAgpACsBK///AEv+VgQeBD4CJgBIAAABBwDeAT0AAAAnQBICkB7PHt8eA2AegB4CUB4BHhO4/7q2SCsCAR4KKQArAStdXV01AP//AKIAAAToByYCJgAoAAABBwDfATMBZAAqQBIBDEAeIDQADK8MAi8MXwwCDAK4/f+0SCsBARC5AiEAKQArAStdcSs1//8AS//oBB4FwgImAEgAAAEHAN8A4AAAABVACgIBHgoASCcCASG5AiIAKQArASsA//8AlgAABCoHLAImAC8AAAEHAI0AUgFqABVACgEBCQJwSCcBAQm5AiEAKQArASsA//8AQgAAAbMHHQImAE8AAAEHAI3/ZAFbADyzAQEBB7kCIQApACsBsQYCQ1RYtQAHBwECQSsbuQAH/8CzFxk0B7j/wEALIiU0LwcBBwFaSCsrXSsrWTUAAgCWAAAEKgW6AAoAEACdswYKAAa4AVFAMwEDZQIAZQIBAQ0KUQAAAQMCCgsQAlUCZQEBEg0NDAIPDh4QCwgPGhINDiAMCyQQEAJVC7j/8rQPDwJVC7j//kALDQ0CVQsEEBAGVQu4//5ADQwMBlUgCwELGRE7XBgrThD0XSsrKysrPE39PE4Q5gA/PE39PD88ARESOS/9KzwQPBDkABA8EDztEO0Q7QEREjkxMAE1MxUUBgcnNjY3AREzESEVAsjNUFcyOTcC/WjCAtIE7c3NcYsmTRlhW/sTBbr6860AAgCIAAACVAW6AAoADgDVQAkvEAEKAwAHtwa4AkNADgEDQAIAQAIBAAIDAQAGuAJbQCgHMwBAAxQLEAJVHwMBA0lwEIAQAp8Q3xACTxABEA0MAA4LCg0OJQwLuP/4tBAQAlULuP/6QBEODgJVCwQMDAJVCwoLCwJVC7j/8rQLCwZVC7j//kALDw8GVQsIEBAGVQu4//y0DQ0GVQu4//lADwwMBlUACyALAgtOD0dmGCsQ9l0rKysrKysrKys8/TwAPzw/PAEQcV1d9l0r/fTkEDwQPAA/PO0Q7RD97QEREjkxMAFdATUzFRQGByc2NjcBETMRAZy4SE4tMzEC/pG0BQG5uWV9IkQXV1L6/wW6+kYA//8AlgAABCoFugImAC8AAAEHAQEA5AAAACmxAQa4/8C0DA40BgS4/qdACkgrAQZADRE0BgS4AdCxSCsAKys1ASsrNQD//wCDAAACpAW6ACYATwAAAQYBAeYAAB1ADgGPBL8EAgQDlUgrAQQDuAJ9sUgrACs1AStdNQD//wCcAAAFHwcsAiYAMQAAAQcAjQFcAWoAQLMBAQENugIhACkBZIUAKwGxBgJDVFi4/+y0DQ0CBEErG0ARbw1/DQIADQG/DeAN8A0DDQS4/pWxSCsrXXFxWTX//wCHAAAD5gXCAiYAUQAAAQcAjQDiAAAAJLQBPxoBGrj/wLQSFDQaBbj/2rRIKwEBGrkCIgApACsBKytxNf//AJwAAAUfBywCJgAxAAABBwDfAXcBagAZQAoBAA8MAQVBAQENugIhACkBZIUAKwErNQD//wCHAAAD5gXCAiYAUQAAAQcA3wDiAAAAFkAKAQAcGQELQQEBGrkCIgApACsBKzX//wBj/+cF3QcsAiYAMgAAAQcA3QGfAWoAIkATAwIAICAgAvAgASADVkgrAgMCI7kCIQApACsBK11xNTX//wBE/+gEJwXCAiYAUgAAAQcA3QDhAAAAJrIDAh64/8BAEA8PBlWPHgEeBCtIKwIDAiG5AiIAKQArAStdKzU1//8AoQAABa0HLAImADUAAAEHAI0BGQFqACRADQImQAwRNCZAExQ0JgK4/3i0SCsCASa5AiEAKQArASsrKzX//wCFAAACxgXCAiYAVQAAAQYAjRQAACRADQGvFd8VAhVACw00FQa4/3u0SCsBARW5AiIAKQArASsrXTX//wChAAAFrQcmAiYANQAAAQcA3wEiAWQAKEAQAj8jAe8j/yMCXyOPIwIjArj/a7RIKwIBJrkCIQApACsBK11dcTX//wA8AAACxgXCAiYAVQAAAQYA3xQAAB23AT8STxICEga4/5a0SCsBARW5AiIAKQArAStdNQD//wBc/+cE6wcsAiYANgAAAQcAjQEOAWoAIUATAX80jzQCTzRfNAI0FgBIKwEBNLkCIQApACsBK11dNQD//wA//+gDsQXCAiYAVgAAAQcAjQCsAAAAJUAWAc803zQCLzRfNAJPNAE0FQBIKwEBNLkCIgApACsBK11dXTUAAAIAMP29BLoFugAHABIAyrMNEggOugExAA0BSUANCQtlChIIZQkJAAoBCrgCuUAUBxJRCAgJZQotBwUCHgQDAgcACBS4AnO1BgUgBAEEuAEBtwYgAQIvAwEDuAEBtAEHIAEAuP/oQAsQEAJVAAgPDwJVALj/8rQMDAJVALj/4rQNDQJVALj//LQMDAZVALj//rcNDQZVIAABALgCc7MTtpkYKxD2XSsrKysrKzztEPRdPBD99F08EOYAPzw/PP08ARD0/TwQ5AAQ9l08EP08EO0Q/e0BERI5MTAhESE1IRUhEQM1MxUUByc2NzY3AhP+HQSK/hvKzacyPB4UBAUNra368/66zc20SUwbMyFCAAIAJP3sAioFmQAXACEBBEAVISEvIzEhAwABDQwKHiEYAQMACRYeuAFJQAwZG0AaGEAZGQAaARq4ArZALwMhkRgbGhgZQBoaAQcQCSsPCgYWHAMLDxAjSRAiACKfAQEBDRIlDAH/BwhFCUUHuP/qtBAQAlUHuP/wtA8PAlUHuP/qtA4OAlUHuP/0tAwNAlUHuP/8tAsLAlUHuP/4tBAQBlUHuP/sQBgPDwZVBwIMDAZVBw0NDQZVAAcgB5AHAwe6AjAAIgE2scQYKxD0XSsrKysrKysrK/TkEO08/TwQXeTk5hA8AD/tPzz9PAEREjkv/TwQPBDkABD2XTwQ7RDtEO0REjkSOQEREjkAETMzEMkxMAFdJRcGIyImJjURIzUzETcRMxUjERQWFjMyAzUzFRQGByc2NwIQGkw8YmwshISztbUTKygezLlJTixfB6GfED5logJjjAEHbP6NjP2TTSwa/jW4uEZ7IkUqdP//ADAAAAS6ByYCJgA3AAABBwDfAQ8BZAA1swEBAQu5AiEAKQArAbEGAkNUWLUADAsBBkErG0AMCEAlJzQIQA0RNAgGuP+tsUgrKysrWTUAAAIAI//yAv0FugAKACIA8EAqbwVsB38HjgcEYAFgBmAHcAFwBHIHgAGABAgAFxgVBgoACw0bDA4LFCEHuAItQCQBB7cGAEACAgEABzMBCpEAQAFAAhokGxQrGhUGIRwOCxoMIhu4AjC2GB0lFxRFErj/8rQQEAJVErj/9rQODwJVErj//LQMDAJVErj/7LQQEAZVErj/6LQPDwZVErj/9rQNDQZVErj/9EAKDAwGVQASARIZI7gBNrFmGCtOEPRdKysrKysrK03kPP089OQ8AD/tPzz9PAFOEPZN7f3kEOQAPzwQ7RDtEOQREjkSOQEREjkREjkAETMzyTEwAV0AXQE1MxUUBgcnNjY3AxcGIyImJjURIzUzETcRMxUjERQWFjMyAkW4SE4tMzECkRpMPGJsLISEs7W1EysoHgUBubllfSJEF1dS+6CfED5logJjjAEHbP6NjP2TTSwa//8Aof/nBSIHKwImADgAAAEHANsBigE+ADtADwIBGIA6PDSvGL8Y/xgDGLgDFwB9P3IrGDU1AbEGAkNUWLcCAQAVGwwAQSs1NRu3AQICHgYAaCcrWQD//wCD/+gD4AXtAiYAWAAAAQcA2wDcAAAAGUAMAgEAGR8REUEBAgIiuQIiACkAKwErNTUA//8Aof/nBSIHLAImADgAAAEHAN0BlwFqADO1AgEBAgIcuQIhACkAKwGxBgJDVFi4/+m0FRwMAEErG0ALwBkBYBkBGRFVSCsrXV1ZNTUA//8Ag//oA+AFwgImAFgAAAEHAN0AtAAAADG1AgEBAgIguQIiACkAKwGxBgJDVFi1ABwgCxZBKxu5AB3/wLcSFDQdEWRIKysrWTU0AP//ACkAAASwBywCJgA9AAABBwCNAPsBagAoQBABzxDfEAKvEAEQQAsPNBACuP9ZtEgrAQEQuQIhACkAKwErK11dNf//ACgAAAPUBcICJgBdAAABBwCNAKkAAAAetQFPEgESB7j+abRIKwEBEroCIgApAWSFACsBK101//8AKQAABLAG9AImAD0AAAEHANoBMAFqABu1Ac8NAQ0CuP8RtEgrAQENuQIhACkAKwErXTUA//8AKAAAA9QFigImAF0AAAEHANoAqQAAAC5AEwEPQAsLBlUfDy8PAu8P/w8CDwS4/6G0SCsBAQ+6AiIAKQFkhQArAStdcSs1AAEApAAABDgFugAFAINAHAIDHgEAAgUIEAEgAQIBGgcDBCAFBQAkEBACVQC4//K0Dw8CVQC4/+q0DQ0CVQC4//q0DAwCVQC4//20EBAGVQC4//O0Dw8GVQC4/+q0DQ0GVQC4//S3DAwGVQAZBju5AY4AGCtOEPQrKysrKysrKzxNEP08ThDmXQA/PzxN/TwxMBMhFSERI6QDlP0uwgW6rfrzAAMAYP/nBdoF1AAMABgAHAEoQGlsCG0KbA9qEWMVYxcGEA4QEh8UHxhjAmMEBmoOYxJkFGsYmAKWBAYfFRAXbQFiBWMHagtvDAcQAh8EHwgSChAPHxEgHgc6CBseTxlfGX8ZjxkE7xkBGRkJFh4DAxAeCQkcZRMZZQ0TJga4/+i0EBACVQa4/+60DQ0CVQa4//C0DAwCVQa4//m0CwsGVQa4//S0DQ0GVQa4//pAJgwMBlUgBoAGAoAeAQYaHg0mAAYLCwZVAAYMDAZVIAABABkdY1wYKxD2XSsr7RD2XV0rKysrKyvtEOYQ5gA/7T/tEjkvcV3tMTBDeUAsARgLJREIEyEBDwoNIQAVBBMhARcCDSEAEgcQIQAODBAhABQFFiEBGAEWIQErKysrASsrKysrgQFdXV0AXV0TEAAhIAAREAAhIiQCNxQAMzIAERAAIyIAEzUhFWABigE0ATUBh/52/s3d/rOTyAEQ5OABFv7o29f+4NMCRALKAW4BnP5d/qr+rP5g3QFbqPv+wQE7ARQBGAE5/tr+gKysAAADAFX/ywYNBeYAEgAZACABVEBgICI6AzoHNQw1EDUUNBg8GzofRANEB0kRYCJwIoQVih6fIqAivyLwIhQAIjgDAikVJhcmHCgeOAZoBGkVZRdlHGkedgR5BnkNdhCIBIgUhReFHIgeEzkDASATCAsaGR4LuAE6QCYKEx4ScAKAAgICogADCgkaCRMKAZAJAUAJUAlgCXAJgAkFCSAACrj//EANDAwGVX8KAQoKDh0mBbj/9EA6DxAGVQUqDQ0GVQUaCwwGVQAFYAUCIAVgBXAFnwWgBb8F8AUHBRoiACIQIkAiAxAiMCJAIrAiwCIFIrj/wEAMEBI0FiYOEhAQAlUOuP/qQAsNDQJVDggPEAZVDrj/1rQNDQZVDrj/6EANCwwGVSAOAQ4ZIWNcGCsQ9l0rKysrK+0rXXEQ9l1xKysr7RI5L3ErPP1xcjwQPBA8AD8/9F087RD0/TwQPBA8MTAAcV0BcV0BMxUEABUQAAUVIzUkADU0EiQ3FQYGFRQWFzM2NjU0JiMC0MIBNAFH/p7+58L+3/6mlgES087j+LnCzeje1wXmtRP+vu/+9P7KCtbWCwE/+aMBCJgKqAbWyMrSAwbawrjpAAACAEj/6ARTBD4AFAAgARRAUAYJBhIQIjcCRwJWAlYEdgl1EoYJCggHAUkXRhlGHUkfWxdUGVQdWx9oCWgLZw95CfccDRgTASUdKh81HTofBG8IYBMCEwgDHgQQBgAGBgobuAKasgoLFbgCmrUQBwgTAAO4//a0EBECVQO4//C0EBEGVQO4//C3DQ0GVQNrQB64/+i0DRECVR64/+y0CwsCVR64/+5ARw0NBlWQHgEfHvAeAh5CBYAArQEBBq0FNyIYQA0IDg8CVQ0cDA0CVQ0MEBAGVQ0SDQ0GVQ0lDAwGVQ0XCwsGVT8NTw0CDTQhEPZdKysrKysr7RD27TwQ7RoQ/XFdKysrGu0rKysRMzMAP+0/7T8/ERIXOV0xMABxcl0BcV0BMwYDEhcjJicGISICERASMzIWFzYlIgYVFBYzMjY1NCYDm7hGO0Y7sysWU/74yPT1yn2eRAf+uIGWjn98ppsEJtz+yf5+kWRe2gEsAQEBCAEhZWcjFNDEv9rXysTIAAIASP/oBCwFugATAB8BhkCBOxIBWApaDFUPaApoDHgfBkUZShtKH1UGWgkFJxUoHzcVOB9FFQXGAwEzFjkYORwzHlscjhOHH5kDqBK4EtYV2hncHNYf5wznFvcM9xYSawZvCmMMYBBjFm8YbxxgHn4TCV8GXwpQDFAQUBZfGFocUB4IBgMVAysRawxqEAUTAgAduAKatQURBxECF7gCmrILCwK4AppAMwAAewOLAwIDAQAwEUARAlsRaxF/EY8RBAURCA5AAAEAAA4BARpAIUANDQJVIUALCwJVCLj/6kARDw8CVQgYDQ0CVQgQCwsCVQi4//C0Dw8GVQi4//G0Cw0GVQi4/8BASiQlNDAIAQAIEAggCAMIMSEUQA4MDg8CVQ4SDQ0CVQ4MDAwCVQ4cCwsCVQ4MEBAGVQ4NDQ0GVQ4WDAwGVQ4NCwsGVR8OPw4CDjEgEPZdKysrKysrKyvtEPZdXSsrKysrKysr7TMvETMvXRESOTldchESOV0AP+0/7REzPzPtERI5MTABcV1dXXIAXV1dcRMhFSEWFxYWFRAAIyICNRAANyYnExQWMzI2NTQmIyIGrgMh/dBk1b6W/ung9fgBBrZd+VKzi3q7soeVpQW6kmaThOLB/v3+4wFA3AEAAQ0HQd/8yqrcvMu8zugAAAEAYv/oA2MEPgAkAOhANx8mXyZ9An0ViQGLAoMIhA+LFYkWsgSyD8MEwg8OgCYBJiE5GjYidQd5ELQFtiHEBcYhCR4MFxa4/8BADgkMNBYWFAA/AQEBAQMLuAKaQAlwDL8MAgwMGQO4ApqyIwcUuAKaQCsZCx4GHAwMFxwBABYXBkAgQBoiNCAgHBAAAQAAABcgF2AXgBcEF6omEUAcuP/4QBgPDwZVHBAMDAZVHBYLCwZVHxxPHAIcNCUQ9l0rKyvtEPZdMi9xETMvK+0RMxEzERI5LxESOQA/7T/tEjkvce0RMy9dMxEzLyszETkxMABdAXFdAQcmIyIGFRQWMzI3FSYjIgYVFBYzMjcXBiMiJjU0NyY1NDYzMgM9gXtrWFF4dA8jIBCPb3BNjXuBoO67uLCTrrTOA65oXV42Rl0BlwFuRUdhg22qvn61TFOSd70AAgBE/+gEwwQ+AA8AGwEkQD02ETYVORc5G0URRRVJF0kbUwJYBVQIUhFUFV4XZQJqBWQIZBFkFW0XFA8CAgoEFhwHCwEcDwYQHA0HGSQEuP/qtA4OAlUEuP/qtAoMAlUEuP/vtBAQBlUEuP/gtA8PBlUEuP/VtA0NBlUEuP/xtAwMBlUEuP/kQCELCwZVUARgBHAEgAQEEAQwBEAEUARgBHAEgASQBLAECQS4Ac9AMgo/AAEPAI8AAgCqHRMkCkAkJTQKDA4PAlUKEg0NAlUKDAwMAlUKHAsLAlUKDBAQBlUKuP//QB4PDwZVCgwNDQZVCh4MDAZVCgoLCwZVHwo/CgIKMRwQ9l0rKysrKysrKysr7RDmcV0Q/V1xKysrKysrK+0AP+0/7T/tARESOREzMTABXQEVIRYREAAjIgAREAAzMhcHIgYVFBYzMjY1NCYEw/7fhf7d0Nj+6AEjzUtfrYOxrYqRq50EJpJ8/vr+4/7zARgBEwEbARAYfczLyszVwrHlAAEALgAAAvoEJgAHAL1AHRAJUAlgCXAJgAmfCdAJB08JAQIKBwQcBQZ/BwEHuAEPtAFwBAEEuAEPsgElArj/4LQQEAJVArj/9LQNDQJVArj//rQMDAJVArj/5LQLCwJVArj/7EALCgoCVQIIEBAGVQK4//i0DQ0GVQK4//ZALQwMBlUQAiACcAKAAtAC4ALwAgdAAqACsAIDAAJwAoAC0ALgAvACBgkAAgFKAi9eXV5ycV0rKysrKysrK+3kXRDkXQA//Tw/MTABcV0BESMRITUhFQH6tP7oAswDlPxsA5SSkgACAEj+aQTpBD8AGwAlAR5AREAnASMFIxcoGDgdSB1zDHoXigmMF7QF9wILUg1mBGcFYg1nG5gXqBfHDcoSyhfKGAscMwYcExYLFQEcACIcCwcABwEAuP/AQBUJDjQAABkcFAZPFQEVJRQGEBACVRS4//S0Dw8CVRS4//xAGA8PBlUUBgwMBlUUQAsNNL8UARQUGR8kD7j/9rQPDwZVD7j/8bQNDQZVD7j/7rQMDAZVD7j/8kAcCwsGVUAPAQAPEA8gDzAPBA8xJwMkGRAQEAZVGbj//EAfDw8GVRkSDQ0GVRkXDAwGVRkOCwsGVT8ZARkxJjQ3GCsQ9l0rKysrK+0Q9l1xKysrK+0SOS9dKysrKyv9cTwQPBE5LyszAD8/7RDtLz88/eQxMABdAV1xAQcGERQWFxE0NjYzMhYWFRQGBgcRIxEiABE0AAE2NjU0JiMiBhUB8yPPo6Iea1yPs3xi3LOyuv68AQMBrX+1hEo1MQQ7nEX+25vzIwKUanNJdPqQePHKJv6CAX4BRgEA7QEl/E0X7sGzpEl8AAL/4f1nBIr+6wADAAcAQ7YCAT8DAAYAuAKfQBgFBwU/BAcGBgMDAhoJBAUFAAABxQhDQRgrEPU8EDwQPE4Q9jwQPBA8AC9N7TwQ5jwQPP08MTADNSEVATUhFR8EqftXBKn+aYKC/v6Bgf//ALAAAANPBboAJgAEAAABBwAEAcAAAAANswIBDgS4AcCxSCcBKwAAAQBSAgcCmwSuABQAWkAaNQREBGUEYhF3BHARBhINFAMDEBQBAicGDBS4AVlAGAYcEAcNJQqCFAI/ARQlATAAAQAZFXGMGCtOEPRdPE3tEO0Q9O0AP+30PBD0PBESOS8BERI5MTAAXRMRMxU2NjMyFhYVESMRNCYjIgYVEVKCKWdAU3IyjUFEUVkCBwKZRSkqP2Vt/moBkVhFXGj+lgADADP/5giTBboANgBBAF8BakBrUwRSHGYbZRyFDopXiVmIW5panFsKBhwKIwUvFhwZIxUvIxssIzQaRRlCGko7Sj9RA1UEZANsE2QvZTBiUHYEexN5U3tXeluFBI8OjxONFoUfiTuAUIxejV+pDbgNxA3KI8QlJxoMUVghFCS4Are1RxwoTjpNuAETQBMoFBwMCDoHOB40NDU3HgAAEToQuAETsgwHX7gCtEA5LisKBQY1CkccKAtRHCELPTwFLmoFagcl5V1OJxdeXT1NJMVKOE1qRDoIJSwHIBAQAlUHCA0NAlUHuP/4QDMMDAJVBwdgYRA4HhE4VV4eGmE3Nbo2NgAcEBACVQAqDw8CVQAmDQ0CVQAqCwwCVQAZYGG4Ae+zIZtoGCsrTvQrKysrPE0Q/TxOEPZN/eQQ5BESOS8rKys8/eT29OUQ9v3kEOUQ5uYQ7QA/7T/tPz88/eY//eQ/7RE5L+0v5BDtEP3kEP3lERI5ERI5MTABXQBdEyEyFxYXMxEXESE2MzIXFhcnJiYjIgYVFBcWBBYWFRQGIyImJwcGBiMiJyY1ESMGBgcGIyMRIxMRMzI2NjU0JiYjAREHFBYzMjY3JiYnFxYWMzI3NjU0JyYkJyYmNTQ3MwHO6nteDVy2AUBVXL12XwS7BmhmZmU5OAE9i0rrxH2eRQEcLxKTQSVmH5ByT8OfwsKEoJpYSH2EAyEBLiwMGg4XEgG2CIFsaUw5Iy7+rzhWUSAFuoFjrgE2Af7LHGZSkQFTV1AuNyQkTFGIS4XOSlODCAhOLGYCx3SWIRb9qgUP/fAyelxTeTz+iP1xHyYsBQUvTDYBY289LjwuICpbHS54Tk0/AAABAE8AnQewA2wAEAAAATMGBgchFSEWFyMmJic1NjYB7Ew7O00GO/nFaF5OgbpjV8IDbHZfYGVsyZCVMC0lmAAAAQCZ/lMDaAU7ABAAABM2NjczFhYXFSYnESMRBgYHmZGXJS4vlZDJbGVgX3YDnoXCVmO6gU1eZ/o+BcJMPDsAAAEATwCdB7ADbAAQAAABFhYXFQYGByM2NyE1ISYmJwYThcJWY7qBTV5n+cUGO0w8OwNskZclLTCVkMlsZWFedgABAJn+UwNoBTsAEAAAFzUWFhcRMxE2NxUGBgcjJiaZd15gZWzJkJUvLiWXEEw7PEwFwvo+Z15NgbpjVsIAAAEATwCeB7ADbgAbAAABFQYGByM2NyEWFyMmJic1NjY3MwYHISYnMxYWB7BetoJQRX36531FUIK2Xl62glBFfQUZfUVQgrYCHC0rkpSsi4uslJIrLSyRlayLi6yVkQABAJj+VQNnBbcAGwAAATMWFhcVJicRNjcVBgYHIyYmJzUWFxEGBzU2NgHpLSyRlKuMjKuUkSwtK5KUq4yMq5SSBbdet4JQRX765n5ET4K3Xl63gk9EfgUafkVQgrcAAgCY/ZQDZwW3ABsAHwAAATMWFhcVJicRNjcVBgYHIyYmJzUWFxEGBzU2NgEhFSEB6S0skZSrjIyrlJEsLSuSlKuMjKuUkv7cAs39MwW3XreCUEV++uZ+RE+Ct15et4JPRH4FGn5FUIK3+J1iAAABAWoAAAZrBP8ABQAAATMRIRUhAWpkBJ36/wT/+2VkAAEAngAABSMF1AAhAISyRggauAK7QBoJAxESAQAIExIgEREQGiMAIQEhIAIZIp55GCtOEPRN7TwQPE4Q9jxNEP08AD88PDw/7TEwQ3lAOBYeAw8dHhweAgYEAwUDBgMHAwQGDg8NDwwPCw8EBhcWGBYCBhsIH1gAGQoVWAEeAxpYARYPGlgBKysBKysqKioqgYEhIxEQNz4DMzIeAhcWFREjETQnLgMjIg4CBwYVASWHBwxEldt8d9egRQsEhgYKNW+tXFy0cy4HAwJtAQVFfaKcYl2gtIc0+/2TAnTjP3KHdkxQg5xoNtAAAAMAcgDCBDoE5AADAAcACwBqQDwLCiUIPwkBkAnACQIJvwYDAgABJTACAZ8CzwICAr8FBwYlBAUICwsEBwcDABoNCQoKBQUGBgIBGQxXWhgrThD0PDwQPBA8EDwQ9jw8EDw8EDwALzxN/TwQ/V1x/TwQPBD9XXE8/TwxMAEhNSERITUhESE1IQQ6/DgDyPw4A8j8OAPIBD2n/Zuo/ZuoAAACAJ0AAAQ4BIEABAAJAAAzEQEBESUhEQEBnQHNAc78tgL5/oP+hAJ6Agf9+f2GUQIHAav+VQABAHEBqAQ5BAYABQAttAMlAgIBuAG5QA4AAhoHBAUlAQAZBldaGCtOEPQ8Tf08ThDmAC9N/jwQ7TEwExEhFSERcQPI/OIBqAJeqP5KAAABAiL9/QPQBskAFgAAASMRNDYzMhYVFAYjIicmJiMiBwYHBhUCs5GzcUNHMyUeGxIvFxEOCgQH/f0HE9veQSwoNA8KSQwIEyFqAAEBBf39ArMGyQAWAAABMxEUBiMiJjU0NjMyFxYWMzI3Njc2NQIikbNxQ0czJB8cEi4XEQ4KBAcGyfjt295BLCg0EApIDAcVIGoAAf/pAhYFwQLFAAMAAAEhNSEFwfooBdgCFq8AAAEByf2TAngHSAADAAABETMRAcmv/ZMJtfZLAAABAn79kwXCAsUABQAAARUhESMRBcL9a68Cxa/7fQUyAAH/6f2TAywCxQAFAAABITUhESMCff1sA0OvAhav+s4AAQJ+AhYFwgdIAAUAAAERMxEhFQJ+rwKVAhYFMvt9rwAB/+kCFgMsB0gABQAAASE1IREzAyz8vQKUrwIWrwSDAAECfv2TBcIHSAAHAAABETMRIRUhEQJ+rwKV/Wv9kwm1+32v+30AAf/p/ZMDLAdIAAcAAAERITUhETMRAn39bAKUr/2TBIOvBIP2SwAB/+n9kwXBAsUABwAAASE1IRUhESMCff1sBdj9a68CFq+v+30AAAH/6QIWBcEHSAAHAAABITUhETMRIQXB+igClK8ClQIWrwSD+30AAf/p/ZMFwQdIAAsAAAEhNSERMxEhFSERIwJ9/WwClK8Clf1rrwIWrwSD+32v+30AAv/pAVgFwQODAAMABwAAASE1IREhNSEFwfooBdj6KAXYAtSv/dWvAAIBwP2TA+sHSAADAAcAAAERMxEhETMRAzyv/dWv/ZMJtfZLCbX2SwABAn79kwXCA4MACQAAAREhFSEVIRUhEQJ+A0T9awKV/Wv9kwXwr82v/DsAAAEBwP2TBcICxQAJAAABESEVIREjESMRAcAEAv4pr839kwUyr/t9BHT7jAAAAgHA/ZMFwQODAAUACwAAASMRIRUhAREjESEVAm+vBAH8rgF8rwKF/ZMF8K/+hPw7BHSvAAH/6f2TAywDgwAJAAABITUhNSE1IREjAn39bAKU/WwDQ68BWK/Nr/oQAAH/6f2TA+oCxQAJAAABEyE1IREjESMRAb8B/ikEAa/N/ZMEg6/6zgSD+30AAv/p/ZMD6gODAAUACwAAAREhNSERASE1IREjAzv8rgQB/dX+KgKFr/2TBUGv+hADxa/7jAAAAQJ+AVgFwgdIAAkAAAERMxEhFSEVIRUCfq8Clf1rApUBWAXw/Duvza8AAQHAAhYFwgdIAAkAAAEhETMRMxEzESEFwvv+r82vAdcCFgUy+30Eg/t9AAACAcABWAXBB0gABQALAAABESEVIREBIRUhETMCbwNS+/8CKwHW/XuvB0j6v68F8Pw7rwR0AAAB/+kBWAMsB0gACQAAASE1ITUhNSERMwMs/L0ClP1sApSvAVivza8DxQAB/+kCFgPqB0gACQAAASE1IREzETMRMwPq+/8B1q/NrwIWrwSD+30EgwAC/+kBWAPqB0gABQALAAABMxEhNSEBETMRITUDO6/7/wNS/oSv/XsHSPoQrwF8A8X7jK8AAQJ+/ZMFwgdIAAsAAAERMxEhFSEVIRUhEQJ+rwKV/WsClf1r/ZMJtfw7r82v/DsAAgHA/ZMFwgdIAAcACwAAAREzESEVIREhETMRAzyvAdf+Kf3Vr/2TCbX7fa/7fQm19ksAAAMBwP2TBcIHSAADAAkADwAAAREzERMRMxEhFQERIRUhEQHAr82vAdf9egKG/in9kwm19ksFQQR0/Duv+r8EdK/8OwAAAf/p/ZMDLAdIAAsAAAEhNSEnITUhETMRIwJ9/WwClQH9bAKUr68BWK/NrwPF9ksAAv/p/ZMD6gdIAAcACwAAARMhNSERMxEzETMRAb8B/ikB1q/Nr/2TBIOvBIP2Swm19ksAAAP/6f2TA+oHSAADAAkADwAAAREzEQERITUhEREhNSERIwM7r/6E/XsB1v4qAoWv/ZMJtfZLCbX7jK8DxfoQr/uMAAL/6f2TBcEDgwADAAsAAAEhNSEBITUhFSERIwXB+igF2Py8/WwF2P1rrwLUr/3Vr6/8OwAB/+n9kwXBAsUACwAAARMhNSEVIREjESMRAb8B/ikF2P4pr839kwSDr6/7fQR0+4wAAAP/6f2TBcEDgwADAAkADwAAASE1IQEhNSERIyERIRUhEQXB+igF2Pv+/ioCha8BfAKG/ikC1K/91a/7jAR0r/w7AAL/6QFYBcEHSAAHAAsAAAEhNSERMxEhESE1IQXB+igClK8ClfooBdgC1K8Dxfw7/dWvAAAB/+kCFgXBB0gACwAAASE1IREzETMRMxEhBcH6KAHWr82vAdcCFq8Eg/t9BIP7fQAD/+kBWAXBB0gABQALAA8AAAEhNSERMwEhETMRIREhNSECbv17AdavA1P9eq8B1/ooBdgC1K8DxfuMBHT8O/3VrwAB/+n9kwXBB0gAEwAAASE1ITUhNSERMxEhFSEVIRUhESMCff1sApT9bAKUrwKV/WsClf1rrwFYr82vA8X8O6/Nr/w7AAH/6f2TBcEHSAATAAABEyE1IREzETMRMxEhFSERIxEjEQG/Af4pAdavza8B1/4pr839kwSDrwSD+30Eg/t9r/t9BIP7fQAE/+n9kwXBB0gABQALABEAFwAAASEVIREzAREzESE1ASE1IREjAREjESEVA+sB1v17r/3Ur/17Adb+KgKFrwIsrwKFA4OvBHT8OwPF+4yv/dWv+4wDxfw7BHSvAAH/6QJtBcEHSAADAAABIREhBcH6KAXYAm0E2wAB/+n9kwXBAm0AAwAAASERIQXB+igF2P2TBNoAAf/p/ZMFwQdIAAMAAAMRIREXBdj9kwm19ksAAAH/6f2TAtUHSAADAAADESERFwLs/ZMJtfZLAAABAtb9kwXCB0gAAwAAAREhEQLWAuz9kwm19ksAHgBm/ggFwQdIAAMABwALAA8AEwAXABsAHwAjACcAKwAvADMANwA7AD8AQwBHAEsATwBTAFcAWwBfAGMAZwBrAG8AcwB3AAATMxUjJTMVIyUzFSMFMxUjJTMVIyUzFSMHMxUjJTMVIyUzFSMFMxUjJTMVIyUzFSMHMxUjJTMVIyUzFSMXMxUjJTMVIyUzFSMHMxUjJTMVIyUzFSMFMxUjJTMVIyUzFSMHMxUjJTMVIyUzFSMXMxUjJTMVIyUzFSNmfX0B8n19AfN9ff0UfX0B83x8AfJ9ffl9ff4NfX3+Dn19BN59ff4OfHz+DX19+X19AfJ9fQHzfX35fX3+Dnx8/g19ffl9fQHyfX0B8319/RR9fQHzfHwB8n19+X19/g19ff4OfX35fX0B83x8AfJ9fQdIfX19fX18fX19fX18fX19fX19fHx8fHx9fX19fX18fX19fX18fX19fX19fHx8fHx9fX19fX18fX19fX0AP//q/ggFwQdIAAMABwALAA8AEwAXABsAHwAjACcAKwAvADMANwA7AD8AQwBHAEsATwBTAFcAWwBfAGMAawBvAHMAdwB7AH8AgwCHAIsAjwCTAJcAmwCfAKMApwCrAK8AswC3ALsAvwDDAMcAywDPANMA1wDbAN8A4wDnAOsA7wDzAPcA+wD/AAATMxUjNzMVIzczFSM3MxUjNzMVIzczFSMFMxUjNzMVIzczFSM3MxUjNzMVIzczFSM1MxUjNTMVIwUzFSM3MxUjNzMVIzczFSM3MxUjNzMVIwUzFSM3MxUjNzMVIzczFSM3MxUjNzMVIzUzFSM1MxUjBTMVIzczFSM3MxUjNzMVIzczFSM3MxUjBTMVIyUzFSM3MxUjNzMVIzczFSMlMxUjBTMVIyczFSMnMxUjJzMVIyczFSMnMxUjBzMVIzczFSM3MxUjNzMVIzczFSM3MxUjFzMVIyczFSMnMxUjJzMVIyczFSMnMxUjBzMVIzczFSM3MxUjNzMVIzczFSM3MxUjZ3x8+Xx8+X19+X19+nx8+Xx8+qV9ffl9ffl9ffp8fPl9ffl9fX19fX37n3x8+Xx8+X19+X19+nx8+Xx8+qV9ffl9ffl9ffp8fPl9ffl9fX19fX37n3x8+Xx8+X19+X19+nx8+Xx8+qV9fQHyfX36fHz5fX35fX38G319BGJ8fPl8fPp9ffl9ffl8fPl8fH19ffl9ffl9ffp8fPl9ffl9fX18fPl8fPp9ffl9ffl8fPl8fH19ffl9ffl9ffp8fPl9ffl9fQdIfX19fX19fX19fX18fX19fX19fX19fX19fX19fH19fX19fX19fX19fXx8fHx8fHx8fHx8fHx8fH19fX19fX19fX19fXx9fX19fX19fX19fXx9fX19fX19fX19fX18fHx8fHx8fHx8fH19fX19fX19fX19fXx9fX19fX19fX19fQAALv///YwF1gdIAD0AQQBFAEkATQBRAFUAWQBdAGEAZQBpAG0AcQB1AHkAfQCBAIUAiQCNAJEAlQCZAJ0AoQClAKkArQCxALUAuQC9AMEAxQDJAM0A0QDVANkA3QDhAOUA6QDtAPEAAAERIxUzESMVMxEjFTMRIxUzFSERMzUjETM1IxEzNSMRMzUjETM1MxUzNTMVMzUzFTM1MxUzNTMVMzUzFSMVJRUzNTMVMzUzFTM1MxUzNTMVMzUXIxUzJyMVMycjFTMnIxUzJyMVMwcVMzUzFTM1MxUzNTMVMzUzFTM1BSMVMzcVMzUzFTM1MxUzNTMVMzUFFTM1IRUzNQc1IxUlFTM1MxUzNRM1IxUjNSMVIzUjFSM1IxUjNSMVBxUzNTMVMzUzFTM1MxUzNTMVMzUTNSMVIzUjFSM1IxUjNSMVIzUjFQcVMzUzFTM1MxUzNTMVMzUzFTM1BdZ8fHx8fHx8fPopfX19fX19fX19fH18fX18fX18fXx8+yJ8fXx9fXx9fXx9fX35fX36fHz5fX35fX35fH18fX18fX18/Jh9fXx9fXx9fXx9+yJ8AXZ9+nwB8n19fH19fH19fH19fH18fH18fX18fX18fX18fX18fX18fXx8fXx9fXx9fXwF0v6KfP6Kff6KfP6KfXwBdX0Bdn0BdX0Bdn0BdX19fX19fX19fX19+X19fX19fX19fX19ffl9fX19fX19fX19fHx8fHx8fHx8fPl9fX19fX19fX19+X19fX19fX19fX19ff6KfX19fX19fX19fX18fHx8fHx8fHx8/op9fX19fX19fX19fH19fX19fX19fX0AAQCSAAAEQgOwAAMAABMhESGSA7D8UAOw/FAAAAEAAAE9B/8CvwADAAARIREhB//4AQK//n4AAQEwAAAGvAWLAAIAACEBAQEwAsYCxgWL+nUAAAEBIP/hBssFiQACAAAJAgEgBav6VQWJ/Sz9LAABATD/4Qa8BWwAAgAACQIGvP06/ToFbPp1BYsAAQEg/+EGywWJAAIAAAERAQbL+lUFifpYAtQAAAIAsgCJBCMD+gANABsAAAEyFhYVFAAjIgA1NDY2FyIGBhUUFjMyNjU0JiYCam/Udv7+trf+/nbUb12uYtaXl9VirgP6ctRyt/7+AQK3c9NyTF6wXpfW1pdesF4AAgCAAAAEVAPUAAMADwAAMxEhEQEiBhUUFjMyNjU0JoAD1P4WVHZ3U1R2dgPU/CwCtHZUU3d3U1R2AAMAKgAABK0EgwADABEAHwAAMxEhEQEiBgYVFAAzMgA1NCYmBzIWFhUUBiMiJjU0NjYqBIP9v3DTdgECt7YBAnbTb1uvYtWXmNVirwSD+30D+nLUc7b+/gECtnPUckxer2CX1dWXYK9eAAAFAZj/iQaTBIQACwAXACMALwA7AAABEAAhIAAREAAhIAADNAAjIgAVFAAzMgABFAYjIiY1NDYzMhYFFAYjIiY1NDYzMhYBNxYzMjcXBgYjIiYGk/6L/vj++P6KAXYBCAEIAXVc/sHi4v7BAT/i4gE//TsvIiEwMCEiLwHpLyIhMDAhIi/9lT5PmZlOPzKTYWKSAgb++P6LAXUBCAEJAXX+i/734gE//sHi4f7BAT8BZSEwMCEiLy8iITAwISIvL/6NJJCQJF9kZAAABAG4/4kGswSEAAsAFwAjAC8AAAEQACEgABEQACEgAAU0JiMiBhUUFjMyNiU0JiMiBhUUFjMyNgEWFjMyNjcnBiMiJwaz/ov++P74/ooBdgEIAQgBdfzfLyIhMDAhIi8B6S8iITAwISIv/ZUykmJhkzI/TpmZTwIG/vj+iwF1AQgBCQF1/ouFIi8vIiEwMCEiLy8iITAw/tBfZGRfJJCQAAIAEP8hB0YGVQAvADsAAAEzERYWFwEXARYXFhchFSEGBwEHAQYGBxEjESYmJwEnASYmJyE1ITY2NwE3ATY2NwE0ACMiABUUADMyAAOGTGafWAEiNP7iSR4mAgFQ/rETfAEdOf7lYpJrTHCZUP7aMwEdQkQL/rABUAlCRf7kMAEkZZ1cAiT+09TU/tQBLNTUAS0GVf6vBz9HARw1/uJfSmBdRb2e/t0yARpIOQz+rwFRDz49/uozAR5UpGpFap9UAR85/uZGPQj9t9QBLP7U1NT+0wEtAAACAPT+SQULBeMAGQAnAAABESEVIREjESE1IREiJiY1NDY2MzIWFhUUAAMiBgYVFAAzMgA1NCYmAxwBy/41O/40Acxn9ZGL+ImI+Yr+4e124X4BE8LDARN+4QHN/m47/kkBtzsBkoP7jIj6iov5iNH+0QPUeeJ6w/7tARPDeuJ5AAIAb/76BYcGVAAYACYAAAEXEwcDARYWFRQGBiMiJiY1NAAzMhcBAScTIgYGFRQAMzIANTQmJgTAJKM5jv6alJiK+YmI+YoBM9tOWAFo/ecYIHbhfgETwsMBE37hBlQQ/WYPAkX9AEv+kYj5i4v5iNkBMhsDA/73Nf22eeJ6w/7tARPDeuJ5AAABADoAAAQGBM8AIgAAARYWBBYVFAYjIiYnHgIXFyE3MjYnBgYjIiY1NDc2Njc2NgIhGmwBFUqAXE5/MQFLpYkH/OcIuMsELYVUWoEhLcowSUMEz2yq+4ZFYIBhXZOtYwklJdfVX1+CW0k7UqY2U4IAAQA3AAAFCATPADMAACEhNzY3NjY1NCcGBiMiJjU0NjMyFyYmNTQ2MzIWFRQHNjc2MzIWFRQGIyImJyYnFhYXFhcESvywCKU2UWcBPa9bdKKUXjxnKhmednahRVQRGyJkk6FxP4UxIzQEWVw+oSIjIjPIbxAefHKidnSfM0ZHKXKenm1ZYigFCJ10eKM9MyVYn7k9KR8AAQA//+gEgQTPABwAAAUmJicmJyYmNTQ2MzIXFhc2NzYzMhYVFAYHBgcGAmIfc6V5HC4plG1uUT0mITxTbWyWWH6kSzsYds/aoCtGdTxvlk46c3E7UJVnWsOez4VpAAEAQP/oA9YEzwARAAABFhcWFwYHBgcmJyYnJic2NzYCCVmCllxKqIhSGy9ReBqdZZ92BM+XrchnTuC2kDRFeJ8jwXPVngABACX/2wPbBVMAHgAAATMyFxYXFhYVFSM1NCYnJiMjERQGBiMiJjU0NjMyFwHmJqw3TzwtNGM5OElZHECcXG1/mHtOYAVTDhQ5KplmZytEXxkg/L15h1F7ZGmPLgAAAQBV/4AFMgXvAB4AAAElERQGBiMiJjU0NjMyFhcRBREUBgYjIiY1NDYzMhcCFgMcP5dfbYKaeig9Rf2tQJxcbX+Ye05gBPf4+6x8flJ9Y2SRDh0C1Ln8vHmHUHtjaY8uAP//AL//5wV4BboAJgAsAAABBwAtAhcAAACeQA4BBB4PEAJVBBwNDQJVBLj/8LQLCwJVBLj/4LQJCgZVBLj//EARDAwGVQQSDQ0GVQQJDw8GVQS4/9pAFhAQBlVPBF8EnwS/BMAEBQQDlkgrAAC4//a0EBACVQC4//q0DA0CVQC4/++0EBAGVQC4//O0Dw8GVQC4//lADgsNBlVvAJAAAgAWv0grAStdKysrKys1K10rKysrKysrKzT//wCI/lEDGAW6ACYATAAAAQcATQHeAAAApEAPAwIcQAwMAlUcQAkKAlUTuP/4tAwNAlUTuP/AtAsLAlUTuP/8tBAQBlUTuP/6tA0NBlUTuP/OQBgLDAZVYBNwEwIfEzATbxOQE6AT4BMGEwe4ASy0SCsBAAS4//i0DA0CVQS4//y0EBAGVQS4//i0Dw8GVQS4//pAFAsNBlUABBAEIAR/BI8EBQQbiEgrAStdKysrKzU1K11xKysrKysrKzU1//8AbAAABNYFyQAnAFEA8AAAAQYAtgAAABJADgABACPwSCcBARgjAEgnKysAAQCAA7MBjgW6AAUAOkAjAyIaITQCIhohNAIDAAUEBAEF7gMCAAL5BIEvAQEBGQadaBgrThD0XU397QA/PO0BERIXOTEwKysTEzczBwOADDTONWkDswES9fX+7v//AIADswKpBboAJgGNAAABBwGNARsAAAAqAbEGAkNUWBu1AU8HAQcMuAF/QA9IKwBPAV8BkAEDAQxGSCsrXTUrXTRZAAQAYf/KBrUF0wAZAB0AKQA1AMdAKSEAIAEvDYAABCABIAKGE4YWgiyOL44ygjUIHB0dPxobFBoaGx0aOCczvAK+ACEBZQAtAr5AFicJHBsbCg8OHw4CDnYRAAAQAAIAoBe8Ar4ABAFlABECvkAKCgMc6BugHjAqJLgCvUARKioebgAd+RquAA4qDToAKgG4AVRACxQqPwcBBxk2cacYK04Q9F1N/fTt9O0ZEPQY7RD07f3tGRD0GO0AP+39/eRdEORdEDwQPD/t/e0Q9DyHBS4rfRDEMTABXQBdARcGBiMiJjU0NjMyFhcHJiYjIgYVFBYzMjYDATMBATQ2MzIWFRQGIyImNxQWMzI2NTQmIyIGAmx7FKd6mLm6mHqZFXoRWT9fd3NcSmPGAyKS/OEB0MCcmsK/nZvBgX1eXn19Xl59A+wQgJDHusDGenAUS0yIlJWIWvw9Bgn59wGpu8nJsMbJyLyOjo6Sio6OAAACAA//6AKGBdMAGgAmAH1AH08oARkaGgsLDAsKGRgbCxoAGQEEDBgBPBkZFQUT+RK4AnpAKA8pFQ0iKgUFExInCCkebCYmDAIMKQAYIBiQGKAYsBjAGAYYnyepehgrEPZd7TwQPBD2/fQ8AD/tP+397RESOS/tARESFzk5OQ4QPAgQPIcEfRDEMTABXRM3ETQ2MzIWFRQCBxEUFjMyNjcVBiMiJjU1BxM2NjU0JyYjIgcGFQ+xe29gfHilHRsaRGlvclxrT/hiLxoUHh8PFwGm6wHH4pmCbVz+9+b+YVkrIUqiV3J/4WICK6mANz0iGRoqsQAAAgCSAAAEQgOwAAMABwAAEyERIRMRIRGSA7D8UEwDGAOw/FADZPzoAxgAAQCDAb0CUgOMAAMAAAERIRECUv4xA4z+MQHPAAIAgwG9AlIDjAADAAcAAAERIREFIREhAlL+MQGD/skBNwOM/jEBz0z+yQAAAQCyAIkEIwP6AA0AAAEyFhYVFAAjIgA1NDY2Amtu1Hb+/ra3/v521AP6ctRyt/7+AQK3c9NyAAACAHABqgJmA6AACwAXAAABMhYVFAYjIiY1NDYXIgYVFBYzMjY1NCYBa2iTk2hok5JpSWZnSEhnZgOgk2hok5NoaJNMZ0hJZmZJSGf////9AAAFWQa+AiYAJAAAAQcA2AFKAV8AJkAXAgAPARAP0A8CIA8wDwIADxIMDEECAQ+5AiEAKQArAStdcXI1//8ASv/oBBwFXwImAEQAAAEHANgA9QAAABpADQJwOAEAODsCAkECATi5AsMAKQArAStdNf//AGb/5wV2ByYCJgAmAAABBwDWAbABZAAWQAoBACAjCA9BAQEguQIhACkAKwErNf//AFD/6APtBcICJgBGAAABBwDWAPoAAAAWQAoBAB0gBw5BAQEduQIiACkAKwErNf//AGb/5wV2BxoCJgAmAAABBwDaAbABkAAVQAkBHgtkSCsBAR65AiEAKQArASs1AP//AFD/6APtBYoCJgBGAAABBwDaAPAAAAApswEBARu5AiIAKQArAbEGAkNUWLUAGx4LC0ErG7dvGwEbEyhIKytdWTUA//8AogAABOgGyQImACgAAAEHANgBgQFqABZACgEADA8BAkEBAQy5AiEAKQArASs1//8AS//oBB4FXwImAEgAAAEHANgA4AAAABZACgIAHiEHD0ECAR65AsMAKQArASs1//8AogAABOgHIgImACgAAAEHANkBawFqACWzAQEBELkCIQApACsBsQYCQ1RYtQATDQECQSsbtBMFRkgrK1k1AP//AEv/6AQeBbgCJgBIAAABBwDZAPQAAAAVQAoCASUWAEgnAgEiuQIiACkAKwErAP//AKIAAAToBvQCJgAoAAABBwDaAYEBagAWQAoBAAwPAQJBAQEMuQIhACkAKwErNf//AEv/6AQeBYoCJgBIAAABBwDaAPoAAAAWQAoCAB4hBw9BAgEeuQIiACkAKwErNf//AG3/5wW5ByECJgAqAAABBwDWAg4BXwAlswEBASi5AiEAKQArAbEGAkNUWLUAKCsODkErG7QmDgBIKytZNQD//wBC/lED6gXCAiYASgAAAQcA1gDIAAAAFkAKAgAtMA8XQQIBLbkCIgApACsBKzX//wBt/+cFuQbpAiYAKgAAAQcA2gIOAV8AFkAKAQAmKQoCQQEBJrkCIQApACsBKzX//wBC/lED6gWKAiYASgAAAQcA2gDkAAAAFUAJAispLEgrAgEruQIiACkAKwErNQD//wBt/lsFuQXTAiYAKgAAAQcA3AIUAAAAE0AMAQAxLAoCQQEBJwgpACsBKzUAAAMAQv5RA+oGKAAJACQAMAFwQDAqEiYaKSkmLTsSNBpLEkQaVg9bEmUPahIMNSc1L0QnRC9TJ1MvYSdiLwgGMQeSCQC4AjCyAQECuAJUtBkdHAYbuAJ/tC4cGQcLuAKqQBAgCjAKYApwCoAKwArQCgcKuAJ9QAsNHCIPEUUoHBMKBroCWwAHAQxAJAkJAX4CAh0WHBszKzMRJR4eMkALCwJVMkANDQJVHRIQEAJVHbj/9EARDw8CVR0GDg4CVR0WDQ0CVR24/+pACwsLBlUdEhAQBlUduP/utAwMBlUduP/8QFENDQZV0B0BEB1AHWAdgB0EHXQWCyUKIiUkFiALCwJVFhoMDAJVFiINDQJVFhwLCwZVFgwNDQZVFhoMDAZVvxbPFt8W/xYEHxY/Fk8WAxYZMTS5AQoAGCtOEPRdcSsrKysrK03t9O0Q/V1xKysrKysrKysrKzwQ/fT1PBESOS/tOS/05AA/7eQ/7f1d5D/t5D88EP48EP089u0xMAFdAF0BFSM1NDY3FwYHARcWMzI2NjUGIyICNTQSMzIXNTMRFAYGIyImExQWMzI2NTQmIyIGAnjRSl42XRD+Tq8R43mLJnWu3PLy3Lp6plzlm9bWmap5gaObjIKeBUGvdXCMJVMnbfpnGqhgkLWLATvc8QE2mID8aufafrsDGtW8xcqq288A//8ApAAABSIHLAImACsAAAEHANYBrgFqABZACgEADhEBBkEBAQ65AiEAKQArASs1//8AhwAAA+gHLAImAEsAAAEHANYBLAFqABVACQEVBQBIKwEBF7kCIQApACsBKzUAAAIAHwAABacFugATABcBBrkAGf/AQCwTFTQvGQERFRQGBBIAAwQDExcIBgIUAQsCHgwBAQQWFR4QERETCAQCDxMIDLgCXUAJDyAODgkPCCAJuP/utA8PAlUJuP/yQAsNDQJVCRAMDAJVCbj/wEATCwsGVQkBDAwGVQldLxmAGQIZAbgCXUALEwUSIBMgEBACVRO4//a0Dw8CVRO4//a0DQ0CVRO4//pACwwMAlUTMAsLBlUTuP/3tAwMBlUTuP/4QBMNDQZVE10YIBkBIBlQGWAZcBkEXXEQ9isrKysrKyv9PBDkEF32KysrKyv9PBA8EO3kAD88PzwSOS88/TwROS88/TwRMxEzAREzERczERczMTABXSsTIzUzNTMVITUzFTMVIxEjESERIxMVITWkhYXCAvrChYXC/QbCwgL6BEuU29vb25T7tQKz/U0ES+vrAAEABgAAA+gFugAZAWa1EyIQFzQbuP/AsxUXNA64/8CzCQo0Fbj/3kALFxk0JQs1CkUKAwq4/+C2Fxk0ChgHArj/wEAyHis0AtQIAQEMBAAUHAwHERkKByABAQESJRtACwsCVRtAEBACVQ8oEBACVQ8UDg4CVQ+4/+xAEQ0NAlUPBAwMAlUPGgsLAlUPuP/2QAsLCwZVDxQQEAZVD7j/+EALDQ0GVQ8KDw8GVQ+4//ZAEgwMBlUPQDM2NP8PAcAPAQ9OG7j/wEAXNDY0sBvwGwJwG6AbsBv/GwQbBRglBBm4//q0EBACVRm4//pAFw4OAlUZBAwMAlUZCAsLAlUZBAsLBlUZuP/6QBEPDwZVGQIMDAZVGQINDQZVGbj/wEASMzY08BkBABkgGdAZ4BkEGU4aEPZdcSsrKysrKysrKzz9PBBdcSv2XXErKysrKysrKysrKysr7S9dLwA/PD/tPxI5Lzz9KzwBETMxMAArXSsrASsrEyM1MzUzFSEVIRE2MzIWEREjERAjIgYVESOHgYG0AW/+kXrGieS04XudtASvhoWFhv79kpj++/1fAqEBAqG9/bsA////wAAAAl4HFAImACwAAAEHANf/ugFqABZACgEABBABAkEBARO5AiEAKQArASs1////0gAAAnAFqgImANUAAAEGANfMAAAWQAoBAAQQAQJBAQETuQIiACkAKwErNf///+QAAAJUBq8CJgAsAAABBwDY/8cBUAAWQAoBAAQHAQJBAQEHuQIhACkAKwErNf///+kAAAJZBV8CJgDVAAABBgDYzAAAFkAKAQAEBwECQQEBB7kCwwApACsBKzX/////AAACTgcIAiYALAAAAQcA2f/RAVAAFkAKAQALBQECQQEBCLkCIQApACsBKzX////6AAACSQW4AiYA1QAAAQYA2cwAABZACgEACwUBAkEBAQi5AiIAKQArASs1AAEAo/5WAlkFugASAPC5AAUCXUANCg8SCBACBwgAABIPArj/wLMYGjQCuAJdtSANAQ0RFLj/wLQNDQJVFLj/wLM4PTQUuP/AszM0NBS4/8CzLTA0FLj/wLMoKTQUuP/AsyMlNBS4/8CzHR40FLj/wLMYGjQUuP/AQCgNEDQgFJAUrxQDEiAAD48PoA+wDwQvD0APUA/fD/APBRIPGBAQAlUPuP/stA8PAlUPuP/utA0NAlUPuP/2QBQMDAJVDyALCwZVIA+PD5APAw+iExD2XSsrKysrQ1xYsoAPAQFdWXFy/V0rKysrKysrKys8L13tKxESOS8vPAA/Pz/tMTAhBhUUFjMyNxUGIyImNTQ3ETMRAT4dUj5NW3doW3wjwk4+Q1Uudz12Z1B+Bbn6RgAAAgBm/lcCHAW6AAMAFgDjQFUYNgsLAlVPGJAYoBiwGMAY3xjwGAcAGB8YcBiAGJ8YsBjAGN8Y6wTgGP8YCx8YAQB+AQAUBhYTCglFDg8MIAsBCwQEFhMGRSARARECAwMWAQAAFiUTuP/4tBAQAlUTuP/6QBcODgJVEwQMDAJVEwoLCwJVExQLCwZVE7j/6rQQEAZVE7j//rQNDQZVE7j//EAiDAwGVQATnxOgE7ATwBPgEwbAE/ATAgATIBPQE+ATBBNOFxD2XXFyKysrKysrKyvtPBA8EDwQPC9d7RESOS8vXTwAP+0/PD8//TEwAV1ycSsTNTMVAwYVFBYzMjcVBiMiJjU0NxEzEYi0Ox1SPk1bdWhldCK0BOvPz/sVTj5DVS53PHpiQYwEJvvaAP//ADf/5wRUBywCJgAtAAABBwDWAcIBagAWQAoBABQXCAtBAQEUuQIhACkAKwErNQAC/6L+UQIgBcIABgAUASVAKwQIAxIgCCARIBI7BzMIMhFIC4YICgcTCA4KAGQEBA8DHwMCA4cCBQYGAQK4AiJACw4GChwTDwU8Bj0EuP/AQCEJDDQEZABkA38BPAIgEBAGVQIgCwsGVQ8CHwIvAj8CBAK4/8BAGQsXNAACPwJ/Av8CBAKQFgEWFxcaEA8lDQ64//pAQw4OAlUOEA0NAlUOEAwMAlUODAsLAlUOHgsLBlUODBAQBlUOCAwMBlUODA0NBlWQDgEfDj8OTw4DDhkVCAcVFAhHUBgrQ3lADAsSCxINGwEMEQobAAArASuBETMzThD0XXErKysrKysrKzxN/TxORWVE5nEZL10rcSsrGE39GfYY/f0rGfYY7QA/7T8/PDwQPBD9XTwQ7RESORI5MTABXRMHIxMzEyMBNxYzMjY1ETMRFAYjIuZxzdjA4Mv+TSI0IT8utHWWSQVUqgEY/uj5upkOU4gEXPugxbAA//8Alv5bBVIFugImAC4AAAEHAe4BzAAAAB2xARa4/8BADglkBlUgFgEAFhEABUEOAC8BK10rNQD//wCI/lsD+AW6AiYATgAAAQcB7gEhAAAAFUANASAWkBYCABYRAAVBDgAvAStdNQAAAQCGAAAD9gQmAAsBW7kABv/otAwMAlUKuP/otAwMAlUJuP/oQEwMDAJVFwMBRAMBBgYECQIHBiUGLwcvCIANtwXGBcAN5QblCeAN+gT1Bg0/DVoEWQVpBGkFmAaoBgcFBhsEGAkoCTgJWARZBQdKBgEDuP/0QBAKCRACBgYHCQoJCAoFCQgIuP/4QEALDAZVCCUHBhQHBwYDBAQlBQoUBQUKZQoBCgkGAwQEAQYFBAYLCAgHCqsGAQoJCAYFBAMHIAeAB78HAwcCCyUAuP/4tBAQAlUAuP/6QBEODgJVAAYMDAJVAAYLCwJVALj/+LQQEAZVALj/7rQPDwZVALj/+LQMDQZVALj/wEASMzY08AABAAAgANAA4AAEAE4MEPZdcSsrKysrKysr/TwZL10XOXEAGD88EDw/PD8RFzlyhwUuKwR9EMSHBS4YKysOfRDEBwgQPAg8ABc4MTA4AXJxXV0AXXJxKysrMxEzEQEzAQEjAQcRhrQBqun+agG/3v6hfwQm/lABsP52/WQCH3r+WwD//wCW/lsEKgW6AiYALwAAAQcB7gFUAAAAE0ALASAWAQAQCwAFQQgALwErXTUA/////f5bAa4FugImAE8AAAEGAe6SAAAWtgFPBAEfBAG4/+S0BAQAAEEBK11xNf//AJz+WwUfBboCJgAxAAABBwHuAeYAAAATQAsBIBQBABQPAAVBDAAvAStdNQD//wCH/lsD5gQ+AiYAUQAAAQcB7gD6AAAADrcBACEcAQxBGQAvASs1AAEApf/nBV0F0wAdAPxAXjsHNAs/FkELaRNsFnsDdQZyB3UWiwObAwwFAwUZFAMUGSQDJBMvFnECggKVAqQCpAOzArYDwALQAhAPDg4MDw4XHgUDAQACDw4RHgwJHB0IDy8OAQ4VJgkkEBACVQm4/9S0DQ0CVQm4//C0CwsCVQm4/+y0DQ0GVQm4//RAFAsMBlUACQEJVh8BHCAdIBAQAlUduP/2tA8PAlUduP/2tA0NAlUduP/6tAwMAlUduP/0tA8PBlUduP/4tA0NBlUduP/2tgwMBlUdXR4Q/SsrKysrKyv9PBD2XSsrKysr7S9dLwA/PD/tLy8/PD/tAREzABEzETMxMABdAV0TMxU2NjMyFhIREAAjIic3FjMyNhI1ECEiBgYVESOlxHPifbXliP783H95V2BBTYJM/muFyUzEBbq2hEui/s/+8v52/n9ImTSBAQfRAkN9wdH83wAAAQCL/lED6gQ+AB0BPEBKJBg0GUQZ4BjlGQUVHNQR0hLiEgSFEp0PrA+qErwPBQYSBRxyEokPgBEFBwcGBgkcBA8VChAcGgcXFgYSEBQMDQENJQASEBACVQC4/+pACw0NAlUABgwMAlUAuP/2tAsLAlUAuP/0QAsLCwZVABoQEAZVALj/+bQNDQZVALj/9kALDAwGVf8AAf8AAQC4/8BAHDM2NLAA8AACcACgALAAwAAEAEUfGBeaExQlFhW4//hAERAQAlUVBgwMAlUVBAsLBlUVuP/6tBAQBlUVuP/6QBEPDwZVFQIMDAZVFQQNDQZVFbj/wEAVMzY08BUBABUgFdAV4BUEFU4eEg0UERI5EPZdcSsrKysrKysrPP089DwQ9l1xK11xKysrKysrKyvtPBA8ABESOT88P+0/P+0zLzMvMTABXV1dAF0BERQGIyInNxYzMjY1ETQmIyIGFREjETMVNjMyFhYD6nWWSUQiNSBBLGh3daO0onXdgrA5Ao39OcWwE5kOWIMCvJSIlsj9vAQml69wpQD//wBj/+cF3QbTAiYAMgAAAQcA2AHbAXQAHrUCIBxwHAK4/+y3HB8AB0ECARy5AiEAKQArAStdNf//AET/6AQnBV8CJgBSAAABBwDYAOsAAAAlswICARq5AsMAKQArAbEGAkNUWLUAGxwAB0ErG7QaAgpIKytZNQD//wBj/+cF3QciAiYAMgAAAQcA2QHbAWoAIUAUAlAjYCNwI4AjkCMFIwIASCsCASC5AiEAKQArAStdNQD//wBE/+gEJwW4AiYAUgAAAQcA2QDrAAAAFkAKAgAhGwAHQQIBHrkCIgApACsBKzX//wCh/lsFrQW6AiYANQAAAQcB7gHmAAAAE0ALAiAuAQAuKAEGQSUALwErXTUA//8Ahf5bAsYEPgImAFUAAAEGAe4lAAAEsBQAL///AFz/5wTrByYCJgA2AAABBwDWAUwBZAAWQAoBADM2FhZBAQEyuQIhACkAKwErNf//AD//6AOxBcICJgBWAAABBwDWAL4AAAAWQAoBADM2FRVBAQEyuQIiACkAKwErNQABADAAAAS6BboADwC0QCYAERARIBEDDAEwCwICDwYIBR4HBgIPCAsMOQcBAjkGDgkIIAcBB7gBAbcJIAQFLwYBBrgBAbIEBA+4/+hACxAQAlUPCA8PAlUPuP/ytAwMAlUPuP/itA0NAlUPuP/8tAwMBlUPuP/otA0NBlUPuP/gQAoQEAZVEA8gDwIPuAJzsxC2mRgrEP1dKysrKysrKzwQ9F08EP30XTwQPBD0PBD0PAA/Pzz9PBESOS88/TwxMAFdASE1IREhNSEVIREhFSERIwIT/rYBSv4dBIr+GwFI/rjCAnWEAhStrf3shP2LAAABAAz/8gITBZkAHgEOuQAF/8CzIyY0Brj/wEBbIyY0LyCAIAIQASsPAgIaDAUrCwYGFskaAxgaFwUVCDQLDAZVCTQLDAZVCAkGEQ4NCgQJEgADBAcECB4PMwugArACwALQAgQCAgYLDCIXIhgJEiUIGP8eBgVFHrj/+rQQEAJVHrj/+kAXDg4CVR4EDA0CVR4ICwsCVR4GEBAGVR64//q0Dw8GVR64//xACwsLBlUeEgwMBlUeuP/0QBQNDQZVrx6/HgIAHtAeAh5OHxcYR7kBCgAYKwAQyQEQ9F1xKysrKysrKysr9DwQ7Tz9PBDk9DwRMy9xEOQREhczERIXMwARMzMrKxESORI5P+0/PP08EjkvPP08MTABXSsrEyM1MxEjNTMRNxEzFSMRMxUjFRQWMzI3FwYjIiYmNZGFhYSEtLS0rKwlQCAvGkk9anMfAgKEARSMAQds/o2M/uyE1VU+B58QSHWIAP//AKH/5wUiBw4CJgA4AAABBwDXAaQBZAAWQAoBABUhERFBAQEVuQIhACkAKwErNf//AIP/6APgBaoCJgBYAAABBwDXAOwAAAAgQBIB7xkBGUBTVDQAGSUREUEBARm5AiIAKQArASsrcTX//wCh/+cFIgbDAiYAOAAAAQcA2AGkAWQAJbMBAQEVuQIhACkAKwGxBgJDVFi1ABUXCwFBKxu0FQ8ASCsrWTUA//8Ag//oA+AFXwImAFgAAAEHANgA7AAAABZACgEAGRwKF0EBARm5AsMAKQArASs1//8Aof/nBSIHHAImADgAAAEHANkBkAFkABZACgEAHBYLAUEBARm5AiEAKQArASs1//8Ag//oA+AFuAImAFgAAAEHANkA7AAAACizAQEBHbkCIgApACsBsQYCQ1RYtQAgGgoXQSsbsSALuP/YsUgrK1k1AAEAof5WBSIFugAiATO3WBBYIskQAyS4/8BAKhMVNDoQOxE0ITYiShBKEUYhRiJYEVYhZiJ2F6oi6BcODCINFTQHnAgIBbgCXbUKDw8JDxm4ArtACgAJHRMCIAgBCAK4Al1AEA0NDwAB/wABAJwPDxIcJh+4/+y0Dw8CVR+4//JAEQ0NAlUfEAwMAlUfDA8PBlUfuP/wQB8LCwZVIB8BIB9QHwJgH3AfgB8DH10kFSYSIBAQAlUSuP/2tA8PAlUSuP/2tA0NAlUSuP/6tAwMAlUSuP/8tAsLBlUSuP/3tAwMBlUSuP/4tA0NBlUSuP/2tw8PBlUgCgESuP/AthMVNBJdIzu5AY4AGCsQ9CtdKysrKysrKyvtEPZdXXErKysrK+0SOS/tXXEzL+0vXQA/PD/tMz8/7TMv7TEwAStdKwBdBQYVFBYzMjcVBiMiJjU0NyQCEREzERQWFjMyNhERMxEUAgYDEhRSPk1bdmVieRz+8+7CSbF027TCTvAYRypHVC53PXhlRnEXARoBUANP/LK/uV7EARIDTvyxwf7+tAAAAQCD/lcE0wQmACUBcrUMIg8RNCe4/8BACRUXNBIgExY0HLj/8EBAEhQ0ChUZFSYSNRJEEncchBwHKhIrIAIHBwgIBUUKDyMYBiUQCx4cEwsHIAhACHAIAwgCRQ0NAAAlIiERAxCaI7gCMEAZJSRAMzY0J0AQEAJVJCgQEAJVJBIODgJVJLj/6kALDQ0CVSQEDAwCVSS4//y0CwsCVSS4//RACwsLBlUkFBAQBlUkuP/2QAsNDQZVJAwPDwZVJLj/9kANDAwGVf8kAcAkASROJ7j/wEAVNDY0sCfwJwJwJ6AnsCf/JwQnGiUXuP/4tBAQAlUXuP/4QBEODgJVFwQMDAJVFwoLCwZVF7j/9kARDw8GVRcCDAwGVRcCDQ0GVRe4/8BAFTM2NPAXAQAXIBfQF+AXBBdOJkdQGCsQ9F1xKysrKysrKyvtEF1xK/ZdcSsrKysrKysrKysrKzz95Bc5ETkvMi/tL108AD/tPzw/PD/tMy8zLzEwAF0BXSsrKyshBhUUFjMyNxUGIyImNTQ3NzUGIyImJjURMxEUFhYzMjY2NREzEQO4HVI+TFx1aGJ3Ggh81n6xO7QablNbjzC0Tj5DVS53PHhkQ2khnLRwp5UCkv2zi3dUYJB6Ajn72gD//wAZAAAHdgcsAiYAOgAAAQcA1gJsAWoAJbMBAQEbuQIhACkAKwGxBgJDVFi1ABseCAlBKxu0GRUASCsrWTUA//8ABgAABbcFwgImAFoAAAEHANYBmgAAACWzAQEBFbkCIgApACsBsQYCQ1RYtQAVGAcIQSsbtBMRAEgrK1k1AP//AAYAAAVGBywCJgA8AAABBwDWAW0BagAWQAoBAA8SAgpBAQEPuQIhACkAKwErNf//ACH+UQPuBcICJgBcAAABBwDWANcAAAAlswEBAR25AiIAKQArAbEGAkNUWLUAHSAMEkErG7QbDwBIKytZNQAAAQCJAAACVgXTAA4AtUBNTxCQEKAQsBDAEN8Q8BAHsBDAEN8Q4BD/EAUAEB8QcBCAEJ8QBR8QSwNZA2gDcBAFChwFAAAKBwcACCAIcAiACAQIDQ4lARBACwsCVQC4//ZAFxAQAlUABgwMAlUAEAsLAlUACBAQBlUAuP/8QCYMDQZVnwDAAOAAAwAAoACwAAPAAPAAAgAAIADQAOAABABOD0dQGCsQ9F1xcnIrKysrKys8/TwvXTMvAD8/7TEwAV1ycnEzETQ2NjMyFwcmIyIGFRGJNoZqT1gaNjRaOwSXc39KEp0KT1f7eAD////9AAAFWQgMAjYAYwAAARcAjQFTAkoAZbcEJxEASCsEJ7j/wLMzNjQnuP/AsyIkNCe4/8CzHiA0J7j/wLYQEjSvJwEnAC9dKysrK7EGAkNUWEAJACcQJwKgJwEnuP/As0VFNCe4/8CzLC80J7j/wLIXGTQrKytdclk1ASs1AP//AEr/6AQcB4QCJgBuAAABBwCNAQ8BwgDKsQYCQ1RYQCoEAFBTOztBAwIAOD4cHEEEAFNQU/BTAy9TcFOAUwNTAwIgQYBBAoBBAUEAL3FyNTUvXXE1ASs1NSs1G0AsBFBEAEgrUVJQU4BLTzRTQGBgNFNAODg0AFNgU49T0FMEj1PwUwJTgDg/NFO4/8BACSwuNFOAKS80U7j/wLMnKDRTuP+AsyMkNFO4/8CzHyI0U7j/gEAPHh40U0AVGDRTgBMUNFMcuAFAABoYENwrKysrKysrKytxcisrK8TUxDEwASs1Wf//AAEAAAeQBywCJgCQAAABBwCNApMBagAWQAoCABQWAQRBAgEXuQIhACkAKwErNf//AET/6AbKBcICJgCgAAABBwCNAlgAAAAVQAoDAU4lAEgnAwFOuQIiACkAKwErAP//AFP/xQXtBywCJgCRAAABBwCNAcsBagAVQAkDNBkySCsDATS5AiEAKQArASs1AP//AIH/sQRkBcICJgChAAABBwCNATYAAAAVQAoDASwdHkgnAwEvuQIiACkAKwErAAABALkDWQGGBCYAAwAkQA4CAQMAPAEFnwM8ABkEobkBkAAYK04Q9E395gAv/TwQPDEwEzUzFbnNA1nNzf//ABkAAAd2BywCJgA6AAABBwBDAooBagAYuQAB/6a3GxkICUEBARq5AiEAKQArASs1//8ABgAABbcFwgImAFoAAAEHAEMBaAAAABi5AAH/prcVEwcIQQEBFLkCIgApACsBKzX//wAZAAAHdgcsAiYAOgAAAQcAjQKKAWoAFUAJARkIAEgrAQEZuQIhACkAKwErNQD//wAGAAAFtwXCAiYAWgAAAQcAjQFoAAAAFUAJARMHAEgrAQETuQIiACkAKwErNQD//wAZAAAHdgbhAiYAOgAAAQcAjgJsAR4AK7UCAQECAhm5AiEAKQArAbEGAkNUWLUAHB0ICUErG7EcF7j/4rFIKytZNTUA//8ABgAABbcFwwImAFoAAAEHAI4BmgAAABhACwIBFgcASCsBAgIWuQIiACkAKwErNTX//wAGAAAFRgcsAiYAPAAAAQcAQwFNAWoAFUAKAQEOBhpIJwEBDrkCIQApACsBKwD//wAh/lED7gXCAiYAXAAAAQcAQwC3AAAAHEAPARwgDQ4GVRwPGkgrAQEcuQIiACkAKwErKzUAAQCKA+kBWwXJAAkAR7YDAQgAA6sEuAFQQBgJAQA8CQkIAARpA8UAAAmBBz8IAQgZCp25AZAAGCtOEPRdPE39PBD05AA/PBD9PBD97QEREjkAyTEwASMWFwcmJjU1MwFLXgJsLF1IwQT4nCxHKo6DpQAAAf/hBMsCygVfAAMAGkAMATUAAhoFABkEQ2gYK04Q5BDmAC9N7TEwAzUhFR8C6QTLlJQAAAEAG//kBDoF0wA2AS9AxQskEwQpGDoSUy5tLGIuhigI2x7fIdoy6SH6IQUZIQF1CYYJAjQ1NR4eHysgMzIyISFfIN8gAo8gAQ8gHyAvIJ8gryAFICAmAgMDGRkaKxsBAAAcHAAbAS8bARsbFiYqJ18pbykCKYhALQEtKSYBBx4UahANHg6rCx4QCxefFgshHhwDGSMyNQADAzAqXilpDeUgDjAOAg4aODM0NAEBAocZXiADAQNNMF6/I88j7yMDI3IXIB8fGxsaxRarrx8BFxk3qY0YK04Q9F0ZTeQY9DwQPBA8EPRd/fRd7fQ8EDwQPE4Q9l1N5PTtERIXORESFzkAP+0/7f3tEPTtP+1x/V3kERI5L11xPBA8EDwQ/TwQPBA8ETkvXXFyPBA8EDwQ/TwQPBA8MTAAXQFycV0BIRUhBgc2MzIXFjMyNxcGIyInJiMiByc2NyM1MyYnIzUzJjU0JDMyFhcHJiYjIgYVFBchFSEWAbEBFv7mIYBNQFdnqkRFdjqSXEqQl0alkEXCINHRBCWofhcBCcGm9xqzDZRrdY0cAVj+yhoCZpSQgxYZKTilPywuXa1w0ZQfdZRaTcLcv7wbcZGWXDqFlGkAAAIAWv/eBHwESAASABkApEBQtgQBRRdaBFIOWxBaFVIXawRoBwggGzoESwRJEUoVBRIATBMvGc8ZAhkZCQ8GaQUBrAOrCQsUOhisFqsPBwWrjwafBq8GvwbPBt8GBgYGFBO4AsFAFQASIBICEBIgEjASAxIxGwEAGBkZALgCwbcfDD8MAgwxGhD2Xf08EDwQPBD2XV39PDkvXe0AP/305D/95C/kERI5L108/TwxMAFdXQBdAREWMzI3FwYGIyIANTQAMzIAEycRJiMiBxEBQXiy/o1IeOB77f7cASbr1gEwC+eArK95AhP+jXn2K61nAUD19wE+/uT+50oBKXl6/tgAAAUAa//HBoAF0wADAA0AIQAtADgA5EAOLzp7EXcVihGGFQUCAwO4/8CzQlw0A7j/wEARJzs0Az8AARQAAAEYGCUODja4AmFACx8lLyU/JQMlJR0rugJhABMBwEAJHQUHrAigCwQNuAEftAsM4gIBuwF9AAMAMAJhQA0d4gAAAwkiKRAnLikguAEdQB0aKCkWJzMpGho6AAMBAgQ6OQsMBQQMDSkECAfLBLgBRrM5V2gYKxD29jwQ/TwQPBI5ERIXOU4Q9k3t9O0Q/e307QA/PBD27RD9PPQ8/TwQ9P05EP3tEjkvXe0ZOS8ROS+HBS4YKysrfRDEMTABXRcBMwEDEQYHNTY2NzMRASY1NDYzMhYVFAcWFRQGIyImNTQ3FBYzMjY1NCYjIgYDFDMyNjU0JiMiBuQETZ37szZmejegLmwC7YJ9i4uLjKeogoqhsUYzM0lINjdAHJVHUFZERkw5Bgz59AMWAipRIHsRbT39Ef6SL3NQb2tWcy0pj2p+f2SUwTI0NC0uNzr+kX9FNTpERQAFACL/xwaBBdMAAwAiADYAQgBNAVFAFx8U3xQCL09pJmYqeyZ3KoomhSoHAgMDuP/As0JcNAO4/8BAFSc7NAM/AAEUAAABHBwhGC0tOiMjS7gCYUALHzovOj86Azo6MkC9AmEAKAHAADIADgJhQA4NDSEYBcUgBDAEAgRkB70CYQAhAR8AGAAUAqpAFx8VLxU/FQN/FQFfFW8VAl8VbxUCFZESuAJhsxjiAgG7AX0AAwBFAmFAETLiAAADCQ4NnxA3KSUnQyk1uAEdQBsvPSkrJ0gpLxpPAAMBAgRPThApGiIKKTAeAR64AihAFwQOJw1kBRQpEBXQFQIVIgUpBBlOfGgYK04Q9E3t9HLtEPbkEP1d7fTtERIXOU4Q9k3t9O0Q/e307RDkOQA/PBD27RD9PPT99HJxcV3kEP399F3kERI5L+0Q/e0SOS9d7Rk5LxE5LxESOS+HBS4YKysrfRDEMTABXQByFwEzAQE3FjMyNjU0Iwc3MjU0IyIHJzY2MyAVFAcWFRQGIyABJjU0NjMyFhUUBxYVFAYjIiY1NDcUFjMyNjU0JiMiBgMUMzI2NTQmIyIG5QRNnPu0/qCSH3tDWpw6Fpx5aCSPKYZkAR6KraWK/vUEfYKJfoyLjaiqgIeksUYzMUpINjZAHJVITlVERkw5Bgz59APaD3BLOW8DbmZZZhdvT7x4JyuSZYT+pC9zWmVrVnAwKY9te3tolMEyNDMuLjc6/pF/RjQ6REUAAAUAIv/HBoEF0wADAB8AMwA/AEoBd0AseyN3J4ojhifBG9cb5Rv1FQgSGSAZL0wxGQQFFQUbAhQVFWwQERQQEBECAwO4/8CzQlw0A7j/wEARJzs0Az8AARQAAAEqKjcgIEi4AmFACx83Lzc/NwM3Ny89ugJhACUBwEATLxUVDREQJ18Pbw9/D48PBA+rDbgCYUAcDxdAF1AXAxcXHREFxYAEASAEMARABFAEBARkB7oCYQAdAR+0ERMUEhS4AmGzEScCAbsBfQADAEICYUANL+IAAAMJNCkiJ0ApMrgBHUAiLDopKCdFKSwaTAADAQIETEsVDxATDxIBEiIKKQAaMBoCGrgCKEAUBBQUEREPDw8QARAnBSkEGUtXaBgrThD0Te30XTIvMi8zLxD9Xe30XTwREjkREhc5ThD2Te307RD97fTtAD88EPbtEP089O08EDwQ/f30XXHkERI5L1399F3kERI5LxD97RI5L13tGTkvETkvhwUuGCsrK30QxIcOLhgrBX0QxDEwAXFdXRcBMwEBNxYzMjY1NCYjIgcnEyEVIQc2MzIWFRQGIyImASY1NDYzMhYVFAcWFRQGIyImNTQ3FBYzMjY1NCYjIgYDFDMyNjU0JiMiBuUETZz7tP6gkBp5TFxTQkZGjU8B1v6KIk9ZcZ65gnabBJOCiX6Mi42oqoCHpLFGMzFKSDY2QByVSE5VREZMOQYM+fQD1xJpUz86VUAZAXl5njWTbHiWcf4zL3NaZWtWcDApj217e2iUwTI0My4uNzr+kX9GNDpERQAFAEr/xwaABdMAAwAMACAALAA3AORADi85fRB3FIsQhhQFAgMDuP/As0JcNAO4/8BAESc7NAM/AAEUAAABFxckDQ01uAJhQAsfJC8kPyQDJCQcKroCYQASAcCyHAwEuAG5twYHrAkIJwIBuwF9AAMALwJhQA0c4gAAAwkhKQ8nLSkfuAEdQCkZJykVJzIpGRo5AAMBAgQ5OAYJBAkgCgEKhwwpBAgHrC8EAQQ8OHxoGCsQ9l30PBD99F08ERI5ERIXOU4Q9k3t9O0Q/e307QA/PBD27RD9PPQ8/Tz2PBD97RI5L13tGTkvETkvhwUuGCsrK30QxDEwAV0XATMBAxITITUhFQIDASY1NDYzMhYVFAcWFRQGIyImNTQ3FBYzMjY1NCYjIgYDFDMyNjU0JiMiBswETZ37s6QY7f6AAiX0IgNwgn2Li4uMp6mBhqWxRjMxS0g2N0AclUdQVkRGTDkGDPn0AxYBQQEjeVD+5P6P/pIvc1Bva1ZzLSmPbXt7aJTBMTUzLi43Ov6Rf0U1OkRFAAABAOL92QHA/28ACQA6QBUGPgdsCQkAnwIBAwKBAQEABuUH4gC4AmCzCgkD2bkBkAAYKxE5EPT05BA8EP08AC88/TwQ9u0xMBM1MxUUBgcnNjfv0UpeNl0Q/sCvdW6NJlQoawAAAQBr/lsCHP/SABMAS0AKCE0ADRANIA0DDbgCMUAeAhE6E00Afw8CHwIvAgMCOBQFKQ/5EwBqCuILGRRXuQGQABgrThD0TeT2PPTtABD+XfT95BD0Xe0xMBc2MzIWFRQGIyInNxYzMjU0IyIH1SMfiXyNmD9NCywrp38OEjIEbkhNdAx1BExDAgD//wDeBKoCTwXCAhYAjQAAAAP/6gTOAsEF4wADAAcACwBaQDgEoAYJoAtABgsAAwGQAwEDh4AAAwWfBwcACJ9QCmAKAgoKAAN18AIBAkAsLzQCxQGgXwABUAABAC9yXe32K3HtETMvXe0RMy/tAD8a/V1xPDwaEO0Q7TEwATMDIyUzFSMlMxUjAVu6yHUBPK2t/datrQXj/uvAwMDAAAAD//8AAAVbBboABwAOABIBq7YBDg8QAlUCuP/ytA8QAlUCuP/8tBAQBlUCuP/2tA0NBlUCuP/4QGUMDAZVCQwMDAZVBQwMDAZVLxQwFGcIaAlgFIgDnw+QFMkFxgbAFPAUDAgFWQFWAlAUaAuwFPMM8w3zDgkEDAQNBA4DDwASEBICEtoQAgsKCQUEBAwNDggGBwcMCQUECAYMBwIDA7j/+EAPDAwCVQMgBAwUBAQMAQAAuP/4QBUMDAJVACAHDBQHBwwJHgUFCB4GAwa4AnBADgAM6QIBAhBSEVIS6UAPuP/AsxIVNA+4/8BACgsMNN8PAQ9UAAK6AQsAAQELQBIMIABlBwNSUATPBN8EA5AEAQS4AQFAC1AMwAffDAOQDAEMuAEBQA0PB88HAn8HgAcCB5MTugGbAY4AGCsQ9F1xGfRdcfRdcRjtEO0aGRDt7RgQ9HIrKxr99O0APzztL+Q8EO08EO2HBS4rK30QxIcuGCsrfRDEARESOTkROTmHEMTEDsTEhwUQxMQOxMQAGD/9XTwxMAFLsAtTS7AeUVpYtAQPAwgHuv/wAAD/+Dg4ODhZAXJxXSsrKysrKysjATMBIwMhAxMhAyYnBgclEzMDAQIz0QJY3av9m6HZAfGZSR8cM/3vhezcBbr6RgG8/kQCWgGWwm6Ni5oBGP7oAAAC/6cAAAXXBboACwAPAOtAOAwADxAPAg/aDQIGBR4ICAcHAAMEHgIBAgoJHgsACA1SDlKQDwEP6Q8MHwxPDM8M3wwFDEAOETQMuP/AQA0JCzSfDAEMQC5kNAwHuP/AQCwQEjQHVANKIAogDQIKGhEECSABADIQEAJVAAoPDwJVABoNDQJVACYMDAJVALj/8UAXCwsCVQAIEBAGVQAPDw8GVQAcDQ0GVQC4/+xACwwMBlUAIAsLBlUAugEWABABibFbGCsQ9isrKysrKysrKys8/TxOEPZdTfTkKy8rcisrcf1d9O0APzz9PD88/TwSOS88EP08P/1dPDEwIREhFSERIRUhESEVARMzAwGRBCT8ngMr/NUDhPnQhezcBbqt/j+s/g2tBKIBGP7oAAAC/6gAAAXmBboACwAPASy5ABH/wEAuExU0DAAPEA8CD9oNAgQDHgmgCtAKAgoKCAUCAgsICA1SDlKQDwEP6QxADxE0DLj/wEAdCQs0DCALCwZVTwxfDKAMA1AMARAMAQwFCCAHBwa4/91AHRAQAlUGDA8PAlUGHg0NAlUGCgwMAlUGEhAQBlUGuP/+QDQPDwZVBhENDQZVBgoMDAZVYAaPBgIGGlARgBECEQILIAEACBAQAlUAHA8PAlUALg0NAlUAuP/6QBcMDAJVADAQEAZVABkPDwZVACYNDQZVALj/+kAUDAwGVQBACwsGVU8AXwC/AAMA3RC4AYmxWRgrEPZdKysrKysrKysrPP08EF32XSsrKysrKysrPBD9PC9ycV0rKyv9XfTtAD88PzwSOS9dPP08P/1dPDEwASshETMRIREzESMRIREBEzMDAWjCAvrCwv0G/X6F7NwFuv2mAlr6RgKz/U0EogEY/ugAAv+oAAACKgW6AAMABwDGQDIPCS8JMAmACQQABxAHAgfaBgUCAQIACAVSBlKQBwEH6QQWDA0CVQQYCwsGVQRADxE0BLj/wEBfCQs0TwRfBKAEsAQEEAQBBAIDIAEAChAQAlUAHA8PAlUALg0NAlUAOAwMAlUACgsLAlUABBAQBlUADA8PBlUAKg0NBlUAEgwMBlUAGAsLBlVfAG8AfwADTwBfAAIA3Qi4AYmxWRgrEPZdcSsrKysrKysrKys8/Twvcl0rKysr/V307QA/Pz887V0xMAFdIREzEQETMwMBaML9foXs3AW6+kYEogEY/ugAA/+n/+cF0gXUAAwAGAAcAQ5AVgUPChEKFQUXEw8dER0VExdHDkkSSRRHGFgFWAdWC1QPWhFbEl0VUxeJEpoClQQXABwQHAIc2hsaAhYeAwMQHgkJGlIbUpAcARzpGSALCwZVGUAPETQZuP/AQA8JCzSgGbAZAoAZARkTJga4/+pACxAQAlUGCA8PAlUGuP/utA0NAlUGuP/wQAsMDAJVBhALCwJVBrj/9bQNDQZVBrj/+EA3DAwGVQYaHg0mAAoPEAJVABALDgJVAAoJCgJVAAsNDQZVABIMDAZVAEkLCwZVDwAfAC8AAwAuHbgBibFcGCsQ9l0rKysrKyvtThD2KysrKysrK03tL3FdKysr/V307QA/7T/tPzztXTEwAV0TEAAhIAAREAAhIiQCNxQAMzIAERAAIyIAJRMzA1gBigE0ATUBh/52/s3d/rOTyAEQ5OABFv7o29f+4P6HhezcAsoBbgGc/l3+qv6s/mDdAVuo+/7BATsBFAEYATn+2psBGP7oAAL/pwAABrwFugAMABABzbYICToDBDsJuP/nsxIXNAi4/+dADhIXNAQZEhc0AxkSFzQJuP/YsxghNAi4/9hAKhghNAQoGCE0EiYEKQgqCi8SBGgBaAZoC94GBAUEAwMGCAcJCQYGAwYJA7j/9kAqDBACVQMgAgEUAgIBBgkGAwkKDBACVQkgCgsUCgoLABAQEAIQ2g8OAgELuP/gQAsNDQZVCyALCwZVC7gCGUAqCgoJCQMDAgIACAsGAQMCAA5SD1KQEAEQ6Q0ZDAwCVWANcA0CDUAPETQNuP/AQA4JCzRPDV8NsA3ADQQNErgCGEAJDAlSQAqACgIKuAG1QA0LCwwgAANSTwKPAgICuAG1QCcBAQAkEBACVQAMDw8CVQAcDAwCVQAiEBAGVQAgDw8GVQAMDAwGVQC4AkeyEQYMuAGJsagYKxE5EPYrKysrKys8EPRd7RD9PBD0Xe0Q5i9dKytxK/1d9O0AERIXOT8/PBA8EDwQ9CsrPD887V2HBS4rKwh9EMSHBS4YKysIfRDEhw4QxMSHDhDExEuwF1NLsBxRWli0CAwJDAS6//QAA//0ATg4ODhZMTAAXQFdQ1xYQAkJIhk5CCIZOQS4/96xGTkrKytZKysrKysrKysrIREBMwEWFzY3ATMBEQETMwMDsf3L7AEhVUBCXgEc4v23+zSF7NwCbQNN/kaDdXOQAa/8s/2TBKIBGP7oAAAC/6cAAAWlBdMAHQAhAbRARZ8RnxsCWAFXDXoSdRqGGK8jBlwFUAlvBWQJdgkFJQlLEksURhhFGgULBQQJHQUUCSoFBQwVAhc7GgMAIRAhAiHaIB8CFrgCSEAjBwMODQABLRsbES0NHg8QHRwcEAgfUiBSkCEBIekeQA8RNB64/8BAEAkLNE8eXx6gHrAewB4FHg24AjqzEBARAbsCOgAbABz/9kARCwsCVRwRCgsLAlUvEU8RAhG4AnhADQ4TJgtKDw4MEBACVQ64//ZACw8PAlUOBg0NAlUOuP/8tAwMAlUOuP/oQAsLCwJVDhAQEAZVDrj/+rQMDQZVDrj/90ASCwsGVRATrw4CDmojIBxAHAIcuAJ4tR0ZJgNKHbj/4LQQEAJVHbj/6rQPDwJVHbj/7rQNDQJVHbj/9rQMDAJVHbj/4LQQEAZVHbj/7LQPDwZVHbj/8rQNDQZVHbj/+EAKDAwGVSAdAR2sIroBiQGOABgrEPZdKysrKysrKyv07RDtXRD2XSsrKysrKysrPPTtEO1dKxArPO0QPBDtL10rK/1d9O0APzwQPBA8/fQ8EPQ8EDw/7T887V0xMAFxXV1dXQBdNyEkETQSJDMyBBIVEAUhFSE1JBE0AiMiAhUQBRUhAxMzA2sBQP7QoAEkzcsBD6/+0AFA/cYBZPvJz/gBYv3FxIXs3K3+AW7HATy3qP7G2P6S/q2ipgGz9QE9/sHp/keqogSiARj+6AAABP94AAACTwXjAAMABwALAA8As0AaCaMKDaMPQAoPDwQBnwQBBEKAB8kCAQYACgm4AjCzCwsEDLgCMEAMUA5gDgIODgQfBwEHuAEMQBTwBgEGQCwvNAZJBUAEEU4CAyUBALj//EARDg4CVQAECwwCVQAMEBAGVQC4//60DQ0GVQC4//xADQwMBlUQACAAAgBFEEe5AQoAGCsQ9l0rKysrKzz9POQv7fYrce1xETMvXe0RMy/tAD8/PP4a7V1xPDwaEO0Q7TEwMxEzEQMzAyMlMxUjJTMVI4m0VLrIdQE8ra391q2tBCb72gXj/uvAwMDAAP////0AAAVZBboCBgAkAAD//wCWAAAE6QW6AgYAJQAAAAL//gAABVoFugADAAoA4UA8hAgBnwgBBwIXAi8MMAx4BokBhgKXBJgFtwS4BccEyAXnA/cDDwYECAUnBCgFNwQ4BQaUCAEBDg8QAlUCuP/ytA8QAlUCuP/2QDwMDAJVBggIBQoEBAgCAwEACAUIBAUgAwIUAwMCCAQIBQQgAAEUAAABBQQeAAgBAgIBAgMIAAgEAQAFAgO6AhQAAAIUQA0IBgwMBlXPCAEICAwLGRESOS9dKxjt7Tk5Ejk5AD8/Pz8RORD9PIcFLisIfRDEhwUuGCsIfRDEARE5ETmHDhDEhw4QxDEwASsrK3JxXQByXSMBMwElIQEmJwYHAgIz0QJY+7EDL/7DRyEbNAW6+katA0O8dIiQAP//AKIAAAToBboCBgAoAAD//wApAAAEsAW6AgYAPQAA//8ApAAABSIFugIGACsAAP//AL8AAAGBBboCBgAsAAD//wCWAAAFUgW6AgYALgAAAAEACwAABUgFugAKAOdAGl8FAQAMLwwwDG8MBFcDXARWBQMKCA8QAlUAuP/4QBEPEAJVAwUFAgcICAUAAQoJBbj/7kAJDAwCVQUCBQgCuP/sQA0MDAZVAiABABQBAQAFuP/uQCgMDAJVBQgFAggMDA0GVQggCQoUCQkKBQABCQgIAgEICgACCAoJAAIBugFfAAn/+LQNDQJVCboBXwAF//RADQsLBlUABTAFAgUFDAsZERI5L10rGO0r7Tk5Ejk5AD88Pzw/PBESOYcFLisrCH0QxCuHBS4YKysIfRDEKwERORE5hw4QxIcOEMQxMAErK3JdAHIBASMBJicGBwEjAQMQAjjT/oMyGyEt/nTGAj0FuvpGBCiMZXl4+9gFuv//AJgAAAYPBboCBgAwAAD//wCcAAAFHwW6AgYAMQAAAAMAbQAABMYFugADAAcACwA+QCcFHh8HAU8HXwd/B48HBAcHAAkeCwgCHgACBpwBYgpWDQecAGILVgwQ9uTkEPbk5AA/7T/tEjkvXXHtMTATIRUhEyEVIQMhFSGIBCP73V4DZ/yZeQRZ+6cFuq3+Jqz+Jq3//wBj/+cF3QXUAgYAMgAAAAEApAAABSIFugAHAKy5AAn/wEAOExU0AwgACAUeAQIFIAO4/+60Dw8CVQO4//JAGQ0NAlUDEAwMAlUDXYAJAQkGIAAgEBACVQC4//a0Dw8CVQC4//a0DQ0CVQC4//q0DAwCVQC4//VADgwNBlUACAsLBlUgAAEAuP/AthMVNABdCAm4/+BAEwsLBlUgCQEgCVAJYAlwCQQ7WRgrXXErEPYrXSsrKysrK+0QXfYrKyvtAD/tPz8xMAErMxEhESMRIRGkBH7C/QYFuvpGBQ368///AJ4AAAT9BboCBgAzAAAAAQCUAAAEogW6AAsA2UA89QkBNgM2CQIVBJUEpQTWAgQHAgsJFgIaCSYCLQk3AjoDPwlJAwppA2oJeAN4CbgDuQn2AvkJCAMEAwIEuP/wtA8QAlUEuP/wQBEMDAJVBB4ICRQICAkDAgMEArj/9kA2DxACVQISDAwGVQIeCgkUCgoJCggJAwQEAgQFAgEeCwIFHgcIBAIJAwQICAcKCwsHAOMgBgEGuAExsw0H6QwQ5hD2XeQQPBA8EDwSFzkAP+0//TwQPBESFzmHBS4rKysIfRDEhwUuGCsrKwh9EMQxMAFdcXIAcV0BFSEBASEVITUBATUEefztAfT+DAM8+/IB3/4hBbqt/ez9tK3KAi8B/sMA//8AMAAABLoFugIGADcAAP//AAYAAAVGBboCBgA8AAD//wAJAAAFSQW6AgYAOwAAAAEAfwAABjAFugAWAQpASkAETwlJD0AUQBhgGHAYkBigGAkAGCAYMBhAGAQVIA8RNA8gDxE0IwMjCjQDNAqiCuQK9goHCAVdEBMTABIMAgYCAAISCAcRIAYSuP/7QA4MDQZVEhIWCyANASAWDbj/8LQPDwJVDbj/6rQMDAJVDbj/4EAbDA0GVQANIA0wDUANBEANYA1wDZANoA3/DQYNuAJdQBAYgBjAGNAYA6AY4BjwGAMYuP/AswkRNBa4//RAIBAQAlUWCAwMAlUWEA8PBlUWEA0NBlUWFAwMBlUgFgEWuQJdABcQ5F0rKysrKytdcRDmXXErKysQ7RDtEjkvKzz9PAA/Pz8/ERI5Lzz9PDEwAF0rKwFxXRMzERQWFxEzETY2EREzERAFESMRJAARf8LW38LS48P9iML+tv7TBbr+dfHBEgNP/LENzgEBAXP+Yv2zCv47AcUGATUBCwAAAQBhAAAFmwXTAB0Bd0BbnxGfGwJYAVkEWAVXDVsUVBVYF1gYehJ1GoYYC1wFUAlvBWQJdgkFJQlLEksURhhFGgULBQQJHQUUCSoFBQwVAhc7GgMWHgcDDg0AAS0bGxEtDR4PEB0cHBAIDbgCOrMQEBEBuwI6ABsAHP/2QBELCwJVHBEKCwsCVS8RTxECEbgCeEANDhMmC0oPDhAQEAJVDrj/9kALDw8CVQ4KDQ0CVQ64/+xACwsLAlUOEBAQBlUOuP/6tAwNBlUOuP/3QBMLCwZVEBMBDmpfHwEfIBxAHAIcuAJ4tR0ZJgNKHbj/4LQQEAJVHbj/6rQPDwJVHbj/7rQNDQJVHbj/9rQMDAJVHbj/4LQQEAZVHbj/7LQPDwZVHbj/8rQNDQZVHbj/+EAPDAwGVWAdAQAdIB0CHaweEPZdcSsrKysrKysr9O0Q7V0QXfZdKysrKysrKzz07RDtXSsQKzztEDwQ7QA/PBA8EDz99DwQ9DwQPD/tMTABcV1dXV0AXTchJBE0EiQzMgQSFRAFIRUhNSQRNAIjIgIVEAUVIWEBQP7QoAEkzcsBD6/+0AFA/cYBZPvJz/gBYv3Frf4BbscBPLeo/sbY/pL+raKmAbP1AT3+wen+R6qi//8ABAAAAjUG4QImACwAAAEHAI7/xwEeACi1AgEBAgILuQIhACkAKwGxBgJDVFi1AAUKAQJBKxu0CAIASCsrWTU1//8ABgAABUYG4QImADwAAAEHAI4BUAEeABtACwIBEQsASCsBAgIUugIhACkBZIUAKwErNTUA//8ASP/oBFMFwgImAS4AAAEHAI0A9AAAABtADgLgIfAhAiEVAEgrAgEhuQIiACkAKwErXTUA//8AYv/oA2MFwgImATAAAAEHAI0AkAAAABZACgEAJSccAEEBASW5AiIAKQArASs1//8Ai/5pA+oFwgImAhgAAAEHAI0A9AAAABVACQEUEABIKwEBFLkCIgApACsBKzUA//8AYwAAAdQFwgImAhoAAAEGAI2FAAA8swEBAQe5AiIAKQArAbEGAkNUWLUVBwcBAkErG7kAB//AsxcZNAe4/8BACyIlNC8HAQcBWkgrK10rK1k1//8AiP/oA9oF4wImAiMAAAEHAfAA3AAAAA20AQIDAxe5AiIAKQArAAACAIz+aQQ9BdMAFAAsAQZAWTgUSBRXD2cPahlqHWUmeQt6GXodiQuLGZcNDSgMAUgpWSWpCKwNBA0QCg40uw3LDQIAByRoDQENDRUcECzALAIsGxwHJBwTBwETCwIODRUVARgkPwpPCgIKuAJUQAknJC4UCwsCVRC4//C0Cw0GVRC4/8BAFCQlNDAQAQAQEBAgEAMQMS4fASUCuP/2QBEQEAJVAgYMDAJVAgYLCwJVArj/8kARDw8GVQIEDAwGVQIGCwsGVQK4/8BAEjM2NPACAQACIALQAuACBAJOLRD2XXErKysrKysr/TwQ9l1dKysr7fRd7RE5LzkAPz8/EO0Q7S9d7Rk5L10REjkBXSsxMAFdAHFdJREjETQ2NjMyFhUUBgcWFhUUAiMiEzI2NTQmIyIGBhURFBYWMzI2NTQmJiMjAT+zW96Iyc+nbK6939PYK7ioj2tdiR8wnmd9kWudghqH/eIFham/feeJhqQTEdieqv7zA3iAeWKEYniW/m2sooKrfmilOwAAAQAZ/mkD5wQmAAgBGrOPCgECuP/uQAsPEQJVAgoNDQJVArj/7EAPCQsCVfACAQACAQIBAgMBuP/8QEQOEQZVASUACBQAAAgCAwIBAwQPEQZVAyUEBRQEBAUCAQUHDgQDAwEBAAYFCAoDBAYBAAcE/wYA/wcFBiUIBxIREQJVB7j/8EAREBACVQcKDQ0CVQcKCQkCVQe4//60EBAGVQe4//hAJgwMBlUAB48H4AfwBwRABwGwBwEHBwoJAAowCmAKgAqQCgVACgEKuP/AshUaNCtxXRESOS9ycV0rKysrKys8/TwZEOQQ5BESORESObEGAkNUWLICBgcREjlZABg/PD88EDwQPD8REjmHBS4rKwh9EMSHBS4YKysIfRDEMTAAcnErKysBXRMzAQEzAREjERm9ASkBMLj+c7cEJvy7A0X72v5pAZcAAAEASP5RA3YFugAfAOxAIAgZGBlsBHcGhgamBKkYBxoDQwNUAwM3A3odix0DAh4RuAJqQBMQDwgcFwoeSAAAHgEQEAygAAEAuP/AtgkKNAAAGxO4AjBAEwwYEBACVQwYDQ4CVQwZEBAGVQy4//S0Dw8GVQy4/+pAEg0NBlUMCgwMBlUMDB8BbwECAbj/wEA6CQs0AQUkGxILEQJVGxIQEAZVGwIPDwZVGwwNDQZVGyAMDAZVGwwLCwZVHxs/G08bXxt/G48bBhsoIBD2XSsrKysrK+0vK10zLysrKysrK+0RMy8rXREzLxEzAD/tP+0/7REzMTABXQBxXRMhFQQAFRQWFx4CFRQGBiM3NjU0JiYnLgI1NAA3IeoCjP7z/pNseZyDYnidcTGoNk5tl5lMAVbs/mAFunqm/efkeHQKDil/WWGkQqYTeik+EgQEcbp17QH3nwABAIv+aQPqBD4AEwEpQFdyEXAViw6CEIIRmw6sDqkRoBW7DrAVwBXUEdAV4BX/FRDwFQEGBwkRFgclBDUERgTZEOAD7xEJCw8ACg8cBQcCAQYRDxMLDAoMJRVACwsCVQkYEBACVQm4/+pAEQ0NAlUJBgwMAlUJHAsLAlUJuP/0QAsLCwZVCRQQEAZVCbj/+UALDQ0GVQkKDw8GVQm4//ZAGgwMBlVwCaAJsAnACf8JBQlOFQMCmhITJQEAuP/4QBEQEAJVAAYLDAJVAAQLCwZVALj/+kARDw8GVQACDAwGVQAEDQ0GVQC4/8BAFTM2NPAAAQAAIADQAOAABABOFBEMExESORD2XXErKysrKysrPP089DwQ9l0rKysrKysrKysr7TwQPAAREjk/PD/tPz8xMABdAXFdMxEzFTYzMhYWFREjETQmIyIGFRGLonXdgrA5tGh3daMEJpevcKWc+9wEHZSIlsj9vAADAFz/6AQYBdMABwANABIBNEBhVwFXA1gFWAdnAWcDBiQQKRI6CzUNNRA6EkYBSQNJBUYHSQtGDUMQShJmBWkHdhB5EoYQiRK1ELoSFgkcfw+PDwIPDwIRHAYLDBwCAwkOJAQIDyQAFEANDQJVFEALCwJVBLj/6kARDw8CVQQYDQ0CVQQQCwsCVQS4//C0CwsGVQS4//C0DQ0GVQS4//C0Dw8GVQS4//C0DAwGVQS4/8BAFSQlNDAEAQAEEAQgBAMEMQQx3xQBFLj/wEBEHiM0MBQBFAAMDg8CVQASDQ0CVQAMDAwCVQAcCwsCVQAOCwsGVQAODQ0GVQAMEBAGVQAWDAwGVQBAJCU0HwA/AAIAMRMQ5F0rKysrKysrKysQcStd5vZdXSsrKysrKysrKysQ/TwQ/TwAP+0/7RI5L13tMTABXQBdExAhIBEQISATIQImIyABIRIhIFwB3gHe/iL+IroCSAqgfP7pAj39uAsBGQEaAt0C9v0K/QsDPgE54P1W/ecAAQCJAAABPQQmAAMATEASAgEGAAoFTgIDJQEABgsMAlUAuP/8tAwMBlUAuP/+QBMNDQZVAAwQEAZVAAAgAAIARQRHuQEKABgrEPZdKysrKzz9POYAPz88MTAzETMRibQEJvvaAAEAhgAAA/8EJgALAVq5AAX/6LQMDAJVCLj/6LQMDAJVCbj/6EA+DAwCVRcCAUQCAT8NWgNZBGkDaQSADZgFqAW3BMYEwA3lBeUI4A36A/UFEAUFGwMYCCgIOAhYA1kEB0oFAQK4//RADAkIEAIFCAkJBAgHB7j/+UBSCwsGVQclBgUUBgYFAgMDEBAQBlUDBwwNBlUDJQQJFAQECWUJAQkIBQIEAwAGBAMGCgcHBgqrBQEJCAcFBAMCBxAGUAZwBoAGnwa/BgYGAQolC7j/+LQQEAJVC7j/+kARDg4CVQsGDAwCVQsGCwsCVQu4//y0EBAGVQu4//C0Dw8GVQu4//m0DA0GVQu4/8BAEjM2NPALAQALIAvQC+ALBAtODBD2XXErKysrKysrK/08GS9dFzlxABg/PBA8Pzw/ERc5cocFLisrKwR9EMSHBS4YKysOfRDEBw4QPDwAFzgxMDgBcnFdAHJxKysrEzMRATMBASMBBxEjhrMBr+7+JQIE5v5iQrMEJv5fAaH+R/2TAfQ9/kkAAAEAGAAAA+YFugAHAO+5AAP/7EBACQkCVQAYDhECVQMAEwB5AIkABAMQFBk0NwZGBVYFaAOnBKcFBggDAAkYAzAJYAmYAKAJsAkIAAwLDwZVBQQHB7j/+kAWCw0GVQcMEBEGVQclBgUUBgYFAQIDA7j/9EA4DA0GVQMMEBEGVQMlAAEUAAMEAAEAAwEFBAAGBwcCAQoEBBQElgCWBAQDBQQBBAIHBgIYERECVQK6ARsABgEbQA0AACAAMABgAAQAAAkIGRESOS9dGO3tKxI5Ehc5XQA/PDwQPD88Ejk5hwguKysrhwV9xIcuGCsrK4d9xAArMTABXV0rAF0rKwEBIwEDMwEjAf/+174Bip6+AiS+Axr85gQSAaj6RgD//wCg/mkD+gQmAgYAlwAA//8AGgAAA+gEJgIGAFkAAAABAFz+UQNwBdMAKAEMQDEJIQkmRg9WD4MPBQUKNgvmCwOJBIcGiguLDIcjmybGC9YMCGkEZwZrC2oeeQx5HgYhuP/oswkLNAy4/9BAIR0gNCIIHKAJAQkJHSgYHBcPEBwdCgIcKAEYFxcUHwUkJbj/7bQPEAZVJbj/+LQNDQZVJbj/9EAbDAwGVW8lfyUCJSUfGxwUChAQAlUUFA0NAlUUuP/ltA8QBlUUuP/ltw0NBlUfFAEUuP/AQCEJCzQUFIAIAQgIAE4qDSQfIAwMBlUfCAsLBlUfH48fAh+5AlQAKRD2XSsr7RD2Mi9dMy8rXSsrKyvtETMvXSsrK+0REjkvMwA/7T/tP+0REjkvXf05MTAAKytdXXEBXQEVIyIGFRQhMxUiBgYVFBYXHgIVFAYHNzY2NTQnJBE0NjcmJjU0NjMDBJOkkwErk4TEnXG6eHBK2rkuY1Or/ka3jo6B5dsF05VhWqyVTsqAYJYVDj18SIS5AqcHWC5mEzABdpn0PRKzXYLBAP//AET/6AQnBD4CBgBSAAAAAgCD/mkERQQ+AA0AGQEMQGQHAgFrC8oD2QP3AvgIBWoYahlgG4AbqAa5BQZfGWIDagZsCWIPbBUGUANfBV8JUA9fFQU5EDUSNxY5GEkQRhJGFkkYVgNXBVgJWQxoDHgMigwPDAoADhQcCgsOHAQHERENFyQHuP/AQAokJTQHDg8PAlUHuP/utA8PBlUHuP/uQBgLDQZVMAdgB4AHAwAHEAcgBwMHMd8bARu4/8BACh4jNDAbARsNJQC4//xACw4QAlUABAsMAlUAuP/8QAsPEAZVAAQLCwZVALj/wEASMzY08AABAAAgANAA4AAEAE4aEPZdcSsrKysr7RBxK132XV0rKysr7REzLwA/7T/tPxE5MTAAXQFdXV1dcRMREBIzMgAVFAAjIicRASIGFRQWMzI2NTQmg+7j4gEP/v3TxXMBI4OenIaHqrb+aQOFAS4BIv7M9vf+y33+BAVAydvFxMvD3sEAAAEAVv5RA8YEPgAiAO5ASycIKR82CDkgRghKIAaGIJgfqAWoH7cgxyDYBNkfCCYgNyBHIHYghgQFCRwbFRwQDwMcIQcTEhINHgEAABgkDQgQEAJVDQQQEAZVDbj//LQPDwZVDbj/+LQNDQZVDbj/8LQMDAZVDbj/wEATJCU0MA0BAA0QDSANAw0x3yQBJLj/wEA6HiM0MCQBJAYkHggODgJVHgwNDQJVHgwMDAJVHhALCwJVHgQPEAZVHhMLDQZVHkAkJTQfHj8eAh4xIxD2XSsrKysrKyvtEHErXfZdXSsrKysrK+0zLzMREjkvMwA/7T/tL+0xMABdXQFdAQcmIyIGFRQWFx4CFRQGIyInNxYzMjY1NCYnJiY1NAAhMgPGKnBwye6Dwot8Rt6mQ1UsOitgbk9+3tkBWQEkewQcliP5qHSzMyVBc0uJsA6lDFM7NjkbL/yu8QFkAAABAIj/6APaBCYAEwDyQDlEA0QHVANTB5oRlhIGHxVQBFsHYwRqB3MEewfAFdAV4BX/FQtwFbAVAvAVAQUcDwsKAAYJCgwKJQu4//RAERAQAlULCg8PAlULGg4OAlULuP/0QBcNDQJVCwwMDAJVCxgQEAZVCwgPDwZVC7j/+EAXDA0GVR8LcAuwC8AL/wsFC04VAQIlABO4//i0EBACVRO4//hACw4OAlUTBAwMAlUTuP/4QAsPDwZVEwQLCwZVE7j/wEASMzY08BMBABMgE9AT4BMEE04UEPZdcSsrKysrKzz9PBD0XSsrKysrKysr7TwQPAA/PD/tMTABcV1dAHETMxEUFjMyNjY1ETMRFAYjIiYmNYi0kmJReC6z7MGVw00EJv2Lo5JceG8CZ/2S7eOFrpYAAAEAEf5pBCAEJgALASFAdTUCAaECzQjwAv8IBDACPwgCBQUKCxUFGgs4C3cIBqgDpgi2BbkLyQLHBccIyAvXCPgD9wkLBwsPDRcLIA05BTcLBgUBBgQJCAkEAAcLAAcKAwIBBgoDAggACQEABwcICRECVQcLDREGVQclBgEUBgYBAwQJCbj/+LQJEQJVCbj/9UAoDREGVQklCgMUCgoDBAMDAQEABgkHBwYGCg4HCQYKAwEABJoGAI8KBrj/9bQQEAJVBrj/9UAeCgoCVQ8GHwYgBgMGmg0KCxERAlUAChAKIAoDCkkMGRDmXSsQ5l0rKxgQ5BDkETk5ERI5OQA/PBA8EDw/PBA8EDyHBS4rKyuHfcSHLhgrKyuHfcQAERI5OQ8PDw8xMAFdcXIAXXFyEzMBATMBASMBASMBMMQBJAEuxv56AZrN/sX+wskBmQQm/bQCTP0s/RcCZf2bAuMAAQB6/mkFOQQmABwBEre0E+Ae/x4DC7j/4LMLDjQEuP/gQCMLDjQSICQmNLwayhoCeRJ5GQIJBhQGkhcLFg4OBgcGAAYIFbsCMAAHABb//rcNDQJVFhYcDrgCMLYPKA8PAlUPuP/qQAsNDQJVDwwMDAJVD7j/9kAhDA0GVQ8UDw8GVQ8fEBAGVQ9AMjY0/w8B3w//DwIPTh4CugIwABz/+kALEBACVRwECwwCVRy4//20CwsGVRy4//O0Dw8GVRy4/8BAKDM2NPAcAQAcIBzQHOAcBBxOHSAebx6AHrAe4B4FUB6AHpAewB7vHgVdcRD0XXErKysrK+0Q9l1xKysrKysrK+0SOS8rPP08AD8/Pz8/7TwQPDEwAF1xKysrAV0TMxEUFhYXETMRPgI1ETMRFAYGBxEjES4DNXqzMJuItIOaNbNN6s60hciLLgQm/fSTmmcHA6f8WQdimZkCDP360MqXB/6BAX8ERJWktwAAAQBX/+gF6AQmACQBVUBJACYoHiAmOR5IHkAmUwVcEl0dUx9kBWsSbh1hH3YYeh11H3okhRiJJK8m8CYWACYBHgsGEUgcBkggAAsBCwsgABYGAAYcCyALFrsCMAAXAAECMEATABcXGRQAAAMjHgANEA0CUA0BDbgCMEASCggPDwZVCgojFEAZChAQAlUZuP/2QAsMDAJVGQoLCwJVGbj/87QPDwZVGbj/6bQMDQZVGbj/wEApJCU0IBkwGQIAGQEAGRAZIBkwGa8Z8BkGABkQGSAZQBlgGQUZMd8mASa4/8BACh4jNDAmASYDQCO4//ZACwsLAlUjBRAQBlUjuP/7QB0PDwZVIxgNDQZVIxsMDAZVI0AkJTQfIz8jAiMxJRD2XSsrKysrK+0QcStd9l1dcnErKysrKyvtEjkvK+1xcjkREjkvERI5LxDtEO0APz8/PxESOS9dEO0Q7RESOTEwAXJdEzMCFRQWMzI2NjURMxEUFhYzMjY1NAMzEhEQAiMiJwYjIgI1EPWulYBjQHAlsyVxQGKAlK2e26riYWLis9IEJv6346/WZIx+ATf+yXuQY9Ww4wFJ/uf++P73/uzv7wEi+wEI////0QAAAgIFwwImAhoAAAEGAI6UAAAotQIBAQICC7kCIgApACsBsQYCQ1RYtQAFCgECQSsbtAgCAEgrK1k1Nf//AIj/6APaBcMCJgIjAAABBwCOAPAAAAAdQA8CAXAUAQAUGwALQQECAhS5AiIAKQArAStdNTQA//8ARP/oBCcFwgImAFIAAAEHAI0A9AAAABtADgLgHfAdAh0EAEgrAgEduQIiACkAKwErXTUA//8AiP/oA9oFwgImAiMAAAEHAI0A3AAAAAuyAQEUuQIiACkAKwD//wBX/+gF6AXCAiYCJgAAAQcAjQHgAAAAFkAKAQAlJwsMQQEBJbkCIgApACsBKzX//wCiAAAE6AbhAiYAKAAAAQcAjgFeAR4ADLMBAgIMuQIhACkAKwABADL/5waZBboAHQEYQCpmBHYEhwQDIggZDAQGFw9dDkoMBh4XFxsCHR4AAhsIER4MCQ9KDg4UAwK4AoizGxQmCbj/0LQNDQJVCbj/8rQLCwJVCbj/9rQLCwZVCbj/4rQMDAZVCbj/7EAMDQ0GVQk3HxsgGhoDugKIAAD/4LQQEAJVALj/9LQPDwJVALj/1rQNDQJVALj/6rQMDAJVALj/+rQLCwJVALj/6rQLCwZVALj/9rQMDAZVALj/1rQNDQZVALj/8bYPEAZVAFQeEPYrKysrKysrKyv9PBDtEPYrKysrK+0Q7RESOS/kAD/tPz/9PBI5L+0Q/e0REjkSOTEwQ3lAGBIWBwsSCxQ2ARYHFDYBEwoRNgAVCBc2ASsrASsrgYEAXRMhFSERNjMyABUUAiMiJzcWMzI2NTQmIyIHESMRITIEkv4Y/bvpARzp4WiDH0xSl5uzvKLmwv4YBbqt/jhj/ubLsv7WIaQlsIaOu179WAUN//8AoQAABFUHLAImAj0AAAEHAI0A+wFqABVACQEGA6dIKwEBBrkCIQApACsBKzUAAAEAZP/nBXYF0wAaAM9AhakWtAa5FgMbBisGOwZdGW8ZfxmxCQcpAykJKQs1AzsGNQk7FkcDSwZFCUsWVgNUCVYLVBNqC3cDeQZ4C4cDiQyoFrUGyAgYB+MgCGAIcAiACAQICAoRFVQUFAoRGh4CAgoXHhEDBR4KCQEBCAIVJhQHJhRiLwgBnwgBCBogHAEcGi0CJg24//lAExAQBlUNCgsLBlUgDQENGRtjXBgrEPZdKyv95BBd9F1x5O0Q7RESOS8AP+0/7RI5L+0REjkv5BESOS9d5DEwAV1xAF0BFSEWEjMgExcCISAAEzQSJDMyBBcHAiEiAgcDWf3fC/zFAV5Zu3/+G/6l/q0LlwE42OQBMza+U/7D1vMMA0ut9/7jAXQx/hoBvwFHyAFK1OLJMgEz/v7cAP//AFz/5wTrBdMCBgA2AAD//wC/AAABgQW6AgYALAAA//8ABAAAAjUG4QImACwAAAEHAI7/xwEeACi1AgEBAgILuQIhACkAKwGxBgJDVFi1AAUKAQJBKxu0CAIASCsrWTU1//8AN//nA2EFugIGAC0AAAACAA3/5wgpBboAGwAmARiyPQgVuAEOQBEUYhIBHiYmCw0eGwIcHgsIF7gCSEAeEgkLIAAcChAQAlUcJA8PAlUcHg0NAlUcCgsLBlUcuP/2QAsMDAZVHCANDQZVHLj/6EATDg8GVRwZEBAGVYAcARwcGiEmBrj/9bQMDQZVBrj/wEATJCU0MAYBAAYQBiAGAwYxKA4gGrj/8EALEBACVRoKDQ0CVRq4AjpAERVKFAwLDAZVFAIQEAZVFC0nEPYrK+T0KyvtEPZdXSsr7RI5L10rKysrKysrKzztAD/tP+0/7RI5L+0Q/e0xMEN5QCwYJAMRECYIJh8lBCUjJhgRGiwBHgkhNgEkAyE2ARkPFywAIAcdNgAiBSU2ASsrKwErKysrKysrK4GBAREhMhYWFRQGBiMhESERFAYGIyInNxYzMjY1EQEhMjY2NTQmJiMhBJoBXvPcYo3Jvv3D/e4rimpAWiEwIkJCA5YBhGp6V12dwf78Bbr9jm/GaInVTQUN/Q3m1ncYrBRjuAQI+uspd2BbeyYAAAIApAAAB8kFugAUAB8BREAvKwgMHxMBHh8fCxQRAhUeDgsIFAsgABUgDxACVRUGDQ0CVRUgDAwCVRUMCwsGVRW4//RACwwMBlUVGA0NBlUVuP/iQCIPDwZVFRAQEAZVFRUPGiYGHg0NAlUGFgwMAlUGDAsLAlUGuP/1tAsLBlUGuP/ytAwMBlUGuP/0tA0NBlUGuP/AQBokJTQwBgEABhAGIAYDBjEhEQ4gDyAQEAJVD7j/9rQPDwJVD7j/9rQNDQJVD7j/+rQMDAJVD7j/+rQMDAZVD7j/9LQNDQZVD7j/+LQPDwZVD7j//LYQEAZVD10gEPYrKysrKysrK/08EPRdXSsrKysrKyvtEjkvKysrKysrKys8/TwAPzztPzwSOS/9PBA8MTBDeUAeAx0IJhglBCUcJhcJGjYBHQMaNgEZBxY2ABsFHjYBKysBKysrKysrgQERITIWFhUUBgYjIREhESMRMxEhERMhMjY2NTQmJiMjBDoBRtHpj5fJwP3P/e7CwgISwgFrfHtdUqfa7AW6/Y5GzomP2EQCof1fBbr9jgJy+uskeWNVei0AAQAxAAAGeAW6ABcBOUANZgR3BIcEAxkIEwwEBrgCSEAMEREMAhceAAIUDAgCuAKIsxUMIAq4/9RAERAQAlUKCg8PAlUKFA0NAlUKuP/SQAsMDQJVChMQEAZVCrj/67QNDQZVCrj/4LQMDAZVCrj/1kASCwsGVQpAMzY0/woBwAoBCk4ZuP/AQBk0NjSwGfAZAhAZcBmgGbAZ/xkFGRUgFBQDugKIAAD/4LQQEAJVALj/2rQNDQJVALj/7rQMDAJVALj//kALCwsCVQAJEBAGVQC4//e0Dw8GVQC4/9m0DQ0GVQC4//RAEAwMBlUABAsLBlUAAAEA4xgQ9nErKysrKysrKyv9PBDtEF1xK/ZdcSsrKysrKysrK+0Q7QA/PD/9PBI5L+05EjkxMEN5QBAHEAglDyYQBw02AQ4JETYBKwErKyuBAF0TIRUhESQzMhYWFREjETQmJiMiBREjESExBJX+FwERpJ/sW8I2j2qh/vfC/hYFuq3+PV6B4MX+fgF7kJ9aXP1YBQ0A//8AoQAABKIHLAImAkQAAAEHAI0BLwFqAA6yAQEiugIhACkBZIUAK///AAr/7AUPBxcCJgJNAAABBwDZAWQBXwAWQAoBABgSAARBAQEVuQIhACkAKwErNQABAKD+aQUhBboACwEtQBkQDQEPDSANgA3gDQQJBgICBx4EBAsICCALuP/kQAsPDwJVCxAMDAJVC7j/7UAyCwsGVQsCDAwGVQsKDQ0GVQsZDw8GVUALYAsCIAtPC2ALkAugC8ALBiALYAvAC/ALBAu4AhRACgIHIAQkEBACVQS4/+e0Dw8CVQS4//60DQ0CVQS4//xAGQwMAlUEEAsLAlUEDgsLBlVABI8EAl8EAQS4AhRADwEGDQ0CVQEeAgwPDwJVArj/8rQNDQJVArj/8LQLCwJVArj/9rQLCwZVArj/+rQMDAZVArj/+LQNDQZVArj/9kAWDw8GVQACUAKgArAC8AIFUAIBkAIBAi9dcXIrKysrKysr/Sv9XXErKysrKyvtEP1dcXIrKysrKyvtAD88EO0vPzwxMAFdcSERIxEhETMRIREzEQM3rf4WwgL8w/5pAZcFuvrzBQ36Rv////0AAAVZBboCBgAkAAAAAgCnAAAE+AW6AA4AGADkQBUoCAQeGBgOAx4AAg8eDggCAgATJgm4//G0CwwGVQm4//hACw0NBlUJBBAQBlUJuP/AQBMkJTQwCQEACRAJIAkDCTHfGgEauP/AQBEeIzQwGgEaAw8gACAQEAJVALj/9rQPDwJVALj/9rQNDQJVALj/+rQMDAJVALj/9rQMDAZVALj/7rQNDQZVALj/9rYPEAZVAF0ZEPYrKysrKysr/TwQcStd9l1dKysrK+0SOS8AP+0/7RI5L/0xMEN5QBwGFgsmByUVJhEMEzYBFgYTNgESChA2ABQIFzYBKysBKysrKyuBEyEVIREhMhYWFRQGBiMhNyEyNjU0JiYjIacDt/0LAV7C5YpjxOz9wsIBhJ2dWqDB/v0Fuq3+PErNiG/BeqWAgFt6KAD//wCWAAAE6QW6AgYAJQAAAAEAoQAABFUFugAFAHtAFwIDHgEAAgUIARoHAwQgBQUAJBAQAlUAuP/ytA8PAlUAuP/qtA0NAlUAuP/+tAwMAlUAuP/2tBAQBlUAuP/0tA8PBlUAuP/ptA0NBlUAuP/2QAoMDAZVABkGO44YK04Q9CsrKysrKysrPE0Q/TxOEOYAPz88Tf08MTATIRUhESOhA7T9DsIFuq368wACAAD+qgUjBboADQAUARJAFQ8WLxYCDx4AAgUJAhMDCh4HCA0eELj/4LQQEAJVELj/8rQNDQJVELj/6EALCwsCVRAKDQ0GVRC4//i0Dw8GVRC4//JACxAQBlUQEAMJFCACuP/+tAwMAlUCuP/otAsLAlUCuP/2tAsMBlUCuAJdsgUeA7j/4EARDw8CVQMiDQ0CVQMKCwwGVQO4/9i0DQ0GVQO4//BALg8PBlUDChAQBlUJDwMBOh8D3wMCDwOPAwIPA58DrwO/A/8DBQNLFhNlCwsIHgm4//ZAEAsNBlUJChAQBlUJHwkBCRUQPHIQKyvtOS/tEPZdcXJeXV4rKysrKyvt9CsrK+0REjkvKysrKysr7QA//Tw8PC88P+0xMAFdASERMxEjESERIxEzEhElIRUUAgchASMDfISt/DetcrECuv4BQ2ICpAW6+vP9/QFW/qoCAwELAywpS7v9d9H//wCiAAAE6AW6AgYAKAAAAAEABwAAB1sFuwA9AaZApY0YhBqLJoIoBC8/AQ8/Lz9AP3cUcD+HFIA/lhSWF5kpmSzgPwwoHCgjORI4HDgjOC5JLmgbaCSILApJEkkcSSN2F3YpeCwGJxk4OjogLC4ULCwuJSYmICcoFCcnKAUDAyAUEhQUFBIbGhogGRgUGRkYOjgDBQQIPCwuFBIEMSoWKjwlKBsYBCElKCAnGxoYAxkDBRIUFgMfCy4sKgM6OCAyATwePLgCXbchIT0mGiAIMbsCSAA1AAsBDkAWNQh7PQKfMgEyLScaCwsGVU8njycCJ7gBcrYfkAsBCy0ZuP/wQAoLCwZVQBmAGQIZuAFyQAwgAB9lPSAMEBACVSC4//i0Dw8CVSC4//60DAwCVSC4//q0CwsGVSC4//5ADQ8PBlXwIAFwIOAgAiAvXXErKysrKzz9PBD9XSvkcRD9XSvkcQA/9DztEO0/PDwSOS/tPBA8ARESOTkXORESFzk5OREXORESOTkAERc5Ejk5ERIXORESFzmHBS4rDn0QxIcOLhgrDn0QxIcFLhgrDn0QxIcOLhgrDn0QxAAuLjEwAF1dAV1dcQERMjY3PgIzMhcVIicmIyIHBgcGBgcWFwEjAyYmIxEjESIGBwcDIwE2NyYmJyYnJiMHNTYzMhYWFxYWFxEEFY9rUz1PkldfFwkdIAddLS47QF5ZkIcBLvD1YoZ5x2CTYgz18QEuio5PZEU/LS1ZTgtlYI1QP1RpkAW6/X5pwpB3UQKoAQEtLZOfcyYo3v4YAY6egv1SAq5lpxT+cgHo3ycga62dKCgCqAJPd5LFZAICggAAAQBO/+cEggXTACYBFkBTThnEAwIGHzkORh5lIXUepR8GBxlLHloedAMEwAHBFssXyBgEKAgfC0AfUB9gH3AfgB8FHx0MF+M/GE8YXxh/GAQYGCUaAeMwAEAAUAADAAAaJQy4AkizCgolE7gCSLIaAwS4AkhAFCUJCwsXECYdEAsLBlUdEA0NBlUduP/nQA4PEAZVnx2vHQIdSwcmIrj/7rQMDAJVIrj/7UARCwwGVSAiASJcKBcmGGIBJgC5ATEAJxD07fTtEPZdKyvt9F0rKyvtETkvAD/tP+0SOS/tERI5L13kERI5L13kARESOV0AEjkxMEN5QBwjJBscERIFBhIbEDYBBSQHNgERHBM2AQYjBDYAKysBKyuBgYGBAHFdAV1xEzcWFjMyNjU0JiMjNTI2NjU0JiMiBgYVJxIhMhYVFAcWFhUUBCMgTrkVt5easryiXYaObZV/b508ukUBv9f8wnCX/tvy/mABnjBr1p5weY+pH39RYI5vty0qAdPvoM1xH7+Fvf8AAAEAoQAABSAFugAJATpACi8LAQcYDBwCVQK4/+hAFAwcAlU3AjgHVgJZB2kHdgJ5BwcCuP/0QCIQEAZVB0wPEAZVBzwMDAZVB04LCwZVAwcICCACAxQCAgMCuP/gtAsLBlUHuP/MQBQLCwZVAgcIAwECCAYIAwgGAgcgBLj/7LQPDwJVBLj/7kALDQ0CVQQSDAwCVQS4//y0CwsGVQS4//5AGQwNBlUECA8PBlUEOQ8LAQsCIAAkEBACVQC4//a0Dw8CVQC4//q0DQ0CVQC4//y0DAwCVQC4//a0CwsGVQC4//q0DA0GVQC4//e2Dw8GVQA5ChD2KysrKysrK+0QXfYrKysrKyvtERI5OQA/PD88Ejk5KyuHBS4rh33EsQYCQ1RYQAwGAg8HFQJbB4oHBQK4/+CyDBE0ACtdWSsrKysxMABdKysBXRMzEQEzESMRASOhsAMMw7D888IFuvt3BIn6RgSG+3oA//8AoQAABSAHFwImAkIAAAEHANkBeAFfABZACgEAEQsABEEBAQ65AiEAKQArASs1AAEAoQAABKIFuwAhAQlAQ4sZhBsCCgcdBywHLyN2GIkHjR4HOhM6FTgdAwYEBCUVExQVFRMcGxsICxAGVRsgGhkUGhoZGRwfGwYECQITFRAXFwK4Al2zHx8hELgCSEAhCXsAAhobGyEIGxwZAxoGBBcVEwMgkAsBCy0aLSMBICAhuP/qtBAQAlUhuP/2tA8PAlUhuP/6tA0NAlUhuP/+tAwMAlUhuP/4tAsLBlUhuP/8tAwMBlUhuP/0tA0NBlUhuP/0tg8PBlUhOSIQ9isrKysrKysr/TwQ9uRxERc5OTkSFzkAPzwQPD/07RI5L+0ZOS8SOTkREjk5ERI5OYcFLhgrKw59EMSHDi4YKw59EMQxMABdAV1xEzMRMjY3PgIzMhcVIicmIyIHBgcGBgcWFwEjAyYmIxEjocKFbFQ9T5JYcAYKHSAHXS0uO0pmR46KAS7x9WWIbMIFuv1+Z8SQd1ECqAEBLS2TumEdJ9/+GAGOpXv9UgAAAQAS/+cEnwW6ABIA77IZCA24AQ63DGIKBR4AAg+4AkhADQoJAwgDIAIGEBACVQK4/+xAEQ8PAlUCJg0NAlUCBgwMAlUCuP/otAsLAlUCuP/qQBkLCwZVAggNDQZVAggPDwZVAl2AFAEUBiASuP/ktBAQAlUSuP/4QBEPDwJVEgINDQJVEggMDAJVErj/5EALCwsCVRIaCwsGVRK4AjpACQ1KDAYMDAZVDLj/+LQNDQZVDLj/+LYPDwZVDGITEPYrKyvk9CsrKysrK+0QXfYrKysrKysrK/0APz/tP+0Q/e0xMEN5QBAQEQcJCCYQCRIsAREHDywAKwErK4GBASERIxEhERQGBiMiJzcWMzI2NQEJA5bC/e4rimpAWiEwIkJCBbr6RgUN/Q3m1ncYrBRjuAD//wCYAAAGDwW6AgYAMAAA//8ApAAABSIFugIGACsAAP//AGP/5wXdBdQCBgAyAAAAAQCgAAAFIQW6AAcAtLkACf/AQA0TFTQDBwgFHgACAyACuP/utA8PAlUCuP/uQAsNDQJVAhAMDAJVArj/4LQLCwZVArj//kAVDA0GVQI5DwmACQIJBiAHIBAQAlUHuP/2tA8PAlUHuP/2tA0NAlUHuP/6QAsMDAJVBwoLCwZVB7j/9rcMDQZVIAcBB7j/wEASExU0B10IIAkBIAlQCWAJcAkEXXEQ9itdKysrKysr7RBd9isrKysr7QA/7T88MTABKxMhESMRIREjoASBw/0EwgW6+kYFDfrzAP//AJ4AAAT9BboCBgAzAAD//wBm/+cFdgXTAgYAJgAA//8AMAAABLoFugIGADcAAAABAAr/7AUPBboAEAC3QBdmAgGbAgFoAgGcAZMDAgIQAgEQAwECArj/9EARDQ0GVQIeEAAUEAIDEAADAgK4//RAIA0NBlUCHgUEFAUCAQUEAhAFAwgAC10KSggEAwMBAAINuAJIQBAICRABAAUDBAIgCgEKkwAEugFcAAABXLMCAhIRGRESOS8Y7e0ZEORdERI5ORI5OQAYP+0/PDwQPBD07RESFzmHCC4rKwV9EMSHCC4YKysFfRDEhwgQxDEwAXJdAHJdEzMBATMBBgYjIic1FjMyNjcKxAHeAaLB/dpnhHtLbU5XR2c+Bbr8fgOC+4zWhCOmLVuiAAMAUgAABcIFxgARABgAHwEHQEkgIQEQIU8hcCHQIeAhBSUVKxcrGyUdBBJ7GQkME3sfHjAMAW8MfwwCDJMLGR4APwMBcAMBA5MBAgsIHCYPEg8PBlUPFA0NBlUPuP/2QBULDAZVDw8/DwIfD28Pfw+PD+8PBQ+4AcOzChYmBrj/9LQPDwZVBrj/9kAbDQ0GVQYKCwwGVQAGMAYCEAZgBnAGgAbgBgUGuAHDQA0LEwoZCwJACgEKHgELuP/8QAsPDwJVCwoPDwZVC7j/+kATDQ0GVQALkAvACwMgC08LsAsDCy9dcisrKzz9cTwQPBA8EP1dcSsrK+0Q/V1xKysr7QA/P/RdcTztEPRdcf3kEDwQ5DEwAF0BXXEBNTMVBAAVFAAFFSM1JAA1NAAFETY2NTQmJQYGFRQWFwKwtgEYAUT+xv7etv78/qYBWQG7vNjU/oq14N24BQq8vA/+zeTf/sgQvb0KASn09QEmm/0ACcivrMkKCMaxr8gI//8ACQAABUkFugIGADsAAAABAJ/+aQWmBboACwD5QBcgDeANAgQBAgkHAh4LCAMgBgAPDwJVBrj/8rQNDQJVBrj/9rQMDAJVBrj/1LQQEAZVBrj/9kAOCwsGVWAGgAYCBgYJHge4/+pACw8PAlUHGAwMAlUHuP/dtA8PBlUHuP/dQB8NDQZVBwYMDAZVIAefB68HvwcEB0sNAiALJBAQAlULuP/2tA8PAlULuP/6tA0NAlULuP/+tAwMAlULuP/+tBAQBlULuP/0tA8PBlULuP/0tA0NBlULuP/6QBAMDAZVCwYLCwZVIAsBCzkMEPZdKysrKysrKysr7RD2XSsrKysr/TkvXSsrKysr7QA//TwvPzwxMAFdEzMRIREzETMRIxEhn8IC/MOGrPulBbr68wUN+vP9vAGXAAEAVwAABLQFugASAPRAC2kCeQKJAgMWCAIEuAJIQAsODhEKAgEIEQEgALj/+LQQEAJVALj/5EALDw8CVQAeDQ0CVQC4//60DAwCVQC4/+hACwsLAlUABg0NBlUAuP/8QCsMDAZVAF2AFAEUCyAIChAQAlUIFA8PAlUIFg0NAlUIGgwMAlUIEgsLAlUIuP/yQBoQEAZVCA4PDwZVCAwNDQZVCBgMDAZVIAgBCLj/wEASExU0CF0TIBQBIBRQFGAUcBQEXXEQ9itdKysrKysrKysr7RBd9isrKysrKyv9PAA/Pzw5L+05MTBDeUAOBQ0GJQ0FCzYADAcONgArASsrgQBdISMRBCMiJiY1ETMRFBYzMjcRMwS0wv77xJnqT8Kve83iwgJPYY/csgGv/mPwl1sCyQAAAQChAAAGtQW6AAsBIkBPDw1ADXANgA2/DcAN7w0HBwIeCwgEBAEQAiALKhAQAlULDg8PAlULBg0NAlULEAwMAlULCgsLAlULGg8PBlULDwwNBlUPCwFPC38LjwsDC7gBbbMGByAKuP/YtBAQAlUKuP/utA8PAlUKuP/+tA0NAlUKuP/wtAwMAlUKuP/gtAsLAlUKuP/mtA8PBlUKuP/uQBIMDQZVUAoBAAoBQApwCoAKAwq4AW1ACQYgAxAQEAJVA7j/9rQPDwJVA7j//kALDAwCVQMHEBAGVQO4//y0Dw8GVQO4//5AGAsNBlVAA5ADAiADcAOgA8AD7wMFA3ANAV0vXXIrKysrKyvt/V1xcisrKysrKyvtEP1dcSsrKysrKyvtAD88EDwv/TwxMAFdEzMRIREzESERMxEhocIB58IB58L57AW6+vMFDfrzBQ36RgABAKH+aQc6BboADwFZQCVAEW8RcBGAEaARBQgEBAECDQYLAh4PCAwekA6gDrAOAw4OByAKuP/YtBAQAlUKuP/utA8PAlUKuP/+tA0NAlUKuP/wtAwMAlUKuP/gtAsLAlUKuP/utBAQBlUKuP/TtA8PBlUKuP/2QBwMDQZVCgoLCwZVAApQCgIAChAKAkAKcAqACgMKuAFtQDQDAiAPKhAQAlUPDg8PAlUPBg0NAlUPEAwMAlUPCgsLAlUPDhAQBlUPKA8PBlUPCgwMBlUPuP/2QA8LCwZVDw8BTw9/D48PAw+4AW1ACQYgAxAQEAJVA7j/9rQPDwJVA7j//rQMDAJVA7j/8rQQEAZVA7j/6EAeDw8GVQMGCw0GVUADAe8DAQADIANvA3ADoAPvAwYDL11xcisrKysrK/39XXErKysrKysrKyvtEP1dcXIrKysrKysrKyv9OS9d7QA//Tw8Lz88EDwxMAFdEzMRIREzESERMxEzESMRIaHCAefCAefCha36FAW6+vMFDfrzBQ368/28AZcAAAIAAAAABg8FugAMABYAy0AeIggCHhYWCgweAAINHgoIESYGFBAQAlUGDA0NAlUGuP/2tAsNBlUGuP/AQB0kJTQwBgEABhAGIAYDBjEgGAEYAQ0gChgQEAJVCrj/9kAXDw8CVQoGDQ0CVQoUDAwCVQoaCwsCVQq4/+5ACwsLBlUKCgwNBlUKuP/uQAkPEAZVCu0AABcQPBD0KysrKysrKyv9PBBd9l1dKysrK+0AP+0/7RI5L/0xMEN5QBgEFBMmDwgRNgEUBBE2ARAHDjYAEgUVNgErKwErKyuBESERISASFRQGISERIQEhMjY1NCYmIyECgAFfAVnX+f7V/dP+QgKAAWO3pGGguv79Bbr9jv8AoLjwBQ37mHuGW30jAAADAKgAAAZrBboACgAUABgBNEASIggCHhQUChUBAgseGAoIDyYGuP/qtA8PAlUGuP/ctA0NAlUGuP/OtAwMAlUGuP/iQCcNDQZVBgMPDwZVUAYBEAYgBsAG0AbgBgVABmAGgAavBgQGBgoYIBa4/9y0EBACVRa4/8xAEQ8PAlUWLg0NAlUWFgwMAlUWuP/ptAsLBlUWuP/4QBEMDAZVFggNDQZVFgoPDwZVFrgBDkAWIBowGkAaUBqAGgUaAQsgCiAQEAJVCrj/9rQPDwJVCrj/9rQNDQJVCrj/+rQMDAJVCrj/+LQNDQZVCrj/+LYPEAZVCl0ZEPYrKysrKyv9PBBd9isrKysrKysr/RE5L11xcisrKysr7QA/PO0/PBI5L+0xMEN5QBgEEhEmDQgPNgESBA82AQ4HDDYAEAUTNgErKwErKyuBEzMRISAWFRQGISE3ITI2NTQmJiMhATMRI6jCAV4BWNno/sX90sIBY7elZJ65/vwEP8LCBbr9jv6hqv+le4dcfCIDGfpGAAACAKUAAAT2BboACwAVAMVAFiUIAh4VFQsAAgweCwgQJgcWEBACVQe4//C0DAwCVQe4//O0Cw0GVQe4/8BAIyQlNDAHAQAHEAcgBwMHMUAXgBeQF68XBBcBDCALIBAQAlULuP/2tA8PAlULuP/2tA0NAlULuP/6tAwMAlULuP/2tAwNBlULuP/ytg8QBlULXRYQ9isrKysrK/08EF32XV0rKysr7QA/7T8SOS/9MTBDeUAaBBMFJRImDgkQNgETBBA2AQ8IDTYAEQYUNgErKwErKysrgRMzESEyFhYVFAIhITchMjY1NCYmIyGlwgFe9dxg6P7E/dPCAWPYg1+evf78Bbr9jnLEaKr/AKWZbFh7JAD//wBK/+cFXAXTAVMCLwXAAADAAEAAAB1ACQANDScQEAJVDbj/3bYNDQJVDVwcThD2KysRNQAAAgCk/+cHrQXTABIAHgG8QDYGFQkXCRsGHRUVGxcbGxUdJQcmCysNJhUqFyobJR1GFEgYSRpHHlAVWxdcG1Mdew6LDpwEGg64/+i0EBECVQ64/+i0DQ4CVQ64/+i0CwsCVQS4/+i0EBECVQS4/+i0DQ4CVQS4/+hAMQsLAlUCHhBAEBECVRBADQ4CVRBACwsCVRBACwsGVRAQEgAcHgYDAAISCBYeDAkZJgm4//a0EBACVQm4//K0Dw8CVQm4/+60DQ0CVQm4//C0DAwCVQm4/+60CwsCVQm4//60CwsGVQm4//a0DQ0GVQm4//hADw8PBlUJXIAgASATJg97A7j/1kALEBACVQMUDw8CVQO4//xACw0NAlUDBAwMAlUDuP/oQBELCwJVAxoLCwZVAwoMDAZVA7j/+EAdDQ0GVQMaDw8GVSADfwOPAwMD2gERIBIgEBACVRK4//a0Dw8CVRK4//a0DQ0CVRK4//q0DAwCVRK4//i0DxAGVRK4//a0DQ0GVRK4//q2DAwGVRJdHxD2KysrKysrK/089l0rKysrKysrKyv07RBd9CsrKysrKysr7QA/7T8/P+0REjkvKysrK+0xMCsrKysrKwFdEzMRIRIAISAAERAAISAAAyERIwEQADMyEhEQAiMiAqTCARoVAXABEAEfAXn+iP7b/vb+nR/+4sICnwEA0NX++tXZ+wW6/W4BOAFz/mz+pv6Y/moBXwE2/YQC1v7q/s0BNAEhARIBO/7BAP//ABoAAAUmBboBUwA1BccAAMAAQAAAiLkAD//0tAsQBlUQuP/0QA4LEAZVAQAAACIQEAJVALj/7rQPDwJVALj/8kALDQ0CVQAQDAwCVQC4//a0CwsCVQC4//y0EBAGVQC4//BACw8PBlUAAg0NBlUAuP/8tAwMBlUAuP/yQA0LCwZVIAABIAABAF0kARD2XV0rKysrKysrKysrETU1Kyv//wBK/+gEHAQ+AgYARAAAAAIAW//oBEQF3QAcACgBE0BFOQo1JTknSQpGJUgnWQ5ZEVUVWx9RJVwnDD0YAQkgJgkjFwAzAY8FHBoAIBwMByYcEwsAkgGaHSQqQA0NAlUqQAsLAlUPuP/wQBEQEAJVDwoPDwJVDwoNDQJVD7j/9kALDAwCVQ8ECwsCVQ+4//C0Cw0GVQ+4//i0Dw8GVQ+4/8BAECQlNDAPAQAPEA8gDwMPMSq4/8BAQx4jNDAqASqAKgEjJBcMDg8CVRcSDQ0CVRcMDAwCVRccCwsCVRcSCwsGVRcWDA0GVRcOEBAGVRdAJCU0Hxc/FwIXMSkQ9l0rKysrKysrK+1dEHEr9l1dKysrKysrKysrK+307QA/7T/tP+305AEREjkAERI5MTAAcQFdARcOAiMiBgYHNjYzMgAVFAYGIyImAhEQACEyNgM0JiMiBhUUFjMyNgORnwtJc6jfokcERLZy0QESir2jvdJwAR0BKLgyAp2PlaKzg4anBd0Ca1QYVr2VZWX+4fW67oKtAQ4BTwGlASQM/FCm1OC7ucTjAAADAIgAAAPwBCYADwAZACMBMkA2DyUvJQJGCAgQIwgFHhArIyMPGSsABhorDwoVJAUMDA0GVQUIDw8GVQUWEBAGVdAFAQWqHiQLuP/8tA0NAlULuP/utAwMBlULuP/4tA0NBlULuP/0QAsPDwZVCwYQEAZVC7j/wEATJCU0MAsBAAsQCyALAwsx3yUBJbj/wEAdHiM0MCUBJRkaJQ8EDAwCVQ8KCwsCVQ8ECQkCVQ+4//ZACwsLBlUPCgwMBlUPuP/ytg8QBlUPRSQQ9isrKysrK/08EHErXfZdXSsrKysrK+30XSsrK+0AP+0/7RI5L/0BERI5ABESOTEwQ3lAMwIhEyUDJSAmEgcVGwEXAhUbARwNHhsBIQkeGwEUBhEbAAcWBBgbAR0MGxsAHwoiGwEJCBA8KysrPCsBKysrKysrK4EBXRMhMhYWFRQGBxYWFQYGIyETMzI2NjU0JiMjETMyNjc0JiYjI4gBn5mVaz8/S2MKxLv+IbTAc1ZEd5DG7ZlyA0JqddoEJjOIX0xxJhmJXpeSAmcYSTNUQv0DR1czVxcAAQCIAAAC6wQmAAUAZEALAysABgUKAQcEJQC4//a0ERECVQC4//pAEQ4OAlUABAwMAlUACgsLAlUAuP/0tBAQBlUAuP/8QBYNDQZVAAwMDAZVAAQLCwZVAAABAEUGEPZdKysrKysrKyvtEDwAPz/tMTATIRUhESOIAmP+UbQEJpX8bwAAAgAA/tMEbAQmAAwAEQE7QA8NKwAGBQkPAworBwoNkgC4/+5ACxAQAlUAFgwMAlUAuP/ytAsLAlUAuP/4tAsLBlUAuP/qQBkMDAZVjwABAEAPyQALEAsgCwMLCwgJECUCuP/0QBcMDAZVAgIQEAZVDwIBDwLPAgICAgUrA7j/4kAREBACVQMADw8CVQMODg4CVQO4//ZACw0NAlUDBgwMAlUDuP/2QBELCwJVAwgLCwZVAxIMDAZVA7j/2rQNDQZVA7j/5rQPDwZVA7j/9UAkEBAGVR8DPwOfA68DvwPfA+8D/wMITwOPAwLfAwEDThMIKwkJuP/4tAwNBlUJuP/0QA8PDwZV3wkBDwkBHwkBCRIQPF1xcisrEO0Q9nJxXSsrKysrKysrKysr/TkvXXErK+0REjkvXe30XSsrKysr7QA//Tw8Lzw/7TEwASERMxEjESERIxEzEhMCByERARUC5HOU/LyUX76OFIwCOwQm/G7+PwEt/tMBwQECAfv9+/gC/f//AEv/6AQeBD4CBgBIAAAAAf/7AAAFYAQmADgBuEA5JwUBAxIMJRMSHCUQOi86PzpgOnA6rzoKADofOjA6Tzp/OoA63zrvOgg0FjshhBaLIZQWmyEGNTMzuP/4tBAQAlUzuP/yQEoPEQZVMyspJxQpKScDBQUODxEGVQUrDhAUDg4QFxYWJRUUFBUVFCAhISUiIxQiIiMDBTUzBAgBEA4nKQQLEiUSASMgFxQEHSI3AbgBDEA/HRoaABsuMwswC0gICAAGIiEhGxsWFhUKJSc1KTMFLyMhIAMcIhIQDgMFBQoXFhQDG0AKAQqqgBUBABUQFQIVuAIoQAsAGyU4HAoPEAJVHLj/8rQODgJVHLj//LQMDAJVHLj/9rQLCwJVHLj/97QLDQZVHLj/+EANEBAGVYAcAQAcEBwCHLgCKEAdTy8BL6oAIpAi0CIDUCKwIvAiA3Ai4CLwIgMiMzkQ9V1xcuRx9F1xKysrKysrPP089F1x5HESFzkRFzkREhc5ERc5AD88EDwQPBA8PzwQ7TwQ5BESOS88/TwREhc5ETk5ERIXORESFzmHBS4rDn0QxIcFLhgrDn0QxIcOLhgrKw59EMSHDi4YKysrDn0QxDEwAXFxXQBdAREyNjc2NzYzMxUnIgcGBwYGBxYXEyMDJiYjESMRIgYHAyMTNjcmJicmJyYjIgc1MzIWFhcWFjMRAwlWRkM/MjFrQjFIFBUrKERIdW/GxsE7WD24PFg7wcbFcHVQQEAWGRozDSgZaFVDNkJFVwQm/jVCn5cqKZUBFRZtaFAhH7n+twFJZD7+FQHrPWX+twFJuR8lV6Q3DQ0BlRlRgJ1EAcsAAAEAMv/oA2IEPgAmAQpAXdQJARAoVR2ACYQMgh0FCBkBOwgSAAEajwAbUBtgG3AbsBsF0BsBGxseAAuPDwp/CgIKCghAAQEBSJAAoAACAAAYCEgNBx5IGAsSECEBAQUKyQuPG8kaBSQQjyEkFbj/8LQQEAJVFbj/wEARJCU0MBUBABUQFSAVAxUxKBq4//BADRAQAlVAGgGPGrAaAhq5AlsAJxDmXXErEPZdXSsr7fTtEO30/RE5LxESOQA/7T/tEjkvXe1xETkvXeQREjkvcV3kERI5MTBDeUAqHyQTFw4PBgcjJgcOBRsBHxchGwEkEyEbAwYPCBsBIBYeGwAiFCUbARMSEDwrKysBKysrK4GBgYEAXQFdcQE1PgI1NCYjIgcnEiEyFhUUBxYWFRQGIyADNxYWMzI2NTQmJiMiAXJyU0phTZg9q1ABMqrBflBQ0Lv+lTqpF41bW3lMVnEJAeCNARBQPElXsxwBK7qBgk0rhVuPsgFDJGZwZ1A+XBcAAAEAhwAAA/AEJgAJAVJAERkDFAgCVgJnAnsHhAKNBwUCuP/qQAsJEQJVBxYJEQJVArj/6kA5CREGVQcWCREGVQMHCAgrAgMUAgIDAgcIAwEGCAYKByULQBAQAlULQAsLAlUEJBARAlUEEg4OAlUEuP/tQB0NDQJVBAYMDAJVBBoLCwJVBBYQEAZVBAYPDwZVBLj/9LQMDQZVBLj//EASCwsGVQRAMzY0/wQB/wQBBE4LuP/AQBc0NjSwC/ALAnALgAugC7ALwAsFCwIlCbj/+rQQEAJVCbj/+kALDg4CVQkGCwwCVQm4//pACw8PBlUJBAsLBlUJuP/AQBIzNjTwCQEACSAJ0AngCQQJTgoQ9l1xKysrKysr7RBdcSv2XXErKysrKysrKysrKyvtsQYCQ1RYswMIBwIREjk5G7MDCAYCERI5OVkAPzw/PBI5OYcFLiuHfcQAKysrKzEwAF0BXRMzEQEzESMRASOHtAHzwrT+DcIEJvzWAyr72gMl/NsA//8AhwAAA/AFuAImAmIAAAEHANkA9gAAABZACgEAEQsABEEBAQ65AiIAKQArASs1AAEAhgAAA5AEJgAdAT5ASz4FPwY/B0QFRBeUFwYNBi8ELAUvBi8fTAZeBnoHiweWBgpLBEsGmwSbBqsEqwa7BLsGywTLBgofHz8fewR7Bo8EjwYGBBEGDxgXF7j/8EAbDA0GVRclFhUUFhYVBgQJAhEPBAYEDBUYHBMCuAEMQCobGxYBDEgJCQEGHBcXFgoEBhMRDwULGBUXAxwLqgAWARZJIB8BHwEcJQC4//i0EBACVQC4//pAEQ4OAlUABgwMAlUABgsLAlUAuP/6tAwMBlUAuP/8tA0NBlUAuP/wtA8PBlUAuP/2tBAQBlUAuP/AQBIzNjTwAAEAACAA0ADgAAQATh4Q9F1xKysrKysrKysr/TwQXfVd5BIXOREXOQA/PBA8PzwQ7RESOS/tORI5ORIXORESOTmHBS4rKw59EMQBETMRM11xMTABXXETMxEyNjc+AjMzFSciBwYHBgYHFhcTIwMmJiMRI4a0VkVDNUJWXyQyRxQVKylER3RwxcbAO1g9tAQm/jVCn35QHJUBFRZtaFAhH7n+twFJYz/+FQAAAQAY//kEIwQmABIBRkAWHAgFKwAGAzMMDhwKCgMlFEALCwJVArj/zEALEBACVQIoDw8CVQK4//pACw4OAlUCFA0NAlUCuP/yQAsMDAJVAgoLCwJVArj/7LQJCQJVArj/8bQLDAZVArj/9kAbDQ0GVQIEDw8GVQIQEBAGVQJAMzY0/wIBAk4UuP/AQBk0NjSwFPAUAkAUYBRwFKAUsBTAFAYUBSUSuP/2tBERAlUSuP/QQBEQEAJVEhYPDwJVEhYNDQJVErj/5rQMDAJVErj/7LQLCwJVErj/7rQMDAZVErj/8rQNDQZVErj/4EAWDxAGVU8SXxJvEnAS3xIFErsMDBQTfLkBCgAYKxESOS/0XSsrKysrKysrK+0QXXEr9nErKysrKysrKysrKysr7QA/7RDkP+0xMEN5QBIPEQcJCCYQJQ8JEhsBEQcOGwArASsrK4GBEyERIxEhERQGBiMiJzUzMjY2Nd8DRLP+IxhsZj9STzgwEAQm+9oDkf3vuXZYCJYXMooAAQCMAAAE9AQmAAwBiLYHHAoNAlUCuP/kQHYKDAJVDgK1CsUKAxICGwcCBAEMAwMIDAlGAUoDRQhKCVYIWgmEAY8DgQiPCdAB3wPQCN8J9Qj6CRQICRkCGwl4AngJiAmUAZsDlAibCaQBqwO0AbsDtgjEAcsDxggSBQgKCRQBGgMWCBsJlQGZApoDlQieCQsBuP/2QBUBCgkJCwoMBlUJKwIBFAICAQMHCAi4/+y0CgwGVQi4//VAJw0NBlUIKwIDFAICAwoHAgMLAwEGCwkJCAgGCgIJCAEDBQYLBgclBLj/5EALEBACVQQcDg4CVQS4/+y0DAwCVQS4//q0DAwGVQS4//5AIQ0NBlUECA8PBlUEIBARBlUEToAOsA7ADgMOPw4BCwolALj/+kALEBACVQAGCwwCVQC4//60DAwGVQC4//RADA8RBlUAACAAAgBODRD2XSsrKyv9PF0QXfYrKysrKysr/TwREhc5AD88EDwQPD88Ehc5hwUuKysrh33Ehy4YKyuHfcQxMAE4AXJdcQByXSsrEyEBASERIxEBIwERI4wBGAEXATYBA7T+xqH+17AEJvyuA1L72gNX/KkDgPyAAAABAIgAAAPjBCYACwD8QBnQDeANAgIrCQkEAQYKBwoEByUNQAsLAlUFuP/sQAsQEAJVBRYODgJVBbj/7EARDQ0CVQUIDAwCVQUiCwsCVQW4//ZAHgsNBlUFCg8PBlUFFhAQBlUFQDM2NP8FAf8FAQVODbj/wEAWNDY0sA3wDQJwDaANsA3ADQQNAQolALj/9rQREQJVALj/+rQQEAJVALj/+kAXDg4CVQAEDAwCVQAKCwsCVQADCwsGVQC4//a0Dw8GVQC4/8BAFDM2NPAAAQAAIADQAOAA8AAFAE4MEPZdcSsrKysrKysr/TwQXXEr9l1xKysrKysrKysrK/08AD88Pzw5L+0xMAFdEzMRIREzESMRIREjiLQB87S0/g20BCb+RgG6+9oB1/4pAP//AET/6AQnBD4CBgBSAAAAAQCIAAADzgQmAAcBC0AQBCsABgYDCgMlCUALCwJVAbj/+0AREBACVQEMDw8CVQEWDg4CVQG4//hAEQ0NAlUBEAwMAlUBJgsLAlUBuP/4tAwMBlUBuP/6QCANDQZVAQ4PDwZVARgQEAZVAUAzNjT/AQHfAf8BAgFOCbj/wEAXNDY0sAnwCQIfCXAJoAmwCcAJBQkGJQC4//a0ERECVQC4//q0EBACVQC4//pAEQ4OAlUABAwMAlUACgsLAlUAuP/+tAwMBlUAuP/4tA8PBlUAuP/8tBAQBlUAuP/AQBIzNjTwAAEAACAA0ADgAAQATggQ9l1xKysrKysrKysr7RBdcSv2XXErKysrKysrKysrKyv9AD88P+0xMBMhESMRIREjiANGtP4itAQm+9oDkfxv//8Ah/5pBCEEPgIGAFMAAP//AFD/6APtBD4CBgBGAAAAAQAmAAADhQQmAAcAmkATLwkwCUAJXwmgCQUCBysABgUKB7sBVwAEAAIBV7IEJQW4//ZACxAQAlUFCg8PAlUFuP/0tA0NAlUFuP/2tAsLAlUFuP/utAsLBlUFuP/4tAwMBlUFuP/7QCYNDQZVBQYQEAZVAAUQBVAFsAXABQUABVAFYAWgBbAFBQAFoAUCBS9dcXIrKysrKysrK+3tEO0APz/9PDEwAV0TIRUhESMRISYDX/6qs/6qBCaV/G8DkQD//wAh/lED7gQmAgYAXAAAAAMAS/5pBkoFugAdACkANQFEQGJYEgEEBgQKCxULGQ83HzdbA1wNVRJTHFkgWSJZJlUsVi5VNGoDag1lEmQcaiBuIm4maChmLGUuZjR5A3YGeQ12EnYcgwaJDYUSIx4wAQAnMzMcBRoHITMtHAsUCxAOAAABD7j/9rcPEAJVDyUAELj/8LQMDAZVELj/80AKDQ0GVRAQFyQkCLj/9rQKCwJVCLj/5LQLDAZVCLj/6rQNDQZVCLj/6rQPDwZVCLj/wEAkJCU0MAgBIAgBCDEAN0A3UDdgN4A3kDcGADcgNzA3QDffNwU3uP/AQDQeIzQwNwE3KiQXGAsLBlUXIwwMBlUXHA0NBlUXCA8PBlUXDhAQBlUXQCQlNB8XPxcCFzE2EPZdKysrKysr7RBxK11d9F1dKysrKyvtEjkvKys8/Ss8AD8/Pzz95D88/eQBERI5OTEwXQBdATMRNjYzMhIVFAIjIiYnESMRBgYjIgIRNBIzMhYXExQWMzI2NTQmIyIGBRQWMzI2NTQmIyIGAvG0OIZNvd3usTp4VLQ2g0yn+uK/UIIzs4RjbpuPcHh5/V6XcHV0entvjAW6/gVAP/7F7/n+zSRQ/g0B8zo6ASUBEecBOT9A/lDwpcvWysbOuuHGxcXS0s0A//8ADwAAA/EEJgIGAFsAAAABAIr+0wRYBCYACwEGQBZfDQEEAQYHAisLCgkOAyUNQAsLAlUGuP/qtBAQAlUGuP/gtA0NAlUGuP/6QAsMDAJVBhYLCwJVBrj/8rQLDQZVBrj/5rQPDwZVBrj/7rcQEAZVBgkrB7j/8LQQEAJVB7j/8EARDQ0CVQcoCwsCVQcIDQ0GVQe4//a0DxAGVQe4AQxAEJAGAWAGgAbABgMGTg0CJQC4//pAFxAQAlUABgsMAlUADgsLBlUABAwMBlUAuP/xtA8PBlUAuP/2tBAQBlUAuP/AQBIzNjTwAAEAACAA0ADgAAQATgwQ9l1xKysrKysrK+0Q9l1y/CsrKysr7RArKysrKysrK+0APz/9PD88MTABXRMzESERMxEzESMRIYq0AfK0dJT8xgQm/G4Dkvxu/j8BLQAAAQBFAAADowQmABMAzUASHAgIAQ0PSAYGCQEGDAoJDCUKuP/QQBEQEAJVCiAPDwJVCgoNDQJVCrj/+rQKCwJVCrj/+EAWDAwGVQoUDw8GVQoaEBAGVQpOFQElALj/4EAREBACVQAcDw8CVQAWDQ0CVQC4//xAJAwMAlUAFgsMBlUAGA0NBlUAGA8PBlUAHBAQBlUfAE8AAgAoFBD2XSsrKysrKysr7RD0KysrKysrK/08AD8/PDkv7TkSOTEwQ3lAEhASAwUEJhElBRACHQADEgYdACsBKysrgYETMxUUFhYzMjcRMxEjEQYjIiYmNUW0H3ZZZqK0tKaQeblCBCbJgnVXNgHh+9oBrDR7smsAAQCNAAAF3QQmAAsBfEAlAA0QDXANAyANMA1PDWANcA2gDcAN7w0ICAQEAQYHAisLCgclCbj/9rQQEAJVCbj/7kALDQ0CVQkGDAwCVQm4//C0CwsCVQm4/+i0DAwGVQm4//u0Dw8GVQm4//1AJBAQBlUwCQEACRAJMAlACbAJ0AngCQcQCSAJMAlgCXAJgAkGCbgBxLVABQEDJQW4/+y0EBACVQW4/+q0DQ0CVQW4//S0DAwCVQW4//S0CwsCVQW4/+20DAwGVQW4//a0Dw8GVQW4//pAJBAQBlUfBS8FrwXfBQQABTAF0AXgBQQQBSAFMAVgBXAFgAUGBbgBxLICJQC4//q0EBACVQC4//RACw4OAlUABgsLAlUAuP/wQAsJCgJVAAYQEAZVALj//rQPDwZVALj/+EAcDQ0GVQAJDAwGVQAFCwsGVQ8AAU8AAQAAAQBODBD2XXFyKysrKysrKysr7f1dcXIrKysrKysr/XH9XXFyKysrKysrK+0AP/08PzwQPDEwAV1dEzMRIREzESERMxEhjbQBmrQBm7P6sAQm/G8DkfxvA5H72gABAI3+0wZUBCYADwF8QC4QEQEgEU8RYBFwEaARwBHvEQcIBAQBBgYLAisPCg0ODisMChAQBlUMFA8PBlUMuP/vQBkNDQZVDBEMDAZVDAwRMBFQEXARoBEEByUJuP/2tBAQAlUJuP/uQAsNDQJVCQYMDAJVCbj/8LQLCwJVCbj/7UAqDA0GVQkDEBAGVTAJAQAJEAkwCUAJsAnQCeAJBxAJIAkwCWAJcAmACQYJuAHEtUAFAQMlBbj/7LQQEAJVBbj/6rQNDQJVBbj/9LQMDAJVBbj/9LQLCwJVBbj/8UAkDA0GVR8FLwWvBd8FBAAFMAXQBeAFBBAFIAUwBWAFcAWABQYFuAHEsgIlALj/+rQQEAJVALj/9EALDg4CVQAGCwsCVQC4//BACwkKAlUAChAQBlUAuP/zQBYNDQZVAA0MDAZVDwABTwABAAABAE4QEPZdcXIrKysrKysr7f1dcXIrKysrK/1x/V1xcisrKysrK+1dEjkvKysrK+0APz/9PDw/PBA8MTABXV0TMxEhETMRIREzETMRIxEhjbQBmrQBm7N3lfrOBCb8bgOS/G4Dkvxu/j8BLQACACgAAAS3BCYADAAVAPhAHBMQARkTARkSARkEARUrAgIKDCsABg0rCgoRJAa4/+a0DQ0CVQa4//q0CwsCVQa4//60CwsGVQa4/+q0DAwGVQa4/+xACg8PBlUGF98XARe4/8BAFh4jNDAXAQINJQoMEBACVQoQDw8CVQq4/9q0DQ0CVQq4/+q0DAwCVQq4//S0CwsCVQq4/8CzGUw0Crj/wEAKCw00kAoBCgwMALj/8rQLCwZVALj/4LQMDQZVALj/07QPDwZVALj/ykALEBAGVQBAGUw0ABYQ3isrKysrPBDeXSsrKysrKyv9PAFxK10Q3isrKysr7QA/7T/tEjkv7TEwcnJychMhETMyFhUUBiMhESEBMzI2NTQmIyMoAdvl89zV0P49/tkB272skHup1QQm/mG9iY6zA5H9AVNcVFwAAwCLAAAFLgQmAAMADgAXASBAEx8IBisXFwMFAAYPKw4OAwoTJAq4/+xACw8QAlUKCg0NAlUKuP/atA8PBlUKuP/sQCcQEAZVUAqQCgIPCgFgCnAKgArACgQKCg8DJQEEEBACVQEgDw8CVQG4/+JACw0NAlUBCgwMAlUBuP/stAoLAlUBuP/ktAsLBlUBuP/0QBcMDQZVARAPDwZVASQQEAZVAU4ZBQ8lBLj//EALEBACVQQECwwCVQS4//S0Dw8GVQS4//C0EBAGVQS4/8BAEjM2NPAEAQAEIATQBOAEBAROGBD2XXErKysrK/08EPYrKysrKysrKyv9ETkvXXFyKysrK+0APzwQ7T88Ejkv/TEwQ3lAFggVEQwTGwEVCBMbARILEBsAFAkWGwErKwErK4EBMxEjATMRMzIWFRQGIyE3MzI2NTQmIyMEerS0/BG05N/xyd3+PrS9q5JsudUEJvvaBCb+Ya2Yhb2UVFlFbAACAIQAAAPsBCYACgATAQZAFh8IAisTEwoABgsrCgoPJAYODAwCVQa4//y0CwsGVQa4//G0DAwGVQa4//ZACw8PBlUGBhAQBlUGuP/AQDckJTQwBgEABhAGIAYDBjEfFT8VXxV/FZ8VrxW/Fd8VCA8VAQ8VjxWvFb8VzxXfFe8VBxUBCyUAuP/8QAsQEAJVAAQLDAJVALj//LQMDAZVALj//rQNDQZVALj/9LQPDwZVALj/7LQQEAZVALj/wEASMzY08AABAAAgANAA4AAEAE4UEPZdcSsrKysrKyv9PBBxcl32XV0rKysrKyvtAD/tPxI5L/0xMEN5QBYEEQ0IDxsBEQQPGwEOBwwbABAFEhsBKysBKyuBEzMRMzIWFRQGIyE3MzI2NTQmIyOEtOTf8cnd/j60vauSbLnVBCb+Ya2Yhb2UVFlFbAD//wAr/9sDygQ+AVMCfQQVAADAAEAAADmxAA64//pACxAQAlUOBg8PAlUOuP/0tAwMAlUOuP/+QA4PDwZVDgYQEAZVDg43HE4Q9hErKysrKzUAAAIAif/oBa0EPgATAB8BfUBeCgQBNBlHGVoIXwxQDlMVUxlfG1sfbghvDGUOYxVjGW8bbh+5BMsE2QTZD9sV2RbbGdUb0x/pBOcP+QT7BfcP+RX6GfUb8x8iAisRERMAFBwGBwAGEwoaHA0LAxAkF7j/7rQQEAJVF7j/5LQNDQJVF7j/7UALEBAGVRcQDQ0GVRe4//dAGAwMBlUwF/8XAp8X0BfgF/AXBBcXAB0kCrj//LQQEAJVCrj/8rQPDwJVCrj/9LQPDwZVCrj/9rQNDQZVCrj/8LQLDAZVCrj/wEAUJCU0MAoBAAoQCiAKAwoxIQESJQC4//a0ERECVQC4//q0EBACVQC4//pAFw4OAlUABAwMAlUACgsLAlUABAsMBlUAuP/+tA0NBlUAuP/4tA8PBlUAuP/0tBAQBlUAuP/AQBIzNjTwAAEAACAA0ADgAAQATiAQ9l1xKysrKysrKysrK/08EPZdXSsrKysrK+0SOS9dcSsrKysr/TwAP+0/Pz/tERI5L+0xMAFdcRMzETM2NjMyFhYVEAIjIgInIxEjASIGFRQWMzI2NTQmibTaGO29obp5+tbH8A/atANahJOUfHudiAQm/kTk8ILkwf7t/uQBCOb+KgOly7fbzL3Szc0AAgAfAAADywQmABIAGwEgQCYECR0INAxEDFsIVAzUDAd5CwEkCAwCCgYICAoMDAJVCAYMDAZVCLj/9kAqEBAGVQglCQsUCQkLCwwGCQMMDBsrAwMCFCsSBgkICAIKCwYIAwkTAiUAuP/8QAsQEAJVABIPDwJVALj/9kALDQ0CVQASDAwCVQC4/+60CwsCVQC4/+q0CgoCVQC4//i0DAwGVQC4//pAGA0NBlUADg8PBlUAIhAQBlUATh0JKBckD7j/+LYKCgJVD5EcEPYr7RnkGBD2KysrKysrKysrK/08ERc5AD88EDw/7RI5L+0ZOS8REjkROYcFLhgrKysrDn0QxAEREjkxMBhDeUAYDRkZDRcbAhURFxsAGA4aGwANDBYQFBsBACsQPCsBKyuBAV1xAREjESMiBgcHIxM2NyYmNTQ2MwUhIgYVFBYzMwPLs2hfXVmd38JZWJqVw7kBOf8AoV2JrscEJvvaAZ4xhegBHoMRFbR1iqyVZENfWf//AEv/6AQeBcMCJgBIAAABBwCOAN8AAAAjQBQDAiJACwsCVa8iASIKUEgrAgMCJbkCIgApACsBK10rNTUAAAEAAP5RA+gFugAlAThAHgMPFA8lCzULRgsFNhJFE3ofix8EFxcWFhocFA8HArj/wEA3His0AtQIAQENBAAgHA0HJCUKFwAWARYHIAIBAh0lJ0ALCwJVJ0AQEAJVECgQEAJVEBQODgJVELj/7EARDQ0CVRAEDAwCVRAaCwsCVRC4//ZAHgsNBlUQCg8PBlUQFBAQBlUQQDM2NP8QAcAQARBOJ7j/wEAYNDY0sCfwJwJwJ6AnsCf/JwQnCgUkJQQluP/6tBAQAlUluP/6QBcODgJVJQQMDAJVJQgLCwJVJQgLCwZVJbj/+LQPDwZVJbj/wEASMzY08CUBACUgJdAl4CUEJU4mEP1dcSsrKysrKys8/Tw8EF1xK/ZdcSsrKysrKysrKysr7S9dLy9dMwA/PD/tPxI5Lzz9Kzw/7TMvMy8xMAFdAF0TIyczNTMVIRUhETY2MzIWFREUBiMiJzcWMzI2NRE0JiMiBhURI4eGAYezAVf+qT2hY6++mHJPPyI0IC8/cXFjtbMEwXeCgnf+6kpJuOX9Je6HE5kOP5wC14GBitT9uwD//wCIAAAC6wXCAiYCXQAAAQYAjXgAAAuyAQEGuQIiACkAKwAAAQBL/9sD6gQ+ABoA4kA6HxxFGFUEVRhrDGwNbBBzCXMKewx0EnUThRKVEpAYDxSPXxVvFQIVFQsRCCIwB0AHYAegBwQHBxELGrj/wEBIHiA0GisCAgsXHBEHBRwLCwEBBwIVJBSaByQfCAEINxwaAiQOCA4OAlUODA0NAlUODAwMAlUOEAsLAlUOEAwMBlUOCgsNBlUOuP/8QBgPDwZVDg4QEAZVDkAkJTQfDj8OAg4xGzS5AQoAGCtOEPRdKysrKysrKysrTf08ThD2XU3t9O0REjkvAD/tP+0SOS/tKxESOS9d5BESOS9d5DEwAV0BFSEWFjMyExcGBiMGAjcQADMyFhcHJiMiBgcCgf6JEZGB5CmwHOu+4vgGAQLfstwYryzReJkRAmqUra0BCBev1g0BOf8BAwEovZUc2bGOAP//AD//6AOxBD4CBgBWAAD//wCIAAABPAW6AgYATAAA//8ACQAAAjoFwwImANUAAAEGAI7MAAAfQBECAQggCwsGVQgCAEgrAQICC7kCIgApACsBKys1NQD///+i/lEBOgW6AgYATQAAAAIAE//6BvgEJgAZACIBIEAfFQQVBhAkAwErIiIJCysZBhorCRMrEhIJChAKABolCbj/9EALEBACVQkMDw8CVQm4//S0DQ0CVQm4/+y0CwsGVQm4/9m0DAwGVQm4//C0DQ0GVQm4/+JAEhAQBlVACWAJApAJAQkJDB4kBbj/9rQLCwZVBbj/5LQMDAZVBbj/9kALDw8GVQUEEBAGVQW4/8BAEyQlNDAFAQAFEAUgBQMFMd8kASS4/8BAFh4jNDAkASQMJRgIDxACVRgSDQ0CVRi4//RAIgsMAlUYIAsLBlUYHAwMBlUYFA0NBlVPGF8Y3xgDGKQTmiMQ9vZdKysrKysr7RBxK130XV0rKysrK/0ROS9dcSsrKysrKyv9PAA/PzwQ7RDtP+0SOS/tMTABXQERMzIWFRQGIyERIREUBgYjIic1FjMyNjURATMyNjU0JiMjBETl3PPE4v4+/g0nb2gdb0coPygDW72skmu61gQm/mGsmYDCA5H976+QRwaTCk6TArz8blNaRmsAAAIAgwAABjkEJgASABsBFkAoFQMVBQIBDysaCgoIEQ4GEysLCAoRCCUAGxISExwQEAJVExQNDQJVE7j/8kALDAwGVRMKDQ0GVRO4//RAFQ8PBlUTGRAQBlUPEy8TAhMTDBckBLj/+LQLCwZVBLj/5LQMDAZVBLj/9LQPDwZVBLj/wEARJCU0MAQBAAQgBAIEMd8dAR24/8BACx4jNDAdAR0OCyUMuP/4QBEQEAJVDAQLDAJVDAQMDAZVDLj//LQNDQZVDLj/9LQPDwZVDLj/9LQQEAZVDLj/wEASMzY08AwBAAwgDNAM4AwEDE4cEPZdcSsrKysrKyv9PBBxK132XV0rKysr7RI5L10rKysrKys8Ejk5/TwAPzztPzwSOS88/TwxMAFdATMyFhUUBiMhESERIxEzESERMxEzMjY1NCYjIwOF5d7xytz+Pv5mtLQBmrS9rZBrutUCbKaRgbQB1/4pBCb+RgG6/GdPVEJlAAEAAAAAA+gFugAbAR5AEgMMFAwlCDUIRggFehKKEgIEG7j/wEAyHis0G9QFGhoKAQATHAoHDxgKBCAbARsQJR1ACwsCVR1AEBACVQ0oEBACVQ0UDg4CVQ24/+xAEQ0NAlUNBAwMAlUNGgsLAlUNuP/2QB4LDQZVDQoPDwZVDRYQEAZVDUAzNjT/DQHADQENTh24/8BAGDQ2NLAd8B0CcB2gHbAd/x0EHQcCFyUBGLj/+rQQEAJVGLj/+kAXDg4CVRgEDAwCVRgICwsCVRgGCwsGVRi4//q0Dw8GVRi4/8BAEjM2NPAYAQAYIBjQGOAYBBhOHBD2XXErKysrKysrPP08PBBdcSv2XXErKysrKysrKysrK+0vXS8APzw/7T8SOS88/Ss8MTABXQBdEzUzFSEVIRE2NjMyFhURIxE0JiMiBhURIxEjJ4ezAVf+qT2hY6++tHFxY7WzhgEFOIKCd/7qSkm45f1fAqGBgYrU/bsEwXcA//8AhgAAA5AFwgImAmQAAAEGAI14AAALsgEBHrkCIgApACsA//8AIf5RA+4FuAImAFwAAAEHANkAtwAAABZACgEAIhwLE0EBAR+5AiIAKQArASs1AAEAiP7SA+MEJgALAT5ADgkGBgIOBysEBAsKACsDuP/6tAoNAlUDuP/8tAwMBlUDuP/4tA0NBlUDuP/wQBcPEAZVXwNvA38DAwMDBAglDUALCwJVC7j/8UALEBACVQsWDg4CVQu4//BAEQ0NAlULCgwMAlULJgsLAlULuP/3tAsLBlULuP/1tAwMBlULuP/4QB4NDQZVCwgPDwZVCxYQEAZVC0AzNjT/CwH/CwELTg24/8BAFTQ2NLAN8A0CcA2gDbANwA0EDQclBLj/9rQREQJVBLj/+rQQEAJVBLj/+kAXDg4CVQQEDAwCVQQKCwsCVQQECwsGVQS4//i0Dw8GVQS4/8BAEjM2NPAEAQAEIATQBOAEBARODBD2XXErKysrKysrK+0QXXEr9l1xKysrKysrKysrKysr7RI5L10rKysr7QA/PBDtPz88MTAhESMRIREzESERMxECgJX+nbQB87T+0gEuBCb8bgOS+9oAAAEAoQAAA6wHUAAHAIxALgEEHgcCBggAHgMWDw8CVQMSDAwCVQMJCwsGVQMTDA0GVQMeDw8GVQMDCAkFIAa4/+S0EBACVQa4//S0Dw8CVQa4//q0DQ0CVQa4//60DAwCVQa4//20DxAGVQa4//+0DQ0GVQa4//q2DAwGVQY5CBD2KysrKysrK+0REjkvKysrKyvtAD8/7S8xMAERMxEhESMRAv+t/bfCBboBlv29+vMFugABAIgAAAMMBbwABwCXQCMBAAQrBwYGCgAlAxYPDwJVAwwMDAJVAwoLCwZVAxQMDQZVA7j/57QPDwZVA7j/80AOEBAGVSADAQMDCAkFJQa4//a0ERECVQa4//pAFw4OAlUGBAwMAlUGCgsLAlUGAgwMBlUGuP/8tA8PBlUGuP/zthAQBlUGRQgQ9isrKysrKyvtERI5L10rKysrKyvtAD8/7T8xMAERMxEhESMRAneV/jC0BCYBlv3V/G8EJgAAAQBBAcoHwAJbAAMAFEAJAR4AAqsFAKsEEOYQ5gAv7TEwEzUhFUEHfwHKkZEAAAQAoAAACEAFugAJABUAIQAlATpAGCcBKAYvJ4oBhgaqC6MOqhUIBxgJFgJVArj/6EAlCRYCVTcCZgJ1AoUCjwcFOAgBBwYGugIBFAICAQIHBgMBAh8qDbgBZkAoGSoTTSMiNSQldQgIBggBBgIIAgMgBRYQEAJVBQQPDwJVBQoNDQJVBbj/4EAQDAwCVQUFCAokxRAlxRZeCrgBYkAXHF4QBgsMAlUQPicHCCAJCQAcEBACVQC4//S0Dw8CVQC4//K0DQ0CVQC4//q2CwwCVQD5JhD2KysrKzwQ/TwQ9ivt/e3kEOQREjkvKysrK/08ERI5OQA/PBD0PP08/u397T88Ejk5hwUuK4d9xDEwGEN5QCoLIRoSHB8BGBQWHwAeDhwfASAMFh8AGxEZHwAXFRkfAB0PHx8BIQsfHwEAKysrKwErKysrgQBdKysBXRMzAREzESMBESMBNDYzMhYVFAYjIiY3FBYzMjY1NCYjIgYDIRUhoMMCzbnC/S+2BM/HpKPDyaWO1a9rTklxdUZLbZwCqf1XBbr7kARw+kYEa/uVAxGx0ti3udjD1IaIg4WMfYL9fpQAAAEALQAABVkEJgALAMhAFg8NLw0CCgoCCggABCsFBgslCQAlAgm4/+i0EBACVQm4//i0DQ0CVQm4//K0DAwCVQm4/+20DAwGVQm4//xAFA0NBlUJCg8PBlUJJhAQBlUJQgYCuP/otA8QAlUCuP/0QAsNDQJVAgoLCwJVArj/7kALCwsGVQIIDAwGVQK4//i0DQ0GVQK4/+q0Dw8GVQK4/+BADRAQBlUCQgUGxA0FfAwQ5hDmEOQrKysrKysrKxDkKysrKysrKxDtEO0AP/08PD8/MTABXQERIxEhNSEVIxEjEQH5tP7oBSzytAOU/GwDlJKS/GwDlAAAAgEB/lIBqf/OAA4AHQAxuQAAAtO3CEANFzQICA+9AtMAFwLEABMABALTthsMQBobNAwvKzz9PAA//TIvK/0xMAUyFhYVFAYGIyImJjU0NhcyFhYVFAYGIyImJjU0NgFVGCYWFiYYGCYWKykYJhYWJhgYJhYwMhYmGBglFxclGB811BYmGBglFxclGCQwAAUAHv5SAoz/zgAOAB0AKgA3AEYAY7IeDwC4AtNACyUXCEANFzQICDgrvQLTAEAAMQLEAC4C07I1NQy4AtO0BOUbPCG4AtOzRCjlE7gC00AJG0AaGzQbG0hHERI5Lyv9/jz9PBD+/Tkv7QA/PP08Mi8rPDz9PDwxMBcyFhYVFAYGIyImJjU0NiEyFhYVFAYGIyImJjU0NiEyFhUUBgYjIiY1NDYFMhYVFAYjIiYmNTQ2ITIWFhUUBgYjIiYmNTQ2chglFxclGBgmFisBDBYlGRYmGBgmFjABBykrFiYYIzEw/s4fNTAkGCUXLAF+FiUZFiYYFSUaMDIWJhgYJRcXJRgfNRMnGhglFxclGCQwNR8YJRcxIyQw1CspIzEXJRgfNRMnGhglFxQmGiQwAAMAMf5SAnn/zgAMABAAHwBQtBBkDg4AuALTtwZADRc0BgYRugLTABgCxLYODg9VCRUDuALTQBAcXwkBfwkBCUAXGTQJCSEgERI5Lytdcjz9PBD+Mi8AP/0yLyv9Mi/tMTAFMhYVFAYjIiY1NDY2BTUhFRcyFhYVFAYjIiYmNTQ2NgIlKCwsKCQwFib+JAFQpBUlGiwoFiUZEycyNR8fNTEjGCYWcmhoYhMnGh81FCYaFiUZAAMAMf5SAnn/zgAMABQAIwBsQAwgFAEUFBwOE2QQEAC4AtO3BkANFzQGBhW9AtMAHALEABkAAwLTQCIgCVUSD3UOdRN1LxI/EgISQCAiNBJALS80EkA/QzQSEiUkERI5LysrK3H0/eQQ/jz9PAA//TIvK/0yL/08ETkvcTEwBTIWFRQGIyImNTQ2NgE1IzUhFSMVJTIWFhUUBiMiJiY1NDY2AiUoLCwoJDAWJv6VcQFQawEPFSUaLCgWJRkTJzI1Hx81MSMYJhb++pRoaJQyEycaHzUUJhoWJRkAAQEB/o8Bqf83AA4AFL0AAALTAAgABALTAAwv7QAv/TEwBTIWFhUUBgYjIiYmNTQ2AVUYJhYWJhgYJhYryRYmGBglFxclGB81AAACAH7+jwIs/zcADAAbACexDQC4AtOyFAYQuALTshhqCrgC07MDAx0cERI5L+3+7QAvPP08MTAXMhYVFAYjIiYmNTQ2ITIWFRQGBiMiJiY1NDY20h42MCQYJhYwASooLBYmGBYlGRMnySspIzEXJRgkMDUfGCUXFCYaFiUZAAADAH7+UgIs/84ADAAbACoASLENALgC00AJFAZADRc0BgYcvALTACQCxAAgAtO0KCgDChC4AtOyGGoKuALTswMDLCsREjkv7f7tERI5L+0AP/0yLys8/TwxMBcyFhUUBiMiJiY1NDYhMhYVFAYGIyImJjU0NjYHMhYWFRQGBiMiJiY1NDbSHjYwJBgmFjABKigsFiYYFiUZEydpGCYWFiYYGCYWMDIrKSMxFyUYJDA1HxglFxQmGhYlGdQWJhgYJRcXJRgkMAABAIz+xQIe/y0AAwAPtQFkAAICAS8zLwAv7TEwEzUhFYwBkv7FaGgAAQCM/lICHv9iAAcAKLUDZAYCnwC4AsRACwUFBnUBAgIBAQkIERI5LzMvEP0yLwA/9DztMTABNSM1IRUjFQEckAGSjv5SqGhoqAABAQEEngGpBUYADgAguQAAAtO0EAgBCAS4AtO3HwwvDK8MAwwvce0AL13tMTABMhYWFRQGBiMiJiY1NDYBVRYlGRYmGBglFzAFRhQmGhgmFhYmGCMxAAMAEP5RApr/zQAPAB4ALQBiuQAQAtOzGBgnALgC00ASCEA1OTQIQCElNAhACRc0CAgfugLTACf/wLMJDDQnugLEACMC07IrqxS7AtMAHAAMAtO1BKscHC8uERI5L/btEP327QA/K/0yLysrK+0SOS/tMTAXMhYWFRQGBiMiJiY1NDY2BTIWFhUUBgYjIiYmNTQ2BTIWFhUUBgYjIiYmNTQ2ZBYlGRYmGBglFxQmAQsYJhYWJhgYJhYwARUYJRcXJRgYJhYwMxMnGhglFxclGBYlGWwWJhgYJRcXJRgkMGgWJhgYJRcXJRgkMAAAAQEBAe4BqQKWAAwAGrwABgLTAAAAAwLTtR8KLwoCCi9x7QAv7TEwATIWFRQGIyImJjU0NgFVHjYxIxgmFisCliwoJDAWJRkfNQABASH+UQGJ/80AAwAauQAA/8C0DRM0AAO4AsSyAWQAL+0APy8rMTAFMxEjASFoaDP+hAAAAQB9A4UCkwQlAAMADrUA+QED7gAv7QAv/TEwEzUhFX0CFgOFoKAAAAEAjATjAh4FSwADAA61AGQBA24AL+0AL/0xMBM1IRWMAZIE42hoAAABANL/7AFhBQEAAwAbswEBAAW4AsiyAyAAuQLHAAQQ9v3mAC8zLzEwFxEzEdKPFAUV+usAAQMLBJ4DswVHAAwAFL0ABwLTAAAAAwLTAAov7QAv7TEwATIWFRQGBiMiJjU0NgNfKSsSJxsjMTYFRzUgFiQaMSMpLAAB/wQEnv+sBUcADAAUvQAHAtMAAAAKAtMAAy/tAC/tMTADMhYVDgIjIiY1NDaoKCwBFiUYJDA1BUc1IBglFzEjKSwAAAIAuQAAAYYEJgADAAcAGkAMADwBBTwEAwcABzwEL+08EDwAL+0v7TEwEzUzFQM1MxW5zc3NA1nNzfynzc0AAQBpAAAESgQlABUA6UB6GQgmDDgBOgI7CDsJOQw7FUgBTQJJCE0JSQxNFVUDVglWDGcDfwhzFIwJghSAFacM2ADXFRoIAikTKBU9Aj8VgQmPFaYM2hUJFQwLCwACCQoBAQALCyAKARQKCgEVDAEJBAoGBQABChEQCwoGDxASBAUHCQIMFQQRBgG4AmC3gAABAAAQIBG4Asq2FwsKBSAKBrkCyQAWEPYy7S8zEPbtMy9d7RESFzkzETMyETMAPzw8PD88PDwSFzmHBS4rh33EBw48PIcOEMQ8sQYCQ1RYtQIYDBE0DLj/6LIMETQAKytZMTAAXQFdISMBBgcDIxMSNwMzATY2NzczBwYGBwRK7P5rXhErxisesvfrAVQ+MQ4ZxhgQX3UCPTOb/pEBbwEAWgFc/iUpZ3bV2421RwAAAQAyAAAEKQQxABIAdkAsBRAWEFQQYxDiEAUABPkDCgz5DQz5DQ0K+Q8HBSAAAAEUDAwGVQEaDQ0GVQG4//BACw8PBlUBCBAQBlUBuALMtBQMDA0MuP/AtQ0RNAwNBLkCywATEPYyLysRMy8Q9isrKysyL+0AP+0zL+0v7T/9PDEwAV0lMxUhNSERNCYmIyIHJzYzIAQVA4Cp/AkCj0Ktt0GIEIeYAR4BAaCgoAFqlJVYDp4W+PwAAAEAGQAAAugEMQAZAMlAVgMYEhgjGC8bOAo0GEsKWQpqCnsKhQaQBakLDQMEBLoBAhQBAQIFBwcjCAoUCAgKBQQKCAEM6AAEEAQCBAQWCAcCAwoT+RQHFBH5FgcFCgwIE8UUFAcIuP/wQBEICAQMIAEDnwKvAr8CAwICAbj/9kAODAwGVQEKDxAGVS8BAQG5AsgAGxD2XSsrMn0vGF0zEP0yMy84MzMv5BESOTkAP+0zP+0/PDw8fBI5L10Y7TMRORI5hwUuKw59EMSHBS4YK30QxDEwAV0BERMjAyIHByM3NjYzETQmJiMiByc2MzIWFgKGYrtJe1I7w1RLxkkZVkc9MA5DYYiQNAKu/rr+mAEElW+kklsBF1ZZNgqYFmaVAAEALQAAA+QEJQAHAFFAEAMKAQX5BgYEIAEMCwwGVQG4/+y0DQ0GVQG4//xAEA8PBlUBChAQBlWfAQEBoAe4Asy0CTAGAQa5AssACBDmXRD29F0rKysr7QA//Tw/MTABIxEjESE1IQPktb79vAO3A4X8ewOFoAACAJYAAARABDEADgASAIpAHzIDNARFA0UEVgNWBGYEBw75ABIHEQoODPkAAgcIIAW4/+xACxAQBlUFEA8PBlUFuP/wtAwMBlUFuALIQA4UDg4AAA8gEioQEAZVErj/7rQPDwZVErj/9kALDQ0GVRIEDAwGVRK5AscAExD2KysrK+0zLzMvEPYrKyvtAD8z/TI/PC8v7TEwAV0TNjMgFhURIxE0JiYjIgcTESMRlrWrAUz+v0q1rYinu78EEh/2/v3DAgqflU0c/uf9qgJWAAEAmwAAAV4EJQADADe0AgoDBgW4AsiyACADuP/+tAsLBlUDuP/+QAsNDQZVAxQQEAZVA7kCxwAEEPYrKyv95AA/PzEwAREjEQFewwQl+9sEJQABAF8AAALiBCUAEwBQQB4PFSAVAgkKAOgR+RIGEBAAEQggCQkDIA4OEg8TARO4AsxACxUSFAwNBlUgEgESuQLFABQQ5l0rEOZdETkv7Tkv7RESOS8AP+3tPzEwAV0BIgYVFBcWFRUjNTQnJjU0NyE1IQLima0JGsAUB4f+9AKDA56vkx1U8maTrmrcSjGlcaAAAAEAmwAABDkEMQARAHNAFGMPcxACQw9TDwIBCgoG+Q0HAiARuP/sQAsQEAZVERAPDwZVEbj/8LQMDAZVEbgCyEAKEwggCyoQEAZVC7j/7rQPDwZVC7j/9kALDQ0GVQsEDAwGVQu5AscAEhD2KysrK+0Q9CsrK+0AP+0/PDEwAV1dISMRNCYmIyIHESMRNjMyFhYVBDm/NJySVWm/1rPE72ICP3WGUQ78gwQOI3PArAAAAQCM/+MEQAQ7AB0AnEApLx8Baxt7GwIDEhMSIxIDRgVWBWsXexcEBfkZCx8OAQ4ODPkRBwAGDw64//BAFwIPD58Orw4CDg4ACSAVEBAQBlUvFQEVuALIsx8BIAC4//a0EBAGVQC4/++0Dw8GVQC4//S0DQ0GVQC4//60CwsGVQC5AscAHhD2KysrK+0Q9l0r7RI5L10zLxc4AD8//TIvXT/tXV0xMAFdXRMzERQWMzI2NjU1NCMiByc2MzIWFRUUBgYjIiYmNYy/rWtyhSiHX088bKeMkE/fr5rjWgQl/dnrlmqqkIfpamKy3NRMzuimmOjQAAEAmwIAAV4EJQADADi0AgIDBgW4AsiyACADuP/+tAsLBlUDuP/+QAsNDQZVAxAQEAZVA7kCxwAEEPQrKyv95gA/My8xMAERIxEBXsMEJf3bAiUAAAEAKP5oA4IEMQAOAF61Kwo7CgIDuv/wAAT/8EATBw4O+QAGAAz5AgcODgAADwggBbj/8kAXCwwGVQUKDQ0GVQUWDw8GVQUgEBAGVQW5AsgAEBD2KysrK+0RMy8zLwA/7TM/7T8xMDgBOAFdEzYzIAQRESMRNCYmIyIHKJqAASoBFr9ZuHpslAQbFuP+7/wrA6KtkkIUAAEAUP/wA1YENwAXAHFANUoFSglcBVwJWRFZFAYqBSwJOwU7CQQBnwAAA58WCwyfDQ0Knw8HAQwBAAAMPw0BDQ0YByYSuP/4tAsNBlUSuP/4tw8PBlUgEgESuQLGABkQ9l0rK+0RMy9dMzwRMy8vAD/tMy/tP+0zL+0xMAFdXTc3FjMyNjY1NCYjIgcnNjMgABUUBgYjIlAaXmNxmlO1qWRdGnVcAQoBK4H2vl0OrB5dqm+n0h6sHv7K75zwlgABADwAAANGBboAFgCfQBw2BkQGVAZ1BoMGBQoKFPkABhUCCCALCAsNBlULuP/ntA8PBlULuP/gQAoQEAZVCwsUEyABuP/stAsLBlUBuP/otAwNBlUBuP/4tA8PBlUBuP/+tBAQBlUBuALKsxgAIBS4//ZAGQsLBlUUGQwNBlUUGQ8PBlUUIhAQBlUUFBcRMy8rKysr7RD0KysrK+0SOS8rKyvtAD8/7T8xMAFdEyERFAYHBwYVFSM1NDY3NzY2NTUhETP6AkwqNDZRvzMxPCwZ/bW+BCX++HCLR0htfKqPgYI/TDhaR48CNQACAJsAAAQ5BDEACAARAHBAEkMGUwZmBgMR+QEKDvkEBwogCLj/7EALEBAGVQgODw8GVQi4//K0DAwGVQi4AshAChMQIAI8EBAGVQK4/+60DxAGVQK4//RACw0NBlUCBAwMBlUCuQLHABIQ9isrKyvtEPYrKyvtAD/tP+0xMAFdISERNjMyFhYVAxE0JiYjIgcRBDn8YtazxO9ivzScklVpBA4jc8Cs/k4Bn3WGUQ79IwAAAQBQAAAEPgQxABoAxUAWCgQHCAgVKQQ2FVoEWgVpBWoSCQAQA7j/8EBLDAwPFwMCAiABABQBAQAVFxcSCw0GVRcgGAAUGBgAAAMVAxgBE/kGBwIBBg35CwsXGAoAAwIXFQUKAQEYHhAQBlU/GF8YAhgYDyAKuP/sQAsQEAZVChAPDwZVCrj/8LQMDAZVCrkCyAAcEPYrKyvtMy9dKxkzLxgSFzkAPzw8EO0/PD/tERIXOYcFLisrDn0QxIcFLhgrDn0QxAEYERI5LwA4ATgxMAFdEwMzFzY2MzIWFhURITUhETQmJiMiBgMDIxM29KS7Ti/Ic3qxUP3dAWIXX0hwnTdLwVQMAmoBu+pnj33w8f4toAE3sKFl5/7j/ncBnjsAAQCb/mgBXgQlAAMAN7QCDgMGBbgCyLIAIAO4//60CwsGVQO4//5ACw0NBlUDEBAQBlUDuQLHAAQQ9isrK/3mAD8/MTABESMRAV7DBCX6QwW9AAEAPAAAAjwEMQARAGxAIwQPFA8kDy8TNA8FAvkBCgr5CwsI+Q0HCwICChALAQsLBCARuP/vQBEQEAZVEQcPDwZVEQ4NDQZVEbj/70AMDAwGVS8RvxHPEQMRuQLIABMQ9l0rKysr7TMvXTMzLy8AP+0zL+0/7TEwAV0hITUhETQmJiMiByc2MzIWFhUCPP4AAUEaVUc9MA5DYYiQNKACCFZZNgqYFmaViAAAAgBa/+EEPgRCAA0AGQDfQCovGzcYRxhTAlkFWQlTDFMQXBJcFlMYpwmoDecB6QYPEfkLCxf5AwcUJge4//RACxAQAlUHDA8PAlUHuP/0QAsODgJVBwoNDQJVB7j/9kALDAwCVQcACwsCVQe4/+a0CwsGVQe4//C0DQ0GVQe4//K0DAwGVQe4//i0Dw8GVQe4AsZAChsOJgAKDA8CVQC4//ZAHQsLAlUADgsLBlUADg0NBlUADBAQBlUAFAwMBlUAuP/2tA8PBlUAuQLFABoQ9isrKysrKyvtEPYrKysrKysrKysr7QA/7T/tMTABXRM0ADMyFhIVFAYGIyIANxQWMzI2NTQmIyIGWgER4YbYlHDioOH+79GYiZSPmomRkAIO/gE2df8Av534mAEx/LzR4q3A1ucAAAEAGf+eA7UEJQARAJFAH4cRAQgANQ15AHkDdQx1DYkABxsAGAM7BGkEBAADAgK4//hANg8QBlUCIAEAFAEBAAMAAhD5AA8QDwIPBwIBBgMDEAMCAAIBEgwMBlUBAQgQDw8fEAEQEAcgCLkCzQATEPbtMy9dMy8REjkvKzMzETMZETkvABg/PDwvXf0ROTmHBS4rK4cOfcQxMAFdXQBdJQMzEzY2NRMzAw4DBAUnNgE8uMmdqlYKwQoIE1Wk/sP+2huzgQOk/JdD+74Bbf7ny6TFkXgxphoAAAEAbv5oA/cEMQAZAJJACTgWSRZbFgMPF7j/8LICEBW4//BAFwIDbAgIDhoTDgwMGPkOBwUFBgYAFCARuP/4tAsMBlURuP/8QBENDQZVERQPDwZVESMQEAZVEbgCyEAWGwAgDBILDQZVDAgPDwZVDBIQEAZVDLkCyQAaEPYrKyvtEPYrKysr7RE5LzMvAD/tMy8/ERI5L+0xMBc4ARc4XQERFDMyNxcGIyImNRE2MzIEEREjETQmJiMiASZ7MiIVO0yCk7TB8AEkvjOgj2IDgf7negyLGYyLAY81xv7n/BYD12+JXAAAAQBz//AEBQQ3ACAAoEA5TQ5LEnoOiw4ELw4vEj0OPRIEGGwdHQIIC/kKCg35CAsAABP5AgcLCwoKIBoaGxsWECYFCBAQBlUFuP/4tA8PBlUFuP/4twsNBlUgBQEFvQLGACIAFgLPACD/+EAREBAGVSAODw8GVSAOCw0GVSC5AskAIRD0Kysr7RD0XSsrK+0ROS8zLxEzLzMvAD/tMy8/7TMv7RESOS/tMTABXV0TNjMyABEQACEiJzcWMzI2NTQmIyIHFRQzMjcXBiMiJjV6rb3pATj+wP7iw3EuYper98KiVFJ7MiIUOk2CkgQCNf7u/vz+//7QR54/w8Ss0RPCewyLGY2KAAEAGf5oA2EEJQANAKa5AAP/7EBBDxAGVQkDAVcEaAJmA2YEeAJ2BOkD+QMIGQEUCyYLLw82C0gCRwRYAggMEAEEbAAMEAwCDAwCAA4JCAMCBgQMIAG4//hAGgsNBlUBJA8QBlWPAQEfAS8BbwF/AQQBAQkCuP/wQBADIA8CPwJfAn8CBAICCCAJuQLGAA8Q9u0zL13tOBI5L11xKyvtOQA/PDw8PxI5L13tMzgxMAFdXXErAREBMwE2NjcTMwMCBREBWf7AywEAT0AKHcchHf7y/mgDKQKU/e8vc2EBDv7N/vJp/O0AAQAKAAADZgQlABEAm7kACv/sQBwLDAZVCxQNEAZVBw0vEzoFOgpICnYEhAQHDBAFuv/wAA3/8EAeBQ0FDQYMCgYMDLoLChQLCwoGCvkHChEMCwYJCQwLuP/wQBYPCy8LAgsLAAoGBgcHEQoQEAZVESAAuQLGABMQ9u0rMy88ETMRMy9dODMzLwA/PDw//TmHBS4rh33EARESOTkAOTk4ATg4MTABXSsrAQcOAgcTFSE1IQEzATY2NTcDZgoFIWp04/0EAhX9ttkBJ0tACgQlv191fEP+nnGgA4X+KTd9c7AAAAIAlv5oA/gEJQAUABgAn0AZEBp1BoMGAxYVDgoKFPkABgggCw4QEAZVC7j/9EAcDw8GVQsMDQ0GVQsWDAwGVQsLABIgAgYQEAZVArj/9bQPDwZVArj/9bcLDAZVEAIBArsCygAaABcC47IWFgC4/+m0DxAGVQC4//O0DQ0GVQC4//W0DAwGVQC5AscAGRD2KysrMi/tEPZdKysr7RI5LysrKyvtAD/tPz8vMTABXRMhERQGBwcGFRUjNTQ2Nzc2NjU1IRMRMxGWA2IpNTVSvyc+Oysb/VwQtwQl/vhxiUhIbnuqj22HTkw3WUmP+uMD7vwSAAABACgAAAOCBDEADgBotysKOwpJCgMDuv/wAAT/8EAVBwoO+QAGAAz5AgcODi8AAQAACCAFuP/yQAsMDAZVBQgNDQZVBbj/3bQPDwZVBbj/4LQQEAZVBbkCyAAQEPYrKysr7TMvXTMvAD/tMz/tPzEwOAE4AV0TNjMgFhURIxE0JiYjIgcomoEBQv2+PrCea5UEGxb5+/3DAgqRlFwUAAEAZP/jBSoEJQAhAJFARgcPCBMWDxwTGRorHy8jMQ81ED0TPRoxHkgUSBlZBVwSWh9oBWoSah91C3IMdBB2GnkfjAWJHokfHA4DAyER+RwLFgchBgi4//hAGBAQBlUWCBAQBlUhCBAQBlUIIAcHIRYgF7gCxrUjDgMAICG5AsUAIhD0/TIyEPbtEjkv7SsrKwA/PDw/7RI5LzMxMAFdARcSFzI2NRMzAw4DBxYWMzI2NjcTMwMGAgQjIiYCEQMBJgQGEWqqFcAYBhpRr5QZtoV7sFQOK8AkFWz+9dO7/X0OBCWs/vdmapQBHf6yVVhiSQxsgnW5qwHH/nfd/tq2tQFQARgBJQABACj/+ASTBDEAHgCaQExJFUkWWhVlD3UPBQHoAAAD+R0KEgoHGPkMBwoKABggBwsLCwZVBw8MDAZVBw8PDwZVBwgQEAZVQAcBBwcQAAABAQoJCS8KAQoKEyAQuP/1tAwMBlUQuP/dtA8PBlUQuP/gtBAQBlUQuQLIACAQ9isrK+0zL10zLxEzLzMvEjkvcSsrKyvtEjkvAD/9Mj8/7TMZLxjtMTABXTc3FjMyNjURIgcnNjMyBBYVESMRNCYmIwcRFAYGIyIoITQ9RTRWfRHk6+4BAIe/L562YCV1dF4ZjxI9UAJkEp8dUNXP/cMCCpuQWgL9fWRqRAAAAgCbAAADVwQlAAMABwBPtgIGCgMHBgm4AshAGQAgAw0PDwZVAwMMDAZVA5QEIAcUEBAGVQe4//20DQ0GVQe4//20CwsGVQe5AscACBD2Kysr/fYrK/3mAD88PzwxMAERIxEhESMRA1fD/srDBCX72wQl+9sEJQAAAgCbAAADVwQlAAMABwBPtgIKBgMHBgm4AshAGQAgAw0PDwZVAwMMDAZVA5QEIAcUEBAGVQe4//20DQ0GVQe4//20CwsGVQe5AscACBD2Kysr/fYrK/3mAD88Lz8xMAERIxEhESMRA1fD/srDBCX72wQl/dsCJQAAAgCbAgADVwQlAAMABwBOtQIGAwcGCbgCyEAZACADDQ8PBlUDAwwMBlUDlAQgBxQQEAZVB7j//bQNDQZVB7j//bQLCwZVB7kCxwAIEPYrKyv99isr/eYAPzwvLzEwAREjESERIxEDV8P+ysMEJf3bAiX92wIlAAEAWgKkAYkEJQADABlADAMAAAEGAjwBZAOsAC/t/O0APzMvPDEwExMzA1pizbYCpAGB/n8AAAIAWgKkAvwEJQADAAcAMEAaAAQBBQQEBQYCPAFkA6xfAAEAAAY8BWQHrAQv7fz9Mi9d7fztAD8zLxA8EDwxMAETMwMhEzMDAc1izbb+FGLNtgKkAYH+fwGB/n8AAgCbAAAF6wQlAA0AGwBqQAkWBgIQDwEPEhG4AtK1Dg4JCgYHuALSsgoGHbwCyAAXAtAAFgLRtAEBAAIAugLQAAMC0bMREA4QvwLQAA8C0QAHAtAACgLHABwQ9v327TwQPPbtPBA8EPb95gA//Tw/PBD9PC9dLz8xMAERIxE0JiMhESMRITIWAREzESEyNjURMxEUBiMEXqhGTv4hqAKoi5D9yqgB31g8qIiTAxf+QQGuTUP8agQllfxwAs39wk5CAwb86XObAAAC/6wAAAFeBUcADAAQAE65AAAC07cHrBAPChAGCrgC07QvAwEDErgCyLINIBC4//60CwsGVRC4//5ACw0NBlUQEhAQBlUQuQLHABEQ9CsrK/3mL13tAD8/EP7tMTARMhYVFAYGIyYmNTQ2AREjESkrFiYYJS8xAYHDBUc1IBgmFgEyISUw/t772wQl//8AKP5oA4IEMQImAqoAAAEHAo0ACAH2AB1ADwIBjw8BAA8PAgJBAQICD7kC2gApACsBK101NQD//wAo/mgDggQxAiYCqgAAAQcClQAIAfYALEAMAVAPkA8CkA+wDwIPuP/AQAwJDDQADw8CAkEBARK5AtoAKQArASsrXXE1////VwAAA0YFugAmAqwAAAEHApb+VgAAABZACgEAGxsmJkEBARe5AtsAKQArASs1////VwAAA0YFugAmAqwAAAAnApb+VgAAAQYCmOE5AEmxAjC4/+K0CgoGVTC4/+K3Dw8GVQAwATC4/8BAEwwONAAwKRQTQQEAGxszM0ECASa4AtyzKQEBF7kC2wApACsrASs1KytdKys1AAABAC0AAAPBBCUADQCCQCAvDzsJOgp5BnkJeQqBAgcqAioGKgkqCjwCOwYGBgkICLj/9kAuDhEGVQi6BwYUBwcGBgk6BfkEBAMKDAcGCQkECQgGCAcHDQQEDCAvDb8Nzw0DDbkCzQAPEPZd7TMvEjkvMzMRMxkROS8AGD88PzwQ/eQ5hwUuKyuHfcQxMAFdXQECACMhNSEDMxM2ExMzA7cR/vvq/nYBFLHJou4NCsEDDP4o/sygA4X8eUMB1wFtAP//AGT/4wUqBUYCJgK5AAABBwKWA30AAAAaQA0BTy4BCi4uFhZBAQEiuQLdACkAKwErcTX//wBk/+MFKgVGAiYCuQAAAQcClv9qAAAAFkAKAQAuLiEhQQEBIrkC3QApACsBKzX//wBk/+MFKgVGAiYC4QAAAQcClgN9AAAAGkANAk87AQo7OxYWQQIBL7kC3QApACsBK3E1//8AZP/jBSoFRgImAuEAAAEHApb/agAAABZACgIAOzshIUECAS+5At0AKQArASs1//8Aaf7FBEoEJQImAqAAAAEHApQA6wAAABZACgEAFxgGEUEBARe5At4AKQArASs1//8Aaf5SBEoEJQImAqAAAAEHApUA6wAAABZACgEAGRoGEUEBARm5At4AKQArASs1AAIAaQAABEoEJQAVACUBHkBTghSAFacM2ADXFQVVA1YJVgxnA38IcxSMCQc7FUgBTQJJCE0JSQxNFQcZCCYMOAE6AjsIOwk5DAc/FYEJjxWmDNoVBQgCKRMoFT0CBAIYDBEGVQy4/+i0DBEGVSK4AtNALLAaARoaBgoVDAsLAAIJCgEBAAsLugoBFAoKARUMAQkECgYFAAEKERALCgYeuALTQCEAFiAWfxavFr8WBR8WLxYCFhYFDxASBAUHCQIMFQQRBgG4AmC3gAABAAAQIBG4Asq2JwsKBSAKBrkCyQAmEPYy7S8zEPbtMy9d7RESFzkzETMyETMSOS9xXe0APzw8PD88PDwSFzmHBS4rh33EBw48PIcOEMQ8ABgREjkvXe0rKzEwAF1dAV1dXV0hIwEGBwMjExI3AzMBNjY3NzMHBgYHATQ2NjMyFhYVFAYGIyImJgRK7P5rXRIrxisesvfrAVQ+Mg0ZxhgRbGf+rRcmFxgmFhYmGBcmFgI9M5v+kQFvAQBaAVz+JSltcNXbnK8+/t0YJRcXJRgYJRcXJQD//wAyAAAEKQQxAiYCoQAAAQYCmAjsACBAEwEAHRAdIB1gHQQAHRYPD0EBARO5At8AKQArAStdNf//ABkAAALoBDECJgKiAAABBgKY2EYAKEAaAUAkgCQCICRQJJAksCTAJAUAJB0REUEBARq5AuAAKQArAStdcTX//wAtAAAD5AQlAiYCowAAAQYCmE4AACBAEwEAEhASIBKwEgQAEgsFBEEBAQi5AtwAKQArAStdNf//AJYAAARABDECJgKkAAABBwKYAQz/vgAeQBECQB1wHbAdAwAdFg8IQQIBE7kC4QApACsBK101AAIAAAAAAbAEJQADABIAV7kADALTtwQCCgMGAyAAuP/uQBwQEAZVAAoNDwZVAEBDRDQAQD01nwABTwD/AAIAuwLIABQACALTQAkvDwEPQBARNA8vK3HtEPZxcisrKyv9AD8/L+0xMAERIxEDMhYWFRQGBiMiJjU0NjYBsMKaFiUZFiYYHzUWJgQl+9sEJf5xFCYaGCYWKykYJRcAAAIAAAAAAzsEJQATACIAjkAKDyQfJFABYgEEHLgC00AdEBQBFAkKACcR+RIGEBAAEQggCQIQEAZVCQkDIA64//pAKwsNBlUOFg8PBlUOAhAQBlUOQA4QNE8OAQ8Ozw7fDgMOE0AOFzQPEx8TAhO4AsyzJBLFGLkC0wAgL/3mEOZdKy9dcSsrKyvtMy8r7RESOS8AP/3kPy9d7TEwAV0BIgYVFBcWFRUjNTQnJjU0NyE1IQEyFhYVFAYGIyImJjU0NgM7ma0JGsAUB4f+9AKD/RkWJRkWJhgYJRcwA56vkx1U8maTrmrcSjGlcaD+qhQmGhgmFhYmGCMxAP//AIz/4wRABDsCJgKoAAABBwKYARQAAAAWQAoBACghHRZBAQEeuQLfACkAKwErNQACAAACAAGwBCUAAwAQAGa5AAoC00AMBAQAAgECAgMGAyAAuP/uQCIQEAZVAAoNDwZVACgLDAZVAEBDRDQAQD01nwABTwD/AAIAuwLIABIABwLTQAkvDQENQBARNA0vK3HtEPRxcisrKysr/QA/My9dOS/tMTABESMRBzIWFRQGIyImNTQ2NgGwwpofNTEjHzUWJgQl/dsCJfYrKSMxLCgYJhYA//8AKP5oA4IEMQImAqoAAAEGApgSuAAWQAoBABkSDghBAQEPuQLhACkAKwErNf//AFD/8ANWBDcCJgKrAAABBgKY9cwAKLEBIrj/4EAUCwsGVQAiYCJwIgMAIhsNB0EBARi5At8AKQArAStdKzX//wA8AAADRgW6ACYCrAAAAQYCmB85ADexASG4/+K0Dw8GVSG4/+K3CgoGVQAhASG4/8BADAwONAAhGhQTQQEBF7kC3AApACsBKytdKys1AP//AFAAAAQ+BDECJgKuAAABBwKYAT//vAAWQAoBACUeFQ5BAQEbuQLfACkAKwErNf//ADwAAAI8BDECJgKwAAABBwKY/2L/zgAxsQEcuP/itAsNBlUcuP/AtwwONBAckBwCuP/qtxwVAgNBAQESuQLfACkAKwErXSsrNQAAAwBa/+EEPgRCAA0AGQAoARlAIS8qXBJcFlMYpwmoDecB6QYINxhHGFMCWQVZCVMMUxAHIrgC00AZfxqfGgIgGt8aAi8aARoaFxH5CwsX+QMHHrgC00ASHyZPJgJfJo8mnyYDJiYOFCYHuP/0QAsQEAJVBwwPDwJVB7j/9EALDg4CVQcKDQ0CVQe4//ZACwwMAlUHAAsLAlUHuP/mtAsLBlUHuP/wtA0NBlUHuP/ytAwMBlUHuP/4tA8PBlUHuALGQAoqDiYACgwPAlUAuP/2QB0LCwJVAA4LCwZVAA4NDQZVAAwQEAZVABQMDAZVALj/9rQPDwZVALkCxQApEPYrKysrKysr7RD2KysrKysrKysrK+0ROS9dce0AP+0//RE5L11xcu0xMAFdXRM0ADMyFhIVFAYGIyIANxQWMzI2NTQmIyIGBTIWFhUUBgYjIiYmNTQ2WgER4YbYlHDioOH+79GYiZSPmomRkAEjFiUZFiYYGCUXMAIO/gE2df8Av534mAEx/LzR4q3A1udZFCYaGCYWFiYYIzEAAgBu/mgD9wQxABgAKADpQCAJIB8iNAkgDhE0SRVLFlsVixa4DwUZFSkVOBU9FgQPF7j/8LICDhW7//AAAgAZAtNAEyEhA2wICA0pEg4LCxf5DQcFxQa4/8C1GSg0BlUduALTtiUUDw8GVSW4/+pAFAwNBlUlQCMmNCVAGRw0JSUAEyAQuP/4tAsMBlUQuP/8QBQNDQZVEBQPDwZVECMQEAZVLxABELgCyEAWKgAgCxILDQZVCwgPDwZVCxIQEAZVC7kCyQApEPYrKyvtEPZdKysrK+0ROS8rKysr7f4r5AA/7TMvPxESOS/tMy/tMTAXOAEXOF1dKysBERQzMjcXBiMiERE2MyAWFREjETQmJiMiATIWFhUUBgYjIiYmNTQ2NgEmXC0fEzZE+bTBARr6vj+lfmIBCxglFxYlGRgmFhMnA4H+53oMixkBFwGPNeb5/BYD13WRTv6jFyUYGSUWFiYYFiUZAAIAc//wBAUENwAgAC0A1kATTQ5LEnoOiw4ELw4vEj0OPRIEIbgC00AcKCgYbB0dAggL+QoKDfkICwAAE/kCBwsLCgogG7j/wLUZIzQbPiW6AtMAK//kQCAMDQZVKwgQEAZVK0AhIzQrQBkcNCsrFhAmBQgQEAZVBbj/+LQPDwZVBbj/+LcLDQZVIAUBBb0CxgAvABYCzwAg//hAERAQBlUgDg8PBlUgDgsNBlUguQLJAC4Q9isrK+0Q9F0rKyvtETkvKysrK+3uKxEzLzMvAD/tMy8/7TMv7RESOS/tMy/tMTABXV0TNjMyABEQACEiJzcWMzI2NTQmIyIHFRQzMjcXBiMiJjUFMhYWFRQGIyImNTQ2eq296QE4/sD+4sNxLmKXq/fColRSexIKFSdCYpkCChglFzAkIzEwBAI1/u7+/P7//tBHnj/DxKzRE8J7AocTg4dJFyUYJDAwJCMxAP//AAoAAANmBCUCJgK2AAABBwKY/2X/jQArtwEcEgsMBlUcuP/uQBANDQZVABwcCQlBRwsBAQESuQLhACkAKwFxKysrNQD//wCW/mgD+AQlAiYCtwAAAQcCmADIAAAAOkAcAiMIEBAGVSNAPkM0I0AzNzQjQB0fNP8jAXAjAbj/o7cjHBcTQQIBGbkC4gApACsBK11xKysrKzX//wAoAAADggQxAiYCuAAAAQYCmBK4ACCxARm4/+5ADQ0NBlUAGRIOCEEBAQ+5AuEAKQArASsrNQACAGT/4wUqBCUAIQAuANhAWi8wzRPLFMsZ2hTaGQakC6QMqhSqGbsUuxkGeR+MBYkeiR+bFJkZBmoSah91C3IMdBB2GgZIFEgZWQVcElofaAUGKx8xDzUQPRM9GjEeBgcPCBMWDxwTGRoFIrgC00AQKCgRDgMDIRH5HAsWByEGJbgC07ZvLAEsLBYIuP/4QBsQEAZVFggQEAZVIQgQEAZVCCAwBwEHByEWIBe4Asa1MA4DACAhuQLFAC8Q9v0yMhD27RI5L139KysrETkvXe0APzw8P+0SOS8zETkv7TEwAV1dXV1dXV0BFxIXMjY1EzMDDgMHFhYzMjY2NxMzAwYCBCMiJgIRAwEyFhUUBiMiJiY1NDYBJgQGEWqqFcAYBhpRr5QZtoV7sFQOK8AkFWz+9dO7/X0OAxAjMTAkFSUaMAQlrP73ZmqUAR3+slVYYkkMbIJ1uasBx/533f7atrUBUAEYASX+AjEjIzETJxojMQD//wAo//gEkwQxAiYCugAAAQcCmAGG/6MAHEAPAaApsCkCACkiGBJBAQEfuQLhACkAKwErXTUAAgCbAAABXgVGAAMAEgBOuwAMAtMABALdtAIKAwYIuALTsxAQAxS4AsiyACADuP/+tAsLBlUDuP/+QAsNDQZVAxQQEAZVA7kCxwATEPYrKyv95hI5L+0APz8/7TEwAREjERMyFhYVFAYGIyImJjU0NgFew2AWJRkWJhgYJRcwBCX72wQlASEUJhoYJhYWJhgjMf//ADIAAAQpBUsCJgKhAAABBwKbAIYAAAAkQBYBFEASFTQAFBAU4BQDABQVCwtBAQEUuQLdACkAKwErXSs1//8AUP/wA1YFSwImAqsAAAEGAptkAAAWQAoBABkaDQdBAQEZuQLdACkAKwErNf//AHP/8AQFBUsCJgK0AAABBwKbALwAAAAjtAFAIgEiuP/AQAwJCzQAIiMCAkEBASK5At0AKQArASsrXTUAAAEAPAAABGQFugAZANJAI2wCcQhzCQMFDxoIJxg0A0sASwFXGW8IigiCGAoCGAwRBlUQuP/oQDsMEQZVDBkQDw8AAgkKAQEKCiAPABQPDwAZEAIJBA4GBQABCgv5DhQVFQ8PDgYWExQEBQcJAhkQBBUGAbgCYLeAAAEAABQgFbgCykAPGwoLDA91Dg4NIAwMBSAGuQLJABoQ9u0zL/08EOQQPDIQ9u0zL13tERIXOTMRMxEzMgA/PBA8EDwQ7T88PDwSFzmHBS4rfRDEBw48PIcOEMQ8ABgvKysxMAFdAF0hIwEGBwMjExI3JyMRMxEzATY2NzczBwYGBwRk7P5rXRIrxisesoa8vngBVD4yDRnGGBFsZwI9M5v+kQFvAQBavAI1/mv+JSltcNXbnK8+AAAB/9z+7QAkBQkAAwANtAIDAKsDL+0ALy8xMBMRIxEkSAUJ+eQGHAAAAf8l/u0A2wWFAA4BAUASGAUXCwJNAk0OAgEM5Q0NBOUDuP/AswkONAO4AthADQUK5QkG5QkHQAkONAe4Ati2BQhAPz80CLj/wEA0Fhc0CAgFCwUOAkCNjjQCQFtcNAJAJik0AkAOFzQCAgUiCRQ0BQzlDQrlCQ1AKy00AA0BDbgC1kAJCUArLTQACQEJugLWAAv/3kAPKzM0CwsOqwIE5QMG5QcDuP/AtistNA8DAQO6AtYAB//AtistNA8HAQe4Ata3BSIrMzQFBQIvMy8r5F0r5F0rEOwQ7BD9Mi8r5F0r5F0rEOwQ7AAvKzMvKysrKzwQPBEzLysrEP0rPOwQ7BD9K+w8EOwvMTAAXQFyEyMRByc3JzcXNxcHFwcnJEiGMaurMaqqMaurMYb+7QVtiDGpqDGrqzGoqTGIAAH/3P7tAa4FhQAKAF9ANgYK5QlyCAAAAwgB5QJyAwMEqwgHAHIIBasGBgcK5QkB5QICCegICAMiKCk0A0AJCzQDpQSrBy/99isrPBD0PBDsEOwQPBDtEO0ALzz9PBD05BkREjkvGBD05C8xMAEHJzchESMRISc3Aa7ZMYn+9kcBUYkxBK7WMYL6YgXlgjEAAAH+Uf7tACMFhQAKAHpALgxACQo0AQflCHIJBgYJAwXlBHIDqwkCqwkKBnIJAasAAAoH5QgF5QQECOgJCQO4/96zKCk0A7j/wEANCQs0A6UCqwpACQo0CrkC2QAMEPUr/fYrKzwQ9DwQ7BDsEDwQ7RDtAC887RD99OQZERI5LxgQ9OQvMTABKxMjESEXByc3FwchI0f+9okx2dkxiQFR/u0FnoIx1tcxggAAAQCrARgB7QOMABEAQ7ELCrj/wLMPETQKuP/AtQwRNAoKA7gC7LcLCgoADw8GALj/wLUQETQAAAa4ARyFLzMvKxI5LxI5LzMAPzMvKyszMTABFAYjIiY1NDc2NxcGBwYVFBYB7VA/TWZYK1YhOx832QGhNVSQa5VwNz03NihHNjYwAAIAoAEWAeIE4AARAB0AXbELCrj/wLMPETQKuP/AQAsMETQKCg8DAQMDG7wC7gAVAuwAEgLtQAsYGAYLCgoADw8GALj/wLUQETQAAAa4ARyFLzMvKxI5LxI5LzMRMy/tAD/9Mi9dMy8rKzMxMAEUBiMiJjU0NzY3FwYHBhUUFgMUBiMiJjU0NjMyFgHiUD9NZlgrViE7HzfZG0MwMEdGMTFCAvU1VJBrlXA3PTc2KEc2NjD+Ii9FRS8wREIAAgBDARgCnAWxACcAMwCDuQAU/8yzDhE0FLj/4EARCgw0BEAVGjQEQAkRNAQEGQ26AvEAJQLytxlACQs0GRkxvALuACsC7AAYAvG2GRkoLgoKALgC7UAPB0ASEzQHB4AQARAQIiIougLtAC4BJIUv7TMvMy9dMy8r7TkvERI5L+0AP/0yLys/7RE5LysrMTABKysBFAcGIyImNTQ2NTQmIyIGFRQXFhcWFRQHJzQ3NzQnJicmNTQ2MzIWAxQGIyImNTQ2MzIWApwkKUAyQm5ANEFTKkAOKgo9AQVKfgxLtIV4qLZJNDFISTQzRgS5Pi81QixERBYiKkk1MUx0Iml6QlIBEgo0OEJwDllvh7KJ/GwzSUoyNElKAAEAeQCTAugDMwAkAJe1CyAQETQhuP/gQA8QETQXExhADhU0GBgcIwC6Au8AAf/AtwkNNAEBIwoTuALvshwcI7gC77UKBgoFBQq4AutADSMjGBgXFwEAAAEBJga4/8BADAkKNAYFEA4PNAUFH7oC8wANARaFL+05LyszKxEzLzMvETkvOS85LwA/My8SORD9Mi/tERI5LyvtERI5LysROTEwASsrAQcGBwYHJzY3NjcnJjU0NzY3NjMyFxYXByYnJiMiBhUUFxYXNgLoMJhicV0fDRYTGXQzKDA+UFFLMQsoNCUHPScwaDwvX4sCGaQmLzZXES4nIhtCIiggVGRDVisJLoMZBSc2IikmHSJDAAH/ugElAagB0wADABi9AAIC7wABAusAAALwsQUBLxDkAD/tMTABITUhAaj+EgHuASWuAAACAEYE1wGcBj0ABwAQAES5AAAC9bICAga4AvVACQRACQ40BAQPCLgC9bILCw+6AvUADQL0tAAICAQNuAEkhS88My88AD/tMy/tETMvK+0zL/0xMAEUBwYHNDc2FxQGBwYHNDc2AZwzW8gsU9cbF1zILFMGPS4rJVArKCM+MBcUJVArKCMAAAIARgTXAeUGWgAvADoArUAJAzkJJQgIIw0tugL1ADP/wLULDzQzMzm4AvW2JSUUGBgjHLgC9bIUFCO6AvUADQL0QA4IBjkJMCU1KSMfEQYGALoC9gAw/8C1CQo0MDA1uAL2QAwpQAkRNCkpHw0YGBG6AvYAH//AsxcbNB+4/8CzDhI0Hy8rK/0yLzkRMy8r/TIvK+05LxESORESORE5ORI5AD/9Mi/tEjkvETkv/TIvK+0REjkvEjkROTEwARQGBxYWFRQHJwYHBiM2NzY1NCYjIgcGBzY3NjMyFhUUBwYHNjcmJyY1NDc2MzIWBzQmIyIVFBcWFzYB5RYWDhIHVi46R1coBAwUExQSBxQHCxQuIiYEBwNFPxEQGicrNRsmRxgUFhIFHg0GGiVBIgoXDS8pQzYeJEIJGxgYJRgKI0YfN0IqFRUdDxQvEBEdIC8vNCZVFyYcEhQGGxMAAAIARv72AZwAWwAHAA8ARbkACAL1sgoKDLoC9QAO/8C2CQ80Dg4EALgC9bICAga6AvUABAL3tAAICAQMuAEkhS88My88AD/tMy/tETMvK/0yL+0xMCUUBwYHNDc2FxQHBgc0NzYBnDRayCxT1zRayCxTWy8sI1EsKCI7Ly0jUisqIwABAEYFYgGcBjEABwAjuQAAAvWyAgIGugL1AAQC9LIAAAS4ASSFLzMvAD/tMy/9MTABFAcGBzQ3NgGcNFrILFMGMS4tI1EsKCMAAAIASATXAa0GigAdACgAirUaJwQNAxS6AvUAIf/AQAoLDTQhIScDAwknuAL1sg0NCbgC9EAMAwAXDQQnAx4kAAAXuAL2sx4eJAi4AvayCQkRugL2ACT/wLMaHDQkuP/AsxMVNCS4/8CzDhA0JLgBHYUvKysr/TIv7REzL/0yLxESFzkREjkAPzMv7RI5LxEzLyvtERI5ETkxMAEUBgcnBgcGIyM2NzY3JicmNTQ2MzIWFRQGBxYXFic0JiMiBhUUFxc2Aa0GA1MyEkoySTVHQCEfEBRNLRoqCxQQEQtLJhIKCxksCAV9ESQSMjcSSBk4MycTFRofQmU4KBMpNw4NC10bLg4HFhgiFAAAAQBG/9UBnACkAAcAI7kAAAL1sgICBroC9QAEAviyAAAEuAEkhS8zLwA/7TMv7TEwJRQHBgc0NzYBnDRayCxTpDAsI1ArKCIAAQBGBNcBsQYZACgAh0AbBxgEJSYhHB0RGB0dEiZACQo0JiYPEgESEhghuAL1sgQEGLoC9QALAvS3Bx0cFRIRACa4Avm0JSUdDhG4AvmyEhIdugL5ABz/wLMVFzQcuP/Asw0QNBwvKyvtMy/9MhEzL/0yERI5ERI5AD/tOS/tETMvXTMvKxI5LxE5EjkREjkREjkxMAEUBwYjIiYnBgcGIyImNTQ2NzcUBhUUFjMyNzY3NxYXFjMyNzY1NxYWAbEaHTMSHhMVEiAjKioODRUEEhIrGgwSFQgFDBwmFhIVBAcFxUswNgwNJBIgOTIaMiAJCCQMFiM4GksGMQsfMigrBhMvAAACAEYE1wFRBg0ACwAYAC25AAkC9bIPDxa8AvUAAwL0AAAC9rIMDAa6AvoAEgEdhS/tMy/tAD/9Mi/tMTABFAYjIiY1NDYzMhYHNCYjIgYVFBcWMzI2AVFcQzY2UDs2SjxOGxokIRoxGSIFdz5iPDZNd1pXHEQtGCMOCw4AAQF8AcACwQOdAA0AHUAOCgoDCiAQEzQDCgcAAAcvMy8SOTkrAC8zLzEwAQYGByYnJic2NjcWFxYCwRwcE1UwIFUVIyI4OSYC6FdsZTAiF0Rbdl8xLB0AAAEBLgElAp4FuwATADuyDQ0OvALyAAUC6wAS//BAEAkSNAcEDg4FDUALHTQNDQS5AvsABS/tMy8rGRI5LxE5KwAYPz85LzEwAQEUBwYHIzQ3NCcmJyYnNxYXFhcWAp4OAxkiBDotTyhKYE8wRCMqAsdadx20GHPUuI9+QFrYX1FzgJgAAAEAtwElAyEFyAAgAH+xBgS4Au9ADBlADhE0GRkVFBQPFbwC8gAdAvIADwLrtRFADhg0Cbj/9LMJETQduAL7sx4eDga4/9ZADw4RNAYVFQ8UQAsdNBQUDrkC+wAPL+0zLysZEjkvOSsRMxgv7SsrAD8/PxI5LxE5Lyv9ObEGAkNUWLQUQA8RNAArWTEwARQHBiMiJxYXFhYVFAYVIwInJiYnNxYXFjMyNzY3NxYWAyE0OWgNOCYQGxwEHkwZMIODQkM0X2pwKxgNIAQEBRtuQkgIUC9P1LIfjQYBQ1Wm96TKXy5USylrAiNdAAEAgQElA8QFyAApAJa3FSAOETQGHAO4Au+zJCQYCbgC70ALjxwBHBwSFxcYEiZBCQLyACAC8gAYAvIAEgLrACAC+7MhIREnugL7ACb/wEAXDBI0JiYOEYAJAQkXGBgSF0AKHTQXFxG6AvsAEv/AswkMNBIvK+0zLysZEjkvETldETMzGC8r7RI5L+0APz8/PxESOS8ROS9d7RI5L/0ROTEwASsBFAYjIiYnBgYjFhcWFhUUBgcjNAInJic3FhcWMzI3NjczFhYzMjczFBYDxF9jOVQUImhJJRAdHwsYKDhENINJNDxDUlUwKRAgCDg0aRQhBQVjfYQkJTg5SSdHoHE/dZncARqFZcHtViwxOjJcXEqmFkkAAQEsASUDLgW1ACsAcrOEHwEfuP/AswsRNCC4/8C3ChE0IA0NABi+Au8AFwLyAAAC7wABAuu2AQAAGBcXIrgC/LMNDSgRuAL8shwcB7oC/AAoAS6FL/05L+0RMy/tOS8zMi8zAD/tP+0ROS85K7EGAkNUWLIJDQEAXVkxMAErXQEHIicmJyY1NDc2NzY3JicmNTQ3Njc2NwcGBwYVFBcWFxYVFAcGBwYVFBcWAy4/WlNuQ1IjHj4hXFVVZUo5bUxdH28lWEtGR0xEPz9EiVkB78oNESIpPTk8M0IjVyAhLS5MZE1iREfAKRIrJCAhGxofGh1IQkFNKTAgFQAAAgC+AfoDgAT5ABAAIQBAQBAUQA4RNBkgDhE0FEAJETQOuALvshcXH7sC7wAEAAAC/rIREQi6Av0AGwE0hS/tMy/tAC/9Mi/tMTABKysAKwEUBwYjIicmNTQ3Njc2MzIWBzQnJicmIyIHBhUUFxYzMjYDgGd113lGUCwyRlZcdvZKUENlXS9CLCRFP3x6nAOZrXGBKjBbUYeYYnju3DlCNy0pWklIUiYjSQABAK8BQANHBa8AKABvuQAo/+CzDBE0J7j/6LYJETQfFgsPuAL/sxsbFgC4/8C2DhE0AAABFrwC8gABAusAFwL7thYWBx8BCwe4Av5ACyNAEBE0IyMBAAABGS8zGC8RMy8r/TkSOREzL+0APz8SOS8rETkv/TkSOTEwASsrAQcmJyYnJjU0NzY3BgcGIyInJjU0NjU3FhcWMzI3NjcGBwYVFBcWFxYDRyZBITgdJAUBFTAXSi+cMCYGJBgWLmpPYxZVEQcMHBYuEAIk5CslPVtvozo9EbYJBA4gGU4hhCIENxIlEwQTZzNXQaFuV0gZAAABAIEBJQOsBa8AEQCFQCAMIA4RNAMmDhE0AzQJDTQBAQAIQA4RNAhAChE0CAgJALoC8gAJAvK1DSAJDTQNugL/AAUC60ALDg0FCAkBAAAJBAW4AUeFGS8zMzMvMy8zETMzABg/7Ss/PxE5LysrEjkvsQYCQ1RYQA8NyA8RNA2WDg40DUAJDTQAKysrWTEwASsrKwEDBgIDIwICJxMWFxYTMxI3NgOsCJSuKQ5Ax6Mkm2ViPwonWVYFr/7hl/5e/s4BMwGEkgE9tdHL/vgBFtnSAAABAJoBMQPGBbsAFgCTQBMGVA4RNBMmDhE0EzQJDTQMDAsAuP/Asw4RNAC4/8C1ChE0AAABvALrAAsC6wAE/+CzCQ00BLoC/wARAvJACwUEEQwLAAEBCxARuAFHhRkvMzMzLzMvMxEzMwAYP+0rPz85LysrEjkvsQYCQ1RYuQAE/zizDxE0BLj/arMODjQEuP/AsgkNNAArKytZMTABKysrAQMmAicjBgcGBwYHETY3NhMzFhcWFxYDxiSU3jEHKyAqPD9ukFlWMhMzPztQQgJz/sSZAcj94XKXdnyIAR6F1c8BQ+6elG5aAAACANsBJQNNBcwAGgAnAGq5ABr/4EANDBE0AxAJCjQbHwUlALj/wLYPETQAAAEIuALvsyUlAR++Au8AEQLyAAEC6wALAv2yIiIbugL9AAUC/bUXFwEAAAEZLzMYLxEzL+39Mi/tAD8/7RE5L+0ROS8rETkSOTEwASsrAQcmJyYRBgYjIiY1NDc2NzYzMhcWFxYVFhcWAzQnJiMiBhUUFjMyNgNNPWQgGkREIW2BHiZAUm9TKyMLBxQiD64XH1A8cGJGHlYB+tU9kHYBLRgOWlQ+W3RHW1dGi1ao5l0pAgpbL0BaJyouDAAAAwCFAKwDtAY4AAsADwAbAFBACQ8CDxs0Bg0BA7gC7rMJCQ8ZuALusxMTDha4Au2yEBAPuAMAswwMHQC4Au2yBgYNuQMAAA4v7Tkv7REzL/05L+0ALzMv7S8zL+0xMAFdKwEUBiMiJjU0NjMyFiUBIwETFAYjIiY1NDYzMhYBtEw3Nk1MNzdMAgD9Pm0CvERMODdKSzY2TgW5N05PNjVKSEf6hgV6+vc2TEw2Nk9OAAABAMEAMAHXAiIAFAA5uQAS/8C1DBE0EgcGuP/AtgwONAYGEgu4AuxACQcGBgsLDwAADy8zLxI5LzkvMwA/MzMvKzMvKzEwARQHBgcGByc2NzY1JicmNTQ2MzIWAdcmHzsiSipFFykxJSlLNjlWAZpVSTs5ITc3NxktKBMgJDw2TVAAAgCzAzoDZAX0AGcAcwEcuQAN/+CzCxA0I7j/4EAyCxA0DSMYAzAecWU2a1kgCxA0QiALEDRZQkdOGBgsOQZhBGsfKg8HBHEeRlU7YARrRx68AvsAEQL7AHH/wLUKDTRxcVS6AvsARwL7tR9rAWtrTrgC8kAZCiALEDRcIAsQNApcXwABAABRFWFoSxtuP7j/4LMLEDQmuP/gQB4LEDQ/JixQMwEzM0ZHVFUPER4fCG4HYGFoOypuLAa6AvsAYQL7t2hACgw0aGg5vAL7ACwC+wBuAUCFL+XlMy8r5eUREjk5ERI5ORIXOTIvcRI5OSsrETk5ERI5OTMvcTk5KysAPzMvXeXlMy8r5eUREhc5ERIXOREXOTIvERI5OSsrETk5ERI5ORE5OSsrMTABFAYjIicnBxcWFRQGIyInBgcWFxYVFAYjIiY1NDY3JwYHBiMiJjU0NzY3JicGBwYjIiY1NDYzMhYXNjcmJyY1NDYzMhcWFzcmJyY1NDYzMhYVFAYHFzY3NjMyFhUUBwYHFzY3NjMyFgU0JiMiBhUUFjMyNgNkLCE1SkoKdlYlHDRqCQwWCREhIB8hJBIbIiEuMBwkVghxCANDITsrISsqIixrMwMIPTxWJBwvLigcGQIXGyEfICElERs/Ay4uHSRVSS4KQSE8KyMq/s8WEhEWFhERFwSWHSQZGh46LzYcJ88GA0QiPCweKCcfLW4zCUA/UCYdNi4ENxAOFwoSIx4fJCUSEBIcHS02HShQTDQICUNRMR4rKh8tbTIKegVRKB01LSQWIhgLFCMgEhYWEhAYFwAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgA2AQoCGANxABEAHwBQQAkWIA0RNAwWHQ64Au+yDQ0dugLvAAQC60AJFhIMDQgODhoSuAL9swAAIRq6Av0ACAEohS/tETMv7RkROS8SOTkSOQAYP/0yL+wSOTkrMTABFAcGIyInJjU0NzY3JzcWFxYHNCcmJwYHBhUUFjMyNgIYLke9STA3IyAhDz21I3hXbi82LQkcOTA4hAJMjUduHSE9RlxOTwSpXxlUpyY/GxoxDCcjMzk/AAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAEAngEtA6QFwwAsALe5ABL/4LYQETQLDBkEuP/gQAsJETQEExAaGSAdGbj/wEAKCQ40GRkWEBAHHbgC77UAFgEWFge4AvKzAAAnAboC8gAnAutACgwLCxMkGiYgABO4Avu0BAQmABm4AvtAEBoaICYAAQEnAEAMHTQAACa4AvuzMCcBJy9d7TMvKxkSOS8REjkyGC/tERI5L+0SORESORE5LzMAPz8SOS8/OS9d7RI5LxI5LysRORE5ETk5KxI5OTEwASsTNxYWFzY2MzIXFhcHJicmIyIGBxYWMzI2NxcGBiMiJicWFxYVFAcjNCcmJyaeS1pKRw5fWz0xLTEIBSExLl1xHTNJH1JyPhccm3o7RSgqDAkzIyciRDYEy/CiYCqjkR4bPAwBCxBpdBAPOEsIk5oVHWBBMmuO6du0n45xAAACAJgBRgOHBaoAFgAsAHtAGSMgCxE0HyALETQXIRYDABoMKgkAQA4RNAC8Av8AAQLyABoC/7IJCSq6Av8ADwLrQBAXDCEWKgsRNBYWHQABARMduAL+swUFLie6AvwAEwEshS/tETMv7RkSOS8zEjkvKzM5OQAYP+05L+0/7SsREjkREhc5MTABKysBNxYXFhUUBwYjIiYnBgYjIicmNTQSNxMWFjMyNjU0JyYnBgcGBwYVFBYzMjYBrkLSaVxBSmscMBwsWS9fPUGixFAWTSgwQVdQjSkwQCcxRD0rRwTP29HQtpd4aXcOFyUeNDdfcQEd5P3UFyAzJ0qHfJ4rQ1lSZ0pAShwAAQDLAS0DewW9ACMAebUVIA4WNAq4/+C2CxE0DxATHbgC77YcHBkTEwwDuALvsxkZAAy6AvIAAALrQBUDQA8QNANACw00AxwjEA8PHRwcIxa4AvOyBgYjugL7AAABIoUv7TMv7REzLzM5LzMREjkrKwA/PxI5L+0SOS8SOS/tEjk5MTABKysBNBI3IiY1NDY3NjYzMhYXByYmIyIGFRQWMzI2NwcGBwYHBgcBWEdRlZBOSzt2LTVzSwpJTTF9lWxfVo17LWJeaERNFAEtqwEuhT8+L5FZSlJWXwoZEEMyNjwiOL8iWGGHmLQAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAwBGBNcBsQdXAAcAEAA6AM65AAAC9bICAga4AvVACQRACQ40BAQPCLgC9bILCw+4AvVAGw1ACRE0DQ0kGCoVNzgzLi8jKi8vJDg4JCQqM7gC9bIVFSq6AvUAHAL0tAAICAQNuP/BQAwPEDQNGC8uJyQjETi4Avm0NzcvHyO4AvmyJCQvugL5AC7/wLMVFzQuuP/Asw0QNC64ASSFLysr7TMv/TIRMy/9MhESORESOS8rPDMvPAA/7Tkv7REzLzIvEjkvETkSORESORESOREzLyvtMy/tETMvK+0zL+0xMAEUBwYHNDc2FxQGBwYHNDc2FxQHBiMiJicGBwYjIiY1NDc2NzcUBhUUFjMyNzY3NxYXFjMyNzY1NxYWAZwzW8gsU9cbF1zILFPsGh0zESERFBMgIykrCAUOFQQSEisaDBIVCQQMHCYWEhUEBwdXLislUCsoIz4wFxQlUCsoI6JMMDYNDCITIDkxGh0SJAgIJAwWIzgZSwcxCyAyKS0GEzEAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAf+6ASUFGwHTAAMAGL0AAgLvAAEC6wAAAvCxBQEvEOQAP+0xMAEhNSEFG/qfBWEBJa4AAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAQAOv6ZBbUDwAAcACAAJAAoAO61JBASFTQeuP/wsxIVNCi4//CzEhU0ELj/wEALDhE0FjQMETQhIyK4AwK1JCQeJScmuAMCtCgoHR8euAMCQAxvIAHfIAEgIAEKEglBCQMEABcC7wAYAwQAEgLvAAEC67IiJCG4AwG1IyMlHiAduAMBtB8fJignuAMBtyUlBRgYFxcTQQoDAwBAAAAC8AAqAAoC+wAgAAn/wLUJCzQJCQ66AwMABQEqhS/9MhkvKxrtGBD0Gv0yLxk5LxgROS/9OTkzL+05OREzL+05OQA/7T/tPxI5ETMvXXH9OTkzL/05OREzL/05OTEwASsrKysrASEiJyY1NDc2NxcGBwYVFBcWMyE1NCYnNxYXFhUBByc3EwcnNycHJzcFtfxGwHKPKg85HhYVHXxvqgNPNkFNLAlE/kVKpEyASqNNIkulTgElQ1SzXWEjYhMuLkc4dkE6G3CNMqM3DnDW/gORVJH+n5JWklqPVZAA//8AOv6ZBbUDwAAWAx8AAAAE/7r+mQH0A6YAAwAHAAsAGAC7tQcQEhU0Abj/8LMSFTQLuP/wQAsSFTQSNAwRNAQGBbgDArUHBwEICgm4AwK0CwsAAgG4AwJACm8DAd8DAQMDDRO+Au8AFAMEAA4C7wANAuuyBQcEuAMBtQYGCAEDALgDAbQCAgkLCrgDAbcICA0UFBMTD70DAwAMAvAAGgANASqFLxD1/TIvGTkvGBE5L/05OTMv7Tk5ETMv7Tk5AD/tP+0RMy9dcf05OTMv/Tk5ETMv/Tk5MTABKysrKyUHJzcTByc3JwcnNyUhNSE0JyYnNxYXFhUB5EqkTIBKo00iS6VOAZb9xgHxHBNLTkgSGziRVJH+n5JWklqPVZD0rnY+K1GjWzNNsv///7r+mQH0A6YAFgMhAAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAABAA2/k4EIAN1ACwAMAA0ADgA9rU0EBIVNC64//CzEhU0OLj/8EAREhU0KSAKCzQYKgoLNHkqARu4/7a1CRE0MTMyuAMCtTQ0LjU3NrgDArQ4OC0vLroDAgAw/8BACgsRNDAwEwcDHx66Au8AIAMGtA8SABMLuALvsgMDEroC7wATAweyMjQxuAMBtTMzNS4wLbgDAbQvLzY4N7gDAUAXNUAKCzQ1NY8AAQASHiAfHxMSEjoHBxm6AwMAJwEqhS/tMy8RMy8zMy85ORE5XTkvK/05OTMv7Tk5ETMv7Tk5AD/tOS/tEjkROT/tORE5ETkvK/05OTMv/Tk5ETMv/Tk5MTABK10rKysrKwEiJiMiBwYHNjc2MzIXFjMyNjMHBgcGBwYVFBcWITMXByMiJyYnJjU0NzY3NgUHJzcTByc3JwcnNwHkFEwTQFA0WigjS7FCzF9FHXAcJdOU3HuZ4MMBRrgG4jrYj6tYZE88cyMCAUqkTIBKo00iS6VOArgGDAgScSJKHA0OqSQuRGJ6ptdsXgufKDBqeceohmZbHPORVJH+n5JWklqPVZAABAA2/k4ENQNpAD4AQgBGAEoBNrVGEBIVNEC4//CzEhU0Srj/8EAREhU0HiAKCzQNKgoLNHkfARC4/6K1CRE0R0lIuAMCtEpKQT9CuAMCtEBAQ0VGuAMCQA/QRAFERAETOAg0PSklFBO6Au8AFQMGtDAzIjQtuALvsiUlM74C7wA0AwcAPQLvAAEC67JERkO4AwG1RUVBSEpJuAMBtEdHQEJBuAMBQBI/QBIZNF8/fz8CPz8EDjgzCAS4AwNAEDk5jyIBIjMTFQ4UFDQzMwC4AvCzTCkpDroDAwAcASqFL+0zLxDkMy8zMy8SOTkROV05L/05EjkREjkvXSv9OTkyL/05OREzL+05OQA/7T/tOS/tEjkROT/tORE5ERI5ORESOS9dsQYCQ1RYtA9EH0QCAF1Z7Tk5Mi/9OTkyL/05OTEwAStdKysrKysBIyImNTQ3NjcGBwYHBhUUFxYhMxcHIyInJicmNTQ3Njc2NyYmIyIHBgc2NzYzMhYzMjY3BwYHBgcHFBcWMzMFByc3EwcnNycHJzcENYl5ZgoEB6tXoFhv4MMBRrgG4jrYj6tYZFVCfyWpKFkkZT8VbiIlU7Fh4k0zYTUoKTQhOgIyH0uJ/ptKpEyASqNNIkulTgElWmgnOhYkNCVEVmyK12xeC58oMGp5x6uAZFMZWgUHCQMYYiZUJQgHqgUJBgs4UhwR25FUkf6fklaSWo9VkAAABP+6/pkEPQNrABYAGgAeACIAsbUeEBIVNBi4//CzEhU0Irj/8LUSFTQbHRy4AwK1Hh4YHyEguAMCtCIiGRcYuAMCtRoaAQsCD7gC77MJCRYCugLvAAEC67IcHhu4AwG1HR0ZICIhuAMBtB8fGBoXuAMBQA8ZGQMLCwEDVAsRNAMDAQC4AvCxJAEvEOQROS8rEjkvETkv7Tk5My/tOTkRMy/tOTkAP/08Mi/tEjkRMy/tOTkzL/05OREzL/05OTEwASsrKwEhNSEmJyYnJiMiBzY3NjMyFxYXFhczAQcnNxMHJzcnByc3BD37fQMvZkZXSFFTMzQdL0RoZotFnHkrPP6FSqRMgEqjTSJLpU4BJa5PLDcZHAdKLUFkMoxtCf5lkVSR/p+SVpJaj1WQAP///7r+mQQ9A2sAFgMpAAAABABK/0YD6QXJAB4AIgAmACoA6UALKhASFTQkEBIVNCC4//BADhIVNBMqCRE0EioMETQEuP/gswkRNAO4/+CzCRE0Arj/1kALCRE0GDQMETQfISK4AwK1ICAqIyUmuAMCtCQkJykquAMCQAkPKAEoKBoNDBm6Au8AGgMJsgw6ELoDCgAGAwiyICIhuAMBtR8fJSgqKbgDAbQnJyQmI7gDAbclJRkaGhkZFboDAwAAAvCyLA0MuAEahS8zEPT9Mi8ZOS8RMxgv7Tk5My/9OTkRMy/9OTkAP/0Z5Bg/7RE5ETMvXe05OTMv7Tk5ETMv7Tk5MTABKysrKysrKysrARQHBgcGIyInJicmJzcWFjMyNzY2NTQnJic3FhcWFQMHJzcBByc3BwcnNwPpXlJ6dEtFUD1VSEcRQo86gIt+si4lQzlSJyzfTaBKAWhOoktBTKJKASVudmhLSBQPIBsbKA0bUkvlXE9XRkqdTExWagNbklaS/viQVo+vkVSRAP//AEr/RgPpBckAFgMrAAAAAQAUASUGfwXfACwAurkAFv/AQBMQETQJIBARNDsFawUCCSAJDDQquP/gsxARNBK4/+izDxE0Erj/3LMNDjQSuP/wQAoKDDQEAwcSBCwNQQsC7wAMAwsAJQAkAwkAGgAsAu8AHALrswMEAAe4AvO2QBISKAwMAEEJAwAAGwLwAC4AJQL7ACAAJP/AtQkLNCQkKLoDAwAgASqFL/0yGS8rGu0YEPUZ7TMYLxI5LxrtEjk5AD/9PD85P+0RFzkrKysxMAErK10rKwEmJicHJyY1NDc2NyUVBwYHBhUUFxYXFhcWFxUhIicmNTQ3NjcXBgYVFBcWMwYLRrSZIXY+VE6/ARrRfU1iQCgpmHF6SvtV72VsLw0qIiIVc1amAdNqnVsfWjQdrGJaSG6tRikiKxcXMB4ec36Hka45PZNYcB9UFE5UJm0sIQABABQBJQd2Bd8ARQD9uQAq/9azEBE0Ibj/8LMPETQvuP/gsw8RNCy4/+CzDxE0MLj/4LMNETQuuP/gQBUNETQ7G2sbiT0DHyAJDzQTIA8RNA64/+CzEBE0KLj/4LMPETQouP/csw0ONCi4//BACwoMNEEaGR0oBRAjQQwC7wAiAwsACQAIAwkANwAQAu8AOAAAAuuzGRoVHbgC80ANDyhfKAIoKBUMIyM4FbgDA7RAQUEMOL4C8ABHAAkC+wAgAAj/wLUJCzQICAy6AwMABAEqhS/9MhkvKxrtGBDlETkvGu0SOS8REjkvXe0SOTkAPzz9PD85P+0RFzkrKysxMAErKytdKysAKysrKwEiJyY1NDc2NxcGBhUUFxYzITI3NjU0JyYnBycmNTQ3NjclFQcGBwYVFBcWFxYXFhcWFxYXFjMzFSMiJyYnJicmJxQHBiMB1O9lbC8NKiIiFXNWpgGqn2yBMRlIIXY+VE6/ARrRq0Y7QCgpWEc9NSFJLy09LYN7UlosUTELGTNvd+sBJTk9k1hwH1QUTlQmbSwhKTFZQy4YJh9aNB2sYlpIbq1GOiMeEhcwHh5DQTg8JVo5JjOuVClpPw0eMbJkawAAAf+6ASUDJwXfAB0AobkAGf/AQBMQETQMIBARNDsIawgCDCAJDDQVuP/osw8RNBW4/9yzDQ40Fbj/8EAKCgw0BwYKFQQCEL8C7wAPAwsAHQACAu8AAQLrswYHAwq4AvNAFkBvFY8VAg8VLxVfFQMgFQEVFQEPDwO+AwAAIAAAAvAAHwABASqFLxD0GhntMxgvEjkvXV1dGu0SOTkAP/08P+0RFzkrKysxMAErXSsrASE1ISYmJwcnJjU0NzY3JRUHBgcGFRQXFhcWFxYXAyf8kwL5RrSZIXY+VE6/ARrRfU1iQCgpmHF6SgElrmqdWx9aNB2sYlpIbq1GKSIrFxcwHh5zfoeRAAH/ugElBB4F3wA2ANy5AC//1rMNETQmuP/wsw0RNDS4/+CzDxE0Mbj/4LMNETQ1uP/gsw0RNDO4/+BAHw0RNFQrVDICRCtEMgI7IGsgiQsDJCAJDzQYIA8RNC24/+CzDxE0Lbj/3LMNDjQtuP/wQA4KDDQALQEPHx4iLQUVKEEJAu8AJwMLAAUAFQLvAAYAFALrsx4fGiK4AvNACw8tAS0tGhQoKAYauAMDsw8PFAa7AvAAOAAUASqFLxDlETkv7RI5LxESOS9d7RI5OQA/PP08P+0RFzldKysrMTABKytdXV0rKwArKysrARYXFjMzFSMiJyYnJicmJxQHBiMjNTMyNzY1NCcmJwcnJjU0NzY3JRUHBgcGFRQXFhcWFxYXFgLVLy09LYN7UlosUTELGTNvd+tnbJ9sgTEZSCF2PlROvwEa0X1NYkAoKVhHPTUhAmU5JjOuVClpPw0eMbJka64pMVlDLhgmH1o0HaxiWkhurUYpIisXFzAeHkNBODwlAAIAFAElBn8G8AAsADcA8UAQMAgTFTQvIAoLNDYgCgs0Frj/wEATEBE0CSAQETQ7BWsFAgkgCQw0Krj/4LcQETQzDTIMLbgC77YPLgEuLgwSuP/osw8RNBK4/9yzDQ40Erj/8EAKCgw0BAMHEgQsDUELAu8ADAMLACUAJAMJABoALALvABwC60AJLgwyMgcDBAAHuALztkASEigMDABBCQMAABsC8AA5ACUC+wAgACT/wLUJCzQkJCi6AwMAIAEqhS/9MhkvKxrtGBD1Ge0zGC8SOS8a7RI5OREzLxA8AD/9PD85P+0RFzkrKysRMy9d7REzEjkxMAErK10rKwArKysBJiYnBycmNTQ3NjclFQcGBwYVFBcWFxYXFhcVISInJjU0NzY3FwYGFRQXFjMBFQYHBgc1NjY3NgYLRrSZIXY+VE6/ARrRfU1iQCgpmHF6SvtV72VsLw0qIiIVc1amBErYuKNdIMCGlgHTap1bH1o0HaxiWkhurUYpIisXFzAeHnN+h5GuOT2TWHAfVBROVCZtLCEFHalPWU4/aiR+Rk8AAgAUASUHdgbwAEUAUAEzQBBJCBMVNEggCgs0TyAKCzQquP/WsxARNCG4//CzDxE0L7j/4LMPETQsuP/gsw8RNDC4/+CzDRE0Lrj/4EAVDRE0OxtrG4k9Ax8gCQ80EyAPETQOuP/gtxARNEwjSyJGuALvtg9HAUdHIii4/+CzDxE0KLj/3LMNDjQouP/wQAsKDDRBGhkdKAUQI0EMAu8AIgMLAAkACAMJADcAEALvADgAAALrQAlHI0tLHRkaFR24AvNADQ8oXygCKCgVDCMjOBW4AwO0QEFBDDi+AvAAUgAJAvsAIAAI/8C1CQs0CAgMugMDAAQBKoUv/TIZLysa7RgQ5RE5LxrtEjkvERI5L13tEjk5ETMvEDwAPzz9PD85P+0RFzkrKysRMy9d7REzEjkxMAErKytdKysAKysrKysrKwEiJyY1NDc2NxcGBhUUFxYzITI3NjU0JyYnBycmNTQ3NjclFQcGBwYVFBcWFxYXFhcWFxYXFjMzFSMiJyYnJicmJxQHBiMBFQYHBgc1NjY3NgHU72VsLw0qIiIVc1amAaqfbIExGUghdj5UTr8BGtGrRjtAKClYRz01IUkvLT0tg3tSWixRMQsZM2936wKl2LijXSDAhpYBJTk9k1hwH1QUTlQmbSwhKTFZQy4YJh9aNB2sYlpIbq1GOiMeEhcwHh5DQTg8JVo5JjOuVClpPw0eMbJkawXLqU9ZTj9qJH5GTwAC/7oBJQMnBwIAHQAoANJADsghASAgCgs0JyAKCzQZuP/AQBcQETQMIBARNDsIawgCDCAJDDQkECMPHrgC77MfHw8VuP/osw8RNBW4/9yzDQ40Fbj/8EAKCgw0BwYKFQQCEL8C7wAPAwsAHQACAu8AAQLrQAkfDyMjCgYHAwq4AvNAFkBvFY8VAg8VLxVfFQMgFQEVFQEPDwO+AwAAIAAAAvAAKgABASqFLxD1GhntMxgvEjkvXV1dGu0SOTkRMy8QPAA//Tw/7REXOSsrKxEzL+0RMxI5MTABK10rKwArK10BITUhJiYnBycmNTQ3NjclFQcGBwYVFBcWFxYXFhcDFQYHBgc1NjY3NgMn/JMC+Ua0mSF2PlROvwEa0X1NYkAoKZhxekph2LijXSDAhpYBJa5qnVsfWjQdrGJaSG6tRikiKxcXMB4ec36HkQUvqU9ZTj9qJH5GTwAAAv+6ASUEHgcCADYAQQEbs8g6AUG4/+BAExARND8gDQ40OSAKCzRAIAoLNC+4/9azDRE0Jrj/8LMNETQ0uP/gsw8RNDG4/+CzDRE0Nbj/4LMNETQzuP/gQCMNETRUK1QyAkQrRDICOyBrIIkLAyQgCQ80GCAPETQ9KDwnN7gC77M4OCctuP/gsw8RNC24/9yzDQ40Lbj/8EAOCgw0AC0BDx8eIi0FFShBCQLvACcDCwAFABUC7wAGABQC60AJOCg8PCIeHxoiuALzQAsPLQEtLRoUKCgGGrgDA7MPDxQGuwLwAEMAFAEqhS8Q5RE5L+0SOS8REjkvXe0SOTkRMy8QPAA/PP08P+0RFzldKysrETMv7REzEjkxMAErK11dXSsrACsrKysrKysrXQEWFxYzMxUjIicmJyYnJicUBwYjIzUzMjc2NTQnJicHJyY1NDc2NyUVBwYHBhUUFxYXFhcWFxYTFQYHBgc1NjY3NgLVLy09LYN7UlosUTELGTNvd+tnbJ9sgTEZSCF2PlROvwEa0X1NYkAoKVhHPTUhOti4o10gwIaWAmU5JjOuVClpPw0eMbJka64pMVlDLhgmH1o0HaxiWkhurUYpIisXFzAeHkNBODwlBEOpT1lOP2okfkZPAAABADL/pwTZA7IAOwCZuQAm/9ZAEw4RNCk0DhE0KjQLETQDBg4hJyBBCQMHAAYC7wA5AwQAJwLvABb/wLMJCzQWvgMNAA4C7wAwAusAMwMMQAkKCiwkAxIAACy4Av20QBISPSG7AvsAIAAg/8C1CQs0ICAkugMMABoBOYUv/TIZLysa7REzGC8a7TMvEjkREjkv7QA/7T8r7T/tPxI5ERI5MTABKysrARQGByYmIyIHBhUUFjMzMhYWFRQHBiEiJyY1NDc2NzY3FwYGFRQWMzI3NjY1NCYjIyImNTQ3Njc2MzIWBNkMAiNhMldgWCs1UEhFYNvJ/qmyXmYiGi4DPCo/Q6mdeJ+I2hkc6itCNzxVZmdCTAMgIEMOLTRlXTcTEwMQQfuDeEVLl2hyV18GcRFww0t6ejApchsTDD4xQ3N9VGVQAAABACT/HwS1AgUANgCQuQAg/+BACQwRNBo1GRk1Brj/wEAKCQo0BgYBLCwBIroC7wAR/8CzCQ00Eb4DDgA1Au8AAQLrACYDDLMNDQAvuAMMtEAEBB4AvgLwADgAGgL7ACAAGf/AtQkLNBkZHroDDAAVATmFL/0yGS8rGu0YEOQROS8a7RI5L+0AP+0/K/0ROS8SOS8rETMvEjkxMAErASMiBhUUMzIWFxYXFhUUBwYhIicmNTQ3NjcXBgcGFRQXFjMyNzY1NCYjJiYjIiY1NDc2NzYzMwS1r5qbXSkwUTASHXuG/svXf4dAF2IoJiU5gHrVj22GHiMbcxI/Nkk8ZUxUrwElEBghBAkGCQ8lu1VdSU6QdIIvmhRBQG5Ge0A9FhsvEREDByEhfE9AHxcAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAMAMATXAc8HdwAtAFYAYgEdQAkDYQojCQkhDiu6AvUAWv/AtQsPNFpaYbgC9bYjIxQXFyEbuAL1shQUIbgC9UAWDg5LNUYyU1RPSks/RktLQFRUQEBGT7gC9bIyMka6AvUAOQL0QA4JBmEKVyNdJyEeEQYGALoC9gBX/8C1CQo0V1dduAL2QAwnQAkQNCcnHg4XFxG4AvZACh4eNUtKQ0A/LlS4Avm0U1NLPD+4AvmyQEBLugL5AEr/wLMVFzRKuP/Asw0QNEq4ASSFLysr7TMv/TIRMy/9MhESORESOTMv/TIvOREzLyv9Mi8r7TkvERI5ERI5ETk5EjkAP+05L+0RMy8yLxI5LxE5EjkREjkREjkRMy/9Mi/tEjkvETkv/TIvK+0REjkvEjkROTEwAQYGBxYWFRQGBycGBwYjNzY1NCYjIgcHNjc2MzIWFRQGBzY3JicmNTQ3NjcWFgMUBwYjIiYnBgcGIyImNTQ2NzcUBhUUFjMyNzY3NxYXFjMyNzY1NxYWAzQmIyIGFRQXFhc2AcoEDRYPEQMEVi46R1ckFBQTFRIaBwsULiImBwhFQCAJEiUuMh0mHhodMxIeExQTICMqKg4NFQQSEisaDBIVCAUMHCYWEhUEBykXDBMMEgUeDQcVFy8jDBUNEisaQzYeJDwlHRYmGCxHHjdDKhEjIRQuIAwYGy8tNwEBJv50SzA2DA0iEyA4MhoyIQgIJAwWIzgZTAYxCx8yKSwGEzEBJBgmEQwSFAYbEQAAAwBGBNcBsQc9ACkAMQA5AMxAEwcZBCYnIh0eEhkeHhMnJxMTGSK4AvWyBAQZuAL1QAkLQAkMNAsLMCq4AvWyLCwwuAL1QAkuQAkYNC4uODK4AvWyNDQ4ugL1ADYC9EASKjIyLjZAJSg0NgceHRYTEgAnuAL5tCYmHg4SuAL5shMTHroC+QAd/8CzFRc0Hbj/wLMNEDQduAEkhS8rK+0zL/0yETMv/TIREjkREjkvKzwzLzwAP+0zL+0RMy8r7TMv7REzLyvtOS/tETMvMi8SOS8RORI5ERI5ERI5MTABFAcGIyImJwYHBiMiJjU0NzY3NxQGFRQWMzI3Njc3FhcWMzI3NjU3FhYHFAcGBzQ3NhcUBwYHNDc2AbEaHTMRIRETFCAjKioIBQ4VBBETKxoNERUJBAwcJhYSFQQHDzRZyStU1zNayStUBudMMDUNDCITHzgxGR0SJAgIJAwXITgbSQYxCyAyKS0HGCzWLiwjUiwpIiMvLSRRKykjAAACAEYE1wGxBrkABwAxAK25AAAC9bICAga4AvVAGwRACRw0BAQbLi8qJSYaGw8hDCYmGy8vGxshKrgC9bIMDCG6AvUAEwL0sgAABLj/wEAMDhM0BA8mJR4bGggvuAL5tC4uJhYauAL5shsbJroC+QAl/8CzFRc0Jbj/wLMNEDQluAEkhS8rK+0zL/0yETMv/TIREjkREjkvKzMvAD/tOS/tETMvMi8SOS8REjkRORE5ERI5ETMvK+0zL/0xMAEUBwYHNDc2FxQHBiMiJicGBwYjIiY1NDc2NzcUBhUUFjMyNzY3NxYXFjMyNzY1NxYWAaI0WcktUuYaHTMRIREUEyAjKioIBQ4VBBISKxoMEhUIBQwcJhYSFQQHBrkuLiNQKikim0swNg0MIhMgODIaHRIkCAgkDBYjOBlMBjELHzIpLAYTMQADAEAE2QGxBy4AIABKAFYA7LcdVAQPCwAIFroC9QBO/8BACgsNNE5OVAAACFS4AvVAHQ8PCEAJGDQICDQoOiVHSEM+PzM6Pz80SEg0NDpDuAL1siUlOroC9QAsAvRACVQESw9REwAAGbgC9rVLS1ELCxO4AvZAClFRKD8+NzQzIUi4Avm0R0c/LzO4AvmyNDQ/ugL5AD7/wLMVFzQ+uP/Asw0QND64ASSFLysr7TMv/TIRMy/9MhESORESOTMv/TIvETMv/TIvERI5ETk5AD/tOS/tETMvMi8SOS8RORI5ERI5ERI5ETMvKzMv7RI5LxEzLyvtERI5ETkSOTEwASInJicGBwYjIiYnNjc2NyYnJjU0NjMyFhUUBwYHFhcWFRQHBiMiJicGBwYjIiY1NDc2NzcUBhUUFjMyNzY3NxYXFjMyNzY1NxYWJzQmIyIGFRQWFzY2AbEjJwgjORc8OA4bD0wfMDoXCxFHLR0vCgMUIAYKGh0zESERFBMgIyoqCAUOFQQSEisaDBIVCQQMHCYWEhUEB1EeFgcGFCMDBwYxCQIKMQ4mCQgiDxchFg8XFytVKR0VFwcjDwsRoUswNg0MIhMgODIaHRIkCAgkDBYjOBlLBzILHzIpLQYUMfIVKA4JFR0TBxIAAAIARgTXAbEG0wApADEAsUATBxkEJiciHR4SGR4eEycnExMZIrgC9bIEBBm4AvVADgtAGx00C0AJCTQLCzAquAL1siwsMLoC9QAuAvRAECoqLkAlKDQuBx4dFhMSACe4Avm0JiYeDhK4AvmyExMeugL5AB3/wLMVFzQduP/Asw0QNB24ASSFLysr7TMv/TIRMy/9MhESORESOS8rMy8AP+0zL+0RMy8rK+05L+0RMy8yLxI5LxE5EjkREjkREjkxMAEUBwYjIiYnBgcGIyImNTQ3Njc3FAYVFBYzMjc2NzcWFxYzMjc2NTcWFgcUBwYHNDc2AbEaHTMSHhMUEyAjKioIBQ4VBBISKxoMEhUIBQwcJhYSFQQHDzNaySxTBn1LLzUMDSITIDgyGR0SIwkJJAwWITcaSgYxCx8yKSwGEzHoLy0kUCsoIwACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAAB/9z+7QGvBNIABQAQtQADAgUBAi/dxgAvL80xMBMRIxEhFSRIAdMEi/piBeVHAAAB/lH+7QAkBNIABQAQtQUCAwADBC/NxgAvL80xMAE1IREjEf5RAdNIBItH+hsFngAB/xb+7QDqBYUACwAhQA4GCQoABQoDCAACAwoFAy/WzRDd1jwALy/dPBDWzTEwEyMRIxEjESEVIREh6sZIxgHU/nIBjgPY+xUE6wGtR/7hAAH/Fv7tAOoFhQALACFADgUCAQsGAQgBBggJAwsJL9bAEN3WzQAvL93AENbNMTADIREhNSERIxEjESPqAY7+cgHUxkjGBB8BH0f+U/sVBOsAAf8W/u0A6gWFAAcAG0ANLwZ/BgIGAAUDAAIFAy/G3cYALy88zV0xMBMjESMRIxEh6sZIxgHUA9j7FQTrAa0AAAL/Fv7tAOoFhQAGAAoAQEAeBQcJAwMKBAhAEBU0CAoGAgEIBAoKAAEHBQABCQMBL9bNEN3WzRESOT0vPDwAGC8vPN3eK80SOT0vPDw8MTATIxEnNxcHNycHFyRIxurqxmKGhob+7QULttfXtrZ5eXgAAAH/Fv7tAOoFhQANACNADwQDBwAIDQsIBgoLAw0BCy/A1sAQ3cDOAC8vwN3A1s0xMAMzESM1IREzFSMRIxEj6sbGAQ7GxkjGBB8BH0f+mkf7FQTrAAH/Fv7tAOoFhQAPAClAEgUEBgMJAAoPDQUKBwwNBA8CDS/A1sAQ3cDWwAAvL8DdwNbA3cAxMAMzESM1IRUjETMVIxEjESPqxsYB1MbGxkjGBB8BH0dH/uFH+xUE6wAC/xb+7QDqBYUAAwALACFADgUDAAcEAAoBBwkKAAQKL9bNEN3WzQAvL908ENbNMTADIREhAxEhESMRIxGkAUj+uEYB1MZIBB8BH/6aAa3+U/sVBOsAAAH/Fv7tAOoFhQAFABS3AwUCAQQAAwEvxt3GAC8vPM0xMBMjEQMhAyRIxgHUxv7tBSwBbP6UAAH/Fv7tAOoFhQAGAB1ACwUGBAIFBQIGAQQCL8bdxhI5PS8AGC8vPM0xMBMRIxEjExMkSMbq6gPY+xUE6wGt/lMAAAL/3P5XACQHJwADAAcAHUAMAgIDBwcGAwYBBQIGLzzdPAAvLxI5LxI5LzEwExEjERMRIxEkSEhIByf8OAPI+vj8OAPIAAAB/xb+VwDqBycACwAfQA0HBAUKAQAHCwkCBAACL93AEN3dwAAv3cAv3cAxMAM1MxEjNSEVIxEzFerGxgHUxsb+V0cIQkdH975HAAH/3P5XAOAHJwAEABO2AQAEAwACAy/dzgAvLxndzTEwEwcRIxHgvEgGbo74dwjQAAH/IP5XACQHJwAEABtADAYEFgQCAwQAAgEEAi/OzQAvLxndzTEwAF0TESMRJyRIvAcn9zAHiY4AAf/c/lcA6gcnAAUAELUFAQQDAQQv3c0AL80vMTATETMVIREkxv7yByf3d0cI0AAAAgBKAOsEIQTAABsAJwC9QBgvKQEIEA4PFgIAARcPERAJAQMCFiEQARC8AqIAEQK4ABUCuLIfKRO4AWm1BQguAgECvAKiAAcCuAADArhAFiUpBQkuDzAPQA+CDwQPPiIpDj4KPgy4AWlAGxwpGhchAT8BTwGNAQQBPhg+AD44GkgazxoDGrgB/rUoBQeeeRgrAD8BThD0XU3k5PRdPBDt/eTk7fRdPABNEO3k5PRdPBD97eTk9F08ERI5ORESOTkBERI5ORESOTkxMAFdEyc3FzYzMhc3FwcWFRQHFwcnBiMiJwcnNyY1NBcUFjMyNjU0JiMiBtWLc4tqg4Rpi3SLR0eLdItphINqi3OLR6OYa2uYl2xrmAPBiHeLSEiLd4hufX5uiHeMSUmMd4hufn19bJiYbGuYmAAAEAAAAAAIAAXBAAUACQANABkAHQAjAC4ANAA4AEQASABMAFIAWQBgAGgB/kD/pw+3DwJ3D4cPlw8DeiYBUyVjJQIjJTMlQyUDWT1pPQIpPTk9ST0DWUFpQQIpQTlBSUEDVjtmOwImOzY7RjsDVkNmQwImQzZDRkMDxmYBxWgBymIByWQBVmBmYAJZW2lbAqUqtSoCYyoBtSrFKtUq9SoEdSqFKpUqAzMqQypTKgNjQhhCKC1Xb10BP11PXV9dA11dJ1ZQKAEvKD8oTygDKC8MT0cBRwEyMwcbAy8IHAQzExVnEDxeUCcBDydPJ18nA58nASAnMCdAJwMnUgtGIk9NN0sgUjZKH01hcDmAOZA5A0A5UDlgOQMfOQE5J1cwXgFeHye/JwIfJ18nbyefQGYn3yfvJwYnJFUtZS0CJS01LUUtAy1TnysBK18SbxICElpQJAEkF5AOAW8Ofw4CDiEHNgk1IwMAHwEfIwELIQAKI2owZQFlbz9/PwIPPx8/Pz9PPwQ/GkkbSk4vD00BTU4xRVEyRk4vwMDdwMAQ3V3AENTA3cAvXXHNchDQwMDdwMAQ1F3AENTA3cAQ1nFdzdRdzcZd1HHNM11dENRdcd1ywBDWXV1dzQAvwDw83cA8PBDUwNbAENZdXXFdzdTA3dDGL8A8PN3APDwQ3cDWXcAQ1l1xzRI5L3FxzTkQxMAQzTEwXV1xXV1xcV1dXV0BXV1dXV1dXV1dXXFdXQEjNSM1IQUhNSEBIxEzARQjIic3FjMyNREzASE1IQEhNTM1MwEUISMRMzIVFAcWASMVIxEhASE1IQEUBiMiJjU0NjMyFgEjETMBITUhBSERMxUzATQjIxUzMhc0IyMVMzIlECMiERAzMggAZN8BQ/3B/r0BQwI/ZGT+9tNWNEkZKF90/Iz+vQFDBH7+vd9k/Y/+7vDr+Vl3+7TfZAFDBH7+vQFD/ZWkmZmhoZmZpP0OZGQDHv69AUP9wf69ZN8DuqNZZZceq298nv3HycbGyQR+32RkZPx+AUP+4fEtTxqKAeQBG2T6P2TfAQzRAsS6WzYuApTfAUP6P2QCe63AwK2vwMD+sQFD/H5kZAFD3wMZY8LPbdz/AQ3+8/71AAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAEAf/5TAjAGSAAXAEi5ABb/4LMLETQQuP/0sw4RNA+4/+C0ChE0AAG4AwayDg0NuAL6sg4OAbgC+rIAAAe5Av8AEi/tMy/sPBD9AC8zPzMxMAErKysBByYnJicmETQ3Njc2NxcGBwYVFBcWFxYCMCxoM2c5Sko6ZjVkLmw4PCIcOBz+gC19Tp6u5AEF+uCxnlN5Ku7q+fL0wp2WSwD//wBd/lMCDgZIAFcDfAKNAADAAEAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAQAFQElBNMGIAAMAC8AfACHAU9AIwUAAQcHAQElLS4pJCUdHhMhECUlHg8uAS4uHkAJDDQeHiEpuAL1shAQIbgC9UAaFxdjgn6FOVc9QEN+foVJSVBQd2NjhYVXQ2u4Au+yNTVXuALvsj09Q7gC67IFBQG4Avm2AAATJSQNLrgC+bQtLSUaHbgC+bIeHiS4Avm3QCUlYzlaZ1+4AwNAEmNjd1BnZzBUgoJGSX59QARUTLgDA7JQUFS4/8CzEBE0VLj/wEAKCQo0VFRGNW4wc7gDA7Ygd3cwMIlGuAEchS8RMy8zGS8a/RE5ORgROS8rKzMZL/0RFzkYETkvERI5LxkREjkv/RE5OREzGC8a/TIv/TIRMy/9MhESOTMv/TIvAD88EO08EO0REjkvMi88OS85LxI5LxE5ERI5ERI5ETMv7Tkv7REzLysyL10SOS8REjkRORE5ERI5ETMvMy8SOTkxMAEHJicmJzYzMhcWFxYXFAYjIiYnBgcGIyImNTQ2NzcUFjMyNjc3FhcWMzI3Njc3FgEUBwYHByInJicGBwYjIiYnBgYjIiY1NDY3JiY1NDc2NxYXFhcWFjMyNjcDJicmNTQ3NjcWFhcXFhcWMzI2NwMmJyY1NDc2NxYXFhcWBScGBwYHFhYzMjYC/RUZMw02CSUlFR8FEbs1KRclFwwZICEqKggCHh0gFS8GFwsGDiYbEwwIGQUBIgUIFA13TD0uKDgwP0F7FihwNXCE5KQECxcTIA0OFRYMQzkuMyc7BwMHFxMgCRcXJBAgJ0IcIwU6BwIHFxQdBB4kEBv87hNYLjQjFjcyHDwFUQg9NQ4tKiQ5DCpqSGsLDR4YHzYtEi0MDDAjVSgGKAcTKRsmBhT8oyUfMiYZIxw7RB0ZTDw7TSEaVNVMDzQPIioiJlJSe2o3MBk8AREgFCcRIyoiJTN3cqxJJi4tJwERKgopDyIrJSIZh6RUjhdvIB8jOAkKIf//AHkAkwLoAzMAFgLvAAAAAgAOAQoBpgadABYAKwCMQA4AFBZAFj80FhYQFAwIC7j/wLYWPzQLCwQQuALxsggIFLgC8UALBEAJDzQEBCccGyS8Au8AJwMLABsDD0AJFhYACwALDAwkuAMQticnHxwbGxe5AxAAHy/tGTkvMxE5Lxj9Mi8zMxkvGC8zGS8AGD8/5BE5ETMvK+0zL+0SOS8rEjkREjkvKxI5MTABBgcGIyInJiMiBgcnNjc2MzIXFjMyNwMUBwYHJzY2NTQCJyYnNjY3FhIXFgGmHB0pMDItYwYMGA8LGQsXJglkMiE1NEYdDzISAwUhFw4RFDMXEDEOEgZ2IBEYDyEHBw0kCRQgEBf7oFBLKFcKHUwNaAF1y3uALGYtcv50n8YAAv/cASUB1gadABYALQCQQA4XKy1AFj80LS0nKyMfIrj/wLYWPzQiIhsnuALxsh8fK7gC8bcbQAkPNBsbDL4C7wANAwsAFgLvAAEC60ASLS0XIhciIyMMQAkRNAwMDQ0GuAMSshERALkC8AAvEPUyL/0ZOS8yGC8rMy8zMxkvGC8zGS8AGD/tP+wzLyvtMy/tEjkvKxI5ERI5LysSOTEwASMiJyYmJy4CJyYnNxYXFhMWFxYzMwMGBwYjIicmIyIGByc2NzYzMhcWMzI3AdaMRCkkJQoGDRUSFid7JxAKChIiHCGMYhwdKTAyLWMGDBgPCxkLFyYJZDIhNTQBJTcwvotx7nsnMCTCeKdo/nyyMioEoyARGA8hBwcNJAkUIBAXAAACAFYBCgFuBwoAHwA0AJu5AAP/4LMSGTQCuP/gtQsRNCUkLboC7wAw/8BADQkqNDAwBRUAFwcdBQW4/8C2Ehk0BR0dF7wC9QAPAxUAJAMPQAsVBxISGgAAGgUFC7gDBbIaGi24AxC2MDAoJSQkILoDEAAoATuFL+0ZOS8zETkvGP05L/0yLxEzLxI5Lzk5AD8//TIvMysvEjkROTkRM30vGCvkETkxMAArKwEUBwYHBzQ3JicmNTQ3NjMyFhUUBgcmIyIGFRQWMzI2ExQHBgcnNjY1NAInJic2NjcWEhcWAW4fFSq6ZB8QFTU7LRQdDAsfJBYrXSEWEwIdDzISAwUhFw4RFDMXEDEOEgZmGRQND0AuIxAPExUfOD4bFg4dEhwSDA80A/vKUEsoVwodTA1oAXXLe4AsZi1y/nSfxgACABABJQHWBwoAHwA2AJy5AAL/4LMLETQsugLvAC3/wEANCSo0LS0FFQAXBx0FBbj/wLYSGTQFHR0XvgL1AA8DFQA2Au8AIQLrQAsVBxISGgAAGgUFC7gDBUANGhotLEAJETQsLC0tJrgDErIxMSC6AvAAOAE7hRD1Mi/9GTkvMhgvKxI5L/0yLxEzLxI5Lzk5AD/tP/0yLzMrLxI5ETk5ETN9Lxgr7DEwACsBFAcGBwc0NyYnJjU0NzYzMhYVFAYHJiMiBhUUFjMyNhMjIicmJicuAicmJzcWFxYTFhcWMzMBKB8VKrpkHxAVNTstFB0MCx8kFitdIRYTzIxEKSQlCgYNFRIWJ3snEAoKEiIcIYwGZhkUDQ9ALiMQDxMVHzg+GxYOHRIcEgwPNAP6yzcwvotx7nsnMCTCeKdo/nyyMioAAwAy/2MDdQRxACAAKgBKAM25AC3/4EAJCxE0EEALETQDuP/gQA8LEjQSQAkRNEArQjJIMDq4AvVAFUJCSEASGTRISDBACR00MDAcCxQKHLgC77IlJSG6Au8AFALrsgoKDroDCgAEAwhAC0AyPT1FKytFMDA2uAMFskVFGLgC/bMoKAohvAMDABQDAwAAAvCyTAsKuP/AswkMNAq4ATuFLyszEPTt7RE5L/0yL/0yLxEzLxI5Lzk5AD/9MhkvGD/9Mi/tERI5ETMvKzMvKzMv7RESORE5OTEwASsrKwArARQHBiMiJyYnJic3FhYzMjc2NzY3IicmNTQ3NjMyFxYVByYnJiMiBhUUFgMUBwYHBzQ3JicmNTQ3NjMyFhUUBgcmIyIGFRQWMzI2A3V6iLJCRjNSQUEROHsxem1VVStPh0NMMDhWVyYePxYfGyccKVhNHxUqumQfEBU1Oy0UHQwLHyQWK10hFhMBYaWjtg8LGxcWIw0dPjFdL2orMXBnWGZlT40FYCUgJRwxMwH/GRQND0AuIxAPExUfOD4bFg4dEhwSDA80A///ADL/YwN1BHEAFgOFAAAAAgAt/0ABUgXsAB8ANACfuQAC/+BACgsRNBUAFwcdBQ+4AvVAChcXHUASGTQdHQW4/8C2EhQ0IAUBBbj/wLcJDzQFBSUkLboC7wAwAwuzLyQBJLgDD0AJFQcSEgAABQUauAMFswsLKC24AxC2MDAoJSQkILoDEAAoATuFL+0ZOS8zETkvGO0RMy/tMy8yLzkvOTkAP10/5BE5My8rXSszLyszL+0REjkROTkxMAArBRQHBgcHNDcmJyY1NDc2MzIWFRQGByYjIgYVFBYzMjYTFAcGByc2NjU0AicmJzY2NxYSFxYBRR8VKrpkHxAVNTstFB0MCx8kFitdIRYTKx0PMhIDBSEXDhEUMxcQMQ4SNxkUDQ9ALiMQDxMVHzg+GxYOHRIcEgwPNAMCZ1BLKFcKHUwNaAF1y3uALGYtcv50n8YAAAIAE/9AAdYF7AAWADYAqbkAGf/gQAoLETQsFy4eNBwmuAL1QA0uLjRAEhk0NDSQHAEcuP/AtgkONBwcAQy+Au8ADQMLABYC7wABAutACyweKSkxFxcxHBwiuAMFQBYxQA0ONDFACQo0MTEMQAkRNAwMDQ0GuAMSshERALoC8AA4ATuFEPQyL/0ZOS8yGC8rMi8rK/0yLxEzLxI5Lzk5AD/tP+wRMy8rXTMvKzMv7RESORE5OTEwACsBIyInJiYnLgInJic3FhcWExYXFjMzAxQHBgcHNDcmJyY1NDc2MzIWFRQGByYjIgYVFBYzMjYB1oxEKSQlCgYNFRIWJ3snEAoKEiIcIYylHxUqumQfEBU1Oy0UHQwLHyQWK10hFhMBJTcwvotx7nsnMCTCeKdo/nyyMir99hkUDQ9ALiMQDxMVHzg+GxYOHRIcEgwPNAMAAAIAMv+nBNkEcQA7AFsA8LkAPv/gswsRNCa4/9ZAFA4RNCk0DhE0KjQLETRRPFNDWUFLuAL1QBVTU1lAEhk0WVkPQQFBQSADBg4hJyBBCQMHAAYC7wA5AwQAJwLvABb/wLMJCzQWvAMNAA4C7wAwAutAC1FDTk5WPDxWQUFHuAMFs1ZWJDO4AwxACQoKLCQDEgAALLgC/bRAEhJdIbsC+wAgACD/wLUJCzQgICS6AwwAGgE7hS/9MhkvKxrtETMYLxrtMy8SORESOS/tETMv/TIvETMvEjkvOTkAP+0/K+0/7T8SORESOREzL10zLyszL+0REjkROTkxMAErKysAKwEUBgcmJiMiBwYVFBYzMzIWFhUUBwYhIicmNTQ3Njc2NxcGBhUUFjMyNzY2NTQmIyMiJjU0NzY3NjMyFiUUBwYHBzQ3JicmNTQ3NjMyFhUUBgcmIyIGFRQWMzI2BNkMAiNhMldgWCs1UEhFYNvJ/qmyXmYiGi4DPCo/Q6mdeJ+I2hkc6itCNzxVZmdCTPyRHxUqumQfEBU1Oy0UHQwLHyQWK10hFhMDICBDDi00ZV03ExMDEEH7g3hFS5docldfBnERcMNLenowKXIbEww+MUNzfVRlUGsZFA0PQC4jEA8TFR84PhsWDh0SHBIMDzQDAAACACT/HwS1A+4ANgBWAOG5ADn/4LMLETQguP/gQAoMETRMN04+VDxGuAL1QBFOTlRAEhk0VFQ8PBo1GRk1Brj/wEAKCQo0BgYBLCwBIroC7wAR/8CzCQ00EbwDDgA1Au8AAQLrQAtMPklJUTc3UTw8QrgDBbNRUR4muAMMsw0NAC+4Awy0QAQEHgC+AvAAWAAaAvsAIAAZ/8C1CQs0GRkeugMMABUBO4Uv/TIZLysa7RgQ5RE5LxrtEjkv7REzL/0yLxEzLxI5Lzk5AD/tPyv9ETkvEjkvKxEzLxI5My8zLyszL+0REjkROTkxMAErACsBIyIGFRQzMhYXFhcWFRQHBiEiJyY1NDc2NxcGBwYVFBcWMzI3NjU0JiMmJiMiJjU0NzY3NjMzARQHBgcHNDcmJyY1NDc2MzIWFRQGByYjIgYVFBYzMjYEta+am10pMFEwEh17hv7L13+HQBdiKCYlOYB61Y9thh4jG3MSPzZJPGVMVK/8qx8VKrpkHxAVNTstFB0MCx8kFitdIRYTASUQGCEECQYJDyW7VV1JTpB0gi+aFEFAbkZ7QD0WGy8REQMHISF8T0AfFwF3GRQND0AuIxAPExUfOD4bFg4dEhwSDA80AwAC/7oBJQH0BVkADAAsAI65AA//4EAPCxE0BjQMETQiDSQUKhIcuAL1QAwkJCpAEhg0KioSEge+Au8ACAMEAAIC7wABAutACyIUHx8nDQ0nEhIYuAMFtycnAQgIBwcDvQMDAAAC8AAuAAEBO4UvEPX9Mi8ZOS8YETkv/TIvETMvEjkvOTkAP+0/7TMvMy8rMy/tERI5ETk5MTABKwArASE1ITQnJic3FhcWFQMUBwYHBzQ3JicmNTQ3NjMyFhUUBgcmIyIGFRQWMzI2AfT9xgHxHBNLTkgSG2wfFSq6ZB8QFTU7LRQdDAsfJBYrXSEWEwElrnY+K1GjWzNNsgKcGRQND0AuIxAPExUfOD4bFg4dEhwSDA80AwD///+6ASUB9AVZABYDiwAAAAEAkwEKAVIF7AAUADOyBQQNvgLvABADCwAEAw8ADQMQthAQCAUEBAC5AxAACC/tGTkvMxE5LxjtAD8/5BE5MTABFAcGByc2NjU0AicmJzY2NxYSFxYBUh0PMhIDBSEXDhEUMxcQMQ4SAiRQSyhXCh1MDWgBdct7gCxmLXL+dJ/GAAABABMBJQHWBewAFgA8vwAMAu8ADQMLABYC7wABAutACgxACRE0DAwNDQa4AxKyEREAuQLwABgQ9DIv/Rk5LzIYLysAP+0/7DEwASMiJyYmJy4CJyYnNxYXFhMWFxYzMwHWjEQpJCUKBg0VEhYneycQCgoSIhwhjAElNzC+i3HueycwJMJ4p2j+fLIyKgAAAgA6/6EFtQPAABwAIACRuQAQ/8BACw4RNBY0DBE0HR8euAMCtSAgAQoSCUEJAwQAFwLvABgDBAASAu8AAQLrsh4gHbgDAbcfHwUYGBcXE0EKAwMAQAAAAvAAIgAKAvsAIAAJ/8C1CQs0CQkOugMDAAUBKoUv/TIZLysa7RgQ9Br9Mi8ZOS8YETkv7Tk5AD/tP+0/EjkRMy/9OTkxMAErKwEhIicmNTQ3NjcXBgcGFRQXFjMhNTQmJzcWFxYVAQcnNwW1/EbAco8qDzkeFhUdfG+qA082QU0sCUT9w06iSgElQ1SzXWEjYhMuLkc4dkE6G3CNMqM3DnDW/f2RVJIA//8AOv+hBbUDwAAWA48AAAAC/7r/oQH0A6YADAAQAF23BjQMETQPDQ64AwKzEBABB74C7wAIAwQAAgLvAAEC67IOEA24AwG3Dw8BCAgHBwO9AwMAAALwABIAAQEqhS8Q9P0yLxk5LxgROS/tOTkAP+0/7REzL+05OTEwASsBITUhNCcmJzcWFxYVAwcnNwH0/cYB8RwTS05IEhtmTqJKASWudj4rUaNbM02y/hmRVJL///+6/6EB9AOmABYDkQAAAAQAAAEKAiwFIAADAAcAGQAnAJCyAAIDuAMCtAEBBAYHuAMCQA8PBQEFBRYeIA0RNBQeJRa4Au+yFRUlugLvAAwC67IBAwC4AwG0AgIFBwa4AwFADAQEIh4aFRQQFhYiGrgC/bMICCkiugL9ABABKIUv7REzL+0ZETkvEjk5EjkRMxgv/Tk5My/tOTkAP/0yL+wSOTkrETMvXe05OTMv7Tk5MTABByc3BwcnNwEUBwYjIicmNTQ3NjcnNxYXFgc0JyYnBgcGFRQWMzI2AdROoktBTKJKAeIuR71JMDcjICEPPbUjeFduLzYtCRw5MDiEBMuQVo+vkVSR/YeNR24dIT1GXE5PBKlfGVSnJj8bGjEMJyMzOT8ABP/3ASUDAAYlAAMABwAmAC8AtLUECwEAAgO4AwK0AQEEBge4AwJAEQVACQs0BQUdJysoDS4QHR0WuAMKsigoLrgC77WQEAEQECa6Au8ACQLrsgEDALgDAbQCAgUHBrgDAUAMQAQEKyMIFignDQQZuAL+tyAPHQEdHSsIvQLwADEAKwMTABMBE4Uv7RDlGRE5L10a/Rc5EjkYEjkvGv05OTMv7Tk5AD/9Mi9d/TIv/TIvERI5ETk5ETMvK+05OTMv7Tk5MTABXQEHJzcHByc3ASMiJyYnBgYjIiY1NDY3JiY1NDc2NxYWFxcWFxYzMwEnBgYHFhYzMgIDTqJLQUyiSgKHj0g3KRkeXDNzmeCoAg0XEx8KFQ4eGRQfIY/+oxNXZCIVODE8BdCQVo+vkVSR+1t7XJE4Ph8YVtFOCEQIIioiJD50PqyORGgBEW0fQzcJCgADADoBJQW1BQYAAwAHACQAtLkAGP/AQAsOETQeNAwRNAACA7gDArQBAQQGB7gDAkALBUAJCzQFBSASGhFBCQMEAB8C7wAgAwQAGgLvAAkC67IBAwC4AwG0AgIFBwa4AwG3BAQNICAfHxtBCgMDAEAACALwACYAEgL7ACAAEf/AtQkLNBERFroDAwANASqFL/0yGS8rGu0YEPUa/TIvGTkvGBE5L/05OTMv7Tk5AD/tP+0/EjkRMy8r7Tk5My/tOTkxMAErKwEHJzcHByc3ASEiJyY1NDc2NxcGBwYVFBcWMyE1NCYnNxYXFhUD306iS0FMokoDYPxGwHKPKg85HhYVHXxvqgNPNkFNLAlEBLGQVo+vkVSR/HpDVLNdYSNiEy4uRzh2QTobcI0yozcOcNb//wA6ASUFtQUGABYDlQAAAAP/ugElAfQFVgADAAcAFAB7tw40DBE0AAIDuAMCtAEBBAYHuAMCtQ8FAQUFD74C7wAQAwQACgLvAAkC67IBAwC4AwG0AgIFBwa4AwG3BAQJEBAPDwu9AwMACALwABYACQEqhS8Q9f0yLxk5LxgROS/9OTkzL+05OQA/7T/tMy9d7Tk5My/tOTkxMAErAQcnNwcHJzcBITUhNCcmJzcWFxYVAe9OoktBTKJKAY/9xgHxHBNLTkgSGwUBkFaPr5FUkfwqrnY+K1GjWzNNsgD///+6ASUB9AVWABYDlwAAAAQAOgElBbUFuQADAAcACwAoAOpACwsQEhU0BRASFTQBuP/wsxIVNBy4/8BACw4RNCI0DBE0AAIDuAMCtQEBCwQGB7gDArQFBQgKC7gDAkALCUAJCzQJCSQWHhVBCQMEACMC7wAkAwQAHgLvAA0C67IBAwK4AwG1AAAIBQcEuAMBtAYGCQsKuAMBtwgIESQkIyMfQQoDAwBAAAwC8AAqABYC+wAgABX/wLUJCzQVFRq6AwMAEQEqhS/9MhkvKxrtGBD1Gv0yLxk5LxgROS/9OTkzL+05OREzL/05OQA/7T/tPxI5ETMvK+05OTMv7Tk5ETMv7Tk5MTABKysrKysBByc3AQcnNwcHJzcBISInJjU0NzY3FwYHBhUUFxYzITU0Jic3FhcWFQMaTaBKAWhOoktBTKJKA2D8RsByjyoPOR4WFR18b6oDTzZBTSwJRAVjklaS/viQVo+vkVSR/HpDVLNdYSNiEy4uRzh2QTobcI0yozcOcNb//wA6ASUFtQW5ABYDmQAAAAT/ugElAfQGCQADAAcACwAYALJACwsQEhU0BRASFTQBuP/wQAsSFTQSNAwRNAACA7gDArUBAQsEBge4AwK0BQUICgu4AwK1DwkBCQkTvgLvABQDBAAOAu8ADQLrsgEDArgDAbUAAAgFBwS4AwG0BgYJCwq4AwG3CAgNFBQTEw+9AwMADALwABoADQEqhS8Q9f0yLxk5LxgROS/9OTkzL+05OREzL/05OQA/7T/tMy9d7Tk5My/tOTkRMy/tOTkxMAErKysrAQcnNwEHJzcHByc3ASE1ITQnJic3FhcWFQEqTaBKAWhOoktBTKJKAY/9xgHxHBNLTkgSGwWzklaS/viQVo+vkVSR/Cqudj4rUaNbM02y////ugElAfQGCQAWA5sAAAACADb+TgQgA3UAAwAwAJxADi0gCgs0HCoKCzR5LgEfuP+2tQkRNAACAboDAgAD/8BACgkKNAMDFwsHIyK6Au8AJAMGtBMWBBcPuALvsgcHFroC7wAXAweyAQMCuAMBQBIAAI8EAQQWIiQjIxcWFjILCx26AwMAKwEqhS/tMy8RMy8zMy85ORE5XTkv/Tk5AD/tOS/tEjkROT/tORE5ETkvK/05OTEwAStdKysBByc3AyImIyIHBgc2NzYzMhcWMzI2MwcGBwYHBhUUFxYhMxcHIyInJicmNTQ3Njc2AwZVnU19FEwTQFA0WigjS7FCzF9FHXAcJdOU3HuZ4MMBRrgG4jrYj6tYZE88cyMBB5dakQFdBgwIEnEiShwNDqkkLkRieqbXbF4LnygwannHqIZmWxwAAAIANv5OBDUDaQA+AEIAzEAOHiAKCzQNKgoLNHkfARC4/6K1CRE0QT9AugMCAEL/wEAPCxM0QkIBEzgIND0pJRQTugLvABUDBrQwMyI0LbgC77IlJTO+Au8ANAMHAD0C7wABAuuyQEJBuAMBtz8/BA44MwgEuAMDQBA5OY8iASIzExUOFBQ0MzMAuALws0QpKQ66AwMAHAEqhS/tMy8Q5TMvMzMvEjk5ETldOS/9ORI5ERI5L/05OQA/7T/tOS/tEjkROT/tORE5ERI5ORESOS8r7Tk5MTABK10rKwEjIiY1NDc2NwYHBgcGFRQXFiEzFwcjIicmJyY1NDc2NzY3JiYjIgcGBzY3NjMyFjMyNjcHBgcGBwcUFxYzMwEHJzcENYl5ZgoEB6tXoFhv4MMBRrgG4jrYj6tYZFVCfyWpKFkkZT8VbiIlU7Fh4k0zYTUoKTQhOgIyH0uJ/opNoU0BJVpoJzoWJDQlRFZsitdsXgufKDBqecergGRTGVoFBwkDGGImVCUIB6oFCQYLOFIcEf7mklWSAAAC/7r/vAQ9A2sAFgAaAFyyGRcYuAMCtRoaAQsCD7gC77MJCRYCugLvAAEC67IYGhe4AwFADxkZAwsLAQNUCxE0AwMBALgC8LEcAS8Q5RE5LysSOS8ROS/tOTkAP/08Mi/tEjkRMy/tOTkxMAEhNSEmJyYnJiMiBzY3NjMyFxYXFhczAQcnNwQ9+30DL2ZGV0hRUzM0HS9EaGaLRZx5Kzz+A0ujTgElrk8sNxkcB0otQWQyjG0J/nmQVJIA////uv+8BD0DawAWA58AAAABADb+TgQgA3UALAB1QA4pIAoLNBgqCgs0eSoBG7j/trYJETQHAx8eugLvACADBrQPEgATC7gC77IDAxK6Au8AEwMHQBCPAAEAEh4gHx8TEhIuBwcZugMDACcBKoUv7TMvETMvMzMvOTkROV0AP+05L+0SORE5P+05ETkxMAErXSsrASImIyIHBgc2NzYzMhcWMzI2MwcGBwYHBhUUFxYhMxcHIyInJicmNTQ3Njc2AeQUTBNAUDRaKCNLsULMX0UdcBwl05Tce5ngwwFGuAbiOtiPq1hkTzxzIwK4BgwIEnEiShwNDqkkLkRieqbXbF4LnygwannHqIZmWxwAAAEANv5OBDUDaQA+AKBADh4gCgs0DSoKCzR5HwEQuP+iQAsJETQ4CDQ9KSUUE7oC7wAVAwa0MDMiNC24Au+yJSUzvgLvADQDBwA9Au8AAQLrszgzCAS4AwNAEDk5jyIBIjMTFQ4UFDQzMwC4AvCzQCkpDroDAwAcASqFL+0zLxDlMy8zMy8SOTkROV05L/05EjkAP+0/7Tkv7RI5ETk/7TkRORESOTkxMAErXSsrASMiJjU0NzY3BgcGBwYVFBcWITMXByMiJyYnJjU0NzY3NjcmJiMiBwYHNjc2MzIWMzI2NwcGBwYHBxQXFjMzBDWJeWYKBAerV6BYb+DDAUa4BuI62I+rWGRVQn8lqShZJGU/FW4iJVOxYeJNM2E1KCk0IToCMh9LiQElWmgnOhYkNCVEVmyK12xeC58oMGp5x6uAZFMZWgUHCQMYYiZUJQgHqgUJBgs4UhwRAAAB/7oBJQQ9A2sAFgA8sgsCD7gC77MJCRYCugLvAAEC60AMCwsBA1QLETQDAwEAuALwsRgBLxDlETkvKxI5LwA//TwyL+0SOTEwASE1ISYnJicmIyIHNjc2MzIXFhcWFzMEPft9Ay9mRldIUVMzNB0vRGhmi0WceSs8ASWuTyw3GRwHSi1BZDKMbQkA////ugElBD0DawAWA6MAAAACADb+TgQgBR0AAwAwAJNADi0gCgs0HCoKCzR5LgEfuP+2tQkRNAACA7gDArYBAQ8LByMiugLvACQDBrQTFgQXD7gC77IHBxa6Au8AFwMHsgEDArgDAUASAACPBAEEFiIkIyMXFhYyCwsdugMDACsBKoUv7TMvETMvMzMvOTkROV05L/05OQA/7Tkv7RI5ETk/7TkROREzL+05OTEwAStdKysBByc3AyImIyIHBgc2NzYzMhcWMzI2MwcGBwYHBhUUFxYhMxcHIyInJicmNTQ3Njc2AqRNoUsdFEwTQFA0WigjS7FCzF9FHXAcJdOU3HuZ4MMBRrgG4jrYj6tYZE88cyMEyJFUkv2bBgwIEnEiShwNDqkkLkRieqbXbF4LnygwannHqIZmWxwAAgA2/k4ENQUdAAMAQgDCQA4iIAoLNBEqCgs0eSMBFLj/orUJETQAAgO4AwJACwEBMTwMOEEtKRgXugLvABkDBrQ0NyY4MbgC77IpKTe+Au8AOAMHAEEC7wAFAuuyAQMCuAMBtwAACBI8NwwIuAMDQBA9PY8mASY3FxkSGBg4NzcEuALws0QtLRK6AwMAIAEqhS/tMy8Q5TMvMzMvEjk5ETldOS/9ORI5ERI5L/05OQA/7T/tOS/tEjkROT/tORE5ERI5OREzL+05OTEwAStdKysBByc3ASMiJjU0NzY3BgcGBwYVFBcWITMXByMiJyYnJjU0NzY3NjcmJiMiBwYHNjc2MzIWMzI2NwcGBwYHBxQXFjMzAqhNoUsCMIl5ZgoEB6tXoFhv4MMBRrgG4jrYj6tYZFVCfyWpKFkkZT8VbiIlU7Fh4k0zYTUoKTQhOgIyH0uJBMiRVJL8CFpoJzoWJDQlRFZsitdsXgufKDBqecergGRTGVoFBwkDGGImVCUIB6oFCQYLOFIcEQAAAv+6ASUEPQUdAAMAGgBcsgACA7gDArUBARMPBhO4Au+zDQ0aBroC7wAFAuuyAQMAuAMBQA8CAgcPDwUHVAsRNAcHBQS4AvCxHAUvEOUROS8rEjkvETkv7Tk5AD/9PDIv7RI5ETMv7Tk5MTABByc3ASE1ISYnJicmIyIHNjc2MzIXFhcWFzMCXkyiSgKD+30DL2ZGV0hRUzM0HS9EaGaLRZx5KzwEyJFUkvwIrk8sNxkcB0otQWQyjG0JAP///7oBJQQ9BR0AFgOnAAAAAQBfASUCswRqABYATUAJZhN0EwIHBw0SuALvshERDboC7wABAuu1EhIREQgNugMDAAAC8LIYBAi6AvkABwEqhS/tMxD17RE5Lxk5LwAYP/0yL+0SOS8xMAFdASEiJjU0NjczFhcWMyE0JyYnNxYXFhUCs/5AOVsICxcLHRgqAYMyPpEPrUg6ASVCLSY+JSkSD7NtiC3CVbqW8gD//wBfASUCswRqABYDqQAAAAIAXwElArMGEwADABoAb7dmF3QXAgACA7gDArYBARYLCxEWuALvshUVEboC7wAFAuuyAQMAuAMBQAoCAhULFhYVFQwRugMDAAQC8LIcCAy6AvkACwEqhS/tMxD17RE5Lxk5LxgREjkv7Tk5AD/9Mi/tEjkvETMv7Tk5MTABXQEHJzcBISImNTQ2NzMWFxYzITQnJic3FhcWFQGpTqBJAa/+QDlbCAsXCx0YKgGDMj6RD61IOgW9kVaR+xJCLSY+JSkSD7NtiC3CVbqW8gD//wBfASUCswYTABYDqwAAAAEASv9GA+kDcAAeAHJACxMqCRE0EioMETQEuP/gswkRNAO4/+CzCRE0Arj/1kALCRE0GDQMETQNDBm6Au8AGgMJsgw6ELoDCgAGAwi0GhoZGRW6AwMAAALwsiANDLgBGoUvMxD0/TIvGTkvABg//RnkGD/tETkxMAErKysrKysBFAcGBwYjIicmJyYnNxYWMzI3NjY1NCcmJzcWFxYVA+leUnp0S0VQPVVIRxFCjzqAi36yLiVDOVInLAElbnZoS0gUDyAbGygNG1JL5VxPV0ZKnUxMVmoA//8ASv9GA+kDcAAWA60AAAACAEr/RgPpBR0AAwAiAJJACxcqCRE0FioMETQIuP/gswkRNAe4/+CzCRE0Brj/1kALCRE0HDQMETQAAgO4AwK1AQEeERAdugLvAB4DCbIQOhS6AwoACgMIsgEDArgDAbcAAB0eHh0dGboDAwAEAvCyJBEQuAEahS8zEPT9Mi8ZOS8RMxgv/Tk5AD/9GeQYP+0ROREzL+05OTEwASsrKysrKwEHJzcBFAcGBwYjIicmJyYnNxYWMzI3NjY1NCcmJzcWFxYVA1NNoUsBOV5SenRLRVA9VUhHEUKPOoCLfrIuJUM5UicsBMiRVJL8CG52aEtIFA8gGxsoDRtSS+VcT1dGSp1MTFZqAP//AEr/RgPpBR0AFgOvAAAAAQA+/2wGkgNXAEYA+bVAIBARNB64/+BAGg4RNCEgCxE0JjQLETRBQUI6NDUsQkIoNTUnugLvACgDCbIZHxi6AwcAOgLvsgAALL4C7wAJAusAHwLvAA8DEbMEQTE0ugL6ADX/wEARCRE0NTVBCSgoDycfJwInJyO7AwUALAAJ/8BADwkNNAkJQRxCQj9BAUFBPUEKAwUAQAAAAvAASAAZAvsAIAAY/8C1CQs0GBgcuAMDswATARO4ASqFL139MhkvKxrtGBD1Gv0yL10ZOS8YERI5Lys8/TIvXRk5LxESOS8r9DkSOQAYP+0/7TwQ7T8SOT/9OS8SOS8REjkREjkvMTABKysrKwEjIiYnBgcGIyMUBwYHBiMiJyY1NDY3NjcXBgYVFBYzMjc2NTQnJic3FhcWFTMyNzY1NCYnNxcWFxYzMjY1NCcmJzcWFxYVBpJPPFsvKiEvWnssOXWT3chqdCokFjYoRi2xpMCXvCUdNVMyEhl7XygjBwcoEBYlKUsXGR8XJkMvChYBJSEkJg0SXFdxQlNGTZ9WsFk2cBKQpkV8gUNTlWRaR0HNUj9Zmh0ZNB07IzxhYiswHRYyOSoqbU0cP3gA//8APv9sBpIDVwAWA7EAAAAB/7oBJQQ/AzUAOwCqQBc1IBARNAQNEhEpKiIaEhsbNioqNzY2N7oDCQAvAu+yAAAiuALvsgkJEroC7wARAuu2BDIqDRsmKboC+gAq/8C3CQ40Kio2Fxq6AvoAG//AQBEJCjQbGzYRNzc2QAwONDY2MroDBQAAAvCxPREvEPX9Mi8rGTkvERI5Lyv0ORI5Lyv0ORE5ERI5ABg/7TwQ7TwQ7T85LxI5LxE5LxI5ERI5ERI5OTEwASsBIyImJwYHBiMjIicmJwYGIyM1MzI3NjU0Jic3FhcWFxYzMzI3NjU0Jic3FxYXFjMyNjU0JyYnNxYXFhUEP01AXCYvIzNZQTQ0IjIwUFrBwVEjOgYIKRwSICYuQENLJCgIByoVGyciOhshKQcqQSkPFgElIyAlDBIUDR4kG64OF0UdOiQ8XCpJJS0XGjkfOiI8Xm8rJiEaOD4KN20+LURx////ugElBD8DNQAWA7MAAAAEAD7/bAaSBbkAAwAHAAsAUgFvQAsLEBIVNAUQEhU0Abj/8EAJEhU0TCAQETQquP/gQBAOETQtIAsRNDI0CxE0AAIDuAMCtQEBCwQGB7gDArQFBQgKC7gDAkAQCQk0TU1ORkBBOE5ONEFBM7oC7wA0AwmyJSskugMHAEYC77IMDDi+Au8AFQLrACsC7wAbAxGyAQMCuAMBtQAACAUHBLgDAbQGBgkLCrgDAbcICEkVEE09QLoC+gBB/8BAEQkRNEFBTRU0NA8zHzMCMzMvuwMFADgAFf/AQA8JDTQVFU0oTk4/TQFNTUlBCgMFAEAADALwAFQAJQL7ACAAJP/AtQkLNCQkKLgDA7MAHwEfuAEqhS9d/TIZLysa7RgQ9Rr9Mi9dGTkvGBESOS8rPP0yL10ZOS8REjkvK/Q5EjkYERI5L/05OTMv7Tk5ETMv/Tk5AD/tP+08EO0/Ejk//TkvEjkvERI5ERI5LxEzL+05OTMv7Tk5ETMv7Tk5MTABKysrKysrKwEHJzcBByc3BwcnNwEjIiYnBgcGIyMUBwYHBiMiJyY1NDY3NjcXBgYVFBYzMjc2NTQnJic3FhcWFTMyNzY1NCYnNxcWFxYzMjY1NCcmJzcWFxYVBX5NoEoBaE6iS0FMokoB2U88Wy8qIS9aeyw5dZPdyGp0KiQWNihGLbGkwJe8JR01UzISGXtfKCMHBygQFiUpSxcZHxcmQy8KFgVjklaS/viQVo+vkVSR/HohJCYNElxXcUJTRk2fVrBZNnASkKZFfIFDU5VkWkdBzVI/WZodGTQdOyM8YWIrMB0WMjkqKm1NHD94AP//AD7/bAaSBbkAFgO1AAAABP+6ASUEPwW5AAMABwALAEcBHkALCxASFTQFEBIVNAG4//BACxIVNEEgEBE0AAIDuAMCtQEBCwQGB7gDArQFBQgKC7gDAkAVCQlDEBkeHTU2LiYeJydCNjZDQkJDugMJADsC77IMDC64Au+yFRUeugLvAB0C67IBAwK4AwG1AAAIBQcEuAMBtAYGCQsKuAMBQAoICDUQPjYZJzI1ugL6ADb/wLcJDjQ2NkIjJroC+gAn/8BAEQkKNCcnQh1DQ0JADA40QkI+ugMFAAwC8LFJHS8Q9f0yLysZOS8REjkvK/Q5EjkvK/Q5ETkREjkYEjkv/Tk5My/tOTkRMy/9OTkAP+08EO08EO0/OS8SOS8ROS8SORESORESOTkRMy/tOTkzL+05OREzL+05OTEwASsrKysBByc3AQcnNwcHJzcBIyImJwYHBiMjIicmJwYGIyM1MzI3NjU0Jic3FhcWFxYzMzI3NjU0Jic3FxYXFjMyNjU0JyYnNxYXFhUDIU2gSgFoTqJLQUyiSgHjTUBcJi8jM1lBNDQiMjBQWsHBUSM6BggpHBIgJi5AQ0skKAgHKhUbJyI6GyEpBypBKQ8WBWOSVpL++JBWj6+RVJH8eiMgJQwSFA0eJBuuDhdFHTokPFwqSSUtFxo5HzoiPF5vKyYhGjg+CjdtPi1Ecf///7oBJQQ/BbkAFgO3AAAAAgA+/2wIyQNXADEAPgCtuQAU/9ZADg4RNBc0CxE0HDQLETQ1uALvsi0tHboC7wAeAwmyDxUOugMHADwC77IAACK+Au8AAQLrABUC7wAFAxG3OzIBHh4dHRm4AwW2ASIiAQESMkEKAvwAQAAAAvAAQAAPAvsAIAAO/8C1CQs0Dg4SugMDAAkBKoUv/TIZLysa7RgQ9RrtETkvMy8Q/TIvGTkvERI5ABg/7T/tPBDtPxI5P/05L+0xMAErKysBIQYHBiEiJyY1NDY3NjcXBgYVFBYzMjc2NTQnJic3FhcWFTMyNzY3Njc2NzYzMhcWFQc0JiMiBwYHBgchMjYIyftcHnKO/t3IanQqJBY2KEYtsaTAl7wlHTVTMhIZEndmWGGUHVJBSlmJRD+ie1JIWT9hSUgBzWByASXQaIFGTZ9WsFk2cBKQpkV8gUNTlWRaR0HNUj9ZmiYhR2cTNBYZT0mEAjE3IBcyJiYnAP//AD7/bAjJA1cAFgO5AAAAAv+6ASUGxQM+ACUAMABbtxITBQoJExMhuALvsikpLboC7wAXAu+yAQEKugLvAAkC67QtBSYPErgC+rMTEwkmugL8AAAC8LEyCS8Q9e0ZETkv9DkSOTkAGD/tPBDt/TIv7TkvERI5ETkxMAEhIicmJwYGIyM1MzI3NjU0Jic3FhcWMzI3Njc2NzY3NjMyFxYVBzQmIyIHBgchMjYGxftONjElMipUXMHBUSM6BwcpIz1BWFRxeliPIFFCSliIRUCjelFkjnFwAc1tZAElEg4fJBuuDhdFHTsjPIhKTyYpP2YUNBYZT0mEAjE3Qzk5JgD///+6ASUGxQM+ABYDuwAAAAMAPv9sCMkEuQADADUAQgDMuQAY/9ZAEA4RNBs0CxE0IDQLETQAAgO4AwKzAQEiObgC77IxMSG6Au8AIgMJshMZEroDBwBAAu+yBAQmvgLvAAUC6wAZAu8ACQMRsgEDArgDAUAKAAA/NgUiIiEhHbgDBbYFJiYFBRY2QQoC/ABAAAQC8ABEABMC+wAgABL/wLUJCzQSEha6AwMADQEqhS/9MhkvKxrtGBD1Gu0ROS8zLxD9Mi8ZOS8REjkYOS/9OTkAP+0/7TwQ7T8SOT/9OS/tETMv7Tk5MTABKysrAQcnNwEhBgcGISInJjU0Njc2NxcGBhUUFjMyNzY1NCcmJzcWFxYVMzI3Njc2NzY3NjMyFxYVBzQmIyIHBgcGByEyNgYvTKJKAz77XB5yjv7dyGp0KiQWNihGLbGkwJe8JR01UzISGRJ3ZlhhlB1SQUpZiUQ/ontSSFk/YUlIAc1gcgRkkVSS/GzQaIFGTZ9WsFk2cBKQpkV8gUNTlWRaR0HNUj9ZmiYhR2cTNBYZT0mEAjE3IBcyJiYn//8APv9sCMkEuQAWA70AAAAD/7oBJQbFBLkAAwApADQAerIAAgO4AwJACwEBJRYXCQ4NFxcluALvsi0tMboC7wAbAu+yBQUOugLvAA0C67IBAwK4AwG2AAAxCSoTFrgC+rMXFw0qugL8AAQC8LE2DS8Q9e0ZETkv9DkSOTkYOS/9OTkAP+08EO39Mi/tOS8REjkROREzL+05OTEwAQcnNwEhIicmJwYGIyM1MzI3NjU0Jic3FhcWMzI3Njc2NzY3NjMyFxYVBzQmIyIHBgchMjYESUyiSgMg+042MSUyKlRcwcFRIzoHBykjPUFYVHF6WI8gUUJKWIhFQKN6UWSOcXABzW1kBGSRVJL8bBIOHyQbrg4XRR07IzyISk8mKT9mFDQWGU9JhAIxN0M5OSb///+6ASUGxQS5ABYDvwAAAAL/ugElBKcGWQAtADkAjbkAH//wQA0PETQlBzE3ERAYGykevQLvABQAGAMLACkC77QxMTc3AroC7wABAutAECUhNwcKARsYHhQUEREYGBC4AxKyHh4huAMSswoKAS66AvwAAALwsTsBLxD17RE5L+0zL+0zLzIvGTkvERI5ERI5ORE5ABg//TwRMy/tPzPtETkROTkREjk5MTABKwEhNTcyNzY3NjY1NCcmJyYnJzY2NxYXFhcGBgcmJycWFhUUBwYHNjc2MzIXFhUHNCYjIgcGBwYHITIEp/sTmUQ7RFYSFhQPHhAaPgcbGBA5L0kKCg4HHg0jLQ4FDa8xlGqHQz2eaWJJX05YQUUBs+wBJa4BEhU1LGUva4Fef0JfHzxwNC8aFQdnOCkBCQR191RHVx9BZRdGT0iFAjM1IBouIiv///+6ASUEpwZZABYDwQAA////ugElBKcGWQAWA8EAAP///7oBJQSnBlkAFgPBAAAAA/+6ASUEpwZZAAMAMQA9ALW5ACP/8LUPETQAAgO4AwJADQEBLSkLNTsVFBwfLSK9Au8AGAAcAwsALQLvtDU1OzsGugLvAAUC67IBAwK4AwFAGQBACQs0AAAyHCklOwsOBR8cIhgYFRUcHBS4AxKyIiIluAMSsw4OBTK6AvwABALwsT8FLxD17RE5L+0zL+0zLzIvGTkvERI5ERI5ORE5GBESOS8r/Tk5AD/9PBEzL+0/M+0RORE5ORESOTkRMy/tOTkxMAErAQcnNwEhNTcyNzY3NjY1NCcmJyYnJzY2NxYXFhcGBgcmJycWFhUUBwYHNjc2MzIXFhUHNCYjIgcGBwYHITIDl02iSgG1+xOZRDtEVhIWFA8eEBo+BxsYEDkvSQoKDgceDSMtDgUNrzGUaodDPZ5pYklfTlhBRQGz7ATIkVSS/AiuARIVNSxlL2uBXn9CXx88cDQvGhUHZzgpAQkEdfdUR1cfQWUXRk9IhQIzNSAaLiIr////ugElBKcGWQAWA8UAAP///7oBJQSnBlkAFgPFAAD///+6ASUEpwZZABYDxQAAAAEAKv5OBCAERgA3AKezgCsBHbj/4LMOETQxuP/MswsRNDC4/+BACQsRNA0gDhE0DboC7wAj/9q3DhE0IyMoADe8Au8AAQMGABUC77IZGSe6Au8AKAMHQBQNNA4RNCMNJx8BAC4ZGSc3AAAoJ7j/wLYMDTQnJzkfuAMMshERLroDDAAHAR+FL+0zL+0RMy8rMzMvPBE5LxESORESOTkrAD/9Mi/tP+05ETkvK+0rMTABKysrXQEHIicmJyY1NDc2NzY3JicmNTQ3NjMyFxYXIgcGBwYVFBcWFzY3NjcHBgcGBwYVFBcWFxYzMjY3BCD90HLFa4cmHzocRmAlUllmkUFJMUpiZ4VSZHNhe2RfanIq0Fy6Y39qXLOO3C9eL/71pxEdV23MfGNRSCJFMCNNdmpmdSYZOg0RICc5PTcuEzYmKhycUStYXHaHjVFGHRcCAQAAAQA2/k4D4wNzADQAsUAJ6AQBBSAMDjQxuP+6swkRNDC4/8xAEAkRNAsKGwoCKB8NAxMjADS6Au8AAQMGtRAQFxMTF7j/wLUNETQXFyO6Au8AJQLrQA80AQAuKB8NGxskHw0NEh+4/8BACQ8RNB8fEgAAJLsC8AA2ABIC+bITEy66AwwABwEehS/tMy/tEPUyLxE5LysSOS8REjkvERI5ERI5OQA//TIvKzkvEjkvP+05ERIXOTEwAV0rKysAXQEHIicmJyY1NDc2NzY3JiYjIgcjNjc2MzIXFhUUBwYHFhYzMxUjIiYnBgcGBwYVFBcWFxYzA+PKu2vCbo01KlQoawolFRoZERUXOIBWPkUmIxY4Z01cXJmpM0k7UC04qYLjeMn+7qARH1lzz4l1XV4tZCIgI2koYCovSzEiHBJDOK5cai8yREFRS6ldRxkNAAH/ugElA8MDxwAdAG65ABb/4LcQETQREhIAFbgC77MvDQENugMEAAAC77YAAQEBAQYbvALvAAYC7wAFAutAERIbEQc0DRE0BwoREQEAAB8YuAMAsgoKBS8zL+0RMy8zMy8ROSsROTkAP+3tEjkvXe0/Xe0ROS85MTABKwEHBgQjIzUzJiY1NDYzMhcWFwcmJiMiBhUUFhc2NgPDRZf+c6f58B0kxZt7UCJRE0VuO4qdY06k0gJdtjdLri93OHagPBliERMTPTIxeS8ZLwAAAf+6ASUDJwNYACgAakAMECQXBSgAExMcFxccuP/AtQ4RNBwcKLgC77IAAAu6Au8ACgLrQA8FJBAQJCQWUCCAIAIgIAC7AvAAKgAWAvmyFxcKLzMv7RD0Mi9dEjkvOS8SOQA/7TwQ/TIvKzkvEjkvERI5ETk5MTABIyInJicGBwYjIzUzMjc2NycmIyIGByM1NDc2MzIXFhUUBwYHFhYzMwMnk0FDUCRDVmmGWlpUSFJPKiAoEhwRFTo1g3FHXSUbSBBbH5MBJR8lQjwhKa4SFS42Jg0WO24pJR4nUSsuIjwYIAAAAgAq/k4EIAXlAAMAOwDFs4AvASG4/+CzDhE0Nbj/zLMLETQ0uP/gtQsRNAACA7gDAkAJAQEZESAOETQRugLvACf/2rcOETQnJywEO7wC7wAFAwYAGQLvsh0dK7oC7wAsAweyAQMCuAMBQBYAABE0DhE0JxErIwUEMh0dKzsEBCwruP/AtgwNNCsrPSO4AwyyFRUyugMMAAsBH4Uv7TMv7REzLyszMy88ETkvERI5ERI5OSs5L/05OQA//TIv7T/tORE5LyvtKxEzL+05OTEwASsrK10BByc3AQciJyYnJjU0NzY3NjcmJyY1NDc2MzIXFhciBwYHBhUUFxYXNjc2NwcGBwYHBhUUFxYXFjMyNjcB8lGcUQLK/dByxWuHJh86HEZgJVJZZpFBSTFKYmeFUmRzYXtkX2pyKtBcumN/alyzjtwvXi8FkJBTkvkQpxEdV23MfGNRSCJFMCNNdmpmdSYZOg0RICc5PTcuEzYmKhycUStYXHaHjVFGHRcCAQAAAgA2/k4D4wUdAAMAOADUQAnoCAEJIAwONDW4/7qzCRE0NLj/zEALCRE0Cw4bDgIAAgO4AwJACwEBGywjEQMXJwQ4ugLvAAUDBrUUFBsXFxu4/8C1DRE0GxsnugLvACkC67IBAwK4AwFAEwAAHyM4BQQyLCMRHx8oIxERFiO4/8BACQ8RNCMjFgQEKLsC8AA6ABYC+bIXFzK6AwwACwEehS/tMy/tEPUyLxE5LysSOS8REjkvERI5ERI5ORESOS/9OTkAP/0yLys5LxI5Lz/tORESFzkRMy/tOTkxMAFdKysrAF0BByc3AQciJyYnJjU0NzY3NjcmJiMiByM2NzYzMhcWFRQHBgcWFjMzFSMiJicGBwYHBhUUFxYXFjMCV0yiSwIvyrtrwm6NNSpUKGsKJRUaGREVFziAVj5FJiMWOGdNXFyZqTNJO1AtOKmC43jJBMiRVJL50aARH1lzz4l1XV4tZCIgI2koYCovSzEiHBJDOK5cai8yREFRS6ldRxkNAAAC/7oBJQPDBR0AAwAhAJG5ABr/4LUQETQAAgO4AwJACw8BAQEBERUWFgQZuALvsy8RARG6AwQABALvtgAFAQUFCh+8Au8ACgLvAAkC67IBAwK4AwFAEwAAFh8VCzQNETQLDhUVBQQEIxy4AwCyDg4JLzMv7REzLzMzLxE5KxE5OTkv/Tk5AD/t7RI5L13tP13tETkvOREzL13tOTkxMAErAQcnNwEHBgQjIzUzJiY1NDYzMhcWFwcmJiMiBhUUFhc2NgIfS6NMAkZFl/5zp/nwHSTFm3tQIlETRW47ip1jTqTSBMiRVJL9QLY3S64vdzh2oDwZYhETEz0yMXkvGS8AAv+6ASUDJwUdAAMALACKsgACA7gDAkAPAQEgFCgbCSwEFxcgGxsguP/AtQ4RNCAgLLgC77IEBA+6Au8ADgLrsgEDArgDAUASAAAkCSgUFCgoGlAkgCQCJCQEuwLwAC4AGgL5shsbDi8zL+0Q9TIvXRI5LzkvEjkSOS/9OTkAP+08EP0yLys5LxI5LxESORE5OREzL+05OTEwAQcnNwEjIicmJwYHBiMjNTMyNzY3JyYjIgYHIzU0NzYzMhcWFRQHBgcWFjMzAdJMoksB+JNBQ1AkQ1ZphlpaVEhSTyogKBIcERU6NYNxR10lG0gQWx+TBMiRVJL8CB8lQjwhKa4SFS42Jg0WO24pJR4nUSsuIjwYIAAAAwAnASUGTwVzAAMAIwAuAK+1CSAQETQVuP/MswwRNBS4/+C1DBE0AAIDuAMCswEBHyS4/8BACRARNCQkKBAWD0EJAwQAKALvAB8DBAAWAu8ABQLrsgEDArgDAbYAACsXFyQbuALzsisrJEEKAxAAQAAEAvAAMAAQAvsAIAAP/8C1CQs0Dw8TugMDAAsBKoUv/TIZLysa7RgQ9Rr9Mi/tEjkvETkv/Tk5AD/tP+0/EjkROS8rETMv7Tk5MTABKysrAQcnNwEhIicmJyY1NDc2NxcGBhUUBCEhJicmNTQ3NjMyFxYVJzQnJiMiBhUUFxYFiFKiUwFo/GvTgZpPVjMlEigrHAEgAToC4XU3Pz5GVWMsJWgTFy8iISkeBR2UWJL7shofSE6GWXdRKBdXWyWEfiAqMEddand1YrUOVy84KSUxGRL//wAnASUGTwVzABYD0QAAAAP/ugElAiQFzwADABkAJQB0sgACA7gDAkAJAQEVGh4JIw0VuALvsh4eI7gC77INDQa6Au8ABQLrsgEDArgDAUALAAAaIA4RNAkaBxG4AwyzISEFB7oDDAAEAvCxJwUvEPXtETkv7RI5OSs5L/05OQA//TIv/TIv7RESORE5ETMv7Tk5MTABByc3ASE1ITQnBgcGIyInJjU0NzYzMhcWFQMmJyYjIgYVFDMyNgGfTaFKASn9lgIVFTQcLiNJLjUyOFp6QjejDh8qJhsjWBc0BXmSVpL7Vq5ZThEHDCUqT4todL+e1QEEJCUyLR9QEgAD/7oBJQIaBacAAwAWACEAakALCwwBGSAQETQAAgO4AwKyAQESuALvtRsbChcXBroC7wAFAuuyAQMCuAMBtgAAHgoEFw64AwyzHh4FF7oDDAAEAvCxIwUvEPXtETkv7RESORI5L/05OQA//TIvOTMv/TIv7Tk5MTABK10BByc3EyE1ITI2NyYnJjU0NzYzMhcWFScmJyYjIgYVFBcWAcNYjFPo/aABVz5XM6wzczc+WWY1KloXFSk6HChPHAVLkGCM+36uCQ8ZFjJ4aV1pgmeMBFAnSyweTBoJAAQARv9nBKcFdwADAAcANQBCANGzVAoBCbj/4LMOETQduP/gQAsOETQhQAkRNAACA7gDArQBAQQGB7gDArIFBTG4Au+yOjopuALvs0BAFRS8AwcAHwLvAAwDEbIBAwC4AwG0AgIFBwa4AwFACwQENiANETQmNiMtuAL9sz09GyNBCgMDAEAACALwAEQAFQL7ACAAFP/AtQkLNBQUG7gDA7MAEAEQuAEqhS9d/TIZLysa7RgQ9RrtETkv7RI5OSs5L/05OTMv7Tk5AD/tPzk5L+0zL/0yL+05OTMv7Tk5MTABKysrXQEHJzcHByc3ARQHBiEiJyY1NDc2NxcGBwYHBhUUFxYzMjc2NTQmJwYGIyInJjU0NzYzMhcWFScmJyYjIgYVFBYzMjYEMk6iS0FMokoB/76r/uXfeoQmI0EqHRQbDA9uZsfVoLkHCSZNJ1g3QzpBWXVEOp8aCxwqMC06JRotBSKQVo+vkVSR+9bGaF1QV6t2gnh4EkY2SjVDP4I+OUZRijMtFxIVKDBhcWd0oIizsT4PKS4jHyQPAP//AEb/ZwSnBXcAFgPVAAAABP+6ASUCJAXsAAMABwAdACkAlrIAAgO4AwK0AQEEBge4AwJADgVACQw0BQUZHiINJxEZuALvsiIiJ7gC77IREQq6Au8ACQLrsgEDALgDAbQCAgUHBrgDAUALBAQeIA4RNA0eCxW4AwyzJSUJC7oDDAAIAvCxKwkvEPXtETkv7RI5OSs5L/05OTMv7Tk5AD/9Mi/9Mi/tERI5ETkRMy8r7Tk5My/tOTkxMAEHJzcHByc3ASE1ITQnBgcGIyInJjU0NzYzMhcWFQMmJyYjIgYVFDMyNgIETqJLQUyiSgGq/ZYCFRU0HC4jSS41MjhaekI3ow4fKiYbI1gXNAWXkFaPr5FUkfuUrllOEQcMJSpPi2h0v57VAQQkJTItH1ASAAT/ugElAhoF0AADAAcAGgAlAIZACwsQAR0gEBE0AAIDuAMCtAEBBAYHuAMCsgUFFrgC77UfHw4bGwq6Au8ACQLrsgEDALgDAbQCAgUHBrgDAbYEBCIOCBsSuAMMsyIiCRu6AwwACALwsScJLxD17RE5L+0REjkSOS/9OTkzL+05OQA//TIvOTMv/TIv7Tk5My/tOTkxMAErXQEHJzcHByc3ASE1ITI2NyYnJjU0NzYzMhcWFScmJyYjIgYVFBcWAe9VfVZpT3tTAYf9oAFXPlczrDNzNz5ZZjUqWhcVKTocKE8cBX+GUoWNiFGG+5OuCQ8ZFjJ4aV1pgmeMBFAnSyweTBoJAAACAC0BJQTPBjMAKABJASW5ADj/4LMQETQbuAMKQAkvHAEcHEgjEhW4Awq2LyYBJiZIA7gC8UAPDEAJDDQMDDI6PTxERzJIuALvskFARL8DCwAzADIDCQA6Au8AKgLrQBUcDxtACw40GxsADwgHQAkONAcHNhi4Av1ACSBACQo0ICA2ALsC/QBAAA//wLcJETQPDz02QbgC+0ALIEBAPT08R0hERDy4AxC1D0gBSEg7vwMQACkC8ABLADMC+wAy/8C1CRE0MjI2ugMMAC4BJIUv/TIvK+0Q9e0zL13tMy8SOREzLzMZLxrtGBESOS8rGu0SOS8r7RE5Lys5ERI5LysSOQA/7T85PzMz7RE5ETk5ERI5LyvtEjkvXbEGAkNUWLQLJhsmAgBdWf05ORI5L13tMTABKwEUBiMiJyYnNzIXFjMyNjU0JiMiBwciJjU0NjcHBgcGFRQWMzI3NzIWASEiJyY1NDc2NxcGBhUUFxYzIQMnNDY3FxQXFxQGBycTA2GShD1KLVcRGCJPE3OlIhcaDkYZI69gE0UlPCAVEg42NCoBbv0e72VsLw0qIiIVc1amAn19NBgYD0hsFwwwdgOIbXgRChsVAwdDLhUeAQUaH1TqIIMTFiMxEQ8CBzb9WTk9k1hwH1QUTlQmbSwhA1AZRXk5CzodKC5yIBD88P//AC0BJQTPBjMAFgPZAAD///+6ASUDJwXfABYDLwAA////ugElAycF3wAWAy8AAAABAEcADgQNBjMANwCguQAC/+CzDxE0Nbj/8LMNETQZuP/MQA4NETQcIAwRNCQjLjEQMrgC77InJi5BCQMLABEAEAMJABoC7wAGACcC+0AKJiYkJCMxMi4uI7gDELIyMh6/AwwAAALwADkAEQL7ABD/wLUJCzQQEBe6AwwACgElhS/9Mi8r7RD17TMv7TMvEjkRMy8zGS/lABgv7T85PzMz7RE5ETk5MTABKysrKwEUBwYHBiMiJyY1NDc2NzY3FwYHBgcGFRQWMzI3NjU0JyYvAjQ3MxYWFxYXFhcUBgcnFhcWFxYEDUtDgm6pwWp0GRUrHzUgJRkhEBOzn6mQnh8YIyEuNxEEFBcfJRsUCg85AhsfDxgBoaBeUyQeR06bVl1PXkRgE0M1RzhEQHt+OkBZYeiy3MIYhm4mJQkNEg0KRkA6Ehaz0YLQAP//AEcADgQNBjMAFgPdAAAAAf+6ASUBqAYzABIAcbkAEv/wQAocHTQFBA0QEgMRuALvsgkIDb8DCwADAu8AQAABAusACQL7QAsgCAgFBQQQEQ0NBLgDELIREQO9AxAAAALwABQAAQElhS8Q9e0zL+0zLxI5ETMvMxkvGu0AGD8a7T8zM+0ROTkROTkxMAArASE1IQMnNDY3FxQXFhcUBgcnEwGo/hIBiXc0GBgPQTIzEAswdgElrgNQGUV5OQs6HRQUMnIcEPzw////ugElAagGMwAWA98AAAABACP+TgK0AtsAKgCIuQAI/+CzHB80B7j/+EATERk0ixOLGAIgGx9ACRg0Hx8XJLgC70AJG0AZGjQbGxcqvgLvABcC7wABAusADAMGsxcXAB+4AvqzICAFALgC8LYsDAwSCQkFuAL9sxASARIvXe0zLxkSOS8YEOQROS/9ETkvAD8/7e0RMy8r7RI5LysSOTEwAV0rKwEjIgcGFRQWFhUUBgcmJyYnJjU0Njc2NyYnJiMiBwYHJzY3NjMyFxYXFhcCtHemfJ0tLwsOGhkwFyRrb1ixPw8zNCEeGCIuHiY/Vj4+MzUaMwElHydJQpaaQCY+MlNTnlGAGoCJIRoSQAwoFBAnHUstSi4mRCFPAP//ACP+TgK0AtsAFgPhAAAAAv+6ASUDJwNJABcAIwB2QAseIAwNNBsgDBE0Ibj/4LMMETQTuAMKshwcILgC77QFBQoJI7gC77IAAAq6Au8ACQLrtxwgExMYBQkguP/gthEVNCAgCRi6AwAAAALwsSUJLxD17RE5LysSORkSOS8SOQAYP+08EO0REjkv/TIv7TEwASsrKwEjIicmJwYGIyM1MzI3Njc2NzY3FhcWFScmJyYnBgcGBxYWFwMnaENUYUo6eXScmVtHNy09WVBDRSk3cw0bFyYwIRYeJIM6ASUeIz1HN64uJEFYQToQaVRyRxc6OC8yDCEVMic+B////7oBJQMnA0kAFgPjAAAAAgBF/2wENQR2AAMAJACmuQAG/+CzDRE0F7j/1kAQDhE0GiALETQfIAsRNAACA7gDArIBASBBCgLvACEDCQASABEDBwAYAu8ACAMRsgEDAroDAQAA/8BACwoONAAAFSEhICAcQQoDAwBAAAQC8AAmABIC+wAgABH/wLUJCzQRERW6AwMADAEqhS/9MhkvKxrtGBD1Gv0yLxk5LxgROS8r/Tk5AD/tPzk/7TMv7Tk5MTABKysrKwEHJzcBFAcGISInJjU0Njc2NxcGBhUUFjMyNzY1NCcmJzcWFhUCwUucSAITg43+xshqdCokFjYoRi2xpL2StR4aMFM1KAQkj1aL/K/faXFGTZ9WsFk2cBKQpkV8gUNTlWZYTjrNUaiL//8ARf9sBDUEdgAWA+UAAAAC/7oBJQH0BRYAAwAQAFu3CjQMETQAAgO4AwKyAQELvgLvAAwDBAAGAu8ABQLrsgEDALgDAbcCAgUMDAsLB70DAwAEAvAAEgAFASqFLxD1/TIvGTkvGBE5L+05OQA/7T/tMy/tOTkxMAErAQcnNxMhNSE0JyYnNxYXFhUBpEyiSvT9xgHxHBNLTkgSGwTCkVSR/A+udj4rUaNbM02y////ugElAfQFFgAWA+cAAP//ADYBCgIYA3EAFgMIAAAAAv/3ASUDAASpAB4AJwBuQAwEAwEfIyAFJggVFQ64AwqyICAmuALvsggIHrsC7wBAAAEC67cbAA4gHwUEEbgC/rcgDxUBFRUjAL0C8AApACMDEwALAROFL+0Q5RkROS9dGv0XORI5ABg/Gv0yL/0yL/0yLxESORE5OTEwAV0BIyInJicGBiMiJjU0NjcmJjU0NzY3FhYXFxYXFjMzAScGBgcWFjMyAwCPSDcpGR5cM3OZ4KgCDRcTHwoVDh4ZFB8hj/6jE1dkIhU4MTwBJXtckTg+HxhW0U4IRAgiKiIkPnQ+rI5EaAERbR9DNwkKAAP/ugEAAxQEcAAoADUAQwCnQA86IA8RNDotPRIyDh0dLSO4/8C3DxE0IyMtLTK4Au+0CAgODUG+Au8ABALrAA4C7wANAutAFD06CDIpHR8jEiAJDjQSMBYjIykWuAMAszAwDSm4Av1ACTpACQw0OjoNNrgDALMAAEUNuAEfhS8RMy/tETkvK+0ROS/tGRI5LxESOSsROTkROTkSOQAYP+0/7RESOS/9Mi8zLysSOS8REjk5ETkrMTABFAcGIyInJicGBwYjIzUzMjY3JicmNTQ2Nzc2NjcmNTQ3NjcWFxYXFiU0JyYjIgYVFBc2NzYXNCcmJxQGBxYXFjMyNgMUJCcnKXBnR3Q1Q1taWilMQRoaHAMMYxQhHUUsDx9AYXtHXv6gEhUuLlB6KxUZ8TgjMyklPD0yFQwQAc46R000MC5CExiuDRETFBkYERAWrSMbCC8UFFMcNz10knOYhSsZHj0rKUMcGh7HI0ovNTFVFx8eFhIAAAP/uv+CAycDbwAfACkANACKtSYiLhAPF7gC77MiIhAJuALvszIyDx+4Au+yAAAQugLvAA8C60AKASouHiAmDi4NJrgDA7IRES64AwO0DQ0qDyC4Av2yGhoFuAL9syoqDwC7AvAANgAPARuFLxDkETkv7Tkv7RESOS/tMy/tERI5ERI5ERI5AD/tPBDtETMv7REzL+0REjkROTEwASEWFxYVFAcGIyInJjU3IzUzNjc2NzYzMhYVFAcGByElNCMiBwYHNjc2EzQnJicUFxYzMjYDJ/6SQC05GB5AeGR4At39Iyo1OkM7Hy8uG4cBuP61KCs8HTVbPkgodF9cNUB/GCMBJR43RVFOLztTZKRIrl1QZUBKbD1YNyFDqV9eLWkZJiz9+E9JPBBuR1YUAAIAMv9jA3UDFAAgACoAdbUQQAsRNAO4/+BADAsSNBJACRE0CxQKHLgC77IlJSG6Au8AFALrsgoKDrwDCgAEAwgAGAL9sygoCiG8AwMAFAMDAAAC8LIsCwq4/8CzCQw0CrgBH4UvKzMQ9e3tETkv7QA//TIZLxg//TIv7RESOTEwASsrKwEUBwYjIicmJyYnNxYWMzI3Njc2NyInJjU0NzYzMhcWFQcmJyYjIgYVFBYDdXqIskJGM1JBQRE4ezF6bVVVK0+HQ0wwOFZXJh4/Fh8bJxwpWAFhpaO2DwsbFxYjDR0+MV0vaisxcGdYZmVPjQVgJSAlHDEzAP//ADL/YwN1AxQAFgPtAAD//wAy/6cE2QOyABYDNQAA//8AJP8fBLUCBQAWAzYAAAADADL+VgTZA7IAOwA/AEMA1bkAJv/WQBAOETQpNA4RNCo0CxE0PD4/uAMCtD09QEJDugMCAEEDBrUDBg4hJyBBCQMHAAYC7wA5AwQAJwLvABb/wLMJCzQWvAMNAA4C7wAwAuuyPT88uAMBtD4+QUNCuAMBs0BAJDO4AwxACQoKLCQDEgAALLgC/bRAEhJFIbsC+wAgACD/wLUJCzQgICS6AwwAGgE5hS/9MhkvKxrtETMYLxrtMy8SORESOS/tETkv/Tk5My/tOTkAP+0/K+0/7T8SORESOT/tOTkzL+05OTEwASsrKwEUBgcmJiMiBwYVFBYzMzIWFhUUBwYhIicmNTQ3Njc2NxcGBhUUFjMyNzY2NTQmIyMiJjU0NzY3NjMyFgEHJzcHByc3BNkMAiNhMldgWCs1UEhFYNvJ/qmyXmYiGi4DPCo/Q6mdeJ+I2hkc6itCNzxVZmdCTP6HTqJLQUyiSgMgIEMOLTRlXTcTEwMQQfuDeEVLl2hyV18GcRFww0t6ejApchsTDD4xQ3N9VGVQ+9+QVo+vkVSRAAADACT+TgS1AgUANgA6AD4A/rWGM5YzAiC4/+BAEwwYNDoQEhU0FBgSFDSWD6cPAga4/8C2CQo0BgYBLLj/wLYuLzQsLAEiuALvQAzvEQERET43OZ86ATq4AxS3ODg7PZ8+AT66AxQAPP/AswkMNDy4AwazGhkZNboC7wABAuuyODo3uAMBtDk5PD49uAMBtzA7ATs7Lx4muAMMsw0NAC+4Awy0QAQEHgC+AvAAQAAaAvsAIAAZ/8C1CQs0GRkeugMMABUBOYUv/TIZLysa7RgQ5BE5LxrtEjkv7RESOS9d/Tk5My/tOTkAP/0yLzk/K+1dOTkzL+1dOTkRMy9d/RE5LysSOS8rMTABXSsrKwBxASMiBhUUMzIWFxYXFhUUBwYhIicmNTQ3NjcXBgcGFRQXFjMyNzY1NCYjJiYjIiY1NDc2NzYzMwEHJzcHByc3BLWvmptdKTBRMBIde4b+y9d/h0AXYigmJTmAetWPbYYeIxtzEj82STxlTFSv/mJdcFpcW3RdASUQGCEECQYJDyW7VV1JTpB0gi+aFEFAbkZ7QD0WGy8REQMHISF8T0AfF/zRVkdeT1ZHXgAAA/+6/3IB9AOmAAwAEAAUAH23BjQMETQRExK4AwK0FBQPDQ64AwK2ABABEBABB74C7wAIAwQAAgLvAAEC67IOEA24AwG0Dw8SFBO4AwG3EREBCAgHBwO9AwMAAALwABYAAQEqhS8Q9P0yLxk5LxgROS/9OTkzL+05OQA/7T/tETMvXe05OTMv/Tk5MTABKwEhNSE0JyYnNxYXFhUDByc3BwcnNwH0/cYB8RwTS05IEhsFTqJLQUyiSgElrnY+K1GjWzNNsv5EkFaPr5FUkf///7r/cgH0A6YAFgPzAAAAAwBAAKIEDgadAEQATgBlATBAE1QIVkoCT2NlQBY/NGVlX2NbV1q4/8C2Fj80WlpTX7gC8bJXV2O4AvFAJ1NTLjw7AAECSx8uNyAMETQVSBcHNwUjDksRjyMBI0AJETQjIy5LArgC77MAAEs/vwLyAC4C8gARAu8AQABLAutAE2VlT1pPWltbHyMqN0gHSxUXEUC4AvtACyA/Pzw8OwECAAA7uAMMsgICB7oDDAAX/8BACQkKNBcXEREqRbgDA0ARC0ANDzQLQAkLNAsLZ0AqASq4ARWFL10RMy8rK+0ROS85Lyv9Mi/tMy8SOREzLzMZLxrtERI5ORE5ORE5OTMYLzMzGS8YLzMZLwAYPxrtPz8SOS/tERI5LytdERI5ERc5KxI5ERI5ETk5ETMv7TMv7RI5LysSORESOS8rEjkxMABdAQcnFxQHBgcWFxYVFAYHBgYjNjU2NzY3JicmJyYnJiMiBwYjIicmJyYmNTQ3NjMyFxYXFhcXFhc2NzY1JzQ2NxcWFxYWAzQmJwYGBzI3NgEGBwYjIicmIyIGByc2NzYzMhcWMzI3BA4wOwIiJVAmDxcEB2rxcgEFE6p1RiAjVB8YIRMNHhALFi8pLSQaCAwdKU5FVUtJZi0vQxkWORcVFwQsGEvwER0edzp2MlX+zhwdKTAyLWMGDBgPCxkLFyYJZDIhNTQFRrQdW4Z+iodGKD9BJTQjGBsTDUxBW5GENzx/KxojDwgsJzkuPSs+IzVORnJldaRKXoeKeLohQmssBisaDiT8KxYvNidmJAcMBSAgERgPIQcHDSQJFCAQFwADAEkA8gTOBp0AFwA+AFUBRLkAFv/gsw8RNBS4/+CzDxE0Fbj/1rMOETQpuP/WswsRNCi4/+BACQsRNFsciSsCIrj/4EAlCQo0KyoJETQqSgkRNClUCRE0KEAJETQ/U1VAFj80VVVPU0tHSrj/wLYWPzRKSkNPuALxskdHU7gC8UAYQ0MHCkAKETQKChIDICAwA0AJGDQDAz4SvgLyADAC7wAzAvIAJwL7siYmProC7wAZAutADVVVP0o/P0pLSwcKAAO4/8CzGCA0A7j/wEANCg80AwMQIDctCzABMLgDELIzMy24AxCyNzcYuALws1cmJhC4AR2FLzMvEPUyL+0zGS8Y7V0REjkZEjkvKyszOTkyGC8zMy8ZLxEzLwAYP+0zL+0/7T8SOS8rETkvERI5Lys5Mi/tMy/tEjkvKxI5ERI5LysSOTEwASsrKysrXQArKysrKwEUBgcmJyYjIgYjIicmJyY1NDMyFxYXFgEjIicmNTQmNQIHBgcGITUkNzY3NjU0Jic3NjcWFxYXFhcWFxYzMwEGBwYjIicmIyIGByc2NzYzMhcWMzI3AzAECDhuekYPHhQbOkksOylImat0jwGePVQzPQdgS1miiv60AQ2E1W6FGRYhFBEaFxAPEw4SJBgYPf0THB0pMDItYwYMGA8LGQsXJglkMiE1NAMwFBwVfYWTNCMsOk5YP1tlh6X9V1tu3xA2B/71Y3QmIBxRO157lMtiqllUMSKQp3OEomN+NiQEoyARGA8hBwcNJAkUIBAXAAADACYAogQOBwoARABOAG4BQLkAUf/gQCwLETRUCFZKAjw7AAECSx8uNyAMETQVSBcHNwUjDksRjyMBI0AJETQjIy5LArgC77QAAD9LLrj/wLYJHTQuLlQ/uALytk9kZlZsVFS4/8C2Ehk0VGxsZrgC9bVeQAkONF68AxUAEQLvAEsC60ALZFZhYWlPT2lUVFq4AwVADkBpaR8jKjdIB0sVFxFAuAL7QAsgPz88PDsBAgAAO7gDDLICAge6AwwAF//AQAkJCjQXFxERKkW4AwNAEQtADQ80C0AJCzQLC3BAKgEquAE7hS9dETMvKyvtETkvOS8r/TIv7TMvEjkRMy8zGS8a7RESOTkROTkROTkzGC8a/TIvETMvEjkvOTkAP+0/K/0yLzMrLxI5ETk5PxEzLysREjkv7RESOS8rXRESOREXOSsSORESORE5OTEwAF0rAQcnFxQHBgcWFxYVFAYHBgYjNjU2NzY3JicmJyYnJiMiBwYjIicmJyYmNTQ3NjMyFxYXFhcXFhc2NzY1JzQ2NxcWFxYWAzQmJwYGBzI3NgEUBwYHBzQ3JicmNTQ3NjMyFhUUBgcmIyIGFRQWMzI2BA4wOwIiJVAmDxcEB2rxcgEFE6p1RiAjVB8YIRMNHhALFi8pLSQaCAwdKU5FVUtJZi0vQxkWORcVFwQsGEvwER0edzp2MlX+NB8VKrpkHxAVNTstFB0MCx8kFitdIRYTBUa0HVuGfoqHRig/QSU0IxgbEw1MQVuRhDc8fysaIw8ILCc5Lj0rPiM1TkZyZXWkSl6Hini6IUJrLAYrGg4k/CsWLzYnZiQHDAUQGRQND0AuIxAPExUfOD4bFg4dEhwSDA80AwAAAwA5APIEzgcKABcAPgBeAU65AEH/4LMLETQpuP/WswsRNCi4/+BAEgsRNIUUhhWGFscUBFsciSsCIrj/4EAvCQo0KyoJETQqSgkRNClUCRE0KEAJETQHIAoBCkAKETQKCgNACRg0AwMSPiAgPjC8Au8AMwLyACcC+7ImJj68Au8AGQLrABL/wLMXHTQSuP/AQA0JETQSEkRUP1ZGXEREuP/AthIZNERcXFa4AvW1TkAJDjROuAMVQAtURlFRWT8/WURESrgDBbVZWQcKAAO4/8CzGCA0A7j/wEANCg80AwMQIDctCzABMLgDELIzMy24AxCyNzcYuALws2AmJhC4ATuFLzMvEPUyL+0zGS8Y7V0REjkZEjkvKyszOTkyGC/9Mi8RMy8SOS85OQA/K/0yLzMrLxI5ETk5ETMvKys/7TMv7T/tETkvERI5Lys5LytdOTEwASsrKysrXQBdKysrARQGByYnJiMiBiMiJyYnJjU0MzIXFhcWASMiJyY1NCY1AgcGBwYhNSQ3Njc2NTQmJzc2NxYXFhcWFxYXFjMzARQHBgcHNDcmJyY1NDc2MzIWFRQGByYjIgYVFBYzMjYDMAQIOG56Rg8eFBs6SSw7KUiZq3SPAZ49VDM9B2BLWaKK/rQBDYTVboUZFiEUERoXEA8TDhIkGBg9/IMfFSq6ZB8QFTU7LRQdDAsfJBYrXSEWEwMwFBwVfYWTNCMsOk5YP1tlh6X9V1tu3xA2B/71Y3QmIBxRO157lMtiqllUMSKQp3OEomN+NiQEkxkUDQ9ALiMQDxMVHzg+GxYOHRIcEgwPNAMAAwBT/x0EDgXLAEQATgBuAUC5AFH/4EAPCxE0VAhWSgJkT2ZWbFReuAL1QA9mZmxAEhk0bGxAVJBUAlS4/8BAKgsXNFRUETw7AAECSx8uNyAMETQVSBcHNwUjDksRjyMBI0AJETQjIy5LArgC77MAAEs/vgLyAC4C8gARAu8ASwLrQAtkVmFhaU9PaVRUWrgDBUAPQGlpER8jKjdIB0sVFxFAuAL7QAsgPz88PDsBAgAAO7gDDLICAge6AwwAF//AQAkJCjQXFxERKkW4AwNAEQtADQ80C0AJCzQLC3BAKgEquAE7hS9dETMvKyvtETkvOS8r/TIv7TMvEjkRMy8zGS8a7RESOTkROTkROTkRMxgvGv0yLxEzLxI5Lzk5AD/tPz8SOS/tERI5LytdERI5ERc5KxI5ERI5ETk5ETMvK10zLyszL+0REjkROTkxMABdKwEHJxcUBwYHFhcWFRQGBwYGIzY1Njc2NyYnJicmJyYjIgcGIyInJicmJjU0NzYzMhcWFxYXFxYXNjc2NSc0NjcXFhcWFgM0JicGBgcyNzYDFAcGBwc0NyYnJjU0NzYzMhYVFAYHJiMiBhUUFjMyNgQOMDsCIiVQJg8XBAdq8XIBBROqdUYgI1QfGCETDR4QCxYvKS0kGggMHSlORVVLSWYtL0MZFjkXFRcELBhL8BEdHnc6djJVmx8VKrpkHxAVNTstFB0MCx8kFitdIRYTBUa0HVuGfoqHRig/QSU0IxgbEw1MQVuRhDc8fysaIw8ILCc5Lj0rPiM1TkZyZXWkSl6Hini6IUJrLAYrGg4k/CsWLzYnZiQHDP5QGRQND0AuIxAPExUfOD4bFg4dEhwSDA80AwADAEr/HQTOBd4AFwA+AF4BW7kAQf/gswsRNBa4/+CzDxE0FLj/4LMPETQVuP/Wsw4RNCm4/9azCxE0KLj/4EAJCxE0WxyJKwIiuP/gQB4JCjQrKgkRNCpKCRE0KVQJETQoQAkRNFQ/VkZcRE64AvVAClZWXEASGTRcXES4/8CzEhM0RLj/wEAcCQ80REQmBwpAChE0CgoSAyAgMANACRg0AwM+Er4C8gAwAu8AMwLyACcC+7ImJj66Au8AGQLrQAtURlFRWT8/WURESrgDBbdZWS0mBwoAA7j/wLMYIDQDuP/AQA0KDzQDAxAgNy0LMAEwuAMQsjMzLbgDELI3Nxi4AvCzYCYmELgBO4UvMy8Q9TIv7TMZLxjtXRESORkSOS8rKzM5ORgREjkv/TIvETMvEjkvOTkAP+0zL+0/7T8SOS8rETkvERI5Lys5ETMvKyszLyszL+0REjkROTkxMAErKysrK10AKysrKysrARQGByYnJiMiBiMiJyYnJjU0MzIXFhcWASMiJyY1NCY1AgcGBwYhNSQ3Njc2NTQmJzc2NxYXFhcWFxYXFjMzARQHBgcHNDcmJyY1NDc2MzIWFRQGByYjIgYVFBYzMjYDMAQIOG56Rg8eFBs6SSw7KUiZq3SPAZ49VDM9B2BLWaKK/rQBDYTVboUZFiEUERoXEA8TDhIkGBg9/QsfFSq6ZB8QFTU7LRQdDAsfJBYrXSEWEwMwFBwVfYWTNCMsOk5YP1tlh6X9V1tu3xA2B/71Y3QmIBxRO157lMtiqllUMSKQp3OEomN+NiT90xkUDQ9ALiMQDxMVHzg+GxYOHRIcEgwPNAMAAAIAUwCiBA4FywBEAE4A4EApVAhWSgI8OwABAksfLjcgDBE0FUgXBzcFIw5LEY8jASNACRE0IyMuSwK4Au+zAABLP78C8gAuAvIAEQLvAEAASwLrQAsfIyo3SAdLFRcRQLgC+0ALID8/PDw7AQIAADu4AwyyAgIHugMMABf/wEAJCQo0FxcRESpFuAMDQBELQA0PNAtACQs0CwtQQCoBKrgBFYUvXREzLysr7RE5LzkvK/0yL+0zLxI5ETMvMxkvGu0REjk5ETk5ETk5ABg/Gu0/PxI5L+0REjkvK10REjkRFzkrEjkREjkROTkxMABdAQcnFxQHBgcWFxYVFAYHBgYjNjU2NzY3JicmJyYnJiMiBwYjIicmJyYmNTQ3NjMyFxYXFhcXFhc2NzY1JzQ2NxcWFxYWAzQmJwYGBzI3NgQOMDsCIiVQJg8XBAdq8XIBBROqdUYgI1QfGCETDR4QCxYvKS0kGggMHSlORVVLSWYtL0MZFjkXFRcELBhL8BEdHnc6djJVBUa0HVuGfoqHRig/QSU0IxgbEw1MQVuRhDc8fysaIw8ILCc5Lj0rPiM1TkZyZXWkSl6Hini6IUJrLAYrGg4k/CsWLzYnZiQHDAAAAgBKAPIEzgXeABcAPgD1uQAW/+CzDxE0FLj/4LMPETQVuP/Wsw4RNCm4/9azCxE0KLj/4EAJCxE0WxyJKwIiuP/gQC0JCjQrKgkRNCpKCRE0KVQJETQoQAkRNAcKQAoRNAoKEgMgIDADQAkYNAMDPhK+AvIAMALvADMC8gAnAvuyJiY+ugLvABkC67MHCgADuP/AsxggNAO4/8BADQoPNAMDECA3LQswATC4AxCyMzMtuAMQsjc3GLgC8LNAJiYQuAEdhS8zLxD1Mi/tMxkvGO1dERI5GRI5LysrMzk5ABg/7TMv7T/tPxI5LysROS8REjkvKzkxMAErKysrK10AKysrKysBFAYHJicmIyIGIyInJicmNTQzMhcWFxYBIyInJjU0JjUCBwYHBiE1JDc2NzY1NCYnNzY3FhcWFxYXFhcWMzMDMAQIOG56Rg8eFBs6SSw7KUiZq3SPAZ49VDM9B2BLWaKK/rQBDYTVboUZFiEUERoXEA8TDhIkGBg9AzAUHBV9hZM0Iyw6Tlg/W2WHpf1XW27fEDYH/vVjdCYgHFE7XnuUy2KqWVQxIpCnc4SiY342JAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAD//wBGBWIBnAYxABYC9AAA//8ARgTXAZwGPQAWAvEAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAP//AEYE1wFRBg0AFgL4AAD//wBGBNcBsQYZABYC9wAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAAAAIBAAAABQAFAAADAAcAACERIRElIREhAQAEAPwgA8D8QAUA+wAgBMAA//8ASATXAa0GigAWAvUAAP//AEYE1wHlBloAFgLyAAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAD//wBGBNcBsQa5ABYDSQAA//8ARgTXAbEHVwAWAxIAAP//AEYE1wGxBtMAFgNLAAD//wBGBNcBsQc9ABYDSAAA//8AQATZAbEHLgAWA0oAAP//ADAE1wHPB3cAFgNHAAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAD//wBG/9UBnACkABYC9gAA//8ARv72AZwAWwAWAvMAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAQAAAAUABQAAAwAHAAAhESERJSERIQEABAD8IAPA/EAFAPsAIATAAAACAMoBGAHJBbcAEgAeAD65ABAC8rcHQAkKNAcHHLwC7gAWAuwABgLxtAcHExkAuALtsg0NE7kC7QAZL+0zL+0REjkv7QA//TIvKz8xMAEUBwYHBhUjNCcmJyY1NDYzMhYDFAYjIiY1NDYzMhYByRorBRo5GQolGkY3OUkGSDQySEg0MkgFHUN2wxySiH6ZOrZ+LT1dXPw3MkhIMjNKSgAAAQDHARgBzwIiAAsAFr4ACQLuAAMC7AAAAu0ABi/tAD/tMTABFAYjIiY1NDYzMhYBz083NkxNNThOAZ02T043Nk9OAAACAMYBGAHNBFcACwAXACq5AAkC7rIDAxW8Au4ADwLsAAAC7bIGBgy5Au0AEi/tMy/tAD/9Mi/tMTABFAYjIiY1NDYzMhYRFAYjIiY1NDYzMhYBzU44NUxKNzhOTzc1TEs2OE4D0jhOTjg3Tk79lDZPTjc2T04AAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAgEAAAAFAAUAAAMABwAAIREhESUhESEBAAQA/CADwPxABQD7ACAEwAAAAf+6ASUBAAHTAAMAGL0AAgLvAAEC6wAAAvCxBQEvEOUAP+0xMAEhNSEBAP66AUYBJa4AAAH/ugElCAAB0wADABi9AAIC7wABAusAAALwsQUBLxDlAD/tMTABITUhCAD3ughGASWuAAAB/7oBJRAAAdMAAwAYvQACAu8AAQLrAAAC8LEFAS8Q5QA/7TEwASE1IRAA77oQRgElrgAAAgBj/+cGrAXUAA8ALAEBtRsQDQ40J7j/4EATEBE0JyAJCjQKIAkONAYgCQ40Arj/4LMJDjQOuP/gQEYJDjQoEBcXDAQQHhEDDB4lAwQeHQkXKBkILCwSJhEaEBACVREjCwsGVREcDAwGVREWDQ0GVREMDw8GVRE4EBAGVRERCCYZuP/mtBAQAlUZuP/gtA0NAlUZuP/etAwMAlUZuP/gtAsLBlUZuP/ktAwMBlUZuP/otA0NBlUZuP/StBAQBlUZuP/AQBULDTQAGQEZACYhCAsLBlUgIQEhYy0Q9l0r7S9dKysrKysrKyvtMy8rKysrKyvtOS8REjk5AD/tP+0/7RESOS8SOTEwASsrKysrKysBEBcWMzI3NhEQJyYjIgcGJTUzFRQHBgcWFRQCBCMiJAI1EDc2ITIEFzY3NicBK4+K2+CJje11kd+DlQTAwSY0jxq1/re/zv65qMS/ATvjAV9JWyUeAQLH/vyemJqgARUBcpZJjaD50aV8QltMbHng/qG1xwFbwQFo1M730DE4LVYAAgBE/+gFAARAAA8ALAETQA5ZJwEGIAwONAogDA40Arj/4LMMDjQOuP/gQDQMDjQpEBcXDAQQHBEHDBwlBwQcHQsXKBkILCwSJhEgEBAGVREwDw8GVRESCw0GVRERCCQZuP/mQBEPDwJVGRgNDQJVGRALCwJVGbj/8bQQEAZVGbj/07QPDwZVGbj/1rQNDQZVGbj/+EAwCwwGVQAZIBkCGQAkAEAkJTQhDA4PAlUhEg0NAlUhDAwMAlUhHAsLAlUhCBAQBlUhuP/8QB4PDwZVIQgNDQZVIRYMDAZVIQ4LCwZVHyE/IQIhMS0Q9l0rKysrKysrKysr7S9dKysrKysrK+0zLysrK+05LxESOTkAP+0/7T/tERI5LxI5MTABKysrK10TFBcWMzI3NjU0JyYjIgcGJTUzFRQHBgcUFRAHBiMiJyYREDc2MzIXFhc2Nif9WVSMjFNZWlSKjVNZA0LBJjGC8HaL5IWJpInF24tpGkQ7AQITxWxmZm3Kv2tmZWyX0aV8QlZIDg/+jIVBj5QBCAEnjnaPbawqWlUAAAEAof/nBoIFugAlASW1DzQMDjQMuP/gQBMMDjQmGAEhBwcaABwBAh8CEwIauAK7QDYOCSUlAg4JDQJVAiYBEgoKAlUBRAsLBlUBCAwMBlUBHg0NBlUBRA8PBlUBRBAQBlUBAR4mIAi4/+y0Dw8CVQi4/+5ACw0NAlUIEAwMAlUIuP/FQAsLCwZVCBwMDAZVCLj/8bQNDQZVCLj/07QPDwZVCLj/00AOEBAGVQgVJhIgEBACVRK4//a0Dw8CVRK4//a0DQ0CVRK4//q0DAwCVRK4//q0DAwGVRK4//a0DQ0GVRK4//G0Dw8GVRK4//i0EBAGVRK4/8C1ExU0El0mEPYrKysrKysrKyvtLysrKysrKysrPO0zLysrKysrK+0rOS8AP+0/Pz/tETkvOTEwAV0rKwE1MxUUBwYHERQHBgcGIyADJjURMxEUFxYWMzI3NhERMxE2NzY1BcHBJGPZMjSAg9T+Z3M4wiQirn3bVlvCnEYbBOnRpZ0+rQr+6OF+g1BSARWG6QNP/LK9XVljYWYBDwNO/hMQbCp2AAABAIP/6AUdBCYAJAEctRsQCw00GLj/4EBTEBE0DiAJCjQKExkgBwcZABwBBh4GEwYJChkcDCQkAiYBHgsLBlUBFAwMBlUBLQ0NBlUBDA8PBlUBIBAQBlUBAQgJMx0lHwgsEBACVQgSDg4CVQi4//BACw0NAlUICgwMAlUIuP/0QAsLCwZVCAoMDAZVCLj/4rQNDQZVCLj/3rcQEAZVCBUlErj/+LQQEAJVErj/+EAXDg4CVRIEDAwCVRIKCwsGVRIEDAwGVRK4//y0DQ0GVRK4//K0DxAGVRK4/8BAEjM2NPASAQASIBLQEuASBBJOJRD2XXErKysrKysrK+0vKysrKysrKys8/eQRMy8rKysrK+05LwAv7T8/Pz/tETkvORESOTEwASsrACsBNTMVFAcGBxEjNQYjIiYmJyY1ETMRFBcWMzI2NjURMxE2NzY1BFzBJFy9oXzVXaNQEAu0CyOtU406tH8/HANV0aWdPqAU/g6ctEduTzZyApL9s48vmFSOiAI5/hgWYSp2AAAB/dwGjf9FBysAAwAstwEgDhE0AYACugMXAAACU7cBhkAD0AMCA7kCYAACL+1d/e0AfT8azTEwASsDIyczu4Ln4gaNngAAAfwvBo39mAcrAAMALLcBIA4RNAGAAroDFwAAAlO3AYZAA9ADAgO5AmAAAi/tXf3tAH0/Gs0xMAErASMnM/2YgufiBo2eAAH8pgYL/h4HIwADAFO1ASAOETQBuP/AQB8JCjQBhx8CLwICHwIvAo8CnwIErwK/AgICQAkQNAIAuAJTtwGGQAPQAwIDuAJgtXACsAICAi9d7V397QAvK11xcu0rMTABKwEjAzP+HpHn8QYLARgAAf5UBo3/vQcrAAMAQbkAAv/gsw4RNAG4/+C1DhE0AoAAugMXAAP/9LMJEjQDuAJTtwKGTwDfAAIAuQJgAAEv7V397SsAfT8azTEwASsrATMHI/7b4ueCByueAAAB/NcGjf5ABysAAwA4uQAC/+C1DhE0AoAAugMXAAP/9LMJEjQDuAJTtwKGTwDfAAIAuQJgAAEv7V397SsAfT8azTEwASsBMwcj/V7i54IHK54AAf1zBgv+6wcjAAMAVLOZAgECuP/gsw4RNAK4/8BAHwkKNAKHHwEvAQIfAS8BjwGfAQSvAb8BAgFACRA0AQO4AlO3AoZPAN8AAgC5AmAAAS/tXf3tAC8rXXFy7SsxMAErXQEzAyP9+vHnkQcj/ugAAAH+KQXo/94HLAAVAIu5ABH/wEAJCRg0CgwJBxUSuP/AQA4SGDQSkBQBfxQBkBQBFLj/wLMJDDQUuP/AsxklNBS4/8BACjc5NBRAU1o0FAe6AxYADAMXQAwQyQMDEwkUCgoTVxS4/8BACQsNNAAUcBQCFC9dK+0zLxI5ETMv7QB9PxjtfdQrKysrXXFyGN0rzRE5EjkxMAErADc2NzYnJiMiByc2FxYXFhcWBxUjNf7tEDUBAR0qWx8/Cydpe05WAgS6cAZeBQ0cFxAXBF4IAQEnKkNlFzJwAAH+DQZt/6EHLAAUAIC5ABD/wEAqCSA0Cw0KBxERFEATQHyKNBNAUlU0E0BLTDQTQDw+NBNAJjY0EBMBE4AHvAGPAA0DFwAP/8BADxYYNA/4AwMSChMLCxKQEy/tMy8SOREzL+0rAH0/GO0a3HErKysrKxrNOS8RORI5sQYCQ1RYtBFACRk0ACtZMTABKwA3Njc2JyYjIgYHJzYXBBcWBxUjNf6/EjEBARsnVAg8EgskYgEGBQOsXQamBAsWDQkNBQNBBQEBWj8OFjcAAAH9EQXo/sYHLAAVAIu5ABH/wEAJCRg0CgwJBxUSuP/AQA4SGDQSkBQBfxQBkBQBFLj/wLMJDDQUuP/AsxklNBS4/8BACjc5NBRAU1o0FAe6AxYADAMXQAwQyQMDEwkUCgoTVxS4/8BACQsNNAAUcBQCFC9dK+0zLxI5ETMv7QB9PxjtfdQrKysrXXFyGN0rzRE5EjkxMAErADc2NzYnJiMiByc2FxYXFhcWBxUjNf3VEDUBAR0qWx8/Cydpe05WAgS6cAZeBQ0cFxAXBF4IAQEnKktdFzJwAAH8ZwZt/fsHLAAUAIC5ABD/wEAqCSA0Cw0KBxERFEATQHyKNBNAUlU0E0BLTDQTQDw+NBNAJjY0EBMBE4AHvAGPAA0DFwAP/8BADxYYNA/4AwMSChMLCxKQEy/tMy8SOREzL+0rAH0/GO0a3HErKysrKxrNOS8RORI5sQYCQ1RYtBFACRk0ACtZMTABKwA3Njc2JyYjIgYHJzYXBBcWBxUjNf0ZEjEBARsnVAg8EgskYgEGBQOsXQamBAsWDQkNBQNBBQEBWj8OFjcAAAH9nQZJADsHMAASAF+1DiAJETQLuP/gQDcJEzQCIAkRNAAA7wwBDEUHB+8QARBFAwMfCd8JAo8JAQlACRA0Pwm/CQIJCnYJCQB2QBJvEgISL13tMy/tAC9dK3FyMy/tXTkv7V0yLzEwASsrKwEmNjMyFxYzMjczBiMiJyYjIhf9ngFxWz5rOyM9DIIGvj9nQx9OAgZJZn42HlfkOCRfAAAB+/UGfP6TBysAEgDZs0sOAQu4/+BACwoTNAIgChE0AAAHuAMWQB9ADEBeNQxAT1M0DEBDRTQMQCstNG8MfwwCDwwBDIAQuAMWQGEDAw8J7wkCHwkvCU8JXwmPCZ8JBg8JXwlvCX8JvwnwCQYJQIs1CUBqbDQJQGE1CUBcXTQJQFdZNAlATVE0CUBESTQJQDo1CUAxNDQJQC5CNAlAJyw0CUASJTQJgAoNNAkKuAMWsgkJALkDFgASL+0zL+0AfS8rKysrKysrKysrKysrXXFyMxgv7RrdXXErKysrGu0zLzEwASsrXQEmNjMyFxYzMjczBiMiJyYjIhf79gFxWz5rO0Q9DGEGvj9nQ0NOAgZ8UlssGEasLB1MAAAB/HIGC/8QBvIAEgBztQ4gCRE0C7j/4EAQCRM0AiAJETQAAO8MAQxFB7j/wEA0ISY0BwfvEAEQRQMDHwkvCT8JAy8JjwkCCUAJEDQJQDY+ND8JvwkCCQp2CQkAdkASbxICEi9d7TMv7QAvXSsrcXIzL+1dOS8r7V0yLzEwASsrKwEmNjMyFxYzMjczBiMiJyYjIhf8cwFxWz5rOyM9DIIGvj9nQx9OAgYLZn42HlfkOCRfAAAB/tUF1AEcBmYAEwA9uQAK//CzFh80BLj/8LQWHzQLArj/wEATIyg0AoDwBwEHgBADDIALCwKAAy/tMy/tAD/tcRrdK8AxMAArKwMmJzMWFxYzMjc2NzMGBwYjIicm/B4RThg7QEFDQDsYTx9JTXAjH3YGIx4lHRMUFBIeSCQmBA4AAf7VBdQBOQZPAAYAOUARAAMGDwMBA4ACAwMEAAMBBQa4/8CzFBg0Brj/wLUMETQGAgEvzdYrK80SFzkAPxrNcsASOTEwARMHIzczFyMHg6/Rw9CvBhdDe3sAAf8C/rv/z/+IAAMAKEATADxQAZAB0AEDAAEBAQM8QAABALj/wLMJCjQALytx7QAvcXLtMTADNTMV/s3+u83NAAMAoAD2A4kFugAYACQAKACkQBWPEIAUAokMhhgCBwIuCAEBBBYmLie4/8BAFwkLNCcnDhgMIgsLHJEOQAoMNA4OIpEWuP/AQA4KDDQWFgQCHwALCwoAArj/wEAMChY0AgIEGQclJQQAuAKOQAoFIAoBCgoqJiYZuQKOABIv7TMvETMvXTz9PDMvPBESOS8rERI5LxI5AD8zLyvtMy8r7TkvETk5ETMvK+0REjkvPP08MTAAXV0BIzUzNTMVMxUjESM1BiMiJyY1NDc2MzIXARQWMzI2NTQmIyIGASE1IQKmXl59ZmZ0R4m/VymUSlyCSv57b1tba21fXGgCaP0XAukFDVxRUVz8rV1vu1dy9GAxZ/7igpqTfoyclv1DWwADAGv/xwaWBdMAAwAMADAAsUAVAgMDPwABFAAAASIhIR8bDQ4OEikbuAJhsxoaEh+8AmEAJQEfABICYUAJL+IDAAkFB+gIugKjAAQBH0AWCuICAQECAQ4pFRsaGh0OISkiIg4pDbgCKEAUKx0pJycVKSsrMgMMAAcKDCkHywQv5u05EjkSOREzL/05L+0Q/e0zL+0REjkvORE5Ejk5AD889O30/Tk/PPbt/e0ROS/sORI5LzkREjkvOYcFLit9EMQxMBcBMwEDEQYHNTY3MxEBNxYXFjMyNjU0IyIGIzcWNTQjIgcnNjYzIBUUBxYVFAcGIyDkBE2d+7M2ZnqcaWwCVZIUICs7RlefBykHFpx3ZSmPKX14AROKrU9Ujf73OQYM+fQDFgIqUSB7Mon9Ef3KDzsXHk04bgNuAmhZZhdrU7t4KCqVYUFFAAADABn/xwaMBdMAAwAnAEIA0EAVAgMDPwABFAAAARkYGBYSBAUFCSASuAJhsxERCRa8AmEAHAEfAAkCYUALJuIDAAk0MzMwQUC8AmEAQgEfADACYUAWNuICAQECARggDBIRERQFGCkZGQUpBLgCKEANIhQpHh4MKSIiRAMAQLj/4EASDxE0QC4oQjouKTq/KDMpNCcoL/TtEP3t5BESOSs5OREzL/05L+0Q/e0zL+0REjkvORE5ETk5AD889O397RESOS85Pzz27f3tETkv7DkSOS85ERI5LzmHBS4rfRDEMTAXATMBJTcWFxYzMjY1NCMiBiM3FjU0IyIHJzY2MyAVFAcWFRQHBiMgATY3Njc2NTQjIgYHJzYzMhcWFRQHBgcGByEV5ARNnfuzAqaSFCArO0ZXnwcpBxacd2Upjyl9eAETiq1PVI3+9/vGDvCQGyWKQ0AVlzj6kE5GOyqjUCYBgjkGDPn04A87Fx5NOG4DbgJoWWYXa1O7eCgqlWFBRQMMgq9oHikrbjBCENg7NlpVSjV2Oid5AAAB/rYEqgAuBcIAAwBCs5kBAQK4/+CzDhE0Arj/wEAPCQo0AoePAQEBQAkQNAEDuAJTtwKGTwDfAAIAuQJgAAEv7V397QAvK3HtKzEwAStdAzMDI8Px55EFwv7oAAH9cwSq/usFwgADAEKzmQEBArj/4LMOETQCuP/AQA8JCjQCh48BAQFACRA0AQO4AlO3AoZPAN8AAgC5AmAAAS/tXf3tAC8rce0rMTABK10BMwMj/frx55EFwv7oAAAB/ggEqv+ABcIAAwBBtQEgDhE0Abj/wEAPCQo0AYePAgECQAkQNAIAuAJTtwGGQAPQAwIDuAJgtXACsAICAi9d7V307QAvK3HtKzEwASsDIwMzgJHn8QSqARgAAAH8pgSq/h4FwgADAEG1ASAOETQBuP/AQA8JCjQBh48CAQJACRA0AgC4AlO3AYZAA9ADAgO4AmC1cAKwAgICL13tXfTtAC8rce0rMTABKwEjAzP+HpHn8QSqARgAAf5TBKoACAYNABUAaLkAEf/AtwkXNAoMCRUHuAMWswwVNBK4/8C0CRo0EhS4AsNADBDJAwMTCRQKChNXFLj/wEAJCw00ABRwFAIUL10r7TMvEjkRMy/tAD/dK/3U7RE5ETmxBgJDVFi0EkAJDTQAK1kxMAErAjc2NzYnJiMiByc2FxYXFhcWBxUjNekQNQEBHSpbHz8LJ2l7TlYCBLpwBSgFEiYXEBcEZggBAScqS3wXMngAAf0RBKr+xgYNABUAaLkAEf/AtwkXNAoMCRUHuAMWswwVNBK4/8C0CRo0EhS4AsNADBDJAwMTCRQKChNXFLj/wEAJCw00ABRwFAIUL10r7TMvEjkRMy/tAD/dK/3U7RE5ETmxBgJDVFi0EkAJDTQAK1kxMAErADc2NzYnJiMiByc2FxYXFhcWBxUjNf3VEDUBAR0qWx8/Cydpe05WAgS6cAUoBRImFxAXBGYIAQEnKkt8FzJ4AAAB+8gGSf5mBzAAEgBrtQ4gCRE0C7j/4EBBCRM0AiAJETQAAO8MAQxFBwfvEAEQRQMDHwnfCQJPCQEJQAkQND8JTwm/CQMJCnYJCQB2gBIBQBLQEuASA1ASARIvXV1x7TMv7QAvXStxcjMv/V05L/1dMi8xMAErKysBJjYzMhcWMzI3MwYjIicmIyIX+8kBcVs+azsjPQyCBr4/Z0MfTgIGSWZ+Nh5X5DgkXwAAAfr0Bkn9kgcwABIAa7UOIAkRNAu4/+BAQQkTNAIgCRE0AADvDAEMRQcH7xABEEUDAx8J3wkCTwkBCUAJEDQ/CU8JvwkDCQp2CQkAdoASAUAS0BLgEgNQEgESL11dce0zL+0AL10rcXIzL/1dOS/9XTIvMTABKysrASY2MzIXFjMyNzMGIyInJiMiF/r1AXFbPms7Iz0Mgga+P2dDH04CBklmfjYeV+Q4JF8AAAH6rwZJ/U0HMAASAGu1DiAJETQLuP/gQEEJEzQCIAkRNAAA7wwBDEUHB+8QARBFAwMfCd8JAk8JAQlACRA0PwlPCb8JAwkKdgkJAHaAEgFAEtAS4BIDUBIBEi9dXXHtMy/tAC9dK3FyMy/9XTkv/V0yLzEwASsrKwEmNjMyFxYzMjczBiMiJyYjIhf6sAFxWz5rOyM9DIIGvj9nQx9OAgZJZn42HlfkOCRfAAAB/HIEw/8QBaoAFwBpuQAO/+BAMgkRNBEgCRE0AiAJETQAAO8PAQ9FCAjvEwETRQQE3wsBDwt/CwILQAkONAsMdgsLAHYXuP/AsxMXNBe4/8C2DQ40bxcBFy9dKyvtMy/tAC8rXXIzL/1dOS/9XTIvMTABKysrASY3NjMyFxYzMjY3MwYGIyInJiMiBwYX/HMBOjlZPms7IyAiB4IDbVQ/Z0MfIhUWAQTDaD4+Nh4jNHJyOCQYGC8AAfuqBMP+SAWqABcAabkADv/gQDIJETQRIAkRNAIgCRE0AADvDwEPRQgI7xMBE0UEBN8LAQ8LfwsCC0AJDjQLDHYLCwB2F7j/wLMTFzQXuP/Atg0ONG8XARcvXSsr7TMv7QAvK11yMy/9XTkv/V0yLzEwASsrKwEmNzYzMhcWMzI2NzMGBiMiJyYjIgcGF/urATo5WT5rOyMgIgeCA21UP2dDHyIVFgEEw2g+PjYeIzRycjgkGBgvAAH7agTD/ggFqgAXAGm5AA7/4EAyCRE0ESAJETQCIAkRNAAA7w8BD0UICO8TARNFBATfCwEPC38LAgtACQ40Cwx2CwsAdhe4/8CzExc0F7j/wLYNDjRvFwEXL10rK+0zL+0ALytdcjMv/V05L/1dMi8xMAErKysBJjc2MzIXFjMyNjczBgYjIicmIyIHBhf7awE6OVk+azsjICIHggNtVD9nQx8iFRYBBMNoPj42HiM0cnI4JBgYL////PH+u/2+/4gCFwR9/e8AAP///H3+u/1K/4gCFwR9/XsAAP//+93+u/yq/4gCFwR9/NsAAP///MH+u/2O/4gCFwR9/b8AAP//+5j+u/xl/4gCFwR9/JYAAAAB/eoGC/9iByMAAwBTtQEgDhE0Abj/wEAfCQo0AYcfAi8CAh8CLwKPAp8CBK8CvwICAkAJEDQCALgCU7cBhkAD0AMCA7gCYLVwArACAgIvXe1d/e0ALytdcXLtKzEwASsDIwMznpHn8QYLARgAAAH+hAYL//wHIwADAFSzmQEBArj/4LMOETQCuP/AQB8JCjQChx8BLwECHwEvAY8BnwEErwG/AQIBQAkQNAEDuAJTtwKGTwDfAAIAuQJgAAEv7V397QAvK11xcu0rMTABK10DMwMj9fHnkQcj/ugAAf3CBMMAYAWqABcAabkADv/gQDIJETQRIAkRNAIgCRE0AADvDwEPRQgI7xMBE0UEBN8LAQ8LfwsCC0AJDjQLDHYLCwB2F7j/wLMTFzQXuP/Atg0ONG8XARcvXSsr7TMv7QAvK11yMy/9XTkv/V0yLzEwASsrKwEmNzYzMhcWMzI2NzMGBiMiJyYjIgcGF/3DATo5WT5rOyMgIgeCA21UP2dDHyIVFgEEw2g+PjYeIzRycjgkGBgv///88f67/b7/iAIXBH397wAA///9X/67/iz/iAIXBH3+XQAA///+dv67/0P/iAIXBH3/dAAA///+vP67/4n/iAIWBH26AP///Ov+u/24/4gCFwR9/ekAAP///Wz+u/45/4gCFwR9/moAAP///Vj+u/4l/4gCFwR9/lYAAP///JD+u/1d/4gCFwR9/Y4AAP///RX+u/3i/4gCFwR9/hMAAP///Cz+u/z5/4gCFwR9/SoAAAAB/BMGfP6wBysAEgBus0sOAQu4/+BACwoTNAIgChE0AAAHuAMWQB9ADEBeNQxAT1M0DEBDRTQMQCstNG8MfwwCDwwBDIAQuAMWsgMDCboDFwAKAxayCQkAuQMWABIv7TMv7QB9PzMYL+0a3V1xKysrKxrtMy8xMAErK10BNDYzMhcWMzI3MwYjIicmIyIX/BNwWz5rO0Q9DGEGvj9nQ0BRAgZ8UlssGEasLB1MAAAB/BIGSf6wBzAAEgBrtQ4gCRE0C7j/4EBBCRM0AiAJETQAAO8MAQxFBwfvEAEQRQMDHwnfCQJPCQEJQAkQND8JTwm/CQMJCnYJCQB2gBIBQBLQEuASA1ASARIvXV1x7TMv7QAvXStxcjMv/V05L/1dMi8xMAErKysBJjYzMhcWMzI3MwYjIicmIyIX/BMBcVs+azsjPQyCBr4/Z0MfTgIGSWZ+Nh5X5DgkXwAAAfuWBnz+NAcrABIAbrNLDgELuP/gQAsKEzQCIAoRNAAAB7gDFkAfQAxAXjUMQE9TNAxAQ0U0DEArLTRvDH8MAg8MAQyAELgDFrIDAwm6AxcACgMWsgkJALkDFgASL+0zL+0AfT8zGC/tGt1dcSsrKysa7TMvMTABKytdASY2MzIXFjMyNzMGIyInJiMiF/uXAXFbPms7RD0MYQa+P2dDQ04CBnxSWywYRqwsHUwAAfuWBkn+NAcwABIAa7UOIAkRNAu4/+BAQQkTNAIgCRE0AADvDAEMRQcH7xABEEUDAx8J3wkCTwkBCUAJEDQ/CU8JvwkDCQp2CQkAdoASAUAS0BLgEgNQEgESL11dce0zL+0AL10rcXIzL/1dOS/9XTIvMTABKysrASY2MzIXFjMyNzMGIyInJiMiF/uXAXFbPms7Iz0Mgga+P2dDH04CBklmfjYeV+Q4JF8AAAEAiAAAATwEJgADAH9AQE8FkAWgBbAFwAXfBfAFBwAFHwVwBYAFnwWwBcAF3wXgBf8FCh8FAQEGAAoDJQUgCwsCVQAGDAwCVQAKCwsCVQC4/+xACwoKAlUAFAsLBlUAuP/8tAwNBlUAuP/uQAwQEAZVAAAgAOAAAwAvXSsrKysrKyvtAD8/MTABXXJxMxEzEYi0BCb72gD////9/rsFWQW6AiYAJAAAAQcEfQM0AAAAILECELj/wLM1PDQQuP/AshIXNLj/7LQQEQcEQQErKys1//8ASv67BBwEPgImAEQAAAEHBH0CyAAAABBACgIfOQEAOTovN0EBK101/////QAABVkHLAImACQAAAEHBHQDrAAAABBACgJ/IwEAIyIBAkEBK101//8ASv/oBBwGDQImAEQAAAEHBIUDNAAAADqxAky4/8C0EhIGVUy4/8BAGw4QBlWQTAFwTIBMAlBMYEygTLBM4EzwTAZMHLj/yrFIKwErXXFyKys1/////QAABVkHKwImACQAAAAnBHwCjQAZAQcEcQPfAAAAMLcD0BkBABkBGbj/wEAWHyo0GRIASCsCABEUAQJBAhFAGSg0EQAvKzUBKzUrK11xNf//AEr/6AQcByMCJgBEAAAAJwDWAN4AAAEHBJMDSwAAAFq0A19CAUK4/8BAPRcZNEI7AEgrAp86ASA6MDpwOoA6BJA6oDqwOuA68DoFOkAuMjQAOj0cHEECHz4vPgLwPgFfPgE+QAkMND4ALytdcXI1ASsrXXFyNSsrXTX////9AAAFWQcrAiYAJAAAACcEfAKNABkBBwRuA7EAAAAnQBoD3xYBDxYBFhMASCsCABEUAQJBAhFAGSg0EQAvKzUBKzUrXXE1AP//AEr/6AQcByMCJgBEAAAAJwDWAN4AAAEHBJIDLQAAAFlARQM/QCYzND9AFx40PzwASCsCnzoBIDowOnA6gDoEkDqgOrA64DrwOgU6QC4yNAA6PRwcQQIfPi8+AvA+AV8+AT5ACQw0PgAvK11xcjUBKytdcXI1KysrNQD////9AAAFWQcsAiYAJAAAACcEfAKNABkBBwR1A9QAAAAxsQMpuP/AQB0dHzSwKQEAKQEAKSgSE0ECABEUAQJBAhBAGSg0EAAvKzUBKzUrXXErNQD//wBK/+gEHAcsAiYARAAAACcA1gDeAAABBwR0A0gAAABiQAoDgFMBT1N/UwJTuP/AQD4SGzQAU1I7PEECnzoBIDowOnA6gDoEkDqgOrA64DrwOgU6QC4yNAA6PRwcQQIfPi8+AvA+AV8+AT5ACQw0PgAvK11xcjUBKytdcXI1KytdcTX////9AAAFWQcrAiYAJAAAACcEfAKNABkBBwSfBTwAAAAwQCIDFkAdIDQWQBQXNBAWAQAWIAECQQIAERQBAkECEUAZKDQRAC8rNQErNStdKys1//8ASv/oBBwG8gImAEQAAAAnANYA3gAAAQcEegR0AAAAVEBBAwA/Tz8CAD9JOj1BAp86ASA6MDpwOoA6BJA6oDqwOuA68DoFOkAuMjQAOj0cHEECHz4vPgLwPgFfPgE+QAkMND4ALytdcXI1ASsrXXFyNStdNf////3+uwVZBmgCJgAkAAAAJwR8Ao0AGQEHBH0DNAAAADWxAxe4/8CzNTw0F7j/wLISFzS4/+xAExcYBwRBAgARFAECQQIRQAooNBEALys1ASs1KysrNQD//wBK/rsEHAXCAiYARAAAACcA1gDeAAABBwR9AsgAAABDQDADH0ABAEBBLzdBAp86ASA6MDpwOoA6BJA6oDqwOuA68DoFOkAuMjQAOj0cHEECAT65AiIAKQArASsrXXFyNStdNQD////9AAAFWQcrAiYAJAAAACcEewKrAAABBwRxA98AAAA0sQMjuP/As0FCNCO4/8BAGDk1/yMBIxYTSCsCABEbAQJBAiBAGS00IAAvKzUBKzUrcSsrNf//AEr/6AQcByMCJgBEAAAAJwDZAPUAAAEHBJMDSAAAADdADANgSHBIAgBIW0gCSLj/4EAUDxE0SEMYSCsCzzwBPBwDaCsCATy5AiIAKQArAStdNSsrXXE1AP////0AAAVZBysCJgAkAAAAJwR7AqsAAAEHBG4DsQAAAFy2AiBAGS00IAAvKzUBsQYCQ1RYQA4DVCMjFhZBAgAfHwECQSs1KzUbQBsDI0A4OTQjQCkxNCNACRE0QCNvI98j7yMEIwK4//VACUgrAgARGwECQSs1K3ErKys1Wf//AEr/6AQcByMCJgBEAAAAJwDZAPUAAAEHBJIDXAAAACq3Aw9JUEkCSUO4//JADkgrAs88ATwcA2grAgE8uQIiACkAKwErXTUrXTX////9AAAFWQcsAiYAJAAAACcEewKrAAABBwR1A9QAAAA7QAkDsDbANtA2Aza4/8CzKjI0Nrj/wEAXISg0ADY1AQJBAgARGwECQQIgQBktNCAALys1ASs1KysrcjUA//8ASv/oBBwHLAImAEQAAAAnANkA9QAAAQcEdANcAAAAQkAwA1BaYFqQWqBaBABaEFowWnBagFoFAFqAWsBa0FoEAFpZHBxBAs88ATwcA2grAgE8uQIiACkAKwErXTUrXXFyNf////0AAAVZBysCJgAkAAAAJwR7AqsAAAEHBJ8FUAAAACxAHwPPI98j7yMDLyMBACMtAQJBAgARGwECQQIgQBktNCAALys1ASs1K11xNf//AEr/6AQcBvICJgBEAAAAJwDZAPUAAAEHBHoEnAAAACuxA0a4/8BAFQoMNABGUD85QQLPPAE8HANoKwIBPLkCIgApACsBK101Kys1AP////3+uwVZBmYCJgAkAAAAJwR7AqsAAAEHBH0DNAAAADWxAyS4/8CzNTw0JLj/wLISFzS4/+xAEyQlBwRBAgARGwECQQIgQAotNCAALys1ASs1KysrNQD//wBK/rsEHAW4AiYARAAAACcA2QD1AAABBwR9AsgAAAAmQBYDH0cBAEdILzdBAs88ATwcA2grAgE8uQIiACkAKwErXTUrXTX//wCi/rsE6AW6AiYAKAAAAQcEfQNcAAAAEEAKASANAQANDgALQQErXTX//wBL/rsEHgQ+AiYASAAAAQcEfQLaAAAAFLUCUB9gHwK4/9i0HyAEBEEBK101//8AogAABOgHLAImACgAAAEHBHQD1AAAAAu2AQAWHAECQQErNQD//wBL/+gEHgYNAiYASAAAAQcEhQMqAAAAGkATAgAyEDICkDLAMtAyAwAyMQoKQQErXXE1//8AogAABOgHFAImACgAAAEHANcBfAFqABZACgEADBgBAkEBAQy5AiEAKQArASs1//8AS//oBB4FqgImAEgAAAEHANcA8AAAABZACgIAHioKCkECAR65AsMAKQArASs1//8AogAABOgHKwImACgAAAAnBHwCqwAZAQcEcQP9AAAAMLcC0BYBABYBFrj/wEAWHyo0Fg8ASCsBAA4RAQJBAQ5AGSg0DgAvKzUBKzUrK11xNf//AEv/6AQeByMCJgBIAAAAJwDWAN8AAAEHBJMDTAAAAEu0A18oASi4/8BALxcZNCghAEgrAiBAOzUgQC0yNA8gnyACACAjCgpBAh8gLyAC8CABXyABIEAJDDQgAC8rXXFyNQErcisrNSsrXTUA//8AogAABOgHKwImACgAAAAnBHwCqwAZAQcEbgPPAAAANEAlAhNAOjUPEx8TAt8T/xMCDxMBExAASCsBAA4RAQJBAQ5AGSg0DgAvKzUBKzUrXXFyKzX//wBL/+gEHgcjAiYASAAAACcA1gDfAAABBwSSAy4AAABRQD0DJUAREQZVJUAmMzQlQBceNCUiAEgrAiBAOzUgQC0yNA8gnyACACAjCgpBAh8gLyAC8CABXyABIEAJDDQgAC8rXXFyNQErcisrNSsrKys1AP//AKIAAAToBywCJgAoAAAAJwR8AqsAGQEHBHUD6AAAADGxAia4/8BAHRwgNLAmAQAmAQAmJQ8QQQEADhEBAkEBDkAZKDQOAC8rNQErNStdcSs1AP//AEv/6AQeBywCJgBIAAAAJwDWAN8AAAEHBHQDSAAAAFFACQNPOX857zkDObj/wEAwEhs0ADk4ISJBAiBAOzUgQC0yNA8gnyACACAjCgpBAh8gLyAC8CABXyABIEAJDDQgAC8rXXFyNQErcisrNSsrXTUA//8AogAABOgHKwImACgAAAAnBHwCqwAZAQcEnwVQAAAAJEAYArATAQATHQ4RQQEADhEBAkEBDkAZKDQOAC8rNQErNStxNf//AEv/6AQeBvICJgBIAAAAJwDWAN8AAAEHBHoEdAAAAEVAMwMAJU8lAgAlLyAjQQIgQDs1IEAtMjQPIJ8gAgAgIwoKQQIfIC8gAvAgAV8gASBACQw0IAAvK11xcjUBK3IrKzUrXTUA//8Aov67BOgGaAImACgAAAAnBHwCqwAZAQcEfQNcAAAAJEAYAiAUAQAUFQALQQEADhEBAkEBDkAKKDQOAC8rNQErNStdNf//AEv+uwQeBcICJgBIAAAAJwDWAN8AAAEHBH0C2gAAADm1A1AmYCYCuP/YQB0mJwQEQQIgQDs1IEAtMjQPIJ8gAgAgIwoKQQIBJLkCIgApACsBK3IrKzUrXTUA//8AYwAAAhgHLAImACwAAAEHBHQCOgAAABaxAQ64/8BAChAQBlUADhQBAkEBKys1//8AHwAAAdQGDQImBKMAAAEHBIUBzAAAAB+wAQGxBgJDVFi1ABgXAQJBKxu3TxgBGAEiSCsrcVk1AP//ALr+uwGHBboCJgAsAAABBwR9AbgAAAALtgEABQYAA0EBKzUA//8AfP67AUkFugImAEwAAAEHBH0BegAAABZADwIJQG1vNE8JAQAJCgQHQQErcSs1//8AY/67Bd0F1AImADIAAAEHBH0DrAAAAAu2AgAdHgsLQQErNQD//wBE/rsEJwQ+AiYAUgAAAQcEfQLGAAAAC7YCABscCwtBASs1AP//AGP/5wXdBywCJgAyAAABBwR0BDgAAAAYQBECcDABkDCwMMAwAwAwLwMDQQErXXE1//8ARP/oBCcGDQImAFIAAAEHBIUDKgAAABZADwIALhAuApAuAQAuLQQEQQErXXE1//8AY//nBd0HKwImADIAAAAnBHwDHAAZAQcEcQRuAAAAMLcD0CYBACYBJrj/wEAWHyo0Jh8ASCsCAB4hAAdBAh5AGSg0HgAvKzUBKzUrK11xNf//AET/6AQnByMCJgBSAAAAJwDWAOAAAAEHBJMDTQAAAES0A18kASS4/8BAKRcZNCQdAEgrAhxALjI0nxwBABwfAAdBAh8cLxwC8BwBXxwBHEAJDDQcAC8rXXFyNQErcis1KytdNf//AGP/5wXdBysCJgAyAAAAJwR8AxwAGQEHBG4EQAAAADRAJQMjQDo1DyMfIwLfI/8jAg8jASMgAEgrAgAeIQAHQQIeQBkoNB4ALys1ASs1K11xcis1//8ARP/oBCcHIwImAFIAAAAnANYA4AAAAQcEkgMvAAAAQ0AxAyFAJjM0IUAXHjQhHgBIKwIcQC4yNJ8cAQAcHwAHQQIfHC8cAvAcAV8cARxACQw0HAAvK11xcjUBK3IrNSsrKzUA//8AY//nBd0HLAImADIAAAAnBHwDHAAZAQcEdQRgAAAAMbEDNrj/wEAdHCA0sDYBADYBADY1HiFBAgAeIQAHQQIeQBkoNB4ALys1ASs1K11xKzUA//8ARP/oBCcHLAImAFIAAAAnANYA4AAAAQcEdANIAAAATEALA081fzXfNe81BDW4/8BAKhIbNAA1NB0eQQIcQC4yNJ8cAQAcHwAHQQIfHC8cAvAcAV8cARxACQw0HAAvK11xcjUBK3IrNSsrXTX//wBj/+cF3QcrAiYAMgAAACcEfAMcABkBBwSfBcgAAAAgQBUDACMtHiFBAgAeIQAHQQIdQBkoNB0ALys1ASs1KzX//wBE/+gEJwbyAiYAUgAAACcA1gDgAAABBwR6BHQAAAA+QC0DACFPIQIAISscH0ECHEAuMjSfHAEAHB8AB0ECHxwvHALwHAFfHAEcQAkMNBwALytdcXI1AStyKzUrXTX//wBj/rsF3QZoAiYAMgAAACcEfAMcABkBBwR9A6wAAAAgQBUDACQlCwtBAgAeIQAHQQIeQAooNB4ALys1ASs1KzX//wBE/rsEJwXCAiYAUgAAACcA1gDgAAABBwR9AsYAAAApQBkDACIjCwtBAhxALjI0nxwBABwfAAdBAgEguQIiACkAKwErcis1KzUA//8AY//nBqwHLAImBGoAAAEHAI0BxwFqAB9AEQIAMAFvMPAwAjAlGUgrAgEtuQIhACkAKwErXXE1AP//AET/6AUABcICJgRrAAABBwCNAPQAAAAhQBMCADABTzBfMI8wAzAlMUgrAgEtuQIiACkAKwErXXE1AP//AGP/5wasBywCJgRqAAABBwBDAcMBagAgQAkCDy4B/y4BLiW4/+K0SCsCAS25AiEAKQArAStdcTX//wBE/+gFAAXCAiYEawAAAQcAQwDeAAAAIUATAl8uby4CIC4wLgIuJQBIKwIBLbkCIgApACsBK11xNQD//wBj/+cGrAdFAiYEagAAAQcEdAQ4ABkAGkATAlBBAX9BkEGwQcBBBABBQCUlQQErXXE1//8ARP/oBQAGDQImBGsAAAEHBIUDKgAAABhAEQIAQQGQQcBB0EEDAEFAJSVBAStdcTX//wBj/+cGrAb7AiYEagAAAQcA1wHLAVEAFkAKAgAtOSUlQQIBLbkCIQApACsBKzX//wBE/+gFAAWqAiYEawAAAQcA1wDgAAAAFkAKAgAtOSUlQQIBLbkCIgApACsBKzX//wBj/rsGrAXUAiYEagAAAQcEfQOsAAAAEEAKAgAuAQAuLx0dQQErcTX//wBE/rsFAARAAiYEawAAAQcEfQLGAAAAC7YCAC4vHR1BASs1AP//AKH+uwUiBboCJgA4AAABBwR9A3AAAAAQQAoBTxYBABYXEQZBAStxNf//AIP+uwPgBCYCJgBYAAABBwR9AqgAAAAUQA4BUBpgGnAaAwAaGwwVQQErXTX//wCh/+cFIgcsAiYAOAAAAQcEdAPoAAAAEEAKAdAfAQAfJQwAQQErXTX//wCD/+gD4AYNAiYAWAAAAQcEhQMbAAAAMkAcAVAtkC2gLbAtBAAtEC1QLWAtcC2QLaAtsC0ILbj/wEAJFxo0AC0sCxZBASsrXXE1//8Aof/nBoIHLAImBGwAAAEHAI0BiAFqACmxASe4/8BAFDk1cCcBLydfJ48nAycaF0grAQEmuQIhACkAKwErXXIrNQD//wCD/+gFHQXCAiYEbQAAAQcAjQDnAAAAG0AOAU8okCgCKBk8SCsBASW5AiIAKQArAStxNQD//wCh/+cGggcsAiYEbAAAAQcAQwGFAWoAIUASAX8pAW8pAZ8pASkaAEgrAQEnuQIhACkAKwErXXFyNQD//wCD/+gFHQXCAiYEbQAAAQcAQwDeAAAAGUAMAeAmASYZDEgrAQEmuQIiACkAKwErcTUA//8Aof/nBoIHLAImBGwAAAEHBHQD6AAAABRADgEvMIAw0DADADA2FB9BAStdNf//AIP/6AUdBg0CJgRtAAABBwSFAxsAAAAksQE5uP/AQBAWGAZVUDmgOQKQOaA5AjkZuP/nsUgrAStdcSs1//8Aof/nBoIG+wImBGwAAAEHANcBmQFRABZACgEAJjIUH0EBASa5AiEAKQArASs1//8Ag//oBR0FqgImBG0AAAEHANcA5gAAACBAEgHvJQElQFNUNAAlMRMfQQEBJbkCIgApACsBKytxNf//AKH+uwaCBboCJgRsAAABBwR9A3AAAAAQQAoBTycBACcoGg5BAStxNf//AIP+uwUdBCYCJgRtAAABBwR9AqgAAAAUQA4BUCZgJnAmAwAmJxUdQQErXTX//wAG/rsFRgW6AiYAPAAAAQcEfQM0AAAAC7YBAA4PAAxBASs1AP//ACH+UQPuBCYCJgBcAAABBwR9A6wAAAALtgEAHBwSEkEBKzUA//8ABgAABUYHLAImADwAAAEHBHQDtgAAABJADAHQF+AXAgAXHQMJQQErXTX//wAh/lED7gYNAiYAXAAAAQcEhQL4AAAAQbEBL7j/wLQYGAZVL7j/wLQUFQZVL7j/wEAPDxEGVR8vcC8CkC+gLwIvuP/AtCswNC8PuP/JsUgrASsrXXErKys1AP//AAYAAAVGBvsCJgA8AAABBwDXAWgBUQAWQAoBAA0ZAwlBAQENuQIhACkAKwErNf//ACH+UQPuBaoCJgBcAAABBwDXAL4AAAAWQAoBABsnDBJBAQEbuQIiACkAKwErNf////0AAAVZByECNgAkAAABFwDfATYBXwAWQAoCABQRAQJBAgETuQIhACkAKwErNf//AEr/6AQcBcICNgBEAAABFwDfAPUAAAAeQBACYD0B4D0BAD06HBxBAgE8uQLDACkAKwErXXE1////4gAAAlsHIQI2ACwAAAEXAN//ugFfABpADQEgCQEACQYBAkEBAQi5AiEAKQArAStdNf///7AAAAIpBcICNgSjAAABFgDfiAAAFkAKAQAJBgECQQEBCLkCwwApACsBKzX//wBj/+cF3QchAjYAMgAAARcA3wHCAV8AFkAKAgAhHgMDQQIBILkCIQApACsBKzX//wBE/+gEJwXCAjYAUgAAARcA3wDSAAAAFkAKAgAfHAQEQQIBHrkCwwApACsBKzX//wCh/+cFIgchAjYAOAAAARcA3wGQAV8AFkAKAQAaFwsBQQEBGbkCIQApACsBKzX//wCD/+gD4AXCAjYAWAAAARcA3wDcAAAAFkAKAQAeGwoXQQEBHbkCwwApACsBKzX//wCh/+cFIgczAjYAOAAAARcFDALuAAAAGUANAwIBAB4ZCwFBAwIBFwAvNTU1ASs1NTUA//8Ag//oA+AG0QImAFgAAAAnAI4A3AAAAQcA2ADcAXIANEAgAwAhJBkgQQIBcBkBABkfERFBA8AhAQ8hPyECIQECAiC5AiIAKQArL11dNQErXTU1KzX//wCh/+cFIgc0AjYAOAAAARcFDQLuAAAAGUANAwIBAB4ZCwFBAwIBHgAvNTU1ASs1NTUA//8Ag//oA+AHNAImAFgAAAAnAI4A3AAAAQcAjQDnAXIAPbkAA//wQBIhIRsbQQIBcBkBABkfERFBAyG4/8BADQ8RNCFACgw0IQECAhm5AiIAKQArLysrNQErXTU1KzUA//8Aof/nBSIHNAI2ADgAAAEXBQ4C7gAAABlADQMCAQAhFQsBQQMCASEALzU1NQErNTU1AP//AIP/6APgBzQCJgBYAAAAJwCOANwAAAEHAN8A3AFyADZAIgMAJSQZIEECAXAZAQAZHxERQQNgJYAlAiVACww0JQECAhm5AiIAKQArLytdNQErXTU1KzX//wCh/+cFIgc0AjYAOAAAARcFDwLuAAAAGUANAwIBAB4VCwFBAwIBHgAvNTU1ASs1NTUA//8Ag//oA+AHNAImAFgAAAAnAI4A3AAAAQcAQwDNAXIAOkAUAxAhIR4eQQIBcBkBABkfERFBAyK4/8BADQ8RNCJACgw0IgECAhm5AiIAKQArLysrNQErXTU1KzUAA/7+BdgBAgczAAMABwALAGxASwIKCAMHBQgIBEAjJTQEQBUWNAQLDwYBBgACQIiJNAJAT3M0AkA+RTQCQC4zNAJAJCk0LwIBAkAaHjTwAgECQBIUNH8CAQJACQ00AgAvK10rXStxKysrKyvd3l083SsrPAEv3t08EN08MTABITUhESM1MwUjNTMBAv38AgSHh/6Dh4cGvnX+pZOTkwAD/v4F2AECBzQAAwAHAAsAnLMDAQIAuP/AsxUWNAC4/8BAJQwUNAAHBUALFDQ/BQEFAkALHDQCCggIBUAjJTQFQBUWNAUKBwG4/8BAOQoRNAEAQIiJNABAT3M0AEA+RTQAQC46NA8AAQBAJCU0LwABAEAaHjTwAAEAQBIUNH8AAQBACQ00AAAvK10rXStxK3IrKysr3SvWPN0rKzwBL83GK95dK93GKysROTkxMBMHIzcTIzUzBSM1M/3ngofnh4f+g4eHBzSysv6kk5OTAAP+/gXYAQIHNAADAAoADgDlsgkKCLj/wLMwNDQIuP+ctxUWNAgGBQQHuP/AQBwjJTQHQAsWNAcNCwpAMTQ0CmQVFjQKBEAjJTQEuP/AQBQMFjQEAwFADxQ0AUALDjQ/AQEBC7j/wEAZDBY0CwwBQCMlNAFAFRY0AQ4DQCssNAMJBbj/wEA6CRE0BQQIQIiJNAhAT3M0CEA+RTQIQC46NA8IAQhAJCU0LwgBCEAaHjTwCAEIQBIUNH8IAQhACQ00CAAvK10rXStxK3IrKysrPN0rOdYrPN0rKzwBLyveXSsr3dYrK80rKxDd1isrETk5zSsrETkxMAEjNTMnByMnMxc3AyM1MwECh4ceooqclVFPzIeHBdiTybGxYmL+pJMAAAP+/gXYAQIHNAADAAcACwCWQAwFBwQGQAwWNAYKCAS4/8BAHgscNAQDAUALFDQ/AQEBCAkBQCMlNAFAFRY0AQsDBbj/wEA5ChE0BQdAiIk0B0BPczQHQD5FNAdALjo0DwcBB0AkJTQvBwEHQBoeNPAHAQdAEhQ0fwcBB0AJDTQHAC8rXStdK3ErcisrKyvdK9Y83SsrPAEv3l0rzcYrEN3GKxE5OTEwASM1MycjJzMDIzUzAQKHh5aC5+Jgh4cF2JMXsv6kkwAAAf/9AAAEVQW6AA0AWkARAwMFAA8BBSALCQcgEBACVQe4//S0Dw8CVQe4//a0DQ0CVQe4//pAFAwMAlUHXQ4KAh4ECAgHAR4NAgcIAD8/7RE5L8D9wAEQ9isrKyvOwP3AEMAROS8xMAEhESEVIREjESM1MxEhBFX9DgGR/m/CpKQDtAUN/hKE/WUCm4QCmwAAAQAMAAAC6wQmAA0AYkALAwMFAA8CBSULCQe4//i0EBECVQe4//pAGA4OAlUHBAwMAlUHCgsLAlUHTg4KAisECLj/wEANEBMCVQgIBwErDQYHCgA/P+0ROS8rwP3AARD2KysrK87A/cAQwBE5LzEwASERMxUjESMRIzUzESEC6/5R5+e0fHwCYwOR/vWE/f4CAoQBoAAAAQAH/mkHWwW7AEYBE0BfODEBNyRHJAIIFBgUAkUNASkGOQYCJCYmIBkbFBkZGxsZHikREhIgExQUExMUFBYTKQoeEwoFAwMgRUQURUVEQkQIRTEvLyA/PRQ/Pz0/PSs2AiAARSsIIAoMEBACVQq4//i0Dw8CVQq4//60DAwCVQq4//1AMw8PBlUKJi8xJAQsNx42Khk/PRsECx4eHyoUREYsQhYpHhEFAwgLCwoqAkVGHgMTEgEKCAA/zsDA0P3APxI5L8AROTn9OTnAETk5ENTtERc5ENTtEhc5AS8rKysr/cDU3e3EETk5hxArfRDEARESOTmHGBArfRDEARgQ1MYQwBE5OYcQK30QxAEREjk5hxgQK30QxDEwAV1dXV1dASMRIwMmJyYjESMRIgcGBzcGAyMBNjcmJyYnJiYHBzU2MzIXFhcWFxYXETMRMjc2NzY3NjMyFxUiJiMiBwYHBgcGBxYXEzMHW6xF9F0uWnzHYElCagEL9/EBLoqOZDokNj9cV04LZbhdKT5NJESYx5ZGJUw+J12zXxcNMw1nOSAzNiM6ZI2Kw2v+aQGXAY6YLlr9UgKuMi2tAhL+bgHo3ycpVDOInVICAqgCijyStChNAgKC/X5PKrKRO4wCqAJHJoCHM1MrJ9/+xQAAAf/7/tMFUAQmAEIBMUA7ByMBaAYBJCYmDBAQAlUmDA8QBlUmJRcZFBcXGRkXHSkPEBAPDA0GVRAlERIUERESEhQRKQodEQowLy+4//RAFw8QBlUvJTs5FDs7OTs5LDUCJUJBBQMDuP/xQBkMDQZVAyVBPxRBPz8+LEEsCSUKDg8QAlUKuP/2QAsODgJVCggNDQJVCrj/8kA7CwsCVQoJEBAGVQoZORc7BAg1KzAkJi8ELDQqHSseKj9BLBQ+KSsFEg8DAwgLCwoqBhEQCkJBKwMBCgoAP87Q/cAQ0MA/EjkvwBEXOf05OcARORDQ7RDQERc57REXOQEvKysrKyv9wNQROTmHKyt9EMQBGBDd7cYROTmHECsrfRDEARgQ1MYQwBE5OYcQKyt9EMQBERI5OYcYECsrK30QxDEwAV1dASMRIwMmJyYjESMRIgcGBwMjEzY3JicmJyYmIyIHNTMyFxYXFhcWFxYzETMRMjc2Ejc2MzMVJyYHBgcGBwYHFhcXMwVQlCLBMCI1SbhKNCAxwcbFb3ZaLRE4FDA4DSgZaik5LhMpORExY7hkMBJxJTp2QjFMHgsnJRsmTnVvbUn+0wEtAUlRIDH+FQHrMB9T/rcBSbkfKUwcjzMeAZUMEUsgYogXQgHL/jVBGAEOJz2VAQIpDmNfJDIkH7m1AAEAof5pBKIFuwAnAPtADxclAYkUAQgTAYkGAQUDA7j/9EAvCwsGVQMMDhAGVQMgJiQUJiYkZyQBJiQjAwgnEhAQICAeFCAgHjceASAeDRgCICe4//ZACgsLAlUnKQ0IIAq4/+a0EBACVQq4//a0Dw8CVQq4//a0DQ0CVQq4//q0DAwCVQq4//i0DAwGVQq4//C0DQ0GVQq4//RAIw8PBlUKXSggHggbHhASDRUMJCYjDR4FAwgICQwCJh4DAQkIAD/O0O0/EjkvEjntORE5ENQROTntETk5ARD2KysrKysrK/3AENYr7cYROTldhxArfRDEARESFzldhxgQKysrfRDEMTABXV1dXQEjESMDJicmIxEjETMRMjc2NzY3NjMyFxUiJiMiBwYHBgcGBxYXEzMEoqxF9VwsWnfCwpBGJUo+J120cAYNNA1nOSAzNyI5ZY6Kw2v+aQGXAY6WLlz9UgW6/X5SK66RO4wCqAJHJ3+LMVMpJ9/+xQABAIb+0wN2BCYAJgD/sgUDA7j/7kAYDQ0GVQMlJSMUJSUjRiMBIiMlAyYIEhAQuP/uQBMPEAZVECUfHRQfHx0fHQ0ZAiUmuP/wQA0KCgJVICYBJigNCCUKuP/4tBAQAlUKuP/6QBEODgJVCgYMDAJVCgYLCwJVCrj/8LQKCgJVCrj/9rQQEAZVCrj/7rQPDwZVCrj//EAuDQ0GVQoKDAwGVQAKIAoCCk4nHx0IGSsQEg0YDCMlIg0rBQMICAkMBiUrAwEJCgA/ztDtPxI5LxI57TkRORDQETk57RE5OQEQ9l0rKysrKysrKyv9wBDWXSvtxhE5OYcQKyt9EMQBERIXOV2HGBArK30QxDEwASMRIwMmJyYjESMRMxEyNzY3Njc2NzYzMxUnJgcGBwYHBgcWFxczA3aUGMAvIzVJtLRkMBA6KBQsOitfJDJLHwonJRwmTXVvbT7+0wEtAUlRIDH+FQQm/jVBFYtgIEkTDpUBASgNZF4lMiQfubUAAAEAoQAABKIFuwArASS2BCYBFiYkJrj/5EA4DRAGVSYgFBYUFBQWSRRZFGkUA4YkARQkHhIFKgEDARINEAZVASAAKhQAACoDACkFCgsMAlUFEQa4/+5AFxAQAlUGCgsMAlUGBgkeDwABAC0OCSALuP/mtBAQAlULuP/2tA8PAlULuP/2tA0NAlULuP/6tAwMAlULuP/4tAwMBlULuP/wtA0NBlULuP/0QDEPDwZVIAsBC10sJiQJIR4WDhsNKgEpCRQTEAMREQ0OHgkHBAMDCQYJBgkKDQIAAQoIAD/QwD8SOTkvLxIXORDtETkvFzkRORE5ENQROe0ROTkBEPZdKysrKysrK/3AENZdxhE5LysrwM0rMhE5hxArK4d9xAEQwBE5OV1dhxgQKyuHfcQBXTEwISMDJicRIxEmIxEjETMRMjcRMxE2NzY3Njc2MzIXFSImIyIHBgcGBwYHFhcEovH1Oi94M0XCwkcxeCYvNxo2TkhZcAYNNA1nOSAzNyI5ZY6KAY5fPP7GAacY/VIFuv1+DwGT/tpBboIqWCwoAqgCRyd/izFTKSffAAEAhgAAA5AEJgAoATS2aRUBFiMhI7j/7kBKDREGVSMlFBYUFBQWvyEB6yEBnyHfIQIUIR0TBScBAwEIDxAGVQElACcUAAAnAwAmBRAGBgsOAlUGBgmvHb8dAh3PAAEAKg4JJQu4//i0EBACVQu4//pAEQ4OAlULBgwMAlULBgsLAlULuP/2tBAQBlULuP/utA8PBlULuP/8QDsNDQZVCwoMDAZVAAsgCzALAwtOKSMhCR0rFg4cDScAJgkUExADERENDisJBwQDAwkGCQYJCg0GAAEKCgA/0MA/Ejk5Ly8SFzkQ7RE5Lxc5ETkRORDQETntETk5ARD2XSsrKysrKysr/cAQ1XLGchE5LyvAzTIROYcQKyuHfcQBEMAROTldXXKHGBArK4d9xLEGAkNUWEAJLQYiET0GMhEEAF1ZMTABXSEjAyYnFSMRJiMRIxEzETI3ETMVNjc2NzY3NjMzFScmBwYHBgcGBxYXA5DGwA4RYyMrtLQtIWMVGCgULDorXyQySx8KJykiKTZqcAFJGBnWATcQ/hUEJv41CgFE0Ss5YCBJEw6VAQEoDWRoKDAZHLwAAQCk/mkFqAW6AA8ArkAUCwQgDgIgAAwMDAJVAAoMDQZVAA64/+60Dw8CVQ64//JACw0NAlUOEAwMAlUOuP/yQBYLCwZVDgoPDwZVDhEKBSAHIBAQAlUHuP/2tA8PAlUHuP/2tA0NAlUHuP/6tAwMAlUHuP/3tAwNBlUHuP/yQBUPEAZVB10QCx4FBQYMCQIOHgMBBggAP87Q7T/AEjkv7QEQ9isrKysrK/3AENQrKysrK90rK+0Q/cAxMAEjESMRIREjETMRIREzETMFqKyc/QbCwgL6wob+aQGXArP9TQW6/aYCWvrzAAEAiP7TBFcEJgAPAPtALAsDJQ4CJRFACwsCVQAUDQ0CVQAMCwsCVQAMDw8GVQAODA0GVQAKCwsGVQAOuP/6tBERAlUOuP/sQAsQEAJVDhQODgJVDrj/7EARDQ0CVQ4KDAwCVQ4iCwsCVQ64/9+0EBAGVQ64//a0DA0GVQ64//hACgsLBlUOEQoFJQe4//a0ERECVQe4//q0EBACVQe4//pAEQ4OAlUHBAwMAlUHCgsLAlUHuP/zQCAPEAZVBwoLCwZVAAcgBwIHThALKwUFBgwJBg8rAwEGCAA/ztDtP8ASOS/tARD2XSsrKysrKyv9wBDUKysrKysrKysr3SsrKysrK+0Q/cAxMAEjESMRIREjETMRIREzETMEV5SU/g20tAHztHT+0wEtAdf+KQQm/kYBuvxuAAAB//0AAARtBboADAC6uQAJ/+q0DRACVQm4//RAOg0QBlUJDBAQBlUJDAkGDCAAARQAAAEJBgYSDQ0CVQYIDA0GVQYgBQQUBQRvBQEFBAABIAQEEBACVQS4/+S0Dw8CVQS4//RACw0NAlUEBgwMAlUEuP/8tAwNBlUEuP/6QBgQEAZVBAAMBgEJBiYENgQCBAQDBQYCAwgAPz/AEjkvXRI5wBDQwAEvKysrKysr/c0Q3V2HKysrfRDEhxgQKwh9EMQBKwArKzEwAQERIxEBMwEWFzY3AQRt/iS0/iDIASIwHBk5ARIFuvy4/Y4CcgNI/fxVRTlqAfsAAAEAFP5pA+0EJgAMANa5AAn/7kALDxECVQkKDQ0CVQm4/+y0CQsCVQm4//RAPQ4QBlUJCwsLBlUJDAkGDA8PDwZVDCUAARQAAAEJBgYECwsGVQYPDQ0GVQYlBQQUBQQFBAABJQQSERECVQS4//C0EBACVQS4//hAEQ8PAlUECg0NAlUECgkJAlUEuP/8tA0NBlUEuP/+QBsQEAZVBAkEDAUABgYBJAQ0BEQEdASEBAUECgIALz9dwD/AwMASOQEvKysrKysrK/3NEN2HKysrfRDEhxgQKysIfRDEASsAKysrKzEwAQERIxEBMxMWFzY3EwPt/m60/m3C3S4fHTHdBCb72v5pAZcEJv2Zf3dtiQJnAAAB//0AAARtBboAEgDRuQAP/+q0DRECVQ+4/+5ASA8QBlUBAAQPEg8MEggQEQJVEggNEAZVEiAABBQAAAQKCwcPDAwSDQ0CVQwEDA0GVQwgCwcUCwcJCwcBBBICAAQgBwQQEAJVB7j/5LQPDwJVB7j/9EALDQ0CVQcGDAwCVQe4//y0EBAGVQe4//xAFQwNBlUHDwwCCR4EBwcGEgsADAIGCAA/P8DAwBI5L8D9wBI5AS8rKysrKyv93MYzEjkQ3MaHKysrfRDEARESOYcYECsrKwh9EMQBERI5ACsrMTABASEVIREjESE1IQEzARYXNjcBBG3+awFV/mS0/mEBVf5qyAEiMBwZOQESBbr9OZT9oQJflALH/fxVRTlqAfsAAQAU/mkD7QQmABIA6kATJg1GDXYNhg0EJhFGEXYRhhEED7j/7kALDxECVQ8KDQ0CVQ+4/+y0CQsCVQ+4/+JARw4QBlUPCw0NBlUPCwsLBlUPEg8MEg8PDwZVEiUAARQAAAEPDAwECwsGVQwKDQ0GVQwlCwoUCwoJCwoCAAUBJQYKEhERAlUKuP/wtBAQAlUKuP/4QBEPDwJVCgoNDQJVCgoJCQJVCrj//EATDQ0GVQoPChILAAwGAwgrAQoKBgAvP8D9wD/AwMASOQEvKysrKysrwP3A3cYQ3caHKysrfRDEhxgQKysIfRDEASsrACsrKysxMABdXQEBIRUhESMRITUhATMTFhc2NxMD7f5uAUL+vrT+vQFD/m3C3S4fHTHdBCb72oT+7QEThAQm/Zl/d22JAmcAAAEACf5pBUkFugAXAQi5ABD/9EAbCwsCVWkDAUQVdBWEFQNJCwEWDQEGDgwRAlUQuP/ytAwRAlUVuP/4QAoMEQJVCwgMEQJVsQYCQ1RYtwIgFxcKGRgQuP/oQBUKETQGGAoRNAYLFRAECgwDCggTDAIAPzw/PBESFzkrKwEREjk5L+0bQDAGCRQDDBUJFBYNEAoTFg0LChMDDA0DDAMgFg0UFhYNAiAAFhQTCRQJIAoTFAoKExS4/+5AIQkMAlUUEAoMBAkMAlUMEBAVCwYECRQTDA0CFh4DCgkIAQAvP8DQ7T/AwMASFzkBL90rxhDNK4cQK4d9xAEYENbd7YcQK4d9xA8PDw9ZKysAKysxMAFdXV1dACsBIxEjASYnBgcBIwEBMwEWFzY3ATMBATMFSaxE/o8ZJzQS/pDpAjf+DOcBClQiLUcBJ9P9/QGuff5pAZcCCyQ+Vhj+AQL8Ar7+iHc9SV4Bhf1N/aYAAQAP/tMD8QQmABMBHEAVJhFGEYYRAyYERgQCWAcBJhFGEQIMuP/sQAsLCwZVBCgNEQZVDLj/2EAoDREGVQwUCwsGVQwKDQ0GVQQFEAMIEQUQEgkMBg8SCQcGDwMIAwkSCbj/+EAPDRECVQklCAMUCAgDAiUAuP/9QB0MDAZVAAoNDQZVAAwPEAZVAJUSATASARIQDwUQBbj/+EAeDRECVQUlBg8UBgYPXxBvEJ8QAxAMBqAIAQgRBwQMuP/2tA0NAlUMuP/2QBoKCgJVIAwBDAwRBwQEBRAPCAkGEisDBgUKAQAvP8DQ7T/AwMASFzkBL10rKzMzM91dxhDNXYcQKyuHfcQBGBDWXV3dKysr7YcQKyuHfcQPDw8PASsrACsrKzEwAF1dXQFdASMRIwEBIwEBMxcWFzY3NzMBATMD8ZRJ/uz+6doBhP6Z4aMqICMus9f+kQEkZ/7TAS0Bo/5dAigB/vlANzRB+/4M/mIAAQBXAAAEtAW6AB0BOEAPZBQBRRRVFAI2FAEYBBcGuP/yQAsQEAJVBgQNDQJVBrj/8kALDAwCVQYOEBAGVQa4//i0Dw8GVQa4//JACwwMBlUGBhEbHSABuP/4tBAQAlUBuP/kQAsPDwJVAR4NDQJVAbj//rQMDAJVAbj/6EAXCwsCVQEKEBAGVQESDw8GVQEIDQ0GVQG4//5ALQwMBlUBDgsLBlUBHxEgDwoQEAJVDxQPDwJVDxYNDQJVDxoMDAJVDxILCwJVD7j/7EAREBAGVQ8ODQ0GVQ8YDAwGVQ+4//xAIQsLBlUADwEPXR4YGBwbGRYVHgkHBAIJBgkGCQERHAIBCAA/P8ASOTkvLxEzMzMQ7TIyMhE5LwEQ9l0rKysrKysrKyvtENQrKysrKysrKysr7cAROS8rKysrKyvA3cAxMF1dXSEjEQYHESMRBiMiJyYnJjURMxEUFjczETMRNjcRMwS0wqKKeBYPinSALCjCsXkLeJGbwgJPPBf+6QEKAT5GeW+xAa/+Y++ZAQHC/kcUPgLJAAEARQAAA6MEJgAeARxAHnQVhBUCZRUBGQQODAwCVQQOCwwGVQQYBgoPEAJVBrj/9rQMDAJVBrj/+EARCwwGVQYODw8GVQYGERweJQG4/8xAERAQAlUBIA8PAlUBCA0NAlUBuP/2tAoLAlUBuP/4tAsMBlUBuP/8QBsNDQZVAQ4PDwZVARgQEAZVHwEBAAEBASARJQ64/+BAERAQAlUOHA8PAlUOFg0NAlUOuP/8QDoMDAJVDhYLDAZVDhgNDQZVDhgPDwZVDhwQEAZVTw5fDgIOHxkZFx0QHBoXKwgHBAIIBggGCAEQBgEKAD8/Ejk5Ly8RMzMzEO0yMhDAETkvARDWXSsrKysrKysr7RDUXV0rKysrKysrK+3AETkvKysrK8DdKyvAMTBdXSEjEQYHFSM1IyInJicmNREzFRQXFhcWFxEzETY3ETMDo7RuZGMVWV5kJCG0CRI/LDtjV3u0AawiDNbQNztiWWsBFsl0K1QvIQgBFf7rCikB4QAAAQChAAAE/gW6ABUAx0AYZxMBWwQBSgQBFSABFBAQAlUBAg0NAlUBuP/gtAwMAlUBuP/QtAsLBlUBuP/itAwMBlUBuP/wtA0NBlUBuP/wtA8PBlUBuP/oQBAQEAZVARcJDSALIBAQAlULuP/2tA8PAlULuP/2tA0NAlULuP/6tAwMAlULuP/4tAwMBlULuP/ttA0NBlULuP/jQBMPDwZVC10WCAYeDQ8PCQwCAQkIAD/APxI5LzPtMgEQ9isrKysrKyv9wBDUKysrKysrKyvtMTBdXV0hIxE0JyYjIgcRIxEzESQzMhcWFxYVBP7COEerzeLCwgEFxItzgSwnAZ24XHNb/TcFuv2xYT5Fem2zAP//AIcAAAPoBboCFgBLAAAAAgBj/+cFsAXTABoAIQC1QDWKIAFtIAFcIAEaIEogAmIeAVUeAUQeARUeAYYdAXcYATkTSRMChA8Bdg8BagwBGQwBChsmALj/6rQPDwJVALj/7LQLCwJVALj/+LQMDAZVALj/67QLCwZVALj/80AmDQ0GVQBcIxAmERwmIAgBCGMiHB4REC8QAQkQCRAfDh4VAx8eBAkAP+0/7RE5OS8vXREz7QEQ9l3t1O0Q9isrKysr/cUxMF1dXV1dXV1dXV1dXV1dXQESBwYhICcmETUhJicmIyADJzY3NjMyFxYXFgMhFhIzMhIFqQelqv6l/qaqnwR1DHV82P7DU744oJncyJ+jUkfF/EwL/NPT/ALt/rPZ4ODSAVRe3H6E/s0y0HBrYmO0mv7e9v7iAR4AAgBV/+gEKAQ+ABcAIADOQC04H0gfAlUVZRUCihMBeRMBXBNsEwJKDQEoDTgNAmwGAVsGAWMDAVUDARgLJAC4/+a0Dw8CVQC4/+q0DQ0CVQC4/+q0CwsCVQC4/+60Dw8GVQC4//JARwsNBlUAByIRJBIZJAoMDg8CVQoUDA0CVQocCw0GVR8KPwpPCgMKNCEZK58LrwsCEhEPER8RnxGvEQQLEQsRHQ8cFAcdHAQLAD/tP+0ROTkvL10RM13tARD2XSsrK+3W7RD+KysrKyvtMjEwXV1dXV1dXV1dXV0BFAcGIyInJjU0NyEmJyYjIgcnEiEyFxYDIRYXFjMyNzYEKHuF8OqCdwEDGAlMVpbKTrpdAXb1hn/E/a8MOFaJg1NPAhz2maWjlvAQIJxgbdoXAVeYkf6YhkNoWFQAAAMAYP/nBdoF1AARABoAIwDHQDhZIgEaIgEWHlYeAoQYAXUYAVQYARYYRhgCVhcBihQBeRQBXBQBSRQBGhQBWRABeAwBWQIBGxImALj/6EALEBACVQAIDw8CVQC4/+60DQ0CVQC4//C0DAwCVQC4//S0DQ0GVQC4//pALwwMBlUAXCUaHCYKBgwMBlUgCgEKYyQSHhxAEBECVRxADQ4CVRwcIBYeDgMgHgQJAD/tP+0ROS8rK+0BEPZdK/3FEPYrKysrKyv9wDEwXV1dXV1dXV1dXV1dXV1dXQEQBwYhIicmJyY1EDc2ISAXFgcmJyYjIgcGBwUhFhcWMzI3NgXaucL+vs+nrk9Ksr8BTQFFwLfME3WM29eQdhUD4fwcD3eI5NuGfgLb/rnR3Gdquq+pAVTU4t3S8tuDnJN476zPi6CTiAADAET/6AQnBD4ADwAYACEBEkBEXCBsIAJTHGMcAmQWAVUWATcWRxYCWxJrEgJIEgE5EgFpDgFYDgFmCgFmBgFVBgFaAmoCAhAZJCNADQ0CVSNACwsCVQC4//JAEQ8PAlUAEg0NAlUAEAsLAlUAuP/wtAsLBlUAuP/ntA0NBlUAuP/4tA8PBlUAuP/qQC8MDAZVADcjGBokCAgODwJVCCANDQJVCBgMDAJVCBwLCwJVCBILCwZVCBwNDQZVCLj//EAsDw8GVQgEEBAGVQggDAwGVR8IPwhPCAMINCIQK5AaoBoCGhoeFBwMBx4cBAsAP+0/7RE5L13tARD2XSsrKysrKysrK/3FEPYrKysrKysrKyv9xTEwXV1dXV1dXV1dXV1dXV0BEAcGIyInJjUQNzYzMhcWByYnJiMiBwYHBSEWFxYzMjc2BCfwdYzyhXukicXrhoC/EUJZhodZQhECav2RCElUk5NTSAIi/oyFQZ+U+AEnjnabk5eBSmVlSoGUmmFub2AAAQA6ASUFtQPAABwAfEAheRaJFgJYFmgWAoEQAXIQAWQQAVUQASgDAQkDARgYABcTuAMDs0AAHgq4AvtACSAACRAJAgkJDkEOAwMABQAXAu8AGAMEAAoACQMEABIC7wABAusBKoUAP+0/Mz/tAS/tMhkvXRrtENAaGP3OETkZLzEwXV1dXV1dXV0BISInJjU0NzY3FwYHBhUUFxYzITU0Jic3FhcWFQW1/EbAco8qDzkeFhUdfG+qA082QU0sCUQBJUNUs11hI2ITLi5HOHZBOhtwjTKjNw5w1gAB/7oBJQH0A6YADABCQBKMBgF9BgFaBmoGAggIHwcBBwO4AwOzAA4BB78C7wAIAwQAAwLvAAEC6wEqhQA/7T/tAS8Q0P3OcjkZLzEwXV1dASE1ITQnJic3FhcWFQH0/cYB8RwTS05IEhsBJa52PitRo1szTbIAAv+6ASUCJARbABUAIQBMuQANAwxADowWAWsWexYCFgUdHQIDuAMMswAjAhG4Au+zGhoFH7gC77IJCQO6Au8AAQLrAD/tMi/tOTIv7QEvENDtETkvOTldXe0xMAEhNSE0JwYHBiMiJyY1NDc2MzIXFhUDJicmIyIGFRQzMjYCJP2WAhUVNBwuI0kuNTI4WnpCN6MOHyomGyNYFzQBJa5ZThEHDCUqT4todL+e1QEEJCUyLR9QEgAC/7oBJQIaA/MAEgAdAES1eBWIFQIKuAMMtBoaAgYTuAMMswAfAg64Au9ACRcXCwYBBhMTA7oC7wABAusAP+0yLzldMy/tAS8Q0O05ETkv7TEwXQEhNSEyNjcmJyY1NDc2MzIXFhUnJicmIyIGFRQXFgIa/aABVz5XM6wzczc+WWY1KloXFSk6HChPHAElrgkPGRYyeGldaYJnjARQJ0ssHkwaCQAAAgBG/2cEpwOPAC0AOgDEQDOLGQFMGQE6GQEpGQEYGQGEFQF2FQFlFQFWFQFXEGcQdxADhQ8BVwoBCAYBVAFkAXQBAyW4Av1AE4ouAXwuAUsuWy5rLgMuHjU1Exu4AwO2QAA8BA0BDbgC+0ALIAAMEAwgDAMMDBO4AwOzCC44KbgC77MyMh4huALvszg4DQy9AwcAFwLvAAQDEQEqhQA/7T8zOS/tOTMv7RI5AS/tMhkvXRrtXRDQGhjtETkvOTldXV3tMTBdXV1dXV1dXV1dXV1dXSUUBwYhIicmNTQ3NjcXBgcGBwYVFBcWMzI3NjU0JicGBiMiJyY1NDc2MzIXFhUnJicmIyIGFRQWMzI2BKe+q/7l33qEJiNBKh0UGwwPbmbH1aC5BwkmTSdYN0M6QVl1RDqfGgscKjAtOiUaLfLGaF1QV6t2gnh4EkY2SjVDP4I+OUZRijMtFxIVKDBhcWd0oIizsT4PKS4jHyQPAAABAJ7/oQGOAIcAAwAdsgMBALgDAbMCAgADuQMCAAEAL+05OQEv7Tk5MTAlByc3AY5OokoykVSSAAIAEP9MAeQAjAADAAcAUEAVZwV3BYcFpwUEmAS4BMgE2AQEBwUGuAMBswQDAQC4AwG1AgIEBgQFuAMCswcCAAO5AwIAAQAv/Tk51u05OQEvMy/tOTkQ7Tk5MTAAcQFxJQcnNwcHJzcB5EqkTEJLpU44kVSRsY9VkAAAAwAb/pkB7wCMAAMABwALAIlADakLuQvJCwOaCwEJCwq4AwFADgipBbkFyQUDmgUBBwUEuAMBQBAGBgjFAQGWAaYBtgEDAQMCuAMBtQAACAoICbgDArULCwEEBgW4AwJACp8HrwcCBwcCAAO5AwIAAQAv7Tk5My9d7Tk5ETMv7Tk5AS8zL+05OV1dETMv7Tk5XV0Q7Tk5XV0xMCUHJzcBByc3BwcnNwEqTaBKAWhOoktBTKJKNpJWkv74kFaPr5FUkQADABD+mQHkAIwAAwAHAAsAgkANxQsBlgumC7YLAwsJCrgDAUAOCMoHAZkHqQe5BwMHBQS4AwFAEAYGCMUBAZYBpgG2AQMDAQC4AwG1AgIIBAYFuAMCtQcHAQoICbgDArQLCwIAA7kDAgABAC/tOTkyL+05OREzL+05OQEvMy/tOTldXREzL+05OV1dEO05OV1dMTAlByc3EwcnNycHJzcB5EqkTIBKo00iS6VOOJFUkf6fklaSWo9VkAACAGv+rAGHAIwAAwAHAD6yBwUEuAMBswYDAQC4AwFACRACIAICAgYEBbgDArQHBwIAA7kDAgABAC/tOTkzL+05OQEvXe05Od7tOTkxMCUHJzcTByc3AVlKpEzQSqNNOJFUkf6yklaSAAT/+f5RAfsAjAADAAcACwAPAMBADToMAQkMGQwpDAMODA24AwFADg81CwEGCxYLJgsDCwkKuAMBQA4INQcBBgcWByYHAwcFBLgDAUAVBgYICA86AQEDDwEfAS8BAxIFAwEAuAMBtQICDwYEB7gDArUFBQkCAAO4AwK0AQENDw64AwK0DAwKCAu4AwK3CUAJQAwRNAkALysAGhgQTe05OTIv7Tk5My/tOTkRMy/tOTkBLzMv7Tk5X15dX10RMy8zL+05OV1dEO05OV1dEO05OV1dMTAlByc3EwcnNwcHJzc3JzcXActNoErTTqJLQUyiSiigRqc2klaS/rCQVo+vkVSRE1qQWgAC/84EJgInBqAAJQAuAKZAFiYAJTAlQCVwJYAlBQoDJTAWGRAQDhS4/8BANAcONBQZQA4NBywoCRQ0LAUHH08bXxsCGxsw7wL/AgICGQ0OFA4UFg8QHxACBxABBR8DIyi4/8BAEgcONCgDLB8BPwFfAX8BnwEFAbgBKoUAL13dwN4rzRE5ORDcXl3MOTkvLzk5AS9dEjkvXTPNMjIrARgQ1sUa3c0rETkZLxE5ENBfXl0YzTEwASE1MzI3NjU0JyYnJicnNjcWFxYXBgcmJycWFRQHBgc2NzYzMhUHNCMiBwYHMzICJ/2nST9HEwoIDQcNHQgTCCAUIAIOBA4GJgcCBlEaSDB+TGA/YCcZz3AEJlMsLi0xQDE4Hi8OQSoYDQgDH0ABAwJ/ViArDSEvDCKIATIyFBAAAgAPBdsBrwchABMAGgB8QFIHFxcXJxcD5hf2FwIYDxAfEC8QAwgQEA1/FI8UAhQAHAsHAA0QDQILDRYAEgFEABIBcBIBEn4LAU8LXwtvCwMLBRDwGQFfGW8ZrxkDrxm/GQIZuAE0hQAvXXFdwN3GXV0vcXJeXc0BL15dzTIQ1M1xEjkvXl3NMTBdcQEUBwYjIyIVFBcWByY1NDMzNjMyBzQjIgczMgGvMDRIpx8CAQEwTBh2dFJaIDdVUloGvTUsMC0FDQwGMTRCn2MmYgAB//UF+AFuBx4AJgDuuQAB/+BAfBAUNJoXqhcCBAEUAcQB1AEEJQE1AUUBAx0hGxMVGxsADCEAFRAVAhUVDJ8AAY8AnwCvAAN+AAEAKAsADBAMAgsMHQgdMzQAHSUfGTkTSRNZE5kTqRMFCBMYEygTaBN4E4gTBhITESUMCw4JCQZADxEfEU8RXxEEEwMRJSW4/8BAIQ4RNA8lHyVfJQNAPyVPJY8lnyWvJQWgJbAlAiAlMCUCJbgBSoUAL11ycV5dKwAYENRfXl0azTkvzcYyERI5Xl1dL80ROTkrAS9eXTMQxl1dcRE5L3HNERI5LxE5ERI5MTAAXV1xKwEUBwYHBiMiJiMiByc2MzIWMzI3JjU0NzYzMhUUByYjIhUUFxYzMgFuXkw1BwkQOQsRGgsoHhQwExYSRDU7LTEXHyRBNTEYIQZ6KCEaEQIXIw1GFg0jJB84PjEXJhweExkXAAEApATXAewFvQAGAFdAOtYC5gL2AgMEAsADATUDAQQDFAMkAwMD2QHpAfkBAwEGzwABOgABCwAbACsAAwBABQDgA/ADAgOABQIAL80a3V3AARkvGs1dXXE5OV3NXV1xOTldMTABByMnMxc3AeyIOIhXTU0FvebmjIwAAQCkBNcB7AW9AAYAV0A61gXmBfYFAwMFwAQBNQQBBAQUBCQEAwTZBukG+QYDBgHPAAE6AAELABsAKwADAAICQOAF8AUCBYAABAAvwBrdXRrNARkvzV1dcTk5Xc1dXXE5OV0xMAEjJwcjNzMB7FdNTVeIOATXjIzmAAABAA4FiQGmBfkADwCPQGUXDAEGDAHnDPcMAmkDAVoDASkDOQNJAwPbAwHJAwG7AwGZA6kDAnoDigMCawMBOgNKA1oDA9kDAcoDAZkDqQO5AwMPAAcIAAIPDQIIBwpwBwFhBwEwB0AHUAcDB58FrwW/BQMFAgAv1F3GcnJyzRE5EN3GETkBLzPMMjEwAF1dXXFxcXFxcXFycnJxcnIBBiMiJiMiByc2MzIWMzI3AaZAUjx2FhMgCy4zEYUqNTQF0kkwDg1BMBcAAAEAVgXdAW4HCgAfAFe5AAL/4EAOCxE0FQcSEhoAABoFBQu4AwW3GhUAFwcdBQW4/8C2Ehk0BR0dF7gC9bNPDwEPuAFKhQAvXe0yLzMrLxI5ETk5AS/tMi8RMy8SOS85OTEwACsBFAcGBwc0NyYnJjU0NzYzMhYVFAYHJiMiBhUUFjMyNgFuHxUqumQfEBU1Oy0UHQwLHyQWK10hFhMGZhkUDQ9ALiMQDxMVHzg+GxYOHRIcEgwPNAMAAAEAVv9fAW4AjAAfAFK5AAL/4EAOCxE0FQcSEhoAABoFBQu4AwW3GhUAFwcdBQW4/8C2Ehg0BR0dF7oC9QAPASqFAC/tMi8zKy8SORE5OQEv7TIvETMvEjkvOTkxMAArBRQHBgcHNDcmJyY1NDc2MzIWFRQGByYjIgYVFBYzMjYBbh8VKrpkHxAVNTstFB0MCx8kFitdIRYTGBkUDQ9ALiMQDxMVHzg+GxYOHRIcEgwPNAMAAAH/zwQmADIGeQAKAC1AGgIQGh80CQcDAgUABwkDHwI/Al8CfwKfAgUCAC9dM80yAS/dMjLWzTEwASsTFAcnNjU0AzY3EjIvCQQvExw0BKc2SwQlEXwBRiYx/rL//wAPAQoBrwchAjYDjQAAARYFNAAAAEGyAgEiuP/AQAoWGjQAIhUNEEEQuP/AswkQNA+4/8BAFQkQNAANAA4ADwAQABHwD/AQBwIBGQAvNTVdKysBKys1NQD///+/ASUB1gchAjYDjgAAARYFNLAAAC9ACQIBACQXDQ1BDbj/wEAVCRA0AAoACwAMAA0ADgAP8A0HAgEbAC81NV0rASs1NQD////1AQoBbgceAjYDjQAAARYFNQAAAFhADgEwIQEAIRUNEEEZEAERuP+cswkQNBC4/5yzCRA0D7j/nLMJEDQOuP/AswkQNA24/8CzCRA0ELj/wLMRHDQPuP/AtBESNAE6AC81KysrKysrK10BK3E1////zQElAdYHHgI2A44AAAEWBTXYAABksQEjuP/AQAoSGjQAIxcNDUEPuP/AswkQNA64/5yzCRA0Dbj/nLMJEDQMuP+cswkQNAu4/8CzCRA0Crj/wLMJEDQNuP/AQA0RHzTQDeANAhkNAQE8AC81XXErKysrKysrASsrNf//AB3/VAGWBewCNgONAAABFwU1ACj5XAAvtAEwFQEVuP/Asw4QNBW4/8BAEggKNEQVFQAAQQEAOhA6XzoDOgAvXTUBKysrXTUA////9f9UAdYF7AI2A44AAAEXBTUAAPlcAB9AFQEjQA0PNAAjFwYRQQEAPBA8XzwDPAAvXTUBKys1AP//AJMBCgJeBewCNgONAAABFwU5APD+1AArtAFwIAEguP/AQAsOFDR1ICAQEEEAALj/wLUJMTQAATIALzUBLys1KytxNQD//wATASUCNgXsAjYDjgAAARcFOQDI/tQAKbEBIrj/wLMaIDQiuP/AQBANFDQAIhAiAmUiIhERQQE0AC81AStdKys1AP//ADL/YwQWBMYCNgPtAAABFwU5Aqj9vAA3QCkCADAwGABBAl8wATAwQDB/MAMPMC8wgDADMIASFTQwQBYXNDBACQ40MAAvKysrXXFyNQErNQD//wAy/2MEFgTGAjYD7QAAARcFOQKo/bwAN0ApAgAwMBgAQQJfMAEwMEAwfzADDzAvMIAwAzCAEhU0MEAWFzQwQAkONDAALysrK11xcjUBKzUA//8AMv9jBBYE7QI2A+0AAAA3BTkCqP28ARcC9QDI/mMAYEASBAMAYmIYKEECADAwGABBBANOuP/AQDIPETRgTgEPTp9Or06/TgROAl8wATAwQDB/MAMPMC8wgDADMIASFTQwQBYXNDBACQ40MAAvKysrXXFyNS9dcSs1NQErNSs1Nf//ADL/YwQWBO0CNgPtAAAANwU5Aqj9vAEXAvUAyP5jAGBAEgQDAGJiGChBAgAwMBgAQQQDTrj/wEAyDxE0YE4BD06fTq9Ov04ETgJfMAEwMEAwfzADDzAvMIAwAzCAEhU0MEAWFzQwQAkONDAALysrK11xcjUvXXErNTUBKzUrNTX//wAy/6cFVgV6AjYDNQAAARcFOQPo/nAAJ0AcAcA80DzwPAN9PDwAAEEBX1mfWc9ZA1lACRM0WQAvK101AStdNQD//wAk/x8EtQOGAjYDNgAAARcFOQMg/HwAJUAaAQA8NyYNQQEPVC9Un1QDVEASFjRUQAsPNFQALysrXTUBKzUA//8AOgElBbUGoAI2BSgAAAEXBTMB9AAAABtAEAIBEB4gHgIAHh0OE0ECAR4ALzU1AStdNTUA//8AOgElBbUGoAI2BSgAAAEXBTMB9AAAABtAEAIBEB4gHgIAHh0OE0ECAR4ALzU1AStdNTUA////ugElAicGoAI2BSkAAAEWBTMAAAAVQAsCAR8ODQEAQQIBDgAvNTUBKzU1AP///7oBJQInBqACNgUpAAABFgUzAAAAFUALAgEfDg0BAEECAQ4ALzU1ASs1NQD//wA6ASUFtQYEAjYFKAAAARcFMQH0BXgAGUAOAgEAIyEOE0ECASAiASIAL101NQErNTUA//8AOgElBbUGBAI2BSgAAAEXBTEB9AV4ABlADgIBACMhDhNBAgEgIgEiAC9dNTUBKzU1AP///7oBJQH0BgQCNgUpAAABFwUx/9gFeAAosgIBD7j/wEAVCw40AA8RAQBBAgEgEj8SgBKfEgQSAC9dNTUBKys1Nf///7oBJQH0BgQCNgUpAAABFwUx/9gFeAAosgIBD7j/wEAVCw40AA8RAQBBAgEgEj8SgBKfEgQSAC9dNTUBKys1Nf//ADr+rAW1A8ACNgUoAAABFwUxAjAAAAAhQBUCAQAfHQ4TQQIBIEAMFTQAIBAgAiAAL10rNTUBKzU1AP//ADr+rAW1A8ACNgUoAAABFwUxAjAAAAAhQBUCAQAfHQ4TQQIBIEAMFTQAIBAgAiAAL10rNTUBKzU1AP///7r+rAH0A6YCNgUpAAABFgUxAAAAIUAVAgEADxEBAEECARBADBU0ABAQEAIQAC9dKzU1ASs1NQD///+6/qwB9AOmAjYFKQAAARYFMQAAACFAFQIBAA8RAQBBAgEQQAwVNAAQEBACEAAvXSs1NQErNTUA//8AOgBABbUFBgI2A5UAAAEXAvgCWPtpABhACwQDACslFhtBBAM0uALrAD81NQErNTX//wA6AEAFtQUGAjYDlQAAARcC+AJY+2kAGEALBAMAKyUWG0EEAzS4AusAPzU1ASs1Nf///7oAQAH0BVYCNgOXAAABFwL4ACj7aQAYQAsEAwAbFQkIQQQDJLgC6wA/NTUBKzU1////ugBAAfQFVgI2A5cAAAEXAvgAKPtpABhACwQDABsVCQhBBAMkuALrAD81NQErNTX//wA6ASUFtQYEAjYFKAAAARcFMAH0BXgAH0ASAwIBACMhDhNBAwIBICI/IgIiAC9dNTU1ASs1NTUA//8AOgElBbUGBAI2BSgAAAEXBTAB9AV4AB9AEgMCAQAjIQ4TQQMCASAiPyICIgAvXTU1NQErNTU1AP///7oBJQH0BgQCNgUpAAABFwUw/9gFeAAnQBkDAgEAFw0BAEEDAgFvEgEgEj8SgBKfEgQSAC9dcTU1NQErNTU1AP///7oBJQH0BgQCNgUpAAABFwUw/9gFeAAnQBkDAgEAFw0BAEEDAgFvEgEgEj8SgBKfEgQSAC9dcTU1NQErNTU1AP//ADoBJQW1BgQCNgUoAAABFwUyAfQFeAAnQBcEAwIBECcBACchDhNBBAMCAQ8mHyYCJgAvXTU1NTUBK101NTU1AP//ADoBJQW1BgQCNgUoAAABFwUyAfQFeAAnQBcEAwIBECcBACchDhNBBAMCAQ8mHyYCJgAvXTU1NTUBK101NTU1AP///7oBJQH0BgQCNgUpAAABFwUy/9gFeAAzQCEEAwIB3xcBABcRAQBBBAMCARZACAo0LxZvFgI/Fp8WAhYAL11xKzU1NTUBK101NTU1AP///7oBJQH0BgQCNgUpAAABFwUy/9gFeAAzQCEEAwIB3xcBABcRAQBBBAMCARZACAo0LxZvFgI/Fp8WAhYAL11xKzU1NTUBK101NTU1AP//ADr+UQW1A8ACNgUoAAABFwUyAhwAAAAnQBcEAwIBACchDhNBBAMCASBAERU0LyABIAAvXSs1NTU1ASs1NTU1AP//ADr+UQW1A8ACNgUoAAABFwUyAhwAAAAnQBcEAwIBACchDhNBBAMCASBAERU0LyABIAAvXSs1NTU1ASs1NTU1AP///7r+UQH7A6YCNgUpAAABFgUyAAAAJ0AXBAMCAQAaEQEAQQQDAgEQQBEVNC8QARAAL10rNTU1NQErNTU1NQD///+6/lEB+wOmAjYFKQAAARYFMgAAACdAFwQDAgEAGhEBAEEEAwIBEEARFTQvEAEQAC9dKzU1NTUBKzU1NTUA//8ANv5OBCAFegI2A6EAAAEXBTkBkP5wAB9AFgEAMi0HEkEBD0ovSl9KcEqASp9KBkoAL101ASs1AP//ADb+TgQ1BXoCNgOiAAABFwU5AZD+cAAfQBYBAEQ/KTNBAQ9cL1xfXHBcgFyfXAZcAC9dNQErNQD///+6ASUEPQV6AjYDowAAARcFOQEs/nAAMkAeAQAcFwEAQQEwNEA0Ag80LzRfNG80nzQFNEASEzQ0uP/Asw8RNDQALysrXXE1ASs1////ugElBD0FegI2A6MAAAEXBTkBLP5wADJAHgEAHBcBAEEBMDRANAIPNC80XzRvNJ80BTRAEhM0NLj/wLMPETQ0AC8rK11xNQErNf//ADb+TgQgBgQCNgOhAAABFwUxASwFeAAkQBACAQAzMQcSQQIBEDIgMgIyuP/Asw0RNDIALytdNTUBKzU1//8ANv5OBDUGBAI2A6IAAAEXBTEBLAV4ACVACwIBAEVDKTNBAgFEuP/AQAkNETQQRCBEAkQAL10rNTUBKzU1AP///7oBJQQ9BgQCNgOjAAABFwUxAMgFeAAsQBcCAQAdGwEAQQIBEBwgHIAcAxxAEhM0HLj/wLMNETQcAC8rK101NQErNTX///+6ASUEPQYEAjYDowAAARcFMQDIBXgALEAXAgEAHRsBAEECARAcIByAHAMcQBITNBy4/8CzDRE0HAAvKytdNTUBKzU1//8ANv5OBCADdQI2A6EAAAEXBS4BfADIACFAFQIBADMxGRJBAgEAMhAyAjJADA80MgAvK101NQErNTUA//8ANv5OBDUDaQI2A6IAAAEXBS4A8AC0ADtAHZsCqwICAgEPRa9FAp9Fr0UCAEU/DgRBAgFARAFEuP/AQAkHCzREQAwQNEQALysrXTU1AStdcTU1XQD///+6/0wEPQNrAjYDowAAARcFLgEEAAAAIUAVAgEAHRcBAEECAQAcEBwCHEAMFTQcAC8rXTU1ASs1NQD///+6/0wEPQNrAjYDowAAARcFLgEEAAAAIUAVAgEAHRcBAEECAQAcEBwCHEAMFTQcAC8rXTU1ASs1NQD//wA2/k4EIAN1AjYDoQAAARcFMQF8AQQAJUAZAgGfM68z3zPvMwQzQAkKNAAzMRkSQQIBMgAvNTUBKytdNTUA//8ANv5OBDUDaQI2A6IAAAEXBTEBGADwACZAEgIBAEE/DgRBAgE/RL9Ez0QDRLj/wLMJCjREAC8rXTU1ASs1Nf///7r+rAQ9A2sCNgOjAAABFwUxAQQAAAAhQBUCAQAdFwEAQQIBABwQHAIcQAwVNBwALytdNTUBKzU1AP///7r+rAQ9A2sCNgOjAAABFwUxAQQAAAAhQBUCAQAdFwEAQQIBABwQHAIcQAwVNBwALytdNTUBKzU1AP//ADb+TgQgBgQCNgOhAAABFwUvAVQFeAAmQBADAgEANzEHEkEDAgEQNgE2uP/Asw0RNDYALytdNTU1ASs1NTX//wA2/k4ENQYEAjYDogAAARcFLwFUBXgAJkAQAwIBAElDKTNBAwIBEEgBSLj/wLMNETRIAC8rXTU1NQErNTU1////ugElBD0GBAI2A6MAAAEXBS8BGAV4ACpAFAMCAQAhGwEAQQMCARAggCCfIAMguP/Asw0RNCAALytdNTU1ASs1NTX///+6ASUEPQYEAjYDowAAARcFLwEYBXgAKkAUAwIBACEbAQBBAwIBECCAIJ8gAyC4/8CzDRE0IAAvK101NTUBKzU1Nf//ADb+TgQgA3UCNgOhAAABFwUyAaQBVAA5QCYEAwIBbzoB3zoBADoxGRJBlxunGwIEAwIBLzYBQDZwNr82zzYENgAvXXE1NTU1XQErXXE1NTU1AP//ADb+TgQ1A2kCNgOiAAABFwUyAQ4BIgB0QFMEAwIBTEA4OTRMQCktNExAERY0kEwBD0wfTF9Mb0zvTAUATEMOBEEEAwIBX0hvSJ9IAwBIL0i/SM9I30gFD0gfSDBI70j/SAVIQDRDNEhAHiA0SLj/wLMNEDRIAC8rKytdcXI1NTU1AStxcisrKzU1NTX///+6/lEEPQNrAjYDowAAARcFMgEYAAAAJ0AXBAMCAQAkGwEAQQQDAgEvIAEgQBEVNCAALytdNTU1NQErNTU1NQD///+6/lEEPQNrAjYDowAAARcFMgEYAAAAJ0AXBAMCAQAkGwEAQQQDAgEvIAEgQBEVNCAALytdNTU1NQErNTU1NQD//wAyASUCswchAjYDqQAAARcFMwBkAIEATrECAbj/2EAaFxcAAEECEiIQIhIkEyQUkhIGAgEYQBIWNBi4/8BAGQ4RNAAYzxgCMBiPGPAYAwAYEBiQGL8YBBgAL11xcisrNTVdASs1Nf//ADIBJQKzByECNgOpAAABFwUzAGQAgQBOsQIBuP/YQBoXFwAAQQISIhAiEiQTJBSSEgYCARhAEhY0GLj/wEAZDhE0ABjPGAIwGI8Y8BgDABgQGJAYvxgEGAAvXXFyKys1NV0BKzU1//8AXwBAArMEagI2A6kAAAEXAvgA3PtpABhACwIBAB0XBABBAgEmuALrAD81NQErNTX//wBfAEACswRqAjYDqQAAARcC+ADc+2kAGEALAgEAHRcEAEECASa4AusAPzU1ASs1Nf//AF//oQKzBGoCNgOpAAABFwUtAIwAAAAdQBMBABkXBABBAQAYEBgCGEALFTQYAC8rXTUBKzUA//8AX/+hArMEagI2A6kAAAEXBS0AjAAAAB1AEwEAGRcEAEEBABgQGAIYQAsVNBgALytdNQErNQD//wAy/6ECswchAjYDqQAAADcFMwBkAIEBFwUtAIwAAAB0QAkDAEhGBABBAgG4/9hAMRcXAABBAhIiECISJBMkFAUDAEcQRwJHQAsVNEcCEiIQIhIkEyQUkhIGAgEYQBIWNBi4/8BAGQ4RNAAYzxgCMBiPGPAYAwAYEBiQGL8YBBgAL11xcisrNTVdLytdNV0BKzU1KzX//wAy/6ECswchAjYDqQAAADcFMwBkAIEBFwUtAIwAAAB0QAkDAEhGBABBAgG4/9hAMRcXAABBAhIiECISJBMkFAUDAEcQRwJHQAsVNEcCEiIQIhIkEyQUkhIGAgEYQBIWNBi4/8BAGQ4RNAAYzxgCMBiPGPAYAwAYEBiQGL8YBBgAL11xcisrNTVdLytdNV0BKzU1KzX//wBfASUCswYEAjYDqQAAARcFLgBQBXgAL0AhAgEwHUAdgB0DAB0XBABBAgE/HJ8cAhxAEhU0HEAMDTQcAC8rK101NQErXTU1AP//AF8BJQKzBgQCNgOpAAABFwUuAFAFeAAvQCECATAdQB2AHQMAHRcEAEECAT8cnxwCHEASFTQcQAwNNBwALysrXTU1AStdNTUA//8AX/9MArMEagI2A6kAAAEXBS4AjAAAACFAFQIBAB0XBABBAgEAHBAcAhxADBU0HAAvK101NQErNTUA//8AX/9MArMEagI2A6kAAAEXBS4AjAAAACFAFQIBAB0XBABBAgEAHBAcAhxADBU0HAAvK101NQErNTUA//8AXwElArMGzAI2A6kAAAEXBS8AZAZAADuzAwIBHbj/wLILEDS4/99ACR0dEhJBAwIBILj/wEAODRE0ECCfIAIgQAsNNCAALytdKzU1NQErKzU1NQD//wBfASUCswbMAjYDqQAAARcFLwBkBkAAO7MDAgEduP/AsgsQNLj/30AJHR0SEkEDAgEguP/AQA4NETQQIJ8gAiBACw00IAAvK10rNTU1ASsrNTU1AP//ADgBJQKzBswCNgOpAAABFwUwACgGQAAvQBIDAgEcHBwSEkEDAgEQHJ8cAhy4/8BACQ4RNBxADAw0HAAvKytdNTU1ASs1NTUA//8AOAElArMGzAI2A6kAAAEXBTAAKAZAAC9AEgMCARwcHBISQQMCARAcnxwCHLj/wEAJDhE0HEAMDDQcAC8rK101NTUBKzU1NQD//wBJASUCswbMAjYDqQAAARcFMgBQBkAAPrMEAwIBuP/XQBYdHRISQQQDAgEPIGAgcCADIEASFjQguP/AQAkOEDQgQAsMNCAALysrK101NTU1ASs1NTU1//8ASQElArMGzAI2A6kAAAEXBTIAUAZAAD6zBAMCAbj/10AWHR0SEkEEAwIBDyBgIHAgAyBAEhY0ILj/wEAJDhA0IEALDDQgAC8rKytdNTU1NQErNTU1Nf//AEr/RgPpBqACNgOtAAABFwUzAZAAAAAlQAsCAQAfHxUAQQIBILj/wEAJDBM0ECBPIAIgAC9dKzU1ASs1NQD//wBK/0YD6QagAjYDrQAAARcFMwGQAAAAJUALAgEAHx8VAEECASC4/8BACQwTNBAgTyACIAAvXSs1NQErNTUA//8ASv9GA+kFEwI2A60AAAEXBTYBkP9WAB5ACQE4Hx8aGkEBIbj/wLYPEzQPIQEhAC9dKzUBKzX//wBK/0YD6QUTAjYDrQAAARcFNgGQ/1YAHkAJATgfHxoaQQEhuP/Atg8TNA8hASEAL10rNQErNf//AEr++wPpA3ACNgOtAAABFwL4ApT6JAAvQBECAQAfHwAAQQIBryIBwCIBIrj/wLMREzQiuP/AswoLNCIALysrXXE1NQErNTUA//8ASv77A+kDcAI2A60AAAEXAvgClPokAC9AEQIBAB8fAABBAgGvIgHAIgEiuP/AsxETNCK4/8CzCgs0IgAvKytdcTU1ASs1NQD//wBK/tkEDgNwAjYDrQAAARcFLQKA/zgAJLEBH7j/wEATEhU0YB8BJR8fAABBAX8gjyACIAAvXTUBK10rNf//AEr+2QQOA3ACNgOtAAABFwUtAoD/OAAksQEfuP/AQBMSFTRgHwElHx8AAEEBfyCPIAIgAC9dNQErXSs1//8ASv5vA+kDcAI2A60AAAEXBTYB9PmYACdACQEAJR8VAEEBIbj/wEAOEhM0MCFAIQJAId8hAiEAL11xKzUBKzUA//8ASv5vA+kDcAI2A60AAAEXBTYB9PmYACdACQEAJR8VAEEBIbj/wEAOEhM0MCFAIQJAId8hAiEAL11xKzUBKzUA//8ASv7ZBA4DcAI2A60AAAA3BS0CgP84ARcFLQDIASwAMkAJAgAjIwwVQQEfuP/AQBUSFTRgHwElHx8AAEECJAF/II8gAiAAL101LzUBK10rNSs1//8ASv7ZBA4DcAI2A60AAAA3BS0CgP84ARcFLQDIASwAMkAJAgAjIwwVQQEfuP/AQBUSFTRgHwElHx8AAEECJAF/II8gAiAAL101LzUBK10rNSs1//8ASv9GA+kFFgI2A60AAAEXBS4BkASKACtAHgIBAB8fFRVBAgEkQBQVNCRADA40ECRPJH8knyQEJAAvXSsrNTUBKzU1AP//AEr/RgPpBRYCNgOtAAABFwUuAZAEigArQB4CAQAfHxUVQQIBJEAUFTQkQAwONBAkTyR/JJ8kBCQAL10rKzU1ASs1NQD//wBK/0YD6QYRAjYDrQAAARcFMgF8BYUALEAUBAMCAQAjIxUVQQQDAgEPKM8oAii4/8CzDhE0KAAvK101NTU1ASs1NTU1//8ASv9GA+kGEQI2A60AAAEXBTIBfAWFACxAFAQDAgEAIyMVFUEEAwIBDyjPKAIouP/Asw4RNCgALytdNTU1NQErNTU1Nf//AD7/bAaSBL8CNgOxAAAANwUtA+gEOAEXBS0EsAAAADRAFQIATUsJAEEBAElHIwBBAkxACxU0TLj/wEALCQo0TAFIQAsQNEgALys1LysrNQErNSs1//8APv9sBpIEvwI2A7EAAAA3BS0D6AQ4ARcFLQSwAAAANEAVAgBNSwkAQQEASUcjAEECTEALFTRMuP/AQAsJCjRMAUhACxA0SAAvKzUvKys1ASs1KzX///+6/6EEPwS/AjYDswAAADcFLQGQBDgBFwUtAlgAAAA0QBUCAEBANjZBAQA+PBoAQQJBQAsVNEG4/8BACwkKNEEBPUALEDQ9AC8rNS8rKzUBKzUrNf///7r/oQQ/BL8CNgOzAAAANwUtAZAEOAEXBS0CWAAAADRAFQIAQEA2NkEBAD48GgBBAkFACxU0Qbj/wEALCQo0QQE9QAsQND0ALys1LysrNQErNSs1//8APv6ZBpQDVwI2A7EAAAEXBTAEsAAAADGzAwIBR7j/wEASCRE0AEdHAABBAwIBTEAMFTRMuP/AswkKNEwALysrNTU1ASsrNTU1AP//AD7+mQaUA1cCNgOxAAABFwUwBLAAAAAxswMCAUe4/8BAEgkRNABHRwAAQQMCAUxADBU0TLj/wLMJCjRMAC8rKzU1NQErKzU1NQD///+6/pkEPwM1AjYDswAAARcFMAJYAAAAMbMDAgE8uP/AQBIJETQAPDwAAEEDAgFBQAwVNEG4/8CzCQo0QQAvKys1NTUBKys1NTUA////uv6ZBD8DNQI2A7MAAAEXBTACWAAAADGzAwIBPLj/wEASCRE0ADw8AABBAwIBQUAMFTRBuP/AswkKNEEALysrNTU1ASsrNTU1AP//AD7+mQaUBcgCNgOxAAAANwUwBLAAAAEXBS8D6AU8AFFADQYFBABdVyMAQQMCAUe4/8BAHwkRNABHRwAAQQYFBBBcL1xgXIBcBFwDAgFMQAwVNEy4/8CzCQo0TAAvKys1NTUvXTU1NQErKzU1NSs1NTUA//8APv6ZBpQFyAI2A7EAAAA3BTAEsAAAARcFLwPoBTwAUUANBgUEAF1XIwBBAwIBR7j/wEAfCRE0AEdHAABBBgUEEFwvXGBcgFwEXAMCAUxADBU0TLj/wLMJCjRMAC8rKzU1NS9dNTU1ASsrNTU1KzU1NQD///+6/pkEPwXIAjYDswAAADcFMAJYAAABFwUvAZAFPABRQA0GBQQAUkwaAEEDAgE8uP/AQB8JETQAPDwAAEEGBQQQUS9RYFGAUQRRAwIBQUAMFTRBuP/AswkKNEEALysrNTU1L101NTUBKys1NTUrNTU1AP///7r+mQQ/BcgCNgOzAAAANwUwAlgAAAEXBS8BkAU8AFFADQYFBABSTBoAQQMCATy4/8BAHwkRNAA8PAAAQQYFBBBRL1FgUYBRBFEDAgFBQAwVNEG4/8CzCQo0QQAvKys1NTUvXTU1NQErKzU1NSs1NTUA//8APv9MCMkDVwI2A7kAAAEXBS4FeAAAACRAEAMCAEU/GQBBAwJEQAwVNES4/8CzCQo0RAAvKys1NQErNTX//wA+/0wIyQNXAjYDuQAAARcFLgV4AAAAJEAQAwIART8ZAEEDAkRADBU0RLj/wLMJCjREAC8rKzU1ASs1Nf///7r/TAbFAz4CNgO7AAABFwUuA+gAAAAkQBADAgA3MRIAQQMCNkAMFTQ2uP/AswkKNDYALysrNTUBKzU1////uv9MBsUDPgI2A7sAAAEXBS4D6AAAACRAEAMCADcxEgBBAwI2QAwVNDa4/8CzCQo0NgAvKys1NQErNTX//wA+/2wIyQXIAjYDuQAAARcFLwV4BTwAI0AWBAMCAElDGQBBBAMCEEgvSGBIgEgESAAvXTU1NQErNTU1AP//AD7/bAjJBcgCNgO5AAABFwUvBXgFPAAjQBYEAwIASUMZAEEEAwIQSC9IYEiASARIAC9dNTU1ASs1NTUA////ugElBsUFyAI2A7sAAAEXBS8D6AU8AClADQQDAgA7NRIAQQQDAjq4/8BACQ0RNBA6LzoCOgAvXSs1NTUBKzU1NQD///+6ASUGxQXIAjYDuwAAARcFLwPoBTwAKUANBAMCADs1EgBBBAMCOrj/wEAJDRE0EDovOgI6AC9dKzU1NQErNTU1AP///7oBJQSnBlkCNgPBAAABFwUvAlgFPAAxQBAEAwIARAGRREQhIUEEAwJDuP/AQA0NETQQQy9Dn0OvQwRDAC9dKzU1NQErXTU1NQD///+6ASUEpwZZAjYDwQAAARcFLwJYBTwAMUAQBAMCAEQBkUREISFBBAMCQ7j/wEANDRE0EEMvQ59Dr0MEQwAvXSs1NTUBK101NTUA//8AKv5OBCAGzAI2A8kAAAEXBS8AZAZAAEazAwIBQrj/wEAsHkM0kELgQgIAQjwRGUEDAgFBQCNbNEFAEhY0X0FvQX9Bn0EEL0E/QXBBA0EAL11xKys1NTUBK10rNTU1//8ANv5OA+MFyAI2A8oAAAEXBS8AoAU8ADJAGwMCAQA/OQcbQQMCAR8+ARA+Lz6APp8+rz4FPrj/wLMNETQ+AC8rXXI1NTUBKzU1Nf///7oBJQPDBiwCNgPLAAABFwUvAHgFoAAjQBYDAgEAKCIKEUEDAgEvJz8nYCeAJwQnAC9dNTU1ASs1NTUA////ugElAycFyAI2A8wAAAEXBS8AZAU8ADRADQMCAQAzLRcgQQMCATK4/4CzDxE0Mrj/wEALDQ40EDIvMq8yAzIAL10rKzU1NQErNTU1AAIAJwElBk8D0gAfACoAikAXYhEBAlARAUQRATYRAXkFAYkFARMTIBe7AvMAJwAgAxCzQAAsDLgC+0AMICELAQALEAsCCwsPuAMDQAoHcCCAIAIgIBMkQQsC7wAbAwQADAALAwQAEwLvAAEC6wEqhQA/7T8zP+0ROS9dAS/tMhkvXV0a7RDQGhj93u0SOS8xMABdAV1dXV1fXQEhIicmJyY1NDc2NxcGBhUUBCEhJicmNTQ3NjMyFxYVJzQnJiMiBhUUFxYGT/xr04GaT1YzJRIoKxwBIAE6AuF1Nz8+RlVjLCVoExcvIiEpHgElGh9IToZZd1EoF1dbJYR+ICowR11qd3VitQ5XLzgpJTEZEgD//wAn/6EGTwPSAjYFugAAARcFLQSIAAAANbECK7j/wLMRGzQruP/AsgkPNLj/x0AMKysAAEECLEALFTQsuP/AswkKNCwALysrNQErKys1AP//ACf/oQZPA9ICNgW6AAABFwUtBIgAAAA1sQIruP/AsxEbNCu4/8CyCQ80uP/HQAwrKwAAQQIsQAsVNCy4/8CzCQo0LAAvKys1ASsrKzUA////uv+hAiQEWwI2BSoAAAEWBS0AAAAgQA4CACQiDQBBAiNACxU0I7j/wLMJCjQjAC8rKzUBKzX///+6/6ECGgPzAjYFKwAAARYFLQAAACBADgIUIB4BAEECH0ALFTQfuP/AswkKNB8ALysrNQErNf//ACf/oQZPBSMCNgW6AAAANwUtAlgAAAEXBS0ETAScADNAHAMAMS8XAEECAC0rBwBBAzBACxI0MAIsQAsVNCy4/8CzCQo0LAAvKys1Lys1ASs1KzUA//8AJ/+hBk8FIwI2BboAAAA3BS0CWAAAARcFLQRMBJwAM0AcAwAxLxcAQQIALSsHAEEDMEALEjQwAixACxU0LLj/wLMJCjQsAC8rKzUvKzUBKzUrNQD///+6/6ECJAWHAjYFKgAAADYFLQAAARcFLf/EBQAAU0A3AyhAChE0ACgoDQ1BAgAkIg0AQQMfJ+8nAo8nnycCLyeAJ58nAydAEhU0J0AJDTQnAiNACxU0I7j/wLMJCjQjAC8rKzUvKytdcXI1ASs1Kys1AP///7r/oQIaBYcCNgUrAAAANgUtAAABFwUt/8QFAABDQCkDJEAKETQAJCQKCkECACAeCgBBA58jASNAEhM0I0ALCzQjAh9ACxU0H7j/wLMJCjQfAC8rKzUvKytdNQErNSsrNQD//wAnASUGTwYsAjYFugAAARcFLwRMBaAAKLUEAwLQNQG4/6VAEDU1FxdBBAMCPzRgNIA0AzQAL101NTUBK101NTX//wAnASUGTwYsAjYFugAAARcFLwRMBaAAKLUEAwLQNQG4/6VAEDU1FxdBBAMCPzRgNIA0AzQAL101NTUBK101NTX///+6ASUCJAaQAjYFKgAAARcFL//YBgQAPLMEAwIsuP/AQBYKDTQALCYBAEEEAwIPKy8rUCtgKwQruP+AQAkQETQrQAsMNCsALysrXTU1NQErKzU1Nf///7oBJQIaBpACNgUrAAABFwUv/+wGBAAzQBQEAwIAKCIBAEEEAwIQJy8nQCcDJ7j/wLMYHjQnuP+Asw4RNCcALysrXTU1NQErNTU1AP//ACf+mQaUA9ICNgW6AAABFwUwBLAAAAAxswQDAjW4/8BAEhITNAA1KxcAQQQDAjBADBU0MLj/wLMJCjQwAC8rKzU1NQErKzU1NQD//wAn/pkGlAPSAjYFugAAARcFMASwAAAAMbMEAwI1uP/AQBISEzQANSsXAEEEAwIwQAwVNDC4/8CzCQo0MAAvKys1NTUBKys1NTUA////uv6ZAiQEWwI2BSoAAAEWBTAoAAAoQBIEAwIALCIBAEEEAwInQAwVNCe4/8CzCQo0JwAvKys1NTUBKzU1Nf///7r+mQIaA/MCNgUrAAABFgUwKAAAKEASBAMCACgeAQBBBAMCI0AMFTQjuP/AswkKNCMALysrNTU1ASs1NTX//wAnASUGTwZoAjYFugAAARcFMgRMBdwALUAdBQQDApA1AQA1LxcAQQUEAwIfNEA0YDRwNJ80BTQAL101NTU1AStdNTU1NQD//wAnASUGTwZoAjYFugAAARcFMgRMBdwALUAdBQQDApA1AQA1LxcAQQUEAwIfNEA0YDRwNJ80BTQAL101NTU1AStdNTU1NQD///+6ASUCJAa4AjYFKgAAARcFMv/YBiwAUrQFBAMCLLj/wEAmCg00ACwmAQBBBQQDAh8rLytfK+8rBI8rAQ8rLytQKwMrQBIWNCu4/4BACQ8RNCtACQw0KwAvKysrXXFyNTU1NQErKzU1NTX///+6ASUCGga4AjYFKwAAARcFMv/YBiwAP7QFBAMCKLj/wEAdCg00ACgiAQBBBQQDAg8nLydAJ2AnnyevJ/AnBye4/4CzDhE0JwAvK101NTU1ASsrNTU1NQD//wBG/2cEpwUFAjYFLAAAARcFLQJEBH4AHUATAjA7AR47OykpQQIPPC88cDwDPAAvXTUBK101AP//AEb/ZwSnBQUCNgUsAAABFwUtAkQEfgAdQBMCMDsBHjs7KSlBAg88LzxwPAM8AC9dNQErXTUA//8ARv9nBKcFyAI2BSwAAAEXBS8CMAU8ACVAGAQDAms/PykpQQQDAg9EL0RARGBEcEQFRAAvXTU1NQErNTU1AP//AEb/ZwSnBcgCNgUsAAABFwUvAjAFPAAlQBgEAwJrPz8pKUEEAwIPRC9EQERgRHBEBUQAL101NTUBKzU1NQAAAQAUASUGfwVjACsAjLkADQMAswAtGyG4AvOyFggKuAMDQBcHBQsYARgbeQ8BGg8qDzoPAwkPAQ8ME7gC70AbhikBGikqKTopAwkpASkMH58lryW/JQMlJQwcuALvQAovG58bAhsIBysMugLvAAEC6wA//TLMMi9d7RE5L105EjldXV3tETldXV0ROV0BLzP9Mt79zBDQ7TEwASEiJyY1NDcXBhUUISEmJyYlJCUmJjU0NzY3NxUHBgcGFRQXFhcWFwQXFhcGf/tVy16XNCUIAW8ENyVcQf7T/v7+/1qEbXXO39GERnREEE/k5AFqOnw5ASUlO6lHaxQiHbo9Jxw6MjESWi9YZ29SWK1GLB8zIioaBhIrLEYlTpEAAQAUASUHdgVjADQAp7cYBQUrADYlK7gC87IgERO4AwNALxAOhC8Bdi8BGS85LwIvLTMLIgEiJYoaAXkaAWoaAVkaAUsaATgaARkaKRoCGhYcuALvQAwpny2vLb8tAy0tFia4Au9ACS8lnyUCJREQFr8C7wAKAusAMwLvAAUAAALrAD8y7T/9zjIvXe0ROS9dOe0ROV1dXV1dXV0ROV0REjldXV0BLzP9Mt79zBDAETkvzTEwASMiJyYnFAcGIyEiJyY1NDcXBhUUISEgNTQnJiUmJyY1NDc2NzcVBwYHBhUUFwQXFhcWMzMHdntejzm0kIB2/jnLXpc0JQgBbwH8AQhol/5AW0BDbXbN39GERnSjAhGVeHm/P4MBJU4fdVpIQCU7qUdrFCIduj0pIjFkFCstL1hncFFYrUYsHzMiNiZ7QkBAZAAB/7oBJQMnBOgAHQCLtFgIARADuAMAsgAfFbgC80AYCgI8DAELDBsMKwwDDA85BVkFaQUDBQMHuALvQCF1GQFoGQEZAzkTAROfF68XvxcDPRcBDxcfFy8XAxcXAxC4Au+1nw8BDx0DuwLvAAEC6wEqhQA/7TIvXe0ROS9dXV05XRI5XV3tETldETldXQEv1u0Q0O3EMTAAXQEhNSEmJyYnJiY1NDc2NzcVBwYHBhUUFxYXFhcWFwMn/JMC+SNeJe9ahG12zd/RhEZ0o51wSDcqDgElrjonDzITWS9YZ3BRWK1GLB8zIjshHy8eSzo1AAAB/7oBJQQeBOgAJwCWQA5ZEQEoAgEMAwMeGQApHrgC80AdEwmAIgF0IgE1IgEkIgEiICYLFSsVOxUDFRgOChC4Au9AFxy+IAGfIK8gAj4gAQ8gHyAvIAMgIAoZuALvtJ8YARgKvwLvAAgC6wAmAu8AAwAAAusAPzLtP+0vXe0ROS9dXV1dOe0RORE5XRESOV1dXV0BL9btENDEEjkvzTEwAF1dASMiJxQHBiMhNSEyNTQnJicmJjU0NzY3NxUHBgcGFRQXFhcWFxYzMwQeenWYcVpm/lQBuvFRM8NahG12zd/RhEZ0o7lUMGtYOYIBJcJgNyuuMR4aECkTWS9YZ3BRWK1GLB8zIjshJSkXalcA//8AFAElBn8F3wI2Ay0AAAEXAvgEzv88ADxAJQIBry2/Lc8tAy1ADA80AC0tDQ1BAgEvMD8wrzADEDAgMMAwAzC4/8CzCQo0MAAvK11xNTUBKytdNTX//wAUASUHdgXfAjYDLgAAARcC+ATO/zwAPEAlAgEgRq9Gv0bPRgRGQAwONABGRiMjQQIBL0k/Sa9JA2BJwEkCSbj/wLMJCzRJAC8rXXE1NQErK101Nf///7oBJQMnBd8CNgMvAAABFwL4AXz/PAA4QCECAb8ezx4CHkAMDzQAHh4PD0ECAS8hPyGvIQNgIcAhAiG4/8CzCQs0IQAvK11xNTUBKytdNTX///+6ASUEHgXfAjYDMAAAARcC+AF8/zwAOkAjAgGvN783zzcDN0AMDjQANzcnJ0ECAS86PzqvOgNgOsA6Ajq4/8CzCQs0OgAvK11xNTUBKytdNTX//wAtASUEzwYzAjYD2QAAARcFLQFoBawASbQCEEoBSrj/wLILDjS4/8VAKkpKGxtBABoAGxAaEBsEAg9Lf0uvS79L70sFS0AhLzRLQAsNNEtACxE0SwAvKysrXTVdASsrcTUA//8ALQElBM8GMwI2A9kAAAEXBS0BaAWsAEm0AhBKAUq4/8CyCw40uP/FQCpKShsbQQAaABsQGhAbBAIPS39Lr0u/S+9LBUtAIS80S0ALDTRLQAsRNEsALysrK101XQErK3E1AP///7oBJQMnBr8CNgMvAAABFwUtAFAGOAA7twHgHgEQHgEeuP/Asx8jNB64/8BAGQkPNDIeHg4OQQEQHz8fTx9/HwQfQDY+NB8ALytdNQErKytdcTUA////ugElAycGvwI2Ay8AAAEXBS0AUAY4ADu3AeAeARAeAR64/8CzHyM0Hrj/wEAZCQ80Mh4eDg5BARAfPx9PH38fBB9ANj40HwAvK101ASsrK11xNQD//wAtASUEzwcIAjYD2QAAARcFLwFoBnwAXEAKBAMC4FQBb1QBVLj/wEAZCRM0AFROMz1BABoAGxAaEBsEBAMCr1MBU7j/wEAQFyc0U0A9PjRTQAsQNFMAA7j/wLMXLTQDAC8rNS8rKytxNTU1XQErK11xNTU1//8ALQElBM8HCAI2A9kAAAEXBS8BaAZ8AFxACgQDAuBUAW9UAVS4/8BAGQkTNABUTjM9QQAaABsQGhAbBAQDAq9TAVO4/8BAEBcnNFNAPT40U0ALEDRTAAO4/8CzFy00AwAvKzUvKysrcTU1NV0BKytdcTU1Nf///7oBJQMnBtECNgMvAAABFwZuACgG+QAnQBkDAgHvKAEAKCgKCkEDAgE/J08ngCe/JwQnAC9dNTU1AStdNTU1AP///7oBJQMnBtECNgMvAAABFwZuACgG+QAnQBkDAgHvKAEAKCgKCkEDAgE/J08ngCe/JwQnAC9dNTU1AStdNTU1AP//AC3+mQTPBjMCNgPZAAABFwUwAZAAAAAoQBIEAwIAVE4uKUEEAwJPQAwTNE+4/8CzCQo0TwAvKys1NTUBKzU1Nf//AC3+mQTPBjMCNgPZAAABFwUwAZAAAAAoQBIEAwIAVE4uKUEEAwJPQAwTNE+4/8CzCQo0TwAvKys1NTUBKzU1Nf///7r+mQMnBd8CNgMvAAABFwUwAIwAAAAoQBIDAgEAKB4BAEEDAgEjQAwTNCO4/8CzCQo0IwAvKys1NTUBKzU1Nf///7r+mQMnBd8CNgMvAAABFwUwAIwAAAAoQBIDAgEAKB4BAEEDAgEjQAwTNCO4/8CzCQo0IwAvKys1NTUBKzU1Nf//ABQBJQZ/BvACNgMxAAABFwL4BM7/PAA8QCUDAq84vzjPOAM4QAwPNAA4OA0NQQMCLzs/O687AxA7IDvAOwM7uP/AswkKNDsALytdcTU1ASsrXTU1//8AFAElB3YG8AI2AzIAAAEXAvgEzv88ADxAJQMCIFGvUb9Rz1EEUUAMDjQAUVEjI0EDAi9UP1SvVANgVMBUAlS4/8CzCQs0VAAvK11xNTUBKytdNTX///+6ASUDJwcCAjYDMwAAARcC+AF8/zwAOEAhAwK/Kc8pAilADA80ACkpDw9BAwIvLD8srywDYCzALAIsuP/AswkLNCwALytdcTU1ASsrXTU1////ugElBB4HAgI2AzQAAAEXAvgBfP88ADpAIwMCr0K/Qs9CA0JADA40AEJCKChBAwIvRT9Fr0UDYEXARQJFuP/AswkLNEUALytdcTU1ASsrXTU1//8AFAElBn8HIQI2AzEAAAEXBm0DcAa9AG5ACQMCED4BoD4BPrj/wLMxXDQ+uP/AsxIVND64/8BAEwkQNAA+PgcHQQcx5zb3NgMDAj24/8BAGTz/NKA9sD3APQNfPW89AgA9UD1gPQM9AS64/8CzPP80LgAvKzUvXXFyKzU1XQErKysrcXI1Nf//ABQBJQd2ByECNgMyAAABFwZtA3AGvQBnsgMCV7j/wEAkMVw0EFfAVwJPVwEgV0BXr1fgVwQAV1EdHUEHSudP908DAwJWuP/AQBk8/zSgVrBWwFYDX1ZvVgIAVlBWYFYDVgFHuP/Aszz/NEcALys1L11xcis1NV0BK11xcis1NQD///+6ASUDJwchAjYDMwAAARcGbQAABr0AhrIDAi+4/4BAFTz/NBAvAaAvAQAvUC9gL7AvwC8FL7j/wLMbHTQvuP/AQBolJzQALy8KCkHmJucn9ib3JwQDPy5PLgICLrj/wEAZPP80oC6wLsAuA18uby4CAC5QLmAuAy4BH7j/wLYq/zR0HwEfAC9dKzUvXXFyKzVdNV0BKysrXXFyKzU1////ugElBB4HIQI2AzQAAAEXBm0AAAa9AIiyAwJIuP+Aszz/NEi4/8BAExseNBBIAaBIAQBIUEiwSMBIBEi4/8BAHiUnNABISCIiQXs3ejjmP+dA9j/3QAYDP0dPRwICR7j/wEAZPP80oEewR8BHA19Hb0cCAEdQR2BHA0cBOLj/wLYq/zR0OAE4AC9dKzUvXXFyKzVdNV0BKytdcXIrKzU1//8AFP9MBn8G8AI2AzEAAAEXBS4ClAAAACRAEAMCAD44IBtBAwI9QAwVND24/8CzCQo0PQAvKys1NQErNTX//wAU/0wHdgbwAjYDMgAAARcFLgGkAAAAJEAQAwIAV1EEQUEDAlZADBU0Vrj/wLMJCjRWAC8rKzU1ASs1Nf///7r/TAMnBwICNgMzAAABFwUuAKAAAAAkQBADAgAvKQEAQQMCLkAMFTQuuP/AswkKNC4ALysrNTUBKzU1////uv9MBB4HAgI2AzQAAAEWBS4UAAAkQBADAgBIQhUPQQMCR0AMFTRHuP/AswkKNEcALysrNTUBKzU1//8AFP6sBn8G8AI2AzEAAAEXBTEClAAAACRAEAMCAD44IBtBAwI9QAwVND24/8CzCQo0PQAvKys1NQErNTX//wAU/qwHdgbwAjYDMgAAARcFMQHMAAAAJEAQAwIAV1EEQUEDAlZADBU0Vrj/wLMJCjRWAC8rKzU1ASs1Nf///7r+rAMnBwICNgMzAAABFwUxAKAAAAAkQBADAgAvKQEAQQMCLkAMFTQuuP/AswkKNC4ALysrNTUBKzU1////uv6sBB4HAgI2AzQAAAEWBTEAAAAkQBADAgBIQhUPQQMCR0AMFTRHuP/AswkKNEcALysrNTUBKzU1//8AFAElBn8HIQI2AzEAAAEXBm4DSAdJAMmzBAMCQrj/gLM3/zRCuP/AszI2NEK4/8CzJis0Qrj/wLMhJDRCuP/AsxIUNEK4/8BAEA0PNABCAQBCAQBCQgcHQTa4/+hAFhIcNAcxdzQCBAMC30EBX0FvQeBBA0G4/8BACQ4QNEFAEhY0Qbj/wLMYHDRBuP/Aszw9NEG4/8BACkb/NEFASTVBAS64/4CzZP80Lrj/wLMxYzQuuP/gtx4wNHYuAQAuAC81XSsrKzUvKysrKysrcXI1NTVdKwErXXErKysrKys1NTUA//8AFAElB3YHIQI2AzIAAAEXBm4DSAdJANKzBAMCW7j/gLM3/zRbuP/Asj01W7j/wLMyNjRbuP/AsyYtNFu4/8CzISQ0W7j/wEAWEhQ0AFtgWwIAW0BbUFsDAFtbHR1BT7j/6EAdEhw0CEkBB0pkTXRNt08EBAMC31oBX1pvWuBaA1q4/8BACQ4QNFpAEhY0Wrj/wLMYHDRauP/Aszw9NFq4/8BACkb/NFpASTVaAUe4/4CzZP80R7j/wLMxYzRHuP/gtB4wNABHAC81KysrNS8rKysrKytxcjU1NV1xKwErXXErKysrKys1NTX///+6ASUDJwchAjYDMwAAARcGbv/xB0kA+7MEAwIzuP+Aszr/NDO4/8CzPT40M7j/wLMnOTQzuP/AsyEkNDO4/8BAERIUNAAzUDNgMwMAMzMKCkEouP/Qszf/NCe4/9CzN/80Jrj/0LM3/zQnuP/4sx0nNCe4/+BAJhIcNBQnJCcCGSIBBiJzI3MkcyXmJvYmBgQDAt8yAV8ybzLgMgMyuP/AQAkOEDQyQBIWNDK4/8CzGBw0Mrj/wLM8PTQyuP/AQApG/zQyQEk1MgEfuP+As2T/NB+4/8CzKmM0H7j/4LMdKTQfuP/YtBkcNAAfAC81KysrKzUvKysrKysrcXI1NTVdcXIrKysrKwErXSsrKysrNTU1AP///7oBJQQeByECNgM0AAABFwZu//EHSQEBQBQEAwJQTAEATEBMUEyQTKBMsEwGTLj/gLM7/zRMuP/Asz0+NEy4/8CzJzo0TLj/wEAKISQ0AExMIiJBQbj/0LM3/zRAuP/Qszf/ND+4/9CzN/80QLj/+LMdJzRAuP/gQCsSHDQUQCRAAgY7ZDxkPWQ+dDx0PXQ+tkDmP/Y/CgQDAt9LAV9Lb0vgSwNLuP/AQAkOEDRLQBIWNEu4/8CzGBw0S7j/wLM8PTRLuP/AQApG/zRLQEk1SwE4uP+As2T/NDi4/8CzKmM0OLj/4LMdKTQ4uP/YtBkcNAA4AC81KysrKzUvKysrKysrcXI1NTVdcisrKysrASsrKysrXXE1NTUA//8ARwAOBA0HIAI2A90AAAEXBTYB9AFjAK9ACwEAORA5oDmwOQQ5uP+AQAoLEDQAOTknJ0EouP/AsyX/NCe4/4CzJf80Jrj/gLMl/zQquP/wswn/NCm4//CzCf80KLj/0LMJJDQnuP+wswkkNCa4/7BACgkkNAE6QFNjNDq4/8BAJyAiNAA6MDqAOqA6BA86LzpfOm86BAA6EDogOmA6cDq/OsA6BzoABrj/wLMc/zQGAC8rNS9dcXIrKzUrKysrKysrKwErK101AP//AEcADgQNByACNgPdAAABFwU2AfQBYwCvQAsBADkQOaA5sDkEObj/gEAKCxA0ADk5JydBKLj/wLMl/zQnuP+AsyX/NCa4/4CzJf80Krj/8LMJ/zQpuP/wswn/NCi4/9CzCSQ0J7j/sLMJJDQmuP+wQAoJJDQBOkBTYzQ6uP/AQCcgIjQAOjA6gDqgOgQPOi86XzpvOgQAOhA6IDpgOnA6vzrAOgc6AAa4/8CzHP80BgAvKzUvXXFyKys1KysrKysrKysBKytdNQD///+6ASUBqAcgAjYD3wAAARcFNv+cAWMA4LYBABcQFwIXuP/AQCgNEDQAFxMEEUEYQChCNBVAKEI0FEAoQjQYgEP/NBWAQ/80FIBD/zQOuP/Aswn/NA24/8CzCf80DLj/wLMJ/zQLuP/Aswn/NAq4/8CzCf80Cbj/gLMX/zQIuP+Asxf/NAe4/8CzCf80Cbj/wLMJFjQIuP/AtAkWNAEVuP/As0NFNBW4/8CzPT40Fbj/wLI7NRW4/8BAHwkLNAAVMBWAFaAVBBAVcBWAFZAVzxUFYBVwFb8VAxUAL11xcisrKys1KysrKysrKysrKysrKysrKwErK3E1////ugElAagHIAI2A98AAAEXBTb/nAFjAOC2AQAXEBcCF7j/wEAoDRA0ABcTBBFBGEAoQjQVQChCNBRAKEI0GIBD/zQVgEP/NBSAQ/80Drj/wLMJ/zQNuP/Aswn/NAy4/8CzCf80C7j/wLMJ/zQKuP/Aswn/NAm4/4CzF/80CLj/gLMX/zQHuP/Aswn/NAm4/8CzCRY0CLj/wLQJFjQBFbj/wLNDRTQVuP/Asz0+NBW4/8CyOzUVuP/AQB8JCzQAFTAVgBWgFQQQFXAVgBWQFc8VBWAVcBW/FQMVAC9dcXIrKysrNSsrKysrKysrKysrKysrKysBKytxNf//AEcADgQNByECNgPdAAABFwUtAk4GmgDktwEAOq860DoDuP/aQBA6OiQkQTlAQWQ0OEBBZDQouP/AsyX/NCe4/4CzJf80Jrj/gLMl/zQquP/wswn/NCm4//CzCf80KLj/0LMJJDQnuP+wswkkNCa4/7BAJQskNAAmECYCARA5cDmgObA5wDkFADlgOXA5A285fzngOfA5BDm4/8CyWDU5uP/AslI1Obj/wLNKSzQ5uP/As0RHNDm4/8CyQTU5uP/Asjw1Obj/wEALW/80OUALDTQ5AAa4/8CzHP80BgAvKzUvKysrKysrKytdcXI1XSsrKysrKysrKysBK101//8ARwAOBA0HIQI2A90AAAEXBS0CTgaaAOS3AQA6rzrQOgO4/9pAEDo6JCRBOUBBZDQ4QEFkNCi4/8CzJf80J7j/gLMl/zQmuP+AsyX/NCq4//CzCf80Kbj/8LMJ/zQouP/QswkkNCe4/7CzCSQ0Jrj/sEAlCyQ0ACYQJgIBEDlwOaA5sDnAOQUAOWA5cDkDbzl/OeA58DkEObj/wLJYNTm4/8CyUjU5uP/As0pLNDm4/8CzREc0Obj/wLJBNTm4/8CyPDU5uP/AQAtb/zQ5QAsNNDkABrj/wLMc/zQGAC8rNS8rKysrKysrK11xcjVdKysrKysrKysrKwErXTX///+6ASUBqAchAjYD3wAAARcFLf/LBpoBA7cBABMBUBMBE7j/wLMsLjQTuP/Asg4QNLj/4EAVExMNDUEUgFJjNBRAJ1E0E0AnYzQOuP/Aswn/NA24/8CzCf80DLj/wLMJ/zQLuP/Aswn/NAq4/8CzCf80Cbj/gLMX/zQIuP+Asxf/NAe4/8CzCf80Cbj/wLMJFjQIuP/AQCcJFjQEBgQIBAkDARAUcBSgFLAUwBQFABRgFHAUA28UfxTgFPAUBBS4/8CyWDUUuP/AslI1FLj/wLNKSzQUuP/As0RHNBS4/8CyQTUUuP/Asjw1FLj/wEAJW/80FEALDTQUAC8rKysrKysrK11xcjVdKysrKysrKysrKysrKwErKytxcjUA////ugElAagHIQI2A98AAAEXBS3/ywaaAQO3AQATAVATARO4/8CzLC40E7j/wLIOEDS4/+BAFRMTDQ1BFIBSYzQUQCdRNBNAJ2M0Drj/wLMJ/zQNuP/Aswn/NAy4/8CzCf80C7j/wLMJ/zQKuP/Aswn/NAm4/4CzF/80CLj/gLMX/zQHuP/Aswn/NAm4/8CzCRY0CLj/wEAnCRY0BAYECAQJAwEQFHAUoBSwFMAUBQAUYBRwFANvFH8U4BTwFAQUuP/Aslg1FLj/wLJSNRS4/8CzSks0FLj/wLNERzQUuP/AskE1FLj/wLI8NRS4/8BACVv/NBRACw00FAAvKysrKysrKytdcXI1XSsrKysrKysrKysrKysBKysrcXI1AP//AEcADgQNByECNgPdAAABFwZuAjAHSQELswMCAT64/8CyRjU+uP/Asy4wND64/8CzJyw0Prj/wLMVFzQ+uP/AsgoSNLj/6rU+PicnQSm4//izGBs0KLj/+LMYGzQnuP/4sxgbNCa4//izGBs0KLj/wLMl/zQnuP+AsyX/NCa4/4CzJf80Krj/8LMJ/zQpuP/wswn/NCi4/9CzCSQ0J7j/sLMJJDQmuP+wQBkLJDQAJgEDAv9BAQHgQQFQQWBBcEHwQQRBuP/As2X/NEG4/8CzWFk0Qbj/wLNGSDRBuP/Aszw9NEG4/8BACxkcNEFAEhY0QQAGuP/Asxz/NAYALys1LysrKysrK11xNV01NV0rKysrKysrKysrKysBKysrKysrNTU1AP//AEcADgQNByECNgPdAAABFwZuAjAHSQELswMCAT64/8CyRjU+uP/Asy4wND64/8CzJyw0Prj/wLMVFzQ+uP/AsgoSNLj/6rU+PicnQSm4//izGBs0KLj/+LMYGzQnuP/4sxgbNCa4//izGBs0KLj/wLMl/zQnuP+AsyX/NCa4/4CzJf80Krj/8LMJ/zQpuP/wswn/NCi4/9CzCSQ0J7j/sLMJJDQmuP+wQBkLJDQAJgEDAv9BAQHgQQFQQWBBcEHwQQRBuP/As2X/NEG4/8CzWFk0Qbj/wLNGSDRBuP/Aszw9NEG4/8BACxkcNEFAEhY0QQAGuP/Asxz/NAYALys1LysrKysrK11xNV01NV0rKysrKysrKysrKysBKysrKysrNTU1AP///7oBJQGoByECNgPfAAABFwZu/8QHSQDoQAoDAgEgGwHAGwEbuP/AszY7NBu4/8CzFx00G7j/wLINETS4//K1GxsICEEOuP/Aswn/NA24/8CzCf80DLj/wLMJ/zQLuP/Aswn/NAq4/8CzCf80Cbj/gLMX/zQIuP+Asxf/NAe4/8CzCf80Cbj/wLMJFjQIuP/AQB4JFjQEBgQIBAkDAwIBXxxvHOAcA1AcYBxwHPAcBBy4/8CzZf80HLj/wLNYWTQcuP/As0ZINBy4/8CzPD00HLj/wEAJGRw0HEASFjQcAC8rKysrKytdcTU1NV0rKysrKysrKysrASsrKytxcjU1Nf///7oBJQGoByECNgPfAAABFwZu/8QHSQDoQAoDAgEgGwHAGwEbuP/AszY7NBu4/8CzFx00G7j/wLINETS4//K1GxsICEEOuP/Aswn/NA24/8CzCf80DLj/wLMJ/zQLuP/Aswn/NAq4/8CzCf80Cbj/gLMX/zQIuP+Asxf/NAe4/8CzCf80Cbj/wLMJFjQIuP/AQB4JFjQEBgQIBAkDAwIBXxxvHOAcA1AcYBxwHPAcBBy4/8CzZf80HLj/wLNYWTQcuP/As0ZINBy4/8CzPD00HLj/wEAJGRw0HEASFjQcAC8rKysrKytdcTU1NV0rKysrKysrKysrASsrKytxcjU1Nf//AEf+XQQNBjMCNgPdAAABFwZvASz/dAB4twMCAQA+ED4CuP/WQCY+PgoAQQMCPUBHNT1APEE0PUAxNjQBvz3PPd89A9A9AT1AUlI0Pbj/wLJHNT24/8CzPEE0Pbj/wLMyNjQ9uP/AsyksND24/8BACR8kND1ACQs0PQAvKysrKysrK11yNSsrKzU1AStdNTU1//8AR/5dBA0GMwI2A90AAAEXBm8BLP90AHi3AwIBAD4QPgK4/9ZAJj4+CgBBAwI9QEc1PUA8QTQ9QDE2NAG/Pc893z0D0D0BPUBSUjQ9uP/Askc1Pbj/wLM8QTQ9uP/AszI2ND24/8CzKSw0Pbj/wEAJHyQ0PUAJCzQ9AC8rKysrKysrXXI1KysrNTUBK101NTX///+6/pkBvAYzAjYD3wAAARYFMNgAACVAFwMCASEdEwEAQQMCAQAYEBgCGEAMFTQYAC8rXTU1NQErNTU1AP///7r+mQG8BjMCNgPfAAABFgUw2AAAJUAXAwIBIR0TAQBBAwIBABgQGAIYQAwVNBgALytdNTU1ASs1NTUA//8ARf5SBDUEdgI2A+UAAAEXBS0BPP6xAD9AEwIAJyUMBEECJkBNTjQmQDs7NCa4/8BAGTI0NN8mAZ8mryb/JgMAJi8mPyZ/Jo8mBSYAL11xcisrKzUBKzUA//8ARf5SBDUEdgI2A+UAAAEXBS0BPP6xAD9AEwIAJyUMBEECJkBNTjQmQDs7NCa4/8BAGTI0NN8mAZ8mryb/JgMAJi8mPyZ/Jo8mBSYAL11xcisrKzUBKzUA////uv+hAfQFFgI2A+cAAAEWBS0AAAAgQA4CABMRBQRBAhJACxU0Erj/wLMJCjQSAC8rKzUBKzX///+6/6EB9AUWAjYD5wAAARYFLQAAACBADgIAExEFBEECEkALFTQSuP/AswkKNBIALysrNQErNQABAEX/bAQ1A1cAIACoQEB6G4obAmsbAUkbWRsCKBs4GwKIFgEqFjoWAoQTAXYTAWUTAVYTAYYPAXcPAXcLAXUCAVMCYwICRAIBHR0AHBwYuAMDs0AAIg64AvtADCAhDQEADRANAg0NEUEOAwMACAAcAu8AHQMJAA4ADQMHABQC7wAEAxEBKoUAP+0/Mz/tAS/tMhkvXV0a7RDQGhjtMi8SORkvMTBdXV1dXV1dXV1dXV1dXV1dARQHBiEiJyY1NDY3NjcXBgYVFBYzMjc2NTQnJic3FhYVBDWDjf7GyGp0KiQWNihGLbGkvZK1HhowUzUoASXfaXFGTZ9WsFk2cBKQpkV8gUNTlWZYTjrNUaiL//8ARf9sBDUDVwIWBg8AAP//AEX/bAQ1BlACNgYPAAABFwUzAVT/sAAtQAoCAWAicCKwIgMiuP/AQBEJDDQPIiERGEECARAiMCICIgAvXTU1ASsrXTU1AP//AEX/bAQ1BlACNgYPAAABFwUzAVT/sAAtQAoCAWAicCKwIgMiuP/AQBEJDDQPIiERGEECARAiMCICIgAvXTU1ASsrXTU1AP//AEX+hwQ1BHYCNgPlAAABFwL4AVT5sAA+QAwDAoArAQArJRYbQS24/8CzCQs0L7j/wLMJCzQuuP/AQAsJCzQDAjRACQs0NLgDEQA/KzU1KysrAStdNTX//wBF/ocENQR2AjYD5QAAARcC+AFU+bAAPkAMAwKAKwEAKyUWG0EtuP/AswkLNC+4/8CzCQs0Lrj/wEALCQs0AwI0QAkLNDS4AxEAPys1NSsrKwErXTU1////ugBAAfQFFgI2A+cAAAEXAvgAKPtpABhACwMCABcRBQRBAwIguALrAD81NQErNTX///+6AEAB9AUWAjYD5wAAARcC+AAo+2kAGEALAwIAFxEFBEEDAiC4AusAPzU1ASs1Nf//AEX/bAQ1BcgCNgYPAAABFwUvASwFPAAotQMCAQArAbj/9kAQKyUIAEEDAgEAKhAqLyoDKgAvXTU1NQErXTU1Nf//AEX/bAQ1BcgCNgYPAAABFwUvASwFPAAotQMCAQArAbj/9kAQKyUIAEEDAgEAKhAqLyoDKgAvXTU1NQErXTU1Nf//ADb+TgQgBR0CNgMnAAABFwUtARgElgAfQBYEADs5BxJBBBA6LzpgOp86vzrQOgY6AC9dNQErNQD//wA2/k4ENQUdAjYDKAAAARcFLQEcBJYAH0AWBABNSykzQQQQTC9MYEyfTL9M0EwGTAAvXTUBKzUA////uv6ZBD0FHQI2AykAAAEXBS0A0gSWACq5AAT/5UAbJSUPD0EEECQvJIAknyS/JNAk8CQHJEASEzQkAC8rXTUBKzX///+6/pkEPQUdAjYDKQAAARcFLQDSBJYAKrkABP/lQBslJQ8PQQQQJC8kgCSfJL8k0CTwJAckQBITNCQALytdNQErNf//ADYBCgIYBRYCNgMIAAABFwU5ADz+DABdtgIgJaAlAiW4/8CyJS80uP/KQDklJQ4OQQIlgCAgNCWAFBU0JcASEzQlQA0PNCWACww0XyXPJQIPJUAljyXvJQQPJS8lgCXfJe8lBSUAL11xcisrKysrNQErK101AP////cBJQMABd4CNgPqAAABFwU5ADz+1ABftwIgKJAooCgDuP/xQEAoKBUVQQKPLQEPLS8tPy1fLW8tgC2fLQctQEM1LUA1NzQtQC4vNC1AKis0LYAgIDQtQB4jNC1AEhU0LUALGzQtAC8rKysrKysrK11xNQErXTUAAAEAGgCRAxoCnwAUAEdAIIYQlhACmQ6pDgKLDgFZBAE4BEgEAnkDAWgDAQAWDA0IuwLvAA8AEwLvsg0MALgC6wA/xjL93O0BL80QwDEwXV1dXV1dXQEjIiYnJicmIyIHBgcnEjMyFxYzMwMaSEJdQDgFICFDZkc9LsfROVRcQzwBJTVHPgUdj2R9HQHxYWsA//8AGgCRAxoETgI2Bh8AAAEXBTkAjP1EACq5AAH/1EAaGhUNAEEBDxo/Gl8abxoEGoALCzQaQBIWNBoALysrXTUBKzX//wAaAJEDGgR0AjYGHwAAARcFLgBkA+gAJrECAbj/xEAVGxUNAEECARAaPxpPGm8anxqvGgYaAC9dNTUBKzU1//8AMv9jA3UDFAI2A+0AAAEXAvgBNvrYAGdACwMCEDcBsDcBEDcBuP/oQA43NxERQYotAS0YCw00Nbj/6EAeCxE0FhALDzQDAgAuAX8ury7gLgNALnAugC6gLgQuuP+AsxgYNC64/8CzCgs0LgAvKytdcXI1NSsrK10BK11ycTU1AP//ADL/YwN1AxQCNgPtAAABFwL4ATb62ABnQAsDAhA3AbA3ARA3Abj/6EAONzcREUGKLQEtGAsNNDW4/+hAHgsRNBYQCw80AwIALgF/Lq8u4C4DQC5wLoAuoC4ELrj/gLMYGDQuuP/AswoLNC4ALysrXXFyNTUrKytdAStdcnE1NQAAAgAy/2MDdQMUAC4ANAC8QCQXDw0PNCcgCxE0MBATHDRZF2kXAmARAQ0DHQMCCwQTJCYbHBy4/8C2DQ80HBwKKLgC/bMzMwovugMDACYDA7QANgsKLLgC77IxMS+4Au9AHCYTFSQvIj8iAiIiHBsZAB4B4B7wHgIeHg4LCia4AuuyCgoOuwMKAAQDCAEqhQA/7TIZLxg/EjkSOS9xcs0yMjkvXTPNMhDtMi/tAS8zENDt7RE5L+0ROS8rAREzEjk5MTAAX15dXV0rKysBFAcGIyInJicmJzcXFjMyNzY3NwYjIicmIyIHJzYzMhcWMzI3NjcgNTQ3NjMyEQcmIyIVFAN1eoiyQkY6SytXEXZCLHtsUk4LERAuXHkLFR4LMDsVeFseHx8dGv7qMDhWmz8mUUUBYaWjtg8MGg8eIxsPPi9VDAMZIQ4NSyEZCCUjzGdYZv6/BaVBZP//ADL/YwN1AxQCFgYkAAD//wAy/2MDfASvAjYD7QAAARcFNgGQ/vIANLECK7j/wEALEhg0ACsrAABBAi24/4BAEhARNEAtfy0CDy0/LWAtvy0ELQAvXXErNQErKzX//wAy/2MDfASvAjYD7QAAARcFNgGQ/vIANLECK7j/wEALEhg0ACsrAABBAi24/4BAEhARNEAtfy0CDy0/LWAtvy0ELQAvXXErNQErKzX//wAy/2MDdQVRAjYD7QAAARcC9QGk/scAIUAVAwIAPEIYAEEDAjNAEhQ0M0AJDDQzAC8rKzU1ASs1NQD//wAy/2MDdQVRAjYD7QAAARcC9QGk/scAIUAVAwIAPEIYAEEDAjNAEhQ0M0AJDDQzAC8rKzU1ASs1NQD//wAy/2MDdQXtAjYD7QAAARcFOwKo/3QALEAZAgArKxwcQQIvLXAtgC2vLb8tBS1ACAk0Lbj/wLMOETQtAC8rK101ASs1//8AMv9jA3UF7QI2A+0AAAEXBTsCqP90ACxAGQIAKyscHEECLy1wLYAtry2/LQUtQAgJNC24/8CzDhE0LQAvKytdNQErNf//ADL/YwN8BK8CNgPtAAABFwU3AZD+8gA0sQIruP/AQAsSGDQAKysAAEECL7j/gEASEBE0QC9/LwIPLz8vYC+/LwQvAC9dcSs1ASsrNf//ADL/YwN8BK8CNgPtAAABFwU3AZD+8gA0sQIruP/AQAsSGDQAKysAAEECL7j/gEASEBE0QC9/LwIPLz8vYC+/LwQvAC9dcSs1ASsrNf//ADL/YwN1BPwCNgPtAAABFwUuAZAEcAA2sgMCK7j/wEAhCRE0ACsrAABBAwIwQBIUNDAwQDACEDA/ME8wcDCAMAUwAC9dcSs1NQErKzU1//8AMv9jA3UE/AI2A+0AAAEXBS4BkARwADayAwIruP/AQCEJETQAKysAAEEDAjBAEhQ0MDBAMAIQMD8wTzBwMIAwBTAAL11xKzU1ASsrNTX//wAy/2MDfwWvAjYD7QAAARcFLwGQBSMAQrMEAwIvuP/AQBkJFTQALy8AAEEEAwIQNDA0QDQDLzSvNAI0uP/Asw8RNDS4/8CzDhE0NAAvKytdcTU1NQErKzU1Nf//ADL/YwN/Ba8CNgPtAAABFwUvAZAFIwBCswQDAi+4/8BAGQkVNAAvLwAAQQQDAhA0MDRANAMvNK80AjS4/8CzDxE0NLj/wLMOETQ0AC8rK11xNTU1ASsrNTU1AAH/uv+nBNkDsgA2ANZAMEkmATomAWUndScChyYBdCYBYyYBVCYBgyIBZiJ2IgKOIAEDaCB4IAIJFBkUKRQDL7gDDLMICCEpuAL9QA8PAgIPAAAPDzhZGgEaFR+4AvtAETYdRh0CJB0BAh0SHQICHR0huAMMtBsVAgsEvgLvADUDBAALAu8ALALrsxwbHx26AwcAIwLvtwATEBMgEwMTuQMNATmFAD9d7T8zzTk/7T/tETkBL87tMhkvX11dXe0SOV0RMxgvMy8SOT0vGBDtETkv7TEwAF1dX11dXV1dXV1dAV1dARQHJiMiBwYVFDMzMhcWFRAFBiEgETQ3Njc3BzUlFhcGFRQhMjc2NzY1NCMjIiY1NDc2NzYzMgTZDktrV2BYYFB7QjD+/cX+zf6KIh8pEvQBIBEaggFGeJ9TcZ416i4/NzxVZmeOAyAPYmFlXTcmCwhB/uyAYgEnaHJoTiF+PZYFC+eX9DAZMkYlH0EuQ3N9VGUAAf+6/x8EtQIFADYAykAcGDIBBzIBNiEBgyABZCB0IAJWIAFFIAEIEQEDMbsDDAADACcDDEAOCwQLAQMLAwsfADgXExu4AvtADBQaJBoCAhoBAhoaH7gDDEANGBMABRAFAi0FLQUBI7gC70AOQA8BMQ8BAA8QDyAPAw+4Aw5AEFkZAUgZATkZARkXGBsaGja7Au8AAQLrATmFAD/tMi8zzTk5XV1dP11dXe0ROTkvL10BL87tMhkvX11d7RI5EMAROTkYLy9dEO0Q7TEwAF9dXV1dXV1dAV0BIyAVFDMyFxYXFhUUBwYjIicmNTQ3NjcHNSUXBgcGFRQXFjMyNzY1NCcmJyYnJiMiNTQ3NjMzBLWv/stdOnAvEx24f/+5fKhAEi7qASMoGjE5rHSvj22GDwgqEUM2FnXqS1WvASUoIQ0GCQ8l3lQ7OEyjdIIkS3k9lhQrVmpKkD4qFhsvEggFAwMEA0LjRxf//wAy/6cE2QQtAjYDNQAAARcFNgDI/nAAHUATAQA/ED8CAD88JApBAQ8+Xz4CPgAvXTUBK101AP//ACT/HwS1A2UCNgM2AAABFwU2AMj9qAAfQBUBkDegN9A3Azg3Ny8vQQEPOT85AjkAL101AStdNQD///+6/3IB9AT1AjYD8wAAARcFNgAI/zgAMUAkAwAVFQAAQQNvF38XAi8XAQ8XHxc/F18XBBdAEBI0F0AmKjQXAC8rK11xcjUBKzUA////uv9yAfQE9QI2A/MAAAEXBTYACP84ADFAJAMAFRUAAEEDbxd/FwIvFwEPFx8XPxdfFwQXQBASNBdAJio0FwAvKytdcXI1ASs1AP//ADL/YwN1BLECNgPtAAABFwUtAVQEKgA4uQAC//FAGS0rKChBAjAsQCyPLAMvLD8sgCzgLPAsBSy4/8BACQ8RNCxAEhQ0LAAvKytdcTUBKzX//wAy/2MDdQSxAjYD7QAAARcFLQFUBCoAOLkAAv/xQBktKygoQQIwLEAsjywDLyw/LIAs4CzwLAUsuP/AQAkPETQsQBIUNCwALysrXXE1ASs1//8AMv6MBNkDsgI2AzUAAAEXBnABLP8QADi2AgHAPtA+Arj/wEAPPkAaEkECAbBBwEHQQQNBuP/AsxIVNEG4/8CzCQw0QQAvKytxNTUBK101Nf//ACT+TgS1AgUCNgM2AAABFwZwAUD+0gA7QA4CAQA5AQA5OxUNQQIBOrj/wLNKTDQ6uP/As0BHNDq4/8C2LTY00DoBOrgDDgA/XSsrKzU1AStdNTUA////uv6sAfQDpgI2BSkAAAEWBTEAAAAkQBACASMPEQEAQQIBEkAMFTQSuP/AswkKNBIALysrNTUBKzU1////uv6sAfQDpgI2BSkAAAEWBTEAAAAkQBACASMPEQEAQQIBEkAMFTQSuP/AswkKNBIALysrNTUBKzU1//8AMv6oBNkDsgI2AzUAAAEXBnEBVP84ADuzAwIBRrj/wLIJGDS4/+xADEY8GhJBAwIBH0EBQbj/wLMRFjRBuP/AswkPNEEALysrcTU1NQErKzU1NQD//wAk/k4EtQIFAjYDNgAAARcGcQFA/t4AObMDAgFBuP/AQBYKDjQAQTcVDUEDAgE6QEk1zzrfOgI6uP/AswkNNDq4Aw4APytyKzU1NQErKzU1NQAAAQBF/80GfwL7ACgAt0BACw8bDwIVAwALEAsCGgUXGRlAFxk0GRklASgqJUAeJTQlBikjAQ8hAf8hASohAQMPIT8hTyGvIb8hBQsFIyEnG7gC70AZE0ANIBwlNA0gFxk0DSASFjQPDR8NAhoDCbj/6EARCQw0tQnFCdUJAwkNJxkTACe5Au8AAgAv7TkvzRI5OV0rAF9eXSsrKwAaGBBN7RE5OV9eXV9xXXFxAS/NKwEQwDIRORkvKwERMzEwAF9eXV9eXSUHISInJicmNjc2NzY3Njc2NzYzMhcWFRQHJiMiBwYHBgcGBwYVFDMhBn/9+290GRwBAjUiGIRZWVFkRgQfISoZFgs9PTZBBDIkHmWYeF4FiHKlDhAgQLcoG0kwMC9vTgQdNjBHTS58TAVNNw40TToZHQAAAQBF/lcGfwHTABgASUAPiREBRwxXDGcMAwAXDxoUuAMMQAoFEhB2CwEJCxYOvwLvABAC6wAYABYC7wABAwYAP+05P+0ROTldEjkBL+0Q0MAyMTAAXV0BISInJicmNzY3NjcAITMVIyABBhUUMyEVBYL7b3QZHAECHh0cMXABtAKi7PL9V/4qdV4FiP5XDhAgPGJ1LEhkAVOu/pRqLR0J//8ARf/NBn8D6gI2BkAAAAEXBTkBLPzgADOxASm4/8C1Cxs00CkBuP9xQBYpKRMTQQFvLp8uAi5AFRc0LkAJDDQuAC8rK101AStxKzUA//8ARf5XBn8DmgI2BkEAAAEXBTkD6PyQACVAGgEAHiMFDkEBEB4vHl8eAx5AEhU0HkAJDTQeAC8rK101ASs1AAABACgBJQGAAdMAAwAeuQAA/8C2CRk0AAUBA7oC7wABAusAP+0BLxDGKzEwASE1IQGA/qgBWAElrgAAAv4pBCYB2gcWADEAOgDruQAq//BAKCEkNBQQCQ80CRQZFCkUAxY4MgwMMiooJQMPJwEmAycjQCEiGhsYHx+4/8BAHwcTNB8iQBhABxI0GBciFiMjETIxCREALwEkAy80QDS4/8BAHgwTNDQnKDgbHxgXIgUhABoBDQMaAwEsIxY4QAUBAbj/wEAWFRg0LwE/AQIBDB8NPw1fDX8Nnw0FDbgBV4UAL13NxF0rABDAGhjdwMDAEjkvX15dzBc5EMw5xCsAGhgQzV9eXQEvzS/NEjkvzdbdzSsBGhgQzSsBERI5ORI5GhgQ3l9eXTIyzTIROS8ROTEwXl0rKwEhIicGIyMiBhUUMyEVISImJyY3NjMzAyc0NxcUFxYXFAcnEzI1NCc3FhcWMzI2MzIVBzQjIgcGBzMyAdr+ZSIbI0VjW4ktApT9aTgYAQMpaY0fLxkXBx8FKw0XL1YHExYCFS0rtTptTjYmLEgQnkIFHB4eYjQNUw4PSj+jASYMPjcFHA0CETshCP7uMxcjHVYEMK2HATEdMQgAAAT+ogQmAY0HFgADAAcANwBBAaBAQygIGB80DxAWGjQPEAsRNBwWFQMTGgcFBgQDAQIALwYBDwYBHAMGBEAEQAkONAQgAAEAAAEcAwACQAJAIyQ0AgIvJhq4/8CzHCA0Grj/wEASCRU0Gh1AE0AHEjQTEh0RHkAeuP/AQGUPETQAHhAeIB4DQNAe4B7wHgMAHhAewB7QHgQAHhAe8B4DCQMeHi8MOBggJDQ4IR8+kCYBDyYfJgIPAyYfNy80QAwPPC88TzxfPAQ2BUA8JCoFJEATFzQkHgYEBQcCAAEDBQdAB7j/wEAYERc0BwEDFhoTEh0FHAAVAQ0DFREeMEAwuP/AQB0VGTRQMGAwcDADLzA/MAIwNx8IPwhfCH8InwgFCLgBV4UAL13NxF1xKwAaGBDdwC9fXl3MFznQzcYrABoYEM0REjk5ERI5ORDGKwAYEMYROTlfXl0BLxrNL8bN3F9eXV3NETk5KwEREjkYL19eXXFyXl0rARoYEM3W3c0rARoYEM0rKwEREjkYLysBGhgQzV9eXXHGKwEaGBDNX15dcRESOTkREjk5ERIXOTEwASsrKwEHJzcHByc3ASEiJicmNzYzMwMnNDcXFBcWFxQHJxMzNCcGBiMiNTQ3NjMyFxYVFSEiBwYVFDMhAyYnJiMiFRQzMgEPJE0jHiRNIwE4/Wk4GAEDKmmMIC4ZFwcfBSsNFy7zCg8uEFIUGjA5IBr+hFpHQiwClK4GEBMTHSoVBu5FKEVTRShF/TsOD0lAowEmDD43BRwNAhE7IQj+7hclBQ1CLjJBW0tSaDIwNA0BfRATFy4cAAAC/zAEJgDRBSoADgAXAHNACwoQOUI0EBAdJDQWuP/SQB0dLzQRFQ8MAAMKFUAVQAcRNBUVBg8ABhUXDBFAEbj/wEAVBxE0EQMAFwgFHwA/AF8AfwCfAAUAAC9d0N3UETnOKwAaGBDNEjkBL9TNETkvKwEaGBDNORE5ERI5MTABKysrEyMiJwYjIzUzMjc2NxYVJyYnBgcGBxYX0TFRSTFbSklMMD5QTjcMJBURDQwpQgQmPDxTRVkTdzsLNi8FEQwVLAgAAv8dBCYA5AabADEAOQDmQBQNKR0pAi4EIwkYHzITKCoRDTZANLj/6EARFhk0AAUQBSAFAx0FNAU2Aza4/+BALS47NDZABws0NjJALS4rACtACRg0KyoDAQMAMkALCQIDAB8bGBg2IRMQICU0Bbj/4EAsDxU0KAUTNAQ2LgArKgIFAS0hDQsLOBEPNh82LzYDQDYfDT8NXw1/DZ8NBQ24AVeFAC9dzV5dMjI5LxDU1s0XOREXOSsrABESORgvMwEv1NQy1DIazRESORDdzSsBERI5ORoYEM4rKwEREjk5X15dKwEaGBDNMhE5ORESORE5MTBfXl0TBycXFgcWFxYVFAcGIzQ3Njc2NyYnJiYjIgYjIicmNTQzMhcWFxcWFzY1JzQ3FxYXFgM0JwYHMjc25BccAQNLEQgLBWpyAQIJUTgdFBdCEgYXBBU1HhgkXSgfMBUXNxwVCwIyCmoWIkA7FSgGXFYOLH9+HxYeHyIZGAUKJB8rRjciKGILQyYhSH02Mk4jLW+lEDssAxgYBf4pEiksKAMGAAL/EgQmAO4GmQADACYA5kAXIhAVGDQAJCAkAhIFCCAVHDQHEBUcNCS4//BAdB4hNCEQHiE0AwEAAAEcAwACQAJAFRg0PwIBAAIBDAMCAh4KDhgiLzQOGBUYNAoOGg4CCg4THgUKJh8eEyMKAgAPAQEcAwEDQANACQ40AwMfJRsXHhMOER8EJc8fAYAfARAfUB+gHwMfHwU/BV8FfwWfBQUFuAFrhQAvXcRdcV3NORDEMjLdxDMREjkvKwAaGBDNX15dOTkBL83E1DLGETkREjleXSsrARESORgvX15dXSsBGhgQzV9eXTk5MTAAKysrKwFfXl0rEwcnNxMHIyInJjU0NzY3IiYjIgc2NzYzMhcWMzI2MwcGBwYVFCEzZihJJdRrHNpML3gMSAklCS5aExEkVCFfLCMNNg0SYkjtAWNYBXFIK0X+205cOV+NXwkwAxI1ESMLBgdTERZJj8QAA/+SBCYAbwUTAAMABwALAJa5AAX/8LMdLjQIuP/4QFMdLjQCCB0uNAsJLwoBDwoBCggHBS8GAQ8GAQYwBEAEUAQDBAgDASAAAQAAAQACAAgBHAMIBgQHBQACAQNAA0AdKDQDBQoICx8JPwlfCX8JnwkFCQAvXd05OdbGKwAaGBDNOTkQzTk5AS9fXl3WzV1xOTkQ1HLNXXE5ORDNXXE5OTEwACsrASsTByc3JwcnNxcHJzdvJUwjDiVMIz4lTCMEl0UoRSxFKEWoRShFAAAB/n4EJgGCBgQAMwETtQsgExk0CLj/6LMZITQHuP/wQD0ZIjQ7C0sLWwsDDxofGi8aAxkFLy8ALi4mLBwcGyAbQBIZNBsZQAYgIEAaHTQgQAkSNCAgDAMjJSZAJyYmuP/AQCMOFzQmJgwsAEAAQAkNNAAHEBcQJxADERAMABEBEwMRE0AMJrj/wEAxCA00Li8qIS8mJSYbgBwBHCERvxDPEN8QAwAQEBACECYDIQEGFR8KPwpfCn8KnwoFCrgBV4UAL13N1MDdOd7EXV0yEMRdORI5EMYQxBE5KwEYLxrdxl9eXRE5Xl0vKwEaGBDNEjkvKwERMxoYEM0yMhE5LysrARDAGhjdxisBERI5GS8REjkYLxI5GS8xMF9eXXErKysBIyInBiMjFAcGIyI1NDc2NxcGFRQzMjc2NTQnNxYXFhUzMjU0JzcXFhYzMjU0JzcWFxYVAYImMyskQTtoR2jJJgsZEzeiXEhZOSgXCQw7UQcTCAcpIxcsIBYFCwT4ISFvOyiSSV4bNAlxQ3ggJ0dVRmImHypKMhgjHS8rLxkqMTQkDh85AAgAMv5/CMoHFgAzAD8ARABQAG4AegB/AIsAxEBnWTopQC51aQt7b20EBlU0MD8uAS4uAQ8uHy4CLlEAjVpFJUQggGgPfIZkFhReSx4wIAEhIAEAIBAgAiBiGlU9MFdeTh5cWkQ3KStIJSMjJ0RCJ4NkFmZybQRraXuJDxF4CwkJDXt+DQAv3c4ROS8zzdAyzRDd3TIyzdAyMs0v3c4ROS8zzdAyzRDd3TLNM9AyzTMBL83UXV1dMs0z0DIyzdwyMs0Q3DLNMxDWzdRdXV0yzTPQMjLN3DIyzRDcMs0zMTABFAcGBxYVFAYjIicGISAnBiMiJjU0NyYnJjU0NzY3JjU0NjMyFzYhIBc2MzIWFRQHFhcWATQmIyIGFRQWMzI2JyYjIgcHNCYjIgYVFBYzMjYBNCcmJwYjIichBiMiJwYHBhUQATYzMhchNjMyFwABNCYjIgYVFBYzMjYnIRYzMiU0JiMiBhUUFjMyNgjKaGSzA043KCHw/u3+7/AhKDdOA7NkaGhkswNONygh8AETARHwISg3TgOzZGj+Ti4gIC8uISAu1tTv8dQ5LyAgLi4gIS4F21xYnx0jOCf8KCc4Ix2fWFwBUx0jOCcD2Cc4Ix0BU/68LiAhLi8gIC7W/HjU8e/9Ey4hIC4uICAvAsv23NaaDg83TRZ/fxZNNw8Omtbc9vbc1ZoODzdNFn9/Fk03Dw6a1dwCZyEuLyAgLi4zbW0TIC8uISAuLvzC28a+ixApKRCLvsbb/j/+2BApKRABKP5kIC4uICAvLg5tgCAuLiAhLi8ADAAy/skIewcTAA8AEgAVABgAGwAeACEAJAAsAC8AOwBHASJARQwbHBssGwMMGBwYLBgDJwwBJQEByRAByRoBFBokGgLGFgEbFisWAsYVAQgdAQcjAQktEAABAA8CL0AZFiwALCAsAhADLLj/wEA2Bw40LDAdBAwjBDxCIA8IAREDCAkGIUAVESkpQAcNNCk2QiMQDAEMDQokQBgUJwAnICcCEAMnuP/AQDMHDjQnOS0AIAgEP0UdDwQBEQMEBQIeQBkSKytABw00KzMARQFGIEUBEEUBMEWgReBFA0UAL11xcl5d3c4rABDAwBoY3cDAzV9eXTIQ3hc53c4rAF9eXRDAwBoY3cDAzV0yAS/dzisBEMDAGhjdwMDNX15dMhDeFzndzisBX15dEMDAGhjdwMDNXTIxMABeXV1dXV1dXV1dAV1dXQEBESEBASERAQERIQEBIREBESERIREhESEBEQEFFzcBBxcBJwcBASEBEQEhAQEnESUUBiMiJjU0NjMyFgc0JiMiBhUUFjMyNgh7/sr+SP7K/sn+Sf7JATcBtwE3ATYBuPpvASH+3wVG/t4BIv7e/bLNzPxGzc0DuszNA3D+dP3R/nUBiwIvAYwBF8z9639aWoCAWlp/S1Q7O1NTOztUAu7+yf5J/skBNwG3ATcBNwG3ATf+yf5J/Uf+3wVG/t8BIfq6ASH+30vNzQO7zc0Du83N/ioBi/51/dD+dQGLARjN/mbNWoCAWlp/f1o7U1M7O1RUAAH/tQQmAEsEvAALABpADwAGCR8DPwNfA38DnwMFAwAvXc0BL80xMBMUBiMiJjU0NjMyFkssHx8sLB8fLARxHywsHx8sLAAB/7YEJgBKBLoAAwAaQA8DAQMfAT8BXwF/AZ8BBQEAL13NAS/NMTATIzUzSpSUBCaUAAH+7QQmARIFPAASAGe5ABH/2kAmGSQ0Axg6QTQDGCQnNAMYFRg0ABEQESARAw4FEQMJCQABCQcLQAu4/8BAFxsfNF8LbwsCCxEDHwE/AV8BfwGfAQUBAC9d3cDNXSsAGhgQzTIBL805Lzk5X15dKysrKzEwASE1ISYnJiMiBzYzMhcWFxYXMwES/dsBhGM7JigbFiJUMEMdTjoUHAQmU04VDQNWMBVGNAQAAf9kBCYAnQZRAB8AwLkAHv/wQAkkKzQPIBEWNAW4//hAGRsgNBoPKg8CAwAPASQFEgg4PjQSABgZQBm4/8BAHxEWNBlACRA0GRkPAAEJAwAOCQkLBwMOGRgYEhsWQBa4/8BACQcQNBYfEgFAAbj/wEAbCQw0YAFwAYABwAHQAQUBHwk/CV8JfwmfCQUJuAEqhQAvXc5dKwAaGBDdMs4rABoYEM0SOS8zAS/d1M05GS8YEMRfXl05LysrARoYEM0ROSsxMAFfXl1fXSsrKxMjIhUUFxYVFAcmJycmNTQ3NjcmJyYjIgcnNjMyFxYXnTnVIQsMAhYiEWgqVB4HGBkbHxYlQzM5EBUFgEQfbCQfHSsHSHI8DW8fDAkfBRMjDV1JFCEA///+fv6RAYIAbwMXBksAAPprAA+2AApAQ0Q0CrgDBgA/KzUAAAH/nwQmAGEEXAAPAGJAHAUKAg0EBw8AQAcIAAIPD0AlWzQPDQIIBwoFQAe4/8BAFyWoNAcFBUAlKzQFHwI/Al8CfwKfAgUCAC9dxCsAGBDGKwAaGBDNETkQ3cYrABESOQEYLxnFGhjcGcURFzkxMBMGIyImIyIHJzYzMhYzMjdhHyYUPwwLDgUWGAs/EhkZBEkjFwYGHxcLAAACAAAEJgGNBecAGQAfAKlACw8YExc0DhgdITQDuP/WsxgcNAO4/9ZAHwkMNJIDogOyAwOTAqMCswIDAwACEAIgAgMJBRMeQB64/8BAExQZNB5ACQs0HgARGgAKCRccQBy4/8BAHg0TNBwaGRFAEUAMDjQRBAoJDR8EPwRfBH8EnwQFBLgBV4UAL13N3cUQxCsAGhgQ3dXGKwAaGBDNAS8z1N3FEMQrKwEaGBDNMTBfXl1fcXErKysrARQHBiMiJyYnJzcXFjMyNzY3IjU0NzYzMhUHJiMiFRQBjTpAVSAhGyQ+CDgeFmZZEyeEFxopSh4SJiEFGE5OVgcGDBURDQdhFTRhMSowmQJPHzAAAf/9BCYC9gWqABwAsrkAFf/wQGwXGzQPDQEOBg0PDwgPEjSfD78PAgMLDwEUDw8AHBlABA8XHxcvFwMVBRUYCg40FxUbEQ8IHwgvCAMVBAgQCg40BggbCw9ABw40DxELQAtADxI0C0AJDTRQC6ALsAsDCxsfAT8BXwF/AZ8BBQG4AVeFAC9dzcRxKysAGhgQ3c4rABESOTkrAF9eXRESOTkrAF9eXQEYLxrNzTI5GS9eXV9dKwERMzEwAV9eXSsBISImJyY3Njc2NjMyFRQHJiMiBwYHBgcGFRQzIQKS/b83GQEDLAWaJ14SKwYdHRkfECkxSDktAqIEJg8PVTMGWBZqVCEZOyQeKRklGwwOAAAB/oIEJgF7BaoAHACyuQAV//BAbBcbNA8NAQ4GDQ8PCA8SNJ8Pvw8CAwsPARQPDwAcGUAEDxcfFy8XAxUFFRgKDjQXFRsRDwgfCC8IAxUECBAKDjQGCBsLD0AHDjQPEQtAC0APEjQLQAkNNFALoAuwCwMLGx8BPwFfAX8BnwEFAbgBV4UAL13NxHErKwAaGBDdzisAERI5OSsAX15dERI5OSsAX15dARgvGs3NMjkZL15dX10rAREzMTABX15dKwEhIiYnJjc2NzY2MzIVFAcmIyIHBgcGBwYVFDMhARf9vzcZAQMsBZonXhIrBh0dGR8QKTFIOS0CogQmDw9VMwZYFmpUIRk7JB4pGSUbDA4AAAL/EAQmAPAGjQADABoAtbkABf/oQE8cIjQHIBEZNBMWGBs0FggZGzQYGBcaAwEPAgEuAwJAAAANFxdAFRc0FxUPGh8aAgkaCAwADQETAw0PCAIAAwFAAUALDjQBGA0MDAYXGhgYuP/AQBMJDjQYGgQRHwY/Bl8GfwafBgUGuAFXhQAvXc3U3c0rABESORI5GC8zEMYrABoYEM05OQEv3dZfXl3NENReXd3GKwEREjkYLxrNX15dOTkREjkZLzEwASsrKysTByc3ExQhIjU0NzY3FwYVFDMyNzY1NCc3FhVAJE0j/v7pySULGRM2olVGWzIoLAZlRShF/mvSkkxbGzQJb0V4HidJXzxhQ3UAAAYAMgAABJsGjAAIABEAGAAfACYALQDTQHsgJychHw8RAAYJEBIgEjASAxIZGRMHABEBEUETURMCEBMgEzATAxMAHwEfIS0oJSkpHCQODAEECx8XLxc/FwMXGxsWAw8MAQwfFj8WTxYDFl4cAQ8cLxwCHCQqJhoYCgUoKCYaBRAKIApQCgMKGBoIAhANBAErIx0VDgG4ASqFAC/d1t3WzREXOS/d1l3NENbNARkvMjIyMjLWGN3WXV3dXdZdzRE5L91d1t3AETkREjkvzRkQ1hjd1l3dXV3WXc0ROS/dXdbdwBE5ERI5L80xMCEhExEDAQEDERMBARcRByEnETcHESERJwkDFxEhETcHESERJzcXJwcXETMRBJv7l+TkAjQCNeSW/hn+GtKgA2mgaJb+M5YBfAE0/sz+zX4BayVY/vtY2qampUq2AQUCTAEDAjj9yP79/bQDTwHq/hbt/Yi3twJ47av82gMmqwF9/oMBNP7MjPzyAw6MYf0YAuhh39+qqlH9MgLO////WP6uAKj//gEXBloAAPqIAB6yAQABuP/AQA4MEDQfAQEQAZABvwEDAQAvXXErNTUAAv9YBCYAqAV2AAMABwB4QAoDBwUBBAYEAEAAuP/AQBEiJzQPAB8ALwADDQMABgJAArj//0AOFhs0AgAEAgYEBwUDQAO4/8BAGCInNE8DXwNvAwMDBx8BPwFfAX8BnwEFAQAvXc3EXSsAGhgQzREXOQEvKwEaGBDNxF9eXSsBGhgQzREXOTEwEwcnNxcnBxeoqKioaGhoaATOqKioqGhoaAD///9k/pEAnQC8AxcGUQAA+msAFEAKAAlAQ0Q0gAkBCbgDBgA/XSs1//8APv9sBpIFyAI2A7EAAAA3BS0EsAAAARcFLwPoBTwAP0AkBAMCAFVPIwBBAQBJRwkAQQQDAhBUL1RgVIBUBFQBSEALEzRIuP/AswkKNEgALysrNS9dNTU1ASs1KzU1NQD//wA+/2wGkgXIAjYDsQAAADcFLQSwAAABFwUvA+gFPAA/QCQEAwIAVU8jAEEBAElHCQBBBAMCEFQvVGBUgFQEVAFIQAsTNEi4/8CzCQo0SAAvKys1L101NTUBKzUrNTU1AP///7r/oQQ/BcgCNgOzAAAANwUtAlgAAAEXBS8BkAU8AD9AJAQDAgBKRBoAQQEAPDw2NkEEAwIQSS9JYEmASQRJAT1ACxM0Pbj/wLMJCjQ9AC8rKzUvXTU1NQErNSs1NTUA////uv+hBD8FyAI2A7MAAAA3BS0CWAAAARcFLwGQBTwAP0AkBAMCAEpEGgBBAQA8PDY2QQQDAhBJL0lgSYBJBEkBPUALEzQ9uP/AswkKND0ALysrNS9dNTU1ASs1KzU1NQD//wA+/2wIyQS5AjYDvQAAARcFLQVhAAAAJEARA49FAQBFQwUEQQNEQAsVNES4/8CzCQo0RAAvKys1AStdNf//AD7/bAjJBLkCNgO9AAABFwUtBWEAAAAkQBEDj0UBAEVDBQRBA0RACxU0RLj/wLMJCjREAC8rKzUBK101////uv+hBsUEuQI2A78AAAEXBS0C+AAAACBADgMANzUXBEEDNkALFTQ2uP/AswkKNDYALysrNQErNf///7r/oQbFBLkCNgO/AAABFwUtAvgAAAAgQA4DADc1FwRBAzZACxU0Nrj/wLMJCjQ2AC8rKzUBKzX//wAq/k4EIAXlAjYDzQAAARcFLQGQAGQAEUAJAgA+PjIrQQI9AC81ASs1AP//ADb+TgPjBR0CNgPOAAABFwUtAUAAKAAxsQI7uP/AsxwgNDu4/8BAFg4RNBA7AQA7OTI4QQJgOgE6QAsVNDoALytxNQErXSsrNQD///+6/6EDwwUdAjYDzwAAARcFLQEsAAAAIEAOAgAkJAkEQQIjQAsVNCO4/8CzCQo0IwAvKys1ASs1////uv+hAycFHQI2A9AAAAEXBS0AlgAAACBADgIPLy0JCUECLkALFTQuuP/AswkKNC4ALysrNQErNQADAHn+2ALoAzMAJAAoACwAy0AlCQsZCwIGIRYhAiosJ0APJR8lLyUDEAMlJQ0AIyMYGAEXFx8BALj/wEARCRU0AAEuAgYSBgIJAwYFBR+4AvNADkANFxwTGEAOFTQYGCMTuALvshwjALgC77IBQAG4/8C1CQ00AQEjuALvQA8KLCcqICUwJUAlAyUGBQq5AusBFoUAP9051l3A3cAQ7TkvKwAaGBBN7RDe7RI5LysAERI5ARgvGk3tOS8zX15dENbNKwEREjkYLxE5LzkvERI5L19eXRrN3s0xMF1dAQcGBwYHJzY3NjcnJjU0NzY3NjMyFxYXByYnJiMiBhUUFxYXNgMRIxEzMxEjAugwmGJxXR8NFhMZdDMoMD5QUUsxCyg0JQc9JzBoPC9fi8Bful9fAhmkJi82VxEuJyIbQiIoIFRkQ1YrCS6DGQUnNiIpJh0iQ/6B/mcBmf5nAAADACP+TgK0AtsAKgAuADIAskASiRgBCRQBhwcBABcBCQMXFwAfuAL6QAkgIAUANDAyQDK4/8BAEgkNNAAyASIDMiwuQC5AFyA0Lrj/wEAJCQk0LgkMDAkFuAL9tBASARIMuAMGQAksMTIrASAfFyS4Au+2DxsfGwIbF7wC7wAqAu8AAQLrAD/t/d5x7RDOMhDewN7APwEvXe3NORkvGBDOKysBGhgQ3c5fXl0rARoYEM0QwBE5L03tETkvX15dMTBdXV0BIyIHBhUUFhYVFAYHJicmJyY1NDY3NjcmJyYjIgcGByc2NzYzMhcWFxYXAREjESERIxECtHemfJ0tLwsOGhkwFyRrb1ixPw8zNCEeGCIuHiY/Vj4+MzUaM/7kXwEZXwElHydJQpaaQCY+MlNTnlGAGoCJIRoSQAwoFBAnHUstSi4mRCFP/p7+ZwGZ/mcBmQD//wA2AQoCGANxAhYDCAAAAAL/uv7xAfQDpgAMABsAYEAe2RIBjAYBfQYBWgZqBgIWFxQNGRkBAAgIAB8HAQcDuAMDswAdAQe6Au8ACAMEsxcQFgO7Au8AAQLrASyFAD/t3swzP+0BLxDQ/c5yETkZLxESORgvzM3OMjEwXV1dXQEhNSE0JyYnNxYXFhUDFAYjIicmNTQ3FwYVFBYB9P3GAfEcE0tOSBIbjzYmOCEbjBZejAElrnU/LFCjWzNNsv0wJjI3LzyRYyNWOBwtAAAC/7r+XAKQAuwAHgAtAKtAEAsbARUNJB0kLSQDFgQoKSm4/+BAFgkRNCkmAB8QHwIJAx8rFw0LFBUJBQu4AwNAEBkFFxcQAC8QGR4HKEApKCi4/8BAGA0RNAAoECjgKPAoBCgiaw17DQINEBUUEr4C7wAQAB4C7wAAABABLIUAL9DtEP3OMhE5XS/MXSsAETMaGBDOETkBLxDAETkvxDlN7RE51s0RORDUzF9eXc3OKwERMzEwX15dXl0BIyIHBgcGIyInJicmNwYjIzUzMhMXBhUUFzY3NjMzAxQGIyInJjU0NxcGFRQWApAoaDI/ExEKJx8bBQQIUJtaWtBlNDwWAjJMkSixNiY4IRuMFl6MASUkLl5Ra1pbVy6krgEZEq+YcTxNQV/84SYyNy88kWMjVjgcLQAAAgAv/3QBxgBkAAMABwA0QBkHBQYEAwEAAgIEBgRwBQEFnwcBBwcCAAMBAC/NOTkyL3HNcjk5AS8zL805ORDNOTkxMCUHJzcHByc3AcY2kDhDNpA4OGksaYdpLGkAAAMAO/7LAc//2AADAAcACwDfQDQBAwACAkAcIDQPAgERAwIAQABASFQ0AEA9RTQAAAYJCwgKCkAcIDQPCgERAwoIQAcFBgQEuP/AQB4cIDQABAERAwQGQAZAMkU0BkAYITQGBggKCAkLQAu4/8CzISY0C7j/wEAMEhc0CwsBBAYFB0AHuP/Asz5FNAe4/8BADBIXNNAHAQcHAgADAQAvzTk5My9xKysAGhgQzTk5ETMvKysAGhgQzTk5AS8zLysrARoYEM1fXl0rARESOTkaGBDNX15dKwEREjk5ETMYLysrARoYEM1fXl0rARESOTkxMAUHJzcFByc3BwcnNwEgOYI2ATQ5gjZUOYI2TGAkYFVgJGB8YCRgAAADABL+6QHkAHgAAwAHAAsBVkA8CwkKCApADRE0jwqfCgJ+CgFPCl8KbwoDCghAeQeJB5kHA2oHATkHSQdZBwMqBwEDDwcfBwISBQcFBgQEuP/AQEANETRABFAEAjEEAQAEEAQgBAMWAwQGQAZAGBs0BgYIhgGWAQJlAXUBAjYBRgFWAQMlAQEDAAEQAQISBQMBAgAAuP/AQEMNETSQAKAAAoEAAVAAYABwAAMAAgIIBAYPBQEFBwcBlgimCAJ1CIUIAkYIVghmCAM1CAEWCCYIAgoIDwkBEQMJC0ALuP/AQBUxNzQLQCIlNAsLAgAAAwERAwMBQAG4/8CzCQ40AQAvKwAaGBDNX15dOTkyLysrABoYEM1fXl05OV1dXV1dETMvzV05OQEvMy/NXV1dKwEREjk5X15dX11dXV0RMxgvKwEaGBDNX15dXV0rARESOTlfXl1fXV1dXRoYEM1dXV0rARESOTkxMCUHJzcTByc3JwcnNwHkSqRMgEqkTCBKpEw4fUB9/u59QH03fUB9AAIAsf98AUsARgADAAcAfEAxBwUGBARAJDc0BEAGBgMBAgAAQCQ3NAACBgQPBR8FLwUDIQMFB0AHQGKQNAdATVc0B7j/wLNISDQHuP/AQBAbIzQHBwIAgAOQA6ADAwMBAC/NcTk5My8rKysrABoYEM1fXl05OQEvzSsBERI5OTIYLxrNKwEREjk5MTAlByc3FwcnNwExIl4kdiJeJC5GGEaERhhGAAADAG3/cAGUADcAAwAHAAsBDkAWCwkKCApAFxk0CkAmLTQKCEAHBQYEBLj/wLMXGTQEuP/AQA0mLTQEQAYGCAMBAgAAuP/AsxcZNAC4/8BAGSYtNAACQAJALkM0AkAfKzQCQBIZNAICCAi4/8CzJkM0CLj/wEARFRk0CAQGBwUFQB8jNAUHQAe4/8CzLjM0B7j/wEAjGiM0DwcBNAMHBwEKCAkLCUAfIzQJC0ALQBUZNAsLAgABAwO4/8C0HyM0AwEAL80rABESOTkzGC8rABoYEM0rABESOTkRMxgvX15dKysAGhgQzSsAERI5OQEYLysrAREzGC8rKysBGhgQzSsrARESOTkRMxgvGs0rKwEREjk5GhgQzSsrARESOTkxMCUHJzcXByc3JwcnNwGUImYiRCJmIhciZiIaRh1GgUYdRhRGHUYA//8AFAElBn8G0QI2Ay0AAAEXBm4DcAb5ACNAFgMCAQg3NwcHQQMCAT82TzaANr82BDYAL101NTUBKzU1NQD//wAUASUHdgbRAjYDLgAAARcGbgNwBvkAI0AWAwIBAFBQHR1BAwIBP09PT4BPv08ETwAvXTU1NQErNTU1AP//AJsA3wFeBCUCNgKpAAABFwKY/6j+8QAjQAkBAA4HAgFBAQS4/8CzERI0BLj/wLMKCzQEAC8rKzUBKzUAAAH+2QTjASgF5gANACG8AAECnwAAAAcCn7MIAAgLuQKfAAQAL/3ewAEv7d7tMTATMwYGIyImJzMWFjMyNq17D5l/gJkPew5TRlFTBeZ9hoV+RENBAAEAAAEfArwBhwADABC1AwUAAmQAAC/tAS8QwDEwETUhFQK8AR9oaP//AJsBHwNXBCUCNgK9AAABFwZ2AJsAAABAuQAL/8CzDhE0Crj/wEAaDhE0UAhQCQIQCBAJkAiQCQQCAAkKBgFBAgm4/8C2Cw00AAkBCQAvXSs1ASs1XXErK/////UAogQOBx4CNgP7AAABFgU1AAAAS0AOAy0DLgMvEy0TLhMvBjC4/9izDBY0L7j/2LMMFjQuuP/YswwWNC24/9izDBY0LLj/2LMMFjQCuP/1tFtbdnZBASs1ACsrKysrcQD////1APIEzgceAjYD/AAAARYFNQAAADBACwAgCjAKUApgCgQKuP/AQAoJGjQKAC8QARACuP/1tEtLZmZBASs1Ll01AC4rXTX//wBT/yQEDgXLAjYD+wAAARcFNQDI+SwASLkAAv+7tmRkExNBAmi4/8CzEhY0aLj/gLIfNWi4/8CyOjVouP/AQBNBQjRAaAFQaNBoAjBoQGjwaANoAC5dcXIrKysrNQErNf//AEr/JATOBd4CNgP8AAABFwU1AGT5LABGQAkCD0tLJiZBAli4/8CzEhY0WLj/gLIfNVi4/8CyOjVYuP/AQBNBQjRAWAFQWNBYAjBYQFjwWANYAC5dcXIrKysrNQErNf//AFMAogQOBkICNgP7AAABFwU5AVT/OABXtqYyxjICAlS4/8CzISQ0VLj/wEAcFBU0AFQgVEBUAwBUYFQCIFQwVEBUcFSAVJBUBrj/2kATVE8yPEGjPqM/o0ADAl5ACRY0XgAuKzVdAStdcXIrKzVdAP//AEoA8gTOBkICNgP8AAABFwU5AeD/OABhtjAICxE0AkS4/8CzJSg0RLj/wLMgIjREuP/AsxcbNES4/8BACgsTNHBEgESQRAO4//FADEQ/FTBBlhWmFQIACrj/wEALCxo0CgJOQAlINE4ALis1Lis1XQErcSsrKys1KwD//wBTAKIEHAcgAjYD+wAAARcFNgIwAWMAYrECT7j/wEAQCgw0UE9gTwIOT08AAEECUbj/wLNDRTRRuP/Asz0+NFG4/8CyOzVRuP/AQB8JCzQAUTBRgFGgUQQQUXBRgFGQUc9RBWBRcFG/UQNRAC9dcXIrKysrNQErXSs1//8ASgDyBM4HIAI2A/wAAAEXBTYCMAFjAGexAkK4/8CyCg80uP/iQA5CPzAzQQMxAzIDMwMCQbj/wLNDRTRBuP/Asz0+NEG4/8CyOzVBuP/AQB8JCzQAQTBBgEGgQQQQQXBBgEGQQc9BBWBBcEG/QQNBAC9dcXIrKysrNV0BKys1AP//AFMAogQOByECNgP7AAABFwUtAk4GmgBxuQAC/8hAJlFRPDxBAhBScFKgUrBSwFIFAFJgUnBSAy9SP1JvUrBS4FLwUgZSuP/Aslg1Urj/wLJSNVK4/8CzSks0Urj/wLNERzRSuP/AskE1Urj/wLI8NVK4/8CzW/80UgAuKysrKysrK11xcjUBKzUA//8ASgDyBM4HIQI2A/wAAAEXBS0CTgaaAHJAKwJvPwEiPz8zM0ECEEJwQqBCsELAQgUAQmBCcEIDL0I/Qm9CsELgQvBCBkK4/8CyWDVCuP/AslI1Qrj/wLNKSzRCuP/As0RHNEK4/8CyQTVCuP/Asjw1Qrj/wLNb/zRCAC4rKysrKysrXXFyNQErXTX//wBTAKIEDgchAjYD+wAAARcGbgIwB0kAb0AOBAMCEFM/U1BTYFOgUwW4//FAGVNTAABBBAMCX1JvUuBSA1BSYFJwUvBSBFK4/8CzZf80Urj/wLNYWTRSuP/As0ZINFK4/8CzPD00Urj/wEAJGRw0UkASFjRSAC8rKysrKytdcTU1NQErXTU1NQD//wBKAPIEzgchAjYD/AAAARcGbgJYB0kAZrUEAwIPSQG4/8ZAGUlDMDNBBAMCX0JvQuBCA1BCYEJwQvBCBEK4/8CzZf80Qrj/wLNYWTRCuP/As0ZINEK4/8CzPD00Qrj/wEAJGRw0QkASFjRCAC8rKysrKytdcTU1NQErXTU1Nf//AFP+uwQOBcsCNgP7AAABFwZvAfT/0gAfswQDAk+4/8BADg8RNDBPQE8Cfk9PCwtBAStdKzU1NQD//wBK/rsEzgXeAjYD/AAAARcGbwK8/9IAIrIEAwK4/9JADj8/GBhBBAMCSkALETRKAC4rNTU1ASs1NTUAAQBxASUD4gW1ACQA7rUYIBIZNCC4/+CzFiE0Erj/wLMRFTQSuP+xQBgMEDQfCQEDCQkPFw8dHx0vHQMNBB0fIAG4/+C2CR80AQADA7j/wEARGBs0AyMPDx8PAhADDx8hIQe4AvuyC0ALuP/AQAsMETQACwETAwsWEbj/wLMWQDQRuP/asxIVNBG4/8C1DBE0ER0XuAL7QA1AABYQFkAWAxEDFh0BuP/gtgkfNAEAJh0vEMYyKwEYENRfXl0aTe0SOSsrKwEYEMZfXl0rARoYEE3tORkvABgvzV9eXdDNKwAZEMQyKwAaGRDNX15dGC8SOS9fXTEwASsrKysBByYjIgcGBwYjIicmJyYjIgcSERQHByMCJyYnJic2MzIXNjMyA+IKP0CcHQEHBw4MBgsXJWEfKKwCAh5LGjNHQHyfyH4oGZVYBSYQL9QJXAwOdStDFP78/f4eR00BPlqxgXOct4WFAAABAK0A3AOxBbUAHABrQAsNEA4UNA4QER80Fbj/6EAQDBE0AhUBFgQEQAkMNAQJGbgC/0AKQAYIDwAXARUFF7j/wLUMPDQXCQ+4AvuyEAkEuAL7sgAeCS8Q1u0Q1O0SOSsBX15dABgvL9YaTe0yxisxMAFfXl0rKysBFAYVByYjIgcnNjc2NzYTMxQWFRQHBgc2MzIXFgOxBiQwvvK3Q3pBSDMaSx4EMDNSWoiKLmIBqyGJIQRyKc6ZbYOqWgE1HnYeqMzfiw0NHwD//wAPAKIEDgchAjYD+wAAARYFNAAAABe0AwJTAwK4/7y0XFwqKkEBKzU1AC81NQD//wAPAPIEzgchAjYD/AAAARYFNAAAABe0AwJDAwK4/5e0TEwQEEEBKzU1AC81NQAAAAAAAAEAABVcAAEDjQwAAAkJTgADACT/jwADADf/2wADADz/2wADAfH/jwADAfn/jwADAfv/jwADAgH/jwADAgn/2wADAgr/2wADAg//2wAUABT/aAAkAAP/jwAkADf/aAAkADn/aAAkADr/tAAkADz/aAAkAFn/2wAkAFr/2wAkAFz/2wAkALb/aAApAA//HQApABH/HQApACT/jwAvAAP/tAAvADf/aAAvADn/aAAvADr/aAAvADz/aAAvAFz/tAAvALb/jwAzAAP/2wAzAA/++AAzABH++AAzACT/aAA1ADf/2wA1ADn/2wA1ADr/2wA1ADz/2wA3AAP/2wA3AA//HQA3ABD/jwA3ABH/HQA3AB3/HQA3AB7/HQA3ACT/aAA3ADL/2wA3AET/HQA3AEb/HQA3AEj/HQA3AEz/tAA3AFL/HQA3AFX/tAA3AFb/HQA3AFj/tAA3AFr/jwA3AFz/jwA5AA//RAA5ABD/jwA5ABH/RAA5AB3/tAA5AB7/tAA5ACT/aAA5AET/aAA5AEj/jwA5AEz/2wA5AFL/jwA5AFX/tAA5AFj/tAA5AFz/tAA6AA//jwA6ABD/2wA6ABH/jwA6AB3/2wA6AB7/2wA6ACT/tAA6AET/tAA6AEj/2wA6AEwAAAA6AFL/2wA6AFX/2wA6AFj/2wA6AFz/7gA8AAP/2wA8AA/++AA8ABD/RAA8ABH++AA8AB3/jwA8AB7/ewA8ACT/aAA8AET/aAA8AEj/RAA8AEz/tAA8AFL/RAA8AFP/aAA8AFT/RAA8AFj/jwA8AFn/jwBJAEn/2wBJALYAJQBVAA//jwBVABH/jwBVALYATABZAA//aABZABH/aABaAA//jwBaABH/jwBcAA//aABcABH/aAC1ALX/2wC2AAP/tAC2AFb/2wC2ALb/2wDEAi3/YADEAjb/YADEAkz/YADEAlH/vADEAlT/vAErAA//HwErABH/HwErAfgApAErAfn/RAErAfv/RAErAgH/RAErAhr/qAErAicAWAEsAfn/2wEsAfv/2wEsAgH/2wEsAgr/vgEsAg//vgEtAfn/xQEtAgr/vgEtAg//vgEvATL/4wEvAhz/2QEvAiT/yQEvAoz/4wEyAS7/4wEyAS//4wEyATH/4wEyATP/4wEyAhD/4wEyAhf/4wEyAiD/4wEyAiL/4wEyAib/4wEyAiv/4wEzATL/4wEzAhz/2QEzAiT/yQEzAoz/4wHxASz/1QHxAS3/xQHxAgX/1QHxAgn/aAHxAgr/aAHxAg//aAHxAhb/2wHxAh7/2wHxAiT/2wH1Agr/vgH2ASz/jQH2AS3/jQH2AS7/RgH2ATH/RgH2ATP/RgH2AfgAqgH2Afn/aAH2Afv/aAH2AgH/aAH2AgX/jQH2Ag3/ngH2AhL/aAH2AhP/tAH2Ahj/aAH2Ahr/tAH2Ahv/aAH2Ah3/aAH2AiD/RgH2AicAYgH2Ain/RgH3Agr/0QH3Ag//0QH5AAP/jwH5ALb/aAH5ASz/1QH5AS3/xQH5AgX/1QH5Agn/aAH5Agr/aAH5Ag//aAH5Ahb/2wH5Ah7/2wH5AiT/2wH7AAP/jwH7ASz/1QH7AgX/1QH7Agn/iQH7Agr/aAH7Ag//aAIAASz/wQIAAS3/jwIAAS7/5wIAAS//5wIAATH/5wIAATP/5wIAAgX/wQIAAhD/5wIAAhf/5wIAAhn/5wIAAh//5wIAAiD/5wIAAib/5wIAAin/5wIAAiv/5wIBAAP/jwIBASz/1QIBAgX/1QIBAgn/aAIBAgr/aAIBAg//aAIFAfn/2wIFAfv/1QIFAgH/2wIFAgr/vgIFAg//vgIHAAP/2wIHAA/++gIHABH++gIHAfn/aAIHAfv/aAIHAgH/aAIIATL/ngIIAoz/ngIJAAP/2wIJAA//HwIJABH/HwIJAB3/HwIJAB7/HwIJASz/2wIJAS3/2wIJAS7/HwIJATD/HwIJATH/HwIJATP/HwIJAfgAvAIJAfn/aAIJAfv/aAIJAgH/aAIJAgX/2wIJAg3/2wIJAhD/HwIJAhH/HwIJAhT/TgIJAhb/TgIJAhj/agIJAhr/tAIJAh3/agIJAh7/jwIJAiD/HwIJAiP/UAIJAiT/jwIJAiX/agIJAicAvAIJAij/TgIJAin/HwIJAir/TgIKAAP/2wIKAA/++gIKABD/RgIKABH++gIKAB3/jwIKAB7/jwIKASz/jQIKAS3/jQIKAS7/RgIKATH/RgIKATP/RgIKAfgAvAIKAfn/aAIKAfv/aAIKAgH/aAIKAgX/jQIKAg3/ngIKAhL/aAIKAhP/tAIKAhb/ngIKAhj/aAIKAhr/tAIKAhv/aAIKAh3/aAIKAiD/RgIKAicAeQIKAin/RgIMAS7/sgIMAS//sgIMATH/sgIMATP/sgIMAhD/sgIMAhn/2QIMAiD/sgIMAib/sgIMAin/sgIMAiv/sgINAgr/0QINAg//0QIPAAP/2wIPASz/jQIPAS3/jQIPAS7/RgIPATH/RgIPATP/RgIPAfgAqgIPAfn/aAIPAfv/aAIPAgH/aAIPAgX/jQIPAg3/ngIPAhL/aAIPAhP/tAIPAhj/aAIPAhr/tAIPAhv/aAIPAh3/aAIPAiD/RgIPAicAYgIPAin/RgIXAS7/dwIXAS//tAIXATH/dwIXATL/qgIXATP/dwIXAhD/dwIXAhL/2wIXAhb/qgIXAhj/2wIXAhn/ngIXAhr/2wIXAhv/2wIXAh7/qgIXAiD/dwIXAib/dwIXAin/dwIXAiv/dwIXAoz/qgIZAhz/2QIbAS7/5wIbAS//5wIbATH/5wIbATP/5wIbAhD/5wIbAhf/5wIbAhn/5wIbAh//5wIbAiD/5wIbAiL/5wIbAib/5wIbAin/5wIbAiv/5wIcAS7/4QIcAS//4QIcATH/4QIcATP/2wIcAhD/4QIcAh//4QIcAiD/4QIcAiL/0QIcAiP/zwIcAib/4QIcAin/4QIcAir/zwIcAiv/4QIfAS7/yQIfAS//yQIfATH/yQIfATP/yQIfAhD/yQIfAhf/yQIfAh//yQIfAiD/yQIfAiL/yQIfAin/yQIgATL/4wIgAhz/2QIgAiT/yQIgAoz/4wIhATL/4wIhAhz/2QIhAoz/4wIkAS7/yQIkAS//yQIkATH/yQIkATP/yQIkAhD/yQIkAhf/yQIkAiD/yQIkAiL/yQIkAib/yQIkAin/yQIkAiv/yQImATL/4wImAhz/2QImAiT/yQImAoz/4wIpATL/4wIpAhz/2QIpAiT/yQIpAoz/4wIrATL/4wIrAhz/2QIrAiT/yQIrAoz/4wIuAA//BgIuABH/BgIuAKn/dwIuAKr/dwIuALL/0wI0ALb/YAI1ALb/dwI6ALb/jQI6Aj4ARAI6AkH/6QI6AkUALQI6Akj/0wI6Akn/6QI6Akv/0wI6Akz/YAI6Ak3/pgI6Ak7/vAI6AlH/YAI6Alf/0wI6AloAFwI6Amz/0wI6Am3/6QI6Am4AFwI6AncALQI7Ajr/0wI7AkH/6QI7Akj/6QI7Akv/6QI7Akz/pAI7Ak3/0QI7Ak7/6QI7Ak//0wI7AlH/pAI7AlT/vAI7Alf/6QI7Aln/6QI7AmX/6QI7Am3/0wI8Ajr/vAI8Aj7/0wI8AkD/0wI8AkH/vAI8AkX/6QI8Akj/vAI8Akv/vAI8Akz/dwI8Ak3/vAI8Ak7/vAI8Ak//pgI8AlH/pAI8AlT/jQI8Aln/vAI8Al7/6QI8Amb/6QI8Amz/vAI8Am3/6QI8Am//6QI8AnH/vAI8Ann/6QI9AA//BgI9ABH/BgI9AKn/dwI9AKr/dwI9ALL/0wI9Ajr/dwI9Aj7/dwI9AkH/0wI9AkX/jQI9Akb/0QI9Akj/jQI9Akv/pAI9Aln/vAI9Alr/jQI9Alz/jQI9Al7/dwI9Al//dwI9AmL/jQI9AmX/jQI9Amb/jQI9Amf/jQI9Amj/dwI9Amr/jQI9Am3/dwI9AnX/jQI9Anb/jQI9Anj/jQI9Ann/dwI+Ak0AFwI+Ak7/0wI+AlH/ugI+AmEARAI+AmgAFwI+Am0ALQI/AkH/0wI/Amv/6QJAAkH/6QJAAkj/0wJAAkv/6QJAAkwAFwJAAk0ALQJAAlQALQJAAloAFwJAAl//5wJAAmj/6QJAAm3/6QJBAkX/6QJBAkj/6QJBAkv/6QJBAkz/0wJBAk3/6QJBAk7/6QJBAlH/0wJBAln/6QJEAkH/6QJEAkj/6QJEAkv/6QJEAk0AFwJEAk7/ugJFAk7/6QJFAlsAFwJFAm0AFwJGAk7/6QJGAlH/6QJGAloAFwJGAl8AFwJGAmgAFwJGAmsAFwJGAm0AFwJGAnH/6QJGAncAFwJIAjr/0wJIAj7/0wJIAkD/0wJIAkX/6QJIAk3/0wJIAk//pAJIAlH/0wJIAln/0wJIAl7/0wJIAmX/6QJIAm//6QJKAA/+fQJKABH+fQJKAB3/0wJKAB7/0wJKAKr/jQJKAjr/dwJKAj7/dwJKAkD/6QJKAkH/0wJKAkX/jQJKAkb/6QJKAkj/0wJKAkv/6QJKAkz/pAJKAk3/0wJKAk7/6QJKAk//pAJKAln/0wJKAlr/vAJKAl7/YAJKAl//pgJKAmj/pgJKAnf/0wJKAnn/vAJLAjr/0wJLAj7/0wJLAkH/6QJLAkX/vAJLAkb/6QJLAkj/0wJLAkz/vAJLAk3/vAJLAk//jQJLAlH/vAJLAlT/ugJLAlf/6QJLAloAFwJLAmAALQJLAnH/6QJMAA//HQJMABH/HQJMAKn/pgJMAKr/pgJMALL/0wJMAjr/vAJMAj7/vAJMAkAAFwJMAkH/6QJMAkX/0wJMAkj/pAJMAk7/vAJMAln/0wJMAlr/pAJMAlz/pgJMAl//jQJMAmL/pgJMAmT/pgJMAmX/pAJMAmb/pgJMAmj/YAJMAmn/pgJMAmr/jQJMAmv/jQJMAm3/jQJMAm//pgJMAnP/pgJMAnX/pgJMAnb/pgJMAnj/pgJMAnn/jQJNAA/+8AJNABH+8AJNAB3/0wJNAB7/0wJNAKn/pgJNAKr/pAJNALL/6QJNAjr/dwJNAj7/pAJNAkH/0wJNAkX/vAJNAkj/vAJNAk7/vAJNAlf/0wJNAln/0wJNAlv/0wJNAlz/jQJNAl3/pAJNAl7/YAJNAl//dwJNAmD/vAJNAmH/jQJNAmL/pAJNAmP/vAJNAmT/pAJNAmX/dwJNAmb/pAJNAmf/pAJNAmj/dwJNAmn/pAJNAmr/pAJNAmv/dwJNAm//pAJNAnD/pAJNAnL/pAJNAnP/pAJNAnj/pAJNAnn/dwJOAjr/0wJOAj7/vAJOAkX/vAJOAkz/jQJOAk3/pAJOAlH/0wJOAln/ugJOAmX/vAJPAkH/0wJPAkj/vAJPAkv/vAJPAk7/vAJPAlf/ugJPAmj/6QJPAm3/0wJQAkj/0wJQAloALQJTAloAFwJTAm0ALQJUALb/dwJUAln/vAJWALb/YAJWAjr/0wJWAj7/0wJWAkD/vAJWAkH/6QJWAkX/ugJWAkb/0wJWAkj/0wJWAkv/0wJWAkz/MwJWAk//pAJWAlH/YAJWAlf/6QJWAln/pAJXAj7/vAJXAkD/5wJXAkH/6QJXAkX/vAJXAk//ugJXAln/0wJXAl7/vAJXAmAAFwJXAmX/vAJXAmb/6QJXAnn/6QJYAjr/vAJYAj7/pgJYAkD/0wJYAkX/pAJYAkj/6QJYAkv/6QJYAkz/jQJYAk//pAJYAlH/vAJYAl7/pAJYAmX/pAJYAmb/6QJaAmH/6QJaAmz/0wJaAm3/6QJaAnH/0wJbAlr/0QJbAl7/pAJbAl//6QJbAmD/6QJbAmH/0wJbAmX/pAJbAmb/0wJbAmv/6QJbAm3/0wJbAm7/6QJbAm//vAJbAnH/vAJbAnT/vAJbAnf/6QJbAnn/0wJcAlr/6QJcAlv/6QJcAl7/6QJcAl//6QJcAmD/6QJcAmH/6QJcAmX/0QJcAmb/6QJcAmj/6QJcAmv/6QJcAmz/0wJcAm3/0wJcAm7/6QJcAnH/pAJcAnT/vAJcAnn/6QJdAA//BgJdABH/BgJdAlr/0wJdAl7/pAJdAl//0wJdAmH/6QJdAmX/0wJdAmj/0wJdAmv/0wJdAnn/6QJeAnT/0wJeAncAFwJfAlv/6QJfAl7/0wJfAmD/6QJfAmH/0wJfAmX/vAJfAmz/vAJfAm3/6QJfAm//0wJfAnH/vAJgAlsAFwJgAm0AFwJgAnH/6QJgAnQALQJhAlv/6QJhAl7/0wJhAl//6QJhAmH/6QJhAmX/6QJhAmj/6QJhAmv/6QJhAm3/6QJhAm7/6QJhAnH/vAJhAnT/0wJkAloALQJkAlsALQJkAl8AFwJkAmEAFwJkAmUAFwJkAmgAFwJkAmsAFwJkAmwAFwJkAm0AFwJkAncAFwJlAmgAFwJlAnH/0wJmAlv/6QJmAmH/6QJmAm0AFwJoAl7/0wJoAmD/6QJoAmH/6QJoAmX/0wJoAmz/0wJoAm3/6QJoAm//6QJoAnH/0wJqAl7/0QJqAmH/6QJqAmX/ugJqAmz/0wJqAm3/6QJqAm//6QJqAnH/0wJqAnn/6QJrAmAAFwJrAmgAFwJrAnH/6QJrAncAFwJsAA//HQJsABH/HQJsAlr/6QJsAl7/vAJsAl//6QJsAmAARAJsAmX/0wJsAmj/6QJsAmv/6QJsAm0AFwJtAA//MwJtABH/MwJtAKoAFwJtAlr/6QJtAlsAFwJtAl7/vAJtAl//6QJtAmAAFwJtAmX/0wJtAmb/6QJtAmj/5wJtAmr/6QJtAmv/6QJtAm7/6QJtAnf/6QJtAnn/6QJuAlv/6QJuAl7/0wJuAmX/0wJuAmz/0wJuAm3/6QJuAnH/0wJuAnn/6QJvAlr/6QJvAlv/6QJvAl//6QJvAmH/6QJvAmj/6QJvAmv/6QJvAmz/6QJvAm7/6QJvAnH/0wJwAl//6QJwAmH/6QJwAmj/6QJwAmv/6QJzAl//6QJzAmj/6QJzAm0AFwJ2Amz/YAJ2AnH/dwJ3Al7/0wJ3Al8AFwJ3AmH/6QJ3AmX/0wJ3AmgAFwJ3Amz/0wJ3Am//6QJ3Ann/6QJ4Al7/0wJ4AmD/6QJ4AmX/0wJ4Amb/6QJ4Amz/0wJ4Am//6QJ4AnH/0wKGAA//MwKGABH/MwKIAA//BgKIABH/BgKIAB3/0wKIAB7/0wKIAKn/YAKIAKr/YAKIALL/0wKMAS7/4wKMATH/4wKMATP/4wKMAhD/4wKMAhf/4wKMAiD/4wKMAiL/4wKMAib/4wKMAiv/4wAAAEYDTgAAAAMAAAAAAP4AAAAAAAMAAAABAAoBPgAAAAMAAAACAA4F3gAAAAMAAAADAF4FwAAAAAMAAAAEAAoBPgAAAAMAAAAFABgF7gAAAAMAAAAGAA4GHgAAAAMAAAAHAMQGLAAAAAMAAAAIACYHfAAAAAMAAAAJAIoNpAAAAAMAAAAKBMIA/gAAAAMAAAALAGIOLgAAAAMAAAAMAGYOkAAAAAMAAAANBrQG8AAAAAMAAAAOAFwO9gABAAAAAAAAAH8PUgABAAAAAAABAAUP8QABAAAAAAACAAcSQQABAAAAAAADAC8SMgABAAAAAAAEAAUP8QABAAAAAAAFAAwSSQABAAAAAAAGAAcSYQABAAAAAAAHAGISaAABAAAAAAAIABMTEAABAAAAAAAJAEUWJAABAAAAAAAKAmEP0QABAAAAAAALADEWaQABAAAAAAAMADMWmgABAAAAAAANA1oSygABAAAAAAAOAC4WzQADAAEEAwACAAwW+wADAAEEBQACABAXCwADAAEEBgACAAwXGwADAAEEBwACABAXJwADAAEECAACABAXNwADAAEECQAAAP4AAAADAAEECQABAAoBPgADAAEECQACAA4F3gADAAEECQADAF4FwAADAAEECQAEAAoBPgADAAEECQAFABgF7gADAAEECQAGAA4GHgADAAEECQAHAMQGLAADAAEECQAIACYHfAADAAEECQAJAIoNpAADAAEECQAKBMIA/gADAAEECQALAGIOLgADAAEECQAMAGYOkAADAAEECQANBrQG8AADAAEECQAOAFwO9gADAAEECgACAAwW+wADAAEECwACABAXRwADAAEEDAACAAwW+wADAAEEDgACAAwXVwADAAEEEAACAA4XZwADAAEEEwACABIXdQADAAEEFAACAAwW+wADAAEEFQACABAW+wADAAEEFgACAAwW+wADAAEEGQACAA4XhwADAAEEGwACABAXVwADAAEEHQACAAwW+wADAAEEHwACAAwW+wADAAEEJAACAA4XlQADAAEEKgACAA4XowADAAEELQACAA4XsQADAAEICgACAAwW+wADAAEIFgACAAwW+wADAAEMCgACAAwW+wADAAEMDAACAAwW+wBUAHkAcABlAGYAYQBjAGUAIACpACAAVABoAGUAIABNAG8AbgBvAHQAeQBwAGUAIABDAG8AcgBwAG8AcgBhAHQAaQBvAG4AIABwAGwAYwAuACAARABhAHQAYQAgAKkAIABUAGgAZQAgAE0AbwBuAG8AdAB5AHAAZQAgAEMAbwByAHAAbwByAGEAdABpAG8AbgAgAHAAbABjAC8AVAB5AHAAZQAgAFMAbwBsAHUAdABpAG8AbgBzACAASQBuAGMALgAgADEAOQA5ADAALQAxADkAOQAyAC4AIABBAGwAbAAgAFIAaQBnAGgAdABzACAAUgBlAHMAZQByAHYAZQBkAEMAbwBuAHQAZQBtAHAAbwByAGEAcgB5ACAAcwBhAG4AcwAgAHMAZQByAGkAZgAgAGQAZQBzAGkAZwBuACwAIABBAHIAaQBhAGwAIABjAG8AbgB0AGEAaQBuAHMAIABtAG8AcgBlACAAaAB1AG0AYQBuAGkAcwB0ACAAYwBoAGEAcgBhAGMAdABlAHIAaQBzAHQAaQBjAHMAIAB0AGgAYQBuACAAbQBhAG4AeQAgAG8AZgAgAGkAdABzACAAcAByAGUAZABlAGMAZQBzAHMAbwByAHMAIABhAG4AZAAgAGEAcwAgAHMAdQBjAGgAIABpAHMAIABtAG8AcgBlACAAaQBuACAAdAB1AG4AZQAgAHcAaQB0AGgAIAB0AGgAZQAgAG0AbwBvAGQAIABvAGYAIAB0AGgAZQAgAGwAYQBzAHQAIABkAGUAYwBhAGQAZQBzACAAbwBmACAAdABoAGUAIAB0AHcAZQBuAHQAaQBlAHQAaAAgAGMAZQBuAHQAdQByAHkALgAgACAAVABoAGUAIABvAHYAZQByAGEAbABsACAAdAByAGUAYQB0AG0AZQBuAHQAIABvAGYAIABjAHUAcgB2AGUAcwAgAGkAcwAgAHMAbwBmAHQAZQByACAAYQBuAGQAIABmAHUAbABsAGUAcgAgAHQAaABhAG4AIABpAG4AIABtAG8AcwB0ACAAaQBuAGQAdQBzAHQAcgBpAGEAbAAgAHMAdAB5AGwAZQAgAHMAYQBuAHMAIABzAGUAcgBpAGYAIABmAGEAYwBlAHMALgAgACAAVABlAHIAbQBpAG4AYQBsACAAcwB0AHIAbwBrAGUAcwAgAGEAcgBlACAAYwB1AHQAIABvAG4AIAB0AGgAZQAgAGQAaQBhAGcAbwBuAGEAbAAgAHcAaABpAGMAaAAgAGgAZQBsAHAAcwAgAHQAbwAgAGcAaQB2AGUAIAB0AGgAZQAgAGYAYQBjAGUAIABhACAAbABlAHMAcwAgAG0AZQBjAGgAYQBuAGkAYwBhAGwAIABhAHAAcABlAGEAcgBhAG4AYwBlAC4AIAAgAEEAcgBpAGEAbAAgAGkAcwAgAGEAbgAgAGUAeAB0AHIAZQBtAGUAbAB5ACAAdgBlAHIAcwBhAHQAaQBsAGUAIABmAGEAbQBpAGwAeQAgAG8AZgAgAHQAeQBwAGUAZgBhAGMAZQBzACAAdwBoAGkAYwBoACAAYwBhAG4AIABiAGUAIAB1AHMAZQBkACAAdwBpAHQAaAAgAGUAcQB1AGEAbAAgAHMAdQBjAGMAZQBzAHMAIABmAG8AcgAgAHQAZQB4AHQAIABzAGUAdAB0AGkAbgBnACAAaQBuACAAcgBlAHAAbwByAHQAcwAsACAAcAByAGUAcwBlAG4AdABhAHQAaQBvAG4AcwAsACAAbQBhAGcAYQB6AGkAbgBlAHMAIABlAHQAYwAsACAAYQBuAGQAIABmAG8AcgAgAGQAaQBzAHAAbABhAHkAIAB1AHMAZQAgAGkAbgAgAG4AZQB3AHMAcABhAHAAZQByAHMALAAgAGEAZAB2AGUAcgB0AGkAcwBpAG4AZwAgAGEAbgBkACAAcAByAG8AbQBvAHQAaQBvAG4AcwAuAE0AbwBuAG8AdAB5AHAAZQA6AEEAcgBpAGEAbAAgAFIAZQBnAHUAbABhAHIAOgBWAGUAcgBzAGkAbwBuACAAMwAuADAAMAAgACgATQBpAGMAcgBvAHMAbwBmAHQAKQBBAHIAaQBhAGwATQBUAEEAcgBpAGEAbACuACAAVAByAGEAZABlAG0AYQByAGsAIABvAGYAIABUAGgAZQAgAE0AbwBuAG8AdAB5AHAAZQAgAEMAbwByAHAAbwByAGEAdABpAG8AbgAgAHAAbABjACAAcgBlAGcAaQBzAHQAZQByAGUAZAAgAGkAbgAgAHQAaABlACAAVQBTACAAUABhAHQAIAAmACAAVABNACAATwBmAGYALgAgAGEAbgBkACAAZQBsAHMAZQB3AGgAZQByAGUALgBOAE8AVABJAEYASQBDAEEAVABJAE8ATgAgAE8ARgAgAEwASQBDAEUATgBTAEUAIABBAEcAUgBFAEUATQBFAE4AVAANAAoADQAKAFQAaABpAHMAIAB0AHkAcABlAGYAYQBjAGUAIABpAHMAIAB0AGgAZQAgAHAAcgBvAHAAZQByAHQAeQAgAG8AZgAgAE0AbwBuAG8AdAB5AHAAZQAgAFQAeQBwAG8AZwByAGEAcABoAHkAIABhAG4AZAAgAGkAdABzACAAdQBzAGUAIABiAHkAIAB5AG8AdQAgAGkAcwAgAGMAbwB2AGUAcgBlAGQAIAB1AG4AZABlAHIAIAB0AGgAZQAgAHQAZQByAG0AcwAgAG8AZgAgAGEAIABsAGkAYwBlAG4AcwBlACAAYQBnAHIAZQBlAG0AZQBuAHQALgAgAFkAbwB1ACAAaABhAHYAZQAgAG8AYgB0AGEAaQBuAGUAZAAgAHQAaABpAHMAIAB0AHkAcABlAGYAYQBjAGUAIABzAG8AZgB0AHcAYQByAGUAIABlAGkAdABoAGUAcgAgAGQAaQByAGUAYwB0AGwAeQAgAGYAcgBvAG0AIABNAG8AbgBvAHQAeQBwAGUAIABvAHIAIAB0AG8AZwBlAHQAaABlAHIAIAB3AGkAdABoACAAcwBvAGYAdAB3AGEAcgBlACAAZABpAHMAdAByAGkAYgB1AHQAZQBkACAAYgB5ACAAbwBuAGUAIABvAGYAIABNAG8AbgBvAHQAeQBwAGUAJwBzACAAbABpAGMAZQBuAHMAZQBlAHMALgANAAoADQAKAFQAaABpAHMAIABzAG8AZgB0AHcAYQByAGUAIABpAHMAIABhACAAdgBhAGwAdQBhAGIAbABlACAAYQBzAHMAZQB0ACAAbwBmACAATQBvAG4AbwB0AHkAcABlAC4AIABVAG4AbABlAHMAcwAgAHkAbwB1ACAAaABhAHYAZQAgAGUAbgB0AGUAcgBlAGQAIABpAG4AdABvACAAYQAgAHMAcABlAGMAaQBmAGkAYwAgAGwAaQBjAGUAbgBzAGUAIABhAGcAcgBlAGUAbQBlAG4AdAAgAGcAcgBhAG4AdABpAG4AZwAgAHkAbwB1ACAAYQBkAGQAaQB0AGkAbwBuAGEAbAAgAHIAaQBnAGgAdABzACwAIAB5AG8AdQByACAAdQBzAGUAIABvAGYAIAB0AGgAaQBzACAAcwBvAGYAdAB3AGEAcgBlACAAaQBzACAAbABpAG0AaQB0AGUAZAAgAHQAbwAgAHkAbwB1AHIAIAB3AG8AcgBrAHMAdABhAHQAaQBvAG4AIABmAG8AcgAgAHkAbwB1AHIAIABvAHcAbgAgAHAAdQBiAGwAaQBzAGgAaQBuAGcAIAB1AHMAZQAuACAAWQBvAHUAIABtAGEAeQAgAG4AbwB0ACAAYwBvAHAAeQAgAG8AcgAgAGQAaQBzAHQAcgBpAGIAdQB0AGUAIAB0AGgAaQBzACAAcwBvAGYAdAB3AGEAcgBlAC4ADQAKAA0ACgBJAGYAIAB5AG8AdQAgAGgAYQB2AGUAIABhAG4AeQAgAHEAdQBlAHMAdABpAG8AbgAgAGMAbwBuAGMAZQByAG4AaQBuAGcAIAB5AG8AdQByACAAcgBpAGcAaAB0AHMAIAB5AG8AdQAgAHMAaABvAHUAbABkACAAcgBlAHYAaQBlAHcAIAB0AGgAZQAgAGwAaQBjAGUAbgBzAGUAIABhAGcAcgBlAGUAbQBlAG4AdAAgAHkAbwB1ACAAcgBlAGMAZQBpAHYAZQBkACAAdwBpAHQAaAAgAHQAaABlACAAcwBvAGYAdAB3AGEAcgBlACAAbwByACAAYwBvAG4AdABhAGMAdAAgAE0AbwBuAG8AdAB5AHAAZQAgAGYAbwByACAAYQAgAGMAbwBwAHkAIABvAGYAIAB0AGgAZQAgAGwAaQBjAGUAbgBzAGUAIABhAGcAcgBlAGUAbQBlAG4AdAAuAA0ACgANAAoATQBvAG4AbwB0AHkAcABlACAAYwBhAG4AIABiAGUAIABjAG8AbgB0AGEAYwB0AGUAZAAgAGEAdAA6AA0ACgANAAoAVQBTAEEAIAAtACAAKAA4ADQANwApACAANwAxADgALQAwADQAMAAwAAkACQBVAEsAIAAtACAAMAAxADEANAA0ACAAMAAxADcAMwA3ACAANwA2ADUAOQA1ADkADQAKAGgAdAB0AHAAOgAvAC8AdwB3AHcALgBtAG8AbgBvAHQAeQBwAGUALgBjAG8AbQBNAG8AbgBvAHQAeQBwAGUAIABUAHkAcABlACAARAByAGEAdwBpAG4AZwAgAE8AZgBmAGkAYwBlACAALQAgAFIAbwBiAGkAbgAgAE4AaQBjAGgAbwBsAGEAcwAsACAAUABhAHQAcgBpAGMAaQBhACAAUwBhAHUAbgBkAGUAcgBzACAAMQA5ADgAMgBoAHQAdABwADoALwAvAHcAdwB3AC4AbQBvAG4AbwB0AHkAcABlAC4AYwBvAG0ALwBoAHQAbQBsAC8AbQB0AG4AYQBtAGUALwBtAHMAXwBhAHIAaQBhAGwALgBoAHQAbQBsAGgAdAB0AHAAOgAvAC8AdwB3AHcALgBtAG8AbgBvAHQAeQBwAGUALgBjAG8AbQAvAGgAdABtAGwALwBtAHQAbgBhAG0AZQAvAG0AcwBfAHcAZQBsAGMAbwBtAGUALgBoAHQAbQBsAGgAdAB0AHAAOgAvAC8AdwB3AHcALgBtAG8AbgBvAHQAeQBwAGUALgBjAG8AbQAvAGgAdABtAGwALwB0AHkAcABlAC8AbABpAGMAZQBuAHMAZQAuAGgAdABtAGxUeXBlZmFjZSCpIFRoZSBNb25vdHlwZSBDb3Jwb3JhdGlvbiBwbGMuIERhdGEgqSBUaGUgTW9ub3R5cGUgQ29ycG9yYXRpb24gcGxjL1R5cGUgU29sdXRpb25zIEluYy4gMTk5MC0xOTkyLiBBbGwgUmlnaHRzIFJlc2VydmVkQ29udGVtcG9yYXJ5IHNhbnMgc2VyaWYgZGVzaWduLCBBcmlhbCBjb250YWlucyBtb3JlIGh1bWFuaXN0IGNoYXJhY3RlcmlzdGljcyB0aGFuIG1hbnkgb2YgaXRzIHByZWRlY2Vzc29ycyBhbmQgYXMgc3VjaCBpcyBtb3JlIGluIHR1bmUgd2l0aCB0aGUgbW9vZCBvZiB0aGUgbGFzdCBkZWNhZGVzIG9mIHRoZSB0d2VudGlldGggY2VudHVyeS4gIFRoZSBvdmVyYWxsIHRyZWF0bWVudCBvZiBjdXJ2ZXMgaXMgc29mdGVyIGFuZCBmdWxsZXIgdGhhbiBpbiBtb3N0IGluZHVzdHJpYWwgc3R5bGUgc2FucyBzZXJpZiBmYWNlcy4gIFRlcm1pbmFsIHN0cm9rZXMgYXJlIGN1dCBvbiB0aGUgZGlhZ29uYWwgd2hpY2ggaGVscHMgdG8gZ2l2ZSB0aGUgZmFjZSBhIGxlc3MgbWVjaGFuaWNhbCBhcHBlYXJhbmNlLiAgQXJpYWwgaXMgYW4gZXh0cmVtZWx5IHZlcnNhdGlsZSBmYW1pbHkgb2YgdHlwZWZhY2VzIHdoaWNoIGNhbiBiZSB1c2VkIHdpdGggZXF1YWwgc3VjY2VzcyBmb3IgdGV4dCBzZXR0aW5nIGluIHJlcG9ydHMsIHByZXNlbnRhdGlvbnMsIG1hZ2F6aW5lcyBldGMsIGFuZCBmb3IgZGlzcGxheSB1c2UgaW4gbmV3c3BhcGVycywgYWR2ZXJ0aXNpbmcgYW5kIHByb21vdGlvbnMuTW9ub3R5cGU6QXJpYWwgUmVndWxhcjpWZXJzaW9uIDMuMDAgKE1pY3Jvc29mdClBcmlhbE1UQXJpYWyoIFRyYWRlbWFyayBvZiBUaGUgTW9ub3R5cGUgQ29ycG9yYXRpb24gcGxjIHJlZ2lzdGVyZWQgaW4gdGhlIFVTIFBhdCAmIFRNIE9mZi4gYW5kIGVsc2V3aGVyZS5OT1RJRklDQVRJT04gT0YgTElDRU5TRSBBR1JFRU1FTlQNCg0KVGhpcyB0eXBlZmFjZSBpcyB0aGUgcHJvcGVydHkgb2YgTW9ub3R5cGUgVHlwb2dyYXBoeSBhbmQgaXRzIHVzZSBieSB5b3UgaXMgY292ZXJlZCB1bmRlciB0aGUgdGVybXMgb2YgYSBsaWNlbnNlIGFncmVlbWVudC4gWW91IGhhdmUgb2J0YWluZWQgdGhpcyB0eXBlZmFjZSBzb2Z0d2FyZSBlaXRoZXIgZGlyZWN0bHkgZnJvbSBNb25vdHlwZSBvciB0b2dldGhlciB3aXRoIHNvZnR3YXJlIGRpc3RyaWJ1dGVkIGJ5IG9uZSBvZiBNb25vdHlwZSdzIGxpY2Vuc2Vlcy4NCg0KVGhpcyBzb2Z0d2FyZSBpcyBhIHZhbHVhYmxlIGFzc2V0IG9mIE1vbm90eXBlLiBVbmxlc3MgeW91IGhhdmUgZW50ZXJlZCBpbnRvIGEgc3BlY2lmaWMgbGljZW5zZSBhZ3JlZW1lbnQgZ3JhbnRpbmcgeW91IGFkZGl0aW9uYWwgcmlnaHRzLCB5b3VyIHVzZSBvZiB0aGlzIHNvZnR3YXJlIGlzIGxpbWl0ZWQgdG8geW91ciB3b3Jrc3RhdGlvbiBmb3IgeW91ciBvd24gcHVibGlzaGluZyB1c2UuIFlvdSBtYXkgbm90IGNvcHkgb3IgZGlzdHJpYnV0ZSB0aGlzIHNvZnR3YXJlLg0KDQpJZiB5b3UgaGF2ZSBhbnkgcXVlc3Rpb24gY29uY2VybmluZyB5b3VyIHJpZ2h0cyB5b3Ugc2hvdWxkIHJldmlldyB0aGUgbGljZW5zZSBhZ3JlZW1lbnQgeW91IHJlY2VpdmVkIHdpdGggdGhlIHNvZnR3YXJlIG9yIGNvbnRhY3QgTW9ub3R5cGUgZm9yIGEgY29weSBvZiB0aGUgbGljZW5zZSBhZ3JlZW1lbnQuDQoNCk1vbm90eXBlIGNhbiBiZSBjb250YWN0ZWQgYXQ6DQoNClVTQSAtICg4NDcpIDcxOC0wNDAwCQlVSyAtIDAxMTQ0IDAxNzM3IDc2NTk1OQ0KaHR0cDovL3d3dy5tb25vdHlwZS5jb21Nb25vdHlwZSBUeXBlIERyYXdpbmcgT2ZmaWNlIC0gUm9iaW4gTmljaG9sYXMsIFBhdHJpY2lhIFNhdW5kZXJzIDE5ODJodHRwOi8vd3d3Lm1vbm90eXBlLmNvbS9odG1sL210bmFtZS9tc19hcmlhbC5odG1saHR0cDovL3d3dy5tb25vdHlwZS5jb20vaHRtbC9tdG5hbWUvbXNfd2VsY29tZS5odG1saHR0cDovL3d3dy5tb25vdHlwZS5jb20vaHRtbC90eXBlL2xpY2Vuc2UuaHRtbABOAG8AcgBtAGEAbABuAHkAbwBiAHkBDQBlAGoAbgDpAG4AbwByAG0AYQBsAFMAdABhAG4AZABhAHIAZAOaA7EDvQO/A70DuQO6A6wATgBvAHIAbQBhAGEAbABpAE4AbwByAG0A4QBsAG4AZQBOAG8AcgBtAGEAbABlAFMAdABhAG4AZABhAGEAcgBkBB4EMQRLBEcEPQRLBDkATgBhAHYAYQBkAG4AbwB0AGgBsAGhAwAAbgBnAEEAcgByAHUAbgB0AGEAAAAAAgAAAAAAAP8nAJYAAAAAAAAAAAAAAAAAAAAAAAAAAAaKAAABAgEDAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGAAYQBiAGMAZABlAGYAZwBoAGkAagBrAGwAbQBuAG8AcABxAHIAcwB0AHUAdgB3AHgAeQB6AHsAfAB9AH4AfwCAAIEAggCDAIQAhQCGAIcAiACJAIoAiwCMAI0AjgCPAJAAkQCSAJMAlACVAJYBBACYAJkAmgEFAJwAnQCeAQYAoAChAKIAowCkAKUApgCnAKgAqQCqAKsArQCuAK8AsACxALIAswC0ALUAtgC3ALgAuQC6ALsAvAEHAL4AvwDAAMEAwgDDAMQAxQDGAMcAyADJAMoAywDMAM0AzgDPANAA0QDTANQA1QDWANcA2ADZANoA2wDcAN0A3gDfAOAA4QDiAOMA5ADlAOYA5wDoAOkA6gDrAOwA7QDuAO8A8ADxAPIA8wD0APUA9gD3APgA+QD6APsA/AD9AP4A/wEAAQgBCQEKAQsBDAENAQ4BDwEQAREBEgETARQBFQEWARcBGAEZARoBGwEcAR0BHgEfASABIQEiASMBJAElASYBJwEoASkBKgErASwBLQEuAS8BMAExATIBMwE0ATUBNgE3ATgBOQE6ATsBPAE9AT4BPwFAAUEBQgFDAUQBRQFGAUcBSAFJAUoBSwFMAU0BTgFPAVABUQFSAVMBVAFVAVYBVwFYAVkBWgFbAVwBXQFeAV8BYAFhAWIBYwFkAWUBZgFnAWgBaQFqAWsBbAFtAW4BbwFwAXEBcgFzAXQBdQF2AXcBeAF5AXoBewF8AX0BfgF/AYABgQGCAYMBhAGFAYYBhwGIAYkBigGLAYwBjQGOAY8BkAGRAZIBkwGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwG4AbkBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgHHAcgByQHKAcsBzAHNAc4BzwHQAdEB0gHTAdQB1QHWAdcB2AHZAdoB2wHcAd0B3gHfAeAB4QHiAeMB5AHlAeYB5wHoAekB6gHrAewB7QHuAe8B8AHxAfIB8wH0AfUB9gH3AfgB+QH6AfsB/AH9Af4B/wIAAgECAgIDAgQCBQIGAgcCCAIJAgoCCwIMAg0CDgIPAhACEQISAhMCFAIVAJ8CFgIXAhgCGQIaAhsCHAIdAh4CHwIgAiECIgIjAiQAlwIlAiYCJwIoAikCKgIrAiwCLQIuAi8CMAIxAjICMwI0AjUCNgI3AjgCOQI6AjsCPAI9Aj4CPwJAAkECQgJDAkQCRQJGAkcCSAJJAkoCSwJMAk0CTgJPAlACUQJSAlMCVAJVAlYCVwJYAlkCWgJbAlwCXQJeAl8CYAJhAmICYwJkAmUCZgJnAmgCaQJqAmsCbAJtAm4CbwJwAnECcgJzAnQCdQJ2AncCeAJ5AnoCewJ8An0CfgJ/AoACgQKCAoMChAKFAoYChwKIAokCigKLAowCjQKOAo8CkAKRApIAmwKTApQClQKWApcCmAKZApoCmwKcAp0CngKfAqACoQKiAqMCpAKlAqYCpwKoAqkCqgKrAqwCrQKuAq8CsAKxArICswK0ArUCtgK3ArgCuQK6ArsCvAK9Ar4CvwLAAsECwgLDAsQCxQLGAscCyALJAsoCywLMAs0CzgLPAtAC0QLSAtMC1ALVAtYC1wLYAtkC2gLbAtwC3QLeAt8C4ALhAuIC4wLkAuUC5gLnAugC6QLqAusC7ALtAu4C7wLwAvEC8gLzAvQC9QL2AvcC+AL5AvoC+wL8Av0C/gL/AwADAQMCAwMDBAMFAwYDBwMIAwkDCgMLAwwDDQMOAw8DEAMRAxIDEwMUAxUDFgMXAxgDGQMaAxsDHAMdAx4DHwMgAyEDIgMjAyQDJQMmAycDKAMpAyoDKwMsAy0DLgMvAzADMQMyAzMDNAM1AzYDNwM4AzkDOgM7AzwDPQM+Az8DQANBA0IDQwNEA0UDRgNHA0gDSQNKA0sDTANNA04DTwNQA1EDUgNTA1QDVQNWA1cDWANZA1oDWwNcA10DXgNfA2ADYQNiA2MAvQNkA2UDZgNnA2gDaQNqA2sDbANtA24DbwNwA3EDcgNzA3QDdQN2A3cDeAN5A3oDewN8A30DfgN/A4ADgQOCA4MDhAOFA4YDhwOIA4kDigOLA4wDjQOOA48DkAORA5IDkwOUA5UDlgOXA5gDmQOaA5sDnAOdA54DnwOgA6EDogOjA6QDpQOmA6cDqAOpA6oDqwOsA60DrgOvA7ADsQOyA7MDtAO1A7YDtwO4A7kDugO7A7wDvQO+A78DwAPBA8IDwwPEA8UDxgPHA8gDyQPKA8sDzAPNA84DzwPQA9ED0gPTA9QD1QPWA9cD2APZA9oD2wPcA90D3gPfA+AD4QPiA+MD5APlA+YD5wPoA+kD6gPrA+wD7QPuA+8D8APxA/ID8wP0A/UD9gP3A/gD+QP6A/sD/AP9A/4D/wQABAEEAgQDBAQEBQQGBAcECAQJBAoECwQMBA0EDgQPBBAEEQQSBBMEFAQVBBYEFwQYBBkEGgQbBBwEHQQeBB8EIAQhBCIEIwQkBCUEJgQnBCgEKQQqBCsELAQtBC4ELwQwBDEEMgQzBDQENQQ2BDcEOAQ5BDoEOwQ8BD0EPgQ/BEAEQQRCBEMERARFBEYERwRIBEkESgRLBEwETQROBE8EUARRBFIEUwRUBFUEVgRXBFgEWQRaBFsEXARdBF4EXwRgBGEEYgRjBGQEZQRmBGcEaARpBGoEawRsBG0EbgRvBHAEcQRyBHMEdAR1BHYEdwR4BHkEegR7BHwEfQR+BH8EgASBBIIEgwSEBIUEhgSHBIgEiQSKBIsEjASNBI4EjwSQBJEEkgSTBJQElQSWBJcEmASZBJoEmwScBJ0EngSfBKAEoQSiBKMEpASlBKYEpwSoBKkEqgSrBKwErQSuBK8EsASxBLIEswS0BLUEtgS3BLgEuQS6BLsEvAS9BL4EvwTABMEEwgTDBMQExQTGBMcEyATJBMoEywTMBM0EzgTPBNAE0QTSBNME1ATVBNYE1wTYBNkE2gTbBNwE3QTeBN8E4AThBOIE4wTkBOUE5gTnBOgE6QTqBOsE7ATtBO4E7wTwBPEE8gTzBPQE9QT2BPcE+AT5BPoE+wT8BP0E/gT/BQAFAQUCBQMFBAUFBQYFBwUIBQkFCgULBQwFDQUOBQ8FEAURBRIFEwUUBRUFFgUXBRgFGQUaBRsFHAUdBR4FHwUgBSEFIgUjBSQFJQUmBScFKAUpBSoFKwUsBS0FLgUvBTAFMQUyBTMFNAU1BTYFNwU4BTkFOgU7BTwFPQU+BT8FQAVBBUIFQwVEBUUFRgVHBUgFSQVKBUsFTAVNBU4FTwVQBVEFUgVTBVQFVQVWBVcFWAVZBVoFWwVcBV0FXgVfBWAFYQViBWMFZAVlBWYFZwVoBWkFagVrBWwFbQVuBW8FcAVxBXIFcwV0BXUFdgV3BXgFeQV6BXsFfAV9BX4FfwWABYEFggWDBYQFhQWGBYcFiAWJBYoFiwWMBY0FjgWPBZAFkQWSBZMFlAWVBZYFlwWYBZkFmgWbBZwFnQWeBZ8FoAWhBaIFowWkBaUFpgWnBagFqQWqBasFrAWtBa4FrwWwBbEFsgWzBbQFtQW2BbcFuAW5BboFuwW8Bb0FvgW/BcAFwQXCBcMFxAXFBcYFxwXIBckFygXLBcwFzQXOBc8F0AXRBdIF0wXUBdUF1gXXBdgF2QXaBdsF3AXdBd4F3wXgBeEF4gXjBeQF5QXmBecF6AXpBeoF6wXsBe0F7gXvBfAF8QXyBfMF9AX1BfYF9wX4BfkF+gX7BfwF/QX+Bf8GAAYBBgIGAwYEBgUGBgYHBggGCQYKBgsGDAYNBg4GDwYQBhEGEgYTBhQGFQYWBhcGGAYZBhoGGwYcBh0GHgYfBiAGIQYiBiMGJAYlBiYGJwYoBikGKgYrBiwGLQYuBi8GMAYxBjIGMwY0BjUGNgY3BjgGOQY6BjsGPAY9Bj4GPwZABkEGQgZDBkQGRQZGBkcGSAZJBkoGSwZMBk0GTgZPBlAGUQZSBlMGVAZVBlYGVwZYBlkGWgZbBlwGXQZeBl8GYAZhBmIGYwZkBmUGZgZnBmgGaQZqBmsGbAZtBm4GbwZwBnEGcgZzBnQGdQZ2BncGeAZ5BnoGewZ8Bn0GfgZ/BoAGgQaCBoMGhAaFBoYGhwaIBokGigaLBowGjQaOBS5udWxsEG5vbm1hcmtpbmdyZXR1cm4DbXUxA3BpMQNPaG0ERXVybwdkbWFjcm9uCW92ZXJzY29yZQZtaWRkb3QGQWJyZXZlBmFicmV2ZQdBb2dvbmVrB2FvZ29uZWsGRGNhcm9uBmRjYXJvbgZEc2xhc2gHRW9nb25lawdlb2dvbmVrBkVjYXJvbgZlY2Fyb24GTGFjdXRlBmxhY3V0ZQZMY2Fyb24GbGNhcm9uBExkb3QEbGRvdAZOYWN1dGUGbmFjdXRlBk5jYXJvbgZuY2Fyb24JT2RibGFjdXRlCW9kYmxhY3V0ZQZSYWN1dGUGcmFjdXRlBlJjYXJvbgZyY2Fyb24GU2FjdXRlBnNhY3V0ZQhUY2VkaWxsYQh0Y2VkaWxsYQZUY2Fyb24GdGNhcm9uBVVyaW5nBXVyaW5nCVVkYmxhY3V0ZQl1ZGJsYWN1dGUGWmFjdXRlBnphY3V0ZQRaZG90BHpkb3QFR2FtbWEFVGhldGEDUGhpBWFscGhhBWRlbHRhB2Vwc2lsb24Fc2lnbWEDdGF1A3BoaQ11bmRlcnNjb3JlZGJsCWV4Y2xhbWRibAluc3VwZXJpb3IGcGVzZXRhCWFycm93bGVmdAdhcnJvd3VwCmFycm93cmlnaHQJYXJyb3dkb3duCWFycm93Ym90aAlhcnJvd3VwZG4MYXJyb3d1cGRuYnNlCm9ydGhvZ29uYWwMaW50ZXJzZWN0aW9uC2VxdWl2YWxlbmNlBWhvdXNlDXJldmxvZ2ljYWxub3QKaW50ZWdyYWx0cAppbnRlZ3JhbGJ0CFNGMTAwMDAwCFNGMTEwMDAwCFNGMDEwMDAwCFNGMDMwMDAwCFNGMDIwMDAwCFNGMDQwMDAwCFNGMDgwMDAwCFNGMDkwMDAwCFNGMDYwMDAwCFNGMDcwMDAwCFNGMDUwMDAwCFNGNDMwMDAwCFNGMjQwMDAwCFNGNTEwMDAwCFNGNTIwMDAwCFNGMzkwMDAwCFNGMjIwMDAwCFNGMjEwMDAwCFNGMjUwMDAwCFNGNTAwMDAwCFNGNDkwMDAwCFNGMzgwMDAwCFNGMjgwMDAwCFNGMjcwMDAwCFNGMjYwMDAwCFNGMzYwMDAwCFNGMzcwMDAwCFNGNDIwMDAwCFNGMTkwMDAwCFNGMjAwMDAwCFNGMjMwMDAwCFNGNDcwMDAwCFNGNDgwMDAwCFNGNDEwMDAwCFNGNDUwMDAwCFNGNDYwMDAwCFNGNDAwMDAwCFNGNTQwMDAwCFNGNTMwMDAwCFNGNDQwMDAwB3VwYmxvY2sHZG5ibG9jawVibG9jawdsZmJsb2NrB3J0YmxvY2sHbHRzaGFkZQVzaGFkZQdka3NoYWRlCWZpbGxlZGJveApmaWxsZWRyZWN0B3RyaWFndXAHdHJpYWdydAd0cmlhZ2RuB3RyaWFnbGYGY2lyY2xlCWludmJ1bGxldAlpbnZjaXJjbGUJc21pbGVmYWNlDGludnNtaWxlZmFjZQNzdW4GZmVtYWxlBG1hbGUFc3BhZGUEY2x1YgVoZWFydAdkaWFtb25kC211c2ljYWxub3RlDm11c2ljYWxub3RlZGJsAklKAmlqC25hcG9zdHJvcGhlBm1pbnV0ZQZzZWNvbmQJYWZpaTYxMjQ4CWFmaWk2MTI4OQZIMjIwNzMGSDE4NTQzBkgxODU1MQZIMTg1MzMKb3BlbmJ1bGxldAdBbWFjcm9uB2FtYWNyb24LQ2NpcmN1bWZsZXgLY2NpcmN1bWZsZXgEQ2RvdARjZG90B0VtYWNyb24HZW1hY3JvbgZFYnJldmUGZWJyZXZlBEVkb3QEZWRvdAtHY2lyY3VtZmxleAtnY2lyY3VtZmxleARHZG90BGdkb3QIR2NlZGlsbGEIZ2NlZGlsbGELSGNpcmN1bWZsZXgLaGNpcmN1bWZsZXgESGJhcgRoYmFyBkl0aWxkZQZpdGlsZGUHSW1hY3JvbgdpbWFjcm9uBklicmV2ZQZpYnJldmUHSW9nb25lawdpb2dvbmVrC0pjaXJjdW1mbGV4C2pjaXJjdW1mbGV4CEtjZWRpbGxhCGtjZWRpbGxhDGtncmVlbmxhbmRpYwhMY2VkaWxsYQhsY2VkaWxsYQhOY2VkaWxsYQhuY2VkaWxsYQNFbmcDZW5nB09tYWNyb24Hb21hY3JvbgZPYnJldmUGb2JyZXZlCFJjZWRpbGxhCHJjZWRpbGxhC1NjaXJjdW1mbGV4C3NjaXJjdW1mbGV4BFRiYXIEdGJhcgZVdGlsZGUGdXRpbGRlB1VtYWNyb24HdW1hY3JvbgZVYnJldmUGdWJyZXZlB1VvZ29uZWsHdW9nb25lawtXY2lyY3VtZmxleAt3Y2lyY3VtZmxleAtZY2lyY3VtZmxleAt5Y2lyY3VtZmxleAVsb25ncwpBcmluZ2FjdXRlCmFyaW5nYWN1dGUHQUVhY3V0ZQdhZWFjdXRlC09zbGFzaGFjdXRlC29zbGFzaGFjdXRlCWFub3RlbGVpYQZXZ3JhdmUGd2dyYXZlBldhY3V0ZQZ3YWN1dGUJV2RpZXJlc2lzCXdkaWVyZXNpcwZZZ3JhdmUGeWdyYXZlDXF1b3RlcmV2ZXJzZWQJcmFkaWNhbGV4CWFmaWkwODk0MQllc3RpbWF0ZWQJb25lZWlnaHRoDHRocmVlZWlnaHRocwtmaXZlZWlnaHRocwxzZXZlbmVpZ2h0aHMLY29tbWFhY2NlbnQQdW5kZXJjb21tYWFjY2VudAV0b25vcw1kaWVyZXNpc3Rvbm9zCkFscGhhdG9ub3MMRXBzaWxvbnRvbm9zCEV0YXRvbm9zCUlvdGF0b25vcwxPbWljcm9udG9ub3MMVXBzaWxvbnRvbm9zCk9tZWdhdG9ub3MRaW90YWRpZXJlc2lzdG9ub3MFQWxwaGEEQmV0YQVEZWx0YQdFcHNpbG9uBFpldGEDRXRhBElvdGEFS2FwcGEGTGFtYmRhAk11Ak51AlhpB09taWNyb24CUGkDUmhvBVNpZ21hA1RhdQdVcHNpbG9uA0NoaQNQc2kMSW90YWRpZXJlc2lzD1Vwc2lsb25kaWVyZXNpcwphbHBoYXRvbm9zDGVwc2lsb250b25vcwhldGF0b25vcwlpb3RhdG9ub3MUdXBzaWxvbmRpZXJlc2lzdG9ub3MEYmV0YQVnYW1tYQR6ZXRhA2V0YQV0aGV0YQRpb3RhBWthcHBhBmxhbWJkYQJudQJ4aQdvbWljcm9uA3JobwZzaWdtYTEHdXBzaWxvbgNjaGkDcHNpBW9tZWdhDGlvdGFkaWVyZXNpcw91cHNpbG9uZGllcmVzaXMMb21pY3JvbnRvbm9zDHVwc2lsb250b25vcwpvbWVnYXRvbm9zCWFmaWkxMDAyMwlhZmlpMTAwNTEJYWZpaTEwMDUyCWFmaWkxMDA1MwlhZmlpMTAwNTQJYWZpaTEwMDU1CWFmaWkxMDA1NglhZmlpMTAwNTcJYWZpaTEwMDU4CWFmaWkxMDA1OQlhZmlpMTAwNjAJYWZpaTEwMDYxCWFmaWkxMDA2MglhZmlpMTAxNDUJYWZpaTEwMDE3CWFmaWkxMDAxOAlhZmlpMTAwMTkJYWZpaTEwMDIwCWFmaWkxMDAyMQlhZmlpMTAwMjIJYWZpaTEwMDI0CWFmaWkxMDAyNQlhZmlpMTAwMjYJYWZpaTEwMDI3CWFmaWkxMDAyOAlhZmlpMTAwMjkJYWZpaTEwMDMwCWFmaWkxMDAzMQlhZmlpMTAwMzIJYWZpaTEwMDMzCWFmaWkxMDAzNAlhZmlpMTAwMzUJYWZpaTEwMDM2CWFmaWkxMDAzNwlhZmlpMTAwMzgJYWZpaTEwMDM5CWFmaWkxMDA0MAlhZmlpMTAwNDEJYWZpaTEwMDQyCWFmaWkxMDA0MwlhZmlpMTAwNDQJYWZpaTEwMDQ1CWFmaWkxMDA0NglhZmlpMTAwNDcJYWZpaTEwMDQ4CWFmaWkxMDA0OQlhZmlpMTAwNjUJYWZpaTEwMDY2CWFmaWkxMDA2NwlhZmlpMTAwNjgJYWZpaTEwMDY5CWFmaWkxMDA3MAlhZmlpMTAwNzIJYWZpaTEwMDczCWFmaWkxMDA3NAlhZmlpMTAwNzUJYWZpaTEwMDc2CWFmaWkxMDA3NwlhZmlpMTAwNzgJYWZpaTEwMDc5CWFmaWkxMDA4MAlhZmlpMTAwODEJYWZpaTEwMDgyCWFmaWkxMDA4MwlhZmlpMTAwODQJYWZpaTEwMDg1CWFmaWkxMDA4NglhZmlpMTAwODcJYWZpaTEwMDg4CWFmaWkxMDA4OQlhZmlpMTAwOTAJYWZpaTEwMDkxCWFmaWkxMDA5MglhZmlpMTAwOTMJYWZpaTEwMDk0CWFmaWkxMDA5NQlhZmlpMTAwOTYJYWZpaTEwMDk3CWFmaWkxMDA3MQlhZmlpMTAwOTkJYWZpaTEwMTAwCWFmaWkxMDEwMQlhZmlpMTAxMDIJYWZpaTEwMTAzCWFmaWkxMDEwNAlhZmlpMTAxMDUJYWZpaTEwMTA2CWFmaWkxMDEwNwlhZmlpMTAxMDgJYWZpaTEwMTA5CWFmaWkxMDExMAlhZmlpMTAxOTMJYWZpaTEwMDUwCWFmaWkxMDA5OAlhZmlpMDAyMDgJYWZpaTYxMzUyBXNoZXZhCmhhdGFmc2Vnb2wKaGF0YWZwYXRhaAtoYXRhZnFhbWF0cwVoaXJpcQV0c2VyZQVzZWdvbAVwYXRhaAZxYW1hdHMFaG9sYW0GcXVidXRzBmRhZ2VzaAVtZXRlZwVtYXFhZgRyYWZlBXBhc2VxB3NoaW5kb3QGc2luZG90CHNvZnBhc3VxBGFsZWYDYmV0BWdpbWVsBWRhbGV0AmhlA3ZhdgV6YXlpbgNoZXQDdGV0A3lvZAhmaW5hbGthZgNrYWYFbGFtZWQIZmluYWxtZW0DbWVtCGZpbmFsbnVuA251bgZzYW1la2gEYXlpbgdmaW5hbHBlAnBlCmZpbmFsdHNhZGkFdHNhZGkDcW9mBHJlc2gEc2hpbgN0YXYJZG91YmxldmF2BnZhdnlvZAlkb3VibGV5b2QGZ2VyZXNoCWdlcnNoYXlpbQ1uZXdzaGVxZWxzaWduCnZhdnNoaW5kb3QNZmluYWxrYWZzaGV2YQ5maW5hbGthZnFhbWF0cwpsYW1lZGhvbGFtEGxhbWVkaG9sYW1kYWdlc2gHYWx0YXlpbgtzaGluc2hpbmRvdApzaGluc2luZG90EXNoaW5kYWdlc2hzaGluZG90EHNoaW5kYWdlc2hzaW5kb3QJYWxlZnBhdGFoCmFsZWZxYW1hdHMJYWxlZm1hcGlxCWJldGRhZ2VzaAtnaW1lbGRhZ2VzaAtkYWxldGRhZ2VzaAhoZWRhZ2VzaAl2YXZkYWdlc2gLemF5aW5kYWdlc2gJdGV0ZGFnZXNoCXlvZGRhZ2VzaA5maW5hbGthZmRhZ2VzaAlrYWZkYWdlc2gLbGFtZWRkYWdlc2gJbWVtZGFnZXNoCW51bmRhZ2VzaAxzYW1la2hkYWdlc2gNZmluYWxwZWRhZ2VzaAhwZWRhZ2VzaAt0c2FkaWRhZ2VzaAlxb2ZkYWdlc2gKcmVzaGRhZ2VzaApzaGluZGFnZXNoCHRhdmRhZ2VzCHZhdmhvbGFtB2JldHJhZmUHa2FmcmFmZQZwZXJhZmUJYWxlZmxhbWVkEnplcm93aWR0aG5vbmpvaW5lcg96ZXJvd2lkdGhqb2luZXIPbGVmdHRvcmlnaHRtYXJrD3JpZ2h0dG9sZWZ0bWFyawlhZmlpNTczODgJYWZpaTU3NDAzCWFmaWk1NzQwNwlhZmlpNTc0MDkJYWZpaTU3NDQwCWFmaWk1NzQ1MQlhZmlpNTc0NTIJYWZpaTU3NDUzCWFmaWk1NzQ1NAlhZmlpNTc0NTUJYWZpaTU3NDU2CWFmaWk1NzQ1NwlhZmlpNTc0NTgJYWZpaTU3MzkyCWFmaWk1NzM5MwlhZmlpNTczOTQJYWZpaTU3Mzk1CWFmaWk1NzM5NglhZmlpNTczOTcJYWZpaTU3Mzk4CWFmaWk1NzM5OQlhZmlpNTc0MDAJYWZpaTU3NDAxCWFmaWk1NzM4MQlhZmlpNTc0NjEJYWZpaTYzMTY3CWFmaWk1NzQ1OQlhZmlpNTc1NDMJYWZpaTU3NTM0CWFmaWk1NzQ5NAlhZmlpNjI4NDMJYWZpaTYyODQ0CWFmaWk2Mjg0NQlhZmlpNjQyNDAJYWZpaTY0MjQxCWFmaWk2Mzk1NAlhZmlpNTczODIJYWZpaTY0MjQyCWFmaWk2Mjg4MQlhZmlpNTc1MDQJYWZpaTU3MzY5CWFmaWk1NzM3MAlhZmlpNTczNzEJYWZpaTU3MzcyCWFmaWk1NzM3MwlhZmlpNTczNzQJYWZpaTU3Mzc1CWFmaWk1NzM5MQlhZmlpNTc0NzEJYWZpaTU3NDYwCWFmaWk1MjI1OAlhZmlpNTc1MDYJYWZpaTYyOTU4CWFmaWk2Mjk1NglhZmlpNTI5NTcJYWZpaTU3NTA1CWFmaWk2Mjg4OQlhZmlpNjI4ODcJYWZpaTYyODg4CWFmaWk1NzUwNwlhZmlpNjI5NjEJYWZpaTYyOTU5CWFmaWk2Mjk2MAlhZmlpNTc1MDgJYWZpaTYyOTYyCWFmaWk1NzU2NwlhZmlpNjI5NjQJYWZpaTUyMzA1CWFmaWk1MjMwNglhZmlpNTc1MDkJYWZpaTYyOTY3CWFmaWk2Mjk2NQlhZmlpNjI5NjYJYWZpaTU3NTU1CWFmaWk1MjM2NAlhZmlpNjM3NTMJYWZpaTYzNzU0CWFmaWk2Mzc1OQlhZmlpNjM3NjMJYWZpaTYzNzk1CWFmaWk2Mjg5MQlhZmlpNjM4MDgJYWZpaTYyOTM4CWFmaWk2MzgxMAlhZmlpNjI5NDIJYWZpaTYyOTQ3CWFmaWk2MzgxMwlhZmlpNjM4MjMJYWZpaTYzODI0CWFmaWk2MzgzMwlhZmlpNjM4NDQJYWZpaTYyODgyCWFmaWk2Mjg4MwlhZmlpNjI4ODQJYWZpaTYyODg1CWFmaWk2Mjg4NglhZmlpNjM4NDYJYWZpaTYzODQ5B3VuaTIwMkEHdW5pMjAyQgd1bmkyMDJEB3VuaTIwMkUHdW5pMjAyQwd1bmkyMDZFCHVuaTIwNkY7B3VuaTIwNkEHdW5pMjA2Qgh1bmkyMDZDOwd1bmkyMDZEB3VuaUYwMEEHdW5pRjAwQgd1bmlGMDBDB3VuaUYwMEQHdW5pRjAwRQd1bmlGRkZDCWFmaWk2MzkwNAlhZmlpNjM5MDUJYWZpaTYzOTA2CWFmaWk2MzkwOAlhZmlpNjM5MTAJYWZpaTYzOTEyCWFmaWk2MjkyNwlhZmlpNjM5NDEJYWZpaTYyOTM5CWFmaWk2Mzk0MwlhZmlpNjI5NDMJYWZpaTYyOTQ2CWFmaWk2Mzk0NglhZmlpNjI5NTEJYWZpaTYzOTQ4CWFmaWk2Mjk1MwlhZmlpNjM5NTAJYWZpaTYzOTUxCWFmaWk2Mzk1MglhZmlpNjM5NTMJYWZpaTYzOTU2CWFmaWk2Mzk1OAlhZmlpNjM5NTkJYWZpaTYzOTYwCWFmaWk2Mzk2MQlhZmlpNjQwNDYJYWZpaTY0MDU4CWFmaWk2NDA1OQlhZmlpNjQwNjAJYWZpaTY0MDYxCWFmaWk2Mjk0NQlhZmlpNjQxODQJYWZpaTUyMzk5CWFmaWk1MjQwMAlhZmlpNjI3NTMJYWZpaTU3NDExCWFmaWk2Mjc1NAlhZmlpNTc0MTIJYWZpaTYyNzU1CWFmaWk1NzQxMwlhZmlpNjI3NTYJYWZpaTU3NDE0CWFmaWk2Mjc1OQlhZmlpNjI3NTcJYWZpaTYyNzU4CWFmaWk1NzQxNQlhZmlpNjI3NjAJYWZpaTU3NDE2CWFmaWk2Mjc2MwlhZmlpNjI3NjEJYWZpaTYyNzYyCWFmaWk1NzQxNwlhZmlpNjI3NjQJYWZpaTU3NDE4CWFmaWk2Mjc2NwlhZmlpNjI3NjUJYWZpaTYyNzY2CWFmaWk1NzQxOQlhZmlpNjI3NzAJYWZpaTYyNzY4CWFmaWk2Mjc2OQlhZmlpNTc0MjAJYWZpaTYyNzczCWFmaWk2Mjc3MQlhZmlpNjI3NzIJYWZpaTU3NDIxCWFmaWk2Mjc3NglhZmlpNjI3NzQJYWZpaTYyNzc1CWFmaWk1NzQyMglhZmlpNjI3NzkJYWZpaTYyNzc3CWFmaWk2Mjc3OAlhZmlpNTc0MjMJYWZpaTYyNzgwCWFmaWk1NzQyNAlhZmlpNjI3ODEJYWZpaTU3NDI1CWFmaWk2Mjc4MglhZmlpNTc0MjYJYWZpaTYyNzgzCWFmaWk1NzQyNwlhZmlpNjI3ODYJYWZpaTYyNzg0CWFmaWk2Mjc4NQlhZmlpNTc0MjgJYWZpaTYyNzg5CWFmaWk2Mjc4NwlhZmlpNjI3ODgJYWZpaTU3NDI5CWFmaWk2Mjc5MglhZmlpNjI3OTAJYWZpaTYyNzkxCWFmaWk1NzQzMAlhZmlpNjI3OTUJYWZpaTYyNzkzCWFmaWk2Mjc5NAlhZmlpNTc0MzEJYWZpaTYyNzk4CWFmaWk2Mjc5NglhZmlpNjI3OTcJYWZpaTU3NDMyCWFmaWk2MjgwMQlhZmlpNjI3OTkJYWZpaTYyODAwCWFmaWk1NzQzMwlhZmlpNjI4MDQJYWZpaTYyODAyCWFmaWk2MjgwMwlhZmlpNTc0MzQJYWZpaTYyODA3CWFmaWk2MjgwNQlhZmlpNjI4MDYJYWZpaTU3NDQxCWFmaWk2MjgxMAlhZmlpNjI4MDgJYWZpaTYyODA5CWFmaWk1NzQ0MglhZmlpNjI4MTMJYWZpaTYyODExCWFmaWk2MjgxMglhZmlpNTc0NDMJYWZpaTYyODE2CWFmaWk1NzQxMAlhZmlpNjI4MTUJYWZpaTU3NDQ0CWFmaWk2MjgxOQlhZmlpNjI4MTcJYWZpaTYyODE4CWFmaWk1NzQ0NQlhZmlpNjI4MjIJYWZpaTYyODIwCWFmaWk2MjgyMQlhZmlpNTc0NDYJYWZpaTYyODI1CWFmaWk2MjgyMwlhZmlpNjI4MjQJYWZpaTU3NDQ3CWFmaWk2MjgyOAlhZmlpNTc0NzAJYWZpaTYyODI3CWFmaWk1NzQ0OAlhZmlpNjI4MjkJYWZpaTU3NDQ5CWFmaWk2MjgzMAlhZmlpNTc0NTAJYWZpaTYyODMzCWFmaWk2MjgzMQlhZmlpNjI4MzIJYWZpaTYyODM0CWFmaWk2MjgzNQlhZmlpNjI4MzYJYWZpaTYyODM3CWFmaWk2MjgzOAlhZmlpNjI4MzkJYWZpaTYyODQwCWFmaWk2Mjg0MQlnbHlwaDEwMjELYWZpaTU3NTQzLTILYWZpaTU3NDU0LTILYWZpaTU3NDUxLTIJZ2x5cGgxMDI1CWdseXBoMTAyNgthZmlpNTc0NzEtMgthZmlpNTc0NTgtMgthZmlpNTc0NTctMgthZmlpNTc0OTQtMgthZmlpNTc0NTktMgthZmlpNTc0NTUtMgthZmlpNTc0NTItMglnbHlwaDEwMzQJZ2x5cGgxMDM1CWdseXBoMTAzNgthZmlpNjI4ODQtMgthZmlpNjI4ODEtMgthZmlpNjI4ODYtMgthZmlpNjI4ODMtMgthZmlpNjI4ODUtMgthZmlpNjI4ODItMgthZmlpNTc1MDQtMgthZmlpNTc0NTYtMgthZmlpNTc0NTMtMglnbHlwaDEwNDYJZ2x5cGgxMDQ3C2FmaWk1NzU0My0zC2FmaWk1NzQ1NC0zC2FmaWk1NzQ1MS0zCWdseXBoMTA1MQlnbHlwaDEwNTILYWZpaTU3NDcxLTMLYWZpaTU3NDU4LTMLYWZpaTU3NDU3LTMLYWZpaTU3NDk0LTMLYWZpaTU3NDU5LTMLYWZpaTU3NDU1LTMLYWZpaTU3NDUyLTMJZ2x5cGgxMDYwCWdseXBoMTA2MQlnbHlwaDEwNjILYWZpaTYyODg0LTMLYWZpaTYyODgxLTMLYWZpaTYyODg2LTMLYWZpaTYyODgzLTMLYWZpaTYyODg1LTMLYWZpaTYyODgyLTMLYWZpaTU3NTA0LTMLYWZpaTU3NDU2LTMLYWZpaTU3NDUzLTMJZ2x5cGgxMDcyCWdseXBoMTA3MwthZmlpNTc1NDMtNAthZmlpNTc0NTQtNAthZmlpNTc0NTEtNAlnbHlwaDEwNzcJZ2x5cGgxMDc4C2FmaWk1NzQ3MS00C2FmaWk1NzQ1OC00C2FmaWk1NzQ1Ny00C2FmaWk1NzQ5NC00C2FmaWk1NzQ1OS00C2FmaWk1NzQ1NS00C2FmaWk1NzQ1Mi00CWdseXBoMTA4NglnbHlwaDEwODcJZ2x5cGgxMDg4C2FmaWk2Mjg4NC00C2FmaWk2Mjg4MS00C2FmaWk2Mjg4Ni00C2FmaWk2Mjg4My00C2FmaWk2Mjg4NS00C2FmaWk2Mjg4Mi00C2FmaWk1NzUwNC00C2FmaWk1NzQ1Ni00C2FmaWk1NzQ1My00CWdseXBoMTA5OAlnbHlwaDEwOTkJZ2x5cGgxMTAwCWdseXBoMTEwMQlnbHlwaDExMDIJZ2x5cGgxMTAzCWdseXBoMTEwNAlnbHlwaDExMDUJZ2x5cGgxMTA2CWdseXBoMTEwNwlnbHlwaDExMDgJZ2x5cGgxMTA5CWdseXBoMTExMAlnbHlwaDExMTEJZ2x5cGgxMTEyCWdseXBoMTExMwlnbHlwaDExMTQJZ2x5cGgxMTE1CWdseXBoMTExNglnbHlwaDExMTcJZ2x5cGgxMTE4CWdseXBoMTExOQlnbHlwaDExMjAJZ2x5cGgxMTIxCWdseXBoMTEyMglnbHlwaDExMjMJZ2x5cGgxMTI0CWdseXBoMTEyNQlnbHlwaDExMjYLYWZpaTU3NDQwLTILYWZpaTU3NDQwLTMLYWZpaTU3NDQwLTQFT2hvcm4Fb2hvcm4FVWhvcm4FdWhvcm4JZ2x5cGgxMTM0CWdseXBoMTEzNQlnbHlwaDExMzYHdW5pRjAwNgd1bmlGMDA3B3VuaUYwMDkSY29tYmluaW5naG9va2Fib3ZlB3VuaUYwMTAHdW5pRjAxMwd1bmlGMDExB3VuaUYwMUMHdW5pRjAxNRRjb21iaW5pbmd0aWxkZWFjY2VudAlnbHlwaDExNDcJZ2x5cGgxMTQ4B3VuaUYwMkMIZG9uZ3NpZ24Ib25ldGhpcmQJdHdvdGhpcmRzB3VuaUYwMDgJZ2x5cGgxMTU0CWdseXBoMTE1NQd1bmlGMDBGB3VuaUYwMTIHdW5pRjAxNAd1bmlGMDE2B3VuaUYwMTcHdW5pRjAxOAd1bmlGMDE5B3VuaUYwMUEHdW5pRjAxQgd1bmlGMDFFB3VuaUYwMUYHdW5pRjAyMAd1bmlGMDIxB3VuaUYwMjIUY29tYmluaW5nZ3JhdmVhY2NlbnQUY29tYmluaW5nYWN1dGVhY2NlbnQHdW5pRjAxRBFjb21iaW5pbmdkb3RiZWxvdwd1bmlGMDIzB3VuaUYwMjkHdW5pRjAyQQd1bmlGMDJCB3VuaUYwMjQHdW5pRjAyNQd1bmlGMDI2B3VuaUYwMjcHdW5pRjAyOAd1bmlGMDJEB3VuaUYwMkUHdW5pRjAyRgd1bmlGMDMwB3VuaUYwMzEJQWRvdGJlbG93CWFkb3RiZWxvdwpBaG9va2Fib3ZlCmFob29rYWJvdmUQQWNpcmN1bWZsZXhhY3V0ZRBhY2lyY3VtZmxleGFjdXRlEEFjaXJjdW1mbGV4Z3JhdmUQYWNpcmN1bWZsZXhncmF2ZRRBY2lyY3VtZmxleGhvb2thYm92ZRRhY2lyY3VtZmxleGhvb2thYm92ZRBBY2lyY3VtZmxleHRpbGRlEGFjaXJjdW1mbGV4dGlsZGUTQWNpcmN1bWZsZXhkb3RiZWxvdxNhY2lyY3VtZmxleGRvdGJlbG93C0FicmV2ZWFjdXRlC2FicmV2ZWFjdXRlC0FicmV2ZWdyYXZlC2FicmV2ZWdyYXZlD0FicmV2ZWhvb2thYm92ZQ9hYnJldmVob29rYWJvdmULQWJyZXZldGlsZGULYWJyZXZldGlsZGUOQWJyZXZlZG90YmVsb3cOYWJyZXZlZG90YmVsb3cJRWRvdGJlbG93CWVkb3RiZWxvdwpFaG9va2Fib3ZlCmVob29rYWJvdmUGRXRpbGRlBmV0aWxkZRBFY2lyY3VtZmxleGFjdXRlEGVjaXJjdW1mbGV4YWN1dGUQRWNpcmN1bWZsZXhncmF2ZRBlY2lyY3VtZmxleGdyYXZlFEVjaXJjdW1mbGV4aG9va2Fib3ZlFGVjaXJjdW1mbGV4aG9va2Fib3ZlEEVjaXJjdW1mbGV4dGlsZGUQZWNpcmN1bWZsZXh0aWxkZRNFY2lyY3VtZmxleGRvdGJlbG93E2VjaXJjdW1mbGV4ZG90YmVsb3cKSWhvb2thYm92ZQppaG9va2Fib3ZlCUlkb3RiZWxvdwlpZG90YmVsb3cJT2RvdGJlbG93CW9kb3RiZWxvdwpPaG9va2Fib3ZlCm9ob29rYWJvdmUQT2NpcmN1bWZsZXhhY3V0ZRBvY2lyY3VtZmxleGFjdXRlEE9jaXJjdW1mbGV4Z3JhdmUQb2NpcmN1bWZsZXhncmF2ZRRPY2lyY3VtZmxleGhvb2thYm92ZRRvY2lyY3VtZmxleGhvb2thYm92ZRBPY2lyY3VtZmxleHRpbGRlEG9jaXJjdW1mbGV4dGlsZGUTT2NpcmN1bWZsZXhkb3RiZWxvdxNvY2lyY3VtZmxleGRvdGJlbG93Ck9ob3JuYWN1dGUKb2hvcm5hY3V0ZQpPaG9ybmdyYXZlCm9ob3JuZ3JhdmUOT2hvcm5ob29rYWJvdmUOb2hvcm5ob29rYWJvdmUKT2hvcm50aWxkZQpvaG9ybnRpbGRlDU9ob3JuZG90YmVsb3cNb2hvcm5kb3RiZWxvdwlVZG90YmVsb3cJdWRvdGJlbG93ClVob29rYWJvdmUKdWhvb2thYm92ZQpVaG9ybmFjdXRlCnVob3JuYWN1dGUKVWhvcm5ncmF2ZQp1aG9ybmdyYXZlDlVob3JuaG9va2Fib3ZlDnVob3JuaG9va2Fib3ZlClVob3JudGlsZGUKdWhvcm50aWxkZQ1VaG9ybmRvdGJlbG93DXVob3JuZG90YmVsb3cJWWRvdGJlbG93CXlkb3RiZWxvdwpZaG9va2Fib3ZlCnlob29rYWJvdmUGWXRpbGRlBnl0aWxkZQd1bmkwMUNEB3VuaTAxQ0UHdW5pMDFDRgd1bmkwMUQwB3VuaTAxRDEHdW5pMDFEMgd1bmkwMUQzB3VuaTAxRDQHdW5pMDFENQd1bmkwMUQ2B3VuaTAxRDcHdW5pMDFEOAd1bmkwMUQ5B3VuaTAxREEHdW5pMDFEQgd1bmkwMURDCWdseXBoMTI5MglnbHlwaDEyOTMJZ2x5cGgxMjk0CWdseXBoMTI5NQd1bmkwNDkyB3VuaTA0OTMHdW5pMDQ5Ngd1bmkwNDk3B3VuaTA0OUEHdW5pMDQ5Qgd1bmkwNDlDB3VuaTA0OUQHdW5pMDRBMgd1bmkwNEEzB3VuaTA0QUUHdW5pMDRBRgd1bmkwNEIwB3VuaTA0QjEHdW5pMDRCMgd1bmkwNEIzB3VuaTA0QjgHdW5pMDRCOQd1bmkwNEJBB3VuaTA0QkIHdW5pMDE4Rgd1bmkwMjU5B3VuaTA0RTgHdW5pMDRFOQlnbHlwaDEzMjAJZ2x5cGgxMzIxCWdseXBoMTMyMglnbHlwaDEzMjMJZ2x5cGgxMzI0CWdseXBoMTMyNQlnbHlwaDEzMjYJZ2x5cGgxMzI3CWdseXBoMTMyOAlnbHlwaDEzMjkJZ2x5cGgxMzMwCWdseXBoMTMzMQlnbHlwaDEzMzIJZ2x5cGgxMzMzCWdseXBoMTMzNAlnbHlwaDEzMzUHdW5pMDY1Mwd1bmkwNjU0B3VuaTA2NTUHdW5pMDY3MAd1bmkwNjcxB3VuaUZCNTEHdW5pMDY3MglnbHlwaDEzNDMHdW5pMDY3MwlnbHlwaDEzNDUHdW5pMDY3NQdnbHlwaDQ3B3VuaTA2NzYJZ2x5cGgxMzQ5B3VuaTA2NzcJZ2x5cGgxMzUxB3VuaTA2NzgFZ2x5cGgHdW5pMDY3OQd1bmlGQjY3B3VuaUZCNjgHdW5pRkI2OQd1bmkwNjdBB3VuaUZCNUYHdW5pRkI2MAd1bmlGQjYxB3VuaTA2N0IHdW5pRkI1Mwd1bmlGQjU0B3VuaUZCNTUHdW5pMDY3QwlnbHlwaDEzNjcJZ2x5cGgxMzY4CWdseXBoMTM2OQd1bmkwNjdECWdseXBoMTM3MQlnbHlwaDEzNzIJZ2x5cGgxMzczB3VuaTA2N0YHdW5pRkI2Mwd1bmlGQjY0B3VuaUZCNjUHdW5pMDY4MAd1bmlGQjVCB3VuaUZCNUMHdW5pRkI1RAd1bmkwNjgxCWdseXBoMTM4MwlnbHlwaDEzODQJZ2x5cGgxMzg1B3VuaTA2ODIJZ2x5cGgxMzg3CWdseXBoMTM4OAlnbHlwaDEzODkHdW5pMDY4Mwd1bmlGQjc3B3VuaUZCNzgHdW5pRkI3OQd1bmkwNjg0B3VuaUZCNzMHdW5pRkI3NAd1bmlGQjc1B3VuaTA2ODUJZ2x5cGgxMzk5CWdseXBoMTQwMAlnbHlwaDE0MDEHdW5pMDY4Nwd1bmlGQjdmB3VuaUZCODAHdW5pRkI4MQd1bmkwNjg4B3VuaUZCODkHdW5pMDY4OQlnbHlwaDE0MDkHdW5pMDY4QQlnbHlwaDE0MTEHdW5pMDY4QglnbHlwaDE0MTMHdW5pMDY4Qwd1bmlGQjg1B3VuaTA2OEQHdW5pRkI4Mwd1bmkwNjhFB3VuaUZCODcHdW5pMDY4RglnbHlwaDE0MjEHdW5pMDY5MAlnbHlwaDE0MjMHdW5pMDY5MQd1bmlGQjhEB3VuaTA2OTIJZ2x5cGgxNDI2B3VuaTA2OTMJZ2x5cGgxNDI5B3VuaTA2OTQJZ2x5cGgxNDMxB3VuaTA2OTUJZ2x5cGgxNDMzB3VuaTA2OTYJZ2x5cGgxNDM1B3VuaTA2OTcJZ2x5cGgxNDM3B3VuaTA2OTkJZ2x5cGgxNDM5B3VuaTA2OUEJZ2x5cGgxNDQxCWdseXBoMTQ0MglnbHlwaDE0NDMHdW5pMDY5QglnbHlwaDE0NDUJZ2x5cGgxNDQ2CWdseXBoMTQ0Nwd1bmkwNjlDCWdseXBoMTQ0OQlnbHlwaDE0NTAJZ2x5cGgxNDUxB3VuaTA2OUQJZ2x5cGgxNDUzCWdseXBoMTQ1NAlnbHlwaDE0NTUHdW5pMDY5RQlnbHlwaDE0NTcJZ2x5cGgxNDU4CWdseXBoMTQ1OQd1bmkwNjlGCWdseXBoMTQ2MQd1bmkwNkEwCWdseXBoMTQ2MwlnbHlwaDE0NjQJZ2x5cGgxNDY1B3VuaTA2QTEHdW5pMDZBMglnbHlwaDE0NjgJZ2x5cGgxNDY5CWdseXBoMTQ3MAd1bmkwNkEzCWdseXBoMTQ3MglnbHlwaDE0NzMJZ2x5cGgxNDc0B3VuaTA2QTQHdW5pRkI2Qgd1bmlGQjZDB3VuaUZCNkQHdW5pMDZBNQlnbHlwaDE0ODAJZ2x5cGgxNDgxCWdseXBoMTQ4Mgd1bmkwNkE2B3VuaUZCNkYHdW5pRkI3MAd1bmlGQjcxB3VuaTA2QTcJZ2x5cGgxNDg4B3VuaTA2QTgJZ2x5cGgxNDkwB3VuaTA2QUEJZ2x5cGgxNDkyCWdseXBoMTQ5MwlnbHlwaDE0OTQHdW5pMDZBQglnbHlwaDE0OTYJZ2x5cGgxNDk3CWdseXBoMTQ5OAd1bmkwNkFDCWdseXBoMTUwMAlnbHlwaDE1MDEJZ2x5cGgxNTAyB3VuaTA2QUQHdW5pRkJENAd1bmlGQkQ1B3VuaUZCRDYHdW5pMDZBRQlnbHlwaDE1MDgJZ2x5cGgxNTA5CWdseXBoMTUxMAd1bmkwNkIwCWdseXBoMTUxMglnbHlwaDE1MTMJZ2x5cGgxNTE0B3VuaTA2QjEHdW5pRkI5Qgd1bmlGQjlDB3VuaUZCOUQHdW5pMDZCMglnbHlwaDE1MjAJZ2x5cGgxNTIxCWdseXBoMTUyMgd1bmkwNkIzB3VuaUZCOTcHdW5pRkI5OAd1bmlGQjk5B3VuaTA2QjQJZ2x5cGgxNTI4CWdseXBoMTUyOQlnbHlwaDE1MzAHdW5pMDZCNQlnbHlwaDE1MzIJZ2x5cGgxNTMzCWdseXBoMTUzNAd1bmkwNkI2CWdseXBoMTUzNglnbHlwaDE1MzcJZ2x5cGgxNTM4B3VuaTA2QjcJZ2x5cGgxNTQwCWdseXBoMTU0MQlnbHlwaDE1NDIHdW5pMDZCOAlnbHlwaDE1NDQJZ2x5cGgxNTQ1CWdseXBoMTU0Ngd1bmkwNkI5CWdseXBoMTU0OAlnbHlwaDE1NDkJZ2x5cGgxNTUwB3VuaTA2QkEHdW5pRkI5Rgd1bmkwNkJCB3VuaUZCQTEHdW5pMDZCQwlnbHlwaDE1NTYJZ2x5cGgxNTU3CWdseXBoMTU1OAd1bmkwNkJECWdseXBoMTU2MAd1bmkwNkJGCWdseXBoMTU2MglnbHlwaDE1NjMJZ2x5cGgxNTY0B3VuaTA2QzAHdW5pRkJBNQd1bmkwNkMxB3VuaTA2QzIHdW5pMDZDMwd1bmkwNkM0CWdseXBoMTU3MQd1bmkwNkM1B3VuaUZCRTEHdW5pMDZDNgd1bmlGQkRBB3VuaTA2QzcHdW5pRkJEOAd1bmkwNkM4B3VuaUZCREMHdW5pMDZDOQd1bmlGQkUzB3VuaTA2Q0EJZ2x5cGgxNTgzB3VuaTA2Q0IHdW5pRkJERgd1bmkwNkNECWdseXBoMTU4Nwd1bmkwNkNFCWdseXBoMTU4OQlnbHlwaDE1OTAJZ2x5cGgxNTkxB3VuaTA2Q0YJZ2x5cGgxNTkzB3VuaTA2RDAHdW5pRkJFNQd1bmlGQkU2B3VuaUZCRTcHdW5pMDZEMQlnbHlwaDE1OTkHdW5pMDZEMgd1bmlGQkFGB3VuaTA2RDMHdW5pRkJCMQd1bmkwNkQ0B3VuaTA2RDYHdW5pMDZENwd1bmkwNkQ4B3VuaTA2RDkHdW5pMDZEQQd1bmkwNkRCB3VuaTA2REMHdW5pMDZERAd1bmkwNkRFB3VuaTA2REYHdW5pMDZFMAd1bmkwNkUxB3VuaTA2RTIHdW5pMDZFMwd1bmkwNkU0B3VuaTA2RTUHdW5pMDZFNgd1bmkwNkU3B3VuaTA2RTgHdW5pMDZFOQd1bmkwNkVBB3VuaTA2RUIHdW5pMDZFRAd1bmkwNkZBCWdseXBoMTYyOQlnbHlwaDE2MzAJZ2x5cGgxNjMxB3VuaTA2RkIJZ2x5cGgxNjMzCWdseXBoMTYzNAlnbHlwaDE2MzUHdW5pMDZGQwlnbHlwaDE2MzcJZ2x5cGgxNjM4CWdseXBoMTYzOQd1bmkwNkZEB3VuaTA2RkUHdW5pRkJBNgd1bmlGQkE4B3VuaUZCQTkJZ2x5cGgxNjQ1CWdseXBoMTY0NglnbHlwaDE2NDcJZ2x5cGgxNjQ4CWdseXBoMTY0OQlnbHlwaDE2NTAJZ2x5cGgxNjUxB3VuaUZCMUQHdW5pRkIxRQlnbHlwaDE2NTQHdW5pRkIxRglnbHlwaDE2NTYJZ2x5cGgxNjU3CWdseXBoMTY1OAlnbHlwaDE2NTkJZ2x5cGgxNjYwCWdseXBoMTY2MQlnbHlwaDE2NjIJZ2x5cGgxNjYzCWdseXBoMTY2NAlnbHlwaDE2NjUJZ2x5cGgxNjY2CWdseXBoMTY2NwlnbHlwaDE2NjgJZ2x5cGgxNjY5CWdseXBoMTY3MAlnbHlwaDE2NzEJZ2x5cGgxNjcyCWdseXBoMTY3MwAAAAADAAgAAgARAAH//wADAAEAAE0CvyICOQQmAABA2gW6AABNIEFyaWFsICAgICAgICAg/////wA///5BUkxSMDAAAEAAAAAAAQAAAAwAAAAAAAAAAgAZAugC8AABAvEC+AADAvkDBQABAwgDCAABAwoDDAABAxIDEgADAxsDGwABAx8DIgABAycDNgABA0cDSwADA3wDfQABA38DfwACA4ADgAABA4EDjAACA40D9AABA/UD/AACA/8EAAADBAQEBQADBAgECQADBA0EEgADBBQEFQADBEwETgABBGcEaQABBSoGbAABBnIGiQABAAAAAQAAAAoAPgCiAAFhcmFiAAgACgABTUFSIAAaAAAABwAFAAEAAgADAAUABgAAAAcABgAAAAEAAgADAAQABgAIaXNvbAAyaXNvbAA4aW5pdAA+bWVkaQBEZmluYQBKZmluYQBQbGlnYQBWcmxpZwBeAAAAAQAAAAAAAQABAAAAAQACAAAAAQADAAAAAQAEAAAAAQAFAAAAAgAGAAcAAAABAAYACAASACgARgGoAwoFVAeeCMAAAQABAAEACAACAAgAAQZyAAEAAQXfAAEAAQABAAgAAgAMAAMGagYdA5MAAQADBh8GIAYhAAEAAQABAAgAAgCuAFQDIQMpAy8DMwPzA4sDkQOXA5sDnwOjA6cDswO3A7sDvwPDA8cDywPPA9MD1wPbA98D4wPnA+sD6wPzBSkFKgVMBVAFVAVYBVwFYAVkBWgFbAVwBXQFeAV8BaIFpgWqBa4FsgW0BbgFKgW9BcEFxQXJBc0D0wXFBdUF2QXdBeEF5QXpBe0F8QX1BfkF/QYBBgUGCQYNBUwGFQMhBhsGawY2BjwGXgZiBmYAAQBUAx8DJwMtAzEDNQOJA48DlQOZA50DoQOlA7EDtQO5A70DwQPFA8kDzQPRA9UD2QPdA+ED5QPpA+sD8QUoBSwFSgVOBVIFVgVaBV4FYgVmBWoFbgVyBXYFegWgBaQFqAWsBbAFtAW2BboFuwW/BcMFxwXLBc8F0QXTBdcF2wXfBeMF5wXrBe8F8wX3BfsF/wYDBgcGCwYRBhMGFwYZBh8GNAY6BlwGYAZkAAEAAQABAAgAAgCuAFQDIgMqAzADNAP0A4wDkgOYA5wDoAOkA6gDtAO4A7wDwAPEA8gDzAPQA9QD2APcA+AD5APoA+wD7AP0BSkFKwVNBVEFVQVZBV0FYQVlBWkFbQVxBXUFeQV9BaMFpwWrBa8FswW1BbkFKwW+BcIFxgXKBc4D1AXGBdYF2gXeBeIF5gXqBe4F8gX2BfoF/gYCBgYGCgYOBUwGFgMiBhwGbAY3Bj0GXwZjBmcAAQBUAx8DJwMtAzEDNQOJA48DlQOZA50DoQOlA7EDtQO5A70DwQPFA8kDzQPRA9UD2QPdA+ED5QPpA+sD8QUoBSwFSgVOBVIFVgVaBV4FYgVmBWoFbgVyBXYFegWgBaQFqAWsBbAFtAW2BboFuwW/BcMFxwXLBc8F0QXTBdcF2wXfBeMF5wXrBe8F8wX3BfsF/wYDBgcGCwYRBhMGFwYZBh8GNAY6BlwGYAZkAAEAAQABAAgAAgEiAI4DIAMoAywDLgMyAzYDggOEA4YDiAOKA44DkAOUA5YDmgOeA6IDpgOqA6wDrgOwA7IDtgO6A74DwgPGA8oDzgPSA9YD2gPeA+ID5gPqA+oD7gPwA/ID9gP4A/oD/AUoBSwFPQU/BUEFQwVFBUcFSQVLBU8FUwVXBVsFXwVjBWcFawVvBXMFdwV7BX8FgQWDBYUFhwWJBYsFjQWPBZEFkwWVBZcFmQWbBZ0FnwWhBaUFqQWtBbEFtQW3BboFvAXABcQFyAXMBdAF0gXUBdgF3AZzBeQF6AXsBfAF9AX4BfwGAAYEBggGDAYQBhIGFAYYBhoGHgYfBiAGIQYjBiUGJwYpBisGLQYvBjEGMwY1BjkGOwY/BkEGQwZdBmEGZQABAI4DHwMnAysDLQMxAzUDgQODA4UDhwOJA40DjwOTA5UDmQOdA6EDpQOpA6sDrQOvA7EDtQO5A70DwQPFA8kDzQPRA9UD2QPdA+ED5QPpA+sD7QPvA/ED9QP3A/kD+wUoBSwFPAU+BUAFQgVEBUYFSAVKBU4FUgVWBVoFXgViBWYFagVuBXIFdgV6BX4FgAWCBYQFhgWIBYoFjAWOBZAFkgWUBZYFmAWaBZwFngWgBaQFqAWsBbAFtAW2BboFuwW/BcMFxwXLBc8F0QXTBdcF2wXfBeMF5wXrBe8F8wX3BfsF/wYDBgcGCwYPBhEGEwYXBhkGHQYfBiAGIQYiBiQGJgYoBioGLAYuBjAGMgY0BjgGOgY+BkAGQgZcBmAGZAABAAEAAQAIAAIBIgCOAyADKAMsAy4DMgM2A4IDhAOGA4gDigOOA5ADlAOWA5oDngOiA6YDqgOsA64DsAOyA7YDugO+A8IDxgPKA84D0gPWA9oD3gPiA+YD6gPqA+4D8APyA/YD+AP6A/wFKAUsBT0FPwVBBUMFRQVHBUkFSwVPBVMFVwVbBV8FYwVnBWsFbwVzBXcFewV/BYEFgwWFBYcFiQWLBY0FjwWRBZMFlQWXBZkFmwWdBZ8FoQWlBakFrQWxBbUFtwW6BbwFwAXEBcgFzAXQBdIF1AXYBdwF4AXkBegF7AXwBfQF+AX8BgAGBAYIBgwGEAYSBhQGGAYaBh4GHwYgBiEGIwYlBicGKQYrBi0GLwYxBjMGNQY5BjsGPwZBBkMGXQZhBmUAAQCOAx8DJwMrAy0DMQM1A4EDgwOFA4cDiQONA48DkwOVA5kDnQOhA6UDqQOrA60DrwOxA7UDuQO9A8EDxQPJA80D0QPVA9kD3QPhA+UD6QPrA+0D7wPxA/UD9wP5A/sFKAUsBTwFPgVABUIFRAVGBUgFSgVOBVIFVgVaBV4FYgVmBWoFbgVyBXYFegV+BYAFggWEBYYFiAWKBYwFjgWQBZIFlAWWBZgFmgWcBZ4FoAWkBagFrAWwBbQFtgW6BbsFvwXDBccFywXPBdEF0wXXBdsF3wXjBecF6wXvBfMF9wX7Bf8GAwYHBgsGDwYRBhMGFwYZBh0GHwYgBiEGIgYkBiYGKAYqBiwGLgYwBjIGNAY4BjoGPgZABkIGXAZgBmQABAAJAAEACAABAQIACgAaAHAAsgC8AMYA0ADaAOQA7gD4AAoAFgAeACYALAAyADgAPgBEAEoAUAN/AAMD4APqA38AAwPgBh8D9QACA4ID9wACA4QD+QACA4gD+wACA44GeAACBT8GegACBUEGfAACBUMGiAACBT0ACAASABgAHgAkACoAMAA2ADwD9gACA4ID+AACA4QD+gACA4gD/AACA44GeQACBT8GewACBUEGfQACBUMGiQACBT0AAQAEBn4AAgOOAAEABAZ/AAIDjgABAAQGgAACA44AAQAEBoEAAgOOAAEABAaCAAIDjgABAAQGgwACA44AAQAEBoQAAgOOAAEABAaFAAIDjgABAAoD3wPgBf0F/gYBBgIGBQYGBgkGCgAEAAcAAQAIAAEAOgABAAgABgAOABQAGgAgACYALAMSAAIC8QNHAAIC8gNIAAIC8wNJAAIC9ANKAAIC9QNLAAIC9gABAAEC9wAAAAEAAAABYXJhYgAMAAYAAAAAAAUC8AMbBGcEaARpAAAAAAABAAEAAQAAAAEAABpnAAAAFAAAAAAAABpfMIIaWwYJKoZIhvcNAQcCoIIaTDCCGkgCAQExDjAMBggqhkiG9w0CBQUAMGAGCisGAQQBgjcCAQSgUjBQMCwGCisGAQQBgjcCARyiHoAcADwAPAA8AE8AYgBzAG8AbABlAHQAZQA+AD4APjAgMAwGCCqGSIb3DQIFBQAEEKRFzbyY5IhG+q3v+FTiYCOgghS8MIICvDCCAiUCEEoZ0jiMglkcpV1zXxVd3KMwDQYJKoZIhvcNAQEEBQAwgZ4xHzAdBgNVBAoTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxFzAVBgNVBAsTDlZlcmlTaWduLCBJbmMuMSwwKgYDVQQLEyNWZXJpU2lnbiBUaW1lIFN0YW1waW5nIFNlcnZpY2UgUm9vdDE0MDIGA1UECxMrTk8gTElBQklMSVRZIEFDQ0VQVEVELCAoYyk5NyBWZXJpU2lnbiwgSW5jLjAeFw05NzA1MTIwMDAwMDBaFw0wNDAxMDcyMzU5NTlaMIGeMR8wHQYDVQQKExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMRcwFQYDVQQLEw5WZXJpU2lnbiwgSW5jLjEsMCoGA1UECxMjVmVyaVNpZ24gVGltZSBTdGFtcGluZyBTZXJ2aWNlIFJvb3QxNDAyBgNVBAsTK05PIExJQUJJTElUWSBBQ0NFUFRFRCwgKGMpOTcgVmVyaVNpZ24sIEluYy4wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANMuIPBofCwtLoEcsQaypwu3EQ1X2lPYdePJMyqy1PYJWzTz6ZD+CQzQ2xtauc3n9oixncCHJet9WBBzanjLcRX9xlj2KatYXpYE/S1iEViBHMpxlNUiWC/VzBQFhDa6lKq0TUrp7jsirVaZfiGcbIbASkeXarSmNtX8CS3TtDmbAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAYVUOPnvHkhJ+ERCOIszUsxMrW+hE5At4nqR+86cHch7iWe/MhOOJlEzbTmHvs6T7Rj1QNAufcFb2jip/F87lY795aQdzLrCVKIr17aqp0l3NCsoQCY/Os68olsR5KYSS3P+6Z0JIppAQ5L9h+JxT5ZPRcz/4/Z1PhKxV0f0RY2MwggQCMIIDa6ADAgECAhAIem1cb2KTT7rE/UPhFBidMA0GCSqGSIb3DQEBBAUAMIGeMR8wHQYDVQQKExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMRcwFQYDVQQLEw5WZXJpU2lnbiwgSW5jLjEsMCoGA1UECxMjVmVyaVNpZ24gVGltZSBTdGFtcGluZyBTZXJ2aWNlIFJvb3QxNDAyBgNVBAsTK05PIExJQUJJTElUWSBBQ0NFUFRFRCwgKGMpOTcgVmVyaVNpZ24sIEluYy4wHhcNMDEwMjI4MDAwMDAwWhcNMDQwMTA2MjM1OTU5WjCBoDEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTAxMScwJQYDVQQDEx5WZXJpU2lnbiBUaW1lIFN0YW1waW5nIFNlcnZpY2UwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDAemGH67KnA2MbKxph3oC3FR2gi5A9uyeShBQ564XOKZIGZkikA0+N6E+n8K9e0S8Zx5HxtZ57kSHO6f/jTvD8r5VYuGMt5o72KRjNcI5Qw+2Wu0DbviXoQlXW9oXyBueLmRwx8wMP1EycJCrcGxuPgvOw76dN4xSn4I/Wx2jCYVipctT4MEhP2S9vYyDZicqCe8JLvCjFgWjn5oJArEY6oPk/Ns1Mu1RCWnple/6E5MdHVKy5PeyAxxr3xDOBgckqlft/XjqHkBTbzC518u9r5j2pYL5CAapPqluoPyIxnxIV+XOhHoKLBCvqRgJMbY8fUC6VSyp4BoR0PZGPLEcxAgMBAAGjgbgwgbUwQAYIKwYBBQUHAQEENDAyMDAGCCsGAQUFBzABhiRodHRwOi8vb2NzcC52ZXJpc2lnbi5jb20vb2NzcC9zdGF0dXMwCQYDVR0TBAIwADBEBgNVHSAEPTA7MDkGC2CGSAGG+EUBBwEBMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vd3d3LnZlcmlzaWduLmNvbS9ycGEwEwYDVR0lBAwwCgYIKwYBBQUHAwgwCwYDVR0PBAQDAgbAMA0GCSqGSIb3DQEBBAUAA4GBAC3zT2NgLBja9SQPUrMM67O8Z4XCI+2PRg3PGk2+83x6IDAyGGiLkrsymfCTuDsVBid7PgIGAKQhkoQTCsWY5UBXxQUl6K+vEWqp5TvL6SP2lCldQFXzpVOdyDY6OWUIc3OkMtKvrL/HBTz/RezD6Nok0c5jrgmn++Ib4/1BCmqWMIIEEjCCAvqgAwIBAgIPAMEAizw8iBHRPvZj7N9AMA0GCSqGSIb3DQEBBAUAMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5MB4XDTk3MDExMDA3MDAwMFoXDTIwMTIzMTA3MDAwMFowcDErMCkGA1UECxMiQ29weXJpZ2h0IChjKSAxOTk3IE1pY3Jvc29mdCBDb3JwLjEeMBwGA1UECxMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSEwHwYDVQQDExhNaWNyb3NvZnQgUm9vdCBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpAr3BcOY78k4bKJ+XeF4w6qKpjSVf+P6VTKO3/p2iID58UaKboo9gMmvRQmR57qx2yVTa8uuchhyPn4Rms8VremIj1h083g8BkuiWxL8tZpqaaCaZ0Dosvwy1WCbBRucKPjiWLKkoOajsSYNC44QPu5psVWGsgnyhYC13TOmZtGQ7mlAcMQgkFJ+p55ErGOY9mGMUYFgFZZ8dN1KH96fvlALGG9O/VUWziYC/OuxUlE6u/ad6bXROrxjMlgkoIQBXkGBpN7tLEgc8Vv9b+6RmCgim0oFWV++2O14WgXcE2va+roCV/rDNf9anGnJcPMq88AijIjCzBoXJsyB3E4XfAgMBAAGjgagwgaUwgaIGA1UdAQSBmjCBl4AQW9Bw72lyniNRfhSyTY7/y6FyMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5gg8AwQCLPDyIEdE+9mPs30AwDQYJKoZIhvcNAQEEBQADggEBAJXoC8CN85cYNe24ASTYdxHzXGAyn54Lyz4FkYiPyTrmIfLwV5MstaBHyGLv/NfMOztaqTZUaf4kbT/JzKreBXzdMY09nxBwarv+Ek8YacD80EPjEVogT+pie6+qGcgrNyUtvmWhEoolD2Oj91Qc+SHJ1hXzUqxuQzIH/YIX+OVnbA1R9r3xUse958Qw/CAxCYgdlSkaTdUdAqXxgOADtFv0sd3IV+5lScdSVLa0AygS/5DW8AiPfriXxas3LOR65Kh343agANBqP8HSNorgQRKoNWobats14dQcBOSoRQTIWjM4bk0cDWK3CqKM09VUP0bNHFWmcNsSOoeTdZ+n0qAwggTJMIIDsaADAgECAhBqC5lPwADeqhHU2ECaqL7mMA0GCSqGSIb3DQEBBAUAMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5MB4XDTAwMTIxMDA4MDAwMFoXDTA1MTExMjA4MDAwMFowgaYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMjAwMCBNaWNyb3NvZnQgQ29ycC4xIzAhBgNVBAMTGk1pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBMIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEAooQVU9gLMA40lf86G8LzL3ttNyNN89KM5f2v/cUCNB8kx+Wh3FTsfgJ0R6vbMlgWFFEpOPF+srSMOke1OU5uVMIxDDpt+83Ny1CcG66n2NlKJj+1xcuPluJJ8m3Y6ZY+3gXP8KZVN60vYM2AYUKhSVRKDxi3S9mTmTBaR3VktNO73barDJ1PuHM7GDqqtIeMsIiwTU8fThG1M4DfDTpkb0THNL1Kk5u8ph35BSNOYCmPzCryhJqZrajbCnB71jRBkKW3ZsdcGx2jMw6bVAMaP5iQuMznPQR0QxyP9znms6xIemsqDmIBYTl2bv0+mAdLFPEBRv0VAOBH2k/kBeSAJQIBA6OCASgwggEkMBMGA1UdJQQMMAoGCCsGAQUFBwMDMIGiBgNVHQEEgZowgZeAEFvQcO9pcp4jUX4Usk2O/8uhcjBwMSswKQYDVQQLEyJDb3B5cmlnaHQgKGMpIDE5OTcgTWljcm9zb2Z0IENvcnAuMR4wHAYDVQQLExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xITAfBgNVBAMTGE1pY3Jvc29mdCBSb290IEF1dGhvcml0eYIPAMEAizw8iBHRPvZj7N9AMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBQpXLkbts0z7rueWX335couxA00KDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNVHQ8EBAMCAUYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOCAQEARVjimkF//J2/SHd3rozZ5hnFV7QavbS5XwKhRWo5Wfm5J5wtTZ78ouQ4ijhkIkLfuS8qz7fWBsrrKr/gGoV821EIPfQi09TAbYiBFURfZINkxKmULIrbkDdKD7fo1GGPdnbh2SX/JISVjQRWVJShHDo+grzupYeMHIxLeV+1SfpeMmk6H1StdU3fZOcwPNtkSUT7+8QcQnHmoD1F7msAn6xCvboRs1bk+9WiKoHYH06iVb4nj3Cmomwb/1SKgryBS6ahsWZ6qRenywbAR+ums+kxFVM9KgS//3NI3IsnQ/xj6O4kh1u+NtHoMfUy2V7feXq6MKxphkr7jBG/G41UWTCCBQ8wggP3oAMCAQICCmEHEUMAAAAAADQwDQYJKoZIhvcNAQEFBQAwgaYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMjAwMCBNaWNyb3NvZnQgQ29ycC4xIzAhBgNVBAMTGk1pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBMB4XDTAyMDUyNTAwNTU0OFoXDTAzMTEyNTAxMDU0OFowgaExCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMjAwMiBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAMTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKqZvTmoGCf0Kz0LTD98dy6ny7XRjA3COnTXk7XgoEs/WV7ORU+aeSnxScwaR+5Vwgg+EiD4VfLuX9Pgypa8MN7+WMgnMtCFVOjwkRC78yu+GeUDmwuGHfOwOYy4/QsdPHMmrFcryimiFZCCFeJ3o0BSA4udwnC6H+k09vM1kk5Vg/jaMLYg3lcGtVpCBt5Zy/Lfpr0VR3EZJSPSy2+bGXnfalvxdgV5KfzDVsqPRAiFVYrLyA9GS1XLjJZ3SofoqUEGx/8N6WhXY3LDaVe0Q88yOjDcG+nVQyYqef6V2yJnJMkv0DTj5vtRSYa4PNAlX9bsngNhh6loQMf44gPmzwUCAwEAAaOCAUAwggE8MA4GA1UdDwEB/wQEAwIGwDATBgNVHSUEDDAKBggrBgEFBQcDAzAdBgNVHQ4EFgQUa8jGUSDwtC/ToLauf14msriHUikwgakGA1UdIwSBoTCBnoAUKVy5G7bNM+67nll99+XKLsQNNCihdKRyMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5ghBqC5lPwADeqhHU2ECaqL7mMEoGA1UdHwRDMEEwP6A9oDuGOWh0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL0NvZGVTaWduUENBLmNybDANBgkqhkiG9w0BAQUFAAOCAQEANSP9E1T86dzw3QwUevqns879pzrIuuXn9gP7U9unmamgmzacA+uCRxwhvRTL52dACccWkQJVzkNCtM0bXbDzMgQ9EuUdpwenj6N+RVV2G5aVkWnw3TjzSInvcEC327VVgMADxC62KNwKgg7HQ+N6SF24BomSQGxuxdz4mu8LviEKjC86te2nznGHaCPhs+QYfbhHAaUrxFjLsolsX/3TLMRvuCOyDf888hFFdPIJBpkY3W/AhgEYEh0rFq9W72UzoepnTvRLgqvpD9wB+t9gf2ZHXcsscMx7TtkGuG6MDP5iHkL5k3yiqwqe0CMQrk17J5FvJr5o+qY/nyPryJ27hzGCBQ8wggULAgEBMIG1MIGmMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSswKQYDVQQLEyJDb3B5cmlnaHQgKGMpIDIwMDAgTWljcm9zb2Z0IENvcnAuMSMwIQYDVQQDExpNaWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQQIKYQcRQwAAAAAANDAMBggqhkiG9w0CBQUAoIHcMBQGCSsGAQQBgjcoATEHAwUAAwAAADAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgorBgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAfBgkqhkiG9w0BCQQxEgQQWgcErdNb7kkwQaDV2L6G0DBqBgorBgEEAYI3AgEMMVwwWqAwgC4AQQByAGkAYQBsACAARgBvAG4AdAAgAFYAZQByAHMAaQBvAG4AIAAzAC4AMAAwoSaAJGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS90eXBvZ3JhcGh5IDANBgkqhkiG9w0BAQEFAASCAQBONxfiGjeZWScLyZcq61DgYQLWI4ZInfCUvZkdYMEqR6+3j1k4BfOkg5eVe/EEJAhTzG3Kx8cZQJErT8e8l64cOtp8d9SBdY5cIjyZB1KK/uOwZ+cOHvTtLnSTRooSlkxICw3/X8OKO+q731sIClz/owxN6VFHVLyC1STlgeq9wbexwgp5cpZkrfJmgvr1AIYc79WlpiOVEz0hqprzskzpPOFQlpeF91CZ14gVP5iRWBJC2lR6hJukMjZEwKv3o54IFRf8aFWgUzxY7cYq9Jp9zTBCjIYFBtLG5Rua7/Uy0NOJ37yfdY3Om3liK/oUKxOzpB4IpFc/jFn6+8X6sNP8oYICTDCCAkgGCSqGSIb3DQEJBjGCAjkwggI1AgEBMIGzMIGeMR8wHQYDVQQKExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMRcwFQYDVQQLEw5WZXJpU2lnbiwgSW5jLjEsMCoGA1UECxMjVmVyaVNpZ24gVGltZSBTdGFtcGluZyBTZXJ2aWNlIFJvb3QxNDAyBgNVBAsTK05PIExJQUJJTElUWSBBQ0NFUFRFRCwgKGMpOTcgVmVyaVNpZ24sIEluYy4CEAh6bVxvYpNPusT9Q+EUGJ0wDAYIKoZIhvcNAgUFAKBZMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTAyMTAxODIxMTczNFowHwYJKoZIhvcNAQkEMRIEEAxp+xpeNWgUkJFzI3XdgF8wDQYJKoZIhvcNAQEBBQAEggEApmslO+JU0q/35zePkU/XAFcRNqCjVOiqCRUKseIPBHg40Om+3go/jEGYsCxYO1b10ENE094cJqp65+8p3h6IQG9qkELfEnsSsbpxFKjrp6MOiXPpA4C0lsMQ5ebjM3ab2ud+bew4FTHB/ewhaolU/FDT/mKNOAVm8Hg444Efa44rLDKRuNj/BwqEiUyWP23YnYVhOyaZPrtzl6EKsp6pLjijDl+zU+nbnwOmHB2rSkdjDhWakAL9IPVQ0JQieAmFdJtN7+siQKy4rnVdrMCOOvn3tzRbXOGb+u/EJDRKXpX74XQcmk6sdq5/FgZC8vVxTbrU8jT3GNWYRFDyY/tySwA="}sVt.prototype.drawFreeTextAnnotations=function(e,t,i){var n,o,r=e.data,s=r.replace(/"/g,""),a=JSON.parse(e.bounds),t=t.getPage(e.pageIndex);""!==r&&(r=this.convertPixelToPoint(a.left),n=this.convertPixelToPoint(a.top),o=this.convertPixelToPoint(a.width),a=this.convertPixelToPoint(a.height),(r=new VEt(r,n,o,a))._dictionary.set("NM",e.signatureName.toString()),n=e.fontSize,r.border.width=0,o=Zxt.helvetica,je(a=e.fontFamily.toString())||((e=a.toString()).includes("Times New Roman")?o=Zxt.timesRoman:e.includes("Courier")?o=Zxt.courier:e.includes("Symbol")?o=Zxt.symbol:e.includes("ZapfDingbats")&&(o=Zxt.zapfDingbats)),n=Math.floor(this.convertPixelToPoint(n)),a=Jxt.regular,r.font=new _xt(o,n,a),r.text=s,r.borderColor=[0,0,0],r.textAlignment=MAt.center,r._annotFlags=bAt.print,i&&(e=this.getRotateAngle(t.rotation),r.rotationAngle=Math.abs(e)),r.setValues("AnnotationType","Signature"),i&&(r.flatten=!0),r.setAppearance(!0),t.annotations.add(r))},sVt.prototype.getRotateAngle=function(e){var t=0;switch(e){case TAt.angle0:t=0;break;case TAt.angle180:t=2;break;case TAt.angle270:t=3;break;case TAt.angle90:t=1}return t},sVt.prototype.drawImage=function(e,t,i){var n,o,r,s,a=e.data,l=JSON.parse(e.bounds),t=t.getPage(e.pageIndex);""!==a&&(a=a.toString().split(",")[1],r=this.convertPixelToPoint(l.left),s=this.convertPixelToPoint(l.top),n=this.convertPixelToPoint(l.width),l=this.convertPixelToPoint(l.height),t.rotation!==TAt.angle90&&t.rotation!==TAt.angle270||(n=(o=[l,n])[0],l=o[1]),o=new BEt(r,s,n,l),r=new JFt(a),s=t.graphics,a=o.appearance.normal,o._dictionary.set("NM",e.signatureName.toString()),e=this.getRotateAngle(t.rotation),o.rotationAngle=Math.abs(e),i&&(o.flatten=!0),i?a.graphics.drawImage(r,0,0,n,l):(e=s.save(),a.graphics.drawImage(r,0,0,n,l),a.graphics.restore(e)),t.annotations.add(o))},sVt.prototype.saveFormFieldsDesignerData=function(e){if(Object.prototype.hasOwnProperty.call(e,"formDesigner")){var t=e.formDesigner;if(!je(t)){var i=JSON.parse(t);Object.prototype.hasOwnProperty.call(e,"formFieldsPageList")&&JSON.parse(e.formFieldsPageList);if(!je(this.formFieldLoadedDocument.form))for(var t=this.formFieldLoadedDocument.form._fields.length,n=this.formFieldLoadedDocument.form,o=t-1;0<=o;o--){var r=n.fieldAt(o),s=null,r=!!je(s=r instanceof bTt?r:s)||s.isSigned;null!=s&&r||n.removeField(n.fieldAt(o))}for(var a=0;a<i.length;a++)this.addFormFieldsToDocument(i[parseInt(a.toString(),10)].FormField)}if(!je(this.formFieldLoadedDocument.form))if(je(this.defaultAppearanceFields))this.formFieldLoadedDocument.form.setDefaultAppearance(!1);else{for(a=0;a<this.formFieldLoadedDocument.form.count;a++){var l=this.formFieldLoadedDocument.form.fieldAt(a);-1===this.defaultAppearanceFields.indexOf(l.name)&&l.setAppearance(!0)}this.defaultAppearanceFields=null}}},sVt.prototype.setFont=function(e,t){var i=this.getFontStyle(e),n=(t._dictionary.set("FontStyle",i),/[^\u0000-\u007F]/.test(t.text));t.font=n?this.getTrueFont(e.fontSize,i):new _xt(this.getFontFamily(e.FontFamily),this.convertPixelToPoint(e.fontSize),i)},sVt.prototype.saveFormFieldsData=function(e){if(Object.prototype.hasOwnProperty.call(e,"fieldsData")){var e=e.fieldsData,t=JSON.parse(e);if(!je(t)&&0<Object.keys(t).length&&!je(this.formFieldLoadedDocument.form)){0<this.formFieldLoadedDocument.form._fields.length&&this.formFieldLoadedDocument.form.setDefaultAppearance(!1);for(var i=0;i<this.formFieldLoadedDocument.form._fields.length;i++){var n=this.formFieldLoadedDocument.form.fieldAt(i),o="",r="";if(je(n.name)||(o=n.name.replace(/[^0-9a-zA-Z]+/g,"").replace(/\s+/g,""),r=n.name),n instanceof ZIt)n.password,(Object.prototype.hasOwnProperty.call(t,o)&&!je(t[""+o])||Object.prototype.hasOwnProperty.call(t,r)&&!je(t[""+r]))&&(!je(s=t[""+(o=Object.prototype.hasOwnProperty.call(t,r)?r:o)])&&Object.prototype.hasOwnProperty.call(s,"isReadOnly")&&(n.text=s.fieldValue,n.readOnly="true"===s.isReadOnly),this.setFont(s,n));else if(n instanceof uTt){if(Object.prototype.hasOwnProperty.call(t,o)&&!je(t[""+o])||Object.prototype.hasOwnProperty.call(t,r)&&!je(t[""+r])){for(var s=t[""+(o=Object.prototype.hasOwnProperty.call(t,r)?r:o)],a=n.itemsCount,l="",h=(je(s)||(Object.prototype.hasOwnProperty.call(s,"isReadOnly")&&(n.readOnly="true"===s.isReadOnly),je(s.fieldValue))||(l=s.fieldValue),!1),d=0;d<a;d++){var p=void 0;n._dictionary.has("Opt")?p=n._dictionary.get("Opt")[parseInt(d.toString(),10)]:je(n.itemAt(d))||(p=n.itemAt(d).text),(p===l||p&&0<p.length&&p[1]===l)&&(n.selectedIndex=d,h=!0)}n.editable&&!h&&(n.selectedValue=l),this.setFont(s,n)}}else if(n instanceof oTt){if(Object.prototype.hasOwnProperty.call(t,o)&&!je(t[""+o])||Object.prototype.hasOwnProperty.call(t,r)&&!je(t[""+r])){var c=(s=t[""+(o=Object.prototype.hasOwnProperty.call(t,r)?r:o)]).isSelected,u=c.toString(),g=s.fieldValue;if(je(g)||n._dictionary.set("ExportValue",g),"true"===u.toLowerCase()||"false"===u.toLowerCase()){if(n.checked=c,!je(s)&&Object.prototype.hasOwnProperty.call(s,"isReadOnly")&&(n.readOnly=s.readonly),"false"===u.toLowerCase()){for(var m=n,f=0;f<m.itemsCount;f++)m.itemAt(f).checked=!1;n.checked=!1}}else{g=je(u)?-1:parseInt(u,10);if(0<(m=n).itemsCount)if(-1===g){for(var y=0;y<m.itemsCount;y++)m.itemAt(y).checked=!1;n.checked=!1}else je(m.itemAt(g))||(m.itemAt(g).checked=!0)}}}else if(n instanceof fTt){if(Object.prototype.hasOwnProperty.call(t,o)&&!je(t[""+o])||Object.prototype.hasOwnProperty.call(t,r)&&!je(t[""+r])){for(var c=t[""+(o=Object.prototype.hasOwnProperty.call(t,r)?r:o)],a=n.itemsCount,l="",v=(je(c)||(Object.prototype.hasOwnProperty.call(c,"fieldValue")&&!je(c.fieldValue)&&(l=c.fieldValue),Object.prototype.hasOwnProperty.call(c,"isReadOnly")&&(n.readOnly="true"===c.isReadOnly)),l=JSON.parse(l)[0].replace(/[^0-9a-zA-Z]+/g,""),[]),f=0;f<a;f++)(p=n.itemAt(f).text)===l&&v.push(f);n.selectedIndex=v,this.setFont(c,n)}}else if(n instanceof aTt){if(Object.prototype.hasOwnProperty.call(t,o)&&!je(t[""+o])||Object.prototype.hasOwnProperty.call(t,r)&&!je(t[""+r]))if(!je(s=t[""+(o=Object.prototype.hasOwnProperty.call(t,r)?r:o)])&&Object.prototype.hasOwnProperty.call(s,"isReadOnly")){var b=s.fieldValue;if(b)for(var w=0;w<n.itemsCount;w++){var C=n.itemAt(w);if(C&&(C.value===b||C._optionValue===b)){n.selectedIndex=w;break}}n.readOnly="true"===s.isReadOnly}}else if(n instanceof bTt){if(Object.prototype.hasOwnProperty.call(t,o)&&!je(t[""+o])||Object.prototype.hasOwnProperty.call(t,r)&&!je(t[""+r])){Object.prototype.hasOwnProperty.call(t,r)&&(o=r);var S=n,A=(Object.prototype.hasOwnProperty.call(t,o+"fontName")?this.drawFieldFreeTextAnnotations(t[""+o],S,o,t[o+"bounds"],t[o+"fontName"],t[o+"fontSize"]):Object.prototype.hasOwnProperty.call(t,o+"ImageData")?this.drawFieldImage(t[""+o],S,o,t[o+"bounds"]):Object.prototype.hasOwnProperty.call(t,o+"bounds")&&this.drawFieldPath(t[""+o],S,o,t[o+"bounds"]),S.itemsCount);if(0<A)for(f=0;f<A;f++)Object.prototype.hasOwnProperty.call(t,o+"fontName_"+f)?this.drawFieldFreeTextAnnotations(t[""+o],S,o,t[o+"bounds_"+f],t[o+"fontName_"+f],t[o+"fontSize_"+f]):Object.prototype.hasOwnProperty.call(t,o+"ImageData_"+f)?this.drawFieldImage(t[""+o],S,o,t[o+"bounds_"+f]):Object.prototype.hasOwnProperty.call(t,o+"bounds_"+f)&&this.drawFieldPath(t[""+o],S,o,t[o+"bounds_"+f])}(Object.prototype.hasOwnProperty.call(t,o+"isReadOnly")||Object.prototype.hasOwnProperty.call(t,r+"isReadOnly"))&&(Object.prototype.hasOwnProperty.call(t,r+"isReadOnly")&&(o=r),n.readOnly="true"===t.isReadOnly)}}}}},sVt.prototype.addFormFieldsToDocument=function(e){var t,i=this.formFieldLoadedDocument.getPage(e.pageNumber-1);switch(e.formFieldAnnotationType){case"Textbox":case"PasswordField":t=this.saveTextBoxField(i,e);break;case"Checkbox":t=this.SaveCheckBoxField(i,e);break;case"RadioButton":t=this.saveRadioButtonField(e);break;case"DropdownList":t=this.saveDropDownField(i,e);break;case"ListBox":t=this.saveListBoxField(i,e);break;case"SignatureField":case"InitialField":t=this.saveSignatureField(i,e)}t&&this.formFieldLoadedDocument.form.add(t)},sVt.prototype.setFontFromKeys=function(e,t,i,n,o,r){i=mRt.tryGetFontFromKeys(i,e.toString(),n,r);je(i)?o&&(o=this.getTrueFont(n,r),mRt.isSupportedFont(e,i))?t.font=o:this.disableFieldAppearance(t):(t.font=i,t.setAppearance(!0))},sVt.prototype.setFontAppearance=function(t,e,i,n,o,r,s){if(!je(o)&&0<Object.keys(o).length){var e=mRt.getFontKey(o,e.toLowerCase());!je(e)&&(e=o[""+e],e=mRt.processFontStream(e),e=new Uxt(e,this.convertPixelToPoint(i),s),a=mRt.isSupportedFont(t,e),n.setAppearance(a),a)?n.font=e:this.setFontFromKeys(t,n,o,i,r,s)}else try{n.font.measureString(t.toString())}catch(e){var a;r&&(a=this.getTrueFont(i,s),mRt.isSupportedFont(t,a))?n.font=a:this.disableFieldAppearance(n)}},sVt.prototype.disableFieldAppearance=function(e){e.setAppearance(!1),je(this.defaultAppearanceFields)&&(this.defaultAppearanceFields=[]),this.defaultAppearanceFields.push(e.name)},sVt.prototype.saveTextBoxField=function(e,t){var i=je(t.name)?"Password"===t.type?"passwordTextbox":"textbox":t.name,n=this.convertFieldBounds(t),o=e.rotation,r=!1,n=(0!==t.rotation&&(r=!0),this.getBounds(n,e.size[1],e.size[0],o,r)),o={x:n.X,y:n.Y,width:n.Width,height:n.Height},n=new ZIt(e,i,o),i=(n.backColor=[t.backgroundColor.r,t.backgroundColor.g,t.backgroundColor.b],0===t.backgroundColor.r&&0===t.backgroundColor.g&&0===t.backgroundColor.b&&0===t.backgroundColor.a&&(n.backColor=[t.backgroundColor.r,t.backgroundColor.g,t.backgroundColor.b,t.backgroundColor.a]),n.maxLength=t.maxLength,n.insertSpaces=t.insertSpaces,n.readOnly=t.isReadonly,n.required=t.isRequired,n.textAlignment=this.getTextAlignment(t.textAlign),n.visibility=this.getFormFieldsVisibility(t.visibility),n.text=je(t.value)?"":t.value,n.toolTip=je(t.tooltip)?"":t.tooltip,n.color=[t.fontColor.r,t.fontColor.g,t.fontColor.b],n.borderColor=[t.borderColor.r,t.borderColor.g,t.borderColor.b],0==t.borderColor.r&&0==t.borderColor.g&&0==t.borderColor.b&&0==t.borderColor.a&&(n.borderColor=[t.borderColor.r,t.borderColor.g,t.borderColor.b,t.borderColor.a]),n.border.width=t.thickness,n.multiLine=t.Multiline,this.getFontStyle(t)),o=(n._dictionary.set("FontStyle",i),/[^\u0000-\u007F]/.test(n.text)),s=t.FontFamily||t.fontFamily;return n.font=new _xt(this.getFontFamily(s),this.convertPixelToPoint(t.fontSize),i),je(n.text.toString())||(s=this.pdfViewer.pdfRenderer.FallbackFontCollection,this.setFontAppearance(n.text.toString(),t.fontFamily,t.fontSize,n,s,o,i)),"PasswordField"===t.formFieldAnnotationType&&(n.password=!0),r||(n.rotate=this.getFormfieldRotation(e.rotation)),je(t.customData)||(s=JSON.stringify(t.customData),n._dictionary.set("CustomData",s)),n},sVt.prototype.saveDropDownField=function(e,t){for(var i=je(t.name)?"dropdownList":t.name,n=this.convertFieldBounds(t),o=e.rotation,r=!1,n=(0!==t.rotation&&(r=!0),this.getBounds(n,e.size[1],e.size[0],o,r)),o={x:n.X,y:n.Y,width:n.Width,height:n.Height},s=new uTt(e,i,o),a=!1,l=0;l<t.option.length;l++){var h=new iDt(t.option[parseInt(l.toString(),10)].itemName,t.option[parseInt(l.toString(),10)].itemValue);s.addItem(h),/[^\u0000-\u007F]/.test(t.option[parseInt(l.toString(),10)].itemName)&&(a=!0)}s.textAlignment=this.getTextAlignment(t.textAlign);var d=this.getFontStyle(t),n=(s._dictionary.set("FontStyle",d),t.FontFamily||t.fontFamily);s.font=new _xt(this.getFontFamily(n),this.convertPixelToPoint(t.fontSize),d);for(l=0;l<t.option.length;l++){var p=t.option[parseInt(l.toString(),10)].itemName.toString();if(!je(p)){var c=this.pdfViewer.pdfRenderer.FallbackFontCollection;this.setFontAppearance(p,t.fontFamily,t.fontSize,s,c,a,d);break}}return 0<s.itemsCount&&(0<t.selectedIndex.length?s.selectedIndex=t.selectedIndex[0]:s.selectedIndex=0),s.required=t.isRequired,s.readOnly=t.isReadonly,s.visibility=this.getFormFieldsVisibility(t.visibility),s.backColor=[t.backgroundColor.r,t.backgroundColor.g,t.backgroundColor.b],0===t.backgroundColor.r&&0===t.backgroundColor.g&&0===t.backgroundColor.b&&0===t.backgroundColor.a&&(s.backColor=[t.backgroundColor.r,t.backgroundColor.g,t.backgroundColor.b,t.backgroundColor.a]),s.borderColor=[t.borderColor.r,t.borderColor.g,t.borderColor.b],0==t.borderColor.r&&0==t.borderColor.g&&0==t.borderColor.b&&0==t.borderColor.a&&(s.borderColor=[t.borderColor.r,t.borderColor.g,t.borderColor.b,t.borderColor.a]),s.border.width=t.thickness,s.color=[t.fontColor.r,t.fontColor.g,t.fontColor.b],r||(s.rotate=this.getFormfieldRotation(e.rotation)),s.toolTip=je(t.tooltip)?"":t.tooltip,je(t.customData)||(i=JSON.stringify(t.customData),s._dictionary.set("CustomData",i)),s},sVt.prototype.SaveCheckBoxField=function(e,t){var i=je(t.name)&&""===t.name?"checkboxField":t.name,n=this.convertFieldBounds(t),o=e.rotation,r=!1,n=(0!==t.rotation&&(r=!0),this.getBounds(n,e.size[1],e.size[0],o,r)),o={x:n.X,y:n.Y,width:n.Width,height:n.Height},n=new oTt(i,o,e);return n.readOnly=t.isReadonly,n.required=t.isRequired,n.checked=t.isChecked,n.visibility=this.getFormFieldsVisibility(t.visibility),n._dictionary.set("ExportValue",t.value),n.backColor=[t.backgroundColor.r,t.backgroundColor.g,t.backgroundColor.b],0===t.backgroundColor.r&&0===t.backgroundColor.g&&0===t.backgroundColor.b&&0===t.backgroundColor.a&&(n.backColor=[t.backgroundColor.r,t.backgroundColor.g,t.backgroundColor.b,t.backgroundColor.a]),n.borderColor=[t.borderColor.r,t.borderColor.g,t.borderColor.b],0===t.borderColor.r&&0===t.borderColor.g&&0===t.borderColor.b&&0===t.borderColor.a&&(n.borderColor=[t.borderColor.r,t.borderColor.g,t.borderColor.b,t.borderColor.a]),n.border.width=t.thickness,n.toolTip=je(t.tooltip)?"":t.tooltip,r||(n.rotate=this.getFormfieldRotation(e.rotation)),je(t.customData)||(i=JSON.stringify(t.customData),n._dictionary.set("CustomData",i)),n},sVt.prototype.saveListBoxField=function(e,t){for(var i=je(t.name)?"listBox":t.name,n=this.convertFieldBounds(t),o=e.rotation,r=!1,n=(0!==t.rotation&&(r=!0),this.getBounds(n,e.size[1],e.size[0],o,r)),o={x:n.X,y:n.Y,width:n.Width,height:n.Height},s=new fTt(e,i,o),a=!1,l=!1,h=0;h<t.option.length;h++){var d=new iDt(t.option[parseInt(h.toString(),10)].itemName,t.option[parseInt(h.toString(),10)].itemValue);s.addItem(d),/[^\u0000-\u007F]/.test(t.option[parseInt(h.toString(),10)].itemName)&&(l=!0),je(d&&d._dictionary&&!a)||(d.textAlignment=this.getTextAlignment(t.textAlign),a=!0)}if(0<s.itemsCount){var p=t.selectedIndex.length;if(Array.isArray(t.selectedIndex)&&0<p)if(1===p)s.selectedIndex=t.selectedIndex[0];else{for(var c=[],u=0;u<p;u++)c.push(t.selectedIndex[parseInt(u.toString(),10)]);s.selectedIndex=c}else s.selectedIndex=0}s.textAlignment=this.getTextAlignment(t.textAlign),s.multiSelect=!0,s.backColor=[t.backgroundColor.r,t.backgroundColor.g,t.backgroundColor.b],0===t.backgroundColor.r&&0===t.backgroundColor.g&&0===t.backgroundColor.b&&0===t.backgroundColor.a&&(s.backColor=[t.backgroundColor.r,t.backgroundColor.g,t.backgroundColor.b,t.backgroundColor.a]),s.borderColor=[t.borderColor.r,t.borderColor.g,t.borderColor.b],0==t.borderColor.r&&0==t.borderColor.g&&0==t.borderColor.b&&0==t.borderColor.a&&(s.borderColor=[t.borderColor.r,t.borderColor.g,t.borderColor.b,t.borderColor.a]),s.border.width=t.thickness;var g=this.getFontStyle(t),n=(s._dictionary.set("FontStyle",g),t.FontFamily||t.fontFamily);s.font=new _xt(this.getFontFamily(n),this.convertPixelToPoint(t.fontSize),g);for(h=0;h<t.option.length;h++){var m=t.option[parseInt(h.toString(),10)].itemName.toString();if(!je(m)){var f=this.pdfViewer.pdfRenderer.FallbackFontCollection;this.setFontAppearance(m,t.fontFamily,t.fontSize,s,f,l,g);break}}return s.readOnly=t.isReadonly,s.required=t.isRequired,s.visibility=this.getFormFieldsVisibility(t.visibility),s.toolTip=je(t.tooltip)?"":t.tooltip,r||(s.rotate=this.getFormfieldRotation(e.rotation)),je(t.customData)||(i=JSON.stringify(t.customData),s._dictionary.set("CustomData",i)),s},sVt.prototype.saveRadioButtonField=function(e){for(var t,i=this.formFieldLoadedDocument.getPage(e.pageNumber-1),n=je(e.radiobuttonItem[0].name)?"radiobuttonField":e.radiobuttonItem[0].name,o=new aTt(i,n),r=0,s=!1,a=!1,l=!1,h=0;h<e.radiobuttonItem.length;h++){var d=e.radiobuttonItem[parseInt(h.toString(),10)],p=this.formFieldLoadedDocument.getPage(d.pageNumber-1),c=je(d.value)||""===d.value?n:d.value,u=this.getRotateAngle(p.rotation),g=this.convertFieldBounds(d),m=!1,g=(0!==e.rotation&&(m=!0),this.getBounds(g,p.size[1],p.size[0],u,m)),u={x:g.X,y:g.Y,width:g.Width,height:g.Height},g=new $Et(c,u,p);m&&(g.rotationAngle=this.GetRotateAngle(p.rotation)),d.isReadonly&&(a=!0),d.isRequired&&(l=!0),g.borderColor=[d.borderColor.r,d.borderColor.g,d.borderColor.b],0==d.borderColor.r&&0==d.borderColor.g&&0==d.borderColor.b&&0==d.borderColor.a&&(g.borderColor=[d.borderColor.r,d.borderColor.g,d.borderColor.b,d.borderColor.a]),g.border.width=d.thickness,g.backColor=[d.backgroundColor.r,d.backgroundColor.g,d.backgroundColor.b],0===d.backgroundColor.r&&0===d.backgroundColor.g&&0===d.backgroundColor.b&&0===d.backgroundColor.a&&(g.backColor=[d.backgroundColor.r,d.backgroundColor.g,d.backgroundColor.b,d.backgroundColor.a]),g.visibility=this.getFormFieldsVisibility(d.visibility),o.add(g),d.isSelected&&(r=h,s=!0)}return o.readOnly=a,o.required=l,o.toolTip=je(e.tooltip)?"":e.tooltip,s&&(o.selectedIndex=r),je(e.radiobuttonItem[0].customData)?je(e.customData)||(t=JSON.stringify(e.customData),o._dictionary.set("CustomData",t)):(t=JSON.stringify(e.radiobuttonItem[0].customData),o._dictionary.set("CustomData",t)),o},sVt.prototype.saveSignatureField=function(e,t){var i=je(t.name)?"signatureField":t.name,n=this.convertFieldBounds(t),o=e.rotation,r=!1,n=(0!==t.rotation&&(r=!0),this.getBounds(n,e.size[1],e.size[0],o,r)),o={x:n.X,y:n.Y,width:n.Width,height:n.Height},n=new bTt(e,i,o);return n.toolTip=t.tooltip,n.required=t.isRequired,n.readOnly=t.isReadonly,"InitialField"===t.formFieldAnnotationType&&n._dictionary.set("InitialField",!0),""===t.value&&(n.backColor=[t.backgroundColor.r,t.backgroundColor.g,t.backgroundColor.b],0===t.backgroundColor.r)&&0===t.backgroundColor.g&&0===t.backgroundColor.b&&0===t.backgroundColor.a&&(n.backColor=[t.backgroundColor.r,t.backgroundColor.g,t.backgroundColor.b,t.backgroundColor.a]),n.borderColor=[t.borderColor.r,t.borderColor.g,t.borderColor.b],0===t.borderColor.r&&0===t.borderColor.g&&0===t.borderColor.b&&0===t.borderColor.a&&(n.borderColor=[t.borderColor.r,t.borderColor.g,t.borderColor.b,t.borderColor.a]),n.border.width=t.thickness,"hidden"===t.visibility?n.visible=!1:"visible"===t.visibility&&(n.visible=!0),"Text"===t.signatureType?this.drawDesignerFieldFreeTextAnnotations(n,i,t):"Image"===t.signatureType?this.drawDesignerFieldImage(n,i,t):"Path"!==t.signatureType||je(t.value)||""===t.value||this.drawDesignerFieldPath(n,i,t),r||(n.rotate=this.getFormfieldRotation(e.rotation)),je(t.customData)||(o=JSON.stringify(t.customData),n._dictionary.set("CustomData",o)),n},sVt.prototype.drawDesignerFieldFreeTextAnnotations=function(e,t,i){var n=i.signatureBound.x,o=i.signatureBound.y,r=i.signatureBound.width,s=i.signatureBound.height,e=e.page,a=e.rotation,l=i.zoomValue,n={X:this.convertPixelToPoint(n/l),Y:this.convertPixelToPoint(o/l),Width:this.convertPixelToPoint(r/l),Height:this.convertPixelToPoint(s/l)},o=!1;0!==i.rotation&&(o=!0),n=this.getBounds(n,e.size[1],e.size[0],a,o),je(i)||(n={X:r=n.X,Y:s=n.Y,Width:l=n.Width,Height:a=n.Height},(r=new VEt(r,s,l,a)).setAppearance(!0),r._dictionary.set("T",t),s=i.fontSize,l=Zxt.helvetica,je(i.fontFamily)||(l=this.getFontFamily(i.fontFamily)),a=this.getFontStyle(i),t=/[^\u0000-\u007F]/.test(i.value),r.font=t?this.getTrueFont(this.convertPixelToPoint(s),a):new _xt(l,this.convertPixelToPoint(i.fontSize),a),r.text=i.value,this.setFontSize(this.convertPixelToPoint(s),r.font,i.value,n,l,a),r.border.width=0,r.textAlignment=MAt.center,r.flags=bAt.print,"hidden"===i.visibility&&(r.flags=bAt.hidden),o||(r.rotationAngle=Math.abs(this.getRotateAngle(e.rotation))),r.setValues("AnnotationType","Signature"),r.setAppearance(!0),e.annotations.add(r))},sVt.prototype.drawDesignerFieldImage=function(e,t,i){var n=i.signatureBound.x,o=i.signatureBound.y,r=i.signatureBound.width,s=i.signatureBound.height,e=e.page,a=e.rotation,l=i.zoomValue,n={X:this.convertPixelToPoint(n/l),Y:this.convertPixelToPoint(o/l),Width:this.convertPixelToPoint(r/l),Height:this.convertPixelToPoint(s/l)},o=!1;0!==i.rotation&&(o=!0),n=this.getBounds(n,e.size[1],e.size[0],a,o),je(i)||(r=n.X,s=n.Y,l=n.Width,a=n.Height,n=i.value.toString().split(",")[1],r=new BEt(r,s,l,a),s=new JFt(n),r.appearance.normal.graphics.drawImage(s,0,0,l,a),o||(r.rotationAngle=Math.abs(this.getRotateAngle(e.rotation))),r._dictionary.set("T",t),r.flags=bAt.print,"hidden"===i.visibility&&(r.flags=bAt.hidden),e.annotations.add(r))},sVt.prototype.drawDesignerFieldPath=function(e,t,i){for(var n=JSON.parse(i.value),o=i.signatureBound.x,r=i.signatureBound.y,s=i.signatureBound.width,a=i.signatureBound.height,l=e.page,e=l.rotation,h=i.zoomValue,o={X:this.convertPixelToPoint(o/h),Y:this.convertPixelToPoint(r/h),Width:this.convertPixelToPoint(s/h),Height:this.convertPixelToPoint(a/h)},o=this.getBounds(o,l.size[1],l.size[0],e,!1),d=0,p=0;p<this.formFieldLoadedDocument.pageCount&&l!==this.formFieldLoadedDocument.getPage(p);p++)d++;if(0<n.length){for(var c=o.X,u=o.Y,r=o.Width,s=o.Height,g=-1,m=-1,f=-1,y=-1,v=new nIt,b=0;b<n.length;b++){var w=n[parseInt(b.toString(),10)];v.addLine(w.x,w.y,0,0)}for(b=0;b<v._points.length;b+=2){var C,S,A=v._points[parseInt(b.toString(),10)];-1===g?(g=A[0],m=A[1],f=A[0],y=A[1]):((C=A[0])<=g&&(g=C),(S=A[1])<=m&&(m=S),f<=C&&(f=C),y<=S&&(y=S))}var x=(f-g)/r,I=(y-m)/s,T=[],E=0;if(0!==e){for(var D=0;D<n.length;D++){if("M"===(A=n[parseInt(D.toString(),10)]).command.toString()&&0!==D){E=D;break}T.push(parseFloat(A.x)),T.push(parseFloat(A.y))}for(var T=[],M=0;M<n.length;M++){A=n[parseInt(M.toString(),10)];T.push((parseFloat(A.x)-g)/x+c),T.push(this.formFieldLoadedDocument.getPage(d).size[1]-(parseFloat(A.y)-m)/I-u)}}else for(p=0;p<n.length;p++){if("M"===(A=n[parseInt(p.toString(),10)]).command.toString()&&0!==p){E=p;break}T.push((parseFloat(A.x)-g)/x+c);var k=(parseFloat(A.y)-m)/I;T.push(this.formFieldLoadedDocument.getPage(d).size[1]-k-u)}var P=new iEt([c,u,r,s],T);if(P.flags=bAt.print,"hidden"===i.visibility&&(P.flags=bAt.hidden),P.bounds={x:o.X,y:o.Y,width:o.Width,height:o.Height},P.border.width=0,P.color=[0,0,0],P.setValues("annotationSignature","annotationSignature"),T=[],0!==e){for(var B=[],F=E;F<n.length;F++)"M"===(A=n[parseInt(F.toString(),10)]).command.toString()&&F!==E&&(B.push(T),T=[]),T.push(parseFloat(A.x)),T.push(parseFloat(A.y));0<T.length&&B.push(T);for(var L=0;L<B.length;L++){if(T=[],0<B[parseInt(L.toString(),10)].length){for(M=0;M<n.length;M++){A=n[parseInt(M.toString(),10)];T.push((parseFloat(A.x)-g)/x+c),T.push(this.formFieldLoadedDocument.getPage(d).size[1]-(parseFloat(A.y)-m)/I-u)}P.inkPointsCollection.push(T)}T=[]}}else{for(var R=0;R<n.length;R++){k=("M"===(A=n[parseInt(R.toString(),10)]).command.toString()&&0!==R&&(P.inkPointsCollection.push(T),T=[]),T.push((parseFloat(A.x)-g)/x+c),(parseFloat(A.y)-m)/I);T.push(this.formFieldLoadedDocument.getPage(d).size[1]-k-u)}0<T.length&&P.inkPointsCollection.push(T)}P._dictionary.set("T",t),P.setAppearance(!0),P.rotationAngle=Math.abs(this.getRotateAngle(l.rotation)),this.formFieldLoadedDocument.getPage(d).annotations.add(P)}},sVt.prototype.setFontSize=function(e,t,i,n,o,r){t=new _xt(o,e,r);do{if(e-=.001,(t._size=e)<.25){t._size=.25;break}var s=t.measureString(i);if(s[0]<n.Width&&s[1]<n.height){t._size=e;break}}while(.25<e)},sVt.prototype.getTrueFont=function(e,t){return new Uxt(oVt(),this.convertPixelToPoint(e),t)},sVt.prototype.convertFieldBounds=function(e){var t=e.zoomValue;return{X:this.convertPixelToPoint(e.lineBound.X/t),Y:this.convertPixelToPoint(e.lineBound.Y/t),Width:this.convertPixelToPoint(e.lineBound.Width/t),Height:this.convertPixelToPoint(e.lineBound.Height/t)}},sVt.prototype.getFontFamily=function(e){var t=Zxt.helvetica;switch(e){case"Courier":t=Zxt.courier;break;case"Times New Roman":t=Zxt.timesRoman;break;case"Symbol":t=Zxt.symbol;break;case"ZapfDingbats":t=Zxt.zapfDingbats}return t},sVt.prototype.getBounds=function(e,t,i,n,o){var r={};return 0===n?r={X:e.X,Y:e.Y,Width:e.Width,Height:e.Height}:1===n?r=o?{X:e.Y-(e.Width/2-e.Height/2),Y:t-e.X-e.Height-(e.Width/2-e.Height/2),Width:e.Width,Height:e.Height}:{X:e.Y,Y:t-e.X-e.Width,Width:e.Height,Height:e.Width}:2===n?r={X:i-e.X-e.Width,Y:t-e.Y-e.Height,Width:e.Width,Height:e.Height}:3===n&&(r=o?{X:i-e.Y-e.Height-(e.Width/2-e.Height/2),Y:e.X+(e.Width/2-e.Height/2),Width:e.Width,Height:e.Height}:{X:i-e.Y-e.Height,Y:e.X,Width:e.Height,Height:e.Width}),r},sVt.prototype.getFormfieldRotation=function(e){var t=0;switch(e){case 1:t=90;break;case 2:t=180;break;case 3:t=270;break;case 4:t=360}return t},sVt.prototype.getTextAlignment=function(e){var t;switch(e.toLowerCase()){case"left":t=MAt.left;break;case"right":t=MAt.right;break;case"center":t=MAt.center;break;case"justify":t=MAt.justify}return t},sVt.prototype.getFormFieldsVisibility=function(e){var t;switch(e){case"visible":t=kAt.visible;break;case"hidden":t=kAt.hidden;break;case"visibleNotPrintable":t=kAt.visibleNotPrintable;break;case"hiddenPrintable":t=kAt.hiddenPrintable}return t},sVt.prototype.getFontStyle=function(e){var t=Jxt.regular;return je(e)||je(e.font)||(e.font.isBold&&(t|=Jxt.bold),e.font.isItalic&&(t|=Jxt.italic),e.font.isUnderline&&(t|=Jxt.underline),e.font.isStrikeout&&(t|=Jxt.strikeout)),t},sVt.prototype.convertPixelToPoint=function(e){return 72*e/96},sVt.prototype.convertPointtoPixel=function(e){return 96*e/72},sVt.prototype.fontConvert=function(e){return{Bold:e.isBold,FontFamily:this.getFontFamilyString(e.fontFamily),Height:e.height,Italic:e.isItalic,Name:this.getFontFamilyString(e.fontFamily).toString(),Size:e.size,Strikeout:e.isStrikeout,Underline:e.isUnderline,Style:e.style}},sVt.prototype.parseFontStyle=function(e,t){return 0<(e&Jxt.underline)&&(t.Underline=!0),0<(e&Jxt.strikeout)&&(t.Strikeout=!0),0<(e&Jxt.bold)&&(t.Bold=!0),0<(e&Jxt.italic)&&(t.Italic=!0),t},sVt.prototype.GetFormFields=function(){this.PdfRenderedFormFields=[];var e=this.formFieldLoadedDocument.form;if(!je(e)&&!je(e._fields)){e.orderFormFields();for(var t=0;t<e.count;t++){for(var i=e.fieldAt(t),n=i.page,o=0,r=0;r<this.formFieldLoadedDocument.pageCount&&n!==this.formFieldLoadedDocument.getPage(r);r++)o++;if(!je(i.page))if(i instanceof ZIt){var s=i;0<s.itemsCount?this.addTextBoxFieldItems(s):this.addTextBoxField(s,o,s.bounds,null)}else if(i instanceof uTt){s=e.fieldAt(t);this.addComboBoxField(s,o)}else if(i instanceof oTt){var a=i;1<a.itemsCount?this.addCheckBoxFieldItems(a):this.addCheckBoxField(a,o,a.bounds,null)}else if(i instanceof fTt)this.addListBoxField(i,o);else if(i instanceof aTt)for(var l=0;l<i.itemsCount;l++){var h,d=i.itemAt(l);d&&(h=d.page)&&this.addRadioButtonField(d,h._pageIndex,i.name)}else e.fieldAt(t)instanceof bTt&&((a=e.fieldAt(t)).isSigned&&this.showDigitalSignatureAppearance?(this.mIsDigitalSignaturePresent=!0,a.flatten=!0):a.isSigned&&this.hideEmptyDigitalSignatureFields||(0<a.itemsCount?this.addSigntureFieldItems(a):this.addSignatureField(a,o,a.bounds)))}}this.retrieveInkAnnotation(this.formFieldLoadedDocument)},sVt.prototype.addTextBoxFieldItems=function(e){if(e instanceof ZIt){var t=e;if(0<t.itemsCount)for(var i=0;i<t.itemsCount;i++){var n=t.itemAt(i).page;if(!je(n)){for(var o=0,r=0;r<this.formFieldLoadedDocument.pageCount&&n!==this.formFieldLoadedDocument.getPage(o);r++)o++;this.addTextBoxField(t,o,t.itemAt(i).bounds,t.itemAt(i).font)}}}},sVt.prototype.addTextBoxField=function(e,t,i,n){var o=new aVt;o.FieldName=e.name,o.ActualFieldName=e.name,e.password?o.Name="Password":o.Name="Textbox",o.ToolTip=e.toolTip,je(i)?o.LineBounds={X:e.bounds.x,Y:e.bounds.y,Width:e.bounds.width,Height:e.bounds.height}:o.LineBounds={X:i.x,Y:i.y,Width:i.width,Height:i.height},o.TabIndex=e.tabIndex,o.PageIndex=t,o.BorderWidth=e.border.width,o.BorderStyle=e.border.style,je(e.backColor)?o.IsTransparent=!0:o.BackColor={R:e.backColor[0],G:e.backColor[1],B:e.backColor[2]},o.Alignment=e.textAlignment,o.MaxLength=e.maxLength,o.Visible=e.visibility,o.InsertSpaces=e.insertSpaces,je(n)?o.Font=this.fontConvert(e.font):o.Font=this.fontConvert(n),e._dictionary.has("FontStyle")&&(i=e._dictionary.get("FontStyle"),o.Font=this.parseFontStyle(i,o.Font)),o.Rotation=e.rotationAngle,o.IsReadonly=e.readOnly,o.IsRequired=e.required,je(e.color)||(o.FontColor={R:e.color[0],G:e.color[1],B:e.color[2]}),je(e.borderColor)?o.IsTransparent=!0:o.BorderColor={R:e.borderColor[0],G:e.borderColor[1],B:e.borderColor[2]},o.Text=e.text||"",o.Multiline=e.multiLine,o.RotationAngle=this.GetRotateAngle(e.page.rotation),e._dictionary.has("CustomData")&&(o.CustomData=JSON.parse(e._dictionary.get("CustomData"))),o.TextList=[],this.PdfRenderedFormFields.push(o)},sVt.prototype.addComboBoxField=function(e,t){var i,n=new aVt;if(n.Name="DropDown",n.ToolTip=e.toolTip,n.FieldName=e.name,n.Font=this.fontConvert(e.font),n.IsAutoSize=e._isAutoFontSize,n.Selected=e.editable,e._dictionary.has("FontStyle")&&(i=e._dictionary.get("FontStyle"),n.Font=this.parseFontStyle(i,n.Font)),n.ActualFieldName=e.name,n.SelectedValue=e.selectedValue,0<e._options.length&&"string"!=typeof e._options[0]&&(i=e._options.filter(function(e){return e[0]===n.SelectedValue}))&&i[0]&&(n.SelectedValue=i[0][1]),n.selectedIndex=e.selectedIndex,n.LineBounds={X:e.bounds.x,Y:e.bounds.y,Width:e.bounds.width,Height:e.bounds.height},n.TabIndex=e.tabIndex,n.PageIndex=t,je(e.backColor)?n.IsTransparent=!0:n.BackColor={R:e.backColor[0],G:e.backColor[1],B:e.backColor[2]},n.BorderWidth=e.border.width,n.BorderStyle=e.border.style,je(e.borderColor)?n.IsTransparent=!0:n.BorderColor={R:e.borderColor[0],G:e.borderColor[1],B:e.borderColor[2]},n.FontColor={R:e.color[0],G:e.color[1],B:e.color[2]},n.Rotation=e.rotationAngle,n.IsRequired=e.required,n.IsReadonly=e.readOnly,n.Visible=e.visibility,n.RotationAngle=this.GetRotateAngle(e.page.rotation),n.Alignment=e.textAlignment,e._dictionary.has("CustomData")&&(n.CustomData=JSON.parse(e._dictionary.get("CustomData"))),n.TextList=[],e._dictionary.has("Opt")&&0<(i=e._dictionary.get("Opt")).length&&(n.ComboBoxList=i.map(function(e){return"string"==typeof e?{itemName:e,itemValue:e}:"object"==typeof e?{itemName:e[1],itemValue:e[0]}:{itemName:"",itemValue:""}})),0===n.TextList.length)for(var o=0;o<e.itemsCount;o++){var r=e.itemAt(o);r&&(n.TextList.push(r.text),0===o)&&(n.Alignment=r.textAlignment)}this.PdfRenderedFormFields.push(n)},sVt.prototype.addCheckBoxFieldItems=function(e){if(e instanceof oTt){var t=e;if(0<t.itemsCount)for(var i=0;i<t.itemsCount;i++){var n=t.itemAt(i).page;if(!je(n)){for(var o=0,r=0;r<this.formFieldLoadedDocument.pageCount&&n!==this.formFieldLoadedDocument.getPage(o);r++)o++;this.addCheckBoxField(t,o,t.itemAt(i).bounds,i.toString())}}}},sVt.prototype.addCheckBoxField=function(e,t,i,n){var o=new aVt,i=(o.Name="CheckBox",o.ToolTip=e.toolTip,i.IsEmpty?o.LineBounds={X:e.bounds.x,Y:e.bounds.y,Width:e.bounds.width,Height:e.bounds.height}:o.LineBounds={X:i.x,Y:i.y,Width:i.width,Height:i.height},o.Selected=e.checked,o.TabIndex=e.tabIndex,o.GroupName=e.name.replace(/[^0-9a-zA-Z]+/g,""),o.ActualFieldName=e.name,o.PageIndex=t,o.BorderWidth=e.border.width,je(e.backColor)?o.IsTransparent=!0:o.BackColor={R:e.backColor[0],G:e.backColor[1],B:e.backColor[2]},o.BorderStyle=e.border.style,je(e.borderColor)?o.IsTransparent=!0:o.BorderColor={R:e.borderColor[0],G:e.borderColor[1],B:e.borderColor[2]},o.RotationAngle=this.GetRotateAngle(e.page.rotation),o.IsReadonly=e.readOnly,o.IsRequired=e.required,o.Visible=e.visibility,e._dictionary._get("ExportValue"));e._dictionary._get("ExportValue")&&!je(i)&&(o.Value=i),je(n)||(o.CheckBoxIndex=n,je(t=e.itemAt(parseInt(n,10))))||(o.Selected=t.checked),o.RotationAngle=this.GetRotateAngle(e.page.rotation),e._dictionary.has("CustomData")&&(o.CustomData=JSON.parse(e._dictionary.get("CustomData"))),this.PdfRenderedFormFields.push(o)},sVt.prototype.addListBoxField=function(e,t){var i,n=new aVt,o=(n.Name="ListBox",n.ToolTip=e.toolTip,n.Text=e.name.replace(/[^0-9a-zA-Z]+/g,""),n.ActualFieldName=e.name,e.itemsCount);if(0<o){var r=e.selectedIndex;if(Array.isArray(r))for(var s=0;s<r.length;s++)n.SelectedList.push(r[parseInt(s.toString(),10)]);else n.SelectedList.push(r)}n.Font=this.fontConvert(e.font),e._dictionary.has("FontStyle")&&(i=e._dictionary.get("FontStyle"),n.Font=this.parseFontStyle(i,n.Font)),n.LineBounds={X:e.bounds.x,Y:e.bounds.y,Width:e.bounds.width,Height:e.bounds.height},n.TabIndex=e.tabIndex,n.PageIndex=t,n.BorderWidth=e.border.width,n.BorderStyle=e.border.style,je(e.backColor)?n.IsTransparent=!0:n.BackColor={R:e.backColor[0],G:e.backColor[1],B:e.backColor[2]},n.FontColor={R:e.color[0],G:e.color[1],B:e.color[2]},je(e.borderColor)||(n.BorderColor={R:e.borderColor[0],G:e.borderColor[1],B:e.borderColor[2]}),n.Rotation=e.rotationAngle,n.IsReadonly=e.readOnly,n.IsRequired=e.required,n.Visible=e.visibility,n.MultiSelect=e.multiSelect,0<o&&Array.isArray(e.selectedIndex)&&Array.isArray(e.selectedValue)&&(n.selectedIndex=e.selectedIndex[0],n.SelectedValue=e.selectedValue[0]);for(s=0;s<o;s++){var a=0<e._kidsCount?e.itemAt(s):e._options[parseInt(s.toString(),10)];a&&(n.TextList.push(0<e._kidsCount?a.text:a),0===s)&&(n.Alignment=e.textAlignment)}n.RotationAngle=this.GetRotateAngle(e.page.rotation),e._dictionary.has("CustomData")&&(n.CustomData=JSON.parse(e._dictionary.get("CustomData"))),this.PdfRenderedFormFields.push(n)},sVt.prototype.addRadioButtonField=function(e,t,i){var n=e._field,o=new aVt;o.Name="RadioButton",o.ToolTip=n.toolTip,je(n.actualName)||(o.GroupName=n.actualName.replace(/[^0-9a-zA-Z]+/g,""),o.ActualFieldName=i),o.TabIndex=n.tabIndex,o.Selected=e.selected,o.LineBounds={X:e.bounds.x,Y:e.bounds.y,Width:e.bounds.width,Height:e.bounds.height},o.Value=e.value,o.PageIndex=t,je(e.backColor)?o.IsTransparent=!0:o.BackColor={R:e.backColor[0],G:e.backColor[1],B:e.backColor[2]},o.BorderWidth=e.border.width,o.BorderStyle=e.border.style,o.BorderColor={R:n.borderColor[0],G:n.borderColor[1],B:n.borderColor[2]},o.Rotation=n.rotationAngle,o.IsRequired=n.required,o.IsReadonly=n.readOnly,o.Visible=n.visibility,o.RotationAngle=this.GetRotateAngle(e.page.rotation),n._dictionary.has("CustomData")&&(o.CustomData=JSON.parse(n._dictionary.get("CustomData"))),this.PdfRenderedFormFields.push(o)},sVt.prototype.checkTransparent=function(e){var t=!1;return t=0===e.R&&0===e.G&&0===e.B?!0:t},sVt.prototype.GetRotateAngle=function(e){var t=0;switch(e){case 0:t=0;break;case 1:t=-90;break;case 2:t=-180;break;case 3:t=-270}return t},sVt.prototype.drawFieldFreeTextAnnotations=function(e,t,i,n,o,r){for(var s,a,e=JSON.parse(e),n=JSON.parse(n),l=t.page,h=0;h<this.formFieldLoadedDocument.pageCount&&l!==this.formFieldLoadedDocument.getPage(h);h++);je(e)||""===e||(t=this.convertPixelToPoint(n.x),s=this.convertPixelToPoint(n.y),a=this.convertPixelToPoint(n.width),n=this.convertPixelToPoint(n.height),(t=new VEt(t,s,a,n)).setAppearance(!0),t._dictionary.set("T",i),s=0<r?r:n/2,a=Zxt.helvetica,je(o)||((i=o).includes("Times New Roman")?a=Zxt.timesRoman:i.includes("Courier")?a=Zxt.courier:i.includes("Symbol")?a=Zxt.symbol:i.includes("ZapfDingbats")&&(a=Zxt.zapfDingbats)),r=this.getFontStyle(),t.font=new _xt(a,this.convertPixelToPoint(s),r),t.text=e,t.rotationAngle=this.getRotateAngle(l.rotation),t.flags=bAt.print,t.setValues("AnnotationType","Signature"),t.setAppearance(!0),l.annotations.add(t))},sVt.prototype.drawFieldImage=function(e,t,i,n){for(var o,r,e=JSON.parse(e),n=JSON.parse(n),s=t.page,a=0;a<this.formFieldLoadedDocument.pageCount&&s!==this.formFieldLoadedDocument.getPage(a);a++);je(e)||""===e||(t=e.toString().split(",")[1],e=this.convertPixelToPoint(n.x),r=this.convertPixelToPoint(n.y),o=this.convertPixelToPoint(n.width),n=this.convertPixelToPoint(n.height),e=new BEt(e,r,o,n),r=new JFt(t),e.appearance.normal.graphics.drawImage(r,0,0,o,n),e.rotationAngle=this.getRotateAngle(s.rotation),e._dictionary.set("T",i),e.flags=bAt.print,e.setAppearance(!0),s.annotations.add(e))},sVt.prototype.drawFieldPath=function(e,t,i,n){for(var o=JSON.parse(e),e=JSON.parse(n),r=t.page,s=0,a=0;a<this.formFieldLoadedDocument.pageCount&&r!==this.formFieldLoadedDocument.getPage(a);a++)s++;if(0<o.length){for(var n=this.GetRotateAngle(r.rotation),l=this.convertPixelToPoint(e.x),h=this.convertPixelToPoint(e.y),d=this.convertPixelToPoint(e.width),e=this.convertPixelToPoint(e.height),p=(0!==n&&(l=this.convertPixelToPoint(t.bounds.x),h=this.convertPixelToPoint(t.bounds.y),d=this.convertPixelToPoint(t.bounds.width),e=this.convertPixelToPoint(t.bounds.height)),-1),c=-1,u=-1,g=-1,m=0;m<o.length;m++){var f,y,v=o[parseInt(m.toString(),10)];-1===p?(p=v.x,c=v.y,u=v.x,g=v.y):((f=v.x)<=p&&(p=f),(y=v.y)<=c&&(c=y),u<=f&&(u=f),g<=y&&(g=y))}var b=(u-p)/d,w=(g-c)/e,C=[],S=0;if(0!==n){for(var A=0;A<o.length;A++){if("M"===(v=o[parseInt(A.toString(),10)]).command.toString()&&0!==A){S=A;break}C.push(parseFloat(v.x)),C.push(parseFloat(v.y))}for(var C=[],x=0;x<o.length;x++){v=o[parseInt(x.toString(),10)];C.push((parseFloat(v.x)-p)/b+l),C.push(this.formFieldLoadedDocument.getPage(s).size[1]-(parseFloat(v.y)-c)/w-h)}}else for(a=0;a<o.length;a++){if("M"===(v=o[parseInt(a.toString(),10)]).command.toString()&&0!==a){S=a;break}C.push((parseFloat(v.x)-p)/b+l);var I=(parseFloat(v.y)-c)/w;C.push(this.formFieldLoadedDocument.getPage(s).size[1]-I-h)}var T=new iEt([l,h,d,e],C),t=(T.flags=bAt.print,{x:T.bounds.x,y:r.size[1]-(T.bounds.y+T.bounds.height),width:T.bounds.width,height:T.bounds.height});if(T.bounds=t,C=[],(T.border.width=0)!==n){for(var E=[],D=S;D<o.length;D++)"M"===(v=o[parseInt(D.toString(),10)]).command.toString()&&D!==S&&(E.push(C),C=[]),C.push(parseFloat(v.x)),C.push(parseFloat(v.y));0<C.length&&E.push(C);for(var M=0;M<E.length;M++){if(C=[],0<E[parseInt(M.toString(),10)].length){for(x=0;x<o.length;x++){v=o[parseInt(x.toString(),10)];C.push((parseFloat(v.x)-p)/b+l),C.push(this.formFieldLoadedDocument.getPage(s).size[1]-(parseFloat(v.y)-c)/w-h)}T.inkPointsCollection.push(C)}C=[]}}else{for(var k=0;k<o.length;k++){I=("M"===(v=o[parseInt(k.toString(),10)]).command.toString()&&0!==k&&(T.inkPointsCollection.push(C),C=[]),C.push((parseFloat(v.x)-p)/b+l),(parseFloat(v.y)-c)/w);C.push(this.formFieldLoadedDocument.getPage(s).size[1]-I-h)}0<C.length&&T.inkPointsCollection.push(C)}T._dictionary.set("T",i),T.setAppearance(!0),this.formFieldLoadedDocument.getPage(s).annotations.add(T)}},sVt.prototype.addSigntureFieldItems=function(e){if(e instanceof bTt){var t=e;if(0<t.itemsCount)for(var i=0;i<t.itemsCount;i++)if(!je(t.itemAt(i).page)){for(var n=t.itemAt(i).page,o=0,r=0;r<this.formFieldLoadedDocument.pageCount&&n!==this.formFieldLoadedDocument.getPage(o);r++)o++;this.addSignatureField(t,o,t.itemAt(i).bounds)}}},sVt.prototype.addSignatureField=function(e,t,i){var n=new aVt,i=(n.Name="SignatureField",n.ToolTip=e.toolTip,n.FieldName=e.name,n.ActualFieldName=e.name,i.IsEmpty?n.LineBounds={X:e.bounds.x,Y:e.bounds.y,Width:e.bounds.width,Height:e.bounds.height}:n.LineBounds={X:i.x,Y:i.y,Width:i.width,Height:i.height},n.PageIndex=t,n.TabIndex=e.tabIndex,n.BorderWidth=e.border.width,n.BorderStyle=e.border.style,n.IsReadonly=e.readOnly,n.IsRequired=e.required,n.Visible=e.visibility,je(e.backColor)?n.IsReadonly&&(n.IsTransparent=!0):n.BackColor={R:e.backColor[0],G:e.backColor[1],B:e.backColor[2]},n.IsSignatureField=!0,n.Rotation=e.rotationAngle,n.RotationAngle=this.GetRotateAngle(e.page.rotation),e._dictionary.get("InitialField"));je(i)||(n.IsInitialField=i),e._dictionary.has("CustomData")&&(n.CustomData=JSON.parse(e._dictionary.get("CustomData"))),this.PdfRenderedFormFields.push(n)},sVt.prototype.retrieveInkAnnotation=function(e){for(var t=1,i=0;i<e.pageCount;i++)for(var n=e.getPage(i),o=n.annotations,r=parseInt(o.count.toString(),10),s=0;s<r;s++){var a=o.at(s);if(a instanceof iEt){var l,h="",d=[],p=[];if((l=a)._dictionary.has("T")&&!l._dictionary.has("NM")){if(!je(l.inkPointsCollection))for(var c=0;c<l.inkPointsCollection.length;c++)for(var u=l.inkPointsCollection[parseInt(c.toString(),10)],g=0;g<u.length;g+=2){var m=void 0,f=void 0,f=n.rotation===TAt.angle90?(m=u[g+1],u[parseInt(g.toString(),10)]):n.rotation===TAt.angle180?(m=n.size[0]-u[g+1],u[g+1]):n.rotation===TAt.angle270?(m=n.size[0]-u[g+1],n.size[1]-u[parseInt(g.toString(),10)]):(m=u[parseInt(g.toString(),10)],n.size[1]-u[g+1]);h+=0===g?"M"+m+","+f+" ":"L"+m+","+f+" ",d.push(m),p.push(f)}var y=new aVt,v=(l._dictionary.has("T")&&(y.FieldName=l._dictionary.get("T")),y.FieldName=y.FieldName+"_"+t,y.Name="ink",n.rotation),b=!1,w=(0!==a.rotationAngle&&(b=!0),{X:l.bounds.x,Y:l.bounds.y,Width:l.bounds.width,Height:l.bounds.height});y.LineBounds=this.getBounds(w,n.size[1],n.size[0],v,!b),y.Value=h,y.PageIndex=i,y.BorderColor=[l.color[0],l.color[1],l.color[2]],y.Rotation=a.rotationAngle,this.PdfRenderedFormFields.push(y),t++}}else if(a instanceof VEt)!(l=a)._dictionary.has("T")||l._dictionary.has("NM")||l._dictionary.has("M")||((y=new aVt).FieldName=l._dictionary.get("T")+"_"+t,w={X:l.bounds.x,Y:l.bounds.y,Width:l.bounds.width,Height:l.bounds.height},y.LineBounds=w,y.Name="SignatureText",y.FontFamily=this.getFontFamilyString(l.font._fontFamily),y.FontSize=this.convertPointtoPixel(l.font.size),y.Value=l.text,y.PageIndex=i,y.BorderColor=l.borderColor,this.PdfRenderedFormFields.push(y),t++);else if(a instanceof BEt){for(var C,S=a,A=[],x=0,I=this.PdfRenderedFormFields;x<I.length;x++){var T=I[x];if(T.ActualFieldName===S._dictionary._map.T){A.push(T);break}}S._dictionary.has("T")&&!S._dictionary.has("NM")&&!S._dictionary.has("M")&&0<A.length&&this.pdfViewerBase.isSignatureWithInRect(this.pdfViewerBase.canvasRectArray(A[0].LineBounds),this.pdfViewerBase.canvasRectArray(S.bounds))&&((y=new aVt).FieldName=S._dictionary.get("T")+"_"+t,v=a._dictionary.get("AP"),b=new X2t(this.pdfViewer,this.pdfViewerBase),y.LineBounds={X:S.bounds.x,Y:S.bounds.y,Width:S.bounds.width,Height:S.bounds.height},y.Name="SignatureImage",y.PageIndex=i,t++,je(v)?je(C=a._dictionary.get("AP"))||je(C.dictionary)||!C.dictionary.has("N")||je(C.dictionary)||b.findStampImage(a):v.has("N")&&(0===(C=a.createTemplate()).size[0]||0===C.size[1]||je(C._appearance)?b.findStampImage(a):(y.PageIndex=i,b.findStampTemplate(a,y,y.Rotation,b.annotationOrder.length-1,!0,y.FieldName,this.PdfRenderedFormFields,y.PageIndex))))}}},sVt.prototype.getFontFamilyString=function(e){switch(e){case Zxt.helvetica:return"Helvetica";case Zxt.timesRoman:return"Times New Roman";case Zxt.courier:return"Courier";case Zxt.symbol:return"Symbol";case Zxt.zapfDingbats:return"ZapfDingbats";default:return"Helvetica"}};var rVt=sVt;function sVt(e,t,i){this.PdfRenderedFormFields=[],this.pdfViewer=e,this.pdfViewerBase=t,this.formFieldLoadedDocument=this.pdfViewer.pdfRendererModule.loadedDocument,this.mIsDigitalSignaturePresent=i}var aVt=function(){this.ActualFieldName=null,this.FontColor={R:0,G:0,B:0},this.BackColor={R:0,G:0,B:0},this.BorderColor={R:0,G:0,B:0},this.CheckBoxGroupName=null,this.Alignment=0,this.BorderStyle=0,this.BorderWidth=0,this.CheckBoxGroupName=null,this.CheckBoxIndex=null,this.ComboBoxList=[],this.FieldName=null,this.Font=null,this.FontFamily=null,this.FontSize=0,this.FontStyle=0,this.GroupName=null,this.InsertSpaces=!1,this.IsAutoSize=!1,this.IsInitialField=!1,this.IsReadonly=!1,this.IsRequired=!1,this.IsSignatureField=!1,this.IsTransparent=!1,this.MaxLength=0,this.MultiSelect=!1,this.Multiline=!1,this.Name=null,this.PageIndex=0,this.Rotation=0,this.RotationAngle=0,this.Selected=!1,this.SelectedList=[],this.SelectedValue=null,this.TabIndex=0,this.Text=null,this.TextList=[],this.ToolTip=null,this.Value=null,this.Visible=0,this.CustomData=null},lVt=(hVt.prototype.addShape=function(e,t){this.checkAnnotationLock(e);if(je(e.shapeAnnotationType)||"Line"!==e.shapeAnnotationType)if(je(e.shapeAnnotationType)||"Square"!==e.shapeAnnotationType)if(je(e.shapeAnnotationType)||"Circle"!==e.shapeAnnotationType)if(je(e.shapeAnnotationType)||"Polygon"!==e.shapeAnnotationType){if(!je(e.shapeAnnotationType)&&"Polyline"===e.shapeAnnotationType){var i=JSON.parse(e.vertexPoints),n=this.getSaveVertexPoints(i,t),o=JSON.parse(e.bounds),r=new KTt(n);r.bounds=new dvt(this.convertPixelToPoint(o.left||0),this.convertPixelToPoint(o.top||0),this.convertPixelToPoint(o.width||0),this.convertPixelToPoint(o.height||0)),je(e.note)||(r.text=e.note.toString()),r.author=je(e.author)||""===e.author.toString()?"Guest":e.author.toString(),je(e.subject)||(r.subject=e.subject.toString()),r._dictionary.set("NM",e.annotName.toString()),je(e.strokeColor)||(T=[(M=JSON.parse(e.strokeColor)).r,M.g,M.b],r.color=T),je(e.fillColor)||(D=JSON.parse(e.fillColor),this.isTransparentColor(D)||(b=[D.r,D.g,D.b],r.innerColor=b),D.a<1&&0<D.a?(r._dictionary.update("FillOpacity",D.a),D.a=1):r._dictionary.update("FillOpacity",D.a)),je(e.opacity)||(r.opacity=e.opacity);g=((C=new pDt).width=e.thickness,C.style=e.borderStyle,C.dash=e.borderDashArray,r.border=C,r.rotationAngle=this.getRotateAngle(e.rotateAngle),r.beginLineStyle=this.getLineEndingStyle(e.lineHeadStart),r.endLineStyle=this.getLineEndingStyle(e.lineHeadEnd),void 0);if(je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(g=new Date(Date.parse(e.modifiedDate)),r.modifiedDate=g),0<(S=e.comments).length)for(m=0;m<S.length;m++)r.comments.add(this.addCommentsCollection(S[parseInt(m.toString(),10)],r.bounds));v=e.review;r.reviewHistory.add(this.addReviewCollections(v,r.bounds)),!je(e.isCloudShape)&&e.isCloudShape&&((A=new mPt(t._crossReference)).update("S",k.get("C")),A.update("I",e.cloudIntensity),r._dictionary.update("BE",A),0<(A=JSON.parse(e.rectangleDifference)).length)&&(E=this.getRDValues(A),r._dictionary.update("RD",E)),this.preserveIsLockProperty(e,r),r.setAppearance(!0),je(e.customData)||r.setValues("CustomData",JSON.stringify(e.customData)),je(e.allowedInteractions)||r.setValues("AllowedInteractions",JSON.stringify(e.allowedInteractions)),t.annotations.add(r)}}else{var i=JSON.parse(e.vertexPoints),n=this.getSaveVertexPoints(i,t),s=(je((o=JSON.parse(e.bounds)).left)&&(e.bounds.left=0),je(o.top)&&(e.bounds.top=0),this.convertPixelToPoint(o.left)),a=this.convertPixelToPoint(o.top),l=this.convertPixelToPoint(o.width),h=this.convertPixelToPoint(o.height),d=new GTt(n);d.bounds=new dvt(s,a,l,h),je(e.note)||(d.text=e.note.toString()),d.author=je(e.author)||""===e.author.toString()?"Guest":e.author.toString(),je(e.subject)||(d.subject=e.subject.toString()),d._dictionary.set("NM",e.annotName.toString()),je(e.strokeColor)||(T=[(M=JSON.parse(e.strokeColor)).r,M.g,M.b],d.color=T),je(e.fillColor)||(D=JSON.parse(e.fillColor),this.isTransparentColor(D)||(b=[D.r,D.g,D.b],d.innerColor=b),D.a<1&&0<D.a?(d._dictionary.update("FillOpacity",D.a),D.a=1):d._dictionary.update("FillOpacity",D.a)),je(e.opacity)||(d.opacity=e.opacity);g=((C=new pDt).width=e.thickness,C.style=e.borderStyle,C.dash=e.borderDashArray,d.border=C,d.rotationAngle=this.getRotateAngle(e.rotateAngle),void 0);if(je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(g=new Date(Date.parse(e.modifiedDate)),d.modifiedDate=g),0<(S=e.comments).length)for(m=0;m<S.length;m++)d.comments.add(this.addCommentsCollection(S[parseInt(m.toString(),10)],d.bounds));v=e.review;d.reviewHistory.add(this.addReviewCollections(v,d.bounds)),!je(e.isCloudShape)&&e.isCloudShape&&((I=new uDt).style=IAt.cloudy,I.intensity=e.cloudIntensity,d.borderEffect=I,0<(A=JSON.parse(e.rectangleDifference)).length)&&(E=this.getRDValues(A),d._dictionary.update("RD",E)),this.preserveIsLockProperty(e,d),je(e.customData)||d.setValues("CustomData",JSON.stringify(e.customData)),je(e.allowedInteractions)||d.setValues("AllowedInteractions",JSON.stringify(e.allowedInteractions)),d.setAppearance(!0),t.annotations.add(d)}else{var s=je((o=JSON.parse(e.bounds)).left)?0:this.convertPixelToPoint(o.left),a=je(o.top)?0:this.convertPixelToPoint(o.top),l=je(o.width)?0:this.convertPixelToPoint(o.width),h=je(o.height)?0:this.convertPixelToPoint(o.height),p=0,c=0,u=((0!==(f=this.getCropBoxValue(t,!1)).x&&0!==f.y&&f.x===s||0===f.x&&t.cropBox[2]===t.size[0]&&f.y===t.size[1])&&(p=f.x,c=f.y),new RTt(p+s,c+a,l,h));je(e.note)||(u.text=e.note.toString()),u.author=je(e.author)||""===e.author.toString()?"Guest":e.author.toString(),u._dictionary.set("NM",e.annotName.toString()),je(e.subject)||(u.subject=e.subject.toString()),je(e.strokeColor)||(T=[(M=JSON.parse(e.strokeColor)).r,M.g,M.b],u.color=T),je(e.fillColor)||(D=JSON.parse(e.fillColor),this.isTransparentColor(D)||(b=[D.r,D.g,D.b],u.innerColor=b),D.a<1&&0<D.a?(u._dictionary.update("FillOpacity",D.a),D.a=1):u._dictionary.update("FillOpacity",D.a)),je(e.opacity)||(u.opacity=e.opacity);(C=new pDt).width=e.thickness,C.style=e.borderStyle,C.dash=e.borderDashArray,u.border=C,u.rotationAngle=this.getRotateAngle(e.rotateAngle);var g=void 0;if(je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(g=new Date(Date.parse(e.modifiedDate)),u.modifiedDate=g),0<(S=e.comments).length)for(var m=0;m<S.length;m++)u.comments.add(this.addCommentsCollection(S[parseInt(m.toString(),10)],u.bounds));v=e.review;u.reviewHistory.add(this.addReviewCollections(v,u.bounds)),!je(e.isCloudShape)&&e.isCloudShape&&((I=new uDt).style=IAt.cloudy,I.intensity=e.cloudIntensity,u._borderEffect=I,0<(A=JSON.parse(e.rectangleDifference)).length)&&(E=this.getRDValues(A),u._dictionary.update("RD",E)),this.preserveIsLockProperty(e,u),je(e.customData)||u.setValues("CustomData",JSON.stringify(e.customData)),e.allowedInteractions&&null!=e.allowedInteractions&&u.setValues("AllowedInteractions",JSON.stringify(e.allowedInteractions)),u.setAppearance(!0),t.annotations.add(u)}else{je((o=JSON.parse(e.bounds)).left)&&(e.bounds.left=0),je(o.top)&&(e.bounds.top=0);var f=this.getCropBoxValue(t,!1),s=this.convertPixelToPoint(o.left),a=this.convertPixelToPoint(o.top),l=this.convertPixelToPoint(o.width),h=this.convertPixelToPoint(o.height),p=0,c=0,y=((0!==f.x&&0!==f.y&&f.x===s||0===f.x&&t.cropBox[2]===t.size[0]&&f.y===t.size[1])&&(p=f.x,c=f.y),new zTt(p+s,c+a,l,h));je(e.note)||(y.text=e.note.toString()),y.author=je(e.author)||""===e.author.toString()?"Guest":e.author.toString(),y._dictionary.set("NM",e.annotName.toString()),je(e.subject)||(y.subject=e.subject.toString()),je(e.strokeColor)||(T=[(M=JSON.parse(e.strokeColor)).r,M.g,M.b],y.color=T),je(e.fillColor)||(D=JSON.parse(e.fillColor),this.isTransparentColor(D)||(b=[D.r,D.g,D.b],y.innerColor=b),D.a<1&&0<D.a?(y._dictionary.update("FillOpacity",D.a),D.a=1):y._dictionary.update("FillOpacity",D.a)),je(e.opacity)||(y.opacity=e.opacity);(C=new pDt).width=e.thickness,C.style=e.borderStyle,C.dash=e.borderDashArray,y.border=C,y.rotationAngle=this.getRotateAngle(e.rotateAngle);var g=void 0;if(je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(g=new Date(Date.parse(e.modifiedDate)),y.modifiedDate=g),0<(S=e.comments).length)for(var m=0;m<S.length;m++)y.comments.add(this.addCommentsCollection(S[parseInt(m.toString(),10)],y.bounds));var v=e.review;y.reviewHistory.add(this.addReviewCollections(v,y.bounds)),!je(e.isCloudShape)&&e.isCloudShape&&((I=new uDt).style=IAt.cloudy,I.intensity=e.cloudIntensity,y.borderEffect=I,0<(A=JSON.parse(e.rectangleDifference)).length)&&(E=this.getRDValues(A),y._dictionary.update("RD",E)),this.preserveIsLockProperty(e,y),je(e.customData)||y.setValues("CustomData",JSON.stringify(e.customData)),e.allowedInteractions&&null!=e.allowedInteractions&&y.setValues("AllowedInteractions",JSON.stringify(e.allowedInteractions)),y.setAppearance(!0),t.annotations.add(y)}else{var b,i=JSON.parse(e.vertexPoints),n=this.getSaveVertexPoints(i,t),w=new BTt(n);je(e.note)||(w.text=e.note.toString()),w.author=je(e.author)||""===e.author.toString()?"Guest":e.author.toString(),w._dictionary.set("NM",e.annotName.toString()),je(e.subject)||(w.subject=e.subject.toString()),je(e.strokeColor)||(T=[(M=JSON.parse(e.strokeColor)).r,M.g,M.b],w.color=T),je(e.fillColor)||!(je((D=JSON.parse(e.fillColor)).r)||je(D.g)||je(D.b)||je(D.a))&&0<D.a&&(b=[D.r,D.g,D.b],w.innerColor=b),je(e.opacity)||(w.opacity=e.opacity);(C=new pDt).width=e.thickness,C.style=e.borderStyle,C.dash=e.borderDashArray,w.border=C,w.rotationAngle=this.getRotateAngle(e.rotateAngle),w.lineEndingStyle.begin=this.getLineEndingStyle(e.lineHeadStart),w.lineEndingStyle.end=this.getLineEndingStyle(e.lineHeadEnd);var C,g=void 0,S=(je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(g=new Date(Date.parse(e.modifiedDate)),w.modifiedDate=g),e.comments),o=JSON.parse(e.bounds);if(w.bounds=o,w.bounds.x=o.left,w.bounds.y=o.top,0<S.length)for(var m=0;m<S.length;m++)w.comments.add(this.addCommentsCollection(S[parseInt(m.toString(),10)],w.bounds));var v=e.review;w.reviewHistory.add(this.addReviewCollections(v,w.bounds)),this.preserveIsLockProperty(e,w),je(e.customData)||w.setValues("CustomData",JSON.stringify(e.customData)),e.allowedInteractions&&null!=e.allowedInteractions&&w.setValues("AllowedInteractions",JSON.stringify(e.allowedInteractions)),w.setAppearance(!0),t.annotations.add(w)}if(!je(e.enableShapeLabel)&&e.enableShapeLabel){var A,f=JSON.parse(e.labelBounds.toString()),s=this.convertPixelToPoint(f.left),p=this.convertPixelToPoint(f.top),c=("Line"===e.shapeAnnotationType&&(p-=5),this.convertPixelToPoint(f.width)),a=this.convertPixelToPoint(f.height),x=new VEt(p,s,c,a),g=(x.author=e.author,void 0),l=(je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(g=new Date(Date.parse(e.modifiedDate)),x.modifiedDate=g),x._dictionary.set("NM",e.annotName.toString()+"freeText"),x.lineEndingStyle=wAt.openArrow,x.annotationIntent=HAt.freeTextTypeWriter,0),h=(je(e.fontSize)||(l=parseFloat(e.fontSize)),l=!je(l)&&!isNaN(l)&&0<l?l:16,this.getFontFamily(e.fontFamily)),I=this.getFontStyle({});x.font=new _xt(h,this.convertPixelToPoint(l),I),x.subject="Text Box",x.text="",je(e.labelContent)||null!==e.labelContent.toString()&&(x.text=e.labelContent.toString()),x.rotationAngle=this.getRotateAngle(e.rotateAngle),x.border=new pDt,Object.prototype.hasOwnProperty.call(e,"thickness")&&!je(e.thickness)&&(A=parseInt(e.thickness.toString(),10),x.border.width=A),x.opacity=1,!Object.prototype.hasOwnProperty.call(e,"opacity")||je(e.opacity)||(x.opacity=parseFloat(e.opacity));var T,E=[(T=JSON.parse(e.labelBorderColor)).r,T.g,T.b];x.borderColor=E;var D,i=[(D=JSON.parse(e.labelFillColor)).r,D.g,D.b],n=(x.color=i,JSON.parse(e.fontColor)),M=[n.r,n.g,n.b];if(x.textMarkUpColor=M,0<(S=x.comments).length)for(m=0;m<S.length;m++)x.comments.add(this.addCommentsCollection(S[parseInt(m.toString(),10)],x.bounds));je(e.customData)||x.setValues("CustomData",e.customData),t.annotations.add(x)}},hVt.prototype.saveInkSignature=function(e,t){for(var i=JSON.parse(e.bounds),n=JSON.parse(e.data.toString()),o=this.getInkRotateAngle(t.rotation.toString()),r=this.convertPixelToPoint(i.x),s=this.convertPixelToPoint(i.y),a=this.convertPixelToPoint(i.width),i=this.convertPixelToPoint(i.height),l=e.opacity,O=parseInt(e.thickness.toString(),10),h=(je(e.strokeColor)||(D=[(D=JSON.parse(e.strokeColor)).r,D.g,D.b],e.color=D),-1),d=-1,p=-1,c=-1,u=new nIt,g=0;g<n.length;g++){var m=n[parseInt(g.toString(),10)];u.addLine(m.x,m.y,0,0)}for(var f=this.getRotatedPathForMinMax(u._points,o),y=0;y<f.points.length;y+=2){var v,b=f.points[parseInt(y.toString(),10)];-1===h?(h=b[0],d=b[1],p=b[0],c=b[1]):((v=b[0])<=h&&(h=v),(b=b[1])<=d&&(d=b),p<=v&&(p=v),c<=b&&(c=b))}var w=(p-h)/a,C=(c-d)/i,S=(0===w?w=1:0===C&&(C=1),[]),A=0;if(0!==o){for(var x=0;x<n.length;x++){if("M"===(m=n[parseInt(x.toString(),10)]).command.toString()&&x!==A){A=x;break}S.push(parseFloat(m.x.toString())),S.push(parseFloat(m.y.toString()))}for(var I=this.getRotatedPath(S,o),S=[],T=0;T<I._points.length;T+=2)S.push((I._points[parseInt(T.toString(),10)][0]-h)/w+r),S.push(t.size[1]-(I._points[parseInt(T.toString(),10)][1]-d)/C-s)}else for(x=0;x<n.length;x++){if("M"===(m=n[parseInt(x.toString(),10)]).command.toString()&&x!==A){A=x;break}S.push((m.x-h)/w+r);var E=(m.y-d)/C;S.push(t.size[1]-E-s)}var D=[e.color[0],e.color[1],e.color[2]],M=new iEt([r,s,a,i],S),a=(new dvt,new dvt(M.bounds.x,t.size[1]-(M.bounds.y+M.bounds.height),M.bounds.width,M.bounds.height));if(M.bounds=a,M.color=D,S=[],0<A)if(0!==o){for(var k=[],P=A;P<n.length;P++)"M"===(m=n[parseInt(P.toString(),10)]).command.toString()&&P!==A&&(k.push(S),S=[]),S.push(m.x),S.push(m.y);0<S.length&&k.push(S);for(var B=0;B<k.length;B++){var F=[],L=k[parseInt(B.toString(),10)];if(0<L.length){for(I=this.getRotatedPath(L,o),T=0;T<I._points.length;T+=2)F.push((I._points[parseInt(T.toString(),10)][0]-h)/w+r),F.push(t.size[1]-(I._points[parseInt(T.toString(),10)][1]-d)/C-s);M.inkPointsCollection.push(F)}F=[]}}else{for(P=A;P<n.length;P++){E=("M"===(m=n[parseInt(P.toString(),10)]).command.toString()&&P!==A&&(M.inkPointsCollection.push(S),S=[]),S.push((m.x-h)/w+r),(m.y-d)/C);S.push(t.size[1]-E-s)}0<S.length&&M.inkPointsCollection.push(S)}this.checkAnnotationLock(e);je(e.author)||je(e.author)&&""===e.author?e.author="Guest":M.author=!je(e.author)&&""!==e.author.toString()?e.author.toString():"Guest",je(e.subject)||""===e.subject||(M.subject=e.subject.toString()),je(e.note)?je(e.notes)||(M.text=e.notes.toString()):M.text=e.note.toString(),je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(i=new Date(Date.parse(e.modifiedDate)),M.modifiedDate=i);var a=e.review,R=(M.reviewHistory.add(this.addReviewCollections(a,M.bounds)),e.comments);if(0<R.length)for(P=0;P<R.length;P++)M.comments.add(this.addCommentsCollection(R[parseInt(P.toString(),10)],M.bounds));return this.preserveIsLockProperty(e,M),M.border.width=O,M.opacity=l,M._isEnableControlPoints=!1,M._dictionary.set("NM",e.annotName.toString()),M.rotationAngle=this.getRotateAngle(e.rotationAngle),je(e.customData)||M.setValues("CustomData",JSON.stringify(e.customData)),M.setAppearance(!0),t.annotations.add(M),e},hVt.prototype.getRotatedPath=function(e,t){for(var i=this.getRotatedPoints(e,t),n=new nIt,o=0;o<i.points.length;o+=2)n.addLine(i.points[parseInt(o.toString(),10)][0],i.points[parseInt(o.toString(),10)][1],i.points[parseInt((o+1).toString(),10)][0],i.points[o+1][1]);return n},hVt.prototype.getRotationMatrix=function(e){var e=e*(Math.PI/180),t=Math.cos(e),e=Math.sin(e);return[[t,-e,0],[e,t,0],[0,0,1]]},hVt.prototype.getRotatedPoints=function(e,t){for(var i=new IVt,n=0;n<e.length;n+=2)i.moveTo(e[parseInt(n.toString(),10)],e[parseInt((n+1).toString(),10)]),i.lineTo(0,0);t=this.getRotationMatrix(t);return i.transform(t),i},hVt.prototype.getRotatedPathForMinMax=function(e,t){for(var i=new IVt,n=0;n<e.length;n+=2)i.moveTo(e[parseInt(n.toString(),10)][0],e[parseInt(n.toString(),10)][1]),i.lineTo(e[parseInt((n+1).toString(),10)][0],e[parseInt((n+1).toString(),10)][1]);t=this.getRotationMatrix(t);return i.transform(t),i},hVt.prototype.addTextMarkup=function(e,t){var i=parseInt(e.pageNumber.toString(),10),n=t.getPage(i),o=new TEt;switch(e.textMarkupAnnotationType.toString()){case"Highlight":o.textMarkupType=RAt.highlight;break;case"Strikethrough":o.textMarkupType=RAt.strikeOut;break;case"Underline":o.textMarkupType=RAt.underline;break;case"Squiggly":o.textMarkupType=RAt.squiggly}for(var r=JSON.parse(e.bounds),s=[],a=0;a<r.length;a++){var l=r[parseInt(a.toString(),10)],h=this.getCropBoxValue(n,!0);je(l.left)||s.push(new dvt(h.x+this.convertPixelToPoint(l.left),h.y+this.convertPixelToPoint(l.top),Object.prototype.hasOwnProperty.call(l,"width")?this.convertPixelToPoint(l.width):0,Object.prototype.hasOwnProperty.call(l,"height")?this.convertPixelToPoint(l.height):0))}var d=new TEt(null,0,0,0,0);0<s.length&&(d.bounds={x:s[0].x,y:s[0].y,width:s[0].width,height:s[0].height}),d.textMarkupType=o.textMarkupType,this.checkAnnotationLock(e);if(je(e.author)||je(e.author)&&""===e.author?e.author="Guest":d.author=!je(e.author)&&""!==e.author.toString()?e.author.toString():"Guest",je(e.subject)||""===e.subject||(d.subject=e.subject.toString()),je(e.note)||(d.text=e.note.toString()),je(e.annotationRotation)||(d.rotateAngle=this.getRotateAngle(e.annotationRotation)),je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(t=new Date(Date.parse(e.modifiedDate)),d.modifiedDate=t),d._dictionary.set("NM",e.annotName.toString()),je(e.color)||(v=[(y=JSON.parse(e.color)).r,y.g,y.b],d.color=v),je(e.opacity)||(d.opacity=e.opacity),0<s.length){for(var p=[],a=0;a<s.length;a++){var c=s[parseInt(a.toString(),10)],u=c.x,g=c.y,m=c.width,c=c.height;0!==u&&0!==g&&0!==m&&0!==c&&p.push([u,g,m,c])}d.boundsCollection=p}var f=e.comments;if(0<f.length)for(a=0;a<f.length;a++)d.comments.add(this.addCommentsCollection(f[parseInt(a.toString(),10)],d.bounds));var y,v,i=e.review;d.reviewHistory.add(this.addReviewCollections(i,d.bounds)),je(e.color)||(v=[(y=JSON.parse(e.color)).r,y.g,y.b],d.textMarkUpColor=v),this.preserveIsLockProperty(e,d),je(e.customData)||d.setValues("CustomData",JSON.stringify(e.customData)),je(e.allowedInteractions)||d.setValues("AllowedInteractions",JSON.stringify(e.allowedInteractions)),je(e.textMarkupContent)||d._dictionary.set("TextMarkupContent",e.textMarkupContent.toString()),d.setAppearance(!0),n.annotations.add(d)},hVt.prototype.getCropBoxValue=function(e,t){var i=0,n=0;return null!=e&&(i=t?0:e.cropBox[0],n=t?0:e.cropBox[1]),{x:i,y:n}},hVt.prototype.getBothCropBoxValue=function(e){return[e.cropBox[0],e.cropBox[1]]},hVt.prototype.preserveIsLockProperty=function(e,t){var i=this.checkAnnotationLock(e),n=!1,o=!1;e.isCommentLock&&null!==e.isCommentLock&&(o=Boolean(e.isCommentLock.toString())),e.isPrint&&null!==e.isPrint&&(n=Boolean(e.isPrint.toString())),(!je(e.isLocked)&&e.isLocked||i)&&(i=!0),t.flags=i&&o&&n?bAt.locked|bAt.print|bAt.readOnly:i&&o?bAt.locked|bAt.readOnly:i&&n?bAt.locked|bAt.print:o&&n?bAt.print|bAt.readOnly:i?bAt.locked:o?bAt.readOnly:bAt.print},hVt.prototype.addCustomStampAnnotation=function(e,t){var i=e,e=JSON.parse(i.bounds),n=parseInt(i.pageNumber.toString(),10),o=this.getCropBoxValue(t,!1),r=0,s=0,a=(t.graphics,!je(i.template)&&""!==i.template),n=(s=Object.prototype.hasOwnProperty.call(i,"wrapperBounds")&&!a?(l=i.wrapperBounds,r=(l=this.calculateBoundsXY(l,e,n,t)).x,l.y):(r=this.convertPixelToPoint(e.left),this.convertPixelToPoint(e.top)),0),l=0,o=((0!==o.x&&0!==o.y&&o.x===r||0===o.x&&t.cropBox[2]===t.size[0]&&o.y===t.size[1])&&(n=o.x,l=o.y),r+=n,s+=l,this.convertPixelToPoint(e.width)),n=this.convertPixelToPoint(e.height),l=(je(i.stampAnnotationType)||"image"!==i.stampAnnotationType||" "===i.stampAnnotationPath||a||t.rotation!==TAt.angle90&&t.rotation!==TAt.angle270||(o=this.convertPixelToPoint(e.height),n=this.convertPixelToPoint(e.width)),i.opacity),e=i.rotateAngle;if(!Object.prototype.hasOwnProperty.call(i,"annotationSettings")||je(i.annotationSettings)||je((u=i.annotationSettings).isLock)||u.isLock,!je(i.stampAnnotationType)&&"image"===i.stampAnnotationType&&" "!==i.stampAnnotationPath||a){var h=new BEt(r,s,o,n),d=(t.annotations.add(h),a?(b=h.appearance.normal,d=new mPt(t._crossReference),w=b.graphics.save(),b.graphics.setTransparency(l),(u=new _It(i.template,d._crossReference))._isExported=!0,u._appearance=i.template,u._crossReference=d._crossReference,u._size=[i.templateSize[0],i.templateSize[1]],b.graphics.drawTemplate(u,{x:0,y:0,width:o,height:n}),b.graphics.restore(w)):(a=void 0,(u=DMt(i.stampAnnotationPath.toString().split(",")[1],!1))&&2<u.length&&(255===u[0]&&216===u[1]||137===u[0]&&80===u[1]&&78===u[2]&&71===u[3]&&13===u[4]&&10===u[5]&&26===u[6]&&10===u[7])?(a=new JFt(u),w=(b=h.appearance.normal).graphics.save(),b.graphics.setTransparency(l),b.graphics.drawImage(a,0,0,o,n),b.graphics.restore(w)):(b=h.appearance,u=(d=this.pdfViewerBase.pngData.filter(function(e){return e.name===i.annotName})[0]._dictionary.get("AP")).get("N"),b.normal=new _It(u,t._crossReference)),h.rotationAngle=this.getRubberStampRotateAngle(t.rotation,e)),h.opacity=l,je(i.note)||(h.text=i.note.toString()),h._dictionary.set("NM",i.annotName.toString()),void 0);if(je(i.modifiedDate)||isNaN(Date.parse(i.modifiedDate))||(d=new Date(Date.parse(i.modifiedDate)),h.modifiedDate=d),0<(v=i.comments).length)for(var p=0;p<v.length;p++)h.comments.add(this.addCommentsCollection(v[parseInt(p.toString(),10)],h.bounds));var c=i.review;h.reviewHistory.add(this.addReviewCollections(c,h.bounds)),!je(i.author)&&i.author&&(h.author=i.author.toString()),!je(i.subject)&&i.subject&&(h.subject=i.subject.toString()),this.preserveIsLockProperty(i,h),je(i.customData)||h.setValues("CustomData",JSON.stringify(i.customData)),je(i.icon)||h.setValues("iconName",i.icon)}else{var a=i.icon.toString(),u=i.stampFillcolor.toString(),g=je(i.fillColor)?"#192760":i.fillColor.toString(),m=i.isDynamicStamp.toString(),f=(new fIt([0,0,0]),[]),g=("#192760"===g?f=[25,39,96]:"#516c30"===g?f=[81,108,48]:"#8a251a"===g&&(f=[138,37,26]),new fIt(f),new fIt([0,0,0]),[]),f=("#e6eddf"===u?g=[230,237,223]:"#f6dedd"===u?g=[246,222,221]:"#dce3ef"===u&&(g=[220,227,239]),u=new fIt(f),g=new fIt(g),new yIt(f,1)),y=new dvt(r,s,o,n);t.rotation!==TAt.angle90&&t.rotation!==TAt.angle270||(y=new dvt(r,s,n,o));(h=new BEt).bounds=y,!je(i.subject)&&i.subject&&(h.subject=i.subject.toString()),je(i.note)||(h.text=i.note.toString()),h._dictionary.set("NM",i.annotName.toString());var v,d=void 0;if(je(i.modifiedDate)||isNaN(Date.parse(i.modifiedDate))||(d=new Date(Date.parse(i.modifiedDate)),h.modifiedDate=d),0<(v=i.comments).length)for(p=0;p<v.length;p++)h.comments.add(this.addCommentsCollection(v[parseInt(p.toString(),10)],h.bounds));var b,w,c=i.review,r=(h.reviewHistory.add(this.addReviewCollections(c,h.bounds)),!1),s=("true"!==m&&(r=this.getIconName(i,a,h)),void 0);"Accepted"===a.trim()||"Rejected"===a.trim()?s=this.drawStampAsPath(i.stampAnnotationPath,h,u,g):r&&(t.rotation!==TAt.angle90&&t.rotation!==TAt.angle270||(h.bounds=y),h.rotationAngle=this.getRubberStampRotateAngle(t.rotation,i.rotateAngle)),je(i.modifiedDate)||isNaN(Date.parse(i.modifiedDate))||je(i.modifiedDate)||isNaN(Date.parse(i.modifiedDate))||(n=new Date(Date.parse(i.modifiedDate)),h.modifiedDate=n),h.opacity=l,h.author=je(i.author)||""===i.author.toString()?"Guest":i.author.toString(),this.preserveIsLockProperty(i,h),je(i.customData)||h.setValues("CustomData",JSON.stringify(i.customData)),je(i.rotateAngle)||h.setValues("rotateAngle",i.rotateAngle.toString()),je(i.icon)||h.setValues("iconName",i.icon.toString()),t.annotations.add(h),r||((b=h.appearance.normal).graphics.drawRoundedRectangle(0,0,y.width,y.height,10,f,g),"true"===m?(o=i.dynamicText.toString(),w=b.graphics.save(),b.graphics.setTransparency(l),this.renderDynamicStamp(h,a,o,u,y,f,t),b.graphics.restore(w),h._dictionary.set("Name",k.get("#23D"+a.split(" ").join("")))):(this.retriveDefaultWidth(a.trim()),w=b.graphics.save(),b.graphics.setTransparency(l),this.renderSignHereStamp(h,y,a,u,t,f,s),b.graphics.restore(w)),h.rotationAngle=this.getRubberStampRotateAngle(t.rotation,e))}},hVt.prototype.addMeasure=function(e,t){if(je(e.shapeAnnotationType)||"Line"!==e.shapeAnnotationType)if(je(e.shapeAnnotationType)||"Polyline"!==e.shapeAnnotationType){if(!je(e.shapeAnnotationType)&&"Polyline"===e.shapeAnnotationType&&"PolygonRadius"===e.shapeAnnotationType||"Circle"===e.shapeAnnotationType){var i=this.addCircleMeasurementAnnotation(e,t);t.annotations.add(i)}else if(!je(e.shapeAnnotationType)&&"Polygon"===e.shapeAnnotationType&&"PolygonRadius"!==e.indent){var n=JSON.parse(e.vertexPoints),o=this.getSaveVertexPoints(n,t),r=new GTt(o);r.author=je(e.author)||""===e.author.toString()?"Guest":e.author.toString(),je(e.note)||(r.text=e.note.toString()),je(e.annotName)||(r.name=e.annotName.toString()),je(e.subject)||(r.subject=e.subject.toString()),je(e.strokeColor)||(m=JSON.parse(e.strokeColor),r.color=[m.r,m.g,m.b]),je(e.fillColor)||(f=JSON.parse(e.fillColor),this.isTransparentColor(f)||(y=[f.r,f.g,f.b],r.innerColor=y),f.a<1&&0<f.a?(r._dictionary.update("FillOpacity",f.a),f.a=1):r._dictionary.update("FillOpacity",f.a)),je(e.opacity)||(r.opacity=e.opacity);a=((b=new pDt).width=e.thickness,b.style=e.borderStyle,je(e.borderDashArray)||(b.dash=[e.borderDashArray,e.borderDashArray]),r.border=b,r._dictionary.update("IT",k.get(e.indent.toString())),r.rotationAngle=this.getRotateAngle(e.rotateAngle),void 0),l=(je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(a=new Date(Date.parse(e.modifiedDate)),r.modifiedDate=a),e.comments),h=JSON.parse(e.bounds);if(r.bounds=h,r.bounds.x=h.left,r.bounds.y=h.top,0<l.length)for(d=0;d<l.length;d++)r.comments.add(this.addCommentsCollection(l[parseInt(d.toString(),10)],r.bounds));u=e.review,g=(r.reviewHistory.add(this.addReviewCollections(u,r.bounds)),!je(e.isCloudShape)&&Boolean(e.isCloudShape.toString())&&(r.borderEffect.style=IAt.cloudy,r.borderEffect.intensity=e.cloudIntensity,0<(p=JSON.parse(e.rectangleDifference)).length)&&(c=this.getRDValues(p),r._dictionary.update("RD",c)),this.preserveIsLockProperty(e,r),JSON.parse(e.calibrate));je(g)||(r._dictionary.set("Measure",this.setMeasureDictionary(g)),"PolygonVolume"===e.indent&&Object.prototype.hasOwnProperty.call(g,"depth")&&r._dictionary.update("Depth",g.depth)),je(e.customData)||r.setValues("CustomData",JSON.stringify(e.customData)),e.allowedInteractions&&null!=e.allowedInteractions&&r.setValues("AllowedInteractions",JSON.stringify(e.allowedInteractions)),r.setAppearance(!0),t.annotations.add(r)}}else{var n=JSON.parse(e.vertexPoints),o=this.getSaveVertexPoints(n,t),s=new KTt(o);s.author=je(e.author)||""===e.author.toString()?"Guest":e.author.toString(),je(e.note)||(s.text=e.note.toString()),s._dictionary.set("NM",e.annotName.toString()),je(e.subject)||(s.subject=e.subject.toString()),je(e.strokeColor)||(i=[(m=JSON.parse(e.strokeColor)).r,m.g,m.b],s.color=i),je(e.fillColor)||(f=JSON.parse(e.fillColor),this.isTransparentColor(f)||(y=[f.r,f.g,f.b],s.innerColor=y),f.a<1&&0<f.a?(s._dictionary.update("FillOpacity",f.a),f.a=1):s._dictionary.update("FillOpacity",f.a)),je(e.opacity)||(s.opacity=e.opacity);(b=new pDt).width=e.thickness,b.style=this.getBorderStyle(e.borderStyle),b.dash=e.borderDashArray,s.border=b,s.rotationAngle=this.getRotateAngle(e.rotateAngle),s.beginLineStyle=this.getLineEndingStyle(e.lineHeadStart),s.endLineStyle=this.getLineEndingStyle(e.lineHeadEnd);var a=void 0,l=(je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(a=new Date(Date.parse(e.modifiedDate)),s.modifiedDate=a),e.comments),h=JSON.parse(e.bounds);if(s.bounds=h,s.bounds.x=h.left,s.bounds.y=h.top,0<l.length)for(var d=0;d<l.length;d++)s.comments.add(this.addCommentsCollection(l[parseInt(d.toString(),10)],s.bounds));var p,c,u=e.review,g=(s.reviewHistory.add(this.addReviewCollections(u,s.bounds)),s._dictionary.set("IT",k.get(e.indent.toString())),!je(e.isCloudShape)&&e.isCloudShape&&((i=new mPt(t._crossReference)).update("S",k.get("C")),i.update("I",e.cloudIntensity),s._dictionary.update("BE",i),0<(p=JSON.parse(e.rectangleDifference)).length)&&(c=this.getRDValues(p),s._dictionary.update("RD",c)),this.preserveIsLockProperty(e,s),JSON.parse(e.calibrate));je(g)||s._dictionary.set("Measure",this.setMeasureDictionary(g)),je(e.customData)||s.setValues("CustomData",JSON.stringify(e.customData)),e.allowedInteractions&&null!==e.allowedInteractions&&s.setValues("AllowedInteractions",JSON.stringify(e.allowedInteractions)),s.setAppearance(!0),t.annotations.add(s)}else{var m,f,y,n=JSON.parse(e.vertexPoints),o=this.getSaveVertexPoints(n,t),v=new BTt(o);je(e.note)||(v.text=e.note.toString()),v.author=je(e.author)||""===e.author.toString()?"Guest":e.author.toString(),je(e.subject)||(v.subject=e.subject.toString()),v.lineIntent=CAt.lineDimension,je(e.annotName)||(v.name=e.annotName.toString()),je(e.strokeColor)||(m=JSON.parse(e.strokeColor),v.color=[m.r,m.g,m.b]),je(e.fillColor)||(f=JSON.parse(e.fillColor),this.isTransparentColor(f)||(y=[f.r,f.g,f.b],v.innerColor=y),f.a<1&&0<f.a?(v._dictionary.update("FillOpacity",f.a),f.a=1):v._dictionary.update("FillOpacity",f.a)),je(e.opacity)||(v.opacity=e.opacity);(b=new pDt).width=e.thickness,je(e.borderStyle)||""===e.borderStyle||(b.style=this.getBorderStyle(e.borderStyle)),je(e.borderDashArray)||(b.dash=[e.borderDashArray,e.borderDashArray]),v.border=b,v.rotationAngle=this.getRotateAngle(e.rotateAngle),v.lineEndingStyle.begin=this.getLineEndingStyle(e.lineHeadStart),v.lineEndingStyle.end=this.getLineEndingStyle(e.lineHeadEnd);var b,a=void 0,i=(je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(a=new Date(Date.parse(e.modifiedDate)),v.modifiedDate=a),v.caption.type=this.getCaptionType(e.captionPosition),/[\u0600-\u06FF]/.test(v.text)),l=(v.caption.cap=!i&&e.caption,v.leaderExt=e.leaderLength,v.leaderLine=e.leaderLineExtension,e.comments),h=JSON.parse(e.bounds);if(v.bounds=h,v.bounds.x=h.left,v.bounds.y=h.top,0<l.length)for(var d=0;d<l.length;d++)v.comments.add(this.addCommentsCollection(l[parseInt(d.toString(),10)],v.bounds));var u=e.review;v.reviewHistory.add(this.addReviewCollections(u,v.bounds)),v._dictionary.update("LLO",e.leaderLineOffset),this.preserveIsLockProperty(e,v),je(g=JSON.parse(e.calibrate))||v._dictionary.set("Measure",this.setMeasureDictionary(g)),je(e.customData)||v.setValues("CustomData",JSON.stringify(e.customData)),e.allowedInteractions&&null!=e.allowedInteractions&&v.setValues("AllowedInteractions",JSON.stringify(e.allowedInteractions)),v.setAppearance(!0),t.annotations.add(v)}},hVt.prototype.addStickyNotes=function(e,t){var i=JSON.parse(e.bounds),n=this.getCropBoxValue(t,!1),o=this.convertPixelToPoint(i.left),r=this.convertPixelToPoint(i.top),s=this.convertPixelToPoint(i.width),i=this.convertPixelToPoint(i.height),a=0,l=0,h=((0!==n.x&&0!==n.y&&n.x===o||0===n.x&&t.cropBox[2]===t.size[0]&&n.y===t.size[1])&&(a=n.x,l=n.y),new rEt(null,a+o,l+r,s,i)),d=(null===e.author&&(e.author="Guest"),null!=e.note&&(h.text=e.note.toString()),h.author=e.author.toString(),null!=e.subject&&(h.subject=e.subject.toString()),h._dictionary.set("NM",e.annotName.toString()),je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(n=new Date(Date.parse(e.modifiedDate)),h.modifiedDate=n),e.comments);if(0<d.length)for(var p=0;p<d.length;p++)h.comments.add(this.addCommentsCollection(d[parseInt(p.toString(),10)],h.bounds));a=e.review;h.reviewHistory.add(this.addReviewCollections(a,h.bounds));h.color=[255,255,51],h.opacity=e.opacity,h.icon=OAt.comment,this.preserveIsLockProperty(e,h),je(e.customData)||h.setValues("CustomData",JSON.stringify(e.customData)),t.annotations.add(h)},hVt.hasDynamicText=function(e){return Object.prototype.hasOwnProperty.call(e,"dynamicText")&&!je(e.dynamicText.toString())},hVt.setFontFromKeys=function(e,t,i,n,o){i=mRt.tryGetFontFromKeys(i,e.dynamicText.toString(),n,o);je(i)?t.setAppearance(!1):(t.font=i,t.setAppearance(!0))},hVt.prototype.addFreeText=function(e,t,i){var n=JSON.parse(e.bounds),o=this.getCropBoxValue(t,!1),r=this.convertPixelToPoint(n.left),s=this.convertPixelToPoint(n.top),a=this.convertPixelToPoint(n.width),n=this.convertPixelToPoint(n.height),l=0,h=0,d=((0!==o.x&&0!==o.y&&o.x===r||0===o.x&&t.cropBox[2]===t.size[0]&&o.y===t.size[1])&&(l=o.x,h=o.y),new VEt(l+r,h+s,a,n)),l=(d.setAppearance(!0),je(e.author)&&(e.author="Guest"),d.author=e.author.toString(),je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(o=new Date(Date.parse(e.modifiedDate)),d.modifiedDate=o),e.review),r=(d.reviewHistory.add(this.addReviewCollections(l,d.bounds)),d._dictionary.set("NM",e.annotName.toString()),d.lineEndingStyle=wAt.openArrow,d.annotationIntent=HAt.freeTextTypeWriter,0),h=(je(e.fontSize)||(r=parseFloat(e.fontSize)),r=!je(r)&&!isNaN(r)&&0<r?r:16,this.getFontFamily(e.fontFamily)),s={},a=(Object.prototype.hasOwnProperty.call(e,"font")&&!je(e.font)&&(s=e.font),this.getFontStyle(s));if(d.font=new _xt(h,this.convertPixelToPoint(r),a),hVt.hasDynamicText(e))if(!je(i)&&0<Object.keys(i).length){n=mRt.getFontKey(i,e.fontFamily.toLowerCase());!je(n)&&(o=i[""+n],o=mRt.processFontStream(o),l=new Uxt(o,this.convertPixelToPoint(r),a),s=mRt.isSupportedFont(e.dynamicText.toString(),l),d.setAppearance(s),s)?d.font=l:hVt.setFontFromKeys(e,d,i,r,a)}else try{d.font.measureString(e.dynamicText.toString())}catch(e){d.setAppearance(!1)}null!=e.subject&&(d.subject=e.subject.toString()),d.text="",Object.prototype.hasOwnProperty.call(e,"dynamicText")&&!je(e.dynamicText.toString())&&(d.text=e.dynamicText.toString());var p,h="RotateAngle"+Math.abs(e.rotateAngle),n=(d.rotationAngle=this.getRotateAngle(h),new pDt),c=(n.width=je(e.thickness)?1:e.thickness,d.border=n,d.border.width=n.width,Object.prototype.hasOwnProperty.call(e,"padding")&&je(e.padding),d.opacity=je(e.opacity)?1:e.opacity,je(e.strokeColor)||(p=[(o=JSON.parse(e.strokeColor)).r,o.g,o.b],d.borderColor=p,this.isTransparentColor(o))||(d.border.width=je(e.thickness)?0:e.thickness),je(e.fillColor)||(s=JSON.parse(e.fillColor),this.isTransparentColor(s)||(p=[s.r,s.g,s.b],e.isTransparentSet?d.color=void 0:d.color=p),s.a<1&&0<s.a?(d._dictionary.update("FillOpacity",s.a),s.a=1):d._dictionary.update("FillOpacity",s.a)),je(e.fontColor)||(l=JSON.parse(e.fontColor),this.isTransparentColor(l))||(i=[l.r,l.g,l.b],d.textMarkUpColor=i),e.comments);if(0<c.length)for(var u=0;u<c.length;u++)d.comments.add(this.addCommentsCollection(c[parseInt(u.toString(),10)],d.bounds));this.preserveIsLockProperty(e,d),je(e.customData)||d.setValues("CustomData",JSON.stringify(e.customData)),Object.prototype.hasOwnProperty.call(e,"textAlign")&&!je(e.textAlign)&&(d.textAlignment=this.getPdfTextAlignment(e.textAlign.toString().toLowerCase())),Object.prototype.hasOwnProperty.call(e,"allowedInteractions")&&!je(e.allowedInteractions)&&d.setValues("AllowedInteractions",JSON.stringify(e.allowedInteractions)),t.annotations.add(d)},hVt.prototype.renderSignHereStamp=function(e,t,i,n,o,r,s){var a=new E1t,l=new _xt(Zxt.helvetica,20,Jxt.bold|Jxt.italic),h=(a.alignment=MAt.center,a.lineAlignment=T1t.middle,new nIt),d=e.appearance.normal,p=(0<this.defaultHeight&&0<this.defaultWidth&&d.graphics.scaleTransform(t.width/(this.defaultWidth+4),t.height/28),p=[this.defaultWidth/2+1,15,0,0],h.addLine(p[0],p[1],(p=[0,0])[0],p[1]),[h._points[0][0],h._points[0][1],0,0]);if(s){for(var c=Number.MAX_VALUE,u=Number.MAX_VALUE,g=Number.MIN_VALUE,m=Number.MIN_VALUE,f=0;f<s._points.length;f++)var y=s._points[parseInt(f.toString(),10)],c=Math.min(c,y[0]),u=Math.min(u,y[1]),g=Math.max(g,y[0]),m=Math.max(m,y[1]);for(var v=(t.width-(g-c))/2-c,b=(t.height-(m-u))/2-u,f=0;f<s._points.length;f++)s._points[parseInt(f.toString(),10)][0]+=v,s._points[parseInt(f.toString(),10)][1]+=b;e.appearance.normal.graphics.drawPath(s,r,n)}else d.graphics.drawString(i.toUpperCase(),l,p,r,n,a)},hVt.prototype.retriveDefaultWidth=function(e){switch(e.trim()){case"Witness":this.defaultWidth=97.39,this.defaultHeight=16.84;break;case"Initial Here":this.defaultWidth=151.345,this.defaultHeight=16.781;break;case"Sign Here":this.defaultWidth=121.306,this.defaultHeight=16.899;break;default:this.defaultWidth=0,this.defaultHeight=0}},hVt.prototype.renderDynamicStamp=function(e,t,i,n,o,r,s){var a=new E1t,l=(a.alignment=MAt.left,a.lineAlignment=T1t.middle,null),h=null,d=!1,d=(h=(d=/[\u0600-\u06FF]/.test(i)?!0:d)?(l=new Uxt(oVt(),this.pdfViewer.annotationModule.calculateFontSize(t.toUpperCase(),o)-5,Jxt.bold|Jxt.italic),new Uxt(oVt(),this.pdfViewer.annotationModule.calculateFontSize(i.toUpperCase(),o)-5,Jxt.bold|Jxt.italic)):(l=new _xt(Zxt.helvetica,this.pdfViewer.annotationModule.calculateFontSize(t.toUpperCase(),o)-5,Jxt.bold|Jxt.italic),new _xt(Zxt.helvetica,this.pdfViewer.annotationModule.calculateFontSize(i,o)-5,Jxt.bold|Jxt.italic)),e.appearance.normal),e=new nIt,p=[5,o.height/3],c=[5,o.height-2*h.size],p=(e.addLine(p[0],p[1],c[0],c[1]),[e._points[0][0],e._points[0][1],0,0]),c=[e._points[1][0],e._points[1][1],o.width-e._points[1][0],o.height-e._points[1][1]];d.graphics.drawString(t.toUpperCase(),l,p,r,n,a),d.graphics.drawString(i,h,c,r,n,a)},hVt.prototype.calculateBoundsXY=function(e,t,i,n){var o=new dvt,i=this.pdfViewer.pdfRendererModule.getPageSize(i);return n.rotation===TAt.angle90?(o.x=this.convertPixelToPoint(e.y),o.y=this.convertPixelToPoint(i.width-e.x-e.width)):n.rotation===TAt.angle180?(o.x=this.convertPixelToPoint(i.width-e.x-e.width),o.y=this.convertPixelToPoint(i.height-e.y-e.height)):n.rotation===TAt.angle270?(o.x=this.convertPixelToPoint(i.height-e.y-e.height),o.y=this.convertPixelToPoint(e.x)):(o.x=this.convertPixelToPoint(e.x),o.y=this.convertPixelToPoint(e.y)),o},hVt.prototype.setMeasurementUnit=function(e){var t;switch(e){case"cm":t=PAt.centimeter;break;case"in":t=PAt.inch;break;case"mm":t=PAt.millimeter;break;case"pt":t=PAt.point;break;case"p":t=PAt.pica}return t},hVt.prototype.getRubberStampRotateAngle=function(e,t){var i=TAt.angle0;switch(t){case 0:i=TAt.angle0;break;case 90:i=TAt.angle90;break;case 180:i=TAt.angle180;break;case 270:i=TAt.angle270}return i=(e-i+4)%4},hVt.prototype.getFontFamily=function(e){var t=Zxt.helvetica;switch(e=je(e)||""===e?"Helvetica":e){case"Helvetica":t=Zxt.helvetica;break;case"Courier":t=Zxt.courier;break;case"Times New Roman":t=Zxt.timesRoman;break;case"Symbol":t=Zxt.symbol;break;case"ZapfDingbats":t=Zxt.zapfDingbats}return t},hVt.prototype.getFontStyle=function(e){var t=Jxt.regular;return je(e)||(e.isBold&&(t|=Jxt.bold),e.isItalic&&(t|=Jxt.italic),e.isStrikeout&&(t|=Jxt.strikeout),e.isUnderline&&(t|=Jxt.underline)),t},hVt.prototype.getPdfTextAlignment=function(e){var t=MAt.left;switch(e){case"center":t=MAt.center;break;case"right":t=MAt.right;break;case"justify":t=MAt.justify}return t},hVt.prototype.drawStampAsPath=function(e,t,i,n){for(var o={x:0,y:0},r=new nIt,s=e,a=0;a<s.length;a++){var l,h,d=s[parseInt(a.toString(),10)],p=d.command.toString();"M"===p&&(r.startFigure(),o={x:d.x,y:d.y}),"L"===p&&(l=[o,{x:d.x,y:d.y}],this.transformPoints(l),l=[{x:l[0].x,y:l[0].y},{x:l[1].x,y:l[1].y}],r.addLine(this.convertPixelToPoint(l[0].x),this.convertPixelToPoint(l[0].y),this.convertPixelToPoint(l[1].x),this.convertPixelToPoint(l[1].y)),o={x:d.x,y:d.y}),"C"===p&&(l=[o,{x:d.x,y:d.y},{x:d.x1,y:d.y1},{x:d.x2,y:d.y2}],this.transformPoints(l),h=[{x:l[0].x,y:l[0].y},{x:l[1].x,y:l[1].y},{x:l[2].x,y:l[2].y},{x:l[3].x,y:l[3].y}],r.addBezier(this.convertPixelToPoint(h[0].x),this.convertPixelToPoint(h[0].y),this.convertPixelToPoint(h[1].x),this.convertPixelToPoint(h[1].y),this.convertPixelToPoint(h[2].x),this.convertPixelToPoint(h[2].y),this.convertPixelToPoint(h[3].x),this.convertPixelToPoint(h[3].y)),o={x:d.x,y:d.y}),"Z"!==p&&"z"!==p||r.closeFigure()}return r},hVt.prototype.transformPoints=function(e){if(!je(e))for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)]=this.transform(e[parseInt(t.toString(),10)])},hVt.prototype.transform=function(e){return{x:e.x,y:e.y}},hVt.prototype.getIconName=function(e,t,i){var n=!0;switch(t.trim()){case"Approved":i.icon=FAt.approved;break;case"Confidential":i.icon=FAt.confidential;break;case"Not Approved":i.icon=FAt.notApproved;break;case"Draft":i.icon=FAt.draft;break;case"Final":i.icon=FAt.final;break;case"Completed":i.icon=FAt.completed;break;case"For Public Release":i.icon=FAt.forPublicRelease;break;case"Not For Public Release":i.icon=FAt.notForPublicRelease;break;case"For Comment":i.icon=FAt.forComment;break;case"Void":i.icon=FAt.void;break;case"Preliminary Results":i.icon=FAt.preliminaryResults;break;case"Information Only":i.icon=FAt.informationOnly;break;default:n=!1}return n},hVt.prototype.addCircleMeasurementAnnotation=function(e,t){var i=JSON.parse(e.bounds),n=this.getCropBoxValue(t,!1),o=this.convertPixelToPoint(i.left),r=this.convertPixelToPoint(i.top),s=this.convertPixelToPoint(i.width),a=this.convertPixelToPoint(i.height),i=(je(i.left)&&(e.bounds.left=0),je(i.top)&&(e.bounds.top=0),0),l=0,h=((0!==n.x&&0!==n.y&&n.x===o||0===n.x&&t.cropBox[2]===t.size[0]&&n.y===t.size[1])&&(i=n.x,l=n.y),new RTt(i+o,l+r,s,a)),l=(je(e.note)||(h.text=e.note.toString()),h.author=je(e.author)||""===e.author.toString()?"Guest":e.author.toString(),h._dictionary.set("NM",e.annotName.toString()),je(e.subject)||(h.subject=e.subject.toString()),je(e.strokeColor)||(n=[(t=JSON.parse(e.strokeColor)).r,t.g,t.b],h.color=n),je(e.fillColor)||(i=JSON.parse(e.fillColor),this.isTransparentColor(i)||(o=[i.r,i.g,i.b],h.innerColor=o),i.a<1&&0<i.a?(h._dictionary.update("FillOpacity",i.a),i.a=1):h._dictionary.update("FillOpacity",i.a)),je(e.opacity)||(h.opacity=e.opacity),new pDt),d=(l.width=e.thickness,l.style=e.borderStyle,l.dash=e.borderDashArray,h.border=l,h.rotationAngle=this.getRotateAngle(e.rotateAngle),je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(r=new Date(Date.parse(e.modifiedDate)),h.modifiedDate=r),e.comments);if(0<d.length)for(var p=0;p<d.length;p++)h.comments.add(this.addCommentsCollection(d[parseInt(p.toString(),10)],h.bounds));s=e.review,h.reviewHistory.add(this.addReviewCollections(s,h.bounds)),!je(e.isCloudShape)&&e.isCloudShape&&((a=new uDt).style=IAt.cloudy,a.intensity=e.cloudIntensity,h._borderEffect=a,0<(t=JSON.parse(e.rectangleDifference)).length)&&(n=this.getRDValues(t),h._dictionary.update("RD",n)),this.preserveIsLockProperty(e,h),h.measureType=BAt.radius,o=JSON.parse(e.calibrate);return je(o)||h._dictionary.set("Measure",this.setMeasureDictionary(o)),je(e.customData)||h.setValues("CustomData",JSON.stringify(e.customData)),h.setAppearance(!0),h},hVt.prototype.setMeasureDictionary=function(e){var t,i=new mPt;return i.set("Type","Measure"),i.set("R",e.ratio),je(e.x)||(t=this.createNumberFormat(e.x),i.set("X",t)),je(e.distance)||(t=this.createNumberFormat(JSON.parse(e.distance)),i.set("D",t)),je(e.area)||(t=this.createNumberFormat(JSON.parse(e.area)),i.set("A",t)),je(e.angle)||(t=this.createNumberFormat(JSON.parse(e.angle)),i.set("T",t)),je(e.volume)||(t=this.createNumberFormat(JSON.parse(e.volume)),i.set("V",t)),i},hVt.prototype.createNumberFormat=function(e){var t=[];if(!je(e)&&0!==e.length){for(var i=0;i<e.length;i++){var n=new mPt,o=e[parseInt(i.toString(),10)];n.set("Type","NumberFormat"),n.set("U",o.unit),n.set("F",o.fractionalType),n.set("D",o.denominator),n.set("C",o.conversionFactor),n.set("FD",o.formatDenominator),t.push(n)}return t}},hVt.prototype.checkAnnotationLock=function(e){var t=!1;return t=je(e.annotationSettings)||je((e=e.annotationSettings).isLock)?t:e.isLock},hVt.prototype.getSaveVertexPoints=function(e,t){for(var i=t.size[1],n=[],o=0;o<e.length;o++){var r=this.convertPixelToPoint(e[parseInt(o.toString(),10)].x),r=(n.push(r),i-this.convertPixelToPoint(e[parseInt(o.toString(),10)].y));n.push(r)}return n},hVt.prototype.getLineEndingStyle=function(e){var t=wAt.none;switch(e){case"Square":t=wAt.square;break;case"ClosedArrow":case"Closed":t=wAt.closedArrow;break;case"RClosedArrow":t=wAt.rClosedArrow;break;case"OpenArrow":case"Open":t=wAt.openArrow;break;case"ROpenArrow":t=wAt.rOpenArrow;break;case"Butt":t=wAt.butt;break;case"Circle":case"Round":t=wAt.circle;break;case"Diamond":t=wAt.diamond;break;case"Slash":t=wAt.slash}return t},hVt.prototype.getCaptionType=function(e){var t=AAt.inline;switch(e){case"Inline":t=AAt.inline;break;case"Top":t=AAt.top}return t},hVt.prototype.addReviewCollections=function(e,t){t=new rEt(null,t.x,t.y,t.width,t.height);return null!=e.state&&(t.state=this.getReviewState(e.state.toString()),t.stateModel=VAt.review),t},hVt.prototype.addCommentsCollection=function(e,t){var i=new rEt,n=(i.text=e.note,i.author=e.author,i.subject=e.subject,je(e.note)?i._annotFlags=bAt.print:i.text=e.note.toString(),e.review);return i.reviewHistory.add(this.addReviewCollections(n,t)),je(e.modifiedDate)||isNaN(Date.parse(e.modifiedDate))||(n=new Date(Date.parse(e.modifiedDate)),i.modifiedDate=n),je(e.annotName)||i._dictionary.set("NM",e.annotName.toString()),i},hVt.prototype.getReviewState=function(e){var t;switch(e){case"Accepted":t=NAt.accepted;break;case"Cancelled":t=NAt.cancel;break;case"Completed":t=NAt.completed;break;case"Rejected":t=NAt.rejected;break;case"None":t=NAt.none;break;default:t=NAt.unmarked}return t},hVt.prototype.convertPixelToPoint=function(e){return 72*e/96},hVt.prototype.convertPointToPixel=function(e){return 96*e/72},hVt.prototype.isTransparentColor=function(e){return e&&0===e.a},hVt.prototype.getRDValues=function(e){for(var t=[],i=0;i<e.length;i++)t.push(parseFloat(e[parseInt(i.toString(),10)]));return t},hVt.prototype.getRotateAngle=function(e){var t=TAt.angle0;switch(e){case"RotateAngle0":t=TAt.angle0;break;case"RotateAngle180":t=TAt.angle180;break;case"RotateAngle270":t=TAt.angle270;break;case"RotateAngle90":t=TAt.angle90}return t},hVt.prototype.getInkRotateAngle=function(e){var t=0;switch(e){case"0":t=0;break;case"1":t=-90;break;case"2":t=-180;break;case"3":t=-270}return t},hVt.prototype.loadSignature=function(e,t,i,n,o,r){var s=new fVt,a="";if(!je(e.inkPointsCollection))for(var l=0;l<e.inkPointsCollection.length;l++)for(var h=e.inkPointsCollection[parseInt(l.toString(),10)],d=0;d<h.length;d+=2){var p=void 0,c=void 0,c=e._page.rotation===TAt.angle90?(p=h[d+1],h[parseInt(d.toString(),10)]):e._page.rotation===TAt.angle180?(p=e._page.size[0]-h[parseInt(d.toString(),10)],h[d+1]):e._page.rotation===TAt.angle270?(p=e._page.size[0]-h[d+1],e._page.size[1]-h[parseInt(d.toString(),10)]):(p=h[parseInt(d.toString(),10)],e._page.size[1]-h[d+1]);a+=0===d?"M"+p+","+c+" ":"L"+p+","+c+" "}return s.AnnotationType="Signature",s.Bounds=this.getBounds(e.bounds,t,i,n),s.Opacity=e.opacity,s.Thickness=e.border.width,s.PathData=a,s.StrokeColor="rgba("+e.color[0]+","+e.color[1]+","+e.color[2]+","+(e.color[3]||1)+")",s.PageNumber=o,s.SignatureName=e.name,s},hVt.prototype.loadInkAnnotation=function(e,t,i,n,o,r){var s=new uVt,a="";if(!je(e.inkPointsCollection))for(var l=0;l<e.inkPointsCollection.length;l++)for(var h=e.inkPointsCollection[parseInt(l.toString(),10)],d=0;d<h.length;d+=2){var p=void 0,c=void 0,c=e._page.rotation===TAt.angle90?(p=h[d+1],h[parseInt(d.toString(),10)]):e._page.rotation===TAt.angle180?(p=e._page.size[0]-h[parseInt(d.toString(),10)],h[d+1]):e._page.rotation===TAt.angle270?(p=e._page.size[0]-h[d+1],e._page.size[1]-h[parseInt(d.toString(),10)]):(p=h[parseInt(d.toString(),10)],e._page.size[1]-h[d+1]);a+=0===d?"M"+p+","+c+" ":"L"+p+","+c+" "}s.Author=e.author,s.Subject=e.subject,je(e.modifiedDate)?s.ModifiedDate=this.formatDate(new Date):s.ModifiedDate=this.formatDate(e.modifiedDate),s.Note=this.getValidNoteContent(e.text);for(var u=0;u<e.reviewHistory.count;u++)s.State=this.getStateString(e.reviewHistory.at(parseInt(u.toString(),10)).state),s.StateModel=this.getStateModelString(e.reviewHistory.at(parseInt(u.toString(),10)).stateModel);(je(s.State)||je(s.StateModel))&&(s.State="Unmarked",s.StateModel="None"),s.Comments=new Array;for(u=0;u<e.comments.count;u++){var g=this.loadPopupAnnotation(e.comments.at(u),t,i,n);s.Comments.push(g)}return this.updateIsLockProperty(s,e),s.AnnotationType="Ink",s.AnnotType="Ink",s.Bounds=this.getBounds(e.bounds,t,i,n),e.bounds.y<0&&(r=new dvt(e.bounds.x,r.cropBox[1]+e.bounds.y,e.bounds.width,e.bounds.height),s.Bounds=this.getBounds(r,t,i,n)),s.Opacity=e.opacity,s.Thickness=e.border.width,s.PathData=a,s.StrokeColor="rgba("+e.color[0]+","+e.color[1]+","+e.color[2]+","+(e.color[3]||1)+")",s.PageNumber=o,s.AnnotName=e.name,e._dictionary.has("CustomData")&&!je(e._dictionary.get("CustomData"))&&null!=(r=e._dictionary.get("CustomData"))&&(s.ExistingCustomData=r),s},hVt.prototype.loadSquareAnnotation=function(e,t,i,n,o){var r=new gVt;r.ShapeAnnotationType="Square",r.Author=e.author,r.AnnotName=e.name,r.Subject=e.subject,je(e.modifiedDate)?r.ModifiedDate=this.formatDate(new Date):r.ModifiedDate=this.formatDate(e.modifiedDate),r.Note=this.getValidNoteContent(e.text),r.Thickness=e.border.width,r.BorderStyle=this.getBorderStylesString(e.border.style),r.BorderDashArray=e.border.dash&&e.border.dash[0]||0,r.Opacity=e.opacity,r.RotateAngle=this.getRotateAngleString(e.rotate),r.AnnotType="shape";for(var s=0;s<e.reviewHistory.count;s++)r.State=this.getStateString(e.reviewHistory.at(parseInt(s.toString(),10)).state),r.StateModel=this.getStateModelString(e.reviewHistory.at(parseInt(s.toString(),10)).stateModel);(je(r.State)||je(r.StateModel))&&(r.State="Unmarked",r.StateModel="None"),r.Comments=new Array;for(s=0;s<e.comments.count;s++){var a=this.loadPopupAnnotation(e.comments.at(s),t,i,n);r.Comments.push(a)}r.Bounds=this.getBounds(e.bounds,t,i,n),r.LineHeadStart="None",r.LineHeadEnd="None",!je(e.borderEffect)&&e.borderEffect.style===IAt.cloudy?(r.IsCloudShape=!0,r.CloudIntensity=e.borderEffect.intensity):(r.IsCloudShape=!1,r.CloudIntensity=0),e._dictionary.has("RD")&&!je(e._dictionary.get("RD"))?r.RectangleDifference=e._dictionary.get("RD"):r.RectangleDifference=new Array,this.updateIsLockProperty(r,e),e._dictionary.has("AllowedInteractions")&&(l=e.getValues("AllowedInteractions")[0],r.AllowedInteractions=JSON.parse(l)),r.StrokeColor=je(e.color)?"rgba(0,0,0,1)":"rgba("+e.color[0]+","+e.color[1]+","+e.color[2]+","+(e.color[3]||1)+")";var l=!je(e.color)&&e.color[3]?e.color[3]:1;return e._dictionary.has("FillOpacity")&&!je(e._dictionary.get("FillOpacity"))&&(l=parseInt(e._dictionary.get("FillOpacity").toString(),10)),l=e.innerColor?l:0,e.innerColor=e.innerColor||[255,255,255],r.FillColor="rgba("+e.innerColor[0]+","+e.innerColor[1]+","+e.innerColor[2]+","+l+")",r.EnableShapeLabel=!1,null!=o&&(r.EnableShapeLabel=!0,r.LabelContent=o.text,r.LabelFillColor="rgba("+o.color[0]+","+o.color[1]+","+o.color[2]+","+(o.color[3]||1)+")",r.FontColor="rgba("+o.textMarkUpColor[0]+","+o.textMarkUpColor[1]+","+o.textMarkUpColor[2]+","+(o.textMarkUpColor[3]||1)+")",r.LabelBorderColor="rgba("+o.borderColor[0]+","+o.borderColor[1]+","+o.borderColor[2]+","+(o.borderColor[3]||1)+")",r.FontSize=o.font.size),e._dictionary.has("CustomData")&&!je(e._dictionary.get("CustomData"))&&null!=(l=e._dictionary.get("CustomData"))&&(r.ExistingCustomData=l),r},hVt.prototype.loadLineAnnotation=function(e,t,i,n,o){var r=new gVt;r.ShapeAnnotationType="Line",r.Author=e.author,r.AnnotName=e.name,r.Subject=e.subject,je(e.modifiedDate)?r.ModifiedDate=this.formatDate(new Date):r.ModifiedDate=this.formatDate(e.modifiedDate),r.Note=this.getValidNoteContent(e.text),r.Thickness=e.border.width,r.BorderStyle=this.getBorderStylesString(e.border.style),r.BorderDashArray=e.border.dash&&e.border.dash[0]||0,r.Opacity=e.opacity,r.RotateAngle=this.getRotateAngleString(e.rotate),r.AnnotType="shape",r.EnableShapeLabel=!1,null!=o&&(r.EnableShapeLabel=!0,r.LabelContent=o.text,r.LabelFillColor="rgba("+o.color[0]+","+o.color[1]+","+o.color[2]+","+(o.color[3]||1)+")",r.FontColor="rgba("+o.textMarkUpColor[0]+","+o.textMarkUpColor[1]+","+o.textMarkUpColor[2]+","+(o.textMarkUpColor[3]||1)+")",r.LabelBorderColor="rgba("+o.borderColor[0]+","+o.borderColor[1]+","+o.borderColor[2]+","+(o.borderColor[3]||1)+")",r.FontSize=o.font.size);for(var s=0;s<e.reviewHistory.count;s++)r.State=this.getStateString(e.reviewHistory.at(parseInt(s.toString(),10)).state),r.StateModel=this.getStateModelString(e.reviewHistory.at(parseInt(s.toString(),10)).stateModel);(je(r.State)||je(r.StateModel))&&(r.State="Unmarked",r.StateModel="None"),r.Comments=new Array;for(s=0;s<e.comments.count;s++){var a=this.loadPopupAnnotation(e.comments.at(s),t,i,n);r.Comments.push(a)}r.Bounds=this.getBounds(e.bounds,t,i,n),r.LineHeadStart=this.getLineEndingStyleString(e.lineEndingStyle.begin),r.LineHeadEnd=this.getLineEndingStyleString(e.lineEndingStyle.end),!je(e._borderEffect)&&e._borderEffect.style===IAt.cloudy?(r.IsCloudShape=!0,r.CloudIntensity=e._borderEffect.intensity):(r.IsCloudShape=!1,r.CloudIntensity=0),r.VertexPoints=this.getLinePoints(e.linePoints,t,i,n,e._page),e._dictionary.has("RD")&&!je(e._dictionary.get("RD"))?r.RectangleDifference=e._dictionary.get("RD"):r.RectangleDifference=new Array,this.updateIsLockProperty(r,e),e._dictionary.has("AllowedInteractions")&&(o=e.getValues("AllowedInteractions")[0],r.AllowedInteractions=JSON.parse(o));var l,o=je(e.color)?[0,0,0]:e.color,o=(r.StrokeColor="rgba("+o[0]+","+o[1]+","+o[2]+","+(o[3]||1)+")",e.color&&e.color[3]?e.color[3]:1);return e._dictionary.has("FillOpacity")&&!je(e._dictionary.get("FillOpacity"))&&(o=parseInt(e._dictionary.get("FillOpacity").toString(),10)),o=e.innerColor?o:0,e.innerColor=e.innerColor||[255,255,255],r.FillColor="rgba("+e.innerColor[0]+","+e.innerColor[1]+","+e.innerColor[2]+","+o+")",e._dictionary.has("CustomData")&&!je(e._dictionary.get("CustomData"))&&null!=(l=e._dictionary.get("CustomData"))&&(r.ExistingCustomData=l),e.lineIntent!==CAt.lineArrow&&e._dictionary.has("Measure")?(o=new mVt(r),e._dictionary.has("Measure")&&(o.Calibrate=this.getMeasureObject(e)),o.Indent=e.lineIntent.toString(),o.Caption=e.caption.cap,o.LeaderLength=e.leaderExt,o.LeaderLineExtension=e.leaderLine,o.ExistingCustomData=r.ExistingCustomData,e._dictionary.has("LLO")?o.LeaderLineOffset=e._dictionary.get("LLO"):o.LeaderLineOffset=0,o.CaptionPosition=e.caption.type.toString(),e.flags===bAt.readOnly?o.IsCommentLock=!0:o.IsCommentLock=!1,e.flags===bAt.print&&(o.IsPrint=!0),e._dictionary.has("CustomData")&&!je(e._dictionary.get("CustomData"))&&null!=(l=e._dictionary.get("CustomData"))&&(o.ExistingCustomData=l),o):r},hVt.prototype.getLinePoints=function(e,t,i,n,o){var r=[],s=new CVt(e[0],e[1]),a=new CVt(e[2],e[3]),l=this.getBothCropBoxValue(o),h=0,d=0;return 0===l[0]&&o.cropBox[2]===o.size[2]&&l[1]===o.size[3]||(h=l[0],d=l[1]),0===n?(s={X:this.convertPointToPixel(e[0])-this.convertPointToPixel(h),Y:t-this.convertPointToPixel(e[1])+this.convertPointToPixel(d)},a={X:this.convertPointToPixel(e[2])-this.convertPointToPixel(h),Y:t-this.convertPointToPixel(e[3])+this.convertPointToPixel(d)}):1===n?(s={X:this.convertPointToPixel(e[1]),Y:this.convertPointToPixel(e[0])},a={X:this.convertPointToPixel(e[3]),Y:this.convertPointToPixel(e[2])}):2===n?(s={X:i-this.convertPointToPixel(e[0]),Y:this.convertPointToPixel(e[1])},a={X:i-this.convertPointToPixel(e[2]),Y:this.convertPointToPixel(e[3])}):3===n&&(s={X:i-this.convertPointToPixel(e[1]),Y:t-this.convertPointToPixel(e[0])},a={X:i-this.convertPointToPixel(e[3]),Y:t-this.convertPointToPixel(e[2])}),r.push(s),r.push(a),r},hVt.prototype.loadEllipseAnnotation=function(e,t,i,n,o){var r=new gVt;r.ShapeAnnotationType="Circle",r.Author=e.author,r.AnnotName=e.name,r.Subject=e.subject,je(e.modifiedDate)?r.ModifiedDate=this.formatDate(new Date):r.ModifiedDate=this.formatDate(e.modifiedDate),r.Note=this.getValidNoteContent(e.text),r.Thickness=e.border.width,r.BorderStyle=this.getBorderStylesString(e.border.style),r.BorderDashArray=e.border.dash&&e.border.dash[0]||0,r.Opacity=e.opacity,r.RotateAngle=this.getRotateAngleString(e.rotate),r.AnnotType="shape";for(var s=0;s<e.reviewHistory.count;s++)r.State=this.getStateString(e.reviewHistory.at(parseInt(s.toString(),10)).state),r.StateModel=this.getStateModelString(e.reviewHistory.at(parseInt(s.toString(),10)).stateModel);(je(r.State)||je(r.StateModel))&&(r.State="Unmarked",r.StateModel="None"),r.Comments=new Array;for(s=0;s<e.comments.count;s++){var a=this.loadPopupAnnotation(e.comments.at(s),t,i,n);r.Comments.push(a)}r.Bounds=this.getBounds(e.bounds,t,i,n),r.LineHeadStart="None",r.LineHeadEnd="None",!je(e._borderEffect)&&e._borderEffect.style===IAt.cloudy?(r.IsCloudShape=!0,r.CloudIntensity=e._borderEffect.intensity):(r.IsCloudShape=!1,r.CloudIntensity=0),e._dictionary.has("RD")&&!je(e._dictionary.get("RD"))?r.RectangleDifference=e._dictionary.get("RD"):r.RectangleDifference=new Array,this.updateIsLockProperty(r,e),e._dictionary.has("AllowedInteractions")&&(h=e.getValues("AllowedInteractions")[0],r.AllowedInteractions=JSON.parse(h)),r.StrokeColor="rgba("+e.color[0]+","+e.color[1]+","+e.color[2]+","+(e.color[3]||1)+")";var l,h=e.color[3]||1;return e._dictionary.has("FillOpacity")&&!je(e._dictionary.get("FillOpacity"))&&(h=parseInt(e._dictionary.get("FillOpacity").toString(),10)),h=e.innerColor?h:0,e.innerColor=e.innerColor||[255,255,255],r.FillColor="rgba("+e.innerColor[0]+","+e.innerColor[1]+","+e.innerColor[2]+","+h+")",r.EnableShapeLabel=!1,null!=o&&(r.EnableShapeLabel=!0,r.LabelContent=o.text,r.LabelFillColor="rgba("+o.color[0]+","+o.color[1]+","+o.color[2]+","+(o.color[3]||1)+")",r.FontColor="rgba("+o.textMarkUpColor[0]+","+o.textMarkUpColor[1]+","+o.textMarkUpColor[2]+","+(o.textMarkUpColor[3]||1)+")",r.LabelBorderColor="rgba("+o.borderColor[0]+","+o.borderColor[1]+","+o.borderColor[2]+","+(o.borderColor[3]||1)+")",r.FontSize=o.font.size),e._dictionary.has("CustomData")&&!je(e._dictionary.get("CustomData"))&&null!=(l=e._dictionary.get("CustomData"))&&(r.ExistingCustomData=l),e._dictionary.has("Measure")?(r.FillColor="rgba("+e.innerColor[0]+","+e.innerColor[1]+","+e.innerColor[2]+","+h+")",(o=new mVt(r)).Calibrate=this.getMeasureObject(e),e._dictionary.has("IT")?o.Indent=e._dictionary.get("IT"):o.Indent="PolyLineDimension",o.Caption=!1,o.LeaderLength=0,o.LeaderLineExtension=0,o.LeaderLineOffset=0,o.CaptionPosition="",e.flags===bAt.readOnly?o.IsCommentLock=!0:o.IsCommentLock=!1,e.flags===bAt.print&&(o.IsPrint=!0),e._dictionary.has("CustomData")&&!je(e._dictionary.get("CustomData"))&&null!=(l=e._dictionary.get("CustomData"))&&(o.ExistingCustomData=l),o):r},hVt.prototype.loadPolygonAnnotation=function(e,t,i,n,o){var r=new gVt;r.ShapeAnnotationType="Polygon",r.Author=e.author,r.AnnotName=e.name,r.Subject=e.subject,je(e.modifiedDate)?r.ModifiedDate=this.formatDate(new Date):r.ModifiedDate=this.formatDate(e.modifiedDate),r.Note=this.getValidNoteContent(e.text),r.Thickness=e.border.width,r.BorderStyle=this.getBorderStylesString(e.border.style),r.BorderDashArray=e.border.dash&&e.border.dash[0]||0,r.Opacity=e.opacity,r.RotateAngle=this.getRotateAngleString(e.rotate),r.AnnotType="shape";for(var s=0;s<e.reviewHistory.count;s++)r.State=this.getStateString(e.reviewHistory.at(parseInt(s.toString(),10)).state),r.StateModel=this.getStateModelString(e.reviewHistory.at(parseInt(s.toString(),10)).stateModel);(je(r.State)||je(r.StateModel))&&(r.State="Unmarked",r.StateModel="None"),r.Comments=new Array;for(s=0;s<e.comments.count;s++){var a=this.loadPopupAnnotation(e.comments.at(s),t,i,n);r.Comments.push(a)}r.Bounds=this.getBounds(e.bounds,t,i,n),je(e._dictionary.get("Vertices"))||(r.VertexPoints=this.getVertexPoints(e._dictionary.get("Vertices"),i,t,n,e._page)),je(r.VertexPoints)||r.VertexPoints[0]===r.VertexPoints[r.VertexPoints.length-1]||r.VertexPoints.push(r.VertexPoints[0]),r.StrokeColor="rgba("+e.color[0]+","+e.color[1]+","+e.color[2]+","+(e.color[3]||1)+")";var l,h=e.color[3]||1;return e._dictionary.has("FillOpacity")&&!je(e._dictionary.get("FillOpacity"))&&(h=parseInt(e._dictionary.get("FillOpacity").toString(),10)),h=e.innerColor?h:0,e.innerColor=e.innerColor||[255,255,255],r.FillColor="rgba("+e.innerColor[0]+","+e.innerColor[1]+","+e.innerColor[2]+","+h+")",r.LineHeadStart="None",r.LineHeadEnd="None",r.EnableShapeLabel=!1,null!=o&&(r.EnableShapeLabel=!0,r.LabelContent=o.text,r.LabelFillColor="rgba("+o.color[0]+","+o.color[1]+","+o.color[2]+","+(o.color[3]||1)+")",r.FontColor="rgba("+o.textMarkUpColor[0]+","+o.textMarkUpColor[1]+","+o.textMarkUpColor[2]+","+(o.textMarkUpColor[3]||1)+")",r.LabelBorderColor="rgba("+o.borderColor[0]+","+o.borderColor[1]+","+o.borderColor[2]+","+(o.borderColor[3]||1)+")",r.FontSize=o.font.size),!je(e.borderEffect)&&e.borderEffect.style===IAt.cloudy?(r.IsCloudShape=!0,r.CloudIntensity=e.borderEffect.intensity):(r.IsCloudShape=!1,r.CloudIntensity=0),e._dictionary.has("RD")&&!je(e._dictionary.get("RD"))?r.RectangleDifference=e._dictionary.get("RD"):r.RectangleDifference=new Array,this.updateIsLockProperty(r,e),e._dictionary.has("CustomData")&&!je(e._dictionary.get("CustomData"))&&null!=(l=e._dictionary.get("CustomData"))&&(r.ExistingCustomData=l),e._dictionary.has("AllowedInteractions")&&(h=e.getValues("AllowedInteractions")[0],r.AllowedInteractions=JSON.parse(h)),!e._dictionary.has("Measure")||(o=new mVt(r),e._dictionary.has("IT")&&!je(e._dictionary.get("IT"))?o.Indent=e._dictionary.get("IT").name:o.Indent="PolygonDimension",o.Calibrate=this.getMeasureObject(e),je(o.Calibrate))?r:("PolygonVolume"===o.Indent&&e._dictionary.has("Depth")&&!je(e._dictionary.get("Depth"))&&(o.Calibrate.Depth=e._dictionary.get("Depth")),o.Caption=!1,o.LeaderLength=0,o.LeaderLineExtension=0,o.LeaderLineOffset=0,o.CaptionPosition="",e.flags===bAt.readOnly?o.IsCommentLock=!0:o.IsCommentLock=!1,e.flags===bAt.print&&(o.IsPrint=!0),!e._dictionary.has("CustomData")||je(e._dictionary.get("CustomData"))||je(l=e._dictionary.get("CustomData"))||(o.ExistingCustomData=l),o)},hVt.prototype.loadPolylineAnnotation=function(e,t,i,n,o){var r=new gVt;if(r.ShapeAnnotationType="Polyline",r.Author=e.author,r.AnnotName=e.name,r.Subject=e.subject,je(e.modifiedDate)?r.ModifiedDate=this.formatDate(new Date):r.ModifiedDate=this.formatDate(e.modifiedDate),r.Note=this.getValidNoteContent(e.text),r.Thickness=e.border.width,r.BorderStyle=this.getBorderStylesString(e.border.style),r.BorderDashArray=e.border.dash&&e.border.dash[0]||0,r.Opacity=e.opacity,r.RotateAngle=this.getRotateAngleString(e.rotate),r.AnnotType="shape",!je(e.reviewHistory))for(var s=0;s<e.reviewHistory.count;s++)r.State=this.getStateString(e.reviewHistory.at(parseInt(s.toString(),10)).state),r.StateModel=this.getStateModelString(e.reviewHistory.at(parseInt(s.toString(),10)).stateModel);if((je(r.State)||je(r.StateModel))&&(r.State="Unmarked",r.StateModel="None"),r.Comments=new Array,!je(e.comments))for(s=0;s<e.comments.count;s++){var a=this.loadPopupAnnotation(e.comments.at(s),t,i,n);r.Comments.push(a)}r.Bounds=this.getBounds(e.bounds,t,i,n),je(e._dictionary.get("Vertices"))||(r.VertexPoints=this.getVertexPoints(e._dictionary.get("Vertices"),i,t,n,e._page)),r.StrokeColor="rgba("+e.color[0]+","+e.color[1]+","+e.color[2]+","+(e.color[3]||1)+")";var l,h=e.color[3]||1;return e._dictionary.has("FillOpacity")&&!je(e._dictionary.get("FillOpacity"))&&(h=parseInt(e._dictionary.get("FillOpacity").toString(),10)),h=e.innerColor?h:0,e.innerColor=e.innerColor||[255,255,255],r.FillColor="rgba("+e.innerColor[0]+","+e.innerColor[1]+","+e.innerColor[2]+","+h+")",r.LineHeadStart=this.getLineEndingStyleString(e.beginLineStyle),r.LineHeadEnd=this.getLineEndingStyleString(e.endLineStyle),r.EnableShapeLabel=!1,null!=o&&(r.EnableShapeLabel=!0,r.LabelContent=o.text,r.LabelFillColor="rgba("+o.color[0]+","+o.color[1]+","+o.color[2]+","+(o.color[3]||1)+")",r.FontColor="rgba("+o.textMarkUpColor[0]+","+o.textMarkUpColor[1]+","+o.textMarkUpColor[2]+","+(o.textMarkUpColor[3]||1)+")",r.LabelBorderColor="rgba("+o.borderColor[0]+","+o.borderColor[1]+","+o.borderColor[2]+","+(o.borderColor[3]||1)+")",r.FontSize=o.font.size),!je(e._borderEffect)&&e._borderEffect.style===IAt.cloudy?(r.IsCloudShape=!0,r.CloudIntensity=e._borderEffect.intensity):(r.IsCloudShape=!1,r.CloudIntensity=0),e._dictionary.has("RD")&&!je(e._dictionary.get("RD"))?r.RectangleDifference=e._dictionary.get("RD"):r.RectangleDifference=new Array,this.updateIsLockProperty(r,e),e._dictionary.has("CustomData")&&!je(e._dictionary.get("CustomData"))&&null!=(l=e._dictionary.get("CustomData"))&&(r.ExistingCustomData=l),e._dictionary.has("AllowedInteractions")&&(o=e.getValues("AllowedInteractions")[0],r.AllowedInteractions=JSON.parse(o)),e._dictionary.has("Measure")?(r.FillColor="rgba("+e.innerColor[0]+","+e.innerColor[1]+","+e.innerColor[2]+","+h+")",(o=new mVt(r)).Calibrate=this.getMeasureObject(e),e._dictionary.has("IT")?o.Indent=e._dictionary.get("IT").name:o.Indent="PolyLineDimension",o.Caption=!1,o.LeaderLength=0,o.LeaderLineExtension=0,o.LeaderLineOffset=0,o.CaptionPosition="",e.flags===bAt.readOnly?o.IsCommentLock=!0:o.IsCommentLock=!1,e.flags===bAt.print&&(o.IsPrint=!0),e._dictionary.has("CustomData")&&!je(e._dictionary.get("CustomData"))&&null!=(l=e._dictionary.get("CustomData"))&&(o.ExistingCustomData=l),o):r},hVt.prototype.loadSignatureImage=function(e,t){var i,n=e,o=new fVt,r=(o.SignatureName=n.name,e._dictionary.get("AP"));return null!==(r=null===r&&null!==(i=e._dictionary.get("AP"))&&null!==i.Object?i.Object:r)&&r.has("N")&&this.m_renderer.findStampImage(e),o.Bounds=new dvt(n.bounds.x,n.bounds.y,n.bounds.width,n.bounds.height),o.PathData=this.m_renderer.imageData,o.AnnotationType="SignatureImage",o.PageNumber=t,o.Opacity=n.opacity,o.StrokeColor="rgba("+n.color+","+n.color[1]+","+n.color[2]+","+(n.color[3]||1)+")",o},hVt.prototype.getMeasureObject=function(e){var t,i,n,o,r,s,a=new yVt;return(t=e._dictionary.has("Measure")?e._dictionary.get("Measure"):t).has("R")?(a.Ratio=t.get("R"),t.has("X")&&(i=this.getMeasureValues(t.getArray("X"))),a.X=i,t.has("D")&&(n=this.getMeasureValues(t.getArray("D"))),a.Distance=n,t.has("A")&&(o=this.getMeasureValues(t.getArray("A"))),a.Area=o,t.has("T")&&(r=this.getMeasureValues(t.getArray("T"))),a.Angle=r,t.has("V")&&(s=this.getMeasureValues(t.getArray("V"))),a.Volume=s,!je(t)&&t.has("TargetUnitConversion")?a.TargetUnitConversion=t.get("TargetUnitConversion").FloatValue:a.TargetUnitConversion=0,a):null},hVt.prototype.getMeasureValues=function(e){var t=new Array;if(!je(e))for(var i=0;i<e.length;i++){var n,o=e[parseInt(i.toString(),10)],r=new vVt;je(o)||(o.has("D")&&!je(o.get("D"))&&(r.Denominator=o.get("D")),o.has("C")&&!je(o.get("C"))&&(r.ConversionFactor=o.get("C")),o.has("F")&&!je(o.get("F"))?"object"!=typeof(n=o.get("F"))||je(n.name)||(r.FractionalType=n.name):r.FractionalType="D",o.has("FD")&&!je(o.get("FD"))&&(r.FormatDenominator=o.get("FD")),o.has("U")&&!je(o.get("U"))&&(r.Unit=o.get("U"))),t.push(r)}return t},hVt.prototype.getVertexPoints=function(e,t,i,n,o){var r=[],s=this.getBothCropBoxValue(o),a=0,l=0;if(0===s[0]&&o.cropBox[2]===o.size[2]&&s[1]===o.size[3]||(a=s[0],l=s[1]),0===n)for(var h=0;h<e.length;h++){var d={X:this.convertPointToPixel(e[parseInt(h.toString(),10)])-this.convertPointToPixel(a),Y:i-this.convertPointToPixel(e[h+1])+this.convertPointToPixel(l)};h+=1,r.push(d)}else if(1===n)for(h=0;h<e.length;h++){d={X:this.convertPointToPixel(e[h+1]),Y:this.convertPointToPixel(e[parseInt(h.toString(),10)])};h+=1,r.push(d)}else if(2===n)for(h=0;h<e.length;h++){d={X:t-this.convertPointToPixel(e[parseInt(h.toString(),10)]),Y:this.convertPointToPixel(e[h+1])};h+=1,r.push(d)}else if(3===n)for(h=0;h<e.length;h++){d={X:t-this.convertPointToPixel(e[h+1]),Y:i-this.convertPointToPixel(e[parseInt(h.toString(),10)])};h+=1,r.push(d)}return r},hVt.prototype.getLineIndentString=function(e){switch(e){case CAt.lineArrow:return"LineArrow";case CAt.lineDimension:return"LineDimension"}},hVt.prototype.getLineEndingStyleString=function(e){switch(e){case wAt.none:return"None";case wAt.butt:return"Butt";case wAt.circle:return"Circle";case wAt.closedArrow:return"ClosedArrow";case wAt.diamond:return"Diamond";case wAt.openArrow:return"OpenArrow";case wAt.rClosedArrow:return"RClosedArrow";case wAt.rOpenArrow:return"ROpenArrow";case wAt.slash:return"Slash";case wAt.square:return"Square"}},hVt.prototype.getBorderStylesString=function(e){switch(e){case xAt.solid:return"Solid";case xAt.dashed:return"Dashed";case xAt.beveled:return"Beveled";case xAt.inset:return"Inset";case xAt.underline:return"Underline";case xAt.dot:return"Dot";default:return"None"}},hVt.prototype.getBorderStyle=function(e){var t=xAt.solid;switch(e){case"Solid":t=xAt.solid;break;case"Dashed":t=xAt.dashed;break;case"Beveled":t=xAt.beveled;break;case"Inset":t=xAt.inset;break;case"Underline":t=xAt.underline;break;case"Dot":t=xAt.dot}return t},hVt.prototype.getRotateAngleString=function(e){switch(e){case TAt.angle0:return"RotateAngle0";case TAt.angle90:return"RotateAngle90";case TAt.angle180:return"RotateAngle180";case TAt.angle270:return"RotateAngle270";default:return"RotateAngle0"}},hVt.prototype.getValidNoteContent=function(e){return je(e)||""===e||" "===e?"":e},hVt.prototype.getBounds=function(e,t,i,n){var o;return 0===n?o=new SVt(this.convertPointToPixel(e.x),this.convertPointToPixel(e.y),this.convertPointToPixel(e.width),this.convertPointToPixel(e.height)):1===n?o=new SVt(i-this.convertPointToPixel(e.y)-this.convertPointToPixel(e.height),this.convertPointToPixel(e.x),this.convertPointToPixel(e.height),this.convertPointToPixel(e.width)):2===n?o=new SVt(i-this.convertPointToPixel(e.x)-this.convertPointToPixel(e.width),t-this.convertPointToPixel(e.y)-this.convertPointToPixel(e.height),this.convertPointToPixel(e.width),this.convertPointToPixel(e.height)):3===n&&(o=new SVt(this.convertPointToPixel(e.y),t-this.convertPointToPixel(e.x)-this.convertPointToPixel(e.width),this.convertPointToPixel(e.height),this.convertPointToPixel(e.width))),o},hVt.prototype.loadPopupAnnotation=function(e,t,i,n){var o=new bVt;o.Author=e.author,o.Subject=e.subject,!e._dictionary.has("Subtype")||je(e._dictionary.get("Subtype"))||je(e._dictionary.get("Subtype").name)||(o.SubType=e._dictionary.get("Subtype").name.toString()),!e._dictionary.has("Type")||je(e._dictionary.get("Type"))||je(e._dictionary.get("Type").name)||(o.Type=e._dictionary.get("Type").name.toString()),e._dictionary.has("IRT")&&!je(e._dictionary.get("IRT"))&&null!=(r=e._dictionary.get("IRT"))&&(o.Reference=r.Reference),o.AnnotName=e.name,je(e.modifiedDate)?o.ModifiedDate=this.formatDate(new Date):o.ModifiedDate=this.formatDate(e.modifiedDate),o.Note=e.text,this.updateIsLockProperty(o,e),o.Icon=this.getPopupIconString(e.icon),o.State=this.getStateString(e.state),o.StateModel=this.getStateModelString(e.stateModel),o.Size=new iVt(e.bounds.width,e.bounds.height),e.color=e.color||[0,0,0],o.Color=new AVt(e.color[0],e.color[1],e.color[2]),o.Opacity=e.opacity,o.AnnotType="sticky",o.StrokeColor="rgba("+o.Color.R+","+o.Color.G+","+o.Color.B+",1)",o.Bounds=this.getBounds(e.bounds,t,i,n);for(var r,s=0;s<e.reviewHistory.count;s++)o.State=this.getStateString(e.reviewHistory.at(parseInt(s.toString(),10)).state),o.StateModel=this.getStateModelString(e.reviewHistory.at(parseInt(s.toString(),10)).stateModel);(je(o.State)||"None"===o.State||je(o.StateModel))&&(o.State="Unmarked",o.StateModel="None"),o.Comments=new Array,e._dictionary.has("CustomData")&&!je(e._dictionary.get("CustomData"))&&null!=(r=e._dictionary.get("CustomData"))&&(o.ExistingCustomData=r);for(s=0;s<e.comments.count;s++)o.Comments.push(this.loadPopupAnnotation(e.comments.at(s),t,i,n));return o},hVt.prototype.loadFreeTextAnnotation=function(e,t,i,n,o){var r=new cVt,s=(r.AnnotationIntent=this.getAnnotationIntentString(e.annotationIntent),r.AnnotationFlags=this.getAnnotationFlagsString(e.flags),r.Author=e.author,r.AnnotName=e.name,!je(r.AnnotName)&&""!==r.AnnotName||(r.AnnotName=Math.abs(Math.random()).toString(36).substring(2)),r.AnnotType="Text Box",r.FreeTextAnnotationType="Text Box",r.BorderColor=new AVt(e.borderColor[0],e.borderColor[1],e.borderColor[2]),r.CalloutLines=[{X:100,Y:400},{X:200,Y:400}],e.color||[0,0,0]);je(e.color)&&(r.IsTransparentSet=!0),r.Color=new AVt(s[0],s[1],s[2]),r.Flatten=e.flatten,r.FlattenPopups=!je(e.flattenPopups)&&e.flattenPopups,r.FontFamily=this.getFontFamilyString(e.font._fontFamily),r.FontSize=this.convertPointToPixel(e.font.size),r.Font=new xVt(e.font,r.FontFamily),r.Thickness=e.border.width,r.StrokeColor="rgba("+e.borderColor[0]+","+e.borderColor[1]+","+e.borderColor[2]+","+(e.borderColor[3]||1)+")",e._dictionary.has("FillOpacity")&&!je(e._dictionary.get("FillOpacity"))&&(l=parseInt(e._dictionary.get("FillOpacity").toString(),10)),l=e.color?je(l)?1:l:0,r.FillColor="rgba("+s[0]+","+s[1]+","+s[2]+","+l+")",r.Layer=e._dictionary.has("Layer")?e._dictionary.get("Layer"):null,r.Location=e._dictionary.has("Location")?e._dictionary.get("Location"):"{X="+e.bounds.x+",Y="+e.bounds.y+"}",r.MarkupText=e.text,je(e.modifiedDate)?r.ModifiedDate=this.formatDate(new Date):r.ModifiedDate=this.formatDate(e.modifiedDate),r.Name="freeText",r.Opacity=e.opacity,e._dictionary.has("Rotation")&&!je(e._dictionary.get("Rotation"))&&(r.Rotate=parseInt(e._dictionary.get("Rotation"),10)),e._dictionary.has("Rotate")&&!je(e._dictionary.get("Rotate"))&&(r.Rotate=parseInt(e._dictionary.get("Rotate"),10)),je(e.subject)?r.Subject="Text Box":r.Subject=e.subject,r.Text=e.text,r.MarkupText=e.text,r.TextAlign=this.getTextAlignmentString(e.textAlignment),(je(r.State)||"None"===r.State||je(r.StateModel))&&(r.State="Unmarked",r.StateModel="None"),r.FontColor=je(e.textMarkUpColor)?"rgba(0, 0, 0, 1)":"rgba("+e.textMarkUpColor[0]+","+e.textMarkUpColor[1]+","+e.textMarkUpColor[2]+","+(e.textMarkUpColor[3]||1)+")";for(var a=0;a<e.reviewHistory.count;a++)r.State=this.getStateString(e.reviewHistory.at(parseInt(a.toString(),10)).state),r.StateModel=this.getStateModelString(e.reviewHistory.at(parseInt(a.toString(),10)).stateModel);r.Comments=new Array;for(var l,a=0;a<e.comments.count;a++){var h=this.loadPopupAnnotation(e.comments.at(a),t,i,n);r.Comments.push(h)}return r.Bounds=this.getBounds(e.bounds,t,i,n),r.Bounds.Y<0&&(s={x:e.bounds.x,y:o.cropBox[1]+e.bounds.y,width:e.bounds.width,height:e.bounds.height},r.Bounds=this.getBounds(s,t,i,n)),r.PageRotation=n,this.updateIsLockProperty(r,e),e._dictionary.has("CustomData")&&!je(e._dictionary.get("CustomData"))&&null!=(l=e._dictionary.get("CustomData"))&&(r.ExistingCustomData=l),e._dictionary.has("AllowedInteractions")&&(o=e.getValues("AllowedInteractions")[0],r.AllowedInteractions=JSON.parse(o)),r},hVt.prototype.getTextAlignmentString=function(e){switch(e){case MAt.left:return"Left";case MAt.right:return"Right";case MAt.center:return"Center";case MAt.justify:return"Justify";default:return"Left"}},hVt.prototype.loadSignatureText=function(e,t,i,n,o){var r=new fVt;return r.SignatureName=e.name,r.Bounds=this.getBounds(e.bounds,n,i,o),r.AnnotationType="SignatureText",r.FontFamily=this.getFontFamilyString(e.font._fontFamily),r.FontSize=this.convertPointToPixel(e.font.size),r.PathData=e.text,r.PageNumber=t,r.StrokeColor="rgba("+e.textMarkUpColor[0]+","+e.textMarkUpColor[1]+","+e.textMarkUpColor[2]+","+(e.textMarkUpColor[3]||1)+")",r.Opacity=e.opacity,r.Thickness=1,r},hVt.prototype.getFontFamilyString=function(e){switch(e){case Zxt.helvetica:return"Helvetica";case Zxt.timesRoman:return"Times New Roman";case Zxt.courier:return"Courier";case Zxt.symbol:return"Symbol";case Zxt.zapfDingbats:return"ZapfDingbats";default:return"Helvetica"}},hVt.prototype.getAnnotationFlagsString=function(e){switch(e){case bAt.default:return"Default";case bAt.invisible:return"Invisible";case bAt.hidden:return"Hidden";case bAt.print:return"Print";case bAt.noZoom:return"NoZoom";case bAt.noRotate:return"NoRotate";case bAt.noView:return"NoView";case bAt.readOnly:return"ReadOnly";case bAt.locked:return"Locked";case bAt.toggleNoView:return"ToggleNoView";default:return"Default"}},hVt.prototype.getAnnotationIntentString=function(e){switch(e){case HAt.freeTextCallout:return"FreeTextCallout";case HAt.freeTextTypeWriter:return"FreeTextTypeWriter";case HAt.none:return"None"}},hVt.prototype.getStateString=function(e){switch(e){case NAt.accepted:return"Accepted";case NAt.rejected:return"Rejected";case NAt.cancel:return"Cancelled";case NAt.completed:return"Completed";case NAt.none:return"None";case NAt.unmarked:return"Unmarked";case NAt.marked:return"Marked";case NAt.unknown:return"Unknown";default:return null}},hVt.prototype.getStateModelString=function(e){switch(e){case VAt.review:return"Review";case VAt.marked:return"Marked";default:VAt.none;return"None"}},hVt.prototype.getPopupIconString=function(e){switch(e){case OAt.comment:return"Comment";case OAt.help:return"Help";case OAt.insert:return"Insert";case OAt.key:return"Key";case OAt.newParagraph:return"NewParagraph";case OAt.note:return"Note";case OAt.paragraph:return"Paragraph";default:return null}},hVt.prototype.formatDate=function(e){return this.datePadding(e.getMonth()+1)+"/"+this.datePadding(e.getDate())+"/"+e.getFullYear()+" "+this.datePadding(e.getHours())+":"+this.datePadding(e.getMinutes())+":"+this.datePadding(e.getSeconds())},hVt.prototype.datePadding=function(e){return e<10?"0"+e:e.toString()},hVt.prototype.removeSignatureTypeAnnot=function(e,t){if(Object.prototype.hasOwnProperty.call(e,"isAnnotationsExist")&&JSON.parse(e.isAnnotationsExist)||Object.prototype.hasOwnProperty.call(e,"isFormFieldAnnotationsExist")&&JSON.parse(e.isFormFieldAnnotationsExist)){var i=e.annotationsPageList||[],e=e.formFieldsPageList||"[]";if(0!==i.length)for(var n=JSON.parse(i),o=0;o<n.length;o++)for(var r=n[parseInt(o.toString(),10)],s=t.getPage(parseInt(r,10)).annotations,a=parseInt(s.count.toString(),10)-1;0<=a;a--)((l=s.at(a))instanceof VEt||l instanceof iEt||l instanceof BTt||l instanceof BEt||l instanceof TEt||l instanceof rEt||l instanceof zTt||l instanceof RTt||l instanceof VTt||l instanceof GTt||l instanceof QTt||l instanceof KTt)&&s.remove(l);if(0!==e.length)for(n=JSON.parse(e),o=0;o<n.length;o++)for(var l,r=n[parseInt(o.toString(),10)],s=t.getPage(parseInt(r,10)-1).annotations,a=parseInt(s.count.toString(),10)-1;0<=a;a--)((l=s.at(a))instanceof VEt||l instanceof iEt||l instanceof BTt||l instanceof BEt||l instanceof TEt||l instanceof rEt||l instanceof zTt||l instanceof RTt||l instanceof VTt||l instanceof GTt||l instanceof QTt||l instanceof KTt)&&s.remove(l)}},hVt.prototype.updateIsLockProperty=function(e,t){t=gMt(t.flags);!je(t)&&t.includes("locked")?e.IsLocked=!0:e.IsLocked=!1,!je(t)&&t.includes("readOnly")?e.IsCommentLock=!0:e.IsCommentLock=!1,!je(t)&&t.includes("print")&&(e.IsPrint=!0)},hVt.prototype.loadTextMarkupAnnotation=function(e,t,i,n,o){var r=new wVt,s=(r.TextMarkupAnnotationType=this.getMarkupAnnotTypeString(e.textMarkupType),"StrikeOut"===r.TextMarkupAnnotationType&&(r.TextMarkupAnnotationType="Strikethrough"),r.Author=e.author,r.Subject=e.subject,r.AnnotName=e.name,r.Note=e.text||"",r.Rect=new EVt(e.bounds.x,e.bounds.y,e.bounds.width+e.bounds.x,e.bounds.height+e.bounds.y),r.Opacity=e.opacity,r.Color="#"+(1<<24|e.color[0]<<16|e.color[1]<<8|e.color[2]).toString(16).slice(1),je(e.modifiedDate)?r.ModifiedDate=this.formatDate(new Date):r.ModifiedDate=this.formatDate(e.modifiedDate),r.AnnotationRotation=e.rotationAngle,e._dictionary.has("QuadPoints")?e._dictionary.get("QuadPoints"):[]),a=[];if(0===n)for(var l=0;l<e.boundsCollection.length;l++){var h=e.boundsCollection[parseInt(l.toString(),10)],d=h[0],p=h[1],c=h[2],h=h[3];a.push(this.getBounds({x:d,y:p,width:c,height:h},h,c,n))}else a=this.getTextMarkupBounds(s,t,i,n,o);r.Bounds=a,r.AnnotType="textMarkup";for(l=0;l<e.reviewHistory.count;l++)r.State=this.getStateString(e.reviewHistory.at(parseInt(l.toString(),10)).state),r.StateModel=this.getStateModelString(e.reviewHistory.at(parseInt(l.toString(),10)).stateModel);(je(r.State)||je(r.StateModel))&&(r.State="Unmarked",r.StateModel="None"),r.Comments=new Array;for(l=0;l<e.comments.count;l++){var u=this.loadPopupAnnotation(e.comments.at(l),t,i,n);r.Comments.push(u)}return this.updateIsLockProperty(r,e),e._dictionary.has("CustomData")&&!je(e._dictionary.get("CustomData"))&&null!=(s=e._dictionary.get("CustomData"))&&(r.ExistingCustomData=s),e._dictionary.has("AllowedInteractions")&&(o=e.getValues("AllowedInteractions")[0],r.AllowedInteractions=JSON.parse(o)),e._dictionary.has("TextMarkupContent")&&!je(s=e.getValues("TextMarkupContent"))&&(r.TextMarkupContent=s[0]),r},hVt.prototype.getTextMarkupBounds=function(e,t,i,n,o){var r=0,s=0,a=0,l=0,h=[],o=this.getCropBoxValue(o,!1),d=0,p=0;if(0!==o.x&&0!==o.y&&(d=o.x,p=o.y),!je(e))for(var c=0;c<e.length;c++){var a=0===n?(r=this.convertPointToPixel(parseInt(e[parseInt(c.toString(),10)],10)-d),s=t-this.convertPointToPixel(parseInt(e[c+1],10)+p),l=this.convertPointToPixel(parseInt(e[c+3],10)-parseInt(e[c+7],10)),this.convertPointToPixel(parseInt(e[c+6],10)-parseInt(e[c+4],10))):1===n?(r=this.convertPointToPixel(parseInt(e[c+5],10)),s=this.convertPointToPixel(parseInt(e[parseInt(c.toString(),10)],10)),l=this.convertPointToPixel(parseInt(e[c+6],10)-parseInt(e[c+4],10)),this.convertPointToPixel(parseInt(e[c+3],10)-parseInt(e[c+7],10))):2===n?(r=i-this.convertPointToPixel(parseInt(e[c+2],10)),s=this.convertPointToPixel(parseInt(e[c+5],10)),l=this.convertPointToPixel(parseInt(e[c+3],10)-parseInt(e[c+7],10)),this.convertPointToPixel(parseInt(e[c+6],10)-parseInt(e[c+4],10))):(r=i-this.convertPointToPixel(parseInt(e[c+1],10)),s=t-this.convertPointToPixel(parseInt(e[c+6],10)),l=this.convertPointToPixel(parseInt(e[c+6],10)-parseInt(e[c+4],10)),this.convertPointToPixel(parseInt(e[c+3],10)-parseInt(e[c+7],10))),u=new SVt(r,s,a,l);c+=7,h.push(u)}return h},hVt.prototype.getMarkupAnnotTypeString=function(e){var t="";switch(e){case RAt.highlight:t="Highlight";break;case RAt.strikeOut:t="StrikeOut";break;case RAt.underline:t="Underline";break;case RAt.squiggly:t="Squiggly"}return t},hVt);function hVt(e,t){this.formats=["M/d/yyyy h:mm:ss tt","M/d/yyyy, h:mm:ss tt","M/d/yyyy h:mm tt","MM/dd/yyyy hh:mm:ss","M/d/yyyy h:mm:ss","M/d/yyyy hh:mm tt","M/d/yyyy hh tt","M/d/yyyy h:mm","M/d/yyyy h:mm","MM/dd/yyyy hh:mm","M/dd/yyyy hh:mm","dd/M/yyyy h:mm:ss tt","dd/M/yyyy, h:mm:ss tt","M/d/yy, h:mm:ss tt","yyyy/MM/dd, h:mm:ss tt","dd/MMM/yy, h:mm:ss tt","yyyy-MM-dd, h:mm:ss tt","dd-MMM-yy, h:mm:ss tt","MM-dd-yy, h:mm:ss tt","YYYY-MM-DDTHH:mm:ss.sssZ","±YYYYYY-MM-DDTHH:mm:ss.sssZ","yyyy-MM-ddTHH:mm:ss.fffZ"],this.pdfViewer=e,this.pdfViewerBase=t}function dVt(e,t){this.x=e,this.y=t}function pVt(){}var cVt=function(){this.AnnotationSelectorSettings=null,this.TextMarkupColor=null,this.Color=null,this.Font=null,this.Border=null,this.LineEndingStyle=null,this.AnnotationFlags=null,this.CalloutLines=null,this.ModifiedDate=null,this.Comments=null,this.CreatedDate=null,this.InnerColor=null,this.Layer=null,this.Page=null,this.PageTags=null,this.ReviewHistory=null,this.Rotate=0,this.Note=null,this.CustomData=null,this.AnnotationSettings=null,this.IsPrint=!0,this.IsReadonly=!1,this.ExistingCustomData=null,this.Bounds=null,this.PageRotation=0,this.IsTransparentSet=!1},uVt=function(){this.AnnotationType=null,this.Bounds=null,this.CustomData=null,this.Opacity=0,this.StrokeColor=null,this.Thickness=null,this.PathData=null,this.IsLocked=null,this.IsCommentLock=null,this.PageNumber=null,this.AnnotName=null,this.Author=null,this.ModifiedDate=null,this.Subject=null,this.Note=null,this.State=null,this.StateModel=null,this.AnnotationSelectorSettings=null,this.AnnotationSettings=null,this.AllowedInteractions=null,this.Comments=null,this.AnnotType=null,this.IsPrint=null,this.ExistingCustomData=null},gVt=function(){this.LabelBounds=new SVt(0,0,0,0),this.LabelContent=null,this.LabelFillColor=null,this.LabelBorderColor=null,this.LabelSettings=null,this.FontColor=null,this.FontSize=0,this.AnnotationSettings=null,this.AnnotationSelectorSettings=null,this.VertexPoints=null,this.CustomData=null,this.ExistingCustomData=null,this.IsPrint=!0,this.AllowedInteractions=null,this.AnnotationRotation=0},mVt=function(e){this.LabelBounds=new SVt(0,0,0,0),this.LabelContent=null,this.LabelFillColor=null,this.LabelBorderColor=null,this.LabelSettings=null,this.FontColor=null,this.FontSize=0,this.AnnotationSettings=null,this.AnnotationSelectorSettings=null,this.VertexPoints=null,this.CustomData=null,this.ExistingCustomData=null,this.IsPrint=!0,this.AllowedInteractions=null,this.AnnotationRotation=0,this.Author=e.Author,this.AnnotationSelectorSettings=e.AnnotationSelectorSettings,this.BorderDashArray=e.BorderDashArray,this.BorderStyle=e.BorderStyle,this.Bounds=e.Bounds,this.CloudIntensity=e.CloudIntensity,this.FillColor=e.FillColor,this.IsCloudShape=e.IsCloudShape,this.IsLocked=e.IsLocked,this.LineHeadEnd=e.LineHeadEnd,this.LineHeadStart=e.LineHeadStart,this.ModifiedDate=e.ModifiedDate,this.Note=e.Note,this.Opacity=e.Opacity,this.RectangleDifference=e.RectangleDifference,this.RotateAngle=e.RotateAngle,this.ShapeAnnotationType=e.ShapeAnnotationType,this.StrokeColor=e.StrokeColor,this.Subject=e.Subject,this.Thickness=e.Thickness,this.VertexPoints=e.VertexPoints,this.AnnotName=e.AnnotName,this.Comments=e.Comments,this.State=e.State,this.StateModel=e.StateModel,this.AnnotType="shape_measure",this.AnnotationSettings=e.AnnotationSettings,this.EnableShapeLabel=e.EnableShapeLabel,this.AllowedInteractions=e.AllowedInteractions,this.AnnotationRotation=e.AnnotationRotation,!0===e.EnableShapeLabel&&(this.LabelContent=e.LabelContent,this.LabelFillColor=e.LabelFillColor,this.FontColor=e.FontColor,this.LabelBorderColor=e.LabelBorderColor,this.FontSize=e.FontSize,this.LabelSettings=e.LabelSettings,this.LabelBounds=e.LabelBounds)},fVt=function(){this.PathData=null,this.ExistingCustomData=null},yVt=function(){this.Ratio="",this.X=[],this.Distance=[],this.Area=[],this.Angle=[],this.Volume=[],this.TargetUnitConversion=0,this.Depth=0},vVt=function(){this.Unit="",this.ConversionFactor=0,this.FractionalType="",this.Denominator=0,this.FormatDenominator=!1},bVt=function(){this.AnnotationFlags=null,this.AnnotationSelectorSettings=null,this.AnnotationSettings=null,this.ExistingCustomData=null,this.CustomData=null,this.IsPrint=!1},wVt=function(){this.AnnotationSelectorSettings=null,this.AnnotationSettings=null,this.ExistingCustomData=null,this.CustomData=null,this.IsPrint=!0,this.IsMultiSelect=!1,this.AnnotpageNumbers=null,this.AnnotNameCollection=null},CVt=function(e,t){this.X=e,this.Y=t},SVt=function(e,t,i,n){this.X=e,this.Y=t,this.Width=i,this.Height=n,this.Location={X:e,Y:t},this.Size={IsEmpty:!1,Width:i,Height:n},this.Left=e,this.Top=t,this.Right=e+i,this.Bottom=t+n},AVt=function(e,t,i){this.IsEmpty=!0,this.R=e,this.G=t,this.B=i,0===this.R&&0===this.G&&0===this.B||(this.IsEmpty=!1)},xVt=function(e,t){this.Bold=e.isBold,this.FontFamily=e._fontFamily,this.Height=e.height,this.Italic=e.isItalic,this.Name=t,this.Size=e.size,this.Strikeout=e.isStrikeout,this.Style=e.style,this.Underline=e.isUnderline},IVt=(TVt.prototype.moveTo=function(e,t){this.points.push([e,t])},TVt.prototype.lineTo=function(e,t){this.points.push([e,t])},TVt.prototype.transform=function(i){this.points=this.points.map(function(e){var t=e[0],e=e[1];return[i[0][0]*t+i[0][1]*e+i[0][2],i[1][0]*t+i[1][1]*e+i[1][2]]})},TVt);function TVt(){this.points=[]}var EVt=function(e,t,i,n){this.left=e,this.top=t,this.right=i,this.bottom=n,this.width=i-e,this.height=n-t},DVt=(MVt.prototype.saveSignatureData=function(e,t){var i=new rVt(this.pdfViewer,this.pdfViewerBase),n=JSON.parse(e.signatureData);if(!je(n))for(var o=0;o<n.length;o++){var r=n[parseInt(o.toString(),10)];if(0<r.length)for(var s=0;s<r.length;s++){var a=r[parseInt(s.toString(),10)],l=Object.prototype.hasOwnProperty.call(a,"shapeAnnotationType")&&null!==a.shapeAnnotationType?a.shapeAnnotationType.toString():null;if(null!==l&&"SignatureText"===l)i.drawFreeTextAnnotations(a,t,!0);else if(null!==l&&"SignatureImage"===l)i.drawImage(a,t,!0);else{for(var l=a.pageIndex,h=t.getPage(l),d=this.getRotateAngle(h.rotation.toString()),p=h.size,c=p[0],u=p[1],c=1===d||3===d?(u=p[0],p[1]):(u=p[1],p[0]),p=JSON.parse(a.bounds),p=this.getSignatureBounds(p,this.convertPointToPixel(u),this.convertPointToPixel(c),d),g=JSON.parse(a.data),u=this.convertPixelToPoint(p.left),c=this.convertPixelToPoint(p.top),m=this.convertPixelToPoint(p.width),f=this.convertPixelToPoint(p.height),d=a.opacity,p=a.thickness,a=JSON.parse(a.strokeColor),a=[a.r,a.g,a.b],y=-1,v=-1,b=-1,w=-1,C=0;C<g.length;C++){var S,A,x=g[parseInt(C.toString(),10)];-1===y?(y=x.x,v=x.y,b=x.x,w=x.x):((S=x.x)<=y&&(y=S),(A=x.y)<=v&&(v=A),b<=S&&(b=S),w<=A&&(w=A))}var I=b-y,T=w-v,E=[0,0],l=t.getPage(l),D=null,M=(null!=l&&((D=l.graphics).save(),D.setTransparency(d),D.translateTransform(u,c)),new yIt(a,m));if(M._width=this.convertPixelToPoint(p),0<g.length)for(var k=new nIt,P=0;P<g.length;P++){var B=(x=g[parseInt(P.toString(),10)]).command.toString(),F=(x.x-y)/(I/m),L=(x.y-v)/(T/f);"M"===B?(0!==P&&(h.graphics.drawPath(k,M,null),k=new nIt),E=[F,L],je(D)||k.addLine(F,L,F,L)):"L"===B&&(B=[F,L],null!=D&&k.addLine(E[0],E[1],B[0],B[1]),E=B),P===g.length-1&&h.graphics.drawPath(k,M,null)}null!=D&&D.restore()}}}},MVt.prototype.getSignatureBounds=function(e,t,i,n){var o;return 0===n?o={left:e.left,top:e.top,width:e.width,height:e.height}:1===n?o={left:i-e.top-e.height,top:e.left,width:e.height,height:e.width}:2===n?o={left:i-e.left-e.width,top:t-e.top-e.height,width:e.width,height:e.height}:3===n&&(o={left:e.top,top:t-e.left-e.width,width:e.height,height:e.width}),o},MVt.prototype.saveSignatureAsAnnotatation=function(O,e){var t=new lVt(this.pdfViewer,this.pdfViewerBase),i=JSON.parse(O.signatureData);if(!je(i))for(var n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)];if(0<o.length)for(var r=0;r<o.length;r++){var s=new rVt(this.pdfViewer,this.pdfViewerBase),a=o[parseInt(r.toString(),10)],l=Object.prototype.hasOwnProperty.call(a,"shapeAnnotationType")&&null!==a.shapeAnnotationType?a.shapeAnnotationType.toString():null;if(null!==l&&"SignatureText"===l)s.drawFreeTextAnnotations(a,e,!1);else if(null!==l&&"SignatureImage"===l)s.drawImage(a,e,!1);else{for(var l=JSON.parse(a.bounds),h=JSON.parse(a.data),s=a.pageIndex,d=e.getPage(s),s=t.getCropBoxValue(d,!1),p=s.x+this.convertPixelToPoint(l.left),c=this.convertPixelToPoint(l.top),s=(0===s.x&&d.cropBox[2]===d.size[0]&&s.y===d.size[1]||(c-=s.y),this.convertPixelToPoint(l.width)),l=this.convertPixelToPoint(l.height),N=a.opacity,V=a.thickness,u=JSON.parse(a.strokeColor),u=[u.r,u.g,u.b],g=-1,m=-1,f=-1,y=-1,v=t.getInkRotateAngle(d.rotation.toString()),_=new nIt,b=0;b<h.length;b++){var w=h[parseInt(b.toString(),10)];_.addLine(w.x,w.y,0,0)}for(var H=t.getRotatedPathForMinMax(_._points,v),C=0;C<H.points.length;C+=2){var S,A=H.points[parseInt(C.toString(),10)];-1===g?(g=A[0],m=A[1],f=A[0],y=A[1]):((S=A[0])<=g&&(g=S),(A=A[1])<=m&&(m=A),f<=S&&(f=S),y<=A&&(y=A))}var x=(f-g)/s,I=(y-m)/l,T=(0===x?x=1:0===I&&(I=1),[]),E=0;if(0!==v){for(var D=0;D<h.length;D++){if("M"===(w=h[parseInt(D.toString(),10)]).command.toString()&&D!==E){E=D;break}T.push(parseFloat(w.x.toString())),T.push(parseFloat(w.y.toString()))}for(var M=t.getRotatedPath(T,v),T=[],k=0;k<M._points.length;k+=2)T.push((M._points[parseInt(k.toString(),10)][0]-g)/x+p),T.push(d.size[1]-(M._points[parseInt(k.toString(),10)][1]-m)/I-c)}else for(D=0;D<h.length;D++){if("M"===(w=h[parseInt(D.toString(),10)]).command.toString()&&D!==E){E=D;break}T.push((w.x-g)/x+p);var z=(w.y-m)/I;T.push(d.size[1]-z-c)}var P=new iEt([p,c,s,l],T),s=(new dvt,new dvt(P.bounds.x,d.size[1]-(P.bounds.y+P.bounds.height),P.bounds.width,P.bounds.height));if(P.bounds=s,P.color=u,T=[],0<E)if(0!==v){for(var B=[],F=E;F<h.length;F++)"M"===(w=h[parseInt(F.toString(),10)]).command.toString()&&F!==E&&(B.push(T),T=[]),T.push(w.x),T.push(w.y);0<T.length&&B.push(T);for(var j=0;j<B.length;j++){var L=[],W=B[parseInt(j.toString(),10)];if(0<W.length){for(M=t.getRotatedPath(W,v),k=0;k<M._points.length;k+=2)L.push((M._points[parseInt(k.toString(),10)][0]-g)/x+p),L.push(d.size[1]-(M._points[parseInt(k.toString(),10)][1]-m)/I-c);P.inkPointsCollection.push(L)}L=[]}}else{for(var R=E;R<h.length;R++){z=("M"===(w=h[parseInt(R.toString(),10)]).command.toString()&&R!==E&&(P.inkPointsCollection.push(T),T=[]),T.push((w.x-g)/x+p),(w.y-m)/I);T.push(d.size[1]-z-c)}0<T.length&&P.inkPointsCollection.push(T)}P.border.width=V,P.opacity=N,P._dictionary.set("NM",a.signatureName.toString()),P._annotFlags=bAt.print,Object.prototype.hasOwnProperty.call(a,"author")&&null!==a.author&&"Guest"!==(l=a.author.toString())&&(P.author=l),d.annotations.add(P)}}}},MVt.prototype.convertPointToPixel=function(e){return 96*e/72},MVt.prototype.convertPixelToPoint=function(e){return.75*e},MVt.prototype.getRotateAngle=function(e){var t=0;switch(e){case"RotateAngle0":case"0":t=0;break;case"RotateAngle180":case"2":t=2;break;case"RotateAngle270":case"3":t=3;break;case"RotateAngle90":case"1":t=1}return t},MVt);function MVt(e,t){this.pdfViewer=e,this.pdfViewerBase=t}var kVt=function(){this.HasChild=!1},PVt=function(){},BVt=function(){},FVt=(LVt.prototype.getImageStream=function(){this.mIsImageStreamParsed=!0;var e=this.mImageDictionary,t=(this.getImageInterpolation(e),this.setImageFilter()),e=this.imageStream();if(je(t)&&this.mImageFilter.push("FlateDecode"),je(t))return null;for(var i,n=0;n<t.length;n++)1<t.length&&(this.isDualFilter=!0),"DCTDecode"!==t[parseInt(n.toString(),10)]||this.mImageDictionary.has("SMask")||this.mImageDictionary.has("Mask")||"DeviceCMYK"!==(i=this.setColorSpace()).name&&"DeviceN"!==i.name&&"DeviceGray"!==i.name&&"Separation"!==i.name&&"DeviceRGB"!==i.name&&("ICCBased"!==i.name||4!==this.numberOfComponents)||"DeviceRGB"!==i.name||this.mImageDictionary.has("DecodeParms")||this.mImageDictionary.has("Decode");return this.mImageFilter=null,e},LVt.prototype.setColorSpace=function(){if(je(this.mColorspace))return this.getColorSpace(),this.mColorspace},LVt.prototype.getColorSpace=function(){var e;this.mImageDictionary.has("ColorSpace")&&(this.internalColorSpace="",this.mImageDictionary.has("ColorSpace")&&(e=this.mImageDictionary.getArray("ColorSpace"))&&Array.isArray(e)&&0<e.length&&this.mImageDictionary.get("ColorSpace"),this.mImageDictionary.get("ColorSpace")instanceof k)&&(this.mColorspace=this.mImageDictionary.get("ColorSpace"))},LVt.prototype.setImageFilter=function(){return je(this.mImageFilter)&&(this.mImageFilter=this.getImageFilter()),this.mImageFilter},LVt.prototype.getImageFilter=function(){var e=[];return je(this.mImageDictionary)||this.mImageDictionary.has("Filter")&&this.mImageDictionary.get("Filter")instanceof k&&e.push(this.mImageDictionary.get("Filter").name),e},LVt.prototype.getImageInterpolation=function(e){!je(e)&&e.has("Interpolate")&&(this.mIsImageInterpolated=e.get("Interpolate"))},LVt.prototype.imageStream=function(){return yMt(this.mImageStream.getString(),!1,!0)},LVt);function LVt(e,t){this.mIsImageStreamParsed=!1,this.mIsImageInterpolated=!1,this.isDualFilter=!1,this.numberOfComponents=0,je(t)||(this.mImageStream=e,this.mImageDictionary=t)}var RVt,OVt=function(){return(OVt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},NVt=(VVt.prototype.createOrganizeWindow=function(e){var t,i,n=this,o=this.pdfViewer.element.id;je(document.getElementById(o+"_organize_window"))||je(this.organizeDialog)?(this.dialogDivElement=Q("div",{id:o+"_organize_window",className:"e-pv-organize-window"}),t=this.dialogDivElement,i=this.createContentArea(),this.pdfViewerBase.mainContainer.appendChild(t),this.organizeDialog=new pS({showCloseIcon:!0,closeOnEscape:!0,isModal:!0,header:this.pdfViewer.localeObj.getConstant("Organize Pages"),target:this.pdfViewerBase.mainContainer,content:i,visible:!1,open:function(){n.organizeWindowFocus()},close:function(e){n.isSkipRevert?n.isSkipRevert=!1:(n.tempOrganizePagesCollection=JSON.parse(JSON.stringify(n.organizePagesCollection)),n.undoOrganizeCollection=[],n.redoOrganizeCollection=[],n.isDocumentModified=!1,n.pdfViewerBase.isImportDoc=!1,n.startTile=null,n.ctrlKey=!1,n.shiftKey=!1,n.isTouchEvent=!1,n.isClickedOnCheckBox=!1,n.totalCheckedCount=0,n.isOrganizeWindowOpen=!1,n.destroyDialogWindow(),n.createOrganizeWindow(!0))}}),F.isDevice&&!this.pdfViewer.enableDesktopMode||(i=this.pdfViewerBase.pageCount,this.organizeDialog.buttons=[{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Save As"),isPrimary:!0},click:this.onSaveasClicked.bind(this)},{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Save"),isPrimary:!0},click:this.onSaveClicked.bind(this)},{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Total")+" "+i.toString()+" "+this.pdfViewer.localeObj.getConstant("Pages"),cssClass:"e-pv-organize-total-page-button",disabled:!0}}]),window.addEventListener("resize",function(){n.updateOrganizeDialogSize()}),this.pdfViewer.enableRtl&&(this.organizeDialog.enableRtl=!0),this.waitingPopup=Q("div",{id:o+"_organizeLoadingIndicator"}),t.appendChild(this.waitingPopup),GLt({target:this.waitingPopup,cssClass:"e-spin-center"}),this.pdfViewerBase.setLoaderProperties(this.waitingPopup),this.organizeDialog.appendTo(t),e||(this.organizeDialog.show(!0),this.isOrganizeWindowOpen=!0),this.disableTileDeleteButton(),this.enableDisableToolbarItems(),this.updateUndoRedoButtons(),this.initEventListeners()):(this.organizeDialog.show(!0),this.isOrganizeWindowOpen=!0)},VVt.prototype.createOrganizeWindowForMobile=function(){var e,t,i=this,n=this.pdfViewer.element.id;je(document.getElementById(n+"_organize_window"))||je(this.organizeDialog)?(this.dialogDivElement=Q("div",{id:n+"_organize_window",className:"e-pv-organize-window"}),e=this.dialogDivElement,t=this.createContentArea(),this.pdfViewerBase.mainContainer.appendChild(e),this.organizeDialog=new pS({showCloseIcon:!0,closeOnEscape:!0,isModal:!0,header:this.pdfViewer.localeObj.getConstant("Organize Pages"),target:this.pdfViewerBase.mainContainer,content:t,visible:!1,close:function(){i.isSkipRevert?i.isSkipRevert=!1:(i.tempOrganizePagesCollection=JSON.parse(JSON.stringify(i.organizePagesCollection)),i.undoOrganizeCollection=[],i.redoOrganizeCollection=[],i.isDocumentModified=!1,i.pdfViewerBase.isImportDoc=!1,i.startTile=null,i.ctrlKey=!1,i.shiftKey=!1,i.isTouchEvent=!1,i.isClickedOnCheckBox=!1,i.isOrganizeWindowOpen=!1,i.totalCheckedCount=0,i.destroyDialogWindow(),i.createOrganizeWindow(!0))}}),F.isDevice&&!this.pdfViewer.enableDesktopMode||(t=this.pdfViewerBase.pageCount,this.organizeDialog.buttons=[{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Save As"),isPrimary:!0},click:this.onSaveasClicked.bind(this)},{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Save"),isPrimary:!0},click:this.onSaveClicked.bind(this)},{buttonModel:{content:this.pdfViewer.localeObj.getConstant("Total")+" "+t.toString()+" "+this.pdfViewer.localeObj.getConstant("Pages"),cssClass:"e-pv-organize-total-page-button",disabled:!0}}]),window.addEventListener("resize",function(){i.updateOrganizeDialogSize()}),this.pdfViewer.enableRtl&&(this.organizeDialog.enableRtl=!0),this.waitingPopup=Q("div",{id:n+"_organizeLoadingIndicator"}),e.appendChild(this.waitingPopup),GLt({target:this.waitingPopup,cssClass:"e-spin-center"}),this.pdfViewerBase.setLoaderProperties(this.waitingPopup),this.organizeDialog.appendTo(e),this.organizeDialog.show(!0),this.createMobileContextMenu(),this.disableTileDeleteButton(),this.enableDisableToolbarItems(),this.updateUndoRedoButtons(),this.initEventListeners()):this.organizeDialog.show(!0)},VVt.prototype.initEventListeners=function(){this.boundOnTileAreaMouseDown=this.onTileAreaMouseDown.bind(this),this.boundOnTileAreaKeyDown=this.onTileAreaKeyDown.bind(this),this.boundOnTileAreaKeyUp=this.onTileAreaKeyUp.bind(this),this.tileAreaDiv.addEventListener("mousedown",this.boundOnTileAreaMouseDown),document.addEventListener("keydown",this.boundOnTileAreaKeyDown),document.addEventListener("keyup",this.boundOnTileAreaKeyUp)},VVt.prototype.removeEventListeners=function(){je(this.tileAreaDiv)||this.tileAreaDiv.removeEventListener("mousedown",this.boundOnTileAreaMouseDown),document.removeEventListener("keydown",this.boundOnTileAreaKeyDown),document.removeEventListener("keyup",this.boundOnTileAreaKeyUp)},VVt.prototype.onTileAreaMouseDown=function(e){var t,i,n,o=this;e.target&&e.target.previousElementSibling&&e.target.previousElementSibling.classList.contains("e-pv-organize-tile-checkbox")?this.isClickedOnCheckBox=!0:this.isClickedOnCheckBox=!1,e.target.closest(".e-pv-organize-anchor-node")?(e=e.target,t=Array.from(this.tileAreaDiv.children),this.shiftKey&&this.startTile?(i=Array.from(this.tileAreaDiv.children).indexOf(e.closest(".e-pv-organize-anchor-node")),this.startTile&&(n=Array.from(this.tileAreaDiv.children).indexOf(this.startTile.closest(".e-pv-organize-anchor-node")),this.selectRange(n,i),t.forEach(function(e,t){(t<Math.min(n,i)||t>Math.max(n,i))&&o.deselectTile(e)}))):this.ctrlKey||(this.startTile=e)):this.ctrlKey||this.shiftKey||(this.clearSelection(),this.startTile=null),this.updateSelectAllCheckbox(),this.enableDisableToolbarItems()},VVt.prototype.onTileAreaKeyDown=function(e){!e.ctrlKey&&!e.metaKey||e.shiftKey||(this.ctrlKey=!0,this.isOrganizeWindowOpen&&(65===e.keyCode&&(e.preventDefault(),this.selectAllTiles()),90===e.keyCode?(e.preventDefault(),this.undo()):89===e.keyCode&&(e.preventDefault(),this.redo()))),e.shiftKey&&(this.shiftKey=!0)},VVt.prototype.onTileAreaKeyUp=function(e){e.ctrlKey||e.metaKey||(this.ctrlKey=!1),e.shiftKey||(this.shiftKey=!1)},VVt.prototype.onSelectAllClick=function(e){e.checked?this.selectAllTiles():this.clearSelection()},VVt.prototype.selectRange=function(e,t){for(var i=Math.min(e,t),n=Math.max(e,t),o=i;o<=n;o++){var r=this.tileAreaDiv.children[parseInt(o.toString(),10)];this.selectTile(r)}},VVt.prototype.selectTile=function(e){var t;je(e)||(t=e.closest(".e-pv-organize-anchor-node").querySelector(".e-pv-organize-tile-checkbox"))&&(t.checked=!0,this.setSelectionRingStyle(t,e))},VVt.prototype.deselectTile=function(e){var t;je(e)||(t=e.closest(".e-pv-organize-anchor-node").querySelector(".e-pv-organize-tile-checkbox"))&&(t.checked=!1,this.setSelectionRingStyle(t,e))},VVt.prototype.clearSelection=function(){var i=this;document.querySelectorAll(".e-pv-organize-node-selection-ring").forEach(function(e){var t=e.closest(".e-pv-organize-anchor-node").querySelector(".e-pv-organize-tile-checkbox");t.checked=!1,i.setSelectionRingStyle(t,e)}),this.updateSelectAllCheckbox(),this.enableDisableToolbarItems()},VVt.prototype.selectAllTiles=function(){var t=this;Array.from(this.tileAreaDiv.children).forEach(function(e){t.selectTile(e)}),this.updateSelectAllCheckbox(),this.enableDisableToolbarItems()},VVt.prototype.updateOrganizeDialogSize=function(){var e=this.pdfViewer.element.getBoundingClientRect().width,t=this.pdfViewer.element.getBoundingClientRect().height;je(this.organizeDialog)||(this.organizeDialog.width=e+"px",this.organizeDialog.height=t+"px")},VVt.prototype.createContentArea=function(){var t=this,e=this.pdfViewer.element.id,i=Q("div",{id:e+"_content_appearance",className:"e-pv-organize-content-apperance"}),e=Q("div",{id:e+"_toolbar_appearance",className:"e-pv-organize-toolbar-apperance"}),n=(this.tileAreaWrapper=Q("div",{id:this.pdfViewer.element.id+"_organize_tile_view_wrapper",className:"e-pv-organize-tile-view-wrapper"}),this.tileAreaDiv=Q("div",{id:this.pdfViewer.element.id+"_organize_tile_view",className:"e-pv-organize-tile-view e-pv-thumbnail-row"}),this.tileAreaWrapper.style.width="100%",this.tileAreaWrapper.style.height="calc(100% - 48px)",this.tileAreaWrapper.style.position="relative",i.style.width="100%",i.style.height="100%",e.style.height="48px",this.tileAreaDiv.style.height="100%",this.selectAllCheckBox=new ib({label:F.isDevice&&!this.pdfViewer.enableDesktopMode?"":this.pdfViewer.localeObj.getConstant("Select All"),cssClass:"e-pv-organize-select-all",checked:!1,change:this.onSelectAllClick.bind(this)}),[]),o=[{type:"Input",template:this.selectAllCheckBox,id:"selectAllCheckbox",align:"Left"},{type:"Separator",align:"Left"},{prefixIcon:"e-pv-undo-icon e-pv-icon",visible:!0,cssClass:"e-pv-undo-container",id:this.pdfViewer.element.id+"_undo_organize_Pages",align:"Left",click:function(e){t.undo()}},{prefixIcon:"e-pv-redo-icon e-pv-icon",visible:!0,cssClass:"e-pv-redo-container",id:this.pdfViewer.element.id+"_redo_organize_Pages",align:"Left",click:function(e){t.redo()}},{prefixIcon:"e-pv-rotate-left-icon e-pv-icon",visible:!0,cssClass:"e-pv-toolbar-rotate-left",id:this.pdfViewer.element.id+"_rotate_page_left",align:"Center",click:function(e){t.onToolbarLeftButtonClick()}},{prefixIcon:"e-pv-rotate-right-icon e-pv-icon",visible:!0,cssClass:"e-pv-toolbar-rotate-right",id:this.pdfViewer.element.id+"_rotate_page_right",align:"Center",click:function(e){t.onToolbarRightButtonClick()}},{type:"Separator",align:"Center"},{prefixIcon:"e-pv-copy-icon e-pv-icon",visible:!0,cssClass:"e-pv-toolbar-rotate-right",id:this.pdfViewer.element.id+"_copy_page",align:"Center",click:function(e){t.onToolbarCopyButtonClick()}},{type:"Separator",align:"Center"},{prefixIcon:"e-pv-delete-icon e-pv-icon",visible:!0,cssClass:"e-pv-delete-selected",id:this.pdfViewer.element.id+"_delete_selected",align:"Center",click:function(e){t.onToolbarDeleteButtonClick()}},{prefixIcon:"e-pv-import-icon e-pv-icon",text:this.pdfViewer.localeObj.getConstant("Import Document"),visible:!0,cssClass:"e-pv-import-pages",id:this.pdfViewer.element.id+"_import_pages",align:"Right",click:function(e){t.bindImportDocEvent()}}],r=[{type:"Input",template:this.selectAllCheckBox,id:"selectAllCheckbox",align:"Left"},{type:"Separator",align:"Left"},{prefixIcon:"e-pv-undo-icon e-pv-icon",visible:!0,cssClass:"e-pv-undo-container",id:this.pdfViewer.element.id+"_undo_organize_Pages",align:"Left",click:function(e){t.undo()}},{prefixIcon:"e-pv-redo-icon e-pv-icon",visible:!0,cssClass:"e-pv-redo-container",id:this.pdfViewer.element.id+"_redo_organize_Pages",align:"Left",click:function(e){t.redo()}},{prefixIcon:"e-pv-rotate-left-icon e-pv-icon",visible:!0,cssClass:"e-pv-toolbar-rotate-left",id:this.pdfViewer.element.id+"_rotate_page_left",align:"Right",click:function(e){t.onToolbarLeftButtonClick()}},{prefixIcon:"e-pv-rotate-right-icon e-pv-icon",visible:!0,cssClass:"e-pv-toolbar-rotate-right",id:this.pdfViewer.element.id+"_rotate_page_right",align:"Right",click:function(e){t.onToolbarRightButtonClick()}},{prefixIcon:"e-pv-delete-icon e-pv-icon",visible:!0,cssClass:"e-pv-delete-selected",id:this.pdfViewer.element.id+"_delete_selected",align:"Right",click:function(e){t.onToolbarDeleteButtonClick()}},{type:"Separator",align:"Right"},{prefixIcon:"e-pv-more-icon e-pv-icon",visible:!0,cssClass:"e-pv-toolbar-rotate-right",id:this.pdfViewer.element.id+"_organize_more_button",align:"Right",click:this.openContextMenu.bind(this)}],r=(F.isDevice&&!this.pdfViewer.enableDesktopMode?n.push.apply(n,r):n.push.apply(n,o),this.toolbar=new U3({items:n}),this.toolbar.cssClass="e-pv-organize-toolbar",this.toolbar.height="48px",this.toolbar.width="auto",this.toolbar.appendTo(e),i.appendChild(e),this.renderThumbnailImage(),this.tileAreaWrapper.appendChild(this.tileAreaDiv),i.appendChild(this.tileAreaWrapper),this.createImportDocElement(e),this.organizeWireEvent(),e.querySelector("#"+this.pdfViewer.element.id+"_rotate_page_right")),o=(je(r)||this.createTooltip(r,this.pdfViewer.localeObj.getConstant("Rotate Right")),e.querySelector("#"+this.pdfViewer.element.id+"_rotate_page_left")),n=(je(o)||this.createTooltip(o,this.pdfViewer.localeObj.getConstant("Rotate Left")),e.querySelector("#"+this.pdfViewer.element.id+"_copy_page")),r=(je(n)||this.createTooltip(n,this.pdfViewer.localeObj.getConstant("Copy Pages")),e.querySelector("#"+this.pdfViewer.element.id+"_delete_selected")),o=(je(r)||this.createTooltip(r,this.pdfViewer.localeObj.getConstant("Delete Pages")),e.querySelector("#"+this.pdfViewer.element.id+"_undo_organize_Pages")),n=(je(o)||this.createTooltip(o,this.pdfViewer.localeObj.getConstant("Undo")),e.querySelector("#"+this.pdfViewer.element.id+"_redo_organize_Pages"));return je(n)||this.createTooltip(n,this.pdfViewer.localeObj.getConstant("Redo")),i},VVt.prototype.createMobileContextMenu=function(){this.mobileContextMenu=[{text:this.pdfViewer.localeObj.getConstant("Save"),iconCss:"e-icons e-pv-save-icon e-pv-icon"},{text:this.pdfViewer.localeObj.getConstant("Save As"),iconCss:"e-icons e-pv-save-as-icon e-pv-icon"},{separator:!0},{text:this.pdfViewer.localeObj.getConstant("Copy"),iconCss:"e-pv-copy-icon e-pv-icon"},{separator:!0},{text:this.pdfViewer.localeObj.getConstant("Import Document"),id:this.pdfViewer.element.id+"_import_pages",iconCss:"e-pv-import-icon e-pv-icon"}];var e=Q("ul",{id:this.pdfViewer.element.id+"_organize_context_menu"});this.pdfViewer.element.appendChild(e),je(this.contextMenuObj)&&(this.contextMenuObj=new D4({target:"#"+this.pdfViewer.element.id+"_organize_more_button",items:this.mobileContextMenu,beforeOpen:this.contextMenuBeforeOpen.bind(this),select:this.contextMenuItemSelect.bind(this)}),this.pdfViewer.enableRtl&&(this.contextMenuObj.enableRtl=!0),this.contextMenuObj.appendTo(e)),F.isDevice&&!this.pdfViewer.enableDesktopMode?this.contextMenuObj.animationSettings.effect="ZoomIn":this.contextMenuObj.animationSettings.effect="SlideDown"},VVt.prototype.contextMenuBeforeOpen=function(e){this.contextMenuObj.enableItems(["Save","Save As"],!0),this.contextMenuObj.enableItems(["Copy"],!1),this.contextMenuObj.enableItems(["Import Document"],!0);!this.selectAllCheckBox.checked&&!this.selectAllCheckBox.indeterminate||!this.pdfViewer.pageOrganizerSettings.canCopy||this.getCopiedItems(!1)||this.getImportedItems(!1)||this.contextMenuObj.enableItems(["Copy"],!0)},VVt.prototype.getCopiedItems=function(i){var n=this;return this.tileAreaDiv.querySelectorAll(".e-pv-organize-node-selection-ring").forEach(function(e){var e=e.closest(".e-pv-organize-anchor-node"),t=parseInt(e.getAttribute("data-page-order"),10),e=n.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===t});e.isInserted&&!e.isDeleted&&(i=!0)}),i},VVt.prototype.getImportedItems=function(i){var n=this;return this.tileAreaDiv.querySelectorAll(".e-pv-organize-node-selection-ring").forEach(function(e){var e=e.closest(".e-pv-organize-anchor-node"),t=parseInt(e.getAttribute("data-page-order"),10),e=n.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===t});e.isImportedDoc&&!e.isDeleted&&(i=!0)}),i},VVt.prototype.contextMenuItemSelect=function(e){switch(e.item.text){case"Save":this.onSaveClicked();break;case"Save As":this.onSaveasClicked();break;case"Copy":this.onToolbarCopyButtonClick();break;case"Import Document":this.bindImportDocEvent()}},VVt.prototype.createRequestForPreview=function(){var i=this;return!!document.documentMode?(this.requestPreviewCreation(i),null):new Promise(function(e,t){i.requestPreviewCreation(i)})},VVt.prototype.requestPreviewCreation=function(t){for(var e=t.pdfViewer.pageCount,i=!1,n=0;n<e;n++)t.pdfViewerBase.digitalSignaturePresent(n)&&(i=!0);var o="",o=(i&&(o=t.pdfViewerBase.digitalSignaturePages.toString()),{startPage:0..toString(),endPage:e.toString(),sizeX:"99.7",sizeY:"141",hashId:t.pdfViewerBase.hashId,action:"RenderThumbnailImages",elementId:t.pdfViewer.element.id,uniqueId:t.pdfViewerBase.documentId,digitalSignaturePresent:i,digitalSignaturePageList:o});if(this.pdfViewerBase.jsonDocumentId&&(o.documentId=this.pdfViewerBase.jsonDocumentId),this.pdfViewerBase.clientSideRendering)for(var r={documentId:t.pdfViewerBase.getDocumentId(),hashId:t.pdfViewerBase.hashId,elementId:t.pdfViewer.element.id,uniqueId:t.pdfViewerBase.documentId},s=!!t.pdfViewer.textSearch,a=0;a<e;a++)this.pdfViewerBase.pdfViewerRunner.addTask({startIndex:0,endIndex:e,pageIndex:a,message:"renderPreviewTileImage",isTextNeed:s,jsonObject:r,isRenderText:s,requestType:s?"pdfTextSearchRequest":""},yRt.Low);else this.previewRequestHandler=new DRt(this.pdfViewer),this.previewRequestHandler.url=t.pdfViewer.serviceUrl+"/"+t.pdfViewer.serverActionSettings.renderThumbnail,this.previewRequestHandler.responseType="json",0<e&&!je(t.pdfViewerBase.hashId)&&this.previewRequestHandler.send(o),this.previewRequestHandler.onSuccess=function(e){e=e.data;t.pdfViewerBase.checkRedirection(e)||t.updatePreviewCollection(e)},this.previewRequestHandler.onFailure=function(e){t.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,t.pdfViewer.serverActionSettings.renderThumbnail)},this.previewRequestHandler.onError=function(e){t.pdfViewerBase.openNotificationPopup(),t.pdfViewer.fireAjaxRequestFailed(e.status,e.statusText,t.pdfViewer.serverActionSettings.renderThumbnail)}},VVt.prototype.updatePreviewCollection=function(t){if(t){if("object"!=typeof t)try{t=JSON.parse(t)}catch(e){this.pdfViewerBase.onControlError(500,t,this.pdfViewer.serverActionSettings.renderThumbnail),t=null}t&&t.uniqueId===this.pdfViewerBase.documentId&&(this.pdfViewer.fireAjaxRequestSuccess(this.pdfViewer.serverActionSettings.renderThumbnail,t),this.getData(t,this.pdfViewerBase.clientSideRendering))}},VVt.prototype.previewOnMessage=function(e){var t,i,n,o,r,s,a;"renderPreviewTileImage"===e.data.message&&(t=document.createElement("canvas"),a=(e=e.data).value,r=e.width,s=e.height,i=e.pageIndex,n=e.startIndex,e=e.endIndex,t.width=r,t.height=s,(r=(o=t.getContext("2d")).createImageData(r,s)).data.set(a),o.putImageData(r,0,0),s=t.toDataURL(),this.pdfViewerBase.releaseCanvas(t),a={thumbnailImage:s,startPage:n,endPage:e,uniqueId:this.pdfViewerBase.documentId,pageIndex:i},this.updatePreviewCollection(a))},VVt.prototype.getData=function(e,t){if(this.dataDetails||(this.dataDetails=[]),t)this.dataDetails.push({pageId:e.pageIndex,image:e.thumbnailImage});else{for(var t=e.startPage,i=e.endPage,n=t;n<i;n++){var o=e.thumbnailImage[parseInt(n.toString(),10)],r=n;this.dataDetails.push({pageId:r,image:o})}this.dataDetails.sort(function(e,t){return e.pageId-t.pageId})}this.dataDetails.length===this.pdfViewer.pageCount&&(je(this.pdfViewerBase.navigationPane)||this.pdfViewerBase.navigationPane.enableOrganizeButton(!0),je(this.pdfViewer.toolbar)||this.pdfViewer.toolbar.enableToolbarItem(["OrganizePagesTool"],!0),this.pdfViewer.isPageOrganizerOpen&&(!F.isDevice||this.pdfViewer.enableDesktopMode?this.createOrganizeWindow():this.createOrganizeWindowForMobile()),this.isAllImagesReceived=!0)},VVt.prototype.createImportDocElement=function(e){this.pdfViewer.pageOrganizerSettings.canImport&&e&&(this.importDocInputElement=Q("input",{id:this.pdfViewer.element.id+"_importDocElement",styles:"position:fixed; left:-100em",attrs:{type:"file"}}),this.importDocInputElement.setAttribute("accept",".pdf"),this.importDocInputElement.setAttribute("aria-label","import document element"),this.importDocInputElement.setAttribute("tabindex","-1"),e.appendChild(this.importDocInputElement))},VVt.prototype.movePDFpages=function(e,t,i){for(var n=this,o=!1,r=0,s=e;r<s.length;r++)if(s[r]===t){o=!0;break}if(!o){for(var a=[],l=this,h=0;h<this.selectedPageIndexes.length;h++)!function(t){a.push(l.clonedCollection(l.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===n.selectedPageIndexes[parseInt(t.toString(),10)]})))}(h);var d=[];d.push.apply(d,this.selectedPageIndexes),this.addOrganizeAction(a,"Move Pages",[],d,this.dragEndIndex,this.isRightInsertion),this.rearrangePages(e,t,i)}},VVt.prototype.rearrangePages=function(e,t,i){var n=this,o=(this.tempOrganizePagesCollection=this.updateCollection(this.tempOrganizePagesCollection,e,t,i),Array.from(this.tileAreaDiv.children)),r=(e.sort(function(e,t){return e-t}),e.map(function(e){return o[parseInt(e.toString(),10)]})),s=i?t+1:t;r.forEach(function(e){o.splice(s,0,e),s+=1});for(var a=0;a<e.length;a++)e[parseInt(a.toString(),10)]>=t&&(e[parseInt(a.toString(),10)]+=r.length);e.sort(function(e,t){return t-e}).forEach(function(e){o.splice(e,1)}),this.tileAreaDiv.innerHTML="",o.forEach(function(e,t){n.tileAreaDiv.appendChild(e),e.setAttribute("data-page-order",t.toString())}),this.updatePageNumber()},VVt.prototype.updateCollection=function(e,t,i,n){var o=this,r=[],s=0,a=[],l=(t.sort(),i=n?i+1:i,0),h=(t.forEach(function(e){e<i&&l++}),e.sort(function(e,t){return o.sorting(e.currentPageIndex,t.currentPageIndex)})),n=h.filter(function(e){return null===e.currentPageIndex}).length;h.forEach(function(e){null===e.currentPageIndex&&r.push(OVt({},e))});for(var d=0;d<h.length;d++){for(var p=!1,c=0;c<t.length;c++)if(h[parseInt(d.toString(),10)].currentPageIndex===t[parseInt(c.toString(),10)]){p=!0;break}if(s===i-l)break;p||this.containsPageDetails(h[parseInt(d.toString(),10)],a)||je(h[parseInt(d.toString(),10)].currentPageIndex)||(r.push(OVt({},h[parseInt(d.toString(),10)])),a.push(h[parseInt(d.toString(),10)]),r[r.length-1].currentPageIndex=s,s+=1)}for(d=0;d<h.length;d++){for(p=!1,c=0;c<t.length;c++)if(h[parseInt(d.toString(),10)].currentPageIndex===t[parseInt(c.toString(),10)]){p=!0;break}p&&!this.containsPageDetails(h[parseInt(d.toString(),10)],a)&&(r.push(OVt({},h[parseInt(d.toString(),10)])),a.push(h[parseInt(d.toString(),10)]),r[r.length-1].currentPageIndex=s,s+=1)}for(d=n;d<h.length;d++){for(p=!1,c=0;c<t.length;c++)if(h[parseInt(d.toString(),10)].currentPageIndex===t[parseInt(c.toString(),10)]){p=!0;break}p||this.containsPageDetails(h[parseInt(d.toString(),10)],a)||(r.push(OVt({},h[parseInt(d.toString(),10)])),a.push(h[parseInt(d.toString(),10)]),r[r.length-1].currentPageIndex=s,s+=1)}return r},VVt.prototype.sorting=function(e,t){return e=je(e)?-1:parseInt(e.toString(),10),(t=je(t)?-1:parseInt(t.toString(),10))<e?1:e<t?-1:0},VVt.prototype.containsPageDetails=function(e,t){for(var i=!1,n=!1,o=0;o<t.length;o++)t[parseInt(o.toString(),10)].pageIndex===e.pageIndex&&(i=!0),t[parseInt(o.toString(),10)].currentPageIndex===e.currentPageIndex&&(n=!0);return i&&n},VVt.prototype.renderThumbnailImage=function(){this.organizePagesCollection=[];for(var e=0;e<this.pdfViewer.pageCount;e++)this.tileImageRender(e),this.organizePagesCollection.push(new HVt(e,e,null,!1,!1,!1,!1,!1,!1,this.getRotatedAngle(this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].rotation.toString()),this.pdfViewerBase.pageSize[parseInt(e.toString(),10)],!1,null,null,null));this.tempOrganizePagesCollection=JSON.parse(JSON.stringify(this.organizePagesCollection))},VVt.prototype.bindImportDocEvent=function(){this.pdfViewer.pageOrganizerSettings.canImport&&document.getElementById(this.pdfViewer.element.id+"_import_pages")&&this.importDocInputElement.click()},VVt.prototype.tileImageRender=function(e,t,i,n,o,r,s,a,l){var h=this,d="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAAaADAAQAAAABAAAAAQAAAAD5Ip3+AAAAC0lEQVQIHWP4DwQACfsD/Qy7W+cAAAAASUVORK5CYII=",p=(this.pageLink=Q("div",{id:"anchor_page_"+e,className:"e-pv-organize-anchor-node"}),o?(this.pageLink.id=this.pageLink.id+"_"+t,this.pageLink.setAttribute("data-page-order",i.toString())):this.pageLink.setAttribute("data-page-order",e.toString()),this.thumbnail=Q("div",{id:this.pdfViewer.element.id+"_organize_page_"+e,className:"e-pv-organize-tile e-pv-thumbnail-column"}),o&&(this.thumbnail.id=this.thumbnail.id+"_"+t),this.imageContainer=Q("div",{id:this.pdfViewer.element.id+"_container_image_"+e,className:"e-pv-image-container"}),o&&(this.imageContainer.id=this.imageContainer.id+"_"+t),o||s?(c=this.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===i}).pageSize,r&&0<=i-1&&(c=this.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===i-1}).pageSize)):c=this.pdfViewerBase.pageSize[parseInt(e.toString(),10)],this.thumbnailImage=Q("img",{id:this.pdfViewer.element.id+"_organize_image_"+e,className:"e-pv-organize-image"}),o&&(this.thumbnailImage.id=this.thumbnailImage.id+"_"+t),c=c.height>c.width?(p=100*c.width/c.height,100):(p=100)*c.height/c.width,this.thumbnailImage.style.width=p+"%",this.thumbnailImage.style.height=c+"%",s?this.thumbnailImage.src=d:i&&null!==i?(p=this.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===i}))&&-1!==p.pageIndex?this.thumbnailImage.src=this.dataDetails[parseInt(p.pageIndex.toString(),10)].image:p&&null!==p.copiedPageIndex&&0<=p.copiedPageIndex?this.thumbnailImage.src=this.dataDetails[parseInt(p.copiedPageIndex.toString(),10)].image:this.thumbnailImage.src=d:this.thumbnailImage.src=this.dataDetails[parseInt(e.toString(),10)].image,this.imageContainer.addEventListener("click",function(e){h.handleImageContainerClick(e)}),this.thumbnailImage.alt=this.pdfViewer.element.id+"_organize_page_"+e,o&&(this.thumbnailImage.alt=this.pdfViewer.element.id+"_organize_page_"+i),a?(c=Q("span",{id:this.pdfViewer.element.id+"_organize_import_download_icon_"+e,className:"e-pv-organize-import-download-icon e-pv-import-icon e-pv-icon"}),this.importImageWrapper=Q("div",{id:this.pdfViewer.element.id+"_organize_import_image_wrapper_"+e,className:"e-pv-organize-import-image-wrapper"}),this.importImageWrapper.appendChild(c),this.imageContainer.appendChild(this.importImageWrapper)):this.imageContainer.appendChild(this.thumbnailImage),o&&!je(this.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===i}))&&(s=this.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===i}).rotateAngle,this.imageContainer.style.transform="rotate("+s+"deg)"),this.thumbnail.appendChild(this.imageContainer),Q("div",{id:this.pdfViewer.element.id+"_tile_pagenumber_"+e,className:"e-pv-tile-number"})),d=(o&&(p.id=p.id+"_"+t),p.textContent=a?l:(o?i+1:e+1).toString(),document.createElement("input"));d.type="checkbox",d.className="e-pv-organize-tile-checkbox",d.id="checkboxdiv_page_"+e,o&&(d.id=d.id+"_"+t),this.thumbnail.appendChild(d);new ib({disabled:!1,checked:!1,change:this.onSelectClick.bind(this)}).appendTo(d),d.parentElement.style.height="100%",d.parentElement.style.width="100%",d.parentElement.style.display="none";var c=Q("div",{id:this.pdfViewer.element.id+"_organize_buttondiv_"+e,className:"e-pv-organize-buttondiv"}),s=(o&&(c.id=c.id+"_"+t),this.deleteButton=Q("button",{id:this.pdfViewer.element.id+"_delete_page_"+e,attrs:{"aria-label":this.pdfViewer.localeObj.getConstant("Delete Page"),tabindex:"-1"}}),o&&(this.deleteButton.id=this.deleteButton.id+"_"+t),this.deleteButton.className="e-pv-tbar-btn e-pv-delete-button e-btn e-pv-organize-pdf-tile-btn",this.deleteButton.setAttribute("type","button"),Q("span",{id:this.pdfViewer.element.id+"_delete_icon",className:"e-pv-delete-icon e-pv-icon"}));this.deleteButton.appendChild(s);new NS({content:ao(function(){return this.pdfViewer.localeObj.getConstant("Delete Page")},this),opensOn:"Hover",beforeOpen:this.onTooltipBeforeOpen.bind(this)}).appendTo(this.deleteButton),this.rotateRightButton=Q("button",{id:this.pdfViewer.element.id+"_rotate_page_"+e,attrs:{"aria-label":this.pdfViewer.localeObj.getConstant("Rotate Right"),tabindex:"-1"}}),o&&(this.rotateRightButton.id=this.rotateRightButton.id+"_"+t),this.rotateRightButton.className="e-pv-tbar-btn e-pv-rotate-right-button e-btn e-pv-organize-pdf-tile-btn",this.rotateRightButton.setAttribute("type","button");l=Q("span",{id:this.pdfViewer.element.id+"_rotate-right_icon",className:"e-pv-rotate-right-icon e-pv-icon"});this.rotateRightButton.appendChild(l);new NS({content:ao(function(){return this.pdfViewer.localeObj.getConstant("Rotate Right")},this),opensOn:"Hover",beforeOpen:this.onTooltipBeforeOpen.bind(this)}).appendTo(this.rotateRightButton),this.rotateLeftButton=Q("button",{id:this.pdfViewer.element.id+"_rotate_page_"+e,attrs:{"aria-label":this.pdfViewer.localeObj.getConstant("Rotate Left"),tabindex:"-1"}}),o&&(this.rotateLeftButton.id=this.rotateLeftButton.id+"_"+t),this.rotateLeftButton.className="e-pv-tbar-btn e-pv-rotate-left-button e-btn e-pv-organize-pdf-tile-btn",this.rotateLeftButton.setAttribute("type","button");d=Q("span",{id:this.pdfViewer.element.id+"_rotate_left_icon",className:"e-pv-rotate-left-icon e-pv-icon"});this.rotateLeftButton.appendChild(d);new NS({content:ao(function(){return this.pdfViewer.localeObj.getConstant("Rotate Left")},this),opensOn:"Hover",beforeOpen:this.onTooltipBeforeOpen.bind(this)}).appendTo(this.rotateLeftButton),this.copyButton=Q("button",{id:this.pdfViewer.element.id+"_copy_page_"+e,attrs:{"aria-label":this.pdfViewer.localeObj.getConstant("Copy Page"),tabindex:"-1"}}),o&&(this.copyButton.id=this.copyButton.id+"_"+t),this.copyButton.className="e-pv-tbar-btn e-pv-copy-button e-btn e-pv-organize-pdf-tile-btn",this.copyButton.setAttribute("type","button");s=Q("span",{id:this.pdfViewer.element.id+"_copy_icon",className:"e-pv-copy-icon e-pv-icon"});this.copyButton.appendChild(s);new NS({content:ao(function(){return this.pdfViewer.localeObj.getConstant("Copy Page")},this),opensOn:"Hover",beforeOpen:this.onTooltipBeforeOpen.bind(this)}).appendTo(this.copyButton),this.insertRightButton=Q("button",{id:this.pdfViewer.element.id+"_insert_page_"+e,attrs:{"aria-label":this.pdfViewer.localeObj.getConstant("Insert Right"),tabindex:"-1"}}),o&&(this.insertRightButton.id=this.insertRightButton.id+"_"+t),this.insertRightButton.className="e-pv-tbar-btn e-pv-insert-right-button e-btn e-pv-organize-pdf-tile-btn",this.insertRightButton.setAttribute("type","button");l=Q("span",{id:this.pdfViewer.element.id+"_insert_right_icon",className:"e-icons e-plus"});this.insertRightButton.appendChild(l);new NS({content:ao(function(){return this.pdfViewer.localeObj.getConstant("Insert Right")},this),opensOn:"Hover",beforeOpen:this.onTooltipBeforeOpen.bind(this)}).appendTo(this.insertRightButton),this.insertLeftButton=Q("button",{id:this.pdfViewer.element.id+"_insert_page_"+e,attrs:{"aria-label":this.pdfViewer.localeObj.getConstant("Insert Left"),tabindex:"-1"}}),o&&(this.insertLeftButton.id=this.insertLeftButton.id+"_"+t),this.insertLeftButton.className="e-pv-tbar-btn e-pv-insert-left-button e-btn e-pv-organize-pdf-tile-btn",this.insertLeftButton.setAttribute("type","button");d=Q("span",{id:this.pdfViewer.element.id+"_insert_left_icon",className:"e-icons e-plus"});this.insertLeftButton.appendChild(d),new NS({content:ao(function(){return this.pdfViewer.localeObj.getConstant("Insert Left")},this),opensOn:"Hover",beforeOpen:this.onTooltipBeforeOpen.bind(this)}).appendTo(this.insertLeftButton),this.pdfViewer.pageOrganizerSettings.canInsert||(this.insertLeftButton.setAttribute("disabled","disabled"),this.insertLeftButton.firstElementChild.classList.add("e-disabled"),this.insertRightButton.setAttribute("disabled","disabled"),this.insertRightButton.firstElementChild.classList.add("e-disabled")),this.pdfViewer.pageOrganizerSettings.canRotate||(this.rotateLeftButton.setAttribute("disabled","disabled"),this.rotateLeftButton.firstElementChild.classList.add("e-disabled"),this.rotateRightButton.setAttribute("disabled","disabled"),this.rotateRightButton.firstElementChild.classList.add("e-disabled")),this.pdfViewer.pageOrganizerSettings.canDelete||(this.deleteButton.setAttribute("disabled","disabled"),this.deleteButton.firstElementChild.classList.add("e-disabled")),this.pdfViewer.pageOrganizerSettings.canCopy||(this.copyButton.setAttribute("disabled","disabled"),this.copyButton.firstElementChild.classList.add("e-disabled")),c.appendChild(this.insertLeftButton),a||(c.appendChild(this.rotateLeftButton),c.appendChild(this.rotateRightButton),c.appendChild(this.copyButton)),c.appendChild(this.deleteButton),c.appendChild(this.insertRightButton),this.thumbnail.appendChild(c),c.style.display="none",this.pageLink.appendChild(this.thumbnail),this.tileAreaDiv.appendChild(this.pageLink),this.pageLink.appendChild(p),this.rotateRightButton.addEventListener("click",this.rotateButtonClick),this.rotateLeftButton.addEventListener("click",this.rotateLeftButtonClick),this.insertRightButton.addEventListener("click",this.insertRightButtonClick),this.insertLeftButton.addEventListener("click",this.insertLeftButtonClick),this.deleteButton.addEventListener("click",this.deleteButtonClick),this.copyButton.addEventListener("click",this.copyButtonClick),this.pageLink.addEventListener("mouseover",this.thumbnailMouseOver),this.pageLink.addEventListener("mouseleave",this.thumbnailMouseLeave),this.movePages(),o&&(r?this.tileAreaDiv.insertBefore(this.pageLink,n):this.tileAreaDiv.insertBefore(this.pageLink,n.nextSibling))},VVt.prototype.handleImageContainerClick=function(e){var t=e.target.closest(".e-pv-organize-anchor-node").querySelector(".e-pv-organize-tile-checkbox.e-control.e-checkbox.e-lib");e instanceof PointerEvent?"touch"===e.pointerType?this.isTouchEvent=!0:"mouse"===e.pointerType&&(this.isTouchEvent=!1):!this.pdfViewerBase.isMacSafari&&e instanceof TouchEvent?this.isTouchEvent=!0:e instanceof MouseEvent&&(this.isTouchEvent=!1),t&&!je(t)&&!je(t.ej2_instances)&&0<t.ej2_instances.length&&t.ej2_instances[0].click()},VVt.prototype.movePages=function(){var o=this,r=this,e=this.imageContainer,e=(this.dragObj=new hn(e,{dragArea:this.tileAreaDiv,isDragScroll:!0,enableTapHold:!0,tapHoldThreshold:F.isDevice?50:750,helper:function(e){var t;return o.pdfViewer.pageOrganizerSettings.canRearrange?((t=(e=e.element.querySelector(".e-pv-organize-image, .e-pv-organize-import-image-wrapper")).cloneNode(!0)).style.width=e.clientWidth+"px",t.style.height=e.clientHeight+"px",o.virtualEle=Q("div",{className:"e-pv-virtual-image-container"}),o.virtualEle.appendChild(t),o.tileAreaWrapper.appendChild(o.virtualEle),o.virtualEle):null},drag:function(e){var t,i;e.event.preventDefault(),r.pdfViewer.pageOrganizerSettings.canRearrange&&(r.autoScroll(e),r.addSelectionRingStyle(),i=!je(e.target)&&e.target instanceof Element?e.target.closest(".e-pv-organize-anchor-node"):null,je(i)||(t=parseInt(i.getAttribute("data-page-order"),10),r.dragHoveredIndex=t,t=i.getBoundingClientRect(),je(i=document.querySelector(".e-pv-organize-outer-border"))&&(i=Q("div",{className:"e-pv-organize-outer-border"}),r.tileAreaWrapper.appendChild(i)),i.style.display="block",r.isHoveredOnSelectedPages(r.selectedPageIndexes,r.dragHoveredIndex)&&!je(e.target)&&(e.target.classList.contains("e-pv-organize-image")||e.target.classList.contains("e-pv-organize-import-image-wrapper")||e.target.classList.contains("e-pv-image-container"))?(i.classList.add("e-pv-selected"),i.classList.remove("e-pv-not-selected")):!je(e.target)&&(e.target.classList.contains("e-pv-organize-image")||e.target.classList.contains("e-pv-organize-import-image-wrapper")||e.target.classList.contains("e-pv-image-container"))&&(i.classList.add("e-pv-not-selected"),i.classList.remove("e-pv-selected")),r.handlePageMove(e,t,r.gapBetweenDivs,i)))},dragStart:function(e){if(r.selectedPageIndexes=[],r.pdfViewer.pageOrganizerSettings.canRearrange){if(e.element.parentElement.querySelector(".e-pv-organize-tile-checkbox").checked)for(var t=r.tileAreaDiv.querySelectorAll(".e-pv-organize-node-selection-ring"),i=0;i<t.length;i++)r.selectedPageIndexes.push(parseInt(t[parseInt(i.toString(),10)].getAttribute("data-page-order"),10)),t[parseInt(i.toString(),10)].classList.add("e-pv-organize-tile-draggedEle"),(n=t[parseInt(i.toString(),10)].querySelector(".e-pv-organize-image, .e-pv-organize-import-image-wrapper"))&&n.classList.add("e-pv-organize-tile-draggedEle");else{var n,e=e.element.closest(".e-pv-organize-anchor-node");e&&(r.selectedPageIndexes.push(parseInt(e.getAttribute("data-page-order"),10)),e.classList.add("e-pv-organize-tile-draggedEle"),n=e.querySelector(".e-pv-organize-image, .e-pv-organize-import-image-wrapper"))&&n.classList.add("e-pv-organize-tile-draggedEle")}e=Q("span",{className:"e-badge e-badge-primary e-badge-overlap e-badge-notification",innerHTML:""+o.selectedPageIndexes.length});e.classList.add("e-pv-notification"),r.virtualEle.append(e),r.addSelectionRingStyle()}},dragStop:function(e){function t(){r.virtualEle.parentNode.removeChild(r.virtualEle),r.tileAreaDiv.querySelectorAll(".e-pv-organize-tile-draggedEle").forEach(function(e){e.classList.remove("e-pv-organize-tile-draggedEle")});var e=document.querySelector(".e-pv-organize-outer-border");je(e)||(e.classList.remove("e-pv-selected","e-pv-not-selected"),r.selectedPageIndexes=[])}null!==r.autoScrollInterval&&(clearInterval(r.autoScrollInterval),r.autoScrollInterval=null),r.removeSelectionRingStyle(),e.target instanceof Element&&e.target.classList&&null!=e.target&&(e.target.classList.contains("e-pv-organize-image")||e.target.classList.contains("e-pv-organize-import-image-wrapper")||e.target.classList.contains("e-pv-image-container"))||t()}}),this.thumbnail);this.dropObj=new un(e,{drop:function(e){null!==r.autoScrollInterval&&(clearInterval(r.autoScrollInterval),r.autoScrollInterval=null),r.removeSelectionRingStyle();var t=document.querySelector(".e-pv-organize-outer-border");t&&(t.classList.remove("e-pv-selected","e-pv-not-selected"),t.parentNode.removeChild(t)),r.virtualEle&&r.virtualEle.parentNode&&(r.virtualEle.parentNode.removeChild(r.virtualEle),r.virtualEle=null),r.pageDragDrop(e),r.tileAreaDiv.querySelectorAll(".e-pv-organize-tile-draggedEle").forEach(function(e){e.classList.remove("e-pv-organize-tile-draggedEle")}),r.selectedPageIndexes=[]},over:function(e){},out:function(e){var t=document.querySelector(".e-pv-organize-outer-border");je(t)||t.classList.remove("e-pv-selected","e-pv-not-selected")}})},VVt.prototype.autoScroll=function(e){var t,r,s=this,a=(("touchmove"===e.event.type?e.event.touches[0]:e.event).clientY,10),e=(this.autoScrollInterval=null,window.innerHeight),l=a,h=e-a,e=document.getElementById(this.pdfViewer.element.id+"_toolbar_appearance").getBoundingClientRect().bottom+a,i=this.organizeDialog.element.getElementsByClassName("e-footer-content"),i=(!je(i)&&0<i.length&&(t=i[0].getBoundingClientRect()),je(t)?this.tileAreaDiv.getBoundingClientRect().bottom-a:t.top-a),l=parseFloat(Math.max(l,e).toFixed(2)),h=Math.min(h,i),d=parseFloat(this.virtualEle.getBoundingClientRect().top.toFixed(2))<=l,p=this.virtualEle.getBoundingClientRect().bottom>=h;d||p?(r=this.tileAreaDiv.scrollHeight-this.tileAreaDiv.clientHeight,function e(){clearTimeout(s.autoScrollInterval),s.autoScrollInterval=null,function(){s.tileAreaDiv.onscroll=function(){var e=document.querySelector(".e-pv-organize-outer-border");je(e)||(e.style.display="none")};var e=s.virtualEle.getBoundingClientRect(),t=e.bottom-(s.previousClientY+e.height),i=e.top-s.previousClientY,e=(s.previousClientY=e.top,s.tileAreaDiv.scrollTop),i=0<e&&i<=0,t=e<r&&0<=t,n=e;{var o;d&&i?(o=(l-s.virtualEle.getBoundingClientRect().top)/a,n-=10*o):p&&t&&(o=(s.virtualEle.getBoundingClientRect().bottom-h)/a,n+=10*o)}if((n=Math.max(0,Math.min(r,n)))!==e)return s.tileAreaDiv.scrollTop=n,1}()&&(s.autoScrollInterval=window.setTimeout(e,30))}()):(clearTimeout(this.autoScrollInterval),s.autoScrollInterval=null)},VVt.prototype.handlePageMove=function(e,t,i,n){var o,e=this.isTileRightInsertion(e);je(this.isTileRightInsertion)||(i=e?t.width+i/2:-i/2,o=n.parentElement.getBoundingClientRect(),n.style.left=t.x+i-o.x+"px",n.style.top=t.top-o.y+"px",n.style.height=t.height+"px",this.isRightInsertion=e)},VVt.prototype.isTileRightInsertion=function(e){var t=je(e.target)?null:e.target.closest(".e-pv-organize-anchor-node");return je(t)?null:(t=t.getBoundingClientRect(),("mousemove"===e.event.type?e.event:e.event.touches[0]).clientX>t.x+t.width/2)},VVt.prototype.addSelectionRingStyle=function(){for(var e=this.tileAreaDiv.querySelectorAll(".e-pv-organize-anchor-node"),t=0;t<this.selectedPageIndexes.length;t++)e[this.selectedPageIndexes[parseInt(t.toString(),10)]].classList.add("e-pv-dragging-style")},VVt.prototype.removeSelectionRingStyle=function(){for(var e=this.tileAreaDiv.querySelectorAll(".e-pv-organize-anchor-node"),t=0;t<this.selectedPageIndexes.length;t++)e[this.selectedPageIndexes[parseInt(t.toString(),10)]].classList.remove("e-pv-dragging-style")},VVt.prototype.isHoveredOnSelectedPages=function(e,t){for(var i=!1,n=0;n<e.length;n++)if(e[parseInt(n.toString(),10)]===t){i=!0;break}return i},VVt.prototype.addOrganizeAction=function(e,t,i,n,o,r){this.undoOrganizeCollection.push({UndoRedoTileActions:e,action:t,toolbarActions:i,selectedPagesIndexes:n,dropIndex:o,isRightInsertion:r}),this.redoOrganizeCollection=[],this.updateUndoRedoButtons()},VVt.prototype.updateUndoRedoButtons=function(){var t=this;this.toolbar.items.forEach(function(e){e.id===t.pdfViewer.element.id+"_undo_organize_Pages"?t.enableToolbarItem(e.id,0<t.undoOrganizeCollection.length):e.id===t.pdfViewer.element.id+"_redo_organize_Pages"&&t.enableToolbarItem(e.id,0<t.redoOrganizeCollection.length)})},VVt.prototype.enableDisableToolbarItems=function(){var t=this;this.toolbar.items.forEach(function(e){e.id===t.pdfViewer.element.id+"_rotate_page_left"||e.id===t.pdfViewer.element.id+"_rotate_page_right"?t.enableToolbarItem(e.id,(t.selectAllCheckBox.checked||t.selectAllCheckBox.indeterminate)&&t.pdfViewer.pageOrganizerSettings.canRotate&&!t.getImportedItems(!1)):e.id===t.pdfViewer.element.id+"_copy_page"?t.enableToolbarItem(e.id,(t.selectAllCheckBox.checked||t.selectAllCheckBox.indeterminate)&&t.pdfViewer.pageOrganizerSettings.canCopy&&!t.getCopiedItems(!1)&&!t.getImportedItems(!1)):e.id===t.pdfViewer.element.id+"_delete_selected"?t.enableToolbarItem(e.id,t.selectAllCheckBox.indeterminate&&t.pdfViewer.pageOrganizerSettings.canDelete):e.id===t.pdfViewer.element.id+"_import_pages"&&t.enableToolbarItem(e.id,t.pdfViewer.pageOrganizerSettings.canImport)})},VVt.prototype.enableToolbarItem=function(e,t){e=document.getElementById(e);je(e)||je(e.parentElement)||(this.toolbar.enableItems(e.parentElement,t),e.setAttribute("tabindex",t?"0":"-1"),e.setAttribute("data-tabindex",t?"0":"-1"))},VVt.prototype.disableTileDeleteButton=function(){if(1===this.tileAreaDiv.childElementCount)je(t=this.tileAreaDiv.querySelector(".e-pv-organize-anchor-node").querySelector(".e-pv-delete-button"))||(t.setAttribute("disabled","disabled"),t.firstElementChild.classList.add("e-disabled"));else for(var e=0;e<this.tileAreaDiv.childElementCount;e++){var t;!je(t=(this.tileAreaDiv.childNodes[parseInt(e.toString(),10)].classList.contains("e-pv-organize-anchor-node")?this.tileAreaDiv.childNodes[parseInt(e.toString(),10)]:this.tileAreaDiv.childNodes[parseInt(e.toString(),10)].querySelector(".e-pv-organize-anchor-node")).querySelector(".e-pv-delete-button"))&&this.pdfViewer.pageOrganizerSettings.canDelete&&(t.removeAttribute("disabled"),t.firstElementChild.classList.remove("e-disabled"))}},VVt.prototype.disableTileCopyRotateButton=function(){for(var e=0;e<this.tempOrganizePagesCollection.length;e++){var t,i,n=this.tempOrganizePagesCollection[parseInt(e.toString(),10)];n.isImportedDoc&&!n.isDeleted&&null!=!n.currentPageIndex&&(t=(n=this.tileAreaDiv.querySelector('[data-page-order="'+n.currentPageIndex.toString()+'"]')).querySelector(".e-pv-rotate-left-button"),i=n.querySelector(".e-pv-rotate-right-button"),n=n.querySelector(".e-pv-copy-button"),je(t)||(t.setAttribute("disabled","disabled"),t.firstElementChild.classList.add("e-disabled")),je(i)||(i.setAttribute("disabled","disabled"),i.firstElementChild.classList.add("e-disabled")),je(n)||(n.setAttribute("disabled","disabled"),n.firstElementChild.classList.add("e-disabled")))}},VVt.prototype.disableTileCopyButton=function(){for(var e=0;e<this.tempOrganizePagesCollection.length;e++){var t=this.tempOrganizePagesCollection[parseInt(e.toString(),10)];!t.isInserted||t.isDeleted||null==!t.currentPageIndex||je(t=this.tileAreaDiv.querySelector('[data-page-order="'+t.currentPageIndex.toString()+'"]').querySelector(".e-pv-copy-button"))||(t.setAttribute("disabled","disabled"),t.firstElementChild.classList.add("e-disabled"))}},VVt.prototype.updateSelectAllCheckbox=function(){var e=this.tileAreaDiv.childElementCount;this.totalCheckedCount=this.tileAreaDiv.querySelectorAll(".e-pv-organize-node-selection-ring").length,this.selectAllCheckBox&&(0===this.totalCheckedCount?(this.selectAllCheckBox.indeterminate=!1,this.selectAllCheckBox.checked=!1):e===this.totalCheckedCount?(this.selectAllCheckBox.indeterminate=!1,this.selectAllCheckBox.checked=!0):this.selectAllCheckBox.indeterminate=!0)},VVt.prototype.setSelectionRingStyle=function(e,t){e.checked?t.classList.add("e-pv-organize-node-selection-ring"):t.classList.remove("e-pv-organize-node-selection-ring");for(var i=0,n=Array.from(t.children);i<n.length;i++)for(var o=n[i],r=0,s=Array.from(o.children);r<s.length;r++){var a,l=s[r];l.classList.contains("e-checkbox-wrapper")&&(a=l.getElementsByClassName("e-control e-checkbox e-lib")[0].id,a=At(document.getElementById(a),"checkbox"),e.checked?(l.style.display="block",l.children[0].style.display="block",a.checked=!0):(l.style.display="none",l.children[0].style.display="none",a.checked=!1,je(l.parentElement)||je(l.parentElement.lastElementChild)||!l.parentElement.lastElementChild.classList.contains("e-pv-organize-buttondiv")||(l.parentElement.lastElementChild.style.display="none")))}},VVt.prototype.onTooltipBeforeOpen=function(e){this.pdfViewer.toolbarSettings.showTooltip||(e.cancel=!0)},VVt.prototype.openContextMenu=function(e){var t=document.getElementById(this.pdfViewer.element.id+"_organize_context_menu");je(t)||"block"===t.style.display||this.contextMenuObj.open(e.originalEvent.clientY,e.originalEvent.clientX,e.originalEvent.currentTarget)},VVt.prototype.updateTempRotationDetail=function(t,e){var i;this.pdfViewer.pageOrganizerSettings.canRotate&&-1!==(i=this.tempOrganizePagesCollection.findIndex(function(e){return e.currentPageIndex===t}))&&(this.tempOrganizePagesCollection[parseInt(i.toString(),10)].rotateAngle,this.tempOrganizePagesCollection[parseInt(i.toString(),10)].rotateAngle=Math.abs((this.tempOrganizePagesCollection[parseInt(i.toString(),10)].rotateAngle+e+360)%360)),this.organizeWindowFocus()},VVt.prototype.organizeWindowFocus=function(){var e=this.pdfViewer.element.id;document.getElementById(e+"_organize_window").focus()},VVt.prototype.getRotatedAngle=function(e){switch(e.trim()){case"0":return 0;case"90":case"1":return 90;case"180":case"2":return 180;case"270":case"3":return 270;default:return 0}},VVt.prototype.getRotation=function(e){switch(e.trim()){case"0":return 0;case"90":return 1;case"180":return 2;case"270":return 3;default:return 0}},VVt.prototype.updateRotationDetailCollection=function(){for(var e=0;e<this.tempOrganizePagesCollection.length;e++){var t,i=this.tempOrganizePagesCollection[parseInt(e.toString(),10)];-1!==i.pageIndex&&(t=this.pdfViewerBase.pageSize[parseInt(i.pageIndex.toString(),10)],Math.abs(this.getRotation(t.rotation.toString())-i.rotateAngle)%180==90)&&this.updatePageSize(i.pageIndex,t.height,t.width)}},VVt.prototype.updatePageSize=function(e,t,i){this.pdfViewerBase.pageSize[parseInt(e.toString(),10)]&&(this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].width=t,this.pdfViewerBase.pageSize[parseInt(e.toString(),10)].height=i,this.pdfViewerBase.highestWidth<t&&(this.pdfViewerBase.highestWidth=t),this.pdfViewerBase.isMixedSizeDocument=!0);for(var n=e;n<this.pdfViewerBase.pageSize.length;n++)!this.pdfViewerBase.pageSize[parseInt((n-1).toString(),10)]&&n-1<0?this.pdfViewerBase.pageSize[parseInt(n.toString(),10)].top=this.pdfViewerBase.pageGap:this.pdfViewerBase.pageSize[parseInt(n.toString(),10)].top=this.pdfViewerBase.pageSize[parseInt((n-1).toString(),10)].top+this.pdfViewerBase.pageSize[parseInt((n-1).toString(),10)].height+this.pdfViewerBase.pageGap},VVt.prototype.onSaveClicked=function(){var o=this;this.isSkipRevert=!0,this.showOrganizeLoadingIndicator(!0),JSON.stringify(this.tempOrganizePagesCollection)!==JSON.stringify(this.organizePagesCollection)||this.isDocumentModified?(this.updateOrganizePageCollection(),this.isDocumentModified=!0,this.pdfViewer.saveAsBlob().then(function(e){o.blobToBase64(e).then(function(e){var t,i,n;je(e)||""===e||(t=o.pdfViewer.fileName,i=o.pdfViewer.downloadFileName,n=o.pdfViewerBase.jsonDocumentId,o.showOrganizeLoadingIndicator(!1),o.organizeDialog.hide(),o.undoOrganizeCollection=[],o.redoOrganizeCollection=[],o.pdfViewer.loadDocInternally(e,null,!1),o.pdfViewerBase.updateDocumentEditedProperty(!0),o.pdfViewer.fileName=t,je(i)?o.pdfViewer.downloadFileName=t:o.pdfViewer.downloadFileName=i,o.pdfViewerBase.jsonDocumentId=n)})})):(this.showOrganizeLoadingIndicator(!1),this.organizeDialog.hide(),this.undoOrganizeCollection=[],this.redoOrganizeCollection=[])},VVt.prototype.blobToByteArray=function(n){return new Promise(function(t,e){var i=new FileReader;i.onloadend=function(){var e=i.result,e=new Uint8Array(e);t(e)},i.readAsArrayBuffer(n)})},VVt.prototype.blobToBase64=function(n){return new Promise(function(e,t){var i=new FileReader;i.onloadend=function(){return e(i.result)},i.readAsDataURL(n)})},VVt.prototype.showOrganizeLoadingIndicator=function(e){var t=document.getElementById(this.pdfViewer.element.id+"_organizeLoadingIndicator");t&&(e?(t.style.display="block",aRt):(t.style.display="none",hRt))(t)},VVt.prototype.updateOrganizePageDetailsInViewer=function(){for(var e=0,t=this.organizePagesCollection;e<t.length;e++){var i=t[e],n=i.pageIndex,o=i.rotateAngle,r=void 0,i=(r=-1!==n?this.pdfViewerBase.pageSize[parseInt(n.toString(),10)]:this.pdfViewerBase.pageSize[parseInt(i.copiedPageIndex.toString(),10)]).width*this.pdfViewerBase.getZoomFactor(),s=r.height*this.pdfViewerBase.getZoomFactor(),r=r.top*this.pdfViewerBase.getZoomFactor(),a=this.pdfViewerBase.getElement("_pageDiv_"+n),l=this.pdfViewerBase.getElement("_pageCanvas_"+n);a&&l&&(a.style.width=i+"px",a.style.height=s+"px",this.pdfViewer.enableRtl?a.style.right=this.pdfViewerBase.updateLeftPosition(n)+"px":a.style.left=this.pdfViewerBase.updateLeftPosition(n)+"px",a.style.top=r+"px",this.pdfViewerBase.pageContainer.style.width=this.pdfViewerBase.isMixedSizeDocument&&this.pdfViewerBase.highestWidth*this.pdfViewerBase.getZoomFactor()>this.pdfViewerBase.viewerContainer.clientWidth?this.pdfViewerBase.highestWidth*this.pdfViewerBase.getZoomFactor()+"px":this.pdfViewerBase.viewerContainer.clientWidth+"px",90===o||270===o?(i=a.style.width,a.style.width=a.style.height,a.style.height=i):(a.style.width="",a.style.height=""),a.style.left=(this.pdfViewerBase.viewerContainer.clientWidth-parseInt(a.style.width,10)*this.pdfViewerBase.getZoomFactor())/2+"px",l.style.transform="rotate("+o+"deg)",90===o||270===o?(s=l.width,l.style.width=l.height+"px",l.width=l.height,l.style.height=s+"px",l.height=s,l.style.margin="0px",l.style.marginLeft=(l.height-l.width)/2+"px",l.style.marginTop=(l.width-l.height)/2+"px"):l.style.margin="0px",this.applyElementStyles(l,n))}},VVt.prototype.getNextSubIndex=function(e,t){var e=e.querySelectorAll("[id^='anchor_page_"+t+"']"),i=-1;return e.forEach(function(e){e=e.id.split("_").slice(2),e[0],e=e[1];Number(e)>i&&(i=Number(e))}),i+1},VVt.prototype.removePage=function(e){var t=this.tileAreaDiv.childNodes[parseInt(e.toString(),10)];this.deleteTempPage(e,t),this.tileAreaDiv.removeChild(t),this.updatePageDetail()},VVt.prototype.rotateImage=function(e,t){var i,n=this.tileAreaDiv.childNodes[parseInt(e.toString(),10)].querySelector(".e-pv-organize-image");n&&(i=parseFloat(n.style.transform.replace("rotate(","").replace("deg)",""))||0,n.style.transform="rotate("+(i=(i+t+360)%360)+"deg)",this.updateTempRotationDetail(e,t))},VVt.prototype.updatePageDetail=function(){this.updateTotalPageCount(),this.updatePageNumber()},VVt.prototype.deletePageElement=function(e){var t;this.pdfViewer.pageOrganizerSettings.canDelete&&1<this.tileAreaDiv.childElementCount&&(t=parseInt(e.getAttribute("data-page-order"),10),this.deleteTempPage(t,e),!je(t=e.querySelector(".e-pv-delete-button"))&&!je(t.ej2_instances)&&0<t.ej2_instances.length&&t.ej2_instances[0].destroy(),this.tileAreaDiv.removeChild(e),this.updateTotalPageCount(),this.updatePageNumber(),this.updateSelectAllCheckbox(),this.disableTileDeleteButton())},VVt.prototype.deleteTempPage=function(t,e){if(this.pdfViewer.pageOrganizerSettings.canDelete&&0<this.tempOrganizePagesCollection.filter(function(e){return!1===e.isDeleted}).length){var i=this.tempOrganizePagesCollection.findIndex(function(e){return e.currentPageIndex===t}),n=this.tempOrganizePagesCollection[parseInt(i.toString(),10)].currentPageIndex;for(-1===i||this.tempOrganizePagesCollection[parseInt(i.toString(),10)].isInserted||this.tempOrganizePagesCollection[parseInt(i.toString(),10)].isCopied||this.tempOrganizePagesCollection[parseInt(i.toString(),10)].isImportedDoc?this.tempOrganizePagesCollection.splice(i,1):(this.tempOrganizePagesCollection[parseInt(i.toString(),10)].isDeleted=!0,this.tempOrganizePagesCollection[parseInt(i.toString(),10)].currentPageIndex=null),this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.map(function(e){return n<e.currentPageIndex&&!e.isDeleted&&(e.currentPageIndex=e.currentPageIndex-1),e});!je(e.nextElementSibling);){var o=e.nextElementSibling,r=parseInt(o.getAttribute("data-page-order"),10);r-=1,o.setAttribute("data-page-order",r.toString()),e=o}}},VVt.prototype.undoDeletedPage=function(t,i,e,n){var o;for(this.tempOrganizePagesCollection.some(function(e){return e.isDeleted})&&(o=this.tempOrganizePagesCollection.find(function(e){return null===e.currentPageIndex&&e.isDeleted&&-1!==e.pageIndex&&e.pageIndex===i&&null===e.copiedPageIndex}))&&(o.currentPageIndex=t,o.rotateAngle=e),this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.map(function(e){return e.currentPageIndex>=t&&!e.isDeleted?e.currentPageIndex+=1:e.currentPageIndex===t&&e.isDeleted&&(e.isDeleted=!1),e}),this.tempOrganizePagesCollection.sort(function(e,t){return e.currentPageIndex-t.currentPageIndex}),n&&n.setAttribute("data-page-order",(t+1).toString());n&&!je(n.nextElementSibling);){var r=n.nextElementSibling,s=parseInt(r.getAttribute("data-page-order"),10);s+=1,r.setAttribute("data-page-order",s.toString()),n=r}},VVt.prototype.insertRemovedPages=function(e,i,t){var n=0,o=this.tempOrganizePagesCollection.findIndex(function(e){return e.currentPageIndex===i});if(-1!==o)for(var r=0;r<o;r++)this.tempOrganizePagesCollection[parseInt(r.toString(),10)].isDeleted&&n++;else for(r=0;r<i;r++)this.tempOrganizePagesCollection[parseInt(r.toString(),10)].isDeleted&&n++;for(this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.slice(0,i+n).concat(e,this.tempOrganizePagesCollection.slice(i+n)),this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.map(function(e,t){return i+n<t&&!e.isDeleted&&(e.currentPageIndex+=1),e}),t&&t.setAttribute("data-page-order",(i+1).toString());t&&!je(t.nextElementSibling);){var s=t.nextElementSibling,a=parseInt(s.getAttribute("data-page-order"),10);a+=1,s.setAttribute("data-page-order",a.toString()),t=s}},VVt.prototype.clonedCollection=function(e){return JSON.parse(JSON.stringify(e))},VVt.prototype.updateTotalPageCount=function(){var e=document.querySelectorAll(".e-pv-organize-anchor-node").length,t=document.querySelector(".e-pv-organize-total-page-button");je(t)||(t.textContent=this.pdfViewer.localeObj.getConstant("Total")+" "+e.toString()+" "+this.pdfViewer.localeObj.getConstant("Pages"))},VVt.prototype.updatePageNumber=function(){var n=this;document.querySelectorAll(".e-pv-organize-anchor-node").forEach(function(e){var t=parseInt(e.getAttribute("data-page-order"),10),i=e.querySelector(".e-pv-tile-number");i&&((e=n.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===t})).isImportedDoc?(i.textContent=e.documentName,new NS({content:ao(function(){return i.textContent},n),opensOn:"Hover",beforeOpen:n.onTooltipBeforeOpen.bind(n)}).appendTo(i)):i.textContent=(t+1).toString())}),this.organizeWindowFocus()},VVt.prototype.insertTempPage=function(i,e,t){if(this.pdfViewer.pageOrganizerSettings.canInsert){var n,o=this.tempOrganizePagesCollection.findIndex(function(e){return e.currentPageIndex===i}),r=void 0,r=0!==i?this.tempOrganizePagesCollection.findIndex(function(e){return e.currentPageIndex===i-1}):o,s=void 0,a=void 0;for(e?(s=this.tempOrganizePagesCollection[parseInt(r.toString(),10)].pageIndex,0<=o-1&&!this.tempOrganizePagesCollection[parseInt((o-1).toString(),10)].isInserted&&(this.tempOrganizePagesCollection[parseInt((o-1).toString(),10)].hasEmptyPageAfter=!0),o<=this.tempOrganizePagesCollection.length-1&&!this.tempOrganizePagesCollection[parseInt(o.toString(),10)].isInserted&&(this.tempOrganizePagesCollection[parseInt(o.toString(),10)].hasEmptyPageBefore=!0),a=JSON.parse(JSON.stringify(this.tempOrganizePagesCollection[parseInt(r.toString(),10)].pageSize)),-1===s||je(a.rotation)||90!==this.getRotatedAngle(a.rotation.toString())&&270!==this.getRotatedAngle(a.rotation.toString())||(n=a.width,a.width=a.height,a.height=n),this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.slice(0,o).concat([new HVt(i,-1,this.tempOrganizePagesCollection[parseInt(o.toString(),10)].pageIndex,!0,!1,!1,!1,!1,!1,this.tempOrganizePagesCollection[parseInt(r.toString(),10)].rotateAngle,a,!1,null,null,null)],this.tempOrganizePagesCollection.slice(o)),this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.map(function(e,t){return t!==o&&e.currentPageIndex>=i&&null!=e.currentPageIndex&&(e.currentPageIndex=e.currentPageIndex+1),e}),t.setAttribute("data-page-order",(i+1).toString())):(s=this.tempOrganizePagesCollection[parseInt(o.toString(),10)].pageIndex,0<=o&&!this.tempOrganizePagesCollection[parseInt(o.toString(),10)].isInserted&&(this.tempOrganizePagesCollection[parseInt(o.toString(),10)].hasEmptyPageAfter=!0),o+1<=this.tempOrganizePagesCollection.length-1&&!this.tempOrganizePagesCollection[parseInt((o+1).toString(),10)].isInserted&&(this.tempOrganizePagesCollection[parseInt((o+1).toString(),10)].hasEmptyPageBefore=!0),a=JSON.parse(JSON.stringify(this.tempOrganizePagesCollection[parseInt(o.toString(),10)].pageSize)),-1===s||je(a.rotation)||90!==this.getRotatedAngle(a.rotation.toString())&&270!==this.getRotatedAngle(a.rotation.toString())||(n=a.width,a.width=a.height,a.height=n),this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.slice(0,o+1).concat([new HVt(i+1,-1,this.tempOrganizePagesCollection[parseInt(o.toString(),10)].pageIndex,!0,!1,!1,!1,!1,!1,this.tempOrganizePagesCollection[parseInt(o.toString(),10)].rotateAngle,a,!1,null,null,null)],this.tempOrganizePagesCollection.slice(o+1)),this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.map(function(e,t){return t!==o+1&&e.currentPageIndex>=i+1&&null!=e.currentPageIndex&&(e.currentPageIndex=e.currentPageIndex+1),e}));!je(t.nextElementSibling);){var l=t.nextElementSibling,h=parseInt(l.getAttribute("data-page-order"),10);h+=1,l.setAttribute("data-page-order",h.toString()),t=l}}},VVt.prototype.copyPage=function(t,e){if(this.pdfViewer.pageOrganizerSettings.canCopy){var i=this.tempOrganizePagesCollection.findIndex(function(e){return e.currentPageIndex===t}),n=void 0;if(-1!==i){var o,r=this.tempOrganizePagesCollection[parseInt(i.toString(),10)].pageIndex,n=JSON.parse(JSON.stringify(this.tempOrganizePagesCollection[parseInt(i.toString(),10)].pageSize));for(-1===r||je(n.rotation)||90!=this.getRotatedAngle(n.rotation.toString())&&270!==this.getRotatedAngle(n.rotation.toString())||(o=n.width,n.width=n.height,n.height=o),-1===r&&this.tempOrganizePagesCollection[parseInt(i.toString(),10)].isCopied?this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.slice(0,i+1).concat([new HVt(t+1,-1,this.tempOrganizePagesCollection[parseInt(i.toString(),10)].copiedPageIndex,!1,!1,!0,!1,!1,!1,this.tempOrganizePagesCollection[parseInt(i.toString(),10)].rotateAngle,n,!1,null,null,null)],this.tempOrganizePagesCollection.slice(i+1)):this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.slice(0,i+1).concat([new HVt(t+1,-1,r,!1,!1,!0,!1,!1,!1,this.tempOrganizePagesCollection[parseInt(i.toString(),10)].rotateAngle,n,!1,null,null,null)],this.tempOrganizePagesCollection.slice(i+1)),this.tempOrganizePagesCollection[parseInt(i.toString(),10)].istargetCopied=!0,this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.map(function(e,t){return i+1<t&&null!=e.currentPageIndex&&(e.currentPageIndex=e.currentPageIndex+1),e});!je(e.nextElementSibling);){var s=e.nextElementSibling,a=parseInt(s.getAttribute("data-page-order"),10);a+=1,s.setAttribute("data-page-order",a.toString()),e=s}}}},VVt.prototype.importPage=function(i,e,t,n,o,r){if(this.pdfViewer.pageOrganizerSettings.canImport){var s,a,l=this.tempOrganizePagesCollection.findIndex(function(e){return e.currentPageIndex===i});if(-1!==l)for(s=this.tempOrganizePagesCollection[parseInt(l.toString(),10)].pageIndex,a=JSON.parse(JSON.stringify(this.tempOrganizePagesCollection[parseInt(l.toString(),10)].pageSize)),o?(this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.slice(0,l).concat([new HVt(i,-1,s,!1,!1,!1,!1,!1,!1,0,a,!0,n,t,r)],this.tempOrganizePagesCollection.slice(l)),this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.map(function(e,t){return t!==l&&e.currentPageIndex>=i&&null!=e.currentPageIndex&&(e.currentPageIndex=e.currentPageIndex+1),e}),e.setAttribute("data-page-order",(i+1).toString())):(this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.slice(0,l+1).concat([new HVt(i+1,-1,s,!1,!1,!1,!1,!1,!1,0,a,!0,n,t,r)],this.tempOrganizePagesCollection.slice(l+1)),this.tempOrganizePagesCollection=this.tempOrganizePagesCollection.map(function(e,t){return l+1<t&&null!=e.currentPageIndex&&(e.currentPageIndex=e.currentPageIndex+1),e}));!je(e.nextElementSibling);){var h=e.nextElementSibling,d=parseInt(h.getAttribute("data-page-order"),10);d+=1,h.setAttribute("data-page-order",d.toString()),e=h}}},VVt.prototype.organizeWireEvent=function(){this.importDocInputElement&&this.importDocInputElement.addEventListener("change",this.importDocument.bind(this))},VVt.prototype.organizeUnWireEvent=function(){this.importDocInputElement&&this.importDocInputElement.removeEventListener("change",this.importDocument.bind(this))},VVt.prototype.importDocument=function(e){var t,i;this.pdfViewer.pageOrganizerSettings.canImport&&(t=this,i=e.target.files,null!==e.target.files[0])&&(e=i[0])&&(this.importedDocumentName=e.name,(i=new FileReader).readAsDataURL(e),i.onload=function(e){e=e.currentTarget.result;t.loadImportDoc(e,null,!1),je(t.importDocInputElement)||(t.importDocInputElement.value="")})},VVt.prototype.loadImportDoc=function(i,n,o){var r,s,a,e,t,l,h=this;this.pdfViewer.pageOrganizerSettings.canImport&&(r=null,s=!1,(r=this).importedDocumentData=i,a=this.pdfViewerBase.createGUID(),e=i.includes("pdf;base64,"),t=i,i=this.pdfViewerBase.checkDocumentData(i,!1),l=this.pdfViewerBase.constructJsonObject(i,n,e),this.pdfViewer.serverActionSettings)&&(this.pdfViewerBase.loadRequestHandler=new DRt(this.pdfViewer),this.pdfViewerBase.loadRequestHandler.url=this.pdfViewer.serviceUrl+"/"+this.pdfViewer.serverActionSettings.validatePassword,this.pdfViewerBase.loadRequestHandler.responseType="json",this.pdfViewerBase.loadRequestHandler.mode=!0,l.action="ValidatePassword",l.elementId=this.pdfViewer.element.id,l.isFileName=!1,this.pdfViewerBase.clientSideRendering?this.pdfViewerBase.getPdfByteArray(t).then(function(e){var t=h.pdfViewer.pdfRendererModule.loadImportDocument(e,a,n,l);if(t){if("object"!=typeof t)try{t=JSON.parse(t)}catch(e){h.pdfViewerBase.onControlError(500,t,h.pdfViewer.serverActionSettings.load),t=null}if(t){for(;"object"!=typeof t;)if(t=JSON.parse(t),"number"==typeof parseInt(t,10)&&!isNaN(parseInt(t,10))){t=parseInt(t,10);break}t.uniqueId!==a&&("number"!=typeof parseInt(t,10)||isNaN(parseInt(t,10)))||(4===t?(h.pdfViewerBase.isImportDoc=!0,s=!0,h.pdfViewerBase.renderPasswordPopup(i,n,h.pdfViewerBase.isImportDoc)):3===t&&(h.pdfViewerBase.isImportDoc=!0,h.pdfViewerBase.renderCorruptPopup(h.pdfViewerBase.isImportDoc)))}o&&4!==t&&(h.pdfViewerBase.passwordDialogReset(),h.pdfViewerBase.passwordPopup)&&h.pdfViewerBase.passwordPopup.hide(),(!s||o&&4!==t)&&3!==t&&h.importDocuments(n,h.importedDocumentName,i)}}):(this.pdfViewerBase.loadRequestHandler.send(l),this.pdfViewerBase.loadRequestHandler.onSuccess=function(e){var t=e.data;if(t){if("object"!=typeof t)try{t=JSON.parse(t)}catch(e){r.pdfViewerBase.onControlError(500,t,r.pdfViewer.serverActionSettings.load),t=null}if(t){for(;"object"!=typeof t;)if(t=JSON.parse(t),"number"==typeof parseInt(t,10)&&!isNaN(parseInt(t,10))){t=parseInt(t,10);break}t.uniqueId!==a&&("number"!=typeof parseInt(t,10)||isNaN(parseInt(t,10)))||(4===t?(r.pdfViewerBase.isImportDoc=!0,s=!0,r.pdfViewerBase.renderPasswordPopup(i,n,r.pdfViewerBase.isImportDoc)):3===t&&(r.pdfViewerBase.isImportDoc=!0,r.pdfViewerBase.renderCorruptPopup(r.pdfViewerBase.isImportDoc)))}o&&4!==t&&(r.pdfViewerBase.passwordDialogReset(),r.pdfViewerBase.passwordPopup)&&r.pdfViewerBase.passwordPopup.hide(),(!s||o&&4!==t)&&3!==t&&r.importDocuments(n,r.importedDocumentName,i)}}))},VVt.prototype.importDocuments=function(r,s,a){if(this.pdfViewer.pageOrganizerSettings.canImport){var l=this;if(1===this.tileAreaDiv.querySelectorAll(".e-pv-organize-node-selection-ring").length)for(var h=this,e=0;e<l.tileAreaDiv.childElementCount;e++)!function(e){var t,i,n,o,e=l.tileAreaDiv.childNodes[parseInt(e.toString(),10)];e instanceof HTMLElement&&e.classList.contains("e-pv-organize-node-selection-ring")&&(o=e.id.split("anchor_page_")[e.id.split("anchor_page_").length-1],t=parseInt(e.getAttribute("data-page-order"),10),o=o.split("_"),i=0,n=parseInt(o[parseInt((o.length-1).toString(),10)],10),1<o.length&&(n=parseInt(o[parseInt((o.length-2).toString(),10)],10)),i=h.getNextSubIndex(e.parentElement,n),h.importPage(t,e,r,s,!1,a),h.tileImageRender(n,i,t+1,e,!0,!1,!1,!0,s),(o=[]).push(h.clonedCollection(h.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===t+1}))),h.addOrganizeAction(o,"Import Pages",[],[],null,!1))}(e);else{var t=l.tileAreaDiv.childNodes[0],i=t.id.split("anchor_page_")[t.id.split("anchor_page_").length-1],n=parseInt(t.getAttribute("data-page-order"),10),i=i.split("_"),o=parseInt(i[parseInt((i.length-1).toString(),10)],10),o=(1<i.length&&(o=parseInt(i[parseInt((i.length-2).toString(),10)],10)),i=this.getNextSubIndex(t.parentElement,o),this.importPage(n,t,r,s,!0,a),this.tileImageRender(o,i,n,t,!0,!0,!1,!0,s),[]);o.push(this.clonedCollection(this.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===n}))),this.addOrganizeAction(o,"Import Pages",[],[],null,!1)}this.updatePageNumber(),this.updateTotalPageCount(),this.enableDisableToolbarItems(),this.disableTileCopyRotateButton(),this.disableTileDeleteButton()}},VVt.prototype.updateOrganizePageCollection=function(){this.organizePagesCollection=JSON.parse(JSON.stringify(this.tempOrganizePagesCollection))},VVt.prototype.applyElementStyles=function(e,t){var i,n,o;e&&(i=document.getElementById(this.pdfViewer.element.id+"_pageCanvas_"+t),t=document.getElementById(this.pdfViewer.element.id+"_oldCanvas_"+t),i&&0<i.offsetLeft?(n=i.offsetLeft,o=i.offsetTop,e.style.marginLeft=n+"px",e.style.marginRight=n+"px",e.style.top=o+"px"):t&&0<t.offsetLeft?(n=t.offsetLeft,o=t.offsetTop,e.style.marginLeft=n+"px",e.style.marginRight=n+"px",e.style.top=o+"px"):(e.style.marginLeft="auto",e.style.marginRight="auto",e.style.top="auto"))},VVt.prototype.onSaveasClicked=function(){var t,i=this,n=(JSON.stringify(this.tempOrganizePagesCollection)!==JSON.stringify(this.organizePagesCollection)&&(this.updateOrganizePageCollection(),this.isDocumentModified=!0,this.pdfViewerBase.updateDocumentEditedProperty(!0)),this.pdfViewer.fileName),o=JSON.parse(JSON.stringify(this.organizePagesCollection));this.pdfViewer.saveAsBlob().then(function(e){t=e,(i.pdfViewerBase.clientSideRendering?i.blobToByteArray(t):i.blobToBase64(t)).then(function(e){je(e)||""===e||i.pdfViewer.firePageOrganizerSaveAsEventArgs(n,e)&&(i.pdfViewerBase.fileDownload(e,i.pdfViewerBase,!0),i.organizePagesCollection=JSON.parse(JSON.stringify(o)))})})},VVt.prototype.rotateAllPages=function(e){var t;this.pdfViewer.pageOrganizerSettings.canRotate&&(e=e,t=this.pdfViewer.pageCount,t=Array.from({length:t},function(e,t){return t}),this.processRotation(t,e))},VVt.prototype.rotatePages=function(e,t){if(this.pdfViewer.pageOrganizerSettings.canRotate)if(Array.isArray(e))if(void 0!==t&&"number"==typeof t){var i=t;this.processRotation(e,i)}else for(var n=0,o=e;n<o.length;n++){var r=o[n];this.processRotation([r.pageIndex],r.rotationAngle)}else"number"==typeof e&&"number"==typeof t&&(e=e,t=t,i=arguments[2],this.processRotation(this.generateRange(e,t),i))},VVt.prototype.processRotation=function(e,n){if(this.pdfViewer.pageOrganizerSettings.canRotate)for(var o=this,t=0,i=e;t<i.length;t++)!function(t){var e=o.pdfRotateAngle(n),i=o.organizePagesCollection.findIndex(function(e){return e.pageIndex===t});-1!==i&&(o.organizePagesCollection[parseInt(i.toString(),10)].rotateAngle=(o.organizePagesCollection[parseInt(i.toString(),10)].rotateAngle+e+360)%360)}(i[t])},VVt.prototype.generateRange=function(i,e){return Array.from({length:e-i+1},function(e,t){return i+t})},VVt.prototype.pdfRotateAngle=function(e){var t=0;return e===RVt.RotateAngle0?t=0:e===RVt.RotateAngle90?t=90:e===RVt.RotateAngle180?t=180:e===RVt.RotateAngle270?t=270:e===RVt.RotateAngle360&&(t=0),t},VVt.prototype.createTooltip=function(e,t){null!==t&&new NS({content:ao(function(){return t}),opensOn:"Hover",beforeOpen:this.onTooltipBeforeOpen.bind(this)}).appendTo(e)},VVt.prototype.rotateClockwise=function(e){if(this.pdfViewer.pageOrganizerSettings.canRotate)for(var i=this,t=0,n=e;t<n.length;t++)!function(t){var e=i.organizePagesCollection.findIndex(function(e){return e.pageIndex===t});-1!==e&&(i.organizePagesCollection[parseInt(e.toString(),10)].rotateAngle=(i.organizePagesCollection[parseInt(e.toString(),10)].rotateAngle+90+360)%360)}(n[t])},VVt.prototype.rotateCounterclockwise=function(e){if(this.pdfViewer.pageOrganizerSettings.canRotate)for(var i=this,t=0,n=e;t<n.length;t++)!function(t){var e=i.organizePagesCollection.findIndex(function(e){return e.pageIndex===t});-1!==e&&(i.organizePagesCollection[parseInt(e.toString(),10)].rotateAngle=(i.organizePagesCollection[parseInt(e.toString(),10)].rotateAngle-90+360)%360)}(n[t])},VVt.prototype.openPageOrganizer=function(){je(this.pdfViewer.pageOrganizer)?this.pdfViewerBase.getModuleWarningMessage("PageOrganizer"):this.isAllImagesReceived&&(!F.isDevice||this.pdfViewer.enableDesktopMode?this.createOrganizeWindow():this.createOrganizeWindowForMobile())},VVt.prototype.closePageOrganizer=function(){je(this.pdfViewer.pageOrganizer)?this.pdfViewerBase.getModuleWarningMessage("PageOrganizer"):je(this.organizeDialog)||this.organizeDialog.hide()},VVt.prototype.switchPageOrganizer=function(){je(this.pdfViewer.pageOrganizer)||(!je(this.organizeDialog)&&this.organizeDialog.visible?this.closePageOrganizer():this.openPageOrganizer())},VVt.prototype.getModuleName=function(){return"PageOrganizer"},VVt.prototype.destroyDialogWindow=function(){this.removeEventListeners(),this.isOrganizeWindowOpen=!1,je(this.organizeDialog)||(this.organizeUnWireEvent(),this.organizeDialog.destroy(),this.organizeDialog=null);var e=this.pdfViewerBase.getElement("_organize_window");je(e)||e.parentElement.removeChild(e)},VVt.prototype.clear=function(){je(this.pdfViewerBase.navigationPane)||this.pdfViewerBase.navigationPane.enableOrganizeButton(!1),je(this.pdfViewer.toolbar)||this.pdfViewer.toolbar.enableToolbarItem(["OrganizePagesTool"],!1),this.destroyDialogWindow(),this.organizePagesCollection=[],this.tempOrganizePagesCollection=[],this.undoOrganizeCollection=[],this.redoOrganizeCollection=[],this.isDocumentModified=!1,this.pdfViewerBase.isImportDoc=!1,this.mobileContextMenu=[],this.dataDetails=[]},VVt.prototype.destroy=function(){return!0},VVt);function VVt(e,t){var p=this;this.dataDetails=[],this.mobileContextMenu=[],this.organizePagesCollection=[],this.tempOrganizePagesCollection=[],this.isSkipRevert=!1,this.isAllImagesReceived=!1,this.selectedPageIndexes=[],this.autoScrollInterval=null,this.gapBetweenDivs=48,this.isDocumentModified=!1,this.undoOrganizeCollection=[],this.redoOrganizeCollection=[],this.toolbarUndoRedoCollection=[],this.isTouchEvent=!1,this.isOrganizeWindowOpen=!1,this.pageDragDrop=function(e){e=e.target.closest(".e-pv-organize-anchor-node"),e=parseInt(e.getAttribute("data-page-order"),10);p.dragEndIndex=e,p.movePDFpages(p.selectedPageIndexes,p.dragEndIndex,p.isRightInsertion)},this.thumbnailMouseOver=function(e){var t=p;if(e.currentTarget instanceof HTMLElement)for(var i=0,n=Array.from(e.currentTarget.children);i<n.length;i++)for(var o=n[i],r=0,s=Array.from(o.children);r<s.length;r++){var a=s[r];if(!a.classList.contains("e-pv-image-container"))if(a.style.display="flex",a.classList.contains("e-checkbox-wrapper"))a.children[0].style.display="block";else if(a.classList.contains("e-pv-organize-buttondiv")&&0<a.childElementCount)for(var l=0,h=Array.from(a.children);l<h.length;l++){var d=h[l];!(1<t.totalCheckedCount)||"insert"===d.id.split("_")[1]?d.style.display="flex":d.style.display="none"}}},this.thumbnailMouseLeave=function(e){if(e.currentTarget instanceof HTMLElement)for(var t=0,i=Array.from(e.currentTarget.children);t<i.length;t++)for(var n=i[t],o=0,r=Array.from(n.children);o<r.length;o++){var s=r[o];s.classList.contains("e-pv-image-container")||(e.currentTarget.classList.contains("e-pv-organize-node-selection-ring")&&s.classList.contains("e-checkbox-wrapper")?s.style.display="block":s.style.display="none")}},this.onSelectClick=function(e){var t=event.currentTarget.querySelector(".e-pv-organize-tile-checkbox"),i=t.closest(".e-pv-organize-anchor-node");if("mouse"!==e.event.pointerType&&(p.isTouchEvent||F.isDevice&&!p.pdfViewer.enableDesktopMode))!("touch"===e.event.pointerType||p.isTouchEvent||F.isDevice&&!p.pdfViewer.enableDesktopMode)||je(t)||je(i)||i&&p.setSelectionRingStyle(t,i);else if(!p.isClickedOnCheckBox||je(t)||je(i)){if(!je(t)&&!je(i)){if(!p.ctrlKey&&!p.shiftKey){var n=document.querySelectorAll(".e-pv-organize-node-selection-ring");if(0<n.length)for(var o=0;o<n.length;o++){var r=n[parseInt(o.toString(),10)].closest(".e-pv-organize-anchor-node").querySelector(".e-pv-organize-tile-checkbox");r.checked=!1,p.setSelectionRingStyle(r,n[parseInt(o.toString(),10)])}p.isClickedOnCheckBox||(t.checked=!0)}p.shiftKey&&(t.checked=!0),p.setSelectionRingStyle(t,i)}}else i&&p.setSelectionRingStyle(t,i);if(p.updateSelectAllCheckbox(),p.enableDisableToolbarItems(),1<p.totalCheckedCount)for(o=0;o<i.querySelector(".e-pv-organize-buttondiv").childElementCount;o++)"insert"===i.querySelector(".e-pv-organize-buttondiv").children[parseInt(o.toString(),10)].id.split("_")[1]?i.querySelector(".e-pv-organize-buttondiv").children[parseInt(o.toString(),10)].style.display="flex":i.querySelector(".e-pv-organize-buttondiv").children[parseInt(o.toString(),10)].style.display="none"},this.rotateButtonClick=function(e){var t,i;p.pdfViewer.pageOrganizerSettings.canRotate&&(i=(e=e.currentTarget.closest(".e-pv-organize-anchor-node")).querySelector(".e-pv-organize-image"),t=parseInt(e.getAttribute("data-page-order"),10),i)&&(e=parseFloat(i.style.transform.replace("rotate(","").replace("deg)",""))||0,i.style.transform="rotate("+(e=360<=(e+=90)?0:e)+"deg)",p.updateTempRotationDetail(t,90),(i=[]).push(p.clonedCollection(p.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===t}))),p.addOrganizeAction(i,"Rotate Right",[],[],null,!1))},this.rotateLeftButtonClick=function(e){var t,i;p.pdfViewer.pageOrganizerSettings.canRotate&&(i=(e=e.currentTarget.closest(".e-pv-organize-anchor-node")).querySelector(".e-pv-organize-image"),t=parseInt(e.getAttribute("data-page-order"),10),i)&&(e=parseFloat(i.style.transform.replace("rotate(","").replace("deg)",""))||0,i.style.transform="rotate("+(e=-90===(e=360<=(e-=90)?0:e)?270:e)+"deg)",p.updateTempRotationDetail(t,-90),(i=[]).push(p.clonedCollection(p.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===t}))),p.addOrganizeAction(i,"Rotate Left",[],[],null,!1))},this.onToolbarRightButtonClick=function(){if(p.pdfViewer.pageOrganizerSettings.canRotate){for(var n=p,e=0;e<n.tileAreaDiv.childElementCount;e++)!function(e){var t,i,e=n.tileAreaDiv.childNodes[parseInt(e.toString(),10)];e instanceof HTMLElement&&e.classList.contains("e-pv-organize-node-selection-ring")&&(t=e.querySelector(".e-pv-organize-image"),i=parseInt(e.getAttribute("data-page-order"),10),t)&&(e=parseFloat(t.style.transform.replace("rotate(","").replace("deg)",""))||0,t.style.transform="rotate("+(e=360<=(e+=90)?0:e)+"deg)",p.updateTempRotationDetail(i,90),p.toolbarUndoRedoCollection.push(p.clonedCollection(p.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===i}))))}(e);p.addOrganizeAction(null,"Toolbar Rotate Right",p.toolbarUndoRedoCollection,[],null,!1),p.toolbarUndoRedoCollection=[]}},this.onToolbarLeftButtonClick=function(){for(var n=p,e=0;e<n.tileAreaDiv.childElementCount;e++)!function(e){var t,i,e=n.tileAreaDiv.childNodes[parseInt(e.toString(),10)];e instanceof HTMLElement&&e.classList.contains("e-pv-organize-node-selection-ring")&&(t=e.querySelector(".e-pv-organize-image"),i=parseInt(e.getAttribute("data-page-order"),10),t)&&(e=parseFloat(t.style.transform.replace("rotate(","").replace("deg)",""))||0,t.style.transform="rotate("+(e=-90===(e=360<=(e-=90)?0:e)?270:e)+"deg)",p.updateTempRotationDetail(i,-90),p.toolbarUndoRedoCollection.push(p.clonedCollection(p.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===i}))))}(e);p.addOrganizeAction(null,"Toolbar Rotate Left",p.toolbarUndoRedoCollection,[],null,!1),p.toolbarUndoRedoCollection=[]},this.onToolbarCopyButtonClick=function(){if(p.pdfViewer.pageOrganizerSettings.canCopy){for(var r=p,e=0;e<r.tileAreaDiv.childElementCount;e++)!function(e){var t,i,n,o,e=r.tileAreaDiv.childNodes[parseInt(e.toString(),10)];e instanceof HTMLElement&&e.classList.contains("e-pv-organize-node-selection-ring")&&(i=e.id.split("anchor_page_")[e.id.split("anchor_page_").length-1],t=parseInt(e.getAttribute("data-page-order"),10),i=i.split("_"),n=0,o=parseInt(i[parseInt((i.length-1).toString(),10)],10),1<i.length&&(o=parseInt(i[parseInt((i.length-2).toString(),10)],10)),n=p.getNextSubIndex(e.parentElement,o),p.copyPage(t,e),p.tileImageRender(o,n,t+1,e,!0,!1,!1),p.updatePageNumber(),p.toolbarUndoRedoCollection.push(p.clonedCollection(p.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===t+1}))))}(e);p.updateTotalPageCount(),p.disableTileDeleteButton(),p.addOrganizeAction(null,"Toolbar Copy",p.toolbarUndoRedoCollection,[],null,!1),p.toolbarUndoRedoCollection=[]}},this.onToolbarDeleteButtonClick=function(){var t,e;p.pdfViewer.pageOrganizerSettings.canDelete&&((e=(t=p).tileAreaDiv.querySelectorAll(".e-pv-organize-node-selection-ring")).forEach(function(e){var e=e.closest(".e-pv-organize-anchor-node"),t=parseInt(e.getAttribute("data-page-order"),10);p.toolbarUndoRedoCollection.push(p.clonedCollection(p.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===t})))}),e.forEach(function(e){e=e.closest(".e-pv-organize-anchor-node");t.deletePageElement(e)})),p.enableDisableToolbarItems(),p.addOrganizeAction(null,"Toolbar Delete",p.toolbarUndoRedoCollection,[],null,!1),p.toolbarUndoRedoCollection=[]},this.undo=function(){var e=p.undoOrganizeCollection.pop();if(e){var n=JSON.parse(JSON.stringify(e));switch(n.action){case"Insert Right":case"Insert Left":case"Import Pages":case"Copy":p.removePage(n.UndoRedoTileActions[0].currentPageIndex);break;case"Rotate Right":p.rotateImage(n.UndoRedoTileActions[0].currentPageIndex,-90);break;case"Rotate Left":p.rotateImage(n.UndoRedoTileActions[0].currentPageIndex,90);break;case"Delete":var t=p.tileAreaDiv.childNodes[parseInt(n.UndoRedoTileActions[0].currentPageIndex.toString(),10)];n.UndoRedoTileActions[0].isCopied?(p.insertRemovedPages(n.UndoRedoTileActions[0],n.UndoRedoTileActions[0].currentPageIndex,t),p.tileImageRender(n.UndoRedoTileActions[0].copiedPageIndex,0,n.UndoRedoTileActions[0].currentPageIndex,t,!0,!0,!1)):n.UndoRedoTileActions[0].isInserted?(p.insertRemovedPages(n.UndoRedoTileActions[0],n.UndoRedoTileActions[0].currentPageIndex,t),p.tileImageRender(n.UndoRedoTileActions[0].copiedPageIndex,0,n.UndoRedoTileActions[0].currentPageIndex,t,!0,!0,!0)):n.UndoRedoTileActions[0].isImportedDoc?(p.insertRemovedPages(n.UndoRedoTileActions[0],n.UndoRedoTileActions[0].currentPageIndex,t),p.tileImageRender(n.UndoRedoTileActions[0].copiedPageIndex,0,n.UndoRedoTileActions[0].currentPageIndex,t,!0,!0,!1,!0,n.UndoRedoTileActions[0].documentName)):n.UndoRedoTileActions[0].isCopied||n.UndoRedoTileActions[0].isInserted||n.UndoRedoTileActions[0].isImportedDoc||(p.undoDeletedPage(n.UndoRedoTileActions[0].currentPageIndex,n.UndoRedoTileActions[0].pageIndex,n.UndoRedoTileActions[0].rotateAngle,t),p.tileImageRender(n.UndoRedoTileActions[0].pageIndex,0,n.UndoRedoTileActions[0].currentPageIndex,t,!0,!0,!1)),p.updatePageDetail();break;case"Move Pages":for(var o=n.dropIndex,r=[],s=[],a=new Set,l=function(e,t,i){return e<=i&&i<=t},i=0;i<n.UndoRedoTileActions.length;i++)!function(e){var t,i=n.UndoRedoTileActions[parseInt(e.toString(),10)],e=p.tempOrganizePagesCollection.find(function(e){return i.isCopied?e.copiedPageIndex===i.copiedPageIndex&&l(o-n.selectedPagesIndexes.length,o+n.selectedPagesIndexes.length,e.currentPageIndex)&&!a.has(e.currentPageIndex):i.isInserted?e.copiedPageIndex===i.copiedPageIndex&&e.isInserted&&l(o-n.selectedPagesIndexes.length,o+n.selectedPagesIndexes.length,e.currentPageIndex)&&!a.has(e.currentPageIndex):i.isImportedDoc?e.copiedPageIndex===i.copiedPageIndex&&e.isImportedDoc&&l(o-n.selectedPagesIndexes.length,o+n.selectedPagesIndexes.length,e.currentPageIndex)&&!a.has(e.currentPageIndex):e.pageIndex===i.pageIndex});e&&(t=[e.currentPageIndex],a.add(e.currentPageIndex),(o<i.currentPageIndex?s:r).push({currentPageIndex:i.currentPageIndex,selectedIndexes:t}))}(i);if(0<r.length){r.sort(function(e,t){return e.currentPageIndex-t.currentPageIndex});for(var h=0;h<r.length;h++)p.rearrangePages(r[parseInt(h.toString(),10)].selectedIndexes,r[parseInt(h.toString(),10)].currentPageIndex,r[parseInt(h.toString(),10)].currentPageIndex>r[parseInt(h.toString(),10)].selectedIndexes[0])}if(0<s.length){s.sort(function(e,t){return t.currentPageIndex-e.currentPageIndex});for(h=0;h<s.length;h++)p.rearrangePages(s[parseInt(h.toString(),10)].selectedIndexes,s[parseInt(h.toString(),10)].currentPageIndex,s[parseInt(h.toString(),10)].currentPageIndex>s[parseInt(h.toString(),10)].selectedIndexes[0])}break;case"Toolbar Rotate Right":p.rotateImages(n,-90);break;case"Toolbar Rotate Left":p.rotateImages(n,90);break;case"Toolbar Copy":if(0<n.toolbarActions.length)for(i=n.toolbarActions.length-1;0<=i;i--){t=p.tileAreaDiv.childNodes[parseInt(n.toolbarActions[parseInt(i.toString(),10)].currentPageIndex.toString(),10)];p.deleteTempPage(n.toolbarActions[parseInt(i.toString(),10)].currentPageIndex,t),p.tileAreaDiv.removeChild(t),p.updatePageDetail()}p.disableTileDeleteButton();break;case"Toolbar Delete":if(0<n.toolbarActions.length)for(i=0;i<n.toolbarActions.length;i++){t=p.tileAreaDiv.childNodes[parseInt(n.toolbarActions[parseInt(i.toString(),10)].currentPageIndex.toString(),10)];n.toolbarActions[parseInt(i.toString(),10)].isCopied?(p.insertRemovedPages(n.toolbarActions[parseInt(i.toString(),10)],n.toolbarActions[parseInt(i.toString(),10)].currentPageIndex,t),p.tileImageRender(n.toolbarActions[parseInt(i.toString(),10)].copiedPageIndex,0,n.toolbarActions[parseInt(i.toString(),10)].currentPageIndex,t,!0,!0,!1)):n.toolbarActions[parseInt(i.toString(),10)].isInserted?(p.insertRemovedPages(n.toolbarActions[parseInt(i.toString(),10)],n.toolbarActions[parseInt(i.toString(),10)].currentPageIndex,t),p.tileImageRender(n.toolbarActions[parseInt(i.toString(),10)].copiedPageIndex,0,n.toolbarActions[parseInt(i.toString(),10)].currentPageIndex,t,!0,!0,!0)):n.toolbarActions[parseInt(i.toString(),10)].isImportedDoc?(p.insertRemovedPages(n.toolbarActions[parseInt(i.toString(),10)],n.toolbarActions[parseInt(i.toString(),10)].currentPageIndex,t),p.tileImageRender(n.toolbarActions[parseInt(i.toString(),10)].copiedPageIndex,0,n.toolbarActions[parseInt(i.toString(),10)].currentPageIndex,t,!0,!0,!1,!0,n.toolbarActions[parseInt(i.toString(),10)].documentName)):n.toolbarActions[parseInt(i.toString(),10)].isCopied||n.toolbarActions[parseInt(i.toString(),10)].isInserted||n.toolbarActions[parseInt(i.toString(),10)].isImportedDoc||(p.undoDeletedPage(n.toolbarActions[parseInt(i.toString(),10)].currentPageIndex,n.toolbarActions[parseInt(i.toString(),10)].pageIndex,n.toolbarActions[parseInt(i.toString(),10)].rotateAngle,t),p.tileImageRender(n.toolbarActions[parseInt(i.toString(),10)].pageIndex,0,n.toolbarActions[parseInt(i.toString(),10)].currentPageIndex,t,!0,!0,!1)),p.updatePageDetail()}p.disableTileDeleteButton()}}p.redoOrganizeCollection.push(e),p.enableDisableToolbarItems(),p.updateUndoRedoButtons()},this.redo=function(){var e=p.redoOrganizeCollection.pop();if(e){var t=JSON.parse(JSON.stringify(e));switch(t.action){case"Insert Right":case"Insert Left":var i=p.tileAreaDiv.childNodes[parseInt(t.UndoRedoTileActions[0].currentPageIndex.toString(),10)];p.insertRemovedPages(t.UndoRedoTileActions[0],t.UndoRedoTileActions[0].currentPageIndex,i),p.tileImageRender(t.UndoRedoTileActions[0].copiedPageIndex,0,t.UndoRedoTileActions[0].currentPageIndex,i,!0,!0,!0),p.disableTileCopyButton(),p.updatePageDetail();break;case"Rotate Right":p.rotateImage(t.UndoRedoTileActions[0].currentPageIndex,90);break;case"Rotate Left":p.rotateImage(t.UndoRedoTileActions[0].currentPageIndex,-90);break;case"Copy":i=p.tileAreaDiv.childNodes[parseInt(t.UndoRedoTileActions[0].currentPageIndex.toString(),10)];p.insertRemovedPages(t.UndoRedoTileActions[0],t.UndoRedoTileActions[0].currentPageIndex,i),p.tileImageRender(t.UndoRedoTileActions[0].copiedPageIndex,0,t.UndoRedoTileActions[0].currentPageIndex,i,!0,!0,!1),p.updatePageDetail();break;case"Import Pages":i=p.tileAreaDiv.childNodes[parseInt(t.UndoRedoTileActions[0].currentPageIndex.toString(),10)];p.insertRemovedPages(t.UndoRedoTileActions[0],t.UndoRedoTileActions[0].currentPageIndex,i),p.tileImageRender(t.UndoRedoTileActions[0].copiedPageIndex,0,t.UndoRedoTileActions[0].currentPageIndex,i,!0,!0,!1,!0,t.UndoRedoTileActions[0].documentName),p.disableTileCopyRotateButton();break;case"Delete":p.removePage(t.UndoRedoTileActions[0].currentPageIndex);break;case"Move Pages":p.rearrangePages(t.selectedPagesIndexes,t.dropIndex,t.isRightInsertion);break;case"Toolbar Rotate Right":p.rotateImages(t,90);break;case"Toolbar Rotate Left":p.rotateImages(t,-90);break;case"Toolbar Copy":if(0<t.toolbarActions.length)for(var n=0;n<t.toolbarActions.length;n++){i=p.tileAreaDiv.childNodes[parseInt(t.toolbarActions[parseInt(n.toString(),10)].currentPageIndex.toString(),10)];p.insertRemovedPages(t.toolbarActions[parseInt(n.toString(),10)],t.toolbarActions[parseInt(n.toString(),10)].currentPageIndex,i),p.tileImageRender(t.toolbarActions[parseInt(n.toString(),10)].copiedPageIndex,0,t.toolbarActions[parseInt(n.toString(),10)].currentPageIndex,i,!0,!0,!1),p.updatePageDetail()}p.disableTileDeleteButton();break;case"Toolbar Delete":if(0<t.toolbarActions.length)for(n=t.toolbarActions.length-1;0<=n;n--){i=p.tileAreaDiv.childNodes[parseInt(t.toolbarActions[parseInt(n.toString(),10)].currentPageIndex.toString(),10)];p.deleteTempPage(t.toolbarActions[parseInt(n.toString(),10)].currentPageIndex,i),p.tileAreaDiv.removeChild(i),p.updatePageDetail()}p.disableTileDeleteButton()}}p.undoOrganizeCollection.push(e),p.enableDisableToolbarItems(),p.updateUndoRedoButtons()},this.rotateImages=function(e,t){if(0<e.toolbarActions.length)for(var i=0;i<e.toolbarActions.length;i++){var n,o=p.tileAreaDiv.childNodes[parseInt(e.toolbarActions[parseInt(i.toString(),10)].currentPageIndex.toString(),10)].querySelector(".e-pv-organize-image");o&&(n=parseFloat(o.style.transform.replace("rotate(","").replace("deg)",""))||0,o.style.transform="rotate("+(n=(n+t+360)%360)+"deg)",p.updateTempRotationDetail(e.toolbarActions[parseInt(i.toString(),10)].currentPageIndex,t))}},this.insertRightButtonClick=function(e){var t,i,n,o;p.pdfViewer.pageOrganizerSettings.canInsert&&(o=(e=e.currentTarget).id.split("_insert_page_")[e.id.split("_insert_page_").length-1],e=e.closest(".e-pv-organize-anchor-node"),t=parseInt(e.getAttribute("data-page-order"),10),o=o.split("_"),i=0,n=parseInt(o[parseInt((o.length-1).toString(),10)],10),1<o.length&&(n=parseInt(o[parseInt((o.length-2).toString(),10)],10)),i=p.getNextSubIndex(e.parentElement,n),p.insertTempPage(t,!1,e),p.tileImageRender(n,i,t+1,e,!0,!1,!0),p.updateTotalPageCount(),p.updatePageNumber(),p.disableTileDeleteButton(),p.disableTileCopyButton(),p.updateSelectAllCheckbox(),p.enableDisableToolbarItems(),(o=[]).push(p.clonedCollection(p.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===t+1}))),p.addOrganizeAction(o,"Insert Right",[],[],null,!1))},this.insertLeftButtonClick=function(e){var t,i,n,o;p.pdfViewer.pageOrganizerSettings.canInsert&&(o=(e=e.currentTarget).id.split("_insert_page_")[e.id.split("_insert_page_").length-1],e=e.closest(".e-pv-organize-anchor-node"),t=parseInt(e.getAttribute("data-page-order"),10),o=o.split("_"),i=0,n=parseInt(o[parseInt((o.length-1).toString(),10)],10),1<o.length&&(n=parseInt(o[parseInt((o.length-2).toString(),10)],10)),i=p.getNextSubIndex(e.parentElement,n),p.insertTempPage(t,!0,e),p.tileImageRender(n,i,t,e,!0,!0,!0),p.updateTotalPageCount(),p.updatePageNumber(),p.disableTileDeleteButton(),p.disableTileCopyButton(),p.updateSelectAllCheckbox(),p.enableDisableToolbarItems(),(o=[]).push(p.clonedCollection(p.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===t}))),p.addOrganizeAction(o,"Insert Left",[],[],null,!1))},this.copyButtonClick=function(e){var t,i,n,o;p.pdfViewer.pageOrganizerSettings.canCopy&&(o=(e=e.currentTarget).id.split("_copy_page_")[e.id.split("_copy_page_").length-1],e=e.closest(".e-pv-organize-anchor-node"),t=parseInt(e.getAttribute("data-page-order"),10),o=o.split("_"),i=0,n=parseInt(o[parseInt((o.length-1).toString(),10)],10),1<o.length&&(n=parseInt(o[parseInt((o.length-2).toString(),10)],10)),i=p.getNextSubIndex(e.parentElement,n),p.copyPage(t,e),p.tileImageRender(n,i,t+1,e,!0,!1,!1),p.updateTotalPageCount(),p.updatePageNumber(),p.disableTileDeleteButton(),(o=[]).push(p.clonedCollection(p.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===t+1}))),p.addOrganizeAction(o,"Copy",[],[],null,!1))},this.deleteButtonClick=function(e){var t,i;p.pdfViewer.pageOrganizerSettings.canDelete&&(e=e.currentTarget.closest(".e-pv-organize-anchor-node"),t=parseInt(e.getAttribute("data-page-order"),10),(i=[]).push(p.clonedCollection(p.tempOrganizePagesCollection.find(function(e){return e.currentPageIndex===t}))),p.addOrganizeAction(i,"Delete",[],[],null,!1),p.deletePageElement(e)),p.updateSelectAllCheckbox(),p.enableDisableToolbarItems()},this.pdfViewer=e,this.pdfViewerBase=t}(zVt=RVt=RVt||{})[zVt.RotateAngle0=1]="RotateAngle0",zVt[zVt.RotateAngle90=2]="RotateAngle90",zVt[zVt.RotateAngle180=3]="RotateAngle180",zVt[zVt.RotateAngle270=4]="RotateAngle270",zVt[zVt.RotateAngle360=1]="RotateAngle360";function _Vt(e,t){this.pageIndex=e,this.rotationAngle=t}var HVt=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u,g){this.currentPageIndex=e,this.pageIndex=t,this.copiedPageIndex=i,this.isInserted=n,this.isDeleted=o,this.isCopied=r,this.istargetCopied=s,this.hasEmptyPageAfter=a,this.hasEmptyPageBefore=l,this.rotateAngle=h,this.pageSize=d,this.isImportedDoc=p,this.documentName=c,this.password=u,this.documentData=g},zVt=(Bft.Inject(ist,d,vft,Tft,Vft,Rft,V2t,B2t,O2t,sft,W2t,z2t,NVt),Object.freeze({__proto__:null,Drawing:Lwt,findActiveElement:gCt,findObjectsUnderMouse:mCt,findObjectUnderMouse:fCt,CalculateLeaderPoints:yCt,findElementUnderMouse:vCt,insertObject:bCt,findTargetShapeElement:wCt,findObjects:CCt,findActivePage:function(e){var t=void 0;return e.target&&e.target.wrapper?e.target.pageIndex:e.target&&0<(e=e.target.id.split("_")).length?parseInt(e[e.length-1],10):t},ActiveElements:VCt,getConnectorPoints:lwt,getSegmentPath:hwt,updateSegmentElement:dwt,getSegmentElement:pwt,updateDecoratorElement:cwt,getDecoratorElement:uwt,clipDecorators:gwt,clipDecorator:mwt,initDistanceLabel:fwt,updateDistanceLabel:ywt,updateRadiusLabel:vwt,initPerimeterLabel:bwt,updatePerimeterLabel:wwt,removePerimeterLabel:function(e){for(var t=0;t<e.wrapper.children.length;t++){var i=e.wrapper.children[parseInt(t.toString(),10)];i&&!je(i.content)&&e.wrapper.children.splice(t,1)}},updateCalibrateLabel:Cwt,getPolygonPath:Swt,textElement:Awt,initLeaders:xwt,initLeader:Iwt,isPointOverConnector:Twt,findNearestPoint:Ewt,getDecoratorShape:Dwt,renderAdornerLayer:HCt,createSvg:zCt,isLineShapes:$bt,setElementStype:ewt,findPointsLength:twt,findPerimeterLength:function(e){return Cbt.getLengthFromListOfPoints(e)},getBaseShapeAttributes:iwt,getFunction:nwt,cloneObject:owt,cloneArray:rwt,getInternalProperties:swt,isLeader:awt,PdfBounds:Mft,PdfFont:Cft,PdfAnnotationBase:jbt,PdfFormFieldBase:Ubt,ZOrderPageTable:Gbt,Selector:Jbt,ToolBase:nft,SelectTool:_wt,MoveTool:jwt,StampTool:Uwt,InkDrawingTool:Ywt,ConnectTool:Jwt,ResizeTool:eCt,NodeDrawingTool:nCt,PolygonDrawingTool:sCt,LineTool:hCt,RotateTool:cCt,Annotation:sft,AnnotationBaseSettings:ZSt,AnnotBoundsRect:$St,AnnotBoundsBase:eAt,AnnotRectBase:tAt,AnnotFontBase:iAt,IBounds:nAt,AnnotationsInternal:oAt,AnnotationsBase:rAt,LinkAnnotation:ist,TextMarkupAnnotation:hAt,MeasureAnnotation:pAt,ShapeAnnotation:uAt,StampAnnotation:mAt,StickyNotesAnnotation:yAt,FreeTextAnnotation:jCt,InputElement:QCt,InkAnnotation:S1t,NavigationPane:gLt,PdfViewerBase:ARt,TextLayer:xRt,ContextMenu:TRt,get CommentStatus(){return SCt},get FontStyle(){return ACt},get ContextMenuItem(){return xCt},get SignatureType(){return ICt},get AnnotationResizerLocation(){return TCt},get ExtractTextOption(){return ECt},get DisplayMode(){return DCt},get CursorType(){return MCt},get DynamicStampItem(){return kCt},get SignStampItem(){return PCt},get StandardBusinessStampItem(){return BCt},get AllowedInteraction(){return FCt},get AnnotationDataFormat(){return LCt},get FormFieldDataFormat(){return RCt},get ModifierKeys(){return OCt},get PdfKeys(){return NCt},AjaxHandler:DRt,Signature:kRt,Spinner:function(e,t,i,n){switch(e){case"Create":GLt({type:n,target:document.querySelector(t.target),cssClass:t.cssClass,label:t.label,width:t.width});break;case"Show":aRt(document.querySelector(i));break;case"Hide":hRt(document.querySelector(i));break;case"Set":dRt({cssClass:t.cssClass,type:n})}},createSpinner:GLt,showSpinner:aRt,hideSpinner:hRt,setSpinner:dRt,BlazorUiAdaptor:pRt,Magnification:vft,Navigation:Rft,ThumbnailView:Tft,Toolbar:Vft,AnnotationToolbar:VRt,FormDesignerToolbar:RRt,ToolbarSettings:Gmt,CustomToolbarItem:X$e,AjaxRequestSettings:Wo,CustomStamp:Met,AnnotationToolbarSettings:Cet,FormDesignerToolbarSettings:ts,SignatureFieldSettings:d$,InitialFieldSettings:zmt,SignatureIndicatorSettings:Qmt,SignatureDialogSettings:ost,ServerActionSettings:jee,StrikethroughSettings:det,UnderlineSettings:q$e,HighlightSettings:h,LineSettings:mft,ArrowSettings:cft,RectangleSettings:SOt,CircleSettings:IOt,ShapeLabelSettings:DOt,PolygonSettings:POt,StampSettings:LOt,CustomStampSettings:NOt,DistanceSettings:HOt,PerimeterSettings:WOt,AreaSettings:qOt,RadiusSettings:XOt,VolumeSettings:ZOt,InkAnnotationSettings:tNt,StickyNotesSettings:oNt,MeasurementSettings:aNt,FreeTextSettings:dNt,AnnotationSelectorSettings:uNt,TextSearchColorSettings:fNt,PageInfo:bNt,HandWrittenSignatureSettings:SNt,AnnotationSettings:INt,DocumentTextCollectionSettings:DNt,TextDataSettings:PNt,RectangleBounds:LNt,TileRenderingSettings:NNt,ScrollSettings:HNt,FormField:WNt,ContextMenuSettings:qNt,TextFieldSettings:XNt,PasswordFieldSettings:ZNt,CheckBoxFieldSettings:t2t,RadioButtonFieldSettings:o2t,DropdownFieldSettings:a2t,ListBoxFieldSettings:d2t,Item:u2t,KeyGesture:f2t,KeyboardCommand:b2t,CommandManager:S2t,PageOrganizerSettings:I2t,SearchResult:D2t,PdfViewer:Bft,BookmarkView:d,TextSelection:B2t,TextSearch:O2t,Print:V2t,FormFields:z2t,FormDesigner:W2t,AccessibilityTags:U2t,RectBounds:G2t,PdfiumRunner:Y2t,PageRenderer:X2t,StampAnnotationBase:J2t,PdfRenderer:Z2t,SizeBase:iVt,Annotations:nVt,FormFieldsBase:rVt,PdfRenderedFields:aVt,AnnotationRenderer:lVt,PointBase:dVt,FreeTextAnnotationBase:cVt,InkSignatureAnnotation:uVt,ShapeAnnotationBase:gVt,MeasureShapeAnnotationBase:mVt,SignatureAnnotationBase:fVt,PopupAnnotationBase:bVt,TextMarkupAnnotationBase:wVt,PdfLayer:pVt,AnnotPoint:CVt,AnnotBounds:SVt,AnnotColor:AVt,FontBase:xVt,Path:IVt,RectangleBase:EVt,SignatureBase:DVt,BookmarkBase:kVt,BookmarkDestination:PVt,BookmarkStyles:BVt,getArialFontData:oVt,ImageStructureBase:FVt,PageOrganizer:NVt,get PdfPageRotateAngle(){return RVt},PageRotation:_Vt,OrganizeDetails:HVt})),Mft=Object.freeze({__proto__:null,_PdfBaseStream:SPt,_PdfStream:IPt,_PdfContentStream:DPt,_PdfNullStream:PPt,_ContentParser:FPt,_ContentLexer:RPt,_PdfRecord:NPt,_PdfDecodeStream:Xet,_PdfDecryptStream:WPt,get PdfAnnotationFlag(){return bAt},get PdfLineEndingStyle(){return wAt},get PdfLineIntent(){return CAt},get PathPointType(){return SAt},get PdfLineCaptionType(){return AAt},get PdfBorderStyle(){return xAt},get PdfBorderEffectStyle(){return IAt},get PdfRotationAngle(){return TAt},get PdfCrossReferenceType(){return EAt},get PdfHighlightMode(){return DAt},get PdfTextAlignment(){return MAt},get PdfFormFieldVisibility(){return kAt},get PdfMeasurementUnit(){return PAt},get PdfCircleMeasurementType(){return BAt},get PdfRubberStampAnnotationIcon(){return FAt},get PdfCheckBoxStyle(){return LAt},get PdfTextMarkupAnnotationType(){return RAt},get PdfPopupIcon(){return OAt},get PdfAnnotationState(){return NAt},get PdfAnnotationStateModel(){return VAt},get PdfAttachmentIcon(){return _At},get PdfAnnotationIntent(){return HAt},get PdfDestinationMode(){return zAt},get DataFormat(){return jAt},get PdfFormFieldsTabOrder(){return WAt},get _PdfAnnotationType(){return QAt},get _PdfGraphicsUnit(){return UAt},get _FieldFlag(){return qAt},get _SignatureFlag(){return GAt},get _PdfCheckFieldState(){return YAt},get PdfPermissionFlag(){return XAt},get PdfPageOrientation(){return KAt},get PdfTextDirection(){return JAt},get PdfSubSuperScript(){return ZAt},get PdfBlendMode(){return $At},get PdfFillMode(){return e1t},get PdfDashStyle(){return t1t},get PdfLineCap(){return i1t},get PdfLineJoin(){return n1t},get _PdfWordWrapType(){return o1t},get _FontDescriptorFlag(){return r1t},get _TrueTypeCmapFormat(){return s1t},get _TrueTypeCmapEncoding(){return a1t},get _TrueTypePlatformID(){return l1t},get _TrueTypeMicrosoftEncodingID(){return h1t},get _TrueTypeMacintoshEncodingID(){return d1t},get _TrueTypeCompositeGlyphFlag(){return p1t},get _ImageFormat(){return c1t},get _TokenType(){return u1t},get PdfTextStyle(){return g1t},get _PdfColorSpace(){return m1t},get PdfNumberStyle(){return f1t},get PdfUnorderedListStyle(){return y1t},get PdfLayoutType(){return v1t},get PdfLayoutBreakType(){return b1t},get PdfListMarkerAlignment(){return w1t},get PdfPrintState(){return C1t},_PdfFlateStream:ZPt,PdfAction:Z$e,PdfGoToAction:QIt,PdfFieldActions:qIt,_PdfCatalog:eBt,_PdfCrossReference:KBt,PdfDocument:kFt,PdfAnnotationExportSettings:BFt,PdfFormFieldExportSettings:LFt,PdfPageSettings:OFt,PdfMargins:VFt,PdfDocumentSplitEventArgs:HFt,PdfFileStructure:fFt,_PdfMergeHelper:wFt,_PdfCopier:SFt,PdfPage:PDt,PdfDestination:FDt,PdfSection:DFt,PdfBookmarkBase:SDt,PdfBookmark:IDt,PdfNamedDestination:EDt,_PdfNamedDestinationCollection:MDt,_PdfLexicalOperator:QBt,_PdfParser:qBt,_Linearization:YBt,_PdfName:k,_PdfCommand:rPt,_PdfReference:aPt,_PdfReferenceSet:hPt,_PdfReferenceSetCache:pPt,Dictionary:uPt,_PdfDictionary:mPt,_PdfNull:yPt,_clearPrimitiveCaches:vPt,_isName:bPt,_isCommand:wPt,PdfPageImportOptions:vFt,PdfPredictorStream:oBt,_toUnsigned:sMt,_toSigned16:aMt,_toSigned32:lMt,_copyRange:hMt,_checkType:dMt,_getDecoder:pMt,_checkRotation:cMt,_getPageIndex:uMt,_annotationFlagsToString:gMt,_stringToAnnotationFlags:mMt,_stringToPdfString:fMt,_stringToBytes:yMt,_areArrayEqual:vMt,_numberToString:bMt,_areNotEqual:wMt,_bytesToString:CMt,_decodeUnicodeBytes:SMt,_stringToUnicodeArray:AMt,_byteArrayToHexString:xMt,_hexStringToByteArray:IMt,_hexStringToString:TMt,_isWhiteSpace:EMt,_decode:DMt,_encode:kMt,_getInheritableProperty:PMt,_parseRectangle:BMt,_calculateBounds:FMt,_toRectangle:LMt,_fromRectangle:RMt,_getUpdatedBounds:OMt,_convertToColor:NMt,_parseColor:VMt,_mapBorderStyle:_Mt,_mapBorderEffectStyle:HMt,_reverseMapEndingStyle:zMt,_mapLineEndingStyle:jMt,_mapHighlightMode:WMt,_reverseMapHighlightMode:QMt,_reverseMapBlendMode:UMt,_mapBlendMode:qMt,_floatToString:GMt,_addProcSet:YMt,_getNewGuidString:XMt,_escapePdfName:KMt,_getBezierArc:JMt,_findPage:ZMt,_checkField:$Mt,_getItemValue:ekt,_getStateTemplate:tkt,_getColorValue:ikt,_setMatrix:nkt,_styleToString:okt,_stringToStyle:rkt,_mapMeasurementUnit:skt,_mapMarkupAnnotationType:akt,_reverseMarkupAnnotationType:lkt,_mapGraphicsUnit:hkt,_mapRubberStampIcon:dkt,_mapPopupIcon:pkt,_reverseMapAnnotationState:ckt,_mapAnnotationState:ukt,_reverseMapAnnotationStateModel:gkt,_mapAnnotationStateModel:mkt,_mapAttachmentIcon:fkt,_mapAnnotationIntent:ykt,_reverseMapPdfFontStyle:vkt,_getSpecialCharacter:bkt,_getLatinCharacter:wkt,_encodeValue:function(e){for(var t="",i=0;i<e.length;i++){var n=255&e.charCodeAt(i),o=String.fromCharCode(n),r="";switch(o){case" ":case"%":case"(":case")":case"<":case">":case"[":case"]":case"{":case"}":case"/":case"#":t=(t+="#")+(1===(r=n.toString(16).toUpperCase()).length?"0"+r:r);break;default:126<n||n<37?t=(t+="#")+(1===(r=n.toString(16).toUpperCase()).length?"0"+r:r):t+=o}}return t},_getCommentsOrReview:function(e,t){return t?e.reviewHistory:e.comments},_checkReview:Ckt,_checkComment:Skt,_updateVisibility:Akt,_removeDuplicateReference:xkt,_removeDuplicateFromResources:Ikt,_removeReferences:Tkt,BaseException:Dkt,FormatError:Mkt,ParserEndOfFileException:Bkt,_defaultToString:Lkt,_obtainFontDetails:Rkt,_getFontStyle:Okt,_mapFont:Nkt,_tryParseFontStream:Vkt,_getFontFromDescriptor:_kt,_checkInkPoints:Hkt,_obtainDestination:zkt,_updateBounds:jkt,_decodeText:Wkt,_getSize:Qkt,_stringToBigEndianBytes:Ukt,_convertNumber:qkt,_arabicToRoman:Gkt,_arabicToLetter:Ykt,_appendChar:Xkt,_isNullOrUndefined:Kkt,_isArrayEqual:function(e,t){if(e.length!==t.length)return!1;for(var i=0,n=e.length;i<n;i++)if(e[Number.parseInt(i.toString(),10)]!==t[Number.parseInt(i.toString(),10)])return!1;return!0},_defineProperty:function(e,t,i,n){return void 0===n&&(n=!1),Object.defineProperty(e,t,{value:i,enumerable:!n,configurable:!0,writable:!1}),i},_compressStream:Jkt,_isRightToLeftCharacters:Zkt,_updatePageCount:$kt,_updatePageSettings:ePt,_emptyPdfData:"JVBERi0xLjQNCiWDkvr+DQoxIDAgb2JqDQo8PA0KL1R5cGUgL0NhdGFsb2cNCi9QYWdlcyAyIDAgUg0KL0Fjcm9Gb3JtIDMgMCBSDQo+Pg0KZW5kb2JqDQoyIDAgb2JqDQo8PA0KL1R5cGUgL1BhZ2VzDQovS2lkcyBbNCAwIFJdDQovQ291bnQgMQ0KL1Jlc291cmNlcyA8PD4+DQoNCi9NZWRpYUJveCBbLjAwIC4wMCA1OTUuMDAgODQyLjAwXQ0KL1JvdGF0ZSAwDQo+Pg0KZW5kb2JqDQozIDAgb2JqDQo8PA0KL0ZpZWxkcyBbXQ0KPj4NCmVuZG9iag0KNCAwIG9iag0KPDwNCi9Db3VudCAxDQovVHlwZSAvUGFnZXMNCi9LaWRzIFs1IDAgUl0NCi9QYXJlbnQgMiAwIFINCj4+DQplbmRvYmoNCjUgMCBvYmoNCjw8DQovVHlwZSAvUGFnZQ0KL1BhcmVudCA0IDAgUg0KPj4NCmVuZG9iag0KeHJlZg0KMCA2DQowMDAwMDAwMDAwIDY1NTM1IGYNCjAwMDAwMDAwMTcgMDAwMDAgbg0KMDAwMDAwMDA4OSAwMDAwMCBuDQowMDAwMDAwMjE4IDAwMDAwIG4NCjAwMDAwMDAyNTUgMDAwMDAgbg0KMDAwMDAwMDMzNCAwMDAwMCBuDQp0cmFpbGVyDQo8PA0KL1Jvb3QgMSAwIFINCi9TaXplIDYNCj4+DQoNCnN0YXJ0eHJlZg0KMzg3DQolJUVPRg0K",PdfAnnotationCollection:yDt,PdfPopupAnnotationCollection:bDt,PdfAnnotation:TTt,PdfComment:MTt,PdfLineAnnotation:BTt,PdfCircleAnnotation:RTt,PdfEllipseAnnotation:VTt,PdfSquareAnnotation:zTt,PdfRectangleAnnotation:QTt,PdfPolygonAnnotation:GTt,PdfPolyLineAnnotation:KTt,PdfAngleMeasurementAnnotation:$Tt,PdfInkAnnotation:iEt,PdfPopupAnnotation:rEt,PdfFileLinkAnnotation:lEt,PdfUriAnnotation:pEt,PdfDocumentLinkAnnotation:gEt,PdfTextWebLinkAnnotation:yEt,PdfAttachmentAnnotation:wEt,Pdf3DAnnotation:AEt,PdfTextMarkupAnnotation:TEt,PdfWatermarkAnnotation:MEt,PdfRubberStampAnnotation:BEt,PdfSoundAnnotation:REt,PdfFreeTextAnnotation:VEt,PdfRedactionAnnotation:zEt,PdfRichMediaAnnotation:QEt,PdfWidgetAnnotation:GEt,PdfStateItem:KEt,PdfRadioButtonListItem:$Et,PdfListFieldItem:iDt,PdfAnnotationCaption:oDt,PdfAnnotationLineEndingStyle:sDt,PdfInteractiveBorder:lDt,PdfAnnotationBorder:pDt,PdfBorderEffect:uDt,_PaintParameter:mDt,PdfAppearance:ATt,_PdfPaddings:jFt,_DecompressedOutput:jDt,_DeflateStream:KDt,_Inflater:YDt,_HuffmanTree:qDt,_InBuffer:QDt,get _InflaterState(){return VDt},get _BlockType(){return _Dt},_PdfFontMetrics:k1t,_WidthTable:B1t,_StandardWidthTable:L1t,_CjkWidthTable:N1t,_CjkWidth:_1t,_CjkSameWidth:z1t,_CjkDifferentWidth:Q1t,PdfFont:Oxt,PdfStandardFont:_xt,PdfCjkStandardFont:jxt,PdfTrueTypeFont:Uxt,_PdfStandardFontMetricsFactory:Gxt,_PdfCjkStandardFontMetricsFactory:Xxt,_PdfCjkFontDescriptorFactory:eIt,get PdfFontStyle(){return Jxt},get PdfFontFamily(){return Zxt},get PdfCjkFontFamily(){return $xt},_UnicodeLine:iIt,PdfStringFormat:E1t,get PdfVerticalAlignment(){return T1t},_PdfStringLayouter:q1t,_PdfStringLayoutResult:Y1t,_LineInfo:J1t,get _LineType(){return K1t},_StringTokenizer:Z1t,_TrueTypeReader:cxt,_TrueTypeNameRecord:gxt,_TrueTypeMetrics:mxt,_TrueTypeLongHorMetric:yxt,_TrueTypeGlyph:vxt,_TrueTypeLocaTable:wxt,_TrueTypeGlyphHeader:Cxt,_BigEndianWriter:Sxt,_TrueTypeTableInfo:ext,_TrueTypeOS2Table:ixt,_TrueTypePostTable:nxt,_TrueTypeNameTable:oxt,_TrueTypeMicrosoftCmapSubTable:rxt,_TrueTypeHorizontalHeaderTable:sxt,_TrueTypeHeadTable:axt,_TrueTypeCmapTable:lxt,_TrueTypeCmapSubTable:hxt,_TrueTypeAppleCmapSubTable:dxt,_TrueTypeTrimmedCmapSubTable:pxt,_UnicodeTrueTypeFont:xxt,PdfField:XIt,PdfTextBoxField:ZIt,PdfButtonField:tTt,PdfCheckBoxField:oTt,PdfRadioButtonListField:aTt,PdfListField:dTt,PdfComboBoxField:uTt,PdfListBoxField:fTt,PdfSignatureField:bTt,_PdfDefaultAppearance:CTt,PdfForm:rFt,PdfGraphics:aIt,_PdfTransformationMatrix:hIt,_Matrix:pIt,PdfGraphicsState:gIt,get _TextRenderingMode(){return uIt},PdfBrush:fIt,PdfPen:yIt,_PdfUnitConvertor:vIt,PdfLayoutFormat:WFt,PdfLayoutResult:UFt,_PageLayoutResult:GFt,_PdfLayoutParameters:YFt,PdfPath:nIt,_PdfStreamWriter:x1t,PdfTemplate:_It,_Bidirectional:Mxt,_RtlCharacters:Pxt,_ArabicShapeRenderer:Txt,_ArabicShape:Dxt,_RtlRenderer:Fxt,_ImageDecoder:N$e,PdfBitmap:JFt,PdfImage:rIt,_PngDecoder:eMt,_JpegDecoder:HDt,_PdfEncryptor:aBt,_MD5:hBt,_Sha256:pBt,_Sha512:uBt,_Word64:mBt,_EncryptionKey:W$e,_BasicEncryption:bBt,_AdvancedEncryption:SBt,_Cipher:xBt,_NormalCipherFour:TBt,_AdvancedEncryptionBaseCipher:MBt,_AdvancedEncryption128Cipher:BBt,_AdvancedEncryption256Cipher:RBt,_NullCipher:VBt,_CipherTransform:HBt,_ExportHelper:i0,_XfdfDocument:PIt,_FontStructure:FIt,_XmlWriter:wIt,_Namespace:SIt,_XmlElement:xIt,_XmlAttribute:TIt,_FdfDocument:hFt,_FdfHelper:pFt,_JsonDocument:NIt,_XmlDocument:gFt,PdfList:oLt,PdfOrderedList:aLt,PdfUnorderedList:hft,_PdfListInfo:pLt,_PdfListLayouter:cLt,PdfListItem:$Ft,PdfListItemCollection:tLt,PdfLayerCollection:TFt,PdfLayer:xFt}),Cft=Object.freeze({__proto__:null,PdfAction:W,PdfUriAction:Jh,PdfActionLinkAnnotation:Sg,PdfAnnotation:gg,PdfAnnotationCollection:Bu,PdfDocumentLinkAnnotation:Tg,PdfLinkAnnotation:vg,PdfTextWebLink:am,PdfUriAnnotation:nm,Dictionary:ml,defaultToString:gl,PdfCatalog:ap,PdfDocument:sg,PdfDocumentBase:Xd,PdfDocumentTemplate:ju,PdfViewerPreferences:np,get PdfPageMode(){return $d},get PdfPageLayout(){return ep},get DuplexMode(){return tp},get PageScalingMode(){return ip},PdfPageNumberField:vm,PdfCompositeField:Sm,PdfPageCountField:km,PointF:ed,SizeF:td,RectangleF:id,Rectangle:nd,PdfCacheCollection:ig,PdfCollection:Pc,PdfDestination:Qg,PdfFunction:Fm,PdfSampledFunction:Hm,get PdfDestinationMode(){return Mm},ProcedureSets:Fp,get PdfHorizontalAlignment(){return Vh},get PdfVerticalAlignment(){return _h},get PdfTextAlignment(){return Hh},get TextRenderingMode(){return zh},get PdfLineJoin(){return jh},get PdfLineCap(){return Wh},get PdfDashStyle(){return Qh},get PdfFillMode(){return Uh},get PdfColorSpace(){return qh},get PdfBlendMode(){return Gh},get PdfGraphicsUnit(){return Yh},get PdfGridImagePosition(){return Xh},get PdfTextDirection(){return Kh},PdfColor:se,PdfGraphics:fu,GetResourceEventHandler:vu,PdfGraphicsState:wu,PdfMargins:Cp,PdfPen:Ep,PdfResources:lu,Guid:du,PdfTransformationMatrix:Mp,Matrix:Pp,PdfBrush:rd,PdfBrushes:jm,PdfSolidBrush:Sd,PdfLinearGradientBrush:Jm,PdfRadialGradientBrush:nf,PdfTilingBrush:gu,PdfGradientBrush:iu,PdfColorBlend:Gm,PdfBlend:s,PdfTemplate:ou,PdfLayoutElement:Hg,PdfPath:By,PdfArc:sf,PdfTextElement:$g,ElementLayouter:Dg,PdfLayoutFormat:kg,PdfLayoutParams:Bg,PdfLayoutResult:Lg,TextLayouter:Ug,TextPageLayoutResult:Yg,PdfTextLayoutResult:Xg,get PdfLayoutType(){return Xc},get PdfLayoutBreakType(){return Kc},get PathPointType(){return Jc},get PdfFontStyle(){return hd},get PdfFontFamily(){return dd},get PdfFontType(){return pd},get PdfWordWrapType(){return cd},get PdfSubSuperScript(){return ud},get FontEncoding(){return gd},get TtfCmapFormat(){return md},get TtfCmapEncoding(){return fd},get TtfPlatformID(){return yd},get TtfMicrosoftEncodingID(){return vd},get TtfMacintoshEncodingID(){return bd},get FontDescriptorFlags(){return wd},get TtfCompositeGlyphFlags(){return Cd},PdfFont:Rd,PdfFontMetrics:Bc,WidthTable:Lc,StandardWidthTable:Nc,PdfStandardFont:cg,PdfStandardFontMetricsFactory:lg,PdfStringFormat:xd,PdfStringLayouter:Dd,PdfStringLayoutResult:kd,LineInfo:Fd,get LineType(){return Bd},StringTokenizer:Td,PdfTrueTypeFont:Uy,RtlRenderer:Zc,ArabicShapeRenderer:zc,ArabicShape:Wc,Bidi:Uc,RtlCharacters:Gc,ByteArray:Yp,get ImageFormat(){return Gp},ImageDecoder:Kp,PdfBitmap:oc,PdfImage:ec,PdfTransparency:Op,get ObjectStatus(){return zd},get ObjectType(){return Yd},PdfCrossTable:hp,RegisteredObject:pp,DictionaryProperties:Cl,PdfMainObjectCollection:Qd,ObjectInfo:qd,Operators:bl,PdfStreamWriter:Ip,PdfWriter:Nd,PdfWriterHelper:_d,PdfArrayBuffer:jd,get PdfPageOrientation(){return up},get PdfPageRotateAngle(){return gp},get PdfNumberStyle(){return mp},get PdfDockStyle(){return fp},get PdfAlignmentStyle(){return yp},get TemplateType(){return vp},PageAddedEventArgs:Vu,PdfDocumentPageCollection:eg,PdfPage:Ou,PdfPageBase:ku,PdfPageLayer:Au,PdfPageLayerCollection:Du,PdfPageSettings:Ap,PdfPageSize:bp,PdfPageTemplateElement:Gy,PdfSection:Yu,PageSettingsState:Ku,PdfSectionCollection:Zu,PdfSectionPageCollection:Hu,PdfSectionTemplate:qu,PdfArray:Bl,PdfDictionary:Sl,SaveSectionCollectionEventHandler:xl,SaveDescendantFontEventHandler:Il,SaveFontDictionaryEventHandler:Tl,SaveAnnotationEventHandler:El,SaveSectionEventHandler:Dl,SaveTemplateEventHandler:Ml,PdfName:yl,PdfNumber:kl,PdfReference:Ph,PdfReferenceHolder:Fh,PdfStream:xh,SaveCmapEventHandler:Eh,SaveFontProgramEventHandler:Dh,get InternalEnum(){return Th},PdfString:Mh,PdfGridStyleBase:af,PdfGridStyle:df,PdfGridCellStyle:uf,PdfGridRowStyle:ff,get PdfHorizontalOverflowType(){return mf},PdfBorders:Og,PdfPaddings:Vg,get PdfBorderOverlapStyle(){return tf},PdfGridLayouter:Vf,PdfGridLayoutResult:zf,PdfGridLayoutFormat:Qf,GridCellEventArgs:qf,PdfGridBeginCellDrawEventArgs:Xf,PdfGridEndCellDrawEventArgs:Zf,PdfCancelEventArgs:ey,BeginPageLayoutEventArgs:ny,EndPageLayoutEventArgs:sy,PdfGridBeginPageLayoutEventArgs:hy,PdfGridEndPageLayoutEventArgs:cy,RowLayoutResult:gy,PdfGrid:Lf,PdfGridColumn:Sf,PdfGridColumnCollection:xf,PdfGridRow:Tf,PdfGridRowCollection:Df,PdfGridHeaderCollection:kf,PdfGridCell:vf,PdfGridCellCollection:wf}),jVt=(twe.Inject(zwe,TCe,Uwe,exe,aCe,$we,OCe,fSe,nCe,Ube,Fwe,gCe,Ewe,LCe,GAe,yAe,wSe,UAe,pwe,JAe,FAe,M1e),oxe.Inject(bxe,exe,Exe,Axe),WVt.prototype.chartRender=function(e,t){this.keywordIndex=je(t)?0:t,this.chartType=e[o_t[this.keywordIndex]],this.isPieType="Pie"===this.chartType||"Doughnut"===this.chartType;var t=this.chartData(e,this.chartType),i={enableAnimation:!1,width:e[XVt[this.keywordIndex]]*(96/72)+"px",height:e[KVt[this.keywordIndex]]*(96/72)+"px"};this.isPieType?this.chart=new oxe(i):(this.chart=new twe(i),this.chart.primaryXAxis=this.chartPrimaryXAxis(e[t_t[this.keywordIndex]],this.chartType),this.chart.primaryYAxis=this.chartPrimaryYAxis(e[i_t[this.keywordIndex]])),this.chart.series=this.chartSeries(e[$Vt[this.keywordIndex]],t,this.chartType);for(var n=0;n<this.chart.series.length;n++)this.chart.series[parseInt(n.toString(),10)].animation.enable=!1;this.chart.title=e[n_t[this.keywordIndex]],this.chart.legendSettings=this.parseChartLegend(e[e_t[this.keywordIndex]])},WVt.prototype.convertChartToImage=function(d,p,c){var u=this;return new Promise(function(t,e){var i=u.getControlsValue([d],p,c),n=i.width,o=i.height,r=Q("canvas"),s=Math.max(1,window.devicePixelRatio||1),a=(r.width=n*s,r.height=o*s,r.style.width=n+"px",r.style.height=o+"px",window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(i.svg)],{type:"image/svg+xml"}))),l=new Image,h=r.getContext("2d");h.scale(s,s),l.onload=function(){h.drawImage(l,0,0),window.URL.revokeObjectURL(a);var e=r.toDataURL("image/png");t(e)},l.onerror=function(){e("Invalid data")},l.src=a})},WVt.prototype.getControlsValue=function(e,n,t){var o=0,r=0,s=new fo("").createSvg({id:"Image_Export",width:200,height:200});return e.map(function(e){var t,i;e&&(t=e.svgObject.cloneNode(!0),(i=e.renderer.createGroup({style:"transform: translateY("+r+"px)"})).appendChild(t),o=Math.max(e.availableSize.width,n),r+=e.availableSize.height,e.svgObject.outerHTML,s.appendChild(i))}),s.setAttribute("width",o+""),s.setAttribute("height",r+""),{width:o,height:r,svg:s}},WVt.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},WVt.prototype.chartSeries=function(e,t,i){for(var n=[],o=0;o<e.length;o++){var r=e[parseInt(o.toString(),10)],r=this.writeChartSeries(r,t,i,o);n.push(r)}return n},WVt.prototype.writeChartSeries=function(e,t,i,n){var o,r=this.officeChartType(i),s=e[s_t[this.keywordIndex]][parseInt(n.toString(),10)],a={};if(a.type=r,a.dataSource=t,a.name=e[a_t[this.keywordIndex]],a.xName="x",a.yName="y"+n,"Bubble"===i&&(a.size="size"+n),this.isPieType?(a.pointColorMapping="color","Doughnut"===i&&(a.innerRadius="75%",a.radius="70%")):(je(s)&&(s=e[s_t[this.keywordIndex]][0]),o=this.chartFormat(s,r),a.fill=o,je(s[d_t[this.keywordIndex]][g_t[this.keywordIndex]])||(a.pointColorMapping="color")),"Line_Markers"!==i&&"Line_Markers_Stacked"!==i&&"Line_Markers_Stacked_100"!==i||(a.marker={visible:!0}),e.hasOwnProperty(l_t[this.keywordIndex])&&(this.isPieType?a.dataLabel=this.parseDataLabels(e[l_t[this.keywordIndex]]):((t={}).dataLabel=this.parseDataLabels(e[l_t[this.keywordIndex]]),a.marker=t)),e.hasOwnProperty(h_t[this.keywordIndex])&&(n=e[h_t[this.keywordIndex]],a.errorBar=this.parseErrorBars(n)),e.hasOwnProperty(r_t[this.keywordIndex]))for(var l=e[r_t[this.keywordIndex]],h=[],d=0;d<l.length;d++){var p=l[parseInt(d.toString(),10)],p=this.parseTrendLines(p,o);h.push(p),a.trendlines=h}return a},WVt.prototype.parseDataLabels=function(e){var t={visible:!0};return this.isPieType?"BestFit"===e[m_t[this.keywordIndex]]||"Inside"===e[m_t[this.keywordIndex]]?t.position="Inside":t.position="Outside":t.position=this.dataLabelPosition(e[m_t[this.keywordIndex]]),t},WVt.prototype.parseErrorBars=function(e){var t={visible:!0};return t.type=e[f_t[this.keywordIndex]],t.direction=e[v_t[this.keywordIndex]],"Cap"===e[b_t[this.keywordIndex]]?t.errorBarCap={width:1}:t.errorBarCap={width:0},t},WVt.prototype.parseTrendLines=function(e,t){var i={};return i.type=e[f_t[this.keywordIndex]],i.name=e[y_t[this.keywordIndex]],i.forwardForecast=e[w_t[this.keywordIndex]],i.backwardForecast=e[C_t[this.keywordIndex]],"NaN"===e[S_t[this.keywordIndex]]?i.intercept=0:i.intercept=e[S_t[this.keywordIndex]],i.fill=t,i},WVt.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},WVt.prototype.chartFormat=function(e,t){return("Line"===t||"StackingLine"===t||"StackingLine100"===t?e[p_t[this.keywordIndex]]:e[d_t[this.keywordIndex]])[c_t[this.keywordIndex]]},WVt.prototype.chartPrimaryXAxis=function(e,t){var i={},n=(e[n_t[this.keywordIndex]]&&(i.title=e[n_t[this.keywordIndex]]),this.chartCategoryType(e[A_t[this.keywordIndex]]));return"DateTime"===(i.valueType=n)&&(i.intervalType="Days",i.labelFormat="M/d/yyyy",i.edgeLabelPlacement="Shift"),"Scatter_Markers"!==t&&"Bubble"!==t||this.checkAndSetAxisValue(i,e),this.parseBoolValue(e[x_t[this.keywordIndex]])&&(i.majorGridLines={width:1}),this.parseBoolValue(e[I_t[this.keywordIndex]])&&(i.minorTicksPerInterval=4),i},WVt.prototype.chartCategoryType=function(e){var t="";switch(e){case"Time":t="DateTime";break;case"Automatic":t="Category"}return t},WVt.prototype.chartPrimaryYAxis=function(e){var t={};return e[n_t[this.keywordIndex]]&&(t.title=e[n_t[this.keywordIndex]]),this.checkAndSetAxisValue(t,e),e[x_t[this.keywordIndex]]&&(t.majorGridLines={width:1}),e[I_t[this.keywordIndex]]&&(t.minorTicksPerInterval=4),t},WVt.prototype.checkAndSetAxisValue=function(e,t){var i;0!==t[M_t[this.keywordIndex]]&&(e.minimum=t[M_t[this.keywordIndex]]),0!==t[D_t[this.keywordIndex]]&&(e.maximum=t[D_t[this.keywordIndex]]),0!==t[T_t[this.keywordIndex]]&&((i=t[E_t[this.keywordIndex]])&&this.parseBoolValue(i)?(i=this.calculateMajorUnit(this.chartYValues))<10&&("Bar_Stacked_100"===this.chartType||"Line_Stacked_100"===this.chartType||"Column_Stacked_100"===this.chartType||"Line_Markers_Stacked_100"===this.chartType||"Area_Stacked_100"===this.chartType)?e.interval=10:e.interval=i:e.interval=t[T_t[this.keywordIndex]])},WVt.prototype.calculateMajorUnit=function(e){if(e&&0<e.length){for(var t=Number.MIN_VALUE,i=Number.MAX_VALUE,n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)];t<o&&(t=o),o<i&&(i=o)}return this.roundToNiceNumber((t-i)/1.5)}return 1},WVt.prototype.roundToNiceNumber=function(e){var t=Math.floor(Math.log(e)/Math.log(10)),t=Math.pow(10,t),e=e/t;return e<1.5?+t:e<3?2*t:e<7?5*t:10*t},WVt.prototype.chartData=function(e,t){for(var i=e[ZVt[this.keywordIndex]],n=[],o=0;o<i.length;o++){var r=i[parseInt(o.toString(),10)],r=this.chartPlotData(r,e,t,o);n.push(r)}return n},WVt.prototype.chartPlotData=function(e,t,i,n){var o,r,s,a=this,l={},h=t[$Vt[this.keywordIndex]];"m/d/yyyy"===t[t_t[this.keywordIndex]][P_t[this.keywordIndex]]?(s=e[k_t[this.keywordIndex]].split("/"),o=Number(s[0]),r=Number(s[1]),s=Number(s[2]),l.x=new Date(s,o-1,r)):l.x=e[k_t[this.keywordIndex]];for(var d=0;d<h.length;d++){var p,c,u=e[JVt[this.keywordIndex]][parseInt(d.toString(),10)];je(u)||(p=u[B_t[this.keywordIndex]],this.chartYValues.push(p),l["y"+d]=p,"Bubble"===i&&(l["size"+d]=u[F_t[this.keywordIndex]])),"Pie"!==t[o_t[this.keywordIndex]]&&"Doughnut"!==t[o_t[this.keywordIndex]]&&"Column_Stacked"!==t[o_t[this.keywordIndex]]||(je(u=(p=h[parseInt(d.toString(),10)])[s_t[this.keywordIndex]].find(function(e){return e[u_t[a.keywordIndex]]===n}))?1<p[s_t[this.keywordIndex]].length&&0===p[s_t[this.keywordIndex]][parseInt(n.toString(),10)][u_t[this.keywordIndex]]?(u=p[s_t[this.keywordIndex]][parseInt(n.toString(),10)],c=this.chartFormat(u,i),"Column_Stacked"!==t[o_t[this.keywordIndex]]?l.color=c:l["color"+d]=c):je(p[L_t[this.keywordIndex]])||je(p[L_t[this.keywordIndex]][d_t[this.keywordIndex]])||7<p[L_t[this.keywordIndex]][d_t[this.keywordIndex]][c_t[this.keywordIndex]].length&&(c=this.getColor(p[L_t[this.keywordIndex]][d_t[this.keywordIndex]][c_t[this.keywordIndex]]),"Column_Stacked"!==t[o_t[this.keywordIndex]]?l.color=c:l["color"+d]=c):(c=this.chartFormat(u,i),"Column_Stacked"!==t[o_t[this.keywordIndex]]?l.color=c:l["color"+d]=c))}return l},WVt.prototype.getColor=function(e){return 0<e.length&&"#"===e[0]&&7<e.length?e.substr(0,7):e},WVt.prototype.parseChartLegend=function(e){var t={},e=e[m_t[this.keywordIndex]];return(e="Corner"===e?"right":e)?(t.visible=!0,t.position=e.charAt(0).toUpperCase()+e.slice(1)):t.visible=!1,t},WVt.prototype.parseBoolValue=function(e){return"string"==typeof e||e instanceof String?!je(e)&&"f"!==e&&"0"!==e&&"off"!==e&&"false"!==e:1===e||!0===e},WVt.prototype.destroy=function(){this.chart&&this.chart.destroy(),this.chart=void 0,this.chartYValues&&(this.chartYValues=[]),this.chartYValues=void 0},WVt);function WVt(){this.keywordIndex=void 0,this.chartYValues=[]}var QVt,UVt,qVt,GVt,YVt,XVt=["width","w"],KVt=["height","h"],JVt=["chartData","chd"],ZVt=["chartCategory","c"],$Vt=["chartSeries","cs"],e_t=["chartLegend","cl"],t_t=["chartPrimaryCategoryAxis","cpca"],i_t=["chartPrimaryValueAxis","cpva"],n_t=["chartTitle","ctt"],o_t=["chartType","ct"],r_t=["trendLines","tl"],s_t=["dataPoints","dp"],a_t=["seriesName","sn"],l_t=["dataLabel","sl"],h_t=["errorBar","eb"],d_t=["fill","f"],p_t=["line","l"],c_t=["rgb","rgb"],u_t=["id","i"],g_t=["foreColor","fc"],m_t=["position","p"],f_t=["type","t"],y_t=["name","n"],v_t=["direction","dir"],b_t=["endStyle","est"],w_t=["forward","fw"],C_t=["backward","bw"],S_t=["intercept","itr"],A_t=["categoryType","ct"],x_t=["hasMajorGridLines","hmajgl"],I_t=["hasMinorGridLines","hmingl"],T_t=["majorUnit","maju"],E_t=["isAutoMajor","iam"],D_t=["maximumValue","maxv"],M_t=["minimumValue","minv"],k_t=["categoryXName","cx"],P_t=["numberFormat","nf"],B_t=["yValue","y"],F_t=["size","sz"],L_t=["seriesFormat","sf"],nft=Object.freeze({__proto__:null,ChartComponent:jVt,widthProperty:XVt,heightProperty:KVt,chartDataProperty:JVt,chartCategoryProperty:ZVt,chartSeriesProperty:$Vt,chartLegendProperty:e_t,chartPrimaryCategoryAxisProperty:t_t,chartPrimaryValueAxisProperty:i_t,chartTitleProperty:n_t,chartTypeProperty:o_t,trendLinesProperty:r_t,dataPointsProperty:s_t,seriesNameProperty:a_t,dataLabelProperty:l_t,errorBarProperty:h_t,fillProperty:d_t,lineProperty:p_t,rgbProperty:c_t,idProperty:u_t,foreColorProperty:g_t,positionProperty:m_t,typeProperty:f_t,nameProperty:y_t,directionProperty:v_t,endStyleProperty:b_t,forwardProperty:w_t,backwardProperty:C_t,interceptProperty:S_t,categoryTypeProperty:A_t,hasMajorGridLinesProperty:x_t,hasMinorGridLinesProperty:I_t,majorUnitProperty:T_t,isAutoMajorProperty:E_t,maximumValueProperty:D_t,minimumValueProperty:M_t,categoryXNameProperty:k_t,numberFormatProperty:P_t,yValueProperty:B_t,sizeProperty:F_t,seriesFormatProperty:L_t}),sft=Object.freeze({__proto__:null,ToastPosition:KH,ButtonModelProps:$H,ToastAnimations:iz,ToastAnimationSettings:rz,Toast:hz,get ToastUtility(){return lz},get Severity(){return cz},get Variant(){return uz},Message:Iz,get SkeletonType(){return Dz},get ShimmerEffect(){return Mz},Skeleton:Bz}),ist=Object.freeze({__proto__:null,MenuAnimationSettings:n3,MenuItem:e3,FieldSettings:Jj,HScroll:lj,VScroll:xj,addScrolling:Tj,destroyScroll:Dj,Item:j3,Toolbar:U3,AccordionActionSettings:m4,AccordionAnimationSettings:v4,AccordionItem:C4,Accordion:x4,ContextMenu:D4,Menu:L4,TabActionSettings:h3,TabAnimationSettings:C5,Header:x5,TabItem:E5,Tab:k5,FieldsSettings:CW,ActionSettings:xW,NodeAnimationSettings:EW,TreeView:PW,Sidebar:wH,get BreadcrumbOverflowMode(){return JW},BreadcrumbItem:c8,Breadcrumb:Wz,get CarouselSwipeMode(){return y8},CarouselItem:$8,Carousel:$W,AppBar:b8,get StepStatus(){return fQ},Step:IQ,get StepperOrientation(){return vQ},StepperBase:DQ,StepperAnimationSettings:s6,get StepLabelPosition(){return BQ},get StepType(){return FQ},Stepper:h6}),vft=(QVt=function(e,t){return(QVt=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])}))(e,t)},function(e,t){function i(){this.constructor=e}QVt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Rft=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},R_t=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},O_t=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},N_t="e-icon-anim",V_t="e-nodata",__t="e-disabled",H_t="e-input-focus",z_t="e-multicolumn-list",j_t="e-multicolumn-grid",W_t=(Q_t.prototype.InjectModules=function(){IP.Inject(xY,YG,uX,eG,jG)},Q_t);function Q_t(){}(Tft=UVt=UVt||{}).StartsWith="StartsWith",Tft.EndsWith="EndsWith",Tft.Contains="Contains",(Vft=qVt=qVt||{}).None="None",Vft.Ascending="Ascending",Vft.Descending="Descending",(Gmt=GVt=GVt||{}).OneColumn="OneColumn",Gmt.MultipleColumns="MultipleColumns",(X$e=YVt=YVt||{}).Both="Both",X$e.Content="Content",X$e.Header="Header";vft(q_t,U_t=n),Rft([e()],q_t.prototype,"text",void 0),Rft([e()],q_t.prototype,"value",void 0),Rft([e()],q_t.prototype,"groupBy",void 0);var U_t,Wo=q_t;function q_t(){return null!==U_t&&U_t.apply(this,arguments)||this}vft(Y_t,G_t=n),Rft([e("")],Y_t.prototype,"field",void 0),Rft([e("")],Y_t.prototype,"header",void 0),Rft([e("")],Y_t.prototype,"width",void 0),Rft([e("")],Y_t.prototype,"textAlign",void 0),Rft([e(null)],Y_t.prototype,"format",void 0),Rft([e(!1)],Y_t.prototype,"displayAsCheckBox",void 0),Rft([e(null)],Y_t.prototype,"template",void 0),Rft([e(null)],Y_t.prototype,"headerTemplate",void 0),Rft([e(null)],Y_t.prototype,"customAttributes",void 0);var G_t,Met=Y_t;function Y_t(){return null!==G_t&&G_t.apply(this,arguments)||this}vft(K_t,X_t=n),Rft([e(!1)],K_t.prototype,"enableAltRow",void 0),Rft([e(null)],K_t.prototype,"rowHeight",void 0),Rft([e("Default")],K_t.prototype,"gridLines",void 0),Rft([e(!1)],K_t.prototype,"allowTextWrap",void 0),Rft([e(YVt.Both)],K_t.prototype,"textWrapMode",void 0),Rft([e(!1)],K_t.prototype,"allowResizing",void 0),Rft([i()],K_t.prototype,"resizing",void 0),Rft([i()],K_t.prototype,"resizeStart",void 0),Rft([i()],K_t.prototype,"resizeStop",void 0);var X_t,Cet=K_t;function K_t(){return null!==X_t&&X_t.apply(this,arguments)||this}vft(Z_t,J_t=Ji),Z_t.prototype.preRender=function(){this.element.id||(this.element.id=D("e-"+this.getModuleName())),this.keyConfigs={escape:"escape",altUp:"alt+uparrow",altDown:"alt+downarrow",tab:"tab",shiftTab:"shift+tab",end:"end",enter:"enter",home:"home",moveDown:"downarrow",moveUp:"uparrow"},this.matchedRowEle=this.matchedContent=this.exactMatchedContent=null,this.persistData()},Z_t.prototype.getDirective=function(){return"EJS-MULTICOLUMNCOMBOBOX"},Z_t.prototype.getModuleName=function(){return"multicolumncombobox"},Z_t.prototype.getPersistData=function(){return this.addOnPersist(["value"])},Z_t.prototype.persistData=function(){var e;this.enablePersistence&&(this.element.id+="_wrapper",je(e=window.localStorage.getItem(this.getModuleName()+this.element.id))||""===e||this.setProperties(JSON.parse(e),!0))},Z_t.prototype.render=function(){this.renderInput(),this.renderGrid(),this.popupDiv=this.createElement("div",{className:"e-popup-content"}),this.popupDiv.appendChild(this.gridEle),this.setHTMLAttributes(),this.renderPopup(),this.wireEvents()},Z_t.prototype.setHiddenValue=function(){var e,t;je(this.value)?this.hiddenElement.innerHTML="":je(e=this.hiddenElement.querySelector("option"))?je(this.hiddenElement)||((t=document.createElement("option")).text=this.text,t.setAttribute("value",this.value.toString()),t.setAttribute("selected",""),this.hiddenElement.appendChild(t)):(e.textContent=this.text,e.setAttribute("value",this.value.toString()))},Z_t.prototype.renderGrid=function(){var t=this,e=this.getGridColumns(),i=this.sortOrder.toString().toLowerCase();this.gridObj=new IP({dataSource:this.dataSource,columns:e,allowSorting:this.allowSorting,enableStickyHeader:!0,gridLines:this.gridSettings.gridLines,rowHeight:this.gridSettings.rowHeight,enableAltRow:this.gridSettings.enableAltRow,enableVirtualization:this.enableVirtualization,enableRtl:this.enableRtl,editSettings:{allowAdding:!1},query:this.query,allowTextWrap:this.gridSettings.allowTextWrap,textWrapSettings:{wrapMode:this.gridSettings.textWrapMode},height:this.popupHeight,allowResizing:this.gridSettings.allowResizing,allowMultiSorting:"multiplecolumns"===this.sortType.toString().toLowerCase()&&this.allowSorting,rowTemplate:this.itemTemplate,beforeDataBound:function(){t.dataSource instanceof me&&t.isShowSpinner&&(t.showHideSpinner(!0),t.isShowSpinner=!1)},dataBound:function(){t.onDataBound()},actionFailure:function(e){t.onActionFailure(e)},actionBegin:function(e){t.trigger("actionBegin",e)},actionComplete:this.handleActionComplete.bind(this),keyPressed:this.handleKeyPressed.bind(this),resizing:function(e){t.gridSettings.resizing&&t.gridSettings.resizing.call(t,e)},resizeStart:function(e){t.gridSettings.resizeStart&&t.gridSettings.resizeStart.call(t,e)},resizeStop:function(e){t.gridSettings.resizeStop&&t.gridSettings.resizeStop.call(t,e)}}),this.gridEle=this.createElement("div",{id:this.element.id+"_"+D("grid"),className:j_t}),this.updateGroupByField(),0<e.length&&(this.gridObj.columns[0].isPrimaryKey=!0),"none"!==i&&(this.gridObj.sortSettings={columns:[{field:this.fields.text,direction:"ascending"===i?qVt.Ascending:qVt.Descending}]}),this.gridObj.appendTo(this.gridEle),je(this.value)&&je(this.text)&&je(this.index)||this.initValue(null,null,!0)},Z_t.prototype.handleActionComplete=function(e){var t,i=this;this.trigger("actionComplete",e),"sorting"===e.requestType&&this.updateRowSelection(e),Array.isArray(e.rows)&&this.isDataFiltered&&(e=e.rows,t=0,e.forEach(function(e){e=i.gridObj.getRowElementByUID(e.uid);e&&(t+=e.getBoundingClientRect().height)}),this.popupRowHeight=t||parseFloat(this.popupHeight),this.updateGridHeight(!0,!0)),this.popupObj.refreshPosition(),this.gridObj.element.querySelector(".e-content").scrollTop=0},Z_t.prototype.handleKeyPressed=function(e){"Enter"===e.key&&(e.cancel=!0,this.isPopupOpen)&&(this.selectedGridRow(this.gridObj.getRows()[this.gridObj.selectedRowIndex],e,!0),this.hidePopup(e),this.focusIn(e)),this.fields.groupBy&&(e.cancel=!0,this.gridKeyActionHandler(e,!0))},Z_t.prototype.isRowMatching=function(e,t,i){function n(t){var i=[];return t&&"object"==typeof t?Array.isArray(t)?t.forEach(function(e){return i.push.apply(i,n(e))}):Object.keys(t).forEach(function(e){return i.push.apply(i,n(t[""+e]))}):null!=t&&i.push(String(t)),i}e=n(e);return-1!==e.indexOf(t)&&-1!==e.indexOf(i)},Z_t.prototype.updateRowSelection=function(e){var t=this;e&&e.rows.forEach(function(e){t.selectDataRow(e.data,e.index)})},Z_t.prototype.selectDataRow=function(e,t){this.isRowMatching(e,this.value?this.value.toString():"",this.text?this.text.toString():"")&&(this.gridObj.selectRow(t),e=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.index=t,this.isProtectedOnChange=e)},Z_t.prototype.findIndex=function(e,i){return e.findIndex(function(t){return Object.keys(i).every(function(e){return t[e]===i[e]})})},Z_t.prototype.getGridColumns=function(){var h=this;return this.columns.map(function(e){var t=e.field,i=e.header,n=e.width,o=e.textAlign,r=e.format,s=e.displayAsCheckBox,a=e.template,l=e.headerTemplate,e=e.customAttributes;return{field:t,headerText:i,width:n,textAlign:""===o.toString()&&h.enableRtl?"Right":o,format:r,displayAsCheckBox:s,template:a,headerTemplate:l,customAttributes:e,type:s&&!r?"boolean":void 0}})},Z_t.prototype.updateGroupByField=function(){var e,t=this.fields.groupBy,i=""!==t&&!je(t);i&&("multiplecolumns"!==this.sortType.toString().toLowerCase()&&this.gridEle.classList.add("e-multicolumn-group"),e=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.gridObj.allowGrouping=!0,this.gridObj.groupSettings={showDropArea:!1,columns:[t]},this.groupTemplate&&i&&(this.gridObj.groupSettings.captionTemplate=this.groupTemplate),this.isVue&&(this.gridObj.isVue=this.isVue),this.isProtectedOnChange=e)},Z_t.prototype.onDataBound=function(){var e=this,t=this.dataSource.length,i=this.popupDiv.querySelector("."+j_t),n=this.popupDiv.classList.contains(V_t),n=(t<=0&&i?(this.l10nUpdate(),this.popupDiv.removeChild(this.gridEle),U([this.popupDiv],[V_t])):n&&1<=t&&(q([this.popupDiv],[V_t]),i=this.popupDiv.querySelector(".e-no-records"))&&this.popupDiv.removeChild(i),this.isInitialRender&&(t=this.popupDiv.querySelector(".e-gridcontent tr"),i=n?this.popupDiv.getBoundingClientRect().height:t?t.getBoundingClientRect().height:0,this.popupRowHeight=i,this.popupObj.hide(),this.popupEle.style.visibility="unset",this.isInitialRender=!1),this.gridObj.element.querySelectorAll(".e-row"));this.isDataFiltered&&0<n.length&&""!==this.inputEle.value&&n[0].classList.add("e-row-focus"),this.dataSource instanceof me&&setTimeout(function(){e.showHideSpinner(!1)})},Z_t.prototype.showHideSpinner=function(e){(e?kA:BA)(this.dropdownElement)},Z_t.prototype.onActionFailure=function(e){this.trigger("actionFailure",e),this.l10nUpdate(!0),U([this.popupDiv],[V_t])},Z_t.prototype.renderInput=function(){var e=["aria-expanded","aria-readOnly","aria-disabled","autocomplete","autocapitalize","spellcheck","tabindex"];if("INPUT"===this.element.tagName){this.inputEle=this.element,je(this.inputEle.getAttribute("role"))&&this.inputEle.setAttribute("role","combobox"),je(this.inputEle.getAttribute("type"))&&this.inputEle.setAttribute("type","text");var t,i=this.inputEle,n={"aria-expanded":"false","aria-readOnly":this.readonly.toString(),"aria-disabled":this.disabled.toString(),autocomplete:"off",autocapitalize:"off",spellcheck:"false",tabindex:"0"};for(t in n)n.hasOwnProperty(t)&&-1!==e.indexOf(t)&&je(i.getAttribute(t))&&i.setAttribute(t,n[t])}else this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text"}}),this.element.parentElement.insertBefore(this.inputEle,this.element);this.inputObj=HF.createInput({element:this.inputEle,buttons:["e-input-group-icon e-multicolumn-list-icon e-icons"],floatLabelType:this.floatLabelType,properties:{enabled:!this.disabled,readonly:this.readonly,placeholder:this.placeholder,enableRtl:this.enableRtl,showClearButton:this.showClearButton,cssClass:this.cssClass}},this.createElement),this.inputWrapper=this.inputObj.container,this.inputWrapper.classList.add(z_t),this.inputWrapper.setAttribute("spellcheck","false"),this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:"e-multicolumn-list-hidden"}}),lt([this.hiddenElement],this.inputWrapper);var o=this.inputEle.getAttribute("name")?this.inputEle.getAttribute("name"):this.inputEle.getAttribute("id");this.hiddenElement.setAttribute("name",o),this.inputEle.removeAttribute("name"),this.hiddenElement.hasAttribute("aria-label")||this.hiddenElement.setAttribute("aria-label",this.getModuleName()),this.element.tagName===this.getDirective()&&this.element.appendChild(this.inputWrapper),this.setElementWidth(this.width),this.dropdownElement=this.inputWrapper.querySelector(".e-input-group-icon.e-multicolumn-list-icon.e-icons"),mA({target:this.dropdownElement})},Z_t.prototype.setElementWidth=function(e){var t;je(e)||(t=this.inputWrapper,"number"==typeof e?t.style.width=T(e):"string"==typeof e&&(t.style.width=e.match(/px|%|em/)?e:T(e)))},Z_t.prototype.setHTMLAttributes=function(){var i=this,e=this.htmlAttributes,t=this.inputEle;if(Object.keys(e).length)for(var n=0,o=Object.keys(e);n<o.length;n++){var r=o[n];switch(r){case"class":this.inputWrapper.classList.add(e[r]);break;case"disabled":this.setProperties({enabled:!1},!0),this.setEnable();break;case"readonly":this.setProperties({readonly:!0},!0),this.dataBind();break;case"style":var s=e[r];this.inputWrapper.style.cssText="",s&&s.split(";").forEach(function(e){var e=e.split(":").map(function(e){return e.trim()}),t=e[0],e=e[1];t&&e&&i.inputWrapper.style.setProperty(t,e)});break;default:-1<["name","required"].indexOf(r)||0===r.indexOf("data")?this.hiddenElement.setAttribute(r,this.htmlAttributes[""+r]):-1<["title","id","placeholder","role","autocomplete","autocapitalize","spellcheck","minlength","maxlength"].indexOf(r)&&"placeholder"===r?HF.setPlaceholder(e[r],t):t.setAttribute(r,e[r])}}},Z_t.prototype.setEnable=function(){HF.setEnabled(!this.disabled,this.inputEle),this.disabled?(this.isPopupOpen&&this.hidePopup(),U([this.inputWrapper],__t),this.inputWrapper&&this.inputWrapper.classList.contains(H_t)&&q([this.inputWrapper],[H_t]),this.setAriaDisabled("true")):(q([this.inputWrapper],__t),this.setAriaDisabled("false"))},Z_t.prototype.setAriaDisabled=function(e){this.inputEle.setAttribute("aria-disabled",e),this.inputWrapper.setAttribute("aria-disabled",e)},Z_t.prototype.updateFieldValue=function(e,t){return R(e,t).toString()},Z_t.prototype.initValue=function(o,i,r){function s(e){e=p.updateCurrentValues(a,e),l=e.currentValue,h=e.currentText,d=e.currentIndex}var a,l,h,d,n,p=this,c=this.gridObj.getSelectedRecords()[0],u=this.gridObj.getSelectedRows()[0],e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value=this.value&&this.value.toString(),this.isProtectedOnChange=e;!o&&(!je(this.value)||!je(this.text))||o&&void 0!==i?(n=o?i?this.value:this.text:je(this.value)?this.text:this.value,!je(this.dataSource)&&this.dataSource instanceof me?this.dataSource.executeQuery(new ya).then(function(e){var e=e.result,t=e.filter(function(e){return p.updateFieldValue(o?i?p.fields.value:p.fields.text:je(p.value)?p.fields.text:p.fields.value,e)===n});0<t.length&&(a=t[0],s(e),p.updateChangeEvent(a,c,u,l,h,d,o,r),p.gridObj.selectRow(p.index))}):!je(this.dataSource)&&this.dataSource instanceof Array&&(a=this.dataSource.filter(function(e){return p.updateFieldValue(o?i?p.fields.value:p.fields.text:je(p.value)?p.fields.text:p.fields.value,e)===n})[0],s(this.dataSource))):je(this.index)||(!je(this.dataSource)&&this.dataSource instanceof me?this.dataSource.executeQuery(new ya).then(function(e){e=e.result;a=e[p.index],s(e),p.updateChangeEvent(a,c,u,l,h,d,o,r),p.gridObj.selectRow(p.index)}):!je(this.dataSource)&&this.dataSource instanceof Array&&(this.fields.groupBy?setTimeout(function(){var e=p.gridObj.getRows();if(e&&0<e.length)for(var t=p.gridObj.getRowInfo(e[p.index]).rowData,i=p.fields.value,n=0;n<e.length;n++)if(t&&t[parseInt(i.toString(),10)]===p.dataSource[parseInt(n.toString(),10)][parseInt(i.toString(),10)]){a=t,s(p.dataSource),p.updateChangeEvent(a,c,u,l,h,d,o,r),p.gridObj.selectRow(p.index);break}}):(a=this.dataSource[this.index],s(this.dataSource)))),this.dataSource instanceof me||this.updateChangeEvent(a,c,u,l,h,d,o,r)},Z_t.prototype.updateChangeEvent=function(e,t,i,n,o,r,s,a){var l=e?this.updateFieldValue(this.fields.value,e):null,e={value:e?l:null,itemData:{text:o,value:n},item:this.getDataByValue(this.value),previousItemData:t,previousItemElement:i,itemElement:this.inputWrapper,event:null,isInteracted:!s};this.updateValues(n,o,r,e,a)},Z_t.prototype.updateCurrentValues=function(e,t){var i,n;return je(e)?{currentValue:null,currentText:null,currentIndex:null}:(i=this.updateFieldValue(this.fields.text,e),n=this.updateFieldValue(this.fields.value,e),HF.setValue(i,this.inputEle,this.floatLabelType,this.showClearButton),{currentValue:n,currentText:i,currentIndex:t.indexOf(e)})},Z_t.prototype.renderPopup=function(){this.popupEle=this.createElement("div",{id:this.element.id+"_options",className:z_t+" e-popup "+(null!==this.cssClass?this.cssClass:"")}),pt(this.popupEle,{"aria-label":this.element.id,role:"dialog"}),document.body.appendChild(this.popupEle),this.createPopup(this.popupEle),lt([this.popupDiv],this.popupEle),this.footerTemplate&&this.setFooterTemplate();var e,t=this.getSize(!1);this.popupEle.style.maxHeight=t,this.footerTemplate&&(e=Math.round(this.footer.getBoundingClientRect().height),t=T(parseInt(t,10)-e+"px")),this.popupDiv.style.maxHeight=t,this.updateGridHeight(),this.popupEle.style.visibility="hidden",this.isInitialRender=!0},Z_t.prototype.updateGridHeight=function(e,t){t=e?(e=(e=this.gridObj.getContent().querySelector(".e-content")).offsetHeight-e.clientHeight,""===this.fields.groupBy||je(this.fields.groupBy)||(this.popupRowHeight+=this.popupRowHeight),t&&this.popupRowHeight<this.prevGridHeight?this.popupRowHeight+e+"px":this.prevGridHeight+"px"):(this.prevGridHeight=this.popupDiv.getBoundingClientRect().height-this.popupDiv.querySelector(".e-gridheader").getBoundingClientRect().height,this.prevGridHeight+"px"),e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.gridObj.height=t,this.isProtectedOnChange=e},Z_t.prototype.createPopup=function(e){var t=this;this.popupObj=new Sv(e,{width:this.getSize(!0),targetType:"relative",collision:{X:"flip",Y:"flip"},relateTo:this.inputWrapper,enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},targetExitViewport:function(){F.isDevice||t.hidePopup()},open:function(){t.inputEle.focus(),t.updateClearIconState()}})},Z_t.prototype.setFooterTemplate=function(){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),U([this.footer],"e-popup-footer"));var e=this.getTemplateFunction(this.footerTemplate)({count:this.dataSource.length},this,"footerTemplate",this.element.id+"footerTemplate",this.isStringTemplate,void 0,this.footer);e&&ht(Array.prototype.slice.call(e),this.footer),ht([this.footer],this.popupEle)},Z_t.prototype.l10nUpdate=function(e){var t,i,n;this.noRecord?this.noRecord.innerHTML="":this.noRecord=this.createElement("div"),"No records found"!==this.noRecordsTemplate||"Request Failed"!==this.actionFailureTemplate?(n=e?this.actionFailureTemplate:this.noRecordsTemplate,t=e?this.element.id+"_actionFailure":this.element.id+"_noRecords",i=e?"actionFailureTemplate":"noRecordsTemplate",(n=this.getTemplateFunction(n)({},this,i,t,this.isStringTemplate,void 0,this.noRecord))&&ht(n=Array.prototype.slice.call(n),this.noRecord)):(this.l10n=new Cn("multicolumncombobox",{noRecordsTemplate:"No records found",actionFailureTemplate:"Request Failed"},this.locale),this.noRecord.innerHTML=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate")),U([this.noRecord],"e-no-records"),lt([this.noRecord],this.popupDiv),this.popupObj.refreshPosition()},Z_t.prototype.getTemplateFunction=function(t){if("string"!=typeof t)return oo(t);var i="";try{var e=ge(t),i=e?"SCRIPT"===e.tagName?e.innerHTML:e.outerHTML:t}catch(e){i=t}return oo(i)},Z_t.prototype.getSize=function(e){var t=e?this.popupWidth:this.popupHeight,i=T(t);return i.includes("%")?i=((e?this.inputWrapper.offsetWidth:document.documentElement.clientHeight)*parseFloat(i)/100).toString()+"px":"string"==typeof t&&(i=t.match(/px|em/)?t:i),i},Z_t.prototype.selectedGridRow=function(e,t,i){var n=this,o={isInteracted:!!t,item:this.gridObj.getSelectedRecords()[0],itemElement:e,itemData:this.gridObj.getSelectedRecords()[0],event:t,cancel:!1},r=this.gridObj.getSelectedRecords()[0],s=r?this.updateFieldValue(this.fields.text,r):"",a=r?this.updateFieldValue(this.fields.value,r):"",l={isInteracted:!!t,item:r,itemElement:e,itemData:{text:r?s:"",value:r?a:""},event:t,cancel:!1,value:r?a:"",previousItemData:{text:this.text,value:this.value},previousItemElement:this.previousItemElement};this.trigger("select",o,function(e){!e.cancel&&e.itemData&&(e="Enter"===t.key||"Tab"===t.key||t.shiftKey&&"Tab"===t.key||t.altKey&&"ArrowUp"===t.key,i&&!e||n.updateValues(r?a:"",r?s:"",n.gridObj.selectedRowIndex,l),HF.setValue(r?s:"",n.inputEle,n.floatLabelType,n.showClearButton),n.setHiddenValue(),i&&!e||n.hidePopup(t))})},Z_t.prototype.updateValues=function(e,t,i,n,o){this.previousItemElement=n.itemElement;var r=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.text=t||this.text,this.value=e||this.value,this.index=this.selectedRowIndex=je(i)?this.index:i,this.isProtectedOnChange=r,this.setHiddenValue(),o||this.triggerChangeEvent(n)},Z_t.prototype.triggerChangeEvent=function(e){this.trigger("change",e,function(e){e.cancel})},Z_t.prototype.inputHandler=function(e){var n,o,r,s=this;this.showPopup(null,!0),this.updateClearIconState(),this.allowFiltering&&(n=e.target.value.toLowerCase(),r={preventDefaultAction:o=!1,text:n,updateData:function(e,t,i){r.cancel||(o=!0,s.filterAction(e,n,t,i))},event:e,cancel:!1},this.trigger("filtering",r,function(e){e.cancel||e.preventDefaultAction||o||s.filterAction(s.dataSource,n,s.query,s.fields)})),this.updateInputValue(e.target.value)},Z_t.prototype.updateInputValue=function(r){return R_t(this,void 0,void 0,function(){var t,i,n,o;return O_t(this,function(e){switch(e.label){case 0:return this.dataSource instanceof me?(n=new ya,[4,this.dataSource.executeQuery(n)]):[3,2];case 1:return n=e.sent(),o=n.result,o=this.filterDatas(o,r),i=o.data,o=o.exactData,[3,3];case 2:Array.isArray(this.dataSource)&&(t=this.filterDatas(this.dataSource,r),i=t.data,o=t.exactData),e.label=3;case 3:return this.selectFilteredRows(i,o),[2]}})})},Z_t.prototype.filterDatas=function(e,t){var i=this;return{data:e.filter(function(e){e=i.updateFieldValue(i.fields.text,e);return t&&e.toLowerCase().startsWith(t.toLowerCase())}),exactData:e.filter(function(e){return i.updateFieldValue(i.fields.text,e)===t})}},Z_t.prototype.selectFilteredRows=function(e,t){e.length<=0?this.matchedRowEle=this.matchedContent=this.exactMatchedContent=null:(this.matchedContent=e[0],this.exactMatchedContent=t[0],e=this.findIndex(this.gridObj.currentViewData,this.matchedContent),this.matchedRowEle=this.gridObj.getRowByIndex(e))},Z_t.prototype.filterAction=function(e,t,i,n){var o=this,r=i||new ya,s=this.filterType.toString().toLowerCase();je(i)&&je(n)?this.updateGridDataSource(e):i?e instanceof me?this.filteringHandler(e,t,i,n):new me(e).executeQuery(i).then(function(e){e=e.result;o.updateGridDataSource(e)}):e instanceof me?this.filteringHandler(e,t,r,n):Array.isArray(e)&&(i=e.filter(function(e){return o.filterData(e,s,t,n)}),this.updateGridDataSource(i))},Z_t.prototype.filteringHandler=function(e,t,i,n){var o,r=this,s=this.filterType.toString().toLowerCase();e.executeQuery(i).then(function(e){e=e.result;o=e.filter(function(e){return r.filterData(e,s,t,n)}),r.updateGridDataSource(o)})},Z_t.prototype.filterData=function(e,t,i,n){var o=this.updateFieldValue((n||this.fields).text,e).toLowerCase();switch(t){case"startswith":return o.startsWith(i);case"endswith":return o.endsWith(i);case"contains":return o.includes(i);default:return!1}},Z_t.prototype.updateGridDataSource=function(e){var t;0<e.length?(q([this.popupDiv],[V_t]),(t=this.popupDiv.querySelector(".e-no-records"))&&this.popupDiv.removeChild(t),this.gridObj.dataSource=e,this.isDataFiltered=!0):(this.l10nUpdate(),U([this.popupDiv],[V_t]))},Z_t.prototype.wireEvents=function(){je(this.inputObj.buttons[0])||(E.add(this.inputObj.buttons[0],"mousedown",this.preventBlur,this),E.add(this.inputObj.buttons[0],"mousedown",this.dropDownClick,this)),E.add(document,"mousedown",this.onDocumentClick,this),E.add(this.gridEle,"click",this.onMouseClick,this),E.add(this.inputEle,"input",this.inputHandler,this),E.add(this.inputEle,"focus",this.focusIn,this),this.showClearButton&&E.add(this.inputObj.clearButton,"mousedown",this.clearText,this),E.add(window,"resize",this.windowResize,this),this.keyboardModule=new bn(this.inputWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.keyboardModule=new bn(this.gridEle,{keyAction:this.gridKeyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},Z_t.prototype.unWireEvents=function(){je(this.inputObj.buttons[0])||(E.remove(this.inputObj.buttons[0],"mousedown",this.preventBlur),E.remove(this.inputObj.buttons[0],"mousedown",this.dropDownClick)),E.remove(document,"mousedown",this.onDocumentClick),E.remove(this.inputEle,"input",this.inputHandler),E.remove(this.inputWrapper,"focus",this.focusIn),E.remove(window,"resize",this.windowResize),E.remove(this.gridEle,"click",this.onMouseClick),this.showClearButton&&E.remove(this.inputObj.clearButton,"mousedown",this.clearText),this.keyboardModule&&this.keyboardModule.destroy()},Z_t.prototype.preventBlur=function(e){e.preventDefault()},Z_t.prototype.dropDownClick=function(e){var t;this.disabled||this.readonly||((t=this.gridEle.querySelector(".e-row-focus"))&&t.classList.remove("e-row-focus"),this.isPopupOpen?this.hidePopup(e):this.showPopup(e))},Z_t.prototype.onMouseClick=function(e){var t=z(e.target,".e-row"),i=this.gridObj.selectedRowIndex;t&&(0<=i?this.selectedGridRow(t,e):(this.gridObj.selectedRowIndex=this.gridObj.getRows().indexOf(t),this.gridObj.selectRow(this.gridObj.selectedRowIndex),this.hidePopup(e)))},Z_t.prototype.onDocumentClick=function(e){var t=e.target;this.disabled||this.readonly||!this.isPopupOpen?t.closest(".e-multicolumn-list")||this.focusOut():t.classList.contains("e-multicolumn-list-icon")||z(t,".e-multicolumn-list.e-popup")?e.preventDefault():t.classList.contains("e-multicolumncombobox")||t.classList.contains("e-clear-icon")||(je(this.text)||this.updateInputValue(this.text),t=""===this.inputEle.value,this.updateValuesOnInput(e,null,t))},Z_t.prototype.updateValuesOnInput=function(e,t,i,n){var o,e=e||t,t=(n=void 0===n?!1:n)?this.matchedContent:this.exactMatchedContent;t||(this.inputEle.value=this.value=this.index=this.text=null),this.hidePopup(e),this.matchedRowEle&&!i&&t?(o=this.isProtectedOnChange,this.isProtectedOnChange=!0,n=this.updateFieldValue(this.fields.text,this.matchedContent),i=this.updateFieldValue(this.fields.value,this.matchedContent),this.inputEle.value=n,this.value=i,t=this.findIndex(this.gridObj.currentViewData,this.matchedContent),this.index=t,this.text=n,this.gridObj.selectRow(t),this.selectedGridRow(this.gridObj.getRowByIndex(t),e),this.previousItemElement=this.gridObj.getSelectedRows()[0],this.isProtectedOnChange=o):this.isDataFiltered&&(this.inputEle.value="",i={value:null,itemData:{text:null,value:null},item:null,previousItemData:{text:this.text,value:this.value},previousItemElement:this.previousItemElement,itemElement:null,event:e,isInteracted:!0,cancel:!1},o=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.text=this.value=this.index=null,this.gridObj.refreshColumns(),this.isProtectedOnChange=o,this.triggerChangeEvent(i),this.isDataFiltered=!1,this.matchedContent=this.matchedRowEle=null)},Z_t.prototype.clearText=function(e){this.isDataFiltered=!0,this.updateValuesOnInput(e,null,!0)},Z_t.prototype.windowResize=function(){this.popupObj&&(this.popupObj.setProperties({width:this.getSize(!0)}),this.popupObj.refreshPosition())},Z_t.prototype.setCssClass=function(e,t){var i=this.popupObj?[this.inputWrapper,this.popupObj.element]:[this.inputWrapper];je(t)||""===t||q(i,t.split(" ")),je(e)||""===e||U(i,e.split(" "))},Z_t.prototype.keyActionHandler=function(e){switch(e.action){case"escape":case"altUp":case"shiftTab":case"tab":this.isPopupOpen?this.hidePopup(e):this.focusOut();break;case"altDown":this.isPopupOpen||(this.showPopup(e),this.updateSelectedItem(e,!1));break;case"moveDown":case"moveUp":this.updateSelectedItem(e,!0,!0);break;case"enter":this.updateValuesOnInput(null,e,!1,!0),this.focusIn(e);break;case"home":case"end":this.updateSelectedItem(e)}},Z_t.prototype.gridKeyActionHandler=function(e,t){switch(t&&(t=(e.altKey?"Alt+":"")+(e.shiftKey?"Shift+":"")+e.key,e.action={ArrowDown:"moveDown",ArrowUp:"moveUp",End:"end",Home:"home",Tab:"tab",Escape:"escape","Shift+Tab":"shiftTab","Alt+ArrowUp":"altUp"}[t]||e.action),e.action){case"escape":case"tab":case"shiftTab":case"altUp":this.isPopupOpen&&(e.preventDefault(),"escape"!==e.action&&this.updateSelectedItem(e),this.hidePopup(e));break;case"moveDown":case"moveUp":case"home":case"end":this.updateSelectedItem(e)}},Z_t.prototype.updateSelectedItem=function(e,t,i){var n,o,r=this;void 0===t&&(t=!0),this.isPopupOpen&&(n=this.fields.groupBy?this.gridObj.selectedRowIndex||0:this.gridObj.selectedRowIndex,o=this.dataSource instanceof me?this.remoteDataLength:this.dataSource.length,-1===n&&("moveDown"===e.action||"moveUp"===e.action)||"home"===e.action?n=0:o-1<=n&&"moveDown"===e.action||"end"===e.action?n=o-1:"moveDown"===e.action&&0<=n&&n<=o-1&&(this.fields.groupBy||i)?n+=1:("moveUp"===e.action&&0<n&&this.fields.groupBy||i)&&--n,this.enableVirtualization?setTimeout(function(){r.selectRow(e,t,n)}):this.selectRow(e,t,n))},Z_t.prototype.selectRow=function(e,t,i){void 0===t&&(t=!0),this.gridObj.selectRow(i),this.gridObj.selectedRowIndex=i;var n=this.gridEle.querySelector(".e-row-focus");n&&n.classList.remove("e-row-focus"),t&&this.selectedGridRow(this.gridObj.getRows()[parseInt(i.toString(),10)],e,!0)},Z_t.prototype.updateClearIconState=function(){var e=this.inputWrapper.querySelector(".e-clear-icon");e&&(e.style.display=""===this.inputEle.value?"none":"flex")},Z_t.prototype.updateDynamicDataSource=function(e,t){var i;this.gridObj&&(this.isShowSpinner=!0,this.gridObj.dataSource=e,t instanceof me?t.executeQuery(new ya).then(function(e){i=e.result.length}):i=t.length,0===i)&&this.popupDiv.appendChild(this.gridEle)},Z_t.prototype.focusIn=function(e){this.disabled||this.readonly||(U([this.inputWrapper],[H_t]),this.inputEle.focus(),this.updateClearIconState(),this.trigger("focus",e),"Never"!==this.floatLabelType&&HF.calculateWidth(this.inputEle,this.inputWrapper))},Z_t.prototype.focusOut=function(e){this.disabled||this.readonly||(this.isPopupOpen&&this.hidePopup(e),this.inputWrapper&&(q([this.inputWrapper],[H_t]),(e=this.inputWrapper.querySelector(".e-clear-icon"))&&(e.style.display="none"),"Never"!==this.floatLabelType)&&HF.calculateWidth(this.inputEle,this.inputWrapper))},Z_t.prototype.showPopup=function(e,n){var o=this,e={popup:this.popupObj,event:e,cancel:!1,animation:{name:"FadeIn",duration:100}};this.trigger("open",e,function(e){var t,i;e.cancel||o.isPopupOpen||(o.isPopupOpen=!0,o.popupObj.refreshPosition(),U([o.inputWrapper],[N_t]),pt(o.inputEle,{"aria-expanded":"true","aria-owns":o.element.id+"_popup","aria-controls":o.element.id}),n||(o.value||o.text||o.index)&&o.gridObj.selectRow(o.selectedRowIndex),(i=o.gridObj.getContent())&&(t=i.querySelector(".e-rowcell.e-active"),i=i.querySelector(".e-row"),t?o.inputEle.setAttribute("aria-activedescendant",t.parentElement.getAttribute("data-uid")):i&&o.inputEle.setAttribute("aria-activedescendant",i.getAttribute("data-uid"))),!je(o.dataSource)&&o.dataSource instanceof me&&o.dataSource.executeQuery(new ya).then(function(e){o.remoteDataLength=e.result.length}),o.popupObj.show(new Vt(e.animation),o.popupEle.firstElementChild))})},Z_t.prototype.hidePopup=function(t){var i=this,e={popup:this.popupObj,event:t||null,cancel:!1,animation:{name:"FadeOut",duration:100}},n=t?t.target:null;this.trigger("close",e,function(e){e.cancel||(i.isPopupOpen=!1,q([i.inputWrapper],[N_t]),pt(i.inputEle,{"aria-expanded":"false"}),i.popupObj.hide(new Vt(e.animation)),n&&(n.classList.contains("e-multicolumn-list-icon")||n.classList.contains("e-rowcell"))?(i.value||i.gridObj.refreshColumns(),setTimeout(function(){i.focusIn(t)})):i.focusOut(),i.inputEle.removeAttribute("aria-owns"),i.inputEle.removeAttribute("aria-activedescendant"))}),setTimeout(function(){i.gridObj&&(i.gridObj.dataSource=i.dataSource,i.updateGridHeight(!0,!1))},100)},Z_t.prototype.addItems=function(e,t){var i=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.gridObj.editSettings.allowAdding=!0,this.gridObj.dataBind(),this.isProtectedOnChange=i,this.gridObj.addRecord(e,t)},Z_t.prototype.getItems=function(){return this.gridObj.getDataRows()},Z_t.prototype.getDataByValue=function(t){var i=this;return!je(this.dataSource)&&this.dataSource instanceof Array?this.dataSource.filter(function(e){return i.updateFieldValue(i.fields.value,e)===t})[0]:(!je(this.dataSource)&&this.dataSource instanceof me&&this.dataSource.executeQuery(new ya).then(function(e){return e.result.filter(function(e){return i.updateFieldValue(i.fields.value,e)===t})[0]}),null)},Z_t.prototype.destroy=function(){if(this.unWireEvents(),this.gridObj&&(this.gridObj.destroy(),G(this.gridObj.element)),this.inputEle){for(var e=["placeholder","aria-expanded","spellcheck","aria-label","role","type","aria-owns","aria-controls","aria-readonly","autocomplete","autocapitalize","spellcheck","aria-activedescendant"],t=0;t<e.length;t++)this.inputEle.removeAttribute(e[t]);this.inputEle.classList.remove("e-input"),HF.setValue("",this.inputEle,this.floatLabelType,this.showClearButton)}this.popupEle&&(this.popupEle.removeAttribute("aria-label"),this.popupEle.removeAttribute("role")),this.popupObj&&(this.popupObj.destroy(),G(this.popupObj.element)),this.element.tagName!==this.getDirective()&&this.inputWrapper.parentElement.insertBefore(this.element,this.inputWrapper),this.inputObj&&(G(this.inputObj.container),this.inputObj=null),HF.destroy({element:this.inputEle,floatLabelType:this.floatLabelType,properties:this.properties}),G(this.inputWrapper),G(this.popupDiv),this.inputEle=null,this.previousItemElement=null,this.inputWrapper.innerHTML="",this.inputWrapper=null,this.popupDiv=null,this.popupObj=null,this.gridObj=null,this.gridEle=null,this.popupEle=null,this.footer=null,this.noRecord=null,this.hiddenElement=null,this.dropdownElement=null,J_t.prototype.destroy.call(this)},Z_t.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++){var o,r=n[i];switch(r){case"width":case"popupWidth":"width"===r&&this.setElementWidth(e.width),this.popupObj&&(this.popupObj.element.style.width=this.getSize(!0));break;case"popupHeight":this.popupObj&&(o=this.getSize(!1),this.popupObj.element.style.maxHeight=o,this.popupDiv.style.maxHeight=o,this.gridObj.height=o);break;case"placeholder":HF.setPlaceholder(e.placeholder,this.inputEle);break;case"readonly":HF.setReadonly(this.readonly,this.inputEle);break;case"disabled":HF.setEnabled(!this.disabled,this.inputEle),this.setEnable();break;case"cssClass":this.setCssClass(e.cssClass,t.cssClass);break;case"floatLabelType":HF.removeFloating(this.inputObj),HF.addFloating(this.inputEle,this.floatLabelType,this.placeholder);break;case"showClearButton":HF.setClearButton(e.showClearButton,this.inputEle,this.inputObj);break;case"value":this.initValue(!0,!0);break;case"text":this.initValue(!0,!1);break;case"index":this.initValue(!0);break;case"sortOrder":this.gridObj&&(this.gridObj.sortSettings.columns=[{field:this.fields.text,direction:e.sortOrder===qVt.Ascending?qVt.Ascending:qVt.Descending}]);break;case"htmlAttributes":this.setHTMLAttributes();break;case"noRecordsTemplate":this.l10nUpdate();break;case"actionFailureTemplate":this.l10nUpdate(!0);break;case"footerTemplate":this.setFooterTemplate();break;case"itemTemplate":this.gridObj&&(this.gridObj.rowTemplate=e.itemTemplate);break;case"groupTemplate":this.groupTemplate=e.groupTemplate,this.updateGroupByField();break;case"enableRtl":this.gridObj&&this.popupObj&&(this.gridObj.enableRtl=e.enableRtl,HF.setEnableRtl(e.enableRtl,[this.inputWrapper]),this.popupObj.enableRtl=e.enableRtl);break;case"dataSource":this.updateDynamicDataSource(e.dataSource,t.dataSource);break;case"query":this.gridObj&&(this.gridObj.query=e.query);break;case"gridSettings":this.gridObj&&(this.gridObj.gridLines=e.gridSettings.gridLines,this.gridObj.rowHeight=e.gridSettings.rowHeight,this.gridObj.enableAltRow=e.gridSettings.enableAltRow,this.gridObj.allowResizing=e.gridSettings.allowResizing,je(e.gridSettings.allowTextWrap)||(this.gridObj.allowTextWrap=e.gridSettings.allowTextWrap),je(e.gridSettings.textWrapMode)||(this.gridObj.textWrapSettings.wrapMode=e.gridSettings.textWrapMode));break;case"fields":this.fields=e.fields,this.updateGroupByField();break;case"filterType":this.filterType=e.filterType;break;case"enableVirtualization":this.gridObj&&(this.enableVirtualization=this.gridObj.enableVirtualization=e.enableVirtualization);break;case"sortType":this.gridObj&&(this.sortType=e.sortType,this.gridObj.allowMultiSorting="multiplecolumns"===this.sortType.toString().toLowerCase()&&this.allowSorting);break;case"allowFiltering":this.allowFiltering=e.allowFiltering;break;case"allowSorting":this.gridObj&&(this.allowSorting=this.gridObj.allowSorting=e.allowSorting);break;case"columns":this.gridObj&&(o=this.getGridColumns(),this.gridObj.columns=o)}}},Rft([e([])],Z_t.prototype,"dataSource",void 0),Rft([e(null)],Z_t.prototype,"text",void 0),Rft([e(null)],Z_t.prototype,"value",void 0),Rft([e(null)],Z_t.prototype,"index",void 0),Rft([e("100%")],Z_t.prototype,"width",void 0),Rft([e("300px")],Z_t.prototype,"popupHeight",void 0),Rft([e("100%")],Z_t.prototype,"popupWidth",void 0),Rft([e(null)],Z_t.prototype,"placeholder",void 0),Rft([e(!0)],Z_t.prototype,"allowFiltering",void 0),Rft([e(!0)],Z_t.prototype,"allowSorting",void 0),Rft([e(!1)],Z_t.prototype,"showClearButton",void 0),Rft([e("")],Z_t.prototype,"cssClass",void 0),Rft([t({text:null,value:null,groupBy:null},Wo)],Z_t.prototype,"fields",void 0),Rft([kt([],Met)],Z_t.prototype,"columns",void 0),Rft([t({},Cet)],Z_t.prototype,"gridSettings",void 0),Rft([e(UVt.StartsWith)],Z_t.prototype,"filterType",void 0),Rft([e("Never")],Z_t.prototype,"floatLabelType",void 0),Rft([e(qVt.None)],Z_t.prototype,"sortOrder",void 0),Rft([e(GVt.OneColumn)],Z_t.prototype,"sortType",void 0),Rft([e(!1)],Z_t.prototype,"enableVirtualization",void 0),Rft([e(!1)],Z_t.prototype,"disabled",void 0),Rft([e(!1)],Z_t.prototype,"readonly",void 0),Rft([e(!1)],Z_t.prototype,"enablePersistence",void 0),Rft([e()],Z_t.prototype,"query",void 0),Rft([e(null)],Z_t.prototype,"itemTemplate",void 0),Rft([e(null)],Z_t.prototype,"footerTemplate",void 0),Rft([e(null)],Z_t.prototype,"groupTemplate",void 0),Rft([e("Request Failed")],Z_t.prototype,"actionFailureTemplate",void 0),Rft([e("No records found")],Z_t.prototype,"noRecordsTemplate",void 0),Rft([e({})],Z_t.prototype,"htmlAttributes",void 0),Rft([i()],Z_t.prototype,"created",void 0),Rft([i()],Z_t.prototype,"open",void 0),Rft([i()],Z_t.prototype,"close",void 0),Rft([i()],Z_t.prototype,"actionFailure",void 0),Rft([i()],Z_t.prototype,"actionBegin",void 0),Rft([i()],Z_t.prototype,"actionComplete",void 0),Rft([i()],Z_t.prototype,"filtering",void 0),Rft([i()],Z_t.prototype,"select",void 0),Rft([i()],Z_t.prototype,"change",void 0);var J_t,ts=Rft([Bt],Z_t);function Z_t(e,t){e=J_t.call(this,e,t)||this;return e.gridInject=new W_t,e.isShowSpinner=!0,e.gridInject.InjectModules(),e}var $_t,d$=Object.freeze({__proto__:null,MultiColumnGrid:W_t,get FilterType(){return UVt},get SortOrder(){return qVt},get SortType(){return GVt},get WrapMode(){return YVt},FieldSettings:Wo,Column:Met,GridSettings:Cet,MultiColumnComboBox:ts}),zmt=($_t=function(e,t){return($_t=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])}))(e,t)},function(e,t){function i(){this.constructor=e}$_t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),eHt=function(e,t){this.width=e,this.height=t};function tHt(e,t){return"string"!=typeof e?e:je(e)?null:-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10)}function iHt(e){e.element.style.height=je(e.height)?"auto":e.height,e.element.style.width=je(e.width)?"auto":e.width,e.element.style.setProperty("display","block");var t=e.element.clientWidth,i=e.element.clientHeight,n="string"==typeof e.element.style.width?tHt(e.element.style.width,t):e.element.style.width,o="string"==typeof e.element.style.height?tHt(e.element.style.height,i):e.element.style.height;new eHt(0,0);return"0px"===e.width||"0%"===e.width||"0%"===e.height||"0px"===e.height?new eHt(0,0):new eHt(tHt(e.width,t)||t||n||600,tHt(e.height,i)||i||o||(e.isDevice?Math.min(window.innerWidth,window.innerHeight):450))}function nHt(e){e.renderer=new fo(e.element.id),e.availableSize=iHt(e),e.svgObject=e.renderer.createSvg({id:e.element.id+"_svg",width:e.availableSize.width,height:e.availableSize.height}),"0px"!==e.width&&"0%"!==e.width&&"0%"!==e.height&&"0px"!==e.height||(e.svgObject.setAttribute("height","0"),e.svgObject.setAttribute("width","0"))}function oHt(e,t,i){var n=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,r=i.ownerDocument.defaultView.pageYOffset,s=i.ownerDocument.documentElement.clientTop,i=i.ownerDocument.documentElement.clientLeft,o=n.left+o-i,i=n.top+r-s;return new jHt(e-o,t-i)}function rHt(e){return e*(Math.PI/180)}function sHt(e){return e*(180/Math.PI)}function aHt(e,t,i,n,o){var r,s,a,l=new eHt(o.mapAreaRect.width,o.mapAreaRect.height),h=o.baseMapBounds.longitude,d=o.baseMapBounds.latitude,p=rHt(e),c=rHt(t),u=je(o.projectionType)?"Mercator":o.projectionType,g=o.isTileMap?256*Math.pow(2,1):je(i)?Math.min(l.width,l.height):Math.min(l.width,l.height)*i;if("Normal"===n.geometryType)f=je(i)?t:Math.abs((t-h.min)*i),v=je(i)?e:Math.abs((d.max-e)*i);else if("Geographic"===n.geometryType){switch(u){case"Mercator":var m=new wHt(g/2,g/2),f=m.x+t*(g/360),y=fHt(Math.sin(rHt(e)),-.9999,.9999),v=m.y+.5*Math.log((1+y)/(1-y))*-(g/(2*Math.PI));break;case"Winkel3":a=((r=cHt(c,p)).x+c/(Math.PI/2))/2,s=(r.y+p)/2;break;case"Miller":a=c,s=1.25*Math.log(Math.tan(Math.PI/4+.4*p));break;case"Eckert3":a=2/(b=Math.sqrt(Math.PI*(4+Math.PI)))*c*(1+Math.sqrt(1-4*p*p/(Math.PI*Math.PI))),s=4/b*p;break;case"AitOff":a=(r=cHt(c,p)).x,s=r.y;break;case"Eckert5":a=c*(1+Math.cos(p))/Math.sqrt(2+Math.PI),s=2*p/Math.sqrt(2+Math.PI);break;case"Equirectangular":a=c,s=p;break;case"Eckert6":for(var b=(1+Math.PI/2)*Math.sin(p),w=1/0,C=0;C<10&&1e-6<Math.abs(w);C++)p-=w=(p+Math.sin(p)-b)/(1+Math.cos(p));b=Math.sqrt(2+Math.PI),a=c*(1+Math.cos(p))/b,s=2*p/b}f="Mercator"===u?f:uHt(dHt(o,sHt(a)),3),v="Mercator"===u?v:-uHt(pHt(o,sHt(s)),3)}return new wHt(f,v)}function lHt(n,o,r,e){var s="";return!je(e)&&1<e.length&&(Array.prototype.forEach.call(e,function(e,t){var i=e.latitude,e=e.longitude,i=n.isTileMap?hHt(new jHt(e,i),o,n.tileTranslatePoint,!0):aHt(i,e,o,r,n);s+=0===t?"M "+i.x+" "+i.y:" L "+i.x+" "+i.y}),s+=" z "),s}function hHt(e,t,i,n){var t=256*Math.pow(2,t),o=(e.x+180)/360,r=Math.sin(e.y*Math.PI/180),r=.5-Math.log((1+r)/(1-r))/(4*Math.PI),s=e.x,e=e.y;return n&&(s=o*t+.5+i.x,e=r*t+.5+i.y),{x:s,y:e}}function dHt(e,t){var i=e.baseMapBounds.longitude,e=je(e.baseSize)?e.mapAreaRect.width:e.mapAreaRect.width+Math.abs(e.baseSize.width-e.mapAreaRect.width)/2;return Math.round(e*(t-i.min)/(i.max-i.min)*100)/100}function pHt(e,t){var i=e.baseMapBounds.latitude;return Math.round(e.mapAreaRect.height*(t-i.min)/(i.max-i.min)*100)/100}function cHt(e,t){var i=Math.cos(t),n=gHt(mHt(i*Math.cos(e/=2)));return new wHt(2*i*Math.sin(e)*n,Math.sin(t)*n)}function uHt(e,t){t=Math.pow(10,t);return Math.round(e*t)/t}function gHt(e){return e/Math.sin(e)}function mHt(e){return Math.acos(e)}function fHt(e,t,i){return je(t)||(e=Math.max(e,t)),e=je(i)?e:Math.min(e,i)}function yHt(e,t,i,n){Q("a",{attrs:{download:e+"."+t.toLocaleLowerCase(),href:i}}).dispatchEvent(new MouseEvent(n?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function vHt(e,t){this.x=e,this.y=t}function bHt(e,t){this.latitude=e,this.longitude=t}var wHt=function(e,t){this.x=e,this.y=t},CHt=function(e,t){this.min=e,this.max=t},SHt=function(e,t){this.latitude=new CHt(e.min,e.max),this.longitude=new CHt(t.min,t.max)};function AHt(e,t){var i=document.getElementById("mapsmeasuretext");return null===i&&((i=document.createElement("text")).id="mapsmeasuretext",document.body.appendChild(i)),i.innerText=e,i.style.cssText="position: absolute; font-size: "+("number"==typeof t.size?t.size+"px":t.size)+"; font-weight: "+t.fontWeight+"; font-style: "+t.fontStyle+"; font-family: "+t.fontFamily+"; visibility: hidden; top: -100; left: 0; whiteSpace: nowrap; lineHeight: normal",new eHt(i.clientWidth,i.clientHeight)}function xHt(e,t){var i=document.createElement("canvas").getContext("2d");i.font=t.fontStyle+" "+t.fontWeight+" "+("number"==typeof t.size?t.size+"px":t.size)+" "+t.fontFamily;i=i.measureText(e).width,e=parseFloat(t.size)||16;return new eHt(i,e)}var IHt,THt=function(e,t,i,n,o,r,s){void 0===r&&(r=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=r,this.anchor=n,this.x=t,this.y=i,this.baseLine=s},EHt=function(e,t,i,n,o,r,s,a){this.id=e,this["fill-opacity"]=o,this["stroke-opacity"]=r,this.fill=t,this.stroke=n,this["stroke-width"]=i,this["stroke-dasharray"]=s,this.d=a},DHt=function(e,t,i){this.r=e,this.g=t,this.b=i},MHt=(zmt(kHt,IHt=EHt),kHt);function kHt(e,t,i,n,o,r,s,a,l){e=IHt.call(this,e,t,i.width,i.color,n,i.opacity)||this;return e.y=o.y,e.x=o.x,e.height=o.height,e.width=o.width,e.rx=r||0,e.ry=s||0,e.transform=a||"",e["stroke-dasharray"]=l,e["fill-opacity"]=n,e["stroke-opacity"]=i.opacity,e}zmt(FHt,PHt=EHt);var PHt,BHt=FHt;function FHt(e,t,i,n,o,r,s,a){e=PHt.call(this,e,t,i.width,i.color,n,i.opacity,a)||this;return e.cy=r,e.cx=o,e.r=s,e["stroke-dasharray"]=a,e["fill-opacity"]=n,e["stroke-opacity"]=i.opacity,e}zmt(RHt,LHt=EHt);var LHt,Qmt=RHt;function RHt(e,t,i,n,o,r,s,a){e=LHt.call(this,e,i,n,o,r=void 0===r?1:r,s=void 0===s?1:s,a=void 0===a?"":a)||this;return e.points=t,e}zmt(NHt,OHt=Qmt);var OHt,ost=NHt;function NHt(e,t,i,n,o,r,s,a){return OHt.call(this,e,t,i,n,o,r=void 0===r?1:r,s=void 0===s?1:s,a=void 0===a?"":a)||this}zmt(_Ht,VHt=EHt);var VHt,jee=_Ht;function _Ht(e,t,i,n,o,r,s,a){e=VHt.call(this,e,i,n,o,r=void 0===r?1:r,s=void 0===s?1:s,a=void 0===a?"":a)||this;return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}function HHt(e,t,i,n){this.x1=e,this.y1=t,this.x2=i,this.y2=n}function zHt(e,t,i,n,o,r,s,a,l){void 0===r&&(r="userSpaceOnUse"),void 0===s&&(s="userSpaceOnUse"),void 0===a&&(a=""),void 0===l&&(l=""),this.id=e,this.x=t,this.y=i,this.width=n,this.height=o,this.patternUnits=r,this.patternContentUnits=s,this.patternTransform=a,this.href=l}var jHt=function(e,t){this.x=e,this.y=t},WHt=function(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n};function QHt(e,t,i,n,o){void 0===o&&(o=!1);var r,i={id:e.id,x:e.x,y:e.y,fill:i,"font-size":t.size,"font-style":t.fontStyle,"font-family":t.fontFamily,"font-weight":t.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:t.opacity,"dominant-baseline":e.baseLine},s="string"==typeof e.text||"number"==typeof e.text?e.text:o?e.text[e.text.length-1]:e.text[0],a=new fo(""),l=a.createText(i,s);if(l.style["user-select"]="none",l.style["font-family"]=t.fontFamily,l.style["font-size"]=t.size,l.style["font-weight"]=t.fontWeight,l.style["font-color"]=t.color,l.style["-moz-user-select"]="none",l.style["-webkit-touch-callout"]="none",l.style["-webkit-user-select"]="none",l.style["-khtml-user-select"]="none",l.style["-ms-user-select"]="none",l.style["-o-user-select"]="none","string"!=typeof e.text&&1<e.text.length)for(var h=1,d=e.text.length;h<d;h++)r=AHt(e.text[h],t).height,r=a.createTSpan({x:e.x,id:e.id,y:e.y+(o?-h*r:h*r)},o?e.text[e.text.length-(h+1)]:e.text[h]),l.appendChild(r);return n.appendChild(l),l}function UHt(e,t,i,n,o,r){for(var s=Q("div",{id:t,className:o.element.id+"_marker_template_element"}),a=(s.style.cssText="position: absolute;pointer-events: auto;",e.length);0<a;)s.appendChild(e[0]),a--;if(!o.isReact||"function"!==r){for(var l=s.innerHTML,h=Object.keys(i),d=RegExp,p=0;p<h.length;p++)"object"==typeof i[h[p]]?l=GHt(l,"",i,o):"latitude"!==h[p].toLowerCase()&&"longitude"!==h[p].toLowerCase()&&(l=l.replace(new d("{{:"+h[p]+"}}","g"),i[h[p].toString()]));s.innerHTML=l}return s}function qHt(e,t){t=t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e;return t}function GHt(e,t,i,n){for(var o=""===e?t:e,r=""===e?o.split("${"):o.split("{{:"),s=RegExp,a=0;a<r.length;a++)if(-1<r[a].indexOf("}}")&&-1<r[a].indexOf(".")||-1<r[a].indexOf("}")&&-1<r[a].search("."))for(var l,h=""===e?r[a].split("}"):r[a].split("}}"),d=0;d<h.length;d++)-1<h[d].indexOf(".")&&(l=KHt(i,h[d]).toString(),o=""===e?o.split("${"+h[d]+"}").join(qHt(l,n)):o.replace(new s("{{:"+h[d]+"}}","g"),l));return o}function YHt(e,t,i){for(var n=(je(e.childElementCount)?e[0]:e).outerHTML,o=Object.keys(i),r=RegExp,s=0;s<o.length;s++)n=n.replace(new r("{{:"+o[s]+"}}","g"),i[o[s].toString()]);e=Q("div",{id:t,innerHTML:n});return e.style.position="absolute",e}function XHt(e,t,i,n,o,r,s){var a,l,h=o.size,d=o.borderColor,p=parseFloat(o.borderWidth),c=parseFloat(o.borderOpacity),u=o.fill,g=o.dashArray,m={color:d,width:p,opacity:c},o=o.opacity,p=new EHt(n,u,p,d,o,c,g,"");return h.width="string"==typeof h.width?parseInt(h.width,10):h.width,h.height="string"==typeof h.height?parseInt(h.height,10):h.height,"Circle"===e?(d=(h.width+h.height)/4,c=new BHt(n,u,m,o,i.x,i.y,d,g),s.renderer.drawCircle(c)):"Rectangle"===e?(a=i.x-h.width/2,l=i.y-h.height/2,d=new MHt(n,u,m,o,new WHt(a,l,h.width,h.height),null,null,"",g),s.renderer.drawRectangle(d)):"Image"===e?(a=i.x-h.width/2,l=i.y-(-1<n.indexOf("cluster")?h.height/2:h.height),I(p,{href:t,height:h.height,width:h.width,x:a,y:l}),s.renderer.drawImage(p)):mzt(s,e,p,h,i,r)}function KHt(e,t){if(!je(e)&&!je(t)){var i=t.replace(/\[/g,".").replace(/\]/g,"").split(".");if(1===i.length)e=e[i[0]];else for(var n=0;n<i.length&&!je(e);n++)e=e[i[n]]}return e}function JHt(e,t){var i=!je(e.colorValuePath)&&-1<e.colorValuePath.indexOf(".")?KHt(t,e.colorValuePath).toString():t[e.colorValuePath];return e.fill=je(e.colorValuePath)||je(i)?e.fill:-1<e.colorValuePath.indexOf(".")?KHt(t,e.colorValuePath).toString():t[e.colorValuePath],e}function ZHt(e,t){return je(e.shapeValuePath)||je(t[e.shapeValuePath])?(ezt(e,t),tzt(e,t)):(ezt(e,t),"Image"===t[e.shapeValuePath]&&tzt(e,t)),e}function $Ht(e,t){return-1<e.indexOf(".")?KHt(t,e).toString():t[e]}function ezt(e,t){je(e.shapeValuePath)||(t=$Ht(e.shapeValuePath,t),e.shape=je(t)||""===t.toString()?e.shape:t)}function tzt(e,t){je(e.imageUrlValuePath)||(t=$Ht(e.imageUrlValuePath,t),e.imageUrl=je(t)?e.imageUrl:t)}function izt(l,h,d,p,c,u,o,r,s,g,a){var m,f,y,v,b,w,C,S=[],A=[],x=0,I=0,T=l.markerSettings[c],E=0,D=[],M=!a&&l.markerClusterSettings.allowClustering?l.markerClusterSettings:T.clusterSettings,k=M.labelStyle,P=d.renderer.createGroup({id:d.element.id+"_LayerIndex_"+p+"_markerCluster"}),B={cancel:!1,name:Q3t,fill:M.fill,height:M.height,width:M.width,imageUrl:M.imageUrl,shape:M.shape,data:void 0,maps:d,cluster:M,border:M.border},F=d.element.getBoundingClientRect(),L=(d.isTileMap?new Object:Ezt(d,l,!1),d.isTileMap||(C=d.mapLayerPanel.calculateFactor(l)),!1),R=d.isTileMap?d.tileZoomLevel:d.mapScaleValue,O=T.clusterSettings.allowClustering||l.markerClusterSettings.allowClustering&&1<l.markerSettings.length?h.querySelectorAll("[id*='LayerIndex_"+p+"_MarkerIndex_"+c+"']:not([id*='_Group'])"):h.childNodes;return d.trigger("markerClusterRendering",B,function(e){for(Array.prototype.forEach.call(O,function(e,i){var t,n,o,r,s,a;D=[],"hidden"!==e.style.visibility?(m=(w=e).getBoundingClientRect(),D.push(i),je(m)||(je(t=0<d.markerModule.zoomedMarkerCluster.length&&d.markerModule.zoomedMarkerCluster[p]&&d.markerModule.zoomedMarkerCluster[p][i]&&0<d.markerModule.zoomedMarkerCluster[p][i].length||0<d.markerModule.initialMarkerCluster.length&&d.markerModule.initialMarkerCluster[p]&&d.markerModule.initialMarkerCluster[p][i]&&0<d.markerModule.initialMarkerCluster[p][i].length?(d.previousScale<R?d.markerModule.zoomedMarkerCluster:d.markerModule.initialMarkerCluster)[p][i]:null)||0===t.length||T.clusterSettings.allowClustering?Array.prototype.forEach.call(O,function(e,t){i+1<=t&&"hidden"!==e.style.visibility&&ozt(e,m,S,D,t)}):Array.prototype.forEach.call(t,function(e){var t;i!==e&&(t=document.getElementById(d.element.id+"_LayerIndex_"+p+"_MarkerIndex_"+c+"_dataIndex_"+e))&&"hidden"!==t.style.visibility&&ozt(t,m,S,D,e)}),nzt(d,R,p,i,D),x=m.left+m.width/2,I=m.top+m.height,0<S.length&&(D=D.filter(function(e,t,i){return i.indexOf(e)===t}),x-=F.left,I-=d.availableSize.height<=F.height?F.top:F.bottom-F.top,t=parseInt(e.id.split("_dataIndex_")[1].split("_")[0],10),n=parseInt(e.id.split("_MarkerIndex_")[1].split("_")[0],10),r=(o=l.markerSettings[n]).dataSource[t],s=je(o.longitudeValuePath)?je(r.longitude)?je(r.Longitude)?0:parseFloat(r.Longitude):parseFloat(r.longitude):Number(KHt(r,o.longitudeValuePath)),r=je(o.latitudeValuePath)?je(r.latitude)?je(r.Latitude)?0:parseFloat(r.Latitude):parseFloat(r.latitude):Number(KHt(r,o.latitudeValuePath)),d.isTileMap?d.isTileMap&&(a=hHt(new wHt(s,r),d.tileZoomLevel,d.tileTranslatePoint,!0)):a=aHt(r,s,C,l,d),e.style.visibility="hidden",B.cancel?(b={size:new eHt(M.width,M.height),fill:M.fill,borderColor:M.border.color,borderWidth:M.border.width,opacity:M.opacity,dashArray:M.dashArray,imageUrl:M.imageUrl,shape:M.shape}).borderOpacity=(je(M.border.opacity)?M:M.border).opacity:(b={size:new eHt(B.width,B.height),fill:B.fill,borderColor:B.border.color,borderWidth:B.border.width,opacity:M.opacity,dashArray:M.dashArray,imageUrl:B.imageUrl,shape:B.shape}).borderOpacity=(je(B.border.opacity)?M:B.border).opacity,x=d.isTileMap||-1<h.id.indexOf("_Markers_Group")?x:x+3.75-B.width/2,I=d.isTileMap||-1<h.id.indexOf("_Markers_Group")?I:I-B.height/2,I=d.isTileMap?(x=a.x,a.y):(x=(a.x+(je(d.translatePoint)||0===d.translatePoint.x||d.isResize?g.location:d.translatePoint).x)*(je(d.scale)?g:d).scale+o.offset.x,(a.y+(je(d.translatePoint)||0===d.translatePoint.y||d.isResize?g.location:d.translatePoint).y)*(je(d.scale)?g:d).scale+o.offset.y),r=d.element.id+"_LayerIndex_"+p+"_MarkerIndex_"+n+"_dataIndex_"+t+"_cluster_"+E,s=d.element.id+"_LayerIndex_"+p+"_MarkerIndex_"+n+"_dataIndex_"+t+"_cluster_"+E+"_datalabel_"+E,E++,(e=XHt(b.shape,b.imageUrl,{x:0,y:0},r,b,u,d)).setAttribute("transform","translate( "+x+" "+I+" )"),"Balloon"===B.shape?e.children[0].textContent=D.toString():e.textContent=D.toString(),y=new THt(s,0,3.75,"middle",(S.length+1).toString(),"",""),(y=QHt(y,k,k.color,u)).setAttribute("transform","translate( "+x+" "+I+" )"),a=parseFloat(e.id.split("_MarkerIndex_")[1]),o.clusterSettings.allowClustering&&a===n||l.markerClusterSettings.allowClustering&&1<l.markerSettings.length&&a===n?(P.appendChild(e),P.appendChild(y)):(P.appendChild(y),P.appendChild(e)))),S=[]):nzt(d,R,p,i,D),L=!0}),o.appendChild(P),d.svgObject.appendChild(o),d.element.appendChild(d.svgObject),M.allowDeepClustering&&!a&&Array.prototype.forEach.call(P.childNodes,function(e,t){if("hidden"!==e.style.visibility&&!(je(m=(w=e).getBoundingClientRect())||-1<w.id.indexOf("_datalabel_"))){for(var i=t+1;i<P.childElementCount;i++)"hidden"!==P.childNodes[i].style.visibility&&(v=P.childNodes[i],je(f=v.getBoundingClientRect())||-1<v.id.indexOf("_datalabel_")||m.left>f.right||m.right<f.left||m.top>f.bottom||m.bottom<f.top||(A.push(v),A.push(P.childNodes[i-1]),P.childNodes[i].style.visibility="hidden",o=je(P.childNodes[i+1])?null:parseFloat(P.childNodes[i+1].id.split("_MarkerIndex_")[1]),T.clusterSettings.allowClustering&&o===c||l.markerClusterSettings.allowClustering&&1<l.markerSettings.length&&o===c?P.childNodes[i+1].style.visibility="hidden":(o=parseFloat(P.childNodes[i-1].id.split("_MarkerIndex_")[1]),P.childNodes[i-1].style.visibility=o===c?"hidden":P.childNodes[i-1].style.visibility),D.push(i)));if(0<A.length){w=e;for(var n=0;n<A.length;n++){"g"===w.tagName?w.childNodes[0].textContent=w.childNodes[0].textContent+","+A[n].textContent:w.textContent=w.textContent+","+A[n].textContent;var o=parseFloat(P.childNodes[t+1].id.split("_MarkerIndex_")[1]);T.clusterSettings.allowClustering&&o===c||l.markerClusterSettings.allowClustering&&1<l.markerSettings.length&&o===c?P.childNodes[t+1].textContent=(+P.childNodes[t+1].textContent+ +A[n+1].textContent).toString():(o=parseFloat(P.childNodes[t-1].id.split("_MarkerIndex_")[1]),P.childNodes[t-1].textContent=o===c?(+P.childNodes[t-1].textContent+ +A[n+1].textContent).toString():P.childNodes[t-1].textContent),n++}}A=[]}});0<P.childNodes.length;){var t=parseFloat(P.childNodes[0].id.split("_MarkerIndex_")[1]);T.clusterSettings.allowClustering&&t===c||l.markerClusterSettings.allowClustering&&1<l.markerSettings.length&&t===c?u.insertBefore(P.childNodes[0],null):t===c&&u.insertBefore(P.childNodes[0],u.firstChild)}r||kzt(d.element.id+"_Secondary_Element").appendChild(u);var i=document.getElementById(d.element.id+"_LayerIndex_"+p+"_Polygon_Group"),n=document.getElementById(d.element.id+"_LayerIndex_"+p+"_Polygons_Group"),i=(je(i)&&!d.isTileMap?o.insertBefore(u,o.firstChild):d.isTileMap?je(n)?je(i)?o.insertBefore(u,o.firstChild):i.insertAdjacentElement("afterend",u):n.insertAdjacentElement("afterend",u):o.appendChild(u),document.getElementById(d.element.id+"_LayerIndex_"+p+"_markerCluster"));je(i)||i.remove(),s&&(n=document.getElementById(d.element.id+"_Layer_Collections"),i=document.getElementById(d.element.id+"_LayerIndex_"+(p+1)),je(n)||je(i)?je(n)||n.appendChild(o):n.insertBefore(o,i))}),L}function nzt(e,t,i,n,o){var r;1===t?(r=!je(e.markerModule.initialMarkerCluster[i][n])&&1<o.length?o:[],e.markerModule.initialMarkerCluster[i][n]=r,r=!je(e.markerModule.zoomedMarkerCluster[i][n])&&1<o.length?o:[],e.markerModule.zoomedMarkerCluster[i][n]=r):1<t&&(e.markerModule.zoomedMarkerCluster[i][n]=1<o.length?o:[])}function ozt(e,t,i,n,o){var r=e.getBoundingClientRect();je(r)||t.left>r.right||t.right<r.left||t.top>r.bottom||t.bottom<r.top||(i.push(r),e.style.visibility="hidden",n.push(o))}function rzt(e,t){for(var i,n=e[0].layerIndex,o=e[0].targetClusterIndex,r=e[0].markerIndex,s=e[0].dataIndex,a=t.element.id+"_LayerIndex_"+n+"_MarkerIndex_"+r,s=a+"_dataIndex_"+s+"_cluster_"+o,l="Balloon"===t.layers[n].markerClusterSettings.shape?Lzt(s+"_Group"):Lzt(s),s=Lzt(s+"_datalabel_"+o),h=(l.setAttribute("visibility","visible"),s.setAttribute("visibility","visible"),e[0].data.length),d=0;d<h;d++)(i=Lzt(a+"_dataIndex_"+e[0].data[d].index+"_Group")?Lzt(a+"_dataIndex_"+e[0].data[d].index+"_Group"):Lzt(a+"_dataIndex_"+e[0].data[d].index)).style.visibility="hidden",-1<i.id.indexOf("Group")&&(Lzt(a+"_dataIndex_"+e[0].data[d].index).style.visibility="hidden");Izt(t.element.id+"_LayerIndex_"+n+"_MarkerIndex_"+r+"_markerClusterConnectorLine")}function szt(e,t,i,n){for(var o=e[0].layerIndex,r=e[0].markerIndex,s=e[0].targetClusterIndex,a=e[0].dataIndex,l=n?Lzt:i.querySelector.bind(i),h=n?"":"#",d=t.element.id+"_LayerIndex_"+o+"_MarkerIndex_"+r,p=t.layers[o],c=!t.markerModule.allowInnerClusterSetting(p)&&p.markerClusterSettings.allowClustering?p.markerClusterSettings:p.markerSettings[r].clusterSettings,p=p.markerSettings[r],u=d+"_dataIndex_"+a+"_cluster_"+s,g="Balloon"===c.shape?l(h+u+"_Group"):l(h+u),u=l(h+u+"_datalabel_"+s),m=(g.setAttribute("visibility","hidden"),u.setAttribute("visibility","hidden"),l(h+d+"_dataIndex_"+a+"_Group")?l(h+d+"_dataIndex_"+a+"_Group"):l(h+d+"_dataIndex_"+a)),f=(-1<m.parentElement.id.indexOf("Template_Group")?m.getBoundingClientRect():p).height,y=(-1<m.parentElement.id.indexOf("Template_Group")?m.getBoundingClientRect():p).width,v=+g.getAttribute("transform").split("translate(")[1].trim().split(" ")[0],b=+g.getAttribute("transform").split("translate(")[1].trim().split(" ")[1].split(")")[0].trim(),w=(y="string"==typeof y?parseFloat(y):y)+5,C=6.28*w,S=0,A=Math.round(C/y),x=(S+=A,e[0].data.length),I=Math.round(f/C*100),T=(x<A?100/x:I)/100*360,E=x<A?45:0,D=1,M="M "+v+" "+b+" ",k="",P=0;P<x;P++){if(S===P||360<=Math.round(E)){for(E=0,C=6.28*(w=(y+5)*++D),A=Math.round(C/f),I=Math.round(f/C*100);I*A<100;)A++;T=I/100*360,S+=A}var B=v+w*Math.sin(2*Math.PI*E/360),F=b+w*Math.cos(2*Math.PI*E/360);k+=M+"L "+B+" "+F+" ",-1<(m=l(h+d+"_dataIndex_"+e[0].data[P].index+"_Group")?l(h+d+"_dataIndex_"+e[0].data[P].index+"_Group"):l(h+d+"_dataIndex_"+e[0].data[P].index)).parentElement.id.indexOf("Template_Group")&&(m.style.transform="",m.style.left=t.isTileMap?B-y/2+"px":B-y/2-10+"px",m.style.top=t.isTileMap?F-f/2+"px":F-f/2-10+"px"),m.setAttribute("transform","translate( "+B+" "+F+")"),m.style.visibility="visible",-1<m.id.indexOf("Group")&&(l(h+d+"_dataIndex_"+e[0].data[P].index).style.visibility="visible"),E+=T}s=c.connectorLineSettings,u={d:k,id:t.element.id+"_LayerIndex_"+o+"_MarkerIndex_"+r+"_dataIndex_"+a+"_markerClusterConnectorLine",stroke:s.color,"fill-opacity":s.opacity,"stroke-opacity":s.opacity,"stroke-width":s.width};i=n?l(t.element.id+"_Markers_Group"):i;i=l(t.element.id+"_LayerIndex_"+o).querySelector("#"+i.id);g=t.renderer.createGroup({id:t.element.id+"_LayerIndex_"+o+"_MarkerIndex_"+r+"_markerClusterConnectorLine"});g.appendChild(t.renderer.drawPath(u)),"Balloon"===p.shape?i.insertBefore(g,i.querySelector("#"+d+"_dataIndex_0_Group")):i.insertBefore(g,i.querySelector("#"+d+"_dataIndex_0"))}function azt(e,t,i,n,o,r,s,a,l,h,d){var p={size:new eHt(e.width,e.height),fill:e.fill,borderColor:e.border.color,borderWidth:e.border.width,opacity:t.opacity,dashArray:t.dashArray,borderOpacity:(je(e.border.opacity)?t:e.border).opacity},e=(Izt(s),XHt(e.shape,e.imageUrl,{x:0,y:0},s,p,d,h)),s=(h.isTileMap?o.x:(o.x+r.x)*l)+(je(a)||je(a.x)?0:a.x),p=(h.isTileMap?o.y:(o.y+r.y)*l)+(je(a)||je(a.y)?0:a.y),r=(e.setAttribute("transform","translate( "+s+" "+p+" )"),hzt(h.selectedMarkerElementId,h.markerSelectionClass,e,"MarkerselectionMapStyle"),h.legendSettings.toggleLegendSettings.enable&&"Markers"===h.legendSettings.type&&(o=parseInt(e.id.split("_LayerIndex_")[1],10),dzt(h.toggledElementId,"g"===e.tagName?e.children[0]:e,h.legendSettings.toggleLegendSettings.applyShapeSettings?h.layers[o].shapeSettings:h.legendSettings.toggleLegendSettings)),d.appendChild(e),i.length-1===n?"marker":null),l=new wHt(s,p);return(0<t.animationDuration||"Enable"===Ut)&&Qzt(e,t.animationDelay,t.animationDuration,l,h,r),d}function lzt(e,t,i,n,o,r,s,a,l,h,d){if((t=Fzt(e.template,d))&&t(n,d,e.template,d.element.id+"_MarkerTemplate"+o,!1).length){for(var p=UHt(t(n,d,e.template,d.element.id+"_MarkerTemplate"+o,!1),i,n,0,d,typeof e.template),c=0;c<p.children.length;c++)p.children[c].style.pointerEvents="auto";p.style.left=(d.isTileMap?s.x:(s.x+a.x)*l)+h.x-(d.isTileMap?0:d.mapAreaRect.x)+"px",p.style.top=(d.isTileMap?s.y:(s.y+a.y)*l)+h.y-(d.isTileMap?0:d.mapAreaRect.y)+"px",p.style.transform="translate(-50%, -50%)",r.appendChild(p)}return r}function hzt(e,t,i,n){if(e)for(var o=0;o<e.length;o++)i.getAttribute("id")===e[o]&&(0!==o&&"g"!==i.tagName||(je(t)||je(t.id)||document.body.appendChild(t),-1<i.id.indexOf("_MarkerIndex_")&&0<i.childElementCount&&i.children[0].setAttribute("class",n)),i.setAttribute("class",n))}function dzt(e,t,i){if(!je(e)&&0<e.length)for(var n=0;n<e.length;n++)e[n]===t.id&&(t.setAttribute("fill",i.fill),t.setAttribute("stroke",i.border.color),t.setAttribute("fill-opacity",i.opacity.toString()),t.setAttribute("stroke-opacity",(je(i.border.opacity)?i:i.border).opacity.toString()),t.setAttribute("stroke-width",(je(i.border.width)?0:i.border.width).toString()))}function pzt(e,t,i,n,o,r,s){Lzt(e)||((e=Q("style",{id:e})).innerText="."+t+"{fill:"+i+";opacity:"+n+";stroke-width:"+r+";stroke:"+o+";}",s.shapeSelectionClass=e,document.body.appendChild(e))}function czt(e,t){return t&&t.appendChild(e),e}function uzt(e,t,i){return czt(e.renderer.drawCircle(t),i)}function gzt(e,t,i){return czt(e.renderer.drawRectangle(t),i)}function mzt(e,t,i,n,o,r){var s;switch(t){case"Balloon":s=fzt(e,i,n,o,"Marker",r);break;case"Cross":i.d="M "+o.x+" "+(o.y-n.height/2)+" L "+o.x+" "+(o.y+n.height/2)+" M "+(o.x-n.width/2)+" "+o.y+" L "+(o.x+n.width/2)+" "+o.y;break;case"Diamond":i.d="M "+o.x+" "+(o.y-n.height/2)+" L "+(o.x+n.width/2)+" "+o.y+" L "+o.x+" "+(o.y+n.height/2)+" L "+(o.x-n.width/2)+" "+o.y+" Z";break;case"Star":i.d="M "+(o.x+n.width/3)+" "+(o.y+n.height/2)+" L "+(o.x-n.width/2)+" "+(o.y-n.height/6)+" L "+(o.x+n.width/2)+" "+(o.y-n.height/6)+" L "+(o.x-n.width/3)+" "+(o.y+n.height/2)+" L "+o.x+" "+(o.y-n.height/2)+" L "+(o.x+n.width/3)+" "+(o.y+n.height/2)+" Z";break;case"Triangle":i.d="M "+o.x+" "+(o.y-n.height/2)+" L "+(o.x+n.width/2)+" "+(o.y+n.height/2)+" L "+(o.x-n.width/2)+" "+(o.y+n.height/2)+" Z";break;case"HorizontalLine":i.d=" M "+(o.x-n.width/2)+" "+o.y+" L "+(o.x+n.width/2)+" "+o.y;break;case"VerticalLine":i.d="M "+o.x+" "+(o.y-n.height/2)+" L "+o.x+" "+(o.y+n.height/2);break;case"InvertedTriangle":i.d="M "+(o.x-n.width/2)+" "+(o.y-n.height/2)+" L "+(o.x+n.width/2)+" "+(o.y-n.height/2)+" L "+o.x+" "+(o.y+n.height/2)+" Z";break;case"Pentagon":for(var a,l,h=0;h<5;h++)a=n.width/2*Math.cos(Math.PI/180*(72*h)),l=n.height/2*Math.sin(Math.PI/180*(72*h)),i.d+=(0===h?"M ":"L ")+(o.x+a)+" "+(o.y+l);i.d+=" Z"}return"Cross"!==t&&"HorizontalLine"!==t&&"VerticalLine"!==t||(i.stroke="transparent"===i.stroke?i.fill:i.stroke),"Balloon"===t?s:e.renderer.drawPath(i)}function fzt(e,t,i,n,o,r){var s=i.width,a=i.height,s=(n.x-=s/2,n.y-=-1<t.id.indexOf("cluster")?a/2:-1<t.id.indexOf("Legend")?a/1.25:a,t.d="M15,0C8.8,0,3.8,5,3.8,11.2C3.8,17.5,9.4,24.4,15,30c5.6-5.6,11.2-12.5,11.2-18.8C26.2,5,21.2,0,15,0z M15,16c-2.8,0-5-2.2-5-5s2.2-5,5-5s5,2.2,5,5S17.8,16,15,16z",e.renderer.drawPath(t)),a=i.width/30,i=i.height/30;return s.setAttribute("transform","translate("+n.x+", "+n.y+") scale("+a+", "+i+")"),"Marker"===o?(czt(s,n=e.renderer.createGroup({id:t.id+"_Group"})),czt(n,r)):s}function yzt(e,t,i,n,o){if(!je(t)&&!je(e)&&!je(i))for(var r=0;r<e.length;r++){var s=-1<i.indexOf(".")?KHt(e[r],i):e[r][i],a=vzt(s,n,t);if((!je(s)&&isNaN(t[a])&&"string"==typeof s?s.toLowerCase():s)===(!je(t[a])&&isNaN(t[a])?t[a].toLowerCase():t[a]))return r}return null}function vzt(e,t,i){if(!je(e)&&!je(i)&&!je(t))for(var n="[object Array]"===Object.prototype.toString.call(t)?t:[t],o=0;o<n.length;o++)if((je(e)||"string"!=typeof e?e:e.toLowerCase())===(!je(i[n[o]])&&isNaN(i[n[o]])?i[n[o]].toLowerCase():i[n[o]]))return n[o];return null}function bzt(e,t,i){for(var n=[],o=0;o<e.length;o++){var r=e[o];t<=r.y&&i>=r.y&&n.push(r)}return n}function wzt(e,t,i,n,o){return o===n?(t-e)/100+e:(t-e)/100*(100/(o-n)*(i-n))+e}function Czt(e,t,i){if(!e.length)return null;for(var n,o,r,s,a=e.length,l=0,h=0,d=0,p=0;p<=a-1;p++)n=e[p].x,o="Mercator"===t||"Normal"===i?e[p].y:-e[p].y,s=p===a-1?(r=e[0].x,"Mercator"===t||"Normal"===i?e[0].y:-e[0].y):(r=e[p+1].x,"Mercator"===t||"Normal"===i?e[p+1].y:-e[p+1].y),l+=Math.abs(n*s-r*o),h+=Math.abs((n+r)*(n*s-r*o)),d+=Math.abs((o+s)*(n*s-r*o));l*=.5;for(var c=e.some(function(e){return e.x<5&&e.y<5})&&"Normal"===i?6:4,h=0!==l?1/(c*l)*h:0,d=0!==l?1/(c*l)*d:0,u={x:0,y:0},g={x:0,y:0},m={x:0,y:0},f={x:0,y:0},y={x:0,y:0},v={x:0,y:0},b={x:0,y:0},w={x:0,y:0},C=0,p=0;p<=a-1;p++){var S=e[p];S.y="Mercator"===t||"Normal"===i?S.y:-S.y,S.y>d?S.x<h&&h-S.x<h-y.x?y={x:S.x,y:S.y}:S.x>h&&(0===v.x||S.x-h<v.x-h)&&(v={x:S.x,y:S.y}):S.x<h&&h-S.x<h-b.x?b={x:S.x,y:S.y}:S.x>h&&(0===w.x||S.x-h<w.x-h)&&(w={x:S.x,y:S.y}),C=v.y-w.y+(v.y-w.y)/4,S.x>h?S.y<d&&d-S.y<d-u.y?u={x:S.x,y:S.y}:S.y>d&&(0===g.y||S.y-d<g.y-d)&&(g={x:S.x,y:S.y}):S.y<d&&d-S.y<d-m.y?m={x:S.x,y:S.y}:S.y>d&&(0===f.y||S.y-d<f.y-d)&&(f={x:S.x,y:S.y})}return{x:h,y:d,rightMin:u,rightMax:g,leftMin:m,leftMax:f,points:e,topMax:w,topMin:b,bottomMax:v,bottomMin:y,height:C}}function Szt(e){var t=!1;return"[object Array]"===Object.prototype.toString.call(e)&&Array.prototype.forEach.call(e,function(e){je(e.geometry)||"Path"!==e.geometry.type||(t=!0)}),t}function Azt(e,t,i,n,o,r){var s=t;if(e<(n=je(n)?(o?xHt:AHt)(t,i).width:n))for(var a=t.length-1;0<=a;--a)if((n=(o?xHt:AHt)(s=t.substring(0,a)+"...",i).width)<=e||s.length<4)return s.length<4&&(s=" "),je(r)||r.push(n),s;return je(r)||r.push(n),s}function xzt(e,t,i,n){var o;switch(t){case"Near":o=e.x;break;case"Center":o="title"===n?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":o="title"===n?e.width-e.y-i.width:e.x+e.width-i.width}t="title"===n?e.y+i.height/2:e.y+e.height/2+i.height/2;return new wHt(o,t)}function Izt(e){e=document.getElementById(e);return e?ue(e):null}function Tzt(e,t){var i=aHt(e.minLatOfGivenLocation,e.minLongOfGivenLocation,e.mapLayerPanel.calculateFactor(t),t,e),t=aHt(e.maxLatOfGivenLocation,e.maxLongOfGivenLocation,e.mapLayerPanel.calculateFactor(t),t,e),e=(i.x+t.x)/2,i=(i.y+t.y)/2;return new wHt(e,i)}function Ezt(e,t,i){var n,o,r,s,a=e.zoomSettings.zoomFactor,l=e.centerPosition,h=l.latitude,d=l.longitude,p=!je(e.centerLatOfGivenLocation)&&!je(e.centerLongOfGivenLocation)&&e.zoomNotApplied,c=(je(e.mapScaleValue)&&(e.mapScaleValue=a),e.zoomSettings.shouldZoomInitially&&e.zoomSettings.enable&&(e.mapScaleValue=o=a=(e.zoomSettings.shouldZoomInitially||e.enablePersistence)&&1===e.scale?e.scale:je(e.markerZoomFactor)?1:e.markerZoomedState?e.markerZoomFactor:parseInt(e.scale.toString()),e.markerZoomedState&&e.mapScaleValue!==e.markerZoomFactor&&!e.enablePersistence&&(e.mapScaleValue=a=e.markerZoomFactor),!e.markerZoomedState||je(e.markerCenterLatitude)||je(e.markerCenterLongitude)||(h=e.markerCenterLatitude,d=e.markerCenterLongitude)),p&&(e.mapScaleValue=o=a=e.scaleOfGivenLocation),je(e.baseMapRectBounds)?null:e.baseMapRectBounds.min),u=je(e.baseMapRectBounds)?null:e.baseMapRectBounds.max,g=i?1:e.mapScaleValue,m=(je(e.currentShapeDataLength)&&!je(t.shapeData)&&(e.currentShapeDataLength=je(t.shapeData.features)?je(t.shapeData.geometries)?0:t.shapeData.geometries.length:t.shapeData.features.length),e.totalRect&&e.legendSettings.visible?e.totalRect:e.mapAreaRect),f=e.availableSize;return je(c)||je(u)||(n=Math.abs(u.x-c.x),u=Math.abs(c.y-u.y),i=i?1:1===e.markerZoomFactor?e.mapScaleValue:a,l=e.zoomSettings.shouldZoomInitially&&e.markerZoomedState&&!e.zoomPersistence?e.markerZoomCenterPoint:e.centerPosition,!je(d)&&0!==d&&!je(h)&&0!==h||p?(a=((n+Math.abs(e.mapAreaRect.width-n))/2+e.mapAreaRect.x)/i,l=((u+Math.abs(e.mapAreaRect.height-u))/2+e.mapAreaRect.y)/i,i=p?Tzt(e,t):aHt(h,d,e.mapLayerPanel.calculateFactor(t),t,e),o=je(e.previousProjection)||e.previousProjection!==e.projectionType||e.isMarkerZoomCompleted?(r=-i.x+a,s=-i.y+l,g):(1!==Math.floor(e.scale)&&e.zoomSettings.shouldZoomInitially||e.zoomNotApplied?(r=-i.x+a,s=-i.y+l):e.zoomSettings.shouldZoomInitially||e.zoomNotApplied?(r=-i.x+a,s=-i.y+l,o=g):(r=e.zoomTranslatePoint.x,s=e.zoomTranslatePoint.y),e.mapScaleValue)):je(e.previousProjection)||e.previousProjection!==e.projectionType?(0!==u&&0!==n&&u!==n||(n=m.width/2,u=m.height),o=parseFloat(Math.min(m.width/n,m.height/u).toFixed(2)),p=0!==c.x&&"layers"===e.translateType?f.width-m.width:0,r=m.x+(-c.x+(m.width/2-(n*=o=1.05<o?1:o)/2))-p,s=m.y+(-c.y+(m.height/2-(u*=o)/2)),e.previousTranslate=new wHt(r,s)):e.zoomSettings.shouldZoomInitially||1!==e.markerZoomFactor||1!==e.mapScaleValue?(o=e.mapScaleValue<1?e.mapScaleValue+1:e.mapScaleValue,e.mapScaleValue=e.zoomSettings.enable&&1!==e.mapScaleValue?e.mapScaleValue:1,e.currentShapeDataLength!==(je(t.shapeData.features)?t.shapeData.geometries:t.shapeData.features).length&&"SubLayer"!==t.type?(h=parseFloat(Math.min(m.height/u,m.width/n).toFixed(2)),s=m.y+(-c.y+(m.height/2-(u*=h)/2)),r=m.x+(-c.x+(m.width/2-(n*=o=h)/2))):e.availableSize.height===e.heightBeforeRefresh&&e.widthBeforeRefresh===e.availableSize.width||je(e.translatePoint)||je(e.previousTranslate)?je(e.previousProjection)||!(1===e.mapScaleValue||e.mapScaleValue<=1.05)||e.zoomModule.isDragZoom?(r=e.zoomTranslatePoint.x,s=e.zoomTranslatePoint.y,o=e.scale):(o=parseFloat(Math.min(m.width/n,m.height/u).toFixed(2)),r=m.x+(-c.x+(m.width/2-(n*=o=1.05<o?1:o)/2)),s=m.y+(-c.y+(m.height/2-(u*=o)/2))):(d=parseFloat(Math.min(m.width/n,m.height/u).toFixed(2)),a=n,i=u,l=m.x+(-c.x+(m.width/2-(a*=d)/2)),g=m.y+(-c.y+(m.height/2-(i*=d)/2)),f=(e.translatePoint.x-e.previousTranslate.x)/e.widthBeforeRefresh,p=(e.translatePoint.y-e.previousTranslate.y)/e.heightBeforeRefresh,r=l+f*e.availableSize.width,s=g+p*e.availableSize.height,e.previousTranslate=new wHt(l,g),e.zoomTranslatePoint.x=r,e.zoomTranslatePoint.y=s)):(o=parseFloat(Math.min(m.width/n,m.height/u).toFixed(2)),s=m.y+(-c.y+(m.height/2-(u*=o)/2)),r=m.x+(-c.x+(m.width/2-(n*=o)/2))),je(e.translatePoint))||(r=e.enablePersistence&&0!==e.translatePoint.x&&!e.zoomNotApplied?e.translatePoint.x:r,s=e.enablePersistence&&0!==e.translatePoint.y&&!e.zoomNotApplied?e.translatePoint.y:s),o=e.enablePersistence?1<=e.mapScaleValue?e.mapScaleValue:1:o,e.widthBeforeRefresh=e.availableSize.width,e.heightBeforeRefresh=e.availableSize.height,{scale:o,location:new wHt(r,s)}}function Dzt(e,t,i){var n,o,r=e.zoomSettings.zoomFactor,s=e.centerPosition,a=s.latitude,s=s.longitude,l=!je(e.centerLongOfGivenLocation)&&!je(e.centerLatOfGivenLocation)&&e.zoomNotApplied,h=(je(e.previousCenterLatitude)&&je(e.previousCenterLongitude)?(e.previousCenterLatitude=e.centerPosition.latitude,e.previousCenterLongitude=e.centerPosition.longitude):e.previousCenterLatitude!==e.centerPosition.latitude&&e.previousCenterLongitude!==e.centerPosition.longitude?(e.centerPositionChanged=!0,e.previousCenterLatitude=e.centerPosition.latitude,e.previousCenterLongitude=e.centerPosition.longitude):e.centerPositionChanged=!1,(je(e.mapScaleValue)||r>e.mapScaleValue)&&(e.isReset&&1===e.mapScaleValue?e.mapScaleValue=e.mapScaleValue:!je(e.mapScaleValue)&&e.mapScaleValue<=e.scale?e.mapScaleValue=e.scale:e.mapScaleValue=r),e.mapScaleValue=1!==e.zoomSettings.zoomFactor&&e.zoomSettings.zoomFactor===e.mapScaleValue||e.zoomSettings.zoomFactor===e.mapScaleValue||e.centerPositionChanged?e.zoomSettings.zoomFactor:e.mapScaleValue,e.zoomSettings.shouldZoomInitially&&!e.isZoomByPosition&&(e.mapScaleValue=r=v=(e.enablePersistence||e.zoomSettings.shouldZoomInitially)&&1===e.scale?e.scale:je(e.markerZoomFactor)?e.mapScaleValue:e.markerZoomFactor,r=e.mapScaleValue,je(e.markerCenterLatitude)||je(e.markerCenterLongitude)||(a=e.markerCenterLatitude,s=e.markerCenterLongitude)),l&&(e.mapScaleValue=v=r=e.scaleOfGivenLocation),i?1:e.mapScaleValue),d=e.mapAreaRect,p=e.baseMapRectBounds.min,c=e.baseMapRectBounds.max,u=i?1:e.mapScaleValue,g=Math.abs(c.x-p.x),c=Math.abs(p.y-c.y);if(!je(s)&&0!==s&&!je(a)&&0!==a||l){var m=(c+Math.abs(e.mapAreaRect.height-c))/2/u,f=(g+Math.abs(e.mapAreaRect.width-g))/2/u,u=l?Tzt(e,t):aHt(a,s,e.mapLayerPanel.calculateFactor(t),t,e);je(e.zoomTranslatePoint)&&je(e.previousProjection)||e.zoomNotApplied?(n=-u.x+f+e.mapAreaRect.x/h,o=-u.y+m+e.mapAreaRect.y/h):e.previousProjection!==e.projectionType?(n=-u.x+f,o=-u.y+m):(e.isZoomByPosition&&(e.zoomTranslatePoint.x=-u.x+f,e.zoomTranslatePoint.y=-u.y+m),n=e.zoomTranslatePoint.x,o=e.zoomTranslatePoint.y,r=h),je(e.translatePoint)||(o=e.enablePersistence&&0!==e.translatePoint.y&&!e.zoomNotApplied?e.translatePoint.y:o,n=e.enablePersistence&&0!==e.translatePoint.x&&!e.zoomNotApplied?e.translatePoint.x:n),v=0!==r?r:1}else{var l=0===e.zoomSettings.zoomFactor?1:e.zoomSettings.zoomFactor,y=e.zoomSettings.maxZoom,v=l=y<l?y:l,a=0===e.mapScaleValue?1:e.mapScaleValue>y?y:e.mapScaleValue,f=d.x+(-p.x+(d.width/2-g/2)),m=d.y+(-p.y+(d.height/2-c/2));if(!je(e.zoomTranslatePoint)||!je(e.previousProjection))if(e.previousProjection!==e.projectionType){var b=[];b.push({x:f,y:m});for(var w=1;w<y;w++){var C=b[w-1].x-(d.width/w-d.width/(w+1))/2,S=b[w-1].y-(d.height/w-d.height/(w+1))/2;b.push({x:C,y:S})}f=b[l-1].x,m=b[l-1].y}else f=e.zoomTranslatePoint.x,m=e.zoomTranslatePoint.y,l!==a&&(v=a);je(e.translatePoint)||(n=e.enablePersistence&&0!==e.translatePoint.x&&!e.zoomNotApplied?e.translatePoint.x:f,o=e.enablePersistence&&0!==e.translatePoint.y&&!e.zoomNotApplied?e.translatePoint.y:m)}return v=e.enablePersistence?0===e.mapScaleValue?1:e.mapScaleValue:v,e.widthBeforeRefresh=e.availableSize.width,e.heightBeforeRefresh=e.availableSize.height,{scale:i?1:v,location:new wHt(n,o)}}function Mzt(e){e.tileZoomScale=e.tileZoomLevel=Math.floor(e.availableSize.height/512)+1;var t=256*Math.pow(2,e.tileZoomLevel);e.tileTranslatePoint.x=e.availableSize.width/2-t/2,e.tileTranslatePoint.y=e.availableSize.height/2-t/2+20,e.previousTileWidth=e.availableSize.width,e.previousTileHeight=e.availableSize.height}function kzt(e){return document.getElementById(e)}function Pzt(e){return"string"==typeof e?parseFloat(e):e}function Bzt(e,t){return e.formatFunction=e.intl.getNumberFormat({format:e.format,useGrouping:e.useGroupingSeparator}),e.formatFunction(t)}function Fzt(t,e){var i=null;try{"function"!=typeof t&&document.querySelectorAll(t).length?i=oo(document.querySelector(t).innerHTML.trim()):(e.isVue||e.isVue3||"function"==typeof t)&&(i=oo(t))}catch(e){i=oo(t)}return i}function Lzt(e){return document.getElementById(e)}function Rzt(e,t){var i,n=parseInt(e.split("_LayerIndex_")[1].split("_")[0],10),e=parseInt(e.split("_shapeIndex_")[1].split("_")[0],10),t=t.layersCollection[n],n=t.layerData[e].property;return{shapeData:n,data:i=t.dataSource?t.dataSource[yzt(t.dataSource,n,t.shapeDataPath,t.shapePropertyPath)]:i}}function Ozt(e,t,i,n){var o=Rzt(e,i),r={color:t.border.color,opacity:t.border.opacity,width:t.border.width},s=t.enableMultiSelect?{cancel:!1,name:n,fill:t.fill,opacity:t.opacity,border:r,shapeData:o.shapeData,data:o.data,target:e,maps:i,shapeDataCollection:i.shapeSelectionItem}:{cancel:!1,name:n,fill:t.fill,opacity:t.opacity,border:r,shapeData:o.shapeData,data:o.data,target:e,maps:i};return i.trigger(n,s,function(){s.border.opacity=(je(s.border.opacity)?s:s.border).opacity}),s}function Nzt(e){return document.getElementsByClassName(e)}function Vzt(e,t){var i=null;return i=document.getElementById(t)?document.getElementById(t).querySelector("#"+e):i}function _zt(e,t,i,n){for(var o,r=n.layers[e].shapeData.features,s=0;s<r.length;s++)if(r[s].properties.name===t){o=n.element.id+"_LayerIndex_"+e+"_shapeIndex_"+s+"_dataIndex_undefined";break}return Lzt(o)}function Hzt(e,t,i){e=Q("style",{id:e});return e.innerText="."+t+"{fill:"+i.fill+";fill-opacity:"+(je(i.opacity)?"1":i.opacity.toString())+";stroke-opacity:"+(je(i.border.opacity)?"1":i.border.opacity.toString())+";stroke-width:"+i.border.width.toString()+";stroke:"+i.border.color+";}",e}function zzt(e,t,i){e=Lzt(e);je(e)||(e.innerText="."+t+"{fill:"+i.fill+";fill-opacity:"+(je(i.opacity)?"1":i.opacity.toString())+";stroke-width:"+i.border.width.toString()+";stroke-opacity:"+(je(i.border.opacity)?"1":i.border.opacity.toString())+";stroke:"+i.border.color+"}")}function jzt(t,i,e,n,o){var r={color:t.border.color,width:t.border.width/i.scale,opacity:t.border.opacity},s={opacity:t.opacity,fill:t.fill,border:r,name:n4t,target:e.id,cancel:!1,shapeData:n,data:o,maps:i};i.trigger("itemSelection",s,function(e){s.border.opacity=(je(t.border.opacity)?t:t.border).opacity,i.shapeSelectionItem.push(s.shapeData),Lzt("ShapeselectionMap")?zzt("ShapeselectionMap","ShapeselectionMapStyle",s):document.body.appendChild(Hzt("ShapeselectionMap","ShapeselectionMapStyle",s))})}function Wzt(e){e.removeAttribute("class")}function Qzt(i,e,t,n,o,r,s){void 0===s&&(s=0);var a=n.x,l=n.y,h=0,d=i.getAttribute("transform")||"";new Vt({}).animate(i,{duration:0===t&&"Enable"===Ut?1e3:t,delay:e,progress:function(e){var t;e.timeStamp>e.delay&&!o.zoomModule.isPanningInProgress?(o.isTileMap&&0===h&&!je(t=document.querySelector(".GroupElement"))&&(t.style.display="block"),h=(e.timeStamp-e.delay)/e.duration,i.setAttribute("transform","translate( "+(a-s*h)+" "+(l-s*h)+" ) scale("+h+")")):o.zoomModule.isPanningInProgress&&(d=i.getAttribute("transform"))},end:function(e){o.zoomModule.isPanningInProgress||i.setAttribute("transform",d),o.zoomModule.isPanningInProgress=!1,r&&o.trigger(e4t,{cancel:!1,name:e4t,element:r,maps:o})}})}function Uzt(e){Izt(e)}function qzt(e,t,i,n,o,r,s,a,l){for(var h=oHt(i,n,a),h=(je(h)||(i=h.x,n=h.y),document.getElementById(s)),d=AHt(e,{fontFamily:"Segoe UI",size:"8px",fontStyle:"Normal",fontWeight:"Regular"}).width,p=e.split(" "),c=p[0].length,u=1;u<p.length;u++)c<p[u].length&&(c=p[u].length);h||((h=Q("div",{id:s})).style.cssText='background-color: rgb(255, 255, 255) !important; color:black !important; position:absolute;border:1px solid rgb(0, 0, 0); padding-left:5px;font-size:12px; font-family: "Segoe UI"; text-align:center'),i<o-d||(o-d<i&&i<o-8*c?d=o-i:o-8*c<=i&&(d<i?i-=d:(d=i,i=0)));t=t.split("px");Gzt(h,e,i,n,t,d,o,a),h.clientHeight+2*parseInt(t[0],10)>r&&(d=i,i=0),Gzt(h,e,i,n,t,d,o,a),l&&setTimeout(Uzt,5e3,s)}function Gzt(e,t,i,n,o,r,s,a){e.innerText=t,e.style.top=-1!==e.id.indexOf("_Legend")?(parseInt(o[0],10)+n).toString()+"px":(2*parseInt(o[0],10)).toString()+"px",e.style.left=i.toString()+"px",e.style.width=r.toString()+"px",e.style.maxWidth=s.toString()+"px",e.style.wordWrap="break-word",a.appendChild(e)}function Yzt(e,t,i,n,o){var r=Lzt(e),s=Xzt(o.borderColor),a=Xzt(o.fontColor),i="top:"+i.toString()+"px;left:"+n.toString()+"px;color:"+(a?"rgba("+a.r+","+a.g+","+a.b+","+o.fontOpacity+")":o.fontColor)+";background:"+o.fill+";z-index: 2;position:absolute;border:"+o.borderWidth+"px solid "+(s?"rgba("+s.r+","+s.g+","+s.b+","+o.borderOpacity+")":o.borderColor)+";font-family:"+o.fontFamily+";font-style:"+o.fontStyle+";font-weight:"+o.fontWeight+";font-size:"+o.fontSize+";border-radius:"+o.borderWidth+"px;";!r&&o.visible?((r=Q("div",{id:e})).innerHTML=go.sanitize("&nbsp;"+t+"&nbsp;"),r.style.cssText=i,document.body.appendChild(r)):o.visible&&(r.innerHTML=go.sanitize("&nbsp;"+t+"&nbsp;"),r.style.cssText=i)}function Xzt(e){var t,i;return-1!==e.indexOf("#")&&-1===e.toLowerCase().indexOf("rgb")?(i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e))?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null:-1!==e.toLowerCase().indexOf("rgb")?(i=e.match(/\d+/g).map(function(e){return parseInt(e,10)}))?{r:i[0],g:i[1],b:i[2]}:null:((t=document.createElement("div")).style.color=e,i=window.getComputedStyle(document.body.appendChild(t)).color.match(/\d+/g).map(function(e){return parseInt(e,10)}),document.body.removeChild(t),i?{r:i[0],g:i[1],b:i[2]}:null)}function Kzt(e,t,i,n,o){var r=new fo(""),e=Jzt(e,i,t,o,n);return r["draw"+e.functionName](e.renderOption)}function Jzt(e,t,i,n,o){var r,s="Path",a=t.width,l=t.height,h=e.x,d=e.y,p=e.x+-a/2,c=e.y+-l/2;switch(n.stroke="HorizontalLine"===i||"VerticalLine"===i||"Cross"===i?n.fill:n.stroke,n["stroke-width"]=0!==n["stroke-width"]||"HorizontalLine"!==i&&"VerticalLine"!==i&&"Cross"!==i?n["stroke-width"]:1,i){case"Circle":case"Bubble":s="Ellipse",I(n,{rx:a/2,ry:l/2,cx:h,cy:d});break;case"VerticalLine":I(n,{d:r="M "+h+" "+(d+l/2)+" L "+h+" "+(d+-l/2)});break;case"HorizontalLine":I(n,{d:r="M "+h+" "+d+" L "+(h+a/2)+" "+d});break;case"Diamond":I(n,{d:r="M "+p+" "+d+" L "+h+" "+(d+-l/2)+" L "+(h+a/2)+" "+d+" L "+h+" "+(d+l/2)+" L "+p+" "+d+" z"});break;case"Rectangle":I(n,{d:r="M "+p+" "+(d+-l/2)+" L "+(h+a/2)+" "+(d+-l/2)+" L "+(h+a/2)+" "+(d+l/2)+" L "+p+" "+(d+l/2)+" L "+p+" "+(d+-l/2)+" z"});break;case"Triangle":I(n,{d:r="M "+p+" "+(d+l/2)+" L "+h+" "+(d+-l/2)+" L "+(h+a/2)+" "+(d+l/2)+" L "+p+" "+(d+l/2)+" z"});break;case"InvertedTriangle":I(n,{d:r="M "+(h+a/2)+" "+(d-l/2)+" L "+h+" "+(d+l/2)+" L "+(h-a/2)+" "+(d-l/2)+" L "+(h+a/2)+" "+(d-l/2)+" z"});break;case"Pentagon":for(var u,g,m=0;m<=5;m++)u=a/2*Math.cos(Math.PI/180*(72*m)),g=a/2*Math.sin(Math.PI/180*(72*m)),r=0===m?"M "+(h+u)+" "+(d+g)+" ":r.concat("L "+(h+u)+" "+(d+g)+" ");I(n,{d:r=r.concat("Z")});break;case"Star":I(n,{d:r="M "+(e.x+t.width/3)+" "+(e.y+t.height/2)+" L "+(e.x-t.width/2)+" "+(e.y-t.height/6)+" L "+(e.x+t.width/2)+" "+(e.y-t.height/6)+" L "+(e.x-t.width/3)+" "+(e.y+t.height/2)+" L "+e.x+" "+(e.y-t.height/2)+" L "+(e.x+t.width/3)+" "+(e.y+t.height/2)+" Z"});break;case"Cross":I(n,{d:r="M "+p+" "+d+" L "+(h+a/2)+" "+d+" M "+h+" "+(d+l/2)+" L "+h+" "+(d+-l/2)});break;case"Image":s="Image",I(n,{href:o,height:l,width:a,x:p,y:c})}return{renderOption:n,functionName:s}}function Zzt(e,t){t.appendChild(e);var i=e.offsetWidth,n=e.offsetHeight;return t.removeChild(e),new eHt(i,n)}function $zt(e,t,i,n){for(var o,r=0;r<e.childElementCount;r++)if(-1<(o=e.childNodes[r]).id.indexOf("_NavigationGroup"))ejt(o,t,i,n);else if(-1<o.id.indexOf("_Polygons_Group"))for(var s=0;s<o.childElementCount;s++){var a=n.layersCollection[t].polygonSettings.polygons[parseInt(o.children[s].id.split("_PolygonIndex_")[1])].borderWidth;o.children[s].setAttribute("stroke-width",(a/i).toString())}else{var l,h=void 0,d=n.layersCollection[t].shapeSettings.borderWidthValuePath,p=n.layersCollection[t].shapeSettings.border.width,c=n.layersCollection[t].shapeSettings.circleRadius,h=n.layersCollection[t].shapeSettings.borderWidthValuePath&&null!==(l=yzt(n.layersCollection[t].dataSource,n.layersCollection[t].layerData[r].property,n.layersCollection[t].shapeDataPath,n.layersCollection[t].shapePropertyPath,n.layersCollection[t]))&&n.layersCollection[t].dataSource[l][d]||(je(p)?0:p);o.setAttribute("stroke-width",(h/i).toString()),(-1<e.id.indexOf("_Point")||-1<e.id.indexOf("_MultiPoint"))&&o.setAttribute("r",(c/i).toString())}}function ejt(e,t,i,n){for(var o,r,s=0;s<e.childElementCount;s++)"path"===(r=e.childNodes[s]).tagName&&(o=n.layersCollection[t].navigationLineSettings[parseFloat(r.id.split("_NavigationIndex_")[1].split("_")[0])].width,r.setAttribute("stroke-width",(o/i).toString()))}function tjt(e){for(var t=[],i=e.touches,n=0;n<i.length;n++)t.push({pageX:i[n].pageX,pageY:i[n].pageY});return t}function ijt(e,t){e=njt(e[0],e[1]);return njt(t[0],t[1])/e}function njt(e,t){var i=e.pageX-t.pageX,e=e.pageY-t.pageY;return Math.sqrt(i*i+e*e)}function ojt(e,t){var t=t.element.getBoundingClientRect(),i=t.top+document.defaultView.pageXOffset,n=t.left+document.defaultView.pageYOffset;return Array.prototype.slice.call(e).map(function(e){return{x:e.pageX-n,y:e.pageY-i}})}function rjt(e){return{x:e.map(function(e){return e.x}).reduce(sjt)/e.length,y:e.map(function(e){return e.y}).reduce(sjt)/e.length}}function sjt(e,t){return e+t}function ajt(e,t,i,n,o,r,s){var a,l,h,d,p,c,u,g,m=s.previousPoint,f=s.previousScale,y=o-f,v=new jHt(0,0);o===f?e.setAttribute("transform","scale( "+o+" ) translate( "+n.x+" "+n.y+" )"):(p=n,h=(c=m).x===p.x?null:(p.y-c.y)/(p.x-c.x),p=m,d=null===(c=h)?p.x:p.y-c*p.x,u=n.x-m.x,g=n.y-m.y,ljt(e,0,i,function(e){e.timeStamp>e.delay&&(a=(e.timeStamp-e.delay)/e.duration,l=f+a*y,v.x=m.x+a*u/(l/o),v.y=null==h?m.y+a*g:h*v.x+d,e.element.setAttribute("transform","scale( "+l+" ) translate( "+v.x+" "+v.y+" )"),s.translatePoint=v,s.scale=l,s.zoomModule.processTemplate(n.x,n.y,l,s))},function(){s.translatePoint=n,s.scale=o,e.setAttribute("transform","scale( "+o+" ) translate( "+n.x+" "+n.y+" )"),s.zoomModule.processTemplate(n.x,n.y,o,s)}))}function ljt(t,e,i,n,o){function r(e){(e-=a=a||e)<i?(n.call(s,{element:t,delay:0,timeStamp:e,duration:i}),window.requestAnimationFrame(r)):(window.cancelAnimationFrame(l),o.call(s,{element:t}),-1<t.id.indexOf("Marker")&&(kzt(t.id.split("_Layer")[0]+"_Markers_Group").style.cssText="visibility:visible"))}var s=this,a=null,l=(i="Disable"===Ut?0:i,window.requestAnimationFrame(r))}function hjt(e,t,i,n,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=n,this.sendData=o}var djt;function pjt(e,t,i,n){var o,r=e.getAttribute("transform").split(" "),s=(2===r.length&&(r[2]=r[1].split(")")[0],r[1]=r[0].split("(")[1]),new jHt(parseInt(r[1],10),parseInt(r[2],10))),a=n.x-s.x,l=n.y-s.y,h=new jHt(0,0);ljt(e,0,i,function(e){e.timeStamp>e.delay&&(o=(e.timeStamp-e.delay)/e.duration,h.x=s.x+o*a,h.y=s.y+o*l,e.element.setAttribute("transform","translate( "+h.x+" "+h.y+" )"))},function(){e.setAttribute("transform","translate( "+n.x+" "+n.y+" )")})}function cjt(e,t){var i=je(t.shouldZoomPreviousFactor)?null:t.shouldZoomPreviousFactor,n=je(t.shouldZoomCurrentFactor)?null:t.shouldZoomCurrentFactor;je(n)?!je(i)&&je(n)&&t.shouldZoomPreviousFactor!==e?t.shouldZoomCurrentFactor=e:t.shouldZoomPreviousFactor=e:(t.shouldZoomCurrentFactor=null,t.shouldZoomPreviousFactor=null)}function ujt(e,t,i,n,o,r,s,a){var l,h=s.zoomSettings.maxZoom,d=Math.sin(t*Math.PI/180),d=Math.log((1+d)/(1-d))/2,d=Math.max(Math.min(d,Math.PI),-Math.PI)/2,p=Math.sin(e*Math.PI/180),p=Math.log((1+p)/(1-p))/2,p=Math.max(Math.min(p,Math.PI),-Math.PI)/2,t=(s.zoomNotApplied&&!s.isTileMap&&(t=Math.abs((s.baseMapBounds.latitude.max-s.baseMapBounds.latitude.min)/(t-e)),e=Math.abs((s.baseMapBounds.longitude.max-s.baseMapBounds.longitude.min)/(n-i)),l=a?(t+e)/2:Math.min(t,e)),(d-p)/Math.PI),e=n-i,d=(e<0?360+e:e)/360,p=Math.log(r/256/t)/Math.LN2,n=Math.log(o/256/d)/Math.LN2,i=s.zoomNotApplied&&!s.isTileMap?l:a&&!s.isTileMap?(p+n)/2:Math.min(p,n),e=Math.min(i,h);return e=s.isTileMap||!s.zoomNotApplied?Math.floor(e):e,s.isTileMap||cjt(e,s),e}function gjt(e){var t,e=je(e.result)?e.actual:e.result;return je(e.length)?je(e.Items)||(t=e.Items):t=e,t}(det=djt=djt||{}).mapsTitleFont={size:"14px",fontWeight:null,color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"},det.mapsSubTitleFont={size:"13px",fontWeight:null,color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"},det.tooltipLabelFont={size:"12px",fontWeight:"Regular",color:null,fontStyle:"Regular",fontFamily:null},det.legendTitleFont={size:"12px",fontWeight:"Medium",color:null,fontStyle:"Medium",fontFamily:null},det.legendLabelFont={size:"13px",fontWeight:"Medium",color:null,fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"},det.dataLabelFont={size:null,fontWeight:"Medium",color:"#000000",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"};mjt=function(e,t){return(mjt=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])}))(e,t)};var mjt,fjt,q$e=function(e,t){function i(){this.constructor=e}mjt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},h=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},mft=(q$e(yjt,fjt=n),h([e("")],yjt.prototype,"content",void 0),h([e("0px")],yjt.prototype,"x",void 0),h([e("0px")],yjt.prototype,"y",void 0),h([e("None")],yjt.prototype,"verticalAlignment",void 0),h([e("None")],yjt.prototype,"horizontalAlignment",void 0),h([e("-1")],yjt.prototype,"zIndex",void 0),yjt);function yjt(){return null!==fjt&&fjt.apply(this,arguments)||this}q$e(bjt,vjt=n),h([e("Start")],bjt.prototype,"position",void 0),h([e("false")],bjt.prototype,"showArrow",void 0),h([e(2)],bjt.prototype,"size",void 0),h([e("black")],bjt.prototype,"color",void 0),h([e(0)],bjt.prototype,"offSet",void 0);var vjt,cft=bjt;function bjt(){return null!==vjt&&vjt.apply(this,arguments)||this}q$e(Cjt,wjt=n),h([e(null)],Cjt.prototype,"size",void 0),h([e(null)],Cjt.prototype,"color",void 0),h([e("Roboto, Noto, Sans-serif")],Cjt.prototype,"fontFamily",void 0),h([e("Medium")],Cjt.prototype,"fontWeight",void 0),h([e("Medium")],Cjt.prototype,"fontStyle",void 0),h([e(1)],Cjt.prototype,"opacity",void 0);var wjt,SOt=Cjt;function Cjt(){return null!==wjt&&wjt.apply(this,arguments)||this}q$e(Ajt,Sjt=n),h([e("transparent")],Ajt.prototype,"fill",void 0),h([e(null)],Ajt.prototype,"color",void 0),h([e(1)],Ajt.prototype,"borderOpacity",void 0),h([e(1)],Ajt.prototype,"borderWidth",void 0),h([e(null)],Ajt.prototype,"borderColor",void 0),h([e(null)],Ajt.prototype,"radius",void 0),h([e(null)],Ajt.prototype,"selectionColor",void 0),h([e(null)],Ajt.prototype,"highlightColor",void 0),h([e(5)],Ajt.prototype,"padding",void 0),h([e(1)],Ajt.prototype,"opacity",void 0),h([e(["ZoomIn","ZoomOut","Reset"])],Ajt.prototype,"toolbarItems",void 0);var Sjt,IOt=Ajt;function Ajt(){return null!==Sjt&&Sjt.apply(this,arguments)||this}q$e(Ijt,xjt=n),h([e(!0)],Ijt.prototype,"visible",void 0),h([e("white")],Ijt.prototype,"fill",void 0),h([e(1)],Ijt.prototype,"borderOpacity",void 0),h([e(1)],Ijt.prototype,"borderWidth",void 0),h([e("#707070")],Ijt.prototype,"borderColor",void 0),h([e("black")],Ijt.prototype,"fontColor",void 0),h([e("")],Ijt.prototype,"fontFamily",void 0),h([e("")],Ijt.prototype,"fontStyle",void 0),h([e("")],Ijt.prototype,"fontWeight",void 0),h([e("")],Ijt.prototype,"fontSize",void 0),h([e(1)],Ijt.prototype,"fontOpacity",void 0);var xjt,DOt=Ijt;function Ijt(){return null!==xjt&&xjt.apply(this,arguments)||this}q$e(Ejt,Tjt=n),h([e("transparent")],Ejt.prototype,"backgroundColor",void 0),h([e(1)],Ejt.prototype,"borderOpacity",void 0),h([e(1)],Ejt.prototype,"borderWidth",void 0),h([e("transparent")],Ejt.prototype,"borderColor",void 0),h([e("Far")],Ejt.prototype,"horizontalAlignment",void 0),h([e("Near")],Ejt.prototype,"verticalAlignment",void 0),h([e("Horizontal")],Ejt.prototype,"orientation",void 0),h([t({},IOt)],Ejt.prototype,"buttonSettings",void 0),h([t({},DOt)],Ejt.prototype,"tooltipSettings",void 0);var Tjt,POt=Ejt;function Ejt(){return null!==Tjt&&Tjt.apply(this,arguments)||this}q$e(Mjt,Djt=n),h([e("")],Mjt.prototype,"color",void 0),h([e(0)],Mjt.prototype,"width",void 0),h([e(null)],Mjt.prototype,"opacity",void 0);var Djt,LOt=Mjt;function Mjt(){return null!==Djt&&Djt.apply(this,arguments)||this}q$e(Pjt,kjt=n),h([e(null)],Pjt.prototype,"latitude",void 0),h([e(null)],Pjt.prototype,"longitude",void 0);var kjt,NOt=Pjt;function Pjt(){return null!==kjt&&kjt.apply(this,arguments)||this}q$e(Fjt,Bjt=n),h([e(!1)],Fjt.prototype,"visible",void 0),h([e("")],Fjt.prototype,"template",void 0),h([e("")],Fjt.prototype,"fill",void 0),h([t({color:null,width:1},LOt)],Fjt.prototype,"border",void 0),h([t({fontFamily:null,size:null,fontWeight:null},SOt)],Fjt.prototype,"textStyle",void 0),h([e(null)],Fjt.prototype,"format",void 0),h([e(null)],Fjt.prototype,"valuePath",void 0),h([e(2e3)],Fjt.prototype,"duration",void 0);var Bjt,HOt=Fjt;function Fjt(){return null!==Bjt&&Bjt.apply(this,arguments)||this}q$e(Rjt,Ljt=n),h([e(!1)],Rjt.prototype,"visible",void 0),h([e("")],Rjt.prototype,"fill",void 0),h([t({color:null,width:1},LOt)],Rjt.prototype,"border",void 0),h([t({fontFamily:null,size:null,fontWeight:null},SOt)],Rjt.prototype,"textStyle",void 0),h([e(2e3)],Rjt.prototype,"duration",void 0);var Ljt,WOt=Rjt;function Rjt(){return null!==Ljt&&Ljt.apply(this,arguments)||this}q$e(Njt,Ojt=n),h([e(10)],Njt.prototype,"left",void 0),h([e(10)],Njt.prototype,"right",void 0),h([e(10)],Njt.prototype,"top",void 0),h([e(10)],Njt.prototype,"bottom",void 0);var Ojt,qOt=Njt;function Njt(){return null!==Ojt&&Ojt.apply(this,arguments)||this}q$e(_jt,Vjt=n),h([e("#000000")],_jt.prototype,"color",void 0),h([e(1)],_jt.prototype,"width",void 0),h([e(1)],_jt.prototype,"opacity",void 0);var Vjt,XOt=_jt;function _jt(){return null!==Vjt&&Vjt.apply(this,arguments)||this}q$e(zjt,Hjt=n),h([e(!1)],zjt.prototype,"allowClustering",void 0),h([e(!0)],zjt.prototype,"allowDeepClustering",void 0),h([t({color:"transparent",width:1},LOt)],zjt.prototype,"border",void 0),h([e("#D2691E")],zjt.prototype,"fill",void 0),h([e(1)],zjt.prototype,"opacity",void 0),h([e("Rectangle")],zjt.prototype,"shape",void 0),h([e(12)],zjt.prototype,"width",void 0),h([e(12)],zjt.prototype,"height",void 0),h([e(new wHt(0,0))],zjt.prototype,"offset",void 0),h([e("")],zjt.prototype,"imageUrl",void 0),h([e("")],zjt.prototype,"dashArray",void 0),h([t({},SOt)],zjt.prototype,"labelStyle",void 0),h([e(!1)],zjt.prototype,"allowClusterExpand",void 0),h([t({},XOt)],zjt.prototype,"connectorLineSettings",void 0);var Hjt,ZOt=zjt;function zjt(){return null!==Hjt&&Hjt.apply(this,arguments)||this}q$e(Wjt,jjt=n);var jjt,tNt=Wjt;function Wjt(){return null!==jjt&&jjt.apply(this,arguments)||this}q$e(Ujt,Qjt=n),h([e(null)],Ujt.prototype,"from",void 0),h([e(null)],Ujt.prototype,"to",void 0),h([e(null)],Ujt.prototype,"value",void 0),h([e(null)],Ujt.prototype,"color",void 0),h([e(null)],Ujt.prototype,"minOpacity",void 0),h([e(null)],Ujt.prototype,"maxOpacity",void 0),h([e(null)],Ujt.prototype,"label",void 0),h([e(!0)],Ujt.prototype,"showLegend",void 0);var Qjt,oNt=Ujt;function Ujt(){return null!==Qjt&&Qjt.apply(this,arguments)||this}q$e(Gjt,qjt=n),h([e(null)],Gjt.prototype,"latitude",void 0),h([e(null)],Gjt.prototype,"longitude",void 0);var qjt,aNt=Gjt;function Gjt(){return null!==qjt&&qjt.apply(this,arguments)||this}q$e(Xjt,Yjt=n),h([e(null)],Xjt.prototype,"shapePath",void 0),h([e(null)],Xjt.prototype,"shapeValue",void 0);var Yjt,dNt=Xjt;function Xjt(){return null!==Yjt&&Yjt.apply(this,arguments)||this}q$e(Jjt,Kjt=n),h([e(!1)],Jjt.prototype,"enable",void 0),h([e(null)],Jjt.prototype,"fill",void 0),h([e(1)],Jjt.prototype,"opacity",void 0),h([e(!1)],Jjt.prototype,"enableMultiSelect",void 0),h([t({color:"transparent",width:0},LOt)],Jjt.prototype,"border",void 0);var Kjt,uNt=Jjt;function Jjt(){return null!==Kjt&&Kjt.apply(this,arguments)||this}q$e($jt,Zjt=n),h([e(null)],$jt.prototype,"fill",void 0),h([e(!1)],$jt.prototype,"enable",void 0),h([e(1)],$jt.prototype,"opacity",void 0),h([t({color:"transparent",width:0},LOt)],$jt.prototype,"border",void 0);var Zjt,fNt=$jt;function $jt(){return null!==Zjt&&Zjt.apply(this,arguments)||this}q$e(t3t,e3t=n),h([e(1)],t3t.prototype,"borderWidth",void 0),h([e(1)],t3t.prototype,"borderOpacity",void 0),h([e(1)],t3t.prototype,"opacity",void 0),h([e("#FF471A")],t3t.prototype,"borderColor",void 0),h([e("#FF471A")],t3t.prototype,"fill",void 0),h([e([])],t3t.prototype,"points",void 0),h([e("")],t3t.prototype,"tooltipText",void 0),h([e("")],t3t.prototype,"tooltipTemplate",void 0);var e3t,bNt=t3t;function t3t(){return null!==e3t&&e3t.apply(this,arguments)||this}q$e(n3t,i3t=n),h([kt([],bNt)],n3t.prototype,"polygons",void 0),h([t({},uNt)],n3t.prototype,"selectionSettings",void 0),h([t({},fNt)],n3t.prototype,"highlightSettings",void 0),h([t({},WOt)],n3t.prototype,"tooltipSettings",void 0);var i3t,SNt=n3t;function n3t(){return null!==i3t&&i3t.apply(this,arguments)||this}q$e(r3t,o3t=n),h([e(!1)],r3t.prototype,"visible",void 0),h([e(1)],r3t.prototype,"width",void 0),h([e(null)],r3t.prototype,"longitude",void 0),h([e(null)],r3t.prototype,"latitude",void 0),h([e("")],r3t.prototype,"dashArray",void 0),h([e("black")],r3t.prototype,"color",void 0),h([e(0)],r3t.prototype,"angle",void 0),h([t({showArrow:!1,position:"Start",size:5,color:"black"},cft)],r3t.prototype,"arrowSettings",void 0),h([t({},uNt)],r3t.prototype,"selectionSettings",void 0),h([t({},fNt)],r3t.prototype,"highlightSettings",void 0);var o3t,INt=r3t;function r3t(){return null!==o3t&&o3t.apply(this,arguments)||this}q$e(a3t,s3t=n),h([t({},LOt)],a3t.prototype,"border",void 0),h([e(!1)],a3t.prototype,"visible",void 0),h([e([])],a3t.prototype,"dataSource",void 0),h([e()],a3t.prototype,"query",void 0),h([e(1e3)],a3t.prototype,"animationDuration",void 0),h([e(0)],a3t.prototype,"animationDelay",void 0),h([e("")],a3t.prototype,"fill",void 0),h([e(10)],a3t.prototype,"minRadius",void 0),h([e(20)],a3t.prototype,"maxRadius",void 0),h([e(1)],a3t.prototype,"opacity",void 0),h([e(null)],a3t.prototype,"valuePath",void 0),h([e("Circle")],a3t.prototype,"bubbleType",void 0),h([e(null)],a3t.prototype,"colorValuePath",void 0),h([kt([],oNt)],a3t.prototype,"colorMapping",void 0),h([t({},HOt)],a3t.prototype,"tooltipSettings",void 0),h([t({},uNt)],a3t.prototype,"selectionSettings",void 0),h([t({},fNt)],a3t.prototype,"highlightSettings",void 0);var s3t,DNt=a3t;function a3t(){return null!==s3t&&s3t.apply(this,arguments)||this}q$e(h3t,l3t=n),h([e("")],h3t.prototype,"text",void 0),h([e("")],h3t.prototype,"description",void 0);var l3t,PNt=h3t;function h3t(){return null!==l3t&&l3t.apply(this,arguments)||this}q$e(p3t,d3t=PNt),h([t({size:null,fontWeight:null,fontFamily:null},SOt)],p3t.prototype,"textStyle",void 0),h([e("Center")],p3t.prototype,"alignment",void 0);var d3t,LNt=p3t;function p3t(){return null!==d3t&&d3t.apply(this,arguments)||this}q$e(u3t,c3t=PNt),h([t({size:null,fontWeight:null,fontFamily:null},SOt)],u3t.prototype,"textStyle",void 0),h([e("Center")],u3t.prototype,"alignment",void 0),h([t({},LNt)],u3t.prototype,"subtitleSettings",void 0);var c3t,NNt=u3t;function u3t(){return null!==c3t&&c3t.apply(this,arguments)||this}q$e(m3t,g3t=n),h([e(!1)],m3t.prototype,"enable",void 0),h([e(!0)],m3t.prototype,"enablePanning",void 0),h([e(!0)],m3t.prototype,"enableSelectionZooming",void 0),h([e(!0)],m3t.prototype,"mouseWheelZoom",void 0),h([e(!1)],m3t.prototype,"doubleClickZoom",void 0),h([e(!0)],m3t.prototype,"pinchZooming",void 0),h([e(!1)],m3t.prototype,"zoomOnClick",void 0),h([e(1)],m3t.prototype,"zoomFactor",void 0),h([e(10)],m3t.prototype,"maxZoom",void 0),h([e(1)],m3t.prototype,"minZoom",void 0),h([e(!1)],m3t.prototype,"shouldZoomInitially",void 0),h([e(!0)],m3t.prototype,"resetToInitial",void 0),h([t({},POt)],m3t.prototype,"toolbarSettings",void 0);var g3t,HNt=m3t;function m3t(){return null!==g3t&&g3t.apply(this,arguments)||this}q$e(y3t,f3t=n),h([e(!1)],y3t.prototype,"enable",void 0),h([e(!0)],y3t.prototype,"applyShapeSettings",void 0),h([e(1)],y3t.prototype,"opacity",void 0),h([e("")],y3t.prototype,"fill",void 0),h([t({color:"",width:0},LOt)],y3t.prototype,"border",void 0);var f3t,WNt=y3t;function y3t(){return null!==f3t&&f3t.apply(this,arguments)||this}q$e(b3t,v3t=n),h([e(!1)],b3t.prototype,"useMarkerShape",void 0),h([e(!1)],b3t.prototype,"toggleVisibility",void 0),h([e(!1)],b3t.prototype,"visible",void 0),h([e("transparent")],b3t.prototype,"background",void 0),h([e("Layers")],b3t.prototype,"type",void 0),h([e(!1)],b3t.prototype,"invertedPointer",void 0),h([e("After")],b3t.prototype,"labelPosition",void 0),h([e("None")],b3t.prototype,"labelDisplayMode",void 0),h([e("Circle")],b3t.prototype,"shape",void 0),h([e("")],b3t.prototype,"width",void 0),h([e("")],b3t.prototype,"height",void 0),h([t({fontFamily:null,fontWeight:null},SOt)],b3t.prototype,"textStyle",void 0),h([e(15)],b3t.prototype,"shapeWidth",void 0),h([e(15)],b3t.prototype,"shapeHeight",void 0),h([e(10)],b3t.prototype,"shapePadding",void 0),h([t({color:null,width:0},LOt)],b3t.prototype,"border",void 0),h([t({color:"#000000",width:0},LOt)],b3t.prototype,"shapeBorder",void 0),h([t({},PNt)],b3t.prototype,"title",void 0),h([t({size:null,color:djt.legendTitleFont.color,fontStyle:djt.legendTitleFont.fontStyle,fontWeight:null,fontFamily:null},SOt)],b3t.prototype,"titleStyle",void 0),h([e("Bottom")],b3t.prototype,"position",void 0),h([e("Center")],b3t.prototype,"alignment",void 0),h([e("None")],b3t.prototype,"orientation",void 0),h([e({x:0,y:0})],b3t.prototype,"location",void 0),h([e(null)],b3t.prototype,"fill",void 0),h([e(1)],b3t.prototype,"opacity",void 0),h([e("Default")],b3t.prototype,"mode",void 0),h([e(null)],b3t.prototype,"showLegendPath",void 0),h([e(null)],b3t.prototype,"valuePath",void 0),h([e(!1)],b3t.prototype,"removeDuplicateLegend",void 0),h([t({},WNt)],b3t.prototype,"toggleLegendSettings",void 0);var v3t,qNt=b3t;function b3t(){return null!==v3t&&v3t.apply(this,arguments)||this}q$e(C3t,w3t=n),h([e(!1)],C3t.prototype,"visible",void 0),h([t({width:0,color:"transparent"},LOt)],C3t.prototype,"border",void 0),h([e("black")],C3t.prototype,"fill",void 0),h([e(1)],C3t.prototype,"opacity",void 0),h([e(5)],C3t.prototype,"rx",void 0),h([e(5)],C3t.prototype,"ry",void 0),h([t({fontWeight:null},SOt)],C3t.prototype,"textStyle",void 0),h([e("")],C3t.prototype,"labelPath",void 0),h([e("None")],C3t.prototype,"smartLabelMode",void 0),h([e("None")],C3t.prototype,"intersectionAction",void 0),h([e("")],C3t.prototype,"template",void 0),h([e(0)],C3t.prototype,"animationDuration",void 0);var w3t,XNt=C3t;function C3t(){return null!==w3t&&w3t.apply(this,arguments)||this}q$e(A3t,S3t=n),h([e(null)],A3t.prototype,"fill",void 0),h([e([])],A3t.prototype,"palette",void 0),h([e(5)],A3t.prototype,"circleRadius",void 0),h([t({width:null,color:null},LOt)],A3t.prototype,"border",void 0),h([e("")],A3t.prototype,"dashArray",void 0),h([e(1)],A3t.prototype,"opacity",void 0),h([e(null)],A3t.prototype,"colorValuePath",void 0),h([e(null)],A3t.prototype,"borderColorValuePath",void 0),h([e(null)],A3t.prototype,"borderWidthValuePath",void 0),h([e(null)],A3t.prototype,"valuePath",void 0),h([kt([],oNt)],A3t.prototype,"colorMapping",void 0),h([e(!1)],A3t.prototype,"autofill",void 0);var S3t,ZNt=A3t;function A3t(){return null!==S3t&&S3t.apply(this,arguments)||this}q$e(I3t,x3t=n),h([t({color:"transparent",width:1},LOt)],I3t.prototype,"border",void 0),h([e(null)],I3t.prototype,"dashArray",void 0),h([e(!1)],I3t.prototype,"visible",void 0),h([e(!1)],I3t.prototype,"enableDrag",void 0),h([e("#FF471A")],I3t.prototype,"fill",void 0),h([e(null)],I3t.prototype,"heightValuePath",void 0),h([e(null)],I3t.prototype,"widthValuePath",void 0),h([e(10)],I3t.prototype,"height",void 0),h([e(10)],I3t.prototype,"width",void 0),h([e(1)],I3t.prototype,"opacity",void 0),h([e(null)],I3t.prototype,"colorValuePath",void 0),h([e(null)],I3t.prototype,"shapeValuePath",void 0),h([e(null)],I3t.prototype,"imageUrlValuePath",void 0),h([e("Balloon")],I3t.prototype,"shape",void 0),h([e("")],I3t.prototype,"legendText",void 0),h([e(new wHt(0,0))],I3t.prototype,"offset",void 0),h([e("")],I3t.prototype,"imageUrl",void 0),h([e(null)],I3t.prototype,"template",void 0),h([e([])],I3t.prototype,"dataSource",void 0),h([e()],I3t.prototype,"query",void 0),h([t({},HOt)],I3t.prototype,"tooltipSettings",void 0),h([e(1e3)],I3t.prototype,"animationDuration",void 0),h([e(0)],I3t.prototype,"animationDelay",void 0),h([t({},uNt)],I3t.prototype,"selectionSettings",void 0),h([t({},fNt)],I3t.prototype,"highlightSettings",void 0),h([e(null)],I3t.prototype,"latitudeValuePath",void 0),h([e(null)],I3t.prototype,"longitudeValuePath",void 0),h([kt([],aNt)],I3t.prototype,"initialMarkerSelection",void 0),h([t({},ZOt)],I3t.prototype,"clusterSettings",void 0);var x3t,t2t=I3t;function I3t(){return null!==x3t&&x3t.apply(this,arguments)||this}q$e(D3t,T3t=t2t);var T3t,E3t=D3t;function D3t(e,t,i,n){return T3t.call(this,e,t,i,n)||this}q$e(k3t,M3t=n),h([e(null)],k3t.prototype,"shapeData",void 0),h([e()],k3t.prototype,"query",void 0),h([t({},ZNt)],k3t.prototype,"shapeSettings",void 0),h([e([])],k3t.prototype,"dataSource",void 0),h([e("Layer")],k3t.prototype,"type",void 0),h([e("Geographic")],k3t.prototype,"geometryType",void 0),h([e("")],k3t.prototype,"urlTemplate",void 0),h([e(!0)],k3t.prototype,"visible",void 0),h([e("name")],k3t.prototype,"shapeDataPath",void 0),h([e("name")],k3t.prototype,"shapePropertyPath",void 0),h([e(0)],k3t.prototype,"animationDuration",void 0),h([kt([],E3t)],k3t.prototype,"markerSettings",void 0),h([t({},ZOt)],k3t.prototype,"markerClusterSettings",void 0),h([t({},XNt)],k3t.prototype,"dataLabelSettings",void 0),h([kt([],DNt)],k3t.prototype,"bubbleSettings",void 0),h([kt([],INt)],k3t.prototype,"navigationLineSettings",void 0),h([t({},SNt)],k3t.prototype,"polygonSettings",void 0),h([t({},HOt)],k3t.prototype,"tooltipSettings",void 0),h([t({},uNt)],k3t.prototype,"selectionSettings",void 0),h([t({},fNt)],k3t.prototype,"highlightSettings",void 0),h([t({},WNt)],k3t.prototype,"toggleLegendSettings",void 0),h([kt([],dNt)],k3t.prototype,"initialShapeSelection",void 0);var M3t,o2t=k3t;function k3t(){var e=null!==M3t&&M3t.apply(this,arguments)||this;return e.isBaseLayer=!1,e}var P3t,B3t=function(e,t,i,n,o,r,s){void 0===i&&(i=256),void 0===n&&(n=256),void 0===o&&(o=0),void 0===r&&(r=0),void 0===s&&(s=null),this.x=e,this.y=t,this.top=o,this.left=r,this.height=i,this.width=n,this.src=s},a2t=(q$e(F3t,P3t=n),h([e(null)],F3t.prototype,"background",void 0),h([t({color:"transparent",width:1},LOt)],F3t.prototype,"border",void 0),F3t);function F3t(){return null!==P3t&&P3t.apply(this,arguments)||this}var L3t="click",R3t="rightClick",O3t="doubleClick",N3t="resize",V3t="tooltipRender",_3t="shapeSelected",H3t="shapeHighlight",z3t="layerRendering",j3t="shapeRendering",W3t="markerRendering",Q3t="markerClusterRendering",U3t="markerClick",q3t="markerDragStart",G3t="markerClusterClick",Y3t="markerMouseMove",X3t="markerClusterMouseMove",K3t="dataLabelRendering",J3t="bubbleRendering",Z3t="bubbleClick",$3t="bubbleMouseMove",e4t="animationComplete",t4t="legendRendering",i4t="annotationRendering",n4t="itemSelection",o4t="itemHighlight",r4t="beforePrint",s4t=(a4t.prototype.getBingMap=function(e,t,i,n,o,r){for(var s="",a=Math.min(this.maps.tileZoomLevel,parseInt(this.maxZoom,10));0<a;a--){var l=0,h=1<<a-1;0!=(e.x&h)&&l++,0!=(e.y&h)&&(l+=2),s=s+""+l}return je(r)?"":(r=r[Math.min(parseInt(s.substr(s.length-1,1),10),r.length)],(o=o.replace("{quadkey}",s).replace("{subdomain}",r))+"&mkt="+n+"&ur=IN&Key="+t)},a4t.prototype.destroy=function(){this.maps=null,this.subDomains=[]},a4t);function a4t(e){this.maps=e}h4t.prototype.getShapeColorMapping=function(e,t,i){var n=e.colorValuePath||e.valuePath,t=!je(n)&&-1<n.indexOf(".")?KHt(t,n):t[n],n=Number(t),e=this.getColorByValue(e.colorMapping,n,t);return je(e)?i:e},h4t.prototype.getColorByValue=function(e,t,i){if(isNaN(t)&&je(i))return null;for(var n,o="",r=0,s=e;r<s.length;r++){var a=s[r];(!je(a.from)&&!je(a.to)&&t>=a.from&&t<=a.to||a.value===i)&&(o="[object Array]"===Object.prototype.toString.call(a.color)?je(a.value)?this.getColor(a,t):a.color[0]:a.color),(t>=a.from&&t<=a.to||a.value===i)&&!je(a.minOpacity)&&!je(a.maxOpacity)&&o&&(n=this.deSaturationColor(a,o,t,i)),(""===o||je(o))&&je(a.from)&&je(a.to)&&je(a.minOpacity)&&je(a.maxOpacity)&&je(a.value)&&(o="[object Array]"===Object.prototype.toString.call(a.color)?a.color[0]:a.color)}return{fill:o||(e.length?null:i),opacity:n}},h4t.prototype.deSaturationColor=function(e,t,i,n){var o=1;return o=i>=e.from&&i<=e.to||e.value===n?(isNaN(i)?e.from/(e.to-e.from):(i-e.from)/(e.to-e.from))*(e.maxOpacity-e.minOpacity)+e.minOpacity:o},h4t.prototype.rgbToHex=function(e,t,i){return"#"+this.componentToHex(e)+this.componentToHex(t)+this.componentToHex(i)},h4t.prototype.componentToHex=function(e){e=e.toString(16);return 1===e.length?"0"+e:e},h4t.prototype.getColor=function(e,t){return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:(t=this.getGradientColor(Number(t),e),this.rgbToHex(t.r,t.g,t.b))},h4t.prototype.getGradientColor=function(e,t){var i=t.from,n=t.to,o=0,r=n-i,o=(e-i)/r;if(t.color.length<=2)a="#"===t.color[0].charAt(0)?t.color[0]:this._colorNameToHex(t.color[0]),l="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:this._colorNameToHex(t.color[t.color.length-1]);else{for(var s,a="#"===t.color[0].charAt(0)?t.color[0]:this._colorNameToHex(t.color[0]),l="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:this._colorNameToHex(t.color[t.color.length-1]),h=r/(t.color.length-1),d=t.color.length-1,p=[],c=1;c<d;c++)s={b:i+c*h,color:t.color[c]},p.push(s);for(var u=0;u<p.length;u++)i<=e&&e<=p[u].b&&0===u?(l="#"===p[u].color.charAt(0)?p[u].color:this._colorNameToHex(p[u].color),o=e<p[u].b?1-Math.abs((e-p[u].b)/h):(e-p[u].b)/h):p[u].b<=e&&e<=n&&u===p.length-1&&(a="#"===p[u].color.charAt(0)?p[u].color:this._colorNameToHex(p[u].color),o=e<p[u].b?1-Math.abs((e-p[u].b)/h):(e-p[u].b)/h),u!==p.length-1&&u<p.length&&p[u].b<=e&&e<=p[u+1].b&&(a="#"===p[u].color.charAt(0)?p[u].color:this._colorNameToHex(p[u].color),l="#"===p[u+1].color.charAt(0)?p[u+1].color:this._colorNameToHex(p[u+1].color),o=Math.abs(e-p[u+1].b)/h)}return this.getPercentageColor(o,a,l)},h4t.prototype.getPercentageColor=function(e,t,i){var i=i.split("#")[1],t=t.split("#")[1],n=this.getPercentage(e,parseInt(t.substr(0,2),16),parseInt(i.substr(0,2),16)),o=this.getPercentage(e,parseInt(t.substr(2,2),16),parseInt(i.substr(2,2),16)),e=this.getPercentage(e,parseInt(t.substr(4,2),16),parseInt(i.substr(4,2),16));return new DHt(n,o,e)},h4t.prototype.getPercentage=function(e,t,i){return Math.round(t+(i-t)*e)},h4t.prototype._colorNameToHex=function(e){var t={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",orchid:"#da70d6",papayawhip:"#ffefd5",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};return"[object Array]"!==Object.prototype.toString.call(e)&&void 0!==t[e.toLowerCase()]?t[e.toLowerCase()]:e};var l4t=h4t;function h4t(e){}p4t.prototype.measureLayerPanel=function(){var e,i=this,t=this.mapObject.layersCollection,n=this.mapObject.mapAreaRect,o=kzt(this.mapObject.element.id+"_Secondary_Element");this.mapObject.isTileMap&&o&&(this.tileSvgObject=this.mapObject.renderer.createSvg({id:this.mapObject.element.id+"_Tile_SVG",width:n.width,height:n.height}),(e=Q("div",{id:this.mapObject.element.id+"_Tile_SVG_Parent"})).style.cssText="position: absolute; height: "+n.height+"px; width: "+n.width+"px;",e.appendChild(this.tileSvgObject),o.appendChild(e)),this.layerGroup=this.mapObject.renderer.createGroup({id:this.mapObject.element.id+"_Layer_Collections","clip-path":"url(#"+this.mapObject.element.id+"_MapArea_ClipRect)"}),this.clipRectElement=this.mapObject.renderer.drawClipPath(new MHt(this.mapObject.element.id+"_MapArea_ClipRect","transparent",{width:1,color:"Gray"},1,{x:this.mapObject.isTileMap?0:n.x,y:this.mapObject.isTileMap?0:n.y,width:n.width,height:n.height})),this.layerGroup.appendChild(this.clipRectElement),this.mapObject.baseMapBounds=null,this.mapObject.baseMapRectBounds=null,this.mapObject.baseSize=null,Array.prototype.forEach.call(t,function(e,t){i.currentLayer=e,i.processLayers(e,t)}),je(this.mapObject.legendModule)||"Float"!==this.mapObject.legendSettings.position||(this.mapObject.isTileMap?this.layerGroup:this.mapObject.svgObject).appendChild(this.mapObject.legendModule.legendGroup)},p4t.prototype.renderTileLayer=function(e,t,i,n){e.currentFactor=e.calculateFactor(t),e.mapObject.defaultState=!(1!==e.mapObject.zoomSettings.zoomFactor&&!je(e.mapObject.tileZoomLevel)&&1!==e.mapObject.tileZoomLevel),je(e.mapObject.previousCenterLatitude)&&je(e.mapObject.previousCenterLongitude)&&!e.mapObject.isZoomByPosition?(e.mapObject.previousCenterLatitude=e.mapObject.centerPosition.latitude,e.mapObject.previousCenterLongitude=e.mapObject.centerPosition.longitude):e.mapObject.previousCenterLatitude!==e.mapObject.centerPosition.latitude&&e.mapObject.previousCenterLongitude!==e.mapObject.centerPosition.longitude||e.mapObject.isZoomByPosition?(e.mapObject.centerPositionChanged=!0,e.mapObject.previousCenterLatitude=e.mapObject.centerPosition.latitude,e.mapObject.previousCenterLongitude=e.mapObject.centerPosition.longitude):e.mapObject.centerPositionChanged=!1;var o,t=new wHt(e.mapObject.centerPosition.longitude,e.mapObject.centerPosition.latitude),r=t,t=(this.mapObject.isTileMap&&e.mapObject.markerModule&&e.mapObject.zoomSettings.enable&&(e.mapObject.markerModule.calculateZoomCenterPositionAndFactor(this.mapObject.layersCollection),je(this.mapObject.markerCenterLatitude)||je(this.mapObject.markerCenterLongitude)||e.mapObject.isZoomByPosition||(r=new wHt(e.mapObject.markerCenterLongitude,e.mapObject.markerCenterLatitude))),t=!e.mapObject.zoomSettings.shouldZoomInitially&&e.mapObject.centerPosition.longitude&&e.mapObject.centerPosition.latitude&&!e.mapObject.zoomPersistence&&e.mapObject.defaultState?new wHt(e.mapObject.centerPosition.longitude,e.mapObject.centerPosition.latitude):e.mapObject.zoomSettings.shouldZoomInitially&&e.mapObject.markerZoomedState&&!e.mapObject.zoomPersistence&&!je(e.mapObject.markerZoomCenterPoint)?new wHt(e.mapObject.markerZoomCenterPoint.longitude,e.mapObject.markerZoomCenterPoint.latitude):{x:null,y:null},e.mapObject.zoomSettings.shouldZoomInitially&&!e.mapObject.isZoomByPosition?je(e.mapObject.markerZoomFactor)?1:e.mapObject.markerZoomFactor:e.mapObject.zoomSettings.zoomFactor),t=e.mapObject.enablePersistence?je(e.mapObject.mapScaleValue)?je(e.mapObject.markerZoomFactor)?e.mapObject.zoomSettings.zoomFactor:e.mapObject.markerZoomFactor:e.mapObject.mapScaleValue:t;t=e.mapObject.zoomSettings.enable?t:e.mapObject.zoomSettings.zoomFactor,e.mapObject.defaultState=1===(t=0<t?t:1),!e.mapObject.markerZoomedState&&e.mapObject.zoomSettings.shouldZoomInitially&&1===e.mapObject.zoomSettings.zoomFactor&&(e.mapObject.defaultState=!0),je(e.mapObject.tileZoomLevel)?(e.mapObject.tileZoomLevel=t,e.mapObject.previousZoomFactor=t):this.mapObject.isReset&&1===e.mapObject.tileZoomLevel&&!e.mapObject.zoomSettings.shouldZoomInitially?(o=e.mapObject.tileZoomLevel,e.mapObject.tileZoomLevel=o):1!==e.mapObject.zoomSettings.zoomFactor||e.mapObject.zoomSettings.shouldZoomInitially?(e.mapObject.previousZoomFactor=e.mapObject.tileZoomLevel,e.mapObject.tileZoomLevel=e.mapObject.defaultState&&e.mapObject.zoomSettings.enable?e.mapObject.tileZoomLevel:e.mapObject.zoomSettings.shouldZoomInitially||e.mapObject.centerPositionChanged?t:e.mapObject.previousZoomFactor!==e.mapObject.zoomSettings.zoomFactor?e.mapObject.zoomSettings.zoomFactor:e.mapObject.tileZoomLevel,e.mapObject.tileZoomLevel=1===t&&0===e.mapObject.zoomSettings.zoomFactor?t:e.mapObject.tileZoomLevel,!je(e.mapObject.tileTranslatePoint)&&(e.mapObject.markerZoomFactor!==e.mapObject.mapScaleValue||je(e.mapObject.markerZoomFactor)&&je(e.mapObject.mapScaleValue))&&(e.mapObject.zoomSettings.zoomFactor<=1||e.mapObject.previousZoomFactor!==e.mapObject.zoomSettings.zoomFactor)&&(e.mapObject.tileTranslatePoint.x=0,e.mapObject.tileTranslatePoint.y=0)):e.mapObject.defaultState&&(e.mapObject.previousZoomFactor=e.mapObject.tileZoomLevel,e.mapObject.tileZoomLevel=t,je(e.mapObject.tileTranslatePoint)||(e.mapObject.tileTranslatePoint.x=0,e.mapObject.tileTranslatePoint.y=0)),t<=1&&!je(e.mapObject.height)&&!e.mapObject.zoomSettings.shouldZoomInitially&&e.mapObject.tileZoomLevel===e.mapObject.tileZoomScale&&this.mapObject.initialCheck&&Mzt(this.mapObject),je(e.mapObject.centerLatOfGivenLocation)||je(e.mapObject.centerLongOfGivenLocation)||!e.mapObject.zoomNotApplied||(je(r)||(r.y=e.mapObject.centerLatOfGivenLocation,r.x=e.mapObject.centerLongOfGivenLocation),e.mapObject.tileZoomLevel=e.mapObject.mapScaleValue=e.mapObject.scaleOfGivenLocation),e.mapObject.tileTranslatePoint=e.panTileMap(e.mapObject.availableSize.width,e.mapObject.availableSize.height,r),this.mapObject.zoomSettings.resetToInitial&&this.mapObject.initialCheck&&!je(e.mapObject.height)&&512<this.mapObject.availableSize.height&&(this.mapObject.applyZoomReset=!0,this.mapObject.initialZoomLevel=Math.floor(this.mapObject.availableSize.height/512),o=256*Math.pow(2,this.mapObject.initialZoomLevel),je(this.mapObject.initialTileTranslate)||(this.mapObject.initialTileTranslate.x=this.mapObject.availableSize.width/2-o/2,this.mapObject.initialTileTranslate.y=this.mapObject.availableSize.height/2-o/2+20)),e.generateTiles(e.mapObject.tileZoomLevel,e.mapObject.tileTranslatePoint,null,n),je(e.mapObject.previousZoomFactor)||e.mapObject.previousZoomFactor===e.mapObject.zoomSettings.zoomFactor||(e.mapObject.previousZoomFactor=e.mapObject.zoomSettings.zoomFactor),e.mapObject.polygonModule&&!je(t=e.mapObject.polygonModule.polygonRender(this.mapObject,i,e.mapObject.tileZoomLevel))&&e.layerObject.appendChild(t),e.mapObject.navigationLineModule&&!je(r=e.mapObject.navigationLineModule.renderNavigation(e.currentLayer,e.mapObject.tileZoomLevel,i))&&e.layerObject.appendChild(r),e.mapObject.markerModule&&e.mapObject.markerModule.markerRender(this.mapObject,e.layerObject,i,e.mapObject.tileZoomLevel,null),e.translateLayerElements(e.layerObject),e.layerGroup.appendChild(e.layerObject)},p4t.prototype.processLayers=function(n,o){var r=this;if(this.layerObject=this.mapObject.renderer.createGroup({id:this.mapObject.element.id+"_LayerIndex_"+o}),!this.mapObject.enablePersistence){var e=this.mapObject.getModuleName()+this.mapObject.element.id;if(-1===navigator.userAgent.indexOf("Edge")){var t=void 0;try{t=window.localStorage}catch(e){t=null}!je(t)&&window.localStorage.getItem(e)&&window.localStorage.removeItem(e)}}var s={cancel:!1,name:z3t,index:o,layer:n,maps:this.mapObject,visible:n.visible};this.mapObject.trigger("layerRendering",s,function(e){var t,i;!s.cancel&&s.visible&&(je(n.shapeData)&&!je(n.urlTemplate)&&""!==n.urlTemplate?!je(n.urlTemplate)&&-1<n.urlTemplate.indexOf("quadkey")?(t=new s4t(r.mapObject),r.bingMapCalculation(n,o,r,t)):r.renderTileLayer(r,n,o):je(n.shapeData)||je(n.shapeData.geometries)&&je(n.shapeData.features)||(t=!je(n.shapeData.geometries)&&0<n.shapeData.geometries.length?n.shapeData.geometries:n.shapeData.features,n.layerData=[],!je(i=n.shapeData.bbox)&&n.isBaseLayer?r.mapObject.baseMapBounds=new SHt({min:i[0][1],max:i[1][1]},{min:i[0][0],max:i[1][0]}):je(r.mapObject.baseMapBounds)&&!Szt(t)&&r.calculateRectBounds(t),r.calculatePathCollection(o,t)))}),this.mapObject.isTileMap?this.tileSvgObject&&(this.tileSvgObject.appendChild(this.layerGroup),this.mapObject.baseMapBounds=null):this.mapObject.svgObject.appendChild(this.layerGroup)},p4t.prototype.bingMapCalculation=function(e,t,i,n){n.imageUrl=e.urlTemplate,n.subDomains=["t0","t1","t2","t3"],n.maxZoom="21",i.mapObject.bingMap=n,i.renderTileLayer(i,e,t,n),this.mapObject.arrangeTemplate(),this.mapObject.zoomModule&&this.mapObject.previousScale!==this.mapObject.scale&&this.mapObject.zoomModule.applyTransform(this.mapObject,!1,!0)},p4t.prototype.bubbleCalculation=function(e,t){if(null!=e.dataSource&&null!=e)for(var i=e.dataSource,n=0;n<i.length;n++){var o=!je(e.valuePath)&&-1<e.valuePath.indexOf(".")?Number(KHt(e.dataSource[n],e.valuePath)):parseFloat(e.dataSource[n][e.valuePath]);isNaN(o)||(0!==n?o>t.max?t.max=o:o<t.min&&(t.min=o):t.max=t.min=o)}},p4t.prototype.calculatePathCollection=function(y,v){var b=this,w=(this.groupElements=[],Szt(v)||(this.currentFactor=this.calculateFactor(this.currentLayer)),this.rectBounds=null,this.currentLayer.shapeSettings),C=(Array.prototype.forEach.call(v,function(e){var t,i,n;je(e.geometry)&&je(e.coordinates)||(t=(je(e.geometry)?e:e.geometry).type,i=(je(e.geometry)?e:e.geometry).coordinates,n=e.geometry,e=e.properties,b.generatePoints(t,i,n,e))}),this.currentLayer.rectBounds=this.rectBounds,je(this.mapObject.baseMapRectBounds)&&this.currentLayer.isBaseLayer&&(this.mapObject.baseMapRectBounds=this.rectBounds),!je(w.palette)&&1<w.palette.length?w.palette:function(e){var t;switch(e.toLowerCase()){case"tailwind":t=["#0369A1","#14B8A6","#15803D","#334155","#5A61F6","#65A30D","#8B5CF6","#9333EA","#F59E0B","#F97316"];break;case"tailwinddark":t=["#10B981","#22D3EE","#2DD4BF","#4ADE80","#8B5CF6","#E879F9","#F472B6","#F87171","#F97316","#FCD34D"];break;case"tailwind3":t=["#2F4074","#03B4B4","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];break;case"tailwind3dark":t=["#8029F1","#1ABC9C","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];break;case"fluent":t=["#614570","#4C6FB1","#CC6952","#3F579A","#4EA09B","#6E7A89","#D4515C","#E6AF5D","#639751","#9D4D69"];break;case"fluentdark":t=["#8AB113","#2A72D5","#43B786","#584EC6","#E85F9C","#6E7A89","#EA6266","#EBA844","#26BC7A","#BC4870"];break;case"material3":t=["#6200EE","#E77A16","#82C100","#7107DC","#05BB3D","#D21020","#FAD200","#0085FF","#9204EA","#08EE9B"];break;case"material3dark":t=["#4EAAFF","#FA4EAB","#FFF500","#17EA58","#38FFE7","#FF9E45","#B3F32F","#B93CE4","#FC5664","#9B55FF"];break;case"fluent2":t=["#6200EE","#09AF74","#0076E5","#CB3587","#E7910F","#0364DE","#66CD15","#F3A93C","#107C10","#C19C00"];break;case"fluent2dark":case"fluent2highcontrast":t=["#9BB449","#2A72D5","#43B786","#3F579A","#584EC6","#E85F9C","#6E7A89","#EA6266","#0B6A0B","#C19C00"];break;case"bootstrap5":case"bootstrap5dark":t=["#6610F2","#6f42C1","#D63384","#DC3545","#FD7E14","#FFC107","#198754","#0DCAF0"];break;default:t=["#B5E485","#7BC1E8","#DF819C","#EC9B79","#78D0D3","#D6D572","#9178E3","#A1E5B4","#87A4B4","#E4C16C"]}return t}(this.mapObject.theme)),S=Q("div",{id:this.mapObject.element.id+"_LayerIndex_"+y+"_Label_Template_Group",className:this.mapObject.element.id+"_template"});if(S.style.cssText="pointer-events: none; overflow: hidden; position: absolute;top:"+this.mapObject.mapAreaRect.y+"px;left:"+this.mapObject.mapAreaRect.x+"px;height:"+this.mapObject.mapAreaRect.height+"px;width:"+this.mapObject.mapAreaRect.width+"px;",0!==this.currentLayer.layerData.length)for(var e=function(a){function e(n){var o,r="Polygon"===(r=je(c._isMultiPolygon)?(je(c.type)?c[0]:c).type:"MultiPolygon")||"MultiPolygon"===r?"Polygon":r;if(n.cancel?(n.fill=g,n.border.color=w.border.color||b.mapObject.themeStyle.shapeBorderColor,n.border.width=w.border.width):(n.fill="#A6A6A6"===n.fill?n.shape.fill||b.mapObject.themeStyle.shapeFill:n.fill,n.border.color=("transparent"===n.border.color?n.shape:n).border.color,n.border.width=(0===n.border.width?n.shape:n).border.width,je(w.borderColorValuePath)&&(p.color=n.border.color),je(w.borderWidthValuePath)&&(p.width=n.border.width)),n.border.opacity=je(n.border.opacity)?f:n.border.opacity,b.groupElements.length<1)d=b.mapObject.renderer.createGroup({id:b.mapObject.element.id+"_LayerIndex_"+y+"_"+r+"_Group",transform:""}),b.groupElements.push(d);else for(var e=0;e<b.groupElements.length;e++){var t=b.groupElements[e];if(-1<t.id.indexOf(r)){d=t;break}if(e>=b.groupElements.length-1){d=b.mapObject.renderer.createGroup({id:b.mapObject.element.id+"_LayerIndex_"+y+"_"+r+"_Group"}),b.groupElements.push(d);break}}switch(r){case"Polygon":c._isMultiPolygon?u=b.generateMultiPolygonPath(c):(u+="M"+c[0].point.x+" "+c[0].point.y,c.map(function(e){u+=" L "+e.point.x+" "+e.point.y})),3<(u+=" z ").length&&(l=new EHt(m,n.fill,n.border.width,n.border.color,f,n.border.opacity,w.dashArray,u),o=b.mapObject.renderer.drawPath(l));break;case"LineString":c.map(function(e,t){u+=0===t?"M "+e.point.x+" "+e.point.y:"L"+e.point.x+" , "+e.point.y+" "}),3<u.length&&(l=new EHt(m,"transparent",je(n.border.width)?1:n.border.width,je(n.fill)?n.border.color:n.fill,f,n.border.opacity,w.dashArray,u),o=b.mapObject.renderer.drawPath(l));break;case"MultiLineString":c.map(function(e){e.map(function(e,t){u+=0===t?"M "+e.point.x+" "+e.point.y:"L"+e.point.x+" , "+e.point.y+" "})}),3<u.length&&(l=new EHt(m,"transparent",je(n.border.width)?1:n.border.width,je(n.fill)?n.border.color:n.fill,f,n.border.opacity,w.dashArray,u),o=b.mapObject.renderer.drawPath(l));break;case"Point":var i=c.point,s="SubLayer"!==b.mapObject.layers[y].type?w.circleRadius:w.circleRadius/(b.mapObject.isTileMap?b.mapObject.scale:b.currentFactor);h=new BHt(m,n.fill,n.border,f,i.x,i.y,s,w.dashArray),o=b.mapObject.renderer.drawCircle(h);break;case"MultiPoint":c.map(function(e,t){var e=e.point,i="SubLayer"!==b.mapObject.layers[y].type?w.circleRadius:w.circleRadius/(b.mapObject.isTileMap?b.mapObject.scale:b.currentFactor);h=new BHt(m+"_multiLine_"+t,n.fill,n.border,f,e.x,e.y,i,w.dashArray),o=b.mapObject.renderer.drawCircle(h),b.pathAttributeCalculate(d,o,r,c)});break;case"Path":u=c.point,l=new EHt(m,n.fill,n.border.width,n.border.color,f,n.border.opacity,w.dashArray,u),o=b.mapObject.renderer.drawPath(l)}je(o)||"MultiPoint"===r||b.pathAttributeCalculate(d,o,r,c),a===b.currentLayer.layerData.length-1&&b.layerFeatures(y,C,v,S)}var l,h,d,t=void 0,p={color:w.border.color||n.mapObject.themeStyle.shapeBorderColor,width:w.border.width,opacity:w.border.opacity},c=n.currentLayer.layerData[a],u="",g=w.autofill?C[a%C.length]:w.fill||n.mapObject.themeStyle.shapeFill,m=(null===w.colorValuePath||je(c.property)||(null!==(t=yzt(n.currentLayer.dataSource,c.property,n.currentLayer.shapeDataPath,n.currentLayer.shapePropertyPath,n.currentLayer))&&0===w.colorMapping.length?g=-1<n.currentLayer.shapeSettings.colorValuePath.indexOf(".")?KHt(n.currentLayer.dataSource[t],w.colorValuePath):n.currentLayer.dataSource[t][w.colorValuePath]:c.property[w.colorValuePath]&&0===n.currentLayer.dataSource.length&&0===w.colorMapping.length&&(g=-1<n.currentLayer.shapeSettings.colorValuePath.indexOf(".")?KHt(c.property,w.colorValuePath):c.property[w.colorValuePath]),g=je(g)?w.fill||n.mapObject.themeStyle.shapeFill:g),n.mapObject.element.id+"_LayerIndex_"+y+"_shapeIndex_"+a+"_dataIndex_"+t),i=n.getShapeColorMapping(n.currentLayer,c.property,g),g="[object Object]"!==Object.prototype.toString.call(i)||je(i.fill)?g:i.fill,f=((n.currentLayer.shapeSettings.borderColorValuePath||n.currentLayer.shapeSettings.borderWidthValuePath)&&null!==(t=yzt(n.currentLayer.dataSource,c.property,n.currentLayer.shapeDataPath,n.currentLayer.shapePropertyPath,n.currentLayer))&&(n.currentLayer.dataSource[t][w.borderColorValuePath]&&(p.color=n.currentLayer.dataSource[t][w.borderColorValuePath]),n.currentLayer.dataSource[t][w.borderWidthValuePath])&&(p.width=n.currentLayer.dataSource[t][w.borderWidthValuePath]),("[object Object]"!==Object.prototype.toString.call(i)||je(i.opacity)?w:i).opacity),i={cancel:!1,name:j3t,index:a,data:n.currentLayer.dataSource?n.currentLayer.dataSource[t]:null,maps:n.mapObject,shape:w,fill:g,border:{width:p.width,color:p.color,opacity:p.opacity}};e.bind(n),n.mapObject.trigger("shapeRendering",i,e)},n=this,t=0;t<this.currentLayer.layerData.length;t++)e(t);else this.layerFeatures(y,C,v,S)},p4t.prototype.pathAttributeCalculate=function(e,t,i,n){for(var o,r="[object Array]"===Object.prototype.toString.call(this.currentLayer.shapePropertyPath)?this.currentLayer.shapePropertyPath:[this.currentLayer.shapePropertyPath],s=0;s<r.length;s++)if(!je(n.property)){o=r[s];break}t.setAttribute("aria-label",je(n.property)?"":n.property[o]),this.currentLayer.selectionSettings.enable||this.currentLayer.highlightSettings.enable?(t.tabIndex=this.mapObject.tabIndex,t.setAttribute("role","button"),t.style.cursor=this.currentLayer.highlightSettings.enable&&!this.currentLayer.selectionSettings.enable?"default":"pointer"):t.setAttribute("role","region"),"LineString"!==i&&"MultiLineString"!==i||(t.style.cssText="outline:none"),hzt(this.mapObject.selectedElementId,this.mapObject.shapeSelectionClass,t,"ShapeselectionMapStyle"),this.mapObject.legendSettings.toggleLegendSettings.enable&&"Layers"===this.mapObject.legendSettings.type&&dzt(this.mapObject.toggledElementId,t,this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings?this.currentLayer.shapeSettings:this.mapObject.legendSettings.toggleLegendSettings),e.appendChild(t)},p4t.prototype.layerFeatures=function(o,r,e,i){var s,a=this;if(this.mapObject.polygonModule&&this.groupElements.push(this.mapObject.polygonModule.polygonRender(this.mapObject,o,this.mapObject.isTileMap?Math.floor(this.currentFactor):this.currentFactor)),this.currentLayer.bubbleSettings.length&&this.mapObject.bubbleModule)for(var l,t=this.currentLayer.bubbleSettings.length,h=this,n=0;n<t;n++)!function(i){l=h.currentLayer.bubbleSettings[i],s=h.mapObject.renderer.createGroup({id:h.mapObject.element.id+"_LayerIndex_"+o+"_bubble_Group_"+i});var n={min:0,max:0},e=(h.bubbleCalculation(l,n),l.dataSource);h.mapObject.bubbleModule.bubbleCollection=[],!je(e)&&0<e.length&&(e.map(function(e,t){a.renderBubble(a.currentLayer,e,r[t%r.length],n,i,t,s,o,l)}),h.groupElements.push(s))}(n);this.mapObject.markerModule&&!this.mapObject.isTileMap&&this.mapObject.zoomSettings.enable&&this.mapObject.markerModule.calculateZoomCenterPositionAndFactor(this.mapObject.layersCollection);var d,p=this.mapObject.renderer.createGroup({id:this.mapObject.element.id+"_LayerIndex_"+o+"_dataLableIndex_Group"});p.style.pointerEvents="none",this.mapObject.dataLabelModule&&this.currentLayer.dataLabelSettings.visible&&(d=[],Array.prototype.forEach.call(e,function(e,t){a.renderLabel(a.currentLayer,o,e,p,t,i,d)}),this.groupElements.push(p)),this.mapObject.navigationLineModule&&this.groupElements.push(this.mapObject.navigationLineModule.renderNavigation(this.currentLayer,this.currentFactor,o)),je(this.groupElements)||je(this.layerObject)||this.groupElements.map(function(e){je(e)||a.layerObject.appendChild(e)}),this.mapObject.markerModule&&this.mapObject.markerModule.markerRender(this.mapObject,this.layerObject,o,this.mapObject.isTileMap?Math.floor(this.currentFactor):this.currentFactor,null),this.translateLayerElements(this.layerObject),this.layerGroup.appendChild(this.layerObject)},p4t.prototype.renderLabel=function(e,t,i,n,o,r,s){this.mapObject.dataLabelModule.renderLabel(e,t,i,e.layerData,n,r,o,s)},p4t.prototype.generateMultiPolygonPath=function(e){for(var t="",i=0;i<e.length;i++)t+="M"+e[i][0].point.x+" "+e[i][0].point.y,e[i].map(function(e){t+=" L "+e.point.x+" "+e.point.y});return t},p4t.prototype.renderBubble=function(e,t,i,n,o,r,s,a,l){if(je(this.mapObject.bubbleModule)||!l.visible)return null;i=l.fill||i,this.mapObject.bubbleModule.id=this.mapObject.element.id+"_LayerIndex_"+a+"_BubbleIndex_"+o+"_dataIndex_"+r,this.mapObject.bubbleModule.renderBubble(l,t,i,n,o,r,a,e,s,this.mapObject.bubbleModule.id)},p4t.prototype.getShapeColorMapping=function(e,t,i){var n;return i=i||e.shapeSettings.fill,0===e.shapeSettings.colorMapping.length&&je(e.dataSource)||(t=yzt(e.dataSource,t,e.shapeDataPath,e.shapePropertyPath),n=new l4t(this.mapObject),je(e.dataSource))||je(e.dataSource[t])?i:n.getShapeColorMapping(e.shapeSettings,e.dataSource[t],i)},p4t.prototype.generatePoints=function(e,t,i,n){var o=this,r=[];switch(e.toLowerCase()){case"polygon":0<(r=this.calculatePolygonBox(t[0])).length&&(r.property=n,r.type=e,r._isMultiPolygon=!1,this.currentLayer.layerData.push(r));break;case"multipolygon":for(var s=[],a=0;a<t.length;a++)for(var l=0;l<t[a].length;l++)0<(r=this.calculatePolygonBox(t[a][l])).length&&s.push(r);s.property=n,s.type=e,s._isMultiPolygon=!0,this.currentLayer.layerData.push(s);break;case"linestring":var h=je(this.currentLayer.shapeSettings.border.width)?1:"string"==typeof this.currentLayer.shapeSettings.border.width?parseInt(this.currentLayer.shapeSettings.border.width,10):this.currentLayer.shapeSettings.border.width;t.map(function(e){u=e[1],g=e[0];e=aHt(u,g,o.currentFactor,o.currentLayer,o.mapObject);o.calculateBox(e,h),r.push({point:e,lat:u,lng:g})}),r.property=n,r.type=e,this.currentLayer.layerData.push(r);break;case"multilinestring":var d=je(this.currentLayer.shapeSettings.border.width)?1:"string"==typeof this.currentLayer.shapeSettings.border.width?parseInt(this.currentLayer.shapeSettings.border.width,10):this.currentLayer.shapeSettings.border.width,p=[];t.map(function(e){r=[],e.map(function(e){u=e[1],g=e[0];e=aHt(u,g,o.currentFactor,o.currentLayer,o.mapObject);o.calculateBox(e,d),r.push({point:e,lat:u,lng:g})}),p.push(r)}),p.property=n,p.type=e,this.currentLayer.layerData.push(p);break;case"point":var c=(je(this.currentLayer.shapeSettings.border.width)?1:"string"==typeof this.currentLayer.shapeSettings.border.width?parseInt(this.currentLayer.shapeSettings.border.width,10):this.currentLayer.shapeSettings.border.width)+2*this.currentLayer.shapeSettings.circleRadius,u=t[1],g=t[0],m=aHt(u,g,this.currentFactor,this.currentLayer,this.mapObject);this.calculateBox(m,c),this.currentLayer.layerData.push({point:m,type:e,lat:u,lng:g,property:n});break;case"multipoint":var f=(je(this.currentLayer.shapeSettings.border.width)?1:"string"==typeof this.currentLayer.shapeSettings.border.width?parseInt(this.currentLayer.shapeSettings.border.width,10):this.currentLayer.shapeSettings.border.width)+2*this.currentLayer.shapeSettings.circleRadius,r=[];t.map(function(e){u=e[1],g=e[0];e=aHt(u,g,o.currentFactor,o.currentLayer,o.mapObject);o.calculateBox(e,f),r.push({point:e,lat:u,lng:g})}),r.property=n,r.type=e,this.currentLayer.layerData.push(r);break;case"path":this.currentLayer.layerData.push({point:i.d,type:e,property:n})}},p4t.prototype.calculateBox=function(e,t){je(this.rectBounds)?this.rectBounds={min:{x:e.x-t,y:e.y-t},max:{x:e.x+t,y:e.y+t}}:(this.rectBounds.min.x=Math.min(this.rectBounds.min.x,e.x-t),this.rectBounds.min.y=Math.min(this.rectBounds.min.y,e.y-t),this.rectBounds.max.x=Math.max(this.rectBounds.max.x,e.x+t),this.rectBounds.max.y=Math.max(this.rectBounds.max.y,e.y+t))},p4t.prototype.calculateFactor=function(e){var t,i,n=1,o=this.mapObject.baseMapBounds,r=new eHt(this.mapObject.mapAreaRect.width,this.mapObject.mapAreaRect.height-5);return o?(i=aHt(o.latitude.min,o.longitude.min,null,e,this.mapObject),t=(o=aHt(o.latitude.max,o.longitude.max,null,e,this.mapObject)).y-i.y,i=o.x-i.x,0!==t&&0!==i||(i=r.width/2,t=r.height)):t=i=500,e=t<r.height?parseFloat(Math.abs(100*Number(r.height/Number(t.toString()+"e+1"))).toString().split(".")[0])/10:r.height/t,n=i<r.width?parseFloat(Math.abs(100*Number(r.width/Number(i.toString()+"e+1"))).toString().split(".")[0])/10:r.width/i,Math.min(n,e)},p4t.prototype.translateLayerElements=function(e){if(this.mapObject.translateType="layer",je(this.mapObject.baseMapRectBounds)){if(this.mapObject.isTileMap&&!je(this.mapObject.scale))for(var t=0;t<e.childElementCount;t++)-1<(l=e.childNodes[t]).id.indexOf("_Markers_Group")||-1<l.id.indexOf("_bubble_Group")||-1<l.id.indexOf("_dataLableIndex_Group")||-1<l.id.indexOf("_line_Group")||-1===l.id.indexOf("_Polygons_Group")&&(a="scale( "+this.mapObject.scale+" ) translate( "+this.mapObject.translatePoint.x+" "+this.mapObject.translatePoint.y+" ) ",l.setAttribute("transform",a))}else{var i="Disable"===Ut?0:0===this.currentLayer.animationDuration&&"Enable"===Ut?1e3:this.currentLayer.animationDuration,n=0!==i||je(this.mapObject.zoomModule),o=(this.mapObject.baseTranslatePoint=this.mapObject.zoomTranslatePoint,void 0),o=(1<this.mapObject.zoomSettings.zoomFactor&&!je(this.mapObject.zoomModule)?Dzt:Ezt)(this.mapObject,this.currentLayer,n),r=this.mapObject.previousScale=o.scale,s=this.mapObject.previousPoint=o.location;this.mapObject.baseTranslatePoint=this.mapObject.translatePoint=s,this.mapObject.baseScale=this.mapObject.scale=r;for(var a,l,h=0;h<e.childElementCount;h++)-1<(l=e.childNodes[h]).id.indexOf("_Markers_Group")||-1<l.id.indexOf("_bubble_Group")||-1<l.id.indexOf("_dataLableIndex_Group")||(a="scale( "+r+" ) translate( "+s.x+" "+s.y+" ) ",l.setAttribute("transform",a),0<i&&!je(this.mapObject.zoomModule)&&(o=(1<this.mapObject.zoomSettings.zoomFactor?Dzt:Ezt)(this.mapObject,this.currentLayer),this.mapObject.scale=o.scale,this.mapObject.zoomTranslatePoint=this.mapObject.translatePoint=o.location))}},p4t.prototype.calculateRectBounds=function(e){var n=this;Array.prototype.forEach.call(e,function(e){if(!je(e.geometry)||!je(e.coordinates)){var t=(je(e.geometry)?e:e.geometry).type,i=(je(e.geometry)?e:e.geometry).coordinates;switch(t.toLowerCase()){case"polygon":n.calculateRectBox(i[0]);break;case"multipolygon":i.map(function(e){n.calculateRectBox(e[0])});break;case"multilinestring":i.map(function(e){e.map(function(e,t){n.calculateRectBox(e,"multilinestring",0===t)})});break;case"linestring":i.map(function(e,t){n.calculateRectBox(e,"linestring",0===t)});break;case"point":n.calculateRectBox(i,"point");break;case"multipoint":i.map(function(e,t){n.calculateRectBox(e,"multipoint",0===t)})}}})},p4t.prototype.calculatePolygonBox=function(e){var n=this,o=[],r=this.mapObject.baseMapBounds;return e.map(function(e){var t,i=e[1],e=e[0];e>=r.longitude.min&&e<=r.longitude.max&&i>=r.latitude.min&&i<=r.latitude.max&&(t=aHt(i,e,n.currentFactor,n.currentLayer,n.mapObject),je(n.rectBounds)?n.rectBounds={min:{x:t.x,y:t.y},max:{x:t.x,y:t.y}}:(n.rectBounds.min.x=Math.min(n.rectBounds.min.x,t.x),n.rectBounds.min.y=Math.min(n.rectBounds.min.y,t.y),n.rectBounds.max.x=Math.max(n.rectBounds.max.x,t.x),n.rectBounds.max.y=Math.max(n.rectBounds.max.y,t.y)),o.push({point:t,lat:i,lng:e}))}),o},p4t.prototype.calculateRectBox=function(e,t,i){var n=this;"linestring"!==t&&"multilinestring"!==t&&"point"!==t&&"multipoint"!==t?Array.prototype.forEach.call(e,function(e){je(n.mapObject.baseMapBounds)?n.mapObject.baseMapBounds=new SHt({min:e[1],max:e[1]},{min:e[0],max:e[0]}):(n.mapObject.baseMapBounds.latitude.min=Math.min(n.mapObject.baseMapBounds.latitude.min,e[1]),n.mapObject.baseMapBounds.latitude.max=Math.max(n.mapObject.baseMapBounds.latitude.max,e[1]),n.mapObject.baseMapBounds.longitude.min=Math.min(n.mapObject.baseMapBounds.longitude.min,e[0]),n.mapObject.baseMapBounds.longitude.max=Math.max(n.mapObject.baseMapBounds.longitude.max,e[0]))}):(i||"point"===t)&&je(this.mapObject.baseMapBounds)?this.mapObject.baseMapBounds=new SHt({min:e[1],max:e[1]},{min:e[0],max:e[0]}):(this.mapObject.baseMapBounds.latitude.min=Math.min(this.mapObject.baseMapBounds.latitude.min,e[1]),this.mapObject.baseMapBounds.latitude.max=Math.max(this.mapObject.baseMapBounds.latitude.max,e[1]),this.mapObject.baseMapBounds.longitude.min=Math.min(this.mapObject.baseMapBounds.longitude.min,e[0]),this.mapObject.baseMapBounds.longitude.max=Math.max(this.mapObject.baseMapBounds.longitude.max,e[0]))},p4t.prototype.generateTiles=function(e,t,i,n,o,r){var s,a=this.mapObject.locale,l=this.mapObject.availableSize,h=(this.tiles=[],g=s=Math.pow(2,e),0),d=0,p=(t.x+256*g<l.width&&(h=0<t.x?Math.ceil(t.x/256):0,d=t.x+256*g<l.width?Math.ceil((l.width-(t.x+256*g))/256):0),g+=h+d,"Pan"===i?(g=this.horizontalPanXCount>=g?this.horizontalPanXCount:g,this.horizontalPan=!1):(this.horizontalPanXCount=g,this.horizontalPan=!0),this.mapObject.layers[this.mapObject.baseLayerIndex]),c=(this.urlTemplate=p.urlTemplate,Math.min(s,(-t.y+l.height)/256+1)),u=Math.min(g,(-t.x+l.width+256*d)/256+1),g=-(t.x+256*h+256)/256,m=-(t.y+256)/256;n=n||this.bing||this.mapObject.bingMap;for(var f=Math.round(g);f<Math.round(u);f++)for(var y=Math.round(m);y<Math.round(c);y++){var v,b=256*f+t.x,w=256*y+t.y;-256<b&&b<=l.width&&-256<w&&w<l.height&&0<=y&&((v=new B3t((f<0?f%s+s:f)%s,y)).left=Math.round(b),v.top=Math.round(w),n&&!je(p.urlTemplate)&&""!==p.urlTemplate&&-1<p.urlTemplate.indexOf("quadkey")?v.src=n.getBingMap(v,"","",a,n.imageUrl,n.subDomains):(n=null,v.src=this.urlTemplate.replace("level",e.toString()).replace("tileX",v.x.toString()).replace("tileY",v.y.toString())),this.tiles.push(v))}je(i)||(1<i.indexOf("wheel")?(this.animateToZoomX=this.mapObject.availableSize.width/2-o.x-10,this.animateToZoomY=-o.y):(this.animateToZoomX=-10,this.animateToZoomY=10-(this.mapObject.availableSize.height/2+11.5)));for(var C=Pe([],this.tiles,[],!0),S=0,A=this.mapObject.layers;S<A.length;S++){var x=A[S];if("SubLayer"===x.type&&x.visible&&(je(x.shapeData)&&!je(x.urlTemplate)&&""!==x.urlTemplate))for(var I=0,T=C;I<T.length;I++){var E=T[I],D=Pe({},E,{},!0);x.urlTemplate.indexOf("quadkey")?(n=new s4t(this.mapObject),D.src=n.getBingMap(D,"","",a,n.imageUrl,n.subDomains)):D.src=x.urlTemplate.replace("level",e.toString()).replace("tileX",E.x.toString()).replace("tileY",E.y.toString()),this.tiles.push(D)}}(this.mapObject.previousScale!==this.mapObject.scale||this.mapObject.isReset||this.mapObject.isZoomByPosition||this.mapObject.zoomNotApplied)&&this.arrangeTiles(i,this.animateToZoomX,this.animateToZoomY,r)},p4t.prototype.arrangeTiles=function(o,e,t,r){var i,s=this,a=(void 0===r&&(r=!1),document.getElementById(this.mapObject.element.id+"_tile_parent")),l=document.getElementById(this.mapObject.element.id+"_tiles");r?(je(i=document.getElementById(this.mapObject.element.id+"_animates_tiles"))&&(i=Q("div",{id:this.mapObject.element.id+"_animates_tiles"})),this.tileProcess(o,i,r),l.appendChild(i)):(i=void 0,i=je(o)||"Pan"===o||(this.tileAnimation(o,e,t),"Disable"===Ut)?0:0===this.mapObject.layersCollection[0].animationDuration&&"Enable"===Ut?1e3:this.mapObject.layersCollection[0].animationDuration,setTimeout(function(){var e;if(a&&(a.style.zIndex="1"),l&&(l.style.zIndex="0"),!document.getElementById(s.mapObject.element.id+"_animated_tiles")&&a?(e=Q("div",{id:s.mapObject.element.id+"_animated_tiles"}),a.appendChild(e)):"Pan"!==o&&l&&a?(l.appendChild(a.children[0]),s.mapObject.isAddLayer||je(document.getElementById(s.mapObject.element.id+"_animated_tiles"))||(document.getElementById(s.mapObject.element.id+"_animated_tiles").id=s.mapObject.element.id+"_animated_tiles_old"),e=Q("div",{id:s.mapObject.element.id+"_animated_tiles"}),a.appendChild(e)):e=a?a.children[0]:null,s.tileProcess(o,e,r),!je(s.mapObject.currentTiles))for(var t=s.tiles.length;t<e.childElementCount;t++){for(var i=!1,n=0;n<s.mapObject.currentTiles.childElementCount;n++)i||s.mapObject.currentTiles.children[n].id!==e.children[t].id||(i=!0);i?e.children[t].style.display="none":e.removeChild(e.children[t])}},i))},p4t.prototype.tileProcess=function(e,t,i){for(var n=0;n<this.tiles.length;n++){var o,r,s=this.tiles[n],a=null,l=this.mapObject.element.id;"Pan"===e?(o=!1,a=je(r=document.getElementById(l+"_tile_"+n))?(o=!0,r=Q("div",{id:l+"_tile_"+n}),Q("img")):(r.style.removeProperty("display"),r.children[0]),!o&&a&&a.src!==s.src&&(a.src=s.src),r.style.position="absolute",r.style.left=s.left+"px",r.style.top=s.top+"px",r.style.height=s.height+"px",r.style.width=s.width+"px",o&&(a.setAttribute("height","256px"),a.setAttribute("width","256px"),a.setAttribute("src",s.src),a.setAttribute("alt",this.mapObject.getLocalizedLabel("ImageNotFound")),a.style.setProperty("user-select","none"),r.appendChild(a),t.appendChild(r))):((a=Q("img")).setAttribute("height","256px"),a.setAttribute("width","256px"),a.setAttribute("src",s.src),a.style.setProperty("user-select","none"),a.setAttribute("alt",this.mapObject.getLocalizedLabel("ImageNotFound")),(r=Q("div",{id:l+"_tile_"+n})).style.position="absolute",r.style.left=s.left+"px",r.style.top=s.top+"px",r.style.height=s.height+"px",r.style.width=s.width+"px",r.appendChild(a),t&&t.appendChild(r)),!i&&n===this.tiles.length-1&&document.getElementById(this.mapObject.element.id+"_animated_tiles_old")&&Izt(this.mapObject.element.id+"_animated_tiles_old")}},p4t.prototype.tileAnimation=function(e,t,i){var n=document.getElementById(this.mapObject.element.id+"_tile_parent"),o=document.getElementById(this.mapObject.element.id+"_animated_tiles"),r=document.getElementById(this.mapObject.element.id+"_tiles"),s="2";if(0===e.indexOf("ZoomOut")||"Reset"===e){for(r.style.zIndex="1",n.style.zIndex="0";1<=r.childElementCount;)r.removeChild(r.children[0]);t=0,i=document.getElementById(this.mapObject.element.id+"_tile_parent").getClientRects()[0].height/4,s=0===e.indexOf("ZoomOut")?"0.5":"0.2"}je(o)||(o.style.transition="Disable"===Ut?"0ms":0===this.mapObject.layersCollection[0].animationDuration&&"Enable"===Ut?"1000ms":this.mapObject.layersCollection[0].animationDuration+"ms",o.style.transform="translate("+t+"px, "+i+"px) scale("+s+")")},p4t.prototype.panTileMap=function(e,t,i){this.mapObject.tileZoomLevel<=this.mapObject.tileZoomScale&&this.mapObject.initialCheck&&(this.mapObject.tileZoomLevel=this.mapObject.tileZoomScale);var n=this.mapObject.tileZoomLevel,o=256*Math.pow(2,n),r=e/2-o/2,s=t/2-o/2,a=hHt(i,n,{x:r,y:s},this.isMapCoordinates),l=this.mapObject.zoomNotApplied?0:20;return r-=a.x-e/2,s=s-(a.y-t/2)+l,this.mapObject.scale=Math.pow(2,n-1),(je(this.mapObject.tileTranslatePoint)||0===this.mapObject.tileTranslatePoint.y&&0===this.mapObject.tileTranslatePoint.x||je(this.mapObject.previousTileWidth)||je(this.mapObject.previousTileHeight))&&(this.mapObject.previousTileWidth=e,this.mapObject.previousTileHeight=t),je(this.mapObject.tileTranslatePoint)||!je(i.x)||1!==this.mapObject.zoomSettings.zoomFactor&&this.mapObject.zoomSettings.zoomFactor===n&&this.mapObject.defaultState||e===this.mapObject.previousTileWidth&&t===this.mapObject.previousTileHeight||(a=r-(this.mapObject.previousTileWidth/2-o/2),i=s-(this.mapObject.previousTileHeight/2-o/2+l),this.mapObject.tileTranslatePoint.x=this.mapObject.tileTranslatePoint.x+a,this.mapObject.tileTranslatePoint.y=this.mapObject.tileTranslatePoint.y+i),je(this.mapObject.tileTranslatePoint)||this.mapObject.zoomNotApplied||(0===this.mapObject.tileTranslatePoint.x||this.mapObject.tileTranslatePoint.x===r||this.mapObject.centerPositionChanged||(r=this.mapObject.tileTranslatePoint.x),0===this.mapObject.tileTranslatePoint.y)||this.mapObject.tileTranslatePoint.y===s||this.mapObject.centerPositionChanged||(s=this.mapObject.tileTranslatePoint.y),this.mapObject.translatePoint=new wHt((r-.01*this.mapObject.zoomSettings.zoomFactor)/this.mapObject.scale,(s-.01*this.mapObject.zoomSettings.zoomFactor)/this.mapObject.scale),this.mapObject.previousTileWidth=e,this.mapObject.previousTileHeight=t,new wHt(r,s)},p4t.prototype.destroy=function(){this.mapObject=null,this.groupElements=[],this.layerObject=null,this.currentLayer=null,this.rectBounds=null,this.tiles=[],this.clipRectElement=null,this.tileSvgObject=null,this.ajaxModule=null,this.ajaxResponse=[],this.layerGroup=null,je(this.bing)||this.bing.destroy(),this.bing=null};var d4t=p4t;function p4t(e){this.isMapCoordinates=!0,this.horizontalPan=!1,this.horizontalPanXCount=0,this.mapObject=e,this.ajaxModule=new Qe,this.ajaxResponse=[]}u4t.prototype.renderAnnotationElements=function(){var i=this,e=this.map.element.id+"_Secondary_Element",n=Q("div",{id:this.map.element.id+"_Annotations_Group"});n.style.position="absolute",n.style.top="0px",n.style.left="0px",this.map.annotations.map(function(e,t){null!==e.content&&i.createAnnotationTemplate(n,e,t)}),0<n.childElementCount&&!je(kzt(e))&&kzt(e).appendChild(n),this.map.renderReactTemplates()},u4t.prototype.createAnnotationTemplate=function(e,t,n){var o,r,s=this,i=this.map,a=i.availableSize,l=Q("div",{id:i.element.id+"_Annotation_"+n}),h=(l.style.cssText="position: absolute; z-index:"+t.zIndex+";",{cancel:!1,name:i4t,content:t.content,annotation:t}),d=(this.map.trigger(i4t,h,function(e){if(!h.cancel)if((o=Fzt(h.content,s.map))&&o(s.map,s.map,h.content,s.map.element.id+"_ContentTemplate_"+n).length)for(var t=(r=Array.prototype.slice.call(o(s.map,s.map,h.content,s.map.element.id+"_ContentTemplate_"+n))).length,i=0;i<t;i++)l.appendChild(r[i]);else l.appendChild(Q("div",{innerHTML:h.content}))}),Zzt(l.cloneNode(!0),i.element)),p=i.element.getBoundingClientRect(),c=i.svgObject.getBoundingClientRect(),u=Math.abs(c.left-p.left),g=Math.abs(c.top-p.top),i=je(t.x)?"0%":t.x,p=je(t.y)?"0%":t.y,m=-1<i.indexOf("%")?a.width/100*parseFloat(i):parseFloat(i),f=-1<p.indexOf("%")?a.height/100*parseFloat(p):parseFloat(p);switch(u="None"===t.horizontalAlignment?u+m:u,g="None"===t.verticalAlignment?g+f:g,t.verticalAlignment){case"Near":g+=f;break;case"Center":g=g+f+(c.height/2-d.height/2);break;case"Far":g=g+c.height+f-d.height}switch(t.horizontalAlignment){case"Near":u+=m;break;case"Center":u=u+m+(c.width/2-d.width/2);break;case"Far":u=u+c.width+m-d.width}l.style.left=u+"px",l.style.top=g+"px",e.appendChild(l)},u4t.prototype.getModuleName=function(){return"Annotations"},u4t.prototype.destroy=function(){this.map=null};var c4t=u4t;function u4t(e){this.map=e}g4t=function(e,t){return(g4t=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])}))(e,t)};var g4t,m4t,d2t=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},u2t=(function(e,t){function i(){this.constructor=e}g4t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(f4t,m4t=Ji),Object.defineProperty(f4t.prototype,"isShapeSelected",{get:function(){return this.mapSelect},enumerable:!0,configurable:!0}),f4t.prototype.mergePersistMapsData=function(){var e;try{i=window.localStorage}catch(e){i=null}if(je(i)||(e=window.localStorage.getItem(this.getModuleName()+this.element.id)),!je(e)&&""!==e){var t=JSON.parse(e),i=Object.keys(t);this.isProtectedOnChange=!0;for(var n=0,o=i;n<o.length;n++){var r=o[n];"object"!=typeof this[r]||je(this[r])?this[r]=t[r]:Pe(this[r],t[r])}this.isProtectedOnChange=!1}},f4t.prototype.getLocalizedLabel=function(e){return this.localeObject.getConstant(e)},f4t.prototype.preRender=function(){this.isDevice=F.isDevice,this.initPrivateVariable(),this.allowServerDataBinding=!1,this.unWireEVents(),this.wireEVents(),this.setCulture()},f4t.prototype.renderElements=function(){this.isDestroyed||(this.trigger("load",{maps:this}),this.createSVG(),this.findBaseAndSubLayers(),!je(this.markerModule)&&this.markerModule.getMapsInstance()&&this.markerModule.initializeMarkerClusterList(),this.createSecondaryElement(),this.addTabIndex(),this.themeStyle=function(e){var t,i;switch(e.toLowerCase()){case"materialdark":i="#303030";break;case"fabricdark":i="#201F1F";break;case"bootstrapdark":i="#1A1A1A"}switch(e.toLowerCase()){case"materialdark":case"fabricdark":case"bootstrapdark":t={backgroundColor:i,areaBackgroundColor:i,titleFontColor:"#FFFFFF",titleFontSize:"14px",subTitleFontColor:"#FFFFFF",legendTitleFontColor:"#DADADA",legendTextColor:"#DADADA",dataLabelFontColor:"#DADADA",tooltipFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",zoomFillColor:"#FFFFFF",labelFontFamily:"Roboto, Noto, Sans-serif",fontFamily:"Roboto, Noto, Sans-serif",fontSize:"12px",legendFontSize:"12px",fontWeight:"Medium",titleFontWeight:"Medium",zoomSelectionColor:"#e61576",shapeFill:"#A6A6A6",shapeBorderColor:"#000000",rectangleZoomFillColor:"#d3d3d3",rectangleZoomFillOpacity:.5,rectangleZoomBorderColor:"#009900",legendBorderColor:"#000000",legendBorderWidth:0,tooltipBorderColor:"transparent",zoomButtonRadius:30};break;case"highcontrast":t={backgroundColor:"#000000",areaBackgroundColor:"#000000",titleFontColor:"#FFFFFF",titleFontSize:"14px",subTitleFontColor:"#FFFFFF",legendTitleFontColor:"#FFFFFF",legendTextColor:"#FFFFFF",dataLabelFontColor:"#000000",tooltipFontColor:"#000000",tooltipFillColor:"#ffffff",zoomFillColor:"#FFFFFF",fontFamily:"Roboto, Noto, Sans-serif",fontSize:"12px",legendFontSize:"12px",fontWeight:"Medium",labelFontFamily:"Roboto, Noto, Sans-serif",titleFontWeight:"Medium",zoomSelectionColor:"#e61576",shapeFill:"#A6A6A6",shapeBorderColor:"#000000",rectangleZoomFillColor:"#d3d3d3",rectangleZoomFillOpacity:.5,rectangleZoomBorderColor:"#009900",legendBorderColor:"#000000",legendBorderWidth:0,tooltipBorderColor:"transparent",zoomButtonRadius:30};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",areaBackgroundColor:"#FFFFFF",titleFontColor:"#212529",subTitleFontColor:"#212529",legendTitleFontColor:"#212529",legendTextColor:"#212529",dataLabelFontColor:"#212529",tooltipFontColor:"#FFFFFF",tooltipFillColor:"#000000",zoomFillColor:"#5B6269",fontFamily:"HelveticaNeue-Medium",fontSize:"12px",fontWeight:"Medium",titleFontSize:"16px",legendFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:.9,labelFontFamily:"HelveticaNeue-Medium",titleFontWeight:"Medium",zoomSelectionColor:"#e61576",shapeFill:"#A6A6A6",shapeBorderColor:"#000000",rectangleZoomFillColor:"#d3d3d3",rectangleZoomFillOpacity:.5,rectangleZoomBorderColor:"#009900",legendBorderColor:"#000000",legendBorderWidth:0,tooltipBorderColor:"transparent",zoomButtonRadius:30};break;case"tailwind":t={backgroundColor:"rgba(255,255,255, 0.0)",areaBackgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#374151",subTitleFontColor:"#374151",legendTitleFontColor:"#374151",legendTextColor:"#6B7280",dataLabelFontColor:"#505967",tooltipFontColor:"#F9FAFB",tooltipFillColor:"#111827",zoomFillColor:"#6b7280",fontFamily:"Inter",fontSize:"12px",fontWeight:"Medium",titleFontSize:"14px",legendFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:.9,labelFontFamily:"Inter",titleFontWeight:"500",zoomSelectionColor:"#374151",shapeFill:"#E5E7EB",shapeBorderColor:"#000000",rectangleZoomFillColor:"#d3d3d3",rectangleZoomFillOpacity:.5,rectangleZoomBorderColor:"#009900",legendBorderColor:"#000000",legendBorderWidth:0,tooltipBorderColor:"transparent",zoomButtonRadius:30};break;case"tailwinddark":t={backgroundColor:"rgba(255,255,255, 0.0)",areaBackgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#D1D5DB",subTitleFontColor:"#D1D5DB",legendTitleFontColor:"#D1D5DB",legendTextColor:"#D1D5DB",dataLabelFontColor:"#D1D5DB",tooltipFontColor:"#1F2937",tooltipFillColor:"#F9FAFB",zoomFillColor:"#D1D5DB",fontFamily:"Inter",fontSize:"12px",fontWeight:"Medium",titleFontSize:"14px",legendFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:.9,labelFontFamily:"Inter",titleFontWeight:"500",zoomSelectionColor:"#F3F4F6",shapeFill:"#374151",shapeBorderColor:"#000000",rectangleZoomFillColor:"#d3d3d3",rectangleZoomFillOpacity:.5,rectangleZoomBorderColor:"#009900",legendBorderColor:"#000000",legendBorderWidth:0,tooltipBorderColor:"transparent",zoomButtonRadius:30};break;case"tailwind3":t={backgroundColor:"rgba(255,255,255, 0.0)",areaBackgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#111827",subTitleFontColor:"#111827",legendTitleFontColor:"#111827",legendTextColor:"#6B7280",dataLabelFontColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFillColor:"#111827",zoomFillColor:"#374151",fontFamily:"Inter",fontSize:"12px",fontWeight:"400",titleFontSize:"14px",legendFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Inter",titleFontWeight:"500",zoomSelectionColor:"#6B7280",shapeFill:"#F3F4F6",shapeBorderColor:"#E5E7EB",rectangleZoomFillColor:"#818CF8",rectangleZoomFillOpacity:.3,rectangleZoomBorderColor:"#4F46E5",legendBorderColor:"#E5E7EB",legendBorderWidth:0,tooltipBorderColor:"#111827",zoomButtonRadius:32};break;case"tailwind3dark":t={backgroundColor:"rgba(255,255,255, 0.0)",areaBackgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#FFFFFF",subTitleFontColor:"#FFFFFF",legendTitleFontColor:"#FFFFFF",legendTextColor:"#9CA3AF",dataLabelFontColor:"#FFFFFF",tooltipFontColor:"#1F2937",tooltipFillColor:"#F9FAFB",zoomFillColor:"#D1D5DB",fontFamily:"Inter",fontSize:"12px",fontWeight:"400",titleFontSize:"14px",legendFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Inter",titleFontWeight:"600",zoomSelectionColor:"#9CA3AF",shapeFill:"#282F3C",shapeBorderColor:"#282F3C",rectangleZoomFillColor:"#3730A3",rectangleZoomFillOpacity:.3,rectangleZoomBorderColor:"#6366F1",legendBorderColor:"#282F3C",legendBorderWidth:0,tooltipBorderColor:"#F9FAFB",zoomButtonRadius:30};break;case"bootstrap5":t={backgroundColor:"transparent",areaBackgroundColor:"transparent",titleFontColor:"#212529",subTitleFontColor:"#212529",legendTitleFontColor:"#212529",legendTextColor:"#212529",dataLabelFontColor:"#212529",tooltipFontColor:"#FFFFFF",tooltipFillColor:"#000000",zoomFillColor:"#6E757D",fontFamily:"Segoe UI",fontSize:"10px",fontWeight:"400",titleFontSize:"14px",subTitleFontSize:"12px",legendFontSize:"10px",tooltipFillOpacity:.9,tooltipTextOpacity:1,labelFontFamily:"Segoe UI",titleFontWeight:"400",zoomSelectionColor:"#212529",zoomBorderColor:"#DEE2E6",shapeFill:"#E9ECEF",shapeBorderColor:"#DEE2E6",zoomButtonRadius:32,rectangleZoomBorderColor:"#0D6EFD",rectangleZoomFillColor:"#86B7FE",rectangleZoomFillOpacity:.3,legendBorderColor:"#000000",legendBorderWidth:0,tooltipBorderColor:"transparent"};break;case"bootstrap5dark":t={backgroundColor:"transparent",areaBackgroundColor:"transparent",titleFontColor:"#DEE2E6",subTitleFontColor:"#DEE2E6",legendTitleFontColor:"#DEE2E6",legendTextColor:"#DEE2E6",dataLabelFontColor:"#DEE2E6",tooltipFontColor:"#212529",tooltipFillColor:"#FFFFFF",zoomFillColor:"#ADB5BD",fontFamily:"Segoe UI",fontSize:"10px",fontWeight:"400",titleFontSize:"14px",subTitleFontSize:"12px",legendFontSize:"10px",tooltipFillOpacity:.9,tooltipTextOpacity:1,labelFontFamily:"Segoe UI",titleFontWeight:"400",zoomSelectionColor:"#F8F9FA",zoomBorderColor:"#495057",shapeFill:"#343A40",shapeBorderColor:"#495057",zoomButtonRadius:32,rectangleZoomFillColor:"#86B7FE",rectangleZoomBorderColor:"#0D6EFD",rectangleZoomFillOpacity:.3,legendBorderColor:"#000000",legendBorderWidth:0,tooltipBorderColor:"transparent"};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",areaBackgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",subTitleFontColor:"#201F1E",legendTitleFontColor:"#201F1E",legendTextColor:"#201F1E",dataLabelFontColor:"#201F1E",tooltipFontColor:"#323130",tooltipFillColor:"#FFFFFF",zoomFillColor:"#A19F9D",fontFamily:"Segoe UI",fontSize:"12px",fontWeight:"Medium",titleFontSize:"14px",legendFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Segoe UI",titleFontWeight:"600",zoomSelectionColor:"#323130",shapeFill:"#F3F2F1",shapeBorderColor:"#000000",rectangleZoomFillColor:"#d3d3d3",rectangleZoomFillOpacity:.5,rectangleZoomBorderColor:"#009900",legendBorderColor:"#000000",legendBorderWidth:0,tooltipBorderColor:"transparent",zoomButtonRadius:30};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",areaBackgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",subTitleFontColor:"#F3F2F1",legendTitleFontColor:"#F3F2F1",legendTextColor:"#F3F2F1",dataLabelFontColor:"#F3F2F1",tooltipFontColor:"#F3F2F1",tooltipFillColor:"#252423",zoomFillColor:"#484644",fontFamily:"Segoe UI",fontSize:"12px",fontWeight:"Medium",titleFontSize:"14px",legendFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Segoe UI",titleFontWeight:"600",zoomSelectionColor:"#F3F2F1",shapeFill:"#252423",shapeBorderColor:"#000000",rectangleZoomFillColor:"#d3d3d3",rectangleZoomFillOpacity:.5,rectangleZoomBorderColor:"#009900",legendBorderColor:"#000000",legendBorderWidth:0,tooltipBorderColor:"transparent",zoomButtonRadius:30};break;case"material3":t={backgroundColor:"transparent",areaBackgroundColor:"transparent",titleFontColor:"#1C1B1F",subTitleFontColor:"#1C1B1F",legendTitleFontColor:"#1C1B1F",legendTextColor:"#49454E",dataLabelFontColor:"#1C1B1F",tooltipFontColor:"#F4EFF4",tooltipFillColor:"#313033",zoomFillColor:"#49454E",fontFamily:"Roboto",fontSize:"14px",titleFontSize:"16px",subTitleFontSize:"14px",legendFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Roboto",titleFontWeight:"500",fontWeight:"400",zoomSelectionColor:"#49454E",shapeFill:"#E7E0EC",shapeBorderColor:"#000000",rectangleZoomFillColor:"#6750A4",rectangleZoomFillOpacity:.24,rectangleZoomBorderColor:"#6750A4",legendBorderColor:"#000000",legendBorderWidth:0,tooltipBorderColor:"transparent",zoomButtonRadius:30};break;case"material3dark":t={backgroundColor:"transparent",areaBackgroundColor:"transparent",titleFontColor:"#E6E1E5",subTitleFontColor:"#E6E1E5",legendTitleFontColor:"#E6E1E5",legendTextColor:"#CAC4D0",dataLabelFontColor:"#E6E1E5",tooltipFontColor:"#313033",tooltipFillColor:"#E6E1E5",zoomFillColor:"#E6E1E5",fontFamily:"Roboto",fontSize:"14px",titleFontSize:"16px",subTitleFontSize:"14px",legendFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Roboto",titleFontWeight:"500",fontWeight:"400",zoomSelectionColor:"#E6E1E5",shapeFill:"#49454F",shapeBorderColor:"#000000",rectangleZoomFillColor:"#D0BCFF",rectangleZoomFillOpacity:.24,rectangleZoomBorderColor:"#D0BCFF",legendBorderColor:"#000000",legendBorderWidth:0,tooltipBorderColor:"transparent",zoomButtonRadius:30};break;case"fluent2":t={backgroundColor:"transparent",areaBackgroundColor:"transparent",titleFontColor:"#242424",subTitleFontColor:"#242424",legendTitleFontColor:"#242424",legendTextColor:"#242424",dataLabelFontColor:"#242424",tooltipFontColor:"#242424",tooltipFillColor:"#FFFFFF",zoomFillColor:"#D1D1D1",fontFamily:"Segoe UI",fontSize:"10px",fontWeight:"400",titleFontSize:"14px",subTitleFontSize:"12px",legendFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Segoe UI",titleFontWeight:"600",zoomSelectionColor:"#242424",shapeFill:"#E6E6E6",shapeBorderColor:"#EBEBEB",rectangleZoomFillColor:"#B4D6FA",rectangleZoomFillOpacity:.25,rectangleZoomBorderColor:"#0F6CBD",legendBorderColor:"#000000",legendBorderWidth:0,tooltipBorderColor:"transparent",zoomButtonRadius:32};break;case"fluent2dark":t={backgroundColor:"transparent",areaBackgroundColor:"transparent",titleFontColor:"#FFFFFF",subTitleFontColor:"#FFFFFF",legendTitleFontColor:"#FFFFFF",legendTextColor:"#FFFFFF",dataLabelFontColor:"#FFFFFF",tooltipFontColor:"#FFFFFF",tooltipFillColor:"#292929",zoomFillColor:"#666",fontFamily:"Segoe UI",fontSize:"10px",fontWeight:"400",titleFontSize:"14px",subTitleFontSize:"12px",legendFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Segoe UI",titleFontWeight:"600",zoomSelectionColor:"#FFFFFF",shapeFill:"#333333",shapeBorderColor:"#000000",rectangleZoomFillColor:"#0E4775",rectangleZoomFillOpacity:.25,rectangleZoomBorderColor:"#0E4775",legendBorderColor:"#000000",legendBorderWidth:0,tooltipBorderColor:"transparent",zoomButtonRadius:32};break;case"fluent2highcontrast":t={backgroundColor:"transparent",areaBackgroundColor:"transparent",titleFontColor:"#FFFFFF",subTitleFontColor:"#FFFFFF",legendTitleFontColor:"#FFFFFF",legendTextColor:"#FFFFFF",dataLabelFontColor:"#FFFFFF",tooltipFontColor:"#FFFFFF",tooltipFillColor:"#000000",zoomFillColor:"#3FF23F",fontFamily:"Segoe UI",fontSize:"10px",fontWeight:"400",titleFontSize:"14px",subTitleFontSize:"12px",legendFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Segoe UI",titleFontWeight:"600",zoomSelectionColor:"#FFFFFF",zoomBorderColor:"#FFFFFF",shapeFill:"#FFFFFF",shapeBorderColor:"#FFFFFF",rectangleZoomFillColor:"#1AEBFF",rectangleZoomFillOpacity:.25,rectangleZoomBorderColor:"#1AEBFF",legendBorderColor:"#FFFFFF",legendBorderWidth:1,tooltipBorderColor:"#FFF",zoomButtonRadius:32};break;default:t={backgroundColor:"#FFFFFF",areaBackgroundColor:"#FFFFFF",titleFontColor:"#424242",titleFontSize:"14px",subTitleFontColor:"#424242",legendTitleFontColor:"#757575",legendTextColor:"#757575",dataLabelFontColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFillColor:"#000000",zoomFillColor:"#737373",labelFontFamily:"Roboto, Noto, Sans-serif",fontFamily:"Roboto, Noto, Sans-serif",fontSize:"12px",legendFontSize:"12px",fontWeight:"Medium",titleFontWeight:"Medium",zoomSelectionColor:"#e61576",shapeFill:"#A6A6A6",shapeBorderColor:"#000000",rectangleZoomFillColor:"#d3d3d3",rectangleZoomFillOpacity:.5,rectangleZoomBorderColor:"#009900",legendBorderColor:"#000000",legendBorderWidth:0,tooltipBorderColor:"transparent",zoomButtonRadius:30}}return t}(this.theme),this.renderBorder(),this.renderTitle(this.titleSettings,"title",null,null),this.renderArea(),this.processRequestJsonData(),this.renderComplete(),this.isAddLayer=!!this.isTileMap&&this.isAddLayer)},f4t.prototype.render=function(){this.renderElements()},f4t.prototype.processRequestJsonData=function(){var n,o,r=this,s=this.layersCollection.length-1;this.serverProcess={request:0,response:0},Array.prototype.forEach.call(this.layersCollection,function(i,e){if(i.shapeData instanceof me?(r.serverProcess.request++,o=i.shapeData,n=i.query instanceof ya?i.query:new ya,o.executeQuery(n).then(function(e){r.processResponseJsonData("DataManager",e,i,"ShapeData")})):(i.shapeData instanceof hjt||i.shapeData)&&!je(i.shapeData.dataOptions)&&r.processAjaxRequest(i,i.shapeData,"ShapeData"),i.dataSource instanceof me&&(r.serverProcess.request++,o=i.dataSource,n=i.query instanceof ya?i.query:new ya,o.executeQuery(n).then(function(e){i.dataSource=gjt(e)})),0<i.markerSettings.length)for(var t=0;t<i.markerSettings.length;t++)!function(t){i.markerSettings[t].dataSource instanceof me&&(r.serverProcess.request++,o=i.markerSettings[t].dataSource,n=i.markerSettings[t].query instanceof ya?i.markerSettings[t].query:new ya,o.executeQuery(n).then(function(e){i.markerSettings[t].dataSource=gjt(e)}))}(t);if(0<i.bubbleSettings.length)for(t=0;t<i.bubbleSettings.length;t++)!function(t){i.bubbleSettings[t].dataSource instanceof me&&(r.serverProcess.request++,o=i.bubbleSettings[t].dataSource,n=i.bubbleSettings[t].query instanceof ya?i.bubbleSettings[t].query:new ya,o.executeQuery(n).then(function(e){i.bubbleSettings[t].dataSource=gjt(e)}))}(t);(i.dataSource instanceof hjt||!je(i.dataSource)&&!je(i.dataSource.dataOptions))&&r.processAjaxRequest(i,i.dataSource,"DataSource"),r.serverProcess.request===r.serverProcess.response&&s===e&&r.processResponseJsonData(null)})},f4t.prototype.processAjaxRequest=function(n,e,o){var r=this,t=(this.serverProcess.request++,new Qe(e.dataOptions,e.type,e.contentType));t.onSuccess=function(e){var t,i;je(e.type)||"application/octet-stream"!==e.type?r.processResponseJsonData("Fetch",e,n,o):(t=new FileReader,i=r,t.onload=function(){e=JSON.parse(t.result.toString()),i.processResponseJsonData("Fetch",e,n,o)},t.readAsText(e))},t.send(e.sendData)},f4t.prototype.processResponseJsonData=function(e,t,i,n){if(this.serverProcess.response++,e&&("ShapeData"===n?i.shapeData="DataManager"===e?gjt(t):t:i.dataSource="DataManager"===e?gjt(t):t),je(e)||this.serverProcess.request!==this.serverProcess.response)je(e)&&this.renderMap();else{var o=this.layersCollection;this.layersCollection=[];for(var r=0;r<o.length;r++)o[r].isBaseLayer&&this.layersCollection.push(o[r]);for(var s=0;s<o.length;s++)o[s].isBaseLayer||this.layersCollection.push(o[s]);this.renderMap()}},f4t.prototype.renderMap=function(){this.legendModule&&this.legendSettings.visible&&this.legendModule.renderLegend(),this.createTile(),this.zoomSettings.enable&&this.zoomModule&&this.zoomModule.createZoomingToolbars(),je(this.dataLabelModule)||(this.dataLabelModule.dataLabelCollections=[]),this.mapLayerPanel.measureLayerPanel(),je(this.svgObject)||this.element.appendChild(this.svgObject),this.setSecondaryElementPosition();for(var e,t,i,n,o,r,s=0;s<this.layers.length;s++){if(this.layers[s].selectionSettings&&this.layers[s].selectionSettings.enable&&0<this.layers[s].initialShapeSelection.length&&this.checkInitialRender){for(var a=this.layers[s].selectionSettings.enableMultiSelect,l=(this.layers[s].selectionSettings.enableMultiSelect=a||!0,this.layers[s].initialShapeSelection),h=0;h<this.layers[s].initialShapeSelection.length;h++)this.shapeSelection(s,l[h].shapePath,l[h].shapeValue,!0);this.layers[s].selectionSettings.enableMultiSelect=a,s===this.layers.length-1&&(this.checkInitialRender=!1)}if(!this.isResize)for(var d=0;d<this.layers[s].markerSettings.length;d++)if(this.layers[s].markerSettings[d].selectionSettings&&this.layers[s].markerSettings[d].selectionSettings.enable&&0<this.layers[s].markerSettings[d].initialMarkerSelection.length)for(var p=this.layers[s].markerSettings[d].initialMarkerSelection,h=0;h<p.length;h++)this.markerInitialSelection(s,d,this.layers[s].markerSettings[d],p[h].latitude,p[h].longitude)}je(document.getElementById(this.element.id+"_tile_parent"))||(o=this.svgObject.getBoundingClientRect(),e=document.getElementById(this.element.id),t=document.getElementById(this.element.id+"_tile_parent"),i=document.getElementById(this.element.id+"_tiles"),r=t.getBoundingClientRect(),n=void 0,n=parseFloat(t.style.left),o=o.bottom-r.bottom-e.offsetTop,r=parseFloat(t.style.top),r=o<=11?r:je(this.legendModule)||"Bottom"!==this.legendSettings.position?2*r:this.mapAreaRect.y,n=!(o<=11)&&je(this.legendModule)?2*n:n,t.style.top=r+"px",t.style.left=n+"px",i.style.top=r+"px",i.style.left=n+"px",!je(this.legendModule)&&0<this.legendModule.totalPages.length&&(t.style.height=i.style.height=this.legendModule.legendTotalRect.height+"px",t.style.width=i.style.width=this.legendModule.legendTotalRect.width+"px")),this.arrangeTemplate(),this.annotationsModule&&"0px"!==this.width&&"0px"!==this.height&&"0%"!==this.width&&"0%"!==this.height&&this.annotationsModule.renderAnnotationElements(),this.element.style.outline="none",this.element.style.position="relative";for(s=0;s<document.getElementsByTagName("path").length-1;s++)-1<document.getElementsByTagName("path")[s].id.indexOf("shapeIndex")&&(document.getElementsByTagName("path")[s].style.outline="none");this.zoomingChange(),this.zoomModule&&this.isDevice&&this.zoomModule.removeToolbarOpacity(this.isTileMap?Math.round(this.tileZoomLevel):this.mapScaleValue,this.element.id+"_Zooming_"),this.isZoomByPosition||this.zoomNotApplied||this.triggerZoomEvent(),this.isResize=!1},f4t.prototype.triggerZoomEvent=function(){var e=this.getMinMaxLatitudeLongitude(),e={maps:this,isResized:this.isResize,minLatitude:e.minLatitude,maxLatitude:e.maxLatitude,minLongitude:e.minLongitude,maxLongitude:e.maxLongitude,cancel:!1,name:"Loaded"};this.trigger("loaded",e)},f4t.prototype.markerSelection=function(e,t,i,n){var o={color:e.border.color,width:e.border.width/t.scale,opacity:e.border.opacity},o={opacity:e.opacity,fill:e.fill,border:o,target:i.id,cancel:!1,data:n,maps:t};Lzt("MarkerselectionMap")?zzt("MarkerselectionMap","MarkerselectionMapStyle",o):document.body.appendChild(Hzt("MarkerselectionMap","MarkerselectionMapStyle",o)),0!==this.selectedMarkerElementId.length&&!e.enableMultiSelect||("g"===i.tagName?(i.children[0].setAttribute("class","MarkerselectionMapStyle"),this.selectedMarkerElementId.push(i.children[0].id)):(i.setAttribute("class","MarkerselectionMapStyle"),this.selectedMarkerElementId.push(i.id)))},f4t.prototype.markerInitialSelection=function(e,t,i,n,o){var r=i.selectionSettings;if(r.enable)for(var s=0;s<i.dataSource.length;s++){var a,l=i.dataSource[s];l.latitude===n&&l.longitude===o&&(a=this.element.id+"_LayerIndex_"+e+"_MarkerIndex_"+t+"_dataIndex_"+s,this.markerSelection(r,this,Lzt(a),l))}},f4t.prototype.renderArea=function(){var e=this.mapsArea.border.width,t=this.mapsArea.background;(0<e||t||this.themeStyle.areaBackgroundColor)&&(e={opacity:je(this.mapsArea.border.opacity)?1:this.mapsArea.border.opacity,color:this.mapsArea.border.color,width:this.mapsArea.border.width},t=new MHt(this.element.id+"_MapAreaBorder",t||this.themeStyle.areaBackgroundColor,e,1,this.mapAreaRect),this.svgObject.appendChild(this.renderer.drawRectangle(t)))},f4t.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"Maps Element"),this.element.setAttribute("role","region"),this.element.tabIndex=this.tabIndex},f4t.prototype.setSecondaryElementPosition=function(){var e=kzt(this.element.id+"_Secondary_Element"),t=this.element.getBoundingClientRect(),i=kzt(this.element.id+"_svg");je(i)||(i=i.getBoundingClientRect(),e.style.left=Math.max(i.left-t.left,0)+"px",e.style.top=Math.max(i.top-t.top,0)+"px")},f4t.prototype.zoomingChange=function(){if(kzt(this.element.id+"_Layer_Collections")&&this.zoomModule&&(this.zoomModule.layerCollectionEle=kzt(this.element.id+"_Layer_Collections")),this.isTileMap&&kzt(this.element.id+"_Tile_SVG")&&kzt(this.element.id+"_tile_parent")){var e=kzt(this.element.id+"_tile_parent"),t=kzt(this.element.id+"_Tile_SVG"),i=kzt(this.element.id+"_Tile_SVG_Parent"),n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.left-o.left,s=n.top-o.top,a=(i.style.left=r+"px",i.style.top=s+"px",!je(this.legendModule)&&0<this.legendModule.totalPages.length&&(e.style.width=t.style.width=this.legendModule.legendTotalRect.width.toString(),e.style.height=t.style.height=this.legendModule.legendTotalRect.height.toString(),i.style.width=this.legendModule.legendTotalRect.width+"px",i.style.height=this.legendModule.legendTotalRect.height+"px"),document.getElementsByClassName("template"));if(!je(a)&&0<a.length)for(var l=0;l<a.length;l++){var h=a[l];h.style.left=r+"px",h.style.top=s+"px"}}if(0<=this.zoomSettings.zoomFactor){this.zoomModule&&this.zoomModule.toolBarGroup&&this.zoomSettings.enable&&this.zoomModule.alignToolBar();var d=document.getElementById(this.element.id+"_Layer_Collections");if(!je(d)&&0<d.childElementCount)for(l=0;l<d.childNodes.length;l++){var p=d.childNodes[l];if("g"===p.tagName&&-1===p.id.indexOf("_Legend_Group"))for(var c=parseFloat(p.id.split("_LayerIndex_")[1].split("_")[0]),u=0;u<p.childNodes.length;u++){var g=p.childNodes[u];-1<g.id.indexOf("_Markers_Group")||-1<g.id.indexOf("_bubble_Group")||-1<g.id.indexOf("_dataLableIndex_Group")||$zt(g,c,this.scale,this)}}this.zoomModule&&(this.previousScale!==this.scale||this.zoomNotApplied||this.isZoomByPosition)&&this.zoomModule.applyTransform(this,!1,!0)}},f4t.prototype.createSecondaryElement=function(){var e;je(document.getElementById(this.element.id+"_Secondary_Element"))&&((e=Q("div",{id:this.element.id+"_Secondary_Element"})).style.cssText="position: relative;z-index:2;",this.element.appendChild(e))},f4t.prototype.getMinMaxLatitudeLongitude=function(){var e,t=document.getElementById(this.element.id);return je(t)?{minLatitude:0,maxLatitude:0,minLongitude:0,maxLongitude:0}:(t=t.getBoundingClientRect(),e=Pzt(this.margin.left),e=this.isTileMap?this.pointToLatLong(this.mapAreaRect.x-e,-this.mapAreaRect.y):this.getGeoLocation(0,this.mapAreaRect.x+t.left,this.mapAreaRect.y),t=this.isTileMap?this.pointToLatLong(this.mapAreaRect.width,this.mapAreaRect.height-this.mapAreaRect.y):this.getGeoLocation(0,this.mapAreaRect.x+t.left+this.mapAreaRect.width,this.mapAreaRect.y+this.mapAreaRect.height),{minLatitude:e.latitude,maxLatitude:t.latitude,minLongitude:e.longitude,maxLongitude:t.longitude})},f4t.prototype.arrangeTemplate=function(){var r=this,e=(document.getElementById(this.element.id+"_Legend_Border")&&(document.getElementById(this.element.id+"_Legend_Border").style.pointerEvents="none"),document.getElementsByClassName(this.element.id+"_template"));!je(e)&&0<e.length&&kzt(this.element.id+"_Layer_Collections")&&!this.isTileMap&&Array.prototype.forEach.call(e,function(e){var t,i,n=0,o=0;!je(e)&&0<e.childElementCount&&(t=kzt(r.element.id+"_Layer_Collections").getBoundingClientRect(),i=kzt(e.id).getBoundingClientRect(),-1===e.id.indexOf("Marker")&&(n=r.isTileMap?0:t.left<i.left?-Math.abs(i.left-t.left):Math.abs(i.left-t.left),o=r.isTileMap?0:t.top<i.top?-Math.abs(i.top-t.top):Math.abs(i.top-t.top)),Array.prototype.forEach.call(e.childNodes,function(e){-1===e.id.indexOf("Marker")&&(e.style.left=parseFloat(e.style.left)+n+"px",e.style.top=parseFloat(e.style.top)+o+"px",e.style.transform="translate(-50%, -50%)")}))})},f4t.prototype.createTile=function(){var e,t,i=this.layersCollection[0];i.isBaseLayer&&!je(i.urlTemplate)&&""!==i.urlTemplate&&je(i.shapeData)&&(Izt(this.element.id+"_tile_parent"),Izt(this.element.id+"_tiles"),Izt("animated_tiles"),i=Q("div",{id:this.element.id+"_tile_parent"}),e=Pzt(this.margin.right),i.style.cssText="position: absolute; left: "+this.mapAreaRect.x+"px; right: "+e+"px; top: "+(this.mapAreaRect.y+0)+"px; height: "+this.mapAreaRect.height+"px; width: "+this.mapAreaRect.width+"px; overflow: hidden;",(t=Q("div",{id:this.element.id+"_tiles"})).style.cssText="position: absolute; left: "+this.mapAreaRect.x+"px;  right: "+e+"px; top: "+(this.mapAreaRect.y+0)+"px; height: "+this.mapAreaRect.height+"px; width: "+this.mapAreaRect.width+"px; overflow: hidden;",this.element.appendChild(i),this.element.appendChild(t))},f4t.prototype.initPrivateVariable=function(){var e;""===this.element.id&&(e=document.getElementsByClassName("e-maps").length,this.element.id="maps_control_"+e),this.renderer=new fo(this.element.id),this.mapLayerPanel=new d4t(this)},f4t.prototype.findBaseAndSubLayers=function(){var t=this,e=this.baseLayerIndex,i=[],n=[];this.layersCollection=[],Array.prototype.forEach.call(this.layers,function(e){("Layer"===e.type?i:n).push(e)});for(var o=0;o<i.length;o++){var r=i[o];if(r.visible&&e===o){r.isBaseLayer=!0,this.isTileMap=!!je(r.shapeData),this.layersCollection.push(r);break}if(o===i.length-1){this.layersCollection.push(i[0]);break}}n.map(function(e){e.visible&&t.layersCollection.push(e)})},f4t.prototype.renderBorder=function(){var e,t=this.border.width,i=this.svgObject.querySelector("#"+this.element.id+"_MapBorder");(0<t||this.background||this.themeStyle.backgroundColor)&&je(i)?(e={opacity:je(this.border.opacity)?1:this.border.opacity,color:this.border.color,width:this.border.width},e=new MHt(this.element.id+"_MapBorder",this.background||this.themeStyle.backgroundColor,e,1,new WHt(t/2,t/2,this.availableSize.width-t,this.availableSize.height-t)),this.svgObject.appendChild(this.renderer.drawRectangle(e))):i.setAttribute("fill",this.background||this.themeStyle.backgroundColor)},f4t.prototype.renderTitle=function(e,t,i,n){var o,r,s,a={size:e.textStyle.size,color:e.textStyle.color,fontFamily:e.textStyle.fontFamily,fontWeight:e.textStyle.fontWeight,fontStyle:e.textStyle.fontStyle,opacity:e.textStyle.opacity},l=Pzt(this.margin.top),h=Pzt(this.margin.bottom),d=Pzt(this.margin.left),p=Pzt(this.margin.right),p=Math.abs(d+p-this.availableSize.width);a.fontFamily=(je(a.fontFamily)?this.themeStyle:a).fontFamily,a.fontWeight=a.fontWeight||this.themeStyle.titleFontWeight,a.size="title"===t?a.size||this.themeStyle.titleFontSize:a.size||this.themeStyle.subTitleFontSize||djt.mapsSubTitleFont.size,e.text?(je(n)&&(n=this.renderer.createGroup({id:this.element.id+"_Title_Group"})),s=AHt(r=Azt(p,e.text,a),a),i=xzt(je(i)?new WHt(d,l,this.availableSize.width,this.availableSize.height):i,je(e.alignment)?"Center":e.alignment,s,t),r=new THt(this.element.id+"_Map_"+t,i.x,i.y,"start",r),i=new WHt(i.x,i.y,s.width,s.height),(s=QHt(r,a,a.color||("title"===t?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),n)).setAttribute("aria-label",e.text),s.setAttribute("role","region"),("title"!==t||e.subtitleSettings.text)&&"subtitle"!==t||(o=Math.abs(i.y+h-this.availableSize.height),this.mapAreaRect=new WHt(d,i.y+10,p,o-10)),"subtitle"!==t&&e.subtitleSettings.text?this.renderTitle(e.subtitleSettings,"subtitle",i,n):this.svgObject.appendChild(n)):(o=Math.abs(l+h-this.availableSize.height),this.mapAreaRect=new WHt(d,l,p,o))},f4t.prototype.createSVG=function(){this.removeSvg(),nHt(this)},f4t.prototype.removeSvg=function(){if(Izt(this.element.id+"_Secondary_Element"),Izt(this.element.id+"_tile_parent"),Izt(this.element.id+"_tiles"),this.svgObject){for(;0<this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&ue(this.svgObject)}this.clearTemplate()},f4t.prototype.wireEVents=function(){E.add(this.element,"click",this.mapsOnClick,this),E.add(this.element,"contextmenu",this.mapsOnRightClick,this),E.add(this.element,"dblclick",this.mapsOnDoubleClick,this),E.add(this.element,F.touchStartEvent,this.mouseDownOnMap,this),E.add(this.element,F.touchMoveEvent,this.mouseMoveOnMap,this),E.add(this.element,F.touchEndEvent,this.mouseEndOnMap,this),E.add(this.element,"pointerleave mouseleave",this.mouseLeaveOnMap,this),E.add(this.element,"keydown",this.keyDownHandler,this),E.add(this.element,"keyup",this.keyUpHandler,this),this.resizeEvent=this.mapsOnResize.bind(this),window.addEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeEvent)},f4t.prototype.unWireEVents=function(){E.remove(this.element,"click",this.mapsOnClick),E.remove(this.element,"contextmenu",this.mapsOnRightClick),E.remove(this.element,"dblclick",this.mapsOnDoubleClick),E.remove(this.element,F.touchStartEvent,this.mouseDownOnMap),E.remove(this.element,F.touchMoveEvent,this.mouseMoveOnMap),E.remove(this.element,F.touchEndEvent,this.mouseEndOnMap),E.remove(this.element,"pointerleave mouseleave",this.mouseLeaveOnMap),E.remove(this.element,"keydown",this.keyDownHandler),E.remove(this.element,"keyup",this.keyUpHandler),window.removeEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeEvent)},f4t.prototype.mouseLeaveOnMap=function(e){0<document.getElementsByClassName("highlightMapStyle").length&&this.legendModule&&(this.legendModule.removeShapeHighlightCollection(),Wzt(document.getElementsByClassName("highlightMapStyle")[0]))},f4t.prototype.keyUpHandler=function(e){var t=e.target.id;this.isTileMap&&this.removeTileMap(),"Tab"===e.code&&-1<t.indexOf("_LayerIndex_")&&-1<t.indexOf("shapeIndex")?this.keyboardHighlightSelection(t,e):-1===t.indexOf("_LayerIndex_")&&-1===t.indexOf("shapeIndex")&&0<Nzt("highlightMapStyle").length&&(Wzt(Nzt("highlightMapStyle")[0]),this.legendSettings.visible)&&this.legendModule&&this.legendModule.removeShapeHighlightCollection()},f4t.prototype.keyboardHighlightSelection=function(e,t){var i=t.type,n=parseInt(e.split("_LayerIndex_")[1].split("_")[0],10),o=parseInt(e.split("_shapeIndex_")[1].split("_")[0],10),o=this.layers[n].shapeData.features.length>o?this.layers[n].shapeData.features[o].properties:null,e=parseInt(e.split("_dataIndex_")[1].split("_")[0],10),e=je(e)?null:this.layers[n].dataSource[e];this.layers[n].selectionSettings.enable&&"keydown"===i&&this.selectionModule?(this.selectionModule.selectionsettings=this.layers[n].selectionSettings,this.selectionModule.selectionType="Shape",this.selectionModule.selectElement(t.target,n,e,o)):this.highlightModule&&this.layers[n].highlightSettings.enable&&"keyup"===i&&!t.target.classList.contains("ShapeselectionMapStyle")&&(this.highlightModule.highlightSettings=this.layers[n].highlightSettings,this.highlightModule.handleHighlight(t.target,n,e,o))},f4t.prototype.keyDownHandler=function(e){var t,i=this.zoomModule,n=e.target.id;"ArrowUp"!==e.code&&"ArrowDown"!==e.code&&"ArrowLeft"!==e.code&&"ArrowRight"!==e.code||!i||(t=document.getElementById(this.element.id+"_animated_tiles"),this.isTileMap&&!je(t)&&(this.currentTiles=t.cloneNode(!0))),this.zoomSettings.enable&&i&&("+"===e.key||"Equal"===e.code)?i.performZoomingByToolBar("zoomin"):this.zoomSettings.enable&&i&&("-"===e.key||"Minus"===e.code)?i.performZoomingByToolBar("zoomout"):this.zoomSettings.enable&&i&&82===e.keyCode?(i.performZoomingByToolBar("reset"),i.isPanModeEnabled=!1):this.zoomSettings.enable&&this.zoomSettings.enablePanning&&i&&("ArrowUp"===e.code||"ArrowDown"===e.code)?(e.preventDefault(),i.mouseDownLatLong.x=0,i.mouseMoveLatLong.y=this.mapAreaRect.height/7,i.panning("None",i.mouseDownLatLong.x,"ArrowUp"===e.code?-i.mouseMoveLatLong.y:i.mouseMoveLatLong.y,e),i.mouseDownLatLong.y=i.mouseMoveLatLong.y):this.zoomSettings.enable&&this.zoomSettings.enablePanning&&i&&("ArrowLeft"===e.code||"ArrowRight"===e.code)?(e.preventDefault(),i.mouseDownLatLong.y=0,i.mouseMoveLatLong.x=this.mapAreaRect.width/7,i.panning("None","ArrowLeft"===e.code?-i.mouseMoveLatLong.x:i.mouseMoveLatLong.x,i.mouseDownLatLong.y,e),i.mouseDownLatLong.x=i.mouseMoveLatLong.x):"Enter"===e.code&&(n=e.target.id,e.preventDefault(),this.legendModule&&(-1<n.indexOf("_Left_Page_Rect")||-1<n.indexOf("_Right_Page_Rect"))&&(this.mapAreaRect=this.legendModule.initialMapAreaRect,this.legendModule.currentPage=-1<n.indexOf("_Left_Page_")?this.legendModule.currentPage-1:this.legendModule.currentPage+1,this.legendModule.legendGroup=this.renderer.createGroup({id:this.element.id+"_Legend_Group"}),this.legendModule.drawLegendItem(this.legendModule.currentPage),t=document.getElementById(this.element.id+"_Paging_Text").textContent.split("/").map(Number),-1<n.indexOf("_Left_Page_Rect")?(1!==t[0]&&e.target.focus(),e.target.style.outlineColor=t[0]-1!==t[1]?"":"transparent"):-1<n.indexOf("_Right_Page_Rect")&&(t[0]!==t[1]&&e.target.focus(),e.target.style.outlineColor=t[0]!==t[1]+1?"":"transparent"),Vzt(this.element.id+"_Legend_Border",this.element.id))&&(Vzt(this.element.id+"_Legend_Border",this.element.id).style.pointerEvents="none"),-1<n.indexOf("shapeIndex"))&&this.keyboardHighlightSelection(n,e),this.zoomModule&&this.zoomModule.removeToolbarOpacity(this.isTileMap?Math.round(this.tileZoomLevel):this.mapScaleValue,this.mouseMoveId)},f4t.prototype.SelectedElement=function(e){var t=!1;return t="ShapeselectionMapStyle"===e.getAttribute("class")?!0:t},f4t.prototype.mapsOnClick=function(t){var e,i,n=this,o=t.target,r=o.id,s=null,a=null;this.mouseClickEvent={x:t.x,y:t.y},-1===o.id.indexOf("_ToolBar")&&(je(e=this.getClickLocation(r,t.pageX,t.pageY,o,t.layerX,t.layerY))||(s=e.latitude,a=e.longitude),i={cancel:!1,name:L3t,target:r,x:t.clientX,y:t.clientY,latitude:s,longitude:a,isShapeSelected:this.SelectedElement(o)},this.onclick?this.trigger(i.name="onclick",i,function(e){n.clickHandler(t,i,o)}):this.trigger("click",i,function(e){n.clickHandler(t,i,o)})),this.zoomModule&&(this.zoomModule.removeToolbarOpacity(this.isTileMap?Math.round(this.tileZoomLevel):this.mapScaleValue,r),this.isDevice)&&this.zoomModule.removeToolbarClass("","","","","")},f4t.prototype.clickHandler=function(e,t,i){-1<i.id.indexOf("shapeIndex")&&(this.mergeCluster(),Lzt(this.element.id+"_mapsTooltip"))&&-1<this.mapsTooltipModule.tooltipTargetID.indexOf("_MarkerIndex_")&&Izt(this.element.id+"_mapsTooltip"),this.markerModule&&this.markerModule.markerClusterClick(e),t.cancel||this.notify(L3t,i),t.cancel||-1===i.id.indexOf("shapeIndex")||this.triggerShapeSelection(i)},f4t.prototype.triggerShapeSelection=function(e){var t=parseInt(e.id.split("_LayerIndex_")[1].split("_")[0],10),t=Ozt(e.id,this.layers[t].selectionSettings,this,_3t);t.cancel||!this.selectionModule||je(this.shapeSelected)?t.cancel&&this.selectionModule&&je(t.data)&&(Wzt(e),this.selectionModule.removedSelectionList(e)):zzt(this.selectionModule.selectionType+"selectionMap",this.selectionModule.selectionType+"selectionMapStyle",t)},f4t.prototype.getMarkerClickLocation=function(e,t,i,n,o,r){document.getElementById(this.element.id+"_svg").style.cursor="grabbing";var s=Lzt(o.targetId),a=this.getClickLocation(o.targetId,e,t,s,i,n),l=this.isTileMap?hHt(new jHt(a.longitude,a.latitude),this.tileZoomLevel,this.tileTranslatePoint,!0):aHt(a.latitude,a.longitude,this.mapLayerPanel.currentFactor,this.layersCollection[o.layerIndex],this),h=this.translatePoint,d=this.isTileMap?l.x:(l.x+h.x)*this.scale,l=this.isTileMap?l.y:(l.y+h.y)*this.scale;return("Balloon"!==this.markerDragArgument.shape?s:s.parentElement).setAttribute("transform","translate( "+d+" "+l+" )"),r&&(h=this.layers[o.layerIndex].markerSettings[o.markerIndex],a=this.getClickLocation(o.targetId,e-h.offset.x,t-h.offset.y,s,i-h.offset.x,n-h.offset.y)),a},f4t.prototype.getClickLocation=function(e,t,i,n,o,r,s){var a,l,h,d=0;return-1===e.indexOf("_LayerIndex_")||this.isTileMap||je(s)&&(parseInt(this.mouseDownEvent.x,10)!==parseInt(this.mouseClickEvent.x,10)||parseInt(this.mouseDownEvent.y,10)!==parseInt(this.mouseClickEvent.y,10))?this.isTileMap&&(!je(s)||parseInt(this.mouseDownEvent.x,10)===parseInt(this.mouseClickEvent.x,10)&&parseInt(this.mouseDownEvent.y,10)===parseInt(this.mouseClickEvent.y,10))&&(a=this.getTileGeoLocation(o,r)):(d=parseFloat(e.split("_LayerIndex_")[1].split("_")[0]),"Normal"===this.layers[d].geometryType?-1<e.indexOf("_shapeIndex_")?(o=oHt(t,i,-1<(s=n.parentElement).id.indexOf("_Point_Group")||-1<s.id.indexOf("_LineString_Group")||-1<s.id.indexOf("_MultiLineString_Group")||-1<s.id.indexOf("_Polygon_Group")?s.parentElement:s),r=this.mapLayerPanel.currentFactor*this.mapScaleValue,l=Math.abs(-this.baseMapBounds.longitude.min*r),h=Math.abs(this.baseMapBounds.latitude.max*r),a={latitude:Math.abs(this.baseMapBounds.latitude.max-o.y/r),longitude:Math.abs(o.x/r+this.baseMapBounds.longitude.min)},this.baseMapBounds.longitude.min<0&&l>o.x&&(a.longitude=-a.longitude),this.baseMapBounds.latitude.min<0&&h>o.y&&(a.latitude=-a.latitude)):-1<e.indexOf("_MarkerIndex_")&&this.markerModule&&!this.markerDragArgument?(n=parseInt(e.split("_MarkerIndex_")[1].split("_")[0],10),s=parseInt(e.split("_dataIndex_")[1].split("_")[0],10),a=isNaN(n)||isNaN(s)?{latitude:null,longitude:null}:{latitude:(r=this.layers[d].markerSettings[n].dataSource[s]).latitude,longitude:r.longitude}):-1<e.indexOf("_MarkerIndex_")&&this.markerModule&&this.markerDragArgument?(o=document.getElementById(this.element.id+"_LayerIndex_"+this.markerDragArgument.layerIndex).getBoundingClientRect(),n=new jHt(t>o.left?Math.abs(o.left-t):0,i>o.top?Math.abs(o.top-i):0),l=Math.abs(-this.baseMapBounds.longitude.min*this.mapLayerPanel.currentFactor),h=Math.abs(this.baseMapBounds.latitude.max*this.mapLayerPanel.currentFactor),a={latitude:Math.abs(this.baseMapBounds.latitude.max-n.y/(this.mapLayerPanel.currentFactor*this.scale)),longitude:Math.abs(n.x/(this.mapLayerPanel.currentFactor*this.scale)+this.baseMapBounds.longitude.min)},this.baseMapBounds.longitude.min<0&&l>n.x&&(a.longitude=-a.longitude),this.baseMapBounds.latitude.min<0&&h>n.y&&(a.latitude=-a.latitude)):a={latitude:null,longitude:null}:a=this.getGeoLocation(d,t,i)),a},f4t.prototype.removeTileMap=function(){var e=document.getElementById(this.element.id+"_animated_tiles");if(!je(this.currentTiles)&&e.childElementCount<this.currentTiles.childElementCount)for(var t=e.childElementCount-1;t>=this.currentTiles.childElementCount;t--)e.removeChild(e.children[t]);this.currentTiles=null},f4t.prototype.mouseEndOnMap=function(e){var t,i,n=0,o=0;return-1!==e.type.indexOf("touch")?(this.isTouch=!0,n=t=e.changedTouches[0].pageX,o=(i=e.changedTouches[0].pageY)-(this.isTileMap?10:0),this.mouseClickEvent={x:t,y:i}):(this.isTouch="touch"===e.pointerType,t=e.pageX,i=e.pageY,n=e.layerX,o=e.layerY-(this.isTileMap?10:0)),this.isTileMap&&this.removeTileMap(),this.isTouch&&(this.titleTooltip(e,t,i,!0),je(this.legendModule)||this.legendTooltip(e,e.pageX,e.pageY,!0)),this.notify(F.touchEndEvent,e),e.cancelable&&!this.isTouch&&e.preventDefault(),je(this.markerDragArgument)?document.getElementById(this.element.id+"_svg").style.cursor="auto":(e=this.markerDragArgument,this.mouseClickEvent.x=this.mouseDownEvent.x,this.mouseClickEvent.y=this.mouseDownEvent.y,n=this.getMarkerClickLocation(t,i,n,o,this.markerDragArgument,!0),o=this.layers[e.layerIndex].markerSettings[e.markerIndex],document.getElementById(this.element.id+"_svg").style.cursor=o.enableDrag?"pointer":"grabbing",t={name:"markerDragEnd",x:t,y:i,latitude:n.latitude,longitude:n.longitude,layerIndex:e.layerIndex,markerIndex:e.markerIndex,dataIndex:e.dataIndex},je(o.latitudeValuePath)&&je(o.longitudeValuePath)?je((i=o.dataSource[e.dataIndex]).Longitude)||je(i.Latitude)?(o.dataSource[e.dataIndex].latitude=t.latitude,o.dataSource[e.dataIndex].longitude=t.longitude):(o.dataSource[e.dataIndex].Latitude=t.latitude,o.dataSource[e.dataIndex].Longitude=t.longitude):(o.dataSource[e.dataIndex][o.latitudeValuePath]=t.latitude,o.dataSource[e.dataIndex][o.longitudeValuePath]=t.longitude),this.markerDragId="",this.markerDragArgument=null,this.trigger("markerDragEnd",t)),this.zoomModule&&this.isDevice&&(this.zoomModule.removeToolbarOpacity(this.isTileMap?Math.round(this.tileZoomLevel):this.scale,this.element.id+"_Zooming_"),this.zoomModule.removeToolbarClass("","","","","")),!1},f4t.prototype.mouseDownOnMap=function(e){this.mouseDownEvent={x:e.x,y:e.y},-1!==e.type.indexOf("touch")&&e.changedTouches&&(this.mouseDownEvent={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}),this.isDevice&&!je(this.mapsTooltipModule)&&this.mapsTooltipModule.renderTooltip(e);var t=e.target,i=(this.markerDragId=t.id,document.getElementById(this.element.id+"_animated_tiles"));this.isTileMap&&!je(i)&&(this.currentTiles=i.cloneNode(!0)),-1===t.id.indexOf("_ToolBar")&&(i=this.markerModule,(-1<t.id.indexOf("shapeIndex")||-1<t.id.indexOf("Tile"))&&this.mergeCluster(),i&&(i.markerClick(e),i.markerClusterClick(e)),this.bubbleModule)&&this.bubbleModule.bubbleClick(e),this.notify(F.touchStartEvent,e)},f4t.prototype.mergeCluster=function(){this.markerModule&&0<this.markerModule.sameMarkerData.length&&(!this.zoomModule||this.zoomModule.isSingleClick)&&(rzt(this.markerModule.sameMarkerData,this),this.markerModule.sameMarkerData=[])},f4t.prototype.mapsOnRightClick=function(e){var t=e.target,i=t.id,n=null,o=null;this.mouseClickEvent=this.mouseDownEvent={x:e.x,y:e.y},-1===t.id.indexOf("_ToolBar")&&(je(t=this.getClickLocation(i,e.pageX,e.pageY,t,e.layerX,e.layerY))||(n=t.latitude,o=t.longitude),t={cancel:!1,name:R3t,target:i,x:e.clientX,y:e.clientY,latitude:n,longitude:o,isShapeSelected:!1},this.trigger("rightClick",t))},f4t.prototype.mapsOnDoubleClick=function(e){this.notify("dblclick",e);var t,i=e.target,n=i.id,o=null,r=null;-1===i.id.indexOf("_ToolBar")&&(-1===i.id.indexOf("_LayerIndex_")||this.isTileMap||this.mouseDownEvent.x!==e.clientX||this.mouseDownEvent.y!==e.clientY?this.isTileMap&&this.mouseDownEvent.x===e.clientX&&this.mouseDownEvent.y===e.clientY&&(o=(t=this.getTileGeoLocation(e.layerX,e.layerY)).latitude,r=t.longitude):(i=parseFloat(i.id.split("_LayerIndex_")[1].split("_")[0]),o=(t=this.getGeoLocation(i,e.layerX,e.layerY)).latitude,r=t.longitude),i={cancel:!1,name:O3t,x:e.clientX,y:e.clientY,target:n,latitude:o,longitude:r,isShapeSelected:null},this.trigger("doubleClick",i))},f4t.prototype.mouseMoveOnMap=function(e){var t;e.type,t=e.target,this.mouseMoveEvent(e),this.markerModule&&(this.markerModule.markerMove(e),this.markerModule.markerClusterMouseMove(e)),this.bubbleModule&&this.bubbleModule.bubbleMove(e),-1===t.id.indexOf("MarkerIndex")&&(document.getElementById(this.element.id+"_svg").style.cursor="auto"),this.onMouseMove(e),this.notify(F.touchMoveEvent,e)},f4t.prototype.mouseMoveEvent=function(e){var t=e.target.id;t=(t=this.isTileMap?this.getTileGeoLocation(e.layerX,e.layerY):(t=-1<t.indexOf("_LayerIndex_")?parseInt(t.split("_LayerIndex_")[1].split("_")[0],10):this.baseLayerIndex,this.getGeoLocation(t,e.clientX,e.clientY)),{x:e.clientX,y:e.clientY,latitude:t.latitude,longitude:t.longitude,target:e.target}),this.trigger("mouseMove",t)},f4t.prototype.onMouseMove=function(e){var t,i,n,o=e.target,o=(this.mouseMoveId=o.id,0),r=0;return-1===e.type.indexOf("touch")?(t=e.pageX,i=e.pageY,o=e.layerX,r=e.layerY-(this.isTileMap?10:0),this.titleTooltip(e,e.pageX,e.pageY),je(this.legendModule)||this.legendTooltip(e,e.pageX,e.pageY,!0)):(o=t=(n=e.touches)[0].clientX,r=i=n[0].clientY-(this.isTileMap?10:0)),je(this.markerDragArgument)||(n=this.markerDragArgument,this.mouseClickEvent.x=this.mouseDownEvent.x,this.mouseClickEvent.y=this.mouseDownEvent.y,this.getMarkerClickLocation(t,i,o,r,n,!1)),this.zoomModule&&this.zoomModule.removeToolbarOpacity(this.isTileMap?Math.round(this.tileZoomLevel):this.scale,e.target.id),!1},f4t.prototype.legendTooltip=function(e,t,i,n){for(var o,r,s=e.target.id,a=(this.legendModule.currentPage,e.target.id.split("_Index_")[1]),l=this.legendModule.totalPages.length<=this.legendModule.currentPage?this.legendModule.totalPages.length-1:this.legendModule.currentPage<0?0:this.legendModule.currentPage,h=(0!==this.legendModule.totalPages.length?this.legendModule.totalPages[l].Collection:this.legendModule.totalPages).length,d=0;d<h;d++)o=(r=this.legendModule.totalPages[l].Collection[d]).DisplayText,s=e.target.id,a=e.target.id.split("_Index_")[1],s===this.element.id+"_Legend_Text_Index_"+a&&-1<e.target.textContent.indexOf("...")&&r.idIndex===parseInt(a,10)&&qzt(o,this.legendSettings.textStyle.size,t,i,this.element.offsetWidth,this.element.offsetHeight,this.element.id+"_EJ2_Legend_Text_Tooltip",Lzt(this.element.id+"_Secondary_Element"),n);s!==this.element.id+"_Legend_Text_Index_"+a&&Izt(this.element.id+"_EJ2_Legend_Text_Tooltip")},f4t.prototype.titleTooltip=function(e,t,i,n){var o=e.target.id;o===this.element.id+"_LegendTitle"&&-1<e.target.textContent.indexOf("...")?qzt(this.legendSettings.title.text,this.legendSettings.titleStyle.size,t,i,this.element.offsetWidth,this.element.offsetHeight,this.element.id+"_EJ2_LegendTitle_Tooltip",Lzt(this.element.id+"_Secondary_Element"),n):Izt(this.element.id+"_EJ2_LegendTitle_Tooltip"),o===this.element.id+"_Map_title"&&-1<e.target.textContent.indexOf("...")?qzt(this.titleSettings.text,this.titleSettings.textStyle.size||this.themeStyle.titleFontSize,t,i,this.element.offsetWidth,this.element.offsetHeight,this.element.id+"_EJ2_Title_Tooltip",Lzt(this.element.id+"_Secondary_Element"),n):Izt(this.element.id+"_EJ2_Title_Tooltip")},f4t.prototype.mapsOnResize=function(e){var t,i=this;return this.isDestroyed||this.isExportInitialTileMap||(t={cancel:!(this.isResize=this.isReset=!0),name:N3t,previousSize:this.availableSize,currentSize:iHt(this),maps:this},this.trigger(N3t,t),t.cancel)||(this.resizeTo&&clearTimeout(this.resizeTo),!je(this.element)&&this.element.classList.contains("e-maps")&&(this.resizeTo=setTimeout(function(){i.unWireEVents(),i.createSVG(),i.refreshing=!0,i.wireEVents(),i.render(),i.refreshing=!1},500))),!1},f4t.prototype.zoomByPosition=function(e,t){var i;this.isDestroyed||(this.zoomNotApplied=this.isMarkerZoomCompleted=!1,i=this.zoomSettings.zoomFactor===t,this.previousProjection=null,!this.isTileMap&&this.zoomModule?(je(e)?this.zoomSettings.zoomFactor=t:(this.zoomSettings.zoomFactor=t,i=this.centerPosition.latitude===e.latitude&&this.centerPosition.longitude===e.longitude||i,this.centerPosition=e),this.isZoomByPosition=!0,this.mapScaleValue=null):this.zoomModule&&(this.tileZoomLevel=this.zoomSettings.zoomFactor=t,i=this.centerPosition.latitude===e.latitude&&this.centerPosition.longitude===e.longitude||i,this.centerPosition=e,this.isZoomByPosition=!0),i&&this.refresh())},f4t.prototype.panByDirection=function(e,t){if(!this.isDestroyed){var i=0,n=0;switch(e){case"Left":i=-this.mapAreaRect.width/7;break;case"Right":i=this.mapAreaRect.width/7;break;case"Top":n=-this.mapAreaRect.height/7;break;case"Bottom":n=this.mapAreaRect.height/7}this.zoomModule&&this.zoomModule.panning(e,i,n,t)}},f4t.prototype.addLayer=function(e){var t;this.isDestroyed||((t=this.layers).push(e),this.isAddLayer=!0,this.layers=t)},f4t.prototype.removeLayer=function(e){var t;this.isDestroyed||((t=this.layers).splice(e,1),this.layers=t)},f4t.prototype.addMarker=function(e,t){if(!this.isDestroyed&&!je(this.markerModule))if(je(e)||je(t)){for(var i=0;i<this.layers.length;i++){n=document.getElementById(this.element.id+"_LayerIndex_"+i);this.markerModule.zoomedMarkerCluster[i]=[],this.markerModule.initialMarkerCluster[i]=[],this.markerModule.markerRender(this,n,i,this.isTileMap?this.tileZoomLevel:this.mapLayerPanel.currentFactor,null)}this.arrangeTemplate()}else{var n=document.getElementById(this.element.id+"_LayerIndex_"+e);if(0<t.length&&n){for(var o=0,r=t;o<r.length;o++){var s=r[o];this.layersCollection[e].markerSettings.push(new E3t(this,"markerSettings",s))}this.markerModule.markerRender(this,n,e,this.isTileMap?this.tileZoomLevel:this.mapLayerPanel.currentFactor,"AddMarker"),this.arrangeTemplate()}}},f4t.prototype.shapeSelection=function(e,t,i,n){if(!this.isDestroyed&&!je(this.layers[e])){var o=void 0,r=void 0,s=Array.isArray(t)?t:Array(t),a=(je(n)&&(n=!0),this.layers[e].selectionSettings);if(!a.enableMultiSelect&&this.legendSelection&&n&&this.removeShapeSelection(),"SubLayer"===this.layers[e].type)for(var l=0;l<this.layersCollection.length;l++)if(this.layersCollection[l].shapeData===this.layers[e].shapeData){r=l;break}if(!je(a)&&a.enable)for(var h=void 0,d=this.layers[e].shapeData.features,l=0;l<d.length;l++)for(var p=0;p<s.length;p++){var c=void 0;if((!je(d[l].properties[s[p]])&&isNaN(d[l].properties[s[p]])?d[l].properties[s[p]].toLowerCase():d[l].properties[s[p]])===(je(i)||"string"!=typeof i?i:i.toLowerCase())){je(this.layers[e].shapeSettings.colorValuePath)||(c=yzt(this.layers[e].dataSource,d[l].properties,this.layers[e].shapeDataPath,this.layers[e].shapePropertyPath,this.layers[e]));var u=this.layers[e];if(0<=this.baseLayerIndex&&u.isBaseLayer?h=0:"SubLayer"===this.layers[e].type&&(h=r),o=Lzt(this.element.id+"_LayerIndex_"+h+"_shapeIndex_"+l+"_dataIndex_"+c),je(c)&&je(o)&&(o=Lzt(this.element.id+"_LayerIndex_"+e+"_shapeIndex_"+l+"_dataIndex_null")),u=parseInt(o.id.split("_shapeIndex_")[1].split("_")[0],10),c=this.layers[e].shapeData.features.length>u?this.layers[e].shapeData.features[u].properties:null,u=je(u=parseInt(o.id.split("_dataIndex_")[1].split("_")[0],10))?null:this.layers[e].dataSource[u],n){jzt(a,this,o,c,u),this.shapeSelectionClass=Lzt("ShapeselectionMap"),this.legendSettings.visible&&-1===o.id.indexOf("_MarkerIndex_")&&this.legendModule.shapeHighLightAndSelection(o,u,a,"selection",e);var g=!this.legendSettings.visible||this.legendModule.shapeToggled;if(g&&(o.setAttribute("class","ShapeselectionMapStyle"),-1===this.selectedElementId.indexOf(o.getAttribute("id"))&&this.selectedElementId.push(o.getAttribute("id")),!a.enableMultiSelect))return}else this.legendSelection=!a.enableMultiSelect&&!this.legendSelection||this.legendSelection,this.legendSettings.visible&&-1===o.id.indexOf("_MarkerIndex_")&&"ShapeselectionMapStyle"===o.getAttribute("class")&&this.legendModule.shapeHighLightAndSelection(o,u,a,"selection",e),(g=!this.legendSettings.visible||this.legendModule.shapeToggled)&&(Wzt(o),-1!==(c=this.selectedElementId.indexOf(o.getAttribute("id"))))&&(this.selectedElementId.splice(c,1),!a.enableMultiSelect)&&this.legendSelection&&0<this.selectedElementId.length&&this.removeShapeSelection()}}}},f4t.prototype.zoomToCoordinates=function(e,t,i,n){var o,r,s,a;this.isDestroyed||(r=o=void 0,a=this.isMarkerZoomCompleted=!1,this.centerPosition={latitude:null,longitude:null},this.isZoomByPosition=!1,(je(i)&&je(n)||je(e)&&je(t))&&(e=je(e)?0:e,t=je(e)?0:t,i=je(i)?e:i,n=je(n)?t:n,a=!0),i<e&&(e=(s=[i,e])[0],i=s[1]),n<t&&(t=(s=[n,t])[0],n=s[1]),r=a?(o=e+i,t+n):(o=(e+i)/2,(t+n)/2),this.centerLatOfGivenLocation=o,this.centerLongOfGivenLocation=r,this.minLatOfGivenLocation=e,this.minLongOfGivenLocation=t,this.maxLatOfGivenLocation=i,this.maxLongOfGivenLocation=n,this.zoomNotApplied=!0,this.scaleOfGivenLocation=ujt(e,i,t,n,this.mapAreaRect.width,this.mapAreaRect.height,this,!0),s=this.getMinMaxLatitudeLongitude(),a={cancel:!1,name:"zoom",type:"zoomIn",maps:this,tileTranslatePoint:{},translatePoint:{},tileZoomLevel:this.isTileMap?{previous:this.tileZoomLevel,current:this.scaleOfGivenLocation}:{},scale:this.isTileMap?{previous:this.tileZoomLevel,current:this.scaleOfGivenLocation}:{previous:this.scale,current:this.scaleOfGivenLocation},minLatitude:s.minLatitude,maxLatitude:s.maxLatitude,minLongitude:s.minLongitude,maxLongitude:s.maxLongitude},this.trigger("zoom",a),this.refresh())},f4t.prototype.removeShapeSelection=function(){for(var e=this.selectedElementId.length,t=0;t<e;t++)Wzt(kzt(this.selectedElementId[0])),this.selectedElementId.splice(0,1);if(this.legendSettings.visible)for(var i=this.legendSelectionCollection.length,t=0;t<i;t++)Wzt(kzt(this.legendSelectionCollection[t].legendElement.id)),this.selectedLegendElementId.splice(0,1);this.shapeSelectionItem=[],this.legendSelectionCollection=[]},f4t.prototype.setCulture=function(){this.intl=new Ti,this.setLocaleConstants(),this.localeObject=new Cn(this.getModuleName(),this.defaultLocalConstants,this.locale)},f4t.prototype.setLocaleConstants=function(){this.defaultLocalConstants={ZoomIn:"Zoom in",Zoom:"Zoom",ZoomOut:"Zoom out",Pan:"Pan",Reset:"Reset",ImageNotFound:"Image Not Found"}},f4t.prototype.destroy=function(){this.unWireEVents(),je(this.mapsTooltipModule)||this.mapsTooltipModule.removeEventListener(),je(this.zoomModule)||this.zoomModule.removeEventListener(),je(this.legendModule)||this.legendModule.removeEventListener(),je(this.selectionModule)||this.selectionModule.removeEventListener(),je(this.highlightModule)||this.highlightModule.removeEventListener(),je(this.bingMap)||this.bingMap.destroy(),m4t.prototype.destroy.call(this),this.shapeSelectionItem=[],this.toggledElementId=[],this.toggledLegendId=[],this.legendSelectionCollection=[],this.selectedLegendElementId=[],this.selectedNavigationElementId=[],this.selectedBubbleElementId=[],this.selectedMarkerElementId=[],this.selectedElementId=[],this.dataLabelShape=[],this.zoomShapeCollection=[],this.zoomLabelPositions=[],this.mouseDownEvent={x:null,y:null},this.mouseClickEvent={x:null,y:null},this.formatFunction=null,this.localeObject=null,this.defaultLocalConstants=null,this.intl=null,this.mapAreaRect=null,this.layersCollection=null,this.themeStyle=null,this.totalRect=null,this.baseSize=null,this.baseMapBounds=null,this.baseMapRectBounds=null,this.baseTranslatePoint=null,this.baseTileTranslatePoint=null,this.markerZoomCenterPoint=null,this.currentTiles=null,this.serverProcess=null,this.toolbarProperties=null,this.zoomLabelPositions=null,this.resizeEvent=null,this.availableSize=null,document.getElementById("mapsmeasuretext")&&document.getElementById("mapsmeasuretext").remove(),this.removeSvg(),this.svgObject=null,this.mapLayerPanel=null,this.renderer=null,this.translatePoint=null,this.tileTranslatePoint=null,this.previousPoint=null,this.dataLabelShape=[],this.zoomShapeCollection=[],this.selectedElementId=[],this.selectedMarkerElementId=[],this.selectedBubbleElementId=[],this.shapeSelectionClass=null,this.markerSelectionClass=null,this.bubbleSelectionClass=null,this.navigationSelectionClass=null,this.selectedNavigationElementId=[],this.polygonSelectionClass=null,this.selectedPolygonElementId=[],this.legendSelectionClass=null,this.previousTranslate=null,this.initialTileTranslate=null,this.markerDragArgument=null},f4t.prototype.getModuleName=function(){return"maps"},f4t.prototype.getPersistData=function(){return this.addOnPersist(["translatePoint","zoomSettings","mapScaleValue","tileTranslatePoint","baseTranslatePoint","scale","zoomPersistence","defaultState","markerZoomedState","initialCheck","initialZoomLevel","initialTileTranslate","applyZoomReset","markerZoomFactor"])},f4t.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){for(var i=!1,n=!1,o=!1,r=0,s=Object.keys(e);r<s.length;r++){var a=s[r];switch(a){case"background":this.renderBorder();break;case"height":case"width":case"layers":case"projectionType":case"centerPosition":case"legendSettings":case"baseLayerIndex":if("layers"===a)for(var o=!0,l=Object.keys(e.layers).length,h=0;h<l;h++)if(!je(e.layers[h]))for(var d=0,p=Object.keys(e.layers[h]);d<p.length;d++){var c=p[d];je(this.layers[h].shapeData)&&!je(this.layers[h].urlTemplate)&&""!==this.layers[h].urlTemplate?this.isReset=!0:"markerSettings"===c&&(n=!0)}i=!0;break;case"zoomSettings":je(t.zoomSettings)||(i=!(e.zoomSettings.zoomFactor!==t.zoomSettings.zoomFactor&&!o||(e.zoomSettings.shouldZoomInitially!==t.zoomSettings.shouldZoomInitially?(this.zoomSettings.zoomFactor=1,this.previousProjection=null,this.scale=this.isMarkerZoomCompleted?null:this.scale,this.isMarkerZoomCompleted=!e.zoomSettings.shouldZoomInitially):e.zoomSettings.enable!==t.zoomSettings.enable&&(this.zoomSettings.zoomFactor=1),0)));break;case"locale":case"currencyCode":m4t.prototype.refresh.call(this)}}i&&(e.layers&&n?(Izt(this.element.id+"_Markers_Group"),this.isTileMap?this.mapLayerPanel.renderTileLayer(this.mapLayerPanel,this.layers.currentFactor,this.layers.length-1):this.render()):(this.createSVG(),this.renderElements()))}},f4t.prototype.requiredModules=function(){var e=[],t=this.findVisibleLayers(this.layers),i=!1;return this.annotations.map(function(e){i=null!=e.content}),this.isBubbleVisible()&&e.push({member:"Bubble",args:[this],name:"Bubble"}),t.highlight&&e.push({member:"Highlight",args:[this],name:"Highlight"}),t.selection&&e.push({member:"Selection",args:[this],name:"Selection"}),this.legendSettings.visible&&e.push({member:"Legend",args:[this],name:"Legend"}),(this.zoomSettings.enable||this.zoomSettings.zoomFactor>this.zoomSettings.minZoom)&&e.push({member:"Zoom",args:[this],name:"Zoom"}),this.isMarkersVisible()&&e.push({member:"Marker",args:[this],name:"Marker"}),this.isDataLabelVisible()&&e.push({member:"DataLabel",args:[this],name:"DataLabel"}),this.isNavigationVisible()&&e.push({member:"NavigationLine",args:[this],name:"NavigationLine"}),this.isPolygonVisible()&&e.push({member:"Polygon",args:[this],name:"Polygon"}),t.tooltip&&e.push({member:"MapsTooltip",args:[this],name:"MapsTooltip"}),i&&e.push({member:"Annotations",args:[this,c4t],name:"Annotations"}),this.allowPrint&&e.push({member:"Print",args:[this],name:"Print"}),this.allowImageExport&&e.push({member:"ImageExport",args:[this],name:"ImageExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this],name:"PdfExport"}),e},f4t.prototype.isMarkersVisible=function(){var i=!1;return Array.prototype.forEach.call(this.layers,function(e){for(var t=0;t<e.markerSettings.length;t++)if(e.markerSettings[t].visible){i=!0;break}}),i},f4t.prototype.isDataLabelVisible=function(){for(var e=!1,t=0;t<this.layers.length;t++)if(this.layers[t].dataLabelSettings.visible){e=!0;break}return e},f4t.prototype.isNavigationVisible=function(){var i=!1;return Array.prototype.forEach.call(this.layers,function(e){for(var t=0;t<e.navigationLineSettings.length;t++)if(e.navigationLineSettings[t].visible){i=!0;break}}),i},f4t.prototype.isPolygonVisible=function(){var i=!1;return Array.prototype.forEach.call(this.layers,function(e){for(var t=0;t<e.polygonSettings.polygons.length;t++)if(0<e.polygonSettings.polygons.length){i=!0;break}}),i},f4t.prototype.isBubbleVisible=function(){for(var e=!1,t=0,i=this.layers;t<i.length;t++){var n=i[t];if(this.getBubbleVisible(n)){e=!0;break}}return e},f4t.prototype.getBubbleVisible=function(e){for(var t=!1,i=0,n=e.bubbleSettings;i<n.length;i++)if(n[i].visible){t=!0;break}return t},f4t.prototype.print=function(e){this.allowPrint&&this.printModule&&!this.isDestroyed&&this.printModule.print(this,e)},f4t.prototype.export=function(t,i,n,o){var r=this;if(!this.isDestroyed){if(je(o)&&(o=!0),"PDF"!==t&&this.allowImageExport&&this.imageExportModule)return new Promise(function(e){e(r.imageExportModule.export(r,t,i,o))});if(this.allowPdfExport&&this.pdfExportModule)return new Promise(function(e){e(r.pdfExportModule.export(r,t,i,o,n))})}return null},f4t.prototype.getBingUrlTemplate=function(i){var e;return e=this.isDestroyed?e:new Promise(function(t){var e=new Qe({url:i});e.onSuccess=function(e){e=e.resourceSets[0].resources[0];t(e.imageUrl)},e.send()})},f4t.prototype.findVisibleLayers=function(e,t,i,n,o,r){void 0===t&&(t=!1),void 0===i&&(i=!1),void 0===n&&(n=!1),void 0===o&&(o=!1),void 0===r&&(r=!1);for(var s=0,a=e;s<a.length;s++){var l=a[s];if(t=l.visible||t,l.visible){for(var h=l.bubbleSettings,d=l.markerSettings,p=l.polygonSettings,c=0,u=l.navigationLineSettings;c<u.length;c++){var g=u[c];g.visible&&(o=!je(g.highlightSettings)&&g.highlightSettings.enable||o,r=!je(g.selectionSettings)&&g.selectionSettings.enable||r)}for(var m=0,f=p.polygons;m<f.length;m++){var y=f[m];!je(y.points)&&0<y.points.length&&(o=l.polygonSettings.highlightSettings.enable||o,r=l.polygonSettings.selectionSettings.enable||r,n=l.polygonSettings.tooltipSettings.visible||n)}for(var v=0,b=d;v<b.length;v++){var w=b[v];if(w.visible&&(n=w.tooltipSettings.visible||n,o=w.selectionSettings.enable||o,r=w.highlightSettings.enable||r),n)break}for(var C=0,S=h;C<S.length;C++){var A=S[C];if(A.visible&&(n=A.tooltipSettings.visible||n,o=A.selectionSettings.enable||o,r=A.highlightSettings.enable||r),n)break}n=l.tooltipSettings.visible||n,o=l.selectionSettings.enable||o,r=l.highlightSettings.enable||r}if(t&&i&&n)break}return{layer:t,bubble:i,tooltip:n,selection:o,highlight:r}},f4t.prototype.getGeoLocation=function(e,t,i){var n,o,r=null,s=null;return this.isDestroyed||this.isTileMap||(o=document.getElementById(this.element.id),n=this.element.getBoundingClientRect(),t=t-o.offsetLeft-(n.left-o.offsetLeft)-window.scrollX,i=i-o.offsetTop-(n.top-o.offsetTop)-window.scrollY,o=(n=Ezt(this,this.layersCollection[e],!1).location).x*this.scale,e=n.y*this.scale,n=Math.min(this.mapAreaRect.height,this.mapAreaRect.width)*this.mapLayerPanel.currentFactor*this.scale,t=this.clip(t-o,0,n-1)/n-.5,o=.5-this.clip(i-e,0,n-1)/n,r=90-360*Math.atan(Math.exp(2*-o*Math.PI))/Math.PI,s=360*t),{latitude:r,longitude:s}},f4t.prototype.clip=function(e,t,i){return Math.min(Math.max(e,t),i)},f4t.prototype.getTileGeoLocation=function(e,t){var i,n=null,o=null;return this.isTileMap&&(i=document.getElementById(this.element.id+"_tile_parent"),this.isDestroyed||je(i)||(n=(e=this.pointToLatLong(e+this.mapAreaRect.x-i.offsetLeft,t+this.mapAreaRect.y-i.offsetTop)).latitude,o=e.longitude)),{latitude:n,longitude:o}},f4t.prototype.pointToLatLong=function(e,t){var i,n=0,o=0;return this.isDestroyed||je(this.translatePoint)||(t=je(this.markerDragArgument)?t:t+10,i=256*Math.pow(2,this.tileZoomLevel),e=this.clip(e-this.translatePoint.x*this.scale,0,i-1)/i-.5,t=.5-this.clip(t-this.translatePoint.y*this.scale,0,i-1)/i,n=90-360*Math.atan(Math.exp(2*-t*Math.PI))/Math.PI,o=360*e),{latitude:n,longitude:o}},d2t([e(null)],f4t.prototype,"background",void 0),d2t([e(!1)],f4t.prototype,"useGroupingSeparator",void 0),d2t([e(null)],f4t.prototype,"format",void 0),d2t([e(null)],f4t.prototype,"width",void 0),d2t([e(null)],f4t.prototype,"height",void 0),d2t([e("MouseMove")],f4t.prototype,"tooltipDisplayMode",void 0),d2t([e(!1)],f4t.prototype,"allowPrint",void 0),d2t([e(!1)],f4t.prototype,"allowImageExport",void 0),d2t([e(!1)],f4t.prototype,"allowPdfExport",void 0),d2t([t({},NNt)],f4t.prototype,"titleSettings",void 0),d2t([t({},HNt)],f4t.prototype,"zoomSettings",void 0),d2t([t({},qNt)],f4t.prototype,"legendSettings",void 0),d2t([kt([],o2t)],f4t.prototype,"layers",void 0),d2t([kt([],mft)],f4t.prototype,"annotations",void 0),d2t([t({},qOt)],f4t.prototype,"margin",void 0),d2t([t({color:"#DDDDDD",width:0},LOt)],f4t.prototype,"border",void 0),d2t([e("Material")],f4t.prototype,"theme",void 0),d2t([e("Mercator")],f4t.prototype,"projectionType",void 0),d2t([e(0)],f4t.prototype,"baseLayerIndex",void 0),d2t([e(null)],f4t.prototype,"description",void 0),d2t([e(0)],f4t.prototype,"tabIndex",void 0),d2t([t({latitude:null,longitude:null},NOt)],f4t.prototype,"centerPosition",void 0),d2t([t({},a2t)],f4t.prototype,"mapsArea",void 0),d2t([i()],f4t.prototype,"load",void 0),d2t([i()],f4t.prototype,"beforePrint",void 0),d2t([i()],f4t.prototype,"loaded",void 0),d2t([i()],f4t.prototype,"click",void 0),d2t([i()],f4t.prototype,"onclick",void 0),d2t([i()],f4t.prototype,"doubleClick",void 0),d2t([i()],f4t.prototype,"rightClick",void 0),d2t([i()],f4t.prototype,"resize",void 0),d2t([i()],f4t.prototype,"tooltipRender",void 0),d2t([i()],f4t.prototype,"legendRendering",void 0),d2t([i()],f4t.prototype,"tooltipRenderComplete",void 0),d2t([i()],f4t.prototype,"shapeSelected",void 0),d2t([i()],f4t.prototype,"itemSelection",void 0),d2t([i()],f4t.prototype,"itemHighlight",void 0),d2t([i()],f4t.prototype,"shapeHighlight",void 0),d2t([i()],f4t.prototype,"layerRendering",void 0),d2t([i()],f4t.prototype,"shapeRendering",void 0),d2t([i()],f4t.prototype,"markerRendering",void 0),d2t([i()],f4t.prototype,"markerClusterRendering",void 0),d2t([i()],f4t.prototype,"markerClick",void 0),d2t([i()],f4t.prototype,"markerDragStart",void 0),d2t([i()],f4t.prototype,"markerDragEnd",void 0),d2t([i()],f4t.prototype,"markerClusterClick",void 0),d2t([i()],f4t.prototype,"markerClusterMouseMove",void 0),d2t([i()],f4t.prototype,"markerMouseMove",void 0),d2t([i()],f4t.prototype,"mouseMove",void 0),d2t([i()],f4t.prototype,"dataLabelRendering",void 0),d2t([i()],f4t.prototype,"bubbleRendering",void 0),d2t([i()],f4t.prototype,"bubbleClick",void 0),d2t([i()],f4t.prototype,"bubbleMouseMove",void 0),d2t([i()],f4t.prototype,"animationComplete",void 0),d2t([i()],f4t.prototype,"annotationRendering",void 0),d2t([i()],f4t.prototype,"zoom",void 0),d2t([i()],f4t.prototype,"pan",void 0),d2t([i()],f4t.prototype,"panComplete",void 0),d2t([i()],f4t.prototype,"zoomComplete",void 0),d2t([Bt],f4t));function f4t(e,t){e=m4t.call(this,e,t)||this;return e.isTileMap=!1,e.isResize=!1,e.isReset=!1,e.baseSize=new eHt(0,0),e.translatePoint=new wHt(0,0),e.baseTranslatePoint=new wHt(0,0),e.zoomTranslatePoint=new wHt(0,0),e.markerZoomedState=!0,e.zoomPersistence=!1,e.defaultState=!0,e.centerPositionChanged=!1,e.markerNullCount=0,e.tileTranslatePoint=new wHt(0,0),e.baseTileTranslatePoint=new wHt(0,0),e.isDevice=!1,e.staticMapZoom=e.zoomSettings.enable?e.zoomSettings.zoomFactor:0,e.zoomNotApplied=!1,e.dataLabelShape=[],e.zoomShapeCollection=[],e.zoomLabelPositions=[],e.mouseDownEvent={x:null,y:null},e.mouseClickEvent={x:null,y:null},e.selectedElementId=[],e.selectedMarkerElementId=[],e.selectedBubbleElementId=[],e.selectedNavigationElementId=[],e.selectedPolygonElementId=[],e.selectedLegendElementId=[],e.legendSelectionCollection=[],e.shapeSelections=!0,e.legendSelection=!0,e.toggledLegendId=[],e.toggledElementId=[],e.checkInitialRender=!0,e.initialTileTranslate=new wHt(0,0),e.isMarkerZoomCompleted=!1,e.markerDragId="",e.initialCheck=!0,e.applyZoomReset=!1,e.markerClusterExpandCheck=!1,e.markerClusterExpand=!1,e.mouseMoveId="",e.shapeSelectionItem=[],e.markerDragArgument=null,x("mergePersistData",e.mergePersistMapsData,e),e}y4t.prototype.renderBubble=function(r,e,t,i,s,a,l,h,d,p){var c=this,n=h.layerData,o=r.colorValuePath,u=!je(o)&&-1<o.indexOf(".")?KHt(e,r.colorValuePath):e[o],o=!je(o)&&-1<o.indexOf(".")?Number(KHt(e,r.colorValuePath)):Number(e[o]),g=!je(r.valuePath)&&-1<r.valuePath.indexOf(".")?Number(KHt(e,r.valuePath)):Number(e[r.valuePath]);if(isNaN(g)&&isNaN(o)&&je(u))return null;for(var m=wzt(r.minRadius,r.maxRadius,g,i.min,i.max),g=new l4t(this.maps).getColorByValue(r.colorMapping,o,u),i="[object Object]"!==Object.prototype.toString.call(g)||je(g.fill)?t:g.fill,f=("[object Object]"!==Object.prototype.toString.call(g)||je(g.opacity)?r:g).opacity,y=[[]],v=(this.maps.translateType="bubble",0),b=0,w=0,C=0,S=n.length;C<S;C++){var A=(A=n[C]).property,x=vzt(e[h.shapeDataPath],h.shapePropertyPath,A);if((!je(e[h.shapeDataPath])&&isNaN(e[h.shapeDataPath])?e[h.shapeDataPath].toLowerCase():e[h.shapeDataPath])===(!je(A[x])&&isNaN(A[x])?A[x].toLowerCase():A[x])&&"LineString"!==n[C].type&&"MultiLineString"!==n[C].type&&"Point"!==n[C].type&&"MultiPoint"!==n[C].type)if(n[C]._isMultiPolygon)for(var I=n[C],T=0;T<I.length;T++)y.push(this.getPoints(I[T],[])),b<(w=y[y.length-1].length)&&(b=w,v=y.length-1);else y.push(this.getPoints(n[C],[])),b<(w=y[y.length-1].length)&&(b=w,v=y.length-1)}var E,o=this.maps.projectionType,u={color:r.border.color,opacity:r.border.opacity,width:r.border.width},t=Czt(y[v],o,h.geometryType);if(r.visible){if(je(t)){g=y.length-1;if(!y[g].x||!y[g].y)return;E={cancel:!1,name:J3t,border:u,cx:y[g].x,cy:y[g].y,data:e,fill:i,maps:this.maps,radius:m}}else o="Mercator"===this.maps.projectionType?t.y:-t.y,E={cancel:!1,name:J3t,border:u,cx:t.x,cy:o,data:e,fill:i,maps:this.maps,radius:m};this.maps.trigger("bubbleRendering",E,function(e){var t,i,n,o;!E.cancel&&(E.border.opacity=je(E.border.opacity)?f:E.border.opacity,t="Circle"===r.bubbleType?(t=new BHt(p,E.fill,E.border,f,0,0,E.radius,null),uzt(c.maps,t,d)):(t="Mercator"===c.maps.projectionType?E.cy-m:E.cy+m,n=new MHt(p,E.fill,E.border,f,new WHt(0,0,2*m,2*m),2,2),E.cx-=m,E.cy=t,gzt(c.maps,n,d)),hzt(c.maps.selectedBubbleElementId,c.maps.bubbleSelectionClass,t,"BubbleselectionMapStyle"),c.bubbleCollection.push({LayerIndex:l,BubbleIndex:s,DataIndex:a,element:t,center:{x:E.cx,y:E.cy}}),n=0!==h.animationDuration||"Enable"===Ut||je(c.maps.zoomModule),n=(1<c.maps.zoomSettings.zoomFactor&&!je(c.maps.zoomModule)&&!c.maps.isTileMap?Dzt:Ezt)(c.maps,h,n),i=r.dataSource,o=n.scale,n=n.location,n=new jHt(c.maps.isTileMap?(E.cx+c.maps.translatePoint.x)*c.maps.tileZoomLevel:(E.cx+n.x)*o,c.maps.isTileMap?(E.cy+c.maps.translatePoint.y)*c.maps.tileZoomLevel:(E.cy+n.y)*o),t.setAttribute("transform","translate( "+n.x+" "+n.y+" )"),o=i.length-1===a?"bubble":null,"Square"===r.bubbleType?(n.x+=m,n.y+=m*("Mercator"===c.maps.projectionType?1:-1)):m=0,0<r.animationDuration||"Enable"===Ut)&&Qzt(t,r.animationDelay,r.animationDuration,n,c.maps,o,m)})}},y4t.prototype.getPoints=function(e,t){return je(e.map)?t=e.point:e.map(function(e){t.push(new wHt(e.point.x,e.point.y))}),t},y4t.prototype.bubbleClick=function(e){var t,i=e.target.id;-1===i.indexOf("_LayerIndex_")||je(t=this.getbubble(i))||(t={cancel:!1,name:Z3t,data:t,maps:this.maps,target:i,x:e.clientX,y:e.clientY},this.maps.trigger(Z3t,t))},y4t.prototype.getbubble=function(e){var t=e.split("_LayerIndex_"),i=parseInt(t[1].split("_")[0],10);if(-1<e.indexOf("_BubbleIndex_")){e=this.maps.layers[i],i=parseInt(t[1].split("_BubbleIndex_")[1],10),t=parseInt(t[1].split("_BubbleIndex_")[1].split("_dataIndex_")[1],10);if(!isNaN(i))return e.bubbleSettings[i].dataSource[t]}return null},y4t.prototype.bubbleMove=function(e){var t,i=e.target.id;-1===i.indexOf("_LayerIndex_")||je(t=this.getbubble(i))||(t={cancel:!1,name:$3t,data:t,maps:this.maps,target:i,x:e.clientX,y:e.clientY},this.maps.trigger($3t,t))},y4t.prototype.getModuleName=function(){return"Bubble"},y4t.prototype.destroy=function(){this.bubbleCollection=[],this.maps=null};f2t=y4t;function y4t(e){this.id="",this.maps=e,this.bubbleCollection=[]}v4t.prototype.getMapsInstance=function(){return this.maps},v4t.prototype.markerRender=function(g,m,f,y,v){var b=this,w=0,C=0,S=!1,A=0,x=(g.translateType="marker",g.layersCollection[f]),I=m.querySelectorAll("#"+g.element.id+"_Markers_Group");0<I.length?(this.markerSVGObject=I[0],this.markerSVGObject.innerHTML="",S=!0):this.markerSVGObject=g.renderer.createGroup({id:g.element.id+"_Markers_Group",class:"GroupElement"}),this.markerSVGObject.style.pointerEvents="auto";var T,E,e=kzt(g.element.id+"_Secondary_Element").querySelectorAll("#"+g.element.id+"_LayerIndex_"+f+"_Markers_Template_Group"),D=(e&&0<e.length&&0<e[0].childElementCount?((T=kzt(g.element.id+"_LayerIndex_"+f+"_Markers_Template_Group")).innerHTML="",S=!0):(T=Q("div",{id:g.element.id+"_LayerIndex_"+f+"_Markers_Template_Group",className:g.element.id+"_template"})).style.cssText="overflow: hidden; position: absolute;pointer-events: none;top:"+g.mapAreaRect.y+"px;left:"+g.mapAreaRect.x+"px;height:"+g.mapAreaRect.height+"px;width:"+g.mapAreaRect.width+"px;",this.allowInnerClusterSetting(x)),e=0!==x.animationDuration||"Enable"===Ut||je(g.zoomModule);g.isTileMap||(E=(!je(g.zoomModule)&&1<g.zoomSettings.zoomFactor?Dzt:Ezt)(g,x,e)),Array.prototype.forEach.call(x.markerSettings,function(p,c){var u=p.dataSource;w=0,je(p.dataSource)||Array.prototype.forEach.call(u,function(l,h){g.markerNullCount=0<c&&0===h?0:g.markerNullCount;var d={cancel:!1,name:W3t,fill:p.fill,height:je(p.heightValuePath)||je(l[p.heightValuePath])?p.height:l[p.heightValuePath],width:je(p.widthValuePath)||je(l[p.widthValuePath])?p.width:l[p.widthValuePath],imageUrl:p.imageUrl,shape:p.shape,template:p.template,data:l,maps:g,marker:p,border:p.border,colorValuePath:p.colorValuePath,shapeValuePath:p.shapeValuePath,imageUrlValuePath:p.imageUrlValuePath};g.trigger("markerRendering",d,function(e){d=ZHt(d=JHt(d,l),l);var t=je(p.longitudeValuePath)?je(l.longitude)?je(l.Longitude)?null:parseFloat(l.Longitude):parseFloat(l.longitude):Number(KHt(l,p.longitudeValuePath)),i=je(p.latitudeValuePath)?je(l.latitude)?je(l.Latitude)?null:parseFloat(l.Latitude):parseFloat(l.latitude):Number(KHt(l,p.latitudeValuePath)),n=p.offset,o=(d.cancel||!p.visible||je(t)||je(i)||(o=g.element.id+"_LayerIndex_"+f+"_MarkerIndex_"+c+"_dataIndex_"+h,r=g.isTileMap?hHt(new jHt(t,i),y,g.tileTranslatePoint,!0):aHt(i,t,y,x,g),g.isTileMap&&(E="SubLayer"===x.type&&je(g.zoomModule)?r=hHt(new jHt(t,i),g.tileZoomLevel,g.tileTranslatePoint,!0):new Object),a=("AddMarker"===v?g:E).scale,s="AddMarker"===v?g.translatePoint:E.location,!d.template||isNaN(r.x)||isNaN(r.y)?d.template||isNaN(r.x)||isNaN(r.y)||(S=!0,w++,azt(d,p,u,h,r,s,o,n,a,g,b.markerSVGObject)):(S=!1,A++,lzt(d,void 0,o,l,c,T,r,s,a,n,g),g.renderReactTemplates())),C+=isNaN(i)||isNaN(t)?1:0,A+=d.cancel?1:0,w+=d.cancel?1:0,g.markerNullCount=je(t)||je(i)?g.markerNullCount+1:g.markerNullCount,u.length-g.markerNullCount),r=!1,s=p.clusterSettings.allowClustering||x.markerClusterSettings.allowClustering&&1<x.markerSettings.length?b.markerSVGObject.querySelectorAll("[id*='LayerIndex_"+f+"_MarkerIndex_"+c+"']:not([id*='_Group'])"):b.markerSVGObject.childNodes,a=b.markerSVGObject.childNodes===s?A:0;s.length===o-a-C&&"Template"!==v&&(0===I.length&&m.appendChild(b.markerSVGObject),p.clusterSettings.allowClustering||!D&&x.markerClusterSettings.allowClustering)&&(0===I.length&&(g.svgObject.appendChild(b.markerSVGObject),g.element.appendChild(g.svgObject)),-1!==x.urlTemplate.indexOf("openstreetmap")&&je(x.shapeData)&&g.zoomSettings.enable?(r=izt(x,b.markerSVGObject,g,f,c,b.markerSVGObject,m,!0,!1,null,D),0===I.length&&m.appendChild(b.markerSVGObject)):r=izt(x,b.markerSVGObject,g,f,c,b.markerSVGObject,m,!0,!1,E,D),g.renderReactTemplates()),(p.clusterSettings.allowClustering||x.markerClusterSettings.allowClustering&&1<x.markerSettings.length?T.querySelectorAll("[id*='LayerIndex_"+f+"_MarkerIndex_"+c+"']:not([id*='_Group'])"):T.childNodes).length===o-w-C&&kzt(g.element.id+"_Secondary_Element")&&(S||kzt(g.element.id+"_Secondary_Element").appendChild(T),g.checkInitialRender&&(p.clusterSettings.allowClustering||!D&&x.markerClusterSettings.allowClustering)&&!r&&(izt(x,T,g,f,c,b.markerSVGObject,m,!1,!1,E,D),g.renderReactTemplates()),x.markerClusterSettings.allowClustering)&&0<I.length&&kzt(g.element.id+"_Layer_Collections").appendChild(m)})})})},v4t.prototype.calculateIndividualLayerMarkerZoomLevel=function(e,t,i){var n=Math.abs(this.maps.baseMapBounds.latitude.max-this.maps.baseMapBounds.latitude.min),o=Math.abs(this.maps.baseMapBounds.longitude.max-this.maps.baseMapBounds.longitude.min),t=Math.floor(Math.log(t/n)),n=(t=i<t?i:t,i<(n=Math.floor(Math.log(e/o)))?i:n),e=Math.min(t,n),o=Math.min(e,i-1);return this.maps.isTileMap||cjt(o,this.maps),o},v4t.prototype.calculateZoomCenterPositionAndFactor=function(e){var n,o,r,s,t,i,a,l,h,d;je(this.maps)||(this.maps.zoomSettings.shouldZoomInitially&&this.maps.markerModule?(a=i=t=void 0,l=this.maps.zoomSettings.maxZoom,h=this.maps.mapAreaRect.width,d=this.maps.mapAreaRect.height,this.maps.markerZoomedState=this.maps.markerZoomedState||(!je(this.maps.markerZoomFactor)&&1<this.maps.markerZoomFactor?this.maps.markerZoomedState:!this.maps.markerZoomedState),this.maps.defaultState=this.maps.markerZoomedState?!this.maps.markerZoomedState:this.maps.defaultState,Array.prototype.forEach.call(e,function(e){0!==e.markerSettings.length&&Array.prototype.forEach.call(e.markerSettings,function(e){e=e.dataSource;!je(e)&&0<e.length&&Array.prototype.forEach.call(e,function(e,t){var i=je(e.latitude)?je(e.Latitude)?null:parseFloat(e.Latitude):parseFloat(e.latitude),e=je(e.longitude)?je(e.Longitude)?null:parseFloat(e.Longitude):parseFloat(e.longitude);je(i)||je(e)||(n=je(n)&&0===t?e:n,o=je(o)&&0===t?i:o,r=je(r)&&0===t?i:r,s=je(s)&&0===t?e:s,e<n&&(n=e),i<r&&(r=i),s<e&&(s=e),o<i&&(o=i))})})}),je(r)||je(n)||je(s)||je(o)||(i=(r+o)/2,a=(n+s)/2,this.maps.markerCenterLatitude=i,this.maps.markerCenterLongitude=a,(je(this.maps.markerZoomCenterPoint)||this.maps.markerZoomedState)&&(this.maps.markerZoomCenterPoint={latitude:i,longitude:a}),e=void 0,this.maps.isTileMap||0===this.maps.baseMapRectBounds.min.x?(t=ujt(r,o,n,s,h,d,this.maps,!1),this.maps.isTileMap?e=!je(this.maps.markerZoomFactor)&&!je(this.maps.mapScaleValue)&&1<this.maps.mapScaleValue&&1!==this.maps.markerZoomFactor?this.maps.mapScaleValue:t:(e=!je(this.maps.mapScaleValue)&&1!==Math.floor(this.maps.scale)&&this.maps.mapScaleValue!==t&&je(this.maps.shouldZoomCurrentFactor)?this.maps.mapScaleValue:t)!==this.maps.mapScaleValue||1!==this.maps.markerZoomFactor&&1!==this.maps.mapScaleValue||this.maps.enablePersistence||(e=t)):(t=this.calculateIndividualLayerMarkerZoomLevel(h,d,l),e=!je(this.maps.mapScaleValue)&&this.maps.mapScaleValue!==t?this.maps.mapScaleValue:t),this.maps.markerZoomFactor=e)):(this.maps.markerZoomedState=!1,1<this.maps.markerZoomFactor&&(this.maps.markerCenterLatitude=null,this.maps.markerCenterLongitude=null,this.maps.markerZoomFactor=1,this.maps.enablePersistence||(this.maps.mapScaleValue=1)),this.maps.isTileMap&&!this.maps.enablePersistence&&this.maps.mapScaleValue<=1&&(this.maps.tileZoomLevel=0===this.maps.mapScaleValue?this.maps.isZoomByPosition?this.maps.tileZoomLevel:1:this.maps.mapScaleValue,1!==this.maps.mapScaleValue||1!==this.maps.markerZoomFactor||je(this.maps.tileTranslatePoint)||(this.maps.tileTranslatePoint.x=0,this.maps.tileTranslatePoint.y=0))))},v4t.prototype.markerClick=function(e){var t,i,n,o,r,s,a=e.target.id;-1===(a=-1===a.indexOf(this.maps.element.id)&&!je(t=e.target.closest("."+this.maps.element.id+"_marker_template_element"))&&-1<t.id.indexOf("_MarkerIndex_")?t.id:a).indexOf("_LayerIndex_")||0<a.indexOf("_cluster_")||je(t=this.getMarker(a))||(t.marker.enableDrag&&(document.getElementById(this.maps.element.id+"_svg").style.cursor="grabbing"),s={cancel:!1,name:U3t,data:t.data,maps:this.maps,marker:t.marker,target:a,x:e.clientX,y:e.clientY,latitude:t.data.latitude||t.data.Latitude,longitude:t.data.longitude||t.data.Longitude,value:t.data.name},this.maps.trigger(U3t,s),!t.marker.enableDrag)||(s=!1,i=parseInt(a.split("_LayerIndex_")[1].split("_")[0],10),n=parseInt(a.split("_MarkerIndex_")[1].split("_")[0],10),o=parseInt(a.split("_dataIndex_")[1].split("_")[0],10),r=this.maps.layers[i].markerSettings[n],s=0<this.sameMarkerData.length?0<this.sameMarkerData[0].data.filter(function(e){return e.index===o}).length&&this.sameMarkerData[0].layerIndex===i&&this.sameMarkerData[0].markerIndex===n:s)||(s={name:q3t,x:e.clientX,y:e.clientY,latitude:t.data.latitude||t.data.Latitude,longitude:t.data.longitude||t.data.Longitude,layerIndex:i,markerIndex:n,dataIndex:o},this.maps.trigger(q3t,s),this.maps.markerDragArgument={targetId:a,x:e.clientX,y:e.clientY,latitude:t.data.latitude||t.data.Latitude,longitude:t.data.longitude||t.data.Longitude,shape:je(r.shapeValuePath)?r.shape:r.dataSource[o][r.shapeValuePath],layerIndex:i,markerIndex:n,dataIndex:o})},v4t.prototype.markerClusterClick=function(e){var t,i=e.target.id;-1===i.indexOf("_LayerIndex_")||-1===i.indexOf("_cluster_")||je(t=this.getMarker(i))||(0<t.clusterCollection.length&&this.maps.markerClusterExpand&&(Lzt(this.maps.element.id+"_mapsTooltip")&&-1<this.maps.mapsTooltipModule.tooltipTargetID.indexOf("_MarkerIndex_")&&Izt(this.maps.element.id+"_mapsTooltip"),0<this.sameMarkerData.length&&!this.maps.markerClusterExpandCheck?(this.maps.markerClusterExpandCheck=!0,rzt(this.sameMarkerData,this.maps)):(this.sameMarkerData=t.clusterCollection,this.maps.markerClusterExpandCheck=!1,szt(this.sameMarkerData,this.maps,this.markerSVGObject,!0))),i={cancel:!1,name:G3t,data:t,maps:this.maps,target:i,x:e.clientX,y:e.clientY,latitude:t.data.latitude||t.data.Latitude,longitude:t.data.longitude||t.data.Longitude,markerClusterCollection:t.markCollection},this.maps.trigger(G3t,i))},v4t.prototype.getMarker=function(e){var t=e.split("_LayerIndex_"),i=parseInt(t[1].split("_")[0],10),n=this.maps.layers[i],o=[],r=[];if(-1<e.indexOf("_MarkerIndex_")){var s=parseInt(t[1].split("_MarkerIndex_")[1].split("_")[0],10),t=parseInt(t[1].split("_dataIndex_")[1].split("_")[0],10),a=n.markerSettings[s],l=this.allowInnerClusterSetting(n);if(this.maps.markerClusterExpand=(!l&&n.markerClusterSettings.allowClustering?n.markerClusterSettings:a.clusterSettings).allowClusterExpand,!isNaN(s)){var h=a.dataSource[t],d=[];if(!a.template&&-1<e.indexOf("_cluster_")&&this.maps.markerClusterExpand&&Array.prototype.forEach.call(a.dataSource,function(e,t){e.latitude===h.latitude&&e.longitude===h.longitude&&d.push({data:h,index:t})}),-1<e.indexOf("_cluster_")){for(var l=!l&&n.markerClusterSettings.allowClustering?n.markerClusterSettings:n.markerSettings[s].clusterSettings,n=document.getElementById(-1<e.indexOf("_datalabel_")?"Balloon"===l.shape?e.split("_datalabel_")[0]+"_Group":e.split("_datalabel_")[0]:"Balloon"===l.shape?e+"_Group":e),l=("Balloon"===l.shape?n.children[0]:n).textContent.split(",").map(Number),d=[],p=0,c=l;p<c.length;p++){var u=c[p];d.push({data:a.dataSource[u],index:u}),o.push(a.dataSource[u])}r.push({data:d,layerIndex:i,markerIndex:s,dataIndex:t,targetClusterIndex:+(-1<e.split("_cluster_")[1].indexOf("_datalabel_")?e.split("_cluster_")[1].split("_datalabel_")[0]:e.split("_cluster_")[1]),isClusterSame:!1})}return{marker:a,data:h,clusterCollection:r,markCollection:o}}}return null},v4t.prototype.markerMove=function(e){var t,i=e.target.id;-1===i.indexOf("_LayerIndex_")||0<i.indexOf("_cluster_")||je(t=this.getMarker(i))||(t.marker.enableDrag&&(document.getElementById(this.maps.element.id+"_svg").style.cursor=je(this.maps.markerDragArgument)?"pointer":"grabbing"),t={cancel:!1,name:Y3t,data:t.data,maps:this.maps,target:i,x:e.clientX,y:e.clientY},this.maps.trigger(Y3t,t))},v4t.prototype.markerClusterMouseMove=function(e){var t,i=e.target.id;-1===i.indexOf("_LayerIndex_")||-1===i.indexOf("_cluster_")||(t=this.getMarker(i),this.maps.markerClusterExpand&&(e.target.style.cursor="pointer"),je(t))||(t={cancel:!1,name:X3t,data:t.data,maps:this.maps,target:i,x:e.clientX,y:e.clientY},this.maps.trigger(X3t,t))},v4t.prototype.allowInnerClusterSetting=function(e){for(var t=!1,i=0;i<e.markerSettings.length;i++)if(e.markerSettings[i].clusterSettings.allowClustering){t=!0;break}return t},v4t.prototype.initializeMarkerClusterList=function(){for(var e=0;e<this.maps.layers.length;e++)this.initialMarkerCluster[e]=[],this.zoomedMarkerCluster[e]=[]},v4t.prototype.getModuleName=function(){return"Marker"},v4t.prototype.destroy=function(){this.maps=null,this.markerSVGObject=null,this.sameMarkerData=[],this.initialMarkerCluster=[],this.zoomedMarkerCluster=[]};b2t=v4t;function v4t(e){this.maps=e,this.sameMarkerData=[],this.initialMarkerCluster=[],this.zoomedMarkerCluster=[]}b4t.prototype.polygonRender=function(o,r,s){var a=o.layersCollection[r],l=o.renderer.createGroup({id:o.element.id+"_LayerIndex_"+r+"_Polygons_Group"});return a.polygonSettings.polygons.map(function(e,t){var i=o.renderer.createGroup({id:o.element.id+"_LayerIndex_"+r+"_Polygons_Group_"+t}),n=e.points;!je(e.points)&&0<e.points.length&&(n=lHt(o,s,a,n),t=new EHt(o.element.id+"_LayerIndex_"+r+"_PolygonIndex_"+t,e.fill,e.borderWidth/s,e.borderColor,e.opacity,e.borderOpacity,"",n),e=o.renderer.drawPath(t),hzt(o.selectedPolygonElementId,o.polygonSelectionClass,e,"PolygonselectionMapStyle"),i.appendChild(e),l.appendChild(i))}),l},b4t.prototype.getModuleName=function(){return"Polygon"},b4t.prototype.destroy=function(){};S2t=b4t;function b4t(e){}w4t.prototype.getDataLabel=function(e,t,i,n){for(var o,r=0;r<(je(e)?0:e.length);r++){var s=e[r],a=!je(s[n])&&isNaN(s[n])&&"string"==typeof s[n]?s[n].toLowerCase():s[n];if(i=je(i)||"string"!=typeof i?i:i.toString(),a===(je(i)||"string"!=typeof i?i:i.toLowerCase())){o=s;break}}return o},w4t.prototype.renderLabel=function(m,f,e,t,z,y,v,b){var w,C,S,A,j,W,Q,d,x,I=this,i=m.dataLabelSettings,T=m.dataLabelSettings.textStyle,E=m.dataLabelSettings,n=m.dataLabelSettings.labelPath,D=[[]],M=0,o=0,k=e,P="",r=0,U=!1,p=e.properties,B=this.maps.element.id+"_LayerIndex_"+f+"_shapeIndex_"+v+"_LabelIndex_"+v,F=new wHt(0,0),s=t[v],c=(T.fontFamily="material"!==this.maps.theme.toLowerCase()?this.maps.themeStyle.labelFontFamily:T.fontFamily,T.fontWeight=T.fontWeight||this.maps.themeStyle.fontWeight,T.size=T.size||this.maps.themeStyle.fontSize,e=je(s)?null:s.property,"[object Array]"===Object.prototype.toString.call(m.shapePropertyPath)?m.shapePropertyPath:[m.shapePropertyPath]),e=0!==m.animationDuration||"Enable"===Ut||je(this.maps.zoomModule),e=this.maps.isTileMap?new Object:(1<this.maps.zoomSettings.zoomFactor&&!je(this.maps.zoomModule)?Dzt:Ezt)(this.maps,m,e),L=(this.maps.isTileMap?this.maps:e).scale,R=this.maps.isTileMap?this.maps.translatePoint:e.location,O=this.maps.zoomTranslatePoint,N=je(this.maps.scale)?1:Math.floor(this.maps.scale),V=this.maps.zoomSettings.enable&&!je(this.maps.zoomShapeCollection)&&0<this.maps.zoomShapeCollection.length&&!this.maps.isAddLayer;this.maps.translateType="labels";for(var a=0;a<c.length&&!(p[c[a]]&&(d=c[a],A=this.getDataLabel(m.dataSource,m.shapeDataPath,k.properties[d],m.shapeDataPath)));a++);if(A=this.getDataLabel(m.dataSource,m.shapeDataPath,k.properties[d],m.shapeDataPath),!je(s)&&!je(s.property))if(D=[[]],t[v]._isMultiPolygon||"Point"===t[v].type||"MultiPoint"===t[v].type){if("Point"!==t[v].type&&"MultiPoint"!==t[v].type)for(var u=t[v],a=0;a<u.length;a++)D.push(this.getPoint(u[a],[])),o<(r=D[D.length-1].length)&&(o=r,M=D.length-1)}else D.push(this.getPoint(t[v],[])),o<(r=D[D.length-1].length)&&(o=r,M=D.length-1);if(P=je(A)?k.properties[n]:je(A[n])?k.properties[n]||A[m.shapeDataPath]:A[n].toString(),"[object Array]"===Object.prototype.toString.call(m.shapePropertyPath)&&je(P)&&!je(m.dataSource)&&0===m.dataSource.length)for(var l=0;l<m.shapePropertyPath.length;l++)if(k.properties[m.shapePropertyPath[l]]){P=k.properties[m.shapePropertyPath[l]];break}je(P)&&""!==m.dataLabelSettings.template&&0===m.dataSource.length&&(P=k.properties[m.shapePropertyPath]);var _,q=P=je(P)&&!je(m.dataSource)&&0<m.dataSource.length?"":P,G=this.maps.projectionType,Y=_=Czt(D[M],G,m.geometryType);if(!je(P)&&!je(_)){if(V&&1<N&&!this.maps.zoomNotApplied&&""===i.template){if(0<f)for(var h=0;h<this.maps.zoomLabelPositions.length;h++)if(this.maps.zoomLabelPositions[h].dataLabelText===P){j=v,v=h,U=!0;break}W=_.x,Q=_.y,_.x=(_.x+O.x)*L,_.y=(_.y+O.y)*L}_.y="Mercator"===this.maps.projectionType||"Normal"===m.geometryType?_.y:-_.y,je(this.maps.format)||isNaN(Number(P))||isNaN(parseFloat(P))||this.maps.useGroupingSeparator&&(P=Bzt(this.maps,parseFloat(P)),je(A)||(A[n]=P));var H={name:K3t,maps:this.maps,cancel:!1,border:{color:i.border.color,width:i.border.width,opacity:i.border.opacity},datalabel:i,fill:i.fill,template:i.template,text:P,offsetX:0,offsetY:0};this.maps.trigger("dataLabelRendering",H,function(e){if(!H.cancel){var t,i=V&&1<N&&!I.maps.zoomNotApplied&&I.maps.zoomShapeCollection.length>v?I.maps.dataLabelShape[v]*L:(_.rightMax.x-_.leftMax.x)*L,n=(je(I.maps.dataLabelShape)||I.maps.isReset||(x=Y.rightMax.x-Y.leftMax.x,I.maps.dataLabelShape.push(x)),xHt(P=H.text===P||H.cancel?P:H.text,T)),o=P,r=n,s=_.y-n.height/2,a=_.y+n.height/2,l=(_.y+R.y)*L-n.height/2,h=(_.y+R.y)*L+n.height/2,s=(5<(s=bzt(D[M],s,a)).length&&"MultiPolygon"!==k.geometry.type&&"MultiPolygon"!==k.type&&(a=Czt(s,G,m.geometryType),V&&1<N&&!I.maps.zoomNotApplied&&""===H.template&&(a.x=(I.maps.zoomLabelPositions[v].location.x+O.x)*L,a.y=(I.maps.zoomLabelPositions[v].location.y+O.y)*L),W=a.x,_.x=a.x,i=V&&1<N&&!I.maps.zoomNotApplied&&I.maps.zoomShapeCollection.length>v?I.maps.dataLabelShape[v]*L:0<(a.rightMax.x-a.leftMax.x)*L?(a.rightMax.x-a.leftMax.x)*L:i),(_.x+R.x)*L+n.width/2),a=(_.x+R.x)*L-n.width/2;if(I.value[v]={rightWidth:s,leftWidth:a,heightTop:l,heightBottom:h},""!==H.template){s=(x=Fzt(H.template,I.maps))?x(je(A)?k.properties:A,I.maps,H.template,I.maps.element.id+"_LabelTemplate",!1):document.createElement("div");s.innerHTML=x?"":H.template,t=YHt(s,B,je(A)?k.properties:A),I.maps.isTileMap?(t.style.left=(_.x+R.x)*L-n.width/2+"px",t.style.top=(_.y+R.y)*L-n.height+"px"):(t.style.left=Math.abs(I.maps.baseMapRectBounds.min.x-_.x)*L+e.offsetX+"px",t.style.top=Math.abs(I.maps.baseMapRectBounds.min.y-_.y)*L+e.offsetY+"px"),y.appendChild(t)}else{a=je(E.smartLabelMode)?"None":E.smartLabelMode.toString(),l=("Trim"===a&&(r=xHt(o=Azt(i,"number"==typeof P?P.toString():P,T,null,!0),T),w=new THt(B,F.x,F.y,"middle",o,"","")),"None"===a&&(w=new THt(B,F.x,F.y,"middle",P,"","")),"Hide"===a&&(P=i>=n.width?P:"",w=new THt(B,F.x,F.y,"middle",P,"","")),je(w)||(P=w.text),je(E.intersectionAction)?"None":E.intersectionAction.toString());if("Hide"===l){for(var d=0;d<b.length;d++)if(!je(b[d])&&!(I.value[v].leftWidth>b[d].rightWidth||I.value[v].rightWidth<b[d].leftWidth||I.value[v].heightTop>b[d].heightBottom||I.value[v].heightBottom<b[d].heightTop)){P="";break}b.push(I.value[v]),w=new THt(B,F.x,F.y,"middle",P,"","")}var p,c,u;if("Trim"===l){for(var g=0;g<b.length;g++)if(!je(b[g]))if(b[g].rightWidth<I.value[v].leftWidth||b[g].leftWidth>I.value[v].rightWidth||b[g].heightBottom<I.value[v].heightTop||b[g].heightTop>I.value[v].heightBottom)o=P,0;else{if(I.value[v].leftWidth>b[g].leftWidth){o=Azt((i=b[g].rightWidth-I.value[v].leftWidth)-(I.value[v].rightWidth-I.value[v].leftWidth),P,T,null,!0);break}if(I.value[v].leftWidth<b[g].leftWidth){i=I.value[v].rightWidth-b[g].leftWidth,o=Azt(Math.abs(i-(I.value[v].rightWidth-I.value[v].leftWidth)),P,T,null,!0);break}}r=xHt(o,T),b.push(I.value[v]),w=new THt(B,F.x,F.y,"middle",o,"","")}"None"===l&&(w=new THt(B,F.x,F.y,"middle",P,"","")),1<o.length&&1<(h=H.border).width&&(s=H.fill,a=E.opacity,l=E.rx,p=E.ry,u=c=void 0,u=V&&1<N&&!I.maps.zoomNotApplied?(c=_.x-n.width/2,_.y-n.height/2-5):(c=(_.x+R.x)*L-n.width/2,(_.y+R.y)*L-n.height/2),h.opacity=je(h.opacity)?a:h.opacity,s=new MHt(I.maps.element.id+"_LayerIndex_"+f+"_shapeIndex_"+v+"_rectIndex_"+v,s,h,a,new WHt(c+e.offsetX,u+e.offsetY,n.width,n.height),l,p),(S=I.maps.renderer.drawRectangle(s)).setAttribute("visibility",0<m.dataLabelSettings.animationDuration||"Enable"===Ut?"hidden":"visibile"),z.appendChild(S)),(C=QHt(w,T,T.color||I.maps.themeStyle.dataLabelFontColor,z)).setAttribute("aria-label",P),C.setAttribute("role","region"),C.setAttribute("visibility",0<m.dataLabelSettings.animationDuration||"Enable"===Ut?"hidden":"visibile"),V&&1<N&&!I.maps.zoomNotApplied?(C.setAttribute("transform","translate( "+(_.x+e.offsetX)+" "+(_.y+e.offsetY)+" )"),_.x=W,_.y=Q):C.setAttribute("transform","translate( "+((_.x+R.x)*L+e.offsetX)+" "+((_.y+R.y)*L+r.height/2+e.offsetY)+" )"),z.appendChild(C)}I.dataLabelCollections.push({location:{x:_.x+e.offsetX,y:_.y+e.offsetY},element:je(t)?C:t,layerIndex:f,shapeIndex:U?j:v,labelIndex:U?j:v,dataLabelText:q}),0<y.childElementCount&&!I.maps.element.contains(y)&&(document.getElementById(I.maps.element.id+"_Secondary_Element").appendChild(y),I.maps.renderReactTemplates()),!(0<m.dataLabelSettings.animationDuration||"Enable"===Ut)||je(C)||(I.datalabelAnimate(C,E.animationDuration,T.opacity,!1),je(S))||I.datalabelAnimate(S,E.animationDuration,E.opacity,!0)}})}},w4t.prototype.datalabelAnimate=function(t,e,i,n){var o;new Vt({}).animate(t,{duration:0===e&&"Enable"===Ut?1e3:e,delay:0,progress:function(e){e.timeStamp>e.delay&&(o=(e.timeStamp-e.delay)/e.duration,t.setAttribute("style","user-select: none; visibility: visible;"),t.setAttribute(n?"fill-opacity":"opacity",(i*o).toString()))},end:function(){t.style.visibility="visible",t.setAttribute(n?"fill-opacity":"opacity",i.toString())}})},w4t.prototype.getPoint=function(e,t){return"MultiLineString"===e.type?Array.prototype.forEach.call(e,function(e){Array.prototype.forEach.call(e,function(e){t.push(new wHt(e.point.x,e.point.y))})}):Array.prototype.forEach.call(e,function(e){t.push(new wHt(e.point.x,e.point.y))}),t},w4t.prototype.getModuleName=function(){return"DataLabel"},w4t.prototype.destroy=function(){this.dataLabelCollections=[],this.value=null,this.maps=null};I2t=w4t;function w4t(e){this.value={rightWidth:0,leftWidth:0,heightTop:0,heightBottom:0},this.maps=e,this.dataLabelCollections=[]}C4t.prototype.renderNavigation=function(e,t,i){if(!je(this.maps))for(var n,o,r,s,a,l,h,d,p=void 0,c=e.navigationLineSettings,u=[],g=void 0,m=void 0,f=void 0,y=void 0,v=void 0,b=void 0,w=void 0,C=void 0,S=void 0,A=void 0,x=void 0,I=this.maps.renderer.createGroup({id:this.maps.element.id+"_LayerIndex_"+i+"_line_Group"}),T=0;T<c.length;T++){if(o=c[T].latitude,n=c[T].longitude,r=!je(c[T].visible)&&c[T].visible,g=je(c[T].angle)?0:c[T].angle,s=c[T].width||1,a=c[T].color,l=c[T].dashArray,h=!je(d=c[T].arrowSettings)&&d.showArrow,!je(n)&&!je(o)&&n.length===o.length&&r)for(var E=0;E<n.length;E++){var D=this.maps.isTileMap?hHt(new wHt(n[E],o[E]),t,this.maps.tileTranslatePoint,!0):aHt(o[E],n[E],t,e,this.maps);u.push(D)}for(var x=this.maps.renderer.createGroup({id:this.maps.element.id+"_LayerIndex_"+i+"_NavigationGroup"+T}),M=0;M<u.length-1;M++){var k,P,B,F,g=1<(g=g<-1?-1:g)?1:g,L=this.maps.element.id+"_LayerIndex_"+i+"_NavigationIndex_"+T+"_Line"+M,R=this.convertRadius(u[M],u[M+1]);g<=1&&0<g&&(f=0,u[M].x>u[M+1].x)&&(f=1),-1<=g&&g<0&&u[M].x>u[M+(f=1)].x&&(f=0),h&&(y=d.color,v=je(d.size)?0:d.size,A=je(d.offSet)?0:d.offSet,k=Math.round(v/2),w="Start"===(b=d.position)?"url(#triangle"+T+")":null,C="End"===b?"url(#triangle"+T+")":null,S=je(S=0!==S&&0===g?"Start"===b?A:-A:S)?0:S,P=this.maps.element.id+"_triangle",(B=this.maps.renderer.createDefs()).innerHTML+='<marker id="triangle'+T+'"></marker>',(F=B.querySelector("#triangle"+T)).setAttribute("markerWidth",v.toString()),F.setAttribute("markerHeight",v.toString()),F.setAttribute("refX",(k-S).toString()),F.setAttribute("refY",k.toString()),F.setAttribute("orient","auto"),m=new EHt(P,y,s,a,1,1,l,"M 0,0  L 0,"+v+" L "+k+", "+k+" Z"),p=this.maps.renderer.drawPath(m),F.appendChild(p),B.appendChild(F),x.appendChild(B)),P=0===(g=Math.abs(g))?"M "+u[M].x+","+u[M].y+"L "+u[M+1].x+","+u[M+1].y+" ":"M "+u[M].x+","+u[M].y+" A "+(R/2+(1-g)*R/(10*g))+" "+(R/2+(1-g)*R/(10*g))+" 0,0,"+f+" , "+u[M+1].x+","+u[M+1].y+" ",m=new EHt(L,"none",s,a,1,1,l,P),p=this.maps.renderer.drawPath(m),je(b)||("Start"===b?p.setAttribute("marker-start",w):p.setAttribute("marker-end",C)),hzt(this.maps.selectedNavigationElementId,this.maps.navigationSelectionClass,p,"navigationlineselectionMapStyle"),x.appendChild(p),I.appendChild(x)}u=[]}return I},C4t.prototype.convertRadius=function(e,t){var i=t.x-e.x,t=t.y-e.y;return Math.sqrt(Math.pow(i,2)+Math.pow(t,2))},C4t.prototype.getModuleName=function(){return"NavigationLine"},C4t.prototype.destroy=function(){this.maps=null};D2t=C4t;function C4t(e){this.maps=e}S4t.prototype.renderLegend=function(){this.legendRenderingCollections=[],this.legendCollection=[],this.totalPages=[],this.widthIncrement=0,this.heightIncrement=0,this.defsElement=this.maps.renderer.createDefs(),this.maps.svgObject.appendChild(this.defsElement),this.initialMapAreaRect=this.maps.mapAreaRect,this.calculateLegendBounds(),this.drawLegend()},S4t.prototype.calculateLegendBounds=function(){var p=this,e=this.maps,c=e.legendSettings,t=(this.legendCollection=[],e.mapAreaRect.y);if(this.legendRenderingCollections=[],Array.prototype.forEach.call(e.layersCollection,function(e,t){if(!je(e.shapeData)){var i=e.shapeData.features,n=e.shapeDataPath,o=e.shapePropertyPath,r=e.dataSource,s=void 0,a=void 0;if("Layers"===c.type&&e.visible)s=e.shapeSettings.colorValuePath,a=e.shapeSettings.colorMapping,p.getLegends(t,i,a,r,n,s,o);else if("Bubbles"===c.type)for(var l=0,h=e.bubbleSettings;l<h.length;l++){var d=h[l];d.visible&&(s=d.colorValuePath,a=d.colorMapping,r=d.dataSource,p.getLegends(t,i,a,r,n,s,o))}}"Markers"===c.type&&p.getMarkersLegendCollections(t,e.markerSettings)}),0<this.legendCollection.length)for(var i=0;i<this.legendCollection.length;i++){var n=this.legendCollection[i],o={name:t4t,cancel:!1,fill:n.fill,shape:c.shape,shapeBorder:c.shapeBorder,text:"number"==typeof n.text?n.text.toString():n.text};e.trigger("legendRendering",o),n.fill=o.fill,n.shape=o.shape,n.shapeBorder=o.shapeBorder,n.text=o.text,o.cancel&&(this.legendCollection.splice(i,1),i--)}var r=e.legendSettings.title.text,O=e.legendSettings.titleStyle;if(0<this.legendCollection.length){var s,N,V,_=c.mode,a=0,l=0,h=c.shapePadding,d=c.shapeHeight,u=c.shapeWidth,g=[],m=[],f=c.position,H=c.labelDisplayMode,y="None"===c.orientation?"Top"===f||"Bottom"===f?"Horizontal":"Vertical":c.orientation,v=1<c.width.length?-1<c.width.indexOf("%")?e.availableSize.width/100*parseInt(c.width,10):parseInt(c.width,10):null,b=1<c.height.length?-1<c.height.indexOf("%")?e.availableSize.height/100*parseInt(c.height,10):parseInt(c.height,10):null,w=0,C=0,z=AHt(r,O);if("Interactive"===_){for(var j=c.textStyle,f=this.legendCollection.length,S="Horizontal"===y?je(v)?e.mapAreaRect.width/f:v/f:je(v)?25:v,A="Horizontal"===y?je(b)?25:b:je(b)?e.mapAreaRect.height/f:b/f,x=(C=z.height+10,c.labelPosition),I=w=0,W=0,T=0,E=0,D=0,Q=0,i=0;i<this.legendCollection.length;i++){var w="Horizontal"===y?w+S:w,C="Horizontal"===y?C:C+A,M=this.legendCollection[i].text,k=new eHt(0,0);if("None"===H?k=AHt(M,j):"Trim"===H?k=AHt(M=Azt("Horizontal"===y?S:A,M,j),j):M="","Left"===c.position||"Right"===c.position||"Float"===c.position)for(var U=0;U<this.legendCollection.length;U++){var P=AHt((n=this.legendCollection[U]).text,c.textStyle);this.textMaxWidth=Math.max(this.textMaxWidth,P.width)}D=Math.max(D,k.height),Q=Math.max(Q,k.width),0<k.width&&0<k.height&&(W="Horizontal"===y?(I=w+S/2,"After"===x?C+A+k.height/2+10:C-10):(I="After"===x?w-this.textMaxWidth/2-10:w+S+this.textMaxWidth/2+10,C+A/2+k.height/4)),0===i?(T="Horizontal"!==y&&"After"===x?I-this.textMaxWidth/2:w,E="Horizontal"!==y||"After"===x?C:W-k.height/2,1===this.legendCollection.length&&(v="Horizontal"===y?Math.abs(w+S-T):S+this.textMaxWidth+10,b="Horizontal"===y?A+D/2+10:Math.abs(C+A-E))):i===this.legendCollection.length-1&&(v="Horizontal"===y?Math.abs(w+S-T):S+this.textMaxWidth+10,b="Horizontal"===y?A+D/2+10:Math.abs(C+A-E)),this.legendRenderingCollections.push({fill:this.legendCollection[i].fill,x:w,y:C,width:S,height:A,text:M,textX:I,textY:W,textWidth:k.width,textHeight:k.height,shapeBorder:this.legendCollection[i].shapeBorder})}1===this.legendCollection.length&&(b=D+10,v=S),this.legendItemRect={x:T,y:E,width:v,height:b}}else{for(var v=je(v)?e.mapAreaRect.width:v,b=je(b)?e.mapAreaRect.height:b,B=0,i=this.page=0;i<this.legendCollection.length;i++){var F,L,R,n=this.legendCollection[i],P=(je(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]}),AHt(n.text,c.textStyle));this.textMaxWidth=Math.max(this.textMaxWidth,P.width),0===i?(w=a=10+u/2,C=l=t+z.height+(d>P.height?d/2:P.height/4)):(F=P.height>d?P.height:d,"Horizontal"===y?l=(R=m[B-1].x+m[B-1].width+10+u)+h+P.width>v?b<(L=(m[B-1].y>g[B-1].y+d/2?m[B-1].y:g[B-1].y+d/2)+t)+F?(this.getPageChanged(),B=0,g=[],m=[],a=w,C):(a=g[0].x,L+F/2):(a=R-u/2,g[B-1].y):b<(L=m[B-1].y>g[B-1].y+d/2?m[B-1].y:g[B-1].y+d/2)+t+F?(R=m[B-1].x+this.textMaxWidth+10)+h+P.width>v?(a=w,l=C,m=[],g=[],this.getPageChanged(),B=0):(a=R+u/2,l=g[0].y):(a=g[B-1].x,l=L+10+d/2)),F=a+u/2+h,s=l+P.height/4,g.push({x:a,y:l}),m.push({x:F,y:s,width:P.width,height:P.height/2}),this.totalPages[this.page].Collection.push({DisplayText:n.text,ImageSrc:n.imageSrc,Shape:{x:a,y:l},Text:{x:F,y:s},Fill:n.fill,legendShape:n.shape,shapeBorder:n.shapeBorder,idIndex:i,Rect:{x:g[B].x-u/2,y:g[B].y-d/2<s-P.height?g[B].y-d/2:s-P.height,width:Math.abs(g[B].x-u/2-(F+P.width)),height:d>P.height?d:P.height}}),B++}r=this.totalPages[0].Collection;Array.prototype.forEach.call(r,function(e,t){e=new WHt(e.Rect.x,e.Rect.y,e.Rect.width,e.Rect.height);0===t&&(N=e.x,V=e.y),p.widthIncrement=Math.max(p.widthIncrement,Math.abs(N-(e.x+e.width))),p.heightIncrement=Math.max(p.heightIncrement,Math.abs(V-(e.y+e.height)))}),v=this.widthIncrement<v?this.widthIncrement:v,b=this.heightIncrement<b?this.heightIncrement:b,this.legendItemRect={x:r[0].Rect.x,y:r[0].Rect.y,width:v,height:b}}}},S4t.prototype.getLegends=function(e,t,i,n,o,r,s){this.getRangeLegendCollection(e,t,i,n,o,r,s),this.getEqualLegendCollection(e,t,i,n,o,r,s),this.getDataLegendCollection(e,t,i,n,o,r,s)},S4t.prototype.getPageChanged=function(){this.page++,je(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]})},S4t.prototype.legendTextTrim=function(e,t,i,n){var o=t,r=n-AHt(t,i).width;if(e<n)for(var s=t.length-1;0<=s;--s)if(r+AHt(o=t.substring(0,s)+"...",i).width<=e||o.length<4)return o=o.length<4?" ":o;return o},S4t.prototype.drawLegend=function(){var e=this.maps,t=e.legendSettings,i=e.renderer,n={size:t.textStyle.size,color:t.textStyle.color,fontFamily:t.textStyle.fontFamily,fontWeight:t.textStyle.fontWeight,fontStyle:t.textStyle.fontStyle,opacity:t.textStyle.opacity};if(this.legendGroup=i.createGroup({id:e.element.id+"_Legend_Group"}),"Interactive"===t.mode)for(var o=0;o<this.legendRenderingCollections.length;o++){var r=e.element.id+"_Legend_Index_"+o,s=e.element.id+"_Legend_Index_"+o+"_Text",a=this.legendRenderingCollections[o],l=new WHt(a.x,a.y,a.width,a.height),h=(0===o&&this.renderLegendBorder(),new wHt(a.textX,a.textY)),r=(n.color=null!==n.color?n.color:this.maps.themeStyle.legendTextColor,new MHt(r,a.fill,a.shapeBorder,t.opacity,l)),l=new THt(s,h.x,h.y,"middle",a.text,"",""),s=(n.fontFamily=(je(n.fontFamily)?this.maps.themeStyle:n).fontFamily,n.size=n.size||e.themeStyle.legendFontSize,QHt(l,n,n.color,this.legendGroup)),h=(s.setAttribute("aria-label",a.text),s.setAttribute("role","region"),i.drawRectangle(r));this.legendGroup.appendChild(h),!e.legendSettings.toggleLegendSettings.enable||"Layers"!==t.type&&"Markers"!==t.type||this.maintainLegendToggle(o,h,s),this.legendToggle()}else this.drawLegendItem(this.currentPage)},S4t.prototype.drawLegendItem=function(e){var t=this.maps,i=t.legendSettings,n=new eHt(i.shapeWidth,i.shapeHeight),o=t.renderer,r=i.shape;if(0<=e&&e<this.totalPages.length){Vzt(this.legendGroup.id,this.maps.element.id)&&ue(Vzt(this.legendGroup.id,this.maps.element.id));for(var s=0;s<this.totalPages[e].Collection.length;s++){var a,l,h=this.totalPages[e].Collection[s],d=h.shapeBorder,p=o.createGroup({id:t.element.id+"_Legend_Index_"+h.idIndex}),c=h.DisplayText,u="HorizontalLine"===i.shape||"VerticalLine"===i.shape||"Cross"===i.shape?je(i.fill)?"#000000":i.fill:d.color,g=("HorizontalLine"===i.shape||"VerticalLine"===i.shape||"Cross"===i.shape)&&0===d.width?1:d.width,m=t.element.id+"_Legend_Shape_Index_"+h.idIndex,f=t.element.id+"_Legend_Text_Index_"+h.idIndex,y=new wHt(h.Shape.x,h.Shape.y-4),v=new wHt(h.Text.x,h.Text.y-4),m=new EHt(m,h.Fill,g,u,i.opacity,(je(d.opacity)?i:d).opacity,""),g={fontFamily:i.textStyle.fontFamily,fontStyle:i.textStyle.fontStyle,fontWeight:i.textStyle.fontWeight,size:i.textStyle.size,color:i.textStyle.color,opacity:i.textStyle.opacity},u=(g.color=null!==g.color?g.color:this.maps.themeStyle.legendTextColor,g.fontFamily=(je(g.fontFamily)?this.maps.themeStyle:g).fontFamily,g.size=g.size||t.themeStyle.legendFontSize,g.fontWeight=g.fontWeight||t.themeStyle.fontWeight,0===s&&this.renderLegendBorder(),"Markers"===i.type&&i.useMarkerShape&&(u=this.legendCollection[h.idIndex].data[0],r=je((d=t.layers[u.layerIndex].markerSettings[u.markerIndex]).dataSource[u.dataIndex][d.shapeValuePath])||""===d.dataSource[u.dataIndex][d.shapeValuePath]?d.shape:d.dataSource[u.dataIndex][d.shapeValuePath]),"Balloon"===r?p.appendChild(fzt(t,m,n,{x:y.x,y:y.y+5},"Legend")):p.appendChild(Kzt(y,r,n,h.ImageSrc,m)),h.Rect.x+h.Rect.width),d=(u>this.legendBorderRect.width&&(c=this.legendTextTrim(this.legendBorderRect.width,c,g,u)),QHt(new THt(f,v.x,v.y,"start",c,"",""),g,g.color,p));d.setAttribute("aria-label",c),d.setAttribute("role","region"),this.legendGroup.appendChild(p),!t.legendSettings.toggleLegendSettings.enable||"Layers"!==i.type&&"Markers"!==i.type||(y=p.childNodes[0],this.maintainLegendToggle(h.idIndex,y,d)),s===this.totalPages[e].Collection.length-1&&(m=void 0,0!==this.page&&(v=AHt(u=e+1+"/"+this.totalPages.length,f=i.textStyle),g=this.legendItemRect.x+this.legendItemRect.width-v.width-20-20+2,p=(c=this.legendItemRect.x+this.legendItemRect.width)-10-v.width/2-5-4,h=this.legendItemRect.y+this.legendItemRect.height+2.5+10,m=o.createGroup({id:t.element.id+"_Legend_Paging_Group"}),y=o.createGroup({id:t.element.id+"_Legend_Left_Paging_Group"}),d=o.createGroup({id:t.element.id+"_Legend_Right_Paging_Group"}),a=" M "+c+" "+h+" L "+(c-10)+" "+(h-5)+" L "+(c-10)+" "+(h+5)+" z ",l=new EHt(t.element.id+"_Left_Page",this.maps.themeStyle.legendTextColor,0,this.maps.themeStyle.legendTextColor,e+1===1?.5:1,1,""," M "+g+" "+h+" L "+(10+g)+" "+(h-5)+" L "+(10+g)+" "+(h+5)+" z "),y.appendChild(o.drawPath(l)),l=new MHt(t.element.id+"_Left_Page_Rect","transparent",{},1,new WHt(g-5,h-10,20,20),null,null,"",""),(g=o.drawRectangle(l)).setAttribute("aria-label","Navigate to the previous legend items"),g.setAttribute("role","button"),g.tabIndex=e+1===1?-1:t.tabIndex,e+1===1?(g.style.cursor="default",g.style.setProperty("outline","none")):(g.style.cursor="pointer",g.style.removeProperty("outline")),y.appendChild(g),this.wireEvents(y),l=new EHt(t.element.id+"_Right_Page",this.maps.themeStyle.legendTextColor,0,this.maps.themeStyle.legendTextColor,e+1===this.totalPages.length?.5:1,1,"",a),d.appendChild(o.drawPath(l)),a=new MHt(t.element.id+"_Right_Page_Rect","transparent",{},1,new WHt(c-10-5,h-10,20,20),null,null,"",""),(g=o.drawRectangle(a)).setAttribute("aria-label","Navigate to the next legend items"),g.setAttribute("role","button"),g.tabIndex=e+1===this.totalPages.length?-1:t.tabIndex,e+1===this.totalPages.length?(g.style.cursor="default",g.style.setProperty("outline","none")):(g.style.cursor="pointer",g.style.removeProperty("outline")),d.appendChild(g),this.wireEvents(d),m.appendChild(y),m.appendChild(d),l={id:t.element.id+"_Paging_Text",x:p,y:h+v.height/4,fill:this.maps.themeStyle.legendTextColor,"font-size":"14px","font-style":f.fontStyle,"font-family":f.fontFamily,"font-weight":f.fontWeight,"text-anchor":"middle",transform:"",opacity:1,"dominant-baseline":""},(c=o.createText(l,u)).style.cssText="user-select: none;",c.setAttribute("aria-label",u),c.setAttribute("role","region"),m.appendChild(c),this.legendGroup.appendChild(m)),this.legendToggle())}}},S4t.prototype.maintainLegendToggle=function(e,t,i){var n;this.maps.legendSettings.toggleLegendSettings.enable&&!je(this.maps.toggledLegendId)&&-1<this.maps.toggledLegendId.indexOf(e)&&!je(this.maps.toggledElementId)&&0<this.maps.toggledElementId.length&&(e=this.legendCollection[e].data,this.maps.legendSettings.toggleLegendSettings.applyShapeSettings?(n=e[e.length-1].layerIndex,this.setToggleAttributes(i,t,this.maps.layers[n].shapeSettings.fill,this.maps.layers[n].shapeSettings.opacity,this.maps.layers[n].shapeSettings.border.color||this.maps.themeStyle.shapeBorderColor,je(this.maps.layers[n].shapeSettings.border.width)?0:this.maps.layers[n].shapeSettings.border.width,(je(this.maps.layers[n].shapeSettings.border.opacity)?this.maps.layers[n].shapeSettings:this.maps.layers[n].shapeSettings.border).opacity,this.maps.layers[n].shapeSettings.fill)):this.setToggleAttributes(i,t,this.maps.legendSettings.toggleLegendSettings.fill,this.maps.legendSettings.toggleLegendSettings.opacity,this.maps.legendSettings.toggleLegendSettings.border.color,this.maps.legendSettings.toggleLegendSettings.border.width,(je(this.maps.legendSettings.toggleLegendSettings.border.opacity)?this.maps.legendSettings.toggleLegendSettings:this.maps.legendSettings.toggleLegendSettings.border).opacity,this.maps.legendSettings.toggleLegendSettings.fill),e._isVisible=!1)},S4t.prototype.legendHighLightAndSelection=function(e,t){var i="Default"===this.maps.legendSettings.mode?document.getElementById(e.id.replace("Shape","Text")):document.getElementById(e.id+"_Text"),n=this.maps.legendModule.legendCollection,o=!je(n[0].data[0].layerIndex)&&this.maps.layers[n[0].data[0].layerIndex].selectionSettings.enableMultiSelect,r=0,s=!0,a=parseFloat(e.id.charAt(e.id.length-1)),l=(this.updateLegendElement(),this.maps.toggledLegendId.indexOf(a));if(this.maps.legendSettings.toggleLegendSettings.enable&&"highlight"===t&&-1!==l)return-1!==(l=this.getIndexofLegend(this.legendHighlightCollection,e))&&this.legendHighlightCollection.splice(l,1),this.removeLegendHighlightCollection(),null;if("selection"===t){if(this.shapeHighlightCollection=[],this.maps.shapeSelections||o||(this.removeAllSelections(),this.maps.shapeSelections=!0),0<this.maps.legendSelectionCollection.length&&(o||this.maps.shapeSelections))for(var h=0;h<this.maps.legendSelectionCollection.length;h++){if(e===this.maps.legendSelectionCollection[h].legendElement){this.maps.legendSelectionCollection[h].legendElement=e,s=!1,this.removeLegendSelectionCollection(this.maps.legendSelectionCollection[h].legendElement),this.maps.selectedLegendElementId.splice(this.maps.selectedLegendElementId.indexOf(a),1),this.maps.legendSelectionCollection.splice(h,1),this.maps.legendSelection=!(0<this.maps.legendSelectionCollection.length);break}if(!o)if(1<this.maps.legendSelectionCollection.length){for(var d=0;d<this.maps.legendSelectionCollection.length;d++)this.removeLegendSelectionCollection(this.maps.legendSelectionCollection[d].legendElement);this.maps.legendSelectionCollection=[]}else this.removeLegendSelectionCollection(this.maps.legendSelectionCollection[h].legendElement),this.maps.legendSelectionCollection.splice(h,1)}}else{if(0<this.maps.legendSelectionCollection.length)for(h=0;h<this.maps.legendSelectionCollection.length;h++){if((-1<e.id.indexOf("_Legend_Shape")||e.id.indexOf("_Legend_Index"))&&e===this.maps.legendSelectionCollection[h].legendElement){s=!1;break}this.removeLegendHighlightCollection()}this.removeLegendHighlightCollection()}if(s)for(var p=0;p<n.length;p++){var c="Interactive"===this.maps.legendSettings.mode?parseFloat(e.id.split("_Legend_Index_")[1]):parseFloat(e.id.split("_Legend_Shape_Index_")[1]);if(i.textContent===n[p].text&&0<n[p].data.length&&c===p){var u=this.maps.layers[n[p].data[0].layerIndex],c=void 0,g=void 0,m=void 0;if(je(u)||(c=("selection"===t?u.selectionSettings:u.highlightSettings).enable,g=void 0,g="selection"===t?u.selectionSettings:u.highlightSettings,m=n[p].data),c)for(var f=0;f<m.length;f++){var y=void 0,v=m[f].shapeIndex,b=m[f].layerIndex,w=m[f].dataIndex;if(null!==(y=-1===(C=m[f].pointIndex)?document.getElementById(this.maps.element.id+"_LayerIndex_"+b+"_shapeIndex_"+v+"_dataIndex_"+w):document.getElementById(this.maps.element.id+"_LayerIndex_"+b+"_shapeIndex_"+v+"_dataIndex_"+w+"_multiLine_"+C))){var C,S,A=!0;if(null!==this.maps.legendSelectionCollection)for(var x=0;x<this.maps.legendSelectionCollection.length;x++)if(this.maps.legendSelectionCollection[x].legendElement===e){A=!1;break}"highlight"===t&&A?(0===f&&(this.legendHighlightCollection=[],this.pushCollection(e,this.legendHighlightCollection,n[p],u.shapeSettings)),b=this.legendHighlightCollection.length,v=this.legendHighlightCollection[b-1].legendOldFill,this.legendHighlightCollection[b-1].MapShapeCollection.Elements.push(y),w=this.legendHighlightCollection[b-1].MapShapeCollection.Elements.length-1,C=y.getAttribute("fill"),S=y.getAttribute("fill-opacity"),this.legendHighlightCollection[b-1].shapeOldFillColor.push(C),this.legendHighlightCollection[b-1].shapeOldOpacity=S,C=this.legendHighlightCollection[b-1].shapeOldFillColor[w],S=this.legendHighlightCollection[b-1].shapeOldOpacity,this.shapePreviousColor=this.legendHighlightCollection[b-1].shapeOldFillColor,this.setColor(y,je(g.fill)?C:g.fill,je(g.opacity)?S:g.opacity.toString(),g.border.color,g.border.width.toString(),"highlight"),this.setColor(e,je(g.fill)?v:g.fill,je(g.opacity)?S:g.opacity.toString(),g.border.color,g.border.width.toString(),"highlight")):"selection"===t&&(this.legendHighlightCollection=[],this.maps.legendSelectionClass=g,0===f&&(this.pushCollection(e,this.maps.legendSelectionCollection,n[p],u.shapeSettings),o||0!==this.maps.selectedLegendElementId.length&&(this.maps.selectedLegendElementId=[]),this.maps.selectedLegendElementId.push(p)),r=this.maps.legendSelectionCollection.length,w=this.maps.legendSelectionCollection[r-1].legendOldFill,this.maps.legendSelectionCollection[r-1].MapShapeCollection.Elements.push(y),this.maps.legendSelectionCollection[r-1].shapeOldFillColor=this.shapePreviousColor,this.setColor(e,je(g.fill)?w:g.fill,g.opacity.toString(),g.border.color,g.border.width.toString(),"selection"),this.setColor(y,je(g.fill)?w:g.fill,g.opacity.toString(),g.border.color,g.border.width.toString(),"selection"),-1===this.maps.selectedElementId.indexOf(y.getAttribute("id"))&&this.maps.selectedElementId.push(y.getAttribute("id")),f===m.length-1)&&(this.maps.legendSelection=!1,this.removeLegend(this.maps.legendSelectionCollection))}}}}},S4t.prototype.setColor=function(e,t,i,n,o,r){var s=-1<e.parentElement.id.indexOf("LineString");"selection"===r?(pzt(s?"LineselectionMap":"ShapeselectionMap",s?"LineselectionMapStyle":"ShapeselectionMapStyle",s?"transparent":t,i,s?t:n,o,this.maps),e.setAttribute("class",s?"LineselectionMapStyle":"ShapeselectionMapStyle")):(e.setAttribute("fill",s?"transparent":t),e.setAttribute("fill-opacity",i),e.setAttribute("stroke",s?t:n),e.setAttribute("stroke-width",(Number(o)/this.maps.scale).toString()))},S4t.prototype.pushCollection=function(e,t,i,n){t.push({legendElement:e,legendOldFill:i.fill,legendOldOpacity:i.opacity,legendOldBorderColor:i.borderColor,legendOldBorderWidth:i.borderWidth,shapeOpacity:n.opacity,shapeOldBorderColor:n.border.color||this.maps.themeStyle.shapeBorderColor,shapeOldBorderWidth:n.border.width});e=t.length;t[e-1].MapShapeCollection={Elements:[]},t[e-1].shapeOldFillColor=[],t[e-1].shapeOldOpacity=null},S4t.prototype.removeLegend=function(e){for(var t=0;t<e.length;t++)for(var i=e[t],n=(this.setColor(i.legendElement,i.legendOldFill,i.legendOldOpacity,i.legendOldBorderColor,i.legendOldBorderWidth,"highlight"),i.MapShapeCollection.Elements.length),o=0;o<n;o++){var r=-1!==i.legendOldFill.indexOf("url")?i.shapeOldFillColor[o]:i.legendOldFill,s=je(i.shapeOldOpacity)?i.shapeOpacity:i.shapeOldOpacity;this.setColor(i.MapShapeCollection.Elements[o],r,s,i.shapeOldBorderColor,i.shapeOldBorderWidth,"highlight")}},S4t.prototype.removeLegendHighlightCollection=function(){0<this.legendHighlightCollection.length&&(this.removeLegend(this.legendHighlightCollection),this.legendHighlightCollection=[])},S4t.prototype.removeLegendSelectionCollection=function(e){if(0<this.maps.legendSelectionCollection.length){Wzt(e);for(var t=this.shapesOfLegend(e),i=t.length,n=0;n<i;n++){var o=Lzt(t[n]);"ShapeselectionMapStyle"!==o.getAttribute("class")&&"LineselectionMapStyle"!==o.getAttribute("class")||(Wzt(o),-1!==(o=this.maps.selectedElementId.indexOf(o.id))&&this.maps.selectedElementId.splice(o,1))}}},S4t.prototype.removeShapeHighlightCollection=function(){if(0<this.shapeHighlightCollection.length)for(var e=0;e<this.shapeHighlightCollection.length;e++){for(var t=this.shapeHighlightCollection[e],i=!0,n=0;n<this.maps.legendSelectionCollection.length;n++)this.maps.legendSelectionCollection[n].legendElement===t.legendElement&&(i=!1);i&&this.setColor(t.legendElement,t.legendOldFill,t.legendOldOpacity,t.legendOldBorderColor,t.legendOldBorderWidth,"highlight")}},S4t.prototype.shapeHighLightAndSelection=function(e,t,i,n,o){if(void 0!==t){this.updateLegendElement(),this.shapeToggled=!0;var r=this.maps.legendModule.legendCollection,s=this.legendIndexOnShape(t,o),a=this.shapeDataOnLegend(e),t=this.maps.toggledLegendId.indexOf(s.actualIndex);if(this.maps.legendSettings.toggleLegendSettings.enable&&-1!==t)return this.shapeToggled=!1,this.legendHighlightCollection=[],-1!==(t=this.getIndexofLegend(this.shapeHighlightCollection,a.LegendEle))&&this.shapeHighlightCollection.splice(t,1),this.removeShapeHighlightCollection(),null;if(void 0===s.currentIndex&&void 0===s.actualIndex)return this.removeShapeHighlightCollection(),null;if(void 0!==s.currentIndex||"selection"!==n||this.maps.layers[o].selectionSettings.enableMultiSelect||"ShapeselectionMapStyle"===e.getAttribute("class")||(this.maps.legendSelection=!1),"selection"!==n||this.maps.layers[o].selectionSettings.enableMultiSelect||this.maps.legendSelection||(this.removeAllSelections(),this.maps.legendSelection=!0),void 0===s.currentIndex){if("selection"===n&&void 0!==s.actualIndex){for(var l=0,h=0;h<a.Elements.length;h++)"ShapeselectionMapStyle"===a.Elements[h].getAttribute("class")&&l++;t=this.maps.selectedLegendElementId.indexOf(s.actualIndex);-1===t?(this.maps.selectedLegendElementId.push(s.actualIndex),this.maps.legendSelectionClass=i):l<=1&&("ShapeselectionMapStyle"===e.getAttribute("class")||"LineselectionMapStyle"===e.getAttribute("class"))&&(!this.maps.layers[o].selectionSettings.enableMultiSelect||l<=1&&("ShapeselectionMapStyle"===e.getAttribute("class")||"LineselectionMapStyle"===e.getAttribute("class")))&&this.maps.selectedLegendElementId.splice(t,1)}return this.removeShapeHighlightCollection(),null}var t=r[s.actualIndex].text,d=void 0,p=void 0,c=("Default"===this.maps.legendSettings.mode?void 0!==s.currentIndex&&(d=document.getElementById(this.maps.element.id+"_Legend_Text_Index_"+s.actualIndex).textContent,p=document.getElementById(this.maps.element.id+"_Legend_Shape_Index_"+s.actualIndex)):(d=document.getElementById(this.maps.element.id+"_Legend_Index_"+s.actualIndex+"_Text").textContent,p=document.getElementById(this.maps.element.id+"_Legend_Index_"+s.actualIndex)),this.oldShapeElement=a.LegendEle,this.maps.legendSelectionCollection.length);if(t===d){var u=!0;if(this.maps.legendSelectionCollection)for(h=0;h<this.maps.legendSelectionCollection.length;h++)if(this.maps.legendSelectionCollection[h].legendElement===a.LegendEle){u=!1;break}if("highlight"===n&&u){(void 0===(m=this.isTargetSelected(a,this.shapeHighlightCollection))||m&&!m.IsSelected)&&this.pushCollection(p,this.shapeHighlightCollection,r[s.actualIndex],this.maps.layers[o].shapeSettings);for(var g=0;g<this.shapeHighlightCollection.length;g++)a.LegendEle.id===this.shapeHighlightCollection[g].legendElement.id&&(this.shapeHighlightCollection[g].legendElement=a.LegendEle);if(0<c)for(g=0;g<c;g++){if(a.LegendEle===this.maps.legendSelectionCollection[g].legendElement){this.maps.legendSelectionCollection[g].legendElement=a.LegendEle,this.removeShapeHighlightCollection();break}g===c-1&&(this.removeShapeHighlightCollection(),this.setColor(p,je(i.fill)?p.getAttribute("fill"):i.fill,i.opacity.toString(),i.border.color,i.border.width.toString(),"highlight"))}else this.removeShapeHighlightCollection(),this.setColor(p,je(i.fill)?p.getAttribute("fill"):i.fill,je(i.opacity)?"1":i.opacity.toString(),i.border.color,i.border.width.toString(),"highlight")}else if("selection"===n){var m=this.isTargetSelected(a,this.maps.legendSelectionCollection);if(0<c)for(var f,y,g=0;g<this.maps.legendSelectionCollection.length;)a.LegendEle===this.maps.legendSelectionCollection[g].legendElement||i.enableMultiSelect?g++:(f=this.maps.legendSelectionCollection[g],y=this.maps.selectedLegendElementId.indexOf(s.actualIndex),this.maps.selectedLegendElementId.splice(y,1),this.maps.legendSelectionCollection.splice(g,1),Wzt(f.legendElement),this.maps.shapeSelections=!0,g=0);if(m&&m.IsSelected&&("ShapeselectionMapStyle"===e.getAttribute("class")||"LineselectionMapStyle"===e.getAttribute("class"))){var v=0;if(i.enableMultiSelect)for(h=0;h<a.Elements.length;h++)e.getAttribute("class")===a.Elements[h].getAttribute("class")&&v++;v<=1&&(i.enableMultiSelect||this.maps.legendSelection)&&(this.maps.selectedLegendElementId.splice(this.maps.selectedLegendElementId.indexOf(s.actualIndex),1),je(a.LegendEle)||Wzt(a.LegendEle),this.maps.legendSelectionCollection.splice(m.SelectionIndex,1),this.maps.shapeSelections=!0)}else{void 0!==m&&(!m||m.IsSelected)||je(p)||-1===(b=this.getIndexofLegend(this.maps.legendSelectionCollection,p))&&this.pushCollection(p,this.maps.legendSelectionCollection,r[s.actualIndex],this.maps.layers[o].shapeSettings);for(var b,w=!0,h=0;h<this.maps.selectedLegendElementId.length;h++)s.actualIndex===this.maps.selectedLegendElementId[h]&&(w=!1);w&&this.maps.selectedLegendElementId.push(s.actualIndex),this.maps.legendSelectionClass=i,this.removeLegend(this.shapeHighlightCollection),je(p)||(this.setColor(p,je(i.fill)?p.getAttribute("fill"):i.fill,je(i.opacity)?"1":i.opacity.toString(),i.border.color,i.border.width.toString(),"selection"),b=this.getIndexofLegend(this.maps.legendSelectionCollection,p),this.maps.legendSelectionCollection[b].MapShapeCollection.Elements.push(e)),this.maps.shapeSelections=!1}}else 0<document.getElementsByClassName("highlightMapStyle").length&&(this.removeShapeHighlightCollection(),Wzt(document.getElementsByClassName("highlightMapStyle")[0]))}}else this.removeShapeHighlightCollection()},S4t.prototype.isTargetSelected=function(e,t){for(var i,n=0;n<t.length;n++)je(e.LegendEle.getAttribute("id"))||e.LegendEle.getAttribute("id")!==t[n].legendElement.getAttribute("id")||(i={IsSelected:!0,SelectionIndex:n});return i},S4t.prototype.updateLegendElement=function(){for(var e=0;e<this.maps.legendSelectionCollection.length;e++)document.getElementById(this.maps.legendSelectionCollection[e].legendElement.id)&&(this.maps.legendSelectionCollection[e].legendElement=document.getElementById(this.maps.legendSelectionCollection[e].legendElement.id))},S4t.prototype.getIndexofLegend=function(e,t){return e.map(function(e){return e.legendElement}).indexOf(t)},S4t.prototype.removeAllSelections=function(){for(var e=0;e<this.maps.selectedElementId.length;e++)Wzt(i=document.getElementById(this.maps.selectedElementId[e]));for(var t=0;t<this.maps.selectedLegendElementId.length;t++){var i=("Interactive"===this.maps.legendSettings.mode?this.maps.element.id+"_Legend_Index_":this.maps.element.id+"_Legend_Shape_Index_")+this.maps.selectedLegendElementId[t];je(document.getElementById(i))||Wzt(document.getElementById(i))}this.maps.legendSelectionCollection=[],this.maps.selectedLegendElementId=[],this.maps.selectedElementId=[]},S4t.prototype.legendIndexOnShape=function(e,t){for(var i,n,o,r=e[this.maps.layers[t].shapeDataPath],s=this.maps.legendSettings.mode,a=this.maps.legendModule.legendCollection,l=("Default"===s&&!je(this.maps.legendModule.totalPages)&&0<this.maps.legendModule.totalPages.length&&(o=this.maps.legendModule.totalPages[this.maps.legendModule.currentPage].Collection),"Default"!==s||je(o)?1:o.length),h=0;h<a.length;h++){for(var d=a[h].data,p=0;p<l;p++)if("Default"!==s||a[h].text===o[p].DisplayText)for(var c=0;c<d.length;c++)r===d[c].name&&(i=p);for(c=0;c<d.length;c++)r===d[c].name&&(n=h)}return{currentIndex:i,actualIndex:n}},S4t.prototype.shapeDataOnLegend=function(e){for(var t=this.maps.legendModule.legendCollection,i=this.maps.legendSettings,n=0;n<t.length;n++){for(var o=t[n].data,r=!1,s=[],a={Elements:[]},l=0;l<o.length;l++){var h,d=void 0,p=o[l].shapeIndex,c=o[l].layerIndex,u=o[l].dataIndex;e===(d=-1===(h=o[l].pointIndex)?document.getElementById(this.maps.element.id+"_LayerIndex_"+c+"_shapeIndex_"+p+"_dataIndex_"+u):document.getElementById(this.maps.element.id+"_LayerIndex_"+c+"_shapeIndex_"+p+"_dataIndex_"+u+"_multiLine_"+h))&&(r=!0),s.push(d)}if(r)return je(a.LegendEle)&&(a.LegendEle="Default"===i.mode?document.getElementById(this.maps.element.id+"_Legend_Shape_Index_"+n):document.getElementById(this.maps.element.id+"_Legend_Index_"+n)),a.Elements=s,a}return null},S4t.prototype.shapesOfLegend=function(e){for(var e=parseFloat(e.id.charAt(e.id.length-1)),t=this.maps.legendModule.legendCollection[e].data,i=[],n=0;n<t.length;n++){var o,r=void 0,s=t[n].shapeIndex,a=t[n].layerIndex,l=t[n].dataIndex;je(r=-1===(o=t[n].pointIndex)?document.getElementById(this.maps.element.id+"_LayerIndex_"+a+"_shapeIndex_"+s+"_dataIndex_"+l):document.getElementById(this.maps.element.id+"_LayerIndex_"+a+"_shapeIndex_"+s+"_dataIndex_"+l+"_multiLine_"+o))||i.push(r.id)}return i},S4t.prototype.legendToggle=function(){var e=this.maps,t=e.legendSettings;if(this.maps.selectedLegendElementId)for(var i=0;i<this.maps.selectedLegendElementId.length;i++){var n="Interactive"===t.mode?this.maps.element.id+"_Legend_Index_":this.maps.element.id+"_Legend_Shape_Index_",o=e.svgObject.querySelector("#"+n+this.maps.selectedLegendElementId[i]);if(!je(o)){n=je(this.maps.legendSelectionClass.fill)?o.getAttribute("fill"):this.maps.legendSelectionClass.fill;this.setColor(o,n,this.maps.legendSelectionClass.opacity.toString(),this.maps.legendSelectionClass.border.color,this.maps.legendSelectionClass.border.width.toString(),"selection");for(var r=0;r<this.maps.legendSelectionCollection.length;r++)this.maps.legendSelectionCollection[r].legendElement.id===o.id&&(this.maps.legendSelectionCollection[r].legendElement=o);-1===this.getIndexofLegend(this.maps.legendSelectionCollection,o)&&(n=this.maps.legendModule.legendCollection[this.maps.selectedLegendElementId[i]].data[i].layerIndex,this.pushCollection(o,this.maps.legendSelectionCollection,this.maps.legendModule.legendCollection[this.maps.selectedLegendElementId[i]],this.maps.layers[n].shapeSettings))}}if(this.maps.toggledLegendId)for(i=0;i<this.maps.toggledLegendId.length;i++){var s="Interactive"===t.mode?"#"+this.maps.element.id+"_Legend_Index_"+this.maps.toggledLegendId[i]+"_Text":"#"+this.maps.element.id+"_Legend_Text_Index_"+this.maps.toggledLegendId[i],s=e.svgObject.querySelector(s),s=(je(s)||s.setAttribute("fill","#E5E5E5"),"Interactive"===t.mode?"#"+this.maps.element.id+"_Legend_Index_"+this.maps.toggledLegendId[i]:"#"+this.maps.element.id+"_Legend_Shape_Index_"+this.maps.toggledLegendId[i]),s=e.svgObject.querySelector(s);je(s)||s.setAttribute("fill","#E5E5E5")}},S4t.prototype.renderLegendBorder=function(){var e=this.maps,t=e.legendSettings,i=t.title.text,n={fontFamily:t.titleStyle.fontFamily,fontStyle:t.titleStyle.fontStyle,fontWeight:t.titleStyle.fontWeight,size:t.titleStyle.size,color:t.titleStyle.color,opacity:t.titleStyle.opacity},o=Azt(this.legendItemRect.width+20,i,n),r=AHt(o,n),s=(this.legendBorderRect=new WHt(this.legendItemRect.x-10,this.legendItemRect.y-10-r.height,this.legendItemRect.width+20,this.legendItemRect.height+20+r.height+("Interactive"!==t.mode&&0!==this.page?10:0)),{color:t.border.color||this.maps.themeStyle.legendBorderColor,opacity:t.border.opacity,width:t.border.width||this.maps.themeStyle.legendBorderWidth}),s=(s.opacity=je(s.opacity)?1:s.opacity,new MHt(e.element.id+"_Legend_Border",t.background,s,1,this.legendBorderRect,null,null,"",""));this.legendGroup.appendChild(e.renderer.drawRectangle(s)),this.getLegendAlignment(e,this.legendBorderRect.width,this.legendBorderRect.height,t),this.legendGroup.setAttribute("transform","translate( "+(this.translate.x+-this.legendBorderRect.x)+" "+(this.translate.y+-this.legendBorderRect.y)+" )"),"Float"!==t.position&&e.svgObject.appendChild(this.legendGroup),i&&(n.color=null!==n.color?n.color:this.maps.themeStyle.legendTitleFontColor,n.fontFamily=(je(n.fontFamily)?this.maps.themeStyle:n).fontFamily,n.size=je(n.size)?this.maps.themeStyle.subTitleFontSize||djt.legendTitleFont.size:n.size,n.fontWeight=je(n.fontWeight)?this.maps.themeStyle.titleFontWeight||djt.legendTitleFont.fontWeight:n.fontWeight,(s=QHt(new THt(e.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-r.height/2-5,"middle",o,""),n,n.color,this.legendGroup)).setAttribute("aria-label",i),s.setAttribute("role","region"))},S4t.prototype.changeNextPage=function(e){this.currentPage=-1<e.target.id.indexOf("_Left_Page_")?this.currentPage-1:this.currentPage+1,this.legendGroup=this.maps.renderer.createGroup({id:this.maps.element.id+"_Legend_Group"}),this.maps.mapAreaRect=this.initialMapAreaRect,this.drawLegendItem(this.currentPage),je(this.maps.legendModule)||"Float"!==this.maps.legendSettings.position||(this.maps.isTileMap?this.maps.mapLayerPanel.layerGroup:this.maps.svgObject).appendChild(this.maps.legendModule.legendGroup),Vzt(this.maps.element.id+"_Legend_Border",this.maps.element.id)&&(Vzt(this.maps.element.id+"_Legend_Border",this.maps.element.id).style.pointerEvents="none")},S4t.prototype.getLegendAlignment=function(e,t,i,n){var o,r,s=Pe({},e.mapAreaRect,void 0,!0),a=s.x,l=s.y,h=s.height,d=s.width,p=e.availableSize.width,c=e.availableSize.height,u=je(n.location.x)?0:"string"==typeof n.location.x&&-1<n.location.x.indexOf("%")?e.availableSize.width/100*parseFloat(n.location.x):"string"==typeof n.location.x?parseFloat(n.location.x):n.location.x,g=je(n.location.y)?0:"string"==typeof n.location.y&&-1<n.location.y.indexOf("%")?e.availableSize.height/100*parseFloat(n.location.y):"string"==typeof n.location.y?parseFloat(n.location.y):n.location.y;if("Float"===n.position)this.translate=e.isTileMap?new wHt(u,g+2.5):new wHt(u+e.mapAreaRect.x,g+e.mapAreaRect.y),this.legendTotalRect=e.mapAreaRect;else{switch(n.position){case"Top":case"Bottom":s.height="Top"===n.position?h-i:h-i-20,o=p/2-t/2,r="Top"===n.position?l:l+s.height,s.y="Top"===n.position?l+i+(e.isTileMap?5:10):l-5;break;case"Left":case"Right":s.width=d-t-e.mapAreaRect.x,o="Left"===n.position?a+5:a+s.width+10,r=c/2-i/2,s.x="Left"===n.position?a+t+10:a}switch(n.alignment){case"Near":"Top"===n.position||"Bottom"===n.position?o=s.x-("Interactive"===n.mode?10:0):r=s.y-(n.height&&n.width||"Interactive"!==n.mode?0:e.mapAreaRect.x);break;case"Far":"Top"===n.position||"Bottom"===n.position?o=p-t-("Interactive"===n.mode?0:10):r=c-i-("Default"===n.mode?10:0)}(n.height||n.width)&&"Interactive"!==n.mode?this.legendTotalRect=e.mapAreaRect=e.totalRect=s:(e.totalRect=null,(n.height||n.width)&&"Interactive"===n.mode&&(e.totalRect=s),this.legendTotalRect=e.mapAreaRect=s),"Left"===n.position&&(e.mapAreaRect.width=s.width),this.translate=new wHt(o,r)}},S4t.prototype.getMarkersLegendCollections=function(h,e){var d=this;Array.prototype.forEach.call(e,function(s,a){var e=s.dataSource,l=s.legendText;Array.prototype.forEach.call(e,function(e,t){var i,n=!!je(e[d.maps.legendSettings.showLegendPath])||e[d.maps.legendSettings.showLegendPath],o=!je(e.latitude)||!je(e.Latitude)||!je(e[s.latitudeValuePath]),r=!je(e.longitude)||!je(e.Longitude)||!je(e[s.longitudeValuePath]);s.visible&&n&&o&&r&&(s.template&&(je((o=Fzt(s.template,d.maps)(d.maps)).childElementCount)?o[0]:o).querySelector("img").src,r=je(e[l])?"":e[l],o=je(s.colorValuePath)?s.fill:e[s.colorValuePath],i=[],d.maps.legendSettings.removeDuplicateLegend?i.push(d.getMarkerLegendData(h,r,o)):i.push({layerIndex:h,markerIndex:a,dataIndex:t,value:o,name:r,shape:je(s.shapeValuePath)||je(e[s.shapeValuePath])||""===e[s.shapeValuePath]?(d.maps.legendSettings.useMarkerShape?s:d.maps.legendSettings).shape:e[s.shapeValuePath]}),d.getOverallLegendItemsCollection(r,o,i,n))})})},S4t.prototype.getMarkerLegendData=function(o,r,s){var a=this,l=[];return this.maps.layers[o].markerSettings.map(function(e,n){e=e.dataSource;Array.prototype.forEach.call(e,function(e,t){var i=a.maps.layers[o].markerSettings[n];r!==e[i.legendText]&&""!==r||s!==(e[i.colorValuePath]||i.fill)||l.push({layerIndex:o,markerIndex:n,dataIndex:t,value:s,name:r,shape:je(i.shapeValuePath)?i.shape:e[i.shapeValuePath]})})}),l},S4t.prototype.getRangeLegendCollection=function(r,s,e,t,a,l,h){for(var i,d=this,p=0,c=this.maps.legendSettings.fill,u=[],g=this,n=0,o=e;n<o.length;n++)!function(n){var o,e;je(n.from)||je(n.to)||(i=je(n.label)?n.from+" - "+n.to:n.label,o=!(u=[]),!je(t)&&0<t.length&&Array.prototype.forEach.call(t,function(e,t){var i=-1<l.indexOf(".")?Number(KHt(e,l)):parseFloat(e[l]);i>=n.from&&i<=n.to&&(o=!0,u.push(d.getLegendData(r,t,e,a,s,h,i)))}),o||u.push({layerIndex:r,shapeIndex:null,dataIndex:null,name:null,value:null}),e=je(c)?"[object Array]"===Object.prototype.toString.call(n.color)?je(n.value)?g.legendGradientColor(n,p):n.color[0]:n.color:c,p++,g.getOverallLegendItemsCollection(i,e,u,n.showLegend))}(o[n])},S4t.prototype.getOverallLegendItemsCollection=function(e,t,i,n){var o=[],r=this.maps.legendSettings;if(0<i.length&&n){for(var s=0;s<i.length;s++){var a=i[s];if(0<a.length)for(var l=0;l<a.length;l++)o.push(a[l]);else o.push(i[s]);o._isVisible=!0}if(!!this.maps.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollection,e,t))for(s=0;s<this.legendCollection.length;s++)this.legendCollection[s].text===e&&this.legendCollection[s].fill===t&&this.legendCollection[s].data.push(o[0]);else this.legendCollection.push({text:e,fill:t,data:o,opacity:r.opacity,borderColor:r.shapeBorder.color,borderWidth:r.shapeBorder.width})}},S4t.prototype.removeDuplicates=function(e,t,i){for(var n=!1,o=0;o<e.length;o++)if((e[o].text===t||""===e[o].text)&&e[o].fill===i){n=!0;break}return n},S4t.prototype.getEqualLegendCollection=function(a,l,h,d,p,c,u){for(var g,m=this,f=this.maps.legendSettings.fill,y=[],v=[],b=[],w=[],C=this,e=0,t=h;e<t.length;e++)!function(n){if(je(n.value)){var o;je(n.minOpacity)&&je(n.maxOpacity)&&je(n.value)&&je(n.from)&&je(n.to)&&!je(n.color)&&(Array.prototype.forEach.call(d,function(e,t){for(var i=-1<c.indexOf(".")?KHt(e,c):e[c],n=0;n<b.length;n++)i===b[n]&&w.push(m.getLegendData(a,t,e,p,l,u,i))}),0===b.length&&(o=!1,Array.prototype.forEach.call(d,function(e,t){o=!1;for(var i=e[c],n=0;n<h.length;n++)je(i)||isNaN(i)?o=o||!1:i>=h[n].from&&i<=h[n].to&&(o=!0);o||w.push(m.getLegendData(a,t,e,p,l,u,i))})),g=je(n.label)?"Others":n.label,s="[object Array]"===Object.prototype.toString.call(n.color)?n.color[0]:n.color,C.getOverallLegendItemsCollection(g,s,w,n.showLegend))}else{g=je(n.label)?n.value:n.label;var r=!(v=[]);!je(d)&&0<d.length&&Array.prototype.forEach.call(d,function(e,t){var i=c&&-1<c.indexOf(".")?KHt(e,c):e[c];i===n.value?(r=!0,-1===y.indexOf(i)&&y.push(i),v.push(m.getLegendData(a,t,e,p,l,u,i))):-1===b.indexOf(i)&&b.push(i)});for(var e=0;e<y.length;e++)for(var t,i=0;i<b.length;i++)y[e]===b[i]&&(t=b.indexOf(y[e]),b.splice(t,1));r||v.push({layerIndex:a,shapeIndex:null,dataIndex:null,name:null,value:null});var s=je(f)?"[object Array]"===Object.prototype.toString.call(n.color)?n.color[0]:n.color:f;C.getOverallLegendItemsCollection(g,s,v,n.showLegend)}}(t[e])},S4t.prototype.getDataLegendCollection=function(s,a,l,e,h,d,p){var c,u=this,g=this.maps.legendSettings.fill,m=this.maps.legendSettings.valuePath;je(d)||je(e)||Array.prototype.forEach.call(e,function(e,t){var i=!!je(u.maps.legendSettings.showLegendPath)||!je(e[u.maps.legendSettings.showLegendPath])&&e[u.maps.legendSettings.showLegendPath],n=-1<d.indexOf(".")?KHt(e,d):e[d],o=[],r=je(g)?n:g;je(n)||0!==l.length||je(m)&&je(h)||(c=je(e[m])?-1<h.indexOf(".")?KHt(e,h):e[h]:-1<m.indexOf(".")?KHt(e,m):e[m],o.push(u.getLegendData(s,t,e,h,a,p,n))),u.getOverallLegendItemsCollection(c,r,o,i)})},S4t.prototype.interactiveHandler=function(e){var e=e.target,i=this.maps.legendSettings,n=this.maps.element.id+"_Interactive_Legend",t="Layers"===i.type?"_shapeIndex_":"Markers"===i.type?"_MarkerIndex_":"_BubbleIndex_";if(1<e.id.indexOf(t)){var o=parseFloat(e.id.split("_LayerIndex_")[1].split("_")[0]),r=parseFloat(e.id.split(/_dataIndex_/i)[1].split("_")[0]),s=void 0,a=void 0,l=void 0,t=(je(Vzt(n,this.maps.element.id))||ue(Vzt(n,this.maps.element.id)),this.maps.layersCollection[o]),t="Layers"===i.type?t.visible:"Markers"===i.type?t.markerSettings[parseFloat(e.id.split("_MarkerIndex_")[1].split("_")[0])].visible:this.maps.getBubbleVisible(this.maps.layersCollection[o]);if(i.visible&&0<this.legendRenderingCollections.length&&"Interactive"===i.mode&&t)for(var h=this.maps.svgObject.getBoundingClientRect(),d=0;d<this.legendCollection.length;d++){var p=this.legendCollection[d],c=Vzt(this.maps.element.id+"_Legend_Index_"+d,this.maps.element.id),u=c.getBoundingClientRect(),g=new WHt(Math.abs(u.left-h.left),Math.abs(u.top-h.top),u.width,u.height),s=c.getAttribute("fill"),a=i.shapeBorder.color,l=i.shapeBorder.width;if(!je(p.data))for(var m=p.data,f=this,y=0;y<m.length;y++)if("break"===function(e){var t;if(r===m[e].dataIndex&&o===m[e].layerIndex)return f.renderInteractivePointer(i,s,a,n,l,g),t=Vzt(n,f.maps.element.id),f.maps.isDevice&&!je(t)&&(clearTimeout(f.arrowTimer),f.arrowTimer=setTimeout(function(){je(t.parentNode)||ue(t)},2e3)),"break"}(y))break}}else je(Vzt(n,this.maps.element.id))||ue(Vzt(n,this.maps.element.id))},S4t.prototype.renderInteractivePointer=function(e,t,i,n,o,r){var s,a,l="None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation,r=(r.y="Float"===e.position&&this.maps.isTileMap?r.y-this.maps.mapAreaRect.y:r.y,l="Horizontal"===l?e.invertedPointer?" M "+(s=r.x+r.width/2-("Float"===e.position&&this.maps.isTileMap?this.maps.mapAreaRect.x:0))+" "+(a=r.y+r.height)+" L "+(s-10)+" "+(a+10)+" L "+(s+10)+" "+(a+10)+" Z ":" M "+(s=r.x+r.width/2-("Float"===e.position&&this.maps.isTileMap?this.maps.mapAreaRect.x:0))+" "+(a=r.y)+" L "+(s-10)+" "+(a-10)+" L "+(s+10)+" "+(a-10)+" Z ":e.invertedPointer?" M "+(s=r.x-("Float"===e.position&&this.maps.isTileMap?this.maps.mapAreaRect.x:0))+" "+(a=r.y+r.height/2)+" L "+(s-10)+" "+(a-10)+" L "+(s-10)+" "+(a+10)+" z ":" M "+(s=r.x+r.width-("Float"===e.position&&this.maps.isTileMap?this.maps.mapAreaRect.x:0))+" "+(a=r.y+r.height/2)+" L "+(s+10)+" "+(a-10)+" L "+(s+10)+" "+(a+10)+" z ",new EHt(n,t,o,i,1,1,"",l));("Float"===e.position&&this.maps.isTileMap?this.maps.mapLayerPanel.layerGroup:this.maps.svgObject).appendChild(this.maps.renderer.drawPath(r))},S4t.prototype.wireEvents=function(e){E.add(e,F.touchStartEvent,this.changeNextPage,this)},S4t.prototype.addEventListener=function(){this.maps.isDestroyed||(this.maps.on(F.touchMoveEvent,this.interactiveHandler,this),this.maps.on(F.touchEndEvent,this.interactiveHandler,this),this.maps.on(L3t,this.legendClick,this))},S4t.prototype.markerToggleSelection=function(e,t,i,n){e.setAttribute("fill",this.legendCollection[n].fill),e.setAttribute("stroke",this.maps.layers[t].markerSettings[i].border.color),e.setAttribute("fill-opacity",this.maps.layers[t].markerSettings[i].opacity.toString()),e.setAttribute("stroke-width",this.maps.layers[t].markerSettings[i].border.width.toString()),e.setAttribute("stroke-opacity",(je(this.maps.layers[t].markerSettings[i].border.opacity)?this.maps.layers[t].markerSettings[i]:this.maps.layers[t].markerSettings[i].border).opacity.toString());n=this.maps.toggledElementId.indexOf(e.id);-1!==n&&this.maps.toggledElementId.splice(n,1)},S4t.prototype.bubbleToggleSelection=function(e,t,i,n){e.setAttribute("fill",this.legendCollection[n].fill),e.setAttribute("stroke",this.maps.layers[t].bubbleSettings[i].border.color),e.setAttribute("fill-opacity",this.maps.layers[t].bubbleSettings[i].opacity.toString()),e.setAttribute("stroke-width",this.maps.layers[t].bubbleSettings[i].border.width.toString()),e.setAttribute("stroke-opacity",(je(this.maps.layers[t].bubbleSettings[i].border.opacity)?this.maps.layers[t].bubbleSettings[i]:this.maps.layers[t].bubbleSettings[i].border).opacity.toString())},S4t.prototype.legendClick=function(e){var t,i,n=this.maps.legendSettings.toggleLegendSettings.fill,o=this.maps.legendSettings.toggleLegendSettings.opacity,r=this.maps.legendSettings.toggleLegendSettings.border.color,s=this.maps.legendSettings.toggleLegendSettings.border.width,a=(je(this.maps.legendSettings.toggleLegendSettings.border.opacity)?this.maps.legendSettings.toggleLegendSettings:this.maps.legendSettings.toggleLegendSettings.border).opacity;if(!je(e.parentNode)&&-1<e.parentNode.id.indexOf(this.maps.element.id+"_Legend_Index_")){var l=void 0,h=parseFloat(e.parentElement.id.substr((this.maps.element.id+"_Legend_Index_").length)),d=(y=this.legendCollection[h].data)._isVisible,p=void 0;if(this.maps.legendSettings.toggleLegendSettings.enable&&("Bubbles"===this.maps.legendSettings.type||"Markers"===this.maps.legendSettings.type))for(var c=0;c<this.maps.layers.length;c++)for(var u=0;u<("Bubbles"===this.maps.legendSettings.type?this.maps.layers[c].bubbleSettings:this.maps.layers[c].markerSettings).length;u++){for(var g=0;g<y.length;g++){p=this.legendCollection[h].data[g],l="Bubbles"===this.maps.legendSettings.type?Vzt(this.maps.element.id+"_LayerIndex_"+p.layerIndex+"_BubbleIndex_"+u+"_dataIndex_"+p.dataIndex,this.maps.element.id):Vzt(this.maps.element.id+"_LayerIndex_"+p.layerIndex+"_MarkerIndex_"+p.markerIndex+"_dataIndex_"+p.dataIndex,this.maps.element.id),je(p.shape)||"Balloon"!==p.shape||(l=(l="Bubbles"===this.maps.legendSettings.type?Vzt(this.maps.element.id+"_LayerIndex_"+p.layerIndex+"_BubbleIndex_"+u+"_dataIndex_"+p.dataIndex+"_Group",this.maps.element.id):Vzt(this.maps.element.id+"_LayerIndex_"+p.layerIndex+"_MarkerIndex_"+p.markerIndex+"_dataIndex_"+p.dataIndex+"_Group",this.maps.element.id)).children[0]);var m=this.maps.toggledLegendId.indexOf(h);d&&null!==l?(this.maps.legendSettings.toggleLegendSettings.applyShapeSettings?(l.setAttribute("fill",this.maps.layers[c].shapeSettings.fill),l.setAttribute("stroke",this.maps.layers[c].shapeSettings.border.color||this.maps.themeStyle.shapeBorderColor),l.setAttribute("fill-opacity",this.maps.layers[c].shapeSettings.opacity.toString()),l.setAttribute("stroke-width",(je(this.maps.layers[c].shapeSettings.border.width)?0:this.maps.layers[c].shapeSettings.border.width).toString()),l.setAttribute("stroke-opacity",(je(this.maps.layers[c].shapeSettings.border.opacity)?this.maps.layers[c].shapeSettings:this.maps.layers[c].shapeSettings.border).opacity.toString())):(l.setAttribute("fill",n),l.setAttribute("fill-opacity",o.toString()),l.setAttribute("stroke",r),l.setAttribute("stroke-width",s.toString()),l.setAttribute("stroke-opacity",a.toString())),"Markers"===this.maps.legendSettings.type&&(-1===m&&this.maps.toggledLegendId.push(h),-1===this.maps.toggledElementId.indexOf(l.id))&&this.maps.toggledElementId.push(l.id),null!==e&&(t=Vzt(this.maps.element.id+"_Legend_Shape_Index_"+h,this.maps.element.id),i=Vzt(this.maps.element.id+"_Legend_Text_Index_"+h,this.maps.element.id),this.maps.legendSettings.toggleLegendSettings.applyShapeSettings?this.setToggleAttributes(i,t,this.maps.layers[c].shapeSettings.fill,this.maps.layers[c].shapeSettings.opacity,this.maps.layers[c].shapeSettings.border.color||this.maps.themeStyle.shapeBorderColor,je(this.maps.layers[c].shapeSettings.border.width)?0:this.maps.layers[c].shapeSettings.border.width,(je(this.maps.layers[c].shapeSettings.border.opacity)?this.maps.layers[c].shapeSettings:this.maps.layers[c].shapeSettings.border).opacity,this.maps.layers[c].shapeSettings.fill):this.setToggleAttributes(i,t,n,o,r,s,a,n))):("Markers"===this.maps.legendSettings.type?(-1!==m&&0===g&&this.maps.toggledLegendId.splice(m,1),this.markerToggleSelection(l,c,u,h)):this.bubbleToggleSelection(l,c,u,h),null!==e&&(t=Vzt(this.maps.element.id+"_Legend_Shape_Index_"+h,this.maps.element.id),i=Vzt(this.maps.element.id+"_Legend_Text_Index_"+h,this.maps.element.id),this.setToggleAttributes(i,t,this.legendCollection[h].fill,this.legendCollection[h].opacity,this.legendCollection[h].shapeBorder.color,this.legendCollection[h].shapeBorder.width,this.legendCollection[h].shapeBorder.opacity,this.maps.legendSettings.textStyle.color),"HorizontalLine"!==this.maps.legendSettings.shape&&"VerticalLine"!==this.maps.legendSettings.shape&&"Cross"!==this.maps.legendSettings.shape||t.setAttribute("stroke",this.legendCollection[h].fill)))}y._isVisible=!d}if("Layers"===this.maps.legendSettings.type&&this.maps.legendSettings.toggleLegendSettings.enable){var f=void 0;this.removeCollections(e,h),-1!==(m=this.maps.toggledLegendId.indexOf(h))&&(d=!1);for(u=0;u<this.maps.layers.length;u++)for(g=0;g<y.length;g++){p=this.legendCollection[h].data[g];null!==(f=Vzt(this.maps.element.id+"_LayerIndex_"+p.layerIndex+"_shapeIndex_"+p.shapeIndex+"_dataIndex_"+p.dataIndex,this.maps.element.id))&&(S=this.maps.toggledElementId.indexOf(f.id),d?(0===g&&this.maps.toggledLegendId.push(h),-1===S&&this.maps.toggledElementId.push(f.id),this.maps.legendSettings.toggleLegendSettings.applyShapeSettings?(f.setAttribute("fill",this.maps.layers[u].shapeSettings.fill),f.setAttribute("fill-opacity",this.maps.layers[u].shapeSettings.opacity.toString()),f.setAttribute("stroke",this.maps.layers[u].shapeSettings.border.color||this.maps.themeStyle.shapeBorderColor),f.setAttribute("stroke-width",(je(this.maps.layers[u].shapeSettings.border.width)?0:this.maps.layers[u].shapeSettings.border.width).toString()),f.setAttribute("stroke-opacity",(je(this.maps.layers[u].shapeSettings.border.opacity)?this.maps.layers[u].shapeSettings:this.maps.layers[u].shapeSettings.border).opacity.toString())):(f.setAttribute("fill",n),f.setAttribute("fill-opacity",o.toString()),f.setAttribute("stroke",r),f.setAttribute("stroke-width",s.toString()),f.setAttribute("stroke-opacity",a.toString())),null!==e&&(i=Vzt(this.maps.element.id+"_Legend_Text_Index_"+h,this.maps.element.id),t=Vzt(this.maps.element.id+"_Legend_Shape_Index_"+h,this.maps.element.id),this.maps.legendSettings.toggleLegendSettings.applyShapeSettings?this.setToggleAttributes(i,t,this.maps.layers[u].shapeSettings.fill,this.maps.layers[u].shapeSettings.opacity,this.maps.layers[u].shapeSettings.border.color||this.maps.themeStyle.shapeBorderColor,je(this.maps.layers[u].shapeSettings.border.width)?0:this.maps.layers[u].shapeSettings.border.width,(je(this.maps.layers[u].shapeSettings.border.opacity)?this.maps.layers[u].shapeSettings:this.maps.layers[u].shapeSettings.border).opacity,this.maps.layers[u].shapeSettings.fill):this.setToggleAttributes(i,t,n,o,r,s,a,n))):(-1!==m&&0===g&&this.maps.toggledLegendId.splice(m,1),-1!==S&&this.maps.toggledElementId.splice(S,1),f.setAttribute("fill",this.legendCollection[h].fill),f.setAttribute("stroke-opacity",(je(this.maps.layers[u].shapeSettings.border.opacity)?this.maps.layers[u].shapeSettings:this.maps.layers[u].shapeSettings.border).opacity.toString()),f.setAttribute("stroke-width",(je(this.maps.layers[u].shapeSettings.border.width)?0:this.maps.layers[u].shapeSettings.border.width).toString()),f.setAttribute("fill-opacity",this.maps.layers[u].shapeSettings.opacity.toString()),f.setAttribute("stroke",this.maps.layers[u].shapeSettings.border.color||this.maps.themeStyle.shapeBorderColor),null!==e&&(i=Vzt(this.maps.element.id+"_Legend_Text_Index_"+h,this.maps.element.id),t=Vzt(this.maps.element.id+"_Legend_Shape_Index_"+h,this.maps.element.id),this.setToggleAttributes(i,t,this.legendCollection[h].fill,this.legendCollection[h].opacity,this.legendCollection[h].shapeBorder.color,this.legendCollection[h].shapeBorder.width,this.legendCollection[h].shapeBorder.opacity,"#757575"))))}y._isVisible=!d}}else if(!je(e.id)&&(-1<e.id.indexOf(this.maps.element.id+"_Legend_Shape_Index")||-1!==e.id.indexOf(this.maps.element.id+"_Legend_Index"))&&this.maps.legendSettings.visible&&-1===e.id.indexOf("_Text")){var y,v=void 0,h=parseFloat(e.id.split(this.maps.element.id+"_Legend_Index_")[1]),b=void 0,d=(y=this.legendCollection[h].data)._isVisible;if(("Bubbles"===this.maps.legendSettings.type||"Markers"===this.maps.legendSettings.type)&&this.maps.legendSettings.toggleLegendSettings.enable)for(m=this.maps.toggledLegendId.indexOf(h),c=0;c<this.maps.layers.length;c++)for(u=0;u<("Bubbles"===this.maps.legendSettings.type?this.maps.layers[c].bubbleSettings:this.maps.layers[c].markerSettings).length;u++){for(g=0;g<y.length;g++){b=this.legendCollection[h].data[g],v="Bubbles"===this.maps.legendSettings.type?Vzt(this.maps.element.id+"_LayerIndex_"+b.layerIndex+"_BubbleIndex_"+u+"_dataIndex_"+b.dataIndex,this.maps.element.id):Vzt(this.maps.element.id+"_LayerIndex_"+b.layerIndex+"_MarkerIndex_"+u+"_dataIndex_"+b.dataIndex,this.maps.element.id);je(b.shape)||"Balloon"!==b.shape||(v=(v="Bubbles"===this.maps.legendSettings.type?Vzt(this.maps.element.id+"_LayerIndex_"+b.layerIndex+"_BubbleIndex_"+u+"_dataIndex_"+b.dataIndex+"_Group",this.maps.element.id):Vzt(this.maps.element.id+"_LayerIndex_"+b.layerIndex+"_MarkerIndex_"+u+"_dataIndex_"+b.dataIndex+"_Group",this.maps.element.id)).children[0]),d&&null!==v?("Markers"===this.maps.legendSettings.type&&(-1===m&&this.maps.toggledLegendId.push(h),-1===this.maps.toggledElementId.indexOf(v.id))&&this.maps.toggledElementId.push(v.id),this.maps.legendSettings.toggleLegendSettings.applyShapeSettings?(v.setAttribute("fill",this.maps.layers[c].shapeSettings.fill),v.setAttribute("stroke",this.maps.layers[c].shapeSettings.border.color||this.maps.themeStyle.shapeBorderColor),v.setAttribute("stroke-width",(je(this.maps.layers[c].shapeSettings.border.width)?0:this.maps.layers[c].shapeSettings.border.width).toString()),v.setAttribute("stroke-opacity",(je(this.maps.layers[c].shapeSettings.border.opacity)?this.maps.layers[c].shapeSettings:this.maps.layers[c].shapeSettings.border).opacity.toString()),v.setAttribute("fill-opacity",this.maps.layers[c].shapeSettings.opacity.toString())):(v.setAttribute("fill",n),v.setAttribute("fill-opacity",o.toString()),v.setAttribute("stroke",r),v.setAttribute("stroke-width",s.toString()),v.setAttribute("stroke-opacity",a.toString())),null!==e&&(i=Vzt(this.maps.element.id+"_Legend_Index_"+h+"_Text",this.maps.element.id),t=Vzt(this.maps.element.id+"_Legend_Index_"+h,this.maps.element.id),this.maps.legendSettings.toggleLegendSettings.applyShapeSettings?this.setToggleAttributes(i,t,this.maps.layers[c].shapeSettings.fill,this.maps.layers[c].shapeSettings.opacity,this.maps.layers[c].shapeSettings.border.color||this.maps.themeStyle.shapeBorderColor,je(this.maps.layers[c].shapeSettings.border.width)?0:this.maps.layers[c].shapeSettings.border.width,(je(this.maps.layers[c].shapeSettings.border.opacity)?this.maps.layers[c].shapeSettings:this.maps.layers[c].shapeSettings.border).opacity,this.maps.layers[c].shapeSettings.fill):this.setToggleAttributes(i,t,n,o,r,s,a,n))):("Markers"===this.maps.legendSettings.type?(-1!==m&&0===g&&this.maps.toggledLegendId.splice(m,1),this.markerToggleSelection(v,c,u,h)):this.bubbleToggleSelection(v,c,u,h),null!==e&&((t=Vzt(this.maps.element.id+"_Legend_Index_"+h,this.maps.element.id)).setAttribute("fill",this.legendCollection[h].fill),t.setAttribute("fill-opacity",this.legendCollection[h].opacity),t.setAttribute("stroke",this.legendCollection[h].shapeBorder.color),t.setAttribute("stroke-width",this.legendCollection[h].shapeBorder.width),t.setAttribute("stroke-opacity",this.legendCollection[h].shapeBorder.opacity),(i=Vzt(this.maps.element.id+"_Legend_Index_"+h+"_Text",this.maps.element.id)).setAttribute("fill",this.maps.legendSettings.textStyle.color)))}y._isVisible=!d}if("Layers"===this.maps.legendSettings.type&&this.maps.legendSettings.toggleLegendSettings.enable){var w=void 0,C=(this.removeCollections(e,h),this.maps.toggledLegendId.indexOf(h));-1!==C&&(d=!1);for(c=0;c<this.maps.layers.length;c++)for(var S,g=0;g<y.length;g++)b=this.legendCollection[h].data[g],null!==(w=Vzt(this.maps.element.id+"_LayerIndex_"+b.layerIndex+"_shapeIndex_"+b.shapeIndex+"_dataIndex_"+b.dataIndex,this.maps.element.id))&&(S=this.maps.toggledElementId.indexOf(w.id),d?(0===g&&this.maps.toggledLegendId.push(h),-1===S&&this.maps.toggledElementId.push(w.id),this.maps.legendSettings.toggleLegendSettings.applyShapeSettings?(w.setAttribute("fill",this.maps.layers[0].shapeSettings.fill),w.setAttribute("stroke",this.maps.layers[0].shapeSettings.border.color||this.maps.themeStyle.shapeBorderColor),w.setAttribute("fill-opacity",this.maps.layers[c].shapeSettings.opacity.toString()),w.setAttribute("stroke-width",(je(this.maps.layers[c].shapeSettings.border.width)?0:this.maps.layers[c].shapeSettings.border.width).toString()),w.setAttribute("stroke-opacity",(je(this.maps.layers[c].shapeSettings.border.opacity)?this.maps.layers[c].shapeSettings:this.maps.layers[c].shapeSettings.border).opacity.toString())):(w.setAttribute("fill",n),w.setAttribute("fill-opacity",o.toString()),w.setAttribute("stroke",r),w.setAttribute("stroke-width",s.toString()),w.setAttribute("stroke-opacity",a.toString())),null!==e&&(t=Vzt(this.maps.element.id+"_Legend_Index_"+h,this.maps.element.id),i=Vzt(this.maps.element.id+"_Legend_Index_"+h+"_Text",this.maps.element.id),this.maps.legendSettings.toggleLegendSettings.applyShapeSettings?this.setToggleAttributes(i,t,this.maps.layers[0].shapeSettings.fill,this.maps.layers[c].shapeSettings.opacity,this.maps.layers[0].shapeSettings.border.color||this.maps.themeStyle.shapeBorderColor,je(this.maps.layers[c].shapeSettings.border.width)?0:this.maps.layers[c].shapeSettings.border.width,(je(this.maps.layers[c].shapeSettings.border.opacity)?this.maps.layers[c].shapeSettings:this.maps.layers[c].shapeSettings.border).opacity,this.maps.layers[0].shapeSettings.fill):this.setToggleAttributes(i,t,n,o,r,s,a,n))):(-1!==C&&0===g&&this.maps.toggledLegendId.splice(C,1),-1!==S&&this.maps.toggledElementId.splice(S,1),w.setAttribute("fill-opacity",this.maps.layers[c].shapeSettings.opacity.toString()),w.setAttribute("stroke-width",(je(this.maps.layers[c].shapeSettings.border.width)?0:this.maps.layers[c].shapeSettings.border.width).toString()),w.setAttribute("stroke",this.maps.layers[0].shapeSettings.border.color||this.maps.themeStyle.shapeBorderColor),w.setAttribute("stroke-opacity",(je(this.maps.layers[c].shapeSettings.border.opacity)?this.maps.layers[c].shapeSettings:this.maps.layers[c].shapeSettings.border).opacity.toString()),w.setAttribute("fill",this.legendCollection[h].fill),null!==e&&(i=Vzt(this.maps.element.id+"_Legend_Index_"+h+"_Text",this.maps.element.id),t=Vzt(this.maps.element.id+"_Legend_Index_"+h,this.maps.element.id),this.setToggleAttributes(i,t,this.legendCollection[h].fill,this.legendCollection[h].opacity,this.legendCollection[h].shapeBorder.color,this.legendCollection[h].shapeBorder.width,this.legendCollection[h].shapeBorder.opacity,"#757575"))));y._isVisible=!d}}},S4t.prototype.removeCollections=function(e,t){this.removeLegendSelectionCollection(e);var i=this.getIndexofLegend(this.maps.legendSelectionCollection,e);-1!==i&&this.maps.legendSelectionCollection.splice(i,1);-1!==this.getIndexofLegend(this.legendHighlightCollection,e)&&this.legendHighlightCollection.splice(i,1);i=this.getIndexofLegend(this.shapeHighlightCollection,e),-1!==i&&this.shapeHighlightCollection.splice(i,1),e=this.maps.selectedLegendElementId.indexOf(t);-1!==e&&this.maps.selectedLegendElementId.splice(e,1)},S4t.prototype.removeEventListener=function(){if(!this.maps.isDestroyed){this.maps.off(F.touchMoveEvent,this.interactiveHandler),this.maps.off(F.touchEndEvent,this.interactiveHandler),this.maps.off(L3t,this.legendClick);var e=document.getElementById(this.maps.element.id+"_Legend_Paging_Group");if(e)for(var t=0;t<e.childElementCount;t++)E.remove(e.childNodes[t],F.touchStartEvent,this.changeNextPage)}},S4t.prototype.getLegendData=function(e,t,i,n,o,r,s){var a=[];if("[object Array]"===Object.prototype.toString.call(o))for(var l=0;l<o.length;l++){var h=o[l],d=-1<n.indexOf(".")?KHt(i,n):i[n],p=vzt(i[n],r,h.properties),d=je(d)||"string"!=typeof d?d:d.toLowerCase();if((!je(h.properties[p])&&isNaN(h.properties[p])?h.properties[p].toLowerCase():h.properties[p])===d)if("MultiPoint"!==h.geometry.type)a.push({layerIndex:e,shapeIndex:l,dataIndex:t,name:i[n],value:s,pointIndex:-1});else for(var c=0;c<h.geometry.coordinates.length;c++)a.push({layerIndex:e,shapeIndex:l,dataIndex:t,name:i[n],value:s,pointIndex:c})}return a},S4t.prototype.setToggleAttributes=function(e,t,i,n,o,r,s,a){e.setAttribute("fill",a),t.setAttribute("fill",i),t.setAttribute("fill-opacity",n.toString()),t.setAttribute("stroke",o),t.setAttribute("stroke-width",r.toString()),je(s)||t.setAttribute("stroke-opacity",s.toString())},S4t.prototype.legendGradientColor=function(e,t){var i="http://www.w3.org/2000/svg";if(!je(e.color)&&"object"==typeof e.color){var n=document.createElementNS(i,"linearGradient"),o=this.maps.legendSettings.position,r="Top"===o||"Bottom"===o?"100":"0",o="Top"===o||"Bottom"===o?"0":"100";n.setAttribute("id","linear_"+t+"_"+this.maps.element.id),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2",r+"%"),n.setAttribute("y2",o+"%");for(var s=0;s<e.color.length;s++){var a=100/(e.color.length-1),l=document.createElementNS(i,"stop");l.setAttribute("offset",s*a+"%"),l.setAttribute("stop-color",e.color[s]),l.setAttribute("stop-opacity",1..toString()),n.appendChild(l)}this.legendLinearGradient=n;r="url(#linear_"+t+"_"+this.maps.element.id+")";this.defsElement.appendChild(n),o=r}return o},S4t.prototype.getModuleName=function(){return"Legend"},S4t.prototype.destroy=function(){this.legendCollection=[],this.legendRenderingCollections=[],this.translate=null,this.legendBorderRect=null,this.initialMapAreaRect=null,this.legendTotalRect=null,this.totalPages=[],this.legendItemRect=null,this.legendGroup=null,this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.shapePreviousColor=[],this.selectedNonLegendShapes=[],this.legendLinearGradient=null,this.currentLayer=null,this.defsElement=null,this.legendElement=[],this.oldShapeElement=null,this.maps.refreshing||(this.maps=null)};Bft=S4t;function S4t(e){this.legendBorderRect=new WHt(0,0,0,0),this.initialMapAreaRect=new WHt(0,0,0,0),this.legendTotalRect=new WHt(0,0,0,0),this.totalPages=[],this.page=0,this.currentPage=0,this.legendItemRect=new WHt(0,0,0,0),this.heightIncrement=0,this.widthIncrement=0,this.textMaxWidth=0,this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.shapePreviousColor=[],this.selectedNonLegendShapes=[],this.shapeToggled=!0,this.legendElement=null,this.maps=e,this.addEventListener()}A4t.prototype.addEventListener=function(){this.maps.isDestroyed||(this.maps.on(F.touchMoveEvent,this.mouseMove,this),this.maps.on(F.touchStartEvent,this.mouseMove,this))},A4t.prototype.removeEventListener=function(){this.maps.isDestroyed||(this.maps.off(F.touchMoveEvent,this.mouseMove),this.maps.off(F.touchStartEvent,this.mouseMove))},A4t.prototype.addHighlight=function(e,t,i){e=_zt(e,t,0,this.maps);i?this.mapHighlight(e,null,null):Wzt(e)},A4t.prototype.mouseMove=function(e){var t,i,n,o,r,s=e.target,e="touch"===e.pointerType||"2"===e.pointerType||-1<e.type.indexOf("touch");(-1!==s.id.indexOf("LayerIndex")||-1<s.id.indexOf("NavigationIndex"))&&"ShapeselectionMapStyle"!==s.getAttribute("class")&&!e&&"MarkerselectionMapStyle"!==s.getAttribute("class")&&"BubbleselectionMapStyle"!==s.getAttribute("class")&&"navigationlineselectionMapStyle"!==s.getAttribute("class")&&"PolygonselectionMapStyle"!==s.getAttribute("class")&&"LineselectionMapStyle"!==s.getAttribute("class")?(i=parseInt(s.id.split("_LayerIndex_")[1].split("_")[0],10),o=n=t=e=void 0,-1<s.id.indexOf("shapeIndex")?(n=parseInt(s.id.split("_shapeIndex_")[1].split("_")[0],10),e=this.maps.layers[i].shapeData.features&&!je(this.maps.layersCollection[i].layerData[n])?this.maps.layersCollection[i].layerData[n].property:null,t=je(o=parseInt(s.id.split("_dataIndex_")[1].split("_")[0],10))?null:this.maps.layers[i].dataSource[o],this.highlightSettings=this.maps.layers[i].highlightSettings):-1<s.id.indexOf("BubbleIndex")?(n=parseInt(s.id.split("_BubbleIndex_")[1].split("_")[0],10),o=parseInt(s.id.split("_dataIndex_")[1].split("_")[0],10),t=this.maps.layers[i].bubbleSettings[n].dataSource[o],this.highlightSettings=this.maps.layers[i].bubbleSettings[n].highlightSettings):-1<s.id.indexOf("MarkerIndex")?(n=parseInt(s.id.split("_MarkerIndex_")[1].split("_")[0],10),o=parseInt(s.id.split("_dataIndex_")[1].split("_")[0],10),t=this.maps.layers[i].markerSettings[n].dataSource[o],this.highlightSettings=this.maps.layers[i].markerSettings[n].highlightSettings):-1<s.id.indexOf("_PolygonIndex_")?(o=parseInt(s.id.split("_PolygonIndex_")[1].split("_")[0],10),t=this.maps.layers[i].polygonSettings.polygons[o].points,this.highlightSettings=this.maps.layers[i].polygonSettings.highlightSettings):(r=parseInt(s.id.split("_NavigationIndex_")[1].split("_")[0],10),i=parseInt(s.id.split("_LayerIndex_")[1].split("_")[0],10),e=null,t={latitude:this.maps.layers[i].navigationLineSettings[r].latitude,longitude:this.maps.layers[i].navigationLineSettings[r].longitude},this.highlightSettings=this.maps.layers[i].navigationLineSettings[r].highlightSettings),this.highlightSettings.enable?this.handleHighlight(s,i,t,e):je(n=document.getElementsByClassName("highlightMapStyle")[0])||(Wzt(n),-1<n.id.indexOf("NavigationIndex")&&(r=parseInt(n.id.split("_NavigationIndex_")[1].split("_")[0],10),o=parseInt(n.parentElement.id.split("_LayerIndex_")[1].split("_")[0],10),n.setAttribute("stroke-width",this.maps.layers[o].navigationLineSettings[r].width.toString()),n.setAttribute("stroke",this.maps.layers[o].navigationLineSettings[r].color)))):0<Nzt("highlightMapStyle").length?(-1<(s=Nzt("highlightMapStyle")[0]).id.indexOf("NavigationIndex")&&(r=parseInt(s.id.split("_NavigationIndex_")[1].split("_")[0],10),i=parseInt(s.parentElement.id.split("_LayerIndex_")[1].split("_")[0],10),s.setAttribute("stroke-width",this.maps.layers[i].navigationLineSettings[r].width.toString()),s.setAttribute("stroke",this.maps.layers[i].navigationLineSettings[r].color)),Wzt(s),this.maps.legendSettings.visible&&this.maps.legendModule&&this.maps.legendModule.removeShapeHighlightCollection()):(-1!==s.id.indexOf(this.maps.element.id+"_Legend_Shape_Index")||-1!==s.id.indexOf(this.maps.element.id+"_Legend_Index"))&&this.maps.legendModule&&this.maps.legendSettings.visible&&-1===s.id.indexOf("_Text")?this.maps.legendModule.legendHighLightAndSelection(s,"highlight"):this.maps.legendSettings.visible&&this.maps.legendModule&&this.maps.legendModule.removeLegendHighlightCollection()},A4t.prototype.handleHighlight=function(e,t,i,n){this.maps.legendSettings.visible&&-1===e.id.indexOf("_MarkerIndex_")&&this.maps.legendModule&&"Layers"===this.maps.legendSettings.type&&this.maps.legendModule.shapeHighLightAndSelection(e,i,this.highlightSettings,"highlight",t),-1<e.id.indexOf("shapeIndex")&&this.maps.legendSettings.visible&&this.maps.legendModule&&!this.maps.legendModule.shapeToggled||this.mapHighlight(e,n,i)},A4t.prototype.mapHighlight=function(e,t,i){var n=this,o=parseInt(e.id.split("_LayerIndex_")[1].split("_")[0],10),r=!1,o=(-1<e.id.indexOf("MarkerIndex")&&(s=parseInt(e.id.split("_MarkerIndex_")[1].split("_")[0],10),r=this.maps.layers[o].markerSettings[s].highlightSettings.enable),-1!==e.parentElement.id.indexOf("LineString")&&this.highlightSettings.fill||this.highlightSettings.border.color),s=-1===e.parentElement.id.indexOf("LineString")?this.highlightSettings.border.width/(r?1:this.maps.scale):this.highlightSettings.border.width/this.maps.scale,r=(je(this.highlightSettings.border.opacity)?this.highlightSettings:this.highlightSettings.border).opacity,a={opacity:this.highlightSettings.opacity,fill:-1===e.parentElement.id.indexOf("LineString")?-1===e.id.indexOf("NavigationIndex")?je(this.highlightSettings.fill)?e.getAttribute("fill"):this.highlightSettings.fill:"none":"transparent",border:{color:o,width:s,opacity:r},cancel:!1},l={opacity:a.opacity,fill:a.fill,border:{color:o,width:s,opacity:r},name:H3t,target:e.id,cancel:!1,shapeData:t,data:i,maps:this.maps},h=(-1<e.id.indexOf("shapeIndex")&&this.maps.trigger(H3t,l,function(){}),{opacity:a.opacity,fill:a.fill,border:{color:o,width:s,opacity:r},name:o4t,target:e.id,cancel:!1,shapeData:t,data:i,maps:this.maps});this.maps.trigger(o4t,h,function(){h.cancel=(a.cancel!==h.cancel?h:-1<e.id.indexOf("shapeIndex")?l:a).cancel,h.fill=(a.fill!==h.fill?h:-1<e.id.indexOf("shapeIndex")?l:a).fill,h.opacity=(a.opacity!==h.opacity?h:-1<e.id.indexOf("shapeIndex")?l:a).opacity,h.border.color=(a.border.color!==h.border.color?h:-1<e.id.indexOf("shapeIndex")?l:a).border.color,h.border.width=(a.border.width!==h.border.width?h:-1<e.id.indexOf("shapeIndex")?l:a).border.width,h.border.opacity=(a.border.opacity!==h.border.opacity?h:-1<e.id.indexOf("shapeIndex")?l:a).border.opacity,n.highlightMap(e,h)})},A4t.prototype.highlightMap=function(e,t){var i,n,o;"highlightMapStyle"===e.getAttribute("class")||t.cancel||(0<Nzt("highlightMapStyle").length&&(Wzt(i=Nzt("highlightMapStyle")[0]),-1<i.id.indexOf("NavigationIndex"))&&(n=parseInt(i.id.split("_NavigationIndex_")[1].split("_")[0],10),o=parseInt(i.parentElement.id.split("_LayerIndex_")[1].split("_")[0],10),i.setAttribute("stroke-width",this.maps.layers[o].navigationLineSettings[n].width.toString()),i.setAttribute("stroke",this.maps.layers[o].navigationLineSettings[n].color)),Lzt("highlightMap")?zzt("highlightMap","highlightMapStyle",t):document.body.appendChild(Hzt("highlightMap","highlightMapStyle",t)),e.setAttribute("class","highlightMapStyle"))},A4t.prototype.getModuleName=function(){return"Highlight"},A4t.prototype.destroy=function(){this.highlightSettings=null,this.maps.refreshing||(this.maps=null)};d=A4t;function A4t(e){this.maps=e,this.addEventListener()}x4t.prototype.addEventListener=function(){this.maps.isDestroyed||this.maps.on(L3t,this.mouseClick,this)},x4t.prototype.removeEventListener=function(){this.maps.isDestroyed||this.maps.off(L3t,this.mouseClick)},x4t.prototype.mouseClick=function(e){var t,i,n,o,r;!je(e.type)&&-1!==e.type.indexOf("touch")&&je(e.id)&&(e=e.target),!je(e.id)&&(-1<e.id.indexOf("LayerIndex")||-1<e.id.indexOf("NavigationIndex"))?(i=o=n=r=void 0,t=parseInt(e.id.split("_LayerIndex_")[1].split("_")[0],10),-1<e.id.indexOf("shapeIndex")?(o=parseInt(e.id.split("_shapeIndex_")[1].split("_")[0],10),r=!je(this.maps.layers[t].shapeData.features)&&this.maps.layers[t].shapeData.features.length>o?this.maps.layers[t].shapeData.features[o].properties:!je(this.maps.layers[t].shapeData.geometries)&&this.maps.layers[t].shapeData.geometries.length>o?this.maps.layers[t].shapeData.geometries[o].properties:null,n=je(i=parseInt(e.id.split("_dataIndex_")[1].split("_")[0],10))?null:this.maps.layers[t].dataSource[i],this.selectionsettings=this.maps.layers[t].selectionSettings,this.selectionType="Shape"):-1<e.id.indexOf("BubbleIndex")?(o=parseInt(e.id.split("_BubbleIndex_")[1].split("_")[0],10),i=parseInt(e.id.split("_dataIndex_")[1].split("_")[0],10),n=this.maps.layers[t].bubbleSettings[o].dataSource[i],this.selectionsettings=this.maps.layers[t].bubbleSettings[o].selectionSettings,this.selectionType="Bubble"):-1<e.id.indexOf("MarkerIndex")?(o=parseInt(e.id.split("_MarkerIndex_")[1].split("_")[0],10),i=parseInt(e.id.split("_dataIndex_")[1].split("_")[0],10),n=this.maps.layers[t].markerSettings[o].dataSource[i],this.selectionsettings=this.maps.layers[t].markerSettings[o].selectionSettings,this.selectionType="Marker"):-1<e.id.indexOf("_PolygonIndex_")?(i=parseInt(e.id.split("_PolygonIndex_")[1].split("_")[0],10),n=this.maps.layers[t].polygonSettings.polygons[i].points,this.selectionsettings=this.maps.layers[t].polygonSettings.selectionSettings,this.selectionType="Polygon"):-1<e.id.indexOf("NavigationIndex")&&(o=parseInt(e.id.split("_NavigationIndex_")[1].split("_")[0],10),r=null,n={latitude:this.maps.layers[t].navigationLineSettings[o].latitude,longitude:this.maps.layers[t].navigationLineSettings[o].longitude},this.selectionsettings=this.maps.layers[t].navigationLineSettings[o].selectionSettings,this.selectionType="navigationline"),!je(this.selectionsettings)&&this.selectionsettings.enable&&this.selectElement(e,t,n,r)):this.maps.legendSettings.visible&&!this.maps.legendSettings.toggleLegendSettings.enable&&this.maps.legendModule&&!je(e.id)&&-1===e.id.indexOf("_Text")&&(-1<e.id.indexOf(this.maps.element.id+"_Legend_Shape_Index")||-1!==e.id.indexOf(this.maps.element.id+"_Legend_Index"))&&this.maps.legendModule.legendHighLightAndSelection(e,"selection")},x4t.prototype.selectElement=function(e,t,i,n){this.maps.mapSelect=!!e,this.maps.legendModule&&this.maps.legendSettings.visible&&-1===e.id.indexOf("_MarkerIndex_")&&this.maps.legendModule.shapeHighLightAndSelection(e,i,this.selectionsettings,"selection",t),-1<e.id.indexOf("shapeIndex")&&this.maps.legendSettings.visible&&this.maps.legendModule&&!this.maps.legendModule.shapeToggled||this.selectMap(e,n,i)},x4t.prototype.addSelection=function(e,t,i){e=_zt(e,t,0,this.maps);i?this.selectMap(e,null,null):Wzt(e)},x4t.prototype.selectMap=function(p,e,t){var c=this,u=-1<p.parentElement.id.indexOf("LineString"),i={color:u&&this.selectionsettings.fill||this.selectionsettings.border.color,width:u?this.selectionsettings.border.width/this.maps.scale:this.selectionsettings.border.width/("Marker"===this.selectionType?1:this.maps.scale),opacity:this.selectionsettings.border.opacity},g={opacity:this.selectionsettings.opacity,fill:u?"transparent":"navigationline"!==this.selectionType?this.selectionsettings.fill:"none",border:i,name:n4t,target:p.id,cancel:!1,shapeData:e,data:t,maps:this.maps};this.maps.trigger("itemSelection",g,function(e){if(g.border.opacity=(je(c.selectionsettings.border.opacity)?c.selectionsettings:c.selectionsettings.border).opacity,!g.cancel)if(p.getAttribute("class")===c.selectionType+"selectionMapStyle"||"LineselectionMapStyle"===p.getAttribute("class")){Wzt(p),c.removedSelectionList(p);for(var t=0;t<c.maps.shapeSelectionItem.length;t++)if(c.maps.shapeSelectionItem[t]===g.shapeData){c.maps.shapeSelectionItem.splice(t,1);break}-1<p.id.indexOf("NavigationIndex")&&(n=parseInt(p.id.split("_NavigationIndex_")[1].split("_")[0],10),o=parseInt(p.parentElement.id.split("_LayerIndex_")[1].split("_")[0],10),p.setAttribute("stroke-width",c.maps.layers[o].navigationLineSettings[n].width.toString()),p.setAttribute("stroke",c.maps.layers[o].navigationLineSettings[n].color))}else{var i=kzt(c.maps.element.id+"_Layer_Collections");if(!c.selectionsettings.enableMultiSelect&&(0<i.getElementsByClassName(c.selectionType+"selectionMapStyle").length||0<i.getElementsByClassName("LineselectionMapStyle").length)){for(var n,o,r=i.getElementsByClassName(c.selectionType+"selectionMapStyle").length,s=void 0,a=0;a<r;a++)Wzt(s=i.getElementsByClassName(c.selectionType+"selectionMapStyle")[0]),c.removedSelectionList(s);if(0<i.getElementsByClassName("LineselectionMapStyle").length)for(r=i.getElementsByClassName("LineselectionMapStyle").length,a=0;a<r;a++)Wzt(s=i.getElementsByClassName("LineselectionMapStyle")[0]),c.removedSelectionList(s);if("Shape"===c.selectionType){c.maps.shapeSelectionItem=[];for(var l=c.maps.selectedElementId.length,h=0;h<l;h++){Wzt(s=i.getElementsByClassName(c.selectionType+"selectionMapStyle")[0]);var d=c.maps.selectedElementId.indexOf(s.getAttribute("id"));c.maps.selectedElementId.splice(d,1)}}-1<s.id.indexOf("NavigationIndex")&&(n=parseInt(p.id.split("_NavigationIndex_")[1].split("_")[0],10),o=parseInt(p.parentElement.id.split("_LayerIndex_")[1].split("_")[0],10),s.setAttribute("stroke-width",c.maps.layers[o].navigationLineSettings[n].width.toString()),s.setAttribute("stroke",c.maps.layers[o].navigationLineSettings[n].color))}u?(Lzt("LineselectionMap")?zzt("LineselectionMap","LineselectionMapStyle",g):document.body.appendChild(Hzt("LineselectionMap","LineselectionMapStyle",g)),p.setAttribute("class","LineselectionMapStyle")):(Lzt(c.selectionType+"selectionMap")?zzt(c.selectionType+"selectionMap",c.selectionType+"selectionMapStyle",g):document.body.appendChild(Hzt(c.selectionType+"selectionMap",c.selectionType+"selectionMapStyle",g)),p.setAttribute("class",c.selectionType+"selectionMapStyle")),"ShapeselectionMapStyle"===p.getAttribute("class")&&(c.maps.shapeSelectionClass=Lzt(c.selectionType+"selectionMap"),c.maps.selectedElementId.push(p.getAttribute("id")),c.maps.shapeSelectionItem.push(g.shapeData)),"MarkerselectionMapStyle"===p.getAttribute("class")&&(c.maps.markerSelectionClass=Lzt(c.selectionType+"selectionMap"),c.maps.selectedMarkerElementId.push(p.getAttribute("id"))),"BubbleselectionMapStyle"===p.getAttribute("class")&&(c.maps.bubbleSelectionClass=Lzt(c.selectionType+"selectionMap"),c.maps.selectedBubbleElementId.push(p.getAttribute("id"))),"navigationlineselectionMapStyle"===p.getAttribute("class")&&(c.maps.navigationSelectionClass=Lzt(c.selectionType+"selectionMap"),c.maps.selectedNavigationElementId.push(p.getAttribute("id"))),"PolygonselectionMapStyle"===p.getAttribute("class")&&(c.maps.polygonSelectionClass=Lzt(c.selectionType+"selectionMap"),c.maps.selectedPolygonElementId.push(p.getAttribute("id")))}})},x4t.prototype.removedSelectionList=function(e){"Shape"===this.selectionType&&this.maps.selectedElementId.splice(this.maps.selectedElementId.indexOf(e.getAttribute("id")),1),"Bubble"===this.selectionType&&this.maps.selectedBubbleElementId.splice(this.maps.selectedBubbleElementId.indexOf(e.getAttribute("id")),1),"Marker"===this.selectionType&&this.maps.selectedMarkerElementId.splice(this.maps.selectedMarkerElementId.indexOf(e.getAttribute("id")),1),"navigationline"===this.selectionType&&this.maps.selectedBubbleElementId.splice(this.maps.selectedBubbleElementId.indexOf(e.getAttribute("id")),1),"Polygon"===this.selectionType&&this.maps.selectedPolygonElementId.splice(this.maps.selectedPolygonElementId.indexOf(e.getAttribute("id")),1)},x4t.prototype.getModuleName=function(){return"Selection"},x4t.prototype.destroy=function(){this.selectionsettings=null,this.maps.refreshing||(this.maps=null)};B2t=x4t;function x4t(e){this.maps=e,this.addEventListener()}I4t.prototype.renderTooltip=function(i){var n,e,t,o,r,s=this,a=(m=(-1!==i.type.indexOf("touch")?(this.isTouch=!0,g=i.changedTouches[0].pageX,i.changedTouches[0]):(this.isTouch="touch"===i.pointerType,g=i.pageX,i)).pageY,i.target),l=(-1===a.id.indexOf(this.maps.element.id)&&!je(u=a.closest("."+this.maps.element.id+"_marker_template_element"))&&-1<u.id.indexOf("_MarkerIndex_")&&(a=u),""),h=a.id,d=[],p=-1<h.indexOf("_LayerIndex_")&&parseFloat(h.split("_LayerIndex_")[1].split("_")[0]),c=this.maps.layersCollection[p],u=[],g=oHt(g,m,this.maps.svgObject),m=(this.tooltipTargetID=h,null),f=null,y=this.maps.getClickLocation(h,i.pageX,i.pageY,a,i.layerX,i.layerY,"tooltip"),v=(je(y)||(m=y.latitude,f=y.longitude),-1<h.indexOf("_PolygonIndex_"));if((-1<h.indexOf("_shapeIndex_")||-1<h.indexOf("_MarkerIndex_")||-1<h.indexOf("_BubbleIndex_")||-1<h.indexOf("_PolygonIndex_"))&&null===this.maps.markerDragArgument){if(-1<h.indexOf("_PolygonIndex_")){var y=parseInt(h.split("_PolygonIndex_")[1].split("_")[0],10),b=c.polygonSettings.tooltipSettings,w=c.polygonSettings.polygons[y],C=b.textStyle,S=b.fill;u.push(w.tooltipText)}else if(-1<h.indexOf("_shapeIndex_")){var A=c.tooltipSettings,y=parseInt(h.split("_shapeIndex_")[1].split("_")[0],10);if(je(c.layerData)||je(c.layerData[y]))return;var x=c.layerData[y].property,I=!1,T="[object Array]"===Object.prototype.toString.call(c.shapePropertyPath)?c.shapePropertyPath:[c.shapePropertyPath];if(!je(T)){for(var E=0;E<T.length;E++)if(!je(c.dataSource)&&!je(c.shapeDataPath))for(var D=0;D<c.dataSource.length;D++){var M=c.dataSource[D],k=-1<c.shapeDataPath.indexOf(".")?KHt(M,c.shapeDataPath):M[c.shapeDataPath];if((!je(k)&&isNaN(M[c.shapeDataPath])?k.toLowerCase():k)===(!je(x[T[E]])&&isNaN(x[T[E]])?x[T[E]].toLowerCase():x[T[E]])){I=!0,p=D,E=T.length;break}}if(p=I?p:null,c.dataSource&&0<c.dataSource.length){if(!je(c.dataSource[p]))for(e in d=JSON.parse(JSON.stringify(c.dataSource[p])),x)d.hasOwnProperty(e)||(d[e]=x[e])}else d=x}!A.visible||(je(p)||isNaN(p))&&je(x)||(c.tooltipSettings.format?l=this.formatter(c.tooltipSettings.format,d):(y=vzt(c.shapeDataPath,c.shapePropertyPath,x),l=je(c.dataSource)||je(p)?x[y]:qHt(-1<A.valuePath.indexOf(".")?KHt(c.dataSource[p],A.valuePath):c.dataSource[p][A.valuePath],this.maps),je(l)&&!je(A.valuePath)&&(l=-1<A.valuePath.indexOf(".")?KHt(x,A.valuePath):x[A.valuePath])))}else-1<h.indexOf("_MarkerIndex_")?(y=parseInt(h.split("_MarkerIndex_")[1].split("_")[0],10),t=parseInt(h.split("_MarkerIndex_")[1].split("_")[2],10),o=c.markerSettings[y],A=o.tooltipSettings,d=o.dataSource[t],A.visible&&!isNaN(y)&&(o.tooltipSettings.format?l=this.formatter(o.tooltipSettings.format,o.dataSource[t]):"function"!=typeof o.template&&o.template&&!o.tooltipSettings.valuePath?l=o.template.split(">")[1].split("<")[0]:je(o.tooltipSettings.valuePath)||(l=qHt(-1<o.tooltipSettings.valuePath.indexOf(".")?KHt(o.dataSource[t],o.tooltipSettings.valuePath):o.dataSource[t][o.tooltipSettings.valuePath],this.maps)))):-1<h.indexOf("_BubbleIndex_")&&(y=parseInt(h.split("_BubbleIndex_")[1].split("_")[0],10),t=parseInt(h.split("_BubbleIndex_")[1].split("_")[2],10),o=c.bubbleSettings[y],A=o.tooltipSettings,d=o.dataSource[t],A.visible)&&!isNaN(t)&&(o.tooltipSettings.format?l=this.formatter(o.tooltipSettings.format,o.dataSource[t]):je(o.tooltipSettings.valuePath)||(l=qHt(-1<o.tooltipSettings.valuePath.indexOf(".")?KHt(o.dataSource[t],o.tooltipSettings.valuePath):o.dataSource[t][o.tooltipSettings.valuePath],this.maps)));(v?b:A).visible&&(document.getElementById(this.tooltipId)?n=document.getElementById(this.tooltipId):(n=Q("div",{id:this.maps.element.id+"_mapsTooltip",className:"EJ2-maps-Tooltip"}),je(v?w.tooltipTemplate:A.template)||(v?""===w.tooltipTemplate:""===A.template)||"MouseMove"===this.maps.tooltipDisplayMode?n.style.cssText="position: absolute;pointer-events:none;":n.style.position="absolute",document.getElementById(this.maps.element.id+"_Secondary_Element").appendChild(n)),v?w.tooltipTemplate:A.template,(v?null!==w.tooltipTemplate:null!==A.template)&&1===Object.keys((v?w.tooltipTemplate:A.template,v?w.tooltipTemplate:A.template)).length&&(v?w.tooltipTemplate=w.tooltipTemplate[Object.keys(w.tooltipTemplate)[0]]:A.template=A.template[Object.keys(A.template)[0]]),y={location:g,text:u,data:d=this.setTooltipContent(A,d),textStyle:{color:(v?C:A.textStyle).color,fontFamily:(v?C:A.textStyle).fontFamily,fontStyle:(v?C:A.textStyle).fontStyle,fontWeight:(v?C:A.textStyle).fontWeight,opacity:(v?C:A.textStyle).opacity,size:(v?C:A.textStyle).size},template:v?w.tooltipTemplate:A.template},""!==(r={cancel:!1,name:V3t,options:y,fill:v?S:A.fill,maps:this.maps,latitude:m,longitude:f,element:a,eventArgs:i,content:v?je(w.tooltipText)?"":w.tooltipText:je(l)?"":l.toString()}).content||""!==r.options.template?this.maps.trigger(V3t,r,function(e){var t;r.cancel||je(l)||-1!==h.indexOf("_cluster_")||-1!==h.indexOf("_dataLabel_")?s.clearTooltip(i.target):(s.maps.isProtectedOnChange=!0,r.options.textStyle.size=r.options.textStyle.size||s.maps.themeStyle.fontSize,r.options.textStyle.color=r.options.textStyle.color||s.maps.themeStyle.tooltipFontColor,r.options.textStyle.fontFamily=r.options.textStyle.fontFamily||s.maps.themeStyle.fontFamily,r.options.textStyle.fontWeight=r.options.textStyle.fontWeight||s.maps.themeStyle.fontWeight,r.options.textStyle.opacity=r.options.textStyle.opacity||s.maps.themeStyle.tooltipTextOpacity,t=v?{color:b.border.color||s.maps.themeStyle.tooltipBorderColor,width:b.border.width,opacity:b.border.opacity}:{color:A.border.color||s.maps.themeStyle.tooltipBorderColor,width:A.border.width,opacity:A.border.opacity},r.cancel?s.svgTooltip=new tr({theme:s.maps.theme,enable:!0,header:"",data:A.data,template:A.template,content:r.content.toString()!==l.toString()?[r.content.toString()]:[l.toString()],shapes:[],location:A.location,palette:[void 0],areaBounds:s.maps.mapAreaRect,textStyle:A.textStyle,availableSize:s.maps.availableSize,fill:A.fill||s.maps.themeStyle.tooltipFillColor,enableShadow:!0,border:t}):s.svgTooltip=new tr({theme:s.maps.theme,enable:!0,header:"",data:r.options.data,template:r.options.template,content:r.content.toString()!==l.toString()?[r.content.toString()]:[l.toString()],shapes:[],location:r.options.location,palette:[void 0],areaBounds:s.maps.mapAreaRect,textStyle:r.options.textStyle,availableSize:s.maps.availableSize,fill:r.fill||s.maps.themeStyle.tooltipFillColor,enableShadow:!0,border:t}),(s.maps.isVue||s.maps.isVue3)&&(s.svgTooltip.controlInstance=s.maps),s.svgTooltip.opacity=s.maps.themeStyle.tooltipFillOpacity||s.svgTooltip.opacity,s.svgTooltip.appendTo(n),s.maps.renderReactTemplates(),s.maps.isDevice&&null!==(t=!je(t=(-1<h.indexOf("_MarkerIndex_")||-1<h.indexOf("_BubbleIndex_")||-1<h.indexOf("_shapeIndex_")?A:b).duration)&&0<t?t:t<0?2e3:null)&&(clearTimeout(s.tooltipTimer),s.tooltipTimer=setTimeout(s.removeTooltip.bind(s),t)))}):this.clearTooltip(i.target),this.svgTooltip&&this.maps.trigger("tooltipRenderComplete",{cancel:!1,name:"tooltipRenderComplete",maps:this.maps,options:y,element:this.svgTooltip.element}),this.svgTooltip)?this.maps.trigger("tooltipRenderComplete",{cancel:!1,name:"tooltipRenderComplete",maps:this.maps,options:y,element:this.svgTooltip.element}):this.clearTooltip(i.target)}else je(i.target.closest("#"+this.maps.element.id+"_mapsTooltipparent_template"))&&this.clearTooltip(i.target)},I4t.prototype.setTooltipContent=function(e,t){t=Pe({},t,null,!0);return this.maps.format&&!isNaN(Number(t[e.valuePath]))?t[e.valuePath]=Bzt(this.maps,Number(t[e.valuePath])):t=Object.keys(t).length?t:void 0,t},I4t.prototype.formatter=function(e,t){void 0===t&&(t={});for(var i=0,n=Object.keys(t);i<n.length;i++){var o=n[i];e="object"==typeof t[o]?GHt("",e,t,this.maps):e.split("${"+o+"}").join(qHt(t[o],this.maps))}return e},I4t.prototype.mouseUpHandler=function(e){je(this.maps)||(this.renderTooltip(e),"MouseMove"===this.maps.tooltipDisplayMode&&(clearTimeout(this.tooltipTimer),this.tooltipTimer=setTimeout(this.removeTooltip.bind(this),2e3)))},I4t.prototype.removeTooltip=function(){var e=!1;return 0<document.getElementsByClassName("EJ2-maps-Tooltip").length&&(ue(document.getElementsByClassName("EJ2-maps-Tooltip")[0]),e=!0),e},I4t.prototype.clearTooltip=function(e){je(e.closest("#"+this.maps.element.id+"_mapsTooltipparent_template"))&&this.removeTooltip()&&this.maps.clearTemplate()},I4t.prototype.addEventListener=function(){this.maps.isDestroyed||("DoubleClick"===this.maps.tooltipDisplayMode?this.maps.on("dblclick",this.renderTooltip,this):"Click"===this.maps.tooltipDisplayMode?this.maps.on(F.touchEndEvent,this.mouseUpHandler,this):this.maps.on(F.touchMoveEvent,this.renderTooltip,this),this.maps.on(F.touchCancelEvent,this.removeTooltip,this),this.maps.element.addEventListener("contextmenu",this.removeTooltip))},I4t.prototype.removeEventListener=function(){this.maps.isDestroyed||("DoubleClick"===this.maps.tooltipDisplayMode?this.maps.off("dblclick",this.renderTooltip):"Click"===this.maps.tooltipDisplayMode?this.maps.off(F.touchEndEvent,this.mouseUpHandler):this.maps.off(F.touchMoveEvent,this.renderTooltip),this.maps.off(F.touchCancelEvent,this.removeTooltip),this.maps.element.removeEventListener("contextmenu",this.removeTooltip))},I4t.prototype.getModuleName=function(){return"MapsTooltip"},I4t.prototype.destroy=function(){je(this.svgTooltip)||(this.svgTooltip.destroy(),this.svgTooltip.controlInstance=null,Izt(this.maps.element.id+"_mapsTooltip")),this.svgTooltip=null,this.maps.refreshing||(this.maps=null)};O2t=I4t;function I4t(e){this.maps=e,this.tooltipId=this.maps.element.id+"_mapsTooltip",this.addEventListener()}T4t.prototype.performZooming=function(e,t,i,n){var o,r,s,a,l,h,d,p=this,c=(void 0===n&&(n=!1),this.maps),u=(c.previousProjection=t<=1.5?void 0:c.projectionType,c.defaultState=!1,c.initialCheck=!1,c.markerZoomedState=c.isMarkerZoomCompleted=!1,c.zoomPersistence=c.enablePersistence,c.tileZoomLevel),g=c.zoomSettings.maxZoom,m=c.zoomSettings.minZoom,f=(t=t<=g?t:g,!0);switch(i.toLowerCase()){case"zoomin":f=t<=this.maps.zoomSettings.maxZoom;break;case"zoomout":f=t>=this.maps.zoomSettings.minZoom}f&&(o=c.previousScale=c.scale,r=c.tileTranslatePoint,c.isTileMap||!("ZoomIn"===i?m<=t&&t<=g:m<=t)&&!c.isReset?c.isTileMap&&m<=t&&t<=g&&(this.getTileTranslatePosition(u,t,e,i),c.tileZoomLevel=t,c.zoomSettings.zoomFactor=t,c.scale=Math.pow(2,t-1),"ZoomOut"===i&&c.zoomSettings.resetToInitial&&c.applyZoomReset&&t<=c.initialZoomLevel&&(c.initialCheck=!0,c.zoomPersistence=!1,c.tileTranslatePoint.x=c.initialTileTranslate.x,c.tileTranslatePoint.y=c.initialTileTranslate.y,t=c.tileZoomLevel=c.mapScaleValue=c.initialZoomLevel,c.scale=Math.pow(2,t-1)),c.mapScaleValue=isNaN(c.mapScaleValue)?1:c.mapScaleValue,c.translatePoint.y=(c.tileTranslatePoint.y-.01*c.mapScaleValue)/c.scale,c.translatePoint.x=(c.tileTranslatePoint.x-.01*c.mapScaleValue)/c.scale,this.triggerZoomEvent(r,u,i)?(c.translatePoint=c.tileTranslatePoint=new wHt(0,0),c.scale=c.previousScale,c.tileZoomLevel=u,c.zoomSettings.zoomFactor=c.previousScale):(document.querySelector(".GroupElement")&&(document.querySelector(".GroupElement").style.display="none"),document.getElementById(this.maps.element.id+"_LayerIndex_1")&&(document.getElementById(this.maps.element.id+"_LayerIndex_1").style.display="none"),this.markerLineAnimation(c),c.mapLayerPanel.generateTiles(t,c.tileTranslatePoint,i+"wheel",null,e),m=0===this.maps.layersCollection[0].animationDuration&&"Enable"===Ut?1e3:this.maps.layersCollection[0].animationDuration,setTimeout(function(){p.applyTransform(p.maps,n),document.getElementById(p.maps.element.id+"_LayerIndex_1")&&(document.getElementById(p.maps.element.id+"_LayerIndex_1").style.display="block")},m))):(g=c.mapAreaRect,m=c.baseMapRectBounds.min,a=c.baseMapRectBounds.max,s=Math.abs(m.x-a.x),a=Math.abs(m.y-a.y),h=l=void 0,t<1.2&&"Eckert5"!==c.projectionType?(0!==s&&0!==a&&s!==a||(s=g.width/2,a=g.height),t=parseFloat(Math.min(g.width/s,g.height/a).toFixed(2)),c.translatePoint=this.calculateInitalZoomTranslatePoint(t=1.05<t?1:t,s,a,g,m,c)):(l=(d=c.translatePoint).x-(g.width/o-g.width/t)/(g.width/e.x),h=d.y-(g.height/o-g.height/t)/(g.height/e.y),l=(d=Math.abs(c.baseMapRectBounds.max.y-c.baseMapRectBounds.min.y)*t)<c.mapAreaRect.height?g.x+(-m.x+(g.width/2-s/2)):l,h=d<c.mapAreaRect.height?g.y+(-m.y+(g.height/2-a/2)):h,c.translatePoint=new wHt(l,h)),c.scale=t,c.zoomTranslatePoint=c.translatePoint,this.triggerZoomEvent(r,u,i)?(c.translatePoint=c.previousPoint,c.scale=c.mapScaleValue=c.previousScale):this.applyTransform(c,n)),this.triggerZoomComplete(c,u,i)),this.maps.zoomNotApplied=!1,this.maps.isDevice&&this.removeToolbarOpacity(c.isTileMap?Math.round(c.tileZoomLevel):c.scale,c.element.id+"_Zooming_")},T4t.prototype.calculateInitalZoomTranslatePoint=function(e,t,i,n,o,r){r=0!==o.x&&"layers"===r.translateType?r.availableSize.width-n.width:0,t=n.x+(-o.x+(n.width/2-(t*=e)/2))-r,r=n.y+(-o.y+(n.height/2-(i*=e)/2));return new wHt(t,r)},T4t.prototype.triggerZoomEvent=function(e,t,i){var n=this.maps,o=(n.isTileMap&&(n.mapScaleValue=je(n.mapScaleValue)?1:n.mapScaleValue,n.translatePoint.y=(n.tileTranslatePoint.y-.01*n.mapScaleValue)/n.scale,n.translatePoint.x=(n.tileTranslatePoint.x-.01*n.mapScaleValue)/n.scale),this.maps.getMinMaxLatitudeLongitude()),e=n.isTileMap?{cancel:!1,name:"zoom",type:i,maps:n,tileTranslatePoint:{previous:e,current:n.tileTranslatePoint},translatePoint:{previous:n.previousPoint,current:n.translatePoint},tileZoomLevel:{previous:t,current:n.tileZoomLevel},scale:{previous:n.previousScale,current:n.scale},minLatitude:o.minLatitude,maxLatitude:o.maxLatitude,minLongitude:o.minLongitude,maxLongitude:o.maxLongitude}:{cancel:!1,name:"zoom",type:i,maps:n,tileTranslatePoint:{},translatePoint:{previous:n.previousPoint,current:n.translatePoint},tileZoomLevel:{},scale:{previous:n.previousScale,current:n.scale},minLatitude:o.minLatitude,maxLatitude:o.maxLatitude,minLongitude:o.minLongitude,maxLongitude:o.maxLongitude};return n.trigger("zoom",e),e.cancel},T4t.prototype.getTileTranslatePosition=function(e,t,i,n){var o=this.maps,n="ZoomOut"!==n&&"Reset"===n&&1<t?0:10,r=o.availableSize,e=256*Math.pow(2,e),s=256*Math.pow(2,t),a=(i.x-o.tileTranslatePoint.x)/e*100,e=(i.y-o.tileTranslatePoint.y)/e*100;o.tileTranslatePoint.x=1===t?r.width/2-256:i.x-a*s/100,o.tileTranslatePoint.y=1===t?r.height/2-256+2*n:i.y-e*s/100},T4t.prototype.getTileTranslate=function(e,t){var i=this.maps,t="ZoomOut"!==t&&"Reset"===t&&1<e?0:10,n=i.availableSize,o=256*Math.pow(2,e),r=n.width/2-o/2,o=n.height/2-o/2,s=hHt(new jHt(this.pinchStartLatLong.longitude,this.pinchStartLatLong.latitude),e,{x:r,y:o},!0),s=(r-=s.x-n.width/2,o=o-(s.y-n.height/2)+t,Math.pow(2,e-1));i.tileTranslatePoint.x=r,i.tileTranslatePoint.y=o,i.translatePoint.x=(r-.01*this.tileZoomLevel)/s,i.translatePoint.y=(o-.01*this.tileZoomLevel)/s},T4t.prototype.performRectZooming=function(){this.isDragZoom=!0;var e,t,i,n,o=this.maps,r=o.availableSize,s=(o.previousProjection=o.projectionType,o.tileZoomLevel),a=o.tileTranslatePoint,l=this.zoomingRect,h=o.zoomSettings.maxZoom,d=o.zoomSettings.minZoom;0<l.height&&0<l.width&&(n=this.zoomingRect.x+this.zoomingRect.width/2,t=this.zoomingRect.y+this.zoomingRect.height/2,i=void 0,o.isTileMap?(i=s+Math.round(s+(r.width/l.width+r.height/l.height)/2),o.zoomSettings.zoomFactor=i=d<=i&&i<=h?i:h,this.getTileTranslatePosition(s,i,{x:n,y:t}),o.tileZoomLevel=i,o.translatePoint.x=(o.tileTranslatePoint.x-.5*Math.pow(2,i))/Math.pow(2,i),o.translatePoint.y=(o.tileTranslatePoint.y-.5*Math.pow(2,i))/Math.pow(2,i),o.scale=Math.pow(2,i),(e=this.triggerZoomEvent(a,s,""))?(o.translatePoint=o.tileTranslatePoint=new wHt(0,0),o.scale=o.tileZoomLevel=o.zoomSettings.zoomFactor=s):o.mapLayerPanel.generateTiles(i,o.tileTranslatePoint)):(i=(i=(d=o.previousScale=o.scale)+Math.round((r.width/l.width+r.height/l.height)/2))<this.maps.zoomSettings.maxZoom?i:this.maps.zoomSettings.maxZoom,l=o.previousPoint=o.translatePoint,i<=h&&(h=l.x-(r.width/d-r.width/i)/(r.width/n),n=l.y-(r.height/d-r.height/i)/(r.height/t),o.translatePoint=new wHt(h,n)),o.scale=i<this.maps.zoomSettings.maxZoom?i:this.maps.zoomSettings.maxZoom,(e=this.triggerZoomEvent(a,s,""))&&(o.translatePoint=o.previousPoint,o.scale=o.previousScale),o.zoomTranslatePoint=o.translatePoint),e||(o.mapScaleValue=i,this.applyTransform(o,!1,!0),this.maps.zoomNotApplied=!1,this.zoomingRect=null)),this.isZoomFinal=this.isZoomSelection&&Math.round(o.scale)===this.maps.zoomSettings.maxZoom,this.triggerZoomComplete(o,s,""),this.removeToolbarOpacity(o.scale,this.maps.element.id+"_Zooming_")},T4t.prototype.setInteraction=function(e){this.lastScale=1,this.interaction=e},T4t.prototype.updateInteraction=function(){2===this.fingers?this.setInteraction("zoom"):this.setInteraction(null)},T4t.prototype.tilePinchingProcess=function(e){this.tileZoomLevel=Math.round(e),this.getTileTranslate(this.tileZoomLevel),this.maps.mapLayerPanel.generateTiles(this.tileZoomLevel,this.maps.tileTranslatePoint,null,null,null,!0)},T4t.prototype.performPinchZooming=function(e){var t,i=this.maps,n=i.tileZoomLevel,o=this.pinchFactor,r=i.tileTranslatePoint;if(this.maps.mergeCluster(),i.isTileMap){this.isPinchZooming=!0;var s=this.touchCenter,a=this.getMousePosition(this.touchMoveList[0].pageX,this.touchMoveList[0].pageY),l=this.getMousePosition(this.touchMoveList[1].pageX,this.touchMoveList[1].pageY),a=Math.sqrt(Math.pow(a.x-l.x,2)+Math.pow(a.y-l.y,2)),l=a/this.startDistance;if(!je(this.pinchDistance)){var h=Math.log2(l*(256*Math.pow(2,n))/256),h=Math.min(i.zoomSettings.maxZoom,Math.max(i.zoomSettings.minZoom,h)),l=this.pinchDistance>a?n*l:h,d=!1,p=(this.pinchDistance>a?(h=l%1,d=!0):this.pinchDistance<a&&(h=l%1+1),Math.ceil(l));if(p>i.zoomSettings.minZoom&&p<=i.zoomSettings.maxZoom){var c=document.getElementById(i.element.id),c=(c&&(c.style.overflow="hidden"),this.tileZoomLevel=p,s.x/(i.mapAreaRect.width-i.mapAreaRect.x)*100),p=s.y/(i.mapAreaRect.height-i.mapAreaRect.y)*100,u=document.getElementById(i.element.id+"_tile_parent"),g=document.getElementById(i.element.id+"_tiles"),m=(g||((g=document.createElement("div")).id=i.element.id+"_tiles",i.element.appendChild(g),this.copyStyles(u,g),g.style.zIndex="0"),g.style.visibility="hidden",u.style.transformOrigin=c+"% "+p+"%",u.style.transform="scale("+h+")",document.getElementById(i.element.id+"_Tile_SVG_Parent"));if(m.style.transformOrigin=c+"% "+p+"%",m.style.transform="scale("+h+")",(!this.isCancellation&&l%1<=.2&&.1<=l%1&&!d||l%1<=.9&&d)&&((c=document.getElementById(i.element.id+"_animates_tiles"))||((c=document.createElement("div")).id=i.element.id+"_animates_tiles",c.classList.add(this.tileZoomLevel.toString()),g.appendChild(c)),0===c.childElementCount)&&(this.pinchZoomScale=d?Math.floor(l):Math.ceil(l),this.tilePinchingProcess(this.pinchZoomScale),this.isCancellation=!0),(this.isCancellation&&.99<=l%1&&!d||l%1<=.1&&d)&&""!==u.style.transformOrigin&&this.isCancellation){u.style.transformOrigin="",u.style.transform="",m.style.transformOrigin="",m.style.transform="",this.pinchTileZoomScale=d?Math.floor(l):Math.ceil(l),this.getTileTranslate(this.pinchTileZoomScale);for(var f=document.getElementById(i.element.id+"_animated_tiles"),y=document.getElementById(i.element.id+"_animates_tiles");f.firstChild;)f.removeChild(f.firstChild);if(Array.from(y.children).forEach(function(e){f.appendChild(e.cloneNode(!0))}),document.getElementById(i.element.id+"_animated_tiles").className=this.pinchTileZoomScale.toFixed(0),y)for(;y.firstChild;)y.removeChild(y.firstChild);this.isCancellation=!1,i.mapScaleValue=this.pinchTileZoomScale,i.scale=Math.pow(2,this.pinchTileZoomScale-1),this.applyTransform(i)}}}this.pinchDistance=a}else{var p=i.mapAreaRect,h=(i.isMarkerZoomCompleted=!1,i.previousScale=i.scale,i.previousPoint=i.translatePoint,i.previousProjection=i.projectionType,ijt(this.touchStartList,this.touchMoveList)),s=rjt(ojt(this.touchMoveList,this.maps)),g=h/this.lastScale,c=(this.lastScale=h,this.pinchFactor*=g,this.pinchFactor=Math.min(this.maps.zoomSettings.maxZoom,Math.max(this.pinchFactor,this.maps.zoomSettings.minZoom)),i.baseMapRectBounds.min),u=i.baseMapRectBounds.max,m=Math.abs(c.y-u.y),d=Math.abs(c.x-u.x),l=i.translatePoint,a=void 0,h=void 0;o<1.2&&"Eckert5"!==i.projectionType?(0!==d&&0!==m&&d!==m||(d=p.width/2,m=p.height),o=parseFloat(Math.min(p.width/d,p.height/m).toFixed(2)),i.translatePoint=this.calculateInitalZoomTranslatePoint(o=1.05<o?1:o,d,m,p,c,i)):(g=Math.abs(i.baseMapRectBounds.max.y-i.baseMapRectBounds.min.y)*o,a=l.x-(p.width/i.scale-p.width/o)/(p.width/s.x),h=l.y-(p.height/i.scale-p.height/o)/(p.height/s.y),a=g<i.mapAreaRect.height?p.x+(-c.x+(p.width/2-d/2)):a,h=g<i.mapAreaRect.height?p.y+(-c.y+(p.height/2-m/2)):h,i.translatePoint=new wHt(a,h)),i.scale=o,(t=this.triggerZoomEvent(r,n,""))&&(i.translatePoint=i.previousPoint,i.scale=i.previousScale)}i.isTileMap||(i.mapScaleValue=o,t||this.applyTransform(i),this.triggerZoomComplete(i,n,"")),F.isDevice&&this.removeToolbarOpacity(i.isTileMap?Math.round(i.tileZoomLevel):i.scale,i.element.id+"_Zooming_")},T4t.prototype.copyStyles=function(e,t){var i=window.getComputedStyle(e);Array.from(i).forEach(function(e){t.style[e]=i.getPropertyValue(e)})},T4t.prototype.getTouchCenterPoint=function(){for(var e=[],t=0;t<this.touchMoveList.length;t++)e.push(this.getMousePosition(this.touchMoveList[t].pageX,this.touchMoveList[t].pageY));return{x:(e[0].x+e[1].x)/2,y:(e[0].y+e[1].y)/2}},T4t.prototype.triggerZoomComplete=function(e,t,i){var n,o;e.zoomSettings.enable&&(o=void 0,e.isTileMap&&(e.mapScaleValue=je(e.mapScaleValue)?1:e.mapScaleValue,e.translatePoint.y=(e.tileTranslatePoint.y-.01*e.mapScaleValue)/e.scale,e.translatePoint.x=(e.tileTranslatePoint.x-.01*e.mapScaleValue)/e.scale),n=this.maps.getMinMaxLatitudeLongitude(),o=e.isTileMap?{cancel:!1,name:"zoomComplete",type:i,maps:e,tileTranslatePoint:{previous:e.tileTranslatePoint,current:e.tileTranslatePoint},translatePoint:{previous:e.previousPoint,current:e.translatePoint},tileZoomLevel:{previous:t,current:e.tileZoomLevel},scale:{previous:e.previousScale,current:e.scale},minLatitude:n.minLatitude,maxLatitude:n.maxLatitude,minLongitude:n.minLongitude,maxLongitude:n.maxLongitude}:{cancel:!1,name:"zoomComplete",type:i,maps:e,tileTranslatePoint:{},translatePoint:{previous:e.previousPoint,current:e.translatePoint},tileZoomLevel:{},scale:{previous:e.previousScale,current:e.scale},minLatitude:n.minLatitude,maxLatitude:n.maxLatitude,minLongitude:n.minLongitude,maxLongitude:n.maxLongitude},this.maps.trigger("zoomComplete",o))},T4t.prototype.drawZoomRectangle=function(){var e=this.maps,t=this.mouseDownPoints,i=this.mouseMovePoints,n={width:1,color:this.maps.themeStyle.rectangleZoomBorderColor},o=Math.abs(i.x-t.x),r=Math.abs(i.y-t.y),s=i.x>t.x?t.x:t.x-o,i=i.y>t.y?t.y:t.y-r;s>e.mapAreaRect.x&&s<e.mapAreaRect.x+e.mapAreaRect.width&&i>e.mapAreaRect.y&&i<e.mapAreaRect.y+e.mapAreaRect.height&&(this.zoomingRect=new WHt(s,i,o,r),(t=e.renderer.createSvg({id:e.element.id+"_Selection_Rect_Zooming",width:e.availableSize.width,height:e.availableSize.height,style:"position: absolute;"})).style.position="absolute",s=new MHt(e.element.id+"_ZoomRect",this.maps.themeStyle.rectangleZoomFillColor,n,this.maps.themeStyle.rectangleZoomFillOpacity,this.zoomingRect,0,0,"","3"),t.appendChild(e.renderer.drawRectangle(s)),kzt(e.element.id+"_Secondary_Element").appendChild(t))},T4t.prototype.animateTransform=function(e,t,i,n,o){var r=0===this.currentLayer.animationDuration&&"Enable"===Ut?1e3:this.currentLayer.animationDuration;!t||0===r||this.maps.isTileMap?this.maps.isTileMap&&-1<e.id.indexOf("_Polygons_Group")||e.setAttribute("transform","scale("+o+") translate( "+i+" "+n+" )"):this.maps.isTileMap||ajt(e,0,r,new jHt(i,n),o,this.maps.mapAreaRect,this.maps)},T4t.prototype.applyTransform=function(y,v,b,w){var C,S,A=this,x=(this.templateCount=0,y.scale),I=y.translatePoint.x,T=y.translatePoint.y,E=0;if(y.zoomShapeCollection=[],this.isPanningInProgress=w||!1,document.getElementById(y.element.id+"_mapsTooltip")&&Izt(y.element.id+"_mapsTooltip"),y.isTileMap){var e=document.getElementById(y.element.id+"_svg");if(e)for(var t=0;t<y.layers.length;t++){var i=e.querySelector("#"+y.element.id+"_LayerIndex_"+t);i&&e.removeChild(i)}}if(this.layerCollectionEle){for(var n=function(e){var g=D.layerCollectionEle.childNodes[e];if("g"===g.tagName){D.templateCount++,D.index=-1<g.id.indexOf("_LayerIndex_")&&parseFloat(g.id.split("_LayerIndex_")[1].split("_")[0]),D.currentLayer=y.layersCollection[D.index];for(var m=y.mapLayerPanel.calculateFactor(D.currentLayer),t=g.childElementCount,f=document.getElementById(y.element.id+"_LayerIndex_"+D.index+"_Markers_Template_Group"),i=0;i<t;i++)!function(e){var t,i,r,s,a=g.childNodes[e];if(-1<a.id.indexOf("_Markers_Group")||-1<a.id.indexOf("_bubble_Group")||-1<a.id.indexOf("_dataLableIndex_Group"))if(-1<a.id.indexOf("_Markers_Group"))D.isPanModeEnabled&&w||je(a.childNodes[0])&&je(f.childNodes[0])||(t=(je(a.childNodes[0])?f:a).childNodes[0],D.markerTranslates(t,m,I,T,x,"Marker",g)),je(a=g.childNodes[e])||-1===a.id.indexOf("Markers")||(Array.prototype.forEach.call(a.childNodes,function(e,t){A.markerTranslate(e,m,I,T,x,"Marker",b);var i=parseInt(e.id.split("_dataIndex_")[1].split("_")[0],10),n=parseInt(e.id.split("_MarkerIndex_")[1].split("_")[0],10);if(0<A.currentLayer.markerSettings[n].initialMarkerSelection.length)for(var o=A.currentLayer.markerSettings[n].dataSource[i],r=0;r<A.currentLayer.markerSettings[n].initialMarkerSelection.length;r++)A.currentLayer.markerSettings[n].initialMarkerSelection[r].latitude!==o.latitude&&A.currentLayer.markerSettings[n].initialMarkerSelection[r].longitude!==o.longitude||y.markerSelection(A.currentLayer.markerSettings[n].selectionSettings,y,a.children[t],A.currentLayer.markerSettings[n].dataSource[i]);!(0<A.currentLayer.animationDuration||"Enable"===Ut||(0<y.layersCollection[0].animationDuration||"Enable"===Ut)&&"SubLayer"===A.currentLayer.type)||A.isPanModeEnabled||y.isTileMap||je(S=v?S:"visibility:hidden")||(a.style.cssText=S)}),D.isPanModeEnabled&&0<y.markerModule.sameMarkerData.length?szt(y.markerModule.sameMarkerData,y,a,!0):0<y.markerModule.sameMarkerData.length&&(y.markerModule.sameMarkerData=[],document.getElementById(y.element.id+"_mapsTooltip"))&&Izt(y.element.id+"_mapsTooltip"),document.getElementById(y.element.id+"_mapsTooltip")&&y.mapsTooltipModule.tooltipTargetID.indexOf("_MarkerIndex_")&&!D.isPanModeEnabled&&(t=y.mapsTooltipModule,je(e=a.querySelector("#"+t.tooltipTargetID))||("hidden"===e.style.visibility?Izt(y.element.id+"_mapsTooltip"):(i=parseFloat(e.getAttribute("transform").split("(")[1].split(")")[0].split(" ")[1]),e=parseFloat(e.getAttribute("transform").split("(")[1].split(")")[0].split(" ")[2]),y.isTileMap&&(i+=+Lzt(y.element.id+"_tile_parent").style.left.split("px")[0],e+=+Lzt(y.element.id+"_tile_parent").style.top.split("px")[0]),t.svgTooltip.location.x=i,t.svgTooltip.location.y=e,t.svgTooltip.enableAnimation=!1))));else if(-1<a.id.indexOf("_bubble_Group"))for(var n=void 0,o=0;o<a.childElementCount;o++){n=a.childNodes[o],C=parseFloat(n.id.split("_LayerIndex_")[1].split("_")[0]);for(var l=parseFloat(n.id.split("_BubbleIndex_")[1].split("_")[0]),h=parseFloat(n.id.split("_BubbleIndex_")[1].split("_")[2]),d=0;d<y.bubbleModule.bubbleCollection.length;d++){var p=y.bubbleModule.bubbleCollection[d];if(p.LayerIndex===C&&p.BubbleIndex===l&&p.DataIndex===h){var c=p.center.x,p=p.center.y,c=(c+I)*x,p=(p+T)*x,u=0===D.currentLayer.animationDuration&&"Enable"===Ut?1e3:D.currentLayer.animationDuration;b&&0!==u?pjt(n,0,u,new jHt(c,p)):n.setAttribute("transform","translate( "+c+" "+p+" )");break}}}else-1<a.id.indexOf("_dataLableIndex_Group")&&!je(y.layers[D.index])&&(y.zoomLabelPositions=[],y.zoomLabelPositions=y.dataLabelModule.dataLabelCollections,r=!y.isTileMap&&b,s=[],Array.prototype.forEach.call(a.childNodes,function(e,t){var i,n,o;-1<a.childNodes[t].id.indexOf("_LabelIndex_")&&(o=parseFloat(a.childNodes[t].id.split("_LabelIndex_")[1].split("_")[0]),n=a.childNodes[t].id,y.zoomShapeCollection.push(n),A.dataLabelTranslate(a.childNodes[t],m,I,T,x,"DataLabel",r,E,w,s),E++,n=y.layers[A.index].dataLabelSettings.border,0<t)&&1<n.width&&-1<a.childNodes[t-1].id.indexOf("_rectIndex_")&&!je(y.zoomLabelPositions[o])&&(n=(y.zoomLabelPositions[o].location.x+I)*x,o=(y.zoomLabelPositions[o].location.y+T)*x,i=AHt(a.childNodes[t].textContent,y.layers[A.index].dataLabelSettings.textStyle),t=a.childNodes[t-1],n=n-i.width/2,o=o-i.height/2-5,t.setAttribute("x",n),t.setAttribute("y",o))}));else y.isTileMap&&-1<a.id.indexOf("_line_Group")?(a.remove(),0<g.children.length&&g.children[0]?g.insertBefore(y.navigationLineModule.renderNavigation(D.currentLayer,D.isPinchZooming?D.pinchZoomScale:y.tileZoomLevel,D.index),g.children[1]):g.appendChild(y.navigationLineModule.renderNavigation(D.currentLayer,D.isPinchZooming?D.pinchZoomScale:y.tileZoomLevel,D.index))):y.isTileMap&&-1<a.id.indexOf("_Polygons_Group")?0<D.currentLayer.polygonSettings.polygons.length&&(D.currentLayer.polygonSettings.polygons.map(function(e,t){e=e.points,e=lHt(y,A.isPinchZooming?A.pinchZoomScale:y.tileZoomLevel,A.currentLayer,e),t=document.getElementById(y.element.id+"_LayerIndex_"+A.index+"_PolygonIndex_"+t);je(t)||t.setAttribute("d",e)}),document.getElementById(y.element.id+"_LayerIndex_"+D.index+"_Polygons_Group").style.visibility=""):-1===a.id.indexOf("Legend")&&($zt(a,D.index,x,y),y.zoomTranslatePoint=y.translatePoint,D.animateTransform(a,b,I,T,x))}(i)}y.arrangeTemplate()},D=this,o=0;o<this.layerCollectionEle.childElementCount;o++)n(o);je(this.currentLayer)||b&&0!==this.currentLayer.animationDuration&&!y.isTileMap||this.processTemplate(I,T,x,y)}},T4t.prototype.markerTranslates=function(e,u,g,m,f,y,v){var b=this,w=0,C=0,S=0,A=parseInt((e||v).id.split("_LayerIndex_")[1].split("_")[0],10),x=this.maps.renderer.createGroup({id:this.maps.element.id+"_Markers_Group",class:"GroupElement"}),e=(x.style.pointerEvents="auto",document.getElementById(x.id)&&Izt(x.id),this.maps.mapAreaRect),I=Q("div",{id:this.maps.element.id+"_LayerIndex_"+A+"_Markers_Template_Group",className:"template"}),T=(I.style.cssText="overflow: hidden; position: absolute;pointer-events: none;top:"+e.y+"px;left:"+e.x+"px;height:"+e.height+"px;width:"+e.width+"px;",document.getElementById(I.id)&&Izt(I.id),this.maps.layersCollection[A]),E=this.maps.markerModule.allowInnerClusterSetting(T);Array.prototype.forEach.call(T.markerSettings,function(d,p){C=S=0;var c=d.dataSource;je(c)||Array.prototype.forEach.call(c,function(a,l){b.maps.markerNullCount=0<=p&&0===l?0:b.maps.markerNullCount;var h={template:d.template,data:a,maps:b.maps,marker:d,cancel:!1,name:W3t,fill:d.fill,colorValuePath:d.colorValuePath,shapeValuePath:d.shapeValuePath,height:je(d.heightValuePath)||je(a[d.heightValuePath])?d.height:a[d.heightValuePath],width:je(d.widthValuePath)||je(a[d.widthValuePath])?d.width:a[d.widthValuePath],imageUrl:d.imageUrl,imageUrlValuePath:d.imageUrlValuePath,shape:d.shape,border:d.border};h=JHt(h=ZHt(h,a),a),b.maps.trigger("markerRendering",h,function(e){d.shapeValuePath!==h.shapeValuePath&&(h=ZHt(h,a)),d.colorValuePath!==h.colorValuePath&&(h=JHt(h,a));var t,i=je(d.latitudeValuePath)?je(a.latitude)?je(a.Latitude)?null:a.Latitude:parseFloat(a.latitude):Number(KHt(a,d.latitudeValuePath)),n=je(d.longitudeValuePath)?je(a.longitude)?je(a.Longitude)?null:a.Longitude:parseFloat(a.longitude):Number(KHt(a,d.longitudeValuePath)),o=d.offset,r=(h.cancel||!d.visible||je(n)||je(i)||(r=b.maps.element.id+"_LayerIndex_"+A+"_MarkerIndex_"+p+"_dataIndex_"+l,s=b.maps.isTileMap?hHt(new jHt(n,i),b.isPinchZooming?b.pinchZoomScale:b.maps.tileZoomLevel,b.maps.tileTranslatePoint,!0):aHt(i,n,u,T,b.maps),t={x:g,y:m},!h.template||isNaN(s.x)||isNaN(s.y)?h.template||isNaN(s.x)||isNaN(s.y)||(C++,azt(h,d,c,l,s,t,r,o,f,b.maps,x)):(S++,lzt(h,void 0,r,a,p,I,s,t,f,o,b.maps))),w+=isNaN(i)||isNaN(n)?1:0,S+=h.cancel?1:0,C+=h.cancel?1:0,b.maps.markerNullCount=je(i)||je(n)?b.maps.markerNullCount+1:b.maps.markerNullCount,c.length-b.maps.markerNullCount),s=!1;(d.clusterSettings.allowClustering||T.markerClusterSettings.allowClustering&&1<T.markerSettings.length?x.querySelectorAll("[id*='LayerIndex_"+A+"_MarkerIndex_"+p+"']:not([id*='_Group'])"):x.childNodes).length===r-S-w&&"Template"!==y&&(b.maps.isTileMap?(t=document.getElementById(b.maps.element.id+"_LayerIndex_"+A+"_Polygons_Group"),o=document.getElementById(b.maps.element.id+"_LayerIndex_"+A+"_Polygon_Group"),je(t)?je(o)?v.insertBefore(x,v.firstElementChild):o.insertAdjacentElement("afterend",x):t.insertAdjacentElement("afterend",x)):v.appendChild(x),T.markerSettings[p].clusterSettings.allowClustering||!E&&T.markerClusterSettings.allowClustering)&&(b.maps.svgObject.appendChild(x),b.maps.element.appendChild(b.maps.svgObject),s=izt(T,x,b.maps,A,p,x,v,!0,!0,null,E)),(d.clusterSettings.allowClustering||T.markerClusterSettings.allowClustering&&1<T.markerSettings.length?I.querySelectorAll("[id*='LayerIndex_"+A+"_MarkerIndex_"+p+"']:not([id*='_Group'])"):I.childNodes).length===r-C-w&&kzt(b.maps.element.id+"_Secondary_Element")&&(kzt(b.maps.element.id+"_Secondary_Element").appendChild(I),1<=f)&&(d.clusterSettings.allowClustering||!E&&T.markerClusterSettings.allowClustering)&&!s&&izt(T,I,b.maps,A,p,x,v,!1,!0,null,E)})})})},T4t.prototype.processTemplate=function(e,t,i,n){for(var o=0,r=0;r<this.templateCount;r++){var s=n.mapLayerPanel.calculateFactor(this.currentLayer),a=kzt(n.element.id+"_LayerIndex_"+r+"_Markers_Template_Group"),l=kzt(n.element.id+"_LayerIndex_"+r+"_Label_Template_Group"),h=kzt(n.element.id+"_LayerIndex_"+r+"_Polygons_Group");if(!je(a)&&0<a.childElementCount){a.style.visibility="visible";for(var d=0;d<a.childElementCount;d++)this.markerTranslate(a.childNodes[d],s,e,t,i,"Template")}if(!je(l)&&0<l.childElementCount)for(d=0;d<l.childElementCount;d++)this.dataLabelTranslate(l.childNodes[d],s,e,t,i,"Template",!1,o),o++;if(!je(h))for(d=0;d<h.childElementCount;d++){var p=n.layersCollection[r].polygonSettings.polygons[d].borderWidth;h.childNodes[d].childNodes[0].setAttribute("stroke-width",(p/i).toString())}}},T4t.prototype.dataLabelTranslate=function(e,t,i,n,o,r,s,a,l,h){void 0===s&&(s=!1);var d,p=this.maps.dataLabelModule.dataLabelCollections,c=this.maps.layers[this.index].dataLabelSettings.textStyle,u=parseFloat(e.id.split("_LayerIndex_")[1].split("_")[0]),g=parseFloat(e.id.split("_shapeIndex_")[1].split("_")[0]),m=(-1<e.id.indexOf("_LabelIndex_")&&(y=parseFloat(e.id.split("_LabelIndex_")[1].split("_")[0])),0===this.currentLayer.animationDuration&&"Enable"===Ut?1e3:this.currentLayer.animationDuration),p=p[a],f=a;if(p.layerIndex===u&&p.shapeIndex===g&&p.labelIndex===y){a=p.location.x,u=p.location.y;if("Template"===r){var g=0,y=0;y=this.maps.isTileMap?(g=(a+i)*o-(v=AHt(d=p.dataLabelText,c)).width/2,(u+n)*o-v.height):(r=kzt(this.maps.element.id+"_Layer_Collections"),a=Math.abs(this.maps.baseMapRectBounds.min.x-a)*o,u=Math.abs(this.maps.baseMapRectBounds.min.y-u)*o,r=r.getBoundingClientRect(),b=e.parentElement.getBoundingClientRect(),g=a+(r.left-b.left),u+(r.top-b.top)),e.style.left=g+"px",e.style.top=y+"px"}else{if(a=(a+i)*o,u=(u+n)*o,d=p.dataLabelText,s&&0!==m||e.setAttribute("transform","translate( "+a+" "+u+" )"),(je(l)||!l)&&("None"!==this.maps.layers[this.index].dataLabelSettings.smartLabelMode||"None"!==this.maps.layers[this.index].dataLabelSettings.intersectionAction)){var v,r=u-(v=xHt(d,c)).height/2,b=u+v.height/2,w={rightWidth:a+v.width/2,leftWidth:a-v.width/2,heightTop:r,heightBottom:b},C=("Hide"===this.maps.layers[this.index].dataLabelSettings.smartLabelMode&&(x=1<o?this.maps.dataLabelShape[f]*o>=v.width?d:"":this.maps.dataLabelShape[f]>=v.width?d:"",e.textContent=x),[]);if("Trim"===this.maps.layers[this.index].dataLabelSettings.smartLabelMode&&(x=Azt(1<o?this.maps.dataLabelShape[f]*o:this.maps.dataLabelShape[f],d,c,v.width,!0,C),e.textContent=x),"Hide"===this.maps.layers[this.index].dataLabelSettings.intersectionAction){for(var S=0;S<h.length;S++)if(!je(h[S])){if(!(w.leftWidth>h[S].rightWidth||w.rightWidth<h[S].leftWidth||w.heightTop>h[S].heightBottom||w.heightBottom<h[S].heightTop)){e.textContent=x="";break}x=je(x)?d:x,e.textContent=x}h.push(w)}if("Trim"===this.maps.layers[this.index].dataLabelSettings.intersectionAction){for(var A,x,I=0;I<h.length;I++)if(!je(h[I]))if(w.rightWidth<h[I].leftWidth||w.leftWidth>h[I].rightWidth||w.heightBottom<h[I].heightTop||w.heightTop>h[I].heightBottom)A=je(x)?d:x,1<o&&(D=0<C.length?C[0]:v.width,A=Azt(this.maps.dataLabelShape[f]*o,A,c,D,!0)),e.textContent=A;else{if(w.leftWidth>h[I].leftWidth){A=Azt(E=(T=h[I].rightWidth-w.leftWidth)-(w.rightWidth-w.leftWidth),x=je(x)?d:x,c,D=0<C.length?C[0]:v.width,!0),e.textContent=A;break}if(w.leftWidth<h[I].leftWidth){var T=w.rightWidth-h[I].leftWidth,E=Math.abs(T-(w.rightWidth-w.leftWidth)),D=(x=je(x)?d:x,0<C.length?C[0]:v.width);A=Azt(E,x,c,D,!0),e.textContent=A;break}}h.push(w),je(A)&&(A=Azt(this.maps.dataLabelShape[f]*o,d,c,v.width,!0),e.textContent=A)}}(s||0<m)&&pjt(e,0,m,new jHt(a,u))}}},T4t.prototype.markerTranslate=function(e,t,i,n,o,r,s){void 0===s&&(s=!1);var a,l,h=parseInt(e.id.split("_LayerIndex_")[1].split("_")[0],10),d=parseInt(e.id.split("_MarkerIndex_")[1].split("_")[0],10),p=parseInt(e.id.split("_dataIndex_")[1].split("_")[0],10),h=this.maps.layersCollection[h],d=h.markerSettings[d];je(d)||je(d.dataSource)||je(d.dataSource[p])||(l=je(d.longitudeValuePath)?je(d.dataSource[p].longitude)?je(d.dataSource[p].Longitude)?0:parseFloat(d.dataSource[p].Longitude):parseFloat(d.dataSource[p].longitude):Number(KHt(d.dataSource[p],d.longitudeValuePath)),p=je(d.latitudeValuePath)?je(d.dataSource[p].latitude)?je(d.dataSource[p].Latitude)?0:parseFloat(d.dataSource[p].Latitude):parseFloat(d.dataSource[p].latitude):Number(KHt(d.dataSource[p],d.latitudeValuePath)),a=0===this.currentLayer.animationDuration&&"Enable"===Ut?1e3:this.currentLayer.animationDuration,p=this.maps.isTileMap?hHt(new wHt(l,p),this.isPinchZooming?this.pinchZoomScale:this.maps.tileZoomLevel,this.maps.tileTranslatePoint,!0):aHt(p,l,t,h,this.maps),this.maps.isTileMap?"Template"===r?(e.style.left=p.x+d.offset.x+"px",e.style.top=p.y+d.offset.y+"px"):(p.x+=d.offset.x,p.y+=d.offset.y,e.setAttribute("transform","translate( "+p.x+" "+p.y+" )")):"Template"===r?0<a?(p.x=Math.abs(this.maps.baseMapRectBounds.min.x-p.x)*o,p.y=Math.abs(this.maps.baseMapRectBounds.min.y-p.y)*o,l=kzt(this.maps.element.id+"_Layer_Collections").getBoundingClientRect(),t=e.parentElement.getBoundingClientRect(),e.style.left=p.x+(l.left-t.left)+d.offset.x+"px",e.style.top=p.y+(l.top-t.top)+d.offset.y+"px",e.style.transform="translate(-50%, -50%)"):(e.style.left=(p.x+i)*o+d.offset.x-this.maps.mapAreaRect.x+"px",e.style.top=(p.y+n)*o+d.offset.y-this.maps.mapAreaRect.y+"px"):(p.x=(p.x+i)*o+d.offset.x,p.y=(p.y+n)*o+d.offset.y,s&&0!==a?pjt(e,0,a,p):e.setAttribute("transform","translate( "+p.x+" "+p.y+" )")))},T4t.prototype.markerLineAnimation=function(e){if(e.isTileMap)for(var t=0;t<e.layersCollection.length;t++){var i=kzt(this.maps.element.id+"_LayerIndex_"+t+"_Markers_Template_Group"),n=kzt(this.maps.element.id+"_LayerIndex_"+t+"_line_Group"),o=kzt(this.maps.element.id+"_LayerIndex_"+t+"_Polygons_Group");je(i)||(i.style.visibility="hidden"),je(n)||(n.style.visibility="hidden"),je(o)||(o.style.visibility="hidden")}},T4t.prototype.panning=function(e,t,i,n){var o,r,s,a,l,h=this.maps,d=this.mouseDownPoints,p=this.mouseMovePoints,c=h.scale,u=(h.markerZoomedState=!1,h.zoomPersistence=h.enablePersistence,h.defaultState=!1,h.initialCheck=!1,h.translatePoint),g=h.tileTranslatePoint,d=(t=je(t)?d.x-p.x:t,i=je(i)?d.y-p.y:i,-1<n.type.indexOf("mouse")||-1<n.type.indexOf("key")?n.layerX:n.touches[0].pageX),p=-1<n.type.indexOf("mouse")||-1<n.type.indexOf("key")?n.layerY:n.touches[0].pageY;this.maps.mergeCluster(),h.isTileMap?1<this.maps.tileZoomLevel&&(o=h.tileTranslatePoint.x-t,r=h.tileTranslatePoint.y-i,h.tileTranslatePoint.x=o,h.tileTranslatePoint.y=r,(-10<h.tileTranslatePoint.y&&i<0||h.tileTranslatePoint.y<-256*(Math.pow(2,this.maps.tileZoomLevel)-2)&&0<i)&&(h.tileTranslatePoint.x=o+t,h.tileTranslatePoint.y=r+i),h.translatePoint.x=h.tileTranslatePoint.x/h.scale,h.translatePoint.y=h.tileTranslatePoint.y/h.scale,n=this.maps.getTileGeoLocation(d,p),a=this.maps.getMinMaxLatitudeLongitude(),l={cancel:!1,name:"pan",maps:h,tileTranslatePoint:{previous:g,current:h.tileTranslatePoint},translatePoint:{previous:u,current:h.translatePoint},scale:h.scale,tileZoomLevel:h.tileZoomLevel,latitude:n.latitude,longitude:n.longitude,minLatitude:a.minLatitude,maxLatitude:a.maxLatitude,minLongitude:a.minLongitude,maxLongitude:a.maxLongitude},h.trigger("pan",l),h.mapLayerPanel.generateTiles(h.tileZoomLevel,h.tileTranslatePoint,"Pan"),this.applyTransform(h,!1,!1,!0),h.translatePoint.x=(h.tileTranslatePoint.x-t)/h.scale,h.translatePoint.y=(h.tileTranslatePoint.y-i)/h.scale):(g=Pzt(h.margin.top),n=je(n=document.getElementById(h.element.id+"_Legend_Group"))?0:n.getClientRects()[0].height,o=u.x-t/c,r=u.y-i/c,c=kzt(h.element.id+"_Layer_Collections").getBoundingClientRect(),s=kzt(h.element.id+"_svg").getBoundingClientRect(),t=t<0?c.left<=s.left+h.mapAreaRect.x:c.left+c.width+h.mapAreaRect.x>=s.width,i=i<0?c.top<=s.top+h.mapAreaRect.y:c.top+c.height+n+g>=s.top+s.height,c=this.maps.getGeoLocation(this.maps.layersCollection.length-1,d,p),a=this.maps.getMinMaxLatitudeLongitude(),l={cancel:!1,name:"pan",maps:h,tileTranslatePoint:{},translatePoint:{previous:u,current:new wHt(o,r)},scale:h.scale,tileZoomLevel:h.tileZoomLevel,latitude:c.latitude,longitude:c.longitude,minLatitude:a.minLatitude,maxLatitude:a.maxLatitude,minLongitude:a.minLongitude,maxLongitude:a.maxLongitude},h.trigger("pan",l),l.cancel||(t&&i?(h.translatePoint=new wHt(o,r),this.applyTransform(h,!1,!1,!0)):t?(h.translatePoint=new wHt(o,h.translatePoint.y),this.applyTransform(h,!1,!1,!0)):i&&(h.translatePoint=new wHt(h.translatePoint.x,r),this.applyTransform(h,!1,!1,!0))),this.maps.zoomNotApplied=!1),h.zoomTranslatePoint=h.translatePoint,this.mouseDownPoints=this.mouseMovePoints,this.isSingleClick=!1},T4t.prototype.toolBarZooming=function(e,t){var i,n,o,r,s,a=this,l=this.maps,h=(l.initialCheck=l.isMarkerZoomCompleted=!1,l.defaultState="Reset"===t&&1===e&&!(l.zoomSettings.resetToInitial&&l.applyZoomReset)||"ZoomOut"===t&&1===e,l.tileZoomLevel),d=l.previousScale=l.scale,p=(l.markerZoomedState=!1,l.zoomPersistence=l.enablePersistence,l.mapScaleValue=e,l.zoomSettings.maxZoom),c=l.zoomSettings.minZoom,u=l.mapAreaRect,g=l.previousPoint=l.translatePoint,m=l.tileTranslatePoint;this.maps.mergeCluster(),l.previousProjection="Reset"===t?void 0:l.projectionType,e="ZoomOut"===t&&1===Math.round(e)?1:e,e=(e="Reset"===t?c:0===Math.round(e)?1:e)<c&&"ZoomIn"===t?c+1:e,!l.isTileMap&&("ZoomIn"===t?c<=e&&Math.round(e)<=p:c<=e||l.isReset)?(i=l.baseMapRectBounds.min,n=l.baseMapRectBounds.max,s=Math.abs(n.x-i.x),n=Math.abs(i.y-n.y),r=o=void 0,e<1.2&&"Eckert5"!==l.projectionType?(0!==n&&0!==s&&n!==s||(s=u.width/2,n=u.height),e=parseFloat(Math.min(u.width/s,u.height/n).toFixed(2)),l.translatePoint=this.calculateInitalZoomTranslatePoint(e=1.05<e?1:e,s,n,u,i,l)):(o=g.x-(u.width/d-u.width/e)/2,r=g.y-(u.height/d-u.height/e)/2,o=(g=Math.abs(l.baseMapRectBounds.max.y-l.baseMapRectBounds.min.y)*e)<l.mapAreaRect.height?u.x+(-i.x+(u.width/2-s/2)):o,r=g<l.mapAreaRect.height?u.y+(-i.y+(u.height/2-n/2)):r,l.translatePoint=new wHt(o,r)),l.zoomTranslatePoint=l.translatePoint,l.scale=e,this.triggerZoomEvent(m,h,t)?(l.translatePoint=l.zoomTranslatePoint=l.previousPoint,l.scale=l.previousScale):this.applyTransform(l,!1,!0)):l.isTileMap&&(c<=e&&e<=p||l.isReset)&&(d=h<c&&!l.isReset?c:e,l.scale=Math.pow(2,d-1),l.tileZoomLevel=d,l.previousScale===l.scale&&!l.isReset||(l.zoomSettings.zoomFactor=e,s={x:l.availableSize.width/2,y:l.availableSize.height/2},this.getTileTranslatePosition(h,d,s,t),(l.zoomSettings.resetToInitial&&l.applyZoomReset&&"Reset"===t||"ZoomOut"===t&&l.zoomSettings.resetToInitial&&l.applyZoomReset&&d<=l.initialZoomLevel)&&(l.initialCheck=!0,l.zoomPersistence=!1,l.tileTranslatePoint.x=l.initialTileTranslate.x,l.tileTranslatePoint.y=l.initialTileTranslate.y,d=l.tileZoomLevel=l.mapScaleValue=l.initialZoomLevel),this.triggerZoomEvent(m,h,t)?(l.translatePoint=l.tileTranslatePoint=new wHt(0,0),l.scale=l.previousScale,l.tileZoomLevel=h,l.zoomSettings.zoomFactor=l.previousScale):(l.translatePoint.y=(l.tileTranslatePoint.y-.01*l.mapScaleValue)/l.scale,l.translatePoint.x=(l.tileTranslatePoint.x-.01*l.mapScaleValue)/l.scale,document.getElementById(this.maps.element.id+"_LayerIndex_1")&&(document.getElementById(this.maps.element.id+"_LayerIndex_1").style.display="none"),document.querySelector(".GroupElement")&&(document.querySelector(".GroupElement").style.display="none"),this.markerLineAnimation(l),l.mapLayerPanel.generateTiles(d,l.tileTranslatePoint,t),g=0===this.maps.layersCollection[0].animationDuration&&"Enable"===Ut?1e3:this.maps.layersCollection[0].animationDuration,setTimeout(function(){a.applyTransform(a.maps,!1,!0),document.getElementById(a.maps.element.id+"_LayerIndex_1")&&(document.getElementById(a.maps.element.id+"_LayerIndex_1").style.display="block"),a.maps.isAddLayer=!1},g))),this.maps.zoomNotApplied=!1),this.triggerZoomComplete(l,h,t)},T4t.prototype.createZoomingToolbars=function(){for(var e=this.maps,t=(this.toolBarGroup=e.renderer.createGroup({id:e.element.id+"_Zooming_KitCollection",opacity:"fluentdark"===e.theme.toLowerCase()?.6:.3}),15),i=15,n=e.zoomSettings.toolbarSettings,o=e.zoomSettings.toolbarSettings.buttonSettings,r=(this.maps.toolbarProperties={toolBarOrientation:n.orientation,highlightColor:o.highlightColor,selectionColor:o.selectionColor,horizontalAlignment:n.horizontalAlignment,verticalAlignment:n.verticalAlignment,color:o.color,shapeOpacity:o.opacity,borderOpacity:o.borderOpacity},o.radius||e.themeStyle.zoomButtonRadius),s=r/4,a=r/4,l=r/2,h=o.padding,d=this.maps.toolbarProperties.toolBarOrientation,p=e.zoomSettings.toolbarSettings.buttonSettings.toolbarItems.map(function(e){return e}),t=r/4+o.borderWidth/2+h,i=r/4+o.borderWidth/2+h,c=('<filter id="chart_shadow" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="5"/>'+'<feOffset dx="-3" dy="4" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="1"/>'+'</feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>',p.length),u="Horizontal"===d?c*r+c*h+h+c*o.borderWidth:r+o.borderWidth+2*h,d="Horizontal"===d?r+o.borderWidth+2*h:c*r+c*h+h+c*o.borderWidth,c=e.renderer.createDefs(),c=(c.innerHTML='<filter id="chart_shadow" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="5"/><feOffset dx="-3" dy="4" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="1"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>',this.toolBarGroup.appendChild(c),e.renderer.drawRectangle(new MHt(e.element.id+"_Zooming_Rect",n.backgroundColor,{color:n.borderColor,width:n.borderWidth,opacity:n.borderOpacity},n.borderOpacity,new WHt(n.borderWidth/2,n.borderWidth/2,u-n.borderWidth,d-n.borderWidth),0,0))),g=(this.toolBarGroup.appendChild(c),(r-o.borderWidth/2)/30),m=0;m<p.length;m++){0!==m&&(t="Horizontal"===e.toolbarProperties.toolBarOrientation?t+(r+h)+o.borderWidth:t,i="Horizontal"===e.toolbarProperties.toolBarOrientation?i:i+(r+h)+o.borderWidth);var f=p[m],y=je(this.maps.toolbarProperties.color)?this.maps.themeStyle.zoomFillColor:this.maps.toolbarProperties.color,v=o.borderColor||this.maps.themeStyle.zoomBorderColor||this.maps.themeStyle.zoomFillColor,b=(this.currentToolbarEle=e.renderer.createGroup({id:e.element.id+"_Zooming_ToolBar_"+f+"_Group",transform:"translate( "+t+" "+i+" ) "}),this.currentToolbarEle.setAttribute("class","e-maps-toolbar"),this.currentToolbarEle.appendChild(e.renderer.drawCircle(new BHt(e.element.id+"_Zooming_ToolBar_"+f+"_Rect",o.fill,{color:v,width:o.borderWidth,opacity:o.borderOpacity},o.opacity,s,a,l,""))),""),w=o.fill;switch(this.selectionColor=this.maps.toolbarProperties.selectionColor||this.maps.themeStyle.zoomSelectionColor,f.toLowerCase()){case"zoom":var C=void 0,S=void 0,S=(b=(b="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,")+"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"+"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,",this.currentToolbarEle.setAttribute("class",this.maps.zoomSettings.enableSelectionZooming?"e-maps-toolbar":""),(!this.maps.zoomSettings.enablePanning||this.maps.zoomSettings.enableSelectionZooming)&&(!this.maps.zoomSettings.enablePanning||!this.maps.zoomSettings.enableSelectionZooming)&&(this.maps.zoomSettings.enablePanning||this.maps.zoomSettings.enableSelectionZooming)?!this.maps.zoomSettings.enablePanning&&this.maps.zoomSettings.enableSelectionZooming?(C=this.maps.themeStyle.zoomFillColor,y):(C=this.selectionColor,this.selectionColor):(C=w,y)),C=e.renderer.drawPath(new EHt(e.element.id+"_Zooming_ToolBar_"+f,C,1,S,1,1,null,b+"4.114s-1.828,4.114-4.114,4.114S5.943,8.229,5.943,5.943z"));C.setAttribute("transform","scale( "+g+","+g+" )"),this.currentToolbarEle.appendChild(C),this.zoomElements=this.currentToolbarEle,this.wireEvents(this.currentToolbarEle,this.performToolBarAction);break;case"zoomin":S=e.renderer.drawPath(new EHt(e.element.id+"_Zooming_ToolBar_"+f+"_Path",w,3,y,1,1,null,b="M 8, 0 L 8, 16 M 0, 8 L 16, 8"));S.setAttribute("transform","scale( "+g+","+g+" )"),this.currentToolbarEle.appendChild(S),this.wireEvents(this.currentToolbarEle,this.performToolBarAction);break;case"zoomout":C=e.renderer.drawPath(new EHt(e.element.id+"_Zooming_ToolBar_"+f,w,3,y,1,1,null,b="M 0, 8 L 16, 8"));C.setAttribute("transform","scale( "+g+","+g+" )"),this.currentToolbarEle.appendChild(C),this.wireEvents(this.currentToolbarEle,this.performToolBarAction);break;case"pan":var A=void 0,x=(b="M5,3h2.3L7.275,5.875h1.4L8.65,3H11L8,0L5,3z M3,11V8.7l2.875,0.025v-1.4L3,7.35V5L0,8L3,",b+="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",this.currentToolbarEle.setAttribute("class",this.maps.zoomSettings.enablePanning?"e-maps-toolbar":""),this.maps.zoomSettings.enablePanning&&this.maps.zoomModule.isDragZoom?A=this.selectionColor||this.maps.themeStyle.zoomFillColor:this.maps.zoomSettings.enablePanning?A=w||this.maps.themeStyle.zoomFillColor:(A=this.selectionColor||this.maps.themeStyle.zoomFillColor,this.currentToolbarEle.setAttribute("class","")),e.renderer.drawPath(new EHt(e.element.id+"_Zooming_ToolBar_"+f,A,1,y,1,1,null,b)));x.setAttribute("transform","scale( "+g+","+g+" )"),this.currentToolbarEle.appendChild(x),this.panColor=A,this.panElements=this.currentToolbarEle,this.wireEvents(this.currentToolbarEle,this.performToolBarAction);break;case"reset":b=(b="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,")+"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,"+"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,";x=e.renderer.drawPath(new EHt(e.element.id+"_Zooming_ToolBar_"+f,w,null,y,1,1,null,b+"3.575,2.618,6.5,5.818,6.5C9.128,14.5,10.219,14.134,11.091,13.484L11.091,13.484z"));x.setAttribute("transform","scale( "+g+","+g+" )"),this.currentToolbarEle.appendChild(x),this.wireEvents(this.currentToolbarEle,this.performToolBarAction)}this.toolBarGroup.appendChild(this.currentToolbarEle)}},T4t.prototype.performToolBarAction=function(e){var t=e.target,i=(e.stopImmediatePropagation(),"touch"===e.pointerType||"2"===e.pointerType||-1<e.type.indexOf("touch")),t=t.id.split("_Zooming_ToolBar_")[1].split("_")[0],n=!0;switch(t.toLowerCase()){case"zoomin":n=(this.maps.isTileMap?this.maps.tileZoomLevel:this.maps.scale)+1<=this.maps.zoomSettings.maxZoom;break;case"zoomout":var o=this.maps.isTileMap?this.maps.tileZoomLevel:this.maps.scale,n="Miller"===this.maps.projectionType||"Winkel3"===this.maps.projectionType||"AitOff"===this.maps.projectionType?Math.round(o)-1>=this.maps.zoomSettings.minZoom:o-1>=this.maps.zoomSettings.minZoom;break;case"reset":n=Math.round(this.maps.isTileMap?this.maps.tileZoomLevel:this.maps.scale)!==this.maps.zoomSettings.minZoom}i&&n?(this.handled=!0,this.performZoomingByToolBar(t)):"mousedown"!==e.type&&"pointerdown"!==e.type||this.handled||!n?this.handled=!1:(this.handled=!1,this.performZoomingByToolBar(t))},T4t.prototype.performZoomingByToolBar=function(e){var t=this.maps,i=(t.isReset=!1,0),n=this.fillColor||this.maps.themeStyle.zoomFillColor;switch(e.toLowerCase()){case"zoom":this.panColor=n,this.zoomColor=this.maps.zoomSettings.enableSelectionZooming?this.selectionColor:n,this.applySelection(this.zoomElements,this.zoomColor),this.applySelection(this.panElements,this.panColor),this.isPan=!1,this.isZoomSelection=this.maps.zoomSettings.enableSelectionZooming;break;case"pan":this.panColor=this.maps.zoomSettings.enablePanning?this.selectionColor:n,this.zoomColor=n,this.maps.zoomSettings.enablePanning?this.applySelection(this.zoomElements,this.fillColor||n):this.applySelection(this.zoomElements,this.selectionColor),this.applySelection(this.panElements,this.panColor),this.isPan=this.maps.zoomSettings.enablePanning,this.isZoomSelection=!1;break;case"zoomin":t.staticMapZoom=t.tileZoomLevel,0<t.staticMapZoom&&t.staticMapZoom<t.zoomSettings.maxZoom&&(t.staticMapZoom+=1),t.isTileMap&&t.tileZoomLevel>=t.zoomSettings.minZoom&&t.tileZoomLevel<t.zoomSettings.maxZoom?this.toolBarZooming(t.tileZoomLevel+1,"ZoomIn"):t.isTileMap||this.toolBarZooming(t.scale+1,"ZoomIn"),i=this.maps.isTileMap?Math.round(this.maps.tileZoomLevel):Math.round(this.maps.mapScaleValue),this.isZoomSelection||(i===t.zoomSettings.maxZoom||1<i||1===i&&this.maps.isTileMap?(this.applySelection(this.zoomElements,n),this.applySelection(this.panElements,t.zoomSettings.enablePanning?this.selectionColor:n)):1!==i||this.maps.isTileMap||(this.applySelection(this.zoomElements,n),this.applySelection(this.panElements,n)));break;case"zoomout":t.staticMapZoom=t.tileZoomLevel,t.markerCenterLatitude=null,t.markerCenterLongitude=null,this.toolBarZooming((t.isTileMap?t.tileZoomLevel:t.scale)-1,"ZoomOut"),i=this.maps.isTileMap?Math.round(this.maps.tileZoomLevel):Math.round(this.maps.mapScaleValue),!this.isPan&&this.isZoomSelection?(this.panColor=n,this.zoomColor=this.selectionColor,this.applySelection(this.zoomElements,this.selectionColor),this.applySelection(this.panElements,this.panColor)):i<=1&&!t.isTileMap?this.applySelection(this.panElements,n):this.applySelection(this.panElements,t.zoomSettings.enablePanning?this.selectionColor:n);break;case"reset":t.staticMapZoom=t.zoomSettings.enable?t.zoomSettings.zoomFactor:0,t.markerCenterLatitude=null,t.markerCenterLongitude=null,this.isZoomSelection=!1,this.isPan=t.zoomSettings.enablePanning,this.toolBarZooming(t.zoomSettings.minZoom,"Reset"),this.isPan&&!this.isZoomSelection||!this.isPan&&this.isZoomSelection?this.maps.zoomSettings.enablePanning?(this.applySelection(this.zoomElements,n),this.applySelection(this.panElements,this.selectionColor)):(this.applySelection(this.zoomElements,this.selectionColor),this.applySelection(this.panElements,n)):this.isPan||this.isZoomSelection||(this.applySelection(this.zoomElements,n),this.applySelection(this.panElements,n))}this.panningStyle(e.toLowerCase())},T4t.prototype.panningStyle=function(e){var t=kzt(this.maps.element.id+"_svg");"pan"===e||this.isPanModeEnabled&&"reset"!==e?t.setAttribute("class","e-maps-panning"):t.setAttribute("class","")},T4t.prototype.applySelection=function(e,t){if(e)for(var i,n=0;n<e.childElementCount;n++)"circle"!==(i=e.childNodes[n]).tagName&&(i.setAttribute("fill",-1<e.id.indexOf("Pan")?t:"transparent"),i.setAttribute("stroke",t))},T4t.prototype.showTooltip=function(e){var t=e.target.id.split("_Zooming_ToolBar_")[1].split("_")[0],i=this.maps.zoomSettings.toolbarSettings.tooltipSettings,i={visible:i.visible,fill:i.fill,borderOpacity:i.borderOpacity,borderWidth:i.borderWidth,borderColor:i.borderColor,fontColor:i.fontColor,fontFamily:i.fontFamily,fontStyle:i.fontStyle,fontWeight:i.fontWeight,fontSize:i.fontSize||"10px",fontOpacity:i.fontOpacity};i.fontFamily=this.maps.themeStyle.fontFamily,this.isTouch||(Yzt("EJ2_Map_Toolbar_Tip",this.maps.getLocalizedLabel(t),e.pageY+10,e.pageX+10,i),this.maps.isDevice&&(clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)))},T4t.prototype.removeTooltip=function(){kzt("EJ2_Map_Toolbar_Tip")&&ue(kzt("EJ2_Map_Toolbar_Tip"))},T4t.prototype.alignToolBar=function(){var e=this.maps,t=Q("div",{id:e.element.id+"_ToolBar"}),i=(t.style.cssText="position:absolute;z-index:2",e.renderer.createSvg({id:e.element.id+"_Zooming_ToolBar",width:10,height:10})),n=(i.appendChild(this.toolBarGroup),t.appendChild(i),kzt(e.element.id+"_Secondary_Element")&&kzt(e.element.id+"_Secondary_Element").appendChild(t),this.toolBarGroup.getBoundingClientRect()),o=(i.setAttribute("height",(n.height+e.zoomSettings.toolbarSettings.borderWidth).toString()),i.setAttribute("width",(n.width+e.zoomSettings.toolbarSettings.borderWidth).toString()),je(e.totalRect)?e.mapAreaRect:e.totalRect),r=0,s=0;switch(e.toolbarProperties.verticalAlignment){case"Near":s=o.y;break;case"Center":s=o.height/2-n.height/2;break;case"Far":s=o.height-n.height-10}switch(e.toolbarProperties.horizontalAlignment){case"Near":r=o.x;break;case"Center":r=o.width/2-n.width/2;break;case"Far":r=je(e.legendModule)||"Left"!==e.legendSettings.position?o.width-n.width-10:o.width+o.x-n.width-10}t.style.left=r+"px",t.style.top=s+"px";var i=this.maps.toolbarProperties.highlightColor||this.maps.themeStyle.zoomSelectionColor,i=" .e-maps-toolbar:hover > circle { stroke:"+i+"; } .e-maps-toolbar:hover > path { fill: "+i+" ;  stroke: "+i+"; }.e-maps-toolbar:hover { cursor: pointer; } .e-maps-cursor-disable:hover { cursor: not-allowed; } .e-maps-panning:hover { cursor: pointer; } .e-maps-popup-close { display: block; opacity: 0; }",a=document.createElement("style");a.appendChild(document.createTextNode(i)),t.appendChild(a)},T4t.prototype.removeToolbarOpacity=function(e,t){var i;!je(this.maps)&&this.maps.zoomModule&&this.maps.zoomSettings.enable&&(kzt(this.maps.element.id+"_Zooming_KitCollection")&&-1<t.indexOf(this.maps.element.id+"_Zooming_")?(this.maps.isDevice?(kzt(this.maps.element.id+"_Zooming_KitCollection").setAttribute("opacity","1"),this.removeToolbarClass("","","","","")):this.removeToolbarClass(this.maps.zoomSettings.enableSelectionZooming?"e-maps-toolbar":"","e-maps-toolbar","e-maps-toolbar",this.maps.zoomSettings.enablePanning?"e-maps-toolbar":"","e-maps-toolbar"),t=this.maps.toolbarProperties.shapeOpacity,i=this.maps.toolbarProperties.borderOpacity,this.maps.isTileMap&&(e<=1.1||this.maps.zoomSettings.minZoom===e)?(this.maps.isDevice||this.removeToolbarClass(this.maps.zoomSettings.enableSelectionZooming?"e-maps-toolbar":"","e-maps-toolbar","",this.maps.zoomSettings.enablePanning?"e-maps-toolbar":"",""),this.maps.zoomSettings.enablePanning&&this.removePanColor(this.maps.toolbarProperties.selectionColor||this.maps.themeStyle.zoomSelectionColor),this.isZoomSelection&&this.maps.zoomSettings.enableSelectionZooming&&!this.maps.isReset&&(this.removeZoomColor(this.maps.toolbarProperties.selectionColor||this.maps.themeStyle.zoomSelectionColor),this.removePanColor(this.maps.toolbarProperties.color||this.maps.themeStyle.zoomFillColor)),this.removeZoomOpacity(this.maps.zoomSettings.enableSelectionZooming?t:.3,this.maps.zoomSettings.enableSelectionZooming?i:.3,t,i,.3,.3,this.maps.zoomSettings.enablePanning?t:.3,this.maps.zoomSettings.enablePanning?i:.3,.3,.3)):e<=1.1||this.maps.zoomSettings.minZoom===e?(this.maps.isDevice||this.removeToolbarClass(this.maps.zoomSettings.enableSelectionZooming?"e-maps-toolbar":"","e-maps-toolbar","","",""),!this.isZoomSelection&&this.maps.zoomSettings.enablePanning&&this.removePanColor(this.maps.toolbarProperties.color||this.maps.themeStyle.zoomFillColor),this.isZoomSelection&&this.maps.zoomSettings.enableSelectionZooming&&!this.maps.isReset&&(this.removeZoomColor(this.maps.toolbarProperties.selectionColor||this.maps.themeStyle.zoomSelectionColor),this.removePanColor(this.maps.toolbarProperties.color||this.maps.themeStyle.zoomFillColor)),this.removeZoomOpacity(this.maps.zoomSettings.enableSelectionZooming?t:.3,this.maps.zoomSettings.enableSelectionZooming?i:.3,t,i,.3,.3,.3,.3,.3,.3)):e<this.maps.zoomSettings.maxZoom?(this.maps.isDevice||this.removeToolbarClass(this.maps.zoomSettings.enableSelectionZooming?"e-maps-toolbar":"","e-maps-toolbar","e-maps-toolbar",this.maps.zoomSettings.enablePanning?"e-maps-toolbar":"","e-maps-toolbar"),this.maps.zoomModule.isZoomFinal?this.maps.zoomModule.isZoomFinal=!1:this.removeZoomOpacity(this.maps.zoomSettings.enableSelectionZooming?t:.3,this.maps.zoomSettings.enableSelectionZooming?i:.3,t,i,t,i,this.maps.zoomSettings.enablePanning?t:.3,this.maps.zoomSettings.enablePanning?i:.3,t,i),this.isZoomSelection&&this.maps.zoomSettings.enableSelectionZooming?(this.removeZoomColor(this.maps.toolbarProperties.selectionColor||this.maps.themeStyle.zoomSelectionColor),this.maps.zoomModule.isPan&&this.maps.zoomSettings.enablePanning&&this.removePanColor(this.maps.toolbarProperties.color||this.maps.themeStyle.zoomFillColor)):!this.isZoomSelection&&this.maps.zoomSettings.enablePanning&&(this.removePanColor(this.maps.toolbarProperties.selectionColor||this.maps.themeStyle.zoomSelectionColor),this.maps.zoomSettings.enableSelectionZooming)&&this.removeZoomColor(this.maps.toolbarProperties.color||this.maps.themeStyle.zoomFillColor)):(this.maps.isDevice||this.removeToolbarClass("","","e-maps-toolbar",this.maps.zoomSettings.enablePanning?"e-maps-toolbar":"","e-maps-toolbar"),this.removeZoomOpacity(.3,.3,.3,.3,t,i,this.maps.zoomSettings.enablePanning?t:.3,this.maps.zoomSettings.enablePanning?i:.3,t,i),this.maps.zoomSettings.enableSelectionZooming&&this.removeZoomColor(this.maps.toolbarProperties.color||this.maps.themeStyle.zoomFillColor),!this.isZoomSelection&&this.maps.zoomSettings.enablePanning&&this.removePanColor(this.maps.toolbarProperties.selectionColor||this.maps.themeStyle.zoomSelectionColor))):this.maps.isDevice||(this.removePanColor(this.maps.toolbarProperties.color||this.maps.themeStyle.zoomFillColor),this.removeZoomColor(this.maps.toolbarProperties.color||this.maps.themeStyle.zoomFillColor),this.removeZoomOpacity(1,1,1,1,1,1,1,1,1,1)))},T4t.prototype.setOpacity=function(e,t,i,n){kzt(this.maps.element.id+e)&&(kzt(this.maps.element.id+e).setAttribute("stroke-opacity",i.toString()),kzt(this.maps.element.id+e).setAttribute("fill-opacity",i.toString()),kzt(this.maps.element.id+t).setAttribute("stroke-opacity",n.toString()),kzt(this.maps.element.id+t).setAttribute("fill-opacity",n.toString()))},T4t.prototype.removeZoomOpacity=function(e,t,i,n,o,r,s,a,l,h){this.setOpacity("_Zooming_ToolBar_Zoom_Rect","_Zooming_ToolBar_Zoom",t,e),this.setOpacity("_Zooming_ToolBar_ZoomIn_Rect","_Zooming_ToolBar_ZoomIn_Path",n,i),this.setOpacity("_Zooming_ToolBar_ZoomOut_Rect","_Zooming_ToolBar_ZoomOut",r,o),this.setOpacity("_Zooming_ToolBar_Pan_Rect","_Zooming_ToolBar_Pan",a,s),this.setOpacity("_Zooming_ToolBar_Reset_Rect","_Zooming_ToolBar_Reset",h,l)},T4t.prototype.removeToolbarClass=function(e,t,i,n,o){kzt(this.maps.element.id+"_Zooming_KitCollection")&&(document.getElementById(this.maps.element.id+"_Zooming_ToolBar_ZoomIn_Group")&&kzt(this.maps.element.id+"_Zooming_ToolBar_ZoomIn_Group").setAttribute("class",t),document.getElementById(this.maps.element.id+"_Zooming_ToolBar_ZoomOut_Group")&&kzt(this.maps.element.id+"_Zooming_ToolBar_ZoomOut_Group").setAttribute("class",i),document.getElementById(this.maps.element.id+"_Zooming_ToolBar_Reset_Group")&&kzt(this.maps.element.id+"_Zooming_ToolBar_Reset_Group").setAttribute("class",o),document.getElementById(this.maps.element.id+"_Zooming_ToolBar_Zoom_Group")&&this.maps.zoomSettings.enableSelectionZooming&&kzt(this.maps.element.id+"_Zooming_ToolBar_Zoom_Group").setAttribute("class",e),document.getElementById(this.maps.element.id+"_Zooming_ToolBar_Pan_Group"))&&this.maps.zoomSettings.enablePanning&&kzt(this.maps.element.id+"_Zooming_ToolBar_Pan_Group").setAttribute("class",n)},T4t.prototype.removePanColor=function(e){kzt(this.maps.element.id+"_Zooming_ToolBar_Pan_Rect")&&this.maps.zoomSettings.enablePanning&&(kzt(this.maps.element.id+"_Zooming_ToolBar_Pan").setAttribute("fill",e),kzt(this.maps.element.id+"_Zooming_ToolBar_Pan").setAttribute("stroke",e))},T4t.prototype.removeZoomColor=function(e){kzt(this.maps.element.id+"_Zooming_ToolBar_Zoom_Rect")&&this.maps.zoomSettings.enableSelectionZooming&&(kzt(this.maps.element.id+"_Zooming_ToolBar_Zoom").setAttribute("fill","transparent"),kzt(this.maps.element.id+"_Zooming_ToolBar_Zoom").setAttribute("stroke",e))},T4t.prototype.wireEvents=function(e,t){E.add(e,F.touchStartEvent,t,this),E.add(e,"mouseover",this.showTooltip,this),E.add(e,"mouseout",this.removeTooltip,this)},T4t.prototype.mapMouseWheel=function(e){var t,i,n,o,r;this.maps.zoomSettings.enable&&this.maps.zoomSettings.mouseWheelZoom&&((t=this.maps).markerZoomedState=!1,t.zoomPersistence=t.enablePersistence,i=this.getMousePosition(e.pageX,e.pageY),o=t.tileZoomLevel,r=t.scale,n=t.zoomSettings.maxZoom,o=t.isTileMap?o:r,this.maps.mergeCluster(),i.x>t.mapAreaRect.x&&i.x<t.mapAreaRect.x+t.mapAreaRect.width&&i.y>t.mapAreaRect.y&&i.y<t.mapAreaRect.y+t.mapAreaRect.height&&(e.preventDefault(),"ZoomIn"==(r="mozilla"!==this.browserName||this.isPointer?0<e.wheelDelta/120?"ZoomIn":"ZoomOut":0<-e.detail/3?"ZoomIn":"ZoomOut")?(t.mapScaleValue=o+1,t.isTileMap?(t.staticMapZoom=t.tileZoomLevel,0<t.staticMapZoom&&t.staticMapZoom<n&&(t.staticMapZoom+=1,this.performZooming(i,o+1,r,!0))):this.performZooming(i,o+1,r,!0)):(t.mapScaleValue=o-1,t.isReset=t.mapScaleValue<1,t.staticMapZoom=t.tileZoomLevel,1===t.mapScaleValue&&(t.markerCenterLatitude=null,t.markerCenterLongitude=null),1<t.staticMapZoom&&t.staticMapZoom<n&&--t.staticMapZoom,this.performZooming(i,o-1,r,!0))),this.removeToolbarOpacity(t.mapScaleValue,this.maps.isDevice?this.maps.element.id+"_Zooming_":(je(e.target)?this.maps.element:e.target).id))},T4t.prototype.doubleClick=function(e){var t=e.pageX,i=e.pageY,n=e.target.closest("#"+this.maps.element.id+"_mapsTooltipparent_template");this.maps.zoomSettings.enable&&this.maps.zoomSettings.doubleClickZoom&&!(-1<e.target.id.indexOf("_Zooming_"))&&je(n)&&(e=this.getMousePosition(t,i),t=(n=this.maps).tileZoomLevel,i=n.scale,n.mapScaleValue=n.mapScaleValue+1,t=n.isTileMap?t:i,e.x>n.mapAreaRect.x)&&e.x<n.mapAreaRect.x+n.mapAreaRect.width&&e.y>n.mapAreaRect.y&&e.y<n.mapAreaRect.y+n.mapAreaRect.height&&this.performZooming(e,t+1,"ZoomIn")},T4t.prototype.mouseDownHandler=function(e){var t,i,n=null,o=(this.isPinchZooming=!1,e.target,"touchstart"===e.type?(this.isTouch=!0,n=e.touches,e.target,i=n[0].pageX,t=n[0].pageY):(i=e.pageX,t=e.pageY,e.target),this.isTouch||e.preventDefault(),this.maps.zoomSettings.enablePanning?this.isPan=this.isPanModeEnabled=!this.isZoomSelection:this.isPan=this.isPanModeEnabled=this.panColor!==this.selectionColor?this.maps.zoomSettings.enablePanning:this.zoomColor===this.selectionColor,this.mouseDownLatLong={x:i,y:t},this.maps.isTileMap?Math.round(this.maps.tileZoomLevel):Math.round(this.maps.mapScaleValue));this.rectZoomingStart=this.isZoomSelection&&o<this.maps.zoomSettings.maxZoom&&this.maps.zoomSettings.enable,this.mouseDownPoints=this.getMousePosition(i,t),this.isTouch&&null!==n&&(this.firstMove=!0,this.pinchFactor=this.maps.scale,this.fingers=n.length),this.maps.isTileMap&&this.isTouch&&1<e.touches.length&&(o=this.getMousePosition(e.touches[0].pageX,e.touches[0].pageY),i=this.getMousePosition(e.touches[1].pageX,e.touches[1].pageY),this.startDistance=Math.sqrt(Math.pow(o.x-i.x,2)+Math.pow(o.y-i.y,2)),this.touchCenter={x:(o.x+i.x)/2,y:(o.y+i.y)/2},this.pinchStartLatLong=this.maps.pointToLatLong((o.x+i.x)/2,(o.y+i.y)/2),this.isCancellation=!1,this.pinchTileZoomScale=this.maps.tileZoomLevel,this.pinchDistance=null),this.isSingleClick=!0},T4t.prototype.mouseMoveHandler=function(e){var t,i,n,o=this.maps,r=null,s=this.maps.zoomSettings;"touchmove"===e.type?(this.isTouch=!0,n=e.target,t=(r=e.touches)[0].pageX,i=r[0].pageY):(t=e.pageX,i=e.pageY,n=e.target),kzt(o.element.id+"_Zooming_KitCollection")&&(-1<n.id.indexOf("_Zooming_")?kzt(o.element.id+"_Zooming_KitCollection").setAttribute("opacity","1"):o.isDevice||kzt(o.element.id+"_Zooming_KitCollection").setAttribute("opacity","fluentdark"===o.theme.toLowerCase()?"0.6":"0.3")),this.isTouch&&this.maps.zoomSettings.enable&&this.maps.zoomSettings.pinchZooming&&null!==r&&(this.firstMove&&2===r.length?(this.rectZoomingStart=!1,this.updateInteraction(),this.touchStartList=tjt(e)):2===r.length&&2===this.touchStartList.length&&(this.touchMoveList=tjt(e),e.cancelable&&e.preventDefault(),this.rectZoomingStart=!1,this.performPinchZooming(e)),this.firstMove=!1),this.mouseMovePoints=this.getMousePosition(t,i),!this.isPinchZooming&&s.enable&&this.isPanModeEnabled&&-1===this.maps.markerDragId.indexOf("_MarkerIndex_")&&(F.isDevice&&1<=r.length||!F.isDevice)&&(e.preventDefault(),this.maps.element.style.cursor="pointer",this.mouseMoveLatLong={x:t,y:i},this.mouseDownLatLong.x!==this.mouseMoveLatLong.x)&&this.mouseDownLatLong.y!==this.mouseMoveLatLong.y&&(this.maps.zoomSettings.enablePanning&&this.panning("None",null,null,e),this.mouseDownLatLong.x=t,this.mouseDownLatLong.y=i),this.isPinchZooming||this.isTouch&&(null===r||1!==r.length)||!this.rectZoomingStart||(e.preventDefault(),n=this.maps.isTileMap?Math.round(this.maps.tileZoomLevel):Math.round(this.maps.mapScaleValue),this.maps.zoomSettings.enableSelectionZooming&&n<this.maps.zoomSettings.maxZoom?this.drawZoomRectangle():(this.rectZoomingStart=!1,this.isPan=!0))},T4t.prototype.mouseUpHandler=function(e){this.rectZoomingStart=!1,this.isSingleClick=!!this.isSingleClick,this.isTouch=!1,this.touchStartList=[],this.touchMoveList=[],this.lastScale=1,this.isCancellation=!1,this.maps.element.style.cursor="auto",this.isPinchZooming&&this.maps.isTileMap&&(this.isPinchZooming=!1,t=document.getElementById(this.maps.element.id+"_tile_parent"),n=document.getElementById(this.maps.element.id+"_Tile_SVG_Parent"),t.style.transformOrigin="",t.style.transform="",n.style.transformOrigin="",n.style.transform="",this.maps.tileZoomLevel=this.maps.mapScaleValue=this.maps.zoomSettings.zoomFactor=this.pinchZoomScale,this.maps.scale=Math.pow(2,this.pinchZoomScale-1),this.tileZoomLevel=Math.round(this.pinchZoomScale),this.getTileTranslate(this.tileZoomLevel),this.maps.mapLayerPanel.generateTiles(this.tileZoomLevel,this.maps.tileTranslatePoint),this.applyTransform(this.maps),document.getElementById(this.maps.element.id+"_animates_tiles"))&&document.getElementById(this.maps.element.id+"_animates_tiles").remove(),this.isPanModeEnabled&&this.maps.zoomSettings.enablePanning&&!je(this.maps.previousPoint)&&(this.maps.isTileMap?this.isPanningInProgress:this.maps.translatePoint.x!==this.maps.previousPoint.x&&this.maps.translatePoint.y!==this.maps.previousPoint.y)&&(n=t=void 0,r=s=0,i=e.target,e=void(-1!==e.type.indexOf("touch")?(s=t=e.changedTouches[0].pageX,r=(n=e.changedTouches[0].pageY)-(this.maps.isTileMap?10:0),e.target,this.maps.mouseClickEvent={x:t,y:n}):(t=e.pageX,n=e.pageY,s=e.layerX,r=e.layerY-(this.maps.isTileMap?10:0),e.target)),o=this.maps.getMinMaxLatitudeLongitude(),e=this.maps.isTileMap?(s=this.maps.getTileGeoLocation(s,r),{cancel:!1,name:"panComplete",maps:this.maps,tileTranslatePoint:{previous:this.maps.tileTranslatePoint,current:this.maps.tileTranslatePoint},translatePoint:{previous:this.maps.previousPoint,current:this.maps.translatePoint},scale:this.maps.scale,tileZoomLevel:this.maps.tileZoomLevel,latitude:s.latitude,longitude:s.longitude,minLatitude:o.minLatitude,maxLatitude:o.maxLatitude,minLongitude:o.minLongitude,maxLongitude:o.maxLongitude}):(this.maps.mouseClickEvent.x=this.maps.mouseDownEvent.x,this.maps.mouseClickEvent.y=this.maps.mouseDownEvent.y,r=this.maps.getClickLocation(i.id,t,n,i,t,n),{cancel:!1,name:"panComplete",maps:this.maps,tileTranslatePoint:{},translatePoint:{previous:this.maps.previousPoint,current:this.maps.translatePoint},scale:this.maps.scale,tileZoomLevel:this.maps.tileZoomLevel,latitude:je(r)?0:r.latitude,longitude:je(r)?0:r.longitude,minLatitude:o.minLatitude,maxLatitude:o.maxLatitude,minLongitude:o.minLongitude,maxLongitude:o.maxLongitude}),this.maps.trigger("panComplete",e)),this.isPanModeEnabled=!1,this.isPanningInProgress=!1;var t,i,n,o,r,s=kzt(this.maps.element.id+"_Selection_Rect_Zooming");s&&this.maps.zoomSettings.enable&&this.maps.zoomSettings.enableSelectionZooming&&(ue(s),this.performRectZooming()),this.mouseMoveLatLong={x:0,y:0},this.mouseDownLatLong={x:0,y:0},this.pinchDistance=null},T4t.prototype.mouseCancelHandler=function(e){this.isPanModeEnabled=!1,this.isTouch=!1,this.rectZoomingStart=!1;var t=kzt(this.maps.element.id+"_Selection_Rect_Zooming");t&&this.maps.zoomSettings.enable&&(ue(t),this.performRectZooming())},T4t.prototype.click=function(e){var t,i=this.maps,n=e.target.closest("#"+this.maps.element.id+"_mapsTooltipparent_template");if(i.markerModule&&0<i.markerModule.sameMarkerData.length||-1<e.target.id.indexOf("MarkerIndex")&&-1===e.target.id.indexOf("cluster")||!je(n))return null;!this.isSingleClick||!i.zoomSettings.zoomOnClick||-1<e.target.id.indexOf("_Zooming_")||i.zoomSettings.doubleClickZoom||this.zoomColor===this.selectionColor||(n=e.pageX,e=e.pageY,n=this.getMousePosition(n,e),e=i.tileZoomLevel,t=i.scale,i.mapScaleValue=i.mapScaleValue+1,e=i.isTileMap?e:t,n.x>i.mapAreaRect.x&&n.x<i.mapAreaRect.x+i.mapAreaRect.width&&n.y>i.mapAreaRect.y&&n.y<i.mapAreaRect.y+i.mapAreaRect.height&&this.performZooming(n,e+1,"ZoomIn"))},T4t.prototype.getMousePosition=function(e,t){var i=this.maps,n=i.element.getBoundingClientRect(),o=i.element.ownerDocument.defaultView.pageXOffset,r=i.element.ownerDocument.defaultView.pageYOffset,s=i.element.ownerDocument.documentElement.clientTop,i=i.element.ownerDocument.documentElement.clientLeft,o=n.left+o-i,i=n.top+r-s;return new wHt(Math.abs(e-o),Math.abs(t-i))},T4t.prototype.addEventListener=function(){this.maps.isDestroyed||(E.add(this.maps.element,this.wheelEvent,this.mapMouseWheel,this),E.add(this.maps.element,"click",this.click,this),E.add(this.maps.element,"dblclick",this.doubleClick,this),this.maps.on(F.touchMoveEvent,this.mouseMoveHandler,this),this.maps.on(F.touchStartEvent,this.mouseDownHandler,this),this.maps.on(F.touchEndEvent,this.mouseUpHandler,this),E.add(this.maps.element,this.cancelEvent,this.mouseCancelHandler,this))},T4t.prototype.removeEventListener=function(){if(!this.maps.isDestroyed){E.remove(this.maps.element,this.wheelEvent,this.mapMouseWheel),E.remove(this.maps.element,"click",this.click),E.remove(this.maps.element,"dblclick",this.doubleClick),this.maps.off(F.touchMoveEvent,this.mouseMoveHandler),this.maps.off(F.touchStartEvent,this.mouseDownHandler),this.maps.off(F.touchEndEvent,this.mouseUpHandler),E.remove(this.maps.element,this.cancelEvent,this.mouseCancelHandler);var e=document.getElementById(this.maps.element.id+"_Zooming_KitCollection");if(e)for(var t=0;t<e.childNodes.length;t++)"g"===e.childNodes[t].tagName&&(E.add(e.childNodes[t],F.touchStartEvent,this.performToolBarAction),E.add(e.childNodes[t],"mouseover",this.showTooltip),E.add(e.childNodes[t],"mouseout",this.removeTooltip))}},T4t.prototype.getModuleName=function(){return"Zoom"},T4t.prototype.destroy=function(){this.toolBarGroup=null,this.currentToolbarEle=null,this.zoomingRect=null,this.zoomElements=null,this.panElements=null,this.baseTranslatePoint=null,this.touchStartList=null,this.touchMoveList=null,this.previousTouchMoveList=null,this.mouseDownPoints=null,this.mouseMovePoints=null,this.startTouches=[],this.mouseDownLatLong=null,this.mouseMoveLatLong=null,this.layerCollectionEle=null,this.currentLayer=null,this.pinchDistance=null,this.maps.refreshing||(this.maps=null)};V2t=T4t;function T4t(e){this.isPanModeEnabled=!1,this.mouseEnter=!1,this.isTouch=!1,this.rectZoomingStart=!1,this.browserName=F.info.name,this.isPointer=F.isPointer,this.handled=!1,this.isPanningInProgress=!1,this.isPan=!1,this.isZoomFinal=!1,this.isZoomSelection=!1,this.pinchFactor=1,this.startTouches=[],this.isCancellation=!1,this.pinchTileZoomScale=1,this.tileZoomLevel=1,this.pinchZoomScale=1,this.isPinchZooming=!1,this.mouseDownLatLong={x:0,y:0},this.mouseMoveLatLong={x:0,y:0},this.isSingleClick=!1,this.maps=e,this.wheelEvent="mozilla"!==this.browserName||this.isPointer?"mousewheel":"DOMMouseScroll",this.cancelEvent=this.isPointer?"pointerleave":"mouseleave",this.selectionColor=this.maps.zoomSettings.toolbarSettings.buttonSettings.selectionColor,this.fillColor=this.maps.zoomSettings.toolbarSettings.buttonSettings.color,this.addEventListener()}E4t.prototype.print=function(e,t){var i=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),n=(i.moveTo(0,0),i.resizeTo(screen.availWidth,screen.availHeight),{cancel:!1,htmlContent:this.getHTMLContent(e,t),name:r4t});e.trigger("beforePrint",n,function(e){n.cancel||V(n.htmlContent,i)})},E4t.prototype.getHTMLContent=function(e,t){var i,n=Q("div"),o=e.element.cloneNode(!0),r=e.isTileMap?o.getElementsByTagName("svg")[1]:o.getElementsByTagName("svg")[0];if(je(r)||je(r=r.childNodes[0])||(i=r.getAttribute("fill"),"Tailwind"!==e.theme&&"Tailwind3"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==i&&"transparent"!==i?"TailwindDark"!==e.theme&&"Tailwind3Dark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==i&&"transparent"!==i||r.setAttribute("fill","rgba(0, 0, 0, 1)"):r.setAttribute("fill","rgba(255,255,255, 1)")),e.isTileMap)for(var s=0;s<o.childElementCount;s++)if(o.children[s].id===e.element.id+"_tile_parent"){o.children[s].style.removeProperty("height"),o.children[s].style.removeProperty("width"),o.children[s].style.removeProperty("top"),o.children[s].style.removeProperty("left"),o.children[s].style.removeProperty("right"),o.children[s].style.removeProperty("overflow");var a=document.getElementById(e.element.id+"_Tile_SVG_Parent");o.children[s].children[0].style.overflow="hidden",o.children[s].children[0].style.position="absolute",o.children[s].children[0].style.height=a.style.height,o.children[s].children[0].style.width=a.style.width,o.children[s].children[0].style.left=a.style.left,o.children[s].children[0].style.top=a.style.top;break}return t?t instanceof Array?Array.prototype.forEach.call(t,function(e){n.appendChild(Lzt(e).cloneNode(!0))}):t instanceof Element?n.appendChild(t.cloneNode(!0)):n.appendChild(Lzt(t).cloneNode(!0)):n.appendChild(o),n},E4t.prototype.getModuleName=function(){return"Print"},E4t.prototype.destroy=function(){};W2t=E4t;function E4t(e){}D4t.prototype.export=function(y,v,b,w){return new Promise(function(o,e){var r,s=Q("canvas",{id:"ej2-canvas",attrs:{width:y.availableSize.width.toString(),height:y.availableSize.height.toString()}}),a=!(-1<F.userAgent.toString().indexOf("HeadlessChrome")),l=document.getElementById(y.element.id+"_Tile_SVG_Parent"),t=kzt(y.element.id+"_svg").cloneNode(!0),h=t.childNodes[0].getAttribute("fill"),d=("Tailwind"!==y.theme&&"Tailwind3"!==y.theme&&"Bootstrap5"!==y.theme&&"Fluent"!==y.theme&&"Material3"!==y.theme&&"Fluent2"!==y.theme||"rgba(255,255,255, 0.0)"!==h&&"transparent"!==h?"TailwindDark"!==y.theme&&"Tailwind3Dark"!==y.theme&&"Bootstrap5Dark"!==y.theme&&"FluentDark"!==y.theme&&"Material3Dark"!==y.theme&&"Fluent2Dark"!==y.theme&&"Fluent2HighContrast"!==y.theme||"rgba(255,255,255, 0.0)"!==h&&"transparent"!==h||t.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):t.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)"),n=y.isTileMap?(r=kzt(y.element.id+"_Tile_SVG").cloneNode(!0),'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+t.outerHTML+r.outerHTML+"</svg>"):'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+t.outerHTML+"</svg>",window.URL.createObjectURL(new Blob("SVG"===v?[n]:[(new XMLSerializer).serializeToString(t)],{type:"image/svg+xml"})));if("SVG"===v)w?yHt(b,v,d,a):o(null);else{var i=new Image,p=s.getContext("2d");if(y.isTileMap){y.isExportInitialTileMap=!0;for(var n=document.getElementById(y.element.id+"_MapAreaBorder"),c=parseFloat(n.getAttribute("y")),u=parseFloat(n.getAttribute("x")),g=new XMLHttpRequest,m=y.mapLayerPanel.tiles.length,f=0;f<=m+1;f++)!function(t){var i=document.getElementById(y.element.id+"_tile_"+(t-1)),n=new Image,e=(n.crossOrigin="Anonymous",y.background||(!("Tailwind"!==y.theme&&"Tailwind3"!==y.theme&&"Bootstrap5"!==y.theme&&"Fluent"!==y.theme&&"Material3"!==y.theme||"rgba(255,255,255, 0.0)"!==h&&"transparent"!==h)||"TailwindDark"!==y.theme&&"Tailwind3Dark"!==y.theme&&"Bootstrap5Dark"!==y.theme&&"FluentDark"!==y.theme&&"Material3Dark"!==y.theme||"rgba(255,255,255, 0.0)"!==h&&"transparent"!==h?"#ffffff":"#000000")),e=(p.fillStyle=e,p.fillRect(0,0,y.availableSize.width,y.availableSize.height),p.font=y.titleSettings.textStyle.size+" Arial",document.getElementById(y.element.id+"_Map_title"));je(e)||(p.fillStyle=e.getAttribute("fill"),p.fillText(y.titleSettings.text,parseFloat(e.getAttribute("x")),parseFloat(e.getAttribute("y")))),n.onload=function(){var e;0===t||t===m+1?0===t?(p.setTransform(1,0,0,1,0,0),p.rect(0,c,parseFloat(l.style.width),parseFloat(l.style.height)),p.clip()):p.setTransform(1,0,0,1,u,c):p.setTransform(1,0,0,1,parseFloat(i.style.left)+u,parseFloat(i.style.top)+c),p.drawImage(n,0,0),t===m+1&&(localStorage.setItem("local-canvasImage",s.toDataURL("image/png")),e=localStorage.getItem("local-canvasImage"),w?(yHt(b,v,e,a),localStorage.removeItem("local-canvasImage"),y.isExportInitialTileMap=!1):(y.isExportInitialTileMap=!1,"PNG"===v?o(e):"JPEG"===v&&o(s.toDataURL("image/jpeg"))))},0===t||t===m+1?0===t?n.src=d:setTimeout(function(){n.src=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(r)],{type:"image/svg+xml"}))},300):(g.open("GET",i.children[0].getAttribute("src"),!0),g.send(),n.src=i.children[0].getAttribute("src"))}(f)}else i.onload=function(){p.drawImage(i,0,0),window.URL.revokeObjectURL(d),w?yHt(b,v,s.toDataURL("image/png").replace("image/png","image/octet-stream"),a):"PNG"===v?o(s.toDataURL("image/png")):"JPEG"===v&&o(s.toDataURL("image/jpeg"))},i.src=d}})},D4t.prototype.getModuleName=function(){return"ImageExport"},D4t.prototype.destroy=function(){};NVt=D4t;function D4t(e){}M4t.prototype.export=function(m,f,y,v,b){return new Promise(function(o){m.isTileMap&&(m.isExportInitialTileMap=!0);var r=Q("canvas",{id:"ej2-canvas",attrs:{width:m.availableSize.width.toString(),height:m.availableSize.height.toString()}}),s=(b=je(b)?up.Landscape:b,document.getElementById(m.element.id+"_Tile_SVG_Parent")),e=m.svgObject.cloneNode(!0),a=e.childNodes[0].getAttribute("fill"),l=("Tailwind"!==m.theme&&"Tailwind3"!==m.theme&&"Bootstrap5"!==m.theme&&"Fluent"!==m.theme&&"Material3"!==m.theme&&"Fluent2"!==m.theme||"rgba(255,255,255, 0.0)"!==a&&"transparent"!==a?"TailwindDark"!==m.theme&&"Tailwind3Dark"!==m.theme&&"Bootstrap5Dark"!==m.theme&&"FluentDark"!==m.theme&&"Material3Dark"!==m.theme&&"Fluent2Dark"!==m.theme&&"Fluent2HighContrast"!==m.theme||"rgba(255,255,255, 0.0)"!==a&&"transparent"!==a||e.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):e.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)"),window.URL.createObjectURL(new Blob("SVG"===f?[void 0]:[(new XMLSerializer).serializeToString(e)],{type:"image/svg+xml"}))),h=new sg,t=new Image,d=r.getContext("2d");if(m.isTileMap)for(var e=document.getElementById(m.element.id+"_MapAreaBorder"),p=parseFloat(e.getAttribute("y")),c=parseFloat(e.getAttribute("x")),u=new XMLHttpRequest,g=m.mapLayerPanel.tiles.length,i=0;i<=g+1;i++)!function(t){var i=document.getElementById(m.element.id+"_tile_"+(t-1)),n=new Image,e=(n.crossOrigin="Anonymous",m.background||(!("Tailwind"!==m.theme&&"Tailwind3"!==m.theme&&"Bootstrap5"!==m.theme&&"Fluent"!==m.theme&&"Material3"!==m.theme||"rgba(255,255,255, 0.0)"!==a&&"transparent"!==a)||"TailwindDark"!==m.theme&&"Tailwind3Dark"!==m.theme&&"Bootstrap5Dark"!==m.theme&&"FluentDark"!==m.theme&&"Material3Dark"!==m.theme||"rgba(255,255,255, 0.0)"!==a&&"transparent"!==a?"#ffffff":"#000000")),e=(d.fillStyle=e,d.fillRect(0,0,m.availableSize.width,m.availableSize.height),d.font=m.titleSettings.textStyle.size+" Arial",document.getElementById(m.element.id+"_Map_title"));je(e)||(d.fillStyle=e.getAttribute("fill"),d.fillText(m.titleSettings.text,parseFloat(e.getAttribute("x")),parseFloat(e.getAttribute("y")))),n.onload=function(){var e;0===t||t===g+1?0===t?(d.setTransform(1,0,0,1,0,0),d.rect(0,p,parseFloat(s.style.width),parseFloat(s.style.height)),d.clip()):d.setTransform(1,0,0,1,c,p):d.setTransform(1,0,0,1,parseFloat(i.style.left)+c,parseFloat(i.style.top)+p),d.drawImage(n,0,0),t===g+1&&"PDF"===f&&(localStorage.setItem("saved-image-example",r.toDataURL("image/jpeg")),e=localStorage.getItem("saved-image-example"),h.pageSettings.orientation=b,e=e.slice(e.indexOf(",")+1),h.pages.add().graphics.drawImage(new oc(e),0,0,m.availableSize.width-60,m.availableSize.height),m.isExportInitialTileMap=!1,v?(h.save(y+".pdf"),h.destroy()):o(null))},0===t||t===g+1?0===t?n.src=l:setTimeout(function(){var e=document.getElementById(m.element.id+"_Tile_SVG");n.src=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(e)],{type:"image/svg+xml"}))},300):(u.open("GET",i.children[0].getAttribute("src"),!0),u.send(),n.src=i.children[0].getAttribute("src"))}(i);else t.onload=function(){var e;d.drawImage(t,0,0),window.URL.revokeObjectURL(l),"PDF"===f&&(e=r.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream"),h.pageSettings.orientation=b,e=e.slice(e.indexOf(",")+1),h.pages.add().graphics.drawImage(new oc(e),0,0,m.availableSize.width-60,m.availableSize.height),v?(h.save(y+".pdf"),h.destroy()):o(null))},t.src=l})},M4t.prototype.getModuleName=function(){return"PdfExport"},M4t.prototype.destroy=function(){};Xet=M4t;function M4t(){}u2t.Inject(f2t,Bft,b2t,d,B2t,O2t,V2t,I2t,D2t,c4t,W2t,Xet,NVt,S2t);var k4t,P4t,Z$e=Object.freeze({__proto__:null,Maps:u2t,load:"load",loaded:"loaded",click:L3t,onclick:"onclick",rightClick:R3t,doubleClick:O3t,resize:N3t,tooltipRender:V3t,shapeSelected:_3t,shapeHighlight:H3t,mousemove:"mousemove",mouseup:"mouseup",mousedown:"mousedown",layerRendering:z3t,shapeRendering:j3t,markerRendering:W3t,markerClusterRendering:Q3t,markerClick:U3t,markerDragStart:q3t,markerDragEnd:"markerDragEnd",markerClusterClick:G3t,markerMouseMove:Y3t,mouseMove:"mouseMove",markerClusterMouseMove:X3t,dataLabelRendering:K3t,bubbleRendering:J3t,bubbleClick:Z3t,bubbleMouseMove:$3t,animationComplete:e4t,legendRendering:t4t,annotationRendering:i4t,itemSelection:n4t,panComplete:"panComplete",zoomComplete:"zoomComplete",itemHighlight:o4t,beforePrint:r4t,zoomIn:"zoomIn",zoomOut:"zoomOut",pan:"pan",Annotation:mft,Arrow:cft,Font:SOt,ZoomToolbarButtonSettings:IOt,ZoomToolbarTooltipSettings:DOt,ZoomToolbarSettings:POt,Border:LOt,CenterPosition:NOt,TooltipSettings:HOt,PolygonTooltipSettings:WOt,Margin:qOt,ConnectorLineSettings:XOt,MarkerClusterSettings:ZOt,MarkerClusterData:tNt,ColorMappingSettings:oNt,InitialMarkerSelectionSettings:aNt,InitialShapeSelectionSettings:dNt,SelectionSettings:uNt,HighlightSettings:fNt,PolygonSetting:bNt,PolygonSettings:SNt,NavigationLineSettings:INt,BubbleSettings:DNt,CommonTitleSettings:PNt,SubTitleSettings:LNt,TitleSettings:NNt,ZoomSettings:HNt,ToggleLegendSettings:WNt,LegendSettings:qNt,DataLabelSettings:XNt,ShapeSettings:ZNt,MarkerBase:t2t,MarkerSettings:E3t,LayerSettings:o2t,Tile:B3t,MapsAreaSettings:a2t,Size:eHt,stringToNumber:tHt,calculateSize:iHt,createSvg:nHt,getMousePosition:oHt,degreesToRadians:rHt,radiansToDegrees:sHt,convertGeoToPoint:aHt,calculatePolygonPath:lHt,convertTileLatLongToPoint:hHt,xToCoordinate:dHt,yToCoordinate:pHt,aitoff:cHt,roundTo:uHt,sinci:gHt,acos:mHt,calculateBound:fHt,triggerDownload:yHt,Point:wHt,RelativePoint:vHt,Coordinate:bHt,MinMax:CHt,GeoLocation:SHt,measureText:AHt,measureTextElement:xHt,TextOption:THt,PathOption:EHt,ColorValue:DHt,RectOption:MHt,CircleOption:BHt,PolygonOption:Qmt,PolylineOption:ost,LineOption:jee,Line:HHt,MapLocation:jHt,Rect:WHt,PatternOptions:zHt,renderTextElement:QHt,convertElement:UHt,formatValue:qHt,convertStringToValue:GHt,convertElementFromLabel:YHt,drawSymbols:XHt,getValueFromObject:KHt,markerColorChoose:JHt,markerShapeChoose:ZHt,clusterTemplate:izt,markerClusterListHandler:nzt,markerBoundsComparer:ozt,mergeSeparateCluster:rzt,clusterSeparate:szt,marker:azt,markerTemplate:lzt,maintainSelection:hzt,maintainToggleSelection:dzt,maintainStyleClass:pzt,appendShape:czt,drawCircle:uzt,drawRectangle:gzt,drawPath:function(e,t,i){return czt(e.renderer.drawPath(t),i)},drawPolygon:function(e,t,i){return czt(e.renderer.drawPolygon(t),i)},drawPolyline:function(e,t,i){return czt(e.renderer.drawPolyline(t),i)},drawLine:function(e,t,i){return czt(e.renderer.drawLine(t),i)},calculateShapes:mzt,drawDiamond:function(e,t,i,n,o){return t.d="M "+n.x+" "+(n.y-i.height/2)+" L "+(n.x+i.width/2)+" "+n.y+" L "+n.x+" "+(n.y+i.height/2)+" L "+(n.x-i.width/2)+" "+n.y+" Z",czt(e.renderer.drawPath(t),o)},drawTriangle:function(e,t,i,n,o){return t.d="M "+n.x+" "+(n.y-i.height/2)+" L "+(n.x+i.width/2)+" "+(n.y+i.height/2)+" L "+(n.x-i.width/2)+" "+(n.y+i.height/2)+" Z",czt(e.renderer.drawPath(t),o)},drawCross:function(e,t,i,n,o){return t.d="M "+n.x+" "+(n.y-i.height/2)+" L "+n.x+" "+(n.y+i.height/2)+" M "+(n.x-i.width/2)+" "+n.y+" L "+(n.x+i.width/2)+" "+n.y,czt(e.renderer.drawPath(t),o)},drawHorizontalLine:function(e,t,i,n,o){return t.d=" M "+(n.x-i.width/2)+" "+n.y+" L "+(n.x+i.width/2)+" "+n.y,czt(e.renderer.drawPath(t),o)},drawVerticalLine:function(e,t,i,n,o){return t.d="M "+n.x+" "+(n.y-i.height/2)+" L "+n.x+" "+(n.y+i.height/2),czt(e.renderer.drawPath(t),o)},drawStar:function(e,t,i,n,o){return t.d="M "+(n.x+i.width/3)+" "+(n.y+i.height/2)+" L "+(n.x-i.width/2)+" "+(n.y-i.height/6)+" L "+(n.x+i.width/2)+" "+(n.y-i.height/6)+" L "+(n.x-i.width/3)+" "+(n.y+i.height/2)+" L "+n.x+" "+(n.y-i.height/2)+" L "+(n.x+i.width/3)+" "+(n.y+i.height/2)+" Z",czt(e.renderer.drawPath(t),o)},drawBalloon:fzt,drawPattern:function(e,t,i,n){for(var o=e.renderer.createPattern(t,"pattern"),r=0,s=i;r<s.length;r++)czt(s[r],o);return czt(o,n)},getFieldData:function(e,t){for(var i=[],n=0,o=e;n<o.length;n++){for(var r=o[n],s={},a=0,l=t;a<l.length;a++){var h=l[a];r[h]&&(s[h]=r[h])}i.push(s)}return i},checkShapeDataFields:yzt,checkPropertyPath:vzt,filter:bzt,getRatioOfBubble:wzt,findMidPointOfPolygon:Czt,isCustomPath:Szt,textTrim:Azt,findPosition:xzt,removeElement:Izt,calculateCenterFromPixel:Tzt,getTranslate:Ezt,getZoomTranslate:Dzt,fixInitialScaleForTile:Mzt,getElementByID:kzt,getProcessedMarginValue:Pzt,Internalize:Bzt,getTemplateFunction:Fzt,getElement:Lzt,getShapeData:Rzt,triggerShapeEvent:Ozt,getElementsByClassName:Nzt,querySelector:Vzt,getTargetElement:_zt,createStyle:Hzt,customizeStyle:zzt,triggerItemSelectionEvent:jzt,removeClass:Wzt,elementAnimate:Qzt,timeout:Uzt,showTooltip:qzt,wordWrap:Gzt,createTooltip:Yzt,getHexColor:Xzt,drawSymbol:Kzt,renderLegendShape:Jzt,getElementOffset:Zzt,changeBorderWidth:$zt,changeNavaigationLineWidth:ejt,targetTouches:tjt,calculateScale:ijt,getDistance:njt,getTouches:ojt,getTouchCenter:rjt,sum:sjt,zoomAnimate:ajt,animate:ljt,MapAjax:hjt,smoothTranslate:pjt,compareZoomFactor:cjt,calculateZoomLevel:ujt,processResult:gjt,LayerPanel:d4t,Bubble:f2t,BingMap:s4t,Marker:b2t,Polygon:S2t,ColorMapping:l4t,DataLabel:I2t,NavigationLine:D2t,Legend:Bft,Highlight:d,Selection:B2t,MapsTooltip:O2t,Zoom:V2t,Annotations:c4t,Print:W2t,ImageExport:NVt,PdfExport:Xet}),N$e=(MH.Inject(e_),Object.freeze({__proto__:null,classNames:AH,FieldSettings:TH,ListView:MH,Virtualization:e_,get cssClass(){return $_},get ListBase(){return X_},getFieldValues:fH,Sortable:RH,moveTo:NH})),W$e=(k4t=function(e,t){return(k4t=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])}))(e,t)},function(e,t){function i(){this.constructor=e}k4t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),i0=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},hft=(W$e(B4t,P4t=n),i0([e("16px")],B4t.prototype,"size",void 0),i0([e("")],B4t.prototype,"color",void 0),i0([e("Segoe UI")],B4t.prototype,"fontFamily",void 0),i0([e("Regular")],B4t.prototype,"fontWeight",void 0),i0([e("Normal")],B4t.prototype,"fontStyle",void 0),i0([e(1)],B4t.prototype,"opacity",void 0),B4t);function B4t(){return null!==P4t&&P4t.apply(this,arguments)||this}W$e(L4t,F4t=n),i0([e("16px")],L4t.prototype,"size",void 0),i0([e("")],L4t.prototype,"fontFamily",void 0),i0([e("normal")],L4t.prototype,"fontWeight",void 0),i0([e("normal")],L4t.prototype,"fontStyle",void 0);var F4t,W=L4t;function L4t(){return null!==F4t&&F4t.apply(this,arguments)||this}W$e(O4t,R4t=n),i0([e(10)],O4t.prototype,"left",void 0),i0([e(10)],O4t.prototype,"right",void 0),i0([e(10)],O4t.prototype,"top",void 0),i0([e(10)],O4t.prototype,"bottom",void 0);var R4t,Sg=O4t;function O4t(){return null!==R4t&&R4t.apply(this,arguments)||this}W$e(V4t,N4t=n),i0([e(null)],V4t.prototype,"color",void 0),i0([e(0)],V4t.prototype,"width",void 0),i0([e("")],V4t.prototype,"dashArray",void 0);var N4t,gg=V4t;function V4t(){return null!==N4t&&N4t.apply(this,arguments)||this}W$e(H4t,_4t=n),i0([e("")],H4t.prototype,"content",void 0),i0([e(0)],H4t.prototype,"x",void 0),i0([e(0)],H4t.prototype,"y",void 0),i0([e("None")],H4t.prototype,"verticalAlignment",void 0),i0([e("None")],H4t.prototype,"horizontalAlignment",void 0),i0([e("-1")],H4t.prototype,"zIndex",void 0),i0([t({size:"12px",color:null},hft)],H4t.prototype,"font",void 0),i0([e(null)],H4t.prototype,"axisIndex",void 0),i0([e(null)],H4t.prototype,"axisValue",void 0);var _4t,Tg=H4t;function H4t(){return null!==_4t&&_4t.apply(this,arguments)||this}W$e(j4t,z4t=n),i0([e("Normal")],j4t.prototype,"type",void 0),i0([e(0)],j4t.prototype,"height",void 0),i0([e(0)],j4t.prototype,"width",void 0),i0([e(10)],j4t.prototype,"roundedCornerRadius",void 0),i0([e("transparent")],j4t.prototype,"backgroundColor",void 0),i0([t({width:1,color:null},gg)],j4t.prototype,"border",void 0),i0([e(0)],j4t.prototype,"offset",void 0);var z4t,vg=j4t;function j4t(){return null!==z4t&&z4t.apply(this,arguments)||this}W$e(Q4t,W4t=n),i0([e(null)],Q4t.prototype,"fill",void 0),i0([t({size:null,opacity:null,fontFamily:null,fontWeight:null},hft)],Q4t.prototype,"textStyle",void 0),i0([e(null)],Q4t.prototype,"format",void 0),i0([e(null)],Q4t.prototype,"template",void 0),i0([e(!0)],Q4t.prototype,"enableAnimation",void 0),i0([t({color:null,width:null},gg)],Q4t.prototype,"border",void 0),i0([e("End")],Q4t.prototype,"position",void 0),i0([e(!1)],Q4t.prototype,"showAtMousePosition",void 0);var W4t,Xd=Q4t;function Q4t(){return null!==W4t&&W4t.apply(this,arguments)||this}W$e(q4t,U4t=n),i0([e(!1)],q4t.prototype,"enable",void 0),i0([e("")],q4t.prototype,"fill",void 0),i0([t({color:"",size:null,opacity:null,fontFamily:null,fontWeight:null},hft)],q4t.prototype,"textStyle",void 0),i0([e(null)],q4t.prototype,"format",void 0),i0([e(!1)],q4t.prototype,"showAtMousePosition",void 0),i0([t({},Xd)],q4t.prototype,"rangeSettings",void 0),i0([e("End")],q4t.prototype,"position",void 0),i0([e(null)],q4t.prototype,"template",void 0),i0([e(!0)],q4t.prototype,"enableAnimation",void 0),i0([t({color:null,width:null},gg)],q4t.prototype,"border",void 0),i0([e("Pointer")],q4t.prototype,"type",void 0);var U4t,Pc=q4t;function q4t(){return null!==U4t&&U4t.apply(this,arguments)||this}G4t=function(e,t){return(G4t=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])}))(e,t)};var G4t,Y4t,Qg=function(e,t){function i(){this.constructor=e}G4t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Fm=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},nf=(Qg(X4t,Y4t=n),Fm([e("")],X4t.prototype,"dashArray",void 0),Fm([e(null)],X4t.prototype,"height",void 0),Fm([e(2)],X4t.prototype,"width",void 0),Fm([e(null)],X4t.prototype,"color",void 0),Fm([e(0)],X4t.prototype,"offset",void 0),X4t);function X4t(){return null!==Y4t&&Y4t.apply(this,arguments)||this}Qg(J4t,K4t=n),Fm([t({size:"12px",color:null,fontStyle:null,fontWeight:null,fontFamily:null},hft)],J4t.prototype,"font",void 0),Fm([e(!1)],J4t.prototype,"useRangeColor",void 0),Fm([e("")],J4t.prototype,"format",void 0),Fm([e(0)],J4t.prototype,"offset",void 0),Fm([e("Auto")],J4t.prototype,"position",void 0);var K4t,s=J4t;function J4t(){return null!==K4t&&K4t.apply(this,arguments)||this}Qg($4t,Z4t=n),Fm([e(0)],$4t.prototype,"start",void 0),Fm([e(0)],$4t.prototype,"end",void 0),Fm([e(null)],$4t.prototype,"linearGradient",void 0),Fm([e(null)],$4t.prototype,"radialGradient",void 0),Fm([e("Outside")],$4t.prototype,"position",void 0),Fm([e("")],$4t.prototype,"color",void 0),Fm([e(10)],$4t.prototype,"startWidth",void 0),Fm([e(10)],$4t.prototype,"endWidth",void 0),Fm([e(0)],$4t.prototype,"offset",void 0),Fm([t({color:"#000000",width:0},gg)],$4t.prototype,"border",void 0);var Z4t,sf=$4t;function $4t(){return null!==Z4t&&Z4t.apply(this,arguments)||this}Qg(t5t,e5t=n),Fm([e(20)],t5t.prototype,"height",void 0),Fm([e(2)],t5t.prototype,"width",void 0),Fm([e(null)],t5t.prototype,"interval",void 0),Fm([e(null)],t5t.prototype,"color",void 0),Fm([e(null)],t5t.prototype,"offset",void 0),Fm([e("Auto")],t5t.prototype,"position",void 0);var e5t,af=t5t;function t5t(){return null!==e5t&&e5t.apply(this,arguments)||this}Qg(n5t,i5t=n),Fm([e("Marker")],n5t.prototype,"type",void 0),Fm([e(null)],n5t.prototype,"linearGradient",void 0),Fm([e(null)],n5t.prototype,"radialGradient",void 0),Fm([e(null)],n5t.prototype,"value",void 0),Fm([e("InvertedTriangle")],n5t.prototype,"markerType",void 0),Fm([e(null)],n5t.prototype,"imageUrl",void 0),Fm([t({color:"#808080"},gg)],n5t.prototype,"border",void 0),Fm([e(10)],n5t.prototype,"roundedCornerRadius",void 0),Fm([e("Far")],n5t.prototype,"placement",void 0),Fm([e(20)],n5t.prototype,"height",void 0),Fm([e(20)],n5t.prototype,"width",void 0),Fm([e(null)],n5t.prototype,"color",void 0),Fm([e(1)],n5t.prototype,"opacity",void 0),Fm([e(0)],n5t.prototype,"animationDuration",void 0),Fm([e(!1)],n5t.prototype,"enableDrag",void 0),Fm([e(0)],n5t.prototype,"offset",void 0),Fm([e("Auto")],n5t.prototype,"position",void 0),Fm([e(null)],n5t.prototype,"description",void 0),Fm([e("")],n5t.prototype,"text",void 0),Fm([t({size:"16px",fontStyle:"normal",fontWeight:"normal",fontFamily:null},W)],n5t.prototype,"textStyle",void 0);var i5t,qf=n5t;function n5t(){var e=null!==i5t&&i5t.apply(this,arguments)||this;return e.animationComplete=!0,e.isPointerAnimation=!0,e.currentValue=null,e}Qg(r5t,o5t=n),Fm([e(0)],r5t.prototype,"minimum",void 0),Fm([e(100)],r5t.prototype,"maximum",void 0),Fm([e(!1)],r5t.prototype,"isInversed",void 0),Fm([e(!1)],r5t.prototype,"showLastLabel",void 0),Fm([e(!1)],r5t.prototype,"opposedPosition",void 0),Fm([t({},nf)],r5t.prototype,"line",void 0),Fm([kt([{}],sf)],r5t.prototype,"ranges",void 0),Fm([kt([{}],qf)],r5t.prototype,"pointers",void 0),Fm([t({width:2,height:20},af)],r5t.prototype,"majorTicks",void 0),Fm([t({width:1,height:10},af)],r5t.prototype,"minorTicks",void 0),Fm([t({},s)],r5t.prototype,"labelStyle",void 0);var o5t,ey=r5t;function r5t(){var e=null!==o5t&&o5t.apply(this,arguments)||this;return e.visibleLabels=[],e}var s5t,a5t="animationComplete",l5t="axisLabelRender",h5t="tooltipRender",d5t="annotationRender",p5t="gaugeMouseMove",c5t="gaugeMouseLeave",u5t="gaugeMouseDown",g5t="gaugeMouseUp",KH=(s5t=function(e,t){return(s5t=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])}))(e,t)},function(e,t){function i(){this.constructor=e}s5t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});function m5t(e,t){return-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10)}function f5t(e,t){return je(e)?null:-1!==e.indexOf("%")?t:parseInt(e,10)}function y5t(e,t){var i=document.getElementById("gauge-measuretext");return null===i&&(i=Q("text",{id:"gauge-measuretext"}),document.body.appendChild(i)),i.innerText=e,i.style.position="absolute",i.style.fontSize=t.size,i.style.fontWeight=t.fontWeight,i.style.fontStyle=t.fontStyle,i.style.fontFamily=t.fontFamily,i.style.visibility="hidden",i.style.top="-100",i.style.left="0",i.style.whiteSpace="nowrap",new R5t(i.clientWidth,i.clientHeight)}function v5t(e,t,i){var n=t;if(e<y5t(t,i).width)for(var o=t.length-1;0<=o;--o)if(y5t(n=t.substring(0,o)+"...",i).width<=e||n.length<4)return n=n.length<4?" ":n;return n}function b5t(e,t,i,n,o,r){r="pointer"===r?e<=n&&o<=e:null!=t&&t<=n&&o<=t&&null!=i&&i<=n&&o<=i;return r}function w5t(e,t,i,n,o,r){var s=e.getBoundingClientRect(),a=t.getBoundingClientRect(),l=-1<t.id.indexOf("MarkerPointer")?a.height/2:n.isInversed?a.height:0,t=-1<t.id.indexOf("MarkerPointer")?a.width/2:n.isInversed?0:a.width,h=new R5t(n.lineBounds.width,n.lineBounds.height),l="drag"===o?r.y-n.lineBounds.y:a.top+l-s.top-n.lineBounds.y,e=tWt(e),o="drag"===o?r.x-n.lineBounds.x+e:a.left+t-s.left-n.lineBounds.x+e,r="Vertical"===i?h.height:h.width,a="Vertical"===i?l:o;return("Vertical"===i?n.isInversed?a/r:1-a/r:n.isInversed?1-a/r:a/r)*n.visibleRange.delta+n.visibleRange.min}function C5t(e,t,i){var n=document.getElementById("gauge_path");null===n&&((n=Q("text",{id:"gauge_path"})).style.position="absolute",n.style.top="0px",n.style.left="0px",i.appendChild(n));i=new fo("id").createSvg({id:"box_path",width:t.width,height:t.height}),i.appendChild(e),n.appendChild(i),t=e.getBBox();return ue(n),t}function S5t(e){return document.getElementById(e)}function A5t(e){e=S5t(e);e&&ue(e)}function x5t(e,t,i,n){e=(e-n.min)/n.delta;return"Vertical"===i?t.isInversed?e:1-e:t.isInversed?1-e:e}function I5t(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 T5t(e,t,i){for(var n=0,o=Object.keys(t);n<o.length;n++){var r=o[n];e=e.split("{"+r+"}").join(E5t(t[r],i).toString())}return e}function E5t(e,t){t=t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e;return null!==t?t:""}function D5t(t,e){var i=null;try{"function"==typeof t?i=oo(t):document.querySelectorAll(t).length?i=oo(document.querySelector(t).innerHTML.trim()):(e.isVue||e.isVue3)&&(i=oo(t))}catch(e){i=oo(t)}return i}function M5t(e,t){t.appendChild(e);var i=e.offsetWidth,n=e.offsetHeight;return t.removeChild(e),new R5t(i,n)}function k5t(e,t,i,n){Q("a",{attrs:{download:e+"."+t.toLocaleLowerCase(),href:i}}).dispatchEvent(new MouseEvent(n?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function P5t(e){this.id=e}var B5t,F5t=function(e,t,i,n){this.min=e,this.max=t,this.interval=i,this.delta=n},L5t=function(e,t){this.x=e,this.y=t},R5t=function(e,t){this.width=e,this.height=t},O5t=function(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n},N5t=(KH(V5t,B5t=P5t),V5t);function V5t(e,t,i,n,o,r,s,a){void 0===a&&(a="");e=B5t.call(this,e)||this;return e.opacity=o,e.fill=t,e.stroke=n,e["stroke-width"]=i,e["stroke-dasharray"]=r,e.d=s,e.transform=a,e}var _5t,H5t=function(e,t,i,n,o){this.opacity=n,this.id=e,this.y=o.y,this.x=o.x,this.fill=t,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=i.dashArray,this.height=o.height,this.width=o.width},z5t=(KH(j5t,_5t=P5t),j5t);function j5t(e,t,i,n,o,r,s){void 0===r&&(r="");e=_5t.call(this,e)||this;return e.transform="",e.baseLine="auto",e.x=t,e.y=i,e.anchor=n,e.text=o,e.transform=r,e.baseLine=s,e}var W5t=function(e,t,i,n,o){this.text=e,this.value=t,this.size=i,this.x=n,this.y=o},Q5t=function(e,t){this.align=t,this.axisIndex=e};function U5t(e,t,i,n,o){var r=new fo(""),i=(je(e.id)||A5t(e.id),"fill:"+i+"; font-size:"+t.size+"; font-style:"+t.fontStyle+" ; font-weight:"+t.fontWeight+"; font-family:"+t.fontFamily+"; text-anchor:"+e.anchor+"; transform:"+e.transform+"; opacity:"+(je(n)?t.opacity:n)+"; dominant-baseline:"+e.baseLine+";"),t={id:e.id,x:e.x,y:e.y,style:i},n=r.createText(t,e.text);return o.appendChild(n),n}function q5t(e,t,i,n){for(var o,r=t-e,s=G5t(i,n),a=r/s,l=Math.pow(10,Math.floor(Math.log(a)/Math.log(10))),h=0,d=[10,5,2,1];h<d.length&&!(s<r/(o=l*d[h]));h++)a=o;return a}function G5t(e,t){t=5*("Horizontal"===t?.533:1);return Math.max(e*(t/100),1)}function Y5t(e,t){var e=e.id.replace(t.element.id,"").split("_"),i=parseInt(e[2],10),e=parseInt(e[4],10);return{axis:t.axes[i],axisIndex:i,pointer:t.axes[i].pointers[e],pointerIndex:e}}function X5t(t,e){var i=null;return e.forEach(function(e){t>=e.start&&e.end>=t&&e.start!==e.end&&(i=e.interior)}),i}function K5t(e,t,i){var n=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,r=i.ownerDocument.defaultView.pageYOffset,s=i.ownerDocument.documentElement.clientTop,i=i.ownerDocument.documentElement.clientLeft,o=n.left+o-i,i=n.top+r-s;return new L5t(e-o,t-i)}function J5t(e){var t;switch(e.toLowerCase()){case"tailwind":t=["#0369A1","#14B8A6","#15803D","#334155","#5A61F6","#65A30D","#8B5CF6","#9333EA","#F59E0B","#F97316"];break;case"tailwinddark":t=["#10B981","#22D3EE","#2DD4BF","#4ADE80","#8B5CF6","#E879F9","#F472B6","#F87171","#F97316","#FCD34D"];break;case"tailwind3":t=["#2F4074","#03B4B4","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];break;case"tailwind3dark":t=["#8029F1","#1ABC9C","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];break;case"fluent":t=["#614570","#4C6FB1","#CC6952","#3F579A","#4EA09B","#6E7A89","#D4515C","#E6AF5D","#639751","#9D4D69"];break;case"fluentdark":t=["#8AB113","#2A72D5","#43B786","#584EC6","#E85F9C","#6E7A89","#EA6266","#EBA844","#26BC7A","#BC4870"];break;case"material3":t=["#6200EE","#E77A16","#82C100","#7107DC","#05BB3D","#D21020","#FAD200","#0085FF","#9204EA","#08EE9B"];break;case"material3dark":t=["#4EAAFF","#FA4EAB","#FFF500","#17EA58","#38FFE7","#FF9E45","#B3F32F","#B93CE4","#FC5664","#9B55FF"];break;case"fluent2":t=["#6200EE","#09AF74","#0076E5","#CB3587","#E7910F","#0364DE","#66CD15","#F3A93C","#107C10","#C19C00"];break;case"fluent2dark":case"fluent2highcontrast":t=["#9BB449","#2A72D5","#43B786","#3F579A","#584EC6","#E85F9C","#6E7A89","#EA6266","#0B6A0B","#C19C00"];break;case"bootstrap5":case"bootstrap5dark":t=["#6610F2","#6f42C1","#D63384","#DC3545","#FD7E14","#FFC107","#198754","#0DCAF0"];break;default:t=["#ff5985","#ffb133","#fcde0b","#27d5ff","#50c917"]}return t}function Z5t(e,t,i,n,o,r,s,a){var l,h=i.width,d=i.height,p=e.x,c=e.y;switch(t){case"Circle":I(o,{r:l=(h+d)/4,cx:p="Vertical"===r?s.opposedPosition?"Near"===a.placement?p-l:p+l:"Far"!==a.placement?p-l:p+l:p,cy:c="Vertical"===r?c:s.opposedPosition?"Near"===a.placement?c-l:c+l:"Far"===a.placement?c+l:c-l});break;case"Diamond":case"Rectangle":p="Horizontal"===r?p-h/2:!s.opposedPosition&&"Far"!==a.placement||s.opposedPosition&&"Near"===a.placement?p-h:p,c="Vertical"===r?c:s.opposedPosition?"Near"===a.placement?c-d/2:c+d/2:"Far"===a.placement?c+d/2:c-d/2,I(o,{d:"Diamond"===t?"M "+p+" "+c+" L "+(p+h/2)+" "+(c-d/2)+" L "+(p+h)+" "+c+" L "+(p+h/2)+" "+(c+d/2)+" L "+p+" "+c+" z":"M "+p+" "+(c-d/2)+" L "+(p+h)+" "+(c-d/2)+" L "+(p+h)+" "+(c+d/2)+" L "+p+" "+(c+d/2)+" L "+p+" "+(c-d/2)+" z"});break;case"Triangle":I(o,{d:"Vertical"===r?"M "+p+" "+c+" L"+(p-h)+" "+(c-d/2)+"L"+(p-h)+" "+(c+d/2)+" Z":"M "+p+" "+c+" L"+(p+h/2)+" "+(c-d)+"L"+(p-h/2)+" "+(c-d)+" Z"});break;case"InvertedTriangle":I(o,{d:"Vertical"===r?"M "+p+" "+c+" L"+(p+h)+" "+(c-d/2)+"L"+(p+h)+" "+(c+d/2)+" Z":"M "+p+" "+c+" L"+(p+h/2)+" "+(c+d)+"L"+(p-h/2)+" "+(c+d)+" Z"});break;case"Arrow":I(o,{d:"Vertical"===r?"M "+p+" "+c+" L"+(p-h/2)+" "+(c-d/2)+" L"+(p-h/2)+" "+(c-d/2+d/4)+" L"+(p-h)+" "+(c-d/2+d/4)+" L"+(p-h)+" "+(c+d/2-d/4)+" L"+(p-h/2)+" "+(c+d/2-d/4)+" L"+(p-h/2)+" "+(c+d/2)+"z":"M "+p+" "+c+" L"+(p+h/2)+" "+(c-d/2)+" L"+(p+h/2-h/4)+" "+(c-d/2)+" L"+(p+h/2-h/4)+" "+(c-d)+" L"+(p-h/2+h/4)+" "+(c-d)+" L"+(p-h/2+h/4)+" "+(c-d/2)+" L"+(p-h/2)+" "+(c-d/2)+"z"});break;case"InvertedArrow":I(o,{d:"Vertical"===r?"M "+p+" "+c+"L"+(p+h/2)+" "+(c-d/2)+" L"+(p+h/2)+" "+(c-d/2+d/4)+" L"+(p+h)+" "+(c-d/2+d/4)+" L"+(p+h)+" "+(c+d/2-d/4)+" L"+(p+h/2)+" "+(c+d/2-d/4)+" L"+(p+h/2)+" "+(c+d/2)+"z":"M "+p+" "+c+" L"+(p+h/2)+" "+(c+d/2)+" L"+(p+h/2-h/4)+" "+(c+d/2)+" L"+(p+h/2-h/4)+" "+(c+d)+" L"+(p-h/2+h/4)+" "+(c+d)+" L"+(p-h/2+h/4)+" "+(c+d/2)+" L"+(p-h/2)+" "+(c+d/2)+"z"});break;case"Image":I(o,{href:n,height:d,width:h,x:p-h/2,y:c-d/2})}return o}function $5t(e,t,i,n,o,r){var s,a=e.x,e=e.y;return"Text"===t&&(s=(t=y5t(r.text,r.textStyle)).height,t=t.width,I(i,{x:"Horizontal"===n?a-t/2:!o.opposedPosition&&"Far"!==r.placement||o.opposedPosition&&"Near"===r.placement?"Inside"===r.position&&!o.opposedPosition||"Cross"===r.position||o.opposedPosition&&"Near"===r.placement&&"Outside"===r.position?a-t/2:a-t:"Cross"===r.position&&"Far"===r.placement||o.opposedPosition&&"Cross"===r.position&&("None"===r.placement||"Center"===r.placement)?a+t/2:a,y:"Vertical"===n?e+s/4:o.opposedPosition?"Near"===r.placement?e:"Cross"===r.position?e+s/2+s/4:"Outside"===r.position?e+s:e+s/2:"Far"===r.placement?"Cross"===r.position?e+s/2+s/4:"Inside"===r.position?e+s:e+s/2:e})),i}function eWt(e,t,i,n,o,r,s,a){var l=" ",h=a;switch(t){case"RoundedRectangle":u=e.x,d=e.y,m=e.width,p=e.height,f=u+m-(h=("Vertical"===i&&0===e.height||"Horizontal"===i&&0===e.width)&&10<h?10:h),c=d+p-h,g=h+d,y=h+u,("container"===o||"bar"===o&&("Vertical"===i&&0!==e.height||"Horizontal"===i&&0!==e.width))&&(u+m/2<y&&(f=y=u+m/2),d+p/2<g)&&(c=g=d+p/2),"bar"===o&&("Vertical"===i&&0===e.height||"Horizontal"===i&&0===e.width)&&(e.width<h/2&&!s.isInversed?f=f+h+h/2:e.width<h/2&&s.isInversed&&(y=u-Math.ceil(h/4)),e.height<h/2&&!s.isInversed?g=d-Math.ceil(h/4):e.height<h/2&&s.isInversed&&(c=c+h+h/2)),l=(l=(l="M "+u+" "+g+" Q "+u+" "+d+" "+y+" "+d+" ")+("L "+f+" "+d+" Q "+(u+m)+" "+d+" "+(u+m)+" "+g+" ")+("L "+(u+m)+" "+c+" Q "+(u+m)+" "+(d+p)+" "+f+" "+(d+p)+" "))+(" L "+y+" "+(d+p)+" Q "+u+" "+(d+p)+" "+u+" "+c+" ")+("L "+u+" "+g+" z");break;case"Thermometer":var d,p,c,u,g,m="Vertical"===i?e.width:e.height,f=m+m/2/Math.PI,y=m/2;l="Vertical"===i?(d=r+r/2/Math.PI-f,p="bar"===o?e.y+d:e.y,c="bar"===o?e.y+(y-y/Math.PI):e.y,u=e.height,"M"+e.x+" "+(p+u)+" A "+f+" "+f+", 0, 1, 0, "+(e.x+e.width)+" "+(p+u)+" L "+(e.x+e.width)+" "+c+" A "+y+" "+y+", 0, 1, 0, "+e.x+" "+c+" z "):(g="bar"!==o||s.isInversed?e.x:e.x-(r+r/2/Math.PI-f),m="bar"===o?e.width-(y-y/Math.PI):e.width,"M"+g+" "+e.y+" A "+f+" "+f+", 0, 1, 0, "+g+" "+(e.y+e.height)+" L "+(("bar"===o?e.x:g)+m)+" "+(e.y+e.height)+" A "+y+" "+y+", 0, 1, 0, "+(("bar"===o?e.x:g)+m)+" "+e.y+" z ")}return l}function tWt(e){var t=S5t(e.id+"_svg"),i=0;return i=je(t)||je(e)?i:e.getBoundingClientRect().left-t.getBoundingClientRect().left}function iWt(e,t){var i,n=S5t(t.element.id+"_EJ2_Title_Tooltip");n?(n.innerText=e,n.style.top=(t.actualRect.y+10).toString()+"px",n.style.left=t.actualRect.x.toString()+"px"):(i=(i=y5t(e,{size:"12px",fontFamily:"Segoe UI"}).width+10)<t.actualRect.width?i:t.actualRect.width-10,(n=Q("div",{id:t.element.id+"_EJ2_Title_Tooltip",className:"EJ2-LinearGauge-Tooltip"})).innerText=e,n.style.cssText="top:"+(t.actualRect.y+10).toString()+"px; left:"+t.actualRect.x.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";width:'+i+"px;",document.body.style.overflow="hidden",S5t(t.element.id+"_Secondary_Element").appendChild(n))}function nWt(){0<document.getElementsByClassName("EJ2-LinearGauge-Tooltip").length&&document.getElementsByClassName("EJ2-LinearGauge-Tooltip")[0].remove()}rWt.prototype.calculateAxesBounds=function(){var e,t,i,n,o;this.gauge.nearSizes=[],this.gauge.farSizes=[];this.checkThermometer();for(var r=0;r<this.gauge.axes.length;r++){(e=this.gauge.axes[r]).checkAlign=new Q5t(r,e.opposedPosition?"Far":"Near"),(e.opposedPosition?this.gauge.farSizes:this.gauge.nearSizes).push(1),this.calculateLineBounds(e,r),this.calculateTickBounds(e),this.calculateLabelBounds(e),0<e.pointers.length&&this.calculatePointerBounds(e),0<e.ranges.length&&this.calculateRangesBounds(e);var s=e.labelBounds,a=this.gauge.axes[r].labelStyle.offset;"Vertical"===this.gauge.orientation?(t=e.opposedPosition?e.lineBounds.x:s.x-a-8,i=e.lineBounds.y,o=e.lineBounds.height,n=Math.abs(e.opposedPosition?s.x+s.width+8-t-a:e.lineBounds.x-t)):(i=e.opposedPosition?e.lineBounds.y:s.y-s.height-a-8,t=e.lineBounds.x,n=e.lineBounds.width,o=Math.abs(e.opposedPosition?s.y+8-i-a:Math.abs(e.lineBounds.y-i))),e.bounds=new O5t(t,i,n,o)}},rWt.prototype.calculateLineBounds=function(e,t){var i,n,o,r,s=e.line.height,a=this.gauge.orientation,l=this.gauge.containerBounds,s=0<e.line.width?s:null,h=("Vertical"===a?(n=je(s)?l.y:l.y+(l.height/2-s/2),o=e.line.width,r=je(s)?l.height:s):(i=je(s)?l.x:l.x+(l.width/2-s/2),r=e.line.width,o=je(s)?l.width:s),this.checkPreviousAxes(e,t)),d=0;if(!je(h)){for(var p=h;0<=p;p--)if(this.gauge.axes[p].minimum!==this.gauge.axes[p].maximum){h=p,d++;break}0===d&&(h=null)}je(h)?"Vertical"===a?i=(e.opposedPosition?l.x+l.width:l.x)+e.line.offset:n=(e.opposedPosition?l.y+l.height:l.y)+e.line.offset:(s=this.gauge.axes[h],"Vertical"===a?i=(e.opposedPosition?s.bounds.x+s.bounds.width:s.bounds.x)+e.line.offset:n=(e.opposedPosition?s.bounds.y+s.bounds.height:s.bounds.y)+e.line.offset),e.lineBounds=new O5t(i,n,o,r),e.minimum===e.maximum&&(e.lineBounds=new O5t(0,0,0,0))},rWt.prototype.calculateTickBounds=function(e){var t,i,n=Math.min(e.minimum,e.maximum),o=Math.max(e.minimum,e.maximum),n=n===o?o-1:n,r=e.lineBounds,s=e.majorTicks,a=e.minorTicks,l=(e.majorInterval=s.interval,e.minorInterval=a.interval,"Vertical"===this.gauge.orientation?r.height:r.width),h=("Vertical"===this.gauge.orientation?r.width:r.height)/2;e.majorInterval=je(e.majorInterval)?q5t(n,o,l,this.gauge.orientation):s.interval,e.visibleRange=new F5t(n,o,e.majorInterval,o-n),e.minorInterval=je(e.minorInterval)?e.majorInterval/2:e.minorInterval,"Vertical"===this.gauge.orientation?(t="Auto"===e.majorTicks.position?(e.opposedPosition?r.x+h:r.x-h-s.height)+s.offset:t,t="Auto"!==e.majorTicks.position?"Cross"===e.majorTicks.position?r.x-s.height/2-s.offset:"Inside"===e.majorTicks.position&&!e.opposedPosition||"Outside"===e.majorTicks.position&&e.opposedPosition?r.x-h-s.height-s.offset:r.x+h+s.offset:t,e.majorTickBounds=new O5t(t,r.y,s.height,r.height),e.minimum===e.maximum&&(e.majorTickBounds=new O5t(0,0,0,0)),t="Auto"===e.minorTicks.position?(e.opposedPosition?r.x+h:r.x-h-a.height)+a.offset:t,t="Auto"!==e.minorTicks.position?"Cross"===e.minorTicks.position?r.x-a.height/2-a.offset:"Inside"===e.minorTicks.position&&!e.opposedPosition||"Outside"===e.minorTicks.position&&e.opposedPosition?r.x-h-a.height-a.offset:r.x+h+a.offset:t,e.minorTickBounds=new O5t(t,r.y,a.height,r.height)):(i="Auto"===e.majorTicks.position?(e.opposedPosition?r.y+h:r.y-h-s.height)+s.offset:i,i="Auto"!==e.majorTicks.position?"Cross"===e.majorTicks.position?r.y-s.height/2-s.offset:"Inside"===e.majorTicks.position&&!e.opposedPosition||"Outside"===e.majorTicks.position&&e.opposedPosition?r.y-h-s.height-s.offset:r.y+h+s.offset:i,e.majorTickBounds=new O5t(r.x,i,r.width,s.height),e.minimum===e.maximum&&(e.majorTickBounds=new O5t(0,0,0,0)),i="Auto"===e.minorTicks.position?(e.opposedPosition?r.y+h:r.y-h-a.height)+a.offset:i,i="Auto"!==e.minorTicks.position?"Cross"===e.minorTicks.position?r.y-a.height/2-s.offset:"Inside"===e.minorTicks.position&&!e.opposedPosition||"Outside"===e.minorTicks.position&&e.opposedPosition?r.y-h-a.height-a.offset:r.y+h+a.offset:i,e.minorTickBounds=new O5t(r.x,i,r.width,a.height)),e.minimum===e.maximum&&(e.minorTickBounds=new O5t(0,0,0,0))},rWt.prototype.calculateLabelBounds=function(e){var t,i,n,o,r,s,a="Auto"!==e.labelStyle.position&&"Auto"!==e.majorTicks.position&&"Auto"!==e.minorTicks.position,l=a&&e.labelStyle.position===e.minorTicks.position&&e.minorTicks.position!==e.majorTicks.position?e.minorTickBounds:e.majorTickBounds,h=e.labelStyle.offset;this.calculateVisibleLabels(e),e.minimum===e.maximum?e.labelBounds=new O5t(0,0,0,0):(t=e.maxLabelSize.width,i=e.maxLabelSize.height/2,"Vertical"===this.gauge.orientation?(n="Auto"===e.labelStyle.position?(e.opposedPosition?l.x+l.width+5:l.x-t-5)+h:n,o=l.x,r=("Cross"===e.majorTicks.position||"Cross"===e.minorTicks.position)&&l.width>e.lineBounds.width?l.width/2:e.lineBounds.width/2,o=a&&e.labelStyle.position!==e.minorTicks.position&&e.labelStyle.position!==e.majorTicks.position?"Cross"!==e.minorTicks.position&&"Cross"!==e.majorTicks.position?"Inside"===e.labelStyle.position?l.x-e.lineBounds.width:"Outside"===e.labelStyle.position?l.x+e.lineBounds.width:l.x:"Inside"===e.labelStyle.position?e.lineBounds.x-r:"Outside"===e.labelStyle.position?e.lineBounds.x-l.width+r:l.x:l.x,n="Auto"!==e.labelStyle.position?"Cross"===e.labelStyle.position?e.lineBounds.x-e.maxLabelSize.width/4-h:"Inside"===e.labelStyle.position&&!e.opposedPosition||"Outside"===e.labelStyle.position&&e.opposedPosition?o-t-5-h:o+l.width+5+h:n,o=e.lineBounds.y):(o="Auto"===e.labelStyle.position?(e.opposedPosition?l.y+l.height+5+i:l.y-5)+h:o,s=l.y,r=("Cross"===e.majorTicks.position||"Cross"===e.minorTicks.position)&&l.height>e.lineBounds.height?l.height/2:e.lineBounds.height/2,s=a&&e.labelStyle.position!==e.minorTicks.position&&e.labelStyle.position!==e.majorTicks.position?"Cross"!==e.minorTicks.position&&"Cross"!==e.majorTicks.position?"Inside"===e.labelStyle.position?l.y-e.lineBounds.height:"Outside"===e.labelStyle.position?l.y+e.lineBounds.height:l.y:"Inside"===e.labelStyle.position?e.lineBounds.y-r:"Outside"===e.labelStyle.position?e.lineBounds.y-l.height+r:l.y:l.y,o="Auto"!==e.labelStyle.position?"Cross"===e.labelStyle.position?e.lineBounds.y+e.maxLabelSize.height/4-h:"Inside"===e.labelStyle.position&&!e.opposedPosition||"Outside"===e.labelStyle.position&&e.opposedPosition?s-5-h:s+l.height+5+i+h:o,n=e.lineBounds.x),e.labelBounds=new O5t(n,o,t,i))},rWt.prototype.calculatePointerBounds=function(e){for(var t,i=e.visibleRange,n=Math.min(i.min,i.max),o=Math.max(i.min,i.max),r=0;r<e.pointers.length;r++)!je((t=e.pointers[r]).offset)&&0<t.offset.length?t.currentOffset=m5t(t.offset,"Horizontal"===this.gauge.orientation?this.gauge.availableSize.height/2:this.gauge.availableSize.width/2):t.currentOffset=t.offset,t.currentValue=null===t.value||t.value<n?n:t.value>o?o:t.value,0<t.width&&b5t(t.currentValue,null,null,i.max,i.min,"pointer")&&this["calculate"+t.type+"Bounds"](e,t)},rWt.prototype.calculateMarkerBounds=function(e,t){var i,n,o=e.lineBounds,r=t.currentOffset,s=e.visibleRange,a=t.placement,l=e.majorTickBounds,h=e.labelBounds,d=t.border.width,p=y5t(t.text,t.textStyle);"Vertical"===this.gauge.orientation?(i="Auto"===t.position?(i=e.opposedPosition?"Far"===a?h.x+h.width:"Center"===a?l.x+l.width:o.x:("Near"===a?h:"Center"===a?l:o).x,e.opposedPosition?("Near"===t.placement?"InvertedTriangle"===t.markerType||"InvertedArrow"===t.markerType?i+d:i-d:"Triangle"===t.markerType||"Arrow"===t.markerType?i-d:i+d)+r:("Far"===t.placement?"Triangle"===t.markerType||"Arrow"===t.markerType?i-d:i+d:"InvertedTriangle"===t.markerType||"InvertedArrow"===t.markerType?i+d:i-d)+r):"Cross"===t.position?o.x-("Text"===t.markerType?p.width:t.width/2)-r:"Inside"===t.position&&!e.opposedPosition||"Outside"===t.position&&e.opposedPosition?o.x-o.width/2-("InvertedTriangle"!==t.markerType&&"Triangle"!==t.markerType?("Text"===t.markerType?p:t).width:0)-r:o.x+o.width/2+r,n=x5t(t.currentValue,e,this.gauge.orientation,s)*o.height+o.y):(n="Auto"===t.position?(n=e.opposedPosition?"Far"===a?h.y:"Center"===a?l.y+l.height:o.y:"Near"===a?h.y-h.height:("Center"===a?l:o).y,e.opposedPosition?("Near"===t.placement?"InvertedTriangle"===t.markerType||"InvertedArrow"===t.markerType?n+d:n-d:"Triangle"===t.markerType||"Arrow"===t.markerType?n-d:n+d)+r:("Far"===t.placement?"Triangle"===t.markerType||"Arrow"===t.markerType?n-d:n+d:"InvertedTriangle"===t.markerType||"InvertedArrow"===t.markerType?n+d:n-d)+r):"Cross"===t.position?o.y-("Text"===t.markerType?p:t).height/2-r:"Inside"===t.position&&!e.opposedPosition||"Outside"===t.position&&e.opposedPosition?o.y-o.height/2-("InvertedTriangle"!==t.markerType&&"Triangle"!==t.markerType?("Text"===t.markerType?p:t).height:0)-r:o.y+o.height/2+r,i=x5t(t.currentValue,e,this.gauge.orientation,s)*o.width+o.x),t.bounds=new O5t(i,n,t.width,t.height),e.minimum===e.maximum&&(t.bounds=new O5t(0,0,0,0),t.width=0,t.height=0)},rWt.prototype.calculateBarBounds=function(e,t){var i,n,o,r,s=e.lineBounds,a=e.visibleRange,l=this.gauge.orientation,h=t.currentOffset,d=this.gauge.containerBounds;"Vertical"===l?("Auto"===t.position?(i=0<d.width?d.x+(d.width/2-t.width/2):e.opposedPosition?s.x-t.width-10:s.x+10,i+=h):i="Cross"===t.position?s.x-t.width/2-h:"Inside"===t.position&&!e.opposedPosition||"Outside"===t.position&&e.opposedPosition?s.x-s.width/2-t.width-h:s.x+s.width/2+h,n=x5t(t.currentValue,e,l,a)*s.height+s.y,r=x5t(a.min,e,l,a)*s.height+s.y,o=Math.abs(r-n),n=e.isInversed?r:n,r=t.width):("Auto"===t.position?(n=0<d.height?d.y+d.height/2-t.height/2:e.opposedPosition?s.y-t.height-10:s.y+10,n+=h):n="Cross"===t.position?s.y-t.height/2-h:"Inside"===t.position&&!e.opposedPosition||"Outside"===t.position&&e.opposedPosition?s.y-s.height/2-t.height-h:s.y+s.height/2+h,o=t.height,i=x5t(a.min,e,l,a)*s.width+s.x,d=x5t(t.currentValue,e,l,a)*s.width+s.x,r=Math.abs(d-i),i=e.isInversed?d:i),t.bounds=new O5t(i,n,r,o),e.minimum===e.maximum&&(t.bounds=new O5t(0,0,0,0),t.width=0,t.height=0)},rWt.prototype.calculateRangesBounds=function(e){for(var t,i,n,o,r,s,a,l,h,d,p,c,u=e.lineBounds,g=e.visibleRange,m=this.gauge.orientation,f=0;f<e.ranges.length;f++)t=e.ranges[f],this.gauge.gradientModule&&(h=this.gauge.gradientModule.getGradientColorString(t)),!je(t.offset)&&0<t.offset.length?t.currentOffset=m5t(t.offset,"Horizontal"===this.gauge.orientation?this.gauge.availableSize.height/2:this.gauge.availableSize.width/2):t.currentOffset=t.offset,b5t(null,i=Math.max(t.start,g.min),n=Math.min(t.end,g.max),g.max,g.min,"range")&&(n=Math.max(i,n),i=Math.min(i,t.end),l=t.position,d=t.startWidth,p=t.endWidth,c=!je(this.gauge.rangePalettes)&&0<this.gauge.rangePalettes.length?this.gauge.rangePalettes:J5t(this.gauge.theme),t.interior=h||t.color||c[f%c.length],"Vertical"===this.gauge.orientation?(s=u.x+t.currentOffset+("Cross"===l?d/2:"Outside"===l||"Auto"===l?-u.width/2:"Inside"===l?u.width/2:0),a=x5t(n,e,m,g)*u.height+u.y,c=x5t(i,e,m,g)*u.height+u.y,o=e.opposedPosition?"Inside"===l||"Cross"===l?s-d:s+d:"Inside"===l?s+d:s-d,r=e.opposedPosition?"Inside"===l||"Cross"===l?s-p:s+p:"Inside"===l?s+p:s-p,t.path="M"+s+" "+a+" L "+s+" "+(a+(c-=a))+" L "+o+" "+(a+c)+" L "+r+" "+a+" L "+s+" "+a+" z "):(s=x5t(n,e,m,g)*u.width+u.x,a=e.lineBounds.y+t.currentOffset+("Cross"===l?d/2:"Outside"===l||"Auto"===l?-u.height/2:"Inside"===l?u.height/2:0),c=x5t(i,e,m,g)*u.width+u.x,o=e.opposedPosition?"Inside"===l||"Cross"===l?a-d:a+d:"Inside"===l?a+d:a-d,r=e.opposedPosition?"Inside"===l||"Cross"===l?a-p:a+p:"Inside"===l?a+p:a-p,t.path="M"+s+" "+a+" L "+(s-(c=s-c))+" "+a+" L "+(s-c)+" "+o+" L "+s+" "+r+" L "+s+" "+a+" z "))},rWt.prototype.checkPreviousAxes=function(e,t){t-=1;return t=0<=t?this.gauge.axes[t].checkAlign.align===e.checkAlign.align?t:this.checkPreviousAxes(e,t):null},rWt.prototype.calculateVisibleLabels=function(n){if(n.visibleLabels=[],n.minimum!==n.maximum){for(var o,e=n.visibleRange.min,t=n.visibleRange.max,i=n.visibleRange.interval,r=void 0,s=n.labelStyle,a=s.format&&null!==s.format.match("{value}"),l=function(e){function t(e){e.cancel||n.visibleLabels.push(new W5t(e.text,i,o))}var i=e;-1!==i.toString().indexOf("e")&&je(h.gauge.format)&&(e=parseInt(i.toString().split("-")[1],10),i=parseInt(i.toFixed(e),10)),r={cancel:!1,name:l5t,axis:n,text:a?T5t(s.format,{value:i},h.gauge):E5t(i,h.gauge).toString(),value:i};t.bind(h),h.gauge.trigger(l5t,r,t)},h=this,d=e;d<=t&&0<i;d+=i)l(d);var e=n.visibleLabels.length?n.visibleLabels[n.visibleLabels.length-1].value:null,p=n.visibleRange.max;e!==p&&!0===n.showLastLabel&&(r={cancel:!1,name:l5t,axis:n,text:a?T5t(s.format,{value:p},this.gauge):E5t(p,this.gauge).toString(),value:p},(e=function(e){o=y5t(e.text,n.labelStyle.font),e.cancel||n.visibleLabels.push(new W5t(e.text,p,o))}).bind(this),this.gauge.trigger(l5t,r,e)),this.getMaxLabelWidth(n)}},rWt.prototype.getMaxLabelWidth=function(e){var t;e.maxLabelSize=new R5t(0,0);for(var i=0;i<e.visibleLabels.length;i++)(t=e.visibleLabels[i]).size=y5t(t.text,e.labelStyle.font),t.size.width>e.maxLabelSize.width&&(e.maxLabelSize.width=t.size.width),t.size.height>e.maxLabelSize.height&&(e.maxLabelSize.height=t.size.height)},rWt.prototype.checkThermometer=function(){"Thermometer"===this.gauge.container.type&&this.gauge.axes.map(function(t){t.isInversed&&t.pointers.map(function(e){"Bar"===e.type&&(t.isInversed=!1)})})},rWt.prototype.destroy=function(){this.gauge=null};var oWt=rWt;function rWt(e){this.gauge=e}function sWt(e){this.gauge=e}sWt.prototype.performMarkerAnimation=function(e,t,i){var n,o,r,s=this,a=e,l=t.visibleRange,h="Vertical"===this.gauge.orientation?t.lineBounds.height:t.lineBounds.width,d="Vertical"===this.gauge.orientation?t.lineBounds.y:t.lineBounds.x,p=("Vertical"===this.gauge.orientation?i.bounds.y=x5t(i.currentValue,t,this.gauge.orientation,l)*h+d:i.bounds.x=x5t(i.currentValue,t,this.gauge.orientation,l)*h+d,n=new N5t(a.id,null,null,null),n=Z5t(i.bounds,i.markerType,new R5t(i.width,i.height),i.imageUrl,n,this.gauge.orientation,t,i),"Text"===i.markerType&&(o=new z5t(a.id,0,0,"middle",i.text,null,"auto"),o=$5t(i.bounds,i.markerType,o,this.gauge.orientation,t,i)),"string"==typeof i.startValue?parseInt(i.startValue,10):i.startValue),c=i.currentValue,p=p===c?l.min:p,u=Math.abs(p-c),g=n.d,m=n.cx,f=n.cy,y=("Text"===i.markerType?o:n).x,v=("Text"===i.markerType?o:n).y;new Vt({}).animate(a,{name:"Linear",duration:"Enable"!==Ut||(0!==i.animationDuration||this.gauge.allowLoadingAnimation)&&0!==this.gauge.animationDuration?this.gauge.allowLoadingAnimation&&0===i.animationDuration?this.gauge.animationDuration/this.gauge.splitUpCount:i.animationDuration:1e3,progress:function(e){e.timeStamp>=e.delay&&(r=(e.timeStamp-e.delay)/e.duration,r=p<c?p+r*u:p-r*u,"Vertical"===s.gauge.orientation?(i.bounds.y=x5t(r,t,s.gauge.orientation,l)*h+d,n=Z5t(i.bounds,i.markerType,new R5t(i.width,i.height),i.imageUrl,n,s.gauge.orientation,t,i),"Text"===i.markerType&&(o=$5t(i.bounds,i.markerType,o,s.gauge.orientation,t,i)),je(n.r)?je(("Text"===i.markerType?o:n).y)?a.setAttribute("d",n.d):a.setAttribute("y","Text"===i.markerType?o.y:n.y.toString()):a.setAttribute("cy",n.cy.toString())):(i.bounds.x=x5t(r,t,s.gauge.orientation,l)*h+d,n=Z5t(i.bounds,i.markerType,new R5t(i.width,i.height),i.imageUrl,n,s.gauge.orientation,t,i),"Text"===i.markerType&&(o=$5t(i.bounds,i.markerType,o,s.gauge.orientation,t,i)),je(n.r)?je(("Text"===i.markerType?o:n).x)?a.setAttribute("d",n.d):a.setAttribute("x","Text"===i.markerType?o.x:n.x.toString()):a.setAttribute("cx",n.cx.toString())),a.style.visibility="visible")},end:function(){var e;je(f)?je(v)?a.setAttribute("d",g):(a.setAttribute("y",v.toString()),a.setAttribute("x",y.toString())):(a.setAttribute("cy",f.toString()),a.setAttribute("cx",m.toString())),a.style.visibility="visible",i.isPointerAnimation=!1,i.animationComplete=!0,i.startValue=i.value=i.currentValue,s.gauge.trigger(a5t,{axis:t,pointer:i}),s.gauge.allowLoadingAnimation&&(!je(s.gauge.annotationsModule)&&0<s.gauge.annotations.length&&(""!==s.gauge.annotations[0].content||1<s.gauge.annotations.length)?(e=document.getElementById(s.gauge.element.id+"_AnnotationsGroup"),s.gauge.annotationsModule.annotationAnimate(e,s.gauge)):(s.gauge.allowLoadingAnimation=!1,s.gauge.isOverAllAnimationComplete=!0))}})},sWt.prototype.performBarAnimation=function(e,t,i){var n,o,r,s,a,l,h,d,p,c=this,u=t.visibleRange,g=e,m="Vertical"===this.gauge.orientation?t.lineBounds.height:t.lineBounds.width,f="Vertical"===this.gauge.orientation?t.lineBounds.y:t.lineBounds.x,y="string"==typeof i.startValue?parseInt(i.startValue,10):i.startValue,v=i.currentValue,y=y===v?u.min:y,b=g.tagName,w=Math.abs(y-v),C=x5t(v,t,this.gauge.orientation,u)*m+f,S=x5t(u.min,t,this.gauge.orientation,u)*m+f,A="Vertical"===this.gauge.orientation?t.isInversed?S:C:t.isInversed?C:S,x=Math.abs(S-C),I=("Thermometer"===this.gauge.container.type&&0===y&&0<this.gauge.container.width&&(v===t.minimum?e.style.visibility="visible":(h=g.parentElement.childNodes[1].childNodes[0].childNodes[0],"Vertical"===this.gauge.orientation?(S=h.getAttribute("y"),r=h.getAttribute("height"),s=parseInt(S,10)+parseInt(r,10),h.setAttribute("y",s.toString())):(C=h.getAttribute("x"),a=h.getAttribute("width"),s=parseInt(C,10)+parseInt(a,10),h.setAttribute("width","0")))),d=i.value===t.minimum&&"RoundedRectangle"===this.gauge.container.type?"":eWt(i.bounds,this.gauge.container.type,this.gauge.orientation,new R5t(i.bounds.width,i.bounds.height),"bar",this.gauge.container.width,t,i.roundedCornerRadius),i.bounds.width),T=i.bounds.height;new Vt({}).animate(g,{name:"Linear",duration:"Enable"!==Ut||(0!==i.animationDuration||this.gauge.allowLoadingAnimation)&&0!==this.gauge.animationDuration?this.gauge.allowLoadingAnimation&&0===i.animationDuration?this.gauge.animationDuration/this.gauge.splitUpCount:i.animationDuration:1e3,progress:function(e){e.timeStamp>=e.delay&&(n=(e.timeStamp-e.delay)/e.duration,p=x5t(y<v?y+n*w:y-n*w,t,c.gauge.orientation,u)*m+f,o=x5t(u.min,t,c.gauge.orientation,u)*m+f,l=Math.abs(p-o),"Vertical"===c.gauge.orientation?(i.bounds.y=t.isInversed?o:p,T=l):(i.bounds.x=t.isInversed?p:o,I=l),"path"===b?(0===y&&"Thermometer"===c.gauge.container.type&&("Vertical"===c.gauge.orientation?h.setAttribute("y",(s-n*parseInt(r,10)).toString()):h.setAttribute("width",(n*parseInt(a,10)).toString())),p=i.value===t.minimum&&"RoundedRectangle"===c.gauge.container.type?"":eWt(new O5t(i.bounds.x,i.bounds.y,I,T),c.gauge.container.type,c.gauge.orientation,new R5t(I,T),"bar",c.gauge.container.width,t,i.roundedCornerRadius),g.setAttribute("d",p)):"Vertical"===c.gauge.orientation?(g.setAttribute("y",i.bounds.y.toString()),g.setAttribute("height",T.toString())):(g.setAttribute("x",i.bounds.x.toString()),g.setAttribute("width",I.toString())),g.style.visibility="visible")},end:function(){var e;"path"===b?0===y&&"Thermometer"===c.gauge.container.type?g.parentElement.children[1].remove():g.setAttribute("d",d):"Vertical"===c.gauge.orientation?(g.setAttribute("y",A.toString()),g.setAttribute("height",x.toString())):(g.setAttribute("x",A.toString()),g.setAttribute("width",x.toString())),g.style.visibility="visible",i.isPointerAnimation=!1,i.startValue=i.value=i.currentValue,c.gauge.trigger(a5t,{axis:t,pointer:i}),c.gauge.allowLoadingAnimation&&(!je(c.gauge.annotationsModule)&&0<c.gauge.annotations.length&&(""!==c.gauge.annotations[0].content||1<c.gauge.annotations.length)?(e=document.getElementById(c.gauge.element.id+"_AnnotationsGroup"),c.gauge.annotationsModule.annotationAnimate(e,c.gauge)):(c.gauge.allowLoadingAnimation=!1,c.gauge.isOverAllAnimationComplete=!0))}})},aWt=function(e,t){return(aWt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}aWt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(dWt,lWt=sWt),dWt.prototype.renderAxes=function(){var e,t,i,n=this,o=(this.axisElements=[],this.gauge.svgObject.querySelector("#"+this.gauge.element.id+"_Axis_Collections"));o&&ue(o),this.axisObject=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_Axis_Collections",transform:"translate( 0, 0 )"});for(var r=this.gauge.splitUpCount=0;r<this.gauge.axes.length;r++)t=(e=this.gauge.axes[r]).majorTicks,i=e.minorTicks,this.htmlObject=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_Axis_Group_"+r}),this.gauge.allowLoadingAnimation&&(0===this.gauge.splitUpCount&&(0<e.line.width||0<e.majorTicks.height&&0<e.majorTicks.width||0<e.minorTicks.height&&0<e.minorTicks.width||0<this.gauge.container.width||0<e.ranges.length&&(1!==e.ranges.length||e.ranges[0].start!==e.ranges[0].end||0!==e.ranges[0].start))&&this.gauge.splitUpCount++,0!==this.gauge.splitUpCount&&1!==this.gauge.splitUpCount||(this.gauge.splitUpCount=0<e.pointers.length?this.gauge.splitUpCount+1:this.gauge.splitUpCount)),this.drawAxisLine(e,this.htmlObject,r),this.drawRanges(e,this.htmlObject,r),this.drawTicks(e,t,this.htmlObject,"MajorTicks",e.majorTickBounds,r),this.drawTicks(e,i,this.htmlObject,"MinorTicks",e.minorTickBounds,r),this.drawAxisLabels(e,this.htmlObject,r),this.drawPointers(e,this.htmlObject,r),this.axisElements.push(this.htmlObject);this.axisElements.forEach(function(e){n.axisObject.appendChild(e)}),this.gauge.svgObject.appendChild(this.axisObject),this.gauge.nearSizes.length!==this.gauge.farSizes.length&&1<this.gauge.axes.length&&this.axisAlign(this.gauge.axes)},dWt.prototype.axisAlign=function(e){var t,i=0,n=0;"Vertical"===this.gauge.orientation?(e.forEach(function(e){e.opposedPosition?n+=e.bounds.width:i+=e.bounds.width}),i+=this.gauge.containerBounds.width/2,n+=this.gauge.containerBounds.width/2,t=i/2-n/2,this.axisObject.setAttribute("transform","translate("+t+",0)"),je(this.gauge.containerObject)||this.gauge.containerObject.setAttribute("transform","translate("+t+",0)")):(e.forEach(function(e){e.opposedPosition?n+=e.bounds.height:i+=e.bounds.height}),i+=this.gauge.containerBounds.height/2,n+=this.gauge.containerBounds.height/2,t=i/2-n/2,this.axisObject.setAttribute("transform","translate(0,"+t+")"),je(this.gauge.containerObject)||this.gauge.containerObject.setAttribute("transform","translate(0,"+t+")"))},dWt.prototype.drawAxisLine=function(e,t,i){var n=e.lineBounds,o="",r=e.line.color||this.gauge.themeStyle.lineColor;0<e.line.width&&(o="M"+n.x+" "+n.y+" L "+("Vertical"===this.gauge.orientation?n.x:n.x+n.width)+" "+("Vertical"===this.gauge.orientation?n.y+n.height:n.y)+"z",n=new N5t(this.gauge.element.id+"_AxisLine_"+i,r,e.line.width,r,1,e.line.dashArray,o),i=this.gauge.renderer.drawPath(n),this.gauge.allowLoadingAnimation&&i.classList.add(this.gauge.element.id+"animation"),t.appendChild(i))},dWt.prototype.drawTicks=function(e,t,i,n,o,r){for(var s,a,l="",h=e.visibleRange,d=e.lineBounds,p=e.majorTicks.color||this.gauge.themeStyle.majorTickColor,c=e.minorTicks.color||this.gauge.themeStyle.minorTickColor,p="MajorTicks"===n?p:c,u="MajorTicks"===n?e.majorInterval:e.minorInterval,g=e.minimum!==e.maximum?t.height:0,m=h.min;m<=h.max&&0<u;m+=u)"MajorTicks"!==n&&"MinorTicks"!==n||(l="Vertical"===this.gauge.orientation?(a=o.x,s=x5t(m,e,this.gauge.orientation,h)*d.height+d.y,l.concat("M"+a+" "+s+" L"+(a+g)+" "+s+" ")):(a=x5t(m,e,this.gauge.orientation,h)*d.width+d.x,s=o.y,l.concat("M"+a+" "+s+" L"+a+" "+(s+g)+" ")));c=new N5t(this.gauge.element.id+"_"+n+"Line_"+r,p,t.width,p,1,null,l),r=this.gauge.renderer.drawPath(c);this.gauge.allowLoadingAnimation&&r.classList.add(this.gauge.element.id+"animation"),i.appendChild(r)},dWt.prototype.drawAxisLabels=function(e,t,i){for(var n,o,r,s=e.lineBounds,a=e.labelBounds,l=e.majorTickBounds,h=e.visibleRange,d=this.gauge.themeStyle.labelColor,p=e.labelStyle.offset,c=e.visibleLabels.length-1,u=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_AxisLabelsGroup_"+i}),g=0;g<e.visibleLabels.length;g++){var m,f,y,v,b=e.visibleLabels[g].size,b=(v=je(v=e.labelStyle.useRangeColor?X5t(e.visibleLabels[g].value,e.ranges):null)?e.labelStyle.font.color||d:v,"Vertical"===this.gauge.orientation?(n=x5t(e.visibleLabels[g].value,e,this.gauge.orientation,h)*s.height+s.y,f="Auto"!==e.labelStyle.position||e.opposedPosition?a.x:l.x-b.width-5+p,n+=b.height/4,e.visibleLabels[g].x=f,e.visibleLabels[g].y=n):0!==g&&g!==c||"None"===this.gauge.edgeLabelPlacement?(f=x5t(e.visibleLabels[g].value,e,this.gauge.orientation,h)*s.width+s.x,n=a.y,o="middle",r="",e.visibleLabels[g].x=f,e.visibleLabels[g].y=n):("Shift"===this.gauge.edgeLabelPlacement?(f=0===g?x5t(e.visibleLabels[g].value,e,this.gauge.orientation,h)*s.width+s.x+(e.isInversed?-e.visibleLabels[g].size.width/2:e.visibleLabels[g].size.width/2):x5t(e.visibleLabels[g].value,e,this.gauge.orientation,h)*s.width+s.x-(e.isInversed?-e.visibleLabels[g].size.width/2:e.visibleLabels[g].size.width/2),this.gauge.allowMargin&&g===c&&(!e.isInversed&&f-e.visibleLabels[g].size.width/2<e.visibleLabels[g-1].x+e.visibleLabels[g-1].size.width/2?f+=e.visibleLabels[g].size.width/2:e.isInversed&&f+e.visibleLabels[g].size.width/2>e.visibleLabels[g-1].x-e.visibleLabels[g-1].size.width/2&&(f-=e.visibleLabels[g].size.width/2))):"Trim"===this.gauge.edgeLabelPlacement?(f=x5t(e.visibleLabels[g].value,e,this.gauge.orientation,h)*s.width+s.x,g===c&&(this.gauge.allowMargin?e.isInversed&&f+e.visibleLabels[g].size.width/2>e.visibleLabels[g-1].x-e.visibleLabels[g-1].size.width/2?(m=e.visibleLabels[g].size.width-(f+e.visibleLabels[g].size.width/2-(e.visibleLabels[g-1].x-e.visibleLabels[g-1].size.width/2)+2),e.visibleLabels[g].text=v5t(m,e.visibleLabels[g].text,e.labelStyle.font)):!e.isInversed&&f-e.visibleLabels[g].size.width/2<e.visibleLabels[g-1].x+e.visibleLabels[g-1].size.width/2&&(m=e.visibleLabels[g].size.width-(e.visibleLabels[g-1].x+e.visibleLabels[g-1].size.width/2-(f-e.visibleLabels[g].size.width/2)+2),e.visibleLabels[g].text=v5t(m,e.visibleLabels[g].text,e.labelStyle.font)):!e.isInversed&&this.gauge.margin.right<=10?(y=.75*e.visibleLabels[g].size.width,e.visibleLabels[g].text=v5t(y,e.visibleLabels[g].text,e.labelStyle.font)):e.isInversed&&f+e.visibleLabels[g].size.width/2>e.visibleLabels[g-1].x-e.visibleLabels[g-1].size.width/2&&(y=e.visibleLabels[g].size.width-(f+e.visibleLabels[g].size.width/2-(e.visibleLabels[g-1].x-e.visibleLabels[g-1].size.width/2)+2),e.visibleLabels[g].text=v5t(y,e.visibleLabels[g].text,e.labelStyle.font)))):"Auto"===this.gauge.edgeLabelPlacement&&(this.gauge.allowMargin?(f=x5t(e.visibleLabels[g].value,e,this.gauge.orientation,h)*s.width+s.x,g===c&&e.isInversed&&f+e.visibleLabels[g].size.width/2>e.visibleLabels[g-1].x-e.visibleLabels[g-1].size.width/2&&(b=e.visibleLabels[g].size.width-(f+e.visibleLabels[g].size.width/2-(e.visibleLabels[g-1].x-e.visibleLabels[g-1].size.width/2)+2),e.visibleLabels[g].text=v5t(b,e.visibleLabels[g].text,e.labelStyle.font))):(f=g===c?x5t(e.visibleLabels[g].value,e,this.gauge.orientation,h)*s.width+s.x-(e.isInversed?-e.visibleLabels[g].size.width/2:e.visibleLabels[g].size.width/2):x5t(e.visibleLabels[g].value,e,this.gauge.orientation,h)*s.width+s.x+(e.isInversed?-e.visibleLabels[g].size.width/2:e.visibleLabels[g].size.width/2),g===c&&(!e.isInversed&&f-e.visibleLabels[g].size.width/2<e.visibleLabels[g-1].x+e.visibleLabels[g-1].size.width/2?(f+=e.visibleLabels[g].size.width/2,y=.75*e.visibleLabels[g].size.width,e.visibleLabels[g].text=v5t(y,e.visibleLabels[g].text,e.labelStyle.font)):e.isInversed&&f+e.visibleLabels[g].size.width/2>e.visibleLabels[g-1].x-e.visibleLabels[g-1].size.width/2&&(f-=e.visibleLabels[g].size.width/2,b=e.visibleLabels[g].size.width-(f+e.visibleLabels[g].size.width/2-(e.visibleLabels[g-1].x-e.visibleLabels[g-1].size.width/2)+2),e.visibleLabels[g].text=v5t(b,e.visibleLabels[g].text,e.labelStyle.font))))),n=a.y,e.visibleLabels[g].x=f,e.visibleLabels[g].y=n,o="middle",r=""),{size:e.labelStyle.font.size,color:e.labelStyle.font.color,fontFamily:e.labelStyle.font.fontFamily,fontWeight:e.labelStyle.font.fontWeight,fontStyle:e.labelStyle.font.fontStyle,opacity:e.labelStyle.font.opacity}),b=(b.fontFamily=b.fontFamily||this.gauge.themeStyle.labelFontFamily,b.fontStyle=b.fontStyle||this.gauge.themeStyle.labelStyle,b.fontWeight=b.fontWeight||this.gauge.themeStyle.labelWeight,U5t(new z5t(this.gauge.element.id+"_Axis_"+i+"_Label_"+g,f,n,o,e.visibleLabels[g].text,null,r),b,v,null,u));b.setAttribute("aria-label",e.visibleLabels[g].text),b.setAttribute("role","region")}this.gauge.allowLoadingAnimation&&u.classList.add(this.gauge.element.id+"animation"),t.appendChild(u)},dWt.prototype.drawPointers=function(e,t,i){for(var n,o,r,s=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_PointersGroup_"+i}),a=0;a<e.pointers.length;a++)n=e.pointers[a],o="url(#"+this.gauge.element.id+"_AxisIndex_"+i+"__"+n.type+"ClipRect_"+a+")",je(n.bounds)||(r=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_AxisIndex_"+i+"_"+n.type+"PointerGroup_"+a}),je(n.startValue)&&(n.startValue=e.visibleRange.min),!("Enable"===Ut||0<n.animationDuration||this.gauge.allowLoadingAnimation)||this.gauge.isPropertyChange&&!n.isPointerAnimation||this.gauge.gaugeResized||(n.startValue=this.gauge.isPropertyChange?n.startValue:e.minimum,"Thermometer"===this.gauge.container.type&&0===n.startValue&&r.setAttribute("clip-path",o)),this["draw"+n.type+"Pointer"](e,i,n,a,r),s.appendChild(r));this.gauge.gradientCount=0,t.appendChild(s)},dWt.prototype.drawMarkerPointer=function(e,t,i,n,o){var r,s,a,l={},t=this.gauge.element.id+"_AxisIndex_"+t+"_"+i.type+"Pointer_"+n,n=(this.gauge.gradientModule&&(a=this.gauge.gradientModule.getGradientColorString(i)),S5t(t)&&0<S5t(t).childElementCount&&ue(S5t(t)),i.color||this.gauge.themeStyle.pointerColor),h=i.markerType;je(i.position)||"InvertedTriangle"!==i.markerType&&"Triangle"!==i.markerType||(h=("Outside"===i.position&&!e.opposedPosition||"Inside"===i.position&&e.opposedPosition||"Cross"===i.position)&&"Triangle"===i.markerType?"InvertedTriangle":("Inside"===i.position&&!e.opposedPosition||"Outside"===i.position&&e.opposedPosition)&&"InvertedTriangle"===i.markerType?"Triangle":i.markerType),r=new N5t(t,a||n,i.border.width,i.border.color,i.opacity,i.border.dashArray,null,"translate( 0, 0 )"),r=Z5t(i.bounds,h,new R5t(i.width,i.height),i.imageUrl,r,this.gauge.orientation,e,i),"Text"===i.markerType&&(s=new z5t(t,void 0,void 0,"start",i.text,null,"auto"),s=$5t(i.bounds,h,s,this.gauge.orientation,e,i),l={size:i.textStyle.size,fontFamily:i.textStyle.fontFamily||this.gauge.themeStyle.labelFontFamily,fontWeight:i.textStyle.fontWeight,fontStyle:i.textStyle.fontStyle}),t="Circle"===i.markerType?this.gauge.renderer.drawCircle(r):"Image"===i.markerType?this.gauge.renderer.drawImage(r):"Text"!==i.markerType||je(i.text)?this.gauge.renderer.drawPath(r):U5t(s,l,a||n,i.opacity,o),this.gauge.allowLoadingAnimation&&(t.style.visibility="hidden"),o.appendChild(t),!(0<i.animationDuration||"Enable"===Ut)||this.gauge.allowLoadingAnimation&&!this.gauge.isPropertyChange||this.gauge.isPropertyChange&&!i.isPointerAnimation||i.startValue===i.currentValue||this.gauge.isPointerAnimationInProgress||(i.startValue=this.gauge.isPropertyChange?i.startValue:e.minimum,i.animationComplete=!1,this.performMarkerAnimation(t,e,i)),this.gauge.allowLoadingAnimation||0!==i.animationDuration||(i.startValue=i.currentValue),t.setAttribute("aria-label",i.description||"Pointer:"+Number(i.currentValue).toString()),t.setAttribute("role","region")},dWt.prototype.drawBarPointer=function(e,t,i,n,o){var r,s,a,l,h,d=new R5t(this.gauge.availableSize.width,this.gauge.availableSize.height),p=this.gauge.element.id+"_AxisIndex_"+t+"_"+i.type+"Pointer_"+n;this.gauge.gradientModule&&(h=this.gauge.gradientModule.getGradientColorString(i)),S5t(p)&&0<S5t(p).childElementCount&&ue(S5t(p)),"Normal"===this.gauge.container.type||0===this.gauge.container.width?(r=new H5t(p,h||i.color||this.gauge.themeStyle.pointerColor,i.border,i.opacity,i.bounds),l=i.bounds,s=this.gauge.renderer.drawRectangle(r)):(a=i.value>e.minimum||"Thermometer"===this.gauge.container.type?eWt(i.bounds,this.gauge.container.type,this.gauge.orientation,new R5t(i.bounds.width,i.bounds.height),"bar",this.gauge.container.width,e,i.roundedCornerRadius):"",a=new N5t(p,h||i.color||this.gauge.themeStyle.pointerColor,i.border.width,i.border.color,i.opacity,i.border.dashArray,a),l=C5t((s=this.gauge.renderer.drawPath(a)).cloneNode(!0),d,this.gauge.element)),S5t(p)&&0<S5t(p).childElementCount?(h=S5t(p).firstElementChild,"Normal"===this.gauge.container.type?(h.setAttribute("x",r.x+""),h.setAttribute("y",r.y+""),h.setAttribute("width",r.width+""),h.setAttribute("height",r.height+"")):h.setAttribute("d",a.d)):o.appendChild(s),s.setAttribute("aria-label",i.description||"Pointer:"+Number(i.currentValue).toString()),s.setAttribute("role","region"),this.gauge.allowLoadingAnimation&&(s.style.visibility="hidden"),!(0<i.animationDuration||this.gauge.allowLoadingAnimation||"Enable"===Ut)||this.gauge.isPropertyChange&&!i.isPointerAnimation||i.startValue===i.currentValue||this.gauge.isPointerAnimationInProgress||(i.startValue=this.gauge.isPropertyChange?i.startValue:e.minimum,"Thermometer"===this.gauge.container.type&&0===i.startValue&&0<this.gauge.container.width&&(d=this.gauge.renderer.drawClipPath(new H5t(this.gauge.element.id+"_AxisIndex_"+t+"__"+i.type+"ClipRect_"+n,"transparent",{width:1,color:"Gray"},1,l)),o.appendChild(d)),this.gauge.allowLoadingAnimation&&!this.gauge.isPropertyChange)||(i.isPointerAnimation=!1,this.performBarAnimation(s,e,i)),0===i.animationDuration&&(i.startValue=i.currentValue)},dWt.prototype.pointerAnimation=function(e,t){if(!this.gauge.isPointerAnimationInProgress&&this.gauge.allowLoadingAnimation){this.gauge.isPointerAnimationInProgress=!0;for(var i=0;i<e.pointers.length;i++){var n,o=e.pointers[i];"Bar"===o.type?(n=S5t(this.gauge.element.id+"_AxisIndex_"+t+"_"+o.type+"Pointer_"+i))&&this.performBarAnimation(n,e,o):(n=S5t(this.gauge.element.id+"_AxisIndex_"+t+"_"+o.type+"Pointer_"+i))&&this.performMarkerAnimation(n,e,o)}}},dWt.prototype.drawRanges=function(e,t,i){var n,o=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_RangesGroup_"+i});this.gauge.allowLoadingAnimation&&o.classList.add(this.gauge.element.id+"animation");for(var r=0;r<e.ranges.length;r++)je((n=e.ranges[r]).path)||(n=new N5t(this.gauge.element.id+"_AxisIndex_"+i+"_Range_"+r,n.interior,n.start!==n.end?n.border.width:0,n.border.color,1,n.border.dashArray,n.path),o.appendChild(this.gauge.renderer.drawPath(n)));t.appendChild(o)},dWt.prototype.updateTextPointer=function(e,t,i){var n=new z5t(e,void 0,void 0,"start",t.text,null,"auto"),n=$5t(t.bounds,"Text",n,this.gauge.orientation,i,t),i=document.getElementById(e);i.setAttribute("x",n.x.toString()),i.setAttribute("y",n.y.toString()),i.textContent=t.text},dWt.prototype.destroy=function(){this.htmlObject=null,this.axisObject=null,this.axisElements=[],this.gauge=null};var aWt,lWt,hWt=dWt;function dWt(e){return lWt.call(this,e)||this}cWt.prototype.renderAnnotationElements=function(i){var n=this,e=i.element.id+"_Secondary_Element",o=Q("div",{id:i.element.id+"_AnnotationsGroup"});o.style.position="absolute",o.style.top="0px",o.style.left="0px",o.style.opacity=i.allowLoadingAnimation?"0":"1",i.splitUpCount=i.allowLoadingAnimation&&0<i.annotations.length?i.splitUpCount+1:i.splitUpCount,i.annotations.map(function(e,t){null!==e.content&&n.createAnnotationTemplate(o,t,i)}),0<o.childElementCount&&!je(S5t(e))&&S5t(e).appendChild(o),i.renderReactTemplates()},cWt.prototype.createAnnotationTemplate=function(h,d,p){var c,u,g,m,f=!1,y=p.annotations[d],v=Q("div",{id:p.element.id+"_Annotation_"+d}),e=(v.style.cssText="position: absolute; z-index:"+y.zIndex+";",{size:y.font.size,color:y.font.color,fontFamily:y.font.fontFamily,fontWeight:y.font.fontWeight,fontStyle:y.font.fontStyle,opacity:y.font.opacity}),b={cancel:!1,name:d5t,content:y.content,annotation:y,textStyle:e};b.textStyle.color=e.color||p.themeStyle.labelColor,p.trigger(d5t,b,function(){if(!b.cancel){if((m=D5t(b.content,p))&&m(p,p,b.content,p.element.id+"_ContentTemplate"+d).length)for(var e=(g=Array.prototype.slice.call(m(p,p,b.content,p.element.id+"_ContentTemplate"+d))).length,t=0;t<e;t++)v.appendChild(g[t]);else{var i=Q("div",{innerHTML:je(b.content)?null:b.content.toString()});i.style.cssText=I5t(b.textStyle),v.appendChild(i)}var n=M5t(v.cloneNode(!0),p.element);if(je(y.axisValue)){var i=p.element.getBoundingClientRect(),o=p.svgObject.getBoundingClientRect();switch(f=!0,c=Math.abs(o.left-i.left),u=Math.abs(o.top-i.top),c="None"===y.horizontalAlignment?c+y.x:c,u="None"===y.verticalAlignment?u+y.y:u,y.verticalAlignment){case"Near":u+=y.y;break;case"Center":u=u+y.y+(o.height/2-n.height/2);break;case"Far":u=u+o.height+y.y-n.height}switch(y.horizontalAlignment){case"Near":c+=y.x;break;case"Center":c=c+y.x+(o.width/2-n.width/2);break;case"Far":c=c+o.width+y.x-n.width}}else{m=je(y.axisIndex)?0:y.axisIndex;var r,i=(m=p.axes[m]).visibleRange,s=(f=y.axisValue>=i.min&&y.axisValue<=i.max,m.lineBounds),a=tWt(p.element),l=S5t(p.element.id+"_Axis_Collections");je(l)||(l=l.getAttribute("transform").split("(")[1].split(")")[0],r=parseInt(l.split(",")[0],10),l=parseInt(l.split(",")[1],10),"Vertical"===p.orientation?(c=s.x+parseFloat(y.x.toString())+r-a,u=x5t(parseFloat(y.axisValue.toString()),m,p.orientation,i)*s.height+s.y,u+=parseFloat(y.y.toString())):(c=x5t(parseFloat(y.axisValue.toString()),m,p.orientation,i)*s.width+s.x-a,c+=parseFloat(y.x.toString()),u=s.y+parseFloat(y.y.toString())+l),c-=n.width/2,u-=n.height/2)}v.style.left=c+"px",v.style.top=u+"px",f&&h.appendChild(v)}})},cWt.prototype.annotationAnimate=function(t,e){var i;"0"===t.style.opacity&&(i=0,new Vt({}).animate(t,{duration:0===e.animationDuration&&"Enable"===Ut?1e3:e.allowLoadingAnimation&&0<e.animationDuration?e.animationDuration/e.splitUpCount:0,progress:function(e){e.timeStamp>e.delay&&(i=(e.timeStamp-e.delay)/e.duration,t.style.opacity=i)},end:function(){t.style.opacity=1,e.allowLoadingAnimation=!1,e.isOverAllAnimationComplete=!0}}))},cWt.prototype.getModuleName=function(){return"Annotations"},cWt.prototype.destroy=function(){};var pWt=cWt;function cWt(){}gWt.prototype.renderTooltip=function(e){i=(-1!==e.type.indexOf("touch")?(this.isTouch=!0,t=e.changedTouches[0].pageX,e.changedTouches[0]):(this.isTouch="touch"===e.pointerType,t=e.pageX,e)).pageY;var t,i,n,o,r,s,a,l,h,d,p=e.target;-1<p.id.indexOf("Pointer")&&-1<this.gauge.tooltip.type.indexOf("Pointer")?(this.pointerElement=p,r=this.gauge.element.getBoundingClientRect(),s=Y5t(this.pointerElement,this.gauge),this.currentAxis=s.axis,this.axisIndex=s.axisIndex,this.currentPointer=s.pointer,h=this.tooltip.format&&null!==this.tooltip.format.match("{value}"),(a={size:this.tooltip.textStyle.size,color:this.tooltip.textStyle.color,fontFamily:this.tooltip.textStyle.fontFamily,fontWeight:this.tooltip.textStyle.fontWeight,fontStyle:this.tooltip.textStyle.fontStyle,opacity:this.tooltip.textStyle.opacity}).color=a.color||this.gauge.themeStyle.tooltipFontColor,a.size=a.size||this.gauge.themeStyle.tooltipFontSize,a.fontFamily=a.fontFamily||this.gauge.themeStyle.fontFamily,a.fontWeight=a.fontWeight||this.gauge.themeStyle.labelWeight,a.opacity=a.opacity||this.gauge.themeStyle.tooltipTextOpacity,o=h?T5t(this.tooltip.format,{value:this.currentPointer.currentValue},this.gauge):E5t(this.currentPointer.currentValue,this.gauge).toString(),n=this.tooltipCreate(n),this.tooltipRender(o,p,n,e,r,t,i,a),this.gauge.renderReactTemplates()):-1<p.id.indexOf("Range")&&-1<this.gauge.tooltip.type.indexOf("Range")?(this.pointerElement=p,r=this.gauge.element.getBoundingClientRect(),s=Y5t(this.pointerElement,this.gauge),this.currentAxis=s.axis,this.axisIndex=s.axisIndex,a=Number(p.id.charAt(p.id.length-1)),this.currentRange=this.currentAxis.ranges[a],s=this.currentRange.start.toString(),a=this.currentRange.end.toString(),h=(l=this.gauge.tooltip.rangeSettings.format||this.currentAxis.labelStyle.format)&&(null!==l.match("{end}")||null!==l.match("{start}")),(d={size:this.tooltip.rangeSettings.textStyle.size,color:this.tooltip.rangeSettings.textStyle.color,fontFamily:this.tooltip.rangeSettings.textStyle.fontFamily,fontWeight:this.tooltip.rangeSettings.textStyle.fontWeight,fontStyle:this.tooltip.rangeSettings.textStyle.fontStyle,opacity:this.tooltip.rangeSettings.textStyle.opacity}).color=d.color||this.gauge.themeStyle.tooltipFontColor,d.size=d.size||this.gauge.themeStyle.tooltipFontSize,d.fontFamily=d.fontFamily||this.gauge.themeStyle.fontFamily,d.fontWeight=d.fontWeight||this.gauge.themeStyle.labelWeight,d.opacity=d.opacity||this.gauge.themeStyle.tooltipTextOpacity,o=h?l.replace(/{start}/g,s).replace(/{end}/g,a):"Start : "+s+"<br>End : "+a,n=this.tooltipCreate(n),this.tooltipRender(o,p,n,e,r,t,i,d),this.gauge.renderReactTemplates()):p.id===this.element.id+"_LinearGaugeTitle"&&-1<p.textContent.indexOf("...")?iWt(this.gauge.title,this.gauge):(nWt(),this.gauge.clearTemplate())},gWt.prototype.tooltipRender=function(e,i,n,t,o,r,s,a){var l=this,h=this.getTooltipLocation(),d=((this.tooltip.rangeSettings.showAtMousePosition&&-1<i.id.indexOf("Range")||this.tooltip.showAtMousePosition&&-1<i.id.indexOf("Pointer"))&&(h=K5t(r,s,this.gauge.svgObject)),{name:h5t,cancel:!1,gauge:this.gauge,event:t,location:h,content:e,tooltip:this.tooltip,axis:this.currentAxis,pointer:this.currentPointer}),p=this.getTooltipPosition();h.y+=this.tooltip.rangeSettings.template&&"Top"===p||this.tooltip.template&&"Top"===p?20:0,h.x+=this.tooltip.rangeSettings.template&&"Right"===p||this.tooltip.template&&"Right"===p?20:0,this.gauge.trigger(h5t,d,function(){var e,t=(-1<i.id.indexOf("Range")?d.tooltip.rangeSettings:d.tooltip).template;null!==t&&1===Object.keys(t).length&&"function"!=typeof t&&(t=t[Object.keys(t)[0]]),d.cancel||(e=(-1<i.id.indexOf("Range")?l.tooltip.rangeSettings:l.tooltip).fill,l.svgTooltip=l.svgCreate(l.svgTooltip,d,l.gauge,o,e,t,p,h,i,a),l.svgTooltip.opacity=l.gauge.themeStyle.tooltipFillOpacity||l.svgTooltip.opacity,l.svgTooltip.appendTo(n))})},gWt.prototype.tooltipCreate=function(e){return document.getElementById(this.tooltipId)?e=document.getElementById(this.tooltipId):((e=Q("div",{id:this.tooltipId,className:"EJ2-LinearGauge-Tooltip"})).style.cssText="position: absolute;pointer-events:none;z-index: 3;",document.getElementById(this.gauge.element.id+"_Secondary_Element").appendChild(e)),e},gWt.prototype.svgCreate=function(e,t,i,n,o,r,s,a,l,h){l=(-1<l.id.indexOf("Range")?t.tooltip.rangeSettings:t.tooltip).border,h={color:t.tooltip.textStyle.color||h.color,fontFamily:t.tooltip.textStyle.fontFamily||h.fontFamily,fontStyle:t.tooltip.textStyle.fontStyle||h.fontStyle,fontWeight:t.tooltip.textStyle.fontWeight||h.fontWeight,opacity:t.tooltip.textStyle.opacity||h.opacity,size:t.tooltip.textStyle.size||h.size},l={color:l.color||this.gauge.themeStyle.tooltipBorderColor||"transparent",width:l.width||this.gauge.themeStyle.tooltipBorderWidth||0,dashArray:l.dashArray};return e=new tr({enable:!0,header:"",data:{value:t.content},template:r,content:[go.sanitize(t.content)],shapes:[],location:t.location,palette:[],inverted:!("Horizontal"===t.gauge.orientation),enableAnimation:t.tooltip.enableAnimation,fill:o||i.themeStyle.tooltipFillColor,availableSize:i.availableSize,areaBounds:new O5t("Vertical"===this.gauge.orientation?a.x:n.left-this.element.getBoundingClientRect().left,"Vertical"===this.gauge.orientation||"Bottom"===s?n.top:a.y,"Right"===s?Math.abs(n.left-a.x):n.width,n.height),textStyle:h,border:l,theme:t.gauge.theme,enableShadow:!0}),(i.isVue||i.isVue3)&&(e.controlInstance=i),e},gWt.prototype.getTooltipPosition=function(){var e="Vertical"===this.gauge.orientation?this.currentAxis.opposedPosition?"Right":"Left":this.currentAxis.opposedPosition?"Top":"Bottom";return e},gWt.prototype.getTooltipLocation=function(){var e,t=this.gauge.element.id+"_AxisLine_"+this.axisIndex,i=this.gauge.element.id+"_MajorTicksLine_"+this.axisIndex,t=S5t(t)?(e=(n=S5t(t).getBoundingClientRect()).left,n.top):(n=S5t(i).getBoundingClientRect(),e=this.currentAxis.opposedPosition?n.left:n.left+n.width,this.currentAxis.opposedPosition?n.top:n.top+n.height),i=this.pointerElement.getBoundingClientRect(),n=this.gauge.element.getBoundingClientRect(),o=i.left-n.left,r=i.top-n.top,s=i.height,i=i.width,a=(-1<this.pointerElement.id.indexOf("Range")?this.tooltip.rangeSettings:this.tooltip).position;return"Vertical"===this.gauge.orientation?(o=e-n.left,r=-1<this.pointerElement.id.indexOf("Range")||-1<this.pointerElement.id.indexOf("BarPointer")?this.currentAxis.isInversed?"End"===a||"Start"===a?r+s:r+s/2:"End"===a?r:"Start"===a?r+s:r+s/2:"Marker"===this.currentPointer.type?r+s/2:this.currentAxis.isInversed?r+s:r):(r=t-n.top,o=-1<this.pointerElement.id.indexOf("Range")||-1<this.pointerElement.id.indexOf("BarPointer")?this.currentAxis.isInversed?"End"===a?o:"Start"===a?o+i:o+i/2:"End"===a?o+i:"Start"===a?o:o+i/2:"Marker"===this.currentPointer.type?o+i/2:this.currentAxis.isInversed?o:o+i),new L5t(o,r)},gWt.prototype.mouseUpHandler=function(e){nWt(),this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(nWt.bind(this),2e3)},gWt.prototype.addEventListener=function(){this.gauge.isDestroyed||(this.gauge.on(F.touchMoveEvent,this.renderTooltip,this),this.gauge.on(F.touchEndEvent,this.mouseUpHandler,this))},gWt.prototype.removeEventListener=function(){this.gauge.isDestroyed||(this.gauge.off(F.touchMoveEvent,this.renderTooltip),this.gauge.off(F.touchEndEvent,this.mouseUpHandler))},gWt.prototype.getModuleName=function(){return"Tooltip"},gWt.prototype.destroy=function(){this.element=null,this.currentAxis=null,this.currentPointer=null,this.currentRange=null,je(this.svgTooltip)||(this.svgTooltip.destroy(),this.svgTooltip.controlInstance=null,A5t(this.tooltipId)),this.svgTooltip=null,this.pointerElement=null,this.tooltip=null,this.removeEventListener(),this.gauge=null};var uWt=gWt;function gWt(e){this.gauge=e,this.element=e.element,this.tooltip=e.tooltip,this.tooltipId=this.gauge.element.id+"_LinearGauge_Tooltip",this.addEventListener()}mWt=function(e,t){return(mWt=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])}))(e,t)};var mWt,fWt,$H=function(e,t){function i(){this.constructor=e}mWt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},iz=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},rz=($H(yWt,fWt=n),iz([e("#000000")],yWt.prototype,"color",void 0),iz([e(1)],yWt.prototype,"opacity",void 0),iz([e("0%")],yWt.prototype,"offset",void 0),iz([e("")],yWt.prototype,"style",void 0),yWt);function yWt(){return null!==fWt&&fWt.apply(this,arguments)||this}$H(bWt,vWt=n),iz([e("0%")],bWt.prototype,"x",void 0),iz([e("0%")],bWt.prototype,"y",void 0);var vWt,Iz=bWt;function bWt(){return null!==vWt&&vWt.apply(this,arguments)||this}$H(CWt,wWt=n),iz([e("0%")],CWt.prototype,"startValue",void 0),iz([e("100%")],CWt.prototype,"endValue",void 0),iz([kt([{color:"#000000",opacity:1,offset:"0%",style:""}],rz)],CWt.prototype,"colorStop",void 0);var wWt,n3=CWt;function CWt(){return null!==wWt&&wWt.apply(this,arguments)||this}$H(AWt,SWt=n),iz([e("0%")],AWt.prototype,"radius",void 0),iz([t({x:"0%",y:"0%"},Iz)],AWt.prototype,"outerPosition",void 0),iz([t({x:"0%",y:"0%"},Iz)],AWt.prototype,"innerPosition",void 0),iz([kt([{color:"#000000",opacity:1,offset:"0%",style:""}],rz)],AWt.prototype,"colorStop",void 0);var SWt,Jj=AWt;function AWt(){return null!==SWt&&SWt.apply(this,arguments)||this}IWt.prototype.getLinearGradientColor=function(e){var t=new fo(""),i=e.linearGradient.colorStop,i=this.getGradientColor(i),n="_"+this.gauge.svgObject.id+"_"+this.gauge.gradientCount+"_linearGradient",e={id:n,x1:(-1===e.linearGradient.startValue.indexOf("%")?e.linearGradient.startValue:parseFloat(e.linearGradient.startValue).toString())+"%",x2:(-1===e.linearGradient.endValue.indexOf("%")?e.linearGradient.endValue:parseFloat(e.linearGradient.endValue).toString())+"%",y1:"0%",y2:"0%"},t=t.drawGradient("linearGradient",e,i);return this.gauge.svgObject.appendChild(t),"url(#"+n+")"},IWt.prototype.getRadialGradientColor=function(e){var t=new fo(""),i=e.radialGradient.colorStop,i=this.getGradientColor(i),n="_"+this.gauge.svgObject.id+"_"+this.gauge.gradientCount+"_radialGradient",e={id:n,r:je(e.radialGradient.radius)?"0%":(-1===e.radialGradient.radius.indexOf("%")?e.radialGradient.radius:parseFloat(e.radialGradient.radius).toString())+"%",cx:null==e.radialGradient.outerPosition?"0%":(-1===e.radialGradient.outerPosition.x.indexOf("%")?e.radialGradient.outerPosition.x:parseFloat(e.radialGradient.outerPosition.x).toString())+"%",cy:null==e.radialGradient.outerPosition?"0%":(-1===e.radialGradient.outerPosition.y.indexOf("%")?e.radialGradient.outerPosition.y:parseFloat(e.radialGradient.outerPosition.y).toString())+"%",fx:null==e.radialGradient.innerPosition?"0%":(-1===e.radialGradient.innerPosition.x.indexOf("%")?e.radialGradient.innerPosition.y:parseFloat(e.radialGradient.innerPosition.x).toString())+"%",fy:null==e.radialGradient.innerPosition?"0%":(-1===e.radialGradient.innerPosition.y.indexOf("%")?e.radialGradient.innerPosition.y:parseFloat(e.radialGradient.innerPosition.y).toString())+"%"},t=t.drawGradient("radialGradient",e,i);return this.gauge.svgObject.appendChild(t),"url(#"+n+")"},IWt.prototype.getGradientColor=function(e){for(var t=[],i=je(e)?0:e.length,n=0;n<i;n++){var o=e[n],o={color:o.color,colorStop:o.offset,opacity:o.opacity?o.opacity.toString():"1",style:o.style};t.push(o)}return t},IWt.prototype.getGradientColorString=function(e){return e.linearGradient||e.radialGradient?(e=e.linearGradient?this.getLinearGradientColor(e):this.getRadialGradientColor(e),this.gauge.gradientCount+=1,e):null},IWt.prototype.getModuleName=function(){return"Gradient"},IWt.prototype.destroy=function(){this.gauge=null};var xWt=IWt;function IWt(e){this.gauge=e}TWt=function(e,t){return(TWt=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])}))(e,t)};var TWt,EWt,m4=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},v4=(function(e,t){function i(){this.constructor=e}TWt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(DWt,EWt=Ji),DWt.prototype.preRender=function(){this.unWireEvents(),this.isPointerAnimationInProgress=!1,this.trigger("load",{gauge:this}),this.initPrivateVariable(),this.setCulture(),this.createSvg(),this.wireEvents()},DWt.prototype.setTheme=function(){this.themeStyle=function(e){var t;switch(e.toLowerCase()){case"materialdark":case"fabricdark":case"bootstrapdark":t={backgroundColor:"#333232",titleFontColor:"#ffffff",titleFontSize:"15px",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#000000",tooltipFontSize:"13px",labelColor:"#DADADA",lineColor:"#C8C8C8",majorTickColor:"#C8C8C8",minorTickColor:"#9A9A9A",pointerColor:"#9A9A9A",titleFontStyle:"Normal",titleFontWeight:"Normal",labelStyle:"Normal",labelWeight:"Normal",containerBorderColor:"#bfbfbf",fontFamily:"Segoe UI",labelFontFamily:"Segoe UI"};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",titleFontSize:"15px",tooltipFillColor:"#ffffff",tooltipFontColor:"#000000",tooltipFontSize:"13px",labelColor:"#FFFFFF",lineColor:"#FFFFFF",majorTickColor:"#FFFFFF",minorTickColor:"#FFFFFF",pointerColor:"#FFFFFF",titleFontStyle:"Normal",titleFontWeight:"Normal",labelStyle:"Normal",labelWeight:"Normal",containerBorderColor:"#bfbfbf",fontFamily:"Segoe UI",labelFontFamily:"Segoe UI"};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",titleFontSize:"15px",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"13px",labelColor:"#212529",lineColor:"#ADB5BD",majorTickColor:"#ADB5BD",minorTickColor:"#CED4DA",pointerColor:"#6C757D",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",labelFontFamily:"HelveticaNeue",tooltipFillOpacity:1,tooltipTextOpacity:.9,containerBackground:"#F8F9FA",titleFontStyle:"Normal",titleFontWeight:"Normal",labelStyle:"Normal",labelWeight:"Normal",containerBorderColor:"#bfbfbf"};break;case"tailwind":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#374151",titleFontSize:"15px",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"13px",labelColor:"#6B7280",lineColor:"#E5E7EB",majorTickColor:"#9CA3AF",minorTickColor:"#9CA3AF",pointerColor:"#1F2937",fontFamily:"Inter",fontSize:"14px",labelFontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:.9,containerBackground:"rgba(255,255,255, 0.0)",titleFontStyle:"Normal",titleFontWeight:"500",labelStyle:"Normal",labelWeight:"Normal",containerBorderColor:"#E5E7EB"};break;case"tailwinddark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#D1D5DB",titleFontSize:"15px",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"13px",labelColor:"#9CA3AF",lineColor:"#374151",majorTickColor:"#6B7280",minorTickColor:"#6B7280",pointerColor:"#9CA3AF",fontFamily:"Inter",fontSize:"14px",labelFontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:.9,containerBackground:"rgba(255,255,255, 0.0)",titleFontStyle:"Normal",titleFontWeight:"500",labelStyle:"Normal",labelWeight:"Normal",containerBorderColor:"#4b5563"};break;case"tailwind3":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#111827",titleFontSize:"14px",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"12px",labelColor:"#4B5563",lineColor:"#E5E7EB",majorTickColor:"#D1D5DB",minorTickColor:"#D1D5DB",pointerColor:"#1F2937",fontFamily:"Inter",fontSize:"14px",labelFontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:1,containerBackground:"#E5E7EB",titleFontStyle:"Normal",titleFontWeight:"600",labelStyle:"Normal",labelWeight:"400",containerBorderColor:"#E5E7EB"};break;case"tailwind3dark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#FFFFFF",titleFontSize:"14px",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"12px",labelColor:"#D1D5DB",lineColor:"#282F3C",majorTickColor:"#374151",minorTickColor:"#374151",pointerColor:"#6B7280",fontFamily:"Inter",fontSize:"12px",labelFontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:1,containerBackground:"#282F3C",titleFontStyle:"Normal",titleFontWeight:"600",labelStyle:"Normal",labelWeight:"400",containerBorderColor:"#282F3C"};break;case"bootstrap5":t={backgroundColor:"transparent",titleFontColor:"#212529",titleFontSize:"14px",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",labelColor:"#212529",lineColor:"#E9ECEF",majorTickColor:"#CED4DA",minorTickColor:"#CED4DA",pointerColor:"#343A40",fontSize:"14px",titleFontStyle:"normal",titleFontWeight:"400",labelStyle:"normal",labelWeight:"400",fontFamily:"Segoe UI",labelFontFamily:"Segoe UI",tooltipFillOpacity:.9,containerBackground:"#E9ECEF",containerBorderColor:"#E9ECEF"};break;case"bootstrap5dark":t={backgroundColor:"transparent",titleFontColor:"#DEE2E6",titleFontSize:"14px",titleFontStyle:"normal",titleFontWeight:"400",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#212529",tooltipFontSize:"12px",labelColor:"#DEE2E6",labelStyle:"normal",labelWeight:"400",labelFontFamily:"Segoe UI",lineColor:"#343A40",majorTickColor:"#6C757D",minorTickColor:"#6C757D",pointerColor:"#ADB5BD",fontSize:"14px",fontFamily:"Segoe UI",tooltipFillOpacity:.9,containerBackground:"#343A40",containerBorderColor:"#343A40"};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",titleFontSize:"15px",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#323130",tooltipFontSize:"13px",labelColor:"#3B3A39",lineColor:"#EDEBE9",majorTickColor:"#C8C6C4",minorTickColor:"#C8C6C4",pointerColor:"#A19F9D",fontFamily:"Segoe UI",fontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,containerBackground:"rgba(255,255,255, 0.0)",titleFontStyle:"normal",titleFontWeight:"600",labelStyle:"normal",labelWeight:"400",containerBorderColor:"#EDEBE9"};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",titleFontSize:"15px",tooltipFillColor:"#252423",tooltipFontColor:"#F3F2F1",tooltipFontSize:"13px",labelColor:"#C8C6C4",lineColor:"#292827",majorTickColor:"#484644",minorTickColor:"#484644",pointerColor:"#797775",fontFamily:"Segoe UI",fontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,containerBackground:"rgba(255,255,255, 0.0)",titleFontStyle:"normal",titleFontWeight:"600",labelStyle:"normal",labelWeight:"400",containerBorderColor:"#292827"};break;case"material3":t={backgroundColor:"transparent",titleFontColor:"#1C1B1F",titleFontSize:"16px",tooltipFillColor:"#313033",tooltipFontColor:"#F4EFF4",tooltipFontSize:"14px",labelColor:" #1E192B",lineColor:"#C4C7C5",majorTickColor:"#C4C7C5",minorTickColor:"#C4C7C5",pointerColor:"#49454E",fontFamily:"Roboto",fontSize:"12px",labelFontFamily:"Roboto",tooltipFillOpacity:1,tooltipTextOpacity:1,containerBackground:"#E7E0EC",titleFontStyle:"normal",titleFontWeight:"500",labelStyle:"normal",labelWeight:"400",containerBorderColor:"#E7E0EC"};break;case"material3dark":t={backgroundColor:"transparent",titleFontColor:"#E6E1E5",titleFontSize:"16px",tooltipFillColor:"#E6E1E5",tooltipFontColor:"#313033",tooltipFontSize:"14px",labelColor:"#E6E1E5",lineColor:"#938F99",majorTickColor:"#938F99",minorTickColor:"#938F99",pointerColor:"#CAC4D0",fontFamily:"Roboto",fontSize:"12px",labelFontFamily:"Roboto",tooltipFillOpacity:1,tooltipTextOpacity:1,containerBackground:"#49454F",titleFontStyle:"normal",titleFontWeight:"500",labelStyle:"normal",labelWeight:"400",containerBorderColor:"#49454F"};break;case"fluent2":t={backgroundColor:"transparent",titleFontColor:"#242424",titleFontSize:"14px",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#242424",tooltipFontSize:"12px",labelColor:"#616161",lineColor:"#EDEBE9",majorTickColor:"#C8C6C4",minorTickColor:"#C8C6C4",pointerColor:"#A19F9D",fontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,titleFontStyle:"normal",titleFontWeight:"600",labelStyle:"normal",labelWeight:"400",containerBorderColor:"#EDEBE9",containerBackground:"#EDEBE9",fontFamily:"Segoe UI",labelFontFamily:"Segoe UI"};break;case"fluent2dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontSize:"14px",tooltipFillColor:"#292929",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",labelColor:"#ADADAD",lineColor:"#292827",majorTickColor:"#484644",minorTickColor:"#484644",pointerColor:"#8A8886",fontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,titleFontStyle:"normal",titleFontWeight:"600",labelStyle:"normal",labelWeight:"400",containerBorderColor:"#292827",containerBackground:"#292827",fontFamily:"Segoe UI",labelFontFamily:"Segoe UI"};break;case"fluent2highcontrast":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontSize:"14px",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",labelColor:"#FFFFFF",lineColor:"#292827",majorTickColor:"#484644",minorTickColor:"#484644",pointerColor:"#8A8886",fontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,titleFontStyle:"normal",titleFontWeight:"600",labelStyle:"normal",labelWeight:"400",containerBorderColor:"#292827",containerBackground:"#292827",fontFamily:"Segoe UI",labelFontFamily:"Segoe UI",tooltipBorderColor:"#FFF",tooltipBorderWidth:1};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",titleFontSize:"15px",tooltipFillColor:"#FFFFF",tooltipFontColor:"#FFFFFF",tooltipFontSize:"13px",labelColor:"#686868",lineColor:"#a6a6a6",majorTickColor:"#a6a6a6",minorTickColor:"#a6a6a6",pointerColor:"#a6a6a6",containerBackground:"#e0e0e0",titleFontStyle:"Normal",titleFontWeight:"Normal",labelStyle:"Normal",labelWeight:"Normal",containerBorderColor:"#bfbfbf",fontFamily:"Segoe UI",labelFontFamily:"Segoe UI"}}return t}(this.theme)},DWt.prototype.initPrivateVariable=function(){var e;""===this.element.id&&(e=document.getElementsByClassName("e-lineargauge").length,this.element.id="lineargauge_control_"+e),this.renderer=new fo(this.element.id),this.gaugeAxisLayoutPanel=new oWt(this),this.axisRenderer=new hWt(this)},DWt.prototype.setCulture=function(){this.intl=new Ti},DWt.prototype.createSvg=function(){this.removeSvg(),this.calculateSize(),je(this.renderer)&&(this.renderer=new fo(this.element.id)),je(this.gaugeAxisLayoutPanel)&&(this.gaugeAxisLayoutPanel=new oWt(this)),je(this.axisRenderer)&&(this.axisRenderer=new hWt(this)),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},DWt.prototype.removeSvg=function(){A5t(this.element.id+"_Secondary_Element"),je(this.svgObject)||je(this.svgObject.parentNode)||ue(this.svgObject),this.clearTemplate()},DWt.prototype.renderAnimation=function(){var e,t=this;this.allowLoadingAnimation&&(e=document.getElementById(this.element.id+"_RangesGroup_0"),this.axisElementAnimate(e),this.styleRemove&&clearTimeout(this.styleRemove),this.styleRemove=setTimeout(function(){var e=document.querySelectorAll("style."+t.element.id+"animation");0<e.length&&e[0].remove()},0===this.animationDuration&&"Enable"===Ut?1e3:this.animationDuration))},DWt.prototype.axisElementAnimate=function(e){var t,i=this,n=document.querySelectorAll("style."+this.element.id+"animation");new Vt({}).animate(e,{duration:0===this.animationDuration&&"Enable"===Ut?1e3:0<this.animationDuration?this.animationDuration/this.splitUpCount:0,progress:function(e){e.timeStamp>e.delay&&(t=(e.timeStamp-e.delay)/e.duration,n[0].style.cssText="opacity: "+t+";")},end:function(){je(n)||0===n.length||(n[0].style.cssText="opacity: 1;");for(var e=0;e<i.axes.length;e++)i.axisRenderer.pointerAnimation(i.axes[e],e),i.axes.length-1==0&&0===i.axes[e].pointers.length&&(i.isOverAllAnimationComplete=!0)}})},DWt.prototype.calculateSize=function(){je(this.height)||(this.element.style.height=this.height),je(this.width)||(this.element.style.width=this.width);var e=f5t(this.width,this.element.offsetWidth)||this.element.offsetWidth||600,t=f5t(this.height,this.element.offsetHeight)||this.element.offsetHeight||450;this.availableSize=new R5t(e,t)},DWt.prototype.renderElements=function(){this.setTheme(),this.renderGaugeElements(),this.calculateBounds(),this.renderAxisElements(),this.renderAnimation(),this.renderComplete()},DWt.prototype.render=function(){var e;this.isPropertyChange=!1,this.isCheckPointerDrag=!1,this.allowLoadingAnimation=(0===this.animationDuration&&"Enable"===Ut||0<this.animationDuration)&&!this.isOverAllAnimationComplete,this.allowLoadingAnimation&&0===document.getElementsByClassName(this.element.id+"animation").length&&((e=Q("style",{className:this.element.id+"animation"})).style.cssText="."+this.element.id+"animation{opacity: 0}",document.body.appendChild(e)),this.renderElements()},DWt.prototype.renderGaugeElements=function(){this.appendSecondaryElement(),this.renderBorder(),this.renderTitle(),this.renderContainer()},DWt.prototype.appendSecondaryElement=function(){var e;je(S5t(this.element.id+"_Secondary_Element"))&&((e=Q("div")).id=this.element.id+"_Secondary_Element",e.style.position="relative",this.element.appendChild(e))},DWt.prototype.calculateBounds=function(){this.gaugeAxisLayoutPanel.calculateAxesBounds()},DWt.prototype.renderAxisElements=function(){this.axisRenderer.renderAxes(),this.element.appendChild(this.svgObject),this.annotationsModule&&this.annotationsModule.renderAnnotationElements(this),this.isCheckPointerDrag||this.trigger("loaded",{gauge:this}),A5t("gauge-measuretext")},DWt.prototype.renderBorder=function(){var e=this.border.width;(0<e||this.background||this.themeStyle.backgroundColor)&&(e=new H5t(this.element.id+"_LinearGaugeBorder",this.background||this.themeStyle.backgroundColor,this.border,1,new O5t(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e)),this.svgObject.appendChild(this.renderer.drawRectangle(e)))},DWt.prototype.renderTitle=function(){var e=this.availableSize.width-this.margin.left-this.margin.right,t={size:this.titleStyle.size||this.themeStyle.titleFontSize,color:this.titleStyle.color,fontFamily:this.titleStyle.fontFamily||this.themeStyle.fontFamily,fontWeight:this.titleStyle.fontWeight||this.themeStyle.titleFontWeight,fontStyle:this.titleStyle.fontStyle||this.themeStyle.titleFontStyle,opacity:this.titleStyle.opacity},i=v5t(e,this.title,t),n=y5t(i,t),i=new z5t(this.element.id+"_LinearGaugeTitle",this.availableSize.width/2,this.margin.top+n.height/2,"middle",i),n={x:i.x-n.width/2,y:i.y,width:n.width,height:n.height},o=this.margin.left,n=n.y,r=this.availableSize.height-n-this.margin.bottom;this.actualRect={x:o,y:n,width:e,height:r},this.title&&((o=U5t(i,t,t.color||this.themeStyle.titleFontColor,null,this.svgObject)).setAttribute("aria-label",this.description||this.title),o.setAttribute("role","region"),o.setAttribute("tabindex",this.tabIndex.toString()))},DWt.prototype.unWireEvents=function(){E.remove(this.element,F.touchStartEvent,this.gaugeOnMouseDown),E.remove(this.element,F.touchMoveEvent,this.mouseMove),E.remove(this.element,F.touchEndEvent,this.mouseEnd),E.remove(this.element,"contextmenu",this.gaugeRightClick),E.remove(this.element,F.isPointer?"pointerleave":"mouseleave",this.mouseLeave),window.removeEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeEvent)},DWt.prototype.wireEvents=function(){E.add(this.element,F.touchStartEvent,this.gaugeOnMouseDown,this),E.add(this.element,F.touchMoveEvent,this.mouseMove,this),E.add(this.element,F.touchEndEvent,this.mouseEnd,this),E.add(this.element,"contextmenu",this.gaugeRightClick,this),E.add(this.element,F.isPointer?"pointerleave":"mouseleave",this.mouseLeave,this),this.resizeEvent=this.gaugeResize.bind(this),E.add(window,F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeEvent),this.setStyle(this.element)},DWt.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"},DWt.prototype.gaugeResize=function(){var e,t,i=this;return this.isDestroyed||(e={gauge:this,previousSize:new R5t(this.availableSize.width,this.availableSize.height),name:"resized",currentSize:new R5t(0,0),cancel:!1},t=this.element.getBoundingClientRect(),e.currentSize=new R5t(t.width,t.height),this.trigger("resized",e),e.cancel)||(this.resizeTo&&clearTimeout(this.resizeTo),!je(this.element)&&this.element.classList.contains("e-lineargauge")&&(this.resizeTo=window.setTimeout(function(){i.gaugeResized=!0,i.createSvg(),i.allowLoadingAnimation=!1,i.renderElements()},500))),!1},DWt.prototype.destroy=function(){this.unWireEvents(),EWt.prototype.destroy.call(this),je(this.gaugeAxisLayoutPanel)||this.gaugeAxisLayoutPanel.destroy(),je(this.axisRenderer)||this.axisRenderer.destroy(),this.gaugeAxisLayoutPanel=null,this.axisRenderer=null,this.activePointer=null,this.activeAxis=null,this.actualRect=null,this.containerObject=null,this.containerBounds=null,this.availableSize=null,this.mouseElement=null,this.nearSizes=[],this.farSizes=[],this.themeStyle=null,this.intl=null,this.removeSvg(),this.resizeEvent=null,this.svgObject=null,this.renderer=null},DWt.prototype.renderContainer=function(){for(var e,t,i,n,o="transparent"!==this.container.backgroundColor||"Bootstrap4"!==this.theme&&"Material"!==this.theme&&"Material3"!==this.theme&&"Material3Dark"!==this.theme&&"Fluent2"!==this.theme&&"Fluent2Dark"!==this.theme&&"Bootstrap5"!==this.theme&&"Bootstrap5Dark"!==this.theme&&"Tailwind"!==this.theme&&"TailwindDark"!==this.theme&&"Tailwind3"!==this.theme&&"Tailwind3Dark"!==this.theme?this.container.backgroundColor:this.themeStyle.containerBackground,r=this.container.width,s=r+r/2/Math.PI,a=r/2,l=!1,h=0;h<this.axes.length;h++)if(this.axes[h].minimum!==this.axes[h].maximum){l=!0;break}"Vertical"===this.orientation?(t=this.allowMargin?(t=this.actualRect.height,t=0<this.container.height?this.container.height:2*(t/2-t/2/4),"Thermometer"===this.container.type?t-2*s-a:t):(t=this.actualRect.height-20-30,"Thermometer"===this.container.type&&0!==r?this.actualRect.height-2*s-a-30:t),e=this.container.width,i=this.actualRect.x+(this.actualRect.width/2-this.container.width/2)+this.container.offset,n=this.actualRect.y+(this.actualRect.height/2-("Thermometer"===this.container.type?(t+2*s-a)/2:t/2))):(e=this.allowMargin?(e=0<this.container.height?this.container.height:2*(this.actualRect.width/2-this.actualRect.width/2/4),"Thermometer"===this.container.type?e-2*s-a:e):(e=this.actualRect.width-20,"Thermometer"===this.container.type?this.actualRect.width-2*s-a:e),i=this.actualRect.x+(this.actualRect.width/2-("Thermometer"===this.container.type?(e-2*s+a)/2:e/2)),n=this.actualRect.y+(this.actualRect.height/2-this.container.width/2)+this.container.offset,t=this.container.width),this.containerBounds=l?{x:i,y:n,width:e,height:t}:{x:0,y:0,width:0,height:0},(0<this.containerBounds.width&&"Vertical"===this.orientation||0<this.containerBounds.height&&"Horizontal"===this.orientation)&&(this.containerObject=this.renderer.createGroup({id:this.element.id+"_Container_Group",transform:"translate( 0, 0)"}),"Normal"===this.container.type?(r={color:this.container.border.color||this.themeStyle.containerBorderColor,width:this.container.border.width,dashArray:this.container.border.dashArray},s=new H5t(this.element.id+"_"+this.container.type+"_Layout",o,r,1,new O5t(i,n,e,t)),this.containerObject.appendChild(this.renderer.drawRectangle(s))):(a=eWt(this.containerBounds,this.container.type,this.orientation,new R5t(this.container.height,this.container.width),"container",null,null,this.container.roundedCornerRadius),r=new N5t(this.element.id+"_"+this.container.type+"_Layout",o,this.container.border.width,this.container.border.color||this.themeStyle.containerBorderColor,1,this.container.border.dashArray,a),this.containerObject.appendChild(this.renderer.drawPath(r))),this.allowLoadingAnimation&&this.containerObject.classList.add(this.element.id+"animation"),this.svgObject.appendChild(this.containerObject))},DWt.prototype.setMouseXY=function(e){var t,i,n=S5t(this.element.id+"_svg").getBoundingClientRect(),o=this.element.getBoundingClientRect();-1<e.type.indexOf("touch")?(this.isTouch=!0,t=e.changedTouches[0].clientY,i=e.changedTouches[0].clientX):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType,i=e.clientX,t=e.clientY),this.mouseY=t-o.top-Math.max(n.top-o.top,0),this.mouseX=i-o.left-Math.max(n.left-o.left,0)},DWt.prototype.gaugeOnMouseDown=function(i){var n,o,r=this,s=(this.setMouseXY(i),this.getMouseArgs(i,"touchstart",u5t));return this.trigger(u5t,s,function(){var e,t;r.mouseX=s.x,r.mouseY=s.y,r.isTouch&&(i.preventDefault(),r.isTouchPointer=!0),s.target&&!s.cancel&&(-1<s.target.id.indexOf("MarkerPointer")||-1<s.target.id.indexOf("BarPointer"))&&(r.isOverAllAnimationComplete=!0,n=r.moveOnPointer(s.target),o=Y5t(s.target,r),r.activeAxis=r.axes[o.axisIndex],r.activePointer=r.activeAxis.pointers[o.pointerIndex],je(r.activePointer.pathElement)&&(r.activePointer.pathElement=[i.target]),e=parseInt(r.activePointer.pathElement[0].id.slice(-1),10),t=parseInt(r.activePointer.pathElement[0].id.match(/\d/g)[0],10),o.pointer.enableDrag&&r.trigger("dragStart",{axis:r.activeAxis,name:"dragStart",pointer:r.activePointer,currentValue:r.activePointer.currentValue,pointerIndex:e,axisIndex:t}),!je(n))&&n.pointer&&(r.pointerDrag=!0,r.mouseElement=s.target)}),!1},DWt.prototype.mouseMove=function(n){var o,r=this,s=(this.setMouseXY(n),this.getMouseArgs(n,"touchmove",p5t));return this.trigger(p5t,s,function(){var e,t,i;r.mouseX=s.x,r.mouseY=s.y,s.target&&!s.cancel&&(r.pointerDrag&&r.activePointer?je(r.activePointer.pathElement)||(r.isTouch&&(r.isTouchPointer=!0,n.preventDefault()),t=parseInt(r.activePointer.pathElement[0].id.slice(-1),10),i=parseInt(r.activePointer.pathElement[0].id.split("AxisIndex_")[1].match(/\d/g)[0],10),r.axes[i].pointers[t].enableDrag&&(!je(o=r.moveOnPointer(r.activePointer.pathElement[0]))&&o.pointer&&(r.element.style.cursor=o.style),r.isDrag=r.isCheckPointerDrag=!0,e={axis:r.activeAxis,pointer:r.activePointer,previousValue:r.activePointer.currentValue,name:"dragMove",currentValue:null,axisIndex:i,pointerIndex:t},-1<r.activePointer.pathElement[0].id.indexOf("MarkerPointer")?r.markerDrag(r.activeAxis,r.activeAxis.pointers[t]):r.barDrag(r.activeAxis,r.activeAxis.pointers[t]),e.currentValue=r.activePointer.currentValue,r.trigger("dragMove",e))):-1<s.target.id.indexOf("Pointer")&&je(r.activePointer)?(t=parseInt(s.target.id.split("Pointer_")[1],10),i=parseInt(s.target.id.split("AxisIndex_")[1].match(/\d/g)[0],10),r.axes[i].pointers[t].enableDrag&&(r.element.style.cursor="pointer")):r.element.style.cursor=r.pointerDrag?r.element.style.cursor:"auto",r.gaugeOnMouseMove())}),this.notify(F.touchMoveEvent,n),(!je(s.target)&&s.target.id===this.element.id+"_LinearGaugeTitle"||document.getElementById(this.element.id+"_EJ2_Title_Tooltip"))&&this.titleTooltip(n,!1),!1},DWt.prototype.titleTooltip=function(e,t){e.target.id===this.element.id+"_LinearGaugeTitle"&&-1<e.target.textContent.indexOf("...")?(clearTimeout(this.tooltipTimeout),iWt(this.title,this),t&&(this.tooltipTimeout=setTimeout(nWt.bind(this),2e3))):A5t(this.element.id+"_EJ2_Title_Tooltip")},DWt.prototype.moveOnPointer=function(e){var t,i,n=this.element.getBoundingClientRect(),o=!1,r=S5t(e.id),s=r,e=Y5t(e,this),a=e.axis,e=e.pointer;return e.enableDrag&&(t=(o="Bar"!==e.type||("Vertical"===this.orientation?(e=r.getBoundingClientRect().top-n.top,e=a.isInversed?e+s.getBBox().height:e,a.isInversed?this.mouseY<=e&&this.mouseY>e-10:this.mouseY<e+10&&this.mouseY>=e):(e=r.getBoundingClientRect().left-n.left,e=a.isInversed?e:e+s.getBBox().width,a.isInversed?this.mouseX>=e&&this.mouseX<e+10:this.mouseX>e-10&&this.mouseX<=e)),"grabbing")),i=o?{pointer:o,style:t}:i},DWt.prototype.gaugeRightClick=function(e){return 2!==e.buttons&&"touch"!==e.pointerType||(e.preventDefault(),e.stopPropagation(),!1)},DWt.prototype.mouseLeave=function(e){this.activeAxis=null,this.activePointer=null;e=this.getMouseArgs(e,"touchmove",c5t);return this.trigger(c5t,e),je(this.mouseElement)||(this.mouseElement=null,this.pointerDrag=!1),!1},DWt.prototype.gaugeOnMouseMove=function(){var e;return this.pointerDrag&&(e=Y5t(this.mouseElement,this)).pointer.enableDrag&&e.pointer.animationComplete&&this[e.pointer.type.toLowerCase()+"Drag"](e.axis,e.pointer),!0},DWt.prototype.mouseEnd=function(e){this.isTouchPointer=!1,this.setMouseXY(e);var t,i,n=!je(this.activePointer)&&"Image"===this.activePointer.markerType,o=this.getMouseArgs(e,"touchend",g5t);return this.trigger(g5t,o),this.activeAxis&&this.activePointer&&(t=parseInt(this.activePointer.pathElement[0].id.slice(-1),10),i=parseInt(this.activePointer.pathElement[0].id.split("_AxisIndex_")[1],10),this.activePointer.enableDrag)&&(this.trigger("dragEnd",{name:"dragEnd",axis:this.activeAxis,pointer:this.activePointer,currentValue:this.activePointer.currentValue,axisIndex:i,pointerIndex:t}),this.axes[i].pointers[t].value=this.activePointer.currentValue,this.activeAxis=null,this.activePointer=null,this.isDrag=!1,je(this.mouseElement&&!n)||this.triggerDragEvent(this.mouseElement)),je(this.mouseElement)||(this.mouseElement=null,this.pointerDrag=!1),this.element.style.cursor="auto",this.notify(F.touchEndEvent,e),o.target.id!==this.element.id+"_LinearGaugeTitle"&&!document.getElementById(this.element.id+"_EJ2_Title_Tooltip")||this.titleTooltip(e,!0),!0},DWt.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},DWt.prototype.export=function(i,n,o,r){var s=this;return je(r)&&(r=!0),"PDF"!==i&&this.allowImageExport&&this.imageExportModule?new Promise(function(e,t){e(s.imageExportModule.export(s,i,n,r))}):this.allowPdfExport&&this.pdfExportModule?new Promise(function(e,t){e(s.pdfExportModule.export(s,i,n,o,r))}):null},DWt.prototype.getMouseArgs=function(e,t,i){var n=this.element.getBoundingClientRect(),n=new L5t(-n.left,-n.top),t=e.type===t;return n.x+=(t?e.changedTouches[0]:e).clientX,n.y+=(t?e.changedTouches[0]:e).clientY,{cancel:!1,name:i,model:this,x:n.x,y:n.y,target:e.target}},DWt.prototype.markerDrag=function(e,t){var i,n,o=w5t(this.element,this.mouseElement,this.orientation,e,"drag",new L5t(this.mouseX,this.mouseY));b5t(o,null,null,e.visibleRange.max,e.visibleRange.min,"pointer")&&(i=new N5t("pointerID",t.color||this.themeStyle.pointerColor,t.border.width,t.border.color,t.opacity,t.border.dashArray,null,""),"Vertical"===this.orientation?t.bounds.y=this.mouseY:t.bounds.x=this.mouseX+tWt(this.element),t.currentValue=this.isTouch?t.startValue=o:t.value=o,"Text"===t.markerType&&(n=new z5t("pointerID",void 0,void 0,"middle",t.text,null,"auto"),n=$5t(t.bounds,t.markerType,n,this.orientation,e,t)),i=Z5t(t.bounds,t.markerType,new R5t(t.width,t.height),t.imageUrl,i,this.orientation,e,t),"Image"===t.markerType||"Text"===t.markerType?(this.mouseElement.setAttribute("x",("Text"===t.markerType?n.x:t.bounds.x-t.bounds.width/2).toString()),this.mouseElement.setAttribute("y",("Text"===t.markerType?n.y:t.bounds.y-t.bounds.height/2).toString())):"Circle"===t.markerType?(this.mouseElement.setAttribute("cx",i.cx.toString()),this.mouseElement.setAttribute("cy",i.cy.toString()),this.mouseElement.setAttribute("r",i.r.toString())):this.mouseElement.setAttribute("d",i.d))},DWt.prototype.barDrag=function(e,t){var i,n=e.lineBounds,o=e.visibleRange,r="Vertical"===this.orientation?n.height:n.width,n="Vertical"===this.orientation?n.y:n.x,s=x5t(o.min,e,this.orientation,o)*r+n,o=x5t(o.max,e,this.orientation,o)*r+n;"Vertical"===this.orientation?(i=e.isInversed?this.mouseY>s&&this.mouseY<o:this.mouseY>o&&this.mouseY<s)&&("Normal"!==this.container.type&&0!==this.container.width||je(this.mouseElement)?(e.isInversed||(t.bounds.y=this.mouseY),t.bounds.height=Math.abs(s-this.mouseY)):(e.isInversed||this.mouseElement.setAttribute("y",this.mouseY.toString()),this.mouseElement.setAttribute("height",Math.abs(s-this.mouseY).toString()))):(r=tWt(this.element),(i=e.isInversed?this.mouseX+r>o&&this.mouseX+r<s:this.mouseX+r>s&&this.mouseX+r<o)&&("Normal"!==this.container.type&&0!==this.container.width||je(this.mouseElement)?(e.isInversed&&(t.bounds.x=this.mouseX+r),t.bounds.width=Math.abs(s-(this.mouseX+r))):(e.isInversed&&this.mouseElement.setAttribute("x",(this.mouseX+r).toString()),this.mouseElement.setAttribute("width",Math.abs(s-(this.mouseX+r)).toString())))),je(this.mouseElement)||(n=w5t(this.element,this.mouseElement,this.orientation,e,"drag",new L5t(this.mouseX,this.mouseY)),t.currentValue=this.isTouch?t.startValue=n:t.value=n),i&&!je(this.mouseElement)&&"path"===this.mouseElement.tagName&&(o=eWt(t.bounds,this.container.type,this.orientation,new R5t(t.bounds.width,t.bounds.height),"bar",this.container.width,e,t.roundedCornerRadius),this.mouseElement.setAttribute("d",o))},DWt.prototype.triggerDragEvent=function(e){var t=this,i=Y5t(e,this),n=w5t(this.element,e,this.orientation,i.axis,"tooltip",null),e={name:"valueChange",gauge:this,element:e,axisIndex:i.axisIndex,axis:i.axis,pointerIndex:i.pointerIndex,pointer:i.pointer,value:n};this.trigger("valueChange",e,function(e){n!==e.value&&t.setPointerValue(e.axisIndex,e.pointerIndex,e.value)})},DWt.prototype.setPointerValue=function(e,t,i){var n,o,r;this.isDestroyed||(o=(n=this.axes[e]).pointers[t],this.gaugeResized=!1,this.allowLoadingAnimation&&(this.allowLoadingAnimation=!1,this.createSvg(),this.renderGaugeElements(),this.calculateBounds(),this.renderAxisElements()),o.startValue!==i&&(this.isPointerAnimationInProgress=!1,r=S5t(this.element.id+"_AxisIndex_"+e+"_"+o.type+"Pointer_"+t),i=i<n.visibleRange.min?n.visibleRange.min:i>n.visibleRange.max?n.visibleRange.max:i,o.currentValue=i,o.isPointerAnimation=!0,this.isPropertyChange=!0,null!==r&&b5t(o.currentValue,null,null,n.visibleRange.max,n.visibleRange.min,"pointer")&&(o.value=this.pointerDrag?this.isTouch?o.startValue:i:o.value,this.gaugeAxisLayoutPanel["calculate"+o.type+"Bounds"](n,o),this.axisRenderer["draw"+o.type+"Pointer"](n,e,o,t,r.parentElement)),this.isProtectedOnChange=!0,o.startValue=o.currentValue,o.currentValue=i,o.value=i,this.isProtectedOnChange=!1))},DWt.prototype.setAnnotationValue=function(e,t,i){var n,o,r,s;this.isDestroyed||(n=null===S5t(this.element.id+"_Annotation_"+e),o=S5t(this.element.id+"_AnnotationsGroup")||Q("div",{id:this.element.id+"_AnnotationsGroup"}),r=this.annotations[e],null!==t&&(A5t(this.element.id+"_Annotation_"+e),r.content=t,r.axisValue=je(i)?r.axisValue:i,this.annotationsModule.createAnnotationTemplate(o,e,this),je(r.axisIndex)?n||je(s=S5t(this.element.id+"_Annotation_"+e))||"object"!=typeof s||o.appendChild(s):(t=this.axes[r.axisIndex].visibleRange,s=S5t(this.element.id+"_Annotation_"+e),!n&&r.axisValue>=t.min&&r.axisValue<=t.max&&!je(s)&&"object"==typeof s&&o.appendChild(s))))},DWt.prototype.isGradientVisible=function(){for(var e=!1,t=0,i=this.axes;t<i.length;t++){for(var n=i[t],o=0,r=n.pointers;o<r.length;o++){var s=r[o];if(!je(s.linearGradient)||!je(s.radialGradient)){e=!0;break}}for(var a=0,l=n.ranges;a<l.length;a++){var h=l[a];if(!je(h.linearGradient)||!je(h.radialGradient)){e=!0;break}}}return e},DWt.prototype.requiredModules=function(){var e=[],t=!1;return this.annotations.map(function(e){t=t||!je(e.content)&&0!==e.content.length||"function"==typeof e.content}),t&&e.push({member:"Annotations",args:[this,pWt],name:"Annotations"}),this.tooltip.enable&&e.push({member:"Tooltip",args:[this,uWt],name:"GaugeTooltip"}),this.allowPrint&&e.push({member:"Print",args:[this],name:"Print"}),this.allowImageExport&&e.push({member:"ImageExport",args:[this],name:"ImageExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this],name:"PdfExport"}),this.isGradientVisible()&&e.push({member:"Gradient",args:[this,xWt],name:"Gradient"}),e},DWt.prototype.getPersistData=function(){return this.addOnPersist(["loaded"])},DWt.prototype.getModuleName=function(){return"lineargauge"},DWt.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){var i=!1,n=!1;this.allowLoadingAnimation=0<this.animationDuration&&!this.isOverAllAnimationComplete,this.isPropertyChange=!(0<this.animationDuration&&!this.isOverAllAnimationComplete),this.gaugeResized=!1;for(var o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"height":case"width":case"margin":this.createSvg(),n=!0;break;case"title":n=""===e.title||""===t.title,i=!(""===e.title||""===t.title);break;case"titleStyle":e.titleStyle&&e.titleStyle.size?n=!0:i=!0;break;case"border":case"background":i=!0;break;case"container":n=!0;break;case"orientation":this.isOverAllAnimationComplete=!0,this.isPointerAnimationInProgress=this.allowLoadingAnimation=!1;for(var s=0;s<this.axes.length;s++)for(var a=0;a<this.axes[s].pointers.length;a++)this.axes[s].pointers[a].startValue=this.axes[s].minimum,this.axes[s].pointers[a].isPointerAnimation=!0;n=!0;break;case"axes":for(var l=0;l<this.axes.length;l++)if(!je(e.axes[l]))for(var h=0,d=Object.keys(e.axes[l]);h<d.length;h++)if("pointers"===d[h])for(var p=Object.keys(e.axes[l].pointers).length,c=0;c<p;c++){var u,g=parseInt(Object.keys(e.axes[l].pointers)[c],10);isNaN(g)||je(Object.keys(e.axes[l].pointers[g]))||(this.allowLoadingAnimation=!1,this.isPointerAnimationInProgress=!1,this.axes[l].pointers[g].startValue=this.axes[l].pointers[g].currentValue,this.axes[l].pointers[g].isPointerAnimation=-1<Object.keys(e.axes[l].pointers[g]).indexOf("value"),this.pointerDrag&&(this.axes[l].pointers[g].isPointerAnimation=!1,this.isTouchPointer)&&e.axes[l].pointers[g].text!==t.axes[l].pointers[g].text&&(u=this.axes[l].pointers[g],g=this.element.id+"_AxisIndex_"+l+"_"+u.type+"Pointer_"+g,this.axisRenderer.updateTextPointer(g,u,this.axes[l])))}n=!0}!this.isTouchPointer&&je(this.activePointer)&&(!n&&i&&(this.removeSvg(),this.renderGaugeElements(),this.renderAxisElements()),n||this.allowLoadingAnimation)&&(this.createSvg(),this.renderGaugeElements(),this.calculateBounds(),this.renderAxisElements(),this.allowLoadingAnimation)&&(this.allowLoadingAnimation=0<this.animationDuration&&!this.isOverAllAnimationComplete,this.renderAnimation())}},m4([e(null)],DWt.prototype,"width",void 0),m4([e(!0)],DWt.prototype,"allowMargin",void 0),m4([e(null)],DWt.prototype,"height",void 0),m4([e(0)],DWt.prototype,"animationDuration",void 0),m4([e("Vertical")],DWt.prototype,"orientation",void 0),m4([e("None")],DWt.prototype,"edgeLabelPlacement",void 0),m4([e(!1)],DWt.prototype,"allowPrint",void 0),m4([e(!1)],DWt.prototype,"allowImageExport",void 0),m4([e(!1)],DWt.prototype,"allowPdfExport",void 0),m4([t({},Sg)],DWt.prototype,"margin",void 0),m4([t({color:"",width:0},gg)],DWt.prototype,"border",void 0),m4([e(null)],DWt.prototype,"background",void 0),m4([e("")],DWt.prototype,"title",void 0),m4([t({size:null,color:null,fontFamily:null,fontStyle:null,fontWeight:null},hft)],DWt.prototype,"titleStyle",void 0),m4([t({},vg)],DWt.prototype,"container",void 0),m4([kt([{}],ey)],DWt.prototype,"axes",void 0),m4([t({},Pc)],DWt.prototype,"tooltip",void 0),m4([kt([{}],Tg)],DWt.prototype,"annotations",void 0),m4([e([])],DWt.prototype,"rangePalettes",void 0),m4([e(!1)],DWt.prototype,"useGroupingSeparator",void 0),m4([e(null)],DWt.prototype,"description",void 0),m4([e(0)],DWt.prototype,"tabIndex",void 0),m4([e(null)],DWt.prototype,"format",void 0),m4([e("Material")],DWt.prototype,"theme",void 0),m4([i()],DWt.prototype,"loaded",void 0),m4([i()],DWt.prototype,"load",void 0),m4([i()],DWt.prototype,"animationComplete",void 0),m4([i()],DWt.prototype,"axisLabelRender",void 0),m4([i()],DWt.prototype,"dragStart",void 0),m4([i()],DWt.prototype,"dragMove",void 0),m4([i()],DWt.prototype,"dragEnd",void 0),m4([i()],DWt.prototype,"annotationRender",void 0),m4([i()],DWt.prototype,"tooltipRender",void 0),m4([i()],DWt.prototype,"gaugeMouseMove",void 0),m4([i()],DWt.prototype,"gaugeMouseLeave",void 0),m4([i()],DWt.prototype,"gaugeMouseDown",void 0),m4([i()],DWt.prototype,"gaugeMouseUp",void 0),m4([i()],DWt.prototype,"valueChange",void 0),m4([i()],DWt.prototype,"resized",void 0),m4([i()],DWt.prototype,"beforePrint",void 0),m4([Bt],DWt));function DWt(e,t){e=EWt.call(this,e,t)||this;return e.gradientCount=0,e.isDrag=!1,e.splitUpCount=0,e.allowLoadingAnimation=!1,e.isPointerAnimationInProgress=!1,e.isOverAllAnimationComplete=!1,e.pointerDrag=!1,e.isTouchPointer=!1,e.isCheckPointerDrag=!1,e.mouseX=0,e.mouseY=0,e.gaugeResized=!1,e}MWt.prototype.print=function(e,t){var i=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),n=(i.moveTo(0,0),i.resizeTo(screen.availWidth,screen.availHeight),{cancel:!1,htmlContent:this.getHTMLContent(e,t),name:"beforePrint"});e.trigger("beforePrint",n,function(){n.cancel||V(n.htmlContent,i)})},MWt.prototype.getHTMLContent=function(e,t){var i,n,o=Q("div");return t?t instanceof Array?t.forEach(function(e){o.appendChild(S5t(e).cloneNode(!0))}):t instanceof Element?o.appendChild(t.cloneNode(!0)):o.appendChild(S5t(t).cloneNode(!0)):(je(n=(t=e.element.cloneNode(!0)).getElementsByTagName("svg")[0])||je(n=n.childNodes[0])||(i=n.getAttribute("fill"),"Tailwind"!==e.theme&&"Tailwind3"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==i&&"transparent"!==i?"TailwindDark"!==e.theme&&"Tailwind3Dark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==i&&"transparent"!==i||n.setAttribute("fill","rgba(0, 0, 0, 1)"):n.setAttribute("fill","rgba(255,255,255, 1)"),""===n.getAttribute("stroke")&&n.setAttribute("stroke","transparent")),o.appendChild(t)),o},MWt.prototype.getModuleName=function(){return"Print"},MWt.prototype.destroy=function(){};C4=MWt;function MWt(e){}kWt.prototype.export=function(l,h,d,p){return new Promise(function(e){var t,i,n=Q("canvas",{id:"ej2-canvas",attrs:{width:l.availableSize.width.toString(),height:l.availableSize.height.toString()}}),o=l.svgObject.cloneNode(!0),r=o.childNodes[0].getAttribute("fill"),s=("Tailwind"!==l.theme&&"Tailwind3"!==l.theme&&"Bootstrap5"!==l.theme&&"Fluent"!==l.theme&&"Material3"!==l.theme&&"Fluent2"!==l.theme||"rgba(255,255,255, 0.0)"!==r&&"transparent"!==r?"TailwindDark"!==l.theme&&"Tailwind3Dark"!==l.theme&&"Bootstrap5Dark"!==l.theme&&"FluentDark"!==l.theme&&"Material3Dark"!==l.theme&&"Fluent2Dark"!==l.theme&&"Fluent2HighContrast"!==l.theme||"rgba(255,255,255, 0.0)"!==r&&"transparent"!==r||o.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):o.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)"),!(-1<F.userAgent.toString().indexOf("HeadlessChrome"))),r='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+o.outerHTML+"</svg>",a=window.URL.createObjectURL(new Blob("SVG"===h?[r]:[(new XMLSerializer).serializeToString(o)],{type:"image/svg+xml"}));"SVG"===h?p?k5t(d,h,a,s):e(null):(t=new Image,i=n.getContext("2d"),t.onload=function(){i.drawImage(t,0,0),window.URL.revokeObjectURL(a),p?k5t(d,h,n.toDataURL("image/png").replace("image/png","image/octet-stream"),s):"JPEG"===h?e(n.toDataURL("image/jpeg")):"PNG"===h&&e(n.toDataURL("image/png"))},t.src=a)})},kWt.prototype.getModuleName=function(){return"ImageExport"},kWt.prototype.destroy=function(){};h3=kWt;function kWt(e){}PWt.prototype.export=function(l,h,d,p,c){return new Promise(function(i){var n=Q("canvas",{id:"ej2-canvas",attrs:{width:l.availableSize.width.toString(),height:l.availableSize.height.toString()}}),e=(p=je(p)?up.Landscape:p,'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+l.svgObject.outerHTML+"</svg>"),t=l.svgObject.cloneNode(!0),o=t.childNodes[0].getAttribute("fill"),r=("Tailwind"!==l.theme&&"Tailwind3"!==l.theme&&"Bootstrap5"!==l.theme&&"Fluent"!==l.theme&&"Material3"!==l.theme&&"Fluent2"!==l.theme||"rgba(255,255,255, 0.0)"!==o&&"transparent"!==o?"TailwindDark"!==l.theme&&"Tailwind3Dark"!==l.theme&&"Bootstrap5Dark"!==l.theme&&"FluentDark"!==l.theme&&"Material3Dark"!==l.theme&&"Fluent2Dark"!==l.theme&&"Fluent2HighContrast"!==l.theme||"rgba(255,255,255, 0.0)"!==o&&"transparent"!==o||t.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):t.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)"),window.URL.createObjectURL(new Blob("SVG"===h?[e]:[(new XMLSerializer).serializeToString(t)],{type:"image/svg+xml"}))),s=new Image,a=n.getContext("2d");s.onload=function(){a.drawImage(s,0,0),window.URL.revokeObjectURL(r);var e=new sg,t=n.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");e.pageSettings.orientation=p,t=t.slice(t.indexOf(",")+1),e.pages.add().graphics.drawImage(new oc(t),0,0,l.availableSize.width-60,l.availableSize.height),c?(e.save(d+".pdf"),e.destroy()):i(null)},s.src=r})},PWt.prototype.getModuleName=function(){return"PdfExport"},PWt.prototype.destroy=function(){};C5=PWt;function PWt(e){}v4.Inject(uWt,pWt,C4,C5,h3,xWt);var x5=Object.freeze({__proto__:null,LinearGauge:v4,Font:hft,TextStyle:W,Margin:Sg,Border:gg,Annotation:Tg,Container:vg,RangeTooltip:Xd,TooltipSettings:Pc,Line:nf,Label:s,Range:sf,Tick:af,Pointer:qf,Axis:ey,stringToNumber:m5t,stringToNumberSize:f5t,measureText:y5t,textTrim:v5t,withInRange:b5t,convertPixelToValue:w5t,getPathToRect:C5t,getElement:S5t,removeElement:A5t,valueToCoefficient:x5t,getFontStyle:I5t,textFormatter:T5t,formatValue:E5t,getTemplateFunction:D5t,getElementOffset:M5t,triggerDownload:k5t,VisibleRange:F5t,GaugeLocation:L5t,Size:R5t,Rect:O5t,CustomizeOption:P5t,PathOption:N5t,RectOption:H5t,TextOption:z5t,VisibleLabels:W5t,Align:Q5t,textElement:U5t,calculateNiceInterval:q5t,getActualDesiredIntervalsCount:G5t,getPointer:Y5t,getRangeColor:X5t,getMousePosition:K5t,getRangePalette:J5t,calculateShapes:Z5t,calculateTextPosition:$5t,getBox:eWt,getExtraWidth:tWt,showTooltip:iWt,removeTooltip:nWt,Annotations:pWt,GaugeTooltip:uWt,Print:C4,ImageExport:h3,PdfExport:C5,ColorStop:rz,GradientPosition:Iz,LinearGradient:n3,RadialGradient:Jj,Gradient:xWt}),E5=Object.freeze({__proto__:null,PaneProperties:qo,Splitter:fKe,Panel:EKe,DashboardLayout:$$,get TimelineOrientation(){return BKe},get TimelineAlign(){return FKe},TimelineItem:d2,Timeline:M$}),BWt="actionBegin",FWt="actionComplete",LWt="actionFailure",RWt="cardDoubleClick",OWt="cardRendered",NWt="queryCellInfo",VWt="dataBinding",_Wt="dataBound",HWt="dialogOpen",zWt="dialogClose",jWt="content-ready",WWt="data-ready",QWt="dataSourceChanged",UWt="dataStateChange",qWt=(GWt.prototype.initDataManager=function(e,t){this.dataManager=e instanceof me?e:new me(e),this.query=t instanceof ya?t:new ya,this.kanbanData=new me(this.parent.kanbanData)},GWt.prototype.isRemote=function(){return!0!==this.dataManager.dataSource.offline&&void 0!==this.dataManager.dataSource.url&&""!==this.dataManager.dataSource.url},GWt.prototype.columnKeyFields=function(){for(var e=[],t=0,i=this.parent.columns;t<i.length;t++){var n=i[t];if(1<n.keyField.toString().split(",").length)for(var o=0,r=n.keyField.toString().split(",");o<r.length;o++){var s=r[o];e.push(s.trim())}else e.push(n.keyField.toString())}return e},GWt.prototype.getQuery=function(e){var t=this.query.clone();if(this.isRemote()&&this.parent.enableVirtualization){for(var i="auto"===this.parent.cardHeight?100:parseInt(T(this.parent.cardHeight).split("px")[0],10),i="auto"===this.parent.height?2*Math.ceil(window.innerHeight/i):2*Math.ceil(parseInt(T(this.parent.height).split("px")[0],10)/i),n=this.columnKeyFields(),o=0;o<n.length;o++)t.where(this.parent.keyField,"equal",n[o]);t.take(i),je(e)&&(e="KanbanVirtualization"),t.addParams("KanbanVirtualization",e)}return t},GWt.prototype.getData=function(e){var t;return this.parent.dataSource&&"result"in this.parent.dataSource?(t=this.eventPromise({requestType:""},e),this.isObservable=!0,t.promise):this.dataManager.executeQuery(e)},GWt.prototype.setState=function(e){return this.dataState=e},GWt.prototype.getStateEventArgument=function(e){var t=new Ba,i=new me({url:"",adaptor:new Ba}),t=t.processQuery(i,e);return Pe(JSON.parse(t.data),t.pvtData)},GWt.prototype.eventPromise=function(e,t,i){var n,o=this,r=e,s=this.getStateEventArgument(t),a=new ll,t=new ll;return void 0!==e.requestType&&!1!==this.dataState.isDataChanged?"cardChanged"===(s.action=e).requestType||"cardRemoved"===e.requestType||"cardCreated"===e.requestType?((n=e).promise=t.promise,n.state=s,n.index=i,this.setState({isPending:!0,resolver:t.resolve}),r.endEdit=t.resolve,r.cancelEdit=t.reject,this.parent.trigger(QWt,n),t.promise.then(function(){o.setState({isPending:!0,resolver:a.resolve}),o.parent.trigger(UWt,s),n.addedRecords.forEach(function(e){o.parent.kanbanData.push(e)}),n.changedRecords.forEach(function(t){Pe(o.parent.kanbanData.filter(function(e){return e[o.parent.cardSettings.headerField]===t[o.parent.cardSettings.headerField]})[0],t)}),n.deletedRecords.forEach(function(t){var e=o.parent.kanbanData.findIndex(function(e){return e[o.parent.cardSettings.headerField]===t[o.parent.cardSettings.headerField]});o.parent.kanbanData.splice(e,1)})}).catch(function(){o.parent.hideSpinner()})):(this.setState({isPending:!0,resolver:a.resolve}),this.parent.trigger(UWt,s)):(this.setState({}),a.resolve(this.parent.dataSource)),a},GWt.prototype.getTable=function(){return this.parent.query?this.getQuery().fromTable:null},GWt.prototype.refreshDataManager=function(){var t=this;this.getData(this.getQuery()).then(function(e){return t.dataManagerSuccess(e)}).catch(function(e){return t.dataManagerFailure(e)})},GWt.prototype.dataManagerSuccess=function(e,t,i,n){var o=this;this.parent.isDestroyed||(t?(this.updateKanbanData(e),this.parent.enableVirtualization&&this.isRemote()&&this.parent.virtualLayoutModule.refresh()):this.parent.trigger(VWt,e,function(e){o.updateKanbanData(e),o.parent.notify(WWt,{processedData:o.parent.kanbanData}),o.parent.trigger(_Wt,null,function(){return o.parent.hideSpinner()})}),this.initload&&(this.parent.layoutModule.refresh(),this.parent.renderTemplates()),this.initload=!0)},GWt.prototype.updateKanbanData=function(e){var t=Pe([],(je(e.result.result)?e:e.result).result,null,!0);if(this.isRemote()&&this.parent.enableVirtualization&&0<t.length&&!je(e.result.count))for(var i=this.columnKeyFields(),n=0;n<i.length;n++)e.result.count[n].Key===i[n]&&(this.parent.columnDataCount[i[n]]=e.result.count[n].Value);this.parent.kanbanData=t,this.kanbanData=new me(this.parent.kanbanData)},GWt.prototype.dataManagerFailure=function(e){var t=this;this.parent.isDestroyed||this.parent.trigger(LWt,{error:e},function(){return t.parent.hideSpinner()})},GWt.prototype.updateDataManager=function(e,i,t,n,o,r,s,a,l,h){var d,p=this,t=(this.parent.showSpinner(),{requestType:t,cancel:!1,addedRecords:i.addedRecords,changedRecords:i.changedRecords,deletedRecords:i.deletedRecords});this.setState({isDataChanged:!0}),this.eventPromise(t,this.query,o),this.parent.trigger(FWt,t,function(t){t.cancel||(d=p.syncDataSource(p.dataManager,e,i,n,r,s),p.dataManager.dataSource.offline?p.isObservable||(p.syncDataSource(p.kanbanData,e,i,n,r,s),o=a===l&&h?o-1:o,p.refreshUI(t,o,r),p.parent.enableVirtualization&&p.parent.virtualLayoutModule.refreshColumnData(a,l,t.requestType,n[p.parent.keyField])):d.then(function(e){p.parent.isDestroyed||(p.getData(p.getQuery()).then(function(e){return p.dataManagerSuccess(e,"DataSourceChange",t,o)}).catch(function(e){return p.dataManagerFailure(e)}),"cardCreated"===t.requestType?Array.isArray(e)?p.modifyArrayData(t.addedRecords,e):t.addedRecords[0]=Pe(t.addedRecords[0],e):"cardChanged"===t.requestType?Array.isArray(e)?p.modifyArrayData(t.changedRecords,e):t.changedRecords[0]=Pe(t.changedRecords[0],e):"cardRemoved"===t.requestType&&(Array.isArray(e)?p.modifyArrayData(t.deletedRecords,e):t.deletedRecords[0]=Pe(t.deletedRecords[0],e)),o=a===l&&h?o-1:o,p.refreshUI(t,o,r),p.parent.enableVirtualization&&p.parent.virtualLayoutModule.refreshColumnData(a,l,t.requestType,n[p.parent.keyField]))}).catch(function(e){p.dataManagerFailure(e)}))})},GWt.prototype.syncDataSource=function(e,t,i,n,o,r){var s,a=this;switch(t){case"insert":return e.insert(n,this.getTable(),this.getQuery());case"update":return this.parent.enableVirtualization&&!this.parent.dataModule.isRemote()&&o?(s=e.remove(this.keyField,n,this.getTable(),this.getQuery()),e.insert(n,this.getTable(),this.getQuery(),e.dataSource.json.findIndex(function(e){return e[a.parent.cardSettings.headerField]===r}))):e.update(this.keyField,n,this.getTable(),this.getQuery());case"delete":return e.remove(this.keyField,n,this.getTable(),this.getQuery());case"batch":if(!this.parent.dataModule.isRemote()&&o&&this.parent.enableVirtualization&&n){for(var l=0;l<n.length;l++)s=e.remove(this.keyField,n[l],this.getTable(),this.getQuery());for(var h=e.dataSource.json.findIndex(function(e){return e[a.parent.cardSettings.headerField]===r}),l=0;l<n.length;l++,h++)s=e.insert(n[l],this.getTable(),this.getQuery(),h);return s}return e.saveChanges(i,this.keyField,this.getTable(),this.getQuery());default:return s}},GWt.prototype.modifyArrayData=function(e,t){if(e.length===t.length)for(var i=0;i<t.length;i++)e[i]=Pe(e[i],t[i]);return e},GWt.prototype.refreshUI=function(i,n,o){var r=this;(this.parent.enableVirtualization?(this.parent.virtualLayoutModule.columnData=this.parent.virtualLayoutModule.getColumnCards(),i.addedRecords.forEach(function(e,t){r.parent.virtualLayoutModule.renderCardBasedOnIndex(e,n+t,o,i.requestType)}),i.changedRecords.forEach(function(e){r.parent.virtualLayoutModule.removeCard(e),r.parent.virtualLayoutModule.renderCardBasedOnIndex(e,n,o,i.requestType),r.parent.virtualLayoutModule.isSelectedCard&&r.parent.actionModule.SingleCardSelection(e),r.parent.sortSettings.field&&"Index"===r.parent.sortSettings.sortBy&&"Descending"===r.parent.sortSettings.direction&&0<n?--n:n++}),i.deletedRecords.forEach(function(e){r.parent.virtualLayoutModule.removeCard(e)}),this.parent.virtualLayoutModule):(this.parent.layoutModule.columnData=this.parent.layoutModule.getColumnCards(),this.parent.swimlaneSettings.keyField&&(this.parent.layoutModule.kanbanRows=this.parent.layoutModule.getRows(),this.parent.layoutModule.swimlaneData=this.parent.layoutModule.getSwimlaneCards()),i.addedRecords.forEach(function(e,t){r.parent.swimlaneSettings.keyField&&!e[r.parent.swimlaneSettings.keyField]&&(e[r.parent.swimlaneSettings.keyField]=""),r.parent.layoutModule.renderCardBasedOnIndex(e,n+t)}),i.changedRecords.forEach(function(e){r.parent.swimlaneSettings.keyField&&!e[r.parent.swimlaneSettings.keyField]&&(e[r.parent.swimlaneSettings.keyField]=""),r.parent.layoutModule.removeCard(e),r.parent.layoutModule.renderCardBasedOnIndex(e,n),r.parent.layoutModule.isSelectedCard&&r.parent.actionModule.SingleCardSelection(e),r.parent.sortSettings.field&&"Index"===r.parent.sortSettings.sortBy&&"Descending"===r.parent.sortSettings.direction&&0<n?--n:n++}),i.deletedRecords.forEach(function(e){r.parent.layoutModule.removeCard(e)}),this.parent.layoutModule)).refresh(),this.parent.renderTemplates(),this.parent.notify(jWt,{}),this.parent.trigger(_Wt,i,function(){return r.parent.hideSpinner()})},GWt);function GWt(e){this.initload=!1,this.dataState={isPending:!1,resolver:null,isDataChanged:!1},this.parent=e,this.keyField=this.parent.cardSettings.headerField,this.dataState={isDataChanged:!1},this.isObservable=!1,this.initDataManager(e.dataSource,e.query),this.refreshDataManager()}YWt=function(e,t){return(YWt=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])}))(e,t)};var YWt,XWt,CW=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},xW=(function(e,t){function i(){this.constructor=e}YWt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(KWt,XWt=n),CW([e()],KWt.prototype,"keyField",void 0),CW([e()],KWt.prototype,"textField",void 0),CW([e(!1)],KWt.prototype,"showEmptyRow",void 0),CW([e(!0)],KWt.prototype,"showItemCount",void 0),CW([e(!1)],KWt.prototype,"allowDragAndDrop",void 0),CW([e()],KWt.prototype,"template",void 0),CW([e("Ascending")],KWt.prototype,"sortDirection",void 0),CW([e()],KWt.prototype,"sortComparer",void 0),CW([e(!0)],KWt.prototype,"showUnassignedRow",void 0),CW([e(!1)],KWt.prototype,"enableFrozenRows",void 0),KWt);function KWt(){return null!==XWt&&XWt.apply(this,arguments)||this}JWt=function(e,t){return(JWt=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])}))(e,t)};var JWt,ZWt,EW=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},wH=(function(e,t){function i(){this.constructor=e}JWt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}($Wt,ZWt=n),EW([e(!0)],$Wt.prototype,"showHeader",void 0),EW([e()],$Wt.prototype,"headerField",void 0),EW([e()],$Wt.prototype,"contentField",void 0),EW([e()],$Wt.prototype,"tagsField",void 0),EW([e()],$Wt.prototype,"grabberField",void 0),EW([e()],$Wt.prototype,"footerCssField",void 0),EW([e()],$Wt.prototype,"template",void 0),EW([e("Single")],$Wt.prototype,"selectionType",void 0),$Wt);function $Wt(){return null!==ZWt&&ZWt.apply(this,arguments)||this}e8t=function(e,t){return(e8t=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])}))(e,t)};var e8t,t8t,c8=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Wz=(function(e,t){function i(){this.constructor=e}e8t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(i8t,t8t=n),c8([e()],i8t.prototype,"template",void 0),c8([e([])],i8t.prototype,"fields",void 0),c8([e(null)],i8t.prototype,"model",void 0),i8t);function i8t(){return null!==t8t&&t8t.apply(this,arguments)||this}n8t=function(e,t){return(n8t=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])}))(e,t)};var n8t,o8t,$8=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},r8t=(function(e,t){function i(){this.constructor=e}n8t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(s8t,o8t=n),$8([e()],s8t.prototype,"keyField",void 0),$8([e()],s8t.prototype,"headerText",void 0),$8([e()],s8t.prototype,"template",void 0),$8([e(!1)],s8t.prototype,"allowToggle",void 0),$8([e(!0)],s8t.prototype,"isExpanded",void 0),$8([e()],s8t.prototype,"minCount",void 0),$8([e()],s8t.prototype,"maxCount",void 0),$8([e(!0)],s8t.prototype,"showItemCount",void 0),$8([e(!1)],s8t.prototype,"showAddButton",void 0),$8([e(!0)],s8t.prototype,"allowDrag",void 0),$8([e(!0)],s8t.prototype,"allowDrop",void 0),$8([e([])],s8t.prototype,"transitionColumns",void 0),s8t);function s8t(){return null!==o8t&&o8t.apply(this,arguments)||this}a8t=function(e,t){return(a8t=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])}))(e,t)};var a8t,l8t,$W=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},b8=(function(e,t){function i(){this.constructor=e}a8t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(h8t,l8t=n),$W([e()],h8t.prototype,"text",void 0),$W([e()],h8t.prototype,"keyFields",void 0),h8t);function h8t(){return null!==l8t&&l8t.apply(this,arguments)||this}d8t=function(e,t){return(d8t=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])}))(e,t)};var d8t,p8t,IQ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},DQ=(function(e,t){function i(){this.constructor=e}d8t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(c8t,p8t=n),IQ([e("Index")],c8t.prototype,"sortBy",void 0),IQ([e()],c8t.prototype,"field",void 0),IQ([e("Ascending")],c8t.prototype,"direction",void 0),c8t);function c8t(){return null!==p8t&&p8t.apply(this,arguments)||this}var u8t="e-kanban",g8t="e-device",m8t="e-icons",f8t="e-template",y8t="e-swimlane",v8t="e-kanban-table",b8t="e-kanban-header",w8t="e-header-table",C8t="e-header-cells",S8t="e-header-wrap",A8t="e-header-title",x8t="e-header-text",I8t="e-header-icon",T8t="e-stacked-header-row",E8t="e-stacked-header-cell",D8t="e-content-cells",M8t="e-kanban-content",k8t="e-content-table",P8t="e-toggle-header",B8t="e-header-row",F8t="e-content-row",L8t="e-swimlane-row",R8t="e-swimlane-row-expand",O8t="e-swimlane-row-collapse",N8t="e-item-count",V8t="e-card-wrapper",_8t="e-card-virtual-wrapper",H8t="e-card",z8t="e-droppable",j8t="e-drag",W8t="e-drop",Q8t="e-disabled",U8t="e-card-header",q8t="e-card-content",G8t="e-card-header-caption",Y8t="e-card-header-title",X8t="e-card-tags",K8t="e-card-tag",J8t="e-card-color",Z8t="e-card-label",$8t="e-card-footer",eQt="e-empty-card",tQt="e-card-footer-css",iQt="e-column-expand",nQt="e-column-collapse",oQt="e-collapse-header-text",rQt="e-collapsed",sQt="e-kanban-dialog",aQt="e-kanban-form",lQt="e-kanban-error",hQt="e-field",dQt="e-target-dragged-clone",pQt="e-cloned-card",cQt="e-kanban-dragged-card",uQt="e-target-dropped-clone",gQt="e-dropping",mQt="e-kanban-border",fQt="e-toggle-visible",yQt="e-multi-card-wrapper",vQt="e-target-multi-clone",bQt="e-column-key",wQt="e-selection",CQt="e-tooltip-text",SQt="e-swimlane-header",AQt="e-swimlane-header-toolbar",xQt="e-icon-menu",IQt="e-toolbar-swimlane-name",TQt="e-swimlane-overlay",EQt="e-swimlane-content",DQt="e-swimlane-resource",MQt="e-limits",kQt="e-max-count",PQt="e-min-count",BQt="e-max-color",FQt="e-min-color",LQt="e-popup-content",RQt="e-show-add-button",OQt="e-show-add-icon",NQt="e-show-add-focus",VQt="e-frozen-swimlane-row",_Qt="e-frozen-row",HQt=(zQt.prototype.clickHandler=function(e){var t,i=z(e.target,".e-card,.e-header-icon,.e-content-row.e-swimlane-row,.e-show-add-button,.e-frozen-swimlane-row,.e-content-row:not(.e-swimlane-row) .e-content-cells");i&&(i.classList.contains(H8t)?(this.parent.allowKeyboard&&this.parent.keyboardModule.cardTabIndexRemove(),this.cardClick(e)):i.classList.contains(I8t)?this.columnExpandCollapse(e):i.classList.contains(F8t)&&i.classList.contains(L8t)?this.rowExpandCollapse(e):i.classList.contains(RQt)?this.addButtonClick(i):i.classList.contains(VQt)&&(i=[].slice.call(this.parent.element.querySelectorAll("."+L8t)),t=this.parent.layoutModule.frozenSwimlaneRow.querySelector("."+m8t),this.rowExpandCollapse(e,i[this.parent.layoutModule.frozenOrder]),!!t.classList.contains(O8t)?mt(t,[R8t],[O8t]):mt(t,[O8t],[R8t])))},zQt.prototype.addButtonClick=function(e){var t,i=this,n={};0===this.parent.kanbanData.length?n[this.parent.cardSettings.headerField]=1:"number"==typeof this.parent.kanbanData[0][this.parent.cardSettings.headerField]&&(t=this.parent.kanbanData.map(function(e){return parseInt(e[i.parent.cardSettings.headerField],10)}),n[this.parent.cardSettings.headerField]=Math.max.apply(Math,t)+1),n[this.parent.keyField]=z(e,"."+D8t).getAttribute("data-key"),"Index"===this.parent.sortSettings.sortBy&&(n[this.parent.sortSettings.field]=1,z(e,"."+D8t).querySelector("."+H8t))&&(t="Ascending"===this.parent.sortSettings.direction?(e.nextElementSibling.classList.contains(mQt)?e.nextElementSibling:e).nextElementSibling.lastElementChild:(e.nextElementSibling.classList.contains(mQt)?e.nextElementSibling:e).nextElementSibling.firstElementChild,t=this.parent.getCardDetails(t),n[this.parent.sortSettings.field]=t[this.parent.sortSettings.field]+1),0!==this.parent.kanbanData.length&&this.parent.swimlaneSettings.keyField&&z(e,"."+F8t).previousElementSibling&&(n[this.parent.swimlaneSettings.keyField]=z(e,"."+F8t).previousElementSibling.getAttribute("data-key")),this.parent.openDialog("Add",n)},zQt.prototype.doubleClickHandler=function(e){z(e.target,"."+H8t)&&this.cardDoubleClick(e)},zQt.prototype.cardClick=function(t,e){var i=this,n=z(e||t.target,"."+H8t),e=this.parent.getCardDetails(n);e&&(this.parent.activeCardData={data:e,element:n},this.parent.trigger("cardClick",{data:e,element:n,cancel:!1,event:t},function(e){e.cancel||(n.classList.contains(wQt)&&"click"===t.type?(q([n],wQt),(i.parent.enableVirtualization?i.parent.virtualLayoutModule:i.parent.layoutModule).disableAttributeSelection(n)):(e=t.ctrlKey,i.parent.isAdaptive&&i.parent.touchModule&&(e=i.parent.touchModule.mobilePopup&&i.parent.touchModule.tabHold||e),i.cardSelection(n,e,t.shiftKey)),i.parent.isAdaptive&&i.parent.touchModule&&i.parent.touchModule.updatePopupContent(),e=z(n,"."+D8t),i.parent.allowKeyboard&&([].slice.call(e.querySelectorAll("."+H8t)).forEach(function(e){e.setAttribute("tabindex","0")}),i.parent.keyboardModule.addRemoveTabIndex("Remove")))}))},zQt.prototype.cardDoubleClick=function(e){var t=this,i=z(e.target,"."+H8t),n=this.parent.getCardDetails(i),o=(this.parent.activeCardData={data:n,element:i},this.cardSelection(i,!1,!1),{data:n,element:i,cancel:!1,event:e});this.parent.trigger(RWt,o,function(e){e.cancel||t.parent.dialogModule.openDialog("Edit",o.data)})},zQt.prototype.rowExpandCollapse=function(e,t){var s=this,a=e instanceof HTMLElement?e:e.target,l=je(t)?a:t;this.parent.trigger(BWt,{cancel:!1,target:a,requestType:"rowExpandCollapse"},function(e){var t,i,n,o,r;e.cancel||(t=(e=z(l,"."+L8t)).getAttribute("data-key"),i=s.parent.element.querySelector("."+F8t+":nth-child("+(e.rowIndex+2)+")"),n=e.querySelector("."+R8t+",."+O8t),o=!!e.classList.contains(rQt),r=o?(q([i,e],rQt),mt(n,[R8t],[O8t]),s.parent.swimlaneToggleArray.splice(s.parent.swimlaneToggleArray.indexOf(t),1),"0"):(U([i,e],rQt),mt(n,[O8t],[R8t]),s.parent.swimlaneToggleArray.push(t),"-1"),n.setAttribute("aria-label",o?t+" Expand":t+" Collapse"),e.setAttribute("aria-expanded",o.toString()),i.setAttribute("aria-expanded",o.toString()),[].slice.call(i.querySelectorAll("."+D8t)).forEach(function(e){e.setAttribute("tabindex",r)}),s.parent.notify(jWt,{}),s.parent.trigger(FWt,{target:a,requestType:"rowExpandCollapse"}))})},zQt.prototype.columnExpandCollapse=function(e){var i=this,n=e instanceof HTMLElement?e:e.target;this.parent.trigger(BWt,{cancel:!1,target:n,requestType:"columnExpandCollapse"},function(e){var t;e.cancel||(t=(e=z(n,"."+C8t)).cellIndex,i.columnToggle(e),(e=i.parent.element.querySelectorAll("."+C8t+"."+rQt).length)===i.parent.columns.length-i.hideColumnKeys.length&&(U([e=i.parent.element.querySelector("."+C8t+":not(."+E8t+"):nth-child("+(t+1===e?1:t+2)+")")],rQt),i.columnToggle(e)),i.parent.notify(jWt,{}),i.parent.trigger(FWt,{target:n,requestType:"columnExpandCollapse"}))})},zQt.prototype.columnToggle=function(o){var t=this,i=o.cellIndex,e=[].slice.call(this.parent.element.querySelectorAll(".e-content-row:not(.e-swimlane-row)")),n="."+v8t+" col:nth-child("+(i+1)+")",r=o.querySelector("."+iQt+",."+nQt),n=[].slice.call(this.parent.element.querySelectorAll(n));if(o.classList.contains(rQt)){q(n,rQt),this.parent.isAdaptive&&(this.parent.enableVirtualization?n.forEach(function(e){return e.style.width=T(t.parent.virtualLayoutModule.getWidth())}):n.forEach(function(e){return e.style.width=T(t.parent.layoutModule.getWidth())})),mt(r,[iQt],[nQt]);for(var s=0,a=e;s<a.length;s++)!function(e){var t=e.querySelector("."+D8t+":nth-child("+(i+1)+")");q([t,o],rQt),ue(t.querySelector("."+oQt)),o.setAttribute("aria-expanded","true"),t.setAttribute("aria-expanded","true"),[].slice.call(t.parentElement.querySelectorAll("."+rQt)).forEach(function(e){e=e.querySelector("."+oQt);e.style.height="auto",e&&t.getBoundingClientRect().height<e.getBoundingClientRect().height+10&&(e.style.height=t.getBoundingClientRect().height-4+"px")})}(a[s]);0===this.parent.kanbanData.length&&0===e.length&&(q([o],rQt),o.setAttribute("aria-expanded","true")),this.columnToggleArray.splice(this.columnToggleArray.indexOf(o.getAttribute("data-key")),1),this.parent.columns[i].setProperties({isExpanded:!0},!0),o.querySelector(".e-header-icon").setAttribute("aria-label",o.getAttribute("data-key")+" Expand")}else{U(n,rQt),this.parent.isAdaptive&&n.forEach(function(e){return e.style.width=T(50)}),mt(r,[nQt],[iQt]);for(var l=o.getAttribute("data-key"),h=this,d=0,p=e;d<p.length;d++)!function(e){var t,i=e.querySelector("."+D8t+'[data-key="'+l+'"]'),e=i.cellIndex,n=void 0;n=h.parent.enableVirtualization?(t=h.parent.dataModule.isRemote()?h.parent.columnDataCount[h.parent.columns[e].keyField]:h.parent.virtualLayoutModule.columnData[h.parent.columns[e].keyField].length,(h.parent.columns[e].showItemCount?"["+t+"] ":"")+h.parent.columns[e].headerText):(h.parent.columns[e].showItemCount?"["+i.querySelectorAll("."+H8t).length+"] ":"")+h.parent.columns[e].headerText,i.appendChild(Q("div",{className:oQt,innerHTML:n})),U([i,o],rQt),o.setAttribute("aria-expanded","false"),i.setAttribute("aria-expanded","false"),[].slice.call(i.parentElement.querySelectorAll("."+rQt)).forEach(function(e){e=e.querySelector("."+oQt);e&&i.getBoundingClientRect().height<e.getBoundingClientRect().height+10&&(e.style.height=i.getBoundingClientRect().height-4+"px")})}(p[d]);0===this.parent.kanbanData.length&&0===e.length&&(U([o],rQt),o.setAttribute("aria-expanded","false")),this.columnToggleArray.push(o.getAttribute("data-key")),this.parent.columns[i].setProperties({isExpanded:!1},!0),o.querySelector(".e-header-icon").setAttribute("aria-label",l+" Collapse")}},zQt.prototype.cardSelection=function(e,t,i){var n=this;if(e){var o=this.parent.getSelectedCards();if("None"!==this.parent.cardSettings.selectionType){var r=z(e,"."+F8t),s=(je(this.lastSelectionRow)?r:this.lastSelectionRow).rowIndex;if(s===r.rowIndex||!t&&!i||"Multiple"!==this.parent.cardSettings.selectionType)if(0===o.length||t&&"Single"!==this.parent.cardSettings.selectionType||(q(o,wQt),(this.parent.enableVirtualization?this.parent.virtualLayoutModule:this.parent.layoutModule).disableAttributeSelection(o),o.forEach(function(e){n.selectionArray.splice(n.selectionArray.indexOf(e.getAttribute("data-id")),1),n.selectedCardsElement.splice(n.selectedCardsElement.indexOf(e),1),n.selectedCardsData.splice(n.selectedCardsData.indexOf(n.parent.getCardDetails(e),1))})),0<o.length&&i&&"Multiple"===this.parent.cardSettings.selectionType){var a=[],l=void 0,h=void 0,d=void 0,p=[].slice.call(r.querySelectorAll("."+H8t)),s=(p.forEach(function(e){return a.push(e.getAttribute("data-id"))}),e.getAttribute("data-id")),t=this.lastCard.getAttribute("data-id"),o=h=a.indexOf(s),i=l=a.indexOf(t),c=i<o?"next":"prev";for("prev"==c&&(l=o,h=i),d=l;d<=h;d++){var u=p[d];U([u],wQt),u.setAttribute("aria-selected","true"),u.setAttribute("tabindex","0"),this.selectionArray.push(u.getAttribute("data-id")),this.selectedCardsElement.push(u),this.selectedCardsData.push(this.parent.getCardDetails(u)),this.lastCardSelection=u,"prev"==c&&(this.lastCardSelection=p[l])}}else U([e],wQt),e.setAttribute("aria-selected","true"),e.setAttribute("tabindex","0"),this.selectionArray.push(e.getAttribute("data-id")),this.selectedCardsElement.push(e),this.selectedCardsData.push(this.parent.getCardDetails(e)),this.lastCard=this.lastCardSelection=e,this.lastSelectionRow=z(e,"."+F8t),this.lastSelectionRow.previousElementSibling&&(r=this.lastSelectionRow.previousElementSibling.querySelector(".e-swimlane-row-expand,.e-swimlane-row-collapse"))&&r.classList.contains(O8t)&&this.rowExpandCollapse(r)}}},zQt.prototype.addColumn=function(e,t){e=y(r8t,[this.parent,"columns",e,!0]);this.parent.columns.splice(t,0,e),this.parent.notify(WWt,{processedData:this.parent.kanbanData})},zQt.prototype.deleteColumn=function(e){var t=this.parent.element.querySelectorAll("."+C8t).item(e);t&&t.classList.contains(P8t)&&this.columnToggleArray.splice(this.columnToggleArray.indexOf(t.getAttribute("data-key"),0)),this.parent.columns.splice(e,1),0===this.parent.columns.length?(G(this.parent.element.querySelector("."+b8t)),G(this.parent.element.querySelector("."+M8t))):this.parent.notify(WWt,{processedData:this.parent.kanbanData})},zQt.prototype.showColumn=function(e){e=this.hideColumnKeys.indexOf(e.toString());-1!==e&&(this.hideColumnKeys.splice(e,1),this.parent.notify(WWt,{processedData:this.parent.kanbanData}))},zQt.prototype.hideColumn=function(e){this.hideColumnKeys.push(e.toString()),this.parent.notify(WWt,{processedData:this.parent.kanbanData})},zQt.prototype.SingleCardSelection=function(e){"None"!==this.parent.cardSettings.selectionType&&e[this.parent.cardSettings.headerField]&&(e=this.parent.element.querySelector('.e-card[data-id="'+e[this.parent.cardSettings.headerField].toString()+'"]'))&&(U([e],wQt),e.setAttribute("aria-selected","true"),e.setAttribute("tabindex","0"))},zQt);function zQt(e){this.parent=e,this.columnToggleArray=[],this.selectionArray=[],this.lastCardSelection=null,this.lastSelectionRow=null,this.lastCard=null,this.selectedCardsElement=[],this.selectedCardsData=[],this.hideColumnKeys=[]}WQt.prototype.addCard=function(n,o){var r=this,e={cancel:!1,requestType:"cardCreate",addedRecords:n instanceof Array?n:[n],changedRecords:[],deletedRecords:[]};this.parent.trigger(BWt,e,function(e){var i,t;e.cancel||(i=[],r.parent.sortSettings.field&&"Index"===r.parent.sortSettings.sortBy&&(n instanceof Array?i=n:i.push(n),i.forEach(function(e,t){var i;e[r.parent.sortSettings.field]||(i=r.parent.getColumnData(e[r.parent.keyField]),"Ascending"===r.parent.sortSettings.direction&&0<i.length?e[r.parent.sortSettings.field]=i[i.length-1][r.parent.sortSettings.field]+t+1:"Descending"===r.parent.sortSettings.direction&&0<i.length&&(e[r.parent.sortSettings.field]=i[0][r.parent.sortSettings.field]+t+1),0===i.length&&(e[r.parent.sortSettings.field]=1))}),n instanceof Array||o||"Descending"!==r.parent.sortSettings.direction||r.parent.getColumnData(i[0][r.parent.keyField]).filter(function(e,t){e[r.parent.sortSettings.field]===i[0][r.parent.sortSettings.field]&&(o=t+1)}),0===o||o||"Descending"!==r.parent.sortSettings.direction||(o=0),i=r.priorityOrder(i,o)),e={addedRecords:n instanceof Array?n:[n],changedRecords:r.parent.sortSettings.field&&"Index"===r.parent.sortSettings.sortBy?i:[],deletedRecords:[]},t=n instanceof Array||0<i.length?"batch":"insert",r.parent.dataModule.updateDataManager(t,e,"cardCreated",n,o))})},WQt.prototype.getIndexFromData=function(e){var e=this.parent.element.querySelector('.e-card[data-id="'+e[this.parent.cardSettings.headerField]+'"]'),t=z(e,"."+D8t);return[].slice.call(t.querySelectorAll("."+H8t)).indexOf(e)},WQt.prototype.updateCard=function(i,n,o,r,s,a,l){var h=this,e={requestType:"cardChange",cancel:!1,addedRecords:[],changedRecords:i instanceof Array?i:[i],deletedRecords:[]};n=je(n)?this.getIndexFromData(e.changedRecords[0]):n,this.parent.trigger(BWt,e,function(e){var t;e.cancel||(h.parent.sortSettings.field&&"Index"===h.parent.sortSettings.sortBy&&(e=[],i instanceof Array?e=i:e.push(i),i=h.priorityOrder(e,n)),e={addedRecords:[],changedRecords:i instanceof Array?i:[i],deletedRecords:[]},t=i instanceof Array?"batch":"update",h.parent.dataModule.updateDataManager(t,e,"cardChanged",i,n,o,r,s,a,l))})},WQt.prototype.deleteCard=function(t){var i=this,n={addedRecords:[],changedRecords:[],deletedRecords:[]},e=(n.deletedRecords="string"==typeof t||"number"==typeof t?this.parent.kanbanData.filter(function(e){return e[i.parent.cardSettings.headerField]===t}):t instanceof Array?t:[t],{requestType:"cardRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:n.deletedRecords});this.parent.trigger(BWt,e,function(e){e.cancel||(e=1<n.deletedRecords.length?"batch":"delete",i.parent.dataModule.updateDataManager(e,n,"cardRemoved",n.deletedRecords[0]))})},WQt.prototype.priorityOrder=function(a,l){for(var h,d=this,p=a.map(function(e){return e[d.parent.cardSettings.headerField]}),c=a[a.length-1][this.parent.sortSettings.field],i=a.map(function(e){return e[d.parent.keyField]}),e=i.filter(function(e,t){return i.indexOf(e)===t}).sort(),u=[],g=[],t=function(t){var e=a.filter(function(e){return e[d.parent.keyField]===t});h=(m.parent.enableVirtualization?m.parent.virtualLayoutModule:m.parent.layoutModule).getColumnData(t);for(var i=0,n=e;i<n.length;i++){var o=n[i];m.parent.swimlaneSettings.keyField&&(o=m.parent.getSwimlaneData(o[m.parent.swimlaneSettings.keyField]),h=m.parent.getColumnData(t,o))}if(e.forEach(function(e){return u.push(e)}),!je(l)){for(var r=0;r<p.length;r++)!function(i){h.filter(function(e,t){e[d.parent.cardSettings.headerField]===p[i]&&t<=l&&g.push(t)})}(r);if(0<g.length&&(l+=g.length),"Ascending"===m.parent.sortSettings.direction)for(var s=l;s<h.length;s++)-1===p.indexOf(h[s][m.parent.cardSettings.headerField])&&(h[s][m.parent.sortSettings.field]=++c,u.push(h[s]));else for(s=l-1;0<=s;s--)-1===p.indexOf(h[s][m.parent.cardSettings.headerField])&&(h[s][m.parent.sortSettings.field]=++c,u.push(h[s]))}},m=this,n=0,o=e;n<o.length;n++)t(o[n]);return u};var jQt=WQt;function WQt(e){this.parent=e}UQt.prototype.wireDragEvents=function(e){var t;null!=!this.parent.element&&0===this.parent.externalDropId.length&&(t=this.parent.element.querySelector("."+M8t)),this.dragObj.instance=new hn(e,{clone:!0,enableTapHold:this.parent.isAdaptive,enableTailMode:!0,cursorAt:{top:-10,left:-10},dragArea:t,dragStart:this.dragStart.bind(this),drag:this.drag.bind(this),dragStop:this.dragStop.bind(this),enableAutoScroll:!1,helper:this.dragHelper.bind(this)})},UQt.prototype.dragHelper=function(e){if(this.parent.isAdaptive&&this.parent.touchModule.mobilePopup&&this.parent.touchModule.mobilePopup.element.classList.contains("e-popup-open")&&this.parent.touchModule.mobilePopup.hide(),this.dragObj.element=z(e.sender.target,"."+H8t),je(this.dragObj.element))return null;this.dragObj.element.style.width=T(this.dragObj.element.offsetWidth);e=Q("div",{innerHTML:this.dragObj.element.outerHTML});return this.dragObj.cloneElement=e.children.item(0),U([this.dragObj.cloneElement],pQt),this.dragObj.element.parentElement.appendChild(this.dragObj.cloneElement),this.dragObj.targetCloneMulti=Q("div",{className:vQt}),this.dragObj.targetClone=Q("div",{className:uQt,styles:"width:100%;height:"+T(this.dragObj.element.offsetHeight)}),this.dragObj.modifiedData=[],this.dragObj.cloneElement},UQt.prototype.dragStart=function(t){var i=this,e=(this.dragObj.selectedCards=this.dragObj.element,this.borderElm=this.parent.element.querySelectorAll("."+mQt),this.dragObj.element.classList.contains(wQt)?(e=z(this.dragObj.element,"."+F8t),this.dragObj.selectedCards=[].slice.call(e.querySelectorAll(".e-card.e-selection:not(.e-cloned-card)")),this.dragObj.selectedCards.forEach(function(e){i.dragObj.cardDetails.push(i.parent.getCardDetails(e))})):this.dragObj.cardDetails=[this.parent.getCardDetails(this.dragObj.element)],!je(this.dragObj.selectedCards)&&!je(this.dragObj.selectedCards.length)&&1<=this.dragObj.selectedCards.length?this.dragObj.selectedCards[0].closest(".e-content-cells").classList.add("e-dragged-column"):je(this.dragObj.selectedCards)||je(this.dragObj.selectedCards.closest(".e-content-cells"))||this.dragObj.selectedCards.closest(".e-content-cells").classList.add("e-dragged-column"),{cancel:!1,data:this.dragObj.cardDetails,event:t,element:this.dragObj.selectedCards});this.parent.trigger("dragStart",e,function(e){e.cancel?(i.removeElement(i.dragObj.cloneElement),i.dragObj.instance.intDestroy(t),i.dragObj.element=null,i.dragObj.targetClone=null,i.dragObj.draggedClone=null,i.dragObj.cloneElement=null,i.dragObj.targetCloneMulti=null):(i.dragObj.element.classList.contains(wQt)?(i.dragObj.selectedCards.forEach(function(e){i.draggedClone(e)}),1<i.dragObj.selectedCards.length&&(i.dragObj.cloneElement.innerHTML="",e=Q("div",{className:"e-multi-card-text",innerHTML:i.dragObj.selectedCards.length+" "+i.parent.localeObj.getConstant("cards")}),i.dragObj.cloneElement.appendChild(e),mt(i.dragObj.cloneElement,["e-multi-card-clone"],[wQt]),(i.parent.enableVirtualization?i.parent.virtualLayoutModule:i.parent.layoutModule).disableAttributeSelection(i.dragObj.cloneElement),i.dragObj.cloneElement.style.width="90px")):i.draggedClone(i.dragObj.element),E.add(document.body,"keydown",i.keydownHandler,i),i.parent.notify(jWt,{}))})},UQt.prototype.draggedClone=function(e){this.dragObj.draggedClone=Q("div",{className:dQt,styles:"width:"+T(e.offsetWidth-1)+";height:"+T(e.offsetHeight)}),e.insertAdjacentElement("afterend",this.dragObj.draggedClone),U([e],cQt)},UQt.prototype.drag=function(e){var t=this;if(e.target){var i,n,o=z(e.target,"."+u8t+" ."+H8t),r=(je(o)||!this.parent.enableVirtualization||je(e.target.previousElementSibling)||je(e.target.previousElementSibling.querySelector(".e-target-dropped-clone"))||(o=e.target.previousElementSibling.querySelector(".e-target-dropped-clone").nextElementSibling),e.target),r=(je(e.target.parentElement)||("SPAN"===e.target.nodeName&&e.target.classList.contains("e-empty-card")||"DIV"===e.target.nodeName&&e.target.classList.contains("e-kanban-border")&&this.parent.element.querySelector(".e-target-dropped-clone")!==e.target.nextElementSibling.firstChild)&&(r=e.target.parentElement),o||r),s=z(r,".e-content-row:not(.e-swimlane-row) .e-content-cells.e-droppable");if(r.nextElementSibling&&r.nextElementSibling.lastChild&&(c=r.nextElementSibling.lastChild.previousElementSibling),this.externalDrop(r),this.kanbanObj=this.parent.isExternalKanbanDrop?this.parent.externalDropObj:this.parent,this.calculateArgs(e),s&&"not-allowed"!==document.body.style.cursor){var a=this.getColumnKey(s),l=a.split(","),a=(this.multiCloneRemove(),a===this.getColumnKey(z(this.dragObj.draggedClone,"."+D8t)));if(1===l.length||a)if(r.classList.contains(dQt)&&this.removeElement(this.dragObj.targetClone,this.kanbanObj),r.classList.contains(H8t)||"beforebegin"===this.insertClone){a=r.classList.contains(dQt)&&r.previousElementSibling.classList.contains(cQt)?null:r.previousElementSibling;this.insertClone="afterend",je(a)&&(a=r.classList.contains(dQt)?this.dragObj.pageY/2:this.dragObj.pageY,h=r.classList.contains(dQt)?r.offsetHeight:r.offsetHeight/2,(a-=d=this.kanbanObj.element.getBoundingClientRect().top+window.scrollY)-(r.getBoundingClientRect().top+window.scrollY-d)<h)&&(this.insertClone="beforebegin"),r.classList.contains(H8t)&&(this.parent.enableVirtualization&&(this.insertClone=this.isTargetElementVisible(r)?this.insertClone:"beforebegin"),r.insertAdjacentElement(this.insertClone,this.dragObj.targetClone))}else if(r.classList.contains(D8t)&&!z(r,"."+L8t)){if(0!==r.querySelectorAll("."+cQt).length&&0===r.querySelectorAll(".e-card:not(.e-kanban-dragged-card):not(.e-cloned-card)").length)return;r.querySelector("."+V8t).appendChild(this.dragObj.targetClone)}else!r.classList.contains(V8t)&&!r.classList.contains(_8t)||z(r,"."+L8t)||0!==s.querySelectorAll("."+H8t).length?!(r.classList.contains(mQt)&&!z(r,"."+L8t)&&r.nextElementSibling&&r.nextElementSibling.classList.contains(V8t)&&this.dragObj.targetClone)||c&&c.classList.contains(uQt)||this.parent.enableVirtualization||this.isTargetElementVisible(r.nextElementSibling)||r.nextElementSibling.appendChild(this.dragObj.targetClone):r.appendChild(this.dragObj.targetClone);else 1<l.length&&(s.classList.contains(gQt)||s.firstChild&&s.firstChild.classList.contains(gQt))&&this.multiCloneCreate(l,s);this.kanbanObj.notify(jWt,{})}0===this.kanbanObj.element.querySelectorAll("."+gQt).length&&this.cellDropping();var h,a=!1,d=(s&&(a=s.classList.contains(rQt)&&s.classList.contains(gQt),"true"!==s.getAttribute("aria-expanded")&&s.parentElement.hasAttribute("aria-expanded")||(i=s.getBoundingClientRect(),this.updateDimension(i)),n=s.querySelector("."+mQt)),r&&"TABLE"===r.tagName&&!je(r.querySelector("."+F8t))&&(i=r.querySelector("."+F8t).getBoundingClientRect(),this.updateDimension(i,r)),a&&(this.toggleVisible(r),U([s],fQt)),[].slice.call(this.kanbanObj.element.querySelectorAll("."+fQt))),p=(0<d.length&&!r.classList.contains(fQt)&&!z(r,"."+fQt)&&(this.toggleVisible(r,d.slice(-1)[0]),q(d,fQt)),this.kanbanObj.notify(jWt,{}),z(r,"."+bQt)),c=(p&&0<(h=[].slice.call(this.kanbanObj.element.querySelectorAll("."+bQt+":not(."+Q8t+")")).filter(function(e){return t.getColumnKey(e)===t.getColumnKey(p)})).length&&(U(h,"e-multi-active"),h[0].previousElementSibling)&&U([h[0].previousElementSibling],"e-multi-bottom-border"),document.body.style.cursor=s&&s.classList.contains(gQt)||s&&n&&n.classList.contains(gQt)?"":"not-allowed",!o||z(o,"."+D8t).classList.contains(gQt)||s&&n&&n.classList.contains(gQt)||(o.style.cursor="not-allowed",document.body.style.cursor="not-allowed"),this.isExternalDrop&&"not-allowed"===document.body.style.cursor&&(document.body.style.cursor=""),"not-allowed"===document.body.style.cursor&&(this.removeElement(this.dragObj.targetClone,this.kanbanObj),this.multiCloneRemove()),this.updateScrollPosition(),{data:this.dragObj.cardDetails,event:e,element:this.dragObj.selectedCards});this.kanbanObj.trigger("drag",c),this.parent.isExternalKanbanDrop=!1,this.isExternalDrop=!1}},UQt.prototype.removeElement=function(e,t){0<(t=t||this.parent).element.getElementsByClassName(e.className).length&&ue(e)},UQt.prototype.isTargetElementVisible=function(e){var t=z(e,"."+V8t);return!(!je(t)&&t.getBoundingClientRect().bottom<e.getBoundingClientRect().bottom)},UQt.prototype.externalDrop=function(i){var n=this;this.parent.externalDropId.forEach(function(e){var t=z(i,e);t&&(t.classList.contains("e-kanban")?(n.parent.externalDropObj=document.querySelector(e).ej2_instances[0],n.parent.isExternalKanbanDrop=!0,U([].slice.call(n.parent.externalDropObj.element.querySelectorAll(".e-content-row:not(.e-swimlane-row):not(.e-collapsed) .e-content-cells")),gQt)):n.isExternalDrop=!0)})},UQt.prototype.multiCloneCreate=function(e,t){var i=t.offsetHeight,n=t.querySelector("."+MQt);n&&(i-=n.offsetHeight),this.dragObj.targetCloneMulti.style.height=T(i),t.querySelector("."+RQt)&&U([t.querySelector("."+RQt)],yQt),U([t.querySelector("."+V8t)],yQt),t.querySelector("."+V8t).style.height="auto",t.style.borderStyle="none",this.removeElement(this.dragObj.targetClone);for(var o=0,r=e;o<r.length;o++){var s=r[o],a=z(this.dragObj.draggedClone,"."+D8t),a=this.kanbanObj.columns[a.cellIndex].transitionColumns,a=this.allowedTransition(this.dragObj.element.getAttribute("data-key"),s,a),l=Q("div",{className:bQt+(a?"":" "+Q8t),attrs:{"data-key":s.trim()}}),s=Q("div",{className:"e-text",innerHTML:s.trim()});t.appendChild(this.dragObj.targetCloneMulti).appendChild(l).appendChild(s),l.style.cursor=a?"":"not-allowed",l.style.lineHeight=l.style.height=T(i/e.length),s.style.top=T(i/2-s.offsetHeight/2)}},UQt.prototype.allowedTransition=function(e,t,i){for(var n=!0,o=t.split(","),r=0;r<o.length;r++){if(e===o[r].trim())return!0;if(i){if(1===i.length&&0===i[0].length)return!0;for(var s=0;s<i.length;s++){if(o[r].trim()===i[s].trim())return!0;n=!1}}}return n},UQt.prototype.cellDropping=function(){var e,t=this,i=z(this.dragObj.draggedClone,"."+D8t),n=z(this.dragObj.draggedClone,"."+F8t);i&&i.classList.contains(W8t)&&U([i],gQt),this.addDropping(n,i),this.kanbanObj.swimlaneSettings.keyField&&this.kanbanObj.swimlaneSettings.allowDragAndDrop&&(e=[].slice.call(this.kanbanObj.element.querySelectorAll(".e-content-row:not(.e-swimlane-row):not(.e-collapsed)")),[].slice.call(e).forEach(function(e){n!==e&&t.addDropping(e,i)}))},UQt.prototype.addDropping=function(e,i){var t,n=this;i&&this.borderElm&&0!==this.borderElm.length?(i.classList.contains(gQt)&&q([i],gQt),t=i.getBoundingClientRect(),this.updateDimension(t)):i&&e&&[].slice.call(e.children).forEach(function(e){var t=n.kanbanObj.columns[i.cellIndex].transitionColumns;e!==i&&e.classList.contains(W8t)&&n.allowedTransition(i.getAttribute("data-key"),e.getAttribute("data-key"),t)&&U([e],gQt)})},UQt.prototype.updateDimension=function(i,n){[].slice.call(this.borderElm).forEach(function(e){!e.parentElement||"true"!==e.parentElement.getAttribute("aria-expanded")&&e.parentElement.hasAttribute("aria-expanded")||U([e],gQt);var t=e.previousElementSibling;e.style.height=parseInt(i.height.toString(),10)-(t&&t.classList.contains(RQt)?t.offsetHeight+t.offsetTop:0)+"px",n&&"TABLE"===n.tagName||(e.style.width=parseInt(i.width.toString(),10)+"px"),e.style.left=e.parentElement.getBoundingClientRect().left-z(e,".e-kanban").getBoundingClientRect().left+"px"})},UQt.prototype.keydownHandler=function(e){"Escape"===e.code&&this.dragObj.cloneElement&&(E.remove(this.dragObj.cloneElement,"keydown",this.keydownHandler),this.dragObj.element.removeAttribute("aria-grabbed"),this.dragStopClear(),this.dragStopPostClear())},UQt.prototype.dragStop=function(e){var o,r,s,t,i,a=this,l=z(this.dragObj.targetClone,"."+D8t),e=(this.parent.enableVirtualization&&!je(l)&&l.classList.add("e-dropped-column"),E.remove(document.body,"keydown",this.keydownHandler),[].slice.call(this.borderElm).forEach(function(e){e.classList.remove(gQt)}),this.dragObj.targetClone.parentElement&&(t=(s=this.dragObj.selectedCards&&1<this.dragObj.selectedCards.length&&"Index"===this.parent.sortSettings.sortBy)?".e-card:not(."+pQt+"),."+uQt:".e-card:not(."+cQt+", ."+pQt+"),."+uQt,t=[].slice.call(this.dragObj.targetClone.parentElement.querySelectorAll(t)).indexOf(this.dragObj.targetClone),this.parent.enableVirtualization)&&!je(this.dragObj.targetClone.nextElementSibling)&&(r=this.dragObj.targetClone.nextElementSibling.getAttribute("data-id")),!je(this.kanbanObj)&&this.kanbanObj.element.querySelector("."+vQt)&&(o=z(e.target,"."+bQt+":not(."+Q8t+")")),(l||o)&&(l?i=this.getColumnKey(l):(i=this.getColumnKey(o),l=z(o,"."+D8t)),this.dragObj.selectedCards instanceof HTMLElement?this.updateDroppedData(this.dragObj.selectedCards,i,l):this.dragObj.selectedCards.forEach(function(e){a.updateDroppedData(e,i,l)}),this.parent.sortSettings.field)&&"Index"===this.parent.sortSettings.sortBy&&this.changeOrder(this.dragObj.modifiedData,e.helper),0===this.dragObj.modifiedData.length&&(this.dragObj.modifiedData=this.dragObj.cardDetails),{cancel:!1,data:this.dragObj.modifiedData,event:e,element:this.dragObj.selectedCards,dropIndex:t});this.parent.trigger("dragStop",e,function(e){var t,i,n;a.dragStopClear(),e.cancel||(l||o)&&(t=e.data instanceof Array&&1<e.data.length?e.data:e.data[0],n=i=void 0,a.parent.enableVirtualization&&(i=l.closest(".e-kanban").querySelector(".e-dragged-column").getAttribute("data-key"),n=l.getAttribute("data-key")),a.parent.crudModule.updateCard(t,e.dropIndex,!0,r,i,n,s),a.parent.enableVirtualization)&&(a.parent.virtualLayoutModule.refreshColumnData(i,n),a.parent.virtualLayoutModule.ensureColumnNotEmpty(i)),a.removeEmptyTrElement(),a.dragStopPostClear()})},UQt.prototype.removeEmptyTrElement=function(){if(!this.parent.swimlaneSettings.showEmptyRow)for(var e=this.parent.element.querySelectorAll(".e-content-row.e-swimlane-row"),t=0;t<e.length;t++){var i=e[t].nextElementSibling.querySelectorAll(".e-card-wrapper .e-card");je(e[t].nextElementSibling)||0!==i.length||(G(e[t].nextElementSibling),G(e[t]))}},UQt.prototype.dragStopClear=function(){this.removeElement(this.dragObj.draggedClone),this.removeElement(this.dragObj.targetClone,this.kanbanObj),this.removeElement(this.dragObj.cloneElement),[].slice.call(this.parent.element.querySelectorAll("."+dQt)).forEach(function(e){ue(e)}),this.dragObj.element.style.removeProperty("width"),this.multiCloneRemove(),this.dragObj.selectedCards instanceof HTMLElement?q([this.dragObj.selectedCards],cQt):q(this.dragObj.selectedCards,cQt),clearInterval(this.dragObj.navigationInterval),this.dragObj.navigationInterval=null,"not-allowed"===document.body.style.cursor&&(document.body.style.cursor="");[].slice.call(this.parent.element.querySelectorAll(".e-card[style]")).forEach(function(e){e.style.cursor=""});var e="."+F8t+":not(."+L8t+")";[].slice.call(this.parent.element.querySelectorAll(e+" ."+D8t)).forEach(function(e){return q([e],gQt)}),this.parent.externalDropObj&&[].slice.call(this.parent.externalDropObj.element.querySelectorAll(e+" ."+D8t)).forEach(function(e){return q([e],gQt)})},UQt.prototype.dragStopPostClear=function(){this.parent.isAdaptive&&(this.parent.touchModule.tabHold=!1),this.parent.element.querySelector(".e-dragged-column")&&this.parent.element.querySelector(".e-dragged-column").classList.remove("e-dragged-column"),this.parent.element.querySelector(".e-dropped-column")&&this.parent.element.querySelector(".e-dropped-column").classList.remove("e-dropped-column"),this.dragObj.cardDetails=this.dragObj.modifiedData=[],this.isDragging=!1,this.parent.isExternalKanbanDrop=!1,this.parent.externalDropObj=null},UQt.prototype.updateDroppedData=function(e,t,i){e=Pe({},this.parent.getCardDetails(e),null,!0);1===t.split(",").length&&(e[this.parent.keyField]=t),this.parent.swimlaneSettings.keyField&&this.parent.swimlaneSettings.allowDragAndDrop&&(t=z(i,"."+F8t).previousElementSibling,this.parent.isAdaptive?(i=this.parent.layoutModule.kanbanRows[this.parent.layoutModule.swimlaneIndex].keyField,e[this.parent.swimlaneSettings.keyField]=i):e[this.parent.swimlaneSettings.keyField]=this.getColumnKey(t)),this.dragObj.modifiedData.push(e)},UQt.prototype.changeOrder=function(e,t){var i,n=this,o=!1,t="Ascending"===this.kanbanObj.sortSettings.direction?(t===this.dragObj.targetClone.previousElementSibling&&this.dragObj.targetClone.previousElementSibling&&this.dragObj.targetClone.previousElementSibling.previousElementSibling?this.dragObj.targetClone.previousElementSibling:this.dragObj.targetClone).previousElementSibling:this.dragObj.targetClone.nextElementSibling;if(!t||t.classList.contains(cQt)||t.classList.contains(pQt)||t.classList.contains(dQt))if(this.dragObj.targetClone.nextElementSibling&&"Ascending"===this.kanbanObj.sortSettings.direction)t=this.dragObj.targetClone.nextElementSibling;else{if(!this.dragObj.targetClone.previousElementSibling||"Descending"!==this.kanbanObj.sortSettings.direction)return;t=this.dragObj.targetClone.previousElementSibling}else o=!0;t.classList.contains(H8t)&&(i=this.kanbanObj.getCardDetails(t)[this.kanbanObj.sortSettings.field],(e=1<e.length&&"Descending"===this.kanbanObj.sortSettings.direction?e.reverse():e).forEach(function(e,t){o?e[n.kanbanObj.sortSettings.field]=++i:1!==i&&t<=e[n.kanbanObj.sortSettings.field]?e[n.kanbanObj.sortSettings.field]=--i:1===i&&(e[n.kanbanObj.sortSettings.field]=t+1)}))},UQt.prototype.toggleVisible=function(t,i){var n=this,e=([].slice.call(this.kanbanObj.element.querySelectorAll(".e-header-cells:not(.e-stacked-header-cell)")).forEach(function(e){n.getColumnKey(e)===n.getColumnKey(i||t)&&n.kanbanObj.actionModule.columnToggle(e)}),z(this.dragObj.draggedClone,"."+D8t));e&&(e=T(e.offsetWidth-16),this.dragObj.draggedClone.style.width=e,this.dragObj.cloneElement.style.width=e)},UQt.prototype.multiCloneRemove=function(){var e=je(this.kanbanObj)?[]:[].slice.call(this.kanbanObj.element.querySelectorAll("."+vQt));0<e.length&&([].slice.call(this.kanbanObj.element.querySelectorAll("."+bQt)).forEach(ue),e.forEach(function(e){e=z(e,"."+D8t);e&&(e.style.borderStyle="",e.querySelector("."+RQt)&&q([e.querySelector("."+RQt)],yQt),q([e.querySelector("."+V8t)],yQt))}),this.removeElement(this.dragObj.targetCloneMulti,this.kanbanObj))},UQt.prototype.calculateArgs=function(e){e=this.getPageCoordinates(e);this.dragObj.pageY=e.pageY,this.dragObj.pageX=e.pageX,this.isDragging=!0,this.kanbanObj.isAdaptive&&this.kanbanObj.tooltipModule&&this.kanbanObj.tooltipModule.tooltipObj.close()},UQt.prototype.getPageCoordinates=function(e){var t=e.event;return t&&t.changedTouches?t.changedTouches[0]:e.changedTouches?e.changedTouches[0]:t||e},UQt.prototype.getColumnKey=function(e){return e&&e.getAttribute("data-key")?e.getAttribute("data-key").trim():""},UQt.prototype.updateScrollPosition=function(){var e=this;je(this.dragObj.navigationInterval)&&(this.dragObj.navigationInterval=window.setInterval(function(){e.autoScroll()},100))},UQt.prototype.autoScrollValidation=function(){var e=this.dragObj.pageY,t=this.dragObj.pageX,i={left:!1,right:!1,top:!1,bottom:!1},n=this.kanbanObj.element.querySelector("."+M8t).getBoundingClientRect();e<n.top+30+window.pageYOffset&&e>n.top+window.pageYOffset&&(i.top=!0),e>n.bottom-30+window.pageYOffset&&e<n.bottom+window.pageYOffset&&(i.bottom=!0),t<n.left+30+window.pageXOffset&&t>n.left+window.pageXOffset&&(i.left=!0),t>n.right-30+window.pageXOffset&&t<n.right+window.pageXOffset&&(i.right=!0),this.dragEdges=i},UQt.prototype.autoScroll=function(){this.autoScrollValidation();var e,t,i,n,o;this.kanbanObj.isAdaptive?(this.dragEdges.top||this.dragEdges.bottom?n=this.dragObj.targetClone?z(this.dragObj.targetClone,"."+V8t):z(this.dragObj.draggedClone,"."+V8t):(this.dragEdges.right||this.dragEdges.left)&&(n=this.kanbanObj.element.querySelector("."+M8t)),n&&(e=n.offsetHeight<=n.scrollHeight,o=n.offsetWidth<=n.scrollWidth,t=0<=n.scrollTop&&n.scrollTop+n.offsetHeight<=n.scrollHeight,i=0<=n.scrollLeft&&n.scrollLeft+n.offsetWidth<=n.scrollWidth,e&&t&&(this.dragEdges.top||this.dragEdges.bottom)&&(n.scrollTop+=this.dragEdges.top?-66:30),o)&&i&&(this.dragEdges.left||this.dragEdges.right)&&((this.parent.enableVirtualization?this.kanbanObj.virtualLayoutModule:this.kanbanObj.layoutModule).getWidth()*(this.kanbanObj.columns.length-1)>n.scrollLeft||this.dragEdges.left)&&(n.scrollLeft+=this.dragEdges.left?-30:30)):(e=this.kanbanObj.element.querySelector("."+M8t),t=this.dragObj.targetClone.parentElement,o=e.offsetHeight<=e.scrollHeight,i=e.offsetWidth<=e.scrollWidth,n=o&&0<=e.scrollTop&&e.scrollTop+e.offsetHeight<=e.scrollHeight,o=i&&0<=e.scrollLeft&&e.scrollLeft+e.offsetWidth<=e.scrollWidth,n&&(this.dragEdges.top||this.dragEdges.bottom)&&(e.scrollTop+=this.dragEdges.top?-30:30,this.parent.swimlaneSettings.enableFrozenRows&&(this.dragObj.cloneElement.style.top=this.dragEdges.top?parseInt(this.dragObj.cloneElement.style.top,10)-30+"px":parseInt(this.dragObj.cloneElement.style.top,10)+30+"px"),t)&&(t.scrollTop+=this.dragEdges.top?-30:30),o&&(this.dragEdges.left||this.dragEdges.right)&&(e.scrollLeft+=this.dragEdges.left?-30:30,t)&&(t.scrollLeft+=this.dragEdges.left?-30:30),this.dragObj.pageY-window.scrollY<30?window.scrollTo(window.scrollX,window.scrollY-30):window.innerHeight-(this.dragObj.pageY-window.scrollY)<30&&window.scrollTo(window.scrollX,window.scrollY+30))},UQt.prototype.unWireDragEvents=function(e){je(e)||je(e.ej2_instances[0])||(e=e.ej2_instances[0])&&!e.isDestroyed&&e.destroy()};var QQt=UQt;function UQt(e){this.insertClone="afterend",this.parent=e,this.dragObj={element:null,cloneElement:null,instance:null,targetClone:null,draggedClone:null,targetCloneMulti:null,selectedCards:[],pageX:0,pageY:0,navigationInterval:null,cardDetails:[],modifiedData:[]},this.dragEdges={left:!1,right:!1,top:!1,bottom:!1},this.isDragging=!1,this.isExternalDrop=!1}GQt.prototype.openDialog=function(e,t){this.action=e,this.parent.activeCardData.data=t,this.renderDialog(t,e),this.dialogObj.show()},GQt.prototype.closeDialog=function(){this.dialogObj.hide()},GQt.prototype.renderDialog=function(e,t){this.element=Q("div",{id:this.parent.element.id+"_dialog_wrapper"}),this.parent.element.appendChild(this.element);e={buttons:this.getDialogButtons(t),content:this.getDialogContent(e,t),cssClass:sQt,enableRtl:this.parent.enableRtl,header:this.parent.localeObj.getConstant("Add"===t?"addTitle":"Edit"===t?"editTitle":"deleteTitle"),height:"auto",isModal:!0,showCloseIcon:!0,width:"Delete"===t?400:350,visible:!1,beforeOpen:this.onBeforeDialogOpen.bind(this),beforeClose:this.onBeforeDialogClose.bind(this)};this.dialogObj=new pS(Pe(e,"Delete"!==t&&this.parent.dialogSettings.model||{}),this.element),"Delete"!==t&&this.applyFormValidation(),this.dialogObj.element.querySelector(".e-dlg-closeicon-btn").title=this.parent.localeObj.getConstant("close")},GQt.prototype.getDialogContent=function(e,t){if("Delete"===t)return this.parent.localeObj.getConstant("deleteContent");var t=Q("div",{className:"e-kanban-form-wrapper"}),i=Q("form",{id:this.parent.element.id+"EditForm",className:aQt,attrs:{onsubmit:"return false;"}});if(this.parent.dialogSettings.template){e&&(this.destroyComponents(),[].slice.call(i.childNodes).forEach(ue));var n=this.parent.element.id+"_dialogTemplate";ht(this.parent.templateParser(this.parent.dialogSettings.template)(e,this.parent,"dialogTemplate",n,!1),i),this.parent.renderTemplates()}else{var e=Q("div",{className:"e-kanban-dialog-content"}),o=(i.appendChild(e),Q("table"));e.appendChild(o);for(var r=0,s=this.getDialogFields();r<s.length;r++){var a=s[r],l=Q("tr"),h=(o.appendChild(l),l.appendChild(Q("td",{className:"e-label",innerHTML:a.text||a.key})),Q("td"));l.appendChild(h),h.appendChild(this.renderComponents(a))}}return t.appendChild(i),t},GQt.prototype.getDialogFields=function(){var e=this.parent.dialogSettings.fields;return 0===e.length&&(e=[{text:"ID",key:this.parent.cardSettings.headerField,type:"TextBox"},{key:this.parent.keyField,type:"DropDown"},{key:this.parent.cardSettings.contentField,type:"TextArea"}],this.parent.sortSettings.field&&e.splice(e.length-1,0,{key:this.parent.sortSettings.field,type:"TextBox"}),this.parent.swimlaneSettings.keyField)&&e.splice(e.length-1,0,{key:this.parent.swimlaneSettings.keyField,type:"DropDown"}),e},GQt.prototype.getDialogButtons=function(e){var t="Delete"===e?"e-dialog-no":"e-dialog-cancel",t=[{buttonModel:{cssClass:"e-flat "+("Delete"===e?"e-dialog-yes":"Add"===e?"e-dialog-add":"e-dialog-edit"),isPrimary:!0,content:this.parent.localeObj.getConstant("Add"===e||"Edit"===e?"save":"yes")},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-flat "+t,isPrimary:!1,content:this.parent.localeObj.getConstant("Add"===e||"Edit"===e?"cancel":"no")},click:this.dialogButtonClick.bind(this)}];return"Edit"===e&&(e={buttonModel:{cssClass:"e-flat e-dialog-delete",isPrimary:!1,content:this.parent.localeObj.getConstant("delete")},click:this.dialogButtonClick.bind(this)},t.splice(0,0,e)),t},GQt.prototype.renderComponents=function(e){var t,i,n=Q("div",{className:e.key+"_wrapper"}),o=Q("input",{className:hQt,attrs:{name:e.key}}),r=(n.appendChild(o),this.parent.activeCardData.data?this.parent.activeCardData.data[e.key]:null);switch(e.type){case"DropDown":if(e.key===this.parent.keyField){var s=(this.parent.enableVirtualization?this.parent.virtualLayoutModule:this.parent.layoutModule).columnKeys;if(0<this.parent.actionModule.hideColumnKeys.length){s=[];for(var a=0;a<this.parent.columns.length;a++)(this.parent.enableVirtualization?this.parent.virtualLayoutModule:this.parent.layoutModule).isColumnVisible(this.parent.columns[a])&&(s="number"==typeof this.parent.columns[a].keyField?s.concat(this.parent.columns[a].keyField.toString()):s.concat(this.parent.columns[a].keyField.split(",").map(function(e){return e.trim()})))}t={dataSource:s,value:r&&r.toString()}}else e.key===this.parent.swimlaneSettings.keyField&&(t={dataSource:[].slice.call((this.parent.enableVirtualization?this.parent.virtualLayoutModule:this.parent.layoutModule).kanbanRows),fields:{text:"textField",value:"keyField"},value:r});i=new qz(t);break;case"Numeric":i=new NL({value:r});break;case"TextBox":i=new fV({value:r}),r&&this.parent.cardSettings.headerField===e.key&&(i.enabled=!1);break;case"TextArea":ue(o),t=Q("div"),o=Q("textarea",{className:hQt,attrs:{name:e.key,rows:"3","aria-label":this.parent.cardSettings.contentField},innerHTML:r}),n.appendChild(t).appendChild(o)}return i&&i.appendTo(o),n},GQt.prototype.onBeforeDialogOpen=function(t){var i=this,e={data:this.parent.activeCardData.data,cancel:!1,element:this.element,target:this.parent.activeCardData.element,requestType:this.action};this.storeElement=document.activeElement,parseInt(t.maxHeight,10)<=250&&(t.maxHeight="250px"),this.parent.trigger(HWt,e,function(e){t.cancel=e.cancel,e.cancel&&i.destroy()})},GQt.prototype.onBeforeDialogClose=function(t){var i=this,e=this.getFormElements(),n={};if(t.isInteracted&&(this.preventUpdate=!0),!this.preventUpdate)for(var o=0,r=e;o<r.length;o++){var s=r[o],a=s.name||this.getColumnName(s);je(a)||""===a||(s=this.getValueFromElement(s),a===this.parent.cardSettings.headerField&&(s="string"===this.getIDType()?s:parseInt(s,10)),n[a]=s)}this.preventUpdate=!1;var l={data:n=Pe(this.parent.activeCardData.data,n),cancel:!1,element:this.element,requestType:this.action};this.parent.trigger(zWt,l,function(e){t.cancel=e.cancel,e.cancel||(i.cardData=l.data,i.destroy(),i.parent.actionModule.SingleCardSelection(i.cardData))})},GQt.prototype.getIDType=function(){return 0!==this.parent.kanbanData.length?typeof this.parent.kanbanData[0][this.parent.cardSettings.headerField]:"string"},GQt.prototype.applyFormValidation=function(){for(var n=this,e=this.element.querySelector("."+aQt),t={},i=0,o=this.parent.dialogSettings.fields;i<o.length;i++){var r=o[i];t[r.key]=r.validationRules&&0<Object.keys(r.validationRules).length?r.validationRules:null}this.formObj=new nN(e,{rules:t,customPlacement:function(e,t){var i=t.getAttribute("for");n.element.querySelector("#"+i+"_Error")||n.createTooltip(e,t,i,"")},validationComplete:function(e){var t=n.element.querySelector("#"+e.inputName+"_Error");t&&(t.style.display="failure"===e.status?"":"none")}})},GQt.prototype.createTooltip=function(e,t,i,n){var o,e=e.parentElement.getBoundingClientRect(),r=(this.element.classList.contains(sQt)?(o=this.element,this.element):o=this.element.querySelector(".e-kanban-dialog .e-dlg-content")).getBoundingClientRect(),i=Q("div",{className:"e-tooltip-wrap e-popup "+lQt,id:i+"_Error",styles:"display:"+n+";top:"+(e.bottom-r.top+o.scrollTop+9)+"px;left:"+(e.left-r.left+o.scrollLeft+e.width/2)+"px;"}),n=Q("div",{className:"e-tip-content"}),r=(n.appendChild(t),Q("div",{className:"e-arrow-tip e-tip-top"}));r.appendChild(Q("div",{className:"e-arrow-tip-outer e-tip-top"})),r.appendChild(Q("div",{className:"e-arrow-tip-inner e-tip-top"})),i.appendChild(n),i.appendChild(r),o.appendChild(i),i.style.left=parseInt(i.style.left,10)-i.offsetWidth/2+"px"},GQt.prototype.destroyToolTip=function(){this.element&&this.element.querySelectorAll("."+lQt).forEach(ue),this.formObj&&this.formObj.element&&this.formObj.reset()},GQt.prototype.dialogButtonClick=function(e){var t,i=e.target.cloneNode(!0),e=(je(e.keyCode)||13!==e.keyCode||(i=this.dialogObj.element.querySelector(".e-footer-content button.e-primary").cloneNode(!0)),this.formObj.element.id);document.getElementById(e)&&this.formObj.validate()&&(i.classList.contains("e-dialog-edit")||i.classList.contains("e-dialog-add"))&&(this.dialogObj.hide(),je(this.cardData)||(i.classList.contains("e-dialog-edit")&&(e=void 0,(t=this.parent.activeCardData).data[this.parent.keyField]===this.cardData[this.parent.keyField]&&t.element&&(e=[].slice.call(t.element.parentElement.children).indexOf(t.element)),this.parent.enableHtmlSanitizer&&"string"==typeof this.cardData[this.parent.cardSettings.contentField]&&(this.cardData[this.parent.cardSettings.contentField]=go.sanitize(this.cardData[this.parent.cardSettings.contentField])),this.parent.crudModule.updateCard(this.cardData,e)),i.classList.contains("e-dialog-add")&&this.parent.crudModule.addCard(this.cardData),this.parent.actionModule.SingleCardSelection(this.cardData),this.cardData=null)),i.classList.contains("e-dialog-edit")||i.classList.contains("e-dialog-add")||(i.classList.contains("e-dialog-cancel")&&(this.preventUpdate=!0),this.dialogObj.hide(),i.classList.contains("e-dialog-yes")?this.parent.crudModule.deleteCard(this.parent.activeCardData.data):i.classList.contains("e-dialog-no")?this.openDialog("Edit",this.parent.activeCardData.data):i.classList.contains("e-dialog-delete")&&this.openDialog("Delete",this.parent.activeCardData.data))},GQt.prototype.getFormElements=function(){for(var e=[],t=0,i=[].slice.call(this.element.querySelectorAll("."+hQt));t<i.length;t++){var n=i[t];!n.classList.contains("e-control")&&n.querySelector(".e-control")?e.push(n.querySelector(".e-control")):e.push(n)}return e},GQt.prototype.getColumnName=function(e){var t,i,n=e.getAttribute("data-name")||"";return n=""===n&&(i=!1,t="",e.classList.contains("e-dropdownlist")||e.classList.contains("e-multiselect")?(t=e.classList.contains("e-dropdownlist")?"e-ddl":"e-multiselect",i=!0):e.classList.contains("e-numerictextbox")&&(t="e-numeric"),i=z(e,i?"."+t+":not(.e-control)":"."+t)||e.querySelector("."+t))&&(e=i.querySelector("[name]"))?e.name:n},GQt.prototype.getValueFromElement=function(e){e=e.classList.contains("e-dropdownlist")||e.classList.contains("e-multiselect")?e.ej2_instances[0].value:e.classList.contains("e-checkbox")?e.ej2_instances[0].checked:"checkbox"===e.type?e.checked:e.value;return e},GQt.prototype.destroyComponents=function(){for(var e=0,t=this.getFormElements();e<t.length;e++){var i=t[e].ej2_instances;i&&0<i.length&&i.forEach(function(e){return e.destroy()}),this.parent.isReact&&this.formObj&&this.formObj.element.remove()}},GQt.prototype.destroy=function(){this.destroyToolTip(),this.destroyComponents(),this.dialogObj&&(this.dialogObj.destroy(),this.storeElement.focus(),this.dialogObj=null,ue(this.element),this.element=null)};var qQt=GQt;function GQt(e){this.preventUpdate=!1,this.parent=e}XQt.prototype.keyActionHandler=function(e){var t=this,i=this.parent.element.querySelectorAll(".e-card."+wQt).item(0);if(i||z(document.activeElement,"."+u8t)){var n,o=[];switch(e.action){case"upArrow":case"downArrow":case"multiSelectionByUpArrow":case"multiSelectionByDownArrow":e.preventDefault(),this.processUpDownArrow(e.action,i);break;case"rightArrow":case"leftArrow":this.processLeftRightArrow(e);break;case"firstCardSelection":case"lastCardSelection":this.processCardSelection(e.action,i);break;case"multiSelectionEnter":case"multiSelectionSpace":document.activeElement&&this.parent.actionModule.cardSelection(document.activeElement,!0,!1);break;case"space":case"enter":this.processEnter(e,i);break;case"escape":(document.activeElement.classList.contains(H8t)||document.activeElement.classList.contains(RQt))&&(document.activeElement.classList.contains(wQt)?(q([document.activeElement],wQt),document.activeElement.focus()):(n=z(document.activeElement,"."+D8t),q([].slice.call(n.querySelectorAll("."+H8t)),wQt),n.focus(),this.cardTabIndexRemove(),this.addRemoveTabIndex("Add")));break;case"tab":case"shiftTab":n=z(document.activeElement,"."+D8t),document.activeElement.classList.contains(H8t)&&(document.activeElement.nextElementSibling||"tab"!==e.action||e.preventDefault(),!document.activeElement.previousElementSibling)&&n.querySelector("."+RQt)&&"tab"===e.action&&U([n.querySelector("."+RQt)],NQt),!document.activeElement.classList.contains(RQt)||(n.querySelector("."+H8t)||"tab"!==e.action)&&"shiftTab"!==e.action||e.preventDefault(),document.activeElement.classList.contains(u8t)&&(this.cardTabIndexRemove(),this.parent.keyboardModule.addRemoveTabIndex("Add"));break;case"delete":[].slice.call(this.parent.element.querySelectorAll(".e-card."+wQt)).forEach(function(e){o.push(t.parent.getCardDetails(e))}),this.parent.crudModule.deleteCard(o)}}},XQt.prototype.processCardSelection=function(e,t){t&&(q([t],wQt),(this.parent.enableVirtualization?this.parent.virtualLayoutModule:this.parent.layoutModule).disableAttributeSelection(t),(i=this.parent.actionModule.selectionArray).splice(i.indexOf(t.getAttribute("data-id")),1)),this.cardTabIndexRemove();var i=[].slice.call(this.parent.element.querySelectorAll("."+H8t)),t="firstCardSelection"===e?i[0]:i[i.length-1];this.parent.actionModule.cardSelection(t,!1,!1),this.addRemoveTabIndex("Remove"),t.focus(),[].slice.call(z(t,"."+D8t).querySelectorAll("."+H8t)).forEach(function(e){e.setAttribute("tabindex","0")})},XQt.prototype.processLeftRightArrow=function(e){document.activeElement.classList.contains(D8t)&&("rightArrow"===e.action&&document.activeElement.nextElementSibling?document.activeElement.nextElementSibling.focus():"leftArrow"===e.action&&document.activeElement.previousElementSibling&&document.activeElement.previousElementSibling.focus())},XQt.prototype.processUpDownArrow=function(e,t){var i;"upArrow"===e&&document.activeElement?(document.activeElement.classList.contains(H8t)&&document.activeElement.previousElementSibling?document.activeElement.previousElementSibling.focus():document.activeElement.classList.contains(RQt)&&(document.activeElement.setAttribute("tabindex","-1"),q([document.activeElement],NQt),0<(i=z(document.activeElement,"."+D8t)).querySelectorAll("."+H8t).length)&&[].slice.call(i.querySelectorAll("."+H8t)).slice(-1)[0].focus(),this.removeSelection()):"downArrow"===e&&document.activeElement&&document.activeElement.classList.contains(H8t)&&(document.activeElement.nextElementSibling?document.activeElement.nextElementSibling.focus():z(document.activeElement,"."+V8t).nextElementSibling&&((i=z(document.activeElement,"."+V8t).nextElementSibling).setAttribute("tabindex","0"),U([i],NQt),i.focus()),this.removeSelection()),("multiSelectionByUpArrow"===e||"multiSelectionByDownArrow"===e)&&t&&"Multiple"===this.parent.cardSettings.selectionType&&(i=void 0,i="multiSelectionByUpArrow"===e?document.activeElement.previousElementSibling:document.activeElement.nextElementSibling)&&(this.parent.actionModule.cardSelection(i,!1,!0),i.focus(),this.multiSelection=!0)},XQt.prototype.removeSelection=function(){var e;this.multiSelection&&(0<(e=this.parent.getSelectedCards()).length&&(q(e,wQt),(this.parent.enableVirtualization?this.parent.virtualLayoutModule:this.parent.layoutModule).disableAttributeSelection(e)),this.multiSelection=!1)},XQt.prototype.cardTabIndexRemove=function(){[].slice.call(this.parent.element.querySelectorAll("."+H8t)).forEach(function(e){e.setAttribute("tabindex","-1")}),[].slice.call(this.parent.element.querySelectorAll("."+RQt)).forEach(function(e){e.setAttribute("tabindex","-1"),q([e],NQt)})},XQt.prototype.processEnter=function(e,t){"space"===e.action&&e.preventDefault();var i=e.target;i.classList.contains(I8t)&&this.parent.actionModule.columnExpandCollapse(e),(i.classList.contains(R8t)||i.classList.contains(O8t))&&this.parent.actionModule.rowExpandCollapse(e),document.activeElement.classList.contains(H8t)&&this.parent.actionModule.cardSelection(document.activeElement,!1,!1),document.activeElement.classList.contains(RQt)&&(this.parent.dialogModule.dialogObj||this.parent.actionModule.addButtonClick(document.activeElement),document.activeElement.focus()),i.classList.contains(D8t)&&(e=[].slice.call(i.querySelectorAll("."+H8t)),this.addRemoveTabIndex("Remove"),0<e.length&&(i.querySelector("."+H8t).focus(),e.forEach(function(e){e.setAttribute("tabindex","0")})),i.querySelector("."+RQt))&&(i.querySelector("."+RQt).setAttribute("tabindex","0"),i.querySelector("."+RQt).focus()),t===document.activeElement&&1===this.parent.element.querySelectorAll("."+wQt).length&&(this.parent.activeCardData={data:this.parent.getCardDetails(t),element:t},this.parent.dialogModule.dialogObj||this.parent.dialogModule.openDialog("Edit",this.parent.getCardDetails(t)),t.focus())},XQt.prototype.addRemoveTabIndex=function(e){var t="Add"===e?"0":"-1",e=[].slice.call(this.parent.element.querySelectorAll("."+I8t)),e=(0<e.length&&e.forEach(function(e){e.setAttribute("tabindex",t)}),[].slice.call(this.parent.element.querySelectorAll("."+R8t)));0<e.length&&e.forEach(function(e){e.setAttribute("tabindex",t)});[].slice.call(this.parent.element.querySelectorAll(".e-content-row:not(.e-swimlane-row) .e-content-cells")).forEach(function(e){e.setAttribute("tabindex",t)})},XQt.prototype.destroy=function(){this.keyboardModule.destroy()};var YQt=XQt;function XQt(e){this.keyConfigs={firstCardSelection:"36",lastCardSelection:"35",upArrow:"38",downArrow:"40",rightArrow:"39",leftArrow:"37",multiSelectionEnter:"ctrl+13",multiSelectionSpace:"ctrl+32",multiSelectionByUpArrow:"shift+38",multiSelectionByDownArrow:"shift+40",shiftTab:"shift+tab",enter:"13",tab:"tab",delete:"46",escape:"27",space:"32"},this.parent=e,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.keyboardModule=new bn(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.multiSelection=!1}JQt.prototype.renderTooltip=function(){this.tooltipObj=new NS({cssClass:this.parent.cssClass+" e-kanban-tooltip",enableRtl:this.parent.enableRtl,mouseTrail:!this.parent.isAdaptive,offsetY:5,position:"BottomCenter",showTipPointer:!0,target:"."+CQt,beforeRender:this.onBeforeRender.bind(this),beforeClose:this.onBeforeClose.bind(this)}),this.tooltipObj.appendTo(this.parent.element),this.tooltipObj.isStringTemplate=!0},JQt.prototype.onBeforeRender=function(e){var t,i,n;this.parent.dragAndDropModule.isDragging?e.cancel=!0:(this.parent.tooltipTemplate?(t=Q("div"),i=z(e.target,"."+H8t),i=this.parent.getCardDetails(i),n=this.parent.element.id+"_tooltipTemplate",ht(this.parent.templateParser(this.parent.tooltipTemplate)(i,this.parent,"tooltipTemplate",n,!1),t),this.parent.renderTemplates()):t=ao(function(){return'<div class="e-card-header-caption">'+e.target.innerText+"</div>"}),this.tooltipObj.setProperties({content:t},!0))},JQt.prototype.onBeforeClose=function(){this.parent.resetTemplates(["tooltipTemplate"])},JQt.prototype.destroy=function(){this.tooltipObj.destroy(),U([this.parent.element],"e-control"),this.tooltipObj=null};var KQt=JQt;function JQt(e){this.parent=e,this.renderTooltip()}$Qt.prototype.wireTouchEvents=function(){this.element=this.parent.element.querySelector("."+M8t),this.touchObj=new Mn(this.element,{tapHold:this.tapHoldHandler.bind(this)})},$Qt.prototype.tapHoldHandler=function(e){this.tabHold=!0;e=z(e.originalEvent.target,"."+H8t);e&&"Multiple"===this.parent.cardSettings.selectionType&&(this.parent.actionModule.cardSelection(e,!0,!1),this.mobilePopup||(this.renderMobilePopup(),this.mobilePopup.show()),this.updatePopupContent())},$Qt.prototype.renderMobilePopup=function(){var e,t;"Multiple"===this.parent.cardSettings.selectionType&&(e=Q("div",{className:"e-mobile-popup-wrapper e-popup-close",innerHTML:'<div class="e-popup-header"><button class="e-close"></button></div><div class="'+LQt+'"></div>'}),document.body.appendChild(e),U([e],g8t),this.mobilePopup=new Sv(e,{targetType:"container",enableRtl:this.parent.enableRtl,hideAnimation:{name:"ZoomOut"},showAnimation:{name:"ZoomIn"},collision:{X:"fit",Y:"fit"},position:{X:"left",Y:"top"},viewPortElement:document.body,zIndex:1004,close:this.popupClose.bind(this)}),e=this.mobilePopup.element.querySelector(".e-close"),(t=new zv({cssClass:"e-flat e-round e-small",enableRtl:this.parent.enableRtl,iconCss:m8t+" e-close-icon"})).appendTo(e),t.isStringTemplate=!0,E.add(e,"click",this.closeClick,this))},$Qt.prototype.getPopupContent=function(){var e,t=this.parent.getSelectedCards();return 1<t.length?e="("+t.length+") "+this.parent.localeObj.getConstant("cardsSelected"):1===t.length&&(e=" "+this.parent.getCardDetails(t[0])[this.parent.cardSettings.headerField]),e},$Qt.prototype.updatePopupContent=function(){var e;this.mobilePopup&&((e=this.getPopupContent())?this.mobilePopup.element.querySelector("."+LQt).textContent=e:this.mobilePopup.hide())},$Qt.prototype.closeClick=function(){this.parent.touchModule.mobilePopup.hide()},$Qt.prototype.popupClose=function(){this.popupDestroy()},$Qt.prototype.popupDestroy=function(){var e;this.mobilePopup&&this.mobilePopup.element&&((e=this.mobilePopup.element.querySelector(".e-control.e-btn").ej2_instances[0])&&e.destroy(),this.mobilePopup.destroy(),ue(this.mobilePopup.element),this.mobilePopup=null)},$Qt.prototype.unWireTouchEvents=function(){this.touchObj&&this.touchObj.destroy(),this.touchObj=null,this.element=null},$Qt.prototype.destroy=function(){this.popupDestroy(),this.unWireTouchEvents(),this.tabHold=!1};var ZQt=$Qt;function $Qt(e){this.parent=e,this.tabHold=!1}e6t.prototype.renderSwimlaneHeader=function(){var e=Q("div",{className:SQt,innerHTML:'<div class="'+AQt+'"><div class="e-toolbar-menu"><div class="e-icons '+xQt+'"></div></div><div class="e-toolbar-level-title"><div class="'+IQt+'"></div></div></div>'});this.parent.element.appendChild(e),E.add(e.querySelector("."+xQt),"click",this.menuClick,this)},e6t.prototype.renderSwimlaneTree=function(){var e=this.parent.element.querySelector("."+SQt).offsetHeight,t=window.innerHeight-e,e=(this.popupOverlay=Q("div",{className:TQt,styles:"height: "+t+"px;"}),Q("div",{className:EQt,styles:"top:"+e+"px;"})),t=Q("div",{className:DQt+" e-popup-close",styles:"height: "+t+"px;"}),e=(e.appendChild(t),e.appendChild(this.popupOverlay),this.parent.element.appendChild(e),Q("div",{className:"e-swimlane-tree"})),i=(t.appendChild(e),(this.parent.enableVirtualization?this.parent.virtualLayoutModule:this.parent.layoutModule).kanbanRows),i=(this.treeViewObj=new PW({cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,fields:{dataSource:i,id:"keyField",text:"textField"},nodeTemplate:this.parent.swimlaneSettings.template,nodeClicked:this.treeSwimlaneClick.bind(this),drawNode:this.drawNode.bind(this)}),this.treeViewObj.appendTo(e),{targetType:"relative",actionOnScroll:"none",enableRtl:this.parent.enableRtl,zIndex:10,hideAnimation:{name:"SlideLeftOut",duration:500},showAnimation:{name:"SlideLeftIn",duration:500},viewPortElement:this.parent.element.querySelector("."+M8t)});i.content=this.treeViewObj.element,this.treePopup=new Sv(t,i)},e6t.prototype.menuClick=function(){var e;(this.parent.element.querySelector("."+DQt).classList.contains("e-popup-open")?(this.treePopup.hide(),q):(q(e=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item")),"e-active"),U([e[this.parent.layoutModule.swimlaneIndex]],"e-active"),this.treePopup.show(),U))([this.popupOverlay],"e-enable")},e6t.prototype.treeSwimlaneClick=function(e){this.treePopup.hide();var t=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item"));this.parent.layoutModule.swimlaneIndex=t.indexOf(e.node),this.parent.layoutModule.scrollLeft=0,this.parent.notify(WWt,{processedData:this.parent.kanbanData}),e.event.preventDefault()},e6t.prototype.hidePopup=function(){this.treePopup.hide(),q([this.popupOverlay],"e-enable")},e6t.prototype.getWidth=function(){return 80*window.innerWidth/100},e6t.prototype.drawNode=function(e){var t;this.parent.swimlaneSettings.template&&this.parent.isReact&&(t=this.parent.element.id+"_treeviewTemplate",ht(this.parent.templateParser(this.parent.swimlaneSettings.template)(e.nodeData,this.parent,"nodeTemplate",t,!1),e.node.querySelector(".e-list-text")))};s6=e6t;function e6t(e){this.parent=e}t6t=function(e,t){return(t6t=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}t6t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(o6t,i6t=s6),o6t.prototype.initRender=function(){var e;0!==this.parent.columns.length&&(this.columnData=this.getColumnCards(),this.kanbanRows=this.getRows(),this.swimlaneData=this.getSwimlaneCards(),this.parent.isAdaptive&&(e=this.parent.element.querySelector("."+M8t))&&(this.scrollLeft=e.scrollLeft),this.destroy(),this.parent.on(WWt,this.initRender,this),this.parent.on(jWt,this.scrollUiUpdate,this),this.parent.isAdaptive&&this.parent.swimlaneSettings.keyField&&0!==this.parent.kanbanData.length&&this.renderSwimlaneHeader(),e=Q("div",{className:b8t}),this.parent.element.appendChild(e),this.renderHeader(e),this.renderContent(),this.renderCards(),this.renderValidation(),this.parent.renderTemplates(),this.parent.notify(jWt,{}),this.wireEvents(),this.parent.isInitialRender)&&(this.parent.isInitialRender=!1)},o6t.prototype.renderHeader=function(e){for(var t=Q("div",{className:this.parent.swimlaneSettings.keyField?y8t:""}),e=(e.appendChild(t),Q("table",{className:v8t+" "+w8t})),t=(t.appendChild(e),this.renderColGroup(e),Q("thead")),i=Q("tbody",{className:"e-hide",innerHTML:"<tr><td></td></tr>",attrs:{role:"rowgroup"}}),l=(e.appendChild(i),e.appendChild(t),0<this.parent.stackedHeaders.length&&t.appendChild(this.createStackedRow(this.parent.stackedHeaders)),Q("tr",{className:B8t})),h=(t.appendChild(l),this),n=0,o=this.parent.columns;n<o.length;n++)!function(e){var t,i,n,o,r,s,a;h.isColumnVisible(e)&&(t=h.parent.actionModule.columnToggleArray.indexOf(e.keyField.toString()),i=Q("th",{className:-1===t?C8t:C8t+" "+rQt,attrs:{"data-role":"kanban-column","data-key":e.keyField.toString(),scope:"col"}}),n=[],e.allowToggle&&(n.push(P8t),e.isExpanded||n.push(rQt)),U([i],n),n=Q("div",{className:S8t}),i.appendChild(n),h.columnData=h.getColumnCards(h.parent.kanbanData),o=h.columnData[e.keyField].length,s=Q("div",{className:A8t}),n.appendChild(s),e.template?(r={keyField:e.keyField,headerText:e.headerText,minCount:e.minCount,maxCount:e.maxCount,allowToggle:e.allowToggle,isExpanded:e.isExpanded,showItemCount:e.showItemCount,count:o},U([i],f8t),a=h.parent.element.id+"_columnTemplate",ht(h.parent.templateParser(e.template)(r,h.parent,"columnTemplate",a,!1),s)):(r=Q("div",{className:x8t,innerHTML:e.headerText}),s.appendChild(r),e.showItemCount&&(a=Q("div",{className:N8t,innerHTML:"- "+o.toString()+" "+h.parent.localeObj.getConstant("items")}),s.appendChild(a))),e.allowToggle&&(r=!(!e.isExpanded||-1!==t),(s=Q("div",{className:I8t+" "+m8t+" "+(r?iQt:nQt),attrs:{tabindex:"0",role:"button"}})).setAttribute("aria-label",r?e.keyField+" Expand":e.keyField+" Collapse"),i.setAttribute("aria-expanded",r.toString()),n.appendChild(s)),a=[{keyField:e.keyField,textField:e.headerText,count:o}],h.parent.trigger(NWt,{data:a,element:l,cancel:!1,requestType:"headerRow"},function(e){e.cancel||l.appendChild(i)}))}(o[n])},o6t.prototype.renderContent=function(){for(var e=Q("div",{className:M8t}),t=(this.parent.element.appendChild(e),Q("div",{className:this.parent.swimlaneSettings.keyField?y8t:""})),e=(e.appendChild(t),Q("table",{className:v8t+" "+k8t,attrs:{role:"presentation"}})),i=(t.appendChild(e),this.renderColGroup(e),Q("thead",{className:"e-hide",attrs:{role:"none"}})),n=0,o=this.parent.columns;n<o.length;n++){var r=o[n],r=Q("th",{id:r.keyField,innerHTML:r.keyField,attrs:{scope:"col"}});r.style.display="none",i.appendChild(r)}e.appendChild(i);var s=Q("tbody",{attrs:{role:"treegrid","aria-label":"Kanban Content"}}),a=(e.appendChild(s),!1);this.swimlaneRow=this.kanbanRows,this.initializeSwimlaneTree();for(var l=0,h=this.swimlaneRow;l<h.length;l++){var d=h[l];this.parent.swimlaneSettings.keyField&&0!==this.parent.swimlaneToggleArray.length&&(a=-1!==this.parent.swimlaneToggleArray.indexOf(d.keyField)),this.parent.swimlaneSettings.keyField&&!this.parent.isAdaptive&&this.renderSwimlaneRow(s,d,a),this.renderSingleContent(s,d,a)}},o6t.prototype.renderSingleContent=function(t,e,i){for(var n=Q("tr",{className:i?F8t+" "+rQt:F8t,attrs:{role:"row","aria-label":e.keyField+"row content"}}),o=0,r=this.parent.columns;o<r.length;o++){var s,a,l=r[o];this.isColumnVisible(l)&&(s=Q("td",{className:(-1===(a=this.parent.actionModule.columnToggleArray.indexOf(l.keyField.toString()))?D8t:D8t+" "+rQt)+((l.allowDrag?" "+j8t:"")+(l.allowDrop?" e-drop "+z8t:"")),attrs:{"data-role":"kanban-column","data-key":l.keyField.toString(),tabindex:"0","aria-describedby":l.keyField.toString(),role:"gridcell"}}),(l.allowToggle&&!l.isExpanded||-1!==a)&&(U([s],rQt),a=(l.showItemCount?"["+this.getColumnData(l.keyField,this.swimlaneData[e.keyField]).length+"] ":"")+l.headerText,s.appendChild(Q("div",{className:oQt,innerHTML:a})),s.setAttribute("aria-expanded","false")),l.showAddButton&&((a=Q("div",{className:RQt,attrs:{tabindex:"-1"}})).appendChild(Q("div",{className:OQt+" "+m8t})),s.appendChild(a)),n.appendChild(s))}i=[{keyField:e.keyField,textField:e.textField,count:e.count}];this.parent.trigger(NWt,{data:i,element:n,cancel:!1,requestType:"contentRow"},function(e){e.cancel||(t.classList.contains("e-swimlane-row")?t.insertAdjacentElement("beforebegin",n):t.appendChild(n))})},o6t.prototype.initializeSwimlaneTree=function(){var e,t,i,n;this.parent.swimlaneSettings.keyField&&this.parent.isAdaptive&&0!==this.parent.kanbanData.length&&(n=this.parent.element.querySelector("."+IQt),this.swimlaneRow=[this.kanbanRows[this.swimlaneIndex]],this.renderSwimlaneTree(),this.parent.swimlaneSettings.template?(e=this.swimlaneData[this.swimlaneRow[0].keyField].length,i=Pe({},this.swimlaneRow[0],{count:e},!0),i=this.parent.templateParser(this.parent.swimlaneSettings.template)(i,this.parent,"swimlaneTemplate","",!1),n.appendChild(i[0])):(n.innerHTML=this.swimlaneRow[0].textField,this.parent.swimlaneSettings.showItemCount&&(e=this.swimlaneData[this.swimlaneRow[0].keyField].length,n=i=void 0,je(t=this.parent.element.querySelector("."+AQt))||(i=Q("div",{className:"e-toolbar-swimlane-item-count"}),n=Q("div",{className:N8t}),i.appendChild(n),t.appendChild(i)),n.innerHTML="- "+e+" "+this.parent.localeObj.getConstant("items"))))},o6t.prototype.renderSwimlaneRow=function(t,e,i){var n=Q("tr",{className:"e-content-row e-swimlane-row"+(i?" "+rQt:""),attrs:{"aria-label":e.keyField+" row header",role:"row","data-key":e.keyField,"aria-expanded":(!i).toString()}}),o=this.parent.columns.length-this.parent.actionModule.hideColumnKeys.length,o=Q("td",{className:D8t,attrs:{"data-role":"kanban-column",role:"gridcell",colspan:o.toString()}}),r=Q("div",{className:SQt});o.appendChild(r);var s,i=Q("div",{className:m8t+" "+(i?O8t:R8t),attrs:{tabindex:"0",role:"button","aria-label":i?e.keyField+" Collapse":e.keyField+" Expand"}}),i=(r.appendChild(i),Q("div",{className:S8t})),a=(r.appendChild(i),this.swimlaneData[e.keyField].length),l=(this.parent.swimlaneSettings.template?(l=Pe({},e,{count:a},!0),U([o],f8t),s=this.parent.element.id+"_swimlaneTemplate",ht(this.parent.templateParser(this.parent.swimlaneSettings.template)(l,this.parent,"swimlaneTemplate",s,!1),i)):i.appendChild(Q("div",{className:"e-swimlane-text",innerHTML:e.textField,attrs:{"data-role":e.textField}})),this.parent.swimlaneSettings.showItemCount&&r.appendChild(Q("div",{className:N8t,innerHTML:"- "+a.toString()+" "+this.parent.localeObj.getConstant("items")})),n.appendChild(o),[{keyField:e.keyField,textField:e.textField,count:e.count}]);this.parent.trigger(NWt,{data:l,element:n,cancel:!1,requestType:"swimlaneRow"},function(e){e.cancel||(t.classList.contains("e-swimlane-row")?t.insertAdjacentElement("beforebegin",n):t.appendChild(n))})},o6t.prototype.renderCards=function(){var h=this,d=this.swimlaneRow,e=[].slice.call(this.parent.element.querySelectorAll(".e-content-row:not(.e-swimlane-row)")),n=[].slice.call(this.parent.element.querySelectorAll(".e-content-row.e-swimlane-row")),o=[],p=!1;e.forEach(function(s,a){for(var l=0,e=function(e){if(h.isColumnVisible(e)){var t=h.parent.swimlaneSettings.keyField?h.getColumnData(e.keyField,h.parent.swimlaneSettings.showEmptyRow&&je(h.swimlaneData[d[a].keyField])?[]:h.swimlaneData[d[a].keyField]):h.columnData[e.keyField],i=(l+=t.length,s.querySelector('[data-key="'+e.keyField+'"]')),n=Q("div",{className:V8t,attrs:{role:"listbox",tabindex:"0","aria-label":e.keyField.toString()}});if(!(p=0<e.transitionColumns.length?!0:p)&&je(h.parent.swimlaneSettings.keyField)&&(e=Q("div",{className:mQt}),i.appendChild(e)),i.appendChild(n),0<t.length)for(var o=0,r=t;o<r.length;o++)!function(e){var t=e[h.parent.cardSettings.headerField],t=h.parent.actionModule.selectionArray.indexOf(t),i=h.renderCard(e),t=(-1!==t&&(i.setAttribute("aria-selected","true"),U([i],wQt)),{data:e,element:i,cancel:!1});h.parent.trigger(OWt,t,function(e){e.cancel||n.appendChild(i)})}(r[o]);else n.appendChild(h.renderEmptyCard())}},t=0,i=h.parent.columns;t<i.length;t++)e(i[t]);0===l&&(o.push(s),0<n.length)&&o.push(n[a])}),this.parent.swimlaneSettings.showEmptyRow||0!==this.parent.kanbanData.length||this.parent.showEmptyColumn||o.forEach(ue)},o6t.prototype.renderCard=function(e){var t=Q("div",{className:H8t,attrs:{"data-id":e[this.parent.cardSettings.headerField],"data-key":e[this.parent.keyField],"aria-selected":"false",tabindex:"-1",role:"option","aria-roledescription":"Card"}});if("auto"!==this.parent.cardHeight&&(t.style.height=T(this.parent.cardHeight)),this.parent.cardSettings.template){U([t],f8t);var i=this.parent.element.id+"_cardTemplate";ht(this.parent.templateParser(this.parent.cardSettings.template)(e,this.parent,"cardTemplate",i,!1),t)}else{var n,o,i=this.parent.enableTooltip?" "+CQt:"",r=(this.parent.cardSettings.showHeader&&(n=Q("div",{className:U8t}),r=Q("div",{className:G8t}),o=Q("div",{className:Y8t+i,innerHTML:e[this.parent.cardSettings.headerField]||""}),n.appendChild(r),r.appendChild(o),t.appendChild(n)),Q("div",{className:q8t+i,innerHTML:e[this.parent.cardSettings.contentField]||""}));if(t.appendChild(r),this.parent.cardSettings.tagsField&&e[this.parent.cardSettings.tagsField]){for(var s=Q("div",{className:X8t}),a=0,l=e[this.parent.cardSettings.tagsField].toString().split(",");a<l.length;a++){var h=l[a];s.appendChild(Q("div",{className:K8t+" "+Z8t,innerHTML:h}))}t.appendChild(s)}if(this.parent.cardSettings.grabberField&&e[this.parent.cardSettings.grabberField]&&(U([t],J8t),t.style.borderLeftColor=e[this.parent.cardSettings.grabberField]),this.parent.cardSettings.footerCssField){for(var d=Q("div",{className:$8t}),p=0,c=e[this.parent.cardSettings.footerCssField].split(",");p<c.length;p++){var u=c[p];d.appendChild(Q("div",{className:u.trim()+" "+tQt}))}t.appendChild(d)}}return t},o6t.prototype.renderEmptyCard=function(){return Q("span",{className:eQt,innerHTML:this.parent.localeObj.getConstant("noCard"),attrs:{"aria-label":this.parent.localeObj.getConstant("noCard"),role:"option"}})},o6t.prototype.renderColGroup=function(e){var n=this,o=Q("colgroup");this.parent.columns.forEach(function(e){var t,i;n.isColumnVisible(e)&&(i=n.parent.actionModule.columnToggleArray.indexOf(e.keyField.toString()),t=e.allowToggle&&!e.isExpanded,i=Q("col",{className:-1!==i||t?rQt:"",attrs:{"data-key":e.keyField.toString()}}),n.parent.isAdaptive&&(e=T(t?50:n.getWidth()),i.style.width=e),o.appendChild(i))}),e.appendChild(o)},o6t.prototype.getRows=function(){var n=this,o=[];return this.parent.swimlaneSettings.keyField&&(this.parent.kanbanData.map(function(e){if(n.parent.swimlaneSettings.showEmptyRow||!(je(e[n.parent.keyField])||""===e[n.parent.keyField]||e[n.parent.keyField]&&-1===n.columnKeys.indexOf(e[n.parent.keyField].toString()))){var t=e[n.parent.swimlaneSettings.textField]||e[n.parent.swimlaneSettings.keyField],i=e[n.parent.swimlaneSettings.keyField];if(!e[n.parent.swimlaneSettings.keyField]){if(!n.parent.swimlaneSettings.showUnassignedRow)return;t=n.parent.localeObj.getConstant("unassigned"),i=""}o.push({keyField:i,textField:t})}}),o=o.filter(function(e,t,i){return t===i.map(function(e){return e.keyField}).indexOf(e.keyField)}),(o=this.swimlaneSorting(o)).forEach(function(t){t.count=n.parent.kanbanData.filter(function(e){return-1<n.columnKeys.indexOf(e[n.parent.keyField])&&e[n.parent.swimlaneSettings.keyField]===t.keyField}).length}),0!==o.length)||o.push({keyField:"",textField:""}),o},o6t.prototype.swimlaneSorting=function(e){return this.parent.swimlaneSettings.sortComparer?e=this.parent.swimlaneSettings.sortComparer.call(this.parent,e):(e.sort(function(e,t){return e.textField.localeCompare(t.textField,void 0,{numeric:!0})}),"Descending"===this.parent.swimlaneSettings.sortDirection&&e.reverse()),e},o6t.prototype.createStackedRow=function(r){var e=Q("tr",{className:B8t+" "+T8t}),s=[];this.parent.columns.forEach(function(e){for(var t="",i=0,n=r;i<n.length;i++){var o=n[i];-1!==o.keyFields.indexOf(e.keyField.toString())&&(t=o.text)}s.push(t)});for(var t=0;t<s.length;t++){for(var i=1,n=t+1;n<s.length&&(""!==s[t]&&""!==s[n]&&s[t]===s[n]);n++)i++;var o=Q("div",{className:x8t,innerHTML:s[t]}),a=Q("th",{className:C8t+" "+E8t,attrs:{colspan:i.toString(),scope:"col"}});e.appendChild(a).appendChild(o),t+=i-1}return e},o6t.prototype.scrollUiUpdate=function(){var e,i=this,t=this.parent.element.querySelector("."+b8t),n=this.parent.element.querySelector("."+M8t),o=this.parent.element.offsetHeight-t.offsetHeight;this.parent.isAdaptive&&(o=window.innerHeight-(t.offsetHeight+25),(e=this.parent.element.querySelector("."+SQt))&&(o-=e.offsetHeight),[].slice.call(this.parent.element.querySelectorAll("."+D8t)).forEach(function(e){var t=e.querySelector("."+V8t);t.classList.contains(yQt)||(t.style.height=T(o),E.add(e,"touchmove",i.onAdaptiveScroll,i))})),"auto"!==this.parent.height&&"100%"!==this.parent.height&&(n.style.height=T(o)),[].slice.call(t.children).forEach(function(e){var t=0;0<n.offsetWidth-n.clientWidth&&(t=17,0<n.offsetHeight-n.clientHeight)&&(e.style.width=T(n.clientWidth)),i.parent.enableRtl?e.style.paddingLeft=T(t):e.style.paddingRight=T(t)}),this.updateScrollPosition()},o6t.prototype.onContentScroll=function(e){var t=e.target,i=this.parent.element.querySelector("."+b8t);[].slice.call(i.children).forEach(function(e){e.scrollLeft=t.scrollLeft}),this.parent.scrollPosition.content={left:t.scrollLeft,top:t.scrollTop},!je(this.parent.swimlaneSettings.keyField)&&this.parent.swimlaneSettings.enableFrozenRows&&this.frozenRows(e)},o6t.prototype.addFrozenSwimlaneDataKey=function(e){e=e.getAttribute("data-key");je(e)||this.frozenSwimlaneRow.setAttribute("data-key",e)},o6t.prototype.frozenRows=function(e){var t,i,n,o,r,s=this.parent.element.querySelector("."+L8t),a=this.parent.element.querySelector("."+b8t),l=this.parent.element.querySelector("."+M8t);je(this.frozenSwimlaneRow)?(this.frozenSwimlaneRow=Q("div",{className:VQt}),t=Q("div",{className:_Qt}),this.frozenSwimlaneRow.appendChild(t),this.parent.element.insertBefore(this.frozenSwimlaneRow,this.parent.element.firstElementChild),t.appendChild(s.querySelector("."+SQt).cloneNode(!0)),this.addFrozenSwimlaneDataKey(s),gt(this.frozenSwimlaneRow,{height:T(s.getBoundingClientRect().height),width:T(l.querySelector(".e-swimlane").getBoundingClientRect().width),top:T(a.getBoundingClientRect().height.toString())}),gt(a,{position:"relative",top:T(-this.frozenSwimlaneRow.getBoundingClientRect().height)}),gt(l,{position:"relative",top:T(-this.frozenSwimlaneRow.getBoundingClientRect().height)})):(s=(t=[].slice.call(this.parent.element.querySelectorAll("."+L8t)))[this.frozenOrder],a=t[this.frozenOrder-1],i=t[this.frozenOrder+1],r=o=n=void 0,s&&(n=s.getBoundingClientRect().top+s.getBoundingClientRect().height),a&&(o=a.getBoundingClientRect().top+a.getBoundingClientRect().height),i&&(r=i.getBoundingClientRect().top+i.getBoundingClientRect().height),s=l.getBoundingClientRect().top+this.frozenSwimlaneRow.getBoundingClientRect().height,l=this.frozenSwimlaneRow.querySelector("."+_Qt),r&&r<=s&&this.frozenOrder<t.length-1?(l&&(ue(l.querySelector("."+SQt)),l.appendChild(i.querySelector("."+SQt).cloneNode(!0)),this.addFrozenSwimlaneDataKey(i)),++this.frozenOrder):o&&s<n&&o<s&&0<this.frozenOrder&&(l&&(ue(l.querySelector("."+SQt)),l.appendChild(a.querySelector("."+SQt).cloneNode(!0)),this.addFrozenSwimlaneDataKey(a)),--this.frozenOrder)),e&&0===e.target.scrollTop&&this.removeFrozenRows()},o6t.prototype.removeFrozenRows=function(){ue(this.frozenSwimlaneRow),this.frozenSwimlaneRow=null;var e=this.parent.element.querySelector("."+b8t),t=this.parent.element.querySelector("."+M8t);gt(e,{position:"",top:""}),gt(t,{position:"",top:""}),this.parent.scrollPosition.content={left:this.parent.scrollPosition.content.left,top:0},t.scrollTop=0,this.frozenOrder=0},o6t.prototype.onColumnScroll=function(e){var t,e=e.target;e.offsetParent&&(t=e.offsetParent.getAttribute("data-key"),this.parent.scrollPosition.column[""+t]={left:e.scrollLeft,top:e.scrollTop})},o6t.prototype.onAdaptiveScroll=function(e){this.parent.touchModule.tabHold&&!this.parent.touchModule.mobilePopup&&e.preventDefault()},o6t.prototype.isColumnVisible=function(e){var t=this,i=!1;return"number"==typeof e.keyField?i=-1===this.parent.actionModule.hideColumnKeys.indexOf(e.keyField.toString()):e.keyField.split(",").forEach(function(e){i=-1===t.parent.actionModule.hideColumnKeys.indexOf(e)}),i},o6t.prototype.renderLimits=function(e,t){var i=Q("div",{className:MQt});e.minCount&&i.appendChild(Q("div",{className:PQt,innerHTML:this.parent.localeObj.getConstant("min")+": "+e.minCount.toString()})),e.maxCount&&i.appendChild(Q("div",{className:kQt,innerHTML:this.parent.localeObj.getConstant("max")+": "+e.maxCount.toString()})),0<i.childElementCount&&(t.querySelector("."+V8t)?t.insertBefore(i,t.firstElementChild):t.appendChild(i))},o6t.prototype.renderValidation=function(){var s=this;this.parent.columns.forEach(function(n){var o,e,r,t;(n.minCount||n.maxCount)&&(o=s.columnData[n.keyField],t='[data-key="'+n.keyField+'"]',e=s.parent.element.querySelector("."+C8t+t),r=[].slice.call(s.parent.element.querySelectorAll("."+D8t+t)),"Swimlane"===s.parent.constraintType&&s.parent.swimlaneSettings.keyField?s.swimlaneRow.forEach(function(t,e){s.renderLimits(n,r[e]);var i=o.filter(function(e){return e[s.parent.swimlaneSettings.keyField]===t.keyField}),i=s.getValidationClass(n,i.length);i&&U([r[e]],i)}):(s.renderLimits(n,e),(t=s.getValidationClass(n,o.length))&&U(r.concat(e),t)))})},o6t.prototype.getValidationClass=function(e,t){var i;return e.maxCount&&t>e.maxCount?i=BQt:e.minCount&&t<e.minCount&&(i=FQt),i},o6t.prototype.refreshValidation=function(){[].slice.call(this.parent.element.querySelectorAll("."+MQt)).forEach(function(e){ue(e)});q([].slice.call(this.parent.element.querySelectorAll("."+FQt)),FQt);var e=[].slice.call(this.parent.element.querySelectorAll("."+BQt));q(e,BQt),this.renderValidation()},o6t.prototype.getColumnData=function(t,i){var n=this,o=(void 0===i&&(i=this.parent.kanbanData),[]);if("number"==typeof t)var e=i.filter(function(e){return e[n.parent.keyField]===t}),o=o.concat(e);else for(var r=0,s=t.split(",");r<s.length;r++)!function(t){var e=i.filter(function(e){return e[n.parent.keyField]===t.trim()});o=o.concat(e)}(s[r]);return this.sortCategory(o),o},o6t.prototype.sortCategory=function(e){var t=this.parent.cardSettings.headerField,i=this.parent.sortSettings.direction;switch(this.parent.sortSettings.sortBy){case"DataSourceOrder":this.sortOrder(t,i,e);break;case"Custom":case"Index":this.parent.sortSettings.field&&(t=this.parent.sortSettings.field),this.sortOrder(t,i,e)}return e},o6t.prototype.sortOrder=function(i,e,t){var n,o,r=!0;return!(r=0<this.parent.kanbanData.length?"number"==typeof this.parent.kanbanData[0][""+i]:r)&&"Index"===this.parent.sortSettings.sortBy||(t=t.sort(function(e,t){return(o=r?(n=e[""+i],t[""+i]):(n=e[""+i]?e[""+i].toLowerCase():"",t[""+i]?t[""+i].toLowerCase():""))<n?1:n<o?-1:0}),"Descending"!==e)||t.reverse(),t},o6t.prototype.documentClick=function(e){e.target.classList.contains(TQt)&&this.parent.element.querySelector("."+DQt).classList.contains("e-popup-open")&&(this.treePopup.hide(),q([this.popupOverlay],"e-enable")),z(e.target,"."+u8t)||(q(e=[].slice.call(this.parent.element.querySelectorAll(".e-card."+wQt)),wQt),this.disableAttributeSelection(e))},o6t.prototype.disableAttributeSelection=function(e){e instanceof Element?e.setAttribute("aria-selected","false"):e.forEach(function(e){e.setAttribute("aria-selected","false")})},o6t.prototype.getColumnCards=function(i){var n=this,o={};return this.columnKeys=[],this.parent.columns.forEach(function(e){var t="number"==typeof e.keyField,t=(n.columnKeys=t?n.columnKeys.concat(e.keyField.toString()):n.columnKeys.concat(e.keyField.split(",").map(function(e){return e.trim()})),n.getColumnData(e.keyField,i));o[e.keyField]=t}),o},o6t.prototype.getSwimlaneCards=function(){var i=this,e={};return this.parent.swimlaneSettings.keyField&&this.kanbanRows.forEach(function(t){return e[t.keyField]=i.parent.kanbanData.filter(function(e){return!je(e[i.parent.keyField])&&-1<i.columnKeys.indexOf(e[i.parent.keyField].toString())&&(!e[i.parent.swimlaneSettings.keyField]&&i.parent.swimlaneSettings.showUnassignedRow?"":e[i.parent.swimlaneSettings.keyField])===t.keyField})}),e},o6t.prototype.refreshHeaders=function(){var e=this.parent.element.querySelector("."+b8t);[].slice.call(e.children).forEach(ue),this.renderHeader(e)},o6t.prototype.refreshCards=function(){this.parent.resetTemplates(["cardTemplate"]),[].slice.call(this.parent.element.querySelectorAll("."+V8t)).forEach(ue),this.renderCards(),this.wireDragEvent(),this.parent.renderTemplates()},o6t.prototype.refresh=function(){var s=this,a=!1;this.parent.columns.forEach(function(e){if(e.showItemCount){e&&e.template&&!a&&(s.refreshHeaders(),a=!0);var t="."+C8t+'[data-key="'+e.keyField+'"] .'+N8t,t=s.parent.element.querySelector(t);if(t){var i=0;if("number"==typeof e.keyField)i=[].slice.call(s.parent.element.querySelectorAll('.e-card[data-key="'+e.keyField+'"]')).length;else for(var n=0,o=e.keyField.split(",");n<o.length;n++)var r=o[n],i=[].slice.call(s.parent.element.querySelectorAll('.e-card[data-key="'+r.trim()+'"]')).length+i;t.innerHTML="- "+i+" "+s.parent.localeObj.getConstant("items")}}}),this.parent.swimlaneSettings.keyField&&[].slice.call(this.parent.element.querySelectorAll("."+L8t)).forEach(function(e){var t=e.getAttribute("data-key"),i=e.querySelector("."+N8t);i&&t&&(t=[].slice.call(e.nextElementSibling.querySelectorAll("."+H8t)),i.innerHTML="- "+t.length+" "+s.parent.localeObj.getConstant("items"))}),this.refreshValidation()},o6t.prototype.updateScrollPosition=function(){var i=this,e=this.parent.element.querySelector("."+M8t);e&&(F.isIE?(e.scrollTop=this.parent.scrollPosition.content.top,e.scrollLeft=this.parent.scrollPosition.content.left):e.scrollTo(this.parent.scrollPosition.content.left,this.parent.scrollPosition.content.top)),[].slice.call(this.parent.element.querySelectorAll("."+V8t)).forEach(function(e){var t;e.offsetParent&&(t=i.parent.scrollPosition.column[e.offsetParent.getAttribute("data-key")])&&(F.isIE?(e.scrollTop=t.top,e.scrollLeft=t.left):e.scrollTo(t.left,t.top))})},o6t.prototype.renderCardBasedOnIndex=function(t,i){var e,n,o,r,s,a,l,h=this,d=t[this.parent.keyField],p=this.parent.element.querySelector(".e-content-row:not(.e-swimlane-row)");this.parent.swimlaneSettings.keyField&&!this.parent.isAdaptive&&(e='.e-content-row.e-swimlane-row[data-key="'+t[this.parent.swimlaneSettings.keyField]+'"]',this.parent.element.querySelector(e)?p=this.parent.element.querySelector(e).nextElementSibling:(-1!==this.columnKeys.indexOf(d)&&-1===this.parent.actionModule.hideColumnKeys.indexOf(d)&&(a=this.kanbanRows.findIndex(function(e){return e.keyField===t[h.parent.swimlaneSettings.keyField]}),o=[].slice.call(this.parent.element.querySelectorAll(".e-swimlane-row")),r=this.parent.element.querySelector("."+k8t+" tbody"),o[a]&&(r=o[a]),this.renderSwimlaneRow(r,this.kanbanRows[a],!1),this.renderSingleContent(r,this.kanbanRows[a],!1)),p=this.parent.element.querySelector(e).nextElementSibling,[].slice.call(p.children).forEach(function(e){var t=Q("div",{className:V8t});e.appendChild(t),t.appendChild(h.renderEmptyCard())}))),"Index"!==this.parent.sortSettings.sortBy?(n=this.parent.cardSettings.headerField,"Custom"===this.parent.sortSettings.sortBy&&(n=this.parent.sortSettings.field),i=je(this.parent.swimlaneSettings.keyField)?this.getColumnData(d,this.parent.kanbanData).findIndex(function(e){return e[""+n]===t[""+n]}):(o=this.parent.getSwimlaneData(t[this.parent.swimlaneSettings.keyField]),this.getColumnData(d,o).findIndex(function(e){return e[""+n]===t[""+n]}))):"Index"===this.parent.sortSettings.sortBy&&this.parent.sortSettings.field&&"Ascending"===this.parent.sortSettings.direction&&(i=t[this.parent.sortSettings.field]-1),p&&(r=[].slice.call(p.children).filter(function(e){return-1!==e.getAttribute("data-key").replace(/\s/g,"").split(",").indexOf(d.toString().replace(/\s/g,""))})[0],(a=(s=r.querySelector("."+V8t)).querySelector("."+eQt))&&ue(a),l=this.renderCard(t),this.parent.allowDragAndDrop&&r.classList.contains(j8t)&&(this.parent.dragAndDropModule.wireDragEvents(l),U([l],z8t)),this.parent.trigger(OWt,{data:t,element:l,cancel:!1},function(e){e.cancel||(je(i)||0===s.children.length?s.appendChild(l):s.insertBefore(l,s.childNodes[i]))}))},o6t.prototype.removeCard=function(e){var t,e=e[this.parent.cardSettings.headerField],e=this.parent.element.querySelector('.e-card[data-id="'+e+'"]');e&&(this.isSelectedCard=!!e.classList.contains(wQt),t=e.parentElement,ue(e),0===t.querySelectorAll(".e-card:not(."+pQt+")").length)&&t.appendChild(this.renderEmptyCard())},o6t.prototype.wireEvents=function(){var t=this,e=(E.add(this.parent.element,"click",this.parent.actionModule.clickHandler,this.parent.actionModule),E.add(this.parent.element,"dblclick",this.parent.actionModule.doubleClickHandler,this.parent.actionModule),E.add(document,F.touchStartEvent,this.documentClick,this),this.parent.element.querySelector("."+M8t));E.add(e,"scroll",this.onContentScroll,this),[].slice.call(this.parent.element.querySelectorAll("."+V8t)).forEach(function(e){t.parent.isInitialRender&&e.offsetParent&&(t.parent.scrollPosition.column[e.offsetParent.getAttribute("data-key")]={left:0,top:0}),E.add(e,"scroll",t.onColumnScroll,t)}),this.parent.isAdaptive&&(this.parent.touchModule.wireTouchEvents(),e.scrollLeft=this.scrollLeft),this.wireDragEvent()},o6t.prototype.unWireEvents=function(){var t=this,e=(E.remove(this.parent.element,"click",this.parent.actionModule.clickHandler),E.remove(this.parent.element,"dblclick",this.parent.actionModule.doubleClickHandler),E.remove(document,F.touchStartEvent,this.documentClick),this.parent.element.querySelector("."+M8t)),e=(e&&(E.remove(e,"scroll",this.onContentScroll),this.parent.allowDragAndDrop)&&this.unWireDragEvent(),[].slice.call(this.parent.element.querySelectorAll("."+V8t)));0<e.length&&e.forEach(function(e){E.remove(e,"scroll",t.onColumnScroll)}),this.parent.isAdaptive&&this.parent.touchModule.unWireTouchEvents()},o6t.prototype.wireDragEvent=function(){var e,t=this;this.parent.allowDragAndDrop&&(U(e=[].slice.call(this.parent.element.querySelectorAll("."+D8t+"."+j8t+" ."+H8t)),z8t),e.forEach(function(e){return t.parent.dragAndDropModule.wireDragEvents(e)}))},o6t.prototype.unWireDragEvent=function(){var t=this,e=[].slice.call(this.parent.element.querySelectorAll("."+D8t+"."+j8t+" ."+H8t));q(e,z8t),e.forEach(function(e){return t.parent.dragAndDropModule.unWireDragEvents(e)})},o6t.prototype.destroy=function(){this.parent.resetTemplates(),this.parent.off(WWt,this.initRender),this.parent.off(jWt,this.scrollUiUpdate),this.unWireEvents();var e=this.parent.element.querySelector("."+b8t),e=(e&&ue(e),this.parent.element.querySelector("."+M8t)),e=(e&&ue(e),this.treeViewObj&&(this.treeViewObj.destroy(),this.treeViewObj=null),this.treePopup&&(this.treePopup.destroy(),this.treePopup=null),this.parent.element.querySelector("."+SQt)),e=(e&&ue(e),this.parent.element.querySelector("."+EQt)),e=(e&&ue(e),this.parent.element.querySelector("."+VQt));e&&(ue(e),this.frozenSwimlaneRow=null)};var t6t,i6t,n6t=o6t;function o6t(e){var t=i6t.call(this,e)||this;return t.kanbanRows=[],t.parent=e,t.columnKeys=[],t.swimlaneIndex=0,t.swimlaneData={},t.scrollLeft=0,t.frozenOrder=0,t.parent.on(WWt,t.initRender,t),t.parent.on(jWt,t.scrollUiUpdate,t),t}r6t=function(e,t){return(r6t=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}r6t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(l6t,s6t=s6),l6t.prototype.initRender=function(){var e;this.isSwimlane=!je(this.parent.swimlaneSettings.keyField)&&1<this.parent.swimlaneSettings.keyField.trim().length,this.query=this.parent.query instanceof ya?this.parent.query:new ya,0!==this.parent.columns.length&&(this.cardHeight=this.cardHeightCalculate(),this.columnData=this.getColumnCards(),this.kanbanRows=this.getRows(),this.parent.isAdaptive&&(e=this.parent.element.querySelector("."+M8t))&&(this.scrollLeft=e.scrollLeft),this.destroy(),this.parent.on(WWt,this.initRender,this),this.parent.on(jWt,this.scrollUiUpdate,this),e=Q("div",{className:b8t}),this.parent.element.appendChild(e),this.renderHeader(e),this.isSwimlane||(this.renderContent(),this.renderCards()),this.renderValidation(),this.parent.renderTemplates(),this.parent.notify(jWt,{}),this.wireEvents(),this.parent.isInitialRender)&&(this.parent.isInitialRender=!1)},l6t.prototype.cardHeightCalculate=function(){var e="auto"===this.parent.cardHeight?108:parseInt(T(this.parent.cardHeight).split("px")[0],10)+8;return e},l6t.prototype.renderHeader=function(e){for(var t=Q("div",{className:this.parent.swimlaneSettings.keyField?y8t:""}),e=(e.appendChild(t),Q("table",{className:v8t+" "+w8t,attrs:{role:"presentation"}})),t=(t.appendChild(e),this.renderColGroup(e),Q("thead")),l=(e.appendChild(t),0<this.parent.stackedHeaders.length&&t.appendChild(this.createStackedRow(this.parent.stackedHeaders)),Q("tr",{className:B8t})),h=(t.appendChild(l),this),i=0,n=this.parent.columns;i<n.length;i++)!function(e){var t,i,n,o,r,s,a;h.isColumnVisible(e)&&(t=h.parent.actionModule.columnToggleArray.indexOf(e.keyField.toString()),i=Q("th",{className:-1===t?C8t:C8t+" "+rQt,attrs:{"data-role":"kanban-column","data-key":e.keyField.toString()}}),n=[],e.allowToggle&&(n.push(P8t),e.isExpanded||n.push(rQt)),U([i],n),n=Q("div",{className:S8t}),i.appendChild(n),o=h.parent.dataModule.isRemote()?h.parent.columnDataCount[e.keyField]:h.columnData[e.keyField].length,s=Q("div",{className:A8t}),n.appendChild(s),e.template?(r={keyField:e.keyField,headerText:e.headerText,minCount:e.minCount,maxCount:e.maxCount,allowToggle:e.allowToggle,isExpanded:e.isExpanded,showItemCount:e.showItemCount,count:o},U([i],f8t),a=h.parent.element.id+"_columnTemplate",ht(h.parent.templateParser(e.template)(r,h.parent,"columnTemplate",a,!1),s)):(r=Q("div",{className:x8t,innerHTML:e.headerText}),s.appendChild(r),e.showItemCount&&(a=Q("div",{className:N8t,innerHTML:"- "+o.toString()+" "+h.parent.localeObj.getConstant("items")}),s.appendChild(a))),e.allowToggle&&(r=!(!e.isExpanded||-1!==t),(s=Q("div",{className:I8t+" "+m8t+" "+(r?iQt:nQt),attrs:{tabindex:"0"}})).setAttribute("aria-label",r?e.keyField+" Expand":e.keyField+" Collapse"),i.setAttribute("aria-expanded",r.toString()),n.appendChild(s)),a=[{keyField:e.keyField,textField:e.headerText,count:o}],h.parent.trigger(NWt,{data:a,element:l,cancel:!1,requestType:"headerRow"},function(e){e.cancel||l.appendChild(i)}))}(n[i])},l6t.prototype.renderContent=function(){for(var e=Q("div",{className:M8t}),t=(this.parent.element.appendChild(e),Q("div",{className:this.parent.swimlaneSettings.keyField?y8t:""})),e=(e.appendChild(t),Q("table",{className:v8t+" "+k8t,attrs:{role:"presentation"}})),i=(t.appendChild(e),this.renderColGroup(e),Q("tbody")),n=(e.appendChild(i),!1),o=0,r=this.kanbanRows;o<r.length;o++){var s=r[o];this.parent.swimlaneSettings.keyField&&0!==this.parent.swimlaneToggleArray.length&&(n=-1!==this.parent.swimlaneToggleArray.indexOf(s.keyField)),this.renderSingleContent(i,s,n)}},l6t.prototype.renderSingleContent=function(t,e,i){for(var n=Q("tr",{className:i?F8t+" "+rQt:F8t,attrs:{"aria-expanded":"true"}}),o=0,r=this.parent.columns;o<r.length;o++){var s,a,l=r[o];this.isColumnVisible(l)&&(s=Q("td",{className:(-1===(a=this.parent.actionModule.columnToggleArray.indexOf(l.keyField.toString()))?D8t:D8t+" "+rQt)+((l.allowDrag?" "+j8t:"")+(l.allowDrop?" e-drop "+z8t:"")),attrs:{"data-role":"kanban-column","data-key":l.keyField.toString(),"aria-expanded":"true",tabindex:"0",role:"navigation"}}),(l.allowToggle&&!l.isExpanded||-1!==a)&&(U([s],rQt),a=(l.showItemCount?"["+(this.parent.dataModule.isRemote()?this.parent.columnDataCount[l.keyField]:this.getColumnData(l.keyField).length)+"] ":"")+l.headerText,s.appendChild(Q("div",{className:oQt,innerHTML:a})),s.setAttribute("aria-expanded","false")),l.showAddButton&&((a=Q("div",{className:RQt,attrs:{tabindex:"-1"}})).appendChild(Q("div",{className:OQt+" "+m8t})),s.appendChild(a)),n.appendChild(s),this.parent.enableVirtualization)&&(l=this.parent.element.querySelector(".e-kanban-header").getBoundingClientRect().height,"auto"===this.parent.height?s.style.height=window.innerHeight-(l+this.parent.element.getBoundingClientRect().top+15)+"px":s.style.height=parseInt(T(this.parent.height).split("px")[0],10)-(l+15)+"px")}i=[{keyField:e.keyField,textField:e.textField,count:e.count}];this.parent.trigger(NWt,{data:i,element:n,cancel:!1,requestType:"contentRow"},function(e){e.cancel||(t.classList.contains("e-swimlane-row")?t.insertAdjacentElement("beforebegin",n):t.appendChild(n))})},l6t.prototype.windowResize=function(){for(var e=this.parent.element.querySelectorAll("."+D8t),t=this.parent.element.querySelector(".e-kanban-header").getBoundingClientRect().height,i=0;i<e.length;i++)"auto"===this.parent.height?e[i].style.height=window.innerHeight-(t+this.parent.element.getBoundingClientRect().top+15)+"px":e[i].style.height=parseInt(T(this.parent.height).split("px")[0],10)-(t+15)+"px"},l6t.prototype.refreshColumnData=function(u,g,e,t){var m=this,i=[].slice.call(this.parent.element.querySelectorAll(".e-content-row:not(.e-swimlane-row)")),f=("cardChanged"===e||"cardCreated"===e||"cardRemoved"===e)&&!je(t);i.forEach(function(c){for(var e=0,t=m.parent.columns;e<t.length;e++)!function(e){if(m.isColumnVisible(e)&&(e.keyField===u||e.keyField===g)||f){var t=0,i=m.getColumnCards()[e.keyField],i=m.parent.dataModule.isRemote()?m.parent.columnDataCount[e.keyField]:i.length,n=m.cardHeight*i,o=Array.apply(null,Array(i)).map(function(){return++t}),r=c.querySelector('[data-key="'+e.keyField+'"]'),s=Math.ceil(parseInt(r.style.height.split("px")[0],10)/m.cardHeight);m.offsets[1]=s*m.cardHeight;for(var a=1;a<o.length;a++)m.offsets[o[a]]=m.offsets[o[a-1]]+s*m.cardHeight,m.tempOffsets[o[a]]=0|m.offsets[o[a]-1];var l=r.querySelector("."+V8t),h=i%2==0?i-2:i-1,d=m.getInfoFromView(m.scrollStatus[e.keyField]),d=m.getTranslateY(d),p=l.querySelector("."+_8t);p.style.maxHeight=i*m.cardHeight+"px",m.setPadding(d,p,i),m.currentStatus={column:e.keyField,columnOverAllHeight:n,columnHeight:parseInt(r.style.height.split("px")[0],10),previousScrollTop:m.scrollStatus[e.keyField].currentScrollTop,currentScrollTop:l.scrollTop,scrollDirection:m.scrollStatus[e.keyField].scrollDirection,currentBlockIndex:m.scrollStatus[e.keyField].currentBlockIndex,oldBlockIndex:m.scrollStatus[e.keyField].oldBlockIndex,offsets:m.offsets,tempOffsets:m.tempOffsets,totalColumnData:i,singleIndexCardCount:s,maxBlock:h},m.scrollStatus[e.keyField]=m.currentStatus}}(t[e])})},l6t.prototype.renderCards=function(){var g=this,e=[].slice.call(this.parent.element.querySelectorAll(".e-content-row:not(.e-swimlane-row)")),o=[].slice.call(this.parent.element.querySelectorAll(".e-content-row.e-swimlane-row")),r=[],m=!1;e.forEach(function(c,e){for(var u=0,t=function(e){if(g.isColumnVisible(e)){var t=0,n=(g.offsets={},g.tempOffsets={},g.columnData[e.keyField]),i=g.parent.dataModule.isRemote()?g.parent.columnDataCount[e.keyField]:n.length,o=(u+=i,g.cardHeight*i+7),r=c.querySelector('[data-key="'+e.keyField+'"]'),s=Math.ceil(parseFloat(r.style.height.split("px")[0])/g.cardHeight),a=i<s?i:Math.floor(i/s),l=Array.apply(null,Array(i)).map(function(){return++t});g.offsets[1]=s*g.cardHeight+7;for(var h=1;h<l.length;h++)g.offsets[l[h]]=g.offsets[l[h-1]]+s*g.cardHeight,g.tempOffsets[l[h]]=0|g.offsets[l[h]-1];var d=Q("div",{className:V8t,attrs:{role:"listbox"}}),p=Q("div",{className:_8t,attrs:{role:"listbox"}}),a=(d.appendChild(p),a%2==0?a:a+1);if(g.currentStatus={column:e.keyField,columnOverAllHeight:o,columnHeight:parseInt(r.style.height.split("px")[0],10),previousScrollTop:null,currentScrollTop:d.scrollTop,scrollDirection:null,currentBlockIndex:[1,2],oldBlockIndex:[1,2],offsets:g.offsets,tempOffsets:g.tempOffsets,totalColumnData:i,singleIndexCardCount:s,maxBlock:a},g.scrollStatus[e.keyField]=g.currentStatus,!(m=0<e.transitionColumns.length?!0:m)&&je(g.parent.swimlaneSettings.keyField)&&(o=Q("div",{className:mQt}),r.appendChild(o)),r.appendChild(d),0<i){for(h=0;h<2*s&&h<n.length;h++)!function(e){var t=n[e][g.parent.cardSettings.headerField],t=g.parent.actionModule.selectionArray.indexOf(t),i=g.renderCard(n[e]),t=(-1!==t&&(i.setAttribute("aria-selected","true"),U([i],wQt)),{data:n[e],element:i,cancel:!1});g.parent.trigger(OWt,t,function(e){e.cancel||p.appendChild(i)})}(h);p.style.maxHeight=g.cardHeight*i+"px"}else p.appendChild(g.renderEmptyCard());g.setPadding(0,p,i)}},i=0,n=g.parent.columns;i<n.length;i++)t(n[i]);0===u&&(r.push(c),0<o.length)&&r.push(o[e])}),this.parent.swimlaneSettings.showEmptyRow||0!==this.parent.kanbanData.length||this.parent.showEmptyColumn||r.forEach(ue)},l6t.prototype.renderCard=function(e){var t=Q("div",{className:H8t,attrs:{"data-id":e[this.parent.cardSettings.headerField],"data-key":e[this.parent.keyField],"aria-selected":"false",tabindex:"-1",role:"option"}});if(t.style.height=this.cardHeight-8+"px",this.parent.cardSettings.template){U([t],f8t);var i=this.parent.element.id+"_cardTemplate";ht(this.parent.templateParser(this.parent.cardSettings.template)(e,this.parent,"cardTemplate",i,!1),t)}else{var n,o,i=this.parent.enableTooltip?" "+CQt:"",r=(this.parent.cardSettings.showHeader&&(n=Q("div",{className:U8t}),r=Q("div",{className:G8t}),o=Q("div",{className:Y8t+i,innerHTML:e[this.parent.cardSettings.headerField]||""}),n.appendChild(r),r.appendChild(o),t.appendChild(n)),Q("div",{className:q8t+i,innerHTML:e[this.parent.cardSettings.contentField]||""}));if(t.appendChild(r),this.parent.cardSettings.tagsField&&e[this.parent.cardSettings.tagsField]){for(var s=Q("div",{className:X8t}),a=0,l=e[this.parent.cardSettings.tagsField].toString().split(",");a<l.length;a++){var h=l[a];s.appendChild(Q("div",{className:K8t+" "+Z8t,innerHTML:h}))}t.appendChild(s)}if(this.parent.cardSettings.grabberField&&e[this.parent.cardSettings.grabberField]&&(U([t],J8t),t.style.borderLeftColor=e[this.parent.cardSettings.grabberField]),this.parent.cardSettings.footerCssField){for(var d=Q("div",{className:$8t}),p=0,c=e[this.parent.cardSettings.footerCssField].split(",");p<c.length;p++){var u=c[p];d.appendChild(Q("div",{className:u.trim()+" "+tQt}))}t.appendChild(d)}}return t},l6t.prototype.renderEmptyCard=function(){return Q("span",{className:eQt,innerHTML:this.parent.localeObj.getConstant("noCard")})},l6t.prototype.renderColGroup=function(e){var n=this,o=Q("colgroup");this.parent.columns.forEach(function(e){var t,i;n.isColumnVisible(e)&&(i=n.parent.actionModule.columnToggleArray.indexOf(e.keyField.toString()),t=e.allowToggle&&!e.isExpanded,i=Q("col",{className:-1!==i||t?rQt:"",attrs:{"data-key":e.keyField.toString()},styles:n.parent.isAdaptive?"width: "+T(t?50:n.getWidth()):""}),o.appendChild(i))}),e.appendChild(o)},l6t.prototype.getRows=function(){var e=[];return e.push({keyField:"",textField:""}),e},l6t.prototype.createStackedRow=function(r){var e=Q("tr",{className:B8t+" "+T8t}),s=[];this.parent.columns.forEach(function(e){for(var t="",i=0,n=r;i<n.length;i++){var o=n[i];-1!==o.keyFields.indexOf(e.keyField.toString())&&(t=o.text)}s.push(t)});for(var t=0;t<s.length;t++){for(var i=1,n=t+1;n<s.length&&(""!==s[t]&&""!==s[n]&&s[t]===s[n]);n++)i++;var o=Q("div",{className:x8t,innerHTML:s[t]}),a=Q("th",{className:C8t+" "+E8t,attrs:{colspan:i.toString()}});e.appendChild(a).appendChild(o),t+=i-1}return e},l6t.prototype.scrollUiUpdate=function(){var e,i=this,t=this.parent.element.querySelector("."+b8t),n=this.parent.element.querySelector("."+M8t),o=this.parent.element.offsetHeight-t.offsetHeight;this.parent.isAdaptive&&(o=window.innerHeight-(t.offsetHeight+25),(e=this.parent.element.querySelector("."+SQt))&&(o-=e.offsetHeight),[].slice.call(this.parent.element.querySelectorAll("."+D8t)).forEach(function(e){var t=e.querySelector("."+V8t);t.classList.contains(yQt)||(t.style.height=T(o),E.add(e,"touchmove",i.onAdaptiveScroll,i))})),"auto"!==this.parent.height&&"100%"!==this.parent.height&&(n.style.height=T(o)),[].slice.call(t.children).forEach(function(e){var t=0;0<n.offsetWidth-n.clientWidth&&(t=17,0<n.offsetHeight-n.clientHeight)&&(e.style.width=T(n.clientWidth)),i.parent.enableRtl?e.style.paddingLeft=T(t):e.style.paddingRight=T(t)}),this.updateScrollPosition()},l6t.prototype.onContentScroll=function(e){var t=e.target,e=this.parent.element.querySelector("."+b8t);[].slice.call(e.children).forEach(function(e){e.scrollLeft=t.scrollLeft}),this.parent.scrollPosition.content={left:t.scrollLeft,top:t.scrollTop}},l6t.prototype.getOffset=function(e,t){return Math.min(0|t.offsets[e],0|t.offsets[t.maxBlock])},l6t.prototype.getTranslateY=function(e){var t=(e.newBlockIndex[0]||1)-1,i=this.getOffset(t,e),n=this.getOffset(e.newBlockIndex[e.newBlockIndex.length-1],e);return i>e.currentScrollTop?this.getOffset(t-1,e):n<e.currentScrollTop+e.columnHeight?this.getOffset(1+t,e):i},l6t.prototype.setPadding=function(e,t,i,n,o){n&&"down"===o?(t.style.paddingTop=e+"px",t.style.paddingBottom="0px"):(t.style.paddingTop=e+"px",t.style.paddingBottom=this.cardHeight*i-e+"px")},l6t.prototype.getData=function(e,t,i,n){var o=this.query.clone(),e=new ba(e,"equal",t,!0);return o.where(e),o.take(i),o.skip(n),o.addParams("KanbanVirtualScroll","KanbanVirtualScroll"),this.parent.dataSource&&"result"in this.parent.dataSource?this.eventPromise({requestType:""},o).promise:this.parent.dataModule.dataManager.executeQuery(o)},l6t.prototype.eventPromise=function(e,t){var t=this.getStateEventArgument(t),i=new ll;return t.updateData=i.resolve,t.action=e,i},l6t.prototype.getStateEventArgument=function(e){var t=new Ba,i=new me({url:"",adaptor:new Ba}),t=t.processQuery(i,e);return Pe(JSON.parse(t.data),t.pvtData)},l6t.prototype.dataManagerSuccess=function(e,t){var i,n=this;return t?i=Pe([],(je(e.result.result)?e:e.result).result,null,!0):this.parent.trigger(VWt,e,function(e){i=Pe([],(je(e.result.result)?e:e.result).result,null,!0),n.parent.trigger(_Wt,null,function(){return n.parent.hideSpinner()})}),i},l6t.prototype.dataManagerFailure=function(e){var t=this;this.parent.isDestroyed||this.parent.trigger(LWt,{error:e},function(){return t.parent.hideSpinner()})},l6t.prototype.onColScrollShowSkeleton=function(e){var t,i,n,e=e.target;0<this.parent.element.querySelectorAll(".e-card-skeleton-wrapper").length||(t=e.parentElement.getAttribute("data-key"),i=this.scrollStatus[t].previousScrollTop,n=e.parentElement.clientHeight,(e.scrollTop-i>n||i-e.scrollTop>n)&&this.showSkeleton(e,this.scrollStatus[t].singleIndexCardCount))},l6t.prototype.showSkeleton=function(e,t){var i=Q("div",{className:"e-card-virtual-skeleton-wrapper",attrs:{role:"listbox"}});e.parentElement.insertBefore(i,e),i.style.position="absolute",i.style.zIndex="10";for(var n=0;n<t;n++){var o=Q("div",{className:"e-card-skeleton-wrapper"}),r=Q("span",{className:"e-skeleton e-skeleton-text e-shimmer-wave"});r.style.height=this.cardHeight+"px",je(e.querySelector(".e-card"))||(r.style.width=e.querySelector(".e-card").getBoundingClientRect().width+"px"),o.appendChild(r),i.appendChild(o)}},l6t.prototype.hideSkeleton=function(i){setTimeout(function(){for(var e=i.querySelectorAll(".e-card-virtual-skeleton-wrapper"),t=0;t<e.length;t++)G(e[t])},50)},l6t.prototype.onColumnScroll=function(e){var t,i,n,o,r,s,a,l,h,d,p,c,u,g=this,m=e.target,f=m.scrollTop;m.offsetParent&&(t=m.offsetParent.getAttribute("data-key"),this.parent.scrollPosition.column[t]={left:m.scrollLeft,top:m.scrollTop}),this.parent.enableVirtualization&&(i=m,d=0,n=this.getColumnCards()[t],o=this.parent.dataModule.isRemote()?this.parent.columnDataCount[t]:n.length,d=this.cardHeight*(d+=o),u=[],s=[],this.checkScrollDirection(t,f),"fast"===this.findScrollSpeed(m,t)&&d<f||(a=this.scrollStatus[t].maxBlock,a=-1<this.scrollStatus[t].currentBlockIndex.indexOf(a),l=e.timeStamp-this.scrollStatus[t].previousTimeStamps<300,a&&!je(this.scrollStatus[t].previousTimeStamps)&&l)||(this.scrollStatus[t].previousTimeStamps=e.timeStamp,u=(r=this.getInfoFromView(this.scrollStatus[t])).currentBlockIndex.filter(function(e){return-1===r.newBlockIndex.indexOf(e)}),s=r.newBlockIndex.filter(function(e){return-1===r.currentBlockIndex.indexOf(e)}),l=(a=f+m.clientHeight>=d)?d-i.querySelector("."+_8t).childElementCount*this.cardHeight:this.getTranslateY(r),h=i.querySelector("."+_8t),0<u.length&&(d=e=void 0,d=1===u[0]?(e=0,u.length*this.scrollStatus[t].singleIndexCardCount-1):(e=(u[0]-1)*this.scrollStatus[t].singleIndexCardCount)+u.length*this.scrollStatus[t].singleIndexCardCount,this.removeCardsOnScroll(h,"down"===this.scrollStatus[t].scrollDirection,e,d)),0<s.length&&(this.parent.dataModule.isRemote()?(c=(s[0]-1)*this.scrollStatus[t].singleIndexCardCount,p=[],this.getData(this.parent.keyField,t,this.scrollStatus[t].singleIndexCardCount*s.length,c).then(function(e){p=g.dataManagerSuccess(e),g.scrollCardInsert(t,h,m,f,i,"down"===g.scrollStatus[t].scrollDirection?0:p.length-1,!0,p,null)}).catch(function(e){return g.dataManagerFailure(e)})):(c="down"===this.scrollStatus[t].scrollDirection?(s[0]-1)*this.scrollStatus[t].singleIndexCardCount:(s[0]-1)*this.scrollStatus[t].singleIndexCardCount+this.scrollStatus[t].singleIndexCardCount*s.length-1,u="down"===this.scrollStatus[t].scrollDirection?c+this.scrollStatus[t].singleIndexCardCount*s.length:(s[0]-1)*this.scrollStatus[t].singleIndexCardCount,this.scrollCardInsert(t,h,m,f,i,c,!1,n,u))),this.scrollStatus[t].currentBlockIndex=this.scrollStatus[t].newBlockIndex,this.setPadding(l,h,o,a,this.scrollStatus[t].scrollDirection),r.currentBlockIndex=r.newBlockIndex,this.parent.renderTemplates()),this.hideSkeleton(i.parentElement))},l6t.prototype.checkScrollDirection=function(e,t){this.scrollStatus[e].previousScrollTop=this.scrollStatus[e].currentScrollTop,(this.scrollStatus[e].currentScrollTop=t)>this.scrollStatus[e].previousScrollTop?this.scrollStatus[e].scrollDirection="down":this.scrollStatus[e].scrollDirection="up"},l6t.prototype.findScrollSpeed=function(e,t){return"down"===this.scrollStatus[t].scrollDirection&&e.scrollTop-this.scrollStatus[t].previousScrollTop>e.clientHeight||"up"===this.scrollStatus[t].scrollDirection&&this.scrollStatus[t].previousScrollTop-e.scrollTop>e.clientHeight?"fast":"slow"},l6t.prototype.removeCardsOnScroll=function(e,t,i,n){for(var o=i;o<n;o++){for(var r=t?e.firstChild:e.lastChild;!je(r)&&(r.classList.contains(cQt)||r.classList.contains(dQt)||r.classList.contains(uQt)||r.classList.contains(pQt));)r=t?r.nextSibling:r.previousSibling;je(r)||G(r)}},l6t.prototype.scrollCardInsert=function(n,o,e,t,i,r,s,a,l){var h=this,d=s?a.length:l,p=s?0:l;if(0<a.length){for(var c=this,u=r;"down"===this.scrollStatus[n].scrollDirection?u<d:p<=u;"down"===this.scrollStatus[n].scrollDirection?u++:u--)!function(e){var t,i;je(a[e])||(i=a[e][c.parent.cardSettings.headerField],i=c.parent.actionModule.selectionArray.indexOf(i),t=c.renderCard(a[e]),-1!==i&&(t.setAttribute("aria-selected","true"),U([t],wQt)),i={data:a[e],element:t,cancel:!1},c.parent.trigger(OWt,i,function(e){e.cancel||("down"===h.scrollStatus[n].scrollDirection?o.appendChild(t):o.insertBefore(t,o.firstChild),h.parent.dragAndDropModule.wireDragEvents(t),U([t],z8t))}))}(u);e.scrollTop=t}else i.appendChild(this.renderEmptyCard())},l6t.prototype.ensureColumnNotEmpty=function(e){var t=this.scrollStatus[e].singleIndexCardCount,i=this.columnData[e],n=this.parent.element.querySelector('.e-content-row:not(.e-swimlane-row) [data-key="'+e+'"]').querySelector("."+_8t),e=n.querySelectorAll("."+H8t);if(0<e.length){var o=e[e.length-1].getAttribute("data-id"),r=e[0].getAttribute("data-id"),s=void 0,a=void 0;if(e.length<2*t){for(var l=0;l<i.length;l++)o===i[l][this.parent.cardSettings.headerField].toString()&&(s=l),r===i[l][this.parent.cardSettings.headerField].toString()&&(a=l);for(l=e.length;l<2*t;l++){var h,d=s===i.length-1,p=s<i.length?s+1:a-1;p<=i.length&&(je(h=i[p])||(h=this.renderCard(h),this.triggerCardRendering(h,p,i,n,d),d?a=p:s=p))}}}},l6t.prototype.triggerCardRendering=function(t,e,i,n,o){var r=this,s=i[e][this.parent.cardSettings.headerField],s=(-1!==this.parent.actionModule.selectionArray.indexOf(s)&&(t.setAttribute("aria-selected","true"),U([t],wQt)),{data:i[e],element:t,cancel:!1});this.parent.trigger(OWt,s,function(e){e.cancel||(o?n.insertBefore(t,n.querySelectorAll("."+H8t)[0]):n.appendChild(t),r.parent.dragAndDropModule.wireDragEvents(t),U([t],z8t))})},l6t.prototype.ensureBlocks=function(e){var t=e.newBlockIndex[e.block],i=Math.ceil(e.totalColumnData/e.singleIndexCardCount),n=Math.max,e="down"===e.scrollDirection?i<=t?[n(t,1),--t,--t].reverse():i<=t+1?[n(t-1,1),t,++t]:[n(t,1),++t,++t]:t===i?[n(t-2,1),n(t-1,1),t]:[n(t-1,1),t,t+1];return e.filter(function(e){return 0<e})},l6t.prototype.getInfoFromView=function(e){var t,i=!1,n=e,e=(n.page=this.getPageFromTop(e),n.newBlockIndex=this.getBlockIndexes(n.page),this.ensureBlocks(n));return n.newBlockIndex.toString()!==e.toString()&&(t=e[e.length-1],-1===n.newBlockIndex.indexOf(t))&&(i=!0),n.newBlockIndex=i?e:n.newBlockIndex,n},l6t.prototype.getBlockIndexes=function(e){return[e+(e-1),2*e]},l6t.prototype.getPageFromTop=function(n){var o=this,r=n.totalColumnData,s=0;return this.offsetKeys=Object.keys(n.offsets),this.offsetKeys.some(function(e){var t,i=Number(e),e=n.currentScrollTop<=n.offsets[parseInt(e,10)]||i===r&&n.currentScrollTop>n.offsets[parseInt(e,10)];return e&&(t=Math.ceil(r/n.singleIndexCardCount),o.offsetKeys.length%2!=0&&i.toString()===o.offsetKeys[o.offsetKeys.length-2]&&n.currentScrollTop<=n.offsets[o.offsetKeys.length-1]&&(i=t<i+1?t:i+1),n.block=(i=t<i?t:i)%2==0?1:0,s=Math.max(1,Math.min(o.getPage(i,t),t))),e}),s},l6t.prototype.getPage=function(e,t){return t<e+1?e%2==0?e/2:(e-1)/2:e%2==0?e/2:(e+1)/2},l6t.prototype.onAdaptiveScroll=function(e){this.parent.touchModule.tabHold&&!this.parent.touchModule.mobilePopup&&e.preventDefault()},l6t.prototype.isColumnVisible=function(e){var t=this,i=!1;return"number"==typeof e.keyField?i=-1===this.parent.actionModule.hideColumnKeys.indexOf(e.keyField.toString()):e.keyField.split(",").forEach(function(e){i=-1===t.parent.actionModule.hideColumnKeys.indexOf(e)}),i},l6t.prototype.renderLimits=function(e,t){var i=Q("div",{className:MQt});e.minCount&&i.appendChild(Q("div",{className:PQt,innerHTML:this.parent.localeObj.getConstant("min")+": "+e.minCount.toString()})),e.maxCount&&i.appendChild(Q("div",{className:kQt,innerHTML:this.parent.localeObj.getConstant("max")+": "+e.maxCount.toString()})),0<i.childElementCount&&(t.querySelector("."+V8t)?t.insertBefore(i,t.firstElementChild):t.appendChild(i))},l6t.prototype.renderValidation=function(){var o=this;this.parent.columns.forEach(function(e){var t,i,n;(e.minCount||e.maxCount)&&(t=o.columnData[e.keyField],n='[data-key="'+e.keyField+'"]',i=o.parent.element.querySelector("."+C8t+n),n=[].slice.call(o.parent.element.querySelectorAll("."+D8t+n)),o.renderLimits(e,i),e=o.getValidationClass(e,t.length))&&U(n.concat(i),e)})},l6t.prototype.getValidationClass=function(e,t){var i;return e.maxCount&&t>e.maxCount?i=BQt:e.minCount&&t<e.minCount&&(i=FQt),i},l6t.prototype.refreshValidation=function(){[].slice.call(this.parent.element.querySelectorAll("."+MQt)).forEach(function(e){ue(e)});q([].slice.call(this.parent.element.querySelectorAll("."+FQt)),FQt);var e=[].slice.call(this.parent.element.querySelectorAll("."+BQt));q(e,BQt),this.renderValidation()},l6t.prototype.getColumnData=function(t,i){var n=this,o=(void 0===i&&(i=this.parent.kanbanData),[]);if("number"==typeof t)var e=i.filter(function(e){return e[n.parent.keyField]===t}),o=o.concat(e);else for(var r=0,s=t.split(",");r<s.length;r++)!function(t){var e=i.filter(function(e){return e[n.parent.keyField]===t.trim()});o=o.concat(e)}(s[r]);return this.sortCategory(o),o},l6t.prototype.sortCategory=function(e){var t=this.parent.cardSettings.headerField,i=this.parent.sortSettings.direction;switch(this.parent.sortSettings.sortBy){case"DataSourceOrder":this.sortOrder(t,i,e);break;case"Custom":case"Index":this.parent.sortSettings.field&&(t=this.parent.sortSettings.field),this.sortOrder(t,i,e)}return e},l6t.prototype.sortOrder=function(i,e,t){var n,o,r=!0;return!(r=0<this.parent.kanbanData.length?"number"==typeof this.parent.kanbanData[0][i]:r)&&"Index"===this.parent.sortSettings.sortBy||(t=t.sort(function(e,t){return(o=r?(n=e[i],t[i]):(n=e[i].toLowerCase(),t[i].toLowerCase()))<n?1:n<o?-1:0}),"Descending"!==e)||t.reverse(),t},l6t.prototype.documentClick=function(e){e.target.classList.contains(TQt)&&this.parent.element.querySelector("."+DQt).classList.contains("e-popup-open")&&(this.treePopup.hide(),q([this.popupOverlay],"e-enable")),z(e.target,"."+u8t)||(q(e=[].slice.call(this.parent.element.querySelectorAll(".e-card."+wQt)),wQt),this.disableAttributeSelection(e))},l6t.prototype.disableAttributeSelection=function(e){e instanceof Element?e.setAttribute("aria-selected","false"):e.forEach(function(e){e.setAttribute("aria-selected","false")})},l6t.prototype.getColumnCards=function(i){var n=this,o={};return this.columnKeys=[],this.parent.columns.forEach(function(e){var t="number"==typeof e.keyField,t=(n.columnKeys=t?n.columnKeys.concat(e.keyField.toString()):n.columnKeys.concat(e.keyField.split(",").map(function(e){return e.trim()})),n.getColumnData(e.keyField,i));o[e.keyField]=t}),o},l6t.prototype.refreshHeaders=function(){var e=this.parent.element.querySelector("."+b8t);[].slice.call(e.children).forEach(ue),this.renderHeader(e)},l6t.prototype.refreshCards=function(){this.parent.resetTemplates(["cardTemplate"]),[].slice.call(this.parent.element.querySelectorAll("."+_8t)).forEach(ue),this.renderCards(),this.wireDragEvent(),this.parent.renderTemplates()},l6t.prototype.refresh=function(){var a=this,l=!1;this.parent.columns.forEach(function(e){if(e.showItemCount){e&&e.template&&!l&&(a.refreshHeaders(),l=!0);var t="."+C8t+'[data-key="'+e.keyField+'"] .'+N8t,t=a.parent.element.querySelector(t);if(t){var i=a.parent.dataModule.isRemote()?a.parent.columnDataCount[e.keyField]:a.columnData[e.keyField].length,n=0;if("number"==typeof e.keyField)n=[].slice.call(a.parent.element.querySelectorAll('.e-card[data-key="'+e.keyField+'"]')).length;else for(var o=0,r=e.keyField.split(",");o<r.length;o++)var s=r[o],n=[].slice.call(a.parent.element.querySelectorAll('.e-card[data-key="'+s.trim()+'"]')).length+n;t.innerHTML="- "+i+" "+a.parent.localeObj.getConstant("items")}}}),this.refreshValidation()},l6t.prototype.updateScrollPosition=function(){var i=this,e=this.parent.element.querySelector("."+M8t);e&&(F.isIE?(e.scrollTop=this.parent.scrollPosition.content.top,e.scrollLeft=this.parent.scrollPosition.content.left):e.scrollTo(this.parent.scrollPosition.content.left,this.parent.scrollPosition.content.top)),[].slice.call(this.parent.element.querySelectorAll("."+V8t)).forEach(function(e){var t;e.offsetParent&&(t=i.parent.scrollPosition.column[e.offsetParent.getAttribute("data-key")])&&(F.isIE?(e.scrollTop=t.top,e.scrollLeft=t.left):e.scrollTo(t.left,t.top))})},l6t.prototype.renderCardBasedOnIndex=function(t,i,n,o){var r,e,s,a,l=this,h=t[this.parent.keyField],d=this.parent.element.querySelector(".e-content-row:not(.e-swimlane-row)");"Index"!==this.parent.sortSettings.sortBy?(r=this.parent.cardSettings.headerField,"Custom"===this.parent.sortSettings.sortBy&&(r=this.parent.sortSettings.field),i=je(this.parent.swimlaneSettings.keyField)?this.getColumnData(h,this.parent.kanbanData).findIndex(function(e){return e[r]===t[r]}):(e=this.parent.getSwimlaneData(t[this.parent.swimlaneSettings.keyField]),this.getColumnData(h,e).findIndex(function(e){return e[r]===t[r]}))):"Index"===this.parent.sortSettings.sortBy&&this.parent.sortSettings.field&&"Ascending"===this.parent.sortSettings.direction&&(i=t[this.parent.sortSettings.field]-1),d&&(e=[].slice.call(d.children).filter(function(e){return-1!==e.getAttribute("data-key").replace(/\s/g,"").split(",").indexOf(h.toString().replace(/\s/g,""))})[0],(d=(s=e.querySelector("."+_8t)).querySelector("."+eQt))&&ue(d),a=this.renderCard(t),this.parent.allowDragAndDrop&&e.classList.contains(j8t)&&(this.parent.dragAndDropModule.wireDragEvents(a),U([a],z8t)),this.parent.trigger(OWt,{data:t,element:a,cancel:!1},function(e){var t=!!n||s.childNodes.length<l.scrollStatus[h].singleIndexCardCount;(e.cancel||!t)&&je(o)||(je(i)||0===s.children.length?s.appendChild(a):s.insertBefore(a,s.childNodes[i]))}))},l6t.prototype.removeCard=function(e){var t,e=e[this.parent.cardSettings.headerField],e=this.parent.element.querySelector('.e-card[data-id="'+e+'"]');e&&(this.isSelectedCard=!!e.classList.contains(wQt),t=e.parentElement,ue(e),0===t.querySelectorAll(".e-card:not(."+pQt+")").length)&&t.appendChild(this.renderEmptyCard())},l6t.prototype.wireEvents=function(){var t=this,e=(E.add(this.parent.element,"click",this.parent.actionModule.clickHandler,this.parent.actionModule),E.add(this.parent.element,"dblclick",this.parent.actionModule.doubleClickHandler,this.parent.actionModule),E.add(document,F.touchStartEvent,this.documentClick,this),window.addEventListener("resize",this.winResize),this.parent.element.querySelector("."+M8t));E.add(e,"scroll",this.onContentScroll,this),[].slice.call(this.parent.element.querySelectorAll("."+V8t)).forEach(function(e){t.parent.isInitialRender&&e.offsetParent&&(t.parent.scrollPosition.column[e.offsetParent.getAttribute("data-key")]={left:0,top:0}),E.add(e,"scroll",t.onColScrollShowSkeleton,t),E.add(e,"scroll",P(t.onColumnScroll,200),t)}),this.parent.isAdaptive&&(this.parent.touchModule.wireTouchEvents(),e.scrollLeft=this.scrollLeft),this.wireDragEvent()},l6t.prototype.unWireEvents=function(){var t=this,e=(E.remove(this.parent.element,"click",this.parent.actionModule.clickHandler),E.remove(this.parent.element,"dblclick",this.parent.actionModule.doubleClickHandler),E.remove(document,F.touchStartEvent,this.documentClick),window.removeEventListener("resize",this.winResize),this.winResize=null,this.parent.element.querySelector("."+M8t)),e=(e&&(E.remove(e,"scroll",this.onContentScroll),E.remove(e,"scroll",this.onColScrollShowSkeleton),this.parent.allowDragAndDrop)&&this.unWireDragEvent(),[].slice.call(this.parent.element.querySelectorAll("."+V8t)));0<e.length&&e.forEach(function(e){E.remove(e,"scroll",P(t.onColumnScroll,200))}),this.parent.isAdaptive&&this.parent.touchModule.unWireTouchEvents()},l6t.prototype.wireDragEvent=function(){var e,t=this;this.parent.allowDragAndDrop&&(U(e=[].slice.call(this.parent.element.querySelectorAll("."+D8t+"."+j8t+" ."+H8t)),z8t),0<e.length)&&e.forEach(function(e){return t.parent.dragAndDropModule.wireDragEvents(e)})},l6t.prototype.unWireDragEvent=function(){var t=this,e=[].slice.call(this.parent.element.querySelectorAll("."+D8t+"."+j8t+" ."+H8t));q(e,z8t),0<e.length&&e.forEach(function(e){return t.parent.dragAndDropModule.unWireDragEvents(e)})},l6t.prototype.destroy=function(){this.parent.resetTemplates(),this.parent.off(WWt,this.initRender),this.parent.off(jWt,this.scrollUiUpdate),this.unWireEvents();var e=this.parent.element.querySelector("."+b8t),e=(e&&ue(e),this.parent.element.querySelector("."+M8t)),e=(e&&ue(e),this.treeViewObj&&(this.treeViewObj.destroy(),this.treeViewObj=null),this.treePopup&&(this.treePopup.destroy(),this.treePopup=null),this.parent.element.querySelector("."+SQt)),e=(e&&ue(e),this.parent.element.querySelector("."+EQt));e&&ue(e)};var r6t,s6t,a6t=l6t;function l6t(e){var t=s6t.call(this,e)||this;return t.parent=e,t.kanbanRows=[],t.scrollStatus={},t.offsets={},t.tempOffsets={},t.offsetKeys=[],t.columnKeys=[],t.scrollLeft=0,t.frozenOrder=0,t.winResize=t.windowResize.bind(t),t.parent.enableVirtualization&&(t.parent.on(WWt,t.initRender,t),t.parent.on(jWt,t.scrollUiUpdate,t)),t}h6t=function(e,t){return(h6t=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])}))(e,t)};var h6t,d6t,h6=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Tft=(function(e,t){function i(){this.constructor=e}h6t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(p6t,d6t=Ji),p6t.prototype.preRender=function(){this.isAdaptive=F.isDevice,this.kanbanData=[],this.enablePersistence&&this.swimlaneToggleArray||(this.swimlaneToggleArray=[]),this.activeCardData={data:null,element:null};this.localeObj=new Cn(this.getModuleName(),{items:"items",min:"Min",max:"Max",cardsSelected:"Cards Selected",addTitle:"Add New Card",editTitle:"Edit Card Details",deleteTitle:"Delete Card",deleteContent:"Are you sure you want to delete this card?",save:"Save",delete:"Delete",cancel:"Cancel",yes:"Yes",no:"No",close:"Close",noCard:"No cards to display",unassigned:"Unassigned",cards:"Cards"},this.locale),this.scrollPosition={content:{left:0,top:0},column:{}},this.isInitialRender=!0},p6t.prototype.requiredModules=function(){return[]},p6t.prototype.getPersistData=function(){return 0<this.dataSource.length?this.addOnPersist(["columns","dataSource","swimlaneToggleArray"]):this.addOnPersist(["columns","kanbanData","swimlaneToggleArray"])},p6t.prototype.getModuleName=function(){return"kanban"},p6t.prototype.render=function(){var e=[u8t],t=[];(this.enableRtl?e:t).push("e-rtl"),(this.isAdaptive?e:t).push(g8t),this.cssClass&&e.push(this.cssClass),mt(this.element,e,t),this.element.style.width=T(this.width),this.element.style.height=T(this.height),this.element.setAttribute("role","application"),this.element.setAttribute("aria-label","Kanban Board"),mA({target:this.element}),this.showSpinner(),this.initializeModules()},p6t.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"cssClass":t.cssClass&&q([this.element],t.cssClass),e.cssClass&&U([this.element],e.cssClass);break;case"enableRtl":case"locale":this.refresh();break;case"width":this.element.style.width=T(e.width),this.element.querySelector("."+b8t).firstElementChild.style.width="auto",this.notify(jWt,{});break;case"height":this.element.style.height=T(e.height),this.element.querySelector("."+M8t).style.height="auto",this.notify(jWt,{});break;case"dataSource":case"query":this.dataModule&&this.dataModule.setState({isDataChanged:!1}),this.dataModule=new qWt(this);break;case"columns":case"constraintType":this.notify(WWt,{processedData:this.kanbanData});break;case"swimlaneSettings":this.onSwimlaneSettingsPropertyChanged(e.swimlaneSettings,t.swimlaneSettings);break;case"cardSettings":this.onCardSettingsPropertyChanged(e.cardSettings,t.cardSettings);break;case"allowDragAndDrop":e.allowDragAndDrop?(this.enableVirtualization?this.virtualLayoutModule:this.layoutModule).wireDragEvent():(this.enableVirtualization?this.virtualLayoutModule:this.layoutModule).unWireDragEvent();break;case"enableTooltip":this.tooltipModule&&(this.tooltipModule.destroy(),this.tooltipModule=null),e.enableTooltip&&(this.tooltipModule=new KQt(this),(this.enableVirtualization?this.virtualLayoutModule:this.layoutModule).refreshCards());break;case"dialogSettings":e.dialogSettings&&(this.dialogModule=new qQt(this));break;case"allowKeyboard":this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null),e.allowKeyboard&&(this.keyboardModule=new YQt(this));break;case"stackedHeaders":(this.enableVirtualization?this.virtualLayoutModule:this.layoutModule).refreshHeaders();break;case"sortSettings":this.notify(WWt,{processedData:this.kanbanData})}},p6t.prototype.onSwimlaneSettingsPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"keyField":case"textField":case"showEmptyRow":case"showItemCount":case"template":case"sortDirection":this.notify(WWt,{processedData:this.kanbanData});break;case"enableFrozenRows":this.layoutModule.frozenSwimlaneRow&&!this.swimlaneSettings.enableFrozenRows&&this.layoutModule.removeFrozenRows()}},p6t.prototype.onCardSettingsPropertyChanged=function(e,t){for(var i,n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"showHeader":case"headerField":case"contentField":case"template":case"tagsField":case"grabberField":case"footerCssField":(this.enableVirtualization?this.virtualLayoutModule:this.layoutModule).refreshCards();break;case"selectionType":0<(i=this.getSelectedCards()).length&&(q(i,wQt),(this.enableVirtualization?this.virtualLayoutModule:this.layoutModule).disableAttributeSelection(i))}},p6t.prototype.initializeModules=function(){this.dataModule=new qWt(this),this.enableVirtualization?this.virtualLayoutModule=new a6t(this):this.layoutModule=new n6t(this),this.allowKeyboard&&(this.keyboardModule=new YQt(this)),this.actionModule=new HQt(this),this.crudModule=new jQt(this),this.dragAndDropModule=new QQt(this),this.dialogModule=new qQt(this),this.enableTooltip&&(this.tooltipModule=new KQt(this)),(F.isDevice||F.isTouch)&&(this.touchModule=new ZQt(this))},p6t.prototype.renderTemplates=function(){this.isReact&&this.renderReactTemplates()},p6t.prototype.resetTemplates=function(e){this.isReact&&this.clearTemplate(e)},p6t.prototype.destroyModules=function(){this.layoutModule&&(this.layoutModule.destroy(),this.layoutModule=null),this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null),this.virtualLayoutModule&&(this.virtualLayoutModule.destroy(),this.virtualLayoutModule=null),this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.tooltipModule&&(this.tooltipModule.destroy(),this.tooltipModule=null),this.dialogModule=null,this.actionModule=null,this.crudModule=null,this.dataModule=null,this.dragAndDropModule=null},p6t.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){return oo(t)}},p6t.prototype.getCardDetails=function(e){var t=this,i="number"==typeof this.kanbanData[0][this.cardSettings.headerField]?parseInt(e.getAttribute("data-id"),10):e.getAttribute("data-id");return this.kanbanData.filter(function(e){return e[t.cardSettings.headerField]===i})[0]},p6t.prototype.getColumnData=function(e,t){return this.enableVirtualization?this.virtualLayoutModule.getColumnCards(t)[""+e]||[]:this.layoutModule.getColumnCards(t)[""+e]||[]},p6t.prototype.getSwimlaneData=function(e){return this.layoutModule.getSwimlaneCards()[""+e]||[]},p6t.prototype.getSelectedCards=function(){return[].slice.call(this.element.querySelectorAll(".e-card."+wQt))},p6t.prototype.showSpinner=function(){kA(this.element)},p6t.prototype.hideSpinner=function(){BA(this.element)},p6t.prototype.openDialog=function(e,t){this.dialogModule.openDialog(e,t)},p6t.prototype.closeDialog=function(){this.dialogModule.closeDialog()},p6t.prototype.addCard=function(e,t){this.crudModule.addCard(e,t)},p6t.prototype.updateCard=function(e,t){this.crudModule.updateCard(e,t)},p6t.prototype.deleteCard=function(e){this.crudModule.deleteCard(e)},p6t.prototype.addColumn=function(e,t){this.actionModule.addColumn(e,t)},p6t.prototype.deleteColumn=function(e){this.actionModule.deleteColumn(e)},p6t.prototype.showColumn=function(e){this.actionModule.showColumn(e)},p6t.prototype.hideColumn=function(e){this.actionModule.hideColumn(e)},p6t.prototype.refreshUI=function(e,t){this.dataModule.refreshUI(e,t=t||0)},p6t.prototype.refreshHeader=function(){this.resetTemplates(["columnTemplate"]),(this.enableVirtualization?this.virtualLayoutModule:this.layoutModule).refreshHeaders(),this.renderTemplates()},p6t.prototype.destroy=function(){this.destroyModules(),[].slice.call(this.element.childNodes).forEach(function(e){G(e)});var e=[u8t];this.cssClass&&(e=e.concat(this.cssClass.split(" "))),q([this.element],e),d6t.prototype.destroy.call(this)},h6([e()],p6t.prototype,"cssClass",void 0),h6([e("auto")],p6t.prototype,"width",void 0),h6([e("auto")],p6t.prototype,"height",void 0),h6([e("auto")],p6t.prototype,"cardHeight",void 0),h6([e()],p6t.prototype,"enableVirtualization",void 0),h6([e([])],p6t.prototype,"dataSource",void 0),h6([e()],p6t.prototype,"query",void 0),h6([e()],p6t.prototype,"keyField",void 0),h6([e("Column")],p6t.prototype,"constraintType",void 0),h6([e([])],p6t.prototype,"externalDropId",void 0),h6([kt([],r8t)],p6t.prototype,"columns",void 0),h6([e(!0)],p6t.prototype,"allowKeyboard",void 0),h6([e(!0)],p6t.prototype,"enableHtmlSanitizer",void 0),h6([kt([],b8)],p6t.prototype,"stackedHeaders",void 0),h6([t({},xW)],p6t.prototype,"swimlaneSettings",void 0),h6([t({},wH)],p6t.prototype,"cardSettings",void 0),h6([t({},DQ)],p6t.prototype,"sortSettings",void 0),h6([t({},Wz)],p6t.prototype,"dialogSettings",void 0),h6([e(!0)],p6t.prototype,"allowDragAndDrop",void 0),h6([e(!1)],p6t.prototype,"enableTooltip",void 0),h6([e(!1)],p6t.prototype,"showEmptyColumn",void 0),h6([e(!1)],p6t.prototype,"enablePersistence",void 0),h6([e()],p6t.prototype,"tooltipTemplate",void 0),h6([i()],p6t.prototype,"actionBegin",void 0),h6([i()],p6t.prototype,"actionComplete",void 0),h6([i()],p6t.prototype,"actionFailure",void 0),h6([i()],p6t.prototype,"created",void 0),h6([i()],p6t.prototype,"dataBinding",void 0),h6([i()],p6t.prototype,"dataBound",void 0),h6([i()],p6t.prototype,"cardClick",void 0),h6([i()],p6t.prototype,"cardDoubleClick",void 0),h6([i()],p6t.prototype,"queryCellInfo",void 0),h6([i()],p6t.prototype,"cardRendered",void 0),h6([i()],p6t.prototype,"dragStart",void 0),h6([i()],p6t.prototype,"drag",void 0),h6([i()],p6t.prototype,"dragStop",void 0),h6([i()],p6t.prototype,"dialogOpen",void 0),h6([i()],p6t.prototype,"dialogClose",void 0),h6([i()],p6t.prototype,"dataStateChange",void 0),h6([i()],p6t.prototype,"dataSourceChanged",void 0),h6([Bt],p6t));function p6t(e,t){e=d6t.call(this,e,t)||this;return e.columnDataCount={},e.needsID=!0,e}var c6t,u6t,Vft=Object.freeze({__proto__:null,Kanban:Tft,actionBegin:BWt,actionComplete:FWt,actionFailure:LWt,cardClick:"cardClick",cardDoubleClick:RWt,cardRendered:OWt,queryCellInfo:NWt,dataBinding:VWt,dataBound:_Wt,dragStart:"dragStart",drag:"drag",dragStop:"dragStop",documentClick:"document-click",dialogOpen:HWt,dialogClose:zWt,contentReady:jWt,dataReady:WWt,bottomSpace:25,cardSpace:16,toggleWidth:50,dataSourceChanged:QWt,dataStateChange:UWt}),Gmt=(c6t=function(e,t){return(c6t=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])}))(e,t)},function(e,t){function i(){this.constructor=e}c6t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),X$e=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},vft=(Gmt(g6t,u6t=n),X$e([e("")],g6t.prototype,"iconCss",void 0),X$e([e()],g6t.prototype,"text",void 0),X$e([e("Button")],g6t.prototype,"type",void 0),X$e([e("Left")],g6t.prototype,"align",void 0),X$e([e(!0)],g6t.prototype,"visible",void 0),X$e([e(!1)],g6t.prototype,"disabled",void 0),X$e([e("")],g6t.prototype,"tooltip",void 0),X$e([e("")],g6t.prototype,"cssClass",void 0),X$e([e(null)],g6t.prototype,"template",void 0),X$e([e(-1)],g6t.prototype,"tabIndex",void 0),g6t);function g6t(){return null!==u6t&&u6t.apply(this,arguments)||this}Gmt(f6t,m6t=n),X$e([kt([],vft)],f6t.prototype,"items",void 0),X$e([i()],f6t.prototype,"itemClicked",void 0);var m6t,Rft=f6t;function f6t(){return null!==m6t&&m6t.apply(this,arguments)||this}Gmt(v6t,y6t=Ji),v6t.prototype.preRender=function(){},v6t.prototype.getModuleName=function(){return"interactivechatBase"},v6t.prototype.getPersistData=function(){return this.addOnPersist([])},v6t.prototype.render=function(){},v6t.prototype.setDimension=function(e,t,i){e.style.width=je(t)?e.style.width:T(t),e.style.height=je(i)?e.style.height:T(i)},v6t.prototype.addCssClass=function(e,t){t&&e.classList.add(t)},v6t.prototype.addRtlClass=function(e,t){t&&e.classList.add("e-rtl")},v6t.prototype.updateCssClass=function(e,t,i){i&&q([e],i.trim().split(" ")),t&&U([e],t.trim().split(" "))},v6t.prototype.updateHeader=function(e,t,i){e?(t.hidden=!1,i.style.height=""):(t.hidden=!0,i.style.height="100%")},v6t.prototype.renderViewSections=function(e,t,i){t=this.createElement("div",{className:t}),e.appendChild(t),t=this.createElement("div",{className:i});e.appendChild(t)},v6t.prototype.createViewComponents=function(e){var t=this.createElement("div",{className:"e-views"}),i=this.createElement("div",{className:"e-view-container"});t.appendChild(i),e.appendChild(t)},v6t.prototype.updateScroll=function(e){e.scrollTo(0,e.scrollHeight)},v6t.prototype.getElement=function(e){var t;switch(e){case"footer":t="e-footer";break;case"contentContainer":t="e-content-container";break;case"outputElement":t="e-content";break;default:t=""}return this.createElement("div",{className:t})},v6t.prototype.createSuggestionElement=function(e){var t=this.createElement("div",{className:"e-suggestions"}),i=this.createElement("div",{className:"e-suggestion-header"}),n=this.createElement("div",{className:"e-suggestion-list"});return e&&t.appendChild(i),t.appendChild(n),{suggestionContainer:t,suggestionHeaderElement:i,suggestionListElement:n}},v6t.prototype.renderSuggestions=function(e,t,i,n,o,r){var s,a,l,h=!!i;e&&0<e.length&&(l=(a=this.createSuggestionElement(t)).suggestionContainer,s=a.suggestionHeaderElement,a=a.suggestionListElement,this.suggestionsElement=l,this.suggestionsElement.className="e-suggestions "+(h?"e-suggestion-item-template":""),this.suggestionHeader=s,this.renderSuggestionList(e,l=a,h,n,i,o,r),t&&(this.suggestionHeader.innerHTML=t),this.suggestionsElement.append(l),this.content.append(this.suggestionsElement))},v6t.prototype.renderSuggestionList=function(o,e,r,s,a,l,h){var d=this,p=this.createElement("ul",{attrs:{tabindex:"-1"}});o.forEach(function(e,t){var i,n=d.createElement("li");pt(n,{tabindex:"0"}),E.add(n,"click",h,d),E.add(n,"keydown",d.suggestionItemHandler,d),r?((i={index:t})[s]=o[parseInt(t.toString(),10)],d.updateContent(a,n,i,l)):n.innerHTML=e,p.append(n)}),e.appendChild(p)},v6t.prototype.suggestionItemHandler=function(e){"Enter"!==e.key||e.shiftKey||this.onSuggestionClick(e)},v6t.prototype.renderBannerView=function(e,t,i){var n;e&&(n=this.createElement("div",{className:"emptyChatTemplate"===i?"e-empty-chat-template":"e-banner-view"}),this.updateContent(e,n,{},i),t.prepend(n))},v6t.prototype.updateContent=function(e,t,i,n){this.isReact&&this.clearTemplate([n]);n=!(this.isReact||this.isVue),e=this.getTemplateFunction(e,n);"string"==typeof e?t.innerHTML=e:ht(e(i,this),t),this.renderReactTemplates()},v6t.prototype.renderFooterContent=function(e,t,i,n,o,r){return e?(this.updateContent(e,t,{},"footerTemplate"),null):(e=this.createElement("textarea",{className:r}),t.appendChild(e),this.renderFooter(e,i,n,o))},v6t.prototype.renderFooter=function(e,t,i,n){i=new IV({rows:1,cols:300,placeholder:i,resizeMode:"None",value:t,showClearButton:n=void 0===n?!1:n});return i.appendTo(e),i},v6t.prototype.updateTextAreaObject=function(e){je(e)||((e=e.element).style.height="auto",e.style.height=e.scrollHeight+"px")},v6t.prototype.renderSendIcon=function(e,t){e=this.createElement("span",{attrs:{class:e,role:"button","aria-label":"Submit",tabindex:"0"}});return t.appendChild(e),e},v6t.prototype.appendChildren=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];e.append.apply(e,t)},v6t.prototype.insertBeforeChildren=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];e.prepend.apply(e,t)},v6t.prototype.wireFooterEvents=function(e,t,i,n){var o=this;e&&E.add(e,"click",this.onSendIconClick,this),t&&!i&&E.add(t,"keydown",this.footerKeyHandler,this),E.add(window,"resize",function(){return o.updateTextAreaObject(n)},this)},v6t.prototype.unWireFooterEvents=function(e,t,i,n){var o=this;e&&E.remove(e,"click",this.onSendIconClick),t&&!i&&E.remove(t,"keydown",this.footerKeyHandler),E.remove(window,"resize",function(){return o.updateTextAreaObject(n)})},v6t.prototype.removeAndNullify=function(e){e&&(je(e.parentNode)?e.innerHTML="":ue(e))},v6t.prototype.destroyAndNullify=function(e){e&&e.destroy()},v6t.prototype.getTemplateFunction=function(t,e){if("string"!=typeof t)return oo(t);var i="";try{var n=ge(t);n?(i="SCRIPT"===n.tagName?n.innerHTML:n.outerHTML,e=!1):i=t}catch(e){i=t}return e?i:oo(i)},v6t.prototype.onPropertyChanged=function(e,t){},X$e([i()],v6t.prototype,"created",void 0);var y6t,Wo=X$e([Bt],v6t);function v6t(e,t){return y6t.call(this,e,t)||this}b6t=function(e,t){return(b6t=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])}))(e,t)};var b6t,w6t,C6t,Met=function(e,t){function i(){this.constructor=e}b6t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Cet=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},S6t="e-aiassist-header-text e-assist-view-header",ts=(Met(A6t,w6t=n),Cet([e(null)],A6t.prototype,"prompt",void 0),Cet([e("")],A6t.prototype,"response",void 0),Cet([e(null)],A6t.prototype,"isResponseHelpful",void 0),A6t);function A6t(){return null!==w6t&&w6t.apply(this,arguments)||this}(zmt=C6t=C6t||{}).Assist="Assist",zmt.Custom="Custom";Met(I6t,x6t=n),Cet([e("Assist")],I6t.prototype,"type",void 0),Cet([e("")],I6t.prototype,"name",void 0),Cet([e()],I6t.prototype,"iconCss",void 0),Cet([e()],I6t.prototype,"viewTemplate",void 0);var x6t,det=I6t;function I6t(){return null!==x6t&&x6t.apply(this,arguments)||this}Met(E6t,T6t=n),Cet([e("100%")],E6t.prototype,"width",void 0),Cet([kt([],vft)],E6t.prototype,"items",void 0),Cet([i()],E6t.prototype,"itemClicked",void 0);var T6t,q$e=E6t;function E6t(){return null!==T6t&&T6t.apply(this,arguments)||this}Met(M6t,D6t=n),Cet([e("100%")],M6t.prototype,"width",void 0),Cet([kt([],vft)],M6t.prototype,"items",void 0),Cet([i()],M6t.prototype,"itemClicked",void 0);var D6t,h=M6t;function M6t(){return null!==D6t&&D6t.apply(this,arguments)||this}Met(P6t,k6t=Wo),P6t.prototype.preRender=function(){this.element.id||(this.element.id=D("e-"+this.getModuleName()))},P6t.prototype.getDirective=function(){return"EJS-AIASSISTVIEW"},P6t.prototype.getModuleName=function(){return"aiassistview"},P6t.prototype.getPersistData=function(){return this.addOnPersist([])},P6t.prototype.render=function(){this.renderPromptView()},P6t.prototype.renderPromptView=function(){this.setDimension(this.element,this.width,this.height),this.renderViews(),this.renderToolbar(),this.updateTextAreaObject(this.textareaObj),this.wireEvents()},P6t.prototype.renderToolbar=function(){this.updateHeaderToolbar(),this.assistViewTemplateIndex<0?this.displayContents.unshift(this.contentWrapper):this.displayContents.unshift(this.assistCustomSection),this.previousElement=this.displayContents[this.activeView],this.renderHeaderToolbar(),this.viewWrapper=this.element.querySelector(".e-view-content"),this.updateActiveView(),this.addCssClass(this.element,this.cssClass),this.updateHeader(this.showHeader,this.toolbarHeader,this.viewWrapper),this.aiAssistViewRendered=!0,this.addRtlClass(this.element,this.enableRtl)},P6t.prototype.renderViews=function(){this.assistViewTemplateIndex=-1,this.aiAssistViewRendered=!1,this.isAssistView=!1,this.isOutputRenderingStop=!1,this.isResponseRequested=!1,this.renderViewSections(this.element,"e-view-header","e-view-content");var e,t,i=!1,n=1;if(0<this.views.length)for(var o=0;o<this.views.length;o++)"assist"!==this.views[parseInt(o.toString(),10)].type.toLocaleLowerCase()||i?"custom"===this.views[parseInt(o.toString(),10)].type.toLocaleLowerCase()&&(t=this.createElement("div",{className:"e-customview-content-section-"+n+" e-custom-view"}),this.getContextObject("customViewTemplate",t,-1,o),this.displayContents.push(t),this.toolbarItems.push({text:this.views[parseInt(o.toString(),10)].name||"",prefixIcon:this.views[parseInt(o.toString(),10)].iconCss||"",cssClass:"e-aiassist-header-text e-custom-view-header",htmlAttributes:{"data-index":this.element.id+"_view_"+n.toString()}}),n++):(e={text:this.views[parseInt(o.toString(),10)].name||"AI Assist",prefixIcon:this.views[parseInt(o.toString(),10)].iconCss||"e-icons e-assistview-icon",cssClass:S6t,htmlAttributes:{"data-index":this.element.id+"_view_0"}},this.toolbarItems.unshift(e),this.views[parseInt(o.toString(),10)].viewTemplate&&(this.assistViewTemplateIndex=o),this.isAssistView=i=!0);0!==this.views.length&&i||(e={text:"AI Assist",prefixIcon:"e-icons e-assistview-icon",cssClass:S6t,htmlAttributes:{"data-index":this.element.id+"_view_0"}},this.toolbarItems.unshift(e),i=!0),0<=this.assistViewTemplateIndex&&this.views[this.assistViewTemplateIndex].viewTemplate?(this.assistCustomSection=this.createElement("div",{attrs:{class:"e-assistview-content-section","data-index":this.element.id+"_view_0"}}),this.getContextObject("assistViewTemplate",this.assistCustomSection,-1,this.assistViewTemplateIndex)):this.renderDefaultView()},P6t.prototype.renderHeaderToolbar=function(){var n=this,e=(this.toolbar=new U3({items:this.toolbarItems,height:"100%",enableRtl:this.enableRtl,clicked:function(e){var t,i={item:{type:e.item.type,text:e.item.text,iconCss:e.item.prefixIcon,cssClass:e.item.cssClass,tooltip:e.item.tooltipText,template:e.item.template,disabled:e.item.disabled,visible:e.item.visible,align:e.item.align,tabIndex:e.item.tabIndex},event:e.originalEvent,cancel:!1};n.toolbarSettings.itemClicked&&n.toolbarSettings.itemClicked.call(n,i),i.cancel||e.item.htmlAttributes&&parseInt(e.item.htmlAttributes["data-index"].split(n.element.id+"_view_")[1],10)!==n.activeView&&(i=n.isProtectedOnChange,n.isProtectedOnChange=!0,t=n.getIndex(n.activeView),n.activeView=parseInt(e.item.htmlAttributes["data-index"].split(n.element.id+"_view_")[1],10),n.updateActiveView(t),n.isProtectedOnChange=i)}}),this.toolbarHeader=this.element.querySelector(".e-view-header"),this.createElement("div"));this.toolbar.appendTo(e),this.toolbar.element.setAttribute("aria-label","assist-view-toolbar-header"),this.toolbarHeader.appendChild(e)},P6t.prototype.updateHeaderToolbar=function(){var e;0<this.toolbarSettings.items.length&&(e=this.toolbarSettings.items.map(function(e){return{type:e.type,template:e.template,disabled:e.disabled,cssClass:e.cssClass,visible:e.visible,tooltipText:e.tooltip,prefixIcon:e.iconCss,text:e.text,align:e.align}}),this.toolbarItems=this.toolbarItems.concat(e))},P6t.prototype.getIndex=function(e){return e>this.views.length-(this.isAssistView?1:0)||e<0?0:e},P6t.prototype.updateActiveView=function(e){var t=this.getIndex(this.activeView);this.aiAssistViewRendered?e!==t&&(this.removePreviousView(e,t),this.appendView(t)):(this.appendView(t),this.toolbar.tbarEle[parseInt(t.toString(),10)]&&this.toolbar.tbarEle[parseInt(t.toString(),10)].classList.add("e-active")),this.previousElement=this.displayContents[parseInt(t.toString(),10)]},P6t.prototype.appendView=function(e){0===e&&this.assistViewTemplateIndex<0?this.viewWrapper.append(this.contentWrapper,this.stopResponding,this.footer):0===e&&0<=this.assistViewTemplateIndex?this.viewWrapper.append(this.assistCustomSection):this.viewWrapper.append(this.displayContents[parseInt(e.toString(),10)])},P6t.prototype.removePreviousView=function(e,t){this.viewWrapper.removeChild(this.previousElement),0===e&&this.assistViewTemplateIndex<0&&(this.viewWrapper.removeChild(this.stopResponding),this.viewWrapper.removeChild(this.footer)),this.toolbar.tbarEle[parseInt(t.toString(),10)]&&this.toolbar.tbarEle[parseInt(t.toString(),10)].classList.add("e-active"),0<=e&&this.toolbar.tbarEle[parseInt(e.toString(),10)]&&this.toolbar.tbarEle[parseInt(e.toString(),10)].classList.remove("e-active")},P6t.prototype.renderDefaultView=function(){var e=this.element.querySelector(".e-view-content"),e=(this.createViewComponents(e),this.contentWrapper=this.element.querySelector(".e-views"),this.contentWrapper.setAttribute("data-index",this.element.id+"_view_0"),this.element.querySelector(".e-view-container")),t=(this.content=this.getElement("contentContainer"),this.footer=this.getElement("footer"),"e-footer "+(this.footerTemplate?"e-footer-template":""));this.footer.className=t,this.renderContent(),this.renderAssistViewFooter(),this.renderBannerView(this.bannerTemplate,e,"bannerTemplate"),e.append(this.content),this.renderStopResponding()},P6t.prototype.renderStopResponding=function(){this.stopResponding=this.createElement("div",{attrs:{class:"e-stop-response",tabIndex:"0","aria-label":"Stop Responding",role:"button"}});var e=this.createElement("span",{className:"e-icons e-assist-stop"});this.stopRespondingContent=this.createElement("span",{className:"e-stop-response-text"}),this.l10n=new Cn("aiassistview",{stopResponseText:"Stop Responding"},this.locale),this.updateStopRespondingTitle(),this.appendChildren(this.stopResponding,e,this.stopRespondingContent)},P6t.prototype.updateStopRespondingTitle=function(){this.l10n.setLocale(this.locale),this.stopRespondingContent.textContent=this.l10n.getConstant("stopResponseText")},P6t.prototype.renderContent=function(){this.renderSuggestions(this.promptSuggestions,this.promptSuggestionsHeader,this.promptSuggestionItemTemplate,"promptSuggestion","promptSuggestionItemTemplate",this.onSuggestionClick),this.renderOutputContent(),this.outputElement&&this.renderSkeleton()},P6t.prototype.renderOutputContent=function(e){var t,i=this;this.outputElement=this.getElement("outputElement"),0===this.responseToolbarSettings.items.length&&(t=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.responseToolbarSettings.items=[{iconCss:"e-icons e-assist-copy",tooltip:"Copy",cssClass:"check"},{iconCss:"e-icons e-assist-like",tooltip:"Like"},{iconCss:"e-icons e-assist-dislike",tooltip:"Dislike"}],this.isProtectedOnChange=t),this.prompts&&this.prompts.forEach(function(e,t){i.renderOutputContainer(e.prompt,e.response,t)}),this.suggestionsElement&&this.content.contains(this.suggestionsElement)?this.content.insertBefore(this.outputElement,this.suggestionsElement):this.content.appendChild(this.outputElement),e&&(this.aiAssistViewRendered=!0)},P6t.prototype.renderAssistViewFooter=function(){this.textareaObj=this.renderFooterContent(this.footerTemplate,this.footer,this.prompt,this.promptPlaceholder,this.showClearButton,"e-assist-textarea");this.footerTemplate||(this.sendIcon=this.renderSendIcon("e-assist-send e-icons disabled",this.footer)),this.textareaObj&&(this.textareaObj.input=this.handleInput.bind(this),this.activateSendIcon(this.textareaObj.value.length))},P6t.prototype.handleInput=function(e){var t=this.isProtectedOnChange,t=(this.isProtectedOnChange=!0,this.prompt=e.value,this.isProtectedOnChange=t,this.activateSendIcon(e.value.length),this.updateTextAreaObject(this.textareaObj),{value:e.value,previousValue:e.previousValue,event:e.event,element:this.textareaObj.element});this.trigger("promptChanged",t)},P6t.prototype.activateSendIcon=function(e){this.sendIcon.classList.toggle("disabled",0===e),this.sendIcon.classList.toggle("enabled",0<e)},P6t.prototype.footerKeyHandler=function(e){this.keyHandler(e,"footer")},P6t.prototype.stopResponseKeyHandler=function(e){this.keyHandler(e,"stopresponse")},P6t.prototype.wireEvents=function(){this.wireFooterEvents(this.sendIcon,this.footer,this.footerTemplate,this.textareaObj),this.stopResponding&&(E.add(this.stopResponding,"click",this.respondingStopper,this),E.add(this.stopResponding,"keydown",this.stopResponseKeyHandler,this))},P6t.prototype.unWireEvents=function(){this.unWireFooterEvents(this.sendIcon,this.footer,this.footerTemplate,this.textareaObj),this.stopResponding&&(E.remove(this.stopResponding,"click",this.respondingStopper),E.remove(this.stopResponding,"keydown",this.stopResponseKeyHandler)),this.detachCodeCopyEventHandler()},P6t.prototype.detachCodeCopyEventHandler=function(){this.preTagElements.forEach(function(e){var t=e.preTag,e=e.handler,t=t.querySelector(".e-code-copy");E.remove(t,"click",e)}),this.preTagElements=[]},P6t.prototype.keyHandler=function(e,t){if("Enter"===e.key&&!e.shiftKey)switch(t){case"footer":e.preventDefault(),this.isResponseRequested||this.onSendIconClick();break;case"stopresponse":this.respondingStopper(e)}},P6t.prototype.respondingStopper=function(e){this.isOutputRenderingStop=!0,this.isResponseRequested=!1,this.lastStreamPrompt="",this.outputElement.hasChildNodes&&this.element.querySelector(".e-loading-body")&&this.outputElement.removeChild(this.skeletonContainer),this.stopResponding.classList.remove("e-btn-active");var t=this.prompts?this.prompts.length-1:-1,e={event:e,prompt:0<=t?this.prompts[parseInt(t.toString(),10)].prompt:"",dataIndex:this.prompts?this.prompts.length-1:-1};this.trigger("stopRespondingClick",e)},P6t.prototype.onSuggestionClick=function(e){this.suggestionsElement.hidden=!0;var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.prompt=e.target.innerText,this.isProtectedOnChange=t,this.onSendIconClick()},P6t.prototype.onSendIconClick=function(){var e,t;!this.isResponseRequested&&this.prompt.trim()&&(this.isResponseRequested=!0,this.lastStreamPrompt="",this.suggestionsElement&&(this.suggestionsElement.hidden=!0),this.isOutputRenderingStop=!1,this.stopResponding.classList.add("e-btn-active"),this.addPrompt(),this.createOutputElement(),e={cancel:!1,responseToolbarItems:this.responseToolbarSettings.items,prompt:this.prompt,promptSuggestions:this.promptSuggestions},this.footerTemplate||(t=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.prompt=this.textareaObj.value="",this.textareaObj.dataBind(),this.isProtectedOnChange=t,this.updateTextAreaObject(this.textareaObj),this.activateSendIcon(this.textareaObj.value.length)),this.trigger("promptRequest",e),this.contentWrapper)&&this.scrollToBottom()},P6t.prototype.addPrompt=function(){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.prompts=this.prompts.concat([{prompt:this.prompt,response:"",isResponseHelpful:null}]),this.isProtectedOnChange=e},P6t.prototype.getContextObject=function(e,t,i,n){var o,r={},s=0<=i?i:-1,a=0<=i?this.prompts[parseInt(s.toString(),10)].prompt:"",l=0<=i?this.prompts[parseInt(s.toString(),10)].response:"";switch(e.toLowerCase()){case"promptitemtemplate":o=this.promptItemTemplate,r={prompt:a,toolbarItems:this.promptToolbarSettings.items,index:s};break;case"responseitemtemplate":o=this.responseItemTemplate,r={prompt:a,response:l,index:s,toolbarItems:this.responseToolbarSettings.items};break;case"customviewtemplate":case"assistviewtemplate":o=this.views[parseInt(n.toString(),10)].viewTemplate||""}this.updateContent(o,t,r,e)},P6t.prototype.createOutputElement=function(){this.outputSuggestionEle=this.createElement("div",{attrs:{id:"e-prompt-item_"+(this.prompts.length-1),class:"e-prompt-container "+(this.promptItemTemplate?"e-prompt-item-template":"")}}),this.renderPrompt(this.prompt,this.prompts.length-1),this.outputElement.append(this.outputSuggestionEle,this.skeletonContainer),this.skeletonContainer.hidden=!1},P6t.prototype.renderOutputContainer=function(e,t,i,n,o){var r=this.createElement("div",{attrs:{id:"e-response-item_"+i,class:"e-output-container "+(this.responseItemTemplate?"e-response-item-template":"")}});this.renderOutput(r,e,t,n,i,o),e&&this.outputElement.append(this.outputSuggestionEle),this.outputElement.append(r),this.stopResponding&&o&&this.stopResponding.classList.remove("e-btn-active"),this.isOutputRenderingStop||this.content.contains(this.suggestionsElement)||!this.suggestionsElement||this.content.append(this.suggestionsElement)},P6t.prototype.renderOutput=function(e,t,i,n,o,r){var s=this.createElement("span",{className:"e-output-icon e-icons "+(this.responseIconCss||this.isAssistView&&this.views[0].iconCss||"e-assistview-icon")}),a=this.createElement("div",{className:"e-output"}),n=(this.aiAssistViewRendered&&!n||je(t)||(this.outputSuggestionEle=this.createElement("div",{attrs:{id:"e-prompt-item_"+o,class:"e-prompt-container "+(this.promptItemTemplate?"e-prompt-item-template":"")}}),this.renderPrompt(t,o)),{prompt:t,response:i});n.response?this.responseItemTemplate?(this.getContextObject("responseItemTemplate",a,o),this.outputElement.querySelector(".e-skeleton")&&this.outputElement.removeChild(this.skeletonContainer),this.contentFooterEle&&this.contentFooterEle.classList.remove("e-assist-toolbar-active"),this.renderOutputToolbarItems(o,r),a.append(this.contentFooterEle),e.append(a)):(this.renderOutputTextContainer(n.response,a,o,!1,r),e.append(s,a)):this.aiAssistViewRendered&&(this.outputElement.querySelector(".e-skeleton")&&this.outputElement.removeChild(this.skeletonContainer),this.suggestionsElement)&&(this.suggestionsElement.hidden=!1)},P6t.prototype.renderOutputTextContainer=function(e,t,i,n,o){var r=this;this.contentFooterEle&&this.contentFooterEle.classList.remove("e-assist-toolbar-active"),this.outputContentBodyEle=this.createElement("div",{attrs:{class:"e-content-body",tabindex:"0"}}),n||(this.outputContentBodyEle.innerHTML=e,Array.from(this.outputContentBodyEle.querySelectorAll("pre")).forEach(function(e){var t=document.createElement("span");t.className="e-icons e-code-copy e-assist-copy",e.insertBefore(t,e.firstChild),r.preTagElements.push({preTag:e,handler:r.getCopyHandler(e)}),E.add(t,"click",r.preTagElements[r.preTagElements.length-1].handler)})),this.renderOutputToolbarItems(i,o),this.appendChildren(t,this.outputContentBodyEle,this.contentFooterEle)},P6t.prototype.getCopyHandler=function(i){return function(){var e=i.innerText,t=(window.navigator.clipboard.writeText(e),i.querySelector(".e-code-copy"));t.className="e-icons e-code-copy e-assist-check",setTimeout(function(){t.className="e-icons e-code-copy e-assist-copy"},1e3)}},P6t.prototype.renderOutputToolbarItems=function(e,t){this.contentFooterEle=this.createElement("div",{className:"e-content-footer e-assist-toolbar-active"});var i=this.createElement("div");this.renderResponseToolbar(e),this.aiAssistViewRendered&&(this.outputElement.querySelector(".e-skeleton")&&this.outputElement.removeChild(this.skeletonContainer),t)&&this.suggestionsElement&&(this.suggestionsElement.hidden=!1),this.responseToolbarEle.appendTo(i),this.responseToolbarEle.element.setAttribute("aria-label","response-toolbar-"+e),this.contentFooterEle.appendChild(i)},P6t.prototype.renderResponseToolbar=function(i){var n=this,e=this.responseToolbarSettings.items.map(function(e){e={type:e.type,visible:e.visible,disabled:e.disabled,tooltipText:e.tooltip,template:e.template,prefixIcon:e.iconCss,text:e.text,cssClass:e.cssClass,align:e.align,width:n.responseToolbarSettings.width};return"e-icons e-assist-like"===e.prefixIcon&&n.prompts[parseInt(i.toString(),10)].isResponseHelpful?e.prefixIcon="e-icons e-assist-like-filled":"e-icons e-assist-dislike"===e.prefixIcon&&!1===n.prompts[parseInt(i.toString(),10)].isResponseHelpful&&(e.prefixIcon="e-icons e-assist-dislike-filled"),e});this.responseToolbarEle=new U3({items:e,clicked:function(e){var t={item:{type:e.item.type,text:e.item.text,iconCss:e.item.prefixIcon,cssClass:e.item.cssClass,tooltip:e.item.tooltipText,template:e.item.template,disabled:e.item.disabled,visible:e.item.visible,align:e.item.align,tabIndex:e.item.tabIndex},event:e.originalEvent,cancel:!1,dataIndex:i};n.responseToolbarSettings.itemClicked&&n.responseToolbarSettings.itemClicked.call(n,t),t.cancel||n.handleItemClick(e,i)}})},P6t.prototype.getClipBoardContent=function(e){var t=document.createElement("div");t.innerHTML=e,t.style.top="0",t.style.left="0",t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([t.innerHTML],{type:"text/html"}),"text/plain":new Blob([t.innerText],{type:"text/plain"})})]),document.body.removeChild(t)},P6t.prototype.handleItemClick=function(e,t){var i,n,o=this,r=(e.item.controlParent.element.querySelector(".e-assist-dislike"),"e-icons e-assist-copy"===e.item.prefixIcon&&(this.getClipBoardContent(this.prompts[parseInt(t.toString(),10)].response),e.item.prefixIcon="e-icons e-assist-check",this.responseToolbarEle.dataBind(),setTimeout(function(){e.item.prefixIcon="e-icons e-assist-copy",o.responseToolbarEle.dataBind()},1e3)),e.item.prefixIcon),s="e-icons e-assist-like-filled"===r||"e-icons e-assist-like"===r,r="e-icons e-assist-dislike-filled"===r||"e-icons e-assist-dislike"===r;(s||r)&&(n=null,s?n=!0!==this.prompts[parseInt(t.toString(),10)].isResponseHelpful||null:r&&(n=!1===this.prompts[parseInt(t.toString(),10)].isResponseHelpful&&null),i=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.prompts[parseInt(t.toString(),10)].isResponseHelpful=n,n=this.prompts[parseInt(t.toString(),10)],t=e.item.controlParent.items,s?!0===n.isResponseHelpful?(e.item.prefixIcon="e-icons e-assist-like-filled",t&&2<t.length&&(t[2].prefixIcon="e-icons e-assist-dislike")):e.item.prefixIcon="e-icons e-assist-like":r&&(!1===n.isResponseHelpful?(e.item.prefixIcon="e-icons e-assist-dislike-filled",t&&1<t.length&&(t[1].prefixIcon="e-icons e-assist-like")):e.item.prefixIcon="e-icons e-assist-dislike"),this.responseToolbarEle.dataBind(),this.isProtectedOnChange=i)},P6t.prototype.renderPrompt=function(e,t){var i=this.createElement("div",{attrs:{class:"e-prompt-text",tabindex:"0"}}),n=this.createElement("div",{className:"e-prompt-content"}),o=this.createElement("div",{className:"e-prompt-toolbar"}),r=this.createElement("div"),s=this.createElement("span",{className:this.promptIconCss?"e-prompt-icon e-icons "+this.promptIconCss:""});this.promptItemTemplate?this.getContextObject("promptItemTemplate",this.outputSuggestionEle,t):(i.innerHTML=e,this.appendChildren(n,i),this.promptIconCss&&n.appendChild(s),this.outputSuggestionEle.append(n)),this.renderPromptToolbar(r,t),o.append(r),this.appendChildren(this.outputSuggestionEle,o)},P6t.prototype.renderPromptToolbar=function(e,i){var t,n=this,o=[];0===this.promptToolbarSettings.items.length?(o=[{prefixIcon:"e-icons e-assist-edit",tooltipText:"Edit"},{prefixIcon:"e-icons e-assist-copy",tooltipText:"Copy"}],t=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.promptToolbarSettings.items=[{iconCss:"e-icons e-assist-edit",tooltip:"Edit"},{iconCss:"e-icons e-assist-copy",tooltip:"Copy"}],this.isProtectedOnChange=t):o=this.promptToolbarSettings.items.map(function(e){return{type:e.type,template:e.template,disabled:e.disabled,cssClass:e.cssClass,visible:e.visible,tooltipText:e.tooltip,prefixIcon:e.iconCss,text:e.text,align:e.align,width:n.promptToolbarSettings.width}}),this.promptToolbarEle=new U3({items:o,clicked:function(e){var t={item:{type:e.item.type,text:e.item.text,iconCss:e.item.prefixIcon,cssClass:e.item.cssClass,tooltip:e.item.tooltipText,template:e.item.template,disabled:e.item.disabled,visible:e.item.visible,align:e.item.align,tabIndex:e.item.tabIndex},event:e.originalEvent,cancel:!1,dataIndex:i};n.promptToolbarSettings.itemClicked&&n.promptToolbarSettings.itemClicked.call(n,t),t.cancel||("e-icons e-assist-edit"===e.item.prefixIcon&&n.onEditIconClick(i),"e-icons e-assist-copy"===e.item.prefixIcon&&(n.getClipBoardContent(n.prompts[parseInt(i.toString(),10)].prompt),e.item.prefixIcon="e-icons e-assist-check",n.promptToolbarEle.dataBind(),setTimeout(function(){e.item.prefixIcon="e-icons e-assist-copy",n.promptToolbarEle.dataBind()},1e3)))}}),this.promptToolbarEle.appendTo(e),this.promptToolbarEle.element.setAttribute("aria-label","prompt-toolbar-"+i)},P6t.prototype.renderSkeleton=function(){this.skeletonContainer=this.createElement("div",{className:"e-output-container"});var e=this.createElement("div",{className:"e-output",styles:"width: 70%;"}),t=this.createElement("span",{className:"e-output-icon e-skeleton e-skeleton-text e-shimmer-wave"}),i=this.createElement("div",{className:"e-loading-body"}),n=this.createElement("div",{className:"e-loading-footer"}),o=[this.createElement("div",{className:"e-skeleton e-skeleton-text e-shimmer-wave",styles:"width: 100%; height: 15px;"}),this.createElement("div",{className:"e-skeleton e-skeleton-text e-shimmer-wave",styles:"width: 75%; height: 15px;"}),this.createElement("div",{className:"e-skeleton e-skeleton-text e-shimmer-wave",styles:"width: 50%; height: 15px;"})],r=o[0],s=o[1],o=o[2],a=this.createElement("div",{className:"e-skeleton e-skeleton-text e-shimmer-wave",styles:"width: 100%; height: 30px;"});this.appendChildren(i,r,s,o),n.append(a),this.appendChildren(e,i,n),this.appendChildren(this.skeletonContainer,t,e)},P6t.prototype.onEditIconClick=function(e){var t;this.textareaObj&&(this.suggestionsElement&&(this.suggestionsElement.hidden=!0),t=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.textareaObj.value=this.prompt=this.prompts[parseInt(e.toString(),10)].prompt,this.textareaObj.dataBind(),this.updateTextAreaObject(this.textareaObj),this.textareaObj.focusIn(),this.isProtectedOnChange=t,this.activateSendIcon(this.prompt.length))},P6t.prototype.updateIcons=function(e,t){var i;void 0===t&&(t=!1),this.outputElement&&(i=t?(e="e-prompt-icon e-icons "+e,this.outputElement.querySelectorAll(".e-prompt-icon")):(e=" e-output-icon e-icons "+e,this.outputElement.querySelectorAll(".e-output-icon")));for(var n=0;n<(i&&i.length);n++)q([i[parseInt(n.toString(),10)]],i[parseInt(n.toString(),10)].classList.toString().trim().split(" ")),U([i[parseInt(n.toString(),10)]],e.trim().split(" "))},P6t.prototype.updateToolbarSettings=function(e){for(var t=this.views.length;t<this.toolbarItems.length;t++)e.items[parseInt(0..toString(),10)]===this.toolbarItems[parseInt(t.toString(),10)]&&this.toolbarItems.splice(t,1);this.updateHeaderToolbar(),this.toolbar.items=this.toolbarItems},P6t.prototype.updateResponse=function(e,t,i,n){!this.responseItemTemplate&&n?((n=n.querySelector(".e-content-body"))&&(n.innerHTML=e),i&&this.suggestionsElement&&(this.suggestionsElement.hidden=!1)):this.renderOutputContainer(void 0,e,t,!1,i)},P6t.prototype.destroy=function(){k6t.prototype.destroy.call(this),this.unWireEvents(),this.destroyAndNullify(this.textareaObj),this.destroyAndNullify(this.responseToolbarEle),this.destroyAndNullify(this.promptToolbarEle),this.destroyAndNullify(this.toolbar),this.destroyAssistView(),ue(this.viewWrapper),this.viewWrapper=null,this.aiAssistViewRendered=null,this.assistViewTemplateIndex=null,this.toolbarItems=[],this.displayContents=[],this.isOutputRenderingStop=null,this.isResponseRequested=null,this.suggestionHeader=null,this.previousElement=null,this.assistCustomSection=null,this.preTagElements=[],this.toolbarSettings=this.promptToolbarSettings=this.responseToolbarSettings={},this.cssClass&&q([this.element],this.cssClass.split(" ")),this.element.classList.remove("e-rtl")},P6t.prototype.destroyAssistView=function(){for(var e=0,t=["toolbarHeader","sendIcon","suggestions","skeletonContainer","outputElement","outputSuggestionEle","contentFooterEle","footer","assistCustomSection","content","stopRespondingContent","stopResponding","contentWrapper"];e<t.length;e++){var i=t[e];this.removeAndNullify(this[i]),this[i]=null}},P6t.prototype.executePrompt=function(e){var t;!je(e)&&0<e.trim().length&&(t=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.prompt=e,this.isProtectedOnChange=t,this.onSendIconClick())},P6t.prototype.addPromptResponse=function(e,t){void 0===t&&(t=!0);var i,n,o=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.isOutputRenderingStop||(i=this.element.querySelector("#e-response-item_"+(this.prompts.length-1)),n=this.prompts[this.prompts.length-1],"string"==typeof e&&(this.isResponseRequested||(this.prompts=this.prompts.concat([{prompt:null,response:null,isResponseHelpful:null}]),n=this.prompts[this.prompts.length-1]),n.response=e,this.updateResponse(n.response,this.prompts.length-1,t,i)),"object"==typeof e&&(e={prompt:e.prompt,response:e.response,isResponseHelpful:je(e.isResponseHelpful)?null:e.isResponseHelpful},this.prompt===e.prompt||this.lastStreamPrompt===e.prompt?(n.response=e.response,n.isResponseHelpful=e.isResponseHelpful,this.updateResponse(n.response,this.prompts.length-1,t,i)):(this.prompts=this.prompts.concat([e]),this.renderOutputContainer(e.prompt,e.response,this.prompts.length-1,!0,t)),t||(this.lastStreamPrompt=e.prompt)),t&&this.stopResponding&&this.stopResponding.classList.remove("e-btn-active"),this.isResponseRequested=!t),this.isProtectedOnChange=o},P6t.prototype.scrollToBottom=function(){this.updateScroll(this.contentWrapper)},P6t.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"width":case"height":this.setDimension(this.element,this.width,this.height);break;case"cssClass":this.updateCssClass(this.element,e.cssClass,t.cssClass);break;case"promptIconCss":this.updateIcons(e.promptIconCss,!0);break;case"responseIconCss":this.updateIcons(e.responseIconCss);break;case"showHeader":this.updateHeader(this.showHeader,this.toolbarHeader,this.viewWrapper);break;case"promptSuggestions":this.suggestionsElement&&this.suggestionsElement.remove(),this.isOutputRenderingStop||this.renderSuggestions(this.promptSuggestions,this.promptSuggestionsHeader,this.promptSuggestionItemTemplate,"promptSuggestion","promptSuggestionItemTemplate",this.onSuggestionClick);break;case"showClearButton":this.textareaObj.showClearButton=this.showClearButton;break;case"promptPlaceholder":this.textareaObj.placeholder=this.promptPlaceholder;break;case"promptSuggestionsHeader":this.suggestionHeader.innerHTML=this.promptSuggestionsHeader,this.element.querySelector(".e-suggestions .e-suggestion-header")||this.suggestionsElement.append(this.suggestionHeader);break;case"activeView":var o=this.getIndex(t.activeView);this.updateActiveView(o);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"]("e-rtl"),je(this.toolbar)||(this.toolbar.enableRtl=this.enableRtl,this.toolbar.dataBind());break;case"toolbarSettings":this.updateToolbarSettings(t.toolbarSettings);break;case"promptToolbarSettings":case"responseToolbarSettings":case"prompts":this.isOutputRenderingStop=!1,this.outputElement&&ue(this.outputElement),this.stopResponding&&this.stopResponding.classList.remove("e-btn-active"),this.aiAssistViewRendered=!1,this.renderOutputContent(!0),this.detachCodeCopyEventHandler();break;case"prompt":this.footerTemplate||(this.textareaObj.value=this.prompt,this.textareaObj.dataBind(),this.updateTextAreaObject(this.textareaObj));break;case"locale":this.assistViewTemplateIndex<0&&this.updateStopRespondingTitle()}},Cet([e("")],P6t.prototype,"prompt",void 0),Cet([e("Type prompt for assistance...")],P6t.prototype,"promptPlaceholder",void 0),Cet([kt([],ts)],P6t.prototype,"prompts",void 0),Cet([e([])],P6t.prototype,"promptSuggestions",void 0),Cet([e("")],P6t.prototype,"promptSuggestionsHeader",void 0),Cet([e(!0)],P6t.prototype,"showHeader",void 0),Cet([t({items:[]},Rft)],P6t.prototype,"toolbarSettings",void 0),Cet([e(0)],P6t.prototype,"activeView",void 0),Cet([e(null)],P6t.prototype,"promptIconCss",void 0),Cet([e(null)],P6t.prototype,"responseIconCss",void 0),Cet([e("100%")],P6t.prototype,"width",void 0),Cet([e("100%")],P6t.prototype,"height",void 0),Cet([e("")],P6t.prototype,"cssClass",void 0),Cet([kt([],det)],P6t.prototype,"views",void 0),Cet([t({width:null,items:[]},q$e)],P6t.prototype,"promptToolbarSettings",void 0),Cet([t({width:null,items:[]},h)],P6t.prototype,"responseToolbarSettings",void 0),Cet([e(!1)],P6t.prototype,"showClearButton",void 0),Cet([e("")],P6t.prototype,"footerTemplate",void 0),Cet([e("")],P6t.prototype,"promptItemTemplate",void 0),Cet([e("")],P6t.prototype,"responseItemTemplate",void 0),Cet([e("")],P6t.prototype,"promptSuggestionItemTemplate",void 0),Cet([e("")],P6t.prototype,"bannerTemplate",void 0),Cet([i()],P6t.prototype,"promptRequest",void 0),Cet([i()],P6t.prototype,"promptChanged",void 0),Cet([i()],P6t.prototype,"stopRespondingClick",void 0);var k6t,d2t=Cet([Bt],P6t);function P6t(e,t){e=k6t.call(this,e,t)||this;return e.toolbarItems=[],e.displayContents=[],e.preTagElements=[],e}B6t=function(e,t){return(B6t=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])}))(e,t)};var B6t,F6t,u2t=function(e,t){function i(){this.constructor=e}B6t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},L6t=function(){return(L6t=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},mft=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},cft=(u2t(R6t,F6t=n),mft([e("")],R6t.prototype,"iconCss",void 0),mft([e("")],R6t.prototype,"text",void 0),mft([e("")],R6t.prototype,"tooltip",void 0),R6t);function R6t(){return null!==F6t&&F6t.apply(this,arguments)||this}u2t(N6t,O6t=n),mft([e("")],N6t.prototype,"id",void 0),mft([e("Default")],N6t.prototype,"user",void 0),mft([e("")],N6t.prototype,"avatarUrl",void 0),mft([e("")],N6t.prototype,"avatarBgColor",void 0),mft([e("")],N6t.prototype,"cssClass",void 0);var O6t,SOt=N6t;function N6t(){return null!==O6t&&O6t.apply(this,arguments)||this}u2t(_6t,V6t=n),mft([e("")],_6t.prototype,"id",void 0),mft([e("")],_6t.prototype,"text",void 0),mft([t({},SOt)],_6t.prototype,"author",void 0),mft([e("")],_6t.prototype,"timeStamp",void 0),mft([e("")],_6t.prototype,"timeStampFormat",void 0),mft([t({},cft)],_6t.prototype,"status",void 0);var V6t,IOt=_6t;function _6t(){return null!==V6t&&V6t.apply(this,arguments)||this}u2t(z6t,H6t=Wo),z6t.prototype.preRender=function(){this.element.id||(this.element.id=D("e-"+this.getModuleName()))},z6t.prototype.getDirective=function(){return"EJS-CHATUI"},z6t.prototype.getModuleName=function(){return"chat-ui"},z6t.prototype.getPersistData=function(){return this.addOnPersist([])},z6t.prototype.render=function(){this.renderChatUIView()},z6t.prototype.renderChatUIView=function(){this.intl=new Ti,this.setDimension(this.element,this.width,this.height),this.renderViewSections(this.element,"e-chat-header","e-chat-content"),this.viewWrapper=this.element.querySelector(".e-chat-content"),this.chatHeader=this.element.querySelector(".e-chat-header"),this.renderChatHeader(),this.renderChatContentElement(),this.renderChatSuggestionsElement(),this.renderChatFooterContent(),this.addCssClass(this.element,this.cssClass),this.addRtlClass(this.element,this.enableRtl),this.updateHeader(this.showHeader,this.chatHeader,this.viewWrapper),(je(this.messages)||this.messages.length<=0)&&(this.renderBannerView(this.emptyChatTemplate,this.messageWrapper,"emptyChatTemplate"),this.isEmptyChatTemplateRendered=!je(this.messageWrapper.querySelector(".e-empty-chat-template"))),this.updateTextAreaObject(this.textareaObj),this.wireEvents(),this.renderTypingIndicator(),this.updateScrollPosition(!1,0)},z6t.prototype.updateScrollPosition=function(e,t){var i=this;this.isReact||this.isAngular?setTimeout(function(){e?i.handleAutoScroll():i.scrollToBottom()},t):this.scrollToBottom()},z6t.prototype.renderChatHeader=function(){var e,t;this.headerText&&(e=this.createElement("div",{className:"e-header"}),this.headerIconCss&&(t=this.createElement("span",{className:"e-header-icon e-icons "+this.headerIconCss}),e.appendChild(t)),(t=this.createElement("div",{className:"e-header-text"})).innerHTML=this.headerText,e.appendChild(t),this.chatHeader.appendChild(e),this.renderChatHeaderToolbar(e))},z6t.prototype.renderChatHeaderToolbar=function(e){var t,i,n=this;!je(this.headerToolbar)&&0<this.headerToolbar.items.length&&(t=this.createElement("div",{className:"e-chat-toolbar"}),i=this.headerToolbar.items.map(function(e){return{type:e.type,template:e.template,disabled:e.disabled,cssClass:e.cssClass,visible:e.visible,tooltipText:e.tooltip,prefixIcon:e.iconCss,text:e.text,align:e.align}}),this.toolbar=new U3({items:i,height:"100%",enableRtl:this.enableRtl,clicked:function(e){e={item:{type:e.item.type,text:e.item.text,iconCss:e.item.prefixIcon,cssClass:e.item.cssClass,tooltip:e.item.tooltipText,template:e.item.template,disabled:e.item.disabled,visible:e.item.visible,align:e.item.align,tabIndex:e.item.tabIndex},event:e.originalEvent,cancel:!1};n.headerToolbar.itemClicked&&n.headerToolbar.itemClicked.call(n,e)}}),this.toolbar.appendTo(t),e.appendChild(t))},z6t.prototype.updateHeaderToolbar=function(){var e=this.chatHeader.querySelector(".e-header");je(this.toolbar)?this.renderChatHeaderToolbar(e):(e=this.headerToolbar.items.map(function(e){return{type:e.type,template:e.template,disabled:e.disabled,cssClass:e.cssClass,visible:e.visible,tooltipText:e.tooltip,prefixIcon:e.iconCss,text:e.text,align:e.align}}),this.toolbar.items=e)},z6t.prototype.renderChatContentElement=function(){this.messageWrapper=this.createElement("div",{className:"e-message-wrapper",attrs:{tabindex:"0"}}),this.viewWrapper.prepend(this.messageWrapper),this.content=this.createElement("div",{className:"e-typing-suggestions"}),this.viewWrapper.append(this.content),this.renderScrollDown(),this.setChatMsgId(),this.renderMessageGroup(this.messageWrapper)},z6t.prototype.setChatMsgId=function(){var e,i=this;this.messages&&0<this.messages.length&&(e=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.messages=this.messages.map(function(e,t){return L6t({},e,{id:e.id||i.element.id+"-message-"+(t+1)})}),this.isProtectedOnChange=e)},z6t.prototype.renderScrollDown=function(){var e=this.createElement("button",{id:"scrollDownButton"});this.downArrowIcon=new zb({iconCss:"e-icons e-chat-scroll-down",position:"BottomRight",target:this.content,isPrimary:!1}),this.downArrowIcon.appendTo(e)},z6t.prototype.loadBatch=function(){for(var e=this.startIndex-1;0<=e;e--){var t=e,i=e===this.messages.length-1?-1:t+1,n=(this.updateMessageTimeFormats(this.messages[parseInt(e.toString(),10)],t),this.getMessageDate(t));n.setHours(0,0,0,0),0<=Math.min(t,i)&&((o=this.getMessageDate(i)).setHours(0,0,0,0),n.getTime()===o.getTime())&&(o=this.messageWrapper.querySelectorAll(".e-timebreak")[0])&&o.remove(),this.renderGroup(this.messageWrapper,this.messages[parseInt(e.toString(),10)],!0,t,i),this.showTimeBreak&&this.messageWrapper.prepend(this.createTimebreakElement(n));var o=window.innerHeight*this.multiplier;if(this.startIndex=e,this.messageWrapper.scrollHeight>o)break}},z6t.prototype.renderMessageGroup=function(i){var n=this;this.loadOnDemand?this.messages&&this.messages.length<=0||(mA({target:this.messageWrapper}),this.startIndex=this.messages.length,this.loadBatch()):this.messages.forEach(function(e,t){n.renderGroup(i,e,!1,t,t-1)})},z6t.prototype.isTimeBreakAdded=function(e,t){return(t?e.firstElementChild:e.lastElementChild).classList.contains("e-timebreak")},z6t.prototype.getLastUser=function(e){return 0<=e?this.messages[parseInt(e.toString(),10)].author.id:""},z6t.prototype.renderGroup=function(e,t,i,n,o){var r,s;i||(this.updateMessageTimeFormats(t,n),this.handleTimeBreak(o,n,i)),t.author.id===this.user.id?(s=this.showTimeBreak&&this.isTimeBreakAdded(e,i),t.author.id!==this.getLastUser(o)||s?(r=this.createElement("div",{className:"e-message-group e-right "+(this.messageTemplate?"e-message-item-template":"")}),this.manageChatContent(i,e,r)):(s=this.element.querySelectorAll(".e-message-group.e-right").length,r=this.element.querySelectorAll(".e-message-group.e-right")[i?0:s-1]),this.addGroupItems(t,r,!1,!0,n,i)):this.getLastUser(o)!==t.author.id||this.isTimeVaries(n,o)?(r=this.createElement("div",{className:"e-message-group e-left "+(this.messageTemplate?"e-message-item-template":"")}),s=this.createAvatarIcon(t.author,!1),this.messageTemplate||r.prepend(s),this.manageChatContent(i,e,r),this.loadOnDemand?this.loadLeftGroupOnDemand(t,i,n,r):(this.createLeftGroupItems(r,t,n),this.addGroupItems(t,r,!0,!1,n,i))):(o=this.element.querySelectorAll(".e-message-group.e-left").length,r=this.element.querySelectorAll(".e-message-group.e-left")[i?0:o-1],i?this.loadLeftGroupOnDemand(t,i,n,r):this.addGroupItems(t,r,!1,!1,n,i))},z6t.prototype.isTimeVaries=function(e,t){e=this.getMessageDate(e),e.setHours(0,0,0,0),t=this.getMessageDate(t);return t.setHours(0,0,0,0),e.getTime()!==t.getTime()},z6t.prototype.loadLeftGroupOnDemand=function(e,t,i,n){(!!this.messages[parseInt((i-1).toString(),10)]?this.messages[parseInt((i-1).toString(),10)].author.id:"")!==e.author.id||this.isTimeVaries(i,i-1)?(this.addGroupItems(e,n,!0,!1,i,t),this.createLeftGroupItems(n,e,i)):this.addGroupItems(e,n,!1,!1,i,t)},z6t.prototype.createLeftGroupItems=function(e,t,i){var n,o;this.messageTemplate||(n=this.createElement("div",{className:"e-message-header-container"}),(o=this.createElement("div",{className:"e-message-header"})).innerHTML=t.author.user,t=this.getTimeStampElement(t.timeStamp||new Date,t.timeStampFormat,i),this.appendChildren(n,o,t),this.insertBeforeChildren(e,n))},z6t.prototype.createAvatarIcon=function(e,t){var i=e.user.trim(),n=i.split(" "),n=1<n.length?""+n[0][0]+n[n.length-1][0]:i[0],t=this.createElement(je(e.avatarUrl)||""===e.avatarUrl?"span":"img",{className:" "+(t?"e-user-icon":"e-message-icon")+" "+e.cssClass});return e.avatarBgColor&&(t.style.backgroundColor=e.avatarBgColor),je(e.avatarUrl)||""===e.avatarUrl?t.innerHTML=n:(t.src=e.avatarUrl,t.alt=i),t},z6t.prototype.getTimeStampElement=function(e,t,i){e=this.getFormattedTime(e,t);return this.createElement("div",{className:"e-time",innerHTML:this.showTimeStamp?e:""})},z6t.prototype.updateTimeFormats=function(e,t,i){var n;this.messages[parseInt(i.toString(),10)]&&(n=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.messages[parseInt(i.toString(),10)].timeStamp=this.intl.parseDate(t,{format:"dd/MM/yyyy hh:mm a"}),this.messages[parseInt(i.toString(),10)].timeStampFormat=e,this.isProtectedOnChange=n)},z6t.prototype.getFormattedTime=function(e,t){return e="string"==typeof e?new Date(e):e,this.intl.formatDate(e,{format:this.getFormat(t)})},z6t.prototype.getFormat=function(e){return!je(e)&&0<e.length?e:!je(this.timeStampFormat)&&this.timeStampFormat.length?this.timeStampFormat:"dd/MM/yyyy hh:mm a"},z6t.prototype.addGroupItems=function(e,t,i,n,o,r){var s=this.createElement("div",{className:"e-message-item",id:""+e.id}),a=this.createElement("div",{className:"e-status-wrapper"}),l=this.getTimeStampElement(e.timeStamp||new Date,e.timeStampFormat,o),h=this.createElement("div",{className:"e-text",innerHTML:e.text});this.messageTemplate?this.getContextObject("messageTemplate",t,o,e):(i||s.appendChild(l),n?(o=this.createElement("div",{className:"e-status-item"}),i=this.createElement("span",{attrs:{class:"e-status-icon "+(e.status?e.status.iconCss:""),title:""+(e.status?e.status.tooltip:"")}}),l=this.createElement("div",{innerHTML:e.status?e.status.text:"",className:"e-status-text"}),this.appendChildren(o,h,i),this.appendChildren(a,o,l),s.appendChild(a)):s.appendChild(h),this.manageChatContent(r,t,s))},z6t.prototype.manageChatContent=function(e,t,i){e?t.prepend(i):t.appendChild(i)},z6t.prototype.createTimebreakElement=function(e){var t=this.createElement("div",{className:"e-timebreak "+(this.timeBreakTemplate?"e-timebreak-template":"")}),i=this.getFormattedTime(e,"MMMM d, yyyy");return this.timeBreakTemplate?this.getContextObject("timeBreakTemplate",t,null,null,e):((e=this.createElement("span",{className:"e-timestamp"})).innerHTML=i,t.appendChild(e)),t},z6t.prototype.handleTimeBreak=function(e,t,i){var n;this.showTimeBreak&&((n=this.getMessageDate(t)).setHours(0,0,0,0),-1===e?this.messageWrapper.appendChild(this.createTimebreakElement(n)):0<t&&((t=this.getMessageDate(e)).setHours(0,0,0,0),n.getTime()===t.getTime()||i||this.messageWrapper.appendChild(this.createTimebreakElement(n))))},z6t.prototype.renderNewMessage=function(e,t){var i;this.isEmptyChatTemplateRendered&&(i=this.messageWrapper.querySelector(".e-empty-chat-template"),this.messageWrapper.removeChild(i),this.isEmptyChatTemplateRendered=!1),this.renderGroup(this.messageWrapper,e,!1,t,t-1)},z6t.prototype.loadMoreMessages=function(){var e,t=this;this.startIndex<=0||(e=this.messageWrapper.scrollHeight-this.messageWrapper.scrollTop,kA(this.messageWrapper),setTimeout(function(){BA(t.messageWrapper),t.loadBatch(),t.messageWrapper.scrollTop=t.messageWrapper.scrollHeight-e},1e3))},z6t.prototype.updateMessageTimeFormats=function(e,t){var i=this.getFormattedTime(e.timeStamp||new Date,"dd/MM/yyyy hh:mm a");this.updateTimeFormats(e.timeStampFormat,i,t)},z6t.prototype.getMessageDate=function(e){return new Date(this.messages[parseInt(e.toString(),10)].timeStamp)},z6t.prototype.renderChatSuggestionsElement=function(){!je(this.suggestions)&&0<this.suggestions.length&&this.renderSuggestions(this.suggestions,null,this.suggestionTemplate,"suggestion","suggestionTemplate",this.onSuggestionClick)},z6t.prototype.handleSuggestionUpdate=function(){this.suggestionsElement&&this.suggestionsElement.remove(),!je(this.suggestions)&&0<this.suggestions.length&&this.renderSuggestions(this.suggestions,null,this.suggestionTemplate,"suggestion","suggestionTemplate",this.onSuggestionClick),this.toggleScrollIcon()},z6t.prototype.onSuggestionClick=function(e){this.suggestionsElement.hidden=!0,this.textareaObj.value=e.target.innerText,this.onSendIconClick(e)},z6t.prototype.renderChatFooterContent=function(){this.footer=this.getElement("footer");var e="e-footer "+(this.footerTemplate?"e-footer-template":"");this.footer.className=e,this.renderChatFooter(),this.viewWrapper.append(this.footer),this.updateFooter(this.showFooter,this.footer)},z6t.prototype.renderChatFooter=function(){var t=this;this.textareaObj=this.renderFooterContent(this.footerTemplate,this.footer,"",this.placeholder,!1,"e-chat-textarea");this.footerTemplate||(this.sendIcon=this.renderSendIcon("e-chat-send e-icons disabled",this.footer)),this.textareaObj&&(this.textareaObj.input=this.handleInput.bind(this),this.textareaObj.blur=function(e){return t.triggerUserTyping(e.event,e.value)},je(this.textareaObj.value)||this.activateSendIcon(this.textareaObj.value.length))},z6t.prototype.handleInput=function(e){this.triggerUserTyping(e.event,e.value),this.activateSendIcon(e.value.length),this.updateTextAreaObject(this.textareaObj)},z6t.prototype.triggerUserTyping=function(e,t){e={event:e,message:t,user:this.user,isTyping:"blur"!==e.type&&0<t.length};this.trigger("userTyping",e)},z6t.prototype.renderTypingIndicator=function(){var t=this;if(this.l10n=new Cn("chat-ui",{oneUserTyping:"{0} is typing",twoUserTyping:"{0} and {1} are typing",threeUserTyping:"{0}, {1}, and {2} other are typing",multipleUsersTyping:"{0}, {1}, and {2} others are typing"},this.locale),this.indicatorWrapper&&this.indicatorWrapper.remove(),this.typingUsers&&0!==this.typingUsers.length){if(this.indicatorWrapper=this.createElement("div",{className:"e-typing-indicator "+(this.typingUsersTemplate?"e-typing-indicator-template":"")}),this.typingUsersTemplate)this.getContextObject("typingUsersTemplate",this.indicatorWrapper,null,null,null);else{this.typingUsers.slice(0,3).forEach(function(e){e=t.createAvatarIcon(e,!0);t.indicatorWrapper.appendChild(e)});for(var e=this.createElement("span",{className:"e-user-text"}),i=(this.indicatorWrapper.appendChild(e),this.updateUserText(),this.createElement("div",{className:"e-indicator-wrapper"})),n=0;n<3;n++){var o=this.createElement("span",{className:"e-indicator"});this.appendChildren(i,o)}this.indicatorWrapper.appendChild(i)}this.content.prepend(this.indicatorWrapper)}},z6t.prototype.updateUserText=function(){var e,t=this;this.typingUsersTemplate||(this.l10n.setLocale(this.locale),e=this.typingUsers.filter(function(e){return e.user!==t.user.user}).map(function(e){return e.user}),e=this.getTypingMessage(e),this.indicatorWrapper.querySelector(".e-user-text").innerHTML=e)},z6t.prototype.getTypingMessage=function(e){var t;return 3<=e.length?this.l10n.getConstant(3<e.length?"multipleUsersTyping":"threeUserTyping").replace("{0}",e[0].toString()).replace("{1}",e[1].toString()).replace("{2}",(e.length-2).toString()):(t=this.l10n.getConstant(2===e.length?"twoUserTyping":"oneUserTyping"),2===e.length?t.replace("{0}",e[0].toString()).replace("{1}",e[1].toString()):t.replace("{0}",e[0].toString()))},z6t.prototype.updateTypingUsers=function(e){var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.typingUsers=e,this.isProtectedOnChange=t,this.renderTypingIndicator()},z6t.prototype.activateSendIcon=function(e){this.sendIcon.classList.toggle("disabled",0===e),this.sendIcon.classList.toggle("enabled",0<e)},z6t.prototype.updateHeaderIcon=function(){var e,t=this.element.querySelector(".e-header-icon");t?t.className="e-header-icon e-icons "+this.headerIconCss:(t=this.element.querySelector(".e-header"))&&(e=this.createElement("span",{className:"e-header-icon e-icons "+this.headerIconCss}),t.prepend(e))},z6t.prototype.updateHeaderText=function(){var e;this.headerText&&(e=this.element.querySelector(".e-header-text"))&&(e.innerHTML=this.headerText)},z6t.prototype.renderUpdatedMessage=function(){this.messageWrapper.innerHTML="",this.setChatMsgId(),this.renderMessageGroup(this.messageWrapper)},z6t.prototype.onSendIconClick=function(e){var t,i,n,o=this;this.textareaObj.value.trim()&&(t={id:this.element.id+"-message-"+(this.messages.length+1),author:this.user,text:this.textareaObj.value},i=this.isProtectedOnChange,this.textareaObj.value="",this.textareaObj.dataBind(),this.updateTextAreaObject(this.textareaObj),this.activateSendIcon(this.textareaObj.value.length),n={cancel:!1,message:t},this.triggerUserTyping(e,""),this.trigger("messageSend",n,function(e){e.cancel||(t=e.message,o.isProtectedOnChange=!0,o.messages=o.messages.concat([t]),o.isProtectedOnChange=i,o.renderNewMessage(t,o.messages.length-1))}),this.suggestionsElement&&(this.suggestionsElement.hidden=!1),this.updateScrollPosition(!1,5))},z6t.prototype.getContextObject=function(e,t,i,n,o){var r,s={};switch(e.toLowerCase()){case"messagetemplate":r=this.messageTemplate,s={message:n,index:i};break;case"timebreaktemplate":r=this.timeBreakTemplate,s={messageDate:o};break;case"typinguserstemplate":r=this.typingUsersTemplate,s={users:this.typingUsers}}this.updateContent(r,t,s,e)},z6t.prototype.handleAutoScroll=function(){this.isScrollAtBottom&&this.updateScroll(this.messageWrapper),this.autoScrollToBottom&&this.updateScroll(this.messageWrapper),this.toggleScrollIcon()},z6t.prototype.footerKeyHandler=function(e){this.keyHandler(e,"footer")},z6t.prototype.scrollBottomKeyHandler=function(e){this.keyHandler(e,"scrollBottom")},z6t.prototype.keyHandler=function(e,t){if("Enter"===e.key&&!e.shiftKey)switch(t){case"footer":e.preventDefault(),this.onSendIconClick(e);break;case"scrollBottom":this.scrollToBottom()}},z6t.prototype.updateFooter=function(e,t){t.hidden=!e},z6t.prototype.handleScroll=function(){var e,t=this.checkScrollAtBottom();t&&(this.toggleClassName(this.downArrowIcon.element,t,"downArrow"),e=this.element.querySelector(".e-suggestions"))&&(this.toggleClassName(e,t,"suggestion"),t&&this.isScrollAtBottom||this.updateScroll(this.messageWrapper)),this.loadOnDemand&&0===this.messageWrapper.scrollTop&&(this.multiplier+=this.multiplier,this.loadMoreMessages()),this.isScrollAtBottom=t},z6t.prototype.checkScrollAtBottom=function(){var e=Math.floor(this.messageWrapper.scrollTop);return Math.floor(this.messageWrapper.scrollHeight)-e<=Math.floor(this.messageWrapper.clientHeight)+5},z6t.prototype.toggleClassName=function(e,t,i){switch(i){case"downArrow":e.classList.toggle("e-arrowdown-hide",t),e.classList.toggle("e-arrowdown-show",!t);break;case"suggestion":e.classList.toggle("e-show-suggestions",t),e.classList.toggle("e-hide-suggestions",!t);break;case"scroll":e.classList.toggle("e-scroll-smooth",!t)}},z6t.prototype.toggleScrollIcon=function(){var e=this.checkScrollAtBottom(),t=(this.toggleClassName(this.downArrowIcon.element,e,"downArrow"),this.element.querySelector(".e-suggestions"));t&&(this.toggleClassName(t,e,"suggestion"),e)&&this.updateScroll(this.messageWrapper),this.isScrollAtBottom=e},z6t.prototype.scrollBtnClick=function(){this.toggleClassName(this.messageWrapper,!1,"scroll"),this.scrollToBottom(),this.toggleClassName(this.messageWrapper,!0,"scroll")},z6t.prototype.updateMessageItem=function(e,t){var i;e.author||e.timeStamp||this.messageTemplate?this.renderUpdatedMessage():(t=this.messageWrapper.querySelector("#"+t))&&(e.id&&(t.id=e.id),(i=t.querySelector(".e-text"))&&e.text&&(i.innerHTML=e.text),e.status)&&((i=t.querySelector(".e-status-text"))&&e.status.text&&(i.innerHTML=e.status.text),i=t.querySelector(".e-status-icon"))&&e.status.iconCss&&(t=e.status.iconCss,i.className="e-status-icon "+t,e.status.tooltip)&&(i.title=e.status.tooltip)},z6t.prototype.wireEvents=function(){this.wireFooterEvents(this.sendIcon,this.footer,this.footerTemplate,this.textareaObj),E.add(this.messageWrapper,"scroll",this.handleScroll,this),E.add(this.downArrowIcon.element,"click",this.scrollBtnClick,this),E.add(this.downArrowIcon.element,"keydown",this.scrollBottomKeyHandler,this)},z6t.prototype.unwireEvents=function(){this.unWireFooterEvents(this.sendIcon,this.footer,this.footerTemplate,this.textareaObj),E.remove(this.messageWrapper,"scroll",this.handleScroll),E.remove(this.downArrowIcon.element,"click",this.scrollBtnClick),E.remove(this.downArrowIcon.element,"keydown",this.scrollBottomKeyHandler)},z6t.prototype.destroyChatUI=function(){for(var e=0,t=["content","sendIcon","footer","indicatorWrapper","messageWrapper","viewWrapper","chatHeader"];e<t.length;e++){var i=t[e];this.removeAndNullify(this[i]),this[i]=null}},z6t.prototype.scrollToBottom=function(){this.updateScroll(this.messageWrapper),this.toggleScrollIcon()},z6t.prototype.addMessage=function(e){var t;je(e)||(t=this.isProtectedOnChange,this.isProtectedOnChange=!0,e="string"==typeof e?{id:this.element.id+"-message-"+(this.messages.length+1),author:this.user,text:e,timeStamp:new Date,timeStampFormat:this.timeStampFormat}:L6t({},e,{id:e.id||this.element.id+"-message-"+(this.messages.length+1)}),this.messages=this.messages.concat([e]),this.renderNewMessage(e,this.messages.length-1),this.updateScrollPosition(!0,5),this.isProtectedOnChange=t)},z6t.prototype.updateMessage=function(t,i){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.messages=this.messages.map(function(e){return e.id===i?L6t({},e,t):e}),this.updateMessageItem(t,i),this.isProtectedOnChange=e},z6t.prototype.scrollToMessage=function(e){e=this.messageWrapper.querySelector("#"+e);e&&e.scrollIntoView({behavior:"smooth",block:"start"})},z6t.prototype.focus=function(){this.textareaObj&&this.textareaObj.focusIn()},z6t.prototype.destroy=function(){H6t.prototype.destroy.call(this),this.unwireEvents(),this.cssClass&&q([this.element],this.cssClass.split(" ")),this.element.classList.remove("e-rtl"),this.destroyAndNullify(this.textareaObj),this.destroyAndNullify(this.downArrowIcon),this.destroyAndNullify(this.toolbar),this.destroyChatUI(),this.intl=null},z6t.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"width":case"height":this.setDimension(this.element,this.width,this.height);break;case"placeholder":this.textareaObj&&(this.textareaObj.placeholder=this.placeholder);break;case"cssClass":this.updateCssClass(this.element,e.cssClass,t.cssClass);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"]("e-rtl"),je(this.toolbar)||(this.toolbar.enableRtl=this.enableRtl,this.toolbar.dataBind());break;case"showHeader":this.updateHeader(this.showHeader,this.chatHeader,this.viewWrapper);break;case"headerText":this.updateHeaderText();break;case"headerIconCss":this.updateHeaderIcon();break;case"messages":this.renderUpdatedMessage(),this.updateScrollPosition(!0,5);break;case"user":var o={id:e.user.id,user:e.user.user,avatarUrl:e.user.avatarUrl,avatarBgColor:e.user.avatarBgColor,cssClass:e.user.cssClass};this.user=L6t({},this.user,o);break;case"showTimeStamp":case"timeStampFormat":case"showTimeBreak":0<this.messages.length&&this.renderUpdatedMessage();break;case"showFooter":this.updateFooter(this.showFooter,this.footer);break;case"autoScrollToBottom":this.handleAutoScroll();break;case"suggestions":this.handleSuggestionUpdate();break;case"typingUsers":this.updateTypingUsers(this.typingUsers);break;case"locale":if(!this.typingUsers||0===this.typingUsers.length)return;this.updateUserText();break;case"headerToolbar":this.updateHeaderToolbar();break;case"currencyCode":this.refresh()}},mft([e("100%")],z6t.prototype,"width",void 0),mft([e("100%")],z6t.prototype,"height",void 0),mft([t({},SOt)],z6t.prototype,"user",void 0),mft([e("Chat")],z6t.prototype,"headerText",void 0),mft([e("")],z6t.prototype,"headerIconCss",void 0),mft([e("Type your message…")],z6t.prototype,"placeholder",void 0),mft([e("")],z6t.prototype,"cssClass",void 0),mft([e(!0)],z6t.prototype,"showHeader",void 0),mft([e(!0)],z6t.prototype,"showFooter",void 0),mft([t({items:[]},Rft)],z6t.prototype,"headerToolbar",void 0),mft([e([])],z6t.prototype,"suggestions",void 0),mft([e(!1)],z6t.prototype,"showTimeBreak",void 0),mft([kt([],IOt)],z6t.prototype,"messages",void 0),mft([kt([],SOt)],z6t.prototype,"typingUsers",void 0),mft([e("dd/MM/yyyy hh:mm a")],z6t.prototype,"timeStampFormat",void 0),mft([e(!0)],z6t.prototype,"showTimeStamp",void 0),mft([e(!1)],z6t.prototype,"autoScrollToBottom",void 0),mft([e(!1)],z6t.prototype,"loadOnDemand",void 0),mft([e("")],z6t.prototype,"suggestionTemplate",void 0),mft([e("")],z6t.prototype,"footerTemplate",void 0),mft([e("")],z6t.prototype,"emptyChatTemplate",void 0),mft([e("")],z6t.prototype,"messageTemplate",void 0),mft([e("")],z6t.prototype,"timeBreakTemplate",void 0),mft([e("")],z6t.prototype,"typingUsersTemplate",void 0),mft([i()],z6t.prototype,"messageSend",void 0),mft([i()],z6t.prototype,"userTyping",void 0);var H6t,DOt=mft([Bt],z6t);function z6t(e,t){e=H6t.call(this,e,t)||this;return e.multiplier=3,e}var POt=Object.freeze({__proto__:null,Prompt:ts,get AssistViewType(){return C6t},AssistView:det,PromptToolbarSettings:q$e,ResponseToolbarSettings:h,AIAssistView:d2t,MessageStatus:cft,User:SOt,Message:IOt,ChatUI:DOt,ToolbarItem:vft,ToolbarSettings:Rft,InterActiveChatBase:Wo}),LOt=Object.freeze({__proto__:null,NumericTextBox:NL,regularExpressions:UL,createMask:qL,applyMask:GL,wireEvents:YL,unwireEvents:XL,bindClearEvent:KL,unstrippedValue:$L,strippedValue:eR,maskInputMouseDownHandler:iR,maskInputMouseUpHandler:nR,maskInputFocusHandler:oR,triggerFocus:rR,escapeRegExp:sR,maskInputBlurHandler:aR,maskInputDropHandler:dR,mobileRemoveFunction:uR,setMaskValue:IR,setElementValue:TR,maskInput:function(e){var t=ER(e),i=(GL.call(t),eR.call(this,this.element));this.prevValue=i,this.value=i,e.mask&&(XL.call(t),YL.call(t))},getVal:function(e){return eR.call(DR(e),e.element)},getMaskedVal:function(e){return $L.call(DR(e),e.element)},MaskUndo:MR,MaskedTextBox:LR,containerAttributes:QF,TEXTBOX_FOCUS:UF,get Input(){return HF},TicksData:wk,ColorRangeData:Ir,LimitData:bk,TooltipData:QR,Slider:KO,regex:iN,get ErrorOption(){return $O},FormValidator:nN,FilesProp:Ck,ButtonsProps:zN,AsyncSettings:QN,Uploader:GN,ColorPicker:cV,TextBox:fV,TextArea:IV,get ChatMessageRole(){return kV},SmartTextArea:RV,Signature:BV,get LabelPosition(){return KV},get PrecisionType(){return JV},Rating:u_,get OtpInputType(){return f_},get OtpInputStyle(){return y_},get TextTransform(){return v_},OtpInput:w_,SignatureBase:h0,ButtonSettings:x_,TooltipSettings:l,get SpeechToTextState(){return E_},SpeechToText:k_}),NOt=(VSt.Inject(wce,tte,pJ,P$e,H$e,set,tn,Kmt),Object.freeze({__proto__:null,parseValue:GCt,getCompValue:YCt,encode:XCt,render:KCt,update:JCt,destroy:ZCt,setFocus:$Ct,accessValue:eSt,destroyModules:tSt,showPopup:iSt,PopupSettings:Det,modulesList:sSt,localeConstant:aSt,ROOT:lSt,ROOT_TIP:hSt,VALUE_WRAPPER:dSt,VALUE:pSt,OVERLAY_ICON:cSt,TIP_TITLE:uSt,TITLE:gSt,INLINE:mSt,POPUP:fSt,WRAPPER:ySt,LOADING:vSt,FORM:bSt,CTRL_GROUP:wSt,INPUT:CSt,BUTTONS:SSt,EDITABLE_ERROR:ASt,ELEMENTS:xSt,OPEN:ISt,BTN_SAVE:TSt,BTN_CANCEL:ESt,RTE_SPIN_WRAP:DSt,CTRL_OVERLAY:MSt,DISABLE:kSt,ICONS:"e-icons",PRIMARY:"e-primary",SHOW:PSt,HIDE:BSt,RTL:FSt,ERROR:LSt,LOAD:RSt,InPlaceEditor:VSt,Base:HSt,AutoComplete:wce,ColorPicker:tte,ComboBox:pJ,DateRangePicker:P$e,MultiSelect:H$e,Rte:set,Slider:tn,TimePicker:Kmt})),j6t=(W6t.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},W6t.prototype.addEventListener=function(){this.parent.on("crop",this.cropping,this),this.parent.on("destroyed",this.destroy,this)},W6t.prototype.removeEventListener=function(){this.parent.off("crop",this.cropping),this.parent.off("destroyed",this.destroy)},W6t.prototype.cropping=function(e){switch(this.updateCropPvtVar(),e.prop){case"cropCircle":this.cropCircle(e.value.context,e.value.isSave,e.value.isFlip);break;case"setCurrSelPoints":this.setCurrSelPoints(e.value.isSetDimension);break;case"updateRotatePan":this.updateRotatePan();break;case"crop":this.crop(e.value.obj);break;case"calcRatio":this.calcRatio(e.value.obj,e.value.dimension);break;case"getCurrFlipState":this.getCurrFlipState(e.value.panObj);break;case"getPreviousCropCurrentObj":e.value.obj.prevObj=this.prevCropCurrObj;break;case"setPreviousCropCurrentObj":this.prevCropCurrObj=e.value.obj;break;case"setCropDestPoints":this.cropDestPoints=e.value.point;break;case"getTempFlipPanPoint":e.value.obj.point=this.tempFlipPanPoint;break;case"setTempFlipPanPoint":je(e.value.isAdd)?this.tempFlipPanPoint=e.value.point:(this.tempFlipPanPoint.x+=e.value.point.x,this.tempFlipPanPoint.y+=e.value.point.y);break;case"getPreventScaling":e.value.obj.bool=this.isPreventScaling;break;case"adjustStraightenForShapes":this.adjustStraightenForShapes(e.value.type,e.value.isInitialRotated);break;case"resizeWrapper":this.resizeWrapper();break;case"setTransformCrop":this.isTransformCrop=e.value.bool;break;case"setInitCrop":this.isInitCrop=e.value.bool;break;case"resetZoom":this.resetZoom();break;case"revertTransform":this.revertTransform(e.value.type,e.value.coll);break;case"reset":this.reset()}},W6t.prototype.getModuleName=function(){return"crop"},W6t.prototype.updateCropPvtVar=function(){var e=this.parent;e.lowerCanvas&&(this.lowerContext=e.lowerCanvas.getContext("2d")),e.upperCanvas&&(this.upperContext=e.upperCanvas.getContext("2d"))},W6t.prototype.reset=function(){this.prevCropCurrObj=null,this.croppedDegree=0,this.cropDestPoints={startX:0,startY:0,width:0,height:0},this.tempFlipPanPoint={x:0,y:0},this.isPreventScaling=!1,this.isInitCrop=!1,this.isTransformCrop=!1},W6t.prototype.cropImg=function(e){for(var t,i=this.parent,n=je(e),o=i.element.querySelector("#"+i.element.id+"_nonaspectratio"),r=i.activeObj.activePoint,s=i.img,a=!1,l=0,h=i.rotateFlipColl.length;l<h;l++){var d=i.rotateFlipColl[l];90!==d&&-90!==d||(a=!0)}i.notify("draw",{prop:"setImageEdited",onPropertyChange:!1}),(n||o)&&(this.croppedDegree=i.transform.degree),n&&0!==i.transform.degree||a?(this.updateCropObj(),t={startX:s.destLeft,startY:s.destTop,width:s.destWidth,height:s.destHeight},i.notify("transform",{prop:"setCurrDestinationPoint",onPropertyChange:!1,value:{point:t}}),this.rotateCrop()):n&&""!==i.transform.currFlipState?(this.updateCropObj(),t={startX:s.destLeft,startY:s.destTop,width:s.destWidth,height:s.destHeight},i.notify("transform",{prop:"setCurrDestinationPoint",onPropertyChange:!1,value:{point:t}}),this.flipCrop()):(this.adjustStraightenForShapes("initial",!1),i.notify("draw",{prop:"setTempZoomFactor",onPropertyChange:!1,value:{tempZoomFactor:i.transform.zoomFactor}}),o=this.calcRatio(),!n&&e||(this.updateCropObj(),i.notify("draw",{prop:"resetPanPoints",onPropertyChange:!1}),i.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),t={startX:s.destLeft,startY:s.destTop,width:s.destWidth,height:s.destHeight},i.notify("transform",{prop:"setCurrDestinationPoint",onPropertyChange:!1,value:{point:t}}),i.currSelectionPoint=Pe({},i.activeObj,{},!0),this.cropDestPoints={startX:s.destLeft,startY:s.destTop,width:s.destWidth,height:s.destHeight}),i.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!(n={width:0,height:0}),value:{width:r.width*o.width,height:r.height*o.height,obj:n,isImgShape:null}}),e=n,this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height),this.lowerContext.clearRect(0,0,i.lowerCanvas.width,i.lowerCanvas.height),i.img={srcLeft:r.startX*o.width-s.destLeft*o.width,srcTop:r.startY*o.height-s.destTop*o.height,srcWidth:r.width*o.width,srcHeight:r.height*o.height,destLeft:(i.lowerCanvas.clientWidth-e.width)/2,destTop:(i.lowerCanvas.clientHeight-e.height+1)/2,destWidth:e.width,destHeight:e.height},t=this.lowerContext.filter,i.notify("draw",{prop:"drawImage",onPropertyChange:!1}),this.lowerContext.filter="none",n=Pe({},i.activeObj,{},!0),this.cropObjColl(),i.transform.straighten=0,i.activeObj=n,this.cropFreehandDrawColl(),i.shapeColl=[],i.notify("shape",{prop:"updateShapeColl",onPropertyChange:!1}),i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),i.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),i.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.upperContext}}),i.currSelectionPoint&&"crop-circle"===i.currSelectionPoint.shape?this.cropCircle(this.lowerContext):i.isCircleCrop=!1,this.lowerContext.filter=t,i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),i.currObjType.isCustomCrop=!1,i.pan(!1),i.transform.defaultZoomFactor=0)},W6t.prototype.adjustStraightenForShapes=function(e,t){for(var i=this.parent,n=i.img.destLeft+i.img.destWidth/2,o=i.img.destTop+i.img.destHeight/2,r=0,s=i.objColl;r<s.length;r++){var a,l,h,d,p,c,u,g,m=s[r];-1===["rectangle","ellipse","text","image","redact"].indexOf(m.shape)||!t&&0===m.rotatedAngle||(a=(u=m.activePoint).startX,g=u.startY,l=u.width,u=u.height,c="initial"===e?m.rotatedAngle:-m.rotatedAngle,h=a+l/2-n,d=g+u/2-o,p=Math.cos(c),g=(c=Math.sin(c))*h+p*d+o-g-u/2,m.activePoint.startX+=u=p*h-c*d+n-a-l/2,m.activePoint.startY+=g,m.activePoint.endX+=u,m.activePoint.endY+=g)}},W6t.prototype.updateCropObj=function(){this.parent.afterCropActions=[];var e={currObj:{}},e=(this.parent.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:e}}),e.currObj);e.straighten=this.parent.transform.straighten,this.parent.cropObj=Pe({},e,{},!0)},W6t.prototype.rotateCrop=function(){for(var e,t=this.parent,i=this.getCurrFlipState(),n=t.activeObj.shape||"",o=(t.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),t.currSelectionPoint=Pe({},t.activeObj,{},!0),t.objColl.push(t.activeObj),t.activeObj=Pe({},t.objColl[t.objColl.length-1],{},!0),Pe({},t.objColl[t.objColl.length-1],{},!0),Pe({},t.currSelectionPoint,{},!0)),r={bool:null},s=(t.notify("transform",{prop:"getPreventSelect",onPropertyChange:!1,value:{obj:r}}),t.notify("transform",{prop:"setPreventSelect",onPropertyChange:!1,value:{bool:!0}}),Pe([],t.rotateFlipColl,[],!0)),a=(this.panToSelRangle(!0),e=Pe({},t.objColl[t.objColl.length-1],{},!0),this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),t.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:e}}),t.objColl.pop(),t.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),t.objColl.push(t.activeObj),t.transform.straighten),l=(0!==a&&(t.transform.straighten=0,t.straightenBaseImageCanvas(),t.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),t.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),t.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}})),this.resetZoom(),Pe([],t.afterCropActions,[],!0)),h=(this.revertTransform("initial",s),0!==a&&(t.transform.straighten="horizontal"===i||"vertical"===i?-a:a,t.straightenBaseImageCanvas(),t.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),t.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}}),t.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}})),e=Pe({},t.objColl[t.objColl.length-1],{},!0),this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),t.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:e}}),t.objColl.pop(),t.transform.degree=0,{isIntersect:null}),d=(t.notify("draw",{prop:"updateImgCanvasPoints",onPropertyChange:!1}),t.notify("draw",{prop:"isLinesIntersect",onPropertyChange:!1,value:{obj:h}}),0);0!==a&&h.isIntersect&&50!=++d;)t.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:.025,zoomPoint:null},isResize:null}),t.notify("draw",{prop:"updateImgCanvasPoints",onPropertyChange:!1}),t.notify("draw",{prop:"isLinesIntersect",onPropertyChange:!1,value:{obj:h}});this.cropImg(!0),this.revertTransform("reverse",s),t.afterCropActions=l,t.currSelectionPoint=o,t.notify("transform",{prop:"setPreventSelect",onPropertyChange:!1,value:{bool:r.bool}}),t.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),t.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.upperContext}}),"crop-circle"===n&&this.cropCircle(this.lowerContext),this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),t.notify("draw",{prop:"resetPanPoints",onPropertyChange:!1})},W6t.prototype.revertTransform=function(e,t){var i=this.parent,n={isRotate:!1};if("initial"===e)for(var o=t.length-1;0<=o;o--)switch(r=t[o]){case 90:i.notify("transform",{prop:"rotate",value:{degree:-90,obj:n}});break;case-90:i.notify("transform",{prop:"rotate",value:{degree:90,obj:n}});break;default:i.notify("transform",{prop:"flipImage",value:{direction:i.toPascalCase(r.toString())}})}else{this.updateFlipState();for(var r,o=0,s=t.length;o<s;o++)switch(r=t[o]){case 90:i.notify("transform",{prop:"rotate",value:{degree:90,obj:n}});break;case-90:i.notify("transform",{prop:"rotate",value:{degree:-90,obj:n}});break;default:i.notify("transform",{prop:"flipImage",value:{direction:i.toPascalCase(r.toString())}})}}},W6t.prototype.updateFlipState=function(){for(var e=this.parent,t=e.objColl,i=0,n=t.length;i<n;i++)t[i].shapeFlip="";for(var o=e.pointColl,i=0;i<e.freehandCounter;i++)o[i].shapeFlip=""},W6t.prototype.resetZoom=function(){var e=this.parent;if(0<e.transform.zoomFactor){var t=e.transform.zoomFactor,i=e.isUndoRedo;e.setProperties({zoomSettings:{zoomFactor:10*t}},!0),e.notify("transform",{prop:"setPreviousZoomValue",onPropertyChange:!1,value:{previousZoomValue:e.zoomSettings.zoomFactor}});for(var n=0;n<10*t;n++)e.isUndoRedo=!0,e.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:-.1,zoomPoint:null},isResize:null});e.isUndoRedo=i,e.notify("draw",{prop:"resetPanPoints",onPropertyChange:!1})}},W6t.prototype.flipCrop=function(){var e,t=this.parent,i=(t.notify("transform",{prop:"setReverseFlip",onPropertyChange:!1,value:{isReverseFlip:!0}}),t.panPoint.totalPannedPoint.x+=this.tempFlipPanPoint.x,t.panPoint.totalPannedPoint.y+=this.tempFlipPanPoint.y,t.transform.currFlipState),n={flipColl:null},n=(t.notify("transform",{prop:"getFlipColl",onPropertyChange:!1,value:{obj:n}}),n.flipColl),o=(t.notify("transform",{prop:"setFlipColl",onPropertyChange:!1,value:{flipColl:[]}}),t.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),t.objColl.push(t.activeObj),0===t.transform.degree&&(o=-t.cropObj.totalPannedPoint.x,e=-t.cropObj.totalPannedPoint.y,t.img.destLeft+=o,t.img.destTop+=e,t.notify("transform",{prop:"drawPannImage",value:{point:{x:o,y:e}}}),t.activeObj=Pe({},t.objColl[t.objColl.length-1],{},!0),this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),t.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:t.activeObj}}),t.objColl.pop(),t.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),t.objColl.push(t.activeObj)),this.resetZoom(),t.currSelectionPoint=Pe({},t.objColl[t.objColl.length-1],{},!0),this.lowerContext.clearRect(0,0,t.lowerCanvas.width,t.lowerCanvas.height),this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),this.lowerContext.filter);t.notify("draw",{prop:"drawImage",onPropertyChange:!1}),this.updateFlipState(),t.notify("shape",{prop:"redrawObj",onPropertyChange:!1,value:{degree:this.getCurrFlipState()}}),t.notify("freehand-draw",{prop:"flipFHDColl",onPropertyChange:!1,value:{value:this.getCurrFlipState()}}),t.activeObj=Pe({},t.objColl[t.objColl.length-1],{},!0),t.objColl.pop(),this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),t.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate"}}),this.cropImg(!0),t.notify("transform",{prop:"setReverseRotate",onPropertyChange:!1,value:{bool:!0}}),this.lowerContext.setTransform(1,0,0,1,0,0),t.notify("draw",{prop:"setDestPoints",onPropertyChange:!1}),t.notify("draw",{prop:"currTransState",onPropertyChange:!1,value:{type:"initial",isPreventDestination:null,context:null,isPreventCircleCrop:null}}),t.notify("draw",{prop:"drawImage",onPropertyChange:!1}),this.lowerContext.filter=o,t.notify("draw",{prop:"setRotateZoom",onPropertyChange:!1,value:{isRotateZoom:!1}}),t.notify("draw",{prop:"currTransState",onPropertyChange:!1,value:{type:"reverse",isPreventDestination:null,context:null,isPreventCircleCrop:null}}),t.transform.currFlipState=i,t.notify("transform",{prop:"setFlipColl",onPropertyChange:!1,value:{flipColl:n}}),this.lowerContext.filter="none",this.updateFlipState(),t.notify("shape",{prop:"redrawObj",onPropertyChange:!1,value:{degree:this.getCurrFlipState()}}),t.notify("freehand-draw",{prop:"flipFHDColl",onPropertyChange:!1,value:{value:this.getCurrFlipState()}}),t.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),this.lowerContext.filter=o,(t.currSelectionPoint&&"crop-circle"===t.currSelectionPoint.shape||t.isCircleCrop)&&this.cropCircle(this.lowerContext),t.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),t.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),t.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.upperContext}}),this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),t.notify("transform",{prop:"setReverseFlip",onPropertyChange:!1,value:{isReverseFlip:!1}}),t.notify("draw",{prop:"resetPanPoints",onPropertyChange:!1}),this.tempFlipPanPoint={x:0,y:0}},W6t.prototype.cropObjColl=function(){var e=this.parent;if(0<e.objColl.length)for(var t=0,i=e.objColl.length;t<i;t++){var n,o,r=(n=e.objColl[t]).activePoint,s=e.activeObj.activePoint,a=s.startX,l=s.startY,h=s.width,s=s.height,d=n.shape;n.imageRatio={startX:(r.startX-a)/h,startY:(r.startY-l)/s,endX:(r.endX-a)/h,endY:(r.endY-l)/s,width:h/r.width,height:s/r.height};switch(d){case"text":o=0===(o=0===n.shapeDegree?e.transform.degree:e.transform.degree-n.shapeDegree)||180===Math.abs(o)?r.width:r.height,n.textSettings.fontRatio=o/n.textSettings.fontSize;break;case"line":case"arrow":this.cropPointCollection(t),"arrow"===d&&e.notify("shape",{prop:"updateArrowRatio",onPropertyChange:!1,value:{obj:n}});break;case"path":this.cropPointCollection(t)}}},W6t.prototype.cropPointCollection=function(e){for(var t,i,n,o=this.parent,r=o.objColl[e].shape,s=o.activeObj.activePoint,a=o.img,l=a.destLeft,h=a.destTop,d=a.destWidth,a=a.destHeight,p="path"===r?(t=s.startX,i=s.startY,n=s.width,s.height):(t=l,i=h,n=d,a),c=o.objColl[e].pointColl,u=0,g=c.length;u<g;u++)c[u].ratioX=(c[u].x-t)/n,c[u].ratioY=(c[u].y-i)/p},W6t.prototype.cropFreehandDrawColl=function(){for(var e=this.parent,t=e.activeObj.activePoint,i=t.startX,n=t.startY,o=t.width,r=t.height,s=0;s<e.freehandCounter;s++){e.points=Pe([],e.pointColl[s].points,[]),e.notify("freehand-draw",{prop:"setPointCounter",onPropertyChange:!1,value:{value:0}});for(var a=e.points.length,l=0;l<a;l++)e.points[l].ratioX=(e.points[l].x-i)/o,e.points[l].ratioY=(e.points[l].y-n)/r}e.notify("freehand-draw",{prop:"updateCropPtsForSel",onPropertyChange:!1})},W6t.prototype.resetAnnotations=function(){var e=this.parent;e.objColl=[],e.pointColl=[],e.freehandCounter=0,e.notify("freehand-draw",{prop:"resetStraightenPoint"})},W6t.prototype.setCurrSelPoints=function(e){var t,i,n,o=this.parent,r=(o.allowDownScale=!1,this.cropDestPoints),s=this.lowerContext.filter,a=o.isCropTab,l=(o.img={srcLeft:0,srcTop:0,srcWidth:o.baseImgCanvas.width,srcHeight:o.baseImgCanvas.height,destLeft:r.startX,destTop:r.startY,destWidth:r.width,destHeight:r.height},o.img),h=o.currSelectionPoint,e=(this.lowerContext.clearRect(0,0,o.lowerCanvas.width,o.lowerCanvas.height),e&&o.notify("draw",{prop:"setDestPoints",onPropertyChange:!1}),o.notify("draw",{prop:"currTransState",onPropertyChange:!1,value:{type:"initial",isPreventDestination:null,context:null,isPreventCircleCrop:null}}),0===this.croppedDegree&&0===o.transform.degree&&h&&"crop-circle"!==h.shape&&"crop-square"!==h.shape&&(l.destLeft=r.startX,l.destTop=r.startY,l.destWidth=r.width,l.destHeight=r.height),0===o.transform.degree&&(l.destLeft+=o.panPoint.totalPannedInternalPoint.x,l.destTop+=o.panPoint.totalPannedInternalPoint.y),o.notify("draw",{prop:"drawImage",onPropertyChange:!1}),this.lowerContext.filter=s,o.notify("draw",{prop:"currTransState",onPropertyChange:!1,value:{type:"reverse",isPreventDestination:null,context:null,isPreventCircleCrop:!0}}),Pe([],o.objColl,null,!0)),r=Pe([],o.pointColl,null,!0),s={straightenPoint:null};o.notify("freehand-draw",{prop:"getStraightenPoint",onPropertyChange:!1,value:{obj:s}}),this.resetAnnotations(),je(o.activeObj.shape)&&o.cropObj.activeObj.shape&&(o.activeObj=Pe({},o.cropObj.activeObj,null,!0)),this.panToSelRangle(),o.isCropTab=a,o.objColl=e,o.pointColl=r,o.freehandCounter=o.pointColl.length,s.straightenPoint.x&&s.straightenPoint.y&&o.notify("freehand-draw",{prop:"setStraightenPoint",onPropertyChange:!1,value:{x:s.straightenPoint.x,y:s.straightenPoint.y,ratioX:s.straightenPoint.ratioX,ratioY:s.straightenPoint.ratioY}}),o.cropObj.activeObj.shape?(a={startX:l.destLeft,startY:l.destTop,width:l.destWidth,height:l.destHeight},h&&h.activePoint&&(t=(h=h.activePoint).startX,i=h.startY,n=h.width,h=h.height,l.destLeft=t,l.destTop=i,l.destWidth=n,l.destHeight=h),o.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),l.destLeft=a.startX,l.destTop=a.startY,l.destWidth=a.width,l.destHeight=a.height,o.notify("freehand-draw",{prop:"updateFHDColl",onPropertyChange:!1}),e=Pe([],o.objColl,null,!0),r=Pe([],o.pointColl,null,!0),o.notify("freehand-draw",{prop:"getStraightenPoint",onPropertyChange:!1,value:{obj:s}}),this.resetAnnotations(),o.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(t={selPointColl:null}),value:{obj:t}}),i=t.selPointColl,o.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:[]}}}),o.cropObj.filter=this.lowerContext.filter,n=Pe({},o.currSelectionPoint,null,!0),o.notify("draw",{prop:"setCurrentObj",onPropertyChange:!1,value:{obj:null}}),o.activeObj=Pe({},n,null,!0),h=Pe({},o.activeObj,null,!0),o.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),o.currSelectionPoint=null,o.isCircleCrop=!1,0!==o.transform.degree&&(je(o.activeObj.shape)&&o.cropObj.activeObj.shape&&(o.activeObj=Pe({},o.cropObj.activeObj,null,!0)),o.notify("transform",{prop:"drawPannedImage",value:{xDiff:0,yDiff:0}}),o.panPoint.currentPannedPoint={x:0,y:0}),o.objColl=e,o.pointColl=r,o.freehandCounter=o.pointColl.length,s.straightenPoint.x&&s.straightenPoint.y&&o.notify("freehand-draw",{prop:"setStraightenPoint",onPropertyChange:!1,value:{x:s.straightenPoint.x,y:s.straightenPoint.y,ratioX:s.straightenPoint.ratioX,ratioY:s.straightenPoint.ratioY}}),o.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:i}}}),o.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"iterate",pen:"iterate",isPreventApply:null}}),this.adjustStraightenForShapes("reverse",!1),o.notify("freehand-draw",{prop:"updateFHDColl",onPropertyChange:!1,value:{isPreventApply:!0}}),o.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),0===o.transform.degree?o.notify("transform",{prop:"drawPannImage",onPropertyChange:!1,value:{point:{x:0,y:0}}}):(je(o.activeObj.shape)&&o.cropObj.activeObj.shape&&(o.activeObj=Pe({},o.cropObj.activeObj,null,!0)),o.notify("transform",{prop:"drawPannedImage",value:{xDiff:0,yDiff:0}}),o.panPoint.currentPannedPoint={x:0,y:0}),o.activeObj=h,o.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate"}}),o.notify("transform",{prop:"setTempPanMove",onPropertyChange:!1,value:{point:null}}),this.isInitCrop||0!==o.transform.degree||""===o.cropObj.currFlipState||0===o.cropObj.cropZoom?this.isInitCrop=!1:(this.isInitCrop=!0,o.notify("draw",{prop:"getStraightenActObj",onPropertyChange:!(l={activeObj:null}),value:{obj:l}}),o.notify("draw",{prop:"performCancel",value:{isContextualToolbar:null}}),o.notify("draw",{prop:"setStraightenActObj",onPropertyChange:!1,value:{activeObj:l.activeObj}}),o.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"croptransform",isApplyBtn:!1,isCropping:null,isZooming:null,cType:null}}))):(this.adjustStraightenForShapes("reverse",!0),o.notify("freehand-draw",{prop:"updateFHDColl",onPropertyChange:!1,value:{isPreventApply:!0}}),a=this.lowerContext.filter,this.lowerContext.filter="none",o.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"iterate",pen:"iterate",isPreventApply:null}}),this.lowerContext.filter=a,o.currSelectionPoint=null),document.querySelector(".e-ie-straighten-value-span")&&(document.querySelector(".e-ie-straighten-value-span").innerHTML=o.transform.straighten.toString()+"&#176")},W6t.prototype.panToSelRangle=function(e){var t=this.parent,i=t.cropObj.totalPannedClientPoint,n=0!==t.transform.degree?e?-i.x:i.x:0,e=0!==t.transform.degree?e?-i.y:i.y:0;0!==t.transform.degree&&(t.panPoint.currentPannedPoint={x:n,y:e},t.notify("transform",{prop:"drawPannedImage",value:{xDiff:n,yDiff:e}}),t.panPoint.currentPannedPoint={x:0,y:0})},W6t.prototype.cropCircle=function(e,t,i){var n=this.parent,o=n.img,r=o.destLeft,s=o.destTop,a=o.destWidth,o=o.destHeight,l=(i&&""!==n.transform.currFlipState&&n.notify("draw",{prop:"setTransform",onPropertyChange:!1,value:{context:e,value:n.transform.currFlipState,isReverse:null}}),e.filter),r=(e.filter="none",e.globalCompositeOperation="destination-in",e.beginPath(),je(t)?r+a/2:e.canvas.width/2),s=je(t)?s+o/2:e.canvas.height/2,o=t?e.canvas.width/2:a/2;e.arc(r,s,o,0,2*Math.PI),e.closePath(),e.fill(),e.restore(),e.globalCompositeOperation="source-over",n.currObjType.isActiveObj=n.isCircleCrop=!0,e.filter=l,i&&""!==n.transform.currFlipState&&n.notify("draw",{prop:"setTransform",onPropertyChange:!1,value:{context:e,value:n.transform.currFlipState,isReverse:null}})},W6t.prototype.getCurrCropState=function(){var e=this.parent,t="",i={flipColl:null};return e.notify("transform",{prop:"getFlipColl",onPropertyChange:!1,value:{obj:i}}),t=this.getCurrFlipState(),-90!==e.transform.degree&&-270!==e.transform.degree||("horizontal"===t?t="vertical":"vertical"===t&&(t="horizontal")),t=""===t?1<i.flipColl.length?this.getCurrFlipState():e.transform.currFlipState:t},W6t.prototype.updateRotatePan=function(){var e,t,i,n,o=this.parent;je(o.panPoint.currentPannedPoint)||(n="",e=o.transform.degree,t=(i=o.panPoint.currentPannedPoint).x,i=i.y,n=0<o.rotateFlipColl.length&&"number"==typeof o.rotateFlipColl[0]&&e<0?this.getCurrCropState():this.getCurrFlipState(),e%90==0&&e%180!=0?90===e||-90===e&&("horizontal"===n||"vertical"===n)||-270===e&&(""===n||"verticalHorizontal"===n||"horizontalVertical"===n)?("horizontal"===n||""===n?o.img.destLeft+=i:o.img.destLeft-=i,""===n||"vertical"===n?o.img.destTop-=t:o.img.destTop+=t):270!==e&&(-270!==e||"horizontal"!==n&&"vertical"!==n)&&(-90!==e||""!==n&&"verticalHorizontal"!==n&&"horizontalVertical"!==n)||(""===n||"horizontal"===n?o.img.destLeft-=i:o.img.destLeft+=i,""===n||"vertical"===n?o.img.destTop+=t:o.img.destTop-=t):180!==e&&-180!==e||(""===n||"vertical"===n?o.img.destLeft-=t:o.img.destLeft+=t,""===n||"horizontal"===n?o.img.destTop-=i:o.img.destTop+=i))},W6t.prototype.crop=function(e){var t,i=this.parent,n=i.activeObj.activePoint,o=n.startX,r=n.startY,s=n.endX,n=n.endY;!i.disabled&&i.isImageLoaded&&(t={isCropToolbar:i.isCropToolbar},i.currObjType.isUndoAction&&!t.isCropToolbar&&i.notify("undo-redo",{prop:"refreshUrc",value:{bool:null}}),o={cancel:!1,startPoint:{x:o,y:r},endPoint:{x:s,y:n},preventScaling:!1},t.isCropToolbar||(i.trigger("cropping",o),i.editCompleteArgs=o),this.cropEvent(o,e,t))},W6t.prototype.cropEvent=function(e,t,i){var n,o,r=this.parent;e.cancel||(o=r.activeObj.shape?r.activeObj.shape.split("-"):[],!r.disabled&&r.activeObj.horTopLine&&(r.currObjType.isCustomCrop||0<o.length&&"crop"===o[0])&&(t.isCrop=!0,o=Pe({},r.cropObj,{},!0),t=Pe({},this.prevCropCurrObj,{},!0),e.preventScaling?this.isPreventScaling=!0:this.isPreventScaling=!1,this.cropImg(),this.isPreventScaling&&(r.aspectWidth=r.img.destWidth,r.aspectHeight=r.img.destHeight),r.notify("freehand-draw",{prop:"resetStraightenPoint"}),r.isCropTab=!1,r.transform.zoomFactor=0,r.setProperties({zoomSettings:{zoomFactor:1}},!0),r.notify("transform",{prop:"setPreviousZoomValue",onPropertyChange:!1,value:{previousZoomValue:r.zoomSettings.zoomFactor}}),F.isDevice||this.updateUndoRedoColl(t,o,i),r.notify("transform",{prop:"setCropDimension",onPropertyChange:!1,value:{width:r.cropObj.destPoints.width,height:r.cropObj.destPoints.height}}),e=r.element.querySelector("#"+r.element.id+"_aspectratio"),n=r.element.querySelector("#"+r.element.id+"_nonaspectratio"),r.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}}),!i.isCropToolbar&&je(e)&&je(n)&&r.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:!1,isCropping:!1,isZooming:null,cType:null}}),this.resizeWrapper(),F.isDevice)&&this.updateUndoRedoColl(t,o,i))},W6t.prototype.updateUndoRedoColl=function(e,t,i){var n=this.parent,o={prevCurrSelectionPoint:n.prevCurrSelectionPoint};e.currSelectionPoint=Pe({},o.prevCurrSelectionPoint,{},!0),n.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"crop",previousObj:e,previousObjColl:e.objColl,previousPointColl:e.pointColl,previousSelPointColl:e.selPointColl,previousCropObj:t,previousText:null,currentText:null,previousFilter:null,isCircleCrop:n.isCircleCrop}}),i.isCropToolbar||n.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}})},W6t.prototype.resizeWrapper=function(){var e,t=this.parent;F.isDevice&&(e=(e=t.element).querySelector("#"+e.id+"_contextualToolbarArea"))&&""===e.style.position&&!this.isTransformCrop&&(e.style.position="absolute",t.isStraightening=!1,t.update(),t.notify("filter",{prop:"setAdjustmentValue",value:{adjustmentValue:t.canvasFilter}}))},W6t.prototype.calcRatio=function(e,t){var i=this.parent,n=i.transform.degree,o=i.img,r=o.destWidth,o=o.destHeight,t=t||i.baseImgCanvas,i=t.width,t=t.height,r=0===n||n%180==0?i/r:t/r,n=0===n||n%180==0?t/o:i/o;return e&&(e.width=r,e.height=n),{width:r,height:n}},W6t.prototype.getCurrFlipState=function(e){var t=this.parent,i={panRegion:""},n={collection:t.rotateFlipColl};t.notify("shape",{prop:"alignRotateFlipColl",onPropertyChange:!1,value:{collection:t.rotateFlipColl,isRotateFlipCollection:!0,obj:n}}),t.rotateFlipColl=n.collection;for(var o=0,r=t.rotateFlipColl.length;o<r;o++)t.notify("transform",{prop:"setCurrPanRegion",onPropertyChange:!1,value:{region:i.panRegion,type:t.rotateFlipColl[o],obj:i}});return e&&(e.panRegion=i.panRegion),i.panRegion},W6t);function W6t(e){this.croppedDegree=0,this.cropDestPoints={startX:0,startY:0,width:0,height:0},this.tempFlipPanPoint={x:0,y:0},this.isPreventScaling=!1,this.isInitCrop=!1,this.isTransformCrop=!1,this.parent=e,this.addEventListener()}var Q6t=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},U6t=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},q6t=(G6t.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},G6t.prototype.addEventListener=function(){this.parent.on("draw",this.draw,this),this.parent.on("destroyed",this.destroy,this)},G6t.prototype.removeEventListener=function(){this.parent.off("draw",this.draw),this.parent.off("destroyed",this.destroy)},G6t.prototype.draw=function(e){switch(this.updatePrivateVariables(),e.prop){case"drawObject":this.drawObject(e.value.canvas,e.value.obj,e.value.isCropRatio,e.value.points,e.value.isPreventDrag,e.value.saveContext,e.value.isPreventSelection);break;case"updateActiveObject":this.updateActiveObject(e.value.actPoint,e.value.obj,e.value.isMouseMove,e.value.x,e.value.y);break;case"clearOuterCanvas":this.clearOuterCanvas(e.value.context);break;case"setDestPoints":this.setDestPoints();break;case"updateCurrTransState":this.updateCurrTransState(e.value.type,e.value.isPreventDestination,e.value.isRotatePan);break;case"currTransState":this.currTransState(e.value.type,e.value.isPreventDestination,e.value.context,e.value.isPreventCircleCrop);break;case"setTransform":this.setTransform(e.value.context,e.value.value,e.value.isReverse);break;case"render-image":this.renderImage(e.value.isMouseWheel,e.value.isPreventClearRect,e.value.isFrame,e.value.isStraighten);break;case"draw-image-to-canvas":this.drawImgToCanvas(e.value.dimension);break;case"update-canvas":this.updateCanvas();break;case"performCancel":this.performCancel(e.value.isContextualToolbar,e.value.isUndoRedo,e.value.isFinalCancel);break;case"updateFlipPan":this.updateFlipPan(e.value.tempSelectionObj);break;case"select":this.select(e.value.type,e.value.startX,e.value.startY,e.value.width,e.value.height);break;case"callUpdateCurrTransState":this.callUpdateCurrTransState();break;case"resetPanPoints":this.resetPanPoints();break;case"setClientTransDim":this.setClientTransDim(e.value.isPreventDimension);break;case"redrawImgWithObj":this.redrawImgWithObj();break;case"setCurrentObj":this.setCurrentObj(e.value.obj,e.value.isUndoRedo,e.value.isCircleCrop);break;case"performPointZoom":this.performPointZoom(e.value.x,e.value.y,e.value.type,e.value.isResize);break;case"open":this.open(e.value.data);break;case"isInitialLoading":this.isInitialLoading=e.value.isInitialLoading;break;case"isInitialLoaded":this.getInitialLoaded(e.value.object);break;case"fileSelect":this.fileSelect(e.value.inputElement,e.value.args);break;case"getFileName":e.value.obj.fileName=this.fileName,e.value.obj.fileType=this.fileType;break;case"getErrorImage":e.value.obj.isErrorImage=this.isErrorImage;break;case"getInitialZoomValue":e.value.obj.initialZoomValue=this.initZoomValue;break;case"setShapeTextInsert":this.isShapeTextInserted=e.value.bool;break;case"resetCurrentSelectionPoint":this.currSelPoint=null;break;case"setRotateZoom":this.isRotateZoom=e.value.isRotateZoom;break;case"setTempStrokeSettings":this.tempStrokeSettings=e.value.tempStrokeSettings;break;case"setTempTextSettings":this.tempTextSettings=e.value.tempTextSettings;break;case"setTempAdjustmentValue":this.tempAdjValue=e.value.tempAdjustmentValue;break;case"getTempAdjustmentValue":e.value.obj.value=this.tempAdjValue;break;case"setTempFilter":this.tempFilter=e.value.tempFilter;break;case"setTempUndoRedoStep":this.tempUndoRedoStep=e.value.tempUndoRedoStep;break;case"setTempFreehandCounter":this.tempFreehandCounter=e.value.tempFreehandCounter;break;case"setTempCurrentFreehandDrawIndex":this.tempCurrFhdIndex=e.value.tempCurrentFreehandDrawIndex;break;case"setTempZoomFactor":this.tempZoomFactor=e.value.tempZoomFactor;break;case"setCancelAction":this.isCancelAction=e.value.bool;break;case"getRotatedFlipCropSelection":e.value.bool.isSelected=this.rotatedFlipCropSel;break;case"getPrevActObj":e.value.obj.prevActObj=this.prevActObj;break;case"setPrevActObj":this.prevActObj=e.value.prevActObj;break;case"setZoomCropWidth":this.zoomCrop.width=e.value.width,this.zoomCrop.height=e.value.height;break;case"setImageEdited":this.isImageEdited=!0;break;case"reset":this.reset();break;case"setNewPath":this.isNewPath=e.value.bool;break;case"getNewPath":e.value.obj.isNewPath=this.isNewPath;break;case"getArrowDimension":e.value.obj.arrowDimension=Pe({},this.arrowDimension,{},!0);break;case"setArrowDimension":this.arrowDimension=e.value.arrowDimension;break;case"moveToSelectionRange":this.moveToSelectionRange(e.value.type,e.value.activeObj);break;case"setResizeSelect":this.isResizeSelect=e.value.bool;break;case"applyFrame":this.applyFrame(e.value.ctx,e.value.frame,e.value.preventImg);break;case"drawImage":this.drawImage();break;case"downScaleImgCanvas":this.downScaleImgCanvas(e.value.ctx,e.value.isImgAnnotation,e.value.isHFlip,e.value.isVFlip);break;case"downScale":this.downScale(e.value.canvas,e.value.width,e.value.height);break;case"resetFrameZoom":this.resetFrameZoom(e.value.isOk);break;case"triggerFrameChange":e.value.obj.frameChangeEventArgs=this.triggerFrameChange(e.value.prevFrameSettings);break;case"setImageApply":this.isImageApply=e.value.bool;break;case"zoomToSel":this.zoomToSel(e.value.activeObj,e.value.isToolbar);break;case"getStraightenActObj":e.value.obj.activeObj=this.straightenActObj;break;case"setStraightenActObj":this.straightenActObj=e.value.activeObj;break;case"updateImgCanvasPoints":this.updateImgCanvasPoints();break;case"isLinesIntersect":e.value.obj.isIntersect=this.isLinesIntersect(e.value.obj);break;case"getImageCanvasPoints":e.value.obj.points=this.imgCanvasPoints;break;case"setDestForStraighten":this.setDestForStraighten();break;case"setTempDestForStraighten":this.tempStraightenDestPoints=Pe({},this.straightenDestPoints,{},!0);break;case"getStraightenInitZoom":e.value.obj.zoomFactor=this.straightenInitZoom;break;case"setStraightenInitZoom":this.straightenInitZoom=e.value.zoomFactor;break;case"isPointsInsideImg":e.value.obj.bool="inside"!==this.checkPointPosition(e.value.x,e.value.y,this.imgCanvasPoints[0].x,this.imgCanvasPoints[0].y,this.imgCanvasPoints[1].x,this.imgCanvasPoints[1].y,this.imgCanvasPoints[2].x,this.imgCanvasPoints[2].y,this.imgCanvasPoints[3].x,this.imgCanvasPoints[3].y);break;case"setIsCropSelect":this.isCropSelect=e.value.bool;break;case"updateCropSelection":this.updateCropSelection();break;case"updateCropSelObj":this.updateCropSelObj();break;case"redrawDownScale":this.redrawDownScale();break;case"updateFinetune":this.updateFinetune();break;case"isSelOutsideImg":e.value.obj.bool=this.isSelOutsideImg();break;case"resetStraightenDestPoints":this.straightenDestPoints=null;break;case"checkPointPosition":e.value.obj.position=this.checkPointPosition(e.value.obj.x,e.value.obj.y,e.value.obj.x1,e.value.obj.y1,e.value.obj.x2,e.value.obj.y2,e.value.obj.x3,e.value.obj.y3,e.value.obj.x4,e.value.obj.y4);break;case"updateTempObjColl":this.tempObjColl=Pe([],this.parent.objColl,[],!0);break;case"resetTempObjColl":this.tempObjColl=null;break;case"updateTempPointColl":this.tempPointColl=Pe({},this.parent.pointColl,{},!0);break;case"resetTempPointColl":this.tempPointColl={};break;case"showDialogPopup":this.showDialogPopup();break;case"imageBackgroundColor":this.imageBackgroundColor=e.value.color;break;case"getImageBackgroundColor":e.value.obj.color=this.imageBackgroundColor;break;case"setTempStrokeWidth":this.tempStrokeWidth=e.value.strokeWidth;break;case"setNullExtension":this.isNullExtension=e.value.extension}},G6t.prototype.getModuleName=function(){return"draw"},G6t.prototype.updatePrivateVariables=function(){var e=this.parent;e.lowerCanvas&&(this.lowerContext=e.lowerCanvas.getContext("2d")),e.upperCanvas&&(this.upperContext=e.upperCanvas.getContext("2d")),je(this.tempZoomFactor)&&(this.tempZoomFactor=e.transform.zoomFactor),""===this.tempTextSettings.fontFamily&&(this.tempTextSettings.fontFamily=e.fontFamily.default)},G6t.prototype.reset=function(){this.isInitialLoading=this.isErrorImage=this.isNewPath=this.isResizeSelect=!1,this.isShapeTextInserted=!1,this.isImageApply=!1,this.isNullExtension=!0,this.initZoomValue=null,this.tempFilter="",this.origDim={width:0,height:0},this.currSelPoint=null,this.isRotateZoom=!1,this.tempAdjValue="",this.tempStrokeSettings={strokeColor:"#fff",fillColor:"",strokeWidth:null,radius:null,outlineColor:"",outlineWidth:null},this.tempTextSettings={text:"Enter Text",fontFamily:this.parent.fontFamily.default,fontSize:null,fontRatio:null,bold:!1,italic:!1,underline:!1},this.tempUndoRedoStep=this.tempFreehandCounter=this.tempCurrFhdIndex=0,this.tempZoomFactor=null,this.isCancelAction=!1,this.rotatedFlipCropSel=!1,this.prevActObj=null,this.tempStraightenDestPoints=null,this.arrowDimension={bar:{width:10,height:32,ratioX:null,ratioY:null},arrow:{width:24,height:24,ratioX:null,ratioY:null},arrowSolid:{width:32,height:32,ratioX:null,ratioY:null},circle:{width:10,height:10,ratioX:null,ratioY:null},square:{width:20,height:20,ratioX:null,ratioY:null}},this.straightenActObj=null,this.imgCanvasPoints=[],this.straightenInitZoom=null,this.allowRedactStraighten=!0,this.tempObjColl=[],this.tempPointColl={},this.imageBackgroundColor="",this.tempStrokeWidth=null,this.straightenDestPoints=null,this.isCropSelect=this.isDownScale=this.preventStraightening=!1},G6t.prototype.redrawDownScale=function(){var e,t=this.parent;t.transform.zoomFactor&&t.transform.zoomFactor<0&&(e=Pe({},t.activeObj,{},!0),t.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.isDownScale=!0,this.renderImage(),this.isDownScale=!1,e.shape)&&this.drawObject("duplicate",e)},G6t.prototype.updateFinetune=function(){var e,t,i,n=this.parent;n.transform.zoomFactor&&n.transform.zoomFactor<0&&(e=this.lowerContext.filter,this.lowerContext.filter="none",n.notify("draw",{prop:"redrawDownScale"}),t=n.inMemoryCanvas.getContext("2d"),i=(i=this.lowerContext).getImageData(0,0,i.canvas.width,i.canvas.height),n.inMemoryCanvas.width=i.width,n.inMemoryCanvas.height=i.height,t.putImageData(i,0,0),this.lowerContext.filter=e,n.notify("draw",{prop:"redrawDownScale"}))},G6t.prototype.drawImage=function(){this.applyFrame(this.lowerContext,this.parent.frameObj.type)},G6t.prototype.drawObject=function(e,t,i,n,o,r,s){var a,l=this.parent,h=l.activeObj,d=l.activeObj.activePoint;this.upperContext.clearRect(0,0,l.upperCanvas.width,l.upperCanvas.height),"original"===(e=e.toLowerCase())?a=this.lowerContext:"duplicate"===e?a=this.upperContext:r&&(a=r),!o&&h.shape&&this.setDragLimit(),l.currObjType.shape&&"crop"===l.currObjType.shape.split("-")[0].toLowerCase()&&i&&this.drawCropRatio(),h=l.activeObj,d=l.activeObj.activePoint,je(h.strokeSettings)&&(l.notify("shape",{prop:"getStrokeSettings",onPropertyChange:!(o={strokeSettings:{}}),value:{obj:o}}),h.strokeSettings=o.strokeSettings),je(h.strokeSettings.strokeWidth)&&(h.strokeSettings.strokeWidth=2),t&&(l.activeObj=Pe({},t,{},!0)),n&&n.startX&&n.startY&&n.endX&&n.endY&&n.width&&n.height&&(d.startX=n.startX,d.startY=n.startY,d.endX=n.endX,d.endY=n.endY,d.width=n.width,d.height=n.height),this.updateActiveObject(),h=l.activeObj,je((d=l.activeObj.activePoint).startX)&&je(d.startY)||(l.currObjType.isText&&(l.notify("shape",{prop:"getKeyHistory",onPropertyChange:!(i={keyHistory:""}),value:{obj:i}}),h.keyHistory=i.keyHistory),o=!1,"original"!==e&&((o=h.shape&&"crop"===h.shape.split("-")[0]?!0:o)&&(n&&n.startX&&n.startY&&n.endX&&n.endY&&n.width&&n.height?(d.startX=n.startX,d.startY=n.startY,d.endX=n.endX,d.endY=n.endY,d.width=n.width,d.height=n.height):d=h.activePoint,this.upperContext.fillStyle="rgb(0, 0, 0, 0.25)",this.upperContext.fillRect(0,0,l.lowerCanvas.width,l.lowerCanvas.height),this.upperContext.clearRect(d.startX,d.startY,d.width,d.height)),!je(s)||a!==this.lowerContext&&a!==this.upperContext||(this.rotateContext("initial",a),this.drawOuterSelection(a),this.rotateContext("reverse",a))),l.currObjType.isActiveObj=!0,l.notify("shape",{prop:"getKeyHistory",onPropertyChange:!(i={keyHistory:""}),value:{obj:i}}),t?this.drawShapeObj(e,t.shape,r,s):""!==i.keyHistory&&l.currObjType.isText?this.drawShapeObj(e,"text",r,s):h.shape?this.drawShapeObj(e,h.shape,r,s):this.drawShapeObj(e,void 0,r,s),"duplicate"===e&&o&&"crop-circle"!==h.shape&&"none"!==l.frameObj.type&&(this.applyFrame(this.upperContext,l.frameObj.type),this.drawCornerCircles(this.upperContext)))},G6t.prototype.rotateContext=function(e,t){var i,n=this.parent,o=n.activeObj,r=o.shape,o=o.rotatedAngle,s=n.img,a=s.destLeft,l=s.destTop,h=s.destWidth,s=s.destHeight,d=n.activeObj.activePoint,p=d.startX,c=d.startY,u=d.width,d=d.height;"line"!==r&&"arrow"!==r&&(r="initial"===e?o:-o,e=0!==n.transform.straighten||n.isCropTab?(i=a+h/2,l+s/2):(i=p+u/2,c+d/2),t.translate(i,e),t.rotate(r),t.translate(-i,-e))},G6t.prototype.setDragLimit=function(){var e,t,i=this.parent,n=i.activeObj.activePoint,o=i.activeObj,r=o.shape,o=o.rotatedAngle;n&&"image"!==r&&"line"!==r&&0===o&&i.activeObj.preventShapeDragOut&&(o=(r=i.img).destLeft,e=r.destTop,t=r.destWidth,r=r.destHeight,n.startX<o?(n.startX=o,n.endX=Math.min(n.startX+n.width,o+t)):n.endX>o+t&&(n.endX=o+t,n.startX=Math.max(n.endX-n.width,o)),n.startY<e?n.startY=e:n.endY>e+r&&(n.endY=e+r,n.startY=Math.max(n.endY-n.height,e)),i.activeObj=this.updateWidthHeight(i.activeObj))},G6t.prototype.drawCropRatio=function(){var e,t,i,n,o=this.parent,r=o.activeObj.activePoint,s=o.img,a=s.destLeft,l=s.destTop,h=s.destWidth,d=s.destHeight;switch(0<o.transform.zoomFactor&&this.currSelPoint?(s=Pe({},o.activeObj,{},!0),this.drawCustomSelection("crop-custom",null,null,null,null),0!==o.transform.straighten&&(r=o.activeObj.activePoint),n=o.transform.degree%90==0&&o.transform.degree%180!=0?i=r.width<r.height?r.width:r.height:(i=r.width,r.height),o.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),o.activeObj=s,o.currObjType.shape=s.shape,this.upperContext.clearRect(0,0,o.upperCanvas.width,o.upperCanvas.height),o.currObjType.isCustomCrop=!1):(i=h,n=d,a<0&&(i+=a),l<0&&(n+=l),a+h>o.lowerCanvas.width&&(i-=a+h-o.lowerCanvas.width),l+d>o.lowerCanvas.height&&(n-=l+d-o.lowerCanvas.height)),o.currObjType.shape.toLowerCase()){case"crop-square":case"crop-circle":o.notify("selection",{prop:"setDragDirection",onPropertyChange:!1,value:{width:i,height:n}}),r=o.activeObj.activePoint,o.lowerCanvas.width<r.endX-r.startX&&(r.startX=7.5,r.endX=o.lowerCanvas.width-7.5),o.lowerCanvas.height<r.endY-r.startY&&(r.startY=7.5,r.endY=o.lowerCanvas.height-7.5),i===h&&n===d&&(r.startX+=a,r.startY+=l,r.endX+=a,r.endY+=l),o.lowerCanvas.width>o.lowerCanvas.height?(r.height=r.endY-r.startY,r.width=r.height,r.endX=r.startX+r.width):(r.width=r.endX-r.startX,r.height=r.width,r.endY=r.startY+r.height);break;case"crop-3:2":e=3,t=2;break;case"crop-4:3":e=4,t=3;break;case"crop-5:4":e=5,t=4;break;case"crop-7:5":e=7,t=5;break;case"crop-16:9":e=16,t=9;break;case"crop-2:3":e=2,t=3;break;case"crop-3:4":e=3,t=4;break;case"crop-4:5":e=4,t=5;break;case"crop-5:7":e=5,t=7;break;case"crop-9:16":e=9,t=16;break;default:e=parseInt(o.currObjType.shape.toLowerCase().split("crop-")[1].split(":")[0]),t=parseInt(o.currObjType.shape.toLowerCase().split("crop-")[1].split(":")[1])}void 0!==e&&void 0!==t&&(o.notify("selection",{prop:"calcShapeRatio",onPropertyChange:!1,value:{x:e,y:t,imgWidth:i,imgHeight:n}}),i===h&&n===d&&this.updatePoints(),r=o.activeObj.activePoint),r.startX<a&&(u=a-r.startX+7.5,r.startX+=u,r.endX+=u),r.startY<l&&(u=l-r.startY+7.5,r.startY+=u,r.endY+=u),o.activeObj=this.updateWidthHeight(o.activeObj),this.adjToCenter(),this.enlargeToImg(),0!==o.transform.straighten&&(this.adjToStraighten(),this.updateActiveObject(o.activeObj.activePoint,o.activeObj));var p={isIntersect:null,arr:null},c=0,r=o.activeObj.activePoint;if(0!==o.transform.straighten)for(;this.isLinesIntersect(p)&&c<100;){c++;var u=+r.width/100;r.startX+=u,r.endX-=u,u=+r.height/100,r.startY+=u,r.endY-=u,r.width=r.endX-r.startX,r.height=r.endY-r.startY,this.updateActiveObject(r,o.activeObj)}this.straightenInitZoom=o.transform.zoomFactor,this.straightenActObj=Pe({},o.activeObj,{},!0),o.notify("draw",{prop:"resetStraightenDestPoints"}),o.notify("draw",{prop:"setDestForStraighten"})},G6t.prototype.adjToCenter=function(){var e,t=this.parent,i=t.activeObj.activePoint,n=t.img,o=n.destLeft,r=n.destTop,s=n.destWidth,n=n.destHeight,a=t.lowerCanvas.width/2-(i.endX-i.width/2),t=t.lowerCanvas.height/2-(i.endY-i.height/2);i.startX+=a,i.endX+=a,i.startY+=t,i.endY+=t,i.startX<(7.5<=o?o:7.5)?(e=(7.5<=o?o:0)-i.startX,i.startX+=e,i.endX+=e):i.endX>o+s&&(e=i.endX-(o+s),i.startX-=e,i.endX-=e),i.startY<(7.5<=r?r:7.5)?(e=(7.5<=r?r:0)-i.startY,i.startY+=e,i.endY+=e):i.endY>r+n&&(e=i.endY-(r+n),i.startY-=e,i.endY-=e)},G6t.prototype.enlargeToImg=function(){var e=this.parent;if(0!==e.transform.straighten&&e.transform.degree%90==0&&e.transform.degree%180!=0)for(var t=e.activeObj.activePoint,i=Pe({},t,{},!0),n=0;;){n++;var o=5*t.width/100,r=(t.startX-=o,t.endX+=o,o=5*t.height/100,t.startY-=o,t.endY+=o,t.width=t.endX-t.startX,t.height=t.endY-t.startY,this.updateActiveObject(t,e.activeObj),{isIntersect:null,arr:null});if(this.updateImgCanvasPoints(),this.isLinesIntersect(r),r.arr[0]||r.arr[1]||r.arr[2]||r.arr[3]||t.startX<7.5||t.startY<7.5||100===n){o=+(t=Pe({},i,{},!0)).width/100,t.startX+=o,t.endX-=o,o=+t.height/100,t.startY+=o,t.endY-=o,t.width=t.endX-t.startX,t.height=t.endY-t.startY,this.updateActiveObject(t,e.activeObj);break}i=Pe({},t,{},!0)}},G6t.prototype.updateActiveObject=function(e,t,i,n,o){var r=this.parent,s=(e=e||Pe({},r.activeObj.activePoint,{},!0),t=t||Pe({},r.activeObj,{},!0),e.width=e.endX-e.startX,e.height=e.endY-e.startY,e.startX),a=e.startY,l=e.endX,h=e.endY,d=e.width/2,p=e.height/2;t.horTopLine={startX:s+(n=n||0),startY:a-(o=o||0),endX:l+n,endY:h+o},t.horBottomLine={startX:s-n,startY:h-o,endX:l-n,endY:h+o},t.verLeftLine={startX:s+n,startY:a-o,endX:s-o,endY:h-o},t.verRightLine={startX:l+n,startY:a+o,endX:l-n,endY:h+o},t.topLeftCircle={startX:s,startY:a,radius:t.horTopLine.endX?7.5:0},t.topCenterCircle={startX:s+d,startY:a,radius:t.horTopLine.endX?7.5:0},t.topRightCircle={startX:l,startY:a,radius:t.horTopLine.endX?7.5:0},t.centerLeftCircle={startX:s,startY:a+p,radius:t.horTopLine.endX?7.5:0},t.centerRightCircle={startX:l,startY:a+p,radius:t.horTopLine.endX?7.5:0},t.bottomLeftCircle={startX:s,startY:h,radius:t.horTopLine.endX?7.5:0},t.bottomCenterCircle={startX:s+d,startY:h,radius:t.horTopLine.endX?7.5:0},t.bottomRightCircle={startX:l,startY:h,radius:t.horTopLine.endX?7.5:0},0===t.rotatedAngle&&(t.rotationCirclePoint={x:t.bottomCenterCircle.startX,y:t.bottomCenterCircle.startY+25},t.rotationCirclePoint.ratioX=(t.rotationCirclePoint.x-r.img.destLeft)/r.img.destWidth,t.rotationCirclePoint.ratioY=(t.rotationCirclePoint.y-r.img.destTop)/r.img.destHeight),t.activePoint=e,je(i)&&(r.activeObj=Pe({},t,{},!0))},G6t.prototype.drawOuterSelection=function(e,t){var i,n=this.parent,o=n.activeObj.activePoint,r=n.activeObj,s=(e.lineWidth=.5,Pe({},r,{},!0));if(((i=r.shape?r.shape.split("-"):i)&&"crop"===i[0]||void 0===r.shape)&&!t&&(this.upperContext.fillStyle="rgb(0, 0, 0, 0.25)",this.upperContext.fillRect(0,0,n.lowerCanvas.width,n.lowerCanvas.height),this.upperContext.clearRect(o.startX,o.startY,o.width,o.height)),e.strokeStyle=n.themeColl[n.theme].primaryColor,e.fillStyle=n.themeColl[n.theme].secondaryColor,(0===s.shapeDegree?n.transform.degree:n.transform.degree-s.shapeDegree)<0&&0,"arrow"===r.shape||"line"===r.shape)e.beginPath(),e.moveTo(o.startX,o.startY),e.lineTo(o.endX,o.endY),e.stroke();else if("path"===r.shape){e.beginPath();var a=Pe({},n.activeObj,{},!0);if(a.pointColl[0]&&(e.moveTo(a.pointColl[0].x,a.pointColl[0].y),1<a.pointColl.length))for(var l=1,h=a.pointColl.length;l<h;l++)o.endX=a.pointColl[l].x,o.endY=a.pointColl[l].y,e.lineTo(o.endX,o.endY);var t={shape:null};n.notify("selection",{prop:"getCurrentDrawingShape",value:{obj:t}}),"path"===t.shape&&(n.activeObj=r=a),e.lineTo(o.endX,o.endY),e.stroke()}else this.drawCornerCircles(e);!n.selectionSettings.showCircle||void 0!==i&&"crop"===i[0]||(t=e.strokeStyle,i=e.fillStyle,e.strokeStyle=n.selectionSettings.strokeColor,e.fillStyle=n.selectionSettings.fillColor,"text"===r.shape?(e.lineWidth*=2,e.beginPath(),this.drawRotationArcLine(e),e.lineTo(r.rotationCirclePoint.x,r.rotationCirclePoint.y),e.stroke(),e.fill(),e.closePath(),e.beginPath(),e.moveTo(r.rotationCirclePoint.x,r.rotationCirclePoint.y),e.arc(r.rotationCirclePoint.x,r.rotationCirclePoint.y,r.bottomCenterCircle.radius,0,2*Math.PI),e.stroke(),e.fill(),e.closePath(),e.lineWidth/=2):"redact"!==n.activeObj.shape&&this.drawCenterCircles(e),e.strokeStyle=t,e.fillStyle=i),s.rotationCircleLine=r.rotationCircleLine,n.activeObj=Pe({},s,{},!0)},G6t.prototype.drawArrowHead=function(e,t){switch(t?this.parent.activeObj.start:this.parent.activeObj.end){case"arrowSolid":t?this.arrowSolid(e,!0):this.arrowSolid(e,!1);break;case"arrow":t?this.arrow(e,!0):this.arrow(e,!1);break;case"circleSolid":t?this.arrowCircleSolid(e,!0):this.arrowCircleSolid(e,!1);break;case"circle":t?this.arrowCircle(e,!0):this.arrowCircle(e,!1);break;case"bar":t?this.arrowBar(e,!0):this.arrowBar(e,!1);break;case"square":case"squareSolid":t?this.arrowSquareStart(e):this.arrowSquareEnd(e)}},G6t.prototype.drawShapeObj=function(e,t,i,n){var o,r,s=this.parent,a=s.activeObj.activePoint,l=s.activeObj,h=l.strokeSettings,d=h.strokeColor,p=h.fillColor,c=h.strokeWidth,h=void 0!==t?t:s.currObjType.shape,h=(s.currObjType.shape=h,"original"===e.toLowerCase()?o=this.lowerContext:"duplicate"===e.toLowerCase()?o=this.upperContext:i&&(o=i),s.currObjType.shape.toLowerCase()),u=(-1!==["rectangle","ellipse","line","arrow","path","image","redact"].indexOf(h)&&(l.shape=s.currObjType.shape),o.strokeStyle=d,o.fillStyle="text"===t||"freehanddraw"===t?d:p,a.width/3),g=a.height/3,m=a.endX-a.startX,f=a.endY-a.startY,y=(this.rotateContext("initial",o),o.fillStyle);switch(s.currObjType.shape.toLowerCase()){case"rectangle":this.drawSquareLines(o),je(n)&&o===this.upperContext&&this.drawOuterSelection(o);break;case"redact":this.drawRedact(o,l),je(n)&&o===this.upperContext&&this.drawOuterSelection(o),s.currObjType.isRedact=!0;break;case"ellipse":m=Math.abs(m),f=Math.abs(f),o.beginPath(),o.ellipse(a.startX+m/2,a.startY+f/2,m/2,f/2,0,0,2*Math.PI,!1),""!==p&&(o.fillStyle=p,o.fill()),o.ellipse(a.startX+m/2,a.startY+f/2,Math.abs(m/2-c),Math.abs(f/2-c),0,0,2*Math.PI,!1),o.fillStyle=d,o.fill("evenodd"),o.closePath(),je(n)&&o===this.upperContext&&this.drawOuterSelection(o);break;case"crop-circle":this.shapeCircle(o,m,f);break;case"line":this.shapeLine(o,a.startX,a.startY,a.endX,a.endY),je(n)&&o===this.upperContext&&this.drawOuterSelection(o);break;case"arrow":(0===l.shapeDegree?s.transform.degree:s.transform.degree-l.shapeDegree)<0&&0,o.fillStyle=o.strokeStyle,je(l.triangleDirection)&&(l.triangleDirection="right"),je(l.start)&&(l.start="none"),je(l.end)&&(l.end="arrowSolid"),this.drawArrowHead(o,!0),this.drawArrowHead(o,!1),"none"===l.end&&"circle"!==l.start&&"square"!==l.start&&this.shapeLine(o,a.startX,a.startY,a.endX,a.endY),o.fillStyle=y,je(n)&&o===this.upperContext&&this.drawOuterSelection(o);break;case"path":if(1<(r=Pe({},s.activeObj,{},!0)).pointColl.length){var v={shape:null};if(s.notify("selection",{prop:"getCurrentDrawingShape",value:{obj:v}}),"path"===v.shape&&s.isShapeDrawing)for(var b={x:0,y:0},w=0,C=r.pointColl.length;w<C;w++)je(r.pointColl[w+1])?(b.x=r.activePoint.endX,b.y=r.activePoint.endY):(b.x=r.pointColl[w+1].x,b.y=r.pointColl[w+1].y),a.startX=r.pointColl[w].x,a.startY=r.pointColl[w].y,a.endX=b.x,a.endY=b.y,s.activeObj=this.updateWidthHeight(s.activeObj),this.shapeLine(o,a.startX,a.startY,a.endX,a.endY),F.isDevice&&(r.activePoint.endX=b.x,r.activePoint.endY=b.y);else for(w=1,C=r.pointColl.length;w<C;w++)a.startX=r.pointColl[w-1].x,a.startY=r.pointColl[w-1].y,a.endX=r.pointColl[w].x,a.endY=r.pointColl[w].y,s.activeObj=this.updateWidthHeight(s.activeObj),this.shapeLine(o,a.startX,a.startY,a.endX,a.endY);s.activeObj=l=r}else this.shapeLine(o,a.startX,a.startY,a.endX,a.endY);o===this.upperContext&&this.drawOuterSelection(o);break;case"text":this.shapeText(o);break;case"image":this.shapeImage(o),je(n)&&o===this.upperContext&&this.drawOuterSelection(o);break;case"crop-square":case"crop-3:4":case"crop-4:3":case"crop-6:9":case"crop-9:6":case"crop-9:16":case"crop-16:9":o===this.lowerContext&&(o=this.upperContext),this.drawSelection(u,g),s.currObjType.shape="";break;default:this.drawSelection(u,g)}this.rotateContext("reverse",o)},G6t.prototype.updatePoints=function(){var e=this.parent,t=e.activeObj.activePoint,i=e.img,n=i.destLeft,i=i.destTop;t.startX+=n,t.startY+=i,t.endX+=n,t.endY+=i,e.activeObj=this.updateWidthHeight(e.activeObj)},G6t.prototype.updateWidthHeight=function(e){var t=e.activePoint,i=t.startX,n=t.startY,o=t.endX,t=t.endY;return e.activePoint.width=o-i,e.activePoint.height=t-n,e},G6t.prototype.drawCornerCircles=function(e){var t,i,n=this.parent,o=n.activeObj;e.beginPath(),e.rect(o.activePoint.startX,o.activePoint.startY,o.activePoint.width,o.activePoint.height),e.stroke(),e.closePath(),n.selectionSettings.showCircle&&(t=e.strokeStyle,i=e.fillStyle,e.strokeStyle=n.selectionSettings.strokeColor,e.fillStyle=n.selectionSettings.fillColor,e.lineWidth*=2,e.beginPath(),e.moveTo(o.topLeftCircle.startX,o.topLeftCircle.startY),e.arc(o.topLeftCircle.startX,o.topLeftCircle.startY,o.topLeftCircle.radius,0,2*Math.PI),e.moveTo(o.topRightCircle.startX,o.topRightCircle.startY),e.arc(o.topRightCircle.startX,o.topRightCircle.startY,o.topRightCircle.radius,0,2*Math.PI),e.moveTo(o.bottomLeftCircle.startX,o.bottomLeftCircle.startY),e.arc(o.bottomLeftCircle.startX,o.bottomLeftCircle.startY,o.bottomLeftCircle.radius,0,2*Math.PI),e.moveTo(o.bottomRightCircle.startX,o.bottomRightCircle.startY),e.arc(o.bottomRightCircle.startX,o.bottomRightCircle.startY,o.bottomRightCircle.radius,0,2*Math.PI),e.stroke(),e.fill(),e.closePath(),e.lineWidth/=2,e.strokeStyle=t,e.fillStyle=i)},G6t.prototype.drawCenterCircles=function(e){var t=this.parent,i=t.activeObj.activePoint,n=t.activeObj;if(e.lineWidth*=2,e.beginPath(),"arrow"===n.shape||"line"===n.shape)e.moveTo(i.startX,i.startY),e.arc(i.startX,i.startY,n.topCenterCircle.radius,0,2*Math.PI),e.moveTo(i.endX,i.endY),e.arc(i.endX,i.endY,n.bottomCenterCircle.radius,0,2*Math.PI);else if("path"===n.shape){var o=Pe({},t.activeObj,{},!0);if(1<o.pointColl.length)for(var r=1,s=o.pointColl.length;r<s;r++)i.startX=o.pointColl[r-1].x,i.startY=o.pointColl[r-1].y,i.endX=o.pointColl[r].x,i.endY=o.pointColl[r].y,e.moveTo(i.startX,i.startY),e.arc(i.startX,i.startY,n.topCenterCircle.radius,0,2*Math.PI),e.moveTo(i.endX,i.endY),e.arc(i.endX,i.endY,n.bottomCenterCircle.radius,0,2*Math.PI);var a={shape:null};t.notify("selection",{prop:"getCurrentDrawingShape",value:{obj:a}}),"path"===a.shape&&(t.activeObj=n=o),e.moveTo(i.startX,i.startY),e.arc(i.startX,i.startY,n.topCenterCircle.radius,0,2*Math.PI),e.moveTo(i.endX,i.endY),e.arc(i.endX,i.endY,n.bottomCenterCircle.radius,0,2*Math.PI)}else this.drawRotationArcLine(e),e.lineTo(n.rotationCirclePoint.x,n.rotationCirclePoint.y);e.stroke(),e.fill(),e.closePath(),"arrow"!==n.shape&&"line"!==n.shape&&"path"!==n.shape&&(e.beginPath(),e.moveTo(n.rotationCirclePoint.x,n.rotationCirclePoint.y),e.arc(n.rotationCirclePoint.x,n.rotationCirclePoint.y,n.bottomCenterCircle.radius,0,2*Math.PI),e.stroke(),e.fill(),e.closePath()),e.lineWidth/=2},G6t.prototype.drawRotationArcLine=function(e){var t=this.parent,i=t.activeObj,n=(je(i.rotationCircleLine)&&(i.rotationCircleLine=22.5),!1),o=!1,t=0===i.shapeDegree?t.transform.degree:t.transform.degree-i.shapeDegree;if(t<0&&(t=360+t),i.flipObjColl)for(var r=0,s=i.flipObjColl.length;r<s;r++){var a=i.flipObjColl[r].toLowerCase();"horizontal"===a?n=!0:"vertical"===a&&(o=!0)}switch(t){case 0:case 360:o?(i.rotationCirclePoint={x:i.topCenterCircle.startX,y:i.topCenterCircle.startY-i.rotationCircleLine},e.moveTo(i.rotationCirclePoint.x,i.rotationCirclePoint.y+i.rotationCircleLine)):(i.rotationCirclePoint={x:i.bottomCenterCircle.startX,y:i.bottomCenterCircle.startY+i.rotationCircleLine},e.moveTo(i.rotationCirclePoint.x,i.rotationCirclePoint.y-i.rotationCircleLine));break;case 90:case-270:n?(i.rotationCirclePoint={x:i.centerRightCircle.startX+i.rotationCircleLine,y:i.centerLeftCircle.startY},e.moveTo(i.rotationCirclePoint.x-i.rotationCircleLine,i.rotationCirclePoint.y)):(i.rotationCirclePoint={x:i.centerLeftCircle.startX-i.rotationCircleLine,y:i.centerLeftCircle.startY},e.moveTo(i.rotationCirclePoint.x+i.rotationCircleLine,i.rotationCirclePoint.y));break;case 180:case-180:o?(i.rotationCirclePoint={x:i.bottomCenterCircle.startX,y:i.bottomCenterCircle.startY+i.rotationCircleLine},e.moveTo(i.rotationCirclePoint.x,i.rotationCirclePoint.y-i.rotationCircleLine)):(i.rotationCirclePoint={x:i.topCenterCircle.startX,y:i.topCenterCircle.startY-i.rotationCircleLine},e.moveTo(i.rotationCirclePoint.x,i.rotationCirclePoint.y+i.rotationCircleLine));break;case 270:case-90:n?(i.rotationCirclePoint={x:i.centerLeftCircle.startX-i.rotationCircleLine,y:i.centerLeftCircle.startY},e.moveTo(i.rotationCirclePoint.x+i.rotationCircleLine,i.rotationCirclePoint.y)):(i.rotationCirclePoint={x:i.centerRightCircle.startX+i.rotationCircleLine,y:i.centerLeftCircle.startY},e.moveTo(i.rotationCirclePoint.x-i.rotationCircleLine,i.rotationCirclePoint.y))}},G6t.prototype.drawSquareLines=function(e){var t=this.parent,i=t.activeObj,n=i.activePoint,o=n.startX,r=n.startY,s=n.width,n=n.height,a=i.strokeSettings,l=a.fillColor,h=a.strokeColor,d=a.strokeWidth,a=a.radius,i=("crop"===(p=i.shape?i.shape.split("-"):p)[0]?e.strokeStyle="#fff":e.strokeStyle=h,e.beginPath(),{width:0,height:0}),p=(t.notify("crop",{prop:"calcRatio",onPropertyChange:!1,value:{obj:i,dimension:{width:e.canvas.width,height:e.canvas.height}}}),e.canvas.id===t.element.id+"_tempCanvas"),c=t.transform.zoomFactor,p=p?10*a*((i.width+i.height)/2):10*a,i=p+p*c;null!==a?t.isSafari?this.drawRoundedRect(e,o,r,s,n,i):e.roundRect(o,r,s,n,i):e.rect(o,r,s,n),""!==l&&(e.fillStyle=l,e.fill()),null!==a?t.isSafari?this.drawRoundedRect(e,o+d,r+d,s-2*d,n-2*d,i):e.roundRect(o+d,r+d,s-2*d,n-2*d,i):e.rect(o+d,r+d,s-2*d,n-2*d),e.fillStyle=h,e.fill("evenodd"),e.closePath()},G6t.prototype.drawRoundedRect=function(e,t,i,n,o,r){r=Math.max(0,Math.min(r,n/2,o/2));e.moveTo(t+r,i),e.arcTo(t+n,i,t+n,i+o,r),e.arcTo(t+n,i+o,i,i+o,r),e.arcTo(t,i+o,t,i,r),e.arcTo(t,i,t+n,i,r),e.closePath()},G6t.prototype.drawSelection=function(e,t){var i=this.parent,n=i.activeObj,o=n.activePoint,r=o.startX,s=o.startY,a=o.endX,o=o.endY;this.upperContext.strokeStyle=i.themeColl[i.theme].primaryColor,this.upperContext.beginPath(),n.horTopInnerLine={startX:r,startY:s+t,endX:a,endY:o+t},n.horBottomInnerLine={startX:r,startY:s+2*t,endX:a,endY:o+2*t},n.verLeftInnerLine={startX:r+e,startY:s,endX:r+e,endY:o},n.verRightInnerLine={startX:r+2*e,startY:s,endX:r+2*e,endY:o},this.upperContext.moveTo(n.horTopInnerLine.startX,n.horTopInnerLine.startY),this.upperContext.lineTo(n.horTopInnerLine.endX,n.horTopInnerLine.startY),this.upperContext.moveTo(n.horBottomInnerLine.startX,n.horBottomInnerLine.startY),this.upperContext.lineTo(n.horBottomInnerLine.endX,n.horBottomInnerLine.startY),this.upperContext.moveTo(n.verLeftInnerLine.startX,n.verLeftInnerLine.startY),this.upperContext.lineTo(n.verLeftInnerLine.endX,n.verLeftInnerLine.endY),this.upperContext.moveTo(n.verRightInnerLine.startX,n.verRightInnerLine.startY),this.upperContext.lineTo(n.verRightInnerLine.endX,n.verRightInnerLine.endY),this.upperContext.stroke(),this.upperContext.closePath()},G6t.prototype.shapeCircle=function(e,t,i){var n=this.parent,o=n.activeObj.activePoint,r=o.startX,s=o.startY,a=o.endX,l=o.endY,o=o.width,h=(e.strokeStyle=n.themeColl[n.theme].primaryColor,e.clearRect(0,0,n.lowerCanvas.width,n.lowerCanvas.height),e.fillStyle="rgb(0, 0, 0, 0.25)",e.fillRect(0,0,n.lowerCanvas.width,n.lowerCanvas.height),e.lineWidth);e.lineWidth=2,e.beginPath(),e.ellipse(n.activeObj.horTopLine.startX+t/2,n.activeObj.horTopLine.startY+i/2,t/2,i/2,0,0,2*Math.PI,!1),e.stroke(),e.closePath(),e.save(),e.beginPath(),e.arc((a-r)/2+r,(l-s)/2+s,o/2,0,2*Math.PI),e.closePath(),e.clip(),e.clearRect(0,0,n.lowerCanvas.width,n.lowerCanvas.height),e.restore(),e.lineWidth=h,this.drawOuterSelection(e,!0),n.currObjType.shape=""},G6t.prototype.shapeLine=function(e,t,i,n,o){var r=e.lineWidth;e.lineWidth=this.parent.activeObj.strokeSettings.strokeWidth,e.beginPath(),e.moveTo(t,i),e.lineTo(n,o),e.stroke(),e.lineWidth=r},G6t.prototype.manipulateSaveCtx=function(e,t,i){var n;return e!==this.lowerContext&&e!==this.upperContext&&(this.parent.notify("crop",{prop:"calcRatio",onPropertyChange:!(n={width:0,height:0}),value:{obj:n,dimension:{width:e.canvas.width,height:e.canvas.height}}}),t&&(t*=n.width),i)&&(i*=n.height),{x:t,y:i}},G6t.prototype.arrow=function(e,t){var i=this.parent.activeObj,n=i.activePoint,o=n.startX,r=n.startY,s=n.endX,n=n.endY,a=i.strokeSettings.strokeWidth,l=(e.lineWidth=a,this.arrowDimension.arrow.width),h=this.arrowDimension.arrow.height,d=this.manipulateSaveCtx(e,l,h),l=d.x+a,h=d.y+a,d=(this.dx=s-o,this.dy=n-r,e.fillStyle=i.strokeSettings.strokeColor,Math.atan2(this.dy,this.dx)),a="arrow"===i.start,p="arrow"===i.end,c="circle"===i.end||"square"===i.end,u="circle"===i.start||"square"===i.start;((t&&"left"===i.triangleDirection||"right"===i.triangleDirection)&&(a&&"none"===i.end||a&&!c&&!u)||!t&&(p&&"none"===i.start||!a&&!c&&!u))&&this.shapeLine(e,o,r,s,n),t&&"left"===i.triangleDirection||!t&&"right"===i.triangleDirection?(e.translate(s,n),e.rotate(d),this.shapeLine(e,0,0,-l,h/2),this.shapeLine(e,0,0,-l,-h/2),e.rotate(-d),e.translate(-s,-n)):(t&&"right"===i.triangleDirection||!t&&"left"===i.triangleDirection)&&(e.translate(o,r),e.rotate(d),this.shapeLine(e,0,0,l,h/2),this.shapeLine(e,0,0,l,-h/2),e.rotate(-d),e.translate(-o,-r))},G6t.prototype.arrowSolid=function(e,t){var i=this.parent.activeObj,n=i.strokeSettings.strokeWidth,o=i.activePoint,r=o.startX,s=o.startY,a=o.endX,o=o.endY,l=this.arrowDimension.arrowSolid.width,h=this.arrowDimension.arrowSolid.height,d=this.manipulateSaveCtx(e,l,h),l=d.x+n,h=d.y+n,d=(this.dx=a-r,this.dy=o-s,Math.atan2(this.dy,this.dx)),p="arrowSolid"===i.start,c="arrowSolid"===i.end,u="circle"===i.end||"square"===i.end,g="circle"===i.start||"square"===i.start;(t&&p&&"none"===i.end||p&&!u&&!g||!t&&(c&&"none"===i.start||!p&&!u&&!g))&&this.shapeLine(e,r,s,a,o),t&&"left"===i.triangleDirection||!t&&"right"===i.triangleDirection?(e.translate(a,o),e.rotate(d),e.beginPath(),e.moveTo(n,0),e.lineTo(h/2-l,h/2),e.lineTo(h/2-l,-h/2),e.closePath(),e.fill(),e.rotate(-d),e.translate(-a,-o),i.rotatedAngle=d):(t&&"right"===i.triangleDirection||!t&&"left"===i.triangleDirection)&&(e.translate(r,s),e.rotate(d),e.beginPath(),e.moveTo(0-n,0),e.lineTo(l-h/2,h/2),e.lineTo(l-h/2,-h/2),e.closePath(),e.fill(),e.rotate(-d),e.translate(-r,-s),i.rotatedAngle=d)},G6t.prototype.arrowSquareStart=function(e){var t=this.parent.activeObj,i=t.strokeSettings.strokeWidth,n=t.activePoint,o=n.startX,r=n.startY,s=n.endX,n=n.endY,a="square"===t.start,l="circle"===t.end,h="squareSolid"===t.start,d="circleSolid"===t.end,a=((a&&"none"===t.end||a&&!l&&"square"!==t.start||h&&d)&&this.shapeLine(e,o,r,s,n),e.lineWidth=i,e.beginPath(),e.fillStyle=t.strokeSettings.strokeColor,this.arrowDimension.square.width),l=this.arrowDimension.square.height,h=this.manipulateSaveCtx(e,a,l),a=h.x+i,l=h.y+i,d=(this.dx=s-o,this.dy=n-r,Math.atan2(this.dy,this.dx));"left"===t.triangleDirection?(e.translate(s,n),e.rotate(d),"squareSolid"===t.start&&e.fillRect(l/2-a,-l/2,a,l),e.strokeRect(l/2-a,-l/2,a,l),e.rotate(-d),e.translate(-s,-n),this.squareStartIntersectX1=s-l/2*Math.cos(d),this.squareStartIntersectY1=n-l/2*Math.sin(d),"square"===t.start&&"square"!==t.end&&"circle"!==t.end?this.shapeLine(e,o,r,this.squareStartIntersectX1,this.squareStartIntersectY1):"square"===t.start&&"circle"===t.end?this.shapeLine(e,this.endCircleIntersectX1,this.endCircleIntersectY1,this.squareStartIntersectX1,this.squareStartIntersectY1):"squareSolid"===t.start&&"squareSolid"===t.end&&this.shapeLine(e,o,r,s,n)):"right"===t.triangleDirection&&(e.lineWidth=i,e.fillStyle=t.strokeSettings.strokeColor,"squareSolid"===t.start&&"squareSolid"===t.end&&this.shapeLine(e,o,r,s,n),e.translate(o,r),e.rotate(d),"squareSolid"===t.start&&e.fillRect(l/2-a,-l/2,a,l),e.strokeRect(l/2-a,-l/2,a,l),e.rotate(-d),e.translate(-o,-r),t.rotatedAngle=d,this.squareStartIntersectX1=o+l/2*Math.cos(d),this.squareStartIntersectY1=r+l/2*Math.sin(d),"square"===t.start&&"square"!==t.end&&"circle"!==t.end&&this.shapeLine(e,s,n,this.squareStartIntersectX1,this.squareStartIntersectY1),"square"===t.start)&&"circle"===t.end&&this.shapeLine(e,this.endCircleIntersectX1,this.endCircleIntersectY1,this.squareStartIntersectX1,this.squareStartIntersectY1)},G6t.prototype.arrowSquareEnd=function(e){var t=this.parent.activeObj,i=t.activePoint,n=i.startX,o=i.startY,r=i.endX,i=i.endY,s=t.strokeSettings.strokeWidth,a=this.arrowDimension.square.width,l=this.arrowDimension.square.height,h=this.manipulateSaveCtx(e,a,l),a=h.x+s,l=h.y+s,h=(this.dx=r-n,this.dy=i-o,Math.atan2(this.dy,this.dx));e.lineWidth=s,"right"===t.triangleDirection?(e.fillStyle=t.strokeSettings.strokeColor,"squareSolid"===t.end&&"none"===t.start&&this.shapeLine(e,n,o,r,i),e.translate(r,i),e.rotate(h),"squareSolid"===t.end&&e.fillRect(l/2-a,-l/2,a,l),e.strokeRect(l/2-a,-l/2,a,l),e.rotate(-h),e.translate(-r,-i),t.rotatedAngle=h,this.squareEndIntersectX1=r-l/2*Math.cos(h),this.squareEndIntersectY1=i-l/2*Math.sin(h),"square"===t.end&&"square"!==t.start&&"circle"!==t.start?this.shapeLine(e,n,o,this.squareEndIntersectX1,this.squareEndIntersectY1):"circle"===t.start&&"square"===t.end?this.shapeLine(e,this.squareEndIntersectX1,this.squareEndIntersectY1,this.startCircleIntersectX1,this.startCircleIntersectY1):"square"===t.start&&"square"===t.end&&this.shapeLine(e,this.squareEndIntersectX1,this.squareEndIntersectY1,this.squareStartIntersectX1,this.squareStartIntersectY1)):"left"===t.triangleDirection&&(e.translate(n,o),e.rotate(h),"squareSolid"===t.end&&e.fillRect(l/2-a,-l/2,a,l),e.strokeRect(l/2-a,-l/2,a,l),e.rotate(-h),e.translate(-n,-o),t.rotatedAngle=h,this.squareEndIntersectX1=n+l/2*Math.cos(h),this.squareEndIntersectY1=o+l/2*Math.sin(h),"square"===t.end&&"square"!==t.start&&"circle"!==t.start?this.shapeLine(e,r,i,this.squareEndIntersectX1,this.squareEndIntersectY1):"circle"===t.start&&"square"===t.end?this.shapeLine(e,this.squareEndIntersectX1,this.squareEndIntersectY1,this.startCircleIntersectX1,this.startCircleIntersectY1):"square"===t.start&&"square"===t.end?this.shapeLine(e,this.squareEndIntersectX1,this.squareEndIntersectY1,this.squareStartIntersectX1,this.squareStartIntersectY1):"squareSolid"===t.end&&"none"===t.start&&this.shapeLine(e,n,o,r,i))},G6t.prototype.arrowCircle=function(e,t){var i,n,o,r,s,a,l,h,d=this.parent,p=d.activeObj,c=p.activePoint,u=c.startX,g=c.startY,m=c.endX,c=c.endY,f=p.strokeSettings.strokeWidth;t&&"left"===p.triangleDirection||!t&&"right"===p.triangleDirection?(e.lineWidth=f,i=this.arrowDimension.circle.width,i=this.manipulateSaveCtx(e,i,null).x+f,e.beginPath(),e.arc(m,c,i,0,2*Math.PI),e.stroke(),e.closePath(),this.dx=m-u,this.dy=c-g,n=this.dx*this.dx+this.dy*this.dy,0<=(r=(o=2*(this.dx*(u-m)+this.dy*(g-c)))*o-4*n*((u-m)*(u-m)+(g-c)*(g-c)-i*i))&&(e.fillStyle=p.strokeSettings.strokeColor,s=(-o-Math.sqrt(r))/(2*n),a=u+this.dx*s,l=g+this.dy*s,t?(this.startCircleIntersectX1=a,this.startCircleIntersectY1=l,this.endCircleIntersectX1=m-this.dx*s,this.endCircleIntersectY1=c-this.dy*s,e.beginPath(),e.fill(),e.beginPath(),"circle"===p.start&&"circle"===p.end?this.shapeLine(e,this.startCircleIntersectX1,this.startCircleIntersectY1,this.endCircleIntersectX1,this.endCircleIntersectY1):"circle"===p.start&&"circle"!==p.end&&"square"!==p.end&&this.shapeLine(e,u,g,this.startCircleIntersectX1,this.startCircleIntersectY1),e.stroke(),e.closePath()):(this.endCircleIntersectX1=a,this.endCircleIntersectY1=l,"circle"===p.end&&"circle"!==p.start&&"square"!==p.start&&this.shapeLine(e,u,g,this.endCircleIntersectX1,this.endCircleIntersectY1))),h=Math.atan2(this.dy,this.dx),d.activeObj.rotatedAngle=h):(t&&"right"===p.triangleDirection||!t&&"left"===p.triangleDirection)&&(e.lineWidth=f,i=this.arrowDimension.circle.width,i=this.manipulateSaveCtx(e,i,null).x+f,e.beginPath(),e.arc(u,g,i,0,2*Math.PI),e.stroke(),e.closePath(),this.dx=u-m,this.dy=g-c,n=this.dx*this.dx+this.dy*this.dy,0<=(r=(o=2*(this.dx*(m-u)+this.dy*(c-g)))*o-4*n*((m-u)*(m-u)+(c-g)*(c-g)-i*i))&&(e.fillStyle=p.strokeSettings.strokeColor,s=(-o-Math.sqrt(r))/(2*n),a=m+this.dx*s,l=c+this.dy*s,t?(this.startCircleIntersectX1=a,this.startCircleIntersectY1=l,this.endCircleIntersectX1=u-this.dx*s,this.endCircleIntersectY1=g-this.dy*s,"circle"===p.start&&"circle"===p.end?this.shapeLine(e,this.endCircleIntersectX1,this.endCircleIntersectY1,this.startCircleIntersectX1,this.startCircleIntersectY1):"circle"===p.start&&"circle"!==p.end&&"square"!==p.end&&this.shapeLine(e,m,c,this.startCircleIntersectX1,this.startCircleIntersectY1)):(this.endCircleIntersectX1=a,this.endCircleIntersectY1=l,e.beginPath(),e.fill(),e.beginPath(),"circle"===p.end&&"circle"!==p.start&&"square"!==p.start&&this.shapeLine(e,m,c,this.endCircleIntersectX1,this.endCircleIntersectY1))),h=Math.atan2(this.dy,this.dx),d.activeObj.rotatedAngle=h)},G6t.prototype.arrowCircleSolid=function(e,t){var i,n=this.parent.activeObj,o=n.activePoint,r=o.startX,s=o.startY,a=o.endX,o=o.endY,l="circleSolid"===n.start,h=n.strokeSettings.strokeWidth;t&&"left"===n.triangleDirection||!t&&"right"===n.triangleDirection?(e.lineWidth=h,e.beginPath(),e.fillStyle=n.strokeSettings.strokeColor,(t&&l&&"none"===n.end||l&&"circle"!==n.end&&"square"!==n.end||!t&&"circleSolid"===n.end&&"none"===n.start)&&this.shapeLine(e,r,s,a,o),i=this.arrowDimension.circle.width,i=this.manipulateSaveCtx(e,i,null).x+h,this.dx=a-r,this.dy=o-s,e.save(),e.beginPath(),e.arc(a,o,i,0,2*Math.PI),e.stroke(),e.fill(),e.closePath(),n.rotatedAngle=Math.atan2(this.dy,this.dx)):(t&&"right"===n.triangleDirection||!t&&"left"===n.triangleDirection)&&(e.lineWidth=h,e.beginPath(),e.fillStyle=n.strokeSettings.strokeColor,(t&&l&&"none"===n.end||l&&"circle"!==n.end&&"square"!==n.end||!t&&"circleSolid"===n.end&&"none"===n.start)&&this.shapeLine(e,r,s,a,o),i=this.arrowDimension.circle.width,i=this.manipulateSaveCtx(e,i,null).x+h,this.dx=a-r,this.dy=o-s,e.save(),e.beginPath(),e.arc(r,s,i,0,2*Math.PI),e.stroke(),e.fill(),e.closePath(),n.rotatedAngle=Math.atan2(this.dy,this.dx))},G6t.prototype.arrowBar=function(e,t){var i,n,o,r,s=this.parent,a=s.activeObj,l=a.activePoint,h=l.startX,d=l.startY,p=l.endX,l=l.endY,c=a.strokeSettings.strokeWidth;t&&"left"===a.triangleDirection||!t&&"right"===a.triangleDirection?(e.lineWidth=c,e.beginPath(),e.fillStyle=a.strokeSettings.strokeColor,(t&&"bar"===a.start&&"none"===a.end||"bar"===a.start&&"circle"!==a.end&&"square"!==a.end||!t&&("bar"===a.end&&"none"===a.start||"bar"===a.end&&"circle"!==a.start&&"square"!==a.start))&&this.shapeLine(e,h,d,p,l),i=this.arrowDimension.bar.width,n=this.arrowDimension.bar.height,i=(o=this.manipulateSaveCtx(e,i,n)).x+c,n=o.y+c,this.dx=p-h,this.dy=l-d,r=Math.atan2(this.dy,this.dx),e.translate(p,l),e.rotate(r),e.fillRect(n/4-i,-n/2,i,n),e.rotate(-r),e.translate(-p,-l),a.rotatedAngle=r):(t&&"right"===a.triangleDirection||!t&&"left"===a.triangleDirection)&&(e.lineWidth=c,e.beginPath(),e.fillStyle=a.strokeSettings.strokeColor,(t&&"bar"===a.start&&"none"===a.end||"bar"===a.start&&"circle"!==a.end&&"square"!==a.end||!t&&"bar"===a.end&&"none"===a.start)&&this.shapeLine(e,h,d,p,l),i=this.arrowDimension.bar.width,n=this.arrowDimension.bar.height,i=(o=this.manipulateSaveCtx(e,i,n)).x+c,n=o.y+c,this.dx=p-h,this.dy=l-d,r=Math.atan2(this.dy,this.dx),e.translate(h,d),e.rotate(r),e.fillRect(n/4-i,-n/2,i,n),e.rotate(-r),e.translate(-h,-d),s.activeObj.rotatedAngle=r)},G6t.prototype.shapeImage=function(e){var t=this.parent,i=t.activeObj,n=i.activePoint,o=n.startX,r=n.startY,s=n.width,n=n.height,a=i.imageCanvas.getContext("2d"),l=(e===this.lowerContext&&this.isImageApply&&(t.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!(l={width:0,height:0}),value:{width:i.imageElement.width,height:i.imageElement.height,obj:l,isImgShape:null}}),s<l.width/5||n<l.height/5)&&(a.clearRect(0,0,i.imageCanvas.width,i.imageCanvas.height),t.notify("selection",{prop:"applyTransformToImg",onPropertyChange:!1,value:{ctx:a}}),t.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate"}}),this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),t.notify("selection",{prop:"setImageClarity",onPropertyChange:!1,value:{bool:!1}}),this.isImageApply=!1),{startX:0,startY:0,width:0,height:0}),a=(l.width=s,l.height=n,4===i.flipObjColl.length&&(i.flipObjColl=[],i.shapeFlip=""),l.startX=(s-l.width)/2+o,l.startY=(n-l.height)/2+r,e.globalAlpha);e.globalAlpha=i.opacity,i.rotateFlipColl&&0<i.rotateFlipColl.length?this.rotateImage(e):e.drawImage(i.imageCanvas,l.startX,l.startY,l.width,l.height),e.globalAlpha=a,t.currObjType.isText=!1},G6t.prototype.shapeText=function(e){var t=this.parent,i=e.filter,n=t.activeObj,o=n.activePoint,r=o.startX,s=o.startY,a=o.width,l=o.height,h=n.keyHistory.split("\n"),o=n.textSettings,d=o.fontFamily,p=o.bold,c=o.italic,u=n.textSettings.fontSize,g=((u+.25*u)*h.length-u*h.length)/h.length,o=(e.filter="none",e.fillStyle);""!==n.strokeSettings.fillColor&&(e.fillStyle=n.strokeSettings.fillColor,e.fillRect(n.activePoint.startX,n.activePoint.startY,n.activePoint.width,n.activePoint.height)),e.fillStyle=o;for(var m=0;m<h.length;m++){var f=h[m],y=(m+1)*u*.85+m*g,v=(-360===t.transform.degree&&(t.transform.degree=0),0===t.transform.degree||180===t.transform.degree?l<u&&(u=n.textSettings.fontSize=l-.1*l):a<u&&(u=n.textSettings.fontSize=a-.1*a),e.strokeStyle=n.strokeSettings.outlineColor,e.fillStyle=n.strokeSettings.strokeColor,e.lineWidth),b={width:0,height:0},w=(t.notify("crop",{prop:"calcRatio",onPropertyChange:!1,value:{obj:b,dimension:{width:e.canvas.width,height:e.canvas.height}}}),b=b,e.canvas.id===t.element.id+"_tempCanvas"),C=Math.max(1,n.strokeSettings.outlineWidth/2),C=(/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$|^[a-zA-Z]+$/.test(n.strokeSettings.outlineColor)?(e.lineWidth=C*(.5*(w?Math.floor((u-1)/60):Math.floor((u-1)/16))+.5),w&&(e.lineWidth*=(b.width+b.height)/2,0!==t.transform.degree)&&(e.lineWidth/=1.8)):e.lineWidth=1,"");p&&(C="bold "),c&&(C="italic "),e.font=(C=p&&c?"italic bold ":C)+u+"px "+d,4===n.flipObjColl.length&&(n.flipObjColl=[],n.shapeFlip=""),n.rotateFlipColl&&0<n.rotateFlipColl.length?this.rotateText(e):(e.strokeText(f,r+.1*u,s+y),e.fillText(f,r+.1*u,s+y)),e.lineWidth=v}e.filter=i,t.currObjType.isText=!1,this.upperContext===e&&this.drawOuterSelection(e)},G6t.prototype.updateActPoint=function(e,t){var i=this.parent,n=i.activeObj,o=n.activePoint;return"horizontal"===e.toLowerCase()?o.startX<=t.canvas.width/2?(o.startX=t.canvas.width/2+(t.canvas.width/2-o.endX),o.endX=o.startX+o.width,this.updateActiveObject(o,n),i.activeObj=n):o.startX>=t.canvas.width/2&&(o.startX=t.canvas.width-o.endX,o.endX=o.startX+o.width,this.updateActiveObject(o,n),i.activeObj=n):"vertical"===e.toLowerCase()&&(o.startY<=t.canvas.height/2?(o.startY=t.canvas.height/2+(t.canvas.height/2-o.endY),o.endY=o.startY+o.height,this.updateActiveObject(o,n),i.activeObj=n):o.startY>=t.canvas.height/2&&(o.startY=t.canvas.height-o.endY,o.endY=o.startY+o.height,this.updateActiveObject(o,n),i.activeObj=n)),o},G6t.prototype.rotateImage=function(e){var t,i=this.parent,n=i.activeObj,o=Pe({},i.activeObj,null,!0),r=0===n.shapeDegree?i.transform.degree:i.transform.degree-n.shapeDegree,s={startX:0,startY:0,width:0,height:0},a=(s.width=(r=(r=-450===r?-90:r)<0?360+r:r)%90==0&&r%180!=0?n.activePoint.height:n.activePoint.width,s.height=r%90==0&&r%180!=0?n.activePoint.width:n.activePoint.height,s.startX=n.activePoint.startX,s.startY=n.activePoint.startY,s.startX),l=s.startY;e.save();for(var h=0,d=n.rotateFlipColl.length;h<d;h++){var p=n.rotateFlipColl[h];"number"==typeof p?(t=p,s.width=(t=(t=-450===t?-90:t)<0?360+t:t)%90==0&&t%180!=0?n.activePoint.height:n.activePoint.width,s.height=t%90==0&&t%180!=0?n.activePoint.width:n.activePoint.height,e.translate(e.canvas.width/2,e.canvas.height/2),e.rotate(Math.PI/180*p),e.translate(-e.canvas.height/2,-e.canvas.width/2),t%90==0&&t%270!=0||0===t?(l=e.canvas.width-(n.activePoint.startX+n.activePoint.width),l+=(n.activePoint.width-s.height)/2,a=s.startY):t%270==0&&(a=e.canvas.height-(n.activePoint.startY+n.activePoint.height),a+=(n.activePoint.height-s.width)/2,l=s.startX),s.startX=a,s.startY=l,n.activePoint.startX=a,n.activePoint.startY=l,n.activePoint.endX=n.activePoint.startX+s.width,n.activePoint.endY=n.activePoint.startY+s.height,n=this.updateWidthHeight(n)):("horizontal"===p&&r%90==0&&r%180!=0?p="vertical":"vertical"===p&&r%90==0&&r%180!=0&&(p="horizontal"),"horizontal"===p?(e.translate(e.canvas.width,0),e.scale(-1,1),n.activePoint=this.updateActPoint("horizontal",e)):"vertical"===p&&(e.translate(0,e.canvas.height),e.scale(1,-1),n.activePoint=this.updateActPoint("vertical",e)),s.startX=n.activePoint.startX,s.startY=n.activePoint.startY),s.startX=n.activePoint.startX,s.startY=n.activePoint.startY,a=s.startX,l=s.startY}0!==n.rotatedAngle&&i.notify("shape",{prop:"setPointCollForShapeRotation",onPropertyChange:!1,value:{obj:n}}),e.drawImage(n.imageCanvas,s.startX,s.startY,s.width,s.height),e.restore(),i.activeObj=o,360!==i.transform.degree&&-360!==i.transform.degree||(i.transform.degree=0)},G6t.prototype.rotateText=function(e){var t,i=this.parent,n=i.activeObj,o=Pe({},i.activeObj,null,!0),r=i.activeObj.activePoint,s=0===n.shapeDegree?i.transform.degree:i.transform.degree-n.shapeDegree,a={startX:0,startY:0,width:0,height:0},l=(a.width=(s=(s=-450===s?-90:s)<0?360+s:s)%90==0&&s%180!=0?r.height:r.width,a.height=s%90==0&&s%180!=0?r.width:r.height,a.startX=r.startX,a.startY=r.startY,a.startX),h=a.startY;e.save();for(var d=0,p=n.rotateFlipColl.length;d<p;d++){var c=n.rotateFlipColl[d];"number"==typeof c?(t=c,a.width=(t=(t=-450===t?-90:t)<0?360+t:t)%90==0&&t%180!=0?r.height:r.width,a.height=t%90==0&&t%180!=0?r.width:r.height,e.translate(e.canvas.width/2,e.canvas.height/2),e.rotate(Math.PI/180*c),e.translate(-e.canvas.height/2,-e.canvas.width/2),t%90==0&&t%270!=0||0===t?(h=e.canvas.width-r.endX,l=r.startY):t%270==0&&(l=e.canvas.height-r.endY,h=r.startX),a.startX=l,a.startY=h,r.startX=l,r.startY=h,r.endX=r.startX+a.width,r.endY=r.startY+a.height,n=this.updateWidthHeight(n)):("horizontal"===c&&s%90==0&&s%180!=0?c="vertical":"vertical"===c&&s%90==0&&s%180!=0&&(c="horizontal"),"horizontal"===c?(e.translate(e.canvas.width,0),e.scale(-1,1)):"vertical"===c&&(e.translate(0,e.canvas.height),e.scale(1,-1)),n.activePoint=r=this.updateActPoint(c,e),a.startX=r.startX,a.startY=r.startY),a.startX=r.startX,a.startY=r.startY,l=a.startX,h=a.startY}0!==n.rotatedAngle&&i.notify("shape",{prop:"setPointCollForShapeRotation",onPropertyChange:!1,value:{obj:n}}),h+=.4*n.textSettings.fontSize,this.textFlipDegree(e,l,h),e.restore(),i.activeObj=o,360!==i.transform.degree&&-360!==i.transform.degree||(i.transform.degree=0)},G6t.prototype.textFlipDegree=function(e,t,i){for(var n=this.parent.activeObj,o=n.keyHistory.split("\n"),r=n.textSettings.fontSize,s=.85*r+(r*o.length-r*o.length)/o.length,a=0,l=o.length;a<l;a++){var h=o[a];0<a&&(1===a&&(s-=.85*r),s+=r+.15*r),e.strokeText(h,t+.15*r,i+s+(0<a?.25*r:.35*-r)),e.fillText(h,t+.15*r,i+s+(0<a?.25*r:.35*-r))}},G6t.prototype.clearOuterCanvas=function(e){var t=this.parent,i=t.img,n=i.destLeft,o=i.destTop,r=i.destWidth,i=i.destHeight,s=0<o?o:0;e.clearRect(0,0,0<n?n:0,t.lowerCanvas.height),e.clearRect(n+r,0,t.lowerCanvas.width-(n+r),t.lowerCanvas.height),e.clearRect(0,0,t.lowerCanvas.width,s),e.clearRect(0,o+i,t.lowerCanvas.width,t.lowerCanvas.height-(o+i)),""!==t.transform.currFlipState&&(t.img.destLeft=n,t.img.destTop=o)},G6t.prototype.setDestPoints=function(){var e,t,i=this.parent,n=i.transform,o=n.degree,n=n.zoomFactor;o%90==0&&o%180!=0?(i.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!(t={width:0,height:0}),value:{width:i.img.srcHeight,height:i.img.srcWidth,obj:t,isImgShape:null}}),e=t,this.isRotateZoom&&(e.width+=e.width*n,e.height+=e.height*n,i.img.destWidth=e.height,i.img.destHeight=e.width),i.img.destLeft=(i.lowerCanvas.clientWidth-e.height)/2,i.img.destTop=(i.lowerCanvas.clientHeight-e.width)/2,i.img.destWidth=e.height,i.img.destHeight=e.width):(i.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!(t={width:0,height:0}),value:{width:i.img.srcWidth,height:i.img.srcHeight,obj:t,isImgShape:null}}),e=t,this.isRotateZoom&&(e.width+=e.width*n,e.height+=e.height*n,i.img.destWidth=e.width,i.img.destHeight=e.height),i.img.destLeft=(i.lowerCanvas.clientWidth-e.width)/2,i.img.destTop=0===o?(i.lowerCanvas.clientHeight-e.height+1)/2:(i.lowerCanvas.clientHeight-e.height)/2,i.img.destWidth=e.width,i.img.destHeight=e.height)},G6t.prototype.updateCurrTransState=function(e,t,i,n){var o=this.parent,r=o.img.destLeft,s=o.img.destTop;"initial"===e&&(this.lowerContext.setTransform(1,0,0,1,0,0),je(t))&&this.setDestPoints(),o.isCircleCrop||o.currSelectionPoint&&"crop-circle"===o.currSelectionPoint.shape?(this.currTransState(e,!0,null,i),0===o.transform.degree&&""===o.transform.currFlipState&&0===o.transform.straighten&&je(n)&&(o.img.destLeft=r,o.img.destTop=s),i&&(o.img.destLeft+=o.panPoint.totalPannedClientPoint.x,o.img.destTop+=o.panPoint.totalPannedClientPoint.y),o.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),i&&(o.img.destLeft-=o.panPoint.totalPannedClientPoint.x,o.img.destTop-=o.panPoint.totalPannedClientPoint.y)):(this.currTransState(e,null,null,i),0===o.transform.degree&&""===o.transform.currFlipState&&0===o.transform.straighten&&je(n)&&(o.img.destLeft=r,o.img.destTop=s))},G6t.prototype.currTransState=function(e,t,i,n){var o=this.parent;i=i||this.lowerContext,"initial"===e?this.setTransformColl(i,e):"reverse"===e&&(this.setTransformColl(i,e),this.setClientTransDim(t),o.isCircleCrop||o.currSelectionPoint&&"crop-circle"===o.currSelectionPoint.shape&&je(n))&&(n&&(o.img.destLeft+=o.panPoint.totalPannedClientPoint.x,o.img.destTop+=o.panPoint.totalPannedClientPoint.y),o.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),n)&&(o.img.destLeft-=o.panPoint.totalPannedClientPoint.x,o.img.destTop-=o.panPoint.totalPannedClientPoint.y)},G6t.prototype.setTransformColl=function(e,t){var i=this.parent;if("initial"===t)for(var n=0,o=i.rotateFlipColl.length;n<o;n++)this.setTransform(e,i.rotateFlipColl[n]);else if("reverse"===t)for(n=i.rotateFlipColl.length-1;0<=n;n--)this.setTransform(e,i.rotateFlipColl[n],!0)},G6t.prototype.setTransform=function(e,t,i){var n=this.parent;switch(i&&90===t?t=-90:i&&-90===t&&(t=90),"horizontal"===t&&n.transform.degree%90==0&&n.transform.degree%180!=0?t="vertical":"vertical"===t&&n.transform.degree%90==0&&n.transform.degree%180!=0&&(t="horizontal"),n.notify("transform",{prop:"setReverseRotate",onPropertyChange:!1,value:{bool:!0}}),n.notify("transform",{prop:"setReverseFlip",onPropertyChange:!1,value:{isReverseFlip:!0}}),je(i)&&e.clearRect(0,0,e.canvas.width,e.canvas.height),t){case 90:case-90:e.translate(e.canvas.width/2,e.canvas.height/2),e.rotate(Math.PI/180*t),e.translate(-e.canvas.width/2,-e.canvas.height/2);break;case"horizontal":e.translate(e.canvas.width,0),e.scale(-1,1);break;case"vertical":e.translate(0,e.canvas.height),e.scale(1,-1)}n.notify("transform",{prop:"setReverseRotate",onPropertyChange:!1,value:{bool:!1}}),n.notify("transform",{prop:"setReverseFlip",onPropertyChange:!1,value:{isReverseFlip:!1}})},G6t.prototype.drawImgToCanvas=function(e){var t=this.parent,e=(this.lowerContext.clearRect(0,0,t.lowerCanvas.width,t.lowerCanvas.height),t.img.destWidth=e.width,t.img.destHeight=e.height,this.isInitialLoading&&(t.notify("filter",{prop:"initFilter",onPropertyChange:!1}),this.isInitialLoading=!1),this.lowerContext.filter);this.lowerContext.clearRect(0,0,t.lowerCanvas.width,t.lowerCanvas.height),this.drawImage(),(t.currSelectionPoint&&"crop-circle"===t.currSelectionPoint.shape||t.isCircleCrop)&&t.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),this.lowerContext.filter=e},G6t.prototype.renderImage=function(e,t,i,n){var o=this.parent;o.notify("shape",{prop:"applyActObj",onPropertyChange:!1,value:{isMouseDown:null}}),je(t)&&(this.upperContext.clearRect(0,0,o.lowerCanvas.width,o.lowerCanvas.height),this.lowerContext.clearRect(0,0,o.lowerCanvas.width,o.lowerCanvas.height)),e?this.setTransformColl(this.lowerContext,"initial"):(0!==o.transform.zoomFactor&&(this.isRotateZoom=!0),this.updateCurrTransState("initial",null,null,n)),o.notify("transform",{prop:"setDestPointsForFlipState",onPropertyChange:!1}),this.drawImage(),o.notify("transform",{prop:"setDestPointsForFlipState",onPropertyChange:!1}),e?this.setTransformColl(this.lowerContext,"reverse"):(this.updateCurrTransState("reverse",null,null,n),this.isRotateZoom=!1),i?o.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}):o.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"iterate",pen:"iterate",isPreventApply:null}}),this.clearOuterCanvas(this.lowerContext),(o.isCircleCrop||o.currSelectionPoint&&"crop-circle"===o.currSelectionPoint.shape)&&o.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}})},G6t.prototype.imageOnLoad=function(a){var l=this,h=this.parent,d=this;h.baseImg.src=a,h.baseImg.onload=function(){h.imgSrc=a,h.isUndoRedo||h.notify("filter",{prop:"update-finetunes",onPropertyChange:!1}),d.lowerContext.drawImage(h.baseImg,0,0,d.parent.lowerCanvas.width,d.parent.lowerCanvas.height);var e,t,i,n,o=!1,r=!1,s=(h.isImageUpdated&&(s=(e=h.img).srcWidth,e=e.srcHeight,t=(i=h.baseImgCanvas).width,i=i.height,o=s!==t||e!==i,r=h.baseImg.width===t&&h.baseImg.height===i),BA(h.element),h.element.style.opacity="1",d.updateBaseImgCanvas(),{fileName:l.fileName,fileType:l.fileType,isValidImage:!0});d.updateCanvas(o,r),h.currObjType.isUndoZoom&&(h.currObjType.isUndoZoom=!1,d.parent.lowerCanvas.style.display="block"),h.isUndoRedo=l.isErrorImage=!1,F.isDevice?(h.notify("toolbar",{prop:"destroy-top-toolbar",onPropertyChange:!1}),h.notify("toolbar",{prop:"destroy-bottom-toolbar",onPropertyChange:!1}),n={isApplyBtn:!1,isDevice:F.isDevice,isOkBtn:null,isResize:null,isFrame:null,isMainToolbar:!0},h.notify("toolbar",{prop:"init-main-toolbar",onPropertyChange:!1,value:n}),h.notify("toolbar",{prop:"create-bottom-toolbar",onPropertyChange:!1})):(h.notify("toolbar",{prop:"destroy-top-toolbar",onPropertyChange:!1}),h.notify("toolbar",{prop:"init-main-toolbar",onPropertyChange:!(n={isApplyBtn:!1,isDevice:!1,isOkBtn:null}),value:n})),h.isImageLoaded&&"0.5"!==h.element.style.opacity&&(h.trigger("fileOpened",s),h.triggerEditCompleteEvent({action:"file-open",actionEventArgs:s}))},h.baseImg.onerror=function(){BA(h.element),d.isErrorImage=!0,d.errorLoading()}},G6t.prototype.errorLoading=function(){this.parent.trigger("fileOpened",{fileName:null,fileType:null,isValidImage:!1})},G6t.prototype.updateBaseImgCanvas=function(){var e=this.parent;e.baseImgCanvas.width=e.baseImg.width,e.baseImgCanvas.height=e.baseImg.height,e.baseImgCanvas.getContext("2d").drawImage(e.baseImg,0,0)},G6t.prototype.updateCanvas=function(e,t){var i=this.parent,t=(i.isImageUpdated&&e?!t&&e&&(i.img.srcLeft=0,i.img.srcTop=0,i.img.srcWidth=i.baseImgCanvas.width,i.img.srcHeight=i.baseImgCanvas.height,i.currSelectionPoint=null,i.cropObj={cropZoom:0,defaultZoom:0,totalPannedPoint:{x:0,y:0},totalPannedClientPoint:{x:0,y:0},totalPannedInternalPoint:{x:0,y:0},tempFlipPanPoint:{x:0,y:0},activeObj:{},rotateFlipColl:[],degree:0,currFlipState:"",straighten:0,destPoints:{startX:0,startY:0,width:0,height:0},srcPoints:{startX:0,startY:0,width:0,height:0},filter:"",isBrightAdjust:!1,zoomFactor:0,previousZoomValue:0,aspectWidth:null,aspectHeight:null,frame:"none",straightenZoom:0,adjustmentLevel:{brightness:0,contrast:0,hue:0,opacity:100,saturation:0,blur:0,exposure:0,transparency:100,sharpen:!1,bw:!1},currentFilter:""}):(i.img.srcWidth=i.baseImgCanvas.width,i.img.srcHeight=i.baseImgCanvas.height),{width:0,height:0}),e=(i.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!1,value:{width:i.img.srcWidth,height:i.img.srcHeight,obj:t,isImgShape:null}}),t),t=(i.img.destLeft=(i.lowerCanvas.clientWidth-e.width)/2,i.img.destTop=(i.lowerCanvas.clientHeight-e.height+1)/2,this.drawImgToCanvas(e),this.origDim.width=i.img.destWidth,this.origDim.height=i.img.destHeight,this.zoomCrop.width=i.img.destWidth,this.zoomCrop.height=i.img.destHeight,i.notify("transform",{prop:"setCropDimension",onPropertyChange:!1,value:{width:i.img.destWidth,height:i.img.destHeight}}),{startX:i.img.destLeft,startY:i.img.destTop,width:i.img.destWidth,height:i.img.destHeight}),e=(i.notify("crop",{prop:"setCropDestPoints",onPropertyChange:!1,value:{point:t}}),this.lowerContext.filter);this.lowerContext.filter="none",i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"iterate",pen:"zoom",isPreventApply:null}}),this.lowerContext.filter=e,0<i.img.destWidth&&0<i.img.destHeight&&(i.isImageLoaded=!0),i.isUndoRedo&&""!==i.transform.currFlipState&&i.notify("transform",{prop:"flipImage",onPropertyChange:!1,value:{direction:i.toPascalCase(i.transform.currFlipState)}}),i.disabled&&i.element.setAttribute("class","e-disabled"),1===i.zoomSettings.zoomFactor&&!i.zoomSettings.zoomPoint||i.zoom(i.zoomSettings.zoomFactor,i.zoomSettings.zoomPoint),je(this.initZoomValue)&&(this.initZoomValue=i.zoomSettings.zoomFactor),this.isImageEdited=!1},G6t.prototype.resetFrameZoom=function(e){var t,i=this.parent;je(i.tempFrameZoomLevel)||(t=i.tempFrameZoomLevel,i.tempFrameZoomLevel=null,i.notify("transform",{prop:"resetZoom",onPropertyChange:!1}),i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:t,zoomPoint:null,isResize:!0}}),t=i.cancelCropSelection,e&&t&&(t.previousObj.frameObj=Pe({},i.frameObj,null,!0),t.currentObj.frameObj=Pe({},i.frameObj,null,!0),t.previousObj.frame=t.currentObj.frame=i.frameObj.type),this.updateCropSelObj(),i.cancelCropSelection=null)},G6t.prototype.performCancel=function(e,t,i){var n=this.parent;i&&(n.noPushUndo=!1);var o,r=n.isStraightening,s=(e=e||!1,{bool:!1}),t=(n.allowDownScale=!0,n.notify("selection",{prop:"getFreehandDrawEditing",onPropertyChange:!1,value:{obj:s}}),je(t)&&JSON.stringify(n.frameObj)!==JSON.stringify(n.tempFrameObj)&&(Pe(n.frameObj,n.tempFrameObj),this.renderImage(null,null,!0)),this.resetFrameZoom(!1),{action:""}),e=(s.bool?(n.notify(t.action="freehand-draw",{prop:"cancelFhd",onPropertyChange:!1}),n.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1}),n.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}})):"block"===n.textArea.style.display||"inline-block"===n.textArea.style.display?(t.action="text-editing",n.textArea.style.display="none",n.textArea.value="",n.textArea.style.transform="",this.prevActObj?(n.activeObj=this.prevActObj,this.prevActObj=null):(n.activeObj.strokeSettings=this.tempStrokeSettings,n.activeObj.textSettings=this.tempTextSettings),n.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"cancel"}}),this.isShapeTextInserted&&n.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),n.notify("shape",{prop:"applyActObj",onPropertyChange:!1,value:{isMouseDown:!0}}),n.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1}),n.notify("selection",{prop:"setTempActObj",onPropertyChange:!1,value:{obj:n.activeObj}}),n.drawingShape&&n.enableShapeDrawing(n.toPascalCase(n.drawingShape),!0)):n.activeObj.shape&&"redact"===n.activeObj.shape||!((!F.isDevice||F.isDevice&&!r)&&document.querySelector("#"+n.element.id+"_sliderWrapper")||n.currObjType.isFiltered)?n.activeObj.shape&&"redact"===n.activeObj.shape||!e||F.isDevice&&(!F.isDevice||r)?(this.cancelItems(t),0<n.transform.zoomFactor?(n.togglePan=!0,n.notify("selection",{prop:"setDragCanvas",value:{bool:!0}})):(n.togglePan=!1,n.notify("selection",{prop:"setDragCanvas",value:{bool:!1}}))):n.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!(o={type:"main",isApplyBtn:null,isCropping:null,isZooming:null}),value:o}):(t.action=n.isFinetuneBtnClick?"fine-tune":"filter",this.lowerContext.filter=this.tempAdjValue,n.canvasFilter=this.tempAdjValue,n.notify("filter",{prop:"setAdjustmentValue",onPropertyChange:!1,value:{adjustmentValue:this.tempAdjValue}}),n.initialAdjustmentValue=this.tempAdjValue,1<this.lowerContext.filter.split(" ").length&&"1"===this.lowerContext.filter.split(" ")[0].split("(")[1].split(")")[0]&&n.notify("filter",{prop:"setBrightnessAdjusted",onPropertyChange:!1,value:{isBrightnessAdjusted:!1}}),n.currentFilter=this.tempFilter,n.notify("filter",{prop:"setBevelFilter",onPropertyChange:!1,value:{bevelFilter:this.lowerContext.filter}}),this.lowerContext.clearRect(0,0,n.lowerCanvas.width,n.lowerCanvas.height),this.redrawImgWithObj(),n.currObjType.isFiltered=!1,n.notify("filter",{prop:"getTempAdjustmentLevel",onPropertyChange:!(s={tempAdjustmentLevel:null}),value:{obj:s}}),n.notify("filter",{prop:"setAdjustmentLevel",onPropertyChange:!1,value:{adjustmentLevel:Pe({},s.tempAdjustmentLevel,{},!0)}}),n.notify("undo-redo",{prop:"setUndoRedoStep",onPropertyChange:!1,value:{step:this.tempUndoRedoStep}}),n.upperCanvas.style.cursor=n.cursor="default",n.currObjType.isCustomCrop=!1,this.tempStrokeSettings={strokeColor:"#fff",fillColor:"",strokeWidth:null,radius:null,outlineColor:"",outlineWidth:null},this.clearOuterCanvas(this.lowerContext),(n.currSelectionPoint&&"crop-circle"===n.currSelectionPoint.shape||n.isCircleCrop)&&n.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),o={type:"main",isApplyBtn:null,isCropping:null,isZooming:null},n.element.querySelector(".e-contextual-toolbar-wrapper").classList.add("e-hide"),n.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:o}),n.activeObj.shape&&"image"===n.activeObj.shape&&n.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1}),n.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"cancel"}}),n.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.upperContext.clearRect(0,0,n.upperCanvas.width,n.upperCanvas.height),n.drawingShape&&(n.drawingShape=null,n.notify("selection",{prop:"setCurrentDrawingShape",onPropertyChange:!1,value:{value:""}}))),this.isShapeTextInserted=!1,this.isNewPath=!1,n.notify("toolbar",{prop:"refresh-dropdown-btn",value:{isDisabled:!1}}),n.notify("toolbar",{prop:"setCurrentToolbar",value:{type:"main"}}),i&&(n.noPushUndo=!1),n.drawingShape=null,n.notify("draw",{prop:"resetTempObjColl"}),n.notify("draw",{prop:"resetTempPointColl"}),n.isMaskImage=n.isFinetuneBtnClick=!1,{action:"cancel",actionEventArgs:t});n.triggerEditCompleteEvent(e)},G6t.prototype.cancelItems=function(e){var t,i=this.parent,n=!1,o=i.element.id,r=i.element.querySelector("#"+o+"_aspectratio"),o=i.element.querySelector("#"+o+"_nonaspectratio");switch((n=void 0===(t=void 0!==i.activeObj.shape?i.activeObj.shape.split("-"):t)&&i.currObjType.isCustomCrop||void 0!==t&&"crop"===t[0]?!0:n)&&i.isCropTab&&(i.isCropTab=!1,i.transform.zoomFactor=i.transform.defaultZoomFactor),i.isResize&&(r||o||"resize-toolbar"===i.currentToolbar)&&(e.action="resize",i.notify("selection",{prop:"getNumTextValue",onPropertyChange:!(t={width:null,height:null}),value:{obj:t}}),r={x:t.width,y:t.height},o=i.element.querySelector("#"+i.element.id+"_aspectratio"),t=i.element.querySelector(".e-ie-toolbar-aspect-ratio-btn"),r.x&&r.y&&!je(i.aspectWidth)&&(o||t&&!t.classList.contains("e-hidden")?i.notify("transform",{prop:"resizeImage",value:{width:i.aspectWidth,height:i.aspectHeight}}):(r=i.currObjType.isUndoAction,i.currObjType.isUndoAction=!1,i.notify("transform",{prop:"resizeCrop",value:{width:i.aspectWidth,height:i.aspectHeight}}),i.currObjType.isUndoAction=r)),o={prevCropObj:i.prevCropObj},t={prevObj:i.prevObj},i.notify("toolbar",{prop:"getPrevCropObj",onPropertyChange:!1,value:{obj:o}}),i.notify("toolbar",{prop:"getPrevObj",onPropertyChange:!1,value:{obj:t}}),o.prevCropObj&&t.prevObj&&(i.objColl=[],i.pointColl=[],i.freehandCounter=0,i.cropObj=Pe({},o.prevCropObj,{},!0),this.setCurrentObj(t.prevObj),i.objColl=t.prevObj.objColl,i.pointColl=t.prevObj.pointColl,i.freehandCounter=i.pointColl.length,i.transform.straighten=0,i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),r=i.currSelectionPoint?Pe({},i.currSelectionPoint,{},!0):null,i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:-i.transform.zoomFactor,zoomPoint:null,isResize:!0}}),i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:t.prevObj.defaultZoom,zoomPoint:null,isResize:!0}}),i.currSelectionPoint=r,t.prevObj.zoomFactor&&i.setProperties({zoomSettings:{zoomFactor:t.prevObj.zoomFactor}},!0),i.notify("transform",{prop:"setPreviousZoomValue",onPropertyChange:!1,value:{previousZoomValue:i.zoomSettings.zoomFactor}})),i.isResize=!1,i.notify("transform",{prop:"setResizedImgAngle",onPropertyChange:!1,value:{angle:null}}),o=i.isCropTab,i.isCropTab=!1,this.updateCropSelObj(),i.cancelCropSelection=null,i.isCropTab=o),!0){case i.togglePen:e.action="freehand-draw",this.cancelPen();break;case"text"===i.activeObj.shape:e.action="text",this.cancelText();break;case-1!==["rectangle","ellipse","line","arrow","path","image","redact"].indexOf(i.activeObj.shape):e.action=i.activeObj.shape,this.cancelShape(),i.currObjType.isRedact=!1;break;case n:e.action="crop-selection",this.cancelSelection();break;default:i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height),i.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"cancel"}})}i.notify("selection",{prop:"setCurrentDrawingShape",onPropertyChange:!1,value:{value:""}}),i.upperCanvas.style.cursor=i.cursor="default",i.currObjType.isCustomCrop=!1,this.tempStrokeSettings={strokeColor:"#fff",fillColor:"",strokeWidth:null,radius:null,outlineColor:"",outlineWidth:null};i.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:null,isCropping:!1,isZooming:null}})},G6t.prototype.cancelPen=function(){var e=this.parent,t=(this.upperContext.clearRect(0,0,e.upperCanvas.width,e.upperCanvas.height),e.togglePen=!1,e.upperCanvas.style.cursor=e.cursor="default",Pe([],e.pointColl,[],!0));e.pointColl={};for(var i=0;i<this.tempFreehandCounter;i++)e.pointColl[i]=t[i];e.freehandCounter=this.tempFreehandCounter,e.notify("freehand-draw",{prop:"setCurrentFreehandDrawIndex",value:{value:this.tempCurrFhdIndex}}),e.activeObj.strokeSettings=this.tempStrokeSettings,e.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:e.activeObj.strokeSettings,strokeColor:null,fillColor:null,strokeWidth:null,radius:null}}),e.notify("freehand-draw",{prop:"setPenStrokeWidth",onPropertyChange:!1,value:{value:this.tempStrokeWidth}}),e.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"cancel"}}),e.notify("selection",{prop:"setFreehandDrawCustomized",value:{isFreehandDrawCustomized:!1}}),e.objColl=Pe([],this.tempObjColl,[],!0),e.pointColl=Pe([],this.tempPointColl,[],!0),e.freehandCounter=e.pointColl.length,this.tempPointColl={},this.renderImage(),e.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok",isCancel:!0}})},G6t.prototype.cancelText=function(){var e,t,i=this.parent;i.notify("shape",{prop:"setTextSettings",onPropertyChange:!1,value:{textSettings:this.tempTextSettings,fontFamily:null,fontSize:null}}),i.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:this.tempStrokeSettings,strokeColor:null,fillColor:null,strokeWidth:null,radius:null}}),!je(i.activeObj.currIndex)&&(i.notify("undo-redo",{prop:"getAppliedUndoRedoColl",value:{obj:t={appliedUndoRedoColl:[]}}}),e=t.appliedUndoRedoColl.length,t=t.appliedUndoRedoColl[e-1],this.prevActObj)&&t&&t.currentObjColl.length&&t.currentObjColl[t.currentObjColl.length-1].currIndex===this.prevActObj.currIndex?(i.activeObj=this.prevActObj,this.prevActObj=null):(i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height)),i.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1}),this.tempTextSettings={text:"Enter Text",fontFamily:i.fontFamily.default,fontSize:null,fontRatio:null,bold:!1,italic:!1,underline:!1},i.objColl=Pe([],this.tempObjColl,[],!0),i.pointColl=Pe([],this.tempPointColl,[],!0),this.renderImage(),this.tempObjColl=[],i.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok",isCancel:!0}})},G6t.prototype.cancelShape=function(){var e=this.parent;if(e.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:this.tempStrokeSettings,strokeColor:null,fillColor:null,strokeWidth:null,radius:null}}),je(e.activeObj.currIndex))e.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.upperContext.clearRect(0,0,e.upperCanvas.width,e.upperCanvas.height);else{if(this.isNewPath)e.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.upperContext.clearRect(0,0,e.upperCanvas.width,e.upperCanvas.height);else{for(var t={appliedUndoRedoColl:[]},i=(e.notify("undo-redo",{prop:"getAppliedUndoRedoColl",value:{obj:t}}),void 0),n=0,o=t.appliedUndoRedoColl.length;n<o;n++)for(var r=t.appliedUndoRedoColl[n].currentObjColl,s=0,a=r.length;s<a;s++)if(this.prevActObj&&this.prevActObj.currIndex&&r[s].currIndex===this.prevActObj.currIndex){i=r[0];break}this.prevActObj&&i?(e.activeObj=this.prevActObj,this.prevActObj=null,e.notify("selection",{prop:"redrawShape",onPropertyChange:!1,value:{obj:e.activeObj}}),e.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"cancel"}}),e.notify("shape",{prop:"applyActObj",onPropertyChange:!1,value:{isMouseDown:!0}})):(e.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.upperContext.clearRect(0,0,e.upperCanvas.width,e.upperCanvas.height));var l={undoRedoStep:null};e.notify("undo-redo",{prop:"getUndoRedoStep",value:{obj:l}}),t.appliedUndoRedoColl[l.undoRedoStep-1]?e.objColl=Pe([],t.appliedUndoRedoColl[l.undoRedoStep-1].currentObjColl,[],!0):e.objColl=[]}this.renderImage()}e.currObjType.isDragging=!1,e.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1}),e.objColl=Pe([],this.tempObjColl,[],!0),e.pointColl=Pe([],this.tempPointColl,[],!0),this.renderImage(),this.tempObjColl=[],e.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok",isCancel:!0}})},G6t.prototype.cancelSelection=function(){var e,t=this.parent;t.cancelCropSelection&&(e={value:t.tempStraighten},t.transform.straighten=e.value,t.straightenBaseImageCanvas(),t.notify("freehand-draw",{prop:"resetStraightenPoint"}),t.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}}),t.notify("draw",{prop:"setStraightenActObj",value:{activeObj:t.activeObj}}),t.notify("crop",{prop:"resizeWrapper"}),this.updateCropSelObj(),this.tempStraightenDestPoints)&&JSON.stringify(this.tempStraightenDestPoints)!==JSON.stringify(this.straightenDestPoints)&&(this.straightenDestPoints=Pe({},this.tempStraightenDestPoints,{},!0))},G6t.prototype.updateCropSelObj=function(){var e=this.parent;e.cancelCropSelection&&(e.cropObj=Pe({},e.cancelCropSelection.previousCropObj,{},!0),e.afterCropActions=e.cancelCropSelection.previousObj.afterCropActions,e.notify("undo-redo",{prop:"undoDefault",onPropertyChange:!1,value:{obj:e.cancelCropSelection}}),e.currSelectionPoint=Pe({},e.cancelCropSelection.previousCropObj.activeObj,!0),e.currSelectionPoint&&je(e.currSelectionPoint.shape)&&(e.currSelectionPoint=null),this.clearOuterCanvas(this.lowerContext),e.isCircleCrop||e.currSelectionPoint&&"crop-circle"===e.currSelectionPoint.shape)&&e.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}})},G6t.prototype.updateCropSelection=function(){var e=this.parent,t={currObj:{}},t=(e.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:t}}),t.currObj),i=(t.objColl=Pe([],e.objColl,[],!0),t.pointColl=Pe([],e.pointColl,[],!0),t.afterCropActions=Pe([],e.afterCropActions,[],!0),{selPointColl:null});e.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:i}}),t.selPointColl=Pe([],i.selPointColl,[],!0),e.cancelCropSelection={operation:"cropTransform",previousObj:t,currentObj:t,previousObjColl:t.objColl,currentObjColl:t.objColl,previousPointColl:t.pointColl,currentPointColl:t.pointColl,previousSelPointColl:t.selPointColl,currentSelPointColl:t.selPointColl,previousCropObj:Pe({},e.cropObj,{},!0),currentCropObj:Pe({},e.cropObj,{},!0),previousText:null,currentText:null,filter:null,isCircleCrop:e.isCircleCrop}},G6t.prototype.updateFlipPan=function(e){var t,i=this.parent;""!==i.transform.currFlipState&&(t=this.lowerContext.filter,i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),i.notify("transform",{prop:"rotatedFlip",onPropertyChange:!1}),this.lowerContext.filter="none",i.notify("freehand-draw",{prop:"freehandRedraw",onPropertyChange:!1,value:{context:this.lowerContext,points:null}}),this.lowerContext.filter=t,this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height),e)&&this.drawObject("duplicate",e)},G6t.prototype.select=function(e,t,i,n,o){var r,s,a=this.parent;e=e.toLowerCase(),!a.disabled&&a.isImageLoaded&&(a.allowDownScale=!1,a.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(s={currObj:{}}),value:{object:s}}),(s=s.currObj).objColl=Pe([],a.objColl,[],!0),s.pointColl=Pe([],a.pointColl,[],!0),s.afterCropActions=a.afterCropActions,a.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(r={selPointColl:null}),value:{obj:r}}),s.selPointColl=Pe([],r.selPointColl,[],!0),a.notify("crop",{prop:"setPreviousCropCurrentObj",onPropertyChange:!1,value:{obj:s}}),0<a.transform.zoomFactor&&a.activeObj.shape&&"crop"===a.activeObj.shape.split("-")[0]&&je(this.currSelPoint)&&(this.currSelPoint=Pe({},a.activeObj,{},!0)),r=!1,((s=void 0)===(s=void 0!==a.activeObj.shape?a.activeObj.shape.split("-"):s)&&a.currObjType.isCustomCrop||void 0!==s&&"crop"===s[0])&&(r=!0),a.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(s={currObj:{}}),value:{object:s}}),(s=s.currObj).objColl=Pe([],a.objColl,[],!0),s.pointColl=Pe([],a.pointColl,[],!0),s.afterCropActions=Pe([],a.afterCropActions,[],!0),a.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:null}}),a.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),a.notify("shape",{prop:"setKeyHistory",onPropertyChange:!1,value:{keyHistory:""}}),this.upperContext.clearRect(0,0,a.upperCanvas.width,a.upperCanvas.height),a.upperCanvas.style.display="block",a.currSelectionPoint||0!==a.transform.defaultZoomFactor||0!==a.transform.degree&&0!==a.panPoint.totalPannedInternalPoint.x&&0!==a.panPoint.totalPannedInternalPoint.y&&!r?(a.isCircleCrop=!1,0===a.transform.defaultZoomFactor||this.isResizeSelect||(s=a.isCropTab,a.isCropTab=!1,a.notify("transform",{prop:"resetZoom",onPropertyChange:!1}),a.isCropTab=s,this.resetPanPoints()),a.notify("freehand-draw",{prop:"updateFHDColl",onPropertyChange:!1}),a.isCropTab=!0,a.isCircleCrop=!1,this.isResizeSelect||a.notify("crop",{prop:"setCurrSelPoints",onPropertyChange:!1,value:{isSetDimension:!0}}),a.transform.zoomFactor=a.transform.cropZoomFactor,je(a.cropObj.activeObj.shape)&&(a.currObjType.shape="crop-"+e,this.drawNewSelection(e,t,i,n,o))):(this.isCropSelect?this.isCropSelect=!1:(a.notify("crop",{prop:"adjustStraightenForShapes",onPropertyChange:!1,value:{type:"reverse",isInitialRotated:!0}}),a.notify("freehand-draw",{prop:"updateFHDColl",onPropertyChange:!1}),this.renderImage()),"custom"===e&&(a.currObjType.shape=""),this.drawNewSelection(e,t,i,n,o)))},G6t.prototype.drawNewSelection=function(e,t,i,n,o){var r,s=this.parent,e="crop-"+e.toLowerCase();"crop-custom"==e?""!==s.currObjType.shape&&"crop-custom"!==s.currObjType.shape||(this.drawCustomSelection("crop-custom",t,i,n,o),this.adjToStraighten(),this.updateSelectionInsert(),s.isStraightening&&(this.straightenActObj=Pe({},s.activeObj,{},!0),this.straightenInitZoom=s.transform.zoomFactor)):"crop-canvas"==e?(s.upperCanvas.style.display="block",s.notify("selection",{prop:"setDragCanvas",value:{bool:!0}})):(s.currObjType.isCustomCrop=!1,s.currObjType.shape=e,n&&o?r={startX:t,startY:i,endX:t+n,endY:i+o,width:n,height:o}:n&&"crop-circle"==e&&(r={startX:t,startY:i,endX:t+n,endY:i+n,width:n,height:n}),s.activeObj.shape=e,this.updateSelectionInsert(r))},G6t.prototype.updateSelectionInsert=function(e){var t=this.parent,i=t.activeObj.activePoint,n={shapeSettingsObj:{}},n=(t.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:n}}),{type:t.getSelectionType(n.shapeSettingsObj.type),startX:n.shapeSettingsObj.startX,startY:n.shapeSettingsObj.startY,width:n.shapeSettingsObj.width,height:n.shapeSettingsObj.height}),n={action:"insert",previousSelectionSettings:n,currentSelectionSettings:n};t.trigger("selectionChanging",n),t.editCompleteArgs=n,t.notify("shape",{prop:"updSelChangeEventArgs",onPropertyChange:!1,value:{selectionSettings:n.currentSelectionSettings}}),"Custom"===n.currentSelectionSettings.type?this.drawObject("duplicate",t.activeObj,null,null,!0):(0===i.startX&&0===i.startY&&0===i.width&&0===i.height||(e={startX:i.startX,startY:i.startY,endX:i.endX,endY:i.endY,width:i.width,height:i.height}),this.drawObject("duplicate",null,!0,e))},G6t.prototype.drawCustomSelection=function(e,t,i,n,o){var r,s,a,l,h,d,p,c,u,g,m,f=this.parent,y=f.activeObj.activePoint;f.currObjType.isCustomCrop=!0,this.upperContext.clearRect(0,0,f.upperCanvas.width,f.upperCanvas.height),f.currObjType.shape=f.activeObj.shape=e.toLowerCase(),je(t)||je(i)||je(n)||je(o)?n&&o?(h=(e=f.img).destLeft,d=e.destTop,p=e.destWidth,c=e.destHeight,y.width=n,y.height=o,y.startX=h+(p/2-n/2),y.startY=d+(c/2-o/2)):(je(f.transform.zoomFactor)||0===f.transform.zoomFactor?(g=(e=f.img).destLeft,r=e.destTop,u=e.destWidth,e=e.destHeight,s=f.lowerCanvas.width,a=f.lowerCanvas.height,l=y,0<=g&&0<=r?(l.startX=g,l.startY=r,l.endX=g+u,l.endY=r+e):0<=g?(l.startX=g,l.startY=7.5,l.endX=g+u,l.endY=a-15):0<=r?(l.startX=7.5,l.startY=r,l.endX=s-15,l.endY=r+e):(l.startX=7.5,l.startY=7.5,l.endX=s-15,l.endY=a-15)):(u=(g=f.img).destLeft,r=g.destTop,e=g.destWidth,s=g.destHeight,l=f.lowerCanvas.width,a=f.lowerCanvas.height,(g=y).startX=Math.max(0<u?u:7.5,u),g.startY=Math.max(0<r?r:7.5,r),g.endX=Math.min(u+e+15<l?u+e-15:l-15,u+e),g.endY=Math.min(r+s+15<a?r+s-15:a-15,r+s)),h=(l=f.img).destLeft,d=l.destTop,p=l.destWidth,c=l.destHeight,u=f.lowerCanvas.clientWidth,e=f.lowerCanvas.clientHeight,(g=y).startX=Math.max(g.startX,h),g.startY=Math.max(g.startY,d),g.endX=Math.min(g.endX,h+p),g.endY=Math.min(g.endY,d+c),0<f.transform.straighten?(this.imgCanvasPoints[0].x>g.startX&&(g.startX=this.imgCanvasPoints[0].x),this.imgCanvasPoints[0].y>g.startY&&(g.startY=this.imgCanvasPoints[0].y),this.imgCanvasPoints[2].x<g.endX&&(g.endX=this.imgCanvasPoints[2].x),this.imgCanvasPoints[2].y<g.endY&&(g.endY=this.imgCanvasPoints[2].x)):f.transform.straighten<0&&(this.imgCanvasPoints[3].x>g.startX&&(g.startX=this.imgCanvasPoints[3].x),this.imgCanvasPoints[3].y<g.startY&&(g.startY=this.imgCanvasPoints[3].y),this.imgCanvasPoints[1].x<g.endX&&(g.endX=this.imgCanvasPoints[1].x),this.imgCanvasPoints[1].y>g.endY)&&(g.endY=this.imgCanvasPoints[1].x),g.startX===h&&u<h+p&&(g.endX=u-15),g.startY===d&&e<d+c&&(g.endY=e-15),f.activeObj.activePoint.startX>f.activeObj.activePoint.endX&&(m=f.activeObj.activePoint.startX,f.activeObj.activePoint.startX=f.activeObj.activePoint.endX,f.activeObj.activePoint.endX=m),f.activeObj.activePoint.startY>f.activeObj.activePoint.endY&&(m=f.activeObj.activePoint.startY,f.activeObj.activePoint.startY=f.activeObj.activePoint.endY,f.activeObj.activePoint.endY=m),f.activeObj=this.updateWidthHeight(f.activeObj),this.updateActiveObject(y,f.activeObj),this.adjActObj()):(y.startX=t,y.startY=i,y.endX=t+n,y.endY=i+o,y.width=n,y.height=o),this.updateSelectionInsert()},G6t.prototype.adjToStraighten=function(){var e,t=this.parent;0!==t.transform.straighten&&t.isStraightening&&((e=t.activeObj.activePoint).startX+=7.5,e.startY+=7.5,e.endX-=7.5,e.endY-=7.5,t.activeObj=this.updateWidthHeight(t.activeObj))},G6t.prototype.adjActObj=function(){var e=this.parent;if(0!==e.transform.straighten)for(var t=e.activeObj.activePoint,i=Pe({},t,{},!0),n=0;;){n++;var o={isIntersect:null,arr:null};if(e.notify("draw",{prop:"updateImgCanvasPoints",onPropertyChange:!1}),e.notify("draw",{prop:"isLinesIntersect",onPropertyChange:!1,value:{obj:o}}),o.arr[0]||o.arr[1]||o.arr[2]||o.arr[3]||100===n){t=Pe({},i,{},!0);break}i=Pe({},t,{},!0),t.startX-=5,t.endX+=5,t.width=t.endX-t.startX,this.updateActiveObject(t,e.activeObj)}},G6t.prototype.callUpdateCurrTransState=function(){var e=this.parent,t=Pe([],e.objColl,[],!0),i=Pe({},e.activeObj,{},!0),n=(e.objColl=[],e.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.isRotateZoom=!0,this.updateCurrTransState("initial"),this.lowerContext.clearRect(0,0,e.lowerCanvas.width,e.lowerCanvas.height),0===e.transform.degree&&0<e.rotateFlipColl.length&&(e.img.destLeft+=e.panPoint.totalPannedPoint.x,e.img.destTop+=e.panPoint.totalPannedPoint.y),e.img.destLeft+=e.panPoint.totalPannedInternalPoint.x,e.img.destTop+=e.panPoint.totalPannedInternalPoint.y,this.lowerContext.filter),t=(0===e.transform.degree&&e.notify("transform",{prop:"setDestPointsForFlipState",onPropertyChange:!1}),this.drawImage(),this.updateCurrTransState("reverse"),0===e.transform.degree&&0<e.rotateFlipColl.length&&(e.img.destLeft+=e.panPoint.totalPannedPoint.x,e.img.destTop+=e.panPoint.totalPannedPoint.y),this.isRotateZoom=!1,e.objColl=t,e.togglePen),o=(e.togglePen=!1,this.lowerContext.filter="none",{penStrokeWidth:null});e.notify("freehand-draw",{prop:"getPenStrokeWidth",onPropertyChange:!1,value:{obj:o}}),e.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"iterate",pen:"iterate",isPreventApply:null}}),e.notify("freehand-draw",{prop:"setPenStrokeWidth",onPropertyChange:!1,value:{value:o.penStrokeWidth}}),e.img.destLeft+=e.panPoint.totalPannedInternalPoint.x,e.img.destTop+=e.panPoint.totalPannedInternalPoint.y,e.img.destLeft-=e.panPoint.totalPannedInternalPoint.x,e.img.destTop-=e.panPoint.totalPannedInternalPoint.y,e.togglePen=t,this.lowerContext.filter=n,e.activeObj=i},G6t.prototype.resetPanPoints=function(){this.parent.panPoint.totalPannedPoint={x:0,y:0},this.parent.panPoint.totalPannedClientPoint={x:0,y:0},this.parent.panPoint.totalPannedInternalPoint={x:0,y:0}},G6t.prototype.setClientTransDim=function(e){var t,i=this.parent;i.transform.degree%90==0&&i.transform.degree%180!=0?(i.img.destLeft=(i.lowerCanvas.clientWidth-i.img.destHeight)/2,i.img.destTop=(i.lowerCanvas.clientHeight-i.img.destWidth+1)/2,t=i.img.destWidth,i.img.destWidth=i.img.destHeight,i.img.destHeight=t):je(e)&&(i.img.destLeft=(i.lowerCanvas.clientWidth-i.img.destWidth)/2,i.img.destTop=(i.lowerCanvas.clientHeight-i.img.destHeight+1)/2)},G6t.prototype.redrawImgWithObj=function(){var e,t=this.parent,i={canvasFilter:t.canvasFilter};this.lowerContext.filter=i.canvasFilter,0!==t.rotateFlipColl.length?(i=Pe({},t.panPoint.totalPannedInternalPoint,{},!0),e={startX:t.img.destLeft,startY:t.img.destTop,width:t.img.destWidth,height:t.img.destHeight},this.callUpdateCurrTransState(),t.panPoint.totalPannedInternalPoint=i,t.img.destLeft=e.startX,t.img.destTop=e.startY,t.img.destWidth=e.width,t.img.destHeight=e.height):this.callUpdateCurrTransState(),t.isCircleCrop&&t.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}})},G6t.prototype.setCurrentObj=function(e,t,i){var n,o,r=this.parent,s=!!e,a=(s||(r.cropObj.aspectWidth=r.aspectWidth,r.cropObj.aspectHeight=r.aspectHeight,r.cropObj.frame=r.frameObj.type),e=e||r.cropObj,r.transform.cropZoomFactor=e.cropZoom,r.transform.defaultZoomFactor=e.defaultZoom,this.straightenInitZoom=e.straightenZoom,!s||e.activeObj.shape&&"crop"===e.activeObj.shape.split("-")[0]?r.transform.zoomFactor=e.cropZoom:r.transform.zoomFactor=e.defaultZoom,r.setProperties({zoomSettings:{zoomFactor:e.zoomFactor}},!0),r.notify("transform",{prop:"setPreviousZoomValue",onPropertyChange:!1,value:{previousZoomValue:e.previousZoomValue}}),r.panPoint.totalPannedPoint=Pe({},e.totalPannedPoint,{},!0),r.panPoint.totalPannedClientPoint=Pe({},e.totalPannedClientPoint,{},!0),r.panPoint.totalPannedInternalPoint=Pe({},e.totalPannedInternalPoint,{},!0),Pe({},e.tempFlipPanPoint,{},!0)),a=(r.notify("crop",{prop:"setTempFlipPanPoint",onPropertyChange:!1,value:{point:a}}),r.rotateFlipColl=Pe([],e.rotateFlipColl,[],!0),r.transform.degree=e.degree,r.frameObj.type=e.frame,r.transform.currFlipState=e.currFlipState,r.notify("filter",{prop:"setAdjustmentLevel",onPropertyChange:!1,value:{adjustmentLevel:e.adjustmentLevel}}),r.notify("filter",{prop:"setTempAdjVal"}),r.currentFilter=e.currentFilter,r.notify("filter",{prop:"setTempFilVal"}),r.transform.straighten===e.straighten&&!t||(r.transform.straighten=e.straighten,r.straightenBaseImageCanvas()),r.img={destLeft:e.destPoints.startX,destTop:e.destPoints.startY,destWidth:e.destPoints.width,destHeight:e.destPoints.height,srcLeft:e.srcPoints.startX,srcTop:e.srcPoints.startY,srcWidth:e.srcPoints.width,srcHeight:e.srcPoints.height},r.aspectWidth=e.aspectWidth,r.aspectHeight=e.aspectHeight,e.afterCropActions&&(r.afterCropActions=e.afterCropActions),this.lowerContext.filter=e.filter,r.notify("filter",{prop:"setBrightnessAdjusted",onPropertyChange:!1,value:{isBrightnessAdjusted:e.isBrightAdjust}}),r.notify("draw",{prop:"imageBackgroundColor",onPropertyChange:!1,value:{color:e.bgColor}}),r.isCircleCrop),t=(je(r.currSelectionPoint)?n=null:(n=Pe({},r.currSelectionPoint,{},!0),r.currSelectionPoint=null),r.isCircleCrop=!1,i&&(r.frameObj.type="none"),this.drawCropSelectionImage(e,!1),0!==r.transform.degree&&(""===r.transform.currFlipState?r.notify("transform",{prop:"rotatePan",onPropertyChange:!1,value:{isCropSelection:null,isDefaultZoom:null}}):r.notify("transform",{prop:"drawPannedImage",value:{xDiff:0,yDiff:0}}),r.img.destLeft=e.destPoints.startX,r.img.destTop=e.destPoints.startY,r.panPoint.totalPannedClientPoint=Pe({},e.totalPannedClientPoint,{},!0),r.panPoint.totalPannedInternalPoint=Pe({},e.totalPannedInternalPoint,{},!0)),r.activeObj=Pe({},e.activeObj,{},!0),this.upperContext.clearRect(0,0,r.upperCanvas.width,r.upperCanvas.height),0!==r.activeObj.activePoint.width&&0!==r.activeObj.activePoint.height&&this.drawObject("duplicate",null,null,null,!0),Pe({},e.activeObj,{},!0)),i=!1,l=(0<r.afterCropActions.length&&(o={collection:r.afterCropActions},r.notify("shape",{prop:"alignRotateFlipColl",onPropertyChange:!1,value:{collection:r.afterCropActions,isRotateFlipCollection:null,obj:o}}),r.afterCropActions=o.collection),Pe([],r.afterCropActions,[],!0));if(!s&&0<l.length){for(var i=!0,h=0,d=l.length;h<d;h++)"horizontalflip"!==l[h]&&"verticalflip"!==l[h]||(r.activeObj=Pe({},n,{},!0),this.rotatedFlipCropSel=!0),r.notify("transform",{prop:"updateTransform",onPropertyChange:!1,value:{text:l[h]}});t=Pe({},r.activeObj,{},!0),this.resetPanPoints(),r.activeObj=t,this.upperContext.clearRect(0,0,r.upperCanvas.width,r.upperCanvas.height),0!==r.activeObj.activePoint.width&&0!==r.activeObj.activePoint.height&&this.drawObject("duplicate",null,null,null,!0),e.degree!==r.transform.degree&&(r.transform.cropZoomFactor=null,r.transform.zoomFactor=0),r.notify("freehand-draw",{prop:"updateFHDColl",onPropertyChange:!1}),this.rotatedFlipCropSel&&(this.rotatedFlipCropSel=!1)}r.afterCropActions=l,this.isCancelAction||i||(r.notify("freehand-draw",{prop:"updateFHDColl",onPropertyChange:!1}),r.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),r.img.destLeft=e.destPoints.startX,r.img.destTop=e.destPoints.startY),r.activeObj=t,r.isCircleCrop=a,(je(n)||(r.currSelectionPoint=Pe({},n,{},!0),r.currSelectionPoint&&je(r.currSelectionPoint.shape)))&&(r.currSelectionPoint=null)},G6t.prototype.drawCropSelectionImage=function(e,t){var i,n=this.parent,o=this.lowerContext.filter,t=(n.clearContext(this.lowerContext),n.clearContext(this.upperContext),this.lowerContext.setTransform(1,0,0,1,0,0),t?this.updateCurrTransState("initial"):this.setTransformColl(this.lowerContext,"initial"),n.notify("transform",{prop:"setDestPointsForFlipState",onPropertyChange:!1}),this.drawImage(),t?this.updateCurrTransState("reverse"):this.setTransformColl(this.lowerContext,"reverse"),n.img.destLeft=n.cropObj.destPoints.startX,n.img.destTop=n.cropObj.destPoints.startY,Pe({},e.activeObj,{},!0));this.lowerContext.filter="none",n.img={destLeft:e.destPoints.startX,destTop:e.destPoints.startY,destWidth:e.destPoints.width,destHeight:e.destPoints.height,srcLeft:e.srcPoints.startX,srcTop:e.srcPoints.startY,srcWidth:e.srcPoints.width,srcHeight:e.srcPoints.height},0!==e.activeObj.activePoint.width&&0!==e.activeObj.activePoint.height&&(i={startX:n.img.destLeft,startY:n.img.destTop,width:n.img.destWidth,height:n.img.destHeight},n.img.destLeft=e.activeObj.activePoint.startX,n.img.destTop=e.activeObj.activePoint.startY,n.img.destWidth=e.activeObj.activePoint.width,n.img.destHeight=e.activeObj.activePoint.height,n.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),n.img.destLeft=i.startX,n.img.destTop=i.startY,n.img.destWidth=i.width,n.img.destHeight=i.height),n.activeObj=t,this.lowerContext.filter=o},G6t.prototype.performPointZoom=function(e,t,i,n,o){var r=this.parent,s=r.img,a=s.destLeft,l=s.destTop,h=s.destWidth,s=s.destHeight,d=!1,d=(r.activeObj.shape&&-1<r.activeObj.shape.indexOf("crop-")&&(d=!0),!r.element.querySelector(".e-contextual-toolbar-wrapper")||d||r.element.querySelector(".e-contextual-toolbar-wrapper").classList.contains("e-hide")||(r.okBtn(),r.element.querySelector(".e-contextual-toolbar-wrapper").classList.add("e-hide")),(e-a)/h),a=(t-l)/s,h=r.isUndoRedo,l=(r.isUndoRedo=!0,r.setProperties({zoomSettings:{zoomPoint:{x:e,y:t}}},!0),o||("zoomIn"===i?.1:-.1));r.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:l,zoomPoint:null,isResize:n}}),r.isUndoRedo=h,this.panToPoint(e,t,d,a)},G6t.prototype.panToPoint=function(e,t,i,n){var o=this.parent;if(0<o.transform.zoomFactor){for(var r,s,a,l,h,d=o.img.destLeft,p=o.img.destTop,c=Pe({},o.activeObj,{},!0),u=(0===o.transform.degree?(o.img.destLeft=e-i*o.img.destWidth,o.img.destTop=t-n*o.img.destHeight,this.drawZoomPanImage(o.img.destLeft-d,o.img.destTop-p)):(r=o.isCropTab,o.isCropTab=!0,s=Pe([],o.objColl,[],!0),a=Pe([],o.pointColl,[],!0),o.notify("freehand-draw",{prop:"getStraightenPoint",onPropertyChange:!(l={straightenPoint:null}),value:{obj:l}}),o.objColl=[],o.pointColl=[],o.freehandCounter=0,o.notify("freehand-draw",{prop:"setStraightenPoint",onPropertyChange:!1,value:{x:null,y:null,ratioX:null,ratioY:null}}),o.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(h={selPointColl:null}),value:{obj:h}}),h=h.selPointColl,o.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:[]}}}),o.panPoint.currentPannedPoint={x:e-i*o.img.destWidth-d,y:t-n*o.img.destHeight-p},o.notify("transform",{prop:"rotatePan",onPropertyChange:!1,value:{isCropSelection:null,isDefaultZoom:null}}),o.isCropTab=r,o.objColl=s,o.pointColl=a,o.freehandCounter=o.pointColl.length,l.straightenPoint.x&&l.straightenPoint.y&&o.notify("freehand-draw",{prop:"setStraightenPoint",onPropertyChange:!1,value:{x:l.straightenPoint.x,y:l.straightenPoint.y,ratioX:l.straightenPoint.ratioX,ratioY:l.straightenPoint.ratioY}}),o.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:h}}}),o.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"pan",pen:"pan",x:o.panPoint.currentPannedPoint.x,y:o.panPoint.currentPannedPoint.y,panRegion:""}})),this.adjustPanning(c),!1),g=0;g<o.objColl.length;g++)if(JSON.stringify(c.activePoint)===JSON.stringify(o.objColl[g].activePoint)){u=!0;break}u||(o.activeObj=c),0!==o.activeObj.activePoint.width&&0!==o.activeObj.activePoint.height&&this.drawObject("duplicate",null,null,null,!0)}},G6t.prototype.adjustPanning=function(e){var t,i,n,o,r,s=this.parent,e=e.activePoint,a=e.startX,l=e.startY,h=e.width,e=e.height;0!==h&&0!==e&&(t=(r=s.img).destLeft,i=r.destTop,o=r.destWidth,r=r.destHeight,n={x:0,y:0},a<t?n.x=t-a:t+o<a+h&&(n.x=t+o-(a+h)),l<i?n.y=i-l:i+r<l+e&&(n.y=i+r-(l+e)),0===s.transform.degree?(s.img.destLeft-=n.x,s.img.destTop-=n.y,this.drawZoomPanImage(s.img.destLeft-t,s.img.destTop-i)):(o=s.isCropTab,s.isCropTab=!0,a=Pe([],s.objColl,[],!0),h=Pe([],s.pointColl,[],!0),s.objColl=[],s.pointColl=[],s.freehandCounter=0,s.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(r={selPointColl:null}),value:{obj:r}}),l=r.selPointColl,s.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:[]}}}),s.img.destLeft-=n.x,s.img.destTop-=n.y,s.panPoint.currentPannedPoint={x:s.img.destLeft-t,y:s.img.destTop-i},s.notify("transform",{prop:"rotatePan",onPropertyChange:!1,value:{isCropSelection:null,isDefaultZoom:null}}),s.isCropTab=o,s.objColl=a,s.pointColl=h,s.freehandCounter=s.pointColl.length,s.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:l}}}),s.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"pan",pen:"pan",x:s.panPoint.currentPannedPoint.x,y:s.panPoint.currentPannedPoint.y,panRegion:""}})))},G6t.prototype.panToSel=function(){var e=this.parent,t=Pe({},e.activeObj,{},!0),i=t.activePoint,n=i.startX,o=i.startY,r=i.width,i=i.height,s=(this.allowRedactStraighten=!0,{straightenPoint:null});if(e.notify("freehand-draw",{prop:"getStraightenPoint",onPropertyChange:!1,value:{obj:s}}),s.straightenPoint.x&&s.straightenPoint.y){var n=n+r/2-s.straightenPoint.x,r=o+i/2-s.straightenPoint.y,o=(0===e.transform.degree?(e.img.destLeft+=n,e.img.destTop+=r,e.notify("transform",{prop:"drawPannImage",value:{point:{x:n,y:r}}})):(e.panPoint.currentPannedPoint={x:n,y:r},e.notify("transform",{prop:"drawPannedImage",value:{xDiff:n,yDiff:r}}),e.panPoint.currentPannedPoint={x:0,y:0},e.notify("transform",{prop:"setTempPanMove",value:{point:null}})),e.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:t}}),e.img),a=o.destLeft,l=o.destTop,h=o.destWidth,d=o.destHeight,i=this.imgCanvasPoints,p=(i.forEach(function(e){e.x=e.ratioX*h+a,e.y=e.ratioY*d+l}),this.imgCanvasPoints=i,0);for(3!==e.transform.straighten||this.preventStraightening||(this.preventStraightening=!0,s=e.prevStraightenedDegree,e.prevStraightenedDegree=e.transform.straighten,e.setStraighten(0),e.setStraighten(3),e.prevStraightenedDegree=s,this.preventStraightening=!1);this.isLinesIntersect()&&0!==e.transform.straighten&&360!==e.transform.straighten&&p<100;)p++,this.performPointZoom(e.activeObj.activePoint.startX+e.activeObj.activePoint.width/2,e.activeObj.activePoint.startY+e.activeObj.activePoint.height/2,"zoomIn",!1,.025),this.updateImgCanvasPoints()}},G6t.prototype.drawZoomPanImage=function(e,t){var i=this.parent,n=(i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"pan",pen:"pan",x:e,y:t,panRegion:""}}),this.renderImage(!0),{width:0,height:0});i.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!1,value:{width:i.img.srcWidth,height:i.img.srcHeight,obj:n,isImgShape:null}});n.width+=n.width*i.transform.zoomFactor,n.height+=n.height*i.transform.zoomFactor,i.panPoint.totalPannedPoint.x+=e,i.panPoint.totalPannedPoint.y+=t,i.notify("crop",{prop:"setTempFlipPanPoint",onPropertyChange:!1,value:{point:{x:0,y:0}}})},G6t.prototype.openNewImage=function(){var t=this,e=this.parent,i=e.element.id,n=e.inMemoryCanvas.getContext("2d"),o=(kA(e.element),e.element.style.opacity="0.5",document.querySelector("#"+i+"_currPos")),o=(o&&(o.style.display="none"),{defToolbarItems:null});e.notify("toolbar",{prop:"getDefToolbarItems",value:{obj:o}}),o.defToolbarItems&&0===o.defToolbarItems.length&&je(document.getElementById(i+"_toolbar"))&&e.element.querySelector("#"+i+"_toolbarArea")&&(o=e.element.querySelector("#"+i+"_toolbarArea").clientHeight,e.notify("toolbar",{prop:"setToolbarHeight",value:{height:o}})),e.reset(),e.update(),e.transform.degree=0,e.transform.zoomFactor=0,e.isImageLoaded=!1,e.currSelectionPoint=null,"string"==typeof this.openURL?(1<(o=this.openURL.split(".")).length?(o=o[o.length-2].split("/"),this.fileName=o[o.length-1]):this.fileName="ImageEditor",this.fileType=this.getFileExtensionFromURL(this.openURL),this.fileType&&(this.fileType=e.toPascalCase(this.fileType),"jpg"!==(o=this.fileType.toLowerCase())&&"jpeg"!==o||(this.fileType="Jpeg",o="jpeg"),"jpeg"!==o)&&"png"!==o&&"svg"!==o&&"webp"!==o&&(this.fileType=null),this.imageOnLoad(this.openURL),"string"==typeof this.openURL&&-1!==this.openURL.indexOf("localhost")||this.getImageSizeFromURL(this.openURL.toString(),function(e){null!==e&&t.parent.notify("toolbar",{prop:"setInitialSize",value:{value:+e}})})):(this.fileName="ImageEditor",this.fileType=null,e.lowerCanvas=document.querySelector("#"+i+"_lowerCanvas"),e.upperCanvas=document.querySelector("#"+i+"_upperCanvas"),this.lowerContext=e.lowerCanvas.getContext("2d"),this.upperContext=e.upperCanvas.getContext("2d"),e.clearContext(this.lowerContext),e.clearContext(this.upperContext),e.clearContext(n),e.inMemoryCanvas.width=this.openURL.width,e.inMemoryCanvas.height=this.openURL.height,n.putImageData(this.openURL,0,0),e.baseImg.src=e.inMemoryCanvas.toDataURL())},G6t.prototype.getImageSizeFromURL=function(i,n){return Q6t(this,void 0,void 0,function(){var t;return U6t(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,fetch(i,{method:"HEAD"})];case 1:return t=e.sent(),t=parseInt(t.headers.get("content-length")||"0",10),n(t),[3,3];case 2:return t=e.sent(),console.log(t.message),[3,3];case 3:return[2]}})})},G6t.prototype.dlgBtnClick=function(){this.parent.export(),this.applyDialogOption()},G6t.prototype.dlgCloseBtnClick=function(){this.applyDialogOption()},G6t.prototype.applyDialogOption=function(){var e=this.parent;this.isFileChanged?(e.isImageLoaded=this.isFileChanged=!1,e.reset(),this.checkToolbarTemplate(this.inputElem,this.openURL)):(this.reset(),this.openNewImage()),At(document.getElementById(e.element.id+"_dialog"),"dialog").destroy(),this.isImageEdited=!1},G6t.prototype.showDialogPopup=function(){var e=this.parent,t={key:"ConfirmDialogHeader"},i=(e.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!1,value:{obj:t}}),{key:"ConfirmDialogContent"}),n=(e.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!1,value:{obj:i}}),{key:"Yes"}),o=(e.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!1,value:{obj:n}}),{key:"No"});e.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!1,value:{obj:o}}),e.element.querySelector("#"+e.element.id+"_dialog").style.display="block",new pS({header:t.value,closeOnEscape:!0,content:"<span>"+i.value+"</span>",target:document.getElementById("target"),width:"285px",isModal:!0,animationSettings:{effect:"Zoom"},close:this.dlgCloseBtnClick.bind(this),buttons:[{click:this.dlgCloseBtnClick.bind(this),buttonModel:{content:o.value,iconCss:"e-icons e-close"}},{click:this.dlgBtnClick.bind(this),buttonModel:{content:n.value,isPrimary:!0,iconCss:"e-icons e-check"}}]}).appendTo("#"+e.element.id+"_dialog")},G6t.prototype.restoreOldImage=function(){var e,t,i=this,n=this.parent,o=document.getElementById(this.parent.element.id+"_dropArea"),r=n.getExtensionArray();"string"!=typeof this.openURL?this.openImageData(o):(e=this.getFileExtensionFromURL(this.openURL),t=!!(e=e&&("jpg"===(e=e.toLowerCase())||"jpeg"===e?"jpeg":e))&&(-1<r.indexOf(e)||"jpeg"===e&&(-1<n.uploadSettings.allowedExtensions.indexOf("jpg")||-1<n.uploadSettings.allowedExtensions.indexOf("jpeg")))||this.isNullExtension,-1<this.openURL.indexOf("data:image/")&&-1<this.openURL.indexOf("base64")||-1<this.openURL.indexOf("blob")?this.openImageData(o,!0):n.uploadSettings.minFileSize||n.uploadSettings.maxFileSize?this.getImageSizeFromURL(this.openURL.toString(),function(e){e=n.uploadSettings.minFileSize&&e<n.uploadSettings.minFileSize||n.uploadSettings.maxFileSize&&e>n.uploadSettings.maxFileSize;i.handleFileSize(!t||e,o,!t)}):this.handleFileSize(!t,o,!t))},G6t.prototype.handleFileSize=function(e,t,i){var n=this.parent;e?(this.errorLoading(),n.showDialogPopup("unsupported",i),t&&!n.isImageLoaded&&(t.style.display="block")):(t&&(t.style.display="none"),this.parent.isImageLoaded&&this.reset(),this.openNewImage())},G6t.prototype.openImageData=function(e,t){var i,n=this.parent,o=this,r=n.createElement("canvas"),s=r.getContext("2d");n.uploadSettings.minFileSize||n.uploadSettings.maxFileSize?t?((i=new Image).src=this.openURL,i.onload=function(){s.canvas.width=i.width,s.canvas.height=i.height,s.drawImage(i,0,0),o.getImageSize(r,e)}):(r.width=this.openURL.width,r.height=this.openURL.height,s.putImageData(this.openURL,0,0),this.getImageSize(r,e)):this.handleFileSize(!1,e,!1)},G6t.prototype.getImageSize=function(e,t){var i=this.parent;e.toBlob(function(e){i.uploadSettings.minFileSize&&e.size<i.uploadSettings.minFileSize||i.uploadSettings.maxFileSize&&e.size>i.uploadSettings.maxFileSize?this.handleFileSize(!0,t,!1):this.handleFileSize(!1,t,!1)}.bind(this),"image/jpeg",1)},G6t.prototype.open=function(e){this.parent.disabled||(this.openURL=e,this.restoreOldImage())},G6t.prototype.getInitialLoaded=function(e){e.isInitialLoaded=this.isInitialLoading},G6t.prototype.getFileExtensionFromURL=function(e){var t=e.lastIndexOf(".");return-1!==t?e.slice(t+1).toLowerCase():-1!==e.indexOf("base64")?e.slice(e.indexOf("/")+1,e.indexOf(";")).toLowerCase():null},G6t.prototype.fileSelect=function(e,t){var i,n,o,r=this.parent,s=document.getElementById(r.element.id+"_dropArea");s&&(s.style.display="none"),r.disabled||(i=s=void 0,t=void(t.target?i=s=t.target.files[0]:s=i=t.filesData[0].rawFile),i.name&&(t=(n=i.name.split("."))[n.length-1].toLowerCase()),n=r.getExtensionArray(),o=("jpg"===t||"jpeg"===t)&&(-1<r.uploadSettings.allowedExtensions.indexOf("jpg")||-1<r.uploadSettings.allowedExtensions.indexOf("jpeg")),t&&-1===n.indexOf(t)&&!o||r.uploadSettings.minFileSize&&i.size<r.uploadSettings.minFileSize||r.uploadSettings.maxFileSize&&i.size>r.uploadSettings.maxFileSize?this.errorLoading():(kA(r.element),r.element.style.opacity="0.5",this.inputElem=e,(t=i.name&&i.name.split(".")[1])?(n=r.toPascalCase(t),this.fileType="JPG"===n||"Jpg"===n?"Jpeg":n):this.fileType=null,o=window.URL.createObjectURL(s),this.openURL=o,r.isImageLoaded&&!r.isChangesSaved&&(this.isImageEdited||0<r.pointColl.length||0<r.objColl.length)?(this.isFileChanged=!0,this.showDialogPopup()):this.checkToolbarTemplate(e,o)))},G6t.prototype.checkToolbarTemplate=function(e,t){var i=this.parent;je(i.toolbarTemplate)&&(i.reset(),i.update()),this.fileName=e.value.split("\\")[e.value.split("\\").length-1],this.fileName=this.fileName.split(".")[0],this.imageOnLoad(t.toString()),e.value=""},G6t.prototype.moveToSelectionRange=function(e,t){var i=this.parent;if(i.activeObj.shape){for(var n=!1,o=0,r=i.rotateFlipColl.length;o<r;o++){var s=i.rotateFlipColl[o];if(90===s||-90===s){n=!0;break}}if(n&&0!==i.transform.degree){var a=i.transform.zoomFactor,l=(i.objColl.push(i.activeObj),i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),i.objColl[i.objColl.length-1]);if("rotateleft"===e||"rotateright"===e)if(i.transform.degree%90==0&&i.transform.degree%180!=0)if(l.activePoint.width<t.activePoint.height)for(o=2;o<i.zoomSettings.maxZoomFactor;o++){if(l.activePoint.width>=t.activePoint.height||this.isSelectionBiggerThanCanvas(l)||this.isSelectionOutsideCanvas(l)){je(a)||i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:-.1,zoomPoint:null},isResize:null});break}a+=.1,i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:a,zoomPoint:null},isResize:null})}else for(o=2;o<i.zoomSettings.maxZoomFactor;o++){if(l.activePoint.width>=t.activePoint.height||this.isSelectionBiggerThanCanvas(l)||this.isSelectionOutsideCanvas(l)){je(a)||i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:.1,zoomPoint:null,isResize:null}});break}a-=.1,i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:a,zoomPoint:null},isResize:null})}else if(l.activePoint.height<t.activePoint.width)for(o=2;o<i.zoomSettings.maxZoomFactor;o++){if(l.activePoint.height>=t.activePoint.width||this.isSelectionBiggerThanCanvas(l)||this.isSelectionOutsideCanvas(l)){je(a)||i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:-.1,zoomPoint:null},isResize:null});break}a+=.1,i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:a,zoomPoint:null},isResize:null})}else for(o=2;o<i.zoomSettings.maxZoomFactor;o++){if(l.activePoint.height>=t.activePoint.width||this.isSelectionBiggerThanCanvas(l)||this.isSelectionOutsideCanvas(l)){je(a)||i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:.1,zoomPoint:null},isResize:null});break}a-=.1,i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:a,zoomPoint:null},isResize:null})}var e=i.lowerCanvas.clientWidth/2-(l.activePoint.startX+l.activePoint.width/2),h=(i.lowerCanvas.clientHeight+1)/2-(l.activePoint.startY+l.activePoint.height/2);je(i.activeObj.shape)&&(i.activeObj=Pe({},t,{},!0)),0===i.transform.degree?(i.img.destLeft+=e,i.img.destTop+=h,i.notify("transform",{prop:"drawPannImage",value:{point:{x:e,y:h}}})):(i.panPoint.currentPannedPoint={x:e,y:h},i.notify("transform",{prop:"drawPannedImage",value:{xDiff:e,yDiff:h}}),i.panPoint.currentPannedPoint={x:0,y:0}),i.notify("transform",{prop:"setTempPanMove",onPropertyChange:!1,value:{point:null}}),i.activeObj=Pe({},i.objColl[i.objColl.length-1]),i.objColl.pop(),i.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:i.activeObj}})}}},G6t.prototype.isSelectionBiggerThanCanvas=function(e){var t=!1,i=this.parent,e=e.activePoint,n=e.startX,o=e.startY,r=e.endX,e=e.endY,i=i.img,s=i.destLeft,a=i.destTop,l=i.destWidth,i=i.destHeight;return t=n<=s||o<=a||s+l<=r||a+i<=e?!0:t},G6t.prototype.isSelectionOutsideCanvas=function(e){var t=!1,i=this.parent;return t=e.activePoint.height<i.lowerCanvas.height-i.toolbarHeight||e.activePoint.width<i.lowerCanvas.width?!0:t},G6t.prototype.downScaleImgCanvas=function(e,t,i,n){var o=this.parent,r=t?o.activeObj.imageCanvas:o.baseImgCanvas,s=t?o.activeObj.imageElement:o.baseImg,a=t?o.activeObj.activePoint.width:o.img.destWidth,l=t?o.activeObj.activePoint.height:o.img.destHeight,h={width:0,height:0};o.transform.degree%90==0&&o.transform.degree%180!=0?o.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!1,value:{width:s.height,height:s.width,obj:h,isImgShape:t}}):o.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!1,value:{width:s.width,height:s.height,obj:h,isImgShape:t}}),t||o.allowDownScale&&!o.isCropTab&&!o.isCropToolbar&&0!==s.width&&0!==s.height&&a<.75*h.width&&l<.75*h.height?((h=o.createElement("canvas",{id:o.element.id+"_downScaleCanvas",attrs:{name:"canvasImage"}})).width=t?s.width:o.img.srcWidth,h.height=t?s.height:o.img.srcHeight,t?h.getContext("2d").drawImage(s,0,0,h.width,h.height):(""!==this.imageBackgroundColor&&(e.fillStyle=this.imageBackgroundColor,e.fillRect(o.img.destLeft,o.img.destTop,o.img.destWidth,o.img.destHeight)),h.getContext("2d").drawImage(r,o.img.srcLeft,o.img.srcTop,o.img.srcWidth,o.img.srcHeight,0,0,h.width,h.height)),(t||this.isDownScale)&&this.downScale(h,a,l,t),t?(e.canvas.width=h.width,e.canvas.height=h.height,i&&n?(e.translate(o.activeObj.imageCanvas.width,0),e.scale(-1,1),e.translate(0,o.activeObj.imageCanvas.height),e.scale(1,-1)):i?(je(o.activeObj.isHorImageFlip)||!o.activeObj.isHorImageFlip?(o.activeObj.isHorImageFlip=!0,e.translate(o.activeObj.imageCanvas.width,0),e.scale(-1,1)):o.activeObj.isHorImageFlip&&(o.activeObj.isHorImageFlip=!1),o.activeObj.isVerImageFlip&&(e.translate(0,o.activeObj.imageCanvas.height),e.scale(1,-1))):n&&(je(o.activeObj.isVerImageFlip)||!o.activeObj.isVerImageFlip?(o.activeObj.isVerImageFlip=!0,e.translate(0,o.activeObj.imageCanvas.height),e.scale(1,-1)):o.activeObj.isVerImageFlip&&(o.activeObj.isVerImageFlip=!1),o.activeObj.isHorImageFlip)&&(e.translate(o.activeObj.imageCanvas.width,0),e.scale(-1,1)),e.drawImage(h,0,0),e.setTransform(1,0,0,1,0,0)):o.isFinetuning?(e.save(),e.setTransform(1,0,0,1,0,0),e.drawImage(o.inMemoryCanvas,0,0),e.restore()):e.drawImage(h,0,0,h.width,h.height,o.img.destLeft,o.img.destTop,h.width,h.height)):!je(t)&&t||0===o.baseImgCanvas.width||0===o.baseImgCanvas.height||(""!==this.imageBackgroundColor&&(e.fillStyle=this.imageBackgroundColor,e.fillRect(o.img.destLeft,o.img.destTop,o.img.destWidth,o.img.destHeight)),e.drawImage(o.baseImgCanvas,o.img.srcLeft,o.img.srcTop,o.img.srcWidth,o.img.srcHeight,o.img.destLeft,o.img.destTop,o.img.destWidth,o.img.destHeight)),o.isSafari&&o.notify("filter",{prop:"apply-filter",onPropertyChange:!1,value:{context:e}})},G6t.prototype.downScale=function(e,t,i,n){var o=this.parent;if(!n||!o.isStraightening){for(var r=e.width,s=e.height,a=r/(t=Math.round(t)),l=s/(i=Math.round(i)),h=Math.ceil(a/2),d=Math.ceil(l/2),p=e.getContext("2d"),s=p.getImageData(0,0,r,s),c=p.createImageData(t,i),u=s.data,g=c.data,m=0;m<i;m++)for(var f=0;f<t;f++){for(var y=4*(f+m*t),v=0,b=0,w=0,C=0,S=0,A=0,x=(m+.5)*l,I=Math.floor(m*l),T=Math.ceil((m+1)*l),E=I;E<T;E++)for(var D=Math.abs(x-(E+.5))/d,M=(f+.5)*a,k=D*D,D=Math.floor(f*a),P=Math.ceil((f+1)*a),B=D;B<P;B++){var F,L=Math.abs(M-(B+.5))/h,L=Math.sqrt(k+L*L);1<=L||(A+=(L=2*L*L*L-3*L*L+1)*u[3+(F=4*(B+E*r))],b+=L,w+=(L=L*u[3+F]/250)*u[F],C+=L*u[1+F],S+=L*u[2+F],v+=L)}g[y]=w/v,g[1+y]=C/v,g[2+y]=S/v,g[3+y]=A/b}e.width=(n?o.activeObj.activePoint:o.lowerCanvas).width,e.height=(n?o.activeObj.activePoint:o.lowerCanvas).height,p.putImageData(c,0,0)}},G6t.prototype.drawImgToCtx=function(e,t){var i=this.parent;e.canvas.id!==i.element.id+"_tempCanvas"&&e!==this.upperContext&&je(t)&&this.downScaleImgCanvas(e,null,null,null)},G6t.prototype.getFrameColor=function(e,t,i){this.parent.frameObj.color;return e.gradientColor?((t=t.createLinearGradient(i.startX,i.startY,i.startX+i.width,i.startY+i.height)).addColorStop(0,e.color),t.addColorStop(1,e.gradientColor),t):e.color},G6t.prototype.applyFrame=function(e,t,i){var n,o,r,s,a=this.parent,l=(a.frameObj.type=t,{width:1,height:1}),h={startX:a.img.destLeft-e.lineWidth,startY:a.img.destTop-e.lineWidth,width:a.img.destWidth+2*e.lineWidth,height:a.img.destHeight+2*e.lineWidth},d={type:a.frameObj.type,color:a.frameObj.color,size:a.frameObj.size,inset:a.frameObj.inset,offset:a.frameObj.offset/2,radius:a.frameObj.radius,amount:a.frameObj.amount,border:a.frameObj.border,gradientColor:a.frameObj.gradientColor},p=a.transform.zoomFactor,c=(e.canvas.id===a.element.id+"_tempCanvas"?(o=e.canvas.width,r=e.canvas.height,a.notify("crop",{prop:"calcRatio",onPropertyChange:!(s={width:0,height:0}),value:{obj:s,dimension:{width:o,height:r}}}),d.size*=((l=s).width+l.height)/2,d.inset*=(l.width+l.height)/2,d.offset*=(l.width+l.height)/2,d.radius*=(l.width+l.height)/2,h={startX:0,startY:0,width:e.canvas.width,height:e.canvas.height},a.notify("export",{prop:"updateSaveContext",onPropertyChange:!1,value:{context:e}})):e===this.upperContext&&a.activeObj.shape?h={startX:a.activeObj.activePoint.startX-e.lineWidth,startY:a.activeObj.activePoint.startY-e.lineWidth,width:a.activeObj.activePoint.width+2*e.lineWidth,height:a.activeObj.activePoint.height+2*e.lineWidth}:je(i)&&e.clearRect(0,0,e.canvas.width,e.canvas.height),(l.width+l.height)/2*40),u=(l.width+l.height)/2*50;if(e!==this.upperContext&&(d.size+=d.size*p,d.inset+=d.inset*p,d.offset+=d.offset*p,d.radius+=d.radius*p,c+=c*p,u+=u*p),e!==this.upperContext||!a.activeObj.shape||!("mat"===t&&(h.width-2*d.size<0||h.height-2*d.size<0)||"bevel"===t&&(h.width-2*d.size<40||h.height-2*d.size<40)||"inset"===t&&(h.startX+h.width-d.offset-(h.startX+d.offset)<0||h.startY+h.height-d.offset-(h.startY+d.offset)<0)||"hook"===t&&(h.width-2*d.size<50||h.height-2*d.size<50))){var g={bevelFilter:e.filter},m=e.filter;if(a.currSelectionPoint&&"crop-circle"===a.currSelectionPoint.shape||a.isCircleCrop||e===this.lowerContext&&a.isCropTab)this.drawImgToCtx(e,i);else{switch(t){case"none":this.drawImgToCtx(e,i);break;case"mat":for(this.drawImgToCtx(e,i);(h.width-2*d.size<0||h.height-2*d.size<0)&&0<d.size;)d.size-=20;e.filter="none",e.fillStyle=this.getFrameColor(d,e,h),e.beginPath(),e.rect(h.startX,h.startY,h.width,h.height),e.rect(h.startX+d.size,h.startY+d.size,h.width-2*d.size,h.height-2*d.size),e.fill("evenodd"),e.closePath();break;case"bevel":for(e.filter="none",e.fillStyle=this.getFrameColor(d,e,h),e.beginPath(),e.fillRect(h.startX,h.startY,h.width,h.height),e.closePath(),h.startX+=d.size,h.startY+=d.size,h.width-=2*d.size,h.height-=2*d.size;(h.width-2*d.size<40||h.height-2*d.size<40)&&0<d.size;)h.startX-=d.size,h.startY-=d.size,h.width+=2*d.size,h.height+=2*d.size,d.size-=20,h.startX+=d.size,h.startY+=d.size,h.width-=2*d.size,h.height-=2*d.size;e.fillStyle=this.getFrameColor(d,e,h),e.save(),e.beginPath(),e.moveTo(h.startX+c,h.startY),e.lineTo(h.startX+h.width-c,h.startY),e.quadraticCurveTo(h.startX+h.width,h.startY,h.startX+h.width,h.startY+c),e.lineTo(h.startX+h.width,h.startY+h.height-c),e.quadraticCurveTo(h.startX+h.width,h.startY+h.height,h.startX+h.width-c,h.startY+h.height),e.lineTo(h.startX+c,h.startY+h.height),e.quadraticCurveTo(h.startX,h.startY+h.height,h.startX,h.startY+h.height-c),e.lineTo(h.startX,h.startY+c),e.quadraticCurveTo(h.startX,h.startY,h.startX+c,h.startY),e.closePath(),e.clip(),e.filter="none"===m?a.canvasFilter:m,e.canvas.id===a.element.id+"_tempCanvas"?(i=null,e.filter="none",e.drawImage(a.inMemoryCanvas,0,0),e.filter="none"===m?a.canvasFilter:m):(e.clearRect(0,0,e.canvas.width,e.canvas.height),i?(i=null,0!==a.transform.zoomFactor&&(this.isRotateZoom=!0),a.notify("filter",{prop:"getBevelFilter",onPropertyChange:!1,value:{obj:g}}),e.filter=g.bevelFilter,this.updateCurrTransState("initial"),this.drawImgToCtx(e,i),this.updateCurrTransState("reverse"),this.isRotateZoom=!1,a.frameObj.type="none",e.filter="none",a.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:e,shape:"iterate",pen:"iterate",isPreventApply:null}}),a.frameObj.type="bevel",e.filter="none"===m?a.canvasFilter:m):(a.notify("filter",{prop:"getBevelFilter",onPropertyChange:!1,value:{obj:g}}),e.filter=g.bevelFilter,this.drawImgToCtx(e,i))),e.restore();break;case"line":this.drawImgToCtx(e,i),n=e.lineWidth,e.lineWidth=d.size/10;for(var f=0;f<a.frameObj.amount;f++){0<f&&(h.startX+=d.offset,h.startY+=d.offset,h.width-=2*d.offset,h.height-=2*d.offset);var y=h.startY+h.height-d.inset-d.radius,v=h.startY+d.inset+d.radius,b=h.startX+h.width-d.inset-d.radius,w=h.startX+d.inset+d.radius,C=h.startX+d.inset+d.radius,S=h.startX+h.width-d.inset-d.radius,A=h.startY+d.inset+d.radius,x=h.startY+h.height-d.inset-d.radius;v<=y&&w<=b&&C<=S&&A<=x&&(e.filter="none",e.strokeStyle=this.getFrameColor(d,e,h),"dashed"===d.border?e.setLineDash([2.5*e.lineWidth,1.5*e.lineWidth]):"dotted"===d.border&&e.setLineDash([e.lineWidth,e.lineWidth]),e.beginPath(),e.moveTo(h.startX+d.inset+d.radius,h.startY+d.inset),e.lineTo(h.startX+h.width-d.inset-d.radius,h.startY+d.inset),e.arcTo(h.startX+h.width-d.inset,h.startY+d.inset,h.startX+h.width-d.inset,h.startY+d.inset+d.radius,d.radius),e.lineTo(h.startX+h.width-d.inset,h.startY+h.height-d.inset-d.radius),e.arcTo(h.startX+h.width-d.inset,h.startY+h.height-d.inset,h.startX+h.width-d.inset-d.radius,h.startY+h.height-d.inset,d.radius),e.lineTo(h.startX+d.inset+d.radius,h.startY+h.height-d.inset),e.arcTo(h.startX+d.inset,h.startY+h.height-d.inset,h.startX+d.inset,h.startY+h.height-d.inset-d.radius,d.radius),e.lineTo(h.startX+d.inset,h.startY+d.inset+d.radius),e.arcTo(h.startX+d.inset,h.startY+d.inset,h.startX+d.inset+d.radius,h.startY+d.inset,d.radius),e.closePath(),e.stroke(),e.setLineDash([]))}e.lineWidth=n;break;case"inset":this.drawImgToCtx(e,i),e.filter="none",e.strokeStyle=this.getFrameColor(d,e,h),n=e.lineWidth,e.lineWidth=d.size/10,e.beginPath(),e.moveTo(h.startX+d.offset,h.startY+d.inset),e.lineTo(h.startX+h.width-d.offset,h.startY+d.inset),e.moveTo(h.startX+h.width-d.inset,h.startY+d.offset),e.lineTo(h.startX+h.width-d.inset,h.startY+h.height-d.offset),e.moveTo(h.startX+h.width-d.offset,h.startY+h.height-d.inset),e.lineTo(h.startX+d.offset,h.startY+h.height-d.inset),e.moveTo(h.startX+d.inset,h.startY+h.height-d.offset),e.lineTo(h.startX+d.inset,h.startY+d.offset),e.stroke(),e.closePath(),e.lineWidth=n;break;case"hook":this.drawImgToCtx(e,i),e.filter="none",e.strokeStyle=this.getFrameColor(d,e,h),n=e.lineWidth,e.lineWidth=d.size/10,e.beginPath(),e.moveTo(h.startX+d.inset+u,h.startY+d.inset),e.lineTo(h.startX+d.inset,h.startY+d.inset),e.lineTo(h.startX+d.inset,h.startY+d.inset+u),e.moveTo(h.startX+h.width-d.inset-u,h.startY+d.inset),e.lineTo(h.startX+h.width-d.inset,h.startY+d.inset),e.lineTo(h.startX+h.width-d.inset,h.startY+d.inset+u),e.moveTo(h.startX+h.width-d.inset-u,h.startY+h.height-d.inset),e.lineTo(h.startX+h.width-d.inset,h.startY+h.height-d.inset),e.lineTo(h.startX+h.width-d.inset,h.startY+h.height-d.inset-u),e.moveTo(h.startX+d.inset+u,h.startY+h.height-d.inset),e.lineTo(h.startX+d.inset,h.startY+h.height-d.inset),e.lineTo(h.startX+d.inset,h.startY+h.height-d.inset-u),e.stroke(),e.lineWidth=n}(a.isCircleCrop||a.currSelectionPoint&&"crop-circle"===a.currSelectionPoint.shape)&&a.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:e,isSave:e.canvas.id===a.element.id+"_tempCanvas"||null,isFlip:null}}),e.filter=m}}},G6t.prototype.triggerFrameChange=function(e){var t=this.parent,e={cancel:!1,previousFrameSetting:e,currentFrameSetting:{type:t.toPascalCase(t.frameObj.type),color:t.frameObj.color,gradientColor:t.frameObj.gradientColor,size:t.frameObj.size,inset:t.frameObj.inset,offset:t.frameObj.offset,borderRadius:t.frameObj.radius,frameLineStyle:t.toPascalCase(t.frameObj.border),lineCount:t.frameObj.amount}};return t.trigger("frameChange",e),(t.editCompleteArgs=e).cancel||this.setFrameObj(e.currentFrameSetting),e},G6t.prototype.setFrameObj=function(e){var t=this.parent;t.frameObj.type=e.type.toLowerCase(),t.frameObj.color=e.color,t.frameObj.gradientColor=e.gradientColor,t.frameObj.size=e.size,t.frameObj.inset=e.inset,t.frameObj.offset=e.offset,t.frameObj.radius=e.borderRadius,t.frameObj.border=e.frameLineStyle.toLowerCase(),t.frameObj.amount=e.lineCount},G6t.prototype.zoomToSel=function(e,t){var i=this.parent;if(this.straightenActObj&&JSON.stringify(this.straightenActObj.activePoint)===JSON.stringify(e.activePoint))if(i.activeObj=Pe({},this.straightenActObj,null,!0),this.allowRedactStraighten=!1,0===i.transform.straighten){var n=i.img.destWidth,o=i.img.destHeight;for(i.transform.straighten=360;;){if(je(this.straightenInitZoom)||!(Math.round(i.transform.zoomFactor*Math.pow(10,3))/Math.pow(10,3)>Math.round(this.straightenInitZoom*Math.pow(10,3))/Math.pow(10,3))){this.performDummyZoom();break}if(this.setZoomPan("out"),n===i.img.destWidth&&o===i.img.destHeight){this.performDummyZoom();break}0===i.transform.degree&&(i.transform.zoomFactor-=.025,i.transform.cropZoomFactor-=.025)}i.transform.straighten=0,i.img={destLeft:i.img.destLeft,destTop:i.img.destTop,destWidth:i.img.destWidth,destHeight:i.img.destHeight,srcLeft:i.img.srcLeft,srcTop:i.img.srcTop,srcWidth:i.img.srcWidth,srcHeight:i.img.srcHeight}}else je(this.straightenInitZoom)&&(this.straightenInitZoom=i.transform.zoomFactor),0<this.straightenInitZoom-i.transform.zoomFactor?i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:-(this.straightenInitZoom-i.transform.zoomFactor),zoomPoint:null,isResize:!0}}):this.straightenInitZoom-i.transform.zoomFactor<0&&i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:this.straightenInitZoom-i.transform.zoomFactor,zoomPoint:null,isResize:!0}}),i.activeObj=Pe({},e,null,!0),i.transform.zoomFactor+=.001,this.calcStraightenedPoints(t);else this.straightenActObj=Pe({},e,null,!0),i.activeObj=Pe({},this.straightenActObj,null,!0),this.straightenInitZoom=i.transform.zoomFactor,this.calcStraightenedPoints(t)},G6t.prototype.isDestPointSmall=function(){var e=this.parent,t=e.img,i={startX:t.destLeft,startY:t.destTop,width:t.destWidth,height:t.destHeight},n=(e.notify("shape",{prop:"straightenShapes",onPropertyChange:!1}),!1);return this.straightenDestPoints.destWidth&&this.straightenDestPoints.destHeight&&(t.destWidth<this.straightenDestPoints.destWidth||t.destHeight<this.straightenDestPoints.destHeight)&&(n=!0),t.destLeft=i.startX,t.destTop=i.startY,t.destWidth=i.width,t.destHeight=i.height,e.img=t,n},G6t.prototype.calcStraightenedPoints=function(r){for(var s=this.parent,a=s.img.destWidth,l=s.img.destHeight,h=(je(s.transform.zoomFactor)&&(s.transform.zoomFactor+=.025),this.updateImgCanvasPoints(),this);"break"!==function(){if(!(h.isLinesIntersect()||h.isSelOutsideImg()||r&&h.isDestPointSmall()))return h.performDummyZoom(),"break";if(s.activeObj=Pe({},h.straightenActObj,null,!0),h.setZoomPan("in"),a===s.img.destWidth&&l===s.img.destHeight)return h.performDummyZoom(),"break";0===s.transform.degree&&(s.transform.zoomFactor+=.025,s.transform.cropZoomFactor+=.025);var e=h.imgCanvasPoints,t=s.img.destLeft,i=s.img.destTop,n=s.img.destWidth,o=s.img.destHeight;e.forEach(function(e){e.x=e.ratioX*n+t,e.y=e.ratioY*o+i}),h.imgCanvasPoints=e}(););},G6t.prototype.performDummyZoom=function(){var e=this.parent,t=(e.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:.025,zoomPoint:null,isResize:!0}}),e.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:-.025,zoomPoint:null,isResize:!0}}),10*e.transform.zoomFactor);e.setProperties({zoomSettings:{zoomFactor:t=t<1?1+t/10:t}},!0),e.notify("transform",{prop:"setPreviousZoomValue",onPropertyChange:!1,value:{previousZoomValue:t}}),this.panToSel()},G6t.prototype.setZoomPan=function(e){var t=this.parent,i={maxDimension:null};0===t.transform.degree?(t.notify("transform",{prop:"cropZoom",onPropertyChange:!1,value:{value:"in"===e?.025:-.025,selectionObj:t.activeObj,obj:i}}),t.img.destWidth=i.maxDimension.width,t.img.destHeight=i.maxDimension.height):(t.transform.zoomFactor+="in"===e?.025:-.025,t.transform.cropZoomFactor+="in"===e?.025:-.025,this.updateCurrTransState("initial"),this.isRotateZoom=!0,this.setDestPoints(),this.isRotateZoom=!1,this.updateCurrTransState("reverse"))},G6t.prototype.updateImgCanvasPoints=function(){var e,t,i,n,o=this.parent,r=this.getImagePoints(),s={width:0,height:0},a=o.baseImgCanvas.width,l=o.baseImgCanvas.height,a=(o.notify("crop",{prop:"calcRatio",onPropertyChange:!1,value:{obj:s,dimension:{width:a,height:l}}}),o.transform.degree%90==0&&o.transform.degree%180!=0?s.height:s.width),l=o.transform.degree%90==0&&o.transform.degree%180!=0?s.width:s.height,s=o.img,h=s.destLeft,d=s.destTop,p=s.destWidth,s=s.destHeight;0<o.transform.straighten?(e={x:h+r[0].x/a,y:d},t={x:h+p,y:d+r[1].y/l},i={x:h+p-r[0].x/a,y:d+s},n={x:h,y:d+s-r[1].y/l}):o.transform.straighten<0?(e={x:h,y:d+r[0].y/l},t={x:h+r[1].x/a,y:d},i={x:h+p,y:d+s-r[0].y/l},n={x:h+p-r[1].x/a,y:d+s}):0===o.transform.straighten&&(e={x:h,y:d},t={x:h+p,y:d},i={x:h+p,y:d+s},n={x:h,y:d+s}),e.ratioX=(e.x-h)/p,e.ratioY=(e.y-d)/s,t.ratioX=(t.x-h)/p,t.ratioY=(t.y-d)/s,i.ratioX=(i.x-h)/p,i.ratioY=(i.y-d)/s,n.ratioX=(n.x-h)/p,n.ratioY=(n.y-d)/s,this.imgCanvasPoints=[e,t,i,n]},G6t.prototype.isLinesIntersect=function(e){var t,i,n,o,r,s,a,l,h,d=this.parent,p=d.activeObj.activePoint;return 0!==d.activeObj.rotatedAngle?(o=(i=d.activeObj.activePoint).startX,t=i.startY,a=i.endX,n=i.endY,l=o+i.width/2,i=t+i.height/2,r={x:(h=Math.cos(d.activeObj.rotatedAngle))*(o-l)-(d=Math.sin(d.activeObj.rotatedAngle))*(n-i)+l,y:d*(o-l)+h*(n-i)+i},n={x:h*(a-l)-d*(n-i)+l,y:d*(a-l)+h*(n-i)+i},s=this.imgCanvasPoints,a=this.doIntersect(o={x:h*(o-l)-d*(t-i)+l,y:d*(o-l)+h*(t-i)+i},d={x:h*(a-l)-d*(t-i)+l,y:d*(a-l)+h*(t-i)+i},s[0],s[1]),l=this.doIntersect(d,n,s[1],s[2]),h=this.doIntersect(r,n,s[2],s[3]),t=this.doIntersect(o,r,s[3],s[0]),e&&(e.arr=[a,l,h,t]),a||l||h||t):(i=this.imgCanvasPoints,d=this.doIntersect({x:p.startX,y:p.startY},{x:p.endX,y:p.startY},i[0],i[1]),n=this.doIntersect({x:p.endX,y:p.startY},{x:p.endX,y:p.endY},i[1],i[2]),o=this.doIntersect({x:p.startX,y:p.endY},{x:p.endX,y:p.endY},i[2],i[3]),r=this.doIntersect({x:p.startX,y:p.startY},{x:p.startX,y:p.endY},i[3],i[0]),s=this.isInsideRect(i[0]),a=this.isInsideRect(i[1]),l=this.isInsideRect(i[2]),h=this.isInsideRect(i[3]),e&&(e.arr=[d,n,o,r]),d||n||o||r||s||a||l||h||i[0].x>p.startX&&i[1].x<p.endX&&i[2].x<p.endX&&i[3].x>p.startX&&i[0].y<p.startY&&i[1].y<p.startY&&i[2].y>p.endY&&i[3].y>p.endY||i[0].x<p.startX&&i[1].x>p.endX&&i[2].x>p.endX&&i[3].x<p.startX&&i[0].y>p.startY&&i[1].y>p.startY&&i[2].y<p.endY&&i[3].y<p.endY)},G6t.prototype.isSelOutsideImg=function(){var e=this.parent,t=this.imgCanvasPoints,e=e.activeObj.activePoint;return"inside"!==this.checkPointPosition(e.startX,e.startY,t[0].x,t[0].y,t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y)||"inside"!==this.checkPointPosition(e.endX,e.startY,t[0].x,t[0].y,t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y)||"inside"!==this.checkPointPosition(e.startX,e.endY,t[0].x,t[0].y,t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y)||"inside"!==this.checkPointPosition(e.endX,e.endY,t[0].x,t[0].y,t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y)},G6t.prototype.calcTriangleArea=function(e,t,i,n,o,r){return Math.abs((e*(n-r)+i*(r-t)+o*(t-n))/2)},G6t.prototype.checkPointPosition=function(e,t,i,n,o,r,s,a,l,h){var d=this.calcTriangleArea(e,t,i,n,l,h),p=this.calcTriangleArea(e,t,l,h,s,a),c=this.calcTriangleArea(e,t,s,a,o,r),e=this.calcTriangleArea(e,t,o,r,i,n),t=this.calcTriangleArea(i,n,o,r,s,a)+this.calcTriangleArea(s,a,l,h,i,n);return t<d+p+c+e?"outside":d+p+c+e!==t||0!==d&&0!==p&&0!==c&&0!==e?"inside":"on"},G6t.prototype.getImagePoints=function(){var e=[],t=this.parent,i=t.transform.degree,n=t.baseImg.width,o=t.baseImg.height,r={dim:null,width:o,height:n,angle:t.transform.straighten};r.dim=t.getRotatedCanvasDim(r.width,r.height,r.angle);var s=i%90==0&&i%180!=0?o:n,n=i%90==0&&i%180!=0?n:o,o=(i%90==0&&i%180!=0?r.dim:t.baseImgCanvas).width/2,i=(i%90==0&&i%180!=0?r.dim:t.baseImgCanvas).height/2,r=o-s/2,a=i-n/2,s=o+s/2,n=i+n/2,t=t.transform.straighten*(Math.PI/180),l={x:Math.cos(t)*(r-o)-Math.sin(t)*(a-i)+o,y:Math.sin(t)*(r-o)+Math.cos(t)*(a-i)+i},a={x:Math.cos(t)*(s-o)-Math.sin(t)*(a-i)+o,y:Math.sin(t)*(s-o)+Math.cos(t)*(a-i)+i},s={x:Math.cos(t)*(s-o)-Math.sin(t)*(n-i)+o,y:Math.sin(t)*(s-o)+Math.cos(t)*(n-i)+i},r={x:Math.cos(t)*(r-o)-Math.sin(t)*(n-i)+o,y:Math.sin(t)*(r-o)+Math.cos(t)*(n-i)+i};return e.push(l),e.push(a),e.push(s),e.push(r),e},G6t.prototype.doIntersect=function(e,t,i,n){var o=this.initiation(e,t,i),r=this.initiation(e,t,n),s=this.initiation(i,n,e),a=this.initiation(i,n,t);return o!==r&&s!==a||!!(0===o&&this.onSegment(e,i,t)||0===r&&this.onSegment(e,n,t)||0===s&&this.onSegment(i,e,n)||0===a&&this.onSegment(i,t,n))},G6t.prototype.initiation=function(e,t,i){e=(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y);return 0==e?0:0<e?1:2},G6t.prototype.onSegment=function(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)},G6t.prototype.isInsideRect=function(e){var t=this.parent.activeObj.activePoint,i=!1;return i=e.x>=t.startX&&e.x<=t.endX&&e.y>=t.startY&&e.y<=t.endY?!0:i},G6t.prototype.setDestForStraighten=function(){var e,t,i,n,o=this.parent;je(this.straightenDestPoints)&&(e=(n=o.img).destLeft,t=n.destTop,i=n.destWidth,n=n.destHeight,o.notify("shape",{prop:"straightenShapes",onPropertyChange:!1}),this.straightenDestPoints=Pe({},o.img,{},!0),o.img.destLeft=e,o.img.destTop=t,o.img.destWidth=i,o.img.destHeight=n)},G6t.prototype.drawRedact=function(e,t){var i,n,o,r,s,a,l,h,d,p,c,u,g,m,f,y,v,b,w,C=t.activePoint,S=C.startX,A=C.startY,x=C.endX,C=C.endY,I=t.activePoint,T=I.width,I=I.height,E=!1,D=e.canvas,M=(-1!==D.id.indexOf("_tempCanvas")&&(E=!0),this.parent.img);T<=0||I<=0||(this.parent.isCropTab?e.drawImage(t.redactImage,0,0,t.redactImage.width,t.redactImage.height,S,A,T,I):(n=(i=document.createElement("canvas")).getContext("2d"),o=D.width,r=D.height,o=Math.min(o,r)/1e3,r=(0!==this.parent.transform.straighten?this.parent.transform:this.parent.cropObj).straighten,this.allowRedactStraighten&&0!==r&&(a=(s=document.createElement("canvas")).getContext("2d"),E?(s.width=D.width,s.height=D.height,a.drawImage(D,0,0)):(s.width=M.destWidth,s.height=M.destHeight,a.drawImage(this.lowerContext.canvas,M.destLeft,M.destTop,M.destWidth,M.destHeight,0,0,M.destWidth,M.destHeight)),a=-r*Math.PI/180,h=(l=document.createElement("canvas")).getContext("2d"),l.width=s.width,l.height=s.height,M.destWidth>D.width&&!E&&(l.width=D.width),M.destHeight>D.height&&!E&&(l.height=D.height),h.save(),h.translate(s.width/2,s.height/2),h.rotate(a),h.drawImage(s,-s.width/2,-s.height/2),h.restore(),0<M.destLeft&&!E&&(S-=M.destLeft,x-=M.destLeft),0<M.destTop&&!E&&(A-=M.destTop,C-=M.destTop),b={x:S+T/2,y:A+I/2},y=Math.cos(r*Math.PI/180),m=Math.sin(r*Math.PI/180),p=y*(S-b.x)-m*(A-b.y)+b.x,c=m*(S-b.x)+y*(A-b.y)+b.y,u=y*(x-b.x)-m*(A-b.y)+b.x,g=m*(x-b.x)+y*(A-b.y)+b.y,f=y*(S-b.x)-m*(C-b.y)+b.x,v=m*(S-b.x)+y*(C-b.y)+b.y,E?b={x:D.width/2,y:D.height/2}:(b={x:M.destWidth/2,y:M.destHeight/2},M.destWidth>D.width&&(b.x=D.width/2),M.destHeight>D.height&&(b.y=D.height/2)),y=Math.cos(a),m=Math.sin(a),d=y*(p-b.x)-m*(c-b.y)+b.x,p=m*(p-b.x)+y*(c-b.y)+b.y,c=y*(u-b.x)-m*(g-b.y)+b.x,u=m*(u-b.x)+y*(g-b.y)+b.y,b.x,b.y,b.x,g=m*(f-b.x)+y*(v-b.y)+b.y,m=E?e.canvas.width:M.destWidth,f=E?e.canvas.height:M.destHeight,y=Math.abs(m*Math.cos(a))+Math.abs(f*Math.sin(a)),v=Math.abs(m*Math.sin(a))+Math.abs(f*Math.cos(a)),l.width=y,l.height=v,h.save(),h.translate(y/2,v/2),h.rotate(a),h.drawImage(s,-s.width/2,-s.height/2),h.restore(),"blur"===this.parent.activeObj.redactType?(i.width=T,i.height=I,n.drawImage(l,d+(y-s.width)/2,p+(v-s.height)/2,c-d,g-u,0,0,T,I)):(w=t.redactPixelate/100*20,E&&(w=o*(t.redactPixelate/100)*35),i.width=Math.ceil(T/w),i.height=Math.ceil(I/w),n.drawImage(l,d+(y-s.width)/2,p+(v-s.height)/2,c-d,g-u,0,0,i.width,i.height))),"blur"===this.parent.activeObj.redactType?(0===r&&(i.width=T,i.height=I,n.drawImage(E?D:this.lowerContext.canvas,S,A,T,I,0,0,T,I)),E?(b=o*(t.redactBlur/100*34),n.filter="blur("+b+"px)"):n.filter="blur("+t.redactBlur/100*17+"px)",n.drawImage(i,0,0),0===r?n.drawImage(E?D:this.lowerContext.canvas,S,A,T,I,0,0,T,I):(0<M.destLeft&&!E&&(S+=M.destLeft,x+=M.destLeft),0<M.destTop&&!E&&(A+=M.destTop,C+=M.destTop)),this.parent.isSafari&&this.parent.notify("filter",{prop:"apply-filter",onPropertyChange:!1,value:{context:n}}),e.drawImage(i,0,0,T,I,S,A,T,I)):(w=t.redactPixelate/100*20,E&&(w=o*(t.redactPixelate/100)*35),0===r?(i.width=Math.ceil(T/w),i.height=Math.ceil(I/w),n.drawImage(E?D:this.lowerContext.canvas,S,A,T,I,0,0,i.width,i.height)):(0<M.destLeft&&!E&&(S+=M.destLeft,x+=M.destLeft),0<M.destTop&&!E&&(A+=M.destTop,C+=M.destTop)),e.imageSmoothingEnabled=!1,e.drawImage(i,0,0,i.width,i.height,S,A,T,I)),t.redactImage=this.parent.createElement("canvas"),t.redactImage.width=i.width,t.redactImage.height=i.height,t.redactImage.getContext("2d").drawImage(i,0,0),e.beginPath(),e.rect(S,A,T,I),e.rect(S,A,T,I),e.fill("evenodd"),e.closePath()))},G6t);function G6t(e){this.isInitialLoading=!1,this.fileName="",this.isErrorImage=!1,this.isShapeTextInserted=!1,this.isRotateZoom=!1,this.tempStrokeSettings={strokeColor:"#fff",fillColor:"",strokeWidth:null,outlineColor:"",radius:null,outlineWidth:null},this.tempTextSettings={text:"Enter Text",fontFamily:"",fontSize:null,fontRatio:null,bold:!1,italic:!1,underline:!1},this.tempAdjValue="",this.tempFilter="",this.tempUndoRedoStep=0,this.tempFreehandCounter=0,this.tempCurrFhdIndex=0,this.tempZoomFactor=null,this.isCancelAction=!1,this.rotatedFlipCropSel=!1,this.zoomCrop={width:0,height:0},this.isImageEdited=!1,this.isFileChanged=!1,this.isNewPath=!1,this.isResizeSelect=!1,this.arrowDimension={bar:{width:10,height:32,ratioX:null,ratioY:null},arrow:{width:24,height:24,ratioX:null,ratioY:null},arrowSolid:{width:32,height:32,ratioX:null,ratioY:null},circle:{width:10,height:10,ratioX:null,ratioY:null},square:{width:20,height:20,ratioX:null,ratioY:null}},this.origDim={width:0,height:0},this.isImageApply=!1,this.imgCanvasPoints=[],this.isCropSelect=!1,this.isDownScale=!1,this.preventStraightening=!1,this.tempObjColl=[],this.tempPointColl={},this.imageBackgroundColor="",this.allowRedactStraighten=!0,this.isNullExtension=!0,this.parent=e,this.addEventListener()}X6t.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},X6t.prototype.addEventListener=function(){this.parent.on("export",this.export,this),this.parent.on("destroyed",this.destroy,this)},X6t.prototype.removeEventListener=function(){this.parent.off("export",this.export),this.parent.off("destroyed",this.destroy)},X6t.prototype.export=function(e){switch(this.parent.notify("toolbar",{prop:"refreshShapeDrawing",onPropertyChange:!1}),this.updatePvtVar(),e.prop){case"export":this.exportImg(e.value.type,e.value.fileName,e.value.imgQuality);break;case"exportToCanvas":this.exportToCanvas(e.value.object);break;case"updateSaveContext":this.updateSaveContext(e.value.context);break;case"setImageQuality":this.imageQuality=e.value.value;break;case"drawAnnotation":this.drawAnnotation(e.value.context,e.value.ratio)}},X6t.prototype.getModuleName=function(){return"export"},X6t.prototype.updatePvtVar=function(){var e=this.parent;e.lowerCanvas&&(this.lowerContext=e.lowerCanvas.getContext("2d"))},X6t.prototype.exportImg=function(e,t,i){var n,o=this.parent,r={fileName:""},r=(o.notify("draw",{prop:"getFileName",onPropertyChange:!1,value:{obj:r}}),r.fileName);!o.disabled&&o.isImageLoaded&&(o.notify("shape",{prop:"applyActObj",onPropertyChange:!1,value:{isMouseDown:null}}),n={canvasFilter:this.parent.canvasFilter},this.lowerContext.filter=n.canvasFilter,e=e||"Png",o.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:null}}),o.trigger("beforeSave",n={cancel:!1,fileName:t||r,fileType:e,imageQuality:i}),this.beforeSaveEvent(n,e,t,r,i))},X6t.prototype.beforeSaveEvent=function(e,t,i,n,o){var r=this.parent;e.cancel||(r.currObjType.isSave=!0,i=(i=e.fileName||i)||n,"svg"===(e=t.toLowerCase())?this.toSVGImg(i):this.toBlobFn(i,e,o),r.trigger("saved",e={fileName:i||n,fileType:t}),r.triggerEditCompleteEvent({action:"save",actionEventArgs:e}),r.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1}),r.lowerCanvas.style.left=r.upperCanvas.style.left="",r.lowerCanvas.style.top=r.upperCanvas.style.top="",r.lowerCanvas.style.maxWidth=r.upperCanvas.style.maxWidth="",r.lowerCanvas.style.maxHeight=r.upperCanvas.style.maxHeight="")},X6t.prototype.toSVGImg=function(e){var t=this.parent,i=(kA(t.element),t.element.style.opacity="0.5",this.exportToCanvas()),n=i.toDataURL(),t=(BA(t.element),t.element.style.opacity="1",document.createElementNS("http://www.w3.org/2000/svg","svg")),o=(t.setAttribute("width",i.style.maxWidth),t.setAttribute("height",i.style.maxHeight),document.createElementNS("http://www.w3.org/2000/svg","image")),n=(o.setAttributeNS(null,"height",i.height.toString()),o.setAttributeNS(null,"width",i.width.toString()),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n),t.appendChild(o),'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+i.width+'" height="'+i.height+'">'),o=t.innerHTML,i="data:image/svg+xml;base64,"+btoa(n+o+"</svg>");return null===e?i:(this.downloadImg(i,e+".svg"),null)},X6t.prototype.toBlobFn=function(t,i,e){var n=this,o=this.parent;kA(o.element),o.element.style.opacity="0.5",je(e)||(this.imageQuality=(e=1<e?1:e<=0?.01:e)||null),this.exportToCanvas().toBlob(function(e){e=URL.createObjectURL(e);n.downloadImg(e,t+"."+i),BA(o.element),o.element.style.opacity="1"},"jpeg"===i?"image/jpeg":"webp"===i?"image/webp":"image/png",this.imageQuality||null)},X6t.prototype.exportToCanvas=function(e){var t,i,n=this.parent,o=Pe({},n.cropObj,{},!0),r={currObj:{}},r=(n.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:r}}),r.currObj),s=(r.objColl=Pe([],n.objColl,[],!0),r.pointColl=Pe([],n.pointColl,[],!0),r.afterCropActions=Pe([],n.afterCropActions,[],!0),{selPointColl:null}),a=(n.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:s}}),this.parent.aspectWidth?(n.notify("undo-redo",{prop:"setPreventUR",value:{bool:!0}}),n.notify("toolbar",{prop:"resizeClick",value:{bool:!1}}),n.okBtn(),i=n.transform.degree%90==0&&n.transform.degree%180!=0?(t=this.parent.aspectHeight,this.parent.aspectWidth):(t=this.parent.aspectWidth,this.parent.aspectHeight),n.notify("undo-redo",{prop:"setPreventUR",value:{bool:!1}})):i=n.currSelectionPoint?(t=n.img.srcWidth,n.img.srcHeight):(t=n.baseImgCanvas.width,n.baseImgCanvas.height),{width:0,height:0}),l=(n.notify("crop",{prop:"calcRatio",onPropertyChange:!1,value:{obj:a,dimension:{width:t,height:i}}}),this.lowerContext.filter),h=("none"!==this.lowerContext.filter&&(d=this.lowerContext.filter.split(" "),h=parseFloat(d[5].split("(")[1]),d[5]="blur("+(h*=(a.width+a.height)/2)+"px)",this.lowerContext.filter=d.join(" ")),n.createElement("canvas",{id:n.element.id+"_tempCanvas",attrs:{name:"canvasImage"}})),d=h.getContext("2d"),p=(h.width=t,h.height=i,{width:0,height:0}),p=(n.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!1,value:{width:t,height:i,obj:p}}),h.style.maxWidth=p.width+"px",h.style.maxHeight=p.height+"px",this.lowerContext.filter);return d.filter=this.lowerContext.filter,this.downScaleImgCanvas(d,t,i),this.lowerContext.filter=p,0===n.transform.degree&&""===n.transform.currFlipState&&0===n.transform.straighten||(this.updateSaveContext(d),this.exportTransformedImage(d)),n.isSafari&&n.notify("filter",{prop:"apply-filter",onPropertyChange:!1,value:{context:d}}),this.drawAnnotation(d,a),n.isCircleCrop&&n.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:d,isSave:!0,isFlip:null}}),this.updateFrame(d,!0),this.lowerContext.filter=l,n.canvasFilter=l,e&&(e.canvas=h),n.aspectWidth&&(n.objColl=[],n.pointColl=[],n.freehandCounter=0,n.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:[]}}}),n.notify("draw",{prop:"setCurrentObj",onPropertyChange:!1,value:{obj:r}}),r.selPointColl=Pe([],s.selPointColl,[],!0),n.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:r.selPointColl}}}),n.cropObj=o,n.objColl=Pe([],r.objColl,[],!0),n.pointColl=Pe([],r.pointColl,[],!0),n.freehandCounter=n.pointColl.length,n.transform.straighten=0,this.lowerContext.filter="none",n.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),this.lowerContext.filter=r.filter,n.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),n.isCircleCrop||n.currSelectionPoint&&"crop-circle"===n.currSelectionPoint.shape)&&n.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),h},X6t.prototype.drawAnnotation=function(e,t){var i=this.parent,n=Pe([],i.objColl,[],!0),o=Pe([],i.pointColl,[],!0),r=i.shapeColl.filter(function(e){return"redact"!==e.shape}),s=i.shapeColl.filter(function(e){return"redact"===e.shape});i.shapeColl=s.concat(r);for(var a=0;a<i.shapeColl.length;a++)i.shapeColl[a].order&&(i.shapeColl[a].currIndex&&-1<i.shapeColl[a].currIndex.indexOf("shape")?(i.objColl=[],i.objColl.push(Pe({},i.shapeColl[a],{},!0)),this.drawShape(e,t)):i.shapeColl[a].id&&-1<i.shapeColl[a].id.indexOf("pen")&&(i.pointColl=[],i.freehandCounter=0,i.pointColl.push(Pe({},i.shapeColl[a],{},!0)),i.freehandCounter=i.pointColl.length,this.drawPen(e,t)));i.objColl=n,i.pointColl=o,i.freehandCounter=i.pointColl.length},X6t.prototype.drawShape=function(e,t){var i=this.parent;if(0<i.objColl.length){for(var n=e.filter,o=(e.filter="none",{index:null}),r=(i.notify("shape",{prop:"getSmallestIndex",onPropertyChange:!1,value:{obj:o}}),o.index),s=Pe([],i.objColl,[],!0),o=Pe([],i.objColl,[],!0);0<s.length;){for(var a=!1,l=0;l<s.length;l++){var h=s[l];if(je(h.order))s.splice(l,1),l--;else if(h.order===r){var h=e.filter,d=(e.filter="none",s[l]),p=d.activePoint;if(p.startX-=i.img.destLeft,p.startY-=i.img.destTop,p.endX-=i.img.destLeft,p.endY-=i.img.destTop,p.width=p.endX-p.startX,p.height=p.endY-p.startY,p.startX*=t.width,p.startY*=t.height,p.endX*=t.width,p.endY*=t.height,p.width=p.endX-p.startX,p.height=p.endY-p.startY,d.strokeSettings.strokeWidth*=(t.width+t.height)/2,"text"===d.shape)d.textSettings.fontSize*=(t.width+t.height)/2;else if("path"===d.shape)for(var c=0;c<d.pointColl.length;c++)d.pointColl[c].x=(d.pointColl[c].x-i.img.destLeft)*t.width,d.pointColl[c].y=(d.pointColl[c].y-i.img.destTop)*t.height;else"image"===d.shape&&(i.activeObj=Pe({},s[l],{},!0),i.notify("selection",{prop:"upgradeImageQuality",onPropertyChange:!1}),s[l]=Pe({},i.activeObj,{},!0));i.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"saveContext",obj:s[l],isCropRatio:null,points:null,isPreventDrag:!0,saveContext:e,isPreventSelection:null}}),e.filter=h,i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),r++;p={bool:!1};i.notify("shape",{prop:"isIndexInObjColl",onPropertyChange:!1,value:{obj:p,index:r}}),p.bool||r++,s.splice(l,1),a=!0;break}}if(!a)break}e.filter=n,i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),i.objColl=o}},X6t.prototype.drawPen=function(e,t){var i=this.parent;if(0<i.freehandCounter){for(var n={penStrokeWidth:null},o=(i.notify("freehand-draw",{prop:"getPenStrokeWidth",onPropertyChange:!1,value:{obj:n}}),Pe({},i.pointColl,{},!0)),r=0;r<i.freehandCounter;r++){i.points=Pe([],i.pointColl[r].points,[]),i.notify("freehand-draw",{prop:"setPointCounter",onPropertyChange:!1,value:{value:0}});var s=i.points.length;i.pointColl[r].strokeWidth*=(t.width+t.height)/2;for(var a=0;a<s;a++)i.points[a].x=(i.points[a].x-i.img.destLeft)*t.width,i.points[a].y=(i.points[a].y-i.img.destTop)*t.height}i.notify("freehand-draw",{prop:"freehandRedraw",onPropertyChange:!1,value:{context:e,points:null}}),i.pointColl=o,i.notify("freehand-draw",{prop:"setPenStrokeWidth",onPropertyChange:!1,value:{value:n.penStrokeWidth}})}},X6t.prototype.downScaleImgCanvas=function(e,t,i){var n=this.parent,o=n.baseImgCanvas,r=n.baseImg,s={width:0,height:0},r=(n.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!1,value:{width:r.width,height:r.height,obj:s,isImgShape:null}}),{color:null});n.notify("draw",{prop:"getImageBackgroundColor",value:{obj:r}}),""!==r.color&&(e.fillStyle=r.color,e.fillRect(0,0,e.canvas.width,e.canvas.height)),t<s.width&&i<s.height?((r=n.createElement("canvas",{id:n.element.id+"_downScaleCanvas",attrs:{name:"canvasImage"}})).width=this.parent.img.srcWidth,r.height=this.parent.img.srcHeight,r.getContext("2d").drawImage(o,n.img.srcLeft,n.img.srcTop,n.img.srcWidth,n.img.srcHeight,0,0,r.width,r.height),n.notify("draw",{prop:"downScale",value:{canvas:r,width:t,height:i}}),e.drawImage(r,0,0)):e.drawImage(n.baseImgCanvas,n.img.srcLeft,n.img.srcTop,n.img.srcWidth,n.img.srcHeight,0,0,t,i)},X6t.prototype.updateFrame=function(e,t){var i;"none"!==this.parent.frameObj.type&&(i=e.filter,e.filter="none",this.parent.notify("draw",{prop:"applyFrame",value:{ctx:e,frame:this.parent.frameObj.type,preventImg:t}}),e.filter=i)},X6t.prototype.downloadImg=function(e,t){var i=document.createElement("a");i.href=e,i.target="_parent",i.download=t,(document.body||document.documentElement).appendChild(i),i.click(),i.parentNode.removeChild(i)},X6t.prototype.exportTransformedImage=function(e){var t=this.parent,i=t.transform.degree;if(0<t.rotateFlipColl.length)for(var n=0,o=t.rotateFlipColl.length;n<o;n++){var r=t.rotateFlipColl[n];"number"==typeof r?this.exportRotate(e,r):"horizontal"===r?this.exportFlip(e,!0,!1):"vertical"===r&&this.exportFlip(e,!1,!0)}t.transform.degree=i},X6t.prototype.exportRotate=function(e,t){var i=this.parent;e.clearRect(0,0,e.canvas.width,e.canvas.height),this.setMaxDim(i.transform.degree,e.canvas),e.translate(e.canvas.width/2,e.canvas.height/2),e.rotate(Math.PI/180*t),e.drawImage(i.inMemoryCanvas,-e.canvas.height/2,-e.canvas.width/2,e.canvas.height,e.canvas.width),this.updateSaveContext(e)},X6t.prototype.exportFlip=function(e,t,i){e.clearRect(0,0,e.canvas.width,e.canvas.height),t&&(e.translate(e.canvas.width,0),e.scale(-1,1)),i&&(e.translate(0,e.canvas.height),e.scale(1,-1)),e.drawImage(this.parent.inMemoryCanvas,0,0),this.updateSaveContext(e)},X6t.prototype.updateSaveContext=function(e){var t=this.parent.inMemoryCanvas.getContext("2d"),e=(e.setTransform(1,0,0,1,0,0),e.getImageData(0,0,e.canvas.width,e.canvas.height));this.parent.inMemoryCanvas.width=e.width,this.parent.inMemoryCanvas.height=e.height,t.putImageData(e,0,0)},X6t.prototype.setMaxDim=function(e,t){e%90==0&&e%180!=0?i=je(this.parent.currSelectionPoint)?(n=this.parent.baseImgCanvas.height,this.parent.baseImgCanvas.width):(n=this.parent.img.srcHeight,this.parent.img.srcWidth):e%180!=0&&0!==e||(i=je(this.parent.currSelectionPoint)?(n=this.parent.baseImgCanvas.width,this.parent.baseImgCanvas.height):(n=this.parent.img.srcWidth,this.parent.img.srcHeight)),je(this.parent.aspectWidth)||(n=this.parent.aspectWidth,i=this.parent.aspectHeight),t.width=n,t.height=i;var i,e={width:0,height:0},n=(this.parent.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!1,value:{width:n,height:i,obj:e,isImgShape:null}}),e);t.style.maxWidth=n.width+"px",t.style.maxHeight=n.height+"px"};var Y6t=X6t;function X6t(e){this.parent=e,this.addEventListener()}J6t.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},J6t.prototype.addEventListener=function(){this.parent.on("filter",this.filter,this),this.parent.on("destroyed",this.destroy,this)},J6t.prototype.removeEventListener=function(){this.parent.off("filter",this.filter),this.parent.off("destroyed",this.destroy)},J6t.prototype.filter=function(e){switch(this.updatePrivateVariables(),e.prop){case"finetuneImage":this.finetuneImage(e.value.option,e.value.value);break;case"applyImageFilter":this.setFilter(e.value.option);break;case"update-finetunes":this.updateFinetunes();break;case"set-adjustment":this.setAdjustment(e.value.operation);break;case"initFilter":this.initFilter();break;case"setCurrAdjValue":this.setCurrAdjValue(e.value.type,e.value.value);break;case"updateAdj":this.updateAdj(e.value.type,e.value.value,e.value.isPreview,e.value.ctx);break;case"getCurrentObj":this.getCurrentObj(e.value.object);break;case"getAdjustmentLevel":je(this.parent.activeObj.opacity)?this.adjustmentLevel.transparency=100:this.adjustmentLevel.transparency=100*this.parent.activeObj.opacity,e.value.obj.adjustmentLevel=this.adjustmentLevel;break;case"setAdjustmentLevel":this.adjustmentLevel=e.value.adjustmentLevel;break;case"getTempAdjustmentLevel":e.value.obj.tempAdjustmentLevel=this.tempAdjustmentLevel;break;case"setTempAdjustmentLevel":this.tempAdjustmentLevel=e.value.tempAdjustmentLevel;break;case"setAdjustmentValue":this.adjustmentValue=e.value.adjustmentValue;break;case"setBrightnessAdjusted":this.isBrightnessAdjusted=e.value.isBrightnessAdjusted,this.parent.currentFilter.split("_")&&"cold"===this.parent.currentFilter.split("_")[1]&&(this.isBrightnessAdjusted=!1);break;case"getBevelFilter":e.value.obj.bevelFilter=this.bevelFilter;break;case"setBevelFilter":this.bevelFilter=e.value.bevelFilter;break;case"setTempAdjVal":this.tempAdjVal=Pe({},this.adjustmentLevel,{},!0);break;case"setTempFilVal":this.tempFilVal=this.parent.currentFilter;break;case"reset":this.reset();break;case"apply-filter":this.applyFilter(e.value.context)}},J6t.prototype.updatePrivateVariables=function(){var e=this.parent;e.lowerCanvas&&(this.lowerContext=e.lowerCanvas.getContext("2d"))},J6t.prototype.getModuleName=function(){return"filter"},J6t.prototype.reset=function(){this.adjustmentLevel={brightness:0,contrast:0,hue:0,opacity:100,saturation:0,blur:0,exposure:0,transparency:100,sharpen:!1,bw:!1},this.tempAdjustmentLevel={brightness:0,contrast:0,hue:0,opacity:100,saturation:0,blur:0,exposure:0,transparency:100,sharpen:!1,bw:!1},this.adjustmentValue=this.parent.getDefaultFilter(),this.isBrightnessAdjusted=!1,this.bevelFilter="none",this.tempFilVal="",this.tempAdjVal={brightness:0,contrast:0,hue:0,opacity:100,saturation:0,blur:0,exposure:0,transparency:100,sharpen:!1,bw:!1}},J6t.prototype.updateFinetunes=function(){var t=this,e=this.parent,i=e.finetuneSettings;i&&(["brightness","contrast","hue","saturation","exposure","opacity","blur"].forEach(function(e){i[e]&&(t.adjustmentLevel[e]=i[e].defaultValue,t.tempAdjustmentLevel[e]=i[e].defaultValue)}),e.notify("draw",{prop:"isInitialLoading",onPropertyChange:!1,value:{isInitialLoading:!0}}))},J6t.prototype.initFilter=function(){this.setFilterAdj("brightness",this.adjustmentLevel.brightness),this.setFilterAdj("contrast",this.adjustmentLevel.contrast),this.setFilterAdj("hue",this.adjustmentLevel.hue),this.setFilterAdj("saturation",this.adjustmentLevel.saturation),this.setFilterAdj("exposure",this.adjustmentLevel.exposure),this.setFilterAdj("opacity",this.adjustmentLevel.opacity),this.setFilterAdj("blur",this.adjustmentLevel.blur)},J6t.prototype.updateAdj=function(e,t,i,n){var o,r,s=this.parent,a=(this.lowerContext.clearRect(0,0,s.lowerCanvas.width,s.lowerCanvas.height),this.lowerContext.filter.split(" ")),l=[],h=this.getFilterValue(this.adjustmentLevel.brightness);switch(e){case"brightness":t=this.getFilterValue(this.adjustmentLevel.exposure)+.005*t,a[0]="brightness("+t+")",t=0!==this.adjustmentLevel.brightness?this.adjustmentLevel.opacity/100-.3*this.adjustmentLevel.opacity/100:this.adjustmentLevel.opacity/100,a[4]="opacity("+t+")",this.adjustmentValue=a.join(" ");break;case"contrast":a[1]="contrast("+t+"%)",this.adjustmentValue=a.join(" ");break;case"hue":a[2]="hue-rotate("+t+"deg)",this.adjustmentValue=a.join(" ");break;case"saturation":a[3]="saturate("+t+"%)",this.adjustmentValue=a.join(" ");break;case"opacity":1!==parseFloat(a[0].split("(")[1])&&(t-=.2),a[4]="opacity("+(t=t<0?0:t)+")",this.adjustmentValue=a.join(" ");break;case"blur":a[5]="blur("+t+"px)",this.adjustmentValue=a.join(" ");break;case"exposure":1<t?(--t,t+=h):t<1&&(t=h-(t=1-t)),a[0]="brightness("+t+")",this.adjustmentValue=a.join(" ");break;case"chrome":o=this.getSaturationFilterValue(this.adjustmentLevel.saturation),a[3]="saturate("+(t=(o*=100)+.4*o)+"%)",l=this.adjustmentValue.split(" "),a[0]=l[0],a[1]=l[1],a[2]=l[2],a[4]=l[4],a[5]=l[5],a[6]="sepia(0%)",a[7]="grayscale(0%)",a[8]="invert(0%)";break;case"cold":o=this.getFilterValue(this.adjustmentLevel.brightness),t=.9*(o*=100),a[0]="brightness("+(t*=.01)+")",o=this.getFilterValue(this.adjustmentLevel.contrast),a[1]="contrast("+(t=(o*=100)+.5*o)+"%)",o=this.getSaturationFilterValue(this.adjustmentLevel.saturation),a[3]="saturate("+(t=o*=100)+"%)",l=this.adjustmentValue.split(" "),a[2]=l[2],a[4]=l[4],a[5]=l[5],a[6]="sepia(0%)",a[7]="grayscale(0%)",a[8]="invert(0%)";break;case"warm":o=this.getSaturationFilterValue(this.adjustmentLevel.saturation),a[3]="saturate("+(t=(o*=100)+.4*o)+"%)",a[6]="sepia(25%)",l=this.adjustmentValue.split(" "),a[0]=l[0],a[1]=l[1],a[2]=l[2],a[4]=l[4],a[5]=l[5],a[7]="grayscale(0%)",a[8]="invert(0%)";break;case"grayscale":a[7]="grayscale(100%)",l=this.adjustmentValue.split(" "),a[0]=l[0],a[1]=l[1],a[2]=l[2],a[3]=l[3],a[4]=l[4],a[5]=l[5],a[6]="sepia(0%)",a[8]="invert(0%)";break;case"sepia":a[6]="sepia(100%)",l=this.adjustmentValue.split(" "),a[0]=l[0],a[1]=l[1],a[2]=l[2],a[3]=l[3],a[4]=l[4],a[5]=l[5],a[7]="grayscale(0%)",a[8]="invert(0%)";break;case"invert":a[8]="invert(100%)",l=this.adjustmentValue.split(" "),a[0]=l[0],a[1]=l[1],a[2]=l[2],a[3]=l[3],a[4]=l[4],a[5]=l[5],a[6]="sepia(0%)",a[7]="grayscale(0%)"}"sharpen"!==e&&"blackandwhite"!==e&&(je(i)&&("default"===e&&(a=this.getDefaultCurrentFilter(a)),this.lowerContext.filter=a.join(" ")),a=this.setTempFilterValue(h,i,a,e),s.notify("draw",{prop:"setRotateZoom",onPropertyChange:!1,value:{isRotateZoom:!0}}),s.notify("draw",{prop:"updateCurrTransState",onPropertyChange:!1,value:{type:"initial",isPreventDestination:null,isRotatePan:null}}),r=void 0,"bevel"===s.frameObj.type&&(r=this.lowerContext.filter,this.bevelFilter=r),0===s.transform.degree&&0<s.rotateFlipColl.length&&(s.img.destLeft+=s.panPoint.totalPannedPoint.x,s.img.destTop+=s.panPoint.totalPannedPoint.y),s.img.destLeft+=s.panPoint.totalPannedInternalPoint.x,s.img.destTop+=s.panPoint.totalPannedInternalPoint.y,0===s.transform.degree&&s.notify("transform",{prop:"setDestPointsForFlipState",onPropertyChange:!1}),s.notify("draw",{prop:"drawImage",onPropertyChange:!1}),s.notify("draw",{prop:"updateCurrTransState",onPropertyChange:!1,value:{type:"reverse",isPreventDestination:null,isRotatePan:null}}),s.notify("draw",{prop:"setRotateZoom",onPropertyChange:!1,value:{isRotateZoom:!1}}),0===s.transform.degree&&0<s.rotateFlipColl.length&&(s.img.destLeft+=s.panPoint.totalPannedPoint.x,s.img.destTop+=s.panPoint.totalPannedPoint.y),a=this.setTempFilterValue(h,i,a,e),je(i)&&(this.lowerContext.filter=a.join(" ")),s.initialAdjustmentValue=a.join(" "),r=this.lowerContext.filter,this.lowerContext.filter="brightness(1) contrast(100%) hue-rotate(0deg) saturate(100%) opacity(1) blur(0px) sepia(0%) grayscale(0%) invert(0%)",this.bevelFilter=r,s.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"iterate",pen:"iterate",isPreventApply:null}}),this.lowerContext.filter=r,s.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),(s.currSelectionPoint&&"crop-circle"===s.currSelectionPoint.shape||s.isCircleCrop)&&s.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),this.isBrightnessAdjusted=1!==h);e=a.join(" ");n&&(n.filter=e)},J6t.prototype.setTempFilterValue=function(e,t,i,n){return t&&("default"===n?i=this.getDefaultCurrentFilter(i):1!==e&&((t=this.lowerContext.filter.split(" "))[4]=i[4],this.lowerContext.filter=t.join(" "))),i},J6t.prototype.getDefaultCurrentFilter=function(e){var t=this.adjustmentValue.split(" ");return[t[0],t[1],t[2],t[3],t[4],t[5],"sepia(0%)","grayscale(0%)","invert(0%)"]},J6t.prototype.getFilterValue=function(e){return 0===e?1:1+.5*e/100},J6t.prototype.getSaturationFilterValue=function(e){return 0===e?1:1+e/100},J6t.prototype.setFilterAdj=function(e,t){var i=this.parent;switch(i.notify("freehand-draw",{prop:"apply-pen-draw",onPropertyChange:!1}),this.adjustmentLevel[""+e]=t,e){case"contrast":case"exposure":t=this.getFilterValue(t),"contrast"===e&&(t*=100);break;case"hue":t*=3;break;case"saturation":t=100*this.getSaturationFilterValue(t);break;case"opacity":t<10&&(t+=1),t/=100;break;case"blur":0!==t&&(t=t/20+.5)}var n=Pe({},i.cropObj,{},!0),o=this.getCurrentObj(),r=(o.objColl=Pe([],i.objColl,[],!0),o.pointColl=Pe([],i.pointColl,[],!0),o.afterCropActions=Pe([],i.afterCropActions,[],!0),{selPointColl:null});i.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:r}}),o.selPointColl=Pe([],r.selPointColl,[],!0),this.updateAdj(e,t),i.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:e,previousObj:o,previousObjColl:o.objColl,previousPointColl:o.pointColl,previousSelPointColl:o.selPointColl,previousCropObj:n,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}})},J6t.prototype.setFilter=function(e){var t=this.parent;e=e.toLowerCase(),t.notify("freehand-draw",{prop:"apply-pen-draw",onPropertyChange:!1});var i={currentFilter:this.parent.currentFilter}.currentFilter,n=Pe({},t.cropObj,{},!0),o=this.getCurrentObj(),r=(o.objColl=Pe([],t.objColl,[],!0),o.pointColl=Pe([],t.pointColl,[],!0),o.afterCropActions=Pe([],t.afterCropActions,[],!0),{selPointColl:null});t.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:r}}),o.selPointColl=Pe([],r.selPointColl,[],!0),this.updateAdj(e,null),t.notify("draw",{prop:"setImageEdited",onPropertyChange:!1}),t.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:e,previousObj:o,previousObjColl:o.objColl,previousPointColl:o.pointColl,previousSelPointColl:o.selPointColl,previousCropObj:n,previousText:null,currentText:null,previousFilter:i,isCircleCrop:null}})},J6t.prototype.setAdjustment=function(e){var t,i,n=this.lowerContext.filter.split(" ");switch(e){case"brightness":i=n[0].split("("),t=parseFloat(i[1].split(")")[0]),this.adjustmentLevel.brightness=this.setFilterValue(t);break;case"contrast":i=n[1].split("("),t=parseFloat(i[1].split(")")[0]),this.adjustmentLevel.contrast=this.setFilterValue(t/=100);break;case"hue":i=n[2].split("("),t=parseFloat(i[1].split(")")[0]),this.adjustmentLevel.hue=t/=3;break;case"saturation":i=n[3].split("("),t=parseFloat(i[1].split(")")[0]),this.adjustmentLevel.saturation=this.setSaturationFilterValue(t/=100);break;case"opacity":i=n[4].split("("),.45===(t=parseFloat(i[1].split(")")[0]))?t=40:.4===t?t=30:.35===t?t=20:.3===t?t=10:.25===t?t=0:t*=100,this.adjustmentLevel.opacity=t;break;case"blur":i=n[5].split("("),t=parseFloat(i[1].split(")")[0]),this.adjustmentLevel.blur=t*=20;break;case"exposure":i=n[0].split("("),t=parseFloat(i[1].split(")")[0]),this.adjustmentLevel.exposure=this.setFilterValue(t)}},J6t.prototype.setFilterValue=function(e){return Math.round(1===e?0:100*(e-1)/.5)},J6t.prototype.setSaturationFilterValue=function(e){return Math.round(1===e?0:100*(e-1))},J6t.prototype.finetuneImage=function(e,t){var i=this.parent;if(!i.disabled&&i.isImageLoaded){switch(e.toLowerCase()){case"brightness":this.setFilterAdj("brightness",t);break;case"contrast":this.setFilterAdj("contrast",t);break;case"hue":this.setFilterAdj("hue",t);break;case"saturation":this.setFilterAdj("saturation",t);break;case"opacity":this.setFilterAdj("opacity",t);break;case"blur":this.setFilterAdj("blur",t);break;case"exposure":this.setFilterAdj("exposure",t)}this.parent.canvasFilter=this.lowerContext.filter,i.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}})}},J6t.prototype.setCurrAdjValue=function(e,t){var i=this.parent;switch(this.parent.notify("draw",{prop:"setImageEdited",onPropertyChange:!1}),e){case"brightness":this.setFilterAdj("brightness",t);break;case"contrast":this.setFilterAdj("contrast",t);break;case"hue":this.setFilterAdj("hue",t);break;case"saturation":this.setFilterAdj("saturation",t);break;case"opacity":this.setFilterAdj("opacity",t);break;case"blur":this.setFilterAdj("blur",t);break;case"exposure":this.setFilterAdj("exposure",t)}i.isFinetuneBtnClick=!0,i.curFinetuneObjEvent={finetune:i.toPascalCase(e),value:t}},J6t.prototype.getCurrentObj=function(e){var t=this.parent,i={point:null},n=(t.notify("crop",{prop:"getTempFlipPanPoint",value:{obj:i}}),{previousZoomValue:null}),o=(t.notify("transform",{prop:"getPreviousZoomValue",value:{obj:n}}),{zoomFactor:null}),r=(t.notify("draw",{prop:"getStraightenInitZoom",value:{obj:o}}),{color:null}),s=(t.notify("draw",{prop:"getImageBackgroundColor",value:{obj:r}}),{cropZoom:0,defaultZoom:0,totalPannedPoint:{x:0,y:0},totalPannedClientPoint:{x:0,y:0},totalPannedInternalPoint:{x:0,y:0},tempFlipPanPoint:{x:0,y:0},activeObj:{},rotateFlipColl:[],degree:0,currFlipState:"",zoomFactor:0,previousZoomValue:0,straighten:0,destPoints:{startX:0,startY:0,width:0,height:0},frame:"none",srcPoints:{startX:0,startY:0,width:0,height:0},filter:"",isBrightAdjust:this.isBrightnessAdjusted,aspectWidth:null,aspectHeight:null,straightenZoom:0,adjustmentLevel:Pe({},this.tempAdjVal,{},!0),currentFilter:this.tempFilVal,imageSource:"",bgColor:""});return s.cropZoom=t.transform.cropZoomFactor,s.defaultZoom=t.transform.defaultZoomFactor,s.zoomFactor=t.zoomSettings.zoomFactor,s.previousZoomValue=n.previousZoomValue,s.straightenZoom=o.zoomFactor,s.totalPannedPoint=Pe({},t.panPoint.totalPannedPoint,{},!0),s.totalPannedClientPoint=Pe({},t.panPoint.totalPannedClientPoint,{},!0),s.totalPannedInternalPoint=Pe({},t.panPoint.totalPannedInternalPoint,{},!0),s.tempFlipPanPoint=Pe({},i.point,{},!0),s.activeObj=Pe({},t.activeObj,{},!0),s.rotateFlipColl=Pe([],t.rotateFlipColl,[],!0),s.degree=t.transform.degree,s.straighten=t.cropObj.straighten,s.currFlipState=t.transform.currFlipState,s.destPoints={startX:t.img.destLeft,startY:t.img.destTop,endX:0,endY:0,width:t.img.destWidth,height:t.img.destHeight},s.srcPoints={startX:t.img.srcLeft,startY:t.img.srcTop,endX:0,endY:0,width:t.img.srcWidth,height:t.img.srcHeight},s.filter=this.lowerContext.filter,s.aspectWidth=t.aspectWidth,s.aspectHeight=t.aspectHeight,s.frame=t.frameObj.type,s.frameObj=Pe({},t.frameObj),s.imageSource=t.baseImg.src,s.bgColor=r.color,e&&(e.currObj=s),s},J6t.prototype.getValFromPercentage=function(e){var t=parseFloat(e);return/%\s*?$/i.test(e)&&(t/=100),t},J6t.prototype.getValFromLength=function(e){return parseFloat(e)},J6t.prototype.parseFilterString=function(e){var t=[];return t=e&&"none"!==e?e.split(" ").map(function(e){e=e.match(/([a-z-]+)\(([^)]+)\)/).slice(1,3);return{filter:e[0],value:e[1]}}):t},J6t.prototype.applyFilter=function(e){for(var t=e.canvas,i=t.height,t=t.width,n=e.getImageData(0,0,t,i),o=this.parseFilterString(e.filter),r=0,s=o.length;r<s;r++)switch(o[r].filter){case"blur":n=this.blur(e,n,o[r].value);break;case"brightness":n=this.brightness(n,o[r].value);break;case"contrast":n=this.contrast(n,o[r].value);break;case"grayscale":n=this.grayscale(n,o[r].value);break;case"hue-rotate":n=this.hueRotate(n,o[r].value);break;case"invert":n=this.invert(n,o[r].value);break;case"opacity":n=this.opacity(n,o[r].value);break;case"saturate":n=this.saturate(e,n,o[r].value);break;case"sepia":n=this.sepia(n,o[r].value)}e.putImageData(n,0,0)},J6t.prototype.blur=function(e,t,i){var n=this.getValFromLength(i=void 0===i?"0":i),n=Math.floor(n);if(!(n<=0)){for(var i=e.canvas,o=i.height,r=i.width,s=t.data,a=new Uint8ClampedArray(s.length),l=0;l<o;l++)for(var h=0;h<r;h++){for(var d=0,p=0,c=0,u=0,g=0,m=-n;m<=n;m++)for(var f=-n;f<=n;f++){var y=h+f,v=l+m;0<=y&&y<r&&0<=v&&v<o&&(d+=s[v=4*(v*r+y)],p+=s[1+v],c+=s[2+v],u+=s[3+v],g++)}a[b=4*(l*r+h)]=d/g,a[b+1]=p/g,a[b+2]=c/g,a[b+3]=u/g}for(var b=0;b<s.length;b++)s[b]=a[b]}return t},J6t.prototype.brightness=function(e,t){var i=this.getValFromPercentage(t=void 0===t?"1":t);if(1!==i)for(var n=e.data,o=n.length,r=0;r<o;r+=4)n[r+0]*=i,n[r+1]*=i,n[r+2]*=i;return e},J6t.prototype.contrast=function(e,t){var i=this.getValFromPercentage(t=void 0===t?"1":t);if(1!==i)for(var n=e.data,o=n.length,r=0;r<o;r+=4)n[r+0]=255*((n[r+0]/255-.5)*i+.5),n[r+1]=255*((n[r+1]/255-.5)*i+.5),n[r+2]=255*((n[r+2]/255-.5)*i+.5);return e},J6t.prototype.grayscale=function(e,t){var i=this.getValFromPercentage(t=void 0===t?"0":t);if(0<i)for(var n=e.data,o=n.length,r=0;r<o;r+=4){var s=n[r],a=n[r+1],l=n[r+2],h=.299*s+.587*a+.114*l;n[r]=s*(1-i)+h*i,n[r+1]=a*(1-i)+h*i,n[r+2]=l*(1-i)+h*i}return e},J6t.prototype.hueRotate=function(e,t){void 0===t&&(t="0deg");var i=e.data,t=parseFloat(t)*(Math.PI/180);if(0<t)for(var n=Math.cos(t),t=Math.sin(t),o=[.213+.787*n-.213*t,.715-.715*n-.715*t,.072-.072*n+.928*t,.213-.213*n+.143*t,.715+.285*n+.14*t,.072-.072*n-.283*t,.213-.213*n-.787*t,.715-.715*n+.715*t,.072+.928*n+.072*t],r=0;r<i.length;r+=4){var s=i[r],a=i[r+1],l=i[r+2];i[r]=o[0]*s+o[1]*a+o[2]*l,i[r+1]=o[3]*s+o[4]*a+o[5]*l,i[r+2]=o[6]*s+o[7]*a+o[8]*l}return e},J6t.prototype.invert=function(e,t){var i=this.getValFromPercentage(t=void 0===t?"0":t);if(0<i)for(var n=e.data,o=n.length,r=0;r<o;r+=4)n[r+0]=Math.abs(n[r+0]-255*i),n[r+1]=Math.abs(n[r+1]-255*i),n[r+2]=Math.abs(n[r+2]-255*i);return e},J6t.prototype.opacity=function(e,t){var i=this.getValFromPercentage(t=void 0===t?"0":t);if(0<=i)for(var n=e.data,o=n.length,r=3;r<o;r+=4)n[r]*=i;return e},J6t.prototype.saturate=function(e,t,i){var n=this.getValFromPercentage(i=void 0===i?"0":i);if(1!==n)for(var i=e.canvas,o=i.width,r=i.height,s=t.data,a=.3086*(1-n),l=.6094*(1-n),h=.082*(1-n),d=o<<2,p=0;p<r;p++)for(var c=p*d,u=0;u<o;u++){var g=c+(u<<2),m=s[g],f=s[1+g],y=s[2+g];s[g]=(a+n)*m+l*f+h*y,s[1+g]=a*m+(l+n)*f+h*y,s[2+g]=a*m+l*f+(h+n)*y}return t},J6t.prototype.sepia=function(e,t){var i=this.getValFromPercentage(t=void 0===t?"0":t);if(0<(i=1<i?1:i))for(var n=e.data,o=n.length,r=0;r<o;r+=4){var s=n[r+0],a=n[r+1],l=n[r+2];n[r+0]=(.393*s+.769*a+.189*l)*i+s*(1-i),n[r+1]=(.349*s+.686*a+.168*l)*i+a*(1-i),n[r+2]=(.272*s+.534*a+.131*l)*i+l*(1-i)}return e};var K6t=J6t;function J6t(e){this.adjustmentLevel={brightness:0,contrast:0,hue:0,opacity:100,saturation:0,blur:0,exposure:0,transparency:100,sharpen:!1,bw:!1},this.tempAdjustmentLevel={brightness:0,contrast:0,hue:0,opacity:100,saturation:0,blur:0,exposure:0,transparency:100,sharpen:!1,bw:!1},this.adjustmentValue="",this.isBrightnessAdjusted=!1,this.bevelFilter="none",this.tempAdjVal={brightness:0,contrast:0,hue:0,opacity:100,saturation:0,blur:0,exposure:0,transparency:100,sharpen:!1,bw:!1},this.tempFilVal="",this.parent=e,this.addEventListener()}$6t.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},$6t.prototype.addEventListener=function(){this.parent.on("freehand-draw",this.draw,this),this.parent.on("destroyed",this.destroy,this)},$6t.prototype.removeEventListener=function(){this.parent.off("freehand-draw",this.draw),this.parent.off("destroyed",this.destroy)},$6t.prototype.draw=function(e){switch(this.updateFhdPvtVar(),e.prop){case"hoverFhd":this.hoverFhd(e.value.strokeColor,e.value.strokeWidth);break;case"freehandDownHandler":this.freehandDownHandler(e.value.e,e.value.canvas);break;case"freehandUpHandler":this.freehandUpHandler(e.value.e,e.value.canvas,e.value.context);break;case"handle-freehand-draw":var t=parseInt(e.value.id.split("_")[1],10)-1;this.isFHDIdx(t)&&this.deleteFhd(t,!0);break;case"freehandRedraw":this.freehandRedraw(e.value.context,e.value.points);break;case"deleteFhd":t=parseInt(e.value.id.split("_")[1],10)-1;this.deleteFhd(t,!0);break;case"selectFhd":t=null;e.value.id&&(t=parseInt(e.value.id.split("_")[1],10)-1),this.selectFhd(t);break;case"applyFhd":this.applyFhd();break;case"cancelFhd":this.cancelFhd();break;case"updateFHDCurPts":this.updateFHDCurPts();break;case"rotateFhdColl":this.rotateFhdColl();break;case"flipFHDColl":this.flipFHDColl(e.value.value);break;case"panFHDColl":this.panFHDColl(e.value.xDiff,e.value.yDiff,e.value.panRegion);break;case"updateFHDColl":e.value&&e.value.isPreventApply?this.updateFHDColl(e.value.isPreventApply):this.updateFHDColl();break;case"zoomFHDColl":this.zoomFHDColl(e.value.isPreventApply);break;case"apply-pen-draw":this.applyPenDraw();break;case"freeHandDraw":this.freeHandDraw(e.value.value);break;case"isFHDIdx":this.isFHDIdx(e.value.index,e.value.obj);break;case"getSqPtFD":this.getSqPtFD(e.value.idx,e.value.obj);break;case"getSelPointColl":e.value.obj.selPointColl=Pe([],this.selPointColl);break;case"setSelPointColl":this.selPointColl=Pe([],e.value.obj.selPointColl);break;case"pushSelPointColl":this.selPointColl.push(Pe([],e.value.obj.selPointColl));break;case"setFreehandDrawHoveredIndex":this.fhdHovIdx=e.value.index;break;case"getFreehandDrawHoveredIndex":e.value.obj.index=this.fhdHovIdx;break;case"setPointCounter":this.pointCounter=e.value.value;break;case"getPenStrokeWidth":e.value.obj.penStrokeWidth=this.penStrokeWidth;break;case"setPenStrokeWidth":this.penStrokeWidth=e.value.value;break;case"getCurrentFreehandDrawIndex":e.value.obj.currentFreehandDrawIndex=this.currFHDIdx;break;case"setCurrentFreehandDrawIndex":this.currFHDIdx=e.value.value;break;case"updateCropPtsForSel":this.updateCropPtsForSel();break;case"getFreehandDrawSelectedId":e.value.obj.freehandDrawSelectedId=this.fhdSelID;break;case"resetFreehandDrawSelectedId":this.fhdSelID=null;break;case"getTempFreeHandDrawEditingStyles":e.value.obj.tempFreeHandDrawEditingStyles=this.tempFHDStyles;break;case"setFreehandSelectedIndex":this.fhdSelIdx=e.value.index;break;case"getFreehandSelectedIndex":e.value.obj.freehandSelectedIndex=this.fhdSelIdx;break;case"setCenterSelPoints":this.setCenterSelPoints();break;case"getStraightenPoint":e.value.obj.straightenPoint=Pe({},this.straightenPoint,{},!0);break;case"setStraightenPoint":this.straightenPoint.x=e.value.x,this.straightenPoint.y=e.value.y,e.value.ratioX&&e.value.ratioY&&(this.straightenPoint.ratioX=e.value.ratioX,this.straightenPoint.ratioY=e.value.ratioY);break;case"resetStraightenPoint":this.straightenPoint={x:null,y:null,ratioX:null,ratioY:null},this.prevStraightenObj=null,this.straightenPointAngle=0;break;case"getStraightenPointAngle":e.value.obj.angle=this.straightenPointAngle;break;case"reset":this.reset();break;case"triggerShapeChanging":this.triggerShapeChanging(e.value.shapeChangingArgs);break;case"setMasking":this.isMasking=e.value.value;break;case"resetSelPoints":this.selPoints=[]}},$6t.prototype.updateFhdPvtVar=function(){var e=this.parent;e.lowerCanvas&&(this.lowerContext=e.lowerCanvas.getContext("2d")),e.upperCanvas&&(this.upperContext=e.upperCanvas.getContext("2d"))},$6t.prototype.reset=function(){this.fhdObj={lastWidth:0,lastVelocity:0,time:0,pointX:0,pointY:0},this.isFreehandDrawing=this.isFreehandPointMoved=!1,this.selPoints=[],this.dummyPoints=[],this.freehandDownPoint={x:0,y:0},this.selPointColl={},this.straightenPointAngle=0,this.fhdHovIdx=null,this.pointCounter=0,this.fhdSelID=null,this.isMasking=!1,this.penStrokeWidth=void 0,this.currFHDIdx=0,this.fhdSelIdx=null,this.tempFHDStyles={strokeColor:null,fillColor:null,strokeWidth:null},this.straightenPoint={x:null,y:null,ratioX:null,ratioY:null},this.prevStraightenObj=null},$6t.prototype.getModuleName=function(){return"freehand-draw"},$6t.prototype.hoverFhd=function(e,t){var i,n,o,r,s,a,l=this.parent,h=this.upperContext,d=-1,d=-1<this.fhdHovIdx?this.fhdHovIdx:this.fhdSelIdx,p=(l.points=Pe([],l.pointColl[d].points),this.pointCounter=0,l.points.length);h.fillStyle=e||l.pointColl[d].strokeColor,h.strokeStyle=h.fillStyle,s=a=this.penStrokeWidth=t||l.pointColl[d].strokeWidth,1===p&&(i=n=o=r=l.points[0],this.startDraw(h,i,n,o,r,s,a));for(var c=0;c<p-3;c++)l.points[c+1]&&l.points[c+2]&&l.points[c+2]&&(i=this.calcCurveCP(l.points[c+0],l.points[c+1],l.points[c+2]).controlPoint2,n=this.calcCurveCP(l.points[c+1],l.points[c+2],l.points[c+3]).controlPoint1,o=0===c?l.points[c]:l.points[c+1],r=l.points[c+2],this.startDraw(h,i,n,o,r,s,a));h.closePath();e=this.getSqPtFD(d),t=h.lineWidth;h.lineWidth=2,h.strokeStyle=l.themeColl[l.theme].primaryColor,h.beginPath(),h.rect(e.startX,e.startY,e.width,e.height),h.stroke(),h.closePath(),h.lineWidth=t},$6t.prototype.freehandDownHandler=function(e,t){var i=this.parent,e=(i.lowerCanvas=document.querySelector("#"+i.element.id+"_lowerCanvas"),this.lowerContext=i.lowerCanvas.getContext("2d"),i.upperCanvas=document.querySelector("#"+i.element.id+"_upperCanvas"),this.upperContext=i.upperCanvas.getContext("2d"),this.fhdObj.time=(new Date).getTime(),this.isFreehandDrawing=!0,"mousedown"===e.type?this.freehandDownPoint={x:e.clientX,y:e.clientY}:this.freehandDownPoint={x:e.touches[0].clientX,y:e.touches[0].clientY},this.isFreehandPointMoved=!1,E.add(t,"mousemove touchmove",this.freehandMoveHandler,this),{id:"pen_"+(this.currFHDIdx+1),type:AUt.FreehandDraw,startX:this.freehandDownPoint.x,startY:this.freehandDownPoint.y,strokeColor:i.activeObj.strokeSettings.strokeColor,strokeWidth:this.penStrokeWidth,points:null,index:i.objColl.length+i.freehandCounter+1});this.triggerShapeChanging({cancel:!1,action:"draw-start",previousShapeSettings:e,currentShapeSettings:e})},$6t.prototype.freehandUpHandler=function(e,t,i){var n=t.getBoundingClientRect(),o=this.parent,t=(E.remove(t,"mousemove touchmove",this.freehandMoveHandler),0===o.points.length&&("mouseup"===e.type?this.processPoint(e.clientX-n.left,e.clientY-n.top,!0,i):"touchend"===e.type&&e.changedTouches?this.processPoint(e.changedTouches[0].clientX-n.left,e.changedTouches[0].clientY-n.top,!0,i):this.isFreehandPointMoved||this.processPoint(this.freehandDownPoint.x-n.left,this.freehandDownPoint.y-n.top,!0,i)),i.closePath(),Pe({},o.cropObj,{},!0)),e={currObj:{}},n=(o.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:e}}),e.currObj),i=(n.objColl=Pe([],o.objColl,[],!0),n.pointColl=Pe([],o.pointColl,[],!0),n.afterCropActions=Pe([],o.afterCropActions,[],!0),{selPointColl:null}),e=(o.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:i}}),n.selPointColl=Pe([],i.selPointColl,[],!0),o.freehandCounter),i=o.objColl.length+o.freehandCounter+1,e=(o.pointColl[e]={points:Pe([],o.points),strokeColor:o.activeObj.strokeSettings.strokeColor,strokeWidth:this.penStrokeWidth,flipState:o.transform.currFlipState,id:"pen_"+(this.currFHDIdx+1),order:i},o.points=[],this.dummyPoints=[],this.selPointColl[e]={points:Pe([],this.selPoints)},this.selPoints=[],this.pointCounter=0,o.freehandCounter++,this.isFreehandDrawing=!1,o.isMaskImage||o.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"freehand-draw",previousObj:n,previousObjColl:n.objColl,previousPointColl:n.pointColl,previousSelPointColl:n.selPointColl,previousCropObj:t,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),{id:"pen_"+(this.currFHDIdx+1),type:AUt.FreehandDraw,startX:this.freehandDownPoint.x,startY:this.freehandDownPoint.y,strokeColor:o.activeObj.strokeSettings.strokeColor,strokeWidth:this.penStrokeWidth,points:o.pointColl[this.currFHDIdx].points,index:i});this.triggerShapeChanging({cancel:!1,action:"draw-end",previousShapeSettings:e,currentShapeSettings:e}),this.currFHDIdx++},$6t.prototype.freehandMoveHandler=function(e){this.isFreehandPointMoved=!0;var t,i=this.parent.upperCanvas.getBoundingClientRect(),e="mousemove"===e.type?(t=e.clientX-i.left,e.clientY-i.top):(t=e.touches[0].clientX-i.left,e.touches[0].clientY-i.top);this.isFreehandDrawing&&(this.upperContext.fillStyle=this.parent.activeObj.strokeSettings.strokeColor,this.parent.isMaskImage&&(this.upperContext.globalCompositeOperation="xor"),this.processPoint(t,e,!1,this.upperContext))},$6t.prototype.processPoint=function(e,t,i,n){var o,r,s,a,l,h,d,p=this.parent,c=(this.point(e,t,(new Date).getTime()),!!(o=0<p.points.length&&p.points[p.points.length-1])&&this.distanceTo(o)<=5);this.selPoints.push({x:e,y:t,ratioX:(e-p.img.destLeft)/p.img.destWidth,ratioY:(t-p.img.destTop)/p.img.destHeight,time:this.fhdObj.time}),o&&c&&!i||(this.fhdObj.time=(new Date).getTime(),p.points.push({x:e,y:t,ratioX:(e-p.img.destLeft)/p.img.destWidth,ratioY:(t-p.img.destTop)/p.img.destHeight,time:this.fhdObj.time}),this.dummyPoints.push({x:e,y:t,ratioX:(e-p.img.destLeft)/p.img.destWidth,ratioY:(t-p.img.destTop)/p.img.destHeight,time:this.fhdObj.time}),2<this.dummyPoints.length&&(3===this.dummyPoints.length&&this.dummyPoints.unshift(this.dummyPoints[0]),o=this.dummyPoints[0],c=this.dummyPoints[1],p=this.dummyPoints[2],s=this.dummyPoints[3],r=this.calcCurveCP(o,c,p).controlPoint2,s=this.calcCurveCP(c,p,s).controlPoint1,a=this.dummyPoints[1],l=this.dummyPoints[2],h=.5,d=5,je(this.penStrokeWidth)||(h=d=this.penStrokeWidth),this.startDraw(n,r,s,a,l,h,d),this.pointCounter++,this.dummyPoints.shift()),i&&(r=s=a=l={x:e,y:t,time:(new Date).getTime()},h=.5,d=5,je(this.penStrokeWidth)||(h=d=this.penStrokeWidth),this.startDraw(n,r,s,a,l,h,d)))},$6t.prototype.calcCurveCP=function(e,t,i){var n=e.x-(t=t||e).x,o=e.y-t.y,r=t.x-(i=i||t).x,s=t.y-i.y,a=(e.x+t.x)/2,e=(e.y+t.y)/2,l=(t.x+i.x)/2,i=(t.y+i.y)/2,n=Math.sqrt(n*n+o*o),o=Math.sqrt(r*r+s*s),r=o/(n+o),s=l+(a-l)*r,n=i+(e-i)*r,o=t.x-s,r=t.y-n;return{controlPoint1:this.point(a+o,e+r,0),controlPoint2:this.point(l+o,i+r,0)}},$6t.prototype.point=function(e,t,i){return this.fhdObj.pointX=e,this.fhdObj.pointY=t,{x:this.fhdObj.pointX,y:this.fhdObj.pointY,time:i}},$6t.prototype.startDraw=function(e,t,i,n,o,r,s){var a=this.pointVelocity(n),r=(a=.7*a+(1-.7)*this.fhdObj.lastVelocity,Math.max(s/1.7,r));this.drawCurve(this.fhdObj.time,r,e,t,i,n,o,s),this.fhdObj.lastVelocity=a,this.fhdObj.time=r},$6t.prototype.pointVelocity=function(e){return this.fhdObj.time!==e.time?this.distanceTo(e)/(this.fhdObj.time-e.time):0},$6t.prototype.distanceTo=function(e){return Math.sqrt(Math.pow(this.fhdObj.pointX-e.x,2)+Math.pow(this.fhdObj.pointY-e.y,2))},$6t.prototype.drawCurve=function(e,t,i,n,o,r,s,a){var l,h,d,p,c,u,g,m,f=t-e,t=this.bezierLength(n,o,r,s),y=2*Math.ceil(t);for(i.beginPath(),l=0;l<y;l++)g=(m=(u=(c=1-(h=l/y))*c)*c)*r.x,g=(g=(g+=3*u*h*n.x)+3*c*(d=h*h)*o.x)+(p=d*h)*s.x,m=m*r.y,m=(m=(m+=3*u*h*n.y)+3*c*d*o.y)+p*s.y,u=Math.min(e+p*f,a),this.drawArc(g,m,u,i);i.closePath(),i.fill()},$6t.prototype.bezierLength=function(e,t,i,n){for(var o,r,s,a,l,h,d=0,p=0;p<=10;p++)o=this.bezierPoint(r=p/10,i.x,e.x,t.x,n.x),r=this.bezierPoint(r,i.y,e.y,t.y,n.y),0<p&&(l=o-s,h=r-a,d+=Math.sqrt(l*l+h*h)),s=o,a=r;return d},$6t.prototype.bezierPoint=function(e,t,i,n,o){return t*(1-e)*(1-e)*(1-e)+3*i*(1-e)*(1-e)*e+3*n*(1-e)*e*e+o*e*e*e},$6t.prototype.drawArc=function(e,t,i,n){var o=this.parent.img;(e>o.destLeft&&t>o.destTop&&e<o.destLeft+o.destWidth&&t<o.destTop+o.destHeight||n!==this.lowerContext&&n!==this.upperContext)&&(n.moveTo(e,t),n.arc(e,t,i,0,2*Math.PI,!1))},$6t.prototype.freehandRedraw=function(e,t){var i=this.parent,n=e.filter;if(e.filter="none",t&&(i.pointColl[i.freehandCounter]={points:t,strokeColor:i.activeObj.strokeSettings.strokeColor,strokeWidth:this.penStrokeWidth,flipState:i.transform.currFlipState,id:"pen_"+(i.freehandCounter+1),order:i.objColl.length+i.freehandCounter+1},this.selPointColl[i.freehandCounter]=Pe({},i.pointColl[i.freehandCounter],{},!0),i.freehandCounter++),0<i.freehandCounter){for(var o=0;o<i.freehandCounter;o++){i.points=Pe([],i.pointColl[o].points),this.pointCounter=0;var r=i.points.length,s=void 0,a=void 0,l=void 0,h=void 0,d=void 0,p=void 0;0<r&&(e.fillStyle=i.pointColl[o].strokeColor,d=p=this.penStrokeWidth=i.pointColl[o].strokeWidth),1===r&&(s=a=l=h=i.points[0],this.startDraw(e,s,a,l,h,d,p));for(var c=0;c<r-3;c++)i.points[c+1]&&i.points[c+2]&&i.points[c+2]&&(s=this.calcCurveCP(i.points[c+0],i.points[c+1],i.points[c+2]).controlPoint2,a=this.calcCurveCP(i.points[c+1],i.points[c+2],i.points[c+3]).controlPoint1,l=0===c?i.points[c]:i.points[c+1],h=i.points[c+2],this.startDraw(e,s,a,l,h,d,p));e.closePath()}e===this.lowerContext&&(i.notify("draw",{prop:"applyFrame",value:{ctx:this.lowerContext,frame:i.frameObj.type,preventImg:!0}}),this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height))}e.filter=n},$6t.prototype.getSqPtFD=function(e,t){for(var i={startX:0,startY:0,endX:0,endY:0,width:0,height:0},n=Pe([],this.selPointColl[e].points,[]),o=(this.parent.points=Pe([],this.parent.pointColl[e].points),this.pointCounter=0,n.length),r=0;r<o;r++)0===i.startX&&0===i.startY&&0===i.endX&&0===i.endY?(i.startX=n[r].x,i.startY=n[r].y,i.endX=n[r].x,i.endY=n[r].y):(i.startX=Math.min(i.startX,n[r].x),i.startY=Math.min(i.startY,n[r].y),i.endX=Math.max(i.endX,n[r].x),i.endY=Math.max(i.endY,n[r].y));return i.startX-=this.penStrokeWidth,i.startY-=this.penStrokeWidth,i.endX+=this.penStrokeWidth,i.endY+=this.penStrokeWidth,i.width=i.endX-i.startX,i.height=i.endY-i.startY,t&&(t.activePoint=i),i},$6t.prototype.applyPenDraw=function(){var e=this.parent;"freehanddraw"===e.currObjType.shape&&(e.notify("shape",{prop:"apply",onPropertyChange:!1,value:{shape:null,obj:null,canvas:null}}),e.upperCanvas.style.cursor=e.cursor="default",e.currObjType.shape=""),e.notify("shape",{prop:"clearActObj"})},$6t.prototype.applyFhd=function(){var e=this.parent,t=e.pointColl[this.fhdSelIdx];"#42a5f5"===t.strokeColor&&(t.strokeColor=this.tempFHDStyles.strokeColor),e.notify("toolbar",{prop:"setSelectedFreehandColor",value:{color:"#42a5f5"}}),this.upperContext.clearRect(0,0,e.upperCanvas.width,e.upperCanvas.height),this.lowerContext.clearRect(0,0,e.lowerCanvas.width,e.lowerCanvas.height),e.notify("draw",{prop:"render-image",value:{isMouseWheel:null}}),e.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1}),t&&(t.isSelected=!1),e.notify("selection",{prop:"resetFreehandDrawVariables"}),this.fhdHovIdx=this.fhdSelIdx=null},$6t.prototype.cancelFhd=function(){var e=this.parent,t=e.pointColl[this.fhdSelIdx];e.notify("toolbar",{prop:"setSelectedFreehandColor",value:{color:"#42a5f5"}}),this.upperContext.clearRect(0,0,e.upperCanvas.width,e.upperCanvas.height),this.lowerContext.clearRect(0,0,e.upperCanvas.width,e.upperCanvas.height),this.pointCounter=0,t&&(t.strokeColor=this.tempFHDStyles.strokeColor,t.strokeWidth=this.tempFHDStyles.strokeWidth,t.isSelected=!1),this.fhdHovIdx=this.fhdSelIdx=this.fhdSelID=null,e.notify("selection",{prop:"resetFreehandDrawVariables"}),e.activeObj.strokeSettings.strokeColor=this.tempFHDStyles.strokeColor,e.activeObj.strokeSettings.strokeWidth=this.penStrokeWidth=this.tempFHDStyles.strokeWidth,this.tempFHDStyles={strokeColor:null,strokeWidth:null,fillColor:null},e.notify("draw",{prop:"render-image",value:{isMouseWheel:null}}),e.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1})},$6t.prototype.selectFhd=function(e){var t=this.parent,i=Pe({},this.tempFHDStyles,{},!0);if(t.notify("selection",{prop:"setFreehandDrawEditing",onPropertyChange:!1,value:{bool:!0}}),e||0===e){if(!this.isFHDIdx(e))return;this.fhdSelIdx=this.fhdHovIdx=e,this.hoverFhd(),t.upperCanvas.style.cursor=t.cursor="pointer"}this.fhdSelIdx=this.fhdHovIdx;var e=t.pointColl[this.fhdSelIdx],n=(e.isSelected=!0,this.fhdSelID=e.id,"#42a5f5"!==e.strokeColor&&(t.activeObj.strokeSettings.strokeColor=this.tempFHDStyles.strokeColor=e.strokeColor),t.activeObj.strokeSettings.strokeWidth=this.tempFHDStyles.strokeWidth=t.pointColl[this.fhdHovIdx].strokeWidth,{bool:!1});t.notify("selection",{prop:"getFreehandDrawEditing",onPropertyChange:!1,value:{obj:n}}),n.bool?(n={id:"pen_"+(this.fhdSelIdx+1),type:AUt.FreehandDraw,startX:e.points[0].x,startY:e.points[0].y,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,points:e.points,opacity:e.opacity,index:e.order},this.triggerShapeChanging({cancel:!1,action:"select",previousShapeSettings:n,currentShapeSettings:n})):t.okBtn(null,!0),t.isUndoRedoStack&&(this.tempFHDStyles=i)},$6t.prototype.deleteFhd=function(e,t){var i=this.parent;if(this.isFHDIdx(e)){this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height);for(var n=Pe({},i.pointColl,{},!0),o=Pe({},this.selPointColl,{},!0),r=(i.pointColl={},this.selPointColl={},0),s=0;s<i.freehandCounter;s++)parseInt(n[s].id.split("_")[1],10)-1!==e&&(i.pointColl[r]=n[s],this.selPointColl[r]=o[s],r++);--i.freehandCounter,this.fhdHovIdx=this.fhdSelIdx=null,i.notify("selection",{prop:"resetFreehandDrawVariables"}),i.notify("draw",{prop:"render-image",value:{isMouseWheel:null}}),i.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1})}},$6t.prototype.zoomX=function(e){return e*this.parent.img.destWidth+this.parent.img.destLeft},$6t.prototype.zoomY=function(e){return e*this.parent.img.destHeight+this.parent.img.destTop},$6t.prototype.zoomFHDColl=function(e){var t=this.parent,i={startX:t.img.destLeft,startY:t.img.destTop,width:t.img.destWidth,height:t.img.destHeight};t.notify("shape",{prop:"straightenShapes",onPropertyChange:!1});for(var n=0;n<t.freehandCounter;n++){t.points=Pe([],t.pointColl[n].points,[]),this.pointCounter=0;for(var o=t.points.length,r=0;r<o;r++){var s=t.points[r];s.x=this.zoomX(s.ratioX),s.y=this.zoomY(s.ratioY)}}this.updateFHDCurPts(),this.straightenPoint.x&&this.straightenPoint.y&&(this.straightenPoint.x=this.zoomX(this.straightenPoint.ratioX),this.straightenPoint.y=this.zoomY(this.straightenPoint.ratioY)),0!==t.transform.straighten&&t.notify("shape",{prop:"straightenFHD",onPropertyChange:!1}),t.img.destLeft=i.startX,t.img.destTop=i.startY,t.img.destWidth=i.width,t.img.destHeight=i.height,je(e)&&this.freehandRedraw(this.lowerContext,null)},$6t.prototype.updateFHDCurPts=function(){for(var e=this.parent,t=0;t<e.freehandCounter;t++)if(this.selPointColl[t]){this.selPoints=Pe([],this.selPointColl[t].points,[]),this.pointCounter=0;for(var i=this.selPoints.length,n=0;n<i;n++){var o=this.selPoints[n];o.x=this.zoomX(o.ratioX),o.y=this.zoomY(o.ratioY)}}},$6t.prototype.rotateFhdColl=function(){for(var e=this.parent,t=e.img,i=t.destLeft,n=t.destTop,o=t.destWidth,r=t.destHeight,s=0;s<e.freehandCounter;s++){e.points=Pe([],e.pointColl[s].points,[]),this.pointCounter=0;for(var a=e.points.length,l=0;l<a;l++)(h=e.points[l]).y=n+r*h.ratioX,h.x=i+o-o*h.ratioY,h.ratioX=(h.x-i)/o,h.ratioY=(h.y-n)/r}for(s=0;s<e.freehandCounter;s++)if(this.selPointColl[s]){this.selPoints=Pe([],this.selPointColl[s].points,[]),this.pointCounter=0;for(var h,a=this.selPoints.length,l=0;l<a;l++)(h=this.selPoints[l]).y=n+r*h.ratioX,h.x=i+o-o*h.ratioY,h.ratioX=(h.x-i)/o,h.ratioY=(h.y-n)/r}this.updateFHDCurPts()},$6t.prototype.flipFHDColl=function(e){e=e.toLowerCase();if("horizontal"===e)this.pointsHorizontalFlip();else{if("vertical"!==e){this.pointsHorizontalFlip();for(var t=0;t<this.parent.freehandCounter;t++)this.parent.pointColl[t].shapeFlip=""}this.pointsVerticalFlip()}},$6t.prototype.pointsHorizontalFlip=function(){for(var e=this.parent,t=e.img,i=t.destLeft,n=t.destTop,o=t.destWidth,r=t.destHeight,s=0;s<e.freehandCounter;s++)if(e.pointColl[s].shapeFlip!==e.transform.currFlipState){e.points=Pe([],e.pointColl[s].points,[]),this.pointCounter=0;for(var a=e.points.length,l=0;l<a;l++)(h=e.points[l]).x<=i+o/2?h.x=i+o-(h.x-i):h.x>=i+o/2&&(h.x=i+(i+o-h.x)),h.ratioX=(h.x-i)/o,h.ratioY=(h.y-n)/r;e.pointColl[s].shapeFlip=e.transform.currFlipState}for(s=0;s<e.freehandCounter;s++)if(this.selPointColl[s]&&this.selPointColl[s].shapeFlip!==e.transform.currFlipState){this.selPoints=Pe([],this.selPointColl[s].points,[]),this.pointCounter=0;for(var h,a=this.selPoints.length,l=0;l<a;l++)(h=this.selPoints[l]).x<=i+o/2?h.x=i+o-(h.x-i):h.x>=i+o/2&&(h.x=i+(i+o-h.x)),h.ratioX=(h.x-i)/o,h.ratioY=(h.y-n)/r}this.updateFHDCurPts()},$6t.prototype.pointsVerticalFlip=function(){for(var e=this.parent,t=e.img,i=t.destLeft,n=t.destTop,o=t.destWidth,r=t.destHeight,s=0;s<e.freehandCounter;s++)if(e.pointColl[s].shapeFlip!==e.transform.currFlipState){e.points=Pe([],e.pointColl[s].points,[]),this.pointCounter=0;for(var a=e.points.length,l=0;l<a;l++)(h=e.points[l]).y<=n+r/2?h.y=n+r-(h.y-n):h.y>=n+r/2&&(h.y=n+(n+r-h.y)),h.ratioX=(h.x-i)/o,h.ratioY=(h.y-n)/r;e.pointColl[s].shapeFlip=e.transform.currFlipState}for(s=0;s<e.freehandCounter;s++)if(this.selPointColl[s]&&this.selPointColl[s].shapeFlip!==e.transform.currFlipState){this.selPoints=Pe([],this.selPointColl[s].points,[]),this.pointCounter=0;for(var h,a=this.selPoints.length,l=0;l<a;l++)(h=this.selPoints[l]).y<=n+r/2?h.y=n+r-(h.y-n):h.y>=n+r/2&&(h.y=n+(n+r-h.y)),h.ratioX=(h.x-i)/o,h.ratioY=(h.y-n)/r}this.updateFHDCurPts()},$6t.prototype.updateFHDColl=function(e){for(var t=this.parent,i={startX:t.img.destLeft,startY:t.img.destTop,width:t.img.destWidth,height:t.img.destHeight},n=(t.notify("shape",{prop:"straightenShapes",onPropertyChange:!1}),t.img),o=n.destLeft,r=n.destTop,s=n.destWidth,a=n.destHeight,l=0,h=t.objColl.length;l<h;l++){var d,p=t.objColl[l];if("line"===p.shape||"arrow"===p.shape?t.notify("shape",{prop:"straightenShapePoints",value:{obj:p,isReverse:!0}}):"path"===p.shape&&(d=t.transform.straighten,t.transform.straighten=-t.transform.straighten,t.notify("shape",{prop:"straightenPath",onPropertyChange:!1,value:{obj:p}}),t.transform.straighten=d),p.imageRatio={startX:(p.activePoint.startX-o)/s,startY:(p.activePoint.startY-r)/a,endX:(p.activePoint.endX-o)/s,endY:(p.activePoint.endY-r)/a,width:s/p.activePoint.width,height:a/p.activePoint.height},"path"===p.shape)for(var c=0,u=p.pointColl.length;c<u;c++)p.pointColl[c].ratioX=(p.pointColl[c].x-o)/s,p.pointColl[c].ratioY=(p.pointColl[c].y-r)/a;t.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1})}0<t.freehandCounter&&0!==t.transform.straighten&&(d=t.transform.straighten,t.transform.straighten=-t.transform.straighten,t.notify("shape",{prop:"straightenFHD",onPropertyChange:!1}),t.transform.straighten=d);for(var g=0;g<t.freehandCounter;g++){t.points=Pe([],t.pointColl[g].points,[]),this.pointCounter=0;for(var m=t.points.length,f=0;f<m;f++)(y=t.points[f]).ratioX=(y.x-o)/s,y.ratioY=(y.y-r)/a}for(g=0;g<t.freehandCounter;g++)if(this.selPointColl[g]){this.selPoints=Pe([],this.selPointColl[g].points,[]),this.pointCounter=0;for(var y,m=this.selPoints.length,f=0;f<m;f++)(y=this.selPoints[f]).ratioX=(y.x-o)/s,y.ratioY=(y.y-r)/a}this.straightenPoint.x&&this.straightenPoint.y&&(this.straightenPoint.ratioX=(this.straightenPoint.x-o)/s,this.straightenPoint.ratioY=(this.straightenPoint.y-r)/a),t.img.destLeft=i.startX,t.img.destTop=i.startY,t.img.destWidth=i.width,t.img.destHeight=i.height,t.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:e}})},$6t.prototype.panFHDColl=function(e,t,i){for(var n=this.parent,o=0;o<n.freehandCounter;o++){n.points=Pe([],n.pointColl[o].points,[]),this.pointCounter=0;for(var r=n.points.length,s=0;s<r;s++){var a=n.points[s];""===i||"vertical"===i?a.x+=e:a.x-=e,""===i||"horizontal"===i?a.y+=t:a.y-=t}}for(o=0;o<n.freehandCounter;o++)if(this.selPointColl[o]){this.selPoints=Pe([],this.selPointColl[o].points,[]),this.pointCounter=0;for(r=this.selPoints.length,s=0;s<r;s++){a=this.selPoints[s];""===i||"vertical"===i?a.x+=e:a.x-=e,""===i||"horizontal"===i?a.y+=t:a.y-=t}}this.straightenPoint.x&&this.straightenPoint.y&&(""===i||"vertical"===i?this.straightenPoint.x+=e:this.straightenPoint.x-=e,""===i||"horizontal"===i?this.straightenPoint.y+=t:this.straightenPoint.y-=t),this.freehandRedraw(this.lowerContext,null)},$6t.prototype.freeHandDraw=function(e){var t=this.parent;e?(t.points=[],this.dummyPoints=[],t.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),t.togglePen=!0,t.upperCanvas.style.cursor=t.cursor="crosshair",t.upperCanvas.style.display="block",je(t.activeObj.strokeSettings)&&(t.notify("shape",{prop:"getStrokeSettings",onPropertyChange:!(e={strokeSettings:{}}),value:{obj:e}}),t.activeObj.strokeSettings=e.strokeSettings),je(t.activeObj.strokeSettings.strokeWidth)&&(t.activeObj.strokeSettings.strokeWidth=2),t.isMaskImage?t.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1}):t.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"pen",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}})):(t.upperCanvas.style.cursor=t.cursor="default",e=this.penStrokeWidth,t.notify("shape",{prop:"apply",onPropertyChange:!1,value:{shape:null,obj:null,canvas:null}}),t.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1}),t.notify("toolbar",{prop:"setCurrentToolbar",value:{type:"main"}}),t.notify("selection",{prop:"setFreehandDrawCustomized",value:{isFreehandDrawCustomized:!1}}),this.penStrokeWidth=e)},$6t.prototype.isFHDIdx=function(e,t){for(var i=!1,n=0;n<this.parent.freehandCounter;n++)if(this.parent.pointColl[n].id&&parseInt(this.parent.pointColl[n].id.split("_")[1],10)-1===e){i=!0;break}return t&&(t.isIndex=i),i},$6t.prototype.updateCropPtsForSel=function(){for(var e=this.parent,t=e.activeObj.activePoint,i=0;i<e.freehandCounter;i++){var n={selPointColl:Pe([],this.selPointColl)};if(n.selPointColl[i]){this.selPoints=Pe([],n.selPointColl[i].points,[]),this.pointCounter=0;for(var o=this.selPoints.length,r=0;r<o;r++){var s=this.selPoints[r];s.ratioX=(s.x-t.startX)/t.width,s.ratioY=(s.y-t.startY)/t.height}}}},$6t.prototype.triggerShapeChanging=function(e){var t,i=this.parent,n=i.pointColl[this.fhdSelIdx];i.trigger("shapeChanging",e),"mask-drawing"!==i.element.getAttribute("data-value")||this.isMasking?(-1!==(i.editCompleteArgs=e).currentShapeSettings.id.indexOf("pen_")||"draw-end"!==e.action&&"select"!==e.action||(t="pen_"+e.currentShapeSettings.id,this.fhdSelIdx?i.pointColl[this.fhdSelIdx].id=t:i.pointColl[i.freehandCounter-1].id=t),this.penStrokeWidth=e.currentShapeSettings.strokeWidth,i.activeObj.strokeSettings.strokeColor!==e.currentShapeSettings.strokeColor&&(i.activeObj.strokeSettings.strokeColor=e.currentShapeSettings.strokeColor,i.notify("toolbar",{prop:"update-toolbar-items",onPropertyChange:!1})),this.fhdSelID&&n&&e.currentShapeSettings&&(n.strokeColor=e.currentShapeSettings.strokeColor,n.strokeWidth=e.currentShapeSettings.strokeWidth,n.points=e.currentShapeSettings.points,n.opacity=e.currentShapeSettings.opacity),"select"===e.action&&(this.freehandRedraw(this.upperContext),i.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"pen",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}))):(this.isMasking=!0,i.upperCanvas.style.cursor="crosshair",i.notify("draw",{prop:"updateTempObjColl"}),i.notify("draw",{prop:"updateTempPointColl"}),i.discard(),i.selectMaskImage())},$6t.prototype.setCenterSelPoints=function(){var e=this.parent,t={startX:e.img.destLeft,startY:e.img.destTop,width:e.img.destWidth,height:e.img.destHeight},i=(e.notify("shape",{prop:"straightenShapes",onPropertyChange:!1}),e.img),n=i.destLeft,o=i.destTop,r=i.destWidth,i=i.destHeight,s=e.activeObj.activePoint;!je(this.prevStraightenObj)&&JSON.stringify(this.prevStraightenObj.activePoint)===JSON.stringify(s)||(this.straightenPoint={x:s.startX+s.width/2,y:s.startY+s.height/2,ratioX:(s.startX+s.width/2-n)/r,ratioY:(s.startY+s.height/2-o)/i},this.prevStraightenObj=Pe({},e.activeObj,{},!0),this.straightenPointAngle=e.transform.straighten),e.img.destLeft=t.startX,e.img.destTop=t.startY,e.img.destWidth=t.width,e.img.destHeight=t.height};var Z6t=$6t;function $6t(e){this.fhdObj={lastWidth:0,lastVelocity:0,time:0,pointX:0,pointY:0},this.isFreehandDrawing=!1,this.freehandDownPoint={x:0,y:0},this.isFreehandPointMoved=!1,this.pointCounter=0,this.selPointColl={},this.currFHDIdx=0,this.selPoints=[],this.dummyPoints=[],this.tempFHDStyles={strokeColor:null,fillColor:null,strokeWidth:null},this.straightenPoint={x:null,y:null,ratioX:null,ratioY:null},this.straightenPointAngle=0,this.isMasking=!1,this.parent=e,this.addEventListener()}tUt.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},tUt.prototype.addEventListener=function(){this.parent.on("selection",this.selection,this),this.parent.on("destroyed",this.destroy,this)},tUt.prototype.removeEventListener=function(){this.parent.off("selection",this.selection),this.parent.off("destroyed",this.destroy)},tUt.prototype.selection=function(e){var t=this.parent;switch(this.updatePrivateVariables(),e.prop){case"setCursor":this.setCursor(e.value.x,e.value.y);break;case"updateActivePoint":this.updateActivePoint(e.value.x,e.value.y,e.value.isCropSelection);break;case"updateCursorStyles":this.updateCursorStyles(e.value.x,e.value.y,e.value.type);break;case"setTextSelection":this.setTextSelection(e.value.width,e.value.height);break;case"setActivePoint":this.setActivePoint(e.value.startX,e.value.startY);break;case"clearSelection":this.clearSelection(e.value.resetCrop);break;case"calcShapeRatio":this.calcShapeRatio(e.value.x,e.value.y,e.value.imgWidth,e.value.imgHeight);break;case"tab":this.performTabAction();break;case"setDragDirection":this.setDragDirection(e.value.width,e.value.height);break;case"clearUpperCanvas":this.isTouch&&setTimeout(function(){t.upperCanvas.getContext("2d").clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height)},550);break;case"resetFreehandDrawVariables":this.isFhdEditing=this.isFhdPoint=!1;break;case"isShapeInserted":this.isShapeInserted=e.value.bool;break;case"redrawShape":this.redrawShape(e.value.obj);break;case"setTextBoxStylesToActObj":this.setTextBoxStylesToActObj();break;case"mouseDownEventHandler":this.mouseDownEventHandler(e.value.e);break;case"mouseMoveEventHandler":this.mouseMoveEventHandler(e.value.e);break;case"mouseUpEventHandler":this.mouseUpEventHandler(e.value.e);break;case"canvasMouseDownHandler":this.canvasMouseDownHandler(e.value.e);break;case"canvasMouseMoveHandler":this.canvasMouseMoveHandler(e.value.e);break;case"canvasMouseUpHandler":this.canvasMouseUpHandler(e.value.e);break;case"touchStartHandler":this.touchStartHandler(e.value.e);break;case"keyDownEventHandler":this.keyDownEventHandler(e.value.e);break;case"handleScroll":this.handleScroll(e.value.e);break;case"textKeyDown":setTimeout(this.textKeyDown.bind(this),1,e.value.e);break;case"deleteItem":this.deleteItem();break;case"updatePrevShapeSettings":this.updatePrevShapeSettings(e.value.obj);break;case"getZoomType":e.value.obj.zoomType=this.zoomType;break;case"setZoomType":this.zoomType=e.value.zoomType;break;case"setInitialTextEdit":this.isInitialTextEdited=e.value.bool;break;case"setDragCanvas":this.dragCanvas=e.value.bool;break;case"setFreehandDrawCustomized":this.isFhdCustomized=e.value.isFreehandDrawCustomized;break;case"setTouchEndPoint":this.touchEndPoint.x=e.value.x,this.touchEndPoint.y=e.value.y;break;case"getPanDown":e.value.obj.panDown=this.panDown;break;case"setPanDown":this.panDown=e.value.panDown;break;case"getFreehandDrawEditing":e.value.obj.bool=this.isFhdEditing;break;case"setFreehandDrawEditing":this.isFhdEditing=e.value.bool;break;case"getTempActObj":e.value.obj.tempObj=this.tempActiveObj;break;case"setTempActObj":this.tempActiveObj=e.value.obj;break;case"isInside":this.isInside(e.value.x,e.value.y,e.value.z1,e.value.z2,e.value.z3,e.value.z4);break;case"setDragElement":this.dragElement=e.value.value;break;case"setObjSelected":this.isObjSelected=e.value.bool;break;case"adjustActObjForLineArrow":this.adjustActObjForLineArrow(e.value.obj);break;case"findTarget":this.findTarget(e.value.x,e.value.y,e.value.type);break;case"getCurrentFlipState":this.getCurrentFlipState();break;case"setDragWidth":this.setDragWidth(e.value.width);break;case"setDragHeight":this.setDragHeight(e.value.setDragHeight);break;case"annotate":this.currentDrawingShape=e.value.shape,"text"===e.value.shape?(t.activeObj.textSettings.fontSize=11,t.activeObj.keyHistory="Enter Text",t.notify("shape",{prop:"initializeTextShape",onPropertyChange:!1,value:{text:null,fontFamily:null,fontSize:null,bold:null,italic:null,strokeColor:null}})):"path"===e.value.shape&&(t.activeObj.pointColl=[]);break;case"getCurrentDrawingShape":e.value.obj.shape=this.currentDrawingShape;break;case"setCurrentDrawingShape":this.currentDrawingShape=e.value.value;break;case"getTransRotationPoint":this.getTransRotationPoint(e.value.obj,e.value.object);break;case"adjustNEPoints":this.adjustNEPoints(e.value.rectangle,e.value.x,e.value.y,e.value.angle);break;case"adjustRotationPoints":this.adjustRotationPoints(e.value.rectangle,e.value.x,e.value.y,e.value.angle,e.value.type,e.value.elem);break;case"getResizeDirection":this.getResizeDirection(e.value.rectangle,e.value.x,e.value.y,e.value.angle);break;case"setResizedElement":this.resizedElement=e.value.value;break;case"reset":this.reset();break;case"unWireEvent":this.unwireEvent();break;case"updPtCollForShpRot":this.updPtCollForShpRot(e.value.obj);break;case"findImageRatio":this.findImageRatio(e.value.width,e.value.height,e.value.obj);break;case"getNumTextValue":this.getNumTextValue(e.value.obj);break;case"setImageClarity":this.isImageClarity=e.value.bool;break;case"upgradeImageQuality":this.upgradeImageQuality();break;case"triggerShapeChange":this.triggerShapeChange(e.value.shapeResizingArgs,e.value.shapeMovingArgs,e.value.type);break;case"applyTransformToImg":this.applyTransformToImg(e.value.ctx);break;case"findTargetObj":e.value.obj.bool=this.findTargetObj(e.value.x,e.value.y,e.value.isCrop);break;case"setSliding":this.isSliding=e.value.bool;break;case"setSliderActive":this.isSliderActive=e.value.bool;break;case"getArrowType":e.value.obj.type=this.getArrowType(e.value.type);break;case"setArrowShape":"initial"===e.value.type?this.arrowShape[0]=e.value.shape:this.arrowShape[1]=e.value.shape;break;case"updateNWPoints":this.updateNWPoints(e.value.x,e.value.y);break;case"updateNPoints":this.updateNPoints(e.value.x,e.value.y);break;case"updateNEPoints":this.updateNEPoints(e.value.x,e.value.y);break;case"updateWPoints":this.updateWPoints(e.value.x,e.value.y);break;case"updateEPoints":this.updateEPoints(e.value.x,e.value.y);break;case"updateSWPoints":this.updateSWPoints(e.value.x,e.value.y);break;case"updateSPoints":this.updateSPoints(e.value.x,e.value.y);break;case"updateSEPoints":this.updateSEPoints(e.value.x,e.value.y);break;case"drawMaskCircle":this.drawMaskCircle(e.value.x,e.value.y);break;case"isValueUpdated":this.isValueUpdated();break;case"getDistance":this.getDistance(e.value.x,e.value.y);break;case"redact":this.currentDrawingShape=e.value.shape;break;case"updateTransColl":e.value.obj.coll=this.updateTransColl(e.value.object);break;case"getTransformedShape":e.value.obj.bool=this.isTransformedShape;break;case"setTransformedShape":this.isTransformedShape=e.value.bool;break;case"rgbToHex":this.rgbToHex(e.value.r,e.value.g,e.value.b,e.value.a);break;case"padLeft":this.padLeft(e.value.value,e.value.length,e.value.padChar);break;case"setTimer":this.setTimer(e.value.e);break;case"targetTouches":e.value.output=this.targetTouches(e.value.touches);break;case"calculateScale":e.value.output=this.calculateScale(e.value.startTouches,e.value.endTouches);break;case"beforeSaveEvent":this.beforeSaveEvent(e.value.args,e.value.e);break;case"isKeyBoardCrop":e.value.output=this.isKeyBoardCrop(e.value.e);break;case"focusRatioBtn":this.focusRatioBtn();break;case"performEnterAction":this.performEnterAction(e.value.e);break;case"getImagePoints":e.value.output=this.getImagePoints(e.value.x,e.value.y);break;case"revertPoints":this.revertPoints(e.value.actPoint,e.value.tempActiveObj);break;case"performNWResize":this.performNWResize(e.value.x,e.value.y,e.value.tempActiveObj,e.value.actPoint);break;case"performSEResize":this.performSEResize(e.value.x,e.value.y,e.value.tempActiveObj,e.value.actPoint);break;case"isMouseOutsideImg":e.value.output=this.isMouseOutsideImg(e.value.x,e.value.y)}},tUt.prototype.getModuleName=function(){return"selection"},tUt.prototype.updatePrivateVariables=function(){var e=this.parent;e.lowerCanvas&&(this.lowerContext=e.lowerCanvas.getContext("2d")),e.upperCanvas&&(this.upperContext=e.upperCanvas.getContext("2d"))},tUt.prototype.reset=function(){this.diffPoint={x:0,y:0},this.oldPoint={},this.isTouch=this.isObjSelected=this.isFhdPoint=this.isShapeInserted=!1,this.dragPoint={startX:0,startY:0,endX:0,endY:0},this.tempActiveObj={activePoint:{startX:0,startY:0,endX:0,endY:0,width:0,height:0},flipObjColl:[],triangle:[],triangleRatio:[],order:null},this.isFirstMove=!1,this.cursorTargetId=this.dragElement="",this.isTouchDblClick=!1,this.startTouches=[],this.tempTouches=[],this.currMousePoint={x:0,y:0},this.isPreventDragging=!1,this.timer=void 0,this.tempObjColl=void 0,this.mouseWheel=0,this.textRow=1,this.mouseDownPoint={x:0,y:0},this.previousPoint={x:0,y:0},this.zoomType="Toolbar",this.isInitialTextEdited=!1,this.dragCanvas=this.isPinching=!1,this.isFhdCustomized=!1,this.touchEndPoint={},this.panDown=null,this.isSliding=!1,this.isFhdEditing=!1,this.pathAdjustedIndex=null,this.touchTime=0,this.isImageClarity=!0,this.currentDrawingShape="",this.initialPrevObj={},this.resizedElement="",this.mouseDown="",this.isSliderActive=!1,this.arrowShape=[MUt.None,MUt.SolidArrow],this.isMouseDown=this.isMouseUp=this.isTransformedShape=!1},tUt.prototype.performTabAction=function(){var e,t=this.parent;"block"!==t.textArea.style.display&&"inline-block"!==t.textArea.style.display||(e=this.applyCurrShape(!1),t.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:null}}),e&&t.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}})),t.isKBDNavigation=!0},tUt.prototype.selMouseUpEvent=function(){this.oldPoint.x=void 0,this.oldPoint.y=void 0},tUt.prototype.getMouseCursor=function(e,t,i,n,o){var r=this.getTransRotationPoint(e),s=e.bottomCenterCircle.radius,a=o?0:2*e.topLeftCircle.radius;return t>=e.topLeftCircle.startX-a&&t<=e.topLeftCircle.startX+a&&i>=e.topLeftCircle.startY-a&&i<=e.topLeftCircle.startY+a?"nw-resize":t>=e.topLeftCircle.startX-a&&t<=e.topRightCircle.startX-a&&i>=e.topCenterCircle.startY-a&&i<=e.topCenterCircle.startY+a?"n-resize":t>=e.topRightCircle.startX-a&&t<=e.topRightCircle.startX+a&&i>=e.topRightCircle.startY-a&&i<=e.topRightCircle.startY+a?"ne-resize":t>=e.centerLeftCircle.startX-a&&t<=e.centerLeftCircle.startX+a&&i>=e.topLeftCircle.startY-a&&i<=e.bottomLeftCircle.startY-a?"w-resize":t>=e.centerRightCircle.startX-a&&t<=e.centerRightCircle.startX+a&&i>=e.topRightCircle.startY-a&&i<=e.bottomRightCircle.startY-a?"e-resize":t>=e.bottomLeftCircle.startX-a&&t<=e.bottomLeftCircle.startX+a&&i>=e.bottomLeftCircle.startY-a&&i<=e.bottomLeftCircle.startY+a?"sw-resize":t>=e.bottomLeftCircle.startX-a&&t<=e.bottomRightCircle.startX-a&&i>=e.bottomCenterCircle.startY-a&&i<=e.bottomCenterCircle.startY+a?"s-resize":t>=e.bottomRightCircle.startX-a&&t<=e.bottomRightCircle.startX+a&&i>=e.bottomRightCircle.startY-a&&i<=e.bottomRightCircle.startY+a?"se-resize":t>=e.activePoint.startX&&t<=e.activePoint.endX&&i>=e.activePoint.startY&&i<=e.activePoint.endY?n?"grab":"move":r&&!o&&t>=r.x-(s+2)&&t<=r.x+(s+2)&&i>=r.y-(s+2)&&i<=r.y+(s+2)?"grabbing":"default"},tUt.prototype.setCursor=function(e,t){var i=this.parent,n=(i.upperCanvas.style.cursor=i.cursor="default",{bool:null});if(i.notify("toolbar",{prop:"getFrameToolbar",onPropertyChange:!1,value:{obj:n}}),i.isResize||this.isSliding||n.bool)i.upperCanvas.style.cursor="default";else{var o,r=!1;if((!(o=i.activeObj.shape?i.activeObj.shape.split("-"):o)&&i.currObjType.isCustomCrop||o&&"crop"===o[0])&&(r=!0),i.currObjType.isDragging)""===this.dragElement?i.upperCanvas.style.cursor=i.cursor="move":i.upperCanvas.style.cursor=i.cursor=this.dragElement;else if(i.togglePen)i.upperCanvas.style.cursor=i.cursor="crosshair",i.isMaskImage&&(this.drawMaskCircle(e,t),i.upperCanvas.style.cursor="none");else{if(i.activeObj.shape&&this.setCursorForActObj(o,r,e,t),"default"===i.cursor||"grab"===i.cursor){for(var s=this.getHighestOrder(),a=Pe([],i.shapeColl,[],!0),n=Pe([],i.objColl,[],!0),l=!1;0<s;){l=!1;for(var h,d=a.length-1;0<=d;d--)a[d].order===s?(l=!0,a[d].id&&-1<a[d].id.indexOf("pen")?!i.pointColl[0]||"grab"===i.cursor&&r||i.currObjType.isDragging||i.currObjType.isResize||(h=Pe([],i.points,[],!0),r||this.setCursorForFreehandDrawing(e,t,i.upperCanvas,a[d].id),i.points=h):(i.objColl=[],i.objColl.push(Pe({},a[d],null,!0)),h=i.upperCanvas.style.cursor,0<i.objColl.length&&("grab"!==i.cursor||!r)&&this.setCursorFromObj(e,t,i.objColl,i.upperCanvas,r),"grab"===h&&"default"===i.cursor&&(i.upperCanvas.style.cursor=i.cursor="grab"))):je(a[d].order)&&(l=!0);if("default"!==i.cursor&&"grab"!==i.cursor)break;if(l)for(var p=!1;!p&&0<s;){for(var c=0;c<a.length;c++)if(a[c].order===s-1){p=!0;break}s--,p||s--}}i.objColl=n,"default"!==i.cursor&&"grab"!==i.cursor||i.togglePan&&(i.lowerCanvas.style.cursor=i.upperCanvas.style.cursor=i.cursor="grab")}""===this.currentDrawingShape||"default"!==i.cursor&&"grab"!==i.cursor||(i.upperCanvas.style.cursor=i.cursor="crosshair")}}},tUt.prototype.getHighestOrder=function(){for(var e=0,t=0;t<this.parent.shapeColl.length;t++)this.parent.shapeColl[t].order>e&&(e=this.parent.shapeColl[t].order);return e},tUt.prototype.drawMaskCircle=function(e,t){var i,n,o=this.parent;o.isMaskImage&&(i=2*o.activeObj.strokeSettings.strokeWidth,(n=o.maskCanvas.getContext("2d")).clearRect(0,0,o.maskCanvas.width,o.maskCanvas.height),n.fillStyle=o.activeObj.strokeSettings.strokeColor,n.strokeStyle="#fff",n.beginPath(),n.ellipse(e,t,i/2,i/2,0,0,2*Math.PI,!1),n.fill(),n.stroke(),n.closePath(),o.maskCanvas.style.cursor="none")},tUt.prototype.setCursorForActObj=function(e,t,i,n){var o,r=this.parent;void 0!==r.activeObj.horTopLine?(!(t=void 0===(e=void 0!==r.activeObj.shape?r.activeObj.shape.split("-"):e)&&r.currObjType.isCustomCrop||void 0!==e&&"crop"===e[0]?!0:t)&&r.togglePan&&(r.lowerCanvas.style.cursor=r.upperCanvas.style.cursor=r.cursor="grab"),e=r.upperCanvas.style.cursor,o=Pe({},r.activeObj,{},!0),this.cursorTargetId=o.currIndex,0===o.shapeDegree?r.transform.degree:(r.transform.degree,o.shapeDegree),"line"===o.shape||"arrow"===o.shape?this.setCursorForLineArrow(o,i,n,r.upperCanvas):"path"===o.shape?this.setCursorForPath(o,i,n,r.upperCanvas):je(o.rotatedAngle)||0===o.rotatedAngle?(r.upperCanvas.style.cursor=r.cursor=this.getMouseCursor(o,i,n,t,!1),"text"===o.shape&&-1<["n-resize","s-resize","e-resize","w-resize"].indexOf(r.cursor)&&(r.upperCanvas.style.cursor=r.cursor="move")):this.setCursorForRotatedObject(o,i,n,r.upperCanvas),"default"===e&&"default"===r.cursor&&t&&(r.upperCanvas.style.cursor=r.cursor="grab"),"grab"===e&&"default"===r.cursor&&(r.upperCanvas.style.cursor=r.cursor="grab")):r.togglePan&&!r.togglePen?r.lowerCanvas.style.cursor=r.upperCanvas.style.cursor=r.cursor="grab":r.currObjType.isCustomCrop||r.togglePen?r.upperCanvas.style.cursor=r.cursor="crosshair":r.upperCanvas.style.cursor=r.cursor="default"},tUt.prototype.setCursorForPath=function(e,t,i,n){this.setCursorForLineArrow(e,t,i,n);var o=this.parent;if("default"===o.cursor)for(var r=Pe({},e,null,!0),s=!1,a=1,l=e.pointColl.length;a<l&&!s;a++){r.activePoint.startX=e.pointColl[a-1].x,r.activePoint.startY=e.pointColl[a-1].y,r.activePoint.endX=e.pointColl[a].x,r.activePoint.endY=e.pointColl[a].y,o.notify("shape",{prop:"setPointCollForLineArrow",onPropertyChange:!1,value:{obj:r}});for(var h=e.topLeftCircle.radius,d=0,p=r.pointColl.length;d<p;d++){var c=r.pointColl[d];if(!je(c.x-2*h)&&!je(c.x+2*h)&&!je(c.y-2*h)&&!je(c.y+2*h)&&t>=c.x-2*h&&t<=c.x+2*h&&i>=c.y-2*h&&i<=c.y+2*h){n.style.cursor=o.cursor="move",s=!0;break}n.style.cursor=o.cursor="default"}}return o.cursor},tUt.prototype.setCursorForLineArrow=function(e,t,i,n){var o,r=e.topLeftCircle.radius;if(!je(e.pointColl))for(var s=0,a=e.pointColl.length;s<a;s++){var l=e.pointColl[s];if(t>=l.x-2*r&&t<=l.x+2*r&&i>=l.y-2*r&&i<=l.y+2*r){n.style.cursor=this.parent.cursor="move",o=s;break}n.style.cursor=this.parent.cursor="default"}return o},tUt.prototype.setCursorForRotatedObject=function(e,t,i,n){this.resizedElement="";var o=this.parent,r=e.bottomCenterCircle.radius,s=e.horTopLinePointColl[Math.round(e.horTopLinePointColl.length/2)],a=e.horTopLinePointColl[Math.round(e.horTopLinePointColl.length-1)],l=e.verLeftLinePointColl[Math.round(e.verLeftLinePointColl.length/2)],h=e.verRightLinePointColl[Math.round(e.verRightLinePointColl.length/2)],d=e.horBottomLinePointColl[Math.round(e.horBottomLinePointColl.length/2)],p=e.horBottomLinePointColl[Math.round(e.horBottomLinePointColl.length-1)],c=e.rotationCirclePointColl,u=e.horTopLinePointColl[0],g=e.horBottomLinePointColl[0];if(t>=u.x-(r+2)&&t<=u.x+(r+2)&&i>=u.y-(r+2)&&i<=u.y+(r+2)?n.style.cursor=o.cursor="nw-resize":t>=s.x-5&&t<=s.x+5&&i>=s.y-5&&i<=s.y+5?n.style.cursor=o.cursor=this.resizedElement="n-resize":t>=a.x-(r+2)&&t<=a.x+(r+2)&&i>=a.y-(r+2)&&i<=a.y+(r+2)?n.style.cursor=o.cursor="ne-resize":t>=l.x-5&&t<=l.x+5&&i>=l.y-5&&i<=l.y+5?n.style.cursor=o.cursor=this.resizedElement="w-resize":t>=h.x-5&&t<=h.x+5&&i>=h.y-5&&i<=h.y+5?n.style.cursor=o.cursor=this.resizedElement="e-resize":t>=g.x-(r+2)&&t<=g.x+(r+2)&&i>=g.y-(r+2)&&i<=g.y+(r+2)?n.style.cursor=o.cursor="sw-resize":t>=d.x-5&&t<=d.x+5&&i>=d.y-5&&i<=d.y+5?n.style.cursor=o.cursor=this.resizedElement="s-resize":t>=p.x-(r+2)&&t<=p.x+(r+2)&&i>=p.y-(r+2)&&i<=p.y+(r+2)?n.style.cursor=o.cursor="se-resize":c&&t>=c.x-(r+2)&&t<=c.x+(r+2)&&i>=c.y-(r+2)&&i<=c.y+(r+2)?n.style.cursor=o.cursor="grabbing":(n.style.cursor=o.cursor="default",this.getRectanglePoints(e.activePoint.startX,e.activePoint.startY,e.activePoint.width,e.activePoint.height,e.rotatedAngle*(180/Math.PI),t,i)&&(n.style.cursor=o.cursor="move")),"default"===o.cursor)for(var m=0,f=e.horTopLinePointColl.length;m<f;m++){var y=e.horTopLinePointColl[m];if(t>=y.x-5&&t<=y.x+5&&i>=y.y-5&&i<=y.y+5){n.style.cursor=o.cursor=this.resizedElement="n-resize";break}}if("default"===o.cursor)for(m=0,f=e.horBottomLinePointColl.length;m<f;m++){var v=e.horBottomLinePointColl[m];if(t>=v.x-5&&t<=v.x+5&&i>=v.y-5&&i<=v.y+5){n.style.cursor=o.cursor=this.resizedElement="s-resize";break}}if("default"===o.cursor)for(m=0,f=e.verLeftLinePointColl.length;m<f;m++){var b=e.verLeftLinePointColl[m];if(t>=b.x-5&&t<=b.x+5&&i>=b.y-5&&i<=b.y+5){n.style.cursor=o.cursor=this.resizedElement="w-resize";break}}if("default"===o.cursor)for(m=0,f=e.verRightLinePointColl.length;m<f;m++){var w=e.verRightLinePointColl[m];if(t>=w.x-5&&t<=w.x+5&&i>=w.y-5&&i<=w.y+5){n.style.cursor=o.cursor=this.resizedElement="e-resize";break}}return this.adjustCursorStylesForRotatedState(e),o.cursor},tUt.prototype.adjustCursorStylesForRotatedState=function(e){var t=this.parent,i=e.rotatedAngle*(180/Math.PI);return(92<=(i=0<i?Math.floor(i):Math.ceil(i))&&i<=182||-178<=i&&i<=-88)&&t.cursor in(i={"nw-resize":"ne-resize","n-resize":"s-resize","ne-resize":"nw-resize","w-resize":"e-resize","e-resize":"w-resize","sw-resize":"se-resize","s-resize":"n-resize","se-resize":"sw-resize"})&&(t.cursor=i[t.cursor]),t.upperCanvas.style.cursor=this.getResizeElement(e.rotatedAngle*(180/Math.PI),t.cursor),t.cursor},tUt.prototype.getResizeElement=function(e,t){var i=[];switch(t){case"nw-resize":i=[[337.5,22.5,"nw-resize"],[22.5,67.5,"n-resize"],[67.5,112.5,"ne-resize"],[112.5,157.5,"e-resize"],[157.5,202.5,"se-resize"],[202.5,247.5,"s-resize"],[247.5,292.5,"sw-resize"],[292.5,337.5,"w-resize"]];break;case"n-resize":i=[[337.5,22.5,"n-resize"],[22.5,67.5,"ne-resize"],[67.5,112.5,"e-resize"],[112.5,157.5,"se-resize"],[157.5,202.5,"s-resize"],[202.5,247.5,"sw-resize"],[247.5,292.5,"w-resize"],[292.5,337.5,"nw-resize"]];break;case"ne-resize":i=[[337.5,22.5,"ne-resize"],[22.5,67.5,"e-resize"],[67.5,112.5,"se-resize"],[112.5,157.5,"s-resize"],[157.5,202.5,"sw-resize"],[202.5,247.5,"w-resize"],[247.5,292.5,"nw-resize"],[292.5,337.5,"n-resize"]];break;case"e-resize":i=[[337.5,22.5,"e-resize"],[22.5,67.5,"se-resize"],[67.5,112.5,"s-resize"],[112.5,157.5,"sw-resize"],[157.5,202.5,"w-resize"],[202.5,247.5,"nw-resize"],[247.5,292.5,"n-resize"],[292.5,337.5,"ne-resize"]];break;case"se-resize":i=[[337.5,22.5,"se-resize"],[22.5,67.5,"s-resize"],[67.5,112.5,"sw-resize"],[112.5,157.5,"w-resize"],[157.5,202.5,"nw-resize"],[202.5,247.5,"n-resize"],[247.5,292.5,"ne-resize"],[292.5,337.5,"e-resize"]];break;case"s-resize":i=[[337.5,22.5,"s-resize"],[22.5,67.5,"sw-resize"],[67.5,112.5,"w-resize"],[112.5,157.5,"nw-resize"],[157.5,202.5,"n-resize"],[202.5,247.5,"ne-resize"],[247.5,292.5,"e-resize"],[292.5,337.5,"se-resize"]];break;case"sw-resize":i=[[337.5,22.5,"sw-resize"],[22.5,67.5,"w-resize"],[67.5,112.5,"nw-resize"],[112.5,157.5,"n-resize"],[157.5,202.5,"ne-resize"],[202.5,247.5,"e-resize"],[247.5,292.5,"se-resize"],[292.5,337.5,"s-resize"]];break;case"w-resize":i=[[337.5,22.5,"w-resize"],[22.5,67.5,"nw-resize"],[67.5,112.5,"n-resize"],[112.5,157.5,"ne-resize"],[157.5,202.5,"e-resize"],[202.5,247.5,"se-resize"],[247.5,292.5,"s-resize"],[292.5,337.5,"sw-resize"]]}for(var n=e<0?360-Math.abs(e):e,o=0,r=i;o<r.length;o++){var s=r[o],a=s[0],l=s[1],s=s[2];if(a<n&&n<=l||a<n+360&&n+360<=l)return s}return t},tUt.prototype.setCursorForFreehandDrawing=function(e,t,i,n){var o,r=i.getContext("2d"),s=this.parent,a=document.querySelector("#"+s.element.id+"_textArea"),l=!1;s.notify("freehand-draw",{prop:"setFreehandDrawHoveredIndex",onPropertyChange:!1,value:{index:-1}});for(var h=0;h<s.freehandCounter;h++)if(!n||n===s.pointColl[h].id){for(var d={selPointColl:{}},p=(s.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:d}}),o=Pe([],d.selPointColl[h].points,[]),s.points=Pe([],s.pointColl[h].points,[]),s.pointColl[h]),c=(s.notify("freehand-draw",{prop:"setPointCounter",onPropertyChange:!1,value:{value:0}}),o.length),u=0;u<c;u++)if(0!==u){var g=!1;if(g=o[u-1]&&o[u]?this.isInside(e,t,o[u-1].x,o[u-1].y,o[u].x,o[u].y):g){this.isFhdPoint=!0,s.notify("freehand-draw",{prop:"setFreehandDrawHoveredIndex",onPropertyChange:!1,value:{index:h}}),s.notify("freehand-draw",{prop:"hoverFhd",onPropertyChange:!1,value:{strokeColor:null,strokeWidth:null}}),i.style.cursor=s.cursor="pointer",l=!0;break}this.isFhdEditing&&!p.isSelected||((this.isFhdPoint||this.isFhdEditing)&&(r.clearRect(0,0,i.width,i.height),s.activeObj.shape)&&"none"===a.style.display&&s.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:s.activeObj}}),this.isFhdEditing?(s.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!(m={freehandSelectedIndex:-1}),value:{obj:m}}),f=s.pointColl[m.freehandSelectedIndex].strokeColor,y=s.pointColl[m.freehandSelectedIndex].strokeWidth,s.notify("freehand-draw",{prop:"hoverFhd",onPropertyChange:!1,value:{strokeColor:f,strokeWidth:y}})):s.notify("freehand-draw",{prop:"setFreehandDrawHoveredIndex",onPropertyChange:!1,value:{index:null}}),this.isFhdPoint=!1)}else{var m,f,y,g=s.points[u];if(e>g.x-p.strokeWidth&&e<g.x+p.strokeWidth&&t>g.y-p.strokeWidth&&t<g.y+p.strokeWidth){this.isFhdPoint=!0,s.notify("freehand-draw",{prop:"setFreehandDrawHoveredIndex",onPropertyChange:!1,value:{index:h}}),s.notify("freehand-draw",{prop:"hoverFhd",onPropertyChange:!1,value:{strokeColor:null,strokeWidth:null}}),i.style.cursor=s.cursor="pointer",l=!0;break}this.isFhdEditing&&!p.isSelected||((this.isFhdPoint||this.isFhdEditing)&&(r.clearRect(0,0,i.width,i.height),s.activeObj.shape)&&"none"===a.style.display&&s.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:s.activeObj}}),this.isFhdEditing&&(s.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!(m={freehandSelectedIndex:-1}),value:{obj:m}}),f=s.pointColl[m.freehandSelectedIndex].strokeColor,y=s.pointColl[m.freehandSelectedIndex].strokeWidth,s.notify("freehand-draw",{prop:"hoverFhd",onPropertyChange:!1,value:{strokeColor:f,strokeWidth:y}})),this.isFhdPoint=!1)}if(l)break}},tUt.prototype.setCursorFromObj=function(e,t,i,n,o){for(var r=this.parent,s=0,a=i.length;s<a;s++){if("move"===r.cursor)return;var l=Pe({},i[s],{},!0);if(0===l.activePoint.width&&0===l.activePoint.height)return void i.splice(s,1);this.cursorTargetId=l.currIndex,"line"===l.shape||"arrow"===l.shape?this.setCursorForLineArrow(l,e,t,n):"path"===l.shape?this.setCursorForPath(l,e,t,n):je(l.rotatedAngle)||0===l.rotatedAngle?n.style.cursor=r.cursor=this.getMouseCursor(l,e,t,o,!0):this.setCursorForRotatedObject(l,e,t,n)}},tUt.prototype.isInside=function(e,t,i,n,o,r){var s=Math.min(i,o),i=Math.max(i,o),o=Math.min(n,r),n=Math.max(n,r);return s<=e&&e<=i&&o<=t&&t<=n},tUt.prototype.preventResizing=function(e){var t,i=this.parent;i.activeObj.preventShapeDragOut&&this.isShapeDragOut()&&((t=i.activeObj.activePoint).startX=e.activePoint.startX,t.startY=e.activePoint.startY,t.endX=e.activePoint.endX,t.endY=e.activePoint.endY,t.width=e.activePoint.width,t.height=e.activePoint.height,i.activeObj.rotatedAngle=e.rotatedAngle,i.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:t,obj:i.activeObj,isMouseMove:null,x:null,y:null}}))},tUt.prototype.updateActivePoint=function(e,t,i){var n=this.parent,o=n.activeObj.activePoint,r=o.startX,s=o.startY,o=n.activeObj.activePoint,a=o.width,l=o.height,o=(n.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!1,value:{width:a,height:l,obj:{width:0,height:0},isImgShape:null}}),this.updatePrevShapeSettings()),h={cancel:!1,action:"resize",previousShapeSettings:o,allowShapeOverflow:this.allowOutofBound()},d={cancel:!1,action:"move",previousShapeSettings:o,allowShapeOverflow:this.allowOutofBound()},p=(this.shapeResizingArgs=h,this.shapeMovingArgs=d,"text"===n.activeObj.shape&&""!==this.dragElement&&n.notify("shape",{prop:"updateFontRatio",onPropertyChange:!1,value:{obj:n.activeObj,isTextArea:null}}),""===this.currentDrawingShape||""!==this.dragElement&&"move"!==this.dragElement||!n.isShapeDrawing||(-1<["line","arrow","path"].indexOf(n.activeObj.shape)?this.dragElement="e-resize":r<e&&s<t?this.dragElement="se-resize":e<r&&s<t?this.dragElement="sw-resize":r<e&&t<s?this.dragElement="ne-resize":e<r&&t<s&&(this.dragElement="nw-resize")),"arrow"===n.activeObj.shape&&(0<Math.atan2(e-n.lowerCanvas.width/2,t-n.lowerCanvas.height/2)?n.activeObj.rotatedAngle=-Math.atan2(e-n.lowerCanvas.width/2,t-n.lowerCanvas.height/2):n.activeObj.rotatedAngle=Math.abs(Math.atan2(e-n.lowerCanvas.width/2,t-n.lowerCanvas.height/2))),!1),c=!1;if(!i||0===n.transform.straighten||!this.isMouseOutsideImg(e,t)){var u,g,m=Pe({},n.activeObj,{},!0);switch(void 0!==(u=void 0!==n.activeObj.shape?n.activeObj.shape.split("-"):u)&&"crop"===u[0]&&(g=!0),this.dragElement.toLowerCase()){case"nw-resize":this.updateNWPoints(e,t),this.preventResizing(m),n.notify("shape",{prop:"updateArrowDirection",onPropertyChange:!1,value:{obj:n.activeObj,flip:null,rotatedDegree:null}}),this.triggerShapeChange(h,d,"resize");break;case"n-resize":this.updateNPoints(e,t),this.preventResizing(m),n.notify("shape",{prop:"updateArrowDirection",onPropertyChange:!1,value:{obj:n.activeObj,flip:null,rotatedDegree:null}}),this.triggerShapeChange(h,d,"resize");break;case"ne-resize":this.updateNEPoints(e,t),this.preventResizing(m),n.notify("shape",{prop:"updateArrowDirection",onPropertyChange:!1,value:{obj:n.activeObj,flip:null,rotatedDegree:null}}),this.triggerShapeChange(h,d,"resize");break;case"w-resize":this.updateWPoints(e,t),this.preventResizing(m),n.notify("shape",{prop:"updateArrowDirection",onPropertyChange:!1,value:{obj:n.activeObj,flip:null,rotatedDegree:null}}),this.triggerShapeChange(h,d,"resize");break;case"e-resize":this.updateEPoints(e,t),this.preventResizing(m),n.notify("shape",{prop:"updateArrowDirection",onPropertyChange:!1,value:{obj:n.activeObj,flip:null,rotatedDegree:null}}),this.triggerShapeChange(h,d,"resize");break;case"sw-resize":this.updateSWPoints(e,t),this.preventResizing(m),n.notify("shape",{prop:"updateArrowDirection",onPropertyChange:!1,value:{obj:n.activeObj,flip:null,rotatedDegree:null}}),this.triggerShapeChange(h,d,"resize");break;case"s-resize":this.updateSPoints(e,t),this.preventResizing(m),n.notify("shape",{prop:"updateArrowDirection",onPropertyChange:!1,value:{obj:n.activeObj,flip:null,rotatedDegree:null}}),this.triggerShapeChange(h,d,"resize");break;case"se-resize":this.updateSEPoints(e,t),this.preventResizing(m),n.notify("shape",{prop:"updateArrowDirection",onPropertyChange:!1,value:{obj:n.activeObj,flip:null,rotatedDegree:null}}),this.triggerShapeChange(h,d,"resize");break;case"grabbing":0<Math.atan2(e-(r+a/2),t-(s+l/2))?n.activeObj.rotatedAngle=-Math.atan2(e-(r+a/2),t-(s+l/2)):n.activeObj.rotatedAngle=Math.abs(Math.atan2(e-(r+a/2),t-(s+l/2))),(v=0===n.activeObj.shapeDegree?n.transform.degree:n.transform.degree-n.activeObj.shapeDegree)<0&&(v=360+v);for(var f=0,y=n.activeObj.flipObjColl.length;f<y;f++)"horizontal"===n.activeObj.flipObjColl[f].toLowerCase()?p=!0:"vertical"===n.activeObj.flipObjColl[f].toLowerCase()&&(c=!0);n.activeObj.rotatedAngle-=v*(Math.PI/180),0===v||360===v?c&&(n.activeObj.rotatedAngle-=Math.PI/180*180):90===v||-270===v?p&&(n.activeObj.rotatedAngle-=Math.PI/180*180):180===v||-180===v?c&&(n.activeObj.rotatedAngle-=Math.PI/180*180):270!==v&&-90!==v||p&&(n.activeObj.rotatedAngle-=Math.PI/180*180),this.preventResizing(m);break;case"pathdrag":je(this.pathAdjustedIndex)||(n.activeObj.pointColl[this.pathAdjustedIndex].x=e,n.activeObj.pointColl[this.pathAdjustedIndex].y=t);break;default:if(!i&&!n.currObjType.isCustomCrop){var v=n.activeObj.activePoint;if(this.dragPoint.startX){var b=this.dragPoint.endX-this.previousPoint.x,w=this.dragPoint.endY-this.previousPoint.y;if(v.startX+=b,v.endX+=b,v.startY+=w,v.endY+=w,v.startX,v.startY,"line"!==n.activeObj.shape&&"arrow"!==n.activeObj.shape&&n.activeObj.rotationCirclePointColl&&(n.activeObj.rotationCirclePointColl.x+=b,n.activeObj.rotationCirclePointColl.y+=w,n.activeObj.rotationCirclePoint.x+=b,n.activeObj.rotationCirclePoint.y+=w),"path"===n.activeObj.shape)for(f=0,y=n.activeObj.pointColl.length;f<y;f++)n.activeObj.pointColl[f].x+=b,n.activeObj.pointColl[f].y+=w;if(!this.isPreventDragging&&this.isShapeDragOut()&&(n.activeObj.preventShapeDragOut||"redact"===n.activeObj.shape||g)){if(v.startX-=b,v.endX-=b,v.startY-=w,v.endY-=w,"line"!==n.activeObj.shape&&"arrow"!==n.activeObj.shape&&n.activeObj.rotationCirclePointColl)n.activeObj.rotationCirclePointColl.x-=b,n.activeObj.rotationCirclePointColl.y-=w,n.activeObj.rotationCirclePoint.x-=b,n.activeObj.rotationCirclePoint.y-=w;else if("path"===n.activeObj.shape)for(var C=0,y=n.activeObj.pointColl.length;C<y;C++)n.activeObj.pointColl[C].x-=b,n.activeObj.pointColl[C].y-=w;if(0===n.activeObj.rotatedAngle){var S=n.activeObj.activePoint.endX,A=n.activeObj.activePoint.endY,x=("path"===n.activeObj.shape&&(n.activeObj.activePoint=n.getSquarePointForPath(n.activeObj)),this.setDragWidth(b),this.setDragHeight(w),n.activeObj),I=x.activePoint.endX-S,T=x.activePoint.endY-A;if("path"===x.shape)for(C=0,y=x.pointColl.length;C<y;C++)x.pointColl[C].x+=I,x.pointColl[C].y+=T}else n.notify("selection",{prop:"updPtCollForShpRot",onPropertyChange:!1,value:{obj:n.activeObj}})}}else v.startX=e<this.mouseDownPoint.x?e:this.mouseDownPoint.x,v.startY=t<this.mouseDownPoint.y?t:this.mouseDownPoint.y,e=e<this.mouseDownPoint.x?this.mouseDownPoint.x:e,t=t<this.mouseDownPoint.y?this.mouseDownPoint.y:t,v.endX=e,v.endY=t;this.triggerShapeChange(h,d,"move")}}}},tUt.prototype.isShapeDragOut=function(){var e,t,i,n,o=this.parent,r=!1,s=!1,a=o.activeObj.shape;return(s=o.activeObj.preventShapeDragOut||0===o.activeObj.rotatedAngle&&"line"!==a&&"arrow"!==a&&"path"!==a?!0:s)&&(e=(s=o.activeObj.activePoint).startX,t=s.startY,i=s.endX,s=s.endY,"path"===a&&(e=(n=o.getSquarePointForPath(o.activeObj)).startX,t=n.startY,i=n.endX,s=n.endY),r=0!==o.activeObj.rotatedAngle&&"arrow"!==a&&(o.notify("draw",{prop:"updateImgCanvasPoints",onPropertyChange:!(n={isIntersect:null,arr:null})}),o.notify("draw",{prop:"isLinesIntersect",onPropertyChange:!1,value:{obj:n}}),!!(n.arr[0]||n.arr[1]||n.arr[2]||n.arr[3]))||this.isObjOutsideImg(e,t,i,s,a)),r},tUt.prototype.isObjOutsideImg=function(e,t,i,n,o){var r=this.parent.img,s=r.destLeft,a=r.destTop,l=r.destWidth,r=r.destHeight;return e<s||t<a||s+l<i||a+r<n||("line"===o||"arrow"===o)&&(s+l<e||a+r<t||i<s||n<a)},tUt.prototype.triggerShapeChange=function(e,t,i){var n=this.parent,o=n.activeObj.activePoint,o=(o.width=o.endX-o.startX,o.height=o.endY-o.startY,this.updatePrevShapeSettings());je(this.shapeResizingArgs)||je(this.shapeMovingArgs)?(e.currentShapeSettings=o,t.currentShapeSettings=o):(e.currentShapeSettings=this.shapeResizingArgs.currentShapeSettings=o,t.currentShapeSettings=this.shapeMovingArgs.currentShapeSettings=o),"resize"===i?(this.isCropSelection=!1,(o=void 0)!==(o=void 0!==n.activeObj.shape?n.activeObj.shape.split("-"):o)&&"crop"===o[0]&&(this.isCropSelection=!0),this.isCropSelection?(this.isMouseDown?e.action="resize-start":this.isMouseUp&&(e.action="resize-end"),o={action:e.action,previousSelectionSettings:{type:n.getSelectionType(n.activeObj.shape),startX:e.previousShapeSettings.startX,startY:e.previousShapeSettings.startY,width:e.previousShapeSettings.width,height:e.previousShapeSettings.height},currentSelectionSettings:{type:n.getSelectionType(n.activeObj.shape),startX:e.currentShapeSettings.startX,startY:e.currentShapeSettings.startY,width:e.currentShapeSettings.width,height:e.currentShapeSettings.height}},this.selectionResizingArgs=o,n.trigger("selectionChanging",o),n.editCompleteArgs=o,n.notify("shape",{prop:"updSelChangeEventArgs",onPropertyChange:!1,value:{selectionSettings:o.currentSelectionSettings}})):(""!==this.currentDrawingShape&&"crosshair"===n.upperCanvas.style.cursor&&(e.action="drawing"),n.currObjType.isRedact&&"redact"===n.activeObj.shape||n.trigger("shapeChanging",e),n.editCompleteArgs=e,this.isPreventShaping=e.cancel,n.notify("shape",{prop:"updateShapeChangeEventArgs",onPropertyChange:!1,value:{shapeSettings:e.currentShapeSettings,allowShapeOverflow:e.allowShapeOverflow}}))):"mouse-down"===i||"mouse-up"===i?("redact"!==n.activeObj.shape&&n.trigger("shapeChanging",e),n.editCompleteArgs=e,this.isPreventShaping=e.cancel,n.notify("shape",{prop:"updateShapeChangeEventArgs",onPropertyChange:!1,value:{shapeSettings:e.currentShapeSettings,allowShapeOverflow:e.allowShapeOverflow}})):("redact"!==n.activeObj.shape&&n.trigger("shapeChanging",t),n.editCompleteArgs=t,this.isPreventShaping=t.cancel,n.notify("shape",{prop:"updateShapeChangeEventArgs",onPropertyChange:!1,value:{shapeSettings:t.currentShapeSettings,allowShapeOverflow:t.allowShapeOverflow}})),n.eventType=i},tUt.prototype.setDragWidth=function(e){var t=this.parent,i=t.activeObj.activePoint,n=t.img,o=n.destLeft,r=n.destWidth,s=e,n=t.activeObj.shape,a=!1;if(!t.activeObj.preventShapeDragOut||"line"!==n&&"arrow"!==n||(a=!0),0<=s)for(var l=0;l<s&&(i.startX+=e=s-l,i.endX+=e,!(i.startX>=o&&i.endX<=o+r&&!a||i.startX>=o&&i.endX<=o+r&&i.endX>=o&&i.startX<=o+r&&a));l++)i.startX-=e,i.endX-=e;else for(l=1;l<Math.abs(s)&&(i.startX+=e=s+l,i.endX+=e,!(i.startX>=o&&i.endX<=o+r&&!a||i.startX>=o&&i.endX<=o+r&&i.endX>=o&&i.startX<=o+r&&a));l++)i.startX-=e,i.endX-=e},tUt.prototype.setDragHeight=function(e){var t=this.parent,i=t.activeObj.activePoint,n=t.img,o=n.destTop,r=n.destHeight,s=e,n=t.activeObj.shape,a=!1;if(!t.activeObj.preventShapeDragOut||"line"!==n&&"arrow"!==n||(a=!0),0<=s)for(var l=1;l<s&&(i.startY+=e=s-l,i.endY+=e,!(i.startY>=o&&i.endY<=o+r&&!a||i.startY>=o&&i.endY<=o+r&&i.endY>=o&&i.startY<=o+r&&a));l++)i.startY-=e,i.endY-=e;else for(l=0;l<Math.abs(s)&&(i.startY+=e=s+l,i.endY+=e,!(i.startY>=o&&i.endY<=o+r&&!a||i.startY>=o&&i.endY<=o+r&&i.endY>=o&&i.startY<=o+r&&a));l++)i.startY-=e,i.endY-=e},tUt.prototype.limitDrag=function(e){var t=!1,i=this.parent,n=i.img,o=n.destLeft,r=n.destTop,s=n.destWidth,n=n.destHeight,a=i.activeObj.activePoint,l=e?a.startX:a.endX,h=e?a.startY:a.endY,d=e?a.endX:a.startX,p=e?a.endY:a.startY,c=i.upperCanvas.width,u=i.upperCanvas.height;return F.isDevice?(l<0&&o<0&&(l=0),h<0&&r<0&&(h=0),c<d&&c<o+s&&(d=c),u<p&&u<r+n&&(p=u)):(l<o&&(l=o),h<r&&(h=r),o+s<d&&(d=o+s),r+n<p&&(p=r+n)),0!==i.transform.straighten&&(i.notify("draw",{prop:"updateImgCanvasPoints",onPropertyChange:!(c={isIntersect:null,arr:null})}),i.notify("draw",{prop:"isLinesIntersect",onPropertyChange:!1,value:{obj:c}}),c.arr[0]||c.arr[1]||c.arr[2]||c.arr[3])&&(t=!0),e?(a.startX=l,a.startY=h,a.endX=d,a.endY=p):(a.startX=d,a.startY=p,a.endX=l,a.endY=h),t},tUt.prototype.isMouseOutsideImg=function(e,t){var i={bool:!1};return this.parent.notify("draw",{prop:"updateImgCanvasPoints",onPropertyChange:!1}),this.parent.notify("draw",{prop:"isPointsInsideImg",value:{obj:i,x:e,y:t}}),i.bool},tUt.prototype.preventDraggingInvertly=function(){var e,t,i=!1,n=this.parent;return"image"===n.activeObj.shape||(void 0!==(e=void 0!==n.activeObj.shape?n.activeObj.shape.split("-"):e)&&"crop"===e[0]&&(t=!0),this.isPreventDragging)||0!==n.activeObj.rotatedAngle||!n.activeObj.preventShapeDragOut&&"redact"!==n.activeObj.shape&&!t||(i=this.limitDrag(!0),-1<["line","arrow","path"].indexOf(n.activeObj.shape)&&(i=this.limitDrag(!1))),i},tUt.prototype.preventTextDraggingInvertly=function(){var e=this.parent,t=!1,i=e.activeObj.activePoint,e=e.img,n=e.destLeft,o=e.destTop,r=e.destWidth,e=e.destHeight;return this.isPreventDragging||(i.startX<n||i.startY<o||i.endX>n+r||i.endY>o+e)&&(t=!0),t},tUt.prototype.preventInverseResize=function(e){var t=this.parent.activeObj.activePoint;t.width<0&&(t.width=0,t.startX=e.activePoint.startX,t.endX=e.activePoint.endX),t.height<0&&(t.height=0,t.startY=e.activePoint.startY,t.endY=e.activePoint.endY)},tUt.prototype.getScaleRatio=function(e){var t,i=this.parent,n={x:e,y:e};return i.activeObj.shape&&"crop-custom"!==i.activeObj.shape&&"crop-circle"!==i.activeObj.shape&&"crop-square"!==i.activeObj.shape&&(1<(t=("image"===i.activeObj.shape||"text"===i.activeObj.shape?this.findImageRatio(i.activeObj.activePoint.width,i.activeObj.activePoint.height):i.activeObj.shape).split("-")).length||"image"===i.activeObj.shape||"text"===i.activeObj.shape)&&(t=("image"===i.activeObj.shape||"text"===i.activeObj.shape?t[0]:t[1]).split(":"),i=e/parseInt(t[1],10),n.x=i*parseInt(t[0],10),n.y=i*parseInt(t[1],10)),n},tUt.prototype.findImageRatio=function(e,t,i){function n(e,t){return 0===t?e:n(t,e%t)}var o=n(e,t),e=e/o+":"+t/o;return i&&(i.ratio=e),e},tUt.prototype.revertResizing=function(e){var t=this.parent.activeObj.activePoint;this.preventDraggingInvertly()&&(t.startX=e.activePoint.startX,t.startY=e.activePoint.startY,t.endX=e.activePoint.endX,t.endY=e.activePoint.endY)},tUt.prototype.performSEResize=function(e,t,i,n){var o,r=this.parent;this.resizeImg(e,t,"se-resize",i),n.endX<n.startX&&(o=n.endX,n.endX=n.startX,n.startX=o,this.dragElement=r.upperCanvas.style.cursor=r.cursor="sw-resize"),n.endY<n.startY&&(o=n.endY,n.endY=n.startY,n.startY=o,this.dragElement=r.upperCanvas.style.cursor=r.cursor="ne-resize"),this.revertCustomSelection(n,i,"se-resize"),this.revertResizing(i)},tUt.prototype.performNWResize=function(e,t,i,n){var o,r=this.parent;this.resizeImg(e,t,"nw-resize",i),n.startX>n.endX&&(o=n.startX,n.startX=n.endX,n.endX=o,this.dragElement=r.upperCanvas.style.cursor=r.cursor="ne-resize"),n.startY>n.endY&&(o=n.startY,n.startY=n.endY,n.endY=o,this.dragElement=r.upperCanvas.style.cursor=r.cursor="sw-resize"),this.revertCustomSelection(n,i,"nw-resize"),this.revertResizing(i)},tUt.prototype.isCustomSelection=function(){return!!this.parent.activeObj.shape&&-1<this.parent.activeObj.shape.indexOf("crop-")&&-1===["custom","circle","square","2:3","3:2","3:4","4:3","4:5","5:4","5:7","7:5","9:16","16:9"].indexOf(this.parent.activeObj.shape.split("-")[1])},tUt.prototype.revertCustomSelection=function(e,t,i){var n,o,r,s,a=this.parent;this.isCustomSelection()&&(n=(s=a.img).destLeft,o=s.destTop,r=s.destWidth,s=s.destHeight,r=n+r<a.lowerCanvas.width?n+r:a.lowerCanvas.width,s=o+s<a.lowerCanvas.height?o+s:a.lowerCanvas.height,"se-resize"===i&&(e.endX>r||e.endY>s)||"nw-resize"===i&&(e.startX<(0<n?n:0)||e.startY<(0<o?o:0))||"ne-resize"===i&&(e.endX>r||e.startY<(0<o?o:0))||"sw-resize"===i&&(e.startX<(0<n?n:0)||e.endY>s))&&this.revertPoints(e,t)},tUt.prototype.revertPoints=function(e,t){e.startX=t.activePoint.startX,e.startY=t.activePoint.startY,e.endX=t.activePoint.endX,e.endY=t.activePoint.endY,e.width=t.activePoint.width,e.height=t.activePoint.height},tUt.prototype.updateNWPoints=function(e,t){var i,n,o,r,s,a,l=this.parent,h=l.activeObj.activePoint,d=Pe({},l.activeObj,null,!0);"text"===l.activeObj.shape?(this.resizeImg(e,t,"nw-resize",d),l.notify("shape",{prop:"updateFontSize",onPropertyChange:!1,value:{obj:l.activeObj}})):((i=void 0)!==l.activeObj.shape&&(i=l.activeObj.shape.split("-")),"crop-custom"===l.activeObj.shape||void 0!==l.activeObj.shape&&"crop"!==i[0]||this.isCustomSelection()?("image"===l.activeObj.shape||this.isCustomSelection()?this.resizeImg(e,t,"nw-resize",d):this.adjustNWPoints(h,e,t,l.activeObj.rotatedAngle),h.startX>h.endX&&(n=h.startX,h.startX=h.endX,h.endX=n,this.dragElement=l.upperCanvas.style.cursor=l.cursor="ne-resize"),h.startY>h.endY&&(n=h.startY,h.startY=h.endY,h.endY=n,this.dragElement=l.upperCanvas.style.cursor=l.cursor="sw-resize"),this.revertCustomSelection(h,d,"nw-resize")):(n=(i=l.img).destLeft,l=i.destTop,h.startX<e&&h.startY<t?(o=e-h.startX,r=t-h.startY,s=Math.min(o,r),a=this.getScaleRatio(s),h.startX+=a.x,h.startY+=a.y,(h.startX<(0<n?n:0)||h.startY<(0<l?l:0))&&(h.startX-=a.x,h.startY-=a.y)):(o=h.startX-e,r=t-h.endY,s=Math.max(o,r),a=this.getScaleRatio(s),h.startX-=a.x,h.startY-=a.y,(h.startX<(0<n?n:0)||h.startY<(0<l?l:0))&&(h.startX+=a.x,h.startY+=a.y)),h.width=h.endX-h.startX,h.height=h.endY-h.startY),this.revertResizing(d),h.width=h.endX-h.startX,h.height=h.endY-h.startY,this.preventInverseResize(d))},tUt.prototype.updateNPoints=function(e,t){var i,n,o,r,s,a,l=this.parent,h=l.activeObj.activePoint,d=Pe({},l.activeObj,null,!0);"text"!==l.activeObj.shape&&(n=void 0,l.activeObj.shape&&(n=l.activeObj.shape.split("-")),"crop-custom"===l.activeObj.shape||l.activeObj.shape&&"crop"!==n[0]?("line"!==l.activeObj.shape&&"arrow"!==l.activeObj.shape&&"path"!==l.activeObj.shape&&0!==l.activeObj.rotatedAngle&&this.dragPoint.startX?(this.dragPoint.startX&&this.dragPoint.startY&&(this.previousPoint.x=this.dragPoint.endX,this.previousPoint.y=this.dragPoint.endY,this.dragPoint.endX=e,this.dragPoint.endY=t),o=this.dragPoint.endX-this.previousPoint.x,r=this.dragPoint.endY-this.previousPoint.y,this.adjustRotationPoints(h,o,r,l.activeObj.rotatedAngle)):(h.startY=t,h.height=h.endY-h.startY),h.startY>h.endY&&(n=h.startY,h.startY=h.endY,h.endY=n,this.dragElement=this.resizedElement="s-resize")):(l=(n=l.img).destLeft,i=n.destTop,n=n.destWidth,this.isCustomSelection()?this.performNWResize(e,t,d,h):h.endX>e&&h.startY<t?(o=h.endX-e,r=t-h.startY,s=Math.min(o,r),a=this.getScaleRatio(s),h.endX-=a.x,h.startY+=a.y,(h.endX>l+n||h.startY<i)&&(h.endX+=a.x,h.startY-=a.y)):(o=e-h.endX,r=h.startY-t,s=Math.max(o,r),a=this.getScaleRatio(s),h.endX+=a.x,h.startY-=a.y,(h.endX>l+n||h.startY<i)&&(h.endX-=a.x,h.startY+=a.y)),h.width=h.endX-h.startX,h.height=h.endY-h.startY),this.revertResizing(d))},tUt.prototype.updateNEPoints=function(e,t){var i,n,o,r,s,a,l,h,d,p=this.parent,c=p.activeObj.activePoint,u=Pe({},p.activeObj,null,!0);"text"===p.activeObj.shape?(this.resizeImg(e,t,"ne-resize",u),p.notify("shape",{prop:"updateFontSize",onPropertyChange:!1,value:{obj:p.activeObj}})):(o=void 0,p.activeObj.shape&&(o=p.activeObj.shape.split("-")),"crop-custom"===p.activeObj.shape||void 0!==p.activeObj.shape&&"crop"!==o[0]||this.isCustomSelection()?("image"===p.activeObj.shape||this.isCustomSelection()?this.resizeImg(e,t,"ne-resize",u):this.adjustNEPoints(c,e,t,p.activeObj.rotatedAngle),c.endX<c.startX&&(i=c.endX,c.endX=c.startX,c.startX=i,this.dragElement=p.upperCanvas.style.cursor=p.cursor="nw-resize"),c.startY>c.endY&&(i=c.startY,c.startY=c.endY,c.endY=i,this.dragElement=p.upperCanvas.style.cursor=p.cursor="se-resize"),this.revertCustomSelection(c,u,"ne-resize")):(i=(o=p.img).destLeft,n=o.destTop,o=o.destWidth,c.endX>e&&c.startY<t?(r=c.endX-e,s=t-c.startY,a=Math.min(r,s),l=this.getScaleRatio(a),c.endX-=l.x,c.startY+=l.y,h=i+o<p.lowerCanvas.width?i+o:p.lowerCanvas.width,d=0<n?n:0,(c.endX>h||c.startY<d)&&(c.endX+=l.x,c.startY-=l.y)):(r=e-c.endX,s=c.startY-t,a=Math.max(r,s),l=this.getScaleRatio(a),c.endX+=l.x,c.startY-=l.y,h=i+o<p.lowerCanvas.width?i+o:p.lowerCanvas.width,d=0<n?n:0,(c.endX>h||c.startY<d)&&(c.endX-=l.x,c.startY+=l.y)),c.width=c.endX-c.startX,c.height=c.endY-c.startY),this.revertResizing(u),c.width=c.endX-c.startX,c.height=c.endY-c.startY,this.preventInverseResize(u))},tUt.prototype.updateWPoints=function(e,t){var i,n,o,r,s,a,l=this.parent,h=l.activeObj.activePoint,d=Pe({},l.activeObj,null,!0);"text"!==l.activeObj.shape&&(n=void 0,l.activeObj.shape&&(n=l.activeObj.shape.split("-")),"crop-custom"===l.activeObj.shape||l.activeObj.shape&&"crop"!==n[0]?("line"!==l.activeObj.shape&&"arrow"!==l.activeObj.shape&&"path"!==l.activeObj.shape&&0!==l.activeObj.rotatedAngle&&this.dragPoint.startX?(this.dragPoint.startX&&this.dragPoint.startY&&(this.previousPoint.x=this.dragPoint.endX,this.previousPoint.y=this.dragPoint.endY,this.dragPoint.endX=e,this.dragPoint.endY=t),o=this.dragPoint.endX-this.previousPoint.x,r=this.dragPoint.endY-this.previousPoint.y,this.adjustRotationPoints(h,o,r,l.activeObj.rotatedAngle)):(h.startX=e,h.width=h.endX-h.startX),"line"===l.activeObj.shape||"arrow"===l.activeObj.shape||"path"===l.activeObj.shape?(h.startY=t,h.height=h.endY-h.startY,this.adjustActObjForLineArrow()&&(this.dragElement="e-resize","right"===l.activeObj.triangleDirection?l.activeObj.triangleDirection="left":"left"===l.activeObj.triangleDirection&&(l.activeObj.triangleDirection="right"))):h.startX>h.endX&&(n=h.startX,h.startX=h.endX,h.endX=n,this.dragElement=this.resizedElement="e-resize")):(l=(n=l.img).destLeft,i=n.destTop,n=n.destHeight,this.isCustomSelection()?this.performNWResize(e,t,d,h):h.startX<e&&h.endY>t?(o=e-h.startX,r=h.endY-t,s=Math.min(o,r),a=this.getScaleRatio(s),h.startX+=a.x,h.endY-=a.y,(h.startX<l||h.endY>i+n)&&(h.startX-=a.x,h.endY+=a.y)):(o=h.startX-e,r=t-h.endY,s=Math.max(o,r),a=this.getScaleRatio(s),h.startX-=a.x,h.endY+=a.y,(h.startX<l||h.endY>i+n)&&(h.startX+=a.x,h.endY-=a.y)),h.width=h.endX-h.startX,h.height=h.endY-h.startY),this.revertResizing(d))},tUt.prototype.updateEPoints=function(e,t){var i,n,o,r,s,a,l,h=this.parent,d=h.activeObj.activePoint,p=Pe({},h.activeObj,null,!0);"text"!==h.activeObj.shape&&(o=void 0,h.activeObj.shape&&(o=h.activeObj.shape.split("-")),"crop-custom"===h.activeObj.shape||h.activeObj.shape&&"crop"!==o[0]?("line"!==h.activeObj.shape&&"arrow"!==h.activeObj.shape&&"path"!==h.activeObj.shape&&0!==h.activeObj.rotatedAngle&&this.dragPoint.startX?(this.dragPoint.startX&&this.dragPoint.startY&&(this.previousPoint.x=this.dragPoint.endX,this.previousPoint.y=this.dragPoint.endY,this.dragPoint.endX=e,this.dragPoint.endY=t),r=this.dragPoint.endX-this.previousPoint.x,s=this.dragPoint.endY-this.previousPoint.y,this.adjustRotationPoints(d,r,s,h.activeObj.rotatedAngle)):(d.endX=e,d.width=d.endX-d.startX),"line"===h.activeObj.shape||"arrow"===h.activeObj.shape||"path"===h.activeObj.shape?(d.endY=t,d.height=d.endY-d.startY,this.adjustActObjForLineArrow()&&(this.dragElement="w-resize","right"===h.activeObj.triangleDirection?h.activeObj.triangleDirection="left":"left"===h.activeObj.triangleDirection&&(h.activeObj.triangleDirection="right"))):d.endX<d.startX&&(o=d.endX,d.endX=d.startX,d.startX=o,this.dragElement=this.resizedElement="w-resize")):(h=(o=h.img).destLeft,i=o.destTop,n=o.destWidth,o=o.destHeight,this.isCustomSelection()?this.performSEResize(e,t,p,d):d.endX>e&&d.endY>t?(r=d.endX-e,s=d.endY-t,a=Math.min(r,s),l=this.getScaleRatio(a),d.endX-=l.x,d.endY-=l.y,(d.endX>h+n||d.endY>i+o)&&(d.endX+=l.x,d.endY+=l.y)):(r=e-d.endX,s=t-d.endY,a=Math.max(r,s),l=this.getScaleRatio(a),d.endX+=l.x,d.endY+=l.y,(d.endX>h+n||d.endY>i+o)&&(d.endX-=l.x,d.endY-=l.y)),d.width=d.endX-d.startX,d.height=d.endY-d.startY),this.revertResizing(p))},tUt.prototype.updateSWPoints=function(e,t){var i,n,o,r,s,a,l,h,d=this.parent,p=d.activeObj.activePoint,c=Pe({},d.activeObj,null,!0);"text"===d.activeObj.shape?(this.resizeImg(e,t,"sw-resize",c),d.notify("shape",{prop:"updateFontSize",onPropertyChange:!1,value:{obj:d.activeObj}})):((o=void 0)!==d.activeObj.shape&&(o=d.activeObj.shape.split("-")),"crop-custom"===d.activeObj.shape||void 0!==d.activeObj.shape&&"crop"!==o[0]||this.isCustomSelection()?("image"===d.activeObj.shape||this.isCustomSelection()?this.resizeImg(e,t,"sw-resize",c):this.adjustSWPoints(p,e,t,d.activeObj.rotatedAngle),p.startX>p.endX&&(i=p.startX,p.startX=p.endX,p.endX=i,this.dragElement=d.upperCanvas.style.cursor=d.cursor="se-resize"),p.endY<p.startY&&(i=p.endY,p.endY=p.startY,p.startY=i,this.dragElement=d.upperCanvas.style.cursor=d.cursor="nw-resize"),this.revertCustomSelection(p,c,"sw-resize")):(i=(o=d.img).destLeft,n=o.destTop,o=o.destHeight,p.startX<e&&p.endY>t?(r=e-p.startX,s=p.endY-t,a=Math.min(r,s),l=this.getScaleRatio(a),p.startX+=l.x,p.endY-=l.y,h=n+o<d.lowerCanvas.height?n+o:d.lowerCanvas.height,(p.startX<(0<i?i:0)||p.endY>h)&&(p.startX-=l.x,p.endY+=l.y)):(r=p.startX-e,s=t-p.endY,a=Math.max(r,s),l=this.getScaleRatio(a),p.startX-=l.x,p.endY+=l.y,h=n+o<d.lowerCanvas.height?n+o:d.lowerCanvas.height,(p.startX<(0<i?i:0)||p.endY>h)&&(p.startX+=l.x,p.endY-=l.y)),p.width=p.endX-p.startX,p.height=p.endY-p.startY),this.revertResizing(c),p.width=p.endX-p.startX,p.height=p.endY-p.startY,this.preventInverseResize(c))},tUt.prototype.updateSPoints=function(e,t){var i,n,o,r,s,a,l,h=this.parent,d=h.activeObj.activePoint,p=Pe({},h.activeObj,null,!0);"text"!==h.activeObj.shape&&(o=void 0,h.activeObj.shape&&(o=h.activeObj.shape.split("-")),"crop-custom"===h.activeObj.shape||h.activeObj.shape&&"crop"!==o[0]?("line"!==h.activeObj.shape&&"arrow"!==h.activeObj.shape&&"path"!==h.activeObj.shape&&0!==h.activeObj.rotatedAngle&&this.dragPoint.startX?(this.dragPoint.startX&&this.dragPoint.startY&&(this.previousPoint.x=this.dragPoint.endX,this.previousPoint.y=this.dragPoint.endY,this.dragPoint.endX=e,this.dragPoint.endY=t),r=this.dragPoint.endX-this.previousPoint.x,s=this.dragPoint.endY-this.previousPoint.y,this.adjustRotationPoints(d,r,s,h.activeObj.rotatedAngle)):(d.endY=t,d.height=d.endY-d.startY),d.endY<d.startY&&(o=d.endY,d.endY=d.startY,d.startY=o,this.dragElement=this.resizedElement="n-resize")):(h=(o=h.img).destLeft,i=o.destTop,n=o.destWidth,o=o.destHeight,this.isCustomSelection()?this.performSEResize(e,t,p,d):d.endX>e&&d.endY>t?(r=d.endX-e,s=d.endY-t,a=Math.min(r,s),l=this.getScaleRatio(a),d.endX-=l.x,d.endY-=l.y,(d.endX>h+n||d.endY>i+o)&&(d.endX+=l.x,d.endY+=l.y)):(r=e-d.endX,s=t-d.endY,a=Math.max(r,s),l=this.getScaleRatio(a),d.endX+=l.x,d.endY+=l.x,(d.endX>h+n||d.endY>i+o)&&(d.endX-=l.x,d.endY-=l.y)),d.width=d.endX-d.startX,d.height=d.endY-d.startY),this.revertResizing(p))},tUt.prototype.updateSEPoints=function(e,t){var i,n,o,r,s,a,l,h,d,p,c=this.parent,u=c.activeObj.activePoint,g=Pe({},c.activeObj,null,!0);"text"===c.activeObj.shape?(this.resizeImg(e,t,"se-resize",g),c.notify("shape",{prop:"updateFontSize",onPropertyChange:!1,value:{obj:c.activeObj}})):((r=h=void 0)!==c.activeObj.shape&&(h=c.activeObj.shape.split("-")),"crop-custom"===c.activeObj.shape||void 0!==c.activeObj.shape&&"crop"!==h[0]||this.isCustomSelection()?("image"===c.activeObj.shape||this.isCustomSelection()?this.resizeImg(e,t,"se-resize",g):this.adjustSEPoints(u,e,t,c.activeObj.rotatedAngle),u.endX<u.startX&&(s=u.endX,u.endX=u.startX,u.startX=s,this.dragElement=c.upperCanvas.style.cursor=c.cursor="sw-resize"),u.endY<u.startY&&(s=u.endY,u.endY=u.startY,u.startY=s,this.dragElement=c.upperCanvas.style.cursor=c.cursor="ne-resize"),this.revertCustomSelection(u,g,"se-resize")):(s=(h=c.img).destLeft,a=h.destTop,l=h.destWidth,h=h.destHeight,u.endX>e&&u.endY>t?(i=u.endX-e,n=u.endY-t,o=Math.min(i,n),r=this.getScaleRatio(o),u.endX-=r.x,u.endY-=r.y,d=s+l<c.lowerCanvas.width?s+l:c.lowerCanvas.width,p=a+h<c.lowerCanvas.height?a+h:c.lowerCanvas.height,(u.endX>d||u.endY>p)&&(u.endX+=r.x,u.endY+=r.y)):(i=e-u.endX,n=t-u.endY,o=Math.max(i,n),r=this.getScaleRatio(o),u.endX+=r.x,u.endY+=r.y,d=s+l<c.lowerCanvas.width?s+l:c.lowerCanvas.width,p=a+h<c.lowerCanvas.height?a+h:c.lowerCanvas.height,(u.endX>d||u.endY>p)&&(u.endX-=r.x,u.endY-=r.y)),u.width=u.endX-u.startX,u.height=u.endY-u.startY),this.revertResizing(g),this.preventInverseResize(g))},tUt.prototype.resizeImg=function(e,t,i,n){var o,r,s,a,l=this.parent,h=l.activeObj.activePoint;if(0!==this.previousPoint.x&&0!==this.previousPoint.y){switch("text"===this.currentDrawingShape&&(this.setCursor(e,t),0===l.activeObj.textSettings.fontSize)&&(l.activeObj.textSettings.fontSize=11,l.notify("shape",{prop:"updateFontRatio",onPropertyChange:!1,value:{obj:l.activeObj,isTextArea:null}}),l.activeObj.textSettings.text=l.activeObj.keyHistory="Enter Text",l.notify("shape",{prop:"updateFontStyles",onPropertyChange:!1,value:{isTextBox:null}}),a=this.upperContext.measureText(l.activeObj.textSettings.text).width+.5*l.activeObj.textSettings.fontSize,h.endX=h.startX+a,h.endY=h.startY+l.activeObj.textSettings.fontSize,h.width=h.endX-h.startX,h.height=h.endY-h.startY,n=Pe({},l.activeObj,null,!0),l.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:l.activeObj.activePoint,obj:l.activeObj,isMouseMove:null,x:null,y:null}})),l.upperCanvas.style.cursor){case"se-resize":case"s-resize":this.previousPoint.x>e||this.previousPoint.y>t?(o=this.previousPoint.x-e,r=this.previousPoint.y-t,s=this.getScaleRatio((o+r)/2),this.adjustRotationPoints(h,-Math.abs(s.x),-Math.abs(s.y),l.activeObj.rotatedAngle,"img-resize",i)):0!==this.previousPoint.x&&0!==this.previousPoint.y&&(o=e-this.previousPoint.x,r=t-this.previousPoint.y,s=this.getScaleRatio((o+r)/2),this.adjustRotationPoints(h,Math.abs(s.x),Math.abs(s.y),l.activeObj.rotatedAngle,"img-resize",i));break;case"sw-resize":this.previousPoint.x<e||this.previousPoint.y>t?(o=e-this.previousPoint.x,r=this.previousPoint.y-t,s=this.getScaleRatio((o+r)/2),this.adjustRotationPoints(h,-Math.abs(s.x),-Math.abs(s.y),l.activeObj.rotatedAngle,"img-resize",i)):0!==this.previousPoint.x&&0!==this.previousPoint.y&&(o=this.previousPoint.x-e,r=t-this.previousPoint.y,s=this.getScaleRatio((o+r)/2),this.adjustRotationPoints(h,Math.abs(s.x),Math.abs(s.y),l.activeObj.rotatedAngle,"img-resize",i));break;case"w-resize":case"nw-resize":this.previousPoint.x<e||this.previousPoint.y<t?(o=e-this.previousPoint.x,r=t-this.previousPoint.y,s=this.getScaleRatio((o+r)/2),this.adjustRotationPoints(h,-Math.abs(s.x),-Math.abs(s.y),l.activeObj.rotatedAngle,"img-resize",i)):0!==this.previousPoint.x&&0!==this.previousPoint.y&&(o=this.previousPoint.x-e,r=this.previousPoint.y-t,s=this.getScaleRatio((o+r)/2),this.adjustRotationPoints(h,Math.abs(s.x),Math.abs(s.y),l.activeObj.rotatedAngle,"img-resize",i));break;case"n-resize":case"ne-resize":this.previousPoint.x>e||this.previousPoint.y<t?(o=this.previousPoint.x-e,r=t-this.previousPoint.y,s=this.getScaleRatio((o+r)/2),this.adjustRotationPoints(h,-Math.abs(s.x),-Math.abs(s.y),l.activeObj.rotatedAngle,"img-resize",i)):0!==this.previousPoint.x&&0!==this.previousPoint.y&&(o=e-this.previousPoint.x,r=this.previousPoint.y-t,s=this.getScaleRatio((o+r)/2),this.adjustRotationPoints(h,Math.abs(s.x),Math.abs(s.y),l.activeObj.rotatedAngle,"img-resize",i));break;case"e-resize":this.previousPoint.x>e||this.previousPoint.y>t?(o=this.previousPoint.x-e,r=this.previousPoint.y-t,s=this.getScaleRatio((o+r)/2),this.adjustRotationPoints(h,-Math.abs(s.x),-Math.abs(s.y),l.activeObj.rotatedAngle,"img-resize",i)):0!==this.previousPoint.x&&0!==this.previousPoint.y&&(o=e-this.previousPoint.x,r=t-this.previousPoint.y,s=this.getScaleRatio((o+r)/2),this.adjustRotationPoints(h,Math.abs(s.x),Math.abs(s.y),l.activeObj.rotatedAngle,"img-resize",i))}h.width=h.endX-h.startX,h.height=h.endY-h.startY,(h.width<10||h.height<10||"text"===l.activeObj.shape&&0===l.activeObj.rotatedAngle&&this.preventTextDraggingInvertly())&&(l.activeObj=Pe({},n,null,!0))}this.previousPoint={x:e,y:t}},tUt.prototype.adjustNWPoints=function(e,t,i,n){var o=e.startX+e.width/2,r=e.startY+e.height/2,o=this.rotatePoints(e.endX,e.endY,o,r,n),r=[(o[0]+t)/2,(o[1]+i)/2],o=this.rotatePoints(o[0],o[1],r[0],r[1],-n),t=this.rotatePoints(t,i,r[0],r[1],-n);return e.endX=o[0],e.endY=o[1],e.startY=t[1],e.startX=t[0],e.width=e.endX-e.startX,e.height=e.endY-e.startY,e},tUt.prototype.adjustNEPoints=function(e,t,i,n){var o=e.startX+e.width/2,r=e.startY+e.height/2,o=this.rotatePoints(e.startX,e.endY,o,r,n),r=[(o[0]+t)/2,(o[1]+i)/2],o=this.rotatePoints(o[0],o[1],r[0],r[1],-n),t=this.rotatePoints(t,i,r[0],r[1],-n);return e.startX=o[0],e.endY=o[1],e.width=t[0]-o[0],e.height=o[1]-t[1],e.endX=e.startX+e.width,e.startY=e.endY-e.height,e},tUt.prototype.adjustSWPoints=function(e,t,i,n){var o=e.startX+e.width/2,r=e.startY+e.height/2,o=this.rotatePoints(e.endX,e.startY,o,r,n),r=[(o[0]+t)/2,(o[1]+i)/2],o=this.rotatePoints(o[0],o[1],r[0],r[1],-n),t=this.rotatePoints(t,i,r[0],r[1],-n);return e.endX=o[0],e.startY=o[1],e.startX=t[0],e.endY=t[1],e.width=e.endX-e.startX,e.height=e.endY-e.startY,e},tUt.prototype.adjustSEPoints=function(e,t,i,n){var o=e.startX+e.width/2,r=e.startY+e.height/2,o=this.rotatePoints(e.startX,e.startY,o,r,n),r=[(o[0]+t)/2,(o[1]+i)/2],o=this.rotatePoints(o[0],o[1],r[0],r[1],-n),t=this.rotatePoints(t,i,r[0],r[1],-n);return e.startX=o[0],e.startY=o[1],e.width=t[0]-o[0],e.height=t[1]-o[1],e.endX=e.startX+e.width,e.endY=e.startY+e.height,e},tUt.prototype.adjustRotationPoints=function(e,t,i,n,o,r){var s=e.startX+e.width/2,a=e.startY+e.height/2,t=(this.getResizeDirection(e,t,i,n,o,r),this.rotatePoints(e.startX,e.startY,s,a,n)),i=this.rotatePoints(e.endX,e.startY,s,a,n),o=this.rotatePoints(e.endX,e.endY,s,a,n),r=this.rotatePoints(e.startX,e.endY,s,a,n),s=[(t[0]+o[0])/2,(t[1]+o[1])/2],a=this.rotatePoints(t[0],t[1],s[0],s[1],-n),o=this.rotatePoints(r[0],r[1],s[0],s[1],-n),t=this.rotatePoints(i[0],i[1],s[0],s[1],-n);return e.startX=a[0],e.startY=a[1],e.endX=t[0],e.endY=o[1],e.width=e.endX-e.startX,e.height=e.endY-e.startY,e},tUt.prototype.rotatePoints=function(e,t,i,n,o){return[(e-i)*Math.cos(o)-(t-n)*Math.sin(o)+i,(e-i)*Math.sin(o)+(t-n)*Math.cos(o)+n]},tUt.prototype.setResizedValue=function(e,t,i,n){switch(e){case"x":t+=i;break;case"y":t+=n;break;case"abs-x":t+=0<i?-i:Math.abs(i);break;case"abs-y":t+=0<n?-n:Math.abs(n);break;case"y-abs-x":t+=n+(0<i?-i:Math.abs(i))/2;break;case"abs-x-abs-y":t+=(0<i?-i:Math.abs(i))+(0<n?-n:Math.abs(n))/2;break;case"abs-y-x":t+=(0<n?-n:Math.abs(n))+i/2;break;case"x-y":t+=i+n/2;break;case"y-x":t+=n+i/2;break;case"img-resize-x":t+=i;break;case"img-resize-y":t+=n}return t},tUt.prototype.getResizeDirection=function(e,t,i,n,o,r){n*=180/Math.PI,n=this.getResizedElement(n,this.resizedElement);"e-resize"===this.resizedElement?(e.width=this.setResizedValue(n,e.width,t,i),e.endX=e.width+e.startX):"n-resize"===this.resizedElement?(e.startY=this.setResizedValue(n,e.startY,t,i),e.height=e.endY-e.startY):"w-resize"===this.resizedElement?(e.startX=this.setResizedValue(n,e.startX,t,i),e.width=e.startX+e.endX):"s-resize"===this.resizedElement?(e.height=this.setResizedValue(n,e.height,t,i),e.endY=e.height+e.startY):o&&"img-resize"===o?(e.width=this.setResizedValue("img-resize-x",e.width,t,i),e.height=this.setResizedValue("img-resize-y",e.height,t,i),"se-resize"===r?(e.endX=e.width+e.startX,e.endY=e.height+e.startY):"sw-resize"===r?(e.startX=e.endX-e.width,e.endY=e.height+e.startY):"ne-resize"===r?(e.endX=e.width+e.startX,e.startY=e.endY-e.height):"nw-resize"===r&&(e.startX=e.endX-e.width,e.startY=e.endY-e.height)):o&&"text"===o&&("widthHeight"===r?(e.width=this.setResizedValue("x-y",e.width,t,i),e.endX=e.width+e.startX,e.height=this.setResizedValue("y-x",e.height,t,i),e.endY=e.height+e.startY):"width"===r?(e.width=this.setResizedValue("x-y",e.width,t,i),e.endX=e.width+e.startX):"height"===r&&(e.height=this.setResizedValue("y-abs-x",e.height,t,i),e.endY=e.height+e.startY))},tUt.prototype.getResizedElement=function(e,t){for(var i=[],n=("n-resize"===t?i=[[337.5,360,"y"],[0,22.5,"y"],[22.5,67.5,"y-abs-x"],[67.5,112.5,"abs-x"],[112.5,157.5,"abs-x-abs-y"],[157.5,202.5,"abs-y"],[202.5,247.5,"abs-y-x"],[247.5,292.5,"x"],[292.5,337.5,"x-y"]]:"e-resize"===t?i=[[337.5,360,"x"],[0,22.5,"x"],[22.5,67.5,"x-y"],[67.5,112.5,"y"],[112.5,157.5,"y-abs-x"],[157.5,202.5,"abs-x"],[202.5,247.5,"abs-x-abs-y"],[247.5,292.5,"abs-y"],[292.5,337.5,"abs-y-x"]]:"s-resize"===t?i=[[337.5,360,"y"],[0,22.5,"y"],[22.5,67.5,"y-abs-x"],[67.5,112.5,"abs-x"],[112.5,157.5,"abs-x-abs-y"],[157.5,202.5,"abs-y"],[202.5,247.5,"abs-y-x"],[247.5,292.5,"x"],[292.5,337.5,"x-y"]]:"w-resize"===t&&(i=[[337.5,360,"x"],[0,22.5,"x"],[22.5,67.5,"x-y"],[67.5,112.5,"y"],[112.5,157.5,"y-abs-x"],[157.5,202.5,"abs-x"],[202.5,247.5,"abs-x-abs-y"],[247.5,292.5,"abs-y"],[292.5,337.5,"abs-y-x"]]),e<0?360-Math.abs(e):e),o=0,r=i;o<r.length;o++){var s=r[o],a=s[0],l=s[1],s=s[2];if(a<n&&n<=l||a<n+360&&n+360<=l)return s}return t},tUt.prototype.updateCursorStyles=function(e,t,i){var n,o,r=this.parent,s=!1,a=(""===r.activeObj.keyHistory||void 0!==r.activeObj.shape||r.currObjType.isCustomCrop||r.currObjType.isLine||!r.currObjType.isText||(r.activeObj.shape="text"),Pe({},r.activeObj,{},!0));je(a.topLeftCircle)||((0===a.shapeDegree?r.transform.degree:r.transform.degree-a.shapeDegree)<0&&0,this.isObjSelected?"line"===a.shape||"arrow"===a.shape?s=this.updateCursorStylesForLineArrow(e,t,a):"path"===a.shape?s=this.updateCursorStylesForPath(e,t,a):a.rotatedAngle?(this.setCursorForRotatedObject(a,e,t,r.upperCanvas),"grabbing"===r.cursor?(r.upperCanvas.style.cursor=r.cursor="grabbing",this.dragElement=r.cursor):"move"===r.cursor?(this.dragPoint.startX=this.previousPoint.x=this.dragPoint.endX=e,this.dragPoint.startY=this.previousPoint.y=this.dragPoint.endY=t):"default"!==r.cursor&&(s=!0,this.dragElement=r.cursor,r.currObjType.isResize=!0)):(n=this.getTransRotationPoint(a),o=a.topLeftCircle.radius,n&&e>=n.x-2*o&&e<=n.x+2*o&&t>=n.y-2*o&&t<=n.y+2*o&&"grabbing"!==this.dragElement?(r.upperCanvas.style.cursor=r.cursor="grabbing",this.dragElement=r.upperCanvas.style.cursor):e>=a.topLeftCircle.startX-2*o&&e<=a.topLeftCircle.startX+2*o&&t>=a.topLeftCircle.startY-2*o&&t<=a.topLeftCircle.startY+2*o&&"nw-resize"!==this.dragElement?(a.topLeftCircle.startX=a.topLeftCircle.startY=0,r.upperCanvas.style.cursor=r.cursor="nw-resize",s=!0,this.dragElement=r.upperCanvas.style.cursor):e>=a.topLeftCircle.startX-2*o&&e<=a.topRightCircle.startX-2*o&&t>=a.topCenterCircle.startY-2*o&&t<=a.topCenterCircle.startY+2*o&&"n-resize"!==this.dragElement?(a.topCenterCircle.startX=a.topCenterCircle.startY=0,r.upperCanvas.style.cursor=r.cursor="n-resize",s=!0,this.dragElement=r.upperCanvas.style.cursor):e>=a.topRightCircle.startX-2*o&&e<=a.topRightCircle.startX+2*o&&t>=a.topRightCircle.startY-2*o&&t<=a.topRightCircle.startY+2*o&&"ne-resize"!==this.dragElement?(a.topRightCircle.startX=a.topRightCircle.startY=0,r.upperCanvas.style.cursor=r.cursor="ne-resize",s=!0,this.dragElement=r.upperCanvas.style.cursor):e>=a.centerLeftCircle.startX-2*o&&e<=a.centerLeftCircle.startX+2*o&&t>=a.topLeftCircle.startY-2*o&&t<=a.bottomLeftCircle.startY-2*o&&"w-resize"!==this.dragElement?(a.centerLeftCircle.startX=a.centerLeftCircle.startY=0,r.upperCanvas.style.cursor=r.cursor="w-resize",s=!0,this.dragElement=r.upperCanvas.style.cursor):e>=a.centerRightCircle.startX-2*o&&e<=a.centerRightCircle.startX+2*o&&t>=a.topRightCircle.startY-2*o&&t<=a.bottomRightCircle.startY-2*o&&"e-resize"!==this.dragElement?(a.centerRightCircle.startX=a.centerRightCircle.startY=0,r.upperCanvas.style.cursor=r.cursor="e-resize",s=!0,this.dragElement=r.upperCanvas.style.cursor):e>=a.bottomLeftCircle.startX-2*o&&e<=a.bottomLeftCircle.startX+2*o&&t>=a.bottomLeftCircle.startY-2*o&&t<=a.bottomLeftCircle.startY+2*o&&"sw-resize"!==this.dragElement?(a.bottomLeftCircle.startX=a.bottomLeftCircle.startY=0,r.upperCanvas.style.cursor=r.cursor="sw-resize",s=!0,this.dragElement=r.upperCanvas.style.cursor):e>=a.bottomLeftCircle.startX-2*o&&e<=a.bottomRightCircle.startX-2*o&&t>=a.bottomCenterCircle.startY-2*o&&t<=a.bottomCenterCircle.startY+2*o&&"s-resize"!==this.dragElement?(a.bottomCenterCircle.startX=a.bottomCenterCircle.startY=0,r.upperCanvas.style.cursor=r.cursor="s-resize",s=!0,this.dragElement=r.upperCanvas.style.cursor):e>=a.bottomRightCircle.startX-2*o&&e<=a.bottomRightCircle.startX+2*o&&t>=a.bottomRightCircle.startY-2*o&&t<=a.bottomRightCircle.startY+2*o&&"se-resize"!==this.dragElement?(a.bottomRightCircle.startX=a.bottomRightCircle.startY=0,r.upperCanvas.style.cursor=r.cursor="se-resize",s=!0,this.dragElement=r.upperCanvas.style.cursor):(this.dragPoint.startX=this.previousPoint.x=this.dragPoint.endX=e,this.dragPoint.startY=this.previousPoint.y=this.dragPoint.endY=t),"text"!==a.shape||"n-resize"!==r.cursor&&"s-resize"!==r.cursor&&"e-resize"!==r.cursor&&"w-resize"!==r.cursor||(r.upperCanvas.style.cursor=r.cursor="move",this.dragElement="",this.dragPoint.startX=this.previousPoint.x=this.dragPoint.endX=e,this.dragPoint.startY=this.previousPoint.y=this.dragPoint.endY=t)):(this.dragPoint.startX=this.previousPoint.x=this.dragPoint.endX=e,this.dragPoint.startY=this.previousPoint.y=this.dragPoint.endY=t),this.previousPoint.x=this.previousPoint.y=this.diffPoint.x=this.diffPoint.y=0,"touchstart"!==i||s||e>=a.activePoint.startX&&e<=a.activePoint.endX&&t>=a.activePoint.startY&&t<=a.activePoint.endY||"grabbing"===this.dragElement?r.currObjType.isDragging=!0:"line"===a.shape||"arrow"===a.shape?(this.setCursorForLineArrow(a,e,t,r.upperCanvas),"move"===r.cursor&&(r.currObjType.isDragging=!0)):"path"===a.shape&&(this.setCursorForPath(a,e,t,r.upperCanvas),"move"===r.cursor)&&(r.currObjType.isDragging=!0),0===a.rotatedAngle)||"e-resize"!==this.dragElement&&"w-resize"!==this.dragElement&&"n-resize"!==this.dragElement&&"s-resize"!==this.dragElement||(this.dragPoint.startX=this.previousPoint.x=this.dragPoint.endX=e,this.dragPoint.startY=this.previousPoint.y=this.dragPoint.endY=t)},tUt.prototype.updateCursorStylesForLineArrow=function(e,t,i){for(var n,o=!1,r=this.parent,s=i.topLeftCircle.radius,a=0;a<5;a++)if(e>=(n=i.pointColl[a]).x-2*s&&e<=n.x+2*s&&t>=n.y-2*s&&t<=n.y+2*s){i.centerLeftCircle.startX=i.centerLeftCircle.startY=0,this.dragElement="w-resize",o=!0;break}if(!o)for(a=1;a<6;a++)if(e>=(n=i.pointColl[i.pointColl.length-a]).x-2*s&&e<=n.x+2*s&&t>=n.y-2*s&&t<=n.y+2*s){i.centerRightCircle.startX=i.centerRightCircle.startY=0,this.dragElement="e-resize",o=!0;break}if(!o)for(a=0;a<i.pointColl.length;a++){if(e>=(n=i.pointColl[a]).x-2*s&&e<=n.x+2*s&&t>=n.y-2*s&&t<=n.y+2*s){r.upperCanvas.style.cursor=r.cursor="move",this.dragPoint.startX=this.previousPoint.x=this.dragPoint.endX=e,this.dragPoint.startY=this.previousPoint.y=this.dragPoint.endY=t;break}r.upperCanvas.style.cursor=r.cursor="default"}return o},tUt.prototype.updateCursorStylesForPath=function(e,t,i){var n=!1,o=this.parent;return this.pathAdjustedIndex=this.setCursorForLineArrow(i,e,t,o.upperCanvas),"move"===o.cursor&&(n=!0,this.dragElement="pathDrag"),n||(o.upperCanvas.style.cursor=o.cursor="move",this.dragPoint.startX=this.previousPoint.x=this.dragPoint.endX=e,this.dragPoint.startY=this.previousPoint.y=this.dragPoint.endY=t),n},tUt.prototype.setTextSelection=function(e,t){var i=this.parent,n=i.activeObj.activePoint,o=i.transform.degree,r=(o=0===i.activeObj.shapeDegree?i.transform.degree:i.transform.degree-i.activeObj.shapeDegree,i.activeObj.rotateFlipColl);if(this.isTransformedShape&&r)for(var o=0,s=0;s<r.length;s++)"number"==typeof r[s]&&(o+=r[s]);o<0&&(o=360+o);for(var s=0,a=i.activeObj.flipObjColl.length;s<a;s++){var l=i.activeObj.flipObjColl[s].toLowerCase();switch(o){case 0:switch(l){case"horizontal":n={startX:n.endX-e,startY:n.startY,endX:n.endX,endY:n.startY+(t||0)};break;case"vertical":n.startY=n.endY-t,n={startX:n.startX,startY:n.startY,endX:n.startX+(e||0),endY:n.endY};break;default:n={startX:n.startX,startY:n.startY,endX:n.startX+(e||0),endY:n.startY+(t||0)}}break;case 90:switch(l){case"horizontal":n.endX=n.startX+t,n={startX:n.startX,startY:n.startY,endX:n.endX,endY:n.startY+(e||0)};break;case"vertical":n.startX=n.endX-t,n={startX:n.startX,startY:n.endY-e,endX:n.endX,endY:n.endY};break;default:n.startX=n.endX-t,n={startX:n.startX,startY:n.startY,endX:n.endX,endY:n.startY+(e||0)}}break;case 180:switch(l){case"horizontal":n.startY=n.endY-t,n={startX:n.startX,startY:n.startY,endX:n.startX+e,endY:n.endY};break;case"vertical":n.endY=n.startY+t,n={endX:n.endX,endY:n.endY,startX:n.endX-(e||0),startY:n.startY};break;default:n={endX:n.endX,endY:n.endY,startX:n.endX-(e||0),startY:n.endY-(t||0)}}break;case 270:switch(l){case"horizontal":n.startX=n.endX-t,n={startX:n.startX,startY:n.endY-(e||0),endX:n.endX,endY:n.endY};break;case"vertical":n={startX:n.startX,startY:n.startY,endX:n.startX+t,endY:n.startY+(e||0)};break;default:n.endX=n.startX+t,n={startX:n.startX,startY:n.endY-(e||0),endX:n.endX,endY:n.endY}}}}if(0===i.activeObj.flipObjColl.length)switch(o){case 0:n={startX:n.startX,startY:n.startY,endX:n.startX+(e||0),endY:n.startY+(t||0)};break;case 90:n.startX=n.endX-t,n={startX:n.startX,startY:n.startY,endX:n.endX,endY:n.startY+(e||0)};break;case 180:n={endX:n.endX,endY:n.endY,startX:n.endX-(e||0),startY:n.endY-(t||0)};break;case 270:n.endX=n.startX+t,n={startX:n.startX,startY:n.endY-(e||0),endX:n.endX,endY:n.endY}}n.width=n.endX-n.startX,n.height=n.endY-n.startY,i.activeObj.activePoint=n,360!==i.transform.degree&&-360!==i.transform.degree||(i.transform.degree=0)},tUt.prototype.setActivePoint=function(e,t){var i,n,o=this.parent,r=o.activeObj.activePoint;je(r)||(o.currObjType.isText?(n=e||0,i=t||o.activeObj.textSettings.fontSize,void 0===o.activeObj.textSettings.fontSize&&(o.activeObj.textSettings.fontSize=.1*Math.abs(o.baseImgCanvas.width-o.baseImgCanvas.height)),this.setTextSelection(n,i),this.mouseDownPoint.x=r.endX,this.mouseDownPoint.y=r.endY,void 0!==o.activeObj.horTopLine&&(o.activeObj.activePoint=Pe({},r,{},!0)),o.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate"}})):e&&t?(r.startX=this.mouseDownPoint.x=e,r.startY=this.mouseDownPoint.y=t,o.currObjType.isDragging=!0):((r={startX:(n=o.activeObj).horTopLine.startX,startY:n.horTopLine.startY,endX:n.horTopLine.endX,endY:n.horTopLine.endY}).width=r.endX-r.startX,r.height=r.endY-r.startY))},tUt.prototype.mouseDownEventHandler=function(e){var t,i,n=this.parent;n.isKBDNavigation=!1,this.mouseDown=e.currentTarget===n.lowerCanvas||e.currentTarget===n.upperCanvas?"canvas":"","touchstart"===e.type?this.isTouch=!0:this.isTouch=!1,"touchstart"===e.type&&e.currentTarget===n.lowerCanvas&&!n.isImageLoaded||(this.isCropSelection=!1,this.isPan=!0,void 0!==(t=void 0!==n.activeObj.shape?n.activeObj.shape.split("-"):t)&&"crop"===t[0]&&(this.isCropSelection=!0),this.isCropSelection&&(this.dragCanvas=n.togglePan=!0),"grabbing"===n.cursor&&(t={shapeSettingsObj:{}},this.isGrabbing=!0,n.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:t}}),t={cancel:!(i={cancel:!1,action:"rotate-start",previousShapeSettings:t=t.shapeSettingsObj,allowShapeOverflow:this.allowOutofBound()}),action:"rotate-start",previousShapeSettings:t,allowShapeOverflow:this.allowOutofBound()},this.triggerShapeChange(i,t,"mouse-down")),i={point:this.setXYPoints(e)},n.trigger("click",i),this.isMouseDown=!0,this.isMouseUp=!1,this.clickEvent(i,e))},tUt.prototype.getImagePoints=function(e,t){var i=this.parent.img,n=i.destLeft,o=i.destTop,r=i.destWidth,i=i.destHeight;return e<n?e=n:n+r<e&&(e=n+r),t<o?t=o:o+i<t&&(t=o+i),{x:e,y:t}},tUt.prototype.clickEvent=function(e,t){var i=this.parent,n=i.activeObj.activePoint,o=e.point.x,e=e.point.y,r=i.activeObj.shape&&"text"===i.activeObj.shape?i.cursor:"default",s=i.upperCanvas.style.cursor;if(i.isResize)this.performEnterAction(t),i.upperCanvas.style.cursor="default";else{if(JSON.stringify(i.frameObj)!==JSON.stringify(i.tempFrameObj))i.okBtn();else if(""!==this.currentDrawingShape&&!this.isShapeTouch(t,this.isCropSelection)&&(this.isTouch||"crosshair"===s||i.isShapeDrawing))return i.drawingShape&&!i.isShapeDrawing&&(i.okBtn(),i.enableShapeDrawing(i.toPascalCase(i.drawingShape),!0)),n=i.activeObj.activePoint,i.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(c={currObj:{}}),value:{object:c}}),this.initialPrevObj=c.currObj,this.initialPrevObj.objColl=Pe([],i.objColl,[],!0),this.initialPrevObj.pointColl=Pe([],i.pointColl,[],!0),this.initialPrevObj.afterCropActions=Pe([],i.afterCropActions,[],!0),i.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(c={selPointColl:null}),value:{obj:c}}),this.initialPrevObj.selPointColl=Pe([],c.selPointColl,[],!0),this.setActivePoint(o,e),n=i.activeObj.activePoint,"path"===this.currentDrawingShape&&(l=this.getImagePoints(o,e),i.activeObj.pointColl.push({x:l.x,y:l.y}),0!==n.width)&&0!==n.height&&(n.width=0,n.height=0,n.startX=i.activeObj.pointColl[i.activeObj.pointColl.length-1].x,n.startY=i.activeObj.pointColl[i.activeObj.pointColl.length-1].y),n.endX=n.startX,n.endY=n.startY,"text"===this.currentDrawingShape?(i.activeObj.textSettings.fontSize=11,this.previousPoint.x=n.startX,this.previousPoint.y=n.startY,i.notify("shape",{prop:"updateFontStyles",onPropertyChange:!1,value:{isTextBox:null}}),c=this.upperContext.measureText(i.activeObj.textSettings.text).width+.5*i.activeObj.textSettings.fontSize,n.endX=n.startX+c,n.endY=n.startY+i.activeObj.textSettings.fontSize,n.width=n.endX-n.startX,n.height=n.endY-n.startY):"arrow"===this.currentDrawingShape&&(i.activeObj.start=this.arrowShape[0],i.activeObj.end=this.arrowShape[1]),c={cancel:!(p={cancel:!(i.currObjType.isDragging=!0),action:"draw-start",previousShapeSettings:c=this.updatePrevShapeSettings(),allowShapeOverflow:this.allowOutofBound()}),action:"move",previousShapeSettings:c,allowShapeOverflow:this.allowOutofBound()},this.shapeResizingArgs=p,this.shapeMovingArgs=c,this.triggerShapeChange(p,c,"mouse-down"),i.activeObj.activePoint=n,i.isShapeDrawing=!0,void(this.tempActiveObj=Pe({},i.activeObj,{},!0));i.notify("draw",{prop:"resetFrameZoom",onPropertyChange:!1,value:{isOk:!0}}),this.isCropSelection&&this.dragCanvas&&(this.setCursor(o,e),"move"!==i.cursor)&&"crosshair"!==i.cursor&&"default"!==i.cursor&&"grab"!==i.cursor&&(this.isPan=!1),i.activeObj.shape?this.isObjSelected=!0:this.isObjSelected=!1;var a,l,h,d,p={currObj:{}},c=(i.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:p}}),p.currObj),n=Pe({},i.activeObj,null,!0),p=this.isShapeTouch(t,this.isCropSelection),u=this.isFreehandDrawTouch(t,this.isCropSelection),g=p||this.isShapeClick(t,this.isCropSelection),g=this.applyCurrShape(g),m="none"!==i.textArea.style.display;this.isTouch&&!p&&n.shape&&!this.isCropSelection&&(this.applyObj(o,e)&&(i.okBtn(!0),i.notify("draw",{prop:"setPrevActObj",onPropertyChange:!1,value:{prevActObj:null}})),n=Pe({},i.cropObj,{},!0),i.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:c,previousObjColl:c.objColl,previousPointColl:c.pointColl,previousSelPointColl:c.selPointColl,previousCropObj:n,previousText:null,currentText:null,previousFilter:null,isCircleCrop:i.isCircleCrop}}),g)&&i.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}),p||i.togglePen||this.isCropSelection||"blur"===i.activeObj.redactType||"pixelate"===i.activeObj.redactType||(i.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1}),i.notify("toolbar",{prop:"close-contextual-toolbar",onPropertyChange:!1})),!this.dragCanvas||!this.isPan||"grab"!==i.cursor&&!this.isTouch||p||u||i.togglePen?(c=!1,!i.activeObj.shape||"line"!==i.activeObj.shape&&"arrow"!==i.activeObj.shape||(c=!0),p=(n=this.setXYPoints(t)).x,u=n.y,this.applyObj(p,u)&&(i.okBtn(!0),g&&(n=i.cursor,i.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}),i.cursor=n),i.notify("draw",{prop:"setPrevActObj",onPropertyChange:!1,value:{prevActObj:null}})),i.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:p,y:u,isMouseDown:!0}}),i.notify("freehand-draw",{prop:"getFreehandDrawHoveredIndex",onPropertyChange:!(n={index:null}),value:{obj:n}}),i.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!(a={freehandSelectedIndex:null}),value:{obj:a}}),this.isFhdPoint||this.isFhdCustomized&&!i.togglePen?(je(a.freehandSelectedIndex)||a.freehandSelectedIndex===n.index||(d=n.index,i.okBtn(),this.isFhdCustomized=!1,i.notify("freehand-draw",{prop:"setFreehandDrawHoveredIndex",onPropertyChange:!1,value:{index:d}}),-1<n.index&&(h=i.pointColl[n.index].strokeColor,i.notify("freehand-draw",{prop:"hoverFhd",onPropertyChange:!1,value:{strokeColor:h,strokeWidth:i.pointColl[n.index].strokeWidth}}))),a.freehandSelectedIndex=null,i.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!1,value:{obj:a}}),d=Pe([],i.objColl,[],!0),!je(n.index)&&-1<n.index?(i.notify("freehand-draw",{prop:"selectFhd",value:{type:"ok"}}),i.notify("freehand-draw",{prop:"hoverFhd",onPropertyChange:!1,value:{strokeColor:null,strokeWidth:null}}),i.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:!0}})):a.freehandSelectedIndex?(i.okBtn(),h=i.pointColl[a.freehandSelectedIndex].strokeColor,i.notify("freehand-draw",{prop:"hoverFhd",onPropertyChange:!1,value:{strokeColor:h,strokeWidth:i.pointColl[a.freehandSelectedIndex].strokeWidth}})):this.findTargetObj(p,u,!1)&&(i.objColl=d,this.findTarget(p,u,t.type),i.notify("draw",{prop:"redrawDownScale"}))):(this.isFhdEditing&&(i.apply(),(n=document.getElementById(i.element.id+"_quickAccessToolbarArea"))&&(n.style.display="none"),l=i.pointColl[a.freehandSelectedIndex],h={action:"apply",currentShapeSettings:Pe({},{id:"pen_"+(a.freehandSelectedIndex+1),type:AUt.FreehandDraw,startX:l.points[0].x,startY:l.points[0].y,strokeColor:l.strokeColor,strokeWidth:l.strokeWidth,points:l.points,opacity:l.opacity,index:l.order},{},!0)},i.trigger("shapeChange",h),i.editCompleteArgs=h),d=i.togglePen,i.notify("toolbar",{prop:"close-contextual-toolbar",onPropertyChange:!1}),d&&i.freeHandDraw(!0),this.isFhdEditing=!1,c?this.setCursor(p,u):"default"!==r&&(i.upperCanvas.style.cursor=i.cursor=r),("crosshair"===i.cursor||F.isDevice&&i.togglePen)&&(i.togglePen?(je(i.activeObj.strokeSettings)&&(i.notify("shape",{prop:"getStrokeSettings",onPropertyChange:!(n={strokeSettings:{}}),value:{obj:n}}),i.activeObj.strokeSettings=n.strokeSettings),i.notify("freehand-draw",{prop:"getPenStrokeWidth",onPropertyChange:!(a={penStrokeWidth:null}),value:{obj:a}}),je(a.penStrokeWidth)&&i.notify("freehand-draw",{prop:"setPenStrokeWidth",onPropertyChange:!1,value:{value:2}}),this.upperContext.strokeStyle=i.activeObj.strokeSettings.strokeColor,this.upperContext.fillStyle=i.activeObj.strokeSettings.strokeColor,i.notify("freehand-draw",{prop:"resetSelPoints",onPropertyChange:!1}),i.notify("freehand-draw",{prop:"freehandDownHandler",onPropertyChange:!1,value:{e:t,canvas:i.upperCanvas}})):(i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height)),i.currObjType.isActiveObj=!1,this.dragElement="",this.dragPoint.startX=this.dragPoint.startY=this.dragPoint.endX=this.dragPoint.endY=0),(this.isTouch&&"crosshair"!==s||"crosshair"!==i.cursor)&&"touchstart"===t.type.toLowerCase()||i.currObjType.isActiveObj&&"default"!==i.cursor&&!i.togglePen?(i.notify("draw",{prop:"updateTempObjColl"}),i.notify("draw",{prop:"updateTempPointColl"}),this.findTarget(p,u,t.type),i.notify("draw",{prop:"redrawDownScale"})):""!==i.currObjType.shape&&!i.currObjType.isCustomCrop||i.togglePen||"default"===i.cursor||this.setActivePoint(p,u),m&&i.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}))):(this.applyObj(o,e)&&(i.okBtn(!0),g&&(l=i.cursor,i.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}),i.cursor=l),i.notify("draw",{prop:"setPrevActObj",onPropertyChange:!1,value:{prevActObj:null}})),this.isFhdEditing&&(i.notify("freehand-draw",{prop:"applyFhd",onPropertyChange:!1}),this.isFhdCustomized=!1,i.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1})),(h=i.activeObj.shape)&&-1<["rectangle","ellipse","line","arrow","path","text","image","redact"].indexOf(h)&&(i.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:null}}),i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),i.notify("toolbar",{prop:"setCurrentToolbar",value:{type:"main"}}),i.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1})),d=!1,i.activeObj.shape&&-1<i.activeObj.shape.indexOf("crop-")&&(d=!0),!i.element.querySelector(".e-contextual-toolbar-wrapper")||d||i.element.querySelector(".e-contextual-toolbar-wrapper").classList.contains("e-hide")||(i.okBtn(),i.element.querySelector(".e-contextual-toolbar-wrapper").classList.add("e-hide")),this.canvasMouseDownHandler(t)),this.isShapeInserted=!1,this.tempActiveObj=Pe({},i.activeObj,{},!0)}},tUt.prototype.mouseMoveEventHandler=function(e){var t=this.parent,i=t.cursor,n=t.upperCanvas.style.cursor;if(e.preventDefault(),!(this.isPreventShaping||t.isShapeDrawing&&t.currObjType.isDragging&&this.isTouch&&t.activeObj.shape&&"path"===t.activeObj.shape)){"grabbing"===t.cursor&&this.isGrabbing&&(t.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!(d={shapeSettingsObj:{}}),value:{obj:d}}),d={cancel:!(o={cancel:!1,action:"rotating",previousShapeSettings:d=d.shapeSettingsObj,allowShapeOverflow:this.allowOutofBound()}),action:"rotating",previousShapeSettings:d,allowShapeOverflow:this.allowOutofBound()},this.triggerShapeChange(o,d,"mouse-down")),this.timer&&0<this.timer&&this.dragPoint.startX&&this.dragPoint.startY&&(o=Math.abs(this.dragPoint.startX-e.touches[0].clientX),d=Math.abs(this.dragPoint.startY-e.touches[0].clientY),10<o||10<d)&&(this.timer=0);var o=t.lowerCanvas.getBoundingClientRect();if("touchmove"===e.type&&2===e.touches.length)this.isFirstMove?(this.startTouches=this.targetTouches(e.touches),this.tempTouches=[],this.tempTouches.push({x:e.touches[0].clientX||e.touches[0].pageX-t.lowerCanvas.offsetLeft-o.left,y:(e.touches[0].clientY||e.touches[0].pageY-t.lowerCanvas.offsetTop)-o.top}),this.tempTouches.push({x:(e.touches[1].clientX||e.touches[1].pageX-t.lowerCanvas.offsetLeft)-o.left,y:(e.touches[1].clientY||e.touches[1].pageY-t.lowerCanvas.offsetTop)-o.top})):(d=(e.touches[0].clientX||e.touches[0].pageX-t.lowerCanvas.offsetLeft)-o.left,l=(e.touches[0].clientY||e.touches[0].pageY-t.lowerCanvas.offsetTop)-o.top,h=(e.touches[1].clientX||e.touches[1].pageX-t.lowerCanvas.offsetLeft)-o.left,a=(e.touches[1].clientY||e.touches[1].pageY-t.lowerCanvas.offsetTop)-o.top,this.currMousePoint.x!==(d={x:d<h?h-(h-d)/2:d-(d-h)/2,y:l<a?a-(a-l)/2:l-(l-a)/2}).x&&this.currMousePoint.y!==d.y&&(h="","touchmove"===e.type&&(t.zoomSettings.zoomTrigger&xUt.Pinch)===xUt.Pinch&&(this.zoomType="Pinch",l=this.calculateScale(this.startTouches,this.targetTouches(e.touches)),this.startTouches=this.targetTouches(e.touches),1<l?h="zoomIn":l<1&&(h="zoomOut")),""!==h&&(t.isZoomBtnClick=!0,t.notify("draw",{prop:"performPointZoom",onPropertyChange:!1,value:{x:d.x,y:d.y,type:h,isResize:null}})),this.tempTouches=[],this.tempTouches.push({x:e.touches[0].clientX||e.touches[0].pageX-t.lowerCanvas.offsetLeft,y:e.touches[0].clientY||e.touches[0].pageY-t.lowerCanvas.offsetTop}),this.tempTouches.push({x:e.touches[1].clientX||e.touches[1].pageX-t.lowerCanvas.offsetLeft,y:e.touches[1].clientY||e.touches[1].pageY-t.lowerCanvas.offsetTop}),this.currMousePoint.x=d.x,this.currMousePoint.y=d.y,this.isPinching=!0)),this.isFirstMove=!1;else{"mousemove"===e.type?(r=e.clientX,s=e.clientY):(this.touchEndPoint.x=r=e.touches[0].clientX,this.touchEndPoint.y=s=e.touches[0].clientY),r-=o.left,s-=o.top,this.canvasMouseMoveHandler(e);var r,s,a=!1,l=((a=void 0!==(p=void 0!==t.activeObj.shape?t.activeObj.shape.split("-"):p)&&"crop"===p[0]?!0:a)&&t.notify("transform",{prop:"disableZoomOutBtn",value:{isZoomOut:!0}}),t.upperCanvas.style.cursor=n,t.cursor=i,(t.currObjType.isActiveObj&&(void 0!==t.activeObj.activePoint||0<t.objColl.length)&&!this.dragCanvas||void 0!==t.activeObj.activePoint)&&""===this.dragElement&&(this.setCursor(r,s),t.activeObj.activePoint&&(0===t.activeObj.activePoint.width||!je(t.activeObj.currIndex)&&this.cursorTargetId!==t.activeObj.currIndex)&&"default"!==t.cursor&&"move"!==t.cursor&&"crosshair"!==t.cursor&&"grab"!==t.cursor&&"pointer"!==t.cursor&&(t.upperCanvas.style.cursor=t.cursor="move"),this.findTarget(r,s,e.type)),t.img),h=l.destLeft,d=l.destTop,o=l.destWidth,p=l.destHeight;if(t.currObjType.isDragging){if(t.activeObj.shape&&t.activeObj.preventShapeDragOut&&(r<h||h+o<r||s<d||d+p<s))return;this.upperContext.clearRect(0,0,t.lowerCanvas.width,t.lowerCanvas.height),this.updateActivePoint(r,s,a),t.notify("shape",{prop:"updateTrianglePoints",onPropertyChange:!1,value:{obj:t.activeObj}}),this.isPreventDragging?(this.isShapeDragOut()||(this.isPreventDragging=!1),t.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:null,isCropRatio:null,points:null,isPreventDrag:!0,saveContext:null,isPreventSelection:null}})):t.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:null,isCropRatio:null,points:null,isPreventDrag:null,saveContext:null,isPreventSelection:null}}),a&&(this.dragCanvas=t.togglePan=!0)}this.isMouseDown=!1,this.isMouseUp=!1}}},tUt.prototype.mouseUpEventHandler=function(e){var t=this.parent,i=t.element.id;if(t.isKBDNavigation=this.isMouseDown=!1,this.isMouseUp=!0,F.isDevice||!(t.element.querySelector("#"+i+"_contextualToolbar")&&!t.element.querySelector("#"+i+"_contextualToolbar").parentElement.classList.contains("e-hide")||t.element.querySelector("#"+i+"_headWrapper")&&!t.element.querySelector("#"+i+"_headWrapper").parentElement.classList.contains("e-hide"))||t.activeObj.shape&&"redact"===t.activeObj.shape&&t.isShapeDrawing){if("grabbing"===t.cursor&&this.isGrabbing&&(t.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!(y={shapeSettingsObj:{}}),value:{obj:y}}),d={cancel:!(u={cancel:!1,action:"rotate-end",previousShapeSettings:i=y.shapeSettingsObj,allowShapeOverflow:this.allowOutofBound()}),action:"rotate-end",previousShapeSettings:i,allowShapeOverflow:this.allowOutofBound()},this.triggerShapeChange(u,d,"mouse-up")),this.isGrabbing=!1,this.isPreventShaping&&(this.isPreventShaping=!1),"canvas"===this.mouseDown||this.isSliderActive||e.target.closest(".e-image-editor")||e.target.closest(".e-ie-ddb-popup")){"touchstart"===e.type?this.isTouch=!1:"touchend"===e.type&&e.stopImmediatePropagation(),e.preventDefault(),t.togglePan&&this.canvasMouseUpHandler(e);var i=void 0,n=void 0,o=("mouseup"===e.type?(i=e.clientX,n=e.clientY):this.isTouchDblClick||(i=this.touchEndPoint.x,n=this.touchEndPoint.y),t.lowerCanvas.getBoundingClientRect()),o=(i-=o.left,n-=o.top,void 0),r=this.currentDrawingShape,s=!1;if("touchend"===e.type&&(this.startTouches=this.tempTouches=[],this.isFirstMove=!1,"none"===t.textArea.style.display&&(this.timer=0),this.isPinching))return this.isPinching=!1,t.notify("draw",{prop:"redrawDownScale"}),(t.isCropTab||t.activeObj.shape)&&(t.notify("draw",{prop:"setStraightenActObj",value:{activeObj:null}}),t.notify("freehand-draw",{prop:"resetStraightenPoint"})),void(t.isStraightening&&(t.notify("draw",{prop:"resetStraightenDestPoints"}),t.notify("draw",{prop:"setDestForStraighten"})));var a,l,h,d,p,c,u,g,m=!1,f=void 0;if(void 0!==(f=void 0!==t.activeObj.shape?t.activeObj.shape.split("-"):f)&&"crop"===f[0]&&(m=!0),"path"===this.currentDrawingShape&&t.isShapeDrawing)return a=(l=e.srcElement).parentElement.id,h=t.element.id,e.currentTarget!==t.upperCanvas&&e.currentTarget!==t.lowerCanvas&&0<t.activeObj.pointColl.length&&(l.classList.contains("e-upload-icon")||a===h+"_zoomIn"||a===h+"_zoomOut"||a===h+"_annotationBtn"||a===h+"_borderColorBtn"||a===h+"_borderWidthBtn")&&(t.notify("shape",{prop:"stopPathDrawing",onPropertyChange:!1,value:{e:e,isApply:!0}}),this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),t.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:t.activeObj,isCropRatio:null,points:null,isPreventDrag:!0,saveContext:null,isPreventSelection:!0}})),void(t.currObjType.isDragging&&this.isTouch&&t.activeObj.shape&&"path"===t.activeObj.shape&&(this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),t.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:t.activeObj,isCropRatio:null,points:null,isPreventDrag:!0,saveContext:null,isPreventSelection:!0}})));e.currentTarget!==t.upperCanvas||t.isResize||(this.pathAdjustedIndex=null,""!==this.currentDrawingShape&&("text"===this.currentDrawingShape?(l=Pe({},t.cropObj,{},!0),t.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeInsert",previousObj:this.initialPrevObj,previousObjColl:this.initialPrevObj.objColl,previousPointColl:this.initialPrevObj.pointColl,previousSelPointColl:this.initialPrevObj.selPointColl,previousCropObj:l,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}})):t.notify("undo-redo",{prop:"updateUrObj",onPropertyChange:!1,value:{objColl:this.initialPrevObj.objColl,operation:"shapeInsert"}}),this.isShapeInserted=!0,this.currentDrawingShape="",(t.activeObj.shape&&"path"===t.activeObj.shape&&0===t.activeObj.pointColl.length||(!t.activeObj.shape||"path"!==t.activeObj.shape)&&0===t.activeObj.activePoint.width&&0===t.activeObj.activePoint.height)&&(t.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!(s=!0)}),this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height)),d={cancel:!(u={cancel:!1,action:"draw-end",previousShapeSettings:c=this.updatePrevShapeSettings()}),action:"move",previousShapeSettings:c},this.shapeResizingArgs=u,this.shapeMovingArgs=d,this.triggerShapeChange(u,d,"mouse-up")),t.activeObj.shape&&"path"===t.activeObj.shape&&0<t.activeObj.pointColl.length&&(t.activeObj.activePoint=t.getSquarePointForPath(t.activeObj)),this.adjustActObjForLineArrow(),this.updPtCollForShpRot(),t.currObjType.shape=t.currObjType.shape.toLowerCase(),a=Pe({},t.cropObj,{},!0),t.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(h={currObj:{}}),value:{object:h}}),(l=h.currObj).objColl=Pe([],t.objColl,[],!0),l.pointColl=Pe([],t.pointColl,[],!0),l.afterCropActions=Pe([],t.afterCropActions,[],!0),t.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(d={selPointColl:null}),value:{obj:d}}),l.selPointColl=Pe([],d.selPointColl,[],!0),t.togglePen||m?m&&this.isMouseUp&&-1<t.cursor.indexOf("resize")&&(u={cancel:!1,action:"resize-end",previousShapeSettings:c=this.updatePrevShapeSettings()},this.triggerShapeChange(u,u,"resize")):(this.tempObjColl&&0!==t.activeObj.activePoint.width&&(t.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),t.objColl.push(t.activeObj),JSON.stringify(t.activeObj.activePoint)!==JSON.stringify(this.tempActiveObj.activePoint)&&t.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:l,previousObjColl:this.tempObjColl,previousPointColl:l.pointColl,previousSelPointColl:l.selPointColl,previousCropObj:a,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),h=Pe({},t.objColl[t.objColl.length-1],{},!0),t.objColl.pop(),this.redrawShape(h),this.tempObjColl=void 0),this.isFhdEditing||(this.applyCurrActObj(i,n),t.currObjType.isResize=!1,t.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1}))),t.activeObj&&(d=!1,(void 0===(p=void 0!==t.activeObj.shape?t.activeObj.shape.split("-"):p)&&(t.currObjType.isCustomCrop||t.togglePen)||void 0!==p&&"crop"===p[0])&&(d=!0),c=t.activeObj.shape,-1<["rectangle","ellipse","line","arrow","path"].indexOf(o=c)?t.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"shapes",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}):"text"===c?"none"===t.textArea.style.display&&t.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"text",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}):"redact"===c?t.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"redact",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}):this.isFhdEditing?t.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"pen",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}):d||t.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:null,isCropping:!1,isZooming:null}}),t.notify("toolbar",{prop:"update-toolbar-items",onPropertyChange:!1}),this.isFhdEditing||(u=Math.floor(t.activeObj.activePoint.width),t.activeObj.shape&&"text"===t.activeObj.shape&&11===t.activeObj.textSettings.fontSize&&11===Math.floor(t.activeObj.activePoint.height)&&(55===u||t.activeObj.textSettings.bold&&58===u)&&(t.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),"text"!==t.drawingShape||t.activeObj.keyHistory||(t.activeObj.keyHistory="Enter Text")),d)||(this.adjustActObjForLineArrow(),t.isShapeDrawing?(g=this.currentDrawingShape,t.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1}),this.currentDrawingShape=g):t.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1})))),void 0!==(f=void 0!==t.activeObj.shape?t.activeObj.shape.split("-"):f)&&"crop"===f[0]&&(m=!0),t.activeObj.shape&&!m&&e.currentTarget===t.upperCanvas&&"none"===t.textArea.style.display&&("text"===t.activeObj.shape?t.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"text",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}):"redact"===t.activeObj.shape?t.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"redact",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}):(g=this.currentDrawingShape,this.currentDrawingShape="",t.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"shapes",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}),this.currentDrawingShape=g),t.notify("toolbar",{prop:"update-toolbar-items",onPropertyChange:!1}),t.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:null}}));var y={freehandDrawSelectedId:null};t.notify("freehand-draw",{prop:"getFreehandDrawSelectedId",onPropertyChange:!1,value:{obj:y}}),t.togglePen&&e.currentTarget===t.upperCanvas&&!y.freehandDrawSelectedId?(t.notify("freehand-draw",{prop:"freehandUpHandler",onPropertyChange:!1,value:{e:e,canvas:t.upperCanvas,context:this.upperContext}}),t.togglePen&&!t.isMaskImage&&(je(t.toolbar)||t.toolbar&&0<t.toolbar.length||!je(t.toolbarTemplate))&&(t.okBtn(),t.freeHandDraw(!0))):t.currObjType.shape="",this.dragElement="",this.mouseDown="",this.isSliderActive=!1,t.currObjType.isInitialLine=t.currObjType.isDragging=!1,this.selMouseUpEvent(),je(t.drawingShape)&&o&&""!==r&&(t.drawingShape=o),t.drawingShape&&(this.currentDrawingShape=t.drawingShape.toLowerCase(),s)&&(t.enableShapeDrawing(t.toPascalCase(t.drawingShape),!0),t.upperCanvas.style.cursor="crosshair"),t.isShapeDrawing=!1,t.notify("freehand-draw",{prop:"resetSelPoints",onPropertyChange:!1})}this.isMouseUp=!1}},tUt.prototype.adjustActObjForLineArrow=function(e){var t=!1,i=this.parent;if((e=e||i.activeObj).shape&&("line"===e.shape||"arrow"===i.activeObj.shape)){var n;if(("e-resize"===this.dragElement&&e.activePoint.endX<e.activePoint.startX||"w-resize"===this.dragElement&&e.activePoint.startX>e.activePoint.endX)&&(t=!0,n=e.activePoint.startX,e.activePoint.startX=e.activePoint.endX,e.activePoint.endX=n,n=e.activePoint.startY,e.activePoint.startY=e.activePoint.endY,e.activePoint.endY=n),e.activePoint.width=Math.abs(e.activePoint.endX-e.activePoint.startX),e.activePoint.height=Math.abs(e.activePoint.endY-e.activePoint.startY),"path"!==i.activeObj.shape){i.notify("shape",{prop:"setPointCollForLineArrow",onPropertyChange:!1,value:{obj:e}});for(var o=0;o<e.pointColl.length;o++)e.pointColl[o].ratioX=(e.pointColl[o].x-i.img.destLeft)/i.img.destWidth,e.pointColl[o].ratioY=(e.pointColl[o].y-i.img.destTop)/i.img.destHeight}}return t},tUt.prototype.updPtCollForShpRot=function(e){var t,i,n,o,r,s,a=this.parent;(e=e||a.activeObj).shape&&0!==e.rotatedAngle&&(a.notify("shape",{prop:"setPointCollForShapeRotation",onPropertyChange:!1,value:{obj:e}}),a=a.img,t=a.destLeft,i=a.destTop,n=a.destWidth,o=a.destHeight,a=e.horTopLinePointColl,r=e.horBottomLinePointColl,s=e.verLeftLinePointColl,e=e.verRightLinePointColl,a.forEach(a=function(e){e.ratioX=(e.x-t)/n,e.ratioY=(e.y-i)/o}),r.forEach(a),s.forEach(a),e.forEach(a))},tUt.prototype.setXYPoints=function(e){e.preventDefault(),"mousedown"===e.type?(t=e.clientX,i=e.clientY):(this.touchEndPoint.x=t=e.touches[0].clientX,this.touchEndPoint.y=i=e.touches[0].clientY);var t,i,e=this.parent.lowerCanvas.getBoundingClientRect();return{x:t-=e.left,y:i-=e.top}},tUt.prototype.getCurrentIndex=function(){for(var e,t=this.parent,i=0,n=t.objColl.length;i<n;i++)if(t.activeObj.currIndex===t.objColl[i].currIndex){e=i;break}return e},tUt.prototype.isShapeClick=function(e,t){var i,n,o,r,s=this.parent,a=!1;return s.togglePen||s.activeObj.shape&&"text"===s.activeObj.shape&&this.isShapeInserted&&(i="block"===s.textArea.style.display||"inline-block"===s.textArea.style.display,n=Pe({},s.activeObj,null,!0),s.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:!0}}),o=(e=this.setXYPoints(e)).x,e=e.y,a=this.findTargetObj(o,e,t),t||(this.upperContext.clearRect(0,0,s.upperCanvas.width,s.upperCanvas.height),a&&s.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:!0}})),i?(s.textArea.value=s.objColl[s.objColl.length-1].keyHistory,s.textArea.style.display="block",s.activeObj=n,je(r=this.getCurrentIndex())?s.objColl.pop():s.objColl.splice(r,1)):!a&&n.shape&&(s.activeObj=n,je(r=this.getCurrentIndex())||JSON.stringify(s.activeObj.activePoint)!==JSON.stringify(s.objColl[r].activePoint)?je(s.activeObj.currIndex)&&s.objColl.pop():s.objColl.splice(r,1))),a},tUt.prototype.isShapeTouch=function(e,t){var i,n,o,r,s=this.parent,a=!1;return"touchstart"!==e.type||s.togglePen||(s.activeObj&&"text"===s.activeObj.shape&&(this.timer=setTimeout(this.setTimer.bind(this),1e3,e)),i="block"===s.textArea.style.display||"inline-block"===s.textArea.style.display,n=Pe({},s.activeObj,null,!0),s.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:!0}}),o=(e=this.setXYPoints(e)).x,e=e.y,a=this.findTargetObj(o,e,t),t||this.upperContext.clearRect(0,0,s.upperCanvas.width,s.upperCanvas.height),i?(s.textArea.value=s.objColl[s.objColl.length-1].keyHistory,s.textArea.style.display="block",s.activeObj=n,je(r=this.getCurrentIndex())?s.objColl.pop():s.objColl.splice(r,1)):!a&&n.shape&&(0!==n.activePoint.width||0!==n.activePoint.height||"path"===n.shape&&0<n.pointColl.length)&&(s.activeObj=n,r=this.getCurrentIndex(),t||(je(r)||JSON.stringify(s.activeObj.activePoint)!==JSON.stringify(s.objColl[r].activePoint)?je(s.activeObj.currIndex)&&s.objColl.pop():s.objColl.splice(r,1)))),a},tUt.prototype.isFreehandDrawTouch=function(e,t){var i,n,o,r,s=this.parent,a=!1;return"touchstart"!==e.type||t||s.togglePen||(i="block"===s.textArea.style.display||"inline-block"===s.textArea.style.display,n=Pe({},s.activeObj,null,!0),s.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:!0}}),o=(e=this.setXYPoints(e)).x,e=e.y,this.setCursor(o,e),this.isFhdPoint&&(a=!0),i?(s.textArea.value=s.objColl[s.objColl.length-1].keyHistory,s.textArea.style.display="block",s.activeObj=n,je(r=this.getCurrentIndex())?s.objColl.pop():s.objColl.splice(r,1)):n.shape&&(s.activeObj=n,r=this.getCurrentIndex(),t||(je(r)||JSON.stringify(s.activeObj.activePoint)!==JSON.stringify(s.objColl[r].activePoint)?je(s.activeObj.currIndex)&&s.objColl.pop():s.objColl.splice(r,1)))),a},tUt.prototype.applyObj=function(e,t){var i,n,o,r,s=this.parent,a=!1;return(0!==s.activeObj.activePoint.width||0!==s.activeObj.activePoint.height)&&(r=(o=s.activeObj.activePoint).startX,i=o.startY,n=o.endX,o=o.endY,s.activeObj.shape&&-1<["rectangle","ellipse","line","arrow","path","image","text"].indexOf(s.activeObj.shape)?!(r-2*(r=s.activeObj.topLeftCircle.radius)<=e&&e<=n+2*r&&i-2*r<=t&&t<=o+2*r||"default"!==s.upperCanvas.style.cursor&&"grab"!==s.upperCanvas.style.cursor&&"crosshair"!==s.upperCanvas.style.cursor&&"pointer"!==s.upperCanvas.style.cursor&&"move"!==s.upperCanvas.style.cursor):a)},tUt.prototype.applyCurrShape=function(e){var t,i=this.parent,n=!1;return i.togglePen||(t=Pe({},i.activeObj,null,!0),this.isShapeInserted&&"text"===i.activeObj.shape&&e&&(this.isInitialTextEdited=!0,i.notify("draw",{prop:"setShapeTextInsert",onPropertyChange:!1,value:{bool:!0}})),"block"===i.textArea.style.display||"inline-block"===i.textArea.style.display?(e=Pe({},i.activeObj,null,!0),i.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:null}}),t=Pe({},i.objColl[i.objColl.length-1],null,!0),i.objColl.pop(),i.activeObj=Pe({},e,null,!0),i.textArea.value=t.keyHistory,i.textArea.style.display="block",(e=t.strokeSettings&&t.strokeSettings.strokeColor?"rgb"===t.strokeSettings.strokeColor.split("(")[0]?this.rgbToHex(parseFloat(t.strokeSettings.strokeColor.split("(")[1].split(",")[0]),parseFloat(t.strokeSettings.strokeColor.split("(")[1].split(",")[1]),parseFloat(t.strokeSettings.strokeColor.split("(")[1].split(",")[2]),parseFloat(t.strokeSettings.strokeColor.split("(")[1].split(",")[3])):t.strokeSettings.strokeColor:null)&&"#ffffff"===e&&(e="#fff"),this.tempActiveObj.strokeSettings&&this.tempActiveObj.strokeSettings.strokeColor&&"#ffffff"===this.tempActiveObj.strokeSettings.strokeColor&&(this.tempActiveObj.strokeSettings.strokeColor="#fff"),(t.keyHistory!==this.tempActiveObj.keyHistory||e&&e!==this.tempActiveObj.strokeSettings.strokeColor||t.textSettings&&t.textSettings.fontFamily!==this.tempActiveObj.textSettings.fontFamily||t.textSettings&&Math.round(t.textSettings.fontSize)!==Math.round(this.tempActiveObj.textSettings.fontSize)||t.textSettings&&Math.round(t.textSettings.fontRatio)!==Math.round(this.tempActiveObj.textSettings.fontRatio)||t.textSettings&&t.textSettings.bold!==this.tempActiveObj.textSettings.bold||t.textSettings&&t.textSettings.italic!==this.tempActiveObj.textSettings.italic||t.textSettings&&t.textSettings.underline!==this.tempActiveObj.textSettings.underline)&&(n=!0),this.isInitialTextEdited&&!n&&(this.isInitialTextEdited=!(n=!0))):(this.tempActiveObj.activePoint.height=Math.abs(this.tempActiveObj.activePoint.height),n=JSON.stringify(t)!==JSON.stringify(this.tempActiveObj))),n},tUt.prototype.canvasMouseDownHandler=function(e){var t,i=this.parent,n=(e.preventDefault(),e="mousedown"===e.type?(t=e.offsetX||e.pageX-i.lowerCanvas.offsetLeft,e.offsetY||e.pageY-i.lowerCanvas.offsetTop):(t=e.touches[0].clientX||e.touches[0].pageX-i.lowerCanvas.offsetLeft,e.touches[0].clientY||e.touches[0].pageY-i.lowerCanvas.offsetTop),i.lowerCanvas.getBoundingClientRect()),n=(t-=n.left,e-=n.top,this.panDown={x:t,y:e},{tempPanMove:null});i.notify("transform",{prop:"getTempPanMove",onPropertyChange:!1,value:{obj:n}}),je(n.tempPanMove)&&i.notify("transform",{prop:"setTempPanMove",onPropertyChange:!1,value:{point:{x:t,y:e}}})},tUt.prototype.canvasMouseMoveHandler=function(e){var t,i=this.parent,n={bool:null};i.notify("toolbar",{prop:"getFrameToolbar",onPropertyChange:!1,value:{obj:n}}),i.isResize||n.bool?i.upperCanvas.style.cursor="default":(this.dragCanvas?i.lowerCanvas.style.cursor="grab":(this.dragCanvas=i.togglePan=!1,i.lowerCanvas.style.cursor=i.upperCanvas.style.cursor=i.cursor="default"),n="mousemove"===e.type?(t=e.offsetX,e.offsetY):(t=e.touches[0].clientX||e.touches[0].pageX-i.lowerCanvas.offsetLeft,e.touches[0].clientY||e.touches[0].pageY-i.lowerCanvas.offsetTop),e=i.lowerCanvas.getBoundingClientRect(),t-=e.left,n-=e.top,i.notify("transform",{prop:"setPanMove",onPropertyChange:!1,value:{point:{x:t,y:n}}}),this.panDown&&i.togglePan&&this.dragCanvas&&((i.isCropTab||i.activeObj.shape)&&(i.notify("draw",{prop:"setStraightenActObj",value:{activeObj:null}}),i.notify("freehand-draw",{prop:"resetStraightenPoint"})),i.notify("transform",{prop:"drawPannedImage",onPropertyChange:!1,value:{xDiff:null,yDiff:null}})))},tUt.prototype.canvasMouseUpHandler=function(e){var t=this.parent,e=(e.preventDefault(),{panMove:null});t.notify("transform",{prop:"getPanMove",onPropertyChange:!1,value:{obj:e}}),t.togglePan&&this.panDown&&e.panMove&&t.togglePan&&this.dragCanvas&&(this.panDown=null,t.notify("transform",{prop:"setPanMove",onPropertyChange:!1,value:{point:null}})),t.notify("transform",{prop:"setTempPanMove",onPropertyChange:!1,value:{point:null}}),"path"!==this.currentDrawingShape&&(t.currObjType.isDragging=!1)},tUt.prototype.touchStartHandler=function(e){e.preventDefault();var t=this.parent;if(0===this.touchTime)this.touchTime=(new Date).getTime();else if((new Date).getTime()-this.touchTime<400){this.isTouchDblClick=!0;var i=t.isShapeDrawing;if(t.notify("shape",{prop:"stopPathDrawing",onPropertyChange:!1,value:{e:e,isApply:null}}),this.isTouchDblClick=!1,this.touchTime=0,i!==t.isShapeDrawing&&t.activeObj.shape&&"path"===t.activeObj.shape)return}else this.touchTime=(new Date).getTime();2===e.touches.length?this.isFirstMove=!0:this.mouseDownEventHandler(e),E.add(t.lowerCanvas,"touchend",this.mouseUpEventHandler,this),E.add(t.lowerCanvas,"touchmove",this.mouseMoveEventHandler,this),E.add(t.upperCanvas,"touchend",this.mouseUpEventHandler,this),E.add(t.upperCanvas,"touchmove",this.mouseMoveEventHandler,this)},tUt.prototype.unwireEvent=function(){var e=this.parent;E.remove(e.lowerCanvas,"touchend",this.mouseUpEventHandler),E.remove(e.lowerCanvas,"touchmove",this.mouseMoveEventHandler),E.remove(e.upperCanvas,"touchend",this.mouseUpEventHandler),E.remove(e.upperCanvas,"touchmove",this.mouseMoveEventHandler)},tUt.prototype.keyDownEventHandler=function(e){var t=this.parent,i=(!e.ctrlKey||"+"!==e.key&&"-"!==e.key||e.preventDefault(),{fileName:"",fileType:null}),n=(t.notify("draw",{prop:"getFileName",onPropertyChange:!1,value:{obj:i}}),{fileName:i.fileName,fileType:i.fileType,cancel:!1});switch(e.key){case e.ctrlKey&&"s":t.trigger("beforeSave",n),this.beforeSaveEvent(n,e);break;case e.ctrlKey&&"z":t.allowUndoRedo&&(t.noPushUndo=!1,(t.togglePen||t.drawingShape)&&(t.okBtn(),t.drawingShape=null),t.notify("undo-redo",{prop:"call-undo"}));break;case e.ctrlKey&&"y":t.allowUndoRedo&&(t.noPushUndo=!1,(t.togglePen||t.drawingShape)&&(t.okBtn(),t.drawingShape=null),t.notify("undo-redo",{prop:"call-redo"}));break;case e.ctrlKey&&"+":(t.zoomSettings.zoomTrigger&xUt.Commands)===xUt.Commands&&(this.zoomType="Commands",t.isZoomBtnClick=!0,t.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:.1,zoomPoint:null},isResize:null}),t.notify("draw",{prop:"redrawDownScale"}),(t.isCropTab||t.activeObj.shape)&&(t.notify("draw",{prop:"setStraightenActObj",value:{activeObj:null}}),t.notify("freehand-draw",{prop:"resetStraightenPoint"})),t.isStraightening)&&(t.notify("draw",{prop:"resetStraightenDestPoints"}),t.notify("draw",{prop:"setDestForStraighten"}));break;case e.ctrlKey&&"-":(t.zoomSettings.zoomTrigger&xUt.Commands)===xUt.Commands&&(this.zoomType="Commands",t.isZoomBtnClick=!0,t.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:-.1,zoomPoint:null},isResize:null}),t.notify("draw",{prop:"redrawDownScale"}),(t.isCropTab||t.activeObj.shape)&&(t.notify("draw",{prop:"setStraightenActObj",value:{activeObj:null}}),t.notify("freehand-draw",{prop:"resetStraightenPoint"})),t.isStraightening)&&(t.notify("draw",{prop:"resetStraightenDestPoints"}),t.notify("draw",{prop:"setDestForStraighten"}));break;case"Delete":this.deleteItem();break;case"Escape":t.notify("draw",{prop:"performCancel",value:{isContextualToolbar:null,isFinalCancel:!0}});break;case"Enter":this.performEnterAction(e);break;case"Tab":this.performTabAction();break;default:!F.isDevice||"block"!==t.textArea.style.display&&"inline-block"!==t.textArea.style.display||setTimeout(this.textKeyDown.bind(this),1,e)}},tUt.prototype.performEnterAction=function(e){var t,i,n,o,r,s=this.parent;s.isResize?(t=!!((t=e.target).id.indexOf("aspectratio")||-1<t.id.indexOf("non-aspectratio")),this.isValueUpdated()&&(i=this.getNumTextValue(),o=s.element.querySelector("#"+s.element.id+"_aspectratio"),r=s.element.querySelector(".e-ie-toolbar-aspect-ratio-btn"),i&&i.x&&i.y&&(o||r&&!r.classList.contains("e-hidden")?s.notify("transform",{prop:"resize",value:{width:i.x,height:null,isAspectRatio:!0}}):s.notify("transform",{prop:"resize",value:{width:i.x,height:i.y,isAspectRatio:!1}})),r=s.element.querySelector("#"+s.element.id+"_resizeHeight"),i=s.element.querySelector("#"+s.element.id+"_resizeWidth"),je(o)&&(r&&(n=At(r,"numerictextbox"),r)&&""===r.value&&(n.value=parseFloat(n.placeholder),r.value=n.placeholder+"px"),i)&&(n=At(i,"numerictextbox"),i)&&""===i.value&&(n.value=parseFloat(n.placeholder),i.value=n.placeholder+"px"),s.notify("draw",{prop:"redrawDownScale"})),t&&this.focusRatioBtn()):e.target.classList.contains("e-upload")?(o=s.element.querySelector(".e-image-upload"))&&o.querySelector(".e-tbar-btn")&&o.querySelector(".e-tbar-btn").click():e.target.classList.contains("filter-wrapper")?e.target.parentElement.click():(r=void 0,s.activeObj.shape&&(r=s.activeObj.shape.split("-")),e&&this.isKeyBoardCrop(e)&&s.activeObj.horTopLine&&s.activeObj.shape&&"crop"===r[0]&&s.crop())},tUt.prototype.focusRatioBtn=function(){var e=this.parent.element.id;this.parent.isKBDNavigation&&setTimeout(function(){document.getElementById(e+"_aspectratio")?document.getElementById(e+"_aspectratio").focus():document.getElementById(e+"_nonaspectratio")&&document.getElementById(e+"_nonaspectratio").focus()},50)},tUt.prototype.isKeyBoardCrop=function(e){var t=!1,e=e.target;return t=e.id!==this.parent.element.id+"_ok"&&""!==e.id?t:!0},tUt.prototype.beforeSaveEvent=function(e,t){var i=this.parent;e.cancel||i.notify("export",{prop:"export",onPropertyChange:!1,value:{type:e.fileType,fileName:e.fileName}}),t.preventDefault(),t.stopImmediatePropagation()},tUt.prototype.handleScroll=function(e){this.mouseWheel++;var t,i,n=this.parent,o=!1,r=("mousewheel"===e.type&&(t=e.clientX,i=e.clientY),n.lowerCanvas.getBoundingClientRect());t-=r.left,i-=r.top,t>n.img.destLeft&&t<n.img.destLeft+n.img.destWidth&&i>n.img.destTop&&i<n.img.destTop+n.img.destHeight&&(o=!0),2===this.mouseWheel?!(this.mouseWheel=0)===e.ctrlKey&&o&&e.preventDefault():(e.stopPropagation(),!0===e.ctrlKey&&o&&(e.preventDefault(),!n.isCropTab&&n.activeObj.shape&&"crop"!==n.activeObj.shape.split("-")[0]&&(n.okBtn(null,!0),n.notify("toolbar",{prop:"close-contextual-toolbar",onPropertyChange:!1})),r="","mousewheel"===e.type&&(n.zoomSettings.zoomTrigger&xUt.MouseWheel)===xUt.MouseWheel&&(this.zoomType="MouseWheel",r=0<e.wheelDelta?"zoomIn":"zoomOut"),""!==r)&&(n.isZoomBtnClick=!0,n.notify("draw",{prop:"performPointZoom",onPropertyChange:!1,value:{x:t,y:i,type:r,isResize:null}}),n.notify("draw",{prop:"redrawDownScale"}),(n.isCropTab||n.activeObj.shape)&&(n.notify("draw",{prop:"setStraightenActObj",value:{activeObj:null}}),n.notify("freehand-draw",{prop:"resetStraightenPoint"})),n.isStraightening)&&(n.notify("draw",{prop:"resetStraightenDestPoints"}),n.notify("draw",{prop:"setDestForStraighten"})))},tUt.prototype.textKeyDown=function(e){var t=this.parent;0===t.activeObj.rotatedAngle&&("\r"===String.fromCharCode(e.which)&&(this.textRow+=1),t.textArea.setAttribute("rows",this.textRow.toString()),t.textArea.style.height="auto",t.textArea.style.height=t.textArea.scrollHeight+"px",t.notify("shape",{prop:"setTextBoxWidth",onPropertyChange:!1,value:{e:e}}),F.isDevice&&(t.textArea.style.width=parseFloat(t.textArea.style.width)+t.textArea.style.fontSize+"px"),e=t.textArea.value.split("\n"),this.textRow=e.length,t.textArea.setAttribute("rows",this.textRow.toString()),this.isInitialTextEdited=!1)},tUt.prototype.clearSelection=function(e){var t=this.parent;!t.disabled&&t.isImageLoaded&&(e?t.notify("draw",{prop:"performCancel",value:{isContextualToolbar:null}}):(t.togglePen=!1,t.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.dragElement="",this.dragPoint.startX=this.dragPoint.startY=this.dragPoint.endX=this.dragPoint.endY=0,t.currObjType.shape="",this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),t.currObjType.isActiveObj=!0,t.currObjType.isCustomCrop=!1,t.upperCanvas.style.cursor=t.cursor="default"))},tUt.prototype.setDragDirection=function(e,t){var i=this.parent,n=i.activeObj.activePoint;i.img.destWidth>i.img.destHeight?(n.startX=this.dragPoint.startX=e/2-t/2+7.5,n.startY=this.dragPoint.startY=t/2-t/2+7.5,n.endX=e/2+t/2-7.5,n.endY=t/2+t/2-7.5):(n.startY=this.dragPoint.startX=t/2-e/2+7.5,n.endY=t/2+e/2-7.5,n.startX=this.dragPoint.startX=7.5,n.endX=e-7.5)},tUt.prototype.calcShapeRatio=function(e,t,i,n){for(var o=this.parent,r=o.activeObj.activePoint,s=n<=i?i:n,a=s*(e/t),l=s,h=this.getScale(a,i),d=[],e=o.img,t=e.destLeft,s=e.destTop,p=e.destWidth,e=e.destHeight,c=0;c<2;c++)d.push(0===c?a*h:l*h);for(var a=d[0],l=d[1],u=this.getScale(l,n),g=[],c=0;c<2;c++)g.push(0===c?a*u:l*u);l=g[1],r.width=a=g[0],r.height=l,r.startX=7.5+(this.dragPoint.startX=(i-a)/2),r.startY=7.5+(this.dragPoint.startY=(n-l)/2),r.endX=r.startX+r.width,r.endY=r.startY+r.height,r.startX<t&&t+p>o.lowerCanvas.clientWidth&&(r.startX=t,r.endX=r.startX+a-7.5),r.startY<s&&s+e>o.lowerCanvas.clientHeight&&(r.startY=s,r.endY=r.startY+l-7.5),r.width=r.endX-r.startX,r.height=r.endY-r.startY},tUt.prototype.getScale=function(e,t){return t<e?t/e:1},tUt.prototype.findTarget=function(e,t,i){var n=this.parent;if("mousedown"===i.toLowerCase()||"touchstart"===i.toLowerCase()){var o=!1;n.activeObj.shape&&"crop"===n.activeObj.shape.split("-")[0]&&(o=!0),this.findTargetObj(e,t,o),this.updateCursorStyles(e,t,i)}else{var o=n.activeObj,r=o.topLeftCircle,s=o.topCenterCircle,a=o.topRightCircle,l=o.centerLeftCircle,h=o.centerRightCircle,d=o.bottomLeftCircle,p=o.bottomCenterCircle,c=o.bottomRightCircle;switch(this.dragElement.toLowerCase()){case"nw-resize":r.startX=e,r.startY=t;break;case"n-resize":s.startX=e,s.startY=t;break;case"ne-resize":a.startX=e,a.startY=t;break;case"w-resize":l.startX=e,l.startY=t;break;case"e-resize":h.startX=e,h.startY=t;break;case"sw-resize":d.startX=e,d.startY=t;break;case"s-resize":p.startX=e,p.startY=t;break;case"se-resize":c.startX=e,c.startY=t;break;default:this.dragPoint.startX&&this.dragPoint.startY&&(this.previousPoint.x=this.dragPoint.endX,this.previousPoint.y=this.dragPoint.endY,this.dragPoint.endX=e,this.dragPoint.endY=t)}}},tUt.prototype.findTargetObj=function(e,t,i){var n=this.parent,o=!1;if(0!==n.objColl.length&&!n.currObjType.isCustomCrop&&!i){for(var r,s,a=0,l=void 0,h=0;h<n.objColl.length;h++){var d=n.upperCanvas.style.cursor,p=(this.setCursor(e,t),Pe({},n.objColl[h],{},!0)),c=p.topLeftCircle.radius;if("line"===p.shape||"arrow"===p.shape){for(var u=0;u<p.pointColl.length;u++)if(e>=p.pointColl[u].x-2*c&&e<=p.pointColl[u].x+2*c&&t>=p.pointColl[u].y-2*c&&t<=p.pointColl[u].y+2*c){if(this.tempActiveObj&&this.tempActiveObj.activePoint&&JSON.stringify(this.tempActiveObj.activePoint)===JSON.stringify(p.activePoint)){l=h;break}this.isTouch||"move"===n.cursor||"grab"===n.cursor||this.isShapeInserted?(0===a||a<p.order)&&(a=p.order,l=h):n.objColl[h].currIndex===this.tempActiveObj.currIndex&&(l=h);break}}else if("path"===p.shape){var g=this.setCursorForPath(p,e,t,n.upperCanvas);if("default"!==g&&"grab"!==g){if(this.tempActiveObj&&this.tempActiveObj.activePoint&&JSON.stringify(this.tempActiveObj.activePoint)===JSON.stringify(p.activePoint)){l=h;break}this.isTouch||"move"===n.cursor||"grab"===n.cursor||this.isShapeInserted?(0===a||a<p.order)&&(a=p.order,l=h):n.objColl[h].currIndex===this.tempActiveObj.currIndex&&(l=h)}}else if(0!==p.rotatedAngle){g=this.setCursorForRotatedObject(p,e,t,n.upperCanvas);if("default"!==g&&"grab"!==g){if(this.tempActiveObj&&this.tempActiveObj.activePoint&&JSON.stringify(this.tempActiveObj.activePoint)===JSON.stringify(p.activePoint)){l=h;break}this.isTouch||"move"===n.cursor||"grab"===n.cursor||this.isShapeInserted?(0===a||a<p.order&&("redact"!==p.shape||"redact"===n.drawingShape))&&(a=p.order,l=h):n.objColl[h].currIndex===this.tempActiveObj.currIndex&&(l=h)}}else{var m=this.getTransRotationPoint(p);if(e>=p.activePoint.startX-2*c&&e<=p.activePoint.endX+2*c&&t>=p.activePoint.startY-2*c&&t<=p.activePoint.endY+2*c||m&&e>=m.x-2*c&&e<=m.x+2*c&&t>=m.y-2*c&&t<=m.y+2*c){if(this.tempActiveObj&&this.tempActiveObj.activePoint&&JSON.stringify(this.tempActiveObj.activePoint)===JSON.stringify(p.activePoint)){l=h;break}this.isTouch||"move"===d||"grabbing"===d||this.isShapeInserted||"move"===n.cursor||"grabbing"===n.cursor?(0===a||a<p.order&&("redact"!==p.shape||"redact"===n.drawingShape))&&(a=p.order,l=h):n.objColl[h].currIndex===this.tempActiveObj.currIndex&&(l=h)}}}o=je(l)?(n.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),!1):(this.tempObjColl=Pe([],n.objColl,[],!0),n.currObjType.isCustomCrop=!1,n.activeObj=Pe({},n.objColl[l],{},!0),i=Pe({},n.objColl[l],{},!0),n.objColl.splice(l,1),0===n.transform.degree?(r=this.lowerContext.filter,this.lowerContext.clearRect(0,0,n.lowerCanvas.width,n.lowerCanvas.height),n.notify("draw",{prop:"drawImage",onPropertyChange:!1}),this.lowerContext.filter="none",n.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"iterate",pen:"iterate",isPreventApply:null}}),n.activeObj=Pe({},r,{},!0),this.lowerContext.filter=r,this.getCurrentFlipState()):(r=Pe({},n.panPoint.totalPannedInternalPoint,{},!0),s={startX:n.img.destLeft,startY:n.img.destTop,width:n.img.destWidth,height:n.img.destHeight},n.notify("draw",{prop:"callUpdateCurrTransState",onPropertyChange:!1}),n.panPoint.totalPannedInternalPoint=r,n.img.destLeft=s.startX,n.img.destTop=s.startY,n.img.destWidth=s.width,n.img.destHeight=s.height,n.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"iterate",pen:"iterate",isPreventApply:null}})),n.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),(n.currSelectionPoint&&"crop-circle"===n.currSelectionPoint.shape||n.isCircleCrop)&&n.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),n.activeObj=Pe({},i,{},!0),this.setActivePoint(),n.activeObj=Pe({},i,{},!0),r=Pe({},n.activeObj.strokeSettings,{},!0),n.notify("draw",{prop:"setTempStrokeSettings",onPropertyChange:!1,value:{tempStrokeSettings:r}}),s=Pe({},n.activeObj.textSettings,{},!0),n.notify("draw",{prop:"setTempTextSettings",onPropertyChange:!1,value:{tempTextSettings:s}}),r={cancel:!1,action:"select",previousShapeSettings:i=this.updatePrevShapeSettings(),currentShapeSettings:i,allowShapeOverflow:this.allowOutofBound()},"line"!==n.activeObj.shape&&"arrow"!==n.activeObj.shape||(r.currentShapeSettings.width=n.activeObj.activePoint.endX-n.activeObj.activePoint.startX,r.currentShapeSettings.height=n.activeObj.activePoint.endY-n.activeObj.activePoint.startY),s=void(this.isCropSelection=!1),void 0!==(s=void 0!==n.activeObj.shape?n.activeObj.shape.split("-"):s)&&"crop"===s[0]&&(this.isCropSelection=!0),this.isCropSelection||"redact"===n.activeObj.shape?(this.isMouseDown?r.action="resize-start":this.isMouseUp&&(r.action="resize-end"),i={action:r.action,previousSelectionSettings:{type:n.getSelectionType(n.activeObj.shape),startX:r.previousShapeSettings.startX,startY:r.previousShapeSettings.startY,width:r.previousShapeSettings.width,height:r.previousShapeSettings.height},currentSelectionSettings:{type:n.getSelectionType(n.activeObj.shape),startX:r.currentShapeSettings.startX,startY:r.currentShapeSettings.startY,width:r.currentShapeSettings.width,height:r.currentShapeSettings.height}},n.trigger("selectionChanging",i),n.editCompleteArgs=i,r.currentShapeSettings.startX=i.currentSelectionSettings.startX,r.currentShapeSettings.startY=i.currentSelectionSettings.startY,r.currentShapeSettings.width=i.currentSelectionSettings.width,r.currentShapeSettings.height=i.currentSelectionSettings.height,this.shapeEvent(r)):(n.trigger("shapeChanging",r),this.shapeEvent(r),n.editCompleteArgs=r),!0)}return o},tUt.prototype.shapeEvent=function(e){var t=this.parent;t.notify("shape",{prop:"updateShapeChangeEventArgs",onPropertyChange:!1,value:{shapeSettings:e.currentShapeSettings,allowShapeOverflow:e.allowShapeOverflow}}),t.activeObj.activePoint&&(t.notify("draw",{prop:"getPrevActObj",onPropertyChange:!(e={prevActObj:null}),value:{obj:e}}),je(e.prevActObj)&&t.notify("draw",{prop:"setPrevActObj",onPropertyChange:!1,value:{prevActObj:Pe({},t.activeObj,{},!0)}}),"image"!==t.activeObj.shape||this.isImageClarity||(this.upgradeImageQuality(),this.isImageClarity=!0),t.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:t.activeObj,isCropRatio:null,points:null,isPreventDrag:!0,saveContext:null,isPreventSelection:!0}}),this.isShapeInserted||(this.isPreventDragging=this.isShapeDragOut()))},tUt.prototype.upgradeImageQuality=function(){var e,t,i,n=this.parent;n.activeObj.imageCanvas&&(e=Pe({},n.activeObj,null,!0),t=n.activeObj.imageCanvas.getContext("2d"),n.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!(i={width:0,height:0}),value:{width:n.activeObj.imageElement.width,height:n.activeObj.imageElement.height,obj:i,isImgShape:null}}),n.notify("shape",{prop:"updateObj",onPropertyChange:!1,value:{dimObj:i,x:null,y:null}}),t.clearRect(0,0,n.activeObj.imageCanvas.width,n.activeObj.imageCanvas.height),this.applyTransformToImg(t),n.activeObj=e)},tUt.prototype.applyTransformToImg=function(e){var t=this.parent;t.activeObj.isHorImageFlip&&t.activeObj.isVerImageFlip?(t.activeObj.isHorImageFlip=t.activeObj.isVerImageFlip=!1,t.notify("draw",{prop:"downScaleImgCanvas",onPropertyChange:!1,value:{ctx:e,isImgAnnotation:!0,isHFlip:!0,isVFlip:!0}})):t.activeObj.isHorImageFlip?(t.activeObj.isHorImageFlip=!1,t.notify("draw",{prop:"downScaleImgCanvas",onPropertyChange:!1,value:{ctx:e,isImgAnnotation:!0,isHFlip:!0,isVFlip:!1}})):t.activeObj.isVerImageFlip?(t.activeObj.isVerImageFlip=!1,t.notify("draw",{prop:"downScaleImgCanvas",onPropertyChange:!1,value:{ctx:e,isImgAnnotation:!0,isHFlip:!1,isVFlip:!0}})):t.notify("draw",{prop:"downScaleImgCanvas",onPropertyChange:!1,value:{ctx:e,isImgAnnotation:!0,isHFlip:!1,isVFlip:!1}})},tUt.prototype.targetTouches=function(e){var t=this.parent.lowerCanvas.getBoundingClientRect();return[{x:e[0].pageX-t.left,y:e[0].pageY-t.top},{x:e[1].pageX-t.left,y:e[1].pageY-t.top}]},tUt.prototype.calculateScale=function(e,t){e=this.getDistance(e[0],e[1]);return this.getDistance(t[0],t[1])/e},tUt.prototype.getDistance=function(e,t){var i=0,n=0;return e&&t&&(i=e.x-t.x,n=e.y-t.y),Math.sqrt(i*i+n*n)},tUt.prototype.redrawShape=function(e,t){for(var i,n=this.parent,o=0,r=n.objColl.length;o<r;o++)if(JSON.stringify(e)===JSON.stringify(n.objColl[o])){n.objColl.splice(o,1),e.shape&&"none"===n.textArea.style.display&&(i=Pe({},e,{},!0),n.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.lowerContext.clearRect(0,0,n.lowerCanvas.width,n.lowerCanvas.height),n.notify("draw",{prop:"render-image",value:{isMouseWheel:null}}),0<n.rotateFlipColl.length&&(0!==n.panPoint.totalPannedClientPoint.x||0!==n.panPoint.totalPannedClientPoint.y)&&n.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1}),e=n.activeObj=i);break}"path"===e.shape&&0===e.pointColl.length||"path"!==e.shape&&0===e.activePoint.width&&0===e.activePoint.height||(this.upperContext.clearRect(0,0,n.upperCanvas.width,n.upperCanvas.height),this.isPreventDragging?(n.activeObj.activePoint.startX>n.img.destLeft&&(this.isPreventDragging=!1),t&&n.activeObj.rotatedAngle):t&&0!==n.activeObj.rotatedAngle||"redact"===n.activeObj.shape&&(this.lowerContext.clearRect(0,0,n.lowerCanvas.width,n.lowerCanvas.height),n.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1}),n.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}})),n.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:null,isCropRatio:null,points:null,isPreventDrag:!0,saveContext:null,isPreventSelection:null}}))},tUt.prototype.setTimer=function(e){var t=this.parent;10<this.timer&&(clearTimeout(this.timer),this.timer=0,t.notify("shape",{prop:"findTextTarget",onPropertyChange:!1,value:{e:e}}),F.isDevice)&&this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height)},tUt.prototype.applyCurrActObj=function(e,t){var i,n,o,r,s,a,l=this.parent,h=!1,d=Pe({},l.activeObj,{},!0);je(d.activePoint)||(o=(i=d.activePoint).startX,a=i.startY,s=i.endX,i=i.endY,n=d.topLeftCircle?d.topLeftCircle.radius:0,e>=Math.floor(o)&&e<=Math.ceil(s)&&t>=Math.floor(a)&&t<=Math.ceil(i)?h=!0:0!==n&&e>=Math.floor(o)-n&&e<=Math.ceil(s)+n&&t>=Math.floor(a)-n&&t<=Math.ceil(i)+n?(h=!0,this.tempActiveObj={activePoint:{startX:0,startY:0,endX:0,endY:0,width:0,height:0},flipObjColl:[],triangle:[],triangleRatio:[]}):"text"!==d.shape&&"image"!==d.shape||""===this.dragElement?"line"===d.shape||"arrow"===d.shape?(n={x:o<s?o:s,y:a<i?a:i},o={x:s<o?o:s,y:i<a?a:i},(e>=Math.floor(n.x)-5&&e<=Math.ceil(o.x)+5&&t>=Math.floor(n.y)-5&&t<=Math.ceil(o.y)+5||l.activeObj.preventShapeDragOut)&&(h=!0)):"path"===d.shape?"move"===(r=this.setCursorForPath(d,e,t,l.upperCanvas))&&(h=!0):"grabbing"===this.dragElement?h=!0:0!==d.rotatedAngle?("default"!==(r=this.setCursorForRotatedObject(d,e,t,l.upperCanvas))&&"grab"!==r||"n-resize"===this.dragElement||"e-resize"===this.dragElement||"s-resize"===this.dragElement||"w-resize"===this.dragElement)&&(h=!0):"block"!==l.textArea.style.display&&"inline-block"!==l.textArea.style.display||(h=!0):h=!0,h)||(je(l.activeObj.currIndex)&&(s={id:"shape_"+(l.objColl.length+1)},l.notify("shape",{prop:"getNewShapeId",onPropertyChange:!1,value:{obj:s}}),l.activeObj.currIndex=s.id),l.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),void 0===l.activeObj.horTopLine||0===l.activeObj.horTopLine.startX||0===l.activeObj.horTopLine.endX||l.currObjType.isCustomCrop||""===l.currObjType.shape||0<l.objColl.length&&JSON.stringify(l.objColl[l.objColl.length-1].activePoint)!==JSON.stringify(l.activeObj.activePoint)&&l.objColl.push(Pe({},l.activeObj,{},!0)),-1<["rectangle","ellipse","line","arrow","path","text","image"].indexOf(l.activeObj.shape)&&(a=this.lowerContext.filter,this.lowerContext.filter="brightness(1) contrast(100%) hue-rotate(0deg) saturate(100%) opacity(1) blur(0px) sepia(0%) grayscale(0%) invert(0%)",l.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),this.lowerContext.filter=a,l.activeObj.shape&&l.notify("shape",{prop:"apply",onPropertyChange:!1,value:{shape:null,obj:null,canvas:null}}),l.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),l.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.upperContext}}),l.isCircleCrop)&&l.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),l.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1}))},tUt.prototype.getCurrentFlipState=function(){var e,t=this.parent;0!==t.rotateFlipColl.length?(e=Pe({},t.panPoint.totalPannedInternalPoint,{},!0),t.notify("draw",{prop:"callUpdateCurrTransState",onPropertyChange:!1}),t.panPoint.totalPannedInternalPoint=e):t.notify("draw",{prop:"callUpdateCurrTransState",onPropertyChange:!1})},tUt.prototype.setTextBoxStylesToActObj=function(){var e=this.parent;e.activeObj.textSettings.fontFamily=e.textArea.style.fontFamily,e.activeObj.strokeSettings.strokeColor=""!==e.textArea.style.color&&e.textArea.style.color.split("(")[1]&&e.textArea.style.color.split("(")[1].split(",")[0]&&e.textArea.style.color.split("(")[1].split(",")[1]&&e.textArea.style.color.split("(")[1].split(",")[2]&&e.textArea.style.color.split("(")[1].split(",")[3]?this.rgbToHex(parseFloat(e.textArea.style.color.split("(")[1].split(",")[0]),parseFloat(e.textArea.style.color.split("(")[1].split(",")[1]),parseFloat(e.textArea.style.color.split("(")[1].split(",")[2]),parseFloat(e.textArea.style.color.split("(")[1].split(",")[3])):e.textArea.style.color,e.activeObj.strokeSettings.fillColor=""!==e.textArea.style.backgroundColor&&e.textArea.style.backgroundColor.split("(")[1]&&e.textArea.style.backgroundColor.split("(")[1].split(",")[0]&&e.textArea.style.backgroundColor.split("(")[1].split(",")[1]&&e.textArea.style.backgroundColor.split("(")[1].split(",")[2]&&e.textArea.style.backgroundColor.split("(")[1].split(",")[3]?this.rgbToHex(parseFloat(e.textArea.style.backgroundColor.split("(")[1].split(",")[0]),parseFloat(e.textArea.style.backgroundColor.split("(")[1].split(",")[1]),parseFloat(e.textArea.style.backgroundColor.split("(")[1].split(",")[2]),parseFloat(e.textArea.style.backgroundColor.split("(")[1].split(",")[3])):e.textArea.style.backgroundColor,e.activeObj.strokeSettings.outlineColor=""!==e.textArea.style.textShadow&&e.textArea.style.textShadow.split("(")[1]&&e.textArea.style.textShadow.split("(")[1].split(",")[0]&&e.textArea.style.textShadow.split("(")[1].split(",")[1]&&e.textArea.style.textShadow.split("(")[1].split(",")[2]&&e.textArea.style.textShadow.split("(")[1].split(",")[3]?this.rgbToHex(parseFloat(e.textArea.style.textShadow.split("(")[1].split(",")[0]),parseFloat(e.textArea.style.textShadow.split("(")[1].split(",")[1]),parseFloat(e.textArea.style.textShadow.split("(")[1].split(",")[2]),parseFloat(e.textArea.style.textShadow.split("(")[1].split(",")[3])):e.textArea.style.textShadow.match(/^(\s*[\w#]+)\s/)?e.textArea.style.textShadow.match(/^(\s*[\w#]+)\s/)[1].trim():e.textArea.style.textShadow,"bold"===e.textArea.style.fontWeight?e.activeObj.textSettings.bold=!0:e.activeObj.textSettings.bold=!1,"italic"===e.textArea.style.fontStyle?e.activeObj.textSettings.italic=!0:e.activeObj.textSettings.italic=!1,e.activeObj.textSettings.fontSize=parseFloat(e.textArea.style.fontSize)},tUt.prototype.rgbToHex=function(e,t,i,n){e=Math.max(0,Math.min(255,Math.round(e))),t=Math.max(0,Math.min(255,Math.round(t))),i=Math.max(0,Math.min(255,Math.round(i))),n=Math.max(0,Math.min(1,n));e=this.padLeft(e.toString(16),2,"0"),t=this.padLeft(t.toString(16),2,"0"),i=this.padLeft(i.toString(16),2,"0"),n=this.padLeft(Math.round(255*n).toString(16),2,"0"),e=isNaN(Number(n))?"#"+e+t+i:"#"+e+t+i+n;return e},tUt.prototype.padLeft=function(e,t,i){for(;e.length<t;)e=i+e;return e},tUt.prototype.deleteItem=function(){var e=this.parent;if(this.isFhdEditing){this.updateFreehandDrawColorChange();var t=Pe({},e.cropObj,{},!0),i={currObj:{}};e.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:i}});(l=i.currObj).objColl=Pe([],e.objColl,[],!0),l.pointColl=Pe([],e.pointColl,[],!0),l.afterCropActions=Pe([],e.afterCropActions,[],!0);var n={selPointColl:null},o=(e.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:n}}),l.selPointColl=Pe([],n.selPointColl,[],!0),{freehandDrawSelectedId:null});e.notify("freehand-draw",{prop:"getFreehandDrawSelectedId",onPropertyChange:!1,value:{obj:o}}),e.notify("freehand-draw",{prop:"deleteFhd",value:{id:o.freehandDrawSelectedId}}),e.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"deleteFreehandDrawing",previousObj:l,previousObjColl:this.tempObjColl,previousPointColl:l.pointColl,previousSelPointColl:l.selPointColl,previousCropObj:t,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),e.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}),e.notify("freehand-draw",{prop:"resetFreehandDrawSelectedId"})}else if("none"===e.textArea.style.display){o={prevActObj:null};if(e.notify("draw",{prop:"getPrevActObj",onPropertyChange:!1,value:{obj:o}}),o.prevActObj&&(o.prevActObj.activePoint.width=Math.abs(o.prevActObj.activePoint.width),o.prevActObj.activePoint.height=Math.abs(o.prevActObj.activePoint.height)),o.prevActObj&&JSON.stringify(o.prevActObj)!==JSON.stringify(e.activeObj)){var r=e.activeObj.currIndex;e.notify("draw",{prop:"performCancel",value:{isContextualToolbar:null,isFinalCancel:!0}});for(var s=0,a=e.objColl.length;s<a;s++)if(e.objColl[s].currIndex===r){e.objColl.splice(s,1),e.notify("draw",{prop:"render-image",value:{isMouseWheel:null}});break}}var l,i={isNewPath:null};e.notify("draw",{prop:"getNewPath",value:{obj:i}}),i.isNewPath?(e.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.upperContext.clearRect(0,0,e.upperCanvas.width,e.upperCanvas.height),e.notify("draw",{prop:"render-image",value:{isMouseWheel:null}}),e.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1})):e.activeObj.shape&&(e.objColl.push(e.activeObj),t=Pe({},e.cropObj,{},!0),e.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(o={currObj:{}}),value:{object:o}}),(l=o.currObj).objColl=Pe([],e.objColl,[],!0),l.pointColl=Pe([],e.pointColl,[],!0),l.afterCropActions=Pe([],e.afterCropActions,[],!0),e.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(n={selPointColl:null}),value:{obj:n}}),l.selPointColl=Pe([],n.selPointColl,[],!0),e.objColl.pop(),i=this.updatePrevShapeSettings(),e.notify("shape",{prop:"setKeyHistory",onPropertyChange:!(o={cancel:!1,action:"delete",previousShapeSettings:i,currentShapeSettings:null}),value:{keyHistory:""}}),e.clearSelection(),e.trigger("shapeChanging",o),e.editCompleteArgs=o,e.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1}),e.notify("draw",{prop:"render-image",value:{isMouseWheel:null}}),je(l.objColl[l.objColl.length-1].currIndex)||(e.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"deleteObj",previousObj:l,previousObjColl:this.tempObjColl,previousPointColl:l.pointColl,previousSelPointColl:l.selPointColl,previousCropObj:t,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),e.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}))),e.notify("draw",{prop:"setPrevActObj",onPropertyChange:!1,value:{prevActObj:null}}),e.drawingShape&&(this.currentDrawingShape=e.drawingShape.toLowerCase(),e.enableShapeDrawing(e.toPascalCase(e.drawingShape),!0),e.upperCanvas.style.cursor="crosshair")}document.getElementById(e.element.id+"_quickAccessToolbarArea")&&(document.getElementById(e.element.id+"_quickAccessToolbarArea").style.display="none")},tUt.prototype.updateFreehandDrawColorChange=function(){var e,t=this.parent,i={freehandSelectedIndex:null};t.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!1,value:{obj:i}}),je(i.freehandSelectedIndex)||je(t.pointColl[i.freehandSelectedIndex])||"#42a5f5"!==t.pointColl[i.freehandSelectedIndex].strokeColor||(t.notify("freehand-draw",{prop:"getTempFreeHandDrawEditingStyles",value:{obj:e={tempFreeHandDrawEditingStyles:null}}}),t.pointColl[i.freehandSelectedIndex].strokeColor=e.tempFreeHandDrawEditingStyles.strokeColor)},tUt.prototype.updatePrevShapeSettings=function(e){var t=this.parent,i=[],n=(je(t.activeObj.currIndex)&&(n={id:"shape_"+(t.objColl.length+1)},t.notify("shape",{prop:"getNewShapeId",onPropertyChange:!1,value:{obj:n}}),t.activeObj.currIndex=n.id),"text"===t.activeObj.shape&&t.activeObj.textSettings&&(t.activeObj.textSettings.bold&&i.push("bold"),t.activeObj.textSettings.italic&&i.push("italic"),t.activeObj.textSettings.underline)&&i.push("underline"),t.activeObj.activePoint),o=n.startX,r=n.startY,s=n.endX,a=n.endY,l=n.width,n=n.height,h=t.activeObj,d=h.keyHistory,p=h.currIndex,c=h.shape,u=h.textSettings,g=h.strokeSettings,m=h.rotatedAngle,f=h.imageElement,h=h.opacity,p={id:je(p)?null:p,type:t.toPascalCase(c),startX:o,startY:r,width:l,height:n,strokeColor:g?"text"===c?g.outlineColor:g.strokeColor:null,strokeWidth:g?"text"===c?g.outlineWidth:g.strokeWidth:null,fillColor:g?g.fillColor:null,radius:"ellipse"===c?l/2:null,length:"line"===c||"arrow"===c?l:null,text:"text"===c&&(d||u.text)||null,fontSize:"text"===c&&u?u.fontSize:null,fontFamily:"text"===c&&u?u.fontFamily:null,fontStyle:"text"===c?i:null,color:"text"===c&&g?g.strokeColor:null,degree:"ellipse"===c||"rectangle"===c||"image"===c||"text"===c?m*(180/Math.PI):null,imageData:"image"===c?f.src:null,opacity:"image"===c?h:null,radiusX:"ellipse"===c?l/2:null,radiusY:"ellipse"===c?n/2:null,endX:"line"===c||"arrow"===c?s:null,endY:"line"===c||"arrow"===c?a:null,arrowHead:"arrow"===c?this.getArrowType(t.activeObj.start):null,arrowTail:"arrow"===c?this.getArrowType(t.activeObj.end):null,points:"path"===c?t.activeObj.pointColl:null,index:t.activeObj.order,transformCollection:"text"===c?this.updateTransColl(t.activeObj):null};return e&&(e.shapeSettingsObj=p),p},tUt.prototype.updateTransColl=function(e){var t=this.parent,i=e.rotateFlipColl;if(i&&0<i.length)for(var n,o=[],r=0;r<i.length;r++)"number"==typeof(n=i[r])?o.push({degree:n}):o.push({flip:t.toPascalCase(n)});return o},tUt.prototype.getArrowType=function(e){return{none:"None",arrow:"Arrow",arrowSolid:"SolidArrow",circle:"Circle",circleSolid:"SolidCircle",square:"Square",squareSolid:"SolidSquare",bar:"Bar"}[""+e]},tUt.prototype.getRectanglePoints=function(e,t,i,n,o,r,s){var e=e+i/2,t=t+n/2,o=o*(Math.PI/180),a=Math.cos(o),o=Math.sin(o),r=r-e,e=s-t,s=r*a+e*o,t=-r*o+e*a,r=i/2,o=n/2;return-r<=s&&s<=r&&-o<=t&&t<=o},tUt.prototype.getTransRotationPoint=function(e,t){var i,n=!1,o=!1,r=0===e.shapeDegree?this.parent.transform.degree:this.parent.transform.degree-e.shapeDegree;if(r<0&&(r=360+r),e.flipObjColl)for(var s=0,a=e.flipObjColl.length;s<a;s++)"horizontal"===e.flipObjColl[s].toLowerCase()?n=!0:"vertical"===e.flipObjColl[s].toLowerCase()&&(o=!0);return 0===r||360===r?i=o?{x:e.topCenterCircle.startX,y:e.topCenterCircle.startY-e.rotationCircleLine}:{x:e.bottomCenterCircle.startX,y:e.bottomCenterCircle.startY+e.rotationCircleLine}:90===r||-270===r?i=n?{x:e.centerRightCircle.startX+e.rotationCircleLine,y:e.centerLeftCircle.startY}:{x:e.centerLeftCircle.startX-e.rotationCircleLine,y:e.centerLeftCircle.startY}:180===r||-180===r?i=o?{x:e.bottomCenterCircle.startX,y:e.bottomCenterCircle.startY+e.rotationCircleLine}:{x:e.topCenterCircle.startX,y:e.topCenterCircle.startY-e.rotationCircleLine}:270!==r&&-90!==r||(i=n?{x:e.centerLeftCircle.startX-e.rotationCircleLine,y:e.centerLeftCircle.startY}:{x:e.centerRightCircle.startX+e.rotationCircleLine,y:e.centerLeftCircle.startY}),t&&(t.rotationCirclePoint=i),i},tUt.prototype.getNumTextValue=function(e){var t,i,n=this.parent.element,o=n.querySelector("#"+n.id+"_resizeWidth"),n=n.querySelector("#"+n.id+"_resizeHeight");return o&&n&&(t=n.value.replace(/,/g,""),i=o.value.replace(/,/g,""),""===t&&(t=n.placeholder.replace(/,/g,"")),""===i&&(i=o.placeholder.replace(/,/g,"")),t=parseFloat(t),i=parseFloat(i)),e&&(e.width=i,e.height=t),{x:i,y:t}},tUt.prototype.isValueUpdated=function(){var e=!0,t=this.parent.element.querySelector("#"+this.parent.element.id+"_resizeWidth"),i=this.parent.element.querySelector("#"+this.parent.element.id+"_resizeHeight");return e=t&&i&&""===i.value.replace(/,/g,"")&&""===t.value.replace(/,/g,"")?!1:e},tUt.prototype.allowOutofBound=function(){return-1===["ellipse","rectangle","text","image","redact"].indexOf(this.parent.activeObj.shape)||0!==this.parent.activeObj.rotatedAngle};var eUt=tUt;function tUt(e){this.diffPoint={x:0,y:0},this.oldPoint={},this.isTouch=!1,this.isObjSelected=!1,this.isFhdPoint=!1,this.dragPoint={startX:0,startY:0,endX:0,endY:0},this.isShapeInserted=!1,this.tempActiveObj={activePoint:{startX:0,startY:0,endX:0,endY:0,width:0,height:0},flipObjColl:[],triangle:[],triangleRatio:[],order:null},this.isFirstMove=!1,this.startTouches=[],this.tempTouches=[],this.currMousePoint={x:0,y:0},this.cursorTargetId="",this.isPreventDragging=!1,this.dragElement="",this.textRow=1,this.mouseDownPoint={x:0,y:0},this.previousPoint={x:0,y:0},this.zoomType="Toolbar",this.isInitialTextEdited=!1,this.dragCanvas=!1,this.isFhdCustomized=!1,this.touchEndPoint={},this.isFhdEditing=!1,this.currentDrawingShape="",this.initialPrevObj={},this.touchTime=0,this.resizedElement="",this.isImageClarity=!0,this.isPinching=!1,this.isSliding=!1,this.mouseDown="",this.isSliderActive=!1,this.arrowShape=[MUt.None,MUt.SolidArrow],this.isTouchDblClick=!1,this.isMouseDown=!1,this.isMouseUp=!1,this.mouseWheel=0,this.isTransformedShape=!1,this.parent=e,this.addEventListener()}nUt.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},nUt.prototype.addEventListener=function(){this.parent.on("shape",this.shape,this),this.parent.on("destroyed",this.destroy,this)},nUt.prototype.removeEventListener=function(){this.parent.off("shape",this.shape),this.parent.off("destroyed",this.destroy)},nUt.prototype.shape=function(e){var t,i=this.parent;switch(this.initShapePvtProps(),e.prop){case"drawEllipse":this.drawEllipse(e.value.x,e.value.y,e.value.radiusX,e.value.radiusY,e.value.strokeWidth,e.value.strokeColor,e.value.fillColor,e.value.degree,e.value.isSelected);break;case"drawLine":this.drawLine(e.value.startX,e.value.startY,e.value.endX,e.value.endY,e.value.strokeWidth,e.value.strokeColor,e.value.isSelected);break;case"drawArrow":this.drawArrow(e.value.startX,e.value.startY,e.value.endX,e.value.endY,e.value.strokeWidth,e.value.strokeColor,e.value.arrowStart,e.value.arrowEnd,e.value.isSelected);break;case"drawPath":this.drawPath(e.value.pointColl,e.value.strokeWidth,e.value.strokeColor,e.value.isSelected);break;case"drawRectangle":this.drawRectangle(e.value.x,e.value.y,e.value.width,e.value.height,e.value.strokeWidth,e.value.strokeColor,e.value.fillColor,e.value.degree,e.value.isSelected,e.value.radius);break;case"drawText":this.drawText(e.value.x,e.value.y,e.value.text,e.value.fontFamily,e.value.fontSize,e.value.bold,e.value.italic,e.value.color,e.value.isSelected,e.value.degree,e.value.fillColor,e.value.outlineColor,e.value.outlineWidth,e.value.transformCollection);break;case"redrawActObj":this.redrawActObj(e.value.x,e.value.y,e.value.isMouseDown);break;case"apply":this.apply(e.value.shape,e.value.obj,e.value.canvas);break;case"updateShapeChangeEventArgs":this.updateShapeChangeEventArgs(e.value.shapeSettings,e.value.allowShapeOverflow);break;case"updSelChangeEventArgs":this.updSelChangeEventArgs(e.value.selectionSettings);break;case"iterateObjColl":this.iterateObjColl();break;case"updImgRatioForActObj":this.updImgRatioForActObj();break;case"redrawObj":this.redrawObj(e.value.degree);break;case"redraw-text":this.redrawText();break;case"draw-shape":this.drawShape(e.value.obj,e.value.strokeWidth,e.value.strokeColor,e.value.fillColor,e.value.start,e.value.width,e.value.height);break;case"renderTextArea":this.renderTextArea(e.value.x,e.value.y,e.value.actObj);break;case"setTextBoxWidth":this.setTextBoxWidth(e.value.e);break;case"findTextTarget":this.findTextTarget(e.value.e);break;case"updateFontStyles":this.updateFontStyles(e.value.isTextBox);break;case"applyFontStyle":this.applyFontStyle(e.value.item);break;case"updateFontRatio":this.updateFontRatio(e.value.obj,e.value.isTextArea);break;case"updateFontSize":this.updateFontSize(e.value.obj);break;case"pushActItemIntoObj":this.pushActItemIntoObj();break;case"clearActObj":this.clearActObj();break;case"refreshActiveObj":this.refreshActiveObj();break;case"applyActObj":this.applyActObj(e.value.isMouseDown);break;case"wireEvent":E.add(i.upperCanvas,"dblclick",this.findTextTarget,this),E.add(i.textArea,"mousedown",this.findTextTarget,this),(t=document.getElementById(i.element.id+"_fileUpload"))&&E.add(t,"change",this.fileChanged,this);break;case"unWireEvent":E.remove(i.upperCanvas,"dblclick",this.findTextTarget),E.remove(i.textArea,"mousedown",this.findTextTarget),(t=document.getElementById(i.element.id+"_fileUpload"))&&E.remove(t,"change",this.fileChanged);break;case"getShapeSetting":this.getShapeSetting(e.value.id,e.value.obj);break;case"getShapeSettings":this.getShapeSettings(e.value.obj);break;case"getRedactSettings":this.getRedactSettings(e.value.obj);break;case"isPointsInRange":this.isPointsInRange(e.value.x,e.value.y,e.value.obj);break;case"alignRotateFlipColl":this.alignRotateFlipColl(e.value.collection,e.value.isRotateFlipCollection,e.value.obj);break;case"selectShape":this.selectShape(e.value.id,e.value.obj);break;case"deleteShape":this.deleteShape(e.value.id);break;case"getMaxText":this.getMaxText(e.value.isTextBox,e.value.text,e.value.obj);break;case"setPointCollForLineArrow":e.value.obj.pointColl=this.getLinePoints(e.value.obj.activePoint.startX,e.value.obj.activePoint.startY,e.value.obj.activePoint.endX,e.value.obj.activePoint.endY);break;case"setPointCollForShapeRotation":this.setPointCollForShapeRotation(e.value.obj);break;case"setTextSettings":e.value.textSettings?this.textSettings=e.value.textSettings:e.value.fontFamily?this.textSettings.fontFamily=e.value.fontFamily:e.value.fontSize?this.textSettings.fontSize=e.value.fontSize:e.value.radius&&(this.strokeSettings.radius=e.value.radius);break;case"setStrokeSettings":e.value.strokeSettings?this.strokeSettings=e.value.strokeSettings:e.value.strokeColor?this.strokeSettings.strokeColor=e.value.strokeColor:e.value.fillColor?this.strokeSettings.fillColor=e.value.fillColor:e.value.strokeWidth?this.strokeSettings.strokeWidth=e.value.strokeWidth:e.value.outlineColor?this.strokeSettings.outlineColor=e.value.outlineColor:e.value.radius?this.strokeSettings.radius=e.value.radius:e.value.outlineWidth&&(this.strokeSettings.outlineWidth=e.value.outlineWidth);break;case"getStrokeSettings":e.value.obj.strokeSettings=this.strokeSettings;break;case"setKeyHistory":this.keyHistory=e.value.keyHistory;break;case"getKeyHistory":e.value.obj.keyHistory=this.keyHistory;break;case"setTextBoxPos":this.setTextBoxPos(e.value.actObj,e.value.degree,e.value.flip,e.value.x,e.value.y);break;case"setTextBoxPoints":this.setTextBoxPoints(e.value.actObj,e.value.degree,e.value.flip,e.value.x,e.value.y);break;case"alignTextAreaIntoCanvas":this.alignTextAreaIntoCanvas();break;case"initializeTextShape":this.initializeTextShape(e.value.text,e.value.fontFamily,e.value.fontSize,e.value.bold,e.value.italic,e.value.strokeColor,e.value.fillColor,e.value.outlineColor,e.value.outlineWidth);break;case"stopPathDrawing":this.stopPathDrawing(e.value.e,e.value.isApply);break;case"updateArrowRatio":this.updateArrowRatio(e.value.obj);break;case"getSquarePointForRotatedShape":this.getSquarePointForRotatedShape(e.value.obj,e.value.object);break;case"drawImage":this.drawImage(e.value.x,e.value.y,e.value.width,e.value.height,e.value.src,e.value.degree,e.value.isAspectRatio,e.value.opacity,e.value.isSelected);break;case"reset":this.reset();break;case"updateObj":this.updateObj(e.value.dimObj,e.value.x,e.value.y);break;case"straightenShapes":this.straightenShapes();break;case"straightenShapePoints":this.straightenShapePoints(e.value.obj,e.value.isReverse);break;case"straightenPath":this.straightenPath(e.value.obj);break;case"straightenFHD":this.straightenFHD();break;case"getTextBoxPosition":this.getTextBoxPosition(e.value.obj,e.value.object);break;case"setFlipState":this.setFlipState(e.value.x,e.value.y,e.value.obj,e.value.object);break;case"getNewShapeId":e.value.obj.id=this.getNewShapeId();break;case"z-order":this.updateZOrder(e.value.obj,e.value.value);break;case"getSmallestIndex":e.value.obj.index=this.getSmallestIndex();break;case"isIndexInObjColl":e.value.obj.bool=this.isIndexInObjColl(e.value.index);break;case"drawAnnotations":this.drawAnnotations(e.value.ctx,e.value.shape,e.value.pen,e.value.isPreventApply,e.value.x,e.value.y,e.value.panRegion);break;case"updateShapeColl":this.updateShapeColl();break;case"getNewOrder":e.value.obj.order=this.getNewOrder();break;case"getHighestOrder":e.value.obj.order=this.getHighestOrder();break;case"getLowestOrder":e.value.obj.order=this.getLowestOrder();break;case"drawRedact":this.drawRedact(e.value.x,e.value.y,e.value.width,e.value.height,e.value.type,e.value.value);break;case"setRedactType":this.redactType=e.value.redactType}},nUt.prototype.getModuleName=function(){return"shape"},nUt.prototype.initShapePvtProps=function(){var e=this.parent;e.lowerCanvas&&(this.lowerContext=e.lowerCanvas.getContext("2d")),e.upperCanvas&&(this.upperContext=e.upperCanvas.getContext("2d")),je(this.shapeImg)&&(this.shapeImg=e.createElement("img",{id:e.element.id+"_shapeImg",attrs:{name:"Image",crossorigin:"anonymous"}})),""===this.textSettings.fontFamily&&(this.textSettings.fontFamily=e.fontFamily.default)},nUt.prototype.reset=function(){this.textSettings={text:"Enter Text",fontFamily:this.parent.fontFamily.default,fontSize:null,fontRatio:null,bold:!1,italic:!1,underline:!1},this.strokeSettings={strokeColor:"#fff",fillColor:"",strokeWidth:null,radius:null,outlineColor:"",outlineWidth:null},this.preventFrameAnnotation=!1},nUt.prototype.drawEllipse=function(e,t,i,n,o,r,s,a,l){this.initializeShape("ellipse"),this.drawShape("ellipse",o,r,s,e&&t?{x:e,y:t}:null,i,n,null,null,null,a,null,l)},nUt.prototype.drawLine=function(e,t,i,n,o,r,s){this.initializeShape("line"),this.drawShape("line",o,r,null,e&&t?{x:e,y:t}:null,i-e,n-t,null,null,null,null,null,s)},nUt.prototype.drawPath=function(e,t,i,n){this.initializeShape("path"),e&&this.drawShape("path",t,i,null,null,null,null,e,null,null,null,null,n)},nUt.prototype.drawArrow=function(e,t,i,n,o,r,s,a,l){this.initializeShape("arrow"),this.drawShape("arrow",o,r,null,e&&t?{x:e,y:t}:null,i-e,n-t,null,s,a,null,null,l)},nUt.prototype.drawRectangle=function(e,t,i,n,o,r,s,a,l,h){this.initializeShape("rectangle"),this.drawShape("rectangle",o,r,s,e&&t?{x:e,y:t}:null,i,n,null,null,null,a,null,l,h)},nUt.prototype.drawRedact=function(e,t,i,n,o,r){this.initializeShape("redact"),this.drawShape("redact",null,null,null,e&&t?{x:e,y:t}:null,i,n,null,null,null,null,null,null,null,o,r)},nUt.prototype.drawText=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u){this.drawShapeText(i,n,o,r,s,a,e,t,l,h,d,p,c,u)},nUt.prototype.initializeShape=function(e){var t=this.parent;this.redrawActObj(),t.activeObj.shape=e,t.currObjType.isCustomCrop=!1},nUt.prototype.updateWidthHeight=function(e){return e.activePoint.width=e.activePoint.endX-e.activePoint.startX,e.activePoint.height=e.activePoint.endY-e.activePoint.startY,e},nUt.prototype.setDimension=function(e,t){var i=this.parent,n=i.activeObj.shape;(e&&t||("line"===n||"arrow"===n)&&(e||t))&&(i.activeObj.activePoint.width=e,i.activeObj.activePoint.height=t,"ellipse"===i.currObjType.shape.toLowerCase())&&(i.activeObj.activePoint.width=2*e,i.activeObj.activePoint.height=2*t)},nUt.prototype.getArrowType=function(e){var t=e;return e&&(t={None:"none",Arrow:"arrow",SolidArrow:"arrowSolid",Circle:"circle",SolidCircle:"circleSolid",Square:"square",SolidSquare:"squareSolid",Bar:"bar"}[""+e]),t},nUt.prototype.drawShape=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u,g,m){var f,y,v=this.parent;!v.disabled&&v.isImageLoaded&&(v.notify("draw",{prop:"setImageEdited",onPropertyChange:!1}),this.redrawActObj(),f=Pe([],v.objColl,[],!0),v.togglePen=!1,this.keyHistory="",v.upperCanvas.style.display="block",this.refreshActiveObj(),v.currObjType.shape=e=e.toLowerCase(),"freehanddraw"!==e)&&""!==e&&(v.activeObj.shape=e,y=v.activeObj.strokeSettings,this.upperContext.clearRect(0,0,v.upperCanvas.width,v.upperCanvas.height),je(y)&&(y=this.strokeSettings),"path"===e&&a&&(v.activeObj.pointColl=a),null!=p&&(v.activeObj.opacity=p),y.strokeWidth=t||y.strokeWidth,"rectangle"!==(a=v.activeObj.shape)&&"ellipse"!==a||0!==t||(y.strokeWidth=0),y.strokeColor=i||y.strokeColor,y.fillColor=n||""===n?n:y.fillColor,y.radius=u||y.radius,p=100<v.img.destWidth?100:v.img.destWidth/2,a=100<v.img.destHeight?100:v.img.destHeight/2,v.activeObj.activePoint.width=p,v.activeObj.activePoint.height=a,"line"===e||"arrow"===e?(v.activeObj.lineDraw="horizontal",v.activeObj.activePoint.height=0,"arrow"===e&&(v.activeObj.activePoint.width+=50,v.activeObj.start=this.getArrowType(l),v.activeObj.end=this.getArrowType(h))):"rectangle"===e?v.activeObj.activePoint.width+=v.activeObj.activePoint.width/2:"redact"===e&&g&&(v.activeObj.redactType=g.toLowerCase(),g===BUt.Blur?m&&(v.activeObj.redactBlur=m):m&&(v.activeObj.redactPixelate=m),v.activeObj.redactImage=v.createElement("canvas")),this.setDimension(r,s),o?(v.activeObj.activePoint.startX=o.x,v.activeObj.activePoint.startY=o.y,v.activeObj.activePoint.endX=v.activeObj.activePoint.startX+v.activeObj.activePoint.width,v.activeObj.activePoint.endY=v.activeObj.activePoint.startY+v.activeObj.activePoint.height):this.setCenterPoints(),this.setPointCollForLineAndArrow(),"arrow"===e&&(v.activeObj.triangleDirection="right"),v.currObjType.isDragging=v.currObjType.isCustomCrop=!1,this.initShapeProps(),v.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!(t={shapeSettingsObj:{}}),value:{obj:t}}),v.trigger("shapeChanging",n={cancel:!1,action:"insert",previousShapeSettings:i=t.shapeSettingsObj,currentShapeSettings:i}),v.editCompleteArgs=n,this.updateShapeChangeEventArgs(n.currentShapeSettings,n.allowShapeOverflow),this.setDimension(r,s),v.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate"}}),d&&(v.activeObj.rotatedAngle=d*(Math.PI/180),v.notify("selection",{prop:"updPtCollForShpRot",onPropertyChange:!1,value:{obj:v.activeObj}})),v.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:null}}),v.notify("selection",{prop:"isShapeInserted",onPropertyChange:!1,value:{bool:!0}}),v.notify("undo-redo",{prop:"updateUrObj",onPropertyChange:!1,value:{objColl:f}}),"redact"===e?v.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"redact",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}):v.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"shapes",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}),v.notify("toolbar",{prop:"update-toolbar-items",onPropertyChange:!1}),v.isPublicMethod&&!c&&v.notify("undo-redo",{prop:"updateUndoRedo",value:{operation:"shapeInsert"},onPropertyChange:!1}),v.isPublicMethod=!1)},nUt.prototype.initShapeProps=function(){var e=this.parent;e.activeObj.shapeDegree=e.transform.degree,e.activeObj.shapeFlip=e.transform.currFlipState,e.activeObj.textFlip=e.transform.currFlipState,e.activeObj.flipObjColl=[],e.activeObj.order=this.getNewOrder()},nUt.prototype.setPointCollForLineAndArrow=function(){var e=this.parent,t=e.activeObj.shape,i=e.activeObj.activePoint,n=i.startX,o=i.startY,r=i.endX,i=i.endY;if(("line"===t||"arrow"===t)&&(e.activeObj.pointColl=this.getLinePoints(n,o,r,i),e.activeObj.pointColl))for(var s=0,a=e.activeObj.pointColl.length;s<a;s++)e.activeObj.pointColl[s].ratioX=(e.activeObj.pointColl[s].x-e.img.destLeft)/e.img.destWidth,e.activeObj.pointColl[s].ratioY=(e.activeObj.pointColl[s].y-e.img.destTop)/e.img.destHeight},nUt.prototype.prevObjColl=function(){var e=this.parent,t={currObj:{}},t=(e.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:t}}),this.prevObj=t.currObj,this.prevObj.objColl=Pe([],e.objColl,[],!0),this.prevObj.pointColl=Pe([],e.pointColl,[],!0),this.prevObj.afterCropActions=Pe([],e.afterCropActions,[],!0),{selPointColl:null});e.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:t}}),this.prevObj.selPointColl=Pe([],t.selPointColl,[],!0)},nUt.prototype.drawShapeText=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u){var g=this.parent;if(!g.disabled&&g.isImageLoaded){"freehanddraw"===g.currObjType.shape&&(this.apply(),g.upperCanvas.style.cursor=g.cursor="default",g.currObjType.shape=""),g.notify("draw",{prop:"setImageEdited",onPropertyChange:!1}),g.togglePen=!1,this.redrawActObj(),this.prevObjColl(),this.refreshActiveObj(),g.activeObj.shape=g.currObjType.shape="text",g.currObjType.isCustomCrop=!1,this.initializeTextShape(e,t,i,n,o,r,d,p,c),g.currObjType.isText=g.currObjType.isInitialText=!0,je(g.activeObj.textSettings.fontSize)&&(g.getFontSizes(),g.activeObj.textSettings.fontSize=parseInt(g.fontSizeColl[parseInt("3",10)-1].text,10)),g.img.destWidth<100?g.activeObj.textSettings.fontSize=Math.floor(g.img.destWidth/20):g.img.destHeight<100&&(g.activeObj.textSettings.fontSize=Math.floor(g.img.destHeight/20)),g.activeObj.shapeDegree=g.transform.degree,g.activeObj.shapeFlip=g.transform.currFlipState,g.activeObj.flipObjColl=[],this.updateFontStyles(),g.activeObj.order=this.getNewOrder();t=this.upperContext.measureText(g.activeObj.textSettings.text).width+.5*g.activeObj.textSettings.fontSize,n=g.activeObj.textSettings.fontSize;if(e&&(g.activeObj.keyHistory=e,o=(o=this.getMaxText())||g.activeObj.textSettings.text,t=this.upperContext.measureText(o).width+.5*g.activeObj.textSettings.fontSize,1<(r=e.split("\n")).length)&&(n=r.length*g.activeObj.textSettings.fontSize,n+=.25*i),je(s)||je(a)?this.setCenterPoints(!0,t,n):(g.activeObj.activePoint.startX=s,g.activeObj.activePoint.startY=a,g.activeObj.activePoint.endX=g.activeObj.activePoint.startX+t,g.activeObj.activePoint.endY=g.activeObj.activePoint.startY+n),u){g.notify("selection",{prop:"setTransformedShape",onPropertyChange:!1,value:{bool:!0}}),this.setTransformColl(u);for(var d=g.activeObj,m=(d.shapeDegree=0,d.shapeFlip="",0),f=d.rotateFlipColl,y=0;y<f.length;y++)"number"==typeof f[y]&&(m+=f[y]);m%90==0&&Math.abs(m)%180==90&&(d.activePoint.endX=d.activePoint.startX+n,d.activePoint.endY=d.activePoint.startY+t,d.activePoint.width=d.activePoint.endX-d.activePoint.startX,d.activePoint.height=d.activePoint.endY-d.activePoint.startY)}p={shapeSettingsObj:{}},c=(g.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:p}}),p.shapeSettingsObj),o={cancel:!1,action:"insert",previousShapeSettings:c,currentShapeSettings:c};g.trigger("shapeChanging",o),g.editCompleteArgs=o,this.drawShapeTextEvent(o),h&&(g.activeObj.rotatedAngle=h*(Math.PI/180),g.notify("selection",{prop:"updPtCollForShpRot",onPropertyChange:!1,value:{obj:g.activeObj}}),this.upperContext.clearRect(0,0,g.upperCanvas.width,g.upperCanvas.height),g.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:g.activeObj,isCropRatio:null,points:null,isPreventDrag:!0,saveContext:null,isPreventSelection:null}}),g.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1}),g.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:null}})),e&&-1<e.indexOf("\n")&&g.isPublicMethod&&(r=String(g.fontSizeColl.findIndex(function(e){return e.text===String(g.activeObj.textSettings.fontSize)})+1),g.noPushUndo=!0,g.updateFontSize("5"),0<parseInt(r,10)&&g.updateFontSize(r),g.noPushUndo=!1),g.isPublicMethod&&!l&&g.notify("undo-redo",{prop:"updateUndoRedo",value:{operation:"shapeInsert"},onPropertyChange:!1}),g.isPublicMethod=!1}},nUt.prototype.drawShapeImageEvent=function(e,t){var i=this.parent,e=(this.updateShapeChangeEventArgs(e.currentShapeSettings,e.allowShapeOverflow),i.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate"}}),i.objColl.push(i.activeObj),Pe({},i.cropObj,{},!0));i.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeInsert",previousObj:this.prevObj,previousObjColl:this.prevObj.objColl,previousPointColl:this.prevObj.pointColl,previousSelPointColl:this.prevObj.selPointColl,previousCropObj:e,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),i.notify("selection",{prop:"redrawShape",onPropertyChange:!1,value:{obj:i.objColl[i.objColl.length-1]}}),t?(i.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"shapes",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}),i.notify("toolbar",{prop:"update-toolbar-items",onPropertyChange:!1}),i.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:null}})):i.okBtn(null,!0),i.notify("selection",{prop:"isShapeInserted",onPropertyChange:!1,value:{bool:!0}})},nUt.prototype.setTransformColl=function(e){var t=this.parent;if(t.activeObj.rotateFlipColl=[],e)for(var i=0;i<e.length;i++)e[i].degree?t.activeObj.rotateFlipColl.push(e[i].degree):t.activeObj.rotateFlipColl.push(e[i].flip.toLowerCase())},nUt.prototype.drawShapeTextEvent=function(e){var t=this.parent,e=(this.updateShapeChangeEventArgs(e.currentShapeSettings,e.allowShapeOverflow),this.addLetter(t.activeObj.textSettings.text),t.activeObj.textFlip=t.transform.currFlipState,this.updateFontRatio(t.activeObj),t.objColl.push(t.activeObj),Pe({},t.cropObj,{},!0));t.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeInsert",previousObj:this.prevObj,previousObjColl:this.prevObj.objColl,previousPointColl:this.prevObj.pointColl,previousSelPointColl:this.prevObj.selPointColl,previousCropObj:e,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),t.notify("selection",{prop:"redrawShape",onPropertyChange:!1,value:{obj:t.objColl[t.objColl.length-1]}}),t.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:null}}),t.notify("selection",{prop:"isShapeInserted",onPropertyChange:!1,value:{bool:!0}}),t.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"text",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}),t.notify("toolbar",{prop:"update-toolbar-items",onPropertyChange:!1})},nUt.prototype.initializeTextShape=function(e,t,i,n,o,r,s,a,l){var h=this.parent;this.keyHistory="",h.upperCanvas.style.display="block",h.activeObj.strokeSettings.strokeColor=r||h.activeObj.strokeSettings.strokeColor,h.activeObj.strokeSettings.fillColor=s||h.activeObj.strokeSettings.fillColor,h.activeObj.textSettings.text=e||h.activeObj.textSettings.text,h.activeObj.textSettings.fontFamily=t||h.activeObj.textSettings.fontFamily,h.activeObj.textSettings.fontSize=i||h.activeObj.textSettings.fontSize,h.activeObj.textSettings.bold=n||h.activeObj.textSettings.bold,h.activeObj.textSettings.italic=o||h.activeObj.textSettings.italic,h.activeObj.strokeSettings.outlineColor=a||h.activeObj.strokeSettings.outlineColor,h.activeObj.strokeSettings.outlineWidth=l||h.activeObj.strokeSettings.outlineWidth},nUt.prototype.drawImage=function(e,t,i,n,o,r,s,a,l){this.initializeShape("image"),this.onLoadImgShape(e,t,i,n,o,null,r,s,a,l)},nUt.prototype.redrawActObj=function(e,t,i){var n,o=this.parent;o.activeObj.shape&&(n=o.activeObj.shape.split("-")),o.activeObj.horTopLine&&o.activeObj.shape&&"crop"!==n[0]&&("block"===o.textArea.style.display||"inline-block"===o.textArea.style.display?(o.notify("selection",{prop:"setTextBoxStylesToActObj",onPropertyChange:!1}),this.updateFontRatio(o.activeObj,!0),e&&t?e!==o.activeObj.activePoint.startX&&t!==o.activeObj.activePoint.startY&&this.updateTextFromTextArea():(this.updateTextFromTextArea(),o.textArea.style.transform="",o.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1})),this.refreshActiveObj()):this.applyActObj(i))},nUt.prototype.apply=function(e,t,i){var n,o,r,s,a,l=this.parent;l.disabled||(l.togglePen&&!l.currObjType.isCustomCrop?(n=l.img.destLeft,o=l.img.destTop,r=l.img.destWidth,s=l.img.destHeight,l.notify("draw",{prop:"callUpdateCurrTransState",onPropertyChange:!1}),a=this.lowerContext.filter,this.lowerContext.filter="none",l.togglePen=!1,(l.isCircleCrop||l.currSelectionPoint&&"crop-circle"===l.currSelectionPoint.shape)&&l.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),l.img.destLeft=n,l.img.destTop=o,l.img.destWidth=r,l.img.destHeight=s,this.lowerContext.filter=a):(i=i||"original",je(l.activeObj.shape)&&je(e)?l.currObjType.shape="":l.currObjType.shape=e||l.currObjType.shape,""!==l.currObjType.shape&&(this.upperContext.clearRect(0,0,l.upperCanvas.width,l.upperCanvas.height),"text"===l.activeObj.shape?l.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:i,obj:t,isCropRatio:null,points:null,isPreventDrag:!0,saveContext:null,isPreventSelection:null}}):l.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:i,obj:t}}),l.activeObj.shape=l.currObjType.shape.toLowerCase(),e||""===l.currObjType.shape||l.currObjType.isCustomCrop||l.objColl.push(Pe({},l.activeObj,{},!0)),this.keyHistory="")))},nUt.prototype.setCenterPoints=function(e,t,i){var n,o=this.parent,e=e&&t&&i?(n=t,i):(n=o.activeObj.activePoint.width,o.activeObj.activePoint.height);o.activeObj.activePoint.startX=o.lowerCanvas.width/2-n/2,o.activeObj.activePoint.startY=o.lowerCanvas.height/2-e/2,o.activeObj.activePoint.endX=o.lowerCanvas.width/2+n/2,o.activeObj.activePoint.endY=o.lowerCanvas.height/2+e/2},nUt.prototype.updSelChangeEventArgs=function(e){var t=this.parent;t.activeObj.activePoint={startX:e.startX,startY:e.startY,endX:t.activeObj.activePoint.startX+t.activeObj.activePoint.width,endY:t.activeObj.activePoint.startY+t.activeObj.activePoint.height,width:e.width,height:e.height},t.activeObj.activePoint.endX=t.activeObj.activePoint.startX+t.activeObj.activePoint.width,t.activeObj.activePoint.endY=t.activeObj.activePoint.startY+t.activeObj.activePoint.height},nUt.prototype.updateShapeChangeEventArgs=function(e,t){var i,n=this.parent;if(e.id&&-1===e.id.indexOf("shape_")&&-1===e.id.indexOf("pen_")&&(n.activeObj.currIndex?n.activeObj.currIndex="shape_"+e.id:n.pointColl[i].id="pen_"+e.id),e.id&&e.id.split("_")[0]&&"pen"===e.id.split("_")[0])i=parseInt(e.id.split("_")[1],10)-1,n.pointColl[i].points=e.points,n.pointColl[i].strokeColor=e.strokeColor,n.pointColl[i].strokeWidth=e.strokeWidth,n.pointColl[i].opacity=e.opacity,n.pointColl[i].order=e.index;else{switch(n.activeObj.activePoint.startX=e.startX,n.activeObj.activePoint.startY=e.startY,e.width&&e.height&&(n.activeObj.activePoint.width=e.width,n.activeObj.activePoint.height=e.height,n.activeObj.activePoint.endX=n.activeObj.activePoint.startX+n.activeObj.activePoint.width,n.activeObj.activePoint.endY=n.activeObj.activePoint.startY+n.activeObj.activePoint.height),"text"!==n.activeObj.shape&&(n.activeObj.strokeSettings.strokeColor=e.strokeColor,n.activeObj.strokeSettings.strokeWidth=e.strokeWidth),n.activeObj.strokeSettings.fillColor=e.fillColor,n.activeObj.opacity=e.opacity,n.activeObj.order=e.index,n.activeObj.preventShapeDragOut=!t,je(e.degree)&&(e.degree=0),n.activeObj.shape){case"ellipse":n.activeObj.activePoint.width=2*e.radiusX,n.activeObj.activePoint.height=2*e.radiusY,n.activeObj.activePoint.endX=n.activeObj.activePoint.startX+n.activeObj.activePoint.width,n.activeObj.activePoint.endY=n.activeObj.activePoint.startY+n.activeObj.activePoint.height,e.degree&&(n.activeObj.rotatedAngle=e.degree*(Math.PI/180));break;case"line":case"arrow":n.activeObj.activePoint.width=e.length,n.activeObj.activePoint.endX=e.endX,n.activeObj.activePoint.endY=e.endY,n.activeObj.activePoint.width=n.activeObj.activePoint.startX+n.activeObj.activePoint.width,n.activeObj.activePoint.height=n.activeObj.activePoint.startY+n.activeObj.activePoint.height,"arrow"===n.activeObj.shape&&(n.activeObj.start=this.getArrowType(e.arrowHead),n.activeObj.end=this.getArrowType(e.arrowTail));break;case"text":n.activeObj.keyHistory=n.activeObj.textSettings.text=e.text,n.activeObj.textSettings.fontSize=e.fontSize,n.activeObj.strokeSettings.strokeColor=e.color,n.activeObj.strokeSettings.outlineColor=e.strokeColor,n.activeObj.strokeSettings.outlineWidth=e.strokeWidth,n.activeObj.strokeSettings.fillColor=e.fillColor,n.activeObj.textSettings.fontFamily=e.fontFamily,this.setTransformColl(e.transformCollection),e.degree&&(n.activeObj.rotatedAngle=e.degree*(Math.PI/180)),this.updateFontRatio(n.activeObj);break;case"rectangle":case"image":e.degree&&(n.activeObj.rotatedAngle=e.degree*(Math.PI/180));break;case"path":n.activeObj.pointColl=e.points}if("text"===n.activeObj.shape&&n.activeObj.textSettings){n.activeObj.textSettings.bold=!1,n.activeObj.textSettings.italic=!1,n.activeObj.textSettings.underline=!1;for(var o=0;o<e.fontStyle.length;o++)switch(e.fontStyle[o]){case"bold":n.activeObj.textSettings.bold=!0;break;case"italic":n.activeObj.textSettings.italic=!0}}}},nUt.prototype.addLetter=function(e){var t,i=this.parent;"none"!==i.textArea.style.display||!i.currObjType.isText&&"text"!==i.activeObj.shape||(t=i.activeObj.textSettings.fontSize,"Backspace"===e?this.keyHistory=this.keyHistory.slice(0,-1):this.keyHistory+=e,this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height),this.updateFontStyles(),e=this.upperContext.measureText(this.keyHistory).width+.5*t,this.upperContext.fillText(this.keyHistory,i.activeObj.activePoint.startX,i.activeObj.activePoint.startY+(t=t)),this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height),i.currObjType.isText=!0,i.notify("selection",{prop:"setActivePoint",onPropertyChange:!1,value:{startX:e,startY:t}}))},nUt.prototype.redrawText=function(){var e=this.parent,t=e.activeObj.textSettings,i=t.fontSize,n=t.fontFamily,o="",t=(t.bold&&(o+="bold "),t.italic&&(o+="italic "),this.upperContext.font=o+i+"px "+n,e.activeObj.keyHistory.split("\n")),o="block"===e.textArea.style.display||"inline-block"===e.textArea.style.display?this.getMaxText(!0):this.getMaxText(),n=this.upperContext.measureText(o).width+.5*i,o=t.length*i;1<t.length&&(o+=.5*i),e.notify("selection",{prop:"setTextSelection",onPropertyChange:!1,value:{width:n,height:o}}),e.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:e.activeObj.activePoint,obj:e.activeObj,isMouseMove:null,x:null,y:null}}),e.notify("selection",{prop:"redrawShape",onPropertyChange:!1,value:{obj:e.activeObj}})},nUt.prototype.updateTextFromTextArea=function(){var e,t=this.parent,i=!1,n=t.activeObj.textSettings.fontSize,o=Pe({},t.activeObj,{},!0),r=Pe({},t.cropObj,{},!0),s={currObj:{}},s=(t.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:s}}),s.currObj),a=(s.objColl=Pe([],t.objColl,[],!0),s.pointColl=Pe([],t.pointColl,[],!0),s.afterCropActions=Pe([],t.afterCropActions,[],!0),{selPointColl:null}),a=(t.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:a}}),s.selPointColl=Pe([],a.selPointColl,[],!0),t.activeObj.keyHistory!==t.textArea.value&&(i=!0),t.activeObj.keyHistory=t.textArea.value,t.textArea.style.display="none",t.textArea.value="",this.updateFontStyles(),this.upperContext.measureText(t.activeObj.keyHistory).width+.5*n),l=n,h=t.activeObj.keyHistory.split("\n");if(1<h.length){for(var l=(l*=h.length)+.1*n*h.length,d=[],p=0,c=h.length;p<c;p++)d.push(this.upperContext.measureText(h[p]).width+.5*n);a=Math.max.apply(Math,d)}t.notify("selection",{prop:"setTextSelection",onPropertyChange:!1,value:{width:a,height:l}}),0!==t.activeObj.rotatedAngle&&(a=t.activeObj.activePoint.width-o.activePoint.width,l=t.activeObj.activePoint.height-o.activePoint.height,e="",0<a&&0<l?e="widthHeight":0!=a?e="width":0!=l&&(e="height"),t.activeObj.activePoint=Pe({},o.activePoint,{},!0),t.notify("selection",{prop:"adjustRotationPoints",onPropertyChange:!1,value:{rectangle:t.activeObj.activePoint,x:a,y:l,angle:t.activeObj.rotatedAngle,type:"text",elem:e}}),t.notify("shape",{prop:"updateFontSize",onPropertyChange:!1,value:{obj:t.activeObj}})),t.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:t.activeObj.activePoint,obj:t.activeObj,isMouseMove:null,x:null,y:null}}),this.updImgRatioForActObj(),0!==t.activeObj.rotatedAngle&&t.notify("selection",{prop:"updPtCollForShpRot",onPropertyChange:!1,value:{obj:t.activeObj}}),i?(this.apply(t.activeObj.shape,t.activeObj),t.objColl.push(Pe({},t.activeObj,{},!0)),t.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"text",previousObj:s,previousObjColl:s.objColl,previousPointColl:s.pointColl,previousSelPointColl:s.selPointColl,previousCropObj:r,previousText:t.activeObj.keyHistory,currentText:t.textArea.value,previousFilter:null,isCircleCrop:null}})):(this.apply(t.activeObj.shape,t.activeObj),t.objColl.push(Pe({},t.activeObj,{},!0)))},nUt.prototype.iterateObjColl=function(){var e=this.parent;if(0<e.objColl.length)for(var t=this.getSmallestIndex(),i=Pe([],e.objColl,[],!0);0<i.length;){for(var n=!1,o=0;o<i.length;o++){var r=i[o];if(je(r.order))i.splice(o,1),o--;else if(r.order===t){this.apply(r.shape,r),"redact"===r.shape&&JSON.stringify(r.activePoint)===JSON.stringify(e.activeObj.activePoint)&&r.redactImage!==e.activeObj.redactImage&&(r.redactImage=e.activeObj.redactImage,e.objColl[o])&&JSON.stringify(e.objColl[o].activePoint)===JSON.stringify(r.activePoint)&&(e.objColl[o].redactImage=e.activeObj.redactImage),this.refreshActiveObj(),t++,this.isIndexInObjColl(t)||t++,i.splice(o,1),n=!0;break}}if(!n)break}},nUt.prototype.getSmallestIndex=function(){for(var e,t=this.parent,i=0,n=t.objColl.length;i<n;i++){var o=t.objColl[i];je(o.order)||(je(e)||o.order<e)&&(e=o.order)}return e},nUt.prototype.isIndexInObjColl=function(e){for(var t=this.parent,i=0,n=t.objColl.length;i<n;i++){var o=t.objColl[i];if(!je(o.order)&&o.order===e)return!0}return!1},nUt.prototype.updImgRatioForActObj=function(){var e=this.parent,t={startX:e.img.destLeft,startY:e.img.destTop,width:e.img.destWidth,height:e.img.destHeight},i=(this.straightenShapes(),e.img),n=i.destLeft,o=i.destTop,r=i.destWidth,i=i.destHeight,s=e.activeObj.activePoint;e.activeObj.imageRatio={startX:(s.startX-n)/r,startY:(s.startY-o)/i,endX:(s.endX-n)/r,endY:(s.endY-o)/i,width:r/s.width,height:i/s.height},e.activeObj.rotationCirclePointColl&&(e.activeObj.rotationCirclePointColl.ratioX=(e.activeObj.rotationCirclePointColl.x-n)/r,e.activeObj.rotationCirclePointColl.ratioY=(e.activeObj.rotationCirclePointColl.y-o)/i),"path"===e.activeObj.shape?this.updatePathRatio(e.activeObj):"arrow"===e.activeObj.shape&&this.updateArrowRatio(e.activeObj),e.img.destLeft=t.startX,e.img.destTop=t.startY,e.img.destWidth=t.width,e.img.destHeight=t.height},nUt.prototype.zoomObjColl=function(e){var t=this.parent,i={startX:t.img.destLeft,startY:t.img.destTop,width:t.img.destWidth,height:t.img.destHeight};if(this.straightenShapes(),0<t.objColl.length){for(var n=0,o=t.objColl.length;n<o;n++){var r=t.objColl[n];if(r.imageRatio&&(r.activePoint.startX=r.imageRatio.startX*t.img.destWidth+t.img.destLeft,r.activePoint.startY=r.imageRatio.startY*t.img.destHeight+t.img.destTop,r.activePoint.endX=r.imageRatio.endX*t.img.destWidth+t.img.destLeft,r.activePoint.endY=r.imageRatio.endY*t.img.destHeight+t.img.destTop),"text"===(r=this.updateWidthHeight(r)).shape)this.updateFontSize(r);else if("line"===r.shape||"arrow"===r.shape){r.pointColl=this.getLinePoints(r.activePoint.startX,r.activePoint.startY,r.activePoint.endX,r.activePoint.endY);for(var s=0,a=r.pointColl.length;s<a;s++)r.pointColl[s].ratioX=(r.pointColl[s].x-t.img.destLeft)/t.img.destWidth,r.pointColl[s].ratioY=(r.pointColl[s].y-t.img.destTop)/t.img.destHeight;"arrow"===r.shape&&this.updateArrowSize(r),0===t.transform.straighten||"line"!==r.shape&&"arrow"!==r.shape||this.straightenShapePoints(r)}else if("path"===r.shape){for(var l=0,h=r.pointColl.length;l<h;l++)r.pointColl[l].x=r.pointColl[l].ratioX*t.img.destWidth+t.img.destLeft,r.pointColl[l].y=r.pointColl[l].ratioY*t.img.destHeight+t.img.destTop;this.updatePathRatio(r),0!==t.transform.straighten&&this.straightenPath(r)}t.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:r.activePoint,obj:r}}),"line"!==r.shape&&"arrow"!==r.shape&&"path"!==r.shape&&0!==r.rotatedAngle&&(this.setPointCollForShapeRotation(r),r.rotationCirclePoint.x=r.rotationCirclePoint.ratioX*t.img.destWidth+t.img.destLeft,r.rotationCirclePoint.y=r.rotationCirclePoint.ratioY*t.img.destHeight+t.img.destTop,r.rotationCirclePointColl)&&(r.rotationCirclePointColl.x=r.rotationCirclePointColl.ratioX*t.img.destWidth+t.img.destLeft,r.rotationCirclePointColl.y=r.rotationCirclePointColl.ratioY*t.img.destHeight+t.img.destTop)}je(e)&&(e=this.lowerContext.filter,this.lowerContext.filter="none",this.iterateObjColl(),this.lowerContext.filter=e)}t.img.destLeft=i.startX,t.img.destTop=i.startY,t.img.destWidth=i.width,t.img.destHeight=i.height},nUt.prototype.straightenPath=function(e){for(var t,i=0,n=e.pointColl.length;i<n;i++)t=this.straightenPoints(e.pointColl[i].x,e.pointColl[i].y),e.pointColl[i].x=t.x,e.pointColl[i].y=t.y},nUt.prototype.straightenFHD=function(){for(var e=this.parent,t=0,i=e.freehandCounter;t<i;t++){e.points=Pe([],e.pointColl[t].points,[]);for(var n=e.points.length,o=void 0,r=0;r<n;r++)o=this.straightenPoints(e.points[r].x,e.points[r].y),e.points[r].x=o.x,e.points[r].y=o.y}var s={selPointColl:null};e.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:s}});for(t=0,i=e.freehandCounter;t<i;t++)if(s.selPointColl[t]&&s.selPointColl[t].points)for(n=s.selPointColl[t].points.length,o=void 0,r=0;r<n;r++)o=this.straightenPoints(s.selPointColl[t].points[r].x,s.selPointColl[t].points[r].y),s.selPointColl[t].points[r].x=o.x,s.selPointColl[t].points[r].y=o.y;var a,l={straightenPoint:null};e.notify("freehand-draw",{prop:"getStraightenPoint",onPropertyChange:!1,value:{obj:l}}),l.straightenPoint.x&&l.straightenPoint.y&&(e.notify("freehand-draw",{prop:"getStraightenPointAngle",onPropertyChange:!(a={angle:0}),value:{obj:a}}),a=((360===e.transform.straighten?0:e.transform.straighten)-a.angle)*(Math.PI/180),o=this.straightenPoints(l.straightenPoint.x,l.straightenPoint.y,a),0==a&&(o.x=l.straightenPoint.x,o.y=l.straightenPoint.y),e.notify("freehand-draw",{prop:"setStraightenPoint",onPropertyChange:!1,value:{x:o.x,y:o.y}}))},nUt.prototype.straightenPoints=function(e,t,i){var n=this.parent,o=n.img.destLeft+n.img.destWidth/2,r=n.img.destTop+n.img.destHeight/2;return i=i||n.transform.straighten*(Math.PI/180),{x:Math.cos(i)*(e-o)-Math.sin(i)*(t-r)+o,y:Math.sin(i)*(e-o)+Math.cos(i)*(t-r)+r}},nUt.prototype.straightenShapes=function(){var e,t,i,n=this.parent,o=n.img,r=o.destLeft,s=o.destTop,a=o.destWidth,o=o.destHeight;n.isStraightening&&0!==n.transform.straighten&&(n.notify("draw",{prop:"updateImgCanvasPoints"}),n.notify("draw",{prop:"getImageCanvasPoints",value:{obj:e={points:null}}}),r=r+a/2,a=s+o/2,s=-(n.transform.straighten*(Math.PI/180)),o={x:Math.cos(s)*(e.points[0].x-r)-Math.sin(s)*(e.points[0].y-a)+r,y:Math.sin(s)*(e.points[0].x-r)+Math.cos(s)*(e.points[0].y-a)+a},t=Math.cos(s)*(e.points[1].x-r)-Math.sin(s)*(e.points[1].y-a)+r,i=Math.sin(s)*(e.points[1].x-r)+Math.cos(s)*(e.points[1].y-a)+a,Math.cos(s),e.points[2].x,Math.sin(s),e.points[2].y,r=Math.sin(s)*(e.points[2].x-r)+Math.cos(s)*(e.points[2].y-a)+a,n.img.destWidth=t-o.x,n.img.destHeight=r-i,n.img.destLeft=o.x,n.img.destTop=o.y)},nUt.prototype.straightenShapePoints=function(e,t){var i=this.parent,n=i.img,o=n.destLeft,r=n.destTop,s=n.destWidth,n=n.destHeight;!i.isStraightening||"line"!==e.shape&&"arrow"!==e.shape||(e.activePoint.width=e.activePoint.endX>e.activePoint.startX?e.activePoint.endX-e.activePoint.startX:e.activePoint.startX-e.activePoint.endX,e.activePoint.height=e.activePoint.endY>e.activePoint.startY?e.activePoint.endY-e.activePoint.startY:e.activePoint.startY-e.activePoint.endY,o=o+s/2,s=r+n/2,r=(t?-i.transform.straighten:i.transform.straighten)*(Math.PI/180),n={x:Math.cos(r)*(e.activePoint.startX-o)-Math.sin(r)*(e.activePoint.startY-s)+o,y:Math.sin(r)*(e.activePoint.startX-o)+Math.cos(r)*(e.activePoint.startY-s)+s},t={x:Math.cos(r)*(e.activePoint.endX-o)-Math.sin(r)*(e.activePoint.endY-s)+o,y:Math.sin(r)*(e.activePoint.endX-o)+Math.cos(r)*(e.activePoint.endY-s)+s},e.activePoint.startX=n.x,e.activePoint.startY=n.y,e.activePoint.endX=t.x,e.activePoint.endY=t.y,e.activePoint.width=e.activePoint.endX>e.activePoint.startX?e.activePoint.endX-e.activePoint.startX:e.activePoint.startX-e.activePoint.endX,e.activePoint.height=e.activePoint.endY>e.activePoint.startY?e.activePoint.endY-e.activePoint.startY:e.activePoint.startY-e.activePoint.endY,i.notify("selection",{prop:"adjustActObjForLineArrow",onPropertyChange:!1,value:{obj:e}}))},nUt.prototype.redrawObj=function(e){var t=this.parent,i=!1;if(0<t.objColl.length)if("horizontal"===e||"vertical"===e||"Horizontal"===e||"Vertical"===e||"horizontalVertical"===e||"verticalHorizontal"===e)this.updateCurrentActiveObjPoint(e.toLowerCase());else if("number"==typeof e){this.updateCurrentActiveObjPoint(e);e=this.lowerContext.filter;this.lowerContext.filter="brightness(1) contrast(100%) hue-rotate(0deg) saturate(100%) opacity(1) blur(0px) sepia(0%) grayscale(0%) invert(0%)";for(var n=0,o=t.objColl.length;n<o;n++)"crop"!==t.objColl[n].shape.split("-")[0]&&(this.apply(t.objColl[n].shape,t.objColl[n]),i=!0);i&&t.notify("draw",{prop:"applyFrame",value:{ctx:this.lowerContext,frame:t.frameObj.type,preventImg:!0}}),this.lowerContext.filter=e}},nUt.prototype.updateCurrentActiveObjPoint=function(e){for(var t,i=this.parent,n=i.img,o=n.destLeft,r=n.destTop,s=n.destWidth,a=n.destHeight,l=0,h=i.objColl.length;l<h;l++){var d=i.objColl[l];if(i.activeObj.shape===d.shape&&i.activeObj.activePoint.startX===d.activePoint.startX&&i.activeObj.activePoint.startY===d.activePoint.startY&&i.activeObj.activePoint.endX===d.activePoint.endX&&i.activeObj.activePoint.endY===d.activePoint.endY&&i.activeObj.currIndex===d.currIndex){t=l;break}}if("horizontal"===e||"vertical"===e||"Horizontal"===e||"Vertical"===e||"horizontalvertical"===e||"verticalhorizontal"===e){if("horizontal"===e||"Horizontal"===e)for(var p=0,h=i.objColl.length;p<h;p++)(d=i.objColl[p]).shapeFlip!==i.transform.currFlipState&&(d.activePoint.startX<=o+s/2?(d.activePoint.endX=o+s-(d.activePoint.startX-o),d.activePoint.startX=d.activePoint.endX-d.activePoint.width,i.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:d.activePoint,obj:d}})):d.activePoint.startX>=o+s/2&&(d.activePoint.startX=o+(o+s-d.activePoint.endX),d.activePoint.endX=d.activePoint.startX+d.activePoint.width,i.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:d.activePoint,obj:d}})),"line"===d.shape||"arrow"===d.shape||"path"===d.shape?this.flipLineArrowObj(d,"horizontal"):0!==d.rotatedAngle&&(d.rotatedAngle=d.rotatedAngle+2*(Math.PI-d.rotatedAngle),d.rotationCirclePointColl.x<=o+s/2?d.rotationCirclePointColl.x=o+s-(d.rotationCirclePointColl.x-o):d.rotationCirclePointColl.x>=o+s/2&&(d.rotationCirclePointColl.x=o+(o+s-d.rotationCirclePointColl.x)),d.rotationCirclePointColl.ratioX=(d.rotationCirclePointColl.x-o)/s),d.shapeFlip=i.transform.currFlipState,d.imageRatio={startX:(d.activePoint.startX-o)/s,startY:(d.activePoint.startY-r)/a,endX:(d.activePoint.endX-o)/s,endY:(d.activePoint.endY-r)/a,width:s/d.activePoint.width,height:a/d.activePoint.height});else if("vertical"===e||"Vertical"===e)for(p=0;p<i.objColl.length;p++)(d=i.objColl[p]).shapeFlip!==i.transform.currFlipState&&(d.activePoint.startY<=r+a/2?(d.activePoint.endY=r+a-(d.activePoint.startY-r),d.activePoint.startY=d.activePoint.endY-d.activePoint.height,i.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:d.activePoint,obj:d}})):d.activePoint.startY>=i.lowerCanvas.height/2&&(d.activePoint.startY=r+(r+a-d.activePoint.endY),d.activePoint.endY=d.activePoint.startY+d.activePoint.height,i.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:d.activePoint,obj:d}})),"line"===d.shape||"arrow"===d.shape||"path"===d.shape?this.flipLineArrowObj(d,"vertical"):0!==d.rotatedAngle&&(d.rotatedAngle=-d.rotatedAngle,d.rotationCirclePointColl.y<=r+a/2?d.rotationCirclePointColl.y=r+a-(d.rotationCirclePointColl.y-r):d.rotationCirclePointColl.y>=r+a/2&&(d.rotationCirclePointColl.y=r+(r+a-d.rotationCirclePointColl.y)),d.rotationCirclePointColl.ratioY=(d.rotationCirclePointColl.y-r)/a),d.shapeFlip=i.transform.currFlipState,d.imageRatio={startX:(d.activePoint.startX-o)/s,startY:(d.activePoint.startY-r)/a,endX:(d.activePoint.endX-o)/s,endY:(d.activePoint.endY-r)/a,width:s/d.activePoint.width,height:a/d.activePoint.height});else if("verticalhorizontal"===e||"horizontalvertical"===e)for(p=0,h=i.objColl.length;p<h;p++)(d=i.objColl[p]).shapeFlip!==i.transform.currFlipState&&(d.activePoint.startX<=o+s/2?(d.activePoint.endX=o+s-(d.activePoint.startX-o),d.activePoint.startX=d.activePoint.endX-d.activePoint.width,i.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:d.activePoint,obj:d}})):d.activePoint.startX>=o+s/2&&(d.activePoint.startX=o+(o+s-d.activePoint.endX),d.activePoint.endX=d.activePoint.startX+d.activePoint.width,i.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:d.activePoint,obj:d}})),d.activePoint.startY<=r+a/2?(d.activePoint.endY=r+a-(d.activePoint.startY-r),d.activePoint.startY=d.activePoint.endY-d.activePoint.height,i.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:d.activePoint,obj:d}})):d.activePoint.startY>=i.lowerCanvas.height/2&&(d.activePoint.startY=r+(r+a-d.activePoint.endY),d.activePoint.endY=d.activePoint.startY+d.activePoint.height,i.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:d.activePoint,obj:d}})),"line"!==d.shape&&"arrow"!==d.shape&&"path"!==d.shape||this.flipLineArrowObj(d,e),d.shapeFlip=i.transform.currFlipState,d.imageRatio={startX:(d.activePoint.startX-o)/s,startY:(d.activePoint.startY-r)/a,endX:(d.activePoint.endX-o)/s,endY:(d.activePoint.endY-r)/a,width:s/d.activePoint.width,height:a/d.activePoint.height});void 0!==t&&(i.activeObj=Pe({},i.objColl[t],{},!0))}else if(90===e)this.rotateObjColl();else if(-90===e)for(p=0;p<3;p++)this.rotateObjColl();else if("number"==typeof e)if(0<e)this.rotateObjColl();else for(p=0;p<3;p++)this.rotateObjColl()},nUt.prototype.rotateObjColl=function(){for(var e=this.parent,t=e.img,i=t.destWidth,n=t.destHeight,o=t.destLeft,r=t.destTop,s=0,a=e.objColl.length;s<a;s++){var l=(h=e.objColl[s]).shape;h.activePoint.startY=r+n*h.imageRatio.startX,h.activePoint.endY=r+n*h.imageRatio.endX,h.activePoint.startX=o+i-i*h.imageRatio.endY,h.activePoint.endX=o+i-i*h.imageRatio.startY,h=this.updateWidthHeight(e.objColl[s]),this.updateFontSize(h),"line"===l||"arrow"===l||"path"===l?(this.rotateLineArrowObj(h),"arrow"===l&&this.updateArrowSize(h)):0!==h.rotatedAngle&&(h.rotationCirclePointColl.y=r+n*h.rotationCirclePointColl.ratioX,h.rotationCirclePointColl.x=o+i-i*h.rotationCirclePointColl.ratioY,h.rotationCirclePointColl.ratioX=(h.rotationCirclePointColl.x-o)/i,h.rotationCirclePointColl.ratioY=(h.rotationCirclePointColl.y-r)/n)}for(s=0,a=e.objColl.length;s<a;s++)e.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:e.objColl[s].activePoint,obj:e.objColl[s]}});for(var h,s=0,a=e.objColl.length;s<a;s++)(h=e.objColl[s]).imageRatio={startX:(h.activePoint.startX-o)/i,startY:(h.activePoint.startY-r)/n,endX:(h.activePoint.endX-o)/i,endY:(h.activePoint.endY-r)/n,width:i/h.activePoint.width,height:n/h.activePoint.height}},nUt.prototype.rotateLineArrowObj=function(e){if(!je(e.pointColl)){var t=this.parent.img,i=t.destWidth,n=t.destHeight,o=t.destLeft,r=t.destTop;if(0<e.pointColl.length){for(var s=0;s<e.pointColl.length;s++)e.pointColl[s].y=r+n*e.pointColl[s].ratioX,e.pointColl[s].x=o+i-i*e.pointColl[s].ratioY;for(s=0;s<e.pointColl.length;s++)e.pointColl[s].ratioX=(e.pointColl[s].x-o)/i,e.pointColl[s].ratioY=(e.pointColl[s].y-r)/n;var t=void 0,t=je(e.pointColl[e.pointColl.length-2])?{x:0,y:0}:{x:e.pointColl[e.pointColl.length-2].x,y:e.pointColl[e.pointColl.length-2].y},a=e.pointColl[e.pointColl.length-1].x-t.x,t=e.pointColl[e.pointColl.length-1].y-t.y;e.activePoint.startX=e.pointColl[0].x,e.activePoint.startY=e.pointColl[0].y,e.activePoint.endX=e.pointColl[e.pointColl.length-1].x+a/2,e.activePoint.endY=e.pointColl[e.pointColl.length-1].y+t/2,this.updateWidthHeight(e)}}},nUt.prototype.flipLineArrowObj=function(e,t){t=t.toLowerCase(),je(e.pointColl)||("horizontal"===t?this.lineArrowHorizontalFlip(e):("vertical"!==t&&(this.lineArrowHorizontalFlip(e),e.shapeFlip=""),this.lineArrowVerticalFlip(e)),e.activePoint.startX=e.pointColl[0].x,e.activePoint.startY=e.pointColl[0].y,e.activePoint.endX=e.pointColl[e.pointColl.length-1].x,e.activePoint.endY=e.pointColl[e.pointColl.length-1].y,e.activePoint.startX>e.activePoint.endX&&(t=e.activePoint.startX,e.activePoint.startX=e.activePoint.endX,e.activePoint.endX=t,t=e.activePoint.startY,e.activePoint.startY=e.activePoint.endY,e.activePoint.endY=t))},nUt.prototype.lineArrowHorizontalFlip=function(e){var t=this.parent,i=t.img,n=i.destWidth,o=i.destHeight,r=i.destLeft,s=i.destTop;if(e.shapeFlip!==t.transform.currFlipState){for(var a=0,l=e.pointColl.length;a<l;a++){var h=e.pointColl[a];h.x<=r+n/2?h.x=r+n-(h.x-r):h.x>=r+n/2&&(h.x=r+(r+n-h.x)),h.ratioX=(h.x-r)/n,h.ratioY=(h.y-s)/o}"arrow"===e.shape&&(i=e.start,e.start=e.end,e.end=i),e.shapeFlip=t.transform.currFlipState}},nUt.prototype.lineArrowVerticalFlip=function(e){var t=this.parent,i=t.img,n=i.destWidth,o=i.destHeight,r=i.destLeft,s=i.destTop;if(e.shapeFlip!==t.transform.currFlipState){for(var a=0,l=e.pointColl.length;a<l;a++){var h=e.pointColl[a];h.y<=s+o/2?h.y=s+o-(h.y-s):h.y>=s+o/2&&(h.y=s+(s+o-h.y)),h.ratioX=(h.x-r)/n,h.ratioY=(h.y-s)/o}e.shapeFlip=t.transform.currFlipState}},nUt.prototype.getRotDegOfShape=function(e,t){var i=this.parent,e=((n=0===e.shapeDegree?this.parent.transform.degree:this.parent.transform.degree-e.shapeDegree)<0&&(n=360+n),{bool:!1});if(i.notify("selection",{prop:"getTransformedShape",onPropertyChange:!1,value:{obj:e}}),e.bool&&!t&&i.activeObj.rotateFlipColl)for(var n=0,o=0;o<i.activeObj.rotateFlipColl.length;o++)"number"==typeof i.activeObj.rotateFlipColl[o]&&(n+=i.activeObj.rotateFlipColl[o]);return n},nUt.prototype.renderTextArea=function(e,t,i){var n=this.parent,o={shapeSettingsObj:{}},o=(n.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:o}}),o.shapeSettingsObj),o={cancel:!1,action:"text-edit",previousShapeSettings:o,currentShapeSettings:o},o=(n.trigger("shapeChanging",o),this.updateShapeChangeEventArgs(o.currentShapeSettings,o.allowShapeOverflow),this.getRotDegOfShape(n.activeObj)),r=(this.transformTextArea(),n.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1}),n.element.querySelector("#"+n.element.id+"_zOrderBtn")),s=n.element.querySelector("#"+n.element.id+"_duplicate"),a=n.element.querySelector("#"+n.element.id+"_remove"),l=n.element.querySelector("#"+n.element.id+"_editText"),h=i.strokeSettings.outlineColor,d=i.strokeSettings.outlineWidth,p=[],r=(r&&r.classList.add("e-overlay"),s&&s.classList.add("e-overlay"),a&&a.classList.add("e-overlay"),l&&l.classList.add("e-overlay"),""!==i.strokeSettings.fillColor?n.textArea.style.backgroundColor=i.strokeSettings.fillColor:n.textArea.style.backgroundColor="transparent",n.textArea.style.display="block",n.textArea.style.left=e+"px",n.textArea.style.top=t+"px",n.textArea.style.fontFamily=i.textSettings.fontFamily,n.textArea.style.fontSize=i.textSettings.fontSize+"px",n.textArea.style.color=i.strokeSettings.strokeColor,i.textSettings.fontSize),c=Math.max(1,d/2)*(.5*Math.floor((r-1)/16)+.5);if(/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$|^[a-zA-Z]+$/.test(i.strokeSettings.outlineColor)){for(var u=-c;u<=c;u++)for(var g=-c;g<=c;g++)0===u&&0===g||p.push(u/2+"px "+g/2+"px 0 "+h);n.textArea.style.textShadow=p.join(", ")}else n.textArea.style.textShadow=null;n.textArea.style.fontWeight=i.textSettings.bold?"bold":"normal",n.textArea.style.fontStyle=i.textSettings.italic?"italic":"normal",n.textArea.style.border="2px solid "+n.themeColl[n.theme].primaryColor,n.textArea.value=i.keyHistory,n.textArea.style.overflow="hidden",n.textArea.style.width="auto",n.textArea.style.height="auto",n.textArea.focus();s=i.activePoint,a=s.width,l=s.height,o%90==0&&o%180!=0&&0!==o?(n.textArea.style.width=l+.25*l+"px",n.textArea.style.height=a+.25*a+"px"):(n.textArea.style.width=a+.25*a+"px",n.textArea.style.height=l+.25*l+"px"),this.setTextBoxWidth(),e={flipColl:null};if(n.notify("transform",{prop:"getFlipColl",onPropertyChange:!1,value:{obj:e}}),e.flipColl.length<=1&&this.setTextBoxHeight(),parseFloat(n.textArea.style.maxHeight)<n.activeObj.textSettings.fontSize&&(n.textArea.style.maxHeight=n.activeObj.textSettings.fontSize+"px"),o%90==0&&o%180!=0?parseFloat(n.textArea.style.left)+parseFloat(n.textArea.style.width)>n.img.destTop+n.img.destHeight&&this.alignTextAreaIntoCanvas():parseFloat(n.textArea.style.left)+parseFloat(n.textArea.style.width)>n.img.destLeft+n.img.destWidth&&this.alignTextAreaIntoCanvas(),0!==i.rotatedAngle){var m=parseFloat(n.textArea.style.left),t=parseFloat(n.textArea.style.top),f=(0<i.flipObjColl.length&&(r=(d=n.lowerCanvas).clientWidth,s=d.clientHeight,n.notify("crop",{prop:"getCurrFlipState",onPropertyChange:!(a={x:0,y:0}),value:{panObj:l={panRegion:""}}}),""!==l.panRegion)&&("horizontal"===l.panRegion?(a.x=r-r/2,m=a.x-m+a.x):t=("vertical"===l.panRegion?a.y=s-s/2:m=(a={x:r-r/2,y:s-s/2}).x-m+a.x,a.y-t+a.y)),m+parseFloat(n.textArea.style.width)),y=t+parseFloat(n.textArea.style.height),v=parseFloat(n.textArea.style.width),b=parseFloat(n.textArea.style.height),w={x:f-v/2,y:y-b/2},C=Math.cos(i.rotatedAngle),S=Math.sin(i.rotatedAngle),A={x:C*(f-w.x)-S*(y-w.y)+w.x,y:S*(f-w.x)+C*(y-w.y)+w.y};if(A.x>n.img.destLeft&&A.x<n.img.destLeft+n.img.destWidth&&A.y>n.img.destTop&&A.y+parseFloat(n.textArea.style.fontSize)<n.img.destTop+n.img.destHeight)n.textArea.style.width=n.textArea.style.width;else for(var x=0,I=parseFloat(n.textArea.style.width);;)if(x++,(A={x:C*((f=m+--v)-(w={x:f-v/2,y:y-b/2}).x)-S*(y-w.y)+w.x,y:S*(f-w.x)+C*(y-w.y)+w.y}).x>n.img.destLeft&&A.x<n.img.destLeft+n.img.destWidth&&A.y>n.img.destTop&&A.y+parseFloat(n.textArea.style.fontSize)<n.img.destTop+n.img.destHeight||x===I){n.textArea.style.width=v+"px";break}}n.notify("selection",{prop:"clearUpperCanvas",onPropertyChange:!1})},nUt.prototype.setTextBoxWidth=function(e){var t,i,n,o,r,s=this.parent;0!==s.activeObj.rotatedAngle?(s.textArea.style.whiteSpace="nowrap",s.textArea.style.textOverflow="ellipsis",s.textArea.style.display="inline-block"):(s.textArea.style.whiteSpace="",s.textArea.style.textOverflow="","inline-block"===s.textArea.style.display&&(s.textArea.style.display="block"),t=this.getMaxText(!0),"block"===s.textArea.style.display||"inline-block"===s.textArea.style.display?this.updateFontStyles(!0):this.updateFontStyles(),t=this.upperContext.measureText(t).width+parseFloat(s.textArea.style.fontSize)/2,i=e?this.upperContext.measureText(String.fromCharCode(e.which)).width:0,o=Pe({},s.activeObj,{},!0),r="",n=this.getRotDegOfShape(o),r=o.shapeFlip!==s.transform.currFlipState?"":s.transform.currFlipState,(e&&parseFloat(s.textArea.style.width)<t+i||je(e))&&(0===n?"horizontal"===r.toLowerCase()?0<parseFloat(s.textArea.style.left)-s.img.destLeft-t-i&&(s.textArea.style.width=t+i+"px"):s.img.destWidth-(parseFloat(s.textArea.style.left)-s.img.destLeft)>t+i&&(s.textArea.style.width=t+i+"px"):90===n?"vertical"===r.toLowerCase()?0<parseFloat(s.textArea.style.top)-s.img.destTop-t-i&&(s.textArea.style.width=t+i+"px"):s.img.destHeight-(parseFloat(s.textArea.style.top)-s.img.destTop)>t+i&&(s.textArea.style.width=t+i+"px"):180===n?(o=parseFloat(s.textArea.style.left),e=s.img.destLeft,"horizontal"===r.toLowerCase()?t+i<s.img.destWidth-(o-e)&&(s.textArea.style.width=t+i+"px"):0<o-e-t-i&&(s.textArea.style.width=t+i+"px")):270===n&&(o=parseFloat(s.textArea.style.top),e=s.img.destTop,"vertical"===r.toLowerCase()?t+i<s.img.destHeight-(o-e)&&(s.textArea.style.width=t+i+"px"):0<o-e-t-i&&(s.textArea.style.width=t+i+"px"))))},nUt.prototype.setTextBoxHeight=function(){var e,t=this.parent,i=Pe({},t.activeObj,{},!0),n="",o=this.getRotDegOfShape(i),n=i.textFlip===t.transform.currFlipState?"":""===i.textFlip?t.transform.currFlipState:i.textFlip;switch(o){case 0:"vertical"===n.toLowerCase()?t.textArea.style.maxHeight=t.img.destHeight-(t.img.destHeight-parseFloat(t.textArea.style.top))+"px":(e=parseFloat(t.textArea.style.top)-t.img.destTop,t.textArea.style.maxHeight=t.img.destHeight-e+"px");break;case 90:"horizontal"===n.toLowerCase()?t.textArea.style.maxHeight=t.img.destWidth-(parseFloat(t.textArea.style.left)-t.img.destLeft)+"px":t.textArea.style.maxHeight=parseFloat(t.textArea.style.left)-t.img.destLeft+"px";break;case 180:"vertical"===n.toLowerCase()?(e=parseFloat(t.textArea.style.top)-t.img.destTop,t.textArea.style.maxHeight=t.img.destHeight-e+"px"):t.textArea.style.maxHeight=parseFloat(t.textArea.style.top)-t.img.destTop+"px";break;case 270:"horizontal"===n.toLowerCase()?t.textArea.style.maxHeight=parseFloat(t.textArea.style.left)-t.img.destLeft+"px":t.textArea.style.maxHeight=t.img.destWidth-(parseFloat(t.textArea.style.left)-t.img.destLeft)+"px"}},nUt.prototype.updatePathRatio=function(e){for(var t=this.parent,i=0,n=e.pointColl.length;i<n;i++){var o=e.pointColl[i];o.ratioX=(o.x-t.img.destLeft)/t.img.destWidth,o.ratioY=(o.y-t.img.destTop)/t.img.destHeight}},nUt.prototype.stopPathDrawing=function(e,t){var i,n,o,r=this.parent;"path"===r.activeObj.shape&&(r.notify("selection",{prop:"getCurrentDrawingShape",value:{obj:o={shape:null}}}),"path"===o.shape)&&(o=Pe({},r.cropObj,{},!0),r.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(n={currObj:{}}),value:{object:n}}),(n=n.currObj).objColl=Pe([],r.objColl,[],!0),n.pointColl=Pe([],r.pointColl,[],!0),n.afterCropActions=Pe([],r.afterCropActions,[],!0),r.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(i={selPointColl:null}),value:{obj:i}}),n.selPointColl=Pe([],i.selPointColl,[],!0),r.notify("selection",{prop:"setCurrentDrawingShape",value:{value:""}}),r.currObjType.isDragging=!1,e&&"touchstart"!==e.type&&je(t)&&r.activeObj.pointColl.pop(),this.updatePathRatio(r.activeObj),je(r.activeObj.imageRatio)&&r.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),r.objColl.push(r.activeObj),r.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:n,previousObjColl:n.objColl,previousPointColl:n.pointColl,previousSelPointColl:n.selPointColl,previousCropObj:o,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),r.objColl.pop(),e&&(r.notify("selection",{prop:"mouseUpEventHandler",value:{e:e}}),this.lowerContext.clearRect(0,0,r.lowerCanvas.width,r.lowerCanvas.height),r.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1}),0<r.objColl.length)&&(i=r.activeObj.activePoint,t=r.objColl[r.objColl.length-1].activePoint,Math.floor(i.startX)===Math.floor(t.startX))&&Math.floor(i.startY)===Math.floor(t.startY)&&Math.floor(i.endX)===Math.floor(t.endX)&&Math.floor(i.endY)===Math.floor(t.endY)&&this.refreshActiveObj(),r.notify("draw",{prop:"setNewPath",value:{bool:!0}}),r.objColl[r.objColl.length-1]&&(n=r.drawingShape,r.notify("selection",{prop:"setCurrentDrawingShape",value:{value:""}}),r.noRedact=!0,r.selectShape(r.objColl[r.objColl.length-1].currIndex),r.notify("selection",{prop:"setCurrentDrawingShape",value:{value:"path"}}),r.drawingShape=n),r.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:null}}),r.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!(o={shapeSettingsObj:{}}),value:{obj:o}}),r.notify("selection",{prop:"triggerShapeChange",onPropertyChange:!1,value:{shapeResizingArgs:{cancel:!1,action:"draw-end",previousShapeSettings:e=o.shapeSettingsObj},shapeMovingArgs:{cancel:!1,action:"move",previousShapeSettings:e},type:"mouse-up"}}),r.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1}))},nUt.prototype.findTextTarget=function(e){var t=this.parent;if(e){if("text"!==t.activeObj.shape){if("path"===t.activeObj.shape)return void this.stopPathDrawing(e,null);if("dblclick"!==e.type)return;t.notify("selection",{prop:"setPanDown",onPropertyChange:!1,value:{panDown:null}});var i=Pe({},t.activeObj,{},!0),n=Pe([],t.objColl,[],!0),o={bool:null};if(t.notify("selection",{prop:"findTargetObj",onPropertyChange:!1,value:{x:e.clientX,y:e.clientY,isCrop:!1,obj:o}}),t.objColl=n,!o.bool||"text"!==t.activeObj.shape)return void(t.activeObj=Pe({},i,{},!0))}if("dblclick"===e.type?(a=e.clientX,l=e.clientY):"touchstart"===e.type&&(a=e.touches[0].clientX,l=e.touches[0].clientY,t.notify("selection",{prop:"setTouchEndPoint",onPropertyChange:!1,value:{x:e.touches[0].clientX,y:e.touches[0].clientY}})),t.notify("toolbar",{prop:"setPreventZoomBtn",onPropertyChange:!1,value:{isPrevent:!0}}),t.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"text",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}),t.notify("toolbar",{prop:"setPreventZoomBtn",onPropertyChange:!1,value:{isPrevent:!1}}),t.notify("toolbar",{prop:"update-toolbar-items",onPropertyChange:!1}),je(a)||je(l))"block"!==t.textArea.style.display&&"inline-block"!==t.textArea.style.display||""===this.selectedText()||"mousedown"!==e.type?"none"===t.textArea.style.display&&(t.textArea.style.display="block"):(r=t.textArea.value,t.textArea.value+="a",t.textArea.value=r);else{var n=t.lowerCanvas.getBoundingClientRect(),i=(a-=n.left,l-=n.top,""),e=this.getRotDegOfShape(t.activeObj),i=""===t.activeObj.textFlip?t.activeObj.textFlip===t.transform.currFlipState?"":t.transform.currFlipState:t.activeObj.textFlip===t.transform.currFlipState?"":""===t.transform.currFlipState?t.activeObj.textFlip:t.transform.currFlipState,r=void 0;if("none"===t.textArea.style.display){r=Pe({},t.activeObj,{},!0);for(var s=0;s<t.objColl.length;s++)JSON.stringify(t.activeObj)===JSON.stringify(t.objColl[s])&&t.objColl.splice(s,1);this.refreshActiveObj(),this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),this.lowerContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),t.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1}),t.notify("draw",{prop:"redrawDownScale"}),t.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),t.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.upperContext}}),(t.currSelectionPoint&&"crop-circle"===t.currSelectionPoint.shape||t.isCircleCrop)&&t.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),t.activeObj=r,this.updateFontStyles();var a,l,n=Pe({},t.activeObj,{},!0),r=n.topLeftCircle.radius,h=n.activePoint,d=h.startX,p=h.startY,c=h.endX,u=h.endY,g=d+h.width/2,h=p+h.height/2,m=Math.cos(n.rotatedAngle),f=Math.sin(n.rotatedAngle),y={x:m*(d-g)-f*(p-h)+g,y:f*(d-g)+m*(p-h)+h},p={x:m*(c-g)-f*(p-h)+g,y:f*(c-g)+m*(p-h)+h},d={x:m*(d-g)-f*(u-h)+g,y:f*(d-g)+m*(u-h)+h},f={x:m*(c-g)-f*(u-h)+g,y:f*(c-g)+m*(u-h)+h},o={position:null,x:a,y:l,x1:y.x,y1:y.y,x2:p.x,y2:p.y,x3:d.x,y3:d.y,x4:f.x,y4:f.y};t.notify("draw",{prop:"checkPointPosition",onPropertyChange:!1,value:{obj:o}}),0!==n.rotatedAngle&&("inside"===o.position||"on"===o.position)||0===n.rotatedAngle&&a>=n.activePoint.startX-2*r&&a<=n.activePoint.endX+2*r&&l>=n.activePoint.startY-2*r&&l<=n.activePoint.endY+2*r?(this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),4===n.flipObjColl.length&&(n.flipObjColl=[],n.shapeFlip=i=""),""===i&&1<n.flipObjColl.length&&(i=n.flipObjColl[n.flipObjColl.length-1]),l=(a=(c=n.flipObjColl.length<=1?this.setTextBoxPos(n,e,i,a,l):this.setTextBoxPoints(n,e,i,a,l)).x,c.y),0!==t.activeObj.rotatedAngle&&(a=(g=this.getTextBoxPosition(t.activeObj)).x,l=g.y,a=(g=this.setFlipState(a,l,t.activeObj)).x,l=g.y),this.renderTextArea(a,l,n)):this.applyActObj()}}}},nUt.prototype.getTextBoxPosition=function(e,t){var i={x:0,y:0},n=e.activePoint,o=n.startX,r=n.startY,s=n.endX,a=n.endY,l=o+n.width/2,n=r+n.height/2,h=Math.cos(e.rotatedAngle),d=Math.sin(e.rotatedAngle),p={x:h*(o-l)-d*(r-n)+l,y:d*(o-l)+h*(r-n)+n},r={x:h*(s-l)-d*(r-n)+l,y:d*(s-l)+h*(r-n)+n},o={x:h*(o-l)-d*(a-n)+l,y:d*(o-l)+h*(a-n)+n},d={x:h*(s-l)-d*(a-n)+l,y:d*(s-l)+h*(a-n)+n},s=this.getRotDegOfShape(e);return 0===s||360===s?i={x:p.x,y:p.y}:90===s||-270===s?i={x:r.x,y:r.y}:180===s||-180===s?i={x:d.x,y:d.y}:270!==s&&-90!==s||(i={x:o.x,y:o.y}),t&&(t.x=i.x,t.y=i.y),i},nUt.prototype.setFlipState=function(e,t,i,n){var o=this.parent,r={panRegion:""},s=o.lowerCanvas,a=s.clientWidth,s=s.clientHeight,l={x:0,y:0};return o.notify("crop",{prop:"getCurrFlipState",onPropertyChange:!1,value:{panObj:r}}),""!==r.panRegion&&("horizontal"===r.panRegion?(l.x=a-a/2,e=l.x-e+l.x):t=("vertical"===r.panRegion?l.y=s-s/2:e=(l={x:a-a/2,y:s-s/2}).x-e+l.x,l.y-t+l.y)),n&&(n.x=e,n.y=t),{x:e,y:t}},nUt.prototype.fileChanged=function(e){var t=e.target.files[0],t=t.name&&t.name.split(".").pop().toLowerCase();t&&-1===["jpg","jpeg","png","svg","webp"].indexOf(t)?this.refreshActiveObj():(t=window.URL.createObjectURL(e.target.files[0]),this.onLoadImgShape(null,null,null,null,t.toString(),!0),document.getElementById(this.parent.element.id+"_fileUpload").value="")},nUt.prototype.onLoadImgShape=function(e,t,i,n,o,r,s,a,l,h){var d=this,p=this.parent;"string"==typeof o?this.shapeImg.src=o:(p.inMemoryCanvas.width=o.width,p.inMemoryCanvas.height=o.height,p.inMemoryCanvas.getContext("2d").putImageData(o,0,0),this.shapeImg.src=p.inMemoryCanvas.toDataURL()),this.prevObjColl(),p.activeObj.shape="image",this.initShapeProps(),this.shapeImg.onload=function(){d.upperContext.drawImage(d.shapeImg,0,0,d.shapeImg.width,d.shapeImg.height),d.updateImgCanvas(r,e,t,i,n,s,a,l,h)}},nUt.prototype.updateImgCanvas=function(e,t,i,n,o,r,s,a,l){var h=this.parent,d=(h.activeObj.imageElement=this.shapeImg,h.activeObj.imageCanvas=h.createElement("canvas"),{width:0,height:0}),s=(h.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!1,value:{width:this.shapeImg.width,height:this.shapeImg.height,obj:d,isImgShape:null}}),n&&o&&(d=s?(h.notify("selection",{prop:"findImageRatio",onPropertyChange:!(p={ratio:null}),value:{width:this.shapeImg.width,height:this.shapeImg.height,obj:p}}),this.resizeImage(n,p.ratio)):{width:n,height:o}),this.updateObj(d,t,i),h.notify("draw",{prop:"downScaleImgCanvas",onPropertyChange:!1,value:{ctx:h.activeObj.imageCanvas.getContext("2d"),isImgAnnotation:!0,isHFlip:null,isVFlip:null}}),h.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!1,value:{width:this.shapeImg.width,height:this.shapeImg.height,obj:d,isImgShape:!0}}),n&&o&&(d=s?(h.notify("selection",{prop:"findImageRatio",onPropertyChange:!(p={ratio:null}),value:{width:this.shapeImg.width,height:this.shapeImg.height,obj:p}}),this.resizeImage(n,p.ratio)):{width:n,height:o}),null!=a&&(h.activeObj.opacity=a),this.updateObj(d,t,i),h.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate"}}),this.shapeImg=null,r&&(h.activeObj.rotatedAngle=r*(Math.PI/180),h.notify("selection",{prop:"updPtCollForShpRot",onPropertyChange:!1,value:{obj:h.activeObj}})),{shapeSettingsObj:{}}),p=(h.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:s}}),s.shapeSettingsObj),n={cancel:!1,action:"insert",previousShapeSettings:p,currentShapeSettings:p};h.trigger("shapeChanging",n),h.editCompleteArgs=n,this.drawShapeImageEvent(n,e=e||l),h.isPublicMethod&&!l?h.notify("undo-redo",{prop:"updateUndoRedo",onPropertyChange:!1}):h.isPublicMethod||h.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1}),h.isPublicMethod=!1},nUt.prototype.updateObj=function(e,t,i){var n=this.parent;n.activeObj.activePoint.width=e.width,n.activeObj.activePoint.height=e.height,n.activeObj.activePoint.startX=t||n.lowerCanvas.width/2-e.width/2,n.activeObj.activePoint.startY=i||n.lowerCanvas.height/2-e.height/2,n.activeObj.activePoint.endX=n.activeObj.activePoint.startX+e.width,n.activeObj.activePoint.endY=n.activeObj.activePoint.startY+e.height},nUt.prototype.resizeImage=function(e,t){var t=t.split(":"),i=parseInt(t[0],10),t=parseInt(t[1],10);return{width:e,height:Math.round(e*t/i)}},nUt.prototype.setTextBoxPos=function(e,t,i,n,o){var r={x:n,y:o},n=e.activePoint,s=n.startX,a=n.startY,l=n.endX,h=n.endY;switch(i=i.toLowerCase(),t){case 0:"horizontal"===i?(r.x=l,r.y=a):"vertical"===i?(r.x=s,r.y=h):(r.x=s,r.y=a);break;case 90:"horizontal"===i?(r.x=s,r.y=a):"vertical"===i?(r.x=l,r.y=h):(r.x=l,r.y=a);break;case 180:"horizontal"===i?(r.x=s,r.y=h):"vertical"===i?(r.x=l,r.y=a):(r.x=l,r.y=h);break;case 270:"horizontal"===i?(r.x=l,r.y=h):"vertical"===i?(r.x=s,r.y=a):(r.x=s,r.y=h)}return r},nUt.prototype.setTextBoxPoints=function(e,t,i,n,o){var r={x:n,y:o},n=e.activePoint,s=n.startX,a=n.startY,l=n.endX,h=n.endY;switch(i=i.toLowerCase(),t){case 0:e.flipObjColl[0]&&"horizontal"===e.flipObjColl[0].toLowerCase()?"horizontal"===i?(r.x=s,r.y=a):"vertical"===i&&(r.x=l,r.y=h):"horizontal"===i?(r.x=l,r.y=h):"vertical"===i&&(r.x=l,r.y=a);break;case 90:e.flipObjColl[0]&&"horizontal"===e.flipObjColl[0].toLowerCase()?"horizontal"===i?(r.x=l,r.y=h):"vertical"===i&&(r.x=s,r.y=h):"horizontal"===i?(r.x=s,r.y=h):"vertical"===i&&(r.x=s,r.y=a);break;case 180:e.flipObjColl[0]&&"horizontal"===e.flipObjColl[0].toLowerCase()?"horizontal"!==i&&"vertical"!==i||(r.x=s,r.y=a):"horizontal"===i?(r.x=s,r.y=a):"vertical"===i&&(r.x=s,r.y=h);break;case 270:e.flipObjColl[0]&&"horizontal"===e.flipObjColl[0].toLowerCase()?"horizontal"===i?(r.x=s,r.y=a):"vertical"===i&&(r.x=l,r.y=a):"horizontal"===i?(r.x=l,r.y=a):"vertical"===i&&(r.x=l,r.y=h)}return r},nUt.prototype.selectedText=function(){var e=this.parent,t=e.textArea.selectionStart,i=e.textArea.selectionEnd;return e.textArea.value.substring(t,i)},nUt.prototype.panObjColl=function(e,t,i){var n=this.parent;if(0<n.objColl.length){for(var o=0,r=n.objColl.length;o<r;o++){var s=n.objColl[o];if(""===i){if(s.activePoint.startX+=e,s.activePoint.endX+=e,s.rotationCirclePointColl&&(s.rotationCirclePointColl.x+=e),"path"===s.shape)for(var a=0,l=s.pointColl.length;a<l;a++)s.pointColl[a].x+=e;if(s.activePoint.startY+=t,s.activePoint.endY+=t,s.rotationCirclePointColl&&(s.rotationCirclePointColl.y+=t),"path"===s.shape)for(a=0;a<s.pointColl.length;a++)s.pointColl[a].y+=t}if(s=this.updateWidthHeight(s),n.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:s.activePoint,obj:s}}),"line"===s.shape||"arrow"===s.shape){s.pointColl=this.getLinePoints(s.activePoint.startX,s.activePoint.startY,s.activePoint.endX,s.activePoint.endY);for(var h=0,d=s.pointColl.length;h<d;h++)s.pointColl[h].ratioX=(s.pointColl[h].x-n.img.destLeft)/n.img.destWidth,s.pointColl[h].ratioY=(s.pointColl[h].y-n.img.destTop)/n.img.destHeight}this.refreshActiveObj()}var p=this.lowerContext.filter;this.lowerContext.filter="none",this.iterateObjColl(),this.lowerContext.filter=p,this.refreshActiveObj(),n.notify("draw",{prop:"applyFrame",value:{ctx:this.lowerContext,frame:n.frameObj.type,preventImg:!0}})}},nUt.prototype.updateFontStyles=function(e){var t=this.parent,i=(this.upperContext.strokeStyle=t.activeObj.strokeSettings.strokeColor,this.upperContext.fillStyle=t.activeObj.strokeSettings.strokeColor,""),e=(t.activeObj.textSettings.bold&&(i="bold "),t.activeObj.textSettings.italic&&(i="italic "),t.activeObj.textSettings.bold&&t.activeObj.textSettings.italic&&(i="italic bold "),e?parseFloat(t.textArea.style.fontSize):t.activeObj.textSettings.fontSize),t=("block"===t.textArea.style.display||"inline-block"===t.textArea.style.display?t.textArea.style:t.activeObj.textSettings).fontFamily;this.upperContext.font=i+e+"px "+t},nUt.prototype.applyFontStyle=function(e){var t=this.parent,i={shapeSettingsObj:{}},i=(t.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:i}}),i.shapeSettingsObj),n=(this.pushActItemIntoObj(),Pe([],t.objColl,[],!0));switch(t.objColl.pop(),"none"===t.textArea.style.display?this.updateFontRatio(t.activeObj):this.updateFontRatio(t.activeObj,!0),e){case"default":this.updateFontStyle(e,n,"normal","normal");break;case"bold":this.updateFontStyle(e,n,"bold","normal");break;case"italic":this.updateFontStyle(e,n,"normal","italic");break;case"bolditalic":this.updateFontStyle(e,n,"bold","italic")}i={action:"font-style",currentShapeSettings:Pe({},i,{},!0)};i.currentShapeSettings.fontStyle=[e],t.trigger("shapeChange",i),t.editCompleteArgs=i},nUt.prototype.updateFontStyle=function(e,t,i,n){var o,r=this.parent,s=r.textArea.style;"block"===s.display||"inline-block"===s.display?("normal"===s.fontWeight&&"bold"===i?s.fontWeight="bold":"bold"===s.fontWeight&&"bold"===i&&(s.fontWeight="normal"),"normal"===s.fontStyle&&"italic"===n?s.fontStyle="italic":"italic"===s.fontStyle&&"italic"===n&&(s.fontStyle="normal"),o="normal"===s.fontWeight&&"normal"===s.fontStyle?"default":"bold"===s.fontWeight&&"normal"===s.fontStyle?"bold":"normal"===s.fontWeight&&"italic"===s.fontStyle?"italic":"bolditalic",o=this.getTextAreaWidth(o),s.width=o+"px",this.updateObjColl(e,t)):(this.textSettings.bold=r.activeObj.textSettings.bold="normal"!==i,this.textSettings.italic=r.activeObj.textSettings.italic="normal"!==n,0===r.activeObj.activePoint.width&&0===r.activeObj.activePoint.height||this.redrawText(),r.notify("undo-redo",{prop:"updateUrObj",onPropertyChange:!1,value:{objColl:t}}))},nUt.prototype.updateArrowRatio=function(e){for(var t,i={arrowDimension:null},n=(this.parent.notify("draw",{prop:"getArrowDimension",onPropertyChange:!1,value:{obj:i}}),t=Math.abs(e.activePoint.width)>Math.abs(e.activePoint.height)?Math.abs(e.activePoint.width):Math.abs(e.activePoint.height),0),o=["bar","arrow","arrowSolid","circle","square"];n<o.length;n++){var r,s=t/i.arrowDimension[r=o[n]].width,a=t/i.arrowDimension[r].height;i.arrowDimension[r].ratioX=s,i.arrowDimension[r].ratioY=a}},nUt.prototype.updateArrowSize=function(e){for(var t,i={arrowDimension:null},n=(this.parent.notify("draw",{prop:"getArrowDimension",onPropertyChange:!1,value:{obj:i}}),t=Math.abs(e.activePoint.width)>Math.abs(e.activePoint.height)?Math.abs(e.activePoint.width):Math.abs(e.activePoint.height),0),o=["bar","arrow","arrowSolid","circle","square"];n<o.length;n++){var r,s=i.arrowDimension[r=o[n]].ratioX,a=i.arrowDimension[r].ratioY;i.arrowDimension[r].width=t/s,i.arrowDimension[r].height=t/a}},nUt.prototype.updateFontRatio=function(e,t){var i=this.parent,n=this.getMaxText(t),n=this.upperContext.measureText(n).width+.5*i.activeObj.textSettings.fontSize,o=i.activeObj.textSettings.fontSize,r=this.getRotDegOfShape(e);je(t)?0===r||180===Math.abs(r)?e.textSettings.fontRatio=n/e.textSettings.fontSize:e.textSettings.fontRatio=o/e.textSettings.fontSize:t&&(i.notify("selection",{prop:"getTransformedShape",onPropertyChange:!(t={bool:!1}),value:{obj:t}}),t.bool&&0!==r&&180!==Math.abs(r)?e.textSettings.fontRatio=o/parseFloat(i.textArea.style.fontSize):e.textSettings.fontRatio=n/parseFloat(i.textArea.style.fontSize))},nUt.prototype.updateFontSize=function(e){var t=this.getRotDegOfShape(e,!0);0===t||180===Math.abs(t)?e.textSettings.fontSize=e.activePoint.width/e.textSettings.fontRatio:e.textSettings.fontSize=e.activePoint.height/e.textSettings.fontRatio},nUt.prototype.updateObjColl=function(e,t){var i=this.parent,n=Pe({},i.cropObj,{},!0),o={currObj:{}},o=(i.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:o}}),o.currObj),t=(o.objColl=t,o.pointColl=Pe([],i.pointColl,[],!0),o.afterCropActions=Pe([],i.afterCropActions,[],!0),{selPointColl:null}),t=(i.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:t}}),o.selPointColl=Pe([],t.selPointColl,[],!0),i.activeObj.textSettings.bold),r=i.activeObj.textSettings.italic;switch(e){case"default":i.activeObj.textSettings.bold=!1,i.activeObj.textSettings.italic=!1;break;case"bold":i.activeObj.textSettings.bold=!0,i.activeObj.textSettings.italic=!1;break;case"italic":i.activeObj.textSettings.bold=!1,i.activeObj.textSettings.italic=!0;break;case"bolditalic":i.activeObj.textSettings.bold=!0,i.activeObj.textSettings.italic=!0}i.objColl.push(i.activeObj),i.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"textAreaCustomization",previousObj:o,previousObjColl:o.objColl,previousPointColl:o.pointColl,previousSelPointColl:o.selPointColl,previousCropObj:n,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),i.objColl.pop(),i.activeObj.textSettings.bold=t,i.activeObj.textSettings.italic=r},nUt.prototype.pushActItemIntoObj=function(){var e,t=this.parent;"none"===t.textArea.style.display?0===t.activeObj.activePoint.width&&0===t.activeObj.activePoint.height||t.objColl.push(t.activeObj):(e=Pe({},t.activeObj,{},!0),t.notify("selection",{prop:"setTextBoxStylesToActObj",onPropertyChange:!1}),t.objColl.push(t.activeObj),t.activeObj=e)},nUt.prototype.clearActObj=function(){var e=this.parent;"none"===e.textArea.style.display&&(this.refreshActiveObj(),this.applyActObj(),this.refreshActiveObj(),e.currObjType.isCustomCrop=!1)},nUt.prototype.refreshActiveObj=function(){var e=this.parent;e.activeObj={},e.activeObj.activePoint={startX:0,startY:0,endX:0,endY:0,width:0,height:0},e.activeObj.triangle=[],e.activeObj.triangleRatio=[],e.activeObj.order=null,e.activeObj.flipObjColl=[],e.activeObj.strokeSettings=this.strokeSettings,e.activeObj.textSettings=this.textSettings,e.activeObj.rotatedAngle=0,e.activeObj.opacity=1,e.activeObj.redactType=this.redactType,e.activeObj.redactBlur=e.tempRedactBlur,e.activeObj.redactPixelate=e.tempRedactPixel},nUt.prototype.applyActObj=function(e){var t=this.parent,i=!1;if(void 0!==t.activeObj.shape&&"text"===t.activeObj.shape&&""===t.activeObj.keyHistory)this.refreshActiveObj(),this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height);else{var n=void 0,o=!1;if((void 0===(n=void 0!==t.activeObj.shape?t.activeObj.shape.split("-"):n)&&t.currObjType.isCustomCrop||void 0!==n&&"crop"===n[0])&&(o=!0),t.activeObj.shape&&!o&&"shape"!==t.activeObj.shape){for(var r=0;r<t.objColl.length;r++)if(JSON.stringify(t.activeObj)===JSON.stringify(t.objColl[r])){i=!0;break}if(!i){je(t.activeObj.currIndex)&&(t.activeObj.currIndex=this.getNewShapeId()),je(t.activeObj.order)&&(t.activeObj.order=this.getNewOrder()),this.updImgRatioForActObj();var n=t.activeObj.currIndex.split("_"),s=t.objColl.splice(0,parseInt(n[1],10)-1);s.push(Pe({},t.activeObj,{},!0));for(r=0;r<t.objColl.length;r++)s.push(t.objColl[r]);t.objColl=s,s=[],this.refreshActiveObj(),this.lowerContext.clearRect(0,0,t.lowerCanvas.width,t.lowerCanvas.height),t.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1}),t.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),t.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.upperContext}}),t.currObjType.shape="",this.refreshActiveObj(),t.isCircleCrop&&t.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),t.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1}),je(e)&&(t.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}),t.notify("draw",{prop:"setPrevActObj",onPropertyChange:!1,value:{prevActObj:null}}))}}}},nUt.prototype.getNewShapeId=function(){for(var e=this.parent,t=e.objColl.length+1,i=0;i<e.objColl.length;i++)e.objColl[i].currIndex==="shape_"+t&&(t++,i=-1);return"shape_"+t},nUt.prototype.getNewOrder=function(){for(var e=this.parent,t=(this.updateShapeColl(),e.shapeColl.length+1),i=0;i<e.shapeColl.length;i++)e.shapeColl[i].order===t&&(t++,i=-1);return t},nUt.prototype.getHighestOrder=function(){for(var e=this.parent,t=(this.updateShapeColl(),0),i=0;i<e.shapeColl.length;i++)e.shapeColl[i].order>t&&(t=e.shapeColl[i].order);return t},nUt.prototype.getLowestOrder=function(){for(var e=this.parent,t=(this.updateShapeColl(),1),i=0;i<e.shapeColl.length;i++)e.shapeColl[i].order<t&&(t=e.shapeColl[i].order);return t},nUt.prototype.alignTextAreaIntoCanvas=function(){var e=this.parent,t=e.textArea.value;e.textArea.value="";for(var i=0,n=t.length;i<n;i++)e.textArea.value+=t[i],e.textArea.style.height="auto",e.textArea.style.height=e.textArea.scrollHeight+"px",this.setTextBoxWidth()},nUt.prototype.transformTextArea=function(){var e=this.parent;if("text"===e.activeObj.shape){e.textArea.style.transformOrigin="0 0";var t=e.activeObj.rotatedAngle*(180/Math.PI),i="",n=this.getRotDegOfShape(e.activeObj);if(0<e.activeObj.flipObjColl.length)for(var o=0;o<e.activeObj.flipObjColl.length;o++)i+=0!==n&&n%90==0&&180!==n?"horizontal"===e.activeObj.flipObjColl[o].toLowerCase()?"scale(1, -1)":"scale(-1, 1)":"horizontal"===e.activeObj.flipObjColl[o].toLowerCase()?"scale(-1, 1)":"scale(1, -1)",n+=t,("horizontal"===e.activeObj.flipObjColl[o].toLowerCase()||"vertical"===e.activeObj.flipObjColl[o].toLowerCase())&&(e.textArea.style.transform="rotate("+n+"deg)"+i);else e.textArea.style.transform="rotate("+(n+=t)+"deg)"}},nUt.prototype.getTextAreaWidth=function(e){var t=this.parent,i=t.activeObj.textSettings.bold,n=t.activeObj.textSettings.italic;switch(e){case"default":t.activeObj.textSettings.bold=!1,t.activeObj.textSettings.italic=!1;break;case"bold":t.activeObj.textSettings.bold=!0,t.activeObj.textSettings.italic=!1;break;case"italic":t.activeObj.textSettings.bold=!1,t.activeObj.textSettings.italic=!0;break;case"bolditalic":t.activeObj.textSettings.bold=!0,t.activeObj.textSettings.italic=!0}var e="none"!==t.textArea.style.display;return this.updateFontStyles(e),e=e?this.upperContext.measureText(t.textArea.value).width+.5*t.activeObj.textSettings.fontSize:this.upperContext.measureText(t.activeObj.keyHistory).width+.5*t.activeObj.textSettings.fontSize,t.activeObj.textSettings.bold=i,t.activeObj.textSettings.italic=n,e},nUt.prototype.getRedactObjDetails=function(e){var t=this.parent,i={};switch(i.id=e.currIndex,i.type=t.toPascalCase(e.redactType),i.startX=e.activePoint.startX,i.startY=e.activePoint.startY,i.width=e.activePoint.width,i.height=e.activePoint.height,e.redactType){case"blur":i.blurIntensity=e.redactBlur;break;case"pixelate":i.pixelSize=e.redactPixelate}return i},nUt.prototype.getObjDetails=function(e){var t,i=this.parent,n={},o=(n.id=e.currIndex,n.type=i.toPascalCase(e.shape),n.startX=e.activePoint.startX,n.startY=e.activePoint.startY,n.index=e.order,{coll:null});switch(e.shape){case"rectangle":n.width=e.activePoint.width,n.height=e.activePoint.height,n.strokeColor=e.strokeSettings.strokeColor,n.fillColor=e.strokeSettings.fillColor,n.strokeWidth=e.strokeSettings.strokeWidth,n.degree=e.rotatedAngle*(180/Math.PI);break;case"ellipse":n.radius=e.activePoint.width/2,n.strokeColor=e.strokeSettings.strokeColor,n.fillColor=e.strokeSettings.fillColor,n.strokeWidth=e.strokeSettings.strokeWidth,n.radiusX=e.activePoint.width/2,n.radiusY=e.activePoint.height/2,n.degree=e.rotatedAngle*(180/Math.PI);break;case"line":case"arrow":n.length=e.activePoint.width,n.strokeColor=e.strokeSettings.strokeColor,n.strokeWidth=e.strokeSettings.strokeWidth,n.endX=e.activePoint.endX,n.endY=e.activePoint.endY,"arrow"===e.shape&&(i.notify("selection",{prop:"getArrowType",onPropertyChange:!(t={type:null}),value:{type:e.start,obj:t}}),n.arrowHead=t.type,i.notify("selection",{prop:"getArrowType",onPropertyChange:!1,value:{type:e.end,obj:t}}),n.arrowTail=t.type);break;case"text":n.text=e.keyHistory,n.fontSize=e.textSettings.fontSize,n.fontFamily=e.textSettings.fontFamily,n.color=e.strokeSettings.strokeColor,n.strokeColor=e.strokeSettings.outlineColor,n.fillColor=e.strokeSettings.fillColor,n.strokeWidth=e.strokeSettings.outlineWidth,n.fontStyle=[],e.textSettings.bold&&n.fontStyle.push("bold"),e.textSettings.italic&&n.fontStyle.push("italic"),n.degree=e.rotatedAngle*(180/Math.PI),i.notify("selection",{prop:"updateTransColl",onPropertyChange:!1,value:{obj:o,object:e}}),n.transformCollection=o.coll;break;case"path":n.strokeColor=e.strokeSettings.strokeColor,n.strokeWidth=e.strokeSettings.strokeWidth,n.points=e.pointColl;break;case"image":n.imageData=e.imageCanvas.toDataURL(),n.degree=e.rotatedAngle*(180/Math.PI),n.width=e.activePoint.width,n.height=e.activePoint.height,n.opacity=e.opacity}return n},nUt.prototype.getFreehandDrawDetails=function(e){var t=this.parent,i={};return i.id=t.pointColl[e].id,i.type=AUt.FreehandDraw,i.points=Pe([],t.pointColl[e].points),i.strokeColor=t.pointColl[e].strokeColor,i.strokeWidth=t.pointColl[e].strokeWidth,i.index=t.pointColl[e].order,i},nUt.prototype.getShapeSetting=function(e,t){var i,n=this.parent;if(!n.disabled&&n.isImageLoaded)if("none"!==n.textArea.style.display?n.okBtn(null,!0):this.applyActObj(!0),"shape"===e.split("_")[0]){for(var o,r=0,s=n.objColl.length;r<s;r++)if(n.objColl[r].currIndex===e){o=Pe({},n.objColl[r],{},!0);break}i=this.getObjDetails(o)}else"pen"===e.split("_")[0]&&(i=this.getFreehandDrawDetails(parseInt(e.split("_")[1],10)-1));t.shapeDetails=i},nUt.prototype.getShapeSettings=function(e){var t=this.parent,i=[];if(!t.disabled&&t.isImageLoaded){"none"!==t.textArea.style.display?t.okBtn(null,!0):this.applyActObj(!0);for(var n=0,o=t.objColl.length;n<o;n++){var r=this.getObjDetails(t.objColl[n]);i.push(r)}for(n=0;n<t.freehandCounter;n++){r=this.getFreehandDrawDetails(n);i.push(r)}}e.shapeDetailsColl=i},nUt.prototype.getRedactSettings=function(e){var t=this.parent,i=[];if(!t.disabled&&t.isImageLoaded){"none"!==t.textArea.style.display?t.okBtn(null,!0):this.applyActObj(!0);for(var n=0,o=t.objColl.length;n<o;n++){var r=this.getRedactObjDetails(t.objColl[n]);i.push(r)}}e.shapeDetailsColl=i},nUt.prototype.isPointsInRange=function(e,t,i){var n=!1,o=this.parent;!je(e)&&!je(t)&&e>=o.img.destLeft&&t>=o.img.destTop&&e<=o.img.destLeft+o.img.destWidth&&t<=o.img.destTop+o.img.destHeight&&(n=!0),i.inRange=n},nUt.prototype.alignRotateFlipColl=function(e,t,i){return e=this.popForDefaultTransformedState(e),e=this.popForDefaultFlipState(e),0===(e=this.popForDefaultRotateState(e)).length&&t&&(this.parent.transform.degree=0,this.parent.transform.currFlipState=""),i.collection=e},nUt.prototype.popForDefaultTransformedState=function(e){for(var t=0,i=0,n=0,o=0,r=0;r<e.length;r++)90===e[r]||"rotateRight"===e[r]?(o=n=i=0,4===++t&&(e.pop(),e.pop(),e.pop(),e.pop())):-90===e[r]||"rotateLeft"===e[r]?(o=n=t=0,4===++i&&(e.pop(),e.pop(),e.pop(),e.pop())):"horizontal"===e[r]||"Horizontal"===e[r]||"horizontalflip"===e[r]?(o=t=i=0,2===++n&&(e.pop(),e.pop())):"vertical"!==e[r]&&"Vertical"!==e[r]&&"verticalflip"!==e[r]||(t=i=n=0,2===++o&&(e.pop(),e.pop()));return e},nUt.prototype.popForDefaultFlipState=function(e){for(var t=0,i=e.length-3;t<i;t++){var n="horizontal"===e[t]||"Horizontal"===e[t]||"horizontalFlip"===e[t],o="vertical"===e[t]||"Vertical"===e[t]||"verticalFlip"===e[t],r="horizontal"===e[t+1]||"Horizontal"===e[t+1]||"horizontalFlip"===e[t+1],s="vertical"===e[t+1]||"Vertical"===e[t+1]||"verticalFlip"===e[t+1],a="horizontal"===e[t+2]||"Horizontal"===e[t+2]||"horizontalFlip"===e[t+2],l="vertical"===e[t+2]||"Vertical"===e[t+2]||"verticalFlip"===e[t+2],h="horizontal"===e[t+3]||"Horizontal"===e[t+3]||"horizontalFlip"===e[t+3];(n&&s&&a&&l||o&&r&&l&&h)&&(e.splice(t,4),t-=4)}return e},nUt.prototype.popForDefaultRotateState=function(e){for(var t=0;t<e.length-1;t++){var i=e[t],n=e[t+1];(90!==i&&"rotateRight"!==i||-90!==n&&"rotateLeft"!==n)&&(-90!==i&&"rotateLeft"!==i||90!==n&&"rotateRight"!==n)||(e.splice(t,2),t-=2)}return e},nUt.prototype.selectShape=function(e,t){var i=this.parent,n=!1;if(!i.disabled&&i.isImageLoaded)if(this.applyActObj(),"shape"===e.split("_")[0]){for(var o,r,s=0,a=i.objColl.length;s<a;s++)if(i.objColl[s].currIndex===e){o=Pe({},i.objColl[s],{},!0);break}je(o)?n=!1:(n=!0,i.activeObj=o,i.notify("toolbar",{prop:"getCanvasFilter",onPropertyChange:!(r={canvasFilter:null}),value:{obj:r}}),this.lowerContext.filter=r.canvasFilter,i.notify("selection",{prop:"redrawShape",onPropertyChange:!1,value:{obj:i.activeObj}}),"text"===i.activeObj.shape?i.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"text",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}):"pen"===i.activeObj.shape?i.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"pen",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}):"redact"===i.activeObj.shape?i.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"redact",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}):i.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"shapes",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}),i.notify("toolbar",{prop:"update-toolbar-items",onPropertyChange:!1}),i.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:null}}))}else"pen"===e.split("_")[0]&&(i.notify("selection",{prop:"getFreehandDrawEditing",onPropertyChange:!(r={bool:!1}),value:{obj:r}}),r.bool&&i.okBtn(null,!0),r={isIndex:!1},i.notify("freehand-draw",{prop:"isFHDIdx",value:{index:parseInt(e.split("_")[1],10)-1,obj:r}}),r.isIndex?(n=!0,i.notify("freehand-draw",{prop:"selectFhd",value:{id:e}}),i.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:!0}}),i.notify("toolbar",{prop:"update-toolbar-items",onPropertyChange:!1})):n=!1);t.isSelected=n},nUt.prototype.deleteShape=function(e){var t=this.parent;if(!t.disabled&&t.isImageLoaded){if(t.activeObj.currIndex&&t.activeObj.currIndex===e)t.notify("selection",{prop:"deleteItem",onPropertyChange:!1});else if(this.applyActObj(),"shape"===e.split("_")[0]){for(var i=0,n=t.objColl.length;i<n;i++)if(t.objColl[i].currIndex===e){t.objColl.splice(i,1);break}}else"pen"===e.split("_")[0]&&t.notify("freehand-draw",{prop:"handle-freehand-draw",value:{id:e}});var o={canvasFilter:null};t.notify("toolbar",{prop:"getCanvasFilter",onPropertyChange:!1,value:{obj:o}}),this.lowerContext.filter=o.canvasFilter,this.lowerContext.clearRect(0,0,t.lowerCanvas.width,t.lowerCanvas.height),t.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1}),t.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1})}},nUt.prototype.getMaxText=function(e,t,i){if(je(t)&&!(t=e?this.parent.textArea.value:this.parent.activeObj.keyHistory))return t;for(var n,o=t.split("\n"),r=o[0].length,s=o[0],a=1;a<o.length;a++)r<(n=o[a].length)&&(s=o[a],r=n);return i&&(i.maxText=s),s},nUt.prototype.getLinePoints=function(e,t,i,n){var o,r,s=[];if(e===i){t<n?(o=[e,t],r=[i,n]):(r=[e,t],o=[i,n]);for(var a=this.getSlope(o,r,!0),l=this.getIntercept(o,a),h=o[1];h<=r[1];h++){var d=a*h+l;s.push({x:d,y:h})}}else{e<i?(o=[e,t],r=[i,n]):(r=[e,t],o=[i,n]);for(a=this.getSlope(o,r,!1),l=this.getIntercept(o,a),d=o[0];d<=r[0];d++){h=a*d+l;s.push({x:d,y:h})}}if(Math.floor(e)===Math.floor(i)||s.length<10&&(10<n-t||10<t-n)){for(var s=[],p=Math.min(t,n),c=0;c<Math.abs(Math.floor(n)-Math.floor(t));c++)s.push({x:e,y:p+c});1<s.length&&(u=void 0,u=je(s[s.length-2])?{x:0,y:0}:s[s.length-2],g=s[s.length-1].x-u.x,m=s[s.length-1].y-u.y,s.push({x:s[s.length-1].x+g/2,y:s[s.length-1].y+m/2}))}else if(Math.floor(t)===Math.floor(n)||s.length<10&&(10<i-e||10<e-i)){s=[];for(var u,g,m,f=Math.min(e,i),y=0;y<Math.abs(Math.floor(i)-Math.floor(e));y++)s.push({x:f+y,y:t});1<s.length&&(u=void 0,u=je(s[s.length-2])?{x:0,y:0}:s[s.length-2],g=s[s.length-1].x-u.x,m=s[s.length-1].y-u.y,s.push({x:s[s.length-1].x+g/2,y:s[s.length-1].y+m/2}))}return s},nUt.prototype.getSlope=function(e,t,i){var n;if(i){if(e[1]===t[1])return null;n=(t[0]-e[0])/(t[1]-e[1])}else{if(e[0]===t[0])return null;n=(t[1]-e[1])/(t[0]-e[0])}return n},nUt.prototype.getIntercept=function(e,t){return null===t?e[0]:e[1]-t*e[0]},nUt.prototype.setPointCollForShapeRotation=function(e){var t=this.parent,i=e.activePoint,n=i.startX,o=i.startY,r=i.endX,s=i.endY,a=n+i.width/2,i=o+i.height/2,l=Math.cos(e.rotatedAngle),h=Math.sin(e.rotatedAngle),d={x:l*(n-a)-h*(o-i)+a,y:h*(n-a)+l*(o-i)+i},o={x:l*(r-a)-h*(o-i)+a,y:h*(r-a)+l*(o-i)+i},n={x:l*(n-a)-h*(s-i)+a,y:h*(n-a)+l*(s-i)+i},r={x:l*(r-a)-h*(s-i)+a,y:h*(r-a)+l*(s-i)+i};e.horTopLinePointColl=this.getLinePoints(d.x,d.y,o.x,o.y),e.horTopLinePointColl=this.getLinePoints(d.x,d.y,o.x,o.y),e.horBottomLinePointColl=this.getLinePoints(n.x,n.y,r.x,r.y),e.verLeftLinePointColl=this.getLinePoints(d.x,d.y,n.x,n.y),e.verRightLinePointColl=this.getLinePoints(o.x,o.y,r.x,r.y),e.verLeftLinePointColl.reverse(),e.verRightLinePointColl.reverse();for(var p=0;p<e.horTopLinePointColl.length;p++)e.horTopLinePointColl[p].ratioX=(e.horTopLinePointColl[p].x-this.parent.img.destLeft)/this.parent.img.destWidth,e.horTopLinePointColl[p].ratioY=(e.horTopLinePointColl[p].y-this.parent.img.destTop)/this.parent.img.destHeight;for(p=0;p<e.horBottomLinePointColl.length;p++)e.horBottomLinePointColl[p].ratioX=(e.horBottomLinePointColl[p].x-this.parent.img.destLeft)/this.parent.img.destWidth,e.horBottomLinePointColl[p].ratioY=(e.horBottomLinePointColl[p].y-this.parent.img.destTop)/this.parent.img.destHeight;for(p=0;p<e.verLeftLinePointColl.length;p++)e.verLeftLinePointColl[p].ratioX=(e.verLeftLinePointColl[p].x-this.parent.img.destLeft)/this.parent.img.destWidth,e.verLeftLinePointColl[p].ratioY=(e.verLeftLinePointColl[p].y-this.parent.img.destTop)/this.parent.img.destHeight;for(p=0;p<e.verRightLinePointColl.length;p++)e.verRightLinePointColl[p].ratioX=(e.verRightLinePointColl[p].x-this.parent.img.destLeft)/this.parent.img.destWidth,e.verRightLinePointColl[p].ratioY=(e.verRightLinePointColl[p].y-this.parent.img.destTop)/this.parent.img.destHeight;"move"!==t.upperCanvas.style.cursor&&(t.notify("selection",{prop:"getTransRotationPoint",value:{obj:e,object:s={rotationCirclePoint:null}}}),d=s.rotationCirclePoint)&&(e.rotationCirclePointColl={x:l*(d.x-a)-h*(d.y-i)+a,y:h*(d.x-a)+l*(d.y-i)+i},e.rotationCirclePointColl.ratioX=(e.rotationCirclePointColl.x-t.img.destLeft)/t.img.destWidth,e.rotationCirclePointColl.ratioY=(e.rotationCirclePointColl.y-t.img.destTop)/t.img.destHeight)},nUt.prototype.getSquarePointForRotatedShape=function(e,t){var i={startX:0,startY:0,endX:0,endY:0,width:0,height:0},n=e.activePoint,o=n.startX,r=n.startY,s=n.endX,a=n.endY,l=o+n.width/2,n=r+n.height/2,h=Math.cos(e.rotatedAngle),e=Math.sin(e.rotatedAngle),d={x:h*(o-l)-e*(r-n)+l,y:e*(o-l)+h*(r-n)+n},r={x:h*(s-l)-e*(r-n)+l,y:e*(s-l)+h*(r-n)+n},o={x:h*(o-l)-e*(a-n)+l,y:e*(o-l)+h*(a-n)+n},e={x:h*(s-l)-e*(a-n)+l,y:e*(s-l)+h*(a-n)+n};return i.startX=d.x,i.startY=d.y,i.endX=d.x,i.endY=d.y,r.x<i.startX&&(i.startX=r.x),o.x<i.startX&&(i.startX=o.x),e.x<i.startX&&(i.startX=e.x),r.y<i.startY&&(i.startY=r.y),o.y<i.startY&&(i.startY=o.y),e.y<i.startY&&(i.startY=e.y),i.endX<r.x&&(i.endX=r.x),i.endX<o.x&&(i.endX=o.x),i.endX<e.x&&(i.endX=e.x),i.endY<r.y&&(i.endY=r.y),i.endY<o.y&&(i.endY=o.y),i.endY<e.y&&(i.endY=e.y),i.width=i.endX-i.startX,i.height=i.endY-i.startY,t&&(t.activePoint=i),i},nUt.prototype.updateZOrder=function(e,t){var i=this.parent,n=(t=t.toLowerCase(),e);if(!je(n.order)){var o,r,s=this.getHighestOrder();if(this.updateShapeColl(),0!==i.shapeColl.length){for(var a,l=0;l<i.shapeColl.length;l++)a=i.shapeColl[l],n.id&&-1<n.id.indexOf("pen")?a.id&&a.id===n.id&&i.shapeColl.splice(l,1):a.shape&&-1<a.shape.indexOf("crop-")&&i.shapeColl.splice(l,1);switch(t){case"sendtoback":r=n.order,o=n.order,n.order=1;break;case"sendbackward":--n.order,o=n.order;break;case"bringtofront":r=n.order,n.order=o=s;break;case"bringforward":n.order+=1,o=n.order}this.reArrangeObjColl(o,t,r),n.id&&-1<n.id.indexOf("pen")&&this.reUpdateShapeColl(n)}}},nUt.prototype.reArrangeObjColl=function(e,t,i){var n,o=this.parent;switch(t){case"sendtoback":for(var r=0,s=o.shapeColl.length;r<s;r++)(n=o.shapeColl[r]).order<i&&n.order<=e&&(n.order+=1,this.reUpdateShapeColl(n));break;case"sendbackward":for(r=0,s=o.shapeColl.length;r<s;r++)if((n=o.shapeColl[r]).order===e){n.order+=1,this.reUpdateShapeColl(n);break}break;case"bringtofront":for(r=0,s=o.shapeColl.length;r<s;r++)(n=o.shapeColl[r]).order>i&&n.order<=e&&(--n.order,this.reUpdateShapeColl(n));break;case"bringforward":for(r=0,s=o.shapeColl.length;r<s;r++)if((n=o.shapeColl[r]).order===e){--n.order,this.reUpdateShapeColl(n);break}}},nUt.prototype.reorderRedact=function(e){var t=e.filter(function(e){return"redact"!==e.shape});return e.filter(function(e){return"redact"===e.shape}).concat(t)},nUt.prototype.updateShapeColl=function(){var e=this.parent,t=!1,i=1,n=Pe([],e.objColl,[],!0),n=this.reorderRedact(n),o=Pe([],e.pointColl,[],!0);if(0<e.shapeColl.length&&e.shapeColl.length===e.objColl.length+e.pointColl.length){for(var r=0;r<e.shapeColl.length;r++){if(e.shapeColl[r].order!==i){t=!1;break}t=!0,i++}if(t){for(r=0;r<e.shapeColl.length;r++)if(e.shapeColl[r].currIndex&&-1<e.shapeColl[r].currIndex.indexOf("shape")){for(var s=0;s<n.length;s++)if(e.shapeColl[r].currIndex===n[s].currIndex){e.shapeColl[r]=Pe({},n[s],{},!0),n.splice(s,1);break}}else if(e.shapeColl[r].id&&-1<e.shapeColl[r].id.indexOf("pen"))for(s=0;s<o.length;s++)if(e.shapeColl[r].id===o[s].id){e.shapeColl[r]=Pe([],o[s],[],!0),o.splice(s,1);break}return}}n=Pe([],e.objColl,[],!0);for(var o=Pe([],e.pointColl,[],!0),a=1,l=!(e.shapeColl=[]);0!==n.length||0!==o.length;){for(var h=l=!1,r=0;r<n.length;r++)if(n[r].order===a||!n[r].order&&n[r].shape&&-1<n[r].shape.indexOf("crop-")){e.shapeColl.push(Pe({},n[r],{},!0)),n[r].shape&&-1<n[r].shape.indexOf("crop-")&&(l=!0),n.splice(r,1),h=!0;break}if(!h)for(r=0;r<o.length;r++)if(o[r].order===a){e.shapeColl.push(Pe([],o[r],[],!0)),o.splice(r,1),h=!0;break}l||a++}},nUt.prototype.reUpdateShapeColl=function(e){var t=this.parent;if(e.id&&-1<e.id.indexOf("pen")){if(0<t.freehandCounter)for(var i=0;i<t.freehandCounter;i++)t.pointColl[i].id===e.id&&(t.pointColl[i].order=e.order)}else if(e.currIndex&&-1<e.currIndex.indexOf("shape"))for(i=0;i<t.objColl.length;i++)t.objColl[i].currIndex===e.currIndex&&(t.objColl[i].order=e.order)},nUt.prototype.drawAnnotations=function(e,t,i,n,o,r,s){var a=this.parent,l=Pe({},a.activeObj,{},!0),h=Pe([],a.objColl,[],!0),d=Pe([],a.pointColl,[],!0),p={selPointColl:null},c=(a.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:p}}),{selPointColl:null}),u=(a.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:c}}),this.updateShapeColl(),Pe([],a.shapeColl,[],!0)),u=this.reorderRedact(u),g=!1;this.preventFrameAnnotation||(this.preventFrameAnnotation=g=!0);for(var m=0;m<u.length;m++){var f=u[m].id;if(u[m].order||!u[m].order&&u[m].shape&&-1<u[m].shape.indexOf("crop-")||!u[m].order&&"path"===u[m].shape&&"path"===a.drawingShape){if(u[m].currIndex&&-1<u[m].currIndex.indexOf("shape")){if(a.objColl=[],a.objColl.push(Pe({},u[m],{},!0)),"iterate"===t){var y=this.lowerContext.filter;this.lowerContext.filter="none",this.iterateObjColl(),this.lowerContext.filter=y}else if("zoom"===t||"pan"===t){for(var v=-1,b=0;b<h.length;b++)if(JSON.stringify(h[b])===JSON.stringify(a.objColl[0])){v=b;break}"zoom"===t?this.zoomObjColl(n):this.panObjColl(o,r,s),-1<v&&(h[v]=Pe({},a.objColl[0],{},!0))}}else if(u[m].id&&-1<u[m].id.indexOf("pen"))if(a.pointColl=[],a.freehandCounter=0,a.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:[]}}}),a.pointColl.push(Pe({},u[m],{},!0)),a.notify("freehand-draw",{prop:"pushSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:c.selPointColl[m]}}}),a.freehandCounter=a.pointColl.length,"iterate"===i)a.notify("freehand-draw",{prop:"freehandRedraw",onPropertyChange:!1,value:{context:e,points:null}});else if("zoom"===i||"pan"===i){"zoom"===i?a.notify("freehand-draw",{prop:"zoomFHDColl",onPropertyChange:!1,value:{isPreventApply:n}}):a.notify("freehand-draw",{prop:"panFHDColl",onPropertyChange:!1,value:{xDiff:o,yDiff:r,panRegion:s}});for(var w=0;w<d.length;w++)if(d[w].id===a.pointColl[0].id){d[w]=Pe({},a.pointColl[0],{},!0);break}for(var C=0,S=p.selPointColl.length;C<S;C++)if(p.selPointColl[C].id===c.selPointColl[C].id){p.selPointColl[C]=Pe({},c.selPointColl[C],{},!0);break}}}else(u[m].shape||f)&&(u[m].currIndex||f)||u.splice(m,1)}i&&"zoom"===i&&(a.pointColl=[],a.freehandCounter=0,a.notify("freehand-draw",{prop:"zoomFHDColl",onPropertyChange:!1,value:{isPreventApply:n}})),a.objColl=h,a.pointColl=d,a.freehandCounter=a.pointColl.length,a.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:p.selPointColl}}}),g&&this.preventFrameAnnotation&&(a.notify("draw",{prop:"applyFrame",value:{ctx:this.lowerContext,frame:a.frameObj.type,preventImg:!0}}),this.preventFrameAnnotation=!1),a.activeObj=l};var iUt=nUt;function nUt(e){this.textSettings={text:"Enter Text",fontFamily:"",fontSize:null,fontRatio:null,bold:!1,italic:!1,underline:!1},this.strokeSettings={strokeColor:"#fff",fillColor:"",strokeWidth:null,radius:null,outlineColor:"",outlineWidth:null},this.keyHistory="",this.preventFrameAnnotation=!1,this.redactType="blur",this.parent=e,this.addEventListener()}rUt.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},rUt.prototype.addEventListener=function(){this.parent.on("transform",this.transform,this),this.parent.on("destroyed",this.destroy,this)},rUt.prototype.removeEventListener=function(){this.parent.off("transform",this.transform),this.parent.off("destroyed",this.destroy)},rUt.prototype.transform=function(e){switch(this.initTransformPvtVar(),e.prop){case"flipImage":this.flipImage(e.value.direction);break;case"setDestPointsForFlipState":this.setDestPointsForFlipState();break;case"zoomAction":this.zoomAction(e.value.zoomFactor,e.value.zoomPoint,e.value.isResize);break;case"disableZoomOutBtn":this.disableZoomOutBtn(e.value.isZoomOut);break;case"rotatedFlip":this.rotatedFlip();break;case"drawPannedImage":this.drawPannedImage(e.value.xDiff,e.value.yDiff);break;case"drawPannImage":this.drawPannImage(e.value.point);break;case"performTransformation":this.performTransformation(e.value.text);break;case"updateTransform":this.updateTransform(e.value.text);break;case"rotatePan":this.rotatePan(e.value.isCropSelection,e.value.isDefaultZoom);break;case"resetZoom":this.resetZoom();break;case"pan":this.pan(e.value.value,e.value.x,e.value.y);break;case"zoom":this.zoom(e.value.zoomFactor,e.value.zoomPoint);break;case"setCurrPanRegion":this.setCurrPanRegion(e.value.region,e.value.type,e.value.obj);break;case"rotate":this.rotate(e.value.degree,e.value.obj);break;case"flip":this.flip(e.value.direction);break;case"update":this.update();break;case"calcMaxDimension":this.calcMaxDimension(e.value.width,e.value.height,e.value.obj,e.value.isImgShape);break;case"getPanMove":e.value.obj.panMove=this.panMove;break;case"setPanMove":this.panMove=e.value.point;break;case"getTempPanMove":e.value.obj.tempPanMove=this.tempPanMove;break;case"setTempPanMove":this.tempPanMove=e.value.point;break;case"setReverseFlip":this.isReverseFlip=e.value.isReverseFlip;break;case"setDisablePan":this.disablePan=e.value.bool;break;case"setCurrDestinationPoint":this.currDestPoint=e.value.point,this.currDestPoint.startX-=this.parent.cropObj.totalPannedPoint.x,this.currDestPoint.startY-=this.parent.cropObj.totalPannedPoint.y;break;case"setReverseRotate":this.isReverseRotate=e.value.bool;break;case"getFlipColl":e.value.obj.flipColl=this.flipColl;break;case"setFlipColl":this.flipColl=e.value.flipColl;break;case"getPreviousZoomValue":e.value.obj.previousZoomValue=this.prevZoomValue;break;case"setPreviousZoomValue":this.prevZoomValue=e.value.previousZoomValue;break;case"getCropDimension":e.value.obj.cropDimension=this.cropDimension;break;case"setCropDimension":this.cropDimension.width=e.value.width,this.cropDimension.height=e.value.height;break;case"getPreventSelect":e.value.obj.bool=this.isPreventSelect;break;case"setPreventSelect":this.isPreventSelect=e.value.bool;break;case"resizeImage":this.resizeImage(e.value.width,e.value.height);break;case"resizeCrop":this.resizeCrop(e.value.width,e.value.height);break;case"updateResize":this.updateResize();break;case"resize":this.resize(e.value.width,e.value.height,e.value.isAspectRatio);break;case"straightenImage":this.straightenImage(e.value.degree);break;case"reset":this.reset();break;case"cropZoom":e.value.obj.maxDimension=this.cropZoom(e.value.value,e.value.selectionObj);break;case"setResizedImgAngle":this.resizedImgAngle=e.value.angle}},rUt.prototype.getModuleName=function(){return"transform"},rUt.prototype.initTransformPvtVar=function(){this.parent.lowerCanvas&&(this.lowerContext=this.parent.lowerCanvas.getContext("2d")),this.parent.upperCanvas&&(this.upperContext=this.parent.upperCanvas.getContext("2d"))},rUt.prototype.reset=function(){this.zoomBtnHold=null,this.tempPanMove=null,this.panMove=null,this.disablePan=!1,this.currDestPoint=null,this.isReverseRotate=!1,this.flipColl=[],this.resizedImgAngle=null,this.transCurrObj=null,this.prevZoomValue=1,this.isPreventSelect=this.preventDownScale=!1},rUt.prototype.rotateImage=function(e){var t=this.parent,i={cancel:!1,previousDegree:t.transform.degree,currentDegree:360===Math.abs(t.transform.degree+e)?0:t.transform.degree+e};this.isPreventSelect||(t.trigger("rotating",i),t.editCompleteArgs=i),this.rotateEvent(i,e)},rUt.prototype.rotateEvent=function(e,t){var i,n=this.parent;e.cancel?(n.notify("draw",{prop:"setCurrentObj",onPropertyChange:!1,value:{obj:n.prevEventObjPoint}}),n.activeObj=n.prevEventSelectionPoint,n.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:n.activeObj}})):(e=void 0,je(this.transCurrObj)&&(n.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(i={currObj:{}}),value:{object:i}}),(e=i.currObj).objColl=Pe([],n.objColl,null,!0),e.pointColl=Pe({},n.pointColl,null,!0),e.afterCropActions=Pe([],n.afterCropActions,[],!0),n.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(i={selPointColl:null}),value:{obj:i}}),e.selPointColl=Pe([],i.selPointColl,[],!0)),n.afterCropActions.push(90===t?"rotateRight":"rotateLeft"),e=[],i=void 0,n.activeObj.activePoint&&n.activeObj.shape&&(void 0!==n.activeObj.shape&&(e=n.activeObj.shape.split("-")),!n.currObjType.isCustomCrop&&"crop"!==e[0]||(i=n.currObjType.isCustomCrop?"custom":e[1],n.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),n.objColl.push(n.activeObj),n.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}))),n.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:!0}}),this.upperContext.clearRect(0,0,n.upperCanvas.width,n.upperCanvas.height),this.drawRotatedImage(t),n.notify("draw",{prop:"setImageEdited",onPropertyChange:!1}),n.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),n.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.upperContext}}),n.isCircleCrop&&n.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),i&&(this.upperContext.clearRect(0,0,n.upperCanvas.width,n.upperCanvas.height),n.activeObj=Pe({},n.objColl[n.objColl.length-1],{},!0),n.objColl.pop(),n.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:n.activeObj}})),n.isUndoRedo=!1,e={collection:n.rotateFlipColl},n.notify("shape",{prop:"alignRotateFlipColl",onPropertyChange:!1,value:{collection:n.rotateFlipColl,isRotateFlipCollection:!0,obj:e}}),n.rotateFlipColl=e.collection,n.cropObj.activeObj.shape&&!this.isPreventSelect&&(n.notify("draw",{prop:"setIsCropSelect",value:{bool:!0}}),this.isPreventSelect=!0,n.notify("draw",{prop:"select",onPropertyChange:!1,value:{type:"custom",startX:null,startY:null,width:null,height:null}}),this.isPreventSelect=!1,n.setProperties({zoomSettings:{zoomFactor:1}},!0),this.prevZoomValue=n.zoomSettings.zoomFactor))},rUt.prototype.drawRotatedImage=function(e){var t=this.parent,i=(0===e?t.transform.degree=0:t.transform.degree+=e,360===Math.abs(t.transform.degree)&&(t.transform.degree=0),t.notify("draw",{prop:"setDestPoints",onPropertyChange:!1}),Pe([],t.objColl,[],!0)),n=Pe({},t.activeObj,{},!0);if(t.objColl=[],t.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.isReverseRotate||t.notify("draw",{prop:"updateCurrTransState",onPropertyChange:!1,value:{type:"initial",isPreventDestination:null,isRotatePan:null}}),this.rotateDegree(e),this.isReverseRotate||(t.notify("draw",{prop:"updateCurrTransState",onPropertyChange:!1,value:{type:"reverse",isPreventDestination:null,isRotatePan:null}}),t.rotateFlipColl.push(e)),t.objColl=Pe([],i,[],!0),t.activeObj=Pe({},n,{},!0),t.isCircleCrop&&t.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),t.notify("shape",{prop:"redrawObj",onPropertyChange:!1,value:{degree:e}}),t.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),0<e)t.notify("freehand-draw",{prop:"rotateFhdColl",onPropertyChange:!1});else for(var o=0;o<3;o++)t.notify("freehand-draw",{prop:"rotateFhdColl",onPropertyChange:!1});t.notify("freehand-draw",{prop:"freehandRedraw",onPropertyChange:!1,value:{context:this.lowerContext,points:null}}),this.updateCurrSelectionPoint(e)},rUt.prototype.rotateDegree=function(e){var t=this.parent,i=(this.lowerContext.save(),this.lowerContext.clearRect(0,0,t.lowerCanvas.width,t.lowerCanvas.height),this.lowerContext.translate(t.lowerCanvas.width/2,t.lowerCanvas.height/2),this.lowerContext.rotate(Math.PI/180*e),this.lowerContext.translate(-t.lowerCanvas.width/2,-t.lowerCanvas.height/2),this.lowerContext.filter);t.notify("draw",{prop:"drawImage",onPropertyChange:!1}),this.lowerContext.filter=i,this.lowerContext.translate(t.lowerCanvas.width/2,t.lowerCanvas.height/2),this.lowerContext.rotate(Math.PI/180*-e),this.lowerContext.translate(-t.lowerCanvas.width/2,-t.lowerCanvas.height/2),this.lowerContext.restore()},rUt.prototype.updateCurrSelectionPoint=function(e){var t,i,n,o,r=this.parent;r.currSelectionPoint&&this.currDestPoint&&(t=Pe({},r.activeObj,{},!0),i=Pe([],r.objColl,[],!0),n={startX:r.img.srcLeft,startY:r.img.srcTop,width:r.img.srcWidth,height:r.img.srcHeight},o={startX:r.img.destLeft,startY:r.img.destTop,width:r.img.destWidth,height:r.img.destHeight},r.objColl=[],r.objColl.push(Pe({},r.currSelectionPoint,{},!0)),r.img={srcLeft:0,srcTop:0,srcWidth:r.baseImgCanvas.width,srcHeight:r.baseImgCanvas.height,destLeft:this.currDestPoint.startX,destTop:this.currDestPoint.startY,destWidth:this.currDestPoint.width,destHeight:this.currDestPoint.height},"number"==typeof e&&(r.notify("draw",{prop:"setDestPoints",onPropertyChange:!1}),r.notify("draw",{prop:"setClientTransDim",onPropertyChange:!1,value:{isPreventDimension:null}})),r.notify("shape",{prop:"redrawObj",onPropertyChange:!1,value:{degree:e}}),r.currSelectionPoint=Pe({},r.objColl[0],{},!0),this.currDestPoint={startX:r.img.destLeft,startY:r.img.destTop,width:r.img.destWidth,height:r.img.destHeight},r.objColl=i,r.activeObj=t,r.img={srcLeft:n.startX,srcTop:n.startY,srcWidth:n.width,srcHeight:n.height,destLeft:o.startX,destTop:o.startY,destWidth:o.width,destHeight:o.height})},rUt.prototype.flipImage=function(e){var t=this.parent,i={direction:e,cancel:!1,previousDirection:t.toPascalCase(t.transform.currFlipState||e)};this.isPreventSelect||(t.trigger("flipping",i),t.editCompleteArgs=i),this.flipEvent(i,e)},rUt.prototype.flipEvent=function(e,t){var i=this.parent;if(e.cancel)i.notify("draw",{prop:"setCurrentObj",onPropertyChange:!1,value:{obj:i.prevEventObjPoint}}),i.activeObj=i.prevEventSelectionPoint,i.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:i.activeObj}});else{je(this.transCurrObj)&&(i.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(e={currObj:{}}),value:{object:e}}),(e=e.currObj).objColl=Pe([],i.objColl,null,!0),e.pointColl=Pe({},i.pointColl,null,!0),e.afterCropActions=Pe([],i.afterCropActions,[],!0),i.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(o={selPointColl:null}),value:{obj:o}}),e.selPointColl=Pe([],o.selPointColl,[],!0)),i.afterCropActions.push("horizontal"===t.toLowerCase()?"horizontalflip":"verticalflip");var n,e=[],o=(i.activeObj.activePoint&&(void 0!==i.activeObj.shape&&(e=i.activeObj.shape.split("-")),!i.currObjType.isCustomCrop&&"crop"!==e[0]||(n=i.currObjType.isCustomCrop?"custom":e[1],i.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),i.objColl.push(i.activeObj),i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}))),i.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:!0}}),i.clearContext(this.lowerContext),i.clearContext(this.upperContext),Pe([],i.objColl,[],!0)),e=Pe({},i.activeObj,{},!0),r=(i.objColl=[],i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.isReverseFlip||i.notify("draw",{prop:"updateCurrTransState",onPropertyChange:!1,value:{type:"initial",isPreventDestination:null,isRotatePan:null}}),t.toLowerCase()),s=(this.updateFlipState(r),i.transform.currFlipState.toLowerCase()),s=(i.transform.currFlipState="horizontal"===r&&"horizontal"===s||"vertical"===r&&"vertical"===s?"":r,{isSelected:null}),r=(i.notify("draw",{prop:"getRotatedFlipCropSelection",onPropertyChange:!1,value:{bool:s}}),s.isSelected&&(i.img.destLeft+=i.panPoint.totalPannedInternalPoint.x,i.img.destTop+=i.panPoint.totalPannedInternalPoint.y),this.lowerContext.filter);i.notify("draw",{prop:"drawImage",onPropertyChange:!1}),this.lowerContext.filter=r,i.notify("draw",{prop:"setImageEdited",onPropertyChange:!1}),this.updateFlipState(t.toLowerCase()),this.isReverseFlip||(i.notify("draw",{prop:"updateCurrTransState",onPropertyChange:!1,value:{type:"reverse",isPreventDestination:null,isRotatePan:null}}),this.updateFlipColl(t.toLocaleLowerCase()),i.rotateFlipColl.push(t.toLowerCase())),1===i.rotateFlipColl.length&&(i.notify("crop",{prop:"getCurrFlipState",onPropertyChange:!(s={panRegion:""}),value:{panObj:s}}),""===s.panRegion?i.notify("draw",{prop:"setClientTransDim",onPropertyChange:!1,value:{isPreventDimension:null}}):this.setDestPointsForFlipState()),i.isCircleCrop&&i.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),i.objColl=Pe([],o,[],!0),i.activeObj=Pe({},e,{},!0);for(var a=0,l=i.objColl.length;a<l;a++){var h=i.objColl[a].flipObjColl;0!==h.length&&h[h.length-1]===t?h.pop():h.push(t)}i.notify("shape",{prop:"redrawObj",onPropertyChange:!1,value:{degree:t.toLowerCase()}});r=this.lowerContext.filter,s=(this.lowerContext.filter="brightness(1) contrast(100%) hue-rotate(0deg) saturate(100%) opacity(1) blur(0px) sepia(0%) grayscale(0%) invert(0%)",i.notify("shape",{prop:"iterateObjColl",onPropertyChange:!1}),t.toLowerCase()),o=(("horizontal"===s||"vertical"===s)&&i.notify("freehand-draw",{prop:"flipFHDColl",onPropertyChange:!1,value:{value:s}}),i.notify("freehand-draw",{prop:"freehandRedraw",onPropertyChange:!1,value:{context:this.lowerContext,points:null}}),this.lowerContext.filter=r,i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.updateCurrSelectionPoint(s),i.isUndoRedo=!1,i.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),i.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.upperContext}}),i.isCircleCrop&&i.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),n&&(this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height),i.activeObj=Pe({},i.objColl[i.objColl.length-1],{},!0),i.objColl.pop(),i.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:i.activeObj}})),{collection:i.rotateFlipColl});i.notify("shape",{prop:"alignRotateFlipColl",onPropertyChange:!1,value:{collection:i.rotateFlipColl,isRotateFlipCollection:!0,obj:o}}),i.rotateFlipColl=o.collection,i.cropObj.activeObj.shape&&!this.isPreventSelect&&(i.notify("draw",{prop:"setIsCropSelect",value:{bool:!0}}),this.isPreventSelect=!0,i.notify("draw",{prop:"select",onPropertyChange:!1,value:{type:"custom",startX:null,startY:null,width:null,height:null}}),this.isPreventSelect=!1,i.setProperties({zoomSettings:{zoomFactor:1}},!0),this.prevZoomValue=i.zoomSettings.zoomFactor)}},rUt.prototype.updateFlipState=function(e){var t=this.parent.transform.degree;"horizontal"===e?t%90==0&&t%180!=0?this.verticalFlip():this.horizontalFlip():"vertical"===e&&(t%90==0&&t%180!=0?this.horizontalFlip():this.verticalFlip())},rUt.prototype.horizontalFlip=function(){this.lowerContext.translate(this.lowerContext.canvas.width,0),this.lowerContext.scale(-1,1),this.upperContext.translate(this.upperContext.canvas.width,0),this.upperContext.scale(-1,1)},rUt.prototype.verticalFlip=function(){this.lowerContext.translate(0,this.lowerContext.canvas.height),this.lowerContext.scale(1,-1),this.upperContext.translate(0,this.upperContext.canvas.height),this.upperContext.scale(1,-1)},rUt.prototype.updateFlipColl=function(e){this.isPreventSelect||(0===this.flipColl.length||this.flipColl[this.flipColl.length-1]!==e?this.flipColl.push(e):this.flipColl.pop(),4<=this.flipColl.length&&("horizontal"===(e=this.flipColl.slice(-4))[0]&&"vertical"===e[1]&&"horizontal"===e[2]&&"vertical"===e[3]||"vertical"===e[0]&&"horizontal"===e[1]&&"vertical"===e[2]&&"horizontal"===e[3])&&this.flipColl.splice(-4))},rUt.prototype.setDestPointsForFlipState=function(){var e=this.parent,t={panRegion:""},i=e.img,n=i.destLeft,o=i.destTop,r=i.destWidth,i=i.destHeight,s=e.lowerCanvas,a=s.clientWidth,s=s.clientHeight;e.notify("crop",{prop:"getCurrFlipState",onPropertyChange:!1,value:{panObj:t}}),""!==t.panRegion&&("horizontal"===t.panRegion?e.img.destLeft=a-(r+n):("vertical"!==t.panRegion&&(e.img.destLeft=a-(r+n)),e.img.destTop=s-(i+o)))},rUt.prototype.zoomAction=function(e,t,i,n){var o=this.parent;if(!o.disabled&&o.isImageLoaded)if(je(i)&&(o.zoomSettings.zoomFactor>=o.zoomSettings.maxZoomFactor&&0<e||o.zoomSettings.zoomFactor>o.zoomSettings.minZoomFactor&&e<0&&this.disableZoomOutBtn(!0)||o.zoomSettings.zoomFactor<=o.zoomSettings.minZoomFactor&&e<0))o.notify("toolbar",{prop:"zoom-up-handler",onPropertyChange:!1});else{o.notify("draw",{prop:"setImageEdited",onPropertyChange:!1});var r=e;e=0<r?.1:-.1;for(var s,a=0;a<Math.round(Math.abs(r/.1));a++)1===this.prevZoomValue?this.prevZoomValue+=0<e?10*e:10*e/10:1<this.prevZoomValue?this.prevZoomValue+=10*e:this.prevZoomValue<1&&(this.prevZoomValue+=10*e/10,s=Math.pow(10,1),this.prevZoomValue=Math.round(this.prevZoomValue*s)/s);e=r,o.setProperties({zoomSettings:{zoomFactor:this.prevZoomValue}},!0);var i=void 0,i=(this.tempActiveObj=null,this.isShape=!1,void 0!==o.activeObj.shape&&("shape"===o.activeObj.shape?o.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}):i=o.activeObj.shape.split("-")),void 0!==i&&"crop"===i[0]?(this.tempActiveObj=Pe({},o.activeObj,{},!0),o.isCropTab=!0):(o.activeObj.shape&&"crop"!==i[0]&&(0!==o.activeObj.activePoint.width||0!==o.activeObj.activePoint.height)||"path"===o.activeObj.shape&&0<o.activeObj.pointColl.length)&&(this.isShape=!0),{zoomType:null}),l=(o.notify("selection",{prop:"getZoomType",onPropertyChange:!1,value:{obj:i}}),je(t)&&(t=o.isCropTab&&this.tempActiveObj?{x:o.activeObj.activePoint.startX+o.activeObj.activePoint.width/2,y:o.activeObj.activePoint.startY+o.activeObj.activePoint.height/2}:{x:o.lowerCanvas.clientWidth/2,y:o.lowerCanvas.clientHeight/2},"MouseWheel"!==i.zoomType&&"Pinch"!==i.zoomType||(t={x:o.zoomSettings.zoomPoint.x,y:o.zoomSettings.zoomPoint.y})),o.zoomSettings.zoomFactor-10*e),t={zoomPoint:t,cancel:!1,previousZoomFactor:l,currentZoomFactor:o.zoomSettings.zoomFactor,zoomTrigger:i.zoomType};!o.isCropToolbar&&o.isZoomBtnClick&&(o.trigger("zooming",t),o.editCompleteArgs=t),this.zoomEvent(t,e,n)}},rUt.prototype.zoomEvent=function(e,t,i){var n,o=this.parent,r=o.zoomSettings,s=r.zoomFactor,r=r.minZoomFactor;if(e.cancel)o.isZoomBtnClick=!1;else{"blur"!==this.parent.activeObj.redactType&&"pixelate"!==this.parent.activeObj.redactType&&o.notify("toolbar",{prop:"close-contextual-toolbar",onPropertyChange:!1}),!o.isCropTab&&o.activeObj.shape&&(n=o.activeObj.currIndex),o.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:!0}}),o.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.upperContext.clearRect(0,0,o.lowerCanvas.width,o.lowerCanvas.height);var a,l={canvasFilter:o.canvasFilter},h=(this.lowerContext.filter=l.canvasFilter,o.upperCanvas.style.cursor=o.cursor="default",Pe([],o.objColl,[],!0),o.isCropTab||(0!==o.transform.degree?(o.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:null}}),o.panPoint.currentPannedPoint={x:0,y:0},a=o.allowDownScale,o.allowDownScale=!1,this.rotatePan(!0,!0),o.allowDownScale=a):""!==o.transform.currFlipState&&(o.panPoint.totalPannedPoint={x:0,y:0}),0!==o.transform.straighten)||this.isPreventSelect||o.notify("freehand-draw",{prop:"updateFHDColl",onPropertyChange:!1,value:{isPreventApply:i}}),0===o.transform.degree?(this.drawZoomImgToCanvas(t,this.tempActiveObj),o.notify("crop",{prop:"getCurrFlipState",onPropertyChange:!(l={panRegion:""}),value:{panObj:l}}),""!==l.panRegion&&(o.notify("crop",{prop:"setTempFlipPanPoint",onPropertyChange:!1,value:{point:o.panPoint.totalPannedPoint,isAdd:!0}}),l=Pe([],o.objColl,[],!0),o.objColl=[],d=o.img.destLeft,h=o.img.destTop,this.setDestPointsForFlipState(),this.rotatedFlip(),o.img.destLeft=d,o.img.destTop=h,o.objColl=l,o.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:i}}),0!==o.transform.straighten||this.isPreventSelect||o.notify("freehand-draw",{prop:"updateFHDColl",onPropertyChange:!1,value:{isPreventApply:i}})),s<=r&&!o.isCropTab&&(o.panPoint.totalPannedPoint={x:0,y:0})):(0!==o.transform.straighten||this.isPreventSelect||o.notify("freehand-draw",{prop:"updateFHDColl",onPropertyChange:!1,value:{isPreventApply:i}}),o.panPoint.totalPannedClientPoint={x:0,y:0},o.panPoint.totalPannedInternalPoint={x:0,y:0},this.rotateZoom(t),o.notify("crop",{prop:"getCurrFlipState",onPropertyChange:!(d={panRegion:""}),value:{panObj:d}}),""!==d.panRegion&&(a=this.lowerContext.filter,this.lowerContext.filter="none",o.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:i}}),this.lowerContext.filter=a)),Math.pow(10,1)),l=((s<=r||Math.round(o.transform.zoomFactor*h)/h==2)&&(clearInterval(this.zoomBtnHold),this.zoomBtnHold=0),{panRegion:""}),d=(o.notify("crop",{prop:"getCurrFlipState",onPropertyChange:!1,value:{panObj:l}}),""===l.panRegion&&(a=this.lowerContext.filter,this.lowerContext.filter="none",o.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:i}}),this.lowerContext.filter=a),(o.currSelectionPoint&&"crop-circle"===o.currSelectionPoint.shape||o.isCircleCrop)&&o.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),o.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),o.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.tempActiveObj&&(o.activeObj=Pe({},this.tempActiveObj,{},!0),o.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:o.activeObj}}),s<=r)&&(o.currSelectionPoint=null),o.isUndoRedo=!1,(t=document.querySelector("#"+o.element.id+"_zoomOut"))&&s<=r?(t.classList.add("e-disabled"),t.parentElement.classList.add("e-overlay")):t&&(t.classList.remove("e-disabled"),t.parentElement.classList.remove("e-overlay")),o.drawingShape);if(this.autoEnablePan(),o.drawingShape=d,this.tempActiveObj&&(o.activeObj=Pe({},this.tempActiveObj,{},!0)),"crop-custom"===o.activeObj.shape&&(o.currObjType.isCustomCrop=!0),this.isShape){if(n){for(var p=0,c=o.objColl.length;p<c;p++)if(o.objColl[p].currIndex===n){o.activeObj=Pe({},o.objColl[p],{},!0),o.objColl.splice(p,1);break}}else o.activeObj=Pe({},o.objColl[o.objColl.length-1],{},!0),o.objColl.pop();o.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:o.activeObj,isCropRatio:null,points:null,isPreventDrag:!0,saveContext:null,isPreventSelection:null}}),o.notify("toolbar",{prop:"update-toolbar-items",onPropertyChange:!1}),o.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:null}})}o.notify("toolbar",{prop:"enable-disable-btns",onPropertyChange:!1}),o.notify("selection",{prop:"setZoomType",onPropertyChange:!1,value:{zoomType:"Toolbar"}}),e={zoomPoint:e.zoomPoint,previousZoomFactor:e.previousZoomFactor,currentZoomFactor:e.currentZoomFactor,zoomTrigger:e.zoomTrigger},!o.isCropToolbar&&o.isZoomBtnClick&&(o.isZoomBtnClick=!1),o.drawingShape?(h=Pe({},o.activeObj,{},!0),o.enableShapeDrawing(o.toPascalCase(o.drawingShape),!0),(0<(o.activeObj=h).activePoint.width||0<h.activePoint.height||h.pointColl&&0<h.pointColl.length)&&("redact"===h.shape&&o.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:null}}),l=o.element.querySelector("#"+o.element.id+"_zOrderBtn"),i=o.element.querySelector("#"+o.element.id+"_duplicate"),a=o.element.querySelector("#"+o.element.id+"_remove"),s=o.element.querySelector("#"+o.element.id+"_editText"),l&&l.classList.remove("e-overlay"),i&&i.classList.remove("e-overlay"),a&&a.classList.remove("e-overlay"),s)&&s.classList.remove("e-overlay")):o.activeObj.shape&&"redact"===o.activeObj.shape&&(o.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"redact",isApplyBtn:!1,isCropping:!1}}),o.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:null}}))}},rUt.prototype.disableZoomOutBtn=function(e){var t,i,n,o=this.parent,r=o.zoomSettings,s=r.zoomFactor,r=r.minZoomFactor,a=!1,l=(je(e)||(o.transform.zoomFactor-=.1),t=o.element.querySelector("#"+o.element.id+"_zoomOut"),{destLeft:o.img.destLeft,destTop:o.img.destTop,destWidth:o.img.destWidth,destHeight:o.img.destHeight});return o.activeObj.shape?(i=this.setZoomDimension(-.1,o.activeObj),je(t)||(n=o.activeObj.activePoint,a=0===o.transform.straighten?o.img.destLeft>n.startX||o.img.destTop>n.startY||o.img.destLeft+o.img.destWidth<n.endX||o.img.destTop+o.img.destHeight<n.endY||s===r?(t.classList.add("e-disabled"),t.parentElement.classList.add("e-overlay"),!0):(t.classList.remove("e-disabled"),t.parentElement.classList.remove("e-overlay"),!1):(o.img.destWidth=i.width,o.img.destHeight=i.height,o.notify("draw",{prop:"updateImgCanvasPoints",onPropertyChange:!(n={isIntersect:null})}),o.notify("draw",{prop:"isLinesIntersect",onPropertyChange:!1,value:{obj:n}}),n.isIntersect||s===r?(t.classList.add("e-disabled"),t.parentElement.classList.add("e-overlay"),!0):(t.classList.remove("e-disabled"),t.parentElement.classList.remove("e-overlay"),!1)))):this.setZoomDimension(-.1,null),je(e)||(o.transform.zoomFactor+=.1),o.img.destLeft=l.destLeft,o.img.destTop=l.destTop,o.img.destWidth=l.destWidth,o.img.destHeight=l.destHeight,a},rUt.prototype.drawZoomImgToCanvas=function(e,t){var i=this.parent,n=Math.pow(10,1),n=Math.round(i.transform.zoomFactor*n)/n,n=(.1==n&&-.1===e||0==n&&-.025===e?i.transform.zoomFactor=0:i.transform.zoomFactor+=e,i.transform[i.isCropTab?"cropZoomFactor":"defaultZoomFactor"]=i.transform.zoomFactor,{width:0,height:0});i.isCropTab?n=this.cropZoom(e,t):((n=this.calcMaxDimension(i.img.srcWidth,i.img.srcHeight)).width+=n.width*i.transform.zoomFactor,n.height+=n.height*i.transform.zoomFactor,i.img.destLeft=(i.lowerCanvas.clientWidth-n.width)/2,i.img.destTop=(i.lowerCanvas.clientHeight-n.height+1)/2),i.notify("draw",{prop:"draw-image-to-canvas",value:{dimension:n}}),n.width=this.cropDimension.width,n.height=this.cropDimension.height,n.width+=n.width*i.transform.zoomFactor,n.height+=n.height*i.transform.zoomFactor,i.notify("draw",{prop:"setZoomCropWidth",value:{width:n.width,height:n.height}})},rUt.prototype.rotatedFlip=function(){var e=this.parent,t=(this.isReverseFlip=!0,e.transform.currFlipState),i=this.flipColl,n=Pe([],e.objColl,[],!0),o=Pe({},e.activeObj,{},!0),r=(this.flipColl=[],e.objColl=[],e.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),e.notify("draw",{prop:"currTransState",onPropertyChange:!1,value:{type:"initial",isPreventDestination:null,context:null,isPreventCircleCrop:null}}),this.lowerContext.filter);e.notify("draw",{prop:"drawImage",onPropertyChange:!1}),this.lowerContext.filter=r,e.notify("draw",{prop:"currTransState",onPropertyChange:!1,value:{type:"reverse",isPreventDestination:!0,context:null,isPreventCircleCrop:null}}),""===t&&""!==e.transform.currFlipState&&(t=e.transform.currFlipState),e.transform.currFlipState=t,this.flipColl=i,e.objColl=Pe([],n,[],!0),this.lowerContext.filter="none",e.notify("shape",{prop:"iterateObjColl",onPropertyChange:!1}),this.lowerContext.filter=r,0!==o.activePoint.width&&(e.activeObj=Pe({},o,{},!0)),this.isReverseFlip=!1},rUt.prototype.rotateZoom=function(e){var t=this.parent,i=Math.pow(10,1),i=Math.round(t.transform.zoomFactor*i)/i,i=(.1==i&&-.1===e||0==i&&-.025===e?t.transform.zoomFactor=0:t.transform.zoomFactor+=e,t.isCropTab?t.transform.cropZoomFactor=t.transform.zoomFactor:t.transform.defaultZoomFactor=t.transform.zoomFactor,Pe([],t.objColl,[],!0)),e=Pe({},t.activeObj,{},!0),n=(t.objColl=[],t.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),t.notify("draw",{prop:"updateCurrTransState",onPropertyChange:!1,value:{type:"initial",isPreventDestination:null,isRotatePan:null}}),t.notify("draw",{prop:"setRotateZoom",onPropertyChange:!1,value:{isRotateZoom:!0}}),t.notify("draw",{prop:"setDestPoints",onPropertyChange:!1}),this.lowerContext.filter),n=(t.notify("draw",{prop:"drawImage",onPropertyChange:!1}),this.lowerContext.filter=n,t.notify("draw",{prop:"setRotateZoom",onPropertyChange:!1,value:{isRotateZoom:!1}}),t.notify("draw",{prop:"updateCurrTransState",onPropertyChange:!1,value:{type:"reverse",isPreventDestination:null,isRotatePan:null}}),t.objColl=i,t.activeObj=e,{width:this.cropDimension.width,height:this.cropDimension.height});n.width+=n.width*t.transform.zoomFactor,n.height+=n.height*t.transform.zoomFactor,t.notify("draw",{prop:"setZoomCropWidth",value:{width:n.width,height:n.height}})},rUt.prototype.autoEnablePan=function(){var e=this.parent;e.transform.zoomFactor<=0?(e.togglePan=!1,e.notify("selection",{prop:"setDragCanvas",value:{bool:!1}}),e.pan(!1),this.disablePan=!1):e.pan(!this.disablePan)},rUt.prototype.cropZoom=function(e,t){var i=this.parent,n=i.img.destLeft,o=i.img.destTop,r={width:0,height:0};return(r=i.transform.degree%90==0&&i.transform.degree%180!=0?this.calcMaxDimension(i.img.srcHeight,i.img.srcWidth):this.calcMaxDimension(i.img.srcWidth,i.img.srcHeight)).width+=r.width*i.transform.zoomFactor,r.height+=r.height*i.transform.zoomFactor,i.img.destLeft=n-(r.width-i.img.destWidth)/2,i.img.destTop=o-(r.height-i.img.destHeight)/2,n=i.img.destLeft,o=i.img.destTop,t&&0===i.transform.straighten&&(i.img.destLeft>t.activePoint.startX&&(i.img.destLeft=t.activePoint.startX,0===i.transform.degree)&&(i.panPoint.totalPannedPoint.x-=n-i.img.destLeft),i.img.destTop>t.activePoint.startY&&(i.img.destTop=t.activePoint.startY,0===i.transform.degree)&&(i.panPoint.totalPannedPoint.y-=o-i.img.destTop),i.img.destLeft+r.width<t.activePoint.endX&&(i.img.destLeft=t.activePoint.endX-r.width,0===i.transform.degree)&&(i.panPoint.totalPannedPoint.x-=n-i.img.destLeft),i.img.destTop+r.height<t.activePoint.endY)&&(i.img.destTop=t.activePoint.endY-r.height,0===i.transform.degree)&&(i.panPoint.totalPannedPoint.y-=o-i.img.destTop),r},rUt.prototype.setZoomDimension=function(e,t){var i,n,o,r,s,a=this.parent,l=a.transform.degree,h={width:0,height:0};return(h=l%90==0&&l%180!=0?this.calcMaxDimension(a.img.srcHeight,a.img.srcWidth):this.calcMaxDimension(a.img.srcWidth,a.img.srcHeight)).width+=h.width*a.transform.zoomFactor,h.height+=h.height*a.transform.zoomFactor,a.img.destLeft+=(a.img.destWidth-h.width)/2,a.img.destTop+=(a.img.destHeight-h.height)/2,e<0&&t?(l=t.activePoint.startX,i=t.activePoint.startY,n=t.activePoint.width,o=t.activePoint.height,r=a.img.destLeft+h.width,s=a.img.destTop+h.height,a.img.destLeft>l&&(a.img.destLeft=l),a.img.destTop>i&&(a.img.destTop=i),r<l+n&&(a.img.destLeft=l+n-h.width),s<i+o&&(a.img.destTop=i+o-h.height)):e<0&&je(t)&&(0<a.img.destLeft&&(a.img.destLeft=0),0<a.img.destTop&&(a.img.destTop=0),a.img.destLeft+h.width<a.lowerCanvas.clientWidth&&(a.img.destLeft=a.lowerCanvas.clientWidth-a.img.destWidth),a.img.destTop+h.height<a.lowerCanvas.clientHeight)&&(a.img.destTop=a.lowerCanvas.clientHeight-a.img.destHeight),h},rUt.prototype.drawPannedImage=function(e,t){var i=this.parent,n={panDown:null},n=(i.notify("selection",{prop:"getPanDown",onPropertyChange:!1,value:{obj:n}}),{startPoint:n.panDown,endPoint:this.panMove,cancel:!1});i.trigger("panning",n),n.cancel||this.panEvent(e,t)},rUt.prototype.panEvent=function(e,t,i){var n,o,r,s,a,l=this.parent,h=!1;l.activeObj.shape&&"shape"===l.activeObj.shape&&l.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),je(l.activeObj.shape)&&(h=!0,a=(n=l.activeObj.activePoint={startX:l.img.destLeft,startY:l.img.destTop,endX:l.img.destLeft+l.img.destWidth,endY:l.img.destTop+l.img.destHeight}).startX,o=n.startY,r=n.endX,s=n.endY,a<0&&(n.startX=0),o<0&&(n.startY=0),r>l.lowerCanvas.width&&(n.endX=l.lowerCanvas.width),s>l.lowerCanvas.height&&(n.endY=l.lowerCanvas.height),n.width=n.endX-n.startX,n.height=n.endY-n.startY,l.activeObj.shape="crop-custom",l.notify("shape",{prop:"getStrokeSettings",onPropertyChange:!(a={strokeSettings:{}}),value:{obj:a}}),l.activeObj.strokeSettings=a.strokeSettings,l.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:n,obj:l.activeObj,isMouseMove:null,x:null,y:null}}),l.isCropTab=!0),0===l.transform.degree?(o=void 0,o=je(e)&&je(t)||i?i?this.updatePanPoints(e,t):this.updatePanPoints():{x:e,y:t},l.panPoint.totalPannedPoint.x+=o.x,l.panPoint.totalPannedPoint.y+=o.y,r=Pe({},l.activeObj,{},!0),s=this.lowerContext.filter,this.drawPannImage(o,h),this.lowerContext.filter=s,this.tempPanMove=Pe({},this.panMove,{},!0),l.activeObj=Pe({},r,{},!0),this.upperContext.clearRect(0,0,l.upperCanvas.width,l.upperCanvas.height),l.activeObj.shape&&l.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:l.activeObj}})):(a=l.transform.currFlipState,l.isCropTab=!0,je(e)&&je(t)||i?l.panPoint.currentPannedPoint=i?this.updatePanPoints(e,t):this.updatePanPoints():l.panPoint.currentPannedPoint={x:e,y:t},l.transform.currFlipState=a,this.rotatePan(null,null,h),l.isCropTab=!1,this.tempPanMove=Pe({},this.panMove,{},!0)),h&&(l.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),l.isCropTab=!1,this.upperContext.clearRect(0,0,l.upperCanvas.width,l.upperCanvas.height))},rUt.prototype.drawPannImage=function(e,t){var i=this.parent,n=this.lowerContext.filter,o={startX:i.img.destLeft,startY:i.img.destTop,width:i.img.destWidth,height:i.img.destHeight},n=(this.lowerContext.clearRect(0,0,i.lowerCanvas.width,i.lowerCanvas.height),i.notify("draw",{prop:"updateCurrTransState",onPropertyChange:!1,value:{type:"initial",isPreventDestination:null,isRotatePan:null}}),i.img.destLeft=o.startX,i.img.destTop=o.startY,i.img.destWidth=o.width,i.img.destHeight=o.height,this.setDestPointsForFlipState(),t&&(i.isCropTab=!1),i.notify("draw",{prop:"drawImage",onPropertyChange:!1}),t&&(i.isCropTab=!0),(i.currSelectionPoint&&"crop-circle"===i.currSelectionPoint.shape||i.isCircleCrop)&&i.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:!0}}),this.lowerContext.filter=n,i.notify("draw",{prop:"updateCurrTransState",onPropertyChange:!1,value:{type:"reverse",isPreventDestination:null,isRotatePan:null}}),i.img.destLeft=o.startX,i.img.destTop=o.startY,i.img.destWidth=o.width,i.img.destHeight=o.height,this.lowerContext.filter);this.lowerContext.filter="none",t&&(i.isCropTab=!1),i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"pan",pen:"pan",x:e.x,y:e.y,panRegion:""}}),t&&(i.isCropTab=!0),this.lowerContext.filter=n,i.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),i.isCircleCrop&&i.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:!0}})},rUt.prototype.resetZoom=function(){var e,t,i=this.parent;0!==i.transform.defaultZoomFactor&&(e=i.isUndoRedo,i.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(t={currObj:{}}),value:{object:t}}),this.transCurrObj=t.currObj,this.transCurrObj.objColl=Pe([],i.objColl,null,!0),this.transCurrObj.pointColl=Pe({},i.pointColl,null,!0),this.transCurrObj.afterCropActions=Pe([],i.afterCropActions,[],!0),i.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(t={selPointColl:null}),value:{obj:t}}),this.transCurrObj.selPointColl=Pe([],t.selPointColl,[],!0),i.isUndoRedo=i.isCropToolbar=!0,0<(t=i.transform.defaultZoomFactor)?this.zoomAction(-t):this.zoomAction(Math.abs(t)),i.isCropToolbar=!1,i.isUndoRedo=e)},rUt.prototype.performTransformation=function(e){var t=this.parent;this.resetZoom(),this.updateTransform(e);for(var i,n=0,o=t.objColl.length;n<o;n++)0<t.objColl[n].flipObjColl.length&&(i={collection:t.objColl[n].flipObjColl},t.notify("shape",{prop:"alignRotateFlipColl",onPropertyChange:!1,value:{collection:i.collection,isRotateFlipCollection:null,obj:i}}),t.objColl[n].flipObjColl=i.collection,0===t.objColl[n].flipObjColl.length)&&(t.objColl[n].shapeFlip="")},rUt.prototype.updateTransform=function(e){switch(e.toLowerCase()){case"rotateleft":this.rotateImage(-90);break;case"rotateright":this.rotateImage(90);break;case"horizontalflip":this.flipImage(SUt.Horizontal);break;case"verticalflip":this.flipImage(SUt.Vertical)}},rUt.prototype.rotatePan=function(e,t,i){var n,o=this.parent,r=(this.isReverseRotate=!0,o.transform.degree),s={selPointColl:null},a=(o.activeObj.activePoint&&o.activeObj.shape&&(n=Pe({},o.activeObj,{},!0)),Pe([],o.objColl,[],!0)),l=Pe([],o.pointColl,[],!0),s=(o.objColl=[],o.pointColl=[],o.freehandCounter=0,o.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:s}}),s.selPointColl),h=(o.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:[]}}}),o.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),o.notify("draw",{prop:"setRotateZoom",onPropertyChange:!1,value:{isRotateZoom:!0}}),o.notify("draw",{prop:"updateCurrTransState",onPropertyChange:!1,value:{type:"initial",isPreventDestination:null,isRotatePan:null}}),o.img.destLeft),d=o.img.destTop,p=o.panPoint.totalPannedInternalPoint,p=(o.isCropTab&&(o.img.destLeft+=p.x,o.img.destTop+=p.y),o.notify("crop",{prop:"updateRotatePan",onPropertyChange:!1}),o.isCropTab&&(o.panPoint.totalPannedInternalPoint.x=o.img.destLeft-h,o.panPoint.totalPannedInternalPoint.y=o.img.destTop-d),this.lowerContext.filter),h=(i&&(o.isCropTab=!1),o.notify("draw",{prop:"drawImage",onPropertyChange:!1}),i&&(o.isCropTab=!0),o.notify("draw",{prop:"setRotateZoom",onPropertyChange:!1,value:{isRotateZoom:!1}}),o.notify("draw",{prop:"updateCurrTransState",onPropertyChange:!1,value:{type:"reverse",isPreventDestination:!0,isRotatePan:!0}}),o.img.destLeft),d=o.img.destTop;o.img.destLeft+=o.panPoint.totalPannedClientPoint.x,o.img.destTop+=o.panPoint.totalPannedClientPoint.y,o.img.destLeft+=o.panPoint.currentPannedPoint.x,o.img.destTop+=o.panPoint.currentPannedPoint.y,o.panPoint.totalPannedClientPoint.x=o.img.destLeft-h,o.panPoint.totalPannedClientPoint.y=o.img.destTop-d,o.objColl=a,o.pointColl=l,o.freehandCounter=o.pointColl.length,o.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:s}}}),o.transform.degree=r,this.lowerContext.filter="none",e&&(t?(o.panPoint.totalPannedClientPoint.x=-o.panPoint.totalPannedClientPoint.x,o.panPoint.totalPannedClientPoint.y=-o.panPoint.totalPannedClientPoint.y,o.panPoint.currentPannedPoint=Pe({},o.panPoint.totalPannedClientPoint,{},!0),o.panPoint.totalPannedClientPoint={x:0,y:0},o.img.destLeft+=o.panPoint.currentPannedPoint.x,o.img.destTop+=o.panPoint.currentPannedPoint.y):o.panPoint.currentPannedPoint=Pe({},o.panPoint.totalPannedClientPoint,{},!0)),i&&(o.isCropTab=!1),o.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"pan",pen:"pan",x:o.panPoint.currentPannedPoint.x,y:o.panPoint.currentPannedPoint.y,panRegion:""}}),i&&(o.isCropTab=!0),this.lowerContext.filter=p,o.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),this.upperContext.clearRect(0,0,o.upperCanvas.width,o.upperCanvas.height),o.activeObj=Pe({},n,{},!0),o.activeObj.activePoint&&o.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:o.activeObj,isCropRatio:null,points:null,isPreventDrag:!0,saveContext:null,isPreventSelection:null}}),this.isReverseRotate=!1},rUt.prototype.limitPan=function(){var e=this.parent,t=e.activeObj.activePoint,i=t.startX,n=t.startY,o=t.endX,t=t.endY,r=e.img;e.activeObj.activePoint&&(r.destLeft>i&&(e.img.destLeft=i),r.destTop>n&&(e.img.destTop=n),r.destLeft+r.destWidth<o&&(e.img.destLeft=o-r.destWidth),r.destTop+r.destHeight<t)&&(e.img.destTop=t-r.destHeight)},rUt.prototype.pan=function(e,t,i){var n=this.parent;!n.disabled&&n.isImageLoaded&&(e?(n.togglePan=!0,n.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:null}}),n.notify("selection",{prop:"setDragCanvas",value:{bool:!0}}),n.lowerCanvas.style.cursor=n.upperCanvas.style.cursor=n.cursor="grab",n.notify("selection",{prop:"setPanDown",onPropertyChange:!1,value:{panDown:null}}),(t||i)&&(t=t||0,i=i||0,je(this.panMove)&&(this.panMove={x:t,y:i}),je(this.tempPanMove)&&(this.tempPanMove={x:this.panMove.x,y:this.panMove.y}),this.panEvent(t,i,!0),this.tempPanMove=null)):(n.togglePan=n.currObjType.isCustomCrop=!1,n.notify("selection",{prop:"setDragCanvas",value:{bool:!1}}),n.lowerCanvas.style.cursor=n.upperCanvas.style.cursor=n.cursor="default"))},rUt.prototype.zoom=function(e,t){var i=this.parent;if(!i.disabled&&i.isImageLoaded){e=this.getCurrentZoomFactor(e);if(je(t))this.zoomAction(e,t);else for(var n=0<e?"zoomIn":"zoomOut",o=10*Math.abs(e),r=0;r<o;r++)i.notify("draw",{prop:"performPointZoom",onPropertyChange:!1,value:{x:t.x,y:t.y,type:n,isResize:null}});e={action:0<e?"zoom-in":"zoom-out",actionEventArgs:i.editCompleteArgs};i.triggerEditCompleteEvent(e)}},rUt.prototype.getCurrentZoomFactor=function(e){return!(1<=e)||this.prevZoomValue<1?e-this.prevZoomValue:.1*(e-this.prevZoomValue)},rUt.prototype.setCurrPanRegion=function(e,t,i){var n=e,n=""===e?"horizontal"===t?"horizontal":"vertical"===t?"vertical":e:"horizontal"===e?"horizontal"===t?"horizontalVertical":"vertical"===t?"verticalHorizontal":90===t?"vertical":-90===t?"horizontal":e:"vertical"===e?"horizontal"===t?"horizontalVertical":"vertical"===t?"verticalHorizontal":90===t?"horizontal":-90===t?"vertical":e:"horizontal"===t?"vertical":"vertical"===t?"horizontal":e;i.panRegion=n},rUt.prototype.rotate=function(e,t){var i=this.parent;!i.disabled&&i.isImageLoaded&&e%90==0&&this.rotateImage(e),t.isRotate=!1},rUt.prototype.flip=function(e){var t=this.parent;!t.disabled&&t.isImageLoaded&&this.flipImage(e)},rUt.prototype.update=function(){var e,t,i=this.parent,n=0,o=!1,r={bool:!1},s=i.isStraightening,a=0,l=i.element.querySelector("#"+i.element.id+"_contextualToolbar"),h=i.element.querySelector(".e-contextual-toolbar-wrapper"),d=i.element.querySelector("#"+i.element.id+"_headWrapper"),l=(i.isImageLoaded&&(p=!1,e=void 0,F.isDevice&&(i.activeObj.shape&&(e=i.activeObj.shape.split("-")),i.currObjType.isCustomCrop||e&&"crop"===e[0])&&(p=!0),i.notify("toolbar",{prop:"getFrameToolbar",onPropertyChange:!1,value:{obj:{bool:null}}}),!s&&(l&&!l.parentElement.classList.contains("e-hide")||d&&!d.parentElement.classList.contains("e-hide"))&&(h.classList.add("e-hide"),p||i.okBtn(null,!0),i.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1}),i.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1})),i.notify("selection",{prop:"getFreehandDrawEditing",onPropertyChange:!1,value:{obj:r}}),r.bool&&i.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1}),e=Pe({},i.activeObj.activePoint,{},!0),!i.activeObj.shape||0===e.width&&0===e.height||(o=!0,"block"===i.textArea.style.display||"inline-block"===i.textArea.style.display?(i.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:null}}),i.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1})):(i.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),i.objColl.push(i.activeObj)),i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}))),i.updateDropInfoContent(i.element.querySelector(".e-ie-drop-info")),this.lowerContext.filter),d=i.element.querySelector("#"+i.element.id+"_canvasWrapper"),p=(d&&(d.style.width=i.element.offsetWidth-2+"px"),i.lowerCanvas.width=i.upperCanvas.width=i.maskCanvas.width=i.element.offsetWidth-2,i.toolbarTemplate?n=i.element.querySelector("#"+i.element.id+"_toolbarArea").clientHeight:i.element.querySelector("#"+i.element.id+"_toolbar")&&0===(n=i.element.querySelector("#"+i.element.id+"_toolbar").clientHeight)&&i.toolbar&&0<i.toolbar.length&&-1===i.toolbar.indexOf("Open")&&(i.notify("toolbar",{prop:"getToolbarHeight",value:{obj:t={toolbarHeight:0}}}),n=t.toolbarHeight),i.element.querySelector("#"+i.element.id+"_contextualToolbarArea"));F.isDevice&&s&&p&&(a=p.clientHeight),i.notify("toolbar",{prop:"setToolbarHeight",value:{height:n}}),F.isDevice?d&&(d.style.height=i.element.offsetHeight-(2*n+a)-4+"px"):d&&(d.style.height=i.element.offsetHeight-n-2+"px"),i.lowerCanvas.height=i.upperCanvas.height=parseFloat(d.style.height),this.lowerContext.filter="brightness(1) contrast(100%) hue-rotate(0deg) saturate(100%) opacity(1) blur(0px) sepia(0%) grayscale(0%) invert(0%)",i.notify("filter",{prop:"setAdjustmentValue",onPropertyChange:!1,value:{adjustmentValue:this.lowerContext.filter}}),i.canvasFilter=this.lowerContext.filter,i.initialAdjustmentValue=this.lowerContext.filter,i.clearContext(this.lowerContext),i.clearContext(this.upperContext),i.isImageLoaded&&(i.notify("shape",{prop:"applyActObj",onPropertyChange:!1,value:{isMouseDown:null}}),i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.lowerContext.filter=l,i.initialAdjustmentValue=l,i.canvasFilter=this.lowerContext.filter,i.isImageLoaded&&(kA(i.element),i.element.style.opacity="0.5"),this.lowerContext.clearRect(0,0,i.lowerCanvas.width,i.lowerCanvas.height),this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height),d&&(d.style.width=i.element.offsetWidth-2+"px",d.style.height=i.element.offsetHeight+"px",i.notify("toolbar",{prop:"getToolbarHeight",value:{obj:e={toolbarHeight:0}}}),F.isDevice?d.style.height=parseFloat(d.style.height)-2*e.toolbarHeight-a-4+"px":d.style.height=parseFloat(d.style.height)-e.toolbarHeight-2+"px"),i.lowerCanvas.width=i.upperCanvas.width=i.maskCanvas.width=parseFloat(d.style.width),i.lowerCanvas.height=i.upperCanvas.height=i.maskCanvas.height=parseFloat(d.style.height),this.lowerContext.filter=l,this.calcMaxDimension(i.img.srcWidth,i.img.srcHeight,t={width:0,height:0}),p=t,s&&0!==i.transform.cropZoomFactor?(p.width+=p.width*i.transform.cropZoomFactor,p.height+=p.height*i.transform.cropZoomFactor):0<i.transform.defaultZoomFactor&&(p.width+=p.width*i.transform.defaultZoomFactor,p.height+=p.height*i.transform.defaultZoomFactor),i.img.destLeft=(i.lowerCanvas.clientWidth-p.width)/2,i.img.destTop=(i.lowerCanvas.clientHeight-p.height+1)/2,0===i.transform.degree&&""===i.transform.currFlipState?(0<i.transform.defaultZoomFactor&&(i.img.destLeft+=i.panPoint.totalPannedPoint.x,i.img.destTop+=i.panPoint.totalPannedPoint.y),i.notify("draw",{prop:"draw-image-to-canvas",value:{dimension:p}})):(i.notify("draw",{prop:"draw-image-to-canvas",value:{dimension:p}}),i.notify("draw",{prop:"updateCurrTransState",onPropertyChange:!1,value:{type:"initial",isPreventDestination:null,isRotatePan:null}}),n=this.lowerContext.filter,i.notify("draw",{prop:"drawImage",onPropertyChange:!1}),this.lowerContext.filter=n,i.notify("draw",{prop:"updateCurrTransState",onPropertyChange:!1,value:{type:"reverse",isPreventDestination:null,isRotatePan:null}})),i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),i.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),i.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.upperContext}}),i.isCircleCrop&&i.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),BA(i.element),i.element.style.opacity="1",i.notify("toolbar",{prop:"getDefToolbarItems",value:{obj:a={defToolbarItems:null}}}),a.defToolbarItems&&0<a.defToolbarItems.length&&document.getElementById(i.element.id+"_toolbar")&&((e=At(i.element.id+"_toolbar","toolbar"))&&e.refreshOverflow(),h)&&!s&&h.classList.add("e-hide"),i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height),o&&(d=Pe({},i.objColl[i.objColl.length-1],null,!0),i.objColl.pop(),0!==d.activePoint.width)&&0!==d.activePoint.height&&(this.lowerContext.clearRect(0,0,i.lowerCanvas.width,i.lowerCanvas.height),i.notify("draw",{prop:"render-image",value:{isMouseWheel:null}}),i.objColl.push(d),i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),d=Pe({},i.objColl[i.objColl.length-1],null,!0),i.objColl.pop(),this.lowerContext.clearRect(0,0,i.lowerCanvas.width,i.lowerCanvas.height),i.notify("draw",{prop:"render-image",value:{isMouseWheel:null}}),i.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:d}}),s&&i.notify("draw",{prop:"setStraightenActObj",value:{activeObj:d}}),"rectangle"!==i.activeObj.shape&&"ellipse"!==i.activeObj.shape&&"text"!==i.activeObj.shape&&"line"!==i.activeObj.shape&&"arrow"!==i.activeObj.shape&&"path"!==i.activeObj.shape&&"image"!==i.activeObj.shape||i.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:null}})),r.bool&&i.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:!0}}),i.isResize&&(i.aspectWidth=Math.ceil(i.img.destWidth),i.aspectHeight=Math.ceil(i.img.destHeight),i.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"resize",isApplyBtn:!1,isCropping:!1}}),i.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"resize",isApplyBtn:!1,isCropping:!1}})),(0!==i.transform.degree||""!==i.transform.currFlipState)&&0<i.transform.defaultZoomFactor?(l=Pe({},i.panPoint.totalPannedPoint,null,!0),t=Pe({},i.panPoint.totalPannedInternalPoint,null,!0),p=Pe({},i.panPoint.totalPannedClientPoint,null,!0),this.zoomAction(.1),this.zoomAction(-.1),0===i.transform.degree?(i.img.destLeft+=l.x,i.img.destTop+=l.y,i.panPoint.totalPannedPoint=l,i.notify("draw",{prop:"updateFlipPan",value:{tempSelectionObj:null}})):(i.panPoint.totalPannedInternalPoint=t,i.panPoint.totalPannedClientPoint=p,i.panPoint.currentPannedPoint={x:0,y:0},i.isCropTab=!0,this.rotatePan(),i.isCropTab=!1)):0!==i.transform.degree&&0<i.transform.cropZoomFactor&&(i.transform.zoomFactor=0,i.transform.cropZoomFactor=null,i.notify("toolbar",{prop:"enable-disable-btns",onPropertyChange:!1})))},rUt.prototype.calcMaxDimension=function(e,t,i,n){var o={toolbarHeight:0},r=this.parent,s=(r.notify("toolbar",{prop:"getToolbarHeight",value:{obj:o}}),n?r.element.clientWidth/3:r.element.clientWidth),a=n?(r.element.clientHeight-o.toolbarHeight)/3:r.element.clientHeight-o.toolbarHeight,a=F.isDevice?a-o.toolbarHeight:a,o=(F.isDevice&&r.isStraightening&&(a-=(o=r.element.querySelector("#"+r.element.id+"_contextualToolbarArea"))?o.clientHeight:0),n||0!==r.element.clientHeight||(a=0),je(n)&&(30<s&&(s-=30),30<a)&&(a-=30),s/e),l=a/t,s=Math.min(e,s),a=Math.min(t,a);return o<1&&o<l?(s=e*o,a=t*o):l<1&&l<o&&(s=e*l,a=t*l),je(n)&&(r.notify("crop",{prop:"getPreventScaling",onPropertyChange:!(o={bool:null}),value:{obj:o}}),o.bool)&&r.cropObj.activeObj.activePoint&&0!==r.cropObj.activeObj.activePoint.width&&0!==r.cropObj.activeObj.activePoint.height&&(s=r.cropObj.activeObj.activePoint.width,a=r.cropObj.activeObj.activePoint.height),i&&(i.width=s,i.height=a),{width:s,height:a}},rUt.prototype.updatePanPoints=function(e,t){for(var i=this.parent,n=Pe({},i.activeObj,{},!0),o=i.img.destLeft,r=i.img.destTop,s=(je(this.tempPanMove)&&(this.tempPanMove={x:this.panMove.x,y:this.panMove.y}),this.panMove.x-this.tempPanMove.x),a=this.panMove.y-this.tempPanMove.y,l=((e||t)&&(s=e,a=t),i.img.destLeft+=s,i.img.destTop+=a,this.limitPan(),{bool:null}),h={isIntersect:null},d=(i.notify("draw",{prop:"updateImgCanvasPoints",onPropertyChange:!1}),i.notify("draw",{prop:"isLinesIntersect",onPropertyChange:!1,value:{obj:h}}),i.notify("draw",{prop:"isSelOutsideImg",onPropertyChange:!1,value:{obj:l}}),0);0!==i.transform.straighten&&(h.isIntersect||l.bool)&&(d++,i.img.destLeft=o,i.img.destTop=r,0!==s&&0<s?--s:0!==s&&s<0&&(s+=1),0!==a&&0<a?--a:0!==a&&a<0&&(a+=1),0!==s||0!==a)&&200!==d;)i.img.destLeft+=s,i.img.destTop+=a,this.limitPan(),i.notify("draw",{prop:"updateImgCanvasPoints",onPropertyChange:!1}),i.notify("draw",{prop:"isLinesIntersect",onPropertyChange:!1,value:{obj:h}}),i.notify("draw",{prop:"isSelOutsideImg",onPropertyChange:!1,value:{obj:l}});return i.activeObj=n,{x:i.img.destLeft-o,y:i.img.destTop-r}},rUt.prototype.resizeImage=function(e,t){var i=this.parent,n=!0,o=!0,r=(i.allowDownScale=!1,i.img.srcLeft=0,i.img.srcTop=0,i.isAspectRatio=!0,[]);for(i.img.srcWidth=i.baseImgCanvas.width,i.img.srcHeight=i.baseImgCanvas.height,i.resizeSrc&&0!==i.resizeSrc.width&&0!==i.resizeSrc.height&&(i.img.srcLeft=i.resizeSrc.startX,i.img.srcTop=i.resizeSrc.startY,i.img.srcWidth=i.resizeSrc.width,i.img.srcHeight=i.resizeSrc.height);(e<i.img.destWidth||t<i.img.destHeight)&&o;)if(this.zoomAction(-.1,null,!0,!0),e>i.img.destWidth||t>i.img.destHeight)for(;e>i.img.destWidth||t>i.img.destHeight;)this.zoomAction(.0125,null,!0,!0),o=!1,r.push(i.img.destWidth);for(;(e>i.img.destWidth||t>i.img.destHeight)&&o&&n;)if(this.zoomAction(.1,null,!0,!0),e<i.img.destWidth||t<i.img.destHeight)for(;e<i.img.destWidth;)this.zoomAction(-.0125,null,!0,!0),n=!1,r.push(i.img.destWidth);for(var s=r[0],a=Math.abs(i.img.destWidth-s),l=0,h=r;l<h.length;l++){var d=h[l],p=Math.abs(e-d);p<a&&(s=d,a=p)}s<e&&n&&(this.zoomAction(-.0125,null,!0,!0),n=!1),e<s&&!n&&(this.zoomAction(.0125,null,!0,!0),n=!1),this.zoomAction(.0125,null,!0),i.allowDownScale=!0,this.zoomAction(-.0125,null,!0);var c=Pe({},i.cropObj,{},!0),u=Pe({},this.prevResizeCurrObj,{},!0);i.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"resize",previousObj:u,previousObjColl:u.objColl,previousPointColl:u.pointColl,previousSelPointColl:u.selPointColl,previousCropObj:c,previousText:null,currentText:null,previousFilter:null,isCircleCrop:i.isCircleCrop}}),i.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}})},rUt.prototype.resizeCrop=function(e,t){var i=this.parent,n=!0,o={prevObj:i.prevObj},r=(i.cropObj=Pe({},i.prevCropObj,{},!0),i.allowDownScale=!1,i.notify("toolbar",{prop:"getPrevObj",onPropertyChange:!1,value:{obj:o}}),Pe({},o.prevObj.activeObj,{},!0)),s=(o.prevObj.activeObj=Pe({},i.activeObj,{},!0),i.notify("draw",{prop:"setCurrentObj",onPropertyChange:!1,value:{obj:o.prevObj}}),i.objColl=Pe([],o.prevObj.objColl,[],!0),i.pointColl=Pe([],o.prevObj.pointColl,[],!0),i.transform.straighten=0,i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),0!==i.transform.straighten||this.isPreventSelect||i.notify("freehand-draw",{prop:"updateFHDColl",onPropertyChange:!1}),e),a=t,l=!1;if(e<=t&&t<=Math.ceil(i.img.destHeight)){for(;t<=Math.ceil(i.img.destHeight)&&n;)if(this.zoomAction(-.1,null,!0,!0),e>i.img.destWidth||t>i.img.destHeight)for(;e>i.img.destWidth||t>i.img.destHeight;)this.zoomAction(.0125,null,!0,!0),n=!1}else if(t<=e&&e<i.img.destWidth){for(;e<i.img.destWidth&&n;)if(this.zoomAction(-.1,null,!0,!0),e>i.img.destWidth||t>i.img.destHeight)for(;e>i.img.destWidth||t>i.img.destHeight;)this.zoomAction(.0125,null,!0,!0),n=!1}else if(e<=t&&t>=i.img.destHeight)for(;t>=i.img.destHeight&&n;)this.zoomAction(.1,null,!0,!0);else if(t<=e&&e>=i.img.destWidth){for(;e>=i.img.destWidth&&n;)this.zoomAction(.1,null,!0,!0);if(e<i.img.destWidth&&t<i.img.destHeight){for(;e<i.img.destWidth&&t<i.img.destHeight;)this.zoomAction(-.0125,null,!0,!0),n=!1;this.zoomAction(.0125,null,!0,!0)}}else if(t>i.img.destHeight&&e>i.img.destWidth){for(;t>i.img.destHeight&&e>i.img.destWidth&&n;)this.zoomAction(.1,null,!0,!0);if(e<i.img.destWidth&&t<i.img.destHeight){for(;e<i.img.destWidth&&t<i.img.destHeight;)this.zoomAction(-.0125,null,!0,!0),n=!1;this.zoomAction(.0125,null,!0,!0)}}if(this.resizeImg(r,e,t),e=s,(t=a)!==i.img.destHeight||e!==i.img.destWidth){for(;t>i.img.destHeight||e>i.img.destWidth;)this.zoomAction(.0125,null,!0,!0),l=!0;l&&(this.zoomAction(-.0125,null,!0,!0),l=!1)}if(t!==i.img.destHeight||e!==i.img.destWidth){for(;t<i.img.destHeight||e<i.img.destWidth;)this.zoomAction(-.0125,null,!0,!0),l=!0;l&&(this.zoomAction(-.0125,null,!0,!0),l=!1)}o.prevObj.activeObj=Pe({},r,{},!0),this.zoomAction(.0125,null,!0),i.allowDownScale=!this.preventDownScale,i.isCropTab=!1,this.zoomAction(-.0125,null,!0),i.aspectWidth=e,i.aspectHeight=t},rUt.prototype.resizeImg=function(e,t,i){for(var n=this.parent,o=t/n.img.destWidth,r=i/n.img.destHeight,s=(e.shape?(n.currSelectionPoint=e,n.notify("crop",{prop:"setInitCrop",onPropertyChange:!1,value:{bool:!0}})):n.img.srcWidth===n.baseImgCanvas.width&&n.img.srcHeight===n.baseImgCanvas.height&&(n.currSelectionPoint=null,n.notify("draw",{prop:"select",onPropertyChange:!1,value:{type:"custom",startX:null,startY:null,width:null,height:null}})),je(n.currSelectionPoint)?n.notify("draw",{prop:"select",onPropertyChange:!1,value:{type:"custom",startX:n.img.destLeft,startY:n.img.destTop,width:n.img.destWidth,height:n.img.destHeight}}):n.notify("draw",{prop:"select",onPropertyChange:!1,value:{type:"custom",startX:null,startY:null,width:null,height:null}}),t=n.activeObj.activePoint.width*o,i=n.activeObj.activePoint.height*r,n.activeObj.activePoint.startX+n.activeObj.activePoint.width/2-t/2),a=n.activeObj.activePoint.startY+n.activeObj.activePoint.height/2-i/2,l=0;F.isDevice&&l<500&&(s<0||a<0||s+t>n.img.destWidth||a+i>n.img.destHeight);)l++,s=n.activeObj.activePoint.startX+n.activeObj.activePoint.width/2- --t/2,a=n.activeObj.activePoint.startY+n.activeObj.activePoint.height/2- --i/2;if(n.transform.defaultZoomFactor=0,n.notify("draw",{prop:"setResizeSelect",value:{bool:!0}}),n.notify("draw",{prop:"setIsCropSelect",value:{bool:!0}}),n.notify("draw",{prop:"select",onPropertyChange:!1,value:{type:"custom",startX:s,startY:a,width:t,height:i}}),n.notify("draw",{prop:"setResizeSelect",value:{bool:!1}}),0!==n.transform.straighten){var h={isIntersect:null,arr:null};for(n.notify("draw",{prop:"updateImgCanvasPoints",onPropertyChange:!1}),n.notify("draw",{prop:"isLinesIntersect",onPropertyChange:!1,value:{obj:h}});h.arr[0]||h.arr[1]||h.arr[2]||h.arr[3];)this.zoomAction(.0125,null,!0),n.notify("draw",{prop:"updateImgCanvasPoints",onPropertyChange:!1}),n.notify("draw",{prop:"isLinesIntersect",onPropertyChange:!1,value:{obj:h}})}n.isCropToolbar=!0,n.crop(),n.isCropToolbar=!1},rUt.prototype.updateResize=function(){var e=this.parent,t=(e.prevCropObj=Pe({},e.cropObj,{},!0),{currObj:{}}),t=(e.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:t}}),e.prevObj=t.currObj,e.currSelectionPoint&&e.prevCropObj.activeObj.shape&&(e.prevObj.activeObj=Pe({},e.prevCropObj.activeObj,{},!0)),e.prevObj.objColl=Pe([],e.objColl,[],!0),e.prevObj.pointColl=Pe([],e.pointColl,[],!0),e.prevObj.afterCropActions=Pe([],e.afterCropActions,[],!0),{selPointColl:null});e.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:t}}),e.prevObj.selPointColl=Pe([],t.selPointColl,[],!0),e.resizeSrc={startX:e.img.srcLeft,startY:e.img.srcTop,width:e.img.srcWidth,height:e.img.srcHeight}},rUt.prototype.resize=function(e,t,i){var n=this.parent,o=(n.isResize=!0,je(n.prevCropObj)&&je(n.prevObj)&&n.notify("transform",{prop:"updateResize",value:{bool:!1}}),n.element.querySelector("#"+n.element.id+"_aspectratio")),r=n.element.querySelector("#"+n.element.id+"_nonaspectratio"),o=(o&&r&&(n.notify("toolbar",{prop:"initResizeToolbar"}),F.isDevice)&&n.notify("toolbar",{prop:"init-main-toolbar",value:{isApplyBtn:!1,isDevice:!0,isOkBtn:!0,isResize:!0}}),n.element.querySelector("#"+n.element.id+"_resizeHeight")),r=o?""===o.value?o.placeholder:o.value:t+"px",o={cancel:!1,previousWidth:Math.ceil(n.img.destWidth),previousHeight:Math.ceil(n.img.destHeight),width:Math.ceil(e),height:t&&0!==t?Math.ceil(t):i?Math.ceil(parseFloat(r)):Math.ceil(n.img.destHeight),isAspectRatio:i||!1};n.trigger("resizing",o),(n.editCompleteArgs=o).cancel?n.aspectHeight&&n.aspectWidth&&(n.aspectHeight=o.previousHeight,n.aspectWidth=o.previousWidth):this.resizeEventHandler(o)},rUt.prototype.resizeEventHandler=function(e){var t,i,n,o,r,s=this.parent,a=s.element.querySelector("#"+s.element.id+"_resizeWidth"),l=s.element.querySelector("#"+s.element.id+"_resizeHeight");e.isAspectRatio?(null!=this.resizedImgAngle&&this.resizedImgAngle===s.transform.degree||(this.resizedImgAngle=s.transform.degree,t=!0),t?(s.notify("transform",{prop:"resizeImage",value:{width:e.width,height:0}}),i=s.img.destWidth,n=s.img.destHeight,l&&(r=.5<=(o=parseFloat(""===a.value?a.placeholder:a.value)/(i/n))%1||o%1<=-.5?Math.round(o):o<0?Math.ceil(o):Math.floor(o),At(l,"numerictextbox").value=r,l.value=r.toString()+" px",s.aspectHeight=r,a)&&""===a.value&&(r=.5<=(o=parseFloat(""===l.value?l.placeholder:l.value)/(n/i))%1||o%1<=-.5?Math.round(o):o<0?Math.ceil(o):Math.floor(o),At(a,"numerictextbox").value=r,a.value=r.toString()+" px",s.aspectWidth=r)):s.notify("transform",{prop:"resizeImage",value:{width:e.width,height:null}})):(null!==this.resizedImgAngle&&this.resizedImgAngle!==s.transform.degree&&(this.resizedImgAngle=s.transform.degree,t=!0),t?(s.notify("transform",{prop:"setPreventDownScale",value:{bool:!0}}),s.notify("transform",{prop:"resizeCrop",value:{width:e.width,height:e.height}}),s.notify("undo-redo",{prop:"setPreventUR",value:{bool:!0}}),s.okBtn(null,!0),s.notify("undo-redo",{prop:"setPreventUR",value:{bool:!1}}),s.resizeSrc={startX:s.img.srcLeft,startY:s.img.srcTop,width:s.img.srcWidth,height:s.img.srcHeight},s.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"resize",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}),s.notify("transform",{prop:"setPreventDownScale",value:{bool:!1}}),s.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"resize",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}})):s.notify("transform",{prop:"resizeCrop",value:{width:e.width,height:e.height}})),this.resizedImgAngle=s.transform.degree},rUt.prototype.straightenImage=function(e){var t=this.parent,i=t.activeObj.shape&&-1<t.activeObj.shape.indexOf("crop-");t.toolbar&&0===t.toolbar.length&&t.notify("draw",{prop:"select",onPropertyChange:!1,value:{type:"custom",startX:null,startY:null,width:null,height:null}}),t.notify("toolbar",{prop:"performCropTransformClick",value:{shape:null}}),t.setStraighten(e),i||t.okBtn()};var oUt=rUt;function rUt(e){this.isReverseFlip=!1,this.disablePan=!1,this.isReverseRotate=!1,this.flipColl=[],this.prevZoomValue=1,this.cropDimension={width:0,height:0},this.isPreventSelect=!1,this.preventDownScale=!1,this.resizedImgAngle=null,this.parent=e,this.addEventListener()}aUt.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},aUt.prototype.addEventListener=function(){this.parent.on("undo-redo",this.undoRedo,this),this.parent.on("destroyed",this.destroy,this)},aUt.prototype.removeEventListener=function(){this.parent.off("undo-redo",this.undoRedo),this.parent.off("destroyed",this.destroy)},aUt.prototype.initializeUrPvtProp=function(){this.parent.lowerCanvas&&(this.lowerContext=this.parent.lowerCanvas.getContext("2d")),this.parent.upperCanvas&&(this.upperContext=this.parent.upperCanvas.getContext("2d"))},aUt.prototype.undoRedo=function(e){switch(this.initializeUrPvtProp(),e.prop){case"updateUndoRedoColl":this.updateUrc(e.value.operation,e.value.previousObj,e.value.previousObjColl,e.value.previousPointColl,e.value.previousSelPointColl,e.value.previousCropObj,e.value.previousText,e.value.currentText,e.value.previousFilter,e.value.isCircleCrop);break;case"refreshUrc":this.refreshUrc(e.value.bool);break;case"updateCurrUrc":this.updateCurrUrc(e.value.type,e.value.isCancel);break;case"call-undo":this.callUndo();break;case"call-redo":this.callRedo();break;case"undo":this.undo();break;case"redo":this.redo();break;case"updateUrObj":this.updateUrObj(e.value.objColl,e.value.operation);break;case"updateUndoRedo":this.updateUndoRedo(e.value?e.value.operation:null);break;case"getAppliedUndoRedoColl":e.value.obj.appliedUndoRedoColl=this.appliedUndoRedoColl;break;case"getUndoRedoStep":e.value.obj.undoRedoStep=this.undoRedoStep;break;case"setUndoRedoStep":this.undoRedoStep=e.value.step;break;case"undoDefault":this.undoDefault(e.value.obj);break;case"setPreventUR":this.isPreventing=e.value.bool;break;case"updateUndoRedoStack":e.value&&e.value.isPenDraw?this.updateUndoRedoStack(e.value.isPenDraw):this.updateUndoRedoStack();break;case"reset":this.reset()}},aUt.prototype.getModuleName=function(){return"undo-redo"},aUt.prototype.reset=function(){this.tempCurrSelPoint=null,this.undoRedoStep=0,this.undoRedoColl=[],this.appliedUndoRedoColl=[],this.tempActObj=null,this.tempUndoRedoColl=[],this.tempUndoRedoStep=0,this.isPreventing=!1},aUt.prototype.refreshUrc=function(e){var t=this.parent;t.isImageUpdated||((e=e||!1)&&(t.notify("toolbar",{prop:"setEnableDisableUndoRedo",value:{isPrevent:!0}}),this.tempUndoRedoColl=Pe([],this.appliedUndoRedoColl,[],!0),this.tempUndoRedoStep=this.undoRedoStep),t.notify("toolbar",{prop:"setEnableDisableUndoRedo",value:{isPrevent:!1}}),this.undoRedoColl=this.undoRedoColl.slice(0,this.undoRedoStep),this.appliedUndoRedoColl=this.appliedUndoRedoColl.slice(0,this.undoRedoStep),t.isUndoRedo=t.currObjType.isUndoAction=!1,t.notify("toolbar",{prop:"enable-disable-btns"}))},aUt.prototype.updateCurrUrc=function(e,t){var i=this.parent;if(!(i.isResize||this.isPreventing||i.noPushUndo)){i.notify("toolbar",{prop:"setEnableDisableUndoRedo",value:{isPrevent:!1}}),"ok"===e?(i.notify("draw",{prop:"setShapeTextInsert",onPropertyChange:!1,value:{bool:!1}}),s=0<this.tempUndoRedoColl.length?Pe([],this.tempUndoRedoColl,[],!0):Pe([],this.undoRedoColl,[],!0),n=this.undoRedoColl[this.undoRedoColl.length-1],o=this.appliedUndoRedoColl[this.appliedUndoRedoColl.length-1],r=n?Pe({},n.previousObj,{},!0):null,je(o)?this.undoRedoColl[0]&&(n.previousCropObj=s[0].previousCropObj,n.previousObj=s[0].previousObj,n.previousObjColl=s[0].previousObjColl,n.previousPointColl=s[0].previousPointColl,n.previousText=s[0].previousText):"imageHFlip"!==n.operation&&"imageVFlip"!==n.operation&&(n.previousCropObj=o.currentCropObj,n.previousObj=o.currentObj,n.previousObjColl=o.currentObjColl,n.previousPointColl=o.currentPointColl,n.previousText=o.currentText,"frame"===n.operation)&&n.previousObj&&r&&(n.previousObj.defaultZoom=r.defaultZoom,n.previousObj.zoomFactor=r.zoomFactor,n.previousObj.cropZoom=r.cropZoom),n&&("imageHFlip"!==n.operation&&"imageVFlip"!==n.operation&&(s=this.getZeroZoomObjPointValue(n.currentObjColl,n.currentPointColl),n.currentObjColl=s.obj,n.currentPointColl=s.point,i.notify("filter",{prop:"getAdjustmentLevel",onPropertyChange:!(o={adjustmentLevel:null}),value:{obj:o}}),n.currentObj.adjustmentLevel=Pe({},o.adjustmentLevel,{},!0),i.notify("filter",{prop:"setTempAdjVal"}),n.currentObj.currentFilter=i.currentFilter),this.appliedUndoRedoColl.push(n),t||this.triggerActionCompletedEvent(n.operation)),this.tempUndoRedoColl=[],this.tempUndoRedoStep=0):0<this.tempUndoRedoColl.length&&(this.appliedUndoRedoColl=Pe([],this.tempUndoRedoColl,[],!0),this.undoRedoStep=this.tempUndoRedoStep,this.tempUndoRedoColl=[],this.tempUndoRedoStep=0);var n,o,r=this.appliedUndoRedoColl[this.appliedUndoRedoColl.length-1],s=this.appliedUndoRedoColl[this.appliedUndoRedoColl.length-2];if(16<this.appliedUndoRedoColl.length)this.appliedUndoRedoColl.splice(0,1);else if(!t&&r&&s)if(("shapeTransform"===r.operation&&"shapeTransform"===s.operation||"shapeInsert"===r.operation&&"shapeInsert"===s.operation)&&JSON.stringify(r.currentObjColl)===JSON.stringify(s.currentObjColl)||"freehand-draw"===r.operation&&"freehand-draw"===s.operation&&JSON.stringify(r.currentPointColl)===JSON.stringify(s.currentPointColl)||"freehanddrawCustomized"===r.operation&&"freehanddrawCustomized"===s.operation&&JSON.stringify(r.currentPointColl)===JSON.stringify(s.currentPointColl))this.appliedUndoRedoColl.splice(this.appliedUndoRedoColl.length-1,1);else if(this.undoRedoStep!==this.appliedUndoRedoColl.length-1&&(r=this.appliedUndoRedoColl[this.appliedUndoRedoColl.length-1],s=this.appliedUndoRedoColl[this.undoRedoStep],r)&&s&&"shapeTransform"===r.operation&&"shapeTransform"===s.operation&&JSON.stringify(r.currentObjColl)===JSON.stringify(s.previousObjColl))return this.appliedUndoRedoColl.splice(this.appliedUndoRedoColl.length-1,1),this.undoRedoColl=[],void(this.undoRedoColl=Pe([],this.appliedUndoRedoColl,[],!0));this.undoRedoColl=[],this.undoRedoColl=Pe([],this.appliedUndoRedoColl,[],!0),"ok"===e&&(this.undoRedoStep=this.undoRedoColl.length,i.notify("toolbar",{prop:"enable-disable-btns"})),0<i.transform.zoomFactor&&(i.togglePan=!0,i.notify("selection",{prop:"setDragCanvas",value:{bool:!0}}))}},aUt.prototype.triggerActionCompletedEvent=function(e){var t=this.parent,e={action:{brightness:"fine-tune",contrast:"fine-tune",hue:"fine-tune",saturation:"fine-tune",opacity:"fine-tune",blur:"fine-tune",exposure:"fine-tune",default:"filter",chrome:"filter",cold:"filter",warm:"filter",grayscale:"filter",sepia:"filter",invert:"filter",deleteObj:"shape-delete",deleteFreehandDrawing:"freehand-draw-delete",shapeInsert:"shape-insert",shapeTransform:"shape-customize",freehanddrawCustomized:"freehand-draw-customize"}[e]||e,actionEventArgs:t.editCompleteArgs};t.triggerEditCompleteEvent(e)},aUt.prototype.getUndoRedoAction=function(e){return{brightness:"fine-tune",contrast:"fine-tune",hue:"fine-tune",saturation:"fine-tune",opacity:"fine-tune",blur:"fine-tune",exposure:"fine-tune",default:"filter",chrome:"filter",cold:"filter",warm:"filter",grayscale:"filter",sepia:"filter",invert:"filter",deleteObj:"shape-delete",deleteFreehandDrawing:"freehand-drawing-delete",shapeInsert:"shape-insert",shapeTransform:"shape-customize",imageRotate:"shape-customize",freehanddraw:"freehand-draw",freehanddrawCustomized:"freehand-draw-customize",textAreaCustomization:"text-area-customization",imageHFlip:"shape-customize",imageVFlip:"shape-customize",bgColor:"background-color",updateImage:"image-update"}[e]||e},aUt.prototype.cancelCropSelection=function(){var e,t=this.parent,i=!1;t.activeObj.shape&&(e=t.activeObj.shape.split("-")),(i=t.currObjType.isCustomCrop||e&&"crop"===e[0]?!0:i)&&t.notify("draw",{prop:"performCancel",value:{isContextualToolbar:null}}),0===this.tempUndoRedoColl.length&&0===this.tempUndoRedoStep||(this.appliedUndoRedoColl=Pe([],this.tempUndoRedoColl,[],!0),this.undoRedoColl=Pe([],this.tempUndoRedoColl,[],!0),this.undoRedoStep=this.tempUndoRedoStep,this.tempUndoRedoColl=[],this.tempUndoRedoStep=0,t.notify("toolbar",{prop:"setEnableDisableUndoRedo",value:{isPrevent:!1}}))},aUt.prototype.refreshToolbarActions=function(){var e=this.parent;e.activeObj.shape?(e.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"shapes",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}),e.notify("toolbar",{prop:"update-toolbar-items",onPropertyChange:!1})):e.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1})},aUt.prototype.applyCurrentChanges=function(){var e=this.parent;e.currObjType.isFiltered=!1,0===e.transform.zoomFactor&&(e.togglePan=!1,e.notify("selection",{prop:"setDragCanvas",value:{bool:!1}})),e.element.querySelector(".e-contextual-toolbar-wrapper")&&e.element.querySelector(".e-contextual-toolbar-wrapper").classList.add("e-hide"),e.togglePen&&(e.togglePen=!1,e.upperCanvas.style.cursor=e.cursor="default",this.upperContext.clearRect(0,0,e.upperCanvas.width,e.upperCanvas.height)),0<this.appliedUndoRedoColl.length&&(this.undoRedoColl=Pe([],this.appliedUndoRedoColl,[],!0))},aUt.prototype.callUndo=function(){this.applyCurrentChanges(),this.undo()},aUt.prototype.callRedo=function(){this.applyCurrentChanges(),this.redo()},aUt.prototype.undo=function(){var e=this.parent;if(this.cancelCropSelection(),e.notify("draw",{prop:"resetFrameZoom",onPropertyChange:!1,value:{isOk:!1}}),!e.disabled&&e.isImageLoaded&&0<this.undoRedoStep){this.refreshToolbarActions(),e.activeObj.activePoint&&0!==e.activeObj.activePoint.width&&(this.tempActObj=e.activeObj),e.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.undoRedoStep--,e.notify("toolbar",{prop:"enable-disable-btns"}),e.element.querySelector(".e-contextual-toolbar-wrapper")&&e.element.querySelector(".e-contextual-toolbar-wrapper").classList.add("e-hide"),e.isUndoRedo=!0;var t,i=this.undoRedoColl[this.undoRedoStep],n=(this.undoRedoColl.length===this.undoRedoStep?e.currObjType.isUndoAction=!1:e.currObjType.isUndoAction=!0,"textAreaCustomization"===i.operation||"block"!==e.textArea.style.display&&"inline-block"!==e.textArea.style.display||(e.textArea.style.display="none"),e.notify("draw",{prop:"setCancelAction",onPropertyChange:!1,value:{bool:!0}}),e.cropObj=Pe({},i.previousCropObj,{},!0),e.afterCropActions=i.previousObj.afterCropActions,this.lowerContext.filter=i.previousObj.filter,e.notify("filter",{prop:"setAdjustmentLevel",onPropertyChange:!1,value:{adjustmentLevel:i.previousObj.adjustmentLevel}}),e.notify("filter",{prop:"setTempAdjVal"}),e.currentFilter=i.previousObj.currentFilter,e.notify("filter",{prop:"setTempFilVal"}),e.canvasFilter=this.lowerContext.filter,e.initialAdjustmentValue=this.lowerContext.filter,e.notify("filter",{prop:"setBevelFilter",onPropertyChange:!1,value:{bevelFilter:this.lowerContext.filter}}),{action:this.getUndoRedoAction(i.operation)});switch(i.operation){case"shapeTransform":case"brightness":case"contrast":case"hue":case"saturation":case"opacity":case"blur":case"exposure":case"default":case"chrome":case"cold":case"warm":case"grayscale":case"blackandwhite":case"sepia":case"invert":case"sharpen":case"imageRotate":case"shapeInsert":this.shapeTransform(i.previousObjColl,i.previousPointColl);break;case"freehanddraw":case"freehand-draw":this.updateFreehandDraw(i.previousPointColl,i.previousSelPointColl),e.notify("freehand-draw",{prop:"setCurrentFreehandDrawIndex",value:{value:e.pointColl.length}});break;case"freehanddrawCustomized":this.updateFreehandDrawCustomized(i.previousObjColl,i.previousPointColl);break;case"deleteFreehandDrawing":case"deleteObj":this.updateDelete(i.operation,i.previousObjColl,i.previousPointColl,i.previousSelPointColl);break;case"textAreaCustomization":this.shapeTransform(i.previousObjColl,i.previousPointColl),this.updateTextAreaCustomization(void 0,i.previousObjColl);break;case"text":this.updateText(i.previousObjColl,!0);break;case"frame":e.transform.zoomFactor=e.transform.defaultZoomFactor=i.previousObj.defaultZoom,e.setProperties({zoomSettings:{zoomFactor:i.previousObj.zoomFactor}},!0),e.notify("transform",{prop:"setPreviousZoomValue",onPropertyChange:!1,value:{previousZoomValue:e.zoomSettings.zoomFactor}}),Pe(e.frameObj,i.previousObj.frameObj),e.notify("draw",{prop:"render-image",value:{isMouseWheel:!0,isPreventClearRect:null,isFrame:!0}});break;case"imageHFlip":this.imageFlip("horizontal",i.previousObjColl);break;case"imageVFlip":this.imageFlip("vertical",i.previousObjColl);break;case"bgColor":e.notify("draw",{prop:"imageBackgroundColor",onPropertyChange:!1,value:{color:i.previousObj.bgColor}}),e.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}});break;case"updateImage":e.isImageUpdated=!0,e.baseImg.src=i.previousObj.imageSource,setTimeout(function(){0!==e.cropObj.straighten?(e.notify("toolbar",{prop:"performCropTransformClick",value:{shape:"crop-custom"}}),e.noPushUndo=!0,e.crop(),e.noPushUndo=!1):e.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}}),e.isImageUpdated=!1});break;default:this.undoDefault(i,!0),e.notify("filter",{prop:"set-adjustment",value:{operation:i.operation}}),e.notify("filter",{prop:"update-filter",value:{operation:i.operation,filter:i.filter}})}"crop"===i.operation?(i.previousObj.currSelectionPoint&&(e.currSelectionPoint=Pe({},i.previousObj.currSelectionPoint,{},!0),e.currSelectionPoint)&&je(e.currSelectionPoint.shape)&&(e.currSelectionPoint=null),e.updateCropTransformItems(),e.notify("draw",{prop:"select",onPropertyChange:!1,value:{type:"custom",startX:null,startY:null,width:null,height:null}}),e.isCircleCrop&&(e.isCircleCrop=!1,this.tempCurrSelPoint=Pe({},e.currSelectionPoint,{},!0),e.currSelectionPoint=null),t=e.cancelCropSelection.isCircleCrop,e.cancelCropSelection.isCircleCrop=!1,e.notify("draw",{prop:"performCancel",value:{isContextualToolbar:null,isUndoRedo:!0}}),e.cancelCropSelection.isCircleCrop=t,e.currObjType.isActiveObj=!1,0!==e.transform.straighten&&e.notify("draw",{prop:"setStraightenActObj",value:{activeObj:null}})):"resize"===i.operation&&e.cropObj&&e.cropObj.activeObj&&(e.currSelectionPoint=Pe({},e.cropObj.activeObj,{},!0)),this.undoRedoColl[this.undoRedoStep-1]&&this.undoRedoColl[this.undoRedoStep-1].isCircleCrop&&(e.isCircleCrop=!0,e.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}})),this.endUndoRedo(i.operation,!0),e.triggerEditCompleteEvent({action:"undo",actionEventArgs:n})}},aUt.prototype.redo=function(){var e=this.parent;if(this.cancelCropSelection(),e.notify("draw",{prop:"resetFrameZoom",onPropertyChange:!1,value:{isOk:!1}}),!e.disabled&&e.isImageLoaded&&this.undoRedoStep<this.appliedUndoRedoColl.length){this.refreshToolbarActions(),this.undoRedoStep++,e.notify("toolbar",{prop:"enable-disable-btns"}),e.isUndoRedo=!0;var t,i=this.undoRedoColl[this.undoRedoStep-1],n=(this.undoRedoColl.length===this.undoRedoStep?e.currObjType.isUndoAction=!1:e.currObjType.isUndoAction=!0,"textAreaCustomization"===i.operation||"block"!==e.textArea.style.display&&"inline-block"!==e.textArea.style.display||(e.textArea.style.display="none"),e.notify("draw",{prop:"setCancelAction",onPropertyChange:!1,value:{bool:!0}}),e.cropObj=Pe({},i.currentCropObj,{},!0),e.afterCropActions=i.currentObj.afterCropActions,this.lowerContext.filter=i.currentObj.filter,e.element.querySelector(".e-contextual-toolbar-wrapper")&&e.element.querySelector(".e-contextual-toolbar-wrapper").classList.add("e-hide"),e.notify("filter",{prop:"setAdjustmentLevel",onPropertyChange:!1,value:{adjustmentLevel:i.currentObj.adjustmentLevel}}),e.notify("filter",{prop:"setTempAdjVal"}),e.currentFilter=i.currentObj.currentFilter,e.notify("filter",{prop:"setTempFilVal"}),e.canvasFilter=this.lowerContext.filter,e.initialAdjustmentValue=this.lowerContext.filter,e.notify("filter",{prop:"setBevelFilter",onPropertyChange:!1,value:{bevelFilter:this.lowerContext.filter}}),{action:this.getUndoRedoAction(i.operation)});switch(i.operation){case"shapeTransform":case"brightness":case"contrast":case"hue":case"saturation":case"opacity":case"blur":case"exposure":case"default":case"chrome":case"cold":case"warm":case"grayscale":case"blackandwhite":case"sepia":case"invert":case"sharpen":case"imageRotate":case"shapeInsert":this.shapeTransform(i.currentObjColl,i.currentPointColl);break;case"freehanddraw":case"freehand-draw":this.updateFreehandDraw(i.currentPointColl,i.currentSelPointColl),e.notify("freehand-draw",{prop:"setCurrentFreehandDrawIndex",value:{value:e.pointColl.length}});break;case"freehanddrawCustomized":this.updateFreehandDrawCustomized(i.currentObjColl,i.currentPointColl);break;case"deleteFreehandDrawing":case"deleteObj":this.updateDelete(i.operation,i.currentObjColl,i.currentPointColl,i.currentSelPointColl);break;case"textAreaCustomization":this.shapeTransform(i.currentObjColl,i.currentPointColl),this.updateTextAreaCustomization(void 0,i.currentObjColl);break;case"text":this.updateText(i.currentObjColl,!1);break;case"frame":Pe(e.frameObj,i.currentObj.frameObj),e.notify("draw",{prop:"render-image",value:{isMouseWheel:!0,isPreventClearRect:null,isFrame:!0}});break;case"imageHFlip":this.imageFlip("horizontal",i.currentObjColl);break;case"imageVFlip":this.imageFlip("vertical",i.currentObjColl);break;case"bgColor":e.notify("draw",{prop:"imageBackgroundColor",onPropertyChange:!1,value:{color:i.currentObj.bgColor}}),e.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}});break;case"updateImage":e.isImageUpdated=!0,e.baseImg.src=i.currentObj.imageSource,setTimeout(function(){0!==e.cropObj.straighten?(e.notify("toolbar",{prop:"performCropTransformClick",value:{shape:"crop-custom"}}),e.noPushUndo=!0,e.crop(),e.noPushUndo=!1):e.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}}),e.isImageUpdated=!1});break;default:e.objColl=[],e.pointColl=[],e.freehandCounter=0,e.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:[]}}}),e.notify("draw",{prop:"setCurrentObj",onPropertyChange:!1,value:{obj:i.currentObj,isUndoRedo:!0}}),e.img.destLeft=i.currentObj.destPoints.startX,e.img.destTop=i.currentObj.destPoints.startY,t=Pe({},e.activeObj,{},!0),e.objColl=Pe([],i.currentObjColl,[],!0),e.pointColl=Pe([],i.currentPointColl,[],!0),e.freehandCounter=e.pointColl.length,e.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:Pe([],i.currentSelPointColl,[],!0)}}}),e.transform.straighten=0,this.lowerContext.filter="none",e.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),this.lowerContext.filter=i.currentObj.filter,e.prevStraightenedDegree=e.transform.straighten,e.activeObj=t,this.upperContext.clearRect(0,0,e.upperCanvas.width,e.upperCanvas.height),0!==e.activeObj.activePoint.width&&0!==e.activeObj.activePoint.height&&e.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate"}}),e.notify("filter",{prop:"set-adjustment",value:{operation:i.operation}}),e.notify("filter",{prop:"update-filter",value:{operation:i.operation}})}"crop"===i.operation&&i.isCircleCrop&&(e.isCircleCrop=!0,e.currSelectionPoint=Pe({},this.tempCurrSelPoint,{},!0),this.tempCurrSelPoint=null),"crop"!==i.operation||i.isCircleCrop||(e.isCircleCrop=!1),"crop"===i.operation&&i.currentObj.currSelectionPoint&&(e.currSelectionPoint=Pe({},i.currentObj.currSelectionPoint,{},!0),e.notify("draw",{prop:"setStraightenActObj",value:{activeObj:e.currSelectionPoint}})),e.currSelectionPoint&&je(e.currSelectionPoint.shape)&&(e.currSelectionPoint=null),"resize"===i.operation&&e.cropObj&&e.cropObj.activeObj&&(e.currSelectionPoint=Pe({},e.cropObj.activeObj,{},!0)),this.endUndoRedo(i.operation,!1),e.triggerEditCompleteEvent({action:"redo",actionEventArgs:n})}},aUt.prototype.imageFlip=function(e,t){var i=this.parent,t=(this.shapeTransform(t,null),i.activeObj=Pe({},i.objColl[i.objColl.length-1],{},!0),i.activeObj),n=t.shape,o=t.isHorImageFlip,t=t.isVerImageFlip;i.objColl.pop(),n&&"image"===n?("horizontal"===e?(je(o)&&t?(i.activeObj.isHorImageFlip=!0,i.activeObj.isVerImageFlip=null):je(o)||!o?i.activeObj.isHorImageFlip=!0:i.activeObj.isHorImageFlip=null,i.horizontalFlip(this.upperContext,!0)):"vertical"===e&&(je(t)&&o?(i.activeObj.isVerImageFlip=!0,i.activeObj.isHorImageFlip=null):je(t)||!t?i.activeObj.isVerImageFlip=!0:i.activeObj.isVerImageFlip=null,i.verticalFlip(this.upperContext,!0)),i.notify("shape",{prop:"applyActObj",onPropertyChange:!1,value:{isMouseDown:!0}})):i.notify("draw",{prop:"render-image",value:{isMouseWheel:!0}})},aUt.prototype.shapeTransform=function(e,t){var i=this.parent;i.objColl=Pe([],e,[],!0),t&&(i.pointColl=Pe([],t,[],!0),i.freehandCounter=i.pointColl.length),i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),this.lowerContext.clearRect(0,0,i.lowerCanvas.width,i.lowerCanvas.height),this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height),i.isUndoRedo=!0,i.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1}),i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1})},aUt.prototype.updateFreehandDraw=function(e,t){var i=this.parent;i.pointColl=e,i.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:t}}}),i.freehandCounter=i.pointColl.length,i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),this.lowerContext.clearRect(0,0,i.lowerCanvas.width,i.lowerCanvas.height),this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height),i.isUndoRedo=!0,i.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1})},aUt.prototype.updateFreehandDrawCustomized=function(e,t){var i=this.parent;i.objColl=Pe([],e,[],!0),i.pointColl=t,i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),this.lowerContext.clearRect(0,0,i.lowerCanvas.width,i.lowerCanvas.height),this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height),i.isUndoRedo=!0,i.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1})},aUt.prototype.updateDelete=function(e,t,i,n){var o=this.parent;"deleteFreehandDrawing"===e?(o.pointColl=i,o.freehandCounter=o.pointColl.length,o.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:n}}}),o.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}})):"deleteObj"===e&&(o.objColl=t,o.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}})),this.lowerContext.clearRect(0,0,o.lowerCanvas.width,o.lowerCanvas.height),this.upperContext.clearRect(0,0,o.upperCanvas.width,o.upperCanvas.height),o.isUndoRedo=!0,o.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1})},aUt.prototype.updateTextAreaCustomization=function(e,t){var i=this.parent;i.objColl=Pe([],t,[],!0),i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),this.lowerContext.clearRect(0,0,i.lowerCanvas.width,i.lowerCanvas.height),i.isUndoRedo=!0,i.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1});for(var n=0,o=t.length;n<o;n++){if(!this.tempActObj){e=Pe({},t[t.length-1],{},!0),i.objColl.splice(n,1);break}if(this.tempActObj.currIndex===t[n].currIndex){e=Pe({},t[n],{},!0),i.objColl.splice(n,1);break}}e&&this.updateTextBox(e),"block"!==i.textArea.style.display&&"inline-block"!==i.textArea.style.display||i.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:null}})},aUt.prototype.updateText=function(e,t){var i=this.parent;if(this.tempActObj&&(i.activeObj=Pe({},this.tempActObj,{},!0)),0===e.length&&1===i.objColl.length)this.tempActObj=Pe({},i.objColl[0],{},!0);else for(var n=0,o=i.objColl.length;n<o;n++){if(i.objColl[n]&&je(e[n])){this.tempActObj=Pe({},i.objColl[n],{},!0);break}if(e[n].currIndex!==i.objColl[n].currIndex){this.tempActObj=Pe({},i.objColl[n],{},!0);break}}t&&(i.activeObj=Pe({},this.tempActObj,{},!0)),i.objColl=Pe([],e,[],!0),i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:!0}}),this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height),this.lowerContext.clearRect(0,0,i.lowerCanvas.width,i.lowerCanvas.height),i.isUndoRedo=!0,i.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1}),i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1})},aUt.prototype.updateTextBox=function(e){var t=this.parent,i=(this.upperContext.clearRect(0,0,t.lowerCanvas.width,t.lowerCanvas.height),this.lowerContext.clearRect(0,0,t.lowerCanvas.width,t.lowerCanvas.height),t.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1}),t.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1}),t.textArea);i.style.display="block",i.style.fontFamily=e.textSettings.fontFamily,i.style.fontSize=e.textSettings.fontSize+"px",i.style.color=e.strokeSettings.strokeColor,i.style.fontWeight=e.textSettings.bold?"bold":"normal",i.style.fontStyle=e.textSettings.italic?"italic":"normal",i.style.border="2px solid "+t.themeColl[t.theme].primaryColor,i.value=e.keyHistory,t.activeObj=Pe({},e,{},!0),t.notify("shape",{prop:"updateFontStyles",onPropertyChange:!1,value:{isTextBox:null}}),t.textArea.style.width=t.activeObj.activePoint.width+"px"},aUt.prototype.undoDefault=function(e,t){this.lowerContext.filter=e.previousObj.filter;var i=this.parent,n=(i.objColl=[],i.pointColl=[],i.freehandCounter=0,i.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:[]}}}),!t&&e.isCircleCrop),t=(i.notify("draw",{prop:"setCurrentObj",onPropertyChange:!1,value:{obj:e.previousObj,isUndoRedo:t,isCircleCrop:n}}),i.prevStraightenedDegree=i.transform.straighten,this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height),i.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),i.img.destLeft=e.previousObj.destPoints.startX,i.img.destTop=e.previousObj.destPoints.startY,Pe({},i.activeObj,{},!0));i.objColl=Pe([],e.previousObjColl,[],!0),i.pointColl=Pe([],e.previousPointColl,[],!0),i.freehandCounter=i.pointColl.length,i.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:Pe([],e.previousSelPointColl,[],!0)}}}),i.transform.straighten=0,this.lowerContext.filter="none",i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),this.lowerContext.filter=e.previousObj.filter,i.activeObj=t,this.upperContext.clearRect(0,0,i.upperCanvas.width,i.upperCanvas.height),0!==i.activeObj.activePoint.width&&0!==i.activeObj.activePoint.height&&i.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate"}})},aUt.prototype.endUndoRedo=function(e,t){var i=this.parent;(i.currSelectionPoint&&"crop-circle"===i.currSelectionPoint.shape||i.isCircleCrop)&&JSON.stringify(i.frameObj)!==JSON.stringify({type:"none",color:"#fff",size:20,inset:20,offset:20,radius:0,amount:1,border:"solid",gradientColor:""})&&i.notify("draw",{prop:"render-image",value:{isMouseWheel:!0}}),i.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),i.isCircleCrop&&(t&&"crop"!==e||!t)&&i.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}}),0<i.transform.zoomFactor&&i.notify("selection",{prop:"setDragCanvas",value:{bool:!0}}),i.notify("draw",{prop:"setCancelAction",onPropertyChange:!1,value:{bool:!1}}),i.activeObj.shape&&"crop"===i.activeObj.shape.split("-")[0]?i.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:!0,isCropping:!0,isZooming:null,cType:null}}):i.notify("toolbar",{prop:"refresh-main-toolbar",onPropertyChange:!1}),i.notify("toolbar",{prop:"enable-disable-btns"}),document.getElementById(i.element.id+"_quickAccessToolbarArea")&&(document.getElementById(i.element.id+"_quickAccessToolbarArea").style.display="none"),i.notify("toolbar",{prop:"enable-disable-btns"}),0!==i.transform.degree&&i.notify("transform",{prop:"drawPannedImage",onPropertyChange:!1,value:{xDiff:0,yDiff:0}}),i.notify("filter",{prop:"setAdjustmentValue",onPropertyChange:!1,value:{adjustmentValue:this.lowerContext.filter}}),i.currObjType.isCustomCrop=!1},aUt.prototype.updateUrc=function(e,t,i,n,o,r,s,a,l,h){var d=this.parent;if(!d.isResize&&!this.isPreventing){var p={isInitialLoaded:!1};if(d.currObjType.isUndoAction&&this.refreshUrc(!0),d.notify("draw",{prop:"isInitialLoaded",onPropertyChange:!1,value:{object:p}}),!p.isInitialLoaded&&d.allowUndoRedo){var p={currObj:{}},p=(d.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:p}}),p.currObj),c=(p.objColl=Pe([],d.objColl,[],!0),p.pointColl=Pe([],d.pointColl,[],!0),p.afterCropActions=Pe([],d.afterCropActions,[],!0),{selPointColl:null});if(d.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:c}}),p.selPointColl=Pe([],c.selPointColl,[],!0),"crop"===e)p.currSelectionPoint=Pe({},d.currSelectionPoint,{},!0);else if("frame"===e)t.destPoints={startX:d.frameDestPoints.destLeft,startY:d.frameDestPoints.destTop,width:d.frameDestPoints.destWidth,height:d.frameDestPoints.destHeight},p.destPoints={startX:d.frameDestPoints.destLeft,startY:d.frameDestPoints.destTop,width:d.frameDestPoints.destWidth,height:d.frameDestPoints.destHeight},je(d.tempFrameZoomLevel)||(t.defaultZoom=p.defaultZoom=d.tempFrameZoomLevel);else if(("imageHFlip"===e||"imageVFlip"===e)&&0<this.appliedUndoRedoColl.length){var u=i[i.length-1].currIndex;if(i=this.appliedUndoRedoColl[this.appliedUndoRedoColl.length-1].currentObjColl,u)for(var g=0,m=i.length;g<m;g++)if(i[g].currIndex===u){var f=Pe({},i[g],{},!0);i.splice(g,1),i.push(f);break}}this.undoRedoColl.push({operation:e,previousObj:t,currentObj:p,previousObjColl:i,currentObjColl:p.objColl,previousPointColl:n,currentPointColl:p.pointColl,previousSelPointColl:o,currentSelPointColl:p.selPointColl,previousCropObj:r,currentCropObj:Pe({},d.cropObj,{},!0),previousText:s,currentText:a,filter:l,isCircleCrop:h}),d.notify("toolbar",{prop:"enable-disable-btns",onPropertyChange:!1})}}},aUt.prototype.updateUrObj=function(e,t){var i,n,o,r=this.parent;r.allowUndoRedo&&(r.currObjType.isUndoAction&&!r.isShapeDrawing&&this.refreshUrc(!0),je(r.activeObj.imageRatio)&&r.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),r.objColl.push(r.activeObj),i=Pe({},r.cropObj,{},!0),r.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(n={currObj:{}}),value:{object:n}}),(n=n.currObj).objColl=Pe([],r.objColl,[],!0),n.pointColl=Pe([],r.pointColl,[],!0),n.afterCropActions=Pe([],r.afterCropActions,[],!0),r.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(o={selPointColl:null}),value:{obj:o}}),n.selPointColl=Pe([],o.selPointColl,[],!0),this.undoRedoColl.push({operation:t||"shapeTransform",previousObj:n,currentObj:n,previousObjColl:e,currentObjColl:n.objColl,previousPointColl:n.pointColl,currentPointColl:n.pointColl,previousSelPointColl:n.selPointColl,currentSelPointColl:n.selPointColl,previousCropObj:i,currentCropObj:i}),r.notify("selection",{prop:"redrawShape",onPropertyChange:!1,value:{obj:r.objColl[r.objColl.length-1]}}))},aUt.prototype.updateUndoRedo=function(e){var t=this.parent,i=Pe({},t.cropObj,{},!0),n={currObj:{}},n=(t.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:n}}),n.currObj),o=(n.objColl=Pe([],t.objColl,[],!0),n.pointColl=Pe([],t.pointColl,[],!0),n.afterCropActions=Pe([],t.afterCropActions,[],!0),{selPointColl:null});t.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:o}}),n.selPointColl=Pe([],o.selPointColl,[],!0),je(t.activeObj.imageRatio)&&t.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),t.objColl.push(t.activeObj),this.updateUrc(e||"shapeTransform",n,n.objColl,n.pointColl,n.selPointColl,i),t.objColl.pop(),t.notify("shape",{prop:"applyActObj",onPropertyChange:!1,value:{isMouseDown:null}}),t.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),t.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"shapes",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}),t.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}})},aUt.prototype.getZeroZoomObjPointValue=function(e,t){var i=this.parent,n=(this.updateObjColl(),{currObj:{}}),n=(i.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:n}}),n.currObj),o=(n.objColl=Pe([],i.objColl,[],!0),n.pointColl=Pe([],i.pointColl,[],!0),n.afterCropActions=Pe([],i.afterCropActions,[],!0),{selPointColl:null}),o=(i.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:o}}),n.selPointColl=Pe([],o.selPointColl,[],!0),{cropDimension:null}),r=(i.notify("transform",{prop:"getCropDimension",onPropertyChange:!1,value:{obj:o}}),Pe([],i.objColl,[],!0)),s=Pe([],i.pointColl,[],!0),a={arrowDimension:null},a=(this.parent.notify("draw",{prop:"getArrowDimension",onPropertyChange:!1,value:{obj:a}}),Pe({},a.arrowDimension,{},!0));if(0<i.transform.zoomFactor&&(0<e.length||0<t.length)){if(0<e.length)for(var l=0;l<e.length;l++)e[l].currIndex||(e[l].currIndex="shape_"+(l+1));i.objColl=e,i.pointColl=t;var h,t=i.isUndoRedo,d=i.isCropTab;0!==i.transform.zoomFactor&&(i.isUndoRedo=!0,i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:!0}}),i.notify("freehand-draw",{prop:"updateFHDColl",onPropertyChange:!1}),i.isCropTab=!0,h=Pe({},i.zoomSettings,null,!0),0<i.transform.zoomFactor?i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:-i.transform.zoomFactor,zoomPoint:null,isResize:null}}):i.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:Math.abs(i.transform.zoomFactor),zoomPoint:null,isResize:null}}),i.zoomSettings=h,i.isCropTab=d,i.isUndoRedo=t,r=Pe([],i.objColl,[],!0),s=Pe([],i.pointColl,[],!0),i.objColl=[],i.pointColl=[],i.freehandCounter=0,i.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:[]}}}),i.notify("transform",{prop:"setCropDimension",onPropertyChange:!1,value:{width:o.cropDimension.width,height:o.cropDimension.height}}),(h={width:o.cropDimension.width,height:o.cropDimension.height}).width+=h.width*n.defaultZoom,h.height+=h.height*n.defaultZoom,i.notify("draw",{prop:"setZoomCropWidth",value:{width:h.width,height:h.height}}),i.notify("draw",{prop:"setCurrentObj",onPropertyChange:!1,value:{obj:n}}),i.img.destLeft=n.destPoints.startX,i.img.destTop=n.destPoints.startY,i.panPoint.totalPannedPoint=n.totalPannedPoint,i.panPoint.totalPannedClientPoint=n.totalPannedClientPoint,i.panPoint.totalPannedInternalPoint=n.totalPannedInternalPoint,i.objColl=Pe([],n.objColl,[],!0),i.pointColl=Pe([],n.pointColl,[],!0),i.freehandCounter=i.pointColl.length,i.notify("draw",{prop:"setArrowDimension",onPropertyChange:!1,value:{arrowDimension:a}}),i.notify("freehand-draw",{prop:"setSelPointColl",onPropertyChange:!1,value:{obj:{selPointColl:Pe([],n.selPointColl,[],!0)}}}),this.lowerContext.filter="none",i.transform.straighten=0,this.applyImgTranform(),i.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"iterate",pen:"iterate",isPreventApply:null}}),i.notify("freehand-draw",{prop:"updateFHDCurPts",onPropertyChange:!1}),this.lowerContext.filter=n.filter,0!==i.transform.degree&&i.notify("transform",{prop:"drawPannedImage",onPropertyChange:!1,value:{xDiff:0,yDiff:0}}),i.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),i.isCircleCrop||i.currSelectionPoint&&"crop-circle"===i.currSelectionPoint.shape)&&i.notify("crop",{prop:"cropCircle",onPropertyChange:!1,value:{context:this.lowerContext,isSave:null,isFlip:null}})}return{obj:r,point:s}},aUt.prototype.updateObjColl=function(){for(var e=this.parent,t=0;t<e.objColl.length;t++){var i=e.objColl[t],n=!1;"line"!==i.shape&&"arrow"!==i.shape||(i.activePoint.width<0&&(i.activePoint.width=Math.abs(i.activePoint.width),n=!0),i.activePoint.height<0&&(i.activePoint.height=Math.abs(i.activePoint.height),n=!0),n&&(n=Pe({},e.activeObj,{},!0),e.activeObj=i,e.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),i=e.activeObj,e.activeObj=n))}},aUt.prototype.applyImgTranform=function(){for(var e,t=this.parent,i=Pe({},t.activeObj,{},!0),n=0,o=t.objColl.length;n<o;n++)"image"===t.objColl[n].shape&&(t.activeObj=Pe({},t.objColl[n],{},!0),e=t.objColl[n].imageCanvas.getContext("2d"),t.notify("selection",{prop:"applyTransformToImg",onPropertyChange:!1,value:{ctx:e}}),this.upperContext.clearRect(0,0,t.upperCanvas.width,t.upperCanvas.height),t.notify("selection",{prop:"setImageClarity",onPropertyChange:!1,value:{bool:!0}}));t.activeObj=i},aUt.prototype.updateUndoRedoStack=function(e){var t,i,n,o=this.parent;(o.activeObj.currIndex&&0!==o.activeObj.activePoint.width||0!==o.activeObj.activePoint.height||o.activeObj.pointColl&&0<o.activeObj.pointColl.length||e)&&(t="none"!==o.textArea.style.display,i=o.noPushUndo,o.noPushUndo=!1,o.isUndoRedoStack=!0,e?(e=o.togglePen,o.notify("freehand-draw",{prop:"getFreehandDrawSelectedId",onPropertyChange:!(n={freehandDrawSelectedId:null}),value:{obj:n}}),o.okBtn(),o.noPushUndo=i,n.freehandDrawSelectedId?(o.noRedact=!0,o.selectShape(n.freehandDrawSelectedId)):o.freeHandDraw(!0),o.togglePen=e):o.activeObj.currIndex&&(n=o.activeObj.currIndex,o.okBtn(),o.noPushUndo=i,o.noRedact=!0,o.selectShape(n),o.drawingShape&&o.notify("selection",{prop:"setCurrentDrawingShape",onPropertyChange:!1,value:{value:o.drawingShape.toLowerCase()}}),t)&&o.enableTextEditing(),o.isUndoRedoStack=!1)};var sUt=aUt;function aUt(e){this.undoRedoStep=0,this.undoRedoColl=[],this.appliedUndoRedoColl=[],this.tempUndoRedoColl=[],this.tempUndoRedoStep=0,this.isPreventing=!1,this.parent=e,this.addEventListener()}lUt=function(e,t){return(lUt=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])}))(e,t)};var lUt,hUt,HOt=function(e,t){function i(){this.constructor=e}lUt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},WOt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},qOt=(HOt(dUt,hUt=n),WOt([e(null)],dUt.prototype,"allowedExtensions",void 0),WOt([e(null)],dUt.prototype,"minFileSize",void 0),WOt([e(null)],dUt.prototype,"maxFileSize",void 0),dUt);function dUt(){return null!==hUt&&hUt.apply(this,arguments)||this}HOt(cUt,pUt=n),WOt([e(null)],cUt.prototype,"brightness",void 0),WOt([e(null)],cUt.prototype,"contrast",void 0),WOt([e(null)],cUt.prototype,"hue",void 0),WOt([e(null)],cUt.prototype,"saturation",void 0),WOt([e(null)],cUt.prototype,"exposure",void 0),WOt([e(null)],cUt.prototype,"opacity",void 0),WOt([e(null)],cUt.prototype,"blur",void 0);var pUt,XOt=cUt;function cUt(){return null!==pUt&&pUt.apply(this,arguments)||this}HOt(gUt,uUt=n),WOt([e(null)],gUt.prototype,"zoomTrigger",void 0),WOt([e(1)],gUt.prototype,"minZoomFactor",void 0),WOt([e(10)],gUt.prototype,"maxZoomFactor",void 0),WOt([e(1)],gUt.prototype,"zoomFactor",void 0),WOt([e(null)],gUt.prototype,"zoomPoint",void 0);var uUt,ZOt=gUt;function gUt(){return null!==uUt&&uUt.apply(this,arguments)||this}HOt(fUt,mUt=n),WOt([e(!0)],fUt.prototype,"showCircle",void 0),WOt([e(null)],fUt.prototype,"strokeColor",void 0),WOt([e(null)],fUt.prototype,"fillColor",void 0);var mUt,tNt=fUt;function fUt(){return null!==mUt&&mUt.apply(this,arguments)||this}HOt(vUt,yUt=n),WOt([e("Arial")],vUt.prototype,"default",void 0),WOt([e(null)],vUt.prototype,"items",void 0);var yUt,oNt=vUt;function vUt(){return null!==yUt&&yUt.apply(this,arguments)||this}HOt(FUt,bUt=Ji),(wUt=FUt).prototype.requiredModules=function(){var e=[];return e.push({member:"crop",args:[this]}),e.push({member:"draw",args:[this]}),e.push({member:"selection",args:[this]}),e.push({member:"transform",args:[this]}),e.push({member:"export",args:[this]}),e.push({member:"toolbar-module",args:[this]}),e.push({member:"undo-redo",args:[this]}),e.push({member:"filter",args:[this]}),e.push({member:"shape",args:[this]}),e.push({member:"freehand-draw",args:[this]}),e},FUt.prototype.preRender=function(){this.element.id=this.element.id||D("ej2-image-editor"),this.isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),F.isDevice&&this.element.classList.add("e-device"),this.initializeThemeColl()},FUt.prototype.render=function(){var e,t;this.isAngular&&(t=(e=this.element).cloneNode(!0),e.parentNode.replaceChild(t,e),this.element=t,x("ej2_instances",[this],this.element)),this.initialize()},FUt.prototype.getModuleName=function(){return"image-editor"},FUt.prototype.getPersistData=function(){return this.addOnPersist([])},FUt.prototype.onPropertyChanged=function(e,t){for(var i,n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"cssClass":t.cssClass&&q([this.element],t.cssClass.replace(/\s+/g," ").trim().split(" ")),e.cssClass&&U([this.element],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"disabled":e.disabled?(this.element.classList.add("e-disabled"),this.unwireEvent()):(this.element.classList.remove("e-disabled"),this.wireEvent());break;case"height":this.element.style.height=e.height,this.update();break;case"width":this.element.style.width=e.width,this.update();break;case"theme":e.theme&&(this.theme&&""!==this.theme?this.theme=this.toPascalCase(this.theme):this.theme="Bootstrap5",this.upperContext.strokeStyle=this.themeColl[this.theme].primaryColor,this.upperContext.fillStyle=this.themeColl[this.theme].secondaryColor,this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}));break;case"finetuneSettings":e.finetuneSettings&&(this.finetuneSettings=e.finetuneSettings,this.notify("filter",{prop:"update-finetunes"}));break;case"locale":e.locale&&(this.notify("toolbar",{prop:"setLocale",onPropertyChange:!1,value:{locale:e.locale}}),this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}));break;case"allowUndoRedo":e.allowUndoRedo?this.allowUndoRedo=!0:this.allowUndoRedo=!1,this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}});break;case"showQuickAccessToolbar":e.showQuickAccessToolbar?(this.showQuickAccessToolbar=!0,this.notify("toolbar",{prop:"create-qa-toolbar",onPropertyChange:!1}),this.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!(i={freehandSelectedIndex:null}),value:{obj:i}}),this.activeObj.shape?this.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:null}}):i.freehandSelectedIndex&&this.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:!0}})):(this.showQuickAccessToolbar=!1,this.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1}));break;case"zoomSettings":e.zoomSettings&&(this.zoomSettings.zoomTrigger=e.zoomSettings.zoomTrigger),je(this.zoomSettings.zoomTrigger)?(this.zoomSettings.zoomTrigger=xUt.MouseWheel|xUt.Pinch|xUt.Toolbar|xUt.Commands,this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}})):(e.zoomSettings.zoomTrigger&xUt.Toolbar)===xUt.Toolbar&&this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}});break;case"selectionSettings":e.selectionSettings&&(this.selectionSettings=e.selectionSettings,this.activeObj.shape)&&(this.upperContext.clearRect(0,0,this.upperCanvas.width,this.upperCanvas.height),this.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:this.activeObj}}));break;case"toolbar":e.toolbar&&(this.toolbar=e.toolbar,this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}));break;case"toolbarTemplate":e.toolbarTemplate&&(this.notify("toolbar",{prop:"destroy-bottom-toolbar",onPropertyChange:!1}),this.notify("toolbar",{prop:"destroy-top-toolbar",onPropertyChange:!1}),this.element.appendChild(this.createElement("div",{id:this.element.id+"_toolbarArea",className:"e-toolbar-area"})),this.toolbarTemplateFn());break;case"quickAccessToolbarTemplate":e.quickAccessToolbarTemplate&&(this.notify("toolbar",{prop:"destroy-qa-toolbar",onPropertyChange:!1}),this.quickAccessToolbarTemplateFn());break;case"uploadSettings":e.uploadSettings?(this.uploadSettings=e.uploadSettings,this.uploadSettings.allowedExtensions?this.notify("draw",{prop:"setNullExtension",value:{extension:!1}}):(this.uploadSettings.allowedExtensions=".jpg, .jpeg, .png, .svg, .webp",this.notify("draw",{prop:"setNullExtension",value:{extension:!0}})),this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}})):this.notify("draw",{prop:"setNullExtension",value:{extension:!0}}),this.updateDropInfoContent(this.element.querySelector(".e-ie-drop-info"))}},FUt.prototype.destroy=function(){var e=[],t=(this.element.removeAttribute("tabindex"),this.element.querySelector("#"+this.element.id+"_saveDialog"));t&&"block"===t.style.display&&At(document.getElementById(this.element.id+"_saveDialog"),"dialog").destroy(),this.cssClass&&(e=e.concat(this.cssClass.replace(/\s+/g," ").trim().split(" "))),q([this.element],e),this.element.getAttribute("class")||this.element.removeAttribute("class"),this.unwireEvent(),this.notify("toolbar",{prop:"destroySubComponents",onPropertyChange:!1}),this.notify("destroyed",null),bUt.prototype.destroy.call(this),this.element.innerHTML=""},FUt.prototype.initialize=function(){var e;this.toolbarTemplate?(this.element.appendChild(this.createElement("div",{id:this.element.id+"_toolbarArea",className:"e-toolbar-area"})),this.toolbarTemplateFn()):(this.notify("toolbar",{prop:"create-toolbar",onPropertyChange:!1}),this.notify("toolbar",{prop:"create-contextual-toolbar",onPropertyChange:!1})),this.uploadSettings.allowedExtensions?this.notify("draw",{prop:"setNullExtension",value:{extension:!1}}):this.setProperties({uploadSettings:{allowedExtensions:".jpg, .jpeg, .png, .svg, .webp"}},!0),this.createCanvas(),359<this.element.offsetWidth&&this.element.querySelector(".e-ie-min-drop-content")&&this.element.querySelector(".e-ie-drop-content")&&(this.element.querySelector(".e-ie-min-drop-content").style.display="none",this.element.querySelector(".e-ie-drop-content").style.display="block"),this.createDropUploader(),this.showQuickAccessToolbar&&(document.querySelector("#"+this.element.id+"_canvasWrapper").appendChild(this.createElement("div",{id:this.element.id+"_quickAccessToolbarArea",className:"e-quick-access-toolbar-area"})),(e=document.getElementById(this.element.id+"_quickAccessToolbarArea")).style.position="absolute",e.style.display="none",this.activeObj&&(e.style.left=this.activeObj.activePoint.startX+"px",e.style.top=this.activeObj.activePoint.startY+"px"),e.style.width="100%"),this.quickAccessToolbarTemplate?this.quickAccessToolbarTemplateFn():this.notify("toolbar",{prop:"create-qa-toolbar",onPropertyChange:!1}),this.wireEvent(),this.lowerContext=this.lowerCanvas.getContext("2d"),this.upperContext=this.upperCanvas.getContext("2d"),this.inMemoryContext=this.inMemoryCanvas.getContext("2d"),this.lowerContext.filter=this.getDefaultFilter(),this.notify("filter",{prop:"setAdjustmentValue",onPropertyChange:!1,value:{adjustmentValue:this.lowerContext.filter}}),this.canvasFilter=this.lowerContext.filter,this.notify("toolbar",{prop:"setInitialAdjustmentValue",onPropertyChange:!1,value:{value:this.lowerContext.filter}}),this.cssClass&&U([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.element&&mA({target:this.element}),this.initializeZoomSettings(),this.imgSrc&&this.open(this.imgSrc)},FUt.prototype.createDropUploader=function(){var o=this,r=this;new GN({dropArea:this.element.getElementsByClassName("e-canvas-wrapper")[0],allowedExtensions:this.uploadSettings.allowedExtensions,multiple:!1,selected:function(e){var t,i,n;"change"!==e.event.type&&"drop"!==e.event.type||(i=e.filesData[0].type,t="unsupported",i=-1<o.getExtensionArray().indexOf(i)||"jpeg"===i&&(-1<r.uploadSettings.allowedExtensions.indexOf("jpg")||-1<r.uploadSettings.allowedExtensions.indexOf("jpeg")),n=e.filesData[0].size,n=r.uploadSettings.minFileSize&&n<r.uploadSettings.minFileSize||r.uploadSettings.maxFileSize&&n>r.uploadSettings.maxFileSize,("change"===e.event.type||"drop"===e.event.type&&1===e.event.dataTransfer.files.length)&&i&&!n?o.notify("draw",{prop:"fileSelect",value:{inputElement:o.element.querySelector("#"+o.element.id+"_dropfileUpload"),args:e}}):("drop"===e.event.type&&1<e.event.dataTransfer.files.length&&(t="multi-select-image"),o.showDialogPopup(t,!i)))}}).appendTo("#"+this.element.id+"_dropfileUpload")},FUt.prototype.dlgCloseBtnClick=function(){At(document.getElementById(this.element.id+"_dialog"),"dialog").destroy()},FUt.prototype.showDialogPopup=function(e,t){var i,n,o,r,s,a,l="",h=(this.element.querySelector("#"+this.element.id+"_dialog").style.display="block",{key:"DlgOK"});this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!1,value:{obj:h}}),"multi-select-image"===e?(this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!(i={key:"ImageErrorDialogHeader"}),value:{obj:i}}),this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!(n={key:"ImageErrorDialogContent"}),value:{obj:n}}),l="<span>"+n.value+"</span>"):(this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!(i={key:"AlertDialogHeader"}),value:{obj:i}}),this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!(n={key:"AlertDialogContent"}),value:{obj:n}}),this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!(e={key:"SupportText"}),value:{obj:e}}),o=this.getExtensionString(),this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!(r={key:"MinMaxSizeAlert"}),value:{obj:r}}),a=void this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!(s={key:"And"}),value:{obj:s}}),this.uploadSettings.minFileSize&&this.uploadSettings.maxFileSize?a=" "+r.value+" <b> "+this.formatSizeUnits(this.uploadSettings.minFileSize)+" </b> "+s.value+" <b> "+this.formatSizeUnits(this.uploadSettings.maxFileSize)+" </b> ":this.uploadSettings.minFileSize?(r.key="MinSizeAlert",this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!1,value:{obj:r}}),a=" "+r.value+" <b> "+this.formatSizeUnits(this.uploadSettings.minFileSize)+" </b> "):this.uploadSettings.maxFileSize&&(r.key="MaxSizeAlert",this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!1,value:{obj:r}}),a=" "+r.value+" <b> "+this.formatSizeUnits(this.uploadSettings.maxFileSize)+" </b> "),t?l="<span>"+n.value+" "+e.value+"<b>"+o+"</b></span>":a&&(l="<span>"+n.value+" "+e.value+a+"</span>")),new pS({header:i.value,closeOnEscape:!0,content:l,target:document.getElementById("target"),width:F.isDevice?"285px":"400px",isModal:!0,animationSettings:{effect:"Zoom"},close:this.dlgCloseBtnClick.bind(this),buttons:[{click:this.dlgCloseBtnClick.bind(this),buttonModel:{content:h.value}}]}).appendTo("#"+this.element.id+"_dialog")},FUt.prototype.formatSizeUnits=function(e){return 1073741824<=e?(e/1073741824).toFixed(2)+" GB":1048576<=e?(e/1048576).toFixed(2)+" MB":1024<=e?(e/1024).toFixed(2)+" KB":1<e?e+" bytes":1===e?e+" byte":"0 bytes"},FUt.prototype.getExtensionArray=function(){for(var e=["jpeg","jpg","png","svg","webp"],t=[],i=0,n=this.uploadSettings.allowedExtensions.split(",");i<n.length;i++)for(var o=n[i].trim(),r=0,s=e;r<s.length;r++){var a=s[r];if(-1!==o.indexOf(a)){t.push(a);break}}return t},FUt.prototype.getExtensionString=function(){for(var e={key:"And"},t=(this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!1,value:{obj:e}}),this.getExtensionArray()),i="",n=0;n<t.length;n++){switch(n===t.length-1&&1<t.length&&("jpeg"!==t[n]&&"jpg"!==t[n]||!(-1<i.indexOf("JPG")))&&((2===t.length||3===t.length&&-1!==t.indexOf("jpeg")&&-1!==t.indexOf("jpg"))&&(i=i.replace(/,\s*$/,"")),i+=" "+e.value),t[n]){case"jpeg":case"jpg":-1===i.indexOf("JPG")&&(i+=" JPG,");break;case"png":i+=" PNG,";break;case"svg":i+=" SVG,";break;case"webp":i+=" WebP,"}n===t.length-1&&(i=i.slice(0,-1))}return i},FUt.prototype.wireEvent=function(){E.add(document,"keydown",this.keyDownEventHandler,this),E.add(document,"keypress",this.keyUpEventHandler,this),E.add(this.upperCanvas,"mousedown",this.mouseDownEventHandler,this),E.add(this.upperCanvas,"mousemove",this.mouseMoveEventHandler,this),E.add(this.upperCanvas,"mouseup",this.mouseUpEventHandler,this),E.add(document,"mouseup",this.mouseUpEventHandler,this),E.add(this.lowerCanvas,"mousedown",this.canvasMouseDownHandler,this),E.add(this.lowerCanvas,"mousemove",this.canvasMouseMoveHandler,this),E.add(this.lowerCanvas,"mouseup",this.canvasMouseUpHandler,this),E.add(this.upperCanvas,"touchstart",this.touchStartHandler,this),E.add(this.lowerCanvas,"touchstart",this.touchStartHandler,this),E.add(this.lowerCanvas,"mousewheel DOMMouseScroll",this.handleScroll,this),E.add(this.upperCanvas,"mousewheel DOMMouseScroll",this.handleScroll,this),window.addEventListener("resize",this.windowResizeHandler.bind(this)),F.isIos||"safari"===F.info.name||screen.orientation.addEventListener("change",this.screenOrientation.bind(this)),this.notify("shape",{prop:"wireEvent",onPropertyChange:!1})},FUt.prototype.unwireEvent=function(){E.remove(document,"keydown",this.keyDownEventHandler),E.remove(document,"keypress",this.keyUpEventHandler),E.remove(this.upperCanvas,"mousedown",this.mouseDownEventHandler),E.remove(this.upperCanvas,"mousemove",this.mouseMoveEventHandler),E.remove(this.upperCanvas,"mouseup",this.mouseUpEventHandler),E.remove(document,"mouseup",this.mouseUpEventHandler),E.remove(this.lowerCanvas,"mousedown",this.canvasMouseDownHandler),E.remove(this.lowerCanvas,"mousemove",this.canvasMouseMoveHandler),E.remove(this.lowerCanvas,"mouseup",this.canvasMouseUpHandler),E.remove(this.upperCanvas,"touchstart",this.touchStartHandler),E.remove(this.lowerCanvas,"touchstart",this.touchStartHandler),E.remove(this.lowerCanvas,"mousewheel DOMMouseScroll",this.handleScroll),E.remove(this.upperCanvas,"mousewheel DOMMouseScroll",this.handleScroll),window.removeEventListener("resize",this.windowResizeHandler.bind(this)),F.isIos||"safari"===F.info.name||screen.orientation.removeEventListener("change",this.screenOrientation.bind(this)),this.notify("shape",{prop:"unWireEvent",onPropertyChange:!1}),this.notify("selection",{prop:"unWireEvent",onPropertyChange:!1})},FUt.prototype.createCanvas=function(){this.element.style.boxSizing="border-box";var e={toolbarHeight:0},e=(this.notify("toolbar",{prop:"getToolbarHeight",value:{obj:e}}),e.toolbarHeight),t=(this.toolbar&&0<this.toolbar.length&&-1===this.toolbar.indexOf("Open")&&(e=0),this.element.style.width=this.width,this.element.style.height=this.height,this.createElement("div",{id:this.element.id+"_canvasWrapper",className:"e-canvas-wrapper"})),e=(t.style.cssText="height: "+(this.element.offsetHeight-e-2)+"px; width: "+(this.element.offsetWidth-2)+"px; position: relative; overflow: hidden; margin: 0 auto;",this.element.appendChild(t)),t={key:"DragText"},i=(this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!1,value:{obj:t}}),{key:"DropText"}),n=(this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!1,value:{obj:i}}),{key:"BrowseText"}),o=(this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!1,value:{obj:n}}),this.createElement("div",{id:this.element.id+"_dropArea",className:"e-ie-drop-area"})),r=(o.style.position="relative",this.createElement("span",{className:"e-ie-drop-icon e-icons e-image"})),s=(r.style.position="absolute",this.createElement("span",{className:"e-ie-drop-content"})),t=(s.style.cssText="position: absolute; display: none;",s.textContent=t.value+" ",this.createElement("span",{className:"e-ie-min-drop-content"})),i=(t.style.position="absolute",t.textContent=i.value+" ",this.createElement("a",{id:this.element.id+"_dropBrowse",className:"e-ie-drop-browse"})),a=(i.textContent=n.value,this.createElement("a",{id:this.element.id+"_dropBrowse",className:"e-ie-drop-browse"})),n=(a.textContent=n.value,s.appendChild(i),t.appendChild(a),i.href="",a.href="",this.createElement("span",{className:"e-ie-drop-info",attrs:{position:"absolute"}})),l=(this.updateDropInfoContent(n),o.appendChild(this.createElement("input",{id:this.element.id+"_dropfileUpload",className:"e-fileUpload e-image-upload"})));l.setAttribute("type","file"),l.setAttribute("accept","image/*"),o.appendChild(r),o.appendChild(s),o.appendChild(t),o.appendChild(n),e.appendChild(o),this.lowerCanvas=e.appendChild(this.createElement("canvas",{id:this.element.id+"_lowerCanvas",attrs:{name:"canvasImage"}})),this.maskCanvas=e.appendChild(this.createElement("canvas",{id:this.element.id+"_maskCanvas",attrs:{name:"canvasImage"}})),this.upperCanvas=e.appendChild(this.createElement("canvas",{id:this.element.id+"_upperCanvas",attrs:{name:"canvasImage"}})),this.inMemoryCanvas=this.createElement("canvas",{id:this.element.id+"_inMemoryCanvas",attrs:{name:"canvasImage"}}),this.baseImgCanvas=this.createElement("canvas",{id:this.element.id+"_baseImgCanvas",attrs:{name:"canvasImage"}}),this.textArea=e.appendChild(this.createElement("textarea",{id:this.element.id+"_textArea",className:"e-textarea",attrs:{name:"textArea"}}));this.element.appendChild(this.createElement("div",{id:this.element.id+"_dialog",className:"e-dialog"})).style.display="none";r=this.element.appendChild(this.createElement("input",{id:this.element.id+"_fileUpload",className:"e-fileUpload"}));r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.style.display="none",this.textArea.setAttribute("spellcheck","false"),this.textArea.style.lineHeight="normal",this.lowerCanvas.style.width=this.upperCanvas.style.width=this.maskCanvas.style.width=this.inMemoryCanvas.style.width="100%",this.lowerCanvas.style.height=this.upperCanvas.style.height=this.maskCanvas.style.height=this.inMemoryCanvas.style.height="100%",this.upperCanvas.style.position=this.lowerCanvas.style.position=this.maskCanvas.style.position=this.textArea.style.position="absolute",this.textArea.style.backgroundColor="transparent",this.textArea.style.display="none",this.maskCanvas.style.display=this.textArea.style.resize="none",this.lowerContext=this.lowerCanvas.getContext("2d"),this.baseImg=this.createElement("img",{id:this.element.id+"_orgImg",attrs:{name:"Image",crossorigin:"anonymous"}}),this.upperCanvas.style.cursor=this.cursor="default",this.upperCanvas.style.display="block",this.upperContext=this.upperCanvas.getContext("2d"),i.addEventListener("click",function(e){return e.preventDefault(),l.click(),!1}),a.addEventListener("click",function(e){return e.preventDefault(),l.click(),!1})},FUt.prototype.touchStartHandler=function(e){this.notify("selection",{prop:"touchStartHandler",onPropertyChange:!1,value:{e:e}})},FUt.prototype.mouseDownEventHandler=function(e){"e-ie-drop-browse"!==e.target.className&&this.notify("selection",{prop:"mouseDownEventHandler",onPropertyChange:!1,value:{e:e}})},FUt.prototype.mouseMoveEventHandler=function(e){this.notify("selection",{prop:"mouseMoveEventHandler",onPropertyChange:!1,value:{e:e}})},FUt.prototype.mouseUpEventHandler=function(e){"e-ie-drop-browse"!==e.target.className&&this.notify("selection",{prop:"mouseUpEventHandler",onPropertyChange:!1,value:{e:e}})},FUt.prototype.keyDownEventHandler=function(e){this.notify("selection",{prop:"keyDownEventHandler",onPropertyChange:!1,value:{e:e}})},FUt.prototype.keyUpEventHandler=function(e){"block"!==this.textArea.style.display&&"inline-block"!==this.textArea.style.display||e.target.id!==this.element.id+"_textArea"||this.notify("selection",{prop:"textKeyDown",value:{e:e}})},FUt.prototype.canvasMouseDownHandler=function(e){"e-ie-drop-browse"!==e.target.className&&this.notify("selection",{prop:"canvasMouseDownHandler",onPropertyChange:!1,value:{e:e}})},FUt.prototype.canvasMouseMoveHandler=function(e){this.notify("selection",{prop:"canvasMouseMoveHandler",onPropertyChange:!1,value:{e:e}})},FUt.prototype.canvasMouseUpHandler=function(e){"e-ie-drop-browse"!==e.target.className&&this.notify("selection",{prop:"canvasMouseUpHandler",onPropertyChange:!1,value:{e:e}})},FUt.prototype.handleScroll=function(e){this.notify("selection",{prop:"handleScroll",onPropertyChange:!1,value:{e:e}})},FUt.prototype.adjustToScreen=function(){this.update()},FUt.prototype.screenOrientation=function(){F.isDevice&&setTimeout(this.adjustToScreen.bind(this),100)},FUt.prototype.windowResizeHandler=function(){!F.isDevice&&this.element.classList.contains("e-image-editor")&&this.adjustToScreen()},FUt.prototype.notifyResetForAllModules=function(){for(var e=this.requiredModules(),t=0;t<e.length;t++){var i=e[t].member;this.notify("toolbar-module"===i?"toolbar":i,{prop:"reset",onPropertyChange:!1})}},FUt.prototype.allowShape=function(e,t){this.isPublicMethod=!0,this.applyShapes();var i={inRange:!1};return this.notify("shape",{prop:"isPointsInRange",onPropertyChange:!1,value:{x:e,y:t,obj:i}}),i.inRange},FUt.prototype.manageActiveAction=function(){this.applyShapes(),this.activeObj.shape&&-1<this.activeObj.shape.indexOf("crop")&&this.discard()},FUt.prototype.clearSelection=function(e){this.notify("selection",{prop:"clearSelection",onPropertyChange:!1,value:{resetCrop:e}})},FUt.prototype.crop=function(){var e={isCrop:!1};return this.notify("crop",{prop:"crop",onPropertyChange:!1,value:{obj:e}}),e.isCrop},FUt.prototype.flip=function(e){this.applyShapes(),this.updateImageTransformColl(e.toLowerCase()+"flip"),this.notify("transform",{prop:"flip",value:{direction:e}}),this.notify("draw",{prop:"redrawDownScale"}),this.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}});e={action:"flip",actionEventArgs:this.editCompleteArgs};this.triggerEditCompleteEvent(e)},FUt.prototype.getImageData=function(e){var t;return(e=!!je(e)||e)?(e={canvas:null},this.applyShapes(),this.notify("export",{prop:"exportToCanvas",value:{object:e}}),t=e.canvas.getContext("2d").getImageData(0,0,e.canvas.width,e.canvas.height)):this.isMaskImage&&"mask-drawing"===this.element.getAttribute("data-value")?(t=this.getData(!0),this.updateColl("reset")):(t=this.getData(),this.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}})),t},FUt.prototype.open=function(e,t,i){(t=!!je(t)||t)?je(e)||((t=document.getElementById(this.element.id+"_dropArea"))&&(t.style.display="none"),this.notify("draw",{prop:"open",value:{data:e}})):this.updateImage(e,i?i.backgroundColor:null)},FUt.prototype.reset=function(){this.updateColl("reset");var e,t={isErrorImage:!1};this.notify("draw",{prop:"getErrorImage",value:{obj:t}}),this.disabled||t.isErrorImage||(this.clearContext(this.inMemoryContext),this.clearContext(this.lowerContext),this.clearContext(this.upperContext),this.notify("shape",{prop:"setRedactType",onPropertyChange:!1,value:{redactType:"blur"}}),this.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:!1,isCropping:!1,isZooming:null,cType:null}}),F.isDevice&&document.getElementById(this.element.id+"_bottomToolbar")&&(At(document.getElementById(this.element.id+"_bottomToolbar"),"toolbar").destroy(),this.notify("toolbar",{prop:"create-bottom-toolbar",onPropertyChange:!1})),t=this.isImageLoaded,this.currObjType.isUndoAction=this.isUndoRedo=this.togglePan=this.togglePen=this.isImageLoaded=this.isFinetuning=!1,this.isCircleCrop=this.isCropTab=!1,this.objColl=[],this.transform.degree=0,this.upperCanvas.style.display="block",this.transform.currFlipState="",this.allowDownScale=!0,this.upperCanvas.style.cursor=this.cursor=this.lowerCanvas.style.cursor="default",this.lowerContext.lineWidth=this.upperContext.lineWidth=void 0,this.frameDestPoints=null,this.textArea.value=this.textArea.textContent="",this.textArea.style.display="none",this.lowerContext.filter=this.canvasFilter=this.getDefaultFilter(),this.img.destLeft=this.img.destTop=this.img.srcLeft=this.img.srcTop=0,this.img.destWidth=this.img.destHeight=this.img.srcWidth=this.img.srcHeight=null,this.currSelectionPoint=null,this.panPoint.currentPannedPoint={x:0,y:0},this.rotateFlipColl=[],this.points=[],this.pointColl={},this.freehandCounter=0,this.notify("draw",{prop:"resetPanPoints"}),this.lowerCanvas.style.left=this.upperCanvas.style.left="",this.fontSizeColl=[],this.lowerCanvas.style.top=this.upperCanvas.style.top="",this.lowerCanvas.style.maxWidth=this.upperCanvas.style.maxWidth="",this.lowerCanvas.style.maxHeight=this.upperCanvas.style.maxHeight="",this.transform.defaultZoomFactor=this.transform.zoomFactor=0,this.transform.cropZoomFactor=null,this.frameObj={type:"none",color:"#fff",size:20,inset:20,offset:20,radius:0,amount:1,border:"solid",gradientColor:""},this.tempFrameObj={type:"none",color:"#fff",size:20,inset:20,offset:20,radius:0,amount:1,border:"solid",gradientColor:""},this.currObjType={shape:"",isDragging:!1,isActiveObj:!1,isText:!1,isInitialText:!1,isLine:!1,isInitialLine:!1,isCustomCrop:!1,isZoomed:!1,isUndoZoom:!1,isUndoAction:!1,isFiltered:!1,isSave:!1,isResize:!1,isRedact:!1},this.cropObj={cropZoom:0,defaultZoom:0,totalPannedPoint:{x:0,y:0},totalPannedClientPoint:{x:0,y:0},totalPannedInternalPoint:{x:0,y:0},tempFlipPanPoint:{x:0,y:0},activeObj:{},rotateFlipColl:[],degree:0,currFlipState:"",straighten:0,zoomFactor:0,previousZoomValue:0,destPoints:{startX:0,startY:0,width:0,height:0},frame:"none",srcPoints:{startX:0,startY:0,width:0,height:0},filter:"",isBrightAdjust:!1,aspectWidth:null,aspectHeight:null,straightenZoom:0,adjustmentLevel:{brightness:0,contrast:0,hue:0,opacity:100,saturation:0,blur:0,exposure:0,transparency:100,sharpen:!1,bw:!1},currentFilter:""},this.afterCropActions=[],this.currentFilter="",this.tempFrameZoomLevel=null,this.cxtTbarHeight=null,this.straightenPoint=null,this.transform.straighten=0,this.cancelCropSelection=null,this.aspectWidth=this.aspectHeight=null,this.isResize=this.isMaskImage=!1,this.drawingShape=null,this.isShapeDrawing=this.noPushUndo=this.isUndoRedoStack=this.isKBDNavigation=!1,this.shapeColl=[],this.tempObjColl=[],this.tempPointColl=[],this.tempShapeColl=[],this.isImageUpdated=!1,this.tempToolbarHeight=0,this.tempToolbar=[],this.tempRedactBlur=50,e={initialZoomValue:!(this.tempRedactPixel=40)},this.editCompleteArgs=null,this.isFinetuneBtnClick=!1,this.notify("draw",{prop:"getInitialZoomValue",onPropertyChange:!1,value:{obj:e}}),e.initialZoomValue&&this.setProperties({zoomSettings:{zoomFactor:e.initialZoomValue}},!0),(e=document.getElementById(this.element.id+"_quickAccessToolbarArea"))&&(e.style.display="none"),this.notifyResetForAllModules(),this.notify("filter",{prop:"update-finetunes"}),this.toolbarTemplate?this.toolbarHeight=this.element.querySelector("#"+this.element.id+"_toolbarArea").clientHeight:this.element.querySelector("#"+this.element.id+"_toolbar")&&(this.toolbarHeight=this.element.querySelector("#"+this.element.id+"_toolbar").clientHeight),this.notify("toolbar",{prop:"setToolbarHeight",value:{height:this.toolbarHeight}}),this.isImageLoaded=t,this.straightenBaseImageCanvas(),this.isImageLoaded=!1,this.notify("draw",{prop:"update-canvas",onPropertyChange:!1}),this.isImageLoaded=t,this.prevStraightenedDegree=0,(e=this.element.querySelector(".e-contextual-toolbar-wrapper"))&&e.classList.add("e-hide"),this.notify("toolbar",{prop:"refresh-dropdown-btn",value:{isDisabled:!1}}),this.notify("toolbar",{prop:"enable-disable-btns"}),t=this.isStraightening,F.isDevice&&t&&this.notify("crop",{prop:"resizeWrapper"}),(e=this.element.querySelector("#"+this.element.id+"_saveDialog"))&&At(e,"dialog").close(),this.triggerEditCompleteEvent({action:"reset",actionEventArgs:null}))},FUt.prototype.rotate=function(e){var t={isRotate:!1},e=(this.applyShapes(),90!==e&&-90!==e||this.updateImageTransformColl(90===e?"rotateright":"rotateleft"),this.notify("transform",{prop:"rotate",value:{degree:e,obj:t}}),this.notify("draw",{prop:"redrawDownScale"}),{action:"rotate",actionEventArgs:this.editCompleteArgs});return this.triggerEditCompleteEvent(e),t.isRotate},FUt.prototype.export=function(e,t,i){this.applyShapes(),this.notify("export",{prop:"export",onPropertyChange:!1,value:{type:e,fileName:t,imgQuality:i}})},FUt.prototype.select=function(e,t,i,n,o){this.applyShapes(),this.notify("toolbar",{prop:"performCropTransformClick",value:{shape:"crop-"+e}}),this.notify("draw",{prop:"select",onPropertyChange:!1,value:{type:e,startX:t,startY:i,width:n,height:o}}),t&&i||n&&o?this.notify("draw",{prop:"select",onPropertyChange:!1,value:{type:e,startX:t,startY:i,width:n,height:o}}):this.cropObj={cropZoom:0,defaultZoom:0,totalPannedPoint:{x:0,y:0},totalPannedClientPoint:{x:0,y:0},totalPannedInternalPoint:{x:0,y:0},tempFlipPanPoint:{x:0,y:0},activeObj:{},rotateFlipColl:[],degree:0,currFlipState:"",straighten:0,zoomFactor:0,previousZoomValue:0,destPoints:{startX:0,startY:0,width:0,height:0},frame:"none",srcPoints:{startX:0,startY:0,width:0,height:0},filter:"",isBrightAdjust:!1,aspectWidth:null,aspectHeight:null,straightenZoom:0,adjustmentLevel:{brightness:0,contrast:0,hue:0,opacity:100,saturation:0,blur:0,exposure:0,transparency:100,sharpen:!1,bw:!1},currentFilter:""}},FUt.prototype.freeHandDraw=function(e){this.notify("freehand-draw",{prop:"freeHandDraw",onPropertyChange:!1,value:{value:e}})},FUt.prototype.freehandDraw=function(e){!this.disabled&&this.isImageLoaded&&(!e&&this.isMaskImage?this.discard():(this.manageActiveAction(),this.freeHandDraw(e),this.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!(e={shapeSettingsObj:{}}),value:{obj:e}}),(e=e.shapeSettingsObj).type=AUt.FreehandDraw,this.notify("freehand-draw",{prop:"triggerShapeChanging",value:{shapeChangingArgs:{cancel:!1,action:"insert",previousShapeSettings:e,currentShapeSettings:e}}})))},FUt.prototype.pan=function(e,t,i){this.applyShapes(),this.notify("transform",{prop:"pan",onPropertyChange:!1,value:{value:e,x:t,y:i}})},FUt.prototype.zoom=function(e,t){this.isZoomBtnClick=!0,this.notify("transform",{prop:"zoom",onPropertyChange:!1,value:{zoomFactor:e,zoomPoint:t}}),this.notify("draw",{prop:"redrawDownScale"})},FUt.prototype.drawEllipse=function(e,t,i,n,o,r,s,a,l){var h=!1,d=this.allowShape(e,t);return!this.disabled&&this.isImageLoaded&&(d||je(e)&&je(t))&&(h=!0,this.manageActiveAction(),this.notify("shape",{prop:"drawEllipse",onPropertyChange:!1,value:{x:e,y:t,radiusX:i,radiusY:n,strokeWidth:o,strokeColor:r,fillColor:s,degree:a,isSelected:l}}),this.editCompleted()),h},FUt.prototype.drawLine=function(e,t,i,n,o,r,s){var a=!1,l=this.allowShape(e,t);return!this.disabled&&this.isImageLoaded&&(l||je(e)&&je(t))&&(a=!0,this.manageActiveAction(),this.notify("shape",{prop:"drawLine",onPropertyChange:!1,value:{startX:e,startY:t,endX:i,endY:n,strokeWidth:o,strokeColor:r,isSelected:s}}),this.editCompleted()),a},FUt.prototype.drawArrow=function(e,t,i,n,o,r,s,a,l){var h=!1,d=this.allowShape(e,t);return!this.disabled&&this.isImageLoaded&&(d||je(e)&&je(t))&&(h=!0,this.manageActiveAction(),this.notify("shape",{prop:"drawArrow",onPropertyChange:!1,value:{startX:e,startY:t,endX:i,endY:n,strokeWidth:o,strokeColor:r,arrowStart:s,arrowEnd:a,isSelected:l}}),this.editCompleted()),h},FUt.prototype.drawPath=function(e,t,i,n){var o={inRange:!(this.isPublicMethod=!0)},r=!1;if(e&&0<e.length)for(var s=0;s<e.length&&!o.inRange;s++)this.notify("shape",{prop:"isPointsInRange",onPropertyChange:!1,value:{x:e[s].x,y:e[s].y,obj:o}});return!this.disabled&&this.isImageLoaded&&(o.inRange||je(e))&&(r=!0,this.manageActiveAction(),this.notify("shape",{prop:"drawPath",onPropertyChange:!1,value:{pointColl:e,strokeWidth:t,strokeColor:i,isSelected:n}}),this.editCompleted()),r},FUt.prototype.drawRectangle=function(e,t,i,n,o,r,s,a,l,h){var d=!1,p=this.allowShape(e,t);return!this.disabled&&this.isImageLoaded&&(p||je(e)&&je(t))&&(d=!0,this.manageActiveAction(),this.notify("shape",{prop:"drawRectangle",onPropertyChange:!1,value:{x:e,y:t,width:i,height:n,strokeWidth:o,strokeColor:r,fillColor:s,degree:a,isSelected:l,radius:h}}),this.editCompleted()),d},FUt.prototype.drawText=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u){var g=!1,m=this.allowShape(e,t);return!this.disabled&&this.isImageLoaded&&(m||je(e)&&je(t))&&(g=!0,this.manageActiveAction(),this.notify("shape",{prop:"drawText",onPropertyChange:!1,value:{x:e,y:t,text:i,fontFamily:n,fontSize:o,bold:r,italic:s,color:a,isSelected:l,degree:h,fillColor:d,outlineColor:p,outlineWidth:c,transformCollection:u}}),this.editCompleted()),g},FUt.prototype.drawImage=function(e,t,i,n,o,r,s,a,l){var h=!1,d=this.allowShape(t,i);return h=!this.disabled&&this.isImageLoaded&&(d||je(t)&&je(i))&&(this.manageActiveAction(),d=this.objColl.length,this.notify("shape",{prop:"drawImage",onPropertyChange:!1,value:{x:t,y:i,width:n,height:o,src:e,degree:s,isAspectRatio:r,opacity:a,isSelected:l}}),this.editCompleted(),this.objColl.length>d)?!0:h},FUt.prototype.updateShape=function(e,t){var i,n={isSelected:!1},o=!1,r={bool:!1};return je(e.id)?(e.strokeColor&&(this.activeObj.strokeSettings.strokeColor=e.strokeColor),e.fillColor&&(this.activeObj.strokeSettings.fillColor=e.fillColor),e.strokeWidth&&(this.activeObj.strokeSettings.strokeWidth=e.strokeWidth),e.index&&(this.activeObj.order=e.index),"FreehandDraw"===e.type&&e.strokeWidth&&this.notify("freehand-draw",{prop:"setPenStrokeWidth",onPropertyChange:!1,value:{value:e.strokeWidth}})):("text"!==e.type.toLowerCase()||"block"!==this.textArea.style.display&&"inline-block"!==this.textArea.style.display||(this.okBtn(null,!0),o=!0),this.notify("shape",{prop:"selectShape",onPropertyChange:!1,value:{id:e.id,obj:n,isShape:!0}}),this.notify("selection",{prop:"getFreehandDrawEditing",onPropertyChange:!1,value:{obj:r}}),n.isSelected&&(i=this.activeObj.textSettings.fontSize,this.notify("shape",{prop:"updateShapeChangeEventArgs",onPropertyChange:!1,value:{shapeSettings:e}}),"text"===this.activeObj.shape&&i&&0!=(i=this.activeObj.textSettings.fontSize-i)&&(this.activeObj.activePoint.height+=i,this.activeObj.activePoint.startY-=i/2,this.activeObj.activePoint.endY+=i/2,this.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:this.activeObj.activePoint,obj:this.activeObj,isMouseMove:null,x:null,y:null}})),i=Pe({},this.activeObj,{},!0),this.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:null}}),this.upperContext.clearRect(0,0,this.upperCanvas.width,this.upperCanvas.height),i.shape&&this.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:i}}),"text"===this.activeObj.shape&&this.notify("toolbar",{prop:"editText",onPropertyChange:!1}),r.bool&&this.notify("undo-redo",{prop:"setPreventUR",value:{bool:!0}}),this.okBtn(t,!0),r.bool&&this.notify("undo-redo",{prop:"setPreventUR",value:{bool:!1}}),this.upperContext.clearRect(0,0,this.upperCanvas.width,this.upperCanvas.height),this.editCompleteArgs={action:"shape-update",currentShapeSettings:e},this.editCompleted("shape-customize"),o&&this.enableTextEditing(),t)&&(this.noRedact=!0,this.selectShape(e.id))),n.isSelected},FUt.prototype.selectShape=function(e){this.applyShapes();var t={isSelected:!1};return this.notify("shape",{prop:"selectShape",onPropertyChange:!1,value:{id:e,obj:t,isShape:!0}}),this.editCompleted("shape-select"),this.noRedact=!1,t.isSelected},FUt.prototype.deleteShape=function(e){"Redact"!==this.getShapeSetting(e).type&&(this.applyShapes(),this.notify("shape",{prop:"deleteShape",onPropertyChange:!1,value:{id:e,isShape:!0}}),this.editCompleted("shape-delete"))},FUt.prototype.getShapeSetting=function(e){this.applyShapes();var t={shapeDetails:null};return this.notify("shape",{prop:"getShapeSetting",onPropertyChange:!1,value:{id:e,obj:t}}),this.notify("draw",{prop:"redrawDownScale"}),t.shapeDetails||{}},FUt.prototype.getShapeSettings=function(){this.applyShapes();var e={shapeDetailsColl:[]};return this.notify("shape",{prop:"getShapeSettings",onPropertyChange:!1,value:{obj:e}}),this.notify("draw",{prop:"redrawDownScale"}),e.shapeDetailsColl.filter(function(e){return"redact"!==e.type})},FUt.prototype.getRedacts=function(){this.applyShapes();var e={shapeDetailsColl:[]};return this.notify("shape",{prop:"getRedactSettings",onPropertyChange:!1,value:{obj:e}}),this.notify("draw",{prop:"redrawDownScale"}),e.shapeDetailsColl.filter(function(e){return"redact"!==e.type})},FUt.prototype.selectRedact=function(e){this.applyShapes();var t={isSelected:!1};return this.notify("shape",{prop:"selectShape",onPropertyChange:!1,value:{id:e,obj:t,isRedact:!0}}),this.editCompleted("redact-select"),this.noRedact=!1,t.isSelected},FUt.prototype.deleteRedact=function(e){this.applyShapes(),this.notify("shape",{prop:"deleteShape",onPropertyChange:!1,value:{id:e,isRedact:!0}}),this.editCompleted("redact-delete")},FUt.prototype.updateRedact=function(e,t){this.applyShapes();var i,n={isSelected:!1};return this.notify("shape",{prop:"selectShape",onPropertyChange:!1,value:{id:e.id,obj:n,isRedact:!0}}),n.isSelected&&(this.notify("shape",{prop:"updateShapeChangeEventArgs",onPropertyChange:!1,value:{shapeSettings:e}}),e.blurIntensity&&(this.activeObj.redactBlur=e.blurIntensity),e.pixelSize&&(this.activeObj.redactPixelate=e.pixelSize),this.activeObj.redactType="blur"===e.type.toLowerCase()?"blur":"pixelate",i=Pe({},this.activeObj,{},!0),this.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:null}}),this.upperContext.clearRect(0,0,this.upperCanvas.width,this.upperCanvas.height),i.shape&&this.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:i}}),this.okBtn(t,!0),this.upperContext.clearRect(0,0,this.upperCanvas.width,this.upperCanvas.height),this.editCompleteArgs={action:"redact-update",currentShapeSettings:e},this.editCompleted("redact-customize"),t)&&this.selectRedact(e.id),n.isSelected},FUt.prototype.update=function(){this.notify("transform",{prop:"update"})},FUt.prototype.finetuneImage=function(e,t){!this.disabled&&this.isImageLoaded&&(this.manageActiveAction(),this.notify("filter",{prop:"finetuneImage",value:{value:t,option:e}}),this.editCompleteArgs={finetune:e,value:t},this.editCompleted("fine-tune"))},FUt.prototype.applyImageFilter=function(e){!this.disabled&&this.isImageLoaded&&(this.manageActiveAction(),this.notify("filter",{prop:"applyImageFilter",value:{option:e.toString()}}),this.editCompleteArgs={filter:e},this.editCompleted("filter"),this.canvasFilter=this.lowerContext.filter,this.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}))},FUt.prototype.undo=function(){this.manageActiveAction(),this.notify("undo-redo",{prop:"undo",onPropertyChange:!1}),this.notify("draw",{prop:"redrawDownScale"})},FUt.prototype.redo=function(){this.manageActiveAction(),this.notify("undo-redo",{prop:"redo",onPropertyChange:!1}),this.notify("draw",{prop:"redrawDownScale"})},FUt.prototype.getImageDimension=function(){return{x:this.img.destLeft,y:this.img.destTop,width:this.img.destWidth,height:this.img.destHeight}},FUt.prototype.resize=function(e,t,i){var n,o,r,s,a,l,h=!1;return e.toString().length<=4&&t.toString().length<=4&&(!this.isCircleCrop||i)&&(this.manageActiveAction(),this.notify("toolbar",{prop:"resizeClick",value:{bool:!1}}),n=this.img.destLeft,o=this.img.destTop,r=this.img.destWidth,s=this.img.destHeight,i&&this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"resize",isApplyBtn:!1,isCropping:!1}}),this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"resize",isApplyBtn:!1,isCropping:!1}}),a=this.element.querySelector("#"+this.element.id+"_resizeWidth"),l=this.element.querySelector("#"+this.element.id+"_resizeHeight"),a&&l&&(At(a,"numerictextbox").value=Math.floor(e),a.value=Math.floor(e).toString()+" px",At(l,"numerictextbox").value=Math.floor(t),l.value=Math.floor(t).toString()+" px"),this.notify("transform",{prop:"resize",value:{width:e,height:t,isAspectRatio:i}}),n!==this.img.destLeft||o!==this.img.destTop||r!==this.img.destWidth||s!==this.img.destHeight?(h=!0,this.aspectWidth=e,this.aspectHeight=t,i&&(this.aspectHeight=null),this.okBtn(!1,!1,!0)):this.notify("draw",{prop:"performCancel",value:{isContextualToolbar:null}}),this.notify("draw",{prop:"redrawDownScale"})),h},FUt.prototype.drawFrame=function(e,t,i,n,o,r,s,a,l){this.manageActiveAction();var h=!1,d={frameChangeEventArgs:null},p=(t=t||"#fff",i=i||"",n=n||20,o=o||0,r=r||0,s=s||0,a=a||PUt.Solid,l=l||0,{type:this.toPascalCase(this.frameObj.type),color:this.frameObj.color,gradientColor:this.frameObj.gradientColor,size:this.frameObj.size,inset:this.frameObj.inset,offset:this.frameObj.offset,borderRadius:this.frameObj.radius,frameLineStyle:this.toPascalCase(this.frameObj.border),lineCount:this.frameObj.amount}),e=(Pe(this.tempFrameObj,this.frameObj),this.tempFrameZoomLevel=this.transform.zoomFactor,this.frameDestPoints=Pe({},this.img,{},!0),this.notify("toolbar",{prop:"frameToolbarClick"}),this.frameObj.type=e.toLowerCase(),this.frameObj.color=t,this.frameObj.gradientColor=i,this.frameObj.size=n,this.frameObj.inset=o,this.frameObj.offset=r,this.frameObj.radius=s,this.frameObj.border=a.toLowerCase(),this.frameObj.amount=l,this.notify("draw",{prop:"triggerFrameChange",value:{prevFrameSettings:p,obj:d}}),d.frameChangeEventArgs&&!d.frameChangeEventArgs.cancel?(this.notify("draw",{prop:"render-image",value:{isMouseWheel:null}}),JSON.stringify(this.frameObj)!==JSON.stringify(this.tempFrameObj)?(h=!0,this.okBtn()):this.tempFrameZoomLevel=null):(this.notify("draw",{prop:"performCancel",value:{isContextualToolbar:null}}),Pe(this.frameObj,this.tempFrameObj),this.tempFrameZoomLevel=null),this.notify("draw",{prop:"redrawDownScale"}),this.element.querySelector(".e-contextual-toolbar-wrapper"));return e&&e.classList.add("e-hide"),h},FUt.prototype.straightenImage=function(e){var t=!1;return-45<=e&&e<=45&&(this.applyShapes(),t=!0,this.notify("transform",{prop:"straightenImage",value:{degree:e}}),this.notify("draw",{prop:"redrawDownScale"})),t},FUt.prototype.cloneShape=function(e){var t={isSelected:!1};return"shape"===e.split("_")[0]&&(this.notify("shape",{prop:"selectShape",onPropertyChange:!1,value:{id:e,obj:t}}),t.isSelected)&&(this.notify("toolbar",{prop:"duplicateShape",onPropertyChange:!1,value:{isPreventUndoRedo:!1}}),this.okBtn(null,!0),this.notify("draw",{prop:"redrawDownScale"})),t.isSelected},FUt.prototype.getImageFilter=function(e){var t=this.createElement("canvas").getContext("2d");return this.notify("filter",{prop:"updateAdj",value:{type:e.toLowerCase(),value:null,isPreview:!0,ctx:t}}),t.filter},FUt.prototype.enableTextEditing=function(){var e=Pe({},this.activeObj,{},!0);e.order||(this.noPushUndo=!0,this.okBtn(),this.noPushUndo=!1,this.noRedact=!0,this.selectShape(e.currIndex),e.order=this.activeObj.order),this.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!1}}),this.activeObj=e,this.notify("toolbar",{prop:"editText",onPropertyChange:!1})},FUt.prototype.canUndo=function(){var e=!1;return e=0<this.getUndoRedoColl().index?!0:e},FUt.prototype.canRedo=function(){var e=!1,t=this.getUndoRedoColl(),i=t.undoRedoColl,t=t.index;return i&&0<i.length&&t<i.length-1&&(e=!0),t===i.length?e=!1:(0===t&&0<i.length||0<t)&&(e=!0),e},FUt.prototype.apply=function(){this.isMaskImage?this.discard():(this.updateColl("reset"),this.closeOverlayTbar(),this.okBtn(null,!0))},FUt.prototype.discard=function(){this.updateColl("reset"),this.notify("draw",{prop:"performCancel",value:{isContextualToolbar:this.closeOverlayTbar(),isFinalCancel:!0}})},FUt.prototype.enableShapeDrawing=function(e,t){t&&(this.drawingShape=e.toLowerCase(),this.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1})),e&&t?(this.currObjType.shape=e.toLowerCase(),this.activeObj.shape=this.currObjType.shape,this.currObjType.isDragging=this.currObjType.isCustomCrop=!1,this.activeObj.shapeDegree=this.transform.degree,this.activeObj.shapeFlip=this.transform.currFlipState,this.activeObj.textFlip=this.transform.currFlipState,this.activeObj.flipObjColl=[],this.notify("shape",{prop:"getNewOrder",onPropertyChange:!(e={order:null}),value:{obj:e}}),this.activeObj.order=e.order,this.notify("selection",{prop:"annotate",value:{shape:this.currObjType.shape}}),"text"===this.currObjType.shape?this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"text",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}):"redact"===this.currObjType.shape?this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"redact",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}):this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"shapes",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}),this.notify("toolbar",{prop:"update-toolbar-items",onPropertyChange:!1})):t||this.okBtn(null,!0)},FUt.prototype.bringToFront=function(e){this.noRedact=!0,this.selectShape(e)&&(this.updateShapeOrder(e,"bringToFront"),this.apply())},FUt.prototype.bringForward=function(e){this.noRedact=!0,this.selectShape(e)&&(this.updateShapeOrder(e,"bringForward"),this.apply())},FUt.prototype.sendToBack=function(e){this.noRedact=!0,this.selectShape(e)&&(this.updateShapeOrder(e,"sendToBack"),this.apply())},FUt.prototype.sendBackward=function(e){this.noRedact=!0,this.selectShape(e)&&(this.updateShapeOrder(e,"sendBackward"),this.apply())},FUt.prototype.clearImage=function(){this.reset(),this.isImageLoaded=!1,this.lowerContext.clearRect(0,0,this.lowerCanvas.width,this.lowerCanvas.height),this.upperContext.clearRect(0,0,this.upperCanvas.width,this.upperCanvas.height);var e=document.getElementById(this.element.id+"_bottomToolbar"),e=(F.isDevice&&e&&(document.getElementById(this.element.id+"_bottomToolbar").style.display="none"),this.notify("toolbar",{prop:"destroy-top-toolbar",onPropertyChange:!1}),this.notify("toolbar",{prop:"create-toolbar",onPropertyChange:!1}),this.notify("toolbar",{prop:"create-contextual-toolbar",onPropertyChange:!1}),document.getElementById(this.element.id+"_dropArea"));e&&(e.style.display="block")},FUt.prototype.selectMaskImage=function(e,t){e=e||10,t=t||"#512da880",this.applyShapes(),this.isMaskImage=!0,this.updateColl("empty"),this.enableDisableToolbar(!0),this.update(),this.activeObj.strokeSettings.strokeWidth=e,this.notify("freehand-draw",{prop:"setPenStrokeWidth",onPropertyChange:!1,value:{value:e}}),this.activeObj.strokeSettings.strokeColor=t,this.notify("freehand-draw",{prop:"freeHandDraw",onPropertyChange:!1,value:{value:!0}}),this.maskCanvas.style.display="block"},FUt.prototype.enableDisableToolbar=function(e){var t,i=document.getElementById(this.element.id+"_toolbar");i&&(t=At(i,"toolbar"))&&t.disable(e),(i=document.getElementById(this.element.id+"_bottomToolbar"))&&(t=At(i,"toolbar"))&&t.disable(e)},FUt.prototype.updateImage=function(e,t){var i,n,o,r=this;(e||t||""===t)&&(i=Pe({},this.cropObj,{},!0),this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(o={currObj:{}}),value:{object:o}}),(n=o.currObj).objColl=Pe([],this.objColl,[],!0),n.pointColl=Pe([],this.pointColl,[],!0),n.afterCropActions=Pe([],this.afterCropActions,[],!0),this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(o={selPointColl:null}),value:{obj:o}}),n.selPointColl=Pe([],o.selPointColl,[],!0),e&&(this.isImageUpdated=!0,"string"!=typeof e&&((o=this.createElement("canvas")).width=e.width,o.height=e.height,o.getContext("2d").putImageData(e,0,0),e=o.toDataURL()),this.baseImg.src=e,setTimeout(function(){0!==r.cropObj.straighten?(r.notify("toolbar",{prop:"performCropTransformClick",value:{shape:"crop-custom"}}),r.noPushUndo=!0,r.crop(),r.noPushUndo=!1):r.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}}),r.isImageUpdated=!1,t||(r.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"updateImage",previousObj:n,previousObjColl:n.objColl,previousPointColl:n.pointColl,previousSelPointColl:n.selPointColl,previousCropObj:i,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),r.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}))},100)),!t&&""!==t||(this.notify("draw",{prop:"imageBackgroundColor",onPropertyChange:!1,value:{color:t}}),this.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}}),e)||(this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"bgColor",previousObj:n,previousObjColl:n.objColl,previousPointColl:n.pointColl,previousSelPointColl:n.selPointColl,previousCropObj:i,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}})),e)&&t&&(this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"updateImage",previousObj:n,previousObjColl:n.objColl,previousPointColl:n.pointColl,previousSelPointColl:n.selPointColl,previousCropObj:i,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}))},FUt.prototype.editCompleted=function(e){this.notify("draw",{prop:"redrawDownScale"});e={action:e||"shape-insert",actionEventArgs:this.editCompleteArgs};this.triggerEditCompleteEvent(e)},FUt.prototype.updateColl=function(e){this.isMaskImage&&("empty"===e?(this.tempToolbarHeight=this.toolbarHeight,this.tempToolbar=this.toolbar?Pe([],this.toolbar,[],!0):null,this.tempObjColl=Pe([],this.objColl,[],!0),this.tempPointColl=Pe([],this.pointColl,[],!0),this.tempShapeColl=Pe([],this.shapeColl,[],!0),this.objColl=[],this.pointColl=[],this.shapeColl=[],this.freehandCounter=0,this.notify("freehand-draw",{prop:"setCurrentFreehandDrawIndex",value:{value:0}}),this.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}})):"reset"===e&&(this.objColl=this.tempObjColl,this.pointColl=this.tempPointColl,this.shapeColl=this.tempShapeColl,this.freehandCounter=this.pointColl.length,this.notify("freehand-draw",{prop:"setCurrentFreehandDrawIndex",value:{value:this.freehandCounter}}),this.enableDisableToolbar(!1),0!==this.cropObj.straighten&&(this.notify("toolbar",{prop:"performCropTransformClick",value:{shape:"crop-custom"}}),this.noPushUndo=!0,this.crop(),this.noPushUndo=!1),this.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}}),this.isMaskImage=!1,this.upperContext.globalCompositeOperation="source-over",this.maskCanvas.style.display="none",this.activeObj.strokeSettings={strokeColor:"#fff",fillColor:"",strokeWidth:null,radius:null,outlineColor:"",outlineWidth:null},this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:this.activeObj.strokeSettings,strokeColor:"#fff",fillColor:"",strokeWidth:null,outlineWidth:null}}),this.notify("freehand-draw",{prop:"setPenStrokeWidth",onPropertyChange:!1,value:{value:2}}),this.notify("freehand-draw",{prop:"setMasking",onPropertyChange:!1,value:{value:!1}})))},FUt.prototype.resetToolbar=function(){this.toolbarHeight!==this.tempToolbarHeight&&!(je(this.toolbar)||this.toolbar&&0<this.toolbar.length)&&je(this.toolbarTemplate)&&(this.toolbarHeight=this.tempToolbarHeight,this.notify("toolbar",{prop:"setToolbarHeight",value:{height:this.toolbarHeight}}),this.toolbar=this.tempToolbar,this.toolbarTemplate||(this.notify("toolbar",{prop:"create-toolbar",onPropertyChange:!1}),this.notify("toolbar",{prop:"create-contextual-toolbar",onPropertyChange:!1})),this.update())},FUt.prototype.getData=function(e){e&&this.resetToolbar();var t=Pe([],this.objColl,null,!0),i=Pe([],this.pointColl,null,!0),n=Pe([],this.shapeColl,null,!0);if(e){this.notify("shape",{prop:"updateShapeColl",onPropertyChange:!1});for(var o=0;o<this.freehandCounter;o++)this.pointColl[o].strokeColor="#fff"}else this.objColl=[],this.pointColl=[],this.shapeColl=[],this.freehandCounter=0;var r,s,a,l=this.frameObj.type,h=(this.frameObj.type="none",this.aspectWidth),d=this.aspectHeight,p=(this.aspectWidth=this.aspectHeight=null,this.cropObj.straighten),c=(this.togglePen=!1,this.notify("toolbar",{prop:"performCropTransformClick",value:{shape:"crop-custom"}}),Pe({},this.img,{},!0)),u=Pe({},this.cropObj,{},!0),g=Pe({},this.activeObj,{},!0),m=Pe({},this.transform,{},!0),f=Pe({},this.panPoint,{},!0),y=(0!==p&&this.setStraighten(0),this.activeObj.activePoint),y=(y.startX=this.img.destLeft,y.startY=this.img.destTop,y.width=this.img.destWidth,y.height=this.img.destHeight,y.endX=y.startX+y.width,y.endY=y.startY+y.height,this.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:y,obj:this.activeObj,isMouseMove:null,x:null,y:null}}),this.noPushUndo=!0,this.crop(),this.noPushUndo=!1,this.isCropTab=!1,this.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.notify("crop",{prop:"resetZoom",onPropertyChange:!1}),this.isCropTab=!0,Pe([],this.afterCropActions,[],!0)),v=Pe([],this.rotateFlipColl,[],!0),b=(this.notify("crop",{prop:"revertTransform",value:{type:"initial",coll:v}}),this.getImageData());return e&&(s=(r=this.createElement("canvas")).getContext("2d"),r.width=b.width,r.height=b.height,s.fillRect(0,0,r.width,r.height),0<this.pointColl.length&&(this.notify("crop",{prop:"calcRatio",onPropertyChange:!(a={width:0,height:0}),value:{obj:a,dimension:{width:r.width,height:r.height}}}),this.notify("export",{prop:"drawAnnotation",value:{context:s,ratio:a}})),this.upperContext.clearRect(0,0,this.upperCanvas.width,this.upperCanvas.height),b=s.getImageData(0,0,r.width,r.height)),this.notify("crop",{prop:"revertTransform",value:{type:"reverse",coll:v}}),this.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.afterCropActions=y,e||(this.objColl=t,this.pointColl=i,this.shapeColl=n,this.freehandCounter=this.pointColl.length),this.frameObj.type=l,this.aspectWidth=h,this.aspectHeight=d,this.notify("toolbar",{prop:"performCropTransformClick",value:{shape:"crop-custom"}}),0!==p&&this.setStraighten(p),this.img=c,this.cropObj=u,this.activeObj=g,this.transform=m,this.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:.1,zoomPoint:null,isResize:null}}),this.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:-.1,zoomPoint:null,isResize:null}}),0!==this.transform.degree&&(this.panPoint.currentPannedPoint={x:f.totalPannedClientPoint.x,y:f.totalPannedClientPoint.y},this.notify("transform",{prop:"drawPannedImage",value:{xDiff:f.totalPannedClientPoint.x,yDiff:f.totalPannedClientPoint.y}}),this.panPoint.currentPannedPoint={x:0,y:0},this.notify("transform",{prop:"setTempPanMove",value:{point:null}})),this.noPushUndo=!0,this.crop(),this.noPushUndo=!1,this.transform.straighten=0,this.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}}),b},FUt.prototype.applyShapes=function(){var e;!this.isUndoRedoStack&&(this.notify("selection",{prop:"getFreehandDrawEditing",onPropertyChange:!(e={bool:!1}),value:{obj:e}}),e.bool||this.togglePen||this.activeObj.shape&&-1!==["rectangle","ellipse","line","arrow","path","text","image"].indexOf(this.activeObj.shape)||this.drawingShape)&&this.okBtn(null,!0)},FUt.prototype.closeOverlayTbar=function(){var e=!1,t={bool:null};return this.notify("toolbar",{prop:"getFrameToolbar",onPropertyChange:!1,value:{obj:t}}),!t.bool&&this.element.querySelector(".e-contextual-toolbar-wrapper")&&(this.element.querySelector(".e-contextual-toolbar-wrapper").classList.contains("e-hide")||(e=!0),t=this.isStraightening,F.isDevice&&(!F.isDevice||t)||this.element.querySelector(".e-contextual-toolbar-wrapper").classList.add("e-hide")),e},FUt.prototype.toolbarTemplateFn=function(){var e,t=this.element.id+"_toolbar",i=this.element.querySelector("#"+this.element.id+"_toolbarArea");this.toolbarTemplate&&(this.toolbarFn=this.templateParser(this.toolbarTemplate),e=!this.isReact&&this.isAngular?3===(e=this.toolbarFn({type:"toolbar"},this,"Template",t))[0].nodeType?e[1]:e[0]:this.toolbarFn({type:"toolbar"},this,"Template",t)[0],i.appendChild(e),this.toolbarHeight=i.clientHeight,this.notify("toolbar",{prop:"setToolbarHeight",value:{height:this.toolbarHeight}}),this.renderReactTemplates())},FUt.prototype.quickAccessToolbarTemplateFn=function(){var e,t=this.element.id+"_quickAccessToolbar",i=this.element.querySelector("#"+this.element.id+"_quickAccessToolbarArea");this.quickAccessToolbarTemplate&&(this.qatFn=this.templateParser(this.quickAccessToolbarTemplate),e=!this.isReact&&this.isAngular?3===(e=this.qatFn({type:"toolbar"},this,"Template",t))[0].nodeType?e[1]:e[0]:this.qatFn({type:"toolbar"},this,"Template",t)[0],i.appendChild(e),this.renderReactTemplates())},FUt.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){return oo(t)}},FUt.prototype.getTextFromId=function(e){return{1:"none",2:"bar",3:"arrow",4:"arrowSolid",5:"circle",6:"circleSolid",7:"square",8:"squareSolid"}[""+e]},FUt.prototype.getFinetuneOption=function(e){return{brightness:DUt.Brightness,contrast:DUt.Contrast,hue:DUt.Hue,saturation:DUt.Saturation,opacity:DUt.Opacity,blur:DUt.Blur,exposure:DUt.Exposure}[""+e]},FUt.prototype.setPenStroke=function(e){this.notify("freehand-draw",{prop:"setPenStrokeWidth",onPropertyChange:!1,value:{value:parseInt(e,10)}})},FUt.prototype.updateFreehandDrawColorChange=function(){var e={tempFreeHandDrawEditingStyles:null};this.notify("freehand-draw",{prop:"getTempFreeHandDrawEditingStyles",value:{obj:e}}),this.notify("freehand-draw",{prop:"color-change",value:{color:e.tempFreeHandDrawEditingStyles.strokeColor}})},FUt.prototype.getUndoRedoColl=function(){var e={undoRedoColl:null,index:null},t={undoRedoStep:null},i={appliedUndoRedoColl:[]};return this.notify("undo-redo",{prop:"getAppliedUndoRedoColl",value:{obj:i}}),this.notify("undo-redo",{prop:"getUndoRedoStep",value:{obj:t}}),e.undoRedoColl=i.appliedUndoRedoColl,e.index=t.undoRedoStep,e},FUt.prototype.updateImageTransformColl=function(e){var t;"rotateleft"===e?t=-90:"rotateright"===e?t=90:"horizontalflip"===e?t="horizontal":"verticalflip"===e&&(t="vertical");for(var i=0;i<this.objColl.length;i++){var n=this.objColl[i].shape;"image"!==n&&"text"!==n||(je(this.objColl[i].rotateFlipColl)&&(this.objColl[i].rotateFlipColl=[]),this.objColl[i].rotateFlipColl.push(t),n={collection:this.objColl[i].rotateFlipColl},this.notify("shape",{prop:"alignRotateFlipColl",onPropertyChange:!1,value:{collection:this.objColl[i].rotateFlipColl,isRotateFlipCollection:!1,obj:n}}),this.objColl[i].rotateFlipColl=n.collection)}},FUt.prototype.setInitialZoomState=function(){this.objColl.push(this.activeObj),this.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1});var e=this.isUndoRedo;this.isCropTab=!1,this.isUndoRedo=!0,this.transform.cropZoomFactor&&0<this.transform.cropZoomFactor?this.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:-this.transform.cropZoomFactor,zoomPoint:null,isResize:!0}}):this.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:Math.abs(this.transform.cropZoomFactor),zoomPoint:null,isResize:!0}}),this.isUndoRedo=e,this.panPoint.totalPannedPoint={x:0,y:0},this.transform.cropZoomFactor=0,this.notify("freehand-draw",{prop:"updateFHDColl",onPropertyChange:!1}),this.activeObj=Pe({},this.objColl[this.objColl.length-1],{},!0),this.objColl.pop(),this.isCropTab=!0,this.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:this.activeObj}})},FUt.prototype.updateCropTransformItems=function(){this.prevCurrSelectionPoint=Pe({},this.currSelectionPoint,{},!0),this.notify("draw",{prop:"updateCropSelection",onPropertyChange:!1})},FUt.prototype.toPascalCase=function(e,t){var i=[];je(e)||(i=e.toLowerCase().split("-"));for(var n=0;n<i.length;n++)i[n]=i[n].charAt(0).toUpperCase()+i[n].slice(1);return t&&(t.maxText=i.join("")),i.join("")},FUt.prototype.getFontSizes=function(){var e=[];this.fontSizeColl=[];for(var t=0===this.transform.degree||this.transform.degree%180==0?this.img.destWidth/25:this.img.destHeight/25,i=1;i<=10;i++)this.fontSizeColl.push({text:(i*Math.round(t/2)).toString()}),e.push({text:i.toString()});return e},FUt.prototype.updateDropInfoContent=function(e){var t,i,n,o,r;e&&(this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!(t={key:"SupportText"}),value:{obj:t}}),i=this.getExtensionString(),this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!(n={key:"MinMaxSize"}),value:{obj:n}}),this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!(o={key:"And"}),value:{obj:o}}),this.uploadSettings.minFileSize&&this.uploadSettings.maxFileSize?r=" "+n.value+" "+this.formatSizeUnits(this.uploadSettings.minFileSize)+" "+o.value+" "+this.formatSizeUnits(this.uploadSettings.maxFileSize):this.uploadSettings.minFileSize?(n.key="MinSize",this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!1,value:{obj:n}}),r=" "+n.value+" "+this.formatSizeUnits(this.uploadSettings.minFileSize)):this.uploadSettings.maxFileSize&&(n.key="MaxSize",this.notify("toolbar",{prop:"getLocaleText",onPropertyChange:!1,value:{obj:n}}),r=" "+n.value+" "+this.formatSizeUnits(this.uploadSettings.maxFileSize)),e.textContent=r?t.value+i+r:t.value+i)},FUt.prototype.okBtn=function(e,t,i){t&&(this.noPushUndo=!1,this.notify("selection",{prop:"setTempActObj",onPropertyChange:!1,value:{obj:{activePoint:{startX:0,startY:0,endX:0,endY:0,width:0,height:0},flipObjColl:[],triangle:[],triangleRatio:[],order:null}}}));var n,o=this.element.querySelector(".e-contextual-toolbar-wrapper"),o=(o&&o.classList.remove("e-frame-wrapper"),!1),r=(this.isResizeOkBtn=!0,this.element.querySelector("#"+this.element.id+"_aspectratio")),s=this.element.querySelector("#"+this.element.id+"_nonaspectratio"),a=this.element.querySelector(".e-ie-toolbar-aspect-ratio-btn"),l=this.element.querySelector(".e-ie-toolbar-nonaspect-ratio-btn"),h=((void 0===(n=void 0!==this.activeObj.shape?this.activeObj.shape.split("-"):n)&&this.currObjType.isCustomCrop||void 0!==n&&"crop"===n[0])&&(o=!0),this.allowDownScale=!0,(this.activeObj.shape&&"image"!==this.activeObj.shape||this.togglePen)&&!o&&(this.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!(n={shapeSettingsObj:{}}),value:{obj:n}}),n=n.shapeSettingsObj,this.togglePen&&(n.type=AUt.FreehandDraw),n={action:"apply",currentShapeSettings:Pe({},n,{},!0)},this.currObjType.isRedact||!t&&!this.isShapeDrawing||(this.isShapeDrawing&&(n.action="draw-end"),this.trigger("shapeChange",n)),this.editCompleteArgs=n,this.currObjType.isRedact)&&(this.currObjType.isRedact=!1),r||s?(this.notify("selection",{prop:"getNumTextValue",onPropertyChange:!(n={width:null,height:null}),value:{obj:n}}),d={prevCropObj:this.prevCropObj},h={prevObj:this.prevObj},(n={x:n.width,y:n.height}).x&&n.y&&d.prevCropObj&&h.prevObj?(s||l&&!l.classList.contains("e-hidden")?this.notify("transform",{prop:"resize",value:{width:n.x,height:n.y,isAspectRatio:!1}}):(r||a&&!a.classList.contains("e-hidden"))&&this.notify("transform",{prop:"resize",value:{width:n.x,height:null,isAspectRatio:!0}}),this.isResize=!1,this.aspectWidth=n.x,this.aspectHeight=n.y,this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:!1,isCropping:!1,isZooming:null,cType:null}}),this.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:-this.transform.zoomFactor,zoomPoint:null,isResize:!0}}),this.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:h.prevObj.defaultZoom,zoomPoint:null,isResize:!0}}),h.prevObj.zoomFactor&&this.setProperties({zoomSettings:{zoomFactor:h.prevObj.zoomFactor}},!0),this.notify("transform",{prop:"setPreviousZoomValue",onPropertyChange:!1,value:{previousZoomValue:this.zoomSettings.zoomFactor}}),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"resize",previousObj:h.prevObj,previousObjColl:h.prevObj.objColl,previousPointColl:h.prevObj.pointColl,previousSelPointColl:h.prevObj.selPointColl,previousCropObj:d.prevCropObj,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}),!(l=this.cancelCropSelection)||!je(s)&&s||(l.previousObj.aspectWidth=l.currentObj.aspectWidth=this.aspectWidth,l.previousObj.aspectHeight=l.currentObj.aspectHeight=this.aspectHeight,l.previousCropObj=Pe({},this.cropObj,{},!0),l.currentCropObj=Pe({},this.cropObj,{},!0),this.notify("draw",{prop:"updateCropSelObj"})),this.cancelCropSelection=null):0===n.x||0===n.y?this.notify("draw",{prop:"performCancel",value:{isContextualToolbar:null}}):this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:!1,isCropping:!1,isZooming:null,cType:null}}),this.isAspectRatio=!1):i&&(r=!1,this.aspectWidth&&this.aspectHeight?this.notify("transform",{prop:"resize",value:{width:this.aspectWidth,height:this.aspectHeight,isAspectRatio:!1}}):this.aspectWidth&&(this.notify("transform",{prop:"resize",value:{width:this.aspectWidth,height:null,isAspectRatio:!0}}),this.aspectHeight=this.aspectWidth/(this.img.destWidth/this.img.destHeight),r=!0),this.isResize=!1,this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:!1,isCropping:!1,isZooming:null,cType:null}}),this.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:-this.transform.zoomFactor,zoomPoint:null,isResize:!0}}),this.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:this.prevObj.defaultZoom,zoomPoint:null,isResize:!0}}),this.prevObj.zoomFactor&&this.setProperties({zoomSettings:{zoomFactor:this.prevObj.zoomFactor}},!0),this.notify("transform",{prop:"setPreviousZoomValue",onPropertyChange:!1,value:{previousZoomValue:this.zoomSettings.zoomFactor}}),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"resize",previousObj:this.prevObj,previousObjColl:this.prevObj.objColl,previousPointColl:this.prevObj.pointColl,previousSelPointColl:this.prevObj.selPointColl,previousCropObj:this.prevCropObj,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}),(a=this.cancelCropSelection)&&r&&(a.previousObj.aspectWidth=a.currentObj.aspectWidth=this.aspectWidth,a.previousObj.aspectHeight=a.currentObj.aspectHeight=this.aspectHeight,a.previousCropObj=Pe({},this.cropObj,{},!0),a.currentCropObj=Pe({},this.cropObj,{},!0),this.notify("draw",{prop:"updateCropSelObj"})),this.cancelCropSelection=null,this.isAspectRatio=!1),this.element.querySelector(".e-contextual-toolbar-wrapper .e-toolbar-item.e-selected")),d={bool:!1},s=(this.notify("selection",{prop:"getFreehandDrawEditing",onPropertyChange:!1,value:{obj:d}}),this.notify("toolbar",{prop:"getFrameToolbar",onPropertyChange:!1,value:{obj:{bool:null}}}),document.querySelector("#"+this.element.id+"_sliderWrapper"));h&&(this.currentFilter=h.children[0].children[0].id.replace("Canvas","")),o?(0===this.transform.straighten||0===this.panPoint.totalPannedPoint.x&&0===this.panPoint.totalPannedPoint.y&&0===this.panPoint.totalPannedClientPoint.x&&0===this.panPoint.totalPannedClientPoint.y||(l=this.prevStraightenedDegree,this.prevStraightenedDegree=this.transform.straighten,this.setStraighten(this.transform.straighten-3),this.setStraighten(this.transform.straighten+3),this.prevStraightenedDegree=l),this.isCroppedEvent=this.crop()):this.togglePen?(this.freeHandDraw(!1),this.isMaskImage||(this.notify("freehand-draw",{prop:"getPenStrokeWidth",onPropertyChange:!(n={penStrokeWidth:null}),value:{obj:n}}),this.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}),this.notify("freehand-draw",{prop:"setPenStrokeWidth",onPropertyChange:!1,value:{value:n.penStrokeWidth}})),this.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),this.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.upperContext}})):"block"===this.textArea.style.display||"inline-block"===this.textArea.style.display?(this.notify("shape",{prop:"redrawActObj",onPropertyChange:!1,value:{x:null,y:null,isMouseDown:null}}),this.lowerContext.clearRect(0,0,this.lowerCanvas.width,this.lowerCanvas.height),this.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1}),je(e)&&this.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}),this.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),this.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.upperContext}})):!s&&!this.currObjType.isFiltered||this.drawingShape||"redact"===this.activeObj.shape?d.bool?(this.notify("freehand-draw",{prop:"applyFhd",onPropertyChange:!1}),this.notify("selection",{prop:"setFreehandDrawCustomized",value:{isFreehandDrawCustomized:!1}}),this.notify("toolbar",{prop:"destroy-qa-toolbar"}),this.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}),this.notify("freehand-draw",{prop:"resetFreehandDrawSelectedId",onPropertyChange:!1})):0!==this.activeObj.activePoint.width||0!==this.activeObj.activePoint.height||"path"===this.activeObj.shape&&0<this.activeObj.pointColl.length?("image"===this.activeObj.shape&&this.notify("draw",{prop:"setImageApply",onPropertyChange:!1,value:{bool:!0}}),this.notify("shape",{prop:"applyActObj",onPropertyChange:!1,value:{isMouseDown:null}})):(JSON.stringify(this.frameObj)!==JSON.stringify(this.tempFrameObj)&&(this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(i={currObj:{}}),value:{object:i}}),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"frame",previousObj:i.currObj,previousObjColl:i.currObj.objColl,previousPointColl:i.currObj.pointColl,previousSelPointColl:i.currObj.selPointColl,previousCropObj:Pe({},this.cropObj,{},!0),previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!0}}),r={type:this.toPascalCase(this.frameObj.type),color:this.frameObj.color,gradientColor:this.frameObj.gradientColor,size:this.frameObj.size,inset:this.frameObj.inset,offset:this.frameObj.offset,borderRadius:this.frameObj.radius,frameLineStyle:this.toPascalCase(this.frameObj.border),lineCount:this.frameObj.amount},a={type:this.toPascalCase(this.tempFrameObj.type),color:this.tempFrameObj.color,gradientColor:this.tempFrameObj.gradientColor,size:this.tempFrameObj.size,inset:this.tempFrameObj.inset,offset:this.tempFrameObj.offset,borderRadius:this.tempFrameObj.radius,frameLineStyle:this.toPascalCase(this.tempFrameObj.border),lineCount:this.tempFrameObj.amount},this.editCompleteArgs={cancel:!1,previousFrameSetting:a,currentFrameSetting:r},this.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}),this.tempFrameObj=Pe({},this.frameObj,{},!0)),this.notify("draw",{prop:"resetFrameZoom",onPropertyChange:!1,value:{isOk:!0}})):(this.initialAdjustmentValue=this.canvasFilter=this.lowerContext.filter,this.currObjType.isFiltered=!1,this.notify("draw",{prop:"getTempAdjustmentValue",value:{obj:{value:null}}}),s&&"Opacity"===s.parentElement.previousElementSibling.textContent||this.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}),(0!==this.activeObj.activePoint.width&&0!==this.activeObj.activePoint.height||"path"===this.activeObj.shape&&0<this.activeObj.pointColl.length)&&this.notify("shape",{prop:"applyActObj",onPropertyChange:!1,value:{isMouseDown:null}})),d.isCropToolbar||(this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:!1,isCropping:null,isZooming:null,cType:null}}),this.currObjType.isRedact=!1),this.notify("draw",{prop:"setNewPath",value:{bool:!1}}),this.transform.zoomFactor=this.transform.defaultZoomFactor,this.notify("selection",{prop:"setCurrentDrawingShape",onPropertyChange:!1,value:{value:""}}),this.isResizeOkBtn=!1,this.notify("draw",{prop:"redrawDownScale"}),this.isChangesSaved=this.isFinetuneBtnClick=!1,t&&(this.drawingShape=null,this.notify("draw",{prop:"resetTempObjColl"}),this.notify("draw",{prop:"resetTempPointColl"}))},FUt.prototype.triggerEditCompleteEvent=function(e){"shape-insert"===e.action&&e.actionEventArgs&&e.actionEventArgs.currentShapeSettings&&"Redact"===e.actionEventArgs.currentShapeSettings.type.toString()&&(e.action="redact"),this.trigger("editComplete",e),this.editCompleteArgs=null},FUt.prototype.getObjFromId=function(e){var t;if(this.activeObj.currIndex&&this.activeObj.currIndex===e)t=Pe({},this.activeObj,{},!0);else for(var i=0;i<this.shapeColl.length;i++)if((this.shapeColl[i].id||this.shapeColl[i].currIndex)===e){t=Pe({},this.shapeColl[i],{},!0);break}return t},FUt.prototype.setTempFilterProperties=function(){this.upperCanvas.style.display="block",this.cropSelectedState();var e={adjustmentLevel:null},e=(this.notify("filter",{prop:"getAdjustmentLevel",onPropertyChange:!1,value:{obj:e}}),this.lowerContext.filter=this.initialAdjustmentValue,this.notify("draw",{prop:"setTempAdjustmentValue",value:{tempAdjustmentValue:this.lowerContext.filter}}),this.notify("filter",{prop:"setTempAdjustmentLevel",onPropertyChange:!1,value:{tempAdjustmentLevel:Pe({},e.adjustmentLevel,{},!0)}}),this.notify("draw",{prop:"setTempFilter",value:{tempFilter:this.currentFilter}}),{undoRedoStep:null});this.notify("undo-redo",{prop:"getUndoRedoStep",value:{obj:e}}),this.notify("draw",{prop:"setTempUndoRedoStep",value:{tempUndoRedoStep:e.undoRedoStep}})},FUt.prototype.cropSelectedState=function(){this.activeObj.shape&&"crop"===this.activeObj.shape.split("-")[0]&&this.okBtn()},FUt.prototype.getCurrentCanvasData=function(){var e=Pe({},this.frameObj,{},!0),t=(this.frameObj={type:"none",color:"#fff",size:20,inset:20,offset:20,radius:0,amount:1,border:"solid",gradientColor:""},this.lowerContext.filter),i=(this.lowerContext.filter=this.canvasFilter="none",Pe([],this.objColl,null,!0)),n=Pe([],this.pointColl,null,!0),o=(this.objColl=[],this.pointColl=[],this.freehandCounter=0,this.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}}),this.element.querySelector(".e-contextual-toolbar-wrapper")),r=(o&&o.classList.add("e-hide"),this.getImageData());return o&&o.classList.remove("e-hide"),F.isDevice||this.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"main",isApplyBtn:!0,isCropping:!1}}),this.element.querySelector("#"+this.element.id+"_contextualToolbarArea").classList.remove("e-hide"),this.objColl=i,this.pointColl=n,this.freehandCounter=n.length,this.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"iterate",pen:"iterate",isPreventApply:null}}),this.lowerContext.filter=this.canvasFilter=t,this.frameObj=e,r},FUt.prototype.setCurrAdjustmentValue=function(e,t){var i={finetune:this.getFinetuneOption(e),value:t,cancel:!1};this.trigger("finetuneValueChanging",i),(this.editCompleteArgs=i).cancel||this.notify("filter",{prop:"setCurrAdjValue",value:{type:e.toLowerCase(),value:t}})},FUt.prototype.getSquarePointForPath=function(e){var t={startX:0,startY:0,endX:0,endY:0,width:0,height:0};if(0<e.pointColl.length){for(var t={startX:e.pointColl[0].x,startY:e.pointColl[0].y,endX:e.pointColl[0].x,endY:e.pointColl[0].y},i=1;i<e.pointColl.length;i++)e.pointColl[i].x<t.startX&&(t.startX=e.pointColl[i].x),e.pointColl[i].y<t.startY&&(t.startY=e.pointColl[i].y),e.pointColl[i].x>t.endX&&(t.endX=e.pointColl[i].x),e.pointColl[i].y>t.endY&&(t.endY=e.pointColl[i].y);t.width=t.endX-t.startX,t.height=t.endY-t.startY}return t},FUt.prototype.getSelectionType=function(e){var t={CropCustom:"Custom",CropSquare:"Square",CropCircle:"Circle","Crop3:2":"3:2","Crop4:3":"4:3","Crop5:4":"5:4","Crop7:5":"7:5","Crop16:9":"16:9","Crop2:3":"2:3","Crop3:4":"3:4","Crop4:5":"4:5","Crop5:7":"5:7","Crop9:16":"9:16"};return t[""+(e="crop-custom"===e?"CropCustom":e)]||e.split("Crop")[1]},FUt.prototype.clearContext=function(e){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.clearRect(0,0,e.canvas.height,e.canvas.width)},FUt.prototype.updateArrow=function(e,t){var i=!1,n=this.objColl.length,n=(this.notify("shape",{prop:"pushActItemIntoObj"}),n!==this.objColl.length&&(i=!0),Pe({},this.cropObj,{},!0)),o={currObj:{}},r={shapeSettingsObj:{}},r=(this.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:r}}),r.shapeSettingsObj),o=(this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:o}}),o.currObj),i=(o.objColl=Pe([],this.objColl,[],!0),o.pointColl=Pe([],this.pointColl,[],!0),o.afterCropActions=Pe([],this.afterCropActions,[],!0),i&&this.objColl.pop(),"startArrow"===e?this.activeObj.start=this.getTextFromId(t):"endArrow"===e&&(this.activeObj.end=this.getTextFromId(t)),this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:null,fillColor:null,strokeWidth:this.activeObj.strokeSettings.strokeWidth}}),this.objColl.push(this.activeObj),0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:o,previousObjColl:o.objColl,previousPointColl:o.pointColl,previousCropObj:n,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("selection",{prop:"redrawShape",value:{obj:this.objColl[this.objColl.length-1]}}),F.isDevice?document.getElementById(this.element.id+"_bottomToolbar")&&At(this.element.id+"_bottomToolbar","toolbar").refreshOverflow():document.getElementById(this.element.id+"_toolbar")&&At(this.element.id+"_toolbar","toolbar").refreshOverflow(),{action:e,currentShapeSettings:Pe({},r,{},!0)});this.trigger("shapeChange",i),this.editCompleteArgs=i},FUt.prototype.updateFontFamily=function(e){this.notify("selection",{prop:"setInitialTextEdit",value:{bool:!1}});var t=!1,i=this.objColl.length,i=(this.notify("shape",{prop:"pushActItemIntoObj"}),i!==this.objColl.length&&(t=!0),Pe([],this.objColl,[],!0)),n=Pe({},this.cropObj,{},!0),o={shapeSettingsObj:{}},o=(this.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:o}}),o.shapeSettingsObj),r={currObj:{}},r=(this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:r}}),r.currObj),s=(r.objColl=Pe([],this.objColl,[],!0),r.pointColl=Pe([],this.pointColl,[],!0),r.afterCropActions=Pe([],this.afterCropActions,[],!0),{selPointColl:null}),s=(this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:s}}),r.selPointColl=Pe([],s.selPointColl,[],!0),t&&this.objColl.pop(),"block"===this.textArea.style.display||"inline-block"===this.textArea.style.display?(this.notify("shape",{prop:"updateFontRatio",onPropertyChange:!1,value:{obj:this.activeObj,isTextArea:!0}}),s=this.activeObj.textSettings.fontFamily,this.activeObj.textSettings.fontFamily=this.toPascalCase(e),0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||this.notify("shape",{prop:"redraw-text"}),this.objColl.push(this.activeObj),0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"textAreaCustomization",previousObj:r,previousObjColl:r.objColl,previousPointColl:r.pointColl,previousSelPointColl:r.selPointColl,previousCropObj:n,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.objColl.pop(),this.upperContext.clearRect(0,0,this.upperCanvas.width,this.upperCanvas.height),t=this.activeObj.activePoint.width+.25*this.activeObj.textSettings.fontSize,this.textArea.style.width=t+"px",this.textArea.style.fontFamily=this.toPascalCase(e),this.activeObj.textSettings.fontFamily=s,this.notify("shape",{prop:"updateFontStyles",onPropertyChange:!1,value:{isTextBox:null}})):(this.notify("shape",{prop:"updateFontRatio",onPropertyChange:!1,value:{obj:this.activeObj,isTextArea:null}}),t=this.activeObj.textSettings.fontFamily=this.toPascalCase(e),this.notify("shape",{prop:"setTextSettings",onPropertyChange:!1,value:{textSettings:null,fontFamily:t,fontSize:null}}),0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||this.notify("shape",{prop:"redraw-text"}),this.objColl.push(this.activeObj),0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:r,previousObjColl:i,previousPointColl:Pe([],this.pointColl,[],!0),previousSelPointColl:r.selPointColl,previousCropObj:n,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("selection",{prop:"redrawShape",value:{obj:this.objColl[this.objColl.length-1]}})),{action:"font-family",currentShapeSettings:Pe({},o,{},!0)});s.currentShapeSettings.fontFamily=this.textArea.style.fontFamily,this.trigger("shapeChange",s),this.editCompleteArgs=s},FUt.prototype.updateFontSize=function(e){this.notify("selection",{prop:"setInitialTextEdit",value:{bool:!1}});var t,i,n,o=!1,r=this.objColl.length,r=(this.notify("shape",{prop:"pushActItemIntoObj"}),r!==this.objColl.length&&(o=!0),Pe({},this.cropObj,{},!0)),s={shapeSettingsObj:{}},s=(this.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:s}}),s.shapeSettingsObj),a={currObj:{}},a=(this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:a}}),a.currObj),l=(a.objColl=Pe([],this.objColl,[],!0),a.pointColl=Pe([],this.pointColl,[],!0),a.afterCropActions=Pe([],this.afterCropActions,[],!0),{selPointColl:null}),o=(this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:l}}),a.selPointColl=Pe([],l.selPointColl,[],!0),o&&this.objColl.pop(),"block"===this.textArea.style.display||"inline-block"===this.textArea.style.display?(this.notify("shape",{prop:"updateFontRatio",onPropertyChange:!1,value:{obj:this.activeObj,isTextArea:!0}}),l=this.activeObj.textSettings.fontSize,this.activeObj.textSettings.fontSize=parseInt(this.fontSizeColl[parseInt(e,10)-1].text,10),this.objColl.push(this.activeObj),0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"textAreaCustomization",previousObj:a,previousObjColl:a.objColl,previousPointColl:a.pointColl,previousSelPointColl:a.selPointColl,previousCropObj:r,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.objColl.pop(),o="","bold"===this.textArea.style.fontWeight&&(o="bold "),"italic"===this.textArea.style.fontStyle&&(o="italic "),"bold"===this.textArea.style.fontWeight&&"italic"===this.textArea.style.fontStyle&&(o="italic bold "),this.upperContext.font=o+this.activeObj.textSettings.fontSize+"px "+this.textArea.style.fontFamily,t=this.textArea.value.split("\n"),this.notify("shape",{prop:"getMaxText",onPropertyChange:!(i={maxText:""}),value:{isTextBox:!0,text:null,obj:i}}),o=i.maxText,n=this.upperContext.measureText(o).width+.5*this.activeObj.textSettings.fontSize,this.textArea.style.width=n+"px",this.textArea.style.height=t.length*(this.activeObj.textSettings.fontSize+.25*this.activeObj.textSettings.fontSize)+"px",this.activeObj.textSettings.fontSize=l,this.upperContext.font=this.activeObj.textSettings.fontSize+"px "+this.activeObj.textSettings.fontFamily,this.textArea.style.fontSize=parseInt(this.fontSizeColl[parseInt(e,10)-1].text,10)+"px","georgia"===this.textArea.style.fontFamily&&(this.textArea.style.width=parseFloat(this.textArea.style.width)+parseFloat(this.textArea.style.fontSize)+"px")):(this.notify("shape",{prop:"updateFontRatio",onPropertyChange:!1,value:{obj:this.activeObj,isTextArea:null}}),o=this.activeObj.textSettings.fontSize=parseInt(this.fontSizeColl[parseInt(e,10)-1].text,10),this.notify("shape",{prop:"setTextSettings",onPropertyChange:!1,value:{textSettings:null,fontFamily:null,fontSize:o}}),this.upperContext.font=this.activeObj.textSettings.fontSize+"px "+this.activeObj.textSettings.fontFamily,t=this.activeObj.keyHistory.split("\n"),this.notify("shape",{prop:"getMaxText",onPropertyChange:!(i={maxText:""}),value:{isTextBox:null,text:null,obj:i}}),l=i.maxText,n=this.upperContext.measureText(l).width+.5*this.activeObj.textSettings.fontSize,e=t.length*(this.activeObj.textSettings.fontSize+.25*this.activeObj.textSettings.fontSize),0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||(this.notify("selection",{prop:"setTextSelection",onPropertyChange:!1,value:{width:n,height:e}}),this.notify("draw",{prop:"updateActiveObject",onPropertyChange:!1,value:{actPoint:this.activeObj.activePoint,obj:this.activeObj,isMouseMove:null,x:null,y:null}}),this.notify("shape",{prop:"redraw-text"})),this.objColl.push(this.activeObj),0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:a,previousObjColl:a.objColl,previousPointColl:a.pointColl,previousSelPointColl:a.selPointColl,previousCropObj:r,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("selection",{prop:"redrawShape",value:{obj:this.objColl[this.objColl.length-1]}})),{action:"font-size",currentShapeSettings:Pe({},s,{},!0)});o.currentShapeSettings.fontSize=this.activeObj.textSettings.fontSize,this.trigger("shapeChange",o),this.editCompleteArgs=o},FUt.prototype.updateFontColor=function(e,t){this.notify("selection",{prop:"setInitialTextEdit",value:{bool:!1}});var i=!1,n=this.objColl.length,n=(this.notify("shape",{prop:"pushActItemIntoObj"}),n!==this.objColl.length&&(i=!0),Pe({},this.cropObj,{},!0)),o={shapeSettingsObj:{}},o=(this.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:o}}),o.shapeSettingsObj),r={currObj:{}},r=(this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:r}}),r.currObj),s=(r.objColl=Pe([],this.objColl,[],!0),r.pointColl=Pe([],this.pointColl,[],!0),r.afterCropActions=Pe([],this.afterCropActions,[],!0),{selPointColl:null}),i=(this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:s}}),r.selPointColl=Pe([],s.selPointColl,[],!0),i&&this.objColl.pop(),"none"===this.textArea.style.display?("Text"===t?(this.activeObj.strokeSettings.strokeColor=e,this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:this.activeObj.strokeSettings.strokeColor,fillColor:null,strokeWidth:null}})):(this.activeObj.strokeSettings.fillColor=e,this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:null,fillColor:this.activeObj.strokeSettings.fillColor,strokeWidth:null}})),this.togglePen||0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||(this.objColl.push(this.activeObj),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:r,previousObjColl:r.objColl,previousPointColl:r.pointColl,previousSelPointColl:r.selPointColl,previousCropObj:n,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("selection",{prop:"redrawShape",value:{obj:this.objColl[this.objColl.length-1]}}))):"block"===this.textArea.style.display||"inline-block"===this.textArea.style.display?(this.textArea.style["Text"===t?"color":"backgroundColor"]=e,s="Text"===t?this.activeObj.strokeSettings.strokeColor:this.activeObj.strokeSettings.fillColor,this.activeObj.strokeSettings["Text"===t?"strokeColor":"fillColor"]=e,0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||(this.objColl.push(this.activeObj),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"textAreaCustomization",previousObj:r,previousObjColl:r.objColl,previousPointColl:r.pointColl,previousSelPointColl:r.selPointColl,previousCropObj:n,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.objColl.pop()),this.activeObj.strokeSettings["Text"===t?"strokeColor":"fillColor"]=s):this.togglePen||0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||(this.objColl.push(this.activeObj),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:r,previousObjColl:r.objColl,previousPointColl:r.pointColl,previousSelPointColl:r.selPointColl,previousCropObj:n,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("selection",{prop:"redrawShape",value:{obj:this.objColl[this.objColl.length-1]}})),{action:"font-color",currentShapeSettings:Pe({},o,{},!0)});i.currentShapeSettings.fillColor=e,this.trigger("shapeChange",i),this.editCompleteArgs=i},FUt.prototype.updateStrokeTextColor=function(e){this.notify("selection",{prop:"setInitialTextEdit",value:{bool:!1}});var t=!1,i=this.objColl.length,i=(this.notify("shape",{prop:"pushActItemIntoObj"}),i!==this.objColl.length&&(t=!0),Pe({},this.cropObj,{},!0)),n={shapeSettingsObj:{}},n=(this.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:n}}),n.shapeSettingsObj),o={currObj:{}},o=(this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:o}}),o.currObj),r=(o.objColl=Pe([],this.objColl,[],!0),o.pointColl=Pe([],this.pointColl,[],!0),o.afterCropActions=Pe([],this.afterCropActions,[],!0),{selPointColl:null}),t=(this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:r}}),o.selPointColl=Pe([],r.selPointColl,[],!0),t&&this.objColl.pop(),"none"===this.textArea.style.display?(this.activeObj.strokeSettings.outlineColor=e,this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:null,fillColor:null,strokeWidth:null,outlineColor:this.activeObj.strokeSettings.outlineColor}}),this.togglePen||0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||(this.objColl.push(this.activeObj),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:o,previousObjColl:o.objColl,previousPointColl:o.pointColl,previousSelPointColl:o.selPointColl,previousCropObj:i,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("selection",{prop:"redrawShape",value:{obj:this.objColl[this.objColl.length-1]}}))):"block"===this.textArea.style.display||"inline-block"===this.textArea.style.display?(this.textArea.style.textShadow="-1px -1px 0 "+e+", 1px -1px 0 "+e+", -1px 1px 0 "+e+", 1px 1px 0 "+e,r=this.activeObj.strokeSettings.outlineColor,this.activeObj.strokeSettings.outlineColor=e,0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||(this.objColl.push(this.activeObj),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"textAreaCustomization",previousObj:o,previousObjColl:o.objColl,previousPointColl:o.pointColl,previousSelPointColl:o.selPointColl,previousCropObj:i,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.objColl.pop()),this.activeObj.strokeSettings.outlineColor=r):this.togglePen||0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||(this.objColl.push(this.activeObj),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:o,previousObjColl:o.objColl,previousPointColl:o.pointColl,previousSelPointColl:o.selPointColl,previousCropObj:i,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("selection",{prop:"redrawShape",value:{obj:this.objColl[this.objColl.length-1]}})),{action:"font-color",currentShapeSettings:Pe({},n,{},!0)});t.currentShapeSettings.fillColor=e,this.trigger("shapeChange",t),this.editCompleteArgs=t},FUt.prototype.updatePenStrokeWidth=function(e){var t=Pe([],this.pointColl,[],!0),i=(this.updateFreehandDrawColorChange(),Pe({},this.cropObj,{},!0)),n={shapeSettingsObj:{}},n=(this.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:n}}),n.shapeSettingsObj),o={currObj:{}},o=(this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:o}}),o.currObj),r=(o.objColl=Pe([],this.objColl,[],!0),o.pointColl=Pe([],this.pointColl,[],!0),o.afterCropActions=Pe([],this.afterCropActions,[],!0),{selPointColl:null}),r=(this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:r}}),o.selPointColl=Pe([],r.selPointColl,[],!0),this.pointColl=t,this.notify("selection",{prop:"setFreehandDrawCustomized",value:{isFreehandDrawCustomized:!0}}),this.setPenStroke(e),{bool:!1}),r=(this.notify("selection",{prop:"getFreehandDrawEditing",onPropertyChange:!1,value:{obj:r}}),r.bool&&(this.notify("freehand-draw",{prop:"getPenStrokeWidth",onPropertyChange:!(t={penStrokeWidth:null}),value:{obj:t}}),this.upperContext.clearRect(0,0,this.upperCanvas.width,this.upperCanvas.height),this.lowerContext.clearRect(0,0,this.lowerCanvas.width,this.lowerCanvas.height),this.notify("freehand-draw",{prop:"hoverFhd",onPropertyChange:!1,value:{strokeColor:null,strokeWidth:t.penStrokeWidth}}),this.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!(e={freehandSelectedIndex:null}),value:{obj:e}}),this.pointColl[e.freehandSelectedIndex].strokeWidth=t.penStrokeWidth,this.notify("draw",{prop:"render-image",value:{isMouseWheel:null}}),this.notify("draw",{prop:"redrawDownScale"}),this.notify("freehand-draw",{prop:"hoverFhd",onPropertyChange:!1,value:{strokeColor:null,strokeWidth:t.penStrokeWidth}}),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"freehanddrawCustomized",previousObj:o,previousObjColl:o.objColl,previousPointColl:o.pointColl,previousSelPointColl:o.selPointColl,previousCropObj:i,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}})),n.type=AUt.FreehandDraw,{action:"stroke-width",currentShapeSettings:Pe({},n,{},!0)});r.currentShapeSettings.strokeWidth=this.activeObj.strokeSettings.strokeWidth,this.trigger("shapeChange",r),this.editCompleteArgs=r},FUt.prototype.updatePenStrokeColor=function(e){var t=Pe([],this.pointColl,[],!0),i=(this.updateFreehandDrawColorChange(),Pe({},this.cropObj,{},!0)),n={shapeSettingsObj:{}},n=(this.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:n}}),n.shapeSettingsObj),o={currObj:{}},o=(this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:o}}),o.currObj),r=(o.objColl=Pe([],this.objColl,[],!0),o.pointColl=Pe([],this.pointColl,[],!0),o.afterCropActions=Pe([],this.afterCropActions,[],!0),{selPointColl:null}),r=(this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:r}}),o.selPointColl=Pe([],r.selPointColl,[],!0),this.pointColl=t,this.notify("selection",{prop:"setFreehandDrawCustomized",value:{isFreehandDrawCustomized:!0}}),this.activeObj.strokeSettings.strokeColor=e,{freehandSelectedIndex:null}),t=(this.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!1,value:{obj:r}}),null!=r.freehandSelectedIndex&&(this.upperContext.clearRect(0,0,this.upperCanvas.width,this.upperCanvas.height),this.notify("draw",{prop:"render-image",value:{isMouseWheel:null}}),this.notify("draw",{prop:"redrawDownScale"}),this.notify("freehand-draw",{prop:"hoverFhd",onPropertyChange:!1,value:{strokeColor:null,strokeWidth:null}})),{bool:!1}),t=(this.notify("selection",{prop:"getFreehandDrawEditing",onPropertyChange:!1,value:{obj:t}}),t.bool?(this.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!(r={freehandSelectedIndex:null}),value:{obj:r}}),this.upperContext.clearRect(0,0,this.upperCanvas.width,this.upperCanvas.height),this.pointColl[r.freehandSelectedIndex].strokeColor=e,this.notify("freehand-draw",{prop:"hoverFhd",onPropertyChange:!1,value:{strokeColor:e}}),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"freehanddrawCustomized",previousObj:o,previousObjColl:o.objColl,previousPointColl:o.pointColl,previousSelPointColl:o.selPointColl,previousCropObj:i,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}})):this.togglePen||this.notify("selection",{prop:"redrawShape",value:{obj:this.activeObj}}),n.type=AUt.FreehandDraw,{action:"stroke-color",currentShapeSettings:Pe({},n,{},!0)});t.currentShapeSettings.strokeColor=e,this.trigger("shapeChange",t),this.editCompleteArgs=t},FUt.prototype.updateStrokeWidth=function(e,t,i){var n,o,r,s,a;this.activeObj.shape&&("path"!==this.activeObj.shape||"path"===this.activeObj.shape&&0<this.activeObj.pointColl.length)?(this.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!(n={shapeSettingsObj:{}}),value:{obj:n}}),n=n.shapeSettingsObj,o=!1,r=this.objColl.length,this.notify("shape",{prop:"pushActItemIntoObj"}),r!==this.objColl.length&&(o=!0),r=Pe({},this.cropObj,{},!0),this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(s={currObj:{}}),value:{object:s}}),(s=s.currObj).objColl=Pe([],this.objColl,[],!0),s.pointColl=Pe([],this.pointColl,[],!0),s.afterCropActions=Pe([],this.afterCropActions,[],!0),this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(a={selPointColl:null}),value:{obj:a}}),s.selPointColl=Pe([],a.selPointColl,[],!0),o&&this.objColl.pop(),this.activeObj.strokeSettings["width"===t?"text"===i?"outlineWidth":"strokeWidth":"radius"]=parseInt(e,10),"rectangle"!==this.activeObj.shape&&"ellipse"!==this.activeObj.shape||(this.activeObj.strokeSettings["width"===t?"text"===i?"outlineWidth":"strokeWidth":"radius"]=parseInt(e,10)-1),this.activeObj.strokeSettings["width"===t?"text"===i?"outlineWidth":"strokeWidth":"radius"]*=2,"width"===t?"text"===i?this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:null,fillColor:null,strokeWidth:null,radius:null,outlineWidth:this.activeObj.strokeSettings.outlineWidth}}):this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:null,fillColor:null,strokeWidth:this.activeObj.strokeSettings.strokeWidth,radius:null,outlineWidth:null}}):this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:null,fillColor:null,strokeWidth:null,radius:this.activeObj.strokeSettings.radius}}),this.objColl.push(this.activeObj),0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:s,previousObjColl:s.objColl,previousPointColl:s.pointColl,previousSelPointColl:s.selPointColl,previousCropObj:r,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("selection",{prop:"redrawShape",value:{obj:this.objColl[this.objColl.length-1]}}),(a={action:"stroke-width",currentShapeSettings:Pe({},n,{},!0)}).currentShapeSettings["width"===t?"text"===i?"outlineWidth":"strokeWidth":"radius"]=this.activeObj.strokeSettings["width"===t?"text"===i?"outlineWidth":"strokeWidth":"radius"],this.trigger("shapeChange",a),this.editCompleteArgs=a):this.activeObj.shape&&"path"===this.activeObj.shape&&0===this.activeObj.pointColl.length&&(this.activeObj.strokeSettings.strokeWidth=parseInt(e,10),this.activeObj.strokeSettings.strokeWidth*=2,"width"===t?"text"===i?this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:null,fillColor:null,strokeWidth:null,radius:null,outlineWidth:this.activeObj.strokeSettings.outlineWidth}}):this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:null,fillColor:null,strokeWidth:this.activeObj.strokeSettings.strokeWidth,radius:null,outlineWidth:null}}):this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:null,fillColor:null,strokeWidth:null,radius:this.activeObj.strokeSettings.radius}}))},FUt.prototype.updateStrokeColor=function(e){var t,i,n,o={shapeSettingsObj:{}},o=(this.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:o}}),o.shapeSettingsObj),r=(this.activeObj.shape&&("path"!==this.activeObj.shape||"path"===this.activeObj.shape&&0<this.activeObj.pointColl.length)?(t=!1,i=this.objColl.length,this.notify("shape",{prop:"pushActItemIntoObj"}),i!==this.objColl.length&&(t=!0),i=Pe({},this.cropObj,{},!0),this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(n={currObj:{}}),value:{object:n}}),(n=n.currObj).objColl=Pe([],this.objColl,[],!0),n.pointColl=Pe([],this.pointColl,[],!0),n.afterCropActions=Pe([],this.afterCropActions,[],!0),this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(r={selPointColl:null}),value:{obj:r}}),n.selPointColl=Pe([],r.selPointColl,[],!0),t&&this.objColl.pop(),this.activeObj.strokeSettings.strokeColor=e,this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:this.activeObj.strokeSettings.strokeColor,fillColor:null,strokeWidth:null}}),this.togglePen||(this.objColl.push(this.activeObj),0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:n,previousObjColl:n.objColl,previousPointColl:n.pointColl,previousSelPointColl:n.selPointColl,previousCropObj:i,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("selection",{prop:"redrawShape",value:{obj:this.objColl[this.objColl.length-1]}}))):this.activeObj.shape&&"path"===this.activeObj.shape&&0===this.activeObj.pointColl.length&&(this.activeObj.strokeSettings.strokeColor=e,this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:this.activeObj.strokeSettings.strokeColor,fillColor:null,strokeWidth:null}})),{action:"stroke-color",currentShapeSettings:Pe({},o,{},!0)});r.currentShapeSettings.strokeColor=e,this.trigger("shapeChange",r),this.editCompleteArgs=r},FUt.prototype.updateFillColor=function(e){var t={shapeSettingsObj:{}},t=(this.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:t}}),t.shapeSettingsObj),i=!1,n=this.objColl.length,n=(this.notify("shape",{prop:"pushActItemIntoObj"}),n!==this.objColl.length&&(i=!0),Pe({},this.cropObj,{},!0)),o={currObj:{}},o=(this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:o}}),o.currObj),r=(o.objColl=Pe([],this.objColl,[],!0),o.pointColl=Pe([],this.pointColl,[],!0),o.afterCropActions=Pe([],this.afterCropActions,[],!0),{selPointColl:null}),r=(this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:r}}),o.selPointColl=Pe([],r.selPointColl,[],!0),i&&this.objColl.pop(),this.activeObj.strokeSettings.fillColor=e,this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:null,fillColor:this.activeObj.strokeSettings.fillColor,strokeWidth:null}}),this.objColl.push(this.activeObj),0===this.activeObj.activePoint.width&&0===this.activeObj.activePoint.height||this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:o,previousObjColl:o.objColl,previousPointColl:o.pointColl,previousSelPointColl:o.selPointColl,previousCropObj:n,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("selection",{prop:"redrawShape",value:{obj:this.objColl[this.objColl.length-1]}}),{action:"fill-color",currentShapeSettings:Pe({},t,{},!0)});this.trigger("shapeChange",r),this.editCompleteArgs=r},FUt.prototype.horizontalFlip=function(e,t){je(t)&&(je(this.activeObj.imageRatio)&&this.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),this.notify("shape",{prop:"pushActItemIntoObj"}),i=Pe({},this.cropObj,{},!0),this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(n={currObj:{}}),value:{object:n}}),(n=n.currObj).objColl=Pe([],this.objColl,[],!0),n.pointColl=Pe([],this.pointColl,[],!0),n.afterCropActions=Pe([],this.afterCropActions,[],!0),this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(o={selPointColl:null}),value:{obj:o}}),n.selPointColl=Pe([],o.selPointColl,[],!0),this.objColl.pop()),this.notify("toolbar",{prop:"refreshSlider"}),e.clearRect(0,0,this.activeObj.imageCanvas.width,this.activeObj.imageCanvas.height);var i,n,o=this.duplicateImage();this.notify("draw",{prop:"downScaleImgCanvas",onPropertyChange:!1,value:{ctx:this.activeObj.imageCanvas.getContext("2d"),isImgAnnotation:!0,isHFlip:!0,isVFlip:null}}),this.activeObj.activePoint=o,this.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate"}}),je(t)&&(this.objColl.push(this.activeObj),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"imageHFlip",previousObj:n,previousObjColl:n.objColl,previousPointColl:n.pointColl,previousSelPointColl:n.selPointColl,previousCropObj:i,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("selection",{prop:"redrawShape",value:{obj:this.objColl[this.objColl.length-1]}}))},FUt.prototype.verticalFlip=function(e,t){je(t)&&(je(this.activeObj.imageRatio)&&this.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),this.notify("shape",{prop:"pushActItemIntoObj"}),i=Pe({},this.cropObj,{},!0),this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(n={currObj:{}}),value:{object:n}}),(n=n.currObj).objColl=Pe([],this.objColl,[],!0),n.pointColl=Pe([],this.pointColl,[],!0),n.afterCropActions=Pe([],this.afterCropActions,[],!0),this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(o={selPointColl:null}),value:{obj:o}}),n.selPointColl=Pe([],o.selPointColl,[],!0),this.objColl.pop()),this.notify("toolbar",{prop:"refreshSlider"}),e.clearRect(0,0,this.activeObj.imageCanvas.width,this.activeObj.imageCanvas.height);var i,n,o=this.duplicateImage();this.notify("draw",{prop:"downScaleImgCanvas",onPropertyChange:!1,value:{ctx:this.activeObj.imageCanvas.getContext("2d"),isImgAnnotation:!0,isHFlip:null,isVFlip:!0}}),this.activeObj.activePoint=o,this.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate"}}),je(t)&&(this.objColl.push(this.activeObj),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"imageVFlip",previousObj:n,previousObjColl:n.objColl,previousPointColl:n.pointColl,previousSelPointColl:n.selPointColl,previousCropObj:i,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("selection",{prop:"redrawShape",value:{obj:this.objColl[this.objColl.length-1]}}))},FUt.prototype.rotateImage=function(e){je(this.activeObj.imageRatio)&&this.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),this.notify("shape",{prop:"pushActItemIntoObj"}),t=Pe({},this.cropObj,{},!0);var t,i={currObj:{}},n=(this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:i}}),(i=i.currObj).objColl=Pe([],this.objColl,[],!0),i.pointColl=Pe([],this.pointColl,[],!0),i.afterCropActions=Pe([],this.afterCropActions,[],!0),{selPointColl:null});this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:n}}),i.selPointColl=Pe([],n.selPointColl,[],!0),this.objColl.pop(),this.notify("toolbar",{prop:"refreshSlider"}),"rotleft"===e?this.activeObj.rotatedAngle-=Math.PI/180*90:this.activeObj.rotatedAngle+=Math.PI/180*90,this.notify("selection",{prop:"updPtCollForShpRot",onPropertyChange:!1,value:{obj:this.activeObj}}),this.upperContext.clearRect(0,0,this.upperCanvas.width,this.upperCanvas.height),this.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate"}}),this.objColl.push(this.activeObj),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"imageRotate",previousObj:i,previousObjColl:i.objColl,previousPointColl:i.pointColl,previousSelPointColl:i.selPointColl,previousCropObj:t,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),this.notify("selection",{prop:"redrawShape",value:{obj:this.objColl[this.objColl.length-1]}}),this.notify("toolbar",{prop:"destroy-qa-toolbar"}),this.notify("toolbar",{prop:"renderQAT",onPropertyChange:!1,value:{isPenEdit:null}})},FUt.prototype.pascalToSplitWords=function(e){var t=(e=e.charAt(0).toUpperCase()+e.slice(1)).match(/[A-Z][a-z]+/g);return je(t)?e:t.map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join(" ")},FUt.prototype.getCurrAdjustmentValue=function(e){var t,i={freehandSelectedIndex:null};return this.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!1,value:{obj:i}}),"transparency"===e&&this.togglePen?(this.notify("freehand-draw",{prop:"getPenOpacity",onPropertyChange:!(t={penOpacity:1}),value:{obj:t}}),100*t.penOpacity):"transparency"===e&&null!=i.freehandSelectedIndex?100*this.pointColl[i.freehandSelectedIndex].opacity:(this.notify("filter",{prop:"getAdjustmentLevel",onPropertyChange:!(t={adjustmentLevel:null}),value:{obj:t}}),{brightness:t.adjustmentLevel.brightness,contrast:t.adjustmentLevel.contrast,hue:t.adjustmentLevel.hue,saturation:t.adjustmentLevel.saturation,opacity:t.adjustmentLevel.opacity,blur:t.adjustmentLevel.blur,exposure:t.adjustmentLevel.exposure,transparency:t.adjustmentLevel.transparency,straighten:this.transform.straighten}[""+e])},FUt.prototype.transformSelect=function(e){0!==this.transform.straighten||"rotateleft"!==e&&"rotateright"!==e||!this.activeObj.shape||-1===["crop-2:3","crop-3:2","crop-3:4","crop-4:3","crop-4:5","crop-5:4","crop-5:7","crop-7:5","crop-9:16","crop-16:9"].indexOf(this.activeObj.shape)&&(-1===this.activeObj.shape.indexOf("crop-")||"crop-custom"===this.activeObj.shape||"crop-square"===this.activeObj.shape||"crop-circle"===this.activeObj.shape)||(this.activeObj.shape="crop-"+this.activeObj.shape.split("-")[1].split(":")[1]+":"+this.activeObj.shape.split("-")[1].split(":")[0],this.notify("toolbar",{prop:"performCropTransformClick",value:{shape:this.activeObj.shape,isTransform:!0}})),this.isCropToolbar=!0,this.allowDownScale=!1;var t=this.transform.straighten,i=Pe({},this.activeObj,{},!0),n=this.transform.zoomFactor,o=(this.prevEventSelectionPoint=Pe({},this.activeObj,{},!0),{currObj:{}}),o=(this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:o}}),this.prevEventObjPoint=o.currObj,this.prevEventObjPoint.objColl=Pe([],this.objColl,[],!0),this.prevEventObjPoint.pointColl=Pe([],this.pointColl,[],!0),this.prevEventObjPoint.afterCropActions=Pe([],this.afterCropActions,[],!0),{selPointColl:null});if(this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!1,value:{obj:o}}),this.prevEventObjPoint.selPointColl=Pe([],o.selPointColl,[],!0),0!==this.transform.straighten){this.transform.straighten=0,this.straightenBaseImageCanvas();for(var r=0,s=this.objColl.length;r<s;r++)"line"!==(a=this.objColl[r].shape)&&"arrow"!==a&&"path"!==a&&(this.objColl[r].rotatedAngle-=t*(Math.PI/180),this.notify("selection",{prop:"updPtCollForShpRot",onPropertyChange:!1,value:{obj:this.objColl[r]}}));this.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}}),this.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}})}this.setInitialZoomState();o=Pe({},this.activeObj,{},!0);if(this.notify("crop",{prop:"setTransformCrop",onPropertyChange:!1,value:{bool:!0}}),this.cropSelectedState(),this.notify("crop",{prop:"setTransformCrop",onPropertyChange:!1,value:{bool:!1}}),this.notify("draw",{prop:"resetCurrentSelectionPoint"}),this.updateImageTransformColl(e),this.notify("transform",{prop:"performTransformation",value:{text:e}}),this.isCropTab=!0,this.notify("draw",{prop:"moveToSelectionRange",value:{type:e,activeObj:o}}),!this.isStraightening||"horizontalflip"!==e&&"verticalflip"!==e||(this.notify("draw",{prop:"resetStraightenDestPoints"}),this.notify("draw",{prop:"setDestForStraighten"})),0!==t){this.transform.straighten=t,this.straightenBaseImageCanvas();for(var a,r=0,s=this.objColl.length;r<s;r++)"line"!==(a=this.objColl[r].shape)&&"arrow"!==a&&"path"!==a&&(this.objColl[r].rotatedAngle+=t*(Math.PI/180),this.notify("selection",{prop:"updPtCollForShpRot",onPropertyChange:!1,value:{obj:this.objColl[r]}}));this.notify("shape",{prop:"drawAnnotations",onPropertyChange:!1,value:{ctx:this.lowerContext,shape:"zoom",pen:"zoom",isPreventApply:null}}),this.notify("draw",{prop:"render-image",value:{isMouseWheel:!1}}),this.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:i}}),this.notify("draw",{prop:"setStraightenActObj",value:{activeObj:null}}),this.notify("draw",{prop:"setStraightenInitZoom",value:{zoomFactor:n}}),(this.isStraightening&&("horizontalflip"===e||"verticalflip"===e)&&je(this.transform.zoomFactor)||0===this.transform.zoomFactor)&&(0===this.transform.degree?this.transform.zoomFactor+=.025:0===this.transform.zoomFactor&&(this.transform.zoomFactor=null)),this.notify("draw",{prop:"zoomToSel",value:{activeObj:i,isToolbar:!1}})}this.isCropToolbar=!1;o=this.element.querySelector(".e-ie-straighten-value-span");o&&(o.innerHTML=this.transform.straighten.toString()+"&#176")},FUt.prototype.getDefaultFilter=function(){return"brightness(1) contrast(100%) hue-rotate(0deg) saturate(100%) opacity(1) blur(0px) sepia(0%) grayscale(0%) invert(0%)"},FUt.prototype.setStraighten=function(e){var e={cancel:!1,previousDegree:this.transform.straighten,currentDegree:e};this.trigger("rotating",e),(this.editCompleteArgs=e).cancel||(this.performStraighten(e),e={action:"straighten",actionEventArgs:this.editCompleteArgs},this.triggerEditCompleteEvent(e))},FUt.prototype.duplicateImage=function(){var e=Pe({},this.activeObj.activePoint,{},!0),t={width:0,height:0};return this.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!1,value:{width:this.activeObj.imageElement.width,height:this.activeObj.imageElement.height,obj:t,isImgShape:null}}),this.activeObj.activePoint.width=t.width,this.activeObj.activePoint.height=t.height,e},FUt.prototype.performStraighten=function(e){var e=e.currentDegree,t=this.element.querySelector(".e-ie-straighten-value-span"),t=(t&&(t.innerHTML=e.toString()+"&#176"),Pe({},this.activeObj,null,!0));this.notify("freehand-draw",{prop:"setCenterSelPoints"}),this.transform.straighten=e,this.straightenPoint={x:this.activeObj.activePoint.startX+this.activeObj.activePoint.width/2,y:this.activeObj.activePoint.startY+this.activeObj.activePoint.height/2},this.straightenBaseImageCanvas();for(var i=0,n=this.objColl.length;i<n;i++){var o=this.objColl[i].shape;"line"!==o&&"arrow"!==o&&"path"!==o&&(this.objColl[i].rotatedAngle+=(this.transform.straighten-this.prevStraightenedDegree)*(Math.PI/180),this.notify("selection",{prop:"updPtCollForShpRot",onPropertyChange:!1,value:{obj:this.objColl[i]}}))}this.transform.degree%90==0&&this.transform.degree%180!=0?(0===this.transform.straighten&&(this.transform.straighten=360),this.notify("draw",{prop:"performPointZoom",onPropertyChange:!1,value:{x:this.activeObj.activePoint.startX+this.activeObj.activePoint.width/2,y:this.activeObj.activePoint.startY+this.activeObj.activePoint.height/2,type:"zoomIn",isResize:!0}}),this.notify("draw",{prop:"performPointZoom",onPropertyChange:!1,value:{x:this.activeObj.activePoint.startX+this.activeObj.activePoint.width/2,y:this.activeObj.activePoint.startY+this.activeObj.activePoint.height/2,type:"zoomOut",isResize:!0}}),360===this.transform.straighten&&(this.transform.straighten=0)):this.notify("draw",{prop:"render-image",value:{isMouseWheel:!0,isPreventClearRect:null,isFrame:null,isStraighten:!0}}),this.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:t}}),this.notify("draw",{prop:"zoomToSel",value:{activeObj:t,isToolbar:!0}}),this.notify("transform",{prop:"disableZoomOutBtn",value:{isZoomOut:!0}}),this.prevStraightenedDegree=this.transform.straighten},FUt.prototype.straightenBaseImageCanvas=function(){var e,t,i,n;this.isImageLoaded&&(e="horizontal"===(e=this.getStraightenFlipState())||"vertical"===e?-this.transform.straighten:this.transform.straighten,i=void((t=this.baseImgCanvas.getContext("2d")).canvas.width!==this.lowerContext.canvas.width&&t.canvas.height!==this.lowerContext.canvas.height&&this.notify("crop",{prop:"calcRatio",onPropertyChange:!1,value:{obj:{width:0,height:0},dimension:{width:t.canvas.width,height:t.canvas.height}}})),i=this.getRotatedCanvasDim(this.baseImg.width,this.baseImg.height,this.transform.straighten),this.img.srcWidth=t.canvas.width=i.width,this.img.srcHeight=t.canvas.height=i.height,i=t.canvas.width/2,n=t.canvas.height/2,t.clearRect(0,0,t.canvas.width,t.canvas.height),t.translate(i,n),t.rotate(e*Math.PI/180),t.drawImage(this.baseImg,-this.baseImg.width/2,-this.baseImg.height/2,this.baseImg.width,this.baseImg.height),t.setTransform(1,0,0,1,0,0),this.notify("crop",{prop:"calcRatio",onPropertyChange:!1,value:{obj:{width:0,height:0},dimension:{width:t.canvas.width,height:t.canvas.height}}}))},FUt.prototype.getRotatedCanvasDim=function(e,t,i){var i=i*Math.PI/180,n=Math.cos(i),o=Math.sin(i),r=Math.min(0,e*n,t*Math.cos(Math.PI/2-i),e*n+t*Math.cos(Math.PI/2-i)),n=Math.max(0,e*n,t*Math.cos(Math.PI/2-i),e*n+t*Math.cos(Math.PI/2-i)),s=Math.min(0,e*o,t*Math.sin(Math.PI/2-i),e*o+t*Math.sin(Math.PI/2-i)),e=Math.max(0,e*o,t*Math.sin(Math.PI/2-i),e*o+t*Math.sin(Math.PI/2-i));return{width:Math.ceil(n-r),height:Math.ceil(e-s)}},FUt.prototype.updateShapeOrder=function(e,t){var i,n,o,r,e=this.getObjFromId(e);e.shape&&("path"!==e.shape||"path"===e.shape&&0<e.pointColl.length)||e&&e.id&&-1<e.id.indexOf("pen")?(this.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!(i={shapeSettingsObj:{}}),value:{obj:i}}),i=i.shapeSettingsObj,e.shape&&this.notify("shape",{prop:"pushActItemIntoObj"}),n=Pe({},this.cropObj,{},!0),this.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(o={currObj:{}}),value:{object:o}}),(o=o.currObj).objColl=Pe([],this.objColl,[],!0),o.pointColl=Pe([],this.pointColl,[],!0),o.afterCropActions=Pe([],this.afterCropActions,[],!0),this.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(r={selPointColl:null}),value:{obj:r}}),o.selPointColl=Pe([],r.selPointColl,[],!0),e.shape&&this.objColl.pop(),this.notify("shape",{prop:"z-order",onPropertyChange:!1,value:{obj:e,value:t}}),e.shape&&(this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:null,fillColor:null,strokeWidth:e.strokeSettings.strokeWidth}}),this.objColl.push(e)),this.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:o,previousObjColl:o.objColl,previousPointColl:o.pointColl,previousSelPointColl:o.selPointColl,previousCropObj:n,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),e.shape&&(this.notify("selection",{prop:"redrawShape",value:{obj:this.objColl[this.objColl.length-1]}}),this.activeObj.order=e.order),{action:"stroke-width",previousShapeSettings:Pe({},i,{},!0),currentShapeSettings:Pe({},i,{},!0)}.currentShapeSettings.strokeWidth=this.activeObj.strokeSettings.strokeWidth):this.activeObj.shape&&"path"===this.activeObj.shape&&0===this.activeObj.pointColl.length&&this.notify("shape",{prop:"setStrokeSettings",value:{strokeSettings:null,strokeColor:null,fillColor:null,strokeWidth:this.activeObj.strokeSettings.strokeWidth}})},FUt.prototype.getStraightenFlipState=function(){var e="";if(0<this.rotateFlipColl.length)for(var t=0,i=this.rotateFlipColl.length;t<i;t++){var n=this.rotateFlipColl[t];"horizontal"===n?e+="horizontal":"vertical"===n&&(e+="vertical"),"horizontalvertical"!==e&&"verticalhorizontal"!==e||(e="")}return e},FUt.prototype.initializeZoomSettings=function(){this.theme=je(this.theme)?"Bootstrap5":this.theme,!je(this.zoomSettings.zoomTrigger)&&0!==this.zoomSettings.zoomTrigger||(this.zoomSettings.zoomTrigger=xUt.MouseWheel|xUt.Pinch|xUt.Toolbar|xUt.Commands),je(this.selectionSettings.strokeColor)&&(this.selectionSettings.strokeColor=this.themeColl[this.theme].primaryColor),je(this.selectionSettings.fillColor)&&(this.selectionSettings.fillColor=this.themeColl[this.theme].secondaryColor)},FUt.prototype.initializeThemeColl=function(){this.themeColl={Bootstrap5:{primaryColor:"#0d6efd",secondaryColor:"#fff"},Bootstrap5Dark:{primaryColor:"#0d6efd",secondaryColor:"#fff"},Tailwind:{primaryColor:"#4f46e5",secondaryColor:"#fff"},TailwindDark:{primaryColor:"#22d3ee",secondaryColor:"#fff"},Fluent:{primaryColor:"#0078d4",secondaryColor:"#fff"},FluentDark:{primaryColor:"#0078d4",secondaryColor:"#fff"},Bootstrap4:{primaryColor:"#007bff",secondaryColor:"#fff"},Bootstrap:{primaryColor:"#317ab9",secondaryColor:"#fff"},BootstrapDark:{primaryColor:"#317ab9",secondaryColor:"#fff"},Material:{primaryColor:"#e3165b",secondaryColor:"#fff"},MaterialDark:{primaryColor:"#00b0ff",secondaryColor:"#fff"},Fabric:{primaryColor:"#0078d6",secondaryColor:"#fff"},FabricDark:{primaryColor:"#0074cc",secondaryColor:"#fff"},Highcontrast:{primaryColor:"#000000",secondaryColor:"#fff"},Material3:{primaryColor:"#6750a4",secondaryColor:"#fff"},Material3Dark:{primaryColor:"#d0bcff",secondaryColor:"#fff"},Fluent2:{primaryColor:"#0f6cbd",secondaryColor:"#fff"},Fluent2Dark:{primaryColor:"#115ea3",secondaryColor:"#fff"},Fluent2Highcontrast:{primaryColor:"#1aebff",secondaryColor:"#fff"},"Bootstrap5.3":{primaryColor:"#0d6efd",secondaryColor:"#fff"},"Bootstrap5.3Dark":{primaryColor:"#0d6efd",secondaryColor:"#fff"},Tailwind3:{primaryColor:"#4f46e5",secondaryColor:"#ffffff"},Tailwind3Dark:{primaryColor:"#6366f1",secondaryColor:"#ffffff03"}}},FUt.prototype.drawRedact=function(e,t,i,n,o,r){var s=!1,a=this.allowShape(t,i);return!this.disabled&&this.isImageLoaded&&(a||je(t)&&je(i))&&(s=!0,this.manageActiveAction(),this.notify("shape",{prop:"drawRedact",onPropertyChange:!1,value:{x:t,y:i,width:n,height:o,type:e,value:r}}),this.notify("draw",{prop:"redrawDownScale"})),s},WOt([e("")],FUt.prototype,"cssClass",void 0),WOt([e(!1)],FUt.prototype,"disabled",void 0),WOt([e("100%")],FUt.prototype,"height",void 0),WOt([e("Bootstrap5")],FUt.prototype,"theme",void 0),WOt([e()],FUt.prototype,"toolbar",void 0),WOt([e()],FUt.prototype,"toolbarTemplate",void 0),WOt([e("100%")],FUt.prototype,"width",void 0),WOt([e(!0)],FUt.prototype,"allowUndoRedo",void 0),WOt([e(!0)],FUt.prototype,"showQuickAccessToolbar",void 0),WOt([e()],FUt.prototype,"quickAccessToolbarTemplate",void 0),WOt([e(!1)],FUt.prototype,"isReadOnly",void 0),WOt([e(!1)],FUt.prototype,"enableRtl",void 0),WOt([e(!1)],FUt.prototype,"enablePersistence",void 0),WOt([t({},XOt)],FUt.prototype,"finetuneSettings",void 0),WOt([t({},ZOt)],FUt.prototype,"zoomSettings",void 0),WOt([t({},tNt)],FUt.prototype,"selectionSettings",void 0),WOt([t({},oNt)],FUt.prototype,"fontFamily",void 0),WOt([t({},qOt)],FUt.prototype,"uploadSettings",void 0),WOt([i()],FUt.prototype,"beforeSave",void 0),WOt([i()],FUt.prototype,"created",void 0),WOt([i()],FUt.prototype,"destroyed",void 0),WOt([i()],FUt.prototype,"zooming",void 0),WOt([i()],FUt.prototype,"panning",void 0),WOt([i()],FUt.prototype,"cropping",void 0),WOt([i()],FUt.prototype,"rotating",void 0),WOt([i()],FUt.prototype,"flipping",void 0),WOt([i()],FUt.prototype,"shapeChanging",void 0),WOt([i()],FUt.prototype,"selectionChanging",void 0),WOt([i()],FUt.prototype,"fileOpened",void 0),WOt([i()],FUt.prototype,"saved",void 0),WOt([i()],FUt.prototype,"toolbarCreated",void 0),WOt([i()],FUt.prototype,"toolbarUpdating",void 0),WOt([i()],FUt.prototype,"toolbarItemClicked",void 0),WOt([i()],FUt.prototype,"imageFiltering",void 0),WOt([i()],FUt.prototype,"finetuneValueChanging",void 0),WOt([i()],FUt.prototype,"click",void 0),WOt([i()],FUt.prototype,"shapeChange",void 0),WOt([i()],FUt.prototype,"quickAccessToolbarOpen",void 0),WOt([i()],FUt.prototype,"resizing",void 0),WOt([i()],FUt.prototype,"quickAccessToolbarItemClick",void 0),WOt([i()],FUt.prototype,"frameChange",void 0),WOt([i()],FUt.prototype,"editComplete",void 0);var bUt,wUt,CUt,SUt,AUt,xUt,IUt,TUt,EUt,DUt,MUt,kUt,PUt,BUt,aNt=wUt=WOt([Bt],FUt);function FUt(e,t){e=bUt.call(this,e)||this;return e.isImageLoaded=!1,e.activeObj={activePoint:{startX:0,startY:0,endX:0,endY:0,width:0,height:0},flipObjColl:[],triangle:[],triangleRatio:[],rotatedAngle:0,opacity:1,order:null},e.currObjType={shape:"",isDragging:!1,isActiveObj:!1,isText:!1,isInitialText:!1,isLine:!1,isInitialLine:!1,isCustomCrop:!1,isZoomed:!1,isUndoZoom:!1,isUndoAction:!1,isFiltered:!1,isSave:!1,isResize:!1,isRedact:!1},e.objColl=[],e.pointColl={},e.freehandCounter=0,e.points=[],e.togglePen=!1,e.togglePan=!1,e.img={destLeft:0,destTop:0,destWidth:0,destHeight:0,srcLeft:0,srcTop:0,srcWidth:0,srcHeight:0},e.rotateFlipColl=[],e.cropObj={cropZoom:0,defaultZoom:0,totalPannedPoint:{x:0,y:0},totalPannedClientPoint:{x:0,y:0},totalPannedInternalPoint:{x:0,y:0},tempFlipPanPoint:{x:0,y:0},activeObj:{},rotateFlipColl:[],degree:0,currFlipState:"",straighten:0,destPoints:{startX:0,startY:0,width:0,height:0},srcPoints:{startX:0,startY:0,width:0,height:0},filter:"",isBrightAdjust:!1,zoomFactor:0,previousZoomValue:0,aspectWidth:null,aspectHeight:null,frame:"none",straightenZoom:0,adjustmentLevel:{brightness:0,contrast:0,hue:0,opacity:100,saturation:0,blur:0,exposure:0,transparency:100,sharpen:!1,bw:!1},currentFilter:""},e.afterCropActions=[],e.transform={degree:0,currFlipState:"",zoomFactor:0,cropZoomFactor:null,defaultZoomFactor:0,straighten:0},e.panPoint={currentPannedPoint:{x:0,y:0},totalPannedPoint:{x:0,y:0},totalPannedInternalPoint:{x:0,y:0},totalPannedClientPoint:{x:0,y:0}},e.isUndoRedo=!1,e.isCropTab=!1,e.isCircleCrop=!1,e.fontSizeColl=[],e.initialAdjustmentValue="",e.currentFilter="",e.canvasFilter="brightness(1) contrast(100%) hue-rotate(0deg) saturate(100%) opacity(1) blur(0px) sepia(0%) grayscale(0%) invert(0%)",e.toolbarHeight=0,e.isPublicMethod=!1,e.isCropToolbar=!1,e.cursor="default",e.resizeSrc={startX:e.img.srcLeft,startY:e.img.srcTop,width:e.img.srcWidth,height:e.img.srcHeight},e.isResize=!1,e.isAspectRatio=!1,e.frameObj={type:"none",color:"#fff",size:20,inset:20,offset:20,radius:0,amount:1,border:"solid",gradientColor:""},e.tempFrameObj={type:"none",color:"#fff",size:20,inset:20,offset:20,radius:0,amount:1,border:"solid",gradientColor:""},e.allowDownScale=!0,e.gradientColor="",e.size=20,e.inset=0,e.offset=0,e.borderRadius=0,e.lineCount=0,e.prevStraightenedDegree=0,e.tempStraighten=0,e.isStraightening=!1,e.isFinetuning=!1,e.isZoomBtnClick=!1,e.isFinetuneBtnClick=!1,e.isFilterCanvasClick=!1,e.isFrameBtnClick=!1,e.isChangesSaved=!1,e.isShapeDrawing=!1,e.noPushUndo=!1,e.isUndoRedoStack=!1,e.shapeColl=[],e.isKBDNavigation=!1,e.isMaskImage=!1,e.tempObjColl=[],e.tempPointColl=[],e.tempShapeColl=[],e.isImageUpdated=!1,e.noRedact=!1,e.tempRedactBlur=50,e.tempRedactPixel=40,e.tempToolbarHeight=0,e.tempToolbar=[],wUt.Inject(j6t,q6t,eUt,oUt,Y6t,LUt),wUt.Inject(sUt),wUt.Inject(K6t),wUt.Inject(iUt),wUt.Inject(Z6t),t&&e.appendTo(t),e}(dNt=CUt=CUt||{}).Png="Png",dNt.Jpeg="Jpeg",dNt.Svg="Svg",dNt.WebP="WebP",(uNt=SUt=SUt||{}).Horizontal="Horizontal",uNt.Vertical="Vertical",(fNt=AUt=AUt||{}).Rectangle="Rectangle",fNt.Ellipse="Ellipse",fNt.Line="Line",fNt.Arrow="Arrow",fNt.Path="Path",fNt.Text="Text",fNt.FreehandDraw="FreehandDraw",fNt.Image="Image",(bNt=xUt=xUt||{})[bNt.MouseWheel=1]="MouseWheel",bNt[bNt.Pinch=2]="Pinch",bNt[bNt.Commands=4]="Commands",bNt[bNt.Toolbar=8]="Toolbar",(SNt=IUt=IUt||{}).Bootstrap5="Bootstrap5",SNt.Bootstrap5Dark="Bootstrap5Dark",SNt.Tailwind="Tailwind",SNt.TailwindDark="TailwindDark",SNt.Fluent="Fluent",SNt.FluentDark="FluentDark",SNt.Bootstrap4="Bootstrap4",SNt.Bootstrap="Bootstrap",SNt.BootstrapDark="BootstrapDark",SNt.Material="Material",SNt.MaterialDark="MaterialDark",SNt.Fabric="Fabric",SNt.FabricDark="FabricDark",SNt.Highcontrast="Highcontrast",SNt.Fluent2="Fluent2",SNt.Fluent2Dark="Fluent2Dark",SNt.Tailwind3="Tailwind3",SNt.Tailwind3Dark="Tailwind3Dark",(INt=TUt=TUt||{}).Crop="Crop",INt.Transform="Transform",INt.Annotate="Annotate",INt.ZoomIn="ZoomIn",INt.ZoomOut="ZoomOut",INt.Open="Open",INt.Reset="Reset",INt.Save="Save",INt.Pan="Pan",INt.Move="Move",INt.Pen="Pen",INt.Line="Line",INt.Arrow="Arrow",INt.Path="Path",INt.Rectangle="Rectangle",INt.Image="Image",INt.Ellipse="Ellipse",INt.Text="Text",INt.CustomSelection="CustomSelection",INt.CircleSelection="CircleSelection",INt.SquareSelection="SquareSelection",INt.RatioSelection="RatioSelection",INt.RotateLeft="RotateLeft",INt.RotateRight="RotateRight",INt.FlipHorizontal="FlipHorizontal",INt.FlipVertical="FlipVertical",INt.Undo="Undo",INt.Redo="Redo",INt.None="None",INt.Mat="Mat",INt.Bevel="Bevel",INt.Inset="Inset",INt.Hook="Hook",INt.Finetune="Finetune",INt.Filter="Filter",INt.Frame="Frame",INt.Resize="Resize",INt.HorizontalFlip="HorizontalFlip",INt.VerticalFlip="VerticalFlip",INt.Brightness="Brightness",INt.Contrast="Contrast",INt.Hue="Hue",INt.Saturation="Saturation",INt.Opacity="Opacity",INt.Blur="Blur",INt.Exposure="Exposure",INt.Default="Default",INt.Chrome="Chrome",INt.Cold="Cold",INt.Warm="Warm",INt.Grayscale="Grayscale",INt.Sepia="Sepia",INt.Invert="Invert",INt.Straightening="Straightening",(DNt=EUt=EUt||{}).Default="Default",DNt.Chrome="Chrome",DNt.Cold="Cold",DNt.Warm="Warm",DNt.Grayscale="Grayscale",DNt.Sepia="Sepia",DNt.Invert="Invert",(PNt=DUt=DUt||{}).Brightness="Brightness",PNt.Contrast="Contrast",PNt.Hue="Hue",PNt.Saturation="Saturation",PNt.Exposure="Exposure",PNt.Opacity="Opacity",PNt.Blur="Blur",(LNt=MUt=MUt||{}).None="None",LNt.Arrow="Arrow",LNt.SolidArrow="SolidArrow",LNt.Circle="Circle",LNt.SolidCircle="SolidCircle",LNt.Square="Square",LNt.SolidSquare="SolidSquare",LNt.Bar="Bar",(NNt=kUt=kUt||{}).None="None",NNt.Mat="Mat",NNt.Bevel="Bevel",NNt.Line="Line",NNt.Inset="Inset",NNt.Hook="Hook",(HNt=PUt=PUt||{}).Solid="Solid",HNt.Dashed="Dashed",HNt.Dotted="Dotted",(WNt=BUt=BUt||{}).Blur="Blur",WNt.Pixelate="Pixelate";RUt.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},RUt.prototype.addEventListener=function(){this.parent.on("toolbar",this.toolbar,this),this.parent.on("destroyed",this.destroy,this)},RUt.prototype.removeEventListener=function(){this.parent.off("toolbar",this.toolbar),this.parent.off("destroyed",this.destroy)},RUt.prototype.initLocale=function(){this.defaultLocale={Crop:"Crop",ZoomIn:"Zoom In",ZoomOut:"Zoom Out",Undo:"Undo",Redo:"Redo",Transform:"Transform",Annotation:"Annotation",Finetune:"Finetune",Brightness:"Brightness",Contrast:"Contrast",Hue:"Hue",Saturation:"Saturation",Opacity:"Opacity",Blur:"Blur",Sharpen:"Sharpen",Exposure:"Exposure",Filter:"Filter",Default:"Default",Chrome:"Chrome",Cold:"Cold",Warm:"Warm",Grayscale:"Grayscale",BlackAndWhite:"Black and White",Sepia:"Sepia",Invert:"Invert",Text:"Add Text",Pen:"Pen",Reset:"Reset",Save:"Save",Select:"Select",RotateLeft:"Rotate Left",RotateRight:"Rotate Right",HorizontalFlip:"Horizontal Flip",VerticalFlip:"Vertical Flip",OK:"Apply",Cancel:"Discard",FillColor:"Fill Color",StrokeColor:"Stroke Color",StrokeWidth:"Stroke Width",FontFamily:"Font Family",FontStyle:"Font Style",FontSize:"Font Size",FontColor:"Font Color",Pan:"Pan",Move:"Move",Load:"Load",Custom:"Custom",Square:"Square",Circle:"Circle",Ellipse:"Ellipse",Rectangle:"Rectangle",Line:"Line",Arrow:"Arrow",Path:"Path",Bold:"Bold",Italic:"Italic",BoldItalic:"Bold Italic",XSmall:"X-Small",Small:"Small",Medium:"Medium",Large:"Large",XLarge:"X-Large",ABC:"ABC",Browse:"Browse",Duplicate:"Duplicate",Remove:"Remove",EditText:"Edit Text",Start:"Start",End:"End",Bar:"Bar",ArrowSolid:"Arrow Solid",CircleSolid:"Circle Solid",SquareSolid:"Square Solid",None:"None",CropAndTransform:"Crop and Transform",CropSelection:"Crop Selection",Image:"Add Image",Transparency:"Transparency",Height:"Height",Width:"Width",AspectRatio:"Maintain aspect ratio",W:"W",H:"H",DragText:"Drag and drop your image here or",DropText:"Drop your image here or",BrowseText:"Browse here...",SupportText:"Supports:",Frame:"Frame",Mat:"Mat",Bevel:"Bevel",Inset:"Inset",Hook:"Hook",Color:"Color",Size:"Size",Offset:"Offset",Radius:"Radius",Amount:"Amount",Resize:"Resize",0:"0%",20:"20%",40:"40%",60:"60%",80:"80%",100:"100%",1:"1",2:"2",3:"3",4:"4",5:"5",Border:"Border",Solid:"Solid",Dashed:"Dashed",Dotted:"Dotted",GradientColor:"Gradient Color",ConfirmDialogHeader:"Confirm Save Changes",ConfirmDialogContent:"Do you want to save the changes you made to the image?",AlertDialogHeader:"Unsupported file",AlertDialogContent:"The selected file is unsupported.",MinMaxSize:"with file size between",MinMaxSizeAlert:"File size between",MinSize:"with minimum file size of",MinSizeAlert:"A minimum file size of",MaxSize:"with maximum file size of",MaxSizeAlert:"A maximum file size of",To:"to",Bytes:"bytes",Yes:"Yes",No:"No",ImageErrorDialogHeader:"Image Selection Error",ImageErrorDialogContent:"Please select only one image to open.",Straighten:"Straighten",NoOutline:"No outline",DlgOK:"OK",SaveAs:"Save As",ImageName:"Image name",Format:"Format",Quality:"Quality",Download:"Download",Close:"Close",ImageSize:"Image Size",QualityInfo:"The image quality option is only available for JPEG format",Good:"Good",Great:"Great",Highest:"Highest",BringForward:"Bring Forward",SendBackward:"Send Backward",SendToBack:"Send to Back",BringToFront:"Bring to Front",ZOrder:"Z-Order",Redact:"Redact",Pixelate:"Pixelate",BorderRadius:"Border Radius",TextOutlineColor:"Outline Color",TextOutlineWidth:"Outline Width",PixelSize:"Pixel Size",And:"and"},this.l10n=new Cn("image-editor",this.defaultLocale,this.parent.locale)},RUt.prototype.toolbar=function(e){var t=this.parent;switch(this.updatePrivateVariables(),e.prop){case"create-toolbar":this.createToolbar();break;case"create-contextual-toolbar":this.createContextualToolbar();break;case"update-toolbar-items":this.updateToolbarItems();break;case"refresh-toolbar":this.refreshToolbar(e.value.type,e.value.isApplyBtn,e.value.isCropping,e.value.isZooming,e.value.cType);break;case"renderQAT":this.renderQAT(e.value.isPenEdit);break;case"enable-disable-btns":this.enableDisableTbrBtn();break;case"init-main-toolbar":this.initMainToolbar(e.value.isApplyBtn,e.value.isDevice,e.value.isOkBtn,e.value.isResize,e.value.isFrame,e.value.isMainToolbar);break;case"create-bottom-toolbar":this.createBottomToolbar();break;case"refresh-main-toolbar":this.refreshMainToolbar();break;case"create-qa-toolbar":this.createQuickAccessToolbar();break;case"destroy-qa-toolbar":this.destroyQuickAccessToolbar();break;case"zoom-up-handler":this.zoomBtnMouseUpHandler();break;case"refresh-dropdown-btn":this.refreshDropDownBtn(e.value.isDisabled);break;case"close-contextual-toolbar":this.closeContextualToolbar();break;case"destroy-bottom-toolbar":this.destroyBottomToolbar();break;case"destroy-top-toolbar":this.destroyTopToolbar();break;case"destroySubComponents":this.destroySubComponents();break;case"setLocale":this.l10n.setLocale(e.value.locale);break;case"setPreventZoomBtn":this.preventZoomBtn=e.value.isPrevent;break;case"getToolbarHeight":e.value.obj.toolbarHeight=this.toolbarHeight;break;case"setToolbarHeight":(je(t.toolbar)||t.toolbar&&0<t.toolbar.length&&-1<t.toolbar.indexOf("Open"))&&(this.toolbarHeight=e.value.height);break;case"setCurrentToolbar":this.currentToolbar=e.value.type;break;case"setSelectedFreehandColor":this.selFhdColor=e.value.color;break;case"setInitialAdjustmentValue":t.initialAdjustmentValue=e.value.value;break;case"getCanvasFilter":e.value.obj.canvasFilter=t.canvasFilter;break;case"getDefToolbarItems":e.value.obj.defToolbarItems=this.defToolbarItems;break;case"getPenStroke":this.getPenStroke(e.value.value);break;case"performDefToolbarClickAction":this.performDefTbrClick(e.value.type,e.value.isContextualToolbar,e.value.isDisabledAdjustment,e.value.isDisabledFilter,e.value.isFilterFinetune);break;case"setTempFilterProperties":t.setTempFilterProperties();break;case"refreshSlider":this.refreshSlider();break;case"getCurrAdjustmentValue":t.getCurrAdjustmentValue(e.value.type);break;case"setCurrAdjustmentValue":t.setCurrAdjustmentValue(e.value.type,e.value.value);break;case"refreshShapeDrawing":this.refreshShapeDrawing();break;case"setEnableDisableUndoRedo":this.preventEnableDisableUr=e.value.isPrevent;break;case"reset":this.reset();break;case"getLocaleText":e.value.obj.value=this.l10n.getConstant(e.value.obj.key);break;case"initResizeToolbar":this.initResizeToolbar();break;case"getFrameToolbar":e.value.obj.bool=this.isFrameToolbar;break;case"resizeClick":this.resizeClick();break;case"frameToolbarClick":this.frameToolbarClick();break;case"performCropTransformClick":this.performCropTransformClick(e.value.shape,e.value.isTransform);break;case"duplicateShape":this.duplicateShape(e.value.isPreventUndoRedo,!0);break;case"editText":this.editText();break;case"setInitialSize":this.initialSize=Number(e.value.value);break;case"widthPress":this.widthPress(e.value.e);break;case"heightPress":this.heightPress(e.value.e);break;case"widthAspectRatio":this.widthAspectRatio(e.value.e);break;case"heightAspectRatio":this.heightAspectRatio(e.value.e);break;case"cancelPan":this.cancelPan();break;case"zoomInBtnMouseDownHandler":this.zoomInBtnMouseDownHandler(e.value.event);break;case"zoomOutBtnMouseDownHandler":this.zoomOutBtnMouseDownHandler(e.value.event);break;case"drawDashedLine":this.drawDashedLine(e.value.context);break;case"saveDialogClosed":this.saveDialogClosed(e.value.id);break;case"getIndex":this.getIndex(e.value.item);break;case"getRectRadius":this.getRectRadius(e.value.text);break;case"applyPreviewFilter":this.applyPreviewFilter();break;case"renderSlider":this.renderSlider(e.value.type,e.value.isSelect);break;case"zoomInBtnClickHandler":this.zoomInBtnClickHandler(e.value.e);break;case"zoomOutBtnClickHandler":this.zoomOutBtnClickHandler(e.value.e);break;case"getAdjustmentToolbarItem":this.getAdjustmentToolbarItem();break;case"getFilterToolbarItem":this.getFilterToolbarItem();break;case"renderCropBtn":this.renderCropBtn()}},RUt.prototype.updatePrivateVariables=function(){var e=this.parent;this.inMemoryCanvas=e.inMemoryCanvas,e.lowerCanvas&&(this.lowerContext=e.lowerCanvas.getContext("2d")),e.upperCanvas&&(this.upperContext=e.upperCanvas.getContext("2d")),this.inMemoryCanvas&&(this.inMemoryContext=this.inMemoryCanvas.getContext("2d"))},RUt.prototype.reset=function(){var e=this.parent;this.toolbarHeight=46,e.prevCurrSelectionPoint=null,this.zoomBtnHold=null,this.currToolbar="",e.cxtTbarHeight=null,this.currentToolbar="main",this.selFhdColor="#42a5f5",e.currentFilter="",this.preventZoomBtn=e.isCropToolbar=this.preventEnableDisableUr=this.isFrameToolbar=!1,e.initialAdjustmentValue=e.canvasFilter="brightness(1) contrast(100%) hue-rotate(0deg) saturate(100%) opacity(1) blur(0px) sepia(0%) grayscale(0%) invert(0%)",e.tempStraighten=0,e.isStraightening=!1},RUt.prototype.destroyTopToolbar=function(){var e=this.parent,e=document.getElementById(e.element.id+"_toolbar");this.isToolbar()&&e&&e.classList.contains("e-control")&&At(e,"toolbar").destroy()},RUt.prototype.destroyBottomToolbar=function(){var e=this.parent,e=document.getElementById(e.element.id+"_bottomToolbar");e&&e.classList.contains("e-control")&&At(e,"toolbar").destroy()},RUt.prototype.isToolbar=function(){var e=this.parent;return je(e.toolbar)||e.toolbar&&0<e.toolbar.length||!je(e.toolbarTemplate)},RUt.prototype.createToolbar=function(){var e,t,i=this,n=this.parent,o=n.element.id;je(n.toolbar)||n.toolbar&&0<n.toolbar.length?(n.element.appendChild(n.createElement("div",{id:o+"_toolbarArea",className:"e-toolbar-area"})),e={cssClass:"e-image-upload",align:"Left",type:"Input",tooltipText:this.l10n.getConstant("Browse"),template:new GN({allowedExtensions:n.uploadSettings.allowedExtensions,multiple:!1})},je(this.defToolbarItems)&&(this.defToolbarItems=[]),this.defToolbarItems.push(e),e=document.getElementById(o+"_toolbarArea"),t=n.createElement("div",{id:o+"_toolbar"}),e.appendChild(t),e=[{cssClass:"e-image-upload",align:"Left",type:"Input",tooltipText:this.l10n.getConstant("Browse"),template:new GN({allowedExtensions:n.uploadSettings.allowedExtensions,multiple:!1,selected:function(){var e=document.getElementById(o+"_toolbar"),t=document.getElementById(o+"_bottomToolbar");n.disabled||(F.isDevice?(0<i.defToolbarItems.length&&e&&At(e,"toolbar").destroy(),t&&At(t,"toolbar").destroy(),i.initMainToolbar(!1,F.isDevice,null),i.createBottomToolbar()):(0<i.defToolbarItems.length&&e&&At(e,"toolbar").destroy(),i.initMainToolbar(!1,!1,null)))}})}],new U3({items:e,width:"100%",created:function(){n.trigger("toolbarCreated",{toolbarType:"main"})},clicked:this.defToolbarClicked.bind(this)}).appendTo("#"+o+"_toolbar"),this.createLeftToolbarControls(),e=document.getElementById(o+"_toolbar"),t&&(this.toolbarHeight=e.clientHeight,n.toolbar)&&0<n.toolbar.length&&-1===n.toolbar.indexOf("Open")&&(t=At(document.getElementById(n.element.id+"_toolbar"),"toolbar"))&&(t.destroy(),document.getElementById(n.element.id+"_toolbar").innerHTML="")):this.toolbarHeight=0},RUt.prototype.createContextualToolbar=function(){var e,t=this.parent,i=t.element.id;(je(t.toolbar)||t.toolbar&&0<t.toolbar.length)&&((e=t.createElement("div",{id:i+"_contextualToolbarArea",className:"e-contextual-toolbar-wrapper e-hide"})).style.position="absolute",t.element.appendChild(e),e=document.getElementById(i+"_contextualToolbarArea"),t=t.createElement("div",{id:i+"_contextualToolbar"}),e.appendChild(t))},RUt.prototype.createBottomToolbar=function(){var e,t=this.parent,i=t.element.id;t.element.querySelector("#"+i+"_bottomToolbarArea")&&t.element.querySelector("#"+i+"_bottomToolbarArea").remove(),(je(t.toolbar)||t.toolbar&&0<t.toolbar.length)&&(t.element.appendChild(t.createElement("div",{id:i+"_bottomToolbarArea",className:"e-bottom-toolbar"})),t.toolbarTemplate||(e=document.getElementById(i+"_bottomToolbarArea"),t=t.createElement("div",{id:i+"_bottomToolbar"}),e.appendChild(t)),this.initBottomToolbar())},RUt.prototype.createQuickAccessToolbar=function(){var e,t=this.parent,i=t.element.id;t.showQuickAccessToolbar&&(e={cssClass:"e-image-upload",align:"Left",type:"Input",tooltipText:this.l10n.getConstant("Browse"),template:new GN({allowedExtensions:t.uploadSettings.allowedExtensions,multiple:!1})},je(this.defToolbarItems)&&(this.defToolbarItems=[]),this.defToolbarItems.push(e),e=document.getElementById(i+"_quickAccessToolbarArea"),t=t.createElement("div",{id:i+"_quickAccessToolbar"}),e.appendChild(t),new U3({clicked:this.defToolbarClicked.bind(this)}).appendTo("#"+i+"_quickAccessToolbar"))},RUt.prototype.initMainToolbar=function(e,t,i,n,o,r,s){var a=this,l=this.parent,h=l.element.id;this.isToolbar()&&(n=this.getLeftToolbarItem(i,n),i=this.getRightToolbarItem(i,r,s),r=this.getMainToolbarItem(e,o,s),e=this.getZoomToolbarItem(),this.defToolbarItems=t?o||s?r:n.concat(i):n.concat(r,i,e),n={toolbarType:"main",toolbarItems:this.defToolbarItems},l.trigger("toolbarUpdating",n),this.defToolbarItems=n.toolbarItems,0<this.defToolbarItems.length)&&(r=new U3({width:"100%",items:this.defToolbarItems,clicked:this.defToolbarClicked.bind(this),created:function(){t||a.renderAnnotationBtn(),a.wireZoomBtnEvents(),l.trigger("toolbarCreated",{toolbarType:"main"})}}),t&&o||t&&s?r.appendTo("#"+h+"_bottomToolbar"):r.appendTo("#"+h+"_toolbar"),this.createLeftToolbarControls(),this.enableDisableTbrBtn(),this.isToolbar())&&document.getElementById(h+"_toolbar")&&At(h+"_toolbar","toolbar").refreshOverflow()},RUt.prototype.initBottomToolbar=function(){var e,t=this,i=this.parent,n=i.element.id;(je(i.toolbar)||i.toolbar&&0<i.toolbar.length)&&(e={toolbarType:"bottom-toolbar",toolbarItems:this.getMainToolbarItem()},i.trigger("toolbarUpdating",e),new U3({items:e.toolbarItems,width:"100%",created:function(){t.renderAnnotationBtn(),t.renderCropBtn(),t.renderTransformBtn(),i.trigger("toolbarCreated",{toolbarType:"main"})},clicked:this.defToolbarClicked.bind(this)}).appendTo("#"+n+"_bottomToolbar"),0<this.defToolbarItems.length)&&document.getElementById(n+"_bottomToolbar")&&At(n+"_bottomToolbar","toolbar").refreshOverflow()},RUt.prototype.getLeftToolbarItem=function(e,t){for(var i=this.parent,n=i.element.id,o=[],r=(e&&!t||(je(i.toolbar)||i.toolbar&&-1<i.toolbar.indexOf("Open")?(o.push({id:n+"_upload",cssClass:"e-image-upload",align:"Left",type:"Input",template:new GN({allowedExtensions:i.uploadSettings.allowedExtensions,multiple:!1})}),o.push({visible:!1,cssClass:"e-image-position e-btn e-flat",tooltipText:this.l10n.getConstant("Browse"),align:"Left"})):F.isDevice&&i.toolbar&&-1===i.toolbar.indexOf("Open")&&(o.push({visible:!1,id:n+"_upload",cssClass:"e-image-upload",align:"Left",type:"Input",template:new GN({allowedExtensions:i.uploadSettings.allowedExtensions,multiple:!1})}),o.push({visible:!1,cssClass:"e-image-position e-btn e-flat",tooltipText:this.l10n.getConstant("Browse"),align:"Left"}))),i.allowUndoRedo&&!t&&((je(i.toolbar)||i.toolbar&&-1<i.toolbar.indexOf("Undo"))&&o.push({id:n+"_undo",prefixIcon:"e-icons e-undo",cssClass:"top-icon e-undo",tooltipText:this.l10n.getConstant("Undo"),align:"Left"}),je(i.toolbar)||i.toolbar&&-1<i.toolbar.indexOf("Redo"))&&o.push({id:n+"_redo",prefixIcon:"e-icons e-redo",cssClass:"top-icon e-redo",tooltipText:this.l10n.getConstant("Redo"),align:"Left"}),!this.preventZoomBtn&&(i.zoomSettings.zoomTrigger&xUt.Toolbar)===xUt.Toolbar&&!t&&((je(i.toolbar)||i.toolbar&&-1<i.toolbar.indexOf("ZoomOut"))&&o.push({id:n+"_zoomOut",prefixIcon:"e-icons e-zoom-out",cssClass:"top-icon e-dec-zoom",tooltipText:this.l10n.getConstant("ZoomOut"),align:"Left"}),je(i.toolbar)||i.toolbar&&-1<i.toolbar.indexOf("ZoomIn"))&&o.push({id:n+"_zoomIn",prefixIcon:"e-icons e-zoom-in",cssClass:"top-icon e-inc-zoom",tooltipText:this.l10n.getConstant("ZoomIn"),align:"Left"}),this.processToolbar("left")),s=0,a=r.length;s<a;s++)o.push(r[s]);return o},RUt.prototype.getRightToolbarItem=function(e,t,i){for(var n=this.parent,o=n.element.id,r=[],s=((e||i)&&(r.push({id:o+"_ok",prefixIcon:"e-icons e-check",cssClass:"top-icon e-tick",tooltipText:this.l10n.getConstant("OK"),align:"Right",tabIndex:0}),r.push({id:o+"_cancel",prefixIcon:"e-icons e-close",cssClass:"top-icon e-save",tooltipText:this.l10n.getConstant("Cancel"),align:"Right"})),!t&&F.isDevice||!(je(n.toolbar)||n.toolbar&&-1<n.toolbar.indexOf("Reset"))||r.push({id:o+"_reset",prefixIcon:"e-icons e-btn-reset",cssClass:"top-icon e-img-reset",tooltipText:this.l10n.getConstant("Reset"),align:"Right"}),e||(je(n.toolbar)||n.toolbar&&-1<n.toolbar.indexOf("Save"))&&r.push({id:o+"_save",prefixIcon:"e-icons e-btn-save",cssClass:"e-caret-hide top-icon e-save",tooltipText:this.l10n.getConstant("Save"),align:"Right"}),this.processToolbar("right")),a=0,l=s.length;a<l;a++)r.push(s[a]);return r},RUt.prototype.getMainToolbarItem=function(e,t,i){for(var n=this.parent,o=n.element.id,r=[],s=(t?((je(n.toolbar)||!je(n.toolbar)&&-1<n.toolbar.indexOf("None")||-1<n.toolbar.indexOf("Frame"))&&r.push({id:o+"_none",prefixIcon:"e-icons e-frame-none",cssClass:"top-icon e-frame-none",tooltipText:this.l10n.getConstant("None"),align:"Center"}),(je(n.toolbar)||!je(n.toolbar)&&-1<n.toolbar.indexOf("Mat")||-1<n.toolbar.indexOf("Frame"))&&r.push({id:o+"_mat",prefixIcon:"e-icons e-frame-mat",cssClass:"top-icon e-frame-mat",tooltipText:this.l10n.getConstant("Mat"),align:"Center"}),(je(n.toolbar)||!je(n.toolbar)&&-1<n.toolbar.indexOf("Bevel")||-1<n.toolbar.indexOf("Frame"))&&r.push({id:o+"_bevel",prefixIcon:"e-icons e-frame-bevel",cssClass:"top-icon e-frame-bevel",tooltipText:this.l10n.getConstant("Bevel"),align:"Center"}),(je(n.toolbar)||!je(n.toolbar)&&-1<n.toolbar.indexOf("Line")||-1<n.toolbar.indexOf("Frame"))&&r.push({id:o+"_line",prefixIcon:"e-icons e-frame-line",cssClass:"top-icon e-frame-line",tooltipText:this.l10n.getConstant("Line"),align:"Center"}),(je(n.toolbar)||!je(n.toolbar)&&-1<n.toolbar.indexOf("Inset")||-1<n.toolbar.indexOf("Frame"))&&r.push({id:o+"_inset",prefixIcon:"e-icons e-frame-inset",cssClass:"top-icon e-frame-inset",tooltipText:this.l10n.getConstant("Inset"),align:"Center"}),(je(n.toolbar)||!je(n.toolbar)&&-1<n.toolbar.indexOf("Hook")||-1<n.toolbar.indexOf("Frame"))&&r.push({id:o+"_hook",prefixIcon:"e-icons e-frame-hook",cssClass:"top-icon e-frame-hook",tooltipText:this.l10n.getConstant("Hook"),align:"Center"})):i?(r.push({id:o+"_redactBlur",prefixIcon:"e-icons e-tint",cssClass:"top-icon e-opacity",tooltipText:this.l10n.getConstant("Blur"),align:"Center"}),r.push({id:o+"_pixelate",prefixIcon:"e-icons e-opacity",cssClass:"top-icon e-opacity",tooltipText:this.l10n.getConstant("Pixelate"),align:"Center"}),r.push({id:o+"_duplicate",prefixIcon:"e-icons e-order",cssClass:"top-icon e-order",tooltipText:this.l10n.getConstant("Duplicate"),align:"Center"}),r.push({id:o+"_remove",prefixIcon:"e-icons e-trash",cssClass:"top-icon e-trash",tooltipText:this.l10n.getConstant("Remove"),align:"Center"})):((je(n.toolbar)||n.toolbar&&-1<n.toolbar.indexOf("Crop"))&&r.push({id:o+"_cropTransform",prefixIcon:"e-icons e-crop",cssClass:"top-icon e-crop",tooltipText:this.l10n.getConstant("CropAndTransform"),align:"Center"}),(je(n.toolbar)||n.toolbar&&-1<n.toolbar.indexOf("Annotate"))&&r.push({id:o+"_annotation",tooltipText:this.l10n.getConstant("Annotation"),align:"Center",template:'<button id="'+o+'_annotationBtn"></button>'}),(je(n.toolbar)||n.toolbar&&-1<n.toolbar.indexOf("Finetune"))&&r.push({id:o+"_adjustment",prefixIcon:"e-icons e-adjustment",cssClass:"top-icon e-adjustment",tooltipText:this.l10n.getConstant("Finetune"),align:"Center"}),(je(n.toolbar)||n.toolbar&&-1<n.toolbar.indexOf("Filter"))&&r.push({id:o+"_filter",prefixIcon:"e-icons e-filters",cssClass:"top-icon e-filters",tooltipText:this.l10n.getConstant("Filter"),align:"Center"}),(je(n.toolbar)||!je(n.toolbar)&&-1<n.toolbar.indexOf("Frame"))&&r.push({id:o+"_frame",prefixIcon:"e-icons e-border-frame",cssClass:"top-icon e-border-frame",tooltipText:this.l10n.getConstant("Frame"),align:"Center"}),(je(n.toolbar)||!je(n.toolbar)&&-1<n.toolbar.indexOf("Resize"))&&r.push({id:o+"_resize",prefixIcon:"e-icons e-resize",cssClass:"top-icon e-resize",tooltipText:this.l10n.getConstant("Resize"),align:"Center"}),(je(n.toolbar)||!je(n.toolbar)&&-1<n.toolbar.indexOf("Redact"))&&r.push({id:o+"_redact",prefixIcon:"e-icons e-redact",cssClass:"top-icon e-opacity",tooltipText:this.l10n.getConstant("Redact"),align:"Center"})),this.processToolbar("center")),a=0,l=s.length;a<l;a++)r.push(s[a]);return e&&(r.push({id:o+"_ok",prefixIcon:"e-icons e-check",cssClass:"top-icon e-tick",tooltipText:this.l10n.getConstant("OK"),align:"Right",tabIndex:0}),r.push({id:o+"_cancel",prefixIcon:"e-icons e-close",cssClass:"top-icon e-save",tooltipText:this.l10n.getConstant("Cancel"),align:"Right"})),r},RUt.prototype.getZoomToolbarItem=function(){return[]},RUt.prototype.updateContextualToolbar=function(e,t,i){var n,o=this.parent,r=o.element.id,s=o.element.querySelector("#"+r+"_toolbarArea"),a=o.element.querySelector("#"+r+"_contextualToolbarArea");a&&(a.classList.remove("e-hide"),a.style.left=s.offsetLeft+"px","filter"===e?((s=document.getElementById(r+"_toolbar"))&&0<this.defToolbarItems.length&&At(s,"toolbar").destroy(),F.isDevice?this.initMainToolbar(!1,!0,!0):this.initMainToolbar(!0,null,null),this.refreshSlider(),this.initFilterToolbarItem()):((n=document.querySelector("#"+r+"_contextualToolbar")).classList.contains("e-control")&&At(n,"toolbar").destroy(),this.refreshSlider(),"frame"===e?this.initFrameToolbarItem():this.renderSlider(t,i)),o.toolbarTemplate?this.toolbarHeight=o.element.querySelector("#"+r+"_toolbarArea").clientHeight:o.element.querySelector("#"+r+"_toolbar")&&(this.toolbarHeight=o.element.querySelector("#"+r+"_toolbar").clientHeight),o.toolbarHeight=this.toolbarHeight,F.isDevice?(s=a.offsetHeight+1,e=o.element.querySelector("#"+r+"_customizeWrapper"),this.isFrameToolbar&&e&&(s=e.offsetHeight+2),e=o.element.querySelector("#"+r+"_canvasWrapper").offsetHeight,a.style.top=this.toolbarHeight+1+e-s+"px","straighten"===t&&(o.isStraightening=!0,"absolute"===(n=o.element.querySelector("#"+r+"_contextualToolbarArea")).style.position)&&(n.style.position="",o.element.insertBefore(n,o.element.querySelector("#"+r+"_bottomToolbarArea")),o.update(),i)&&o.notify("draw",{prop:"select",onPropertyChange:!1,value:{type:this.getCropTextContent(document.getElementById(r+"_cropBtn")).toLowerCase(),startX:null,startY:null,width:null,height:null}})):a.style.top=this.toolbarHeight+1+"px")},RUt.prototype.processToolbar=function(e){var t=this.parent,i=[];if(t.toolbar)for(var n=0,o=t.toolbar.length;n<o;n++)"object"==typeof t.toolbar[n]&&(je(t.toolbar[n].align)?"left"===e&&i.push(t.toolbar[n]):t.toolbar[n].align.toLowerCase()===e&&i.push(t.toolbar[n]));return i},RUt.prototype.processSubToolbar=function(e){var t=[];if(e)for(var i=0,n=e.length;i<n;i++)"object"==typeof e[i]&&(e[i].align="Center",t.push(e[i]));return t},RUt.prototype.wireZoomBtnEvents=function(){var e=document.querySelector("#"+this.parent.element.id+"_zoomIn"),t=document.querySelector("#"+this.parent.element.id+"_zoomOut");e&&(e.addEventListener("mousedown",this.zoomInBtnMouseDownHandler.bind(this)),e.addEventListener("mouseup",this.zoomBtnMouseUpHandler.bind(this)),e.addEventListener("click",this.zoomInBtnClickHandler.bind(this))),t&&(t.addEventListener("mousedown",this.zoomOutBtnMouseDownHandler.bind(this)),t.addEventListener("mouseup",this.zoomBtnMouseUpHandler.bind(this)),t.addEventListener("click",this.zoomOutBtnClickHandler.bind(this)))},RUt.prototype.widthPress=function(e){109===e.keyCode&&e.preventDefault()},RUt.prototype.heightPress=function(e){109===e.keyCode&&e.preventDefault()},RUt.prototype.widthAspectRatio=function(e){var t,i,n,o,r;109!==e.keyCode&&9!==e.keyCode&&(i=(e=this.parent).element.id,r=e.element.querySelector("#"+i+"_resizeHeight"),t=e.element.querySelector("#"+i+"_resizeWidth"),i=e.element.querySelector("#"+i+"_aspectratio"),o=e.img.destWidth,n=e.img.destHeight,n=.5<=(r=parseFloat(r.value)/(n/o))%1||r%1<=-.5?Math.round(r):r<0?Math.ceil(r):Math.floor(r),o=At(t,"numerictextbox"),r=At(t,"numerictextbox"),i)&&(null==n||isNaN(n)?je(o.value)?(o.placeholder="0 px",t.placeholder="0 px",je(r.value)&&!je(r.placeholder)&&(o.placeholder=""+e.img.srcWidth,t.placeholder=""+e.img.srcWidth)):(o.value=0,t.value="0 px"):je(o.value)?(o.placeholder=n+" px",t.placeholder=n.toString()+" px"):(o.value=n,t.value=n.toString()+" px"))},RUt.prototype.heightAspectRatio=function(e){var t,i,n,o,r;109!==e.keyCode&&9!==e.keyCode&&(i=(e=this.parent).element.id,t=e.element.querySelector("#"+i+"_resizeHeight"),r=e.element.querySelector("#"+i+"_resizeWidth"),i=e.element.querySelector("#"+i+"_aspectratio"),o=e.img.destWidth,n=e.img.destHeight,n=.5<=(o=parseFloat(r.value)/(o/n))%1||o%1<=-.5?Math.round(o):o<0?Math.ceil(o):Math.floor(o),o=At(t,"numerictextbox"),r=At(r,"numerictextbox"),i)&&(isNaN(n)?je(o.value)?(o.placeholder="0 px",t.placeholder="0 px",je(r.value)&&!je(r.placeholder)&&(o.placeholder=""+e.img.srcHeight,t.placeholder=""+e.img.srcHeight)):(o.value=0,t.value="0 px"):je(o.value)?(o.placeholder=n+" px",t.placeholder=n.toString()+" px"):(o.value=n,t.value=n.toString()+" px"))},RUt.prototype.getResizeToolbarItem=function(){var e=this.parent,t=e.element.id,i=!(!e.aspectWidth||!e.aspectHeight),n=(this.parent.transform.degree%90==0&&this.parent.transform.degree%180!=0?Math.ceil(this.parent.img.srcHeight):Math.ceil(this.parent.img.srcWidth)).toString(),o=(this.parent.transform.degree%90==0&&this.parent.transform.degree%180!=0?Math.ceil(this.parent.img.srcWidth):Math.ceil(this.parent.img.srcHeight)).toString(),r=[],s=document.createElement("span"),s=(s.innerHTML=this.l10n.getConstant("W"),r.push({id:t+"_width",cssClass:"e-ie-resize-width",template:s,align:"Center"}),r.push({id:t+"_resizeWidth",prefixIcon:"e-icons e-anti-clock-wise",tooltipText:this.l10n.getConstant("Width"),align:"Center",type:"Input",template:new NL({width:75,htmlAttributes:{maxLength:"4"},showSpinButton:!1,value:i?e.aspectWidth:null,placeholder:i?null:n,format:"###.## px"})}),document.createElement("span"));return s.innerHTML=this.l10n.getConstant("H"),r.push({id:t+"_height",cssClass:"e-ie-resize-height",template:s,align:"Center"}),r.push({id:t+"_resizeHeight",prefixIcon:"e-icons e-clock-wise",tooltipText:this.l10n.getConstant("Height"),align:"Center",type:"Input",template:new NL({width:75,htmlAttributes:{maxLength:"4"},showSpinButton:!1,value:i?e.aspectHeight:null,placeholder:i?null:o,format:"###.## px"})}),this.isAspectRatio?(r.push({id:t+"_nonaspectratio",prefixIcon:"e-icons e-unlock",align:"Center",tooltipText:this.l10n.getConstant("AspectRatio"),type:"Button"}),this.isAspectRatio=!1):(r.push({id:t+"_aspectratio",prefixIcon:"e-icons e-lock",align:"Center",tooltipText:this.l10n.getConstant("AspectRatio"),type:"Button",tabIndex:0}),this.isAspectRatio=!0),F.isDevice||(r.push({id:t+"_ok",prefixIcon:"e-icons e-check",cssClass:"top-icon e-tick",tooltipText:this.l10n.getConstant("OK"),align:"Right",tabIndex:0}),r.push({id:t+"_cancel",prefixIcon:"e-icons e-close",cssClass:"top-icon e-save",tooltipText:this.l10n.getConstant("Cancel"),align:"Right"})),r},RUt.prototype.initResizeToolbar=function(){var e=this,t=this.parent,i=t.element.id,n=this.getLeftToolbarItem(!1,!0),o=this.getRightToolbarItem(),r=this.getResizeToolbarItem(),s=this.getZoomToolbarItem(),n=(F.isDevice?this.defToolbarItems=r:this.defToolbarItems=n.concat(s,r,o),{toolbarType:"resize",toolbarItems:this.defToolbarItems}),a=(t.trigger("toolbarUpdating",n),this.defToolbarItems=n.toolbarItems,new U3({width:"100%",items:this.defToolbarItems,clicked:this.defToolbarClicked.bind(this),created:function(){e.wireResizeBtnEvents(),t.trigger("toolbarCreated",{toolbarType:"shapes"}),F.isDevice?0<e.defToolbarItems.length&&!je(document.getElementById(i+"_bottomToolbar"))&&a.refreshOverflow():(e.createLeftToolbarControls(),0<e.defToolbarItems.length&&!je(document.getElementById(i+"_toolbar"))&&a.refreshOverflow())}}));F.isDevice?a.appendTo("#"+i+"_bottomToolbar"):a.appendTo("#"+i+"_toolbar"),t.isResize=!1,this.enableDisableTbrBtn(),t.isResize=!0,t.notify("transform",{prop:"disableZoomOutBtn",value:{isZoomOut:!0}})},RUt.prototype.wireResizeBtnEvents=function(){var e=this.parent,t=e.element.id,i=e.element.querySelector("#"+t+"_resizeHeight"),e=e.element.querySelector("#"+t+"_resizeWidth");je(i)||(i.addEventListener("keydown",this.widthPress.bind(this)),e.addEventListener("keyup",this.heightAspectRatio.bind(this))),je(e)||(e.addEventListener("keydown",this.heightPress.bind(this)),i.addEventListener("keyup",this.widthAspectRatio.bind(this)))},RUt.prototype.enableDisableTbrBtn=function(){var e=this.parent,t=e.element.id,i=(this.preventEnableDisableUr||(e.notify("undo-redo",{prop:"getAppliedUndoRedoColl",value:{obj:i={appliedUndoRedoColl:[]}}}),e.notify("undo-redo",{prop:"getUndoRedoStep",value:{obj:n={undoRedoStep:null}}}),(o=e.element.querySelector("#"+t+"_undo"))&&0===n.undoRedoStep?(o.classList.add("e-disabled"),o.parentElement.classList.add("e-overlay")):o&&0<n.undoRedoStep&&(o.classList.remove("e-disabled"),o.parentElement.classList.remove("e-overlay")),(o=e.element.querySelector("#"+t+"_redo"))&&n.undoRedoStep===i.appliedUndoRedoColl.length?(o.classList.add("e-disabled"),o.parentElement.classList.add("e-overlay")):(o&&0===n.undoRedoStep&&0<i.appliedUndoRedoColl.length||o&&0<n.undoRedoStep)&&(o.classList.remove("e-disabled"),o.parentElement.classList.remove("e-overlay"))),document.querySelector("#"+t+"_zoomIn")),n=(i&&e.zoomSettings.zoomFactor>=e.zoomSettings.maxZoomFactor?(i.classList.add("e-disabled"),i.parentElement.classList.add("e-overlay")):i&&(i.classList.remove("e-disabled"),i.parentElement.classList.remove("e-overlay")),document.querySelector("#"+t+"_zoomOut")),o=(n&&e.zoomSettings.zoomFactor<=e.zoomSettings.minZoomFactor?(n.classList.add("e-disabled"),n.parentElement.classList.add("e-overlay")):n&&(n.classList.remove("e-disabled"),n.parentElement.classList.remove("e-overlay")),document.querySelector("#"+t+"_frame")),i=(o&&(e.currSelectionPoint&&"crop-circle"===e.currSelectionPoint.shape||e.isCircleCrop)?o.classList.add("e-overlay"):o&&o.classList.remove("e-overlay"),document.querySelector("#"+t+"_aspectratio"));i&&(e.currSelectionPoint&&"crop-circle"===e.currSelectionPoint.shape||e.isCircleCrop)?i.classList.add("e-overlay"):i&&i.classList.remove("e-overlay")},RUt.prototype.createLeftToolbarControls=function(){var e,t=this.parent,i=t.element.id;void 0!==this.defToolbarItems&&0<this.defToolbarItems.length&&document.getElementById(i+"_toolbar")&&(i=document.getElementById(i+"_toolbar").querySelector(".e-image-upload"))&&(e=i.getElementsByTagName("input")[0],(i=i.getElementsByTagName("button")[0]).className="e-tbar-btn e-tbtn-txt top-icon",i.innerHTML="",i.title=this.l10n.getConstant("Browse"),i.appendChild(t.createElement("span",{className:"e-btn-icon e-icons e-upload-icon e-icon-left"})),e.onchange=this.fileSelect.bind(this,e))},RUt.prototype.fileSelect=function(e,t){var i=this.parent,n=e.files[0].type.split("/")[1],o=this.parent.getExtensionArray(),i=("jpg"===n||"jpeg"===n)&&(-1<i.uploadSettings.allowedExtensions.indexOf("jpg")||-1<i.uploadSettings.allowedExtensions.indexOf("jpeg")),r=(this.fileName=e.files[0].name.split(".")[0],e.files[0].size);this.parent.notify("toolbar",{prop:"setInitialSize",value:{value:e.files[0].size}}),(-1<o.indexOf(n)||i||-1<n.indexOf("svg")&&-1<o.indexOf("svg"))&&(!this.parent.uploadSettings.minFileSize||r>this.parent.uploadSettings.minFileSize)&&(!this.parent.uploadSettings.maxFileSize||r<this.parent.uploadSettings.maxFileSize)?this.parent.notify("draw",{prop:"fileSelect",value:{inputElement:e,args:t}}):(this.parent.isImageLoaded||(this.destroyTopToolbar(),this.createToolbar(),F.isDevice&&this.destroyBottomToolbar()),this.parent.showDialogPopup("unsupported",!(-1<o.indexOf(n)||i||-1<n.indexOf("svg")&&-1<o.indexOf("svg"))))},RUt.prototype.triggerTbarClickEvent=function(e){e={item:e.item,originalEvent:e.event};this.parent.trigger("toolbarItemClicked",e)},RUt.prototype.renderAnnotationBtn=function(e){var h=this,d=this.parent,t=!1,i=[],p=d.element.id,n=["Ellipse","Arrow","Line","Rectangle","Pen","Path","Text","Image"];if(d.toolbar)for(var o=0;o<n.length;o++)if(-1!==d.toolbar.indexOf(n[o])){t=!0;break}(je(d.toolbar)||!t||d.toolbar&&-1<d.toolbar.indexOf("Pen"))&&i.push({text:this.l10n.getConstant("Pen"),id:"pen",iconCss:"e-icons e-free-pen"}),(je(d.toolbar)||!t||d.toolbar&&-1<d.toolbar.indexOf("Line"))&&i.push({text:this.l10n.getConstant("Line"),id:"line",iconCss:"e-icons e-line"}),(je(d.toolbar)||!t||d.toolbar&&-1<d.toolbar.indexOf("Rectangle"))&&i.push({text:this.l10n.getConstant("Rectangle"),id:"rectangle",iconCss:"e-icons e-rectangle"}),(je(d.toolbar)||!t||d.toolbar&&-1<d.toolbar.indexOf("Ellipse"))&&i.push({text:this.l10n.getConstant("Ellipse"),id:"ellipse",iconCss:"e-icons e-circle"}),(je(d.toolbar)||!t||d.toolbar&&-1<d.toolbar.indexOf("Arrow"))&&i.push({text:this.l10n.getConstant("Arrow"),id:"arrow",iconCss:"e-icons e-arrow-right-up"}),(je(d.toolbar)||!t||d.toolbar&&-1<d.toolbar.indexOf("Path"))&&i.push({text:this.l10n.getConstant("Path"),id:"path",iconCss:"e-icons e-critical-path"}),(je(d.toolbar)||!t||d.toolbar&&-1<d.toolbar.indexOf("Text"))&&i.push({text:this.l10n.getConstant("Text"),id:"text",iconCss:"e-icons e-add-text"}),(je(d.toolbar)||!t||d.toolbar&&-1<d.toolbar.indexOf("Image"))&&i.push({text:this.l10n.getConstant("Image"),id:"image",iconCss:"e-icons e-image"});var r={freehandDrawSelectedId:null},s=(d.notify("freehand-draw",{prop:"getFreehandDrawSelectedId",onPropertyChange:!1,value:{obj:r}}),F.isDevice?"#"+p+"_bottomToolbar #"+p:"#"+p),s=(this.enableDisableCloneBtn(s,r),e?this.getCurrentShapeIcon(d.activeObj.shape):"e-annotation"),c=new u2({items:i,iconCss:"e-icons "+s,cssClass:"e-image-popup",open:function(e){(d.currObjType.isFiltered||d.currObjType.isRedact)&&(d.okBtn(),d.element.querySelector("#"+p+"_annotationBtn").click()),F.isDevice&&(e.element.parentElement.style.top=c.element.getBoundingClientRect().top-e.element.parentElement.offsetHeight+"px"),d.activeObj.shape?document.getElementById(d.activeObj.shape).classList.add("e-selected"):d.togglePen&&document.getElementById("pen").classList.add("e-selected")},select:function(e){d.noPushUndo=!1,h.triggerTbarClickEvent(e),d.okBtn();var t,i,n,o=!1,r=((void 0===(l=void 0!==d.activeObj.shape?d.activeObj.shape.split("-"):l)&&d.currObjType.isCustomCrop||void 0!==l&&"crop"===l[0])&&(o=!0),d.currObjType.isCustomCrop=!1,(o||d.togglePan)&&(d.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),h.upperContext.clearRect(0,0,d.upperCanvas.width,d.upperCanvas.height),h.refreshToolbar("main")),{currentFreehandDrawIndex:null}),s=(d.notify("freehand-draw",{prop:"getCurrentFreehandDrawIndex",value:{obj:r}}),{shapeSettingsObj:{}}),a=(c.iconCss="e-icons "+h.getCurrentShapeIcon(e.item.id),d.notify("draw",{prop:"updateTempObjColl"}),d.notify("draw",{prop:"updateTempPointColl"}),{penStrokeWidth:2});switch(e.item.id){case"pen":d.notify("freehand-draw",{prop:"getPenStrokeWidth",onPropertyChange:!1,value:{obj:a}}),d.notify("draw",{prop:"setTempStrokeWidth",value:{strokeWidth:a.penStrokeWidth}}),d.drawingShape=null,d.notify("draw",{prop:"setTempFreehandCounter",value:{tempFreehandCounter:d.freehandCounter}}),d.notify("draw",{prop:"setTempCurrentFreehandDrawIndex",value:{tempCurrentFreehandDrawIndex:r.currentFreehandDrawIndex}}),h.currentToolbar="pen",d.freeHandDraw(!0),d.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:s}}),t=s.shapeSettingsObj,d.notify("freehand-draw",{prop:"getPenStrokeWidth",onPropertyChange:!1,value:{obj:a}}),t.strokeWidth=a.penStrokeWidth,t.type=AUt.FreehandDraw,d.notify("freehand-draw",{prop:"triggerShapeChanging",value:{shapeChangingArgs:i={cancel:!1,action:"insert",previousShapeSettings:t,currentShapeSettings:t}}});break;case"text":h.currentToolbar="text",d.drawingShape=e.item.id,h.currentToolbar="text",h.setInitialShapeSettings(e),d.notify("selection",{prop:"annotate",value:{shape:e.item.id}}),d.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"text",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}});break;case"image":d.drawingShape=null,h.currentToolbar="shapes",d.element.querySelector("#"+p+"_fileUpload").click();break;case"ellipse":case"arrow":case"line":case"rectangle":case"path":d.drawingShape=e.item.id,h.currentToolbar="shapes",h.setInitialShapeSettings(e),d.notify("selection",{prop:"annotate",value:{shape:e.item.id}}),d.notify("toolbar",{prop:"refresh-toolbar",onPropertyChange:!1,value:{type:"shapes",isApplyBtn:null,isCropping:null,isZooming:null,cType:null}}),d.notify("selection",{prop:"updatePrevShapeSettings",onPropertyChange:!1,value:{obj:s}}),t=s.shapeSettingsObj,n=-1===["ellipse","rectangle","text","image"].indexOf(h.parent.activeObj.shape),d.trigger("shapeChanging",i={cancel:!1,action:"insert",previousShapeSettings:t,currentShapeSettings:t,allowShapeOverflow:n}),d.editCompleteArgs=i,d.notify("shape",{prop:"updateShapeChangeEventArgs",value:{shapeSettings:i.currentShapeSettings}})}h.updateToolbarItems();var l=d.togglePen;"pen"===e.item.id&&(d.togglePen=!1),d.notify("draw",{prop:"redrawDownScale"}),d.togglePen=l}});c.appendTo("#"+p+"_annotationBtn")},RUt.prototype.enableDisableCloneBtn=function(e,t){var i=this.parent,n=!1,o=Math.floor(i.activeObj.activePoint.width),o=(i.activeObj.shape&&"text"===i.activeObj.shape&&11===i.activeObj.textSettings.fontSize&&(55===o||i.activeObj.textSettings.bold&&58===o)&&11===Math.floor(i.activeObj.activePoint.height)&&(n=!0),document.querySelector(e+"_duplicate")),r=document.querySelector(e+"_remove"),s=document.querySelector(e+"_editText"),e=document.querySelector(e+"_zOrderBtn");n||0===i.activeObj.activePoint.width&&0===i.activeObj.activePoint.height&&(je(i.activeObj.pointColl)||i.activeObj.pointColl&&0===i.activeObj.pointColl.length)&&je(t.freehandDrawSelectedId)?(o&&o.classList.add("e-overlay"),r&&r.classList.add("e-overlay"),s&&s.classList.add("e-overlay"),e&&e.classList.add("e-overlay")):(o&&o.classList.remove("e-overlay"),r&&r.classList.remove("e-overlay"),s&&s.classList.remove("e-overlay"),e&&e.classList.remove("e-overlay")),e&&(0===i.shapeColl.length||t.freehandDrawSelectedId&&1===i.shapeColl.length)&&e.classList.add("e-overlay")},RUt.prototype.renderStraightenSlider=function(){var e=this.parent,t=e.element.id;(je(e.toolbar)||e.toolbar&&-1<e.toolbar.indexOf("Straightening"))&&e.element.querySelector("#"+t+"_straightenSlider")&&((e=this.createSlider(-45,45,e.cropObj.straighten,"straighten")).appendTo("#"+t+"_straightenSlider"),t=e.element.querySelector(".e-handle"))&&!F.isDevice&&(t.addEventListener("mousedown",function(e){e.preventDefault(),e.stopPropagation()}),t.addEventListener("touchstart",function(e){e.preventDefault(),e.stopPropagation()}))},RUt.prototype.renderCropBtn=function(e){var t,i=this,n=this.parent,o=[],r=!1,s=["CustomSelection","CircleSelection","SquareSelection","RatioSelection"];if(n.toolbar)for(var a=0;a<s.length;a++)if(-1!==n.toolbar.indexOf(s[a])){r=!0;break}(je(n.toolbar)||!r||n.toolbar&&-1<n.toolbar.indexOf("CustomSelection"))&&o.push({text:this.l10n.getConstant("Custom"),id:"custom",iconCss:"e-icons e-custom"}),(je(n.toolbar)||!r||n.toolbar&&-1<n.toolbar.indexOf("CircleSelection"))&&o.push({text:this.l10n.getConstant("Circle"),id:"circle",iconCss:"e-icons e-circle"}),(je(n.toolbar)||!r||n.toolbar&&-1<n.toolbar.indexOf("SquareSelection"))&&o.push({text:this.l10n.getConstant("Square"),id:"square",iconCss:"e-icons e-square"}),(je(n.toolbar)||!r||n.toolbar&&-1<n.toolbar.indexOf("RatioSelection"))&&(o.push({text:"2:3",id:"2:3",iconCss:"e-icons e-custom-f"}),o.push({text:"3:2",id:"3:2",iconCss:"e-icons e-custom-a"}),o.push({text:"3:4",id:"3:4",iconCss:"e-icons e-custom-g"}),o.push({text:"4:3",id:"4:3",iconCss:"e-icons e-custom-b"}),o.push({text:"4:5",id:"4:5",iconCss:"e-icons e-custom-h"}),o.push({text:"5:4",id:"5:4",iconCss:"e-icons e-custom-c"}),o.push({text:"5:7",id:"5:7",iconCss:"e-icons e-custom-i"}),o.push({text:"7:5",id:"7:5",iconCss:"e-icons e-custom-d"}),o.push({text:"9:16",id:"9:16",iconCss:"e-icons e-custom-j"}),o.push({text:"16:9",id:"16:9",iconCss:"e-icons e-custom-e"}));var e=e?(t=this.getCurrentShapeIcon(e),e):n.activeObj.shape&&(0!==n.activeObj.activePoint.width||0!==n.activeObj.activePoint.height)||"path"===n.activeObj.shape&&0<n.activeObj.pointColl.length?(t=this.getCurrentShapeIcon(n.activeObj.shape),n.activeObj.shape):n.currSelectionPoint?(t=this.getCurrentShapeIcon(n.currSelectionPoint.shape),n.currSelectionPoint.shape):(t=o[0].iconCss,o[0].id),l=new u2({open:function(e){n.togglePan&&i.cancelPan(),F.isDevice&&(e.element.parentElement.style.top=l.element.getBoundingClientRect().top-e.element.parentElement.offsetHeight+"px"),n.activeObj.shape&&1<n.activeObj.shape.split("-").length&&(e=document.getElementById(n.activeObj.shape.split("-")[1]))&&(e.classList.add("e-selected"),e.focus()),n.notify("transform",{prop:"disableZoomOutBtn",value:{isZoomOut:!0}})},items:o,select:function(e){i.triggerTbarClickEvent(e),i.cropSelect(e),l.iconCss="e-icons "+i.getCurrentShapeIcon("crop-"+e.item.id),l.content=F.isDevice?null:n.toPascalCase(e.item.id)},iconCss:"e-icons "+t,cssClass:"e-image-popup e-ie-crop-ddb-popup",content:F.isDevice?null:n.toPascalCase(e.replace("crop-",""))});l.appendTo("#"+n.element.id+"_cropBtn")},RUt.prototype.renderTransformBtn=function(){var t=this,i=this.parent,e=[],n=((je(i.toolbar)||i.toolbar&&-1<i.toolbar.indexOf("RotateLeft"))&&e.push({text:this.l10n.getConstant("RotateLeft"),id:"rotateleft",iconCss:"e-icons e-anti-clock-wise"}),(je(i.toolbar)||i.toolbar&&-1<i.toolbar.indexOf("RotateRight"))&&e.push({text:this.l10n.getConstant("RotateRight"),id:"rotateright",iconCss:"e-icons e-clock-wise"}),(je(i.toolbar)||i.toolbar&&-1<i.toolbar.indexOf("FlipHorizontal"))&&e.push({text:this.l10n.getConstant("HorizontalFlip"),id:"horizontalflip",iconCss:"e-icons e-horizontal-flip"}),(je(i.toolbar)||i.toolbar&&-1<i.toolbar.indexOf("FlipVertical"))&&e.push({text:this.l10n.getConstant("VerticalFlip"),id:"verticalflip",iconCss:"e-icons e-vertical-flip"}),new u2({open:function(e){var t;F.isDevice&&(t=(e=e.element.parentElement).offsetHeight,e.style.display="none",e.style.top=n.element.getBoundingClientRect().top-t+"px",e.style.display="block")},items:e,select:function(e){t.triggerTbarClickEvent(e),i.transformSelect.bind(t)},iconCss:"e-icons e-transform",cssClass:"e-image-popup"}));n.appendTo("#"+i.element.id+"_transformBtn")},RUt.prototype.saveDialogPopup=function(){var n=this,e=this.parent,o=e.element.id,t=(e.element.appendChild(e.createElement("div",{id:o+"_saveDialog"})),e.createElement("div",{id:o+"_dialogContent"})),i=(t.style.display="flex",t.appendChild(e.createElement("div",{id:o+"_dialogImgContent",className:"e-ie-dlg-img-content"})));i.appendChild(e.createElement("canvas",{id:o+"_imgPic",className:"e-ie-img-dlg-canvas"}));i.appendChild(e.createElement("div",{id:o+"_imageNameContainer",className:"e-ie-img-size"})).appendChild(e.createElement("span",{id:o+"_imageNameLabel",className:"e-ie-quality-info"}));var i=t.appendChild(e.createElement("div",{id:o+"_dialogRightContent",className:"e-ie-dlg-right-content"})),r=i.appendChild(e.createElement("div",{id:o+"_namediv",className:"e-ie-img-save-name"})),r=(r.appendChild(e.createElement("span",{id:o+"_labelImgname",className:"e-ie-img-label-name",innerHTML:this.l10n.getConstant("ImageName")})),r.appendChild(e.createElement("input",{id:o+"_imgNametext",className:"e-ie-img-input",attrs:{type:"text"}})),i.appendChild(e.createElement("div",{id:o+"_imgNamediv",className:"e-ie-img-save-dlg"}))),r=(r.appendChild(e.createElement("span",{id:o+"_labelname",className:"e-ie-img-label-name",innerHTML:this.l10n.getConstant("Format")})),r.appendChild(e.createElement("button",{id:o+"_saveDropdownbtn",attrs:{tabindex:"1"}})),i.appendChild(e.createElement("div",{id:o+"_imgQualitydiv",className:"e-ie-img-quality-name"}))),s=e.createElement("div",{id:o+"_qualityContainer"});s.appendChild(e.createElement("span",{id:o+"_qualityLabel",className:"e-ie-img-quality-label",innerHTML:this.l10n.getConstant("Quality")})),s.appendChild(e.createElement("span",{id:o+"_qualityInfo",className:"e-circle-info e-icons e-ie-quality-span",attrs:{title:this.l10n.getConstant("QualityInfo")}}));s.appendChild(e.createElement("div",{id:o+"_imgsizeSpan",className:"e-ie-img-size-value-span"})).appendChild(e.createElement("span",{id:o+"_imgsizeValueSpan",className:""})),r.appendChild(s);var s=e.createElement("div",{id:o+"_qualityOptionContainer",className:"e-ie-quality-option-container"}),a=r.appendChild(e.createElement("div",{id:o+"_qualityButtonGroup",className:"e-btn-group"})),l=(["Good","Great","Highest"].forEach(function(e){var t=document.createElement("input"),i=(t.type="radio",t.id=o+"_"+e.toLowerCase(),t.name="quality",t.value=e.toLowerCase(),document.createElement("label"));i.className="e-btn",i.htmlFor=e.toLowerCase(),i.textContent=n.l10n.getConstant(e),a.appendChild(t),a.appendChild(i)}),s.appendChild(a),s.appendChild(e.createElement("div",{id:o+"_qualitySlider",className:"e-ie-img-quality-slider"})),s.appendChild(e.createElement("button",{id:o+"_qualitybuttonIcon",className:"e-ie-img-icon-button",attrs:{type:"button"}})),r.appendChild(s),F.isDevice&&i.appendChild(e.createElement("span",{id:o+"_qualitySize",className:"e-ie-img-quality-size"})),e.element.querySelector("#"+o+"_saveDialog").style.display="block",e.element.appendChild(t),new pS({target:e.element,header:this.l10n.getConstant("SaveAs"),closeOnEscape:!0,content:document.getElementById(o+"_dialogContent"),width:F.isDevice?"345px":"570px",isModal:!0,animationSettings:{effect:"Zoom"},beforeOpen:this.onBeforeopen(),close:this.saveDialogClosed.bind(this,o),cssClass:"e-ie-save-dialog",buttons:[{click:function(){l.hide()},buttonModel:{content:this.l10n.getConstant("Close"),cssClass:"e-save-cancel-btn"}},{click:function(){n.download(),l.hide(),n.isSlider=!1},buttonModel:{isPrimary:!0,content:this.l10n.getConstant("Download"),cssClass:"e-flat e-save-download-btn"}}]}));l.appendTo("#"+o+"_saveDialog")},RUt.prototype.saveDialogClosed=function(e){At(document.getElementById(e+"_saveDropdownbtn"),"dropdownbutton")&&At(document.getElementById(e+"_saveDropdownbtn"),"dropdownbutton").destroy(),this.isSlider=!1,document.querySelector("#"+e+"_qualityButtonGroup")&&document.querySelector("#"+e+"_qualitySlider")&&(document.querySelector("#"+e+"_qualityButtonGroup").remove(),document.querySelector("#"+e+"_qualitySlider").remove(),document.querySelector("#"+e+"_imgsizeValueSpan").remove(),document.querySelector("#"+e+"_imageNameLabel").remove(),document.querySelector("#"+e+"_imgsizeSpan").remove()),document.getElementById(e+"_dialogContent").remove(),At(document.getElementById(e+"_saveDialog"),"dialog").destroy(),document.getElementById(e+"_saveDialog").remove()},RUt.prototype.onBeforeopen=function(){var t=this,e=this.parent,i=e.element.id,n={canvas:null},o=(new fV({placeholder:this.l10n.getConstant("ImageName")}).appendTo("#"+i+"_imgNametext"),document.getElementById(i+"_imgQualitydiv")),r=document.getElementById(i+"_qualitySlider"),s=document.querySelector("#"+i+"_qualityButtonGroup"),a=document.querySelector("#"+i+"_qualitybuttonIcon"),l=document.querySelector("#"+i+"_imgsizeSpan"),h=F.isDevice?document.getElementById(i+"_qualitySize"):document.getElementById(i+"_imageNameLabel"),d={fileName:"",fileType:""},e=(e.notify("draw",{prop:"getFileName",onPropertyChange:!1,value:{obj:d}}),this.fileType=d.fileType||"JPEG",e.notify("export",{prop:"exportToCanvas",value:{object:n}}),n.canvas),p=document.getElementById(i+"_imgPic");p.width=e.width,p.height=e.height;new zv({iconCss:"e-icons e-settings"}).appendTo("#"+i+"_qualitybuttonIcon");var c,u,p=document.getElementById(i+"_saveDropdownbtn");p&&((c=document.createElement("span")).innerHTML="Webp"===this.fileType?"Webp":this.fileType.toUpperCase(),p&&p.appendChild(c),(u=new u2({items:[{id:"jpeg",text:"JPEG"},{id:"png",text:"PNG"},{id:"svg",text:"SVG"},{id:"webp",text:"WebP"}],open:function(e){F.isDevice&&(e.element.parentElement.style.top=u.element.getBoundingClientRect().top-e.element.parentElement.offsetHeight+"px");var t=c.innerHTML;""!==t&&e.element.querySelector('[aria-label = "'+t+'"]').classList.add("e-selected-btn")},select:function(e){l.style.display="none",t.fileType=c.innerHTML=e.item.text,"jpeg"!==e.item.id?(o.style.display="none",h.style.display="block",t.updateImageSize(1,n.canvas,t.fileType),r&&(t.isSlider&&At(r,"slider").destroy(),r.style.display="none"),t.isSlider=!1):(o.style.display="block",q([s],"e-hide"),r.style.display="none",h.style.display="block",t.updateImageSize(je(t.currentQuality)?1:t.currentQuality,n.canvas,t.fileType),document.getElementById(i+"_"+t.imageQuality).checked=!0)}})).appendTo("#"+i+"_saveDropdownbtn"),document.getElementById(i+"_imgNametext").value=this.fileName||d.fileName,d.fileType&&"JPEG"!==d.fileType.toUpperCase()&&(o.style.display="none",l.style.display="none"),F.isDevice&&(document.getElementById(i+"_dialogImgContent").style.display="none",document.getElementById(i+"_dialogRightContent").style.width="100%"),this.updateImageSize(1,n.canvas,this.fileType)),document.getElementById(i+"_"+this.imageQuality).checked=!0,s.addEventListener("click",this.qualityBtnClickHandler.bind(this)),a.addEventListener("click",this.qualityBtnClickHandler.bind(this))},RUt.prototype.qualityBtnClickHandler=function(e){var t=this,i=this.parent,n=i.element.id,o=e.target,r={canvas:null},s={Good:.8,Great:.9,Highest:1},a=document.querySelector("#"+n+"_qualityButtonGroup"),l=document.querySelector("#"+n+"_qualitySlider"),h=document.querySelector("#"+n+"_qualityOptionContainer"),d=document.querySelector("#"+n+"_imgsizeSpan"),p=document.querySelector("#"+n+"_imgsizeValueSpan");i.notify("draw",{prop:"getFileName",onPropertyChange:!1,value:{obj:{fileName:""}}}),i.notify("export",{prop:"exportToCanvas",value:{object:r}}),e.currentTarget.id!==n+"_qualitybuttonIcon"||this.isSlider?e.currentTarget.id===n+"_qualitybuttonIcon"&&this.isSlider?(At(l,"slider").destroy(),l.style.display="none",d.style.display="none",q([a],"e-hide"),h.style.display="block",this.isSlider=!1):s.hasOwnProperty(o.textContent)&&!this.isSlider&&(e.target.previousElementSibling.checked=!0,this.currentQuality=s[o.textContent],this.imageQuality=o.textContent.toLowerCase(),this.updateImageSize(s[o.textContent],r.canvas,"jpeg")):(U([a],"e-hide"),l.style.display="block",d.style.display="inline-block",h.style.display="flex",(e=new KO({tooltip:{placement:"Before",isVisible:!0,format:"P0",showOn:"Focus"},min:.01,max:1,step:.01,value:this.currentQuality,type:"MinRange",width:F.isDevice?"80%":"190px",created:function(){t.updateImageSize(t.currentQuality,r.canvas,"jpeg"),p.innerHTML=Math.round(100*t.currentQuality).toString()},changed:function(e){t.currentQuality=e.value,p.innerHTML=Math.round(100*t.currentQuality).toString(),i.notify("export",{prop:"setImageQuality",value:{value:e.value}}),t.updateImageSize(e.value,r.canvas,"jpeg")}})).appendTo("#"+n+"_qualitySlider"),e.element.parentElement.classList.add("e-ie-quality-slider"),this.isSlider=!0)},RUt.prototype.updateImageSize=function(e,t,i){var n,o,r=this.parent.element.id,s=document.getElementById(r+"_imgPic"),a=s.getContext("2d"),l=F.isDevice?document.getElementById(r+"_qualitySize"):document.getElementById(r+"_imageNameLabel");"jpeg"===i.toLowerCase()?t.toBlob(function(e){var t,i;n=1e3<(n=Math.floor(e.size/1024))?(t=n/1024,l.innerHTML=this.l10n.getConstant("ImageSize")+": "+t.toFixed(2)+" MB",+t.toFixed(2)):(l.innerHTML=this.l10n.getConstant("ImageSize")+": "+n.toFixed(2)+" KB",+n.toFixed(2)),F.isDevice?s.style.display="none":((i=new Image).src=URL.createObjectURL(e),i.onload=function(){a.drawImage(i,0,0),URL.revokeObjectURL(i.src)}),this.fileSize=n}.bind(this),"image/jpeg",e):je(i)||"png"!==i.toLowerCase()&&"webp"!==i.toLowerCase()?je(i)||"svg"!==i.toLowerCase()?F.isDevice?s.style.display="none":(a.drawImage(t,0,0),1e3<this.initialSize?(o=this.initialSize/1048576,l.innerHTML=this.l10n.getConstant("ImageSize")+": "+o.toFixed(2)+" MB"):l.innerHTML=this.l10n.getConstant("ImageSize")+": "+this.initialSize.toFixed(2)+" KB"):(a.drawImage(t,0,0),r=t.toDataURL("image/svg+xml").split(",")[1].length,e=1e3<(e=Math.floor(r/1024))?(o=e/1024,l.innerHTML=this.l10n.getConstant("ImageSize")+": "+o.toFixed(2)+" MB",+o.toFixed(2)):(l.innerHTML=this.l10n.getConstant("ImageSize")+": "+e.toFixed(2)+" KB",+e.toFixed(2)),F.isDevice&&(s.style.display="none"),this.fileSize=e):(r="image/"+i.toLowerCase(),a.drawImage(t,0,0),t.toBlob(function(e){n=1e3<(n=Math.floor(e.size/1024))?(e=n/1024,l.innerHTML=this.l10n.getConstant("ImageSize")+": "+e.toFixed(2)+" MB",+e.toFixed(2)):(l.innerHTML=this.l10n.getConstant("ImageSize")+": "+n.toFixed(2)+" KB",+n.toFixed(2)),F.isDevice&&(s.style.display="none"),this.fileSize=n}.bind(this),r,1))},RUt.prototype.download=function(){var e=this.parent,t=e.element.id,i=("JPEG"===this.fileType&&this.isSlider?(i=At(document.getElementById(t+"_qualitySlider"),"slider").value,e.notify("export",{prop:"setImageQuality",value:{value:i}})):e.notify("export",{prop:"setImageQuality",value:{value:this.currentQuality}}),document.getElementById(t+"_imgNametext").value);e.export(this.fileType,i)},RUt.prototype.getCropTransformToolbarItem=function(){var e,t=this.parent,i=t.element.id,n=[];return n.push({id:i+"_crop",tooltipText:this.l10n.getConstant("CropSelection"),align:"Center",template:'<button id="'+i+'_cropBtn"></button>'}),n.push({align:"Center",type:"Separator"}),(je(t.toolbar)||t.toolbar&&(-1<t.toolbar.indexOf("Transform")||-1<t.toolbar.indexOf("RotateLeft")))&&n.push({id:i+"_rotateLeft",prefixIcon:"e-icons e-anti-clock-wise",tooltipText:this.l10n.getConstant("RotateLeft"),align:"Center"}),(je(t.toolbar)||t.toolbar&&(-1<t.toolbar.indexOf("Transform")||-1<t.toolbar.indexOf("RotateRight")))&&n.push({id:i+"_rotateRight",prefixIcon:"e-icons e-clock-wise",tooltipText:this.l10n.getConstant("RotateRight"),align:"Center"}),2<n.length&&n.push({align:"Center",type:"Separator"}),(je(t.toolbar)||t.toolbar&&(-1<t.toolbar.indexOf("Transform")||-1<t.toolbar.indexOf("HorizontalFlip")))&&n.push({id:i+"_horizontalFlip",prefixIcon:"e-icons e-horizontal-flip",tooltipText:this.l10n.getConstant("HorizontalFlip"),align:"Center"}),(je(t.toolbar)||t.toolbar&&(-1<t.toolbar.indexOf("Transform")||-1<t.toolbar.indexOf("VerticalFlip")))&&n.push({id:i+"_verticalFlip",prefixIcon:"e-icons e-vertical-flip",tooltipText:this.l10n.getConstant("VerticalFlip"),align:"Center"}),(je(t.toolbar)||t.toolbar&&-1<t.toolbar.indexOf("Straightening"))&&!F.isDevice&&(n.push({align:"Center",type:"Separator"}),je(t.toolbar)||t.toolbar&&-1<t.toolbar.indexOf("Straightening"))&&((e=document.createElement("span")).innerHTML=this.l10n.getConstant("Straighten"),n.push({id:i+"_straightenSpan",cssClass:"e-ie-straighten-span",template:e,align:"Center"}),n.push({id:i+"_straighten",cssClass:"top-icon e-straighten",tooltipText:this.l10n.getConstant("Straighten"),align:"Center",type:"Input",template:'<div id="'+i+'_straightenSlider"></div>'}),(e=document.createElement("span")).innerHTML=t.transform.straighten.toString()+"&#176",n.push({id:i+"_straightenSpan",cssClass:"e-ie-straighten-value-span",template:e,align:"Center"})),F.isDevice||(n.push({id:i+"_ok",prefixIcon:"e-icons e-check",cssClass:"top-icon e-tick",tooltipText:this.l10n.getConstant("OK"),align:"Right",tabIndex:0}),n.push({id:i+"_cancel",prefixIcon:"e-icons e-close",cssClass:"top-icon e-save",tooltipText:this.l10n.getConstant("Cancel"),align:"Right"})),n},RUt.prototype.getShapesToolbarItem=function(e){for(var t=this.parent,i=t.element.id,n=[],o=((je(t.toolbar)||t.toolbar)&&n.push({id:i+"_annotation",tooltipText:this.l10n.getConstant("Annotation"),align:"Center",template:'<button id="'+i+'_annotationBtn"></button>'}),-1<e.indexOf("fillColor")&&n.push({prefixIcon:"e-icons e-copy",id:i+"_fillcolor",cssClass:"top-icon e-fill",tooltipText:this.l10n.getConstant("FillColor"),align:"Center",type:"Input",template:'<button id="'+i+'_fillColorBtn"></button>'}),-1<e.indexOf("strokeColor")&&n.push({prefixIcon:"e-icons e-copy",id:i+"_strokecolor",cssClass:"top-icon e-stroke",tooltipText:this.l10n.getConstant("StrokeColor"),align:"Center",type:"Input",template:'<button id="'+i+'_borderColorBtn"></button>'}),-1<e.indexOf("strokeWidth")&&n.push({id:i+"_strokeWidth",cssClass:"top-icon e-size",tooltipText:this.l10n.getConstant("StrokeWidth"),align:"Center",type:"Input",template:'<button id="'+i+'_borderWidthBtn"></button>'}),-1<e.indexOf("start")&&n.push({id:i+"_start",cssClass:"top-icon e-size",tooltipText:this.l10n.getConstant("Start"),align:"Center",type:"Input",template:'<button id="'+i+'_startBtn"></button>'}),-1<e.indexOf("borderRadius")&&n.push({id:i+"_rectangleRadius",cssClass:"top-icon e-size",tooltipText:this.l10n.getConstant("BorderRadius"),align:"Center",type:"Input",template:'<button id="'+i+'_rectangleRadiusBtn"></button>'}),-1<e.indexOf("end")&&n.push({id:i+"_end",cssClass:"top-icon e-size",tooltipText:this.l10n.getConstant("End"),align:"Center",type:"Input",template:'<button id="'+i+'_endBtn"></button>'}),-1<e.indexOf("flip")&&(n.push({id:i+"_rotLeft",prefixIcon:"e-anti-clock-wise",tooltipText:this.l10n.getConstant("RotateLeft"),align:"Center"}),n.push({id:i+"_rotRight",prefixIcon:"e-clock-wise",tooltipText:this.l10n.getConstant("RotateRight"),align:"Center"}),n.push({id:i+"_hFlip",prefixIcon:"e-horizontal-flip",tooltipText:this.l10n.getConstant("HorizontalFlip"),align:"Center"}),n.push({id:i+"_vFlip",prefixIcon:"e-vertical-flip",tooltipText:this.l10n.getConstant("VerticalFlip"),align:"Center"})),-1<e.indexOf("transparency")&&(n.push({align:"Center",type:"Separator"}),n.push({id:i+"_transparency",prefixIcon:"e-opacity",tooltipText:this.l10n.getConstant("Opacity"),align:"Center"})),n.push({align:"Center",type:"Separator"}),-1<e.indexOf("z-order")&&n.push({id:i+"_zOrder",cssClass:"top-icon e-list-unordered-3",tooltipText:this.l10n.getConstant("ZOrder"),align:"Center",type:"Input",template:'<button id="'+i+'_zOrderBtn"></button>'}),-1<e.indexOf("duplicate")&&n.push({id:i+"_duplicate",prefixIcon:"e-icons e-order",cssClass:"top-icon e-order",tooltipText:this.l10n.getConstant("Duplicate"),align:"Center"}),-1<e.indexOf("remove")&&n.push({id:i+"_remove",prefixIcon:"e-icons e-trash",cssClass:"top-icon e-trash",tooltipText:this.l10n.getConstant("Remove"),align:"Center"}),-1<e.indexOf("text")&&n.push({id:i+"_editText",prefixIcon:"e-icons e-annotation-edit",cssClass:"top-icon e-annotation-edit",tooltipText:this.l10n.getConstant("EditText"),align:"Center"}),this.processSubToolbar(e)),r=0,s=o.length;r<s;r++)n.push(o[r]);return F.isDevice||(t.notify("selection",{prop:"getCurrentDrawingShape",value:{obj:e={shape:null}}}),"path"!==e.shape&&(n.push({id:i+"_ok",prefixIcon:"e-icons e-check",cssClass:"top-icon e-tick",tooltipText:this.l10n.getConstant("OK"),align:"Right",tabIndex:0}),n.push({id:i+"_cancel",prefixIcon:"e-icons e-close",cssClass:"top-icon e-save",tooltipText:this.l10n.getConstant("Cancel"),align:"Right"}))),n},RUt.prototype.initCropTransformToolbar=function(e,t){var i=this,n=this.parent,o=n.element.id,r=this.getLeftToolbarItem(),s=this.getRightToolbarItem(),a=this.getCropTransformToolbarItem(),l=this.getZoomToolbarItem(),r=(F.isDevice?this.defToolbarItems=a:this.defToolbarItems=r.concat(l,a,s),{toolbarType:"crop-transform",toolbarItems:this.defToolbarItems}),h=(n.trigger("toolbarUpdating",r),this.defToolbarItems=r.toolbarItems,new U3({width:"100%",items:this.defToolbarItems,clicked:this.defToolbarClicked.bind(this),created:function(){i.renderCropBtn(e),i.renderStraightenSlider(),i.wireZoomBtnEvents(),n.trigger("toolbarCreated",{toolbarType:"shapes"}),F.isDevice?0<i.defToolbarItems.length&&document.getElementById(o+"_bottomToolbar")&&(h.refreshOverflow(),h.refreshOverflow(),h.refreshOverflow()):(i.createLeftToolbarControls(),0<i.defToolbarItems.length&&document.getElementById(o+"_toolbar")&&h.refreshOverflow()),document.getElementById(o+"_cropBtn")&&je(t)&&(F.isDevice||n.notify("draw",{prop:"select",onPropertyChange:!1,value:{type:i.getCropTextContent(document.getElementById(o+"_cropBtn")).toLowerCase(),startX:null,startY:null,width:null,height:null}}))}})),l=(F.isDevice?h.appendTo("#"+o+"_bottomToolbar"):h.appendTo("#"+o+"_toolbar"),n.element.querySelector("#"+o+"_straightenSlider"));(je(n.toolbar)||n.toolbar&&-1<n.toolbar.indexOf("Straightening"))&&l&&l.parentElement.clientHeight>this.toolbarHeight&&(this.toolbarHeight=n.toolbarHeight=l.parentElement.clientHeight),this.enableDisableTbrBtn(),n.notify("transform",{prop:"disableZoomOutBtn",value:{isZoomOut:!0}})},RUt.prototype.getCropTextContent=function(e){if(e){var t,i={"e-custom":"Custom","e-circle":"Circle","e-square":"Square","e-custom-a":"3:2","e-custom-b":"4:3","e-custom-c":"5:4","e-custom-d":"7:5","e-custom-e":"16:9","e-custom-f":"2:3","e-custom-g":"3:4","e-custom-h":"4:5","e-custom-i":"5:7","e-custom-j":"9:16"},n=e.children[0].classList;for(t in i)if(n.contains(t))return i[t]}return""},RUt.prototype.getCurrentShapeIcon=function(e){var t={rectangle:"e-rectangle",ellipse:"e-circle",line:"e-line",arrow:"e-arrow-right-up",path:"e-critical-path",text:"e-add-text",image:"e-image",pen:"e-free-pen","crop-custom":"e-custom","crop-circle":"e-circle","crop-square":"e-square","crop-3:2":"e-custom-a","crop-4:3":"e-custom-b","crop-5:4":"e-custom-c","crop-7:5":"e-custom-d","crop-16:9":"e-custom-e","crop-2:3":"e-custom-f","crop-3:4":"e-custom-g","crop-4:5":"e-custom-h","crop-5:7":"e-custom-i","crop-9:16":"e-custom-j"};return t[e]||(e&&-1!==e.indexOf("crop-")?"e-custom":"e-free-pen")},RUt.prototype.initShapesToolbarItem=function(e){var t=this,i=this.parent,n=i.element.id,o=this.getLeftToolbarItem(),r=this.getRightToolbarItem(),s=this.getShapesToolbarItem(e),a=this.getZoomToolbarItem(),o=(F.isDevice?this.defToolbarItems=s:this.defToolbarItems=o.concat(a,s,r),{toolbarType:i.activeObj.shape||"shapes",toolbarItems:this.defToolbarItems}),l=(i.trigger("toolbarUpdating",o),this.isToolbarString(o.toolbarItems)?(e=o.toolbarItems,this.excludeItems(o.toolbarItems)):this.defToolbarItems=o.toolbarItems,new U3({width:"100%",items:this.defToolbarItems,clicked:this.defToolbarClicked.bind(this),created:function(){t.renderAnnotationBtn(!0),t.createRectangleRadius(e),t.createShapeColor(e),t.createShapeBtn(e),t.createZOrderBtn(e),"arrow"===i.activeObj.shape&&(e.some(function(e){return-1<e.toLowerCase().indexOf("start")})&&t.createStartBtn(),e.some(function(e){return-1<e.toLowerCase().indexOf("end")}))&&t.createEndBtn(),t.wireZoomBtnEvents(),i.trigger("toolbarCreated",{toolbarType:"shapes"}),F.isDevice?0<t.defToolbarItems.length&&document.getElementById(n+"_bottomToolbar")&&(l.refreshOverflow(),l.refreshOverflow(),l.refreshOverflow()):(t.createLeftToolbarControls(),0<t.defToolbarItems.length&&document.getElementById(n+"_toolbar")&&l.refreshOverflow())}}));F.isDevice?l.appendTo("#"+n+"_bottomToolbar"):l.appendTo("#"+n+"_toolbar"),this.enableDisableTbrBtn()},RUt.prototype.createRectangleRadius=function(e){var t,i,n,o=this,r=this.parent,s=r.element.id;-1<e.indexOf("borderRadius")&&(e=[{id:"1",text:this.l10n.getConstant("0")},{id:"2",text:this.l10n.getConstant("20")},{id:"3",text:this.l10n.getConstant("40")},{id:"4",text:this.l10n.getConstant("60")},{id:"5",text:this.l10n.getConstant("80")},{id:"6",text:this.l10n.getConstant("100")}],t=document.getElementById(s+"_rectangleRadiusBtn"),(i=document.createElement("span")).innerHTML=this.l10n.getConstant(r.frameObj.radius.toString()),i.className="e-shape-rectangle-radius",t.appendChild(i),(n=new u2({items:e,open:function(e){F.isDevice&&((t=e.element.parentElement).style.top=n.element.getBoundingClientRect().top-t.offsetHeight+"px");var t=n.element.childNodes[0].textContent;""!==t&&e.element.querySelector('[aria-label = "'+t+'"]').classList.add("e-selected-btn")},select:function(e){o.triggerTbarClickEvent(e),i.textContent=e.item.text,r.updateStrokeWidth(e.item.id,"radius"),F.isDevice?document.getElementById(s+"_bottomToolbar")&&At(s+"_bottomToolbar","toolbar").refreshOverflow():document.getElementById(s+"_toolbar")&&At(s+"_toolbar","toolbar").refreshOverflow(),r.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1})}})).appendTo("#"+s+"_rectangleRadiusBtn"))},RUt.prototype.beforeModeSwitch=function(e,t){this.popupLeft=e.element.offsetParent.style.left,"Picker"===e.mode?(t.showButtons=!0,t.dataBind(),e.element.querySelector(".e-apply").title=this.l10n.getConstant("Apply"),e.element.querySelector(".e-cancel").title=this.l10n.getConstant("Cancel"),e.element.querySelector(".e-mode-switch-btn").title=this.l10n.getConstant("StandardColors")):(t.showButtons=!1,t.dataBind(),e.element.querySelector(".e-mode-switch-btn").title=this.l10n.getConstant("MoreColors"))},RUt.prototype.createShapeColor=function(e){var t,i,n,o,r=this,s=this.parent,a=s.element.id;-1<e.indexOf("fillColor")&&(s.element.querySelector(".e-template.e-fill").appendChild(s.createElement("input",{id:a+"_shape_fill"})),t=new cV({modeSwitcher:!0,noColor:!0,value:"",inline:!0,showButtons:!1,mode:"Palette",cssClass:"e-shape-fill-color",beforeModeSwitch:function(e){return r.beforeModeSwitch(e,t)},presetColors:{custom:["","#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"]},beforeTileRender:function(e){""===e.value&&e.element.classList.add("e-nocolor-item")},change:function(e){s.updateFillColor(e.value),""===e.currentValue.rgba?i.element.children[0].classList.add("e-nocolor-item"):(i.element.children[0].classList.remove("e-nocolor-item"),i.element.children[0].style.backgroundColor=e.currentValue.rgba),i.toggle(),s.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1})},onModeSwitch:function(e){F.isDevice&&(e.element.parentElement.parentElement.style.left=r.popupLeft,e.element.parentElement.parentElement.style.top=i.element.getBoundingClientRect().top-e.element.parentElement.parentElement.offsetHeight+"px")},beforeClose:function(){i.toggle()}},"#"+a+"_shape_fill"),i=new u2({open:function(e){e=e.element.parentElement;F.isDevice&&(e.style.top=i.element.getBoundingClientRect().top-e.offsetHeight+"px",window.innerWidth<=520)&&(e.style.left=s.element.offsetLeft+"px")},target:".e-shape-fill-color",iconCss:"e-dropdownbtn-preview",cssClass:"e-ie-ddb-popup"},"#"+a+"_fillColorBtn"),t.inline=!0,t.value=t.getValue(t.value,"rgba"),s.element.querySelector(".e-fill.e-template .e-dropdownbtn-preview").classList.add("e-nocolor-item")),-1<e.indexOf("strokeColor")&&(s.element.querySelector(".e-template.e-stroke").appendChild(s.createElement("input",{id:a+"_shape_stroke"})),n=new cV({modeSwitcher:!0,noColor:!1,value:"#fff",inline:!0,showButtons:!1,mode:"Palette",cssClass:"e-shape-stroke-color",beforeModeSwitch:function(e){r.popupLeft=e.element.offsetParent.style.left,n.value="#fff"!==s.activeObj.strokeSettings.strokeColor?s.activeObj.strokeSettings.strokeColor:"#008000ff",r.beforeModeSwitch(e,n)},presetColors:this.presetColors,change:function(e){s.updateStrokeColor(e.value),o.element.children[0].style.backgroundColor=e.currentValue.rgba,o.toggle(),s.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1})},onModeSwitch:function(e){F.isDevice&&(e.element.parentElement.parentElement.style.left=r.popupLeft,e.element.parentElement.parentElement.style.top=o.element.getBoundingClientRect().top-e.element.parentElement.parentElement.offsetHeight+"px")},beforeClose:function(){o.toggle()}},"#"+a+"_shape_stroke"),o=new u2({open:function(e){e=e.element.parentElement;F.isDevice&&(e.style.top=o.element.getBoundingClientRect().top-e.offsetHeight+"px",window.innerWidth<=520)&&(e.style.left=s.element.offsetLeft+"px")},target:".e-shape-stroke-color",iconCss:"e-dropdownbtn-preview",cssClass:"e-ie-ddb-popup"},"#"+a+"_borderColorBtn"),n.inline=!0,n.value=n.getValue(n.value,"rgba"),s.element.querySelector(".e-stroke.e-template .e-dropdownbtn-preview").style.background="#fff")},RUt.prototype.createShapeBtn=function(e){var t,i,n,o=this,r=this.parent,s=r.element.id;-1<e.indexOf("strokeWidth")&&(e=[{id:"1",text:this.l10n.getConstant("XSmall")},{id:"2",text:this.l10n.getConstant("Small")},{id:"3",text:this.l10n.getConstant("Medium")},{id:"4",text:this.l10n.getConstant("Large")},{id:"5",text:this.l10n.getConstant("XLarge")}],!r.activeObj.shape||"rectangle"!==r.activeObj.shape&&"ellipse"!==r.activeObj.shape||(e=[{id:"1",text:this.l10n.getConstant("NoOutline")},{id:"2",text:this.l10n.getConstant("XSmall")},{id:"3",text:this.l10n.getConstant("Small")},{id:"4",text:this.l10n.getConstant("Medium")},{id:"5",text:this.l10n.getConstant("Large")},{id:"6",text:this.l10n.getConstant("XLarge")}]),t=document.getElementById(s+"_borderWidthBtn"),(i=document.createElement("span")).innerHTML=this.l10n.getConstant("XSmall"),i.className="e-shape-stroke-width",t.appendChild(i),(n=new u2({items:e,open:function(e){F.isDevice&&(e.element.parentElement.style.top=n.element.getBoundingClientRect().top-e.element.parentElement.offsetHeight+"px");var t=i.innerHTML;""!==t&&e.element.querySelector('[aria-label = "'+t+'"]').classList.add("e-selected-btn")},select:function(e){o.triggerTbarClickEvent(e),i.textContent=e.item.text,r.updateStrokeWidth(e.item.id,"width",r.activeObj.shape),F.isDevice?document.getElementById(s+"_bottomToolbar")&&At(s+"_bottomToolbar","toolbar").refreshOverflow():document.getElementById(s+"_toolbar")&&At(s+"_toolbar","toolbar").refreshOverflow(),r.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1})}})).appendTo("#"+s+"_borderWidthBtn"))},RUt.prototype.createZOrderBtn=function(e){var t,i=this,n=this.parent,o=n.element.id;-1<e.indexOf("z-order")&&(e=[{text:this.l10n.getConstant("BringForward"),id:"bringForward",iconCss:"e-icons e-bring-forward"},{text:this.l10n.getConstant("SendBackward"),id:"sendBackward",iconCss:"e-icons e-send-backward"},{text:this.l10n.getConstant("BringToFront"),id:"bringToFront",iconCss:"e-icons e-bring-to-front"},{text:this.l10n.getConstant("SendToBack"),id:"sendToBack",iconCss:"e-icons e-send-to-back"}],(t=new u2({items:e,iconCss:"e-icons e-layers",beforeOpen:function(e){document.getElementById(n.element.id+"_zOrderBtn").classList.contains("e-disabled")&&(e.cancel=!0);var t={freehandSelectedIndex:-1},i=(n.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!1,value:{obj:t}}),{order:null}),t=(n.notify("shape",{prop:"getHighestOrder",onPropertyChange:!1,value:{obj:i}}),n.activeObj.order||n.getObjFromId(n.pointColl[t.freehandSelectedIndex].id).order);t&&i.order<=t?(e.items[0].disabled=!0,e.items[2].disabled=!0):(e.items[0].disabled=!1,e.items[2].disabled=!1),n.notify("shape",{prop:"getLowestOrder",onPropertyChange:!1,value:{obj:i}}),t&&t<=i.order?(e.items[1].disabled=!0,e.items[3].disabled=!0):(e.items[1].disabled=!1,e.items[3].disabled=!1)},open:function(e){F.isDevice&&(e.element.parentElement.style.top=t.element.getBoundingClientRect().top-e.element.parentElement.offsetHeight+"px")},select:function(e){i.triggerTbarClickEvent(e);var t={freehandDrawSelectedId:null},t=(n.notify("freehand-draw",{prop:"getFreehandDrawSelectedId",onPropertyChange:!1,value:{obj:t}}),t.freehandDrawSelectedId||n.activeObj.currIndex);n.updateShapeOrder(t,e.item.id),F.isDevice?document.getElementById(o+"_bottomToolbar")&&At(o+"_bottomToolbar","toolbar").refreshOverflow():document.getElementById(o+"_toolbar")&&At(o+"_toolbar","toolbar").refreshOverflow(),-1<t.indexOf("shape")?n.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1}):-1<t.indexOf("pen")&&n.notify("undo-redo",{prop:"updateUndoRedoStack",value:{isPenDraw:!0}})}})).appendTo("#"+o+"_zOrderBtn"))},RUt.prototype.createStartBtn=function(){var t=this,i=this.parent,e=i.element.id,n=[{id:"1",text:this.l10n.getConstant("None")},{id:"2",text:this.l10n.getConstant("Bar")},{id:"3",text:this.l10n.getConstant("Arrow")},{id:"4",text:this.l10n.getConstant("ArrowSolid")},{id:"5",text:this.l10n.getConstant("Circle")},{id:"6",text:this.l10n.getConstant("CircleSolid")},{id:"7",text:this.l10n.getConstant("Square")},{id:"8",text:this.l10n.getConstant("SquareSolid")}],o=document.getElementById(e+"_startBtn"),r=document.createElement("span"),s=(je(i.activeObj.start)&&(i.activeObj.start="none"),r.innerHTML=i.pascalToSplitWords(i.activeObj.start),r.className="e-shape-start",o.appendChild(r),new u2({items:n,open:function(e){F.isDevice&&(e.element.parentElement.style.top=s.element.getBoundingClientRect().top-e.element.parentElement.offsetHeight+"px");var t=r.innerHTML;""!==t&&e.element.querySelector('[aria-label = "'+t+'"]').classList.add("e-selected-btn")},select:function(e){i.notify("selection",{prop:"setArrowShape",value:{type:"initial",shape:{1:"none",2:"bar",3:"arrow",4:"arrowSolid",5:"circle",6:"circleSolid",7:"square",8:"squareSolid"}[""+e.item.id]}}),t.triggerTbarClickEvent(e),r.textContent=e.item.text,i.updateArrow("startArrow",e.item.id),i.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1})}}));s.appendTo("#"+e+"_startBtn")},RUt.prototype.createEndBtn=function(){var t=this,i=this.parent,e=i.element.id,n=[{id:"1",text:this.l10n.getConstant("None")},{id:"2",text:this.l10n.getConstant("Bar")},{id:"3",text:this.l10n.getConstant("Arrow")},{id:"4",text:this.l10n.getConstant("ArrowSolid")},{id:"5",text:this.l10n.getConstant("Circle")},{id:"6",text:this.l10n.getConstant("CircleSolid")},{id:"7",text:this.l10n.getConstant("Square")},{id:"8",text:this.l10n.getConstant("SquareSolid")}],o=document.getElementById(e+"_endBtn"),r=document.createElement("span"),s=(je(i.activeObj.end)&&(i.activeObj.end="arrowSolid"),r.innerHTML=i.pascalToSplitWords(i.activeObj.end),r.className="e-shape-end",o.appendChild(r),new u2({items:n,open:function(e){F.isDevice&&(e.element.parentElement.style.top=s.element.getBoundingClientRect().top-e.element.parentElement.offsetHeight+"px");var t=r.innerHTML;""!==t&&e.element.querySelector('[aria-label = "'+t+'"]').classList.add("e-selected-btn")},select:function(e){i.notify("selection",{prop:"setArrowShape",value:{type:"final",shape:{1:"none",2:"bar",3:"arrow",4:"arrowSolid",5:"circle",6:"circleSolid",7:"square",8:"squareSolid"}[""+e.item.id]}}),t.triggerTbarClickEvent(e),r.textContent=e.item.text,i.updateArrow("endArrow",e.item.id),i.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1})}}));s.appendTo("#"+e+"_endBtn")},RUt.prototype.getTextToolbarItem=function(e){for(var t=this.parent,i=t.element.id,n=[],o=((je(t.toolbar)||t.toolbar)&&n.push({id:i+"_annotation",tooltipText:this.l10n.getConstant("Annotation"),align:"Center",template:'<button id="'+i+'_annotationBtn"></button>'}),-1<e.indexOf("fontFamily")&&n.push({id:i+"_fontFamily",cssClass:"top-icon e-img-font-family",tooltipText:this.l10n.getConstant("FontFamily"),align:"Center",template:'<button id="'+i+'_fontFamilyBtn"></button>'}),-1<e.indexOf("fontSize")&&n.push({id:i+"_fontSize",cssClass:"top-icon e-img-font-size",tooltipText:this.l10n.getConstant("FontSize"),align:"Center",template:'<button id="'+i+'_fontSizeBtn"></button>'}),-1<e.indexOf("fontColor")&&n.push({cssClass:"top-icon e-text-font-color",id:i+"_text_strokecolor",tooltipText:this.l10n.getConstant("FontColor"),align:"Center",type:"Input",template:'<button id="'+i+'_fontColorBtn"></button>'}),-1<e.indexOf("strokeColor")&&n.push({cssClass:"top-icon e-stroke-text-font-color",id:i+"_stroke_text_color",tooltipText:this.l10n.getConstant("TextOutlineColor"),align:"Center",type:"Input",template:'<button id="'+i+'_strokeTextColorBtn"></button>'}),-1<e.indexOf("fillColor")&&n.push({cssClass:"top-icon e-text-background-color",id:i+"_text_backgroundcolor",tooltipText:this.l10n.getConstant("FillColor"),align:"Center",type:"Input",template:'<button id="'+i+'_bgColorBtn"></button>'}),-1<e.indexOf("bold")&&n.push({id:i+"_bold",prefixIcon:"e-icons e-bold",cssClass:"top-icon e-bold",tooltipText:this.l10n.getConstant("Bold"),align:"Center"}),-1<e.indexOf("italic")&&n.push({id:i+"_italic",prefixIcon:"e-icons e-italic",cssClass:"top-icon e-italic",tooltipText:this.l10n.getConstant("Italic"),align:"Center"}),-1<e.indexOf("strokeWidth")&&n.push({id:i+"_strokeWidth",cssClass:"top-icon e-size",tooltipText:this.l10n.getConstant("TextOutlineWidth"),align:"Center",type:"Input",template:'<button id="'+i+'_borderWidthBtn"></button>'}),-1<e.indexOf("transparency")&&n.push({id:i+"_transparency",prefixIcon:"e-opacity",tooltipText:this.l10n.getConstant("Opacity"),align:"Center"}),n.push({align:"Center",type:"Separator"}),-1<e.indexOf("z-order")&&n.push({id:i+"_zOrder",cssClass:"top-icon e-list-unordered-3",tooltipText:this.l10n.getConstant("ZOrder"),align:"Center",type:"Input",template:'<button id="'+i+'_zOrderBtn"></button>'}),-1<e.indexOf("duplicate")&&n.push({id:i+"_duplicate",prefixIcon:"e-icons e-order",cssClass:"top-icon e-order",tooltipText:this.l10n.getConstant("Duplicate"),align:"Center",disabled:"block"===t.textArea.style.display||"inline-block"===t.textArea.style.display}),-1<e.indexOf("remove")&&n.push({id:i+"_remove",prefixIcon:"e-icons e-trash",cssClass:"top-icon e-trash",tooltipText:this.l10n.getConstant("Remove"),align:"Center",disabled:"block"===t.textArea.style.display||"inline-block"===t.textArea.style.display}),-1<e.indexOf("text")&&n.push({id:i+"_editText",prefixIcon:"e-icons e-annotation-edit",cssClass:"top-icon e-annotation-edit",tooltipText:this.l10n.getConstant("EditText"),align:"Center",disabled:"block"===t.textArea.style.display||"inline-block"===t.textArea.style.display}),this.processSubToolbar(e)),r=0,s=o.length;r<s;r++)n.push(o[r]);return F.isDevice||(n.push({id:i+"_ok",prefixIcon:"e-icons e-check",cssClass:"top-icon e-tick",tooltipText:this.l10n.getConstant("OK"),align:"Right",tabIndex:0}),n.push({id:i+"_cancel",prefixIcon:"e-icons e-close",cssClass:"top-icon e-save",tooltipText:this.l10n.getConstant("Cancel"),align:"Right"})),n},RUt.prototype.getFontFamilyItems=function(){var e=this.parent;return e.fontFamily&&e.fontFamily.items&&0<e.fontFamily.items.length?e.fontFamily.items:F.isDevice?[{id:"arial",text:"ABC"},{id:"calibri",text:"ABC"},{id:"georgia",text:"ABC"},{id:"roboto",text:"ABC"},{id:"tahoma",text:"ABC"}]:[{id:"arial",text:"Arial"},{id:"calibri",text:"Calibri"},{id:"georgia",text:"Georgia"},{id:"roboto",text:"Roboto"},{id:"tahoma",text:"Tahoma"}]},RUt.prototype.initTextToolbarItem=function(e){var t=this,i=this.parent,n=i.element.id,o=this.getLeftToolbarItem(),r=this.getRightToolbarItem(),s=this.getTextToolbarItem(e),a=this.getZoomToolbarItem(),o=(F.isDevice?this.defToolbarItems=s:this.defToolbarItems=o.concat(a,s,r),{toolbarType:"text",toolbarItems:this.defToolbarItems}),l=(i.trigger("toolbarUpdating",o),this.isToolbarString(o.toolbarItems)?(e=o.toolbarItems,this.excludeItems(o.toolbarItems)):this.defToolbarItems=o.toolbarItems,new U3({width:"100%",items:this.defToolbarItems,clicked:this.defToolbarClicked.bind(this),created:function(){t.renderAnnotationBtn(!0),t.createTextColor(e),t.createStrokeTextColor(e),t.createShapeBtn(e),t.createBackgroundColor(e),t.createTextBtn(e),t.createZOrderBtn(e),t.wireZoomBtnEvents(),i.trigger("toolbarCreated",{toolbarType:"text"}),F.isDevice?0<t.defToolbarItems.length&&document.getElementById(n+"_bottomToolbar")&&(l.refreshOverflow(),l.refreshOverflow(),l.refreshOverflow()):(t.createLeftToolbarControls(),0<t.defToolbarItems.length&&document.getElementById(n+"_toolbar")&&l.refreshOverflow())}}));F.isDevice?l.appendTo("#"+n+"_bottomToolbar"):l.appendTo("#"+n+"_toolbar"),this.enableDisableTbrBtn()},RUt.prototype.createTextColor=function(e){var t,i,n=this,o=this.parent,r=o.element.id;-1<e.indexOf("fontColor")&&o.element.querySelector(".e-template.e-text-font-color")&&(o.element.querySelector(".e-template.e-text-font-color").appendChild(o.createElement("input",{id:r+"_text_font"})),t=new cV({modeSwitcher:!0,noColor:!1,value:"#fff",inline:!0,showButtons:!1,mode:"Palette",cssClass:"e-text-fontt-color",beforeModeSwitch:function(e){n.popupLeft=e.element.offsetParent.style.left,t.value="#fff"!==o.activeObj.strokeSettings.strokeColor?o.activeObj.strokeSettings.strokeColor:"#008000ff",n.beforeModeSwitch(e,t)},presetColors:this.presetColors,change:function(e){o.updateFontColor(e.value,"Text"),i.element.children[0].style.backgroundColor=e.currentValue.rgba,i.toggle(),0===o.activeObj.activePoint.width&&0===o.activeObj.activePoint.height||o.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1})},onModeSwitch:function(e){F.isDevice&&(e.element.parentElement.parentElement.style.left=n.popupLeft,e.element.parentElement.parentElement.style.top=i.element.getBoundingClientRect().top-e.element.parentElement.parentElement.offsetHeight+"px")},beforeClose:function(){i.toggle()}},"#"+r+"_text_font"),i=new u2({open:function(e){e=e.element.parentElement;F.isDevice&&(e.style.top=i.element.getBoundingClientRect().top-e.offsetHeight+"px",window.innerWidth<=520)&&(e.style.left=o.element.offsetLeft+"px")},target:".e-text-fontt-color",iconCss:"e-dropdownbtn-preview",cssClass:"e-ie-ddb-popup"},"#"+r+"_fontColorBtn"),t.inline=!0,t.value=t.getValue(t.value,"rgba"),o.element.querySelector(".e-text-font-color.e-template .e-dropdownbtn-preview").style.background="#fff")},RUt.prototype.createBackgroundColor=function(e){var t,i,n=this,o=this.parent,r=o.element.id;-1<e.indexOf("fillColor")&&o.element.querySelector(".e-template.e-text-background-color")&&(o.element.querySelector(".e-template.e-text-background-color").appendChild(o.createElement("input",{id:r+"_text_bgColor"})),t=new cV({modeSwitcher:!0,noColor:!0,value:"",inline:!0,showButtons:!1,mode:"Palette",cssClass:"e-text-fontt-color",beforeModeSwitch:function(e){n.popupLeft=e.element.offsetParent.style.left,n.beforeModeSwitch(e,t)},presetColors:{custom:["","#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"]},beforeTileRender:function(e){""===e.value&&e.element.classList.add("e-nocolor-item")},change:function(e){o.updateFontColor(e.value,"Background"),""===e.currentValue.rgba?i.element.children[0].classList.add("e-nocolor-item"):(i.element.children[0].classList.remove("e-nocolor-item"),i.element.children[0].style.backgroundColor=e.currentValue.rgba),i.toggle(),0===o.activeObj.activePoint.width&&0===o.activeObj.activePoint.height||o.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1})},onModeSwitch:function(e){F.isDevice&&(e.element.parentElement.parentElement.style.left=n.popupLeft,e.element.parentElement.parentElement.style.top=i.element.getBoundingClientRect().top-e.element.parentElement.parentElement.offsetHeight+"px")},beforeClose:function(){i.toggle()}},"#"+r+"_text_bgColor"),i=new u2({open:function(e){e=e.element.parentElement;F.isDevice&&(e.style.top=i.element.getBoundingClientRect().top-e.offsetHeight+"px",window.innerWidth<=520)&&(e.style.left=o.element.offsetLeft+"px")},target:".e-text-fontt-color",iconCss:"e-dropdownbtn-preview",cssClass:"e-ie-ddb-popup"},"#"+r+"_bgColorBtn"),t.inline=!0,t.value=t.getValue(t.value,"rgba"),o.element.querySelector(".e-text-background-color.e-template .e-dropdownbtn-preview").style.background="#fff")},RUt.prototype.createStrokeTextColor=function(e){var t,i,n=this,o=this.parent,r=o.element.id;-1<e.indexOf("strokeColor")&&o.element.querySelector(".e-template.e-stroke-text-font-color")&&(o.element.querySelector(".e-template.e-stroke-text-font-color").appendChild(o.createElement("input",{id:r+"_stroke_text"})),t=new cV({modeSwitcher:!0,noColor:!0,value:"",inline:!0,showButtons:!1,mode:"Palette",cssClass:"e-text-fontt-color",beforeModeSwitch:function(e){n.popupLeft=e.element.offsetParent.style.left,n.beforeModeSwitch(e,t)},presetColors:{custom:["","#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"]},beforeTileRender:function(e){""===e.value&&e.element.classList.add("e-nocolor-item")},change:function(e){o.updateStrokeTextColor(e.value),""===e.currentValue.rgba?i.element.children[0].classList.add("e-nocolor-item"):(i.element.children[0].classList.remove("e-nocolor-item"),i.element.children[0].style.backgroundColor=e.currentValue.rgba),i.toggle(),0===o.activeObj.activePoint.width&&0===o.activeObj.activePoint.height||o.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1})},onModeSwitch:function(e){F.isDevice&&(e.element.parentElement.parentElement.style.left=n.popupLeft,e.element.parentElement.parentElement.style.top=i.element.getBoundingClientRect().top-e.element.parentElement.parentElement.offsetHeight+"px")},beforeClose:function(){i.toggle()}},"#"+r+"_stroke_text"),i=new u2({open:function(e){e=e.element.parentElement;F.isDevice&&(e.style.top=i.element.getBoundingClientRect().top-e.offsetHeight+"px",window.innerWidth<=520)&&(e.style.left=o.element.offsetLeft+"px")},target:".e-text-fontt-color",iconCss:"e-dropdownbtn-preview",cssClass:"e-ie-ddb-popup"},"#"+r+"_strokeTextColorBtn"),t.inline=!0,t.value=t.getValue(t.value,"rgba"),o.element.querySelector(".e-stroke-text-font-color.e-template .e-dropdownbtn-preview").style.background="#fff")},RUt.prototype.createTextBtn=function(e){var t,i,n,o,r,s=this,a=this.parent,l=a.element.id;-1<e.indexOf("fontFamily")&&(n=document.getElementById(l+"_fontFamilyBtn"),t=document.createElement("span"),F.isDevice?(t.innerHTML="ABC",t.setAttribute("style","font-family: "+a.fontFamily.default.toLowerCase()+"'")):t.innerHTML=a.fontFamily.default,t.className="e-text-font-family",n&&n.appendChild(t),(i=new u2({items:this.getFontFamilyItems(),cssClass:"e-font-family",createPopupOnClick:!0,beforeItemRender:function(e){e.element.setAttribute("style","font-family:"+e.element.id)},open:function(e){F.isDevice&&(e.element.parentElement.style.top=i.element.getBoundingClientRect().top-e.element.parentElement.offsetHeight+"px"),t=("block"===a.textArea.style.display||"inline-block"===a.textArea.style.display?a.textArea.style:a.activeObj.textSettings).fontFamily;var t,e=e.element.querySelector('[id *= "'+t.toLowerCase()+'"]');e&&e.classList.add("e-selected-btn")},select:function(e){s.triggerTbarClickEvent(e),t.textContent=e.item.text,F.isDevice&&t.setAttribute("style","font-family:"+e.item.id),a.updateFontFamily(e.item.id),a.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1});e=document.getElementById(a.element.id+"_toolbar");e&&e.classList.contains("e-control")&&At(e,"toolbar").refreshOverflow()}})).appendTo("#"+l+"_fontFamilyBtn")),-1<e.indexOf("fontSize")&&(n=document.getElementById(l+"_fontSizeBtn"),o=document.createElement("span"),e=a.getFontSizes(),o.innerHTML=e[0].text,o.className="e-text-font-size",n.appendChild(o),(r=new u2({cssClass:"e-font-size",items:e,open:function(e){F.isDevice&&(e.element.parentElement.style.top=r.element.getBoundingClientRect().top-e.element.parentElement.offsetHeight+"px");var t=o.innerHTML;e.element.querySelector('[aria-label *= "'+t+'"]').classList.add("e-selected-btn")},select:function(e){s.triggerTbarClickEvent(e),o.textContent=e.item.text,a.updateFontSize(e.item.text),a.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1})}})).appendTo("#"+l+"_fontSizeBtn"))},RUt.prototype.refreshToolbar=function(e,t,i,n,o,r,s){var a=this.parent,l=a.element.id;if(a.isImageLoaded&&!a.isCropToolbar){var h,d,p,c,u={};switch("filter"!==e&&"color"!==e&&(h=document.getElementById(l+"_toolbar"),p=document.getElementById(l+"_customizeWrapper"),d=document.getElementById(l+"_bottomToolbar"),p&&At(p,"toolbar")&&0<this.defToolbarItems.length&&(At(p,"toolbar").destroy(),p.innerHTML=""),h&&h.classList.contains("e-control")&&0<this.defToolbarItems.length&&(At(h,"toolbar").destroy(),h.innerHTML=""),h&&(0<this.defToolbarItems.length||a.toolbar&&0<a.toolbar.length&&-1===a.toolbar.indexOf("Open"))&&(je(p=At(h,"toolbar"))||(p.destroy(),document.getElementById(a.element.id+"_toolbar").innerHTML="")),d)&&0<this.defToolbarItems.length&&-1<d.className.indexOf("e-control")&&(At(d,"toolbar").destroy(),d.innerHTML=""),this.refreshSlider(),document.querySelector(".e-slider-tooltip")&&document.querySelector(".e-slider-tooltip").remove(),this.isFrameToolbar=a.isCropTab=!1,e){case"main":F.isDevice?i?this.initMainToolbar(!1,!0,!0,!1,!1,!0):this.initMainToolbar(!1,!0,null,!1,!1,!0):F.isDevice&&!n||this.initMainToolbar(t,F.isDevice,null),F.isDevice&&this.initBottomToolbar();break;case"shapes":a.isPublicMethod||(a.noPushUndo=!0),F.isDevice&&this.initMainToolbar(!1,!0,!0),"line"===a.activeObj.shape||"path"===a.activeObj.shape?u.toolbarItems=["strokeColor","strokeWidth","z-order","duplicate","remove"]:"arrow"===a.activeObj.shape?u.toolbarItems=["strokeColor","strokeWidth","start","end","z-order","duplicate","remove"]:"image"===a.activeObj.shape?u.toolbarItems=["flip","z-order","duplicate","remove","transparency"]:"rectangle"===a.activeObj.shape?u.toolbarItems=["fillColor","strokeColor","strokeWidth","borderRadius","z-order","duplicate","remove"]:u.toolbarItems=["fillColor","strokeColor","strokeWidth","z-order","duplicate","remove"],this.initShapesToolbarItem(u.toolbarItems),"image"===a.activeObj.shape&&(c=Pe({},a.activeObj,{},!0),a.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),a.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!0}}),a.activeObj=c,a.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:a.activeObj,isCropRatio:null,points:null,isPreventDrag:!0}}),this.renderQAT(!1));break;case"text":F.isDevice&&this.initMainToolbar(!1,!0,!0),u.toolbarItems=["fontFamily","fontSize","fontColor","fillColor","strokeColor","strokeWidth","bold","italic","z-order","duplicate","remove","text"],this.initTextToolbarItem(u.toolbarItems);break;case"pen":F.isDevice&&this.initMainToolbar(!1,!0,!0),u.toolbarItems=["strokeColor","strokeWidth","z-order","remove","transparency"],this.initPenToolbarItem(u.toolbarItems);break;case"adjustment":F.isDevice&&this.initMainToolbar(!1,!0,!0),this.initAdjustmentToolbarItem();break;case"filter":this.updateContextualToolbar(e);break;case"resize":(a.isCircleCrop||a.currSelectionPoint&&"crop-circle"===a.currSelectionPoint.shape)&&(a.aspectHeight=a.aspectWidth,this.isAspectRatio=!1),this.initResizeToolbar(),F.isDevice&&this.initMainToolbar(!1,!0,!0,!0),c=a.element.querySelector("#"+l+"_aspectratio"),g=a.element.querySelector("#"+l+"_nonaspectratio"),a.aspectWidth&&a.aspectHeight&&(g?a.notify("transform",{prop:"resize",value:{width:a.aspectWidth,height:a.aspectHeight,isAspectRatio:!1}}):c&&a.notify("transform",{prop:"resize",value:{width:a.aspectWidth,height:null,isAspectRatio:!0}}));break;case"color":this.updateContextualToolbar(e,o);break;case"croptransform":je(s)&&(a.allowDownScale=!1,a.isCropTab=!0),F.isDevice&&this.initMainToolbar(!1,!0,!0),je(s)&&a.updateCropTransformItems(),this.initCropTransformToolbar(r,s),F.isDevice&&this.isToolbar()&&this.updateContextualToolbar("color","straighten",!0),a.isMaskImage&&this.refreshToolbar("main");break;case"frame":this.isFrameToolbar=!0,F.isDevice?(this.initMainToolbar(!1,!0,!0),this.initMainToolbar(!1,!0,!0,!1,!0)):this.initMainToolbar(!0,null,null,!1,!0);var g=a.element.querySelector("#"+l+"_"+a.frameObj.type);g&&g.classList.add("e-selected-btn"),"none"!==a.frameObj.type&&this.updateContextualToolbar(e,o),a.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!0}});break;case"redact":F.isDevice?(this.initMainToolbar(!1,!0,!0),this.initMainToolbar(!1,!0,!0,null,null,null,!0)):this.initMainToolbar(t,F.isDevice,null,null,null,null,!0),this.enableDisableTbrBtn(),"blur"===a.activeObj.redactType?(c=a.element.querySelector("#"+l+"_redactBlur"))&&c.classList.add("e-selected-btn"):(g=a.element.querySelector("#"+l+"_pixelate"))&&g.classList.add("e-selected-btn"),this.redactSlider(a.activeObj.redactType)}this.refreshDropDownBtn(i),this.updateKBDNavigation(e),this.currToolbar=e}},RUt.prototype.updateRedactObj=function(){var e=this.parent,t=Pe([],e.objColl,[],!0),i=(e.objColl=[],Pe({},e.activeObj,{},!0));e.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),e.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!0}}),e.objColl=t;for(var n=0;n<e.objColl.length;n++){var o=e.objColl[n];"redact"===o.shape&&(o.redactImage=e.createElement("canvas"),o.redactImage.width=o.activePoint.width,o.redactImage.height=o.activePoint.height,o.redactImage.getContext("2d").drawImage(e.lowerCanvas,o.activePoint.startX,o.activePoint.startY,o.activePoint.width,o.activePoint.height,0,0,o.redactImage.width,o.redactImage.height))}e.isCropTab=!1,e.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!0}}),e.isCropTab=!0,i&&e.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:i,isCropRatio:null,points:null,isPreventDrag:!0}});t={panMove:null};e.notify("transform",{prop:"getPanMove",onPropertyChange:!1,value:{obj:t}}),t.panMove&&e.notify("transform",{prop:"drawPannedImage",onPropertyChange:!1,value:{xDiff:null,yDiff:null}})},RUt.prototype.updateKBDNavigation=function(e){var t,i,n,o=this.parent,r=o.element.id;o.isKBDNavigation&&this.currToolbar!==e&&this.isToolbar()&&(n=void 0,o=o.element.querySelectorAll("#"+r+"_toolbar")[0])&&(n=o.querySelector(".e-toolbar-center"))&&n.children[0]&&(t=n.children[0].querySelector(".e-btn"),o=(o=(o=n.children[1])&&o.children[0])&&o.children[0],"resize"===e&&o&&(t=o),"filter"===e&&(i=document.querySelector("#"+r+"_defaultCanvas"))&&setTimeout(function(){return i.focus()},50),t)&&("main"===e?setTimeout(function(){return t.focus()},50):t.focus())},RUt.prototype.performCropTransformClick=function(e,t){var i=this.parent;je(t)&&(i.notify("draw",{prop:"setTempStraightenZoomDeg"}),i.tempStraighten=i.transform.straighten,(i.currObjType.isFiltered||i.currObjType.isRedact)&&i.okBtn(),i.isStraightening=!0),this.refreshToolbar("croptransform",null,null,null,null,e,t),je(t)&&(i.notify("draw",{prop:"setDestForStraighten"}),i.notify("draw",{prop:"setTempDestForStraighten"}))},RUt.prototype.getAdjustmentToolbarItem=function(){var e=[],t=this.parent,i=!1,n=t.element.id,o=["Brightness","Contrast","Hue","Saturation","Exposure","Opacity","Blur"];if(t.toolbar)for(var r=0;r<o.length;r++)if(-1!==t.toolbar.indexOf(o[r])){i=!0;break}(je(t.toolbar)||!i||t.toolbar&&-1<t.toolbar.indexOf("Brightness"))&&e.push({id:n+"_brightness",prefixIcon:"e-icons e-brightness",cssClass:"top-icon e-brightness",tooltipText:this.l10n.getConstant("Brightness"),align:"Center"}),(je(t.toolbar)||!i||t.toolbar&&-1<t.toolbar.indexOf("Contrast"))&&e.push({id:n+"_contrast",prefixIcon:"e-icons e-contrast",cssClass:"top-icon e-contrast",tooltipText:this.l10n.getConstant("Contrast"),align:"Center"}),(je(t.toolbar)||!i||t.toolbar&&-1<t.toolbar.indexOf("Hue"))&&e.push({id:n+"_hue",prefixIcon:"e-icons e-fade",cssClass:"top-icon e-fade",tooltipText:this.l10n.getConstant("Hue"),align:"Center"}),(je(t.toolbar)||!i||t.toolbar&&-1<t.toolbar.indexOf("Saturation"))&&e.push({id:n+"_saturation",prefixIcon:"e-icons e-saturation",cssClass:"top-icon e-saturation",tooltipText:this.l10n.getConstant("Saturation"),align:"Center"}),(je(t.toolbar)||!i||t.toolbar&&-1<t.toolbar.indexOf("Exposure"))&&e.push({id:n+"_exposure",prefixIcon:"e-icons e-grain",cssClass:"top-icon e-grain",tooltipText:this.l10n.getConstant("Exposure"),align:"Center"}),(je(t.toolbar)||!i||t.toolbar&&-1<t.toolbar.indexOf("Opacity"))&&e.push({id:n+"_opacity",prefixIcon:"e-icons e-opacity",cssClass:"top-icon e-opacity",tooltipText:this.l10n.getConstant("Opacity"),align:"Center"}),(je(t.toolbar)||!i||t.toolbar&&-1<t.toolbar.indexOf("Blur"))&&e.push({id:n+"_blur",prefixIcon:"e-icons e-tint",cssClass:"top-icon e-tint",tooltipText:this.l10n.getConstant("Blur"),align:"Center"});for(var s=this.processToolbar("center"),r=0,a=s.length;r<a;r++)e.push(s[r]);return F.isDevice||(e.push({id:n+"_ok",prefixIcon:"e-icons e-check",cssClass:"top-icon e-tick",tooltipText:this.l10n.getConstant("OK"),align:"Right",tabIndex:0}),e.push({id:n+"_cancel",prefixIcon:"e-icons e-close",cssClass:"top-icon e-save",tooltipText:this.l10n.getConstant("Cancel"),align:"Right"})),e},RUt.prototype.getFrameToolbarItem=function(){var e=this.parent,t=e.element.id,i=[];return i.push({prefixIcon:"e-icons e-copy",id:t+"_frameColor",cssClass:"top-icon e-stroke",tooltipText:this.l10n.getConstant("Color"),align:"Center",type:"Input",template:"<span>"+this.l10n.getConstant("Color")+'</span><button id="'+t+'_frameColorBtn"></button>'}),i.push({prefixIcon:"e-icons e-copy",id:t+"_frameGradient",cssClass:"top-icon e-frame-stroke",tooltipText:this.l10n.getConstant("GradientColor"),align:"Center",type:"Input",template:"<span>"+this.l10n.getConstant("GradientColor")+'</span><button id="'+t+'_frameGradientColorBtn"></button>'}),i.push({id:t+"_frameSize",cssClass:"top-icon e-size",tooltipText:this.l10n.getConstant("Size"),align:"Center",type:"Input",template:"<span>"+this.l10n.getConstant("Size")+'</span><button id="'+t+'_frameSizeBtn"></button>'}),"line"!==e.frameObj.type&&"inset"!==e.frameObj.type&&"hook"!==e.frameObj.type||i.push({id:t+"_frameInset",cssClass:"top-icon e-size",tooltipText:this.l10n.getConstant("Inset"),align:"Center",type:"Input",template:"<span>"+this.l10n.getConstant("Inset")+'</span><button id="'+t+'_frameInsetBtn"></button>'}),"line"!==e.frameObj.type&&"inset"!==e.frameObj.type||i.push({id:t+"_frameOffset",cssClass:"top-icon e-size",tooltipText:this.l10n.getConstant("Offset"),align:"Center",type:"Input",template:"<span>"+this.l10n.getConstant("Offset")+'</span><button id="'+t+'_frameOffsetBtn"></button>'}),"line"===e.frameObj.type&&(i.push({id:t+"_frameRadius",cssClass:"top-icon e-size",tooltipText:this.l10n.getConstant("Radius"),align:"Center",type:"Input",template:"<span>"+this.l10n.getConstant("Radius")+'</span><button id="'+t+'_frameRadiusBtn"></button>'}),i.push({id:t+"_frameAmount",cssClass:"top-icon e-size",tooltipText:this.l10n.getConstant("Amount"),align:"Center",type:"Input",template:"<span>"+this.l10n.getConstant("Amount")+'</span><button id="'+t+'_frameAmountBtn"></button>'}),i.push({id:t+"_frameBorder",cssClass:"top-icon e-size",tooltipText:this.l10n.getConstant("Border"),align:"Center",type:"Input",template:"<span>"+this.l10n.getConstant("Border")+'</span><button id="'+t+'_frameBorderBtn"></button>'})),i},RUt.prototype.getFilterToolbarItem=function(){var e=[],t=this.parent,i=!1,n=t.element.id,o=["Default","Chrome","Cold","Warm","Grayscale","Sepia","Invert"];if(t.toolbar)for(var r=0;r<o.length;r++)if(-1!==t.toolbar.indexOf(o[r])){i=!0;break}(je(t.toolbar)||!i||t.toolbar&&-1<t.toolbar.indexOf("Default"))&&e.push({id:n+"_default",prefixIcon:"e-icons e-none",cssClass:"top-icon e-none",tooltipText:this.l10n.getConstant("Default"),align:"Center",template:'<div class="filter-wrapper"><canvas id='+n+"_defaultCanvas tabindex=0></canvas><div><span>"+this.l10n.getConstant("Default")+"</span></div></div>"}),(je(t.toolbar)||!i||t.toolbar&&-1<t.toolbar.indexOf("Chrome"))&&e.push({id:n+"_chrome",prefixIcon:"e-icons e-none",cssClass:"top-icon e-none",tooltipText:this.l10n.getConstant("Chrome"),align:"Center",template:'<div class="filter-wrapper"><canvas id='+n+"_chromeCanvas></canvas><div><span>"+this.l10n.getConstant("Chrome")+"</span></div></div>"}),(je(t.toolbar)||!i||t.toolbar&&-1<t.toolbar.indexOf("Cold"))&&e.push({id:n+"_cold",prefixIcon:"e-icons e-none",cssClass:"top-icon e-none",tooltipText:this.l10n.getConstant("Cold"),align:"Center",template:'<div class="filter-wrapper"><canvas id='+n+"_coldCanvas></canvas><div><span>"+this.l10n.getConstant("Cold")+"</span></div></div>"}),(je(t.toolbar)||!i||t.toolbar&&-1<t.toolbar.indexOf("Warm"))&&e.push({id:n+"_warm",prefixIcon:"e-icons e-none",cssClass:"top-icon e-none",tooltipText:this.l10n.getConstant("Warm"),align:"Center",template:'<div class="filter-wrapper"><canvas id='+n+"_warmCanvas></canvas><div><span>"+this.l10n.getConstant("Warm")+"</span></div></div>"}),(je(t.toolbar)||!i||t.toolbar&&-1<t.toolbar.indexOf("Grayscale"))&&e.push({id:n+"_grayscale",prefixIcon:"e-icons e-none",cssClass:"top-icon e-none",tooltipText:this.l10n.getConstant("Grayscale"),align:"Center",template:'<div class="filter-wrapper"><canvas id='+n+"_grayscaleCanvas></canvas><div><span>"+this.l10n.getConstant("Grayscale")+"</span></div></div>"}),(je(t.toolbar)||!i||t.toolbar&&-1<t.toolbar.indexOf("Sepia"))&&e.push({id:n+"_sepia",prefixIcon:"e-icons e-none",cssClass:"top-icon e-none",tooltipText:this.l10n.getConstant("Sepia"),align:"Center",template:'<div class="filter-wrapper"><canvas id='+n+"_sepiaCanvas></canvas><div><span>"+this.l10n.getConstant("Sepia")+"</span></div></div>"}),(je(t.toolbar)||!i||t.toolbar&&-1<t.toolbar.indexOf("Invert"))&&e.push({id:n+"_invert",prefixIcon:"e-icons e-none",cssClass:"top-icon e-none",tooltipText:this.l10n.getConstant("Invert"),align:"Center",template:'<div class="filter-wrapper"><canvas id='+n+"_invertCanvas></canvas><div><span>"+this.l10n.getConstant("Invert")+"</span></div></div>"});for(var s=this.processToolbar("center"),r=0,a=s.length;r<a;r++)e.push(s[r]);return e},RUt.prototype.getPenToolbarItem=function(e){for(var t=this.parent,i=t.element.id,n=[],o=((je(t.toolbar)||t.toolbar)&&n.push({id:i+"_annotation",tooltipText:this.l10n.getConstant("Annotation"),align:"Center",template:'<button id="'+i+'_annotationBtn"></button>'}),-1<e.indexOf("strokeColor")&&n.push({prefixIcon:"e-icons e-copy",id:i+"_pen_strokecolor",cssClass:"top-icon e-pen-stroke-color",tooltipText:this.l10n.getConstant("StrokeColor"),align:"Center",type:"Input",template:'<button id="'+i+'_penColorBtn"></button>'}),-1<e.indexOf("strokeWidth")&&n.push({prefixIcon:"e-icons e-copy",id:i+"_pen_strokewidth",cssClass:"top-icon e-size",tooltipText:this.l10n.getConstant("StrokeWidth"),align:"Center",type:"Input",template:'<button id="'+i+'_penStrokeWidth"></button>'}),n.push({align:"Center",type:"Separator"}),-1<e.indexOf("z-order")&&n.push({id:i+"_zOrder",cssClass:"top-icon e-list-unordered-3",tooltipText:this.l10n.getConstant("ZOrder"),align:"Center",type:"Input",template:'<button id="'+i+'_zOrderBtn"></button>'}),-1<e.indexOf("remove")&&n.push({id:i+"_remove",prefixIcon:"e-icons e-trash",cssClass:"top-icon e-trash",tooltipText:this.l10n.getConstant("Remove"),align:"Center"}),this.processSubToolbar(e)),r=0,s=o.length;r<s;r++)n.push(o[r]);return F.isDevice||(n.push({id:i+"_ok",prefixIcon:"e-icons e-check",cssClass:"top-icon e-tick",tooltipText:this.l10n.getConstant("OK"),align:"Right",tabIndex:0}),n.push({id:i+"_cancel",prefixIcon:"e-icons e-close",cssClass:"top-icon e-save",tooltipText:this.l10n.getConstant("Cancel"),align:"Right"})),n},RUt.prototype.initPenToolbarItem=function(e){var t=this,i=this.parent,n=i.element.id,o=this.getLeftToolbarItem(),r=this.getRightToolbarItem(),s=this.getPenToolbarItem(e),a=this.getZoomToolbarItem(),o=(F.isDevice?this.defToolbarItems=s:this.defToolbarItems=o.concat(a,s,r),{toolbarType:"pen",toolbarItems:this.defToolbarItems}),l=(i.trigger("toolbarUpdating",o),this.isToolbarString(o.toolbarItems)?(e=o.toolbarItems,this.excludeItems(o.toolbarItems)):this.defToolbarItems=o.toolbarItems,new U3({width:"100%",items:this.defToolbarItems,clicked:this.defToolbarClicked.bind(this),created:function(){t.renderAnnotationBtn(!0),t.createPenColor(e),t.createPenBtn(e),t.createZOrderBtn(e),t.wireZoomBtnEvents(),i.trigger("toolbarCreated",{toolbarType:"pen"}),F.isDevice?0<t.defToolbarItems.length&&document.getElementById(n+"_toolbar")&&(l.refreshOverflow(),l.refreshOverflow()):(t.createLeftToolbarControls(),0<t.defToolbarItems.length&&document.getElementById(n+"_toolbar")&&l.refreshOverflow())}}));F.isDevice?l.appendTo("#"+n+"_bottomToolbar"):l.appendTo("#"+n+"_toolbar"),this.enableDisableTbrBtn()},RUt.prototype.createPenColor=function(e){var t,i,n=this,o=this.parent,r=o.element.id;-1<e.indexOf("strokeColor")&&(o.element.querySelector(".e-template.e-pen-stroke-color").appendChild(o.createElement("input",{id:r+"_pen_stroke"})),e=o.activeObj.strokeSettings.strokeColor,t=new cV({modeSwitcher:!1,value:"#fff",showButtons:!1,mode:"Palette",cssClass:"e-pen-color",change:function(e){o.updatePenStrokeColor(e.currentValue.hex),n.selFhdColor=e.currentValue.hex,i.element.children[0].style.backgroundColor=e.currentValue.rgba,i.toggle(),o.notify("undo-redo",{prop:"updateUndoRedoStack",value:{isPenDraw:!0}})}},"#"+r+"_pen_stroke"),i=new u2({open:function(e){e=e.element.parentElement;F.isDevice&&(e.style.top=i.element.getBoundingClientRect().top-e.offsetHeight+"px",window.innerWidth<=520)&&(e.style.left=o.element.offsetLeft+"px")},target:".e-pen-color",iconCss:"e-dropdownbtn-preview",cssClass:"e-ie-ddb-popup"},"#"+r+"_penColorBtn"),t.inline=!0,t.value=t.getValue(o.activeObj.strokeSettings.strokeColor,"rgba"),"null"===t.value&&(t.value=e),o.notify("freehand-draw",{prop:"getTempFreeHandDrawEditingStyles",value:{obj:r={tempFreeHandDrawEditingStyles:null}}}),o.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!(e={freehandSelectedIndex:null}),value:{obj:e}}),!je(e.freehandSelectedIndex)&&-1<e.freehandSelectedIndex?o.element.querySelector(".e-pen-stroke-color.e-template .e-dropdownbtn-preview").style.background=("#42a5f5"===this.selFhdColor?r.tempFreeHandDrawEditingStyles:o.pointColl[e.freehandSelectedIndex]).strokeColor:o.element.querySelector(".e-pen-stroke-color.e-template .e-dropdownbtn-preview").style.background=t.value)},RUt.prototype.createPenBtn=function(e){var i,t,n,o=this,r=this.parent,s=r.element.id,a=[{id:"1",text:this.l10n.getConstant("XSmall")},{id:"2",text:this.l10n.getConstant("Small")},{id:"3",text:this.l10n.getConstant("Medium")},{id:"4",text:this.l10n.getConstant("Large")},{id:"5",text:this.l10n.getConstant("XLarge")}];-1<e.indexOf("strokeWidth")&&(e=document.getElementById(s+"_penStrokeWidth"),i=document.createElement("span"),r.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!(t={freehandSelectedIndex:null}),value:{obj:t}}),!je(t.freehandSelectedIndex)&&-1<t.freehandSelectedIndex?i.innerHTML=this.getPenStroke(r.pointColl[t.freehandSelectedIndex].strokeWidth):(r.notify("freehand-draw",{prop:"getPenStrokeWidth",onPropertyChange:!(t={penStrokeWidth:2}),value:{obj:t}}),i.innerHTML=t.penStrokeWidth?this.getPenStroke(t.penStrokeWidth):this.l10n.getConstant("Small")),i.className="e-pen-stroke-width",e.appendChild(i),(n=new u2({items:a,open:function(e){F.isDevice&&(e.element.parentElement.style.top=n.element.getBoundingClientRect().top-e.element.parentElement.offsetHeight+"px");var t=i.innerHTML;e.element.querySelector('[aria-label = "'+t+'"]').classList.add("e-selected-btn")},select:function(e){o.triggerTbarClickEvent(e),i.textContent=e.item.text,r.updatePenStrokeWidth(e.item.id),F.isDevice?document.getElementById(s+"_bottomToolbar")&&At(s+"_bottomToolbar","toolbar").refreshOverflow():document.getElementById(s+"_toolbar")&&At(s+"_toolbar","toolbar").refreshOverflow();e={penStrokeWidth:null};r.notify("freehand-draw",{prop:"getPenStrokeWidth",onPropertyChange:!1,value:{obj:e}}),r.notify("undo-redo",{prop:"updateUndoRedoStack",value:{isPenDraw:!0}}),r.notify("freehand-draw",{prop:"setPenStrokeWidth",onPropertyChange:!1,value:{value:e.penStrokeWidth}})}})).appendTo("#"+s+"_penStrokeWidth"))},RUt.prototype.getPenStroke=function(e){var t="",i={1:this.l10n.getConstant("XSmall"),2:this.l10n.getConstant("Small"),3:this.l10n.getConstant("Medium"),4:this.l10n.getConstant("Large"),5:this.l10n.getConstant("XLarge")};return t=1<=e&&e<=5?i[e]:t},RUt.prototype.initAdjustmentToolbarItem=function(){var e=this,t=this.parent,i=t.element.id,n=this.getLeftToolbarItem(null),o=this.getRightToolbarItem(),r=this.getAdjustmentToolbarItem(),s=this.getZoomToolbarItem(),n=(F.isDevice?this.defToolbarItems=r:this.defToolbarItems=n.concat(s,r,o),{toolbarType:"finetune",toolbarItems:this.defToolbarItems}),a=(t.trigger("toolbarUpdating",n),this.defToolbarItems=n.toolbarItems,new U3({width:"100%",items:this.defToolbarItems,clicked:this.defToolbarClicked.bind(this),created:function(){e.wireZoomBtnEvents(),F.isDevice||e.createLeftToolbarControls(),0<e.defToolbarItems.length&&document.getElementById(i+"_toolbar")&&a.refreshOverflow()}}));F.isDevice?a.appendTo("#"+i+"_bottomToolbar"):a.appendTo("#"+i+"_toolbar"),this.enableDisableTbrBtn()},RUt.prototype.initFrameToolbarItem=function(){var t=this,i=this.parent,n=i.element.id,e=document.querySelector("#"+n+"_contextualToolbarArea"),o=document.querySelector("#"+n+"_frameWrapper");o?o.style.display="block":o=e.appendChild(i.createElement("div",{id:n+"_frameWrapper",className:"e-frame-wrapper",styles:"position: relative"})),o.appendChild(i.createElement("div",{id:n+"_customizeWrapper",styles:"position: absolute"}));var e={toolbarType:"frame",toolbarItems:this.getFrameToolbarItem()},r=(i.trigger("toolbarUpdating",e),new U3({width:"100%",items:e.toolbarItems,clicked:this.defToolbarClicked.bind(this),created:function(){t.createFrameColor(),t.createFrameSize();var e=i.frameObj.type;"line"===e&&t.createFrameRadius(),"line"!==e&&"inset"!==e&&"hook"!==e||t.createFrameInset(),"line"!==e&&"inset"!==e||t.createFrameOffset(),"line"===e&&(t.createFrameAmount(),t.createFrameBorder()),t.createFrameGradientColor(),F.isDevice?0<t.defToolbarItems.length&&document.getElementById(n+"_bottomToolbar")&&(r.refreshOverflow(),r.refreshOverflow(),r.refreshOverflow()):(t.createLeftToolbarControls(),0<t.defToolbarItems.length&&document.getElementById(n+"_toolbar")&&r.refreshOverflow()),i.element.querySelector("#"+n+"_"+e).focus()}}));r.appendTo("#"+n+"_customizeWrapper")},RUt.prototype.createFrameGradientColor=function(){var n,o=this.parent,r={frameChangeEventArgs:null},e=o.element.id,t=(o.element.querySelector(".e-template.e-frame-stroke").appendChild(o.createElement("input",{id:e+"_frame_gradient_fill"})),new cV({modeSwitcher:!1,noColor:!0,value:o.frameObj.gradientColor,showButtons:!1,mode:"Palette",cssClass:"e-frame-gradient-fill-color",change:function(e){n={type:o.toPascalCase(o.frameObj.type),color:o.frameObj.color,gradientColor:o.frameObj.gradientColor,size:o.frameObj.size,inset:o.frameObj.inset,offset:o.frameObj.offset,borderRadius:o.frameObj.radius,frameLineStyle:o.toPascalCase(o.frameObj.border),lineCount:o.frameObj.amount};var t=o.frameObj.gradientColor,i={currObj:{}};o.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:i}}),o.frameObj.gradientColor=e.currentValue.hex,o.notify("draw",{prop:"triggerFrameChange",value:{prevFrameSettings:n,obj:r}}),r.frameChangeEventArgs&&!r.frameChangeEventArgs.cancel?(o.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"frame",previousObj:i.currObj,previousObjColl:i.currObj.objColl,previousPointColl:i.currObj.pointColl,previousSelPointColl:i.currObj.selPointColl,previousCropObj:Pe({},o.cropObj,{},!0),previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),o.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!0}}),o.notify("draw",{prop:"redrawDownScale"}),""===e.currentValue.rgba?s.element.children[0].classList.add("e-nocolor-item"):(s.element.children[0].classList.remove("e-nocolor-item"),s.element.children[0].style.backgroundColor=e.currentValue.rgba),o.curFrameObjEvent={previousFrameSetting:r.frameChangeEventArgs.previousFrameSetting,currentFrameSetting:r.frameChangeEventArgs.currentFrameSetting},o.isFrameBtnClick=!0):o.frameObj.gradientColor=t,s.toggle()}},"#"+e+"_frame_gradient_fill")),s=new u2({open:function(e){F.isDevice&&((e=e.element.parentElement).style.top=s.element.getBoundingClientRect().top-e.offsetHeight+"px",window.innerWidth<=520)&&(e.style.left=o.element.offsetLeft+"px")},target:".e-frame-gradient-fill-color",iconCss:"e-dropdownbtn-preview",cssClass:"e-ie-ddb-popup"},"#"+e+"_frameGradientColorBtn");t.inline=!0,""===o.frameObj.gradientColor?o.element.querySelector(".e-frame-stroke.e-template .e-dropdownbtn-preview").classList.add("e-nocolor-item"):o.element.querySelector(".e-frame-stroke.e-template .e-dropdownbtn-preview").style.background=o.frameObj.gradientColor},RUt.prototype.createFrameColor=function(){var n,o=this.parent,r={frameChangeEventArgs:null},e=o.element.id,t=(o.element.querySelector(".e-template.e-stroke").appendChild(o.createElement("input",{id:e+"_frame_fill"})),new cV({modeSwitcher:!1,value:o.frameObj.color,showButtons:!1,mode:"Palette",cssClass:"e-frame-fill-color",change:function(e){n={type:o.toPascalCase(o.frameObj.type),color:o.frameObj.color,gradientColor:o.frameObj.gradientColor,size:o.frameObj.size,inset:o.frameObj.inset,offset:o.frameObj.offset,borderRadius:o.frameObj.radius,frameLineStyle:o.toPascalCase(o.frameObj.border),lineCount:o.frameObj.amount};var t=o.frameObj.color,i={currObj:{}};o.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:i}}),o.frameObj.color=e.currentValue.hex,o.notify("draw",{prop:"triggerFrameChange",value:{prevFrameSettings:n,obj:r}}),r.frameChangeEventArgs&&!r.frameChangeEventArgs.cancel?(o.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"frame",previousObj:i.currObj,previousObjColl:i.currObj.objColl,previousPointColl:i.currObj.pointColl,previousSelPointColl:i.currObj.selPointColl,previousCropObj:Pe({},o.cropObj,{},!0),previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),o.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!0}}),o.notify("draw",{prop:"redrawDownScale"}),""===e.currentValue.rgba?s.element.children[0].classList.add("e-nocolor-item"):(s.element.children[0].classList.remove("e-nocolor-item"),s.element.children[0].style.backgroundColor=e.currentValue.rgba),o.curFrameObjEvent={previousFrameSetting:r.frameChangeEventArgs.previousFrameSetting,currentFrameSetting:r.frameChangeEventArgs.currentFrameSetting},o.isFrameBtnClick=!0):o.frameObj.color=t,s.toggle()}},"#"+e+"_frame_fill")),s=new u2({open:function(e){F.isDevice&&((e=e.element.parentElement).style.top=s.element.getBoundingClientRect().top-e.offsetHeight+"px",window.innerWidth<=520)&&(e.style.left=o.element.offsetLeft+"px")},target:".e-frame-fill-color",iconCss:"e-dropdownbtn-preview",cssClass:"e-ie-ddb-popup"},"#"+e+"_frameColorBtn");t.inline=!0,o.element.querySelector(".e-stroke.e-template .e-dropdownbtn-preview").style.background=o.frameObj.color},RUt.prototype.createFrameSize=function(){var n,o=this,r=this.parent,s={frameChangeEventArgs:null},a=r.element.id,e=[{id:"1",text:this.l10n.getConstant("20")},{id:"2",text:this.l10n.getConstant("40")},{id:"3",text:this.l10n.getConstant("60")},{id:"4",text:this.l10n.getConstant("80")},{id:"5",text:this.l10n.getConstant("100")}],t=document.getElementById(a+"_frameSizeBtn"),i=document.createElement("span"),l=(i.innerHTML=this.l10n.getConstant(r.frameObj.size.toString()),i.className="e-frame-stroke-width",t.appendChild(i),new u2({items:e,open:function(e){F.isDevice&&((t=e.element.parentElement).style.top=l.element.getBoundingClientRect().top-t.offsetHeight+"px");var t=l.element.childNodes[0].textContent;""!==t&&e.element.querySelector('[aria-label = "'+t+'"]').classList.add("e-selected-btn")},select:function(e){o.triggerTbarClickEvent(e),n={type:r.toPascalCase(r.frameObj.type),color:r.frameObj.color,gradientColor:r.frameObj.gradientColor,size:r.frameObj.size,inset:r.frameObj.inset,offset:r.frameObj.offset,borderRadius:r.frameObj.radius,frameLineStyle:r.toPascalCase(r.frameObj.border),lineCount:r.frameObj.amount};var t=r.frameObj.size,i={currObj:{}};r.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:i}}),r.frameObj.size=parseInt(e.item.text,10),r.notify("draw",{prop:"triggerFrameChange",value:{prevFrameSettings:n,obj:s}}),s.frameChangeEventArgs&&!s.frameChangeEventArgs.cancel?(r.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"frame",previousObj:i.currObj,previousObjColl:i.currObj.objColl,previousPointColl:i.currObj.pointColl,previousSelPointColl:i.currObj.selPointColl,previousCropObj:Pe({},r.cropObj,{},!0),previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),r.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!0}}),r.notify("draw",{prop:"redrawDownScale"}),l.content=e.item.text,r.curFrameObjEvent={previousFrameSetting:s.frameChangeEventArgs.previousFrameSetting,currentFrameSetting:s.frameChangeEventArgs.currentFrameSetting},r.isFrameBtnClick=!0):r.frameObj.size=t,F.isDevice?document.getElementById(a+"_bottomToolbar")&&At(a+"_bottomToolbar","toolbar").refreshOverflow():document.getElementById(a+"_toolbar")&&At(a+"_toolbar","toolbar").refreshOverflow()}}));l.appendTo("#"+a+"_frameSizeBtn")},RUt.prototype.createFrameInset=function(){var n,o=this,r=this.parent,s={frameChangeEventArgs:null},a=r.element.id,e=[{id:"1",text:this.l10n.getConstant("20")},{id:"2",text:this.l10n.getConstant("40")},{id:"3",text:this.l10n.getConstant("60")},{id:"4",text:this.l10n.getConstant("80")},{id:"5",text:this.l10n.getConstant("100")}],t=document.getElementById(a+"_frameInsetBtn"),i=document.createElement("span"),l=(i.innerHTML=this.l10n.getConstant(r.frameObj.inset.toString()),i.className="e-frame-inset",t.appendChild(i),new u2({items:e,open:function(e){F.isDevice&&((t=e.element.parentElement).style.top=l.element.getBoundingClientRect().top-t.offsetHeight+"px");var t=l.element.childNodes[0].textContent;""!==t&&e.element.querySelector('[aria-label = "'+t+'"]').classList.add("e-selected-btn")},select:function(e){o.triggerTbarClickEvent(e),n={type:r.toPascalCase(r.frameObj.type),color:r.frameObj.color,gradientColor:r.frameObj.gradientColor,size:r.frameObj.size,inset:r.frameObj.inset,offset:r.frameObj.offset,borderRadius:r.frameObj.radius,frameLineStyle:r.toPascalCase(r.frameObj.border),lineCount:r.frameObj.amount};var t=r.frameObj.inset,i={currObj:{}};r.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:i}}),r.frameObj.inset=parseInt(e.item.text,10),r.notify("draw",{prop:"triggerFrameChange",value:{prevFrameSettings:n,obj:s}}),s.frameChangeEventArgs&&!s.frameChangeEventArgs.cancel?(r.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"frame",previousObj:i.currObj,previousObjColl:i.currObj.objColl,previousPointColl:i.currObj.pointColl,previousSelPointColl:i.currObj.selPointColl,previousCropObj:Pe({},r.cropObj,{},!0),previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),r.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!0}}),r.notify("draw",{prop:"redrawDownScale"}),l.content=e.item.text,r.curFrameObjEvent={previousFrameSetting:s.frameChangeEventArgs.previousFrameSetting,currentFrameSetting:s.frameChangeEventArgs.currentFrameSetting},r.isFrameBtnClick=!0):r.frameObj.inset=t,F.isDevice?document.getElementById(a+"_bottomToolbar")&&At(a+"_bottomToolbar","toolbar").refreshOverflow():document.getElementById(a+"_toolbar")&&At(a+"_toolbar","toolbar").refreshOverflow()}}));l.appendTo("#"+a+"_frameInsetBtn")},RUt.prototype.createFrameOffset=function(){var n,o=this,r=this.parent,s={frameChangeEventArgs:null},a=r.element.id,e=[{id:"1",text:this.l10n.getConstant("20")},{id:"2",text:this.l10n.getConstant("40")},{id:"3",text:this.l10n.getConstant("60")},{id:"4",text:this.l10n.getConstant("80")},{id:"5",text:this.l10n.getConstant("100")}],t=document.getElementById(a+"_frameOffsetBtn"),i=document.createElement("span"),l=(i.innerHTML=this.l10n.getConstant(r.frameObj.offset.toString()),i.className="e-frame-offset",t.appendChild(i),new u2({items:e,open:function(e){F.isDevice&&((t=e.element.parentElement).style.top=l.element.getBoundingClientRect().top-t.offsetHeight+"px");var t=l.element.childNodes[0].textContent;""!==t&&e.element.querySelector('[aria-label = "'+t+'"]').classList.add("e-selected-btn")},select:function(e){o.triggerTbarClickEvent(e),n={type:r.toPascalCase(r.frameObj.type),color:r.frameObj.color,gradientColor:r.frameObj.gradientColor,size:r.frameObj.size,inset:r.frameObj.inset,offset:r.frameObj.offset,borderRadius:r.frameObj.radius,lineCount:r.frameObj.amount,frameLineStyle:r.toPascalCase(r.frameObj.border)};var t=r.frameObj.offset,i={currObj:{}};r.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:i}}),r.frameObj.offset=parseInt(e.item.text,10),r.notify("draw",{prop:"triggerFrameChange",value:{prevFrameSettings:n,obj:s}}),s.frameChangeEventArgs&&!s.frameChangeEventArgs.cancel?(r.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"frame",previousObj:i.currObj,previousObjColl:i.currObj.objColl,previousPointColl:i.currObj.pointColl,previousSelPointColl:i.currObj.selPointColl,previousCropObj:Pe({},r.cropObj,{},!0),previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),r.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!0}}),r.notify("draw",{prop:"redrawDownScale"}),l.content=e.item.text,r.curFrameObjEvent={previousFrameSetting:s.frameChangeEventArgs.previousFrameSetting,currentFrameSetting:s.frameChangeEventArgs.currentFrameSetting},r.isFrameBtnClick=!0):r.frameObj.offset=t,F.isDevice?document.getElementById(a+"_bottomToolbar")&&At(a+"_bottomToolbar","toolbar").refreshOverflow():document.getElementById(a+"_toolbar")&&At(a+"_toolbar","toolbar").refreshOverflow()}}));l.appendTo("#"+a+"_frameOffsetBtn")},RUt.prototype.createFrameRadius=function(){var n,o=this,r=this.parent,s={frameChangeEventArgs:null},a=r.element.id,e=[{id:"1",text:this.l10n.getConstant("0")},{id:"2",text:this.l10n.getConstant("20")},{id:"3",text:this.l10n.getConstant("40")},{id:"4",text:this.l10n.getConstant("60")},{id:"5",text:this.l10n.getConstant("80")},{id:"6",text:this.l10n.getConstant("100")}],t=document.getElementById(a+"_frameRadiusBtn"),i=document.createElement("span"),l=(i.innerHTML=this.l10n.getConstant(r.frameObj.radius.toString()),i.className="e-frame-radius",t.appendChild(i),new u2({items:e,open:function(e){F.isDevice&&((t=e.element.parentElement).style.top=l.element.getBoundingClientRect().top-t.offsetHeight+"px");var t=l.element.childNodes[0].textContent;""!==t&&e.element.querySelector('[aria-label = "'+t+'"]').classList.add("e-selected-btn")},select:function(e){o.triggerTbarClickEvent(e),n={type:r.toPascalCase(r.frameObj.type),color:r.frameObj.color,gradientColor:r.frameObj.gradientColor,size:r.frameObj.size,inset:r.frameObj.inset,offset:r.frameObj.offset,borderRadius:r.frameObj.radius,frameLineStyle:r.toPascalCase(r.frameObj.border),lineCount:r.frameObj.amount};var t=r.frameObj.radius,i={currObj:{}};r.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:i}}),r.frameObj.radius=parseInt(e.item.text,10),r.notify("draw",{prop:"triggerFrameChange",value:{prevFrameSettings:n,obj:s}}),s.frameChangeEventArgs&&!s.frameChangeEventArgs.cancel?(r.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"frame",previousObj:i.currObj,previousObjColl:i.currObj.objColl,previousPointColl:i.currObj.pointColl,previousSelPointColl:i.currObj.selPointColl,previousCropObj:Pe({},r.cropObj,{},!0),previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),r.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!0}}),r.notify("draw",{prop:"redrawDownScale"}),l.content=e.item.text,r.curFrameObjEvent={previousFrameSetting:s.frameChangeEventArgs.previousFrameSetting,currentFrameSetting:s.frameChangeEventArgs.currentFrameSetting},r.isFrameBtnClick=!0):r.frameObj.radius=t,F.isDevice?document.getElementById(a+"_bottomToolbar")&&At(a+"_bottomToolbar","toolbar").refreshOverflow():document.getElementById(a+"_toolbar")&&At(a+"_toolbar","toolbar").refreshOverflow()}}));l.appendTo("#"+a+"_frameRadiusBtn")},RUt.prototype.createFrameAmount=function(){var n,o=this,r=this.parent,s={frameChangeEventArgs:null},a=r.element.id,e=[{id:"1",text:this.l10n.getConstant("1")},{id:"2",text:this.l10n.getConstant("2")},{id:"3",text:this.l10n.getConstant("3")},{id:"4",text:this.l10n.getConstant("4")},{id:"5",text:this.l10n.getConstant("5")}],t=document.getElementById(a+"_frameAmountBtn"),i=document.createElement("span"),l=(i.innerHTML=this.l10n.getConstant(r.frameObj.amount.toString()),i.className="e-frame-amount",t.appendChild(i),new u2({items:e,open:function(e){F.isDevice&&((t=e.element.parentElement).style.top=l.element.getBoundingClientRect().top-t.offsetHeight+"px");var t=l.element.childNodes[0].textContent;""!==t&&e.element.querySelector('[aria-label = "'+t+'"]').classList.add("e-selected-btn")},select:function(e){o.triggerTbarClickEvent(e),n={type:r.toPascalCase(r.frameObj.type),color:r.frameObj.color,gradientColor:r.frameObj.gradientColor,size:r.frameObj.size,inset:r.frameObj.inset,offset:r.frameObj.offset,borderRadius:r.frameObj.radius,lineCount:r.frameObj.amount,frameLineStyle:r.toPascalCase(r.frameObj.border)};var t=r.frameObj.amount,i={currObj:{}};r.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:i}}),r.frameObj.amount=parseInt(e.item.text,10),r.notify("draw",{prop:"triggerFrameChange",value:{prevFrameSettings:n,obj:s}}),s.frameChangeEventArgs&&!s.frameChangeEventArgs.cancel?(r.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"frame",previousObj:i.currObj,previousObjColl:i.currObj.objColl,previousPointColl:i.currObj.pointColl,previousSelPointColl:i.currObj.selPointColl,previousCropObj:Pe({},r.cropObj,{},!0),previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),r.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!0}}),r.notify("draw",{prop:"redrawDownScale"}),l.content=e.item.text,r.curFrameObjEvent={previousFrameSetting:s.frameChangeEventArgs.previousFrameSetting,currentFrameSetting:s.frameChangeEventArgs.currentFrameSetting},r.isFrameBtnClick=!0):r.frameObj.amount=t,F.isDevice?document.getElementById(a+"_bottomToolbar")&&At(a+"_bottomToolbar","toolbar").refreshOverflow():document.getElementById(a+"_toolbar")&&At(a+"_toolbar","toolbar").refreshOverflow()}}));l.appendTo("#"+a+"_frameAmountBtn")},RUt.prototype.createFrameBorder=function(){var n,o=this,r=this.parent,s={frameChangeEventArgs:null},a=r.element.id,e=[{id:"1",text:this.l10n.getConstant("Solid")},{id:"2",text:this.l10n.getConstant("Dashed")},{id:"3",text:this.l10n.getConstant("Dotted")}],t=document.getElementById(a+"_frameBorderBtn"),i=document.createElement("span"),l=(i.innerHTML=this.l10n.getConstant(r.toPascalCase(r.frameObj.border)),i.className="e-frame-border",t.appendChild(i),new u2({items:e,open:function(e){F.isDevice&&((t=e.element.parentElement).style.top=l.element.getBoundingClientRect().top-t.offsetHeight+"px");var t=l.element.childNodes[0].textContent;""!==t&&e.element.querySelector('[aria-label = "'+t+'"]').classList.add("e-selected-btn")},select:function(e){o.triggerTbarClickEvent(e),n={lineCount:r.frameObj.amount,color:r.frameObj.color,borderRadius:r.frameObj.radius,gradientColor:r.frameObj.gradientColor,size:r.frameObj.size,inset:r.frameObj.inset,offset:r.frameObj.offset,frameLineStyle:r.toPascalCase(r.frameObj.border),type:r.toPascalCase(r.frameObj.type)};var t=r.frameObj.border,i={currObj:{}};r.notify("filter",{prop:"getCurrentObj",onPropertyChange:!1,value:{object:i}}),r.frameObj.border=e.item.text.toLowerCase(),r.notify("draw",{prop:"triggerFrameChange",value:{prevFrameSettings:n,obj:s}}),s.frameChangeEventArgs&&!s.frameChangeEventArgs.cancel?(r.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"frame",previousObj:i.currObj,previousObjColl:i.currObj.objColl,previousPointColl:i.currObj.pointColl,previousSelPointColl:i.currObj.selPointColl,previousCropObj:Pe({},r.cropObj,{},!0),previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),r.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!0}}),r.notify("draw",{prop:"redrawDownScale"}),l.content=e.item.text,r.curFrameObjEvent={previousFrameSetting:s.frameChangeEventArgs.previousFrameSetting,currentFrameSetting:s.frameChangeEventArgs.currentFrameSetting},r.isFrameBtnClick=!0):r.frameObj.border=t,F.isDevice?document.getElementById(a+"_bottomToolbar")&&At(a+"_bottomToolbar","toolbar").refreshOverflow():document.getElementById(a+"_toolbar")&&At(a+"_toolbar","toolbar").refreshOverflow()}}));l.appendTo("#"+a+"_frameBorderBtn")},RUt.prototype.initFilterToolbarItem=function(){var t=this,i=this.parent,n=i.element.id,e={toolbarType:"filter",toolbarItems:this.getFilterToolbarItem()},o=(i.trigger("toolbarUpdating",e),e=e.toolbarItems,document.querySelector("#"+n+"_contextualToolbar").classList.contains("e-control")&&At(document.getElementById(n+"_contextualToolbar"),"toolbar").destroy(),new U3({width:"100%",items:e,clicked:this.contextualToolbarClicked.bind(this),created:function(){t.updatePrivateVariables(),t.createCanvasFilter(),""===i.currentFilter&&(i.currentFilter=n+"_default");var e=document.querySelector("#"+n+"_headWrapper"),e=(e&&(e.style.display="none"),document.getElementById(i.currentFilter+"Canvas"));e&&e.parentElement.parentElement.classList.add("e-selected"),t.enableDisableTbrBtn(),o.refreshOverflow()}}));o.appendTo("#"+n+"_contextualToolbar")},RUt.prototype.drawDashedLine=function(e){e.beginPath(),e.setLineDash([5]),e.rect(10,10,280,130),e.stroke(),e.closePath()},RUt.prototype.createCanvasFilter=function(){var e=this.parent,t=(kA(e.element),e.element.style.opacity="0.5",e.getCurrentCanvasData());this.inMemoryCanvas.width=t.width,this.inMemoryCanvas.height=t.height,this.inMemoryContext.putImageData(t,0,0),this.updateFilterCanvas("_defaultCanvas","default"),this.updateFilterCanvas("_chromeCanvas","chrome"),this.updateFilterCanvas("_coldCanvas","cold"),this.updateFilterCanvas("_warmCanvas","warm"),this.updateFilterCanvas("_grayscaleCanvas","grayscale"),this.updateFilterCanvas("_sepiaCanvas","sepia"),this.updateFilterCanvas("_invertCanvas","invert"),BA(e.element),e.element.style.opacity="1",e.initialAdjustmentValue=this.lowerContext.filter},RUt.prototype.updateFilterCanvas=function(e,t){var i,n=this.parent,e=n.element.querySelector("#"+n.element.id+e);e&&(i=e.getContext("2d"),i=e.getContext("2d"),e.style.width="100px",e.style.height="100px",n.notify("filter",{prop:"updateAdj",value:{type:t,value:null,isPreview:!0,ctx:i}}),i.drawImage(this.inMemoryCanvas,0,0,300,150),n.isSafari)&&n.notify("filter",{prop:"apply-filter",onPropertyChange:!1,value:{context:i}})},RUt.prototype.getQuickAccessToolbarItem=function(e){var t=this.parent,i=t.element.id,n={cancel:!1,toolbarItems:[]},o=[],r=(je(e)?("image"===t.activeObj.shape&&o.push("Flip"),"redact"!==t.activeObj.shape&&o.push("BringToFront"),o.push("Clone"),o.push("Delete"),"text"===t.activeObj.shape&&o.push("EditText"),n.shape=t.toPascalCase(t.activeObj.shape)):e&&(o.push("BringToFront"),o.push("Delete"),n.shape="Freehand draw"),n.toolbarItems=Pe([],o,null,!0),t.trigger("quickAccessToolbarOpen",n),[]);if(n.cancel)r=[];else for(var s=0;s<n.toolbarItems.length;s++)switch(n.toolbarItems[s]){case"BringToFront":r.push({id:i+"_bringToFront",prefixIcon:"e-icons e-bring-to-front",tooltipText:this.l10n.getConstant("BringToFront"),align:"Left"});break;case"Clone":r.push({id:i+"_duplicate",prefixIcon:"e-icons e-order",cssClass:"top-icon e-order",tooltipText:this.l10n.getConstant("Duplicate"),align:"Left"});break;case"Delete":r.push({id:i+"_remove",prefixIcon:"e-icons e-trash",cssClass:"top-icon e-trash",tooltipText:this.l10n.getConstant("Remove"),align:"Left"});break;case"EditText":r.push({id:i+"_editText",prefixIcon:"e-icons e-annotation-edit",cssClass:"top-icon e-annotation-edit",tooltipText:this.l10n.getConstant("EditText"),align:"Left"});break;case"Flip":r.push({id:i+"_hFlip",prefixIcon:"e-icons e-horizontal-flip",tooltipText:this.l10n.getConstant("HorizontalFlip"),align:"Left"}),r.push({id:i+"_vFlip",prefixIcon:"e-icons e-vertical-flip",tooltipText:this.l10n.getConstant("VerticalFlip"),align:"Left"});break;default:r.push(n.toolbarItems[s])}return r},RUt.prototype.renderQAT=function(e){var t,i,n,o,r,s,a,l,h,d=this.parent,p=d.element.id;d.activeObj&&d.showQuickAccessToolbar&&((t=document.getElementById(p+"_quickAccessToolbarArea"))&&(this.destroyQuickAccessToolbar(),t.style.display="block"),0!==(i=this.getQuickAccessToolbarItem(e)).length)&&(je(d.quickAccessToolbarTemplate)&&new U3({items:i,clicked:this.quickAccessToolbarClicked.bind(this)}).appendTo("#"+p+"_quickAccessToolbar"),n=this.toolbarHeight&&0!==this.toolbarHeight?this.toolbarHeight:t.clientHeight,p=d.element.querySelector("#"+p+"_headWrapper"),je(e)&&(0!==d.activeObj.activePoint.width||0!==d.activeObj.activePoint.height||d.activeObj.shape&&"path"===d.activeObj.shape&&0<d.activeObj.pointColl.length)?(d.notify("shape",{prop:"getHighestOrder",onPropertyChange:!(a={order:null}),value:{obj:a}}),d.activeObj.order>a.order&&document.getElementById(d.element.id+"_bringToFront")?document.getElementById(d.element.id+"_bringToFront").classList.add("e-overlay"):document.getElementById(d.element.id+"_bringToFront")&&document.getElementById(d.element.id+"_bringToFront").classList.remove("e-overlay"),t.style.width="auto",d.activeObj.activePoint.width=Math.abs(d.activeObj.activePoint.width),d.activeObj.activePoint.height=Math.abs(d.activeObj.activePoint.height),s=d.activeObj.activePoint.startX<d.activeObj.activePoint.endX?d.activeObj.activePoint.startX:d.activeObj.activePoint.endX,o=d.activeObj.activePoint.startY<d.activeObj.activePoint.endY?d.activeObj.activePoint.startY:d.activeObj.activePoint.endY,l=d.activeObj.activePoint.width,0!==d.activeObj.rotatedAngle&&"arrow"!==d.activeObj.shape?(d.notify("shape",{prop:"getSquarePointForRotatedShape",onPropertyChange:!(h={activePoint:null}),value:{obj:d.activeObj,object:h}}),s=(h=h.activePoint).startX,o=h.startY,l=h.width):"path"===d.activeObj.shape&&(s=(r=d.getSquarePointForPath(d.activeObj)).startX,o=r.startY,l=r.width),t.style.left=s+l/2-25*i.length+"px",parseFloat(t.style.left)+t.clientWidth/2!==s+l/2&&(r=s+l/2-(parseFloat(t.style.left)+t.clientWidth/2),t.style.left=parseFloat(t.style.left)+r+"px"),o-((n=p?p.offsetHeight+n:n)+n/1.5)<d.img.destTop?(t.style.top=d.img.destTop+"px",p&&(t.style.top=(d.img.destTop<0?0:d.img.destTop)+p.offsetHeight+"px")):(n=this.toolbarHeight,t.style.top=o-(n+n/1.5)+"px")):e?(d.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!(s={freehandSelectedIndex:-1}),value:{obj:s}}),d.notify("shape",{prop:"getHighestOrder",onPropertyChange:!(a={order:null}),value:{obj:a}}),d.getObjFromId(d.pointColl[s.freehandSelectedIndex].id).order>=a.order&&document.getElementById(d.element.id+"_bringToFront")?document.getElementById(d.element.id+"_bringToFront").classList.add("e-overlay"):document.getElementById(d.element.id+"_bringToFront")&&document.getElementById(d.element.id+"_bringToFront").classList.remove("e-overlay"),d.notify("freehand-draw",{prop:"getSqPtFD",value:{idx:s.freehandSelectedIndex,obj:l={activePoint:null}}}),h=l.activePoint,t.style.width="auto",t.style.left=h.startX+h.width/2-24*i.length+"px",h.startY-(n+n/1.5)<d.img.destTop?t.style.top=d.img.destTop+"px":t.style.top=h.startY-(n+n/1.5)+"px"):t.style.display="none",parseFloat(t.style.top)<0)&&(t.style.top="0px")},RUt.prototype.refreshDropDownBtn=function(e){var t,i;!je(e)&&(t=this.parent.element.id,(i=document.querySelector("#"+t+"_annotationBtn"))&&(e?(i.classList.add("e-disabled"),i.parentElement.classList.add("e-overlay")):(i.classList.remove("e-disabled"),i.parentElement.classList.remove("e-overlay")),At(i,"dropdown-btn").disabled=e),(i=document.querySelector("#"+t+"_transformBtn"))&&(e?(i.classList.add("e-disabled"),i.parentElement.classList.add("e-overlay")):(i.classList.remove("e-disabled"),i.parentElement.classList.remove("e-overlay")),At(i,"dropdown-btn").disabled=e),(i=document.querySelector("#"+t+"_adjustment"))&&(e?(i.classList.add("e-disabled"),i.parentElement.classList.add("e-overlay")):(i.classList.remove("e-disabled"),i.parentElement.classList.remove("e-overlay")),At(i,"btn").disabled=e),i=document.querySelector("#"+t+"_filter"))&&(e?(i.classList.add("e-disabled"),i.parentElement.classList.add("e-overlay")):(i.classList.remove("e-disabled"),i.parentElement.classList.remove("e-overlay")),At(i,"btn").disabled=e)},RUt.prototype.cropSelect=function(e){var t=this.parent,e=(t.isCropTab=!0,je(t.transform.cropZoomFactor)&&(t.transform.cropZoomFactor=t.transform.zoomFactor,t.notify("draw",{prop:"setTempZoomFactor",onPropertyChange:!1,value:{tempZoomFactor:t.transform.zoomFactor}})),t.transform.zoomFactor=t.transform.cropZoomFactor,e.item.id),i=(this.currentToolbar="crop",t.currSelectionPoint=null,t.notify("draw",{prop:"setIsCropSelect",value:{bool:!0}}),{prevObj:null});t.notify("crop",{prop:"getPreviousCropCurrentObj",value:{obj:i}}),t.notify("draw",{prop:"select",onPropertyChange:!1,value:{type:e,startX:null,startY:null,width:null,height:null}}),t.notify("crop",{prop:"setPreviousCropCurrentObj",value:{obj:i.prevObj}}),this.enableDisableTbrBtn(),t.notify("transform",{prop:"disableZoomOutBtn",value:{isZoomOut:!0}})},RUt.prototype.quickAccessToolbarClicked=function(e,t){var i=this.parent,n=i.element.id;if(e.item){var o,r=null,s={tempObj:null},a=(i.notify("draw",{prop:"getPrevActObj",onPropertyChange:!1,value:{obj:{prevActObj:null}}}),i.notify("selection",{prop:"getTempActObj",onPropertyChange:!1,value:{obj:s}}),s.tempObj.activePoint.height=Math.abs(s.tempObj.activePoint.height),{isNewPath:null}),l=void 0,h=(i.notify("draw",{prop:"getNewPath",value:{obj:a}}),e.item.id.replace(n+"_","").toLowerCase()),d=void 0,p=void 0,c={freehandSelectedIndex:null},u=void 0,g={order:null};switch(h){case"duplicate":i.element.querySelector("#"+n+"_duplicate").classList.contains("e-overlay")||(this.refreshSlider(),a.isNewPath||JSON.stringify(s.tempObj)!==JSON.stringify(i.activeObj)||(r=!0),this.duplicateShape(r));break;case"remove":i.element.querySelector("#"+n+"_remove").classList.contains("e-overlay")||(i.noPushUndo=!1,this.refreshSlider(),i.notify("selection",{prop:"deleteItem",onPropertyChange:!1}));break;case"edittext":i.element.querySelector("#"+n+"_editText").classList.contains("e-overlay")||this.editText();break;case"rotleft":case"rotright":d=i.element.querySelector("#"+n+"_rotLeft"),p=i.element.querySelector("#"+n+"_rotRight"),(d&&!d.classList.contains("e-disabled")||p&&!p.classList.contains("e-disabled"))&&i.rotateImage(e.item.id.replace(n+"_","").toLowerCase()),i.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1});break;case"hflip":i.element.querySelector("#"+n+"_hFlip").classList.contains("e-disabled")||(l=i.activeObj.imageCanvas.getContext("2d"),i.horizontalFlip(l)),i.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1});break;case"vflip":i.element.querySelector("#"+n+"_vFlip").classList.contains("e-disabled")||(l=i.activeObj.imageCanvas.getContext("2d"),i.verticalFlip(l)),i.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1});break;case"bringtofront":i.element.querySelector("#"+n+"_bringToFront").classList.contains("e-overlay")||(i.notify("freehand-draw",{prop:"getFreehandSelectedIndex",onPropertyChange:!1,value:{obj:c}}),u=null!==c.freehandSelectedIndex?i.pointColl[c.freehandSelectedIndex].id:i.activeObj.currIndex,i.updateShapeOrder(u,h),i.notify("shape",{prop:"getHighestOrder",onPropertyChange:!1,value:{obj:g}}),(-1<u.indexOf("pen")?(i.notify("shape",{prop:"updateShapeColl",onPropertyChange:!1}),o=i.getObjFromId(u).order,g.order<=o):(o=i.getObjFromId(u).order,g.order<o))?document.getElementById(i.element.id+"_bringToFront").classList.add("e-overlay"):document.getElementById(i.element.id+"_bringToFront").classList.remove("e-overlay"),i.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1}))}"duplicate"!==h&&"remove"!==h||i.notify("draw",{prop:"redrawDownScale"})}je(t)&&i.trigger("quickAccessToolbarItemClick",e)},RUt.prototype.editText=function(){var e=this.parent,t={x:e.activeObj.activePoint.startX,y:e.activeObj.activePoint.startY},i=(this.upperContext.clearRect(0,0,e.upperCanvas.width,e.upperCanvas.height),e.notify("selection",{prop:"setTempActObj",onPropertyChange:!1,value:{obj:Pe({},e.activeObj,{},!0)}}),e.notify("selection",{prop:"setInitialTextEdit",onPropertyChange:!1,value:{bool:!0}}),e.notify("draw",{prop:"setPrevActObj",onPropertyChange:!1,value:{prevActObj:Pe({},e.activeObj,{},!0)}}),0!==e.activeObj.rotatedAngle&&(i={x:t.x,y:t.y},e.notify("shape",{prop:"getTextBoxPosition",onPropertyChange:!1,value:{obj:e.activeObj,object:i}}),t.x=i.x,t.y=i.y,i={x:t.x,y:t.y},e.notify("shape",{prop:"setFlipState",onPropertyChange:!1,value:{x:t.x,y:t.y,obj:e.activeObj,object:i}}),t.x=i.x,t.y=i.y),Pe({},e.activeObj,{},!0));e.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.upperContext.clearRect(0,0,e.upperCanvas.width,e.upperCanvas.height),this.lowerContext.clearRect(0,0,e.upperCanvas.width,e.upperCanvas.height),e.notify("draw",{prop:"redrawImgWithObj",onPropertyChange:!1}),e.notify("draw",{prop:"redrawDownScale"}),e.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.lowerContext}}),e.notify("draw",{prop:"clearOuterCanvas",onPropertyChange:!1,value:{context:this.upperContext}}),e.activeObj=i,e.notify("shape",{prop:"renderTextArea",onPropertyChange:!1,value:{x:t.x,y:t.y,actObj:e.activeObj}}),je(e.activeObj.currIndex)&&e.notify("draw",{prop:"setShapeTextInsert",onPropertyChange:!1,value:{bool:!0}}),document.getElementById(e.element.id+"_quickAccessToolbarArea")&&(document.getElementById(e.element.id+"_quickAccessToolbarArea").style.display="none")},RUt.prototype.duplicateShape=function(e,t){var i,n=this.parent,o=(n.notify("selection",{prop:"setTempActObj",onPropertyChange:!1,value:{obj:{activePoint:{startX:0,startY:0,endX:0,endY:0,width:0,height:0},flipObjColl:[],triangle:[],triangleRatio:[]}}}),{prevActObj:null}),r=(n.notify("draw",{prop:"getPrevActObj",onPropertyChange:!1,value:{obj:o}}),n.notify("draw",{prop:"getNewPath",value:{obj:{isNewPath:null}}}),Pe({},n.activeObj,{},!0)),s={order:null},s=(n.notify("shape",{prop:"getHighestOrder",onPropertyChange:!1,value:{obj:s}}),r.order?n.notify("shape",{prop:"updateShapeColl",onPropertyChange:!1}):(n.noPushUndo=!0,n.okBtn(),n.noPushUndo=!1,n.selectShape(r.currIndex)),r.order=s.order>r.order?s.order+1:r.order+1,"image"===r.shape&&(i=Pe([],n.objColl,[],!0),n.notify("undo-redo",{prop:"updateUrObj",onPropertyChange:!1,value:{objColl:i}})),je(n.activeObj.currIndex)?n.notify("shape",{prop:"applyActObj",onPropertyChange:!1,value:{isMouseDown:e}}):o.prevActObj||t?(n.activeObj.currIndex=null,r.currIndex=null,n.notify("shape",{prop:"applyActObj",onPropertyChange:!1,value:{isMouseDown:e}})):n.notify("shape",{prop:"applyActObj",onPropertyChange:!1,value:{isMouseDown:!0}}),n.noPushUndo);if(n.noPushUndo=!1,n.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}),n.noPushUndo=s,i=Pe([],n.objColl,[],!0),r.activePoint.startX+=10,r.activePoint.startY-=10,r.activePoint.endX+=10,r.activePoint.endY-=10,"path"===r.shape)for(var a=0;a<r.pointColl.length;a++)r.pointColl[a].x+=10,r.pointColl[a].y-=10;else"image"===r.shape&&(r.imageCanvas=n.createElement("canvas"));o={id:"shape_"+(n.objColl.length+1)},n.notify("shape",{prop:"getNewShapeId",onPropertyChange:!1,value:{obj:o}}),r.currIndex=o.id,n.activeObj=Pe({},r,{},!0),"image"===n.activeObj.shape&&(t=Pe({},r.activePoint,{},!0),n.notify("transform",{prop:"calcMaxDimension",onPropertyChange:!(e={width:0,height:0}),value:{width:n.activeObj.imageElement.width,height:n.activeObj.imageElement.height,obj:e,isImgShape:null}}),n.activeObj.activePoint.width=e.width,n.activeObj.activePoint.height=e.height,n.activeObj.isHorImageFlip&&n.activeObj.isVerImageFlip?(n.activeObj.isHorImageFlip=n.activeObj.isVerImageFlip=!1,n.notify("draw",{prop:"downScaleImgCanvas",onPropertyChange:!1,value:{ctx:r.imageCanvas.getContext("2d"),isImgAnnotation:!0,isHFlip:!0,isVFlip:!0}}),n.activeObj.isHorImageFlip=n.activeObj.isVerImageFlip=!0):n.activeObj.isHorImageFlip?(n.activeObj.isHorImageFlip=!1,n.notify("draw",{prop:"downScaleImgCanvas",onPropertyChange:!1,value:{ctx:r.imageCanvas.getContext("2d"),isImgAnnotation:!0,isHFlip:!0,isVFlip:null}}),n.activeObj.isHorImageFlip=!0):n.activeObj.isVerImageFlip?(n.activeObj.isVerImageFlip=!1,n.notify("draw",{prop:"downScaleImgCanvas",onPropertyChange:!1,value:{ctx:r.imageCanvas.getContext("2d"),isImgAnnotation:!0,isHFlip:null,isVFlip:!0}}),n.activeObj.isVerImageFlip=!0):n.notify("draw",{prop:"downScaleImgCanvas",onPropertyChange:!1,value:{ctx:r.imageCanvas.getContext("2d"),isImgAnnotation:!0,isHFlip:null,isVFlip:null}}),n.activeObj.activePoint=t),"line"!==n.activeObj.shape&&"arrow"!==n.activeObj.shape||n.notify("shape",{prop:"setPointCollForLineArrow",onPropertyChange:!1,value:{obj:n.activeObj}}),n.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:n.activeObj,isCropRatio:null,points:null,isPreventDrag:!0}}),n.notify("undo-redo",{prop:"updateUrObj",onPropertyChange:!1,value:{objColl:i}}),n.notify("shape",{prop:"applyActObj",onPropertyChange:!1,value:{isMouseDown:!0}}),n.noPushUndo=!1,n.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}}),n.noPushUndo=!0,n.notify("selection",{prop:"redrawShape",onPropertyChange:!1,value:{obj:n.objColl[n.objColl.length-1]}}),s=n.element.id,o=F.isDevice?"#"+s+"_bottomToolbar #"+s:"#"+s,e={freehandDrawSelectedId:null};n.notify("freehand-draw",{prop:"getFreehandDrawSelectedId",onPropertyChange:!1,value:{obj:e}}),this.enableDisableCloneBtn(o,e),this.renderQAT(),n.activeObj.shape&&"redact"===n.activeObj.shape&&this.redactSlider(n.activeObj.redactType)},RUt.prototype.defToolbarClicked=function(e){var t,i,n,o,r=this.parent,s=r.element.id,a=!1,l=!1;!this.isFrameToolbar&&r.element.querySelector(".e-contextual-toolbar-wrapper")&&(r.element.querySelector(".e-contextual-toolbar-wrapper").classList.contains("e-hide")||(a=l=!0),t=r.isStraightening,F.isDevice&&(!F.isDevice||t)||r.element.querySelector(".e-contextual-toolbar-wrapper").classList.add("e-hide")),e.item&&("duplicate"===(t=e.item.id.replace(s+"_","").toLowerCase())||"remove"===t||"edittext"===t||"hflip"===t||"vflip"===t||"rotleft"===t||"rotright"===t?(this.quickAccessToolbarClicked(e,!0),r.trigger("toolbarItemClicked",e)):(n=i=!1,(o=document.querySelector("#"+s+"_adjustment"))&&o.classList.contains("e-disabled")&&(n=!0),(o=document.querySelector("#"+s+"_filter"))&&o.classList.contains("e-disabled")&&(i=!0),this.enableDisableTbrBtn(),this.performDefTbrClick(t,a,n,i,l),r.trigger("toolbarItemClicked",e),r.isStraightening&&r.notify("transform",{prop:"disableZoomOutBtn",value:{isZoomOut:!0}}),-1!==["undo","redo","cancel","aspectratio","nonaspectratio","save","duplicate","filter","frame","none","mat","bevel","line","inset","hook","resize","remove"].indexOf(t)&&r.notify("draw",{prop:"redrawDownScale"})))},RUt.prototype.performDefTbrClick=function(e,t,i,n,o){var r,s,a,l,h=this.parent,d=h.element.id,p=h.element.querySelector("#"+d+"_zoomIn"),c=h.element.querySelector("#"+d+"_resizeHeight"),u=h.element.querySelector("#"+d+"_resizeWidth"),g=!1,m=!1;if((void 0===(r=void 0!==h.activeObj.shape?h.activeObj.shape.split("-"):r)&&h.currObjType.isCustomCrop||void 0!==r&&"crop"===r[0])&&(g=!0),!h.disabled){switch(e){case"pan":h.currObjType.isCustomCrop=h.currObjType.isFiltered=!1,h.currObjType.isRedact=!1,h.currObjType.isUndoAction&&h.notify("undo-redo",{prop:"refreshUrc",value:{bool:null}}),g&&(h.currObjType.isCustomCrop=!1,h.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.upperContext.clearRect(0,0,h.upperCanvas.width,h.upperCanvas.height),this.refreshToolbar("main")),h.togglePan?(this.cancelPan(),h.notify("transform",{prop:"setDisablePan",onPropertyChange:!1,value:{bool:!0}}),"pen"===this.currentToolbar&&h.freeHandDraw(!0)):((s=h.element.querySelector(".e-img-pan .e-btn"))&&s.classList.add("e-selected-btn"),h.pan(!0),h.notify("transform",{prop:"setDisablePan",onPropertyChange:!1,value:{bool:!1}})),p&&h.zoomSettings.zoomFactor>=h.zoomSettings.maxZoomFactor?(p.classList.add("e-disabled"),p.parentElement.classList.add("e-overlay")):p&&(p.classList.remove("e-disabled"),p.parentElement.classList.remove("e-overlay")),this.refreshToolbar("main");break;case"cancel":h.currObjType.isRedact&&(h.currObjType.isRedact=!1),this.isFrameToolbar&&h.element.querySelector(".e-contextual-toolbar-wrapper")&&!h.element.querySelector(".e-contextual-toolbar-wrapper").classList.contains("e-hide")&&h.element.querySelector(".e-contextual-toolbar-wrapper").classList.add("e-hide"),h.notify("draw",{prop:"performCancel",value:{isContextualToolbar:t,isFinalCancel:!0}});break;case"ok":F.isDevice&&this.isFrameToolbar&&h.element.querySelector(".e-contextual-toolbar-wrapper")&&!h.element.querySelector(".e-contextual-toolbar-wrapper").classList.contains("e-hide")&&h.element.querySelector(".e-contextual-toolbar-wrapper").classList.add("e-hide"),h.okBtn(null,!0),h.drawingShape=null,this.refreshDropDownBtn(!1),this.currentToolbar="main",h.isStraightening=!1,h.notify("draw",{prop:"resetTempObjColl"}),h.notify("draw",{prop:"resetTempPointColl"});break;case"crop":h.notify("transform",{prop:"disableZoomOutBtn",value:{isZoomOut:!0}}),F.isDevice&&this.updateContextualToolbar("color","straighten");break;case"reset":h.reset(),this.imageHeight=null,this.imageWidth=null,h.aspectHeight=null,h.aspectWidth=null,this.isAspectRatio=!0,this.currentToolbar="main";break;case"undo":h.noPushUndo=!1,(h.togglePen||h.drawingShape)&&(h.okBtn(),h.drawingShape=null),h.notify("undo-redo",{prop:"call-undo"});break;case"redo":h.noPushUndo=!1,(h.togglePen||h.drawingShape)&&(h.okBtn(),h.drawingShape=null),h.notify("undo-redo",{prop:"call-redo"});break;case"aspectratio":(!h.isCircleCrop&&je(h.currSelectionPoint)||h.currSelectionPoint&&"crop-circle"!==h.currSelectionPoint.shape)&&(At(u,"numerictextbox").value?(h.aspectWidth=At(u,"numerictextbox").value,h.aspectHeight=At(c,"numerictextbox").value,h.notify("transform",{prop:"resize",value:{width:h.aspectWidth,height:null,isAspectRatio:!0}})):At(c,"numerictextbox").value&&(h.aspectWidth=parseFloat(At(u,"numerictextbox").placeholder),h.aspectHeight=At(c,"numerictextbox").value,h.notify("transform",{prop:"resize",value:{width:h.aspectWidth,height:h.aspectHeight,isAspectRatio:!0}})),h.resizeSrc={startX:h.img.srcLeft,startY:h.img.srcTop,width:h.img.srcWidth,height:h.img.srcHeight},this.refreshToolbar("resize"));break;case"nonaspectratio":(At(u,"numerictextbox").value||At(c,"numerictextbox").value)&&(h.aspectWidth=At(u,"numerictextbox").value?At(u,"numerictextbox").value:parseFloat(At(u,"numerictextbox").placeholder),h.aspectHeight=At(c,"numerictextbox").value?At(c,"numerictextbox").value:parseFloat(At(c,"numerictextbox").placeholder),h.notify("transform",{prop:"resize",value:{width:h.aspectWidth,height:h.aspectHeight,isAspectRatio:!1}})),h.resizeSrc={startX:h.img.srcLeft,startY:h.img.srcTop,width:h.img.srcWidth,height:h.img.srcHeight},this.refreshToolbar("resize");break;case"resize":(h.currObjType.isFiltered||h.currObjType.isRedact)&&h.okBtn(),this.resizeClick();break;case"adjustment":i||((h.currObjType.isFiltered||h.currObjType.isRedact)&&h.okBtn(),this.refreshToolbar("adjustment"),h.setTempFilterProperties(),h.notify("draw",{prop:"updateFinetune"}),h.notify("filter",{prop:"setTempAdjVal"}),this.openSlider("brightness"));break;case"brightness":case"contrast":case"hue":case"saturation":case"opacity":case"blur":case"exposure":this.openSlider(e);break;case"filter":n||(kA(h.element),this.refreshToolbar("filter"),h.setTempFilterProperties(),BA(h.element));break;case"default":case"chrome":case"cold":case"warm":case"grayscale":case"blackandwhite":case"sepia":case"invert":case"sharpen":h.currObjType.isFiltered=!0,h.notify("filter",{prop:"applyImageFilter",value:{option:e}});break;case"upload":o&&h.element.querySelector(".e-contextual-toolbar-wrapper").classList.remove("e-hide");break;case"bold":h.notify("selection",{prop:"setInitialTextEdit",value:{bool:!1}}),h.activeObj.textSettings.bold&&h.activeObj.textSettings.italic?h.notify("shape",{prop:"applyFontStyle",onPropertyChange:!1,value:{item:"italic"}}):h.activeObj.textSettings.bold&&!h.activeObj.textSettings.italic?h.notify("shape",{prop:"applyFontStyle",onPropertyChange:!1,value:{item:"default"}}):!h.activeObj.textSettings.bold&&h.activeObj.textSettings.italic?h.notify("shape",{prop:"applyFontStyle",onPropertyChange:!1,value:{item:"bolditalic"}}):h.activeObj.textSettings.bold||h.activeObj.textSettings.italic||h.notify("shape",{prop:"applyFontStyle",onPropertyChange:!1,value:{item:"bold"}}),h.element.querySelector("#"+d+"_bold").classList.contains("e-selected-btn")?h.element.querySelector("#"+d+"_bold").classList.remove("e-selected-btn"):h.element.querySelector("#"+d+"_bold").classList.add("e-selected-btn"),0===h.activeObj.activePoint.width&&0===h.activeObj.activePoint.height||h.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1});break;case"italic":h.notify("selection",{prop:"setInitialTextEdit",value:{bool:!1}}),h.activeObj.textSettings.bold&&h.activeObj.textSettings.italic?h.notify("shape",{prop:"applyFontStyle",onPropertyChange:!1,value:{item:"bold"}}):h.activeObj.textSettings.bold&&!h.activeObj.textSettings.italic?h.notify("shape",{prop:"applyFontStyle",onPropertyChange:!1,value:{item:"bolditalic"}}):!h.activeObj.textSettings.bold&&h.activeObj.textSettings.italic?h.notify("shape",{prop:"applyFontStyle",onPropertyChange:!1,value:{item:"default"}}):h.activeObj.textSettings.bold||h.activeObj.textSettings.italic||h.notify("shape",{prop:"applyFontStyle",onPropertyChange:!1,value:{item:"italic"}}),h.element.querySelector("#"+d+"_italic").classList.contains("e-selected-btn")?h.element.querySelector("#"+d+"_italic").classList.remove("e-selected-btn"):h.element.querySelector("#"+d+"_italic").classList.add("e-selected-btn"),0===h.activeObj.activePoint.width&&0===h.activeObj.activePoint.height||h.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1});break;case"croptransform":this.performCropTransformClick();break;case"rotateleft":case"rotateright":case"horizontalflip":case"verticalflip":h.transformSelect(e),this.updateRedactObj(),"rotateleft"!==e&&"rotateright"!==e||(h.notify("draw",{prop:"resetStraightenDestPoints"}),h.notify("draw",{prop:"setDestForStraighten"})),h.notify("transform",{prop:"disableZoomOutBtn",value:{isZoomOut:!0}}),F.isDevice&&this.updateContextualToolbar("color","straighten"),s={action:"rotateleft"===e||"rotateright"===e?"rotate":"flip",actionEventArgs:h.editCompleteArgs},h.triggerEditCompleteEvent(s);break;case"save":h.noPushUndo=!1,h.okBtn(),h.drawingShape=null,this.saveDialogPopup();break;case"transparency":this.updateContextualToolbar("transparency","transparency");break;case"frame":this.frameToolbarClick();break;case"none":case"mat":case"bevel":case"line":case"inset":case"hook":this.unselectFrameBtn(),h.element.querySelector("#"+d+"_"+e)&&h.element.querySelector("#"+d+"_"+e).classList.add("e-selected-btn"),h.frameObj.type=e,h.frameObj.size=20,h.frameObj.inset=20,h.frameObj.radius=0,h.frameObj.amount=1,h.frameObj.offset="inset"===e?60:20,this.refreshToolbar("frame"),h.notify("draw",{prop:"render-image",value:{isMouseWheel:null,isPreventClearRect:null,isFrame:!0}}),h.isFrameBtnClick=!0,h.curFrameObjEvent={previousFrameSetting:h.tempFrameObj,currentFrameSetting:h.frameObj},h.notify("draw",{prop:"triggerFrameChange",value:{prevFrameSettings:h.tempFrameObj,obj:{frameChangeEventArgs:null}}});break;case"redact":h.currObjType.isRedact=m=!0,h.drawingShape="redact",je(h.activeObj.redactBlur)&&(h.activeObj.redactBlur=20),je(h.activeObj.redactPixelate)&&(h.activeObj.redactPixelate=20),h.notify("selection",{prop:"annotate",value:{shape:"redact"}}),this.refreshToolbar("redact"),this.redactSlider(h.activeObj.redactType);break;case"pixelate":h.currObjType.isRedact=m=!0,h.drawingShape="redact",h.notify("selection",{prop:"annotate",value:{shape:"redact"}}),"blur"===h.activeObj.redactType&&this.updateRedactType("pixelate"),h.notify("shape",{prop:"setRedactType",onPropertyChange:!1,value:{redactType:"pixelate"}}),"pixelate"===h.activeObj.redactType?(l=h.element.querySelector("#"+d+"_pixelate"),a=h.element.querySelector("#"+d+"_redactBlur"),l&&l.classList.add("e-selected-btn"),a&&a.classList.contains("e-selected-btn")&&a.classList.remove("e-selected-btn")):(a=h.element.querySelector("#"+d+"_redactBlur"))&&a.classList.add("e-selected-btn"),this.redactSlider(h.activeObj.redactType),0===h.activeObj.activePoint.width&&0===h.activeObj.activePoint.height||h.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:null,previousObjColl:null,previousPointColl:null,previousSelPointColl:null,previousCropObj:null,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}});break;case"redactblur":h.currObjType.isRedact=m=!0,h.drawingShape="redact",h.notify("selection",{prop:"annotate",value:{shape:"redact"}}),h.notify("shape",{prop:"setRedactType",onPropertyChange:!1,value:{redactType:"blur"}}),"pixelate"===h.activeObj.redactType&&this.updateRedactType("blur"),h.notify("shape",{prop:"setRedactType",onPropertyChange:!1,value:{redactType:"blur"}}),"blur"===h.activeObj.redactType?(a=h.element.querySelector("#"+d+"_redactBlur"),l=h.element.querySelector("#"+d+"_pixelate"),a&&a.classList.add("e-selected-btn"),l&&l.classList.contains("e-selected-btn")&&l.classList.remove("e-selected-btn")):(l=h.element.querySelector("#"+d+"_pixelate"))&&l.classList.add("e-selected-btn"),this.redactSlider(h.activeObj.redactType),0===h.activeObj.activePoint.width&&0===h.activeObj.activePoint.height||h.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:null,previousObjColl:null,previousPointColl:null,previousSelPointColl:null,previousCropObj:null,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}})}m&&(h.notify("draw",{prop:"updateTempObjColl"}),h.notify("draw",{prop:"updateTempPointColl"}))}},RUt.prototype.updateRedactType=function(e){var t=this.parent;t.activeObj.redactType=e,t.notify("shape",{prop:"setRedactType",value:{type:e}}),this.parent.objColl.push(t.activeObj),t.notify("selection",{prop:"redrawShape",value:{obj:t.objColl[t.objColl.length-1]}})},RUt.prototype.frameToolbarClick=function(){var e,t,i=this.parent,n=i.element.id,o=document.querySelector("#"+n+"_frame");i.notify("draw",{prop:"updateCropSelection",onPropertyChange:!1}),(i.currObjType.isFiltered||i.currObjType.isRedact)&&i.okBtn(),o&&!o.classList.contains("e-overlay")&&(o=i.transform.zoomFactor,i.frameDestPoints=Pe({},i.img,{},!0),je(i.cxtTbarHeight)&&(e=Pe({},i.frameObj,{},!0),t=Pe({},i.tempFrameObj,{},!0),this.callFrameToolbar(),i.frameObj.type="mat",this.callFrameToolbar(),i.cxtTbarHeight=i.element.querySelector("#"+n+"_customizeWrapper").scrollHeight,i.frameObj=e,i.tempFrameObj=t),this.zoomToFrameRange(),i.tempFrameZoomLevel=o,F.isDevice?i.img.destTop-=i.cxtTbarHeight/2:i.img.destTop+=i.cxtTbarHeight/2,this.callFrameToolbar(),i.notify("draw",{prop:"triggerFrameChange",value:{prevFrameSettings:i.frameObj,obj:{frameChangeEventArgs:null}}}))},RUt.prototype.zoomToFrameRange=function(){for(var e=this.parent,t=(this.isFrameToolbar=!1,e.notify("transform",{prop:"resetZoom",onPropertyChange:!1}),!0);t;){if(this.toolbarHeight+e.img.destTop>=this.toolbarHeight+e.cxtTbarHeight){t=!1;break}e.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:-.1,zoomPoint:null,isResize:!0}})}this.isFrameToolbar=!0},RUt.prototype.resizeClick=function(){var e=this.parent;e.notify("draw",{prop:"updateCropSelection",onPropertyChange:!1}),e.upperCanvas.style.cursor="default",e.notify("transform",{prop:"updateResize",value:{bool:!1}}),this.isAspectRatio?this.isAspectRatio=!1:this.isAspectRatio=!0,e.isResize=!0,this.refreshToolbar("resize")},RUt.prototype.callFrameToolbar=function(){var e=this.parent,t=(Pe(e.tempFrameObj,e.frameObj),{appliedUndoRedoColl:[]});e.notify("undo-redo",{prop:"getAppliedUndoRedoColl",value:{obj:t}}),0===t.appliedUndoRedoColl.length&&(e.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(t={currObj:{}}),value:{object:t}}),e.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"frame",previousObj:t.currObj,previousObjColl:t.currObj.objColl,previousPointColl:t.currObj.pointColl,previousSelPointColl:t.currObj.selPointColl,previousCropObj:Pe({},e.cropObj,{},!0),previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}})),this.refreshToolbar("frame")},RUt.prototype.contextualToolbarClicked=function(e){var t=this.parent,i=t.element.querySelector(".e-contextual-toolbar-wrapper .e-toolbar-item.e-selected"),i=(i&&i.classList.remove("e-selected"),e.item.id.replace(t.element.id,"").split("_")[1]),n={filter:t.toPascalCase(i),cancel:!1};t.trigger("imageFiltering",n),(t.editCompleteArgs=n).cancel||(document.getElementById(e.item.id+"Canvas").parentElement.parentElement.classList.add("e-selected"),t.currObjType.isFiltered=!0,t.notify("filter",{prop:"applyImageFilter",value:{option:i.toLowerCase()}}),t.notify("draw",{prop:"redrawDownScale"}),t.currentFilter=e.item.id,this.enableDisableTbrBtn(),t.isFilterCanvasClick=!0,t.curFilterObjEvent=n)},RUt.prototype.refreshShapeDrawing=function(){var e=this.parent,t={shape:""};e.notify("selection",{prop:"getCurrentDrawingShape",onPropertyChange:!1,value:{obj:t}}),""!==t.shape&&(e.notify("selection",{prop:"setCurrentDrawingShape",onPropertyChange:!1,value:{value:""}}),e.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),this.refreshToolbar("main",!1))},RUt.prototype.zoomInBtnClickHandler=function(e){if(e){var t=this.parent;if((t.zoomSettings.zoomTrigger&xUt.Toolbar)===xUt.Toolbar){t.noPushUndo=!1,t.currObjType.isFiltered&&t.okBtn();var i=t.drawingShape;if(t.drawingShape&&(n=t.activeObj.currIndex,t.noPushUndo=!0,t.okBtn(),t.noPushUndo=!1,t.drawingShape=null,n)&&t.selectShape(n),this.refreshShapeDrawing(),F.isDevice&&"touchstart"===e.type){if(!e.returnValue)return;e.preventDefault()}var n=document.querySelector("#"+t.element.id+"_zoomIn"),e=(E.trigger(n,"click"),{bool:!1}),e=(t.notify("selection",{prop:"getFreehandDrawEditing",onPropertyChange:!1,value:{obj:e}}),e.bool&&(t.notify("freehand-draw",{prop:"applyFhd",onPropertyChange:!1}),this.destroyQuickAccessToolbar()),t.isZoomBtnClick=!0,this.applyPreviewFilter(),t.currObjType.isFiltered=!1,t.currObjType.isRedact=!1,t.togglePen&&(t.currObjType.isZoomed=!0,t.freeHandDraw(!1),t.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}})),t.notify("draw",{prop:"resetCurrentSelectionPoint"}),t.drawingShape=i,t.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:.1,zoomPoint:null,isResize:null}}),t.notify("draw",{prop:"redrawDownScale"}),(t.isCropTab||t.activeObj.shape)&&(t.notify("draw",{prop:"setStraightenActObj",value:{activeObj:null}}),t.notify("freehand-draw",{prop:"resetStraightenPoint"})),t.isStraightening&&(t.notify("draw",{prop:"resetStraightenDestPoints"}),t.notify("draw",{prop:"setDestForStraighten"})),{action:"zoom-in",actionEventArgs:t.editCompleteArgs});t.triggerEditCompleteEvent(e),F.isDevice&&n.focus()}}},RUt.prototype.zoomOutBtnClickHandler=function(e){if(e){var t=this.parent;if((t.zoomSettings.zoomTrigger&xUt.Toolbar)===xUt.Toolbar){t.noPushUndo=!1,t.currObjType.isFiltered&&t.okBtn();var i=t.drawingShape;if(t.drawingShape&&(n=t.activeObj.currIndex,t.noPushUndo=!0,t.okBtn(),t.noPushUndo=!1,t.drawingShape=null,n)&&t.selectShape(n),this.refreshShapeDrawing(),F.isDevice&&"touchstart"===e.type){if(!e.returnValue)return;e.preventDefault()}var n=document.querySelector("#"+t.element.id+"_zoomOut"),e=(E.trigger(n,"click"),{bool:!1}),e=(t.notify("selection",{prop:"getFreehandDrawEditing",onPropertyChange:!1,value:{obj:e}}),e.bool&&(t.notify("freehand-draw",{prop:"applyFhd",onPropertyChange:!1}),this.destroyQuickAccessToolbar()),t.isZoomBtnClick=!0,this.applyPreviewFilter(),t.currObjType.isFiltered=!1,t.currObjType.isRedact=!1,t.togglePen&&(t.currObjType.isZoomed=!0,t.freeHandDraw(!1),t.notify("undo-redo",{prop:"updateCurrUrc",value:{type:"ok"}})),t.notify("draw",{prop:"resetCurrentSelectionPoint"}),t.drawingShape=i,t.notify("transform",{prop:"zoomAction",onPropertyChange:!1,value:{zoomFactor:-.1,zoomPoint:null,isResize:null}}),t.notify("draw",{prop:"redrawDownScale"}),(t.isCropTab||t.activeObj.shape)&&(t.notify("draw",{prop:"setStraightenActObj",value:{activeObj:null}}),t.notify("freehand-draw",{prop:"resetStraightenPoint"})),t.isStraightening&&(t.notify("draw",{prop:"resetStraightenDestPoints"}),t.notify("draw",{prop:"setDestForStraighten"})),{action:"zoom-out",actionEventArgs:t.editCompleteArgs});t.triggerEditCompleteEvent(e),F.isDevice&&n.focus()}}},RUt.prototype.zoomInBtnMouseDownHandler=function(e){e.preventDefault(),this.zoomBtnHold=setInterval(this.zoomInBtnClickHandler.bind(this),250)},RUt.prototype.zoomOutBtnMouseDownHandler=function(e){e.preventDefault(),this.zoomBtnHold=setInterval(this.zoomOutBtnClickHandler.bind(this),250)},RUt.prototype.zoomBtnMouseUpHandler=function(){clearInterval(this.zoomBtnHold),this.zoomBtnHold=0},RUt.prototype.closeContextualToolbar=function(){var e=this.parent,t=e.element.id,i=!1,n=e.isStraightening;return(!F.isDevice||F.isDevice&&!n)&&(e.element.querySelector("#"+t+"_contextualToolbar")&&!e.element.querySelector("#"+t+"_contextualToolbar").parentElement.classList.contains("e-hide")||e.element.querySelector("#"+t+"_headWrapper")&&!e.element.querySelector("#"+t+"_headWrapper").parentElement.classList.contains("e-hide"))&&(e.element.querySelector(".e-contextual-toolbar-wrapper").classList.add("e-hide"),e.okBtn(),this.refreshMainToolbar(),i=!0),i},RUt.prototype.destroyQuickAccessToolbar=function(){var e=this.parent.element.id,t=document.getElementById(e+"_quickAccessToolbar"),t=(t&&t.classList.contains("e-control")&&At(t,"toolbar").destroy(),document.getElementById(e+"_quickAccessToolbarArea"));t&&(t.style.display="none")},RUt.prototype.renderSlider=function(e,t){var i,n,o,r=this.parent,s=r.element.id,a=document.querySelector("#"+s+"_contextualToolbarArea"),l=document.querySelector("#"+s+"_headWrapper"),h=document.querySelector("#"+s+"_labelWrapper"),h=(l&&(l.remove(),h.remove()),l=a.appendChild(r.createElement("div",{id:s+"_headWrapper",styles:"position: relative"})),(h="transparency"===e?l.appendChild(r.createElement("label",{id:s+"_labelWrapper",className:"e-ie-finetune-slider-label",styles:F.isDevice?"position: absolute; top: 31%; left: calc(50% - 150px); font-size: 15px; text-transform: capitalize; font-weight: 400;":"position: absolute; top: 31%; left: calc(50% - 220px); font-size: 15px; text-transform: capitalize; font-weight: 400;"})):l.appendChild(r.createElement("label",{id:s+"_labelWrapper",className:"e-ie-finetune-slider-label",styles:F.isDevice?"position: absolute; top: 31%; left: calc(50% - 160px); font-size: 15px; text-transform: capitalize; font-weight: 400;":"position: absolute; top: 25%; left: calc(50% - 226px); font-size: 15px; text-transform: capitalize; font-weight: 400;"}))).textContent=this.l10n.getConstant(r.toPascalCase("transparency"===e?"opacity":e)),l.appendChild(r.createElement("div",{id:s+"_sliderWrapper",className:"e-ie-finetune-slider-wrap",styles:"position: absolute"}))),d=r.getCurrAdjustmentValue(e);t&&"straighten"===e&&F.isDevice&&(d=r.cropObj.straighten),"brightness"===e||"contrast"===e||"saturation"===e||"exposure"===e?(n=r.finetuneSettings?"brightness"===e&&r.finetuneSettings.brightness?(i=r.finetuneSettings.brightness.min,r.finetuneSettings.brightness.max):"contrast"===e&&r.finetuneSettings.contrast?(i=r.finetuneSettings.contrast.min,r.finetuneSettings.contrast.max):"saturation"===e&&r.finetuneSettings.saturation?(i=r.finetuneSettings.saturation.min,r.finetuneSettings.saturation.max):"exposure"===e&&r.finetuneSettings.exposure?(i=r.finetuneSettings.exposure.min,r.finetuneSettings.exposure.max):(i=-100,100):(i=-100,100),o=this.createSlider(i,n,d,e)):"hue"===e||"blur"===e||"opacity"===e?(n=r.finetuneSettings?"hue"===e&&r.finetuneSettings.hue?(i=r.finetuneSettings.hue.min,r.finetuneSettings.hue.max):"blur"===e&&r.finetuneSettings.blur?(i=r.finetuneSettings.blur.min,r.finetuneSettings.blur.max):"opacity"===e&&r.finetuneSettings.opacity?(i=r.finetuneSettings.opacity.min,r.finetuneSettings.opacity.max):(i=0,100):(i=0,100),o=this.createSlider(i,n,d,e)):"transparency"===e?o=this.createSlider(i=0,n=100,d,e):"straighten"===e&&(o=this.createSlider(i=-45,n=45,d,e)),o.appendTo("#"+s+"_sliderWrapper"),h.style.left=(parseFloat(a.style.width)-parseFloat(o.width))/2+"px","straighten"===e&&F.isDevice&&(l.appendChild(r.createElement("label",{id:s+"_sLabelWrapper",className:"e-ie-straighten-value-span e-ie-finetune-value-span",styles:"position: absolute; top: 31%; margin-left: 20px; font-size: 15px; text-transform: capitalize; font-weight: 400;"})).innerHTML=r.transform.straighten.toString()+"&#176",h.parentElement.classList.add("e-straighten-slider")),"straighten"!==e&&(l.appendChild(r.createElement("label",{id:s+"_finetuneSpan",className:"e-ie-finetune-value-span",styles:F.isDevice?"position: absolute; top: 25%; margin-left: 20px; font-size: 15px; text-transform: capitalize; font-weight: 400;":"position: absolute; top: 25%; left: calc(50% + 190px); font-size: 15px; text-transform: capitalize; font-weight: 400;"})),h.parentElement.classList.add("e-finetune-slider"),"transparency"===e&&F.isDevice&&h.parentElement.classList.add("e-ie-device-transparency-slider"),this.updateFinetuneSpan(e))},RUt.prototype.createSlider=function(e,t,i,o){var r=this,s=this.parent;return new KO({value:i,type:"MinRange",min:e,max:t,step:"straighten"===o?3:1,width:F.isDevice?"180px":"straighten"===o?"200px":"300px",cssClass:"e-slider",change:function(e){var t,i,n;s.notify("selection",{prop:"setSliderActive",onPropertyChange:!1,value:{bool:!0}}),"transparency"===o?s.activeObj.shape&&(je(s.activeObj.imageRatio)&&s.notify("shape",{prop:"updImgRatioForActObj",onPropertyChange:!1}),s.notify("shape",{prop:"pushActItemIntoObj"}),t=Pe({},s.cropObj,{},!0),s.notify("filter",{prop:"getCurrentObj",onPropertyChange:!(i={currObj:{}}),value:{object:i}}),(i=i.currObj).objColl=Pe([],s.objColl,[],!0),i.pointColl=Pe([],s.pointColl,[],!0),i.afterCropActions=Pe([],s.afterCropActions,[],!0),s.notify("freehand-draw",{prop:"getSelPointColl",onPropertyChange:!(n={selPointColl:null}),value:{obj:n}}),i.selPointColl=Pe([],n.selPointColl,[],!0),s.objColl.pop(),s.activeObj.opacity=e.value/100,r.upperContext.clearRect(0,0,s.upperCanvas.width,s.upperCanvas.height),s.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate"}}),s.objColl.push(s.activeObj),s.notify("undo-redo",{prop:"updateUndoRedoColl",onPropertyChange:!1,value:{operation:"shapeTransform",previousObj:i,previousObjColl:i.objColl,previousPointColl:i.pointColl,previousSelPointColl:i.selPointColl,previousCropObj:t,previousText:null,currentText:null,previousFilter:null,isCircleCrop:null}}),s.notify("selection",{prop:"redrawShape",value:{obj:s.objColl[s.objColl.length-1]}}),r.updateFinetuneSpan(o)):"straighten"===o?s.setStraighten(e.value):(s.transform.zoomFactor&&s.transform.zoomFactor<0&&(s.isFinetuning=!0),s.notify("selection",{prop:"setSliding",value:{bool:!0}}),s.setCurrAdjustmentValue(o,e.value),r.updateFinetuneSpan(o),r.enableDisableTbrBtn(),s.isFinetuning=!1)},changed:function(){"transparency"!==o&&"straighten"!==o&&(s.notify("selection",{prop:"setSliding",value:{bool:!1}}),s.notify("draw",{prop:"redrawDownScale"})),s.notify("selection",{prop:"setSliderActive",onPropertyChange:!1,value:{bool:!1}}),"transparency"===o&&setTimeout(function(){s.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1}),s.element.querySelector("#"+s.element.id+"_transparency").click()},50)}})},RUt.prototype.updateFinetuneSpan=function(e){var t=this.parent,i=t.element.querySelector(".e-ie-finetune-value-span");i&&(t.notify("filter",{prop:"getAdjustmentLevel",onPropertyChange:!(t={adjustmentLevel:null}),value:{obj:t}}),i.innerHTML=Math.round(t.adjustmentLevel[e]).toString())},RUt.prototype.applyPreviewFilter=function(){var e=this.parent;(document.querySelector("#"+e.element.id+"_sliderWrapper")||e.currObjType.isFiltered)&&(e.initialAdjustmentValue=this.lowerContext.filter,e.canvasFilter=this.lowerContext.filter,e.currObjType.isFiltered=!1)},RUt.prototype.unselectBtn=function(){for(var e=this.parent.element.id,t=0,i=["#"+e+"_brightness","#"+e+"_contrast","#"+e+"_hue","#"+e+"_saturation","#"+e+"_opacity","#"+e+"_blur","#"+e+"_exposure"];t<i.length;t++){var n=document.querySelector(i[t]);if(n&&n.classList.contains("e-selected-btn")){n.classList.remove("e-selected-btn");break}}},RUt.prototype.openSlider=function(e){this.unselectBtn(),this.parent.currObjType.isFiltered=!0,this.refreshToolbar("color",null,null,null,e),document.getElementById(this.parent.element.id+"_"+e).classList.add("e-selected-btn")},RUt.prototype.refreshSlider=function(){var e=this.parent.element.id,t=document.querySelector("#"+e+"_sliderWrapper"),i=document.querySelector(".e-slider"),e=document.querySelector("#"+e+"_headWrapper");e&&(e.style.display="none"),t&&i&&(i.ej2_instances[0].destroy(),t.remove())},RUt.prototype.unselectFrameBtn=function(){for(var e=this.parent.element.id,t=0,i=["#"+e+"_none","#"+e+"_mat","#"+e+"_line","#"+e+"_inset","#"+e+"_bevel","#"+e+"_hook"];t<i.length;t++){var n=document.querySelector(i[t]);if(n.classList.contains("e-selected-btn")){n.classList.remove("e-selected-btn");break}}},RUt.prototype.updateToolbarItems=function(){var e=this.parent,t=e.element.id;if(e.isImageLoaded&&this.isToolbar()){var i,n=e.element.querySelector(".e-fill.e-template .e-dropdownbtn-preview"),o=e.element.querySelector(".e-stroke.e-template .e-dropdownbtn-preview"),r=e.element.querySelector(".e-text-font-color.e-template .e-dropdownbtn-preview"),s=e.element.querySelector(".e-stroke-text-font-color.e-template .e-dropdownbtn-preview"),a=e.element.querySelector(".e-text-background-color.e-template .e-dropdownbtn-preview"),l=e.element.querySelector(".e-pen-stroke-color.e-template .e-dropdownbtn-preview"),h=e.element.querySelector(".e-shape-stroke-width"),d=e.element.querySelector(".e-shape-rectangle-radius"),p=e.element.querySelector(".e-text-font-family"),c=e.element.querySelector(".e-text-font-size"),u=e.element.querySelector("#"+t+"_bold"),g=e.element.querySelector("#"+t+"_italic");if(e.activeObj.strokeSettings&&e.activeObj.textSettings){if(je(e.activeObj.strokeSettings.strokeWidth)&&(e.activeObj.strokeSettings.strokeWidth=2),je(e.activeObj.strokeSettings.outlineWidth)&&(e.activeObj.strokeSettings.outlineWidth=2),n&&(i=e.activeObj.strokeSettings.fillColor,""===e.activeObj.strokeSettings.fillColor?n.classList.add("e-nocolor-item"):(n.classList.remove("e-nocolor-item"),n.style.background=i),document.querySelector("#"+t+"_shape_fill"))&&(At(t+"_shape_fill","colorpicker").value=i),o&&(i=e.activeObj.strokeSettings.strokeColor,o.style.background=i,document.querySelector("#"+t+"_shape_stroke"))&&(At(t+"_shape_stroke","colorpicker").value=i),r&&(i=e.activeObj.strokeSettings.strokeColor,r.style.background=i,document.querySelector("#"+t+"_text_font"))&&(At(t+"_text_font","colorpicker").value=i),s&&(i=e.activeObj.strokeSettings.outlineColor,/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$|^[a-zA-Z]+$/.test(e.activeObj.strokeSettings.outlineColor)?(s.classList.remove("e-nocolor-item"),s.style.background=i):s.classList.add("e-nocolor-item"),document.querySelector("#"+t+"_stroke_text"))&&(At(t+"_stroke_text","colorpicker").value=i),a&&(i=e.activeObj.strokeSettings.fillColor,""===e.activeObj.strokeSettings.fillColor||"transparent"===e.activeObj.strokeSettings.fillColor?a.classList.add("e-nocolor-item"):(a.classList.remove("e-nocolor-item"),a.style.background=i),document.querySelector("#"+t+"_text_bgColor"))&&(At(t+"_text_bgColor","colorpicker").value=i),l&&(i=e.activeObj.strokeSettings.strokeColor,l.style.background=i,document.querySelector("#"+t+"_pen_stroke")&&(At(t+"_pen_stroke","colorpicker").value=i),e.notify("freehand-draw",{prop:"getPenOpacity",onPropertyChange:!1,value:{obj:{penOpacity:1}}})),p&&(F.isDevice?p.setAttribute("style","font-family:"+e.activeObj.textSettings.fontFamily.toLowerCase()):p.textContent=e.activeObj.textSettings.fontFamily),c)for(var m=0;m<e.fontSizeColl.length;m++){if(parseInt(e.fontSizeColl[m].text,10)>=Math.round(e.activeObj.textSettings.fontSize)){c.textContent=(m+1).toString();break}if(Math.round(e.activeObj.textSettings.fontSize)<parseInt(e.fontSizeColl[0].text,10)){c.textContent="1";break}if(Math.round(e.activeObj.textSettings.fontSize)>parseInt(e.fontSizeColl[e.fontSizeColl.length-1].text,10)){c.textContent=(e.fontSizeColl.length-1+1).toString();break}}u&&(e.activeObj.textSettings.bold?u.classList.add("e-selected-btn"):u.classList.remove("e-selected-btn")),g&&(e.activeObj.textSettings.italic?g.classList.add("e-selected-btn"):g.classList.remove("e-selected-btn")),h&&(n="text"===e.activeObj.shape?e.activeObj.strokeSettings.outlineWidth:e.activeObj.strokeSettings.strokeWidth,o=Math.round(n).toString(),h.textContent=this.getStrokeWidth(o)),d&&(r=Math.round(e.activeObj.strokeSettings.radius).toString(),d.textContent=this.getRectRadius(r))}}},RUt.prototype.getStrokeWidth=function(e){var t;switch(parseInt(e,10)/2){case 0:t=this.l10n.getConstant("NoOutline");break;case 1:t=this.l10n.getConstant("XSmall");break;case 2:t=this.l10n.getConstant("Small");break;case 3:t=this.l10n.getConstant("Medium");break;case 4:t=this.l10n.getConstant("Large");break;case 5:t=this.l10n.getConstant("XLarge")}return t},RUt.prototype.getRectRadius=function(e){var t;switch(parseInt(e,10)/2){case 0:t=this.l10n.getConstant("0");break;case 1:t=this.l10n.getConstant("20");break;case 2:t=this.l10n.getConstant("40");break;case 3:t=this.l10n.getConstant("60");break;case 4:t=this.l10n.getConstant("80");break;case 5:t=this.l10n.getConstant("100")}return t},RUt.prototype.cancelPan=function(){var e=this.parent,t=(e.notify("shape",{prop:"applyActObj",onPropertyChange:!1,value:{isMouseDown:!0}}),e.element.querySelector(".e-img-pan .e-btn"));t&&t.classList.remove("e-selected-btn"),e.pan(!1)},RUt.prototype.refreshMainToolbar=function(){"main"!==this.currToolbar&&this.refreshToolbar("main")},RUt.prototype.destroySubComponents=function(){for(var e=this.parent,t=e.element.querySelectorAll("input.e-control"),i=e.element.querySelectorAll("button.e-control"),n=0,o=t.length;n<o;n++)t[n].classList.contains("e-color-picker")&&(At(t[n],"color-picker").destroy(),G(ge("input#"+t[n].id,e.element)));for(n=0,o=i.length;n<o;n++)i[n].classList.contains("e-dropdown-btn")?(At(i[n],"dropdown-btn").destroy(),G(ge("button#"+i[n].id,e.element))):i[n].classList.contains("e-btn")&&(At(i[n],"btn").destroy(),G(ge("button#"+i[n].id,e.element)))},RUt.prototype.setInitialShapeSettings=function(e){var t=this.parent,e=(t.notify("shape",{prop:"refreshActiveObj",onPropertyChange:!1}),t.currObjType.shape=e.item.id,t.activeObj.shape=t.currObjType.shape.toLowerCase(),t.currObjType.isDragging=t.currObjType.isCustomCrop=!1,t.activeObj.shapeDegree=t.transform.degree,t.activeObj.shapeFlip=t.transform.currFlipState,t.activeObj.textFlip=t.transform.currFlipState,t.activeObj.flipObjColl=[],{order:null});t.notify("shape",{prop:"getNewOrder",onPropertyChange:!1,value:{obj:e}}),t.activeObj.order=e.order},RUt.prototype.isToolbarString=function(e){for(var t=!1,i=0;i<e.length;i++)if("string"==typeof e[i]){t=!0;break}return t},RUt.prototype.excludeItems=function(e){for(var t=[],i=0;i<e.length;i++){var n=this.getIndex(e[i]);-1!==n&&t.push(n)}for(var o=[],i=0;i<this.defToolbarItems.length;i++)"Center"!==this.defToolbarItems[i].align||this.isSameIndex(t,i)||this.defToolbarItems[i].id===this.parent.element.id+"_annotation"||o.push(i);for(i=o.length-1;0<=i;i--)this.defToolbarItems.splice(o[i],1)},RUt.prototype.isSameIndex=function(e,t){for(var i=0;i<e.length;i++)if(e[i]===t)return!0;return!1},RUt.prototype.getIndex=function(e){var t=-1,i=!1;"fontColor"===(e="arrowEnd"===(e="arrowStart"===(e="verticalFlip"===(e="horizontalFlip"===(e="rotateRight"===(e="rotateLeft"===e?"rotLeft":e)?"rotRight":e)?"hflip":e)?"vflip":e)?"start":e)?"end":e)&&(e="strokeColor",i=!0);for(var n=0;n<this.defToolbarItems.length;n++){var o=this.defToolbarItems[n].id;if(o&&-1!==o.toLowerCase().indexOf(e.toLowerCase())){t=n;break}}return i&&(e="fontColor"),t},RUt.prototype.getModuleName=function(){return"toolbar-module"},RUt.prototype.redactSlider=function(e){var t,i,n,o,r=this.parent,s=r.element.id,a=r.element.querySelector("#"+s+"_toolbarArea"),l=r.element.querySelector("#"+s+"_contextualToolbarArea");l&&(l.classList.remove("e-hide"),l.style.left=a.offsetLeft+"px",a=document.querySelector("#"+s+"_contextualToolbarArea"),t=document.querySelector("#"+s+"_headWrapper"),n=document.querySelector("#"+s+"_labelWrapper"),o=document.querySelector("#"+s+"_contextualToolbar"),t&&(t.remove(),n.remove()),o&&(o.remove(),this.createContextualToolbar()),n=(t=a.appendChild(r.createElement("div",{id:s+"_headWrapper",styles:"position: relative"}))).appendChild(r.createElement("label",{id:s+"_labelWrapper",className:"e-ie-finetune-slider-label",styles:F.isDevice?"position: absolute; top: 31%; left: calc(50% - 160px); font-size: 15px; text-transform: capitalize; font-weight: 400;":"position: absolute; top: 25%; left: calc(50% - 226px); font-size: 15px; text-transform: capitalize; font-weight: 400;"})),o="blur"===e?this.l10n.getConstant("Blur"):this.l10n.getConstant("PixelSize"),n.textContent=o,a=t.appendChild(r.createElement("div",{id:s+"_sliderWrapper",className:"e-ie-finetune-slider-wrap",styles:"position: absolute"})),t.appendChild(r.createElement("label",{id:s+"_redactSpan",className:"e-ie-redact-value-span",styles:F.isDevice?"position: absolute; top: 30%; margin-left: 20px; font-size: 15px; text-transform: capitalize; font-weight: 400;":"position: absolute; top: 30%; left: calc(50% + 190px); font-size: 15px; text-transform: capitalize; font-weight: 400;"})),a.parentElement.classList.add("e-finetune-slider"),i="blur"===r.activeObj.redactType?r.activeObj.redactBlur:r.activeObj.redactPixelate,new KO({tooltip:{placement:"Before",isVisible:!0,showOn:"Focus"},min:10,max:100,step:1,value:i,type:"MinRange",width:F.isDevice?"130px":"300px",created:function(){r.element.querySelector(".e-ie-redact-value-span").innerText=i.toString()},change:function(e){r.element.querySelector(".e-ie-redact-value-span").innerText=e.value.toString(),"blur"===r.activeObj.redactType?r.activeObj.redactBlur=r.tempRedactBlur=e.value:"pixelate"===r.activeObj.redactType&&(r.activeObj.redactPixelate=r.tempRedactPixel=e.value),r.notify("draw",{prop:"drawObject",onPropertyChange:!1,value:{canvas:"duplicate",obj:r.activeObj,isCropRatio:null,points:null,isPreventDrag:!0,saveContext:null,isPreventSelection:!0}})},changed:function(){setTimeout(function(){r.notify("undo-redo",{prop:"updateUndoRedoStack",onPropertyChange:!1})},50)}}).appendTo("#"+s+"_sliderWrapper"),F.isDevice)&&(e=l.offsetHeight+1,n=r.element.querySelector("#"+s+"_customizeWrapper"),this.isFrameToolbar&&n&&(e=n.offsetHeight+2),o=r.element.querySelector("#"+s+"_canvasWrapper").offsetHeight,l.style.top=this.toolbarHeight+1+o-e+"px")};var LUt=RUt;function RUt(e){this.defToolbarItems=[],this.toolbarHeight=46,this.currToolbar="",this.preventZoomBtn=!1,this.currentToolbar="main",this.selFhdColor="#42a5f5",this.preventEnableDisableUr=!1,this.isAspectRatio=!0,this.isFrameToolbar=!1,this.presetColors={custom:["#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"]},this.isSlider=!1,this.currentQuality=1,this.imageQuality="highest",this.parent=e,this.addEventListener(),this.initLocale()}qNt=Object.freeze({__proto__:null,Crop:j6t,Draw:q6t,Export:Y6t,Filter:K6t,FreehandDrawing:Z6t,Selection:eUt,Shape:iUt,Transform:oUt,UndoRedo:sUt,UploadSettings:qOt,FinetuneSettings:XOt,ZoomSettings:ZOt,SelectionSettings:tNt,FontFamily:oNt,ImageEditor:aNt,get FileType(){return CUt},get Direction(){return SUt},get ShapeType(){return AUt},get ZoomTrigger(){return xUt},get Theme(){return IUt},get ImageEditorCommand(){return TUt},get ImageFilterOption(){return EUt},get ImageFinetuneOption(){return DUt},get ArrowheadType(){return MUt},get FrameType(){return kUt},get FrameLineStyle(){return PUt},get RedactType(){return BUt},ToolbarModule:LUt});(XNt=dLi=dLi||{}).heatMapTitleFont={size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},XNt.titleFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},XNt.axisTitleFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},XNt.axisLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},XNt.legendLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},XNt.rectLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},XNt.tooltipFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"};OUt=function(e,t){return(OUt=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])}))(e,t)};var OUt,NUt,ZNt=function(e,t){function i(){this.constructor=e}OUt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},t2t=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},o2t=(ZNt(VUt,NUt=n),t2t([e("16px")],VUt.prototype,"size",void 0),t2t([e("")],VUt.prototype,"color",void 0),t2t([e("Segoe UI")],VUt.prototype,"fontFamily",void 0),t2t([e("Normal")],VUt.prototype,"fontWeight",void 0),t2t([e("Normal")],VUt.prototype,"fontStyle",void 0),t2t([e("Center")],VUt.prototype,"textAlignment",void 0),t2t([e("Trim")],VUt.prototype,"textOverflow",void 0),VUt);function VUt(){return null!==NUt&&NUt.apply(this,arguments)||this}ZNt(HUt,_Ut=n),t2t([e(10)],HUt.prototype,"left",void 0),t2t([e(10)],HUt.prototype,"right",void 0),t2t([e(10)],HUt.prototype,"top",void 0),t2t([e(10)],HUt.prototype,"bottom",void 0);var _Ut,a2t=HUt;function HUt(){return null!==_Ut&&_Ut.apply(this,arguments)||this}ZNt(jUt,zUt=n),t2t([e("")],jUt.prototype,"color",void 0),t2t([e(1)],jUt.prototype,"width",void 0),t2t([e("")],jUt.prototype,"radius",void 0);var zUt,Qmt=jUt;function jUt(){return null!==zUt&&zUt.apply(this,arguments)||this}ZNt(QUt,WUt=n),t2t([e("")],QUt.prototype,"color",void 0),t2t([e(0)],QUt.prototype,"width",void 0);var WUt,ost=QUt;function QUt(){return null!==WUt&&WUt.apply(this,arguments)||this}ZNt(qUt,UUt=n),t2t([e(null)],qUt.prototype,"size",void 0),t2t([e(null)],qUt.prototype,"color",void 0);var UUt,jee=qUt;function qUt(){return null!==UUt&&UUt.apply(this,arguments)||this}ZNt(YUt,GUt=n),t2t([e("")],YUt.prototype,"text",void 0),t2t([t({},o2t)],YUt.prototype,"textStyle",void 0);var GUt,f2t=YUt;function YUt(){return null!==GUt&&GUt.apply(this,arguments)||this}ZNt(KUt,XUt=n),t2t([e("#eeeeee")],KUt.prototype,"minColor",void 0),t2t([e("#eeeeee")],KUt.prototype,"maxColor",void 0);var XUt,b2t=KUt;function KUt(){return null!==XUt&&XUt.apply(this,arguments)||this}ZNt(ZUt,JUt=n),t2t([e(null)],ZUt.prototype,"value",void 0),t2t([e(null)],ZUt.prototype,"color",void 0),t2t([e(null)],ZUt.prototype,"label",void 0),t2t([e(null)],ZUt.prototype,"startValue",void 0),t2t([e(null)],ZUt.prototype,"endValue",void 0),t2t([e(null)],ZUt.prototype,"minColor",void 0),t2t([e(null)],ZUt.prototype,"maxColor",void 0);var JUt,S2t=ZUt;function ZUt(){return null!==JUt&&JUt.apply(this,arguments)||this}ZNt(e7t,$Ut=n),t2t([e("#b5b5b5")],e7t.prototype,"color",void 0),t2t([e(1)],e7t.prototype,"width",void 0),t2t([e("Rectangle")],e7t.prototype,"type",void 0);var $Ut,I2t=e7t;function e7t(){return null!==$Ut&&$Ut.apply(this,arguments)||this}ZNt(i7t,t7t=n),t2t([e("0%")],i7t.prototype,"minimum",void 0),t2t([e("100%")],i7t.prototype,"maximum",void 0);var t7t,D2t=i7t;function i7t(){return null!==t7t&&t7t.apply(this,arguments)||this}ZNt(o7t,n7t=n),t2t([e(null)],o7t.prototype,"start",void 0),t2t([e(null)],o7t.prototype,"end",void 0),t2t([e("")],o7t.prototype,"text",void 0),t2t([e(null)],o7t.prototype,"maximumTextWidth",void 0);var n7t,Bft=o7t;function o7t(){return null!==n7t&&n7t.apply(this,arguments)||this}ZNt(s7t,r7t=n),t2t([e("Center")],s7t.prototype,"alignment",void 0),t2t([e("Wrap")],s7t.prototype,"overflow",void 0),t2t([t(dLi.axisLabelFont,o2t)],s7t.prototype,"textStyle",void 0),t2t([t({color:"#b5b5b5",width:1,type:"Rectangle"},I2t)],s7t.prototype,"border",void 0),t2t([kt([],Bft)],s7t.prototype,"categories",void 0);var r7t,d=s7t;function s7t(){return null!==r7t&&r7t.apply(this,arguments)||this}var a7t=function(e,t,i,n,o,r,s){this.value=e,this.color=t,this.label=i,this.startValue=n,this.endValue=o,this.minColor=r,this.maxColor=s},l7t=function(e,t,i){this.mappingName=e,this.bubbleData=t,this.valueType=i},h7t=function(e,t,i,n,o,r,s,a){this.value=e,this.color=t,this.label=i,this.startValue=n,this.endValue=o,this.minColor=r,this.maxColor=s,this.isHidden=a},d7t=function(e,t,i,n,o){this.index=1,this.row=1,this.start=e,this.end=t,this.index=i,this.label=n,this.row=o};p7t=function(e,t){return(p7t=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])}))(e,t)};var p7t,c7t,B2t=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},O2t=(function(e,t){function i(){this.constructor=e}p7t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(u7t,c7t=n),B2t([kt([{}],S2t)],u7t.prototype,"palette",void 0),B2t([e("Gradient")],u7t.prototype,"type",void 0),B2t([e("")],u7t.prototype,"emptyPointColor",void 0),B2t([e("Table")],u7t.prototype,"colorGradientMode",void 0),B2t([t({},b2t)],u7t.prototype,"fillColor",void 0),u7t);function u7t(){return null!==c7t&&c7t.apply(this,arguments)||this}var g7t=function(e,t,i){this.R=e,this.G=t,this.B=i},m7t=(f7t.prototype.convertToRGB=function(e,t){var i,n,o,r=this.heatMap.isColorRange?t[0].startValue:t[0].value,s=0,a=0;if(this.heatMap.isColorRange&&"Gradient"===this.heatMap.paletteSettings.type)for(a=0;a<t.length;a++)if(e<=(o=Number(t[a].endValue))&&e>=Number(t[a].startValue))s=o,i=this.heatMap.colorCollection[a].minColor,n=this.heatMap.colorCollection[a].maxColor;else{if(t[0].startValue!==this.heatMap.dataSourceMinValue&&e<t[0].startValue){s=t[0].startValue,r=this.heatMap.dataSourceMinValue,i=this.heatMap.paletteSettings.fillColor.minColor,n=this.heatMap.paletteSettings.fillColor.maxColor;break}if(o<e&&e<=(a===t.length-1?this.heatMap.dataSourceMaxValue:t[a+1].startValue)){s=a===t.length-1?this.heatMap.dataSourceMaxValue:t[a+1].startValue,r=o,i=this.heatMap.paletteSettings.fillColor.minColor,n=this.heatMap.paletteSettings.fillColor.maxColor;break}r=s=o}else for(a=1;a<t.length;a++){if(e<=(o=Number(t[a].value))){s=o,i=this.getEqualColor(t,r),n=this.getEqualColor(t,s);break}r=s=o}var l=(e-r)/(s-r);return l=isNaN(l)||!isFinite(l)?0:l,this.getPercentageColor(l,i,n)},f7t.prototype.rgbToHex=function(e,t,i){return"#"+this.componentToHex(e)+this.componentToHex(t)+this.componentToHex(i)},f7t.prototype.componentToHex=function(e){e=e.toString(16);return 1===e.length?"0"+e:e},f7t.prototype.getEqualColor=function(e,t){for(var i,n=0;n<e.length;n++)if(Number(e[n].value)===t)return je(i=e[n].color)?i="#FFFFFF":-1!==i.indexOf("rgb")?i=this.convertToHex(i):-1===i.indexOf("#")&&(i="#FFFFFF"),i;return"#00000"},f7t.prototype.convertToHex=function(e){var e=e.substr(3),t=(e=e.split("(")[1].split(")")[0]).split(",");return e=this.rgbToHex(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))},f7t.prototype.getPercentageColor=function(e,t,i){var i=i.split("#")[1],t=t.split("#")[1],n=this.getPercentage(e,parseInt(t.substr(0,2),16),parseInt(i.substr(0,2),16)),o=this.getPercentage(e,parseInt(t.substr(2,2),16),parseInt(i.substr(2,2),16)),e=this.getPercentage(e,parseInt(t.substr(4,2),16),parseInt(i.substr(4,2),16));return new g7t(n,o,e)},f7t.prototype.getPercentage=function(e,t,i){return Math.round(t+(i-t)*e)},f7t.prototype.getColorCollection=function(){var e,t=this.heatMap;t.colorCollection=[],t.legendColorCollection=[];for(var i=0;i<this.heatMap.paletteSettings.palette.length;i++){if(null===this.heatMap.paletteSettings.palette[i].startValue||null===this.heatMap.paletteSettings.palette[i].endValue){this.heatMap.isColorRange=!1;break}this.heatMap.isColorRange=!0}var n=t.bubbleSizeWithColor?t.minColorValue:t.dataSourceMinValue,o=t.bubbleSizeWithColor?t.maxColorValue:t.dataSourceMaxValue,r=(t.emptyPointColor=t.paletteSettings.emptyPointColor||t.themeStyle.emptyCellColor,this.orderbyOffset((this.heatMap.isColorRange||t.paletteSettings.palette&&1<t.paletteSettings.palette.length?t.paletteSettings:t.themeStyle).palette));if(r.isCompact)t.colorCollection=r.offsets,t.legendColorCollection=Pe([],r.offsets,null,!0);else if(e="Gradient"===t.paletteSettings.type?(o-n)/(r.offsets.length-1):(o-n)/r.offsets.length,2<=r.offsets.length)for(var s=0;s<r.offsets.length;s++)t.colorCollection.push(new a7t(Math.round(100*(n+s*e))/100,r.offsets[s].color,r.offsets[s].label,r.offsets[s].startValue,r.offsets[s].endValue,r.offsets[s].minColor,r.offsets[s].maxColor)),t.legendColorCollection.push(new h7t(Math.round(100*(n+s*e))/100,r.offsets[s].color,r.offsets[s].label,r.offsets[s].startValue,r.offsets[s].endValue,r.offsets[s].minColor,r.offsets[s].maxColor,!1));this.heatMap.isColorRange||this.updateLegendColorCollection(n,o,r)},f7t.prototype.updateLegendColorCollection=function(e,t,i){"Fixed"===this.heatMap.paletteSettings.type&&(i.isCompact||i.isLabel)||(Math.round(100*e)/100<this.heatMap.legendColorCollection[0].value&&this.heatMap.legendColorCollection.unshift(new h7t(Math.round(100*e)/100,this.heatMap.legendColorCollection[0].color,this.heatMap.legendColorCollection[0].label,this.heatMap.legendColorCollection[0].startValue,this.heatMap.legendColorCollection[0].endValue,this.heatMap.legendColorCollection[0].minColor,this.heatMap.legendColorCollection[0].maxColor,!0)),Math.round(100*t)/100>this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].value&&this.heatMap.legendColorCollection.push(new h7t(Math.round(100*t)/100,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].color,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].label,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].startValue,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].endValue,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].minColor,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].maxColor,!0)))},f7t.prototype.orderbyOffset=function(e){var i=new y9t,n=this.heatMap.isColorRange?"to":"value";return i.isCompact=!0,i.isLabel=!0,i.offsets=e.sort(function(e,t){return je(e.label)&&je(t.label)&&(i.isLabel=!1),je(e[n])||je(t[n])?(i.isCompact=!1,e):e[n]-t[n]}),i.isCompact||(i.offsets=(this.heatMap.paletteSettings.palette&&1<this.heatMap.paletteSettings.palette.length?this.heatMap.paletteSettings:this.heatMap.themeStyle).palette),i},f7t.prototype.getColorByValue=function(e){var t,i="";if(""!==e.toString())if("Bubble"!==this.heatMap.cellSettings.tileType||"Size"!==this.heatMap.cellSettings.bubbleType&&"Sector"!==this.heatMap.cellSettings.bubbleType)if("Fixed"===this.heatMap.paletteSettings.type)for(var n=0;n<this.heatMap.colorCollection.length;n++){var o=this.heatMap.isColorRange?this.heatMap.paletteSettings.palette[n].startValue:(this.heatMap.colorCollection[n+1]||this.heatMap.colorCollection[n]).value,r=this.heatMap.dataSourceMinValue===this.heatMap.dataSourceMaxValue;if(this.heatMap.isColorRange){var s=void 0;e<=this.heatMap.colorCollection[n].endValue&&e>=this.heatMap.colorCollection[n].startValue?(this.heatMap.legendVisibilityByCellType&&(s=this.heatMap.legendModule.legendRange),i=this.heatMap.legendVisibilityByCellType&&s[n]&&!s[n].visible?this.heatMap.themeStyle.toggledColor:this.heatMap.colorCollection[n].minColor):""===i&&(i=this.heatMap.paletteSettings.fillColor.minColor)}else if(e<=o&&r&&0===n||e<o||o<=e&&n===this.heatMap.colorCollection.length-1){s=void 0;this.heatMap.legendVisibilityByCellType&&(s=this.heatMap.legendModule.legendRange),i=this.heatMap.legendVisibilityByCellType&&s[n]&&!s[n].visible?this.heatMap.themeStyle.toggledColor:this.heatMap.colorCollection[n].color;break}}else"Table"!==this.heatMap.paletteSettings.colorGradientMode&&this.getColorCollection(),i=e<this.heatMap.colorCollection[0].value&&!this.heatMap.isColorRange?this.heatMap.colorCollection[0].color:e>this.heatMap.colorCollection[this.heatMap.colorCollection.length-1].value&&!this.heatMap.isColorRange?this.heatMap.colorCollection[this.heatMap.colorCollection.length-1].color:(t=this.convertToRGB(e,this.heatMap.colorCollection),this.rgbToHex(t.R,t.G,t.B));else i=this.heatMap.isColorRange?this.heatMap.colorCollection[0].minColor:this.heatMap.colorCollection[0].color;else i=this.heatMap.emptyPointColor;return i},f7t.prototype.destroy=function(){this.heatMap=null},f7t);function f7t(e){this.heatMap=e}y7t=function(e,t){return(y7t=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])}))(e,t)};var y7t,V2t=function(e,t){function i(){this.constructor=e}y7t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)};function v7t(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function b7t(e,t){var i=e||"",n=document.getElementById("heatmapmeasuretext");if(null===n&&(n=Q("text",{id:"heatmapmeasuretext"}),document.body.appendChild(n)),"string"==typeof e&&(-1<e.indexOf("<")||-1<e.indexOf(">"))){for(var o=e.split(" "),r=0;r<o.length;r++)-1===o[r].indexOf("<br/>")&&(o[r]=o[r].replace(/[<>]/g,"&"));e=o.join(" ")}return n.innerText=-1<i.indexOf("<br>")||-1<i.indexOf("<br/>")?i:e,n.style.position="absolute",n.style.visibility="hidden",n.style.fontSize=-1!==t.size.indexOf("px")?t.size:t.size+"px",n.style.fontWeight=t.fontWeight,n.style.fontStyle=t.fontStyle,n.style.fontFamily=t.fontFamily,n.style.top="-100",n.style.left="0",n.style.whiteSpace="nowrap",n.style.lineHeight="normal",new x7t(n.clientWidth,n.clientHeight)}function w7t(e,t){this["font-size"]=e.size,this["font-style"]=e.fontStyle.toLowerCase(),this["font-family"]=e.fontFamily,this["font-weight"]=e.fontWeight.toLowerCase(),this.fill=t||""}function C7t(e,t,i,n){n="Near"===n.textAlignment?t:"Center"===n.textAlignment?t+e/2:e+t;return n}function S7t(e){this.id=e}var A7t,x7t=function(e,t){this.width=e,this.height=t},I7t=(V2t(T7t,A7t=S7t),T7t);function T7t(e,t,i,n,o,r,s){e=A7t.call(this,e)||this;return e.opacity=o,e.fill=t,e.stroke=n||"",e["stroke-width"]=parseFloat(i.toString()),e["stroke-dasharray"]=r,e.d=s,e}function E7t(e,i,t,n,o,r,s){var a,l,e=D7t(e=i.enableHtmlSanitizer&&"string"==typeof e?go.sanitize(e):e,i),h=null,d=i.dataSource;if(!i.dataSourceSettings.isJsonData||"Cell"!==i.dataSourceSettings.adaptorType&&"Table"!==i.dataSourceSettings.adaptorType?h={value:n.value,xLabel:o[n.xIndex],yLabel:r[n.yIndex]}:(a="Numeric"===i.yAxis.valueType?i.yAxis.labels:r,l="Numeric"===i.xAxis.valueType?i.xAxis.labels:o,d.forEach(function(t){var e="Cell"===i.dataSourceSettings.adaptorType?Object.keys(t).some(function(e){return t[e]===a[n.yIndex]}):Object.prototype.hasOwnProperty.call(t,a[n.yIndex]);Object.keys(t).some(function(e){return t[e]===l[n.xIndex]})&&e&&(h=t)})),!je(e)){var p=M7t(e(h,i,e,i.element.id+"_Template"+s,!1),i.element.id+"_LabelTemplate_"+s);p.style.cssText="opacity: 1; display: flex; align-items: center; justify-content: center; z-index: 2; position: absolute;top:"+n.y+"px;left:"+n.x+"px;height:"+n.height+"px;width:"+n.width+"px;";for(var c=0;c<p.children.length;c++)p.children[c].style.pointerEvents="none";t.appendChild(p)}return t}function D7t(t,e){var i=null;try{"function"!=typeof t&&document.querySelectorAll(t).length?i=oo(document.querySelector(t).innerHTML.trim()):(e.isVue||e.isVue3||"function"==typeof t)&&(i=oo(t))}catch(e){i=oo(t)}return i}function M7t(e,t){for(var i=Q("div",{id:t}),n=(i.style.cssText="position: absolute;pointer-events: auto;",e.length);0<n;)i.appendChild(e[0]),n--;return i}var k7t,P7t=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u){this.x=e,this.y=t,this.width=i,this.height=n,this.value=o,this.id=r,this.xIndex=s,this.yIndex=a,this.xValue=l,this.yValue=h,this.visible=d,this.displayText=p,this.textId=c,this.allowCollection=u},B7t=function(e,t,i,n,o,r,s,a,l,h,d,p){this.value=e,this.xLabel=t,this.yLabel=i,this.xValue=n,this.yValue=o,this.cellElement=r,this.xPosition=s,this.yPosition=a,this.width=l,this.height=h,this.x=d,this.y=p},F7t=(V2t(L7t,k7t=I7t),L7t);function L7t(e,t,i,n,o,r,s,a,l,h){e=k7t.call(this,e,t,i.width,r,n,h)||this;return e.y=o.y,e.x=o.x,e.height=0<o.height?o.height:0,e.width=0<o.width?o.width:0,e.rx=s||0,e.ry=a||0,e.transform=l||"",e}V2t(N7t,R7t=I7t);var R7t,O7t=N7t;function N7t(e,t,i,n,o,r,s,a){e=R7t.call(this,e,t,i.width,o,n)||this;return e.cx=r||0,e.cy=s||0,e.r=a||0,e}var V7t,_7t=function(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n},H7t=(V2t(z7t,V7t=w7t),z7t);function z7t(e,t,i,n){i=V7t.call(this,i,n)||this;return i.transform="",i["dominant-baseline"]="auto",i.role="region",i.labelRotation=0,i.baseline="auto",i.id=e,i.x=t.x,i.y=t.y,i["text-anchor"]=t["text-anchor"],i.text=t.text,i["aria-label"]=t.text,i.transform=t.transform,i.labelRotation=t.labelRotation,i["dominant-baseline"]=t["dominant-baseline"],i.baseline=t.baseline,i.dy=t.dy,i}var j7t,W7t=function(e,t,i,n,o,r,s,a){this.transform="",this["dominant-baseline"]="auto",this.labelRotation=0,this.baseline="auto",this.x=e||0,this.y=t||0,this["text-anchor"]=i||"start",this.text=n||"",this["aria-label"]=n,this.transform=r||"",this.labelRotation=o,this["dominant-baseline"]=s||"auto",this.baseline=s||"",this.dy=a||""},Q7t=function(e,t,i,n){this.x1=e,this.y1=t,this.x2=i,this.y2=n},U7t=(V2t(q7t,j7t=I7t),q7t);function q7t(e,t,i,n,o,r){e=j7t.call(this,e,null,n,i,o,r,null)||this;return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}V2t(X7t,G7t=I7t);var G7t,Y7t=X7t;function X7t(e,t,i,n,o,r,s){e=G7t.call(this,e,i,o,s,r,null)||this;return e.d=t.d,e.x=t.x,e.y=t.y,e}var K7t=function(e,t,i,n,o,r,s,a,l,h,d,p){this.d=e,this.innerR=t,this.cx=s,this.cy=a,this.x=i,this.y=n,this.x1=o,this.y1=r,this.start=l,this.end=h,this.radius=d,this.counterClockWise=p};function J7t(e){for(var t=0,i=0,n=e;i<n.length;i++)t+=n[i];return t}function Z7t(e,t,i,n){i="Near"===n.textAlignment?e.height-i:"Center"===n.textAlignment?e.height/2:t;return i}function $7t(e,t,i){var n,o,r=new fo("heatmapMeasureRotateText"),s=r.createSvg({id:"heatmapMeasureRotateText_svg",width:100,height:100}),i={"font-size":e.size,"font-style":e.fontStyle.toLowerCase(),"font-family":e.fontFamily,"font-weight":e.fontWeight.toLowerCase(),transform:"rotate("+i+", 0, 0)","text-anchor":"middle"},a=r.createText(i,t[0]);if("string"!=typeof t&&1<t.length)for(var l=1,h=t.length;l<h;l++)o=b7t(t[l],e).height,n=t[l],o=r.createTSpan({x:0,id:"heatmapMeasureRotateText_"+l,y:0+l*o},n),a.appendChild(o);s.appendChild(a),document.body.appendChild(s);i=a.getBoundingClientRect();return ue(s),new x7t(i.right-i.left,i.bottom-i.top)}t9t.prototype.drawRectangle=function(e,t,i){this.heatMap.enableCanvasRendering?this.drawCanvasRectangle(this.heatMap.canvasRenderer,e,i):(delete e.d,-1===(i=t.appendChild(this.heatMap.renderer.drawRectangle(e))).id.indexOf("Rect")?(i.setAttribute("title","Rect Element"),i.setAttribute("role","img"),i.setAttribute("aria-hidden","false")):(t=this.heatMap.cellSettings.enableCellHighlighting||this.heatMap.allowSelection?0:-1,i.setAttribute("tabindex",t.toString()),i.style.outline="none"))},t9t.prototype.drawCircle=function(e,t){this.heatMap.enableCanvasRendering?this.drawCanvasCircle(this.heatMap.canvasRenderer,e):(delete e.d,t=t.appendChild(this.heatMap.renderer.drawCircle(e)),e=this.heatMap.cellSettings.enableCellHighlighting?0:-1,t.setAttribute("tabindex",e.toString()),t.style.outline="none")},t9t.prototype.drawPath=function(e,t,i){this.heatMap.enableCanvasRendering?this.drawCanvasPath(this.heatMap.canvasRenderer,e,t):(delete e.x,delete e.y,i.appendChild(this.heatMap.renderer.drawPath(e)))},t9t.prototype.createText=function(e,t,i){this.heatMap.enableCanvasRendering?this.canvasDrawText(e,i):(delete e.labelRotation,delete e.baseline,delete e.text,t.appendChild(this.heatMap.renderer.createText(e,i)),e.text=i)},t9t.prototype.createWrapText=function(e,t,i){var n,o,r={id:e.id,x:e.x,y:e.y,fill:e.fill,"font-size":t.size,"font-style":t.fontStyle,"font-family":t.fontFamily,"font-weight":t.fontWeight.toLowerCase(),"text-anchor":e["text-anchor"],transform:e.transform,"dominant-baseline":e["dominant-baseline"],"aria-label":e.text[0]},s=e.text[0];if(this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.createText(e,s):n=this.heatMap.renderer.createText(r,s),"string"!=typeof e.text&&1<e.text.length)for(var a=1,l=e.text.length;a<l;a++)o=b7t(e.text[a],t).height,this.heatMap.enableCanvasRendering?(e.id=e.id+a,e.y+=o,this.heatMap.canvasRenderer.createText(e,e.text[a])):(o=this.heatMap.renderer.createTSpan({x:e.x,id:e.id+a,y:e.y+a*o},e.text[a]),n.appendChild(o));this.heatMap.enableCanvasRendering||i.appendChild(n)},t9t.prototype.drawLine=function(e,t){this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.drawLine(e):(delete e.d,t.appendChild(this.heatMap.renderer.drawLine(e)))},t9t.prototype.canvasDrawText=function(e,t,i,n,o,r,s){var a=this.heatMap.canvasRenderer.ctx,l=(i=i||e.x,n=n||e.y,this.getOptionValue(e,"font-weight")),h=(je(l)||"regular"!==l.toLowerCase()||(l="normal"),this.getOptionValue(e,"font-family")),d=-1===e["font-size"].toString().indexOf("px")?e["font-size"]+"px":e["font-size"],p=this.getOptionValue(e,"text-anchor"),l=this.getOptionValue(e,"font-style").toLowerCase()+" "+l+" "+d+" "+h;if("middle"===p&&(p="center"),a.save(),a.fillStyle=e.fill,a.font=l,a.textAlign=p,e.baseline&&(a.textBaseline=e.baseline),a.translate(i,n),a.rotate(e.labelRotation*Math.PI/180),s)for(var c=0;c<o.length;c++)e.y=0!==c?e.y+r:e.y,a.fillText(o[c],e.x-i,e.y-n);else a.fillText(t,e.x-i,e.y-n);a.restore()},t9t.prototype.getOptionValue=function(e,t){return e[t]},t9t.prototype.setAttributes=function(e,t){e.ctx.lineWidth=t["stroke-width"];var i=t["stroke-dasharray"];je(i)||(i=i.split(","),e.ctx.setLineDash([parseInt(i[0],10),parseInt(i[1],10)])),e.ctx.strokeStyle=t.stroke},t9t.prototype.drawCanvasRectangle=function(e,t,i){var n=e.ctx;e.ctx.save(),e.ctx.beginPath(),e.ctx.globalAlpha=t.opacity,this.setAttributes(e,t),this.drawCornerRadius(e,t),(t["stroke-width"]&&0!==t["stroke-width"]||i)&&e.ctx.stroke(),e.ctx.restore(),e.ctx=n},t9t.prototype.drawCornerRadius=function(e,t){var i=t.rx,n=t.x,o=t.y,r=t.width,s=t.height;"none"===t.fill&&(t.fill="transparent"),e.ctx.fillStyle=t.fill,s<2*(i=r<2*i?r/2:i)&&(i=s/2),e.ctx.beginPath(),e.ctx.moveTo(n+r-i,o),e.ctx.arcTo(n+r,o,n+r,o+s,i),e.ctx.arcTo(n+r,o+s,n,o+s,i),e.ctx.arcTo(n,o+s,n,o,i),e.ctx.arcTo(n,o,n+r,o,i),e.ctx.closePath(),e.ctx.fill()},t9t.prototype.drawCanvasCircle=function(e,t){e.ctx.save(),e.ctx.beginPath(),e.ctx.arc(t.cx,t.cy,t.r,0,2*Math.PI),e.ctx.fillStyle=t.fill,e.ctx.globalAlpha=t.opacity,e.ctx.fill(),this.setAttributes(e,t),t["stroke-width"]&&0!==t["stroke-width"]&&e.ctx.stroke(),e.ctx.restore()},t9t.prototype.drawCanvasPath=function(e,t,i){var n=t.d.split(" ");e.ctx.save(),e.ctx.beginPath(),e.ctx.globalAlpha=t.opacity,e.ctx.fillStyle=t.fill,this.setAttributes(e,t);for(var o=0;o<n.length;o+=3){var r=parseFloat(n[o+1]),s=parseFloat(n[o+2]);switch(n[o]){case"M":e.ctx.moveTo(r,s);break;case"L":e.ctx.lineTo(r,s);break;case"A":case"a":e.ctx.arc(i.x,i.y,i.radius,.0174533*i.start,.0174533*i.end,!1),o="a"===n[o]?o+13:o+5;break;case"Z":e.ctx.closePath()}}e.ctx.fill(),t["stroke-width"]&&0!==t["stroke-width"]&&e.ctx.stroke(),e.ctx.restore()};var e9t=t9t;function t9t(e){this.heatMap=e}function i9t(e,t,i){var n=[];switch(t.textOverflow){case"Wrap":n=r9t(e,i,t);break;case"Trim":n.push(s9t(i,e,t));break;default:n.push(a9t(i,e,t))}return n}function n9t(e,t){if(t)for(var i=0;i<e.length;i++)e[i]=go.sanitize(e[i]);return e}function o9t(e){for(var t=!1,i=0;i<e.length;i++)if(-1!==e[i].indexOf("<br>")||-1!==e[i].indexOf("<br/>")){t=!0;break}return t}function r9t(e,t,i,n){for(var o,r=e.split(" "),s="",a=[],l=0,h=r.length;l<h;l++)o=r[l],b7t(s.concat(o),i).width<t?s=s.concat((""===s?"":" ")+o):""!==s?(s=n?s.concat((""===s?"":" ")+o):s,a.push(s9t(t,s,i)),s=n?"":o):a.push(s9t(t,o,i)),s&&l===h-1&&a.push(s9t(t,s,i));return a}function s9t(e,t,i){var n=t;if(e<b7t(t,i).width)for(var o=t.length-1;0<=o;--o)if(b7t(n=t.substring(0,o)+"...",i).width<=e)return n;return n}function a9t(e,t,i){var n=t;if(e<b7t(t,i).width)for(var o=t.length-1;0<=o;--o)if(b7t(n=t.substring(0,o),i).width<=e)return n;return n}var l9t=function(e,t,i,n,o){this.id=e,this.x1=t,this.x2=i,this.y1=n,this.y2=o},h9t=function(e,t){this.color=e,this.colorStop=t};function d9t(e,t,i,n,o,r,s,a){var l=document.getElementById(o),h=b7t(e,{fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"Regular"}),d=h.width+5;t=(t=n<t+d?t-d:t)<0?5:t,l?(l.innerText=e,l.style.top=(i+15).toString()+"px",l.style.left=(t+15).toString()+"px"):((l=Q("div",{id:o})).style.cssText="top:"+(i+15).toString()+"px;left:"+(t+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",l.innerText=e,r.appendChild(l)),e===a.titleSettings.text?l.style.width=t+15+h.width+7>a.availableSize.width?(a.availableSize.width-(t+15)).toString()+"px":"":(l.style.left=t+15+h.width+7>a.availableSize.width?(a.availableSize.width-(h.width+7)).toString()+"px":t.toString()+"px",l.style.top=i+15+h.height+6>a.availableSize.height?(i-(h.height+6)-10).toString()+"px":l.style.top),s&&(je(a.tooltipTimer)||window.clearTimeout(a.tooltipTimer),a.tooltipTimer=setTimeout(function(){p9t(o)},1500))}function p9t(e){e=u9t(e);e&&(ue(e),c9t())}function c9t(){p9t("heatmapmeasuretext")}function u9t(e){return document.getElementById(e)}function g9t(e,t,i,n){var o=new Date(e);switch(t=Math.ceil(t*n),i){case"Years":o.setFullYear(o.getFullYear()+t);break;case"Months":o.setMonth(o.getMonth()+t);break;case"Days":o.setDate(o.getDate()+t);break;case"Hours":o.setHours(o.getHours()+t);break;case"Minutes":o.setMinutes(o.getMinutes()+t)}return o}var m9t=function(e,t){this.region=new _7t(0,0,0,0),this.text=e,this.region=t};function f9t(e,t,i){for(var n,o,r,s=e.length,a=0;a<s;a++)if(t>=(o=(n=e[a]).region).x&&t<=o.x+o.width&&i>=o.y&&i<=o.y+o.height){r=n.text;break}return r}var y9t=function(){},v9t=function(e,t,i,n,o,r){this.pathX1=e,this.pathY1=t,this.pathX2=i,this.pathY2=n,this.pathX3=o,this.pathY3=r},b9t=function(e,t,i,n,o,r){this.x=e,this.y=t,this.width=i,this.height=n,this.label=o,this.id=r},w9t=function(e,t,i,n,o,r,s){this.x=e,this.y=t,this.width=i,this.height=n,this.value=o,this.visible=r,this.currentPage=s},C9t=function(e,t,i,n){this.visible=e,this.value=t,this.startValue=i,this.endValue=n};function S9t(e){e="transparent"===e?"white":e;var t=document.getElementById("heatmapmeasuretext"),t=(t.style.color=e,(e=window.getComputedStyle(t).color).replace(/[()RGBrgba ]/g,"").split(","));return A9t(new g7t(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10)))}function A9t(e){return"#"+x9t(e.R)+x9t(e.G)+x9t(e.B)}function x9t(e){e=e.toString(16);return 1===e.length?"0"+e:e}function I9t(e){e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return e?new g7t(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)):new g7t(255,255,255)}function T9t(e,t,i,n){return e?t.replace("{value}",n(i)):n(i)}var E9t=function(e,t){this.x=e,this.y=t};D9t=function(e,t){return(D9t=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])}))(e,t)};var D9t,M9t,W2t=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},NVt=(function(e,t){function i(){this.constructor=e}D9t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(k9t,M9t=n),k9t.prototype.computeSize=function(e,t,i){var n;new x7t(0,0);this.titleSize=e.getTitleSize(e,10),this.maxLabelSize=e.getMaxLabelSize(e,t),this.getMultilevelLabelsHeight(e,i,t);for(var o=0;o<this.multiLevelLabels.length;o++)n=e.multiLevelLabelSize(10,o),this.multiLevelSize.push(n)},k9t.prototype.multiPosition=function(e,t){var i,n,o="Horizontal"===e.orientation?10:20,r=new E9t(0,0);return"Horizontal"===e.orientation?(i=e.maxLabelSize.height+o+(0===e.angle||180===e.angle||360===e.angle?0:o),n=this.xAxisMultiLabelHeight[t-1],r.x=e.isInversed?e.rect.x+e.rect.width:e.rect.x,r.y=0===t?e.rect.y+(e.opposedPosition?-i:i):e.multiLevelPosition[t-1].y+(e.opposedPosition?-n:n)):(i=e.maxLabelSize.width+o,n=0!==t&&this.multiLevelSize[t-1].width,r.x=0===t?e.rect.x-(e.opposedPosition?-i:i):e.multiLevelPosition[t-1].x-(e.opposedPosition?-(n+o):n+o),r.y=e.isInversed?e.rect.y:e.rect.y+e.rect.height),r},k9t.prototype.multiLevelLabelSize=function(e,t){for(var i=new x7t(0,0),n=this.multiLevelLabels,o=n[t].categories,r=0;r<o.length;r++){var s=b7t(o[r].text,n[t].textStyle);i.width=(i.width>s.width?i:s).width,i.height=(i.height>s.height?i:s).height}var a=("Horizontal"===this.orientation?this.xAxisMultiLabelHeight:this.yAxisMultiLabelHeight)[t];return(this.opposedPosition?this.farSizes:this.nearSizes).push(a),i},k9t.prototype.getMultilevelLabelsHeight=function(n,o,r){var s,a,l,h,d=[],p="Vertical"===n.orientation,c="Vertical"===n.orientation?20:10;this.multiLevelLabels.map(function(t,i){t.categories.map(function(e){l="number"==typeof e.start?e.start:Number(new Date(e.start)),h="number"==typeof e.end?e.end:Number(new Date(e.end)),""!==e.text&&null!==e.start&&null!==e.end&&(s=b7t(e.text,t.textStyle),a=p?s.width:s.height,l=r.heatMapAxis.calculateLeftPosition(n,l,e.start,o),h=r.heatMapAxis.calculateWidth(n,e.end,h,o),s=b7t(e.text,t.textStyle),h=null===e.maximumTextWidth?Math.abs(h-l):e.maximumTextWidth,s.width>h-c&&"Wrap"===t.overflow&&!p&&(a*=r9t(e.text,h-c,t.textStyle).length),d[i]=!d[i]||d[i]<a?a+c:d[i])})}),p?this.yAxisMultiLabelHeight=d:this.xAxisMultiLabelHeight=d},k9t.prototype.getTitleSize=function(e,t){var i=new x7t(0,0);return this.title.text&&((i=b7t(this.title.text,this.title.textStyle)).height+=t),(e.opposedPosition?this.farSizes:this.nearSizes).push(i.height),i},k9t.prototype.getMaxLabelSize=function(e,t){var i=new x7t(0,0),n=this.axisLabels,o=0<e.border.width||0<e.multiLevelLabels.length?10:0,r=1,s="DateTime"===e.valueType&&"None"!==e.showLabelOn||"Wrap"===e.textStyle.textOverflow||"Trim"===e.textStyle.textOverflow?t.initialClipRect.width/e.axisLabelSize:t.initialClipRect.width/e.axisLabels.length,a=(e.angle=e.labelRotation,e.isIntersect=!1,o9t(n));if(("Horizontal"===e.orientation&&("Rotate45"===e.labelIntersectAction||e.labelRotation%180==0&&"Trim"===e.labelIntersectAction||e.enableTrim)||"MultipleRows"===e.labelIntersectAction)&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow){var l=t.initialClipRect.x+(e.isInversed?t.initialClipRect.width:0),h=void 0,d=void 0;this.clearMultipleRow();for(var p=0,c=n.length;p<c;p++){var u=b7t(b=n[p],e.textStyle),g="DateTime"===e.valueType&&"None"!==e.showLabelOn?e.dateTimeAxisLabelInterval[p]*s:s,m=l+(e.isInversed?-(s+u.width)/2:(s-u.width)/2),u=(m=m<t.initialClipRect.x?t.initialClipRect.x:m)+u.width;if(e.isInversed){if(je(d))d=m;else if(d<u&&"MultipleRows"!==e.labelIntersectAction){"Rotate45"!==e.labelIntersectAction||a||e.enableTrim?e.isIntersect=!0:e.angle=45;break}d=m}else{if(je(h))h=u;else if(m<h&&"MultipleRows"!==e.labelIntersectAction){"Rotate45"!==e.labelIntersectAction||a||e.enableTrim?e.isIntersect=!0:e.angle=45;break}h=u}l+=e.isInversed?-g:g,"Horizontal"===e.orientation&&"MultipleRows"===e.labelIntersectAction&&0===e.labelRotation&&this.multipleRow.push(new d7t(m,u,r,b,1))}"Horizontal"===e.orientation&&"MultipleRows"===e.labelIntersectAction&&e.isInversed&&(this.multipleRow=this.multipleRow.reverse())}for(var f=1,p=0;p<n.length;p++){var y,v=this.multipleRow,b=void 0,w=(b=e.enableTrim||"Trim"===e.textStyle.textOverflow&&-1===n[p].indexOf("<br>")&&-1===n[p].indexOf("<br/>")?s9t("Trim"===e.textStyle.textOverflow&&"Horizontal"===e.orientation?s:e.maxLabelLength,n[p],e.textStyle):n[p],[]);if("Wrap"!==e.textStyle.textOverflow&&!a||e.enableTrim)a&&e.enableTrim&&(w=b.split(/<br\s*\/?>/,-1),y=s9t(e.maxLabelLength,w[0],e.textStyle),b=-1===b.indexOf("<br>")&&-1===b.indexOf("<br/>")||-1!==y.indexOf("...")?y:y+"...",w=[]),w.push(b);else{var C="Horizontal"===e.orientation?s:e.maxLabelLength;if(a)for(var w=b.split(/<br\s*\/?>/,-1),S=0;S<w.length;S++)w[S]=s9t(C,w[S],e.textStyle);else w=r9t(b,C,e.textStyle);if(f=w.length>f&&!e.enableTrim?w.length:f,"Vertical"===e.orientation||"Horizontal"===e.orientation&&e.angle%180!=0)for(var A=0,x=0;x<w.length;x++){var I=b7t(w[x],e.textStyle);I.width>A&&(A=I.width,b=w[x])}if("Vertical"===e.orientation)for(var T=t.initialClipRect.height/(e.axisLabelSize/e.axisLabelInterval),x=0;x<w.length;x++)b7t(b,e.textStyle).height*w.length>T-10&&0<w.length&&90!==e.angle&&270!==e.angle&&(w.pop(),0<w.length)&&(w[w.length-1]=w[w.length-1]+"...",w[w.length-1]=s9t(e.maxLabelLength,w[w.length-1],e.textStyle))}var E=e.angle%180==0?b7t(b,e.textStyle):$7t(e.textStyle,w,e.angle);if(i.width=(i.width>E.width?i:E).width,"MultipleRows"===e.labelIntersectAction&&"Horizontal"===e.orientation&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow&&0<p&&0===e.labelRotation){v[p].end>=t.initialClipRect.width&&p<n.length-1&&(v[p].row=v[p].row+1);for(var D=1;D<=e.multilevel.length;D++)if(v[p].start<v[p-1].end){if(e.multilevel[D]<v[p].start){r=D;break}if(D===e.multilevel.length-1){r=e.multilevel.length;break}}else if(E.width<s)for(var M=1;M<=e.multilevel.length;M++)if(e.multilevel[M]<v[p].start){v[r=M].row=r;break}i.height=i.height>E.height*r+.5*E.height/2*(r-1)?i.height:E.height*r+.5*E.height/2*r,this.multipleRow[p].index=r,e.multilevel[r]=v[p].end}else"Horizontal"===e.orientation&&"MultipleRows"===e.labelIntersectAction&&0===p&&0===e.labelRotation&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow&&(e.multilevel[1]=v[p].end),i.height=(i.height>E.height?i:E).height}return i.height=e.angle%180==0?i.height*f:i.height,20<=t.cellSettings.border.width&&"Horizontal"!==e.orientation&&(i.width=i.width+t.cellSettings.border.width/4),(e.opposedPosition?this.farSizes:this.nearSizes).push("Horizontal"===e.orientation?i.height:i.width+o),i},k9t.prototype.calculateNumericAxisLabels=function(e){var t,i,n=0,o=0,r=this.interval||1,s=(e.adaptorModule&&e.isCellData&&(i=("Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax:e.adaptorModule.adaptiveYMinMax).min,t=("Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax:e.adaptorModule.adaptiveYMinMax).max),n=je(this.minimum)?i||0:this.minimum,o=je(this.maximum)?t||this.maxLength*this.increment:this.maximum,this.minimum&&this.maximum&&o<n&&(i=n,n=o,o=i),o=je(this.maximum)?t||o+n:o,je(this.labelFormat)?"":this.labelFormat),a=null!==s.match("{value}");this.format=e.intl.getNumberFormat({format:a?"":s});for(var l=n;l<=o;l+=r*this.increment){var h=T9t(a,s,l,this.format);this.axisLabels.push(h)}this.min=0,this.axisLabelSize=Math.floor((o-n)/this.increment+1),this.max=this.axisLabelSize-1,this.axisLabelInterval=r;for(l=n;l<=o;l+=this.increment){h=T9t(a,s,l,this.format);this.tooltipLabels.push(h),this.labelValue.push(l)}this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},k9t.prototype.calculateCategoryAxisLabels=function(){var e,t=0<(t=this.labels||[]).length?t:this.jsonCellLabel,i=je(this.minimum)||this.minimum instanceof Date?0:this.minimum,n=je(this.maximum)||this.maximum instanceof Date?this.maxLength:this.maximum,o=this.interval||1,r=je(this.labelFormat)?"":this.labelFormat,s=null!==r.match("{value}");if(!je(this.minimum)&&!je(this.maximum)&&n<i&&(e=i,i=n,n=e),t&&0<t.length)for(var a=i;a<=n;a+=o){var l=je(t[a])?s?r.replace("{value}",a.toString()):a.toString():s?r.replace("{value}",t[a].toString()):t[a].toString();this.axisLabels.push(l)}else for(a=i;a<=n;a+=o){l=s?r.replace("{value}",a.toString()):a.toString();this.axisLabels.push(l)}for(a=i;a<=n;a++)this.tooltipLabels.push(je(t[a])?s?r.replace("{value}",a.toString()):a.toString():s?r.replace("{value}",t[a].toString()):t[a].toString()),this.labelValue.push((je(t[a])?a:t[a]).toString());this.min=i,this.max=n,this.axisLabelSize=n-i+1,this.axisLabelInterval=o,this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},k9t.prototype.calculateDateTimeAxisLabel=function(e){var t=this.interval||1,i={skeleton:"full",type:"dateTime"},n=e.intl.getDateParser(i),i=e.intl.getDateFormat(i),o=null,r=null,o=(e.adaptorModule&&e.isCellData&&(o=("Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax:e.adaptorModule.adaptiveYMinMax).min,r=("Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax:e.adaptorModule.adaptiveYMinMax).max),this.minimum||o||null),r=this.maximum||r||null;if(null===o&&null===r){for(var s=0,a=this.maxLength*this.increment,l=s;l<=a;l+=t*this.increment)this.axisLabels.push(l.toString()),this.tooltipLabels.push(l.toString()),this.labelValue.push(l.toString());this.min=0,this.max=this.maxLength,this.axisLabelSize=(a-s)/this.increment+1,this.axisLabelInterval=t}else{null!==o&&null===r?a=g9t(s=Date.parse(n(i(new Date(Sa.parse.parseJson({val:o}).val)))),this.maxLength,this.intervalType,this.increment).getTime():null===o&&null!==r?s=g9t(a=Date.parse(n(i(new Date(Sa.parse.parseJson({val:r}).val)))),-this.maxLength,this.intervalType,this.increment).getTime():(s=Date.parse(n(i(new Date(Sa.parse.parseJson({val:o}).val)))),a=Date.parse(n(i(new Date(Sa.parse.parseJson({val:r}).val))))),this.format=e.intl.getDateFormat({format:this.labelFormat,skeleton:this.getSkeleton()});for(var h=s;h<=a;){var d=this.format(new Date(h));this.axisLabels.push(d),"None"!==this.showLabelOn&&(t=this.calculateLabelInterval(h),this.dateTimeAxisLabelInterval.push(t)),h=g9t(h,t,this.intervalType,this.increment).getTime()}for(this.min=0,this.axisLabelInterval=t,this.axisLabelSize=this.getTotalLabelLength(s,a),this.max=this.axisLabelSize-1,h=s;h<=a;){d=this.format(new Date(h));this.tooltipLabels.push(d),this.labelValue.push(new Date(h)),h=g9t(h,1,this.intervalType,this.increment).getTime()}}this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},k9t.prototype.calculateLabelInterval=function(e){var t=new Date(e).getFullYear(),i=new Date(e).getMonth()+1,n=new Date(e).getDate();return"Years"===this.showLabelOn||"Months"===this.showLabelOn?"Years"===this.showLabelOn&&"Months"===this.intervalType?Math.ceil(12/this.increment):(t="Years"===this.showLabelOn?t%4==0?366:365:new Date(t,i,0).getDate(),t+=1-n,"Days"===this.intervalType?Math.ceil(t/this.increment):"Hours"===this.intervalType?Math.ceil(24*t/this.increment):"Minutes"===this.intervalType?Math.ceil(24*t*60/this.increment):1):"Days"===this.showLabelOn?"Hours"===this.intervalType?Math.ceil(24/this.increment):"Minutes"===this.intervalType?Math.ceil(1440/this.increment):1:"Hours"===this.showLabelOn&&(i=new Date(e).getMinutes(),"Minutes"===this.intervalType)?Math.ceil((60-i)/this.increment):1},k9t.prototype.getSkeleton=function(){var e="Years"===this.intervalType?"yMMM":"Months"===this.intervalType?"MMMd":"Days"===this.intervalType?"yMd":"Hours"===this.intervalType?"EHm":(this.intervalType,"Hms");return e},k9t.prototype.getTotalLabelLength=function(e,t){var i=0,n=new Date(e),o=new Date(t);switch(this.intervalType){case"Years":var r=(o.getFullYear()-n.getFullYear())/this.increment+1,i=Math.floor(r);break;case"Months":var r=12*(o.getFullYear()-n.getFullYear());i=(r=(r-=n.getMonth())+o.getMonth())<=0?1:Math.floor(r/this.increment+1);break;case"Days":s=Math.abs(n.getTime()-o.getTime()),r=Math.floor(s/864e5),i=Math.floor(r/this.increment+1);break;case"Hours":var s=Math.abs(n.getTime()-o.getTime()),r=Math.floor(s/36e5);i=Math.floor(r/this.increment)+1;break;case"Minutes":s=Math.abs(n.getTime()-o.getTime());r=Math.floor(s/6e4);i=Math.floor(r/this.increment)+1}return i},k9t.prototype.clearAxisLabel=function(){this.axisLabels=[],this.tooltipLabels=[],this.dateTimeAxisLabelInterval=[],this.labelValue=[]},k9t.prototype.clearMultipleRow=function(){this.multipleRow=[],this.multilevel=[]},k9t.prototype.destroy=function(){this.axisLabels=null,this.multipleRow=null,this.rect=null,this.nearSizes=null,this.farSizes=null,this.maxLabelSize=null,this.titleSize=null,this.labelValue=null,this.format=null,this.multilevel=[],this.tooltipLabels=[],this.dateTimeAxisLabelInterval=[],this.jsonCellLabel=[],this.multiLevelSize=[],this.xAxisMultiLabelHeight=[],this.yAxisMultiLabelHeight=[],this.multiLevelPosition=[]},W2t([t({text:"",textStyle:dLi.axisTitleFont},f2t)],k9t.prototype,"title",void 0),W2t([e(!1)],k9t.prototype,"opposedPosition",void 0),W2t([e(null)],k9t.prototype,"labels",void 0),W2t([t(dLi.axisLabelFont,o2t)],k9t.prototype,"textStyle",void 0),W2t([e(0)],k9t.prototype,"labelRotation",void 0),W2t([e(!1)],k9t.prototype,"isInversed",void 0),W2t([e("Category")],k9t.prototype,"valueType",void 0),W2t([e(1)],k9t.prototype,"increment",void 0),W2t([e("None")],k9t.prototype,"showLabelOn",void 0),W2t([e(null)],k9t.prototype,"minimum",void 0),W2t([e(null)],k9t.prototype,"maximum",void 0),W2t([e(null)],k9t.prototype,"interval",void 0),W2t([e("")],k9t.prototype,"labelFormat",void 0),W2t([e("Days")],k9t.prototype,"intervalType",void 0),W2t([e("Trim")],k9t.prototype,"labelIntersectAction",void 0),W2t([e(!1)],k9t.prototype,"enableTrim",void 0),W2t([e(35)],k9t.prototype,"maxLabelLength",void 0),W2t([t({color:"#b5b5b5",width:0,type:"Rectangle"},I2t)],k9t.prototype,"border",void 0),W2t([kt([],d)],k9t.prototype,"multiLevelLabels",void 0),k9t);function k9t(){var e=null!==M9t&&M9t.apply(this,arguments)||this;return e.multipleRow=[],e.rect=new _7t(void 0,void 0,0,0),e.nearSizes=[],e.farSizes=[],e.maxLabelSize=new x7t(0,0),e.titleSize=new x7t(0,0),e.multilevel=[],e.axisLabels=[],e.tooltipLabels=[],e.labelValue=[],e.axisLabelSize=0,e.axisLabelInterval=0,e.dateTimeAxisLabelInterval=[],e.maxLength=0,e.min=0,e.max=0,e.isIntersect=!1,e.jsonCellLabel=[],e.multiLevelSize=[],e.xAxisMultiLabelHeight=[],e.yAxisMultiLabelHeight=[],e.multiLevelPosition=[],e}B9t.prototype.renderAxes=function(){this.initialClipRect=this.heatMap.initialClipRect;for(var e,t,i=this.heatMap,n=(i.enableCanvasRendering||(e=this.heatMap.renderer.createGroup({id:i.element.id+"AxisCollection"})),this.heatMap.axisCollections),o=0,r=n.length;o<r;o++){var s=n[o];"Horizontal"===s.orientation?(i.enableCanvasRendering||(t=this.heatMap.renderer.createGroup({id:i.element.id+"XAxisGroup"})),this.drawXAxisLine(t,s),this.drawXAxisTitle(s,t,s.rect),this.drawXAxisLabels(s,t,s.rect)):(t=i.renderer.createGroup({id:i.element.id+"YAxisGroup"}),this.drawYAxisLine(t,s),this.drawYAxisTitle(s,t,s.rect),this.drawYAxisLabels(s,t,s.rect)),0<s.multiLevelLabels.length&&this.drawMultiLevels(t,s),i.enableCanvasRendering||e.appendChild(t)}i.enableCanvasRendering||this.heatMap.svgObject.appendChild(e)},B9t.prototype.drawXAxisLine=function(e,t){t=this.initialClipRect.y+(t.opposedPosition?0:this.initialClipRect.height),t=new U7t(this.heatMap.element.id+"_XAxisLine",new Q7t(this.initialClipRect.x,t,this.initialClipRect.x+this.initialClipRect.width,t),"transparent",0);this.drawSvgCanvas.drawLine(t,e)},B9t.prototype.drawYAxisLine=function(e,t){t=this.initialClipRect.x+(t.opposedPosition?this.initialClipRect.width:0),t=new U7t(this.heatMap.element.id+"_YAxisLine",new Q7t(t,this.initialClipRect.y,t,this.initialClipRect.height+this.initialClipRect.y),"transparent",0);this.drawSvgCanvas.drawLine(t,e)},B9t.prototype.drawXAxisTitle=function(e,t,i){var n,o,r,s,a,l,h="0px"===e.textStyle.size?0:10,h=i.y+(e.opposedPosition?-(e.maxLabelSize.height+h+J7t(e.xAxisMultiLabelHeight)):e.maxLabelSize.height+h+J7t(e.xAxisMultiLabelHeight));e.title.text&&(n=this.heatMap,o=e.title,s=b7t(r=this.heatMap.enableHtmlSanitizer?go.sanitize(o.text):o.text,o.textStyle),l=this.padding,a="Near"===o.textStyle.textAlignment?"start":"Far"===o.textStyle.textAlignment?"end":"middle",l=e.opposedPosition?-(l+s.height/4):l+3*s.height/4,e=new H7t(n.element.id+"_XAxisTitle",new W7t(i.x+C7t(i.width,0,0,o.textStyle),h+l,a,r),o.textStyle,o.textStyle.color||n.themeStyle.axisTitle),this.drawSvgCanvas.createText(e,t,r))},B9t.prototype.drawYAxisTitle=function(e,t,i){var n,o,r,s,a;e.title.text&&(n=e.title,o=this.heatMap,r=e.opposedPosition?90:-90,a="Near"===n.textStyle.textAlignment?"start":"Far"===n.textStyle.textAlignment?"end":"middle",s=10,s=e.opposedPosition?10:-10,s="0px"===e.textStyle.size?0:s,s=i.x+s+(e.opposedPosition?e.maxLabelSize.width+J7t(e.yAxisMultiLabelHeight):-(e.maxLabelSize.width+J7t(e.yAxisMultiLabelHeight))),i=i.y+Z7t(i,0,0,n.textStyle)+(e.opposedPosition?this.padding:-this.padding),e=this.heatMap.enableHtmlSanitizer?go.sanitize(n.text):n.text,a=new H7t(o.element.id+"_YAxisTitle",new W7t(s,i-this.padding,a,e,r,"rotate("+r+","+s+","+i+")","auto"),n.textStyle,n.textStyle.color||o.themeStyle.axisTitle),this.heatMap.enableCanvasRendering?this.drawSvgCanvas.canvasDrawText(a,e,s,i):this.drawSvgCanvas.createText(a,t,e))},B9t.prototype.calculateVisibleLabels=function(){for(var e,t=this.heatMap.axisCollections,i=this.heatMap.dataSourceSettings,n=!(i&&i.isJsonData&&"Cell"===i.adaptorType),o=0,r=t.length;o<r;o++)"Numeric"===(e=t[o]).valueType&&n?(e.clearAxisLabel(),e.calculateNumericAxisLabels(this.heatMap)):"DateTime"===e.valueType&&n?(e.clearAxisLabel(),e.calculateDateTimeAxisLabel(this.heatMap)):"Category"===e.valueType&&(e.clearAxisLabel(),e.calculateCategoryAxisLabels()),e.tooltipLabels=e.isInversed?e.tooltipLabels.reverse():e.tooltipLabels},B9t.prototype.measureAxis=function(e){for(var t=this.heatMap,i=t.axisCollections,n=i.length-1;0<=n;n--){var o,r="0px"===(o=i[n]).textStyle.size?0:this.padding;o.nearSizes=[],o.farSizes=[],o.computeSize(o,t,e),o.opposedPosition?"Horizontal"===o.orientation?(e.y+=J7t(o.farSizes)+r,e.height-=J7t(o.farSizes)+r):e.width-=J7t(o.farSizes)+r:"Horizontal"===o.orientation?e.height-=J7t(o.nearSizes)+r:(e.x+=J7t(o.nearSizes)+r,e.width-=J7t(o.nearSizes)+r)}},B9t.prototype.calculateAxisSize=function(e){for(var t=this.heatMap.axisCollections,i=0,n=t.length;i<n;i++){var o=t[i];o.rect=Pe({},e,null,!0),"Horizontal"===o.orientation&&0!==o.multiLevelLabels.length&&(o.opposedPosition&&(o.rect.y+=0===o.angle||180===o.angle||360===o.angle?0:this.padding,this.heatMap.initialClipRect.y+=0===o.angle||180===o.angle||360===o.angle?0:this.padding),e.height-=0===o.angle||180===o.angle||360===o.angle?0:this.padding),"Horizontal"!==o.orientation||o.opposedPosition||(o.rect.y=e.y+e.height,o.rect.height=0),"Vertical"===o.orientation&&o.opposedPosition&&(o.rect.x=e.x+e.width,o.rect.width=0),o.multiLevelPosition=[];for(var r=0;r<o.multiLevelLabels.length;r++){var s=o.multiPosition(o,r);o.multiLevelPosition.push(s)}}},B9t.prototype.drawXAxisLabels=function(e,t,i){var n=this.heatMap,o=e.axisLabels,r=5<this.heatMap.cellSettings.border.width?this.heatMap.cellSettings.border.width/2:0,s=(i.width-r)/e.axisLabelSize,a=0,l=e.interval||1,h=i.width/(e.axisLabelSize/e.axisLabelInterval),d=e.axisLabelInterval;if(0<h)for(;h<parseInt(e.textStyle.size,10);)h=i.width/(e.axisLabelSize/(d+=1));else d=e.tooltipLabels.length;e.axisLabelInterval<d&&(a=d,o=e.tooltipLabels,l=d);var p,c,u=i.x+(e.isInversed?i.width:0),g=e.angle,m=this.padding;n.enableCanvasRendering||(p=this.heatMap.renderer.createGroup({id:n.element.id+"XAxisLabels"}),c=this.heatMap.renderer.createGroup({id:n.element.id+"XAxisLabelBorder"})),e.isInversed&&"MultipleRows"===e.labelIntersectAction&&e.multipleRow.reverse();for(var f=o9t(o),y=0,v=o.length;y<v;y++){var b,w=new _7t(u,i.y,s,i.height),C=b7t(o[y],e.textStyle),S="Wrap"!==e.textStyle.textOverflow&&!f&&"Trim"!==e.textStyle.textOverflow&&"Trim"===e.labelIntersectAction&&(e.isIntersect||C.width>s)?"DateTime"!==e.valueType||"None"===e.showLabelOn?s9t(s*l,o[y],e.textStyle):s9t(e.dateTimeAxisLabelInterval[y]*s,o[y],e.textStyle):o[y],A=(S=!e.enableTrim&&"Trim"!==e.textStyle.textOverflow||f?S:s9t("Trim"===e.textStyle.textOverflow?s-e.border.width/2:e.maxLabelLength,o[y],e.textStyle),S=n.enableHtmlSanitizer?go.sanitize(S):S),x=[],I=new x7t(0,0),T=("Wrap"!==e.textStyle.textOverflow&&!f||e.enableTrim?(f&&e.enableTrim&&(x=this.getLabels(A,s-e.border.width/2,e,f),A=s9t(e.maxLabelLength,x[0],e.textStyle),A=-1===S.indexOf("<br>")&&-1===S.indexOf("<br/>")||-1!==A.indexOf("...")?A:A+"...",x=[]),x.push(A)):(x=this.getLabels(A,s-e.border.width/2,e,f),A=this.getMaxLabel(x,e)),C=b7t(A,e.textStyle),void 0),E=e.opposedPosition?-m:m+(g%360==0?C.height/2:0),D=(C.width=e.isInversed&&C.width>s?s:C.width,w.x+(e.isInversed?-(w.width/2+C.width/2):w.width/2-C.width/2)),E=("Near"===e.textStyle.textAlignment?D=w.x-(e.isInversed?w.width:0):"Far"===e.textStyle.textAlignment&&(D=w.x+(e.isInversed?-C.width:w.width-C.width)),"Trim"===e.labelIntersectAction?D=e.isInversed?u-s<D?D:u-s:D>=w.x?D:w.x:g%180==0&&(D=(D=D<i.x?i.x:D)+C.width>i.x+i.width?i.x+i.width-C.width:D),"Wrap"!==e.textStyle.textOverflow&&!f||e.isInversed||(D=D<w.x?w.x:D),b="MultipleRows"===e.labelIntersectAction&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow&&0===e.labelRotation?(b=e.opposedPosition?-(e.multipleRow[y].index-1):e.multipleRow[y].index-1,1<e.multipleRow[y].index?i.y+E+C.height*b+(e.opposedPosition?-(.5*C.height/2*e.multipleRow[y].index):.5*C.height/2*e.multipleRow[y].index):i.y+E+(e.opposedPosition?-.5*C.height/2:.5*C.height/2)):i.y+(("Wrap"===e.textStyle.textOverflow||f)&&e.opposedPosition&&g%360==0?-(1<=e.farSizes.length?e.farSizes[1]:0)+m:E),this.drawXAxisBorder(e,c,e.rect,D,C.width,y),D="Center"===e.textStyle.textAlignment&&1<x.length?D+C.width/2:"Near"===e.textStyle.textAlignment?D+m/2:"Far"===e.textStyle.textAlignment?D-m/2:D,g%360!=0&&(I=$7t(e.textStyle,x,g=360<g?g%360:g),D=w.x+(e.isInversed?-w.width/2:w.width/2)+(90===g?C.height*((x.length-1)/2):270===g?-(C.height*(x.length-1))/2:0),b+=e.opposedPosition?("Wrap"!==e.textStyle.textOverflow&&!f||e.enableTrim?-I.height/2:(g%360==180?m:0)+I.height/2-(1<=e.farSizes.length?e.farSizes[1]:0))+e.border.width/2:g%360==0?0:g%360==180?I.height/2-e.border.width+m:I.height/2-e.border.width,1<x.length&&(b-=0<g&&g<80||300<g&&g<360?C.height*((x.length-1)/2):120<g&&g<240&&180!==g&&2<x.length?-(C.height*((x.length-2)/2)):0,D+=0<g&&g<70?C.height*((x.length-1)/2):0),T="rotate("+g+","+D+","+b+")"),5<this.heatMap.cellSettings.border.width&&e.opposedPosition&&(b-=this.heatMap.cellSettings.border.width/2),this.heatMap.yAxis.opposedPosition&&5<this.heatMap.cellSettings.border.width&&(D+=this.heatMap.cellSettings.border.width/2),this.heatMap.xAxis.isInversed&&5<this.heatMap.cellSettings.border.width&&(D-=this.heatMap.cellSettings.border.width/2),C.width>=s&&(D=e.border.width?D+e.border.width/2:D),D="Near"===e.textStyle.textAlignment?D+e.border.width/2:"Far"===e.textStyle.textAlignment?D-e.border.width/2:D,D=g%360==0&&"Center"===e.textStyle.textAlignment&&C.width>s?w.x+(e.isInversed?-C.width/2:C.width/2):D,new H7t(n.element.id+"_XAxis_Label"+y,new W7t(D,b,g%360!=0||"Center"===e.textStyle.textAlignment&&1<x.length?"middle":"start",S,g,T),e.textStyle,e.textStyle.color||n.themeStyle.axisLabel));E.text=f?x:i9t(E.text,e.textStyle,w.width-e.border.width/2),0!==g&&this.heatMap.enableCanvasRendering?this.drawSvgCanvas.canvasDrawText(E,null,null,null,x,C.height,!0):"Wrap"===e.textStyle.textOverflow||f?this.drawSvgCanvas.createWrapText(E,e.textStyle,p):this.drawSvgCanvas.createText(E,p,S),0===a?(T="DateTime"===e.valueType&&"None"!==e.showLabelOn?e.dateTimeAxisLabelInterval[y]:e.axisLabelInterval,u+=e.isInversed?-T*s:T*s):u+=e.isInversed?-a*s:a*s,-1!==A.indexOf("...")&&(w=e.angle%360!=0?D-I.width/2:"Center"===e.textStyle.textAlignment?D-C.width/2:D,E=b-(e.angle%360!=0?I.height/2:C.height),S=-1!==o[y].indexOf("<br>")||-1!==o[y].indexOf("<br/>")?o[y].replace(/<br\s*\/?>/g," "):o[y],this.heatMap.tooltipCollection.push(new m9t(S,new _7t(w,E,(e.angle%360!=0?I:C).width,e.angle%360!=0?I.height:C.height*x.length)))),0!==a&&(y+=a-1)}n.enableCanvasRendering||(t.appendChild(p),t.appendChild(c))},B9t.prototype.getWrappedLabels=function(e,t,i){for(var n=e.split(/<br\s*\/?>/,-1),o=0;o<n.length;o++){var r=n[o];n[o]=s9t(t,r,i.textStyle)}return n},B9t.prototype.getMaxLabel=function(e,t){for(var i,n="",o=0,r=(new x7t(0,0),0);r<e.length;r++)(i=b7t(e[r],t.textStyle)).width>o&&(o=i.width,n=e[r]);return n},B9t.prototype.getLabels=function(e,t,i,n){return n?this.getWrappedLabels(e,t,i):r9t(e,t,i.textStyle)},B9t.prototype.drawYAxisLabels=function(e,t,i){var n=this.heatMap,o=e.axisLabels,r=i.height/e.axisLabelSize,s=0,a=i.height/(e.axisLabelSize/e.axisLabelInterval),l=e.axisLabelInterval;if(0<a)for(;a<parseInt(e.textStyle.size,10);)a=i.height/(e.axisLabelSize/(l+=1));else l=e.tooltipLabels.length;e.axisLabelInterval<l&&(s=l,o=e.tooltipLabels);var h,d,p=i.y+(e.isInversed?0:i.height),c=e.opposedPosition?"start":"end",u=e.opposedPosition?10:-10;n.enableCanvasRendering||(h=this.heatMap.renderer.createGroup({id:n.element.id+"YAxisLabels"}),d=this.heatMap.renderer.createGroup({id:n.element.id+"YAxisLabelBorder"}));for(var g=o9t(o),m=0,f=o.length;m<f;m++){var y=new _7t(i.x,p,i.width,r),v=e.isInversed?y.height/2:-y.height/2,b=20<=this.heatMap.cellSettings.border.width?this.heatMap.cellSettings.border.width/2:0,w=5<this.heatMap.cellSettings.border.width?this.heatMap.cellSettings.border.width/2/f*(e.isInversed?m:f-m):0,C=(T=!e.enableTrim&&"Trim"!==e.textStyle.textOverflow||g?o[m]:s9t(e.maxLabelLength,o[m],e.textStyle),b7t(T=n.enableHtmlSanitizer?go.sanitize(T):T,e.textStyle)),S=1,A=[],x=new x7t(0,0);if("Wrap"!==e.textStyle.textOverflow&&!g||e.enableTrim)g&&e.enableTrim&&(A=this.getLabels(T,e.maxLabelLength,e,g),D=s9t(e.maxLabelLength,A[0],e.textStyle),T=-1===T.indexOf("<br>")&&-1===T.indexOf("<br/>")||-1!==D.indexOf("...")?D:D+"...",A=[]),A.push(T);else{for(var A=this.getLabels(T,e.maxLabelLength,e,g),I=0;I<A.length;I++)C.height*A.length>a+5&&0<A.length&&90!==e.angle&&270!==e.angle&&(A.pop(),0<A.length)&&(A[A.length-1]=A[A.length-1]+"...",A[A.length-1]=s9t(e.maxLabelLength,A[A.length-1],e.textStyle));if(!g)for(var T=0!==A.length?"":T,E=0;E<A.length;E++)T=je(T)?A[E]:T+" "+A[E];S=A.length}var D=y.x+u+(e.opposedPosition?("Wrap"===e.textStyle.textOverflow&&e.angle%360!=0?S*(C.height/2):0)+b:-b),b=("Far"===e.textStyle.textAlignment&&e.angle%360==0?v=e.isInversed?y.height-(1<S?C.height*S-C.height/2:C.height/2):-(1<S?C.height*S-C.height/2:C.height/2):"Near"===e.textStyle.textAlignment&&e.angle%360==0&&(v=(e.isInversed?C.height/2:C.height/2-y.height)+e.border.width/2),y.y-w+v-(1<S&&"Center"===e.textStyle.textAlignment||e.angle%360!=0&&e.opposedPosition?C.height*S/2-C.height/2:0)),v=(e.angle%360!=0&&(c="middle",e.angle=360<e.angle?e.angle%360:e.angle,x=$7t(e.textStyle,A,e.angle),D=y.x+(e.opposedPosition?x.width/2+u:-(x.width/2-u))+(90===e.angle?C.height*((A.length-1)/2):270===e.angle?-(C.height*(A.length-1))/2:0),b=y.y+(e.isInversed?y.height/2:-y.height/2)+(180===e.angle?C.height*((A.length-1)/2):0),1<A.length)&&(w=C.height*((A.length-1)/2),b-=0<e.angle&&e.angle<60||290<e.angle&&e.angle<360?w:115<e.angle&&e.angle<240&&180!==e.angle?-w:0,D+=20<e.angle&&e.angle<160&&90!==e.angle?w:200<e.angle&&e.angle<330&&270!==e.angle?-w-(200<e.angle&&e.angle<240&&!e.opposedPosition&&2<A.length?-(C.height*((A.length-2)/2)):0):330<=e.angle&&e.angle<350?-w/2:0),new H7t(n.element.id+"_YAxis_Label"+m,new W7t(D,b,c,T,e.angle,"rotate("+e.angle+","+D+","+b+")","middle"),e.textStyle,e.textStyle.color||n.themeStyle.axisLabel));F.isIE&&!n.enableCanvasRendering&&(v.dy="1ex"),v.text=g?A:i9t(v.text,e.textStyle,e.maxLabelLength),0!==e.angle&&this.heatMap.enableCanvasRendering?this.drawSvgCanvas.canvasDrawText(v,null,null,null,A,C.height,!0):"Wrap"===e.textStyle.textOverflow||g?this.drawSvgCanvas.createWrapText(v,e.textStyle,h):this.drawSvgCanvas.createText(v,h,T),0===s?(S="DateTime"===e.valueType&&"None"!==e.showLabelOn?e.dateTimeAxisLabelInterval[m]:e.axisLabelInterval,p+=e.isInversed?S*r:-S*r):(p+=e.isInversed?s*r:-s*r,m+=s-1),this.drawYAxisBorder(e,d,e.rect,b,C.height,m),-1!==(T=this.getMaxLabel(A,e)).indexOf("...")&&(y=e.opposedPosition?D:D-(e.angle%360!=0?x.width/2:C.width),w=b-(e.angle%360!=0?x.height/2:C.height),T=-1!==o[m].indexOf("<br>")||-1!==o[m].indexOf("<br/>")?o[m].replace(/<br\s*\/?>/g," "):o[m],this.heatMap.tooltipCollection.push(new m9t(T,new _7t(y,w,(e.angle%360!=0?x:C).width,e.angle%360!=0?x.height:C.height*A.length))))}n.enableCanvasRendering||(t.appendChild(h),t.appendChild(d))},B9t.prototype.drawXAxisBorder=function(e,t,i,n,o,r){var s=i.width/e.axisLabelSize,a="",l=e.interval||1,h=e.isInversed?i.x+i.width-s*r*l:i.x+s*r*l,d=i.y,p=d+(e.opposedPosition?-(e.maxLabelSize.height+10):e.maxLabelSize.height+10),c=e.isInversed?h-s:h+s,u=e.isInversed?n+o+10:n-10,g=e.isInversed?n-10:n+o+10,g="Near"===e.textStyle.textAlignment&&e.isInversed?g+10:"Far"!==e.textStyle.textAlignment||e.isInversed?g:g-10,u="Far"===e.textStyle.textAlignment&&e.isInversed?u-10:"Near"!==e.textStyle.textAlignment||e.isInversed?u:u+10;switch(e.border.type){case"Rectangle":a="M "+h+" "+d+" L "+h+" "+p+" L "+c+" "+p+" L "+c+" "+d+" L "+h+" "+d;break;case"WithoutTopBorder":a="M "+h+" "+d+" L "+h+" "+p+" L "+c+" "+p+" L "+c+" "+d+" ";break;case"WithoutBottomBorder":a="M "+h+" "+p+" L "+h+" "+d+" L "+c+" "+d+" L "+c+" "+p+" ";break;case"WithoutTopandBottomBorder":a="M "+h+" "+d+" L "+h+" "+p+" M "+c+" "+d+" L "+c+" "+p+" ";break;case"Brace":a="M "+h+" "+d+" L "+h+" "+(p=d+(p-d)/2+(e.opposedPosition?0:5))+" L "+u+" "+p+" M "+g+" "+p+" L "+c+" "+p+" L "+c+" "+d+" "}0<e.border.width&&"WithoutBorder"!==e.border.type&&this.createAxisBorderElement(e,a,t,r)},B9t.prototype.drawYAxisBorder=function(e,t,i,n,o,r){var s=i.height/e.axisLabelSize,a="",l=e.interval||1,h=i.x,d=e.isInversed?i.y+s*r*l:i.y+i.height-s*r*l,p=h+(e.opposedPosition?e.maxLabelSize.width+20:-(e.maxLabelSize.width+20)),c=e.isInversed?d+s:d-s,u=e.isInversed?n-o/2:n+o/2,g=e.isInversed?n+o/2:n-o/2;switch(e.border.type){case"Rectangle":a="M "+h+" "+d+" L "+h+" "+c+" L "+p+" "+c+" L "+p+" "+d+" L "+h+" "+d;break;case"WithoutTopBorder":a="M "+h+" "+d+" L "+p+" "+d+" L "+p+" "+c+" L "+h+" "+c+" ";break;case"WithoutBottomBorder":a="M "+p+" "+d+" L "+h+" "+d+" L "+h+" "+c+" L "+p+" "+c+" ";break;case"WithoutTopandBottomBorder":a="M "+h+" "+d+" L "+p+" "+d+" M "+p+" "+c+" L "+h+" "+c+" ";break;case"Brace":a="M "+h+" "+d+" L "+(p=h-(h-p)/2)+" "+d+" L "+p+" "+u+" M "+p+" "+g+" L "+p+" "+c+" L "+h+" "+c}0<e.border.width&&"WithoutBorder"!==e.border.type&&this.createAxisBorderElement(e,a,t,r)},B9t.prototype.createAxisBorderElement=function(e,t,i,n){var o="Horizontal"===e.orientation?"_XAxis_Label_Border":"_YAxis_Label_Border",o=new I7t(this.heatMap.element.id+o+n,"transparent",e.border.width,e.border.color,1,"none",t);this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.drawPath(o,void 0):(n=this.heatMap.renderer.drawPath(o),i.appendChild(n))},B9t.prototype.drawMultiLevels=function(e,t){var i;this.heatMap.enableCanvasRendering||(i=this.heatMap.renderer.createGroup({id:this.heatMap.element.id+"_"+t.orientation+"_MultiLevelLabel"})),"Horizontal"===t.orientation?this.renderXAxisMultiLevelLabels(t,i):this.renderYAxisMultiLevelLabels(t,i),this.heatMap.enableCanvasRendering||e.appendChild(i)},B9t.prototype.renderXAxisMultiLevelLabels=function(l,h){var d,p,c,u,g,m,f,y,v,b,w=this,C=0,S=l.isInversed,A=l.opposedPosition,x="",I=(S?l.rect.width:0)+l.rect.x;l.multiLevelLabels.map(function(s,a){y=w.heatMap.renderer.createGroup({id:w.heatMap.element.id+"_XAxisMultiLevelLabel"+a}),s.categories.map(function(e,t){if(!je(e.start)&&!je(e.end)){"Tailwind"!==w.heatMap.theme&&"TailwindDark"!==w.heatMap.theme||s.setProperties({textStyle:{fontFamily:"Inter"}},!0),"Tailwind3"!==w.heatMap.theme&&"Tailwind3Dark"!==w.heatMap.theme||s.setProperties({textStyle:{color:w.heatMap.themeStyle.axisLabel,fontFamily:"Inter",fontWeight:"400"}},!0),"Material3"!==w.heatMap.theme&&"Material3Dark"!==w.heatMap.theme||s.setProperties({textStyle:{fontFamily:"Roboto"}},!0),"Fluent"!==w.heatMap.theme&&"FluentDark"!==w.heatMap.theme||s.setProperties({textStyle:{fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif'}},!0),"Fluent2"===w.heatMap.theme&&s.setProperties({textStyle:{color:"#242424",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),"Fluent2Dark"!==w.heatMap.theme&&"Fluent2HighContrast"!==w.heatMap.theme||s.setProperties({textStyle:{color:"#FFFFFF",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),"Bootstrap5"===w.heatMap.theme&&s.setProperties({textStyle:{color:"#212529",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),"Bootstrap5Dark"===w.heatMap.theme&&s.setProperties({textStyle:{color:"#DEE2E6",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),c=!1,u="number"==typeof e.start?e.start:Number(new Date(e.start)),g="number"==typeof e.end?e.end:Number(new Date(e.end)),u=I+w.calculateLeftPosition(l,u,e.start,l.rect),p=l.multiLevelPosition[a].y,g=I+w.calculateWidth(l,e.end,g,l.rect);var i=w.heatMap.enableHtmlSanitizer?go.sanitize(e.text):e.text,n=(m=b7t(i,s.textStyle),v=(null===e.maximumTextWidth?Math.abs(g-u):e.maximumTextWidth)-10,d=p+(A?-(l.xAxisMultiLabelHeight[a]-m.height):m.height),C=S?u-v:u+10,"Center"===s.alignment?(C=(g-u)/2+u,C-=(m.width>v?v:m.width)/2):"Far"===s.alignment?(C=S?u-10:g-10,C-=m.width>v?v:m.width):C=S?g+10:u+10,"None"===s.overflow&&m.width>Math.abs(g-u)&&(C=S?u-m.width-10:u+10,f="start"),new W7t(C,d,f,i,0,"translate(0,0)")),o=new H7t(w.heatMap.element.id+"_XAxis_MultiLevel"+a+"_Text"+t,n,s.textStyle,s.textStyle.color||w.heatMap.themeStyle.axisLabel);if("Wrap"===s.overflow?(o.text=r9t(i,v,s.textStyle),b=o.text.length):"Trim"===s.overflow&&(o.text=s9t(v,i,s.textStyle),b=1),"Wrap"===s.overflow&&1<o.text.length){w.drawSvgCanvas.createWrapText(o,s.textStyle,y);for(var r=0;r<o.text.length;r++)if(-1!==o.text[r].indexOf("...")){c=!0;break}}else w.drawSvgCanvas.createText(o,y,o.text);w.heatMap.enableCanvasRendering||h.appendChild(y),-1===o.text.indexOf("...")&&-1===o.text[0].indexOf("...")&&!c||w.heatMap.tooltipCollection.push(new m9t(e.text,new _7t(C,d-m.height,v,m.height*b))),0<s.border.width&&"WithoutBorder"!==s.border.type&&(x=w.renderXAxisLabelBorder(a,l,u,p,g,x,a,m,v,C))}}),""!==x&&(w.createBorderElement(a,l,x,h),x="")}),this.heatMap.enableCanvasRendering||h.appendChild(y)},B9t.prototype.renderXAxisLabelBorder=function(e,t,i,n,o,r,s,a,l,h){var d=n+(t.opposedPosition?-t.xAxisMultiLabelHeight[e]:t.xAxisMultiLabelHeight[e]);switch(t.multiLevelLabels[s].border.type){case"Rectangle":r+="M "+i+" "+n+" L "+i+" "+d+" L "+o+" "+d+" L "+o+" "+n+" L "+i+" "+n+" ";break;case"WithoutTopBorder":r+="M "+i+" "+n+" L "+i+" "+d+" L "+o+" "+d+" L "+o+" "+n+" ";break;case"WithoutBottomBorder":r+="M "+i+" "+d+" L "+i+" "+n+" L "+o+" "+n+" L "+o+" "+d+" ";break;case"WithoutTopandBottomBorder":r+="M "+i+" "+n+" L "+i+" "+d+" M "+o+" "+n+" L "+o+" "+d+" ";break;case"Brace":r+="M "+i+" "+n+" L "+i+" "+(n+(d-n)/2)+" L "+(t.isInversed?(a.width>l?l:a.width)+h+3:h-3)+" "+(n+(d-n)/2)+" M "+(t.isInversed?h-3:(a.width>l?l:a.width)+h+3)+" "+(n+(d-n)/2)+" L "+o+" "+(n+(d-n)/2)+" L "+o+" "+n+" "}return r},B9t.prototype.renderYAxisMultiLevelLabels=function(s,a){var l,h,d,p,c,u,g,m,f,y=this,v=s.isInversed,b="",w=(v?0:s.rect.height)+s.rect.y;s.multiLevelLabels.map(function(o,r){s.multiLevelPosition[r].y,g=y.heatMap.renderer.createGroup({id:y.heatMap.element.id+"_YAxisMultiLevelLabel"+r}),o.categories.map(function(e,t){"Tailwind"!==y.heatMap.theme&&"TailwindDark"!==y.heatMap.theme||o.setProperties({textStyle:{fontFamily:"Inter"}},!0),"Tailwind3"!==y.heatMap.theme&&"Tailwind3Dark"!==y.heatMap.theme||o.setProperties({textStyle:{color:y.heatMap.themeStyle.axisLabel,fontFamily:"Inter",fontWeight:"400"}},!0),"Material3"!==y.heatMap.theme&&"Material3Dark"!==y.heatMap.theme||o.setProperties({textStyle:{fontFamily:"Roboto"}},!0),"Bootstrap5"!==y.heatMap.theme&&"Bootstrap5Dark"!==y.heatMap.theme||o.setProperties({textStyle:{fontFamily:"Segoe UI"}},!0),"Fluent2"===y.heatMap.theme&&o.setProperties({textStyle:{color:"#242424",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),"Fluent2Dark"!==y.heatMap.theme&&"Fluent2HighContrast"!==y.heatMap.theme||o.setProperties({textStyle:{color:"#FFFFFF",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),p="number"==typeof e.start?e.start:Number(new Date(e.start)),c="number"==typeof e.end?e.end:Number(new Date(e.end)),p=w+y.calculateLeftPosition(s,p,e.start,s.rect),d=s.multiLevelPosition[r].x,c=w+y.calculateWidth(s,e.start,c,s.rect);var i=y.heatMap.enableHtmlSanitizer?go.sanitize(e.text):e.text,n=(u=b7t(i,o.textStyle),m=(null===e.maximumTextWidth?Math.abs(d):e.maximumTextWidth)-10,Math.abs(d-(d-s.multiLevelSize[r].width-20))/2-u.width/2),n=(l=(s.opposedPosition?d:d-s.multiLevelSize[r].width-20)+n,h=p+10,"None"!==o.overflow&&(f="Wrap"===o.overflow?r9t(i,m,o.textStyle):s9t(m,i,o.textStyle)),"Center"===o.alignment?h+=(c-p)/2-f.length*u.height/2:h="Far"===o.alignment?v?c-u.height/2:h-u.height:v?h+u.height/2:c+u.height,0<o.border.width&&"WithoutBorder"!==o.border.type&&(b=y.renderYAxisLabelBorder(r,s,d,p,c,b,r,u,m,h)),new W7t(l,h,"start",y.heatMap.enableHtmlSanitizer?go.sanitize(e.text):e.text,0,"translate(0,0)")),i=new H7t(y.heatMap.element.id+"_YAxis_MultiLevel"+r+"_Text"+t,n,o.textStyle,o.textStyle.color||y.heatMap.themeStyle.axisLabel);i.text=f,y.drawSvgCanvas.createText(i,g,i.text),-1!==i.text.indexOf("...")&&y.heatMap.tooltipCollection.push(new m9t(e.text,new _7t(l,h-u.height,m,u.height))),y.heatMap.enableCanvasRendering||a.appendChild(g)}),""!==b&&(y.createBorderElement(r,s,b,a),b="")}),this.heatMap.enableCanvasRendering||a.appendChild(g)},B9t.prototype.renderYAxisLabelBorder=function(e,t,i,n,o,r,s,a,l,h){var d=i-(t.opposedPosition?-(t.multiLevelSize[e].width+20):t.multiLevelSize[e].width+20);switch(t.multiLevelLabels[s].border.type){case"Rectangle":r+="M "+i+" "+n+" L "+d+" "+n+" L "+d+" "+o+" L "+i+" "+o+" L "+i+" "+n+" ";break;case"WithoutTopBorder":r+="M "+i+" "+n+" L "+d+" "+n+" L "+d+" "+o+" L "+i+" "+o+" ";break;case"WithoutBottomBorder":r+="M "+d+" "+n+" L "+i+" "+n+" L "+i+" "+o+" L "+d+" "+o+" ";break;case"WithoutTopandBottomBorder":r+="M "+i+" "+n+" L "+d+" "+n+" M "+i+" "+o+" L "+d+" "+o+" ";break;case"Brace":r+="M "+i+" "+n+" L "+(i+(d-i)/2)+" "+n+" L "+(i+(d-i)/2)+" "+(t.isInversed?h-10-5:h+a.height-10)+" M "+(i+(d-i)/2)+" "+(t.isInversed?h+a.height-10:h-10-5)+" L "+(i+(d-i)/2)+" "+o+" L "+i+" "+o+" "}return r},B9t.prototype.createBorderElement=function(e,t,i,n){var o="Horizontal"===t.orientation?"XAxis":"YAxis",o=new I7t(this.heatMap.element.id+"_"+o+"_MultiLevel_Rect_"+e,"Transparent",t.multiLevelLabels[e].border.width,t.multiLevelLabels[e].border.color,1,"",i),t=this.heatMap.renderer.drawPath(o);this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.drawPath(o,void 0):n.appendChild(t)},B9t.prototype.calculateLeftPosition=function(e,t,i,n){var o;return i="number"==typeof i?("Numeric"===e.valueType&&(e.minimum||e.maximum)&&(t-=e.minimum||0),o=("Horizontal"===e.orientation?n.width:n.height)/(e.axisLabelSize*e.increment),(e.isInversed?-1:1)*t*o):(o=this.calculateNumberOfDays(t,e,!0,n),e.isInversed?-o:o),i="Horizontal"===e.orientation?i:-i},B9t.prototype.calculateWidth=function(e,t,i,n){var o,r;return r="number"==typeof t?("Numeric"===e.valueType&&(e.minimum||e.maximum)&&(i-=e.minimum||0),o=("Horizontal"===e.orientation?n.width:n.height)/(e.axisLabelSize*e.increment),(e.isInversed?-1:1)*(i+1)*o):(r=o=this.calculateNumberOfDays(i,e,!1,n),e.isInversed?-r:r),r="Horizontal"===e.orientation?r:-r},B9t.prototype.calculateNumberOfDays=function(e,t,i,n){for(var o=t.labelValue,r=("Horizontal"===t.orientation?n.width:n.height)/t.axisLabelSize,s=new Date(Number(e)),a=0,l=0;l<t.axisLabelSize;l++){var h,d=new Date(Number(o[l]));if(h=t.isInversed?new Date(Number(o[l-1])):new Date(Number(o[l+1])),l===(t.isInversed?0:t.axisLabelSize-1)&&(h=new Date(Number(o[l])),h="Hours"===t.intervalType?new Date(Number(h.setHours(h.getHours()+1))):"Minutes"===t.intervalType?new Date(Number(h.setMinutes(h.getMinutes()+1))):"Days"===t.intervalType?new Date(Number(h.setDate(h.getDate()+1))):(c="Months"===t.intervalType?new Date(h.getFullYear(),h.getMonth()+1,0).getDate():h.getFullYear()%4==0?366:365,new Date(Number(h.setDate(h.getDate()+c))))),Number(d)<=e&&Number(h)>=e){if("Minutes"===t.intervalType||"Hours"===t.intervalType){var a=r/Math.round(Math.abs((d.getTime()-h.getTime())/6e4))*Math.abs((d.getTime()-s.getTime())/6e4),p=(l=t.isInversed?t.axisLabelSize-1-l:l)*r+a;break}var c=Math.round(Math.abs((d.getTime()-h.getTime())/864e5));i?s.getDate():s.setDate(s.getDate()+1),0!==c&&(a=r/c*Math.abs((d.getTime()-s.getTime())/864e5)),p=(l=t.isInversed?t.axisLabelSize-1-l:l)*r+a;break}}return p},B9t.prototype.destroy=function(){this.drawSvgCanvas=null,this.element=null,this.htmlObject=null,this.initialClipRect=null,this.heatMap=null};var P9t=B9t;function B9t(e){this.heatMap=e,this.padding=10,this.drawSvgCanvas=new e9t(e)}F9t=function(e,t){return(F9t=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])}))(e,t)};var F9t,L9t,Xet=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},TH=(function(e,t){function i(){this.constructor=e}F9t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(R9t,L9t=n),Xet([e("")],R9t.prototype,"labelTemplate",void 0),Xet([e(!0)],R9t.prototype,"showLabel",void 0),Xet([e("")],R9t.prototype,"format",void 0),Xet([e(!0)],R9t.prototype,"enableCellHighlighting",void 0),Xet([t({},D2t)],R9t.prototype,"bubbleSize",void 0),Xet([t({},Qmt)],R9t.prototype,"border",void 0),Xet([t(dLi.rectLabelFont,o2t)],R9t.prototype,"textStyle",void 0),Xet([e("Rect")],R9t.prototype,"tileType",void 0),Xet([e("Color")],R9t.prototype,"bubbleType",void 0),Xet([e(!1)],R9t.prototype,"isInversedBubbleSize",void 0),R9t);function R9t(){return null!==L9t&&L9t.apply(this,arguments)||this}N9t.prototype.renderRectSeries=function(){this.createSeriesGroup();for(var e,t,i=this.heatMap,n=!1,o=(i.xLength=i.axisCollections[0].axisLabelSize,i.yLength=i.axisCollections[1].axisLabelSize,Math.round(100*i.initialClipRect.x)/100),r=Math.round(100*i.initialClipRect.y)/100,s=0,a=0,l=i.cellSettings,h=Math.round((i.initialClipRect.width-l.border.width/2)/i.xLength*100)/100,d=Math.round((i.initialClipRect.height-l.border.width/2)/i.yLength*100)/100,p=0,c=[],u=l.border,g=null,m=(this.rectPositionCollection=[],this.color="",this.bubbleColorValue=[],i.yAxis.opposedPosition&&(o=Math.round(100*(i.initialClipRect.x+parseFloat(u.width.toString())/2))/100),je(this.heatMap.cellSettings.labelTemplate)||""===this.heatMap.cellSettings.labelTemplate||(document.getElementById(this.heatMap.element.id+"_LabelTemplate_Group")&&p9t(this.heatMap.element.id+"_LabelTemplate_Group"),g=Q("div",{id:i.element.id+"_LabelTemplate_Group"})),this.getBubbleRadius(h,d)),f=0;f<i.xLength*i.yLength;f++){"Column"===i.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type?(this.heatMap.dataSourceMinValue=this.heatMap.dataMin[a],this.heatMap.dataSourceMaxValue=this.heatMap.dataMax[a]):"Row"===i.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type&&(this.heatMap.dataSourceMinValue=this.heatMap.dataMin[s],this.heatMap.dataSourceMaxValue=this.heatMap.dataMax[s]),this.setTextAndColor(s,a);var y,v,b=new P7t(0,0,0,0,0,"",0,0,0,0,!0,"","",!0),w=u.color;this.heatMap.bubbleSizeWithColor?this.updateRectDetails(b,o,r,h,d,Pe("",this.bubbleColorValue,null,!0),f,a,s):this.updateRectDetails(b,o,r,h,d,this.text,f,a,s),l.showLabel?je(this.heatMap.cellSettings.labelTemplate)||""===this.heatMap.cellSettings.labelTemplate?e=this.getFormatedText(this.text,l.format):"number"==typeof(y=i.dataSourceSettings.bubbleDataMapping&&i.dataSourceSettings.isJsonData&&"Cell"===i.dataSourceSettings.adaptorType&&!je(b.value[0])?b.value[0].bubbleData:b.value)&&"#ffffff"!==this.cellColor.getColorByValue(y)&&E7t(this.heatMap.cellSettings.labelTemplate,i,g,b,i.axisCollections[0].axisLabels,i.axisCollections[1].axisLabels.slice().reverse(),f):e="",b.displayText=e,i.enableHtmlSanitizer&&(e=go.sanitize(e)),je(this.heatMap.cellRender)||(e=this.cellRendering(b,e)),("Canvas"===i.renderingMode&&0===parseFloat(u.width.toString())||!w&&"Bubble"===l.tileType&&"Sector"===l.bubbleType)&&(w=this.color),"Rect"===l.tileType?(this.renderTileCell(b,u,f,this.color,w),this.updateLabelVisibleStatus(h,d,e)):"Color"===l.bubbleType?(this.renderBubbleCell(b,u,f,this.color,w,m),this.updateLabelVisibleStatus(2*m-12,2*m-6,e)):je(this.text)||"Size"!==l.bubbleType&&"SizeAndColor"!==l.bubbleType||""===this.text.toString()?"Sector"!==l.bubbleType||je(this.text)||""===this.text.toString()||(this.renderSectorCell(b,u,f.toString(),this.color,w,m,this.text),this.checkLabelXDisplay=!1,this.checkLabelYDisplay=!1):("Table"!==this.heatMap.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type&&(this.heatMap.minColorValue=isFinite(this.heatMap.minColorValue)?this.heatMap.minColorValue:this.heatMap.dataSourceMinValue,this.heatMap.maxColorValue=isFinite(this.heatMap.maxColorValue)?this.heatMap.maxColorValue:this.heatMap.dataSourceMaxValue),t=this.getRadiusBypercentage(parseFloat(this.text.toString()),i.dataSourceMinValue,i.dataSourceMaxValue,m),this.renderBubbleCell(b,u,f,this.color,w,t),this.updateLabelVisibleStatus(2*t-12,2*t-6,e)),c.push(b),i.rangeSelection&&"Fixed"===i.paletteSettings.type&&(n=this.isCellValueInRange(s,a),b.visible=n),l.showLabel&&this.checkLabelYDisplay&&this.checkLabelXDisplay&&(y=l.textStyle,w=new H7t(i.element.id+"_HeatMapRectLabels_"+f,new W7t(Math.round(100*(o+h/2))/100,Math.round(100*(r+d/2))/100,"middle",e,null,null,"middle"),y,y.color||this.getSaturatedColor(this.color)),b.textId=w.id,i.rangeSelection&&"Fixed"===i.paletteSettings.type&&(w.fill=n?w.fill:this.heatMap.themeStyle.toggledColor),F.isIE&&!i.enableCanvasRendering&&(w.dy="Bubble"===this.heatMap.cellSettings.tileType?"0.5ex":"1ex"),"Wrap"===this.heatMap.cellSettings.textStyle.textOverflow?(b="Bubble"===l.tileType?"Size"===l.bubbleType||"SizeAndColor"===l.bubbleType?2*t-12:"Color"===l.bubbleType?2*m-12:h:h,v="Bubble"===l.tileType?"Size"===l.bubbleType||"SizeAndColor"===l.bubbleType?2*t-6:"Color"===l.bubbleType?2*m-6:d:d,w.text=r9t(e,b,this.heatMap.cellSettings.textStyle,!0),this.updateLabelText(v,b,w),v=parseInt(this.heatMap.cellSettings.textStyle.size,10)*(w.text.length-1),w.y=1<w.text.length?Math.round(r+(d-v)/2):w.y,this.drawSvgCanvas.createWrapText(w,l.textStyle,this.containerTextObject)):this.drawSvgCanvas.createText(w,this.containerTextObject,e)),p===i.xLength-1?(r=Math.round(100*(r+d))/100,a=p=0,o=i.yAxis.opposedPosition?Math.round(100*(i.initialClipRect.x+parseFloat(u.width.toString())/2))/100:Math.round(100*i.initialClipRect.x)/100,this.rectPositionCollection.push(c),c=[],s++):(o=Math.round(100*(o+h))/100,p++,a++)}je(g)||document.getElementById(this.heatMap.element.id+"_Secondary_Element").appendChild(g),i.enableCanvasRendering||(i.svgObject.appendChild(this.containerRectObject),!l.showLabel)||"Bubble"===l.tileType&&"Sector"===l.bubbleType||i.svgObject.appendChild(this.containerTextObject)},N9t.prototype.isCellValueInRange=function(e,t){for(var i=!1,n=0;n<this.heatMap.toggleValue.length;n++){var o=void 0,r=0!==n||this.heatMap.isColorRange?this.heatMap.isColorRange?this.heatMap.toggleValue[n].startValue:this.heatMap.toggleValue[n].value:this.heatMap.dataSourceMinValue,o="Bubble"===this.heatMap.cellSettings.tileType&&"SizeAndColor"===this.heatMap.cellSettings.bubbleType?n===this.heatMap.toggleValue.length-1?this.heatMap.maxColorValue:this.heatMap.toggleValue[n+1].value-.01:n!==this.heatMap.toggleValue.length-1||this.heatMap.isColorRange?this.heatMap.isColorRange?this.heatMap.toggleValue[n].endValue:this.heatMap.toggleValue[n+1].value-.01:this.heatMap.dataSourceMaxValue,s=this.heatMap.clonedDataSource,s=je(s[e][t][1])||""===s[e][t][1].toString()?"":s[e][t][1],s=parseFloat(("Bubble"===this.heatMap.cellSettings.tileType&&"SizeAndColor"===this.heatMap.cellSettings.bubbleType?s:this.text).toString());if(isNaN(s))i=!0;else{if(!isNaN(s)&&r<=s&&s<=o){if(this.heatMap.toggleValue[n].visible){i=!0;break}i=!1;break}if(this.heatMap.isColorRange&&o>=this.heatMap.toggleValue[n].endValue&&n===this.heatMap.toggleValue.length-1){i=!0;break}}}return i},N9t.prototype.cellRendering=function(e,t){var i=this.heatMap.axisCollections[0],n=this.heatMap.axisCollections[1],o=i.tooltipLabels,r=n.tooltipLabels.slice().reverse(),n=n.labelValue.slice().reverse(),o={heatmap:this.heatMap,cancel:!1,name:"cellRender",value:e.value,xLabel:o[e.xIndex].toString(),yLabel:r[e.yIndex].toString(),displayText:t,xValue:i.labelValue[e.xIndex],yValue:n[e.yIndex],cellColor:this.color};return this.heatMap.trigger("cellRender",o),this.color=o.cellColor,o.displayText},N9t.prototype.setTextAndColor=function(e,t){this.bubbleColorValue=[];var i,n=this.heatMap.dataSourceSettings,o=this.heatMap.clonedDataSource;this.heatMap.bubbleSizeWithColor?(this.text=je(o[e][t][0])||""===o[e][t][0].toString()?"":o[e][t][0],this.color=je(o[e][t][1])||""===o[e][t][1].toString()?this.heatMap.isColorValueExist?this.heatMap.emptyPointColor:this.cellColor.getColorByValue(this.text):this.cellColor.getColorByValue(o[e][t][1]),i=new l7t(n.isJsonData&&"Cell"===n.adaptorType?n.bubbleDataMapping.size:null,this.text,"Size"),this.bubbleColorValue.push(i),this.bubbleColorValue.push({mappingName:n.isJsonData&&"Cell"===n.adaptorType?n.bubbleDataMapping.color:null,bubbleData:je(o[e][t][1])||""===o[e][t][1].toString()?"":o[e][t][1],valueType:"Color"})):(this.text=o[e][t],this.color=this.cellColor.getColorByValue(this.text))},N9t.prototype.createSeriesGroup=function(){this.heatMap.enableCanvasRendering||(this.containerRectObject=this.heatMap.renderer.createGroup({id:this.heatMap.element.id+"_Container_RectGroup"}),!this.heatMap.cellSettings.showLabel)||"Bubble"===this.heatMap.cellSettings.tileType&&"Sector"===this.heatMap.cellSettings.bubbleType||(this.containerTextObject=this.heatMap.renderer.createGroup({id:this.heatMap.element.id+"_Container_TextGroup",transform:"translate( 0, 0)"}))},N9t.prototype.updateRectDetails=function(e,t,i,n,o,r,s,a,l){e.x=t,e.y=i,e.width=n,e.height=o,e.value=r,e.id=this.heatMap.element.id+"_HeatMapRect_"+s,e.xIndex=a,e.yIndex=l},N9t.prototype.renderTileCell=function(e,t,i,n,o){i=new F7t(this.heatMap.element.id+"_HeatMapRect_"+i,n,t,1,new _7t(e.x,e.y,e.width,e.height),o||this.heatMap.themeStyle.cellBorder,t.radius,t.radius);this.drawSvgCanvas.drawRectangle(i,this.containerRectObject,!0)},N9t.prototype.getBubbleRadius=function(e,t){t=t/2<e/2?t/2-2:e/2-2;return t<0?0:t},N9t.prototype.renderSectorCell=function(e,t,i,n,o,r,s){for(var a,l,h,d,p,c,u,g,m=Math.round(100*(e.x+e.width/2))/100,f=Math.round(100*(e.y+e.height/2))/100,y=n,v=this.getRadiusBypercentage(s,this.heatMap.dataSourceMinValue,this.heatMap.dataSourceMaxValue,360),b=0;b<2;b++){g=parseFloat(t.width.toString()),0===b?(a=180<=v?1:0,l=-90,h=0===v?270:v-90,d=Math.round(100*(m+r*Math.cos((v-90)*(Math.PI/180))))/100,p=Math.round(100*(f+r*Math.sin((v-90)*(Math.PI/180))))/100,c=Math.round(100*m)/100,u=Math.round(100*(f-r))/100,0===v&&(y=this.heatMap.emptyPointColor)):(a=180<=v?0:1,l=h,h=270,y=this.heatMap.emptyPointColor,i+="_Unfilled",w=d,C=p,d=c,p=u,c=w,u=C,0===v&&(g=1,o=n));var w=new K7t("",!1,m,f,c,u,d,p,l,h,r,!0),C=new Y7t(this.heatMap.element.id+"_HeatMapRect_"+i,w,y,t,g,1,o);if(this.calculateShapes(C,w,v,a),this.drawSvgCanvas.drawPath(C,w,this.containerRectObject),360===v)break}},N9t.prototype.calculateShapes=function(e,t,i,n){switch(i){case 360:case 0:I(e,{d:0===i&&t.start===t.end?"M "+e.x+" "+e.y+" L "+t.x+" "+(t.y-t.radius):(this.heatMap.enableCanvasRendering?"":"M "+e.x+" "+e.y+" ")+"m "+-t.radius+" 0 a "+t.radius+" "+t.radius+" 0 1 0 "+2*t.radius+" 0 a "+t.radius+" "+t.radius+" 0 1 0 "+-2*t.radius+" 0 "});break;default:I(e,{d:"M "+e.x+" "+e.y+" L "+t.x1+" "+t.y1+" A "+t.radius+" "+t.radius+" 0 "+n+" 1 "+t.cx+" "+t.cy+" Z"})}},N9t.prototype.renderBubbleCell=function(e,t,i,n,o,r){i=new O7t(this.heatMap.element.id+"_HeatMapRect_"+i,n,t,1,o||this.heatMap.themeStyle.cellBorder,Math.round(100*(e.x+e.width/2))/100,Math.round(100*(e.y+e.height/2))/100,r);this.drawSvgCanvas.drawCircle(i,this.containerRectObject)},N9t.prototype.updateLabelText=function(e,t,i){for(var n=0;n<i.text.length;n++)if(e<parseInt(this.heatMap.cellSettings.textStyle.size,10)*(n+1)+10){if(i.text=i.text.slice(0,n),0<n&&"..."!==i.text[n-1].slice(-3)){var o=i.text.slice(0,n-1),r=s9t(t,i.text[n-1]+"...",this.heatMap.cellSettings.textStyle);o.push(r),i.text=o;break}break}},N9t.prototype.updateLabelVisibleStatus=function(e,t,i){this.heatMap.cellSettings.showLabel&&(je(this.heatMap.cellSettings.labelTemplate)||""===this.heatMap.cellSettings.labelTemplate)&&(this.checkLabelYDisplay=t>parseInt(this.heatMap.cellSettings.textStyle.size,10),this.checkLabelXDisplay=e>i.length*(parseInt(this.heatMap.cellSettings.textStyle.size,10)/2)||"Wrap"===this.heatMap.cellSettings.textStyle.textOverflow)},N9t.prototype.getRadiusBypercentage=function(e,t,i,n){var o=parseInt(this.heatMap.cellSettings.bubbleSize.minimum,10),r=parseInt(this.heatMap.cellSettings.bubbleSize.maximum,10),e=((o<0||100<o||isNaN(o))&&(o=0),(r<0||100<r||isNaN(r))&&(r=100),(e-t)/(i-t)*100),e=isNaN(e)?100:e;return n*=(e=this.heatMap.bubbleSizeWithColor||"Bubble"===this.heatMap.cellSettings.tileType&&"Size"===this.heatMap.cellSettings.bubbleType?(e=this.heatMap.cellSettings.isInversedBubbleSize?100-e:e)*(r-o)/100+o:e)/100,Math.round(100*n)/100<0?0:Math.round(100*n)/100},N9t.prototype.getSaturatedColor=function(e){var t=e,e=I9t(S9t("transparent"===e?window.getComputedStyle(document.body,null).backgroundColor:t));return 128<=Math.round((299*e.R+587*e.G+114*e.B)/1e3)?"black":"white"},N9t.prototype.highlightSvgRect=function(e){var t,i;-1===e.indexOf("Celltooltip")&&(-1!==e.indexOf("_HeatMapRect")?(-1!==e.indexOf("_HeatMapRectLabels_")&&(t=e.indexOf("_HeatMapRectLabels_")+19,e=this.heatMap.element.id+"_HeatMapRect_"+e.slice(t)),t=document.getElementById(e),this.heatMap.tempRectHoverClass!==e&&(this.heatMap.cellSettings.enableCellHighlighting&&(i=void 0,(i=this.heatMap.tempRectHoverClass?document.getElementById(this.heatMap.tempRectHoverClass):i)&&!this.heatMap.rectSelected&&i.setAttribute("opacity","1"),t)&&!this.heatMap.rectSelected&&t.setAttribute("opacity","0.65"),this.heatMap.tempRectHoverClass=e)):this.heatMap.cellSettings.enableCellHighlighting&&(i=void 0,i=this.heatMap.tempRectHoverClass?document.getElementById(this.heatMap.tempRectHoverClass):i)&&!this.heatMap.rectSelected&&(i.setAttribute("opacity","1"),this.heatMap.tempRectHoverClass=""))},N9t.prototype.getFormatedText=function(e,t){var i=null!==t.match("{value}"),n=(this.format=this.heatMap.intl.getNumberFormat({format:i?"":t}),"");return n=""!==e.toString()?T9t(i,t,e,this.format):n},N9t.prototype.getCurrentRect=function(e,t){var i=[],e=(i.push(this.heatMap.heatMapSeries.rectPositionCollection[0][0]),Math.ceil((e-i[0].x)/i[0].width)<this.heatMap.axisCollections[0].axisLabelSize?Math.ceil((e-i[0].x)/i[0].width):this.heatMap.axisCollections[0].axisLabelSize),t=Math.floor((t-i[0].y)/i[0].height)<this.heatMap.axisCollections[1].axisLabelSize?Math.floor((t-i[0].y)/i[0].height):this.heatMap.axisCollections[1].axisLabelSize-1,i=this.heatMap.heatMapSeries.rectPositionCollection[t][(e=0===e?1:e)-1];return this.hoverXAxisLabel=this.heatMap.axisCollections[0].tooltipLabels[e-1],this.hoverXAxisValue=this.heatMap.axisCollections[0].labelValue[e-1],this.hoverYAxisLabel=this.heatMap.axisCollections[1].tooltipLabels[this.heatMap.axisCollections[1].tooltipLabels.length-1-t],this.hoverYAxisValue=this.heatMap.axisCollections[1].labelValue[this.heatMap.axisCollections[1].labelValue.length-1-t],i},N9t.prototype.destroy=function(){je(this.cellColor)||this.cellColor.destroy(),this.cellColor=null,this.bubbleColorValue=null,this.containerRectObject=null,this.containerTextObject=null,this.drawSvgCanvas=null,this.format=null,this.hoverXAxisValue=null,this.hoverYAxisValue=null,this.rectPositionCollection=null,this.heatMap=null};var O9t=N9t;function N9t(e){this.heatMap=e,this.drawSvgCanvas=new e9t(this.heatMap),this.cellColor=new m7t(this.heatMap)}V9t=function(e,t){return(V9t=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])}))(e,t)};var V9t,_9t,e_=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},W$e=(function(e,t){function i(){this.constructor=e}V9t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(H9t,_9t=n),e_([e("")],H9t.prototype,"template",void 0),e_([e("")],H9t.prototype,"fill",void 0),e_([t({},ost)],H9t.prototype,"border",void 0),e_([t(dLi.tooltipFont,o2t)],H9t.prototype,"textStyle",void 0),H9t);function H9t(){return null!==_9t&&_9t.apply(this,arguments)||this}z9t.prototype.getModuleName=function(){return"Tooltip"},z9t.prototype.showHideTooltip=function(e,t){var i;je(this.heatMap)||(i=document.getElementById(this.heatMap.element.id+"Celltooltipcontainer"),e?i.style.visibility="visible":(je(i)||"hidden"===i.style.visibility||(!je(this.tooltipObject)&&t&&this.heatMap.isRectBoundary?this.tooltipObject.fadeOut():je(this.tooltipObject)||je(this.tooltipObject.element)||this.tooltipObject.element.firstChild.setAttribute("opacity","0"),i.style.visibility="hidden"),this.isFadeout=!0))},z9t.prototype.destroy=function(){je(this.tooltipObject)||(this.tooltipObject.destroy(),this.tooltipObject.controlInstance=null,p9t(this.heatMap.element.id+"Celltooltipcontainer")),this.tooltipObject=null,this.heatMap=null},z9t.prototype.createTooltip=function(e,t,i,n){var o=null,r=ge("#"+this.heatMap.element.id+"Celltooltipcontainer");this.heatMap.cellSettings.showLabel&&this.heatMap.heatMapSeries.checkLabelXDisplay&&this.heatMap.heatMapSeries.checkLabelYDisplay&&(o=parseInt(this.heatMap.cellSettings.textStyle.size,10)/2),"Tailwind"!==this.heatMap.theme&&"Tailwind3"!==this.heatMap.theme||this.heatMap.setProperties({tooltipSettings:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}}},!0),"TailwindDark"!==this.heatMap.theme&&"Tailwind3Dark"!==this.heatMap.theme||this.heatMap.setProperties({tooltipSettings:{fill:"#F9FAFB",textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500",color:"#1F2937"}}},!0),"Bootstrap5"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#000000",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#FFFFFF"}}},!0),"Bootstrap5Dark"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#FFFFFF",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#212529"}}},!0),"Fluent"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{textStyle:{size:"12px",fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif',fontWeight:"500"}}},!0),"FluentDark"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#252423",textStyle:{size:"12px",fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif',fontWeight:"500",color:"#F3F2F1"}}},!0),"Material3"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#313033",textStyle:{size:"14px",fontFamily:"Roboto",fontWeight:"400",color:"#F4EFF4"}}},!0),"Material3Dark"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#E6E1E5",textStyle:{size:"14px",fontFamily:"Roboto",fontWeight:"400",color:"#313033"}}},!0),"Fluent2"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#FFFFFF",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#242424"}}},!0),"Fluent2Dark"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#292929",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#FFFFFF"}}},!0),"Fluent2HighContrast"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#000000",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#FFFFFF"},border:{width:1,color:"#FFF"}}},!0),this.tooltipObject=new tr({opacity:"Tailwind"===this.heatMap.theme||"Tailwind3"===this.heatMap.theme||"TailwindDark"===this.heatMap.theme||"Tailwind3Dark"===this.heatMap.theme||"Bootstrap5"===this.heatMap.theme||"Bootstrap5Dark"===this.heatMap.theme||"Fluent"===this.heatMap.theme||"FluentDark"===this.heatMap.theme||"Fluent2"===this.heatMap.theme||"Fluent2Dark"===this.heatMap.theme||"Fluent2HighContrast"===this.heatMap.theme?1:.75,enableAnimation:!1,offset:o,location:{x:t,y:i},availableSize:this.heatMap.availableSize,data:{xValue:this.heatMap.heatMapSeries.hoverXAxisValue,yValue:this.heatMap.heatMapSeries.hoverYAxisValue,value:e.value,xLabel:this.heatMap.heatMapSeries.hoverXAxisLabel?this.heatMap.heatMapSeries.hoverXAxisLabel.toString():null,yLabel:this.heatMap.heatMapSeries.hoverYAxisLabel?this.heatMap.heatMapSeries.hoverYAxisLabel.toString():null},theme:this.heatMap.theme,content:n,fill:this.heatMap.tooltipSettings.fill,enableShadow:!0,template:""===this.heatMap.tooltipSettings.template?null:this.heatMap.tooltipSettings.template,border:{width:this.heatMap.tooltipSettings.border.width,color:this.heatMap.tooltipSettings.border.color},textStyle:{size:this.heatMap.tooltipSettings.textStyle.size,fontWeight:this.heatMap.tooltipSettings.textStyle.fontWeight.toLowerCase(),color:this.heatMap.tooltipSettings.textStyle.color,fontStyle:this.heatMap.tooltipSettings.textStyle.fontStyle.toLowerCase(),fontFamily:this.heatMap.tooltipSettings.textStyle.fontFamily},areaBounds:{height:this.heatMap.initialClipRect.height+this.heatMap.initialClipRect.y,width:this.heatMap.initialClipRect.width,x:this.heatMap.initialClipRect.x}},r)},z9t.prototype.createTooltipDiv=function(e){var e=e.enableCanvasRendering&&e.allowSelection?e.availableSize.height:0,t=Q("div",{id:this.heatMap.element.id+"Celltooltipcontainer"}),e=(t.style.cssText="position:absolute; z-index: 3;top:-"+e+"px",Q("div",{id:this.heatMap.element.id+"Celltooltipparent"}));e.style.position="relative",e.appendChild(t),this.heatMap.element.appendChild(e)},z9t.prototype.getTooltipContent=function(e,t){var i,n,o,r=this.heatMap,s=this.heatMap.dataSourceSettings;return n9t(r.bubbleSizeWithColor?(i=r.xAxis.title&&""!==r.xAxis.title.text?r.xAxis.title.text:"X-Axis",r=r.yAxis.title&&""!==r.yAxis.title.text?r.yAxis.title.text:"Y-Axis",n=s.isJsonData&&"Cell"===s.adaptorType?s.bubbleDataMapping.size:"Value 1",s=s.isJsonData&&"Cell"===s.adaptorType?s.bubbleDataMapping.color:"Value 2",o=t.getFormatedText(e.value[0].bubbleData,this.heatMap.cellSettings.format),[i+" : "+t.hoverXAxisLabel+"<br/>"+r+" : "+t.hoverYAxisLabel+"<br/>"+n+" : "+o+"<br/>"+s+" : "+t.getFormatedText(e.value[1].bubbleData,this.heatMap.cellSettings.format)]):(o=e.value,[t.hoverXAxisLabel+" | "+t.hoverYAxisLabel+" : "+t.getFormatedText(o,this.heatMap.cellSettings.format)]),this.heatMap.enableHtmlSanitizer)},z9t.prototype.renderTooltip=function(t){var i=this,e=this.heatMap.heatMapSeries,n=[""];(this.heatMap.bubbleSizeWithColor?!je(t.value)&&!je(t.value[0].bubbleData)&&""!==t.value[0].bubbleData.toString():!(je(t.value)||!je(t.value)&&""===t.value.toString()))?je(this.heatMap.tooltipRender)?(n=this.getTooltipContent(t,e),this.tooltipCallback(t,n)):(e=this.getTooltipContent(t,e),e={heatmap:this.heatMap,cancel:!1,name:"tooltipRender",value:t.value,xValue:this.heatMap.heatMapSeries.hoverXAxisValue,yValue:this.heatMap.heatMapSeries.hoverYAxisValue,xLabel:this.heatMap.heatMapSeries.hoverXAxisLabel?this.heatMap.heatMapSeries.hoverXAxisLabel.toString():null,yLabel:this.heatMap.heatMapSeries.hoverYAxisLabel?this.heatMap.heatMapSeries.hoverYAxisLabel.toString():null,content:e},this.heatMap.trigger("tooltipRender",e,function(e){e.cancel?i.tooltipObject&&i.showHideTooltip(!1):(n=e.content,i.tooltipCallback(t,n))})):(this.showHideTooltip(!1,!1),t.visible||this.showHideTooltip(!1,!1))},z9t.prototype.tooltipCallback=function(e,t){this.tooltipObject?(this.tooltipObject.content=t,this.tooltipObject.data={xValue:this.heatMap.heatMapSeries.hoverXAxisValue,yValue:this.heatMap.heatMapSeries.hoverYAxisValue,xLabel:this.heatMap.heatMapSeries.hoverXAxisLabel?this.heatMap.heatMapSeries.hoverXAxisLabel.toString():null,yLabel:this.heatMap.heatMapSeries.hoverYAxisLabel?this.heatMap.heatMapSeries.hoverYAxisLabel.toString():null,value:e.value}):this.createTooltip(e,e.x+e.width/2,e.y+e.height/2,t),(this.heatMap.isVue||this.heatMap.isVue3)&&(this.tooltipObject.controlInstance=this.heatMap),this.showHideTooltip(!0),this.tooltipObject.enableAnimation=!this.isFirst&&!this.isFadeout,this.isFirst=this.isFirst&&!1,this.isFadeout=this.isFadeout&&!1,this.tooltipObject.location.x=e.x+e.width/2,this.tooltipObject.location.y=e.y+e.height/2,e.visible||this.showHideTooltip(!1,!1)};i0=z9t;function z9t(e){this.isFirst=!0,this.isFadeout=!1,this.heatMap=e}W9t.prototype.processDataSource=function(e){var t,i,n=Pe([],e,null,!0),o=(this.heatMap.clonedDataSource=[],this.completeDataSource=[],this.heatMap.axisCollections),e=o[0].maxLength+1,r=o[0].axisLabelSize+(0<o[0].min?o[0].min:0),s=r<e?e:r,e=o[1].maxLength+1,a=(r=o[1].axisLabelSize+(0<o[1].min?o[1].min:0))<e?e:r,l=0,h=[];this.tempSizeArray=[],this.tempColorArray=[],this.heatMap.minColorValue=null,this.heatMap.maxColorValue=null,this.heatMap.dataMax=[],this.heatMap.dataMin=[],"Column"===this.heatMap.paletteSettings.colorGradientMode&&s<a&&(s=a);for(var d="Category"===o[1].valueType?o[1].min:0;d<("Column"===this.heatMap.paletteSettings.colorGradientMode?s:a);d++){var p="Category"===o[0].valueType?o[0].min:0;for(this.completeDataSource.push([]);p<s;)p>=o[0].min&&p<=o[0].max&&this.processDataArray(n,p,d,l),p++;if("Column"===this.heatMap.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type)for(var c=Pe([],n[l],null,!0),u=0;u<c.length;u++)"object"==typeof c[u]&&null!==c[u]&&(c[u]=c[u][0]);else c=Pe([],this.completeDataSource[l],null,!0);var g=this.getMinMaxValue(t,i,c);"Column"!==this.heatMap.paletteSettings.colorGradientMode&&"Row"!==this.heatMap.paletteSettings.colorGradientMode||"Gradient"!==this.heatMap.paletteSettings.type||(this.heatMap.dataMax[d]=g[1],this.heatMap.dataMin[d]=g[0]),t=g[0],i=g[1],this.heatMap.xAxis.isInversed&&(this.completeDataSource[l]=this.completeDataSource[l].reverse()),d>=this.heatMap.axisCollections[1].min&&d<=this.heatMap.axisCollections[1].max&&h.push(this.completeDataSource[l]),l++}"Row"!==this.heatMap.paletteSettings.colorGradientMode||this.heatMap.yAxis.isInversed||"Gradient"!==this.heatMap.paletteSettings.type||(this.heatMap.dataMax=this.heatMap.dataMax.reverse(),this.heatMap.dataMin=this.heatMap.dataMin.reverse()),"Column"===this.heatMap.paletteSettings.colorGradientMode&&this.heatMap.xAxis.isInversed&&"Gradient"===this.heatMap.paletteSettings.type&&(this.heatMap.dataMax=this.heatMap.dataMax.reverse(),this.heatMap.dataMin=this.heatMap.dataMin.reverse()),this.heatMap.yAxis.isInversed||(this.completeDataSource.reverse(),h.reverse()),this.heatMap.clonedDataSource=h,this.heatMap.dataSourceMinValue=je(t)?0:parseFloat(t.toString()),this.heatMap.dataSourceMaxValue=je(i)?0:parseFloat(i.toString()),this.heatMap.isColorValueExist=!je(this.heatMap.minColorValue),this.heatMap.minColorValue=je(this.heatMap.minColorValue)?this.heatMap.dataSourceMinValue:parseFloat(this.heatMap.minColorValue.toString()),this.heatMap.maxColorValue=je(this.heatMap.maxColorValue)?this.heatMap.dataSourceMaxValue:parseFloat(this.heatMap.maxColorValue.toString())},W9t.prototype.processDataArray=function(e,t,i,n){if(this.heatMap.bubbleSizeWithColor)if(e[t]&&!je(e[t][i])&&"object"==typeof e[t][i]){for(var o=e[t][i],r=0;r<o.length;r++)if((je(o[r])||isNaN(o[r]))&&(o[r]=""),0===r)this.tempSizeArray.push(o[r]);else if(1===r){this.tempColorArray.push(o[r]);break}this.completeDataSource[n].push(o)}else!je(e[t])&&(e[t][i]||0===e[t][i]&&""!==e[t][i].toString())?(this.completeDataSource[n].push([e[t][i]]),this.tempSizeArray.push(e[t][i])):this.completeDataSource[n].push("");else e[t]&&(e[t][i]||0===e[t][i]&&""!==e[t][i].toString())?"object"==typeof e[t][i]?0<e[t][i].length&&!je(e[t][i][0])?this.completeDataSource[n].push(e[t][i][0]):this.completeDataSource[n].push(""):this.completeDataSource[n].push(e[t][i]):this.completeDataSource[n].push("")},W9t.prototype.getMinMaxValue=function(e,t,i){var n=[];return this.heatMap.bubbleSizeWithColor?("Column"===this.heatMap.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type&&(this.tempSizeArray=i),n.push(this.getMinValue(e,this.tempSizeArray)),n.push(this.getMaxValue(t,this.tempSizeArray)),this.heatMap.minColorValue=this.getMinValue(this.heatMap.minColorValue,this.tempColorArray),this.heatMap.maxColorValue=this.getMaxValue(this.heatMap.maxColorValue,this.tempColorArray)):(n.push(this.getMinValue(e,i)),n.push(this.getMaxValue(t,i))),n},W9t.prototype.getMinValue=function(e,t){return(je(e)||this.performSort(t)<e||("Row"===this.heatMap.paletteSettings.colorGradientMode||"Column"===this.heatMap.paletteSettings.colorGradientMode)&&"Gradient"===this.heatMap.paletteSettings.type)&&(e=this.performSort(t)),je(e)?e:parseFloat(e.toString())},W9t.prototype.getMaxValue=function(e,t){return(je(e)&&0<t.length||Math.max.apply(Math,t)>e||("Row"===this.heatMap.paletteSettings.colorGradientMode||"Column"===this.heatMap.paletteSettings.colorGradientMode)&&"Gradient"===this.heatMap.paletteSettings.type)&&(e=Math.max.apply(Math,t)),je(e)?e:parseFloat(e.toString())},W9t.prototype.performSort=function(e){return e.sort(function(e,t){return e-t}).filter(this.checkmin)[0]},W9t.prototype.checkmin=function(e){return!je(e)&&""!==e.toString()},W9t.prototype.destroy=function(){this.completeDataSource=null,this.tempColorArray=null,this.tempSizeArray=null,this.heatMap=null};var j9t=W9t;function W9t(e){this.heatMap=e}Q9t=function(e,t){return(Q9t=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])}))(e,t)};var Q9t,U9t,Qg=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Fm=(function(e,t){function i(){this.constructor=e}Q9t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(q9t,U9t=n),Qg([e("")],q9t.prototype,"height",void 0),Qg([e("")],q9t.prototype,"width",void 0),Qg([t({text:"",textStyle:dLi.titleFont},f2t)],q9t.prototype,"title",void 0),Qg([e("Right")],q9t.prototype,"position",void 0),Qg([e(!0)],q9t.prototype,"visible",void 0),Qg([e("Center")],q9t.prototype,"alignment",void 0),Qg([e(!0)],q9t.prototype,"showLabel",void 0),Qg([e(!0)],q9t.prototype,"showGradientPointer",void 0),Qg([e(!1)],q9t.prototype,"enableSmartLegend",void 0),Qg([e("All")],q9t.prototype,"labelDisplayType",void 0),Qg([t(dLi.legendLabelFont,o2t)],q9t.prototype,"textStyle",void 0),Qg([e("")],q9t.prototype,"labelFormat",void 0),Qg([e(!0)],q9t.prototype,"toggleVisibility",void 0),q9t);function q9t(){return null!==U9t&&U9t.apply(this,arguments)||this}G9t.prototype.getModuleName=function(){return"Legend"},G9t.prototype.destroy=function(){je(this.tooltipObject)||this.tooltipObject.destroy(),this.tooltipObject=null,this.drawSvgCanvas=null,this.format=null,this.gradientPointer=null,this.labelCollection=null,this.labelCollections=null,this.lastList=null,this.legend=null,this.legendGroup=null,this.legendRect=null,this.legendRectPositionCollection=null,this.legendRectScale=null,this.legendScale=null,this.legendXCollections=null,this.legendYCollections=null,this.maxLegendLabelSize=null,this.navigationCollections=null,this.pagingRect=null,this.paginggroup=null,this.segmentCollections=null,this.segmentCollectionsLabels=null,this.textWrapCollections=null,this.translategroup=null,this.visibilityCollections=null,this.fillRect=null,this.legendLabelTooltip=null,this.legendRange=[],this.legendTextRange=[],this.legendTitleTooltip=null,this.previousOptions=null,this.heatMap=null},G9t.prototype.renderLegendItems=function(){var e=this.heatMap,t=(e.toggleValue=[],{color:"transparent",width:0}),i=(this.legend=e.renderer.createGroup({id:e.element.id+"_Heatmap_Legend"}),new F7t(e.element.id+"_LegendBound","none",t,1,this.legendGroup)),i=(this.drawSvgCanvas.drawRectangle(i,this.legend),this.legendRectScale),n=e.canvasRenderer.ctx,o=new _7t(i.x,i.y,i.width,i.height);if("Fixed"===e.paletteSettings.type){var r=e.legendSettings.enableSmartLegend?e.legendColorCollection:e.colorCollection;this.legendRange=e.resizing||!e.legendOnLoad&&e.rendering?[]:this.legendRange,this.legendTextRange=e.resizing||!e.legendOnLoad&&e.rendering?[]:this.legendTextRange,e.enableCanvasRendering&&(n.save(),n.clip());for(var s=0;s<r.length;s++){var a=!!je(this.visibilityCollections[s])||this.visibilityCollections[s];e.toggleValue.push(new C9t(a,r[s].value,r[s].startValue,r[s].endValue))}}if("Gradient"===e.paletteSettings.type||"Fixed"===e.paletteSettings.type&&!0===e.legendSettings.enableSmartLegend){if("Gradient"===e.paletteSettings.type){if(e.enableCanvasRendering){var l=void 0,h=e.canvasRenderer.ctx,l=e.horizontalGradient?h.createLinearGradient(i.x,0,i.x+i.width,0):h.createLinearGradient(0,i.y,0,i.y+i.height);e.legendSettings.title.text&&h.clip();for(s=0;s<e.legendColorCollection.length;s++){var d=((this.heatMap.isColorRange?e.legendColorCollection[s].startValue:e.legendColorCollection[s].value)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue),d=isNaN(d)?0:d;this.heatMap.isColorRange&&"Gradient"===this.heatMap.paletteSettings.type?this.calculateCanvasColorRange(s,l):l.addColorStop(d,e.legendColorCollection[s].color)}h=(h.fillStyle=l).toString()}else{for(var p,i=void 0,c=void 0,u=[],s=0;s<e.legendColorCollection.length;s++)if(this.heatMap.isColorRange&&"Gradient"===this.heatMap.paletteSettings.type?this.calculateColorRange(s,u):(p=(e.legendColorCollection[s].value-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,p=isNaN(p)?0:p,c=new h9t(e.legendColorCollection[s].color,p+"%"),u.push(c)),this.legendMaxValue===this.legendMinValue)break;i=e.horizontalGradient?new l9t(e.element.id+"_lineargradient","0%","100%","0%","0%"):new l9t(e.element.id+"_lineargradient","0%","0%","0%","100%"),i=e.renderer.drawGradient("linearGradient",i,u);this.legend.appendChild(i),h="url(#"+e.element.id+"_lineargradient)"}i=new F7t(e.element.id+"_Gradient_Legend",h,t,1,o);this.drawSvgCanvas.drawRectangle(i,this.legend),this.renderElements(o)}else this.renderSmartLegend(),this.renderTitle(o);e.enableCanvasRendering||e.svgObject.appendChild(this.legend),e.enableCanvasRendering&&n.restore(),this.renderLegendLabel(o)}else{this.legendScale=e.renderer.createGroup({id:e.element.id+"Heatmap_GradientScale"});h=new F7t(e.element.id+"_Gradient_Scale","none",t,1,this.legendRectScale);this.drawSvgCanvas.drawRectangle(h,this.legendScale),this.renderTitle(o),e.enableCanvasRendering||this.legend.appendChild(this.legendScale),this.translategroup=e.renderer.createGroup({id:e.element.id+"_translate"}),this.calculateListPerPage(o),1<this.numberOfPages&&(this.paginggroup=e.renderer.createGroup({id:e.element.id+"_navigation"})),this.renderListLegendMode(o,!0),e.enableCanvasRendering&&n.restore()}},G9t.prototype.renderElements=function(e){this.renderTitle(e),this.renderColorAxisGrid(e)},G9t.prototype.calculateCanvasColorRange=function(e,t){var i=this.heatMap,n=((i.legendColorCollection[e].startValue<i.dataSourceMinValue&&i.legendColorCollection[e].endValue>i.dataSourceMinValue?i.dataSourceMinValue:i.legendColorCollection[e].startValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue),n=isNaN(n)?0:n,o=((i.legendColorCollection[e].endValue>=this.heatMap.dataSourceMaxValue?this.heatMap.dataSourceMaxValue:i.legendColorCollection[e].endValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue);this.heatMap.legendColorCollection[0].startValue!==this.heatMap.dataSourceMinValue&&0===e&&this.heatMap.legendColorCollection[0].startValue>this.heatMap.dataSourceMinValue&&(n=(this.heatMap.legendColorCollection[0].startValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue),t.addColorStop(n/2,this.heatMap.paletteSettings.fillColor.minColor),t.addColorStop(n,this.heatMap.paletteSettings.fillColor.maxColor)),t.addColorStop(n,i.legendColorCollection[e].minColor),t.addColorStop(o,i.legendColorCollection[e].maxColor),this.heatMap.legendColorCollection[e].endValue!==(e===this.heatMap.legendColorCollection.length-1?this.heatMap.dataSourceMaxValue:this.heatMap.legendColorCollection[e+1].startValue)&&this.heatMap.legendColorCollection[e].endValue<this.heatMap.dataSourceMaxValue&&(n=(i.legendColorCollection[e].endValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue),t.addColorStop(n,this.heatMap.paletteSettings.fillColor.minColor),n=((e===this.heatMap.legendColorCollection.length-1?this.heatMap.dataSourceMaxValue:i.legendColorCollection[e+1].startValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue),t.addColorStop(n,this.heatMap.paletteSettings.fillColor.maxColor))},G9t.prototype.calculateColorRange=function(e,t){void 0===t&&(t=[]);var i,n=this.heatMap,o=(n.toggleValue=[],this.heatMap.legendColorCollection[0].startValue>this.heatMap.dataSourceMinValue&&0===e&&(i=(this.heatMap.dataSourceMinValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,i=isNaN(i)?0:i,o=new h9t(n.paletteSettings.fillColor.minColor,i+"%"),t.push(o),i=(n.legendColorCollection[0].startValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,o=new h9t(n.paletteSettings.fillColor.maxColor,i+"%"),t.push(o)),i=(n.legendColorCollection[e].startValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,i=isNaN(i)?0:i,o=new h9t(n.legendColorCollection[e].minColor,i+"%"),t.push(o),i=(n.legendColorCollection[e].endValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,new h9t(n.legendColorCollection[e].maxColor,i+"%"));t.push(o),this.heatMap.legendColorCollection[e].endValue!==(e===this.heatMap.legendColorCollection.length-1?this.heatMap.dataSourceMaxValue:this.heatMap.legendColorCollection[e+1].startValue)&&(i=(n.legendColorCollection[e].endValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,o=new h9t(this.heatMap.paletteSettings.fillColor.minColor,i+"%"),t.push(o),i=((e===this.heatMap.legendColorCollection.length-1?this.heatMap.dataSourceMaxValue:n.legendColorCollection[e+1].startValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,o=new h9t(this.heatMap.paletteSettings.fillColor.maxColor,i+"%"),t.push(o))},G9t.prototype.renderTitle=function(e){var t,i,n,o,r,s,a,l,h,d,p=this.heatMap;p.legendSettings.title.text&&(t=p.legendSettings.title,n=b7t(i=this.heatMap.enableHtmlSanitizer?go.sanitize(t.text):t.text,t.textStyle),o=p.legendSettings.showLabel?this.labelPadding:p.horizontalGradient?10:6,h="start",a=t.textStyle.textAlignment,l=d=s=r=void 0,"Trim"===p.legendSettings.title.textStyle.textOverflow&&(i=s9t(s=p.horizontalGradient?e.width-10:this.width-10,i,t.textStyle)),d=p.horizontalGradient?(r=e.y+("Top"===p.legendSettings.position?0:-(10+n.height+o)),o="Top"===p.legendSettings.position?-(o+n.height/4):o+3*n.height/4,l="Bottom"===p.legendSettings.position?r:r-n.height,0!==i.length&&p.enableCanvasRendering&&this.legendTitleTooltip.push(new m9t(t.text,new _7t(e.x,l,s,n.height))),n.width=(e.width<n.width?e:n).width,l=e.x,l=-1!==i.indexOf("...")&&"Far"===a?l+e.width/2-n.width/2:"Near"===a?l:"Far"===a?e.width+l:l+e.width/2-n.width/2,h="Far"===a&&-1===i.indexOf("...")?"end":"start",new H7t(p.element.id+"_legendTitle",new W7t(l,r+o,h,i,0,"translate(0,0)",void 0),t.textStyle,t.textStyle.color||p.themeStyle.heatMapTitle)):(o=-(o+n.height/4),0!==i.length&&p.enableCanvasRendering&&this.legendTitleTooltip.push(new m9t(t.text,new _7t(e.x,e.y-n.height,s,n.height))),new H7t(p.element.id+"_legendTitle",new W7t(e.x,e.y+o,"start",i,0,"translate(0,0)",void 0),t.textStyle,t.textStyle.color||p.themeStyle.heatMapTitle)),this.drawSvgCanvas.createText(d,this.legend,i))},G9t.prototype.renderSmartLegend=function(){var e,t,i,n,o=this.heatMap,r=o.colorCollection,s={color:"transparent",width:0},a=this.legendRectScale,l=a.width/r.length,h=a.height/r.length;this.legendRectPositionCollection=[],this.legendRange=[];for(var d=0;d<o.legendColorCollection.length;d++){var p=new b9t(0,0,0,0,"",""),c=(o.horizontalGradient?(e=a.x+d*l,t=a.y,i=l,n=a.height,this.segmentCollections.push("Edge"!==o.legendSettings.labelDisplayType||d!==o.legendColorCollection.length-1||o.legendColorCollection[d].isHidden?e:e+l)):(e=a.x,t=a.y+d*h,i=a.width,n=h,this.segmentCollections.push("Edge"!==o.legendSettings.labelDisplayType||d!==o.legendColorCollection.length-1||o.legendColorCollection[d].isHidden?t:t+h)),this.heatMap.renderer.createGroup({id:o.element.id+"_Smart_Legend_Group_"+d})),u=this.heatMap.legendSettings.toggleVisibility?0:-1,g=(c.setAttribute("tabindex",u.toString()),c.style.outline="none",u=new _7t(e,t,i,n),new w9t(0,0,0,0,0,!0,0));g.x=e,g.y=t,g.width=i,g.height=n,g.value=this.heatMap.isColorRange?o.legendColorCollection[d].endValue:o.legendColorCollection[d].value,g.currentPage=this.currentPage,r.length!==o.legendColorCollection.length&&d===o.legendColorCollection.length-1&&(o.horizontalGradient?g.width=0:g.height=0,this.visibilityCollections[d]=this.visibilityCollections[d-1]),g.visible=!!je(this.visibilityCollections[d])||this.visibilityCollections[d],this.legendRange.push(g),o.legendColorCollection[d].isHidden||(g=o.legendOnLoad||this.legendRange[d].visible?this.heatMap.isColorRange?r[d].minColor:r[d].color:this.heatMap.themeStyle.toggledColor||"#D3D3D3",g=new F7t(o.element.id+"_Smart_Legend"+d,g,s,1,u),this.drawSvgCanvas.drawRectangle(g,c),this.legend.appendChild(c),p.x=e,p.y=t,p.width=i,p.height=n,p.label=this.labelCollections[d],p.id=o.element.id+"_Smart_Legend"+d,this.legendRectPositionCollection.push(p),0!==i9t(this.labelCollections[d],o.legendSettings.textStyle,this.textWrapCollections[d]).length&&o.enableCanvasRendering&&(u=b7t(this.labelCollections[d],o.legendSettings.textStyle),this.legendLabelTooltip.push(new m9t(this.labelCollections[d],new _7t(p.x,p.y,u.width,u.height)))))}},G9t.prototype.colorRangeLegendPosition=function(e,t){if(this.segmentCollections.length!==this.segmentCollectionsLabels.length){for(var i=0;i<this.segmentCollections.length;i++)if(this.segmentCollectionsLabels[e]===this.segmentCollections[i]){t=this.segmentCollectionsLabels[e]+((i===this.segmentCollections.length-1?this.heatMap.horizontalGradient?this.width:this.height:this.segmentCollections[i+1])-this.segmentCollections[i])/2;break}}else t=this.segmentCollectionsLabels[e]+((e===this.segmentCollectionsLabels.length-1?this.heatMap.horizontalGradient?this.width:this.height:this.segmentCollectionsLabels[e+1])-this.segmentCollectionsLabels[e])/2;this.labelPosition=t},G9t.prototype.renderLegendLabel=function(e){var t=this.heatMap;if(this.legendTextRange=[],t.legendSettings.showLabel&&("Gradient"===t.paletteSettings.type||"Fixed"===t.paletteSettings.type&&"None"!==t.legendSettings.labelDisplayType)){for(var i,n,o="start",r=void 0,s=void 0,a=void 0,l=(this.legendLabelTooltip=[],t.isColorRange),h=t.legendColorCollection,d=(t.enableCanvasRendering?((i=t.canvasRenderer.ctx).rect(this.legendGroup.x,this.legendGroup.y,this.legendGroup.width,this.legendGroup.height),i.save(),i.clip(),i.restore()):s=t.renderer.createGroup({id:t.element.id+"_Heatmap_LegendLabel"}),void 0),p=void 0,c=0;c<h.length;c++){var u,g,m=(h[c].value-Math.round(100*this.legendMinValue)/100)/(Math.round(100*this.legendMaxValue)/100-Math.round(100*this.legendMinValue)/100)*100,f=h[c].isHidden?c-1:c,f=this.legend.querySelector("#"+t.element.id+"_Smart_Legend_Group_"+f),r=t.horizontalGradient?(d=this.heatMap.isColorRange&&"Gradient"===t.paletteSettings.type?(this.colorRangeLegendPosition(c,d),this.labelPosition):this.heatMap.legendSettings.enableSmartLegend&&this.heatMap.isColorRange&&"Fixed"===t.paletteSettings.type?this.segmentCollections[c]+e.width/h.length/2:this.segmentCollections[c],p=e.y+e.height+this.labelPadding,o=Math.round(100*m)/100==0&&!l||"Fixed"===t.paletteSettings.type&&0===c?"start":Math.round(100*m)/100==100&&"Gradient"===t.paletteSettings.type&&!l||Math.round(100*t.dataSourceMaxValue)/100===h[c].value&&t.legendSettings.enableSmartLegend||t.legendSettings.enableSmartLegend&&"Fixed"===t.paletteSettings.type&&"Edge"===t.legendSettings.labelDisplayType?"end":"middle","hanging"):(d=e.x+e.width+this.labelPadding,p=this.heatMap.isColorRange&&"Gradient"===t.paletteSettings.type?(this.colorRangeLegendPosition(c,p),this.labelPosition):this.heatMap.legendSettings.enableSmartLegend&&this.heatMap.isColorRange&&"Fixed"===t.paletteSettings.type?this.segmentCollections[c]+e.height/h.length/2:this.segmentCollections[c],Math.round(100*m)/100==0&&!l||0===c&&"Fixed"===t.paletteSettings.type?"hanging":Math.round(100*m)/100==100&&!l&&"Gradient"===t.paletteSettings.type||Math.round(100*t.dataSourceMaxValue)/100===h[c].value&&t.legendSettings.enableSmartLegend||t.legendSettings.enableSmartLegend&&"Edge"===t.legendSettings.labelDisplayType&&"Fixed"===t.paletteSettings.type?"auto":"middle"),m=t.horizontalGradient?("None"===t.legendSettings.textStyle.textOverflow?this.segmentCollections:this.textWrapCollections)[c]:this.width-(this.legendRectScale.width+this.labelPadding+this.legendRectPadding),m=b7t((a=i9t(this.labelCollections[c],t.legendSettings.textStyle,m))[0],t.legendSettings.textStyle);if("Fixed"===t.paletteSettings.type&&(u="hanging"===r?p:"middle"===r?p-m.height/2:p-m.height,g="end"===o?d-m.width:"middle"===o?d-m.width/2:d,(g=new w9t(g,u,m.width,m.height,h[c].value,!0,this.currentPage)).visible=!!je(this.visibilityCollections[c])||this.visibilityCollections[c],this.legendTextRange.push(g)),""!==this.labelCollections[c]&&(0!==a.length&&-1!==a[0].indexOf("...")&&t.enableCanvasRendering&&this.legendLabelTooltip.push(new m9t(this.labelCollections[c],new _7t(d,p,m.width,m.height))),a=n9t(a,this.heatMap.enableHtmlSanitizer),u=new W7t(d,p,o,a,0,"translate(0,0)",r),(g=new H7t(t.element.id+"_Legend_Label"+c,u,t.legendSettings.textStyle,t.legendSettings.textStyle.color||t.themeStyle.legendLabel)).fill=t.legendOnLoad||"Fixed"!==t.paletteSettings.type||this.legendRange[c].visible?g.fill:"#D3D3D3",m="Fixed"===t.paletteSettings.type?f:s,1<a.length?this.drawSvgCanvas.createWrapText(g,t.legendSettings.textStyle,s):this.drawSvgCanvas.createText(g,m,a[0]),F.isIE)&&!t.enableCanvasRendering&&("middle"===r?m.lastChild.setAttribute("dy","0.6ex"):"hanging"===r&&m.lastChild.setAttribute("dy","1.5ex")),this.legendMaxValue===this.legendMinValue&&"Gradient"===t.paletteSettings.type)break}t.enableCanvasRendering||(this.legendGroup.height=0<this.legendGroup.height?this.legendGroup.height:0,this.legendGroup.width=0<this.legendGroup.width?this.legendGroup.width:0,"Gradient"===t.paletteSettings.type&&this.legend.appendChild(s),i=t.renderer.createClipPath({id:t.element.id+"_clipPath"}),n=t.renderer.drawRectangle(this.legendGroup),i.appendChild(n),t.svgObject.appendChild(i),this.legend.style.cssText="clip-path:url(#"+i.id+")")}},G9t.prototype.renderGradientPointer=function(e,t,i){var n,o,r,s,a,l,h,d=this.heatMap,t=d.heatMapSeries.getCurrentRect(t,i),i=d.bubbleSizeWithColor?""!==t.value[0].bubbleData.toString()?(this.heatMap.isColorValueExist?t.value[1]:t.value[0]).bubbleData.toString():"":t.value.toString(),t=this.legendRectScale;""!==i.toString()?(d.horizontalGradient?(n=t.width/100*((Number(i)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue))*100,n=isNaN(n)?0:n,o=t.x+n,r=t.y+t.height,s=t.x-5+n,a=h=t.y+t.height+8,l=t.x+5+n):(n=t.height/100*((Number(i)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue))*100,n=isNaN(n)?0:n,o=t.x-1,r=t.y+n,s=l=t.x-8,a=t.y-5+n,h=t.y+5+n),i=new I7t(d.element.id+"_Gradient_Pointer","gray",.01,"#A0A0A0",1,"0,0","M "+o+" "+r+" L "+s+" "+a+" L "+l+" "+h+" Z"),d.enableCanvasRendering?(this.removeGradientPointer(),d.canvasRenderer.drawPath(i,void 0),je(this.previousOptions)||(this.previousOptions.pathX1=o,this.previousOptions.pathY1=r,this.previousOptions.pathX2=s,this.previousOptions.pathY2=a,this.previousOptions.pathX3=l,this.previousOptions.pathY3=h)):(this.gradientPointer=d.renderer.drawPath(i),this.gradientPointer.style.visibility="visible",this.legend.appendChild(this.gradientPointer))):this.removeGradientPointer()},G9t.prototype.removeGradientPointer=function(){var e=this.heatMap;je(e)||(this.gradientPointer&&!e.enableCanvasRendering?this.gradientPointer.style.visibility="hidden":e.enableCanvasRendering&&(je(this.fillRect)||je(this.previousOptions)||0===Object.keys(this.previousOptions).length||(e.horizontalGradient?(this.fillRect.x=this.previousOptions.pathX2-1,this.fillRect.y=this.previousOptions.pathY1,this.fillRect.width=this.previousOptions.pathX3-this.previousOptions.pathX2+2,this.fillRect.height=this.previousOptions.pathY2+1-this.previousOptions.pathY1):(this.fillRect.x=this.previousOptions.pathX2-1,this.fillRect.y=this.previousOptions.pathY2-1,this.fillRect.width=this.previousOptions.pathX1-this.previousOptions.pathX2+1,this.fillRect.height=this.previousOptions.pathY3-this.previousOptions.pathY2+2)),e.canvasRenderer.ctx.fillStyle=e.themeStyle.background,je(this.fillRect)||e.canvasRenderer.ctx.clearRect(this.fillRect.x,this.fillRect.y,this.fillRect.width,this.fillRect.height)))},G9t.prototype.calculateLegendBounds=function(e){var t=this.heatMap,i=t.legendSettings,n=(this.labelCollection=[],this.labelCollections=[],t.legendColorCollection),o=("Bottom"!==i.position&&"Top"!==i.position&&"Right"!==i.position&&"Left"!==i.position&&(i.position="Right"),t.legendSettings.title),o=b7t(this.heatMap.enableHtmlSanitizer?go.sanitize(o.text):o.text,o.textStyle),r=(t.horizontalGradient="Bottom"===i.position||"Top"===i.position,this.legendRectPadding=t.horizontalGradient?t.legendSettings.title.text?o.height+16:16:10,this.labelPadding=i.showLabel?this.heatMap.horizontalGradient?10:6:0,this.legendHeight=i.height,this.legendWidth=i.width,t.legendSettings.labelFormat),s=null!==r.match("{value}");if(this.format=t.intl.getNumberFormat({format:s?"":r}),"Fixed"===t.paletteSettings.type)for(var a=0;a<n.length;a++){var l={cancel:!1,text:h=n[a].label||(this.heatMap.isColorRange?n[a].startValue.toString()+"-"+n[a].endValue.toString():T9t(s,r,n[a].value,this.format).toString()),name:"legendRender"};this.labelCollection.push(h),this.heatMap.trigger("legendRender",l),t.legendRender?t.legendSettings.enableSmartLegend&&"Edge"===t.legendSettings.labelDisplayType&&0<a&&a<n.length-1||l.cancel?this.labelCollections.push(""):this.labelCollections.push(l.text):t.legendSettings.enableSmartLegend&&"Edge"===t.legendSettings.labelDisplayType&&0<a&&a<n.length-1?this.labelCollections.push(""):this.labelCollections.push(h)}else for(a=0;a<n.length;a++){var h,l={cancel:!1,text:h=n[a].isHidden?"":n[a].label||(this.heatMap.isColorRange?n[a].startValue.toString()+"-"+n[a].endValue.toString():T9t(s,r,n[a].value,this.format).toString()),name:"legendRender"};n[a].isHidden||this.heatMap.trigger("legendRender",l),t.legendRender?l.cancel||0<a&&a<n.length-1&&"Edge"===t.legendSettings.labelDisplayType||l.cancel?this.labelCollections.push(""):this.labelCollections.push(l.text):0<a&&a<n.length-1&&"Edge"===t.legendSettings.labelDisplayType?this.labelCollections.push(""):this.labelCollections.push(h)}"Gradient"===t.paletteSettings.type||"Fixed"===t.paletteSettings.type&&t.legendSettings.enableSmartLegend?(this.maxLegendLabelSize=this.getMaxLabelSize(),t.horizontalGradient&&""===i.height?this.legendHeight=(2*this.legendRectPadding+this.legendSize+this.maxLegendLabelSize.height).toString():!t.horizontalGradient&&""===i.width&&("None"===i.textStyle.textOverflow||"Fixed"===t.paletteSettings.type&&t.legendSettings.enableSmartLegend&&"None"===t.legendSettings.labelDisplayType)&&(this.legendWidth=(2*this.legendRectPadding+this.legendSize+this.maxLegendLabelSize.width).toString()),this.calculateTitleBounds()):this.calculateListLegendBounds(e),this.legendHeight=this.legendHeight||(t.horizontalGradient?"50":"100%"),this.legendWidth=this.legendWidth||(t.horizontalGradient?"100%":"Fixed"!==t.paletteSettings.type||t.legendSettings.enableSmartLegend?"50":"70"),this.height=v7t(this.legendHeight,e.height),this.width=v7t(this.legendWidth,e.width),t.horizontalGradient?(this.height=("Gradient"===t.paletteSettings.type||t.legendSettings.enableSmartLegend)&&this.height<50?50:this.height,"Top"===i.position&&(e.y+=this.height),e.height-=this.height):(this.width=("Gradient"===t.paletteSettings.type||t.legendSettings.enableSmartLegend)&&this.width<50?50:this.width,"Left"===i.position&&(e.x+=this.width),e.width-=this.width)},G9t.prototype.calculateTitleBounds=function(){var e=this.heatMap,t=e.legendSettings.title,t=b7t(this.heatMap.enableHtmlSanitizer?go.sanitize(t.text):t.text,t.textStyle);e.legendSettings.title.text&&("Top"!==e.legendSettings.position&&"Bottom"!==e.legendSettings.position||""!==e.legendSettings.height||(this.legendHeight=(2*this.legendRectPadding-t.height+this.legendSize+this.maxLegendLabelSize.height).toString()),""===e.legendSettings.width)&&("None"===e.legendSettings.textStyle.textOverflow||"Fixed"===e.paletteSettings.type&&e.legendSettings.enableSmartLegend&&"None"===e.legendSettings.labelDisplayType)&&("Right"===e.legendSettings.position?this.legendWidth=(2*this.legendRectPadding+t.width+this.legendSize+this.maxLegendLabelSize.width).toString():"Left"===e.legendSettings.position&&(t.width=(t.width>this.maxLegendLabelSize.width?t:this.maxLegendLabelSize).width,this.legendWidth=(2*this.legendRectPadding+t.width+this.legendSize).toString()))},G9t.prototype.calculateListLegendBounds=function(e){var t=this.heatMap,i=(this.listWidth=0,this.listHeight=0,this.currentPage=1,t.legendSettings.title),i=b7t(this.heatMap.enableHtmlSanitizer?go.sanitize(i.text):i.text,i.textStyle),n=(i.height+50).toString();if(t.horizontalGradient){for(var o=0;o<t.colorCollection.length;o++){var r=0,s=(t.legendSettings.showLabel&&(s=this.labelCollections[o],r=b7t(this.heatMap.enableHtmlSanitizer?go.sanitize(s):s,t.legendSettings.textStyle).width),this.legendSize+this.labelPadding+r+this.listInterval);this.listWidth+=s}this.listWidth+=this.listInterval+10,""===this.legendWidth&&(this.legendWidth=(this.listWidth>e.width?e.width:this.listWidth).toString()),""===this.legendHeight&&(this.numberOfRows=Math.ceil(this.listWidth/v7t(this.legendWidth,e.width)),this.numberOfRows=3<this.numberOfRows?3:this.numberOfRows,this.legendHeight=((this.listWidth>e.width||this.listWidth>v7t(this.legendWidth,e.width))&&3<this.numberOfRows?(this.legendSize+this.listInterval)*this.numberOfRows+this.legendRectPadding+parseInt(t.legendSettings.textStyle.size,10)+10:(this.legendSize+this.listInterval)*this.numberOfRows+this.legendRectPadding).toString())}else this.listHeight=(this.legendSize+this.listInterval)*t.colorCollection.length+this.listInterval+(t.legendSettings.title.text?i.height:0),""===this.legendHeight&&(this.legendHeight=(this.listHeight>e.height?e.height:this.listHeight).toString()),""===this.legendWidth&&"Trim"!==t.legendSettings.textStyle.textOverflow&&(this.maxLegendLabelSize=this.getMaxLabelSize(),this.maxLegendLabelSize.width=(i.width>this.maxLegendLabelSize.width?i:this.maxLegendLabelSize).width,this.legendWidth=(2*this.legendRectPadding+this.legendSize+this.labelPadding+this.maxLegendLabelSize.width).toString());v7t(this.legendHeight,e.height)<50&&(this.legendHeight=n),v7t(this.legendWidth,e.width)<70&&(this.legendWidth="70")},G9t.prototype.getMaxLabelSize=function(){var e=this.heatMap;if(this.maxLegendLabelSize=new x7t(0,0),!e.legendSettings.showLabel||e.horizontalGradient&&"Fixed"===e.paletteSettings.type&&!e.legendSettings.enableSmartLegend||"Fixed"===e.paletteSettings.type&&"None"===e.legendSettings.labelDisplayType)return this.maxLegendLabelSize;for(var t=this.maxLegendLabelSize,i=0;i<e.legendColorCollection.length;i++){var n=b7t(e.enableHtmlSanitizer?go.sanitize(this.labelCollections[i]):this.labelCollections[i],e.legendSettings.textStyle);t.width=(t.width>n.width?t:n).width,t.height=(t.height>n.height?t:n).height}return t},G9t.prototype.calculateLegendSize=function(e,t){var i,n,o=this.heatMap,r=o.legendSettings,s=r.alignment,a=v7t(this.legendHeight,e.height),l=o.legendSettings.title.text?this.width:v7t(this.legendWidth,e.width),h=o.axisCollections,d=0;o.horizontalGradient?(l=l>e.width?e.width:l,a="Gradient"===o.paletteSettings.type||o.legendSettings.enableSmartLegend?50<a?a:50:this.height,n="Near"===s?e.x:"Far"===s?e.x+e.width-l:e.x+e.width/2-l/2,""!==o.xAxis.title.text&&(d=b7t(o.xAxis.title.text,o.xAxis.textStyle).height+10),i=h[0].opposedPosition?0:J7t(h[0].xAxisMultiLabelHeight)+h[0].maxLabelSize.height+d+10,i="Top"===r.position?o.titleSettings.text?t:o.margin.top:e.y+e.height+i):(a=a>e.height?e.height:a,l="Gradient"!==o.paletteSettings.type&&!o.legendSettings.enableSmartLegend||50<l?l:50,i="Near"===s?e.y:"Far"===s?e.y+e.height-a:e.y+e.height/2-a/2,""!==o.yAxis.title.text&&(d=b7t(o.yAxis.title.text,o.yAxis.textStyle).height+10),t=h[1].opposedPosition?J7t(h[1].yAxisMultiLabelHeight)+h[1].maxLabelSize.width+d+20:0,n="Right"===r.position?e.x+e.width+t:o.margin.left),this.legendGroup=new _7t(n,i,l,a),this.calculateGradientScale(this.legendGroup)},G9t.prototype.measureListLegendBound=function(e){var t,i=this.heatMap,n=i.legendSettings.title,n=(this.numberOfPages=1,b7t(i.enableHtmlSanitizer?go.sanitize(n.text):n.text,n.textStyle));i.horizontalGradient?this.listWidth>this.width?(this.numberOfRows=Math.ceil(this.listWidth/this.width),this.listHeight=(this.legendSize+this.listInterval)*this.numberOfRows,this.listPerPage=this.numberOfRows<=3?this.numberOfRows:Math.ceil((this.height-15-parseInt(i.legendSettings.textStyle.size,10)-this.legendRectPadding)/(this.legendSize+this.listInterval)),this.numberOfPages=Math.ceil(this.numberOfRows/this.listPerPage)):this.listPerPage=1:this.listHeight>e.height||this.listHeight>this.height?(t=(t=v7t(this.legendHeight,e.height))>e.height?e.height:t,t=i.legendSettings.title.text?t-n.height:t,this.listPerPage=Math.floor(t/(this.legendSize+this.listInterval)-1),this.numberOfPages=Math.max(1,Math.ceil(i.colorCollection.length/this.listPerPage))):(this.listPerPage=i.colorCollection.length,this.legendHeight=this.listHeight.toString())},G9t.prototype.renderPagingElements=function(){var e,t,i,n,o,r,s=this.heatMap;1<this.numberOfPages&&(this.navigationCollections=[],this.legend.appendChild(this.paginggroup),o=this.legendGroup.x+this.legendGroup.width-10,n=this.legendGroup.y+this.legendGroup.height-10,t=o-(r=b7t(e=this.currentPage+"/"+this.numberOfPages,s.legendSettings.textStyle)).width-15,i=new W7t(t,n,"start",e,0,"translate(0,0)","middle"),i=new H7t(s.element.id+"_paging",i,s.legendSettings.textStyle,s.legendSettings.textStyle.color||s.themeStyle.legendLabel),this.drawSvgCanvas.createText(i,this.paginggroup,e),F.isIE&&!s.enableCanvasRendering&&this.paginggroup.lastChild.setAttribute("dy","0.6ex"),this.pagingRect=new _7t(t,n-r.height/2,r.width,r.height),i=new F7t(s.element.id+"_pagingText","none",{color:"transparent",width:0},1,this.pagingRect),this.drawSvgCanvas.drawRectangle(i,this.paginggroup),e=new F7t(s.element.id+"_rightArrow","none",{color:"transparent",width:0},1,new _7t(o-10,n-5,10,10)),this.drawSvgCanvas.drawRectangle(e,this.paginggroup),r="M "+o+" "+n+" L "+(o-10)+" "+(n-5)+" L "+(o-10)+" "+(5+n)+"Z",o="M "+(i=t-15)+" "+n+" L "+(10+i)+" "+(n-5)+" L "+(10+i)+" "+(5+n)+"Z",t=new F7t(s.element.id+"_leftArrow","none",{color:"transparent",width:0},1,new _7t(5+i,n-5,10,10)),this.drawSvgCanvas.drawRectangle(t,this.paginggroup),i=new I7t(s.element.id+"_Legend_leftarrow","gray",.01,"#A0A0A0",1,"0,0",o),n=new I7t(s.element.id+"_Legend_rightarrow","gray",.01,"#A0A0A0",1,"0,0",r),this.navigationCollections.push(e),this.navigationCollections.push(t),s.enableCanvasRendering?(s.canvasRenderer.clearRect(t),s.canvasRenderer.clearRect(e),s.canvasRenderer.drawPath(i,void 0),s.canvasRenderer.drawPath(n,void 0)):((o=s.renderer.drawPath(i)).setAttribute("tabindex","0"),o.style.outline="none",(r=s.renderer.drawPath(n)).setAttribute("tabindex","0"),r.style.outline="none",this.paginggroup.appendChild(o),this.paginggroup.appendChild(r)))},G9t.prototype.calculateGradientScale=function(e){var t,i,n,o=this.heatMap,r=o.legendSettings.title,r=b7t(o.enableHtmlSanitizer?go.sanitize(r.text):r.text,r.textStyle),r=o.legendSettings.title.text?r.height:0;"Fixed"!==o.paletteSettings.type||o.legendSettings.enableSmartLegend||this.measureListLegendBound(o.initialClipRect),e=o.horizontalGradient?(t=e.x+10,i=e.y+this.legendRectPadding,n="Fixed"!==o.paletteSettings.type||o.legendSettings.enableSmartLegend?e.width-20:e.width-2*this.listInterval,"Fixed"!==o.paletteSettings.type||o.legendSettings.enableSmartLegend?this.gradientScaleSize:(this.legendSize+this.listInterval)*this.listPerPage-this.listInterval):(t=e.x+this.legendRectPadding,i=e.y+10+r,n="Fixed"!==o.paletteSettings.type||o.legendSettings.enableSmartLegend?this.gradientScaleSize:e.width-10,"Fixed"!==o.paletteSettings.type||o.legendSettings.enableSmartLegend?e.height-20-r:(this.legendSize+this.listInterval)*this.listPerPage-this.listInterval),this.legendRectScale=new _7t(t,i,n,e),("Gradient"===o.paletteSettings.type||"Fixed"===o.paletteSettings.type&&o.legendSettings.enableSmartLegend)&&this.calculateColorAxisGrid(this.legendRectScale)},G9t.prototype.calculateColorAxisGrid=function(e){var t,i,n,o=this.heatMap,r=this.legendRectScale,s=0,a=(this.segmentCollectionsLabels=[],this.segmentCollections=[],this.textWrapCollections=[],"Gradient"===o.paletteSettings.type?o.legendColorCollection:o.colorCollection),l=o.bubbleSizeWithColor?o.minColorValue:o.dataSourceMinValue,h=o.bubbleSizeWithColor?o.maxColorValue:o.dataSourceMaxValue;if(this.legendMinValue=this.heatMap.isColorRange?a[0].startValue>o.dataSourceMinValue?o.dataSourceMinValue:a[0].startValue:a[0].value>l?l:a[0].value,this.legendMaxValue=this.heatMap.isColorRange?a[a.length-1].endValue<o.dataSourceMaxValue?o.dataSourceMaxValue:a[a.length-1].endValue:a[a.length-1].value<h?h:a[a.length-1].value,"Gradient"===o.paletteSettings.type)for(var d=0;d<a.length;d++){var p=void 0,c=(this.heatMap.isColorRange&&o.horizontalGradient?r.width:r.height)/100;this.heatMap.isColorRange?(a[0].startValue!==this.heatMap.dataSourceMinValue&&0===d&&a[0].startValue>this.heatMap.dataSourceMinValue&&(p=(this.heatMap.dataSourceMinValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,n=(o.horizontalGradient?e.x:e.y)+c*p,this.segmentCollections.push(n)),p=((a[d].startValue<o.dataSourceMinValue&&a[d].endValue>o.dataSourceMaxValue?o.dataSourceMinValue:a[d].startValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,p=isNaN(p)?0:p,n=(o.horizontalGradient?e.x:e.y)+c*p,this.segmentCollections.push(n),this.segmentCollectionsLabels.push(n),a[d].endValue!==(d===a.length-1?this.heatMap.dataSourceMaxValue:a[d+1].startValue)&&this.heatMap.legendColorCollection[d].endValue<this.heatMap.dataSourceMaxValue&&(d===a.length-1&&(p=(a[d].endValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,n=(o.horizontalGradient?e.x:e.y)+c*p,this.segmentCollections.push(n)),p=((d===a.length-1?this.heatMap.dataSourceMaxValue:a[d].endValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,n=(o.horizontalGradient?e.x:e.y)+c*p,this.segmentCollections.push(n))):(p=(a[d].value-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,p=isNaN(p)?0:p,o.horizontalGradient?(c=r.width/100,i=e.x+c*p,this.segmentCollections.push(i)):(c=r.height/100,n=e.y+c*p,this.segmentCollections.push(n)))}if(o.horizontalGradient){for(var u,g,m=this.heatMap.isColorRange?this.segmentCollectionsLabels:this.segmentCollections,f=0;f<a.length;f++)u="Gradient"===o.paletteSettings.type?(g=(m[f]-m[f-1])/2,u=(m[f+1]-m[f])/2,f===a.length-1?this.heatMap.isColorRange?(e.width-m[f-1])/2:g:0!==f&&g<u&&!this.heatMap.isColorRange?g:u):(g=this.legendRectScale.width/o.colorCollection.length,"Edge"===o.legendSettings.labelDisplayType?g:g/2),this.textWrapCollections.push(u),s=(t=i9t(this.labelCollections[f],o.legendSettings.textStyle,u)).length>s?t.length:s;"Bottom"===o.legendSettings.position?(o.initialClipRect.height-=this.maxLegendLabelSize.height*(s-1),this.legendGroup.y-=this.maxLegendLabelSize.height*(s-1)):(o.initialClipRect.y+=this.maxLegendLabelSize.height*(s-1),o.initialClipRect.height-=this.maxLegendLabelSize.height*(s-1)),this.legendRectScale.y=this.legendGroup.y+this.legendRectPadding,this.legendGroup.height=parseInt(this.legendHeight,10)+this.maxLegendLabelSize.height*(s-1)}},G9t.prototype.renderColorAxisGrid=function(e){var t,i,n,o,r,s=this.heatMap;s.enableCanvasRendering||(t=this.heatMap.renderer.createGroup({id:s.element.id+"_ColorAxis_Grid"}));for(var a=0;a<(s.isColorRange?this.segmentCollections:s.legendColorCollection).length;a++){s.horizontalGradient?(i=o=this.segmentCollections[a],n=e.y,r=e.y+e.height):(i=e.x,n=r=this.segmentCollections[a],o=e.x+e.width);var l=new Q7t(i,n,o,r),l=new U7t(this.heatMap.element.id+"_ColorAxis_Grid"+a,l,"#EEEEEE",1);this.drawSvgCanvas.drawLine(l,t),s.enableCanvasRendering||this.legend.appendChild(t)}},G9t.prototype.renderLegendTitleTooltip=function(e,t,i){-1!==e.target.id.indexOf("_legendTitle")&&-1<e.target.textContent.indexOf("...")?(d9t(this.heatMap.legendSettings.title.text,t,i,this.heatMap.element.offsetWidth,this.heatMap.element.id+"_legendTitle_Tooltip",u9t(this.heatMap.element.id+"_Secondary_Element"),null,this.heatMap),document.getElementById(this.heatMap.element.id+"_legendTitle_Tooltip").style.visibility="visible"):p9t(this.heatMap.element.id+"_legendTitle_Tooltip")},G9t.prototype.renderLegendLabelTooltip=function(e,t,i){var n;-1!==e.target.id.indexOf("_Legend_Label")&&-1<e.target.textContent.indexOf("...")?2===(e=e.target.id.split(this.heatMap.element.id+"_Legend_Label")).length&&(n=void 0,n=1===e[1].length||"Trim"===this.heatMap.legendSettings.textStyle.textOverflow?parseInt(e[1],10):parseInt(e[1].substring(0,e[1].length-1),10),d9t(this.labelCollections[n],t,i,this.heatMap.element.offsetWidth,this.heatMap.element.id+"_LegendLabel_Tooltip",u9t(this.heatMap.element.id+"_Secondary_Element"),null,this.heatMap),document.getElementById(this.heatMap.element.id+"_LegendLabel_Tooltip").style.visibility="visible"):p9t(this.heatMap.element.id+"_LegendLabel_Tooltip")},G9t.prototype.calculateListPerPage=function(e){var t=this.heatMap;if(t.horizontalGradient){this.lastList=[];var i=e.x,n=e.y,o=0,r=0,s=0,a=0,l=void 0;for(this.labelXCollections=[],this.labelYCollections=[],this.legendXCollections=[],this.legendYCollections=[],l=0;l<t.colorCollection.length;l++){t.legendSettings.showLabel&&(h=this.labelCollections[l],o=b7t(t.enableHtmlSanitizer?go.sanitize(h):h,t.legendSettings.textStyle).width),s=i+10+5,a=n+5;var h=t.legendSettings.showLabel?s+o:i+this.legendSize+this.listInterval;0!==l&&h>this.legendGroup.width+this.legendGroup.x-this.listInterval&&(r+=1,s=(i=e.x)+10+5,a=(n=e.y+20*r)+5,r%this.listPerPage==0)&&(this.lastList.push(l),a=(n=e.y)+5,r=0),this.labelXCollections.push(s),this.labelYCollections.push(a),this.legendXCollections.push(i),this.legendYCollections.push(n),i=i+this.legendSize+this.labelPadding+o+this.listInterval}this.lastList.push(l),this.numberOfPages=this.lastList.length}},G9t.prototype.renderListLegendMode=function(e,t){for(var i,n=this.heatMap,o={color:"transparent",width:0},r=(this.legendLabelTooltip=[],new x7t(0,0)),s=0,a=0,l=e.x,h=e.y,d=(t&&this.renderPagingElements(),n.legendSettings.title.text?this.width-2*(this.legendSize+this.labelPadding):this.legendGroup.width-(this.legendSize+this.legendRectPadding+this.labelPadding)),p=n.horizontalGradient?(i=1===this.currentPage?0:this.lastList[this.currentPage-2],this.lastList[this.currentPage-1]):(p=(i=this.currentPage*this.listPerPage-this.listPerPage)+this.listPerPage)<n.colorCollection.length?p:n.colorCollection.length,c=i;c<p;c++){n.legendSettings.showLabel&&(m=this.labelCollections[c],r=b7t(this.heatMap.enableHtmlSanitizer?go.sanitize(m):m,n.legendSettings.textStyle));var u,g,m,f=this.heatMap.renderer.createGroup({id:n.element.id+"_Legend_Index_"+c}),y={cancel:!1,text:this.labelCollection[c],name:"legendRender"},y=(n.horizontalGradient&&(l=this.legendXCollections[c],h=this.legendYCollections[c],s=this.labelXCollections[c],a=this.labelYCollections[c]),s=l+this.legendSize+this.labelPadding,a=h+5,this.heatMap.trigger("legendRender",y),t&&n.rendering&&this.legendRange.length<n.colorCollection.length&&((g=new w9t(l,h,10,10,n.colorCollection[c].value,!0,this.currentPage)).visible=!!je(this.visibilityCollections[c])||this.visibilityCollections[c],y.cancel?(u=new w9t(l,h,0,0,n.colorCollection[c].value,!0,this.currentPage),this.legendRange.push(u)):this.legendRange.push(g),n.legendSettings.showLabel)&&((u=new w9t(s,a-r.height/2,r.width,r.height,n.colorCollection[c].value,!0,this.currentPage)).visible=!!je(this.visibilityCollections[c])||this.visibilityCollections[c],this.legendTextRange.push(u)),y.cancel||(g=new _7t(l,h,10,10),y=n.legendOnLoad||this.legendRange[c].visible?this.heatMap.isColorRange?n.colorCollection[c].minColor:n.colorCollection[c].color:"#D3D3D3",y=new F7t(n.element.id+"_legend_list"+c,y,o,1,g),this.drawSvgCanvas.drawRectangle(y,f),n.legendSettings.showLabel&&(-1!==(m=i9t(this.labelCollections[c],n.legendSettings.textStyle,d))[0].indexOf("...")&&n.enableCanvasRendering&&this.legendLabelTooltip.push(new m9t(this.labelCollections[c],new _7t(s,a,r.width,r.height))),y=new W7t(s,a,"start",m,0,"translate(0,0)","middle"),(y=new H7t(n.element.id+"_Legend_Label"+c,y,n.legendSettings.textStyle,n.legendSettings.textStyle.color||n.themeStyle.legendLabel)).fill=n.legendOnLoad||this.legendRange[c].visible?y.fill:"#D3D3D3",this.drawSvgCanvas.createText(y,f,m[0]),F.isIE)&&!n.enableCanvasRendering&&f.lastChild.setAttribute("dy","0.6ex"),n.horizontalGradient?l=l+this.legendSize+this.labelPadding+r.width+this.listInterval:h+=this.legendSize+this.listInterval),this.heatMap.legendSettings.toggleVisibility?0:-1);f.setAttribute("tabindex",y.toString()),f.style.outline="none",this.translategroup.appendChild(f)}n.enableCanvasRendering||(this.legendGroup.height=0<this.legendGroup.height?this.legendGroup.height:0,this.legendGroup.width=0<this.legendGroup.width?this.legendGroup.width:0,e=n.renderer.createClipPath({id:n.element.id+"_LegendScale_ClipPath"}),i=n.renderer.drawRectangle(this.legendGroup),e.appendChild(i),this.translategroup.appendChild(e),this.legend.style.cssText="clip-path:url(#"+e.id+")",this.legendScale.appendChild(this.translategroup),n.svgObject.appendChild(this.legend))},G9t.prototype.translatePage=function(e,t,i){var n,o,r,s;if(i&&1<=t&&t<this.numberOfPages||!i&&1<t&&t<=this.numberOfPages){if(i?(this.currentPage+=1,this.legendRect.y+=this.legendRect.height):(--this.currentPage,this.legendRect.y-=this.legendRect.height),e.enableCanvasRendering)for(var a=0,l=[e.canvasRenderer.ctx,e.secondaryCanvasRenderer.ctx];a<l.length;a++){var h=l[a];je(h)||(h.clearRect(this.legendRectScale.x-5,this.legendRectScale.y-5,this.legendRectScale.width+5,this.legendRectScale.height+10),h.clearRect(this.pagingRect.x,this.pagingRect.y,this.pagingRect.width,this.pagingRect.height))}else for(this.paginggroup.removeChild(this.paginggroup.firstChild);this.translategroup.childNodes.length;)this.translategroup.removeChild(this.translategroup.firstChild);this.renderListLegendMode(this.legendRectScale,!0)}e.enableCanvasRendering&&e.allowSelection&&e.rectSelected&&(t=e.secondaryCanvasRenderer.ctx,i=e.legendSettings.position,s=e.initialClipRect,n="Right"===i?s.x+s.width:0,o="Bottom"===i?s.y+s.height:0,r="Right"===i?e.availableSize.width-(s.x+s.width):"Left"===i?s.x:e.availableSize.width,i="Top"===i?s.y:"Bottom"===i?e.availableSize.height-(s.y+s.height):e.availableSize.height,t.save(),t.clearRect(n,o,r,i),t.restore(),s=document.getElementById(e.element.id+"_canvas"),t=document.getElementById(e.element.id+"_secondary_canvas"),e=s.getContext("2d").getImageData(n,o,r,i),t.getContext("2d").putImageData(e,n,o),s.style.opacity="0.3")},G9t.prototype.createTooltipDiv=function(){var e=Q("div",{id:this.heatMap.element.id+"legendLabelTooltipContainer"});e.style.cssText="position: absolute; pointer-events: none;",this.heatMap.element.appendChild(e)},G9t.prototype.renderTooltip=function(e){var t=this.heatMap,i=[e.label],n=parseInt(t.legendSettings.textStyle.size,10)/2;this.tooltipObject=new tr({offset:n,theme:t.theme,content:i,location:{x:e.x+e.width/2,y:e.y+e.height/2},inverted:!t.horizontalGradient,areaBounds:{height:this.legendGroup.height+this.legendGroup.y,width:this.legendGroup.width+this.legendGroup.x,x:"Right"===t.legendSettings.position?0:this.legendGroup.x,y:"Top"===t.legendSettings.position?""===t.titleSettings.text?this.legendGroup.height-this.legendGroup.y:this.legendGroup.y:0}},"#"+this.heatMap.element.id+"legendLabelTooltipContainer"),this.tooltipObject.element.style.visibility="visible"},G9t.prototype.createTooltip=function(e,t){for(var i,n=0;n<this.heatMap.colorCollection.length;n++){var o=this.legendRectPositionCollection[n];if(o&&e>o.x&&e<o.width+o.x&&t>o.y&&t<o.height+o.y){i=this.legendRectPositionCollection[n];break}}var r=document.getElementById(this.heatMap.element.id+"legendLabelTooltipContainer");r&&"visible"===r.style.visibility&&this.tooltipObject&&!this.heatMap.isTouch&&(this.tooltipObject.fadeOut(),r.style.visibility="hidden"),i&&this.renderTooltip(i)},G9t.prototype.legendRangeSelection=function(e){var t=this.heatMap,i=this.legendRange,n=t.horizontalGradient?10:0,o=this.legendRectScale,r=t.canvasRenderer.ctx,s=t.secondaryCanvasRenderer.ctx;if(t.rangeSelection=!0,t.enableCanvasRendering)t.legendSettings.enableSmartLegend?(je(r)||r.clearRect(o.x-5,o.y-5,o.width+this.labelPadding+this.maxLegendLabelSize.width+5,o.height+2*(5+n)),je(s)||s.clearRect(o.x-5,o.y-5,o.width+this.labelPadding+this.maxLegendLabelSize.width+5,o.height+2*(5+n))):(je(r)||r.clearRect(o.x-5,o.y-5,o.width+5,o.height+10),je(s)||s.clearRect(o.x-5,o.y-5,o.width+5,o.height+10));else{if(t.legendSettings.enableSmartLegend)for(;this.legend&&this.legend.childNodes.length;)this.legend.removeChild(this.legend.firstChild);else for(;this.translategroup&&this.translategroup.childNodes.length;)this.translategroup.removeChild(this.translategroup.firstChild);p9t(t.heatMapSeries.containerRectObject.id),t.cellSettings.showLabel&&p9t(t.heatMapSeries.containerTextObject.id)}t.legendSettings.enableSmartLegend&&t.colorCollection.length!==t.legendColorCollection.length&&(e===t.legendColorCollection.length-1?t.toggleValue[e-1].visible=this.visibilityCollections[e-1]=i[e-1].visible=!i[e].visible:e===t.colorCollection.length-1&&(t.toggleValue[e+1].visible=this.visibilityCollections[e+1]=i[e+1].visible=!i[e].visible)),t.toggleValue[e].visible=this.visibilityCollections[e]=i[e].visible=!i[e].visible,t.legendOnLoad=!1,t.legendSettings.enableSmartLegend?(this.renderSmartLegend(),n=new _7t(o.x,o.y,o.width,o.height),this.renderLegendLabel(n),t.enableCanvasRendering&&(r.save(),r.clip()),"SVG"===t.renderingMode&&this.renderTitle(n)):this.renderListLegendMode(this.legendRectScale,!1),t.enableCanvasRendering&&r.restore(),t.heatMapSeries.renderRectSeries(),t.clearSelection(),t.enableCanvasRendering&&t.allowSelection},G9t.prototype.updateLegendRangeCollections=function(){var e=this.heatMap;e.rangeSelection=!e.legendOnLoad,this.visibilityCollections=e.legendOnLoad?[]:this.visibilityCollections,e.toggleValue=e.legendOnLoad?[]:e.toggleValue,this.legendRange=e.legendOnLoad?[]:this.legendRange,this.legendTextRange=e.legendOnLoad?[]:this.legendTextRange};KH=G9t;function G9t(e){this.maxLegendLabelSize=new x7t(0,0),this.gradientScaleSize=10,this.segmentCollections=[],this.segmentCollectionsLabels=[],this.textWrapCollections=[],this.labelCollections=[],this.labelCollection=[],this.legendSize=10,this.previousOptions=new v9t(0,0,0,0,0,0),this.listPerPage=0,this.numberOfPages=1,this.listWidth=0,this.fillRect=new _7t(0,0,0,0),this.legendRect=new _7t(0,0,0,0),this.currentPage=1,this.lastList=[],this.navigationCollections=[],this.pagingRect=new _7t(0,0,0,0),this.listInterval=10,this.legendLabelTooltip=[],this.legendTitleTooltip=[],this.labelXCollections=[],this.labelYCollections=[],this.legendXCollections=[],this.legendYCollections=[],this.legendRectPositionCollection=[],this.legendRange=[],this.legendTextRange=[],this.visibilityCollections=[],this.heatMap=e,this.drawSvgCanvas=new e9t(e)}Y9t=function(e,t){return(Y9t=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])}))(e,t)};var Y9t,X9t,$H=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},iz=(function(e,t){function i(){this.constructor=e}Y9t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(K9t,X9t=n),$H([e(!1)],K9t.prototype,"isJsonData",void 0),$H([e("None")],K9t.prototype,"adaptorType",void 0),$H([e("")],K9t.prototype,"xDataMapping",void 0),$H([e("")],K9t.prototype,"yDataMapping",void 0),$H([e("")],K9t.prototype,"valueMapping",void 0),$H([t({},jee)],K9t.prototype,"bubbleDataMapping",void 0),K9t);function K9t(){return null!==X9t&&X9t.apply(this,arguments)||this}var J9t=function(){},m4=(Z9t.prototype.constructDatasource=function(e,t){var i,n;"Cell"===t.adaptorType&&(i=this.heatMap.xAxis,n=this.heatMap.yAxis,this.adaptiveXMinMax.min=i.minimum,this.adaptiveXMinMax.max=i.maximum,this.adaptiveYMinMax.min=n.minimum,this.adaptiveYMinMax.max=n.maximum,("Numeric"!==i.valueType&&"DateTime"!==i.valueType||!je(i.minimum)&&!je(i.maximum))&&("Numeric"!==n.valueType&&"DateTime"!==n.valueType||!je(n.minimum)&&!je(n.maximum))||this.getMinMaxValue(e,t,i,n),this.heatMap.isCellData=!0),"None"!==t.adaptorType&&(t.isJsonData||"Table"!==t.adaptorType)?t.isJsonData&&"Table"===t.adaptorType?this.heatMap.completeAdaptDataSource=this.processJsonTableData(e,t):t.isJsonData&&"Cell"===t.adaptorType?this.heatMap.completeAdaptDataSource=this.processJsonCellData(e,t):t.isJsonData||"Cell"!==t.adaptorType||(this.constructAdaptiveAxis(),this.heatMap.completeAdaptDataSource=this.processCellData(e),this.heatMap.isCellData=!0):this.heatMap.completeAdaptDataSource=e},Z9t.prototype.constructAdaptiveAxis=function(){var e=this.heatMap.xAxis,t=this.heatMap.yAxis;"Numeric"===e.valueType&&(this.reconstructedXAxis=this.getNumericAxisCollection(this.adaptiveXMinMax.min,this.adaptiveXMinMax.max,e.increment)),"Numeric"===t.valueType&&(this.reconstructedYAxis=this.getNumericAxisCollection(this.adaptiveYMinMax.min,this.adaptiveYMinMax.max,t.increment)),"DateTime"===e.valueType&&(this.reconstructedXAxis=this.getDateAxisCollection(this.adaptiveXMinMax.min,this.adaptiveXMinMax.max,e.intervalType,e.increment)),"DateTime"===t.valueType&&(this.reconstructedYAxis=this.getDateAxisCollection(this.adaptiveYMinMax.min,this.adaptiveYMinMax.max,t.intervalType,t.increment))},Z9t.prototype.getNumericAxisCollection=function(e,t,i){for(var n=e,o=[];n<=t;)o.push(n.toString()),n+=i;return o},Z9t.prototype.getDateAxisCollection=function(e,t,i,n){for(var o={skeleton:"full",type:"dateTime"},r=this.heatMap.intl.getDateParser(o),o=this.heatMap.intl.getDateFormat(o),s=e=Date.parse(r(o(new Date(Sa.parse.parseJson({val:e}).val)))),a=[];s<=t;)a.push(new Date(s).toString()),s=g9t(s,1,i,n).getTime();return a},Z9t.prototype.getMinMaxValue=function(e,t,i,n){var o=e,r=Object.keys(o[0]);0<o.length&&(this.adaptiveXMinMax.min=je(i.minimum)?t.isJsonData?o[0][r[0]]:o[0][0]:i.minimum,this.adaptiveYMinMax.min=je(n.minimum)?t.isJsonData?o[0][r[1]]:o[0][1]:n.minimum,this.adaptiveXMinMax.max=je(i.maximum)?t.isJsonData?o[0][r[0]]:o[0][0]:i.maximum,this.adaptiveYMinMax.max=je(n.maximum)?t.isJsonData?o[0][r[1]]:o[0][1]:n.maximum);for(var s=0;s<o.length;s++){var a=t.isJsonData?o[s][r[0]]:o[s][0],l=t.isJsonData?o[s][r[1]]:o[s][1];a<this.adaptiveXMinMax.min&&je(i.minimum)&&(this.adaptiveXMinMax.min=a),a>this.adaptiveXMinMax.max&&je(i.maximum)&&(this.adaptiveXMinMax.max=a),l<this.adaptiveYMinMax.min&&je(n.minimum)&&(this.adaptiveYMinMax.min=l),l>this.adaptiveYMinMax.max&&je(n.maximum)&&(this.adaptiveYMinMax.max=l)}},Z9t.prototype.processCellData=function(e){var t=e,i=this.reconstructedXAxis,n=this.reconstructedYAxis,o=0,r=0;if(this.reconstructData=[],t&&t.length)for(var s=0;s<t.length;s++)if(-1<(o="Category"===this.heatMap.xAxis.valueType?t[s][0]:i.indexOf(t[s][0].toString()))){for(;!this.reconstructData[o];)this.reconstructData.push([]);if(-1!==(r="Category"===this.heatMap.yAxis.valueType?t[s][1]:n.indexOf(t[s][1].toString()))){for(;""!==this.reconstructData[o][r];)this.reconstructData[o].push("");this.reconstructData[o][r]=je(t[s][2])?"":t[s][2]}}return this.reconstructData},Z9t.prototype.processJsonCellData=function(e,t){var i,n,o=e,r=this.heatMap.xAxis.labels||[],s=this.heatMap.yAxis.labels||[],a=this.heatMap.axisCollections,l=(0!==r.length&&0!==s.length||this.generateAxisLabels(e,t),"Category"===this.heatMap.xAxis.valueType?0<r.length?this.heatMap.xAxis.labels:a[0].jsonCellLabel:a[0].labelValue),h="Category"===this.heatMap.yAxis.valueType?0<s.length?this.heatMap.yAxis.labels:a[1].jsonCellLabel:a[1].labelValue;if(o.length){this.reconstructData=[];for(var d=0;d<o.length;d++)if(-1!==(i=this.getSplitDataValue(o[d],t,l,je(t.xDataMapping)?null:t.xDataMapping.split("."),this.heatMap.xAxis.valueType))){for(;!this.reconstructData[i];)this.reconstructData.push([]);if(-1!==(n=this.getSplitDataValue(o[d],t,h,je(t.yDataMapping)?null:t.yDataMapping.split("."),this.heatMap.yAxis.valueType))){for(;je(this.reconstructData[i][n]);)this.reconstructData[i].push("");this.heatMap.bubbleSizeWithColor?this.reconstructData[i][n]=[this.getSplitDataValue(o[d],t,null,t.bubbleDataMapping.size.split("."),""),this.getSplitDataValue(o[d],t,null,t.bubbleDataMapping.color.split("."),"")]:this.reconstructData[i][n]=this.getSplitDataValue(o[d],t,null,je(t.valueMapping)?null:t.valueMapping.split("."),"")}}}return this.reconstructData},Z9t.prototype.generateAxisLabels=function(e,t){for(var i=e,e=this.heatMap.xAxis.labels||[],n=this.heatMap.yAxis.labels||[],o=0<e.length,r=0<n.length,s=this.heatMap.axisCollections,a=0;a<s.length;a++){var l=s[a].valueType,h=s[a];if("Category"===l){var d=void 0,p=void 0,c=void 0,p="Horizontal"===h.orientation?(d=o,t.xDataMapping):(d=r,t.yDataMapping);if(h.jsonCellLabel=c=[],!d)for(var u,g=0;g<i.length;g++)p in i[g]&&(u=i[g][p].toString(),-1===c.indexOf(u.toString()))&&c.push(u)}else"DateTime"===l?(h.clearAxisLabel(),h.calculateDateTimeAxisLabel(this.heatMap)):(h.clearAxisLabel(),h.calculateNumericAxisLabels(this.heatMap))}},Z9t.prototype.getSplitDataValue=function(e,t,i,n,o){var r=-1,s={skeleton:"full",type:"dateTime"},a=this.heatMap.intl.getDateParser(s),l=this.heatMap.intl.getDateFormat(s);this.tempSplitDataCollection=e;for(var h=0;h<(je(n)?0:n.length)&&(r=je(i)?null:"DateTime"!==o?i.indexOf(this.tempSplitDataCollection[n[h]]):"string"==typeof this.tempSplitDataCollection[n[h]]||"object"==typeof this.tempSplitDataCollection[n[h]]?i.map(Number).indexOf(Date.parse(a(l(new Date(Sa.parse.parseJson({val:this.tempSplitDataCollection[n[h]]}).val))))):i.map(Number).indexOf(+new Date(this.tempSplitDataCollection[n[h]]).setHours(0,0,0,0)),je(this.tempSplitDataCollection)||(this.tempSplitDataCollection=-1===r||je(i)?this.tempSplitDataCollection[n[h]]:this.tempSplitDataCollection),!je(this.tempSplitDataCollection));h++);return r=je(i)?je(this.tempSplitDataCollection)||""===this.tempSplitDataCollection.toString()?"":parseFloat(this.tempSplitDataCollection.toString()):r},Z9t.prototype.processJsonTableData=function(e,t){var i,n,o,r=e,s=this.heatMap.xAxis.labels||[],a=this.heatMap.yAxis.labels||[];if(r.length){this.reconstructData=[];for(var l=0;l<r.length;l++)if(-1!==(i=this.getSplitDataValue(r[l],t,s,je(t.xDataMapping)?null:t.xDataMapping.split("."),this.heatMap.xAxis.valueType))){for(;!this.reconstructData[i];)this.reconstructData.push([]);for(var h=0;h<Object.keys(this.tempSplitDataCollection).length;h++)if(-1!==(n=(o=Object.keys(this.tempSplitDataCollection)[h])!==t.xDataMapping?a.indexOf(o):-1)){for(;je(this.reconstructData[i][n]);)this.reconstructData[i].push("");this.reconstructData[i][n]=je(this.tempSplitDataCollection[o])?"":this.tempSplitDataCollection[o]}}}return this.reconstructData},Z9t.prototype.destroy=function(){this.reconstructData=null,this.reconstructedXAxis=null,this.reconstructedYAxis=null,this.adaptiveXMinMax=null,this.adaptiveYMinMax=null,this.tempSplitDataCollection=null,this.heatMap=null},Z9t.prototype.getModuleName=function(){return"Adaptor"},Z9t);function Z9t(e){this.reconstructedXAxis=[],this.reconstructedYAxis=[],this.adaptiveXMinMax=new J9t,this.adaptiveYMinMax=new J9t,this.heatMap=e}eqt.prototype.export=function(e,t,i){var n,o,r,s,a,l,h=this,d=this.getControlsValue(),p=d.width,c=d.height,u=this.control.svgObject,g=this.control.enableCanvasRendering,m=(g||(u=Q("canvas",{id:"ej2-canvas",attrs:{width:p.toString(),height:c.toString()}})),!(-1<F.userAgent.toString().indexOf("HeadlessChrome"))),f=(i=je(i)?up.Landscape:i,'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+d.svg.outerHTML+"</svg>"),y=g?u.toDataURL("image/png"):(o=(r=(n=this.control.svgObject.cloneNode(!0)).childNodes[0]).getAttribute("fill"),"Tailwind"!==this.control.theme&&"Tailwind3"!==this.control.theme&&"Bootstrap5"!==this.control.theme&&"Fluent"!==this.control.theme&&"Material3"!==this.control.theme&&"Fluent2"!==this.control.theme||"rgba(255,255,255, 0.0)"!==o&&"transparent"!==o?"TailwindDark"!==this.control.theme&&"Tailwind3Dark"!==this.control.theme&&"Bootstrap5Dark"!==this.control.theme&&"FluentDark"!==this.control.theme&&"Material3Dark"!==this.control.theme&&"Fluent2Dark"!==this.control.theme&&"Fluent2HighContrast"!==this.control.theme||"rgba(255,255,255, 0.0)"!==o&&"transparent"!==o||r.setAttribute("fill","rgba(0, 0, 0, 1)"):r.setAttribute("fill","rgba(255,255,255, 1)"),window.URL.createObjectURL(new Blob("SVG"===e?[f]:[(new XMLSerializer).serializeToString(n)],{type:"image/svg+xml"})));"SVG"===e?"msie"===F.info.name?(o=new Blob([(new XMLSerializer).serializeToString(d.svg)],{type:"application/octet-stream"}),je(window.navigator.msSaveOrOpenBlob)||window.navigator.msSaveOrOpenBlob(o,t+"."+e.toLocaleLowerCase())):this.triggerDownload(t,e,y,m):"msie"===F.info.name?(r=u,f=(r=g?u:this.createCanvas()).toDataURL(e),"PDF"===e?this.exportPdf(r,i,p,c,m,t):this.doExport(e,f,t)):(s=new Image,a=u.getContext("2d"),l=a.shadowColor,s.onload=function(){"Tailwind"!==h.control.theme&&"Tailwind3"!==h.control.theme&&"Bootstrap5"!==h.control.theme&&"Fluent"!==h.control.theme&&"Material3"!==h.control.theme&&"Fluent2"!==h.control.theme||"rgba(0, 0, 0, 0)"!==l&&"transparent"!==l?"TailwindDark"!==h.control.theme&&"Tailwind3Dark"!==h.control.theme&&"Bootstrap5Dark"!==h.control.theme&&"FluentDark"!==h.control.theme&&"Material3Dark"!==h.control.theme&&"Fluent2Dark"!==h.control.theme&&"Fluent2HighContrast"!==h.control.theme||"rgba(0, 0, 0, 0)"!==l&&"transparent"!==l||(a.fillStyle="rgba(0, 0, 0, 1)"):a.fillStyle="rgba(255,255,255, 1)",a.fillRect(0,0,u.width,u.height),a.drawImage(s,0,0),window.URL.revokeObjectURL(y),"PDF"===e?h.exportPdf(u,i,p,c,m,t):window.navigator.msSaveOrOpenBlob?window.navigator.msSaveOrOpenBlob(u.msToBlob(),t+"."+e.toLocaleLowerCase()):h.triggerDownload(t,e,u.toDataURL("image/png").replace("image/png","image/octet-stream"),m)},s.src=y),g||p9t(document.getElementById(this.control.element.id)+"_canvas")},eqt.prototype.triggerDownload=function(e,t,i,n){Q("a",{attrs:{download:e+"."+t.toLocaleLowerCase(),href:i}}).dispatchEvent(new MouseEvent(n?"click":"move",{view:window,bubbles:!1,cancelable:!0}))},eqt.prototype.getControlsValue=function(){var e,t=this.control.enableCanvasRendering,i=new fo("").createSvg({id:"Svg_Export_Element",width:200,height:200}),n=this.control.svgObject.cloneNode(!0),o=this.control.renderer.createGroup({});return o.style.cssText="transform: translateY(0px)",t||o.appendChild(n),n=Math.max(this.control.availableSize.width,0),e=0+this.control.availableSize.height,t||i.appendChild(o),t||(i.setAttribute("width",n+""),i.setAttribute("height",e+"")),{width:n,height:e,svg:i}},eqt.prototype.createCanvas=function(){var e=this.control,t=e.renderingMode,i=(e.renderingMode="Canvas",e.refresh(),e.svgObject);return e.renderingMode=t,e.refresh(),i},eqt.prototype.exportPdf=function(e,t,i,n,o,r){var s=new sg,a=s.pageSettings.margins,l=s.pageSettings.width,h=s.pageSettings.height,e=e.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream"),t=(s.pageSettings.orientation=t,l<i?i+a.left+a.right:l),l=h<n?n+a.top+a.bottom:h;s.pageSettings.size=new td(t,l),e=e.slice(e.indexOf(",")+1),s.pages.add().graphics.drawImage(new oc(e),0,0,i,n),o&&(s.save(r+".pdf"),s.destroy())},eqt.prototype.doExport=function(e,t,i){this.exportImage([t],i,e||"JPG",t)},eqt.prototype.exportImage=function(e,t,i,n){for(var o=[],r=e instanceof HTMLElement?0:e.length,s=0;s<r;s++){for(var a=e[s].replace(/^data:[a-z]*;,/,"").split(","),l=atob(a[1]),a=new ArrayBuffer(l.length),h=new Uint8Array(a),d=0;d<l.length;d++)h[d]=l.charCodeAt(d);o.push(a)}for(var p=0;p<o.length;p++){var c=new Blob([o[p]],{type:"application/octet-stream"});"msie"!==F.info.name||je(window.navigator.msSaveOrOpenBlob)||window.navigator.msSaveOrOpenBlob(c,t+"."+i.toLocaleLowerCase())}},eqt.prototype.print=function(){var e,t,i,n;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),"SVG"===this.control.renderingMode?V(this.getHTMLContent(),this.printWindow):(t=(e=this.control.svgObject).toDataURL(),i=new Image,n=e.getContext("2d"),i.onload=function(){n.drawImage(i,0,0)},i.src=t,V(i,this.printWindow))},eqt.prototype.getHTMLContent=function(){var e=Q("div");return e.appendChild(this.control.element.cloneNode(!0)),e};var $9t=eqt;function eqt(e){this.control=e}tqt=function(e,t){return(tqt=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])}))(e,t)};var tqt,iqt,v4=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},hft=(function(e,t){function i(){this.constructor=e}tqt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(nqt,iqt=Ji),nqt.prototype.preRender=function(){this.initPrivateVariable(),this.unWireEvents(),this.wireEvents()},nqt.prototype.export=function(e,t,i){new $9t(this).export(e,t,i)},nqt.prototype.initPrivateVariable=function(){this.renderer=new fo(this.element.id),this.canvasRenderer=new vo(this.element.id),this.secondaryCanvasRenderer=new vo(this.element.id+"_secondary"),this.heatMapAxis=new P9t(this),this.heatMapSeries=new O9t(this),this.drawSvgCanvas=new e9t(this),this.twoDimensional=new j9t(this),this.cellColor=new m7t(this),this.tempRectHoverClass="",this.tempTooltipRectId="",this.setCulture()},nqt.prototype.setCulture=function(){this.intl=new Ti},nqt.prototype.render=function(){var e;this.horizontalGradient="Bottom"===this.legendSettings.position||"Top"===this.legendSettings.position,this.updateBubbleHelperProperty(),this.trigger("load",{heatmap:this}),"TailwindDark"!==this.theme&&"Tailwind"!==this.theme||(e={title:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Inter"}},this.setProperties({titleSettings:{textStyle:{size:"14px",fontFamily:"Inter"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{fontFamily:"Inter"}}},!0)),"Tailwind3Dark"!==this.theme&&"Tailwind3"!==this.theme||(e={title:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}},this.setProperties({titleSettings:{textStyle:{size:"14px",fontFamily:"Inter",fontWeight:"600"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:{title:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"400"}}},!0),this.setProperties({yAxis:{title:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"400"}}},!0),this.setProperties({cellSettings:{textStyle:{fontFamily:"Inter",fontWeight:"400"}}},!0)),"Material3"!==this.theme&&"Material3Dark"!==this.theme||(e={title:{textStyle:{size:"14px",fontFamily:"Roboto",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Roboto",fontWeight:"400"}},this.setProperties({titleSettings:{textStyle:{size:"16px",fontFamily:"Roboto"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{fontFamily:"Roboto",fontWeight:"400"}}},!0)),"Bootstrap5"!==this.theme&&"Bootstrap5Dark"!==this.theme||(e={title:{textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400"}},textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400"}},this.setProperties({titleSettings:{textStyle:{size:"14px",fontFamily:"Segoe UI",fontWeight:"400"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{size:"10px",fontWeight:"400",fontFamily:"Segoe UI"}}},!0)),"Fluent"!==this.theme&&"FluentDark"!==this.theme||(e={title:{textStyle:{size:"12px",fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif',fontWeight:"500"}},textStyle:{size:"12px",fontFamily:'system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"'}},this.setProperties({titleSettings:{textStyle:{size:"16px",fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif'}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif'}}},!0)),"Fluent2"!==this.theme&&"Fluent2Dark"!==this.theme&&"Fluent2HighContrast"!==this.theme||(e={title:{textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400"}},textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400"}},this.setProperties({titleSettings:{textStyle:{size:"14px",fontFamily:"Segoe UI",fontWeight:"600"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{size:"10px",fontWeight:"400",fontFamily:"Segoe UI"}}},!0)),this.initAxis(),this.processInitData(),this.setTheme(),this.calculateMaxLength(),this.heatMapAxis.calculateVisibleLabels(),this.twoDimensional.processDataSource(this.completeAdaptDataSource),this.createSvg(),this.cellColor.getColorCollection(),this.calculateBounds(),this.renderElements(),this.appendSvgObject(),this.tooltipModule&&this.tooltipModule.showHideTooltip(!1),this.renderComplete()},nqt.prototype.reRenderDatasource=function(){this.dataSourceMinValue=null,this.dataSourceMaxValue=null,this.processInitData(),this.calculateMaxLength(),this.heatMapAxis.calculateVisibleLabels(),this.twoDimensional.processDataSource(this.completeAdaptDataSource),this.cellColor.getColorCollection(),this.calculateBounds()},nqt.prototype.processInitData=function(){this.adaptorModule?this.adaptorModule.constructDatasource(this.dataSource,this.dataSourceSettings):this.completeAdaptDataSource=this.dataSource},nqt.prototype.setRenderMode=function(){"Canvas"===this.renderingMode||"Auto"===this.renderingMode&&1e4<=this.axisCollections[0].axisLabelSize*this.axisCollections[1].axisLabelSize?this.enableCanvasRendering=!0:this.enableCanvasRendering=!1},nqt.prototype.updateBubbleHelperProperty=function(){je(this.legendModule)||"Bubble"===this.cellSettings.tileType&&("Size"===this.cellSettings.bubbleType||"Sector"===this.cellSettings.bubbleType)?this.legendVisibilityByCellType=!1:this.legendModule&&this.legendSettings.visible&&(this.legendVisibilityByCellType=!0),"Bubble"===this.cellSettings.tileType&&"SizeAndColor"===this.cellSettings.bubbleType?this.bubbleSizeWithColor=!0:this.bubbleSizeWithColor=!1},nqt.prototype.renderElements=function(){this.tooltipCollection=[],this.renderSecondaryElement(),this.renderBorder(),this.renderTitle(),this.heatMapAxis.renderAxes(),this.tooltipModule&&this.showTooltip&&(this.tooltipModule.tooltipObject=null,this.tooltipModule.createTooltipDiv(this)),this.heatMapSeries.renderRectSeries(),this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType&&(this.legendModule.renderLegendItems(),"Fixed"===this.paletteSettings.type)&&this.legendSettings.enableSmartLegend&&"None"===this.legendSettings.labelDisplayType&&this.legendModule.createTooltipDiv(),c9t()},nqt.prototype.getModuleName=function(){return"heatmap"},nqt.prototype.getPersistData=function(){return""},nqt.prototype.onPropertyChanged=function(e,t){for(var i=!1,n=!1,o=!0,r=0,s=Object.keys(e);r<s.length;r++)switch(s[r]){case"renderingMode":i=!(o=this.rendering=!1);break;case"cellSettings":this.updateBubbleHelperProperty(),!this.legendModule||e.cellSettings.tileType===(void 0!==t.cellSettings&&t.cellSettings.tileType)&&e.cellSettings.bubbleType===t.cellSettings.bubbleType||(this.legendOnLoad=!0,this.legendModule.updateLegendRangeCollections()),"Bubble"===this.cellSettings.tileType&&(o=!1),this.reRenderDatasource(),n=!0;break;case"showTooltip":n=!0;break;case"dataSource":case"dataSourceSettings":this.isCellData=!1,this.paletteCellSelectionUpdation(),this.reRenderDatasource(),i=!(o=!1);break;case"titleSettings":case"width":case"height":case"margin":case"backgroundColor":n=!0;break;case"legendSettings":this.updateBubbleHelperProperty(),this.legendModule&&this.legendVisibilityByCellType&&(e.legendSettings.visible!==(void 0!==t.legendSettings&&t.legendSettings.visible)||e.legendSettings.enableSmartLegend!==t.legendSettings.enableSmartLegend)?(this.legendOnLoad=!0,this.legendModule.updateLegendRangeCollections()):this.legendOnLoad=!1,n=!0;break;case"yAxis":case"xAxis":this.paletteCellSelectionUpdation(),this.reRenderDatasource(),n=!(o=!1);break;case"paletteSettings":this.paletteCellSelectionUpdation(),this.twoDimensional.processDataSource(this.completeAdaptDataSource),this.cellColor.getColorCollection(),this.calculateBounds(),i=!0;break;case"theme":this.setTheme(),i=!0;break;case"tooltipSettings":this.tooltipModule&&(this.tooltipModule.tooltipObject.fill=this.tooltipSettings.fill,this.tooltipModule.tooltipObject.border=this.tooltipSettings.border,this.tooltipModule.tooltipObject.textStyle=this.tooltipSettings.textStyle,this.tooltipModule.tooltipObject.template=this.tooltipSettings.template,this.tooltipModule.tooltipObject.refresh())}!n&&i?(this.createSvg(),this.renderElements(),this.appendSvgObject(),this.trigger("created"),o||this.clearSelection()):n&&(this.createSvg(),this.refreshBound(),this.appendSvgObject(),this.trigger("created")),this.allowSelection&&this.rectSelected&&(o?this.updateCellSelection():this.clearSelection()),this.rendering=!0},nqt.prototype.paletteCellSelectionUpdation=function(){this.updateBubbleHelperProperty(),this.legendModule&&this.legendVisibilityByCellType&&(this.legendOnLoad=!0,this.legendModule.updateLegendRangeCollections())},nqt.prototype.createSvg=function(){this.removeSvg(),this.setRenderMode(),this.calculateSize(),this.enableCanvasRendering?(this.svgObject=this.canvasRenderer.createCanvas({id:this.element.id+"_canvas",width:this.availableSize.width,height:this.availableSize.height}),this.allowSelection&&this.createMultiCellDiv(!0)):(this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height}),"0"===this.cellSettings.border.width.toString()&&"Rect"===this.cellSettings.tileType&&this.svgObject.setAttribute("shape-rendering","crispEdges"))},nqt.prototype.removeSvg=function(){if((document.getElementById(this.element.id+"_Secondary_Element")&&ue(document.getElementById(this.element.id+"_Secondary_Element")),document.getElementById(this.element.id+"Celltooltipcontainer")&&ue(document.getElementById(this.element.id+"Celltooltipcontainer")),document.getElementById(this.element.id+"legendLabelTooltipContainer")&&ue(document.getElementById(this.element.id+"legendLabelTooltipContainer")),document.getElementById(this.element.id+"_Multi_CellSelection_Canvas")&&ue(document.getElementById(this.element.id+"_Multi_CellSelection_Canvas")),document.getElementById(this.element.id+"_CellSelection_Container")&&ue(document.getElementById(this.element.id+"_CellSelection_Container")),document.getElementById(this.element.id+"_secondary_canvas")&&ue(document.getElementById(this.element.id+"_secondary_canvas")),this.svgObject)&&document.getElementById(this.svgObject.id)){for(;this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);ue(this.svgObject)}},nqt.prototype.renderSecondaryElement=function(){var e=this.createElement("div"),e=(e.id=this.element.id+"_Secondary_Element",this.element.appendChild(e),this.createElement("div",{id:this.element.id+"_CellSelection_Container"}));e.style.cssText="position:absolute; z-index: 2 ; top:"+this.initialClipRect.y+"px; left:"+this.initialClipRect.x+"px",this.element.appendChild(e)},nqt.prototype.requiredModules=function(){var e=[];return this.showTooltip&&e.push({member:"Tooltip",args:[this],name:"Tooltip"}),this.legendSettings.visible&&e.push({member:"Legend",args:[this],name:"Legend"}),!je(this.dataSourceSettings)&&("Table"===this.dataSourceSettings.adaptorType&&this.dataSourceSettings.isJsonData||"Cell"===this.dataSourceSettings.adaptorType)&&e.push({member:"Adaptor",args:[this],name:"Adaptor"}),e},nqt.prototype.destroy=function(){this.unWireEvents(),this.touchInstance.destroy(),this.touchInstance=null;for(var e=0;e<this.axisCollections.length;e++)this.axisCollections[e].destroy();this.axisCollections=null,je(this.heatMapSeries)||this.heatMapSeries.destroy(),this.heatMapSeries=null,je(this.heatMapAxis)||this.heatMapAxis.destroy(),this.heatMapAxis=null,iqt.prototype.destroy.call(this),c9t(),je(this.twoDimensional)||this.twoDimensional.destroy(),this.twoDimensional=null,this.element.innerHTML="",this.availableSize=null,this.elementSize=null,this.initialClipRect=null,this.element.classList.remove("e-heatmap"),this.drawSvgCanvas=null,this.cellColor=null,this.colorCollection=null,this.legendColorCollection=null,this.clonedDataSource=null,this.completeAdaptDataSource=null,this.currentRect=null,this.dataMax=null,this.dataMin=null,this.previousRect=null,this.selectedCellsRect=null,this.canvasSelectedCells=null,this.titleRect=null,this.tooltipCollection=null,this.border=null,this.intl=null,this.titleCollection=null,this.themeStyle=null,this.renderer=null,this.canvasRenderer=null,this.secondaryCanvasRenderer=null,this.svgObject=null,this.resizeEvent=null,this.toggleValue=[],this.previousSelectedCellsRect=[],this.selectedMultiCellCollection=[],this.tempMultiCellCollection=[]},nqt.prototype.refresh=function(){iqt.prototype.refresh.call(this),this.element.classList.add("e-heatmap")},nqt.prototype.appendSvgObject=function(){this.element.appendChild(this.svgObject),this.enableCanvasRendering&&this.allowSelection&&this.createMultiCellDiv(!1)},nqt.prototype.renderBorder=function(){this.border={width:0};var e=je(this.backgroundColor)?this.themeStyle.background:this.backgroundColor,e=new F7t(this.element.id+"_HeatmapBorder",e,this.border,1,new _7t(0,0,+this.availableSize.width,+this.availableSize.height));this.drawSvgCanvas.drawRectangle(e,this.svgObject)},nqt.prototype.calculateSize=function(){for(var e=v7t(this.width,this.element.offsetWidth)||this.element.offsetWidth||600,t=v7t(this.height,this.element.offsetHeight)||this.element.offsetHeight||450,i=(this.availableSize=new x7t(e,t),this.element);i.parentNode&&"BODY"!==i.tagName;){if("center"===i.align){var n=this.availableSize.width.toString();this.element.style.width=n+"px",this.element.style.margin="0 auto";break}i=i.parentElement}},nqt.prototype.renderTitle=function(){var e,t;this.titleSettings.text&&(t="Near"===(e=this.titleSettings.textStyle).textAlignment?"start":"Far"===e.textAlignment?"end":"middle",this.elementSize=b7t(this.titleCollection[0],e),t=new H7t(this.element.id+"_HeatmapTitle",new W7t(C7t(this.availableSize.width-this.margin.left-this.margin.right,this.margin.left,this.margin.right,e),this.margin.top+3*this.elementSize.height/4,t,this.titleCollection),e,e.color||this.themeStyle.heatMapTitle),1<this.titleCollection.length?this.drawSvgCanvas.createWrapText(t,e,this.svgObject):(this.drawSvgCanvas.createText(t,this.svgObject,this.titleCollection[0]),-1!==this.titleCollection[0].indexOf("...")&&this.enableCanvasRendering&&this.tooltipCollection.push(new m9t(this.titleSettings.text,new _7t(this.margin.left,this.margin.top,this.elementSize.width,this.elementSize.height)))))},nqt.prototype.titleTooltip=function(e,t,i,n){e.target.id===this.element.id+"_HeatmapTitle"&&-1<e.target.textContent.indexOf("...")?d9t(this.titleSettings.text,t,i,this.element.offsetWidth,this.element.id+"_Title_Tooltip",u9t(this.element.id+"_Secondary_Element"),n,this):p9t(this.element.id+"_Title_Tooltip")},nqt.prototype.axisTooltip=function(e,t,i,n){var e=e.target.id;(-1!==e.indexOf(this.element.id+"_XAxis_Label")||-1!==e.indexOf(this.element.id+"_YAxis_Label")||-1!==e.indexOf(this.element.id+"_XAxis_MultiLevel")||-1!==e.indexOf(this.element.id+"_YAxis_MultiLevel"))&&(e=f9t(this.tooltipCollection,t,i))?d9t(e,t,i,this.element.offsetWidth,this.element.id+"_axis_Tooltip",u9t(this.element.id+"_Secondary_Element"),this.isTouch,this):p9t(this.element.id+"_axis_Tooltip")},nqt.prototype.isHeatmapRect=function(e,t){var i,n,o,r,s,a=[],l=[];return 0<this.heatMapSeries.rectPositionCollection.length&&(a.push(this.heatMapSeries.rectPositionCollection[0][0]),l.push(this.heatMapSeries.rectPositionCollection[this.yLength-1][this.xLength-1])),0<a.length&&0<l.length&&(5<this.cellSettings.border.width&&e>=a[0].x&&t>=a[0].y&&e<=l[0].x+l[0].width&&t<=l[0].y+l[0].height&&"Rect"===this.cellSettings.tileType?(n=this.heatMapSeries.getCurrentRect(e,t),o=l[0].height,r=l[0].width,s=this.cellSettings.border.width/2,e>=n.x+s&&t>=n.y+s&&e<=n.x+(r-s)&&t<=n.y+(o-s)?this.isRectBoundary=i=!0:this.isRectBoundary=i=!1):(i=e>=a[0].x&&t>=a[0].y&&e<=l[0].x+l[0].width&&t<=l[0].y+l[0].height,this.isRectBoundary=i)),i},nqt.prototype.setTheme=function(){this.themeStyle=function(e){var t;switch(e.toLowerCase()){case"highcontrastlight":case"highcontrast":t={heatMapTitle:"#ffffff",axisTitle:"#ffffff",axisLabel:"#ffffff",cellBorder:"#EEEEEE",background:"#000000",cellTextColor:"#000000",toggledColor:"#000000",emptyCellColor:"#EEEEEE",legendLabel:"#ffffff",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]};break;case"materialdark":case"fabricdark":case"bootstrapdark":t={heatMapTitle:"#ffffff",axisTitle:"#ffffff",axisLabel:"#DADADA",cellBorder:"#EEEEEE",background:"#000000",cellTextColor:"#000000",toggledColor:"#000000",emptyCellColor:"#EEEEEE",legendLabel:"#ffffff",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]};break;case"bootstrap4":t={heatMapTitle:"#212529",axisTitle:"#212529",axisLabel:"#212529",cellBorder:"#E9ECEF",background:"#FFFFFF",cellTextColor:"#212529",toggledColor:"#ffffff",emptyCellColor:"#E9ECEF",legendLabel:"#212529",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]};break;case"tailwind":t={heatMapTitle:"#374151",axisTitle:"#374151",axisLabel:"#6B7280",cellBorder:"#E5E7EB",background:"transparent",cellTextColor:"#111827",toggledColor:"transparent",emptyCellColor:"#E5E7EB",legendLabel:"#374151",palette:[{color:"#5A61F6"},{color:"#65A30D"},{color:"#14B8A6"}]};break;case"tailwinddark":t={heatMapTitle:"#D1D5DB",axisTitle:"#D1D5DB",axisLabel:"#9CA3AF",cellBorder:"#4B5563",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"transparent",emptyCellColor:"#374151",legendLabel:"#D1D5DB",palette:[{color:"#8B5CF6"},{color:"#22D3EE"},{color:"#F87171"}]};break;case"tailwind3":t={heatMapTitle:"#111827",axisTitle:"#111827",axisLabel:"#4B5563",cellBorder:"#E5E7EB",background:"transparent",cellTextColor:"#111827",toggledColor:"transparent",emptyCellColor:"#E5E7EB",legendLabel:"#4B5563",palette:[{color:"#2F4074"},{color:"#03B4B4"},{color:"#0D72DE"}]};break;case"tailwind3dark":t={heatMapTitle:"#FFFFFF",axisTitle:"#FFFFFF",axisLabel:"#D1D5DB",cellBorder:"#282F3C",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"transparent",emptyCellColor:"#282F3C",legendLabel:"#D1D5DB",palette:[{color:"#8029F1"},{color:"#1ABC9C"},{color:"#0D72DE"}]};break;case"bootstrap5":t={heatMapTitle:"#212529",axisTitle:"#212529",axisLabel:"#212529",cellBorder:"transparent",background:"transparent",toggledColor:"#E9ECEF",emptyCellColor:"#E9ECEF",legendLabel:"#212529",palette:[{color:"#DC3545"},{color:"#FFC107"},{color:"#D63384"}]};break;case"bootstrap5dark":t={heatMapTitle:"#DEE2E6",axisTitle:"#DEE2E6",axisLabel:"#DEE2E6",cellBorder:"transparent",background:"transparent",toggledColor:"#343A40",emptyCellColor:"#343A40",legendLabel:"#DEE2E6",palette:[{color:"#DC3545"},{color:"#FFC107"},{color:"#D63384"}]};break;case"fluent":t={heatMapTitle:"#201F1E",axisTitle:"#201F1E",axisLabel:"#201F1E",cellBorder:"#EDEBE9",background:"transparent",cellTextColor:"#111827",toggledColor:"transparent",emptyCellColor:"#EDEBE9",legendLabel:"#201F1E",palette:[{color:"#EDEBE9"},{color:"#614570"},{color:"#4C6FB1"}]};break;case"fluentdark":t={heatMapTitle:"#F3F2F1",axisTitle:"#F3F2F1",axisLabel:"#F3F2F1",cellBorder:"#EDEBE9",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"transparent",emptyCellColor:"#292827",legendLabel:"#F3F2F1",palette:[{color:"#292827"},{color:"#2A72D5"},{color:"#43B786"}]};break;case"material3":t={heatMapTitle:"#1C1B1F",axisTitle:"#1C1B1F",axisLabel:"#1C1B1F",cellBorder:"#C4C7C5",background:"transparent",cellTextColor:"#1C1B1F",toggledColor:"#F6F0FB",emptyCellColor:"#F6F0FB",legendLabel:"#49454E",palette:[{color:"#6200EE"},{color:"#E77A16"},{color:"#82C100"}]};break;case"material3dark":t={heatMapTitle:"#E6E1E5",axisTitle:"#E6E1E5",axisLabel:"#E6E1E5",cellBorder:"#444746",background:"transparent",cellTextColor:"#E6E1E5",toggledColor:"#49454F",emptyCellColor:"#49454E",legendLabel:"#CAC4D0",palette:[{color:"#4EAAFF"},{color:"#FA4EAB"},{color:"#FFF500"}]};break;case"fluent2":t={heatMapTitle:"#242424",axisTitle:"#242424",axisLabel:"#242424",cellBorder:"transparent",background:"transparent",cellTextColor:"#242424",toggledColor:"#EDEBE9",emptyCellColor:"#EDEBE9",legendLabel:"#242424",palette:[{color:"#6200EE"},{color:"#09AF74"},{color:"#0076E5"}]};break;case"fluent2dark":case"fluent2highcontrast":t={heatMapTitle:"#FFFFFF",axisTitle:"#FFFFFF",axisLabel:"#FFFFFF",cellBorder:"transparent",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"#292827",emptyCellColor:"#292827",legendLabel:"#FFFFFF",palette:[{color:"#9BB449"},{color:"#2A72D5"},{color:"#43B786"}]};break;default:t={heatMapTitle:"#424242",axisTitle:"#424242",axisLabel:"#686868",cellBorder:"#EEEEEE",cellTextColor:"#000000",toggledColor:"#ffffff",background:"#FFFFFF",emptyCellColor:"#EEEEEE",legendLabel:"#353535",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]}}return t}(this.theme)},nqt.prototype.calculateBounds=function(){var e=this.margin,t=0,i=this.legendModule&&"Top"===this.legendSettings.position&&this.legendVisibilityByCellType||"0px"===this.titleSettings.textStyle.size?0:16,n=e.left,o=this.availableSize.width-n-e.right;if(("Column"===this.paletteSettings.colorGradientMode||"Row"===this.paletteSettings.colorGradientMode)&&"Gradient"===this.paletteSettings.type)if(0===this.paletteSettings.palette.length)this.legendVisibilityByCellType=!1;else for(var r=0;r<this.paletteSettings.palette.length;r++)if(null!==this.paletteSettings.palette[r].value)this.legendVisibilityByCellType=!0;else if(null===this.paletteSettings.palette[r].value){this.legendVisibilityByCellType=!1;break}this.titleSettings.text&&(s=this.enableHtmlSanitizer?go.sanitize(this.titleSettings.text):this.titleSettings.text,this.titleCollection=i9t(s,this.titleSettings.textStyle,o),t=b7t(s,this.titleSettings.textStyle).height*this.titleCollection.length+i);var s=e.top+t,i=(this.titleRect=new _7t(e.left,e.top,this.availableSize.width-e.left-e.right,t),this.availableSize.height-s-e.bottom),t=(this.initialClipRect=new _7t(n,s,o,i),this.initialClipRect.y);this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType&&this.legendModule.calculateLegendBounds(this.initialClipRect),this.heatMapAxis.measureAxis(this.initialClipRect),this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType&&this.legendModule.calculateLegendSize(this.initialClipRect,t),this.heatMapAxis.calculateAxisSize(this.initialClipRect)},nqt.prototype.refreshBound=function(){this.updateBubbleHelperProperty(),this.calculateBounds(),this.renderElements()},nqt.prototype.initAxis=function(){var e,t=[this.xAxis,this.yAxis];this.axisCollections=[];for(var i=0,n=t.length;i<n;i++)(e=t[i]).orientation=0===i?"Horizontal":"Vertical",e.jsonCellLabel=[],this.axisCollections.push(e)},nqt.prototype.wireEvents=function(){var s=this,e=F.isPointer,t=F.touchStartEvent,i=F.touchEndEvent,n=F.touchMoveEvent,e=e?"pointerleave":"mouseleave",a=(E.add(this.element,F.isDevice?t:"click",this.heatMapMouseClick,this),E.add(this.element,"contextmenu",this.heatMapMouseRightClick,this),E.add(this.element,"dblclick",this.heatMapMouseDoubleClick,this),E.add(this.element,t,this.heatMapMouseMove,this),E.add(this.element,i,this.heatMapMouseLeave,this),E.add(this.element,n,this.heatMapMouseMove,this),E.add(this.element,e,this.heatMapMouseLeave,this),E.add(this.element,"keyup",this.heatMapKeyUp,this),E.add(this.element,"keydown",this.heatMapKeyDown,this),this.resizeEvent=this.heatMapResize.bind(this),window.addEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeEvent),this);this.touchInstance=new Mn(this.element,{tapHold:function(e){var t=e.originalEvent.target.id;if((-1!==t.indexOf(s.element.id+"_HeatMapRect_")||-1!==t.indexOf(s.element.id+"_HeatMapRectLabels_"))&&s.allowSelection){a.isCellTapHold=!0;for(var i=[],n=0;n<s.multiCellCollection.length;n++)i.push(s.multiCellCollection[n]);e.originalEvent.ctrlKey&&s.enableMultiSelect||(s.multiCellCollection=[]),a.getDataCollection();t={heatmap:a,cancel:!1,name:"cellSelected",data:a.multiCellCollection};a.trigger("cellSelected",t),t.cancel?(s.multiCellCollection=i,(0<s.multiCellCollection.length||!1===e.ctrlKey||!s.enableMultiSelect)&&s.removeSelectedCellsBorder(!0)):(!1!==e.ctrlKey&&s.enableMultiSelect||s.removeSelectedCellsBorder(!1),a.currentRect.allowCollection=!1),a.setCellOpacity(),window.clearTimeout(s.tooltipTimer),a.tooltipOnMouseMove(null,a.currentRect,a.isCellTapHold)}},tap:function(e){var t,i,n,o,r=e.originalEvent.target.id;-1===r.indexOf(s.element.id+"_HeatMapRect_")&&-1===r.indexOf(s.element.id+"_HeatMapRectLabels_")&&-1===r.indexOf(s.element.id+"_CellSelection_Container_")||(r=!1,t=void(a.isCellTapHold||(r=!0)),o=n=void 0,i=s.element.getBoundingClientRect(),n=("touchend"===e.originalEvent.type||"touchstart"===e.originalEvent.type?(s.isTouch=!0,t=(o=e.originalEvent).changedTouches[0].clientX,o.changedTouches[0]):(s.isTouch=!1,t=e.originalEvent.clientX,e.originalEvent)).clientY,t-=i.left,n-=i.top,o=s.heatMapSeries.getCurrentRect(t,n),window.clearTimeout(s.tooltipTimer),a.tooltipOnMouseMove(null,o,r))}}),this.setStyle(this.element)},nqt.prototype.setStyle=function(e){e.style.touchAction="element",e.style.touchAction="element",e.style.zoom="none",e.style.userSelect="none",e.style.webkitUserSelect="none",e.style.position="relative",e.style.display="block"},nqt.prototype.print=function(){new $9t(this).print()},nqt.prototype.unWireEvents=function(){var e=F.isPointer,t=F.touchStartEvent,i=F.touchEndEvent,n=F.touchMoveEvent,e=e?"pointerleave":"mouseleave";E.remove(this.element,F.isDevice?t:"click",this.heatMapMouseClick),E.remove(this.element,"contextmenu",this.heatMapMouseRightClick),E.remove(this.element,"dblclick",this.heatMapMouseDoubleClick),E.remove(this.element,t,this.heatMapMouseMove),E.remove(this.element,i,this.heatMapMouseLeave),E.remove(this.element,n,this.heatMapMouseMove),E.remove(this.element,e,this.heatMapMouseLeave),E.remove(this.element,"keyup",this.heatMapKeyUp),E.remove(this.element,"keydown",this.heatMapKeyDown),window.removeEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeEvent)},nqt.prototype.heatMapResize=function(e){var t=this,i=(this.resizing=!0,{heatmap:this,cancel:!1,name:"resized",currentSize:new x7t(0,0),previousSize:new x7t(this.availableSize.width,this.availableSize.height)});return this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(function(){t.isDestroyed?clearTimeout(t.resizeTimer):(t.createSvg(),i.currentSize=t.availableSize,t.trigger("resized",i),t.refreshBound(),t.appendSvgObject(),t.allowSelection&&t.updateCellSelection(),t.trigger("loaded",{heatmap:t}),t.resizing=!1)},500),!1},nqt.prototype.updateCellSelection=function(){var e=this.initialClipRect.width/this.axisCollections[0].axisLabelSize,t=this.initialClipRect.height/this.axisCollections[1].axisLabelSize,i=this.initialClipRect.x,n=this.initialClipRect.y;if(this.enableCanvasRendering){if(this.enableCanvasRendering){for(var o=this.multiCellCollection,r=document.getElementById(this.element.id+"_canvas"),s=document.getElementById(this.element.id+"_secondary_canvas"),a=this.initialClipRect,l=a.y+a.height,h=a.x+a.width,d=0;d<this.multiCellCollection.length;d++){this.multiCellCollection[d].width=o[d].width=e,this.multiCellCollection[d].height=o[d].height=t,this.multiCellCollection[d].x=o[d].x=i+e*this.multiCellCollection[d].xPosition,this.multiCellCollection[d].y=o[d].y=n+t*this.multiCellCollection[d].yPosition;var p=r.getContext("2d").getImageData(o[d].x,o[d].y,o[d].width,o[d].height);s.getContext("2d").putImageData(p,o[d].x,o[d].y),r.style.opacity="0.3"}var c=r.getContext("2d").getImageData(0,0,this.availableSize.width,a.y),c=(s.getContext("2d").putImageData(c,0,0),r.getContext("2d").getImageData(0,l,this.availableSize.width,this.availableSize.height-l)),l=(s.getContext("2d").putImageData(c,0,a.y+a.height),r.getContext("2d").getImageData(h,0,this.availableSize.width-h,this.availableSize.height)),c=(s.getContext("2d").putImageData(l,h,0),r.getContext("2d").getImageData(0,0,a.x,this.availableSize.height));s.getContext("2d").putImageData(c,0,0),p9t(this.element.id+"_selectedCells")}}else if(0!==this.multiCellCollection.length){for(var u=document.getElementById(this.element.id+"_Container_RectGroup"),g=document.getElementById(this.element.id+"_Container_TextGroup"),d=0;d<u.childNodes.length;d++)u.childNodes[d].setAttribute("opacity","0.3"),this.cellSettings.showLabel&&g.childNodes[d]&&g.childNodes[d].setAttribute("opacity","0.3");for(d=0;d<this.multiCellCollection.length;d++){var m,f=this.multiCellCollection[d].cellElement.id.replace(this.element.id+"_HeatMapRect_",""),f=parseInt(f,10);u.childNodes[f].setAttribute("opacity","1"),this.cellSettings.showLabel&&g.childNodes[d]&&((m=document.getElementById(this.element.id+"_HeatMapRectLabels_"+f))&&m.setAttribute("opacity","1"),this.addSvgClass(u.childNodes[f]))}}},nqt.prototype.clearSVGSelection=function(){for(var e=document.getElementById(this.element.id+"_Container_RectGroup"),t=document.getElementById(this.element.id+"_Container_TextGroup"),i=0;i<e.childNodes.length;i++){var n=e.childNodes[i].getAttribute("class");n===this.element.id+"_selected"&&this.removeSvgClass(e.childNodes[i],n),e.childNodes[i].setAttribute("opacity","1"),this.cellSettings.showLabel&&t.childNodes[i]&&t.childNodes[i].setAttribute("opacity","1")}},nqt.prototype.calculateMaxLength=function(){var e=this.completeAdaptDataSource;if(e&&0<e.length){for(var t=e.length-1,i=0,n=0;n<=t;n++)var o=e[n].length,i=o<i?i:o;this.axisCollections[0].maxLength=t,this.axisCollections[1].maxLength=i-1}else this.axisCollections[0].maxLength=0,this.axisCollections[1].maxLength=0},nqt.prototype.setMouseXY=function(e,t){var i=this.element.getBoundingClientRect(),n=(this.enableCanvasRendering?document.getElementById(this.element.id+"_canvas"):document.getElementById(this.element.id+"_svg")).getBoundingClientRect();this.mouseX=e-i.left-Math.max(n.left-i.left,0),this.mouseY=t-i.top-Math.max(n.top-i.top,0)},nqt.prototype.triggerClickEvent=function(e,t,i){var n,o=this.element.getBoundingClientRect(),r=("touchstart"===e.type?(t||(this.isTouch=!0),n=e.changedTouches[0].clientY,e.changedTouches[0]):(t||(this.isTouch=!1),n=e.clientY,e)).clientX;return r-=o.left,n-=o.top,this.isHeatmapRect(r,n)&&(o=this.heatMapSeries.getCurrentRect(r,n),this.trigger(t?"cellDoubleClick":"cellClick",{heatmap:this,value:o.value,x:o.x,y:o.y,xLabel:this.heatMapSeries.hoverXAxisLabel,yLabel:this.heatMapSeries.hoverYAxisLabel,xValue:this.heatMapSeries.hoverXAxisValue,yValue:this.heatMapSeries.hoverYAxisValue,cellElement:this.enableCanvasRendering?null:document.getElementById(o.id),hasRightClicked:i,event:e})),{x:r,y:n}},nqt.prototype.heatMapMouseRightClick=function(e){this.triggerClickEvent(e,!1,!0)},nqt.prototype.heatMapMouseDoubleClick=function(e){this.triggerClickEvent(e,!0,!1)},nqt.prototype.heatMapMouseClick=function(e){var t=this.triggerClickEvent(e,!1,!1),i=t.x,n=t.y;if(this.notify("click",e),this.isHeatmapRect(i,n)&&this.currentRect&&(je(t=document.getElementById(this.currentRect.id))||t.focus()),"Gradient"!==this.paletteSettings.type&&this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType)for(var e=this.legendModule.navigationCollections,o=(e.length&&i>e[0].x&&i<e[0].x+e[0].width&&n>e[0].y&&n<e[0].y+e[0].height?this.legendModule.translatePage(this,this.legendModule.currentPage,!0):e.length&&i>e[1].x&&i<e[1].x+e[1].width&&n>e[1].y&&n<e[1].y+e[1].height&&this.legendModule.translatePage(this,this.legendModule.currentPage,!1),this.legendModule.legendRange),r=this.legendModule.legendTextRange,s=!0,a=0;a<o.length;a++)this.legendModule&&this.legendSettings.toggleVisibility&&this.legendModule.currentPage===o[a].currentPage&&(s&&i>=o[a].x&&i<=o[a].width+o[a].x&&n>=o[a].y&&n<=o[a].y+o[a].height||this.legendSettings.showLabel&&"None"!==this.legendSettings.labelDisplayType&&i>=r[a].x&&i<=r[a].width+r[a].x&&n>=r[a].y&&n<=r[a].y+r[a].height)&&(this.legendModule.legendRangeSelection(a),s=!1);return!1},nqt.prototype.heatMapMouseMove=function(e){var t,i,n=this.element.getBoundingClientRect(),o=("touchmove"===e.type||"touchstart"===e.type?(this.isTouch=!0,t=(i=e).changedTouches[0].clientX,i.changedTouches[0]):(this.isTouch=!1,t=e.clientX,e)).clientY;return this.removeFocus("none"),t-=n.left,o-=n.top,this.setMouseXY(t,o),this.mouseAction(e,t,o,i,n),!0},nqt.prototype.mouseAction=function(e,t,i,n,o){var r,s,a;return e.target&&e.target.id&&(r=this.isHeatmapRect(t,i),a=void(this.legendModule&&(r?"Gradient"===this.paletteSettings.type&&this.legendSettings.showGradientPointer&&this.legendSettings.visible&&this.legendVisibilityByCellType&&this.legendModule.renderGradientPointer(e,t,i):this.legendModule.removeGradientPointer(),this.renderMousePointer(t,i))),s=void 0,a=!(!this.showTooltip||!this.tooltipModule)&&r,r&&(s=this.heatMapSeries.getCurrentRect(t,i),2!==e.which)&&3!==e.which&&(a=this.cellSelectionOnMouseMove(e,s,t,i,a)),this.tooltipOnMouseMove(e,s,a,r),this.legendModule&&this.legendSettings.visible&&"Fixed"===this.paletteSettings.type&&this.legendSettings.enableSmartLegend&&"None"===this.legendSettings.labelDisplayType&&this.legendModule.createTooltip(t,i),this.enableCanvasRendering?(this.element.getBoundingClientRect(),s="Fixed"!==this.paletteSettings.type||!this.legendSettings.enableSmartLegend||"None"!==this.legendSettings.labelDisplayType,(a=f9t(this.tooltipCollection,t,i)||this.legendModule&&s&&(!je(this.legendModule.legendLabelTooltip)&&f9t(this.legendModule.legendLabelTooltip,t,i)||!je(this.legendModule.legendTitleTooltip)&&f9t(this.legendModule.legendTitleTooltip,t,i)))?d9t(a,t,i,this.element.offsetWidth,this.element.id+"_canvas_Tooltip",u9t(this.element.id+"_Secondary_Element"),this.isTouch,this):p9t(this.element.id+"_canvas_Tooltip")):(this.titleSettings.text&&"Trim"===this.titleSettings.textStyle.textOverflow&&this.titleTooltip(e,t,i,this.isTouch),this.axisTooltip(e,t,i,this.isTouch),this.legendModule&&this.legendSettings.visible&&this.legendSettings.showLabel&&this.legendVisibilityByCellType&&this.legendModule.renderLegendLabelTooltip(e,t,i),this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType&&this.legendModule.renderLegendTitleTooltip(e,t,i))),!0},nqt.prototype.cellSelectionOnMouseMove=function(e,t,i,n,o){return("Rect"===this.cellSettings.tileType&&"mousedown"===e.type||"touchstart"===e.type||"pointerdown"===e.type)&&this.allowSelection&&(this.previousRect=t,this.multiSelection=!0,this.rectSelected=!0,this.initialCellX=i,this.initialCellY=n,e.preventDefault()),"Rect"===this.cellSettings.tileType&&this.multiSelection&&t&&(o=!1,this.highlightSelectedCells(this.previousRect,t,i,n,e)),o},nqt.prototype.tooltipOnMouseMove=function(e,t,i,n){var o,r=this;i&&t?this.tempTooltipRectId!==t.id&&(this.showTooltip&&((this.cellSettings.enableCellHighlighting||this.tooltipModule&&this.showTooltip)&&!this.enableCanvasRendering&&this.heatMapSeries.highlightSvgRect(t.id),!this.tooltipTimer||je(e)||"touchstart"!==e.type&&"touchmove"!==e.type||(window.clearTimeout(this.tooltipTimer),this.tooltipTimer=null),this.tooltipModule.renderTooltip(t),o=this.tooltipModule.tooltipObject,this.isTouch)&&(this.tooltipTimer=setTimeout(function(){je(o)||je(document.getElementById(o.element.id))||je(document.getElementById(o.element.id).firstChild)||o.fadeOut(),r.tooltipModule.isFadeout=!0,window.clearTimeout(r.tooltipTimer),r.tooltipTimer=null},1500),e)&&"touchmove"===e.type&&e.cancelable&&e.preventDefault(),this.tempTooltipRectId=t.id):(null!==e&&(n?!this.showTooltip&&5<this.cellSettings.border.width&&this.heatMapSeries.highlightSvgRect(e.target.id):((this.cellSettings.enableCellHighlighting||this.showTooltip)&&!this.enableCanvasRendering&&this.cellSettings.border.width<5&&this.heatMapSeries.highlightSvgRect(e.target.id),this.tooltipModule&&this.showTooltip&&this.tooltipModule.showHideTooltip(!1,!0))),this.tempTooltipRectId="")},nqt.prototype.highlightSelectedCells=function(e,t,i,n,o){var r=e.xIndex,s=e.yIndex,a=t.xIndex,l=t.yIndex,a=(this.currentRect=t,this.selectedCellsRect=new _7t(0,0,0,0),this.selectedCellsRect.x=(e.x>t.x?t:e).x,this.selectedCellsRect.y=(e.y>t.y?t:e).y,this.selectedCellsRect.width=(1+(e.x>t.x?r-a:a-r))*t.width,this.selectedCellsRect.height=(1+(e.y>t.y?s-l:l-s))*t.height,"touchstart"!==o.type||0!==this.multiCellCollection.length||this.isCellTapHold?this.isCellTapHold=!1:this.isCellTapHold=!0,o.preventDefault(),this.initialCellX>i?i:this.initialCellX),r=this.initialCellY>n?n:this.initialCellY,e=new _7t(a-this.initialClipRect.x,r-this.initialClipRect.y,Math.abs(i-this.initialCellX),Math.abs(n-this.initialCellY)),s=(0<e.width&&this.enableMultiSelect&&!1===o.ctrlKey&&(this.removeSelectedCellsBorder(!1),l=document.getElementById(this.element.id+"Celltooltipcontainer_svg"))&&(this.tooltipModule.tooltipObject=null,l.setAttribute("opacity","0")),document.getElementById(this.element.id+"_CellSelection_Container")),t=this.renderer.createSvg({id:this.element.id+"_CellSelection_Container_svg",width:this.initialClipRect.width,height:this.initialClipRect.height}),a=(s.appendChild(t),document.getElementById(this.element.id+"_CellSelection_Container_svg"));this.enableMultiSelect&&(r=new F7t(this.element.id+"_selectedCells","#87ceeb",{color:"transparent",width:1},1,e,"#0000ff"),a.appendChild(this.renderer.drawRectangle(r)),document.getElementById(this.element.id+"_selectedCells").style.opacity="0.5")},nqt.prototype.getDataCollection=function(){var e,t,i,n,o,r,s,a,l,h;je(this.previousRect)||je(this.currentRect)||(r=this.previousRect.xIndex,e=this.previousRect.yIndex,n=this.currentRect.xIndex,t=this.currentRect.yIndex,l=this.previousRect.x,h=this.previousRect.y,this.getCellCollection(this.currentRect,this.previousRect,!0,s=i=r<n?r:n,a=o=e<t?e:t,n=r<n?n:r,r=e<t?t:e,i,l,h),s=i,a=o,l=this.previousRect.x,h=this.previousRect.y,this.checkSelectedCells(),this.getCellCollection(this.currentRect,this.previousRect,!1,s,a,n,r,i,l,h),this.selectedMultiCellCollection=[],this.canvasSelectedCells=new _7t(0,0,0,0),this.selectedCellCount=0)},nqt.prototype.getCellCollection=function(e,t,i,n,o,r,s,a,l,h){for(var d=Math.abs(e.xIndex===t.xIndex?0:e.xIndex-t.xIndex)+1,p=Math.abs(e.yIndex===t.yIndex?0:e.yIndex-t.yIndex)+1,c=0;c<d*p;c++)i?this.getSelectedCellData(l,h,!0):this.getSelectedCellData(l,h,!1),n<r?(l+=e.xIndex>t.xIndex?e.width:-e.width,n++):o<s&&(h+=e.yIndex>t.yIndex?e.height:-e.height,l=t.x,n=a)},nqt.prototype.removeSelectedCellsBorder=function(e){if(this.enableCanvasRendering){for(var t=this.secondaryCanvasRenderer.ctx,i=0;i<this.previousSelectedCellsRect.length;i++){var n=this.previousSelectedCellsRect[i];t.save(),t.clearRect(n.x-1,n.y-1,n.width+2,n.height+2),t.restore()}for(i=0;i<this.multiCellCollection.length;i++){var o=this.multiCellCollection[i];0<this.multiCellCollection.length&&(t.save(),t.clearRect(o.x-1,o.y-1,o.width+2,o.height+2))}}else for(var r=document.getElementById(this.element.id+"_Container_RectGroup"),s=document.getElementById(this.element.id+"_Container_TextGroup"),i=0;i<r.childNodes.length;i++){var a=r.childNodes[i].getAttribute("class");e?(r.childNodes[i].setAttribute("opacity","1"),this.cellSettings.showLabel&&s.childNodes[i]&&(s.childNodes[i].setAttribute("opacity","1"),this.removeSvgClass(r.childNodes[i],a))):(r.childNodes[i].setAttribute("opacity","0.3"),this.cellSettings.showLabel&&s.childNodes[i]&&(s.childNodes[i].setAttribute("opacity","0.3"),this.removeSvgClass(r.childNodes[i],a)))}},nqt.prototype.highlightSelectedAreaInCanvas=function(e){var t,i,n,o;e.x&&(t=document.getElementById(this.element.id+"_canvas"),i=document.getElementById(this.element.id+"_secondary_canvas"),n=this.initialClipRect,o=t.getContext("2d").getImageData(e.x,e.y,e.width,e.height),i.getContext("2d").putImageData(o,e.x,e.y),t.style.opacity="0.3",o=t.getContext("2d").getImageData(0,0,this.availableSize.width,n.y),i.getContext("2d").putImageData(o,0,0),e=t.getContext("2d").getImageData(0,n.y+n.height,this.availableSize.width,this.availableSize.height-(n.y+n.height)),i.getContext("2d").putImageData(e,0,n.y+n.height),o=t.getContext("2d").getImageData(n.x+n.width,0,this.availableSize.width-(n.x+n.width),this.availableSize.height),i.getContext("2d").putImageData(o,n.x+n.width,0),e=t.getContext("2d").getImageData(0,0,n.x,this.availableSize.height),i.getContext("2d").putImageData(e,0,0))},nqt.prototype.getSelectedCellData=function(e,t,i){var n=this.axisCollections[0],o=this.axisCollections[1],r=n.tooltipLabels,s=o.tooltipLabels.slice().reverse(),e=this.heatMapSeries.getCurrentRect(e+1,t+1),t=document.getElementById(e.id),a=new B7t(null,"","",0,0,null,0,0,0,0,0,0);if(a.value=e.value,a.xLabel=r[e.xIndex].toString(),a.yLabel=s[e.yIndex].toString(),a.xValue=n.labelValue[e.xIndex],a.yValue=o.labelValue.slice().reverse()[e.yIndex],a.cellElement=this.enableCanvasRendering?null:t,a.xPosition=e.xIndex,a.yPosition=e.yIndex,a.width=this.currentRect.width,a.height=this.currentRect.height,a.x=this.currentRect.x,a.y=this.currentRect.y,this.currentRect.allowCollection=!0,this.addSvgClass(t),i)this.selectedMultiCellCollection.push(a),this.currentRect.allowCollection=!1;else for(var l=0;l<this.multiCellCollection.length;l++)if(this.multiCellCollection[l].xPosition===a.xPosition&&this.multiCellCollection[l].yPosition===a.yPosition&&(this.currentRect.allowCollection=!1,this.selectedCellCount===this.selectedMultiCellCollection.length)){if(this.currentRect.allowCollection=!1,this.enableCanvasRendering){var h=this.secondaryCanvasRenderer.ctx,d=this.canvasSelectedCells;h.save(),h.clearRect(d.x-1,d.y-1,d.width+2,d.height+2),h.restore(),this.selectedCellsRect=new _7t(0,0,0,0)}else for(var p=0;p<this.selectedMultiCellCollection.length;p++){var c,u,g=this.selectedMultiCellCollection[p].cellElement;g&&(u=g.id.replace(this.element.id+"_HeatMapRect_",""),document.getElementById(this.element.id+"_Container_TextGroup"),c=g.getAttribute("class"),g.setAttribute("opacity","0.3"),(u=document.getElementById(this.element.id+"_HeatMapRectLabels_"+u))&&u.setAttribute("opacity","0.3"),this.removeSvgClass(g,c))}this.multiCellCollection.splice(l,1)}e.visible&&!je(e.value)&&!0===this.currentRect.allowCollection&&this.multiCellCollection.push(a)},nqt.prototype.addSvgClass=function(e){var t;this.enableCanvasRendering||(t=this.element.id+"_selected",e.classList.add(t))},nqt.prototype.removeSvgClass=function(e,t){t&&e.setAttribute("class",t.replace(t,""))},nqt.prototype.clearSelection=function(){if(!this.enableCanvasRendering&&this.allowSelection&&this.clearSVGSelection(),this.enableCanvasRendering){for(var e=this.secondaryCanvasRenderer.ctx,t=0;t<this.previousSelectedCellsRect.length;t++)e.save(),e.clearRect(this.previousSelectedCellsRect[t].x-1,this.previousSelectedCellsRect[t].y-1,this.previousSelectedCellsRect[t].width+2,this.previousSelectedCellsRect[t].height+2),e.restore();for(t=0;t<this.multiCellCollection.length;t++){var i=this.multiCellCollection[t];0<this.multiCellCollection.length&&(e.save(),e.clearRect(i.x-1,i.y-1,i.width+2,i.height+2))}document.getElementById(this.element.id+"_canvas").style.opacity="1"}this.tempMultiCellCollection=[],this.multiCellCollection=[],this.rectSelected=!1},nqt.prototype.renderMousePointer=function(e,t){for(var i,n=this.legendModule.legendRange,o=this.legendModule.legendTextRange,r=!0,s=0;s<n.length;s++)this.legendSettings.toggleVisibility&&this.legendModule.currentPage===n[s].currentPage&&(r&&e>=n[s].x&&e<=n[s].width+n[s].x&&t>=n[s].y&&t<=n[s].y+n[s].height||this.legendSettings.showLabel&&"None"!==this.legendSettings.labelDisplayType&&e>=o[s].x&&e<=o[s].width+o[s].x&&t>=o[s].y&&t<=o[s].y+o[s].height?(this.enableCanvasRendering?document.getElementById(this.element.id+"_canvas").style.cursor="Pointer":(document.getElementById(this.element.id+"_svg").style.cursor="Pointer",je(i=document.getElementById(this.element.id+"legendLabelTooltipContainer"))||(i.style.cursor="Pointer")),r=!1):r&&(this.enableCanvasRendering?document.getElementById(this.element.id+"_canvas").style.cursor="":document.getElementById(this.element.id+"_svg").style.cursor=""))},nqt.prototype.heatMapMouseLeave=function(e){var t,i=this;if(e.target&&e.target.id&&(this.cellSettings.enableCellHighlighting||this.tooltipModule&&this.showTooltip)&&!this.enableCanvasRendering&&this.heatMapSeries.highlightSvgRect(this.tempTooltipRectId),this.allowSelection&&this.multiSelection&&(this.multiSelection=!1,"mouseup"===e.type||"mouseleave"===e.type||"touchend"===e.type||"pointerup"===e.type)&&2!==e.which&&3!==e.which)if(!1===this.isCellTapHold){var n,o,r,s=document.getElementById(this.element.id+"_selectedCells");if(!(0<(je(s)?(n=o=void 0,r=this.element.getBoundingClientRect(),o=("touchend"===e.type?(this.isTouch=!0,n=e.changedTouches[0].clientY,e.changedTouches[0]):(this.isTouch=!1,n=e.clientY,e)).clientX,o-=r.left,n-=r.top,r=this.initialCellX>o?o:this.initialCellX,h=this.initialCellY>n?n:this.initialCellY,new _7t(r-this.initialClipRect.x,h-this.initialClipRect.y,0!==Math.abs(o-this.initialCellX)?Math.abs(o-this.initialCellX):Math.abs(n-this.initialCellY),Math.abs(n-this.initialCellY))):(r=s.getClientRects()[0],new _7t(r.left,r.top,r.width,r.height))).width)||this.enableMultiSelect){for(var a=[],l=0;l<this.multiCellCollection.length;l++)a.push(this.multiCellCollection[l]);!1!==e.ctrlKey&&this.enableMultiSelect||(this.multiCellCollection=[]),this.getDataCollection();var h={heatmap:this,cancel:!1,name:"cellSelected",data:this.multiCellCollection};this.trigger("cellSelected",h),h.cancel?(this.multiCellCollection=a,(0<this.multiCellCollection.length||!1===e.ctrlKey||!this.enableMultiSelect)&&this.removeSelectedCellsBorder(!0)):(!1!==e.ctrlKey&&this.enableMultiSelect||this.removeSelectedCellsBorder(!1),this.currentRect.allowCollection=!1),this.setCellOpacity(),"touchend"===e.type&&(window.clearTimeout(this.tooltipTimer),this.tooltipOnMouseMove(null,this.currentRect,!0))}}else this.isCellTapHold=!1;return this.tooltipModule&&this.showTooltip&&"mouseleave"===e.type&&this.tooltipModule.showHideTooltip(!1),this.tempTooltipRectId="",this.legendModule&&this.legendSettings.visible&&this.legendModule.tooltipObject&&this.legendModule.tooltipObject.element&&(t=this.legendModule.tooltipObject.element.firstChild,"mouseleave"===e.type?t.setAttribute("opacity","0"):(this.legendTooltipTimer&&window.clearTimeout(this.legendTooltipTimer),this.legendTooltipTimer=setTimeout(function(){t.setAttribute("opacity","0")},1500))),"Gradient"===this.paletteSettings.type&&this.legendModule&&this.legendSettings.showGradientPointer&&this.legendSettings.visible&&this.legendVisibilityByCellType&&("mouseleave"===e.type?this.legendModule.removeGradientPointer():(this.gradientTimer&&window.clearTimeout(this.gradientTimer),this.gradientTimer=setTimeout(function(){i.legendModule.removeGradientPointer()},1500))),this.enableCanvasRendering&&(o=document.getElementById(this.element.id+"_hoverRect_canvas"))&&(o.style.visibility="hidden",this.tempRectHoverClass=""),this.titleSettings.text&&-1!==this.titleCollection[0].indexOf("...")&&(e.cancelable&&e.preventDefault(),this.isTouch||(this.enableCanvasRendering?p9t(this.element.id+"_canvas_Tooltip"):p9t(this.element.id+"_Title_Tooltip"))),!0},nqt.prototype.heatMapKeyUp=function(e){var t,i;"Tab"===e.code&&(this.removeFocus("none"),this.tooltipModule&&this.tooltipModule.showHideTooltip(!1),t=-1<(e=e.target).id.indexOf("HeatMapRect"),i=-1<e.id.indexOf("Legend"),!this.cellSettings.enableCellHighlighting||i||this.rectSelected?(t&&this.allowSelection||i&&this.legendSettings.toggleVisibility||-1<e.id.indexOf("arrow"))&&(e.style.outline="2px solid black",e.classList.add("keyboard-focused")):this.heatMapSeries.highlightSvgRect(e.id))},nqt.prototype.heatMapKeyDown=function(e){var t;"Enter"===e.code&&(e.ctrlKey||(this.multiCellCollection=[]),this.removeFocus("none"),e=e.target,this.allowSelection&&-1<e.id.indexOf("HeatMapRect")&&"Rect"===this.cellSettings.tileType?(this.previousRect=this.currentRect=this.getRectElement(e.id),this.removeSelectedCellsBorder(!1),this.getDataCollection(),this.setCellOpacity(),this.rectSelected=!0):this.legendModule&&this.legendSettings.visible&&(je(t=this.calculateLegendIndex(e))||this.legendModule.legendRangeSelection(t),e=document.getElementById(e.id),this.handleArrowNavigation(e),e.setAttribute("tabindex","0"),e.focus()))},nqt.prototype.calculateLegendIndex=function(e){if(this.legendSettings.toggleVisibility){if(-1<e.id.indexOf("Legend_Index"))return parseFloat(e.id.split("Legend_Index_")[1]);if(-1<e.id.indexOf("_Smart_Legend_Group_"))return parseFloat(e.id.split("_Smart_Legend_Group_")[1])}return null},nqt.prototype.handleArrowNavigation=function(e){var t,i;-1<e.id.indexOf("arrow")&&((t=this.legendModule.currentPage)<(i=this.legendColorCollection.length/this.legendModule.listPerPage)&&-1<e.id.indexOf("rightarrow")?this.legendModule.translatePage(this,t,!0):t<=i&&-1<e.id.indexOf("leftarrow")&&this.legendModule.translatePage(this,t,!1))},nqt.prototype.getRectElement=function(e){for(var t=this.heatMapSeries.rectPositionCollection,i=0;i<t.length;i++)for(var n=0;n<t[i].length;n++)if(t[i][n].id===e)return t[i][n];return null},nqt.prototype.removeFocus=function(e){var t=document.querySelector(".keyboard-focused");t&&(t.style.outline=e,t.classList.remove("keyboard-focused"))},nqt.prototype.checkSelectedCells=function(){if(this.enableCanvasRendering){this.canvasSelectedCells=new _7t(0,0,0,0),this.canvasSelectedCells.x=this.selectedCellsRect.x,this.canvasSelectedCells.y=this.selectedCellsRect.y,this.canvasSelectedCells.width=this.selectedCellsRect.width,this.canvasSelectedCells.height=this.selectedCellsRect.height;for(e=0;e<this.multiCellCollection.length;e++)for(t=0;t<this.selectedMultiCellCollection.length;t++)this.selectedMultiCellCollection[t].xPosition===this.multiCellCollection[e].xPosition&&this.selectedMultiCellCollection[t].yPosition===this.multiCellCollection[e].yPosition&&this.selectedCellCount++;this.legendModule&&this.rectSelected&&"Gradient"===this.paletteSettings.type&&this.legendModule.removeGradientPointer()}else for(var e=0;e<this.multiCellCollection.length;e++)for(var t=0;t<this.selectedMultiCellCollection.length;t++)this.selectedMultiCellCollection[t].cellElement.getAttribute("id")===this.multiCellCollection[e].cellElement.getAttribute("id")&&this.selectedCellCount++},nqt.prototype.removeOpacity=function(e,t){for(var i=0;i<e.childNodes.length;i++)e.childNodes[i].setAttribute("opacity","0.3"),this.cellSettings.showLabel&&t.childNodes[i]&&t.childNodes[i].setAttribute("opacity","0.3")},nqt.prototype.setCellOpacity=function(){if(this.enableCanvasRendering)this.previousSelectedCellsRect.push(this.selectedCellsRect),this.highlightSelectedAreaInCanvas(this.selectedCellsRect);else if(0!==this.multiCellCollection.length){this.tempMultiCellCollection.push(this.multiCellCollection);var e=document.getElementById(this.element.id+"_Container_RectGroup"),t=document.getElementById(this.element.id+"_Container_TextGroup");this.removeOpacity(e,t);for(var i=0;i<this.multiCellCollection.length;i++){var n=this.multiCellCollection[i].cellElement,n=parseInt(n.id.replace(this.element.id+"_HeatMapRect_",""),10);e.childNodes[n].setAttribute("opacity","1"),e.childNodes[n].setAttribute("tabindex","0"),this.cellSettings.showLabel&&(n=document.getElementById(this.element.id+"_HeatMapRectLabels_"+n))&&n.setAttribute("opacity","1")}}p9t(this.element.id+"_selectedCells")},nqt.prototype.createMultiCellDiv=function(e){e?((e=this.createElement("div",{id:this.element.id+"_Multi_CellSelection_Canvas"})).style.position="relative",this.element.appendChild(e),this.svgObject.style.position="absolute",this.svgObject.style.left="0px",this.svgObject.style.top="0px",this.svgObject.style.zIndex="0"):(e=void 0,(e=je(e=document.getElementById(this.element.id+"_secondary_canvas"))?this.secondaryCanvasRenderer.createCanvas({width:this.availableSize.width,height:this.availableSize.height,x:0,y:0}):e).style.cssText="position: relative; z-index: 1",this.element.appendChild(e))},v4([e(null)],nqt.prototype,"width",void 0),v4([e(null)],nqt.prototype,"height",void 0),v4([e(!0)],nqt.prototype,"showTooltip",void 0),v4([i()],nqt.prototype,"tooltipRender",void 0),v4([i()],nqt.prototype,"resized",void 0),v4([i()],nqt.prototype,"loaded",void 0),v4([i()],nqt.prototype,"cellRender",void 0),v4([i()],nqt.prototype,"cellSelected",void 0),v4([e("SVG")],nqt.prototype,"renderingMode",void 0),v4([e(null)],nqt.prototype,"dataSource",void 0),v4([t({},iz)],nqt.prototype,"dataSourceSettings",void 0),v4([e(null)],nqt.prototype,"backgroundColor",void 0),v4([e("Material")],nqt.prototype,"theme",void 0),v4([e(!1)],nqt.prototype,"allowSelection",void 0),v4([e(!0)],nqt.prototype,"enableMultiSelect",void 0),v4([e(!1)],nqt.prototype,"enableHtmlSanitizer",void 0),v4([t({},a2t)],nqt.prototype,"margin",void 0),v4([t({text:"",textStyle:dLi.heatMapTitleFont},f2t)],nqt.prototype,"titleSettings",void 0),v4([t({},NVt)],nqt.prototype,"xAxis",void 0),v4([t({position:"Right"},Fm)],nqt.prototype,"legendSettings",void 0),v4([t({},O2t)],nqt.prototype,"paletteSettings",void 0),v4([t({},W$e)],nqt.prototype,"tooltipSettings",void 0),v4([t({},NVt)],nqt.prototype,"yAxis",void 0),v4([t({},TH)],nqt.prototype,"cellSettings",void 0),v4([i()],nqt.prototype,"created",void 0),v4([i()],nqt.prototype,"load",void 0),v4([i()],nqt.prototype,"cellClick",void 0),v4([i()],nqt.prototype,"cellDoubleClick",void 0),v4([i()],nqt.prototype,"legendRender",void 0),v4([Bt],nqt));function nqt(){var e=null!==iqt&&iqt.apply(this,arguments)||this;return e.enableCanvasRendering=!1,e.isColorRange=!1,e.isCellTapHold=!1,e.selectedCellCount=0,e.toggleValue=[],e.legendOnLoad=!0,e.resizing=!1,e.rendering=!0,e.multiSelection=!1,e.rectSelected=!1,e.previousSelectedCellsRect=[],e.multiCellCollection=[],e.selectedMultiCellCollection=[],e.tempMultiCellCollection=[],e.tooltipCollection=[],e.isCellData=!1,e}hft.Inject(KH,i0,m4);W=Object.freeze({__proto__:null,HeatMap:hft,Axis:NVt,AxisHelper:P9t,Data:iz,AdaptiveMinMax:J9t,Adaptor:m4,TwoDimensional:j9t,LegendSettings:Fm,Legend:KH,Font:o2t,Margin:a2t,Border:Qmt,TooltipBorder:ost,BubbleData:jee,Title:f2t,FillColor:b2t,PaletteCollection:S2t,AxisLabelBorder:I2t,BubbleSize:D2t,MultiLevelCategories:Bft,MultiLevelLabels:d,ColorCollection:a7t,BubbleTooltipData:l7t,LegendColorCollection:h7t,MultipleRow:d7t,CellSettings:TH,Series:O9t,PaletteSettings:O2t,RgbColor:g7t,CellColor:m7t,TooltipSettings:W$e,Tooltip:i0,ExportUtils:$9t,stringToNumber:v7t,measureText:b7t,TextElement:w7t,titlePositionX:C7t,Size:x7t,CustomizeOption:S7t,PathOption:I7t,createLabelTemplate:E7t,getTemplateFunction:D7t,convertElement:M7t,CurrentRect:P7t,SelectedCellDetails:B7t,RectOption:F7t,CircleOption:O7t,Rect:_7t,TextOption:H7t,TextBasic:W7t,Line:Q7t,LineOption:U7t,PathAttributes:Y7t,Path:K7t,sum:J7t,titlePositionY:Z7t,rotateTextSize:$7t,DrawSvgCanvas:e9t,getTitle:i9t,getSanitizedTexts:n9t,getIsLineBreakLabel:o9t,textWrap:r9t,textTrim:s9t,textNone:a9t,Gradient:l9t,GradientColor:h9t,showTooltip:d9t,removeElement:p9t,removeMeasureElement:c9t,getElement:u9t,increaseDateTimeInterval:g9t,CanvasTooltip:m9t,getTooltipText:f9t,PaletterColor:y9t,GradientPointer:v9t,CurrentLegendRect:b9t,LegendRange:w9t,ToggleVisibility:C9t,colorNameToHex:S9t,convertToHexCode:A9t,componentToHex:x9t,convertHexToColor:I9t,formatValue:T9t,MultiLevelPosition:E9t}),IP.Inject(_G,gG,hk,eG,YG,QG,qG,KG,ZG,lY,pk,xY,uX,jG,pK,uK,bK,SK,xK,TK,mX,kK,BK,pX),Sg=Object.freeze({__proto__:null,CheckBoxFilterBase:B_,ExcelFilterBase:Zq,SortDescriptor:_k,SortSettings:jk,Predicate:Uk,InfiniteScrollSettings:Yk,FilterSettings:Jk,SelectionSettings:eP,SearchSettings:nP,RowDropSettings:sP,TextWrapSettings:hP,ResizeSettings:cP,GroupSettings:mP,EditSettings:vP,LoadingIndicator:CP,Grid:IP,get CellType(){return LA},get RenderType(){return RA},get ToolbarItem(){return OA},get ResponsiveDialogAction(){return NA},get ResponsiveToolbarAction(){return VA},doesImplementInterface:MP,valueAccessor:kP,headerValueAccessor:function(e,t){return je(e)||""===e?"":Sa.getObject(e,t)},getUpdateUsingRaf:PP,isExportColumns:BP,updateColumnTypeForExportColumns:FP,updatecloneRow:LP,getCollapsedRowsCount:OP,recursive:NP,iterateArrayOrObject:VP,iterateExtend:_P,templateCompiler:HP,setStyleAndAttributes:zP,extend:jP,setColumnIndex:WP,prepareColumns:QP,setCssInGridPopUp:UP,getActualProperties:qP,parentsUntil:A,getElementIndex:GP,inArray:YP,getActualPropFromColl:XP,removeElement:KP,getPosition:JP,getUid:$P,appendChildren:eB,parents:tB,calculateAggregate:iB,getScrollBarWidth:aB,getRowHeight:lB,getActualRowHeight:function(e){var t=Q("table",{className:QE,attrs:{role:"grid"}}),i=(t.style.visibility="hidden",t.innerHTML='<tr><td class="e-rowcell">A<td></tr>',e.appendChild(t),t.querySelector("tr").getBoundingClientRect());return e.removeChild(t),i.height},isComplexField:hB,getComplexFieldID:dB,getParsedFieldID:pB,setComplexFieldID:cB,isEditable:uB,isCellHaveWidth:gB,isActionPrevent:mB,wrap:fB,setFormatter:yB,addRemoveActiveClasses:vB,distinctStringValues:bB,getFilterMenuPostion:wB,getZIndexCalcualtion:CB,toggleFilterUI:SB,toogleCheckbox:AB,setChecked:xB,createCboxWithWrap:IB,removeAddCboxClasses:TB,refreshForeignData:EB,getForeignData:DB,getColumnByForeignKeyValue:MB,padZero:kB,getDatePredicate:PB,isGroupAdaptive:BB,getObject:FB,getCustomDateFormat:LB,getExpandedState:RB,getPrintGridModel:OB,extendObjWithFn:NB,getPrototypesOfObj:VB,measureColumnDepth:_B,checkDepth:HB,refreshFilteredColsUid:zB,get Global(){return rB},getTransformValues:jB,applyBiggerTheme:WB,getScrollWidth:QB,resetColspanGroupCaption:UB,groupCaptionRowLeftRightPos:qB,ensureLastRow:GB,ensureFirstRow:YB,isRowEnteredInGrid:XB,getEditedDataIndex:KB,eventPromise:JB,getStateEventArgument:ZB,ispercentageWidth:$B,resetRowIndex:eF,resetCachedRowIndex:tF,groupReorderRowObject:iF,compareChanges:nF,setRowElements:oF,sliceElements:function(e,t,i){for(var n=e.children.length,o=0,r=0;r<n;r++,o++)t<=r&&r<i||(e.removeChild(e.children[parseInt(o.toString(),10)]),o--)},resetDialogAppend:rF,isChildColumn:sF,pushuid:aF,frozenDirection:lF,addFixedColumnBorder:hF,applyStickyLeftRightPosition:dF,resetColandRowSpanStickyPosition:pF,getCellFromRow:cF,addStickyColumnPosition:uF,getCellsByTableName:gF,getCellByColAndRowIndex:mF,setValidationRuels:fF,getNumberFormat:yF,addBiggerDialog:vF,performComplexDataOperation:bF,setDisplayValue:wF,addRemoveEventListener:CF,createEditElement:SF,getColumnModelByUid:AF,getColumnModelByFieldName:xF,registerEventHandlers:IF,removeEventHandlers:TF,clearReactVueTemplates:EF,infiniteRemoveElements:DF,infiniteAppendElements:MF,getListHeight:kF,getRowIndexFromElement:PF,getParentIns:BF,generateExpandPredicates:FF,getPredicates:LF,getGroupKeysAndFields:RF,findCellIndex:OF,capitalizeFirstLetter:NF,checkIsVirtual:VF,getVisiblePage:_F,created:"create",destroyed:"destroy",load:_A,rowDataBound:HA,queryCellInfo:zA,headerCellInfo:jA,actionBegin:WA,actionComplete:QA,actionFailure:UA,dataBound:qA,rowSelecting:GA,rowSelected:YA,rowDeselecting:XA,rowDeselected:KA,cellSelecting:JA,cellSelected:ZA,cellDeselecting:$A,cellDeselected:e1,columnSelecting:t1,columnSelected:i1,columnDeselecting:n1,columnDeselected:o1,columnDragStart:r1,columnDrag:s1,columnDrop:a1,rowDragStartHelper:l1,rowDragStart:h1,rowDrag:d1,rowDrop:p1,beforePrint:c1,printComplete:u1,detailDataBound:g1,toolbarClick:m1,batchAdd:f1,batchCancel:y1,batchDelete:v1,beforeBatchAdd:b1,beforeBatchDelete:w1,beforeBatchSave:C1,beginEdit:S1,cellEdit:A1,cellSave:x1,cellSaved:I1,endAdd:"endAdd",endDelete:"endDelete",endEdit:"endEdit",recordDoubleClick:T1,recordClick:E1,beforeDataBound:D1,beforeOpenColumnChooser:M1,beforeOpenAdaptiveDialog:k1,resizeStart:P1,onResize:B1,resizeStop:F1,checkBoxChange:L1,beforeCopy:R1,beforePaste:O1,beforeAutoFill:N1,filterChoiceRequest:V1,filterAfterOpen:_1,filterBeforeOpen:H1,filterSearchBegin:z1,commandClick:j1,exportGroupCaption:W1,lazyLoadGroupExpand:Q1,lazyLoadGroupCollapse:U1,initialLoad:q1,initialEnd:G1,dataReady:Y1,contentReady:X1,uiUpdate:K1,onEmpty:J1,inBoundModelChanged:Z1,modelChanged:$1,colGroupRefresh:ex,headerRefreshed:tx,pageBegin:"paging-begin",pageComplete:ix,sortBegin:"sorting-begin",sortComplete:nx,filterBegin:"filtering-begin",filterComplete:ox,searchBegin:"searching-begin",searchComplete:rx,reorderBegin:"reorder-begin",reorderComplete:sx,rowDragAndDropBegin:"rowdraganddrop-begin",rowDragAndDropComplete:ax,groupBegin:"grouping-begin",groupComplete:lx,ungroupBegin:"ungrouping-begin",ungroupComplete:hx,groupAggregates:dx,refreshFooterRenderer:px,refreshAggregateCell:cx,refreshAggregates:ux,rowSelectionBegin:"rowselecting",rowSelectionComplete:gx,columnSelectionBegin:"columnselecting",columnSelectionComplete:"columnselected",cellSelectionBegin:"cellselecting",cellSelectionComplete:mx,destroyAutoFillElements:fx,beforeCellFocused:yx,cellFocused:vx,keyPressed:bx,click:wx,destroy:Cx,columnVisibilityChanged:Sx,scroll:Ax,columnWidthChanged:xx,columnPositionChanged:Ix,rowDragAndDrop:"row-drag-and-drop",rowsAdded:Tx,rowsRemoved:Ex,columnDragStop:Dx,headerDrop:Mx,dataSourceModified:kx,refreshComplete:Px,refreshVirtualBlock:Bx,dblclick:Fx,toolbarRefresh:Lx,bulkSave:Rx,autoCol:Ox,tooltipDestroy:Nx,updateData:Vx,editBegin:"edit-begin",editComplete:"edit-complete",addBegin:"add-begin",addComplete:"add-complete",saveComplete:_x,deleteBegin:"delete-begin",deleteComplete:Hx,preventBatch:zx,dialogDestroy:jx,crudAction:Wx,addDeleteAction:Qx,destroyForm:Ux,doubleTap:qx,beforeExcelExport:Gx,excelExportComplete:Yx,excelQueryCellInfo:Xx,excelHeaderQueryCellInfo:Kx,exportDetailDataBound:Jx,exportDetailTemplate:Zx,beforePdfExport:$x,pdfExportComplete:eI,pdfQueryCellInfo:tI,pdfHeaderQueryCellInfo:iI,accessPredicate:"access-predicate",contextMenuClick:nI,freezeRender:oI,freezeRefresh:"freezerefresh",contextMenuOpen:rI,columnMenuClick:sI,columnMenuOpen:aI,filterOpen:lI,filterDialogCreated:hI,filterMenuClose:dI,initForeignKeyColumn:pI,getForeignKeyData:cI,generateQuery:uI,showEmptyGrid:gI,foreignKeyData:mI,columnDataStateChange:fI,dataStateChange:yI,dataSourceChanged:vI,rtlUpdated:bI,beforeFragAppend:wI,frozenHeight:"frozenHeight",textWrapRefresh:CI,recordAdded:SI,cancelBegin:AI,editNextValCell:xI,hierarchyPrint:II,expandChildGrid:TI,printGridInit:EI,exportRowDataBound:DI,exportDataBound:MI,rowPositionChanged:kI,columnChooserOpened:PI,batchForm:BI,beforeStartEdit:FI,beforeBatchCancel:LI,batchEditFormRendered:RI,partialRefresh:OI,beforeCustomFilterOpen:NI,selectVirtualRow:VI,columnsPrepared:_I,cBoxFltrBegin:HI,cBoxFltrComplete:zI,fltrPrevent:jI,beforeFltrcMenuOpen:WI,valCustomPlacement:QI,filterCboxValue:UI,componentRendered:"component-rendered",restoreFocus:qI,detailStateChange:GI,detailIndentCellInfo:YI,virtaulKeyHandler:"virtaul-key-handler",virtaulCellFocus:XI,virtualScrollEditActionBegin:KI,virtualScrollEditSuccess:JI,virtualScrollEditCancel:ZI,virtualScrollEdit:$I,refreshVirtualCache:eT,editReset:tT,virtualScrollAddActionBegin:iT,getVirtualData:nT,refreshInfiniteModeBlocks:oT,resetInfiniteBlocks:rT,infiniteScrollHandler:sT,infinitePageQuery:aT,infiniteShowHide:lT,appendInfiniteContent:hT,removeInfiniteRows:dT,setInfiniteCache:pT,infiniteEditHandler:cT,initialCollapse:uT,getAggregateQuery:"get-aggregate-query",closeFilterDialog:gT,columnChooserCancelBtnClick:mT,getFilterBarOperator:fT,resetColumns:yT,pdfAggregateQueryCellInfo:vT,excelAggregateQueryCellInfo:bT,setGroupCache:wT,lazyLoadScrollHandler:CT,groupCollapse:ST,beforeCheckboxRenderer:AT,refreshHandlers:xT,refreshFrozenColumns:IT,setReorderDestinationElement:TT,refreshVirtualFrozenHeight:ET,setFreezeSelection:DT,setInfiniteFrozenHeight:"set-infinite-frozen-height",setInfiniteColFrozenHeight:"set-infinite-col-frozen-height",beforeRefreshOnDataChange:MT,immutableBatchCancel:kT,refreshVirtualFrozenRows:PT,checkScrollReset:BT,refreshFrozenHeight:"refresh-frozen-height",setHeightToFrozenElement:"set-height-to-frozen-element",preventFrozenScrollRefresh:FT,nextCellIndex:LT,refreshInfiniteCurrentViewData:RT,infiniteCrudCancel:OT,filterDialogClose:NT,refreshCustomFilterOkBtn:VT,refreshCustomFilterClearBtn:_T,renderResponsiveCmenu:HT,filterCmenuSelect:zT,customFilterClose:jT,setFullScreenDialog:WT,refreshExpandandCollapse:QT,rowModeChange:UT,enterKeyHandler:qT,refreshVirtualMaxPage:GT,setVirtualPageQuery:YT,selectRowOnContextOpen:XT,pagerRefresh:KT,closeInline:JT,closeBatch:"closebatch",closeEdit:ZT,resetVirtualFocus:$T,afterContentRender:"after-content-renderer",refreshVirtualEditFormCells:eE,scrollToEdit:tE,beforeCheckboxRendererQuery:iE,createVirtualValidationForm:nE,validateVirtualForm:oE,destroyChildGrid:rE,stickyScrollComplete:sE,captionActionComplete:aE,refreshInfinitePersistSelection:lE,refreshInfiniteEditrowindex:hE,afterFilterColumnMenuClose:dE,beforeCheckboxfilterRenderer:pE,commandColumnDestroy:cE,batchCnfrmDlgCancel:uE,refreshVirtualLazyLoadCache:gE,refreshFrozenPosition:mE,refreshResizePosition:fE,refreshSplitFrozenColumn:yE,renderResponsiveChangeAction:vE,renderResponsiveColumnChooserDiv:bE,showAddNewRowFocus:wE,infiniteScrollComplete:CE,lastRowCellBorderUpdated:SE,columnChooserSearch:"columnChooserSearch",columnChooserClose:"columnChooserClose",columnChooserUpdate:"columnChooserUpdate",destroyEditForm:AE,beforeDetailTemplateDetach:xE,detachDetailTemplate:IE,rowCell:LE,gridHeader:RE,gridContent:OE,gridFooter:NE,headerContent:VE,movableContent:_E,movableHeader:HE,frozenContent:zE,frozenHeader:jE,content:WE,table:QE,row:UE,gridChkBox:qE,editedRow:GE,addedRow:YE,groupCaptionRow:XE,changedRecords:KE,addedRecords:JE,deletedRecords:ZE,leftRight:$E,frozenRight:eD,frozenLeft:tD,ariaColIndex:iD,ariaRowIndex:nD,tbody:oD,colGroup:rD,open:sD,change:aD,focus:lD,create:hD,beforeOpen:dD,downArrow:pD,upArrow:cD,pageUp:"PageUp",pageDown:uD,enter:gD,shiftEnter:mD,tab:"tab",shiftTab:"shiftTab",initialFrozenColumnIndex:fD,Data:TE,Sort:eG,Page:gG,Selection:hk,Filter:_G,Search:pk,Scroll:mk,resizeClassList:zG,Resize:jG,Reorder:QG,RowDD:qG,Group:YG,getCloneProperties:TP,Print:EP,DetailRow:KG,Toolbar:ZG,Aggregate:lY,summaryIterator:dY,VirtualScroll:xY,Edit:uX,BatchEdit:eX,InlineEdit:ZY,NormalEdit:YY,DialogEdit:oX,ColumnChooser:mX,ExcelExport:pK,PdfExport:uK,ExportHelper:aK,ExportValueFormatter:hK,Clipboard:Ik,CommandColumn:bK,CheckBoxFilter:FG,menuClass:CK,ContextMenu:SK,Freeze:xK,ColumnMenu:TK,ExcelFilter:NG,ForeignKey:kK,Logger:Bk,detailLists:Ok,InfiniteScroll:BK,LazyLoadGroup:pX,Column:C0,CommandColumnModel:Hr,GridColumn:Wr,StackedColumn:qr,Row:DE,Cell:kE,HeaderRender:OD,ContentRender:LD,RowRenderer:yD,CellRenderer:VD,HeaderCellRenderer:qD,FilterCellRenderer:bG,StackedHeaderCellRenderer:KD,Render:FM,IndentCellRenderer:eM,GroupCaptionCellRenderer:oM,GroupCaptionEmptyCellRenderer:aM,BatchEditRender:DY,DialogEditRender:kY,InlineEditRender:TY,EditRender:BY,BooleanEditCell:l9,DefaultEditCell:qY,DropDownEditCell:HY,NumericEditCell:jY,DatePickerEditCell:lX,CommandColumnRenderer:yK,StringFilterUI:AG,NumberFilterUI:IG,DateFilterUI:MG,BooleanFilterUI:EG,FlMenuOptrUI:CG,AutoCompleteEditCell:zK,ComboboxEditCell:UK,MultiSelectEditCell:XK,TimePickerEditCell:$K,ToggleEditCell:nJ,MaskedTextBoxCellEdit:aJ,VirtualContentRenderer:yY,VirtualHeaderRenderer:wY,VirtualElementHandler:SY,GroupLazyLoadRenderer:OK,ResponsiveDialogRenderer:NM,EditCellBase:f7,CellRendererFactory:RM,ServiceLocator:_M,RowModelGenerator:bD,GroupModelGenerator:BD,ValueFormatter:v0,VirtualRowModelGenerator:uY,InterSectionObserver:pY,Pager:lG,ExternalMessage:cG,NumericContainer:iG,PagerMessage:oG,PagerDropDown:dG});function oqt(e,t,i){for(var n=e;n&&(i?n.id!==t:!n.classList.contains(t));)n=n.parentElement;return n}function rqt(e){return je(e.startDate)&&je(e.endDate)&&je(e.duration)?null:!(je(e.startDate)||je(e.endDate)||je(e.duration))}function sqt(e){return!(!e.dataSource||e.dataSource instanceof me||!("result"in e.dataSource))}function aqt(e){for(var t={},i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];t[e[o]]=o}return t}function lqt(e){return!je(e)&&"object"==typeof e&&0===Object.keys(e).length}function hqt(e){var t=e.getFullYear(),i=e.getMonth(),n=e.getDate(),o=e.getHours(),r=e.getMinutes(),s=e.getSeconds(),e=e.getMilliseconds();return Date.UTC(t,i,n,o,r,s,e)}function dqt(e){return e instanceof me&&((e=e.adaptor)instanceof Ra||e instanceof Va||e instanceof za||e instanceof Qa||e instanceof il||e instanceof Ga||e instanceof Ba)}function pqt(e,t,i,n){if(i)for(var o=void 0,r=0;r<e.length;r++)o=s=t?e[parseInt(r.toString(),10)].taskData:Pe({},e[parseInt(r.toString(),10)].taskData,{},!0);else for(o=[],r=0;r<e.length;r++){!je(n)&&n.timezone&&cqt(e[r],n);var s=t?e[parseInt(r.toString(),10)].taskData:Pe({},e[parseInt(r.toString(),10)].taskData,{},!0);o.push(s)}return o}function cqt(e,t){return e&&!je(e.ganttProperties)&&(e.taskData[t.taskFields.startDate]=t.dateValidationModule.remove(e.ganttProperties.startDate,t.timezone),null!==t.taskFields.endDate&&(e.taskData[t.taskFields.endDate]=t.dateValidationModule.remove(e.ganttProperties.endDate,t.timezone)),t.taskFields.baselineEndDate||t.taskFields.baselineStartDate)&&(e.taskData[t.taskFields.baselineStartDate]=t.dateValidationModule.remove(e.ganttProperties.baselineStartDate,t.timezone),e.taskData[t.taskFields.baselineEndDate]=t.dateValidationModule.remove(e.ganttProperties.baselineEndDate,t.timezone)),null}function uqt(e,t){for(var i,n=0;n<t.length;n++)i=new RegExp("\\{"+n+"\\}","gm"),e=e.replace(i,t[n].toString());return e}function gqt(e,t,i,n){for(var o=-1,r=0;r<i.length;r++)if(R(t,i[r])===R(t,e)&&je(n)||!je(n)&&R(t,i[r])===R(t,e)&&R(n,i[r])===R(n,e)){o=r;break}return o}function ae(e){return 76*e/92}function mqt(e){return 92*e/76}var fqt=0;function yqt(){return fqt++}bqt.prototype.isValidateNonWorkDays=function(e){return!je(e)&&e.isAutoSchedule&&(!this.parent.includeWeekend||0<this.parent.totalHolidayDates.length)||je(e)&&(!this.parent.includeWeekend||0<this.parent.totalHolidayDates.length)},bqt.prototype.checkStartDate=function(e,t,i,n){if(je(e))return null;var o=new Date(e.getTime()),r=this.parent.getCurrentDayStartTime(o),s=this.parent.getCurrentDayEndTime(o),a=new Date(e.getTime()),l=this.getSecondsInDecimal(a);if(i=je(i)?!je(t)&&t.isMilestone:i,l<r&&(!i||n))this.setTime(r,a);else if(l<r&&i)this.setTime(r,a);else if(l===s&&(!t||!i)||s<l)a.setDate(a.getDate()+1),r=this.parent.getCurrentDayStartTime(a),this.setTime(r,a);else if(r<l&&l<s){var h=this.parent.workingTimeRanges;0<this.parent.weekWorkingTime.length&&(h=this.parent.getWorkingRange(a));for(var d=0;d<h.length;d++){var p=h[d];if(l>=p.to&&h[d+1]&&l<h[d+1].from){(l!==p.to||t&&i)&&l===p.to||this.setTime(h[d+1].from,a);break}}}if(this.parent.autoCalculateDateScheduling&&!(this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping))do{var c=new Date(a.getTime()),u=this.parent.totalHolidayDates.length;if(this.isValidateNonWorkDays(t)){r=this.parent.getCurrentDayStartTime(c),t&&(s=this.parent.getCurrentDayEndTime(t.endDate?t.isAutoSchedule?t.endDate:t.autoEndDate:c));var g,m=!i||n?r:s;this.parent.includeWeekend||(g=new Date(a.getTime()),a=this.getNextWorkingDay(a),m=this.parent.getCurrentDayStartTime(a),g.getTime()===a.getTime())||i||this.setTime(m,a);for(var f=0;f<u;f++){var y=this.getDateFromFormat(new Date(this.parent.totalHolidayDates[f])),v=new Date(y.getTime());y.setHours(0,0,0,0),v.setHours(23,59,59,59),a.getTime()>=y.getTime()&&a.getTime()<v.getTime()&&(a.setDate(a.getDate()+1),m=this.parent.getCurrentDayStartTime(a),this.setTime(m,a))}}}while(c.getTime()!==a.getTime());return new Date(a.getTime())},bqt.prototype.checkEndDate=function(e,t,i){if(je(e))return null;h=0<this.parent.weekWorkingTime.length?(s=e,(!this.parent.includeWeekend&&t&&t.isAutoSchedule||this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.editModule.taskbarEditModule.taskBarEditRecord&&!this.parent.editModule.taskbarEditModule.taskBarEditRecord.ganttProperties.isAutoSchedule)&&(s=this.getNextWorkingDay(e)),n=this.parent.getStartTime(s),this.parent.getEndTime(s)):(n=this.parent.defaultStartTime,this.parent.defaultEndTime);var n,o=new Date(e.getTime()),r=this.getSecondsInDecimal(o);if(h<r)this.setTime(h,o);else if(r<=n&&!i){var s=this.parent.taskFields;this.parent.editModule&&this.parent.editModule.editedRecord&&!this.parent.editModule.editedRecord[s.startDate]&&this.parent.editModule.editedRecord[s.endDate]?o.setDate(o.getDate()):o.setDate(o.getDate()-1),h=this.parent.getCurrentDayEndTime(o),this.setTime(h,o)}else if(n<r&&r<h)for(var a=0;a<this.parent.workingTimeRanges.length;a++)if(r>this.parent.workingTimeRanges[a].to&&this.parent.workingTimeRanges[a+1]&&r<=this.parent.workingTimeRanges[a+1].from){this.setTime(this.parent.workingTimeRanges[a].to,o);break}if(!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)je(o)||(h=this.parent.getCurrentDayEndTime(e),this.setTime(h,o));else do{var l,h,d=new Date(o.getTime()),p=this.parent.totalHolidayDates.length;if(this.isValidateNonWorkDays(t)){this.parent.includeWeekend||(l=new Date(o.getTime()),o=this.getPreviousWorkingDay(o),h=this.parent.getCurrentDayEndTime(o),l.getTime()!==o.getTime()&&this.setTime(h,o));for(var c=0;c<p;c++){var u=this.getDateFromFormat(new Date(this.parent.totalHolidayDates[c])),g=new Date(u.getTime()),m=new Date(o.getTime());m.setMinutes(o.getMilliseconds()-2),u.setHours(0,0,0,0),g.setHours(23,59,59,59),(o.getTime()>=u.getTime()&&o.getTime()<g.getTime()||m.getTime()>=u.getTime()&&m.getTime()<g.getTime())&&(o.setDate(o.getDate()-1),h=this.parent.getCurrentDayEndTime(o),o.getTime()===u.getTime()&&86400===h&&0===this.getSecondsInDecimal(o)||this.setTime(h,o))}}}while(d.getTime()!==o.getTime());return new Date(o.getTime())},bqt.prototype.checkBaselineStartDate=function(e,t){if(je(e))return null;var i=this.parent.getCurrentDayStartTime(e),t=this.parent.getCurrentDayEndTime(t&&t.endDate?t.isAutoSchedule?t.endDate:t.autoEndDate:e),n=new Date(e.getTime()),o=this.getSecondsInDecimal(n);if(o<i)this.setTime(i,n);else if(t<o)n.setDate(n.getDate()+1),i=0<this.parent.weekWorkingTime.length?this.parent.getStartTime(n):this.parent.defaultStartTime,this.setTime(i,n);else if(i<o&&o<t)for(var r=0;r<this.parent.workingTimeRanges.length;r++)if(o>this.parent.workingTimeRanges[r].to&&this.parent.workingTimeRanges[r+1]&&o<this.parent.workingTimeRanges[r+1].from){this.setTime(this.parent.workingTimeRanges[r+1].from,n);break}return n},bqt.prototype.checkBaselineEndDate=function(e,t){if(je(e))return null;var i=this.parent.getCurrentDayEndTime(e),n=this.parent.getCurrentDayStartTime(t&&t.startDate?t.isAutoSchedule?t.startDate:t.autoStartDate:e),o=new Date(e.getTime()),r=this.getSecondsInDecimal(o);if(i<r)this.setTime(i,o);else if(r<n&&!je(t)&&!t.isMilestone)o.setDate(o.getDate()-1),i=this.parent.getCurrentDayEndTime(o),this.setTime(i,o);else if(n<r&&r<i)for(var s=0;s<this.parent.workingTimeRanges.length;s++)if(r>this.parent.workingTimeRanges[s].to&&this.parent.workingTimeRanges[s+1]&&r<=this.parent.workingTimeRanges[s+1].from){this.setTime(this.parent.workingTimeRanges[s].to,o);break}return t&&t.baselineStartDate&&o&&t.baselineStartDate.getTime()>o.getTime()&&o.setDate(o.getDate()+1),o},bqt.prototype.calculateStartDate=function(e){var t=e.ganttProperties,i=null;je(t.endDate)||je(t.duration)||(i=this.getStartDate(t.endDate,t.duration,t.durationUnit,t)),this.parent.setRecordValue("startDate",i,t,!0),this.parent.taskFields.startDate&&this.parent.dataOperation.updateMappingData(e,"startDate")},bqt.prototype.calculateEndDate=function(e){var t,i,n=e.ganttProperties,o=null;je(n.startDate)?je(o=e[this.parent.taskFields.endDate])||(i=this.parent.getCurrentDayEndTime(o),this.setTime(i,o)):(!je(n.endDate)&&je(n.duration)&&(1===this.compareDates(n.startDate,n.endDate)&&(this.parent.setRecordValue("startDate",new Date(n.endDate.getTime()),n,!0),t=this.parent.getCurrentDayStartTime(n.isAutoSchedule?n.autoStartDate:n.startDate),i=this.parent.getCurrentDayEndTime(n.isAutoSchedule?n.autoEndDate:n.endDate),this.setTime(t,n.startDate)),this.calculateDuration(e)),je(n.duration)||(i=!je(n.segments)&&1<n.segments.length?this.totalDuration(n.segments):n.duration,o=this.getEndDate(n.startDate,i,n.durationUnit,n,!1))),this.parent.setRecordValue("endDate",o,n,!0),this.parent.taskFields.endDate&&this.parent.dataOperation.updateMappingData(e,"endDate")},bqt.prototype.totalDuration=function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i].duration+e[i].offsetDuration;return t},bqt.prototype.calculateDuration=function(e){var t=e.ganttProperties,i=!je(t.segments)&&0<t.segments.length&&!je(this.parent.editModule.taskbarEditModule)?this.parent.editModule.taskbarEditModule.sumOfDuration(t.segments):je(this.parent.taskFields.milestone)||je(t.startDate)||je(t.endDate)||t.startDate.getTime()!==t.endDate.getTime()||!1!==e.taskData[this.parent.taskFields.milestone]?this.getDuration(t.startDate,t.endDate,t.durationUnit,t.isAutoSchedule,t.isMilestone):1,t=(this.parent.setRecordValue("duration",i,t,!0),this.parent.columnByField[this.parent.columnMapping.duration]);je(this.parent.editModule)||je(this.parent.editModule.cellEditModule)||this.parent.editModule.cellEditModule.isCellEdit||je(t)||(je(t.edit)||je(t.edit.read)||je(t=this.parent.editModule.dialogModule.dialog)||je(t=t.querySelector("#"+this.parent.element.id+"Duration").ej2_instances[0])||t.value===i.toString()||(t.value=i.toString(),t.dataBind()),this.parent.taskFields.duration&&(this.parent.dataOperation.updateMappingData(e,"duration"),this.parent.taskFields.durationUnit)&&this.parent.dataOperation.updateMappingData(e,"durationUnit"))},bqt.prototype.getNonworkingTime=function(e,t,i,n){n=!!je(n)||n;var o=this.parent.includeWeekend||!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping||!i?0:this.getWeekendCount(e,t),n=this.getNumberOfSeconds(e,t,n),r=!i||!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?0:this.getHolidaysCount(e,t),n=(n-86400*o-86400*r)/86400,s=this.getNonWorkingSecondsOnDate(e,t,i);return(0<this.parent.weekWorkingTime.length?this.nonWorkingSeconds(e,t,i,n):n*(86400-this.parent.secondsPerDay))+86400*o+86400*r+s},bqt.prototype.nonWorkingSeconds=function(e,t,i,n,o){var r=e.getTime()>t.getTime()?new Date(t.getTime()):new Date(e.getTime()),s=e.getTime()>t.getTime()?new Date(e.getTime()):new Date(t.getTime()),a=0,l=0;if(o?(e=this.parent.getCurrentDayStartTime(r),t=this.parent.getCurrentDayEndTime(r),r.getHours()<t/3600&&r.getHours()>=e/3600||r.setDate(r.getDate()+1)):(r.setDate(r.getDate()+1),r.setHours(0,0,0,0),s.setHours(0,0,0,0)),!(0<n||je(n)))return 0;for(;o&&r.getTime()<=s.getTime()||!o&&r.getTime()<s.getTime();){if(i){if(this.isOnHolidayOrWeekEnd(r,!0))for(;r.setDate(r.getDate()+1),this.isOnHolidayOrWeekEnd(r,!0););this.parent.includeWeekend||this.getNextWorkingDay(r)}if(r.getTime()<=s.getTime()){l++;var h=this.parent.getSecondsPerDay(r);if(a+=o?h:86400-h,r.setDate(r.getDate()+1),i){if(this.isOnHolidayOrWeekEnd(r,!0))for(;r.setDate(r.getDate()+1),this.isOnHolidayOrWeekEnd(r,!0););this.parent.includeWeekend||this.getNextWorkingDay(r)}}}return o&&(0<a?a/=l:a=this.parent.secondsPerDay),a},bqt.prototype.getDuration=function(e,t,i,n,o,r){if(je(e)||je(t))return null;r=!!je(r)||r;var s=0,r=this.getTimeDifference(e,t,r)/1e3-this.getNonworkingTime(e,t,n,r),n=0<this.parent.weekWorkingTime.length?this.nonWorkingSeconds(e,t,n,void 0,!0):this.parent.secondsPerDay,s=o&&this.parent.getFormatedDate(e)===this.parent.getFormatedDate(t)?0:i&&"day"!==i?"minute"===i?r/60:r/3600:r/n;return parseFloat(s.toString())},bqt.prototype.getDurationAsSeconds=function(e,t,i){i=0<this.parent.weekWorkingTime.length?this.parent.getSecondsPerDay(i):this.parent.secondsPerDay;return t&&"day"!==t.toLocaleLowerCase()?"hour"===t.toLocaleLowerCase()?3600*e:60*e:i*e},bqt.prototype.getEndDate=function(e,t,i,n,o){for(var r=new Date(e.getTime()),s=new Date(e.getTime()),a=new Date(e.getTime()),l=0<this.parent.weekWorkingTime.length&&(!i||"day"===i.toLocaleLowerCase())?this.calculateSecondDuration(t,a,l,e,!0):this.getDurationAsSeconds(t,i,e);0<l;)s.setSeconds(s.getSeconds()+l),0<(l-=l-this.getNonworkingTime(r,s,n.isAutoSchedule,!0))&&(s=this.checkStartDate(s,n,o)),r=new Date(s.getTime());return s},bqt.prototype.getStartDate=function(e,t,i,n,o){for(var r=new Date(e.getTime()),s=new Date(e.getTime()),e=new Date(r.getTime()),a=0<this.parent.weekWorkingTime.length?this.calculateSecondDuration(t,e,a,r,!1):this.getDurationAsSeconds(t,i,r);0<a;)s.setSeconds(s.getSeconds()-a),0<(a-=a-this.getNonworkingTime(s,r,n.isAutoSchedule,!0))&&(r=this.checkEndDate(s,n)),r=new Date(s.getTime());return o&&n.isMilestone&&(s.setDate(s.getDate()-1),e=this.parent.getCurrentDayEndTime(n.endDate?n.isAutoSchedule?n.endDate:n.autoEndDate:s),this.parent.dateValidationModule.setTime(e,s),s=this.parent.dateValidationModule.checkStartDate(s,n,!0)),s},bqt.prototype.calculateSecondDuration=function(e,t,i,n,o){if(e<1)i=this.parent.getSecondsPerDay(t)*e;else{i=0;var r=e,s=this.parent.getCurrentDayStartTime(t),a=this.parent.getCurrentDayEndTime(t);for(t.getHours()<a/3600&&t.getHours()>s/3600||!this.fromSegments||(o?t.setDate(t.getDate()+1):t.setDate(t.getDate()-1));0<r;){if(this.isOnHolidayOrWeekEnd(t,!0))for(;o?t.setDate(t.getDate()+1):t.setDate(t.getDate()-1),this.isOnHolidayOrWeekEnd(t,!0););this.parent.includeWeekend||(t=o?this.getNextWorkingDay(t):this.getPreviousWorkingDay(t));var l,h=this.parent.getSecondsPerDay(t),d=0;this.getSecondsInDecimal(n)===this.parent.getStartTime(n)||Number.isInteger(r)||(l=e.toString().split("."),h*=d=parseFloat("."+l[1]),r-=d),r<1&&(h*=r),i+=h,o?t.setDate(t.getDate()+1):t.setDate(t.getDate()-1),d||r--}}return i},bqt.prototype.getProjectStartDate=function(e,t){if(!je(this.parent.cloneProjectStartDate))return"string"==typeof this.parent.cloneProjectStartDate&&(this.parent.cloneProjectStartDate=this.getDateFromFormat(this.parent.cloneProjectStartDate)),s=this.checkStartDate(this.parent.cloneProjectStartDate),this.parent.cloneProjectStartDate=s,new Date(s.getTime());if(je(this.parent.projectStartDate)){if(je(t))return null;var i=this.parent.flatData,n=void 0;0<i.length?n=i[0].ganttProperties.startDate:(n=new Date).setHours(0,0,0,0);for(var o=1;o<i.length;o++){var r=i[o].ganttProperties.startDate;je(r)||-1!==this.compareDates(r,n)||(n=r)}this.parent.cloneProjectStartDate=this.checkStartDate(n,e)}else{var s=this.getDateFromFormat(this.parent.projectStartDate);this.parent.cloneProjectStartDate=this.checkStartDate(s)}return new Date(this.parent.cloneProjectStartDate.getTime())},bqt.prototype.getValidStartDate=function(e,t){var i=null,n=t?e.autoStartDate:e.startDate,t=t?e.autoEndDate:e.endDate,o=!e.isAutoSchedule&&e.autoDuration?e.autoDuration:e.duration;if(je(n))if(je(t)){if(!je(o)){o=this.parent.getTaskByUniqueID(e.uniqueID);if(this.parent.allowUnscheduledTasks&&o&&o.parentItem&&je(n)&&je(t)){for(var r=this.parent.getParentTask(o.parentItem);r&&!r.ganttProperties.startDate;)r=this.parent.getParentTask(r.parentItem);i=r&&r.ganttProperties.startDate?r.ganttProperties.startDate:this.parent.cloneProjectStartDate}else i=this.getProjectStartDate(e)}}else{i=new Date(t.getTime()),o=this.parent.getCurrentDayStartTime(i);this.setTime(o,i)}else i=new Date(n.getTime());return i},bqt.prototype.getValidEndDate=function(e,t){var i,n=null,o=t?e.autoStartDate:e.startDate,r=t?e.autoEndDate:e.endDate,t=t?e.autoDuration:e.duration;return je(r)?je(o)?je(t)||(i=this.getValidStartDate(e))&&(n=this.getEndDate(i,t,e.durationUnit,e,!1)):e.isMilestone?n=this.checkStartDate(o):(n=new Date(o.getTime()),i=this.parent.getCurrentDayEndTime(r||n),this.setTime(i,n)):n=new Date(r.getTime()),n},bqt.prototype.getWorkingTime=function(e,t,i,n,o,r,s,a){var l;return je(t.from)||je(t.to)||(i.setHours(0,0,0,0),l=new Date(i.getTime()),i.setTime(i.getTime()+36e5*t.from),i=new Date(i.getTime()),24===t.to?l.setTime(l.getTime()+864e5):l.setTime(l.getTime()+36e5*t.to),l=(t=new Date(l.getTime())).getTime()-i.getTime(),i=this.getSecondsInDecimal(i),0===(t=this.getSecondsInDecimal(t))&&(t=86400),n+=l/1e3,0===o&&(this.parent.defaultStartTime=i,0<this.parent.weekWorkingTime.length)&&this.assignStartTime(e,i),o!==this[e.toLowerCase()+"TimeRangeLength"]-1&&""!==e||(this.parent.defaultEndTime=t,0<this.parent.weekWorkingTime.length&&this.assignEndTime(e,t)),0<o?""===e?(r.push(r[r.length-1]+i-s[o-1].to),s[o-1].to<i&&a.push({from:s[o-1].to,to:i,isWorking:!1,interval:i-s[o-1].to})):(this.parent[e.toLowerCase()+"NonWorkingHours"].push(this.parent[e.toLowerCase()+"NonWorkingHours"][this.parent[e.toLowerCase()+"NonWorkingHours"].length-1]+i-this.parent[e.toLowerCase()+"NonWorkingTimeRanges"][o-1].to),this.parent[e.toLowerCase()+"WorkingTimeRanges"][o-1].to<i&&this.parent[e.toLowerCase()+"NonWorkingTimeRanges"].push({from:this.parent[e.toLowerCase()+"WorkingTimeRanges"][o-1].to,to:i,isWorking:!1,interval:i-this.parent[e.toLowerCase()+"WorkingTimeRanges"][o-1].to})):(""===e?(r.push(0),a):(this.parent[e.toLowerCase()+"NonWorkingHours"].push(0),this.parent[e.toLowerCase()+"NonWorkingTimeRanges"])).push({from:0,to:i,isWorking:!1,interval:i}),(""===e?(s.push({from:i,to:t}),a):(this.parent[e.toLowerCase()+"WorkingTimeRanges"].push({from:i,to:t}),this.parent[e.toLowerCase()+"NonWorkingTimeRanges"])).push({from:i,to:t,isWorking:!0,interval:t-i})),n},bqt.prototype.assignStartTime=function(e,t){switch(e){case"Monday":this.parent.mondayDefaultStartTime=t;break;case"Tuesday":this.parent.tuesdayDefaultStartTime=t;break;case"Wednesday":this.parent.wednesdayDefaultStartTime=t;break;case"Thursday":this.parent.thursdayDefaultStartTime=t;break;case"Friday":this.parent.fridayDefaultStartTime=t;break;case"Saturday":this.parent.saturdayDefaultStartTime=t;break;case"Sunday":this.parent.sundayDefaultStartTime=t}},bqt.prototype.assignEndTime=function(e,t){switch(e){case"Monday":this.parent.mondayDefaultEndTime=t;break;case"Tuesday":this.parent.tuesdayDefaultEndTime=t;break;case"Wednesday":this.parent.wednesdayDefaultEndTime=t;break;case"Thursday":this.parent.thursdayDefaultEndTime=t;break;case"Friday":this.parent.fridayDefaultEndTime=t;break;case"Saturday":this.parent.saturdayDefaultEndTime=t;break;case"Sunday":this.parent.sundayDefaultEndTime=t}},bqt.prototype.calculateWeekWorkTime=function(e,t,i,n,o,r,s){for(var a=0,l=0;l<t.length;l++){var h=t[l];a+=this.getWorkingTime(e,h,i,n,l,o,r,s)}return this.parent[e.toLowerCase()+"DefaultStartTime"]/3600!=24&&this.parent[e.toLowerCase()+"NonWorkingTimeRanges"].push({from:this.parent[e.toLowerCase()+"DefaultEndTime"],to:86400,isWorking:!1,interval:86400-this.parent[e.toLowerCase()+"DefaultEndTime"]}),a},bqt.prototype.getSecondsPerDay=function(){for(var e=0,t=new Date("10/11/2018"),i=(this.parent.nonWorkingHours=[],this.parent.nonWorkingHours),n=(this.parent.workingTimeRanges=[],this.parent.workingTimeRanges=[],this.parent.workingTimeRanges),o=(this.parent.nonWorkingTimeRanges=[],this.parent.nonWorkingTimeRanges),r=0,s=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];r<s.length;r++)this[(y=s[r]).toLowerCase()+"TimeRangeLength"]=this.parent.dayWorkingTime.length;if(0<this.parent.weekWorkingTime.length){for(var a=0;a<this.parent.weekWorkingTime.length;a++)this[this.parent.weekWorkingTime[a].dayOfWeek.toLowerCase()+"TimeRangeLength"]=this.parent.weekWorkingTime[a].timeRange.length;for(var l=this.parent.weekWorkingTime,h=this.parent.dayWorkingTime,d=0,p=l;d<p.length;d++){var c,u=p[d];u.timeRange&&0<u.timeRange.length&&(c=this.calculateWeekWorkTime(u.dayOfWeek,u.timeRange,t,e,i,n,o),this.parent[u.dayOfWeek.toLowerCase()+"Seconds"]=c)}for(var g=0,m=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];g<m.length;g++){var f,y=m[g];je(this.parent[y.toLowerCase()+"DefaultStartTime"])&&(f=this.calculateWeekWorkTime(y,h,t,e,i,n,o),this.parent[y.toLowerCase()+"Seconds"]=f)}}for(var v=this.parent.dayWorkingTime,b=v.length,w=0,C=0;C<b;C++){var S=v[C];w+=this.getWorkingTime("",S,t,e,C,i,n,o)}return this.parent.defaultEndTime/3600!=24&&o.push({from:this.parent.defaultEndTime,to:86400,isWorking:!1,interval:86400-this.parent.defaultEndTime}),e=w},bqt.prototype.getDurationValue=function(e,t){var i,n=null,o=null;return"string"==typeof e?(i=e.match(/(\d*\.*\d+|.+$)/g))&&i.length<=2&&(o=parseFloat(i[0].toString().trim()),i=i[1]?i[1].toString().trim().toLowerCase():null,-1!==R("minute",this.parent.durationUnitEditText).indexOf(i)?n="minute":-1!==R("hour",this.parent.durationUnitEditText).indexOf(i)?n="hour":-1!==R("day",this.parent.durationUnitEditText).indexOf(i)&&(n="day")):(o=e,n=null),{duration:o,durationUnit:n}},bqt.prototype.getNextWorkingDay=function(e){var t=e.getDay();return-1!==this.parent.nonWorkingDayIndex.indexOf(t)?(e.setDate(e.getDate()+1),this.getNextWorkingDay(e)):e},bqt.prototype.getWeekendCount=function(e,t){var i=0,n=new Date(e.getTime()),o=new Date(t.getTime());for(n.setHours(0,0,0,0),n.setDate(n.getDate()+1),o.setHours(0,0,0,0);n.getTime()<o.getTime();)-1!==this.parent.nonWorkingDayIndex.indexOf(n.getDay())&&(i+=1),n.setDate(n.getDate()+1);return i},bqt.prototype.getNumberOfSeconds=function(e,t,i){var e=new Date(e.getTime()),t=new Date(t.getTime()),n=0;return e.setDate(e.getDate()+1),e.setHours(0,0,0,0),t.setHours(0,0,0,0),n=(n=e.getTime()<t.getTime()?this.getTimeDifference(e,t,i)/1e3:n)%86400!=0?n-n%86400+86400:n},bqt.prototype.getHolidaysCount=function(e,t){var i=0,n=this.parent.totalHolidayDates,o=new Date(e.getTime()),r=new Date(t.getTime());if(o.setDate(o.getDate()+1),o.setHours(0,0,0,0),r.setHours(0,0,0,0),o.getTime()<r.getTime())for(var s=0;s<n.length;s++){var a=this.getDateFromFormat(new Date(n[s]));o.getTime()<=a.getTime()&&r.getTime()>a.getTime()&&(!this.parent.includeWeekend&&-1===this.parent.nonWorkingDayIndex.indexOf(a.getDay())||this.parent.includeWeekend)&&(i+=1)}return i},bqt.prototype.getHolidayDates=function(){for(var e=this.parent.holidays,t=[],i=0;i<e.length;i++){var n=this.getDateFromFormat(e[i].from),o=this.getDateFromFormat(e[i].to);if(!je(n)||!je(o))if(je(n)||je(o)){var r=n||o;r.setHours(0,0,0,0),-1===t.indexOf(r.getTime())&&t.push(r.getTime())}else for(;n<=o;)n.setHours(0,0,0,0),-1===t.indexOf(n.getTime())&&t.push(n.getTime()),n.setDate(n.getDate()+1)}return t},bqt.prototype.isOnHolidayOrWeekEnd=function(e,t){if(t=je(t)?this.parent.includeWeekend:t,!(t=this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?t:!0)&&-1!==this.parent.nonWorkingDayIndex.indexOf(e.getDay()))return!0;for(var i=this.parent.totalHolidayDates,n=0;n<i.length;n++){var o=this.getDateFromFormat(new Date(i[n])),r=new Date(o.getTime());if(o.setHours(0,0,0,0),r.setHours(23,59,59,59),e.getTime()>=o.getTime()&&e.getTime()<r.getTime())return!0}return!1},bqt.prototype.getNonWorkingSecondsOnDate=function(e,t,i){var n=this.getSecondsInDecimal(e),o=this.getSecondsInDecimal(t),r=-1,s=-1,a=0,l=!(!i||!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)&&this.isOnHolidayOrWeekEnd(e,null),i=!(!i||!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)&&this.isOnHolidayOrWeekEnd(t,null);if(0<this.parent.weekWorkingTime.length){for(var h=this.parent.getNonWorkingRange(e),d=0;d<h.length;d++)n>=(c=h[d]).from&&n<=c.to&&(r=d);for(var p=this.parent.getNonWorkingRange(t),d=0;d<p.length;d++)o>=(c=p[d]).from&&o<=c.to&&(s=d)}else{h=this.parent.nonWorkingTimeRanges,p=this.parent.nonWorkingTimeRanges;for(var c,d=0;d<h.length;d++)n>=(c=h[d]).from&&n<=c.to&&(r=d),o>=c.from&&o<=c.to&&(s=d)}if(e.getDate()!==t.getDate()||e.getMonth()!==t.getMonth()||e.getFullYear()!==t.getFullYear()){if(l)a+=86400-n;else for(d=r;d<h.length;d++)je(h[d])||h[d].isWorking||(a+=d===r?h[d].to-n:h[d].interval);if(i)a+=o;else for(d=0;d<=s;d++)p[d].isWorking||(a+=d===s?o-p[d].from:p[d].interval)}else if(r!==s)if(i)a+=o-n;else for(d=r;d<=s;d++)je(h[d])||h[d].isWorking||(a+=d===r?h[d].to-n:d===s?o-h[d].from:h[d].interval);else i?a+=o-n:h[r].isWorking||(a=o-n);return a},bqt.prototype.getPreviousWorkingDay=function(e){var t=e.getDay(),i=0===t?6:t-1,n=this.parent.getCurrentDayEndTime(e);return(-1!==this.parent.nonWorkingDayIndex.indexOf(t)||-1!==this.parent.nonWorkingDayIndex.indexOf(i)&&86400===n&&0===this.getSecondsInDecimal(e))&&(e.setDate(e.getDate()-1),-1!==this.parent.nonWorkingDayIndex.indexOf(e.getDay()))?this.getPreviousWorkingDay(e):e},bqt.prototype.getNonWorkingDayIndex=function(){for(var e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],t=e.length,i=(0===this.parent.workWeek.length&&(this.parent.workWeek=["Monday","Tuesday","Wednesday","Thursday","Friday"]),this.parent.workWeek.slice()),n=i.length,o=0;o<n;o++)i[o]=i[o].toLowerCase();this.parent.nonWorkingDayIndex=[];for(o=0;o<t;o++)-1===i.indexOf(e[o])&&this.parent.nonWorkingDayIndex.push(o)},bqt.prototype.setTime=function(e,t){var i=e/3600,n=(e-3600*(i=parseInt(i,10)))/60,n=parseInt(n,10);t.setHours(i,n,e-3600*i-60*n)},bqt.prototype.getTimeDifference=function(e,t,i){e=new Date(e.getTime()),t=new Date(t.getTime());return i&&this.updateDateWithTimeZone(e,t),t.getTime()-e.getTime()},bqt.prototype.updateDateWithTimeZone=function(e,t){var i,n,o,r,s=e.getTimezoneOffset(),a=t.getTimezoneOffset();s!==a&&((o=new Date((new Date).getFullYear(),0,1).getTimezoneOffset())!==s?(n=e,i=s):o!==a&&(n=t,i=a),o<0?(r=o-i,n.setTime(n.getTime()+60*r*1e3)):0<=o&&(r=i-o,n.setTime(n.getTime()-60*r*1e3)))},bqt.prototype.getSecondsInDecimal=function(e){return 60*e.getHours()*60+60*e.getMinutes()+e.getSeconds()+e.getMilliseconds()/1e3},bqt.prototype.offset=function(e,t){var i=e.getTimezoneOffset();try{var n=new Date(e.toLocaleString("en-US",{timeZone:t}));return isNaN(n.getTime())?0:(e.getTime()-n.getTime())/6e4+i}catch(e){return 0}},bqt.prototype.remove=function(e,t){return e=je(e)?e:this.reverse(e,t,e.getTimezoneOffset())},bqt.prototype.reverse=function(e,t,i){"string"==typeof t&&(t=this.offset(e,t)),"string"==typeof i&&(i=this.offset(e,i));var n=e.getTimezoneOffset(),t=(e=new Date(e.getTime()+6e4*(t-i))).getTimezoneOffset();return new Date(e.getTime()+6e4*(t-n))},bqt.prototype.convert=function(e,t){var i=e.getTimezoneOffset(),t=this.offset(e,t),n=("string"==typeof i&&(i=this.offset(e,i)),"string"==typeof t&&(t=this.offset(e,t)),e.getTimezoneOffset()),i=(e=new Date(e.getTime()+6e4*(i-t))).getTimezoneOffset();return new Date(e.getTime()+6e4*(i-n))},bqt.prototype.getDateFromFormat=function(e,t){var i;return je(e)?null:(e=e instanceof Date?new Date(e.getTime()):je(i=this.parent.globalize.parseDate(e,{format:this.parent.getDateFormat(),type:"dateTime"}))&&!isNaN(new Date(e).getTime())?new Date(e):i,!je(this.parent.timezone)&&t?this.convert(e,this.parent.timezone):e)},bqt.prototype.compareDates=function(e,t){return je(e)||je(t)?!je(e)&&je(t)?1:je(e)&&!je(t)?-1:null:e.getTime()>t.getTime()?1:e.getTime()<t.getTime()?-1:0},bqt.prototype.getDurationString=function(e,t){var i="";return je(e)||(i+=parseFloat(e.toFixed(2))+" ",je(t))||(e=1!==e,"day"===t?i+=e?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===t?i+=e?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):"minute"===t&&(i+=e?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute"))),i},bqt.prototype.getWorkString=function(e,t){var i="";return je(e)||(i+=parseFloat(e).toFixed(2)+" ",je(t))||(e=1!==e,"day"===t?i+=e?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===t?i+=e?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):"minute"===t&&(i+=e?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute"))),i},bqt.prototype.calculateProjectDatesForValidatedTasks=function(e){var t,i=this,n="string"==typeof this.parent.projectStartDate?new Date(this.parent.projectStartDate):this.parent.projectStartDate,o="string"==typeof this.parent.projectEndDate?new Date(this.parent.projectEndDate):this.parent.projectEndDate,r=null,s=null,a=R("dataOperation.dataArray",this.parent);n&&o||!a||0!==a.length?0<a.length&&(t=a.slice().sort(function(e,t){return new Date(e[i.parent.taskFields.startDate]).getTime()-new Date(t[i.parent.taskFields.startDate]).getTime()}),a=a.slice().sort(function(e,t){return new Date(t[i.parent.taskFields.endDate]).getTime()-new Date(e[i.parent.taskFields.endDate]).getTime()}),r=t[0][this.parent.taskFields.startDate],s=a[a.length-1][this.parent.taskFields.endDate]):(r=this.getDateFromFormat(new Date),s=this.getDateFromFormat(new Date(r.getTime()))),this.parent.cloneProjectStartDate=n?new Date(n.getTime()):"string"==typeof r?new Date(r):r,this.parent.cloneProjectEndDate=o?new Date(o.getTime()):"string"==typeof s?new Date(s):s},bqt.prototype.calculateProjectDates=function(e){var t,i,n,o,r,s,a,l,h,d=this;this.parent.isLoad&&this.parent.enablePersistence&&this.parent.cloneProjectStartDate&&this.parent.cloneProjectEndDate?(this.parent.cloneProjectStartDate=this.getDateFromFormat(this.parent.cloneProjectStartDate),this.parent.cloneProjectEndDate=this.getDateFromFormat(this.parent.cloneProjectEndDate)):(t="string"==typeof this.parent.projectStartDate?new Date(this.parent.projectStartDate):this.parent.projectStartDate,i="string"==typeof this.parent.projectEndDate?new Date(this.parent.projectEndDate):this.parent.projectEndDate,t=this.parent.timelineModule.isZooming&&this.parent.cloneProjectStartDate?this.getDateFromFormat(this.parent.cloneProjectStartDate):this.getDateFromFormat(t),i=this.parent.timelineModule.isZooming&&this.parent.cloneProjectEndDate?this.getDateFromFormat(this.parent.cloneProjectEndDate):this.getDateFromFormat(i),o=n=null,r=this.parent.flatData,s=this.parent.currentViewData,a=[],l=function(e){je(e)||a.push(e)},h=function(e){0<e.length&&(e.sort(function(e,t){return e.getTime()-t.getTime()}),n=new Date(e[0].getTime()),o=1<e.length?new Date(e[e.length-1].getTime()):null)},(!t||!i)&&0<r.length||e||this.parent.timelineModule.isZoomToFit?((0<s.length&&this.parent.timelineModule.isZoomToFit&&this.parent.treeGrid.filterModule&&0<this.parent.treeGrid.filterModule.filteredResult.length?s:r).forEach(function(e){a=[];var t,e=e.ganttProperties,i=je(e.startDate)&&je(e.endDate)?t=null:(t=d.getValidStartDate(e),d.getValidEndDate(e));l(n),l(o),l(t),l(i),d.parent.renderBaseline&&!d.parent.timelineModule.isZoomToFit&&(l(e.baselineStartDate),l(e.baselineEndDate)),e.indicators&&0<e.indicators.length&&!d.parent.timelineModule.isZoomToFit&&e.indicators.forEach(function(e){l(d.getDateFromFormat(e.date))}),h(a)}),a=[],l(n),l(o),0<this.parent.eventMarkers.length&&!this.parent.timelineModule.isZoomToFit&&this.parent.eventMarkers.forEach(function(e,t){l(d.getDateFromFormat(e.day))}),0<this.parent.totalHolidayDates.length&&!this.parent.timelineModule.isZoomToFit&&this.parent.totalHolidayDates.forEach(function(e,t){l(new Date(e))}),h(a),n&&o||(n?n=je(n)?this.getDateFromFormat(new Date):n:(n=je(n)?this.getDateFromFormat(new Date):n).setHours(0,0,0,0),(o=this.getDateFromFormat(new Date(n.getTime()))).setDate(o.getDate()+20))):t&&i||0!==r.length||(n=this.getDateFromFormat(new Date),o=this.getDateFromFormat(new Date(n.getTime()))),e?(x("minStartDate",n,e),x("maxEndDate",o,e)):(this.prevProjectStartDate=this.parent.cloneProjectStartDate,this.parent.cloneProjectStartDate=n&&(this.parent.timelineModule.isZoomToFit||je(t))?n:new Date(t.getTime()),this.parent.cloneProjectEndDate=o&&(this.parent.timelineModule.isZoomToFit||je(i))?o:new Date(i.getTime())),this.parent.isProjectDateUpdated=!0)},bqt.prototype.splitTasksDuration=function(e){var t=0,i=e[0].startDate,e=e[e.length-1].endDate;return"Hour"===this.parent.timelineModule.bottomTier?t+=Math.ceil(this.getTimeDifference(i,e)/36e5):"Minutes"===this.parent.timelineModule.bottomTier?t+=Math.ceil(this.getTimeDifference(i,e)/6e4):t+=Math.ceil(this.getTimeDifference(i,e)/864e5),t};var vqt=bqt;function bqt(e){this.fromSegments=!1,this.mondayTimeRangeLength=0,this.tuesdayTimeRangeLength=0,this.wednesdayTimeRangeLength=0,this.thursdayTimeRangeLength=0,this.fridayTimeRangeLength=0,this.saturdayTimeRangeLength=0,this.sundayTimeRangeLength=0,this.parent=e}wqt=function(e,t){return(wqt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}wqt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Aqt,Cqt=vqt),Aqt.prototype.addEventListener=function(){this.parent.on("beforeDataManipulate",this.checkDataBinding.bind(this))},Aqt.prototype.checkDataBinding=function(e){var t,i=this;e&&(this.parent.flatData=[],this.parent.currentViewData=[],this.parent.updatedRecords=[],this.dataArray=[],this.taskIds=[],this.parent.ids=[],this.recordIndex=0,this.hierarchyData=[],this.parent.predecessorsCollection=[],this.parent.treeGrid.parentData=[],this.parent.taskIds=[]),je(this.parent.dataSource)?(this.parent.dataSource=[],this.parent.processTimeline(),this.parent.renderGantt(e)):this.parent.dataSource instanceof me?this.initDataSource(e):(this.parent.dataSource instanceof Object&&sqt(this.parent)?(t=R("result",this.parent.dataSource),this.dataArray=t):this.dataArray=this.parent.dataSource,this.processTimeline(),this.cloneDataSource(),this.parent.renderGantt(e),this.parent.flatData.map(function(e){i.parent.chartRowsModule.updateSegment(e.ganttProperties.segments,e.ganttProperties.taskId)})),this.parent.flatData.map(function(e){i.parent.chartRowsModule.updateSegment(e.ganttProperties.segments,e.ganttProperties.taskId)})},Aqt.prototype.processTimeline=function(){this.parent.processTimeline(),this.parent.enableValidation||(this.parent.dataOperation.calculateProjectDatesForValidatedTasks(),this.parent.timelineModule.validateTimelineProp())},Aqt.prototype.initDataSource=function(t){var i=this,e=this.parent.query instanceof ya?this.parent.query:new ya,n=(e.requiresCount(),this.parent.dataSource);this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?(this.processTimeline(),this.parent.renderGantt(t)):n.executeQuery(e).then(function(e){i.dataArray=e.result,i.processTimeline(),i.parent.loadChildOnDemand&&(!i.parent.loadChildOnDemand||i.parent.taskFields.hasChildMapping)||i.cloneDataSource(),i.parent.renderGantt(t)}).catch(function(e){i.parent.processTimeline(),i.parent.renderGantt(t),i.parent.trigger("actionFailure",{error:e})})},Aqt.prototype.constructDataSource=function(e){for(var t,i=new me(e).executeLocal((new ya).group(this.parent.taskFields.parentID)),n=[],o=0;o<i.length;o++){var r=i[o];!je(r.key)&&-1<(t=this.taskIds.indexOf(r.key.toString()))&&!je(r.key)?e[t][this.parent.taskFields.child]=r.items:-1!==t&&n.push.apply(n,r.items)}this.hierarchyData=this.dataReorder(e,n)},Aqt.prototype.cloneDataSource=function(){var e,t,i,n=this.parent.taskFields.id,o=this.parent.taskFields.parentID,r=[];if(je(n)||je(o))r=this.dataArray;else{for(var s=[],a=0;a<this.dataArray.length;a++){var l=this.dataArray[a];l.parentItem&&delete l.parentItem,s.push(Pe({},{},l,!0)),je(l[n])||this.taskIds.push(l[n].toString())}this.parent.taskFields.child||this.parent.setProperties({taskFields:{child:"Children"}},!0),this.constructDataSource(s),r=this.hierarchyData}this.parent.taskFields.segmentId&&(this.segmentCollection=new me(this.parent.segmentData).executeLocal((new ya).group(this.parent.taskFields.segmentId)),this.parent.taskFields.segments||(this.parent.taskFields.segments="Segments")),"ProjectView"!==this.parent.viewType&&(o=Pe([],[],this.parent.resources,!0),this.constructResourceViewDataSource(o,r,e=[]),0<e.length&&(i=this.parent.resourceFields.name||"resourceName",(t={})[this.parent.resourceFields.id]=0,t[i]=this.parent.localeObj.getConstant("unassignedTask"),t[this.parent.taskFields.child]=e,o.push(t)),r=o),this.prepareDataSource(r)},Aqt.prototype.constructResourceViewDataSource=function(s,a,l){for(var h=this,e=0;e<a.length;e++)!function(e){var n=a[e],o=null!==h.parent.taskFields.child?h.parent.taskFields.child:h.parent.taskFields.child="Children",e=n&&n[h.parent.taskFields.resourceInfo],r=h.parent.resourceFields.id;if(n[o]&&0!==n[o].length||!e||!e.length)(!n[o]||n[o]&&0===n[o].length)&&l.push(n);else if("string"==typeof e){h.isResourceString=!0;for(var t=e,i=0;i<s.length;i++)if(s[i][h.parent.resourceFields.name].toString()===t.toString()){s[i][o]?s[i][o].push(n):s[i][o]=[n];break}}else e.forEach(function(e){for(var t="object"==typeof e?e[r]:e,i=0;i<s.length;i++)if(s[i][r].toString()===t.toString()){s[i][o]?s[i][o].push(n):s[i][o]=[n];break}});n[h.parent.taskFields.child]&&n[h.parent.taskFields.child].length&&h.constructResourceViewDataSource(s,n[h.parent.taskFields.child],l)}(e)},Aqt.prototype.prepareDataSource=function(e){this.prepareRecordCollection(e,0),this.parent.initialLoadData=Pe({},{},this.parent.flatData,!0),(!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)&&(this.parent.dataMap=this.parent.flatData.reduce(function(e,t){return e.set(t.uniqueID,t),e},new Map)),"ResourceView"===this.parent.viewType&&this.calculateSharedTaskUniqueIds(),this.parent.taskFields.dependency&&this.parent.predecessorModule&&this.parent.predecessorModule.ensurePredecessorCollection()},Aqt.prototype.calculateSharedTaskUniqueIds=function(){for(var r=this,e=0;e<this.parent.getTaskIds().length;e++)!function(e){var t=[];if(t[0]=r.parent.getTaskIds()[e][0],t[1]=r.parent.getTaskIds()[e].slice(1),"R"!==t[0]){var i=[],n=[];r.parent.flatData.filter(function(e){e.ganttProperties.taskId.toString()===t[1]&&0!==e.level&&(n.push(e.ganttProperties.rowUniqueID),i.push(e))});for(var o=0;o<i.length;o++)i[o].ganttProperties.sharedTaskUniqueIds=n}}(e)},Aqt.prototype.prepareRecordCollection=function(s,a,l){for(var h=this,e=s.length,d=this,t=0;t<e;t++)!function(e){var t,i,n,o=s[e],e=(je(d.parent.taskFields.segmentId)||0<(e=d.segmentCollection.filter(function(e){return e.key===o[h.parent.taskFields.id]})).length&&(o[d.parent.taskFields.segments]=e[0].items),d.parent.taskFields.hasChildMapping&&o.parentUniqueID&&(l=d.parent.getTaskByUniqueID(o.parentUniqueID)),d.createRecord(o,a,l,!0)),r=(d.parent.enableValidation&&d.parent.autoCalculateDateScheduling&&!(d.parent.isLoad&&d.parent.treeGrid.loadChildOnDemand&&d.parent.taskFields.hasChildMapping)||d.updateTaskLeftWidth(e),e.index=d.recordIndex++,d.parent.ids[e.index]=e.ganttProperties.rowUniqueID,d.parent.flatData.push(e),d.parent.setTaskIds(e),o[d.parent.taskFields.child]||o.taskData&&o.taskData[d.parent.taskFields.child]);"ResourceView"===d.parent.viewType&&je(r)&&je(e.parentItem)&&0===e.level&&(i=e.ganttProperties,d.parent.setRecordValue(i.isAutoSchedule?"startDate":"autoStartDate",null,(t=e).ganttProperties,!0),d.parent.setRecordValue(i.isAutoSchedule?"endDate":"autoEndDate",null,t.ganttProperties,!0),i=t.ganttProperties,d.parent.setRecordValue("isMilestone",!1,i,!0),i.isAutoSchedule&&d.calculateDuration(t),d.updateWorkWithDuration(t),n=i.work,d.parent.setRecordValue("work",n,i,!0),d.parent.setRecordValue("taskType","FixedDuration",i,!0),je(d.parent.taskFields.type)||d.updateMappingData(t,"type"),d.parent.setRecordValue("progress",Math.floor(0),i,!0),d.parent.setRecordValue("totalProgress",0,i,!0),d.parent.setRecordValue("totalDuration",0,i,!0),i.isAutoSchedule||(d.parent.setRecordValue("autoDuration",d.calculateAutoDuration(i),i,!0),d.updateAutoWidthLeft(t)),d.parent.allowParentDependency||d.resetDependency(t),d.updateWidthLeft(t),d.updateTaskData(t)),d.parent.taskFields.hasChildMapping&&(l=null),!je(r)&&0<r.length&&d.prepareRecordCollection(r,e.level+1,e)}(t)},Aqt.prototype.addCustomFieldValue=function(e,t){var i=this.parent.ganttColumns,n=i.length;if(n)for(var o=0;o<n;o++)void 0===t[i[o].field]&&this.parent.setRecordValue(i[o].field,e[i[o].field],t)},Aqt.prototype.getGanttUid=function(e){return e+this.uid++},Aqt.prototype.createRecord=function(e,t,i,n){var o=this.parent.taskFields,r=this.parent.resourceFields,s=e[o.progress],a=null,l=null,h=e[o.notes],d=(s=100<(s=s&&parseFloat(s.toString())?parseFloat(s.toString()):0)?100:s,e[o.dependency]),p=this.getDateFromFormat(e[o.baselineStartDate],!0),c=this.getDateFromFormat(e[o.baselineEndDate],!0),u={},g={},m="Auto"===this.parent.taskMode||"Manual"!==this.parent.taskMode&&!0!==e[o.manual],a=(this.parent.setRecordValue("ganttProperties",g,u),e.ganttProperties&&e.ganttProperties.predecessor&&0<e.ganttProperties.predecessor.length&&this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.setRecordValue("predecessor",e.ganttProperties.predecessor,g,!0),je(e[o.id])?je(e[r.id])||(a=e[r.id],l=je(e[r.name])&&"Unassigned Task"===e.resourceName?e.resourceName:e[r.name],this.addTaskData(u,e,!1)):(a=e[o.id],l=e[o.name],!!(this.parent.loadChildOnDemand&&o.hasChildMapping&&e.taskData)?u.taskData=e.taskData:e.taskData&&e.ganttProperties?this.addTaskData(u,e.taskData,n):this.addTaskData(u,e,n)),this.parent.setRecordValue("taskId",a,g,!0),this.parent.setRecordValue("taskName",l,g,!0),this.parent&&o.parentID&&this.parent.setRecordValue("parentId",e[o.parentID],g,!0),this.addCustomFieldValue(e,u),this.parent.setRecordValue("isAutoSchedule",m,g,!0),!this.parent.undoRedoModule||this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed?this.parent.setRecordValue("resourceInfo",this.setResourceInfo(e),g,!0):e.ganttProperties&&this.parent.setRecordValue("resourceInfo",e.ganttProperties.resourceInfo,g,!0),this.parent.setRecordValue("isMilestone",!1,g,!0),this.parent.setRecordValue("indicators",e[o.indicators],g,!0),this.updateResourceName(u),!je(e[o.child])&&0<e[o.child].length||e.taskData&&e.taskData[o.child]&&0<e.taskData[o.child].length?(this.parent.setRecordValue("hasChildRecords",!0,u),this.parent.setRecordValue("isMilestone",!1,g,!0),this.parent.allowParentDependency||this.resetDependency(u)):this.parent.loadChildOnDemand&&o.hasChildMapping&&u.taskData[o.hasChildMapping]?this.parent.setRecordValue("hasChildRecords",!0,u):this.parent.setRecordValue("hasChildRecords",!1,u),this.calculateScheduledValues(u,e,n),this.parent.setRecordValue("baselineStartDate",this.checkBaselineStartDate(p,g),g,!0),r=0<this.parent.weekWorkingTime.length&&c?this.parent.getEndTime(c):this.parent.defaultEndTime,c&&0===c.getHours()&&86400!==r&&this.setTime(r,c),(g.baselineStartDate&&c&&g.baselineStartDate.getTime()>c.getTime()||!je(g.baselineStartDate)&&!je(g.startDate)&&g.baselineStartDate.getTime()===g.startDate.getTime()&&!je(c)&&!je(g.endDate)&&c.toLocaleDateString()===g.endDate.toLocaleDateString()&&g.isMilestone)&&(c=g.baselineStartDate),this.parent.setRecordValue("baselineEndDate",this.checkBaselineEndDate(c,g),g,!0),this.parent.setRecordValue("progress",s,g,!0),this.parent.setRecordValue("totalProgress",s,g,!0),e.ganttProperties&&e.ganttProperties.predecessorsName&&this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed?this.parent.setRecordValue("predecessorsName",e.ganttProperties.predecessorsName,g,!0):this.parent.setRecordValue("predecessorsName",d,g,!0),this.parent.setRecordValue("notes",h,g,!0),this.parent.setRecordValue("cssClass",e[o.cssClass],g,!0),this.parent.setRecordValue("parentItem",this.getCloneParent(i),u),this.parent.loadChildOnDemand&&o.hasChildMapping&&0<this.parent.currentViewData.length&&this.parent.setRecordValue("parentItem",u.parentItem,this.parent.currentViewData[this.taskIds.indexOf(e[o.id].toString())]),u.parentItem?u.parentItem.uniqueID:null);return this.parent.setRecordValue("parentUniqueID",a,u),"ResourceView"!==this.parent.viewType||je(o.parentID)||je(u.parentItem)||this.parent.setRecordValue("parentId",u.parentItem.taskId,g,!0),this.parent.setRecordValue("level",t,u),e.ganttProperties&&this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed||this.parent.loadChildOnDemand&&o.hasChildMapping&&e.uniqueID?this.parent.setRecordValue("uniqueID",e.uniqueID,u):this.parent.setRecordValue("uniqueID",this.getGanttUid(this.parent.element.id+"_data_"),u),this.parent.setRecordValue("uniqueID",u.uniqueID,g,!0),this.parent.setRecordValue("childRecords",[],u),this.parent.dataSource instanceof Object&&sqt(this.parent)&&!je(o.child)&&this.parent.setRecordValue(o.child,[],u),u.hasChildRecords&&(this.parent.setRecordValue("autoStartDate",u.ganttProperties.startDate,g),this.parent.setRecordValue("autoEndDate",u.ganttProperties.endDate,g),this.parent.setRecordValue("autoDuration",u.ganttProperties.duration,g)),this.parent.setRecordValue("expanded",!u.hasChildRecords||!this.parent.collapseAllParentTasks,u),this.updateExpandStateMappingValue(u,e),n||(this.parent.setRecordValue("width",this.calculateWidth(u),g,!0),this.parent.setRecordValue("left",this.calculateLeft(g,u),g,!0),this.parent.setRecordValue("progressWidth",this.getProgressWidth(g.width,s),g,!0),g.baselineEndDate&&g.baselineStartDate&&(this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(g),g,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(g),g,!0))),je(o.work)&&this.updateWorkWithDuration(u),je(o.manual)||this.parent.dataOperation.updateMappingData(u,"manual"),this.updateTaskData(u),d&&this.parent.predecessorsCollection.push(u),je(i)||(i.childRecords.push(u),this.parent.dataSource instanceof Object&&sqt(this.parent)&&!je(this.parent.taskFields.child)&&i[this.parent.taskFields.child].push(u.taskData)),"ProjectView"===this.parent.viewType?this.parent.setRecordValue("rowUniqueID",g.taskId.toString(),g,!0):(l=u.uniqueID.replace(this.parent.element.id+"_data_",""),this.parent.setRecordValue("rowUniqueID",l,u),this.parent.setRecordValue("rowUniqueID",l,g,!0),this.parent.setRecordValue("sharedTaskUniqueIds",[],g,!0)),this.parent.allowUnscheduledTasks&&u.ganttProperties.startDate&&(u.ganttProperties.endDate||u.ganttProperties.duration)&&(this.parent.setRecordValue("segments",this.setSegmentsInfo(u,!0),g,!0),this.parent.dataOperation.updateMappingData(u,"segments"),n||this.updateWidthLeft(u)),this.parent.chartRowsModule.updateSegment(u.ganttProperties.segments,u.ganttProperties.taskId),u},Aqt.prototype.sortSegmentsData=function(e,t,i){var n=this;return t?e.sort(function(e,t){var i=n.parent.taskFields.startDate;return n.getDateFromFormat(e[i]).getTime()-n.getDateFromFormat(t[i]).getTime()}):e.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()}),e},Aqt.prototype.setSegmentsInfo=function(e,t){var i,n=this,o=this.parent.taskFields,r=[],s=0,a=0,l=[this.parent.taskFields.duration,this.parent.taskFields.endDate,this.parent.taskFields.startDate,this.parent.taskFields.id],h=[];if(!je(this.parent.taskFields.segments)&&(i=t?e.taskData[this.parent.taskFields.segments]:e.ganttProperties.segments,t||e.taskData[this.parent.taskFields.segments]&&0<e.taskData[this.parent.taskFields.segments].length&&e.taskData[this.parent.taskFields.segments].forEach(function(e){var t,i={};for(t in e)-1!==l.indexOf(t)?(t,e[t]):i[t]=e[t];n.customSegmentProperties.push(i)}),!je(i))&&1<i.length){this.sortSegmentsData(i,t,e.ganttProperties);for(var d=0;d<i.length;d++){var p=i[d],c=t?p[o.startDate]:p.startDate,u=t?p[o.endDate]:p.endDate,g=t?p[o.duration]:p.duration,c=this.getDateFromFormat(c);if(c=this.checkStartDate(c,e.ganttProperties,!1),je(g)){if((u=this.getDateFromFormat(u))&&(je(g)||""===String(g))&&(m=void 0,m=0<this.parent.weekWorkingTime.length?this.parent.getEndTime(u):this.parent.defaultEndTime,0===u.getHours())&&86400!==m&&this.setTime(m,u),u=this.checkEndDate(u,e.ganttProperties,!1),g=this.getDuration(c,u,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone),o.duration){if((a=e.ganttProperties.duration-s-1)<=0)continue;g=d===i.length-1||0<a&&a<g?a:g,u=this.getEndDate(c,g,e.ganttProperties.durationUnit,e.ganttProperties,!1)}else if(!o.duration&&o.endDate&&u&&(u=!je(e.ganttProperties.endDate)&&u.getTime()>=e.ganttProperties.endDate.getTime()&&d===i.length-1?e.ganttProperties.endDate:u,g=this.getDuration(c,u,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone),0<r.length)&&u.getTime()<c.getTime()&&u.getTime()<=e.ganttProperties.endDate.getTime()){r[d-1].duration=this.getDuration(r[d-1].startDate,e.ganttProperties.endDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone);continue}}else if(u=this.getEndDate(c,g,e.ganttProperties.durationUnit,e.ganttProperties,!1),o.duration){if((a=e.ganttProperties.duration-s)<=0)continue;g=d===i.length-1||0<a&&a<g?a:g,u=this.getEndDate(c,g,e.ganttProperties.durationUnit,e.ganttProperties,!1)}else if(!o.duration&&o.endDate&&u&&(u=!je(e.ganttProperties.endDate)&&u.getTime()>=e.ganttProperties.endDate.getTime()&&d===i.length-1?e.ganttProperties.endDate:u,g=this.getDuration(c,u,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone),0<r.length)&&u.getTime()<c.getTime()&&u.getTime()<=e.ganttProperties.endDate.getTime()){r[d-1].duration=this.getDuration(r[d-1].startDate,e.ganttProperties.endDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone);continue}if(p={},!(c&&u&&c&&g))break;if(s+=Number(g),p.startDate=c,p.endDate=u,p.duration=Number(g),p.width=0,p.left=0,p.segmentIndex=d,r.push(p),je(r[d-1]))p.offsetDuration=0;else{c=void 0,c=je(this.parent.timelineSettings.bottomTier)?e.ganttProperties.durationUnit:"Minutes"===this.parent.timelineSettings.bottomTier.unit?"minute":"Hour"===this.parent.timelineSettings.bottomTier.unit?"hour":e.ganttProperties.durationUnit,u=this.getDuration(r[d-1].endDate,r[d].startDate,c,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone);if((p.offsetDuration=u)<1){if(0===this.parent.weekWorkingTime.length)p.startDate=this.getEndDate(r[d-1].endDate,1,e.ganttProperties.durationUnit,e.ganttProperties,!1);else{g=new Date(r[d-1].endDate.getTime());if(p.startDate=new Date(g.setHours(g.getHours()+24)),this.isOnHolidayOrWeekEnd(p.startDate,!0))for(;p.startDate.setDate(p.startDate.getDate()+1),this.isOnHolidayOrWeekEnd(p.startDate,!0););this.parent.includeWeekend||(p.startDate=this.getNextWorkingDay(p.startDate));var m=this.parent.getEndTime(r[d-1].endDate);this.getSecondsInDecimal(r[d-1].endDate)===m&&this.setTime(this.parent.getEndTime(p.startDate),p.startDate)}p.startDate=this.checkStartDate(p.startDate,e.ganttProperties,!1),p.endDate=this.getEndDate(p.startDate,p.duration,e.ganttProperties.durationUnit,e.ganttProperties,!1),p.endDate=(!o.duration&&o.endDate&&p.endDate>e.ganttProperties.endDate?e.ganttProperties:p).endDate,p.offsetDuration=1}}h.push(this.setSegmentTaskData(p,i[d]))}this.parent.setRecordValue("duration",s,e.ganttProperties,!0),je(r[r.length-1])||this.parent.setRecordValue("endDate",r[r.length-1].endDate,e.ganttProperties,!0),je(o.endDate)||je(r[r.length-1])||this.parent.setRecordValue(this.parent.taskFields.endDate,r[r.length-1].endDate,e,!0),!t&&h&&0<h.length&&h.forEach(function(e,t){e=Object.assign({},e,n.customSegmentProperties[t]);h[t]=e}),this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,h,e)}return 1<r.length?(this.parent.setRecordValue("segments",r,e.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.segments,e.taskData[this.parent.taskFields.segments],e,!0)):r=null,r},Aqt.prototype.setSegmentTaskData=function(e,t){var i=this.parent.taskFields,t=Pe({},{},t,!0);return je(i.startDate)||(t[this.parent.taskFields.startDate]=e.startDate),je(i.endDate)||(t[this.parent.taskFields.endDate]=e.endDate),je(i.duration)||(t[this.parent.taskFields.duration]=Number(e.duration)),t},Aqt.prototype.fetchResources=function(e){return this.parent.editModule&&this.parent.editModule.dialogModule&&(this.parent.editModule.dialogModule.isFromAddDialog||this.parent.editModule.dialogModule.isFromEditDialog)?this.parent.editModule.dialogModule.ganttResources:e.ganttProperties.resourceInfo},Aqt.prototype.updateWorkWithDuration=function(e){if(this.parent.triggeredColumnName!==this.parent.taskFields.work||0===e.ganttProperties.duration||!je(e.ganttProperties.resourceInfo)&&0===e.ganttProperties.resourceInfo.length){var t,i=this.fetchResources(e),n=0;if(!je(i)&&0<i.length&&!e.hasChildRecords){for(var o,r=i.length,s=void 0,a=(0<this.parent.weekWorkingTime.length?this.parent.getSecondsPerDay(e.ganttProperties.startDate||e.ganttProperties.endDate):this.parent.secondsPerDay)/3600,l=this.getDurationInDay(e.ganttProperties.duration,e.ganttProperties.durationUnit),s=0;s<r;s++)n+=(t=0<(o=i[s][this.parent.resourceFields.unit])?a*o/100:0)*l;"minute"===e.ganttProperties.workUnit&&(n*=60),"day"===e.ganttProperties.workUnit&&(n/=a),n%1!=0&&(n=parseFloat(n.toFixed(2)))}else!e.hasChildRecords&&!je(e.ganttProperties.work)&&!je(e.ganttProperties.duration)&&0<e.ganttProperties.duration&&(n=e.ganttProperties.work);if(e.childRecords&&0<e.childRecords.length&&this.parent.isOnEdit){for(var h=0,d=0;d<e.childRecords.length;d++)h+=e.childRecords[d].ganttProperties.work;n+=h}"FixedUnit"===e.ganttProperties.taskType&&0===t&&(this.parent.setRecordValue("duration",n=0,e.ganttProperties,!0),je(this.parent.taskFields.duration)||this.parent.setRecordValue(this.parent.taskFields.duration,0,e,!0)),this.parent.setRecordValue("work",n,e.ganttProperties,!0),je(this.parent.taskFields.work)||this.parent.isLoad||this.parent.dataOperation.updateMappingData(e,"work")}},Aqt.prototype.getCloneParent=function(e){var t;return je(e)?null:((t={}).uniqueID=e.uniqueID,t.expanded=e.expanded,t.level=e.level,t.index=e.index,t.taskId=e.ganttProperties.rowUniqueID,t)},Aqt.prototype.reUpdateResources=function(){if(0<this.parent.flatData.length)for(var e,t,i,n=0;n<this.parent.flatData.length;n++)e=this.parent.flatData[n].taskData,t=this.parent.flatData[n].ganttProperties,i=this.parent.flatData[n],this.parent.setRecordValue("resourceInfo",this.setResourceInfo(e),t,!0),this.updateResourceName(i)},Aqt.prototype.addTaskData=function(e,t,i){var n,o=this,r=this.parent.taskFields,s=this.parent.dataSource;i&&(r.parentID||s instanceof me&&s.dataSource.json&&s.dataSource.offline)&&r.parentID?(i=t[r.id],s=this.taskIds.indexOf(i.toString()),n=-1<s?this.dataArray[s]:{},je(this.parent.taskFields.segmentId)||0<(r=this.segmentCollection.filter(function(e){return e.key===n[o.parent.taskFields.id]})).length&&(n[this.parent.taskFields.segments]=r[0].items),this.parent.setRecordValue("taskData",n,e)):this.parent.setRecordValue("taskData",t,e)},Aqt.prototype.updateExpandStateMappingValue=function(e,t){var i,n=this.parent.taskFields.expandState,t=t[n];n&&e.hasChildRecords&&(je(t)?je(t)&&!this.parent.collapseAllParentTasks?i=!0:je(t)&&this.parent.collapseAllParentTasks&&(i=!1):i="true"===t.toString(),this.parent.setRecordValue("taskData."+n,i,e),this.parent.setRecordValue(n,i,e),this.parent.setRecordValue("expanded",i,e))},Aqt.prototype.setValidatedDates=function(e,t){var i=e.ganttProperties,n=this.parent.taskFields,o=t[n.duration],r=this.getDateFromFormat(t[n.startDate],!0),t=this.getDateFromFormat(t[n.endDate],!0),o=je(o)||""===o?null:o;this.parent.setRecordValue("startDate",new Date(r.getTime()),i,!0),je(o)||""===o?this.calculateDuration(e):this.updateDurationValue(o,i),this.parent.setRecordValue("endDate",new Date(t.getTime()),i,!0)},Aqt.prototype.calculateScheduledValues=function(e,t,i){var n,o=this.parent.taskFields,r=e.ganttProperties,s=je(s=t[o.duration])||""===s?null:s,a=r.startDate&&r.endDate?(n=this.getDateFromFormat(r.startDate,!0),this.getDateFromFormat(r.endDate,!0)):(n=this.getDateFromFormat(t[o.startDate],!0),this.getDateFromFormat(t[o.endDate],!0)),l=o.segments?t[o.segments]||e.taskData[o.segments]:null,h=!!o.milestone&&!!t[o.milestone],d=t[o.durationUnit]||"",d=(this.parent.setRecordValue("durationUnit",this.validateDurationUnitMapping(d),r,!0),je(t[o.work])?0:parseFloat(t[o.work])),p=(this.parent.setRecordValue("workUnit",this.validateWorkUnitMapping(this.parent.workUnit),r,!0),t[o.type]||""),p=this.validateTaskTypeMapping(p);if(this.parent.setRecordValue("taskType",p,r,!0),t[this.parent.resourceFields.name]===this.parent.localeObj.getConstant("unassignedTask")&&this.parent.setRecordValue("taskType","FixedDuration",r,!0),i&&!this.parent.enableValidation&&n&&a)this.setValidatedDates(e,t);else if(a||n||!je(s)&&""!==s)n?this.calculateDateFromStartDate(n,a,s,e,i):a?this.calculateDateFromEndDate(a,s,e):je(s)||""===s||(this.updateDurationValue(s,r),n=this.parent.allowUnscheduledTasks?null:this.getProjectStartDate(r,i),this.parent.setRecordValue("startDate",n,r,!0),this.parent.allowUnscheduledTasks?this.parent.setRecordValue("endDate",null,r,!0):this.calculateEndDate(e));else{if(this.parent.allowUnscheduledTasks)return;this.parent.setRecordValue("duration",1,r,!0),this.parent.setRecordValue("startDate",this.getProjectStartDate(r,i),r,!0),this.calculateEndDate(e)}if((!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)&&(je(e.ganttProperties.startDate)||je(this.parent.taskFields.startDate)||(e[this.parent.taskFields.startDate]=e.ganttProperties.startDate,e.taskData[this.parent.taskFields.startDate]=e.ganttProperties.startDate),je(e.ganttProperties.endDate)||je(this.parent.taskFields.endDate)||(e[this.parent.taskFields.endDate]=e.ganttProperties.endDate,e.taskData[this.parent.taskFields.endDate]=e.ganttProperties.endDate)),je(o.work))o.type&&r.taskType&&this.parent.dataOperation.updateMappingData(e,"type");else{a=this.parent.taskFields.durationUnit&&t[o.durationUnit]?t[o.durationUnit]:this.parent.durationUnit;if(this.parent.setRecordValue("durationUnit",a,r,!0),isNaN(d)||je(d))this.parent.setRecordValue("work",0,r,!0),this.parent.setRecordValue("duration",0,r,!0),this.parent.setRecordValue("isMilestone",!0,r,!0),je(this.parent.taskFields)||je(this.parent.taskFields.milestone)||this.parent.setRecordValue(this.parent.taskFields.milestone,!0,e,!0),this.parent.setRecordValue("endDate",r.startDate,r,!0);else{switch(this.parent.setRecordValue("work",d,r,!0),p){case"FixedDuration":(je(e[this.parent.taskFields.resourceInfo])||je(e.ganttProperties.resourceInfo)||0===e.ganttProperties.resourceInfo.length)&&0!==r.duration||this.updateWorkWithDuration(e);break;case"FixedWork":(je(e[this.parent.taskFields.resourceInfo])||je(e.ganttProperties.resourceInfo)||0===e.ganttProperties.resourceInfo.length)&&0!==r.work||this.updateDurationWithWork(e);break;case"FixedUnit":e.hasChildRecords||this.updateDurationWithWork(e)}je(o.type)||this.parent.dataOperation.updateMappingData(e,"type"),0===r.duration?(this.parent.setRecordValue("isMilestone",!0,r,!0),je(this.parent.taskFields)||je(this.parent.taskFields.milestone)||this.parent.setRecordValue(this.parent.taskFields.milestone,!0,e,!0),this.parent.setRecordValue("endDate",r.startDate,r,!0)):je(r.startDate)||je(r.duration)||(this.parent.setRecordValue("isMilestone",!1,r,!0),je(this.parent.taskFields)||je(this.parent.taskFields.milestone)||this.parent.setRecordValue(this.parent.taskFields.milestone,!1,e,!0),this.calculateEndDate(e))}this.parent.dataOperation.updateMappingData(e,"work")}je(l)||this.parent.setRecordValue("segments",this.setSegmentsInfo(e,!0),r,!0),0===r.duration&&(this.parent.setRecordValue("isMilestone",!0,r,!0),je(this.parent.taskFields)||je(this.parent.taskFields.milestone)||this.parent.setRecordValue(this.parent.taskFields.milestone,!0,e,!0),this.parent.setRecordValue("endDate",r.startDate,r,!0)),!je(h)&&h&&(this.parent.setRecordValue("duration",0,r,!0),this.parent.setRecordValue("isMilestone",!0,r,!0),je(this.parent.taskFields)||je(this.parent.taskFields.milestone)||this.parent.setRecordValue(this.parent.taskFields.milestone,!0,e,!0),this.parent.setRecordValue("endDate",r.startDate,r,!0))},Aqt.prototype.updateDurationWithWork=function(e){var t=e.ganttProperties,i=this.fetchResources(e);if(!je(i)&&0<i.length){for(var n,o=je(i)?0:i.length,r=0,s=(0<this.parent.weekWorkingTime.length?this.parent.getSecondsPerDay(e.ganttProperties.startDate||e.ganttProperties.endDate):this.parent.secondsPerDay)/3600,a=0,l=void 0,l=0;l<o;l++)r+=0<(n=i[l][this.parent.resourceFields.unit])?s*n/100:"FixedUnit"!==e.ganttProperties.taskType&&"FixedWork"!==t.taskType&&0!==t.duration?s:0;var h=this.getWorkInHour(t.work,t.workUnit);0<o&&0<r&&(a+=h/r),"FixedUnit"===t.taskType&&0===r&&(this.parent.setRecordValue("work",0,t,!0),this.parent.setRecordValue(this.parent.taskFields.work,0,e,!0)),"minute"===t.durationUnit&&(a=a*s*60),"hour"===t.durationUnit&&(a*=s),a%1!=0&&(a=parseFloat(a.toFixed(2))),je(t.duration)||this.parent.setRecordValue("duration",a,t,!0),this.parent.dataOperation.updateMappingData(e,"duration"),this.parent.editModule&&this.parent.editModule.dialogModule&&this.parent.editModule.dialogModule.isFromEditDialog&&(this.isDurationValueUpdated=!0)}},Aqt.prototype.updateUnitWithWork=function(e){var t=e.ganttProperties,i=this.fetchResources(e),n=je(i)?0:i.length,o=0<this.parent.weekWorkingTime.length?this.parent.getSecondsPerDay(e.ganttProperties.startDate||e.ganttProperties.endDate):this.parent.secondsPerDay,o=o/3600;if(0!==n){var r=this.getDurationInDay(e.ganttProperties.duration,e.ganttProperties.durationUnit),s=this.getWorkInHour(t.work,t.workUnit),s=0<r?s/(r*o)*100:0,a=0==s?0:0<s?s/n:100;a%1!=0&&(a=parseFloat(a.toFixed(2)));for(var l=0;l<n;l++)i[l][this.parent.resourceFields.unit]=a,this.parent.isLoad||je(this.parent.editModule)||je(this.parent.editModule.dialogModule)||this.parent.editModule.dialogModule.isEdit||je(this.parent.editModule.cellEditModule)||this.parent.editModule.cellEditModule.isCellEdit||t.resourceInfo&&(t.resourceInfo[l][this.parent.resourceFields.unit]=a),this.parent.editModule&&this.parent.editModule.dialogModule&&!je(this.parent.editModule.dialogModule.ganttResources[l])&&(this.parent.editModule.dialogModule.ganttResources[l][this.parent.resourceFields.unit]=a);this.updateResourceName(e)}},Aqt.prototype.calculateDateFromEndDate=function(e,t,i){var n=i.ganttProperties,o=0<this.parent.weekWorkingTime.length?this.parent.getEndTime(e):this.parent.defaultEndTime,o=(0===e.getHours()&&86400!==o&&this.setTime(o,e),0===parseInt(t,10)||null);this.parent.setRecordValue("endDate",this.checkEndDate(e,i.ganttProperties,o),n,!0),je(t)||""===t?this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("startDate",null,n,!0),this.parent.setRecordValue("duration",null,n,!0)):(this.parent.setRecordValue("duration",1,n,!0),this.parent.setRecordValue("startDate",this.getStartDate(n.endDate,n.duration,n.durationUnit,n),n,!0)):je(t)||""===t||(this.updateDurationValue(t,n),this.parent.setRecordValue("startDate",this.getStartDate(n.endDate,n.duration,n.durationUnit,n),n,!0))},Aqt.prototype.calculateDateFromStartDate=function(e,t,i,n,o){var r=n.ganttProperties,s=!!(0===parseInt(i,10)||e&&t&&new Date(e.getTime())===new Date(t.getTime()))||null;this.parent.setRecordValue("startDate",this.checkStartDate(e,r,s,o),r,!0),this.parent.isTreeGridRendered&&n&&this.updateTaskData(n),t||!je(i)&&""!==i?je(i)||t?t&&(je(i)||""===i)?(e=void 0,e=0<this.parent.weekWorkingTime.length?this.parent.getEndTime(t):this.parent.defaultEndTime,0===t.getHours()&&86400!==e&&this.setTime(e,t),this.parent.setRecordValue("endDate",this.checkEndDate(t,n.ganttProperties),r,!0),1===this.compareDates(r.startDate,r.endDate)?(this.parent.setRecordValue("endDate",r.startDate,r,!0),this.parent.setRecordValue("isMilestone",!0,r,!0),this.parent.setRecordValue("duration",0,r,!0)):this.calculateDuration(n)):(this.updateDurationValue(i,r),!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.setRecordValue("endDate",t,r,!0):this.calculateEndDate(n)):(this.updateDurationValue(i,r),this.calculateEndDate(n)):this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("endDate",null,r,!0),this.parent.setRecordValue("duration",null,r,!0)):(this.parent.setRecordValue("duration",1,r,!0),this.calculateEndDate(n))},Aqt.prototype.getProgressWidth=function(e,t){return e*t/100},Aqt.prototype.calculateWidth=function(e,t){var i=e.ganttProperties,n=t?i.autoStartDate:i.startDate,o=t?i.autoEndDate:i.endDate;return je(n)&&je(o)&&(n=this.getValidStartDate(i,t),o=this.getValidEndDate(i,t)),je(n)||je(o)?3:!i.isMilestone||e.hasChildRecords&&!i.isAutoSchedule?this.getTaskWidth(n,o,i):0},Aqt.prototype.getTaskbarHeight=function(){var e=this.parent.rowHeight,t=this.parent.taskbarHeight;return t<e?t:e},Aqt.prototype.calculateLeft=function(e,t,i){var n=null,o=-300,r=i?e.autoStartDate:e.startDate,s=i?e.autoEndDate:e.endDate,i=i?e.autoDuration:e.duration,a=e.isMilestone;return(r=t&&this.parent.allowUnscheduledTasks&&je(r)&&je(s)&&!je(i)&&!t.hasChildRecords&&t.parentItem&&("Manual"===this.parent.taskMode||"Custom"===this.parent.taskMode&&t[this.parent.taskFields.manual])&&(i=this.parent.getParentTask(t.parentItem)).ganttProperties.startDate?i.ganttProperties.startDate:r)?n=new Date(r.getTime()):s?(n=new Date(s.getTime()),a=!je(r)||!this.parent.allowUnscheduledTasks):n=this.getValidStartDate(e),o=je(n)?o:this.getTaskLeft(n,a)},Aqt.prototype.calculateAutoLeft=function(e){return this.getTaskLeft(e.autoStartDate,e.isMilestone)},Aqt.prototype.calculateAutoDuration=function(e){return this.getDuration(e.autoStartDate,e.autoEndDate,e.durationUnit,!1,e.isMilestone)},Aqt.prototype.calculateAutoWidth=function(e){return this.getTaskWidth(e.autoStartDate,e.autoEndDate)},Aqt.prototype.calculateBaselineLeft=function(e){var t=this.getDateFromFormat(e.baselineStartDate),i=this.getDateFromFormat(e.baselineEndDate);return t&&i?this.getTaskLeft(t,e.isMilestone):0},Aqt.prototype.calculateBaselineWidth=function(e){var t=this.getDateFromFormat(e.baselineStartDate),e=this.getDateFromFormat(e.baselineEndDate);return t&&e&&t.getTime()!==e.getTime()?(this.isBaseline=!0,this.getTaskWidth(t,e)):0},Aqt.prototype.getTaskWidth=function(e,t,i){var n=new Date(e.getTime()),o=new Date(t.getTime()),r=("None"!==this.parent.timelineModule.customTimelineSettings.bottomTier.unit?this.parent.timelineModule.customTimelineSettings.bottomTier:this.parent.timelineModule.customTimelineSettings.topTier).unit,s=(this.parent.timelineModule.customTimelineSettings,!1),a=new Date(e.getTime()),l=0;if(je(i)||"hour"!==i.durationUnit||(a=new Date(a.getTime()+60*i.duration*60*1e3)),(!je(i)&&"minute"===i.durationUnit||!je(i)&&"day"===i.durationUnit&&i.duration<1)&&(a=new Date(a.getTime()+60*i.duration*1e3)),this.isBaseline&&"Day"===r){var h=this.getDuration(n,o,"day",!0,!1);if(this.isBaseline=!1,0<h&&h<1)return h*this.parent.perDayWidth}if(0<this.parent.weekWorkingTime.length)for(var d=new Date(e.getTime()),p=e.getDate();p<=t.getDate();p++){var c=d.getDay(),u=void 0,g=this.parent.weekWorkingTime;switch(c){case 0:u="Sunday";break;case 1:u="Monday";break;case 2:u="Tuesday";break;case 3:u="Wednesday";break;case 4:u="Thursday";break;case 5:u="Friday";break;case 6:u="Saturday";break;default:u=""}for(var m=!0,f=0;f<g.length;f++)if(g[f][u]&&0<g[f][u].length)for(var m=!1,y=0;y<g[f][u].length;y++)l=l+g[f][u][y].to-g[f][u][y].from;if(m)for(var v=0;v<this.parent.dayWorkingTime.length;v++)l=l+this.parent.dayWorkingTime[v].to-this.parent.dayWorkingTime[v].from;d=new Date(d.setDate(d.getDate()+1)),this.parent.includeWeekend||(d=this.parent.dataOperation.getNextWorkingDay(d))}else for(f=0;f<this.parent.dayWorkingTime.length;f++)l=l+this.parent.dayWorkingTime[f].to-this.parent.dayWorkingTime[f].from;var b,w,C,S,h=a.getTime()-n.getTime();return!je(i)&&"minute"===i.durationUnit&&i.duration<60*l||!je(i)&&"day"===i.durationUnit&&!je(i.duration)&&/^\d+\.\d+$/.test(i.duration.toString())?("Day"===r?(w=0<this.parent.weekWorkingTime.length?(b=this.parent.getStartTime(n),this.parent.getEndTime(o)):(b=this.parent.defaultStartTime,this.parent.defaultEndTime),(Math.floor(h/36e5%24)>=l||0==h)&&(s=!0),this.getSecondsInDecimal(n)===b&&s&&n.setHours(0,0,0,0),this.getSecondsInDecimal(o)===w&&s&&o.setHours(24),this.getSecondsInDecimal(o)===b&&o.setHours(0,0,0,0)):s=!0,n.getTime()===o.getTime()?this.parent.perDayWidth:s?!(this.parent.taskFields.duration&&"day"===i.durationUnit&&/^\d+\.\d+$/.test(i.duration.toString())&&"Day"===this.parent.timelineModule.bottomTier&&je(i.segments))||(e=this.parent.holidays&&0<this.parent.holidays.length?this.getHolidaysCount(n,o):0,a=this.parent.includeWeekend?0:this.getWeekendCount(n,o),this.hasDSTTransition(n.getFullYear()))?this.getTimeDifference(n,o,!0)/864e5*this.parent.perDayWidth:(e+a+i.duration)*this.parent.perDayWidth:(h=!1,s=n,e=o,a=i.duration,C=l,s=new Date(s),e=new Date(e),h=!(isNaN(s.getTime())||isNaN(e.getTime())||a<=0||C<=0)&&(s=new Date(s),a=a*C,S=Math.floor(a/C),a=a%C,s.setDate(s.getDate()+S),s.setHours(s.getHours()+a),s.getTime()!==e.getTime())&&1<Math.abs((s.getTime()-e.getTime())/864e5),"day"===i.durationUnit&&i.duration<1&&!h?i.duration*this.parent.perDayWidth:this.hasDSTTransition(n.getFullYear())||-180===n.getTimezoneOffset()?this.getTimeDifference(n,o,!0)/864e5*this.parent.perDayWidth:this.getTimeDifference(n,o)/(36e5*l)*this.parent.perDayWidth)):("Day"===r&&(w=0<this.parent.weekWorkingTime.length?(b=this.parent.getStartTime(n),this.parent.getEndTime(o)):(b=this.parent.defaultStartTime,this.parent.defaultEndTime),this.getSecondsInDecimal(n)===b&&n.setHours(0,0,0,0),this.getSecondsInDecimal(o)===w&&(o.setHours(24),o.setHours(0,0,0,0)),this.getSecondsInDecimal(o)===b)&&o.setHours(0,0,0,0),n.getTime()===o.getTime()?this.parent.perDayWidth:this.hasDSTTransition(n.getFullYear())?(hqt(o)-hqt(n))/6e4*(this.parent.perDayWidth/24)/60:this.getTimeDifference(n,o)/864e5*this.parent.perDayWidth)},Aqt.prototype.getDSTTransitions=function(e,t){function i(e,t){var i=new Date(Date.UTC(e,t+1,0));return new Date(Date.UTC(e,t,i.getUTCDate()-i.getUTCDay()))}function n(e,t){var t=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(e).match(/\d+/g).map(Number),e=t[0],i=t[1],n=t[2],o=t[3],r=t[4],t=t[5];return new Date(n,e-1,i,o,r,t)}var o=i(e,2),e=i(e,9);return{dstStart:n(o,t),dstEnd:n(e,t)}},Aqt.prototype.hasDSTTransition=function(e){for(var t=0,i=11,n=new Date(e,t,1).getTimezoneOffset();t<=i;){var o=Math.floor((t+i)/2),r=new Date(e,o,1).getTimezoneOffset();if(r!==n)return!0;n<r?i=o-1:t=o+1}return!1},Aqt.prototype.getTaskLeft=function(e,t,i){var n,o,r=!1,s=new Date(e.getTime()),a=("Day"===("None"!==this.parent.timelineModule.customTimelineSettings.bottomTier.unit?this.parent.timelineModule.customTimelineSettings.bottomTier:this.parent.timelineModule.customTimelineSettings.topTier).unit&&(o=a=void 0,o=0<this.parent.weekWorkingTime.length?(a=this.parent.getStartTime(s),this.parent.getEndTime(s)):(a=this.parent.defaultStartTime,this.parent.defaultEndTime),this.getSecondsInDecimal(s)===a?s.setHours(0,0,0,0):t&&this.getSecondsInDecimal(s)===o?(s.setHours(24),r=!0):this.getSecondsInDecimal(s)===o&&this.parent.allowUnscheduledTasks&&(s.setHours(22),r=!0)),je(n=this.parent.enableTimelineVirtualization&&(this.parent.isLoad||i)&&!this.parent.timelineModule.performedTimeSpanAction?this.parent.enableTimelineVirtualization&&0!==this.parent.ganttChartModule.scrollObject.element.scrollLeft?this.parent.ganttChartModule.scrollObject.getTimelineLeft():null:n)?new Date(this.parent.timelineModule.timelineStartDate):new Date(this.parent.timelineModule.dateByLeftValue(n).toString()));return a?(t=void 0,this.hasDSTTransition(e.getFullYear()),this.hasDSTTransition(s.getFullYear())?(hqt(s)-hqt(a))/6e4*(this.parent.perDayWidth/24)/60:(o=void 0,"Day"!==this.parent.timelineModule.bottomTier||this.getSecondsInDecimal(s)===this.parent.defaultStartTime||0===this.getSecondsInDecimal(s)||r||this.parent.isFromEventMarker?t=(s.getTime()-a.getTime())/864e5*this.parent.perDayWidth:(i=new Date(e.getTime()),n=new Date(i.setHours(0,0,0,0)),o=this.getDuration(n,e,"day",!0,!1)*this.parent.perDayWidth,s.setHours(0,0,0,0),t=(s.getTime()-a.getTime())/864e5*this.parent.perDayWidth,this.getSecondsInDecimal(e)!==this.parent.defaultStartTime&&"Day"===this.parent.timelineModule.bottomTier&&(t+=o)),t)):0},Aqt.prototype.getSplitTaskWidth=function(e,t,i){var n,e=new Date(e.getTime()),t=new Date(this.getEndDate(e,t,i.ganttProperties.durationUnit,i.ganttProperties,!1).getTime());return"Day"===("None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier)&&(n=i=void 0,n=0<this.parent.weekWorkingTime.length?(i=this.parent.getStartTime(e),this.parent.getEndTime(t)):(i=this.parent.defaultStartTime,this.parent.defaultEndTime),this.getSecondsInDecimal(e)===i&&e.setHours(0,0,0,0),this.getSecondsInDecimal(t)===n&&t.setHours(24),this.getSecondsInDecimal(t)===i)&&t.setHours(0,0,0,0),this.getTimeDifference(e,t)/864e5*this.parent.perDayWidth},Aqt.prototype.getSplitTaskLeft=function(e,t){var i,n,e=new Date(e.getTime());return"Day"===("None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier)&&(n=i=void 0,n=0<this.parent.weekWorkingTime.length?(i=this.parent.getStartTime(e),this.parent.getStartTime(t)):i=this.parent.defaultStartTime,this.getSecondsInDecimal(e)===i&&e.setHours(0,0,0,0),this.getSecondsInDecimal(t)===n)&&t.setHours(0,0,0,0),t?(e.getTime()-t.getTime())/864e5*this.parent.perDayWidth:0},Aqt.prototype.updateMappingData=function(e,t){var i=this.parent.columnMapping,n=e.ganttProperties;if((!je(i[t])||"taskType"===t||"segments"===t)&&"predecessorName"!==t)if("resourceInfo"===t){var o=n.resourceInfo,r=this.parent.resourceFields,s=[],a=[];if(!je(o))for(var l=0;l<o.length;l++){s.push(o[l][r.id]);var h=o[l][r.name],d=o[l][r.unit];100!==d&&(h+="["+d+"%]"),h&&a.push(h)}this.parent.setRecordValue("resourceNames",a.join(","),n,!0),this.isResourceString&&e.taskData[this.parent.taskFields.resourceInfo]&&e.taskData[this.parent.taskFields.resourceInfo][0]&&(e.taskData[this.parent.taskFields.resourceInfo]=e.taskData[this.parent.taskFields.resourceInfo][0][r.name]),this.updateTaskDataResource(e),this.parent.setRecordValue(i[t],a.join(","),e)}else"startDate"===t||"endDate"===t?this.setRecordDate(e,n[t],i[t]):"duration"===t?this.setRecordDuration(e,i[t]):"work"===t?(this.parent.setRecordValue("taskData."+i[t],n.work,e),this.parent.setRecordValue(i[t],n[t],e)):"type"===t?(this.parent.setRecordValue("taskData."+i[t],n.taskType,e),this.parent.setRecordValue(i[t],n.taskType,e)):"manual"===t?(this.parent.setRecordValue("taskData."+i[t],!n.isAutoSchedule,e),this.parent.setRecordValue(i[t],!n.isAutoSchedule,e)):"segments"===t?this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,this.segmentTaskData(e),e):(this.parent.setRecordValue("taskData."+i[t],n[t],e),this.parent.setRecordValue(i[t],n[t],e))},Aqt.prototype.segmentTaskData=function(e){var i=this,t=e.ganttProperties.segments,n=this.parent.taskFields;if(je(t))return null;for(var o=Pe([],[],e.taskData[n.segments],!0),r=0;r<t.length;r++)(this.parent.isEdit||this.parent.editModule&&this.parent.editModule.dialogModule&&R("isEdit",this.parent.editModule.dialogModule)||this.parent.contextMenuModule&&R("isEdit",this.parent.contextMenuModule))&&(o[r]={}),je(n.startDate)||(o[r][this.parent.taskFields.startDate]=t[r].startDate),je(n.endDate)||(o[r][this.parent.taskFields.endDate]=t[r].endDate),je(n.duration)||(o[r][this.parent.taskFields.duration]=Number(t[r].duration));return 0<this.customSegmentProperties.length&&o&&0<o.length&&o.forEach(function(e,t){e=Object.assign({},e,i.customSegmentProperties[t]);o[t]=e}),o},Aqt.prototype.updateTaskDataResource=function(e){var i=e.ganttProperties.resourceInfo,n=e.taskData[this.parent.taskFields.resourceInfo],o=this.parent.resourceFields;if(je(n))e.taskData[this.parent.taskFields.resourceInfo]=i;else if(i&&i.length){for(var t=0;t<i.length;t++){var r=!1;if("string"==typeof n){if(n===i[t][o.name]){n=i[t][o.name],r=!0;break}}else for(var s=0;s<n.length;s++)if("number"==typeof n[s]||"string"==typeof n[s]){if(parseInt(n[s],10)===parseInt(i[t][o.id],10)){n[s]=i[t],r=!0;break}}else if(n[s][o.id]===i[t][o.id]&&"number"!=typeof n[s]){n[s]=Pe({},n[s],i[t],!0),r=!0;break}r||("string"==typeof n?n=i[t][o.name]:n.push(i[t]))}var a=[];if(!je(n))if("string"!=typeof n){for(var l=0;l<n.length;l++)!function(t){i.filter(function(e){e[o.id]===n[t][o.id]&&-1===a.indexOf(n[t])&&a.push(n[t])})}(l);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,a,e)}else this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,n,e)}else this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e)},Aqt.prototype.setRecordDate=function(e,t,i){var n="string"==typeof t?new Date(t):t;je(t)||(t=new Date(n.getTime())),this.parent.setRecordValue(i,t,e),je(t)||(t=new Date(n.getTime())),this.parent.isLoad||this.parent.isDynamicData||this.parent.setRecordValue("taskData."+i,t,e),this.parent.isDynamicData=!1},Aqt.prototype.getDurationInDay=function(e,t){return"day"===t?e:"hour"===t?e/(this.parent.secondsPerDay/3600):e/(this.parent.secondsPerDay/60)},Aqt.prototype.setRecordDuration=function(e,t){var i,n=e.ganttProperties.duration,o=e.ganttProperties.durationUnit;je(n)?(this.parent.setRecordValue(t,n,e),this.parent.setRecordValue("taskData."+t,n,e)):(this.parent.setRecordValue(t,e.ganttProperties.duration,e),i=R(t,e.taskData),isNaN(i)&&je(this.parent.taskFields.durationUnit)&&!je(i)?this.parent.setRecordValue("taskData."+t,this.getDurationString(n,o),e):"string"==typeof i?this.parent.setRecordValue("taskData."+t,n.toString(),e):this.parent.setRecordValue("taskData."+t,n,e)),this.parent.taskFields.durationUnit&&(e.taskData[this.parent.taskFields.durationUnit]=e.ganttProperties.durationUnit)},Aqt.prototype.setDataSource=function(e){for(var t,i=[],n=(t=Array.isArray(e)?e:t).length,o=0;o<n;o++){var r=e[o];i.push(r),je(e[o][this.parent.taskFields.child])||this.setDataSource(e[o][this.parent.taskFields.child])}return i},Aqt.prototype.setStartDate=function(t){var i=this;(je(this.parent.taskFields.parentID)||je(this.parent.taskFields.id)?this.parent.dataSource:this.setDataSource(this.parent.dataSource)).map(function(e){t.ganttProperties.taskId===e[i.parent.taskFields.id]&&(je(i.parent.taskFields.startDate)||(t[i.parent.taskFields.startDate]=e[i.parent.taskFields.startDate]),je(i.parent.taskFields.endDate)||(t[i.parent.taskFields.endDate]=e[i.parent.taskFields.endDate]))})},Aqt.prototype.getWorkInHour=function(e,t){return"day"===t?e*(this.parent.secondsPerDay/3600):"minute"===t?e/60:e},Aqt.prototype.updateTaskData=function(e){var t,i=this.parent.taskFields,n=e.ganttProperties;je(e.taskData)||(t=e.taskData,i.id&&(this.parent.setRecordValue("taskData."+i.id,n.taskId,e),this.parent.setRecordValue(i.id,n.taskId,e)),i.name&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.name,n.taskName,e),this.parent.setRecordValue(i.name,n.taskName,e)),i.startDate&&this.setRecordDate(e,n.startDate,i.startDate),i.endDate&&this.setRecordDate(e,n.endDate,i.endDate),i.duration&&(je(i.milestone)||!je(i.milestone)&&!e.taskData[i.milestone])&&this.setRecordDuration(e,i.duration),i.durationUnit&&(t[i.durationUnit]=n.durationUnit),i.progress&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.progress,n.progress,e),this.parent.setRecordValue(i.progress,n.progress,e)),i.baselineStartDate&&this.setRecordDate(e,n.baselineStartDate,i.baselineStartDate),i.baselineEndDate&&this.setRecordDate(e,n.baselineEndDate,i.baselineEndDate),i.notes&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.notes,n.notes,e),this.parent.setRecordValue(i.notes,n.notes,e)),i.cssClass&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.cssClass,n.cssClass,e),this.parent.setRecordValue(i.cssClass,n.cssClass,e)),i.indicators&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.indicators,n.indicators,e),this.parent.setRecordValue(i.indicators,n.indicators,e)),i.parentID&&(t="ProjectView"===this.parent.viewType?n.parentId:t[i.parentID],this.parent.setRecordValue("taskData."+i.parentID,t,e),this.parent.setRecordValue(i.parentID,n.parentId,e)),i.work&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.work,n.work,e),this.parent.setRecordValue(i.work,n.work,e)),i.type&&(this.parent.setRecordValue("taskData."+i.type,n.taskType,e),this.parent.setRecordValue(i.type,n.taskType,e)))},Aqt.prototype.setResourceInfo=function(e){var t=this;if(je(e[this.parent.taskFields.resourceInfo]))return i;var i=(!this.parent.isLoad&&e.taskData&&this.parent.taskFields.resourceInfo in e.taskData?e.taskData:e)[this.parent.taskFields.resourceInfo],n=je(this.parent.editModule)||je(this.parent.editModule.dialogModule)||!this.parent.editModule.dialogModule.isAddNewResource?this.parent.resources:this.parent.editModule.dialogModule.ganttResources,o=this.parent.resourceFields.id,r=this.parent.resourceFields.unit,s=this.parent.resourceFields.group,a=[];if("string"==typeof i&&""!==i){var l=[],h=e[this.parent.taskFields.resourceInfo].split(",");h&&(n.forEach(function(e){h.includes(e[t.parent.resourceFields.name])&&l.push(e)}),e=Pe({},l[0]),a.push(e),je(r)||je(i[r])||(e[r]=i[r]),je(s)||je(i[s])||(e[s]=i[s]))}else for(var d=0;d<i.length;d++)!function(t){var e=Pe({},n.filter(function(e){return"object"==typeof i[t]&&i[t][o]===e[o]||i[t]===e[o]})[0]);a.push(e),je(r)||je(i[t][r])||(e[r]=i[t][r]),je(s)||je(i[t][s])||(e[s]=i[t][s])}(d);return this.updateResourceUnit(a),a},Aqt.prototype.updateResourceUnit=function(e){var t=this.parent.resourceFields.unit;if(!je(t))for(var i=e.length,n=void 0,n=0;n<i;n++)je(e[n][t])&&(e[n][t]=100)},Aqt.prototype.updateResourceName=function(e){var t=e.ganttProperties.resourceInfo,i=[],n=this.parent.taskFields;if(t&&0<t.length){var o=t.length;if("string"==typeof e.taskData[this.parent.taskFields.resourceInfo]){var r=s=e.taskData[this.parent.taskFields.resourceInfo];this.parent.setRecordValue("resourceNames",r,e.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.resourceInfo,r,e,!0)}else{var s=Pe([],[],e.taskData[this.parent.taskFields.resourceInfo],!0);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e);for(var a=0;a<o;a++){var l=t[a],h=l[this.parent.resourceFields.name],d=l[this.parent.resourceFields.unit];100!==d&&(h+="["+d+"%]"),je(h)||i.push(h),e.taskData&&(d=n.resourceInfo,s[a]&&(s[parseInt(a.toString(),10)],1)?e.taskData[d].push(s[a]):e.taskData[d].push(l[this.parent.resourceFields.id]))}this.parent.setRecordValue("resourceNames",i.join(","),e.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.resourceInfo,i.join(","),e,!0)}this.updateTaskDataResource(e)}},Aqt.prototype.dataReorder=function(e,t){for(var i=[];0<e.length&&0<t.length;){var n=t.indexOf(e[0]);-1===n?e.shift():(i.push(e.shift()),t.splice(n,1))}return i},Aqt.prototype.validateDurationUnitMapping=function(e){return e="minute"===e||"minutes"===e||"m"===e||"min"===e?"minute":"hour"===e||"hours"===e||"h"===e||"hr"===e?"hour":"day"===e||"days"===e||"d"===e?"day":this.parent.durationUnit.toLocaleLowerCase()},Aqt.prototype.validateTaskTypeMapping=function(e){return e="FixedDuration"===e?"FixedDuration":"FixedUnit"===e?"FixedUnit":"FixedWork"===e?"FixedWork":this.parent.taskType},Aqt.prototype.validateWorkUnitMapping=function(e){return e="minute"===e?"minute":"hour"===e?"hour":"day"===e?"day":this.parent.workUnit.toLocaleLowerCase()},Aqt.prototype.updateDurationValue=function(e,t){e=this.getDurationValue(e);isNaN(R("duration",e))||this.parent.setRecordValue("duration",R("duration",e),t,!0),je(R("durationUnit",e))||this.parent.setRecordValue("durationUnit",R("durationUnit",e),t,!0)},Aqt.prototype.reUpdateGanttData=function(){if(0<this.parent.flatData.length){var e,t;this.parent.secondsPerDay=this.getSecondsPerDay();for(var i=0;i<this.parent.flatData.length;i++)e=this.parent.flatData[i].taskData,t=this.parent.flatData[i],je(this.parent.taskFields.duration)||this.setRecordDuration(t,this.parent.taskFields.duration),this.parent.isLoad&&this.setStartDate(t),this.calculateScheduledValues(t,e,!1);this.updateGanttData()}},Aqt.prototype._isInStartDateRange=function(e,t,i){var n=!1;return n=e.getTime()>=t.getTime()&&e.getTime()<i.getTime()?!0:n},Aqt.prototype._isInEndDateRange=function(e,t,i){var n=!1;return n=e.getTime()>t.getTime()&&e.getTime()<=i.getTime()?!0:n},Aqt.prototype.updateOverlappingValues=function(e){var t,a=this,l=e.childRecords,i=[];if(l.length<=1)e.ganttProperties.workTimelineRanges=[];else{l=this.setSortedChildTasks(e),this.updateOverlappingIndex(l);for(var n=this,o=1;o<l.length;o++)!function(r){var e=((t=l[r]).ganttProperties.segments||[{startDate:t.ganttProperties.startDate,endDate:t.ganttProperties.endDate}]).map(function(e){var t=e.startDate,e=e.endDate;return{startDate:new Date(t),endDate:new Date(e)}}),s=[];e.forEach(function(e){for(var n=new Date(e.startDate.getTime()),o=new Date(e.endDate.getTime()),t=0;t<r;t++){var i=l[t];(i.ganttProperties.segments||[{startDate:i.ganttProperties.startDate,endDate:i.ganttProperties.endDate}]).map(function(e){var t=e.startDate,e=e.endDate;return{startDate:new Date(t),endDate:new Date(e)}}).forEach(function(e){var t=e.startDate,e=e.endDate,i={};n&&o&&e&&(a._isInStartDateRange(n,t,e)||a._isInEndDateRange(o,t,e)||t.getTime()>=n.getTime()&&e.getTime()<=o.getTime())&&(t.getTime()>n.getTime()&&t.getTime()<o.getTime()&&e.getTime()>n.getTime()&&e.getTime()>=o.getTime()||n.getTime()===t.getTime()&&o.getTime()<=e.getTime()?(i.from=t,i.to=o):n.getTime()===t.getTime()&&o.getTime()>e.getTime()?(i.from=t,i.to=e):n.getTime()>t.getTime()&&o.getTime()>=e.getTime()?(i.from=n,i.to=e):n.getTime()>t.getTime()&&o.getTime()<e.getTime()?(i.from=n,i.to=o):t.getTime()>=n.getTime()&&e.getTime()<=o.getTime()&&(i.from=t,i.to=e),i.from)&&i.to&&s.push(i)})}}),i.push.apply(i,n.mergeRangeCollections(s))}(o);this.parent.setRecordValue("workTimelineRanges",this.mergeRangeCollections(i,!0),e.ganttProperties,!0),this.calculateRangeLeftWidth(e.ganttProperties.workTimelineRanges)}},Aqt.prototype.updateOverlappingIndex=function(e){for(var t=0;t<e.length;t++)e[t].ganttProperties.eOverlapIndex=t},Aqt.prototype.calculateRangeLeftWidth=function(e){for(var t=0;t<e.length;t++)e[t].left=this.getTaskLeft(e[t].from,!1),e[t].width=this.getTaskWidth(e[t].from,e[t].to)},Aqt.prototype.mergeRangeCollections=function(e,t){for(var i,n,o,r,s=[],a={},l=new me(e).executeLocal((new ya).sortBy(this.parent.taskFields.startDate,"Ascending")),h=0;h<l.length;h++)0===s.length&&0===h?s.push(l[h]):(i=(a=s[s.length-1]).from,n=a.to,o=(r=l[h]).from,r=r.to,i.getTime()===o.getTime()&&n.getTime()>=r.getTime()||i.getTime()<o.getTime()&&n.getTime()>=r.getTime()||(i.getTime()<=o.getTime()&&n.getTime()>=o.getTime()&&n.getTime()<r.getTime()||n.getTime()<o.getTime()&&this.checkStartDate(n).getTime()===o.getTime()?a.to=r:n.getTime()<o.getTime()&&this.checkStartDate(n).getTime()!==o.getTime()&&s.push(l[h])));return s=t?this.splitRangeCollection(s):s},Aqt.prototype.setSortedChildTasks=function(e){return new me(e.childRecords).executeLocal((new ya).sortBy(this.parent.taskFields.startDate,"Ascending"))},Aqt.prototype.splitRangeCollection=function(e,t,i){var n=!this.parent.timelineModule.isSingleTier||"None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier;return"Week"===n||"Month"===n||"Year"===n?e:"Day"===n||0===this.parent.workingTimeRanges[0].from&&86400===this.parent.workingTimeRanges[0].to?this.getRangeWithWeek(e,t,i):this.getRangeWithDay(e,t,i)},Aqt.prototype.getRangeWithDay=function(e,t,i){for(var n=[],o=0;o<e.length;o++)n.push.apply(n,this.splitRangeForDayMode(e[parseInt(o.toString(),10)],t,i));return n},Aqt.prototype.splitRangeForDayMode=function(e,t,i){var n=t||"from",o=i||"to",r=new Date(e[n]),s=new Date(e[o]),a=[],l={};if(r.getTime()<s.getTime())do{for(var h,d=new Date(r.getTime()),p=new Date(r.getTime()),c=this.parent.dataOperation.getSecondsInDecimal(r),u=-1,g=0;g<this.parent.workingTimeRanges.length;g++){var m=this.parent.workingTimeRanges[g];if(c>=m.from&&c<=m.to){u=g;break}}-1!==u&&(h=Math.round(this.parent.workingTimeRanges[u].to-c),p.setSeconds(p.getSeconds()+h))}while(p.getTime()<s.getTime()?(l={},e.task&&(l.task=Pe([],e.task)),l[n]=d,l[o]=p):(l={},e.task&&(l.task=Pe([],e.task)),l[n]=d,l[o]=s),l.isSplit=!0,a.push(l),(r=this.checkStartDate(p)).getTime()<s.getTime());else a.push(e);return a},Aqt.prototype.getRangeWithWeek=function(e,t,i){for(var n=[],o=0;o<e.length;o++)n.push.apply(n,this.splitRangeForWeekMode(e[o],t,i));return n},Aqt.prototype.splitRangeForWeekMode=function(e,t,i){var n,o,r,s,a=t||"from",l=i||"to",h=new Date(e[a]),d=new Date(e[a]),p=new Date(e[l]),c=!1,u=[],g={};if(d.setDate(d.getDate()+1),d.getTime()<p.getTime()){do{}while(this.parent.dataOperation.isOnHolidayOrWeekEnd(d,null)?(o=void(n=new Date(d.getTime())).setDate(d.getDate()-1),o=0<this.parent.weekWorkingTime.length?this.parent.getEndTime(n):this.parent.defaultEndTime,this.setTime(o,n),(g={})[a]=h,g.isSplit=!0,g[l]=new Date(n),e.task&&(g.task=Pe([],e.task,!0)),o=!this.parent.dataOperation.isOnHolidayOrWeekEnd(h,null),r=!this.parent.dataOperation.isOnHolidayOrWeekEnd(n,null),s=h.getTime()!==n.getTime(),o&&r&&s&&u.push(g),n.setDate(n.getDate()+1),h=this.checkStartDate(n),d=new Date(h.getTime()),c=!0):d.setDate(d.getDate()+1),d.getTime()<p.getTime());c?h.getTime()!==p.getTime()&&(g={},e.task&&(g.task=Pe([],e.task,!0)),g[a]=h,g[l]=p,g.isSplit=!0,u.push(g)):u.push(e)}else u.push(e);return u},Aqt.prototype.updateGanttData=function(){this.systemTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone;var e=this.parent.flatData;if(e.length){for(var t=new Map,i=0,n=e;i<n.length;i++){var o=n[i];t.set(o.uniqueID,o)}for(var r=0,s=e.length;r<s;r++)this.updateTaskLeftWidth(e[r],t)}},Aqt.prototype.shouldProcessUpdateWidth=function(){return!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&Boolean(this.parent.taskFields.hasChildMapping)},Aqt.prototype.updateTaskLeftWidth=function(e,t){void 0===t&&(t=null);var i=e.ganttProperties,i=(e.hasChildRecords&&!this.shouldProcessUpdateWidth()||this.updateWidthLeft(e),this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(i),i,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(i),i,!0),e.parentItem?null!=t?t.get(e.parentItem.uniqueID):this.parent.getParentTask(e.parentItem):null),t=i&&i.childRecords.slice(-1)[0]===e;i&&(t&&!e.hasChildRecords&&this.parent.enableValidation?((!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)&&"ResourceView"!==this.parent.viewType||this.updateParentItems(i),this.shouldProcessUpdateWidth()&&this.updateWidthLeft(i)):i&&!this.parent.enableValidation&&this.updateWidthLeft(i))},Aqt.prototype.reUpdateGanttDataPosition=function(){for(var e=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.parent.flatData,t=e.length,i=0;i<t;i++){var n=e[i],o=n.ganttProperties;this.updateWidthLeft(n),"Auto"!==this.parent.taskMode&&n.hasChildRecords&&this.updateAutoWidthLeft(n),this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(o),o,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(o),o,!0),this.parent.dataOperation.updateTaskData(n)}},Aqt.prototype.updateWidthLeft=function(e){var t=e.ganttProperties,i=0,n=0;if(!je(t.segments)&&0<t.segments.length){for(var o=t.segments,r=0;r<o.length;r++){var s,a=o[r];0!==r||je(t.startDate)||je(a.startDate)||je(a.startDate.getTime())||a.startDate.getTime()===t.startDate.getTime()||(a.startDate=t.startDate,s=this.parent.dataOperation.getEndDate(a.startDate,a.duration,t.durationUnit,t,!1),a.endDate=this.parent.dataOperation.checkEndDate(s,t,!1),this.parent.chartRowsModule.incrementSegments(o,0,e)),a.width=this.getSplitTaskWidth(a.startDate,a.duration,e),i+=a.width,a.showProgress=!1,a.progressWidth=-1,0!==r&&(s=new Date(t.startDate.getTime()),a.left=this.getSplitTaskLeft(a.startDate,s))}for(var l=this.parent.dataOperation.getProgressWidth(i,t.progress),h=!0,r=0;r<o.length;r++)h&&(l<=o[r].width?(o[r].progressWidth=l,h=!(o[r].showProgress=!0)):(o[r].progressWidth=o[r].width,l-=o[r].progressWidth),o[r].showProgress)&&(n=n+o[r].left+o[r].progressWidth);this.parent.setRecordValue("segments",t.segments,t,!0),this.parent.dataOperation.updateMappingData(e,"segments")}this.parent.setRecordValue("width",this.parent.dataOperation.calculateWidth(e),t,!0),this.parent.setRecordValue("left",this.parent.dataOperation.calculateLeft(t,e),t,!0),!je(t.segments)&&0<t.segments.length?this.parent.setRecordValue("progressWidth",n,t,!0):this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.isAutoSchedule||!e.hasChildRecords?t.width:t.autoWidth,t.progress),t,!0)},Aqt.prototype.updateAutoWidthLeft=function(e){var t=e.ganttProperties;this.parent.setRecordValue("autoWidth",this.calculateWidth(e,!0),t,!0),this.parent.setRecordValue("autoLeft",this.calculateLeft(t,e,!0),t,!0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.isAutoSchedule||!e.hasChildRecords?t.width:t.autoWidth,t.progress),t,!0)},Aqt.prototype.getParentProgress=function(e){var t=0,i={},n=0<this.parent.weekWorkingTime.length?this.parent.getSecondsPerDay(e.ganttProperties.startDate||e.ganttProperties.endDate):this.parent.secondsPerDay;switch(e.ganttProperties.durationUnit){case"hour":t=e.ganttProperties.duration/(n/3600);break;case"minute":t=e.ganttProperties.duration/(n/60);break;default:t=e.ganttProperties.duration}return e.hasChildRecords?(x("totalProgress",e.ganttProperties.totalProgress,i),x("totalDuration",e.ganttProperties.totalDuration||0,i)):(x("totalProgress",e.ganttProperties.progress*t,i),x("totalDuration",t,i)),i},Aqt.prototype.resetDependency=function(e){var t,i=this.parent.taskFields.dependency;je(i)||(t=e.ganttProperties,this.parent.setRecordValue("predecessor",[],t,!0),this.parent.setRecordValue("predecessorsName",null,t,!0),this.parent.setRecordValue("taskData."+i,null,e),this.parent.setRecordValue(i,null,e))},Aqt.prototype.isUnscheduledTask=function(e,t){for(var i=0,n=null,o=0,r=["startDate","endDate","duration"];o<r.length;o++){var s=r[o];e&&e[s]&&(i++,n=s)}return 1===i||0===i&&!je(t)&&t.hasChildRecords?[!0,n]:[!1,null]},Aqt.prototype.isFromManual=function(e){return!!(this.parent.allowUnscheduledTasks&&this.parent.editModule&&this.parent.oldRecords&&0<this.parent.oldRecords.length&&je(e.ganttProperties.startDate)&&je(e.ganttProperties.endDate)&&!je(e.ganttProperties.duration)&&!e.hasChildRecords&&e.parentItem&&("Manual"===this.parent.taskMode||"Custom"===this.parent.taskMode&&e[this.parent.taskFields.manual]))},Aqt.prototype.updateParentItems=function(e,t){var a=this,l=t?e:this.parent.getParentTask(e),h=!1,d=je(l=l||e)?null:l.ganttProperties,t=this.isUnscheduledTask(d,l),p=t[0];t[1];if(this.parent.autoCalculateDateScheduling&&!(this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)||"ResourceView"===this.parent.viewType){if(l&&l.childRecords&&0<l.childRecords.length){for(var c,i,n,o,e=d.isAutoSchedule?d.startDate:d.autoStartDate,t=d.isAutoSchedule?d.endDate:d.autoEndDate,u=l.childRecords,g=u.length,m=0,f=null,y=null,v=0,b=0,w=0,r=0,s=0,C=(u.some(function(e){var e=a.isUnscheduledTask(e.ganttProperties),t=e[0],e=e[1];return t&&"duration"===e?++s:t||++r,0<r&&0<s}),0<r&&0<s||void 0),S=this,A=0;A<g;A++)!function(t){if(c=S.parent.loadChildOnDemand&&S.parent.taskFields.hasChildMapping?S.parent.currentViewData.filter(function(e){return e.ganttProperties.taskId===u[t][a.parent.taskFields.id]})[0]:u[t],S.parent.isOnDelete&&c.isDelete)return 1===g&&"ProjectView"===S.parent.viewType&&(h=!0);var e=void 0,i=void 0,n=S.isUnscheduledTask(c.ganttProperties),o=n[0],n=n[1],r=void 0,s=(r=S.isFromManual(c)&&(s=S.parent.oldRecords.filter(function(e){return e.ganttProperties.uniqueID===c.ganttProperties.uniqueID})[0])?S.parent.getParentTask(s.parentItem):r)||c,r=r?r.ganttProperties:d,e=o&&"startDate"!==n&&"endDate"!==n&&!p?d.startDate:S.getValidStartDate(s.ganttProperties),n=(!l.hasChildRecords||r.isAutoSchedule||je(s.ganttProperties.autoStartDate)||(e=s.ganttProperties.autoStartDate),i=o&&"startDate"!==n&&"endDate"!==n&&!p?S.getEndDate(d.startDate,s.ganttProperties.duration,s.ganttProperties.durationUnit,s.ganttProperties,!1):S.getValidEndDate(s.ganttProperties),!l.hasChildRecords||r.isAutoSchedule||je(s.ganttProperties.autoEndDate)||(i=s.ganttProperties.autoEndDate),o&&"startDate"!==n&&"endDate"!==n&&(r=S.getDateFromFormat(i),s=S.getDateFromFormat(e),y<r&&(y=r),s<f)&&(f=s),C&&!o||je(C)),s=(je(f)&&n&&(f=S.getDateFromFormat(e)),je(y)&&n&&(y=S.getDateFromFormat(i)),!je(i)&&y&&1===S.compareDates(i,y)&&(y=S.getDateFromFormat(i)),!je(e)&&f&&-1===S.compareDates(e,f)&&(f=S.getDateFromFormat(e)),!c.ganttProperties.isMilestone&&rqt(c.ganttProperties)?(r=S.getParentProgress(c),b+=R("totalProgress",r),m+=R("totalDuration",r),c[S.parent.taskFields.duration]<1&&(m=Number(m.toFixed(4)))):v++,c.ganttProperties.work);"string"==typeof s?(o=parseFloat(s),isNaN(o)||(w+=o)):"number"==typeof s&&(w+=s)}(A);h||(i=0<(o=this.parent.isOnDelete&&c.isDelete?g-v-1:g-v)&&0<m?Number((b/m).toFixed(2)):0,n=l.ganttProperties,o=!(0!=o||!f||!y||f.getTime()!==y.getTime()),0!==this.compareDates(e,f)&&(this.parent.setRecordValue(d.isAutoSchedule?"startDate":"autoStartDate",f,l.ganttProperties,!0),je(d.autoDuration)?0===d.duration:0===d.autoDuration)&&l.isManual&&o&&l.hasChildRecords&&l.ganttProperties.isAutoSchedule&&"TaskbarEditing"!==this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action&&this.parent.setRecordValue("startDate",f,l.ganttProperties,!0),0!==this.compareDates(t,y)&&(this.parent.setRecordValue(d.isAutoSchedule?"endDate":"autoEndDate",y,l.ganttProperties,!0),je(d.autoDuration)?0===d.duration:0===d.autoDuration)&&l.isManual&&o&&l.hasChildRecords&&l.ganttProperties.isAutoSchedule&&"TaskbarEditing"!==this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action&&this.parent.setRecordValue("endDate",y,l.ganttProperties,!0),this.parent.setRecordValue("isMilestone",o,n,!0),je(this.parent.taskFields.milestone)||(this.updateMappingData(l,"milestone"),this.parent.setRecordValue(this.parent.taskFields.milestone,o,l,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.milestone,o,l,!0)),n.isAutoSchedule&&(this.isFromManual(c)?(1===l.childRecords.length&&(l.ganttProperties.duration=c.ganttProperties.duration),this.calculateEndDate(l)):this.calculateDuration(l)),this.updateWorkWithDuration(l),e=n.work,e=this.parent.isOnEdit?e:e+w,this.parent.setRecordValue("work",e,n,!0),this.parent.setRecordValue("taskType","FixedDuration",n,!0),je(this.parent.taskFields.type)||this.updateMappingData(l,"type"),this.parent.setRecordValue("progress",Math.floor(i),n,!0),this.parent.setRecordValue("totalProgress",b,n,!0),this.parent.setRecordValue("totalDuration",m,n,!0),this.parent.setRecordValue("autoDuration",n.duration,n,!0),n.isAutoSchedule||(this.parent.setRecordValue("autoDuration",this.calculateAutoDuration(n),n,!0),this.updateAutoWidthLeft(l)),this.parent.allowParentDependency||this.resetDependency(l),this.updateWidthLeft(l),this.updateTaskData(l))}}else this.parent.setRecordValue("endDate",l.taskData[this.parent.taskFields.endDate],l.ganttProperties,!0);h&&1===l.childRecords.length&&0===l.ganttProperties.duration&&(this.parent.setRecordValue("isMilestone",!0,l.ganttProperties,!0),this.updateWidthLeft(l),this.updateTaskData(l));t=je(l)?null:this.parent.getParentTask(l.parentItem);!t||(!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)&&"ResourceView"!==this.parent.viewType||this.updateParentItems(t),h=!1};var wqt,Cqt,Sqt=Aqt;function Aqt(e){e=Cqt.call(this,e)||this;return e.customSegmentProperties=[],e.isBaseline=!1,e.isDurationValueUpdated=!1,e.uid=0,e.recordIndex=0,e.taskIds=[],e.hierarchyData=[],e.addEventListener(),e}var xqt="e-gantt-single-timeline",Iqt="e-chart-root-container",Tqt="e-chart-rows-container",Eqt="e-grid",Dqt="e-timeline-header-container",Mqt="e-timeline-header-table-container",kqt="e-timeline-header-table-body",Pqt="e-left-label-container",Bqt="e-left-label-inner-div",Fqt="e-right-label-container",Lqt="e-right-label-inner-div",Rqt="e-taskbar-main-container",Oqt="e-task-label",Nqt="e-gantt-child-taskbar-inner-div",Vqt="e-gantt-child-progressbar-inner-div",_qt="e-gantt-child-critical-taskbar-inner-div",Hqt="e-gantt-child-critical-progressbar-inner-div",zqt="e-critical-milestone",jqt="e-baseline-bar",Wqt="e-baseline-gantt-milestone-container",Qqt="e-chart-row-cell",Uqt="e-chart-row",qqt="e-taskbar-left-resizer",Gqt="e-taskbar-right-resizer",Yqt="e-child-progress-resizer",Xqt="e-progressbar-handler",Kqt="e-progressbar-handler-element",Jqt="e-progressbar-handler-after",Zqt="e-icon",$qt="e-gantt-milestone",eGt="e-gantt-child-taskbar",tGt="e-gantt-child-progressbar",iGt="e-manualparent-main-container",nGt="e-gantt-manualparenttaskbar",oGt="e-gantt-manualparent-milestone",rGt="e-gantt-child-manualtaskbar",sGt="e-gantt-manualparenttaskbar-right",aGt="e-gantt-parent-taskbar",lGt="e-gantt-parent-progressbar",hGt="e-gantt-unscheduled-task",dGt="e-left-resize-gripper",pGt="e-right-resize-gripper",cGt="e-progress-resize-gripper",uGt="e-label",gGt="e-template-padding",mGt="e-gantt-unscheduled-taskbar-left",fGt="e-gantt-unscheduled-taskbar-right",yGt="e-connector-line-container",vGt="e-connector-line",bGt="e-critical-line",wGt="e-critical-line-arrow",CGt="e-connector-line-arrow",SGt="e-connector-line-z-index",AGt="e-connectorpoint-left",xGt="e-connectorpoint-right",IGt="e-connectorpoint-left-hover",TGt="e-connectorpoint-right-hover",EGt="e-right-connectorpoint-outer-div",DGt="e-connectorpoint-allow-block",MGt="e-gantt-tooltip",kGt=".e-content",PGt=".e-gridform",BGt="e-edit",FGt="e-active-parent-task",LGt="e-active-child-task",RGt="e-active-connected-task",OGt="e-predecessor-touch-mode",NGt="e-rangecontainer",VGt="e-rg-rangdiv",_Gt=(HGt.prototype.addEventListeners=function(){this.parent.on("grid-scroll",this.gridScrollHandler,this),E.add(this.element,"scroll",this.onScroll,this),this.parent.treeGrid.grid.on("showGanttShimmer",this.updateShimmer,this),this.parent.treeGrid.grid.on("removeGanttShimmer",this.removeShimmer,this),this.parent.treeGrid.grid.on("virtualTransform",this.transformChange,this)},HGt.prototype.removeEventListeners=function(){E.remove(this.element,"scroll",this.onScroll),this.parent.off("grid-scroll",this.gridScrollHandler),this.parent.treeGrid.grid.off("showGanttShimmer",this.updateShimmer),this.parent.treeGrid.grid.off("removeGanttShimmer",this.removeShimmer),this.parent.treeGrid.grid.off("virtualTransform",this.transformChange)},HGt.prototype.gridScrollHandler=function(e){this.element.scrollTop=R("top",e),this.isFromTreeGrid=!0},HGt.prototype.updateContent=function(){var e=this.parent.element,e=Math.round(this.element.scrollLeft/e.offsetWidth);(this.previousCount!==e||this.parent.timelineModule.performedTimeSpanAction||this.parent.timelineModule.isZoomingAction)&&(this.parent.timelineModule.isZoomingAction=!1,this.deleteTableElements(),this.parent.timelineModule.createTimelineSeries(),"Vertical"!==this.parent.gridLines&&"Both"!==this.parent.gridLines||this.parent.renderChartVerticalLines(),this.parent.dayMarkersModule&&this.parent.dayMarkersModule.eventMarkerRender.renderEventMarkers(),this.parent.timelineModule.performedTimeSpanAction=!1,this.parent.dayMarkersModule&&(this.parent.dayMarkersModule.nonworkingDayRender.renderWeekends(),this.parent.dayMarkersModule.nonworkingDayRender.renderHolidays()),this.updateChartElementStyles(),this.previousCount=e,this.isSetScrollLeft)&&(this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft)},HGt.prototype.getTimelineLeft=function(){var e,t=this.parent.element,i=this.parent.timelineModule.wholeTimelineWidth>3*t.offsetWidth?this.parent.timelineModule.wholeTimelineWidth-3*t.offsetWidth:0;return(e=i<=(e=this.element.scrollLeft===(this.parent.enableRtl?-i:i)?this.element.scrollLeft:(e=this.parent.enableRtl?-this.element.scrollLeft:this.element.scrollLeft)>t.offsetWidth?e-t.offsetWidth:0)?i:e)<=t.offsetWidth&&this.isBackwardScrolled&&(e=0),e=this.parent.timelineModule.isZoomToFit||this.parent.timelineModule.isZooming?0:e},HGt.prototype.deleteTableElements=function(){for(var e=this.parent.element.getElementsByClassName("e-timeline-header-table-container");e[0].remove(),0<e.length;);this.parent.element.querySelector("#ganttContainerline-container")&&(this.parent.element.querySelector("#ganttContainerline-container").innerHTML=""),this.parent.element.querySelector(".e-nonworking-day-container")&&(this.parent.element.querySelector(".e-nonworking-day-container").outerHTML=null)},HGt.prototype.updateChartElementStyles=function(){var e,t,i=this.getTimelineLeft();this.parent.enableTimelineVirtualization&&(e=this.parent.connectorLineModule.dependencyViewContainer,t=this.parent.chartRowsModule.taskTable,this.parent.enableRtl?(e.style.left=i+"px",t.style.right=-i+"px"):(e.style.left=-i+"px",t.style.left=-i+"px"),t.style.width=this.parent.timelineModule.wholeTimelineWidth+"px")},HGt.prototype.updateTopPosition=function(){var e,t,i,n=this.parent.treeGrid.element.querySelector(".e-content").scrollTop;n=this.parent.virtualScrollModule&&this.parent.enableVirtualization?n-this.parent.virtualScrollModule.getTopPosition():n,je(this.parent.dayMarkersModule)||(e=R("nonworkingDayRender.holidayContainer",this.parent.dayMarkersModule),t=R("nonworkingDayRender.weekendContainer",this.parent.dayMarkersModule),i=R("eventMarkerRender.eventMarkersContainer",this.parent.dayMarkersModule),e&&(e.style.top=T(n)),t&&(t.style.top=T(n)),i&&(i.style.top=T(n))),this.parent.chartVerticalLineContainer&&(this.parent.chartVerticalLineContainer.style.top=T(n))},HGt.prototype.removeShimmer=function(){var i=this.parent;setTimeout(function(){if(i.hideMaskRow(),!i.allowTaskbarOverlap&&i.showOverAllocation){for(var e=0;e<i.currentViewData.length;e++){var t=i.chartRowsModule.ganttChartTableBody.childNodes[e];"none"!==t.style.display&&i.currentViewData[e].hasChildRecords&&!i.currentViewData[e].expanded&&(i.ganttChartModule.isExpandAll||i.ganttChartModule.isCollapseAll?i.treeGrid.getRowByIndex(e).style.height=t.style.height:i.treeGrid.getRows()[e].style.height=t.style.height)}i.contentHeight=(i.enableRtl?i.element.getElementsByClassName("e-content")[2]:i.element.getElementsByClassName("e-content")[0]).children[0].offsetHeight,i.element.getElementsByClassName("e-chart-rows-container")[0].style.height=i.contentHeight+"px"}},0)},HGt.prototype.transformChange=function(){this.parent.ganttChartModule.virtualRender.adjustTable(),this.parent.ganttChartModule.scrollObject.updateTopPosition()},HGt.prototype.updateShimmer=function(){var e=this.parent;setTimeout(function(){e.showMaskRow()},0)},HGt.prototype.updateSpinner=function(){var e=this.parent;this.parent.showSpinner(),window.clearTimeout(this.isScrolling),this.isScrolling=setTimeout(function(){e.hideSpinner()},200)},HGt.prototype.onScroll=function(){var e=this,t={};this.element.scrollTop!==this.previousScroll.top&&(this.isFromTreeGrid?this.isFromTreeGrid=!1:this.parent.notify("chartScroll",{top:this.element.scrollTop}),t.previousScrollTop=this.previousScroll.top,this.previousScroll.top=this.element.scrollTop,t.scrollTop=this.element.scrollTop,t.scrollDirection="Vertical",t.action="VerticalScroll",this.updateTopPosition()),this.element.scrollLeft!==this.previousScroll.left&&(this.isBackwardScrolled=this.element.scrollLeft<this.previousScroll.left&&!this.parent.enableRtl,this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft,t.previousScrollLeft=this.previousScroll.left,this.previousScroll.left=this.element.scrollLeft,t.scrollLeft=this.element.scrollLeft,t.scrollDirection="Horizontal",t.action="HorizontalScroll",this.parent.enableTimelineVirtualization&&this.parent.timelineModule.wholeTimelineWidth>3*this.parent.element.offsetWidth?(this.isSetScrollLeft=!0,this.parent.timelineModule.totalTimelineWidth>3*this.parent.element.offsetWidth&&this.updateContent(),this.parent.ganttChartModule.updateWidthAndHeight(),this.parent.element.getElementsByClassName("e-weekend-container")[0]&&(this.parent.element.getElementsByClassName("e-weekend-container")[0].style.height="100%"),this.parent.element.getElementsByClassName("e-holiday-container")[0]&&(this.parent.element.getElementsByClassName("e-holiday-container")[0].style.height="100%")):this.parent.enableTimelineVirtualization&&this.parent.timelineModule.wholeTimelineWidth<3*this.parent.element.offsetWidth&&this.parent.connectorLineModule.svgObject.setAttribute("width","100%")),this.parent.timelineModule.performedTimeSpanAction=!1,je(t.scrollDirection)||!0!==this.parent.enableVirtualization&&!0!==this.parent.enableTimelineVirtualization||!this.parent.isToolBarClick&&!je(this.parent.isToolBarClick)||(this.parent.isVirtualScroll=!0,(this.parent.showIndicator||je(this.parent.showIndicator))&&(!this.parent.enableVirtualMaskRow&&this.parent.enableVirtualization&&"Spinner"===this.parent.loadingIndicator.indicatorType?this.updateSpinner():this.parent.enableTimelineVirtualization&&!this.parent.isRowSelected&&1e3<Math.abs(this.element.scrollLeft-t.previousScrollLeft)&&(this.parent.enableVirtualMaskRow||"Spinner"!==this.parent.loadingIndicator.indicatorType?(this.parent.showMaskRow(),setTimeout(function(){e.removeShimmer()},0)):this.updateSpinner()),this.parent.isRowSelected=!1)),this.isSetScrollLeft=!1,this.parent.isToolBarClick=!0,t.requestType="scroll",this.parent.trigger("actionComplete",t)},HGt.prototype.setHeight=function(e){this.element.style.height=T(e)},HGt.prototype.setWidth=function(e){this.element.style.width=T(e)},HGt.prototype.setScrollTop=function(e){this.element.scrollTop=e,this.parent.treeGrid.element.querySelector(".e-content").scrollTop=e},HGt.prototype.setScrollLeft=function(e,t){e=-1===t&&this.parent.enableRtl?-e:e,this.isSetScrollLeft=!0,this.element.scrollLeft=e,this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft,this.parent.enableTimelineVirtualization||(this.previousScroll.left=this.element.scrollLeft)},HGt.prototype.destroy=function(){this.removeEventListeners()},HGt);function HGt(e){this.previousCount=-1,this.isSetScrollLeft=!1,this.previousScroll={top:0,left:0},this.parent=e,this.element=this.parent.ganttChartModule.scrollElement,this.addEventListeners()}jGt.prototype.renderWrapper=function(){this.wrapper=Q("div",{className:"e-virtualtable",styles:"position: absolute; transform: translate(0px, 0px);"}),this.parent.ganttChartModule.scrollElement.appendChild(this.wrapper),this.virtualTrack=Q("div",{className:"e-virtualtrack",styles:"position: relative; pointer-events: none; width: 100%;"}),this.parent.ganttChartModule.scrollElement.appendChild(this.virtualTrack),this.wrapper.appendChild(this.parent.ganttChartModule.chartBodyContent)},jGt.prototype.appendChildElements=function(e){this.wrapper.appendChild(e)},jGt.prototype.adjustTable=function(){var e,t,i,n=this.parent.treeGrid.getContent().querySelector(".e-content").querySelector(".e-virtualtable");this.parent.enableTimelineVirtualization?(i=document.getElementsByClassName("e-virtualtable")[1].style.transform,e=this.parent.treeGrid.element.getElementsByClassName("e-virtualtable")[0].style.transform,t=void 0,t=(""!==i?i:this.parent.ganttChartModule.scrollElement.getElementsByClassName("e-virtualtable")[0].style.transform).match(/translate.*\((.+)\)/)[1].split(", ")[0],i=e.match(/translate.*\((.+)\)/)[1].split(", ")[1],this.parent.ganttChartModule.virtualRender.wrapper.style.transform="translate("+t+", "+i+")"):this.parent.ganttChartModule.virtualRender.wrapper.style.transform=n.style.transform};var zGt=jGt;function jGt(e){this.parent=e}QGt.prototype.addEventListener=function(){this.parent.on("renderPanels",this.renderChartContainer,this),this.parent.on("recordsUpdated",this.renderChartElements,this),this.parent.on("dataReady",this.renderInitialContents,this),this.parent.on("tree-grid-created",this.renderChartContents,this),this.parent.on("destroy",this.destroy,this)},QGt.prototype.renderChartContents=function(){this.parent.notify("refreshDayMarkers",{}),this.wireEvents()},QGt.prototype.renderChartContainer=function(){this.chartElement=Q("div",{id:this.parent.element.id+"GanttChart",className:"e-gantt-chart"}),this.parent.chartPane.appendChild(this.chartElement),this.renderTimelineContainer(),this.renderBodyContainers()},QGt.prototype.renderInitialContents=function(){this.parent.timelineModule.createTimelineSeries()},QGt.prototype.renderOverAllocationContainer=function(){for(var e=0;e<this.parent.flatData.length;e++){var t=this.parent.flatData[e];0<t.childRecords.length&&this.parent.dataOperation.updateOverlappingValues(t)}var i=this.parent.element.querySelector("."+NGt);i&&(i.innerHTML=""),0===this.parent.treeGrid.grid.filterSettings.columns.length&&this.renderRangeContainer(this.parent.currentViewData)},QGt.prototype.renderChartElements=function(){if(this.parent.isFromOnPropertyChange)this.rangeViewContainer.innerHTML="",this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff),this.parent.isFromOnPropertyChange=!1;else{this.parent.chartRowsModule.renderChartRows(),this.parent.predecessorModule&&this.parent.taskFields.dependency&&(this.parent.connectorLineIds=[],this.parent.updatedConnectorLineCollection=[],this.parent.predecessorModule.createConnectorLinesCollection()),this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection);for(var e=0;e<this.parent.chartRowsModule.ganttChartTableBody.children.length;e++)this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[4]?(this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[1].setAttribute("tabindex","-1"),this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[2].setAttribute("tabindex","-1"),this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[4].setAttribute("tabindex","-1")):"ProjectView"===this.parent.viewType?je(this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(e.toString(),10)].children[0].children[1].children[1])||this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[1].setAttribute("tabindex","-1"):this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(e.toString(),10)].children[0].children[1].children[0]&&this.parent.chartRowsModule.ganttChartTableBody.children[e].children[0].children[1].children[0].setAttribute("tabindex","-1");var t=this.parent.criticalPathModule;this.parent.enableCriticalPath&&t&&t.criticalPathCollection&&this.parent.criticalPathModule.criticalConnectorLine(t.criticalPathCollection,t.detailPredecessorCollection,this.parent.enableCriticalPath,t.predecessorCollectionTaskIds),this.parent.showOverAllocation&&this.renderOverAllocationContainer()}this.updateWidthAndHeight(),this.parent.isLoad&&this.parent.notify("selectRowByIndex",{}),this.parent.timelineModule.isZoomToFit&&this.parent.timelineModule.processZoomToFit()},QGt.prototype.renderRangeContainer=function(e){var t,i,n,o=e.length;if(0===this.parent.treeGrid.grid.filterSettings.columns.length)for(t=0;t<o;t++)(n=(i=e[t]).ganttProperties.workTimelineRanges)&&this.renderRange(n,i)},QGt.prototype.getTopValue=function(e){var t,i=this.parent.getExpandedRecords(this.parent.currentViewData),n=i.indexOf(e);return e.parentItem&&-1===n&&(t=this.parent.getRecordByID(e.parentItem.taskId),n=i.indexOf(t)),e.expanded?(n+1)*this.parent.rowHeight:n*this.parent.rowHeight},QGt.prototype.getHierarchyChildRecords=function(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];o.childRecords&&0<o.childRecords.length&&(t.push(o),this.collectHierarchyChildren(o.childRecords,t))}return t},QGt.prototype.collectHierarchyChildren=function(e,t){for(var i=0,n=e;i<n.length;i++){var o=n[i];o.childRecords&&0<o.childRecords.length&&(t.push(o),this.collectHierarchyChildren(o.childRecords,t))}},QGt.prototype.getRangeHeight=function(e){var t,i=Math.floor(this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight);return!e.expanded&&e.hasChildRecords?this.calculateCollapsedRowHeight(i):(t=this.calculateHierarchyChildLength(e),this.calculateExpandedRowHeight(e.childRecords.length,t,i))},QGt.prototype.calculateCollapsedRowHeight=function(e){return this.parent.rowHeight-e},QGt.prototype.calculateHierarchyChildLength=function(e){if(!e.childRecords||0===e.childRecords.length)return 0;for(var t=0,i=0,n=this.getHierarchyChildRecords(e.childRecords);i<n.length;i++){var o=n[i];0!==o.childRecords.length&&o.expanded&&(t+=o.childRecords.length)}return t},QGt.prototype.calculateExpandedRowHeight=function(e,t,i){return(e+t)*this.parent.rowHeight-i},QGt.prototype.renderRange=function(e,t){var i=0,n=this.parent.currentViewData.indexOf(t),o=(i=!this.parent.allowTaskbarOverlap&&this.parent.enableMultiTaskbar?(a=t.parentItem?this.parent.getParentTask(t.parentItem):null,t.parentItem&&a&&!a.expanded&&t.hasChildRecords&&!t.expanded?this.parent.getRowByIndex(this.parent.getRootParent(t,0).index).offsetTop:(o=this.parent.getRowByIndex(n).offsetTop,t.expanded?o+this.parent.rowHeight:o)):this.getTopValue(t),this.rangeViewContainer.querySelector(".rangeContainer"+t.ganttProperties.rowUniqueID)),r=(o&&o.remove(),Q("div",{className:"rangeContainer"+t.ganttProperties.rowUniqueID,styles:"top:"+i+"px; position: absolute;"}));if((0!==t.level||t.expanded||!je(t.parentItem)||this.parent.enableMultiTaskbar)&&(!(0<t.level&&t.expanded)||this.parent.getRecordByID(t.parentItem.taskId).expanded)){for(var s=0;s<e.length;s++){var a,l=void 0,h=this.parent.chartRowsModule.ganttChartTableBody.childNodes,h=(l=this.parent.allowTaskbarOverlap||t.expanded||!this.parent.enableMultiTaskbar?this.getRangeHeight(t):(n=(a=this.parent.getRootParent(t,0)).expanded?n:this.parent.currentViewData.indexOf(a),parseInt(h[n].style.height,10)-(this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)),Q("div",{className:VGt+" e-leftarc",styles:(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e[s].left+e[s].width-5:e[s].left)+"px;\n                top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px;\n                height: "+(l+1)+"px; border-right: 0px;\n                z-index: "+("ProjectView"===this.parent.viewType?1<t.childRecords.length?t.childRecords.length+1:t.childRecords.length:6)})),l=Q("div",{className:VGt+" e-rightarc",styles:(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e[s].left:e[s].left+e[s].width-5)+"px;\n                top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px; height: "+(l+1)+"px;\n                border-left: 0px;\n                z-index: "+("ProjectView"===this.parent.viewType?1<t.childRecords.length?t.childRecords.length+1:t.childRecords.length:6)});r.appendChild(h),r.appendChild(l),this.rangeViewContainer.appendChild(r)}this.parent.ganttChartModule.chartBodyContent.appendChild(this.rangeViewContainer)}},QGt.prototype.renderTimelineContainer=function(){this.chartTimelineContainer=Q("div",{className:Dqt}),this.parent.enableRtl&&(this.chartTimelineContainer.style.borderLeftWidth="1px",this.chartTimelineContainer.style.borderRightWidth="0px"),this.chartTimelineContainer.setAttribute("role","presentation"),this.chartElement.appendChild(this.chartTimelineContainer)},QGt.prototype.renderBodyContainers=function(){this.chartBodyContainer=Q("div",{className:Iqt}),this.chartElement.appendChild(this.chartBodyContainer),this.scrollElement=Q("div",{className:"e-chart-scroll-container e-content",styles:"position:relative;"}),this.chartBodyContainer.appendChild(this.scrollElement),this.chartBodyContent=Q("div",{className:Tqt,styles:"position:relative; overflow:hidden "}),this.parent.virtualScrollModule&&this.parent.enableVirtualization||this.parent.enableTimelineVirtualization?this.parent.ganttChartModule.virtualRender.renderWrapper():this.scrollElement.appendChild(this.chartBodyContent),this.scrollObject=new _Gt(this.parent);var e=0;je(this.parent.toolbarModule)||je(this.parent.toolbarModule.element)||(e=this.parent.toolbarModule.element.offsetHeight),this.scrollObject.setHeight(this.parent.ganttHeight-this.chartTimelineContainer.offsetHeight-e)},QGt.prototype.updateWidthAndHeight=function(){var e=0===this.parent.contentHeight?1<this.parent.flatData.length?36:0:this.parent.contentHeight,t=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0];e>=t.offsetHeight||"auto"===this.parent.height||t.offsetHeight-e<36?this.chartBodyContent.style.height=T(e):(e=this.parent.element.getElementsByClassName("e-chart-rows-container")[0].offsetHeight,t.offsetHeight>=e?this.chartBodyContent.style.height=t.offsetHeight-17+"px":this.chartBodyContent.style.height=t.offsetHeight+"px"),this.parent.timelineModule.isZoomToFit&&this.parent.enableTimelineVirtualization?this.chartBodyContent.style.width=this.parent.enableTimelineVirtualization&&this.parent.timelineModule.totalTimelineWidth>3*this.parent.element.offsetWidth?T(3*this.parent.element.offsetWidth):T(this.parent.timelineModule.totalTimelineWidth-this.parent.timelineModule.clientWidthDifference):this.chartBodyContent.style.width=this.parent.enableTimelineVirtualization&&this.parent.timelineModule.totalTimelineWidth>3*this.parent.element.offsetWidth?T(3*this.parent.element.offsetWidth):T(this.parent.timelineModule.totalTimelineWidth),this.parent.timelineModule.isZoomedToFit&&this.parent.enableVirtualization&&(e=Math.abs(this.parent.timelineModule.totalTimelineWidth-this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].clientWidth),this.parent.ganttChartModule.chartBodyContent.style.width=T(this.parent.timelineModule.totalTimelineWidth-e)),this.setVirtualHeight(),this.parent.notify("updateHeight",{}),this.parent.updateGridLineContainerHeight(),this.updateLastRowBottomWidth()},QGt.prototype.setVirtualHeight=function(){var e,t,i,n;this.parent.virtualScrollModule&&this.parent.enableVirtualization&&(R("virtualTrack",this.parent.ganttChartModule.virtualRender).style.height=this.parent.treeGrid.element.getElementsByClassName("e-virtualtrack")[0].style.height,e=R("wrapper",this.parent.ganttChartModule.virtualRender),t=this.parent.treeGrid.element.getElementsByClassName("e-virtualtable")[0].style.transform,n=document.getElementsByClassName("e-virtualtable")[1].style.transform,this.parent.enableTimelineVirtualization?(i=void 0,"translate(0px)"===t&&navigator.userAgent.includes("Firefox")&&(t="translate(0px, 0px)"),i=(""!==n?n:this.parent.ganttChartModule.scrollElement.getElementsByClassName("e-virtualtable")[0].style.transform).match(/translate.*\((.+)\)/)[1].split(", ")[0],n=t.match(/translate.*\((.+)\)/)[1].split(", ")[1],e.style.transform="translate("+i+", "+n+")"):e.style.transform=t)},QGt.prototype.updateLastRowBottomWidth=function(){var e,t;0<this.parent.currentViewData.length&&"auto"!==this.parent.height&&(e=(e=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.currentViewData:this.parent.expandedRecords)[e.length-1],e=this.parent.currentViewData.indexOf(e),e=this.parent.getRowByIndex(e),(t=this.parent.chartRowsModule.ganttChartTableBody).querySelectorAll(".e-chart-row-cell.e-chart-row-border.e-lastrow")&&q(t.querySelectorAll(".e-chart-row-cell.e-chart-row-border.e-lastrow"),"e-lastrow"),this.chartBodyContent.clientHeight<this.chartBodyContainer.clientHeight)&&e&&(U(e.querySelectorAll("td"),"e-lastrow"),(t=0===this.parent.contentHeight?1<this.parent.flatData.length?36:0:this.parent.contentHeight)>=(e=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0]).offsetHeight||e.offsetHeight-t<36?this.chartBodyContent.style.height=T(t):(t=this.parent.element.getElementsByClassName("e-chart-rows-container")[0].offsetHeight,e.offsetHeight>=t?this.chartBodyContent.style.height=e.offsetHeight-17+"px":this.chartBodyContent.style.height=e.offsetHeight+"px"))},QGt.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("renderPanels",this.renderChartContainer),this.parent.off("recordsUpdated",this.renderChartElements),this.parent.off("dataReady",this.renderInitialContents),this.parent.off("tree-grid-created",this.renderChartContents),this.parent.off("destroy",this.destroy))},QGt.prototype.ganttChartMouseDown=function(e){var t,i=!1;"touchstart"===e.type&&e instanceof TouchEvent&&e.touches&&2===e.touches.length&&(this.initPinchDistance=this.calculatePinchDistance(e.touches[0],e.touches[1]),this.isPinching=!0),this.parent.allowTaskbarDragAndDrop&&this.parent.editModule&&this.parent.editSettings.allowTaskbarEditing&&!this.isPinching&&("ChildDrag"!==(t=this.parent.editModule.taskbarEditModule.getTaskBarAction(e))&&"ParentDrag"!==t&&"MilestoneDrag"!==t&&"ManualParentDrag"!==t||(t={cancel:i,data:this.getRecordByTaskBar(e.target),target:e.target,chartRow:z(e.target,"tr")},this.parent.trigger("rowDragStartHelper",t),i=t.cancel)),i||this.isPinching||(3!==e.which&&this.parent.editSettings.allowTaskbarEditing&&(this.parent.notify("chartMouseDown",e),this.parent.element.tabIndex=0),t=!1,(t=this.parent.editSettings.allowTaskbarEditing&&(this.parent.element.querySelector(".e-left-resize-gripper")||this.parent.element.querySelector(".e-left-connectorpoint-outer-div"))?!0:t)&&2!==e.button)||this.parent.editSettings.allowEditing&&0<this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length&&this.parent.treeGrid.endEdit()},QGt.prototype.calculatePinchDistance=function(e,t){var i=t.clientX-e.clientX,t=t.clientY-e.clientY;return Math.sqrt(i*i+t*t)},QGt.prototype.ganttChartMouseClick=function(e){this.parent.autoFocusTasks&&this.scrollToTarget(e),this.parent.notify("chartMouseClick",e)},QGt.prototype.ganttChartMouseUp=function(e){var t,i;"touchend"===e.type&&(this.initPinchDistance=null,this.isPinching=!1,je(t=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-taskbar-resize-div"))||t.remove(),je(t=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-clone-taskbar")||this.parent.chartPane.querySelector(".e-clone-taskbar"))||t.parentElement.parentElement.remove(),je(this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-gantt-false-line"))||this.parent.editModule.taskbarEditModule.removeFalseLine(!0)),this.parent.editSettings.allowTaskbarEditing&&this.parent.notify("chartMouseUp",e),this.parent.editSettings.allowEditing||(t=!1,t=!!(this.parent.editSettings.allowTaskbarEditing&&R("editModule.taskbarEditModule.isMouseDragged",this.parent)&&R("editModule.taskbarEditModule.taskBarEditAction",this.parent))||t)||(t=e.target,i=e.target.classList.contains(Rqt)||z(e.target,"."+Rqt),!z(t,".e-gantt-parent-taskbar")||this.parent.editSettings.allowEditing||this.parent.isAdaptive?!i&&this.parent.autoFocusTasks&&this.scrollToTarget(e):this.chartExpandCollapseRequest(e))},QGt.prototype.scrollToTarget=function(e){var t=z(e.target,"tr");t&&this.parent.element.contains(t)&&(this.parent.element.querySelectorAll(".e-chart-rows-container")[0].contains(e.target)||this.parent.element.querySelectorAll(".e-gridcontent")[0].contains(e.target))&&0<this.parent.currentViewData.length&&(t=R("rowIndex",z(e.target,"tr")),e=this.parent.currentViewData[t].ganttProperties.startDate,t=this.parent.currentViewData[t].ganttProperties.left,je(e)||(e=this.parent.enableTimelineVirtualization?{}:this.parent.dataOperation.getTaskLeft(e,!1),this.parent.autoFocusTasks&&(this.parent.enableTimelineVirtualization?this.updateScrollLeft(t):this.updateScrollLeft(e))))},QGt.prototype.updateScrollLeft=function(e){e=this.scrollElement.scrollWidth<=(e=0<e?e:0)?this.scrollElement.scrollWidth:e,(this.scrollElement.offsetWidth+this.parent.ganttChartModule.scrollElement.scrollLeft<e||this.scrollElement.scrollLeft>e)&&this.scrollObject.setScrollLeft(e-50,this.parent.enableRtl?-1:0)},QGt.prototype.mouseUp=function(e){"touchend"===e.type&&(this.initPinchDistance=null,this.isPinching=!1),je(this.parent.editModule)||je(this.parent.editModule.taskbarEditModule)||this.parent.editModule.taskbarEditModule.removeFalseLine(!1);var t=this.parent.element.querySelector(".e-taskbar-resize-div");je(t)||t.remove(),this.parent.allowTaskbarDragAndDrop&&this.parent.editModule&&this.parent.editModule.taskbarEditModule&&(this.parent.editModule.taskbarEditModule.previousLeftValue=0),this.parent.allowRowDragAndDrop&&(t=this.parent.element.querySelector(".e-ganttdrag"))&&t.remove(),this.isGanttElement||this.parent.notify("chartMouseUp",e),this.isGanttElement=!1},QGt.prototype.documentMouseUp=function(e){var t,i,n;"touchend"===e.type&&(this.initPinchDistance=null,this.isPinching=!1,this.previousPinchDistance=0),this.isGanttElement=!0,(e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse"))&&!0===R("isEditCollapse",this.parent.treeGrid)&&x("isEditCollapse",!1,this.parent.treeGrid),this.parent.allowRowDragAndDrop&&(t=this.parent.element.querySelector(".e-ganttdrag"))&&t.remove(),this.parent.isDestroyed||3===e.which||(je(t=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-taskbar-resize-div"))||t.remove(),je(t=this.parent.element.getElementsByClassName("e-clone-taskbar")[0])||t.parentElement.parentElement.remove(),t=!1,this.parent.editSettings.allowTaskbarEditing&&R("editModule.taskbarEditModule.isMouseDragged",this.parent)&&R("editModule.taskbarEditModule.taskBarEditAction",this.parent)&&(t=!0),this.parent.notify("chartMouseUp",e),this.parent.showActiveElement&&(this.parent.showIndicator=!0,je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.focusedElement)&&!e.target.classList.contains("e-split-bar")&&(this.focusedElement.tabIndex=0===this.focusedElement.tabIndex?-1:this.focusedElement.tabIndex,q([this.focusedElement],"e-active-container")),t||(i=e.target,n=e.target.classList.contains(Rqt)||z(e.target,"."+Rqt),z(i,".e-gantt-parent-taskbar")&&!this.parent.editSettings.allowEditing?this.chartExpandCollapseRequest(e):!n&&this.parent.autoFocusTasks&&this.scrollToTarget(e)),this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.editModule.taskbarEditModule.removeFalseLine(!0),je(this.parent.onTaskbarClick))||t||(n=z(i=e.target,".e-gantt-parent-taskbar,.e-gantt-child-taskbar,.e-gantt-milestone"))&&this.onTaskbarClick(e,i,n)},QGt.prototype.onTaskbarClick=function(e,t,i){var n,o=z(t,"tr"),o=(je(o)||(n=R("rowIndex",o)),this.getRecordByTarget(e));this.parent.trigger("onTaskbarClick",{data:o,taskbarElement:i,rowIndex:n,target:t})},QGt.prototype.ganttChartLeave=function(e){this.parent.editSettings.allowTaskbarEditing&&this.parent.notify("chartMouseLeave",e)},QGt.prototype.ganttChartMove=function(e){var t;if("touchmove"===e.type&&!0===this.isPinching&&e instanceof TouchEvent&&e.touches&&2===e.touches.length&&(t=this.calculatePinchDistance(e.touches[0],e.touches[1]),15<Math.abs(this.previousPinchDistance-t))&&(t>this.previousPinchDistance?this.parent.timelineModule.processZooming(!0):t<this.previousPinchDistance&&this.parent.timelineModule.processZooming(!1),this.previousPinchDistance=t),this.parent.editSettings.allowTaskbarEditing&&!1===this.isPinching){if(0<this.parent.element.getElementsByClassName("e-clone-taskbar").length&&!this.parent.enableRtl)if(("touchmove"===e.type||"touchstart"===e.type||"touchend"===e.type?e.changedTouches[0]:e).pageX<=this.parent.getOffsetRect(this.parent.ganttChartModule.chartElement).left)return;this.parent.notify("chartMouseMove",e),!je(this.parent.taskFields.dependency)&&this.parent.connectorLineEditModule&&this.parent.connectorLineEditModule.updateConnectorLineEditElement(e)}},QGt.prototype.contextClick=function(e){this.parent.allowFiltering&&this.parent.filterModule&&this.parent.filterModule.closeFilterOnContextClick(e.srcElement),this.parent.allowTaskbarDragAndDrop&&!je(e=this.parent.chartPane.querySelector(".e-clone-taskbar"))&&e.parentElement.parentElement.remove()},QGt.prototype.mouseMoveHandler=function(e){if(!je(this.parent.onMouseMove)&&(this.parent.flatData.length||e.target.classList.contains("e-header-cell-label")||e.target.classList.contains("e-headercell"))){var t=e.target,i={originalEvent:e},n=z(t,".e-chart-row-cell,.e-connector-line-container,.e-event-markers,.e-header-cell-label,.e-rowcell,.e-headercell,.e-indicator-span");if(n){var o,r=void 0,s=z(t,".e-rowcell,.e-chart-row-cell"),a=z(t,".e-rowcell,.e-headercell");if(s&&(r=this.parent.ganttChartModule.getRecordByTarget(e),i.data=r),a&&(s=R("cellIndex",a),i.column=this.parent.treeGrid.columns[s]),z(t,".e-indicator-span")){var l=0,h=r.ganttProperties.indicators;if(1<h.length)for(l=0;l<h.length&&h[l].name!==n.innerText.trim();l++);i.indicator=h[l]}z(t,".e-connector-line-container")&&((o={}).target=n,i.predecessor=this.parent.tooltipModule.getPredecessorTooltipData(o)),z(t,".e-event-markers")&&((o={}).target=n,i.eventMarkers=this.parent.tooltipModule.getMarkerTooltipData(o)),t.classList.contains("e-header-cell-label")&&(i.date=new Date(t.dataset.content))}this.parent.trigger("onMouseMove",i)}},QGt.prototype.doubleClickHandler=function(e){var t=e.target,i=z(t,"tr"),n=R("rowIndex",i),o=this.parent.ganttChartModule.getRecordByTarget(e),e=(this.parent.editSettings.allowEditing&&0<this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length&&this.parent.treeGrid.endEdit(),this.parent.notify("chartDblClick",e),{row:i,rowData:o,rowIndex:n,target:t});this.recordDoubleClick(e)},QGt.prototype.recordDoubleClick=function(e){this.parent.trigger("recordDoubleClick",e)},QGt.prototype.getRecordByTarget=function(e){var t,i=z(e.target,"div."+Rqt);return je(i)?(i=z(e.target,"tr"))&&(e=R("rowIndex",z(e.target,"tr")),t=this.parent.currentViewData[e]):(e=i.getAttribute("rowUniqueId"),t=this.parent.getRecordByID(e)),t},QGt.prototype.getChartRows=function(){return null!==document.getElementById(this.parent.element.id+"GanttTaskTableBody")?document.getElementById(this.parent.element.id+"GanttTaskTableBody").querySelectorAll(".e-chart-row"):null},QGt.prototype.chartExpandCollapseRequest=function(e){var t,i,n;this.parent.enableMultiTaskbar||(t=z(i=e.target,".e-gantt-parent-taskbar"),e=this.getRecordByTarget(e),n=R("rowIndex",i=z(i,"tr")),e={data:e,gridRow:this.parent.treeGrid.getRows()[n],chartRow:i,cancel:!1},this.isExpandCollapseFromChart=!0,t.classList.contains("e-row-expand")?this.collapseGanttRow(e):t.classList.contains("e-row-collapse")&&this.expandGanttRow(e))},QGt.prototype.reRenderConnectorLines=function(){this.parent.connectorLineModule.dependencyViewContainer.innerHTML="",this.parent.connectorLineIds=[],this.parent.updatedConnectorLineCollection=[],this.parent.predecessorModule.createConnectorLinesCollection(),this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection);var e=this.parent.criticalPathModule;this.parent.enableCriticalPath&&e&&e.criticalPathCollection&&e.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds)},QGt.prototype.collapseGanttRow=function(e){var t=this;this.parent.trigger("collapsing",e,function(e){t.isExpandCollapseFromChart&&!R("cancel",e)&&t.collapsedGanttRow(e),t.isExpandCollapseFromChart=!1})},QGt.prototype.collapsedGanttRow=function(t){var i,e,n=this,o=this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.currentViewData.filter(function(e){return e.ganttProperties[n.parent.taskFields.id]===t.data[n.parent.taskFields.id]})[0]:R("data",t);je(t.gridRow)&&this.parent.enableVirtualization||je(t.chartRow)?o&&(o.expanded=!1):(this.isExpandCollapseFromChart?(this.expandCollapseChartRows("collapse",R("chartRow",t),o,null),i=this.parent.taskFields.id,this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?(e=this.parent.treeGrid.getCurrentViewRecords().filter(function(e){return e[i]===t.data[i]})[0],this.parent.treeGrid.collapseRow(R("gridRow",t),e)):this.parent.treeGrid.collapseRow(R("gridRow",t),o),this.isExpandCollapseFromChart=!1):this.expandCollapseChartRows("collapse",R("chartRow",t),o,null),"ResourceView"!==this.parent.viewType&&"ProjectView"!==this.parent.viewType||this.renderMultiTaskbar(o),this.parent.enableVirtualization||this.parent.updateContentHeight(),this.updateWidthAndHeight(),this.reRenderConnectorLines(),R("chartRow",t).setAttribute("aria-expanded","false"))},QGt.prototype.expandGanttRow=function(e){var t=this;this.parent.trigger("expanding",e,function(e){t.isExpandCollapseFromChart&&!R("cancel",e)&&t.expandedGanttRow(e),t.isExpandCollapseFromChart=!1})},QGt.prototype.expandedGanttRow=function(t){var i,e,n=this,o=this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.currentViewData.filter(function(e){return e.ganttProperties.taskId===t.data[n.parent.taskFields.id]})[0]:R("data",t);je(t.gridRow)&&this.parent.enableVirtualization||je(t.chartRow)?o&&(o.expanded=!0):(this.isExpandCollapseFromChart?(this.expandCollapseChartRows("expand",R("chartRow",t),o,null),i=this.parent.taskFields.id,this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?(e=this.parent.treeGrid.getCurrentViewRecords().filter(function(e){return e[i]===t.data[i]})[0],this.parent.treeGrid.expandRow(R("gridRow",t),e)):this.parent.treeGrid.expandRow(R("gridRow",t),o),this.isExpandCollapseFromChart=!1):(this.parent.isExpandCollapseLevelMethod||this.expandCollapseChartRows("expand",R("chartRow",t),o,null),this.parent.isExpandCollapseLevelMethod=!1),"ResourceView"!==this.parent.viewType&&"ProjectView"!==this.parent.viewType||this.renderMultiTaskbar(o),this.parent.enableVirtualization||this.parent.updateContentHeight(),this.updateWidthAndHeight(),this.reRenderConnectorLines(),R("chartRow",t).setAttribute("aria-expanded","true"))},QGt.prototype.renderMultiTaskbar=function(e){this.parent.enableMultiTaskbar?this.parent.chartRowsModule.refreshRecords([e],!0):this.parent.showOverAllocation&&this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)},QGt.prototype.expandCollapseChartRows=function(e,t,i,n){var o;if("expand"===e){o="table-row",n||(i.expanded=!0);for(var r=t.querySelectorAll(".e-row-collapse"),s=0;s<r.length;s++)U([r[s]],"e-row-expand"),q([r[s]],"e-row-collapse")}else if("collapse"===e){o="none",n||(i.expanded=!1);for(r=t.querySelectorAll(".e-row-expand"),s=0;s<r.length;s++)U([r[s]],"e-row-collapse"),q([r[s]],"e-row-expand")}if(!this.parent.enableVirtualization){for(var a=i.childRecords,l=this.getChartRows(),h=[],d=0;d<l.length;d++)l[d].classList.contains("gridrowtaskId"+i.ganttProperties.rowUniqueID+"level"+(i.level+1))&&h.push(l[d]);for(d=0;d<h.length;d++)h[d].style.display=o,a[d].childRecords&&a[d].childRecords.length&&("collapse"===e||a[d].expanded||this.isExpandAll)&&this.expandCollapseChartRows(e,h[d],a[d],!0)}},QGt.prototype.expandCollapseAll=function(e){"expand"===e?(this.isExpandAll=!0,this.parent.treeGrid.expandAll()):(this.isCollapseAll=!0,this.parent.treeGrid.collapseAll(),this.isCollapseAll&&!this.parent.allowTaskbarOverlap&&(e=(this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2]:this.parent.element.getElementsByClassName("e-content")[0]).children[0].offsetHeight,this.parent.contentHeight=e,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px")),this.isExpandAll=!1,this.isCollapseAll=!1},QGt.prototype.expandAtLevel=function(e){this.parent.treeGrid.expandAtLevel(e)},QGt.prototype.collapseAtLevel=function(e){this.parent.enableVirtualization&&(this.parent.isExpandCollapseLevelMethod=!0),this.parent.treeGrid.collapseAtLevel(e)},QGt.prototype.wireEvents=function(){var t,i=this,e=F.isPointer,n=F.touchStartEvent,o=F.touchEndEvent,r=F.touchMoveEvent,e=e?"pointerleave":"mouseleave";E.add(this.parent.chartPane,n,this.ganttChartMouseDown,this),E.add(this.parent.chartPane,e,this.ganttChartLeave,this),E.add(this.parent.chartPane,r,this.ganttChartMove,this),E.add(this.parent.chartPane,"wheel",this.onWheelZoom,this),this.parent.isAdaptive&&(E.add(this.parent.chartRowsModule.ganttChartTableBody,"pointerdown",function(e){t?(clearTimeout(t),t=null,i.doubleClickHandler(e)):t=setTimeout(function(){t=null},200)},this),E.add(this.parent.chartPane,wx,this.ganttChartMouseClick,this),E.add(this.parent.chartPane,o,this.ganttChartMouseUp,this)),this.parent.isAdaptive||(E.add(this.parent.chartRowsModule.ganttChartTableBody,"dblclick",this.doubleClickHandler,this),E.add(this.parent.element,o,this.documentMouseUp,this),E.add(document,o,this.mouseUp,this)),E.add(this.parent.element,"mousemove",this.mouseMoveHandler,this),E.add(document.body,"contextmenu",this.contextClick,this),E.add(document,"mouseup",this.contextClick,this)},QGt.prototype.unWireEvents=function(){var e=F.isPointer,t=F.touchStartEvent,i=F.touchEndEvent,n=F.touchMoveEvent,e=e?"pointerleave":"mouseleave";je(this.parent.chartRowsModule.ganttChartTableBody)||E.remove(this.parent.chartRowsModule.ganttChartTableBody,t,this.ganttChartMouseDown),je(this.parent.chartPane)||(E.remove(this.parent.chartPane,e,this.ganttChartLeave),E.remove(this.parent.chartPane,n,this.ganttChartMove),E.remove(this.parent.chartPane,"wheel",this.onWheelZoom),E.remove(this.parent.chartPane,t,this.ganttChartMouseDown)),this.parent.isAdaptive&&!je(this.parent.chartPane)&&(E.remove(this.parent.chartPane,wx,this.ganttChartMouseClick),E.remove(this.parent.chartPane,i,this.ganttChartMouseUp)),this.parent.isAdaptive||(je(this.parent.element)||E.remove(this.parent.element,i,this.documentMouseUp),je(document))||E.remove(document,i,this.mouseUp),je(this.parent.element)||E.remove(this.parent.element,"mousemove",this.mouseMoveHandler),je(document)||(E.remove(document,"mouseup",this.contextClick),je(document.body))||E.remove(document.body,"contextmenu",this.contextClick),je(this.parent.chartRowsModule.ganttChartTableBody)||E.remove(this.parent.chartRowsModule.ganttChartTableBody,"dblclick",this.doubleClickHandler)},QGt.prototype.onWheelZoom=function(t){var i,n;t.ctrlKey&&(t.preventDefault(),i=t.deltaY<0,n=!1,Math.abs(t.deltaY)<75&&(n=!0),this.debounceTimeout&&(this.debounceTimeoutNext+20>this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeoutNext+20<=this.debounceTimeout||!this.debounceTimeoutNext)&&(this.debounceTimeoutNext=this.debounceTimeout),this.debounceTimeout=setTimeout(function(){var e=Math.abs(t.deltaY);(n?.5<e&&e<15:5<e&&e<=200)&&this.parent.timelineModule.processZooming(i)}.bind(this),100))},QGt.prototype.getRecordByTaskBar=function(e){e=(this.parent.enableVirtualization&&this.parent.enableMultiTaskbar?this.parent.flatData:this.parent.currentViewData)[this.getIndexByTaskBar(e)];return e},QGt.prototype.updateElement=function(e,t,i,n,o){if(this.parent.ganttColumns[parseInt(e.getAttribute("aria-colindex"),10)-1].field===this.parent.taskFields.progress){for(var r=o.index;o.hasChildRecords&&(e=this.getNextElement(e,i,n)),t=this.parent.ganttColumns[parseInt(e.getAttribute("aria-colindex"),10)-1],r=this.parent.treeGrid.getRows().indexOf(e.parentElement),!t.allowEditing;);this.parent.treeGrid.saveCell(),this.parent.treeGrid.editCell(r,this.parent.ganttColumns[parseInt(e.getAttribute("aria-colindex"),10)-1].field)}return e},QGt.prototype.onTabAction=function(e){this.parent.treeGrid.grid.enableHeaderFocus=this.parent.enableHeaderFocus;var t=document.getElementsByClassName("e-toolbar-item"),i=this.parent.editModule&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit;if(this.parent.showActiveElement||i){var n=i?e.target.closest(".e-rowcell"):e.target,o=((n=0<this.parent.element.querySelectorAll(".e-focused").length?this.parent.element.querySelectorAll(".e-focused")[0]:n)&&!(n.classList.contains("e-toolbar-item")||n.classList.contains("e-input")||n.classList.contains("e-btn"))&&(this.currentToolbarIndex=-1),(n.closest(".e-rowcell")||n.closest(".e-chart-row"))&&this.parent.focusModule.setActiveElement(n),this.focusedRowIndex=n.closest(".e-rowcell")?n.parentElement.rowIndex:n.closest(".e-chart-row")?n.closest(".e-chart-row").rowIndex:-1,"tab"===e.action),r=this.getNextElement(n,o,i);if(r&&("noNextRow"===r||r.classList.contains("e-rowdragheader"))&&("noNextRow"===r&&0<this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length&&this.parent.treeGrid.saveCell(),r=null),r&&n.classList.contains("e-headercell")){var s=parseInt(r.getAttribute("aria-colindex"),10)-1;if("shiftTab"===e.action){for(;-1!==s&&!this.parent.treeGrid.columns[s].visible;)s-=1;if(-1!==s)s=this.parent.allowRowDragAndDrop?s+1:s,r=document.getElementsByClassName("e-columnheader")[0].childNodes[s];else for(var a=document.getElementsByClassName("e-toolbar-item").length-1;0<a;a--)if(!document.getElementsByClassName("e-toolbar-item")[a].classList.contains("e-hidden")){r=document.getElementsByClassName("e-toolbar-item")[a],this.currentToolbarIndex=a;break}}else{for(;!this.parent.treeGrid.columns[s].visible;)s+=1;s=this.parent.allowRowDragAndDrop?s+1:s,r=document.getElementsByClassName("e-columnheader")[0].childNodes[s]}}if(!(r=!r&&n.classList.contains("e-headercell")&&"tab"===e.action?document.getElementsByClassName("e-timeline-header-container")[0]:r)&&(n.classList.contains("e-headercell")||n.classList.contains("e-toolbar-item")||n.classList.contains("e-treegrid")||n.classList.contains("e-input")||n.classList.contains("e-btn"))&&this.parent.toolbarModule&&0<this.parent.toolbar.length){var l=-1!==this.currentToolbarIndex?"tab"===e.action?this.currentToolbarIndex+1:this.currentToolbarIndex-1:"shiftTab"===e.action?t.length-1:1,h=!1;if(-1!==l&&("shiftTab"===e.action||"tab"===e.action&&l<t.length))for(;t[l].classList.contains("e-hidden")?"tab"===e.action?l++:l--:((r=t[l]).setAttribute("tabindex","-1"),r.querySelector(".e-btn")===n&&("tab"===e.action?l++:l--,r=t[l]),r.querySelector(".e-btn")&&r.querySelector(".e-btn").setAttribute("tabindex","0"),h=!0,this.currentToolbarIndex=l),!h;);}if("tab"===e.action&&!r&&this.currentToolbarIndex===t.length-1&&(n.classList.contains("e-toolbar-item")||n.classList.contains("e-input")||n.classList.contains("e-btn")))for(a=0;a<this.parent.treeGrid.columns.length;a++)if(this.parent.treeGrid.columns[a].visible){r=document.getElementsByClassName("e-columnheader")[0].childNodes[a];break}if("shiftTab"!==e.action||r||n.classList.contains("e-headercell")||(r=document.getElementsByClassName("e-timeline-header-container")[0]),"shiftTab"===e.action&&n.classList.contains("e-timeline-header-container"))for(a=this.parent.treeGrid.columns.length;0<a;a--)if(this.parent.treeGrid.columns[a-1].visible){r=document.getElementsByClassName("e-columnheader")[0].childNodes[a-1];break}if(je(this.tempNextElement=r)||je(r.cellIndex)||(this.parent.allowRowDragAndDrop?(this.childrenIndex=r.cellIndex,this.nextElementIndex=r.cellIndex-1):(this.childrenIndex=r.cellIndex,this.nextElementIndex=r.cellIndex),-1===this.nextElementIndex||this.parent.ganttColumns[this.nextElementIndex].allowEditing||this.parent.ganttColumns[this.nextElementIndex].field===this.parent.taskFields.id?this.isEditableElement=!1:this.isEditableElement=!0),"noNextRow"===r)this.manageFocus(n,"remove",!0);else if("string"!=typeof r)if(n.closest(".e-chart-row-cell")&&r.closest(".e-rowcell")&&(this.preventScrollIntoView=!0),(n.classList.contains("e-rowcell")||n.closest(".e-chart-row-cell")||n.classList.contains("e-headercell")||n.closest(".e-segmented-taskbar")||n.classList.contains("e-timeline-header-container"))&&e.preventDefault(),o&&n.classList.contains("e-rowdragdrop"))this.parent.treeGrid.grid.notify("key-pressed",e);else{if(n.classList.contains("e-rowcell")&&r&&r.classList.contains("e-rowcell")||n.classList.contains("e-headercell"))if(o){if(this.parent.editSettings.allowNextRowEdit){var d=this.parent.currentViewData[this.focusedRowIndex],p=this.parent.ganttColumns[parseInt(r.getAttribute("aria-colindex"),10)-1].field;d.hasChildRecords?p===this.parent.taskFields.endDate||p===this.parent.taskFields.duration||p===this.parent.taskFields.dependency||p===this.parent.taskFields.progress||p===this.parent.taskFields.work||p===this.parent.taskFields.type||"taskType"===p?(this.parent.treeGrid.grid.endEdit(),this.parent.treeGrid.grid.notify("key-pressed",e)):p===this.parent.taskFields.name||p===this.parent.taskFields.startDate?this.parent.treeGrid.grid.notify("key-pressed",e):(this.parent.treeGrid.grid.notify("key-pressed",e),i&&this.parent.treeGrid.editCell(this.focusedRowIndex,p)):this.parent.treeGrid.grid.notify("key-pressed",e)}else if(!r||!r.classList.contains("e-headercell")&&!r.classList.contains("e-timeline-header-container")){n.classList.contains("e-headercell")&&this.manageFocus(n,"remove",!1);var c=r;if(!(g=this.parent.currentViewData[n.parentElement.rowIndex]).hasChildRecords||this.parent.ganttColumns[parseInt(c.getAttribute("aria-colindex"),10)-1].field!==this.parent.taskFields.progress&&this.parent.ganttColumns[parseInt(c.getAttribute("aria-colindex"),10)-1].allowEditing||this.parent.ganttColumns[parseInt(c.getAttribute("aria-colindex"),10)-1].field===this.parent.taskFields.id||!n.classList.contains("e-editedbatchcell"))r&&!n.classList.contains("e-editedbatchcell")||this.parent.treeGrid.grid.notify("key-pressed",e);else{var u=void 0;for(c=this.updateElement(c,u,o,i,g);!this.parent.ganttColumns[parseInt(c.getAttribute("aria-colindex"),10)-1].allowEditing;)c=this.getNextElement(c,o,i);c=this.updateElement(c,u,o,i,g)}}}else if(r&&!r.classList.contains("e-headercell")&&r.classList.contains("e-rowcell")&&!r.classList.contains("e-toolbar-item")){var g,c=r;if(!(g=this.parent.currentViewData[n.parentElement.rowIndex]).hasChildRecords||this.parent.ganttColumns[parseInt(c.getAttribute("aria-colindex"),10)-1].field!==this.parent.taskFields.progress&&this.parent.ganttColumns[parseInt(c.getAttribute("aria-colindex"),10)-1].allowEditing||this.parent.ganttColumns[parseInt(c.getAttribute("aria-colindex"),10)-1].field===this.parent.taskFields.id||!n.classList.contains("e-editedbatchcell"))if(parseInt(c.parentElement.getAttribute("aria-rowindex"),10)-1!=0&&parseInt(c.getAttribute("aria-colindex"),10)-1==0&&this.parent.ganttColumns[parseInt(c.getAttribute("aria-colindex"),10)-1].field===this.parent.taskFields.id&&n.classList.contains("e-editedbatchcell")){var p=n.parentElement.rowIndex,p=this.getNextRowElement(p,o,!0);if(c=this.getChildElement(p,o),!(d=this.parent.flatData[parseInt(p.getAttribute("aria-rowindex"),10)-1]).hasChildRecords||this.parent.ganttColumns[parseInt(c.getAttribute("aria-colindex"),10)-1].allowEditing&&this.parent.ganttColumns[parseInt(c.getAttribute("aria-colindex"),10)-1].field!==this.parent.taskFields.progress)this.parent.treeGrid.grid.notify("key-pressed",e);else{u=void 0;for(c=this.updateElement(c,u,o,i,d);!this.parent.ganttColumns[parseInt(c.getAttribute("aria-colindex"),10)-1].allowEditing;)c=this.getNextElement(c,o,i);c=this.updateElement(c,u,o,i,d)}}else this.parent.treeGrid.grid.notify("key-pressed",e);else{var u=void 0;for(c=this.updateElement(c,u,o,i,g);!this.parent.ganttColumns[parseInt(c.getAttribute("aria-colindex"),10)-1].allowEditing;)c=this.getNextElement(c,o,i);c=this.updateElement(c,u,o,i,g)}}0<this.parent.element.querySelectorAll(".e-focused").length&&this.manageFocus(this.parent.element.querySelectorAll(".e-focused")[0],"remove",!1),this.parent.editModule&&this.parent.editModule.cellEditModule&&!je(this.parent.editModule.cellEditModule.editedColumn)||r&&(n.classList.contains("e-rowcell")?this.manageFocus(n,"remove",!1):this.manageFocus(n,"remove",!0),r.classList.contains("e-rowcell")&&n.nextElementSibling&&!n.classList.contains("e-timeline-header-container")||n.classList.contains("e-right-label-container")?(n.classList.contains("e-rowcell")||(this.parent.treeGrid.grid.notify("key-pressed",e),(p=R("focusModule",this.parent.treeGrid.grid)).currentInfo.element=r,p.currentInfo.elementToFocus=r,p.content.matrix.current=[r.parentElement.rowIndex,r.cellIndex]),this.manageFocus(r,"add",!1)):r&&(r.classList.contains("e-toolbar-item")||r.classList.contains("e-headercell")||r.classList.contains("e-rowcell"))?(this.manageFocus(n,"remove",!1),r.classList.contains("e-toolbar-item")||this.manageFocus(r,"add",!1),n.classList.contains("e-treegrid")&&e.preventDefault()):this.manageFocus(r,"add",!0),this.parent.focusModule.setActiveElement(r))}}},QGt.prototype.getNextElement=function(e,t,i){if(e.classList.contains("e-timeline-header-container")&&t)return r=this.getNextRowElement(-1,t,!0),this.getChildElement(r,t);var n=t?e.nextElementSibling:e.previousElementSibling;if(e.parentElement.classList.contains("e-taskbar-main-container")){if(this.parent.labelSettings.rightLabel&&t)return e.parentElement.nextElementSibling;if(!t&&this.parent.labelSettings.leftLabel)return e.parentElement.previousElementSibling}for(;n&&n.parentElement.classList.contains("e-row");){if(!n.matches(".e-hide")&&!n.matches(".e-rowdragdrop"))return n;n=t?n.nextElementSibling:n.previousElementSibling}if(je(n)||!n.classList.contains("e-taskbar-main-container")&&!n.classList.contains("e-right-connectorpoint-outer-div")||!je((o=this.parent.currentViewData[this.focusedRowIndex]).ganttProperties.segments)&&0<o.ganttProperties.segments.length&&(n=n.classList.contains("e-right-connectorpoint-outer-div")?n.parentElement.nextElementSibling:n.getElementsByClassName("e-gantt-child-taskbar-inner-div")[0]),this.validateNextElement(n))return n;var o=-1,r=null;if(e.classList.contains("e-rowcell")&&i&&this.parent.editSettings.allowNextRowEdit)return o=e.parentElement.rowIndex,r=this.getNextRowElement(o,t,!0),this.getChildElement(r,t);if(e.classList.contains("e-rowcell"))if(o=e.parentElement.rowIndex,t){if(r=this.parent.getRowByIndex(o),0<this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length)return r=this.getNextRowElement(o,t,!0),this.getChildElement(r,t);if(this.validateNextElement(r,"e-left-label-container"))return r.getElementsByClassName("e-left-label-container")[0];if(this.validateNextElement(r,"e-taskbar-main-container"))return r.getElementsByClassName("e-taskbar-main-container")[0];if(this.validateNextElement(r,"e-right-label-container"))return r.getElementsByClassName("e-right-label-container")[0]}else{if(r=this.getNextRowElement(o,t,!1),this.validateNextElement(r,"e-right-label-container"))return r.getElementsByClassName("e-right-label-container")[0];if(this.validateNextElement(r,"e-taskbar-main-container"))return r.getElementsByClassName("e-taskbar-main-container")[0];if(this.validateNextElement(r,"e-left-label-container"))return r.getElementsByClassName("e-left-label-container")[0]}else if(e.parentElement.classList.contains("e-chart-row-cell")||e.parentElement.parentElement.classList.contains("e-chart-row-cell"))return o=z(e,".e-chart-row").rowIndex,r=t?(!t&&this.parent.virtualScrollModule&&this.parent.enableVirtualization&&(i=this.parent.currentViewData[o],o=this.parent.flatData.indexOf(i)),this.getNextRowElement(o,t,!0)):this.parent.treeGrid.getRows()[o],this.getChildElement(r,t);return n=e,null},QGt.prototype.getNextRowElement=function(e,t,i){var n=this.parent.getExpandedRecords(this.parent.currentViewData),e=this.parent.currentViewData[e],e=n.indexOf(e),t=t?n[e+1]:n[e-1],n=this.parent.currentViewData.indexOf(t);return t?i?this.parent.treeGrid.getRows()[n]:this.parent.getRowByIndex(n):null},QGt.prototype.validateNextElement=function(e,t){return!((!e||!e.classList.contains("e-rowcell"))&&(e&&t?!(t=e.getElementsByClassName(t)[0])||!t.hasChildNodes():!e||je(e)||!e.hasChildNodes()))},QGt.prototype.getChildElement=function(e,t){var i;if(!e)return"noNextRow";for(i=t?e.children[0]:e.children[e.children.length-1];i;){if(!i.matches(".e-hide")&&!i.matches(".e-rowdragdrop"))return i;i=t?i.nextElementSibling:i.previousElementSibling}return i},QGt.prototype.manageFocus=function(e,t,i,n){var o;i?(i=null,e.classList.contains("e-left-label-container")||e.classList.contains("e-right-label-container")?i=e.getElementsByTagName("span")[0]:(e.classList.contains("e-taskbar-main-container")||e.classList.contains("e-gantt-child-taskbar-inner-div"))&&(o=z(e,".e-chart-row").rowIndex,o=(o=this.parent.currentViewData[o]).hasChildRecords?o.ganttProperties.isAutoSchedule?"e-gantt-parent-taskbar":"e-manualparent-main-container":o.ganttProperties.isMilestone?"e-gantt-milestone":!je(o.ganttProperties.segments)&&0<o.ganttProperties.segments.length?"e-segmented-taskbar":"e-gantt-child-taskbar",je(i=e.getElementsByClassName(o)[0]))&&(i=e),(e.classList.contains("e-right-label-temp-container")||e.classList.contains("e-left-label-temp-container")||e.classList.contains("e-indicator-span")||e.classList.contains("e-timeline-header-container"))&&("add"===t?(e.setAttribute("tabIndex","0"),U([e],"e-active-container"),e.focus()):"downArrow"!==n&&"upArrow"!==n&&(q([e],"e-active-container"),e.setAttribute("tabIndex","-1"),e.blur())),"add"!==t||je(i)?je(i)||"downArrow"===n||"upArrow"===n||(q([i],"e-active-container"),e.setAttribute("tabIndex","-1"),e.blur()):(e.setAttribute("tabIndex","0"),U([i],"e-active-container"),e.focus(),this.focusedElement=i)):"add"===t?(e.setAttribute("tabIndex","0"),U([e],["e-focused","e-focus"]),this.preventScrollIntoView||e.scrollIntoView({block:"nearest",inline:"nearest"}),this.preventScrollIntoView=!1,e.focus()):(e.setAttribute("tabIndex","-1"),q([e],["e-focused","e-focus"]),e.blur())},QGt.prototype.getIndexByTaskBar=function(e){var t=e.classList.contains(Rqt)?e:z(e,"div."+Rqt);return je(t)?(t=z(e,"tr."+Uqt),[].slice.call(this.parent.chartRowsModule.ganttChartTableBody.childNodes).indexOf(t)):(e=t.getAttribute("rowUniqueId"),t=this.parent.getRecordByID(e),this.parent.enableVirtualization&&this.parent.enableMultiTaskbar?this.parent.flatData.indexOf(t):this.parent.pdfExportModule&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth&&this.parent.pdfExportModule.isPdfExport?this.parent.ids.indexOf(t.ganttProperties.taskId.toString()):this.parent.currentViewData.indexOf(t))},QGt.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents(),this.chartElement=null,this.rangeViewContainer=null,this.chartBodyContent=null,this.scrollElement=null,this.chartTimelineContainer=null,this.chartBodyContainer=null,je(this.scrollObject)||(this.scrollObject.destroy(),this.scrollObject=null)};var WGt=QGt;function QGt(e){this.isExpandCollapseFromChart=!1,this.isExpandAll=!1,this.isCollapseAll=!1,this.debounceTimeoutNext=0,this.debounceTimeout=0,this.isGanttElement=!1,this.previousPinchDistance=0,this.currentToolbarIndex=-1,this.isPinching=!1,this.preventScrollIntoView=!1,this.parent=e,this.chartTimelineContainer=null,this.rangeViewContainer=Q("div",{className:NGt}),this.rangeViewContainer.setAttribute("role","button"),this.rangeViewContainer.setAttribute("aria-label","RangeContainer"),this.virtualRender=new zGt(this.parent),this.addEventListener()}var UGt=function(){return(UGt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},qGt=(GGt.prototype.initProperties=function(){this.timelineStartDate=null,this.timelineEndDate=null,this.totalTimelineWidth=0,this.customTimelineSettings=null,this.parent.isTimelineRoundOff=!this.isZoomToFit&&!!je(this.parent.projectStartDate),this.parent.enablePersistence&&this.parent.isLoad&&(this.parent.timelineSettings=this.parent.currentZoomingLevel)},GGt.prototype.validateTimelineProp=function(){this.roundOffDays(),this.processTimelineProperty(),this.timelineWidthCalculation()},GGt.prototype.refreshTimeline=function(){this.initProperties(),this.processTimelineUnit(),this.parent.dataOperation.calculateProjectDates(),this.parent.isFromOnPropertyChange||this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff);var e=this.parent.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight;this.parent.element.getElementsByClassName("e-gridcontent")[0].style.height="calc(100% - "+e+"px)",this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].style.height="calc(100% - "+e+"px)"},GGt.prototype.refreshTimelineByTimeSpan=function(){this.validateTimelineProp(),(!this.parent.pdfExportModule||this.parent.pdfExportModule&&!this.parent.pdfExportModule.isPdfExport||this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&!this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)&&(this.parent.ganttChartModule.chartTimelineContainer.innerHTML=""),this.createTimelineSeries()},GGt.prototype.updateChartByNewTimeline=function(){this.parent.chartRowsModule.refreshChartByTimeline();var e=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].scrollLeft;this.parent.element.getElementsByClassName("e-timeline-header-container")[0].scrollLeft=e,this.parent.notify("refreshDayMarkers",{})},GGt.prototype.processZooming=function(e){this.parent.isReact&&this.parent.clearTemplate(["TaskbarTemplate","ParentTaskbarTemplate","MilestoneTemplate","TaskLabelTemplate","RightLabelTemplate","LeftLabelTemplate"]),this.isZoomToFit=this.isZoomedToFit=!1,this.updateUndoRedo(e),this.parent.isProjectDateUpdated||this.parent.dateValidationModule.calculateProjectDates(),this.parent.zoomingProjectStartDate&&(this.parent.cloneProjectStartDate=this.parent.zoomingProjectStartDate,this.parent.cloneProjectEndDate=this.parent.zoomingProjectEndDate),this.parent.zoomingProjectStartDate=this.parent.zoomingProjectEndDate=null;var t=this.checkCurrentZoomingLevel(),i=(this.isZoomIn=e,this.isZooming=!0,this.getZoomLevel(t,e)),i=(this.updateToolbar(i,e),this.parent.zoomingLevels.findIndex(function(e){return e.level===i})),t={requestType:e?"beforeZoomIn":"beforeZoomOut",timeline:this.parent.zoomingLevels[i],cancel:!1};this.parent.trigger("actionBegin",t),je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),t.cancel||this.changeTimelineSettings(t.timeline),this.isZooming=!1},GGt.prototype.updateUndoRedo=function(e){var e=e?"ZoomIn":"ZoomOut";this.parent.undoRedoModule&&this.parent.isUndoRedoItemPresent(e)&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),e={action:e,previousZoomingLevel:Pe({},{},this.parent.currentZoomingLevel,!0)},this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=e)},GGt.prototype.getZoomLevel=function(e,t){var i=e+(t?1:-1);return this.parent.zoomingLevels.find(function(e){return e.level===i})?i:e},GGt.prototype.updateToolbar=function(e,t){this.parent.toolbarModule&&(t?(e===this.parent.zoomingLevels[this.parent.zoomingLevels.length-1].level&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1),this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!0)):(e===this.parent.zoomingLevels[0].level&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1),this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!0)))},GGt.prototype.changeTimelineSettings=function(i){var n=this,o=(this.isZoomToFit?this.isSingleTier="None"===this.customTimelineSettings.topTier.unit||"None"===this.customTimelineSettings.bottomTier.unit:this.isZoomIn||(this.isSingleTier="None"===i.topTier.unit||"None"===i.bottomTier.unit),this.isSingleTier?"None"===this.customTimelineSettings.topTier.unit?"topTier":"bottomTier":null),e=(Object.keys(this.customTimelineSettings).forEach(function(e){var t;e!==o?n.customTimelineSettings[e]="object"!=typeof i[e]||je(i[e])?i[e]:UGt({},i[e]):"None"!==i[t="bottomTier"].unit&&(n.customTimelineSettings["topTier"===e?"bottomTier":"topTier"]=UGt({},i[t]))}),this.parent.isTimelineRoundOff=!this.isZoomToFit&&!!je(this.parent.projectStartDate),this.processTimelineUnit(),this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff),this.parent.criticalPathModule),e=(this.parent.enableCriticalPath&&e&&e.criticalPathCollection&&e.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds),(this.isZooming||this.isZoomToFit)&&(e={requestType:this.isZoomIn?"AfterZoomIn":this.isZoomToFit?"AfterZoomToProject":"AfterZoomOut",timeline:this.parent.currentZoomingLevel},this.parent.trigger("actionComplete",e),je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()),"None"===this.topTier?"bottomTier":"topTier");this.parent.enableTimelineVirtualization&&(!this.parent.pdfExportModule||this.parent.pdfExportModule&&!this.parent.pdfExportModule.isPdfExport)&&(this.wholeTimelineWidth=this.calculateWidthBetweenTwoDate(e,this.parent.timelineModule.timelineStartDate,this.parent.timelineModule.timelineEndDate),this.wholeTimelineWidth<=this.totalTimelineWidth&&(this.wholeTimelineWidth=this.totalTimelineWidth),this.isZoomToFit?(this.clientWidthDifference=Math.abs(this.wholeTimelineWidth-this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].clientWidth)+1,this.parent.element.querySelectorAll(".e-chart-scroll-container")[0].querySelector(".e-virtualtrack").style.width=this.wholeTimelineWidth-this.clientWidthDifference+"px",je(this.parent.element.querySelectorAll(".e-timeline-header-container")[0].querySelector(".e-virtualtrack"))||(this.parent.element.querySelectorAll(".e-timeline-header-container")[0].querySelector(".e-virtualtrack").style.width=this.wholeTimelineWidth-this.clientWidthDifference+"px")):(this.parent.element.querySelectorAll(".e-chart-scroll-container")[0].querySelector(".e-virtualtrack").style.width=this.wholeTimelineWidth+"px",je(this.parent.element.querySelectorAll(".e-timeline-header-container")[0].querySelector(".e-virtualtrack"))||(this.parent.element.querySelectorAll(".e-timeline-header-container")[0].querySelector(".e-virtualtrack").style.width=this.wholeTimelineWidth+"px")),this.parent.ganttChartModule.updateWidthAndHeight())},GGt.prototype.processZoomToFit=function(){this.parent.isReact&&this.parent.clearTemplate(["TaskbarTemplate","ParentTaskbarTemplate","MilestoneTemplate","TaskLabelTemplate","RightLabelTemplate","LeftLabelTemplate"]),this.isZoomToFit=!0,this.isZooming=!1,this.isZoomedToFit=!0;var e,t,i,n={},n=(this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.isUndoRedoItemPresent("ZoomToFit")&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),n.action="ZoomToFit",n.previousTimelineStartDate=Pe([],[],[this.parent.cloneProjectStartDate],!0)[0],n.previousTimelineEndDate=Pe([],[],[this.parent.cloneProjectEndDate],!0)[0],n.previousZoomingLevel=Pe({},{},this.parent.currentZoomingLevel,!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=n),this.parent.zoomingProjectStartDate||(this.parent.zoomingProjectStartDate=this.parent.cloneProjectStartDate,this.parent.zoomingProjectEndDate=this.parent.cloneProjectEndDate),this.parent.zoomingProjectStartDate>this.parent.cloneProjectStartDate&&(this.parent.cloneProjectStartDate=new Date(this.parent.allowUnscheduledTasks?this.parent.zoomingProjectStartDate:this.parent.cloneProjectStartDate)),this.parent.dataOperation.calculateProjectDates(),this.parent.cloneProjectEndDate.getTime()-this.parent.cloneProjectStartDate.getTime()),o=this.parent.ganttChartModule.chartElement.offsetWidth,r=o/(n/864e5),s=this.parent.zoomingLevels.slice().sort(function(e,t){return e.perDayWidth||t.perDayWidth?e.perDayWidth<t.perDayWidth?1:-1:0});if(0!=r){for(var a=0;a<s.length;a++){if(t=s[a],a===s.length-1){e=s[a];break}if(i=s[a+1],r>=t.perDayWidth){e=s[a];break}if(r<t.perDayWidth&&r>i.perDayWidth){e=s[a+1];break}}var n=Pe({},{},e,!0),l=(this.roundOffDateToZoom(this.parent.cloneProjectStartDate,!0,r,n.bottomTier.unit,e),this.roundOffDateToZoom(this.parent.cloneProjectEndDate,!1,r,n.bottomTier.unit,e),this.calculateNumberOfTimelineCells(n)),h=this.parent.ganttChartModule.scrollElement.offsetHeight-17,d=this.parent.ganttChartModule.chartBodyContent.offsetHeight,o=(n.timelineUnitSize=Math.abs(o-(d<=h?0:17))/l,{requestType:"beforeZoomToProject",timeline:n});this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin",this.parent.controlId+"_zoomout"],!0),this.parent.trigger("actionBegin",o),je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),this.changeTimelineSettings(n),this.parent.isTimelineRoundOff=!!je(this.parent.projectStartDate),this.isZoomToFit=!1}},GGt.prototype.bottomTierCellWidthCalc=function(e,t,i){switch(e){case"Minutes":o=6e4*t.bottomTier.count;break;case"Hour":o=36e5*t.bottomTier.count;break;case"Week":o=6048e5*t.bottomTier.count;break;case"Day":o=864e5*t.bottomTier.count;break;case"Month":var n=new Date(i.getFullYear(),i.getMonth()+1,0).getDate(),o=t.bottomTier.count*(86400*n*1e3);break;case"Year":n=i.getFullYear()%400==0||i.getFullYear()%100!=0&&i.getFullYear()%4==0?366:365;o=t.bottomTier.count*(86400*n*1e3)}return o},GGt.prototype.roundOffDateToZoom=function(e,t,i,n,o){n=this.bottomTierCellWidthCalc(n,o,e);t?e.setTime(e.getTime()-n):e.setTime(e.getTime()+n)},GGt.prototype.calculateNumberOfTimelineCells=function(e){var t=new Date(this.parent.cloneProjectStartDate.getTime()),i=new Date(this.parent.cloneProjectEndDate.getTime()),i=(this.parent.dateValidationModule.updateDateWithTimeZone(t,i),Math.abs((i.getTime()-t.getTime())/864e5)),t=e.bottomTier.count,e=e.bottomTier.unit;return"Day"===e?i/t:"Week"===e?i/t/7:"Month"===e?i/t/28:"Year"===e?i/t/336:"Hour"===e?i*(24/t):i*(1440/t)},GGt.prototype.processTimelineUnit=function(){var e=["Year","Month","Week","Day","Hour","Minutes"];this.customTimelineSettings=this.customTimelineSettings||this.extendFunction(this.parent.timelineSettings,["timelineViewMode","timelineUnitSize","weekStartDay","weekendBackground"],{topTier:["unit","format","count","formatter"],bottomTier:["unit","format","count","formatter"]}),-1===e.indexOf(this.customTimelineSettings.topTier.unit)&&-1===e.indexOf(this.customTimelineSettings.bottomTier.unit)?(this.customTimelineSettings.topTier.unit=-1!==e.indexOf(this.customTimelineSettings.timelineViewMode)?this.customTimelineSettings.timelineViewMode:"Week",this.customTimelineSettings.bottomTier.unit=5!==e.indexOf(this.customTimelineSettings.topTier.unit)?e[e.indexOf(this.customTimelineSettings.topTier.unit)+1]:"None"):-1!==e.indexOf(this.customTimelineSettings.topTier.unit)&&-1!==e.indexOf(this.customTimelineSettings.bottomTier.unit)&&e.indexOf(this.customTimelineSettings.topTier.unit)>e.indexOf(this.customTimelineSettings.bottomTier.unit)?this.customTimelineSettings.bottomTier.unit=this.customTimelineSettings.topTier.unit:(this.customTimelineSettings.topTier.unit=-1===e.indexOf(this.customTimelineSettings.topTier.unit)?"None":this.customTimelineSettings.topTier.unit,this.customTimelineSettings.bottomTier.unit=-1===e.indexOf(this.customTimelineSettings.bottomTier.unit)?"None":this.customTimelineSettings.bottomTier.unit),this.topTier=this.customTimelineSettings.topTier.unit,this.bottomTier=this.customTimelineSettings.bottomTier.unit,this.previousIsSingleTier=this.isSingleTier,this.isSingleTier="None"===this.topTier||"None"===this.bottomTier},GGt.prototype.processTimelineProperty=function(){this.customTimelineSettings.topTier.count="None"===this.topTier?1:this.validateCount(this.customTimelineSettings.topTier.unit,this.customTimelineSettings.topTier.count,"topTier"),this.customTimelineSettings.bottomTier.count="None"===this.customTimelineSettings.bottomTier.unit?1:this.validateCount(this.customTimelineSettings.bottomTier.unit,this.customTimelineSettings.bottomTier.count,"bottomTier"),this.customTimelineSettings.bottomTier.format=this.validateFormat(this.customTimelineSettings.bottomTier.unit,this.customTimelineSettings.bottomTier.format),this.customTimelineSettings.topTier.format=this.validateFormat(this.topTier,this.customTimelineSettings.topTier.format),this.customTimelineSettings.weekStartDay=0<=this.customTimelineSettings.weekStartDay&&this.customTimelineSettings.weekStartDay<=6?this.customTimelineSettings.weekStartDay:0,this.parent.pdfExportModule&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth||this.checkCurrentZoomingLevel()},GGt.prototype.calculateZoomingLevelsPerDayWidth=function(){for(var e=this.parent.zoomingLevels,t=0;t<e.length;t++){var i=this.getPerDayWidth(e[t].timelineUnitSize,e[t].bottomTier.count,e[t].bottomTier.unit);e[t].perDayWidth=i}},GGt.prototype.checkCurrentZoomingLevel=function(){var e=("None"!==this.customTimelineSettings.bottomTier.unit?this.customTimelineSettings.bottomTier:this.customTimelineSettings.topTier).count,t=("None"!==this.customTimelineSettings.bottomTier.unit?this.customTimelineSettings.bottomTier:this.customTimelineSettings.topTier).unit,i="None"!==this.customTimelineSettings.bottomTier.unit?"bottomTier":"topTier",t=this.getCurrentZoomingLevel(t,e,i);return this.parent.toolbarModule&&(t===this.parent.zoomingLevels[this.parent.zoomingLevels.length-1].level?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):t===this.parent.zoomingLevels[0].level&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),this.parent.currentZoomingLevel=this.parent.zoomingLevels[t],t},GGt.prototype.getCurrentZoomingLevel=function(t,e,i){this.parent.zoomingLevels.length||(this.parent.zoomingLevels=this.parent.getZoomingLevels());for(var n,o,r,s,a,l,h=this.parent.zoomingLevels.filter(function(e){return"bottomTier"===i?e.bottomTier.unit===t:e.topTier.unit===t}),d=(0===h.length&&(l=this.getClosestUnit(t,"",!1),h=this.parent.zoomingLevels.filter(function(e){return"bottomTier"===i?e.bottomTier.unit===l:e.topTier.unit===l})),h.sort(function(e,t){return"bottomTier"===i?e.bottomTier.count&&t.bottomTier.count?e.bottomTier.count<t.bottomTier.count?1:-1:0:e.topTier.count&&t.topTier.count?e.topTier.count<t.topTier.count?1:-1:0})),p=0;p<d.length;p++){if(a=d[p],p===d.length-1){n=d[p].level;break}if(s=d[p+1],e>=a[""+i].count){o=d[p],n=1<(r=d.filter(function(e){return"bottomTier"===i?e.bottomTier.count===o.bottomTier.count:e.topTier.count===o.topTier.count})).length?this.checkCollectionsWidth(r):r[0].level;break}if(e<a[""+i].count&&e>s[""+i].count){o=d[p+1],n=1<(r=d.filter(function(e){return"bottomTier"===i?e.bottomTier.count===o.bottomTier.count:e.topTier.count===o.topTier.count})).length?this.checkCollectionsWidth(r):r[0].level;break}}return n},GGt.prototype.getClosestUnit=function(t,e,i){var n=["Year","Month","Week","Day","Hour","Minutes"],o=n.indexOf(t);return 0===o&&(i=!0),t=this.isZoomIn||i?n[o+1]:n[o-1],0===this.parent.zoomingLevels.filter(function(e){return e.bottomTier.unit===t}).length?("Year"===t&&(i=!0),e=t,this.getClosestUnit(t,e,i)):t},GGt.prototype.checkCollectionsWidth=function(e){for(var t,i,n,o=this.customTimelineSettings.timelineUnitSize,r=e.sort(function(e,t){return e.timelineUnitSize<t.timelineUnitSize?1:-1}),s=0;s<r.length;s++){if(n=r[s],s===r.length-1){t=r[s].level;break}if(i=r[s+1],o>=n.timelineUnitSize){t=r[s].level;break}if(o<n.timelineUnitSize&&o>i.timelineUnitSize){t=r[s+1].level;break}}return t},GGt.prototype.updateTimelineHeaderHeight=function(){var e;this.parent.timelineModule.isSingleTier?this.parent.element.classList.add(xqt):this.parent.element.classList.remove(xqt),this.previousIsSingleTier!==this.isSingleTier&&(e=0,je(this.parent.toolbarModule)||je(this.parent.toolbarModule.element)||(e=this.parent.toolbarModule.element.offsetHeight),this.parent.ganttChartModule.scrollObject.setHeight(this.parent.ganttHeight-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight-e),this.parent.treeGrid.height=this.parent.ganttHeight-e-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight)},GGt.prototype.dateByLeftValue=function(e,t,i){var n=new Date(this.parent.timelineModule.timelineStartDate.toString()),o=864e5/this.parent.perDayWidth,o=(n.setTime(n.getTime()+e*o),t&&!je(i.predecessorsName)&&""!==i.predecessorsName&&(n.setDate(n.getDate()-1),e=this.parent.getCurrentDayEndTime(i.isAutoSchedule?i.autoEndDate:i.endDate),this.parent.dateValidationModule.setTime(e,n),n=this.parent.dateValidationModule.checkStartDate(n,i,!0)),"None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.topTier:this.parent.timelineModule.bottomTier);return"Hour"!==o&&"Minutes"!==o&&(this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&!this.parent.isInDst(n)?n.setTime(n.getTime()+36e5):!this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&this.parent.isInDst(n)&&n.setTime(n.getTime()-36e5)),n},GGt.prototype.createTimelineSeries=function(){var e,t,i,n,o,r=this.isSingleTier?1:2,s="None"===this.topTier?"bottomTier":"topTier";if(this.topTierCollection=[],this.bottomTierCollection=[],!0===this.restrictRender&&(this.updateTimelineHeaderHeight(),this.wholeTimelineWidth=this.calculateWidthBetweenTwoDate(s,this.parent.timelineModule.timelineStartDate,this.parent.timelineModule.timelineEndDate)),this.parent.enableTimelineVirtualization&&this.wholeTimelineWidth>3*this.parent.element.offsetWidth){for(var a=0;a<r;a++){(i=Q("table",{className:Mqt,styles:"display: block;"})).setAttribute("role","none");var l=Q("thead",{className:kqt,styles:"display:block; border-collapse:collapse"}),h=this.createTimelineTemplate(s),d=Q("tr");Array.from(h.childNodes).forEach(function(e){d.appendChild(e)}),e=Q("td"),t=Q("div",{styles:"width: 20px"}),n=Q("div",{className:"e-virtualtable"}),o=Q("div",{className:"e-virtualtrack"}),e.appendChild(t),d.appendChild(e),n.appendChild(d),l.appendChild(n),l.appendChild(o),i.appendChild(l),this.parent.ganttChartModule.chartTimelineContainer.appendChild(i),d=null,this.restrictRender=!(s="bottomTier")}"auto"!==this.parent.height&&!this.parent.timelineModule.isSingleTier||(p=this.parent.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight,this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].style.height="calc(100% - "+p+"px)",je(this.parent.element.getElementsByClassName("e-gridcontent")[0]))||(this.parent.treeGrid.element.getElementsByClassName("e-gridcontent")[0].style.height="calc(100% - "+p+"px)"),this.timelineVirtualizationStyles()}else{for(var p,a=0;a<r;a++){(i=Q("table",{className:Mqt,styles:"display: block;"})).setAttribute("role","none"),l=Q("thead",{className:kqt,styles:"display:block; border-collapse:collapse"});h=this.createTimelineTemplate(s);d=Q("tr"),Array.from(h.childNodes).forEach(function(e){d.appendChild(e)}),e=Q("td"),t=Q("div",{styles:"width: 20px"}),e.appendChild(t),d.appendChild(e),l.appendChild(d),i.appendChild(l),this.parent.ganttChartModule.chartTimelineContainer.appendChild(i),s="bottomTier",d=null}this.wholeTimelineWidth=this.totalTimelineWidth,"auto"!==this.parent.height&&!this.parent.timelineModule.isSingleTier||(p=this.parent.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight,this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].style.height="calc(100% - "+p+"px)",je(this.parent.element.getElementsByClassName("e-gridcontent")[0]))||(this.parent.treeGrid.element.getElementsByClassName("e-gridcontent")[0].style.height="calc(100% - "+p+"px)")}},GGt.prototype.timelineVirtualizationStyles=function(){var e,t,i=0,n=this.wholeTimelineWidth;this.parent.enableTimelineVirtualization&&(i=this.parent.enableTimelineVirtualization&&!je(this.parent.ganttChartModule.scrollObject.element.scrollLeft)&&0!==this.parent.ganttChartModule.scrollObject.element.scrollLeft?this.parent.ganttChartModule.scrollObject.getTimelineLeft():0,this.parent.enableRtl&&(i=-i),this.parent.element.querySelectorAll(".e-chart-scroll-container")[0].querySelector(".e-virtualtable").style.transform="translate("+i+"px, 0px)",(e=this.parent.element.querySelectorAll(".e-chart-scroll-container")[0].querySelector(".e-virtualtrack")).style.position="relative",e.style.width=n+"px",this.parent.ganttChartModule.scrollObject.isSetScrollLeft&&(e=this.parent.element.querySelectorAll(".e-timeline-header-table-container")[0].querySelector(".e-virtualtable"),t=void 0,je(this.parent.element.querySelectorAll(".e-timeline-header-table-container")[1])||(t=this.parent.element.querySelectorAll(".e-timeline-header-table-container")[1].querySelector(".e-virtualtable")),e.style.transform="translate("+i+"px, 0px)",je(t)||(t.style.transform="translate("+i+"px, 0px)")),e=this.parent.element.querySelectorAll(".e-timeline-header-table-container")[0].querySelector(".e-virtualtrack"),t=void 0,je(this.parent.element.querySelectorAll(".e-timeline-header-table-container")[1])||(t=this.parent.element.querySelectorAll(".e-timeline-header-table-container")[1].querySelector(".e-virtualtrack")),je(t)||(t.style.position="relative",t.style.width=n+"px"),e.style.position="relative",e.style.width=n+"px",this.parent.connectorLineModule.svgObject.style.width=n+"px",this.parent.element.querySelector("."+Dqt).style.width="calc(100% - 17px)",this.parent.timelineModule.isZooming||this.parent.timelineModule.isZoomToFit)&&(this.parent.ganttChartModule.scrollElement.scrollLeft=0,this.isZoomingAction=!0,this.parent.ganttChartModule.scrollObject.updateChartElementStyles())},GGt.prototype.validateCount=function(e,t,i){var n,o=!je(t)&&0<parseInt(t.toString(),10)?parseInt(t.toString(),10):1,r=Math.abs(this.timelineRoundOffEndDate.getTime()-this.timelineStartDate.getTime());switch(e){case"Year":o=o<=(n=Math.round(r/864e5/336))?o:0<n?n:1,"None"!==this.topTier&&"bottomTier"===i&&(o=this.validateBottomTierCount(e,o));break;case"Month":o=o<=(n=Math.round(r/864e5/28))?o:0<n?n+1:1,"None"!==this.topTier&&"bottomTier"===i&&(o=this.validateBottomTierCount(e,o));break;case"Week":o=o<=(n=Math.round(r/864e5/7))?o:0<n?n:1,"None"!==this.topTier&&"bottomTier"===i&&(o=this.validateBottomTierCount(e,o));break;case"Day":o=o<=(n=Math.round(r/864e5))?o:0<n?n:1,"None"!==this.topTier&&"bottomTier"===i&&(o=this.validateBottomTierCount(e,o));break;case"Hour":o=o<=(n=Math.round(r/36e5))?o:0<n?n:1,"None"!==this.topTier&&"bottomTier"===i&&(o=this.validateBottomTierCount(e,o));break;case"Minutes":o=o<=(n=Math.round(r/6e4))?o:0<n?n:1,"None"!==this.topTier&&"bottomTier"===i&&(o=this.validateBottomTierCount(e,o))}return t!==o&&this.isZooming&&this.parent.toolbarModule&&("bottomTier"===i||this.isSingleTier)&&(this.isZoomIn?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),o},GGt.prototype.validateBottomTierCount=function(e,t){var i;switch(e){case"Year":i=t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Month":i="Year"===this.topTier?t<=12*this.customTimelineSettings.topTier.count?t:12*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Week":i="Year"===this.topTier?t<=48*this.customTimelineSettings.topTier.count?t:48*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=4*this.customTimelineSettings.topTier.count?t:4*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Day":i="Year"===this.topTier?t<=336*this.customTimelineSettings.topTier.count?t:336*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=28*this.customTimelineSettings.topTier.count?t:28*this.customTimelineSettings.topTier.count:"Week"===this.topTier?t<=7*this.customTimelineSettings.topTier.count?t:7*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Hour":i="Year"===this.topTier?t<=8064*this.customTimelineSettings.topTier.count?t:8064*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=672*this.customTimelineSettings.topTier.count?t:672*this.customTimelineSettings.topTier.count:"Week"===this.topTier?t<=7*this.customTimelineSettings.topTier.count*24?t:7*this.customTimelineSettings.topTier.count*24:"Day"===this.topTier?t<=24*this.customTimelineSettings.topTier.count?t:24*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Minutes":i="Year"===this.topTier?t<=483840*this.customTimelineSettings.topTier.count?t:483840*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=40320*this.customTimelineSettings.topTier.count?t:40320*this.customTimelineSettings.topTier.count:"Week"===this.topTier?t<=7*this.customTimelineSettings.topTier.count*24*60?t:7*this.customTimelineSettings.topTier.count*24*60:"Day"===this.topTier?t<=24*this.customTimelineSettings.topTier.count*60?t:24*this.customTimelineSettings.topTier.count*60:"Hour"===this.topTier?t<=60*this.customTimelineSettings.topTier.count?t:60*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count}return i},GGt.prototype.validateFormat=function(e,t){var i;switch(e){case"Week":i=t||"MMM dd, yyyy";break;case"Day":case"None":i=t||"";break;case"Hour":i=t||"H";break;case"Month":i=t||"MMM yyyy";break;case"Year":i=t||"yyyy";break;case"Minutes":i=t||"m"}return i},GGt.prototype.extendFunction=function(t,e,i){for(var n=this,o={},r=0;r<e.length;r++)o[e[r]]=t[e[r]];return i&&Object.keys(i).forEach(function(e){o[e]=n.extendFunction(t[e],i[e],null)}),o},GGt.prototype.formatDateHeader=function(e,t,i){var n,t=new Date(t.getTime());return""===e?(n=this.parent.globalize.formatDate(t,{format:"E"}),"zh"===this.parent.locale?n=n.slice(1):"ar"!==this.parent.locale&&(n=n.slice(0,1))):(n=this.parent.globalize.formatDate(t,{format:e}),i&&(n=this.updateHourInFormat(e,n,i.getHours()).updatedFormat)),n},GGt.prototype.isDateAffectedByDST=function(e){for(var t=new Date(e),i=t.getTimezoneOffset(),n=1;n<=3;n++)if(new Date(t.getTime()-60*n*60*1e3).getTimezoneOffset()!==i)return!0;return!1},GGt.prototype.calculateIteration=function(e,t,i,n){var o,r;return e.setHours(t.getHours()),this.isFirstLoop&&this.parent.isInDst(t)&&this.isDateAffectedByDST(t)&&(e.setHours(e.getHours()-1),this.increaseIteration=!0),this.isFirstLoop=!1,e.setMinutes(t.getMinutes()),e.setSeconds(t.getSeconds()),e.setMilliseconds(t.getMilliseconds()),"Hour"===i?(r=t.getHours(),o=Math.ceil((24-r)/n)):"Minutes"===i&&(r=t.getHours(),i=t.getMinutes(),o=Math.ceil((1440-(60*r+i))/n)),this.increaseIteration&&(o+=1,this.increaseIteration=!1),{iterations:o,dummystartDate:e}},GGt.prototype.updateHourInFormat=function(e,t,i){var n,o=e.match(/(h{1,2})/)||e.match(/(H{1,2})/);return!o||(o=o[0],e=e.split(/[\s,:]+/),n=t.split(/[\s,:]+/),-1===(e=e.findIndex(function(e){return e.includes("h")||e.includes("H")})))||e>=n.length?{hasHour:!1,updatedFormat:t}:(i=function(e,t){for(var i=String(e);i.length<t;)i="0"+i;return i}(i,o.length),n[e]=i,{hasHour:!0,hourIndex:e,updatedFormat:n.join(" ")})},GGt.prototype.customFormat=function(e,t,i,n,o){return(o="string"==typeof o?R(o,window):o)(e,t,i,n)},GGt.prototype.createTimelineTemplate=function(e){var t,i=!1,n=this.parent,o=Q("th"),r=("topTier"===e?n.timelineModule.customTimelineSettings.topTier:n.timelineModule.customTimelineSettings.bottomTier).unit,s=("topTier"===e?n.timelineModule.customTimelineSettings.topTier:n.timelineModule.customTimelineSettings.bottomTier).count,a=n.timelineModule.customTimelineSettings.topTier,l=n.timelineModule.customTimelineSettings.bottomTier,n=this.parent.enableTimelineVirtualization&&0!==this.parent.ganttChartModule.scrollObject.element.scrollLeft?this.parent.ganttChartModule.scrollObject.getTimelineLeft():null,h=this.parent.enableTimelineVirtualization&&!je(n)?new Date(this.dateByLeftValue(n).toString()):new Date(this.parent.timelineModule.timelineStartDate.toString()),d=new Date(this.timelineRoundOffEndDate.toString()),p=[],c=new Set,u=0,g=3*this.parent.element.offsetWidth,m=this.parent.dataOperation.hasDSTTransition(h.getFullYear()),f=new Date(2e3,0,1,0,0,0,0),y=!1;this.isFirstLoop=!0;do{var v={};v.startDate=new Date(h.getTime());if("Month"!==r&&"Hour"!==r||"bottomTier"!==e||1===s||0!==p.length||(i=!0),("Hour"===r||"Minutes"===r&&60===s||"Hour"===a.unit&&"Minutes"===l.unit)&&m){var b=this.calculateIteration(f,h,r,s),w=b.iterations;f.setTime(b.dummystartDate.getTime());for(var C=0;C<w;C++){(v={}).startDate=new Date(h.getTime()),h.getHours()!==f.getHours()&&(this.applyDstHour=!0);var S=this.getHeaterTemplateString(new Date(h.toString()),r,e,!1,s,v,i,f),A=new Date(h.toString()),x=A.getTime(),x=(c.has(x)||(c.add(x),p.push(A)),this.getIncrement(h,s,r,i,!0)),A=x,I=("Minutes"!==r&&"Hour"!==r||(this.dstIncreaseHour&&(this.fromDummyDate=!0,A=this.getIncrement(f,s,r,i,!0),this.dstIncreaseHour=!1,this.fromDummyDate=!1),f.setTime(f.getTime()+A),this.inconsistenceDstApplied?(h.setTime(h.getTime()+x-18e5),this.inconsistenceDstApplied=!1):h.setTime(h.getTime()+x)),i=!1,C===w-1&&0!==h.getHours()&&h.setHours(0),23===h.getHours()&&h.getHours()!==f.getHours()&&h.setHours(h.getHours()-1),d<=h&&(S=this.getHeaterTemplateString(p[p.length-1],r,e,!0,s,v),y=!0),o.appendChild(S),"topTier"===e?this.topTierCollection:this.bottomTierCollection);if(v.endDate=new Date(h.getTime()),(this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.enableTimelineVirtualization?"topTier"===e?this.pdfExportTopTierCollection:this.pdfExportBottomTierCollection:I).push(v),u+=v.width,this.weekendEndDate=v.endDate>=d?d:v.endDate,y){y=!1;break}}this.applyDstHour=!1,"Hour"===r?Math.floor(w*s/24):"Minutes"===r&&Math.floor(w*s/1440),f=new Date(2e3,0,1,0,0,0,0)}else{S=this.getHeaterTemplateString(new Date(h.toString()),r,e,!1,s,v,i),p.push(new Date(h.toString())),t=i&&"Month"===r?this.calculateQuarterEndDate(h,s).getTime():(b=Math.abs(this.getIncrement(h,s,r,i,!0)),h.getTime()+b),i=!1,h.setTime(t),!m||"Day"!==r&&"Month"!==r&&"Week"!==r||h.setHours(0,0,0,0),d<=h&&(S=this.getHeaterTemplateString(p[p.length-1],r,e,!0,s,v)),o.appendChild(S);I="topTier"===e?this.topTierCollection:this.bottomTierCollection;v.endDate=new Date(h.getTime()),(this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.enableTimelineVirtualization?"topTier"===e?this.pdfExportTopTierCollection:this.pdfExportBottomTierCollection:I).push(v),u+=v.width,this.weekendEndDate=v.endDate>=d?d:v.endDate}}while((!this.parent.enableTimelineVirtualization||this.parent.pdfExportModule&&(!this.parent.pdfExportModule||this.parent.pdfExportModule.isPdfExport)||u<g)&&h<d);return o},GGt.prototype.updateTimelineAfterZooming=function(e,t){var i,n,o,r,s=document.getElementsByClassName("e-chart-scroll-container e-content")[0];je(s)||(n=!this.parent.isLoad&&this.parent.splitterModule&&this.parent.splitterModule.splitterObject&&"Chart"===this.parent.splitterSettings.view?s.offsetWidth+this.parent.splitterModule.splitterObject.allPanes[0].offsetWidth:s.offsetWidth,s=s.offsetHeight,o=document.getElementsByClassName("e-chart-rows-container")[0].offsetHeight,r=Math.abs(this.timelineStartDate.getTime()-e.getTime()),r/=864e5,i="None"===this.bottomTier?this.getPerDayWidth(this.customTimelineSettings.timelineUnitSize,this.customTimelineSettings.topTier.count,this.topTier):this.getPerDayWidth(this.customTimelineSettings.timelineUnitSize,this.customTimelineSettings.bottomTier.count,this.bottomTier),(s=s<o?i*r+17:i*r)<=n&&(o=n-s,o=Math.round(o/i),e.setDate(e.getDate()+o),this.parent.timelineModule.timelineEndDate=e,t)&&this.parent.updateProjectDates(this.timelineStartDate,this.timelineEndDate,this.parent.isTimelineRoundOff))},GGt.prototype.getTimelineRoundOffEndDate=function(e){var t="None"===this.topTier?this.bottomTier:this.topTier,e=new Date(e.toString());return this.parent.isTimelineRoundOff&&("Hour"===t?e.setMinutes(60):"Minutes"===t?e.setSeconds(60):e.setHours(24,0,0,0)),je(this.parent.projectEndDate)&&this.updateTimelineAfterZooming(e,!1),e},GGt.prototype.getIncrement=function(e,t,i,n,o){var r=new Date(e.getTime()),s=new Date(e.getTime()),a=!1,l=new Date(r);switch(i){case"Year":var r=e,s=new Date(e.getFullYear()+(t-1),11,31),h=hqt(e),d=this.resetToNextYear(e,t),p=this.adjustForDST(r,s,d-h,s.getTime()-r.getTime()+864e5,o,!0);break;case"Month":r=e,s=new Date(e.getFullYear(),e.getMonth()+t,1);h=hqt(e),d=this.resetToNextMonth(e,t);p=this.adjustForDST(r,s,d-h,s.getTime()-r.getTime(),o,!0);break;case"Week":var c=this.parent.timelineModule.customTimelineSettings.weekStartDay,u=e.getDay()<c?c-e.getDay():6-e.getDay()+c,c=(t=0<u?t-1:0,s.setHours(24,0,0,0),u=e.getDay()<c&&0<u?u-1:u,s.setDate(s.getDate()+(u+7*t)),this.resetToNextDay(e)),h=hqt(e),d=c+24*(u+7*t)*60*60*1e3;p=this.adjustForDST(r,s,d-h,s.getTime()-r.getTime(),o,!0);break;case"Day":s.setHours(24,0,0,0);u=(d=(c=this.resetToNextDay(r))+24*(t-1)*60*60*1e3)-(h=hqt(r));p=s.getTime()-r.getTime()+864e5*(t-1),(g=new Date(r)).setTime(g.getTime()+p),p=this.adjustForDST(r,g,u,g.getTime()-r.getTime(),o,!0);break;case"Hour":s.setMinutes(60),s.setSeconds(0);c=(d=this.resetToNextHour(r)+60*(t-1)*60*1e3)-(h=hqt(r));p=s.getTime()-r.getTime()+36e5*(t-1);(g=new Date(r)).setTime(g.getTime()+p),n&&12===t&&0!==r.getHours()&&g.setHours(0,0,0,0);u=new Date(r);u.setHours(u.getHours()-t),-30==r.getTimezoneOffset()-u.getTimezoneOffset()&&(g.setMinutes(g.getMinutes()+30),this.inconsistenceDstApplied=!0),g.getHours()<l.getHours()+t&&(a=!0),p=this.adjustForDST(r,g,c,g.getTime()-r.getTime(),o,a);break;case"Minutes":s.setSeconds(60);var g,u=(d=this.resetToNextMinute(r)+60*(t-1)*1e3)-(h=hqt(r));p=s.getTime()-r.getTime()+6e4*(t-1),(g=new Date(r)).setTime(g.getTime()+p),g.getMinutes()<=l.getMinutes()&&(a=!0),p=this.adjustForDST(r,g,u,g.getTime()-r.getTime(),o,a)}return p},GGt.prototype.resetToNextYear=function(e,t){e=e.getFullYear()+t;return Date.UTC(e,0,1,0,0,0,0)},GGt.prototype.resetToNextMonth=function(e,t){var i=e.getFullYear(),e=e.getMonth();return Date.UTC(i,e+t,1,0,0,0,0)},GGt.prototype.resetToNextDay=function(e){var t=e.getFullYear(),i=e.getMonth(),e=e.getDate();return Date.UTC(t,i,e+1,0,0,0,0)},GGt.prototype.resetToNextHour=function(e){var t=e.getFullYear(),i=e.getMonth(),n=e.getDate(),e=e.getHours();return Date.UTC(t,i,n,e+1,0,0,0)},GGt.prototype.resetToNextMinute=function(e){var t=e.getFullYear(),i=e.getMonth(),n=e.getDate(),o=e.getHours(),e=e.getMinutes();return Date.UTC(t,i,n,o,e+1,0,0)},GGt.prototype.adjustForDST=function(e,t,i,n,o,r){if(this.parent.dataOperation.hasDSTTransition(e.getFullYear())&&!this.inconsistenceDstApplied){var s=n-i;if(t.getTimezoneOffset()>e.getTimezoneOffset()&&o)return this.dstIncreaseHour=!0,this.fromDummyDate?i:r?n+36e5:n;0<s?n-=s:s<0&&(n+=Math.abs(s))}return n},GGt.prototype.isWeekendHeaderCell=function(e,t,i){return!("Day"!==e&&"Hour"!==e&&"Minutes"!==e||1!==this.customTimelineSettings[t].count&&"Hour"!==e&&"Minutes"!==e||-1===this.parent.nonWorkingDayIndex.indexOf(i.getDay()))},GGt.prototype.calculateQuarterEndDate=function(e,t){var i=e.getMonth();return 3===t?0<=i&&i<=2?new Date(e.getFullYear(),3,1):3<=i&&i<=5?new Date(e.getFullYear(),6,1):6<=i&&i<=8?new Date(e.getFullYear(),9,1):new Date(e.getFullYear()+1,0,1):0<=i&&i<=5?new Date(e.getFullYear(),6,1):new Date(e.getFullYear()+1,0,1)},GGt.prototype.calculateTotalHours=function(e,t){var i=0;switch(e){case"Hour":i=+t;break;case"Day":i=24*t;break;case"Week":i=168*t;break;case"Minutes":i=t/60}return i},GGt.prototype.getHeaterTemplateString=function(e,t,i,n,o,r,s,a){var l,h=null,d=(je(this.parent.timelineTemplate)||(h=this.parent.chartRowsModule.templateCompiler(this.parent.timelineTemplate)),("topTier"===i?this.parent.timelineModule.customTimelineSettings.topTier:this.parent.timelineModule.customTimelineSettings.bottomTier).format),p=("topTier"===i?this.parent.timelineModule.customTimelineSettings.topTier:this.parent.timelineModule.customTimelineSettings.bottomTier).formatter,c=je(p)?this.parent.globalize.formatDate(e,{format:this.parent.getDateFormat()}):this.customFormat(e,d,i,t,p),u=Math.abs(this.getIncrement(e,o,t,s)/864e5*this.parent.perDayWidth),g=u,m=(u=n?this.calculateWidthBetweenTwoDate(t,e,this.timelineRoundOffEndDate):s&&"Hour"!==t?this.calculateWidthBetweenTwoDate(t,e,this.calculateQuarterEndDate(e,o)):u,this.isFirstLoop&&this.parent.isInDst(e)&&1===e.getHours()&&this.isDateAffectedByDST(e)&&(u+=this.parent.perDayWidth/24),this.isFirstLoop=!1,this.isWeekendHeaderCell(t,i,e)),f="topTier"===i?" e-gantt-top-cell-text":"";s&&20===e.getHours()&&12===o&&"bottomTier"===i&&"Hour"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit&&e.setTime(e.getTime()-72e6),s=this.applyDstHour?je(p)?this.formatDateHeader(d,e,a):this.customFormat(e,d,i,t,p):je(p)?this.formatDateHeader(d,e):this.customFormat(e,d,i,t,p),je(h)||(o=(l=h(Pe({},{date:c,tier:i,value:s}),this.parent,"TimelineTemplate",this.parent.chartRowsModule.getTemplateID("TimelineTemplate"),!1,void 0,null,this.parent.root))[0])instanceof HTMLElement&&(o.setAttribute("data-tier",i),o.setAttribute("date",c),o.setAttribute("value",s));a=Q("th",{className:(this.parent.timelineModule.isSingleTier?"e-timeline-single-header-cell":"e-timeline-top-header-cell")+(m?" e-weekend-header-cell":""),styles:"width:"+u+"px;"+(m&&this.customTimelineSettings.weekendBackground?"background-color:"+this.customTimelineSettings.weekendBackground+";":"")}),a.tabIndex=-1,a.setAttribute("aria-label",this.parent.localeObj.getConstant("timelineCell")+" "+c),e=Q("div",{className:"e-header-cell-label"+f,styles:"width:"+(u-1)+"px;"});return e.title=this.parent.timelineSettings.showTooltip?c:"",e.textContent=s,e.setAttribute("data-tier",i),this.parent.isReact&&!je(l)&&0<l.length&&(l[0].style.width="100%",l[0].style.height="100%"),!je(h)&&!je(l)&&0<l.length?ht(l,a):a.append(e),a.outerHTML,!this.isSingleTier&&"topTier"!==i||n?(this.isSingleTier||"topTier"===i)&&n&&(this.totalTimelineWidth=this.totalTimelineWidth-g+u):this.totalTimelineWidth=this.totalTimelineWidth+u,r.value=s,r.isWeekend=m,r.width=u,a},GGt.prototype.calculateWidthBetweenTwoDate=function(e,t,i){t=new Date(t.getTime()),i=new Date(i.getTime());return this.parent.dateValidationModule.updateDateWithTimeZone(t,i),(i.getTime()-t.getTime())/864e5*this.parent.perDayWidth},GGt.prototype.timelineWidthCalculation=function(){var e=this.customTimelineSettings.timelineUnitSize,t=this.customTimelineSettings.bottomTier.count,i=this.customTimelineSettings.topTier.count;this.bottomTierCellWidth=e,"None"===this.bottomTier?this.parent.perDayWidth=this.getPerDayWidth(e,i,this.topTier):this.parent.perDayWidth=this.getPerDayWidth(e,t,this.bottomTier),this.topTierCellWidth="None"!==this.bottomTier?"Week"===this.topTier?7*this.parent.perDayWidth:"Hour"===this.topTier?this.parent.perDayWidth/24:"Minutes"===this.topTier?this.parent.perDayWidth/1440:this.parent.perDayWidth:e,this.topTierCellWidth=this.isSingleTier?this.topTierCellWidth:this.topTierCellWidth*i},GGt.prototype.getPerDayWidth=function(e,t,i){var n;switch(i){case"Year":n=e/t/336;break;case"Month":n=e/t/28;break;case"Week":n=e/t/7;break;case"Day":n=e/t;break;case"Hour":n=24/t*e;break;case"Minutes":n=1440/t*e}return n},GGt.prototype.roundOffDays=function(){var e,t,i=this.parent.cloneProjectStartDate,n=this.parent.cloneProjectEndDate,o="None"===this.topTier?this.bottomTier:this.topTier;this.parent.isTimelineRoundOff&&("Year"===o?(i=new Date(i.getFullYear(),0,1),n=new Date(n.getFullYear(),11,31)):"Month"===o?(i=new Date(i.getFullYear(),i.getMonth(),1),n=new Date(n.getFullYear(),n.getMonth()+1,0)):"Week"===o&&(e=je(this.customTimelineSettings.weekStartDay)?0:this.parent.timelineModule.customTimelineSettings.weekStartDay,t=i.getDay()<e?i.getDate()-(7-e+i.getDay()):i.getDate()-i.getDay()+e,i.setDate(t),t=n.getDate()-n.getDay(),n.setDate(6+t+e)),"Hour"===o?i.setMinutes(0):"Minutes"===o?i.setSeconds(0):i.setHours(0,0,0,0)),this.timelineStartDate=i,this.timelineEndDate=n,this.timelineRoundOffEndDate=this.getTimelineRoundOffEndDate(this.timelineEndDate)},GGt.prototype.updateScheduleDatesByToolBar=function(e,t,i,n){var o,r;"Year"===e&&("prevTimeSpan"===t?i=0===i.getMonth()?new Date(i.getFullYear()-1,0,1):new Date(i.getFullYear(),0,1):n=11===n.getMonth()?new Date(n.getFullYear()+1,0,1):new Date(n.getFullYear(),12,1)),"Month"===e&&("prevTimeSpan"===t?i=1===i.getDate()?new Date(i.getFullYear(),i.getMonth()-1,1):new Date(i.getFullYear(),i.getMonth(),1):n=new Date(n.getFullYear(),n.getMonth()+1,1)),"Week"===e&&(o=this.parent.timelineModule.customTimelineSettings.weekStartDay,r=void 0,"prevTimeSpan"===t?(r=i.getDay()<o?7-(o-i.getDay()):i.getDay()-o,i.setHours(0,0,0,0),0===r?i.setDate(i.getDate()-7):i.setDate(i.getDate()-r)):(r=n.getDay()<o?o-n.getDay():7-n.getDay()+o,n.setHours(0,0,0,0),0===r?n.setDate(n.getDate()+6):n.setDate(n.getDate()+r))),"Day"===e&&("prevTimeSpan"===t?0===i.getHours()?i.setTime(i.getTime()-864e5):i.setHours(0):0===n.getHours()?n.setTime(n.getTime()+864e5):n.setHours(24)),"Hour"===e&&("prevTimeSpan"===t?0===i.getMinutes()?i.setTime(i.getTime()-36e5):i.setMinutes(0):0===n.getMinutes()?n.setTime(n.getTime()+36e5):n.setMinutes(60)),"Minutes"===e&&("prevTimeSpan"===t?0===i.getSeconds()?i.setTime(i.getTime()-6e4):i.setSeconds(0):0===n.getSeconds()?n.setTime(n.getTime()+6e4):n.setSeconds(60)),this.parent.cloneProjectStartDate=i,this.parent.cloneProjectEndDate=n},GGt.prototype.updateTimeLineOnEditing=function(e,t){if(1<=e[0].length)for(var i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)],o=n.filter(function(e){return!je(e.ganttProperties.startDate)}),r=n.filter(function(e){return!je(e.ganttProperties.endDate)}),s=0<o.length?new Date(Sa.aggregates.min(o,"ganttProperties.startDate")):null,a=0<o.length?new Date(Sa.aggregates.min(r,"ganttProperties.endDate")):null,r=0<r.length?new Date(Sa.aggregates.max(r,"ganttProperties.endDate")):null,l=new Date(this.parent.dataOperation.checkStartDate(this.timelineStartDate).getTime()),h=new Date(this.parent.dataOperation.checkEndDate(this.timelineEndDate).getTime()),d=je(s)?null:this.parent.dataOperation.getTaskLeft(s,!1),p=je(r)?null:this.parent.dataOperation.getTaskLeft(r,!1),l=this.parent.dataOperation.getTaskLeft(l,!1),h=this.parent.dataOperation.getTaskLeft(h,!1),c=void 0,u=this.parent.editModule.taskbarEditModule,o=0<o.length?new Date(Sa.aggregates.min(o,"ganttProperties.startDate")).setHours(0,0,0,0):null,g=new Date(this.timelineStartDate.getTime()).setHours(0,0,0,0),s=!(!je(d)&&!je(u)&&(u.taskBarEditAction&&"RightResizing"!==u.taskBarEditAction||je(u.taskBarEditAction))&&o<=g&&(d<this.bottomTierCellWidth||d<=l))||(c="prevTimeSpan",s>this.timelineStartDate)?this.timelineStartDate:s,r=!(!je(p)&&p>=(this.parent.enableTimelineVirtualization?this.wholeTimelineWidth:this.totalTimelineWidth)-this.bottomTierCellWidth&&h<p)||(c="prevTimeSpan"===c?"both":"nextTimeSpan",r<this.timelineEndDate)?this.timelineEndDate:r;c?this.performTimeSpanAction(c,t,s,r):je(n[0].ganttProperties.segments)||this.parent.dataOperation.updateWidthLeft(n[0]),!je(s)&&!je(a)&&a<=s&&("CellEditing"===t||"DialogEditing"===t)&&this.parent.allowUnscheduledTasks?(s=new Date(Math.min(s.getTime(),a.getTime())),s=new Date(Math.min(s.getTime(),this.timelineStartDate.getTime())),this.performTimeSpanAction("prevTimeSpan",t,s,r)):je(a)&&a<=s&&("CellEditing"===t||"DialogEditing"===t)&&this.parent.allowUnscheduledTasks&&1===e[0].length&&!je(e[0][0].ganttProperties.endDate)&&je(n[0].ganttProperties.startDate)&&n[0].ganttProperties.endDate<=this.timelineStartDate&&(s=new Date(Math.min(e[0][0].ganttProperties.endDate.getTime(),s.getTime())),this.performTimeSpanAction("prevTimeSpan",t,s,r));break}},GGt.prototype.performTimeSpanAction=function(e,t,i,n,o){o=je(o)?"None"===this.parent.timelineModule.topTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier:o;var r=new Date(this.parent.cloneProjectStartDate.getTime()),s=new Date(this.parent.cloneProjectEndDate.getTime()),o=("publicMethod"!==t&&"both"===e?(this.updateScheduleDatesByToolBar(o,"prevTimeSpan",i,n),this.updateScheduleDatesByToolBar(o,"nextTimeSpan",new Date(this.parent.cloneProjectStartDate.getTime()),n)):this.updateScheduleDatesByToolBar(o,e,i,n),this.timeSpanActionEvent("actionBegin",e,t));o.cancel?(this.parent.cloneProjectStartDate=r,this.parent.cloneProjectEndDate=s):(this.restrictRender=!0,this.performedTimeSpanAction=!0,i=this.parent.ganttChartModule.scrollElement.scrollLeft,this.parent.updateProjectDates(o.projectStartDate,o.ProjectEndDate,o.isTimelineRoundOff,t),"prevTimeSpan"===e&&"publicMethod"===t?(this.parent.ganttChartModule.updateScrollLeft(0),this.parent.timelineModule.isZoomToFit=!1):"nextTimeSpan"===e&&"publicMethod"===t?(this.parent.ganttChartModule.updateScrollLeft(this.parent.enableTimelineVirtualization?this.wholeTimelineWidth:this.totalTimelineWidth),this.parent.timelineModule.isZoomToFit=!1):"nextTimeSpan"===e&&"TaskbarEditing"===t&&(n=document.getElementsByClassName("e-chart-scroll-container e-content")[0].scrollLeft,this.parent.element.querySelector(".e-timeline-header-container").scrollLeft=n,this.parent.timelineModule.isZoomToFit=!1),"TaskbarEditing"===t&&this.parent.enableTimelineVirtualization&&(this.wholeTimelineWidth>3*this.parent.element.offsetWidth||je(this.parent.projectStartDate)&&je(this.parent.projectEndDate))&&(this.parent.ganttChartModule.scrollObject.setScrollLeft(i),this.parent.ganttChartModule.scrollObject.updateContent()),this.parent.timelineModule.timeSpanActionEvent("actionComplete",e,t))},GGt.prototype.timeSpanActionEvent=function(e,t,i){var n={};return n.projectStartDate=new Date(this.parent.cloneProjectStartDate.getTime()),n.ProjectEndDate=new Date(this.parent.cloneProjectEndDate.getTime()),n.requestType="publicMethod"===i?t:"beforeAdd"===i?"TimelineRefreshOnAdd":"TaskbarEditing"===i?"TimelineRefreshOnEdit":t,"actionBegin"===e&&(n.isTimelineRoundOff=this.parent.isTimelineRoundOff,n.cancel=!1),n.action="TimescaleUpdate",this.parent.trigger(e,n),n},GGt);function GGt(e){this.isZoomIn=!1,this.isZooming=!1,this.isZoomToFit=!1,this.topTierCollection=[],this.bottomTierCollection=[],this.pdfExportTopTierCollection=[],this.pdfExportBottomTierCollection=[],this.restrictRender=!0,this.applyDstHour=!1,this.performedTimeSpanAction=!1,this.dstIncreaseHour=!1,this.fromDummyDate=!1,this.isZoomedToFit=!1,this.isZoomingAction=!1,this.increaseIteration=!1,this.isFirstLoop=!1,this.inconsistenceDstApplied=!1,this.parent=e,this.initProperties()}var YGt=function(e){this.allowEditing=!0,this.allowReordering=!0,this.allowResizing=!0,this.allowSorting=!0,this.allowFiltering=!0,this.edit={},I(this,e)},XGt=(KGt.prototype.addEventListener=function(){this.parent.on("renderPanels",this.createContainer,this),this.parent.on("chartScroll",this.updateScrollTop,this),this.parent.on("destroy",this.destroy,this),this.parent.treeGrid.on("renderReactTemplate",this.renderReactTemplate,this)},KGt.prototype.renderReactTemplate=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];-1===this.parent.portals.indexOf(n)&&this.parent.portals.push(n)}this.parent.renderTemplates()},KGt.prototype.createContainer=function(){this.treeGridElement=Q("div",{id:"treeGrid"+this.parent.element.id,className:"e-gantt-tree-grid"});var e=Q("div",{className:"e-gantt-temp-header"});this.parent.treeGridPane.appendChild(this.treeGridElement),this.treeGridElement.appendChild(e),this.parent.treeGridPane.classList.add("e-temp-content")},KGt.prototype.renderTreeGrid=function(){this.composeProperties(),this.bindEvents();this.parent.treeGrid.root=this.parent.root||this.parent,x("registeredTemplate",this.registeredTemplate,this.parent.treeGrid);x("viewContainerRef",this.parent.viewContainerRef,this.parent.treeGrid),this.treeGridElement.contains(this.parent.treeGrid.element)||this.parent.treeGrid.appendTo(this.treeGridElement),this.parent.treeGrid.grid&&this.parent.toolbarModule&&this.parent.isReact&&(this.parent.treeGrid.grid.portals=this.parent.portals),this.wireEvents()},KGt.prototype.composeProperties=function(){var e;this.parent.treeGrid.enableAdaptiveUI=this.parent.enableAdaptiveUI,this.parent.treeGrid.hasChildMapping=this.parent.taskFields.hasChildMapping,this.parent.treeGrid.query=this.parent.query,this.parent.treeGrid.loadChildOnDemand=this.parent.loadChildOnDemand,this.parent.treeGrid.isFromGantt=!0,this.parent.treeGrid.parentIdMapping=this.parent.taskFields.parentID,this.parent.taskFields.parentID&&(this.parent.treeGrid.idMapping=this.parent.taskFields.id),this.parent.treeGrid.showColumnMenu=this.parent.showColumnMenu,this.parent.treeGrid.enableCollapseAll=this.parent.collapseAllParentTasks,this.parent.treeGrid.columnMenuItems=this.parent.columnMenuItems,this.parent.treeGrid.enableRtl=this.parent.enableRtl,this.parent.treeGrid.childMapping=je(this.parent.taskFields.child)?"":this.parent.taskFields.child,this.parent.treeGrid.treeColumnIndex=this.parent.treeColumnIndex,this.parent.treeGrid.columns=this.treeGridColumns,this.parent.treeGrid.loadingIndicator=this.parent.loadingIndicator,this.parent.treeGrid.enableVirtualMaskRow=this.parent.enableVirtualMaskRow,this.parent.dataSource instanceof Object&&sqt(this.parent)?(this.parent.treeGrid.hasChildMapping="isParent",e=R("count",this.parent.dataSource),this.parent.treeGrid.dataSource={result:this.parent.flatData,count:e}):this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.treeGrid.dataSource=this.parent.dataSource:(this.parent.treeGrid.hasChildMapping=null,this.parent.treeGrid.dataSource=this.parent.flatData),this.parent.treeGrid.expandStateMapping=this.parent.taskFields.expandState,this.parent.treeGrid.isGantt=!0,this.parent.treeGrid.rowHeight=this.parent.rowHeight,this.parent.treeGrid.gridLines=this.parent.gridLines,0===this.parent.searchSettings.fields.length&&""===this.parent.searchSettings.key||(this.parent.treeGrid.searchSettings=this.parent.searchSettings);this.parent.treeGrid.isJsComponent=!0,this.parent.treeGrid.height=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].offsetHeight-(0===this.parent.flatData.length?0:19)},KGt.prototype.getContentDiv=function(){return this.treeGridElement.querySelector(".e-content")},KGt.prototype.getHeaderDiv=function(){return this.treeGridElement.querySelector(".e-headercontent")},KGt.prototype.getScrollbarWidth=function(){var e=document.createElement("div"),t=(e.style.visibility="hidden",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar",document.createElement("div")),t=(e.appendChild(t),this.parent.element.appendChild(e),e.offsetWidth-t.offsetWidth);return e.parentNode.removeChild(e),t},KGt.prototype.ensureScrollBar=function(){var e=this.getContentDiv(),t=this.getHeaderDiv(),i=this.getScrollbarWidth(),n=/Android|Mac|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);0!==i||navigator.userAgent.includes("Firefox")?e.style.cssText+="width: calc(100% + "+(i+1)+"px);":e.classList.add("e-gantt-scroll-padding"),0===i&&n&&(t.style.cssText+="width: calc(100% + 17px);")},KGt.prototype.bindEvents=function(){this.parent.treeGrid.dataBound=this.dataBound.bind(this),this.parent.treeGrid.collapsing=this.collapsing.bind(this),this.parent.treeGrid.collapsed=this.collapsed.bind(this),this.parent.treeGrid.expanding=this.expanding.bind(this),this.parent.treeGrid.expanded=this.expanded.bind(this),this.parent.treeGrid.actionBegin=this.actionBegin.bind(this),this.parent.treeGrid.actionComplete=this.treeActionComplete.bind(this),this.parent.treeGrid.created=this.created.bind(this),this.parent.treeGrid.actionFailure=this.actionFailure.bind(this),this.parent.treeGrid.headerCellInfo=this.headerCellInfo.bind(this),this.parent.treeGrid.rowDataBound=this.rowDataBound.bind(this),this.parent.treeGrid.columnMenuOpen=this.columnMenuOpen.bind(this),this.parent.treeGrid.columnMenuClick=this.columnMenuClick.bind(this),this.parent.treeGrid.beforeDataBound=this.beforeDataBound.bind(this),this.parent.treeGrid.dataStateChange=this.dataStateChange.bind(this),null!=this.parent.queryCellInfo&&(this.parent.treeGrid.queryCellInfo=this.queryCellInfo.bind(this))},KGt.prototype.beforeDataBound=function(e){!je(this.parent.selectionModule)&&this.parent.selectionSettings&&this.parent.selectionSettings.persistSelection&&0<this.parent.selectionModule.getSelectedRowIndexes().length&&"sorting"===e.actionArgs.requestType&&(this.isPersist=!0),this.parent.updatedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?R("virtualScrollModule.visualData",this.parent.treeGrid):R("result",e),this.parent.virtualScrollModule&&this.parent.enableVirtualization&&this.parent.updateContentHeight(e),x("contentModule.objectEqualityChecker",this.objectEqualityChecker,this.parent.treeGrid.grid)},KGt.prototype.dataBound=function(e){this.parent.isReact&&this.parent.clearTemplate(["TaskbarTemplate","ParentTaskbarTemplate","MilestoneTemplate","TaskLabelTemplate","RightLabelTemplate","LeftLabelTemplate"]),this.ensureScrollBar(),this.parent.treeDataBound(e),this.parent.isVirtualScroll&&((this.parent.enableVirtualMaskRow&&this.parent.enableVirtualization||this.parent.enableVirtualization&&!this.parent.enableVirtualMaskRow&&"Shimmer"===this.parent.loadingIndicator.indicatorType||"Shimmer"===this.parent.loadingIndicator.indicatorType)&&this.parent.hideMaskRow(),this.parent.editModule&&this.parent.editModule.cellEditModule&&(this.parent.editModule.cellEditModule.isCellEdit=!1),this.parent.isVirtualScroll=!1,je(this.parent.selectionModule)||je(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()),this.prevCurrentView=Pe([],[],this.parent.currentViewData,!0)},KGt.prototype.dataStateChange=function(e){e.action&&"refresh"===e.action.requestType&&(this.parent.treeGrid.dataSource={result:R("result",this.parent.treeGrid.dataSource),count:R("count",this.parent.treeGrid.dataSource)}),this.parent.trigger("dataStateChange",e)},KGt.prototype.collapsing=function(e){var t,i=R("data",e),n=i.length;if(!this.parent.ganttChartModule.isExpandCollapseFromChart){if(je(n))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.collapseGanttRow(t);else for(var o=0;o<n;o++)t=this.createExpandCollapseArgs(e,i[o]),this.parent.ganttChartModule.collapseGanttRow(t);x("cancel",R("cancel",t),e)}},KGt.prototype.expanding=function(e){var t,i=R("data",e),n=i.length;if(!this.parent.ganttChartModule.isExpandCollapseFromChart){if(je(n))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.expandGanttRow(t);else for(var o=0;o<n;o++)t=this.createExpandCollapseArgs(e,i[o]),this.parent.ganttChartModule.expandGanttRow(t);x("cancel",R("cancel",t),e)}},KGt.prototype.collapsed=function(e){if(!this.parent.ganttChartModule.isExpandCollapseFromChart&&!this.parent.isExpandCollapseLevelMethod){var t=void 0,i=R("data",e),n=i.length;if(je(n))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.collapsedGanttRow(t);else for(var o=0;o<n;o++)t=this.createExpandCollapseArgs(e,i[o]),this.parent.ganttChartModule.collapsedGanttRow(t);this.parent.ganttChartModule.isCollapseAll||!t.gridRow||this.parent.allowTaskbarOverlap||(t.gridRow.style.height=t.chartRow.style.height,this.parent.contentHeight=(this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2]:this.parent.element.getElementsByClassName("e-content")[0]).children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px")}je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.parent.trigger("collapsed",e)},KGt.prototype.expanded=function(e){if(!this.parent.ganttChartModule.isExpandCollapseFromChart&&!this.parent.isExpandCollapseLevelMethod){var t=void 0,i=R("data",e),n=i.length;if(je(n))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.expandedGanttRow(t);else for(var o=0;o<n;o++)t=this.createExpandCollapseArgs(e,i[o]),this.parent.ganttChartModule.expandedGanttRow(t);this.parent.ganttChartModule.isExpandAll||!e.row||this.parent.allowTaskbarOverlap||(e.row.style.height=this.parent.rowHeight+"px",this.parent.contentHeight=(this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2]:this.parent.element.getElementsByClassName("e-content")[0]).children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px")}je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.parent.isCollapseAll=!1,this.parent.trigger("expanded",e)},KGt.prototype.actionBegin=function(e){var t;!this.parent.undoRedoModule||"filtering"!==e.requestType&&"searching"!==e.requestType&&"sorting"!==e.requestType&&"filterAfterOpen"!==e.requestType||(this.parent.undoRedoModule.canUpdateIndex=!1),"filterchoicerequest"===e.requestType&&(t=R("filterModel.dlg",e))&&(t.style.display="none"),this.parent.notify("actionBegin",e),null!==R("doubleClickTarget",this.parent.treeGrid.editModule)&&x("doubleClickTarget",null,this.parent.treeGrid.editModule),this.parent.trigger("actionBegin",e),"virtualscroll"===e.requestType||"edit"===e.type||"beginEdit"===e.requestType||e.cancel||(je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow())},KGt.prototype.created=function(e){this.updateKeyConfigSettings()},KGt.prototype.actionFailure=function(e){this.parent.trigger("actionFailure",e)},KGt.prototype.createExpandCollapseArgs=function(e,t){var i;return je(R("data",e).length)?{data:i=R("data",e),gridRow:R("row",e),chartRow:this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(i)],cancel:!1}:{data:t,gridRow:R("row",e),chartRow:this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(t)],cancel:!1}},KGt.prototype.treeActionComplete=function(e){var t,i,n,o,r=this,s=Pe({},e);if("reorder"===R("requestType",e)&&this.parent.undoRedoModule&&!this.parent.undoRedoModule.isFromUndoRedo&&this.parent.isUndoRedoItemPresent("ColumnReorder")&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(o={action:"ColumnReorder"}).fromIndex=Pe([],[],[e.fromIndex],!0)[0],o.toIndex=Pe([],[],[e.toIndex],!0)[0],o.toColumn=Pe([],[],[this.parent.treeGrid.columns[e.toIndex].field],!0)[0],o.fromColumn=Pe([],[],[this.parent.treeGrid.columns[e.fromIndex].field],!0)[0],this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=o),"columnstate"===R("requestType",e)&&this.parent.undoRedoModule&&!this.parent.undoRedoModule.isFromUndoRedo&&this.parent.isUndoRedoItemPresent("ColumnState")&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(o={action:"ColumnState"}).showhideColumns=Pe([],[],e.columns,!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=o),"sorting"===R("requestType",e)?(this.parent.undoRedoModule&&this.parent.isUndoRedoItemPresent("Sorting")&&(this.parent.undoRedoModule.currentAction&&this.parent.undoRedoModule.currentAction.sortColumns&&1<this.parent.undoRedoModule.currentAction.sortColumns.length&&this.parent.undoRedoModule.sortedColumnsLength++,this.parent.undoRedoModule.currentAction&&(!this.parent.undoRedoModule.currentAction.sortColumns||this.parent.undoRedoModule.sortedColumnsLength===this.parent.undoRedoModule.currentAction.sortColumns.length)||this.parent.undoRedoModule.isFromUndoRedo||(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(o={action:"Sorting",sortColumns:[]}).sortColumns=this.parent.undoRedoModule.previousSortedColumns,this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=o),this.parent.undoRedoModule.previousSortedColumns=this.parent.treeGrid.sortSettings.columns),this.parent.notify("updateModel",{}),b(s,"isFrozen")):"filtering"===R("requestType",e)?(this.parent.undoRedoModule&&!this.parent.undoRedoModule.isFromUndoRedo&&this.parent.isUndoRedoItemPresent("Filtering")&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(o={action:"Filtering"}).filteredColumns=Pe([],[],e.columns,!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=o),this.parent.notify("updateModel",{})):"save"===R("type",e)&&this.parent.editModule&&this.parent.editModule.cellEditModule&&(je(i=R("data",e))||je(this.parent.getTaskByUniqueID(i.uniqueID))||(this.parent.getTaskByUniqueID(i.uniqueID).taskData[this.parent.taskFields.duration]=i.taskData[this.parent.taskFields.duration],je(i.taskData[this.parent.taskFields.resourceInfo]))||(this.parent.getTaskByUniqueID(i.uniqueID).taskData[this.parent.taskFields.resourceInfo]=i.taskData[this.parent.taskFields.resourceInfo]),lqt(this.currentEditRow)&&e.column&&e.column.edit&&e.column.field===this.parent.taskFields.resourceInfo&&(n=this.parent.taskFields.resourceInfo,this.currentEditRow=((t={})[n]=i.resources,t)),this.parent.editModule.cellEditModule.initiateCellEdit(e,this.currentEditRow),this.parent.editModule.cellEditModule.isCellEdit=!1,this.currentEditRow={}),"filterAfterOpen"===R("requestType",e)&&this.parent.notify("actionComplete",e),"searching"===R("requestType",e)&&(this.parent.undoRedoModule&&this.parent.isUndoRedoItemPresent("Search")&&(this.parent.undoRedoModule.isFromUndoRedo||(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(o={action:"Search"}).searchString=this.parent.undoRedoModule.searchString,this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=o),this.parent.undoRedoModule.searchString=this.parent.treeGrid.searchSettings.key),this.parent.notify("actionComplete",e)),je(this.parent.toolbarModule)||je(R("batchChanges",e))||this.parent.toolbarModule.refreshToolbarItems(),this.parent.isCancelled&&(x("requestType","cancel",s),x("action","CellEditing",s),this.parent.isCancelled=!1),"refresh"===R("requestType",e)&&je(R("type",e))&&this.parent.addDeleteRecord){if(-1!==this.parent.selectedRowIndex)if(!je(this.parent.selectionModule)&&this.parent.selectionSettings&&this.parent.selectionSettings.persistSelection&&this.parent.editModule.isAdded){var a=this.parent.selectionModule.selectedRowIndexes;if(1<a.length&&this.parent.selectionSettings.persistSelection)for(var l=0;l<a.length;l++){var h=this.parent.flatData[a[l].toString()];this.parent.selectRows(h)}}else this.parent.selectRow(this.parent.selectedRowIndex),this.parent.selectedRowIndex>this.parent.currentViewData.length-1&&(this.parent.selectedRowIndex=-1);else{if(!je(this.parent.selectionModule)&&this.parent.selectionSettings&&this.parent.selectionSettings.persistSelection&&this.parent.editModule&&!this.parent.editModule.isAdded)for(var d=this.parent.selectionModule.getSelectedRecords(),p=this,l=d.length-1;0<=l;l--)!function(e){var t=d[e][p.parent.taskFields.id];p.parent.editModule.deletedRecord.some(function(e){return e.ganttProperties.taskId===t})&&d.splice(e,1)}(l);var c=0;(this.parent.enableVirtualization?this.parent.flatData:this.parent.currentViewData).map(function(e,t){je(r.parent.currentSelection)||e.ganttProperties.taskId!==r.parent.currentSelection[r.parent.taskFields.id]||("ResourceView"!==r.parent.viewType||e.ganttProperties.rowUniqueID!==r.parent.currentSelection.rowUniqueID)&&"ResourceView"===r.parent.viewType||(c=t)}),this.addedRecord=!0,this.parent.selectRow(je(c)?0:c)}this.parent.isExpandPerformed||(this.parent.addDeleteRecord=!1),this.parent.isExpandPerformed=!1}if(this.parent.undoRedoModule&&(this.parent.undoRedoModule.isFromUndoRedo=!1),"refresh"===R("requestType",e)&&this.parent.initiateEditAction(!1),this.parent.trigger("actionComplete",s),this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap){for(l=0;l<this.parent.currentViewData.length;l++)this.parent.currentViewData[l].hasChildRecords&&!this.parent.currentViewData[l].expanded&&this.parent.chartRowsModule.updateDragDropRecords(this.parent.currentViewData[l]);this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)}je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()},KGt.prototype.updateKeyConfigSettings=function(){delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.delete,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.insert,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.upArrow,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.downArrow,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.ctrlHome,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.ctrlEnd,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.enter,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.tab,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.shiftTab,delete this.parent.treeGrid.keyboardModule.keyConfigs.enter,delete this.parent.treeGrid.keyboardModule.keyConfigs.upArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.downArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlShiftUpArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlShiftDownArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlUpArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlDownArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.tab,delete this.parent.treeGrid.keyboardModule.keyConfigs.shiftTab},KGt.prototype.wireEvents=function(){var e=this.parent.treeGrid.element.querySelector(".e-content");e&&E.add(e,"scroll",this.scrollHandler,this),this.parent.isAdaptive&&E.add(this.parent.treeGridPane,"click",this.treeGridClickHandler,this)},KGt.prototype.unWireEvents=function(){var e=this.parent.treeGrid.element&&this.parent.treeGrid.element.querySelector(".e-content");e&&E.remove(e,"scroll",this.scrollHandler),this.parent.isAdaptive&&E.remove(this.parent.treeGridPane,"click",this.treeGridClickHandler)},KGt.prototype.scrollHandler=function(e){var t=this.parent.treeGrid.element.querySelector(".e-content");t.scrollTop!==this.previousScroll.top&&this.parent.notify("grid-scroll",{top:t.scrollTop}),this.previousScroll.top=t.scrollTop,this.parent.contextMenuModule&&this.parent.contextMenuModule.isOpen&&this.parent.contextMenuModule.contextMenu.close()},KGt.prototype.validateGanttColumns=function(){for(var n=this.parent,e=n.columns.length,o=this.parent.taskFields,r=(this.parent.columnMapping={},this.parent.columnByField={},this.parent.customColumns=[],["id","name","startDate","endDate","duration","dependency","progress","baselineStartDate","baselineEndDate","resourceInfo","notes","work","manual","type","milestone","segments"]),s=this,t=0;t<e;t++)!function(e){var t={},e=("string"==typeof n.columns[e]?t.field=n.columns[e]:t=n.columns[e],[]);if(0===(e=0<r.length?r.filter(function(e){return t.field===o[e]}):e).length)return t.field!==s.parent.resourceFields.group&&(s.parent.customColumns.push(t.field),t.headerText=t.headerText||t.field,t.width=t.width||150,t.editType=t.editType||"stringedit",t.type=t.type||"string","checkbox"===t.type&&(s.parent.selectionSettings.type="Multiple"),s.bindTreeGridColumnProperties(t,!0));var i=r.indexOf(e[0]);r.splice(i,1),s.createTreeGridColumn(t,!0),s.parent.columnMapping[e[0]]=t.field}(t);for(var i=0;i<r.length;i++){var a={};je(o[r[i]])||(a.field=o[r[i]],this.createTreeGridColumn(a,0===e),this.parent.columnMapping[r[i]]=a.field)}"ProjectView"!==this.parent.viewType&&(this.composeUniqueIDColumn(a={}),this.createTreeGridColumn(a,!0))},KGt.prototype.createTreeGridColumn=function(t,e){var i,n=this,o=this.parent.taskFields,r=this.parent.previousGanttColumns.filter(function(e){return t.field===e.field})[0];t.disableHtmlEncode=(je(t.disableHtmlEncode)?this.parent:t).disableHtmlEncode,o.id!==t.field&&(t.clipMode=t.clipMode||"EllipsisWithTooltip"),o.id===t.field?this.composeIDColumn(t):o.name===t.field?(this.parent.isLocaleChanged&&r?t.headerText=r.headerText||this.parent.localeObj.getConstant("name"):t.headerText=t.headerText||this.parent.localeObj.getConstant("name"),t.width=t.width||150,t.editType=t.editType||"stringedit",t.type=t.type||"string"):o.startDate===t.field?(this.parent.isLocaleChanged&&r?t.headerText=r.headerText||this.parent.localeObj.getConstant("startDate"):t.headerText=t.headerText||this.parent.localeObj.getConstant("startDate"),t.editType=t.editType||(-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit"),t.format=t.format||{type:"date",format:this.parent.getDateFormat()},t.width=t.width||150,t.edit&&t.edit.params?t.edit.params.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent):t.edit?t.edit.params={renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}:t.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}}):o.endDate===t.field?(this.parent.isLocaleChanged&&r?t.headerText=r.headerText||this.parent.localeObj.getConstant("endDate"):t.headerText=t.headerText||this.parent.localeObj.getConstant("endDate"),t.format=t.format||{type:"date",format:this.parent.getDateFormat()},t.editType=t.editType||(-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit"),t.width=t.width||150,t.edit&&t.edit.params?t.edit.params.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent):t.edit?t.edit.params={renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}:t.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}}):o.duration===t.field?(t.width=t.width||150,this.parent.isLocaleChanged&&r?t.headerText=r.headerText||this.parent.localeObj.getConstant("duration"):t.headerText=t.headerText||this.parent.localeObj.getConstant("duration"),t.valueAccessor=t.valueAccessor||(je(t.edit)||je(t.edit.read)?this.durationValueAccessor.bind(this):null),t.editType=t.editType||"stringedit",t.type=t.type||"string"):o.progress===t.field?this.composeProgressColumn(t):o.dependency===t.field?(this.parent.isLocaleChanged&&r?t.headerText=r.headerText||this.parent.localeObj.getConstant("dependency"):t.headerText=t.headerText||this.parent.localeObj.getConstant("dependency"),t.width=t.width||150,t.editType=t.editType||"stringedit",t.type="string",t.allowFiltering=!1!==t.allowFiltering,t.valueAccessor=t.valueAccessor||this.dependencyValueAccessor.bind(this),je(t.filter)&&"en-US"!==this.parent.locale&&(t.filter={ui:{create:function(e){var t=Q("input",{className:"flm-input"});e.target.appendChild(t),n.dropInstance=new lU({dataSource:n.changeLocale(n.parent.treeGrid.grid.dataSource),fields:{text:n.parent.taskFields.dependency,value:n.parent.taskFields.dependency},placeholder:n.parent.localeObj.getConstant("enterValue"),popupHeight:"200px"}),n.dropInstance.appendTo(t)},write:function(e){n.dropInstance.value=e.filteredValue},read:function(e){e.fltrObj.filterByColumn(e.column.field,e.operator,n.changeDelocale(n.dropInstance.value))}}})):o.resourceInfo===t.field?this.composeResourceColumn(t):o.notes===t.field?(r&&this.parent.isLocaleChanged?t.headerText=r.headerText||this.parent.localeObj.getConstant("notes"):t.headerText=t.headerText||this.parent.localeObj.getConstant("notes"),t.width=t.width||150,t.editType=t.editType||"stringedit",this.parent.showInlineNotes||t.template||(t.template=ao(function(){return'<div class="e-ganttnotes-info">\n                            <span class="e-icons e-notes-info"></span>\n                        </div>'}))):o.baselineStartDate===t.field||o.baselineEndDate===t.field?(i=o.baselineEndDate===t.field?"baselineEndDate":"baselineStartDate",t.width=t.width||150,this.parent.isLocaleChanged&&r?t.headerText=r.headerText||this.parent.localeObj.getConstant(i):t.headerText=t.headerText||this.parent.localeObj.getConstant(i),t.format=t.format||{type:"date",format:this.parent.getDateFormat()},t.editType=t.editType||(-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit")):o.work===t.field?(r&&this.parent.isLocaleChanged?t.headerText=r.headerText||this.parent.localeObj.getConstant("work"):t.headerText=t.headerText||this.parent.localeObj.getConstant("work"),t.width=t.width||150,t.valueAccessor=t.valueAccessor||this.workValueAccessor.bind(this),t.editType=t.editType||"numericedit"):o.type===t.field?(r&&this.parent.isLocaleChanged?t.headerText=r.headerText||this.parent.localeObj.getConstant("taskType"):t.headerText=t.headerText||this.parent.localeObj.getConstant("taskType"),t.width=t.width||150,t.editType="dropdownedit",t.valueAccessor=t.valueAccessor||this.taskTypeValueAccessor.bind(this)):o.manual===t.field&&"Custom"===this.parent.taskMode&&(r&&this.parent.isLocaleChanged?t.headerText=r.headerText||this.parent.localeObj.getConstant("taskMode"):t.headerText=t.headerText||this.parent.localeObj.getConstant("taskMode"),t.width=t.width||120,t.editType=t.editType||"dropdownedit",t.valueAccessor=t.valueAccessor||this.modeValueAccessor.bind(this),t.edit={params:{query:new ya,dataSource:[{id:1,text:this.parent.localeObj.getConstant("manual"),value:!0},{id:2,text:this.parent.localeObj.getConstant("auto"),value:!1}],fields:{text:"text",value:"value"}}}),this.bindTreeGridColumnProperties(t,e)},KGt.prototype.changeLocale=function(e){var o=this,t=[];return e.map(function(e){return e.ganttProperties.predecessorsName}).map(function(e){var i,n;je(e)||(i="",(n=e.split(",")).map(function(e,t){e.includes("FS")?i=(i+=e.replace("FS",o.parent.localeObj.getConstant("FS")))+(n.length!==t+1?",":""):e.includes("FF")?i=(i+=e.replace("FF",o.parent.localeObj.getConstant("FF")))+(n.length!==t+1?",":""):e.includes("SS")?i=(i+=e.replace("SS",o.parent.localeObj.getConstant("SS")))+(n.length!==t+1?",":""):e.includes("SF")&&(i=(i+=e.replace("SF",o.parent.localeObj.getConstant("SF")))+(n.length!==t+1?",":""))}),t.push(i))}),t},KGt.prototype.changeDelocale=function(e){var i,n,o=this.parent.localeObj.getConstant("FF"),r=this.parent.localeObj.getConstant("FS"),s=this.parent.localeObj.getConstant("SS"),a=this.parent.localeObj.getConstant("SF");return je(e)?null:(i=e.split(","),n="",i.map(function(e,t){n=e.includes(o)?(n+=e.replace(o,"FF"))+(i.length!==t+1?",":""):e.includes(r)?(n+=e.replace(r,"FS"))+(i.length!==t+1?",":""):e.includes(s)?(n+=e.replace(s,"SS"))+(i.length!==t+1?",":""):e.includes(a)?(n+=e.replace(a,"SF"))+(i.length!==t+1?",":""):(n+=e)+(i.length!==t+1?",":"")}),n)},KGt.prototype.composeResourceColumn=function(t){var e=this.parent.previousGanttColumns.filter(function(e){return t.field===e.field})[0];e&&this.parent.isLocaleChanged?t.headerText=e.headerText||this.parent.localeObj.getConstant("resourceName"):t.headerText=t.headerText||this.parent.localeObj.getConstant("resourceName"),t.width=t.width||150,t.type="string",t.valueAccessor=t.valueAccessor||this.resourceValueAccessor.bind(this),t.allowFiltering=!1!==t.allowFiltering},KGt.prototype.getResourceIds=function(e){var t=R(this.parent.taskFields.resourceInfo,e.taskData),i=[];if(je(t))return t;for(var n=0;n<t.length;n++)i.push("object"==typeof t[n]?t[n][this.parent.resourceFields.id]:t[n]);return i},KGt.prototype.composeIDColumn=function(t){var e,i,n="ProjectView"===this.parent.viewType,o=this.parent.dataSource?this.parent.dataSource.length:0;t.isPrimaryKey=n,this.parent.isLocaleChanged?(i=this.parent.previousGanttColumns.filter(function(e){return t.field===e.field})[0])&&(t.headerText=i.headerText||this.parent.localeObj.getConstant("id")):t.headerText=t.headerText||this.parent.localeObj.getConstant("id"),t.width=t.width||100;for(var r=0;r<o;r++)if(!je(this.parent.dataSource[r][this.parent.taskFields.id])){e=this.parent.dataSource[r][this.parent.taskFields.id];break}"string"==typeof e||je(e)?("ResourceView"===this.parent.viewType?t.allowEditing=t.allowEditing||!1:t.allowEditing=t.allowEditing||!0,t.editType=t.editType||"stringedit"):(t.allowEditing=t.allowEditing||!1,t.editType=t.editType||"numericedit"),t.valueAccessor=n?null:this.idValueAccessor.bind(this)},KGt.prototype.composeUniqueIDColumn=function(e){e.field="rowUniqueID",e.isPrimaryKey=!0,e.headerText="UniqueID",e.allowEditing=!1,e.visible=!1},KGt.prototype.composeProgressColumn=function(t){var e=this.parent.previousGanttColumns.filter(function(e){return t.field===e.field})[0];this.parent.isLocaleChanged&&e?t.headerText=e.headerText||this.parent.localeObj.getConstant("progress"):t.headerText=t.headerText||this.parent.localeObj.getConstant("progress"),t.width=t.width||150,t.editType=t.editType||"numericedit"},KGt.prototype.bindTreeGridColumnProperties=function(e,t){for(var i={},n={},o=0,r=Object.keys(e);o<r.length;o++){var s=r[o];i[s]=n[s]=e[s]}this.parent.columnByField[n.field]=n,this.parent.ganttColumns.push(new YGt(n)),t&&this.treeGridColumns.push(i)},KGt.prototype.durationValueAccessor=function(e,t,i){return je(t)||je(t.ganttProperties)?this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.dataOperation.getDurationString(parseInt(t[this.parent.taskFields.duration],10),this.parent.durationUnit):"":(t=t.ganttProperties,this.parent.dataOperation.getDurationString(t.duration,t.durationUnit))},KGt.prototype.dependencyValueAccessor=function(e,t,i){var n,o,r=this;return t&&t.ganttProperties&&!je(t.ganttProperties.predecessorsName)?(n="",(o=t.ganttProperties.predecessorsName.split(",")).map(function(e,t){e.includes("FS")?n=(n+=e.replace("FS",r.parent.localeObj.getConstant("FS")))+(o.length!==t+1?",":""):e.includes("FF")?n=(n+=e.replace("FF",r.parent.localeObj.getConstant("FF")))+(o.length!==t+1?",":""):e.includes("SS")?n=(n+=e.replace("SS",r.parent.localeObj.getConstant("SS")))+(o.length!==t+1?",":""):e.includes("SF")&&(n=(n+=e.replace("SF",r.parent.localeObj.getConstant("SF")))+(o.length!==t+1?",":""))}),n):""},KGt.prototype.resourceValueAccessor=function(e,t,i){t=t.ganttProperties;return je(t)?"":t.resourceNames},KGt.prototype.workValueAccessor=function(e,t,i){t=t.ganttProperties;return je(t)?"":this.parent.dataOperation.getWorkString(t.work,t.workUnit)},KGt.prototype.taskTypeValueAccessor=function(e,t,i){t=t.ganttProperties;return je(t)?"":t.taskType},KGt.prototype.modeValueAccessor=function(e,t,i){return t[e]?"Manual":"Auto"},KGt.prototype.idValueAccessor=function(e,t,i){return 0===t.level?"R-"+t.ganttProperties.taskId:"T-"+t.ganttProperties.taskId},KGt.prototype.updateScrollTop=function(e){e=R("top",e);this.treeGridElement.querySelector(".e-content").scrollTop=e,this.previousScroll.top=this.treeGridElement.querySelector(".e-content").scrollTop},KGt.prototype.treeGridClickHandler=function(e){this.parent.notify("treeGridClick",e)},KGt.prototype.removeEventListener=function(){this.parent.off("renderPanels",this.createContainer),this.parent.off("chartScroll",this.updateScrollTop),this.parent.off("destroy",this.destroy),this.parent.treeGrid.off("reactTemplateRender",this.renderReactTemplate)},KGt.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents(),this.parent.treeGrid.element&&this.parent.treeGrid.destroy()},KGt);function KGt(e){var s=this;this.isPersist=!1,this.previousScroll={top:0,left:0},this.queryCellInfo=function(e){s.parent.trigger("queryCellInfo",e)},this.headerCellInfo=function(e){s.parent.trigger("headerCellInfo",e)},this.rowDataBound=function(e){s.parent.trigger("rowDataBound",e)},this.columnMenuOpen=function(e){s.parent.notify("columnMenuOpen",e),s.parent.trigger("columnMenuOpen",e),document.querySelector(".e-colmenu").addEventListener("mousemove",function(){var e=document.querySelector(".e-filter-popup"),t=document.querySelector(".e-filter-item");je(e)||t.classList.contains("e-focused")||ue(s.parent.filterModule.filterMenuElement)})},this.columnMenuClick=function(e){s.parent.trigger("columnMenuClick",e)},this.objectEqualityChecker=function(e,t){if(e){for(var i=Object.keys(e),n=!0,o=["Children","childRecords","taskData","uniqueID","parentItem","parentUniqueID","ganttProperties"],r=0;r<i.length;r++)if((e[i[parseInt(r.toString(),10)]]instanceof Date?new Date(e[i[parseInt(r.toString(),10)]]).getTime():e[i[parseInt(r.toString(),10)]])!==(t[i[parseInt(r.toString(),10)]]instanceof Date?new Date(t[i[parseInt(r.toString(),10)]]).getTime():t[i[parseInt(r.toString(),10)]])&&-1===o.indexOf(i[r])){s.parent.modifiedRecords.push(t),n=!1;break}return n}return!1},this.parent=e,this.parent.treeGrid=new eee,this.parent.treeGrid.allowSelection=!1,this.parent.treeGrid.allowKeyboard=this.parent.allowKeyboard,this.parent.treeGrid["${enableHtmlSanitizer}"]=this.parent.enableHtmlSanitizer,this.parent.treeGrid.enableImmutableMode=this.parent.enableImmutableMode,this.treeGridColumns=[],!this.parent.isLocaleChanged&&this.parent.isLoad&&(this.parent.previousGanttColumns=Pe([],[],this.parent.columns,!0)),this.validateGanttColumns(),this.parent.isLocaleChanged&&(this.parent.isLocaleChanged=!1),this.addEventListener()}JGt=function(e,t){return(JGt=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])}))(e,t)};var JGt,ZGt,gg=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Tg=(function(e,t){function i(){this.constructor=e}JGt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}($Gt,ZGt=n),gg([e(null)],$Gt.prototype,"from",void 0),gg([e(null)],$Gt.prototype,"to",void 0),$Gt);function $Gt(){return null!==ZGt&&ZGt.apply(this,arguments)||this}eYt=function(e,t){return(eYt=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])}))(e,t)};var eYt,tYt,vg=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Xd=(function(e,t){function i(){this.constructor=e}eYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(iYt,tYt=n),vg([e(null)],iYt.prototype,"type",void 0),vg([e(null)],iYt.prototype,"headerText",void 0),vg([e([])],iYt.prototype,"fields",void 0),vg([e({})],iYt.prototype,"additionalParams",void 0),iYt);function iYt(){return null!==tYt&&tYt.apply(this,arguments)||this}nYt=function(e,t){return(nYt=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])}))(e,t)};var nYt,oYt,Pc=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},nf=(function(e,t){function i(){this.constructor=e}nYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(rYt,oYt=n),Pc([e(null)],rYt.prototype,"type",void 0),Pc([e(null)],rYt.prototype,"headerText",void 0),Pc([e([])],rYt.prototype,"fields",void 0),Pc([e({})],rYt.prototype,"additionalParams",void 0),rYt);function rYt(){return null!==oYt&&oYt.apply(this,arguments)||this}sYt=function(e,t){return(sYt=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])}))(e,t)};var sYt,aYt,s=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},sf=(function(e,t){function i(){this.constructor=e}sYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(lYt,aYt=n),s([e(!1)],lYt.prototype,"allowEditing",void 0),s([e(!1)],lYt.prototype,"allowAdding",void 0),s([e(!1)],lYt.prototype,"allowDeleting",void 0),s([e("Auto")],lYt.prototype,"mode",void 0),s([e("Top")],lYt.prototype,"newRowPosition",void 0),s([e(!1)],lYt.prototype,"showDeleteConfirmDialog",void 0),s([e(!1)],lYt.prototype,"allowTaskbarEditing",void 0),s([e(!1)],lYt.prototype,"allowNextRowEdit",void 0),lYt);function lYt(){return null!==aYt&&aYt.apply(this,arguments)||this}hYt=function(e,t){return(hYt=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])}))(e,t)};var hYt,dYt,af=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},qf=(function(e,t){function i(){this.constructor=e}hYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(pYt,dYt=n),af([e(null)],pYt.prototype,"day",void 0),af([e(null)],pYt.prototype,"label",void 0),af([e(null)],pYt.prototype,"cssClass",void 0),pYt);function pYt(){return null!==dYt&&dYt.apply(this,arguments)||this}cYt=function(e,t){return(cYt=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])}))(e,t)};var cYt,uYt,ey=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},C4=(function(e,t){function i(){this.constructor=e}cYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(gYt,uYt=n),ey([kt([],Uk)],gYt.prototype,"columns",void 0),ey([e("Menu")],gYt.prototype,"type",void 0),ey([e()],gYt.prototype,"operators",void 0),ey([e(!1)],gYt.prototype,"ignoreAccent",void 0),ey([e("Parent")],gYt.prototype,"hierarchyMode",void 0),gYt);function gYt(){return null!==uYt&&uYt.apply(this,arguments)||this}mYt=function(e,t){return(mYt=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])}))(e,t)};var mYt,fYt,h3=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},C5=(function(e,t){function i(){this.constructor=e}mYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(yYt,fYt=n),h3([e([])],yYt.prototype,"fields",void 0),h3([e(!1)],yYt.prototype,"ignoreCase",void 0),h3([e("contains")],yYt.prototype,"operator",void 0),h3([e("")],yYt.prototype,"key",void 0),h3([e("Parent")],yYt.prototype,"hierarchyMode",void 0),yYt);function yYt(){return null!==fYt&&fYt.apply(this,arguments)||this}vYt=function(e,t){return(vYt=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])}))(e,t)};var vYt,bYt,rz=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Iz=(function(e,t){function i(){this.constructor=e}vYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(wYt,bYt=n),rz([e(null)],wYt.prototype,"from",void 0),rz([e(null)],wYt.prototype,"to",void 0),rz([e(null)],wYt.prototype,"label",void 0),rz([e(null)],wYt.prototype,"cssClass",void 0),wYt);function wYt(){return null!==bYt&&bYt.apply(this,arguments)||this}CYt=function(e,t){return(CYt=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])}))(e,t)};var CYt,SYt,n3=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Jj=(function(e,t){function i(){this.constructor=e}CYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(AYt,SYt=n),n3([e(null)],AYt.prototype,"rightLabel",void 0),n3([e(null)],AYt.prototype,"leftLabel",void 0),n3([e(null)],AYt.prototype,"taskLabel",void 0),AYt);function AYt(){return null!==SYt&&SYt.apply(this,arguments)||this}xYt=function(e,t){return(xYt=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])}))(e,t)};var xYt,IYt,qo=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},$$=(function(e,t){function i(){this.constructor=e}xYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(TYt,IYt=n),qo([e("Row")],TYt.prototype,"mode",void 0),qo([e("Flow")],TYt.prototype,"cellSelectionMode",void 0),qo([e("Single")],TYt.prototype,"type",void 0),qo([e(!1)],TYt.prototype,"persistSelection",void 0),qo([e(!1)],TYt.prototype,"enableToggle",void 0),TYt);function TYt(){return null!==IYt&&IYt.apply(this,arguments)||this}EYt=function(e,t){return(EYt=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])}))(e,t)};var EYt,DYt,d2=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},M$=(function(e,t){function i(){this.constructor=e}EYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(MYt,DYt=n),d2([e(null)],MYt.prototype,"position",void 0),d2([e(-1)],MYt.prototype,"columnIndex",void 0),d2([e(4)],MYt.prototype,"separatorSize",void 0),d2([e(null)],MYt.prototype,"minimum",void 0),d2([e("Default")],MYt.prototype,"view",void 0),MYt);function MYt(){return null!==DYt&&DYt.apply(this,arguments)||this}kYt=function(e,t){return(kYt=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])}))(e,t)};var kYt,PYt,CW=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},EW=(function(e,t){function i(){this.constructor=e}kYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(BYt,PYt=n),CW([e(null)],BYt.prototype,"id",void 0),CW([e(null)],BYt.prototype,"name",void 0),CW([e(null)],BYt.prototype,"parentID",void 0),CW([e(null)],BYt.prototype,"hasChildMapping",void 0),CW([e(null)],BYt.prototype,"startDate",void 0),CW([e(null)],BYt.prototype,"endDate",void 0),CW([e(null)],BYt.prototype,"dependency",void 0),CW([e(null)],BYt.prototype,"progress",void 0),CW([e(null)],BYt.prototype,"child",void 0),CW([e(null)],BYt.prototype,"milestone",void 0),CW([e(null)],BYt.prototype,"duration",void 0),CW([e(null)],BYt.prototype,"durationUnit",void 0),CW([e(null)],BYt.prototype,"cssClass",void 0),CW([e(null)],BYt.prototype,"baselineStartDate",void 0),CW([e(null)],BYt.prototype,"baselineEndDate",void 0),CW([e(null)],BYt.prototype,"resourceInfo",void 0),CW([e(null)],BYt.prototype,"expandState",void 0),CW([e(null)],BYt.prototype,"indicators",void 0),CW([e(null)],BYt.prototype,"notes",void 0),CW([e(null)],BYt.prototype,"work",void 0),CW([e(null)],BYt.prototype,"manual",void 0),CW([e(null)],BYt.prototype,"type",void 0),CW([e(null)],BYt.prototype,"segments",void 0),CW([e(null)],BYt.prototype,"segmentId",void 0),BYt);function BYt(){return null!==PYt&&PYt.apply(this,arguments)||this}FYt=function(e,t){return(FYt=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])}))(e,t)};var FYt,LYt,c8=function(e,t){function i(){this.constructor=e}FYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},$8=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},$W=(c8(RYt,LYt=n),$8([e("")],RYt.prototype,"format",void 0),$8([e("None")],RYt.prototype,"unit",void 0),$8([e(1)],RYt.prototype,"count",void 0),$8([e(null)],RYt.prototype,"formatter",void 0),RYt);function RYt(){return null!==LYt&&LYt.apply(this,arguments)||this}c8(NYt,OYt=n),$8([e("Week")],NYt.prototype,"timelineViewMode",void 0),$8([t({},$W)],NYt.prototype,"topTier",void 0),$8([t({},$W)],NYt.prototype,"bottomTier",void 0),$8([e(33)],NYt.prototype,"timelineUnitSize",void 0),$8([e(0)],NYt.prototype,"weekStartDay",void 0),$8([e(null)],NYt.prototype,"weekendBackground",void 0),$8([e(!0)],NYt.prototype,"showTooltip",void 0),$8([e(!0)],NYt.prototype,"updateTimescaleView",void 0);var OYt,IQ=NYt;function NYt(){return null!==OYt&&OYt.apply(this,arguments)||this}VYt=function(e,t){return(VYt=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])}))(e,t)};var VYt,_Yt,s6=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},b8=(function(e,t){function i(){this.constructor=e}VYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(HYt,_Yt=n),s6([e(!0)],HYt.prototype,"showTooltip",void 0),s6([e()],HYt.prototype,"taskbar",void 0),s6([e()],HYt.prototype,"baseline",void 0),s6([e()],HYt.prototype,"connectorLine",void 0),s6([e()],HYt.prototype,"editing",void 0),s6([e()],HYt.prototype,"timeline",void 0),HYt);function HYt(){return null!==_Yt&&_Yt.apply(this,arguments)||this}zYt=function(e,t){return(zYt=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])}))(e,t)};var zYt,jYt,xW=function(e,t){function i(){this.constructor=e}zYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},wH=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},DQ=(xW(WYt,jYt=n),wH([e()],WYt.prototype,"field",void 0),wH([e()],WYt.prototype,"direction",void 0),WYt);function WYt(){return null!==jYt&&jYt.apply(this,arguments)||this}xW(UYt,QYt=n),wH([kt([],DQ)],UYt.prototype,"columns",void 0),wH([e(!0)],UYt.prototype,"allowUnsort",void 0);var QYt,Wz=UYt;function UYt(){return null!==QYt&&QYt.apply(this,arguments)||this}qYt=function(e,t){return(qYt=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])}))(e,t)};var qYt,GYt,h6=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Tft=(function(e,t){function i(){this.constructor=e}qYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(YYt,GYt=n),h6([e(null)],YYt.prototype,"id",void 0),h6([e(null)],YYt.prototype,"name",void 0),h6([e(null)],YYt.prototype,"unit",void 0),h6([e(null)],YYt.prototype,"group",void 0),YYt);function YYt(){return null!==GYt&&GYt.apply(this,arguments)||this}XYt=function(e,t){return(XYt=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])}))(e,t)};var XYt,KYt,Gmt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},X$e=(function(e,t){function i(){this.constructor=e}XYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(JYt,KYt=n),Gmt([e("Spinner")],JYt.prototype,"indicatorType",void 0),JYt);function JYt(){return null!==KYt&&KYt.apply(this,arguments)||this}ZYt=function(e,t){return(ZYt=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])}))(e,t)};var ZYt,$Yt,zmt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Met=(function(e,t){function i(){this.constructor=e}ZYt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(eXt,$Yt=n),zmt([e()],eXt.prototype,"dayOfWeek",void 0),zmt([kt([],Tg)],eXt.prototype,"timeRange",void 0),eXt);function eXt(){return null!==$Yt&&$Yt.apply(this,arguments)||this}tXt=function(e,t){return(tXt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}tXt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(oXt,iXt=vqt),oXt.prototype.initPublicProp=function(){this.ganttChartTableBody=null},oXt.prototype.addEventListener=function(){this.parent.on("renderPanels",this.createChartTable,this),this.parent.on("dataReady",this.initiateTemplates,this),this.parent.on("destroy",this.destroy,this)},oXt.prototype.refreshChartByTimeline=function(){this.taskTable.style.width=T(this.parent.enableTimelineVirtualization?this.parent.timelineModule.wholeTimelineWidth:this.parent.timelineModule.totalTimelineWidth);var e=R("prevProjectStartDate",this.parent.dataOperation),t=!1;e&&(t=e.getTime()===this.parent.cloneProjectStartDate.getTime()),this.isUpdated=!!(this.parent.isFromOnPropertyChange&&t&&R("mutableData",this.parent.treeGrid.grid.contentModule)),this.refreshGanttRows(),this.isUpdated=!0},oXt.prototype.createChartTable=function(){this.taskTable=Q("table",{className:"e-task-table e-zero-spacing",id:"GanttTaskTable"+this.parent.element.id,styles:"position: absolute;width:"+(this.parent.enableTimelineVirtualization?this.parent.timelineModule.wholeTimelineWidth:this.parent.timelineModule.totalTimelineWidth)+"px;",attrs:{cellspacing:"0.25px"}});var e=Q("colgroup"),t=Q("col",{styles:"width:"+this.parent.timelineModule.totalTimelineWidth+"px;"});e.appendChild(t),this.taskTable.appendChild(e),this.ganttChartTableBody=Q("tbody",{id:this.parent.element.id+"GanttTaskTableBody"}),this.taskTable.appendChild(this.ganttChartTableBody),this.parent.ganttChartModule.chartBodyContent.appendChild(this.taskTable)},oXt.prototype.initiateTemplates=function(){this.taskTable.style.width=T(this.parent.enableTimelineVirtualization?this.parent.timelineModule.wholeTimelineWidth:this.parent.timelineModule.totalTimelineWidth),this.initChartHelperPrivateVariable(),this.initializeChartTemplate()},oXt.prototype.renderChartRows=function(){this.createTaskbarTemplate(),this.parent.isGanttChartRendered=!0},oXt.prototype.getIndicatorNode=function(e){e='<label class="e-label e-indicator-span" style="display: inline-flex; align-items: center; margin-top: 0; line-height:'+this.parent.rowHeight+"px;"+(this.parent.enableRtl?"right:":"left:")+this.getIndicatorleft(e.date)+'px;"><i class="'+e.iconClass+'" style="margin-right: 3px;"></i> </label>';return this.createDivElement(e)},oXt.prototype.getIndicatorleft=function(e){return e=this.parent.dateValidationModule.getDateFromFormat(e),this.parent.dataOperation.getTaskLeft(e,!1)},oXt.prototype.getChildTaskbarNode=function(e,t){var i,n,o,r,s=null,a=this.templateData,l=this.parent.enableRtl?"right:":"left:",s=this.childTaskbarTemplateFunction?this.childTaskbarTemplateFunction(Pe({index:e},a),this.parent,"TaskbarTemplate",this.getTemplateID("TaskbarTemplate"),!1,void 0,t[0],this.parent.treeGrid.root):(r=t="",n=i=void 0,a.ganttProperties.startDate&&a.ganttProperties.endDate&&a.ganttProperties.duration&&(i=this.createDivElement('<div class="'+Nqt+" "+eGt+" "+(a.ganttProperties.isAutoSchedule?"":rGt)+'"style="width:'+a.ganttProperties.width+"px;height:"+this.taskBarHeight+'px; margin-top :-1px"></div>'),n=this.createDivElement('<div class="'+Vqt+" "+tGt+" "+(a.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualprogressbar")+'" style="border-style:'+(a.ganttProperties.progressWidth?"solid;":"none;")+"width:"+a.ganttProperties.progressWidth+"px;height:100%;border-top-right-radius:"+this.getBorderRadius(a.ganttProperties)+"px;border-bottom-right-radius:"+this.getBorderRadius(a.ganttProperties)+'px;"></div>')),o=Q("div"),this.taskLabelTemplateFunction&&!je(n)&&0<n.length?(e=this.taskLabelTemplateFunction(Pe({index:e},a),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1,void 0,n[0]))&&0<e.length&&(ht(e,o),t=o.innerHTML):(e=this.parent.labelSettings.taskLabel,t="isCustomTemplate"===(t=this.getTaskLabel(e))?this.parent.labelSettings.taskLabel:t,this.parent.enableHtmlSanitizer&&"string"==typeof t&&(t=go.sanitize(t))),-1===t.indexOf("null")&&("isCustomTemplate"!==this.getTaskLabel(this.parent.labelSettings.taskLabel)||this.isTemplate(this.parent.labelSettings.taskLabel)||(t=""),r=isNaN(parseInt(t,10))?'<span class="'+Oqt+'" style="line-height:'+(this.taskBarHeight-1)+"px; text-align:"+(this.parent.enableRtl?"right;":"left;")+"display:inline-block;width:"+(a.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;"></span>':'<span class="'+Oqt+'" style="line-height:'+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"text-align:"+(this.parent.enableRtl?"right;":"left;"):"")+ +("ResourceView"===this.parent.viewType?"display:inline-flex;":"")+ +("ResourceView"===this.parent.viewType?a.ganttProperties.width-10:"")+"px; height:"+this.taskBarHeight+'px;"></span>'),e=!je(a.ganttProperties.segments)&&0<a.ganttProperties.segments.length?this.splitTaskbar(a,t):a.ganttProperties.startDate&&a.ganttProperties.endDate&&a.ganttProperties.duration?r:!a.ganttProperties.startDate||a.ganttProperties.endDate||a.ganttProperties.duration?!a.ganttProperties.endDate||a.ganttProperties.startDate||a.ganttProperties.duration?!a.ganttProperties.duration||a.ganttProperties.startDate||a.ganttProperties.endDate?"":'<div class="'+Vqt+" "+eGt+" e-gantt-unscheduled-taskbar "+(a.ganttProperties.isAutoSchedule?"":rGt)+'"style="'+l+a.ganttProperties.left+"px; width:"+a.ganttProperties.width+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+Vqt+" "+eGt+" "+fGt+" "+(a.ganttProperties.isAutoSchedule?"":rGt)+'"style="'+l+a.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+Vqt+" "+eGt+" "+mGt+" "+(a.ganttProperties.isAutoSchedule?"":rGt)+'"style="'+l+a.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>',a.ganttProperties.segments&&0<a.ganttProperties.segments.length&&(e+=this.getSplitProgressResizerNode()),a.ganttProperties.startDate&&a.ganttProperties.endDate&&a.ganttProperties.duration&&(je(a.ganttProperties.segments)||!je(a.ganttProperties.segments)&&0===a.ganttProperties.segments.length)?(""!==e&&!je(n)&&0<n.length&&(r=this.createDivElement(e)[0],this.parent.disableHtmlEncode?r.innerText=t:r.innerHTML=t,(l=this.parent.labelSettings.taskLabel)&&l.elementRef&&r.appendChild(o),n[0].appendChild(r),""!==n[0].querySelectorAll(".e-task-label")[0].textContent&&!this.isTemplate(l)&&n[0].querySelectorAll(".e-task-label")[0].children[0]&&n[0].querySelectorAll(".e-task-label")[0].children[0].remove(),""===n[0].querySelectorAll(".e-task-label")[0].textContent)&&l&&!l.elementRef&&""!==o.innerHTML&&(n[0].querySelectorAll(".e-task-label")[0].textContent=l),!je(i)&&0<i.length&&i[0].appendChild([].slice.call(n)[0]),i):this.createDivElement(e));return this.parent.enableRtl&&!je(s)&&s[0]&&s[0].querySelector(".e-task-label")&&(s[0].querySelector(".e-task-label").style.marginLeft="15px",s[0].querySelector(".e-task-label").style.marginRight="8px",s[0].querySelector(".e-gantt-child-progressbar"))&&(s[0].querySelector(".e-gantt-child-progressbar").style.textAlign="left"),s},oXt.prototype.splitTaskbar=function(e,t){for(var i="",n=0;n<e.ganttProperties.segments.length;n++){var o=e.ganttProperties.segments[n],r=void 0,r=o.showProgress?"initial":"hidden",s=0===n?"e-segment-first":n===e.ganttProperties.segments.length-1?"e-segment-last":"e-segment-inprogress";i+='<div class="'+Nqt+" "+s+" "+eGt+'  e-segmented-taskbar"style="width:'+o.width+"px;position: absolute;"+(this.parent.enableRtl?"right:":"left:")+o.left+"px;height:"+this.taskBarHeight+"px; overflow:"+r+';" data-segment-index = "'+n+'" aria-label = "'+this.generateSpiltTaskAriaLabel(o,e.ganttProperties)+'"> '+this.getSplitTaskbarLeftResizerNode()+'<div class="'+Vqt+" "+tGt+' " style="border-style:'+(o.progressWidth?"solid;":"none;")+"display:"+(0<=o.progressWidth?"block;":"none;")+"width:"+o.progressWidth+"px;height:100%;text-align:"+(this.parent.enableRtl?"left;":"right;")+"border-top-right-radius:"+this.getSplitTaskBorderRadius(o)+"px;border-bottom-right-radius:"+this.getSplitTaskBorderRadius(o)+'px;"><span class="'+Oqt+'" style="line-height:'+(this.taskBarHeight-1)+"px;display:"+(o.showProgress?"inline;":"none;")+"height:"+this.taskBarHeight+'px;">'+t+"</span></div>"+this.getSplitTaskbarRightResizerNode(o)+"</div></div>"}return i},oXt.prototype.getSplitTaskbarLeftResizerNode=function(){var e=!je(document.body.className)&&document.body.className.includes("e-bigger")?5:-2;return'<div class="'+qqt+" "+Zqt+'" style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>'},oXt.prototype.getSplitTaskbarRightResizerNode=function(e){var t=!je(document.body.className)&&document.body.className.includes("e-bigger")?-17:-10;return'<div class="'+Gqt+" "+Zqt+'" style="'+(this.parent.enableRtl?"right:":"left:")+(e.width+t)+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>'},oXt.prototype.getSplitProgressResizerNode=function(){var e=this.parent.enableRtl?this.templateData.ganttProperties.progressWidth+8:this.templateData.ganttProperties.progressWidth-6;return'<div class="'+Yqt+'" style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="'+Xqt+'"><div class="'+Kqt+'"></div><div class="'+Jqt+'"></div></div>'},oXt.prototype.getSegmentIndex=function(e,t){var i=-1,n=t.ganttProperties,o=n.segments;if(!je(o)){o.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()});for(var r=o.length,s=0;s<r;s++){var a,l,h=o[s];e.getTime()===n.startDate.getTime()?(this.dropSplit=!0,i=0):e.getTime()===h.startDate.getTime()?(this.dropSplit=!0,(a=h.startDate).setDate(a.getDate()+1),a=h.startDate=this.parent.dataOperation.checkStartDate(a,n,!1),h.startDate=a,l=h.endDate,l=this.parent.dataOperation.getEndDate(a,h.duration,n.durationUnit,n,!1),h.endDate=l,s===o.length-1&&this.parent.setRecordValue("endDate",l,n,!0),this.incrementSegments(o,s,t),i=h.segmentIndex):(h.endDate=this.parent.dataOperation.getEndDate(h.startDate,h.duration,n.durationUnit,n,!1),e.getTime()>=h.startDate.getTime()&&e.getTime()<=h.endDate.getTime()&&(i=h.segmentIndex)),this.parent.setRecordValue("segments",n.segments,n,!0)}}return-1===i&&(this.dropSplit=!0),i},oXt.prototype.mergeTask=function(t,e){var i,n,o=e.length,r=this.parent.taskFields,s=this.parent.flatData.filter(function(e){return e[r.id]===t?e:null})[0],a=(this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&(i={action:"MergeTaskbar"},this.parent.isUndoRedoItemPresent("Edit"))&&(this.parent.editModule&&this.parent.editModule.taskbarEditModule.isDragged&&0<this.parent.getUndoActions().length&&this.parent.undoRedoModule.getUndoCollection.splice(this.parent.undoRedoModule.getUndoCollection.length-1,1),this.parent.undoRedoModule.createUndoCollection(),n=this.parent.previousFlatData[s.index],i.modifiedRecords=Pe([],[n],[],!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=i),s.ganttProperties.segments);e=e.sort(function(e,t){return t.firstSegmentIndex-e.firstSegmentIndex});for(var l,h=0;h<o;h++){var d=a[e[h].firstSegmentIndex],p=a[e[h].secondSegmentIndex],p=d.duration+p.duration,c=this.parent.dataOperation.getEndDate(d.startDate,p,s.ganttProperties.durationUnit,s.ganttProperties,!1),d={startDate:d.startDate,endDate:c,duration:p},p=e[h].firstSegmentIndex;a.splice(p,2,d),this.parent.setRecordValue("segments",a,s.ganttProperties,!0),this.parent.dataOperation.updateMappingData(s,"segments"),1===a.length?(this.parent.setRecordValue("endDate",c,s.ganttProperties,!0),this.parent.setRecordValue("EndDate",c,s,!0),this.parent.setRecordValue("segments",null,s.ganttProperties,!0),this.parent.dataOperation.updateMappingData(s,"segments")):s.ganttProperties.endDate!==a[a.length-1].endDate&&this.parent.setRecordValue("endDate",a[a.length-1].endDate,s.ganttProperties,!0)}je(s[r.segments])||je(s[r.segments][0])||(l=Object.keys(s[r.segments][0]));for(var u=[],g=0;g<a.length;g++)je(l)||u[g]||(u[g]={}),je(l)||-1===l.indexOf("StartDate")||(u[g][r.startDate]=a[g].startDate),je(l)||-1===l.indexOf("EndDate")||(u[g][r.endDate]=a[g].endDate),je(l)||-1===l.indexOf("Duration")||(u[g][r.duration]=a[g].duration);s[r.segments]=u,this.updateSegment(s.ganttProperties.segments,t),this.refreshChartAfterSegment(s,"mergeSegment")},oXt.prototype.updateSegment=function(e,t){var i=this;if(!je(this.parent.taskFields.segmentId)&&0<this.parent.segmentData.length){if(je(e))a=this.parent.segmentData.filter(function(e){return!(t===e[i.parent.taskFields.segmentId])});else{for(var n=[],o=0;o<e.length;o++){var r={},s=e[o];r[this.parent.taskFields.segmentId]=t,je(this.parent.taskFields.startDate)||(r[this.parent.taskFields.startDate]=s.startDate),je(this.parent.taskFields.duration)||(r[this.parent.taskFields.duration]=s.duration),je(this.parent.taskFields.endDate)||(r[this.parent.taskFields.endDate]=s.endDate),n.push(r)}for(var a=this.parent.segmentData.filter(function(e){return!(t===e[i.parent.taskFields.segmentId])}),o=0;o<n.length;o++)a.push(n[o])}this.parent.segmentData=a}},oXt.prototype.refreshChartAfterSegment=function(e,t){this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(e,!1),e.ganttProperties,!0),this.parent.dataOperation.updateMappingData(e,"segments"),this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.updateParentItems(e),e.ganttProperties.sharedTaskUniqueIds&&1<e.ganttProperties.sharedTaskUniqueIds.length&&this.parent.editModule.updateSharedTask(e),this.parent.predecessorModule&&this.parent.taskFields.dependency&&(this.parent.predecessorModule.updatedRecordsDateByPredecessor(),this.parent.connectorLineModule.removePreviousConnectorLines(this.parent.flatData),this.parent.connectorLineEditModule.refreshEditedRecordConnectorLine(this.parent.flatData),e.parentItem)&&this.parent.getParentTask(e.parentItem).ganttProperties.isAutoSchedule&&this.parent.isInPredecessorValidation&&this.parent.dataOperation.updateParentItems(e.parentItem),this.refreshRecords(this.parent.currentViewData);var i=this.ganttChartTableBody.querySelectorAll("tr")[this.parent.currentViewData.indexOf(e)],n={requestType:t,rowData:e,modifiedRecords:this.parent.editedRecords,modifiedTaskData:pqt(this.parent.editedRecords,!0)},o=(this.triggerQueryTaskbarInfoByIndex(i,e),this.parent.selectionModule&&this.parent.selectionModule.clearSelection(),n.rowData.taskData[this.parent.taskFields.segments]);if(this.parent.timezone&&null!=o)for(var r=0;r<o.length;r++)o[r][this.parent.taskFields.startDate]=this.parent.dateValidationModule.remove(n.rowData.ganttProperties.segments[r].startDate,this.parent.timezone),this.parent.taskFields.endDate&&(o[r][this.parent.taskFields.endDate]=this.parent.dateValidationModule.remove(n.rowData.ganttProperties.segments[r].endDate,this.parent.timezone));this.parent.trigger("actionComplete",n),je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),x("isEdit",!1,this.parent.contextMenuModule),x("isEdit",!1,this.parent)},oXt.prototype.splitTask=function(t,e){var i=this.parent.taskFields,n=e,o=this.parent.flatData.filter(function(e){return e[i.id]===t?e:null})[0],r=(this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&(r={action:"MergeTaskbar"},this.parent.isUndoRedoItemPresent("Edit"))&&(this.parent.undoRedoModule.createUndoCollection(),r.modifiedRecords=Pe([],[o],[],!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=r),o.ganttProperties),s=(this.dropSplit=!1,-1),a=r.segments;if(je(e.length)||e.length<0){var l=this.parent.dataOperation.checkStartDate(n,r,!1);if(l.getTime()!==r.startDate.getTime()&&r.isAutoSchedule){if(!je(a)&&0<a.length&&(s=this.getSegmentIndex(l,o)),!1===this.dropSplit&&n.getTime()>r.startDate.getTime()&&n.getTime()<r.endDate.getTime()){for(var a=-1!==s?a:[],l=-1!==s?a[s].startDate:new Date(r.startDate.getTime()),h=-1!==s?a[s].endDate:new Date(r.endDate.getTime()),d=this.parent.dataOperation.getDuration(l,h,r.durationUnit,r.isAutoSchedule,r.isMilestone),p=(this.parent.setRecordValue("segments",this.splitSegmentedTaskbar(l,h,n,s,a,o,d),r,!0),[]),c=0;c<a.length;c++)p[c]||(p[c]={}),p[c][i.startDate]=a[c].startDate,p[c][i.endDate]=a[c].endDate,p[c][i.duration]=a[c].duration;o[i.segments]=p,-1!==s&&this.incrementSegments(a,s+1,o),this.parent.setRecordValue("endDate",a[a.length-1].endDate,r,!0),this.parent.taskFields.endDate&&this.parent.dataOperation.updateMappingData(o,"endDate")}this.updateSegment(o.ganttProperties.segments,t),this.refreshChartAfterSegment(o,"splitTaskbar")}}else e.sort(function(e,t){return e.getTime()-t.getTime()}),this.parent.setRecordValue("segments",this.constructSegments(e,o.ganttProperties),o.ganttProperties,!0),this.updateSegment(o.ganttProperties.segments,t),this.refreshChartAfterSegment(o,"splitTask")},oXt.prototype.constructSegments=function(e,t){for(var i,n,o=[],r=new Date,s=0;s<e.length+1&&(r=0===s?t.startDate:r,r=this.parent.dataOperation.checkStartDate(r,t,!1),i=s===e.length||new Date(e[s].getTime())>t.endDate?t.endDate:new Date(e[s].getTime()),i=this.parent.dataOperation.checkEndDate(i,t,!1),n=this.parent.dataOperation.getDuration(r,i,t.durationUnit,t.isAutoSchedule,t.isMilestone),i.getTime()>=r.getTime()&&o.push({startDate:r,endDate:i,duration:n}),s!==e.length);s++)(r=new Date(e[s].getTime())).setDate(e[s].getDate()+1);return o},oXt.prototype.splitSegmentedTaskbar=function(e,t,i,n,o,r,s){var a=r.ganttProperties,r=this.parent.includeWeekend?-1:this.parent.nonWorkingDayIndex.indexOf(i.getDay()),l=-1===r?0:0===r||1===r?1:2,h=(e=this.parent.dataOperation.checkStartDate(e,a,!1),new Date(i.getTime()));h=this.parent.dataOperation.checkEndDate(h,a,!1);for(var d=0;d<2;d++){0<this.parent.weekWorkingTime.length&&(p=this.parent.getCurrentDayEndTime(h),this.setTime(p,h));var p={startDate:e,endDate:h,duration:this.parent.dataOperation.getDuration(e,h,a.durationUnit,a.isAutoSchedule,a.isMilestone),offsetDuration:1},c=this.parent.includeWeekend?-1:this.parent.nonWorkingDayIndex.indexOf(h.getDay()),u=(-1!==n&&(o.splice(n,1),n=-1),o.push(p),this.parent.timelineModule.customTimelineSettings.bottomTier.unit);if("Hour"===u||"Minutes"===u){e=new Date(i.getTime()),e=this.parent.dataOperation.checkStartDate(e,a,!1);var u=this.parent.timelineModule.customTimelineSettings.bottomTier.count,g=this.parent.timelineModule.customTimelineSettings.bottomTier.unit,m=this.parent.timelineModule.getIncrement(e,u,g),f=e.getTime()+m;e.setTime(f+l),h=new Date(t.getTime()),m=this.parent.timelineModule.getIncrement(h,u,g),f=h.getTime()+m,h.setTime(f+l)}else{(e=new Date(i.getTime())).setDate(e.getDate()+1+l);u=this.parent.getCurrentDayStartTime(e);if(this.setTime(u,e),e=this.parent.dataOperation.checkStartDate(e,a,!1),!this.parent.taskFields.duration&&l<=0&&e.setDate(e.getDate()+1),(h=new Date(t.getTime()))<e&&h.setDate(h.getDate()+1),this.isOnHolidayOrWeekEnd(h,!0))for(;h.setDate(h.getDate()+1),this.isOnHolidayOrWeekEnd(h,!0););this.parent.includeWeekend||(h=this.getNextWorkingDay(h))}h=-1!==c?this.parent.dataOperation.getEndDate(e,s-p.duration,a.durationUnit,a,!1):this.parent.dataOperation.checkEndDate(h,a,!1)}return o.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()}),o},oXt.prototype.incrementSegments=function(e,t,i){for(var n=i.ganttProperties,o=t+1;o<e.length;o++){var r=e[o],s=0!==o?new Date(e[o-1].endDate.getTime()):new Date(r.startDate.getTime()),s=(this.parent.dataOperation.fromSegments=!0,s=this.parent.dataOperation.getEndDate(s,r.offsetDuration,n.durationUnit,n,!1),this.parent.dataOperation.fromSegments=!1,s=this.parent.dataOperation.checkStartDate(s,n,!1),r.startDate=s,r.endDate=this.parent.dataOperation.getEndDate(s,r.duration,n.durationUnit,n,!1));r.endDate=s,o===e.length-1&&(this.parent.setRecordValue("endDate",s,n,!0),this.parent.taskFields.endDate)&&this.parent.dataOperation.updateMappingData(i,"endDate")}e.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()}),this.parent.setRecordValue("segments",e,n,!0),this.parent.dataOperation.updateMappingData(i,"segments")},oXt.prototype.calculateLeftValue=function(e){var t=this.parent.renderBaseline?.45:!je(document.body.className)&&document.body.className.includes("e-bigger")?.7:.62,t=Math.floor(this.parent.rowHeight*t);return!je(this.parent.taskbarHeight)&&this.parent.taskbarHeight<=t||je(this.parent.taskbarHeight)&&e<=36||e<=36?1:-1/12*(e-36)+1},oXt.prototype.getMilestoneNode=function(e,t){var i=this.templateData,n=this.parent.rowHeight,n=this.calculateLeftValue(n);return this.milestoneTemplateFunction?this.milestoneTemplateFunction(Pe({index:e},i),this.parent,"MilestoneTemplate",this.getTemplateID("MilestoneTemplate"),!1,void 0,t[0],this.parent.treeGrid.root):(e='<div class="'+$qt+'" style="width:'+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-6)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-6)+"px;position:absolute;transform: rotate(45deg);left:"+n+'px;"> </div>',this.createDivElement(e))},oXt.prototype.getTaskBaselineNode=function(){var e=this.templateData,e='<div class="'+jqt+' " role="term" style="margin-top:'+this.baselineTop+"px;"+(this.parent.enableRtl?"right:":"left:")+e.ganttProperties.baselineLeft+"px;width:"+e.ganttProperties.baselineWidth+"px;height:"+this.baselineHeight+"px;"+(this.baselineColor?"background-color: "+this.baselineColor+";":"")+'"></div>';return this.createDivElement(e)},oXt.prototype.updateTaskBaselineNode=function(e){e='<div class="'+jqt+' " role="term" style="margin-top:'+this.baselineTop+"px;"+(this.parent.enableRtl?"right:":"left:")+e.ganttProperties.baselineLeft+"px;width:"+e.ganttProperties.baselineWidth+"px;height:"+this.baselineHeight+"px;"+(this.baselineColor?"background-color: "+this.baselineColor+";":"")+'"></div>';return this.createDivElement(e)},oXt.prototype.getMilestoneBaselineNode=function(){var e=this.templateData,t=this.parent.renderBaseline?5:2,e='<div class="'+Wqt+'" style="width:'+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-10)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-10)+"px;position:absolute;transform:rotate(45deg);"+(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e.ganttProperties.left-this.milestoneHeight/2+3:e.ganttProperties.baselineLeft-this.milestoneHeight/2+1)+"px;"+(this.baselineColor?"background-color: "+this.baselineColor+";":"")+"margin-top:"+(-Math.floor(this.parent.rowHeight-this.milestoneMarginTop)+t+2)+'px"> </div>';return this.createDivElement(e)},oXt.prototype.getLeftLabelNode=function(e){var t,i=this.leftLabelContainer(),n=(""!==this.generateTaskLabelAriaLabel("left")&&i[0].setAttribute("aria-label",this.generateTaskLabelAriaLabel("left")),null);return this.leftTaskLabelTemplateFunction?n=this.leftTaskLabelTemplateFunction(Pe({index:e},this.templateData),this.parent,"LeftLabelTemplate",this.getTemplateID("LeftLabelTemplate"),!1,void 0,i[0],this.parent.treeGrid.root):(e=this.parent.labelSettings.leftLabel,(t=this.getTaskLabel(e))&&(n=this.getLableText(t="isCustomTemplate"===t?e:t,Bqt),this.parent.enableHtmlSanitizer)&&"string"==typeof t&&(t=go.sanitize(t),n=this.getLableText(t="isCustomTemplate"===t?e:t,Bqt))),n&&0<n.length&&("null"===n[0].data&&(n[0].data=""),ht(n,i[0])),this.parent.enableRtl&&(i[0].style.paddingLeft="25px",i[0].style.paddingRight="0px"),i},oXt.prototype.getLableText=function(e,t){var i=this.parent.renderBaseline?(this.parent.rowHeight-this.taskBarHeight)/2:this.taskBarMarginTop,t=Q("div",{className:t,styles:"height:"+this.taskBarHeight+"px;margin-top:"+i+"px;"}),i=Q("span",{className:uGt}),e=(i[this.parent.disableHtmlEncode?"textContent":"innerHTML"]=e,t.appendChild(i),Q("div"));return e.appendChild(t),e.childNodes},oXt.prototype.getRightLabelNode=function(e){var t,i=this.rightLabelContainer(),n=(""!==this.generateTaskLabelAriaLabel("right")&&i[0].setAttribute("aria-label",this.generateTaskLabelAriaLabel("right")),null);return this.rightTaskLabelTemplateFunction?n=this.rightTaskLabelTemplateFunction(Pe({index:e},this.templateData),this.parent,"RightLabelTemplate",this.getTemplateID("RightLabelTemplate"),!1,void 0,i[0],this.parent.treeGrid.root):(e=this.parent.labelSettings.rightLabel,(t=this.getTaskLabel(e))&&(n=this.getLableText(t="isCustomTemplate"===t?e:t,Lqt),this.parent.enableHtmlSanitizer)&&"string"==typeof t&&(t=go.sanitize(t),n=this.getLableText(t="isCustomTemplate"===t?e:t,Lqt))),n&&0<n.length&&("null"===n[0].data&&(n[0].data=""),ht(n,i[0])),this.parent.enableRtl&&(i[0].style.marginLeft="0px",i[0].style.paddingRight="25px"),i},oXt.prototype.getManualTaskbar=function(){var e=this.templateData,t=this.taskBarHeight/2-1,i=(e.ganttProperties.startDate&&e.ganttProperties.endDate&&(e.ganttProperties.duration||e.hasChildRecords)?'<div class="'+nGt+'" style="width:'+e.ganttProperties.width+"px;height:"+t/5+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div>':e.ganttProperties.startDate||e.ganttProperties.endDate||!e.ganttProperties.duration?'<div class="'+nGt+" "+(e.ganttProperties.startDate?mGt:fGt)+'" style="width:'+e.ganttProperties.width+"px;height:"+2*t+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div>':'<div class="'+nGt+' e-gantt-unscheduled-manualtask" style="width:'+e.ganttProperties.width+"px;height:"+(t/5+1)+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div>')+(e.ganttProperties.startDate&&e.ganttProperties.endDate&&(e.ganttProperties.duration||e.hasChildRecords)||e.ganttProperties.duration?'<div class="e-gantt-manualparenttaskbar-left" style='+(this.parent.enableRtl?"margin-right:0px;":"")+'"height:'+(t/5+8)+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div><div class="e-gantt-manualparenttaskbar-right" style="'+(this.parent.enableRtl?"margin-right:-8px;":"")+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.width-Math.floor((t/5+8)/5))+"px;height:"+(t/5+8)+"px;border-right-width:"+t/5+"px;border-bottom:"+t/5+'px solid transparent;"></div></div>':""),t='<div class="'+iGt+'"style='+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.left-e.ganttProperties.autoLeft)+"px;width:"+e.ganttProperties.width+"px;height:"+t+"px;cursor:"+(this.parent.editSettings.allowTaskbarEditing?"move;":"default;")+"</div>",n='<div class="'+oGt+'" style="width:'+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;position:absolute;transform: rotate(45deg);top:"+(40<this.parent.rowHeight?0:2)+"px;left:"+(this.parent.renderBaseline?2:1)+'px;"> </div>';return this.createDivElement(0===e.ganttProperties.duration&&e.hasChildRecords&&!e.ganttProperties.isAutoSchedule?n+i:t+i)},oXt.prototype.getParentTaskbarNode=function(e,t){var i,n,o,r,s=null,a=this.templateData,s=this.parentTaskbarTemplateFunction?this.parentTaskbarTemplateFunction(Pe({index:e},a),this.parent,"ParentTaskbarTemplate",this.getTemplateID("ParentTaskbarTemplate"),!1,void 0,t[0],this.parent.treeGrid.root):(t="",r=void 0,i=this.taskBarHeight/5,i=this.createDivElement('<div class="e-gantt-parent-taskbar-inner-div '+this.getExpandClass(a)+" "+aGt+'" style="width:'+(a.ganttProperties.isAutoSchedule?a.ganttProperties.width:a.ganttProperties.autoWidth)+"px;height:"+(a.ganttProperties.isAutoSchedule?this.taskBarHeight:3*i)+"px;margin-top:"+(a.ganttProperties.isAutoSchedule?-1:2*i)+'px; "></div>'),n=this.createDivElement('<div class="e-gantt-parent-progressbar-inner-div '+this.getExpandClass(a)+" "+lGt+'" style="border-style:'+(a.ganttProperties.progressWidth?"solid;":"none;")+"width:"+a.ganttProperties.progressWidth+"px;border-top-right-radius:"+this.getBorderRadius(a)+"px;border-bottom-right-radius:"+this.getBorderRadius(a)+'px;height:100%;"></div>'),o=Q("div"),this.taskLabelTemplateFunction?(e=this.taskLabelTemplateFunction(Pe({index:e},a),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1,void 0,n[0]))&&0<e.length&&(ht(e,o),t=o.innerHTML):(t="isCustomTemplate"===(t=this.getTaskLabel(this.parent.labelSettings.taskLabel))?this.parent.labelSettings.taskLabel:t,this.parent.enableHtmlSanitizer&&"string"==typeof t&&(t=go.sanitize(t))),-1===t.indexOf("null")&&("isCustomTemplate"!==this.getTaskLabel(this.parent.labelSettings.taskLabel)||this.isTemplate(this.parent.labelSettings.taskLabel)||(t=""),r=isNaN(parseInt(t,10))?'<span class="'+Oqt+'" style="line-height:'+(a[this.parent.taskFields.manual]&&a.hasChildRecords?Math.floor(.6*this.taskBarHeight):this.taskBarHeight-1)+"px; text-align:"+(this.parent.enableRtl?"right;":"left;")+"display:inline-block;width:"+(a.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;"></span>':'<span class="'+Oqt+'" style="line-height:'+(a[this.parent.taskFields.manual]&&a.hasChildRecords?Math.floor(.6*this.taskBarHeight):this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"display:inline-flex;":"")+("ResourceView"===this.parent.viewType?"width:"+(a.ganttProperties.width-10):"")+"px; height:"+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"display: inline-flex;":"")+("ResourceView"===this.parent.viewType?"width:"+(a.ganttProperties.width-10):"")+"px; height:"+this.taskBarHeight+'px;"></span>',e=this.createDivElement(r)[0],this.parent.disableHtmlEncode?e.innerText=t:e.innerHTML=t,(r=this.parent.labelSettings.taskLabel)&&r.elementRef&&e.appendChild(o),n[0].appendChild(e),""!==n[0].querySelectorAll(".e-task-label")[0].textContent&&!this.isTemplate(r)&&n[0].querySelectorAll(".e-task-label")[0].children[0]&&n[0].querySelectorAll(".e-task-label")[0].children[0].remove(),""===n[0].querySelectorAll(".e-task-label")[0].textContent)&&r&&!r.elementRef&&""!==o.innerHTML&&(n[0].querySelectorAll(".e-task-label")[0].textContent=r),t='<div class="e-gantt-parent-milestone" style="width:'+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;position:absolute;transform: rotate(45deg);top:"+(40<this.parent.rowHeight?0:2)+"px;left:"+(this.parent.renderBaseline?2:1)+'px;"> </div>',i[0].appendChild([].slice.call(n)[0]),a.ganttProperties.isMilestone?this.createDivElement(a.ganttProperties.isAutoSchedule?t:""):i);return this.parent.enableRtl&&s[0]&&s[0].querySelector(".e-task-label")&&(s[0].querySelector(".e-task-label").style.marginLeft="15px",s[0].querySelector(".e-task-label").style.marginRight="8px",s[0].querySelector(".e-gantt-parent-progressbar"))&&(s[0].querySelector(".e-gantt-parent-progressbar").style.textAlign="left"),s},oXt.prototype.getTableTrNode=function(e){var t,i,n=this,o=Q("table"),r="Horizontal"===this.parent.gridLines||"Both"===this.parent.gridLines?"e-chart-row-border":"",s=(this.parent.treeGridModule.isPersist?setTimeout(function(){je(n.parent.treeGrid.grid)||je(n.parent.treeGrid.grid.contentModule)||je(n.parent.treeGrid.grid.contentModule.getRows())||(i=n.parent.treeGrid.grid.contentModule.getRows()[e],t=i&&i.isSelected?"e-active":"")},0):(i=this.parent.treeGrid.grid.contentModule.getRows()[e],t=i&&i.isSelected?"e-active":""),o.querySelector("tbody")),a=(s||(s=document.createElement("tbody"),o.appendChild(s)),document.createElement("tr")),l=(a.classList.add(this.getRowClassName(this.templateData),Uqt),t&&a.classList.add(t),a.style.display=this.getExpandDisplayProp(this.templateData),a.style.height=this.parent.rowHeight+"px",document.createElement("td"));return r?l.classList.add(Qqt,r):l.classList.add(Qqt),l.style.width=this.parent.timelineModule.totalTimelineWidth+"px",a.appendChild(l),s.appendChild(a),o.childNodes},oXt.prototype.initializeChartTemplate=function(){je(this.parent.parentTaskbarTemplate)||(this.parentTaskbarTemplateFunction=this.templateCompiler(this.parent.parentTaskbarTemplate)),!je(this.parent.labelSettings.leftLabel)&&this.isTemplate(this.parent.labelSettings.leftLabel)&&(this.leftTaskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.leftLabel)),!je(this.parent.labelSettings.rightLabel)&&this.isTemplate(this.parent.labelSettings.rightLabel)&&(this.rightTaskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.rightLabel)),!je(this.parent.labelSettings.taskLabel)&&this.isTemplate(this.parent.labelSettings.taskLabel)&&(this.taskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.taskLabel)),je(this.parent.taskbarTemplate)||(this.childTaskbarTemplateFunction=this.templateCompiler(this.parent.taskbarTemplate)),je(this.parent.milestoneTemplate)||(this.milestoneTemplateFunction=this.templateCompiler(this.parent.milestoneTemplate))},oXt.prototype.createDivElement=function(e){var t=document.createElement("div");return this.parseTemplate(e).forEach(function(e){return t.appendChild(e)}),t.childNodes},oXt.prototype.parseTemplate=function(e){var t=this;return this.parseHtmlStringToElementTree(e).map(function(e){return t.constructElementFromNode(e)})},oXt.prototype.parseHtmlStringToElementTree=function(e){for(var t=[],i=[],n=0;null!==(a=this.tagRegex.exec(e));){var o=a[0],r=a[1],s=a[2],s=void 0===s?"":s,a=e.substring(n,a.index).trim(),n=this.tagRegex.lastIndex,r={tagName:r,attributes:s,children:[]};o.startsWith("</")?(0<i.length&&a&&(i[i.length-1].value=a),i.pop()):o.endsWith("/>")||((0<i.length?i[i.length-1].children:t).push(r),i.push(r))}return t},oXt.prototype.constructElementFromNode=function(e){var t=this,i=document.createElement(e.tagName);return e.value&&(i.textContent=e.value),this.setAttributes(i,e.attributes),e.children.forEach(function(e){e=t.constructElementFromNode(e);i.appendChild(e)}),i},oXt.prototype.setAttributes=function(e,t){for(t=t.replace(/style=([^"'\s][^ >]*)/g,'style="$1"');null!==(n=this.attributeRegex.exec(t));){var i=n[1],n=n[2];"class"===i?e.className=n:"style"===i?e.style.cssText=this.cleanStyleString(n):e.setAttribute(i,n)}},oXt.prototype.cleanStyleString=function(e){return e.split(";").map(function(e){return e.trim()}).filter(Boolean).join("; ")},oXt.prototype.isTemplate=function(e){for(var t=!1,i=0;i<this.parent.ganttColumns.length;i++)if(e===this.parent.ganttColumns[i].field){t=!0;break}return t="string"!=typeof e||0===e.indexOf("#")||-1<e.indexOf("<")||-1<e.indexOf("$")||!t},oXt.prototype.getTemplateID=function(e){return this.parent.element.id+e},oXt.prototype.leftLabelContainer=function(){var e='<div class="'+(this.leftTaskLabelTemplateFunction?"e-left-label-container e-left-label-temp-container":Pqt)+' " tabindex="-1" role="term" style="height:'+(this.parent.rowHeight-2)+"px;width:"+this.taskNameWidth(this.templateData)+'"></div>';return this.createDivElement(e)},oXt.prototype.taskbarContainer=function(){var e=this.templateData,t=!(!this.parent.editModule||!this.parent.editSettings.allowTaskbarEditing||"ParentResizing"!==this.parent.editModule.taskbarEditModule.taskBarEditAction),t='<div class="'+Rqt+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+" "+(e.ganttProperties.cssClass||"")+'"  tabindex="-1" role="term" style="'+(!e.ganttProperties.isMilestone||t||e.hasChildRecords&&!e.ganttProperties.isAutoSchedule?"width:"+e.ganttProperties.width+"px;margin-top:"+this.taskBarMarginTop+"px;"+(this.parent.enableRtl?"right:":"left:")+(!e.hasChildRecords||e.ganttProperties.isAutoSchedule?e.ganttProperties.left:e.ganttProperties.autoLeft)+"px;height:"+this.taskBarHeight+"px;cursor:"+(this.parent.editSettings.allowTaskbarEditing?"move;":"default;"):"width:"+this.milestoneHeight+"px;height:"+this.milestoneHeight+"px;margin-top:"+this.milestoneMarginTop+"px;"+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.left-this.milestoneHeight/2)+"px;cursor:"+(this.parent.editSettings.allowTaskbarEditing?"move;":"default;"))+'"></div>';return this.createDivElement(t)},oXt.prototype.rightLabelContainer=function(){var e='<div class="'+(this.rightTaskLabelTemplateFunction?"e-right-label-container e-right-label-temp-container":Fqt)+'"  tabindex="-1" role="term" style="'+(this.parent.enableRtl?"right:":"left:")+this.getRightLabelLeft(this.templateData)+"px; height:"+(this.parent.rowHeight-2)+'px;"></div>';return this.createDivElement(e)},oXt.prototype.childTaskbarLeftResizer=function(){var e=!je(document.body.className)&&document.body.className.includes("e-bigger")?5:-2,e='<div class="'+qqt+" "+Zqt+'"style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>';return this.createDivElement(e)},oXt.prototype.childTaskbarRightResizer=function(){var e=!je(document.body.className)&&document.body.className.includes("e-bigger")?-17:-11,e='<div class="'+Gqt+" "+Zqt+'"style="'+(this.parent.enableRtl?"right:":"left:")+(this.templateData.ganttProperties.width+e)+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>';return this.createDivElement(e)},oXt.prototype.childTaskbarProgressResizer=function(){var e=this.parent.enableRtl?this.templateData.ganttProperties.progressWidth+8:this.templateData.ganttProperties.progressWidth-6,e='<div class="'+Yqt+'"style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="'+Xqt+'"><div class="'+Kqt+'"></div><div class="'+Jqt+'"></div></div>';return this.createDivElement(e)},oXt.prototype.getLeftPointNode=function(){var e=this.templateData,t=!je(document.body.className)&&document.body.className.includes("e-bigger")?12:0,i=!je(document.body.className)&&document.body.className.includes("e-bigger")?6:3,t=-(2+this.connectorPointWidth+t),i=-(this.connectorPointWidth+i),n=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2),o=!this.templateData.ganttProperties.isAutoSchedule&&this.templateData.hasChildRecords&&this.parent.allowParentDependency?"":"margin-top:"+this.connectorPointMargin+"px",r=!0,n=(e.hasChildRecords&&!this.parent.allowParentDependency&&(r=!1),'<div class="e-left-connectorpoint-outer-div" style="'+(e.ganttProperties.isMilestone?"margin-top:"+n+"px;left:"+i+"px;":o+";left:"+t+"px;")+'"><div class="'+(r?AGt:"")+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+'" style="width: '+this.connectorPointWidth+"px;"+(this.parent.enableRtl?"margin-right:2px;":"")+"height: "+this.connectorPointWidth+'px;">'+this.touchLeftConnectorpoint+"</div></div>");return this.createDivElement(n)},oXt.prototype.getRightPointNode=function(){var e=this.templateData,t=-(3+(!je(document.body.className)&&document.body.className.includes("e-bigger")?-12:0)),i=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2),n=!this.templateData.ganttProperties.isAutoSchedule&&this.templateData.hasChildRecords&&this.parent.allowParentDependency?"":"margin-top:"+this.connectorPointMargin+"px",o=!0,i=(e.hasChildRecords&&!this.parent.allowParentDependency&&(o=!1),'<div class="'+EGt+'" style="'+(e.ganttProperties.isMilestone?"left:"+(!je(document.body.className)&&document.body.className.includes("e-bigger")?this.milestoneHeight+5:this.milestoneHeight-2)+"px;margin-top:"+i+"px;":"left:"+(e.ganttProperties.width+t)+"px;"+n+";")+'"><div class="'+(o?xGt:"")+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+'" style="width:'+this.connectorPointWidth+"px;height:"+this.connectorPointWidth+'px;">'+this.touchRightConnectorpoint+"</div></div>");return this.createDivElement(i)},oXt.prototype.getTaskLabel=function(e){var t=this.parent.ganttColumns.length,i=null;if(je(e)||""===e)i="";else if(e===this.parent.taskFields.resourceInfo)i=this.getResourceName(this.templateData);else{for(var n=0;n<t;n++)if(e===this.parent.ganttColumns[n].field){i=this.getFieldValue(this.templateData[e]).toString();break}if(je(i))return"isCustomTemplate"}return i},oXt.prototype.getExpandDisplayProp=function(e){return e=this.templateData,this.parent.getExpandStatus(e)?"table-row":"none"},oXt.prototype.getRowClassName=function(e){var t="gridrowtaskId",i=(e=this.templateData).parentItem;return i&&(t+=i.taskId.toString()),t=(t+="level")+e.level.toString()},oXt.prototype.getBorderRadius=function(e){e=(e=this.templateData).ganttProperties.width-e.ganttProperties.progressWidth;return e<=4?4-e:0},oXt.prototype.getSplitTaskBorderRadius=function(e){e=e.width-e.progressWidth;return e<=4?4-e:0},oXt.prototype.taskNameWidth=function(e){var t=(e=this.templateData).ganttProperties,t=e.ganttProperties.isMilestone?e.ganttProperties.left-this.parent.getTaskbarHeight()/2:e.hasChildRecords&&!t.isAutoSchedule?this.parent.allowUnscheduledTasks?t.left<t.autoLeft?t.left:t.autoLeft:t.autoStartDate.getTime()<t.startDate.getTime()?t.autoLeft:t.left:e.ganttProperties.left;return(t=t<0?0:t)+"px"},oXt.prototype.getRightLabelLeft=function(e){var t,i=(e=this.templateData).ganttProperties;return e.ganttProperties.isMilestone?e.ganttProperties.left+this.parent.getTaskbarHeight()/2:e.hasChildRecords&&!i.isAutoSchedule?(i=this.parent.allowUnscheduledTasks?(t=i.left<i.autoLeft?i.autoLeft:i.left,i.autoWidth):(t=i.autoStartDate.getTime()<i.startDate.getTime()?i.autoLeft:i.left,(i.autoEndDate.getTime()<i.endDate.getTime()?this.parent.dataOperation.getTaskLeft(i.endDate,i.isMilestone):this.parent.dataOperation.getTaskLeft(i.autoEndDate,i.isMilestone))-t),t+i):e.ganttProperties.left+e.ganttProperties.width},oXt.prototype.getExpandClass=function(e){return(e=this.templateData).expanded?"e-row-expand":!e.expanded&&e.hasChildRecords?"e-row-collapse":""},oXt.prototype.getFieldValue=function(e){return je(e)?"":e},oXt.prototype.getResourceName=function(e){var t=null;if(!je((e=this.templateData).ganttProperties.resourceInfo)){var i=e.ganttProperties.resourceInfo.length;if(0<i){for(var n=0;n<i;n++){var o=e.ganttProperties.resourceInfo[n][this.parent.resourceFields.name],r=e.ganttProperties.resourceInfo[n][this.parent.resourceFields.unit];100!==r&&(o+="["+r+"%]"),je(t)?t=o:t+=" , "+o}return t}}return""},oXt.prototype.initChartHelperPrivateVariable=function(){var e=this.parent.renderBaseline?.45:!je(document.body.className)&&document.body.className.includes("e-bigger")?.7:.62,t=this.parent.renderBaseline?4:2,i=this.parent.renderBaseline?1.13:.82;this.parent.rowHeight=je(this.parent.rowHeight)?36:this.parent.rowHeight,this.baselineColor=je(this.parent.baselineColor)||""===this.parent.baselineColor?null:this.parent.baselineColor,this.taskBarHeight=je(this.parent.taskbarHeight)||this.parent.taskbarHeight>=this.parent.rowHeight?Math.floor(this.parent.rowHeight*e):this.parent.taskbarHeight,this.parent.renderBaseline&&(e=void 0,e=this.taskBarHeight+this.baselineHeight<=this.parent.rowHeight?this.taskBarHeight:this.taskBarHeight-(this.baselineHeight+1),this.taskBarHeight=e),this.milestoneHeight=Math.floor(this.taskBarHeight*i),this.taskBarMarginTop=Math.floor((this.parent.rowHeight-this.taskBarHeight)/t),this.milestoneMarginTop=Math.floor((this.parent.rowHeight-this.milestoneHeight)/2),this.milesStoneRadius=Math.floor(this.milestoneHeight/2),this.baselineTop=-(Math.floor(this.parent.rowHeight-(this.taskBarHeight+this.taskBarMarginTop))-4),this.connectorPointWidth=this.parent.isAdaptive?Math.round(this.taskBarHeight/2):9,this.connectorPointMargin=Math.floor(this.taskBarHeight/2-this.connectorPointWidth/1.5)},oXt.prototype.refreshGanttRows=function(){if(this.parent.currentViewData=this.parent.treeGrid.getCurrentViewRecords().slice(),this.createTaskbarTemplate(),this.parent.showOverAllocation){for(var e=0;e<this.parent.currentViewData.length;e++){var t=this.parent.currentViewData[e];0<t.childRecords.length&&(this.parent.setRecordValue("workTimelineRanges",this.parent.dataOperation.mergeRangeCollections(t.ganttProperties.workTimelineRanges,!0),t.ganttProperties,!0),this.parent.dataOperation.calculateRangeLeftWidth(t.ganttProperties.workTimelineRanges))}this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)}this.parent.ganttChartModule.updateLastRowBottomWidth()},oXt.prototype.createTaskbarTemplate=function(){var e,t=this,i=[].slice.call(this.ganttChartTableBody.querySelectorAll("tr")),n=(this.ganttChartTableBody.innerHTML="",[]),o=this.parent.treeGridModule.prevCurrentView;if(this.refreshedTr=[],this.refreshedData=[],this.parent.enableImmutableMode&&o&&0<o.length&&this.isUpdated){for(var r={},s=[],a=this.parent.treeGrid.getPrimaryKeyFieldNames()[0],l=0;l<o.length;l++)s[l]=i[l],r[o[l][a]]=l;for(var h=0;h<this.parent.currentViewData.length;h++){var d=r[this.parent.currentViewData[h][a]],p=this.parent.modifiedRecords.indexOf(this.parent.currentViewData[h]);je(d)||-1!==p||this.parent.isFromRenderBaseline?(g=this.getGanttChartRow(h,this.parent.currentViewData[h]),this.ganttChartTableBody.appendChild(g),this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll("tr")[h]),this.refreshedData.push(this.parent.currentViewData[h])):this.ganttChartTableBody.appendChild(s[d]),this.ganttChartTableBody.querySelectorAll("tr")[h].setAttribute("aria-rowindex",(h+1).toString())}}else{for(var c=Q("tbody",{id:this.parent.element.id+"GanttTaskTableBody"}),l=0;l<this.parent.currentViewData.length;l++){var u=this.parent.currentViewData[l],g=(!u.expanded&&this.parent.enableMultiTaskbar&&n.push(u),this.getGanttChartRow(l,u));u.hasChildRecords&&!u.expanded&&this.parent.enableMultiTaskbar&&!this.parent.allowTaskbarOverlap&&this.updateDragDropRecords(u,g),c.appendChild(g),this.parent.enableImmutableMode&&(this.refreshedTr.push(c.querySelectorAll("tr")[l]),this.refreshedData.push(this.parent.currentViewData[l])),this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.maintainSelectedRecords(parseInt(g.getAttribute("aria-rowindex"),10)-1)}(e=this.ganttChartTableBody).replaceChildren.apply(e,c.childNodes),this.ganttChartTableBody.childNodes.forEach(function(e){e instanceof Element&&(e.addEventListener("touchmove",t.handleTouchMove),e.addEventListener("touchend",t.handleTouchEnd))}),this.parent.initialChartRowElements=this.parent.ganttChartModule.getChartRows()}if(this.parent.enableCriticalPath&&this.parent.criticalPathModule&&(e=this.parent.criticalPathModule).criticalPathCollection&&this.parent.criticalPathModule.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds),this.parent.renderTemplates(),this.triggerQueryTaskbarInfo(),this.parent.modifiedRecords=[],this.parent.showOverAllocation&&this.updateOverlapped(),n.length)for(var m=0;m<n.length;m++)n[m].hasChildRecords&&(this.parent.isGanttChartRendered=!0,this.parent.chartRowsModule.refreshRecords([n[m]]));this.parent.isGanttChartRendered=!0,this.parent.renderTemplates()},oXt.prototype.getGanttChartRow=function(e,t){this.templateData=t;var i,n,o=this.getTableTrNode(e),r=this.getLeftLabelNode(e);if((a=this.taskbarContainer())[0].setAttribute("aria-label",this.generateAriaLabel(this.templateData)),a[0].setAttribute("rowUniqueId",this.templateData.ganttProperties.rowUniqueID),i=this.getLeftPointNode(),(this.templateData.ganttProperties.isAutoSchedule&&"ProjectView"===this.parent.viewType||!this.templateData.hasChildRecords)&&a[0].appendChild([].slice.call(i)[0]),this.templateData.hasChildRecords){var s=void 0;if(!this.parent.enableMultiTaskbar||this.parent.enableMultiTaskbar&&this.templateData.expanded)s=this.getParentTaskbarNode(e,a);else for(var a=[],l=0;l<this.templateData.childRecords.length;l++){this.templateData=this.templateData.childRecords[l];var h=this.taskbarContainer();h[0].setAttribute("aria-label",this.generateAriaLabel(this.templateData)),h[0].setAttribute("rowUniqueId",this.templateData.ganttProperties.rowUniqueID),this.parent.allowParentDependency?(i=this.getLeftPointNode(),!this.templateData.ganttProperties.isAutoSchedule&&this.templateData.hasChildRecords||h[0].appendChild([].slice.call(i)[0])):(i=this.getLeftPointNode(),h[0].appendChild([].slice.call(i)[0])),this.appendChildTaskbars(t,e,h,n,a)}this.templateData.ganttProperties.isAutoSchedule||je((d=this.getManualTaskbar())[0])||(this.parent.allowParentDependency&&(i=this.getLeftPointNode(),d[0].appendChild([].slice.call(i)[0]),p=this.getRightPointNode(),d[0].appendChild([].slice.call(p)[0])),a[0].appendChild([].slice.call(d)[0])),0!==this.templateData.ganttProperties.autoDuration&&!this.templateData.ganttProperties.isMilestone&&s&&0<s.length?ht(s,a[0]):0===this.templateData.ganttProperties.duration&&this.templateData.ganttProperties.isMilestone&&this.templateData.ganttProperties.isAutoSchedule&&(p=this.getMilestoneNode(e,a))&&0<p.length&&ht(p,a[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(this.taskBaselineTemplateNode=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(je(this.templateData.ganttProperties.baselineStartDate)||je(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||je(this.templateData.ganttProperties.baselineEndDate)||je(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.getTime()!==this.templateData.ganttProperties.endDate.getTime()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode()),!(!this.parent.enableMultiTaskbar||this.parent.enableMultiTaskbar&&this.templateData.expanded)||(this.parent.allowParentDependency&&(this.templateData.ganttProperties.isAutoSchedule&&"ProjectView"===this.parent.viewType||!this.templateData.hasChildRecords)||!this.parent.allowParentDependency)&&(n=this.getRightPointNode(),a[0].appendChild([].slice.call(n)[0]))}else this.appendChildTaskbars(t,e,a,n);var d=this.getRightLabelNode(e);if(this.parent.enableMultiTaskbar&&this.templateData.hasChildRecords&&!this.templateData.expanded){s=Q("div",{className:"e-collapse-parent"});o[0].childNodes[0].childNodes[0].appendChild(s);for(l=0;l<a.length;l++)U([a[l]],"collpse-parent-border"),o[0].childNodes[0].childNodes[0].childNodes[0].appendChild([].slice.call(a)[l]);o[0].childNodes[0].childNodes[0].appendChild([].slice.call(r)[0]),this.templateData.ganttProperties.indicators&&0<this.templateData.ganttProperties.indicators.length&&this.appendIndicators(e,o)}else o[0].childNodes[0].childNodes[0].appendChild([].slice.call(r)[0]),o[0].childNodes[0].childNodes[0].appendChild([].slice.call(a)[0]),this.templateData.ganttProperties.indicators&&0<this.templateData.ganttProperties.indicators.length&&this.appendIndicators(e,o),d&&0<d.length&&o[0].childNodes[0].childNodes[0].appendChild([].slice.call(d)[0]);je(this.taskBaselineTemplateNode)||o[0].childNodes[0].childNodes[0].appendChild([].slice.call(this.taskBaselineTemplateNode)[0]),this.taskBaselineTemplateNode=null;var p=o[0].childNodes[0];return this.setAriaRowIndex(t,p),p},oXt.prototype.setAriaRowIndex=function(t,e){var i,n=this,o=this.parent.treeGrid.getCurrentViewRecords(),o=this.parent.virtualScrollModule&&this.parent.enableVirtualization?R("virtualScrollModule.visualData",this.parent.treeGrid):o;this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?(i=this.parent.treeGrid.grid.contentModule.rows.filter(function(e){if(e.data[n.parent.taskFields.id]===t.ganttProperties.taskId)return e})[0],e.setAttribute("data-rowindex",i.index.toString()),e.setAttribute("aria-rowindex",(i.index+1).toString())):(i=o.indexOf(t),e.setAttribute("aria-rowindex",(i+1).toString()))},oXt.prototype.triggerQueryTaskbarInfo=function(){if(this.parent.queryTaskbarInfo)for(var e=(this.parent.enableImmutableMode?this.refreshedTr:this.ganttChartTableBody.querySelectorAll("tr")).length,t=0;t<e;t++){var i,n=(this.parent.enableImmutableMode?this.refreshedTr:this.ganttChartTableBody.querySelectorAll("tr"))[t],o=!je((i=(0<this.refreshedData.length?this.refreshedData:this.parent.currentViewData)[t]).ganttProperties.segments)&&i.ganttProperties.segments.length;if(0<o)for(var r=0;r<o;r++){var s=n.getElementsByClassName("e-segmented-taskbar")[r];this.triggerQueryTaskbarInfoByIndex(s,i)}else n&&this.triggerQueryTaskbarInfoByIndex(n,i)}},oXt.prototype.appendIndicators=function(e,t){for(var i,n,o=this.templateData.ganttProperties.indicators,r=0;r<o.length;r++)(n=this.getIndicatorNode(o[r]))[0].setAttribute("aria-label",o[r].name),i=-1<o[r].name.indexOf("$")||-1<o[r].name.indexOf("#")?this.templateCompiler(o[r].name)(Pe({index:e},this.templateData),this.parent,"indicatorLabelText"):((i=Q("Text")).innerHTML=o[r].name,this.parent.enableHtmlSanitizer&&"string"==typeof o[r].name&&(o[r].name=go.sanitize(o[r].name)),i.childNodes),n[0].appendChild([].slice.call(i)[0]),n[0].title=je(o[r].tooltip)?"":o[r].tooltip,t[0].childNodes[0].childNodes[0].appendChild([].slice.call(n)[0])},oXt.prototype.appendChildTaskbars=function(e,t,i,n,o){if(this.templateData.ganttProperties.isMilestone){var r=this.getMilestoneNode(t,i);r&&0<r.length&&ht(r,i[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(this.taskBaselineTemplateNode=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(je(this.templateData.ganttProperties.baselineStartDate)||je(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||je(this.templateData.ganttProperties.baselineEndDate)||je(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.getTime()!==this.templateData.ganttProperties.endDate.getTime()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode()),o&&(o.push(i[0]),this.templateData=e)}else{var r=rqt(this.templateData.ganttProperties),s=null,a=null,l=null;if(!je(r)){(r||this.templateData.ganttProperties.duration)&&r&&(je(this.templateData.ganttProperties.segments)||this.templateData.ganttProperties.segments.length<=0)&&(s=this.childTaskbarProgressResizer(),l=this.childTaskbarLeftResizer(),a=this.childTaskbarRightResizer());var h=this.getChildTaskbarNode(t,i);if(l&&i[0].appendChild([].slice.call(l)[0]),h&&0<h.length)if(this.templateData.ganttProperties.segments&&0<this.templateData.ganttProperties.segments.length){var d=this.templateData.ganttProperties.segments.length,r=this.createDivElement('<div class="e-gantt-split-container-line"></div>');i[0].appendChild([].slice.call(r)[0]);for(var p=0;p<d;p++)ht(h,i[0])}else ht(h,i[0]);s&&i[0].appendChild([].slice.call(s)[0]),a&&i[0].appendChild([].slice.call(a)[0])}this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(this.taskBaselineTemplateNode=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(je(this.templateData.ganttProperties.baselineStartDate)||je(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||je(this.templateData.ganttProperties.baselineEndDate)||je(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.getTime()!==this.templateData.ganttProperties.endDate.getTime()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode():this.getMilestoneBaselineNode())}(this.parent.allowParentDependency&&(this.templateData.ganttProperties.isAutoSchedule&&"ProjectView"===this.parent.viewType||!this.templateData.hasChildRecords)||!this.parent.allowParentDependency)&&(n=this.getRightPointNode(),i[0].appendChild([].slice.call(n)[0])),o&&(o.push(i[0]),this.templateData=e)},oXt.prototype.customizeTaskbars=function(e,t,i){var n,o,r,s=this,e=(e.ganttProperties.segments&&0<e.ganttProperties.segments.length&&t&&t.parentElement&&t.parentElement.parentElement&&t.parentElement.parentElement.parentElement&&(n=t.parentElement.parentElement.parentElement),{data:e,rowElement:t,taskbarElement:i,taskbarType:e.hasChildRecords?"ParentTask":e.ganttProperties.isMilestone?"Milestone":"ChildTask"}),a=this.getClassName(e);"Milestone"===e.taskbarType?(e.milestoneColor=i.querySelector(a[0])?getComputedStyle(i.querySelector(a[0])).backgroundColor:null,e.baselineColor=t.querySelector(a[1])?getComputedStyle(t.querySelector(a[1])).backgroundColor:t.querySelector("."+jqt)?getComputedStyle(t.querySelector("."+jqt)).backgroundColor:null):i&&(o=i.querySelector(a[0]),r=i.querySelector(a[1]),e.taskbarBgColor=je(o)?null:(i.classList.contains(eGt)?getComputedStyle(i):getComputedStyle(i.querySelector(a[0]))).backgroundColor,e.taskbarBorderColor=je(o)?null:i.classList.contains(eGt)?getComputedStyle(i).backgroundColor:getComputedStyle(i.querySelector(a[0])).outlineColor,e.progressBarBgColor=je(r)?null:(i.classList.contains(tGt)?getComputedStyle(i):getComputedStyle(i.querySelector(a[1]))).backgroundColor,e.baselineColor=n?n.querySelector("."+jqt)?getComputedStyle(n.querySelector("."+jqt)).backgroundColor:null:t.querySelector("."+jqt)?getComputedStyle(t.querySelector("."+jqt)).backgroundColor:null,e.taskLabelColor=i.querySelector("."+Oqt)?getComputedStyle(i.querySelector("."+Oqt)).color:null),n?(e.rightLabelColor=n.querySelector("."+Fqt)&&n.querySelector("."+Fqt).querySelector("."+uGt)?getComputedStyle(n.querySelector("."+Fqt).querySelector("."+uGt)).color:null,e.leftLabelColor=n.querySelector("."+Pqt)&&n.querySelector("."+Pqt).querySelector("."+uGt)?getComputedStyle(n.querySelector("."+Pqt).querySelector("."+uGt)).color:null):(e.rightLabelColor=t.querySelector("."+Fqt)&&t.querySelector("."+Fqt).querySelector("."+uGt)?getComputedStyle(t.querySelector("."+Fqt).querySelector("."+uGt)).color:null,e.leftLabelColor=t.querySelector("."+Pqt)&&t.querySelector("."+Pqt).querySelector("."+uGt)?getComputedStyle(t.querySelector("."+Pqt).querySelector("."+uGt)).color:null),this.parent.trigger("queryTaskbarInfo",e,function(e){s.updateQueryTaskbarInfoArgs(e,void 0,void 0)})},oXt.prototype.triggerQueryTaskbarInfoByIndex=function(e,t){if(!je(e)){var i=t;if(!je(t.ganttProperties.segments)&&0<t.ganttProperties.segments.length)(r=e)&&this.customizeTaskbars(t,e,r);else if(this.parent.enableMultiTaskbar)for(var n=e.querySelectorAll("."+Rqt),o=0;o<n.length;o++){var r=n[o],i=!t.expanded&&t.hasChildRecords?t.childRecords[o]:i,s="ResourceView"===this.parent.viewType?r.getAttribute("rowUniqueId"):i.ganttProperties.taskId.toString();if(i.ganttProperties.segments&&0<i.ganttProperties.segments.length&&i.parentItem&&!t.expanded&&(s="ResourceView"===this.parent.viewType?t.ganttProperties.rowUniqueID:t.ganttProperties.taskId.toString()),e=je(e=(e=this.parent.getRowByID(s))||r.querySelector(".e-gantt-child-taskbar"))&&i.ganttProperties.isMilestone?r:e){s=e.querySelectorAll(".e-segmented-taskbar");if(s&&0<s.length)for(var a=(e.querySelector('.e-taskbar-main-container[rowuniqueid="'+i.ganttProperties.rowUniqueID+'"]')||e).querySelectorAll(".e-segmented-taskbar"),l=0;l<a.length;l++)r=a[l],this.customizeTaskbars(i,a[l],r);else this.customizeTaskbars(i,e,r)}}else{var h=e.querySelector("."+Rqt);e&&this.customizeTaskbars(i,e,h)}}},oXt.prototype.updateQueryTaskbarInfoArgs=function(e,t,i){var n,o=e.rowElement,r=this.parent.enableVirtualization?e.rowElement:e.taskbarElement,s=this.getClassName(e);e.data.ganttProperties.segments&&0<e.data.ganttProperties.segments.length&&(n=o.parentElement.parentElement.parentElement),"Milestone"===e.taskbarType?(r.querySelector(s[0])&&getComputedStyle(r.querySelector(s[0])).backgroundColor!==e.milestoneColor&&(r.querySelector(s[0]).style.backgroundColor=e.milestoneColor),o.querySelector(s[1])&&getComputedStyle(o.querySelector(s[1])).backgroundColor!==e.baselineColor&&(o.querySelector(s[1]).style.backgroundColor=e.baselineColor),o.querySelector("."+jqt)&&getComputedStyle(o.querySelector("."+jqt)).borderTopColor!==e.baselineColor&&(o.querySelector("."+jqt).style.backgroundColor=e.baselineColor)):r&&(r.querySelector(s[0])&&getComputedStyle(r.querySelector(s[0])).backgroundColor!==e.taskbarBgColor&&(r.querySelector(s[0]).style.backgroundColor=e.taskbarBgColor),r.querySelector(s[0])&&getComputedStyle(r.querySelector(s[0])).outlineColor!==e.taskbarBorderColor&&(r.querySelector(s[0]).style.outlineColor=e.taskbarBorderColor),r.querySelector(s[1])&&getComputedStyle(r.querySelector(s[1])).backgroundColor!==e.progressBarBgColor&&(r.querySelector(s[1]).style.backgroundColor=e.progressBarBgColor),r.classList.contains(eGt)&&getComputedStyle(r).backgroundColor!==e.taskbarBgColor&&(r.style.backgroundColor=e.taskbarBgColor),r.classList.contains(eGt)&&getComputedStyle(r).outlineColor!==e.taskbarBorderColor&&(r.style.outlineColor=e.taskbarBorderColor),r.classList.contains(tGt)&&getComputedStyle(r).backgroundColor!==e.progressBarBgColor&&(r.style.backgroundColor=e.progressBarBgColor),r.querySelector("."+Oqt)&&getComputedStyle(r.querySelector("."+Oqt)).color!==e.taskLabelColor&&(r.querySelector("."+Oqt).style.color=e.taskLabelColor),n?n.querySelector("."+jqt)&&getComputedStyle(n.querySelector("."+jqt)).backgroundColor!==e.baselineColor&&(n.querySelector("."+jqt).style.backgroundColor=e.baselineColor):o.querySelector("."+jqt)&&getComputedStyle(o.querySelector("."+jqt)).backgroundColor!==e.baselineColor&&(o.querySelector("."+jqt).style.backgroundColor=e.baselineColor)),n?(n.querySelector("."+Pqt)&&n.querySelector("."+Pqt).querySelector("."+uGt)&&getComputedStyle(n.querySelector("."+Pqt).querySelector("."+uGt)).color!==e.leftLabelColor&&(n.querySelector("."+Pqt).querySelector("."+uGt).style.color=e.leftLabelColor),n.querySelector("."+Fqt)&&n.querySelector("."+Fqt).querySelector("."+uGt)&&getComputedStyle(n.querySelector("."+Fqt).querySelector("."+uGt)).color!==e.rightLabelColor&&(n.querySelector("."+Fqt).querySelector("."+uGt).style.color=e.rightLabelColor)):(o.querySelector("."+Pqt)&&o.querySelector("."+Pqt).querySelector("."+uGt)&&getComputedStyle(o.querySelector("."+Pqt).querySelector("."+uGt)).color!==e.leftLabelColor&&(o.querySelector("."+Pqt).querySelector("."+uGt).style.color=e.leftLabelColor),o.querySelector("."+Fqt)&&o.querySelector("."+Fqt).querySelector("."+uGt)&&getComputedStyle(o.querySelector("."+Fqt).querySelector("."+uGt)).color!==e.rightLabelColor&&(o.querySelector("."+Fqt).querySelector("."+uGt).style.color=e.rightLabelColor))},oXt.prototype.getClassName=function(e){var t=[];return t.push("."+("ParentTask"===e.taskbarType?aGt:"ChildTask"===e.taskbarType?eGt:$qt)),t.push("."+("ParentTask"===e.taskbarType?lGt:"ChildTask"===e.taskbarType?tGt:Wqt)),t},oXt.prototype.templateCompiler=function(t){if(!je(t)&&""!==t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim(),this.parent):oo(t,this.parent)}catch(e){return oo(t,this.parent)}return null},oXt.prototype.updateOverlapped=function(){for(var e=0;e<this.parent.treeGrid.parentData.length;e++)for(var t=this.parent.treeGrid.parentData[e].childRecords,i=0;i<t.length;i++){t[i+1]&&(t[i].ganttProperties.eOverlapped=void 0);for(var n=i+1;n<t.length;n++)t[n].ganttProperties.eOverlapped=void 0,t[i].ganttProperties.startDate.getTime()<t[n].ganttProperties.endDate.getTime()&&t[i].ganttProperties.endDate.getTime()>t[n].ganttProperties.startDate.getTime()?(t[n].ganttProperties.eOverlapped=!0,t[i].ganttProperties.eOverlapped=!0):(je(t[n].ganttProperties.eOverlapped)&&(t[n].ganttProperties.eOverlapped=!1),je(t[i].ganttProperties.eOverlapped)&&(t[i].ganttProperties.eOverlapped=!1))}},oXt.prototype.updateDragDropRecords=function(e,t){var i=e.childRecords,n=this.parent.currentViewData.indexOf(e),o=(this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2]:this.parent.element.getElementsByClassName("e-content")[0]).children[0].offsetHeight,r=(t=t||this.ganttChartTableBody.childNodes[n],this.parent.ganttChartModule.isExpandAll||this.parent.ganttChartModule.isCollapseAll?t.style.height=this.parent.treeGrid.getRowByIndex(n).style.height=this.parent.rowHeight+"px":t.style.height=this.parent.treeGrid.getRows()[n].style.height=this.parent.rowHeight+"px",this.parent.contentHeight=o,[]),s=0;if(e){for(var a=0;a<i.length;a++)for(var l=a+1;l<i.length;l++)for(var h=t.getElementsByClassName("e-taskbar-main-container"),d=0;d<h.length;d++){var p=("ResourceView"===this.parent.viewType?i[l]:i[l].ganttProperties).rowUniqueID;i[a].ganttProperties.startDate.getTime()<i[l].ganttProperties.endDate.getTime()&&i[a].ganttProperties.endDate.getTime()>i[l].ganttProperties.startDate.getTime()?h[d].getAttribute("rowuniqueid")===p&&-1===r.indexOf(p)&&(r.push(p),s++,t.children[0].style.verticalAlign="baseline",t.getElementsByClassName("e-taskbar-main-container")[d].style.marginTop=s*this.parent.rowHeight+this.taskBarMarginTop+"px",this.parent.ganttChartModule.isExpandAll||this.parent.ganttChartModule.isCollapseAll?t.style.height=this.parent.treeGrid.getRowByIndex(n).style.height=parseInt(t.style.height,10)+this.parent.rowHeight+"px":t.style.height=this.parent.treeGrid.getRows()[n].style.height=parseInt(t.style.height,10)+this.parent.rowHeight+"px"):h[d].getAttribute("rowuniqueid")===p&&-1===r.indexOf(p)&&this.parent.rowDragAndDropModule&&this.parent.rowDragAndDropModule.draggedRecord&&h[d].getAttribute("rowuniqueid")===this.parent.rowDragAndDropModule.draggedRecord.rowUniqueID&&this.parent.rowDragAndDropModule.draggedRecord.rowUniqueID===i[l].rowUniqueID&&(t.getElementsByClassName("e-taskbar-main-container")[d].style.marginTop=this.parent.editModule.taskbarEditModule.draggedRecordMarginTop)}this.parent.contentHeight=o,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px"}},oXt.prototype.refreshRow=function(e,t,i){var n=this,o=this.ganttChartTableBody.childNodes[e],r=(i?this.parent.previousFlatData:this.parent.currentViewData)[e];if(-1!==e&&r){var s,a,l=r,h=(!this.parent.allowTaskbarOverlap&&l.expanded&&(this.parent.ganttChartModule.isExpandAll||this.parent.ganttChartModule.isCollapseAll?o.style.height=this.parent.treeGrid.getRowByIndex(e).style.height=this.parent.rowHeight+"px":o.style.height=this.parent.treeGrid.getRows()[e].style.height=this.parent.rowHeight+"px"),l.hasChildRecords&&!l.expanded&&this.parent.enableMultiTaskbar?(o.replaceChild(this.getGanttChartRow(e,l).childNodes[0],o.childNodes[0]),this.parent.renderBaseline&&l.childRecords.forEach(function(e){je(e.ganttProperties.baselineStartDate&&e.ganttProperties.baselineEndDate)||o.childNodes[0].appendChild(n.updateTaskBaselineNode(e)[0])})):this.parent.allowTaskbarDragAndDrop&&!l.expanded?o.replaceWith(this.getGanttChartRow(e,l)):(o.replaceChild(this.getGanttChartRow(e,l).childNodes[0],o.childNodes[0]),this.parent.enableMultiTaskbar&&l.parentItem&&(c=l.parentItem.taskId,(s=this.parent.getRecordByID(c)).expanded||(a=this.parent.getRowByID(c)).replaceChild(this.getGanttChartRow(Number(c),s).childNodes[0],a.childNodes[0]))),this.parent.renderTemplates(),this.parent.showOverAllocation&&this.parent.allowTaskbarOverlap&&(l.hasChildRecords||l.parentItem&&this.parent.editedRecords.every(function(e){return e.ganttProperties.taskId.toString()!==l.parentItem.taskId.toString()}))&&(t?this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData):(c=l.hasChildRecords?l:this.parent.getRecordByID(l.parentItem.taskId),this.parent.dataOperation.updateOverlappingValues(c),this.parent.ganttChartModule.renderRangeContainer([c]))),!je(l.ganttProperties.segments)&&l.ganttProperties.segments.length);if(0<h)for(var d=0;d<h;d++){var p=o.getElementsByClassName("e-segmented-taskbar")[d];this.triggerQueryTaskbarInfoByIndex(p,l)}else this.triggerQueryTaskbarInfoByIndex(o,l),this.parent.enableMultiTaskbar&&l.parentItem&&this.parent.queryTaskbarInfo&&!this.parent.getParentTask(l.parentItem).expanded&&(s=l.parentItem.index,a=void 0,a=(i?this.parent.previousFlatData:this.parent.currentViewData)[s],this.triggerQueryTaskbarInfoByIndex(this.ganttChartTableBody.querySelectorAll("tr")[s],a));var t="ProjectView"===this.parent.viewType?l.ganttProperties.taskId:l.ganttProperties.rowUniqueID,c=(this.parent.ganttChartModule.isExpandAll||this.parent.ganttChartModule.isCollapseAll||this.parent.treeGrid.grid.setRowData(t,l),l.hasChildRecords&&!l.expanded&&this.parent.enableMultiTaskbar&&!this.parent.allowTaskbarOverlap&&this.updateDragDropRecords(r,o),l.hasChildRecords&&this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap&&(this.parent.dataOperation.updateOverlappingValues(l),this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)),this.parent.ganttChartModule.tempNextElement),i=(this.parent.ganttChartModule.isEditableElement&&c&&(this.parent.treeGrid.grid.focusModule.focus(),U([this.parent.treeGrid.getRows()[parseInt(o.getAttribute("aria-rowindex"),10)-1].children[this.parent.ganttChartModule.childrenIndex]],"e-focused"),this.parent.ganttChartModule.tempNextElement=null),this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[e].getAttribute("data-uid")));je(i)||(i.data=l)}},oXt.prototype.updateResourceTaskbarElement=function(e,t){var i=e.querySelector(".e-taskbar-main-container"),e=("ProjectView"===this.parent.viewType&&e.querySelector(".e-collapse-parent")&&(i=e.querySelector(".e-collapse-parent")),null===e.querySelector(".e-collapse-parent")&&U([i],"collpse-parent-border"),e.querySelector("."+Rqt).getAttribute("rowUniqueId")),n=this.parent.getRecordByID(e);if(!je(n)&&n.ganttProperties.segments&&0<n.ganttProperties.segments.length)for(var o=i.getElementsByClassName("e-segmented-taskbar"),r=0;r<o.length;r++)this.triggerQueryTaskbarInfoByIndex(o[r],n);else!this.parent.queryTaskbarInfo||je(e=i.querySelector(".e-gantt-child-taskbar"))||this.triggerQueryTaskbarInfoByIndex(e,n);e="",n&&!je(n.ganttProperties.eOverlapIndex)&&(e=n.ganttProperties.eOverlapIndex.toString()),i=i.cloneNode(!0);i.style.zIndex=e,t[0].childNodes[0].childNodes[0].childNodes[0].appendChild(i)},oXt.prototype.refreshRecords=function(e,t,i){if(this.parent.isGanttChartRendered){this.parent.renderTemplates(),this.parent.enableMultiTaskbar&&(e=new me(e).executeLocal((new ya).sortBy("expanded","Descending")));for(var n=0;n<e.length;n++){var o=void 0,o=i?this.parent.ids.indexOf(e[n].ganttProperties.taskId.toString()):this.parent.currentViewData.indexOf(e[n]);this.parent.enableMultiTaskbar&&(!this.parent.enableMultiTaskbar||!e[n].expanded&&this.parent.isLoad)||this.refreshRow(o,t,i)}this.parent.ganttChartModule.updateLastRowBottomWidth()}},oXt.prototype.removeEventListener=function(){var t=this;this.parent.isDestroyed||(this.ganttChartTableBody.childNodes.forEach(function(e){e instanceof Element&&(e.removeEventListener("touchmove",t.handleTouchMove),e.removeEventListener("touchend",t.handleTouchEnd))}),this.parent.off("renderPanels",this.createChartTable),this.parent.off("dataReady",this.initiateTemplates),this.parent.off("destroy",this.destroy))},oXt.prototype.destroy=function(){this.removeEventListener()},oXt.prototype.generateAriaLabel=function(e){e=this.templateData;var t="",i=this.parent.localeObj.getConstant("name"),n=this.parent.localeObj.getConstant("startDate"),o=this.parent.localeObj.getConstant("endDate"),r=this.parent.localeObj.getConstant("duration"),s=e.ganttProperties.taskName,a=e.ganttProperties.startDate,l=e.ganttProperties.endDate,h=e.ganttProperties.duration;return e.ganttProperties.isMilestone?t=i+" "+s+" "+n+" "+this.parent.getFormatedDate(a):(s&&(t+=i+" "+s+" "),a&&(t+=n+" "+this.parent.getFormatedDate(a)+" "),l&&(t+=o+" "+this.parent.getFormatedDate(l)+" "),h&&(t+=r+" "+this.parent.getDurationString(h,e.ganttProperties.durationUnit))),t},oXt.prototype.generateBaselineAriaLabel=function(e){e=this.templateData;var t="",i=this.parent.localeObj.getConstant("name"),n=this.parent.localeObj.getConstant("startDate"),o=this.parent.localeObj.getConstant("endDate"),r=e.ganttProperties.taskName,s=e.ganttProperties.baselineStartDate,e=e.ganttProperties.baselineEndDate;return t+"Baseline "+(i+" "+r+" ")+(n+" "+this.parent.getFormatedDate(s)+" ")+(o+" "+this.parent.getFormatedDate(e)+" ")},oXt.prototype.generateSpiltTaskAriaLabel=function(e,t){var i="",n=this.parent.localeObj.getConstant("startDate"),o=this.parent.localeObj.getConstant("endDate"),r=this.parent.localeObj.getConstant("duration"),s=e.startDate,a=e.endDate,e=e.duration;return s&&(i+=n+" "+this.parent.getFormatedDate(s)+" "),a&&(i+=o+" "+this.parent.getFormatedDate(a)+" "),e&&(i+=r+" "+this.parent.getDurationString(e,t.durationUnit)),i},oXt.prototype.generateTaskLabelAriaLabel=function(e){var t="";return"left"===e&&this.parent.labelSettings.leftLabel&&!this.leftTaskLabelTemplateFunction?t+=this.parent.localeObj.getConstant("leftTaskLabel")+" "+this.getTaskLabel(this.parent.labelSettings.leftLabel):"right"===e&&this.parent.labelSettings.rightLabel&&!this.rightTaskLabelTemplateFunction&&(t+=this.parent.localeObj.getConstant("rightTaskLabel")+" "+this.getTaskLabel(this.parent.labelSettings.rightLabel)),t};var tXt,iXt,nXt=oXt;function oXt(e){var t=iXt.call(this,e)||this;return t.taskBarHeight=0,t.milestoneHeight=0,t.milesStoneRadius=0,t.baselineTop=0,t.baselineHeight=8,t.touchLeftConnectorpoint="",t.touchRightConnectorpoint="",t.dropSplit=!1,t.refreshedTr=[],t.refreshedData=[],t.isUpdated=!0,t.tagRegex=/<\/?(\w+)([^>]*?)(\/?)>/g,t.attributeRegex=/([\w-]+)\s*=\s*"([^"]*)"/g,t.taskBaselineTemplateNode=null,t.handleTouchMove=function(e){t.parent.ganttChartModule.ganttChartMove(e)},t.handleTouchEnd=function(e){t.parent.ganttChartModule.documentMouseUp(e)},t.parent=e,t.initPublicProp(),t.addEventListener(),t}sXt.prototype.ensurePredecessorCollection=function(){for(var e=0,t=this.parent.predecessorsCollection;e<t.length;e++){var i=t[e];(i.hasChildRecords||this.parent.allowParentDependency)&&!this.parent.allowParentDependency||this.ensurePredecessorCollectionHelper(i,i.ganttProperties)}},sXt.prototype.ensurePredecessorCollectionHelper=function(e,t){var i=t.predecessorsName;if(!i||"string"!=typeof i&&"number"!=typeof i){if(i&&"object"==typeof i&&i.length){for(var n=[],o=0;o<i.length;o++){var r=i[o],s={},a=(s.from=R("from",r)?R("from",r):i[o],s.to=R("to",r)?R("to",r):t.rowUniqueID,s.type=R("type",r)?R("type",r):"FS",R("offset",r));je(a)?(s.offset=0,s.offsetUnit=this.parent.durationUnit.toLocaleLowerCase()):"string"==typeof a?(r=this.getOffsetDurationUnit(R("offset",r)),s.offset=r.duration,s.offsetUnit=r.durationUnit):(s.offset=parseFloat(a.toString()),s.offsetUnit=this.parent.durationUnit.toLocaleLowerCase()),this.checkIsParent(s.from.toString())||n.push(s)}this.parent.setRecordValue("predecessor",n,t,!0)}}else this.parent.setRecordValue("predecessor",this.calculatePredecessor(i,e),t,!0);this.parent.setRecordValue("predecessorsName",this.getPredecessorStringValue(e),t,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,t.predecessorsName,e),this.parent.setRecordValue(this.parent.taskFields.dependency,t.predecessorsName,e)},sXt.prototype.updateUnscheduledDependency=function(e){for(var t=this.parent.taskFields,i=je(e[t.dependency])?[]:e[t.dependency].toString().split(","),n=0;n<i.length;n++){var o=parseInt(i[n],10);if(!isNaN(o)){var o=this.parent.connectorLineModule.getRecordByID(o.toString()),r=je(o)?null:Pe({},{},o.taskData,!0);if(!je(r)&&je(r[t.startDate])&&je(r[t.duration])&&je(r[t.endDate])){r[t.duration]=1;var s=void 0;if(o.parentItem){for(var a=this.parent.getParentTask(o.parentItem);a&&!a.ganttProperties.startDate;)a=this.parent.getParentTask(a.parentItem);s=a?a.ganttProperties.startDate:this.parent.cloneProjectStartDate}else s=this.parent.cloneProjectStartDate;r[t.startDate]=s,this.parent.updateRecordByID(r)}}}},sXt.prototype.checkIsParent=function(e){var t=!1;return t=this.parent.connectorLineModule.getRecordByID(e).hasChildRecords?!0:t},sXt.prototype.getRootParent=function(t){var e=t;return t.parentItem&&(e=this.parent.flatData.filter(function(e){return e.uniqueID===t.parentUniqueID})[0]).parentItem?this.getRootParent(e):e},sXt.prototype.validateParentPredecessor=function(e,t){if(e&&t)if(t.hasChildRecords&&!e.hasChildRecords){if(e.parentUniqueID===t.uniqueID)return!1;do{if(e.parentItem&&(e=this.parent.flatData[this.parent.ids.indexOf(e.parentItem.taskId)]).uniqueID===t.uniqueID)return!1}while(e.parentItem)}else if(!t.hasChildRecords&&e.hasChildRecords){if(t.parentUniqueID===e.uniqueID)return!1;do{if(t.parentItem&&(t=this.parent.flatData[this.parent.ids.indexOf(t.parentItem.taskId)]).uniqueID===e.uniqueID)return!1}while(t.parentItem)}else if(t.hasChildRecords&&e.hasChildRecords)if(t.parentItem&&e.parentItem){if(e.parentUniqueID===t.uniqueID||e.uniqueID===t.parentUniqueID)return!1}else if(!t.parentItem&&e.parentItem){if(this.getRootParent(e).uniqueID===t.uniqueID)return!1}else if(t.parentItem&&!e.parentItem)if(this.getRootParent(t).uniqueID===e.uniqueID)return!1;return!0},sXt.prototype.calculatePredecessor=function(e,l){var h,d,p,c=this,e=e.toString(),u=[],g=[],m=[],n=(e.split(",").forEach(function(e){var t,i,n,o,r=!1,s=!1,a=e.split("-"),a=(6===a.length&&(a[4]=a[4]+"-"+a[5],a.pop()),5===a.length&&12<=a[4].length&&(i=e.substring(0,36),/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(i))&&(r=!0),e.includes("-")&&(i=e.lastIndexOf("-"),i=e.substring(i+1),n=((n=e.replace(i,"").trim().match(/(FS|SS|SF|FF)-$/))?n[0]:"")+i,n=n=/^(FS|SS|SF|FF)/.test(n)?n:(i=n.match(/(FS|SS|SF|FF)/))?i[0]+n.slice(n.indexOf(i[0])+i[0].length):e,e.includes("-"))&&/[A-Za-z]/.test(n)&&-1!==(i=e.indexOf(n))&&(o=e.substring(0,i)).includes("-")&&(s=!0),r?(r=i=void 0,1===(i=a[4].split("+")).length?g[0]=e:(r=i[1].length,g[0]=e.slice(0,-(r+1)),g[1]=i[1]),d="+",0<=a[4].indexOf("-")&&(1===(i=a[4].split("-")).length?g[0]=e:(r=i[1].length,g[0]=e.slice(0,-(r+1)),g[1]=i[1]),d="-")):s&&o.includes("-")?g[0]=o:(g=e.split("+"),d="+",0<=e.indexOf("-")&&(g=e.split("-"),d="-")),h=[],"ResourceView"===c.parent.viewType?c.parent.getTaskIds():c.parent.ids),r=(-1===("ResourceView"===c.parent.viewType?a.indexOf("T"+g[0]):a.indexOf(g[0]))&&-1===a.indexOf(g[0])?1===(h=g[0].split(" ")).length&&(-1!==h[0].indexOf(" ")?h=g[0].match(/(\d+|[A-z]+)/g):(h[0]=g[0].slice(0,-2),h[1]=g[0].slice(-2))):h[0]=g[0],"ResourceView"===c.parent.viewType?a.indexOf("T"+h[0]):a.indexOf(h[0]));h[0]&&-1!==r&&(p=1<h.length?"FS"===(t=h[1].toUpperCase())||"FF"===t||"SF"===t||"SS"===t?t:(c.parent.trigger("actionFailure",{error:"The provided dependency type, "+t+", is invalid. Please ensure that the Dependency Type is FS or FF or SS or SF"}),"FS"):e.includes("-")&&/[A-Za-z]/.test(n)&&o.includes("-")&&((t=e.slice(-2).toString()).toUpperCase(),"FS"===t||"FF"===t||"SF"===t||"SS"===t)?t:"FS",i=1<g.length?d+""+g[1]:"0",s=c.getOffsetDurationUnit(i),a={from:h[0],type:p,isDrawn:!1,to:("ResourceView"===c.parent.viewType?l.ganttProperties.taskId:l.ganttProperties.rowUniqueID).toString(),offsetUnit:s.durationUnit,offset:s.duration},r=c.checkIsParent(h[0]),c.parent.allowParentDependency?(n=c.parent.connectorLineModule.getRecordByID(a.to),(o=c.parent.connectorLineModule.getRecordByID(a.from))&&n?c.validateParentPredecessor(o,n)&&(u.push(a),-1===m.indexOf(o))&&o.hasChildRecords&&c.parent.editModule&&c.parent.editModule.cellEditModule&&c.parent.editModule.cellEditModule.isCellEdit&&m.push(Pe([],[],[o],!0)[0]):u.push(a),h.splice(0)):r||u.push(a))}),0<m.length&&this.parent.undoRedoModule&&this.parent.editModule&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit&&(this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1].connectedRecords=m),[]);return u.map(function(e){var t=e.from,i=e.to,e=u.filter(function(e){return e.from===t&&e.to===i});-1===n.indexOf(e[e.length-1])&&n.push(e[e.length-1])}),n},sXt.prototype.getPredecessorStringValue=function(e){var t=e.ganttProperties.predecessor,i="",n=[];if(t)for(var o=t.length,r=0;r<o;r++){var s=t[r],a="",l="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;s.from!==l.toString()&&(a=s.from+s.type,a="string"==typeof e.ganttProperties.taskId?(n[0]=a.slice(0,-2),n[1]=a.slice(-2),n[0]+" "+n[1]):a,0!==s.offset&&(a+=0<s.offset?"+"+s.offset+" ":s.offset+" ",l=1!==s.offset,"day"===s.offsetUnit?a+=l?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===s.offsetUnit?a+=l?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):a+=l?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute")),i=0<i.length?i+","+a:a)}return i},sXt.prototype.getOffsetDurationUnit=function(e){var t=0,i=this.parent.durationUnit.toLocaleLowerCase(),n=this.parent.durationUnitEditText;if("string"==typeof e){for(var o=e.match(/[^0-9]+|[0-9]+/g),r=0;r<o.length;r++)o[r]=o[r].trim();"-"===o[0]&&o[1]?(o[1]=o[0]+o[1],o.shift()):"+"===o[0]&&o.shift(),"."!==o[1]||isNaN(parseInt(o[2],10))||(o[0]+=o[1]+o[2],o.splice(1,2)),o&&o.length<=2&&(t=parseFloat(o[0]),i=o[1]?o[1].toLowerCase().trim():"",i=-1!==R("minute",n).indexOf(i)?"minute":-1!==R("hour",n).indexOf(i)?"hour":-1!==R("day",n).indexOf(i)?"day":this.parent.durationUnit.toLocaleLowerCase())}else t=e,i=this.parent.durationUnit.toLocaleLowerCase();return isNaN(t)&&(this.parent.trigger("actionFailure",{error:"The provided value for the offset field is invalid.Please ensure the offset field contains only valid numeric values"}),t=0,i=this.parent.durationUnit.toLocaleLowerCase()),{duration:t,durationUnit:i}},sXt.prototype.updatePredecessors=function(e){void 0===e&&(e=null);for(var t,i=this.parent.predecessorsCollection,n=i.length,o=0;o<n;o++)((t=i[o]).hasChildRecords||this.parent.allowParentDependency)&&!this.parent.allowParentDependency||(this.updatePredecessorHelper(t,i,e),t.ganttProperties.isAutoSchedule)||!this.parent.editSettings.allowEditing||(this.parent.connectorLineEditModule.validatedOffsetIds=[],this.parent.connectorLineEditModule.calculateOffset(t))},sXt.prototype.updatePredecessorHelper=function(e,t,i){void 0===i&&(i=null);var n=e.ganttProperties.predecessor,o=n.length;t=je(t)?[]:t;for(var r=0;r<o;r++){var s=n[r],a="ProjectView"!==this.parent.viewType||je(i)?this.parent.connectorLineModule.getRecordByID(s.from):i.get(s.from),l="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;s.from!==l.toString()&&a&&(l=void 0,a.ganttProperties.predecessor?((l=Pe([],a.ganttProperties.predecessor,[],!0)).push(s),this.parent.setRecordValue("predecessor",l,a.ganttProperties,!0)):((l=[]).push(s),this.parent.setRecordValue("predecessor",l,a.ganttProperties,!0),t.push(a)))}},sXt.prototype.traverseParents=function(e){this.parent.dataOperation.updateParentItems(e)},sXt.prototype.updatedRecordsDateByPredecessor=function(e){if(void 0===e&&(e=null),this.parent.autoCalculateDateScheduling&&!(this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)){var t=this.parent.flatData,i=t.length;if(je(e)){e=new Map;for(var n=0,o=t;n<o.length;n++){var r=o[n];e.set(r.ganttProperties.rowUniqueID.toString(),r)}}for(var s=0;s<i;s++){var a=t[s],l=a.ganttProperties;if(l.predecessorsName){this.validatePredecessorDates(a,e);var h=l.predecessor;if(h&&1<h.length)for(var d=0,p=h;d<p.length;d++){var c=p[d],u=void 0;(u="ProjectView"===this.parent.viewType?e.get(c.to):this.parent.connectorLineModule.getRecordByID(c.to))&&this.validatePredecessorDates(u,e)}a.hasChildRecords&&l.startDate&&this.parent.allowParentDependency&&this.updateChildItems(a),a.parentItem&&(h=a.parentItem.taskId,l=void 0,l="ProjectView"===this.parent.viewType?e.get(h):this.parent.getRecordByID(h))&&this.traverseParents(l)}}}},sXt.prototype.updateParentPredecessor=function(e){if(void 0===e&&(e=null),this.parent.enablePredecessorValidation)for(var t=this.parentPredecessors.length-1;0<=t;t--){var i=this.parentPredecessors[t];this.validatePredecessorDates(i,e),i.ganttProperties.startDate&&this.updateChildItems(i)}},sXt.prototype.validatePredecessorDates=function(e,t){if(void 0===t&&(t=null),e.ganttProperties.predecessor)for(var i=e.ganttProperties.predecessor,n=void 0,o=void 0,r=null,s=("ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID).toString(),a=i.filter(function(e){return e.to===s?e:null}),n=0;n<a.length;n++){var l,h=a[n],r="ProjectView"!==this.parent.viewType||je(t)?(o=this.parent.connectorLineModule.getRecordByID(h.from),this.parent.connectorLineModule.getRecordByID(h.to)):(o=t.get(h.from),t.get(h.to));this.parent.allowParentDependency&&o.hasChildRecords&&this.parent.dataOperation.updateParentItems(o),"ProjectView"===this.parent.viewType&&this.parent.allowTaskbarDragAndDrop&&(l=void 0,je(r)?(l=this.parent.editModule.taskbarEditModule.previousIds.indexOf(h.to),r=this.parent.editModule.taskbarEditModule.previousFlatData[l]):je(o)&&(l=this.parent.editModule.taskbarEditModule.previousIds.indexOf(h.from),o=this.parent.editModule.taskbarEditModule.previousFlatData[l])),this.parent.allowParentDependency&&this.parent.isLoad&&-1===this.parentPredecessors.indexOf(e)&&(e.hasChildRecords||r.hasChildRecords)&&this.parentPredecessors.push(e),(r.ganttProperties.isAutoSchedule||this.parent.validateManualTasksOnLinking)&&this.validateChildGanttRecord(o,r,t)}},sXt.prototype.validateChildGanttRecord=function(e,t,i){var n,o;void 0===i&&(i=null),this.parent.editedTaskBarItem===t||e&&je(rqt(e.ganttProperties))||t&&je(rqt(t.ganttProperties))||this.parent.isInPredecessorValidation&&(t.ganttProperties.isAutoSchedule||this.parent.validateManualTasksOnLinking)&&(e=t.ganttProperties,n=("ResourceView"===this.parent.viewType?e.taskId:e.rowUniqueID).toString(),o=e.predecessor.filter(function(e){return e.to===n?e:null}),o=this.getPredecessorDate(t,o,i),this.parent.setRecordValue("startDate",o,e,!0),this.parent.dataOperation.updateMappingData(t,"startDate"),(je(i=t.ganttProperties.segments)||!je(i)&&0===i.length)&&this.dateValidateModule.calculateEndDate(t),this.parent.dataOperation.updateWidthLeft(t),!this.parent.isLoad)&&!this.parent.isFromOnPropertyChange&&t.parentItem&&this.parent.isInPredecessorValidation&&this.parent.getParentTask(t.parentItem).ganttProperties.isAutoSchedule&&-1===this.parentIds.indexOf(t.parentItem.uniqueID)&&(this.parentIds.push(t.parentItem.uniqueID),this.parentRecord.push(t.parentItem))},sXt.prototype.getPredecessorDate=function(i,e,t){var n,o,r,s=this,a=(void 0===t&&(t=null),e.filter(function(e){var t="ResourceView"===s.parent.viewType?i.ganttProperties.taskId:i.ganttProperties.rowUniqueID;return e.to===t.toString()?e:null}));if(a)for(var l=a.length,h=0;h<l;h++){var d=a[h],p="ProjectView"!==this.parent.viewType||je(t)?(r=this.parent.connectorLineModule.getRecordByID(d.from),this.parent.connectorLineModule.getRecordByID(d.to)):(r=t.get(d.from),t.get(d.to));"ProjectView"!==this.parent.viewType||!this.parent.allowTaskbarDragAndDrop||je(p)&&je(r)||(p=je(p)?this.getRecord(r,p,d):p,r=je(r)?this.getRecord(r,p,d):r),p&&r&&(o=this.getValidatedStartDate(p.ganttProperties,r.ganttProperties,d)),null!==n&&1!==this.dateValidateModule.compareDates(o,n)||(n=o)}return n},sXt.prototype.getValidatedStartDate=function(e,t,i){var n=i.type,o=i.offset;switch(n){case"FS":a=this.dateValidateModule.getValidEndDate(t),e.isMilestone&&0===o||(a=this.dateValidateModule.checkStartDate(a,e)),0!==o&&(a=this.updateDateByOffset(a,i,e)),s=e.isMilestone?a:this.dateValidateModule.checkStartDate(a,e);break;case"FF":case"SF":var r,s,a="FF"===n?this.dateValidateModule.getValidEndDate(t):this.dateValidateModule.getValidStartDate(t);0!==o&&(a=this.updateDateByOffset(a,i,e)),e.isMilestone||((r=new Date(a)).setDate(r.getDate()-1),a=this.dateValidateModule.checkEndDate(a,e)),s=e.segments&&0!==e.segments.length?(r=this.dateValidateModule.getDuration(e.startDate,e.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone),this.dateValidateModule.getStartDate(a,r,e.durationUnit,e)):this.dateValidateModule.getStartDate(a,e.duration,e.durationUnit,e);break;case"SS":a=this.dateValidateModule.getValidStartDate(t),0!==o&&(a=this.updateDateByOffset(a,i,e)),s=e.isMilestone?a:this.dateValidateModule.checkStartDate(a,e)}return s},sXt.prototype.updateDateByOffset=function(e,t,i){var n,o=t.offset,t=t.offsetUnit;return o<0&&!je(e)?n=this.dateValidateModule.getStartDate(this.dateValidateModule.checkEndDate(e,i),-1*o,t,i,!0):(je(e)||(n=this.dateValidateModule.getEndDate(e,o,t,i,!1)),i.isMilestone||(n=this.dateValidateModule.checkStartDate(n,i))),n},sXt.prototype.createConnectorLinesCollection=function(e){var t,i=e||this.parent.currentViewData,e=this.parent.pdfExportModule,n=e&&e.isPdfExport,o=(n&&(d=(t=e.helper&&e.helper.exportProps)&&t.fitToWidthSettings,t)&&d&&d.isFitToWidth&&(d=t.exportType,t=e.helper.beforeSinglePageExport,i="CurrentViewData"===d?t.cloneCurrentViewData:t.cloneFlatData),i.length),e=(this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth&&this.parent.pdfExportModule.isPdfExport?this.parent.connectorLineModule.expandedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.parent.getExpandedRecords(this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData):this.parent.connectorLineModule.expandedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.updatedRecords:this.parent.getExpandedRecords(this.parent.updatedRecords),this.parent.flatData),r=n?null:new Map;if(!n&&!je(e))for(var s=0,a=e;s<a.length;s++){var l=a[s];r.set(l.ganttProperties.rowUniqueID.toString(),l)}for(var h,d=this.parent.ganttChartModule.getChartRows(),p=!je(d)&&d[0]&&d[0].offsetHeight,c=0;c<o;c++)this.parent.editModule&&0<this.parent.editModule.deletedTaskDetails.length&&(h=i[c].parentItem)&&(h=je(r)?this.parent.getRecordByID(h.taskId.toString()):r.get(h.taskId.toString()),this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(h),i[c])),this.parent.undoRedoModule&&this.parent.undoRedoModule.canUpdateIndex&&(i[c].index=c,i[c].parentItem)&&this.parent.getParentTask(i[c].parentItem)&&(i[c].parentItem.index=this.parent.getParentTask(i[c].parentItem).index),(h=i[c].ganttProperties.predecessor)&&this.addPredecessorsCollection(h,r,p)},sXt.prototype.addPredecessorsCollection=function(e,t,i){var n,o,r;if(void 0===t&&(t=null),void 0===i&&(i=0),e)for(n=e.length,o=0;o<n;o++){var s;if((s=e[o]).from===s.to)break;var a="ProjectView"!==this.parent.viewType||je(t)?(r=this.parent.connectorLineModule.getRecordByID(s.from),this.parent.connectorLineModule.getRecordByID(s.to)):(r=t.get(s.from),t.get(s.to)),l=!0;(l=(r&&r.hasChildRecords&&!r.expanded||a&&a.hasChildRecords&&!a.expanded)&&!this.parent.allowTaskbarOverlap&&"ProjectView"===this.parent.viewType?!1:l)&&this.parent.connectorLineModule.expandedRecords&&-1!==this.parent.connectorLineModule.expandedRecords.indexOf(r)&&-1!==this.parent.connectorLineModule.expandedRecords.indexOf(a)&&this.updateConnectorLineObject(r,a,s,i)}},sXt.prototype.updateConnectorLineObject=function(e,t,i,n){n=this.parent.connectorLineModule.createConnectorLineObject(e,t,i,n=void 0===n?0:n);return n&&(t.isCritical&&e.isCritical&&(n.isCritical=!0),0<this.parent.connectorLineIds.length&&-1===this.parent.connectorLineIds.indexOf(n.connectorLineId)||0===this.parent.connectorLineIds.length?(this.parent.updatedConnectorLineCollection.push(n),this.parent.connectorLineIds.push(n.connectorLineId)):-1!==this.parent.connectorLineIds.indexOf(n.connectorLineId)&&(t=this.parent.connectorLineIds.indexOf(n.connectorLineId),this.parent.updatedConnectorLineCollection[t]=n),i.isDrawn=!0),n},sXt.prototype.validatePredecessor=function(e,t,i){if(this.parent.isInPredecessorValidation&&e.ganttProperties.predecessor){for(var n,o=this.parent.editModule.taskbarEditModule,r=void 0,s=(o&&(r=o.taskBarEditRecord),e.ganttProperties.predecessor),a=void 0,l=null,h=("ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID).toString(),d=s.filter(function(e){return e.to===h?e:null}),p=s.filter(function(e){return e.from===h?e:null}),c=void 0,u=0;u<d.length;u++){n=d[u],a=this.parent.connectorLineModule.getRecordByID(n.from),(l=this.parent.connectorLineModule.getRecordByID(n.to)).parentItem&&(c=this.parent.getTaskByUniqueID(l.parentItem.uniqueID),-1===this.parent.editModule.updateParentRecords.indexOf(c))&&this.parent.editModule.updateParentRecords.push(c),a.parentItem&&(c=this.parent.getTaskByUniqueID(a.parentItem.uniqueID),-1===this.parent.editModule.updateParentRecords.indexOf(c))&&this.parent.editModule.updateParentRecords.push(c),"ProjectView"!==this.parent.viewType||!this.parent.allowTaskbarDragAndDrop||je(l)&&je(a)||(l=je(l)?this.getRecord(a,l,n):l,a=je(a)?this.getRecord(a,l,n):a),this.parent.isInPredecessorValidation&&l.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1;var g="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;g.toString()!==n.to&&g.toString()!==n.from||i&&"predecessor"!==i||(this.validateChildGanttRecord(a,l),this.parent.editModule.editedRecord&&this.parent.editModule.editedRecord.hasChildRecords&&!this.parent.editModule.editedRecord.parentItem&&(this.isValidatedParentTaskID=l.ganttProperties.taskId))}for(var m,u=0;u<p.length;u++){if(f=p[u],a=this.parent.connectorLineModule.getRecordByID(f.from),(l=this.parent.connectorLineModule.getRecordByID(f.to)).parentItem&&(c=this.parent.getTaskByUniqueID(l.parentItem.uniqueID),-1===this.parent.editModule.updateParentRecords.indexOf(c))&&this.parent.editModule.updateParentRecords.push(c),a.parentItem&&(c=this.parent.getTaskByUniqueID(a.parentItem.uniqueID),-1===this.parent.editModule.updateParentRecords.indexOf(c))&&this.parent.editModule.updateParentRecords.push(c),"ProjectView"!==this.parent.viewType||!this.parent.allowTaskbarDragAndDrop||je(l)&&je(a)||(l=je(l)?this.getRecord(a,l,f):l,a=je(a)?this.getRecord(a,l,f):a),this.parent.isInPredecessorValidation&&l.ganttProperties.isAutoSchedule?this.parent.isValidationEnabled=!0:this.parent.isValidationEnabled=!1,"predecessor"!==i&&this.parent.isValidationEnabled){if(this.validateChildGanttRecord(a,l),this.parent.editModule.editedRecord&&l){var f=a.parentItem?this.getRootParent(a):null;if(l.hasChildRecords&&(!this.parent.editModule.editedRecord.hasChildRecords||!l.parentItem&&(!f||f.ganttProperties.taskId===this.parent.editModule.editedRecord.ganttProperties.taskId))&&this.isValidatedParentTaskID!==l.ganttProperties.taskId){this.updateChildItems(l);for(var y=0;y<l.childRecords.length;y++){var v=l.childRecords[y].ganttProperties;if(-1!==this.isChildRecordValidated.indexOf(v.taskId))return;if(this.isChildRecordValidated.push(v.taskId),v.predecessor&&0<v.predecessor.length)for(var b=0;b<v.predecessor.length;b++){var w=void 0;(w=v.predecessor[b].to!==l.ganttProperties.taskId.toString()?this.parent.flatData[this.parent.ids.indexOf(v.predecessor[b].to)]:this.parent.flatData[this.parent.ids.indexOf(v.predecessor[b].from)])&&(this.validatePredecessor(w,[],""),w.hasChildRecords&&this.parent.editModule.editedRecord.hasChildRecords&&this.updateChildItems(w),this.isValidatedParentTaskID=w.ganttProperties.taskId)}}this.isValidatedParentTaskID=l.ganttProperties.taskId}this.parent.editModule.editedRecord.hasChildRecords&&!this.parent.editModule.editedRecord.parentItem&&(this.isValidatedParentTaskID=l.ganttProperties.taskId)}}else!l.ganttProperties.isAutoSchedule&&this.parent.updateOffsetOnTaskbarEdit&&(this.parent.connectorLineEditModule.validatedOffsetIds=[],this.parent.connectorLineEditModule.calculateOffset(l));!1===a.expanded||!1===l.expanded?l&&this.validatePredecessor(l,void 0,"successor"):l&&(this.parent.editModule.isFirstCall&&(f="ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids,this.storeId=JSON.parse(JSON.stringify(f)),this.parent.editModule.isFirstCall=!1),this.storeId?(S=void 0,f=l[this.parent.taskFields.id].toString(),-1!==(S="ResourceView"===this.parent.viewType?this.storeId.includes(m="T"+f)?this.storeId.indexOf(m):-1:this.storeId.indexOf(f))&&(this.storeId=this.storeId.slice(0,S).concat(this.storeId.slice(S+1)),this.validatePredecessor(l,void 0,"successor"))):this.validatePredecessor(l,void 0,"successor"))}l&&!l.hasChildRecords&&l.parentItem&&-1===this.validatedParentIds.indexOf(l.parentItem.taskId)&&this.validatedParentIds.push(l.parentItem.taskId);s=!0;if(s=l&&l.hasChildRecords&&-1!==this.validatedParentIds.indexOf(l.ganttProperties.taskId.toString())?!1:s)if(l&&l.ganttProperties.taskId!==this.isValidatedParentTaskID&&r){if("ParentDrag"!==o.taskBarEditAction&&"ChildDrag"!==o.taskBarEditAction&&!r.hasChildRecords&&l.hasChildRecords&&(this.updateChildItems(l),this.isValidatedParentTaskID=l.ganttProperties.taskId),l.parentItem){this.parent.dataOperation.updateParentItems(l,!0);var C=this.parent.getParentTask(l.parentItem),S=this.storeId&&-1!==this.storeId.indexOf(C[this.parent.taskFields.id].toString())?this.storeId.indexOf(C[this.parent.taskFields.id].toString()):-1;if(C.ganttProperties.predecessor&&0<C.ganttProperties.predecessor.length&&-1!==S)for(y=0;y<C.ganttProperties.predecessor.length;y++)C.ganttProperties.predecessor[y].to!==C.ganttProperties.taskId.toString()&&(w=this.parent.flatData[this.parent.ids.indexOf(C.ganttProperties.predecessor[y].to)])&&w.parentItem&&this.validateChildGanttRecord(l,w)}}else l&&l.hasChildRecords&&this.isValidatedParentTaskID!==l.ganttProperties.taskId&&!r&&(this.updateChildItems(l),this.isValidatedParentTaskID=l.ganttProperties.taskId)}},sXt.prototype.updateChildItems=function(e){var t=this;if(0<e.childRecords.length&&this.validatedChildItems&&0<this.validatedChildItems.length)if(!!e.childRecords.some(function(e){return t.validatedChildItems.includes(e)}))return;var i,n,o,r=this.parent.previousRecords[e.uniqueID],s=(je(r)||je(r)&&!je(r.ganttProperties)?i=new Date(e.ganttProperties.startDate.getTime()):je(r.ganttProperties.startDate)||(i=new Date(r.ganttProperties.startDate.getTime())),e.ganttProperties.startDate),a=[];if(this.getUpdatableChildRecords(e,a),0!==a.length){for(var l,h=!je(i)&&!je(s)&&i.getTime()>s.getTime()?(n=this.parent.dateValidationModule.checkStartDate(s),o=this.parent.dateValidationModule.checkEndDate(i,e.ganttProperties),!1):(n=this.parent.dateValidationModule.checkStartDate(i),o=this.parent.dateValidationModule.checkEndDate(s,e.ganttProperties),!0),d=!je(n)&&!je(o)&&n.getTime()>=o.getTime()?0:this.parent.dateValidationModule.getDuration(n,o,"minute",!0,!1),p=0;p<a.length;p++)a[p].ganttProperties.isAutoSchedule&&(0<d?(l=rqt(a[p].ganttProperties)?a[p].ganttProperties.startDate:a[p].ganttProperties.startDate||a[p].ganttProperties.endDate||new Date(i.toString()),l=h?this.parent.dateValidationModule.getEndDate(this.parent.dateValidationModule.checkStartDate(l,a[p].ganttProperties,a[p].ganttProperties.isMilestone),d,"minute",a[p].ganttProperties,!1):this.parent.dateValidationModule.getStartDate(this.parent.dateValidationModule.checkEndDate(l,a[p].ganttProperties),d,"minute",a[p].ganttProperties),this.calculateDateByRoundOffDuration(a[p],l),this.parent.isOnEdit&&-1===this.validatedChildItems.indexOf(a[p])&&this.validatedChildItems.push(a[p])):je(r)&&(l=i,a[p].ganttProperties.startDate.getTime()<=l.getTime()&&this.calculateDateByRoundOffDuration(a[p],l),this.parent.isOnEdit)&&-1===this.validatedChildItems.indexOf(a[p])&&this.validatedChildItems.push(a[p]));a.length&&this.parent.dataOperation.updateParentItems(e,!0)}},sXt.prototype.getUpdatableChildRecords=function(e,t){for(var i=e.childRecords,n=0;n<i.length;n++)i[n].ganttProperties.isAutoSchedule&&(t.push(i[n]),i[n].hasChildRecords)&&this.getUpdatableChildRecords(i[n],t)},sXt.prototype.calculateDateByRoundOffDuration=function(e,t){var i,n=e,o=n.ganttProperties,t=new Date(t.getTime());!je(o.endDate)&&je(o.startDate)?(i=this.parent.dateValidationModule.checkStartDate(t,o,null),this.parent.setRecordValue("endDate",this.parent.dateValidationModule.checkEndDate(i,n.ganttProperties),o,!0)):(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(t,o,!1),o,!0),je(o.duration)||this.parent.dateValidationModule.calculateEndDate(n)),this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.updateTaskData(n)},sXt.prototype.getRecord=function(e,t,i){var n,o;return je(t)?(n=this.parent.editModule.taskbarEditModule.previousIds.indexOf(i.to),o=this.parent.editModule.taskbarEditModule.previousFlatData[n]):je(e)&&(n=this.parent.editModule.taskbarEditModule.previousIds.indexOf(i.from),o=this.parent.editModule.taskbarEditModule.previousFlatData[n]),o},sXt.prototype.getValidPredecessor=function(i){var e,n=this,t=[];return je(i)||(e=i.ganttProperties.predecessor)&&0<e.length&&(t=e.filter(function(e){var t="ResourceView"===n.parent.viewType?i.ganttProperties.taskId:i.ganttProperties.rowUniqueID;return e.from!==t.toString()})),t};var rXt=sXt;function sXt(e){this.parentRecord=[],this.parentIds=[],this.parentPredecessors=[],this.validatedParentIds=[],this.storeId=null,this.isChildRecordValidated=[],this.parent=e,this.dateValidateModule=this.parent.dateValidationModule}lXt.prototype.getconnectorLineGap=function(e){return e.milestoneChild?this.parent.chartRowsModule.milestoneMarginTop/2+this.parent.chartRowsModule.milestoneHeight/2:this.parent.chartRowsModule.taskBarMarginTop/2+this.parent.chartRowsModule.taskBarHeight/2},lXt.prototype.initPublicProp=function(){this.lineColor=this.parent.connectorLineBackground,this.lineStroke=4<this.parent.connectorLineWidth?4:this.parent.connectorLineWidth,this.createConnectorLineTooltipTable()},lXt.prototype.getTaskbarMidpoint=function(e){return Math.floor(e?this.parent.chartRowsModule.milestoneMarginTop+this.parent.chartRowsModule.milestoneHeight/2:this.parent.chartRowsModule.taskBarMarginTop+this.parent.chartRowsModule.taskBarHeight/2)+1},lXt.prototype.createConnectorLineObject=function(t,i,e,n){void 0===n&&(n=0);var o,r,s={},a=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport?this.parent.flatData:this.expandedRecords,a=(r=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?(o=this.parent.flatData.filter(function(e){return e.ganttProperties.taskId.toString()===t.ganttProperties.taskId.toString()})[0],r=this.parent.flatData.filter(function(e){return e.ganttProperties.taskId.toString()===i.ganttProperties.taskId.toString()})[0],o=o.index,r.index):(o=a.indexOf(t),a.indexOf(i)),t.ganttProperties),l=i.ganttProperties,h=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.parent.getExpandedRecords(this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData):this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.currentViewData:this.parent.expandedRecords;return s.parentIndexInCurrentView=h.indexOf(t),s.childIndexInCurrentView=h.indexOf(i),!(this.parent.virtualScrollModule&&this.parent.enableVirtualization)&&(-1===s.parentIndexInCurrentView||-1===s.childIndexInCurrentView)||-1===s.parentIndexInCurrentView&&-1===s.childIndexInCurrentView||(s.parentLeft=a.isMilestone?a.left-this.parent.chartRowsModule.milestoneHeight/2:a.left,s.childLeft=l.isMilestone?l.left-this.parent.chartRowsModule.milestoneHeight/2:l.left,s.parentWidth=0===a.width||a.isMilestone?Math.floor(this.parent.chartRowsModule.milestoneHeight):a.width,s.childWidth=0===l.width||l.isMilestone?Math.floor(this.parent.chartRowsModule.milestoneHeight):l.width,s.parentIndex=o,s.childIndex=r,0===n?(h=this.parent.ganttChartModule.getChartRows(),s.rowHeight=!je(h)&&h[0]&&h[0].offsetHeight):s.rowHeight=n,s.type=e.type,o="ResourceView"===this.parent.viewType?a.taskId:a.rowUniqueID,r="ResourceView"===this.parent.viewType?l.taskId:l.rowUniqueID,s.connectorLineId="parent"+o+"child"+r,s.milestoneParent=!!a.isMilestone,s.milestoneChild=!!l.isMilestone,s.parentEndPoint=s.parentLeft+s.parentWidth,s.childEndPoint=s.childLeft+s.childWidth,je(rqt(a)))||je(rqt(l))?null:s},lXt.prototype.renderConnectorLines=function(e){var t,i=[];this.svgObject.innerHTML="";for(var n=0;n<e.length;n++)t=this.getConnectorLineTemplate(e[n]),this.svgObject.appendChild(t),i.push(e[n]);for(var o=this.parent.connectorLineModule.svgObject.childNodes,r=0;r<o.length;r++)for(var s=o[r].childNodes,a=0;a<s.length;a++){var l="Connector Line "+this.parent.connectorLineModule.generateAriaLabel(i[r]);s[a].setAttribute("aria-label",l),s[a].setAttribute("role","img")}this.parent.ganttChartModule.chartBodyContent.insertBefore(this.dependencyViewContainer,this.parent.ganttChartModule.chartBodyContent.lastChild),this.dependencyViewContainer.appendChild(this.svgObject);for(r=0;r<this.svgObject.children.length;r++)this.svgObject.children[r].children[0].setAttribute("tabindex","-1")},lXt.prototype.getParentPosition=function(e){if(e.parentIndex<e.childIndex){if("FF"===e.type)return e.childLeft+e.childWidth>=e.parentLeft+e.parentWidth?"FFType2":"FFType1";if(e.parentLeft<e.childLeft&&e.childLeft>e.parentLeft+e.parentWidth+25){if("FS"===e.type)return"FSType1";if("SF"===e.type)return"SFType1";if("SS"===e.type)return"SSType2"}else if(e.parentLeft<e.childLeft&&e.childLeft<e.parentLeft+e.parentWidth||e.parentLeft===e.childLeft||e.parentLeft>e.childLeft){if(e.parentLeft>e.childLeft+e.childWidth+25&&"SF"===e.type)return"SFType2";if(e.parentLeft>e.childLeft){if("SS"===e.type)return"SSType1";if("SF"===e.type)return"SFType1"}if("FS"===e.type)return"FSType2";if("SS"===e.type)return"SSType2";if("SF"===e.type)return"SFType1"}else if(e.parentLeft<e.childLeft){if("FS"===e.type)return"FSType2";if("SS"===e.type)return"SSType2";if("SF"===e.type)return"SFType1"}}else if(e.parentIndex>e.childIndex)if(e.parentLeft<e.childLeft&&e.childLeft>e.parentLeft+e.parentWidth){if("FS"===e.type)return e.childLeft-(e.milestoneParent?e.parentLeft+e.parentWidth+4:e.parentLeft+e.parentWidth)<=30?"FSType3":"FSType4";if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth){if("SS"===e.type)return"SSType4";if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4"}}else if(e.parentLeft<e.childLeft&&e.childLeft<e.parentLeft+e.parentWidth||e.parentLeft===e.childLeft||e.parentLeft>e.childLeft){if(e.childLeft+e.childWidth<=e.parentLeft+e.parentWidth){if("FF"===e.type)return"FFType3";if("SF"===e.type)return e.childLeft+e.childWidth+25<e.parentLeft?"SFType3":"SFType4";if("SS"===e.type)return e.childLeft<=e.parentLeft?"SSType3":"SSType4"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth){if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4";if("SS"===e.type)return e.childLeft<=e.parentLeft?"SSType3":"SSType4"}if("FS"===e.type)return"FSType3"}else if(e.parentLeft<e.childLeft){if("FS"===e.type)return"FSType3";if("SS"===e.type)return"SSType4";if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4"}return null},lXt.prototype.getHeightValue=function(){return this.parent.showOverAllocation&&this.parent.allowTaskbarOverlap,this.parentRowIndexHeight>this.childRowIndexHeight?this.parentRowIndexHeight-this.childRowIndexHeight:this.childRowIndexHeight-this.parentRowIndexHeight},lXt.prototype.getInnerElementWidthSSType2=function(e){return e.parentLeft===e.childLeft?10:e.childLeft-e.parentLeft},lXt.prototype.getInnerElementLeftSSType2=function(e){return e.parentLeft===e.childLeft?e.parentLeft-20:e.parentLeft-10},lXt.prototype.getInnerChildWidthSSType2=function(e){return e.parentLeft+e.parentWidth<e.childLeft?10:e.parentLeft===e.childLeft?20:e.parentLeft+e.parentWidth>=e.childLeft?10:e.childLeft-e.parentLeft},lXt.prototype.calculateAdjustments=function(e,t,i){var n=this.parent.renderBaseline?.45:!je(document.body.className)&&document.body.className.includes("e-bigger")?.7:.62,n=Math.floor(this.parent.rowHeight*n);return je(this.parent.taskbarHeight)&&e<=36||!je(this.parent.taskbarHeight)&&this.parent.taskbarHeight<=n||!t||e<=36?{adjustY1:0,adjustX:0,adjustY2:0,adjustZ:0}:{adjustY1:(e-36)/("FSType2"===i||"FSType3"===i||"FSType4"===i||"SSType1"===i||"SSType2"===i||"SSType4"===i||"SFType2"===i?12:24),adjustX:-(e-36)/4,adjustZ:-2*(e-36)/24}},lXt.prototype.shouldAdjustForBaseline=function(e,t){if(!this.parent.renderBaseline||!e.milestoneParent&&!e.milestoneChild||e.milestoneParent&&e.milestoneChild)return 0;switch(t){case"FSType1":case"FSType2":return e.milestoneParent?-this.parent.chartRowsModule.milestoneMarginTop/2:this.parent.chartRowsModule.taskBarMarginTop;case"FSType3":case"FFType2":case"SFType2":case"SSType2":return e.milestoneParent?this.parent.chartRowsModule.milestoneMarginTop/2:-this.parent.chartRowsModule.taskBarMarginTop;case"FSType4":case"FFType3":case"SFType4":case"FFType4":case"SFType3":case"SFType1":return e.milestoneParent?-this.parent.chartRowsModule.milestoneMarginTop/2:this.parent.chartRowsModule.taskBarMarginTop;case"SSType3":return e.milestoneParent?-this.parent.chartRowsModule.taskBarMarginTop:this.parent.chartRowsModule.taskBarMarginTop;case"SSType1":case"FFType1":return e.milestoneParent?this.parent.chartRowsModule.taskBarMarginTop:-this.parent.chartRowsModule.milestoneMarginTop/2;default:return 0}},lXt.prototype.updateParentChildRowsHeight=function(e){var t=this.parent.currentViewData.length-1,i=this.parent.ganttChartModule.getChartRows(),n=(this.parentRowIndexHeight=e.parentIndexInCurrentView*e.rowHeight,this.childRowIndexHeight=e.childIndexInCurrentView*e.rowHeight,this.lastRowIndexHeight=t*e.rowHeight,0);if(!this.parent.allowTaskbarOverlap&&this.parent.enableMultiTaskbar)for(var o=this.parentRowIndexHeight=this.childRowIndexHeight=this.lastRowIndexHeight=0;o<t;o++){var r=i[o];r&&"none"!==r.style.display&&(n<e.parentIndexInCurrentView&&(this.parentRowIndexHeight+=i[o].offsetHeight),n<e.childIndexInCurrentView&&(this.childRowIndexHeight+=i[o].offsetHeight),this.lastRowIndexHeight+=i[o].offsetHeight,n++)}},lXt.prototype.getConnectorLineTemplate=function(e){var t=this.getInnerChildWidthSSType2(e),i=this.getInnerElementWidthSSType2(e),n=this.getInnerElementLeftSSType2(e),o=(this.updateParentChildRowsHeight(e),this.getHeightValue()),r=!!e.milestoneChild,s=this.getPosition(e,this.getParentPosition(e),o),o=this.getPosition(e,this.getParentPosition(e),o).top,s=(this.parent.renderBaseline&&(this.parent.rowHeight,e.milestoneParent&&e.milestoneChild||(e.milestoneParent||e.milestoneChild)),s.height),a=0,l=0,h=0,d=0;if(this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap){for(var p=0;p<this.parent.currentViewData.length;p++)"none"!==this.parent.getRowByIndex(p).style.display&&d<e.parentIndex&&(d++,this.parent.getRowByIndex(p).offsetHeight);for(var d=0,c=0;c<this.parent.currentViewData.length;c++)"none"!==this.parent.getRowByIndex(c).style.display&&d<e.childIndex&&(d++,h+=this.parent.getRowByIndex(c).offsetHeight)}this.parent.currentViewData[e.parentIndex]&&this.parent.currentViewData[e.childIndex]&&this.parent.allowParentDependency&&(v=this.parent.currentViewData[e.parentIndex].hasChildRecords,u=this.parent.currentViewData[e.childIndex].hasChildRecords,m=this.parent.currentViewData[e.parentIndex].ganttProperties.isAutoSchedule,g=this.parent.currentViewData[e.childIndex].ganttProperties.isAutoSchedule,!(v&&m&&!u||u&&g&&!v||v&&m&&g&&u||!v&&!u))&&(v&&!m&&u&&!g?l=-11:e.childIndex>e.parentIndex?!v&&u?a=-11:l=-(a=11):v&&!u?a=-11:l=-(a=11),this.parent.currentViewData[e.parentIndex].ganttProperties.isMilestone?e.parentIndex>e.childIndex?(l=-11,a=12):"SS"!==e.type&&"FF"!==e.type||(l=-5):this.parent.currentViewData[e.childIndex].ganttProperties.isMilestone?e.parentIndex>e.childIndex?(l=5,a=-10):e.parentIndex<e.childIndex&&("SS"!==e.type&&"FF"!==e.type||(l=-10)):(e.parentIndex<e.childIndex&&m&&!g||e.childIndex<e.parentIndex&&!m&&g)&&(l=0,a=-11),o+=l);var u,g,m,f,y,v=this.getParentPosition(e);return v&&(u=this.getParentPosition(e),m=this.parent.rowHeight,g=this.calculateAdjustments(m,r,u),this.transform=this.parent.enableRtl?"translate("+(this.parent.enableTimelineVirtualization?this.parent.timelineModule.wholeTimelineWidth:this.parent.timelineModule.totalTimelineWidth)+", 0) scale(-1, 1)":"",this.connectorId="ConnectorLine"+e.connectorLineId,this.groupObject=this.renderer.createGroup({id:this.connectorId,transform:this.transform,style:"pointer-events: stroke",class:yGt}),this.connectorPath=this.renderer.drawPath({class:vGt,d:this.connectorLinePath,fill:"transparent","stroke-width":this.lineStroke}),this.arrowlinePath=this.renderer.drawPath({d:this.arrowPath,class:CGt}),l=this.lineColor&&!this.parent.enableCriticalPath?this.lineColor:"",this.connectorPath.style.stroke=l,this.arrowlinePath.style.fill=l,this.groupObject.appendChild(this.connectorPath),this.groupObject.appendChild(this.arrowlinePath),m=this.shouldAdjustForBaseline(e,v),"FSType1"===v&&(this.taskLineValue=e.milestoneChild?1:0,this.x1=e.parentEndPoint+(e.milestoneParent||e.milestoneChild?-1:0),this.x2=e.milestoneParent?e.childLeft-(e.parentLeft+e.parentWidth+10)+this.lineStroke-10+1:e.childLeft-(e.parentLeft+e.parentWidth+10)+this.lineStroke-10,this.y1=o,this.y2=s+this.taskLineValue+a-this.lineStroke,this.connectorLinePath="M "+this.x1+" "+(this.y1-m)+" L "+(this.x1+this.x2+g.adjustZ)+" "+(this.y1-m)+" L "+(this.x1+this.x2+g.adjustZ)+" "+(this.y1+this.y2+g.adjustY1)+" L "+(this.x1+this.x2+12+g.adjustX)+" "+(this.y1+this.y2+g.adjustY1),this.arrowPath="M "+(this.x1+this.x2+20+g.adjustX)+" "+(this.y1+this.y2+g.adjustY1)+" L "+(this.x1+this.x2+12+g.adjustX)+" "+(this.y1+this.y2-(4+this.lineStroke)+g.adjustY1)+" L "+(this.x1+this.x2+12+g.adjustX)+" "+(this.y1+this.y2+4+g.adjustY1)+" Z"),"FSType2"===v&&(this.x1=e.parentLeft,this.x2=e.parentWidth+(e.milestoneParent?-1:0),this.x3=this.x2+(e.milestoneParent?11:10),this.x4=e.parentWidth-(e.parentEndPoint-e.childLeft+20),this.y1=o,this.y2=s+a-this.getconnectorLineGap(e)-this.lineStroke,this.y3=this.getconnectorLineGap(e),this.y4=this.parent.allowTaskbarOverlap?this.y1+this.y2-(this.y1+this.y2)%e.rowHeight:h,this.connectorLinePath="M "+(this.x1+this.x2)+" "+(this.y1-m)+"  L "+(this.x1+this.x3)+" "+(this.y1-m)+" L "+(this.x1+this.x3)+" "+this.y4+" L "+(this.x1+this.x4+g.adjustZ)+" "+this.y4+" L "+(this.x1+this.x4+g.adjustZ)+" "+(this.y1+this.y2+this.y3+g.adjustY1)+" L "+(this.x1+this.x4+12+g.adjustX)+" "+(this.y1+this.y2+this.y3+g.adjustY1),this.arrowPath="M "+(this.x1+this.x4+20+g.adjustX)+" "+(this.y1+this.y2+this.y3+g.adjustY1)+" L "+(this.x1+this.x4+12+g.adjustX)+" "+(this.y1+this.y2+this.y3-(4+this.lineStroke)+g.adjustY1)+" L "+(this.x1+this.x4+12+g.adjustX)+" "+(this.y1+this.y2+this.y3+4+this.lineStroke+g.adjustY1)+" Z"),"FSType3"===v&&(this.taskLineValue=e.milestoneChild?1:0,this.point1=o,this.x1=e.childLeft+(e.milestoneChild?-1:0)+(e.milestoneParent?1:0)-20,this.x2=e.parentEndPoint-e.childLeft+30,this.y1=this.point1,this.y2=this.point1+s+a-this.getconnectorLineGap(e)-this.lineStroke+this.taskLineValue,this.y3=this.getconnectorLineGap(e),this.y4=this.y2-this.y2%e.rowHeight,this.connectorLinePath="M "+(this.x1+12)+" "+(this.y1-m+g.adjustY1)+" L "+this.x1+" "+(this.y1-m+g.adjustY1)+" L "+this.x1+" "+this.y4+" L "+(this.x1+this.x2)+" "+this.y4+" L "+(this.x1+this.x2)+" "+(this.y2+this.y3)+" L "+(this.x1+this.x2-12)+" "+(this.y2+this.y3),this.arrowPath="M "+(this.x1+20+g.adjustX)+" "+(this.y1-m+g.adjustY1)+" L "+(this.x1+12+g.adjustX)+" "+(this.y1-(4+this.lineStroke)-m+g.adjustY1)+" L "+(this.x1+12+g.adjustX)+" "+(this.y1+4+this.lineStroke-m+g.adjustY1)+" Z"),"FSType4"===v&&(this.point1=o,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.parentEndPoint+(e.milestoneChild?-1:0)+(e.milestoneParent?1:0),this.x2=e.childLeft-e.parentEndPoint-20,this.y1=this.point1+(e.milestoneChild?-1:0),this.y2=this.point1+s+a-this.lineStroke+1+this.taskLineValue,this.connectorLinePath="M "+(this.x1+this.x2+12)+" "+(this.y1+g.adjustY1)+" L "+(this.x1+this.x2)+" "+(this.y1+g.adjustY1)+" L "+(this.x1+this.x2)+" "+(this.y2-m)+" L "+this.x1+" "+(this.y2-m),this.arrowPath="M "+(this.x1+this.x2+20+g.adjustX)+" "+(this.y1+g.adjustY1)+" L "+(this.x1+this.x2+12+g.adjustX)+" "+(this.y1-(4+this.lineStroke)+g.adjustY1)+" L "+(this.x1+this.x2+12+g.adjustX)+" "+(this.y1+4+this.lineStroke+g.adjustY1)+" Z"),"SSType4"===v&&(y=0!==g.adjustX?g.adjustX+2:g.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.point1=s+this.taskLineValue+a,this.point2=o,this.x1=e.parentLeft-10,this.x2=e.childLeft-e.parentLeft,this.y1=this.point2+(e.milestoneChild?1:0),this.y2=(e.milestoneChild?this.parent.chartRowsModule.taskBarMarginTop+this.parent.chartRowsModule.taskBarHeight/2:this.parent.chartRowsModule.milestoneMarginTop+this.parent.chartRowsModule.milestoneHeight/2)+this.point1,this.connectorLinePath="M "+(this.x1+this.x2+y)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+this.y2+" L "+(this.x1+10)+" "+this.y2,this.arrowPath="M "+(this.x1+this.x2+8+y)+" "+this.y1+" L "+(this.x1+this.x2+y)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+this.x2+y)+" "+(this.y1+4+this.lineStroke)+" Z"),"SSType3"===v&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=s+this.taskLineValue+a-(this.lineStroke-1),this.x1=e.childLeft-20,this.y1=o,this.x2=e.parentLeft-e.childLeft+21,this.y2=this.y1+this.point1,this.connectorLinePath="M "+(this.x1+12+g.adjustX)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+(this.y2-m)+" L "+(this.x1+this.x2)+" "+(this.y2-m),this.arrowPath="M "+(this.x1+20+g.adjustX)+" "+this.y1+" L "+(this.x1+12+g.adjustX)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+12+g.adjustX)+" "+(this.y1+4+this.lineStroke)+" Z"),"SSType2"===v&&(y=0!==g.adjustX?g.adjustX+2:g.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=s+this.taskLineValue+a-this.lineStroke,this.x1=n,this.x2=t+1,this.y1=o,this.y2=this.y1+this.point1,this.connectorLinePath="M "+(this.x1+this.x2)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+(this.y2+g.adjustY1-m)+" L "+(this.x1+i+y)+" "+(this.y2+g.adjustY1-m),this.arrowPath="M "+(this.x1+i+8+y)+" "+(this.y2+g.adjustY1-m)+" L "+(this.x1+i+y)+" "+(this.y2-(4+this.lineStroke)+g.adjustY1-m)+" L "+(this.x1+i+y)+" "+(this.y2+4+this.lineStroke+g.adjustY1-m)+" Z"),"SSType1"===v&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=s+this.taskLineValue+a-this.lineStroke,this.x1=e.childLeft-20,this.x2=e.parentLeft-e.childLeft+21,this.y1=o,this.y2=this.y1+this.point1,this.connectorLinePath="M "+(this.x1+this.x2)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+(this.y2+g.adjustY1-m)+" L "+(this.x1+12+g.adjustX)+" "+(this.y2+g.adjustY1-m),this.arrowPath="M "+(this.x1+20+g.adjustX)+" "+(this.y2+g.adjustY1-m)+" L "+(this.x1+12+g.adjustX)+" "+(this.y2-(4+this.lineStroke)+g.adjustY1-m)+" L "+(this.x1+12+g.adjustX)+" "+(this.y2+4+this.lineStroke+g.adjustY1-m)+" Z"),"FFType1"===v&&(y=0!==g.adjustX?g.adjustX+11:g.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.x1=e.childEndPoint,this.x2=e.parentEndPoint+(e.milestoneParent?-1:0),this.x3=e.milestoneParent?22:21,this.x4=e.milestoneChild?4:8,this.y1=o,this.y2=s+this.taskLineValue+a-this.lineStroke+1,this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+(this.x2+this.x3)+" "+this.y1+" L "+(this.x2+this.x3)+" "+(this.y1+this.y2+g.adjustY1-m)+" L "+(this.x1+this.x4)+" "+(this.y1+this.y2+g.adjustY1-m),this.arrowPath="M "+(this.x1+y)+" "+(this.y1+this.y2+g.adjustY1-m)+" L "+(this.x1+8+y)+" "+(this.y1+this.y2-(4+this.lineStroke)+g.adjustY1-m)+" L "+(this.x1+8+y)+" "+(this.y1+this.y2+4+this.lineStroke+g.adjustY1-m)+" Z"),"FFType2"===v&&(y=0!==g.adjustX?g.adjustX+11:g.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.x1=e.parentEndPoint,this.x2=e.childEndPoint+(e.milestoneParent?22:21),this.x3=e.childEndPoint+(e.milestoneChild?9:8),this.y1=o,this.y2=s+this.taskLineValue+a-this.lineStroke+1,f=this.parent.renderBaseline?0:y,this.connectorLinePath="M "+this.x1+" "+this.y1+" L "+this.x2+" "+this.y1+" L "+this.x2+" "+(this.y1+this.y2+g.adjustY1-m)+" L "+this.x3+" "+(this.y1+this.y2+g.adjustY1-m),this.arrowPath="M "+(this.x3-8+f)+" "+(this.y1+this.y2+g.adjustY1-m)+" L "+(this.x3+f)+" "+(this.y1+this.y2-(4+this.lineStroke)+g.adjustY1-m)+" L "+(this.x3+f)+" "+(this.y1+this.y2+4+this.lineStroke+g.adjustY1-m)+" Z"),"FFType3"===v&&(y=0!==g.adjustX?g.adjustX+11:g.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.childEndPoint,this.x2=this.x1+(e.milestoneChild?4:8),this.x3=e.parentEndPoint-e.childEndPoint+(e.milestoneChild?16:10),this.x4=e.parentEndPoint+(e.milestoneParent?-1:0),this.y1=o,this.y2=s+this.taskLineValue+a-this.lineStroke+1,this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+(this.x2+this.x3)+" "+this.y1+" L "+(this.x2+this.x3)+" "+(this.y1+this.y2-m)+" L "+this.x4+" "+(this.y1+this.y2-m),this.arrowPath="M "+(this.x1+y)+" "+this.y1+" L "+(this.x1+8+y)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+8+y)+" "+(this.y1+4+this.lineStroke)+" Z"),"FFType4"===v&&(y=0!==g.adjustX?g.adjustX+11:g.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.parentEndPoint,this.x2=e.childEndPoint+(e.milestoneChild?7:8),this.x3=this.x2+(e.milestoneChild?12:11),this.y1=o,this.y2=s+this.taskLineValue+a-this.lineStroke+1,f=this.parent.renderBaseline?0:y,this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+this.x3+" "+this.y1+" L "+this.x3+" "+(this.y1+this.y2-m)+" L "+this.x1+" "+(this.y1+this.y2-m),this.arrowPath="M "+(this.x2-8+f)+" "+this.y1+" L "+(this.x2+f)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x2+f)+" "+(this.y1+4+this.lineStroke)+" Z"),"SFType4"===v&&(y=0!==g.adjustX?g.adjustX+11:g.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?-1:0,this.point1=this.taskLineValue+s+a-this.getconnectorLineGap(e)-(this.lineStroke-1),this.point2=o,this.x1=e.parentLeft-10,this.x2=this.x1+(e.childEndPoint-e.parentLeft+18),this.x3=this.x2+(e.milestoneChild?16:11),this.y1=this.point2,this.y2=this.y1+this.point1,this.y3=this.getconnectorLineGap(e),this.y4=this.y2-this.y2%e.rowHeight,f=this.parent.renderBaseline?0:y,this.connectorLinePath="M "+this.x2+" "+(this.y1-g.adjustY1)+" L "+this.x3+" "+(this.y1-g.adjustY1)+" L "+this.x3+" "+this.y4+" L "+this.x1+" "+this.y4+" L "+this.x1+" "+(this.y2+this.y3-m)+" L "+(this.x1+11)+" "+(this.y2+this.y3-m),this.arrowPath="M "+(this.x2-8+f)+" "+(this.y1-g.adjustY1)+" L "+(this.x2+f)+" "+(this.y1-(4+this.lineStroke)-g.adjustY1)+" L "+(this.x2+f)+" "+(this.y1+4+this.lineStroke-g.adjustY1)+" Z"),"SFType3"===v&&(y=0!==g.adjustX?g.adjustX+11:g.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.point1=e.parentLeft-(e.childEndPoint+(e.milestoneParent?23:20))+1,this.point2=o,this.x1=e.childEndPoint,this.x2=this.x1+(e.milestoneChild?9:8),this.x3=this.x2+(e.milestoneChild?17:11),this.y1=this.point2,this.y2=this.y1+s+a-(this.lineStroke-1)+this.taskLineValue,this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+this.x3+" "+this.y1+" L "+this.x3+" "+(this.y2-m)+" L "+(this.x3+this.point1)+" "+(this.y2-m),this.arrowPath="M "+(this.x2-8+y)+" "+this.y1+" L "+(this.x2+y)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x2+y)+" "+(this.y1+4+this.lineStroke)+" Z"),"SFType1"===v&&(y=0!==g.adjustX?g.adjustX+11:g.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=s+a-this.getconnectorLineGap(e)+this.taskLineValue-this.lineStroke,this.point2=this.getconnectorLineGap(e),this.x1=e.parentLeft-10,this.y1=o,this.x2=e.childEndPoint-e.parentLeft+31,this.y2=this.y1+this.point1,this.x3=e.childEndPoint-e.parentLeft+18,this.y3=this.y2-this.y2%e.rowHeight,f=this.parent.renderBaseline?0:y,this.connectorLinePath="M "+(this.x1+11)+" "+(this.y1-m)+" L "+this.x1+" "+(this.y1-m)+" L "+this.x1+" "+this.y3+" L "+(this.x1+this.x2)+" "+this.y3+" L "+(this.x1+this.x2)+" "+(this.y2+this.point2+g.adjustY1)+" L "+(this.x1+this.x3)+" "+(this.y2+this.point2+g.adjustY1),this.arrowPath="M "+(this.x1+this.x3-8+f)+" "+(this.y2+this.point2+g.adjustY1)+" L "+(this.x1+this.x3+f)+" "+(this.y2+this.point2-(4+this.lineStroke)+g.adjustY1)+" L "+(this.x1+this.x3+f)+" "+(this.y2+this.point2+4+this.lineStroke+g.adjustY1)+" Z"),"SFType2"===v&&(y=0!==g.adjustX?g.adjustX+11:g.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.childEndPoint,this.y1=o,this.x2=e.parentLeft-e.childEndPoint,this.y2=this.y1+s+this.taskLineValue+a-this.lineStroke,this.connectorLinePath="M "+(this.x1+this.x2+1)+" "+this.y1+" L "+(this.x1+this.x2-10)+" "+this.y1+" L "+(this.x1+this.x2-10)+" "+(this.y2+g.adjustY1-m)+" L "+(this.x1+8)+" "+(this.y2+g.adjustY1-m),this.arrowPath="M "+(this.x1+y)+" "+(this.y2+g.adjustY1-m)+" L "+(this.x1+8+y)+" "+(this.y2-(4+this.lineStroke)+g.adjustY1-m)+" L "+(this.x1+8+y)+" "+(this.y2+4+this.lineStroke+g.adjustY1-m)+" Z"),this.connectorPath.setAttribute("d",this.connectorLinePath),this.arrowlinePath.setAttribute("d",this.arrowPath)),this.groupObject},lXt.prototype.getPosition=function(e,t,i){var n=0,o=0,r=!!e.milestoneParent,s=!!e.milestoneChild,r=this.getTaskbarMidpoint(r)-(this.lineStroke-1),s=this.getTaskbarMidpoint(s)-(this.lineStroke-1),a=-1!==e.parentIndexInCurrentView,e=-1!==e.childIndexInCurrentView;return"SSType1"===t||"SSType2"===t||"FFType1"===t||"FFType2"===t||"SFType2"===t?(n=a?this.parentRowIndexHeight+r:0,o=a&&e?i:e?this.childRowIndexHeight+r:this.lastRowIndexHeight+r):"SSType3"===t||"SSType4"===t||"FSType4"===t||"FFType3"===t||"FFType4"===t||"SFType4"===t||"SFType3"===t?(n=e?this.childRowIndexHeight+s:0,o=a&&e?i:a?this.parentRowIndexHeight+s:this.lastRowIndexHeight+s):"FSType3"===t?(n=e?this.childRowIndexHeight+r:0,o=a&&e?i:a?this.parentRowIndexHeight+s:this.lastRowIndexHeight+r):"SFType1"!==t&&"FSType1"!==t&&"FSType2"!==t||(n=a?this.parentRowIndexHeight+s:0,o=a&&e?i:e?this.childRowIndexHeight+s:this.lastRowIndexHeight+s),{top:n,height:o}},lXt.prototype.createConnectorLineTooltipTable=function(){this.tooltipTable=Q("table",{className:".e-tooltiptable",styles:"margin-top:0px",attrs:{cellspacing:"2px",cellpadding:"2px"}});var e=Q("tbody");e.innerHTML="",this.tooltipTable.appendChild(e)},lXt.prototype.getConnectorLineTooltipInnerTd=function(e,t,i,n){function o(e,t,i,n){var o=document.createElement("tr");return o.id=e,(e=document.createElement("td")).style.padding="2px",e.textContent=r.parent.localeObj.getConstant(t),(t=document.createElement("td")).textContent=i,(i=document.createElement("td")).style.padding="2px",i.textContent=r.parent.localeObj.getConstant(n),o.append(e,t,i),o}var r=this,s=document.createElement("tbody");return s.appendChild(o("fromPredecessor","from",e,t)),s.appendChild(o("toPredecessor","to",i||"",n||"")),s},lXt.prototype.generateAriaLabel=function(e){var t=e.type,i=this.expandedRecords,n=i[e.parentIndex].ganttProperties.taskName,i=i[e.childIndex].ganttProperties.taskName,e=this.parent.localeObj.getConstant("start"),o=this.parent.localeObj.getConstant("finish");return"FS"===t?n+" "+o+" to "+i+" "+e:"FF"===t?n+" "+o+" to "+i+" "+o:"SS"===t?n+" "+e+" to "+i+" "+e:n+" "+e+" to "+i+" "+o},lXt.prototype.getRecordByID=function(t){return je(t)?null:this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData.filter(function(e){return e.ganttProperties.taskId.toString()===t.toString()})[0]:"ResourceView"===this.parent.viewType?this.parent.flatData[this.parent.getTaskIds().indexOf("T"+t.toString())]:this.parent.getRecordByID(t)},lXt.prototype.removePreviousConnectorLines=function(e){for(var t=!0===S(e),i=(t?Object.keys(e):e).length,n=Object.keys(e),o=0;o<i;o++){var r=void 0,s=(r=t?e[n[o]]:e[o]).ganttProperties&&r.ganttProperties.predecessor;if(s&&0<s.length)for(var a=0;a<s.length;a++){var l="parent"+s[a].from+"child"+s[a].to;this.removeConnectorLineById(l)}}},lXt.prototype.removeConnectorLineById=function(e){e=this.parent.connectorLineModule.dependencyViewContainer.querySelector("#ConnectorLine"+e.replace(/([.])/g,"\\$1"));je(e)||ue(e)};var aXt=lXt;function lXt(e){this.transform="",this.connectorLinePath="",this.arrowPath="",this.taskLineValue=0,this.expandedRecords=[],this.parent=e,this.dependencyViewContainer=Q("div",{className:"e-gantt-dependency-view-container"}),Object.assign(this.dependencyViewContainer.style,{width:"100%",height:"100%",zIndex:2,position:"absolute",pointerEvents:"none"}),this.renderer=new fo(this.parent.element.id),this.initPublicProp(),this.svgObject=this.renderer.createSvg({id:this.parent.element.id+"_svg"}),this.svgObject.setAttribute("height","100%"),this.svgObject.setAttribute("width","100%")}dXt.prototype.renderSplitter=function(){var o=this,e=this.calculateSplitterPosition(this.parent.splitterSettings),t=(this.parent.splitterElement=Q("div",{className:"e-gantt-splitter"}),this.parent.treeGridPane=Q("div",{className:"e-gantt-tree-grid-pane"}),this.parent.chartPane=Q("div",{className:"e-gantt-chart-pane"}),U([this.parent.chartPane],"e-droppable"),this.parent.enableRtl?(this.parent.splitterElement.appendChild(this.parent.chartPane),this.parent.splitterElement.appendChild(this.parent.treeGridPane)):(this.parent.splitterElement.appendChild(this.parent.treeGridPane),this.parent.splitterElement.appendChild(this.parent.chartPane)),this.splitterObject=new fKe({height:null,width:this.parent.ganttWidth.toString(),enableRtl:this.parent.enableRtl,separatorSize:this.parent.splitterSettings.separatorSize,paneSettings:[{resizable:!0,size:e,min:this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum)},{resizable:!0}],orientation:"Horizontal",resizeStart:function(e){o.parent.contextMenuModule&&o.parent.contextMenuModule.isOpen&&o.parent.contextMenuModule.contextMenu.close();var t=e.pane[0],i=e.pane[1],n=(o.splitterPreviousPositionGrid=t.scrollWidth+1+"px",o.splitterPreviousPositionChart=i.scrollWidth+1+"px",new ll);return o.parent.trigger("splitterResizeStart",e,function(e){n.resolve(e)}),n},resizing:function(e){o.parent.trigger("splitterResizing",e),o.parent.timelineModule.isZoomToFit&&o.parent.timelineModule.updateTimelineAfterZooming(o.parent.timelineModule.timelineEndDate,!0)},resizeStop:function(e){o.parent.calculateDimensions(),o.isSplitterResized=!0;var t=e.pane[0],i=(o.splitterPreviousPositionGrid=t.scrollWidth+1+"px",o.splitterObject.paneSettings[0].size=o.getSpliterPositionInPercentage(o.splitterPreviousPositionGrid),o.parent.splitterSettings.position=o.splitterObject.paneSettings[0].size,new ll);return o.parent.trigger("splitterResized",e,function(e){!0===e.cancel&&(o.splitterObject.paneSettings[0].size=null,o.splitterObject.paneSettings[0].size=o.getSpliterPositionInPercentage(o.splitterPreviousPositionGrid),o.parent.splitterSettings.position=o.splitterObject.paneSettings[0].size,o.splitterObject.paneSettings[1].size=null,o.splitterObject.paneSettings[1].size=o.getSpliterPositionInPercentage(o.splitterPreviousPositionChart)),je(o.parent.projectEndDate)&&o.parent.timelineModule.updateTimelineAfterZooming(o.parent.timelineModule.timelineEndDate,!0),i.resolve(e)}),i}}),this.parent.element.appendChild(this.parent.splitterElement),this.splitterObject.appendTo(this.parent.splitterElement),this.splitterObject.element.querySelector(".e-split-bar"));t&&(e=parseFloat(e.replace("%","")),e=Math.min(100,Math.max(0,e)),t.setAttribute("aria-valuenow",e.toString()))},dXt.prototype.calculateSplitterPosition=function(e){var t;return!je(this.splitterObject)&&this.parent.enablePersistence?this.splitterObject.paneSettings[0].size:"Grid"===e.view?this.parent.enableRtl?"0%":"100%":"Chart"===e.view?this.parent.enableRtl?"100%":"0%":je(e.position)||""===e.position?!je(e.columnIndex)&&0<=e.columnIndex?150*e.columnIndex<this.parent.ganttWidth||!this.parent.element.classList.contains("e-device")?this.getSpliterPositionInPercentage(this.getTotalColumnWidthByIndex(e.columnIndex).toString()+"px"):this.getSpliterPositionInPercentage(130*e.columnIndex+"px"):(t=this.parent.ganttWidth,this.parent.enableRtl?this.getSpliterPositionInPercentage(t-250+"px"):this.getSpliterPositionInPercentage("250px")):this.getSpliterPositionInPercentage(e.position)},dXt.prototype.getSpliterPositionInPercentage=function(e){var t,i=je(e)||""===e?null:e;return i=je(i)?i:-1!==e.indexOf("px")?(t=parseInt(e,10))/this.parent.ganttWidth*100<=100?t/this.parent.ganttWidth*100+"%":"25%":this.parent.enableRtl?100-parseFloat(e)+"%":-1===e.indexOf("%")?e+"%":e},dXt.prototype.getTotalColumnWidthByIndex=function(e){var t=0,i=this.parent.ganttWidth,n=this.parent.ganttColumns.filter(function(e){return void 0===e.visible||!0===e.visible}).map(function(e){return Object.assign({},e)});if(e=n.length>e?e:n.length,this.parent.enableRtl){for(var o=0;o<e;o++)t+=parseInt(n[o].width,10);t=i-t}else for(o=0;o<e;o++)t+=parseInt(n[o].width,10);return t},dXt.prototype.updateSplitterPosition=function(){this.splitterObject.separatorSize=this.parent.splitterSettings.separatorSize;var e=this.calculateSplitterPosition(this.parent.splitterSettings);this.splitterObject.paneSettings[0].min=this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum),this.splitterObject.dataBind(),this.isSplitterResized||(this.splitterObject.paneSettings[0].size=e),this.isSplitterResized=!1,je(this.parent.projectEndDate)&&this.parent.timelineModule.updateTimelineAfterZooming(this.parent.timelineModule.timelineEndDate,!0)},dXt.prototype.triggerCustomResizedEvent=function(){var e=this.splitterObject.element.querySelectorAll(".e-pane")[0],t=this.splitterObject.element.querySelectorAll(".e-pane")[1],e={event:null,element:this.splitterObject.element,pane:[e,t],index:[0,1],separator:this.splitterObject.element.querySelector(".e-split-bar"),paneSize:[e.offsetWidth,t.offsetWidth]};this.parent.trigger("splitterResized",e),!0===e.cancel&&(this.splitterObject.paneSettings[0].size=this.getSpliterPositionInPercentage(this.splitterPreviousPositionGrid),this.splitterObject.paneSettings[1].size=this.getSpliterPositionInPercentage(this.splitterPreviousPositionChart))},dXt.prototype.destroy=function(){this.splitterObject.destroy(),this.parent.off("destroy",this.destroy)};var hXt=dXt;function dXt(e){this.isSplitterResized=!1,this.parent=e,this.parent.on("destroy",this.destroy,this)}cXt.prototype.createTooltip=function(){this.toolTipObj=new NS,this.toolTipObj.target=".e-header-cell-label, .e-gantt-child-taskbar,.e-gantt-parent-taskbar, .e-gantt-milestone, .e-gantt-unscheduled-taskbar.e-event-markers, .e-baseline-bar, .e-event-markers,.e-connector-line-container, .e-indicator-span, .e-notes-info, .e-gantt-manualparent-milestone,.e-taskbar-left-resizer, .e-taskbar-right-resizer, .e-baseline-gantt-milestone-container, .e-gantt-manualparenttaskbar",this.toolTipObj.position="BottomCenter",this.toolTipObj.openDelay=700,this.toolTipObj.enableRtl=this.parent.enableRtl,this.toolTipObj.enableHtmlSanitizer=this.parent.enableHtmlSanitizer,this.toolTipObj.cssClass=MGt,this.toolTipObj.animation={open:{effect:"None",delay:0},close:{effect:"None",delay:0}},this.toolTipObj.afterOpen=this.updateTooltipPosition.bind(this),this.toolTipObj.showTipPointer=!1,this.toolTipObj.beforeRender=this.tooltipBeforeRender.bind(this),this.toolTipObj.afterClose=this.tooltipCloseHandler.bind(this),this.toolTipObj.isStringTemplate=!0,this.toolTipObj.appendTo(this.parent.element)},cXt.prototype.tooltipBeforeRender=function(t){var e,i,n,o,r,s,a,l=this.parent;if(!l.isOnEdit)return o=je(z(t.target,"div."+Rqt))?oqt(t.target,Qqt):t.target,i={data:{},args:t,cancel:!1,content:""},t.target.classList.contains("e-header-cell-label")?l.timelineSettings.showTooltip?(r=t.target.getAttribute("data-tier"),n=t.target.title,s=je(l.timelineTemplate)?t.target.textContent:t.target.getAttribute("value"),n=l.tooltipSettings.timeline?l.tooltipModule.templateCompiler(l.tooltipSettings.timeline,l,Pe({},{date:n,value:s,tier:r}),"TooltipTaskbarTemplate"):null,s=document.createElement("div"),n?(ht(n,s),i.content=this.toolTipObj.content=s):i.content=this.toolTipObj.content=l.tooltipModule.getTooltipContent("timeline",e,l,t)):t.cancel=!0:l.tooltipSettings.showTooltip?(o&&(i.data=l.ganttChartModule.getRecordByTaskBar(o),e=i.data),t.target.classList.contains("e-gantt-child-taskbar")||t.target.classList.contains("e-gantt-parent-taskbar")||t.target.classList.contains("e-gantt-milestone")||t.target.classList.contains("e-gantt-unscheduled-taskbar")||t.target.classList.contains("e-taskbar-left-resizer")||t.target.classList.contains("e-taskbar-right-resizer")||t.target.classList.contains("e-gantt-manualparenttaskbar")&&l.tooltipSettings.taskbar?(r=void 0,l.tooltipSettings.taskbar&&(r=l.tooltipModule.templateCompiler(l.tooltipSettings.taskbar,l,e,"TooltipTaskbarTemplate")),s=document.createElement("div"),r&&ht(r,s),i.content=this.toolTipObj.content=r?s:e?l.tooltipModule.getTooltipContent(e.ganttProperties.isMilestone?"milestone":"taskbar",e,l,t):""):t.target.classList.contains("e-baseline-bar")||t.target.classList.contains("e-baseline-gantt-milestone-container")?(n=void 0,l.tooltipSettings.baseline&&(n=l.tooltipModule.templateCompiler(l.tooltipSettings.baseline,l,e,"TooltipBaselineTemplate")),o=document.createElement("div"),n&&ht(n,o),i.content=this.toolTipObj.content=n?o:e?l.tooltipModule.getTooltipContent(e.ganttProperties.isMilestone?"milestone":"baseline",e,l,t):""):t.target.classList.contains("e-event-markers")?i.content=this.toolTipObj.content=l.tooltipModule.getTooltipContent("marker",e,l,t):t.target.classList.contains("e-connector-line-container")?(r=void 0,l.tooltipModule.predecessorTooltipData=l.tooltipModule.getPredecessorTooltipData(t),i.data=this.predecessorTooltipData,l.tooltipSettings.connectorLine&&(r=l.tooltipModule.templateCompiler(l.tooltipSettings.connectorLine,l,l.tooltipModule.predecessorTooltipData,"TooltipConnectorLineTemplate")),i.content=this.toolTipObj.content=r?r[0]:l.tooltipModule.getTooltipContent("connectorLine",e,l,t)):t.target.classList.contains("e-indicator-span")?(i.content=this.toolTipObj.content=l.tooltipModule.getTooltipContent("indicator",e,l,t),je(i.content)&&(t.cancel=!0)):t.target.classList.contains("e-notes-info")?(s=this.parent.ganttChartModule.getRecordByTarget(t.event),i.content=this.toolTipObj.content=s.ganttProperties.notes,je(i.content)&&(t.cancel=!0)):t.target.classList.contains("e-gantt-manualparenttaskbar")?(i.content=this.toolTipObj.content=l.tooltipModule.getTooltipContent("manualtaskbar",e,l,t),je(i.content)&&(t.cancel=!0)):t.target.classList.contains("e-gantt-manualparent-milestone")&&(i.content=this.toolTipObj.content=l.tooltipModule.getTooltipContent("manualmilestone",e,l,t),je(i.content))&&(t.cancel=!0)):t.cancel=!0,!1===t.cancel?(a=new ll,l.trigger("beforeTooltipRender",i,function(e){a.resolve(e),e.cancel&&(t.cancel=!0)}),this.toolTipObj.content=i.content,this.parent.isAdaptive||"mouseover"!==t.event.type||(this.currentTarget=t.target,E.add(this.currentTarget,"mousemove",this.mouseMoveHandler.bind(this))),this.parent.renderTemplates(),a):void 0;t.cancel=!0},cXt.prototype.tooltipCloseHandler=function(e){this.tooltipMouseEvent=null,this.parent.isAdaptive||je(this.currentTarget)||E.remove(this.currentTarget,"mousemove",this.mouseMoveHandler),this.currentTarget=null},cXt.prototype.mouseMoveHandler=function(e){this.tooltipMouseEvent=e},cXt.prototype.updateTooltipPosition=function(e){e.element.style.visibility="visible";var t=this.parent.element.closest('[style*="zoom"]');if(je(t)&&!je(this.tooltipMouseEvent)&&!e.target.classList.contains("e-notes-info")){var t=this.getPointorPosition(this.tooltipMouseEvent),i=this.parent.getOffsetRect(this.parent.chartPane),n=i.top+this.parent.chartPane.offsetHeight,o=i.left+this.parent.chartPane.offsetWidth,r=t.x,i=t.y;if(o<r+e.element.offsetWidth+10)for(;o<r+e.element.offsetWidth+10;)r=o-e.element.offsetWidth-10,e.element.style.left=r+"px";else e.element.style.left=(r+=10)+"px";e.event.clientY>e.element.offsetHeight&&n<(i=window.innerHeight<e.element.offsetHeight+i?i-e.element.offsetHeight-10:i)+e.element.offsetHeight+20?i=i-e.element.offsetHeight-10:i+=10,e.element.style.top=i+"px"}},cXt.prototype.getPointorPosition=function(e){var t,i;return je(R("pageX",e))&&je(R("pageY",e))?je(R("clientX",e))&&je(R("clientY",e))||(t=R("clientX",e)+document.body.scrollLeft+document.documentElement.scrollLeft,i=R("clientY",e)+document.body.scrollTop+document.documentElement.scrollTop):(t=R("pageX",e),i=R("pageY",e)),{x:t,y:i}},cXt.prototype.getTooltipContent=function(e,t,i,n){var o,r,s,a;switch(t&&(s=(r=t.ganttProperties).taskName,this.parent.enableHtmlSanitizer&&"string"==typeof s&&(s=go.sanitize(s)),o=je(s)?"":'<tr class = "e-gantt-tooltip-rowcell"><td colspan="3">'+(this.parent.disableHtmlEncode?s.replace(/</g,"&lt;").replace(/>/g,"&gt;"):s)+"</td></tr>"),e){case"milestone":var l=void 0,h=(n.target.className.includes("e-baseline-gantt-milestone-container")&&!je(r.baselineStartDate)?l=r.baselineStartDate:je(r.startDate)||(l=r.startDate),this.parent.getFormatedDate(l,this.parent.getDateFormat())),d=(this.parent.enableHtmlSanitizer&&"string"==typeof h&&(h=go.sanitize(h)),je(l)?"":'<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+h+"</td></tr>"),p=ao(function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+o+d+"</tbody></table>"});break;case"taskbar":var l=!(t.hasChildRecords&&!r.isAutoSchedule),h=this.parent.getFormatedDate(l?r.startDate:r.autoStartDate,this.parent.getDateFormat()),c=this.parent.getFormatedDate(l?r.endDate:r.autoEndDate,this.parent.getDateFormat()),u=this.parent.getDurationString(l?r.duration:r.autoDuration,r.durationUnit),g=r.progress,m=(this.parent.enableHtmlSanitizer&&(h="string"==typeof h?go.sanitize(h):h,c="string"==typeof c?go.sanitize(c):c,u=go.sanitize(u)),r.startDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(l?"startDate":"subTasksStartDate")+"</td><td class="+gGt+'>:</td><td class = "e-gantt-tooltip-value"> '+h+"</td></tr>":""),f=r.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(l?"endDate":"subTasksEndDate")+"</td><td class="+gGt+'>:</td><td class = "e-gantt-tooltip-value">'+c+"</td></tr>":"",y=je(r.duration)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+"</td><td class="+gGt+'>:</td><td class = "e-gantt-tooltip-value"> '+u+"</td></tr>",v='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+"</td><td class="+gGt+">:</td><td>"+g+"</td></tr>";p=ao(function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+o+m+f+y+v+"</tbody></table>"});break;case"baseline":var b=this.parent.getFormatedDate(r.baselineStartDate,this.parent.getDateFormat()),w=this.parent.getFormatedDate(r.baselineEndDate,this.parent.getDateFormat());this.parent.enableHtmlSanitizer&&(b=go.sanitize(b),w=go.sanitize(w)),p=ao(function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+o+'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+b+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+w+"</td></tr></tbody></table>"},this);break;case"marker":var h=i.tooltipModule.getMarkerTooltipData(n),C=this.parent.getFormatedDate(this.parent.dateValidationModule.getDateFromFormat(h.day),this.parent.getDateFormat()),S=h.label||"";this.parent.enableHtmlSanitizer&&(S=go.sanitize(S),C=go.sanitize(C)),p=ao(function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr><td>'+C+"</td></tr><tr><td>"+(this.parent.disableHtmlEncode?S.replace(/</g,"&lt;").replace(/>/g,"&gt;"):S)+"</td></tr></tbody></table>"},this);break;case"connectorLine":var A=i.tooltipModule.predecessorTooltipData.fromName,x=i.tooltipModule.predecessorTooltipData.fromId,I=i.tooltipModule.predecessorTooltipData.toName,T=i.tooltipModule.predecessorTooltipData.toId,E=i.tooltipModule.predecessorTooltipData.linkText,D=i.tooltipModule.predecessorTooltipData.offsetString;this.parent.enableHtmlSanitizer&&(A=go.sanitize(A),x=go.sanitize(x),I=go.sanitize(I),T=go.sanitize(T),E=go.sanitize(E),D=go.sanitize(D)),p=ao(function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("from")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+(this.parent.disableHtmlEncode?A.replace(/</g,"&lt;").replace(/>/g,"&gt;"):A)+" ("+(this.parent.disableHtmlEncode&&"string"==typeof x?x.replace(/</g,"&lt;").replace(/>/g,"&gt;"):x)+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("to")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+(this.parent.disableHtmlEncode?I.replace(/</g,"&lt;").replace(/>/g,"&gt;"):I)+" ("+T+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("taskLink")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+E+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("lag")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+D+"</td></tr></tbody></table>"},this);break;case"indicator":n.target.title.length&&(a=n.target.title,this.parent.enableHtmlSanitizer&&"string"==typeof a&&(a=go.sanitize(a)),p=ao(function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr>'+a+"</tr></tbody></table>"}));break;case"timeline":var M=n.target.title;this.parent.enableHtmlSanitizer&&"string"==typeof M&&(M=go.sanitize(M)),p=ao(function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr>'+M+"</tr></tbody></table>"});break;case"manualtaskbar":var l=this.parent.getFormatedDate(r.autoStartDate,this.parent.getDateFormat()),c=this.parent.getFormatedDate(r.autoEndDate,this.parent.getDateFormat()),u=this.parent.getDurationString(r.duration,r.durationUnit),g=this.parent.getFormatedDate(r.startDate,this.parent.getDateFormat()),h=this.parent.getFormatedDate(r.endDate,this.parent.getDateFormat()),k=(this.parent.enableHtmlSanitizer&&(l=go.sanitize(l),c=go.sanitize(c),u=go.sanitize(u),g=go.sanitize(g),h=go.sanitize(h)),'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+l+"</td></tr>"),P='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+c+"</td></tr>",B='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+u+"</td></tr>",F='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("startDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+g+"</td></tr>",L='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+h+"</td></tr>";p=ao(function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+o+F+k+L+P+B+"</tbody></table>"});break;case"manualmilestone":var l=this.parent.getFormatedDate(r.autoStartDate,this.parent.getDateFormat()),c=this.parent.getFormatedDate(r.autoEndDate,this.parent.getDateFormat()),u=this.parent.getFormatedDate(r.startDate,this.parent.getDateFormat()),R=(this.parent.enableHtmlSanitizer&&(l=go.sanitize(l),c=go.sanitize(c),u=go.sanitize(u)),'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+l+"</td></tr>"),O='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+c+"</td></tr>",N='<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+u+"</tr>";p=ao(function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+o+N+R+O+"</tbody></table>"})}return p},cXt.prototype.getMarkerTooltipData=function(e){e=e.target.id.match(/\d+/g);return this.parent.eventMarkers[Number(e)]},cXt.prototype.getPredecessorTooltipData=function(e){var t,e=e.target.id,i=(e=this.parent.enableHtmlSanitizer&&"string"==typeof e?go.sanitize(e):e).match(/ConnectorLineparent(.*)child(.*)/),n=(i.shift(),e="ResourceView"===this.parent.viewType?(t=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+i[0])],this.parent.flatData[this.parent.getTaskIds().indexOf("T"+i[1])]):(t=this.parent.flatData[this.parent.ids.indexOf(i[0])],this.parent.flatData[this.parent.ids.indexOf(i[1])]),t.ganttProperties.predecessor.filter(function(e){return e.to===i[1]}));return{fromId:"ResourceView"===this.parent.viewType?t.ganttProperties.taskId:t.ganttProperties.rowUniqueID,toId:"ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID,fromName:t.ganttProperties.taskName,toName:e.ganttProperties.taskName,linkType:n[0].type,linkText:this.parent.getPredecessorTextValue(n[0].type),offset:n[0].offset,offsetUnit:n[0].offsetUnit,offsetString:this.parent.getDurationString(n[0].offset,n[0].offsetUnit)}},cXt.prototype.templateCompiler=function(e,t,i,n){var e=t.chartRowsModule.templateCompiler(e),o=t.chartRowsModule.getTemplateID(n);return e(Pe({index:0},i),t,n,o,!0)},cXt.prototype.destroy=function(){this.toolTipObj.destroy()};var pXt=cXt;function cXt(e){this.parent=e,this.createTooltip(),this.parent.on("destroy",this.destroy,this)}gXt.prototype.getActiveElement=function(e){return e?this.previousActiveElement:this.activeElement},gXt.prototype.setActiveElement=function(e){this.previousActiveElement=this.activeElement,this.activeElement=e},gXt.prototype.onKeyPress=function(e){var t=this.parent,i=e.target,n=t.getExpandedRecords(t.currentViewData),o=(!je(this.parent.focusModule.getActiveElement())||"expandAll"!==e.action&&"collapseAll"!==e.action||this.parent.element.querySelector(".e-treegrid").focus(),!this.parent.isEdit&&!je(i)&&i.closest(".e-headercell")&&"Enter"===e.key&&this.parent.sortModule&&this.parent.allowSorting&&(e.action="enter",this.parent.treeGrid.grid.notify("key-pressed",e)),this.parent.focusModule.getActiveElement());if("home"!==e.action&&"end"!==e.action&&"downArrow"!==e.action&&"upArrow"!==e.action&&"delete"!==e.action&&"rightArrow"!==e.action&&"leftArrow"!==e.action&&"focusTask"!==e.action&&"focusSearch"!==e.action&&"expandAll"!==e.action&&"collapseAll"!==e.action&&"undo"!==e.action&&"redo"!==e.action&&"selectAll"!==e.action||je(t.editModule)||je(t.editModule.cellEditModule)||!0!==t.editModule.cellEditModule.isCellEdit)switch(!t.isAdaptive||"addRowDialog"!==e.action&&"editRowDialog"!==e.action&&"delete"!==e.action&&"addRow"!==e.action||t.selectionModule&&"Multiple"===t.selectionSettings.type&&(t.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none"),e.action){case"home":if(t.selectionModule&&"Cell"!==t.selectionSettings.mode){if(0===t.selectedRowIndex)return;t.selectionModule&&0===t.selectionModule.getCellSelectedRecords().length&&t.selectionModule.selectRow(0,!1,!0)}break;case"end":if(t.selectionModule&&"Cell"!==t.selectionSettings.mode){var r=n[n.length-1];if(t.selectedRowIndex===t.flatData.indexOf(r))return;t.selectionModule&&0===t.selectionModule.getCellSelectedRecords().length&&t.selectionModule.selectRow(t.flatData.indexOf(r),!1,!0)}break;case"downArrow":case"upArrow":(h=t.element.querySelector("#"+t.element.id+"_searchbar"))&&h.parentElement.classList.contains("e-input-focus")&&t.selectionModule.clearSelection(),t.element.classList.contains("e-scroll-disabled")||(this.upDownKeyNavigate(e),je(o)||je(o.closest(".e-chart-row"))||t.ganttChartModule.manageFocus(this.getActiveElement(),"remove",!0,e.action),t.selectionSettings&&"Both"===t.selectionSettings.mode&&e.target instanceof HTMLElement&&e.target.classList.contains("e-cellselectionbackground")&&e.target.classList.remove("e-cellselectionbackground"));break;case"expandAll":t.ganttChartModule.expandCollapseAll("expand");break;case"collapseAll":t.ganttChartModule.expandCollapseAll("collapse");break;case"expandRow":case"collapseRow":this.expandCollapseKey(e);break;case"saveRequest":if(!je(t.editModule)&&!je(t.editModule.cellEditModule)&&t.editModule.cellEditModule.isCellEdit){var r=t.editModule.cellEditModule.editedColumn;if(r.field!==t.columnMapping.duration||je(r.edit)||je(r.edit.read)||(l=e.target.ej2_instances[0],s=e.target.value,a=void 0,r.field===t.columnMapping.duration&&s!==(a=je(r.edit)||je(r.edit.read)?a:r.edit.read()).toString()&&(l.value=s,l.dataBind())),t.editModule.dialogModule.dialogObj&&R("dialogOpen",t.editModule.dialogModule.dialogObj))return;t.treeGrid.grid.saveCell(),t.element.querySelector(".e-treegrid").focus()}!je(o)&&!je(o.closest(".e-chart-row"))&&(r=e.target,a=o.querySelector(".e-gantt-parent-taskbar,.e-gantt-child-taskbar,.e-gantt-milestone"))&&this.parent.ganttChartModule.onTaskbarClick(e,r,a);break;case"escape":je(t.editModule)||je(t.editModule.cellEditModule)||(t.editModule.cellEditModule.isCellEdit=!1,je(t.toolbarModule))||t.toolbarModule.refreshToolbarItems();break;case"addRow":t.editModule&&t.editModule.cellEditModule&&t.editModule.cellEditModule.isCellEdit?e.stopPropagation():je(document.getElementById(this.parent.element.id+"_dialog"))&&(e.preventDefault(),t.addRecord(void 0,this.parent.editSettings.newRowPosition,this.parent.selectedRowIndex),t.element.focus());break;case"addRowDialog":if(e.preventDefault(),t.editModule&&t.editModule.dialogModule&&t.editSettings.allowAdding){if(t.editModule.dialogModule.dialogObj&&R("dialogOpen",t.editModule.dialogModule.dialogObj))return;t.editModule.dialogModule.openAddDialog()}break;case"editRowDialog":if(e.preventDefault(),t.element.querySelector(".e-treegrid").focus(),t.editModule&&t.editModule.dialogModule&&t.editSettings.allowEditing){if(t.editModule.dialogModule.dialogObj&&R("dialogOpen",t.editModule.dialogModule.dialogObj))return;t.editModule.dialogModule.openToolbarEditDialog()}break;case"delete":t.selectionModule&&t.editModule&&t.editModule.dialogModule&&(!t.editModule.dialogModule.dialogObj||t.editModule.dialogModule.dialogObj&&!t.editModule.dialogModule.dialogObj.visible)&&(!t.editSettings.allowTaskbarEditing||t.editSettings.allowTaskbarEditing&&!t.editModule.taskbarEditModule.touchEdit)&&("Cell"!==t.selectionSettings.mode&&t.selectionModule.selectedRowIndexes.length||"Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length)&&(je(e.target)||"INPUT"!==e.target.tagName)&&t.editModule.startDeleteAction();break;case"focusTask":e.preventDefault();var s=void 0;t.selectionModule&&(l=t.currentViewData,"Cell"===t.selectionSettings.mode||je(l[t.selectedRowIndex])?"Cell"===t.selectionSettings.mode&&0<t.selectionModule.getSelectedRowCellIndexes().length&&(s=l[(r=t.selectionModule.getSelectedRowCellIndexes())[r.length-1].rowIndex].ganttProperties.rowUniqueID):s=t.currentViewData[t.selectedRowIndex].ganttProperties.rowUniqueID),s&&t.scrollToTask(s.toString());break;case"focusSearch":t.element.querySelector("#"+t.element.id+"_searchbar")&&((h=t.element.querySelector("#"+t.element.id+"_searchbar")).setAttribute("tabIndex","-1"),h.focus());break;case"tab":case"shiftTab":t.element.classList.contains("e-scroll-disabled")||t.ganttChartModule.onTabAction(e);break;case"contextMenu":var a=document.getElementById(this.parent.element.id+"_contextmenu").ej2_instances[0],l=this.parent.getOffsetRect(e.target),r=l.top+l.height/2,s=l.left+l.width/2;this.setActiveElement(e.target),a.open(r,s),e.preventDefault();break;case"undo":this.parent.undoRedoModule&&0<this.parent.undoRedoModule.getUndoCollection.length&&this.parent.undo();break;case"redo":this.parent.undoRedoModule&&0<this.parent.undoRedoModule.getRedoCollection.length&&this.parent.redo();break;case"selectAll":e.preventDefault();var h=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children);0<h.length&&(l=parseInt(h[0].getAttribute("aria-rowindex"),10)-1,a=parseInt(h[h.length-1].getAttribute("aria-rowindex"),10)-1,je(l)||(l=Number(l)),je(a)||(a=Number(a)),je(l)||je(a)||this.parent.selectionModule.selectRowsByRange(l,a));break;default:r={requestType:"keyPressed",action:e.action,keyEvent:e};t.trigger("actionComplete",r)}},gXt.prototype.upDownKeyNavigate=function(e){e.preventDefault();var t,i,n,o,r,s=this.parent,a=("downArrow"===e.action||"upArrow"===e.action)&&this.parent.selectionModule&&this.parent.allowSelection&&this.parent.virtualScrollModule&&this.parent.enableVirtualization?s.getExpandedRecords(s.flatData):s.getExpandedRecords(s.currentViewData);s.selectionModule&&("Cell"!==s.selectionSettings.mode&&-1!==s.selectedRowIndex?(i=void 0,i=(("downArrow"===e.action||"upArrow"===e.action)&&this.parent.selectionModule&&this.parent.allowSelection&&this.parent.virtualScrollModule&&this.parent.enableVirtualization?s.flatData:s.currentViewData)[s.selectedRowIndex],(n=s.element.querySelector(".e-focused"))&&q([n],"e-focused"),n=a.indexOf(i),o="downArrow"===e.action?a[n+1]:a[n-1],r=this.parent.args,document.activeElement!==r&&(("downArrow"===e.action||"upArrow"===e.action)&&this.parent.selectionModule&&this.parent.allowSelection&&this.parent.virtualScrollModule&&this.parent.enableVirtualization?s.selectionModule.selectRow(s.flatData.indexOf(o),!1,!0):s.selectionModule.selectRow(s.currentViewData.indexOf(o),!1,!0))):"Cell"===s.selectionSettings.mode&&0<s.selectionModule.getSelectedRowCellIndexes().length&&(t=(r=(r=s.selectionModule.getSelectedRowCellIndexes())[r.length-1]).cellIndexes[r.cellIndexes.length-1],i=s.currentViewData[r.rowIndex],n=a.indexOf(i),o="downArrow"===e.action?a[n+1]:a[n-1],r={rowIndex:s.currentViewData.indexOf(o),cellIndex:t},s.selectionModule.selectCell(r)),this.parent.ganttChartModule.focusedRowIndex=this.parent.selectedRowIndex)},gXt.prototype.expandCollapseKey=function(e){var t,i,n=this.parent;n.selectionModule&&-1!==n.selectedRowIndex&&("Cell"!==n.selectionSettings.mode?i=n.selectedRowIndex:"Cell"===n.selectionSettings.mode&&0<n.selectionModule.getSelectedRowCellIndexes().length&&(t=n.selectionModule.getSelectedRowCellIndexes(),i=t[t.length-1].rowIndex),this.parent.virtualScrollModule&&this.parent.enableVirtualization&&(i=this.parent.currentViewData.findIndex(function(e){return e.ganttProperties.rowUniqueID===i.toString()})+1),"expandRow"===e.action?(this.isFromKeyboardAction=!0,n.expandByIndex(i)):(this.isFromKeyboardAction=!0,n.collapseByIndex(i)),this.isFromKeyboardAction=!1)};var uXt=gXt;function gXt(e){this.isFromKeyboardAction=!1,this.parent=e,this.activeElement=null,this.previousActiveElement=null}mXt=function(e,t){return(mXt=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])}))(e,t)};var mXt,fXt,yXt,Cet=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},u2t=(function(e,t){function i(){this.constructor=e}mXt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(vXt,fXt=Ji),vXt.prototype.getModuleName=function(){return"gantt"},vXt.prototype.preRender=function(){this.initProperties()},vXt.prototype.getCurrentDayStartTime=function(e){e=0<this.weekWorkingTime.length?this.getStartTime(e):this.defaultStartTime;return e},vXt.prototype.getCurrentDayEndTime=function(e){e=0<this.weekWorkingTime.length?this.getEndTime(e):this.defaultEndTime;return e},vXt.prototype.getStartTime=function(e){var t;switch(e.getDay()){case 0:t=this.sundayDefaultStartTime;break;case 1:t=this.mondayDefaultStartTime;break;case 2:t=this.tuesdayDefaultStartTime;break;case 3:t=this.wednesdayDefaultStartTime;break;case 4:t=this.thursdayDefaultStartTime;break;case 5:t=this.fridayDefaultStartTime;break;default:t=this.saturdayDefaultStartTime}return t},vXt.prototype.getEndTime=function(e){var t;switch(e.getDay()){case 0:t=this.sundayDefaultEndTime;break;case 1:t=this.mondayDefaultEndTime;break;case 2:t=this.tuesdayDefaultEndTime;break;case 3:t=this.wednesdayDefaultEndTime;break;case 4:t=this.thursdayDefaultEndTime;break;case 5:t=this.fridayDefaultEndTime;break;default:t=this.saturdayDefaultEndTime}return t},vXt.prototype.getNonWorkingRange=function(e){var t;switch(e.getDay()){case 0:t=this.sundayNonWorkingTimeRanges;break;case 1:t=this.mondayNonWorkingTimeRanges;break;case 2:t=this.tuesdayNonWorkingTimeRanges;break;case 3:t=this.wednesdayNonWorkingTimeRanges;break;case 4:t=this.thursdayNonWorkingTimeRanges;break;case 5:t=this.fridayNonWorkingTimeRanges;break;default:t=this.saturdayNonWorkingTimeRanges}return t},vXt.prototype.getWorkingRange=function(e){var t;switch(e.getDay()){case 0:t=this.sundayWorkingTimeRanges;break;case 1:t=this.mondayWorkingTimeRanges;break;case 2:t=this.tuesdayWorkingTimeRanges;break;case 3:t=this.wednesdayWorkingTimeRanges;break;case 4:t=this.thursdayWorkingTimeRanges;break;case 5:t=this.fridayWorkingTimeRanges;break;default:t=this.saturdayWorkingTimeRanges}return t},vXt.prototype.getSecondsPerDay=function(e){var t;switch(e.getDay()){case 0:t=this.sundaySeconds;break;case 1:t=this.mondaySeconds;break;case 2:t=this.tuesdaySeconds;break;case 3:t=this.wednesdaySeconds;break;case 4:t=this.thursdaySeconds;break;case 5:t=this.fridaySeconds;break;case 6:t=this.saturdaySeconds;break;default:t=this.secondsPerDay}return t},vXt.prototype.initProperties=function(){this.globalize=new Ti(this.locale),this.isAdaptive=F.isDevice,this.flatData=[],this.currentViewData=[],this.updatedRecords=[],this.ids=[],this.ganttColumns=[],this.updateOffsetOnTaskbarEdit=!1===this.UpdateOffsetOnTaskbarEdit?this.UpdateOffsetOnTaskbarEdit:this.updateOffsetOnTaskbarEdit,this.localeObj=new Cn(this.getModuleName(),this.getDefaultLocale(),this.locale),this.dataOperation=new Sqt(this),this.nonWorkingHours=[],this.mondayNonWorkingHours=[],this.tuesdayNonWorkingHours=[],this.wednesdayNonWorkingHours=[],this.thursdayNonWorkingHours=[],this.fridayNonWorkingHours=[],this.saturdayNonWorkingHours=[],this.sundayNonWorkingHours=[],this.nonWorkingTimeRanges=[],this.mondayNonWorkingTimeRanges=[],this.tuesdayNonWorkingTimeRanges=[],this.wednesdayNonWorkingTimeRanges=[],this.thursdayNonWorkingTimeRanges=[],this.fridayNonWorkingTimeRanges=[],this.saturdayNonWorkingTimeRanges=[],this.sundayNonWorkingTimeRanges=[],this.workingTimeRanges=[],this.mondayWorkingTimeRanges=[],this.tuesdayWorkingTimeRanges=[],this.wednesdayWorkingTimeRanges=[],this.thursdayWorkingTimeRanges=[],this.fridayWorkingTimeRanges=[],this.saturdayWorkingTimeRanges=[],this.sundayWorkingTimeRanges=[],this.defaultEndTime=null,this.defaultStartTime=null,this.mondayDefaultStartTime=null,this.mondayDefaultEndTime=null,this.tuesdayDefaultStartTime=null,this.tuesdayDefaultEndTime=null,this.wednesdayDefaultStartTime=null,this.wednesdayDefaultEndTime=null,this.thursdayDefaultStartTime=null,this.thursdayDefaultEndTime=null,this.fridayDefaultStartTime=null,this.fridayDefaultEndTime=null,this.saturdayDefaultStartTime=null,this.saturdayDefaultEndTime=null,this.sundayDefaultStartTime=null,this.sundayDefaultEndTime=null,this.durationUnitTexts={days:"days",hours:"hours",minutes:"minutes",day:"day",hour:"hour",minute:"minute"},this.durationUnitEditText={minute:["m","min","minute","minutes"],hour:["h","hr","hour","hours"],day:["d","dy","day","days"]},this.perDayWidth=null,this.isMileStoneEdited=!1,this.chartVerticalLineContainer=null,this.updatedConnectorLineCollection=[],this.connectorLineIds=[],this.predecessorsCollection=[],this.isInPredecessorValidation=this.enablePredecessorValidation,this.isValidationEnabled=!0,this.isLoad=!0,this.editedTaskBarItem=null,this.validationDialogElement=null,this.currentEditedArgs={},this.dialogValidateMode={respectLink:!1,removeLink:!1,preserveLinkWithEditing:!0},this.secondsPerDay=this.dataOperation.getSecondsPerDay(),this.nonWorkingDayIndex=[],this.dataOperation.getNonWorkingDayIndex(),this.columnMapping={},this.controlId=this.element.id,this.cloneProjectStartDate=this.enablePersistence&&this.cloneProjectStartDate?this.cloneProjectStartDate:null,this.cloneProjectEndDate=this.enablePersistence&&this.cloneProjectEndDate?this.cloneProjectEndDate:null,this.totalHolidayDates=this.dataOperation.getHolidayDates(),this.ganttChartModule=new WGt(this),this.timelineModule=new qGt(this),this.chartRowsModule=new nXt(this),this.treeGridModule=new XGt(this),this.dateValidationModule=new vqt(this),this.predecessorModule=new rXt(this),this.connectorLineModule=new aXt(this),this.splitterModule=new hXt(this),this.tooltipModule=new pXt(this),this.keyConfig={home:"home",end:"end",downArrow:"downarrow",upArrow:"uparrow",collapseAll:"ctrl+uparrow",expandAll:"ctrl+downarrow",collapseRow:"ctrl+shift+uparrow",expandRow:"ctrl+shift+downarrow",saveRequest:"13",escape:"27",addRow:"insert",addRowDialog:"ctrl+insert",editRowDialog:"ctrl+f2",delete:"delete",tab:"tab",shiftTab:"shift+tab",focusTask:"shift+f5",indentLevel:"shift+leftarrow",outdentLevel:"shift+rightarrow",focusSearch:"ctrl+shift+70",contextMenu:"shift+F10",undo:"ctrl+z",redo:"ctrl+y",selectAll:"ctrl+a"},this.focusModule=new uXt(this),0===this.zoomingLevels.length&&this.setProperties({zoomingLevels:this.getZoomingLevels()},!0),this.resourceFieldsMapping(),je(this.resourceFields.unit)&&this.setProperties({resourceFields:{unit:"unit"}},!0),this.taskIds=[]},vXt.prototype.isUndoRedoItemPresent=function(e){return!(!this.undoRedoModule||!this.undoRedoActions||-1===this.undoRedoActions.indexOf(e))},vXt.prototype.getDateFormat=function(){return je(this.dateFormat)?this.globalize.getDatePattern({skeleton:"yMd"}):this.dateFormat},vXt.prototype.getDefaultTZOffset=function(){var e=new Date((new Date).getFullYear(),0,1),t=new Date((new Date).getFullYear(),6,1);return Math.max(e.getTimezoneOffset(),t.getTimezoneOffset())},vXt.prototype.isInDst=function(e){return e.getTimezoneOffset()<this.getDefaultTZOffset()},vXt.prototype.resourceFieldsMapping=function(){var e=this.resourceFields;e.id=je(e.id)?this.resourceIDMapping:e.id,e.name=je(e.name)?this.resourceNameMapping:e.name},vXt.prototype.validateDimentionValue=function(e){return je(e)?null:"string"==typeof e&&"auto"!==e&&-1===e.indexOf("%")?-1===e.indexOf("px")?e+"px":e:"number"==typeof e?e+"px":e.toString()},vXt.prototype.calculateDimensions=function(){var e=this.validateDimentionValue(this.height),t=this.validateDimentionValue(this.width),i=(je(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(t=this.width),this.element.style.height),n=this.element.style.width;t&&(this.element.style.width=t),e&&(this.element.style.height=e),e||i||(this.element.style.height="auto"),t||n||(this.element.style.width="auto"),this.ganttHeight=this.element.offsetHeight,this.ganttWidth=this.element.offsetWidth},vXt.prototype.render=function(){this.isReact&&(this.treeGrid.isReact=!0,this.treeGrid.grid.isReact=!0),this.isVue&&(this.treeGrid.isVue=!0,this.treeGrid.grid.isVue=!0,this.treeGrid.vueInstance=this.vueInstance,this.treeGrid.grid.vueInstance=this.vueInstance),this.element.setAttribute("role","application"),mA({target:this.element},this.createElement),this.trigger("load",{}),this.element.classList.add("e-gantt"),this.isAdaptive?this.element.classList.add("e-device"):this.element.classList.remove("e-device"),this.calculateDimensions(),je(this.toolbarModule)||this.renderToolbar(),this.splitterModule.renderSplitter(),this.notify("renderPanels",null),this.actionFailures(),je(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.showSpinner():this.showMaskRow(),this.dataMap&&this.dataMap.clear(),this.dataOperation.checkDataBinding()},vXt.prototype.actionFailures=function(){for(var e,t,i,n,o,r,s=[],a=/^[a-zA-Z\s/]+$/,l=!0,h=this.taskFields.properties,d=(Object.keys(h).forEach(function(e){null!==h[e]&&(l=!1)}),!0),p=0;p<this.columns.length;p++)if(this.columns[p].isPrimaryKey){d=!1;break}function c(t,e,i,n){var o;je(i)||(o=i.filter(function(e){return e.prototype.getModuleName()===t})),e&&!je(o)&&0===o.length&&n.push("Module "+t+" is not available in Gantt component! You either misspelled the module name or forgot to load it!")}l&&s.push("Gantt Task Fields are not configured properly. The task fields are crucial for both the project and resource views to function properly. Please ensure that the gantt task fields are properly configured!"),"ResourceView"!==this.viewType||this.resourceFields.id||s.push("Gantt Resource Fields are not properly configured, which is crucial for the Resource View. Please ensure that the resource fields are configured correctly!"),this.dataSource instanceof me&&je(this.taskFields.hasChildMapping)&&s.push("hasChildMapping property is not configured for load-on-demand. Please ensure its properly configured in the Gantt Task Fields!"),je(this.timelineSettings.topTier.format)||""===this.timelineSettings.topTier.format||a.test(this.timelineSettings.topTier.format)||s.push("The provided top tier format is invalid. Please ensure that you provide a valid format for these tier. Make sure to use only letters and avoid numbers or special characters!"),je(this.timelineSettings.bottomTier.format)||""===this.timelineSettings.bottomTier.format||a.test(this.timelineSettings.bottomTier.format)||s.push("The provided bottom  tier format is invalid. Please ensure that you provide a valid format for these tier. Make sure to use only letters and avoid numbers or special characters!"),d&&"ResourceView"!==this.viewType&&s.push("Primarykey is not configured properly. The primarykey is crucial for doing CRUD operations or map taskId in column field of gantt!"),0<this.eventMarkers.length&&this.eventMarkers.forEach(function(e){e.day||s.push("Day is not configured properly in event markers.Please ensure that the day in event markers is properly configured!")}),c("sort",this.allowSorting,this.injectedModules,s),c("edit",e=this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing||this.editSettings.allowNextRowEdit||this.editSettings.allowTaskbarEditing||this.editSettings.mode||this.editSettings.newRowPosition||this.editSettings.showDeleteConfirmDialog?!0:e,this.injectedModules,s),c("reorder",this.allowReordering,this.injectedModules,s),c("excelExport",this.allowExcelExport,this.injectedModules,s),c("rowDragAndDrop",t=this.allowRowDragAndDrop||this.allowTaskbarDragAndDrop?!0:t,this.injectedModules,s),c("criticalPath",this.enableCriticalPath,this.injectedModules,s),c("undoRedo",this.enableUndoRedo,this.injectedModules,s),c("resize",this.allowResizing,this.injectedModules,s),c("toolbar",i=this.toolbar&&0<this.toolbar.length?!0:i,this.injectedModules,s),c("filter",n=this.allowFiltering||this.toolbar&&-1!==this.toolbar.indexOf("Search")?!0:n,this.injectedModules,s),c("selection",this.allowSelection,this.injectedModules,s),c("dayMarkers",o=this.highlightWeekends||this.holidays&&0<this.holidays.length||this.eventMarkers&&0<this.eventMarkers.length?!0:o,this.injectedModules,s),c("contextMenu",this.enableContextMenu,this.injectedModules,s),c("columnMenu",this.showColumnMenu,this.injectedModules,s),c("pdfExport",this.allowPdfExport,this.injectedModules,s),c("virtualScroll",this.enableVirtualization,this.injectedModules,s),0<s.length&&(r={error:{}},s.forEach(function(e,t){r.error[parseInt(t,10)]=e}),this.trigger("actionFailure",r))},vXt.prototype.hideMaskRow=function(){var e=this.element.querySelectorAll(".e-masked-table").length;for(je(this.contentMaskTable)||0===e&&!this.contentMaskTable||(ue(this.contentMaskTable),this.contentMaskTable=null),e=this.element.querySelectorAll(".e-masked-table").length,je(this.headerMaskTable)||0===e&&!this.headerMaskTable||(ue(this.headerMaskTable),this.headerMaskTable=null);0!==this.element.querySelectorAll(".e-table-background").length;)this.element.querySelectorAll(".e-table-background")[0].remove();for(;0!==this.element.querySelectorAll(".e-temp-timeline").length;)this.element.querySelectorAll(".e-temp-timeline")[0].remove();if(0!==this.element.querySelectorAll("."+Mqt).length)for(var t=0;t<this.singleTier;t++)je(this.element.querySelectorAll("."+Mqt)[parseInt(t.toString(),10)])||(this.element.querySelectorAll("."+Mqt)[parseInt(t.toString(),10)].style.visibility="visible");je(this.element.querySelector("."+Dqt))||(this.element.querySelector("."+Dqt).style.position="relative"),je(this.element.getElementsByClassName(Tqt)[0])||(this.element.getElementsByClassName(Tqt)[0].style.visibility="visible")},vXt.prototype.showMaskRow=function(){var e=this.chartPane.childNodes[0].childNodes[0],t=(this.scrollLeftValue=this.chartPane.childNodes[0].childNodes[0].scrollLeft,this.chartPane.childNodes[0].childNodes[1]);if(this.treeGrid.element&&this.ganttChartModule.setVirtualHeight(),!this.contentMaskTable){if(t){var i=t;if(this.renderBackGround(i),this.ganttChartModule.scrollObject.isSetScrollLeft){if(0!==this.element.querySelectorAll("."+Mqt).length){this.singleTier=this.timelineModule.isSingleTier?1:2;for(var n=0;n<this.singleTier;n++)this.element.querySelectorAll("."+Mqt)[parseInt(n.toString(),10)].style.visibility="hidden"}0===this.singleTier&&(this.singleTier=2)}this.element.getElementsByClassName(Tqt)[0].style.visibility="hidden",this.contentMaskTable=this.contentMaskTable=this.createMaskTable(i)}e&&this.ganttChartModule.scrollObject.isSetScrollLeft&&(this.element.querySelector("."+Dqt).style.position="static",this.renderHeaderBackground(i=e),this.headerMaskTable=this.headerMaskTable=this.createMaskTable(i))}},vXt.prototype.renderHeaderBackground=function(e){var t=e;if(!!z(t,"."+Dqt)){for(var i=this.createElement("div",{className:"e-table-background"}),n=0,o=Math.round(e.getBoundingClientRect().width),r=0;r<3;r++)this.enableRtl?i.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(o-=160)+"px; top:0px;"}})):i.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(n+=160)+"px; top:0px;"}}));t.insertBefore(i,t.firstChild)}},vXt.prototype.renderBackGround=function(e){var t=e;if(!!z(t,"."+Iqt)){for(var i=this.createElement("div",{className:"e-table-background"}),n=0,o=Math.round(e.getBoundingClientRect().width),r=0;r<3;r++)this.enableRtl?i.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(o-=160)+"px;z-index:1;"}})):i.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(n+=160)+"px;z-index:1;"}}));t.insertBefore(i,t.firstChild)}},vXt.prototype.createMaskTable=function(e){var t,i=e,n=e.getBoundingClientRect().height,o=!!z(i,"."+Dqt);return o?((t=this.createEmptyTimeLineTable(n)).style.position="sticky",t.style.left="0px",this.enableRtl&&t.style.removeProperty("left")):((t=this.createEmptyMaskTable(n)).style.position="absolute",t.style.zIndex=1),o?(t.style.height=e.getBoundingClientRect().height+"px",(n=this.createElement("div",{className:"e-temp-timeline"})).style.width=this.element.getElementsByClassName("e-timeline-header-container")[0].offsetWidth+"px",n.style.position="sticky",this.enableRtl?n.style["margin-right"]=Math.abs(this.scrollLeftValue)+"px":n.style["margin-left"]=this.scrollLeftValue+"px",n.appendChild(t),i.insertBefore(n,i.firstChild)):(t.style.height=e.getBoundingClientRect().height+"px",i.insertBefore(t,i.firstChild)),t},vXt.prototype.createEmptyTimeLineTable=function(e){for(var t=this.createElement("table",{className:"e-table e-masked-table"}),i=this.createElement("tbody",{className:"e-masked-tbody"}),n=[],o=this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+e/2+"px;"}}),r=0;r<this.singleTier;r++)n.push(o.cloneNode(!0));for(r=this.topBottomHeader=0;r<n.length;r++)i.appendChild(this.applyTimelineMaskRow(n[parseInt(r.toString(),10)])),this.topBottomHeader=this.topBottomHeader+1;return t.appendChild(i),t.style.width="100%",t},vXt.prototype.applyTimelineMaskRow=function(e){var t=e,i=4;4<this.element.getElementsByClassName("e-timeline-header-container")[0].offsetWidth/166&&(i=this.element.getElementsByClassName("e-timeline-header-container")[0].offsetWidth/166);for(var n=0;n<i;n++)t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"}));for(n=0;n<t.childNodes.length-1;n++)t.childNodes[parseInt(n.toString(),10)].style.width="166px";for(var o=[].slice.call(t.childNodes),n=0;n<o.length;n++){var r=o[parseInt(n.toString(),10)];switch(this.topBottomHeader){case 0:this.enableRtl?(r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-timelineHeader"></span>',r.children[0].style.left="-20px"):r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-timelineHeader"></span>';break;case 1:r.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),r.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),r.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"}));for(var s=[].slice.call(r.childNodes),a=0;a<s.length;a++){var l=s[parseInt(a.toString(),10)];0===a?this.enableRtl?(l.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>',l.children[0].style.left="-14px"):l.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>':1===a?this.enableRtl?(l.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML1"></span>',l.children[0].style.left="-30px"):l.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML1"></span>':this.enableRtl?(l.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML2"></span>',l.children[0].style.left="-60px"):l.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML2"></span>'}}}return t},vXt.prototype.createEmptyMaskTable=function(e){for(var t=this.createElement("table",{className:"e-table e-masked-table"}),i=this.createElement("tbody",{className:"e-masked-tbody"}),n=[],o=this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+e/7+"px;"}}),r=this.columnLoop=0;r<6;r++)n.push(o.cloneNode(!0));for(var s=0;s<n.length;s++)this.columnLoop<4?this.columnLoop=this.columnLoop+1:4===this.columnLoop&&(this.columnLoop=1),i.appendChild(this.applyMaskRow(n[parseInt(s.toString(),10)]));t.appendChild(i),t.style.width="100%";e=this.createElement("div",{className:"e-temp-container"});return e.style.width="calc(100% - 17px)",e.style.overflow="hidden",e.appendChild(t),e},vXt.prototype.applyMaskRow=function(e){var t=e;if(this.columnLoop<4){var i=2;2<this.element.getElementsByClassName("e-timeline-header-container")[0].offsetWidth/300&&(i=this.element.getElementsByClassName("e-timeline-header-container")[0].offsetWidth/300);for(var n=0;n<i;n++)t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"}))}else t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"}));for(var o=[].slice.call(t.childNodes),n=0;n<o.length;n++){var r=o[parseInt(n.toString(),10)];switch(this.columnLoop){case 1:0===n?this.enableRtl?(r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell01"></span>',r.children[0].style.left="-14px"):r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell01"></span>':r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell02"></span>';break;case 2:0===n?this.enableRtl?(r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell03"></span>',r.children[0].style.left="-14px"):r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell03"></span>':r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell04"></span>';break;case 3:0===n?this.enableRtl?(r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell05"></span>',r.children[0].style.left="-64px"):r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell05"></span>':this.enableRtl?(r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell06"></span>',r.children[0].style.left="-192px"):r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell06"></span>';break;case 4:this.enableRtl?(r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell07"></span>',r.children[0].style.left="-388px"):r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell07"></span>'}}return t},vXt.prototype.showSpinner=function(){kA(this.element)},vXt.prototype.hideSpinner=function(){BA(this.element)},vXt.prototype.processTimeline=function(){this.timelineModule.processTimelineUnit(),this.timelineModule.calculateZoomingLevelsPerDayWidth()},vXt.prototype.renderGantt=function(e){e&&(this.isFromOnPropertyChange=e),this.enableValidation&&(this.dataOperation.calculateProjectDates(),this.timelineModule.validateTimelineProp());var t=this.flatData,i=new Map;if(null!=t)for(var n=0,o=t;n<o.length;n++){var r=o[n];i.set(r.ganttProperties.rowUniqueID.toString(),r)}this.allowParentDependency&&this.predecessorModule.updateParentPredecessor(i),this.predecessorModule&&this.taskFields.dependency&&(this.predecessorModule.parentIds=[],this.predecessorModule.parentRecord=[],this.predecessorModule.updatePredecessors(i),this.isInPredecessorValidation)&&this.enableValidation&&this.autoCalculateDateScheduling&&(!this.isLoad||this.treeGrid.loadChildOnDemand||!this.taskFields.hasChildMapping)&&this.predecessorModule.updatedRecordsDateByPredecessor(i),this.enableValidation&&(this.dataOperation.calculateProjectDates(),this.timelineModule.validateTimelineProp(),this.dataOperation.updateGanttData()),e?(this.dataSource instanceof Object&&sqt(this)?(t=R("count",this.dataSource),this.treeGrid.dataSource={result:this.flatData,count:t}):this.treeGrid.setProperties({dataSource:this.flatData},!1),je(this.selectionModule)||this.treeGrid.setProperties({selectedRowIndex:this.selectedRowIndex},!1)):(this.treeGridPane.classList.remove("e-temp-content"),je(this.treeGridPane.querySelector(".e-gantt-temp-header"))||ue(this.treeGridPane.querySelector(".e-gantt-temp-header")),this.notify("dataReady",{}),this.enableContextMenu&&this.notify("initiate-contextMenu",{}),e=!je(document.body.className)&&document.body.className.includes("e-bigger")&&36===this.rowHeight?46:this.rowHeight,this.rowHeight=je(this.rowHeight)?36:e,this.renderTreeGrid(),this.wireEvents(),this.notify("initPredessorDialog",{})),this.isFromOnPropertyChange||this.splitterModule.updateSplitterPosition(),"Vertical"!==this.gridLines&&"Both"!==this.gridLines||this.dayMarkersModule||this.renderChartVerticalLines()},vXt.prototype.removeCriticalPathStyles=function(){var e=this.ganttChartModule.chartElement;q(e.querySelectorAll(".e-gantt-child-taskbar-inner-div"),_qt),q(e.querySelectorAll(".e-gantt-child-progressbar-inner-div"),Hqt),q(e.querySelectorAll(".e-critical-milestone"),zqt),q(this.element.querySelectorAll(".e-connector-line"),bGt),q(this.element.querySelectorAll(".e-connector-line-arrow"),wGt)},vXt.prototype.wireEvents=function(){this.allowKeyboard&&(this.keyboardModule=new bn(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfig,eventName:"keydown"})),E.add(window,"resize",this.windowResize,this),E.add(document.body,"keydown",this.keyDownHandler,this)},vXt.prototype.unwireEvents=function(){this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null),E.remove(window,"resize",this.windowResize),E.remove(document.body,"keydown",this.keyDownHandler)},vXt.prototype.keyDownHandler=function(e){e.altKey&&74===e.keyCode&&(this.ganttChartModule.manageFocus(this.treeGrid.element.childNodes[1],"remove",!1),this.ganttChartModule.manageFocus(this.element,"add",!1))},vXt.prototype.windowResize=function(){var e,t,i=this;je(this.element)||(this.updateContentHeight(),this.ganttChartModule.updateWidthAndHeight(),this.treeGridModule.ensureScrollBar(),this.predecessorModule&&this.taskFields.dependency&&(this.updateRowHeightInConnectorLine(this.updatedConnectorLineCollection),this.connectorLineModule.renderConnectorLines(this.updatedConnectorLineCollection)),e=this.criticalPathModule,this.enableCriticalPath&&e&&e.criticalPathCollection&&this.criticalPathModule.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds),this.calculateDimensions(),e=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[0],t=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[1],this.splitterModule.splitterPreviousPositionGrid=e.scrollWidth+1+"px",this.splitterModule.splitterPreviousPositionChart=t.scrollWidth+1+"px",this.timelineModule.isZoomedToFit&&setTimeout(function(){i.timelineModule.processZoomToFit()},0)),this.dayMarkersModule&&this.dayMarkersModule.eventMarkerRender&&this.dayMarkersModule.eventMarkerRender.updateContainerHeight(),this.enableTimelineVirtualization&&this.timelineModule.refreshTimeline()},vXt.prototype.keyActionHandler=function(e){var t;this.enableContextMenu&&this.contextMenuModule&&("downArrow"===e.action||"upArrow"===e.action)&&document.getElementById(this.element.id+"_contextmenu")&&this.args&&(je(t=this.args)||t.focus()),e.target&&("downArrow"===e.action||"upArrow"===e.action)&&e.target===this.element.querySelector(".e-rowcell")||e.target&&"escape"===e.action&&this.treeGrid.grid.columnMenuModule&&"block"===this.treeGrid.grid.columnMenuModule.columnMenu.element.style.display?this.treeGrid.grid.notify("key-pressed",e):this.focusModule.onKeyPress(e)},vXt.prototype.updateRowHeightInConnectorLine=function(e){if(e&&e.length){var t=!je(this.ganttChartModule)&&this.ganttChartModule.getChartRows()[0]&&this.ganttChartModule.getChartRows()[0].getBoundingClientRect().height;if(t&&!isNaN(t))for(var i=0;i<e.length;i++)e[i].rowHeight=t}},vXt.prototype.renderToolbar=function(){je(this.toolbarModule)||(this.toolbarModule.renderToolbar(),this.toolbarModule.refreshToolbarItems())},vXt.prototype.renderTreeGrid=function(){this.treeGridModule.renderTreeGrid()},vXt.prototype.updateCurrentViewData=function(){var t=this;if(this.currentViewData=this.treeGrid.getCurrentViewRecords().slice(),0<this.currentViewData.length&&this.loadChildOnDemand&&this.taskFields.hasChildMapping){this.isLoad=!0,this.flatData=[],this.dataOperation.taskIds=[],this.ids=[],this.dataOperation.recordIndex=0,this.dataOperation.dataArray=this.currentViewData,this.dataOperation.cloneDataSource(),this.predecessorModule&&this.taskFields.dependency&&(this.predecessorModule.parentIds=[],this.predecessorModule.parentRecord=[],this.predecessorModule.updatePredecessors());for(var e=this.treeGrid.grid.contentModule.rows.filter(function(e){if(e.data[t.taskFields.id]===t.flatData[0].ganttProperties.taskId)return e})[0].index,i=0;i<this.flatData.length;i++)this.flatData[i].index=e,e++;this.currentViewData=this.flatData,this.treeGrid.grid.currentViewData=this.flatData,je(this.treeGrid.virtualScrollModule)||(this.treeGrid.virtualScrollModule.visualData=this.flatData,this.updatedRecords=this.flatData)}},vXt.prototype.getRecordFromFlatdata=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getTaskByUniqueID(e[i].uniqueID));return t},vXt.prototype.updateContentHeight=function(e){var t,i;(this.allowTaskbarOverlap||this.ganttChartModule.isCollapseAll||this.ganttChartModule.isExpandAll||this.isLoad)&&(this.virtualScrollModule&&this.enableVirtualization&&!je(e)?(e=R("result.length",e),this.contentHeight=e*this.rowHeight):(e=this.virtualScrollModule&&this.enableVirtualization?this.currentViewData:this.getExpandedRecords(this.currentViewData),i=void(this.expandedRecords=e),t=je(this.ganttChartModule)||je(this.ganttChartModule.getChartRows())?null:this.ganttChartModule.getChartRows()[0],i=!je(t)&&0<t.offsetHeight?t.offsetHeight:this.rowHeight,this.contentHeight=e.length*i))},vXt.prototype.getExpandStatus=function(e){e=this.getParentTask(e.parentItem);return!!je(e)||!1!==e.expanded&&(!e.parentItem||!1!==this.getParentTask(e.parentItem).expanded&&this.getExpandStatus(this.getParentTask(e.parentItem)))},vXt.prototype.getExpandedRecords=function(e){var t=this;return je(e)?[]:(e=e.filter(function(e){return!0===t.getExpandStatus(e)}),this.expandedRecords=e)},vXt.prototype.getZoomingLevels=function(){var e=this.timelineSettings.weekStartDay;return[{topTier:{unit:"Year",format:"yyyy",count:50},bottomTier:{unit:"Year",format:"yyyy",count:10},timelineUnitSize:99,level:0,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:20},bottomTier:{unit:"Year",format:"yyyy",count:5},timelineUnitSize:99,level:1,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:5},bottomTier:{unit:"Year",format:"yyyy",count:1},timelineUnitSize:99,level:2,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayHalfValue,count:6},timelineUnitSize:66,level:3,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayHalfValue,count:6},timelineUnitSize:99,level:4,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayQuarterValue,count:3},timelineUnitSize:66,level:5,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:1},bottomTier:{unit:"Month",formatter:this.displayQuarterValue,count:3},timelineUnitSize:99,level:6,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:1},bottomTier:{unit:"Month",format:"MMM yyyy",count:1},timelineUnitSize:99,level:7,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yy",count:1},bottomTier:{unit:"Week",format:"dd",count:1},timelineUnitSize:33,level:8,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yyyy",count:1},bottomTier:{unit:"Week",format:"dd MMM",count:1},timelineUnitSize:66,level:9,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yyyy",count:1},bottomTier:{unit:"Week",format:"dd MMM",count:1},timelineUnitSize:99,level:10,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:33,level:11,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:66,level:12,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:99,level:13,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:12},timelineUnitSize:66,level:14,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:12},timelineUnitSize:99,level:15,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:6},timelineUnitSize:66,level:16,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:6},timelineUnitSize:99,level:17,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:2},timelineUnitSize:66,level:18,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:2},timelineUnitSize:99,level:19,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:1},timelineUnitSize:66,level:20,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:1},timelineUnitSize:99,level:21,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:30},timelineUnitSize:66,level:22,timelineViewMode:"Hour",weekStartDay:0,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:15},timelineUnitSize:66,level:23,timelineViewMode:"Hour",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:1},timelineUnitSize:66,level:24,timelineViewMode:"Hour",weekStartDay:e,updateTimescaleView:!0,weekendBackground:null,showTooltip:!0}]},vXt.prototype.displayQuarterValue=function(e){e=e.getMonth();return 0<=e&&e<=2?"Q1":3<=e&&e<=5?"Q2":6<=e&&e<=8?"Q3":"Q4"},vXt.prototype.displayHalfValue=function(e){e=e.getMonth();return 0<=e&&e<=5?"H1":"H2"},vXt.prototype.getFormatedDate=function(e,t){return je(e)?null:(je(t)&&(t=this.getDateFormat()),this.globalize.formatDate(e,{format:t}))},vXt.prototype.getDurationString=function(e,t){return this.dateValidationModule.getDurationString(e,t)},vXt.prototype.getWorkString=function(e,t){return this.dateValidationModule.getWorkString(e,t)},vXt.prototype.updateTreeColumns=function(){var e,t=this.treeGrid.grid.getColumns();-1!==this.treeColumnIndex&&this.columns[this.treeColumnIndex]&&!je(this.columns[this.treeColumnIndex].template)&&(e=this.columns[this.treeColumnIndex].template);for(var i=0;i<t.length;i++)for(var n={},o=0;o<this.columns.length;o++)if(this.columns[o].field===t[i].field){for(var r=0,s=Object.keys(this.columns[o]);r<s.length;r++){var a=s[r];ee(this.columns[o][a])||(n[a]=t[i][a]),n.visible=t[i].visible,n.width=t[i].width}this.columns[o]=n,"checkbox"===this.columns[o].type||je(e)||""===e||(this.columns[o].template=e)}0<this.columns.length&&this.treeGrid.setProperties({columns:this.columns},!0)},vXt.prototype.treeDataBound=function(e){var r=this;this.isLoad&&this.undoRedoModule&&(0<this.sortSettings.columns.length?this.undoRedoModule.previousSortedColumns=this.sortSettings.columns:""!==this.searchSettings.key&&(this.undoRedoModule.searchString=this.searchSettings.key)),this.element.getElementsByClassName("e-chart-root-container")[0].style.height="100%",this.element.getElementsByClassName("e-gridcontent")[0].childNodes[0].setAttribute("tabindex","0");this.element.getElementsByClassName("e-gridcontent")[0].childNodes[0].childNodes[0].setAttribute("role","treegrid");var t=this.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight,i=this.element.getElementsByClassName("e-chart-scroll-container e-content")[0];i.style.height="calc(100% - "+t+"px)",i.setAttribute("tabindex","0"),je(this.toolbarModule)||je(this.toolbarModule.element)?this.splitterElement.style.height="100%":this.splitterElement.style.height="calc(100% - "+this.toolbarModule.element.offsetHeight+"px)",this.filterSettings&&this.filterSettings.properties&&this.filterSettings.properties.columns&&this.filterSettings.properties.columns.forEach(function(e){for(var t=e.properties.field,i=null,n=0;n<r.treeGrid.columns.length;n++){var o=r.treeGrid.columns[n];if(o.field===t){i=o;break}}i&&e.properties.uid!==i.uid&&(e.properties.uid=i.uid)}),this.isLoad?(this.enablePersistence&&this.updateTreeColumns(),this.updateCurrentViewData(),this.enableVirtualization?this.virtualScrollModule&&this.enableVirtualization&&(this.ganttChartModule.virtualRender.adjustTable(),this.ganttChartModule.scrollObject.updateTopPosition()):this.updateContentHeight(),this.isTreeGridRendered||(this.isTreeGridRendered=!0,this.timelineModule.isSingleTier?this.element.classList.add(xqt):this.element.classList.remove(xqt),t=this.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight,i.style.height="calc(100% - "+t+"px)",this.treeGrid.setProperties({height:"100%"},!1),this.notify("tree-grid-created",{}),this.createGanttPopUpElement(),je(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.hideSpinner():this.hideMaskRow(),x("isGanttCreated",!0,e),this.renderComplete())):this.getCurrentRecords(e),this.loadChildOnDemand&&this.taskFields.hasChildMapping&&this.updateContentHeight(),this.enableCriticalPath&&this.criticalPathModule&&this.criticalPathModule.showCriticalPath(this.enableCriticalPath),this.notify("recordsUpdated",{});for(var n=0;n<document.getElementsByClassName("e-timeline-header-table-container").length;n++)for(var o=0;o<document.getElementsByClassName("e-timeline-header-table-container")[n].children[0].children[0].children.length;o++){var s=document.getElementsByClassName("e-timeline-header-table-container")[n].children[0].children[0].children[o].children[0];s&&s.setAttribute("tabindex","-1")}i=this.criticalPathModule;this.enableCriticalPath&&i&&i.criticalPathCollection&&this.criticalPathModule.criticalConnectorLine(i.criticalPathCollection,i.detailPredecessorCollection,!0,i.predecessorCollectionTaskIds),this.initialChartRowElements=this.ganttChartModule.getChartRows(),this.isLoad=!1,this.isExpandPerformed=!!this.enableVirtualization&&this.isExpandPerformed,this.isExpandPerformed||(this.previousFlatData=Pe([],this.flatData,[],!0)),this.trigger("dataBound",e)},vXt.prototype.getCurrentRecords=function(e){this.predecessorModule&&this.taskFields.dependency&&this.connectorLineModule.removePreviousConnectorLines(this.currentViewData),this.updateCurrentViewData(),this.enableVirtualization||this.updateContentHeight(),this.virtualScrollModule&&this.enableVirtualization&&(this.ganttChartModule.virtualRender.adjustTable(),this.ganttChartModule.scrollObject.updateTopPosition())},vXt.prototype.onPropertyChanged=function(e,t){for(var i=!1,n=0,o=Object.keys(e);n<o.length;n++){var r,s=o[n];switch(s){case"allowSelection":case"allowRowDragAndDrop":case"allowFiltering":case"showColumnMenu":case"allowResizing":case"allowReordering":case"allowSorting":case"enableImmutableMode":this.treeGrid[s]=this[s],this.treeGrid.dataBind();break;case"workWeek":this.dataOperation.getNonWorkingDayIndex(),this.dataOperation.reUpdateGanttData(),this.chartRowsModule.initiateTemplates(),this.taskFields.dependency&&this.predecessorModule.updatedRecordsDateByPredecessor(),this.chartRowsModule.refreshGanttRows(),this.treeGrid.refreshColumns(),this.timelineModule.refreshTimeline();break;case"toolbar":this.notify("ui-toolbarupdate",{module:"toolbar",properties:e});break;case"columnMenuItems":this.treeGrid.grid.columnMenuItems=qP(this.columnMenuItems);break;case"eventMarkers":case"highlightWeekends":this.notify("ui-update",{module:"day-markers",properties:e});break;case"sortSettings":this.treeGrid.sortSettings=qP(this.sortSettings),this.treeGrid.dataBind();break;case"timelineSettings":this.timelineModule.refreshTimeline();break;case"rowHeight":case"taskbarHeight":this.treeGrid.rowHeight=this.rowHeight,this.treeGrid.dataBind(),this.chartRowsModule.initiateTemplates(),this.timelineModule.updateChartByNewTimeline(),this.taskFields.dependency&&this.ganttChartModule.reRenderConnectorLines();break;case"timezone":this.dataOperation.checkDataBinding(!0);break;case"enableCriticalPath":je(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.hideSpinner():this.hideMaskRow(),this.enableCriticalPath&&this.criticalPathModule?(this.criticalPathModule.showCriticalPath(this.enableCriticalPath),(r=this.criticalPathModule).criticalPathCollection&&this.criticalPathModule.criticalConnectorLine(r.criticalPathCollection,r.detailPredecessorCollection,!0,r.predecessorCollectionTaskIds)):this.removeCriticalPathStyles();break;case"filterSettings":je(e.filterSettings)&&(this.filterSettings.columns=[]),this.treeGrid.filterSettings=qP(this.filterSettings),this.treeGrid.dataBind();break;case"gridLines":this.treeGrid.gridLines=this.gridLines,this.treeGrid.dataBind(),this.renderChartGridLines();break;case"tooltipSettings":this.tooltipModule.toolTipObj&&this.tooltipModule.toolTipObj.destroy(),this.tooltipModule.createTooltip();break;case"splitterSettings":this.splitterModule.updateSplitterPosition();break;case"selectionSettings":this.treeGrid.selectionSettings=qP(this.selectionSettings),this.treeGrid.grid.selectionSettings.enableToggle=this.selectionSettings.enableToggle,this.treeGrid.dataBind();break;case"searchSettings":void 0!==e.searchSettings.key&&(this.treeGrid.grid.searchSettings=qP(this.searchSettings),this.treeGrid.grid.dataBind()),this.treeGrid.searchSettings=qP(this.searchSettings),this.treeGrid.dataBind(),this.toolbarModule&&this.toolbarModule.updateSearchTextBox();break;case"labelSettings":case"renderBaseline":case"baselineColor":this.isFromRenderBaseline=!0,this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isFromRenderBaseline=!1;break;case"resourceIDMapping":case"resourceNameMapping":case"resources":this.dataOperation.reUpdateResources(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows();break;case"includeWeekend":case"allowUnscheduledTasks":case"holidays":this.isLoad=!0,"holidays"===s&&(this.totalHolidayDates=this.dataOperation.getHolidayDates(),this.notify("ui-update",{module:"day-markers",properties:e})),this.dataOperation.reUpdateGanttData(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isLoad=!1,this.taskFields.dependency&&(this.predecessorModule.updatedRecordsDateByPredecessor(),this.treeGrid.refreshColumns(),this.chartRowsModule.refreshGanttRows());break;case"dayWorkingTime":case"weekWorkingTime":i=!0;break;case"addDialogFields":case"editDialogFields":this.editModule&&this.editModule.dialogModule&&this.editModule.dialogModule.processDialogFields();break;case"columns":this.treeGridModule.treeGridColumns=[],this.treeGridModule.validateGanttColumns(),this.treeGrid.columns=this.treeGridModule.treeGridColumns,this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.timelineModule.updateChartByNewTimeline();break;case"width":case"height":this.reUpdateDimention(s);break;case"editSettings":this.treeGrid.editSettings.allowAdding=this.editSettings.allowAdding,this.treeGrid.editSettings.allowDeleting=this.editSettings.allowDeleting,this.treeGrid.editSettings.showDeleteConfirmDialog=this.editSettings.showDeleteConfirmDialog,this.treeGrid.editSettings.allowEditing=this.editSettings.allowEditing,this.treeGrid.editSettings.allowNextRowEdit=this.editSettings.allowNextRowEdit,je(this.editModule)||this.editModule.reUpdateEditModules(),je(this.toolbarModule)||this.toolbarModule.refreshToolbarItems();break;case"connectorLineBackground":case"connectorLineWidth":this.taskFields.dependency&&(this.connectorLineModule.initPublicProp(),this.ganttChartModule.reRenderConnectorLines());break;case"treeColumnIndex":this.treeGrid.treeColumnIndex=this.treeColumnIndex;break;case"projectStartDate":case"projectEndDate":this.timelineModule.isZoomToFit=!1,this.dataOperation.calculateProjectDates(),this.updateProjectDates(this.cloneProjectStartDate,this.cloneProjectEndDate,this.isTimelineRoundOff);break;case"selectedRowIndex":je(this.selectionModule)||this.selectionModule.selectRowByIndex();break;case"dataSource":this.isLoad=!0,this.isReact&&this.clearTemplate(["TaskbarTemplate","ParentTaskbarTemplate","MilestoneTemplate","TaskLabelTemplate","RightLabelTemplate","LeftLabelTemplate"]),this.closeGanttActions(),this.dataSource instanceof Object&&sqt(this)?(this.treeGrid.hasChildMapping="isParent",r=R("count",this.dataSource),this.treeGrid.dataSource={result:this.flatData,count:r}):this.treeGrid.hasChildMapping=null,this.dataOperation.checkDataBinding(!0),this.isLoad=!1;break;case"enableContextMenu":case"contextMenuItems":this.enableContextMenu||"contextMenuItems"===s?this.notify("reRender-contextMenu",{module:"contextMenu",enable:!0}):this.treeGrid.contextMenuItems=[],this.treeGrid.dataBind();break;case"currencyCode":case"locale":case"enableRtl":case"readOnly":case"viewType":case"taskFields":case"allowTaskbarDragAndDrop":case"allowTaskbarOverlap":case"allowParentDependency":case"enableMultiTaskbar":if("locale"===s&&(this.isLocaleChanged=!0),"taskFields"===s&&!je(e.taskFields.child))return;"allowTaskbarDragAndDrop"!==s&&(i=!0);break;case"validateManualTasksOnLinking":this.validateManualTasksOnLinking=e.validateManualTasksOnLinking;break;case"showOverAllocation":this.updateOverAllocationCotainer()}}i&&(this.isLoad&&this.contentMaskTable&&(this.contentMaskTable=null),this.refresh())},vXt.prototype.updateOverAllocationCotainer=function(){var e;this.showOverAllocation?this.ganttChartModule.renderOverAllocationContainer():(e=this.element.querySelector("."+NGt))&&(e.innerHTML="")},vXt.prototype.getPersistData=function(){for(var e=["sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex","currentZoomingLevel","cloneProjectStartDate","cloneProjectEndDate","splitterSettings"],t={filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[]},i=0;i<e.length;i++)for(var n=this[e[i]],o=0,r=t[e[i]];!je(r)&&o<r.length;o++)delete n[r[o]];return this.ignoreInArrays(["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],this.columns),this.addOnPersist(e)},vXt.prototype.ignoreInArrays=function(e,t){for(var i=0;i<t.length;i++)this.ignoreInColumn(e,t[i])},vXt.prototype.ignoreInColumn=function(e,t){for(var i=0;i<e.length;i++)delete t[e[i]],t.filter={}},vXt.prototype.destroy=function(){this.notify("destroy",{}),this.unwireEvents(),je(this.validationDialogElement)||this.validationDialogElement.isDestroyed||this.validationDialogElement.destroy();for(var e=["ganttChartModule","timelineModule","chartRowsModule","treeGridModule","ganttDataUpdatesModule","dateValidationModule","tooltipModule"],t=0;t<e.length;t++)this[e[t]]&&(this[e[t]]=null);this.keyboardModule&&this.keyboardModule.destroy(),this.editModule&&this.editModule.dialogModule&&this.editModule.dialogModule.destroy(),this.splitterModule&&this.splitterModule.destroy(),this.toolbarModule&&this.toolbarModule.toolbar&&this.toolbarModule.toolbar.destroy(),je(this.dayMarkersModule)||(je(this.dayMarkersModule.eventMarkerRender)||je(this.dayMarkersModule.eventMarkerRender.eventMarkersContainer)||(this.dayMarkersModule.eventMarkerRender.eventMarkersContainer=null),je(this.dayMarkersModule.nonworkingDayRender))||(je(this.dayMarkersModule.nonworkingDayRender.nonworkingContainer)||(this.dayMarkersModule.nonworkingDayRender.nonworkingContainer=null),je(this.dayMarkersModule.nonworkingDayRender.weekendContainer)||(this.dayMarkersModule.nonworkingDayRender.weekendContainer=null),je(this.dayMarkersModule.nonworkingDayRender.holidayContainer))||(this.dayMarkersModule.nonworkingDayRender.holidayContainer=null),this.connectorLineModule&&(this.connectorLineModule.dependencyViewContainer=null,this.connectorLineModule.svgObject=null,this.connectorLineModule.renderer=null,this.connectorLineModule.tooltipTable=null),this.treeGridPane=null,this.chartPane=null,this.initialChartRowElements=null,fXt.prototype.destroy.call(this),this.chartVerticalLineContainer=null,this.element.innerHTML="",q([this.element],"e-gantt"),this.element.innerHTML="",this.isTreeGridRendered=!1,this.resetTemplates(),this.dataOperation.uid=null},vXt.prototype.getTaskbarHeight=function(){return this.chartRowsModule.taskBarHeight},vXt.prototype.requiredModules=function(){var e=[];return this.isDestroyed||(this.allowSorting&&e.push({member:"sort",args:[this]}),(this.allowFiltering||this.toolbar&&-1!==this.toolbar.indexOf("Search"))&&e.push({member:"filter",args:[this]}),this.allowReordering&&e.push({member:"reorder",args:[this]}),this.allowExcelExport&&e.push({member:"excelExport",args:[this]}),(this.allowRowDragAndDrop||this.allowTaskbarDragAndDrop)&&e.push({member:"rowDragAndDrop",args:[this]}),this.enableCriticalPath&&e.push({member:"criticalPath",args:[this]}),this.enableUndoRedo&&e.push({member:"undoRedo",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),this.toolbar&&0<this.toolbar.length&&e.push({member:"toolbar",args:[this]}),(this.editSettings.allowAdding||this.editSettings.allowEditing||this.editSettings.allowDeleting||this.editSettings.allowTaskbarEditing||this.allowRowDragAndDrop)&&e.push({member:"edit",args:[this]}),this.allowSelection&&e.push({member:"selection",args:[this]}),this.tooltipSettings.showTooltip&&e.push({member:"tooltip",args:[this]}),(this.highlightWeekends||this.holidays&&0<this.holidays.length||this.eventMarkers&&0<this.eventMarkers.length)&&e.push({member:"dayMarkers",args:[this]}),this.enableContextMenu&&e.push({member:"contextMenu",args:[this]}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this]}),this.allowPdfExport&&e.push({member:"pdfExport",args:[this]}),this.enableVirtualization&&e.push({member:"virtualScroll",args:[this]})),e},vXt.prototype.sortColumn=function(e,t,i){this.sortModule&&this.allowSorting&&this.sortModule.sortColumn(e,t,i)},vXt.prototype.mergePersistGanttData=function(){this.treeGrid||(this.treeGrid=new eee);this.treeGrid.grid.mergePersistGridData.apply(this)},vXt.prototype.mergeColumns=function(e,t){this.treeGrid.grid.mergeColumns.apply(this,[e,t])},vXt.prototype.setFrozenCount=function(){this.treeGrid.grid.setFrozenCount.apply(this)},vXt.prototype.splitFrozenCount=function(e){this.treeGrid.grid.splitFrozenCount.apply(this,[e])},vXt.prototype.isFrozenGrid=function(){return this.treeGrid.grid.isFrozenGrid()},vXt.prototype.clearSorting=function(){this.sortModule.clearSorting()},vXt.prototype.renderChartGridLines=function(){var e="e-chart-row-border",t=this.chartVerticalLineContainer,i=document.getElementById(this.element.id+"GanttTaskTableBody").querySelectorAll("td");if("Vertical"===this.gridLines){if(je(t)?this.renderChartVerticalLines():"none"===window.getComputedStyle(t).display&&(t.style.display="block"),i&&0<i.length&&i[0].classList.contains(e))for(var n=0;n<i.length;n++)q([i[n]],e)}else if("Horizontal"===this.gridLines){if(je(t)||(t.style.display="none"),i&&0<i.length&&!i[0].classList.contains(e))for(n=0;n<i.length;n++)U([i[n]],e)}else if("Both"===this.gridLines){if(je(t)?this.renderChartVerticalLines():"none"===window.getComputedStyle(t).display&&(t.style.display="block"),i&&0<i.length&&!i[0].classList.contains(e))for(n=0;n<i.length;n++)U([i[n]],e)}else if("None"===this.gridLines&&(je(t)||"none"===window.getComputedStyle(t).display||(t.style.display="none"),i)&&0<i.length&&i[0].classList.contains(e))for(n=0;n<i.length;n++)q([i[n]],e)},vXt.prototype.updateGridLineContainerHeight=function(){this.chartVerticalLineContainer&&(this.chartVerticalLineContainer.style.height=T(this.getContentHeight()))},vXt.prototype.getContentHeight=function(){var e=this.ganttChartModule.scrollElement.offsetHeight-16,t=this.ganttChartModule.chartBodyContent.offsetHeight;return t<e?t:e},vXt.prototype.reUpdateDimention=function(e){var t,i,n,o=0;this.calculateDimensions(),je(this.toolbarModule)||je(this.toolbarModule.element)||(this.toolbarModule.toolbar.refresh(),this.toolbarModule.refreshToolbarItems(),o=this.toolbarModule.element.offsetHeight),this.treeGrid.height=this.ganttHeight-o-this.treeGrid.grid.getHeaderContent().offsetHeight,this.splitterModule.splitterObject.height=(this.ganttHeight-o).toString(),je(this.chartVerticalLineContainer)||(this.chartVerticalLineContainer.style.height=this.ganttHeight+"px"),je(this.dayMarkersModule)||(t=R("nonworkingDayRender.holidayContainer",this.dayMarkersModule),i=R("nonworkingDayRender.weekendContainer",this.dayMarkersModule),n=R("eventMarkerRender.eventMarkersContainer",this.dayMarkersModule),t&&(t.style.height=this.ganttHeight+"px"),i&&(i.style.height=this.ganttHeight+"px"),n&&(n.style.height=this.ganttHeight+"px")),"width"===e&&(this.splitterModule.splitterObject.width=this.ganttWidth.toString()),this.ganttChartModule.scrollObject.setHeight(this.ganttHeight-this.ganttChartModule.chartTimelineContainer.offsetHeight-o)},vXt.prototype.renderChartVerticalLines=function(){this.element.contains(this.chartVerticalLineContainer)||(this.chartVerticalLineContainer=Q("div",{id:this.element.id+"line-container",styles:"position:absolute;height:100%;"}),this.ganttChartModule.chartBodyContent.insertBefore(this.chartVerticalLineContainer,this.ganttChartModule.chartBodyContent.lastChild)),this.chartVerticalLineContainer.innerHTML="";for(var e=this.element.getElementsByClassName("e-timeline-header-table-container")[1],t=(e=je(e)?this.element.getElementsByClassName("e-timeline-header-table-container")[0]:e).getElementsByTagName("th"),i=t.length,n=0,o=Q("div"),r=0;r<i;r++){var n=0===r?-1:n+parseFloat(s),s=t[r].style.width,a=Q("div",{className:"e-line-container-cell",styles:(this.enableRtl?"right:"+(n+1):"left:"+(-1!==n?n+.3:n))+"px"});o.appendChild(a)}for(;o.firstChild;)this.chartVerticalLineContainer.appendChild(o.firstChild)},vXt.prototype.getDefaultLocale=function(){return{emptyRecord:"No records to display",id:"ID",name:"Name",startDate:"Start Date",endDate:"End Date",duration:"Duration",progress:"Progress",dependency:"Dependency",notes:"Notes",criticalPath:"Critical Path",undo:"Undo",redo:"Redo",baselineStartDate:"Baseline Start Date",baselineEndDate:"Baseline End Date",taskMode:"Task Mode",changeScheduleMode:"Change Schedule Mode",subTasksStartDate:"SubTasks Start Date",subTasksEndDate:"SubTasks End Date",scheduleStartDate:"Schedule Start Date",scheduleEndDate:"Schedule End Date",auto:"Auto",manual:"Manual",type:"Type",offset:"Offset",resourceName:"Resources",resourceID:"Resource ID",day:"day",hour:"hour",minute:"minute",days:"days",hours:"hours",minutes:"minutes",generalTab:"General",customTab:"Custom Columns",writeNotes:"Write Notes",addDialogTitle:"New Task",editDialogTitle:"Task Information",add:"Add",edit:"Edit",update:"Update",delete:"Delete",cancel:"Cancel",search:"Search",task:" task",tasks:" tasks",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomToFit:"Zoom to fit",excelExport:"Excel export",csvExport:"CSV export",pdfExport:"PDF export",expandAll:"Expand all",collapseAll:"Collapse all",nextTimeSpan:"Next timespan",prevTimeSpan:"Previous timespan",saveButton:"Save",taskBeforePredecessorFS:'You moved "{0}" to start before "{1}" finishes and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorFS:'You moved "{0}" away from "{1}" and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskBeforePredecessorSS:'You moved "{0}" to start before "{1}" starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorSS:'You moved "{0}" to start after "{1}" starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskBeforePredecessorFF:'You moved "{0}" to finish before "{1}" finishes and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorFF:'You moved "{0}" to finish after "{1}" finishes and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskBeforePredecessorSF:'You moved "{0}" away from "{1}" to starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorSF:'You moved "{0}" to finish after "{1}" starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',okText:"Ok",confirmDelete:"Are you sure you want to Delete Record?",from:"From",to:"To",taskLink:"Task Link",lag:"Lag",start:"Start",finish:"Finish",enterValue:"Enter the value",taskInformation:"Task Information",deleteTask:"Delete Task",deleteDependency:"Delete Dependency",convert:"Convert",save:"Save",above:"Above",below:"Below",child:"Child",milestone:"Milestone",toTask:"To Task",toMilestone:"To Milestone",eventMarkers:"Event markers",leftTaskLabel:"Left task label",rightTaskLabel:"Right task label",timelineCell:"Timeline cell",confirmPredecessorDelete:"Are you sure you want to remove dependency link?",unit:"Unit",work:"Work",taskType:"Task Type",unassignedTask:"Unassigned Task",group:"Group",indent:"Indent",outdent:"Outdent",segments:"Segments",splitTask:"Split Task",mergeTask:"Merge Task",left:"Left",right:"Right",FF:"FF",FS:"FS",SF:"SF",SS:"SS"}},vXt.prototype.removeSortColumn=function(e){this.sortModule.removeSortColumn(e)},vXt.prototype.actionBeginTask=function(e){this.trigger("actionBegin",e),je(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.showSpinner():this.showMaskRow()},vXt.prototype.scrollToDate=function(e){e=this.dateValidationModule.getDateFromFormat(e),e=this.dataOperation.getTaskLeft(e,!1);this.ganttChartModule.updateScrollLeft(e)},vXt.prototype.scrollToTask=function(e){-1!==this.ids.indexOf(e)&&(e=this.flatData[this.ids.indexOf(e)].ganttProperties.left,this.ganttChartModule.updateScrollLeft(e))},vXt.prototype.updateChartScrollOffset=function(e,t){je(e)||(e=this.ganttChartModule.scrollElement.scrollWidth<=e?this.ganttChartModule.scrollElement.scrollWidth:e,this.ganttChartModule.scrollObject.setScrollLeft(e,this.enableRtl?-1:0)),je(t)||(t=this.ganttChartModule.scrollElement.scrollHeight<=t?this.ganttChartModule.scrollElement.scrollHeight:t,this.ganttChartModule.scrollObject.setScrollTop(t))},vXt.prototype.getParentTask=function(t){if(!je(t))if(!this.autoCalculateDateScheduling&&this.dataMap&&0<this.dataMap.size&&!this.taskFields.hasChildMapping&&this.isLoad){var e=this.dataMap.get(t.uniqueID);if(e)return e}else{e=this.flatData.find(function(e){return t.uniqueID===e.uniqueID});if(e)return e}return null},vXt.prototype.getRootParent=function(e,t){return e.level===t?e:this.getRootParent(this.getParentTask(e.parentItem),t)},vXt.prototype.filterByColumn=function(e,t,i,n,o,r){this.treeGrid.filterByColumn(e,t,i,n,o,r)},vXt.prototype.excelExport=function(e,t,i,n){return this.excelExportModule?this.treeGrid.excelExport(e,t,i,n):null},vXt.prototype.csvExport=function(e,t,i,n){return this.excelExportModule?this.treeGrid.csvExport(e,t,i,n):null},vXt.prototype.pdfExport=function(e,t,i,n){return this.pdfExportModule?this.pdfExportModule.export(e,t,i,n):null},vXt.prototype.clearFiltering=function(e){this.treeGrid.grid.clearFiltering(e)},vXt.prototype.removeFilteredColsByField=function(e){this.treeGrid.removeFilteredColsByField(e,!1)},vXt.prototype.renderWorkingDayCell=function(e){var t=!1,i=!1,t="Auto"!==this.taskMode&&"Custom"!==this.taskMode||!(!this.includeWeekend&&this.autoCalculateDateScheduling),n=("Custom"===this.taskMode&&this.taskFields.manual&&((n=this.editModule)&&n.cellEditModule&&n.cellEditModule.isCellEdit?i=n.cellEditModule.currentEditedRowData[this.taskFields.manual]:n&&n.dialogModule&&n.dialogModule.isEdit&&(i=n.dialogModule.editedRecord[this.taskFields.manual]),t=i||this.includeWeekend||!this.autoCalculateDateScheduling),t?[]:this.nonWorkingDayIndex),i=this.totalHolidayDates;0<n.length&&-1!==n.indexOf(e.date.getDay())?e.isDisabled=!0:0<i.length&&((t=new Date(e.date.getTime())).setHours(0,0,0),-1!==i.indexOf(t.getTime()))&&(!this.autoCalculateDateScheduling||this.isLoad&&!this.treeGrid.loadChildOnDemand&&this.taskFields.hasChildMapping?e.isDisabled=!1:e.isDisabled=!0)},vXt.prototype.previousTimeSpan=function(e){var t;this.isReact&&this.clearTemplate(["TaskbarTemplate","ParentTaskbarTemplate","MilestoneTemplate","TaskLabelTemplate","RightLabelTemplate","LeftLabelTemplate"]),this.undoRedoModule&&this.isUndoRedoItemPresent("PreviousTimeSpan")&&(this.undoRedoModule.redoEnabled&&this.undoRedoModule.disableRedo(),this.undoRedoModule.createUndoCollection(),(t={action:"PreviousTimeSpan"}).previousTimelineStartDate=Pe([],[],[this.timelineModule.timelineStartDate],!0)[0],t.previousTimelineEndDate=Pe([],[],[this.timelineModule.timelineEndDate],!0)[0],this.undoRedoModule.getUndoCollection[this.undoRedoModule.getUndoCollection.length-1]=t),this.timelineModule.performTimeSpanAction("prevTimeSpan","publicMethod",new Date(this.timelineModule.timelineStartDate.getTime()),new Date(this.timelineModule.timelineEndDate.getTime()),e)},vXt.prototype.nextTimeSpan=function(e){var t;this.isReact&&this.clearTemplate(["TaskbarTemplate","ParentTaskbarTemplate","MilestoneTemplate","TaskLabelTemplate","RightLabelTemplate","LeftLabelTemplate"]),this.undoRedoModule&&this.isUndoRedoItemPresent("NextTimeSpan")&&(this.undoRedoModule.redoEnabled&&this.undoRedoModule.disableRedo(),this.undoRedoModule.createUndoCollection(),(t={action:"NextTimeSpan"}).previousTimelineStartDate=Pe([],[],[this.timelineModule.timelineStartDate],!0)[0],t.previousTimelineEndDate=Pe([],[],[this.timelineModule.timelineEndDate],!0)[0],this.undoRedoModule.getUndoCollection[this.undoRedoModule.getUndoCollection.length-1]=t),this.timelineModule.performTimeSpanAction("nextTimeSpan","publicMethod",new Date(this.timelineModule.timelineStartDate.getTime()),new Date(this.timelineModule.timelineEndDate.getTime()),e)},vXt.prototype.updateProjectDates=function(e,t,i,n){this.timelineModule.totalTimelineWidth=0,this.cloneProjectStartDate=e,this.cloneProjectEndDate=t,this.isTimelineRoundOff=i,this.timelineModule.refreshTimelineByTimeSpan(),this.dataOperation.reUpdateGanttDataPosition(),(!this.pdfExportModule||this.pdfExportModule&&!this.pdfExportModule.isPdfExport||this.pdfExportModule&&this.pdfExportModule.isPdfExport&&this.pdfExportModule.helper.exportProps&&this.pdfExportModule.helper.exportProps.fitToWidthSettings&&!this.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)&&(this.timelineModule.updateChartByNewTimeline(),e=window.outerWidth/window.innerWidth,this.timelineModule.isZoomToFit&&!this.enableTimelineVirtualization&&e<1?(t=void 0,t=this.enableVirtualization?Math.abs(this.timelineModule.totalTimelineWidth-this.element.getElementsByClassName("e-chart-scroll-container e-content")[0].clientWidth)+1:Math.abs(this.timelineModule.totalTimelineWidth-this.ganttChartModule.chartBodyContent.parentElement.clientWidth),this.ganttChartModule.chartBodyContent.style.width=T(this.timelineModule.totalTimelineWidth-t)):this.ganttChartModule.chartBodyContent.style.width=T(this.timelineModule.totalTimelineWidth),this.ganttChartModule.updateLastRowBottomWidth(),this.taskFields.dependency&&this.ganttChartModule.reRenderConnectorLines(),"beforeAdd"!==n)&&this.notify("selectRowByIndex",{})},vXt.prototype.splitTask=function(e,t){this.isEdit=!0,this.chartRowsModule.splitTask(e,t)},vXt.prototype.mergeTask=function(e,t){this.chartRowsModule.mergeTask(e,t)},vXt.prototype.reorderColumns=function(e,t){this.treeGrid.reorderColumns(e,t)},vXt.prototype.initiateEditAction=function(e){this.isOnEdit=e,this.previousRecords={},this.editedRecords=[]},vXt.prototype.setRecordValue=function(e,t,i,n){var o,r;t=ee(t)?null:t,!(!this.isOnEdit&&!this.isOnDelete)&&(this.makeCloneData(e,i,n),r=(n=n?i:i.ganttProperties).rowUniqueID,o=this.getRecordByID(r),r=!1,r=!(!je(t)&&(je(t)||je(i[""+e])||(t instanceof Date?t.getTime()===i[""+e].getTime():i[""+e]===t))),o)&&(-1===this.editedRecords.indexOf(o)&&r||0===this.editedRecords.length)&&(this.editModule.draggedRecord&&this.editModule.draggedRecord.ganttProperties.taskId===n.taskId?this.editedRecords.splice(0,0,o):this.editedRecords.push(o),this.undoRedoModule&&(-1===this.undoRedoModule.changedRecords.indexOf(o)&&this.undoRedoModule.changedRecords.push(Pe({},{},o,!0)),r=0<this.undoRedoModule.getUndoCollection.length?this.undoRedoModule.getUndoCollection[this.undoRedoModule.getUndoCollection.length-1].action:null,!this.editModule||!this.editSettings.allowEditing||this.undoRedoModule.isUndoRedoPerformed||this.isOnDelete||this.isOnAdded||"outdent"===r||"indent"===r||"RowDragAndDrop"===r||"TaskbarDragAndDrop"===r||(n=this.previousFlatData.filter(function(e){return e.ganttProperties.taskId===o.ganttProperties.taskId})[0])&&this.undoRedoModule.getUndoCollection[this.undoRedoModule.getUndoCollection.length-1]&&this.undoRedoModule.getUndoCollection[this.undoRedoModule.getUndoCollection.length-1].modifiedRecords&&this.undoRedoModule.getUndoCollection[this.undoRedoModule.getUndoCollection.length-1].modifiedRecords.push(n)),this.enableImmutableMode)&&this.modifiedRecords.push(o),x(e,t,i)},vXt.prototype.makeCloneData=function(e,t,i){var n=R(e,t);i&&(e="ganttProperties."+e),je(this.previousRecords[t.uniqueID])&&(this.previousRecords[t.uniqueID]={}),ee(R(e,i=this.previousRecords[t.uniqueID]))&&(ee(t=n instanceof Date?new Date(n.getTime()):B(n)?Pe([],n,[],!0):S(n)?Pe({},{},n,!0):n)?x(e,null,i):x(e,t,i))},vXt.prototype.closeGanttActions=function(){this.editModule&&(this.editModule.cellEditModule&&this.editModule.cellEditModule.isCellEdit?(this.treeGrid.closeEdit(),this.editModule.cellEditModule.isCellEdit=!1,je(this.toolbarModule)||this.toolbarModule.refreshToolbarItems()):this.editModule.dialogModule&&this.editModule.dialogModule.dialogObj&&this.editModule.dialogModule.dialogObj.visible&&(this.editModule.dialogModule.dialogObj.hide(),this.editModule.dialogModule.dialogClose()))},vXt.prototype.getTaskByUniqueID=function(t){var e=this.flatData.filter(function(e){return e.uniqueID===t});return 0<e.length?e[0]:null},vXt.prototype.getRecordByID=function(e){return je(e)?null:this.flatData[this.ids.indexOf(e.toString())]},vXt.prototype.setSplitterPosition=function(e,t){var i={},e=(i[t]=e,this.splitterModule.calculateSplitterPosition(i));switch(t){case"view":this.splitterSettings.view=i[t];break;case"columnIndex":this.splitterModule.isSplitterResized=!0,this.splitterSettings.columnIndex=i[t];break;case"position":this.splitterModule.isSplitterResized=!0,this.splitterSettings.position=i[t]}var n=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[0],o=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[1];this.splitterModule.splitterPreviousPositionGrid=n.scrollWidth+1+"px",this.splitterModule.splitterPreviousPositionChart=o.scrollWidth+1+"px",this.splitterModule.splitterObject.paneSettings[0].size=e,this.splitterModule.splitterObject.paneSettings[1].size=parseFloat("99.75%")-parseFloat(e)+"%",this.splitterModule.triggerCustomResizedEvent()},vXt.prototype.expandByIndex=function(e){if("number"==typeof e){var t=this.contructExpandCollapseArgs(null,e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t)}else for(var i,n=0;n<e.length;n++)"number"==typeof e[n]&&(i=e[n],t=this.contructExpandCollapseArgs(null,i),this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t))},vXt.prototype.expandByID=function(e){this.enableVirtualization&&(this.isExpandPerformed=!0);e=this.contructExpandCollapseArgs(e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(e)},vXt.prototype.collapseByIndex=function(e){e=this.contructExpandCollapseArgs(null,e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.collapseGanttRow(e)},vXt.prototype.collapseByID=function(e){e=this.contructExpandCollapseArgs(e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.collapseGanttRow(e)},vXt.prototype.addRecord=function(e,t,i){if(this.editModule&&this.editSettings.allowAdding){if("ResourceView"===this.viewType){this.editModule.addRowPosition=t,this.editModule.addRowIndex=i;var n=void 0,o=(je(e)||(n=this.undoRedoModule&&this.undoRedoModule.isUndoRedoPerformed?e.ganttProperties.resourceInfo:e[this.taskFields.resourceInfo]),void 0),r=void 0;if(!je(n)&&n.length){for(var s,a,l=0;l<n.length&&(o="object"==typeof n[l]?n[l][this.resourceFields.id]:n[0],!(r=this.flatData[this.getTaskIds().indexOf("R"+o)]));l++);r&&(0===r.level||r.childRecords.length)?(s=r.childRecords[i],"ResourceView"===this.viewType&&this.undoRedoModule&&this.undoRedoModule.isUndoRedoPerformed?this.editModule.addRecord(e,t,i):s?"Child"===(a="Above"===t||"Below"===t?t:"Child")?this.editModule.addRecord(e,a,this.getTaskIds().indexOf("R"+o)):this.editModule.addRecord(e,a,this.flatData.indexOf(s)):this.editModule.addRecord(e,"Child",this.getTaskIds().indexOf("R"+o))):this.editModule.addRecord(e,"Bottom")}else this.undoRedoModule&&this.undoRedoModule.isUndoRedoPerformed?this.editModule.addRecord(e,t,i):this.editModule.addRecord(e,"Bottom");this.editModule.addRowPosition=null,this.editModule.addRowIndex=null}else this.editModule.addRecord(e,t,i),"Bottom"===t&&(this.selectedRowIndex=i);"Above"!==t&&"Below"!==t&&"Child"!==t||(this.currentSelection=je(e)?this.currentSelection:e)}},vXt.prototype.updateRecordByID=function(e){this.editModule&&this.editSettings.allowEditing&&(this.updateDuration=!0,this.editModule.updateRecordByID(e),this.updateDuration=!1)},vXt.prototype.updateTaskId=function(e,t){this.editModule&&this.editSettings.allowEditing&&this.editModule.updateTaskId(e,t)},vXt.prototype.expandAtLevel=function(e){this.enableVirtualization&&(this.isExpandCollapseLevelMethod=!0),this.ganttChartModule.expandAtLevel(e)},vXt.prototype.indent=function(){this.editModule&&this.editSettings.allowEditing&&this.editModule.indent()},vXt.prototype.outdent=function(){this.editModule&&this.editSettings.allowEditing&&this.editModule.outdent()},vXt.prototype.getUndoActions=function(){return this.undoRedoModule?this.undoRedoModule.getUndoCollection:[]},vXt.prototype.getRedoActions=function(){return this.undoRedoModule?this.undoRedoModule.getRedoCollection:[]},vXt.prototype.clearUndoCollection=function(){this.undoRedoModule&&(this.undoRedoModule.getUndoCollection=[],this.toolbarModule)&&this.toolbarModule.enableItems([this.controlId+"_undo"],!1)},vXt.prototype.clearRedoCollection=function(){this.undoRedoModule&&(this.undoRedoModule.getRedoCollection=[],this.toolbarModule)&&this.toolbarModule.enableItems([this.controlId+"_redo"],!1)},vXt.prototype.undo=function(){this.undoRedoModule&&this.undoRedoModule.undoAction()},vXt.prototype.redo=function(){this.undoRedoModule&&this.undoRedoModule.redoAction()},vXt.prototype.showCriticalPath=function(e){this.criticalPathModule&&(this.criticalPathModule.showCriticalPath(e),e=this.criticalPathModule,this.criticalPathModule.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds))},vXt.prototype.getCriticalTasks=function(){return!je(this.criticalPathModule)&&this.enableCriticalPath?this.criticalPathModule.getCriticalTasks():null},vXt.prototype.zoomIn=function(){this.timelineModule.processZooming(!0)},vXt.prototype.zoomOut=function(){this.timelineModule.processZooming(!1)},vXt.prototype.fitToProject=function(){this.timelineModule.processZoomToFit(),this.ganttChartModule.updateScrollLeft(0)},vXt.prototype.reorderRows=function(e,t,i){this.rowDragAndDropModule.reorderRows(e,t,i)},vXt.prototype.updateRecordByIndex=function(e,t){var i;this.editModule&&this.editSettings.allowEditing&&(i=this.taskFields,e=!(0<this.updatedRecords.length)||je(this.updatedRecords[e])?null:this.updatedRecords[e],je(e)||(t[i.id]=e[i.id],this.editModule.updateRecordByID(t)))},vXt.prototype.addPredecessor=function(e,t){this.connectorLineModule&&(e=this.connectorLineModule.getRecordByID(e.toString()),this.editModule)&&!je(e)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.addPredecessor(e,t)},vXt.prototype.removePredecessor=function(e){this.connectorLineModule&&(e=this.connectorLineModule.getRecordByID(e.toString()),this.editModule)&&!je(e)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.removePredecessor(e)},vXt.prototype.updatePredecessor=function(e,t){this.connectorLineModule&&(e=this.connectorLineModule.getRecordByID(e.toString()),this.editModule)&&!je(e)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.updatePredecessor(e,t)},vXt.prototype.openAddDialog=function(){this.editModule&&this.editModule.dialogModule&&this.editSettings.allowAdding&&this.editModule.dialogModule.openAddDialog()},vXt.prototype.openEditDialog=function(e){this.editModule&&this.editModule.dialogModule&&this.editSettings.allowEditing&&this.editModule.dialogModule.openEditDialog(e)},vXt.prototype.contructExpandCollapseArgs=function(e,t){je(t)&&e?(o=this.getRecordByID(e.toString()),je(i=this.getRowByID(e))||(n=R("rowIndex",i))):je(t)||(i=this.getRowByIndex(t),n=(e=this.focusModule.isFromKeyboardAction)?R("rowIndex",i):t,o=(e?this.currentViewData:this.flatData)[n]);var i,n,o,t=this.treeGrid.getRows()[n];return{data:o,gridRow:t,chartRow:i,cancel:!1}},vXt.prototype.getRowByIndex=function(e){try{var t=this.element.querySelectorAll(".e-chart-row");return je(e)?null:t[e]}catch(e){return null}},vXt.prototype.getRowByID=function(e){var t=this,e=this.getRecordByID(e.toString()),e=this.loadChildOnDemand&&this.taskFields.hasChildMapping?this.updatedRecords.map(function(e){return e[t.taskFields.id]}).indexOf(e.ganttProperties.taskId):(this.enableVirtualization?this.currentViewData:this.updatedRecords).indexOf(e);return-1!==e?this.getRowByIndex(e):null},vXt.prototype.getUnscheduledTaskClass=function(e){return je(e.startDate)&&je(e.endDate)&&je(e.duration)||je(e.startDate)||je(e.endDate)||je(e.duration)?" "+hGt:""},vXt.prototype.isUnscheduledTask=function(e){return!!(je(e.startDate)||je(e.endDate)||je(e.duration))},vXt.prototype.createGanttPopUpElement=function(){var e=this.createElement("div",{className:"e-ganttpopup",styles:"display:none;"}),t=this.createElement("div",{className:"e-content",attrs:{tabIndex:"-1"}});ht([t,this.createElement("div",{className:"e-uptail e-tail"})],e),t.appendChild(this.createElement("span")),ht([t,this.createElement("div",{className:"e-downtail e-tail"})],e),document.getElementById(this.element.id+"GanttChart").appendChild(e)},vXt.prototype.getPredecessorTextValue=function(e){var t;switch(e){case"SS":t=this.localeObj.getConstant("start")+"-"+this.localeObj.getConstant("start");break;case"FF":t=this.localeObj.getConstant("finish")+"-"+this.localeObj.getConstant("finish");break;case"SF":t=this.localeObj.getConstant("start")+"-"+this.localeObj.getConstant("finish");break;case"FS":t=this.localeObj.getConstant("finish")+"-"+this.localeObj.getConstant("start")}return t},vXt.prototype.search=function(e){this.filterModule&&(this.searchSettings.key=e,this.dataBind())},vXt.prototype.getOffsetRect=function(e){var e=e.getBoundingClientRect(),t=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,i=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,n=document.documentElement.clientTop||document.body.clientTop||0,o=document.documentElement.clientLeft||document.body.clientLeft||0,t=e.top+t-n,n=this.enableRtl?e.right+i-o:e.left+i-o;return{top:Math.round(t),left:Math.round(n),width:e.width,height:e.height}},vXt.prototype.expandAll=function(){this.ganttChartModule.expandCollapseAll("expand")},vXt.prototype.updateDataSource=function(e,t){if(this.isDynamicData=!0,!je(t))for(var i=0,n=Object.keys(t);i<n.length;i++){var o=n[i];switch(o){case"projectStartDate":this.setProperties({projectStartDate:t[o]},!0);break;case"projectEndDate":this.setProperties({projectEndDate:t[o]},!0)}}this.dataSource=e},vXt.prototype.collapseAll=function(){this.ganttChartModule.expandCollapseAll("collapse")},vXt.prototype.getGridColumns=function(){return this.treeGrid.getColumns()},vXt.prototype.getColumnByField=function(t,e){e=e.filter(function(e){return e.field===t});return 0<e.length?e[0]:null},vXt.prototype.getGanttColumns=function(){return this.ganttColumns},vXt.prototype.showColumn=function(e,t){this.treeGrid.showColumns(e,t),this.updateTreeColumns()},vXt.prototype.hideColumn=function(e,t){this.treeGrid.hideColumns(e,t),this.updateTreeColumns()},vXt.prototype.setScrollTop=function(e){this.ganttChartModule.scrollObject.setScrollTop(e)},vXt.prototype.cancelEdit=function(){this.isCancelled=!0,this.closeGanttActions()},vXt.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},vXt.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},vXt.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},vXt.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},vXt.prototype.deleteRecord=function(e){this.editModule&&this.editModule.deleteRecord(e)},vXt.prototype.enableItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},vXt.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},vXt.prototype.updateDataArgs=function(e){var t;return Array.isArray(e.data)||((t=[]).push(e.data),x("data",t,e)),e},vXt.prototype.convertToMilestone=function(e){var t,i,e=this.getRecordByID(e);je(e)||((t=Pe({},{},e.taskData,!0))[(i=this.taskFields).startDate]&&this.setRecordValue(i.startDate,e.ganttProperties.startDate,t,!0),je(i.duration)?(t[i.startDate]=new Date(e.ganttProperties.startDate),t[i.endDate]=new Date(e.ganttProperties.endDate)):t[i.duration]=0,je(i.milestone)||!1===t[i.milestone]&&(t[i.milestone]=!0),je(i.progress)||(t[i.progress]=0),!je(i.child)&&t[i.child]&&(t[i.child]=[]),!je(i.parentID)&&t[i.parentID]&&(t[i.parentID]=null),je(i.segments)||(t[i.segments]=null),"FixedWork"===(je(e.ganttProperties.taskType)?this:e.ganttProperties).taskType&&(je(t[i.work])?e.ganttProperties.work=0:t[i.work]=0),!je(this.contextMenuModule)&&this.contextMenuModule.isOpen&&"Milestone"===this.contextMenuModule.item?(je(i.dependency)||(t[i.dependency]=null),i=this.editSettings.newRowPosition,this.addRecord(t,i,this.selectedRowIndex)):e.hasChildRecords||e.ganttProperties.isMilestone||(this.isConvertedMilestone=!0,this.updateRecordByID(t),this.isConvertedMilestone=!1))},vXt.prototype.changeTaskMode=function(e){this.undoRedoModule&&!this.undoRedoModule.isUndoRedoPerformed&&(this.undoRedoModule.redoEnabled&&this.undoRedoModule.disableRedo(),this.undoRedoModule.createUndoCollection(),(t={action:"TaskMode"}).modifiedRecords=Pe([],[e],[],!0),this.undoRedoModule.getUndoCollection[this.undoRedoModule.getUndoCollection.length-1]=t);var t=this.taskFields,e=this.getRecordByID(e[t.id]),i=e.ganttProperties,t=(this.isOnEdit=!0,this.setRecordValue("isAutoSchedule",!i.isAutoSchedule,i,!0),je(this.taskFields.manual)||(this.setRecordValue("taskData."+t.manual,!i.isAutoSchedule,e),this.setRecordValue(t.manual,!i.isAutoSchedule,e)),this.editModule.updateTaskScheduleModes(e),{data:e});this.editModule.initiateUpdateAction(t)},vXt.prototype.getTaskIds=function(){return this.taskIds},vXt.prototype.setTaskIds=function(e){var t;"ProjectView"!==this.viewType&&(t=e.ganttProperties.taskId,t=0===e.level?"R"+t:"T"+t,this.taskIds.push(t))},vXt.prototype.renderTemplates=function(){this.isReact&&this.renderReactTemplates()},vXt.prototype.resetTemplates=function(){this.isReact&&this.clearTemplate()},Cet([e(!0)],vXt.prototype,"allowKeyboard",void 0),Cet([e(!1)],vXt.prototype,"enableImmutableMode",void 0),Cet([e(!0)],vXt.prototype,"allowParentDependency",void 0),Cet([e(!0)],vXt.prototype,"enableHtmlSanitizer",void 0),Cet([e(!0)],vXt.prototype,"disableHtmlEncode",void 0),Cet([t({},X$e)],vXt.prototype,"loadingIndicator",void 0),Cet([e(!0)],vXt.prototype,"enableVirtualMaskRow",void 0),Cet([e(!0)],vXt.prototype,"loadChildOnDemand",void 0),Cet([e(!0)],vXt.prototype,"updateOffsetOnTaskbarEdit",void 0),Cet([e(!0)],vXt.prototype,"UpdateOffsetOnTaskbarEdit",void 0),Cet([e(!0)],vXt.prototype,"autoCalculateDateScheduling",void 0),Cet([e(!0)],vXt.prototype,"autoFocusTasks",void 0),Cet([e(!1)],vXt.prototype,"enableAdaptiveUI",void 0),Cet([e(!0)],vXt.prototype,"allowSelection",void 0),Cet([e(!1)],vXt.prototype,"allowSorting",void 0),Cet([e(!0)],vXt.prototype,"enablePredecessorValidation",void 0),Cet([e(!1)],vXt.prototype,"showColumnMenu",void 0),Cet([e()],vXt.prototype,"columnMenuItems",void 0),Cet([e(["Sorting","Add","ColumnReorder","ColumnResize","ColumnState","Delete","Edit","Filtering","Indent","Outdent","NextTimeSpan","PreviousTimeSpan","RowDragAndDrop","TaskbarDragAndDrop","Search","ZoomIn","ZoomOut","ZoomToFit"])],vXt.prototype,"undoRedoActions",void 0),Cet([e()],vXt.prototype,"timezone",void 0),Cet([e(!1)],vXt.prototype,"collapseAllParentTasks",void 0),Cet([e(!1)],vXt.prototype,"highlightWeekends",void 0),Cet([e(0)],vXt.prototype,"treeColumnIndex",void 0),Cet([e([])],vXt.prototype,"dataSource",void 0),Cet([e("day")],vXt.prototype,"durationUnit",void 0),Cet([e(null)],vXt.prototype,"query",void 0),Cet([e(null)],vXt.prototype,"dateFormat",void 0),Cet([e("auto")],vXt.prototype,"height",void 0),Cet([e(!1)],vXt.prototype,"renderBaseline",void 0),Cet([e(!1)],vXt.prototype,"allowTaskbarDragAndDrop",void 0),Cet([e(!0)],vXt.prototype,"allowTaskbarOverlap",void 0),Cet([e("Horizontal")],vXt.prototype,"gridLines",void 0),Cet([t({},Jj)],vXt.prototype,"labelSettings",void 0),Cet([e(null)],vXt.prototype,"taskbarTemplate",void 0),Cet([e(null)],vXt.prototype,"parentTaskbarTemplate",void 0),Cet([e(null)],vXt.prototype,"timelineTemplate",void 0),Cet([e(null)],vXt.prototype,"milestoneTemplate",void 0),Cet([e()],vXt.prototype,"baselineColor",void 0),Cet([e("auto")],vXt.prototype,"width",void 0),Cet([e(!1)],vXt.prototype,"enableVirtualization",void 0),Cet([e(!1)],vXt.prototype,"enableTimelineVirtualization",void 0),Cet([e()],vXt.prototype,"toolbar",void 0),Cet([e(["Monday","Tuesday","Wednesday","Thursday","Friday"])],vXt.prototype,"workWeek",void 0),Cet([e(!1)],vXt.prototype,"includeWeekend",void 0),Cet([e(!1)],vXt.prototype,"allowUnscheduledTasks",void 0),Cet([e(!1)],vXt.prototype,"showInlineNotes",void 0),Cet([e(36)],vXt.prototype,"rowHeight",void 0),Cet([e(null)],vXt.prototype,"taskbarHeight",void 0),Cet([e(null)],vXt.prototype,"projectStartDate",void 0),Cet([e(null)],vXt.prototype,"projectEndDate",void 0),Cet([e(null)],vXt.prototype,"resourceIDMapping",void 0),Cet([e(null)],vXt.prototype,"resourceNameMapping",void 0),Cet([e([])],vXt.prototype,"resources",void 0),Cet([e([])],vXt.prototype,"segmentData",void 0),Cet([e(null)],vXt.prototype,"connectorLineBackground",void 0),Cet([e(1)],vXt.prototype,"connectorLineWidth",void 0),Cet([e([])],vXt.prototype,"columns",void 0),Cet([e([])],vXt.prototype,"addDialogFields",void 0),Cet([e([])],vXt.prototype,"editDialogFields",void 0),Cet([e(-1)],vXt.prototype,"selectedRowIndex",void 0),Cet([e("hour")],vXt.prototype,"workUnit",void 0),Cet([e("FixedUnit")],vXt.prototype,"taskType",void 0),Cet([e("ProjectView")],vXt.prototype,"viewType",void 0),Cet([kt([{from:8,to:12},{from:13,to:17}],Tg)],vXt.prototype,"dayWorkingTime",void 0),Cet([kt([],Met)],vXt.prototype,"weekWorkingTime",void 0),Cet([kt([],Iz)],vXt.prototype,"holidays",void 0),Cet([kt([],qf)],vXt.prototype,"eventMarkers",void 0),Cet([t({},EW)],vXt.prototype,"taskFields",void 0),Cet([t({},Tft)],vXt.prototype,"resourceFields",void 0),Cet([t({},IQ)],vXt.prototype,"timelineSettings",void 0),Cet([e([])],vXt.prototype,"zoomingLevels",void 0),Cet([t({},Wz)],vXt.prototype,"sortSettings",void 0),Cet([t({},sf)],vXt.prototype,"editSettings",void 0),Cet([t({},b8)],vXt.prototype,"tooltipSettings",void 0),Cet([t({},$$)],vXt.prototype,"selectionSettings",void 0),Cet([e(!1)],vXt.prototype,"allowFiltering",void 0),Cet([e(!1)],vXt.prototype,"allowExcelExport",void 0),Cet([e(!1)],vXt.prototype,"allowRowDragAndDrop",void 0),Cet([e(!1)],vXt.prototype,"allowReordering",void 0),Cet([e(!1)],vXt.prototype,"readOnly",void 0),Cet([e(!1)],vXt.prototype,"allowResizing",void 0),Cet([e(!1)],vXt.prototype,"enableContextMenu",void 0),Cet([e(!1)],vXt.prototype,"enableCriticalPath",void 0),Cet([e(!1)],vXt.prototype,"enableUndoRedo",void 0),Cet([e(10)],vXt.prototype,"undoRedoStepsCount",void 0),Cet([e()],vXt.prototype,"contextMenuItems",void 0),Cet([e(!1)],vXt.prototype,"allowPdfExport",void 0),Cet([e(!1)],vXt.prototype,"validateManualTasksOnLinking",void 0),Cet([e(!1)],vXt.prototype,"enableMultiTaskbar",void 0),Cet([e(!1)],vXt.prototype,"showOverAllocation",void 0),Cet([e("Auto")],vXt.prototype,"taskMode",void 0),Cet([t({},C4)],vXt.prototype,"filterSettings",void 0),Cet([t({},C5)],vXt.prototype,"searchSettings",void 0),Cet([t({},M$)],vXt.prototype,"splitterSettings",void 0),Cet([i()],vXt.prototype,"queryTaskbarInfo",void 0),Cet([i()],vXt.prototype,"beforeExcelExport",void 0),Cet([i()],vXt.prototype,"excelExportComplete",void 0),Cet([i()],vXt.prototype,"excelQueryCellInfo",void 0),Cet([i()],vXt.prototype,"excelHeaderQueryCellInfo",void 0),Cet([i()],vXt.prototype,"rowDrag",void 0),Cet([i()],vXt.prototype,"rowDragStart",void 0),Cet([i()],vXt.prototype,"rowDragStartHelper",void 0),Cet([i()],vXt.prototype,"rowDrop",void 0),Cet([i()],vXt.prototype,"collapsing",void 0),Cet([i()],vXt.prototype,"collapsed",void 0),Cet([i()],vXt.prototype,"expanding",void 0),Cet([i()],vXt.prototype,"expanded",void 0),Cet([i()],vXt.prototype,"actionBegin",void 0),Cet([i()],vXt.prototype,"actionComplete",void 0),Cet([i()],vXt.prototype,"actionFailure",void 0),Cet([i()],vXt.prototype,"dataStateChange",void 0),Cet([i()],vXt.prototype,"taskbarEdited",void 0),Cet([i()],vXt.prototype,"endEdit",void 0),Cet([i()],vXt.prototype,"cellEdit",void 0),Cet([i()],vXt.prototype,"load",void 0),Cet([i()],vXt.prototype,"created",void 0),Cet([i()],vXt.prototype,"destroyed",void 0),Cet([i()],vXt.prototype,"taskbarEditing",void 0),Cet([i()],vXt.prototype,"dataBound",void 0),Cet([i()],vXt.prototype,"resizeStart",void 0),Cet([i()],vXt.prototype,"resizing",void 0),Cet([i()],vXt.prototype,"resizeStop",void 0),Cet([i()],vXt.prototype,"splitterResizeStart",void 0),Cet([i()],vXt.prototype,"splitterResizing",void 0),Cet([i()],vXt.prototype,"splitterResized",void 0),Cet([i()],vXt.prototype,"columnDragStart",void 0),Cet([i()],vXt.prototype,"columnDrag",void 0),Cet([i()],vXt.prototype,"columnDrop",void 0),Cet([i()],vXt.prototype,"beforeTooltipRender",void 0),Cet([i()],vXt.prototype,"rowSelecting",void 0),Cet([i()],vXt.prototype,"rowSelected",void 0),Cet([i()],vXt.prototype,"rowDeselecting",void 0),Cet([i()],vXt.prototype,"rowDeselected",void 0),Cet([i()],vXt.prototype,"cellSelecting",void 0),Cet([i()],vXt.prototype,"cellSelected",void 0),Cet([i()],vXt.prototype,"cellDeselecting",void 0),Cet([i()],vXt.prototype,"cellDeselected",void 0),Cet([i()],vXt.prototype,"queryCellInfo",void 0),Cet([i()],vXt.prototype,"headerCellInfo",void 0),Cet([i()],vXt.prototype,"rowDataBound",void 0),Cet([i()],vXt.prototype,"columnMenuOpen",void 0),Cet([i()],vXt.prototype,"toolbarClick",void 0),Cet([i()],vXt.prototype,"columnMenuClick",void 0),Cet([i()],vXt.prototype,"contextMenuOpen",void 0),Cet([i()],vXt.prototype,"contextMenuClick",void 0),Cet([i()],vXt.prototype,"onTaskbarClick",void 0),Cet([i()],vXt.prototype,"recordDoubleClick",void 0),Cet([i()],vXt.prototype,"onMouseMove",void 0),Cet([i()],vXt.prototype,"beforePdfExport",void 0),Cet([i()],vXt.prototype,"pdfExportComplete",void 0),Cet([i()],vXt.prototype,"pdfQueryCellInfo",void 0),Cet([i()],vXt.prototype,"pdfQueryTaskbarInfo",void 0),Cet([i()],vXt.prototype,"pdfQueryTimelineCellInfo",void 0),Cet([i()],vXt.prototype,"pdfColumnHeaderQueryCellInfo",void 0),Cet([Bt],vXt));function vXt(e,t){e=fXt.call(this,e,t)||this;return e.isRowSelected=!1,e.showIndicator=!0,e.singleTier=0,e.expandedRecords=[],e.isLocaleChanged=!1,e.triggeredColumnName="",e.totalUndoAction=0,e.previousFlatData=[],e.isExpandPerformed=!1,e.oldRecords=[],e.updateDuration=!1,e.isConvertedMilestone=!1,e.isCancelled=!1,e.isCollapseAll=!1,e.previousRecords={},e.editedRecords=[],e.modifiedRecords=[],e.isOnEdit=!1,e.isOnDelete=!1,e.isOnAdded=!1,e.isExpandCollapseLevelMethod=!1,e.isFromEventMarker=!1,e.isDynamicData=!1,e.isConnectorLineUpdate=!1,e.staticSelectedRowIndex=-1,e.needsID=!0,e.showActiveElement=!0,e.addDeleteRecord=!1,e.enableHeaderFocus=!0,e.enableValidation=!0,e.isTreeGridRendered=!1,e.isFromOnPropertyChange=!1,e.isFromRenderBaseline=!1,e.isGanttChartRendered=!1,e.isEdit=!1,e.eventMarkerColloction=[],x("mergePersistData",e.mergePersistGanttData,e),e}(mft=yXt=yXt||{})[mft.NextPage=0]="NextPage",mft[mft.LastPage=1]="LastPage";var bXt="toolbarClick",wXt=(CXt.prototype.bindTreeGridProperties=function(){this.parent.treeGrid.editSettings.allowEditing=this.parent.editSettings.allowEditing,this.parent.treeGrid.editSettings.allowNextRowEdit=this.parent.editSettings.allowNextRowEdit,this.parent.treeGrid.editSettings.mode="Cell",this.parent.treeGrid.cellEdit=this.ensureEditCell.bind(this),this.parent.editSettings.allowEditing&&eee.Inject(Lee)},CXt.prototype.ensureEditCell=function(e){var t,i,n=this,o=e.rowData,r=e.columnName,s=(this.editedColumn=this.parent.getColumnByField(r,this.parent.ganttColumns),this.parent.taskFields);if(!this.parent.readOnly&&"Dialog"!==this.parent.editSettings.mode)return!o.hasChildRecords||this.parent.allowParentDependency||(r!==s.endDate||(je(o[s.manual])||!1!==o[s.manual])&&"Auto"!==this.parent.taskMode)&&r!==s.duration&&r!==s.dependency&&r!==s.progress&&r!==s.work&&r!==s.type&&"taskType"!==r?(t=new ll,i=this.parent,this.currentEditedRowData=e.rowData,this.parent.trigger("cellEdit",e,function(e){e.columnName===i.taskFields.progress&&e.rowData.hasChildRecords&&(e.cancel=!0),0===o.level&&"ResourceView"===n.parent.viewType&&(e.cancel=!0),t.resolve(e),e.cancel||(e.columnName===n.parent.taskFields.notes?n.openNotesEditor(e):(n.isCellEdit=!0,je(n.parent.toolbarModule)||n.parent.toolbarModule.refreshToolbarItems()))}),t):void((r!==s.dependency||this.parent.allowParentDependency)&&r===s.dependency||(e.cancel=!0));e.cancel=!0},CXt.prototype.openNotesEditor=function(e){var t=this.parent.taskFields,i=e.rowData,n=e.columnName;n!==t.notes||this.parent.showInlineNotes||(e.cancel=!0,-1!==(e=this.parent.editModule.dialogModule.updatedEditFields.map(function(e){return e.type}).indexOf("Notes"))&&(this.parent.editModule.dialogModule.openEditDialog(i.ganttProperties.rowUniqueID),document.getElementById(this.parent.element.id+"_Tab").ej2_instances[0].selectedItem=e)),n===t.notes&&!0===this.parent.showInlineNotes&&(this.isCellEdit=!0)},CXt.prototype.initiateCellEdit=function(e,t){var i,n=!0,n=("actionComplete"===e.name&&e.previousData===e.data[e.column.field]&&(n=!1),this.parent.undoRedoModule&&this.parent.isUndoRedoItemPresent("Edit")&&n&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(n={action:"CellEditing"}).editedColumn=e.column.field,n.modifiedRecords=[],this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=n),R("column",e)),o=R("data",e),r={action:"CellEditing"},s=(r.data=this.parent.getTaskByUniqueID(o.uniqueID),R("previousData",e)),a=this.parent.allowUnscheduledTasks||!je(o[n.field])&&""!==o[n.field]||this.parent.taskFields.duration!==n.field&&this.parent.taskFields.startDate!==n.field&&this.parent.taskFields.endDate!==n.field?o[n.field]:s;je(o)?this.parent.editModule.endEditAction(e):(o[n.field]=s,r.data[n.field]=s,this.parent.initiateEditAction(!0),0<this.parent.weekWorkingTime.length&&a&&(n.field===this.parent.taskFields.startDate||n.field===this.parent.taskFields.baselineStartDate)&&(i=n.field===this.parent.taskFields.startDate?o.ganttProperties.startDate:o.ganttProperties.baselineStartDate,this.parent.getStartTime(i)/3600===i.getHours())&&(i=this.parent.getStartTime(a),this.parent.dataOperation.setTime(i,a)),this.parent.setRecordValue(n.field,a,r.data),n.field===this.parent.taskFields.name?this.taskNameEdited(r):n.field===this.parent.taskFields.startDate?this.startDateEdited(r):n.field===this.parent.taskFields.endDate?this.endDateEdited(r,e.previousData):n.field===this.parent.taskFields.duration?this.durationEdited(r):n.field===this.parent.taskFields.resourceInfo?this.resourceEdited(r,t,o):n.field===this.parent.taskFields.progress?this.progressEdited(r):n.field===this.parent.taskFields.baselineStartDate||n.field===this.parent.taskFields.baselineEndDate?this.baselineEdited(r):n.field===this.parent.taskFields.dependency?this.dependencyEdited(r,s):n.field===this.parent.taskFields.notes?this.notedEdited(r):n.field===this.parent.taskFields.work?this.workEdited(r):n.field!==this.parent.taskFields.type&&"taskType"!==n.field||je(this.parent.taskFields.work)?n.field===this.parent.taskFields.manual?this.taskmodeEdited(r):(this.parent.setRecordValue("taskData."+n.field,r.data[n.field],r.data),this.parent.editModule.initiateSaveAction(r)):this.typeEdited(r,t)),this.isCellEdit=!1,je(this.parent.editModule.cellEditModule.editedColumn)||(this.parent.editModule.cellEditModule.editedColumn=null),je(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},CXt.prototype.taskNameEdited=function(e){this.parent.setRecordValue("taskData."+this.parent.taskFields.name,e.data[this.parent.taskFields.name],e.data),this.parent.setRecordValue("taskName",e.data[this.parent.taskFields.name],e.data.ganttProperties,!0),this.updateEditedRecord(e)},CXt.prototype.notedEdited=function(e){this.parent.setRecordValue("taskData."+this.parent.taskFields.notes,e.data[this.parent.taskFields.notes],e.data),this.parent.setRecordValue("notes",e.data[this.parent.taskFields.notes],e.data.ganttProperties,!0),this.updateEditedRecord(e)},CXt.prototype.taskmodeEdited=function(e){this.parent.setRecordValue("isAutoSchedule",!e.data[this.parent.taskFields.manual],e.data.ganttProperties,!0),this.parent.editModule.updateTaskScheduleModes(e.data),this.updateEditedRecord(e)},CXt.prototype.startDateEdited=function(e){var t=e.data,i=e.data.ganttProperties,n=(n=e.data[this.parent.taskFields.startDate])?new Date(n.getTime()):null;je(n=this.parent.dateValidationModule.checkStartDate(n,t.ganttProperties,t.ganttProperties.isMilestone))?t.hasChildRecords||(this.parent.setRecordValue("startDate",null,i,!0),null===i.startDate&&null===i.endDate&&null!==i.duration||this.parent.setRecordValue("duration",null,i,!0),this.parent.setRecordValue("isMilestone",!1,i,!0)):i.endDate||!je(i.duration)?(this.parent.setRecordValue("startDate",new Date(n.getTime()),i,!0),this.parent.dateValidationModule.calculateEndDate(t)):je(i.endDate)&&je(i.duration)&&this.parent.setRecordValue("startDate",new Date(n.getTime()),i,!0),this.parent.setRecordValue("isMilestone",0===i.duration,i,!0),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(t,"startDate"),this.parent.dataOperation.updateMappingData(t,"endDate"),this.parent.dataOperation.updateMappingData(t,"duration"),this.updateEditedRecord(e)},CXt.prototype.validateEndDateWithSegments=function(e){for(var t=[],i=e.segments,n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)],r=o.endDate,r=!je(e.endDate)&&r.getTime()<e.endDate.getTime()&&n!==i.length-1?r:e.endDate;o.duration=this.parent.dataOperation.getDuration(o.startDate,r,e.durationUnit,e.isAutoSchedule,e.isMilestone),0<i.length&&r.getTime()<o.startDate.getTime()&&r.getTime()<=e.endDate.getTime()?i[n-1].duration=this.parent.dataOperation.getDuration(i[n-1].startDate,e.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone):t.push(o)}return t},CXt.prototype.endDateEdited=function(e,t){var i,n=e.data.ganttProperties,o=e.data[this.parent.taskFields.endDate];je(o=o?new Date(o.getTime()):null)?(this.parent.setRecordValue("endDate",o,n,!0),null===n.startDate&&null===n.endDate&&null!==n.duration||this.parent.setRecordValue("duration",null,n,!0),this.parent.setRecordValue("isMilestone",!1,n,!0)):(i=this.parent.getCurrentDayEndTime(o),(0===o.getHours()||t&&o.toTimeString().slice(0,5)===t.toTimeString().slice(0,5))&&86400!==i&&this.parent.dateValidationModule.setTime(i,o),o=this.parent.dateValidationModule.checkEndDate(o,n,n.isMilestone),this.parent.setRecordValue("endDate",o,n,!0),!je(n.startDate)&&je(n.duration)?-1===this.parent.dateValidationModule.compareDates(n.endDate,n.startDate)&&(this.parent.setRecordValue("endDate",new Date(n.startDate.getTime()),n,!0),i=this.parent.getCurrentDayEndTime(n.endDate),this.parent.dateValidationModule.setTime(i,n.endDate)):!je(n.duration)&&je(n.startDate)&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.getStartDate(n.endDate,n.duration,n.durationUnit,n),n,!0),je(n.segments)||(n.segments=this.validateEndDateWithSegments(n)),this.compareDatesFromRecord(n)<=0?this.parent.dateValidationModule.calculateDuration(e.data):this.parent.editModule.revertCellEdit(e),this.updateDates(e),this.parent.setRecordValue("isMilestone",0===n.duration,n,!0),n.isMilestone&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(n.startDate,n),n,!0)),!je(e.data.ganttProperties.segments)&&0<e.data.ganttProperties.segments.length&&(this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(e.data,!1),e.data.ganttProperties,!0),this.parent.dataOperation.updateMappingData(e.data,"segments")),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(e.data,"startDate"),this.parent.dataOperation.updateMappingData(e.data,"endDate"),this.parent.dataOperation.updateMappingData(e.data,"duration"),this.parent.editModule.updateResourceRelatedFields(e.data,"endDate"),this.updateEditedRecord(e)},CXt.prototype.durationEdited=function(e){/^[^\d.-]+$/.test(e.data[this.parent.taskFields.duration])&&(t="The provided value for the "+this.parent.taskFields.duration+" field is invalid. Please ensure the "+this.parent.taskFields.duration+" field contains only valid numeric values.",this.parent.trigger("actionFailure",{error:t})),parseInt(e.data[this.parent.taskFields.duration],10)<0&&(e.data[this.parent.taskFields.duration]=0);var t=e.data.ganttProperties,i=e.data[this.parent.taskFields.duration];this.parent.dataOperation.updateDurationValue(i,t),this.updateDates(e),this.parent.editModule.updateResourceRelatedFields(e.data,"duration"),this.updateEditedRecord(e)},CXt.prototype.updateDates=function(e){var t=e.data.ganttProperties,i=this.parent.dateValidationModule.getDateFromFormat(t.endDate),n=this.parent.dateValidationModule.getDateFromFormat(t.startDate),o=t.duration;je(o)?(this.parent.setRecordValue("isMilestone",!1,t,!0),null!==e.data[this.parent.taskFields.duration]&&this.parent.setRecordValue("endDate",null,t,!0)):(je(n)&&!je(i)&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.getStartDate(i,o,t.durationUnit,t),t,!0),0!==o&&t.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,t,!0),je(this.parent.taskFields.milestone)||this.parent.setRecordValue(this.parent.taskFields.milestone,!1,e.data,!0),this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(t.startDate,t),t,!0)),!je(t.segments)&&0<t.segments.length&&(this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(e.data,!1),t,!0),this.parent.dataOperation.updateMappingData(e.data,"segments")),this.parent.setRecordValue("isMilestone",0===t.duration,t,!0),this.parent.dateValidationModule.calculateEndDate(e.data)),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(e.data,"endDate"),this.parent.dataOperation.updateMappingData(e.data,"startDate"),this.parent.dataOperation.updateMappingData(e.data,"duration")},CXt.prototype.progressEdited=function(e){var t,i=e.data;this.parent.setRecordValue("progress",100<i[this.parent.taskFields.progress]?100:i[this.parent.taskFields.progress],i.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.progress,100<i[this.parent.taskFields.progress]?100:i[this.parent.taskFields.progress],e.data),i.ganttProperties.isAutoSchedule||this.parent.setRecordValue("autoWidth",this.parent.dataOperation.calculateWidth(i,!1),i.ganttProperties,!0),!je(e.data.ganttProperties.segments)&&0<e.data.ganttProperties.segments.length&&!je(this.parent.editModule.taskbarEditModule)&&this.parent.editModule.taskbarEditModule.updateSegmentProgress(e.data.ganttProperties),e.data.hasChildRecords||(t=i.ganttProperties.isAutoSchedule?i.ganttProperties.width:i.ganttProperties.autoWidth,this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t,i.ganttProperties.progress),i.ganttProperties,!0)),this.updateEditedRecord(e)},CXt.prototype.baselineEdited=function(e){var t=e.data.ganttProperties,i=e.data[this.parent.taskFields.baselineStartDate],n=e.data[this.parent.taskFields.baselineEndDate],o=this.parent.getCurrentDayEndTime(n);n&&0===n.getHours()&&86400!==o&&this.parent.dateValidationModule.setTime(o,n),this.parent.setRecordValue("baselineStartDate",this.parent.dateValidationModule.checkBaselineStartDate(i,t),t,!0),this.parent.setRecordValue("baselineEndDate",this.parent.dateValidationModule.checkBaselineEndDate(n),t,!0),t.baselineStartDate&&t.baselineEndDate&&(this.parent.setRecordValue("baselineLeft",this.parent.dataOperation.calculateBaselineLeft(t),t,!0),this.parent.setRecordValue("baselineWidth",this.parent.dataOperation.calculateBaselineWidth(t),t,!0)),this.updateEditedRecord(e)},CXt.prototype.resourceEdited=function(e,t,i){var n=this.parent.resourceFields,o=t[this.parent.taskFields.resourceInfo];if(o){this.isResourceCellEdited=!0;for(var r=this.parent.dataOperation.setResourceInfo(t).length,s=i.ganttProperties.resourceInfo,a=void 0,l=[],h=this.parent.resources,d=void 0,p=0;p<r;p++)!function(t){if(s){var e=s.length;for(d=0;d<e;d++){if(s[d][n.id]===o[t]){a=d;break}a=-1}}var i;je(a)||-1===a?((i=Pe({},h.filter(function(e){return o[t]===e[n.id]})[0]))[n.unit]=100,l.push(i)):l.push(s[parseInt(a.toString(),10)])}(p);e.data.ganttProperties.resourceInfo=l,this.parent.dataOperation.updateMappingData(e.data,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(e.data,"resource"),"ResourceView"===this.parent.viewType&&(this.parent.editModule.dialogModule.isResourceUpdate=!0,this.parent.editModule.dialogModule.previousResource=s),this.updateDates(e),this.updateEditedRecord(e)}},CXt.prototype.dependencyEdited=function(e,t){/[!@#$%^&*()_=[\]{};:<>|./?-]/.test(e.data[this.parent.taskFields.dependency])&&(i="The provided value for the "+this.parent.taskFields.dependency+" field is invalid. Please ensure that the "+this.parent.taskFields.dependency+" field does not contain any special characters.",this.parent.trigger("actionFailure",{error:i})),this.parent.predecessorModule.updateUnscheduledDependency(e.data);var i,n,o=this.parent.localeObj.getConstant("FF"),r=this.parent.localeObj.getConstant("FS"),s=this.parent.localeObj.getConstant("SS"),a=this.parent.localeObj.getConstant("SF"),l="";je(e.data[this.parent.taskFields.dependency])||(n=e.data[this.parent.taskFields.dependency].split(",")).map(function(e,t){l=e.includes(o)?(l+=e.replace(o,"FF"))+(n.length!==t+1?",":""):e.includes(r)?(l+=e.replace(r,"FS"))+(n.length!==t+1?",":""):e.includes(s)?(l+=e.replace(s,"SS"))+(n.length!==t+1?",":""):e.includes(a)?(l+=e.replace(a,"SF"))+(n.length!==t+1?",":""):(l+=e)+(n.length!==t+1?",":"")}),this.parent.connectorLineEditModule.updatePredecessor(e.data,l,e)||this.parent.editModule.revertCellEdit(t)},CXt.prototype.workEdited=function(e){var t=e.data.ganttProperties,i=((e.data[this.parent.taskFields.work]<0||je(e.data[this.parent.taskFields.work]))&&(e.data[this.parent.taskFields.work]=0),this.parent.updateDuration=!0,e.data[this.parent.taskFields.work]);this.parent.setRecordValue("work",i,t,!0),this.parent.editModule.updateResourceRelatedFields(e.data,"work"),this.updateDates(e),this.updateEditedRecord(e),this.parent.updateDuration=!1},CXt.prototype.typeEdited=function(e,t){var i=this.parent.taskFields.type||"taskType",n=e.data.ganttProperties,t=t[""+i];this.parent.setRecordValue("taskType",t,n,!0),"FixedDuration"===n.taskType&&0===n.duration&&this.parent.editModule.updateResourceRelatedFields(e.data,"work"),this.updateEditedRecord(e)},CXt.prototype.compareDatesFromRecord=function(e){var t=this.parent.dateValidationModule.getValidStartDate(e),e=this.parent.dateValidationModule.getValidEndDate(e);return this.parent.dateValidationModule.compareDates(t,e)},CXt.prototype.updateEditedRecord=function(e){this.parent.editModule.initiateUpdateAction(e)},CXt.prototype.destroy=function(){this.parent.editModule.cellEditModule=void 0},CXt);function CXt(e){this.isCellEdit=!1,this.isResourceCellEdited=!1,this.parent=e,this.bindTreeGridProperties()}AXt.prototype.createTooltip=function(e,t,i){var n=this;this.toolTipObj=new NS({opensOn:e,position:"TopRight",enableRtl:this.parent.enableRtl,mouseTrail:t,cssClass:MGt,windowCollision:!0,target:i||null,animation:{open:{effect:"None"},close:{effect:"None"}}}),this.toolTipObj.target=".e-connectorpoint-left, .e-connectorpoint-right",this.toolTipObj.beforeRender=function(e){e={data:n.taskbarEdit.taskBarEditRecord,args:e,content:n.toolTipObj.content};n.parent.trigger("beforeTooltipRender",e)},this.toolTipObj.afterOpen=function(e){n.updateTooltipPosition(e)},this.toolTipObj.isStringTemplate=!0,this.toolTipObj.appendTo(this.parent.chartPane)},AXt.prototype.updateTooltipPosition=function(e){var t,i;e.element.style.visibility="visible",je(this.parent.element.closest('[style*="zoom"]'))&&((t=this.parent.getOffsetRect(this.parent.chartPane).left+this.parent.chartPane.offsetWidth)<(i=e.element.offsetLeft)+e.element.offsetWidth&&(i+=t-(i+e.element.offsetWidth)),e.element.style.left=i+"px",e.element.style.visibility="visible",e.target)&&this.parent.tooltipSettings.editing&&(t=e.target.getBoundingClientRect().top+window.scrollY,i=void 0,i=e.target.classList.contains("e-connectorpoint-left")||e.target.classList.contains("e-connectorpoint-right")?t-e.element.offsetHeight-14:t-e.element.offsetHeight-8,this.toolTipHeight=e.element.style.top=i+"px")},AXt.prototype.showHideTaskbarEditTooltip=function(e,t){e&&this.parent.tooltipSettings.showTooltip?(this.createTooltip("Custom",!1),this.parent.tooltipModule.toolTipObj.close(),this.updateTooltip(t),this.parent.tooltipSettings.editing&&(this.toolTipObj.openDelay=500),"ConnectorPointLeftDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector("."+AGt)):"ConnectorPointRightDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector("."+xGt)):this.toolTipObj.open(this.taskbarEdit.taskBarEditElement)):je(this.toolTipObj)||(this.toolTipObj.destroy(),this.toolTipObj=null)},AXt.prototype.updateTooltip=function(e){var t=this.taskbarEdit.taskBarEditRecord.ganttProperties,i=(je(e)||-1===e?t:t.segments[e]).width,n=(je(e)||-1===e?t:t.segments[e]).progressWidth,o=je(e)||-1===e?t.left:t.left+t.segments[e].left;je(this.toolTipObj)||("ConnectorPointLeftDrag"===this.taskbarEdit.taskBarEditAction||"ConnectorPointRightDrag"===this.taskbarEdit.taskBarEditAction?(this.toolTipObj.content=this.getTooltipText(e),this.parent.tooltipSettings.editing&&(this.toolTipObj.openDelay=500),this.toolTipObj.offsetY=-3):(this.parent.tooltipSettings.editing&&(this.toolTipObj.openDelay=500),this.toolTipObj.content=this.getTooltipText(e),t.segments&&0<t.segments.length&&this.taskbarEdit.mainElement&&"ProgressResizing"===this.taskbarEdit.taskBarEditAction?(t=this.taskbarEdit.mainElement.querySelectorAll(".e-segmented-taskbar"),this.toolTipObj.refresh(t[e])):this.toolTipObj.refresh(this.taskbarEdit.taskBarEditElement),"LeftResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=0:this.toolTipObj.offsetX=-i:"RightResizing"===this.taskbarEdit.taskBarEditAction||"ParentResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=-i:this.toolTipObj.offsetX=0:"ProgressResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=-n:this.toolTipObj.offsetX=-(i-n):"MilestoneDrag"===this.taskbarEdit.taskBarEditAction?this.toolTipObj.offsetX=-this.parent.chartRowsModule.milestoneHeight/2:5<i&&(this.toolTipObj.offsetX=-(i+o-this.taskbarEdit.tooltipPositionX)),this.parent.tooltipSettings.editing&&document.getElementsByClassName("e-gantt-tooltip")[0]&&this.toolTipHeight&&(document.getElementsByClassName("e-gantt-tooltip")[0].style.top=this.toolTipHeight)))},AXt.prototype.getTooltipText=function(e){var t="",i=this.parent.globalize,n=this.taskbarEdit.taskBarEditRecord.ganttProperties;if(!je(n.segments)&&0<n.segments.length&&-1!==e&&"ProgressResizing"!==this.taskbarEdit.taskBarEditAction&&(n=n.segments[e]),this.parent.tooltipSettings.editing){e=this.parent.tooltipModule.templateCompiler(this.parent.tooltipSettings.editing,this.parent,this.taskbarEdit.taskBarEditRecord,"TooltipEditingTemplate");R("tooltipEle",this.toolTipObj)&&this.parent.renderTemplates(),t=e[0]}else{var o=void 0,r=void 0,s=void 0;switch(je(n)||je(n.startDate)||(o='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("startDate")+"</td><td class="+gGt+'>:</td><td class = "e-gantt-tooltip-value">'+i.formatDate(n.startDate,{format:this.parent.getDateFormat()})+"</td></tr>"),je(n)||je(n.endDate)||(r='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+"</td><td class="+gGt+'>:</td><td class = "e-gantt-tooltip-value">'+i.formatDate(n.endDate,{format:this.parent.getDateFormat()})+"</td></tr>"),je(n)||je(n.duration)||(s='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+"</td><td class="+gGt+'>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getDurationString(n.duration,n.durationUnit)+"</td></tr>"),this.taskbarEdit.taskBarEditAction){case"ProgressResizing":t='<table class = "e-gantt-tooltiptable"><tbody>'+('<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+"</td><td class="+gGt+'>:</td><td class = "e-gantt-tooltip-value">'+n.progress+"</td></tr>")+"</tbody></table>";break;case"LeftResizing":t='<table class = "e-gantt-tooltiptable"><tbody>'+o+s+"</tbody></table>";break;case"RightResizing":case"ParentResizing":t='<table class = "e-gantt-tooltiptable"><tbody>'+r+s+"</tbody></table>";break;case"ChildDrag":case"ParentDrag":case"MilestoneDrag":case"ManualParentDrag":var a="",l="";je(this.taskbarEdit.taskBarEditRecord.ganttProperties.startDate)||(a=o),je(this.taskbarEdit.taskBarEditRecord.ganttProperties.endDate)||(l=r),t='<table class = "e-gantt-tooltiptable"><tbody>'+a+l+"</tbody></table>";break;case"ConnectorPointLeftDrag":case"ConnectorPointRightDrag":t=this.parent.connectorLineModule.tooltipTable,je(this.toolTipObj)&&(this.parent.connectorLineModule.tooltipTable.innerHTML="",this.parent.connectorLineModule.tooltipTable.appendChild(this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.parent.editModule.taskbarEditModule.taskBarEditRecord.ganttProperties.taskName,this.parent.editModule.taskbarEditModule.fromPredecessorText,"","")))}}return"string"==typeof t?ao(function(){return t}):t};var SXt=AXt;function AXt(e,t){this.parent=e,this.taskbarEdit=t}xXt=function(e,t){return(xXt=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])}))(e,t)};var xXt,IXt,TXt=function(){return(TXt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},EXt=(function(e,t){function i(){this.constructor=e}xXt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(DXt,IXt=vqt),DXt.prototype.wireEvents=function(){this.parent.on("chartMouseDown",this.mouseDownHandler,this),this.parent.on("chartMouseUp",this.mouseUpHandler,this),this.parent.on("chartMouseLeave",this.mouseLeaveHandler,this),this.parent.on("chartMouseMove",this.mouseMoveAction,this),this.parent.on("chartMouseClick",this.mouseClickHandler,this)},DXt.prototype.initPublicProp=function(){this.taskBarEditElement=null,this.taskBarEditRecord=null,this.taskBarEditAction=null,this.connectorSecondElement=null,this.connectorSecondRecord=null,this.connectorSecondAction=null,this.highlightedSecondElement=null,this.fromPredecessorText=null,this.toPredecessorText=null,this.finalPredecessor=null,this.drawPredecessor=!1,this.roundOffDuration=!0,this.dragMouseLeave=!1,this.isMouseDragged=!1,this.previousItemProperty=["left","progress","duration","isMilestone","startDate","endDate","width","progressWidth","autoLeft","autoDuration","autoStartDate","autoEndDate","autoWidth","segments"],this.tapPointOnFocus=!1,this.touchEdit=!1},DXt.prototype.mouseDownHandler=function(e){var t;this.parent.editSettings.allowTaskbarEditing&&!this.parent.readOnly&&(this.canDrag=!1,this.taskBarEditElement?((t=oqt(this.getElementByPosition(e),Rqt))&&t.innerHTML===this.taskBarEditElement.innerHTML||this.taskBarEditElement.classList.contains("e-segmented-taskbar")||this.taskBarEditElement.classList.contains("collpse-parent-border"))&&(this.updateTaskBarEditElement(e),this.canDrag=!0,e.preventDefault()):this.parent.isAdaptive||this.updateTaskBarEditElement(e))},DXt.prototype.mouseClickHandler=function(e){var t,i;this.parent.editSettings.allowTaskbarEditing&&(i=oqt(t=this.getElementByPosition(e),Rqt),this.parent.selectionModule&&this.parent.selectionModule.enableSelectMultiTouch?this.tapPointOnFocus&&this.updateTaskBarEditElement(e):this.tapPointOnFocus&&!je(this.taskBarEditElement)&&i&&i.innerHTML!==this.taskBarEditElement.innerHTML?(this.connectorSecondRecord=this.parent.ganttChartModule.getRecordByTaskBar(i),this.connectorSecondAction="ConnectorPointLeftDrag",this.connectorSecondElement=i,this.fromPredecessorText="Finish",this.validateConnectorPoint()&&this.taskBarEditingAction(e,!0),this.showHideActivePredecessors(!1),this.initPublicProp()):t.classList.contains(IGt)?(this.canDrag=!1,this.multipleSelectionEnabled(),this.showHideTaskBarEditingElements(t,this.taskBarEditElement),this.tapPointOnFocus=!0,this.taskBarEditAction="ConnectorPointLeftDrag",this.connectorSecondRecord=this.taskBarEditRecord,this.taskBarEditingAction(e,!1)):t.classList.contains(TGt)?(this.canDrag=!1,this.multipleSelectionEnabled(),this.showHideTaskBarEditingElements(t,this.taskBarEditElement),this.tapPointOnFocus=!0,this.taskBarEditAction="ConnectorPointRightDrag",this.connectorSecondRecord=this.taskBarEditRecord,this.taskBarEditingAction(e,!1)):(this.tapPointOnFocus&&(this.showHideActivePredecessors(!1),this.showHideTaskBarEditingElements(i,this.taskBarEditElement)),this.updateTaskBarEditElement(e)))},DXt.prototype.showHideActivePredecessors=function(e){var t=this.taskBarEditRecord.ganttProperties,i=t.predecessor,n="ResourceView"===this.parent.viewType?t.taskId:t.rowUniqueID;if(i)for(var o=0;o<i.length;o++){var r=i[o];n.toString()!==r.from&&n.toString()!==r.to||this.applyActiveColor(r.from,r.to,e)}t=this.parent.ganttChartModule.chartBodyContainer;(e?(U([this.taskBarEditElement],[LGt]),U):(q([this.taskBarEditElement],[LGt]),q))([t],[OGt]),this.touchEdit=e,je(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},DXt.prototype.applyActiveColor=function(e,t,i){var n=("ProjectView"===this.parent.viewType?this.taskBarEditRecord.ganttProperties.taskId:this.taskBarEditRecord.ganttProperties.rowUniqueID).toString()===e?this.parent.connectorLineModule.getRecordByID(t):this.parent.connectorLineModule.getRecordByID(e),n=this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(n)];je(n)||(n=n.querySelector("."+Rqt),e=this.parent.element.querySelector("#ConnectorLineparent"+e+"child"+t),i?(U([n],[RGt]),e&&U([e],[RGt])):(q([n],[RGt]),e&&q([e],[RGt])))},DXt.prototype.validateConnectorPoint=function(){var e=this.taskBarEditRecord.ganttProperties,t=this.connectorSecondRecord.ganttProperties,i=!0,n="ResourceView"===this.parent.viewType?e.taskId:e.rowUniqueID,o="ResourceView"===this.parent.viewType?t.taskId:t.rowUniqueID;if(this.connectorSecondRecord.hasChildRecords)i=!1;else if(t.predecessor)for(var r=0;r<t.predecessor.length;r++){var s=t.predecessor[r];if(s.from===n.toString()&&s.to===o.toString()){this.parent.connectorLineEditModule.childRecord=this.connectorSecondRecord,this.parent.connectorLineEditModule.predecessorIndex=r,this.parent.connectorLineEditModule.renderPredecessorDeleteConfirmDialog(),i=!1;break}if(s.from===o.toString()&&s.to===n.toString()){this.parent.connectorLineEditModule.childRecord=this.taskBarEditRecord,this.parent.connectorLineEditModule.predecessorIndex=r,this.parent.connectorLineEditModule.renderPredecessorDeleteConfirmDialog(),i=!1;break}}return i},DXt.prototype.mouseLeaveHandler=function(e){"ChildDrag"===this.taskBarEditAction||"ParentDrag"===this.taskBarEditAction||"ProgressResizing"===this.taskBarEditAction||"LeftResizing"===this.taskBarEditAction||"RightResizing"===this.taskBarEditAction?this.dragMouseLeave=!1:this.dragMouseLeave=!0},DXt.prototype.updateTaskBarEditElement=function(e){var t,i,n,o,r,s=this.getElementByPosition(e);if(s.classList.contains(sGt)||s.classList.contains(iGt)||s.classList.contains(nGt))l=oqt(s,iGt);else if(s.classList.contains(oGt))l=oqt(s,oGt);else{var a,l=oqt(s,Rqt);if(!je(l)&&!s.classList.contains("e-connectorpoint-left")&&!s.classList.contains("e-connectorpoint-right"))if(!je((a=this.parent.ganttChartModule.getRecordByTaskBar(l)).ganttProperties.segments)&&0<a.ganttProperties.segments.length)if(s.classList.contains("e-progressbar-handler-after")){for(var h=0;h<a.ganttProperties.segments.length;h++)if(a.ganttProperties.segments[h].showProgress){l=l.querySelectorAll(".e-segmented-taskbar")[h];break}}else l=oqt(s,Nqt)}this.parent.editSettings.allowTaskbarEditing&&l?(this.showHideTaskBarEditingElements(l,this.editElement),this.editElement=l,this.realTaskbarElement=this.editElement,je(s=this.editElement.getAttribute("data-segment-index"))?this.segmentIndex=-1:this.segmentIndex=Number(s),this.taskBarEditRecord=this.parent.ganttChartModule.getRecordByTaskBar(this.editElement),"mousedown"!==e.type&&"touchstart"!==e.type&&"click"!==e.type||(this.taskBarEditAction=this.getTaskBarAction(e),s=this.editElement.getAttribute("data-segment-index"),n=(a=this.parent.ganttChartModule.getRecordByTaskBar(l)).ganttProperties,t=this.editElement.parentElement.offsetLeft,this.currentData=a,U([i=Q("div",{styles:"height:100%;border-style:dashed;border-bottom:none;border-top:none;border-width:1px;position:absolute;z-index:10000"})],"e-taskbar-resize-div"),i.style.setProperty("width",n.width+"px"),r=this.editElement.getAttribute("data-segment-index"),!je(n.segments)&&this.parent.allowTaskbarDragAndDrop&&"LeftResizing"!==this.taskBarEditAction&&"RightResizing"!==this.taskBarEditAction&&"ProgressResizing"!==this.taskBarEditAction?i.style.setProperty("left",je(n.segments)?n.left+"px":t+"px"):i.style.setProperty("left",!je(n.segments)&&1<n.segments.length?t+n.segments[Number(r)].left+"px":n.left+"px"),t=this.parent.createElement("table"),(r=this.parent.createElement("tbody")).appendChild(i),t.appendChild(r),n=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-clone-taskbar"),i=null,r=(!("ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||je(s)||je(s)||0!==Number(s))||-1!==this.segmentIndex&&this.parent.allowTaskbarDragAndDrop&&"LeftResizing"!==this.taskBarEditAction&&"RightResizing"!==this.taskBarEditAction&&"ProgressResizing"!==this.taskBarEditAction?this.editElement.parentElement:this.editElement).cloneNode(!0),n||(U([r],"e-clone-taskbar"),r.style.setProperty("position","absolute"),a.hasChildRecords&&!a.ganttProperties.isAutoSchedule&&(n=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),o=this.parent.getOffsetRect(this.editElement),this.editElement.classList.contains("e-manualparent-main-container")?r.style.setProperty("left",a.ganttProperties.left-a.ganttProperties.autoLeft+"px"):r.style.setProperty(this.parent.enableRtl?"right":"left",Math.abs(o.left-n.left+Math.abs(this.parent.ganttChartModule.scrollElement.scrollLeft))+"px")),r.style.setProperty("top","0px"),i=this.parent.createElement("table"),(o=this.parent.createElement("tbody")).appendChild(r),i.appendChild(o)),"ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||je(s)||je(s)||0!==Number(s)?this.cloneTaskbarElement=r:(n=r.getElementsByClassName("e-segmented-taskbar"),this.cloneTaskbarElement=n[Number(s)]),this.taskBarEditElement=this.cloneTaskbarElement,this.taskbarElement=i,this.taskbarResizer=t,this.currentIndex=s,this.roundOffDuration=!0,"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||!je(this.parent.taskFields.dependency)||(this.taskBarEditAction=null),this.updateMouseDownProperties(e),"ResourceView"!==this.parent.viewType&&"ProjectView"!==this.parent.viewType)||0===this.taskBarEditRecord.level||!this.parent.enableMultiTaskbar||je(o=this.parent.getTaskByUniqueID(this.taskBarEditRecord.parentItem.uniqueID))||o.expanded||(this.prevZIndex=this.taskBarEditElement.style.zIndex,this.taskBarEditElement.style.zIndex="1000",this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")&&U([this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")],"e-collapsed-taskbar-drag"))):this.parent.isAdaptive?(this.taskBarEditElement&&this.showHideTaskBarEditingElements(l,this.editElement),this.initPublicProp()):this.showHideTaskBarEditingElements(l,this.editElement)},DXt.prototype.showHideTaskBarEditingElements=function(e,t,i){t=t||this.editElement;var n,o,r,s,a=!!this.parent.taskFields.progress,l=!0;this.parent.readOnly||(n=e?this.parent.ganttChartModule.getRecordByTaskBar(e):t?this.parent.ganttChartModule.getRecordByTaskBar(t):null,this.parent.enableMultiTaskbar&&e&&(je(r=this.parent.getParentTask(n.parentItem))||r.expanded||(l=!1,U([e],["e-gantt-multi-taskbar"]))),e?(e.querySelector("."+qqt)?(U([e.querySelector("."+qqt)],[dGt]),U([e.querySelector("."+Gqt)],[pGt]),a&&!je(o=n&&n.ganttProperties.segments&&0<n.ganttProperties.segments.length?this.parent.getRowByIndex(this.parent.currentViewData.indexOf(n)).querySelectorAll("."+Yqt)[0]:e.querySelector("."+Yqt))&&(U([o],[cGt]),o.style.top="3px")):this.parent.isAdaptive&&a&&this.parent.ganttChartModule.getRecordByTaskBar(e).hasChildRecords&&U([e],[FGt]),U(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+yGt),[SGt]),!je(this.parent.taskFields.dependency)&&(e.querySelector("."+AGt)||e.parentElement.querySelector("."+AGt))&&l&&(s=je(e.querySelector("."+AGt))?e.parentElement:e,je(s.querySelector("."+AGt))||U([s.querySelector("."+AGt)],[IGt]),je(s.querySelector("."+xGt))||U([s.querySelector("."+xGt)],[TGt]))):i||q(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+yGt),[SGt]),t&&e!==t&&(t.querySelector("."+qqt)&&(q([t.querySelector("."+qqt)],[dGt]),q([t.querySelector("."+Gqt)],[pGt]),o=n&&n.ganttProperties.segments&&0<n.ganttProperties.segments.length?this.parent.getRowByIndex(this.parent.currentViewData.indexOf(n)):t)&&o.querySelector("."+Yqt)&&q([o.querySelector("."+Yqt)],[cGt]),je(this.parent.taskFields.dependency)||!t.querySelector("."+AGt)&&!t.parentElement.querySelector("."+AGt)?this.parent.isAdaptive&&(r=this.parent.ganttChartModule.getRecordByTaskBar(t))&&r.hasChildRecords&&q([t],[FGt]):(a=(s=je(t.querySelector("."+AGt))?t.parentElement:t).querySelector("."+AGt),l=s.querySelector("."+xGt),a&&q([a],[IGt]),l&&q([l],[TGt])),this.editElement=null))},DXt.prototype.getTaskBarAction=function(e){var e=this.getElementByPosition(e),t=this.taskBarEditRecord,i="";return e.classList.contains(qqt)?i="LeftResizing":e.classList.contains(Gqt)?i="RightResizing":(e.classList.contains(Yqt)||z(e,"."+Yqt))&&this.parent.taskFields.progress?i="ProgressResizing":e.classList.contains(AGt)?i="ConnectorPointLeftDrag":e.classList.contains(xGt)?i="ConnectorPointRightDrag":e.classList.contains(sGt)?i="ParentResizing":e.classList.contains(nGt)||e.classList.contains(iGt)||e.classList.contains(oGt)?i="ManualParentDrag":t&&(i=t.hasChildRecords?t[this.parent.taskFields.manual]?"":"ParentDrag":t.ganttProperties.isMilestone?"MilestoneDrag":"ChildDrag"),i},DXt.prototype.updateMouseDownProperties=function(e){var e=this.getCoordinate(e),t=this.parent.element.closest('[style*="zoom"]');t&&(t=parseFloat(getComputedStyle(t).zoom),e.pageX=e.pageX/t,e.pageY=e.pageY/t),(e.pageX||e.pageY)&&(t=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),this.parent.enableRtl?this.mouseDownX=Math.abs(e.pageX-(t.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseDownX=e.pageX-t.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseDownX,this.mouseDownY=this.dragMoveY=e.pageY-t.top+this.parent.ganttChartModule.scrollObject.previousScroll.top),"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||(this.fromPredecessorText="ConnectorPointLeftDrag"===this.taskBarEditAction?"start":"finish",this.parent.connectorLineModule.tooltipTable.innerHTML="",this.parent.connectorLineModule.tooltipTable.appendChild(this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.taskBarEditRecord.ganttProperties.taskName,this.fromPredecessorText,"","")))},DXt.prototype.isMouseDragCheck=function(){var e;!this.isMouseDragged&&this.taskBarEditAction&&(this.mouseDownX!==this.mouseMoveX&&(this.mouseDownX+3<this.mouseMoveX||this.mouseDownX-3>this.mouseMoveX)||this.mouseDownY!==this.mouseMoveY&&(this.mouseDownY+3<this.mouseMoveY||this.mouseDownY-3>this.mouseMoveY))&&(this.isMouseDragged=!0,this.parent.initiateEditAction(!0),e=this.taskBarEditRecord.ganttProperties,this.previousItem=this.parent.timelineModule.extendFunction(e,this.previousItemProperty),"ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction||"ResourceView"===this.parent.viewType&&"ParentDrag"===this.taskBarEditAction||this.editTooltip.showHideTaskbarEditTooltip(!0,this.segmentIndex),this.taskBarEditElement.setAttribute("aria-grabbed","true"))},DXt.prototype.removeFirstBorder=function(e){var t="bottomSegment"===this.parent.rowDragAndDropModule.dropPosition;0<this.parent.element.getElementsByClassName("e-firstrow-border").length&&e&&(e.getAttribute("aria-rowindex")-1!=0||t)&&this.parent.element.getElementsByClassName("e-firstrow-border")[0].remove()},DXt.prototype.removeLastBorder=function(e){var t=e&&(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow")),t=this.parent.enableVirtualization?e&&!t&&this.parent.treeGrid.getRows()[this.parent.treeGrid.getCurrentViewRecords().length-1].getAttribute("data-uid")!==e.getAttribute("data-uid"):e&&!t&&this.parent.treeGrid.getRowByIndex(this.parent.treeGrid.getCurrentViewRecords().length-1).getAttribute("data-uid")!==e.getAttribute("data-uid"),i=t||"topSegment"===this.parent.rowDragAndDropModule.dropPosition;0<this.parent.element.getElementsByClassName("e-lastrow-border").length&&e&&(t||i)&&this.parent.element.getElementsByClassName("e-lastrow-border")[0].remove()},DXt.prototype.removetopOrBottomBorder=function(){var e=[].slice.call(this.parent.element.querySelectorAll(".e-dropbottom, .e-droptop"));e.length&&(this.addRemoveClasses(e,!1,"e-dropbottom"),this.addRemoveClasses(e,!1,"e-droptop"))},DXt.prototype.topOrBottomBorder=function(t){var e;(e=(this.parent.enableVirtualization?(e=this.parent.treeGrid.getRows().filter(function(e){return parseInt(e.getAttribute("aria-rowindex"),10)-1==parseInt(t.getAttribute("aria-rowindex"),10)-1})[0],e=this.parent.treeGrid.getRows().indexOf(e),this.parent.getRowByIndex(e)):this.parent.getRowByIndex(parseInt(t.getAttribute("aria-rowindex"),10)-1)).children)&&("above"===this.parent.rowDragAndDropModule.dropPosition&&(this.addRemoveClasses(e,!0,"e-droptop"),0<this.parent.element.getElementsByClassName("e-lastrow-dragborder").length)&&this.parent.element.getElementsByClassName("e-lastrow-dragborder")[0].remove(),"below"===this.parent.rowDragAndDropModule.dropPosition)&&this.addRemoveClasses(e,!0,"e-dropbottom")},DXt.prototype.removeChildBorder=function(){var e=[].slice.call(this.parent.element.querySelectorAll(".e-childborder"));0<e.length&&this.addRemoveClasses(e,!1,"e-childborder")},DXt.prototype.addRemoveClasses=function(e,t,i){for(var n=0,o=e.length;n<o;n++)t?e[parseInt(n.toString(),10)].classList.add(i):e[parseInt(n.toString(),10)].classList.remove(i)},DXt.prototype.addErrorElem=function(){var e,t=document.getElementsByClassName("e-clone-taskbar")[0];document.querySelectorAll(".e-errorelem").length||(mt(e=document.createElement("div"),["e-errorcontainer"],[]),mt(e,["e-icons","e-errorelem"],[]),this.taskBarEditRecord.ganttProperties.segments&&0<this.taskBarEditRecord.ganttProperties.segments.length&&(e.style.paddingTop=this.parent.taskbarHeight+"px"),t.appendChild(e))},DXt.prototype.removeErrorElem=function(){var e=document.querySelector(".e-errorelem");e&&e.remove()},DXt.prototype.ensurePosition=function(e,t){var i=this;e.filter(function(e){e.hasChildRecords&&!je(e.childRecords)&&(-1===e.childRecords.indexOf(t)?i.ensurePosition(e.childRecords,t):(i.parent.rowDragAndDropModule.dropPosition="Invalid",i.addErrorElem()))})},DXt.prototype.mouseMoveAction=function(i){var n=this;if(this.parent.isAdaptive){if(!this.canDrag)return;this.multipleSelectionEnabled()}var e=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),t=this.getCoordinate(i),t=(this.parent.enableRtl?this.mouseMoveX=Math.abs(t.pageX-(e.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseMoveX=t.pageX-e.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.mouseMoveY=t.pageY-e.top+this.parent.ganttChartModule.scrollObject.previousScroll.top,this.dragMouseLeave=!1);if("ChildDrag"!==this.taskBarEditAction&&"ParentDrag"!==this.taskBarEditAction&&"ManualParentDrag"!==this.taskBarEditAction&&"MilestoneDrag"!==this.taskBarEditAction||(e=void 0,e=this.parent.enableVirtualization?(s=this.parent.currentViewData.indexOf(this.taskBarEditRecord),this.parent.getRowByIndex(s)):this.parent.getRowByIndex(this.taskBarEditRecord.index),e={cancel:t,cloneElement:this.taskbarElement,data:this.taskBarEditRecord,target:i.target,rows:e},this.parent.trigger("rowDrag",e),t=e.cancel),t||this.isMouseDragCheck(),this.isMouseDragged&&this.taskBarEditAction){if(i.preventDefault(),je(this.taskbarElement)||je(this.editElement)||"ConnectorPointRightDrag"===this.taskBarEditAction||"ConnectorPointLeftDrag"===this.taskBarEditAction||"ResourceView"===this.parent.viewType&&this.currentData.hasChildRecords||(d=this.editElement.parentElement,this.parent.enableTimelineVirtualization&&this.parent.timelineModule.wholeTimelineWidth>3*this.parent.element.offsetWidth?d.style.setProperty("position","relative"):d.style.setProperty("position","absolute"),("ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||je(this.currentIndex)||je(this.currentIndex)||0!==Number(this.currentIndex)?this.parent.allowTaskbarDragAndDrop&&"LeftResizing"!==this.taskBarEditAction&&"RightResizing"!==this.taskBarEditAction&&"ProgressResizing"!==this.taskBarEditAction?this.parent.chartPane.getElementsByClassName("e-gantt-chart")[0]:d:(this.taskbarElement.childNodes[0].childNodes[0].style.setProperty("top",d.parentElement.offsetTop+"px"),this.parent.allowTaskbarDragAndDrop&&"LeftResizing"!==this.taskBarEditAction&&"RightResizing"!==this.taskBarEditAction&&"ProgressResizing"!==this.taskBarEditAction?this.parent.chartPane.getElementsByClassName("e-gantt-chart")[0]:d.parentElement)).appendChild(this.taskbarElement),"ProgressResizing"!==this.taskBarEditAction&&(this.parent.enableTimelineVirtualization&&this.parent.timelineModule.wholeTimelineWidth>3*this.parent.element.offsetWidth?this.parent.ganttChartModule.chartBodyContainer.querySelectorAll(".e-chart-scroll-container"):this.parent.ganttChartModule.chartBodyContainer.querySelectorAll(".e-chart-rows-container"))[0].appendChild(this.taskbarResizer)),this.parent.allowTaskbarDragAndDrop&&("ChildDrag"===this.taskBarEditAction||"ParentDrag"===this.taskBarEditAction||"MilestoneDrag"===this.taskBarEditAction||"ManualParentDrag"===this.taskBarEditAction)){var o,r,s,e=this.parent.getOffsetRect(this.taskBarEditElement),t=!je(document.body.className)&&document.body.className.includes("e-bigger")?12:0,t=3+this.parent.chartRowsModule.connectorPointWidth+t,a=void 0,a=this.parent.enableRtl?Math.abs(e.left+t+1):Math.abs(e.left-t-1),e=(this.isClonedElement||this.parent.enableRtl||(a-=this.parent.ganttChartModule.scrollElement.scrollLeft,this.isClonedElement=!0),0),t=this.parent.rowDragAndDropModule.dropPosition=void 0,l=void 0,l="touchmove"===i.type||"touchstart"===i.type||"touchend"===i.type?i.changedTouches[0].pageY:i.y,a=(this.parent.enableRtl?(t=document.elementFromPoint(this.parent.ganttChartModule.chartBodyContainer.offsetWidth,l)).classList.contains("e-taskbar-resize-div")&&(t=document.elementFromPoint(this.parent.ganttChartModule.chartBodyContainer.offsetWidth-t.offsetWidth,l)):t=document.elementFromPoint(a,l),void 0);if(this.parent.enableVirtualization)this.draggedTreeGridRowElement||(a=(d=this.editElement.parentElement).parentElement,this.draggedTreeGridRowElement=a,this.draggedTreeGridRowHeight=this.draggedTreeGridRowElement.offsetHeight);else if(a=this.parent.treeGrid.getRows()[this.parent.flatData.indexOf(this.taskBarEditRecord)],this.draggedTreeGridRowElement=a,this.parent.enableMultiTaskbar)if(this.taskBarEditRecord.parentItem&&!je(this.parent.getRowByID(this.taskBarEditRecord.parentItem.taskId))){if(this.draggedTreeGridRowHeight=this.parent.getRowByID(this.taskBarEditRecord.parentItem.taskId).offsetHeight,"ProjectView"===this.parent.viewType&&0===this.draggedTreeGridRowHeight)for(var h=this.parent.getRecordByID(this.taskBarEditRecord.parentItem.taskId);h.parentItem;)h=this.parent.getRecordByID(h.parentItem.taskId),this.draggedTreeGridRowHeight=this.parent.getRowByID(h.TaskID).offsetHeight}else{var d=this.editElement.parentElement;this.draggedTreeGridRowElement=d.parentElement,this.draggedTreeGridRowHeight=this.draggedTreeGridRowElement.offsetHeight}else this.draggedTreeGridRowHeight=this.draggedTreeGridRowElement.offsetHeight;(o=t?z(t,"tr."+Uqt):o)&&(l=void 0,l=this.parent.enableVirtualization?this.parent.treeGrid.getRows().filter(function(e){return parseInt(e.getAttribute("aria-rowindex"),10)-1==parseInt(o.getAttribute("aria-rowindex"),10)-1})[0]:this.parent.treeGrid.getRows()[parseInt(o.getAttribute("aria-rowindex"),10)-1],this.removeFirstBorder(l),this.removeLastBorder(l),(je(l)||l.getAttribute("data-uid")!==this.draggedTreeGridRowElement.getAttribute("data-uid"))&&oqt(t,"e-chart-rows-container")||(this.parent.rowDragAndDropModule.dropPosition="Invalid",this.addErrorElem()),a=0,t=(d=this.parent).toolbarModule?this.parent.toolbarModule.element.offsetHeight:0,r=this.parent.getOffsetRect(d.element),r=d.treeGrid.getHeaderContent().offsetHeight+r.top+t,t=d.treeGrid.getContent().firstElementChild.scrollTop,je(l)||(e=l.offsetTop-t),d=((a=this.parent.enableVirtualization?this.parent.getOffsetRect(l).top:e+r)+this.draggedTreeGridRowHeight-a)/3,e=(t=a+d)+d,a=t<(r="mousemove"===i.type?i.pageY:je(i.changedTouches)?null:i.changedTouches[0].pageY)&&r<=e,e=e<r&&r<=e+d,(d=r<=t)||a||e)&&(r=void 0,t=R("rowIndex",r=this.parent.enableVirtualization?(s=this.parent.treeGrid.getRows().indexOf(l),this.parent.getRowByIndex(s)):this.parent.getRowByIndex(parseInt(l.getAttribute("aria-rowindex"),10)-1)),s=this.parent.flatData[t],t=!0,"ResourceView"!==this.parent.viewType||this.taskBarEditRecord.hasChildRecords||s.hasChildRecords||je(s.parentItem)||this.taskBarEditRecord.parentItem.taskId!==s.parentItem.taskId||(t=!1),s&&this.ensurePosition([this.taskBarEditRecord],s),t)&&(d&&"Invalid"!==this.parent.rowDragAndDropModule.dropPosition&&(this.parent.rowDragAndDropModule.dropPosition="above",this.removeChildBorder(),this.removeErrorElem(),this.removetopOrBottomBorder(),this.topOrBottomBorder(r)),a&&"Invalid"!==this.parent.rowDragAndDropModule.dropPosition&&(this.parent.rowDragAndDropModule.dropPosition="child",this.removetopOrBottomBorder(),this.addRemoveClasses(r.children,!0,"e-childborder")),e)&&"Invalid"!==this.parent.rowDragAndDropModule.dropPosition&&(this.parent.rowDragAndDropModule.dropPosition="below",this.removetopOrBottomBorder(),this.removeErrorElem(),this.removeChildBorder(),this.removeFirstBorder(l),this.topOrBottomBorder(l))}var p={cancel:!1,requestType:"taskbarediting",taskBarEditAction:this.taskBarEditAction,data:this.taskBarEditRecord};-1!==this.segmentIndex&&(p.requestType="mergeSegment"),this.parent.trigger("actionBegin",p,function(e){var t;"ConnectorPointRightDrag"!==p.taskBarEditAction&&"ConnectorPointLeftDrag"!==p.taskBarEditAction&&"LeftResizing"!==p.taskBarEditAction&&"RightResizing"!==p.taskBarEditAction&&"ProgressResizing"!==p.taskBarEditAction&&"ChildDrag"!==p.taskBarEditAction&&"ParentDrag"!==p.taskBarEditAction&&"MilestoneDrag"!==p.taskBarEditAction&&"ManualParentDrag"!==p.taskBarEditAction&&"ParentResizing"!==p.taskBarEditAction||(n.parent.showIndicator=!1,n.parent.undoRedoModule&&n.parent.isUndoRedoItemPresent("Edit")&&(n.parent.undoRedoModule.redoEnabled&&n.parent.undoRedoModule.disableRedo(),t={},0===n.parent.undoRedoModule.getUndoCollection.length||n.parent.editModule.createArray)&&(n.isDragged=!0,t.modifiedRecords=[],t.action=p.taskBarEditAction,n.parent.undoRedoModule.createUndoCollection(),n.parent.undoRedoModule.getUndoCollection[n.parent.undoRedoModule.getUndoCollection.length-1]=t,n.parent.editModule.createArray=!1,n.parent.undoRedoModule.changedRecords=[])),!je(n.parent.loadingIndicator)&&"Shimmer"===n.parent.loadingIndicator.indicatorType&&n.parent.showIndicator?n.parent.showMaskRow():n.parent.showIndicator&&n.parent.showSpinner(),!1===e.cancel&&n.taskBarEditingAction(i,!1)})}else this.parent.isAdaptive||this.taskBarEditAction||this.updateTaskBarEditElement(i)},DXt.prototype.taskBarEditingAction=function(e,t){var i=this,n={},o=this.parent.ganttChartModule.getIndexByTaskBar(this.taskBarEditElement);if(null!==this.taskBarEditRecord&&(n.editingFields=this.taskBarEditRecord.ganttProperties,n.data=this.taskBarEditRecord,"ResourceView"!==this.parent.viewType||0!==n.data.level)){n.recordIndex=o,n.taskBarEditAction=this.taskBarEditAction,n.roundOffDuration=this.roundOffDuration,n.cancel=!1,n.previousData=this.previousItem,n.segmentIndex=this.segmentIndex,this.roundOffDuration=n.roundOffDuration,this.targetElement=n.target=z(e.target,".e-gantt-child-taskbar"),this.updateMouseMoveProperties(e),this.oldData||(this.oldData=Pe([],[],[this.taskBarEditRecord],!0)[0]);var r=-1!==this.segmentIndex?this.segmentIndex:null;if("ProgressResizing"===this.taskBarEditAction){if(this.mainElement=oqt(this.taskBarEditElement,Rqt),this.taskBarEditRecord.ganttProperties.segments&&0<this.taskBarEditRecord.ganttProperties.segments.length)for(var r=-1,s=0;s<this.taskBarEditRecord.ganttProperties.segments.length;s++){var a=document.getElementsByClassName("e-child-progress-resizer e-progress-resize-gripper")[0].style,a=this.parent.enableRtl?parseInt(a.right,10)-8:parseInt(a.left,10)+8;a<this.taskBarEditRecord.ganttProperties.segments[s].width&&0===s&&(r=s),this.taskBarEditRecord.ganttProperties.segments[s+1]&&a<this.taskBarEditRecord.ganttProperties.segments[s+1].width+this.taskBarEditRecord.ganttProperties.segments[s+1].left&&a>this.taskBarEditRecord.ganttProperties.segments[s+1].left&&(r=s+1)}this.performProgressResize(e,r)}else"LeftResizing"===this.taskBarEditAction?this.enableLeftResizing(e):"RightResizing"===this.taskBarEditAction||"ParentResizing"===this.taskBarEditAction?this.enableRightResizing(e):"ParentDrag"===this.taskBarEditAction||"ChildDrag"===this.taskBarEditAction||"MilestoneDrag"===this.taskBarEditAction||"ManualParentDrag"===this.taskBarEditAction?this.enableDragging(e):"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||(this.updateConnectorLineSecondProperties(e),this.triggerDependencyEvent(e),this.drawFalseLine());if(this.parent.allowTaskbarDragAndDrop&&"LeftResizing"!==this.taskBarEditAction&&"RightResizing"!==this.taskBarEditAction&&"ProgressResizing"!==this.taskBarEditAction){var o=this.parent.getOffsetRect(this.parent.chartPane),l=this.getCoordinate(e),h=l.pageY,l=l.pageX,l={left:Math.abs(l-o.left),top:h-o.top};if("ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar){var d=this.parent.getRecordByID(this.taskBarEditRecord.parentItem.taskId);if(!this.parent.allowTaskbarOverlap&&this.taskBarEditRecord.parentItem&&!d.expanded){var p=0;if(parseInt(this.editElement.style.marginTop,10)>this.parent.rowHeight){for(s=0;s<d.childRecords.length&&d.childRecords[s].ganttProperties.taskId!==this.taskBarEditRecord.ganttProperties.taskId;s++)p+=this.parent.rowHeight;l.top=l.top-p}}}this.topValue=l.top;h=void 0,h=("touchmove"===e.type||"touchstart"===e.type||"touchend"===e.type?e.changedTouches[0]:e).pageX;this.parent.enableRtl?this.leftValue=l.left-Math.abs(h-this.parent.getOffsetRect(this.taskBarEditElement).left)-(0!==this.previousLeftValue?h-this.previousLeftValue:0):this.leftValue=l.left-(h-this.parent.getOffsetRect(this.taskBarEditElement).left)+(0!==this.previousLeftValue?h-this.previousLeftValue:0),0===this.previousLeftValue&&(this.parent.enableRtl?(this.leftValue=this.leftValue-this.parent.ganttChartModule.scrollObject.previousScroll.left,0===this.parent.ganttChartModule.scrollObject.previousScroll.left&&(this.leftValue=this.leftValue-60)):this.leftValue=this.leftValue-this.parent.ganttChartModule.scrollObject.previousScroll.left),this.previousLeftValue=h}else this.leftValue=this.taskBarEditRecord.ganttProperties.left;this.currentSegmentIndex=r,this.setItemPosition(),this.updateEditedItem(),this.tooltipValue=("touchmove"===e.type||"touchstart"===e.type||"touchend"===e.type?e.changedTouches[0]:e).pageX,this.taskBarEditRecord.ganttProperties.segments&&-1===r||this.editTooltip.updateTooltip(r),t&&this.taskBarEditedAction(e),this.parent.trigger("taskbarEditing",n,function(e){e.cancel&&null!==i.taskBarEditRecord&&(i.tapPointOnFocus=!1,I(i.taskBarEditRecord.ganttProperties,e.previousData))})}},DXt.prototype.updateMouseMoveProperties=function(e){var t=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),e=this.getCoordinate(e),i=this.parent.element.closest('[style*="zoom"]'),i=(i&&(i=parseFloat(getComputedStyle(i).zoom),e.pageX=e.pageX/i,e.pageY=e.pageY/i),(e.pageX||e.pageY)&&(this.parent.enableRtl?this.mouseMoveX=Math.abs(e.pageX-(t.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseMoveX=e.pageX-t.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseMoveX,this.mouseMoveY=e.pageY-t.top+this.parent.ganttChartModule.scrollObject.previousScroll.top),"ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction);(3<this.taskBarEditRecord.ganttProperties.width||this.taskBarEditRecord.ganttProperties.isMilestone)&&("ProgressResizing"!==this.taskBarEditAction||0!==this.taskBarEditRecord.ganttProperties.progress&&100!==this.taskBarEditRecord.ganttProperties.progress)||i?(e=0,e=this.parent.enableRtl?Math.abs(Math.abs(this.mouseMoveX)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left)+t.left):this.mouseMoveX-this.parent.ganttChartModule.scrollObject.previousScroll.left+t.left,i=this.mouseMoveY-this.parent.ganttChartModule.scrollObject.previousScroll.top+t.top,e+20>t.left+this.parent.ganttChartModule.chartBodyContainer.offsetWidth?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("right")):e+40>t.left+this.parent.ganttChartModule.chartBodyContainer.offsetWidth&&this.parent.enableRtl&&0===this.parent.ganttChartModule.scrollObject.previousScroll.left?(this.parent.ganttChartModule.scrollObject.previousScroll.left=-1,this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("right")):e-20<t.left?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("left")):i+80>t.top+this.parent.ganttChartModule.chartBodyContainer.offsetHeight?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("bottom")):i-20<t.top?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("top")):this.stopScrollTimer()):this.stopScrollTimer()},DXt.prototype.startScrollTimer=function(t){var i=this,n=(this.stopScrollTimer(),0);this.scrollTimer=window.setInterval(function(){var e;-1===Math.sign(i.timerCount)&&(n=-1,i.timerCount=Math.abs(i.timerCount)),"right"===t?(e=i.parent.enableTimelineVirtualization?i.parent.timelineModule.wholeTimelineWidth:i.parent.timelineModule.totalTimelineWidth,i.timerCount=i.timerCount+1>=e?e:i.timerCount+1):i.timerCount="bottom"===t?i.timerCount+1:i.timerCount-1<0?0:i.timerCount-1,"bottom"===t||"top"===t?i.parent.ganttChartModule.scrollObject.setScrollTop(i.timerCount):i.parent.ganttChartModule.scrollObject.setScrollLeft(i.timerCount,n),"ConnectorPointLeftDrag"!==i.taskBarEditAction&&"ConnectorPointRightDrag"!==i.taskBarEditAction||i.drawFalseLine()},0)},DXt.prototype.stopScrollTimer=function(){window.clearInterval(this.scrollTimer),this.scrollTimer=null},DXt.prototype.enableDragging=function(e){var t,i,n,o,r,s=this.taskBarEditRecord.ganttProperties,a=this.parent.enableTimelineVirtualization?this.parent.timelineModule.wholeTimelineWidth:this.parent.timelineModule.totalTimelineWidth,l=0;this.taskBarEditElement.classList.contains("e-segmented-taskbar")&&!this.taskBarEditElement.classList.contains("e-segment-first")?(i=(t=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return TXt({},e)}))[this.segmentIndex],this.mouseDownX>this.mouseMoveX?(l=je(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,i.left=i.left-l):(l=je(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,i.left=i.left+l),n=t[this.segmentIndex-1],o=t[this.segmentIndex+1],r=void 0,r=this.taskBarEditElement.classList.contains("e-segment-inprogress")?i.left<n.left+n.width?n.left+n.width:i.width+i.left>o.left?o.left-i.width:i.left:i.left<n.left+n.width?n.left+n.width:s.left+i.width+i.left>=a?a-i.width:i.left,i.left=r,this.parent.setRecordValue("segments",t,s,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")):(this.mouseDownX>this.mouseMoveX?0<(l=this.mouseDownX-this.mouseMoveX)&&this.parent.setRecordValue("left",this.previousItem.left-l,s,!0):(l=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("left",this.previousItem.left+l,s,!0)),r=s.left<0?0:s.left+s.width>=a?a-s.width:s.left,this.parent.setRecordValue("left",r,s,!0))},DXt.prototype.validateProgressWidth=function(e,t,i){if(-1!==this.currentSegmentIndex&&e.segments){var n=this.currentSegmentIndex>=this.segmentIndex?0:0!==this.currentSegmentIndex?this.currentSegmentIndex:-1,o=this.currentSegmentIndex>=this.segmentIndex?this.currentSegmentIndex:this.segmentIndex;if(-1!==n)for(var r=n;r<o;r++)t-=e.segments[r+1].left-(e.segments[r].left+e.segments[r].width)}return e.segments&&0<e.segments.length&&(i=this.splitTasksDuration(e.segments)*this.parent.perDayWidth,i=e.segments.reduce(function(e,t){return e+t.width},0)),{progressWidth:t=i<t?i:t,totalTaskWidth:i}},DXt.prototype.performProgressResize=function(e,t){var i=this.taskBarEditRecord.ganttProperties,n=0,o=i.progressWidth,n=(this.mouseDownX>this.mouseMoveX?this.mouseMoveX>i.left&&this.mouseMoveX<i.left+i.width&&0<i.left?(n=this.mouseMoveX-i.left,this.parent.setRecordValue("progressWidth",n,i,!0)):this.mouseMoveX>=i.left+i.width?this.parent.setRecordValue("progressWidth",i.width,i,!0):this.parent.setRecordValue("progressWidth",0,i,!0):this.mouseMoveX>i.left&&this.mouseMoveX<i.left+i.width?(n=this.mouseMoveX-i.left,this.parent.setRecordValue("progressWidth",n,i,!0)):this.mouseMoveX<=i.left?this.parent.setRecordValue("progressWidth",0,i,!0):this.parent.setRecordValue("progressWidth",i.width,i,!0),i.progressWidth>i.width?i.width:i.progressWidth,i.progressWidth<0?0:i.progressWidth),t=(-1===t&&t?this.parent.setRecordValue("progressWidth",o,i,!0):this.parent.setRecordValue("progressWidth",n,i,!0),this.progressValue=n,i.width-i.progressWidth);this.progressBorderRadius=t<=4?4-t:0},DXt.prototype.enableLeftResizing=function(e){var t=this.taskBarEditRecord.ganttProperties,i=0;this.taskBarEditElement.classList.contains("e-segmented-taskbar")&&1<t.segments.length?this.enableSplitTaskLeftResize(t):(this.mouseDownX>this.mouseMoveX?this.mouseMoveX<t.left+t.width?(i=this.mouseDownX-this.mouseMoveX,0<t.left&&(this.parent.setRecordValue("left",this.previousItem.left-i,t,!0),this.parent.setRecordValue("width",this.previousItem.width+i,t,!0))):this.mouseMoveX>t.left+t.width&&(i=this.mouseDownX-this.mouseMoveX,this.parent.setRecordValue("left",this.previousItem.left-i,t,!0),this.parent.setRecordValue("width",3,t,!0)):this.mouseMoveX<t.left+t.width?(i=this.mouseMoveX-this.mouseDownX,t.left<t.left+t.width&&this.previousItem.left+i<=this.previousItem.left+this.previousItem.width&&(this.parent.setRecordValue("left",this.previousItem.left+i,t,!0),this.parent.setRecordValue("width",this.previousItem.width-i,t,!0))):(i=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("left",this.previousItem.left+i,t,!0),this.parent.setRecordValue("width",3,t,!0)),t.segments&&1===t.segments.length&&(t.segments[0].width=t.width),this.updateEditPosition(e,t),this.parent.setRecordValue("left",this.previousItem.left+this.previousItem.width-t.width,t,!0))},DXt.prototype.enableSplitTaskLeftResize=function(e){var t=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return TXt({},e)}),i=t[this.segmentIndex],n=0;if(this.mouseDownX>this.mouseMoveX)if(this.mouseMoveX<e.left+i.width+i.left){var o,n=je(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX;if(this.previousMouseMove=this.mouseMoveX,0<i.left)i.left=i.left-n,i.width=i.width+n,0!==this.segmentIndex&&(o=t[this.segmentIndex-1],e.left+i.left<e.left+o.left+o.width)&&(o=e.left+o.left+o.width-(e.left+i.left),i.width-=o,i.left=i.left+o);else if(i.left<=0&&0===this.segmentIndex){this.parent.setRecordValue("left",e.left-n,e,!0),this.parent.setRecordValue("width",e.width+n,e,!0),i.width=i.width+n;for(var r=1;r<e.segments.length;r++){var s=t[r];s.left=s.left+n}}}else this.mouseMoveX>e.left+i.width+i.left&&(n=je(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,i.left=i.left-n,i.width=this.parent.perDayWidth);else if(this.mouseMoveX<e.left+i.width+i.left-this.parent.perDayWidth)if(n=je(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,0===this.segmentIndex&&i.left<=0){this.parent.setRecordValue("left",e.left+n,e,!0),this.parent.setRecordValue("width",e.width-n,e,!0),i.width=i.width-n;for(r=1;r<e.segments.length;r++){var a=t[r];a.left=a.left-n}}else i.left<i.left+i.width&&i.left+n<=i.left+i.width&&(i.left=i.left+n,i.width=i.width-n);else if(this.mouseMoveX<e.left+i.left+i.width&&i.width>this.parent.perDayWidth)if(n=je(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,n-=i.width-n<this.parent.perDayWidth?this.parent.perDayWidth>i.width?this.parent.perDayWidth-i.width:i.width-this.parent.perDayWidth:0,0===this.segmentIndex){this.parent.setRecordValue("width",e.width-n,e,!0),this.parent.setRecordValue("left",e.left+n,e,!0),i.width=i.width-n;for(r=1;r<e.segments.length;r++){var l=t[r];l.left=l.left-n}}else i.left=i.left+n,i.width=i.width-n;this.parent.setRecordValue("segments",t,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},DXt.prototype.updateEditPosition=function(e,t){this.updateIsMilestone(t),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.width,t.progress),t,!0)},DXt.prototype.updateIsMilestone=function(e){e.width<=3?(this.parent.setRecordValue("width",3,e,!0),this.parent.setRecordValue("isMilestone",!0,e,!0),je(this.taskBarEditRecord[this.parent.taskFields.milestone])||this.parent.setRecordValue(this.parent.taskFields.milestone,!0,this.taskBarEditRecord,!0)):(this.parent.setRecordValue("width",e.width,e,!0),this.parent.setRecordValue("isMilestone",!1,e,!0),je(this.taskBarEditRecord[this.parent.taskFields.milestone])||this.parent.setRecordValue(this.parent.taskFields.milestone,!1,this.taskBarEditRecord,!0))},DXt.prototype.enableRightResizing=function(e){var t,i,n,o,r=this.taskBarEditRecord.ganttProperties,s=0;this.taskBarEditElement.classList.contains("e-segmented-taskbar")&&1<r.segments.length?(i=(t=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return TXt({},e)}))[this.segmentIndex],n=void(this.mouseDownX>this.mouseMoveX?this.mouseMoveX>r.left+i.left&&3<this.mouseDownX-this.mouseMoveX?(s=je(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,i.width=i.width-s):this.mouseMoveX<r.left+i.left&&(n=this.parent.timelineModule.isSingleTier&&("Hour"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit||"Hour"===this.parent.timelineModule.customTimelineSettings.topTier.unit||"Minutes"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit||"Minutes"===this.parent.timelineModule.customTimelineSettings.topTier.unit)||"Hour"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit||"Minutes"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit?this.parent.timelineModule.customTimelineSettings.timelineUnitSize:this.parent.perDayWidth,i.width=n):this.mouseMoveX>i.left&&(s=je(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,i.width=i.width+s)),je(o=this.segmentIndex!==t.length-1?t[this.segmentIndex+1]:null)||(this.taskBarEditElement.classList.contains("e-segment-last")||(n=i.left+i.width>o.left?o.left-i.left:i.width),i.width=n),this.segmentIndex===r.segments.length-1&&0===this.segmentIndex&&this.parent.setRecordValue("width",i.width,r,!0),this.parent.setRecordValue("segments",t,r,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")):(this.mouseDownX>this.mouseMoveX?this.mouseMoveX>r.left&&3<this.mouseDownX-this.mouseMoveX?(s=this.mouseDownX-this.mouseMoveX,this.parent.setRecordValue("width",this.previousItem.width-s,r,!0)):this.mouseMoveX<r.left&&this.parent.setRecordValue("width",3,r,!0):this.mouseMoveX>r.left&&(s=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("width",this.previousItem.width+s,r,!0)),r.segments&&1===r.segments.length&&(r.segments[0].width=r.width),this.updateEditPosition(e,r))},DXt.prototype.updateEditedItem=function(){var e,t,i,n=this.taskBarEditRecord.ganttProperties;switch(this.taskBarEditAction){case"ProgressResizing":var o=n.progressWidth,r=n.width,o=this.validateProgressWidth(n,o,r);this.parent.setRecordValue("progress",this.getProgressPercent(o.totalTaskWidth,o.progressWidth),n,!0);break;case"LeftResizing":-1===this.segmentIndex?(t=this.getRoundOffStartLeft(n,this.roundOffDuration),r=this.getDateByLeft(t),je(n.endDate)&&(i=this.parent.dateValidationModule.getValidEndDate(n),this.parent.setRecordValue("endDate",i,n,!0)),e=this.parent.dateValidationModule.checkStartDate(r,n,null),this.parent.setRecordValue("startDate",new Date(e.getTime()),n,!0),0===this.parent.dateValidationModule.compareDates(n.startDate,n.endDate)&&je(n.isMilestone)&&!1===n.isMilestone&&0===n.duration&&this.parent.setRecordValue("duration",1,n,!0),n.isMilestone&&this.parent.setRecordValue("endDate",new Date(e.getTime()),n,!0),this.parent.dateValidationModule.calculateDuration(this.taskBarEditRecord),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")):this.updateSplitLeftResize(n);break;case"RightResizing":case"ParentResizing":-1===this.segmentIndex?(t=this.getRoundOffEndLeft(n,this.roundOffDuration),o=this.getDateByLeft(t),je(n.startDate)&&(e=this.parent.dateValidationModule.getValidStartDate(n),this.parent.setRecordValue("startDate",e,n,!0)),r=je(n.startDate)?e:n.startDate,i=n.isMilestone?r:this.parent.dateValidationModule.checkEndDate(o,this.taskBarEditRecord.ganttProperties),this.parent.setRecordValue("endDate",new Date(i.getTime()),n,!0),this.parent.dateValidationModule.calculateDuration(this.taskBarEditRecord),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")):this.updateSplitRightResizing(n);break;case"ParentDrag":case"ChildDrag":case"MilestoneDrag":case"ManualParentDrag":-1===this.segmentIndex||0===this.segmentIndex||-1!==this.segmentIndex&&this.parent.allowTaskbarDragAndDrop?this.updateChildDrag(n):this.setSplitTaskDrag(n)}je(this.taskBarEditRecord.ganttProperties.segments)||this.parent.chartRowsModule.updateSegment(this.taskBarEditRecord.ganttProperties.segments,this.taskBarEditRecord.ganttProperties.taskId)},DXt.prototype.updateChildDrag=function(e){var t,i=this.getRoundOffStartLeft(e,this.roundOffDuration),i=this.getDateByLeft(i,e.isMilestone,e);0===this.segmentIndex?(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(i,e,null),e,!0),e.segments[0].startDate=i,e.segments[0].endDate=this.parent.dataOperation.getEndDate(e.segments[0].startDate,e.segments[0].duration,e.durationUnit,e,!1),this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments"),this.parent.chartRowsModule.incrementSegments(e.segments,0,this.taskBarEditRecord),this.parent.setRecordValue("endDate",e.segments[e.segments.length-1].endDate,e,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,e.segments,this.taskBarEditRecord,!0)):!je(e.endDate)&&je(e.startDate)?(t=this.parent.dateValidationModule.checkStartDate(i,e,null),t=this.parent.dateValidationModule.checkEndDate(t,this.taskBarEditRecord.ganttProperties),this.parent.setRecordValue("endDate",t,e,!0)):(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(i,e,null),e,!0),je(e.duration)||this.parent.dateValidationModule.calculateEndDate(this.taskBarEditRecord))},DXt.prototype.updateSplitLeftResize=function(e){var t=e.segments[this.segmentIndex],i=0===this.segmentIndex?this.getRoundOffStartLeft(e,this.roundOffDuration):this.getRoundOffStartLeft(t,this.roundOffDuration),i=this.getDateByLeft(i),i=this.parent.dataOperation.checkStartDate(i,e,!1),n=this.parent.dataOperation.getDuration(i,t.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone);t.startDate=new Date(i.getTime()),t.duration=n,this.parent.setRecordValue("duration",this.sumOfDuration(e.segments),e,!0),0===this.segmentIndex&&this.parent.setRecordValue("startDate",t.startDate,e,!0),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration"),je(e.segments[this.segmentIndex-1])||(i=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex-1].endDate,e.segments[this.segmentIndex].startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone),t.offsetDuration=i),this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},DXt.prototype.updateSplitRightResizing=function(e){var t=e.segments[this.segmentIndex],i=this.getRoundOffEndLeft(e,this.roundOffDuration),i=this.getDateByLeft(i),i=this.parent.dataOperation.checkEndDate(i,e,!1),n=this.parent.dataOperation.getDuration(t.startDate,i,e.durationUnit,e.isAutoSchedule,e.isMilestone);t.endDate=new Date(i.getTime()),t.duration=n,je(e.segments[this.segmentIndex+1])||(i=e.segments[this.segmentIndex+1],n=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex].endDate,i.startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone),t.offsetDuration=n),this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments"),this.parent.setRecordValue("duration",this.sumOfDuration(e.segments),e,!0),this.parent.setRecordValue("endDate",e.segments[e.segments.length-1].endDate,e,!0),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")},DXt.prototype.sumOfDuration=function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i].duration;return t},DXt.prototype.setSplitTaskDrag=function(e){var t,i=e.segments[this.segmentIndex],n=this.getRoundOffStartLeft(i,this.roundOffDuration),n=this.getDateByLeft(n),n=this.parent.dateValidationModule.checkStartDate(n,e,null),n=(i.startDate=n,this.parent.dataOperation.getEndDate(i.startDate,i.duration,e.durationUnit,e,!1));e.segments[this.segmentIndex+1]&&n.getTime()>e.segments[this.segmentIndex+1].startDate.getTime()?i.endDate=e.segments[this.segmentIndex+1].startDate:i.endDate=n,i.duration=this.parent.dataOperation.getDuration(i.startDate,i.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone),this.parent.setRecordValue("duration",this.sumOfDuration(e.segments),e,!0),this.parent.setRecordValue("endDate",e.segments[e.segments.length-1].endDate,e,!0),je(this.parent.taskFields.endDate)||this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"endDate"),je(e.segments[this.segmentIndex-1])||(t=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex-1].endDate,e.segments[this.segmentIndex].startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone),1!==i.startDate.getDay()||0!==t||this.parent.includeWeekend||(t=1),i.offsetDuration=t),je(e.segments[this.segmentIndex+1])||(n=e.segments[this.segmentIndex+1],t=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex].endDate,n.startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone),1!==n.startDate.getDay()||0!==t||this.parent.includeWeekend||(t=1),n.offsetDuration=t),this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},DXt.prototype.getRoundOffEndLeft=function(e,t){var i="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier,n=e.width+e.left,e=(-1!==this.segmentIndex&&1<e.segments.length&&(o=e.segments[this.segmentIndex],n=n-e.width+o.width+o.left),1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(n),1,"Day")/864e5)),o=this.parent.perDayWidth-this.parent.perDayWidth/e,r=o/this.parent.perDayWidth;return(t=void 0===t?!1:t)?"Hour"===i?(t=this.parent.perDayWidth/24,e=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(n),1,"Hour")/36e5),0!==(o=this.parent.perDayWidth/24-this.parent.perDayWidth/24/e)&&(n=n-o+t)):"Minutes"===i?(t=this.parent.perDayWidth/1440,e=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(n),1,"Minutes")/6e4),0!==(o=this.parent.perDayWidth/1440-this.parent.perDayWidth/1440/e)&&(n=n-o+t)):0!==o&&(n=n-o+this.parent.perDayWidth):"Hour"!==i&&"Minutes"!==i&&(.5<r?n=n-o+this.parent.perDayWidth:r<.5&&(n=n-o+this.parent.perDayWidth/2)),n},DXt.prototype.getRoundOffStartLeft=function(e,t){je(e);var i=e.left,n=(-1!==this.segmentIndex&&je(e.segments)&&(i=e.left+this.taskBarEditRecord.ganttProperties.left),"None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier),e=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(i,je(e)?e.isMilestone:null,e),1,"Day")/864e5),o=this.parent.perDayWidth-this.parent.perDayWidth/e,r=o/this.parent.perDayWidth;return(t=void 0===t?!1:t)?"Hour"===n?(e=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(i),1,"Hour")/36e5),i-=o=this.parent.perDayWidth/24-this.parent.perDayWidth/24/e):"Minutes"===n?(e=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(i),1,"Minutes")/6e4),i-=o=this.parent.perDayWidth/1440-this.parent.perDayWidth/1440/e):i-=o:"Hour"!==n&&"Minutes"!==n&&(r<=.5?i-=o:.5<r&&(i=i-o+this.parent.perDayWidth/2)),i},DXt.prototype.getDateByLeft=function(e,t,i){var n=new Date(this.parent.timelineModule.timelineStartDate.toString()),o=864e5/this.parent.perDayWidth,r=new Date(n),e=(r.setTime(r.getTime()+e*o),this.parent.isInDst(r)?n.setTime(n.getTime()+(e-this.parent.perDayWidth/24)*o):n.setTime(n.getTime()+e*o),t&&!je(i.predecessorsName)&&""!==i.predecessorsName&&(r=this.parent.getCurrentDayEndTime(i.isAutoSchedule?i.autoEndDate:i.endDate),this.parent.dateValidationModule.setTime(r,n),n=this.parent.dateValidationModule.checkStartDate(n,i,!0)),"None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.topTier:this.parent.timelineModule.bottomTier);return"Hour"!==e&&"Minutes"!==e&&this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&!this.parent.isInDst(n)&&n.setTime(n.getTime()+36e5),n},DXt.prototype.setItemPosition=function(){je(this.editElement)||(n=this.editElement.parentElement,this.parent.allowTaskbarDragAndDrop&&"ChildDrag"===this.taskBarEditAction?n.style.position=null:this.parent.enableTimelineVirtualization&&this.parent.timelineModule.wholeTimelineWidth>3*this.parent.element.offsetWidth?n.style.setProperty("position","relative"):n.style.setProperty("position","absolute"));var e,t=this.taskBarEditRecord.ganttProperties,i=this.parent.enableRtl?"right":"left",n=je(t.segments)?null:t.segments[this.segmentIndex],o="MilestoneDrag"===this.taskBarEditAction||t.isMilestone?this.parent.chartRowsModule.milestoneHeight:t.width,r=this.parent.isAdaptive?o-2:o-10,s=(je(n)||(r=this.parent.isAdaptive?n.width-2:n.width-10),this.taskBarEditElement.style.setProperty("opacity",".75"),e=this.parent.allowTaskbarDragAndDrop&&!t.isAutoSchedule&&this.taskBarEditRecord.hasChildRecords||this.taskBarEditElement.classList.contains(Rqt)?this.taskBarEditElement:"ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||0!==this.segmentIndex?z(this.taskBarEditElement,"tr."+Uqt).querySelector("."+Rqt):this.taskBarEditElement.parentElement,!(!this.taskBarEditElement.classList.contains("e-segmented-taskbar")&&!this.taskBarEditElement.querySelector(".e-segmented-taskbar"))),a=this.taskBarEditElement.querySelector("."+tGt),l=this.taskBarEditElement.querySelector("."+eGt),h=(s?oqt(this.taskBarEditElement,Rqt):this.taskBarEditElement).querySelector("."+Yqt),d=this.taskBarEditElement.querySelector("."+Gqt),p=this.taskBarEditElement.querySelector("."+aGt),c=this.taskBarEditElement.querySelector("."+lGt),u=this.taskBarEditElement.querySelector("."+EGt),g=e.querySelector("."+EGt),m=this.taskBarEditElement,f=this.taskBarEditElement.querySelector("."+nGt),y=(this.taskBarEditElement.querySelector("."+sGt),this.taskBarEditElement.querySelector(".e-gantt-manualparenttaskbar-left"),this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-taskbar-resize-div"));if(this.parent.allowTaskbarDragAndDrop&&!this.updatePosition&&(this.leftValue=this.leftValue+30,this.updatePosition=!0),"ConnectorPointRightDrag"!==this.taskBarEditAction&&"ConnectorPointLeftDrag"!==this.taskBarEditAction){if("ParentResizing"!==this.taskBarEditAction&&"ManualParentDrag"!==this.taskBarEditAction){if(!s||je(t.segments)||"RightResizing"!==this.taskBarEditAction&&0===this.segmentIndex||(je(y)||(!this.parent.allowTaskbarDragAndDrop||this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&"ChildDrag"!==this.taskBarEditAction&&"ParentDrag"!==this.taskBarEditAction)&&(y.style.width=n.width+"px"),this.taskBarEditElement.style.width=n.width+"px",this.parent.enableRtl?this.taskBarEditElement.style.right=n.left+"px":(this.taskBarEditElement.style.left=n.left+"px",je(y)||(!this.parent.allowTaskbarDragAndDrop||this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&"ChildDrag"!==this.taskBarEditAction&&"ParentDrag"!==this.taskBarEditAction)&&(y.style.left=n.left+this.editElement.parentElement.offsetLeft+"px"))),e.style.setProperty(i,(this.parent.allowTaskbarDragAndDrop?this.leftValue:t.left)+"px"),e.style.width=o+"px",s&&g&&(g.style.left=(this.parent.isAdaptive?o+10:o+2)+"px"),this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&"LeftResizing"!==this.taskBarEditAction&&"RightResizing"!==this.taskBarEditAction&&"ProgressResizing"!==this.taskBarEditAction&&(g=this.parent.taskbarHeight/2,e.style.setProperty("top",this.topValue+g+"px"),e.style.zIndex="4"),"LeftResizing"===this.taskBarEditAction&&0===this.segmentIndex){this.taskBarEditElement.style.setProperty("opacity",".75");for(var v=this.taskBarEditElement.parentElement.getElementsByClassName("e-segmented-taskbar"),b=0;b<t.segments.length;b++){var w=t.segments[b],C=v[b];C.style.width=w.width+"px",1===t.segments.length?(y.style.width=w.width+"px",y.style.setProperty(i,t.left+"px")):(0===b&&(y.style.width=w.width+"px",y.style.setProperty(i,w.left+t.left+"px")),this.parent.enableRtl?C.style.right=w.left+"px":C.style.left=w.left+"px")}}"ChildDrag"===this.taskBarEditAction&&(0===this.segmentIndex||-1!==this.segmentIndex&&this.parent.allowTaskbarDragAndDrop)&&(y.style.width=o+"px",y.style.setProperty(i,t.left+"px"),e.style.setProperty("opacity",".75"))}if(u&&(this.parent.enableRtl?u.style.left=(this.parent.isAdaptive?o+10:o-2)+"px":u.style.left=(this.parent.isAdaptive?o+10:o+2)+"px"),u&&"LeftResizing"===this.taskBarEditAction&&(u.style.left=o-2+"px"),h&&a&&("LeftResizing"===this.taskBarEditAction||"RightResizing"===this.taskBarEditAction||"ChildDrag"===this.taskBarEditAction||"ParentDrag"===this.taskBarEditAction)&&(h.style.display="none",a.style.display="none"),u&&"ProgressResizing"===this.taskBarEditAction&&(u.style.display="none"),"MilestoneDrag"===this.taskBarEditAction||t.isMilestone)e.style.setProperty(i,(this.parent.allowTaskbarDragAndDrop?this.leftValue:t.left-o/2)+"px"),y.style.setProperty(i,t.left-o/2+"px"),y.style.width=o+"px";else if("ProgressResizing"===this.taskBarEditAction)if(-1===this.segmentIndex)l.style.setProperty(i,t.left+t.progressWidth-10+"px"),je(a)||(a.style.width=t.progressWidth+"px",a.style.borderBottomRightRadius=this.progressBorderRadius+"px",a.style.borderTopRightRadius=this.progressBorderRadius+"px",g=this.parent.enableRtl?t.progressWidth+8:t.progressWidth-8,h.style.setProperty(i,g+"px"));else{this.updateSegmentProgress(this.taskBarEditRecord.ganttProperties);for(var S=e.querySelectorAll(".e-gantt-child-progressbar"),A=0;A<S.length;A++)t.segments[A]&&t.segments[A].progressWidth&&this.segmentIndex!==A&&(S[A].style.display="block",S[A].style.width=t.segments[A].progressWidth+"px");a.style.width=t.segments[this.segmentIndex].progressWidth+"px",a.style.borderBottomRightRadius=this.progressBorderRadius+"px",a.style.borderTopRightRadius=this.progressBorderRadius+"px";u=this.parent.enableRtl?this.progressValue+8:this.progressValue-8;h.style.setProperty(i,u+"px")}else"RightResizing"!==this.taskBarEditAction||je(l)?"ParentDrag"===this.taskBarEditAction?(y.style.setProperty(i,t.left+"px"),y.style.width=o+"px",y.style.width=t.width+"px",je(p)||(p.style.width=o+"px",y.style.width=t.width+"px"),je(a)||je(c)||(c.style.width=t.progressWidth+"px")):"ParentResizing"===this.taskBarEditAction?(y.style.width=t.width+"px",y.style.setProperty(i,t.left+"px"),m.style.setProperty("width",t.width+"px"),f.style.setProperty("width",t.width+"px"),this.editElement.parentElement.style.setProperty("width",t.width+"px")):"ManualParentDrag"===this.taskBarEditAction?(y.style.width=t.width+"px",y.style.setProperty(i,t.left+"px"),m.style.setProperty(i,t.left-t.autoLeft+"px"),this.parent.allowTaskbarDragAndDrop&&(m.style.setProperty(i,this.leftValue+"px"),m.style.setProperty("top",this.topValue+"px"),m.style.zIndex="4")):(je(l)||s||(l.style.width=t.width+"px",l.style.left=t.left+"px",this.taskBarEditElement.style.width=t.width+"px",this.taskBarEditElement.style.left=(this.parent.allowTaskbarDragAndDrop?this.leftValue:t.left)+"px",y.style.setProperty(i,t.left+"px"),y.style.width=t.width+"px"),je(a)||(d.style.setProperty(i,r+"px"),a.style.width=t.progressWidth+"px",je(h))||h.style.setProperty(i,t.progressWidth-10+"px"),s&&(d.style.setProperty(i,r+"px"),a.style.width=n.width+"px",je(h)||h.style.setProperty(i,n.width-10+"px"))):(y.style.width=o+"px",l.style.width=o+"px",je(a)||(a.style.width=t.progressWidth+"px",d.style.setProperty(i,r+"px"),je(h))||h.style.setProperty(i,t.progressWidth-10+"px"))}!this.parent.allowTaskbarDragAndDrop||"ChildDrag"!==this.taskBarEditAction&&"ParentDrag"!==this.taskBarEditAction&&"ManualParentDrag"!==this.taskBarEditAction&&"MilestoneDrag"!==this.taskBarEditAction||(g=this.parent.enableRtl?parseInt(y.style.right,10):parseInt(y.style.left,10),this.parent.enableRtl?y.style.right=g-30+"px":y.style.left=g+30+"px")},DXt.prototype.mouseUpHandler=function(e){var t,i,n,o=this.isMouseDragged;this.previousMouseMove=null,this.leftValue=0,this.previousLeftValue=0,this.editTooltip.showHideTaskbarEditTooltip(!1,this.segmentIndex),this.taskBarEditAction&&this.isMouseDragged&&(!this.dragMouseLeave&&this.taskBarEditedAction||this.parent.allowTaskbarDragAndDrop?("touchmove"===e.type||"touchstart"===e.type||"touchend"===e.type?(n=this.getCoordinate(e),this.droppedTarget=document.elementFromPoint(n.pageX,n.pageY)):(this.taskBarEditRecord.hasChildRecords&&!this.taskBarEditRecord.ganttProperties.isAutoSchedule?(n=this.parent.getOffsetRect(this.taskBarEditElement),t=!je(document.body.className)&&document.body.className.includes("e-bigger")?12:0,t=3+this.parent.chartRowsModule.connectorPointWidth+t,i=void 0,i=this.parent.enableRtl?Math.abs(n.left+t+1):Math.abs(Math.abs(n.left-t-1)-this.parent.ganttChartModule.scrollElement.scrollLeft),this.droppedTarget=document.elementFromPoint(i,e.y)):this.droppedTarget=document.elementFromPoint(e.x,e.y),this.droppedTarget&&this.droppedTarget.classList.contains("e-span-label")&&(this.droppedTarget=document.elementFromPoint(e.x+this.droppedTarget.offsetWidth,e.y))),this.previousIds=this.parent.ids.slice(),this.previousFlatData=this.parent.flatData.slice(),this.taskBarEditedAction(e),this.isMouseDragged=!1):(this.parent.isOnEdit=!1,this.cancelTaskbarEditActionInMouseLeave(),n=this.parent.criticalPathModule,this.parent.enableCriticalPath&&n&&n.criticalPathCollection&&n.criticalConnectorLine(n.criticalPathCollection,n.detailPredecessorCollection,!0,n.predecessorCollectionTaskIds))),!this.parent.enableMultiTaskbar||je(this.taskBarEditElement)||je(this.taskBarEditElement.querySelector(".e-gantt-child-taskbar"))||this.taskBarEditElement.querySelector(".e-gantt-child-taskbar").classList.contains("e-collapsed-taskbar-drag")&&(q([this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")],"e-collapsed-taskbar-drag"),this.taskBarEditElement.style.zIndex=this.prevZIndex,this.prevZIndex=""),this.parent.isAdaptive&&!o||this.initPublicProp(),this.stopScrollTimer()},DXt.prototype.taskBarEditedAction=function(e){var t={},i=this.mouseDownX,n=this.mouseDownY,o=this.taskBarEditRecord,r=this.parent.ganttChartModule.getIndexByTaskBar(this.taskBarEditElement),s=this.mouseMoveX,e=this.getCoordinate(e).pageY-this.parent.ganttChartModule.chartBodyContainer.offsetTop,a=("ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||this.drawPredecessor||(this.dependencyCancel=!0),[]);("ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction)&&this.drawPredecessor&&(!this.connectorSecondRecord.hasChildRecords||this.connectorSecondRecord.hasChildRecords&&this.parent.allowParentDependency)?(a.push(Pe([],[],[this.taskBarEditRecord],!0)[0]),this.parent.undoRedoModule&&(this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1].connectedRecords=a,this.parent.toolbarModule)&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!0),this.parent.connectorLineEditModule.updatePredecessor(this.connectorSecondRecord,this.finalPredecessor)):("ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction||this.oldData&&JSON.stringify(o.ganttProperties)===JSON.stringify(this.oldData.ganttProperties)?this.parent.undoRedoModule&&0<this.parent.undoRedoModule.getUndoCollection.length&&(this.parent.totalUndoAction--,this.parent.undoRedoModule.getUndoCollection.splice(this.parent.undoRedoModule.getUndoCollection.length-1,1),this.parent.toolbarModule)&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!1):this.parent.undoRedoModule&&this.parent.toolbarModule&&0<this.parent.undoRedoModule.getUndoCollection.length&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!0),(i!==s||Math.abs(n-e)>=(this.parent.rowHeight-this.parent.taskbarHeight)/2)&&null!==o&&(t.editingFields=o.ganttProperties,t.data=o,t.recordIndex=r,t.previousData=this.previousItem,t.taskBarEditAction=this.taskBarEditAction,t.action="TaskbarEditing",t.roundOffDuration=this.roundOffDuration,t.target=this.targetElement,this.taskbarEditedArgs=t,this.taskbarEdited(t))),this.parent.isProjectDateUpdated=!1},DXt.prototype.cancelTaskbarEditActionInMouseLeave=function(){this.parent.editModule.reUpdatePreviousRecords(!0)},DXt.prototype.updateSegmentProgress=function(e){for(var t=e.segments,i=!0,n=this.splitTasksDuration(t)*this.parent.perDayWidth,o=s=n*Math.ceil(e.progressWidth/n*100)/100,r=0;r<t.length;r++){var s,a=t[r];0!==r&&(s=a.left<=o?o-a.left:0),delete a.progressWidth,0<s&&s>a.width?(s-=a.width,a.progressWidth=a.width,a.showProgress=!1):i&&(a.progressWidth=s,a.showProgress=!0,s-=a.width,i=!1)}},DXt.prototype.taskbarEdited=function(e){var e=Pe({},e),t=e.data,i=t.ganttProperties,n=this.parent.flatData.indexOf(t);if((this.parent.allowTaskbarDragAndDrop&&"ChildDrag"===this.taskBarEditAction||"ParentDrag"===this.taskBarEditAction||"MilestoneDrag"===this.taskBarEditAction||"ManualParentDrag"===this.taskBarEditAction)&&0<this.dragMoveY&&("ResourceView"===this.parent.viewType&&!t.hasChildRecords||"ProjectView"===this.parent.viewType)&&(this.parent.rowDragAndDropModule&&(a=this.parent.currentViewData,this.taskBarEditRecord.parentItem&&a[this.taskBarEditRecord.parentItem.index]&&-1===this.parent.editedRecords.indexOf(a[this.taskBarEditRecord.parentItem.index])&&this.parent.editedRecords.push(a[this.taskBarEditRecord.parentItem.index]),this.removeChildBorder(),this.removeErrorElem(),d=void this.removetopOrBottomBorder(),this.updatePosition=!1,l=void(this.draggedRecordMarginTop=this.taskBarEditElement.style.marginTop),(l=je(this.droppedTarget)?l:z(this.droppedTarget,"tr."+Uqt))&&(d=a[a=Array.from(this.parent.ganttChartModule.getChartRows()).indexOf(l)],l=this.parent.getRootParent(d,0).index,h=this.parent.getRootParent(this.taskBarEditRecord,0).index,s={cancel:!1,data:this.taskBarEditRecord,fromIndex:this.taskBarEditRecord.index,dropIndex:d.index,dropPosition:this.parent.rowDragAndDropModule.dropPosition,dropRecord:d},this.parent.trigger("rowDrop",s),!s.cancel)&&d&&a!==n&&(l!==h||this.taskBarEditRecord.hasChildRecords&&d.hasChildRecords||!this.taskBarEditRecord.hasChildRecords)&&(s=this.parent.flatData.indexOf(d),a=void 0,a=("ProjectView"!==this.parent.viewType||je(this.parent.rowDragAndDropModule.dropPosition))&&(d.hasChildRecords||!d.parentItem&&0===d.childRecords.length)?"child":this.parent.rowDragAndDropModule.dropPosition,this.parent.rowDragAndDropModule&&("ResourceView"!==this.parent.viewType||"child"!==a||d.hasChildRecords||je(d.parentItem)||(this.parent.rowDragAndDropModule.dropPosition=a="Invalid"),a)&&this.parent.rowDragAndDropModule.reorderRows([n],s,a),this.dragMoveY=0),this.isClonedElement=!1),this.parent.showOverAllocation)&&this.parent.ganttChartModule.renderOverAllocationContainer(),"ProgressResizing"===e.taskBarEditAction)e.previousData.progress!==i.progress&&(l=e.data.ganttProperties.progressWidth,h=e.data.ganttProperties.width,d=this.validateProgressWidth(e.data.ganttProperties,l,h),this.parent.setRecordValue("progress",this.getProgressPercent(d.totalTaskWidth,d.progressWidth),i,!0),t.parentItem&&this.parent.editModule.updateParentProgress(t.parentItem),je(i.segments)||this.updateSegmentProgress(i));else{var o=e.data.ganttProperties.segments;if(!je(o)&&0<o.length&&("LeftResizing"===this.taskBarEditAction&&0!==this.segmentIndex||"ChildDrag"===this.taskBarEditAction&&0!==this.segmentIndex||"RightResizing"===this.taskBarEditAction)){var n=o[this.segmentIndex],r=this.taskBarEditRecord.ganttProperties,s=0===this.segmentIndex?null:o[this.segmentIndex-1],a=this.segmentIndex===o.length-1?null:o[this.segmentIndex+1],l=je(a)?this.parent.cloneProjectEndDate:new Date(a.startDate.getTime()),h=je(s)?this.parent.cloneProjectStartDate:new Date(s.endDate.getTime()),d=new Date(n.startDate.getTime()),p=new Date(n.endDate.getTime());if("Day"===this.parent.timelineModule.topTier&&"Hour"===this.parent.timelineModule.bottomTier?(d.setHours(d.getHours()-1),p.setHours(p.getHours()+1)):(d.setDate(d.getDate()),p.setDate(p.getDate())),this.parent.includeWeekend){if(l.setHours(0,0,0,0),h.setHours(0,0,0,0),d.setDate(d.getDate()-1),p.setDate(p.getDate()+1),d.setHours(0,0,0,0),p.setHours(0,0,0,0),d.getTime()<=h.getTime()&&!je(s)&&!je(n)){var c=[{firstSegmentIndex:s.segmentIndex,secondSegmentIndex:n.segmentIndex}];this.parent.chartRowsModule.mergeTask(r.taskId,c)}else if(p.getTime()>=l.getTime()&&this.segmentIndex!==o.length-1){var c=[{firstSegmentIndex:n.segmentIndex,secondSegmentIndex:a.segmentIndex}];this.parent.chartRowsModule.mergeTask(r.taskId,c)}else if(p.getTime()>=l.getTime()){n.endDate.setDate(this.parent.cloneProjectEndDate.getDate()-1),n.startDate=this.parent.dataOperation.getStartDate(n.endDate,n.duration,r.durationUnit,r);for(var u=o.length-2;0<=u;u--){var g,m=TXt({},o[u]);je(m)||((g=new Date(m.endDate)).setDate(g.getDate()-m.offsetDuration),m.endDate=g,m.startDate=this.parent.dataOperation.getStartDate(m.endDate,m.duration,r.durationUnit,r))}}}else p.getTime()<=l.getTime()&&this.segmentIndex!==o.length-1&&!this.parent.includeWeekend&&0===this.parent.dataOperation.getDuration(this.parent.dataOperation.checkStartDate(p,i,!1),l,i.durationUnit,!1,!1)?(c=[{firstSegmentIndex:n.segmentIndex,secondSegmentIndex:a.segmentIndex}],this.parent.chartRowsModule.mergeTask(r.taskId,c)):d.getTime()>=h.getTime()&&!je(s)&&!je(n)&&!this.parent.includeWeekend&&0===this.parent.dataOperation.getDuration(this.parent.dataOperation.checkEndDate(d,i,!1),h,i.durationUnit,!1,!1)&&(c=[{firstSegmentIndex:s.segmentIndex,secondSegmentIndex:n.segmentIndex}],this.parent.chartRowsModule.mergeTask(r.taskId,c))}this.parent.dataOperation.updateWidthLeft(e.data)}this.isDragged=!1,this.parent.dataOperation.updateTaskData(t),this.parent.editModule.initiateUpdateAction(e)},DXt.prototype.getProgressPercent=function(e,t){return Math.ceil(t/e*100)},DXt.prototype.drawFalseLine=function(){var e,t=this.mouseDownX,i=this.mouseDownY,n=this.mouseMoveX,o=this.mouseMoveY,r=Math.sqrt((t-n)*(t-n)+(i-o)*(i-o)),o=180*Math.atan2(o-i,n-t)/Math.PI,i="rotate("+(this.parent.enableRtl?-o:o)+"deg)",n=0,t=(je(document.querySelectorAll(".e-chart-row")[0])||(n=document.querySelectorAll(".e-chart-row")[0].offsetWidth),"ConnectorPointLeftDrag"===this.taskBarEditAction&&(e=this.parent.enableRtl?n-(this.elementOffsetLeft+this.parent.chartRowsModule.connectorPointWidth/2)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left):this.elementOffsetLeft-this.parent.chartRowsModule.connectorPointWidth/2-this.parent.ganttChartModule.scrollObject.previousScroll.left),"ConnectorPointRightDrag"===this.taskBarEditAction&&(e=this.parent.enableRtl?n-(this.elementOffsetLeft+this.elementOffsetWidth+this.parent.chartRowsModule.connectorPointWidth/2)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left):this.elementOffsetLeft+this.elementOffsetWidth+this.parent.chartRowsModule.connectorPointWidth/2-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left)),this.elementOffsetTop+this.elementOffsetHeight/2+this.parent.ganttChartModule.chartBodyContainer.offsetTop-this.parent.ganttChartModule.scrollObject.previousScroll.top);this.removeFalseLine(!1),this.falseLine=Q("div",{className:"e-gantt-false-line",id:"ganttfalseline"+this.parent.element.id,styles:"position: absolute;transform:"+i+";border-top-width: 1px;border-top-style: dashed;z-index: 5;width:"+(r-3)+"px;top:"+t+"px;"}),this.parent.enableRtl?(this.falseLine.style.left="auto",this.falseLine.style.right=e+"px",this.falseLine.style.transformOrigin="100% 0%"):(this.falseLine.style.right="auto",this.falseLine.style.left=e+"px",this.falseLine.style.transformOrigin="0% 100%"),this.parent.ganttChartModule.chartBodyContainer.appendChild(this.falseLine)},DXt.prototype.removeFalseLine=function(e){this.falseLine&&(ue(this.falseLine),this.falseLine=null,e)&&(this.elementOffsetLeft=0,this.elementOffsetTop=0,this.elementOffsetWidth=0,this.elementOffsetHeight=0,q(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+yGt),[SGt]))},DXt.prototype.updateConnectorLineSecondProperties=function(e){var e=this.getElementByPosition(e),t=oqt(e,Rqt),i=document.body.className.includes("e-bigger"),n=(this.connectorSecondAction=null,0);oqt(e,AGt)?(this.connectorSecondAction="ConnectorPointLeftDrag",this.toPredecessorText="Start"):oqt(e,xGt)?(this.connectorSecondAction="ConnectorPointRightDrag",this.toPredecessorText="Finish"):(this.connectorSecondAction=null,this.toPredecessorText=null),this.taskBarEditElement!==t&&this.taskBarEditElement!==this.highlightedSecondElement&&(this.parent.virtualScrollModule&&this.parent.enableVirtualization&&(n=this.parent.virtualScrollModule.getTopPosition()),(this.parent.virtualScrollModule&&this.parent.enableVirtualization&&!this.elementOffsetLeft||!this.parent.enableVirtualization)&&(this.parent.allowParentDependency&&this.taskBarEditElement.children[0].classList.contains("e-manualparent-main-container")?(this.elementOffsetLeft=this.realTaskbarElement.children[0].offsetLeft+this.realTaskbarElement.offsetLeft-(i?10:0),this.elementOffsetTop=this.realTaskbarElement.parentElement.offsetTop+this.realTaskbarElement.offsetHeight/3-5+this.taskBarEditElement.children[0].offsetTop+n):(this.elementOffsetLeft=this.realTaskbarElement.offsetLeft-(i?10:0),this.elementOffsetTop=this.realTaskbarElement.parentElement.offsetTop+this.realTaskbarElement.offsetHeight/3+n),this.elementOffsetWidth=this.realTaskbarElement.offsetWidth+(i?20:0),this.elementOffsetHeight=this.realTaskbarElement.offsetHeight),this.showHideTaskBarEditingElements(t,this.highlightedSecondElement,!0)),je(this.connectorSecondAction)&&!je(this.connectorSecondElement)&&(!this.connectorSecondRecord.hasChildRecords||this.connectorSecondRecord.hasChildRecords&&this.parent.allowParentDependency)&&(this.editTooltip.showHideTaskbarEditTooltip(!1,this.segmentIndex),q([this.connectorSecondElement.querySelector("."+AGt)],[DGt]),q([this.connectorSecondElement.querySelector("."+xGt)],[DGt])),this.connectorSecondElement=this.connectorSecondAction?t:null,this.highlightedSecondElement=t,this.connectorSecondRecord=je(this.connectorSecondElement)?null:this.parent.ganttChartModule.getRecordByTaskBar(this.connectorSecondElement)},DXt.prototype.triggerDependencyEvent=function(e,t){var i,n,o,r,s=this.parent.element.closest('[style*="zoom"]'),s=(s&&(s=parseFloat(getComputedStyle(s).zoom),i=e.pageY/s),this.taskBarEditRecord.ganttProperties),a=this.connectorSecondRecord?this.connectorSecondRecord.ganttProperties:null,l=this.getElementByPosition(e),h=l,d="ResourceView"===this.parent.viewType?s.taskId:s.rowUniqueID;"ConnectorPointLeftDrag"===this.taskBarEditAction?r=d+(this.parent.enableRtl?"F":"S"):"ConnectorPointRightDrag"===this.taskBarEditAction&&(r=d+(this.parent.enableRtl?"S":"F")),this.connectorSecondAction&&("ConnectorPointLeftDrag"===this.connectorSecondAction?(r+=this.parent.enableRtl?"F":"S",n=this.parent.enableRtl?"finish":"start"):"ConnectorPointRightDrag"===this.connectorSecondAction&&(r+=this.parent.enableRtl?"S":"F",n=this.parent.enableRtl?"start":"finish")),je(a)?this.drawPredecessor=!1:(a.predecessorsName?this.finalPredecessor=a.predecessorsName+","+r:this.finalPredecessor=r,d=this.parent.connectorLineEditModule.validatePredecessorRelation(this.connectorSecondRecord,this.finalPredecessor),r=this.parent.predecessorModule.calculatePredecessor(r,this.connectorSecondRecord),(o={}).fromItem=s,o.toItem=a,o.newPredecessorString=this.finalPredecessor,o.predecessor=r&&r[0],o.isValidLink=d,o.requestType="ValidateDependency",this.parent.trigger("actionBegin",o),je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||"ValidateDependency"===o.requestType?"ValidateDependency"!==o.requestType&&this.parent.showSpinner():this.parent.showMaskRow(),o.isValidLink=!(!d&&o.isValidLink)&&o.isValidLink,o.isValidLink?(this.editTooltip.toolTipObj||this.parent.isAdaptive||this.editTooltip.showHideTaskbarEditTooltip(!0,this.segmentIndex),je(this.editTooltip.toolTipObj)||(this.parent.connectorLineModule.tooltipTable.innerHTML="",this.parent.connectorLineModule.tooltipTable.appendChild(this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.parent.editModule.taskbarEditModule.taskBarEditRecord.ganttProperties.taskName,this.parent.editModule.taskbarEditModule.fromPredecessorText,"","")),(s=this.parent.connectorLineModule.tooltipTable.querySelector("#toPredecessor").querySelectorAll("td"))[1].innerText=a.taskName,s[2].innerText=this.parent.localeObj.getConstant(n),je(this.parent.connectorLineModule.tooltipTable.parentElement))||je(this.parent.connectorLineModule.tooltipTable.parentElement.parentElement)||(r=this.parent.connectorLineModule.tooltipTable.parentElement.parentElement).offsetTop+r.offsetHeight>i&&(r.style.top=e.pageY-r.offsetHeight-20+"px"),this.drawPredecessor=!0):(this.parent.isAdaptive?(l.classList.contains(AGt)||l.classList.contains(xGt))&&this.showHideActivePredecessors(!0):U([h],[DGt]),this.drawPredecessor=!1))},DXt.prototype.getCoordinate=function(e){var t={},i=e;return t.pageX=i.pageX,t.pageY=i.pageY,!e||"click"===e.type||"touchmove"!==(i=e).type&&"touchstart"!==i.type&&"touchend"!==i.type||(t.pageX=i.changedTouches[0].pageX,t.pageY=i.changedTouches[0].pageY),t},DXt.prototype.getElementByPosition=function(e){var t;return this.parent.isAdaptive?(t=this.getCoordinate(e),document.elementFromPoint(t.pageX-window.pageXOffset,t.pageY-window.pageYOffset)):e.target},DXt.prototype.multipleSelectionEnabled=function(){this.parent.selectionModule&&"Cell"!==this.parent.selectionSettings.mode&&"Multiple"===this.parent.selectionSettings.type&&this.parent.selectionModule.hidePopUp()},DXt.prototype.unWireEvents=function(){this.parent.isDestroyed||(this.parent.off("chartMouseDown",this.mouseDownHandler),this.parent.off("chartMouseUp",this.mouseUpHandler),this.parent.off("chartMouseLeave",this.mouseLeaveHandler),this.parent.off("chartMouseMove",this.mouseMoveAction),this.parent.off("chartMouseClick",this.mouseClickHandler))},DXt.prototype.destroy=function(){this.unWireEvents(),this.stopScrollTimer(),this.parent.editModule.taskbarEditModule=void 0},DXt);function DXt(e){var t=IXt.call(this,e)||this;return t.leftValue=0,t.previousLeftValue=0,t.isMouseDragged=!1,t.dependencyCancel=!1,t.isDragged=!1,t.editElement=null,t.elementOffsetLeft=0,t.elementOffsetTop=0,t.elementOffsetWidth=0,t.elementOffsetHeight=0,t.segmentIndex=-1,t.currentItemTop=0,t.currentItemPrevTop=0,t.topValue=0,t.draggedRecordMarginTop="0px",t.isClonedElement=!1,t.updatePosition=!1,t.tooltipValue=0,t.parent=e,t.initPublicProp(),t.wireEvents(),t.editTooltip=new SXt(t.parent,t),t}var MXt=function(){return(MXt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},kXt=(PXt.prototype.wireEvents=function(){this.parent.on("chartDblClick",this.dblClickHandler,this)},PXt.prototype.dblClickHandler=function(e){e=this.parent.ganttChartModule.getRecordByTarget(e);!je(e)&&this.parent.editModule&&this.parent.editSettings.allowEditing&&this.openEditDialog(e)},PXt.prototype.processDialogFields=function(){je(this.parent.editDialogFields)||this.parent.editDialogFields&&0===this.parent.editDialogFields.length?(this.updatedEditFields=this.getDefaultDialogFields(),this.updatedEditFields=this.validateDialogFields(this.updatedEditFields)):this.updatedEditFields=this.validateDialogFields(this.parent.editDialogFields),je(this.parent.addDialogFields)||this.parent.addDialogFields&&0===this.parent.addDialogFields.length?(this.updatedAddFields=this.getDefaultDialogFields(),this.updatedAddFields=this.validateDialogFields(this.updatedAddFields)):this.updatedAddFields=this.validateDialogFields(this.parent.addDialogFields)},PXt.prototype.validateDialogFields=function(e){for(var t=[],i=0,n=0;n<e.length;n++){var o=qP(e[n]);"General"!==o.type||!je(o.fields)&&0!==o.fields.length||(o.fields=this.getGeneralColumnFields()),"Dependency"===o.type&&je(this.parent.taskFields.dependency)||"Resources"===o.type&&je(this.parent.taskFields.resourceInfo)||"Notes"===o.type&&je(this.parent.taskFields.notes)||("Custom"!==o.type||!je(o.fields)&&0!==o.fields.length||(i+=1,o.fields=this.getCustomColumnFields()),1<i)||t.push(o)}return t},PXt.prototype.getGeneralColumnFields=function(){for(var e=[],t=0,i=Object.keys(this.parent.columnMapping);t<i.length;t++){var n=i[t];"dependency"!==n&&"resourceInfo"!==n&&"notes"!==n&&e.push(this.parent.columnMapping[n])}return e},PXt.prototype.getCustomColumnFields=function(){for(var e=[],t=0;t<this.parent.customColumns.length;t++)e.push(this.parent.customColumns[t]);return e},PXt.prototype.getDefaultDialogFields=function(){var e=[],t={},i=this.parent.taskFields,n=this.parent.columnMapping;return 0!==Object.keys(n).length&&(t.type="General",e.push(t)),je(R("dependency",n))||(!(t={})!==this.parent.columnByField[n.dependency.valueOf()].visible&&(t.type="Dependency"),e.push(t)),je(R("resourceInfo",n))||(!(t={})!==this.parent.columnByField[n.resourceInfo.valueOf()].visible&&(t.type="Resources"),e.push(t)),je(R("notes",n))||(!(t={})!==this.parent.columnByField[n.notes.valueOf()].visible&&(t.type="Notes"),e.push(t)),je(R("segments",i))||e.push(t={type:"Segments"}),0<this.parent.customColumns.length&&e.push(t={type:"Custom"}),e},PXt.prototype.openAddDialog=function(){this.isEdit=!1,this.editedRecord=this.composeAddRecord(),this.isFromAddDialog=!0,this.createDialog()},PXt.prototype.getMinimumStartDate=function(){var e=je(e=Sa.aggregates.min(this.parent.flatData,"ganttProperties.startDate"))?new Date(this.parent.timelineModule.timelineStartDate.getTime()):new Date(e.getTime());return e=this.parent.dateValidationModule.checkStartDate(e),new Date(e.getTime())},PXt.prototype.composeAddRecord=function(){for(var e={ganttProperties:{}},t=this.parent.ganttColumns,i=this.parent.taskFields,n=this.parent.editModule.getNewTaskId(),o=0;o<t.length;o++){var r=t[o].field;r===i.id?(e[r]=n,e.ganttProperties.rowUniqueID=e[r]):t[o].field===i.startDate?(je(e[i.endDate])?e[r]=this.getMinimumStartDate():e[r]=new Date(e[i.endDate]),this.parent.timezone&&(e[r]=this.parent.dateValidationModule.remove(e[r],this.parent.timezone)),e.ganttProperties.startDate=new Date(e[r])):t[o].field===i.endDate?(je(e[i.startDate])?e[r]=this.getMinimumStartDate():e[r]=new Date(e[i.startDate]),this.parent.timezone&&(e[r]=this.parent.dateValidationModule.remove(e[r],this.parent.timezone)),e.ganttProperties.endDate=new Date(e[r])):t[o].field===i.duration?(e[r]=1,e.ganttProperties.duration=e[r],e.ganttProperties.durationUnit=this.parent.durationUnit.toLocaleLowerCase()):t[o].field===i.name?(e[r]=this.localeObj.getConstant("addDialogTitle")+" "+n,e.ganttProperties.taskName=e[r]):t[o].field===i.progress?(e[r]=0,e.ganttProperties.progress=e[r]):t[o].field===i.work?(e[r]=0,e.ganttProperties.work=e[r]):t[o].field===i.type?(e[r]=this.parent.taskType,e.ganttProperties.taskType=e[r]):e[this.parent.ganttColumns[o].field]=""}return e.ganttProperties.isAutoSchedule="Auto"===this.parent.taskMode||"Manual"!==this.parent.taskMode&&!0!==e[i.manual],e},PXt.prototype.openToolbarEditDialog=function(){var e=this.parent;e.editModule&&e.editSettings.allowEditing&&(-1<this.parent.ganttChartModule.focusedRowIndex&&e.selectionModule&&e.selectionModule.selectRow(this.parent.ganttChartModule.focusedRowIndex,!1,!1),je(e=e.selectionModule?"Row"!==e.selectionSettings.mode&&"Both"!==e.selectionSettings.mode||1!==e.selectionModule.selectedRowIndexes.length?"Cell"===e.selectionSettings.mode&&1===e.selectionModule.getSelectedRowCellIndexes().length?e.updatedRecords[e.selectionModule.getSelectedRowCellIndexes()[0].rowIndex].ganttProperties.rowUniqueID:null:e.updatedRecords[e.selectionModule.selectedRowIndexes[0]].ganttProperties.rowUniqueID:null)||this.openEditDialog(e))},PXt.prototype.openEditDialog=function(e){var t=this.parent;je(e)||(je(e.ganttProperties)||("string"==typeof e.ganttProperties.taskId?this.numericOrString="stringedit":this.numericOrString="numericedit"),je(e.ganttProperties)&&!je(e)&&(isNaN(Number(e))||"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType?this.numericOrString="stringedit":this.numericOrString="numericedit")),"object"!=typeof e||je(e)?je(e)?-1<t.selectedRowIndex&&(this.rowData=t.currentViewData[t.selectedRowIndex],this.rowIndex=t.selectedRowIndex):(this.rowIndex=t.ids.indexOf(e.toString()),-1<this.rowIndex&&(this.rowData=t.flatData[this.rowIndex])):(this.rowIndex=this.parent.currentViewData.indexOf(e),-1<this.rowIndex&&(this.rowData=e)),this.isEdit=!0,"ResourceView"===this.parent.viewType&&0===this.rowData.level||0!==Object.keys(this.rowData).length&&(this.editedRecord=Pe({},{},this.rowData,!0),this.isFromEditDialog=!0,this.createDialog())},PXt.prototype.createDialog=function(){var i=this,e=this.parent,t={},n=(this.beforeOpenArgs.dialogModel=t,this.beforeOpenArgs.rowData=this.editedRecord,this.beforeOpenArgs.rowIndex=this.rowIndex,this.parent.isAdaptive?"":"600px"),n=this.parent.createElement("div",{id:e.element.id+"_dialog",styles:"max-width:"+n}),e=(n.classList.add("e-gantt-dialog"),e.element.appendChild(n),t.animationSettings={effect:"None"},t.header=this.localeObj.getConstant(this.isEdit?"editDialogTitle":"addDialogTitle"),t.isModal=!0,t.enableRtl=this.parent.enableRtl,t.allowDragging=!this.parent.isAdaptive&&!this.parent.enableAdaptiveUI,t.showCloseIcon=!0,this.parent.isAdaptive?{X:"top",Y:"left"}:{X:"center",Y:"center"});t.position=e,t.height=this.parent.isAdaptive?"100%":"auto",t.target=document.body,t.close=this.dialogClose.bind(this),t.closeOnEscape=!0,t.beforeClose=function(e){"escape"===e.closedBy&&"key-pressed"===e.event.name&&"INPUT"===e.event.target.nodeName&&(e.cancel=!0)},t.open=function(e){var e=R("element",e),t=e.querySelector("#"+i.parent.element.id+"GeneralTabContainer");t&&t.scrollHeight>t.offsetHeight&&t.classList.add("e-scroll"),0===i.tabObj.selectedItem&&i.tabObj.select(0),i.parent.isAdaptive&&(e.style.maxHeight="none"),i.parent.focusModule&&i.parent.focusModule.setActiveElement(e)},t.locale=this.parent.locale,t.buttons=[{buttonModel:{content:this.localeObj.getConstant("saveButton"),cssClass:"e-primary"},click:this.buttonClick.bind(this)},{buttonModel:{cssClass:"e-flat",content:this.localeObj.getConstant("cancel")},click:this.buttonClick.bind(this)}],this.createTab(t,n)},PXt.prototype.buttonClick=function(e){var t=e.target;if(t.style.pointerEvents="none",this.localeObj.getConstant("cancel").toLowerCase()===e.target.innerText.trim().toLowerCase())this.dialog&&!this.dialogObj.isDestroyed&&(this.CustomformObj=null,this.formObj=null,this.storeValidTab=null,this.customFieldColumn=[],this.taskFieldColumn=[],this.dialogObj.hide(),this.dialogClose());else if(this.CustomformObj&&!this.CustomformObj.validate())t.style.pointerEvents="";else{if(this.formObj)if(!this.formObj.validate())return void(t.style.pointerEvents="");if(this.storeDependencyTab||"Dependency"===this.firstOccuringTab){var i=void 0;if(i=("Dependency"===this.firstOccuringTab?e.target.closest("#"+this.parent.element.id+"_dialog"):this.storeDependencyTab).querySelector(".e-gridform"))if(!i.ej2_instances[0].validate())return void(t.style.pointerEvents="")}if(this.storeResourceTab||"Resources"===this.firstOccuringTab){i=void 0;if(i=("Resources"===this.firstOccuringTab?e.target.closest("#"+this.parent.element.id+"_dialog"):this.storeResourceTab).querySelector(".e-gridform"))if(!i.ej2_instances[0].validate())return void(t.style.pointerEvents="")}this.initiateDialogSave(),this.parent.updateDuration=!1,this.CustomformObj=null,this.formObj=null,this.storeValidTab=null,this.customFieldColumn=[],this.taskFieldColumn=[],t.style.pointerEvents="auto"}},PXt.prototype.dialogClose=function(){this.dialog&&this.resetValues(),je(this.parent.focusModule)||je(this.parent.focusModule.getActiveElement(!0))||this.parent.focusModule.getActiveElement(!0).focus()},PXt.prototype.resetValues=function(){this.isEdit=!1,this.isAddNewResource=!1,this.editedRecord={},this.parent.triggeredColumnName="",this.rowData={},this.rowIndex=-1,this.addedRecord=null,this.ganttResources=[],this.dialogEditValidationFlag=!1,this.isFromAddDialog=!1,this.isFromEditDialog=!1,this.parent.dataOperation.isDurationValueUpdated=!1,this.dialog&&!this.dialogObj.isDestroyed&&(this.destroyDialogInnerElements(),this.dialogObj.destroy(),ue(this.dialog))},PXt.prototype.destroyDialogInnerElements=function(){for(var e=this.parent,t=this.beforeOpenArgs.tabModel.items,i=0;i<t.length;i++){var n=t[i].content,o=n.getAttribute("id");je(o)&&""===o||("General"===(o=(o=o.replace(e.element.id,"")).replace("TabContainer",""))?this.destroyCustomField(n):"Dependency"===o||"Notes"===o||"Resources"===o?n.ej2_instances[0].destroy():-1!==o.indexOf("Custom")&&this.destroyCustomField(n))}},PXt.prototype.destroyCustomField=function(e){for(var t=e.childNodes,i=this.parent,n=0;n<t.length;n++){var o=t[n],r=o.querySelector('input[id^="'+i.element.id+'"]');r&&(r=r.id.replace(i.element.id,""),je(o=o.querySelector("#"+i.element.id+r).ej2_instances[0])||(je(r=i.columnByField[r])||je(r.edit)||!je(r.edit.params)?o.destroy():"string"==typeof(o=r.edit.destroy)?(o=FB(o,window))():r.edit.destroy()))}},PXt.prototype.destroy=function(){this.resetValues(),this.parent.isDestroyed||(this.parent.off("chartDblClick",this.dblClickHandler),this.parent.editModule.dialogModule=void 0)},PXt.prototype.getEditFields=function(){return this.isEdit?this.updatedEditFields:this.updatedAddFields},PXt.prototype.createTab=function(t,i){var n,o=this,r=this.parent,s={},e=[],a=this.getEditFields(),l=r.taskFields,h=a.length,d=(s.items=e,s.locale=this.parent.locale,s.enableRtl=this.parent.enableRtl,this.beforeOpenArgs.tabModel=s,0);if(0<h)for(var p=0;p<h;p++){var c=a[p],u={};if("General"===c.type){if(0===Object.keys(r.columnMapping).length)continue;je(c.headerText)&&(c.headerText=this.localeObj.getConstant("generalTab")),u.content="General",this.beforeOpenArgs[u.content]=this.getFieldsModel(c.fields)}else if("Segments"===c.type){if(je(l.segments))continue;je(c.headerText)&&(c.headerText=this.localeObj.getConstant("segments")),u.content="Segments",this.beforeOpenArgs[u.content]=this.getSegmentsModel(c.fields)}else if("Dependency"===c.type){if(je(l.dependency))continue;je(c.headerText)&&(c.headerText=this.localeObj.getConstant("dependency")),u.content="Dependency",this.beforeOpenArgs[u.content]=this.getPredecessorModel(c.fields)}else if("Resources"===c.type){if(je(l.resourceInfo))continue;je(c.headerText)&&(c.headerText=this.localeObj.getConstant("resourceName")),u.content="Resources",this.beforeOpenArgs[u.content]=this.getResourcesModel(c.fields)}else if("Notes"===c.type){if(je(l.notes))continue;je(c.headerText)&&(c.headerText=this.localeObj.getConstant("notes")),u.content="Notes",this.beforeOpenArgs[u.content]=this.getNotesModel(c.fields)}else{if(je(c.fields)||0===c.fields.length)continue;je(c.headerText)&&(c.headerText=this.localeObj.getConstant("customTab")),u.content="Custom"+d++,this.beforeOpenArgs[u.content]=this.getFieldsModel(c.fields)}u.header={text:c.headerText},e.push(u)}this.beforeOpenArgs.requestType=this.isEdit?"beforeOpenEditDialog":"beforeOpenAddDialog",this.parent.trigger("actionBegin",this.beforeOpenArgs,function(e){je(o.parent.loadingIndicator)||"Shimmer"!==o.parent.loadingIndicator.indicatorType?o.parent.showSpinner():o.parent.showMaskRow(),e.cancel?(e.cancel=!1,je(o.parent.loadingIndicator)||"Shimmer"!==o.parent.loadingIndicator.indicatorType?o.parent.hideSpinner():o.parent.hideMaskRow()):(o.renderTabItems(),s.selected=o.tabSelectedEvent.bind(o),s.height=o.parent.isAdaptive?"100%":"auto",s.overflowMode="Scrollable",o.tabObj=new k5(s),o.tabObj.isStringTemplate=!0,n=o.parent.createElement("div",{id:r.element.id+"_Tab"}),o.tabObj.appendTo(n),t.content=n,o.dialog=i,o.dialogObj=new pS(t),o.dialogObj.isStringTemplate=!0,o.dialogObj.appendTo(o.dialog),e={action:"OpenDialog",requestType:o.isEdit?"openEditDialog":"openAddDialog",data:o.beforeOpenArgs.rowData,element:o.dialog,cancel:!1},o.parent.treeGrid.grid.getColumns().some(function(e){return e.validationRules})&&(o.CustomformObj=null,o.formObj=null,o.storeValidTab=null,o.customFieldColumn=[],o.taskFieldColumn=[],o.changeFormObj(e.element)),o.parent.trigger("actionComplete",e,function(e){je(o.parent.loadingIndicator)||"Shimmer"!==o.parent.loadingIndicator.indicatorType?o.parent.hideSpinner():o.parent.hideMaskRow(),e.cancel&&o.resetValues()}))})},PXt.prototype.changeFormObj=function(e){var t;if(this.storeColumn||(this.storeColumn=this.parent.treeGrid.grid.getColumns()),this.taskfields||(this.taskfields=this.parent.taskFields.properties),this.storeValidTab||(this.storeValidTab=this.getFilteredDialogFields()),0!==this.customFieldColumn.length&&0!==this.taskFieldColumn.length||this.validateColumn(this.storeColumn,this.taskfields,this.storeValidTab),this.isFromAddDialog&&this.parent.addDialogFields&&0<this.parent.addDialogFields.length?"Resources"!==(t=this.parent.addDialogFields[0].type)&&"Dependency"!==t||(this.firstOccuringTab=t):this.isFromEditDialog&&this.parent.editDialogFields&&0<this.parent.editDialogFields.length&&("Resources"!==(t=this.parent.editDialogFields[0].type)&&"Dependency"!==t||(this.firstOccuringTab=t)),!this.CustomformObj||!this.formObj){var i=this.customFieldColumn,n=this.taskFieldColumn;if(!this.CustomformObj&&i&&0<i.length){for(var o={},r=0;r<i.length;r++){var s=i[r];s.visible&&s.validationRules&&(o[s.field]=s.validationRules)}0<Object.keys(o).length&&(this.CustomformObj=e.querySelector("#"+this.parent.element.id+"Custom0TabContainer"),this.CustomformObj)&&(this.CustomformObj=this.createFormObj(this.CustomformObj,o))}if(!this.formObj&&n&&0<n.length){for(o={},r=0;r<n.length;r++){var a=n[r];a.visible&&a.validationRules&&(o[a.field]=a.validationRules)}0<Object.keys(o).length&&(this.formObj=e.querySelector("#"+this.parent.element.id+"GeneralTabContainer"),this.formObj)&&(this.formObj=this.createFormObj(this.formObj,o))}}this.isFromAddDialog=!1,this.isFromEditDialog=!1},PXt.prototype.getFilteredDialogFields=function(){var e=this.isFromAddDialog?this.parent.addDialogFields:this.parent.editDialogFields;return 0!==e.length?e.filter(function(e){return"General"===e.type||"Custom"===e.type}):null},PXt.prototype.validateColumn=function(n,e,t){var o=this;t?t.forEach(function(e){var i="General"===e.type?o.taskFieldColumn:o.customFieldColumn;e.fields.forEach(function(e){var t=o.parent.getColumnByField(e,n);null!==t?i.push(t):i.push(o.parent.columnByField[e])})}):n.forEach(function(e){(-1!==o.parent.customColumns.indexOf(e.field)?o.customFieldColumn:o.taskFieldColumn).push(e)})},PXt.prototype.createFormObj=function(e,t){var n=this;return new nN(e,{rules:t,locale:this.parent.locale,validationComplete:function(e){n.validationComplete(e)},customPlacement:function(e,t){var i=e.getAttribute("name");i&&n.valErrorPlacement(e,t,i)}})},PXt.prototype.valErrorPlacement=function(e,t,i){var i=i+"-tooltip",n=this.getElemTable(e);n?(n=n.querySelector(".e-tip-content"))&&(n.innerHTML=t.outerHTML):this.createTooltip(e,t,i)},PXt.prototype.createTooltip=function(e,t,i,n){void 0===n&&(n="block");var o=document.getElementById(i),o=(o&&o.remove(),e.parentElement),e=(o&&(o.style.position="relative"),document.createElement("div")),n=(e.className="e-tooltip-wrap e-lib e-control e-popup e-griderror",e.style.display=n,e.style.zIndex="1000",i+"-label"),i=document.createElement("div"),r=(i.id=n,i.className="sr-only",document.createElement("div")),s=(r.className="e-tip-content",document.createElement("div")),t=(s.className="error-message",s.appendChild(t.cloneNode(!0)),document.createElement("div"));t.className="e-arrow-tip e-tip-top",t.appendChild(document.createElement("div")).className="e-arrow-tip-outer e-tip-top",t.appendChild(document.createElement("div")).className="e-arrow-tip-inner e-tip-top",e.setAttribute("aria-labelledby",n),r.appendChild(s),e.appendChild(r),e.appendChild(t),e.style.top="125%",e.style.left="50%",e.style.transform="translateX(-50%)",o&&(o.appendChild(i),o.appendChild(e))},PXt.prototype.getElemTable=function(e){e=e.parentElement;return e?e.querySelector(".e-tooltip-wrap"):null},PXt.prototype.validationComplete=function(e){var t=this.getElemTable(e.element);t&&("failure"===e.status?t.style.display="":t.style.display="none")},PXt.prototype.tabSelectedEvent=function(e){var t=this.parent,i=e.selectedContent.childNodes[0].id,n=this.parent.editModule.dialogModule,o=n.dialog,r=0<o.getElementsByClassName("e-editedbatchcell").length,o=0<o.getElementsByClassName("e-editedrow").length||0<o.getElementsByClassName("e-addedrow").length;n.storeResourceTab&&r?document.querySelector("#"+t.element.id+"ResourcesTabContainer_gridcontrol").ej2_instances[0].saveCell():n.storeDependencyTab&&o&&document.querySelector("#"+t.element.id+"DependencyTabContainer").ej2_instances[0].editModule.batchSave(),i===t.element.id+"DependencyTabContainer"&&(this.storeDependencyTab=e.selectedContent),i===t.element.id+"ResourcesTabContainer"&&(this.storeResourceTab=e.selectedContent),i===t.element.id+"Custom0TabContainer"&&this.parent.treeGrid.grid.getColumns().some(function(e){return e.validationRules})&&this.changeFormObj(e.selectedContent),i===t.element.id+"GeneralTabContainer"&&this.parent.treeGrid.grid.getColumns().some(function(e){return e.validationRules})&&this.changeFormObj(e.selectedContent),(this.parent.isAdaptive||this.parent.enableAdaptiveUI)&&this.responsiveTabContent(i,t),i===t.element.id+"ResourcesTabContainer"?this.resourceSelection(i):i===t.element.id+"NotesTabContainer"?document.getElementById(i).ej2_instances[0].refresh():i===t.element.id+"SegmentsTabContainer"&&(je(this.beforeOpenArgs.rowData.ganttProperties.startDate)?document.getElementById(i).ej2_instances[0].enableToolbarItems([this.parent.element.id+"SegmentsTabContainer_add"],!1):document.getElementById(i).ej2_instances[0].enableToolbarItems([this.parent.element.id+"SegmentsTabContainer_add"],!0))},PXt.prototype.responsiveTabContent=function(e,t){var t=document.getElementById(t.element.id+"_dialog_dialog-content"),i=t.clientHeight,t=(i-=t.querySelector(".e-tab-header").offsetHeight,document.querySelector("#"+e));t.classList.contains("e-grid")&&(i-=t.ej2_instances[0].getHeaderContent().offsetHeight,e=t.querySelector(".e-toolbar"))&&(i-=e.offsetHeight),t.parentElement.style.height=i+"px"},PXt.prototype.getFieldsModel=function(e){for(var t,i={},n=this.parent.columnByField,o=0;o<e.length;o++)e[o]===this.parent.taskFields.dependency||e[o]===this.parent.taskFields.resourceInfo||e[o]===this.parent.taskFields.notes||je(n[e[o]])||(t=e[o],this.createInputModel(n[t],i));return i},PXt.prototype.createInputModel=function(t,e){var i=this,n=this.parent,o=this.parent.locale,r=this.parent.taskFields,s={placeholder:t.headerText,floatLabelType:"Auto"};switch(je(this.parent.taskFields.id)||je(this.parent.columnMapping.id)||je(this.numericOrString)||r.id===t.field&&(t.editType=this.numericOrString),t.editType){case"booleanedit":var a={label:t.headerText,locale:o,enableRtl:this.parent.enableRtl};e[t.field]=a;break;case"defaultedit":case"stringedit":var a=s;a.enableRtl=this.parent.enableRtl,t.field!==n.columnMapping.duration&&t.field!==n.columnMapping.id&&t.field!==n.columnMapping.startDate&&t.field!==n.columnMapping.endDate||(a.change=function(e){i.isTriggered?i.parent.triggeredColumnName="":(t.field!==i.parent.taskFields.duration&&t.field!==i.parent.taskFields.work||i.isTriggered||(i.isTriggered=!0,i.parent.triggeredColumnName=t.field),i.validateScheduleFields(e,t,n))}),e[t.field]=s;break;case"numericedit":a=s;a.enableRtl=this.parent.enableRtl,r.progress===t.field&&(a.min=0,a.max=100),a.change=function(e){i.isTriggered?i.parent.triggeredColumnName="":(t.field!==i.parent.taskFields.duration&&t.field!==i.parent.taskFields.work||i.isTriggered||(i.isTriggered=!0,i.parent.triggeredColumnName=t.field),i.validateScheduleFields(e,t,n))},e[t.field]=a;break;case"datepickeredit":a=s;a.format=this.parent.getDateFormat(),a.enableRtl=this.parent.enableRtl,a.strictMode=!0,a.firstDayOfWeek=n.timelineModule.customTimelineSettings.weekStartDay,t.field!==n.columnMapping.startDate&&t.field!==n.columnMapping.endDate||(a.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent),a.change=function(e){i.validateScheduleFields(e,t,n)}),e[t.field]=a;break;case"datetimepickeredit":a=s;a.format=this.parent.getDateFormat(),a.enableRtl=this.parent.enableRtl,a.strictMode=!0,a.firstDayOfWeek=n.timelineModule.customTimelineSettings.weekStartDay,t.field!==n.columnMapping.startDate&&t.field!==n.columnMapping.endDate||(a.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent),a.change=function(e){i.validateScheduleFields(e,t,n)}),e[t.field]=a;break;case"dropdownedit":t.field!==n.columnMapping.type&&t.field!==n.columnMapping.manual||(s.dataSource=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}],s.fields={value:"Value"},(a=s).enableRtl=this.parent.enableRtl,a.change=function(e){t.field===r.manual&&(i.editedRecord.ganttProperties.isAutoSchedule=!e.value),i.validateScheduleFields(e,t,n)}),e[t.field]=s;break;case"maskededit":e[t.field]=s}return je(t.edit)||je(t.edit.params)||Pe(e[t.field],t.edit.params),e},PXt.prototype.validateScheduleFields=function(e,t,i){je(i.editModule.dialogModule.dialog)||(n=i.editModule.dialogModule.dialog);var n,o,r=null,s=i.editModule.dialogModule.editedRecord,a=null,l=null,h="ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids,d=this.parent.viewType;return je(e.element)?je(e.container)?je(e.event)||je(e.event.path)||je(e.event.path)[1]||(r=(o=e.event.path[1]).querySelector("input").getAttribute("id"),o=o.querySelector("#"+r)):(r=(o=e.container).querySelector("input").getAttribute("id"),o=o.querySelector("#"+r)):r=(o=e.element).getAttribute("id"),je(o)?(a=e.value,l=t.field):(a=o.value,l=r.replace(i.element.id,""),"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType&&(o={rules:((t={})[this.parent.taskFields.id]={required:!0,minLength:[function(e){return"ResourceView"===d?-1===h.indexOf("T"+e.value)&&-1===h.indexOf("R"+e.value):-1===h.indexOf(e.value)},"ID is already present, please enter new value"]},t)},new nN("#"+this.parent.element.id+"GeneralTabContainer",o))),0===l.search("Segments")?(l=l.replace("SegmentsTabContainer",""),this.validateSegmentFields(i,l,a,e)):(this.validateScheduleValuesByCurrentField(l,a,this.editedRecord),r=s.ganttProperties,je((t=i.taskFields).startDate)||t.startDate===l||this.updateScheduleFields(n,r,"startDate"),t.endDate===l&&!je(r.startDate)&&!je(e.value)&&r.startDate.getTime()>e.value&&this.updateScheduleFields(n,r,"endDate"),je(t.endDate)||t.endDate===l||this.updateScheduleFields(n,r,"endDate"),(!je(t.duration)&&t.duration!==l||0<=r.duration)&&this.updateScheduleFields(n,r,"duration"),je(t.work)||t.work===l&&"FixedWork"===r.taskType||this.updateScheduleFields(n,r,"work"),this.dialogEditValidationFlag=!1),!(this.isTriggered=!1)},PXt.prototype.updateScheduleFields=function(e,t,i){var n,o,r,s=this.parent,a=s.element.id,l=R(i,s.columnMapping),h=s.columnByField[l],d=this.parent.taskFields;"stringedit"===h.editType?(o=e.querySelector("#"+a+l))&&(n=o.ej2_instances[0])&&(r=je(h.edit)||je(h.edit.read)?je(h.valueAccessor)?this.parent.dataOperation.getDurationString(t.duration,t.durationUnit):h.valueAccessor(l,s.editModule.dialogModule.editedRecord,h):h.edit.read(),n.value!==r.toString()&&d.duration===l?(n.value=r,n.dataBind()):d.startDate!==l&&d.endDate!==l||(n.value=(d.startDate===l?t.startDate:t.endDate).toString(),n.dataBind())):"datepickeredit"===h.editType||"datetimepickeredit"===h.editType?(o=e.querySelector("#"+a+l))&&(h.editType,s=o.ej2_instances[0])&&(r=t[i],je(s.value)&&!je(r)||je(r)&&!je(s.value)||s.value!==r&&!je(s.value)&&!je(r)&&s.value.toString()!==r.toString())&&(s.value=r,s.dataBind()):"numericedit"===h.editType&&(d=e.querySelector("#"+a+l).ej2_instances[0],je(r=t[i])||d.value===r||(d.value=r,d.dataBind()))},PXt.prototype.validateDuration=function(e){var t,i=e.ganttProperties;this.dialogEditValidationFlag||(je(i.startDate)||rqt(i)||!je(i.duration)?rqt(i)||!je(i.startDate)?(e.ganttProperties.isMilestone&&0!==e.ganttProperties.duration&&(t=this.parent.dateValidationModule.checkStartDate(i.startDate),this.parent.setRecordValue("startDate",t,i,!0),this.parent.taskFields.startDate)&&this.parent.dataOperation.updateMappingData(e,"startDate"),this.parent.dateValidationModule.calculateEndDate(e)):rqt(i)||je(i.endDate)||this.parent.dateValidationModule.calculateStartDate(e):(this.parent.setRecordValue("endDate",null,i,!0),this.parent.setRecordValue("isMilestone",!1,i,!0)),t=0===i.duration,this.parent.setRecordValue("isMilestone",t,i,!0),this.dialogEditValidationFlag=!0)},PXt.prototype.validateStartDate=function(e){var t=e.ganttProperties,i=this.parent.taskFields;this.dialogEditValidationFlag||(je(t.startDate)?(this.parent.setRecordValue("duration",null,t,!0),this.parent.setRecordValue("isMilestone",!1,t,!0),this.parent.allowUnscheduledTasks&&je(i.endDate)&&this.parent.setRecordValue("endDate",null,t,!0)):rqt(t)?je(i.duration)?this.parent.dateValidationModule.calculateDuration(e):(je(i.endDate),this.parent.dateValidationModule.calculateEndDate(e)):je(t.endDate)?je(t.duration)||this.parent.dateValidationModule.calculateEndDate(e):this.parent.dateValidationModule.calculateDuration(e),this.dialogEditValidationFlag=!0)},PXt.prototype.validateEndDate=function(e){var t=e.ganttProperties,i=this.parent.taskFields;this.dialogEditValidationFlag||(je(t.endDate)?(this.parent.setRecordValue("duration",null,t,!0),this.parent.setRecordValue("isMilestone",!1,t,!0)):rqt(t)?je(i.duration)?this.parent.dateValidationModule.calculateDuration(e):je(t.startDate)?this.parent.dateValidationModule.calculateStartDate(e):(!je(t.segments)&&0<t.segments.length&&(t.segments=this.parent.editModule.cellEditModule.validateEndDateWithSegments(t)),this.parent.dateValidationModule.calculateDuration(e)):je(t.duration)?je(t.startDate)||this.parent.dateValidationModule.calculateDuration(e):this.parent.dateValidationModule.calculateStartDate(e),this.dialogEditValidationFlag=!0)},PXt.prototype.validateScheduleValuesByCurrentField=function(e,t,i){var n,o,r,s=this.parent,a=i.ganttProperties,l=s.taskFields;return l.duration===e&&(!je(t)&&""!==t&&(0<=parseInt(t,10)||0<=parseFloat(t))?(s.dataOperation.updateDurationValue(t,a),this.parent.setRecordValue(l.duration,t,i),this.parent.setRecordValue("taskData."+l.duration,a.duration,i),a.isMilestone&&!je(this.parent.editModule.cellEditModule)&&((r={}).data=i,this.parent.editModule.cellEditModule.updateDates(r)),this.validateDuration(i)):s.allowUnscheduledTasks&&(a.startDate&&a.endDate&&a.startDate.getTime()>a.endDate.getTime()||-1!==t.indexOf("-")?(this.parent.setRecordValue("duration",0,a,!0),a.endDate&&this.parent.setRecordValue("startDate",a.endDate,a,!0)):""===t?(this.parent.setRecordValue("duration",null,a,!0),a.endDate&&a.startDate&&this.parent.setRecordValue("endDate",null,a,!0)):(/^[^\d.-]+$/.test(t)&&(n="The provided value for the "+l.duration+" field is invalid. Please ensure the "+l.duration+" field contains only valid numeric values.",this.parent.trigger("actionFailure",{error:n})),this.parent.setRecordValue("duration",a.duration,a,!0))),this.parent.editModule.updateResourceRelatedFields(i,"duration")),l.startDate===e&&(""!==t?(n=this.parent.dateValidationModule.getDateFromFormat(t),n=this.parent.dateValidationModule.checkStartDate(n,a),this.parent.setRecordValue("startDate",n,a,!0),this.validateStartDate(i)):s.allowUnscheduledTasks&&!i.hasChildRecords&&(this.parent.setRecordValue("startDate",null,a,!0),this.parent.setRecordValue("duration",null,a,!0),this.parent.setRecordValue("isMilestone",!1,a,!0))),l.endDate===e&&(""!==t?(n=this.parent.dateValidationModule.getDateFromFormat(t),o=this.parent.getCurrentDayEndTime(n),0===n.getHours()&&86400!==o&&this.parent.dateValidationModule.setTime(o,n),!je(a.startDate)&&!je(a.endDate)&&!je(n)&&a.startDate.getTime()>n.getTime()&&(n=a.endDate),n=this.parent.dateValidationModule.checkEndDate(n,a),(je(a.startDate)||n.getTime()>=a.startDate.getTime())&&this.parent.setRecordValue("endDate",n,a,!0),this.validateEndDate(i),a.isMilestone&&!je(this.parent.editModule.cellEditModule)&&((r={}).data=i,this.parent.editModule.cellEditModule.updateDates(r))):s.allowUnscheduledTasks&&(this.parent.setRecordValue("endDate",null,a,!0),this.parent.setRecordValue("duration",null,a,!0),this.parent.setRecordValue("isMilestone",!1,a,!0))),l.work!==e||je(t)||""===t||(this.parent.setRecordValue("work",t,a,!0),this.parent.editModule.updateResourceRelatedFields(i,"work"),this.validateDuration(i)),e===l.type&&(this.parent.setRecordValue("taskType",t,a,!0),t)&&"FixedDuration"===t&&0===a.duration&&this.parent.editModule.updateResourceRelatedFields(i,"work"),l.manual===e&&this.parent.editModule.updateTaskScheduleModes(i),!0},PXt.prototype.getSegmentsModel=function(r){for(var s=this,e=this.parent.taskFields,e=(!je(r)&&0!==r.length||(r=[],je(e.startDate)||r.push(this.parent.taskFields.startDate),je(e.endDate)||r.push(this.parent.taskFields.endDate),je(e.duration)||r.push(this.parent.taskFields.duration),je(e.id))||r.push(this.parent.taskFields.id),{}),t=(e.editSettings={allowEditing:!0,allowAdding:!0,allowDeleting:!0,mode:"Normal",newRowPosition:"Bottom"},e.locale=this.parent.locale,e.dataSource=[],e.rowHeight=this.parent.isAdaptive?48:null,e.toolbar=[{id:this.parent.element.id+"SegmentsTabContainer_add",prefixIcon:"e-add",tooltipText:this.localeObj.getConstant("add"),align:"Right",text:this.parent.isAdaptive?"":this.localeObj.getConstant("add")},{id:this.parent.element.id+"SegmentsTabContainer_delete",prefixIcon:"e-delete",tooltipText:this.localeObj.getConstant("delete"),align:"Right",text:this.parent.isAdaptive?"":this.localeObj.getConstant("delete")}],[]),i=this,n=0;n<r.length;n++)!function(n){var e={},o="General";switch(r[n]){case i.parent.taskFields.id:e={field:r[n],visible:!1,isPrimaryKey:!0},t.push(e);break;case i.parent.taskFields.startDate:case i.parent.taskFields.endDate:e={field:r[n],headerText:i.localeObj.getConstant(r[n]===i.parent.taskFields.startDate?"startDate":"endDate"),editType:"stringedit",width:"200px",edit:{write:function(e){var t;t=(je(s.beforeOpenArgs[o])||je(s.beforeOpenArgs[o][r[n]])?(t=s.getGeneralColumnFields(),s.getFieldsModel(t)):s.beforeOpenArgs[o])[r[n]],x("value",e.rowData[e.column.field],t),new s.inputs[s.parent.columnByField[r[n]].editType](t).appendTo(e.element)},read:function(e){return e.ej2_instances[0].value}},format:i.parent.getDateFormat()},r[n]===i.parent.taskFields.startDate&&(e.validationRules={required:!0}),t.push(e);break;case i.parent.taskFields.duration:e={field:r[n],headerText:i.localeObj.getConstant(r[n].toLocaleLowerCase()),editType:"stringedit",width:"100px",edit:{write:function(e){(t=(je(s.beforeOpenArgs[o])||je(s.beforeOpenArgs[o][r[n]])?(t=s.getGeneralColumnFields(),s.getFieldsModel(t)):s.beforeOpenArgs[o])[r[n]]).floatLabelType="Never";var t,i=e.rowData[e.column.field];je(i)?x("value",null,t):x("value",i,t),x("value",i,t),new fV(t).appendTo(e.element)},read:function(e){return e.ej2_instances[0].value.toString()}}},t.push(e)}}(n);return e.columns=t,e.height=this.parent.isAdaptive||this.parent.enableAdaptiveUI?"100%":"153px",e},PXt.prototype.getGridColumnByField=function(e,t){for(var i,n=0;n<t.length;n++)t[n].field===e&&(i=t[n]);return i},PXt.prototype.updateSegmentField=function(e,t,i){var n,o=this.parent.editModule.dialogModule.dialog,r=R("Segments",this.beforeOpenArgs),r=this.getGridColumnByField(e,r.columns),s=this.parent.element.id,i=i[e];je((n="stringedit"===r.editType||"datepickeredit"===r.editType?o.querySelector("#"+s+"SegmentsTabContainer"+e).ej2_instances[0]:n).value)||je(i)||n.value.toString()===i.toString()||(n.value=i,n.dataBind())},PXt.prototype.validateSegmentFields=function(e,t,i,n){var o,r=this.parent.taskFields;je(r.duration)||r.duration.toLowerCase()!==t.toLowerCase()||je(i)||""===i||(this.selectedSegment[r.duration]=Number(i),o=e.dataOperation.getEndDate(this.selectedSegment[r.startDate],Number(i),this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties,!1),o=e.dataOperation.checkEndDate(o,this.editedRecord.ganttProperties,!1),this.selectedSegment[r.endDate]=o),je(r.startDate)||r.startDate.toLowerCase()!==t.toLowerCase()||""!==i&&(e=this.parent.dateValidationModule.getDateFromFormat(i),e=this.parent.dateValidationModule.checkStartDate(e),this.selectedSegment[r.startDate]=e,je(r.endDate)||(this.selectedSegment.endDate=this.parent.dataOperation.getEndDate(e,this.selectedSegment[r.duration],this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties,!1))),je(r.endDate)||r.endDate.toLowerCase()!==t.toLowerCase()||""!==i&&(o=this.parent.dateValidationModule.getDateFromFormat(i),e=this.parent.getCurrentDayEndTime(o),0===o.getHours()&&86400!==e&&this.parent.dateValidationModule.setTime(e,o),o=this.parent.dateValidationModule.checkEndDate(o,this.editedRecord.ganttProperties),this.selectedSegment[r.endDate]=o,this.selectedSegment[r.duration]=this.parent.dataOperation.getDuration(this.selectedSegment[r.startDate],this.selectedSegment[r.endDate],this.editedRecord.ganttProperties.durationUnit,!0,!1,!0)),je(r.startDate)||this.updateSegmentField(r.startDate,n,this.selectedSegment),je(r.endDate)||this.updateSegmentField(r.endDate,n,this.selectedSegment),je(r.duration)||this.updateSegmentField(r.duration,n,this.selectedSegment)},PXt.prototype.getPredecessorModel=function(e){!je(e)&&0!==e.length||(e=["ID","Name","Type","Offset","UniqueId"]);var t={editSettings:{allowEditing:!0,allowAdding:!0,allowDeleting:!0,mode:"Normal"}};t.locale=this.parent.locale,t.dataSource=[],t.rowHeight=this.parent.isAdaptive?48:null,t.toolbar=[{id:this.parent.element.id+"DependencyTabContainer_add",prefixIcon:"e-add",tooltipText:this.localeObj.getConstant("add"),align:"Right",text:this.parent.isAdaptive?"":this.localeObj.getConstant("add")},{id:this.parent.element.id+"DependencyTabContainer_delete",prefixIcon:"e-delete",tooltipText:this.localeObj.getConstant("delete"),align:"Right",text:this.parent.isAdaptive?"":this.localeObj.getConstant("delete")}];for(var i=[],n=0;n<e.length;n++){var o={};"id"===e[n].toLowerCase()?(o={field:"id",headerText:this.localeObj.getConstant("id"),allowEditing:!1,width:"70px"},i.push(o)):"name"===e[n].toLowerCase()?(o={field:"name",headerText:this.localeObj.getConstant("name"),editType:"stringedit",width:"250px",validationRules:{required:!0}},i.push(o)):"type"===e[n].toLowerCase()?(o={field:"type",headerText:this.localeObj.getConstant("type"),editType:"dropdownedit",dataSource:this.types,foreignKeyField:"id",foreignKeyValue:"text",defaultValue:"FS",validationRules:{required:!0},width:"150px"},i.push(o)):"offset"===e[n].toLowerCase()?(o={field:"offset",headerText:this.localeObj.getConstant("offset"),editType:"stringedit",defaultValue:this.parent.dataOperation.getDurationString(0,this.beforeOpenArgs.rowData.ganttProperties.durationUnit),validationRules:{required:!0},width:"100px"},i.push(o)):"uniqueid"===e[n].toLowerCase()&&(o={field:"uniqueId",isPrimaryKey:!0,visible:!1,defaultValue:(fqt++).toString()},i.push(o))}return t.columns=i,t.height=this.parent.isAdaptive||this.parent.enableAdaptiveUI?"100%":"153px",t},PXt.prototype.getResourcesModel=function(e){for(var t=this.parent.resourceFields,i=(!je(e)&&0!==e.length||(e=[t.id,t.name,t.unit,t.group]),{allowFiltering:!0,treeColumnIndex:-1,childMapping:"",editSettings:{allowEditing:!0,mode:"Cell"},locale:this.parent.locale,allowSelection:!0,rowHeight:this.parent.isAdaptive?48:null,filterSettings:{type:"Menu"},selectionSettings:{checkboxOnly:!0,checkboxMode:"Default",persistSelection:!0,type:"Multiple"}}),n=[{type:"checkbox",allowEditing:!1,allowSorting:!1,allowFiltering:!1,width:60}],o=0;o<e.length;o++){var r={};e[o]===t.id?(r={field:t.id,headerText:this.localeObj.getConstant("id"),isPrimaryKey:!0,width:"100px",allowEditing:!1},n.push(r)):e[o]===t.name?(r={field:t.name,headerText:this.localeObj.getConstant("name"),allowEditing:!1},n.push(r)):e[o]===t.unit?(r={field:t.unit,headerText:this.localeObj.getConstant("unit"),editType:"numericedit",edit:{params:{min:0}}},n.push(r)):e[o]!==t.group||je(t.group)||(r={field:t.group,headerText:this.localeObj.getConstant("group"),allowEditing:!1},n.push(r))}return i.columns=n,i.height=this.parent.isAdaptive||this.parent.enableAdaptiveUI?"100%":"196px",i},PXt.prototype.getNotesModel=function(e){return!je(e)&&0!==e.length||(e=["Bold","Italic","Underline","StrikeThrough","FontName","FontSize","FontColor","BackgroundColor","LowerCase","UpperCase","|","Alignments","OrderedList","UnorderedList","Outdent","Indent","|","CreateTable","CreateLink","|","ClearFormat","Print","|","Undo","Redo"]),{placeholder:this.localeObj.getConstant("writeNotes"),toolbarSettings:{items:e},height:this.parent.isAdaptive||this.parent.enableAdaptiveUI?"100%":"auto",locale:this.parent.locale}},PXt.prototype.createDivElement=function(e,t){return Q("div",{className:e,id:t})},PXt.prototype.createFormElement=function(e,t){return Q("form",{className:e,id:t})},PXt.prototype.createInputElement=function(e,t,i,n){return Q(n||"input",{className:e,attrs:{type:"text",id:t,name:i,title:i}})},PXt.prototype.renderTabItems=function(){for(var e=this.beforeOpenArgs.tabModel.items,t=0,i=0;i<e.length;i++){var n=e[i];n.content instanceof HTMLElement||("General"===n.content?n.content=this.renderGeneralTab(n.content):"Dependency"===n.content?(this.editedRecord.hasChildRecords&&!this.parent.allowParentDependency&&(n.disabled=!0),n.content=this.renderPredecessorTab(n.content)):"Resources"===n.content?n.content=this.renderResourceTab(n.content):n.content==="Custom"+t?(n.content=this.renderCustomTab(n.content,!0),t++):"Notes"===n.content?n.content=this.renderNotesTab(n.content):"Segments"===n.content&&(this.editedRecord.hasChildRecords&&(n.disabled=!0),n.content=this.renderSegmentsTab(n.content)))}},PXt.prototype.segmentGridActionBegin=function(e){var t=this.parent.taskFields,i=this.beforeOpenArgs.Segments;if("add"===e.requestType||"beginEdit"===e.requestType||"save"===e.requestType){var n,o,r,s,a=i.dataSource,l=R("rowData",e);if(je(this.beforeOpenArgs.rowData.ganttProperties.startDate)||"add"===e.requestType&&(s={},n=R(this.parent.taskFields.startDate,l),o=this.parent.taskFields.endDate?R(this.parent.taskFields.endDate,l):null,r=void 0,je(this.parent.taskFields.duration)||(r=R(this.parent.taskFields.duration,l)),(l=!je(a)&&0<a.length?je(t.endDate)||je(a[0][t.endDate])?new Date(R(t.startDate,a[0]).getTime()):new Date(R(t.endDate,a[0]).getTime()):!je(this.beforeOpenArgs.rowData.ganttProperties.startDate)&&new Date(this.beforeOpenArgs.rowData.ganttProperties.startDate.getTime())).setHours(0,0,0,0),!je(a)&&0<a.length&&l.setDate(l.getDate()+2),n=this.parent.dataOperation.checkStartDate(l),o=this.parent.dateValidationModule.getDateFromFormat(n),l=this.parent.getCurrentDayEndTime(o),0===o.getHours()&&86400!==l&&this.parent.dateValidationModule.setTime(l,o),o=!je(t.endDate)&&!je(a)&&a.length<=0?this.beforeOpenArgs.rowData.ganttProperties.endDate:o,l=this.beforeOpenArgs.rowData.ganttProperties,r=n.getTime()===o.getTime()?1:this.parent.dataOperation.getDuration(n,o,l.durationUnit,!0,!1,!0),s=je(t.duration)?((a={})[t.startDate]=n,a[t.endDate]=o,a):((l={})[t.startDate]=n,l[t.endDate]=o,l[t.duration]=r,l),e.rowData=s),"save"===e.requestType){for(var h=i.dataSource,d=this.parent.taskFields.id,p=h.length;h.some(function(e){return e[d]===p});)p++;je(e.data[d])&&(e.data[d]=p,e.rowData[d]=p)}this.selectedSegment=e.rowData}},PXt.prototype.getDialogTabIndex=function(i){var n;return this.isEdit?this.parent.editDialogFields.map(function(e,t){e.type===i&&(n=t)}):this.parent.addDialogFields.map(function(e,t){e.type===i&&(n=t)}),n},PXt.prototype.setInjected=function(e,t,i,n,o,r,s){if(!je(e)&&!je(e.additionalParams))for(var a in t=e.additionalParams)if(Object.prototype.hasOwnProperty.call(t,a))switch(a){case"allowFiltering":i.Inject(_G);break;case"allowSorting":i.Inject(eG);break;case"allowPaging":i.Inject(gG);break;case"allowGrouping":i.Inject(YG);break;case"editSettings":i.Inject(uX);break;case"aggregates":i.Inject(lY);break;case"showColumnChooser":i.Inject(mX);break;case"showColumnMenu":i.Inject(TK);break;case"contextMenuItems":i.Inject(SK);break;case"allowResizing":i.Inject(jG);break;case"allowReordering":i.Inject(QG);break;case"detailTemplate":i.Inject(KG);break;case"allowRowDragAndDrop":i.Inject(qG);break;case"searchSettings":i.Inject(pk);break;case"selectionSettings":i.Inject(Selection);break;case"enableVirtualization":i.Inject(Xee);break;case"toolbar":t.toolbar.map(function(e){switch(e){case"Search":i.Inject(pk);break;case"Print":i.Inject(EP);break;case"PdfExport":i.Inject(uK);break;case"ExcelExport":i.Inject(pK)}}),r.toolbar,i.Inject(ZG);break;case"columns":r.columns}},PXt.prototype.renderSegmentsTab=function(e){var i=this,t=this.parent,n=this.beforeOpenArgs[e],o=(n.enableAdaptiveUI=this.parent.enableAdaptiveUI,this.beforeOpenArgs.rowData),r=[],o=((r=this.isEdit?je(o.taskData[this.parent.taskFields.segments])?[]:o.taskData[this.parent.taskFields.segments]:r).map(function(e,t){je(e[i.parent.taskFields.id])&&(e[i.parent.taskFields.id]=t)}),n.dataSource=r,n.actionBegin=this.segmentGridActionBegin.bind(this),this.getDialogTabIndex("Segments")),r=(this.isEdit?this.isEdit&&(s=this.parent.editDialogFields[o]):s=this.parent.addDialogFields[o],[]),o=[],s=(je(s)||je(s.additionalParams)||(a=s.additionalParams),this.setInjected(s,a,IP,void 0,r,n,o),IP.Inject(uX,gG,ZG,kK),(n=MXt({},n,a)).toolbar=r.concat(n.toolbar),this.updateColumns(o,n.columns)),a=(n.columns=s,new IP(n)),r=this.createDivElement("",t.element.id+""+e+"TabContainer");return a.appendTo(r),r},PXt.prototype.renderGeneralTab=function(e,t){var i,n=this.parent,o=[],r=this.beforeOpenArgs[e],s=t?this.createDivElement("e-edit-form-row",n.element.id+""+e+"TabContainer"):this.createFormElement("e-edit-form-row",n.element.id+""+e+"TabContainer");this.parent.enableAdaptiveUI&&(s.style.height="100%",(c=Q("table",{className:"e-table"})).style.width="100%",i=Q("tbody"));for(var t=s.id,a=0,l=Object.keys(r);a<l.length;a++){var h,d,p=l[a];!1!==this.parent.columnByField[p].visible&&(h=this.parent.columnByField[p],d=r[p],(this.parent.enableAdaptiveUI?i:s).appendChild(this.renderInputElements(d,h)),o.push(p))}this.parent.enableAdaptiveUI&&(c.appendChild(i),s.appendChild(c)),t!==s.id&&(s.id=t);n=this.getDialogTabIndex("General"),e=[];if(this.isEdit||je(this.parent.addDialogFields[n])||je(this.parent.addDialogFields[n].fields)?!this.isEdit||je(this.parent.editDialogFields[n])||je(this.parent.editDialogFields[n].fields)||(e=this.parent.editDialogFields[n].fields):e=this.parent.addDialogFields[n].fields,!je(e)){var c=e.filter(function(e){return!o.includes(e)});if(!je(c))for(var u=c,g=0;g<=u.length-1;g++){var m,f=document.getElementById(u[g]);je(f)||(f=f.innerHTML,(m=Q("div")).innerHTML=f,s.appendChild(m.children[0]))}}return s},PXt.prototype.isCheckIsDisabled=function(e){var t,i=!1;if(!1===e.allowEditing||e.isPrimaryKey||this.parent.readOnly)if(-1!==this.parent.customColumns.indexOf(e.field))i=!0;else if(e.field===this.parent.taskFields.baselineStartDate||e.field===this.parent.taskFields.baselineEndDate||e.field===this.parent.taskFields.work||e.field===this.parent.taskFields.type||e.field===this.parent.taskFields.id||e.field===this.parent.taskFields.name||e.field===this.parent.taskFields.duration||e.field===this.parent.taskFields.progress||e.field===this.parent.taskFields.startDate||e.field===this.parent.taskFields.endDate){for(var n=0;n<this.parent.currentViewData.length;n++)if(!je(this.parent.currentViewData[n].ganttProperties.taskId)){t=this.parent.currentViewData[n].ganttProperties.taskId;break}i="string"!=typeof t}return i=this.isEdit&&(e.field===this.parent.taskFields.id&&(i=!0),this.editedRecord.hasChildRecords)&&(e.field===this.parent.taskFields.endDate&&(!je(this.editedRecord[this.parent.taskFields.manual])&&!1===this.editedRecord[this.parent.taskFields.manual]||"Auto"===this.parent.taskMode)||e.field===this.parent.taskFields.duration||e.field===this.parent.taskFields.progress||e.field===this.parent.taskFields.work||e.field===this.parent.taskFields.type)?!0:i},PXt.prototype.isParentValid=function(e){if(0<e.length)for(var t=0;t<e.length;t++){if(e[t].uniqueID===this.beforeOpenArgs.rowData.uniqueID){this.isValidData=!1;break}if(e[t].hasChildRecords&&this.isParentValid(e[t].childRecords),!this.isValidData)break}return this.isValidData},PXt.prototype.renderPredecessorTab=function(e){var i=this,t=this.parent,n=this.beforeOpenArgs[e],o=this.parent.columnByField[this.parent.taskFields.dependency],o=((!1===o.allowEditing||o.isPrimaryKey||this.parent.readOnly)&&(n.editSettings.allowEditing=!1,n.editSettings.allowAdding=!1,n.editSettings.allowDeleting=!1),this.beforeOpenArgs.rowData),r=[];this.taskNameCollection(),this.isEdit&&(r=this.predecessorEditCollection(o),this.updatePredecessorDropDownData(o)),o[this.parent.taskFields.dependency]&&(s=o[this.parent.taskFields.dependency].split(",").length),0!==this.preTableCollection.length&&this.preTableCollection.length!==s||(n.editSettings.allowAdding=!1),n.actionComplete=this.gridActionComplete.bind(this),n.dataSource=r,n.enableAdaptiveUI=this.parent.enableAdaptiveUI,n.actionBegin=this.gridActionBegin.bind(this);n.columns[1].edit={write:function(e){"add"===R("requestType",e)&&x("rowData.uniqueId",fqt++,e);new oU({dataSource:new me(i.idCollection),popupHeight:"180px",allowCustom:!1,enableRtl:i.parent.enableRtl,fields:{value:"text"},value:e.rowData.name,change:function(e){var t=z(e.element,"tr").querySelector("#"+i.parent.element.id+"DependencyTabContainerid");t&&(je(e.itemData)||je(e.item)?t.value="":t.value=e.itemData.id)},autofill:!0}).appendTo(e.element)},read:function(e){return e.ej2_instances[0].value}};var o=this.getDialogTabIndex("Dependency"),s=(this.isEdit?this.isEdit&&(a=this.parent.editDialogFields[o]):a=this.parent.addDialogFields[o],[]),r=[],o=(je(a)||je(a.additionalParams)||(l=a.additionalParams),this.setInjected(a,l,IP,void 0,s,n,r),IP.Inject(uX,gG,ZG,kK),(n=MXt({},n,l)).toolbar=n.toolbar.concat(s),this.updateColumns(r,n.columns)),a=(n.columns=o,new IP(n)),l=this.createDivElement("e-dependent-div",t.element.id+""+e+"TabContainer");return a.appendTo(l),l},PXt.prototype.updateColumns=function(i,e){var n={};return i.forEach(function(e){"object"==typeof e&&(n[e.field]=e)}),e.forEach(function(e){var t;"object"==typeof e&&(t=e.field,n[t]?Object.assign(n[t],e):i.push(e))}),i},PXt.prototype.gridActionBegin=function(o){var r=this,e=this.beforeOpenArgs.Dependency;if("add"===o.requestType||"beginEdit"===o.requestType)for(var s="add"!==o.requestType,a=(this.idCollection=Pe([],[],this.preTableCollection,!0),e.dataSource),t=this,i=0;i<=a.length;i++)!function(n){t.idCollection.forEach(function(e,t){var i;e.id===R("id",a[n])&&(i=R("rowData",o),s&&R("id",i)===e.id||r.idCollection.splice(r.idCollection.indexOf(e),1))})}(i)},PXt.prototype.gridActionComplete=function(e){var t;"save"!==e.requestType||je(t=this.parent.editModule.dialogModule.dialog.querySelector("#"+this.parent.element.id+"DependencyTabContainer"))||je(e.rows)||e.rows.length!==this.preTableCollection.length||(e=t.ej2_instances[0])&&(e.editSettings.allowAdding=!1)},PXt.prototype.updateResourceCollection=function(e,t){if(!je(e.data)&&Object.keys(e.data).length){t=document.querySelector("#"+t).ej2_instances[0];if(!je(t)&&0<t.getSelectedRecords().length){for(var i=t.getSelectedRecords(),n=void 0,o=[],n=0;n<i.length;n++){var r=i[n];je(r.taskData)||je(r.taskData[this.parent.resourceFields.unit])||je(e.data[this.parent.resourceFields.unit])||r.taskData[this.parent.resourceFields.id]!==e.data[this.parent.resourceFields.id]||(r.taskData[this.parent.resourceFields.unit]=e.data[this.parent.resourceFields.unit]),o.push(i[n].taskData)}this.ganttResources=Pe([],o)}else this.ganttResources=[]}else this.ganttResources=[]},PXt.prototype.renderResourceTab=function(e){var i=this,t=this.parent,n=t.resourceFields,o=this.beforeOpenArgs.rowData,r=(("beforeOpenEditDialog"===this.beforeOpenArgs.requestType&&!je(this.editedRecord[this.parent.taskFields.resourceInfo])||"beforeOpenAddDialog"===this.beforeOpenArgs.requestType&&!je(this.editedRecord[this.parent.taskFields.resourceInfo]))&&"object"==typeof this.editedRecord[this.parent.taskFields.resourceInfo]&&this.parent.setRecordValue("resourceInfo",this.parent.dataOperation.setResourceInfo(this.editedRecord),o.ganttProperties,!0),o.ganttProperties.resourceInfo),s=((v=this.beforeOpenArgs[e]).enableAdaptiveUI=this.parent.enableAdaptiveUI,t.element.id+""+e+"TabContainer"),a=[],a=Pe([],[],t.resources,!0);if(this.parent.dataOperation.updateResourceUnit(a),!je(r))for(var l=void 0,h=r.length,d=void 0,p=a.length,l=0;l<h;l++)for(d=0;d<p;d++)r[l][n.id]===a[d][n.id]&&(a[d][n.unit]=r[l][n.unit]);v.dataSource=a;var c=o.ganttProperties.resourceInfo;if(this.isEdit&&!je(c))for(var u=0;u<c.length;u++)this.ganttResources.push(c[u]);else if(!this.isEdit&&!je(c))for(u=0;u<c.length;u++)this.ganttResources.push(c[u]);v.actionBegin=function(e){if(e.rowData&&e.columnName===i.parent.resourceFields.unit&&i.editedRecord.ganttProperties.resourceInfo)for(var t=0;t<i.editedRecord.ganttProperties.resourceInfo.length;t++)i.editedRecord.ganttProperties.resourceInfo[t][i.parent.resourceFields.id]===e.rowData[i.parent.resourceFields.id]&&(i.editedRecord.ganttProperties.resourceInfo[t][i.parent.resourceFields.unit]=e.value)},v.rowSelected=function(e){i.updateResourceCollection(e,s),i.currentResources=i.ganttResources},v.rowDeselected=function(e){i.updateResourceCollection(e,s),i.currentResources=i.ganttResources};var g,m,f,e=this.createDivElement("e-resource-div",s),t=this.getDialogTabIndex("Resources"),y=(this.isEdit?this.isEdit&&(g=this.parent.editDialogFields[t]):g=this.parent.addDialogFields[t],[]);if(!je(g)&&!je(g.additionalParams))for(var u in m=g.additionalParams)if(Object.prototype.hasOwnProperty.call(m,u))switch(u){case"allowFiltering":eee.Inject(mee);break;case"allowSorting":eee.Inject(Tee);break;case"allowPaging":eee.Inject(wee);break;case"editSettings":eee.Inject(Lee);break;case"aggregates":case"showColumnChooser":eee.Inject(xee);break;case"showColumnMenu":eee.Inject(TK);break;case"contextMenuItems":eee.Inject(SK);break;case"allowResizing":eee.Inject(oee);break;case"allowReordering":eee.Inject(iee);break;case"detailTemplate":eee.Inject(KG);break;case"allowRowDragAndDrop":eee.Inject(see);break;case"searchSettings":eee.Inject(pk);break;case"selectionSettings":eee.Inject(o$);break;case"toolbar":(f=m.toolbar).map(function(e){switch(e){case"Search":eee.Inject(pk);break;case"Print":eee.Inject(EP);break;case"PdfExport":eee.Inject(uK);break;case"ExcelExport":eee.Inject(pK)}}),je(f)||(v.toolbar=[],v.toolbar=v.toolbar.concat(f)),eee.Inject(See);break;case"enableVirtualization":eee.Inject(Xee);break;case"columns":y=v.columns}eee.Inject(o$,mee,Lee,Xee,See);var v=MXt({},v,m),o=this.updateColumns(y,v.columns),b=(v.columns=o,!1),w=(v.showColumnMenu&&(b=v.showColumnMenu,v.showColumnMenu=!1),new eee(v)),t=this.parent.columnByField[this.parent.taskFields.resourceInfo];return(!1===t.allowEditing||t.isPrimaryKey||this.parent.readOnly)&&(w.allowSelection=!1,w.allowFiltering=!1,w.editSettings.allowEditing=!1),w.dataBound=function(){var e;b&&(w.showColumnMenu=!0),1<=i.parent.editDialogFields.length&&"Resources"===i.parent.editDialogFields[0].type&&(e=i.parent.element.id+"ResourcesTabContainer",i.resourceSelection(e))},w.appendTo(e),e},PXt.prototype.resourceSelection=function(e){var n=this,o=document.querySelector("#"+e).ej2_instances[0],e=(this.parent.triggeredColumnName="",o.getCurrentViewRecords()),r=this.ganttResources;r&&0<r.length&&e.forEach(function(e,t){for(var i=0;i<r.length;i++)e.taskData[n.parent.resourceFields.id]!==r[i][n.parent.resourceFields.id]||je(o.selectionModule)||-1!==o.getSelectedRowIndexes().indexOf(t)||o.selectRow(t)})},PXt.prototype.renderCustomTab=function(e,t){return this.renderGeneralTab(e,t)},PXt.prototype.renderNotesTab=function(e){var t,i,n=this.parent,o=this.beforeOpenArgs[e],r=(o.enableHtmlSanitizer=this.parent.enableHtmlSanitizer,this.editedRecord.ganttProperties),n=this.createDivElement("",n.element.id+""+e+"TabContainer"),e=this.getDialogTabIndex("Notes"),s=[];if(this.isEdit?this.isEdit&&(t=this.parent.editDialogFields[e]):t=this.parent.addDialogFields[e],!je(t)&&!je(t.additionalParams))for(var a in i=t.additionalParams)if(Object.prototype.hasOwnProperty.call(i,a))switch(a){case"toolbarSettings":for(var l=0;l<i.toolbarSettings.items.length;l++){var h=i.toolbarSettings.items[l];if(h)switch(h){case"Image":Ket.Inject(X9e);break;case"CreateTable":Ket.Inject(hqe);break;case"EmojiPicker":Ket.Inject(uit);break;case"FileManager":Ket.Inject(hit);break;case"FormatPainter":Ket.Inject(pit)}}je(i.toolbarSettings.items)||(s=o.toolbarSettings.items),Ket.Inject(att);break;case"editorMode":Ket.Inject(Ytt)}Ket.Inject(att,G9e,oit,ptt,utt,hqe),o.value=r.notes;e=this.parent.columnByField[this.parent.taskFields.notes];return(!1===e.allowEditing||e.isPrimaryKey||this.parent.readOnly)&&(o.enabled=!1),(o=MXt({},o,i)).toolbarSettings.items=s.concat(o.toolbarSettings.items),new Ket(o).appendTo(n),n},PXt.prototype.renderInputElements=function(e,t){var i,n,o,r,s=this,a=this.parent.element.id,l=this.editedRecord,h=this.createDivElement("e-edit-form-column"),d=(this.parent.enableAdaptiveUI&&(i=Q("tr"),n=Q("td"),h.style.width="100%"),{column:t,data:l});return!je(t.edit)&&je(t.edit.params)?((o="string"==typeof(o=t.edit.create)?(o=FB(o,window))(d):t.edit.create(d)).className="",o.setAttribute("type","text"),o.setAttribute("id",a+""+t.field),o.setAttribute("name",t.field),o.setAttribute("title",t.field)):o=this.createInputElement("",a+""+t.field,t.field),h.appendChild(o),e.enabled=je(e.enabled)?!this.isCheckIsDisabled(t):e.enabled,t.field===this.parent.taskFields.duration?je(t.valueAccessor)?je(t.edit)&&(d=l.ganttProperties,e.value=this.parent.dataOperation.getDurationString(d.duration,d.durationUnit)):"string"==typeof t.valueAccessor?(a=FB(t.valueAccessor,window),e.value=a(t.field,l,t)):e.value=t.valueAccessor(t.field,l,t):"booleanedit"===t.editType?!0===l[t.field]?e.checked=!0:e.checked=!1:this.parent.taskFields[t.field]||"numericedit"!==t.editType||""!==l[t.field]&&0!==l[t.field]?e.value=l[t.field]:e.value=0,!je(t.edit)&&je(t.edit.params)?(r=void 0,r="string"==typeof(d=t.edit.write)?(d=FB(d,window))({column:t,rowData:l,element:o}):t.edit.write({column:t,rowData:l,element:o}),t.field===this.parent.taskFields.duration&&(r.change=function(e){s.validateScheduleFields(e,t,s.parent)})):(r=new this.inputs[t.editType](e)).appendTo(o),this.parent.enableAdaptiveUI?(n.appendChild(h),i.appendChild(n),i):h},PXt.prototype.taskNameCollection=function(){var e=this.parent.flatData;this.preTaskIds=[],this.preTableCollection=[];for(var t=0;t<e.length;t++){var i=e[t];if(this.parent.allowParentDependency){var n=i;if(i.parentUniqueID===this.beforeOpenArgs.rowData.uniqueID)this.isValidData=!1;else do{if(n.parentItem&&(n=this.parent.flatData[this.parent.ids.indexOf(n.parentItem.taskId)]).uniqueID===this.beforeOpenArgs.rowData.uniqueID){this.isValidData=!1;break}}while(n.parentItem);if(i.hasChildRecords&&this.isValidData&&(this.isValidData=this.isParentValid(i.childRecords)),!this.isValidData){this.isValidData=!0;continue}}else if(i.hasChildRecords)continue;var o=("ResourceView"===this.parent.viewType?i.ganttProperties.taskId:i.ganttProperties.rowUniqueID).toString(),i={id:o,text:o+"-"+i.ganttProperties.taskName,value:o};this.preTaskIds.push(i.id),this.preTableCollection.push(i)}},PXt.prototype.predecessorEditCollection=function(e){var t=[],i=e.ganttProperties;if(this.isEdit&&!je(this.parent.taskFields.dependency)&&!je(e)&&!je(i.predecessor))for(var n=i.predecessor,o=this.preTableCollection,r=0;r<n.length;r++){var s=n[r].from.toString(),a={};if(("ResourceView"===this.parent.viewType?i.taskId:i.rowUniqueID).toString()!==s){a.id=s;for(var l=0;l<o.length;l++)if(o[l].value===s){a.name=o[l].text;break}a.type=n[r].type;var h=n[r].offset,d=n[r].offsetUnit;a.offset=this.parent.dataOperation.getDurationString(h,d),a.uniqueId=fqt++,t.push(a)}}return t},PXt.prototype.updatePredecessorDropDownData=function(e){var t=("ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID).toString(),t=this.preTaskIds.indexOf(t);this.preTableCollection.splice(t,1),this.preTaskIds.splice(t,1),this.validSuccessorTasks(e,this.preTaskIds,this.preTableCollection)},PXt.prototype.validSuccessorTasks=function(e,h,d){var t,p,c=this,e=e.ganttProperties;e.predecessor&&0<e.predecessor.length&&(t=e.predecessor,p=("ResourceView"===this.parent.viewType?e.taskId:e.rowUniqueID).toString(),t.forEach(function(e){if(e.from.toString()===p){var t,e=e.to;-1<(t=h.indexOf(e))&&(h.splice(t,1),d.splice(t,1));for(var i=c.parent.connectorLineModule.getRecordByID(e),n=!0,o=0,r=c.processedId;o<r.length;o++){var s=r[o];if(s.id===i.ganttProperties.taskId&&Array.isArray(s.value)&&Array.isArray(i.ganttProperties.predecessor)&&s.value.length===i.ganttProperties.predecessor.length){for(var a=!0,l=0;l<s.value.length;l++)if(s.value[l]!==i.ganttProperties.predecessor[l]){a=!1;break}if(a){n=!1;break}}}n&&(c.processedId.push({id:i.ganttProperties.taskId,value:i.ganttProperties.predecessor}),c.validSuccessorTasks(i,h,d))}}))},PXt.prototype.getPredecessorType=function(){var e=[this.parent.getPredecessorTextValue("SS"),this.parent.getPredecessorTextValue("SF"),this.parent.getPredecessorTextValue("FS"),this.parent.getPredecessorTextValue("FF")];return[{id:"FS",text:e[2],value:e[2]},{id:"FF",text:e[3],value:e[3]},{id:"SS",text:e[0],value:e[0]},{id:"SF",text:e[1],value:e[1]}]},PXt.prototype.initiateDialogSave=function(){if(this.isEdit?this.parent.initiateEditAction(!0):this.addedRecord={},this.currentResources&&(this.currentResources=null),this.parent.undoRedoModule&&this.parent.isUndoRedoItemPresent("Edit")&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.isEdit)){this.parent.undoRedoModule.createUndoCollection();var e={action:"DialogEdit",modifiedRecords:[]};if(this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=e,"ResourceView"===this.parent.viewType){var o,r,t=!1;if(this.rowData.ganttProperties.resourceInfo){if(this.ganttResources.length!==this.rowData.ganttProperties.resourceInfo.length)t=!0;else for(var i=0;i<this.rowData.ganttProperties.resourceInfo.length;i++)if(this.ganttResources[i][this.parent.resourceFields.id]!==this.rowData.ganttProperties.resourceInfo[i][this.parent.resourceFields.id]){t=!0;break}}else 0<this.ganttResources.length&&(t=!0);t&&(e={deletedIndexes:[]},o="T"+this.rowData.ganttProperties.taskId,r=[],this.parent.taskIds.reduce(function(e,t){if(t===o)if(0===this.ganttResources.length)r.push(this.parent.flatData[this.parent.taskIds.indexOf(t)]);else for(var i=this.parent.getTaskByUniqueID(this.parent.flatData[this.parent.taskIds.indexOf(t)].parentUniqueID),n=0;n<this.ganttResources.length;n++)i.ganttProperties.taskId!==this.ganttResources[n][this.parent.resourceFields.id]&&-1===r.indexOf(this.parent.flatData[this.parent.taskIds.indexOf(t)])&&r.push(this.parent.flatData[this.parent.taskIds.indexOf(t)])}.bind(this),[]),this.parent.undoRedoModule.findPosition(Pe([],[],r,!0),e,"deletedIndexes"),this.indexes?this.indexes.deletedIndexes[this.indexes.deletedIndexes.length]=e.deletedIndexes[0]:this.indexes=e)}}this.parent.updateDuration=!0;for(var n=this.parent,s=this.beforeOpenArgs.tabModel.items,i=0;i<s.length;i++){var a=s[i].content;je(h=a.getAttribute("id"))&&""===h||("General"===(h=(h=h.replace(n.element.id,"")).replace("TabContainer",""))?this.updateGeneralTab(a,!1):"Dependency"===h?(this.isFromDialogPredecessor=!0,this.updatePredecessorTab(a),this.isFromDialogPredecessor=!1):"Notes"===h?this.updateNotesTab(a):"Resources"===h?(this.updateResourceTab(a),this.dialogEditValidationFlag=!1):-1!==h.indexOf("Custom")?this.updateCustomTab(a):"Segments"===h&&this.updateSegmentsData(a))}if(!this.disableUndo&&this.parent.undoRedoModule&&(this.parent.undoRedoModule.getUndoCollection.splice(this.parent.undoRedoModule.getUndoCollection.length-1,1),this.parent.toolbarModule&&0===this.parent.undoRedoModule.getUndoCollection.length&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!1),this.parent.totalUndoAction--),this.isEdit){this.parent.editModule.editedRecord=this.rowData,this.parent.dataOperation.updateWidthLeft(this.rowData);e={data:this.rowData,action:"DialogEditing"};this.parent.editModule.initiateUpdateAction(e)}else if(this.parent.editModule.editedRecord=this.addedRecord,"ResourceView"===this.parent.viewType){var l=Pe({},this.addedRecord,!0);if(l[this.parent.taskFields.resourceInfo].length)for(i=0;i<l[this.parent.taskFields.resourceInfo].length;i++){var h=l[this.parent.taskFields.resourceInfo][i].toString(),d=this.parent.getTaskIds().indexOf("R"+h.toString());if(-1!==d){this.parent.editModule.addRecord(this.addedRecord,"Child",d);break}}else this.parent.editModule.addRecord(this.addedRecord,"Bottom")}else this.parent.editModule.addRecord(this.addedRecord,this.parent.editSettings.newRowPosition,this.parent.selectedRowIndex);return!0},PXt.prototype.compareObjects=function(e,r){return!je(e)&&e.every(function(e,t){for(var i=r[t],n=Object.keys(e),o=0;o<n.length;o++)if("startDate"===n[o]||"endDate"===n[o]){if(e[n[o]].getTime()!==i[n[o]].getTime())return!0}else if("duration"===n[o]&&e[n[o]]!==i[n[o]])return!0;return!1})},PXt.prototype.updateSegmentTaskData=function(e){var t,i,n=this.parent.taskFields;this.isEdit?(t=this.rowData.ganttProperties.segments,this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,e,this.rowData),i=this.parent.dataOperation.setSegmentsInfo(this.rowData,!0),(this.parent.enableUndoRedo&&t&&i&&t.length!==i.length||!t&&i||t&&!i||this.compareObjects(t,i))&&(this.disableUndo=!0),this.parent.setRecordValue("segments",i,this.rowData.ganttProperties,!0),this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(this.rowData,!1),this.rowData.ganttProperties,!0),e.length<=0&&this.validateDuration(this.rowData)):this.addedRecord[n.segments]=e},PXt.prototype.updateSegmentsData=function(e){var e=e.ej2_instances[0],t=e.isEdit;e.isEdit&&e.endEdit(),t=t&&e.currentViewData.length!==e.dataSource.length?e.dataSource:e.currentViewData,this.updateSegmentTaskData(t)},PXt.prototype.updateGeneralTab=function(e,t){var i=this.parent,n=e.childNodes,o={};this.isEdit||(o=this.addedRecord);for(var r=0;r<n.length;r++){var s,a,l,h=n[r],d=h.querySelector('input[id^="'+i.element.id+'"]')||h.querySelector('textarea[id^="'+i.element.id+'"]'),p=Array.from(h.children).find(function(e){return e.classList.contains("e-richtexteditor")});(d=p?p:d)&&(p=d.id.replace(i.element.id,""),h=h.querySelector("#"+i.element.id+p).ej2_instances[0],"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType&&p===this.parent.taskFields.id&&(s=h.value.toString(),h.value=s),s=i.columnByField[p],(p===this.parent.taskFields.duration?parseInt(this.rowData[p],10)!==parseInt(h.value,10):this.rowData[p]!==h.value)&&(this.disableUndo=!0),je(s)||je(s.edit)||!je(s.edit.params)?je(s)||"booleanedit"!==s.editType?(p===this.parent.taskFields.duration?(a=parseFloat(String(h.value)),o[p]=a):(0<this.parent.weekWorkingTime.length&&h.value&&(p===this.parent.taskFields.startDate||p===this.parent.taskFields.baselineStartDate)&&(a=p===this.parent.taskFields.startDate?this.beforeOpenArgs.rowData.ganttProperties.startDate:this.beforeOpenArgs.rowData.ganttProperties.baselineStartDate,this.parent.getStartTime(a)/3600===a.getHours())&&(l=this.parent.getStartTime(h.value),this.parent.dataOperation.setTime(l,h.value)),o[p]=h.value),this.parent.enableHtmlSanitizer&&"string"==typeof h.value&&(h.value=go.sanitize(h.value),o[p]=h.value)):d instanceof HTMLInputElement&&!0===d.checked?o[p]=!0:o[p]=!1:"string"==typeof(l=s.edit.read)?(l=FB(l,window),o[p]=l(d,h.value)):o[p]=s.edit.read(d,h.value))}this.isEdit&&(t||this.updateScheduleProperties(this.editedRecord,this.rowData),i.editModule.validateUpdateValues(o,this.rowData,!0))},PXt.prototype.updateScheduleProperties=function(e,t){this.parent.setRecordValue("startDate",e.ganttProperties.startDate,t.ganttProperties,!0),this.parent.setRecordValue("endDate",e.ganttProperties.endDate,t.ganttProperties,!0),this.parent.setRecordValue("duration",e.ganttProperties.duration,t.ganttProperties,!0),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,t.ganttProperties,!0),this.parent.setRecordValue("work",e.ganttProperties.work,t.ganttProperties,!0),this.parent.setRecordValue("type",e.ganttProperties.taskType,t.ganttProperties,!0),this.parent.setRecordValue("taskType",e.ganttProperties.taskType,t.ganttProperties,!0),this.parent.setRecordValue("resourceNames",e.ganttProperties.resourceNames,t.ganttProperties,!0),this.parent.setRecordValue("resourceInfo",e.ganttProperties.resourceInfo,t.ganttProperties,!0),je(this.parent.taskFields.startDate)||this.parent.dataOperation.updateMappingData(t,"startDate"),je(this.parent.taskFields.endDate)||this.parent.dataOperation.updateMappingData(t,"endDate"),je(this.parent.taskFields.duration)||(this.parent.dataOperation.updateMappingData(t,"duration"),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,this.rowData,!0),0===this.rowData.ganttProperties.duration?this.parent.setRecordValue("isMilestone",!0,t.ganttProperties,!0):this.parent.setRecordValue("isMilestone",!1,this.rowData.ganttProperties,!0)),je(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(this.rowData,"work"),je(this.parent.taskFields.manual)||this.parent.dataOperation.updateMappingData(this.rowData,"manual"),je(this.parent.taskFields.type)||this.parent.dataOperation.updateMappingData(this.rowData,"type"),je(this.parent.taskFields.resourceInfo)||this.parent.dataOperation.updateMappingData(this.rowData,"resourceInfo")},PXt.prototype.getMatchingPrefix=function(e,t){for(var i=e.name.split("-"),n="",o=0;o<i.length;o++)if(n=""===n?i[o]:n+"-"+i[o],-1!==t.indexOf(n))return[n];return[]},PXt.prototype.updatePredecessorTab=function(e){for(var e=e.ej2_instances[0],t=(e.isEdit&&e.endEdit(),e.dataSource),i=[],e=[],n="",o=[],r=[],s=0;s<t.length;s++){var a=t[s],l=this.getMatchingPrefix(a,this.parent.ids);(je(a.id)||a.id!==l[0]&&!je(l[0]))&&(a.id=l[0]),-1===o.indexOf(a.id)&&("ProjectView"===this.parent.viewType&&(l=this.parent.flatData[this.parent.ids.indexOf(a.id)]).hasChildRecords&&-1===r.indexOf(l)&&r.push(l),l=a.id+a.type,a.offset&&-1!==a.offset.indexOf("-")?l+=a.offset:l+="+"+a.offset,i.push(l),o.push(a.id))}this.isEdit?(n=0<i.length?(e=this.parent.predecessorModule.calculatePredecessor(i.join(","),this.rowData),this.parent.setRecordValue("predecessor",e,this.rowData.ganttProperties,!0),this.parent.predecessorModule.getPredecessorStringValue(this.rowData)):(this.parent.setRecordValue("predecessor",e=[],this.rowData.ganttProperties,!0),""),this.parent.undoRedoModule&&0<this.parent.undoRedoModule.getUndoCollection.length&&(this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1].connectedRecords=r,""===n&&(je(this.rowData.ganttProperties.predecessorsName)||this.rowData.ganttProperties.predecessorsName===n||this.disableUndo)||(this.disableUndo=!0)),this.parent.setRecordValue("predecessorsName",n,this.rowData.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,n,this.rowData),this.parent.setRecordValue(this.parent.taskFields.dependency,n,this.rowData),this.parent.predecessorModule.updateUnscheduledDependency(this.rowData)):this.addedRecord[this.parent.taskFields.dependency]=0<i.length?i.join(","):""},PXt.prototype.updateResourceTab=function(e){var t=this,e=e.ej2_instances[0],i=(e&&e.grid.endEdit(),this.ganttResources),n=(i.forEach(function(e){null===e[t.parent.resourceFields.unit]&&(e[t.parent.resourceFields.unit]=0)}),"ResourceView"!==this.parent.viewType||je(this.rowData.ganttProperties)||(JSON.stringify(this.ganttResources)!==JSON.stringify(this.rowData.ganttProperties.resourceInfo)?(this.isResourceUpdate=!0,this.previousResource=je(this.rowData.ganttProperties.resourceInfo)?[]:this.rowData.ganttProperties.resourceInfo.slice()):this.isResourceUpdate=!1),[]);if(this.isEdit){if((this.rowData.ganttProperties.resourceInfo&&i.length!==this.rowData.ganttProperties.resourceInfo.length||je(this.rowData.ganttProperties.resourceInfo)&&0<i.length)&&(this.disableUndo=!0),!this.disableUndo)for(var o=0;o<i.length;o++)if(JSON.stringify(i[o])!==JSON.stringify(this.rowData.ganttProperties.resourceInfo[o])){this.disableUndo=!0;break}this.parent.setRecordValue("resourceInfo",i,this.editedRecord.ganttProperties,!0),this.parent.dataOperation.updateMappingData(this.editedRecord,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(this.editedRecord,"resource"),this.validateDuration(this.editedRecord),this.updateScheduleProperties(this.editedRecord,this.rowData)}else{for(o=0;o<i.length;o++)n.push(i[o][this.parent.resourceFields.id]),this.isAddNewResource=!0;this.addedRecord[this.parent.taskFields.resourceInfo]=n}},PXt.prototype.updateNotesTab=function(e){var t=this.parent,e=e.ej2_instances[0];this.isEdit?(t.columnByField[t.taskFields.notes].disableHtmlEncode?(this.rowData.ganttProperties.notes===e.getText()||null===this.rowData.ganttProperties.notes&&""===e.getText()||this.disableUndo||(this.disableUndo=!0),e.getHtml().includes("href")?this.parent.setRecordValue("notes",e.getHtml(),this.rowData.ganttProperties,!0):this.parent.setRecordValue("notes",e.getText(),this.rowData.ganttProperties,!0)):(this.rowData.ganttProperties.notes===e.getHtml()||null===this.rowData.ganttProperties.notes&&"<p><br></p>"===e.getHtml()||this.disableUndo||(this.disableUndo=!0),this.parent.setRecordValue("notes",e.getHtml(),this.rowData.ganttProperties,!0)),t.dataOperation.updateMappingData(this.rowData,"notes")):t.columnByField[t.taskFields.notes].disableHtmlEncode?this.addedRecord[this.parent.taskFields.notes]=e.getText():this.addedRecord[this.parent.taskFields.notes]=e.getHtml()},PXt.prototype.updateCustomTab=function(e){this.updateGeneralTab(e,!0)},PXt);function PXt(e){this.isFromDialogPredecessor=!1,this.isTriggered=!1,this.taskFieldColumn=[],this.customFieldColumn=[],this.processedId=[],this.updatedEditFields=null,this.updatedAddFields=null,this.addedRecord=null,this.dialogEditValidationFlag=!1,this.ganttResources=[],this.isValidData=!0,this.isResourceTabUpdated=!1,this.previousResource=[],this.isResourceUpdate=!1,this.parent=e,this.localeObj=this.parent.localeObj,this.beforeOpenArgs={cancel:!1},this.types=this.getPredecessorType(),this.rowData={},this.editedRecord={},this.inputs={booleanedit:ib,dropdownedit:qz,datepickeredit:o9,datetimepickeredit:jq,maskededit:LR,numericedit:NL,stringedit:fV,defaultedit:fV},this.processDialogFields(),this.wireEvents()}var BXt=function(){return(BXt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},FXt=(LXt.prototype.updateConnectorLineEditElement=function(e){e=this.getConnectorLineHoverElement(e.target);R("editModule.taskbarEditModule.taskBarEditAction",this.parent)||this.highlightConnectorLineElements(e)},LXt.prototype.getConnectorLineHoverElement=function(e){var t=oqt(e,vGt),i=oqt(e,CGt),n=oqt(e,bGt),o=oqt(e,wGt);return t||i||n||o?oqt(e,yGt):null},LXt.prototype.highlightConnectorLineElements=function(e){e?e!==this.connectorLineElement&&(this.removeHighlight(),this.addHighlight(e)):this.removeHighlight()},LXt.prototype.addHighlight=function(e){e=(this.connectorLineElement=e).querySelector("."+vGt);e&&e.setAttribute("stroke-width",(this.parent.connectorLineModule.lineStroke+1).toString())},LXt.prototype.removeHighlight=function(){var e;this.connectorLineElement&&((e=this.connectorLineElement.querySelector("."+vGt))&&e.setAttribute("stroke-width",this.parent.connectorLineModule.lineStroke.toString()),this.connectorLineElement=null)},LXt.prototype.getEditedConnectorLineString=function(e){for(var t,i=new Set,n=document.createDocumentFragment(),o=0;o<e.length;o++)if(t=e[o].ganttProperties.predecessor)for(var r=0;r<t.length;r++){var s,a=t[r],l="parent"+a.from+"child"+a.to;this.parent.connectorLineModule.removeConnectorLineById(l),l=this.parent.connectorLineModule.getRecordByID(a.from),s=this.parent.connectorLineModule.getRecordByID(a.to),!(!this.parent.allowParentDependency&&(l&&l.expanded||s&&s.expanded)||this.parent.allowParentDependency&&(l||s))||je(l=this.parent.predecessorModule.updateConnectorLineObject(l,s,a))||i.has(l.connectorLineId)||(s=this.parent.connectorLineModule.getConnectorLineTemplate(l),i.add(l.connectorLineId),n.appendChild(s))}return n},LXt.prototype.refreshEditedRecordConnectorLine=function(e){this.parent.connectorLineModule.removePreviousConnectorLines(this.parent.previousRecords),this.parent.connectorLineModule.expandedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.updatedRecords:this.parent.getExpandedRecords(this.parent.updatedRecords);e=this.getEditedConnectorLineString(e);e&&this.parent.connectorLineModule.svgObject.appendChild(e)},LXt.prototype.idFromPredecessor=function(e){for(var t=e.split(","),i=[],n=[],o=[],r=0;r<t.length;r++){var s,a=[],l=void 0,h=!1,d=void 0,p=!1,c=t[r].split("-");6===c.length&&(c[4]=c[4]+"-"+c[5],c.pop()),5===c.length&&12<=c[4].length&&(s=t[r].substring(0,36),/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(s))&&(p=!0),t[r].includes("-")&&(t[r].includes("-")&&(t[r].includes("days")||t[r].includes("day"))&&0<(s=t[r].split(/-(?=\d)/)).length&&(d=s[s.length-1]),t[r].includes("-"))&&/[A-Za-z]/.test(d)&&-1!==(d=t[r].indexOf(d))&&(l=t[r].substring(0,d-1)).includes("-")&&(h=!0),p?(p=d=void 0,1===(d=c[4].split("+")).length?n[0]=t[r]:(p=d[1].length,n[0]=t[r].slice(0,-(p+1)),n[1]=d[1]),0<=c[4].indexOf("-")&&(1===(d=c[4].split("-")).length?n[0]=t[r]:(p=d[1].length,n[0]=t[r].slice(0,-(p+1)),n[1]=d[1]))):h&&l.includes("-")?n[0]=l:(n=t[r].split("+"),0<=t[r].indexOf("-")&&(n=t[r].split("-"))),je(n[0])||(-1===("ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids).indexOf(n[0])?-1!==n[0].indexOf(" ")?(1===(o=n[0].split(" ")).length&&(o=n[0].match(/(\d+|[A-z]+)/g)),a.push(o[0])):1===n[0].length||2===n[0].length?a.push(n[0]):a.push(n[0].slice(0,-2)):a.push(n[0])),i.push(a.join(""))}return i},LXt.prototype.predecessorValidation=function(e,t){for(var i,n=t.rowUniqueID,o=0;o<e.length;o++)for(var r=e[o],s=[],a=(e.slice(0).splice(o,1),this);null!==r;){var l=function(){var t=[];return-1===s.indexOf(r)?je(a.parent.connectorLineModule.getRecordByID(r))||(!je((i=a.parent.connectorLineModule.getRecordByID(r).ganttProperties).predecessor)&&0<i.predecessor.length&&i.predecessor.forEach(function(e){i.rowUniqueID.toString()!==e.from&&t.push(e.from.toString())}),n.toString()===i.rowUniqueID.toString())||-1!==t.indexOf(n.toString())?{value:!1}:(s.push(r),!je(i.predecessor)&&0<i.predecessor.length?void(r=i.predecessor[0].from):"break"):"break"}();if("object"==typeof l)return l.value;if("break"===l)break}return!0},LXt.prototype.validatePredecessorRelation=function(s,e){var a,l=!0,h="ResourceView"===this.parent.viewType?s.ganttProperties.taskId:s.ganttProperties.rowUniqueID;if(!je(e)&&0<e.length)for(var d=this.idFromPredecessor(e),t=function(e){if(p.parent.allowParentDependency)parseInt(d[d.length-1],10)!==s[p.parent.taskFields.id]&&(t=p.parent.ids.indexOf(d[d.length-1]),t=p.parent.currentViewData[t])&&s&&(l=p.parent.predecessorModule.validateParentPredecessor(t,s));else if(!p.checkParentRelation(s,d))return{value:!1};var t=d.slice(0),i=[],n=!0;if(t.forEach(function(e){-1===i.indexOf(e)?i.push(e):n=!1}),!n)return{value:!1};a=d[e];var r=[];for(d.slice(0).splice(e,1);null!==a;){var o=function(){var i,n,e,o=[];return-1===r.indexOf(a)?je(p.parent.connectorLineModule.getRecordByID(a.toString()))||(!je((n=p.parent.connectorLineModule.getRecordByID(a.toString()).ganttProperties).predecessor)&&0<n.predecessor.length&&n.predecessor.forEach(function(e,t){n.rowUniqueID.toString()!==e.from&&(o.push(e.from.toString()),i=t)}),h.toString()===n.rowUniqueID.toString())||-1!==o.indexOf(h.toString())?{value:!1}:(r.push(a),!je(n.predecessor)&&0<n.predecessor.length?(e=void 0,1<o.length?e=p.predecessorValidation(o,s.ganttProperties):1===o.length&&(a=n.predecessor[i].from),!1===e?{value:!1}:void 0):"break"):"break"}();if("object"==typeof o)return o;if("break"===o)break}},p=this,i=0;i<d.length;i++){var n=t(i);if("object"==typeof n)return n.value}return l},LXt.prototype.addPredecessor=function(e,t){t=je(e.ganttProperties.predecessorsName)||""===e.ganttProperties.predecessorsName?t:e.ganttProperties.predecessorsName+","+t;this.updatePredecessorHelper(e,t)},LXt.prototype.removePredecessor=function(e){this.isPublicDependencyDelete=!0,this.updatePredecessorHelper(e,null)},LXt.prototype.updatePredecessor=function(e,t,i){return this.updatePredecessorHelper(e,t,i)},LXt.prototype.updatePredecessorHelper=function(e,t,i){var n;return ee(t)||this.validatePredecessorRelation(e,t)?(this.parent.isOnEdit=!0,n=[],je(t)||""===t||(n=this.parent.predecessorModule.calculatePredecessor(t,e)),this.parent.setRecordValue("predecessor",n,e.ganttProperties,!0),n=this.parent.predecessorModule.getPredecessorStringValue(e),this.parent.setRecordValue("predecessorsName",n,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,n,e),this.parent.setRecordValue(this.parent.taskFields.dependency,n,e),(n={}).action=i&&i.action&&"CellEditing"===i.action?i.action:this.parent.contextMenuModule&&this.parent.contextMenuModule.isCntxtMenuDependencyDelete||this.isPublicDependencyDelete?"DeleteConnectorLine":"DrawConnectorLine",n.data=e,this.parent.editModule.initiateUpdateAction(n),!0):(e.taskData[this.parent.taskFields.dependency]&&(e.taskData[this.parent.taskFields.dependency]=null),i=t+" is an invalid relation for task "+this.parent.taskFields.id+". Kindly ensure the "+this.parent.taskFields.dependency+" field contains only valid predecessor relations.",this.parent.trigger("actionFailure",{error:i}),!1)},LXt.prototype.checkParentRelation=function(e,i){if(e&&e.parentItem&&-1!==i.indexOf(e.parentItem.taskId.toString()))return!1;for(var n=this,t=0;t<i.length;t++){var o=function(t){var e=n.parent.currentViewData.filter(function(e){return e&&e.ganttProperties.rowUniqueID.toString()===i[t].toString()});if(e[0]&&e[0].hasChildRecords)return{value:!1}}(t);if("object"==typeof o)return o.value}return!0},LXt.prototype.initPredecessorValidationDialog=function(){var e;this.parent.taskFields.dependency&&this.parent.isInPredecessorValidation&&(e=Q("div",{id:this.parent.element.id+"_dialogValidationRule"}),this.parent.element.appendChild(e),this.renderValidationDialog())},LXt.prototype.renderValidationDialog=function(){var e=new pS({header:"Validate Editing",isModal:!0,enableRtl:this.parent.enableRtl,visible:!1,width:"50%",showCloseIcon:!0,close:this.validationDialogClose.bind(this),content:"",buttons:[{click:this.validationDialogOkButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.validationDialogCancelButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});document.getElementById(this.parent.element.id+"_dialogValidationRule").innerHTML="",e.isStringTemplate=!0,e.appendTo("#"+this.parent.element.id+"_dialogValidationRule"),this.parent.validationDialogElement=e},LXt.prototype.validationDialogOkButton=function(){var e=this.parent.currentEditedArgs;e.validateMode.preserveLinkWithEditing=document.getElementById(this.parent.element.id+"_ValidationAddlineOffset").checked,e.validateMode.removeLink=document.getElementById(this.parent.element.id+"_ValidationRemoveline").checked,e.validateMode.respectLink=document.getElementById(this.parent.element.id+"_ValidationCancel").checked,this.applyPredecessorOption(),this.parent.validationDialogElement.hide()},LXt.prototype.validationDialogCancelButton=function(){this.parent.currentEditedArgs.validateMode.respectLink=!0,this.applyPredecessorOption(),this.parent.validationDialogElement.hide()},LXt.prototype.validationDialogClose=function(e){R("isInteraction",e)&&(this.parent.currentEditedArgs.validateMode.respectLink=!0,this.applyPredecessorOption())},LXt.prototype.applyPredecessorOption=function(){var t,i,e=this.parent.currentEditedArgs,n=e.data;e.validateMode.respectLink?(this.parent.editModule.reUpdatePreviousRecords(),this.parent.chartRowsModule.refreshRecords([e.data])):e.validateMode.removeLink?(this.checkChildRecords(n),this.parent.editModule.updateEditedTask(e.editEventArgs)):e.validateMode.preserveLinkWithEditing&&(this.parent.updateOffsetOnTaskbarEdit&&(i=n.ganttProperties.taskId,n.ganttProperties.predecessor)&&n.ganttProperties.predecessor.forEach(function(e){i===e.from&&(t=e.to)}),this.parent.editModule.updateEditedTask(e.editEventArgs),this.processPredecessors(t))},LXt.prototype.compareArrays=function(e,t){return e.length===t.length&&JSON.stringify(e)===JSON.stringify(t)},LXt.prototype.processPredecessors=function(e){var t,i,n=this;e&&(t=this.parent.getRecordByID(e))&&t.ganttProperties&&t.ganttProperties.predecessor&&(this.parent.connectorLineEditModule.validatedOffsetIds=[],this.calculateOffset(t),i=!0,(e=this.validatedId.find(function(e){return e.id===t.ganttProperties.taskId}))&&(e=e.value,this.compareArrays(e,t.ganttProperties.predecessor))&&(i=!1),t.ganttProperties.predecessor.forEach(function(e){t.ganttProperties.taskId===e.from&&i&&n.processPredecessors(e.to)}))},LXt.prototype.checkChildRecords=function(e){var t;if(this.validationPredecessor=e.ganttProperties.predecessor,je(this.validationPredecessor)||this.removePredecessors(e,this.validationPredecessor),0<e.childRecords.length)for(var i=0;i<e.childRecords.length;i++){var n=e.childRecords[i];this.validationPredecessor=n.ganttProperties.predecessor,je(this.validationPredecessor)||this.removePredecessors(n,this.validationPredecessor),0<n.childRecords.length&&this.checkChildRecords(n)}else je(e.parentItem)||(t=this.parent.getRecordByID(e.parentItem.taskId),this.validationPredecessor=t.ganttProperties.predecessor,this.removePredecessors(t,this.validationPredecessor))},LXt.prototype.compareObjects=function(t,i){var e=Object.keys(t).filter(function(e){return"offset"!==e}),n=Object.keys(i).filter(function(e){return"offset"!==e});return e.length===n.length&&e.every(function(e){return t[e]===i[e]})},LXt.prototype.calculateOffset=function(h,e){var i=this;if(this.parent.autoCalculateDateScheduling&&!(this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)&&h&&null!==rqt(h.ganttProperties)){var d=Pe([],h.ganttProperties.predecessor,[],!0),p=this.parent.predecessorModule.getValidPredecessor(h);if(0<p.length){this.cumulativePredecessorChanges=d;for(var c=this,t=0;t<p.length;t++)!function(t){var e=p[parseInt(t.toString(),10)],i=c.parent.connectorLineModule.getRecordByID(e.from),n=(c.parent.undoRedoModule&&c.parent.undoRedoModule.isUndoRedoPerformed&&"ProjectView"===c.parent.viewType&&0===i.ganttProperties.predecessor.filter(function(e){return e.from===p[t].from&&e.to===p[t].to}).length&&i.ganttProperties.predecessor.push(p[t]),void 0);if((i.ganttProperties.startDate||i.ganttProperties.endDate)&&(h.ganttProperties.startDate||h.ganttProperties.endDate)){var o=void 0,r=void 0,s=void 0,a=void 0;switch(e.type){case"FS":o=new Date((i.ganttProperties.endDate||i.ganttProperties.startDate).getTime()),r=new Date((h.ganttProperties.startDate||h.ganttProperties.endDate).getTime());break;case"SS":o=new Date((i.ganttProperties.startDate||i.ganttProperties.endDate).getTime()),r=new Date((h.ganttProperties.startDate||h.ganttProperties.endDate).getTime());break;case"SF":o=new Date((i.ganttProperties.startDate||i.ganttProperties.endDate).getTime()),r=new Date((h.ganttProperties.endDate||h.ganttProperties.startDate).getTime());break;case"FF":o=new Date((i.ganttProperties.endDate||i.ganttProperties.startDate).getTime()),r=new Date((h.ganttProperties.endDate||h.ganttProperties.startDate).getTime())}a=o.getTime()<r.getTime()?(o=c.dateValidateModule.checkStartDate(o),r=c.dateValidateModule.checkEndDate(r,null),!1):(l=new Date(o.getTime()),o=c.dateValidateModule.checkStartDate(r),r=c.dateValidateModule.checkEndDate(l,null),!0),n=o.getTime()<r.getTime()?(s=c.dateValidateModule.getDuration(o,r,e.offsetUnit,!0,!1),c.parent.durationUnit===e.offsetUnit&&(i.ganttProperties.startDate&&je(i.ganttProperties.endDate)||je(i.ganttProperties.startDate)&&i.ganttProperties.endDate)&&(s-=1),a?-1*s:s):0}else n=0;var l=gqt(e,"from",d,"to"),a=(-1!==l&&(d[l].offset=n),Pe([],i.ganttProperties.predecessor,[],!0)),s=gqt(e,"from",a,"to");-1!==s&&(a[s].offset=n),c.parent.setRecordValue("predecessor",a,i.ganttProperties,!0)}(t)}else{var n=h.ganttProperties.predecessor;n&&0<n.length&&n.forEach(function(e){-1===i.validatedOffsetIds.indexOf(e.to)&&("ResourceView"===i.parent.viewType?(i.validatedOffsetIds.push(e.to),i.calculateOffset(i.parent.getRecordByID(i.parent.taskIds.indexOf("T"+e.to).toString()),!0)):i.calculateOffset(i.parent.getRecordByID(e.to),!0))})}e?this.parent.setRecordValue("predecessor",d,h.ganttProperties,!0):(0===p.length&&(this.cumulativePredecessorChanges=[]),d&&0<d.length&&this.cumulativePredecessorChanges&&0<this.cumulativePredecessorChanges.length&&(n=d.map(function(t){var e=i.cumulativePredecessorChanges.find(function(e){return i.compareObjects(e,t)});return e?BXt({},e):null}).filter(function(e){return null!==e}),this.parent.setRecordValue("predecessor",n,h.ganttProperties,!0)));e=this.parent.predecessorModule.getPredecessorStringValue(h);if(this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,e,h),this.parent.setRecordValue(this.parent.taskFields.dependency,e,h),this.parent.setRecordValue("predecessorsName",e,h.ganttProperties,!0),-1===this.validatedOffsetIds.indexOf(h.ganttProperties.taskId.toString())&&this.validatedOffsetIds.push(h.ganttProperties.taskId.toString()),h.hasChildRecords)for(t=0;t<h.childRecords.length;t++)-1===this.validatedOffsetIds.indexOf(h.childRecords[t].ganttProperties.taskId.toString())&&h.childRecords[t].ganttProperties.predecessor&&0<h.childRecords[t].ganttProperties.predecessor.length&&this.calculateOffset(h.childRecords[t]);else h.parentItem&&(n=this.parent.getRecordByID(h.parentItem.taskId),-1===this.validatedOffsetIds.indexOf(n.ganttProperties.taskId.toString()))&&n.ganttProperties.predecessor&&0<n.ganttProperties.predecessor.length&&this.calculateOffset(n)}},LXt.prototype.removePredecessors=function(e,t){var i=Pe([],[],e.ganttProperties.predecessor,!0);if(!je(t)){for(var n,o=t.length,r=0;r<o;r++){var s=this.parent.connectorLineModule.getRecordByID(t[r].from),a=Pe([],[],s.ganttProperties.predecessor,!0),l=gqt(t[r],"from",i,"to"),l=(i.splice(l,1),gqt(t[parseInt(r.toString(),10)],"from",a,"to"));a.splice(l,1),this.parent.setRecordValue("predecessor",a,s.ganttProperties,!0)}i.length!==e.ganttProperties.predecessor.length&&(this.parent.setRecordValue("predecessor",i,e.ganttProperties,!0),n=this.parent.predecessorModule.getPredecessorStringValue(e),this.parent.setRecordValue("predecessorsName",n,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,n,e),this.parent.setRecordValue(this.parent.taskFields.dependency,n,e))}},LXt.prototype.openValidationDialog=function(e){e=this.validationDialogTemplate(e);this.parent.validationDialogElement.setProperties({content:e}),this.parent.validationDialogElement.show()},LXt.prototype.validationDialogTemplate=function(e){var t,i=this.parent.element.id,n=Q("div",{className:"e-ValidationContent"}),o=R("task",e),r=R("parentTask",e),e=R("violationType",e),s=o.ganttProperties.taskName,o=this.parent.getFormatedDate(o.ganttProperties.startDate,this.parent.dateFormat),r=[s,r.ganttProperties.taskName],e=("taskBeforePredecessor_FS"===e?t=this.parent.localeObj.getConstant("taskBeforePredecessor_FS"):"taskAfterPredecessor_FS"===e?t=this.parent.localeObj.getConstant("taskAfterPredecessor_FS"):"taskBeforePredecessor_SS"===e?t=this.parent.localeObj.getConstant("taskBeforePredecessor_SS"):"taskAfterPredecessor_SS"===e?t=this.parent.localeObj.getConstant("taskAfterPredecessor_SS"):"taskBeforePredecessor_FF"===e?t=this.parent.localeObj.getConstant("taskBeforePredecessor_FF"):"taskAfterPredecessor_FF"===e?t=this.parent.localeObj.getConstant("taskAfterPredecessor_FF"):"taskBeforePredecessor_SF"===e?t=this.parent.localeObj.getConstant("taskBeforePredecessor_SF"):"taskAfterPredecessor_SF"===e&&(t=this.parent.localeObj.getConstant("taskAfterPredecessor_SF")),'<div id="'+i+'_ValidationText">'+(t=uqt(t,r))+"<div>");return n.innerHTML=e+('<table><tr><td><input type="radio" id="'+i+'_ValidationCancel" name="ValidationRule" checked/><label for="'+i+'_ValidationCancel" id= "'+i+'_cancelLink">Cancel, keep the existing link</label></td></tr><tr><td><input type="radio" id="'+i+'_ValidationRemoveline" name="ValidationRule"/><label for="'+i+'_ValidationRemoveline" id="'+i+'_removeLink">Remove the link and move <b>'+s+"</b> to start on <b>"+o+'</b>.</label></td></tr><tr><td><input type="radio" id="'+i+'_ValidationAddlineOffset" name="ValidationRule"/><label for="'+i+'_ValidationAddlineOffset" id="'+i+'_preserveLink">Move the <b>'+s+"</b> to start on <b>"+o+"</b> and keep the link.</label></td></tr></table>"),n},LXt.prototype.validateTypes=function(e,t){for(var i,n,o=this.parent.predecessorModule.getValidPredecessor(e),r=(this.validationPredecessor=[],this.parent.predecessorModule.getPredecessorDate(e,o)),s=(t||e).ganttProperties,a=this.parent.allowUnscheduledTasks&&je(r)?s.endDate:this.dateValidateModule.getEndDate(r,s.duration,s.durationUnit,s,!1),l=0;l<o.length;l++){var h,d,p=this.parent.connectorLineModule.getRecordByID(o[l].from),c=null;"FS"===o[l].type?0!==this.parent.dateValidationModule.getDuration(r,s.startDate,this.parent.durationUnit,s.isAutoSchedule,s.isMilestone,!0)&&(s.startDate<r?(this.validationPredecessor.push(o[parseInt(l.toString(),10)]),c="taskBeforePredecessor_FS"):s.startDate>r&&(this.validationPredecessor.push(o[parseInt(l.toString(),10)]),c="taskAfterPredecessor_FS")):"SS"===o[l].type?(h=new Date(s.endDate),d=new Date(r),s.startDate<r?(this.validationPredecessor.push(o[parseInt(l.toString(),10)]),c="taskBeforePredecessor_SS"):s.startDate>r?(this.validationPredecessor.push(o[parseInt(l.toString(),10)]),c="taskAfterPredecessor_SS"):this.parent.allowUnscheduledTasks&&je(s.startDate)&&je(s.duration)&&h.setHours(0,0,0,0)<d.setHours(0,0,0,0)?(this.validationPredecessor.push(o[parseInt(l.toString(),10)]),c="taskBeforePredecessor_SS"):this.parent.allowUnscheduledTasks&&je(s.startDate)&&je(s.duration)&&h.setHours(0,0,0,0)>d.setHours(0,0,0,0)&&(this.validationPredecessor.push(o[parseInt(l.toString(),10)]),c="taskAfterPredecessor_SS")):"FF"===o[l].type?0!==this.parent.dateValidationModule.getDuration(r,p.ganttProperties.endDate,this.parent.durationUnit,p.ganttProperties.isAutoSchedule,p.ganttProperties.isMilestone,!0)&&(a<=p.ganttProperties.endDate?(this.validationPredecessor.push(o[parseInt(l.toString(),10)]),c="taskBeforePredecessor_FF"):a>p.ganttProperties.endDate&&(this.validationPredecessor.push(o[parseInt(l.toString(),10)]),c="taskAfterPredecessor_FF")):"SF"===o[l].type&&0!==this.parent.dateValidationModule.getDuration(p.ganttProperties.startDate,a,this.parent.durationUnit,p.ganttProperties.isAutoSchedule,p.ganttProperties.isMilestone,!0)&&(a<p.ganttProperties.startDate?(this.validationPredecessor.push(o[parseInt(l.toString(),10)]),c="taskBeforePredecessor_SF"):a>=p.ganttProperties.startDate&&(this.validationPredecessor.push(o[parseInt(l.toString(),10)]),c="taskAfterPredecessor_SF")),!je(c)&&je(n)&&(i=p,n=c)}return{parentTask:i,task:e,violationType:n}},LXt.prototype.addRemovePredecessor=function(o){var e=this.parent.previousRecords[o.uniqueID],n=o.ganttProperties.predecessor.slice();if(e&&e.ganttProperties&&e.ganttProperties.hasOwnProperty("predecessor")){var r=e.ganttProperties.predecessor;if(!je(r))for(var s=this,t=0;t<r.length;t++)!function(t){var e,i,n=s.parent.connectorLineModule.getRecordByID(r[parseInt(t.toString(),10)].from);n===o?0!==o.ganttProperties.predecessor.filter(function(e){return r[t].from===e.from&&r[t].to===e.to}).length||o.parentItem&&s.parent.taskFields.dependency&&o.ganttProperties.predecessor&&s.parent.allowParentDependency&&(r[t].from===o.parentItem.taskId||r[t].to===o.parentItem.taskId)||o.ganttProperties.predecessor.push(r[parseInt(t.toString(),10)]):(e=Pe([],[],n.ganttProperties.predecessor,!0),-1!==(i=gqt(r[parseInt(t.toString(),10)],"from",e,"to"))&&(e.splice(i,1),s.parent.setRecordValue("predecessor",e,n.ganttProperties,!0)))}(t);if(!je(n))for(var a=this,i=0;i<n.length;i++)!function(t){var e=a.parent.connectorLineModule.getRecordByID(n[parseInt(t.toString(),10)].from),i=Pe([],[],e.ganttProperties.predecessor,!0);0===i.filter(function(e){return n[t].from===e.from&&n[t].to===e.to}).length&&(i.push(n[parseInt(t.toString(),10)]),a.parent.setRecordValue("predecessor",i,e.ganttProperties,!0))}(i)}},LXt.prototype.removePredecessorByIndex=function(e,t){this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(i={action:"DeleteDependency"}).modifiedRecords=Pe([],[e],[],!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=i);var i=e.ganttProperties.predecessor,t=i.splice(t,1),n=this.parent.connectorLineModule.getRecordByID(t[0].from).ganttProperties.predecessor,o=gqt(t[0],"from",n,"to"),n=(n.splice(o,1),this.parent.predecessorModule.getPredecessorStringValue(e));i.push(t[0]),this.parent.connectorLineEditModule.updatePredecessor(e,n)},LXt.prototype.renderPredecessorDeleteConfirmDialog=function(){this.confirmPredecessorDialog=new pS({width:"320px",isModal:!0,enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("confirmPredecessorDelete"),buttons:[{click:this.confirmOkDeleteButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.confirmCloseDialog.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});var e=Q("div",{id:this.parent.element.id+"_deletePredecessorConfirmDialog"});this.parent.element.appendChild(e),this.confirmPredecessorDialog.isStringTemplate=!0,this.confirmPredecessorDialog.appendTo(e)},LXt.prototype.confirmCloseDialog=function(){this.confirmPredecessorDialog.destroy()},LXt.prototype.confirmOkDeleteButton=function(){this.removePredecessorByIndex(this.childRecord,this.predecessorIndex),this.confirmPredecessorDialog.destroy()},LXt);function LXt(e){this.validationPredecessor=null,this.confirmPredecessorDialog=null,this.predecessorIndex=null,this.childRecord=null,this.validatedId=[],this.validatedOffsetIds=[],this.isPublicDependencyDelete=!1,this.parent=e,this.dateValidateModule=this.parent.dateValidationModule,this.parent.on("initPredessorDialog",this.initPredecessorValidationDialog,this)}var RXt=function(){return(RXt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ts=(OXt.prototype.getModuleName=function(){return"edit"},OXt.prototype.updateDefaultColumnEditors=function(){for(var e,t=[this.parent.taskFields.id,this.parent.taskFields.progress,this.parent.taskFields.resourceInfo,this.parent.taskFields.type,"taskType"],i=0;i<t.length;i++)!je(t[i])&&0<t[i].length&&(e=this.parent.getColumnByField(t[parseInt(i.toString(),10)],this.parent.treeGridModule.treeGridColumns))&&(e.field===this.parent.taskFields.id?this.updateIDColumnEditParams(e):e.field===this.parent.taskFields.progress&&je(e.edit)?this.updateProgessColumnEditParams(e):e.field===this.parent.taskFields.resourceInfo?this.updateResourceColumnEditor(e):e.field!==this.parent.taskFields.type&&"taskType"!==e.field||this.updateTaskTypeColumnEditor(e))},OXt.prototype.updateIDColumnEditParams=function(e){var t={min:0,decimals:0,enableRtl:this.parent.enableRtl,validateDecimalOnType:!0,format:"n0",showSpinButton:!1};this.updateEditParams(e,t)},OXt.prototype.updateProgessColumnEditParams=function(e){var t={min:0,enableRtl:this.parent.enableRtl,decimals:0,validateDecimalOnType:!0,max:100,format:"n0"};this.updateEditParams(e,t)},OXt.prototype.updateEditParams=function(e,t){je(e.edit)?(e.edit={},e.edit.params={}):je(e.edit.params)&&(e.edit.params={}),Pe(t,e.edit.params),e.edit.params=t,this.parent.getColumnByField(e.field,this.parent.ganttColumns).edit=e.edit},OXt.prototype.updateResourceColumnEditor=function(e){var t;this.parent.treeGridModule.currentEditRow={},this.parent.editSettings.allowEditing&&je(e.edit)&&"Auto"===this.parent.editSettings.mode&&(e.editType="dropdownedit",e.edit=this.getResourceEditor(),(t=this.parent.getColumnByField(e.field,this.parent.ganttColumns)).editType="dropdownedit",t.edit=e.edit)},OXt.prototype.getResourceEditor=function(){var t,r=this,s=this.parent.resourceFields,e={};return zU.Inject(JU),e.write=function(e){r.parent.treeGridModule.currentEditRow={},(t=new zU({dataSource:new me(r.parent.resources),fields:{text:s.name,value:s.id},enableRtl:r.parent.enableRtl,mode:"CheckBox",showDropDownIcon:!0,popupHeight:"350px",delimiterChar:",",value:r.parent.treeGridModule.getResourceIds(e.rowData)})).appendTo(e.element)},e.read=function(e){var t=e.ej2_instances[0].value,i=[];je(t)&&(t=[]);for(var n=0;n<t.length;n++)for(var o=0;o<r.parent.resources.length;o++)if(r.parent.resources[o][s.id]===t[n]){i.push(r.parent.resources[o][s.name]);break}return r.parent.treeGridModule.currentEditRow[r.parent.taskFields.resourceInfo]=t,i.join(",")},e.destroy=function(){t&&t.destroy()},e},OXt.prototype.updateTaskTypeColumnEditor=function(e){var t;this.parent.editSettings.allowEditing&&je(e.edit)&&"Auto"===this.parent.editSettings.mode&&(e.editType="dropdownedit",e.edit=this.getTaskTypeEditor(),(t=this.parent.getColumnByField(e.field,this.parent.ganttColumns)).editType="dropdownedit",t.edit=e.edit)},OXt.prototype.getTaskTypeEditor=function(){var t,i=this,e={},n=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}];return e.write=function(e){i.parent.treeGridModule.currentEditRow={},(t=new qz({dataSource:new me(n),enableRtl:i.parent.enableRtl,fields:{value:"Value"},popupHeight:"350px",value:R("taskType",e.rowData.ganttProperties)})).appendTo(e.element)},e.read=function(e){var e=e.ej2_instances[0].value,t=i.parent.taskFields.type||"taskType";return i.parent.treeGridModule.currentEditRow[t]=e},e.destroy=function(){t&&t.destroy()},e},OXt.prototype.reUpdateEditModules=function(){var e,t=this.parent.editSettings;t.allowEditing?(this.parent.editModule.cellEditModule&&"Dialog"===t.mode?(this.cellEditModule.destroy(),this.parent.treeGrid.recordDoubleClick=this.recordDoubleClick.bind(this)):je(this.parent.editModule.cellEditModule)&&"Auto"===t.mode&&(this.cellEditModule=new wXt(this.parent)),this.parent.editModule.dialogModule&&"Auto"===t.mode?this.parent.treeGrid.recordDoubleClick=void 0:je(this.parent.editModule.dialogModule)&&(this.dialogModule=new kXt(this.parent))):(this.cellEditModule&&this.cellEditModule.destroy(),this.dialogModule&&this.dialogModule.destroy()),t.allowDeleting&&t.showDeleteConfirmDialog?je(this.confirmDialog)&&(e=Q("div",{id:this.parent.element.id+"_deleteConfirmDialog"}),this.parent.element.appendChild(e),this.renderDeleteConfirmDialog()):t.allowDeleting&&t.showDeleteConfirmDialog||this.confirmDialog&&!this.confirmDialog.isDestroyed&&this.confirmDialog.destroy(),t.allowTaskbarEditing?je(this.parent.editModule.taskbarEditModule)&&(this.taskbarEditModule=new EXt(this.parent)):this.taskbarEditModule&&this.taskbarEditModule.destroy()},OXt.prototype.recordDoubleClick=function(e){var t,i;this.parent.editSettings.allowEditing&&"Dialog"===this.parent.editSettings.mode&&(i=void 0,e.row&&(t=R("rowIndex",e.row),i=this.parent.currentViewData[t]),je(i)||this.dialogModule.openEditDialog(i)),this.parent.ganttChartModule.recordDoubleClick(e)},OXt.prototype.destroy=function(){this.cellEditModule&&this.cellEditModule.destroy(),this.taskbarEditModule&&this.taskbarEditModule.destroy(),this.dialogModule&&this.dialogModule.destroy(),this.confirmDialog&&!this.confirmDialog.isDestroyed&&this.confirmDialog.destroy()},OXt.prototype.updateRecordByID=function(r){var s=this;if(this.parent.enableImmutableMode&&this.parent.editSettings.allowEditing&&0<this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length&&this.parent.treeGrid.endEdit(),!this.parent.readOnly){var e=this.parent.taskFields;if(!je(r)&&!je(r[e.id])){var a="ResourceView"===this.parent.viewType?this.parent.flatData[this.parent.getTaskIds().indexOf("T"+r[e.id])]:this.parent.getRecordByID(r[e.id]);if(je(a[e.milestone])||!0===a[e.milestone]&&(a[e.milestone]=!1),this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.isUndoRedoItemPresent("Edit")&&a&&(this.parent.undoRedoModule.createUndoCollection(),(h={}).requestType=this.parent.contextMenuModule&&this.parent.contextMenuModule.item?this.parent.contextMenuModule.item:"methodUpdate",h.modifiedRecords=Pe([],[a],[],!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=h),!je(this.parent.editModule)&&a){if(this.parent.isOnEdit=!0,this.validateUpdateValues(r,a,!0),this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed){if("ProjectView"===this.parent.viewType&&r.ganttProperties.predecessor){for(var l=this,t=0;t<r.ganttProperties.predecessor.length;t++)if("break"===function(t){var e=a.ganttProperties.predecessor.filter(function(e){return e.from===r.ganttProperties.predecessor[t].from&&e.to===r.ganttProperties.predecessor[t].to&&r.ganttProperties.predecessor[t].offset!==e.offset&&(s.parent.flatData[s.parent.ids.indexOf(e.to)].ganttProperties.predecessor.filter(function(e){return e.from===r.ganttProperties.predecessor[t].from&&e.to===r.ganttProperties.predecessor[t].to})[0].offset=r.ganttProperties.predecessor[t].offset),e.from!==r.ganttProperties.predecessor[t].from&&e.from!==r.ganttProperties.predecessor[t].to});if(0<e.length){for(var i=0;i<e.length;i++)for(var n=l.parent.flatData[l.parent.ids.indexOf(e[i].from)],o=0;o<n.ganttProperties.predecessor.length;o++)if(n.ganttProperties.predecessor[o].from===e[i].from&&n.ganttProperties.predecessor[o].to===e[i].to){n.ganttProperties.predecessor.splice(o,1);break}return"break"}}(t))break}else if(!r.ganttProperties.predecessor&&a.ganttProperties.predecessor)for(t=0;t<a.ganttProperties.predecessor.length;t++)for(var i=void 0,i=a.ganttProperties.taskId.toString()===a.ganttProperties.predecessor[t].from?a.ganttProperties.predecessor[t].to:a.ganttProperties.predecessor[t].from,n=this.parent.flatData[this.parent.ids.indexOf(i)],o=0;o<n.ganttProperties.predecessor.length;o++)n.ganttProperties.predecessor[o].from===a.ganttProperties.predecessor[t].from&&n.ganttProperties.predecessor[o].to===a.ganttProperties.predecessor[t].to&&n.ganttProperties.predecessor.splice(o,1);a.ganttProperties.resourceInfo=r.ganttProperties.resourceInfo}r[this.parent.taskFields.resourceInfo]&&(0!==a.ganttProperties.duration||"FixedWork"===a.ganttProperties.taskType&&!this.parent.isConvertedMilestone||this.parent.dataOperation.updateWorkWithDuration(a),this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed||this.updateResourceRelatedFields(a,"resource"),this.parent.dateValidationModule.calculateEndDate(a));var h=Object.keys(r);-1===h.indexOf(e.startDate)&&-1===h.indexOf(e.endDate)&&-1===h.indexOf(e.duration)||this.parent.dataOperation.calculateScheduledValues(a,a.taskData,!1),this.parent.dataOperation.updateWidthLeft(a),ee(r[this.parent.taskFields.dependency])||r[this.parent.taskFields.dependency]===a.ganttProperties.predecessorsName?((h={}).data=a,"ResourceView"===this.parent.viewType&&(h.action="methodUpdate"),this.parent.editModule.initiateUpdateAction(h)):this.parent.connectorLineEditModule.updatePredecessor(a,r[this.parent.taskFields.dependency])}}}},OXt.prototype.validateUpdateValues=function(e,t,i){for(var n=this.parent,o=n.taskFields,r=aqt(n.columnMapping),s=[],a=!1,l=0,h=Object.keys(e);l<h.length;l++){var d=h[l];if(o.startDate===d||o.endDate===d||o.duration===d)je(e[""+d])&&!n.allowUnscheduledTasks||(u=t.ganttProperties,p=o.duration===d,i?(p?(n.dataOperation.updateDurationValue(e[d],u),0<u.duration&&u.isMilestone&&this.parent.setRecordValue("isMilestone",!1,u,!0)):(p="string"==typeof e[d]?new Date(e[d]):e[d],d===o.endDate&&je(u.startDate)&&(je(e[o.duration])||""===e[o.duration]||Number.isNaN(e[o.duration]))&&(p=this.parent.editModule.dialogModule.isFromEditDialog?t.ganttProperties.endDate:e[o.endDate]),n.setRecordValue(r[d],p,u,!0),!t[o.startDate]||t[o.startDate]instanceof Date||(t[o.startDate]=new Date(t[o.startDate])),!t[o.endDate]||t[o.endDate]instanceof Date||(t[o.endDate]=new Date(t[o.endDate]))),n.dataOperation.updateMappingData(t,r[d])):(s.push(d),a=!0));else if(o.resourceInfo===d){var p=n.dataOperation.setResourceInfo(e);"ResourceView"===this.parent.viewType&&(JSON.stringify(p)!==JSON.stringify(t.ganttProperties.resourceInfo)?(this.parent.editModule.dialogModule.isResourceUpdate=!0,this.parent.editModule.dialogModule.previousResource=je(t.ganttProperties.resourceInfo)?[]:t.ganttProperties.resourceInfo.slice()):this.parent.editModule.dialogModule.isResourceUpdate=!1),this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed||(t.ganttProperties.resourceInfo=p),n.dataOperation.updateMappingData(t,"resourceInfo")}else if(o.dependency!==d)if(-1!==[o.progress,o.notes,o.durationUnit,o.expandState,o.milestone,o.name,o.baselineStartDate,o.baselineEndDate,o.id,o.segments,o.cssClass].indexOf(d)){var c,u,g,m=n.columnByField[d],f=e[d],y=(je(m)||"datepickeredit"!==m.editType&&"datetimepickeredit"!==m.editType||(f=n.dataOperation.getDateFromFormat(f)),r[d]);switch(d){case o.id:y="taskId";break;case o.name:y="taskName";break;case o.cssClass:y="cssClass";break;case o.milestone:var v,b,y="isMilestone";je(o.duration)||(v=t.ganttProperties,b=e[o.duration],n.setRecordValue(o.duration,b=f?0:b<=0?1:b,t,!0),n.setRecordValue("duration",b,v,!0),n.setRecordValue("taskData."+o.duration,b,t));break;case o.segments:t.ganttProperties.segments&&(y="segments",e)&&!je(e[o.segments])&&0<e[o.segments].length&&e.ganttProperties&&e.ganttProperties.segments&&(this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&(t.ganttProperties.segments=e.ganttProperties.segments),v=t.ganttProperties.segments.reduce(function(e,t){return e+t.duration},0),b=t.ganttProperties.startDate,c=this.parent.dataOperation.getEndDate(b,v,t.ganttProperties.durationUnit,t.ganttProperties,!1),n.setRecordValue("endDate",n.dataOperation.getDateFromFormat(c),t.ganttProperties,!0))}if(!je(y)){var w=[];if("segments"===y&&f&&0<f.length&&!je(t.ganttProperties.segments)){for(var C=0;C<f.length;C++){var S={};f[C][o.startDate]&&(S.startDate=f[C][o.startDate]),f[C][o.endDate]&&(S.endDate=f[C][o.endDate]),f[C][o.duration]&&(S.duration=parseFloat(f[C][o.duration])),f[C][o.id]&&(S.id=f[C][o.id]),w.push(S)}n.setRecordValue(y,w,t.ganttProperties,!0)}else("segments"!==y||"segments"===y&&je(f))&&n.setRecordValue(y,f,t.ganttProperties,!0)}(d===o.baselineStartDate||d===o.baselineEndDate)&&t.ganttProperties.baselineStartDate&&t.ganttProperties.baselineEndDate&&(u=t.ganttProperties,n.setRecordValue("baselineStartDate",n.dataOperation.checkBaselineStartDate(u.baselineStartDate,u),u,!0),g=this.parent.getCurrentDayEndTime(u.baselineEndDate),u.baselineEndDate&&0===u.baselineEndDate.getHours()&&86400!==g&&n.dataOperation.setTime(g,u.baselineEndDate),(u.baselineStartDate&&u.baselineEndDate&&u.baselineStartDate.getTime()>u.baselineEndDate.getTime()||!je(u.baselineStartDate)&&!je(u.startDate)&&u.baselineStartDate.getTime()===u.startDate.getTime()&&!je(u.baselineEndDate)&&!je(u.endDate)&&u.baselineEndDate.toLocaleDateString()===u.endDate.toLocaleDateString()&&u.isMilestone)&&(u.baselineEndDate=u.baselineStartDate),n.setRecordValue("baselineEndDate",n.dataOperation.checkBaselineEndDate(u.baselineEndDate),u,!0),n.setRecordValue("baselineLeft",n.dataOperation.calculateBaselineLeft(u),u,!0),n.setRecordValue("baselineWidth",n.dataOperation.calculateBaselineWidth(u),u,!0),!t[o.baselineStartDate]||t[o.baselineStartDate]instanceof Date||(t[o.baselineStartDate]=new Date(t[o.baselineStartDate])),!t[o.baselineEndDate]||t[o.baselineEndDate]instanceof Date||(t[o.baselineEndDate]=new Date(t[o.baselineEndDate]))),n.setRecordValue("taskData."+d,f,t),d===o.segments&&e&&!je(e[o.segments])&&0<e[o.segments].length&&(this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&e.ganttProperties&&e.ganttProperties.segments&&(t.ganttProperties.segments=e.ganttProperties.segments),n.dataOperation.setSegmentsInfo(t,!0)),n.setRecordValue(d,f,t)}else o.indicators===d?(f=e[d],n.setRecordValue("indicators",f,t.ganttProperties,!0),n.setRecordValue("taskData."+d,f,t),n.setRecordValue(d,f,t)):o.work===d?(n.setRecordValue("work",e[d],t.ganttProperties,!0),this.parent.dataOperation.updateMappingData(t,"work"),this.parent.dataOperation.updateMappingData(t,"duration"),this.parent.dataOperation.updateMappingData(t,"endDate")):d===o.type?(f=e[d],n.setRecordValue("taskType",f,t.ganttProperties,!0),n.setRecordValue(d,f,t),n.setRecordValue("taskData."+d,f,t)):-1!==n.customColumns.indexOf(d)?(m=n.columnByField[d],f=e[d],!je(m.edit)||"datepickeredit"!==m.editType&&"datetimepickeredit"!==m.editType||(f=n.dataOperation.getDateFromFormat(f)),n.setRecordValue("taskData."+d,f,t),n.setRecordValue(d,f,t)):o.manual===d&&(n.setRecordValue("isAutoSchedule",!e[d],t.ganttProperties,!0),this.parent.setRecordValue(d,e[d],t),this.updateTaskScheduleModes(t))}a&&this.validateScheduleValues(s,t,e)},OXt.prototype.updateResourceRelatedFields=function(e,t){var i=e.ganttProperties,n=this.parent.previousRecords,o=i.taskType||this.parent.taskType,r=i.isAutoSchedule,s=this.parent.editModule.dialogModule&&this.parent.editModule.dialogModule.currentResources?this.parent.editModule.dialogModule.currentResources:e.ganttProperties.resourceInfo;if(je(s))je(s)&&"FixedDuration"===o&&0===i.duration&&this.parent.dataOperation.updateWorkWithDuration(e);else switch(o){case"FixedUnit":je(n[i.uniqueID])||je(n[i.uniqueID].ganttProperties)||null!==n[i.uniqueID].ganttProperties.resourceNames&&""!==n[i.uniqueID].ganttProperties.resourceNames||this.parent.dataOperation.updateWorkWithDuration(e),0!==s.length&&(r&&s.length?"resource"===t||"work"===t?this.parent.dataOperation.updateDurationWithWork(e):"duration"!==t&&"endDate"!==t||(this.parent.dataOperation.updateWorkWithDuration(e),0===i.duration&&this.parent.setRecordValue("isMilestone",!0,i,!0)):r||"work"!==t?this.parent.dataOperation.updateWorkWithDuration(e):this.parent.dataOperation.updateUnitWithWork(e));break;case"FixedWork":0!==s.length&&(r?"duration"===t||"endDate"===t?(this.parent.dataOperation.updateUnitWithWork(e),0===i.duration&&this.parent.setRecordValue("isMilestone",!0,i,!0)):this.parent.dataOperation.updateDurationWithWork(e):"work"===t?this.parent.dataOperation.updateUnitWithWork(e):this.parent.dataOperation.updateWorkWithDuration(e));break;case"FixedDuration":0===s.length?this.parent.dataOperation.updateWorkWithDuration(e):s.length&&"work"===t?this.parent.dataOperation.updateUnitWithWork(e):this.parent.dataOperation.updateWorkWithDuration(e)}},OXt.prototype.validateScheduleValues=function(e,t,i){var n=this.parent;2<e.length?n.dataOperation.calculateScheduledValues(t,i,!1):1<e.length?this.validateScheduleByTwoValues(i,e,t):this.dialogModule.validateScheduleValuesByCurrentField(e[0],i[e[0]],t)},OXt.prototype.validateScheduleByTwoValues=function(e,t,i){var n,o,r,s=this.parent,a=s.taskFields,l=i.ganttProperties,h=s.allowUnscheduledTasks;-1!==t.indexOf(a.startDate)&&(n=e[a.startDate]),-1!==t.indexOf(a.endDate)&&(o=e[a.endDate]),-1!==t.indexOf(a.duration)&&(r=e[a.duration]),n&&o||h&&-1!==t.indexOf(a.startDate)&&-1!==t.indexOf(a.endDate)?(s.setRecordValue("startDate",s.dataOperation.getDateFromFormat(n),l,!0),s.setRecordValue("endDate",s.dataOperation.getDateFromFormat(o),l,!0),s.dataOperation.calculateDuration(i)):o&&r||h&&-1!==t.indexOf(a.endDate)&&-1!==t.indexOf(a.duration)?(s.setRecordValue("endDate",s.dataOperation.getDateFromFormat(o),l,!0),s.dataOperation.updateDurationValue(r,l)):(n&&r||h&&-1!==t.indexOf(a.startDate)&&-1!==t.indexOf(a.duration))&&(s.setRecordValue("startDate",s.dataOperation.getDateFromFormat(n),l,!0),s.dataOperation.updateDurationValue(r,l))},OXt.prototype.isTaskbarMoved=function(e){var t,i,n,o,r=!1,s=e.ganttProperties,e=this.parent.previousRecords&&this.parent.previousRecords[e.uniqueID];return e&&e.ganttProperties&&(t=R("ganttProperties.startDate",e),i=R("ganttProperties.endDate",e),n=R("ganttProperties.duration",e),o=R("ganttProperties.durationUnit",e),-1===(e=Object.keys(e.ganttProperties)).indexOf("startDate")&&-1===e.indexOf("endDate")&&-1===e.indexOf("duration")&&-1===e.indexOf("durationUnit")||(je(t)&&!je(s.startDate)||je(i)&&!je(s.endDate)||je(s.startDate)&&!je(t)||je(s.endDate)&&!je(i)||t&&t.getTime()!==s.startDate.getTime()||i&&i.getTime()!==s.endDate.getTime()||!je(n)&&n!==s.duration||!je(n)&&n===s.duration&&o!==s.durationUnit)&&(r=!0)),r},OXt.prototype.isPredecessorUpdated=function(e){var t=!1,i=this.parent.previousRecords[e.uniqueID];return i&&i.ganttProperties&&i.ganttProperties.hasOwnProperty("predecessor")&&(e.ganttProperties.predecessorsName===i.ganttProperties.predecessorsName||""===e.ganttProperties.predecessorsName&&je(i.ganttProperties.predecessorsName)?this.parent.setRecordValue("predecessor",i.ganttProperties.predecessor,e.ganttProperties,!0):t=!0),t},OXt.prototype.isCheckPredecessor=function(e){var t=!1;return t=this.parent.previousRecords[e.uniqueID]&&this.parent.taskFields.dependency&&this.parent.isInPredecessorValidation&&0<this.parent.predecessorModule.getValidPredecessor(e).length&&this.isTaskbarMoved(e)?!0:t},OXt.prototype.updateGanttProperties=function(t,i){var n=["taskId","uniqueID","rowUniqueID","parentId","predecessor"];Object.keys(t.ganttProperties).forEach(function(e){-1===n.indexOf(e)&&(i.ganttProperties[e]=t.ganttProperties[e])})},OXt.prototype.initiateUpdateAction=function(e){var t,i=this.isCheckPredecessor(e.data);if(je(e.data.parentItem)||i){if(0<e.data.childRecords.length&&!i&&!(i=this.isCheckPredecessor(e.data))&&this.isTaskbarMoved(e.data))for(var n=0;n<e.data.childRecords.length;n++)0<this.parent.predecessorModule.getValidPredecessor(e.data.childRecords[n]).length&&(t=n,i=!0)}else o=this.parent.getRecordByID(e.data.parentItem.taskId),i=!!(this.isTaskbarMoved(e.data)&&0<this.parent.predecessorModule.getValidPredecessor(o).length&&this.parent.isInPredecessorValidation);(!this.parent.undoRedoModule||this.parent.undoRedoModule&&!this.parent.undoRedoModule.currentAction||this.parent.undoRedoModule.currentAction&&"indent"!==this.parent.undoRedoModule.currentAction.action&&"outdent"!==this.parent.undoRedoModule.currentAction.action)&&(this.taskbarMoved=this.isTaskbarMoved(e.data)),this.predecessorUpdated=this.isPredecessorUpdated(e.data),this.predecessorUpdated&&(this.parent.isConnectorLineUpdate=!0,this.parent.connectorLineEditModule.addRemovePredecessor(e.data));var o,r={};!i||!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?(this.taskbarMoved&&(this.parent.isConnectorLineUpdate=!0),this.updateEditedTask(e)):(r=je(o)?je(t)?this.parent.connectorLineEditModule.validateTypes(e.data):this.parent.connectorLineEditModule.validateTypes(e.data.childRecords[t],e.data):this.parent.connectorLineEditModule.validateTypes(o,e.data),this.parent.isConnectorLineUpdate=!0,je(R("violationType",r))?this.updateEditedTask(e):!1===(o=this.validateTaskEvent(e)).validateMode.preserveLinkWithEditing&&!1===o.validateMode.removeLink&&!1===o.validateMode.respectLink?this.parent.connectorLineEditModule.openValidationDialog(r):(this.parent.editModule&&this.parent.editModule.dialogModule&&this.parent.editModule.dialogModule.isEdit&&this.predecessorUpdated&&(this.isValidatedEditedRecord=!0,this.parent.predecessorModule.validatePredecessor(e.data,[],"")),this.parent.connectorLineEditModule.applyPredecessorOption()))},OXt.prototype.validateTaskEvent=function(e){var t={};return this.resetValidateArgs(),(this.parent.currentEditedArgs=t).cancel=!1,t.data=e.data,t.requestType="validateLinkedTask",t.validateMode=this.parent.dialogValidateMode,t.editEventArgs=e,this.parent.actionBeginTask(t),t},OXt.prototype.resetValidateArgs=function(){this.parent.dialogValidateMode.preserveLinkWithEditing=!0,this.parent.dialogValidateMode.removeLink=!1,this.parent.dialogValidateMode.respectLink=!1},OXt.prototype.validateChildPredecessors=function(){for(var e=0;e<this.parent.predecessorModule.validatedChildItems.length;e++){var t=this.parent.predecessorModule.validatedChildItems[e];t.ganttProperties.predecessor&&0<t.ganttProperties.predecessor.length&&(this.parent.editedTaskBarItem=t,this.isValidatedEditedRecord||(this.isFirstCall=!0),this.parent.predecessorModule.validatePredecessor(t,[],""))}},OXt.prototype.updateEditedTask=function(e){var t,i=e.data;if(this.editedRecord=i,!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping||this.updateParentChildRecord(i),this.parent.predecessorModule&&(this.parent.predecessorModule.isValidatedParentTaskID=""),(this.parent.isConnectorLineUpdate||this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed)&&this.parent.autoCalculateDateScheduling&&!(this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)){if(this.validateChildPredecessors(),i.ganttProperties.predecessor&&(this.parent.isMileStoneEdited=i.ganttProperties.isMilestone,this.taskbarMoved&&(this.parent.editedTaskBarItem=i),this.isValidatedEditedRecord||(this.isFirstCall=!0,this.parent.predecessorModule.validatePredecessor(i,[],""),this.parent.predecessorModule.isChildRecordValidated=[]),this.isValidatedEditedRecord=!1),this.parent.predecessorModule.isValidatedParentTaskID="",this.parent.allowParentDependency&&this.parent.predecessorModule.isValidatedParentTaskID!==i.ganttProperties.taskId&&i.hasChildRecords&&this.parent.previousRecords[i.uniqueID].ganttProperties.startDate&&"TaskbarEditing"!==e.action&&(!i.hasChildRecords||i.hasChildRecords&&i.ganttProperties.isAutoSchedule)&&(this.parent.predecessorModule.updateChildItems(i),this.validateChildPredecessors()),this.parent.predecessorModule.isValidatedParentTaskID="",this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed)for(var n=0;n<i.childRecords.length;n++)i.childRecords[n].ganttProperties.predecessor&&this.parent.predecessorModule.validatePredecessor(i.childRecords[n],[],"");this.updateParentItemOnEditing(),this.parent.dataOperation.updateParentItems(i,!0)}i.parentItem&&(!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping||this.parent.dataOperation.updateParentItems(i,!0),je(t=this.parent.getRecordByID(i.parentItem.taskId))||t.ganttProperties.predecessorsName||(this.isFirstCall=!0,this.parent.predecessorModule.validatePredecessor(t,[],""),this.updateParentItemOnEditing())),this.parent.updateOffsetOnTaskbarEdit&&this.parent.connectorLineEditModule&&e.data&&(this.parent.connectorLineEditModule.validatedOffsetIds=[],this.parent.connectorLineEditModule.calculateOffset(e.data)),this.parent.predecessorModule.validatedParentIds=[],(je(this.dialogModule)||this.dialogModule&&!this.dialogModule.isFromDialogPredecessor)&&this.initiateSaveAction(e)},OXt.prototype.updateParentItemOnEditing=function(){for(var t=this,e=R("parentRecord",this.parent.predecessorModule),i=0;i<e.length;i++)this.parent.dataOperation.updateParentItems(e[i]);this.parent.editModule.updateParentRecords&&0<this.parent.editModule.updateParentRecords.length&&this.parent.editModule.updateParentRecords.forEach(function(e){e.ganttProperties.predecessor&&0<e.ganttProperties.predecessor.length&&t.parent.predecessorModule.validatePredecessor(e,[],"")});for(i=0;i<e.length;i++)this.parent.dataOperation.updateParentItems(e[i]);x("parentRecord",[],this.parent.predecessorModule),x("parentIds",[],this.parent.predecessorModule)},OXt.prototype.updateParentChildRecord=function(e){!e.hasChildRecords||!this.taskbarMoved||!1!==e[this.parent.taskFields.manual]&&"Auto"!==this.parent.taskMode||je(this.parent.editModule.cellEditModule)||this.parent.editModule.cellEditModule.isResourceCellEdited||this.parent.predecessorModule.updateChildItems(e),je(this.parent.editModule.cellEditModule)||(this.parent.editModule.cellEditModule.isResourceCellEdited=!1)},OXt.prototype.updateTaskScheduleModes=function(e){var t=e[this.parent.taskFields.startDate],i=e.ganttProperties;this.parent.taskFields.manual&&this.parent.setRecordValue(this.parent.taskFields.manual,!e.ganttProperties.isAutoSchedule,e),e.hasChildRecords&&i.isAutoSchedule?(this.parent.setRecordValue("startDate",i.autoStartDate,i,!0),this.parent.setRecordValue("endDate",i.autoEndDate,i,!0),this.parent.setRecordValue("StartDate",i.autoStartDate,e,!0),this.parent.setRecordValue("EndDate",i.autoEndDate,e,!0),this.parent.setRecordValue("taskData.StartDate",i.autoStartDate,e,!0),this.parent.setRecordValue("taskData.EndDate",i.autoEndDate,e,!0),this.parent.setRecordValue("width",this.parent.dataOperation.calculateWidth(e,!0),i,!0),this.parent.setRecordValue("left",this.parent.dataOperation.calculateLeft(i,e,!0),i,!0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(i.width,i.progress),i,!0),this.parent.dataOperation.calculateDuration(e)):e.hasChildRecords&&!i.isAutoSchedule?(this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.calculateDuration(e),this.parent.setRecordValue("autoStartDate",i.autoStartDate,i,!0),this.parent.setRecordValue("autoEndDate",i.autoEndDate,i,!0),this.parent.setRecordValue("autoDuration",this.parent.dataOperation.calculateAutoDuration(e),i,!0),this.parent.dataOperation.updateAutoWidthLeft(e)):(i=this.parent.dateValidationModule.checkStartDate(t,e.ganttProperties),this.parent.setRecordValue("startDate",i,e.ganttProperties,!0),this.parent.dataOperation.updateMappingData(e,"startDate"),this.parent.dateValidationModule.calculateEndDate(e),this.parent.setRecordValue("taskData."+this.parent.taskFields.manual,e[this.parent.taskFields.manual],e),this.parent.dataOperation.updateWidthLeft(e))},OXt.prototype.updateParentProgress=function(e){var t,i=0,e=this.parent.getParentTask(e),n=e.childRecords,o=n?n.length:0,r=0,s=0,a=0;if(n){for(var l=0;l<o;l++)n[l].ganttProperties.isMilestone&&!n[l].hasChildRecords||!rqt(n[l].ganttProperties)?s+=1:(r+=R("totalProgress",t=this.parent.dataOperation.getParentProgress(n[l])),a+=R("totalDuration",t));i=0<o-s?Math.round(r/a):0,isNaN(i)&&(i=0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(e.ganttProperties.isAutoSchedule?e.ganttProperties.width:e.ganttProperties.autoWidth,i),e.ganttProperties,!0),this.parent.setRecordValue("progress",Math.floor(i),e.ganttProperties,!0),this.parent.setRecordValue("totalProgress",r,e.ganttProperties,!0),this.parent.setRecordValue("totalDuration",a,e.ganttProperties,!0)}this.parent.dataOperation.updateTaskData(e),e.parentItem&&this.updateParentProgress(e.parentItem)},OXt.prototype.revertCellEdit=function(e){this.parent.editModule.reUpdatePreviousRecords(!1,!0),this.resetEditProperties()},OXt.prototype.reUpdatePreviousRecords=function(e,t){for(var i=this.parent.previousRecords,n=Object.keys(i),o=0;o<n.length;o++){var r,s=n[o],a=i[s],s=this.parent.getTaskByUniqueID(s),a=(this.copyTaskData(s.taskData,a.taskData),delete a.taskData,this.copyTaskData(s.ganttProperties,a.ganttProperties),delete a.ganttProperties,this.copyTaskData(s,a),this.parent.currentViewData.indexOf(s));e&&this.parent.chartRowsModule.refreshRow(a),t&&(r="ProjectView"===this.parent.viewType?s.ganttProperties.taskId:s.ganttProperties.rowUniqueID,this.parent.treeGrid.grid.setRowData(r,s),this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[a].getAttribute("data-uid")).data=s)}},OXt.prototype.copyTaskData=function(e,t){je(t)||Pe(e,t)},OXt.prototype.updateScheduleDatesOnEditing=function(e){},OXt.prototype.initiateSaveAction=function(h){var d=this,p={requestType:"beforeSave"},c=(p.data=h.data,this.createArray=!(p.cancel=!1),this.parent.toolbarModule&&this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&0<this.parent.undoRedoModule.getUndoCollection.length&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!0),p.modifiedRecords=this.parent.editedRecords,je(h.target)||(p.target=h.target),p.modifiedTaskData=pqt(this.parent.editedRecords,!0),"DrawConnectorLine"!==h.action&&"DeleteConnectorLine"!==h.action||(p.action=h.action,"DeleteConnectorLine"===h.action&&(this.parent.connectorLineEditModule.isPublicDependencyDelete=!1,this.parent.contextMenuModule)&&(this.parent.contextMenuModule.isCntxtMenuDependencyDelete=!1)),this.parent),u=RXt({},p.data.ganttProperties.baselineStartDate),g=RXt({},p.data.ganttProperties.baselineEndDate),m=p.data.ganttProperties.progress,f=JSON.parse(JSON.stringify(p.data.ganttProperties));this.parent.trigger("actionBegin",p,function(e){u===e.data.ganttProperties.baselineStartDate&&g===e.data.ganttProperties.baselineEndDate||(c.setRecordValue("baselineLeft",c.dataOperation.calculateBaselineLeft(e.data.ganttProperties),e.data.ganttProperties,!0),c.setRecordValue("baselineWidth",c.dataOperation.calculateBaselineWidth(e.data.ganttProperties),e.data.ganttProperties,!0)),d.parent.autoCalculateDateScheduling&&f!==e.data.ganttProperties&&!je(e.data.parentItem)&&(d.updateParentItemOnEditing(),d.parent.dataOperation.updateParentItems(e.data,!0));var t=e.data.ganttProperties,i=t.startDate,n=t.endDate,o=t.segments,r=t.durationUnit,s=t.isAutoSchedule,a=t.isMilestone;if(i&&n&&!o&&!d.parent.dataOperation.isDurationValueUpdated&&0!==d.parent.dateValidationModule.getDuration(i,n,r,s,a,!0)&&(t.isMilestone=!1,d.parent.dateValidationModule.calculateDuration(e.data)),d.parent.dataOperation.updateWidthLeft(e.data),je(d.parent.taskFields.progress)||m===e.data.ganttProperties.progress||(o=e.data.ganttProperties.isAutoSchedule?e.data.ganttProperties.width:e.data.ganttProperties.autoWidth,d.parent.setRecordValue("progressWidth",d.parent.dataOperation.getProgressWidth(o,e.data.ganttProperties.progress),e.data.ganttProperties,!0)),d.parent.chartRowsModule.updateSegment(e.data.ganttProperties.segments,e.data.ganttProperties.taskId),je(d.parent.loadingIndicator)||"Shimmer"!==d.parent.loadingIndicator.indicatorType?d.parent.showSpinner():d.parent.showMaskRow(),e.cancel)d.reUpdatePreviousRecords(),d.parent.chartRowsModule.refreshRecords([h.data]),d.resetEditProperties(p);else{if(e.modifiedRecords)for(var l=0;l<e.modifiedRecords.length;l++)d.parent.dataOperation.updateTaskData(e.modifiedRecords[l]);e.modifiedTaskData=pqt(e.modifiedRecords,null,null,d.parent),dqt(d.parent.dataSource)?(i=d.parent.dataSource,n={changedRecords:e.modifiedTaskData},r=d.parent.query instanceof ya?d.parent.query:new ya,((s=i.adaptor)instanceof za&&s instanceof Ra&&!i.dataSource.batchUrl?i.update(d.parent.taskFields.id,n.changedRecords,null,r):i.saveChanges(n,d.parent.taskFields.id,null,r)).then(function(e){return d.dmSuccess(e,h)}).catch(function(e){return d.dmFailure(e,h)})):d.saveSuccess(h),d.parent.enableVirtualization&&d.parent.enableTimelineVirtualization&&d.parent.ganttChartModule.setVirtualHeight(),d.parent.undoRedoModule&&(d.parent.previousFlatData=Pe([],d.parent.flatData,[],!0))}}),this.parent.ganttChartModule.reRenderConnectorLines()},OXt.prototype.updateEditedFields=function(e){for(var t=(e.changedRecords||e).length,i=0;i<t;i++){for(var n=(e.changedRecords||e)[parseInt(i.toString(),10)],o=Object.keys(n).length,r=0,s=Object.keys(n);r<o;r++){var a=s[parseInt(r.toString(),10)];this.parent.editedRecords[parseInt(i.toString(),10)][""+a]=n[""+a],this.parent.editedRecords[parseInt(i.toString(),10)].taskData[""+a]=n[""+a]}this.updateEditedRecordFields(n,this.parent.editedRecords[parseInt(i.toString(),10)])}},OXt.prototype.dmSuccess=function(e,t){this.updateEditedFields(e),this.saveSuccess(t)},OXt.prototype.updateEditedRecordFields=function(e,t){for(var i=this.parent.taskFields,n=Object.keys(e).length,o=0,r=Object.keys(e);o<n;o++){var s=r[parseInt(o.toString(),10)];t[""+s]=e[""+s]}null!==i.id&&(t.ganttProperties.taskId=e[i.id]),null!==i.name&&(t.ganttProperties.taskName=e[i.name]),null!==i.startDate&&(t.ganttProperties.startDate=e[i.startDate]),null!==i.endDate&&(t.ganttProperties.endDate=e[i.endDate]),null!==i.duration&&(t.ganttProperties.duration=parseFloat(e[i.duration])),null!==i.durationUnit&&(t.ganttProperties.durationUnit=e[i.durationUnit]),null!==i.progress&&(t.ganttProperties.progress=e[i.progress]),null!==i.dependency&&(t.ganttProperties.dependency=e[i.dependency]),null!==i.parentID&&(t.ganttProperties.parentID=e[i.parentID]),null!==i.baselineEndDate&&(t.ganttProperties.baselineEndDate=e[i.baselineEndDate]),null!==i.baselineStartDate&&(t.ganttProperties.baselineStartDate=e[i.baselineStartDate]),null!==i.resourceInfo&&(t.ganttProperties.resources=e[i.resourceInfo])},OXt.prototype.dmFailure=function(e,t){if(this.deletedTaskDetails.length){for(var i=this.deletedTaskDetails,n=0;n<i.length;n++)i[n].isDelete=!1;this.deletedTaskDetails=[]}this.reUpdatePreviousRecords(!0,!0),this.resetEditProperties(),this.parent.trigger("actionFailure",{error:e})},OXt.prototype.updateSharedTask=function(e){for(var t=e.ganttProperties.sharedTaskUniqueIds,i=0;i<t.length;i++){var n=this.parent.flatData[this.parent.ids.indexOf(t[i].toString())];n&&n.uniqueID!==e.uniqueID&&(this.updateGanttProperties(e,n),this.parent.setRecordValue("taskData",e.taskData,n,!0),this.parent.dataOperation.updateTaskData(n),this.parent.dataOperation.updateResourceName(n),je(n.parentItem)||this.parent.dataOperation.updateParentItems(n.parentItem))}},OXt.prototype.saveSuccess=function(e){var t={};if(this.parent.timelineSettings.updateTimescaleView&&(n=this.parent.editedRecords,this.parent.timelineModule.updateTimeLineOnEditing([n],e.action)),"ResourceView"===this.parent.viewType){"TaskbarEditing"===e.action||"DrawConnectorLine"===e.action||"DeleteConnectorLine"===e.action?this.updateSharedTask(e.data):"DialogEditing"!==e.action&&"CellEditing"!==e.action&&"methodUpdate"!==e.action||(this.parent.editModule.dialogModule.isResourceUpdate?(this.updateResoures(this.parent.editModule.dialogModule.previousResource,e.data.ganttProperties.resourceInfo,e.data),this.updateSharedTask(e.data),this.isTreeGridRefresh=!0):this.updateSharedTask(e.data));for(var i=0;i<this.updateParentRecords.length;i++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[i]);this.updateParentRecords=[],this.parent.editModule.dialogModule.isResourceUpdate=!1,this.parent.editModule.dialogModule.previousResource=[]}var n=this.parent.criticalPathModule;this.parent.enableCriticalPath&&n&&n.criticalPathCollection&&(n.showCriticalPath(!0),n.criticalConnectorLine(n.criticalPathCollection,n.detailPredecessorCollection,!0,n.predecessorCollectionTaskIds)),this.isTreeGridRefresh||(this.parent.editSettings.allowEditing&&0<this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length&&(this.parent.treeGrid.grid.element.querySelector("form").ej2_instances[0].validate()||(x("isEdit",!1,this.parent.treeGrid.grid),this.parent.editModule.cellEditModule.isCellEdit=!1),this.parent.treeGrid.endEdit()),this.parent.chartRowsModule.refreshRecords(this.parent.editedRecords),!this.parent.allowTaskbarOverlap&&this.parent.showOverAllocation&&(this.parent.contentHeight=this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,this.parent.ganttChartModule.chartBodyContent.style.height=this.parent.contentHeight+"px",this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData),this.parent.taskFields.dependency)&&this.parent.ganttChartModule.reRenderConnectorLines(),(this.parent.isConnectorLineUpdate||this.parent.undoRedoModule&&this.parent.undoRedoModule.currentAction&&this.parent.undoRedoModule.currentAction.connectedRecords)&&!je(this.parent.connectorLineEditModule)&&(this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.connectorLineEditModule.refreshEditedRecordConnectorLine(this.parent.editedRecords),this.updateScheduleDatesOnEditing(e))),!this.parent.editSettings.allowTaskbarEditing||this.parent.editSettings.allowTaskbarEditing&&!this.taskbarEditModule.dependencyCancel?(t.requestType="save",t.data=e.data,t.modifiedRecords=this.parent.editedRecords,t.modifiedTaskData=pqt(this.parent.editedRecords,null,null,this.parent),!this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition&&this.updateRowIndex(),je(e.action)||x("action",e.action,t),"TaskbarEditing"===e.action&&(t.taskBarEditAction=e.taskBarEditAction),this.endEditAction(e),this.parent.trigger("actionComplete",t),this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&this.parent.rowDragAndDropModule.draggedRecord&&(this.parent.rowDragAndDropModule.draggedRecord=null),je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow()):(this.taskbarEditModule.dependencyCancel=!1,this.resetEditProperties()),"ResourceView"===this.parent.viewType&&this.isTreeGridRefresh&&(this.parent.treeGrid.parentData=[],this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.predecessorModule.createConnectorLinesCollection(this.parent.flatData),this.parent.treeGrid.refresh(),this.isTreeGridRefresh=!1),this.parent.editedRecords=[]},OXt.prototype.updateResoures=function(e,t,i){var n=this.parent.flatData,o=t?t.length:0,r=e?e.length:0;if(0!==o||0!==r){for(var s=0;s<o;s++){var a,l=[];if("NaN"===(u=parseInt(t[s][this.parent.resourceFields.id],10).toString())&&(u=t[s][this.parent.resourceFields.id]),!je(e))for(var h=0;h<e.length;h++){var d=parseInt(e[h][this.parent.resourceFields.id],10).toString();if((d="NaN"===d?e[h][this.parent.resourceFields.id]:d)===u){l.push(h);break}}0===l.length?(a=n[this.parent.getTaskIds().indexOf("R"+u)])&&this.addNewRecord(i,a):("NaN"===(a=parseInt(l[0].toString(),10)).toString()&&(a=l[0].toString()),e.splice(a,1))}for(var p=e?e.length:0,s=0;s<p;s++){var c=i.ganttProperties.taskId,u=e[s][this.parent.resourceFields.id],g=n[this.parent.getTaskIds().indexOf("R"+u)];if(!je(g))for(var m=0;m<g.childRecords.length;m++)g.childRecords[m].ganttProperties.taskId===c&&this.removeChildRecord(g.childRecords[m])}0<o&&(r=this.parent.getParentTask(i.parentItem))&&r.ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&this.removeChildRecord(i),0===o&&this.checkWithUnassignedTask(i),this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.flatData[this.parent.flatData.length-1].ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&(this.parent.flatData.splice(this.parent.flatData.length-1,1),this.parent.currentViewData.splice(this.parent.currentViewData.length-1,1),this.parent.taskIds.splice(this.parent.flatData.length-1,1),this.parent.ids.splice(this.parent.flatData.length-1,1))}},OXt.prototype.checkWithUnassignedTask=function(t){for(var e,i=null,n=0;n<this.parent.flatData.length;n++)this.parent.flatData[n].ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&(i=this.parent.flatData[n]);je(i)?((o={})[this.parent.taskFields.id]=0,o[this.parent.taskFields.name]=this.parent.localeObj.getConstant("unassignedTask"),e=this.parent.isOnEdit,this.parent.isOnEdit=!1,o=this.parent.dataOperation.createRecord(o,0),this.parent.isOnEdit=e,this.addRecordAsBottom(o),e=this.parent.flatData[this.parent.flatData.length-1],o=this.parent.flatData.indexOf(e)+1+e.childRecords.length,t.index=o,t.level=e.level+1,this.addNewRecord(t,e),this.parent.dataSource.push(t.taskData)):this.addNewRecord(t,i);var o=this.parent.currentViewData.filter(function(e){return e.ganttProperties.taskId===t.ganttProperties.taskId&&e.hasChildRecords===t.hasChildRecords})[0];t.parentItem=o.parentItem,t.parentUniqueID=o.parentUniqueID},OXt.prototype.addRecordAsBottom=function(e){var t=this.parent.flatData.length,i=(this.parent.currentViewData.splice(t+1,0,e),this.parent.flatData.splice(t+1,0,e),this.parent.ids.splice(t+1,0,e.ganttProperties.rowUniqueID.toString()),0===e.level?"R"+e.ganttProperties.taskId:"T"+e.ganttProperties.taskId);this.parent.getTaskIds().splice(t+1,0,i),this.updateTreeGridUniqueID(e,"add")},OXt.prototype.addNewRecord=function(e,t){var i=null,i=Pe({},{},e,!0),n=(this.parent.setRecordValue("uniqueID",this.parent.dataOperation.getGanttUid(this.parent.element.id+"_data_"),i),this.parent.setRecordValue("uniqueID",i.uniqueID,i.ganttProperties,!0),i.uniqueID.replace(this.parent.element.id+"_data_","")),o=(this.parent.setRecordValue("rowUniqueID",n,i),this.parent.setRecordValue("rowUniqueID",n,i.ganttProperties,!0),this.parent.setRecordValue("level",1,i),this.parent.taskFields.parentID&&this.parent.setRecordValue("parentId",t.ganttProperties.taskId,i.ganttProperties,!0),this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(t),i),i.parentItem?i.parentItem.uniqueID:null);this.parent.setRecordValue("parentUniqueID",o,i),e.ganttProperties.sharedTaskUniqueIds.push(n),i.ganttProperties.sharedTaskUniqueIds=e.ganttProperties.sharedTaskUniqueIds,this.addRecordAsChild(t,i)},OXt.prototype.removeChildRecord=function(e){var t=this.parent,i=[],i=this.parent.dataSource instanceof me&&0<this.parent.dataSource.dataSource.json.length?this.parent.dataSource.dataSource.json:this.parent.currentViewData,n=this.parent.dataSource,o=e,e=this.parent.getParentTask(o.parentItem);if(o){o.parentItem&&(h=0,r=e?e.childRecords:[])&&0<r.length&&(1===r.length&&(this.parent.isOnDelete=!0,r[0].isDelete=!0,this.parent.dataOperation.updateParentItems(e),this.parent.isOnDelete=!1,r[0].isDelete=!1),h=r.indexOf(o),e.childRecords.splice(h,1),this.updateParentRecords.push(e)),o.ganttProperties.sharedTaskUniqueIds.length&&(r=o.ganttProperties.sharedTaskUniqueIds.indexOf(o.ganttProperties.rowUniqueID),o.ganttProperties.sharedTaskUniqueIds.splice(r,1)),this.updateTreeGridUniqueID(o,"delete"),this.parent.taskFields.parentID||((h=[]).push(o.ganttProperties.rowUniqueID.toString()),"ProjectView"===this.parent.viewType&&this.parent.editModule.removeFromDataSource(h));var r=this.parent.flatData.indexOf(o);if(t.taskFields.parentID){for(var s=void 0,a=this.parent.currentViewData,l=0;l<a.length;l++)a[l].ganttProperties.rowUniqueID===o.ganttProperties.rowUniqueID&&(s=l);-1!==s&&(0<n.length&&n.splice(s,1),i.splice(s,1),this.parent.flatData.splice(r,1),this.parent.ids.splice(r,1),this.parent.getTaskIds().splice(r,1))}var h=i.indexOf(o);t.taskFields.parentID||(n=this.parent.editModule.getChildCount(o,0),i.splice(h,n+1),this.parent.flatData.splice(r,n+1),this.parent.ids.splice(r,n+1),this.parent.getTaskIds().splice(r,n+1)),o.parentItem&&e&&e.childRecords&&!e.childRecords.length&&(this.parent.setRecordValue("expanded",!1,e),this.parent.setRecordValue("hasChildRecords",!1,e))}},OXt.prototype.addRecordAsChild=function(e,t){var i,n,o=this.parent,r=this.parent.flatData.indexOf(e),s=this.parent.editModule.getChildCount(e,0),a=this.parent.getTaskByUniqueID(t.parentItem.uniqueID);if(this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&this.dialogModule.indexes&&this.dialogModule.indexes.deletedIndexes&&0<this.dialogModule.indexes.deletedIndexes.length)if(a.ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask"))d=this.parent.taskIds.length+1;else for(var l=0;l<this.dialogModule.indexes.deletedIndexes.length;l++){if(this.dialogModule.indexes.deletedIndexes[l].data.parentUniqueID===t.parentUniqueID&&t.ganttProperties.taskId===this.dialogModule.indexes.deletedIndexes[l].data.ganttProperties.taskId){for(var h=this.dialogModule.indexes.deletedIndexes[l].index,d="above"===this.dialogModule.indexes.deletedIndexes[l].position?h:h+1,p=0;p<e.childRecords.length;p++)if("T"+e.childRecords[p].ganttProperties.taskId===this.dialogModule.indexes.deletedIndexes[l].id){i="above"===this.dialogModule.indexes.deletedIndexes[l].position?p:p+1;break}break}if(this.dialogModule.indexes.deletedIndexes[l].data.parentUniqueID!==t.parentUniqueID&&t.ganttProperties.taskId===this.dialogModule.indexes.deletedIndexes[l].data.ganttProperties.taskId){h=this.parent.getTaskByUniqueID(t.parentItem.uniqueID);d=h.index+h.childRecords.length+1;break}}else if(this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&a.ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&this.parent.undoRedoModule.currentAction.deletedRecordsDetails){for(p=0;p<this.parent.undoRedoModule.currentAction.deletedRecordsDetails.length;p++)if(this.parent.undoRedoModule.currentAction.deletedRecordsDetails[p].data.ganttProperties.taskId===t.ganttProperties.taskId){i=a.index?(d=this.parent.undoRedoModule.currentAction.deletedRecordsDetails[p].data.index)-a.index-1:(d=je(s)||0===s?r+1:s+r+1,0);break}}else d=!je(this.addRowIndex)&&this.addRowPosition&&e.childRecords&&"Child"!==this.addRowPosition?(c=e.childRecords[this.addRowIndex],n="Above"===this.addRowPosition||"Below"===this.addRowPosition?this.addRowPosition:"Child",d=c?this.addRowIndex+r+1:s+r+1,"Above"===n?d:d+1):je(s)||0===s?r+1:s+r+1;this.parent.currentViewData.splice(d,0,t),this.parent.flatData.splice(d,0,t),this.parent.ids.splice(d,0,t.ganttProperties.rowUniqueID.toString()),this.updateTreeGridUniqueID(t,"add");var c=0===t.level?"R"+t.ganttProperties.taskId:"T"+t.ganttProperties.taskId;this.parent.getTaskIds().splice(d,0,c),e.hasChildRecords||(this.parent.setRecordValue("hasChildRecords",!0,e),this.parent.setRecordValue("expanded",!0,e),e.childRecords.length)||(e.childRecords=[],!o.taskFields.parentID&&je(e.taskData[this.parent.taskFields.child])&&(e.taskData[this.parent.taskFields.child]=[])),0<=i?e.childRecords.splice(i,0,t):e.childRecords.splice(e.childRecords.length,0,t),je(t)||this.parent.taskFields.parentID||je(e.taskData[this.parent.taskFields.child])||e.taskData[this.parent.taskFields.child].splice(e.childRecords.length,0,t.taskData),je(t.parentItem)||this.updateParentRecords.push(e)},OXt.prototype.resetEditProperties=function(e){this.parent.currentEditedArgs={},this.resetValidateArgs(),this.parent.editedTaskBarItem=null,this.parent.isOnEdit=!1,this.parent.predecessorModule.validatedChildItems=[],this.parent.isConnectorLineUpdate=!1,this.parent.editedTaskBarItem=null,this.taskbarMoved=!1,this.predecessorUpdated=!1,je(this.dialogModule)||!je(e)&&(je(e)||"beforeSave"!==e.requestType||e.cancel)||(this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose()),this.parent.hideSpinner(),this.parent.initiateEditAction(!1)},OXt.prototype.endEditAction=function(e){this.resetEditProperties(),"TaskbarEditing"===e.action?this.parent.trigger("taskbarEdited",e):"CellEditing"===e.action?this.parent.trigger("endEdit",e):"DialogEditing"===e.action&&(this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose())},OXt.prototype.saveFailed=function(e){this.reUpdatePreviousRecords(),this.parent.hideSpinner()},OXt.prototype.renderDeleteConfirmDialog=function(){var e=new pS({width:"320px",isModal:!0,visible:!1,enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("confirmDelete"),buttons:[{click:this.confirmDeleteOkButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.closeConfirmDialog.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});e.appendTo("#"+this.parent.element.id+"_deleteConfirmDialog"),this.confirmDialog=e},OXt.prototype.closeConfirmDialog=function(){this.confirmDialog.hide()},OXt.prototype.confirmDeleteOkButton=function(){this.deleteSelectedItems(),this.confirmDialog.hide(),this.parent.element.querySelector(".e-treegrid").focus()},OXt.prototype.startDeleteAction=function(){this.parent.editSettings.allowDeleting&&!this.parent.readOnly&&(this.parent.editSettings.showDeleteConfirmDialog?this.confirmDialog.show():(this.deleteSelectedItems(),this.parent.element.querySelector(".e-treegrid").focus()))},OXt.prototype.deleteResourceRecords=function(o){for(var r=this,s=[],a=this,e=0;e<o.length;e++)!function(t){if(o[t].parentItem)if(1===o[t].ganttProperties.sharedTaskUniqueIds.length){for(var e=o[t],i=e.ganttProperties.sharedTaskUniqueIds,n=0;n<i.length;n++)-1!==a.parent.ids.indexOf(i[n].toString())?s.push(a.parent.flatData[a.parent.ids.indexOf(i[n].toString())]):a.parent.undoRedoModule&&a.parent.undoRedoModule.isUndoRedoPerformed&&a.parent.undoRedoModule.currentAction&&"Delete"===a.parent.undoRedoModule.currentAction.action&&s.push(a.parent.flatData[a.parent.taskIds.indexOf("T"+o[t].ganttProperties.taskId)]);-1!==a.parent.ids.indexOf(e.ganttProperties.rowUniqueID)&&-1===s.indexOf(a.parent.flatData[a.parent.ids.indexOf(e.ganttProperties.rowUniqueID)])&&s.push(a.parent.flatData[a.parent.ids.indexOf(e.ganttProperties.rowUniqueID)])}else 1<o[t].ganttProperties.sharedTaskUniqueIds.length&&o.forEach(function(e){e.ganttProperties.sharedTaskUniqueIds.forEach(function(e){s.push(r.parent.getTaskByUniqueID(r.parent.element.id+"_data_"+e))})});else{e=a.parent.flatData.filter(function(e){return e.ganttProperties.taskId===o[t].ganttProperties.taskId&&e.hasChildRecords})[0];je(e)||s.push(e)}}(e);this.deleteRow(s)},OXt.prototype.add=function(e,t){if(t.push(e),e.hasChildRecords)for(var i=e.childRecords,n=0;n<i.length;n++)this.add(i[n],t);else-1===t.indexOf(e)&&t.push(e)},OXt.prototype.deleteSelectedItems=function(){var e;this.isFromDeleteMethod?(this.targetedRecords.length&&("ResourceView"===this.parent.viewType?this.deleteResourceRecords(this.targetedRecords):this.deleteRow(this.targetedRecords)),this.isFromDeleteMethod=!1):(e=[],"Cell"!==this.parent.selectionSettings.mode?e=this.parent.selectionModule.getSelectedRecords():"Cell"===this.parent.selectionSettings.mode&&(e=this.parent.selectionModule.getCellSelectedRecords()),"ResourceView"===this.parent.viewType?this.deleteResourceRecords(e):this.deleteRow(e))},OXt.prototype.deleteRecord=function(e){this.isFromDeleteMethod=!0;var t=typeof e;switch(this.targetedRecords=[],t){case"number":case"string":var i=e.toString();"ResourceView"===this.parent.viewType?je(i)||-1===this.parent.getTaskIds().indexOf("T"+i)||this.targetedRecords.push(this.parent.flatData[this.parent.getTaskIds().indexOf("T"+i)]):je(i)||-1===this.parent.ids.indexOf(i)||this.targetedRecords.push(this.parent.getRecordByID(i));break;case"object":Array.isArray(e)?this.updateTargetedRecords(e):this.targetedRecords.push(e.valueOf())}this.startDeleteAction()},OXt.prototype.updateTargetedRecords=function(e){if(e.length)if("object"==typeof e[0])this.targetedRecords=e;else for(var t=0;t<e.length;t++){var i=e[t].toString();"ResourceView"===this.parent.viewType?je(i)||-1===this.parent.getTaskIds().indexOf("T"+i)||this.targetedRecords.push(this.parent.flatData[this.parent.getTaskIds().indexOf("T"+i)]):je(i)||-1===this.parent.ids.indexOf(i)||this.targetedRecords.push(this.parent.getRecordByID(i))}},OXt.prototype.deleteRow=function(e){var t=this,l=e&&e.length?e:this.parent.selectionModule.getSelectedRecords();if(this.parent.addDeleteRecord=!0,l.length){this.parent.isOnDelete=!0,l.forEach(function(e){t.parent.undoRedoModule&&t.parent.undoRedoModule.isUndoRedoPerformed&&(("ProjectView"===t.parent.viewType?t.parent.getRecordByID(e.ganttProperties.taskId):t.parent.flatData[t.parent.taskIds.indexOf((e.hasChildRecords?"R":"T")+e.ganttProperties.taskId)]).isDelete=!0),e.isDelete=!0}),"ResourceView"!==this.parent.viewType||e.length||(l=[]),this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.isUndoRedoItemPresent("Delete")&&(this.parent.undoRedoModule.redoEnabled&&!this.parent.undoRedoModule.isUndoRedoPerformed&&(this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.getUndoCollection[0]=[]),this.parent.undoRedoModule.isUndoRedoPerformed||this.parent.undoRedoModule.createUndoCollection(),e={action:"Delete",deletedRecordsDetails:[]},this.parent.undoRedoModule.findPosition(Pe([],[],l,!0),e,"deletedRecordsDetails"),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=e);for(var h=this,i=0;i<l.length;i++)!function(e){var t=l[e];if(-1!==h.deletedTaskDetails.indexOf(t))return;var i,n=[t];"ResourceView"===h.parent.viewType&&h.parent.undoRedoModule&&h.parent.undoRedoModule.isUndoRedoPerformed&&l[e].ganttProperties.resourceInfo&&1<l[e].ganttProperties.resourceInfo.length&&(n=[],l[e].hasChildRecords||(i="T"+l[e].ganttProperties.taskId,h.parent.taskIds.reduce(function(e,t){e===i&&n.push(this.parent.flatData[t])}.bind(h),[])));for(var o=0;o<n.length;o++){var r=h.parent.getParentTask(n[o].parentItem),s=(n[o].parentItem&&(s=void 0,je(r)||0<(1===(s=r.childRecords).length?s:s.filter(function(e){return!e.isDelete})).length&&h.parent.dataOperation.updateParentItems(n[o].parentItem)),n[o].ganttProperties.predecessor),a=!0;"ResourceView"===h.parent.viewType&&r&&r.ganttProperties.taskName!==h.parent.localeObj.getConstant("unassignedTask")&&(a=!1),s&&s.length&&a&&h.removePredecessorOnDelete(n[o]),h.deletedTaskDetails.push(n[o]),n[o].hasChildRecords&&h.deleteChildRecords(n[o])}}(i);this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.clearSelection();e={};e.deletedRecordCollection=this.deletedTaskDetails,e.updatedRecordCollection=this.parent.editedRecords,e.cancel=!1,e.action="delete",this.initiateDeleteAction(e),this.parent.isOnDelete=!1}je(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},OXt.prototype.removePredecessorOnDelete=function(e){for(var t=e.ganttProperties.predecessor,i=0;i<t.length;i++){var n=t[i],o="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;if(n.from.toString()===o.toString()){var r=this.parent.connectorLineModule.getRecordByID(n.to.toString());if(!je(r)){for(var s=Pe([],[],r.ganttProperties.predecessor,!0),a=void 0,l=0;l<s.length;l++){var h="ResourceView"===this.parent.viewType?r.ganttProperties.taskId:r.ganttProperties.rowUniqueID;if(s[l].to.toString()===h.toString()&&s[l].from.toString()===o.toString()){a=l;break}}s.splice(a,1),this.updatePredecessorValues(r,s)}}else if(n.to.toString()===o.toString()){var d=this.parent.connectorLineModule.getRecordByID(n.from.toString());if(!je(d)){for(var p=Pe([],[],d.ganttProperties.predecessor,!0),a=void 0,l=0;l<p.length;l++){var c="ResourceView"===this.parent.viewType?d.ganttProperties.taskId:d.ganttProperties.rowUniqueID;if(p[l].from.toString()===c.toString()&&p[l].to.toString()===o.toString()){a=l;break}}e.uniqueID!==d.parentUniqueID&&e.parentUniqueID!==d.uniqueID&&!this.parent.isOnDelete||(p.splice(a,1),this.updatePredecessorValues(d,p))}}}},OXt.prototype.updatePredecessorValues=function(e,t){this.parent.setRecordValue("predecessor",t,e.ganttProperties,!0);t=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("predecessorsName",t,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,t,e),this.parent.setRecordValue(this.parent.taskFields.dependency,t,e)},OXt.prototype.updateTaskId=function(e,t){if(!this.parent.readOnly){var i="number"==typeof e?e.toString():e,n="number"==typeof t?t.toString():t,o=this.parent.ids;if(!je(i)&&!je(n)){var e=o.indexOf(i),r=o.indexOf(n);if(!(-1===e||-1<r)){r=this.parent.flatData[e];if(je(r)||(this.parent.setRecordValue("taskId",t,r.ganttProperties,!0),this.parent.setRecordValue("rowUniqueID",n,r.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.id,t,r,!0),this.parent.setRecordValue(this.parent.taskFields.id,t,r.taskData,!0)),o[e]=n,r.hasChildRecords&&this.parent.taskFields.parentID)for(var s=r.childRecords,a=0;a<s.length;a++){var l=s[a];l[this.parent.taskFields.parentID]=t,this.parent.chartRowsModule.refreshRecords([l])}if(this.parent.taskFields.dependency&&!je(r.ganttProperties.predecessor))for(var h=r.ganttProperties.predecessor,d=void 0,p=0;p<h.length;p++){var c=h[p];c.to===i?d=this.parent.flatData[o.indexOf(c.from)]:c.from===i&&(d=this.parent.flatData[o.indexOf(c.to)]),this.updatePredecessorOnUpdateId(d,i,n)}this.parent.treeGrid.parentData=[],this.parent.treeGrid.refresh()}}}},OXt.prototype.updatePredecessorOnUpdateId=function(e,t,i){if(-1<this.parent.flatData.indexOf(e))for(var n=e.ganttProperties.predecessor,o=0;o<n.length;o++){var r=n[o];r.to===t?r.to=i:r.from===t&&(r.from=i)}this.updatePredecessorValues(e,e.ganttProperties.predecessor)},OXt.prototype.deleteChildRecords=function(e){for(var t=this,i=e.childRecords,n=0;n<i.length;n++){var o,r,s,a=i[n];-1===this.deletedTaskDetails.indexOf(a)&&(o=a.ganttProperties.predecessor,r=!0,s=this.parent.getParentTask(a.parentItem),"ResourceView"===this.parent.viewType&&s&&s.ganttProperties.taskName!==this.parent.localeObj.getConstant("unassignedTask")&&(r=!1),o&&o.length&&r&&this.removePredecessorOnDelete(a),!je(a.ganttProperties.sharedTaskUniqueIds)&&1<a.ganttProperties.sharedTaskUniqueIds.length?a.ganttProperties.sharedTaskUniqueIds.forEach(function(e){t.deletedTaskDetails.push(t.parent.getTaskByUniqueID(t.parent.element.id+"_data_"+e))}):this.deletedTaskDetails.push(a),a.hasChildRecords)&&this.deleteChildRecords(a)}},OXt.prototype.removeFromDataSource=function(e){var t=this.parent.dataSource instanceof me?this.parent.dataSource.dataSource.json:this.parent.dataSource;this.removeData(t,e),this.isBreakLoop=!1},OXt.prototype.removeData=function(e,t){for(var i,n=0;n<e.length&&!this.isBreakLoop;n++)if(-1!==t.indexOf(R(this.parent.taskFields.id,e[n]).toString())){if(e[n][this.parent.taskFields.child]&&(i=e[n][this.parent.taskFields.child],this.removeData(i,t)),t.splice(t.indexOf(R(this.parent.taskFields.id,e[n]).toString()),1),e.splice(n,1),0===t.length){this.isBreakLoop=!0;break}}else e[n][this.parent.taskFields.child]&&(i=e[n][this.parent.taskFields.child],this.removeData(i,t))},OXt.prototype.initiateDeleteAction=function(h){var d=this,e=(this.parent.showSpinner(),{});e.requestType="beforeDelete",e.data=h.deletedRecordCollection,e.modifiedRecords=h.updatedRecordCollection,e.modifiedTaskData=pqt(h.updatedRecordCollection,null,null,this.parent),this.parent.trigger("actionBegin",e,function(e){if(je(d.parent.loadingIndicator)||"Shimmer"!==d.parent.loadingIndicator.indicatorType?d.parent.showSpinner():d.parent.showMaskRow(),e.cancel){for(var t=d.deletedTaskDetails,i=0;i<t.length;i++)t[i].isDelete=!1;d.deletedTaskDetails=[],d.reUpdatePreviousRecords(),d.parent.initiateEditAction(!1),d.parent.hideSpinner()}else if(dqt(d.parent.dataSource)){var n=d.parent.dataSource,o=(d.parent.timezone&&e.modifiedRecords.forEach(function(e){cqt(e,d.parent)}),{deletedRecords:pqt(e.data,null,null,d.parent),changedRecords:e.modifiedTaskData}),e=n.adaptor,r=d.parent.query instanceof ya?d.parent.query:new ya;if(e instanceof za&&e instanceof Ra&&!n.dataSource.batchUrl){for(var s="deletedRecords",a=null,l=0;l<o[s].length;l++)a=n.remove(d.parent.taskFields.id,o[s][l],null,r);a.then(function(){for(var i="changedRecords",e=o[i].length-1;0<=e;e--)!function(t){o.deletedRecords.some(function(e){return e[d.parent.taskFields.id]===o[i][t].taskId})&&o[i].splice(t,1)}(e);n.update(d.parent.taskFields.id,o[i],null,r).then(function(){return d.deleteSuccess(h)}).catch(function(e){return d.dmFailure(e,h)})}).catch(function(e){return d.dmFailure(e,h)})}else n.saveChanges(o,d.parent.taskFields.id,null,r).then(function(){return d.deleteSuccess(h)}).catch(function(e){return d.dmFailure(e,h)})}else d.deleteSuccess(h)})},OXt.prototype.deleteSuccess=function(e){for(var o=this,t=this.parent.flatData,i=this.parent.currentViewData,n=[],r=0;r<e.deletedRecordCollection.length;r++)if("ProjectView"===this.parent.viewType)je(h=this.parent.getRecordByID(e.deletedRecordCollection[r].ganttProperties.taskId))||n.push(h);else{var s=e.deletedRecordCollection[r].hasChildRecords,a=e.deletedRecordCollection[r].ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask"),l=!e.deletedRecordCollection[r].expanded;if(s&&a&&l)return je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.deletedTaskDetails=[],void this.parent.initiateEditAction(!1);e.deletedRecordCollection[r].hasChildRecords?"R"+e.deletedRecordCollection[r].ganttProperties.taskId:"T"+e.deletedRecordCollection[r].ganttProperties.taskId,n.push(this.parent.getTaskByUniqueID(e.deletedRecordCollection[r].uniqueID))}var h,d=[];0<n.length&&(h=y=void 0,this.parent.enableVirtualization?(y=this.parent.flatData.indexOf(n[n.length-1]),this.parent.staticSelectedRowIndex=this.parent.selectedRowIndex=y,h=this.parent.flatData[this.parent.selectedRowIndex+1],this.parent.isCollapseAll||(this.parent.staticSelectedRowIndex=y-(n.length-1))):(y=this.parent.currentViewData.indexOf(n[n.length-1]),this.parent.staticSelectedRowIndex=this.parent.selectedRowIndex=y,h=this.parent.currentViewData[this.parent.selectedRowIndex+1]),je(h)?0<=(y=this.parent.selectedRowIndex-1)&&(this.parent.currentSelection=(this.parent.enableVirtualization?this.parent.flatData:this.parent.currentViewData)[y]):this.parent.currentSelection=h),this.deletedRecord=n;for(r=0;r<n.length;r++){var p=n[r],c=void 0,u=void 0,u="ResourceView"===this.parent.viewType?p.hasChildRecords?(c=this.parent.taskIds.indexOf("R"+p.ganttProperties.taskId.toString()),this.parent.taskIds.indexOf("R"+p.ganttProperties.taskId.toString())):(c=this.parent.taskIds.indexOf("T"+p.ganttProperties.taskId.toString()),this.parent.taskIds.indexOf("T"+p.ganttProperties.taskId.toString())):(c=i.indexOf(p),t.indexOf(p)),g=this.parent.treeGrid.parentData.indexOf(p),m=R("dataOperation.dataArray",this.parent),f=m.indexOf(p.taskData);-1!==c&&i.splice(c,1),-1!==u&&t.splice(u,1),-1!==f&&m.splice(f,1),je(p)||(d.push(p.ganttProperties.taskId.toString()),-1!==u&&(this.parent.ids.splice(u,1),"ResourceView"===this.parent.viewType)&&(this.parent.getTaskIds().splice(u,1),p.hasChildRecords||(p.ganttProperties.resourceInfo=null,delete p.ganttProperties.resourceNames,p[this.parent.taskFields.resourceInfo]=null,p.ganttProperties.sharedTaskUniqueIds=[],delete p.taskData[this.parent.taskFields.resourceInfo])),0===p.level&&-1!==g&&this.parent.treeGrid.parentData.splice(g,1),p.parentItem&&(c=this.parent.getParentTask(p.parentItem))&&(-1!==(f=(m=c.childRecords).indexOf(p))&&m.splice(f,1),m.length||this.parent.setRecordValue("hasChildRecords",!1,c)),this.updateTreeGridUniqueID(p,"delete"))}0<d.length&&this.removeFromDataSource(d),this.updateRowIndex();var y={};if(this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.predecessorModule.createConnectorLinesCollection(this.parent.flatData),this.parent.treeGrid.parentData=[],this.isAdded=!1,this.parent.treeGrid.editModule&&(this.parent.treeGrid.editModule.isOnBatch=!1),this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&this.refreshRecordInImmutableMode(),y.requestType="delete",y.data=e.deletedRecordCollection,y.modifiedRecords=e.updatedRecordCollection,y.modifiedTaskData=pqt(e.updatedRecordCollection,null,null,this.parent),x("action",e.action,y),this.parent.isOnDelete=!1,"ResourceView"===this.parent.viewType&&(!this.parent.undoRedoModule||this.parent.undoRedoModule&&(!this.parent.undoRedoModule.isUndoRedoPerformed||this.parent.undoRedoModule.isUndoRedoPerformed&&"Delete"===this.parent.undoRedoModule.currentAction.action)))for(var v=y.data.filter(function(e){return!e.hasChildRecords}),b=this,r=0;r<v.length;r++)!function(t){var i=b.parent.flatData.filter(function(e){return e.ganttProperties.taskName===o.parent.localeObj.getConstant("unassignedTask")})[0],e=[],n=(i&&(e=i.childRecords.filter(function(e){return e.ganttProperties.taskId===v[t].ganttProperties.taskId})),b.parent.getParentTask(v[t].parentItem)),n=((!n||n.ganttProperties.taskName===b.parent.localeObj.getConstant("unassignedTask")||0!==e.length)&&(n||e&&0!==e.length)||b.checkWithUnassignedTask(v[t]),i=b.parent.flatData.filter(function(e){return e.ganttProperties.taskName===o.parent.localeObj.getConstant("unassignedTask")})[0],b.parent.currentViewData.filter(function(e){return e.ganttProperties.taskId===v[t].ganttProperties.taskId&&!e.hasChildRecords&&e.parentItem&&i.uniqueID===e.parentItem.uniqueID?e:null}));n[0]&&b.parent.dataOperation.updateParentItems(n[0])}(r);this.parent.trigger("actionComplete",y),this.deletedTaskDetails=[],this.parent.initiateEditAction(!1),je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.parent.treeGrid.closeEdit()},OXt.prototype.getNewTaskId=function(){var e="ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids,t=e.length+1;if("ResourceView"===this.parent.viewType){if(!(-1===e.indexOf("T"+t)&&-1===e.indexOf("R"+t)||-1===e.indexOf("T"+(t+=1))&&-1===e.indexOf("R"+t)))for(;-1!==e.indexOf("T"+(t+=1))||-1!==e.indexOf("R"+t););}else if(-1!==e.indexOf(t.toString())&&-1!==e.indexOf((t+=1).toString()))for(;-1!==e.indexOf((t+=1).toString()););return"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType?t.toString():t},OXt.prototype.prepareNewlyAddedData=function(e,t){var i=this.parent.taskFields,n=this.parent.ids;e[i.id]&&(-1!==n.indexOf(e[i.id].toString())?e[i.id]=null:(n="string"==typeof e[i.id]?e[i.id]:parseInt(e[i.id],10),e[i.id]=je(n)?null:n)),e[i.id]||(n=this.getNewTaskId(),e[i.id]=n),this.parent.allowUnscheduledTasks||e[i.startDate]||(e[i.startDate]=this.parent.projectStartDate),!this.parent.allowUnscheduledTasks&&i.duration&&je(e[i.duration])&&!e[i.endDate]&&(e[i.duration]="5"),i.progress&&(e[i.progress]=e[i.progress]?100<e[i.progress]?100:e[i.progress]:0),this.parent.allowUnscheduledTasks||e[i.endDate]||!i.endDate||e[i.duration]||je(n=this.parent.dataOperation.getDateFromFormat(this.parent.projectStartDate))||(n.setDate(n.getDate()+4),e[i.endDate]=this.parent.getFormatedDate(n,this.parent.getDateFormat()))},OXt.prototype.updateNewlyAddedDataBeforeAjax=function(e,t,i,n,o){var r=this.parent.dataOperation.createRecord(e,t);switch(i){case"Above":r.index=o;break;case"Below":case"Child":r.index=o+1;break;case"Bottom":r.index=(this.parent.enableVirtualization?this.parent.flatData:this.parent.currentViewData).length;break;case"Top":r.index=0}if(je(n)||(this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(n),r),p=r.parentItem?r.parentItem.index:null,this.parent.setRecordValue("parentIndex",p,r),c=r.parentItem?r.parentItem.uniqueID:null,this.parent.setRecordValue("parentUniqueID",c,r),je(this.parent.taskFields.id))||je(this.parent.taskFields.parentID)||!r.parentItem||("ProjectView"===this.parent.viewType&&this.parent.setRecordValue(this.parent.taskFields.parentID,r.parentItem.taskId,r.taskData,!0),this.parent.setRecordValue("parentId",r.parentItem.taskId,r.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.parentID,r.parentItem.taskId,r,!0)),this.parent.isOnEdit=!0,this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed)if(e.hasChildRecords){for(var s=[],a=this.parent.undoRedoModule.currentAction.deletedRecordsDetails,l=0;l<e.childRecords.length;l++)this.add(e.childRecords[l],s);for(var h=0;h<a.length;h++)if(e.ganttProperties.taskId===a[h].data.ganttProperties.taskId){"child"===a[h].position?i="Child":"below"===a[h].position?i="Below":"above"===a[h].position&&(i="Above"),this.backUpAndPushNewlyAddedRecord(r,i,n);for(l=0;l<s.length;l++)"ProjectView"===this.parent.viewType?s[l].parentItem.taskId===r.ganttProperties.taskId&&(s[l].parentItem.index=r.index,s[l].parentItem.taskId=r.ganttProperties.taskId,s[l].parentItem.uniqueID=r.ganttProperties.uniqueID,s[l].parentUniqueID=r.ganttProperties.uniqueID):(s[l].parentItem.index=r.index,s[l].parentItem.taskId=r.ganttProperties.rowUniqueID,s[l].parentItem.uniqueID=r.ganttProperties.uniqueID,s[l].parentUniqueID=r.ganttProperties.uniqueID);break}(this.addRowSelectedItem=r).taskData[this.parent.taskFields.child]=[];for(var d=0;d<s.length;d++){this.parent.isOnEdit=!1;var p,c,u=this.parent.dataOperation.createRecord(s[d],s[d].level);0===u.childRecords.length&&u.taskData[this.parent.taskFields.child]&&(u.taskData[this.parent.taskFields.child]=[]),je(n=this.parent.getRecordByID(s[d].parentItem.taskId))||(this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(n),u),p=u.parentItem?u.parentItem.index:null,this.parent.setRecordValue("parentIndex",p,u),c=u.parentItem?u.parentItem.uniqueID:null,this.parent.setRecordValue("parentUniqueID",c,u),je(this.parent.taskFields.id))||je(this.parent.taskFields.parentID)||!u.parentItem||("ProjectView"===this.parent.viewType&&this.parent.setRecordValue(this.parent.taskFields.parentID,u.parentItem.taskId,u.taskData,!0),this.parent.setRecordValue("parentId",u.parentItem.taskId,u.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.parentID,u.parentItem.taskId,u,!0)),this.parent.isOnEdit=!0,u.parentItem&&(i=0===n.childRecords.length?"Child":"Below"),0<this.parent.getParentTask(u.parentItem).childRecords.length&&(this.addRowSelectedItem=this.parent.getParentTask(u.parentItem).childRecords[this.parent.getParentTask(u.parentItem).childRecords.length-1]),this.backUpAndPushNewlyAddedRecord(u,i,n);for(l=0;l<s.length;l++)"ProjectView"===this.parent.viewType?s[l].parentItem.taskId===u.ganttProperties.taskId&&(s[l].parentItem.index=u.index,s[l].parentItem.taskId=u.ganttProperties.taskId,s[l].parentItem.uniqueID=u.ganttProperties.uniqueID,s[l].parentUniqueID=u.ganttProperties.uniqueID):(s[l].parentItem.index=r.index,s[l].parentItem.taskId=r.ganttProperties.rowUniqueID,s[l].parentItem.uniqueID=r.ganttProperties.uniqueID,s[l].parentUniqueID=r.ganttProperties.uniqueID)}}else this.backUpAndPushNewlyAddedRecord(r,i,n);else this.backUpAndPushNewlyAddedRecord(r,i,n);return this.parent.taskFields.dependency&&r.ganttProperties.predecessorsName&&(this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed||this.parent.predecessorModule.ensurePredecessorCollectionHelper(r,r.ganttProperties),this.parent.predecessorModule.updatePredecessorHelper(r),this.parent.predecessorModule.validatePredecessorDates(r)),r.parentItem&&this.parent.getParentTask(r.parentItem).ganttProperties.isAutoSchedule&&this.parent.dataOperation.updateParentItems(r.parentItem),this.parent.isOnEdit=!1,r},OXt.prototype.getChildCount=function(e,t){var i;if(!e.hasChildRecords)return 0;for(var n=0;n<e.childRecords.length;n++)t++,(i=e.childRecords[n]).hasChildRecords&&(t=this.getChildCount(i,t));return t},OXt.prototype.getVisibleChildRecordCount=function(e,t,i){if(e.hasChildRecords)for(var n,o=(n=e.childRecords).length,r=0;r<o;r++)-1!==i.indexOf(n[r])&&t++,n[r].hasChildRecords&&(t=this.getVisibleChildRecordCount(n[r],t,i));else-1!==i.indexOf(e)&&t++;return t},OXt.prototype.updatePredecessorOnIndentOutdent=function(e){for(var t=e.ganttProperties.predecessor.length,i=e.ganttProperties,n=i.predecessor,o=0;o<t;o++){var r,s,a,l=this.parent.getRecordByID(n[o].from),h=this.parent.getRecordByID(n[o].to);(a=this.parent.predecessorModule.validateParentPredecessor(l,h))&&this.parent.allowParentDependency||(n[o].to===i.rowUniqueID.toString()?(r=this.parent.getRecordByID(n[o].from),s=gqt(n[o],"from",r.ganttProperties.predecessor,"to"),(l=Pe([],r.ganttProperties.predecessor,[],!0)).splice(s,1),this.parent.setRecordValue("predecessor",l,r.ganttProperties,!0)):n[o].from===i.rowUniqueID.toString()&&(h=(r=this.parent.getRecordByID(n[o].to)).ganttProperties.predecessorsName.toString().split(","),l=n[o].from+n[o].type,l=h.indexOf(l),h.splice(l,1),this.parent.setRecordValue("predecessorsName",h.join(","),r.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.dependency,h.join(","),r),s=gqt(n[o],"from",r.ganttProperties.predecessor,"to"),(l=Pe([],r.ganttProperties.predecessor,[],!0)).splice(s,1),this.parent.setRecordValue("predecessor",l,r.ganttProperties,!0),this.parent.predecessorModule.validatePredecessorDates(r)))}a&&this.parent.allowParentDependency||(this.parent.setRecordValue("predecessor",[],e.ganttProperties,!0),this.parent.setRecordValue("predecessorsName","",e.ganttProperties,!0))},OXt.prototype.backUpAndPushNewlyAddedRecord=function(e,t,i){var n,o=this.parent.flatData,r=this.parent.currentViewData,s=this.parent.ids;switch(t){case"Top":o.splice(0,0,e),r.splice(0,0,e),s.splice(0,0,e.ganttProperties.rowUniqueID.toString());break;case"Bottom":o.push(e),r.push(e),s.push(e.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType&&(n=0===e.level?"R"+e.ganttProperties.taskId:"T"+e.ganttProperties.taskId,this.parent.getTaskIds().push(n));break;case"Above":a=o.indexOf(this.addRowSelectedItem),l=r.indexOf(this.addRowSelectedItem),this.recordCollectionUpdate(void 0,a,l,e,i,t);break;case"Below":var a,l,h=o.indexOf(this.addRowSelectedItem);l=this.addRowSelectedItem.hasChildRecords?(a=h+this.getChildCount(this.addRowSelectedItem,0)+1,r.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,r)+1):(a=h+1,r.indexOf(this.addRowSelectedItem)+1),this.recordCollectionUpdate(NaN,a,l,e,i,t);break;case"Child":h=o.indexOf(this.addRowSelectedItem),this.addRowSelectedItem.hasChildRecords?(a=h+this.getChildCount(this.addRowSelectedItem,0)+1,this.addRowSelectedItem.expanded||this.parent.enableMultiTaskbar||this.parent.expandByID(this.addRowSelectedItem.ganttProperties.rowUniqueID),l=r.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,r)+1):(this.parent.setRecordValue("hasChildRecords",!0,this.addRowSelectedItem),this.parent.setRecordValue("isMilestone",!1,this.addRowSelectedItem.ganttProperties,!0),this.parent.setRecordValue("expanded",!0,this.addRowSelectedItem),this.parent.setRecordValue("childRecords",[],this.addRowSelectedItem),a=h+1,l=r.indexOf(this.addRowSelectedItem)+1,this.addRowSelectedItem.ganttProperties.predecessor&&this.updatePredecessorOnIndentOutdent(this.addRowSelectedItem),je(this.addRowSelectedItem.ganttProperties.segments)||(this.addRowSelectedItem.ganttProperties.segments=null)),this.recordCollectionUpdate(NaN,a,l,e,i,t)}this.newlyAddedRecordBackup=e},OXt.prototype.recordCollectionUpdate=function(e,t,i,n,o,r){var s=this.parent.flatData,a=this.parent.currentViewData,l=this.parent.ids;s.splice(t,0,n),a.splice(i,0,n),l.splice(t,0,n.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType&&(s=0===n.level?"R"+n.ganttProperties.taskId:"T"+n.ganttProperties.taskId,this.parent.getTaskIds().splice(t,0,s)),!je(o)&&(e="Above"===r?o.childRecords.indexOf(this.addRowSelectedItem):"Below"===r?o.childRecords.indexOf(this.addRowSelectedItem)+1:o.childRecords.length,o.childRecords.splice(e,0,n),this.parent.taskFields.child||(this.parent.taskFields.child="Children"),this.parent.dataSource instanceof me&&je(o.taskData[this.parent.taskFields.parentID])||!je(this.parent.dataSource))&&(a=this.parent.taskFields.child,o.taskData[a]&&0<o.taskData[a].length?"Above"===r||"Below"===r?o.taskData[a].splice(e,0,n.taskData):o.taskData[a].push(n.taskData):(o.taskData[a]=[],o.taskData[a].push(n.taskData)),this.isNewRecordAdded=!0)},OXt.prototype.constructTaskAddedEventArgs=function(e,t,i){var n={};if(n.action=n.requestType=i,1<e.length){n.data=[],n.newTaskData=[],n.recordIndex=[];for(var o=0;o<e.length;o++)n.data[o]=e[o],n.newTaskData[o]=pqt([e[o]],n.data[o],n,this.parent),n.recordIndex[o]=e[o].index}else if(1===e.length)for(o=0;o<e.length;o++)n.data=e[o],n.newTaskData=pqt([e[o]],n.data,n,this.parent),n.recordIndex=e[o].index;return n.modifiedRecords=t,n.modifiedTaskData=pqt(t,null,null,this.parent),n},OXt.prototype.addSuccess=function(e){this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.predecessorModule.createConnectorLinesCollection(this.parent.flatData),this.parent.treeGrid.parentData=[],this.parent.addDeleteRecord=!0,this.parent.treeGrid.isAddedFromGantt=!0,this.isAdded=!0,this.parent.treeGrid.editModule&&(this.parent.treeGrid.editModule.isOnBatch=!1),this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&(this.parent.modifiedRecords=e.modifiedRecords,this.parent.modifiedRecords.push(e.data),this.refreshRecordInImmutableMode()),this.parent.treeGrid.closeEdit()},OXt.prototype.refreshRecordInImmutableMode=function(e,t){if(!t&&!je(e))for(var i=e[0].index+1;i<this.parent.currentViewData.length&&e[0].level<this.parent.currentViewData[i].level;i++)this.parent.modifiedRecords.push(this.parent.currentViewData[i]);for(var r=this,i=0;i<this.parent.modifiedRecords.length;i++)!function(e){var t,i=r.parent.modifiedRecords[e],e=r.parent.rowDragAndDropModule&&r.parent.allowRowDragAndDrop?1:0,n=r.parent.taskFields.id,o=r.parent.currentViewData.findIndex(function(e){return e[n]===i[n]});r.parent.treeGrid.getRows()[o]&&(t=r.parent.treeGrid.grid.getRowObjectFromUID(r.parent.treeGrid.grid.getDataRows()[o].getAttribute("data-uid")),r.parent.treeGrid.renderModule.cellRender({data:t.data,cell:r.parent.treeGrid.getRows()[o].cells[r.parent.treeColumnIndex+e],column:r.parent.treeGrid.grid.getColumns()[r.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),r.parent.treeGrid.renderModule.RowModifier({data:i,row:r.parent.treeGrid.getRows()[o],rowHeight:r.parent.rowHeight}))}(i)},OXt.prototype.updateRealDataSource=function(e,t){var i=this.parent.taskFields,n=sqt(this.parent)?R("result",this.parent.dataSource):this.parent.dataSource;this.parent.dataSource instanceof me&&(n=this.parent.dataSource.dataSource.json);for(var o=0;o<e.length;o++)"Top"===(t=je(t)||je(this.addRowSelectedItem)?"Bottom"===t?"Bottom":"Top":t)?n.splice(0,0,e[o].taskData):"Bottom"!==t&&(je(i.id)||je(i.parentID)||"Child"!==t)?(this.isNewRecordAdded||this.addDataInRealDataSource(n,e[o].taskData,t),this.isNewRecordAdded=!1):n.push(e[o].taskData),this.isBreakLoop=!1},OXt.prototype.addDataInRealDataSource=function(e,t,i){for(var n=0;n<e.length;n++){var o=this.parent.taskFields.child;if(this.isBreakLoop)break;if(R(this.parent.taskFields.id,e[n]).toString()===this.addRowSelectedItem.ganttProperties.rowUniqueID.toString()){var r=void 0;if(this.parent.rowDragAndDropModule&&this.parent.rowDragAndDropModule.droppedRecord&&"ResourceView"===this.parent.viewType)for(var s=0;s<e.length;s++)if(e[s][this.parent.taskFields.id]===this.parent.rowDragAndDropModule.droppedRecord.ganttProperties.taskId){r=s;break}"Above"===i?r?e.splice(r,0,t):e.splice(n,0,t):"Below"===i?r?e.splice(r+1,0,t):e.splice(n+1,0,t):"Child"===i&&(e[n][o]&&0<e[n][o].length||(e[n][o]=[]),e[n][o].push(t)),this.isBreakLoop=!0;break}e[n][o]&&(o=e[n][o],this.addDataInRealDataSource(o,t,i))}},OXt.prototype.updateClientDataFromServer=function(e,t){for(var i=e.addedRecords[0],n=Object.keys(i).length,o=0,r=Object.keys(i);o<n;o++){var s=r[parseInt(o.toString(),10)];t.data[""+s]=i[""+s]}null!==this.parent.taskFields.id&&(t.data.ganttProperties.taskId=i[this.parent.taskFields.id]),null!==this.parent.taskFields.name&&(t.data.ganttProperties.taskName=i[this.parent.taskFields.name]),null!==this.parent.taskFields.startDate&&(t.data.ganttProperties.startDate=i[this.parent.taskFields.startDate]),null!==this.parent.taskFields.endDate&&(t.data.ganttProperties.endDate=i[this.parent.taskFields.endDate]),null!==this.parent.taskFields.duration&&(t.data.ganttProperties.duration=parseFloat(i[this.parent.taskFields.duration])),null!==this.parent.taskFields.durationUnit&&(t.data.ganttProperties.durationUnit=i[this.parent.taskFields.durationUnit]),null!==this.parent.taskFields.progress&&(t.data.ganttProperties.progress=i[this.parent.taskFields.progress]),null!==this.parent.taskFields.dependency&&(t.data.ganttProperties.dependency=i[this.parent.taskFields.dependency]),null!==this.parent.taskFields.parentID&&(t.data.ganttProperties.parentID=i[this.parent.taskFields.parentID]),null!==this.parent.taskFields.baselineEndDate&&(t.data.ganttProperties.baselineEndDate=i[this.parent.taskFields.baselineEndDate]),null!==this.parent.taskFields.baselineStartDate&&(t.data.ganttProperties.baselineStartDate=i[this.parent.taskFields.baselineStartDate]),null!==this.parent.taskFields.resourceInfo&&(t.data.ganttProperties.resources=i[this.parent.taskFields.resourceInfo])},OXt.prototype.addNewUndoCollection=function(e,t){if(this.parent.undoRedoModule&&(!this.parent.undoRedoModule.isUndoRedoPerformed||this.parent.undoRedoModule.isUndoRedoPerformed&&"Add"===this.parent.undoRedoModule.currentAction.action&&"ResourceView"===this.parent.viewType)&&this.parent.isUndoRedoItemPresent("Add")){e.action="Add";for(var i=0<t.data.length?Pe([],[],t.data,!0):[t.data],n=[],o=this,r=0;r<i.length;r++)!function(t){n=o.parent.flatData.filter(function(e){return i[t].index===e.index&&i[t].ganttProperties.taskId===e.ganttProperties.taskId})}(r);e.addedRecords=Pe([],[],n,!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=e}},OXt.prototype.addRecord=function(e,c,t){var u=this,g=this.parent.taskFields.id;if(this.parent.editModule&&this.parent.editSettings.allowAdding){this.parent.isDynamicData=!0,this.parent.treeGrid.isAddedFromGantt=!0,this.parent.isOnAdded=!0;var m=[];if(je(e))this.validateTaskPosition(e,c,t,m);else if(e instanceof Array)if(this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed){var i=e,n=t;"ResourceView"===this.parent.viewType&&("below"===e[0].position?c="Below":"above"===e[0].position?c="Above":"child"===e[0].position&&(c="Child"),n=this.parent.taskIds.indexOf(e[0].id.toString()),i=e[0].data),this.validateTaskPosition(i,c,n,m)}else for(var o=0;o<e.length;o++)this.validateTaskPosition(e[o],c,t,m);else{if("object"!=typeof e)return;this.validateTaskPosition(e,c,t,m)}i={},i=this.constructTaskAddedEventArgs(m,this.parent.editedRecords,"beforeAdd");je(c)||(i.rowPosition=c),this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.isUndoRedoItemPresent("Add")&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection()),this.parent.trigger("actionBegin",i,function(i){u.parent.previousRecords={},je(u.parent.loadingIndicator)||"Shimmer"!==u.parent.loadingIndicator.indicatorType?u.parent.showSpinner():u.parent.showMaskRow();var e=u.parent.taskFields,e="ResourceView"===u.parent.viewType?0<i.data.childRecords.length?u.parent.flatData[u.parent.getTaskIds().indexOf("R"+i.data[e.id])]:u.parent.flatData[u.parent.getTaskIds().indexOf("T"+i.data[e.id])]:u.parent.getRecordByID(i.data[e.id]);if(je(e)||(u.validateUpdateValues(i.newTaskData,e,!0),u.parent.dateValidationModule.calculateEndDate(e),u.parent.dataOperation.updateWidthLeft(e),u.parent.dataOperation.updateParentItems(e)),!je(i.data[""+g])&&i.data[g]!==i.data.ganttProperties.taskId){for(var t=0,n=Object.keys(u.parent.ids);t<n.length;t++){var o=n[t];if(u.parent.ids[o]===i.data.ganttProperties.taskId.toString()){u.parent.ids[o]=i.data[g].toString();break}}i.data.ganttProperties.taskId=i.data[g],i.newTaskData[g]=i.data[g],i.data.ganttProperties.rowUniqueID=i.data[g].toString()}if(i.cancel)u.removeAddedRecord(),u.reUpdatePreviousRecords(),u._resetProperties();else{if(dqt(u.parent.dataSource)){var r=u.parent.dataSource,s={addedRecords:[i.newTaskData],changedRecords:i.modifiedTaskData},a=u.parent.query instanceof ya?u.parent.query:new ya,l=r.adaptor;!(l instanceof za||l instanceof Ra||l instanceof Va)||r.dataSource.batchUrl?r.saveChanges(s,u.parent.taskFields.id,null,a).then(function(e){e.addedRecords[0][u.parent.taskFields.id].toString()!==i.data.ganttProperties.taskId&&(i.data.ganttProperties.taskId=e.addedRecords[0][u.parent.taskFields.id].toString(),i.newTaskData[g]=e.addedRecords[0][u.parent.taskFields.id].toString(),i.data.ganttProperties.rowUniqueID=e.addedRecords[0][u.parent.taskFields.id].toString(),u.parent.ids.push(e.addedRecords[0][u.parent.taskFields.id].toString()));var t=i.data.ganttProperties.taskId.toString();u.parent.taskFields.id&&!je(e.addedRecords[0][u.parent.taskFields.id])&&e.addedRecords[0][u.parent.taskFields.id].toString()===t&&(u.parent.setRecordValue("taskId",e.addedRecords[0][u.parent.taskFields.id],i.data.ganttProperties,!0),u.parent.setRecordValue("taskData",e.addedRecords[0],i.data),u.parent.setRecordValue(u.parent.taskFields.id,e.addedRecords[0][u.parent.taskFields.id],i.data),u.parent.setRecordValue("rowUniqueID",e.addedRecords[0][u.parent.taskFields.id].toString(),i.data.ganttProperties,!0),u.updateClientDataFromServer(e,i),-1!==(t=u.parent.ids.indexOf(t)))&&(u.parent.ids[t]=e.addedRecords[0][u.parent.taskFields.id].toString()),u.updateNewRecord(m,i)}).catch(function(e){u.removeAddedRecord(),u.dmFailure(e,i),u._resetProperties()}):r.insert(s.addedRecords,null,a).then(function(e){var t=(je(e[0])?s.addedRecords:e)[0];m.forEach(function(e){je(e)||(u.updateEditedRecordFields(t,e),u.parent.dataOperation.updateTaskData(e))}),u.updateNewRecord(m,i)}).catch(function(e){u.removeAddedRecord(),u.dmFailure(e,i),u._resetProperties()})}else{if("ProjectView"===u.parent.viewType?("Top"===c||"Bottom"===c||"Above"===c||"Below"===c||"Child"===c||je(c)&&!i.data.parentItem)&&(i.data instanceof Array?u.updateRealDataSource(i.data,c):((l=[]).push(i.data),u.updateRealDataSource(l,c),u.parent.currentSelection=m[0])):(sqt(u.parent)?R("result",u.parent.dataSource):u.parent.dataSource).push(i.data.taskData),0===m.level&&u.parent.treeGrid.parentData.splice(0,0,m),u.updateTreeGridUniqueID(m,"add"),"ResourceView"===u.parent.viewType&&u.parent.undoRedoModule&&u.parent.undoRedoModule.currentAction){r=!1;if((i.data.hasChildRecords||i.data.parentItem&&u.parent.getTaskByUniqueID(i.data.parentItem.uniqueID).ganttProperties.taskName!==u.parent.localeObj.getConstant("unassignedTask"))&&(r=!0),-1!==u.parent.taskIds.indexOf("R0")&&u.parent.undoRedoModule&&u.parent.undoRedoModule.isUndoRedoPerformed&&"Delete"===u.parent.undoRedoModule.currentAction.action&&r){for(var h=u.parent.flatData[u.parent.taskIds.indexOf("R0")],d=h.childRecords.filter(function(e){return e.ganttProperties.taskId===i.data.ganttProperties.taskId}),p=(i.data.hasChildRecords&&(d=i.data.childRecords),0);p<d.length;p++)!function(e){var n,t;1===h.childRecords.length?(u.parent.flatData.splice(u.parent.taskIds.indexOf("R0"),2),u.parent.ids.splice(u.parent.taskIds.indexOf("R0"),2),u.parent.taskIds.splice(u.parent.taskIds.indexOf("R0"),2)):(t=u.parent.taskIds.indexOf("T"+d[e].ganttProperties.taskId),n="T"+d[e].ganttProperties.taskId,t=(e=u.parent.taskIds.reduce(function(e,t,i){return t===n&&e.push(i),e},[]))[e.length-1],u.parent.taskIds.splice(t,1),u.parent.flatData.splice(t,1),u.parent.ids.splice(t,1))}(p);h&&"ResourceView"===u.parent.viewType&&!u.parent.flatData[u.parent.taskIds.indexOf("R0")+1]&&(u.parent.flatData.splice(u.parent.taskIds.indexOf("R0"),1),u.parent.ids.splice(u.parent.taskIds.indexOf("R0"),1),u.parent.taskIds.splice(u.parent.taskIds.indexOf("R0"),1))}}u.refreshNewlyAddedRecord(i,m),"ResourceView"===u.parent.viewType&&u.parent.taskFields.work&&e&&u.parent.dataOperation.updateParentItems(e,!0),u.addNewUndoCollection({},i),u._resetProperties()}u.parent.isOnAdded=!1}})}},OXt.prototype.createNewRecord=function(){for(var e={},t=this.parent.ganttColumns,i=this.parent.taskFields,n=this.parent.editModule.getNewTaskId(),o=0;o<t.length;o++){var r=t[o].field;r===i.id?e[r]=n:t[o].field===i.startDate?(je(e[i.endDate])?e[r]=this.parent.editModule.dialogModule.getMinimumStartDate():e[r]=new Date(e[i.endDate]),this.parent.timezone&&(e[r]=this.parent.dateValidationModule.remove(e[r],this.parent.timezone))):t[o].field===i.endDate?(je(e[i.startDate])?e[r]=this.parent.editModule.dialogModule.getMinimumStartDate():e[r]=new Date(e[i.startDate]),this.parent.timezone&&(e[r]=this.parent.dateValidationModule.remove(e[r],this.parent.timezone))):t[o].field===i.duration?e[r]=1:t[o].field===i.name?e[r]=this.parent.editModule.dialogModule.localeObj.getConstant("addDialogTitle")+" "+n:t[o].field===i.progress||t[o].field===i.work?e[r]=0:t[o].field===i.type||"taskType"===t[o].field?e[r]=this.parent.taskType:t[o].field===i.milestone?e[r]=null:e[this.parent.ganttColumns[o].field]=""}return e},OXt.prototype.validateTaskPosition=function(e,t,i,n){var o,r=je(i)||isNaN(parseInt(i.toString(),10))?this.parent.selectionModule?"Row"!==this.parent.selectionSettings.mode&&"Both"!==this.parent.selectionSettings.mode||1!==this.parent.selectionModule.selectedRowIndexes.length?"Cell"===this.parent.selectionSettings.mode&&1===this.parent.selectionModule.getSelectedRowCellIndexes().length?this.parent.selectionModule.getSelectedRowCellIndexes()[0].rowIndex:null:this.parent.selectionModule.selectedRowIndexes[0]:null:i,s=(this.addRowSelectedItem=je(r)?null:this.parent.updatedRecords[r],t=je(t)?this.parent.editSettings.newRowPosition:t,e=je(e)?this.createNewRecord():e,0);switch(t=(je(r)||r<0||je(this.addRowSelectedItem))&&("Above"===t||"Below"===t||"Child"===t)||!t||"Above"!==t&&"Below"!==t&&"Child"!==t&&"Top"!==t&&"Bottom"!==t?"Top":t){case"Top":case"Bottom":s="ResourceView"===this.parent.viewType?1:0;break;case"Above":case"Below":s=this.addRowSelectedItem.level,o=this.parent.getParentTask(this.addRowSelectedItem.parentItem);break;case"Child":s=this.addRowSelectedItem.level+1,o=this.addRowSelectedItem}this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed||this.prepareNewlyAddedData(e,t);r=this.updateNewlyAddedDataBeforeAjax(e,s,t,o,i);n.push(r)},OXt.prototype.updateRowIndex=function(){for(var e=this.parent.currentViewData,t=e.length,i=0;i<t;i++){var n=i;e[i].index=n,e[i].parentItem&&e[i].parentItem.taskId&&(je(n=this.parent.getRecordByID(e[i].parentItem.taskId))||je(n.index)||je(n.level)||(e[i].parentItem.index=n.index,e[i].parentItem.level=n.level))}},OXt.prototype.updateNewRecord=function(e,t){var i=this;e.forEach(function(e){0===e.level&&(i.parent.treeGrid.parentData.splice(0,0,e),R("dataOperation.dataArray",i.parent).splice(0,0,e.taskData)),i.updateTreeGridUniqueID(e,"add")}),this.updateTreeGridUniqueID(e,"add"),this.refreshNewlyAddedRecord(t,e);this.addNewUndoCollection({},t),this._resetProperties()},OXt.prototype._resetProperties=function(){this.parent.isOnEdit=!1,this.parent.hideSpinner(),this.addRowSelectedItem=null,this.newlyAddedRecordBackup=null,this.isBreakLoop=!1,this.parent.element.tabIndex=0,this.parent.initiateEditAction(!1)},OXt.prototype.updateTreeGridUniqueID=function(e,t){"add"===t?x("uniqueIDCollection."+e.uniqueID,e,this.parent.treeGrid):"delete"===t&&b(R("uniqueIDCollection",this.parent.treeGrid),e.uniqueID)},OXt.prototype.refreshNewlyAddedRecord=function(e,t){var i=this;if(this.parent.selectionModule&&this.parent.allowSelection&&("Row"===this.parent.selectionSettings.mode||"Both"===this.parent.selectionSettings.mode)&&(this.parent.staticSelectedRowIndex=this.parent.currentViewData.indexOf(e.data)),this.parent.timelineSettings.updateTimescaleView&&(s=[],0<e.modifiedRecords.length?(s=0<e.data.length?Pe([],[],e.data,!0):[e.data]).push.apply(s,e.modifiedRecords):s=0<e.data.length?Pe([],[],e.data,!0):[e.data],this.parent.timelineModule.updateTimeLineOnEditing([s],e.action)),this.addSuccess(e),e=this.constructTaskAddedEventArgs(t,e.modifiedRecords,"add"),this.updateRowIndex(),this.parent.trigger("actionComplete",e),je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose(),"ResourceView"===this.parent.viewType)if(1<t.length)for(var n,o=0;o<t.length;o++){e.data[o].ganttProperties.sharedTaskUniqueIds.push(e.data[o].ganttProperties.rowUniqueID),e.data[o].ganttProperties.resourceInfo?((n=Pe([],[],e.data[o].ganttProperties.resourceInfo,!0)).splice(0,1),this.updateResoures([],n,e.data[o])):this.parent.undoRedoModule&&(!this.parent.undoRedoModule||e.data[o].hasChildRecords||!this.parent.undoRedoModule.isUndoRedoPerformed)&&this.parent.undoRedoModule.isUndoRedoPerformed||(this.removeChildRecord(e.data[o]),this.parent.editModule.checkWithUnassignedTask(e.data[o]));for(var r=0;r<this.updateParentRecords.length;r++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[r]);this.updateParentRecords=[]}else{e.data.ganttProperties.sharedTaskUniqueIds.push(e.data.ganttProperties.rowUniqueID);var s=e.data,a=s.ganttProperties,l=s.childRecords,h=this.parent.undoRedoModule,d=function(e,t){e&&1<e.length&&((e=Pe([],[],e,!0)).splice(0,1),h&&h.isUndoRedoPerformed&&(i.parent.editModule.addRowIndex=void 0),i.updateResoures([],e,t))};a.resourceInfo&&a.resourceInfo.length?d(a.resourceInfo,s):0<l.length&&l[0].ganttProperties.resourceInfo&&l[0].ganttProperties.resourceInfo.length?d(l[0].ganttProperties.resourceInfo,e.data.childRecords[0]):this.parent.undoRedoModule&&(!this.parent.undoRedoModule||e.data.hasChildRecords||!this.parent.undoRedoModule.isUndoRedoPerformed)&&this.parent.undoRedoModule.isUndoRedoPerformed||(this.removeChildRecord(e.data),this.parent.editModule.checkWithUnassignedTask(e.data));for(r=0;r<this.updateParentRecords.length;r++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[r]);this.updateParentRecords=[]}},OXt.prototype.removeAddedRecord=function(){var e,t,i=this.parent.flatData,n=this.parent.currentViewData,o=this.parent.ids,r=i.indexOf(this.newlyAddedRecordBackup),s=n.indexOf(this.newlyAddedRecordBackup),a=o.indexOf(this.newlyAddedRecordBackup.ganttProperties.rowUniqueID.toString());b(this.parent.previousRecords,i[r].uniqueID),this.newlyAddedRecordBackup.parentItem&&(t=(e=this.parent.getParentTask(this.newlyAddedRecordBackup.parentItem)).childRecords.indexOf(this.newlyAddedRecordBackup),e.childRecords.splice(t,1),0===e.childRecords.length)&&e.hasChildRecords&&(e.hasChildRecords=!1),i.splice(r,1),n.splice(s,1),o.splice(a,1)},OXt.prototype.getPrevRecordIndex=function(){var e=this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0]-1],t=this.parent.selectionModule.getSelectedRecords()[0],e=this.parent.getRootParent(e,t.level);return this.parent.updatedRecords.indexOf(e)},OXt.prototype.indent=function(){var e=this.parent.selectedRowIndex,t=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length),i=this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0]-1],n=this.parent.selectionModule.getSelectedRecords()[0];this.parent.editSettings.allowEditing&&0!==e&&-1!==e&&t&&"ResourceView"!==this.parent.viewType&&(je(this.parent.updatedRecords[e])||this.parent.updatedRecords[e].level-i.level!=1)&&(t=i.level-n.level==0?this.parent.selectionModule.getSelectedRowIndexes()[0]-1:this.getPrevRecordIndex(),this.indentOutdentRow([this.parent.selectionModule.getSelectedRowIndexes()[0]],t,"child"))},OXt.prototype.outdent=function(){var e=this.parent.selectionModule.getSelectedRowIndexes()[0],t=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length);this.parent.editSettings.allowEditing&&-1!==e&&0!==e&&t&&"ResourceView"!==this.parent.viewType&&0!==this.parent.updatedRecords[e].level&&(t=this.parent.getTaskByUniqueID(this.parent.selectionModule.getSelectedRecords()[0].parentItem.uniqueID),t=this.parent.updatedRecords.indexOf(t),this.indentOutdentRow([e],t,"below"))},OXt.prototype.indentOutdentRow=function(e,t,i){var n=this;e[0],"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment");for(var i=void 0,o=[],r=0;r<e.length;r++)this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.undoRedoModule.currentAction?this.parent.undoRedoModule.currentAction.modifiedRecord?o[r]=this.parent.undoRedoModule.currentAction.modifiedRecord[r].data:o[r]=this.parent.undoRedoModule.currentAction.data[r]:o[r]=this.parent.updatedRecords[e[r]];var s={data:o,dropIndex:t,dropPosition:this.dropPosition};"middleSegment"===this.dropPosition?i="indenting":"bottomSegment"===this.dropPosition&&(i="outdenting"),this.parent.trigger("actionBegin",{action:i,data:o[0],cancel:!1},function(e){je(n.parent.loadingIndicator)||"Shimmer"!==n.parent.loadingIndicator.indicatorType?n.parent.showSpinner():n.parent.showMaskRow(),e.cancel?je(n.parent.loadingIndicator)||"Shimmer"!==n.parent.loadingIndicator.indicatorType?n.parent.hideSpinner():n.parent.hideMaskRow():n.reArrangeRows(s,!0)})},OXt.prototype.reArrangeRows=function(e,t){var i=this;if(this.dropPosition=e.dropPosition,this.parent.oldRecords=[],this.parent.oldRecords=Pe([],[],e.data,!0),"Invalid"!==e.dropPosition&&this.parent.editModule){for(var n,o,r,s,a,l=this.parent,l=(this.droppedRecord=l.updatedRecords[e.dropIndex],"middleSegment"===e.dropPosition?"Indent":"Outdent"),h=(this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.isUndoRedoItemPresent(l)&&((o={}).action=l,o.modifiedRecord=[],o.selectedRowIndexes=Pe([],[],this.parent.selectionModule.selectedRowIndexes,!0),this.parent.undoRedoModule.findPosition(Pe([],[],[e.data],!0)[0],o,"modifiedRecord"),o.droppedRecord=Pe([],[],this.droppedRecord,!0),this.parent.undoRedoModule.redoEnabled&&(this.parent.undoRedoModule.redoEnabled=!1,this.parent.undoRedoModule.getUndoCollection=[],this.parent.undoRedoModule.getRedoCollection=[],this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_redo"],!1),this.parent.undoRedoModule.getUndoCollection[0]=[]),this.parent.undoRedoModule.createUndoCollection(),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=o),[]),d=this.droppedRecord,p=(e.data[0]?h=e.data:h.push(e.data),0),c=h.length,u=0;u<c;u++)this.parent.isOnEdit=!0,n=h[u],this.draggedRecord=n,"Invalid"!==this.dropPosition&&(t&&this.deleteDragRow(),a=this.treeGridData.indexOf(d),this.parent.editModule.updateResourceRelatedFields(d,""),"bottomSegment"===this.dropPosition&&(d.hasChildRecords?(p=this.parent.editModule.getChildCount(d,0),this.parent.taskFields.parentID&&0<this.ganttData.length&&this.ganttData.splice(a+p+1,0,this.draggedRecord.taskData),this.treeGridData.splice(a+p+1,0,this.draggedRecord),this.parent.ids.splice(a+p+1,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),(r=this.parent.ids.indexOf(this.draggedRecord[this.parent.taskFields.id].toString()))!==a+p+1&&(this.parent.ids.splice(r,1),this.parent.ids.splice(a+p+1,0,this.draggedRecord[this.parent.taskFields.id].toString()))):(this.parent.taskFields.parentID&&0<this.ganttData.length&&this.ganttData.splice(a+1,0,this.draggedRecord.taskData),this.treeGridData.splice(a+1,0,this.draggedRecord),this.parent.ids.splice(a+1,0,this.draggedRecord.ganttProperties.rowUniqueID.toString())),this.parent.setRecordValue("parentItem",this.treeGridData[a].parentItem,n),this.parent.setRecordValue("parentUniqueID",this.treeGridData[a].parentUniqueID,n),this.parent.setRecordValue("level",this.treeGridData[a].level,n),n.hasChildRecords&&(this.updateChildRecordLevel(n,1),this.updateChildRecord(n,a+p+1)),d.parentItem)&&(s=(r=o=this.parent.getParentTask(d.parentItem).childRecords).indexOf(d)+1,r.splice(s,0,n)),"middleSegment"===this.dropPosition&&this.dropMiddle(a),je(n.parentItem&&-1!==this.updateParentRecords.indexOf(n.parentItem))||this.updateParentRecords.push(this.parent.getTaskByUniqueID(n.parentItem.uniqueID))),je(n.parentItem)&&(a=(s=this.parent.treeGrid.parentData).indexOf(this.droppedRecord),"bottomSegment"===this.dropPosition)&&s.splice(a+1,0,n),this.refreshDataSource();if("middleSegment"===this.dropPosition){if(!je(d.ganttProperties.predecessor))for(var g,m,f=d.ganttProperties.predecessor.length-1;0<=f;f--)je(d.ganttProperties.predecessor)||(m=this.parent.getRecordByID(d.ganttProperties.predecessor[f].from),g=this.parent.getRecordByID(d.ganttProperties.predecessor[f].to),m=this.parent.predecessorModule.validateParentPredecessor(m,g),!d.ganttProperties.predecessor)||m&&this.parent.allowParentDependency||(this.parent.editModule.removePredecessorOnDelete(d),d.ganttProperties.predecessor.splice(f,1),d.ganttProperties.predecessorsName=null,d[this.parent.taskFields.dependency]=null,d.taskData[this.parent.taskFields.dependency]=null);d.ganttProperties.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,d.ganttProperties,!0),je(d.taskData[this.parent.taskFields.milestone])||!0===d.taskData[this.parent.taskFields.milestone]&&(d.taskData[this.parent.taskFields.milestone]=!1))}for(var y=0;y<this.updateParentRecords.length;y++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[y]);this.parent.editedRecords.forEach(function(e){i.isFirstCall=!0,i.parent.predecessorModule.validatePredecessor(e,[],"")});for(y=0;y<this.updateParentRecords.length;y++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[y]);this.updateParentRecords=[],this.parent.isOnEdit=!1}this.canReset=!0,this.refreshRecord(e)},OXt.prototype.refreshRecord=function(t,i){var e,n,o,r,s=this;dqt(this.parent.dataSource)?(e=this.parent.dataSource,n={changedRecords:pqt(this.parent.editedRecords,null,null,this.parent)},o=this.parent.query instanceof ya?this.parent.query:new ya,((r=e.adaptor)instanceof za&&r instanceof Ra&&!e.dataSource.batchUrl?e.update(this.parent.taskFields.id,n.changedRecords,null,o):e.saveChanges(n,this.parent.taskFields.id,null,o)).then(function(e){return s.indentSuccess(e,t,i)}).catch(function(e){return s.indentFailure(e)})):this.indentOutdentSuccess(t,i)},OXt.prototype.indentSuccess=function(e,t,i){this.updateEditedFields(e),this.indentOutdentSuccess(t,i)},OXt.prototype.indentFailure=function(e){this.parent.trigger("actionFailure",{error:e})},OXt.prototype.indentOutdentSuccess=function(e,t){if(this.parent.treeGrid.parentData=[],this.parent.treeGrid.editModule&&(this.parent.treeGrid.editModule.isOnBatch=!1),this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&(this.refreshRecordInImmutableMode(e.data,t),this.parent.chartRowsModule.refreshRecords(this.parent.editedRecords)),t?e.requestType="rowDropped":"middleSegment"===this.dropPosition?e.requestType="indented":"bottomSegment"===this.dropPosition&&(e.requestType="outdented"),e.modifiedRecords=this.parent.editedRecords,this.parent.timezone)for(var i=0;i<e.modifiedRecords.length;i++)cqt(e.modifiedRecords[i],this.parent);this.canReset&&(this.parent.previousRecords={}),this.canReset=!1,this.parent.trigger("actionComplete",e),je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow(),this.parent.rowDragAndDropModule&&(this.parent.rowDragAndDropModule.draggedRecord=null)},OXt.prototype.refreshDataSource=function(){var e,t,i=this.draggedRecord,n=this.droppedRecord,o=this.parent,r=this.parent.dataSource instanceof me?R("dataOperation.dataArray",this.parent):o.dataSource;if(0<r.length&&!je(n)&&!n.parentItem){for(var s=0;s<Object.keys(r).length;s++)r[s][this.parent.taskFields.child]===n.taskData[this.parent.taskFields.child]&&(e=s);"topSegment"===this.dropPosition?this.parent.taskFields.parentID||r.splice(e,0,i.taskData):"bottomSegment"!==this.dropPosition||this.parent.taskFields.parentID||r.splice(e+1,0,i.taskData)}else this.parent.taskFields.parentID||je(n)||!n.parentItem||"topSegment"!==this.dropPosition&&"bottomSegment"!==this.dropPosition||(o="topSegment"===this.dropPosition?"Above":"Below",this.parent.editModule.addRowSelectedItem=n,t=[],Array.isArray(i)?t=i:t[0]=i,this.parent.editModule.updateRealDataSource(t,o),delete this.parent.editModule.addRowSelectedItem);this.parent.taskFields.parentID&&(i.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(i[this.parent.taskFields.parentID]=n[this.parent.taskFields.parentID],i.taskData[this.parent.taskFields.parentID]=n[this.parent.taskFields.parentID],i.ganttProperties.parentId=n[this.parent.taskFields.parentID]):(i[this.parent.taskFields.parentID]=n[this.parent.taskFields.id],i.taskData[this.parent.taskFields.parentID]=n[this.parent.taskFields.id],i.ganttProperties.parentId=n[this.parent.taskFields.id]):(i[this.parent.taskFields.parentID]=null,i.taskData[this.parent.taskFields.parentID]=null,i.ganttProperties.parentId=null))},OXt.prototype.deleteDragRow=function(){this.parent.dataSource instanceof me?this.ganttData=R("dataOperation.dataArray",this.parent):this.ganttData=sqt(this.parent)?R("result",this.parent.dataSource):this.parent.dataSource,this.treeGridData=sqt(this.parent)?R("result",this.parent.treeGrid.dataSource):this.parent.treeGrid.dataSource;var e=this.parent.getTaskByUniqueID(this.draggedRecord.uniqueID);this.removeRecords(e)},OXt.prototype.updateIndentedChildRecords=function(e){for(var t={uniqueID:e.uniqueID,expanded:e.expanded,level:e.level,index:e.index,taskId:e.ganttProperties.rowUniqueID},i=0;i<e.childRecords.length;i++)this.parent.setRecordValue("parentItem",t,e.childRecords[i]),this.parent.setRecordValue("parentUniqueID",e.uniqueID,e.childRecords[i]);if(e.hasChildRecords){e=e.childRecords;for(var n=0;n<e.length;n++)this.updateIndentedChildRecords(e[n])}},OXt.prototype.dropMiddle=function(e){var t,i,n=this.parent;this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.undoRedoModule.currentAction.modifiedRecord&&"child"!==this.parent.undoRedoModule.currentAction.modifiedRecord[0].position?"above"===this.parent.undoRedoModule.currentAction.modifiedRecord[0].position?t=this.parent.ids.indexOf(this.parent.undoRedoModule.currentAction.modifiedRecord[0].id.toString()):"below"===this.parent.undoRedoModule.currentAction.modifiedRecord[0].position&&(t=this.parent.ids.indexOf(this.parent.undoRedoModule.currentAction.modifiedRecord[0].id.toString())+1):t=je(i=this.parent.editModule.getChildCount(this.droppedRecord,0))||0===i?e+1:i+e+1,"middleSegment"===this.dropPosition&&(this.droppedRecord.ganttProperties.isAutoSchedule&&!je(this.droppedRecord.ganttProperties.predecessorsName)&&""!==this.droppedRecord.ganttProperties.predecessorsName&&(i=this.droppedRecord.ganttProperties.startDate,this.parent.setRecordValue("startDate",i,this.draggedRecord.ganttProperties,!0),this.parent.dateValidationModule.calculateEndDate(this.draggedRecord),this.parent.dataOperation.updateTaskData(this.draggedRecord),this.parent.dataOperation.updateTaskLeftWidth(this.draggedRecord)),n.taskFields.parentID&&0<this.ganttData.length&&this.ganttData.splice(t,0,this.draggedRecord.taskData),this.treeGridData.splice(t,0,this.draggedRecord),this.parent.ids.splice(t,0,this.draggedRecord[this.parent.taskFields.id].toString()),this.recordLevel(),this.draggedRecord.hasChildRecords&&(this.updateChildRecord(this.draggedRecord,t,this.droppedRecord.expanded),this.parent.enableImmutableMode)&&(e=this.draggedRecord,this.updateIndentedChildRecords(e)),je(this.draggedRecord.parentItem&&-1!==this.updateParentRecords.indexOf(this.draggedRecord.parentItem)))&&this.updateParentRecords.push(this.draggedRecord.parentItem)},OXt.prototype.updateChildRecordLevel=function(e,t){if(t++,!e.hasChildRecords)return 0;for(var i=e.childRecords.length,n=0;n<i;n++){var o=e.childRecords[n],r=void 0;e.parentItem&&(r=this.parent.treeGrid.uniqueIDCollection[e.parentItem.uniqueID]),o.level=e.parentItem?r.level+t:e.level+1,o.hasChildRecords&&(t--,t=this.updateChildRecordLevel(o,t))}return t},OXt.prototype.updateChildRecord=function(e,t,i){var n,o=this.parent;if(!e.hasChildRecords)return 0;for(var r=e.childRecords.length,s=0;s<r;s++)n=e.childRecords[s],o.flatData.splice(++t,0,n),this.parent.ids.splice(t,0,n.ganttProperties.rowUniqueID.toString()),o.taskFields.parentID&&0<this.ganttData.length&&this.ganttData.splice(t,0,n.taskData),n.hasChildRecords&&(t=this.updateChildRecord(n,t));return t},OXt.prototype.removeRecords=function(e){var t=this.parent,i=this.parent.dataSource instanceof me?R("dataOperation.dataArray",this.parent):this.parent.dataSource,n=e;if(n){e=this.parent.getParentTask(n.parentItem);if(n.parentItem&&(l=0,h=e?e.childRecords:[])&&0<h.length&&(l=h.indexOf(n),e.childRecords.splice(l,1),this.parent.taskFields.parentID||e.taskData[this.parent.taskFields.child].splice(l,1),this.updateParentRecords.push(e)),t.taskFields.parentID){n.hasChildRecords&&0<n.childRecords.length&&this.removeChildItem(n);for(var o=void 0,r=0<i.length?i:this.parent.currentViewData,s=0;s<r.length;s++)r[s][this.parent.taskFields.id]===n.taskData[this.parent.taskFields.id]&&(o=s);if(-1!==o){0<i.length&&i.splice(o,1);for(var a=void 0,s=0;s<this.treeGridData.length;s++)this.treeGridData[s][this.parent.taskFields.id]===n.taskData[this.parent.taskFields.id]&&(a=s);this.treeGridData.splice(a,1),this.parent.ids.splice(a,1),-1!==this.parent.treeGrid.parentData.indexOf(n)&&this.parent.treeGrid.parentData.splice(this.parent.treeGrid.parentData.indexOf(n),1)}}var l,h=this.treeGridData.indexOf(n);t.taskFields.parentID||(l=this.getChildCount(n,0),this.treeGridData.splice(h,l+1),this.parent.ids.splice(h,l+1),-1!==(i=this.ganttData.indexOf(n.taskData))&&(this.ganttData.splice(i,1),this.parent.treeGrid.parentData.splice(i,1))),n.parentItem&&e&&e.childRecords&&!e.childRecords.length&&(this.parent.setRecordValue("expanded",!1,e),this.parent.setRecordValue("hasChildRecords",!1,e))}},OXt.prototype.removeChildItem=function(e){for(var t,i=0;i<e.childRecords.length;i++){for(var n=e.childRecords[i],o=void 0,o=this.parent.dataSource instanceof me?R("dataOperation.dataArray",this.parent):this.parent.dataSource,r=0;r<o.length;r++)o[r][this.parent.taskFields.id]===n.taskData[this.parent.taskFields.id]&&(t=r);if(-1!==t){0<o.length&&o.splice(t,1);for(var s=void 0,a=0;a<this.treeGridData.length;a++)this.treeGridData[a][this.parent.taskFields.id]===n.taskData[this.parent.taskFields.id]&&(s=a);this.treeGridData.splice(s,1),this.parent.ids.splice(s,1)}n.hasChildRecords&&this.removeChildItem(n)}},OXt.prototype.recordLevel=function(){var e,t=this.parent,i=this.draggedRecord,n=this.droppedRecord,o=t.taskFields.child;n.hasChildRecords||(n.hasChildRecords=!0,n.childRecords.length)||(n.childRecords=[],!t.taskFields.parentID&&je(n.taskData[o])&&(n.taskData[o]=[])),"middleSegment"===this.dropPosition&&(delete(e=Pe({},n)).childRecords,e={uniqueID:e.uniqueID,expanded:e.expanded,level:e.level,index:e.index,taskId:e.ganttProperties.rowUniqueID},this.parent.setRecordValue("parentItem",e,i),this.parent.setRecordValue("parentUniqueID",n.uniqueID,i),n.childRecords.splice(n.childRecords.length,0,i),je(i)||t.taskFields.parentID||je(n.taskData[o])||n.taskData[t.taskFields.child].splice(n.childRecords.length,0,i.taskData),!je(n.ganttProperties.segments)&&0<n.ganttProperties.segments.length&&(n.ganttProperties.segments=null,n.taskData[t.taskFields.segments]=null),i.hasChildRecords?(i.level=n.level+1,this.updateChildRecordLevel(i,1)):i.level=n.level+1,n.expanded=!0)},OXt);function OXt(e){this.isFromDeleteMethod=!1,this.targetedRecords=[],this.isNewRecordAdded=!1,this.isValidatedEditedRecord=!1,this.createArray=!0,this.deletedRecord=[],this.canReset=!1,this.updateParentRecords=[],this.isaddtoBottom=!1,this.confirmDialog=null,this.taskbarMoved=!1,this.predecessorUpdated=!1,this.isBreakLoop=!1,this.deletedTaskDetails=[],this.parent=e,this.parent.predecessorModule.validatedChildItems=[],this.parent.editSettings.allowEditing&&"Auto"===this.parent.editSettings.mode&&(this.cellEditModule=new wXt(this.parent)),this.parent.taskFields.dependency&&(this.parent.connectorLineEditModule=new FXt(this.parent)),(this.parent.editSettings.allowAdding||this.parent.editSettings.allowEditing&&("Dialog"===this.parent.editSettings.mode||"Auto"===this.parent.editSettings.mode))&&(this.dialogModule=new kXt(this.parent)),this.parent.editSettings.allowTaskbarEditing&&(this.taskbarEditModule=new EXt(this.parent)),this.parent.editSettings.allowDeleting&&(e=Q("div",{id:this.parent.element.id+"_deleteConfirmDialog"}),this.parent.element.appendChild(e),this.renderDeleteConfirmDialog()),this.parent.treeGrid.recordDoubleClick=this.recordDoubleClick.bind(this),this.parent.treeGrid.editSettings.allowAdding=this.parent.editSettings.allowAdding,this.parent.treeGrid.editSettings.allowDeleting=this.parent.editSettings.allowDeleting,this.parent.treeGrid.editSettings.showDeleteConfirmDialog=this.parent.editSettings.showDeleteConfirmDialog,this.parent.treeGrid.editSettings.allowNextRowEdit=this.parent.editSettings.allowNextRowEdit,"Dialog"===this.parent.editSettings.mode&&eee.Inject(Lee),this.updateDefaultColumnEditors()}NXt.prototype.getModuleName=function(){return"reorder"},NXt.prototype.bindEvents=function(){var t=this;this.parent.treeGrid.columnDragStart=function(e){t.parent.trigger("columnDragStart",e)},this.parent.treeGrid.columnDrag=function(e){t.parent.trigger("columnDrag",e)},this.parent.treeGrid.columnDrop=function(e){t.parent.trigger("columnDrop",e)}},NXt.prototype.destroy=function(){};det=NXt;function NXt(e){this.parent=e,eee.Inject(iee),this.parent.treeGrid.allowReordering=this.parent.allowReordering,this.bindEvents()}var VXt=function(){return(VXt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},q$e=(_Xt.prototype.getModuleName=function(){return"resize"},_Xt.prototype.bindEvents=function(){var i=this;this.parent.treeGrid.resizeStart=function(e){var t;i.parent.undoRedoModule&&i.parent.isUndoRedoItemPresent("ColumnResize")&&(i.parent.undoRedoModule.createUndoCollection(),(t={action:"ColumnResize"}).resizedColumn=VXt({},e.column),i.parent.undoRedoModule.getUndoCollection[i.parent.undoRedoModule.getUndoCollection.length-1]=t),i.parent.trigger("resizeStart",e)},this.parent.treeGrid.resizing=function(e){i.parent.trigger("resizing",e)},this.parent.treeGrid.resizeStop=function(e){i.parent.trigger("resizeStop",e)}},_Xt.prototype.destroy=function(){},_Xt);function _Xt(e){this.parent=e,eee.Inject(oee),this.parent.treeGrid.allowResizing=this.parent.allowResizing,this.bindEvents()}HXt.prototype.getModuleName=function(){return"filter"},HXt.prototype.updateCustomFilters=function(){for(var e=this.parent.taskFields,t=0;t<this.parent.ganttColumns.length;t++){var i=this.parent.ganttColumns[t];("datepickeredit"!==i.editType&&"datetimepickeredit"!==i.editType||i.field!==e.startDate&&i.field!==e.endDate&&i.field!==e.baselineStartDate&&i.field!==e.baselineEndDate)&&(i.field!==e.duration||"stringedit"!==i.editType)||this.initiateFiltering(this.parent.ganttColumns[t])}},HXt.prototype.updateModel=function(){this.parent.filterSettings=this.parent.treeGrid.filterSettings},HXt.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this),this.parent.on("actionBegin",this.actionBegin,this),this.parent.on("actionComplete",this.actionComplete,this),this.parent.on("columnMenuOpen",this.columnMenuOpen,this)},HXt.prototype.wireEvents=function(e){E.add(document.getElementById(e),"click",this.mouseClickHandler,this)},HXt.prototype.initiateFiltering=function(e){var t=this.parent.getColumnByField(e.field,this.parent.treeGridModule.treeGridColumns);e.allowFiltering=!1!==e.allowFiltering,!e.allowFiltering||"Menu"!==this.parent.filterSettings.type&&"Excel"!==this.parent.filterSettings.type||e.filter||(e.filter={ui:this.getCustomFilterUi(e)}),t&&(t.allowFiltering=e.allowFiltering,t.filter=e.allowFiltering?e.filter:{})},HXt.prototype.getCustomFilterUi=function(e){var t=this.parent.taskFields,i={};return"datepickeredit"!==e.editType||e.field!==t.startDate&&e.field!==t.endDate&&e.field!==t.baselineStartDate&&e.field!==t.baselineEndDate?"datetimepickeredit"!==e.editType||e.field!==t.startDate&&e.field!==t.endDate&&e.field!==t.baselineStartDate&&e.field!==t.baselineEndDate?e.field===t.duration&&"stringedit"===e.editType&&(i=this.getDurationFilter()):i=this.getDateTimePickerFilter():i=this.getDatePickerFilter(e.field),i},HXt.prototype.mouseClickHandler=function(e){z(e.target,".e-excelfilter")&&this.parent.treeGrid.grid.notify("click",e)},HXt.prototype.unWireEvents=function(){E.remove(this.parent.element,"click",this.mouseClickHandler)},HXt.prototype.getDatePickerFilter=function(e){var n,o=this,t=this.parent,i=e===t.taskFields.startDate||e===t.taskFields.baselineStartDate?t.defaultStartTime:t.defaultEndTime;return{create:function(e){var t=LB(e.column.format,e.column.type),i=Q("input",{className:"flm-input"});e.target.appendChild(i),(n=new o9({placeholder:o.parent.localeObj.getConstant("enterValue"),format:t})).enableRtl=o.parent.enableRtl,n.appendTo(i)},write:function(e){n.value=e.filteredValue},read:function(e){n.value&&n.value.setSeconds(i),e.fltrObj.filterByColumn(e.column.field,e.operator,n.value)}}},HXt.prototype.getDateTimePickerFilter=function(){var n,o=this;return{create:function(e){var t=LB(e.column.format,e.column.type),i=Q("input",{className:"flm-input"});e.target.appendChild(i),(n=new jq({placeholder:o.parent.localeObj.getConstant("enterValue"),format:t})).enableRtl=o.parent.enableRtl,n.appendTo(i)},write:function(e){n.value=e.filteredValue},read:function(e){e.fltrObj.filterByColumn(e.column.field,e.operator,n.value)}}},HXt.prototype.getDurationFilter=function(){var o,r=this,s=this.parent,a="";return{create:function(e){var t=Q("input",{className:"e-input"});t.setAttribute("placeholder",r.parent.localeObj.getConstant("enterValue")),e.target.appendChild(t),(o=new fV).enableRtl=r.parent.enableRtl,o.appendTo(t)},write:function(e){o.value=e.filteredValue?a:""},read:function(e){var t,i=r.parent.dataOperation.getDurationValue(o.value),n=R("duration",i),i=R("durationUnit",i);a=0<=n?(t=void 0,"minute"===i?t=60*n/s.secondsPerDay:"hour"===i?t=60*n*60/s.secondsPerDay:(t=n,i="day"),e.fltrObj.filterByColumn(e.column.field,e.operator,t),r.parent.dataOperation.getDurationString(n,i)):(e.fltrObj.filterByColumn(e.column.field,e.operator,null),null)}}},HXt.prototype.columnMenuOpen=function(e){this.filterMenuElement&&document.body.contains(this.filterMenuElement)&&ue(this.filterMenuElement),this.filterMenuElement=null},HXt.prototype.actionBegin=function(e){},HXt.prototype.closeFilterOnContextClick=function(e){var t,i=document.querySelector("body > div.e-datepicker"),n=document.querySelector("body > div.e-datetimepicker");this.filterMenuElement&&document.body.contains(this.filterMenuElement)&&(t=z(e,"#"+this.parent.element.id)||e.querySelector("#"+this.parent.element.id),(this.filterMenuElement.contains(e)||je(t))&&(this.filterMenuElement.contains(e)||this.parent.enableAdaptiveUI||!je(i)||!je(n)||"DIV"!==e.nodeName&&"HTML"!==e.nodeName&&"SPAN"!==e.nodeName&&"BUTTON"!==e.nodeName||e.classList.contains("e-dropdownbase"))||(ue(this.filterMenuElement),this.parent.treeGrid.grid.notify("filter-menu-close",{isOpen:!1}),this.filterMenuElement=null))},HXt.prototype.actionComplete=function(e){var t,i,n,o,r,s;je(e.filterModel)||je(e.filterModel.dialogObj)||je(e.filterModel.dialogObj.element)||"Excel"===this.parent.filterSettings.type&&this.wireEvents(e.filterModel.dialogObj.element.id),e.requestType===_1&&("Menu"===this.parent.treeGrid.filterSettings.type?this.filterMenuElement=R("filterModel.dlgObj.element",e):this.filterMenuElement=R("filterModel.dialogObj.element",e),this.updateFilterMenuPosition(this.filterMenuElement,e),t=this.parent.taskFields.id,i=this.parent.taskFields.dependency,n=this.parent.taskFields.resourceInfo,o=R("values",this.parent.treeGrid.grid.filterModule),e.columnName===i&&je(R(i,o))||e.columnName===n&&je(R(n,o))?(s=void 0,je(r=this.filterMenuElement.querySelector(".e-dropdownlist"))||((s=R("ej2_instances[0]",r)).index=2,s.dataBind())):e.columnName===t&&je(R(t,o))&&"Menu"===this.parent.treeGrid.filterSettings.type&&!je(s=R("ej2_instances[0]",r=this.filterMenuElement.querySelector(".e-flmenu-input")))&&je(this.parent.columnByField[e.columnName].format)&&(s.format="n"))},HXt.prototype.setPosition=function(e,t){var i,n,o,r,s=this.parent.element.getBoundingClientRect(),a=s.top+window.scrollY,l=s.left,h=!1;if(!je(this.parent.element.parentNode)&&"BODY"!==this.parent.element.parentNode.tagName){for(var h=!0,d=this.parent.element.parentNode,p=Math.abs(d.getBoundingClientRect().top),c=p>window.scrollY?p-window.scrollY:window.scrollY-p,u=d.style.marginTop;;){if(Math.abs(a)>Math.abs(c)){n=a-c;break}if(!je(this.parent.element.parentNode)){if(d.parentNode instanceof HTMLDocument)break;(d=d.parentNode).parentNode&&d.parentNode.style&&(u=d.parentNode.style.marginTop)}c=d.getBoundingClientRect().top}for(i=d.getBoundingClientRect().left,r=d.style.marginLeft;;){if(Math.abs(l)>Math.abs(i)){o=l-i;break}if(!je(this.parent.element.parentNode)){if(d.parentNode instanceof HTMLDocument)break;r=(d=d.parentNode).style.marginLeft}i=d.getBoundingClientRect().left}}var p=e.getBoundingClientRect(),e=p.right+window.scrollX,g=h?p.top-a:p.top+window.scrollY;s.right<e+t.offsetWidth?p.left-t.offsetWidth>s.left?e=p.left-t.offsetWidth:e-=e+t.offsetWidth-s.right:je(n)&&je(o)||!h||(e=Math.abs(p.right-s.left),g=Math.abs(p.top-s.top)),je(n)||je(o)?(t.style.top=g+"px",t.style.left=e+"px"):(t.style.top="string"==typeof parseInt(u,10)?g+n+parseInt(u,10)+"px":g+n+"px",t.style.left="string"==typeof parseInt(r,10)?e+o+parseInt(r,10)+8+"px":e+o+"px")},HXt.prototype.updateFilterMenuPosition=function(e,t){var i;U([e],"e-gantt"),this.parent.enableAdaptiveUI||document.querySelector("#"+this.parent.controlId).appendChild(e),this.parent.showColumnMenu?(i=document.querySelector("#treeGrid"+this.parent.controlId+"_gridcontrol_colmenu_Filter"))&&(e.style.zIndex=i.parentElement.style.zIndex,"Menu"===this.parent.treeGrid.filterSettings.type?this.setPosition(i,R("filterModel.dlgObj.element",t)):this.setPosition(i,R("filterModel.dialogObj.element",t))):(i=this.parent.treeGrid.grid.getColumnHeaderByField(t.columnName).querySelector(".e-filtermenudiv"),"Menu"===this.parent.treeGrid.filterSettings.type?wB(i,R("filterModel.dlgObj",t)):wB(i,R("filterModel.dialogObj",t))),e.style.display="block","Menu"===this.parent.treeGrid.filterSettings.type&&e.querySelector(".e-valid-input").focus(),"Excel"===this.parent.treeGrid.filterSettings.type&&document.querySelector(".e-searchinput").focus()},HXt.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateModel",this.updateModel),this.parent.off("actionBegin",this.actionBegin),this.parent.off("actionComplete",this.actionComplete),this.parent.off("columnMenuOpen",this.columnMenuOpen))},HXt.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents()};h=HXt;function HXt(e){this.parent=e,eee.Inject(mee),this.parent.treeGrid.allowFiltering=this.parent.allowFiltering,this.updateCustomFilters(),this.parent.treeGrid.filterSettings=qP(this.parent.filterSettings),this.addEventListener()}zXt.prototype.getModuleName=function(){return"sort"},zXt.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this)},zXt.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("updateModel",this.updateModel)},zXt.prototype.destroy=function(){this.removeEventListener()},zXt.prototype.sortColumn=function(e,t,i){this.parent.treeGrid.sortByColumn(e,t,i)},zXt.prototype.clearSorting=function(){this.parent.treeGrid.clearSorting()},zXt.prototype.updateModel=function(){this.parent.sortSettings=this.parent.treeGrid.sortSettings},zXt.prototype.removeSortColumn=function(e){this.parent.treeGrid.grid.removeSortColumn(e)};d2t=zXt;function zXt(e){this.parent=e,eee.Inject(Tee),this.parent.treeGrid.allowSorting=this.parent.allowSorting,this.parent.treeGrid.sortSettings=qP(this.parent.sortSettings),this.addEventListener()}jXt.prototype.getModuleName=function(){return"selection"},jXt.prototype.wireEvents=function(){this.parent.on("selectRowByIndex",this.selectRowByIndex,this),this.parent.isAdaptive?(this.parent.on("chartMouseClick",this.mouseUpHandler,this),this.parent.on("treeGridClick",this.popUpClickHandler,this)):this.parent.on("chartMouseUp",this.mouseUpHandler,this)},jXt.prototype.selectRowByIndex=function(){-1===this.parent.selectedRowIndex&&-1===this.parent.staticSelectedRowIndex||(this.selectRow(-1!==this.parent.staticSelectedRowIndex?this.parent.staticSelectedRowIndex:this.parent.selectedRowIndex),this.parent.staticSelectedRowIndex=-1)},jXt.prototype.bindEvents=function(){this.parent.treeGrid.rowSelecting=this.rowSelecting.bind(this),this.parent.treeGrid.rowSelected=this.rowSelected.bind(this),this.parent.treeGrid.rowDeselecting=this.rowDeselecting.bind(this),this.parent.treeGrid.rowDeselected=this.rowDeselected.bind(this),this.parent.treeGrid.cellSelecting=this.cellSelecting.bind(this),this.parent.treeGrid.cellSelected=this.cellSelected.bind(this),this.parent.treeGrid.cellDeselecting=this.cellDeselecting.bind(this),this.parent.treeGrid.cellDeselected=this.cellDeselected.bind(this)},jXt.prototype.rowSelecting=function(e){this.parent.isGanttChartRendered?(e.isCtrlPressed=this.isMultiCtrlRequest||e.isCtrlPressed,e.isShiftPressed=this.isMultiShiftRequest||e.isShiftPressed,e.target=this.actualTarget,je(e.foreignKeyData)||0!==Object.keys(e.foreignKeyData).length||delete e.foreignKeyData,this.parent.selectionSettings&&this.parent.selectionSettings.persistSelection&&(this.parent.treeGrid.grid.selectionModule.checkSelectAllClicked=!0),this.parent.trigger("rowSelecting",e),(this.isMultiShiftRequest||this.isMultiCtrlRequest)&&(this.isMultiShiftRequest=this.isMultiCtrlRequest=!1)):e.cancel=!0},jXt.prototype.rowSelected=function(e){var t="rowIndexes",t="Multiple"!==this.parent.selectionSettings.type||je(e[t])?[e.rowIndex]:e[t];if(this.addRemoveClass(t,e.name),this.selectedRowIndexes=Pe([],this.getSelectedRowIndexes(),[],!0),this.parent.setProperties({selectedRowIndex:this.parent.treeGrid.grid.selectedRowIndex},!0),this.isMultiShiftRequest&&(this.selectedRowIndexes=t),this.parent.autoFocusTasks)if(this.parent.enableTimelineVirtualization&&(this.parent.isRowSelected=!0),e.data&&!je(e.data.length))for(var i=0;i<e.data.length;i++)this.parent.ganttChartModule.updateScrollLeft(e.data[i].ganttProperties.left);else this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping&&je(R("data.ganttProperties.left",e))&&(e.data=this.parent.getRecordByID(e.data.taskId)),this.parent.ganttChartModule.updateScrollLeft(R("data.ganttProperties.left",e));e.target=this.actualTarget,je(e.foreignKeyData)||0!==Object.keys(e.foreignKeyData).length||delete e.foreignKeyData,this.prevRowIndex=e.rowIndex,je(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(e),je(this.parent.focusModule.previousActiveElement)||(q([t=this.parent.focusModule.previousActiveElement],"e-focused"),q([t],"e-focus")),this.parent.trigger("rowSelected",e)},jXt.prototype.rowDeselecting=function(e){e.target=this.actualTarget,e.isInteracted=this.isInteracted,this.parent.trigger("rowDeselecting",e)},jXt.prototype.rowDeselected=function(e){var t,i;if(0!==this.multipleIndexes.length)t=this.multipleIndexes;else if(je(e.rowIndexes))t=[e.rowIndex];else{for(var n=0;n<e.rowIndexes.length;n++)e.rowIndexes[n]===e.rowIndex&&(i=!0);t=i?e.rowIndexes:[e.rowIndex]}this.addRemoveClass(t),this.selectedRowIndexes=Pe([],this.getSelectedRowIndexes(),[],!0),this.parent.setProperties({selectedRowIndex:-1},!0),1===this.selectedRowIndexes.length&&this.parent.setProperties({selectedRowIndex:this.selectedRowIndexes[0]},!0),je(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),"Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive&&0===this.selectedRowIndexes.length&&this.hidePopUp(),e.target=this.actualTarget,e.isInteracted=this.isInteracted,this.parent.trigger("rowDeselected",e),this.isInteracted=!1,this.multipleIndexes=[]},jXt.prototype.cellSelecting=function(e){var t=new ll;return this.parent.trigger("cellSelecting",e,function(e){t.resolve(e)}),t},jXt.prototype.cellSelected=function(e){this.parent.trigger("cellSelected",e),je(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},jXt.prototype.cellDeselecting=function(e){this.parent.trigger("cellDeselecting",e)},jXt.prototype.cellDeselected=function(e){this.parent.trigger("cellDeselected",e),je(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},jXt.prototype.selectCell=function(e,t){this.parent.treeGrid.selectCell(e,t)},jXt.prototype.selectCells=function(e){this.parent.treeGrid.grid.selectCells(e)},jXt.prototype.selectRow=function(t,e,i){var n,o=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children),o=(this.parent.enableVirtualization&&(this.parent.treeGridModule.addedRecord||this.parent.editModule&&this.parent.editModule.isAdded)&&(t=this.parent.getExpandedRecords(this.parent.flatData).indexOf(this.parent.flatData[t]),this.parent.treeGridModule.addedRecord=!1,this.parent.editModule)&&(this.parent.editModule.isAdded=!1),o.filter(function(e){return parseInt(e.getAttribute("aria-rowindex"),10)-1===t})[0]);-1===t||je(o)&&!this.parent.enableVirtualization||"Cell"===this.parent.selectionSettings.mode||(this.parent.showActiveElement&&!je(i)&&!i||this.isFromChart?(this.isFromChart&&(this.isFromChart=!1),this.parent.treeGrid.grid.selectionModule.preventFocus=!0):this.parent.treeGrid.grid.selectionModule.preventFocus=!1,!0!==(n=je(this.selectedClass)||this.selectedClass!==o||e?n:!0)&&this.parent.treeGrid.selectRow(t,e),this.parent.treeGrid.grid.selectionModule.preventFocus=!0!==this.parent.treeGrid.grid.selectionModule.preventFocus&&this.parent.treeGrid.grid.selectionModule.preventFocus,this.prevRowIndex=t,this.selectedClass=o)},jXt.prototype.selectRows=function(e){!je(e)&&0<e.length&&this.parent.treeGrid.selectRows(e)},jXt.prototype.getSelectedRowIndexes=function(){return this.parent.treeGrid.getSelectedRowIndexes()},jXt.prototype.getSelectedRowCellIndexes=function(){return this.parent.treeGrid.getSelectedRowCellIndexes()},jXt.prototype.getSelectedRecords=function(){if(this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping){for(var i=[],n=this.parent.selectionModule.getSelectedRowIndexes(),o=this,e=0;e<n.length;e++)!function(t){var e=o.parent.currentViewData.filter(function(e){return e.index===n[t]})[0];i.push(e)}(e);return i}return this.parent.treeGrid.getSelectedRecords()},jXt.prototype.getCellSelectedRecords=function(){for(var e=this.parent.selectionModule.getSelectedRowCellIndexes(),t=[],i=0;i<e.length;i++)t.push(this.parent.currentViewData[e[i].rowIndex]);return t},jXt.prototype.getSelectedRows=function(){return this.parent.treeGrid.getSelectedRows()},jXt.prototype.clearSelection=function(){this.addRemoveClass(this.selectedRowIndexes),this.parent.treeGrid.clearSelection(),this.parent.selectedRowIndex=-1,this.selectedRowIndexes=[],this.selectedClass=null,je(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),this.isInteracted=!1},jXt.prototype.highlightSelectedRows=function(e,t){var i;this.isMultiCtrlRequest=e.ctrlKey||this.enableSelectMultiTouch,this.isMultiShiftRequest=e.shiftKey,this.actualTarget=e.target,this.isInteracted=!0,(this.isSelectionFromChart=t)&&(t=z(e.target,"tr.e-chart-row"),t=parseInt(t.getAttribute("aria-rowindex"),10)-1,i=this.parent.selectionSettings.enableToggle,"Single"===this.parent.selectionSettings.type||!this.isMultiCtrlRequest&&!this.isMultiShiftRequest?(this.parent.selectionSettings.persistSelection&&this.addRemoveClass(this.selectedRowIndexes,e.name),(!this.parent.allowTaskbarDragAndDrop||this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&!this.parent.rowDragAndDropModule.draggedRecord)&&(this.isFromChart=!0,this.selectRow(t,i))):this.isMultiShiftRequest?this.selectRowsByRange(je(this.prevRowIndex)?t:this.prevRowIndex,t):(x("isMultiCtrlRequest",!0,this.parent.treeGrid.grid.selectionModule),this.parent.treeGrid.grid.selectionModule.addRowsToSelection([t]),-1<this.selectedRowIndexes.indexOf(t)&&this.addRemoveClass([t],e.name)))},jXt.prototype.getselectedrowsIndex=function(e,t){for(var i=[],n=e<t?{i:e,max:t}:{i:t,max:e},o=n.i,r=n.max;o<=r;o++)i.push(o);t<e&&i.reverse(),this.selectedRowIndexes=i},jXt.prototype.selectRowsByRange=function(e,t){this.isSelectionFromChart=!0,this.getselectedrowsIndex(e,t),this.selectRows(this.selectedRowIndexes)},jXt.prototype.addRemoveClass=function(r,s){"number"==typeof r&&(r=[r]);for(var a=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children),l=this,e=0;e<r.length;e++)!function(t){var e,i,n,o=a.filter(function(e){return parseInt(e.getAttribute("aria-rowindex"),10)-1===r[parseInt(t.toString(),10)]})[0];je(o)||(e=!1,i=l.getSelectedRowIndexes().indexOf(r[parseInt(t.toString(),10)]),n=l.getSelectedRecords().length,l.parent.selectionSettings.persistSelection&&l.parent.selectionSettings.enableToggle&&!je(s)&&"Multiple"!==l.parent.selectionSettings.type&&0<n&&(e=!0),l.parent.selectionSettings.enableToggle&&l.parent.selectionSettings.persistSelection&&-1<i&&"Single"===l.parent.selectionSettings.type&&e||-1<i&&!je(s)&&"Multiple"===l.parent.selectionSettings.type?l.addClass(o):je(s)?l.removeClass(o):-1<i&&l.addClass(o),l.parent.selectionSettings.enableToggle&&-1<i&&("Single"===l.parent.selectionSettings.type||!l.isMultiCtrlRequest&&!l.isMultiShiftRequest)&&l.parent.selectionSettings.persistSelection&&"chartMouseUp"===s&&l.isSelectionFromChart&&l.removeClass(o))}(e)},jXt.prototype.addClass=function(e){U([e],"e-active"),e.setAttribute("aria-selected","true")},jXt.prototype.removeClass=function(e){q([e],"e-active"),e.removeAttribute("aria-selected")},jXt.prototype.showPopup=function(e){this.isSelectionFromChart?(UP(this.parent.element.querySelector(".e-ganttpopup"),e,"e-rowselect e-icons e-icon-rowselect"+(this.enableSelectMultiTouch&&(1<this.getSelectedRecords().length||1<this.getSelectedRowCellIndexes().length)?" e-spanclicked":"")),document.getElementsByClassName("e-gridpopup")[0].style.display="none",this.openPopup=!0):0===this.selectedRowIndexes.length&&this.hidePopUp()},jXt.prototype.hidePopUp=function(){this.openPopup?(document.getElementsByClassName("e-ganttpopup")[0].style.display="none",this.openPopup=!1):document.getElementsByClassName("e-gridpopup")[0].style.display="none"},jXt.prototype.popUpClickHandler=function(e){var e=e.target,t=this.parent.treeGrid.grid,i=z(e,".e-ganttpopup")?z(e,".e-ganttpopup"):z(e,".e-gridpopup");i?(i=i.querySelector(".e-rowselect"),z(e,".e-ganttpopup")&&!i.classList.contains("e-spanclicked")?(this.enableSelectMultiTouch=!0,i.classList.add("e-spanclicked")):z(e,".e-gridpopup")&&i.classList.contains("e-spanclicked")?(this.openPopup=!0,this.enableSelectMultiTouch=!0):(this.hidePopUp(),this.enableSelectMultiTouch=!1,z(e,".e-ganttpopup")&&i.classList.remove("e-spanclicked"))):"Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive&&z(e,".e-rowcell")&&(0===this.selectedRowIndexes.length&&"Row"===this.parent.selectionSettings.mode||0===this.getCellSelectedRecords().length&&"Cell"===this.parent.selectionSettings.mode)&&this.hidePopUp(),t&&x("enableSelectMultiTouch",this.enableSelectMultiTouch,t.selectionModule)},jXt.prototype.mouseUpHandler=function(e){var t=!1,i=document.querySelectorAll(".e-drag-item"),n=null;e.target.closest(".e-rowcell")?n=e.target:e.target.closest(".e-chart-row")&&(n=e.target.closest(".e-left-label-container")||e.target.closest(".e-taskbar-main-container")||e.target.closest(".e-right-label-container")),this.parent.focusModule&&this.parent.focusModule.setActiveElement(n),!(t=this.parent.editModule&&this.parent.editSettings.allowTaskbarEditing&&this.parent.editModule.taskbarEditModule&&((n=this.parent.editModule.taskbarEditModule).isMouseDragged||n.tapPointOnFocus)?!0:t)&&this.parent.element.contains(e.target)&&1!==i.length&&(n=A(e.target,"e-chart-row"),t=e.target.classList.contains("e-rowcell")||e.target.classList.contains("e-row")||e.target.parentElement&&e.target.parentElement.classList.contains("e-checkbox-wrapper")||e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse")||!je(n),this.popUpClickHandler(e),"Cell"!==this.parent.selectionSettings.mode&&t?(z(e.target,"tr.e-chart-row")?(this.parent.enableVirtualization&&(this.parent.treeGrid.grid.selectionModule.isInteracted=!0),this.parent.treeGrid.isFromChartSide=!0,this.highlightSelectedRows(e,!0)):(this.parent.treeGrid.isFromChartSide=!1,this.highlightSelectedRows(e,!1)),"Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive&&(0<this.selectedRowIndexes.length?this.showPopup(e):this.hidePopUp())):this.isSelectionFromChart=!1)},jXt.prototype.maintainSelectedRecords=function(e){-1<this.parent.selectionModule.getSelectedRowIndexes().indexOf(e)&&this.addRemoveClass([e])},jXt.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off("selectRowByIndex",this.selectRowByIndex),this.parent.isAdaptive?(this.parent.off("chartMouseClick",this.mouseUpHandler),this.parent.off("treeGridClick",this.popUpClickHandler)):this.parent.off("chartMouseUp",this.mouseUpHandler))};cft=jXt;function jXt(e){this.isSelectionFromChart=!1,this.isFromChart=!1,this.multipleIndexes=[],this.selectedRowIndexes=[],this.enableSelectMultiTouch=!1,this.openPopup=!1,this.parent=e,this.bindEvents(),this.parent.treeGrid.selectedRowIndex=this.parent.selectedRowIndex,this.parent.treeGrid.allowSelection=this.parent.allowSelection,this.parent.treeGrid.grid.selectionSettings.enableToggle=this.parent.selectionSettings.enableToggle,this.parent.treeGrid.selectionSettings=qP(this.parent.selectionSettings),this.wireEvents()}WXt.prototype.getModuleName=function(){return"toolbar"},WXt.prototype.renderToolbar=function(){if(0<(this.parent.toolbar||[]).length){this.element=Q("div",{id:this.parent.controlId+"_Gantt_Toolbar",className:"e-gantt-toolbar"}),this.parent.treeGrid.grid.headerModule?this.parent.element.insertBefore(this.element,this.parent.treeGridPane.offsetParent):this.parent.element.appendChild(this.element);for(var e=0,t=["Add","Edit","Update","Delete","Cancel","ExpandAll","CollapseAll","PrevTimeSpan","NextTimeSpan","ZoomIn","ZoomOut","ZoomToFit","ExcelExport","CsvExport","PdfExport","Indent","Outdent","CriticalPath","Undo","Redo"];e<t.length;e++){var i=t[e],n=void 0,o=void 0,o="CriticalPath"===i?(n="critical-path","criticalPath"):(n=i.toLowerCase(),i[0].toLowerCase()+i.slice(1));this.predefinedItems[i]={id:this.parent.element.id+"_"+n,prefixIcon:"e-"+n,text:this.parent.isAdaptive?"":this.parent.localeObj.getConstant(o),tooltipText:this.parent.localeObj.getConstant(o)+("add"===o||"edit"===o||"delete"===o?this.parent.localeObj.getConstant("task"):"expandAll"===o||"collapseAll"===o?this.parent.localeObj.getConstant("tasks"):""),align:this.parent.isAdaptive?"Right":"Left"},this.parent.enableRtl&&("PrevTimeSpan"===i&&(this.predefinedItems[i].prefixIcon="e-nexttimespan"),"NextTimeSpan"===i)&&(this.predefinedItems[i].prefixIcon="e-prevtimespan")}var r=this.parent.localeObj.getConstant("search");this.parent.isAdaptive?this.predefinedItems.Search={id:this.id+"_searchbutton",prefixIcon:"e-search-icon",tooltipText:r,align:"Right"}:this.predefinedItems.Search={id:this.id+"_search",template:'<div class="e-input-group e-search" role="search"><input id="'+this.id+'_searchbar" class="e-input" name="input" type="search"placeholder= "'+r+'"/><span id="'+this.id+'_searchbutton" class="e-input-group-icon e-search-icon e-icons"tabindex="-1" title="'+r+'" aria-label= "search" role="button"></span></div>',tooltipText:r,align:"Right",cssClass:"e-search-wrapper"},this.createToolbar()}},WXt.prototype.addReactToolbarPortals=function(e){this.parent.isReact&&e&&(this.parent.portals=this.parent.portals.concat(e),this.parent.renderTemplates())},WXt.prototype.createToolbar=function(){var e=this.getItems(),e=(this.toolbar=new U3({items:e,enableRtl:this.parent.enableRtl,clicked:this.toolbarClickHandler.bind(this),height:this.parent.isAdaptive?48:"auto"}),this.toolbar.isStringTemplate=!0,this.toolbar.isReact=this.parent.isReact,this.toolbar.on("render-react-toolbar-template",this.addReactToolbarPortals,this),this.toolbar.appendTo(this.element),this.parent.treeGrid.grid&&this.parent.isReact&&(this.parent.treeGrid.grid.portals=this.parent.portals),this.element.querySelector("#"+this.parent.element.id+"_cancel")),t=this.element.querySelector("#"+this.parent.element.id+"_update"),i=(e&&U([e],Eqt),t&&U([t],Eqt),!1);this.parent.toolbar.map(function(e){"Search"===e&&(i=!0)}),this.parent.isAdaptive&&i?(this.element.insertBefore(this.getSearchBarElement(),this.element.childNodes[0]),this.searchElement=this.element.querySelector("#"+this.parent.element.id+"_searchbar"),new fV({placeholder:this.parent.localeObj.getConstant("search"),enableRtl:this.parent.enableRtl,floatLabelType:"Never",showClearButton:!0}).appendTo(this.searchElement)):this.searchElement=this.element.querySelector("#"+this.parent.element.id+"_searchbar"),this.parent.filterModule&&(this.wireEvent(),this.parent.searchSettings)&&this.updateSearchTextBox(),this.enableItems([this.parent.controlId+"_redo",this.parent.controlId+"_undo"],!1),this.parent.readOnly&&this.enableItems([this.parent.element.id+"_add",this.parent.element.id+"_update",this.parent.element.id+"_delete",this.parent.element.id+"_cancel",this.parent.element.id+"_indent",this.parent.element.id+"_outdent"],!1)},WXt.prototype.getSearchBarElement=function(){var e=this,t=Q("div",{className:"e-adaptive-searchbar",styles:"display: none"}),i=Q("input",{attrs:{type:"text"},id:this.parent.element.id+"_searchbar"}),n=Q("span",{className:"e-backarrowspan e-icons"});return n.onclick=function(){t.style.display="none",e.element.childNodes[1].style.display="block"},t.appendChild(n),t.appendChild(i),t},WXt.prototype.wireEvent=function(){this.searchElement&&(E.add(this.searchElement,"keyup",this.keyUpHandler,this),E.add(this.searchElement,"focus",this.focusHandler,this),E.add(this.searchElement,"blur",this.blurHandler,this))},WXt.prototype.propertyChanged=function(e){R("module",e)===this.getModuleName()&&this.parent.toolbar&&(this.element&&this.element.parentNode&&ue(this.element),this.renderToolbar(),this.refreshToolbarItems())},WXt.prototype.unWireEvent=function(){this.searchElement&&(E.remove(this.searchElement,"keyup",this.keyUpHandler),E.remove(this.searchElement,"focus",this.focusHandler),E.remove(this.searchElement,"blur",this.blurHandler),this.searchElement=null),this.parent.isDestroyed||this.parent.off("ui-toolbarupdate",this.propertyChanged)},WXt.prototype.keyUpHandler=function(e){13===e.keyCode&&this.parent.searchSettings.key!==this.searchElement.value&&(this.parent.searchSettings.key=this.searchElement.value,this.parent.dataBind())},WXt.prototype.focusHandler=function(e){e.target.parentElement.classList.add("e-input-focus")},WXt.prototype.blurHandler=function(e){e.target.parentElement.classList.remove("e-input-focus")},WXt.prototype.updateSearchTextBox=function(){this.searchElement&&this.searchElement.value!==this.parent.searchSettings.key&&(this.searchElement.value=this.parent.searchSettings.key)},WXt.prototype.getItems=function(){var e,t=[],i=this.parent.toolbar,n=-1;i.forEach(function(e,t){("string"==typeof e&&"Search"===e||"object"==typeof e&&"Search"===e.text)&&(n=t)}),-1<n&&(e=i.splice(n,1),i.push(e[0]));for(var o=0,r=i;o<r.length;o++){var s=r[o];t.push("string"==typeof s?this.getItemObject(s):this.getItem(s))}return t},WXt.prototype.getItem=function(e){var t=this.predefinedItems[e.text],t=t?Pe(t,t,e):e;return t.align||(t.align=this.parent.isAdaptive?"Right":"Left"),t},WXt.prototype.getItemObject=function(e){return this.predefinedItems[e]||{text:e,id:this.id+"_"+e}},WXt.prototype.toolbarClickHandler=function(e){var i=this,n=this.parent,o=this.id;Pe(e,{cancel:this.parent.isToolBarClick=!1}),e.item.properties.id!==this.parent.element.id+"_pdfexport"&&e.item.properties.id!==this.parent.element.id+"_critical-path"||(je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow()),n.trigger(bXt,e,function(e){if(!e.cancel)switch(!0!==i.parent.isAdaptive||e.item.id!==o+"_edit"&&e.item.id!==o+"_add"&&e.item.id!==o+"_delete"&&e.item.id!==o+"_searchbutton"&&e.item.id!==o+"_expandall"&&e.item.id!==o+"_collapseall"||i.parent.selectionModule&&"Multiple"===i.parent.selectionSettings.type&&(i.parent.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none"),!je(e.item)&&e.item.id){case o+"_edit":n.editModule&&n.editSettings.allowEditing&&n.editModule.dialogModule.openToolbarEditDialog();break;case o+"_indent":n.editModule&&n.selectionModule.getSelectedRecords().length&&n.indent();break;case o+"_critical-path":n.enableCriticalPath?n.enableCriticalPath=!1:n.enableCriticalPath=!0;break;case o+"_outdent":n.editModule&&n.selectionModule.getSelectedRecords().length&&n.outdent();break;case o+"_update":n.editModule.cellEditModule.isCellEdit=!1,n.treeGrid.grid.saveCell();break;case o+"_cancel":n.cancelEdit();break;case o+"_add":n.editModule&&n.editSettings.allowAdding&&n.editModule.dialogModule.openAddDialog();break;case o+"_delete":i.parent.selectionModule&&i.parent.editModule&&("Cell"!==i.parent.selectionSettings.mode&&i.parent.selectionModule.selectedRowIndexes.length||"Cell"===i.parent.selectionSettings.mode&&i.parent.selectionModule.getSelectedRowCellIndexes().length)&&i.parent.editModule.startDeleteAction();break;case o+"_search":R("originalEvent.target.id",e)===i.parent.element.id+"_searchbutton"&&i.parent.filterModule&&(t=i.element.querySelector("#"+i.parent.element.id+"_searchbar").value,i.parent.searchSettings.key!==t)&&(i.parent.searchSettings.key=t,i.parent.dataBind());break;case o+"_searchbutton":var t=i.element.querySelector(".e-adaptive-searchbar");t.parentElement.childNodes[1].style.display="none",t.style.display="block";break;case o+"_expandall":i.parent.ganttChartModule.expandCollapseAll("expand"),i.parent.isCollapseAll=!1;break;case o+"_collapseall":i.parent.ganttChartModule.expandCollapseAll("collapse"),i.parent.isCollapseAll=!0;break;case o+"_prevtimespan":i.parent.previousTimeSpan();break;case o+"_nexttimespan":i.parent.nextTimeSpan();break;case o+"_zoomin":i.zoomIn();break;case o+"_zoomout":i.zoomOut();break;case o+"_zoomtofit":i.zoomToFit();break;case o+"_undo":i.parent.undo();break;case o+"_redo":i.parent.redo()}})},WXt.prototype.zoomIn=function(){this.parent.timelineModule.processZooming(!0),this.parent.timelineModule.isZooming=!1},WXt.prototype.zoomToFit=function(){this.parent.timelineModule.isZoomIn&&(this.parent.timelineModule.isZoomIn=!1),this.parent.timelineModule.processZoomToFit(),this.parent.ganttChartModule.updateScrollLeft(0),this.parent.timelineModule.isZoomToFit=!1},WXt.prototype.zoomOut=function(){this.parent.timelineModule.processZooming(!1),this.parent.timelineModule.isZooming=!1},WXt.prototype.refreshToolbarItems=function(e){var t=this.parent,i=[],n=[],o=t.editSettings,r=this.id,s=t.selectedRowIndex;if(this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)for(var a=0;a<t.updatedRecords.length;a++)if(t.updatedRecords[a].index===s){s=a;break}var l=!1,h=(!t.selectionModule||1!==t.selectionModule.getSelectedRecords().length&&1!==t.selectionModule.getSelectedRowCellIndexes().length||(l=!0),t.selectionModule&&"Multiple"===t.selectionSettings.type&&1<t.selectionModule.selectedRowIndexes.length&&(l=!1),!1);if(t.selectionModule&&t.selectionSettings.persistSelection){var d=t.selectionModule.getSelectedRecords().length;if(t.selectionSettings.persistSelection&&1===d)for(a=0;a<d;a++)-1===(b=t.currentViewData.indexOf(t.selectionModule.getSelectedRecords()[a]))&&(h=!0);h&&(l=!1)}var p=this.toolbar?this.toolbar.items:[],c=[r+"_add",r+"_edit",r+"_delete",r+"_update",r+"_cancel",r+"_indent",r+"_outdent"],e="ResourceView"===this.parent.viewType&&0!==R("data.level",e)||"ProjectView"===this.parent.viewType;if(je(this.parent.editModule))n.push(r+"_delete"),n.push(r+"_add"),n.push(r+"_edit"),n.push(r+"_update"),n.push(r+"_cancel"),n.push(r+"_indent"),n.push(r+"_outdent");else{var u=!!t.editModule.taskbarEditModule&&t.editModule.taskbarEditModule.touchEdit,g=t.flatData&&t.flatData.length,m=((o.allowAdding&&!u?i:n).push(r+"_add"),(o.allowEditing&&e&&g&&l&&!u?i:n).push(r+"_edit"),o.allowEditing&&0!==s&&-1!==s&&g&&l&&"ResourceView"!==this.parent.viewType?je(t.updatedRecords[s])||0!==t.updatedRecords[s].level||!g||u?(e=t.updatedRecords[s-1],je(t.updatedRecords[s])||t.updatedRecords[s].level-e.level!=1||-1===s?-1!==s&&(i.push(r+"_indent"),i.push(r+"_outdent")):(n.push(r+"_indent"),i.push(r+"_outdent"))):(i.push(r+"_indent"),n.push(r+"_outdent")):(n.push(r+"_indent"),n.push(r+"_outdent")),!!t.selectionModule&&(0<t.selectionModule.getSelectedRecords().length||0<t.selectionModule.getSelectedRowCellIndexes().length));if(t.selectionModule&&t.selectionSettings.persistSelection){h&&(m=!1);var f=(d=t.selectionModule.getSelectedRecords()).length;if(t.selectionSettings.persistSelection&&1<f)for(a=0;a<f;a++){if(-1<(b=t.currentViewData.indexOf(d[a]))){m=!0;break}m=!1}}if((o.allowDeleting&&g&&m&&!u?i:n).push(r+"_delete"),"Auto"===t.editSettings.mode&&!je(t.editModule.cellEditModule)&&t.editModule.cellEditModule.isCellEdit){(i=[]).push(r+"_update",r+"_cancel");for(var n=[],y=0;y<p.length;y++)p[y].id!==r+"_update"&&p[y].id!==r+"_cancel"&&-1!==c.indexOf(p[y].id)&&n.push(p[y].id)}else{n.push(r+"_update",r+"_cancel");for(y=0;y<p.length;y++)-1===i.indexOf(p[y].id)&&-1===n.indexOf(p[y].id)&&i.push(p[y].id)}}for(var v=0;v<i.length;v++){for(var b=void 0,y=0;y<p.length;y++)if(p[y].id===i[v]){b=y;break}0<p.length&&!je(p[b])&&p[b].properties.visible&&this.toolbar.hideItem(b,!1)}for(var w=0;w<n.length;w++){for(b=void 0,y=0;y<p.length;y++)if(p[y].id===n[w]){b=y;break}0<p.length&&this.toolbar.hideItem(b,!0)}},WXt.prototype.enableItems=function(e,t){for(var i=0,n=e;i<n.length;i++){var o=n[i],o=this.element.querySelector("#"+o);o&&this.toolbar.enableItems(o.parentElement,t)}},WXt.prototype.destroy=function(){this.parent.filterModule&&this.unWireEvent(),this.parent.isDestroyed||(this.toolbar&&this.toolbar.off("render-react-toolbar-template",this.addReactToolbarPortals),this.toolbar.destroy(),ue(this.element))};SOt=WXt;function WXt(e){this.predefinedItems={},this.items=["Add","Edit","Update","Delete","Cancel","ExpandAll","CollapseAll","Search","PrevTimeSpan","NextTimeSpan","ZoomIn","ZoomOut","ZoomToFit","ExcelExport","CsvExport","PdfExport","Indent","Outdent","CriticalPath"],this.parent=e,this.id=this.parent.element.id,this.parent.on("ui-toolbarupdate",this.propertyChanged,this)}UXt.prototype.createNonworkingContainer=function(){this.parent.ganttChartModule.chartBodyContent.contains(this.nonworkingContainer)||(this.nonworkingContainer=Q("div",{className:"e-nonworking-day-container"}),this.parent.enableTimelineVirtualization&&(this.nonworkingContainer.style.height="100%"),this.parent.ganttChartModule.chartBodyContent.insertBefore(this.nonworkingContainer,this.parent.ganttChartModule.chartBodyContent.firstChild))},UXt.prototype.renderHolidays=function(){var e,t=this;this.parent.holidays&&0<this.parent.holidays.length?(this.createNonworkingContainer(),this.nonworkingContainer.contains(this.holidayContainer)||(this.holidayContainer=Q("div",{className:"e-holiday-container"}),this.parent.enableTimelineVirtualization&&(this.holidayContainer.style.height="100%",this.holidayContainer.style.zIndex="-1"),this.nonworkingContainer.appendChild(this.holidayContainer)),e=this.getHolidaysElement().childNodes,this.holidayContainer.innerHTML="",e.forEach(function(e){t.holidayContainer.appendChild(e.cloneNode(!0))})):this.holidayContainer&&this.holidayContainer.parentNode&&(ue(this.holidayContainer),this.nonworkingContainer)&&0===this.nonworkingContainer.childNodes.length&&ue(this.nonworkingContainer)},UXt.prototype.getHolidaysElement=function(){for(var e,t,i=Q("div"),n=this.parent.contentHeight,o=0,r=(je(this.parent.toolbarModule)||je(this.parent.toolbarModule.element)||(o=this.parent.toolbarModule.element.offsetHeight),this.parent.ganttHeight-o-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight),s=0;s<this.parent.holidays.length;s++){this.parent.holidays[s].from&&this.parent.holidays[s].to?(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[s].from),(t=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[s].to)).setDate(t.getDate()+1),e.setHours(0,0,0,0),t.setHours(0,0,0,0)):this.parent.holidays[s].from?(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[s].from)).setHours(0,0,0,0):this.parent.holidays[s].to&&(e=this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[s].to)).setHours(0,0,0,0);var a=this.parent.holidays[s].from&&this.parent.holidays[s].to?this.parent.dataOperation.getTaskWidth(e,t):this.parent.perDayWidth,l=this.parent.dataOperation.getTaskLeft(e,!1,!0),l=Q("div",{className:"e-holiday",styles:(this.parent.enableRtl?"right:"+l+"px;":"left:"+l+"px;")+" width:"+a+"px; height:100%;"}),a=Q("span",{className:"e-span",styles:"top:"+(r<n?r/2:n/2)+"px;left:"+a/2+"px;"}),h=this.parent.disableHtmlEncode?"textContent":"innerHTML";a[h]=this.parent.holidays[s].label||"",this.parent.enableHtmlSanitizer&&"string"==typeof a[h]&&(a[h]=go.sanitize(a[h])),l.appendChild(a),this.parent.holidays[s].cssClass&&l.classList.add(this.parent.holidays[s].cssClass),i.appendChild(l)}return i},UXt.prototype.renderWeekends=function(){var e,t=this;this.parent.highlightWeekends?(this.createNonworkingContainer(),this.nonworkingContainer.contains(this.weekendContainer)||(this.weekendContainer=Q("div",{className:"e-weekend-container"}),this.parent.enableTimelineVirtualization&&(this.weekendContainer.style.height="100%",this.weekendContainer.style.zIndex="-1"),this.nonworkingContainer.appendChild(this.weekendContainer)),e=this.getWeekendElements().childNodes,this.weekendContainer.innerHTML="",e.forEach(function(e){t.weekendContainer.appendChild(e.cloneNode(!0))})):this.weekendContainer&&(ue(this.weekendContainer),this.nonworkingContainer)&&0===this.nonworkingContainer.childNodes.length&&ue(this.nonworkingContainer)},UXt.prototype.getWeekendElements=function(){var e,t,i,n,o,r,s,a=Q("div"),l=this.parent.enableTimelineVirtualization&&0!==this.parent.ganttChartModule.scrollObject.element.scrollLeft?this.parent.ganttChartModule.scrollObject.getTimelineLeft():null,h=this.parent.enableTimelineVirtualization&&!je(l)?new Date(this.parent.timelineModule.dateByLeftValue(l).getTime()):new Date(this.parent.timelineModule.timelineStartDate.getTime()),d=this.parent.enableTimelineVirtualization?new Date(this.parent.timelineModule.weekendEndDate.getTime()):new Date(this.parent.timelineModule.timelineEndDate.getTime()),p=this.parent.nonWorkingDayIndex,c=!0,u=!0,g=(this.weekendWidthUpdated=!1,this.parent.dataOperation.hasDSTTransition(h.getFullYear()));do{}while(-1!==p.indexOf(h.getDay())&&(e=this.parent.dataOperation.getTaskLeft(h,!1,!0),t=this.parent.perDayWidth,c&&(i=new Date(h.getTime()),(n=new Date(i.getTime())).setDate(n.getDate()+1),n.setHours(0,0,0,0),t=this.parent.dataOperation.getTaskWidth(i,n),c=!1),g||(i=new Date(h),n=new Date(h),i.setDate(i.getDate()+1),o=i.getTimezoneOffset(),r=n.getTimezoneOffset(),u?u=!1:(s="Hour"===this.parent.timelineModule.bottomTier&&1===this.parent.timelineModule.customTimelineSettings.bottomTier.count||"Minutes"===this.parent.timelineModule.bottomTier&&60===this.parent.timelineModule.customTimelineSettings.bottomTier.count||"Hour"===this.parent.timelineModule.topTier&&1===this.parent.timelineModule.customTimelineSettings.topTier.count&&"Minutes"===this.parent.timelineModule.bottomTier&&(30===this.parent.timelineModule.customTimelineSettings.bottomTier.count||15===this.parent.timelineModule.customTimelineSettings.bottomTier.count),this.weekendWidthUpdated||s&&o<r&&(t-=this.parent.perDayWidth/24,this.weekendWidthUpdated=!0))),s=Q("div",{className:"e-weekend",styles:(this.parent.enableRtl?"right:"+e+"px;":"left:"+e+"px;")+" width:"+t+"px;height:100%;"}),a.appendChild(s)),h.setDate(h.getDate()+1),h.setHours(0,0,0,0),h<d);return a},UXt.prototype.updateHolidayLabelHeight=function(){for(var e=this.parent.getContentHeight(),t=document.getElementById(this.parent.element.id),i=0,t=(je(this.parent.toolbarModule)||je(this.parent.toolbarModule.element)||(i=this.parent.toolbarModule.element.offsetHeight),"auto"===this.parent.height?t.offsetHeight-i-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight:this.parent.ganttHeight-i-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight),n=t<e?t/2:e/2,o=this.holidayContainer.querySelectorAll(".e-span"),r=0;r<o.length;r++)o[r].style.top=T(n)},UXt.prototype.updateContainerHeight=function(){var e=this.parent.getContentHeight();this.holidayContainer&&(this.holidayContainer.style.height=T(e),this.updateHolidayLabelHeight()),this.weekendContainer&&(this.weekendContainer.style.height=T(e))},UXt.prototype.removeContainers=function(){this.holidayContainer&&ue(this.holidayContainer),this.weekendContainer&&ue(this.weekendContainer),this.nonworkingContainer&&ue(this.nonworkingContainer)};var QXt=UXt;function UXt(e){this.weekendWidthUpdated=!1,this.parent=e,this.nonworkingContainer=null,this.holidayContainer=null,this.weekendContainer=null}GXt.prototype.renderEventMarkers=function(){this.parent.eventMarkers&&0<this.parent.eventMarkers.length?(this.parent.ganttChartModule.chartBodyContent.contains(this.eventMarkersContainer)||(this.eventMarkersContainer=Q("div",{className:"e-event-markers-container"}),this.eventMarkersContainer.setAttribute("role","term"),this.parent.ganttChartModule.chartBodyContent.appendChild(this.eventMarkersContainer)),this.eventMarkersContainer.innerHTML="",this.getEventMarkersElements(this.eventMarkersContainer)):this.removeContainer()},GXt.prototype.removeContainer=function(){this.eventMarkersContainer&&(ue(this.eventMarkersContainer),this.eventMarkersContainer=null)},GXt.prototype.getEventMarkersElements=function(e){for(var t,i,n,o=[],r=0;r<this.parent.eventMarkers.length;r++)je(this.parent.eventMarkers[r].day)||(this.parent.isFromEventMarker=!0,n=this.parent.dataOperation.getTaskLeft(this.parent.dateValidationModule.getDateFromFormat(this.parent.eventMarkers[r].day,!0),!1,!0),this.parent.isFromEventMarker=!1,o.push({id:r,left:n,label:this.parent.eventMarkers[r].label,date:this.parent.dateValidationModule.getDateFromFormat(this.parent.eventMarkers[r].day,!0)}),n=Q("div",{className:"e-event-markers",styles:(this.parent.enableRtl?"right:"+n+"px;":"left:"+n+"px;")+"  height:100%;",id:"stripline"+r}),this.parent.eventMarkers[r].label&&((t=Q("div",{className:"e-span-label"}))[i=this.parent.disableHtmlEncode?"textContent":"innerHTML"]=this.parent.eventMarkers[r].label,this.parent.enableHtmlSanitizer&&"string"==typeof t[i]&&(t[i]=go.sanitize(t[i])),this.parent.enableRtl?t.style.right="5px":t.style.left="5px",n.appendChild(t),i=Q("div",{className:"e-gantt-right-arrow"}),n.appendChild(i)),this.parent.eventMarkers[r].cssClass&&n.classList.add(this.parent.eventMarkers[r].cssClass),n.setAttribute("tabindex","-1"),n.setAttribute("aria-label",this.parent.localeObj.getConstant("eventMarkers")+" "+("string"==typeof this.parent.eventMarkers[r].day?this.parent.eventMarkers[r].day:this.parent.getFormatedDate(this.parent.eventMarkers[r].day))+" "+this.parent.eventMarkers[r].label),e.appendChild(n));this.parent.eventMarkerColloction=o},GXt.prototype.updateContainerHeight=function(){this.eventMarkersContainer&&(this.eventMarkersContainer.style.height=T(this.parent.getContentHeight()))};var qXt=GXt;function GXt(e){this.parent=e,this.eventMarkersContainer=null}YXt.prototype.wireEvents=function(){this.parent.on("refreshDayMarkers",this.refreshMarkers,this),this.parent.on("updateHeight",this.updateHeight,this),this.parent.on("ui-update",this.propertyChanged,this)},YXt.prototype.propertyChanged=function(e){for(var t=Object.keys(R("properties",e)),i=0;i<t.length;i++)switch(t[i]){case"eventMarkers":this.eventMarkerRender.renderEventMarkers(),this.updateHeight();break;case"highlightWeekends":this.nonworkingDayRender.renderWeekends(),this.updateHeight();break;case"holidays":this.nonworkingDayRender.renderHolidays(),this.updateHeight()}},YXt.prototype.refreshMarkers=function(){this.nonworkingDayRender.renderWeekends(),this.nonworkingDayRender.renderHolidays(),"Vertical"!==this.parent.gridLines&&"Both"!==this.parent.gridLines||this.parent.renderChartVerticalLines(),this.eventMarkerRender.renderEventMarkers()},YXt.prototype.updateHeight=function(){this.nonworkingDayRender.updateContainerHeight(),this.eventMarkerRender.updateContainerHeight()},YXt.prototype.getModuleName=function(){return"dayMarkers"},YXt.prototype.destroy=function(){this.parent.isDestroyed||(this.nonworkingDayRender.removeContainers(),this.eventMarkerRender.removeContainer(),this.parent.off("refreshDayMarkers",this.refreshMarkers),this.parent.off("updateHeight",this.updateHeight),this.parent.off("ui-update",this.propertyChanged))};IOt=YXt;function YXt(e){this.parent=e,this.nonworkingDayRender=new QXt(this.parent),this.eventMarkerRender=new qXt(this.parent),this.wireEvents()}XXt.prototype.getCriticalTasks=function(){return this.criticalTasks},XXt.prototype.showCriticalPath=function(e){var n=this.parent.ids,o=this.parent.flatData;if(e&&0<this.parent.flatData.length){this.parent.enableCriticalPath=!0;var t,i=this.parent.treeGrid.parentData,r=i[0].ganttProperties.endDate,s=0,a=[],l=[],h=[],d=0,p=[],c=[],u=[],g=[],m=[];this.criticalTasks=[],i[0].ganttProperties.autoEndDate>i[0].ganttProperties.endDate&&!i[0].ganttProperties.isAutoSchedule&&(r=i[0].ganttProperties.autoEndDate);for(var f=1;f<i.length;f++)i[f].ganttProperties.endDate>=r&&(r=i[f].ganttProperties.endDate),i[f].ganttProperties.isAutoSchedule||i[f].ganttProperties.autoEndDate>=r&&(r=i[f].ganttProperties.autoEndDate);this.maxEndDate=r;for(var y=0;y<o.length;y++)o[y].isCritical=!1,o[y].ganttProperties.isCritical=!1,s=this.parent.dataOperation.getDuration(o[y].ganttProperties.endDate,r,o[y].ganttProperties.durationUnit,o[y].ganttProperties.isAutoSchedule,o[y].ganttProperties.isMilestone),o[y].slack=s+" "+o[y].ganttProperties.durationUnit,o[y].ganttProperties.slack=s+" "+o[y].ganttProperties.durationUnit,o[y].ganttProperties.endDate>=r&&a.push(o[y].ganttProperties.taskId),o[y].ganttProperties.predecessor&&0!==o[y].ganttProperties.predecessor.length&&(l.push(o[y]),h.push(o[y].ganttProperties.taskId));if("ResourceView"===this.parent.viewType)for(f=0;f<this.parent.taskIds.length;f++)this.resourceCollectionIds[f]=this.parent.taskIds[f].slice(1);for(var v=this,b=0;b<a.length;b++)!function(t){if(-1===h.indexOf(a[t])){if("ProjectView"===v.parent.viewType)d=n.indexOf(a[t].toString());else for(var e=v.parent.currentViewData.filter(function(e){return parseInt(e.ganttProperties.taskId,10)===a[t]}),i=0;i<e.length;i++)!e[i].hasChildRecords&&e[i].ganttProperties.endDate>=v.maxEndDate&&(d=e[i].index);o[d].ganttProperties.progress<100&&(o[d].isCritical=!0,o[d].ganttProperties.isCritical=!0),o[d].slack="0 "+o[d].ganttProperties.durationUnit,p.push(a[t])}else c.push(a[t])}(b);for(var w=l.length,C=[],S=0;S<w;S++){for(var A=-1,x=-1,I=-1,T=-1,E=S,D=l[S].ganttProperties.predecessor,O=l[S].ganttProperties.predecessor.length,M=l[S].ganttProperties.taskId,k=0;k<O;k++)(isNaN(Number(D[k].from))||"string"==typeof M?(isNaN(Number(D[k].from)),D[k].from):parseInt(D[k].from,10))===M&&(I=-1===A?(A=D[k].offset?D[k].to+":"+D[k].offset+D[k].offsetUnit:D[k].to,D[k].type):(A=D[k].offset?A+","+D[k].to+":"+D[k].offset+D[k].offsetUnit:A+","+D[k].to,I+","+D[k].type)),(isNaN(Number(D[k].to))||"string"==typeof M?(isNaN(Number(D[k].to)),D[k].to):parseInt(D[k].to,10))===M&&(T=-1===x?(x=D[k].offset?D[k].from+":"+D[k].offset+D[k].offsetUnit:D[k].from,D[k].type):(x=D[k].offset?x+","+D[k].from+":"+D[k].offset+D[k].offsetUnit:x+","+D[k].from,T+","+D[k].type));-1===x&&(T=x=null),-1===A&&(I=A=null),u.push({from:x,fromPredecessor:T,taskid:M,to:A,toPredecessor:I,currentIndex:E,slack:null,enddate:null}),g.push(M)}for(var P,N=u.length,B=0,F=void 0,L=0;L<N;L++)u[L].to||(F=u[L].taskid,B=("ProjectView"===this.parent.viewType?n:this.resourceCollectionIds).indexOf(F.toString()),P=o[B].ganttProperties,s=this.parent.dataOperation.getDuration(P.endDate,r,"minute",P.isAutoSchedule,P.isMilestone),u[L].slack=s,u[L].fs=-1,u[L].enddate=P.endDate,C.push({fromdata:u[L].from,todateID:u[L].taskid,fromDataPredecessor:u[L].fromPredecessor}));for(b=0;b<C.length;b++)m.push(C[b]),this.slackCalculation(m,u,g,r,o,n);t=this.finalCriticalPath(u,p,o,n,r),this.validatedids=[],this.criticalPathCollection=t,this.detailPredecessorCollection=u,this.predecessorCollectionTaskIds=g}if(!1===e&&0<this.parent.flatData.length){var R;this.parent.enableCriticalPath=!1;for(L=0;L<this.criticalPathCollection.length;L++)R=n.indexOf(this.criticalPathCollection[L].toString()),o[R].isCritical=!1;this.criticalPathCollection=[],this.detailPredecessorCollection=[],this.predecessorCollectionTaskIds=[]}},XXt.prototype.slackCalculation=function(e,t,i,n,o,r){for(var s,a,l,h,d,p=e[0].fromdata.split(","),c=e[0].fromDataPredecessor.split(","),u=(i=(i=i.toString()).split(","),[]),g=0;g<p.length;g++){var u=p[g].split(":"),m=i.indexOf(u[0].toString()),f=i.indexOf(e[0].todateID.toString()),y=("ProjectView"===this.parent.viewType?(s=r.indexOf(u[0].toString()),r):(s=this.resourceCollectionIds.indexOf(u[0].toString()),this.resourceCollectionIds)).indexOf(e[0].todateID.toString()),v=void 0,y=(-1!==s&&(v=o[s].ganttProperties),o[y].ganttProperties);1<u.length&&(h=-1!==u[1].indexOf("hour")?60*parseFloat(u[1]):-1!==u[1].indexOf("day")?parseFloat(u[1])*(this.parent.secondsPerDay/3600)*60:parseFloat(u[1])),v&&-1!==m&&("FS"===c[g]&&(a=v.endDate>y.startDate?-this.parent.dataOperation.getDuration(y.startDate,v.endDate,"minute",v.isAutoSchedule,v.isMilestone):this.parent.dataOperation.getDuration(v.endDate,y.startDate,"minute",v.isAutoSchedule,v.isMilestone),je(t[m].slack)?u.length<=1&&(t[f].slack+a<=0?t[m].slack=0:t[m].slack=t[f].slack+a):t[m].slack>a&&0!==t[m].slack&&u.length<=1&&(t[f].slack+a<=0?t[m].slack=0:t[m].slack=t[f].slack+a),1<u.length&&(t[m].slack=t[f].slack+a,t[m].slack=t[m].slack-h,t[m].slack<=0)&&(t[m].slack=0),t[m].fs=1,t[m].fsslack=t[m].slack,t[m].enddate=v.startDate,v.endDate>=n)&&(t[m].slack=0),"SS"===c[g]&&(v.isAutoSchedule?(a=v.startDate>y.startDate?-this.parent.dataOperation.getDuration(y.endDate,v.startDate,"minute",v.isAutoSchedule,v.isMilestone):this.parent.dataOperation.getDuration(v.startDate,y.startDate,"minute",v.isAutoSchedule,v.isMilestone),je(t[m].slack)?u.length<=1&&(t[f].slack+a<=0?t[m].slack=0:t[m].slack=t[f].slack+a):t[m].slack>a&&0!==t[m].slack&&u.length<=1&&(t[f].slack+a<=0?t[m].slack=0:t[m].slack=t[f].slack+a),1<u.length&&(t[m].slack=t[f].slack+a,t[m].slack=t[m].slack-h,t[m].slack<=0)&&(t[m].slack=0),t[m].fs=1,t[m].fsslack=t[m].slack,t[m].enddate=v.startDate):!v.isAutoSchedule&&(a=this.getSlackDuration(v.endDate,n,"minute",o[s]),je(t[m].slack)||t[m].slack>a&&0!==t[m].slack)&&(t[m].slack=a),v.endDate>=n)&&v.endDate<=n&&(t[m].slack=0),"FF"===c[g]&&(1!==t[f].fs&&1!==t[f].ff&&-1!==t[f].fs||(1!==t[f].fs&&1!==t[f].ff||(l=y.endDate,d=t[f].slack),-1===t[f].fs&&(l=t[f].enddate,d=t[f].slack),a=l>v.endDate?-this.getSlackDuration(v.endDate,l,"minute",o[s]):this.getSlackDuration(l,v.endDate,"minute",o[s]),je(t[m].slack)?u.length<=1&&(t[m].slack=d-a<0?0:d-a):t[m].slack>a&&0!==t[m].slack&&u.length<=1&&(t[m].slack=d-a<0?0:d-a),1<u.length&&(t[m].slack=t[f].slack-a,t[m].slack=t[m].slack-h,t[m].slack<=0)&&(t[m].slack=0),t[m].ff=1,t[m].enddate=l,t[m].fsslack=d),v.endDate>=n)&&v.endDate<=n&&(t[m].slack=0),"SF"===c[g]&&(v.isAutoSchedule?(je(t[m].slack)?u.length<=1?je(t[f].to)?(a=this.getSlackDuration(v.endDate,n,"minute",o[s]),t[m].slack=a):je(t[f].to)||(a=y.endDate>v.startDate?-this.parent.dataOperation.getDuration(v.startDate,y.endDate,"minute",v.isAutoSchedule,v.isMilestone):this.getSlackDuration(y.endDate,v.startDate,"minute",o[s]),t[f].slack+a<=0?t[m].slack=0:t[m].slack=t[f].slack+a):1<u.length&&(a=y.endDate>=v.endDate?v.startDate>y.endDate?-this.getSlackDuration(y.endDate,v.startDate,"minute",o[s]):this.parent.dataOperation.getDuration(v.startDate,y.endDate,"minute",v.isAutoSchedule,v.isMilestone):this.getSlackDuration(v.endDate,n,"minute",o[s]),t[m].slack=t[f].slack+a,t[m].slack=t[m].slack-h,t[m].slack<=0)&&(t[m].slack=0):u.length<=1?(je(t[f].to)?a=this.getSlackDuration(v.endDate,n,"minute",o[s]):je(t[f].to)||(a=y.endDate>v.startDate?-this.parent.dataOperation.getDuration(v.startDate,y.endDate,"minute",v.isAutoSchedule,v.isMilestone):this.getSlackDuration(y.endDate,v.startDate,"minute",o[s])),t[m].slack>a&&0!==t[m].slack&&(je(t[f].to)?t[m].slack=a:je(t[f].to)||(t[f].slack+a<=0?t[m].slack=0:t[m].slack=t[f].slack+a))):1<u.length&&(a=y.endDate>v.endDate?v.startDate>y.endDate?-this.getSlackDuration(y.endDate,v.startDate,"minute",o[s]):this.parent.dataOperation.getDuration(v.startDate,y.endDate,"minute",v.isAutoSchedule,v.isMilestone):this.getSlackDuration(v.endDate,n,"minute",o[s]),t[m].slack>a)&&0!==t[m].slack&&(t[m].slack=t[f].slack+a,t[m].slack=t[m].slack-h,t[m].slack<=0)&&(t[m].slack=0),t[m].fs=1,t[m].fsslack=t[m].slack,t[m].enddate=v.startDate):!v.isAutoSchedule&&(a=this.getSlackDuration(v.endDate,n,"minute",o[s]),je(t[m].slack)||t[m].slack>a&&0!==t[m].slack)&&(t[m].slack=a),v.endDate>=n)&&v.endDate<=n&&(t[m].slack=0),t[m].from)&&((y=[]).push({fromdata:t[m].from,todateID:t[m].taskid,fromDataPredecessor:t[m].fromPredecessor}),this.slackCalculation(y,t,i,n,o,r))}},XXt.prototype.getSlackDuration=function(e,t,i,n){e=this.parent.dateValidationModule.checkStartDate(new Date(e)),t=this.parent.dateValidationModule.checkEndDate(new Date(t));return this.parent.dataOperation.getTimeDifference(e,t,!0)<=0?0:this.parent.dataOperation.getDuration(e,t,i,n.ganttProperties.isAutoSchedule,!0)},XXt.prototype.updateCriticalTasks=function(e,t){for(var i=0;i<e.ganttProperties.predecessor.length;i++){var n=void 0,o=(n="ProjectView"===this.parent.viewType?this.parent.getRecordByID(e.ganttProperties.predecessor[i].from):(o=this.resourceCollectionIds.indexOf(e.ganttProperties.predecessor[i].from.toString()),this.parent.flatData[o]),void 0);e.ganttProperties.endDate&&e.ganttProperties.endDate.getTime()>=this.maxEndDate.getTime()&&(e.ganttProperties.slack=e.slack="0 "+e.ganttProperties.durationUnit,e.ganttProperties.progress<100)&&(e.isCritical=!0,e.ganttProperties.isCritical=!0,-1===t.indexOf(e.ganttProperties.taskId))&&t.push(e.ganttProperties.taskId),n&&("FS"===e.ganttProperties.predecessor[i].type?o=this.parent.dataOperation.getDuration(n.ganttProperties.endDate,e.ganttProperties.startDate,n.ganttProperties.durationUnit,n.ganttProperties.isAutoSchedule,!0):"SS"===e.ganttProperties.predecessor[i].type?o=this.parent.dataOperation.getDuration(n.ganttProperties.startDate,e.ganttProperties.startDate,n.ganttProperties.durationUnit,n.ganttProperties.isAutoSchedule,!0):"FF"===e.ganttProperties.predecessor[i].type?o=this.parent.dataOperation.getDuration(n.ganttProperties.endDate,e.ganttProperties.endDate,n.ganttProperties.durationUnit,n.ganttProperties.isAutoSchedule,!0):"SF"===e.ganttProperties.predecessor[i].type&&(o=this.parent.dataOperation.getDuration(e.ganttProperties.endDate,n.ganttProperties.startDate,n.ganttProperties.durationUnit,n.ganttProperties.isAutoSchedule,!0)),0<=o)&&-1===this.validatedids.indexOf(parseInt(n.ganttProperties.taskId,10))&&n.ganttProperties.taskId!==e.ganttProperties.taskId&&(n.ganttProperties.slack=e.ganttProperties.slack,n.slack=e.slack,n.isCritical=e.ganttProperties.isCritical,n.ganttProperties.isCritical=e.ganttProperties.isCritical,-1===t.indexOf(n.ganttProperties.taskId)&&n.ganttProperties.isCritical&&n.ganttProperties.progress<100&&(t.push(n.ganttProperties.taskId),this.validatedids.push(parseInt(n.ganttProperties.taskId,10)),-1===this.criticalTasks.indexOf(n))&&this.criticalTasks.push(n),n.ganttProperties.predecessorsName)&&this.updateCriticalTasks(n,t)}},XXt.prototype.finalCriticalPath=function(e,t,i,n,o){for(var r=[],s=e.length-1;0<=s;s--){var a,l=i[a=("ProjectView"===this.parent.viewType?n:this.resourceCollectionIds).indexOf(e[s].taskid.toString())].ganttProperties.predecessor,h="0 "+i[a].ganttProperties.durationUnit;if(l&&0<l.length)for(var d=l.length-1;0<=d;d--){var p=void 0,p=("ProjectView"===this.parent.viewType?this.parent.ids:this.resourceCollectionIds).indexOf(l[d].to),c=void 0,u=i[a].ganttProperties;-1!==p&&("FS"===l[d].type?l[d].to!==u.taskId.toString()&&(l[d].to!==u.taskId.toString()||"ResourceView"===this.parent.viewType?c=this.parent.dataOperation.getDuration(u.endDate,i[p].ganttProperties.startDate,u.durationUnit,u.isAutoSchedule,u.isMilestone):-1!==(p=this.parent.ids.indexOf(l[d].from))&&0===(c=this.parent.dataOperation.getDuration(i[p].ganttProperties.endDate,u.startDate,u.durationUnit,u.isAutoSchedule,u.isMilestone))&&a!==p&&i[a].slack===h&&(i[p].slack=i[a].slack,i[p].ganttProperties.slack=i[a].slack),-1!==p)&&(0===c&&a!==p&&i[a].slack!==h?(i[a].slack=i[p].slack,i[a].ganttProperties.slack=i[p].slack):0!==c&&a!==p&&i[p].isCritical&&(i[a].slack=c+" "+i[a].ganttProperties.durationUnit,i[a].ganttProperties.slack=c+" "+i[a].ganttProperties.durationUnit)):c="SF"===l[d].type?this.parent.dataOperation.getDuration(u.startDate,i[p].ganttProperties.endDate,u.durationUnit,u.isAutoSchedule,u.isMilestone):"SS"===l[d].type?this.parent.dataOperation.getDuration(u.startDate,i[p].ganttProperties.startDate,u.durationUnit,u.isAutoSchedule,u.isMilestone):this.parent.dataOperation.getDuration(u.endDate,i[p].ganttProperties.endDate,u.durationUnit,u.isAutoSchedule,u.isMilestone),("number"==typeof i[a][this.parent.taskFields.id]?parseInt(l[d].from,10):l[d].from)===i[a][this.parent.taskFields.id])&&i[p].slack===h&&c<=0&&(i[a].slack=h,i[a].ganttProperties.slack=h)}i[a].slack===h&&i[a].ganttProperties.progress<100&&(i[a].isCritical=!0,i[a].ganttProperties.isCritical=!0,-1===this.criticalTasks.indexOf(i[a])&&this.criticalTasks.push(i[a]),-1===r.indexOf(e[s].taskid))&&r.push(e[s].taskid),i[a].ganttProperties.predecessor&&0<i[a].ganttProperties.predecessor.length&&this.updateCriticalTasks(i[a],r)}if(0<t.length)for(d=0;d<t.length;d++)-1!==(a=("ProjectView"===this.parent.viewType?n:this.resourceCollectionIds).indexOf(t[d].toString()))&&i[a].ganttProperties.progress<100&&(this.criticalTasks.push(i[a]),-1===r.indexOf(t[d]))&&(r=r.concat(t[d]));return r},XXt.prototype.criticalConnectorLine=function(d,e,t,i){this.parent.removeCriticalPathStyles();for(var p=this,n=0;n<d.length;n++)!function(t){var i;if("ProjectView"===p.parent.viewType)i=p.parent.flatData[p.parent.ids.indexOf(d[t].toString())];else for(var e=p.parent.flatData.filter(function(e){return e.ganttProperties.taskId.toString()===d[t].toString()}),n=0;n<e.length;n++)(e[n].ganttProperties.isCritical||e[n].ganttProperties.endDate>=p.maxEndDate)&&(i=e[n]);var o=p.parent.currentViewData.indexOf(i),o=p.parent.getRowByIndex(o),r=void 0,s=p.parent.taskFields;if(i&&i.parentItem){var a=p.parent.currentViewData.filter(function(e){return i.parentItem.uniqueID===e.uniqueID}),a=p.parent.flatData.indexOf(a[0]),a=p.parent.getRowByIndex(a);if(a)for(var l=a.querySelectorAll(".e-taskbar-main-container"),h=0;h<l.length;h++)l[h].getAttribute("rowuniqueid")===i.rowUniqueID&&U(l[h].querySelectorAll(".e-gantt-child-taskbar-inner-div"),_qt)}r=p.parent.allowUnscheduledTasks&&i&&!i[s.startDate]&&!i[s.endDate]&&i[s.duration]?"e-gantt-critical-unscheduled-taskbar":Hqt,o&&("ProjectView"===p.parent.viewType||"ResourceView"===p.parent.viewType&&!i.hasChildRecords)&&(o.getElementsByClassName("e-gantt-milestone")[0]&&U(o.querySelectorAll(".e-gantt-milestone"),zqt),0<o.getElementsByClassName("e-gantt-child-taskbar-inner-div").length&&U(o.querySelectorAll(".e-gantt-child-taskbar-inner-div"),_qt),0<o.getElementsByClassName("e-gantt-child-progressbar-inner-div").length)&&U(o.querySelectorAll(".e-gantt-child-progressbar-inner-div"),r)}(n);if(0!==e.length)for(var o,r=void 0,s=[],a=void 0,l=void 0,n=0;n<this.criticalPathCollection.length;n++)if(r=e[o=i.indexOf(this.criticalPathCollection[n])],-1!==o&&r.to)for(var s=r.to.split(","),h=0;h<s.length;h++){var c,u,l=s[h].split("+"),a=(l=0<=s[h].indexOf("-")?s[h].split("-"):l)[0].replace(":","");"number"==typeof d[h]&&(a=parseInt(l[0],10)),-1!==d.indexOf(a)&&(c=String(r.taskid),u=String(a),0<this.parent.element.querySelectorAll("#ConnectorLineparent"+c.replace(/([.])/g,"\\$1")+"child"+u.replace(/([.])/g,"\\$1")).length)&&(U(this.parent.element.querySelectorAll("#ConnectorLineparent"+c.replace(/([.])/g,"\\$1")+"child"+u.replace(/([.])/g,"\\$1"))[0].querySelectorAll(".e-connector-line"),bGt),U(this.parent.element.querySelectorAll("#ConnectorLineparent"+c.replace(/([.])/g,"\\$1")+"child"+u.replace(/([.])/g,"\\$1"))[0].querySelectorAll(".e-connector-line-arrow"),wGt))}},XXt.prototype.getModuleName=function(){return"criticalPath"},XXt.prototype.destroy=function(){!this.parent.enableCriticalPath&&this.parent.criticalPathModule&&(this.parent.criticalPathModule=void 0)};DOt=XXt;function XXt(e){this.validatedids=[],this.resourceCollectionIds=[],this.criticalTasks=[],this.parent=e}var KXt=function(){return(KXt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},vft=(JXt.prototype.undoAction=function(){var e=this;if(0<this.getUndoCollection.length){var t=this.getUndoCollection[this.getUndoCollection.length-1],i={};if("ZoomIn"===t.action||"ZoomOut"===t.action||"ZoomToFit"===t.action)i.action=t.action,i.previousZoomingLevel=Pe({},{},this.parent.currentZoomingLevel,!0);else if("NextTimeSpan"===t.action||"PreviousTimeSpan"===t.action)i.action=t.action,i.previousTimelineStartDate=Pe([],[this.parent.timelineModule.timelineStartDate],[],!0)[0],i.previousTimelineEndDate=Pe([],[this.parent.timelineModule.timelineEndDate],[],!0)[0];else if("Sorting"===t.action)i.action="Sorting",i.sortColumns=this.previousSortedColumns;else if("Filtering"===t.action)i.action="Filtering",i.filteredColumns=t.filteredColumns;else if("ColumnReorder"===t.action)i.action=t.action,i.toColumn=t.fromColumn,i.fromColumn=t.toColumn,i.fromIndex=t.toIndex,i.toIndex=t.fromIndex;else if("Search"===t.action)i.action=t.action,i.searchString=this.searchString;else if("ColumnState"===t.action)i.action=t.action,i.showhideColumns=t.showhideColumns;else if("ColumnResize"===t.action)i.action=t.action,i.resizedColumn=KXt({},this.parent.treeGrid.columns[t.resizedColumn.index]);else if("RowDragAndDrop"===t.action||"TaskbarDragAndDrop"===t.action){for(var n=[],o=0;o<t.beforeDrop.length;o++)"ProjectView"===this.parent.viewType?n.push(this.parent.getRecordByID(t.beforeDrop[o].data.ganttProperties.taskId)):n.push(this.parent.flatData[this.parent.taskIds.indexOf("T"+t.beforeDrop[o].data.ganttProperties.taskId.toString())]);i.action=t.action,i.beforeDrop=[];var r={},s=Pe([],[],[this.parent.getRecordByID(t.afterDrop.dropRecord.ganttProperties.taskId)],!0)[0];r.data=[];for(o=0;o<t.afterDrop.data.length;o++)"ProjectView"===this.parent.viewType?r.data.push(Pe([],[],[this.parent.getRecordByID(t.afterDrop.data[o].ganttProperties.taskId)],!0)[0]):r.data.push(Pe([],[],this.parent.flatData[this.parent.taskIds.indexOf("T"+t.afterDrop.data[o].ganttProperties.taskId)],!0)[0]);r.dropRecord=Pe([],[],[s],!0)[0],r.dropPosition=t.afterDrop.dropPosition,i.afterDrop=r,this.findPosition(n,i,"beforeDrop")}else if("Indent"===t.action||"Outdent"===t.action)i.selectedRowIndexes=t.selectedRowIndexes,i.droppedRecord=Pe([],[],[this.parent.flatData[this.parent.ids.indexOf(t.droppedRecord.ganttProperties.taskId.toString())]],!0)[0],i.modifiedRecord=[],this.findPosition(Pe([],[],[this.parent.flatData[this.parent.ids.indexOf(t.modifiedRecord[0].data.ganttProperties.taskId.toString())]],!0),i,"modifiedRecord"),i.action=t.action;else if("Delete"===t.action){i.action="Delete",i.deleteRecords=[];for(o=0;o<t.deletedRecordsDetails.length;o++)i.deleteRecords.push(t.deletedRecordsDetails[o].data)}else if("Add"===t.action){i.action="Add",i.deletedRecordsDetails=[];n=t.addedRecords;this.findPosition(n,i,"deletedRecordsDetails")}else{i.action=t.action,i.modifiedRecords=[];for(o=0;o<t.modifiedRecords.length;o++){var a=void 0,a="ProjectView"===this.parent.viewType?this.parent.ids.indexOf(t.modifiedRecords[o].ganttProperties.taskId.toString()):t.modifiedRecords[o].hasChildRecords?this.parent.taskIds.indexOf("R"+t.modifiedRecords[o].ganttProperties.taskId):this.parent.taskIds.indexOf("T"+t.modifiedRecords[o].ganttProperties.taskId);i.modifiedRecords.push(Pe([],[this.parent.flatData[a]],[],!0)[0])}}if(this.getRedoCollection.push(i),this.isUndoRedoPerformed=!0,this.changedRecords=[],"ZoomIn"===(this.currentAction=t).action||"ZoomOut"===t.action||"ZoomToFit"===t.action)this.parent.timelineSettings.timelineViewMode=t.previousZoomingLevel.timelineViewMode,this.parent.timelineSettings.timelineUnitSize=t.previousZoomingLevel.timelineUnitSize,this.parent.timelineSettings.updateTimescaleView=t.previousZoomingLevel.updateTimescaleView,this.parent.timelineSettings.topTier.unit=t.previousZoomingLevel.topTier.unit,this.parent.timelineSettings.topTier.count=t.previousZoomingLevel.topTier.count,this.parent.timelineSettings.topTier.format=t.previousZoomingLevel.topTier.format,this.parent.timelineSettings.bottomTier.unit=t.previousZoomingLevel.bottomTier.unit,this.parent.timelineSettings.bottomTier.count=t.previousZoomingLevel.bottomTier.count,this.parent.timelineSettings.bottomTier.format=t.previousZoomingLevel.bottomTier.format,this.parent.timelineSettings.weekStartDay=t.previousZoomingLevel.weekStartDay,this.parent.timelineSettings.weekendBackground=t.previousZoomingLevel.weekendBackground,"ZoomToFit"===t.action&&this.parent.timelineModule.refreshTimeline();else if("NextTimeSpan"===t.action||"PreviousTimeSpan"===t.action)this.parent.updateProjectDates(t.previousTimelineStartDate,t.previousTimelineEndDate,!1);else if("Sorting"===t.action)if(this.isFromUndoRedo=!0,(this.sortedColumnsLength=0)<t.sortColumns.length)for(o=0;o<t.sortColumns.length;o++)this.parent.treeGrid.sortByColumn(t.sortColumns[o].field,t.sortColumns[o].direction,0<o);else this.parent.clearSorting();else if("Filtering"===t.action){this.isFromUndoRedo=!0;for(o=this.getUndoCollection.length-1;0<=o;o--)if(this.getUndoCollection[o].filteredColumns){for(var l=[],h=0;h<this.getUndoCollection[o].filteredColumns.length;h++)l.push(this.getUndoCollection[o].filteredColumns[h].field);this.parent.clearFiltering(l)}}else if("ColumnReorder"===t.action){this.isFromUndoRedo=!0;var s=this.parent.treeGrid.columns[t.fromIndex].field,d=this.parent.treeGrid.columns[t.toIndex].field;this.parent.reorderColumns(s,d)}else if("Search"===t.action)this.isFromUndoRedo=!0,this.parent.search(t.searchString);else if("ColumnState"===t.action){this.isFromUndoRedo=!0;for(o=0;o<t.showhideColumns.length;o++)t.showhideColumns[o].visible?this.parent.hideColumn(t.showhideColumns[o].field,"field"):this.parent.showColumn(t.showhideColumns[o].field,"field")}else if("ColumnResize"===t.action)this.parent.treeGrid.columns[t.resizedColumn.index].width=t.resizedColumn.width,this.parent.treeGrid.refreshColumns();else if("RowDragAndDrop"===t.action||"TaskbarDragAndDrop"===t.action)for(o=0;o<t.beforeDrop.length;o++){var p=void 0,c=void 0,c=("ProjectView"===this.parent.viewType?(p=this.parent.ids.indexOf(t.beforeDrop[o].data.ganttProperties.taskId.toString()),this.parent.ids):(p=this.parent.ids.indexOf("T"+t.beforeDrop[o].data.ganttProperties.taskId.toString()),this.parent.taskIds)).indexOf(t.beforeDrop[o].id.toString());this.parent.reorderRows([p],c,t.beforeDrop[o].position),this.parent.updateRecordByID(t.beforeDrop[o].data),"child"===t.afterDrop.dropPosition&&this.parent.updateRecordByID(t.afterDrop.dropRecord)}else if("Indent"===t.action||"Outdent"===t.action)this.parent.selectRow(this.parent.ids.indexOf(t.modifiedRecord[0].data.ganttProperties.taskId.toString())),"Indent"===t.action?this.parent.outdent():this.parent.indent(),setTimeout(function(){e.isUndoRedoPerformed=!0,e.parent.updateRecordByID(t.droppedRecord),e.isUndoRedoPerformed=!1});else if("Delete"===t.action)for(var u=void 0,o=0;o<t.deletedRecordsDetails.length;o++){var u=("ProjectView"===this.parent.viewType?this.parent.ids:this.parent.taskIds).indexOf(t.deletedRecordsDetails[o].id.toString()),g=void 0;"above"===t.deletedRecordsDetails[o].position&&(g="Above"),"below"===t.deletedRecordsDetails[o].position&&(g="Below"),je(g="child"===t.deletedRecordsDetails[o].position?"Child":g)&&(g=t.deletedRecordsDetails[o].position.replace(/^./,function(e){return e.toUpperCase()})),this.parent.addRecord(t.deletedRecordsDetails[o].data,g,u)}else if("Add"===t.action){s=Pe([],[this.parent.editSettings.showDeleteConfirmDialog],[],!0)[0],d=(this.parent.editSettings.showDeleteConfirmDialog=!1,t.addedRecords);"ResourceView"===this.parent.viewType&&1===t.addedRecords.length&&t.addedRecords[0].parentItem&&1===(m=this.parent.getTaskByUniqueID(t.addedRecords[0].parentItem.uniqueID)).childRecords.length&&"Unassigned Task"===m.ganttProperties.taskName&&(d=m),this.parent.deleteRecord(d),this.parent.editSettings.showDeleteConfirmDialog=s}else if(this.parent.updateRecordByID(this.getUndoCollection[this.getUndoCollection.length-1].modifiedRecords[0]),t.connectedRecords&&"ProjectView"===this.parent.viewType)for(o=0;o<t.connectedRecords.length;o++)this.parent.updateRecordByID(t.connectedRecords[o]);var m={};(m=Pe([],[],[this.getUndoCollection[this.getUndoCollection.length-1]],!0)[0]).requestType="afterUndoAction",this.parent.trigger("onAfterUndo",m),this.isUndoRedoPerformed=!1,0<this.getRedoCollection.length&&(this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_redo"],!0),this.redoEnabled=!0)}this.getUndoCollection.splice(this.getUndoCollection.length-1,1),0===this.getUndoCollection.length&&this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!1)},JXt.prototype.redoAction=function(){if(0<this.getRedoCollection.length){var e=this.getRedoCollection[this.getRedoCollection.length-1],t={};if("ZoomIn"===e.action||"ZoomOut"===e.action||"ZoomToFit"===e.action)t.action=e.action,t.previousZoomingLevel=Pe({},{},this.parent.currentZoomingLevel,!0);else if("NextTimeSpan"===e.action||"PreviousTimeSpan"===e.action)t.action=e.action,t.previousTimelineStartDate=Pe([],[this.parent.timelineModule.timelineStartDate],[],!0)[0],t.previousTimelineEndDate=Pe([],[this.parent.timelineModule.timelineEndDate],[],!0)[0];else if("Sorting"===e.action)t.action="Sorting",t.sortColumns=Pe([],this.parent.sortSettings.columns,[],!0);else if("Filtering"===e.action)t.action="Filtering",t.filteredColumns=e.filteredColumns;else if("ColumnReorder"===e.action)t.action=e.action,t.toColumn=e.fromColumn,t.fromColumn=e.toColumn,t.fromIndex=e.toIndex,t.toIndex=e.fromIndex;else if("Search"===e.action)t.action=e.action,t.searchString=Pe([],[this.parent.searchSettings.key],[],!0)[0];else if("ColumnState"===e.action)t.action=e.action,t.showhideColumns=e.showhideColumns;else if("ColumnResize"===e.action)t.action=e.action,t.resizedColumn=KXt({},this.parent.treeGrid.columns[e.resizedColumn.index]);else if("RowDragAndDrop"===e.action||"TaskbarDragAndDrop"===e.action){for(var i=[],n=0;n<e.beforeDrop.length;n++)"ProjectView"===this.parent.viewType?i.push(this.parent.getRecordByID(e.beforeDrop[n].data.ganttProperties.taskId)):i.push(this.parent.flatData[this.parent.taskIds.indexOf("T"+e.beforeDrop[n].data.ganttProperties.taskId.toString())]);t.action=e.action,t.beforeDrop=[];var o={},r=void 0;e.afterDrop.dropRecord&&(r=Pe([],[],[this.parent.getRecordByID(e.afterDrop.dropRecord.ganttProperties.taskId)],!0)[0]),o.data=[];for(n=0;n<e.afterDrop.data.length;n++)"ProjectView"===this.parent.viewType?o.data.push(Pe([],[],[this.parent.getRecordByID(e.afterDrop.data[n].ganttProperties.taskId)],!0)[0]):void 0!==e.afterDrop.data[n]&&o.data.push(Pe([],[],this.parent.flatData[this.parent.taskIds.indexOf("T"+e.afterDrop.data[n].ganttProperties.taskId)],!0)[0]);o.dropRecord=Pe([],[],[r],!0)[0],o.dropPosition=e.afterDrop.dropPosition,t.afterDrop=o,this.findPosition(i,t,"beforeDrop")}else if("Indent"===e.action||"Outdent"===e.action)t.selectedRowIndexes=e.selectedRowIndexes,t.droppedRecord=Pe([],[],[this.parent.flatData[this.parent.ids.indexOf(e.droppedRecord.ganttProperties.taskId.toString())]],!0)[0],t.modifiedRecord=[],this.findPosition(Pe([],[],[this.parent.flatData[this.parent.ids.indexOf(e.modifiedRecord[0].data.ganttProperties.taskId.toString())]],!0),t,"modifiedRecord"),t.action=e.action;else if("Delete"===e.action)t.action="Delete",t.deletedRecordsDetails=[],this.findPosition(Pe([],[],e.deleteRecords,!0),t,"deletedRecordsDetails");else if("Add"===e.action)t.action="Add",t.addedRecords=[e.deletedRecordsDetails[0].data];else{t.action=e.action,t.modifiedRecords=[];for(n=0;n<e.modifiedRecords.length;n++){var s=void 0,s="ProjectView"===this.parent.viewType?this.parent.ids.indexOf(e.modifiedRecords[n].ganttProperties.taskId.toString()):e.modifiedRecords[n].hasChildRecords?this.parent.taskIds.indexOf("R"+e.modifiedRecords[n].ganttProperties.taskId):this.parent.taskIds.indexOf("T"+e.modifiedRecords[n].ganttProperties.taskId);t.modifiedRecords.push(Pe([],[this.parent.flatData[s]],[],!0)[0])}}if(this.getUndoCollection.push(t),this.isUndoRedoPerformed=!0,"ZoomIn"===(this.currentAction=e).action||"ZoomOut"===e.action||"ZoomToFit"===e.action)"ZoomToFit"===e.action?this.parent.fitToProject():(this.parent.timelineSettings.timelineViewMode=e.previousZoomingLevel.timelineViewMode,this.parent.timelineSettings.timelineUnitSize=e.previousZoomingLevel.timelineUnitSize,this.parent.timelineSettings.updateTimescaleView=e.previousZoomingLevel.updateTimescaleView,this.parent.timelineSettings.topTier.unit=e.previousZoomingLevel.topTier.unit,this.parent.timelineSettings.topTier.count=e.previousZoomingLevel.topTier.count,this.parent.timelineSettings.topTier.format=e.previousZoomingLevel.topTier.format,this.parent.timelineSettings.bottomTier.unit=e.previousZoomingLevel.bottomTier.unit,this.parent.timelineSettings.bottomTier.count=e.previousZoomingLevel.bottomTier.count,this.parent.timelineSettings.bottomTier.format=e.previousZoomingLevel.bottomTier.format,this.parent.timelineSettings.weekStartDay=e.previousZoomingLevel.weekStartDay,this.parent.timelineSettings.weekendBackground=e.previousZoomingLevel.weekendBackground);else if("NextTimeSpan"===e.action||"PreviousTimeSpan"===e.action)this.parent.updateProjectDates(e.previousTimelineStartDate,e.previousTimelineEndDate,!1);else if("Sorting"===e.action)if(this.isFromUndoRedo=!0,(this.sortedColumnsLength=0)===e.sortColumns.length)this.parent.clearSorting();else for(n=0;n<e.sortColumns.length;n++)this.parent.treeGrid.sortByColumn(e.sortColumns[n].field,e.sortColumns[n].direction,1<e.sortColumns.length);else if("ColumnState"===e.action){this.isFromUndoRedo=!0;for(n=0;n<e.showhideColumns.length;n++)e.showhideColumns[n].visible?this.parent.hideColumn(e.showhideColumns[n].field,"field"):this.parent.showColumn(e.showhideColumns[n].field,"field")}else if("Filtering"===e.action)for(var a=0;a<e.filteredColumns.length;a++)this.isFromUndoRedo=!0,this.parent.filterByColumn(e.filteredColumns[a].field,e.filteredColumns[a].operator,e.filteredColumns[a].value,e.filteredColumns[a].predicate,e.filteredColumns[a].matchCase,e.filteredColumns[a].ignoreAccent);else if("ColumnReorder"===e.action){this.isFromUndoRedo=!0;var r=this.parent.treeGrid.columns[e.fromIndex].field,l=this.parent.treeGrid.columns[e.toIndex].field;this.parent.reorderColumns(r,l)}else if("Search"===e.action)this.isFromUndoRedo=!0,this.parent.search(e.searchString);else if("ColumnResize"===e.action)this.parent.treeGrid.columns[e.resizedColumn.index].width=e.resizedColumn.width,this.parent.treeGrid.refreshColumns();else if("RowDragAndDrop"===e.action||"TaskbarDragAndDrop"===e.action)for(n=0;n<e.beforeDrop.length;n++){var h=void 0,d=void 0,d=("ProjectView"===this.parent.viewType?(h=this.parent.ids.indexOf(e.beforeDrop[n].data.ganttProperties.taskId.toString()),this.parent.ids):(h=this.parent.ids.indexOf("T"+e.beforeDrop[n].data.ganttProperties.taskId.toString()),this.parent.taskIds)).indexOf(e.beforeDrop[n].id.toString());this.parent.reorderRows([h],d,e.beforeDrop[n].position)}else if("Indent"===e.action||"Outdent"===e.action)this.parent.selectRow(e.selectedRowIndexes[0]),"Indent"===e.action&&this.parent.indent(),"Outdent"===e.action&&this.parent.outdent();else if("Delete"===e.action){r=Pe([],[this.parent.editSettings.showDeleteConfirmDialog],[],!0)[0];this.parent.editSettings.showDeleteConfirmDialog=!1,this.parent.deleteRecord(e.deleteRecords),this.parent.editSettings.showDeleteConfirmDialog=r}else if("Add"===e.action)if("ResourceView"===this.parent.viewType&&1<e.deletedRecordsDetails.length)this.parent.editModule.addRecord(Pe([],[],e.deletedRecordsDetails,!0));else for(var p=void 0,n=0;n<e.deletedRecordsDetails.length;n++){var p=("ProjectView"===this.parent.viewType?this.parent.ids:this.parent.taskIds).indexOf(e.deletedRecordsDetails[n].id.toString()),c=void 0;"above"===e.deletedRecordsDetails[n].position&&(c="Above"),"below"===e.deletedRecordsDetails[n].position&&(c="Below"),"child"===e.deletedRecordsDetails[n].position&&(c="Child"),"bottom"===e.deletedRecordsDetails[n].position&&(c="Bottom"),this.parent.editModule.addRecord(e.deletedRecordsDetails[n].data,c,p)}else this.parent.updateRecordByID(e.modifiedRecords[0]);this.isUndoRedoPerformed=!1,0<this.getUndoCollection.length&&this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!0),this.getRedoCollection.splice(this.getRedoCollection.length-1,1),0===this.getRedoCollection.length&&this.parent.toolbarModule&&(this.redoEnabled=!1,this.parent.toolbarModule.enableItems([this.parent.controlId+"_redo"],!1))}},JXt.prototype.createUndoCollection=function(){this.parent.totalUndoAction+1>this.parent.undoRedoStepsCount&&this.getUndoCollection.length===this.parent.totalUndoAction&&(this.getUndoCollection.splice(0,1),this.disableRedo()),this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!0),0===this.getUndoCollection.length?(this.getUndoCollection[0]=[],this.parent.totalUndoAction+1<=this.parent.undoRedoStepsCount&&this.parent.totalUndoAction++):0<Object.keys(this.getUndoCollection[this.getUndoCollection.length-1]).length&&(this.getUndoCollection[this.getUndoCollection.length]=[],this.parent.totalUndoAction+1<=this.parent.undoRedoStepsCount)&&this.parent.totalUndoAction++},JXt.prototype.disableRedo=function(){this.redoEnabled=!1,this.getRedoCollection=[],this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_redo"],!1)},JXt.prototype.findPosition=function(y,v,b){for(var w=this,e=0;e<y.length;e++)!function(t){var e,i={};if(i.data=y[t],"ProjectView"===w.parent.viewType)if(!y[t].hasChildRecords&&y[t].parentItem)if(1<(e=w.parent.getRecordByID(y[t].parentItem.taskId)).childRecords.length){var n=w.parent.ids.indexOf(y[t].ganttProperties.taskId.toString());if((g=w.parent.flatData[n-1]).parentItem&&g.parentItem.taskId.toString()===e.ganttProperties.taskId.toString())i.position="below",i.id=Pe([],[w.parent.flatData[w.parent.ids.indexOf(y[t].ganttProperties.taskId.toString())-1].ganttProperties.taskId],[],!0)[0];else{i.position="above";var o=w.parent.flatData[w.parent.ids.indexOf(y[t].ganttProperties.taskId.toString())+1],r=w.parent.ids.indexOf(y[t].ganttProperties.taskId.toString())+1,s=t;do{}while((m=y[s+1])&&o.ganttProperties.taskId.toString()===m.ganttProperties.taskId.toString()?(s++,o=w.parent.flatData[++r]):o&&o.parentItem?i.id=Pe([],[o.ganttProperties.taskId],[],!0)[0]:(i.id=Pe([],[y[t].parentItem.taskId],[],!0)[0],i.position="child"),!i.id)}}else i.position="child",i.id=Pe([],[e.ganttProperties.taskId],[],!0)[0];else if(y[t].hasChildRecords||y[t].parentItem){if(y[t].hasChildRecords&&!y[t].parentItem){for(h=void 0,o=void 0,d=void 0,l=0;l<w.parent.treeGrid.parentData.length;l++)if(w.parent.treeGrid.parentData[l].ganttProperties.taskId.toString()===y[t].ganttProperties.taskId.toString()){h=l,o=w.parent.treeGrid.parentData[l+1],d=l+1;break}if(-1!==h)if(0===h){i.position="above";s=t;do{}while((m=y[s+1])&&o.ganttProperties.taskId.toString()===m.ganttProperties.taskId.toString()?(s++,o=w.parent.treeGrid.parentData[++d]):(o=o||w.parent.treeGrid.parentData[h],i.id=Pe([],[o.ganttProperties.taskId],[],!0)[0]),!i.id)}else i.position="below",i.id=Pe([],[w.parent.treeGrid.parentData[h-1].ganttProperties.taskId],[],!0)[0]}else if(y[t].hasChildRecords&&y[t].parentItem)if(1===(e=w.parent.getRecordByID(y[t].parentItem.taskId)).childRecords.length)i.position="child",i.id=Pe([],[y[t].parentItem.taskId],[],!0)[0];else{for(var a=void 0,l=0;l<e.childRecords.length;l++)if(e.childRecords[t].ganttProperties.taskId.toString()===y[t].ganttProperties.taskId.toString()){a=l;break}je(a)||(0===a?(i.position="above",i.id=Pe([],[e.childRecords[a+1].ganttProperties.taskId],[],!0)[0]):(i.position="below",i.id=Pe([],[e.childRecords[a-1].ganttProperties.taskId],[],!0)[0]))}}else{w.parent.ids.indexOf(y[t].ganttProperties.taskId.toString())===w.parent.ids.length-1?i.position="below":i.position="above";for(var h=void 0,o=void 0,d=void 0,l=0;l<w.parent.treeGrid.parentData.length;l++)if(w.parent.treeGrid.parentData[l].ganttProperties.taskId.toString()===y[t].ganttProperties.taskId.toString()){h=l,o=w.parent.treeGrid.parentData[l+1],d=l+1;break}var s=t;do{}while((m=y[s+1])&&o.ganttProperties.taskId.toString()===m.ganttProperties.taskId.toString()?(s++,o=w.parent.treeGrid.parentData[++d]):(o=(o=o||w.parent.treeGrid.parentData[h-1])||w.parent.treeGrid.parentData[h],i.id=Pe([],[o.ganttProperties.taskId],[],!0)[0]),!i.id)}else if(y[t].parentItem){var p=void 0;if(1===(p=y[t].parentItem.index?w.parent.flatData[y[t].parentItem.index]:w.parent.flatData[w.parent.ids.indexOf(y[t].parentItem.taskId)]).childRecords.length)i.position="bottom",i.id="R"+p.ganttProperties.taskId,"deletedIndexes"===b&&(i.position="child",i.index=p.index);else{for(var c=void 0,u=0;u<p.childRecords.length;u++)if(p.childRecords[u].ganttProperties.taskId.toString()===y[t].ganttProperties.taskId.toString()){c=u;break}if((g=p.childRecords[c-1])&&g.parentItem&&g.parentUniqueID===p.uniqueID)i.position="below",i.id=Pe([],["T"+w.parent.flatData[w.parent.taskIds.indexOf("T"+y[t].ganttProperties.taskId.toString())-1].ganttProperties.taskId],[],!0)[0],"deletedIndexes"===b&&(i.index=w.parent.taskIds.indexOf("T"+y[t].ganttProperties.taskId.toString())-1);else{r=void 0;if(c!==p.childRecords.length-1){i.position="above",0===c&&p.childRecords[1]?r=p.childRecords[1].index:p.childRecords[c-1]&&(r=p.childRecords[c-1].index);o=w.parent.flatData[r],n=r,s=t;do{}while((m=y[s+1])&&o.ganttProperties.taskId.toString()===m.ganttProperties.taskId.toString()?(s++,o=w.parent.flatData[++n]):o.parentItem?(i.id=Pe([],["T"+o.ganttProperties.taskId],[],!0)[0],"deletedIndexes"===b&&(i.index=Pe([],[o.index],[],!0)[0],0===c)&&p.childRecords[1].ganttProperties.taskId===o.ganttProperties.taskId&&(i.index=i.index-1)):(i.id=Pe([],["R"+y[t].parentItem.taskId],[],!0)[0],i.position="child","deletedIndexes"===b&&(i.index=y[t].parentItem.index)),!i.id)}else c===p.childRecords.length-1?i.position="below":i.position="above",i.id="T"+p.childRecords[c-1].ganttProperties.taskId,"deletedIndexes"===b&&(i.index=p.childRecords[c-1].index)}}}else{var g=w.parent.treeGrid.parentData.filter(function(e){return e.ganttProperties.taskId===y[t].ganttProperties.taskId})[0],g=w.parent.treeGrid.parentData.indexOf(g);if(0===g){i.position="above";for(o=void 0,d=void 0,l=0;l<w.parent.treeGrid.parentData.length;l++)if(w.parent.treeGrid.parentData[l].ganttProperties.taskId===y[t].ganttProperties.taskId){o=w.parent.treeGrid.parentData[l+1],d=l+1;break}var m,s=t;do{}while((m=y[s+1])&&o.ganttProperties.taskId===m.ganttProperties.taskId?(s++,o=w.parent.treeGrid.parentData[++d]):(i.id="R"+o.ganttProperties.taskId,"deletedIndexes"===b&&(i.index=o.index)),!i.id)}else i.position="below",i.id="R"+w.parent.treeGrid.parentData[g-1].ganttProperties.taskId,"deletedIndexes"===b&&(i.index=w.parent.treeGrid.parentData[g-1].index)}if("deletedIndexes"===b){var f=w.parent.getTaskByUniqueID(i.data.parentUniqueID);if(0===w.parent.editModule.dialogModule.ganttResources.length&&-1===v[b].indexOf(i))v[b].push(i);else for(u=0;u<w.parent.editModule.dialogModule.ganttResources.length;u++)w.parent.editModule.dialogModule.ganttResources[u][w.parent.resourceFields.id]!==f.ganttProperties.taskId&&-1===v[b].indexOf(i)&&v[b].push(i)}else v[b].some(function(e){return e.data.ganttProperties.taskId===i.data.ganttProperties.taskId})||v[b].push(i)}(e)},JXt.prototype.getModuleName=function(){return"undoRedo"},JXt.prototype.destroy=function(){!this.parent.enableUndoRedo&&this.parent.undoRedoModule&&(this.parent.undoRedoModule=void 0)},JXt);function JXt(e){this.isUndoRedoPerformed=!1,this.changedRecords=[],this.getRedoCollection=[],this.getUndoCollection=[],this.redoEnabled=!1,this.previousSortedColumns=[],this.searchString="",this.isFromUndoRedo=!1,this.canUpdateIndex=!0,this.sortedColumnsLength=0,this.parent=e}ZXt.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("initiate-contextMenu",this.render,this),this.parent.on("reRender-contextMenu",this.reRenderContextMenu,this),this.parent.on("contextMenuClick",this.contextMenuItemClick,this),this.parent.on("contextMenuOpen",this.contextMenuBeforeOpen,this))},ZXt.prototype.reRenderContextMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.contextMenu&&(this.contextMenu.destroy(),ue(this.element)),this.resetItems(),this.render())},ZXt.prototype.render=function(){this.element=this.parent.createElement("ul",{id:this.ganttID+"_contextmenu",className:Eqt}),this.parent.element.appendChild(this.element);var e="#"+this.ganttID;this.contextMenu=new D4({items:this.getMenuItems(),locale:this.parent.locale,enableRtl:this.parent.enableRtl,target:e,animationSettings:{effect:"None"},select:this.contextMenuItemClick.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this),onOpen:this.contextMenuOpen.bind(this),onClose:this.contextMenuOnClose.bind(this),cssClass:"e-gantt"}),this.contextMenu.appendTo(this.element),this.parent.treeGrid.contextMenuItems=this.headerMenuItems},ZXt.prototype.contextMenuItemClick=function(e){this.item=this.getKeyFromId(e.item.id);var t,i,n,o,r,s,a=R("parentObj",e.item),l=-1;switch(e.type="Content",e.rowData=this.rowData,this.parent.trigger("contextMenuClick",e),a&&!je(a.id)&&"DeleteDependency"===this.getKeyFromId(a.id)&&(l=a.items.indexOf(e.item)),!this.parent.isAdaptive||"TaskInformation"!==this.item&&"Above"!==this.item&&"Below"!==this.item&&"Child"!==this.item&&"DeleteTask"!==this.item||this.parent.selectionModule&&"Multiple"===this.parent.selectionSettings.type&&(this.parent.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none"),this.item){case"TaskInformation":je(this.rowData)||("string"==typeof this.rowData.ganttProperties.taskId?this.parent.openEditDialog(this.rowData.ganttProperties.rowUniqueID):this.parent.openEditDialog(Number(this.rowData.ganttProperties.rowUniqueID)));break;case"Above":case"Below":case"Child":je(this.rowData)?0===this.parent.flatData.length&&this.parent.addRecord():(r=this.item,(n=Pe({},{},this.rowData.taskData,!0))[(o=this.parent.taskFields).startDate]&&this.parent.setRecordValue(o.startDate,this.rowData.ganttProperties.startDate,n,!0),n[o.endDate]&&this.parent.setRecordValue(o.endDate,this.rowData.ganttProperties.endDate,n,!0),je(o.dependency)||(n[o.dependency]=null),!je(o.child)&&n[o.child]&&delete n[o.child],!je(o.parentID)&&n[o.parentID]&&(n[o.parentID]=null),this.rowData&&("ResourceView"===this.parent.viewType&&this.rowData.parentItem&&n[this.parent.taskFields.resourceInfo]&&(t=this.parent.getParentTask(this.rowData.parentItem),i=this.parent.resourceFields.id,s=this.rowData.taskData[this.parent.taskFields.resourceInfo].find(function(e){return e[i]===t.ganttProperties.taskId}),n[this.parent.taskFields.resourceInfo]=s?[s]:[]),s=this.parent.updatedRecords.indexOf(this.rowData),this.parent.addRecord(n,r,s)));break;case"Milestone":case"ToMilestone":je(this.rowData)?0===this.parent.flatData.length&&"Milestone"===this.item&&(r=this.parent.editModule.createNewRecord(),s=this.parent.taskFields,this.parent.taskFields.duration&&(r[s.duration]=0),this.parent.taskFields.milestone&&(r[s.milestone]=!0),this.parent.addRecord(r)):this.parent.convertToMilestone(this.rowData.ganttProperties.rowUniqueID);break;case"DeleteTask":"Cell"!==this.parent.selectionSettings.mode&&1<this.parent.selectionModule.selectedRowIndexes.length||"Cell"===this.parent.selectionSettings.mode&&this.parent.selectionModule.getSelectedRowCellIndexes().length?this.parent.editModule.startDeleteAction():this.parent.editModule.deleteRecord(this.rowData);break;case"ToTask":je(this.rowData)||(n=Pe({},{},this.rowData.taskData,!0),je((o=this.parent.taskFields).duration)?(n[o.startDate]=new Date(this.rowData.taskData[o.startDate]),(s=new Date(this.rowData.taskData[o.startDate])).setDate(s.getDate()+1),n[o.endDate]=s):(r=parseInt(n[o.duration],10)<=0?1:n[o.duration],n[o.duration]=r,this.parent.setRecordValue("duration",r,this.rowData.ganttProperties,!0)),je(n[o.milestone])||!0===n[o.milestone]&&(n[o.milestone]=!1),"FixedWork"!==(s=(je(this.rowData.ganttProperties.taskType)?this.parent:this.rowData.ganttProperties).taskType)&&"FixedUnit"!==s||(this.parent.dataOperation.updateWorkWithDuration(this.rowData),je(n[o.work]))||(n[o.work]=this.rowData.ganttProperties.work),n[o.startDate]&&this.parent.setRecordValue(o.startDate,this.rowData.ganttProperties.startDate,n,!0),this.parent.updateRecordByID(n));break;case"Cancel":this.parent.cancelEdit();break;case"Save":this.parent.editModule.cellEditModule.isCellEdit=!1,this.parent.treeGrid.grid.saveCell();break;case"Dependency"+l:this.isCntxtMenuDependencyDelete=!0,this.parent.connectorLineEditModule.removePredecessorByIndex(this.rowData,l);break;case"Auto":case"Manual":this.parent.changeTaskMode(this.rowData);break;case"Indent":this.parent.indent();break;case"Outdent":this.parent.outdent();break;case"Left":case"Right":this.mergeCall(this.item);break;case"SplitTask":this.splitTaskCall(e)}},ZXt.prototype.splitTaskCall=function(e){var t=this,i=(this.isEdit=!0,this.parent.taskFields),n=this.getClickedDate(e.element),e=(je(this.parent.timelineSettings.bottomTier)&&"Hour"!==this.parent.timelineSettings.bottomTier.unit&&n.setHours(0,0,0,0),{rowData:this.rowData,requestType:"splitTaskbar",splitDate:n,cancel:!1,target:this.targetElement});this.parent.trigger("actionBegin",e,function(e){je(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.showSpinner():t.parent.showMaskRow(),t.parent.chartRowsModule.splitTask(t.rowData[i.id],n),t.parent.chartRowsModule.updateSegment(t.rowData.ganttProperties.segments,t.rowData.ganttProperties.taskId)})},ZXt.prototype.mergeCall=function(e){var t=this,i=(this.isEdit=!0,this.parent.taskFields),n=this.rowData.ganttProperties.segments,o=[{firstSegmentIndex:("Right"===e?this:n[this.segmentIndex-1]).segmentIndex,secondSegmentIndex:("Left"===e?this:n[this.segmentIndex+1]).segmentIndex}],e={rowData:this.rowData,mergeSegmentIndexes:o,requestType:"mergeSegment",cancel:!1,target:this.targetElement};this.parent.trigger("actionBegin",e,function(e){je(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.showSpinner():t.parent.showMaskRow(),!1===e.cancel&&t.parent.chartRowsModule.mergeTask(t.rowData[i.id],o)})},ZXt.prototype.getClickedDate=function(e){o=this.parent.enableRtl?(o=this.parent.element.getBoundingClientRect(),i=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,n=document.documentElement.clientLeft||document.body.clientLeft||0,o.left+i-n):this.parent.getOffsetRect(this.parent.element).left,i=this.parent.enableRtl?(t=Math.abs(o+this.parent.ganttChartModule.chartElement.offsetWidth-this.rowData.ganttProperties.left-this.parent.ganttChartModule.scrollElement.scrollLeft),Math.abs(this.clickedPosition-t)):(t=o+this.parent.ganttChartModule.chartElement.offsetLeft+this.rowData.ganttProperties.left-this.parent.ganttChartModule.scrollElement.scrollLeft,this.clickedPosition-t);var t,i,n=Math.ceil(i/this.parent.perDayWidth),o=this.rowData.ganttProperties.startDate;return je(this.parent.timelineSettings.bottomTier)||"Hour"!==this.parent.timelineSettings.bottomTier.unit||(n=Math.ceil(i/this.parent.timelineSettings.timelineUnitSize),--n),je(this.parent.timelineSettings.bottomTier)||"Minutes"!==this.parent.timelineSettings.bottomTier.unit&&"Hour"!==this.parent.timelineSettings.bottomTier.unit?this.parent.dataOperation.getEndDate(o,n,1<this.rowData.ganttProperties.duration?this.rowData.ganttProperties.durationUnit:("None"!==this.parent.timelineSettings.bottomTier.unit?this.parent.timelineSettings.bottomTier:this.parent.timelineSettings.topTier).unit.toLocaleLowerCase(),this.rowData,!1):(n=Math.ceil(i/this.parent.timelineSettings.timelineUnitSize),this.parent.dataOperation.getEndDate(o,--n,this.parent.timelineSettings.bottomTier.unit.toLocaleLowerCase(),this.rowData,!1))},ZXt.prototype.contextMenuBeforeOpen=function(t){var i=this,e=t.event?t.event.target:this.parent.focusModule?this.parent.ganttChartModule.targetElement:this.parent.focusModule.getActiveElement(),n=((!je(this.parent.editModule)&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit&&e.parentElement.classList.contains("e-row")||e.parentElement.classList.contains("e-treecolumn-container"))&&this.parent.treeGrid.endEdit(),je(t.element)||t.element.id!==this.parent.element.id+"_contextmenu"||(this.clickedPosition=R("event",t).clientX),z(e,".e-gantt-child-taskbar")),n=(n&&(this.targetElement=t.target=n),t.gridRow=z(e,".e-row"),t.chartRow=z(e,".e-chart-row"),z(e,".e-gantt"));if(!z(e,PGt)&&this.parent.editModule&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit&&this.parent.editModule.dialogModule.dialogObj&&!this.parent.editModule.dialogModule.dialogObj.open&&(this.parent.treeGrid.grid.saveCell(),this.parent.editModule.cellEditModule.isCellEdit=!1),this.parent.readOnly&&this.contextMenu.enableItems(["Add","Save","Convert","Delete Dependency","Delete Task","TaskMode","Indent","Outdent","SplitTask","MergeTask"],!1),(je(t.gridRow)&&je(t.chartRow)||0===this.contentMenuItems.length)&&((je(t.parentItem)||je(n))&&je(z(e,".e-content"))?t.cancel=!0:t.cancel=!1),!t.cancel){var o=-1;t.gridRow?o=parseInt(t.gridRow.getAttribute("aria-rowindex"),0)-1:t.chartRow&&(o=parseInt(t.chartRow.getAttribute("aria-rowindex"),0)-1),this.parent.selectionModule&&this.parent.allowSelection&&!t.parentItem&&!je(t.chartRow)&&this.parent.selectionModule.selectRow(o),t.parentItem||(this.rowData=this.parent.ganttChartModule.getRecordByTarget(t.event));for(var r,s=0,a=t.items;s<a.length;s++){var l=a[s];l.separator||(!e.classList.contains("e-gantt-unscheduled-taskbar")||l.text!==this.getLocale("splitTask")&&l.text!==this.getLocale("mergeTask")?this.updateItemStatus(l,e,o):this.hideItems.push(l.text))}if(t.rowData=this.rowData,t.type="Content",t.disableItems=this.disableItems,t.hideItems=this.hideItems,t.hideChildItems=[],je(t.rowData)||0!==t.rowData.level||"ResourceView"!==this.parent.viewType)return r=new ll,this.parent.trigger("contextMenuOpen",t,function(e){r.resolve(e),i.hideItems=e.hideItems,i.disableItems=e.disableItems,e.parentItem||e.hideItems.length!==e.items.length||(i.revertItemStatus(),e.cancel=!0),0<i.hideItems.length&&i.contextMenu.hideItems(i.hideItems),0<i.disableItems.length&&i.contextMenu.enableItems(i.disableItems,!1),0<t.hideChildItems.length&&i.contextMenu.hideItems(t.hideChildItems)}),r;t.cancel=!0}},ZXt.prototype.updateItemStatus=function(e,t,i){var n=this.getKeyFromId(e.id),o=z(t,PGt),r=[],s=z(t,".e-gantt-child-taskbar")||z(t,"e-taskbar-right-resizer")||z(t,"e-taskbar-left-resizer");if(o)"Save"!==n&&"Cancel"!==n&&this.hideItems.push(e.text);else switch(n){case"TaskInformation":this.parent.editSettings.allowEditing&&this.parent.editModule||this.updateItemVisibility(e.text),0===this.parent.flatData.length&&this.hideItems.push(e.text);break;case"Add":this.parent.editSettings.allowAdding&&this.parent.editModule||this.updateItemVisibility(e.text);break;case"Save":case"Cancel":this.hideItems.push(e.text);break;case"Convert":!je(this.rowData)&&this.rowData.hasChildRecords?this.hideItems.push(e.text):this.parent.editSettings.allowEditing&&this.parent.editModule?(je(this.rowData)||this.rowData.ganttProperties.isMilestone?r.push(this.createItemModel(kGt,"ToTask",this.getLocale("toTask"))):r.push(this.createItemModel(kGt,"ToMilestone",this.getLocale("toMilestone"))),e.items=r):this.updateItemVisibility(e.text),0===this.parent.flatData.length&&this.hideItems.push(e.text);break;case"DeleteDependency":var a=this.getPredecessorsItems();je(this.rowData)||!this.rowData.hasChildRecords||this.parent.allowParentDependency?this.parent.editSettings.allowDeleting&&0!==a.length&&this.parent.editModule?0<a.length&&(e.items=a):this.updateItemVisibility(e.text):this.hideItems.push(e.text);break;case"DeleteTask":this.parent.editSettings.allowDeleting&&this.parent.editModule||this.updateItemVisibility(e.text),0===this.parent.flatData.length&&this.hideItems.push(e.text);break;case"TaskMode":"Custom"!==this.parent.taskMode?this.updateItemVisibility(e.text):(this.rowData.ganttProperties.isAutoSchedule?r.push(this.createItemModel(kGt,"Manual",this.getLocale("manual"))):r.push(this.createItemModel(kGt,"Auto",this.getLocale("auto"))),e.items=r);break;case"Indent":this.parent.allowSelection&&this.parent.editModule&&this.parent.editSettings?(a=this.parent.selectedRowIndex,h=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length),l=this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0]-1],this.parent.editSettings.allowEditing&&0!==a&&-1!==a&&h&&"ResourceView"!==this.parent.viewType&&this.parent.updatedRecords[parseInt(a.toString(),10)].level-l.level!=1||this.updateItemVisibility(e.text)):this.hideItems.push(e.text);break;case"Outdent":this.parent.allowSelection&&this.parent.editModule&&this.parent.editSettings?(h=this.parent.selectionModule.getSelectedRowIndexes()[0],a=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length),this.parent.editSettings.allowEditing&&-1!==h&&0!==h&&a&&"ResourceView"!==this.parent.viewType&&0!==this.parent.updatedRecords[parseInt(h.toString(),10)].level||this.updateItemVisibility(e.text)):this.hideItems.push(e.text);break;case"SplitTask":var l=!1,a=!1,h=this.parent.taskFields;je(this.parent.timelineSettings.bottomTier)||(l="Minutes"===this.parent.timelineSettings.bottomTier.unit,a="Hour"===this.parent.timelineSettings.bottomTier.unit),(this.parent.readOnly||!s||je(h.segments)||this.parent.flatData[Number(i)].hasChildRecords||this.parent.flatData[Number(i)].ganttProperties.duration<2&&!l&&!a)&&this.updateItemVisibility(e.text);break;case"MergeTask":this.parent.readOnly||!s?this.updateItemVisibility(e.text):this.mergeItemVisiblity(t,e)}},ZXt.prototype.mergeItemVisiblity=function(e,t){var i=[],n=this.parent.taskFields,e=this.getClickedDate(e),e=(this.segmentIndex=this.parent.chartRowsModule.getSegmentIndex(e,this.rowData),this.rowData.ganttProperties.segments);!je(e)&&0<e.length?je(n.segments)&&-1===this.segmentIndex?this.updateItemVisibility(t.text):(0===this.segmentIndex?i.push(this.createItemModel(kGt,"Right",this.getLocale("right"))):(this.segmentIndex!==e.length-1&&i.push(this.createItemModel(kGt,"Right",this.getLocale("right"))),i.push(this.createItemModel(kGt,"Left",this.getLocale("left")))),t.items=i):this.hideItems.push(t.text)},ZXt.prototype.updateItemVisibility=function(e){(!!je(this.parent.contextMenuItems)?this.hideItems:this.disableItems).push(e)},ZXt.prototype.contextMenuOpen=function(e){this.isOpen=!0;e=this.parent.args=e.element.querySelectorAll("li:not(.e-menu-hide):not(.e-disabled)")[0];je(e)||U([e],"e-focused")},ZXt.prototype.getMenuItems=function(){for(var e=0,t=je(this.parent.contextMenuItems)?this.getDefaultItems():this.parent.contextMenuItems;e<t.length;e++){var i=t[e];"string"==typeof i&&-1!==this.getDefaultItems().indexOf(i)?this.buildDefaultItems(i):"string"!=typeof i&&(-1!==this.getDefaultItems().indexOf(i.text)?this.buildDefaultItems(i.text,i.iconCss):(".e-gridheader"===i.target?this.headerMenuItems:this.contentMenuItems).push(i))}return this.contentMenuItems},ZXt.prototype.createItemModel=function(e,t,i,n){return{text:i,id:this.generateID(t),target:e,iconCss:n?"e-icons "+n:null}},ZXt.prototype.getLocale=function(e){return this.parent.localeObj.getConstant(e)},ZXt.prototype.buildDefaultItems=function(e,t){var i;switch(e){case"AutoFitAll":case"AutoFit":case"SortAscending":case"SortDescending":this.headerMenuItems.push(e);break;case"TaskInformation":i=this.createItemModel(kGt,e,this.getLocale("taskInformation"),this.getIconCSS(BGt,t));break;case"Indent":i=this.createItemModel(kGt,e,this.getLocale("indent"),this.getIconCSS("e-indent",t));break;case"Outdent":i=this.createItemModel(kGt,e,this.getLocale("outdent"),this.getIconCSS("e-outdent",t));break;case"Save":i=this.createItemModel(BGt,e,this.getLocale("save"),this.getIconCSS("e-save",t));break;case"Cancel":i=this.createItemModel(BGt,e,this.getLocale("cancel"),this.getIconCSS("e-cancel",t));break;case"Add":(i=this.createItemModel(kGt,e,this.getLocale("add"),this.getIconCSS("e-add",t))).items=[],i.items.push(this.createItemModel(kGt,"Above",this.getLocale("above"),this.getIconCSS("e-add-above",t))),i.items.push(this.createItemModel(kGt,"Below",this.getLocale("below"),this.getIconCSS("e-add-below",t))),"ResourceView"!==this.parent.viewType&&i.items.push(this.createItemModel(kGt,"Child",this.getLocale("child"))),i.items.push(this.createItemModel(kGt,"Milestone",this.getLocale("milestone")));break;case"DeleteTask":i=this.createItemModel(kGt,e,this.getLocale("deleteTask"),this.getIconCSS("e-delete",t));break;case"DeleteDependency":(i=this.createItemModel(kGt,e,this.getLocale("deleteDependency"))).items=[],i.items.push({});break;case"Convert":(i=this.createItemModel(kGt,e,this.getLocale("convert"))).items=[],i.items.push({});break;case"TaskMode":(i=this.createItemModel(kGt,e,this.getLocale("changeScheduleMode"))).items=[],i.items.push({});break;case"SplitTask":i=this.createItemModel(kGt,e,this.getLocale("splitTask"));break;case"MergeTask":(i=this.createItemModel(kGt,e,this.getLocale("mergeTask"))).items=[],i.items.push({})}i&&this.contentMenuItems.push(i)},ZXt.prototype.getIconCSS=function(e,t){return je(t)?e:t},ZXt.prototype.getPredecessorsItems=function(){this.predecessors=this.parent.predecessorModule.getValidPredecessor(this.rowData);for(var e=[],t=0,i=0,n=this.predecessors;i<n.length;i++){var o=n[i],o=this.parent.connectorLineModule.getRecordByID(o.from).ganttProperties,o=o.rowUniqueID+" - "+o.taskName,r="Dependency"+t++,r=this.createItemModel(kGt,r,o);e.push(r)}return e},ZXt.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","TaskInformation","DeleteTask","Save","Cancel","SortAscending","SortDescending","Add","DeleteDependency","Convert","TaskMode","Indent","Outdent","SplitTask","MergeTask"]},ZXt.prototype.getModuleName=function(){return"contextMenu"},ZXt.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("initiate-contextMenu",this.render),this.parent.off("reRender-contextMenu",this.reRenderContextMenu),this.parent.off("contextMenuClick",this.contextMenuItemClick),this.parent.off("contextMenuOpen",this.contextMenuOpen))},ZXt.prototype.contextMenuOnClose=function(e){0<e.items.length&&e.items[0].parentObj instanceof D4&&this.revertItemStatus()},ZXt.prototype.revertItemStatus=function(){this.contextMenu.showItems(this.hideItems),this.contextMenu.enableItems(this.disableItems),this.hideItems=[],this.disableItems=[],this.isOpen=!1},ZXt.prototype.resetItems=function(){this.hideItems=[],this.disableItems=[],this.headerMenuItems=[],this.contentMenuItems=[],this.item=null},ZXt.prototype.generateID=function(e){return this.ganttID+"_contextMenu_"+e},ZXt.prototype.getKeyFromId=function(e){var t=this.ganttID+"_contextMenu_";return-1<e.indexOf(t)?e.replace(t,""):"Custom"},ZXt.prototype.destroy=function(){this.contextMenu.destroy(),ue(this.element),this.removeEventListener(),this.contextMenu=null,this.element=null};Rft=ZXt;function ZXt(e){var n=this;this.segmentIndex=-1,this.isCntxtMenuDependencyDelete=!1,this.headerContextMenuClick=function(e){var t=z(e.event.target,".e-row"),i=z(e.event.target,".e-chart-row");je(t)&&je(i)&&(e.type="Header",n.parent.trigger("contextMenuClick",e))},this.headerContextMenuOpen=function(e){var t=z(e.event.target,".e-row"),i=z(e.event.target,".e-chart-row");je(t)&&je(i)?(e.type="Header",n.parent.trigger("contextMenuOpen",e)):e.cancel=!0},this.parent=e,this.ganttID=e.element.id,eee.Inject(kee),this.parent.treeGrid.contextMenuClick=this.headerContextMenuClick.bind(this),this.parent.treeGrid.contextMenuOpen=this.headerContextMenuOpen.bind(this),this.addEventListener(),this.resetItems()}$Xt.prototype.getModuleName=function(){return"excelExport"},$Xt.prototype.destroy=function(){},$Xt.prototype.bindEvents=function(){var t=this;this.parent.treeGrid.beforeExcelExport=function(e){t.parent.trigger("beforeExcelExport",e),je(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.showSpinner():t.parent.showMaskRow()},this.parent.treeGrid.excelQueryCellInfo=function(e){t.parent.trigger("excelQueryCellInfo",e)},this.parent.treeGrid.excelHeaderQueryCellInfo=function(e){t.parent.trigger("excelHeaderQueryCellInfo",e)},this.parent.treeGrid.excelExportComplete=function(e){t.parent.trigger("excelExportComplete",e),je(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.hideSpinner():t.parent.hideMaskRow()}};Wo=$Xt;function $Xt(e){this.parent=e,eee.Inject(yee),this.parent.treeGrid.allowExcelExport=this.parent.allowExcelExport,this.bindEvents()}eKt.prototype.getColumnMenu=function(){return this.parent.treeGrid.columnMenuModule.getColumnMenu()},eKt.prototype.destroy=function(){},eKt.prototype.getModuleName=function(){return"columnMenu"};wk=eKt;function eKt(e){eee.Inject(Dee),this.parent=e}tKt.prototype.getModuleName=function(){return"rowDragAndDrop"},tKt.prototype.destroy=function(){},tKt.prototype.bindEvents=function(){this.parent.treeGrid.rowDragStart=this.rowDragStart.bind(this),this.parent.treeGrid.rowDragStartHelper=this.rowDragStartHelper.bind(this),this.parent.treeGrid.rowDrag=this.rowDrag.bind(this),this.parent.treeGrid.rowDrop=this.rowDrop.bind(this)},tKt.prototype.rowDragStart=function(e){this.parent.trigger("rowDragStart",e),this.parent.element.style.position="relative"},tKt.prototype.addErrorElem=function(){var e,t,i,n,o=document.querySelector(".e-ganttdrag");o&&!!!o.querySelector(".e-errorelem")&&((e=document.createElement("div")).classList.add("e-errorcontainer","e-icons","e-errorelem"),o=o.querySelector(".e-rowcell"))&&(t=o.childNodes,(i=o.querySelector(".errorValue"))&&(t=i.childNodes,i.remove()),o.innerHTML="",(n=document.createElement("span")).className="errorValue",n.style.paddingLeft="16px",t.forEach(function(e){n.appendChild(e.cloneNode(!0))}),o.appendChild(e),o.appendChild(n))},tKt.prototype.removeErrorElem=function(){var e=document.querySelector(".e-errorelem");e&&e.remove()},tKt.prototype.rowDrag=function(e){var t,i=this.parent.element.querySelector(".e-cloneproperties"),i=(i.style.display="none",i.cloneNode(!0)),i=(i.classList.add("e-ganttdrag"),i.style.display="",this.parent.element.querySelectorAll(".e-cloneproperties").length<=1?this.parent.element.appendChild(i):document.getElementsByClassName("e-cloneproperties")[0].querySelectorAll(".e-errorelem").length?this.addErrorElem():this.removeErrorElem(),"Both"===this.parent.gridLines&&U(this.parent.element.querySelectorAll(".e-ganttdrag .e-rowcell"),["e-bothganttlines"]),this.parent.element.querySelector(".e-ganttdrag")),n=this.parent.element.getClientRects()[0].top,o=this.parent.element.getClientRects()[0].left,o=this.parent.isAdaptive?(t=e.originalEvent.event.touches[0].clientX-o,e.originalEvent.event.touches[0].clientY-n):(t=R("event",e.originalEvent).clientX-o,R("event",e.originalEvent).clientY-n);i.style.left=t+20+"px",i.style.top=o+20+"px",this.parent.trigger("rowDrag",e)},tKt.prototype.rowDragStartHelper=function(e){this.parent.trigger("rowDragStartHelper",e),this.parent.readOnly&&(e.cancel=!0),"ResourceView"===this.parent.viewType&&0===R("level",e.data[0])&&(e.cancel=!0)},tKt.prototype.rowDrop=function(e){var t=z(e.target,".e-row"),t=(this.parent.oldRecords=Pe([],[],e.data,!0),t?parseInt(t.getAttribute("aria-rowindex"),10)-1:e.dropIndex);e.dropIndex=t,e.dropRecord=this.parent.updatedRecords[e.dropIndex],this.parent.trigger("rowDrop",e),"ResourceView"===this.parent.viewType&&("middleSegment"!==e.dropPosition||1!==e.dropRecord.level&&e.dropRecord.uniqueID!==R("parentItem",e.data[0]).uniqueID||(e.cancel=!0),"middleSegment"===e.dropPosition||0!==e.dropRecord.level&&R("parentItem",e.data[0]).uniqueID!==e.dropRecord.parentItem.uniqueID||(e.cancel=!0)),e.cancel||(e.requestType="beforeDrop",this.parent.trigger("actionBegin",e),je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),e.cancel?je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.hideSpinner():this.parent.hideMaskRow():(this.dropRows(e,!0),e.cancel=!0))},tKt.prototype.dropRows=function(i,c){if(!this.parent.readOnly){if(this.dropPosition=i.dropPosition,"Invalid"!==i.dropPosition&&this.parent.editModule){var u=this.parent;if(this.droppedRecord=u.updatedRecords[i.dropIndex],this.parent.undoRedoModule&&this.parent.isUndoRedoItemPresent("RowDragAndDrop")){if(!this.parent.undoRedoModule.isUndoRedoPerformed){this.parent.undoRedoModule.redoEnabled&&(this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection()),!i.target&&this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.editModule.taskbarEditModule.taskBarEditAction?this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=[]:this.parent.undoRedoModule.createUndoCollection();for(var e=[],n=this,o=0;o<i.data.length;o++)!function(t){e.push(n.parent.flatData.filter(function(e){return i.data[t].ganttProperties.taskId===e.ganttProperties.taskId})[0])}(o);var t=Pe([],[],e,!0),r={},s=(i.name?r.action="RowDragAndDrop":r.action="TaskbarDragAndDrop",r.beforeDrop=[],{});s.dropRecord=Pe([],[],[i.dropRecord||this.droppedRecord],!0)[0],s.data=Pe([],[],i.data,!0),"middleSegment"===i.dropPosition?s.dropPosition="child":"topSegment"===i.dropPosition?s.dropPosition="above":"bottomSegment"===i.dropPosition&&(s.dropPosition="below"),r.afterDrop=s,this.parent.undoRedoModule.findPosition(t,r,"beforeDrop"),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=r}this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!0)}for(var g=void 0,m=[],f=this.droppedRecord,y=(i.data[0]?m=i.data:m.push(i.data),0),a=m.length,l=function(e){if(v.parent.isOnEdit=!0,g=m[e],v.draggedRecord=g,"Invalid"!==v.dropPosition){if("ResourceView"===v.parent.viewType&&(v.checkisSharedTask(),0!==v.draggedRecord.level)&&(v.previousParent=v.draggedRecord.parentItem.uniqueID),v.isSharedTask)return{value:void 0};c&&v.deleteDragRow();var t,e=v.treeGridData.indexOf(f);if("topSegment"===v.dropPosition&&v.dropAtTop(e),"bottomSegment"!==v.dropPosition||v.isSharedTask||(f.hasChildRecords?(y=v.parent.editModule.getChildCount(f,0),v.parent.taskFields.parentID&&0<v.ganttData.length&&v.ganttData.splice(e+y+1,0,v.draggedRecord.taskData),v.treeGridData.splice(e+y+1,0,v.draggedRecord),v.parent.ids.splice(e+y+1,0,v.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===v.parent.viewType&&(r=0===v.draggedRecord.level?"R"+v.draggedRecord.ganttProperties.taskId:"T"+v.draggedRecord.ganttProperties.taskId,v.parent.getTaskIds().splice(e+y+1,0,r))):(v.parent.taskFields.parentID&&0<v.ganttData.length&&v.ganttData.splice(e+1,0,v.draggedRecord.taskData),v.treeGridData.splice(e+1,0,v.draggedRecord),v.parent.ids.splice(e+1,0,v.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===v.parent.viewType&&(r=0===v.draggedRecord.level?"R"+v.draggedRecord.ganttProperties.taskId:"T"+v.draggedRecord.ganttProperties.taskId,v.parent.getTaskIds().splice(e+1,0,r))),v.parent.setRecordValue("parentItem",v.treeGridData[e].parentItem,g),v.parent.setRecordValue("parentUniqueID",v.treeGridData[e].parentUniqueID,g),v.parent.setRecordValue("level",v.treeGridData[e].level,g),g.hasChildRecords&&(v.updateChildRecordLevel(g,1),v.updateChildRecord(g,e+y+1)),f.parentItem&&(t=(r=v.parent.getParentTask(f.parentItem).childRecords).indexOf(f)+1,r.splice(t,0,g))),"middleSegment"===v.dropPosition&&(v.dropMiddle(e),0<f.childRecords.length)&&(delete f.ganttProperties.segments,delete f.taskData[v.parent.taskFields.segments]),0!==v.treeGridData.length)for(var i,n=0;n<v.treeGridData.length;n++)v.treeGridData[parseInt(n.toString(),10)].index=n,je(v.treeGridData[parseInt(n.toString(),10)].parentItem)||(i=R("uniqueIDCollection."+v.treeGridData[parseInt(n.toString(),10)].parentUniqueID,v.parent.treeGrid),v.treeGridData[parseInt(n.toString(),10)].parentItem.index=i.index);je(g.parentItem&&-1!==v.updateParentRecords.indexOf(g.parentItem))||v.updateParentRecords.push(g.parentItem)}if(!v.parent.enableVirtualization){var o=u.flatData,r=void 0,s=void 0,a=v.parent.dataSource,l=v.parent.taskFields.id;if(g.index<f.index){for(var r=g.index,h=0;h<a.length;h++)if("break"===function(t){var e=v.parent.currentViewData.filter(function(e){return e[l]===a[t][l]})[0];if(e&&e.index>f.index)return s=e.index,"break"}(h))break}else{r=f.index;for(var d=0;d<a.length;d++)if("break"===function(t){var e=v.parent.currentViewData.filter(function(e){return e[l]===a[t][l]})[0];if(e&&e.index>g.index)return s=e.index,"break"}(d))break}for(var p=r;p<=s;p++)!function(t){var e;je(o[t])||(o[t].index=t,je(o[t].parentItem))||(e=o.filter(function(e){return e.uniqueID===o[t].parentUniqueID})[0],o[t].parentItem.index=e.index)}(p)}u.rowDragAndDropModule.refreshDataSource()},v=this,o=0;o<a;o++){var h=l(o);if("object"==typeof h)return h.value}if("middleSegment"===this.dropPosition){if(f.ganttProperties.predecessor)for(var d=f.ganttProperties.predecessor.length,p=0;p<d;p++)if(f.ganttProperties.predecessor&&f.ganttProperties.predecessor[p]){var b=this.parent.getRecordByID(f.ganttProperties.predecessor[p].from),w=this.parent.getRecordByID(f.ganttProperties.predecessor[p].to),b=this.parent.predecessorModule.validateParentPredecessor(b,w);if(f.ganttProperties.predecessor&&(!b||!this.parent.allowParentDependency)&&(this.parent.editModule.removePredecessorOnDelete(f),f.ganttProperties.predecessor.splice(0,1),f.ganttProperties.predecessorsName)){for(var C=f.ganttProperties.predecessorsName.split(","),o=0;o<C.length;o++)-1!==C[o].indexOf(g.ganttProperties.taskId+"")&&C.splice(o,1);w=C.join();f.ganttProperties.predecessorsName=w,f[this.parent.taskFields.dependency]=w,f.taskData[this.parent.taskFields.dependency]=w}}f.ganttProperties.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,f.ganttProperties,!0),je(f.taskData[this.parent.taskFields.milestone])||!0===f.taskData[this.parent.taskFields.milestone]&&(f.taskData[this.parent.taskFields.milestone]=!1))}if("ResourceView"!==this.parent.viewType||this.isSharedTask||(s=void 0,s=("middleSegment"!==this.dropPosition&&this.droppedRecord.parentItem||this.droppedRecord).uniqueID,t=this.parent.getTaskByUniqueID(s),(r={})[this.parent.taskFields.resourceInfo]=[],r[this.parent.taskFields.resourceInfo].push(t.ganttProperties.taskId),this.removeExistingResources(),s=this.parent.dataOperation.setResourceInfo(r),je((r=this.draggedRecord).ganttProperties.resourceInfo)&&(r.ganttProperties.resourceInfo=[]),"Unassigned Task"===t.ganttProperties.taskName?(r.ganttProperties.resourceInfo=[],r.ganttProperties.sharedTaskUniqueIds=[r.ganttProperties.rowUniqueID]):r.ganttProperties.resourceInfo.push(s[0]),this.updateCurrentTask(r),"Unassigned Task"===t.ganttProperties.taskName?this.deleteSharedResourceTask():this.updateSharedResourceTask()),this.parent.taskFields.dependency&&this.parent.allowParentDependency){var s=void 0,s=g.parentItem?this.parent.flatData[this.parent.ids.indexOf(g.parentItem.taskId)]:g,S=f.parentItem?this.parent.flatData[this.parent.ids.indexOf(f.parentItem.taskId)]:f,A=void 0;if(S.uniqueID===s.uniqueID||s.parentItem&&S.uniqueID===this.parent.flatData[this.parent.ids.indexOf(s.parentItem.taskId)].uniqueID)for(var A=this.parent.currentViewData.filter(function(e){if(e.ganttProperties.predecessor&&0<e.ganttProperties.predecessor.length){var t=0;if(t<e.ganttProperties.predecessor.length)return parseInt(e.ganttProperties.predecessor[t].to,10)===parseInt(S.ganttProperties.taskId,10)||parseInt(e.ganttProperties.predecessor[t].from,10)===parseInt(S.ganttProperties.taskId,10)}return null}),x=[],o=0;o<A.length;o++){if(x=[],A[o].ganttProperties.predecessor)for(var I=0;I<A[o].ganttProperties.predecessor.length;I++)parseInt(A[o].ganttProperties.taskId,10)!==parseInt(A[o].ganttProperties.predecessor[I].from,10)?x.push(A[o].ganttProperties.predecessor[I].from):x.push(A[o].ganttProperties.predecessor[I].to);for(var T=this,E=0;E<x.length;E++)!function(e){var t=x[e].replace(/\D/g,""),e=T.parent.currentViewData.filter(function(e){return parseInt(e.ganttProperties.taskId,10)===parseInt(t,10)});T.parent.predecessorModule.validateParentPredecessor(A[o],e[0])||(T.parent.dataOperation.resetDependency(A[o]),T.parent.dataOperation.resetDependency(e[0]))}(E)}}for(E=0;E<this.updateParentRecords.length;E++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[E]);"ProjectView"===this.parent.viewType&&this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.predecessorModule&&"TaskbarDragAndDrop"===this.parent.undoRedoModule.currentAction.action&&"child"!==this.parent.undoRedoModule.currentAction.beforeDrop[0].position&&(r=this.parent.flatData[this.parent.ids.indexOf(this.parent.undoRedoModule.currentAction.afterDrop.dropRecord.ganttProperties.taskId.toString())],this.parent.editModule.taskbarEditModule.taskBarEditRecord=r,this.parent.editModule.taskbarEditModule.taskBarEditAction="ChildDrag",this.parent.predecessorModule.validatePredecessor(r,[],""),this.parent.editModule.taskbarEditModule.taskBarEditAction=null),this.updateParentRecords=[],this.parent.isOnEdit=!1}je(this.parent.editModule)||this.parent.editModule.refreshRecord(i,!0),(!this.parent.undoRedoModule||this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed)&&(this.parent.previousFlatData=Pe([],[],this.parent.flatData,!0))}this.parent.oldRecords=[]},tKt.prototype.updateCurrentTask=function(e){this.parent.dataOperation.updateMappingData(e,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(e,"resource"),this.parent.editModule.dialogModule.dialogEditValidationFlag=!1,this.parent.editModule.dialogModule.validateDuration(e),this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.updateTaskData(e)},tKt.prototype.deleteSharedResourceTask=function(){for(var e=0;e<this.parent.getTaskIds().length;e++)this.parent.getTaskIds()[e]==="T"+this.draggedRecord.ganttProperties.taskId&&("Unassigned Task"!==this.parent.getTaskByUniqueID(this.parent.flatData[e].parentItem.uniqueID).ganttProperties.taskName&&this.removeRecords(this.parent.flatData[e]),je(this.parent.flatData[parseInt(e.toString(),10)].parentItem&&-1!==this.updateParentRecords.indexOf(this.parent.flatData[parseInt(e.toString(),10)].parentItem))||this.updateParentRecords.push(this.parent.flatData[e].parentItem))},tKt.prototype.removeExistingResources=function(){var e=this.parent.getTaskByUniqueID(this.previousParent);if(this.draggedRecord.ganttProperties.resourceInfo)for(var t=0;t<this.draggedRecord.ganttProperties.resourceInfo.length;t++)if(this.draggedRecord.ganttProperties.resourceInfo[parseInt(t.toString(),10)][this.parent.resourceFields.id]===e.ganttProperties.taskId){this.draggedRecord.ganttProperties.resourceInfo.splice(t,1);break}},tKt.prototype.updateSharedResourceTask=function(){for(var e=0;e<this.parent.getTaskIds().length;e++)this.parent.getTaskIds()[e]==="T"+this.draggedRecord.ganttProperties.taskId&&(this.parent.editModule.updateGanttProperties(this.draggedRecord,this.parent.flatData[e]),this.parent.dataOperation.updateTaskData(this.parent.flatData[e]),je(this.parent.flatData[parseInt(e.toString(),10)].parentItem&&-1!==this.updateParentRecords.indexOf(this.parent.flatData[parseInt(e.toString(),10)].parentItem))||this.updateParentRecords.push(this.parent.flatData[e].parentItem))},tKt.prototype._getExistingTaskWithID=function(e){for(var t=[],i=0;i<this.parent.getTaskIds().length;i++)this.parent.getTaskIds()[i]==="T"+e.ganttProperties.taskId&&t.push(this.parent.flatData[i]);return t},tKt.prototype.removeResourceInfo=function(e){var t=this.parent.getTaskByUniqueID(this.draggedRecord.parentItem.uniqueID);if(e.ganttProperties.resourceInfo&&1<e.ganttProperties.resourceInfo.length){var i=this._getExistingTaskWithID(e);if(null!==i)for(var n=0;n<i.length;n++)for(var o,r=(o=i[n]).ganttProperties.resourceInfo,s=0;s<r.length;s++)if(r[s][this.parent.resourceFields.id]===t.ganttProperties.taskId){r.splice(s,1),this.parent.setRecordValue("resourceInfo",r,o.ganttProperties,!0),this.updateCurrentTask(o),je(o.parentItem&&-1!==this.updateParentRecords.indexOf(o.parentItem))||this.updateParentRecords.push(o.parentItem);break}}},tKt.prototype.refreshDataSource=function(){var e,t=this.draggedRecord,i=this.droppedRecord,n=this.parent,o=this.parent.taskFields,r=this.parent.dataSource instanceof me?R("dataOperation.dataArray",this.parent):n.dataSource;if(0<r.length&&!je(i)&&!i.parentItem){for(var s=0;s<Object.keys(r).length;s++)(!je(i.taskData[o.child])&&r[s][o.child]===i.taskData[o.child]||je(i.taskData[o.child])&&i.taskData[o.id]===r[s][o.id])&&(e=s);"topSegment"===this.dropPosition?this.parent.taskFields.parentID||r.splice(e,0,t.taskData):"bottomSegment"!==this.dropPosition||this.parent.taskFields.parentID||r.splice(e+1,0,t.taskData)}else this.parent.taskFields.parentID||je(i)||!i.parentItem||"topSegment"!==this.dropPosition&&"bottomSegment"!==this.dropPosition||(n="topSegment"===this.dropPosition?"Above":"Below",this.parent.editModule.addRowSelectedItem=i,this.parent.editModule.updateRealDataSource([t],n),delete this.parent.editModule.addRowSelectedItem);this.parent.taskFields.parentID&&(t.parentItem?(n="middleSegment"===this.dropPosition?this.parent.taskFields.id:this.parent.taskFields.parentID,t[this.parent.taskFields.parentID]=i[n],t.ganttProperties.parentId=i[n],("ResourceView"===this.parent.viewType&&"middleSegment"!==this.dropPosition||"ProjectView"===this.parent.viewType)&&(t.taskData[this.parent.taskFields.parentID]=i.taskData[n])):(t[this.parent.taskFields.parentID]=null,t.taskData[this.parent.taskFields.parentID]=null,t.ganttProperties.parentId=null)),"ProjectView"===this.parent.viewType&&this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.predecessorModule&&"TaskbarDragAndDrop"===this.parent.undoRedoModule.currentAction.action&&(n=this.parent.flatData[this.parent.ids.indexOf(this.parent.undoRedoModule.currentAction.afterDrop.data[0].ganttProperties.taskId.toString())],this.parent.editModule.taskbarEditModule.taskBarEditRecord=n,this.parent.editModule.taskbarEditModule.taskBarEditAction="ChildDrag",this.parent.predecessorModule.validatePredecessor(n,[],""),this.parent.editModule.taskbarEditModule.taskBarEditAction=null)},tKt.prototype.dropMiddle=function(e){var t=this.parent,i=this.parent.editModule.getChildCount(this.droppedRecord,0),i=je(i)||0===i?e+1:i+e+1;"middleSegment"!==this.dropPosition||this.isSharedTask||(t.taskFields.parentID&&0<this.ganttData.length&&this.ganttData.splice(i,0,this.draggedRecord.taskData),this.treeGridData.splice(i,0,this.draggedRecord),this.parent.ids.splice(i,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType&&(e=0===this.draggedRecord.level?"R"+this.draggedRecord.ganttProperties.taskId:"T"+this.draggedRecord.ganttProperties.taskId,this.parent.getTaskIds().splice(i,0,e)),this.draggedRecord.hasChildRecords&&this.updateChildRecord(this.draggedRecord,i,this.droppedRecord.expanded),this.recordLevel(),je(this.draggedRecord.parentItem&&-1!==this.updateParentRecords.indexOf(this.draggedRecord.parentItem))&&this.updateParentRecords.push(this.draggedRecord.parentItem))},tKt.prototype.recordLevel=function(){var e,t=this.parent,i=this.draggedRecord,n=this.droppedRecord,o=t.taskFields.child;n.hasChildRecords||(n.hasChildRecords=!0,n.childRecords.length)||(n.childRecords=[],!t.taskFields.parentID&&je(n.taskData[o])&&(n.taskData[o]=[])),"middleSegment"===this.dropPosition&&(delete(e=Pe({},n)).childRecords,e={uniqueID:e.uniqueID,expanded:e.expanded,level:e.level,index:e.index,taskId:e.ganttProperties.rowUniqueID},this.parent.setRecordValue("parentItem",e,i),this.parent.setRecordValue("parentUniqueID",n.uniqueID,i),n.childRecords.splice(n.childRecords.length,0,i),je(i)||t.taskFields.parentID||je(n.taskData[o])||n.taskData[t.taskFields.child].splice(n.childRecords.length,0,i.taskData),i.hasChildRecords?(i.level=n.level+1,this.parent.setRecordValue("level",this.draggedRecord.level,this.draggedRecord),this.updateChildRecordLevel(i,1)):i.level=n.level+1,n.expanded=!0)},tKt.prototype.deleteDragRow=function(){var e;this.treeGridData=sqt(this.parent)?R("result",this.parent.treeGrid.dataSource):this.parent.treeGrid.dataSource,this.parent.dataSource instanceof me?this.ganttData=R("dataOperation.dataArray",this.parent):this.ganttData=sqt(this.parent)?R("result",this.parent.dataSource):this.parent.dataSource,e=this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed?"ProjectView"===this.parent.viewType?this.parent.flatData[this.parent.ids.indexOf(this.draggedRecord.ganttProperties.taskId.toString())]:this.draggedRecord.hasChildRecords?this.parent.flatData["R"+this.parent.taskIds.indexOf(this.draggedRecord.ganttProperties.taskId)]:this.parent.flatData["T"+this.parent.taskIds.indexOf(this.draggedRecord.ganttProperties.taskId)]:this.parent.getTaskByUniqueID(this.draggedRecord.uniqueID),this.removeRecords(e)},tKt.prototype.checkisSharedTask=function(){this.isSharedTask=!1;for(var e=null,t=(0===this.droppedRecord.level?this.droppedRecord:this.droppedRecord.parentItem).uniqueID,i=this.parent.getTaskByUniqueID(t).childRecords,n=0;n<i.length;n++)"T"+this.draggedRecord.ganttProperties.taskId=="T"+i[n].ganttProperties.taskId&&(this.isSharedTask=!0,e=i[n]);this.isSharedTask&&this.removeResourceInfo(e)},tKt.prototype.dropAtTop=function(e){var t=this.parent;this.isSharedTask||(t.taskFields.parentID&&0<this.ganttData.length&&this.ganttData.splice(e,0,this.draggedRecord.taskData),this.treeGridData.splice(e,0,this.draggedRecord),this.parent.ids.splice(e,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),this.parent.setRecordValue("parentItem",this.droppedRecord.parentItem,this.draggedRecord),this.parent.setRecordValue("parentUniqueID",this.droppedRecord.parentUniqueID,this.draggedRecord),this.parent.setRecordValue("level",this.droppedRecord.level,this.draggedRecord),"ResourceView"===this.parent.viewType&&(t=0===this.draggedRecord.level?"R"+this.draggedRecord.ganttProperties.taskId:"T"+this.draggedRecord.ganttProperties.taskId,this.parent.getTaskIds().splice(e,0,t)),this.draggedRecord.hasChildRecords&&(this.updateChildRecord(this.draggedRecord,e),this.updateChildRecordLevel(this.draggedRecord,1)),this.droppedRecord.parentItem&&(e=(t=this.parent.getParentTask(this.droppedRecord.parentItem).childRecords).indexOf(this.droppedRecord),t.splice(e,0,this.draggedRecord)),je(this.draggedRecord.parentItem&&-1!==this.updateParentRecords.indexOf(this.draggedRecord.parentItem)))||this.updateParentRecords.push(this.draggedRecord.parentItem)},tKt.prototype.updateChildRecordLevel=function(e,t){if(t++,!e.hasChildRecords)return 0;for(var i=e.childRecords.length,n=0;n<i;n++){var o=e.childRecords[n],r=void 0;e.parentItem&&(r=this.parent.treeGrid.uniqueIDCollection[e.parentItem.uniqueID]),o.level=e.parentItem?r.level+t:e.level+1,this.parent.setRecordValue("level",o.level,o),o.hasChildRecords&&(t--,t=this.updateChildRecordLevel(o,t))}return t},tKt.prototype.updateChildRecord=function(e,t,i){var n,o=this.parent;if(!e.hasChildRecords)return 0;for(var r=e.childRecords.length,s=0;s<r;s++)n=e.childRecords[s],o.flatData.splice(++t,0,n),this.parent.ids.splice(t,0,n.ganttProperties.rowUniqueID.toString()),o.taskFields.parentID&&0<o.dataSource.length&&this.ganttData.splice(t,0,n.taskData),n.hasChildRecords&&(t=this.updateChildRecord(n,t));return t},tKt.prototype.removeRecords=function(e){var t=this.parent,i=this.parent.dataSource instanceof me?R("dataOperation.dataArray",this.parent):this.parent.dataSource,n=e,e=n&&n.parentItem?this.parent.getParentTask(n.parentItem):null;if(n){if(n.parentItem&&(l=[],a=0,l=e?e.childRecords:l)&&0<l.length&&("ResourceView"===this.parent.viewType&&1===l.length&&(this.parent.isOnDelete=!0,l[0].isDelete=!0,this.parent.dataOperation.updateParentItems(e),this.parent.isOnDelete=!1,l[0].isDelete=!1),a=l.indexOf(n),e.childRecords.splice(a,1),!this.parent.taskFields.parentID&&e.taskData[this.parent.taskFields.child]&&e.taskData[this.parent.taskFields.child].splice(a,1),this.updateParentRecords.push(e)),!this.parent.taskFields.parentID&&((l=[]).push(n.ganttProperties.taskId.toString()),"ProjectView"===this.parent.viewType||"ResourceView"===this.parent.viewType&&"middleSegment"!==this.dropPosition)&&this.parent.editModule.removeFromDataSource(l),t.taskFields.parentID){n.hasChildRecords&&0<n.childRecords.length&&this.removeChildItem(n);for(var o=void 0,r=0<i.length&&"ResourceView"!==this.parent.viewType?i:this.parent.updatedRecords,s=0;s<r.length;s++)"ResourceView"===this.parent.viewType?r[s].ganttProperties.rowUniqueID===n.ganttProperties.rowUniqueID&&(o=s):r[s][this.parent.taskFields.id]===n.taskData[this.parent.taskFields.id]&&(o=s);-1!==o&&(0<i.length&&i.splice(o,1),a=this.treeGridData.indexOf(n),this.treeGridData.splice(a,1),this.parent.ids.splice(a,1),-1!==this.parent.treeGrid.parentData.indexOf(n)&&this.parent.treeGrid.parentData.splice(this.parent.treeGrid.parentData.indexOf(n),1),"ResourceView"===this.parent.viewType)&&this.parent.getTaskIds().splice(o,1)}var a,l=this.treeGridData.indexOf(n);t.taskFields.parentID||(i=this.parent.editModule.getChildCount(n,0),this.treeGridData.splice(l,i+1),this.parent.ids.splice(l,i+1),-1!==(a=this.ganttData.indexOf(n.taskData))&&(this.ganttData.splice(a,1),this.parent.treeGrid.parentData.splice(a,1)),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(l,i+1)),n.parentItem&&e&&e.childRecords&&!e.childRecords.length&&(e.expanded=!1,e.hasChildRecords=!1)}},tKt.prototype.removeChildItem=function(e){for(var t,i=0;i<e.childRecords.length;i++){for(var n,o=e.childRecords[i],r=void 0,r=this.parent.dataSource instanceof me?R("dataOperation.dataArray",this.parent):this.parent.dataSource,s=0;s<r.length;s++)r[s][this.parent.taskFields.id]===o.taskData[this.parent.taskFields.id]&&(t=s);-1!==t&&(0<r.length&&r.splice(t,1),n=this.treeGridData.indexOf(o),this.treeGridData.splice(n,1),this.parent.ids.splice(n,1),"ResourceView"===this.parent.viewType)&&this.parent.getTaskIds().splice(t,1),o.hasChildRecords&&this.removeChildItem(o)}},tKt.prototype.reorderRows=function(e,t,i){if(!this.parent.readOnly&&e[0]!==t&&("above"===i||"below"===i||"child"===i)){"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment");for(var n=void 0,o=(this.parent.undoRedoModule&&(n=Pe([],[],[this.parent.undoRedoModule.currentAction],!0)[0]),[]),r=0;r<e.length;r++)this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&("RowDragAndDrop"===n.action||"TaskbarDragAndDrop"===n.action)?o[r]=n.beforeDrop[r].data:o[r]=this.parent.flatData[e[r]];i={data:o,dropIndex:t,dropPosition:this.dropPosition};this.dropRows(i,!0)}};Ir=tKt;function tKt(e){this.isTest=!1,this.updateParentRecords=[],this.isaddtoBottom=!1,this.updateCollection={},this.isSharedTask=!1,this.canDrop=!0,this.parent=e,eee.Inject(see),this.parent.treeGrid.allowRowDragAndDrop=this.parent.allowRowDragAndDrop,this.bindEvents()}Object.defineProperty(nKt.prototype,"style",{get:function(){return this.ganttStyle},enumerable:!0,configurable:!0}),nKt.prototype.setTheme=function(e,t){switch(this.initStyles(e),e.columnHeader.fontSize=9.5,e.columnHeader.fontColor=new se(0,0,0),e.columnHeader.fontColor.gray=.2,e.columnHeader.backgroundColor=new se(255,255,255),e.columnHeader.borderColor=new se(234,234,234),e.columnHeader.format.lineAlignment=1,e.columnHeader.format.alignment=0,e.fontFamily=dd.Helvetica,e.cell.fontSize=9.5,e.cell.backgroundColor=new se(255,255,255),e.cell.borderColor=new se(234,234,234),e.cell.fontColor=new se(0,0,0),e.cell.fontColor.gray=.2,e.cell.format.lineAlignment=1,e.cell.format.alignment=0,e.footer.fontSize=9.5,e.footer.fontStyle=0,e.footer.format.alignment=1,e.footer.format.lineAlignment=1,e.footer.borderColor=new se(235,235,235),e.timeline.fontSize=9.5,e.timeline.fontStyle=0,e.timeline.backgroundColor=new se(252,252,252),e.timeline.fontColor=new se(40,40,39),e.chartGridLineColor=new se(235,235,235),e.timeline.borderColor=new se(235,235,235),e.eventMarker.label.backgroundColor=new se(100,253,191),e.eventMarker.label.fontColor=new se(33,33,33),e.eventMarker.lineStyle=new Ep(new se(227,22,91)),e.eventMarker.lineStyle.dashStyle=Qh.Dash,e.holiday.backgroundColor=new se(238,238,238),t){case"Bootstrap":e.taskbar.taskColor=new se(49,122,185),e.taskbar.progressColor=new se(33,82,125),e.taskbar.criticalTaskColor=new se(255,139,139),e.taskbar.criticalProgressColor=new se(255,85,85),e.taskbar.baselineColor=new se(240,173,78),e.taskbar.baselineBorderColor=new se(240,173,78),e.criticalConnectorLineColor=new se(255,85,85),e.taskbar.criticalTaskBorderColor=new se(255,85,85),e.taskbar.parentTaskColor=new se(119,119,119),e.taskbar.parentProgressColor=new se(85,85,85),e.taskbar.taskBorderColor=new se(33,82,125),e.taskbar.parentTaskBorderColor=new se(85,85,85),e.taskbar.milestoneColor=new se(85,85,85),e.footer.fontColor=new se(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new se(33,82,125),e.footer.backgroundColor=new se(255,255,255),e.taskbar.progressFontColor=new se(255,255,255),e.label.fontColor=new se(0,0,0),e.taskbar.splitLineBackground=new se(51,51,51),e.taskbar.unscheduledTaskBarColor=new se(49,122,185),e.taskbar.manualParentBackground=new se(119,119,119),e.taskbar.manualParentProgress=new se(85,85,85),e.taskbar.manualChildBackground=new se(117,56,201),e.taskbar.manualChildProgress=new se(87,42,150),e.taskbar.manualLineColor=new se(152,154,156),e.taskbar.manualParentBorder=new se(85,85,85),e.taskbar.manualChildBorder=new se(87,42,150),e.eventMarker.label.backgroundColor=new se(138,109,59),e.eventMarker.label.fontColor=new se(252,248,227),e.eventMarker.lineStyle=new Ep(new se(49,122,185)),e.holiday.backgroundColor=new se(238,238,238);break;case"Bootstrap 4":e.taskbar.taskColor=new se(0,123,255),e.taskbar.progressColor=new se(0,86,179),e.taskbar.criticalTaskColor=new se(255,139,139),e.taskbar.criticalProgressColor=new se(255,85,85),e.taskbar.baselineColor=new se(255,193,7),e.taskbar.baselineBorderColor=new se(255,193,7),e.criticalConnectorLineColor=new se(255,85,85),e.taskbar.criticalTaskBorderColor=new se(255,85,85),e.taskbar.parentTaskColor=new se(108,117,125),e.taskbar.parentProgressColor=new se(73,80,87),e.taskbar.taskBorderColor=new se(0,86,179),e.taskbar.parentTaskBorderColor=new se(73,80,87),e.taskbar.milestoneColor=new se(73,80,87),e.footer.fontColor=new se(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new se(0,86,179),e.footer.backgroundColor=new se(255,255,255),e.taskbar.progressFontColor=new se(255,255,255),e.label.fontColor=new se(33,37,41),e.taskbar.splitLineBackground=new se(0,0,0),e.taskbar.unscheduledTaskBarColor=new se(0,123,255),e.taskbar.manualParentBackground=new se(108,117,125),e.taskbar.manualParentProgress=new se(73,80,87),e.taskbar.manualChildBackground=new se(133,83,241),e.taskbar.manualChildProgress=new se(102,40,238),e.taskbar.manualLineColor=new se(152,154,156),e.taskbar.manualParentBorder=new se(73,80,87),e.taskbar.manualChildBorder=new se(102,40,238),e.eventMarker.label.backgroundColor=new se(255,193,7),e.eventMarker.label.fontColor=new se(0,0,0),e.eventMarker.lineStyle=new Ep(new se(0,123,255)),e.holiday.backgroundColor=new se(233,236,239);break;case"Fabric":e.columnHeader.fontColor=new se(102,102,102),e.cell.fontColor=new se(51,51,51),e.taskbar.taskColor=new se(0,120,214),e.taskbar.progressColor=new se(0,91,163),e.taskbar.criticalTaskColor=new se(255,139,139),e.taskbar.criticalProgressColor=new se(255,85,85),e.taskbar.baselineColor=new se(216,59,1),e.taskbar.baselineBorderColor=new se(216,59,1),e.criticalConnectorLineColor=new se(255,85,85),e.taskbar.criticalTaskBorderColor=new se(255,85,85),e.taskbar.parentTaskColor=new se(118,118,118),e.taskbar.parentProgressColor=new se(80,80,80),e.taskbar.taskBorderColor=new se(0,91,163),e.taskbar.parentTaskBorderColor=new se(80,80,80),e.taskbar.milestoneColor=new se(80,80,80),e.footer.fontColor=new se(51,51,51),e.footer.fontColor.gray=.2,e.connectorLineColor=new se(0,69,122),e.footer.backgroundColor=new se(255,255,255),e.taskbar.progressFontColor=new se(255,255,255),e.label.fontColor=new se(51,51,51),e.taskbar.splitLineBackground=new se(0,0,0),e.taskbar.unscheduledTaskBarColor=new se(0,120,214),e.taskbar.manualParentBackground=new se(118,118,118),e.taskbar.manualParentProgress=new se(80,80,80),e.taskbar.manualChildBackground=new se(154,56,186),e.taskbar.manualChildProgress=new se(109,24,136),e.taskbar.manualLineColor=new se(152,154,156),e.taskbar.manualParentBorder=new se(80,80,80),e.taskbar.manualChildBorder=new se(109,24,136),e.eventMarker.label.backgroundColor=new se(202,232,255),e.eventMarker.label.fontColor=new se(0,90,158),e.eventMarker.lineStyle=new Ep(new se(0,120,214)),e.holiday.backgroundColor=new se(244,244,244);break;default:e.taskbar.taskColor=new se(88,105,197),e.taskbar.progressColor=new se(63,81,181),e.taskbar.criticalTaskColor=new se(255,139,139),e.taskbar.criticalProgressColor=new se(255,85,85),e.taskbar.baselineColor=new se(193,87,0),e.taskbar.baselineBorderColor=new se(193,87,0),e.criticalConnectorLineColor=new se(255,85,85),e.taskbar.criticalTaskBorderColor=new se(255,85,85),e.taskbar.parentTaskColor=new se(132,132,132),e.taskbar.parentProgressColor=new se(97,97,97),e.taskbar.taskBorderColor=new se(63,81,181),e.taskbar.parentTaskBorderColor=new se(51,51,51),e.taskbar.milestoneColor=new se(97,97,97),e.footer.fontColor=new se(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new se(63,81,181),e.footer.backgroundColor=new se(255,255,255),e.taskbar.progressFontColor=new se(255,255,255),e.label.fontColor=new se(51,51,51),e.taskbar.splitLineBackground=new se(0,0,0),e.taskbar.unscheduledTaskBarColor=new se(63,81,181),e.taskbar.manualParentBackground=new se(97,97,97),e.taskbar.manualParentProgress=new se(97,97,97),e.taskbar.manualChildBackground=new se(0,135,134),e.taskbar.manualChildProgress=new se(0,135,134),e.taskbar.manualLineColor=new se(152,154,156),e.taskbar.manualParentBorder=new se(97,97,97),e.taskbar.manualChildBorder=new se(0,135,134),e.eventMarker.label.backgroundColor=new se(253,191,100),e.eventMarker.label.fontColor=new se(33,33,33),e.eventMarker.lineStyle=new Ep(new se(227,22,91)),e.holiday.backgroundColor=new se(238,238,238)}},nKt.prototype.initStyles=function(e){e.columnHeader={},e.columnHeader.format=new xd,e.cell={},e.cell.format=new xd,e.timeline={},e.footer={},e.footer.format=new xd,e.label={},e.taskbar={},e.eventMarker={},e.eventMarker.label={},e.eventMarker.lineStyle=new Ep(null),e.holiday={}};var iKt=nKt;function nKt(e){this.theme=e,this.ganttStyle={},this.setTheme(this.ganttStyle,this.theme),this.ganttStyle.eventMarker.lineStyle.dashStyle=Qh.Dash}rKt.prototype.size=function(){return this.mKeys.length},rKt.prototype.add=function(e,t){if(null==e||null==t)throw new ReferenceError("Provided key or value is not valid.");if(this.mKeys.indexOf(e)<0)return this.mKeys.push(e),this.mValues.push(t),1;throw new RangeError("An item with the same key has already been added.")},rKt.prototype.keys=function(){return this.mKeys},rKt.prototype.values=function(){return this.mValues},rKt.prototype.getValue=function(e){if(null==e)throw new ReferenceError("Provided key is not valid.");e=this.mKeys.indexOf(e);if(e<0)throw new RangeError("No item with the specified key has been added.");return this.mValues[e]},rKt.prototype.setValue=function(e,t){if(null==e)throw new ReferenceError("Provided key is not valid.");var i=this.mKeys.indexOf(e);i<0?(this.mKeys.push(e),this.mValues.push(t)):this.mValues[i]=t},rKt.prototype.remove=function(e){if(null==e)throw new ReferenceError("Provided key is not valid.");e=this.mKeys.indexOf(e);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},rKt.prototype.containsKey=function(e){if(null==e)throw new ReferenceError("Provided key is not valid.");return!(this.mKeys.indexOf(e)<0)},rKt.prototype.clear=function(){this.mKeys=[],this.mValues=[]};var oKt=rKt;function rKt(){this.mKeys=[],this.mValues=[]}Object.defineProperty(aKt.prototype,"left",{get:function(){return this.leftPen},set:function(e){this.leftPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(aKt.prototype,"right",{get:function(){return this.rightPen},set:function(e){this.rightPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(aKt.prototype,"top",{get:function(){return this.topPen},set:function(e){this.topPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(aKt.prototype,"bottom",{get:function(){return this.bottomPen},set:function(e){this.bottomPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(aKt.prototype,"all",{set:function(e){this.leftPen=this.rightPen=this.topPen=this.bottomPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(aKt.prototype,"isAll",{get:function(){return this.leftPen===this.rightPen&&this.leftPen===this.topPen&&this.leftPen===this.bottomPen},enumerable:!0,configurable:!0}),Object.defineProperty(aKt,"default",{get:function(){return new aKt},enumerable:!0,configurable:!0});var sKt=aKt;function aKt(){var e=new Ep(new se(0,0,0)),t=(e.dashStyle=Qh.Solid,new Ep(new se(0,0,0))),i=(t.dashStyle=Qh.Solid,new Ep(new se(0,0,0))),n=(i.dashStyle=Qh.Solid,new Ep(new se(0,0,0)));n.dashStyle=Qh.Solid,this.leftPen=e,this.rightPen=t,this.topPen=i,this.bottomPen=n}Object.defineProperty(hKt.prototype,"left",{get:function(){return this.leftPad},set:function(e){this.leftPad=e,this.hasLeftPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(hKt.prototype,"right",{get:function(){return this.rightPad},set:function(e){this.rightPad=e,this.hasRightPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(hKt.prototype,"top",{get:function(){return this.topPad},set:function(e){this.topPad=e,this.hasTopPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(hKt.prototype,"bottom",{get:function(){return this.bottomPad},set:function(e){this.bottomPad=e,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(hKt.prototype,"all",{set:function(e){this.leftPad=this.rightPad=this.topPad=this.bottomPad=e,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0},enumerable:!0,configurable:!0});var lKt=hKt;function hKt(e,t,i,n){this.hasLeftPad=!1,this.hasRightPad=!1,this.hasTopPad=!1,this.hasBottomPad=!1,void 0===e?(this.leftPad=this.rightPad=5.76,this.bottomPad=this.topPad=.5):(this.leftPad=e,this.rightPad=t,this.topPad=i,this.bottomPad=n,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0)}function dKt(){}var pKt,cKt,uKt=function(){this.cellSpacing=0,this.borderOverlapStyle=tf.Overlap,this.allowHorizontalOverflow=!1,this.horizontalOverflowType=yXt.LastPage,this.cellPadding=new lKt},bk=(pKt=function(e,t){return(pKt=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])}))(e,t)},function(e,t){function i(){this.constructor=e}pKt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),gKt=(bk(mKt,cKt=Dg),Object.defineProperty(mKt.prototype,"treegrid",{get:function(){return this.elements},enumerable:!0,configurable:!0}),mKt.prototype.layoutInternal=function(e){if(je(e))throw Error("Argument Null Expection");this.currentPage=e.page;var t=e.format;if(null!==this.currentPage&&(this.currentPageBounds=this.currentPage.getClientSize()),this.currentGraphics=this.currentPage.graphics,null!==t&&t.break===Kc.FitColumnsToPage?this.currentBounds=new id(new ed(e.bounds.x,e.bounds.y),new td(this.treegrid.columns.width,this.currentGraphics.clientSize.height)):this.currentBounds=new id(new ed(e.bounds.x,e.bounds.y),this.currentGraphics.clientSize),0===this.treegrid.rows.count)throw Error("Please add row or header into grid");return this.currentBounds.width=0<e.bounds.width?e.bounds.width:this.currentBounds.width-this.treegrid.rows.getRow(0).cells.getCell(0).style.borders.left.width/2,this.startLocation=new ed(e.bounds.x,e.bounds.y),0<e.bounds.height&&(this.currentBounds.height=e.bounds.height),this.treegrid.style.allowHorizontalOverflow||this.treegrid.isFitToWidth?(this.treegrid.measureColumnsWidth(this.currentBounds),this.columnRanges.push([0,this.treegrid.columns.count-1])):(this.treegrid.measureColumnsWidth(),this.determineColumnDrawRanges()),this.layoutOnPage(e)},mKt.prototype.determineColumnDrawRanges=function(){for(var e=0,t=0,i=0,n=this.treegrid.taskbar.isAutoFit()?mqt(this.currentGraphics.clientSize.width)-this.currentBounds.x:this.currentGraphics.clientSize.width-this.currentBounds.x,o=0;o<this.treegrid.columns.count;o++)if(n<=(i+=this.treegrid.columns.getColumn(o).width)){for(var r=0,s=e;s<=o&&!(n<(r+=this.treegrid.columns.getColumn(s).width));s++)t=s;this.columnRanges.push([e,t]),e=t+1,i=t<=o?this.treegrid.columns.getColumn(o).width:0}this.columnRanges.push([e,this.treegrid.columns.count-1])},mKt.prototype.getFormat=function(e){return e},mKt.prototype.layoutOnPage=function(e){for(var t=this.getFormat(e.format),i=new oKt,n=e.page,o=0;o<this.columnRanges.length;o++){for(var r=this.columnRanges[o],s=(this.cellStartIndex=r[0],this.cellEndIndex=r[1],this.treegrid.rows.count),a=0,l=!1,h=0;h<s;h++){var d=this.treegrid.rows.getRow(h),p=(a++,this.currentBounds.y),c=(null===this.currentPage||i.containsKey(this.currentPage)||i.add(this.currentPage,r),this.drawRow(d));for(p===this.currentBounds.y?(l=!0,this.repeatRowIndex=this.treegrid.rows.rowCollection.indexOf(d)):(l=!1,this.repeatRowIndex=-1);!c.isFinish&&null!==n;)if(this.treegrid.allowRowBreakAcrossPages)this.currentPage=this.getNextPageFormat(t),this.treegrid.enableHeader&&this.drawHeader(),this.checkBounds(t),c=this.drawRow(d);else{if(!this.treegrid.allowRowBreakAcrossPages&&a<length){this.currentPage=this.getNextPageFormat(t),this.treegrid.enableHeader&&this.drawHeader();break}if(a>=length)break}!c.isFinish&&null!==n&&t.layout!==Xc.OnePage&&l&&(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageFormat(t),this.treegrid.enableHeader&&this.drawHeader(),this.startLocation.y=this.currentBounds.y,t.paginateBounds===new id(0,0,0,0)&&(this.currentBounds.x+=this.startLocation.x),this.currentBounds.x===sKt.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.drawRow(d),null===this.currentPage||i.containsKey(this.currentPage)||i.add(this.currentPage,r))}this.columnRanges.indexOf(r)<this.columnRanges.length-1&&null!==n&&t.layout!==Xc.OnePage&&(this.currentPage=this.getNextPageFormat(t),this.checkBounds(t))}return e=this.getLayoutResult(),this.treegrid.style.allowHorizontalOverflow&&this.treegrid.style.horizontalOverflowType===yXt.NextPage&&this.reArrangePages(i),e},mKt.prototype.checkBounds=function(e){var t=new ed(sKt.default.right.width/2,sKt.default.top.width/2);e.paginateBounds===new id(0,0,0,0)&&this.startLocation===t&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y)},mKt.prototype.drawHeader=function(){this.drawRow(this.treegrid.rows.getRow(0))},mKt.prototype.reArrangePages=function(e){for(var t=this.currentPage.document,i=[],n=e.keys(),o=0;o<n.length;o++)(a=n[o]).section=null,i.push(a),t.pages.remove(a);for(o=0;o<e.size();o++)for(var r=e.size()/this.columnRanges.length,s=o;s<e.size();s+=r){var a=i[s];-1===t.pages.indexOf(a)&&t.pages.add(a)}},mKt.prototype.getNextPageFormat=function(e){var t=this.currentPage.section,i=null,n=t.indexOf(this.currentPage),i=n===t.count-1?t.add():t.getPages()[n+1];return this.currentGraphics=i.graphics,this.currentBounds=new id(new ed(0,0),i.getClientSize()),i},mKt.prototype.getLayoutResult=function(){var e=new id(this.startLocation,new td(this.currentBounds.width,this.currentBounds.y-this.startLocation.y));return new yKt(this.currentPage,e)},mKt.prototype.checkIfDefaultFormat=function(e){var t=new xd;return e.alignment===t.alignment&&e.characterSpacing===t.characterSpacing&&e.clipPath===t.clipPath&&e.firstLineIndent===t.firstLineIndent&&e.horizontalScalingFactor===t.horizontalScalingFactor&&e.lineAlignment===t.lineAlignment&&e.lineLimit===t.lineLimit&&e.lineSpacing===t.lineSpacing&&e.measureTrailingSpaces===t.measureTrailingSpaces&&e.noClip===t.noClip&&e.paragraphIndent===t.paragraphIndent&&e.rightToLeft===t.rightToLeft&&e.subSuperScript===t.subSuperScript&&e.wordSpacing===t.wordSpacing&&e.wordWrap===t.wordWrap},mKt.prototype.drawRow=function(e,t,i){var n;if(je(t))return n=new gy,(i=0<e.rowBreakHeight?e.rowBreakHeight:e.height)>this.currentPageBounds.height?this.treegrid.allowRowBreakAcrossPages?(n.isFinish=!0,this.drawRowWithBreak(n,e,i)):(n.isFinish=!1,this.drawRow(e,n,i)):this.currentBounds.y+i>this.currentPageBounds.height||this.currentBounds.y+i>this.currentBounds.height?-1<this.repeatRowIndex&&this.repeatRowIndex===e.rowIndex?this.treegrid.allowRowBreakAcrossPages?(n.isFinish=!0,this.drawRowWithBreak(n,e,i)):(n.isFinish=!1,this.drawRow(e,n,i)):n.isFinish=!1:(n.isFinish=!0,this.drawRow(e,n,i)),n;var o=new ed(this.currentBounds.x,this.currentBounds.y),r=(t.bounds=new id(o,new td(0,0)),0);i=this.reCalculateHeight(e,i);for(var s=this.cellStartIndex;s<=this.cellEndIndex;s++){var a=e.cells.getCell(s),l=this.treegrid.columns.getColumn(s);if(!je(a.value)){l.isTreeColumn&&(r=10*e.level);var h=1<a.columnSpan&&s>this.cellEndIndex+1;if(!h)for(var d=1;d<a.columnSpan;d++)e.cells.getCell(s+d).isCellMergeContinue=!0;var p=new td(l.width,i);1<a.columnSpan&&(p=new td(a.width,i),s+=a.columnSpan),!this.checkIfDefaultFormat(l.format)&&this.checkIfDefaultFormat(a.style.format)&&(a.style.format=l.format),a.draw(this.currentGraphics,new id(o,p),h,r),e.treegrid.style.allowHorizontalOverflow&&(a.columnSpan>this.cellEndIndex||s+a.columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<e.cells.count-1&&(e.rowOverflowIndex=this.cellEndIndex),o.x+=l.width,r=0}}return this.currentBounds.y+=i,t.bounds=new id(new ed(t.bounds.x,t.bounds.y),new td(o.x,o.y)),null},mKt.prototype.drawRowWithBreak=function(e,t,i){var n=new ed(this.currentBounds.x,this.currentBounds.y),o=(e.bounds=new id(n,new td(0,0)),0);this.treegridHeight=this.currentBounds.height,t.rowBreakHeight=this.currentBounds.y+i-this.currentBounds.height;for(var r=0;r<t.cells.count;r++)(l=t.cells.getCell(r)).measureHeight()===i&&null===l.value&&(t.rowBreakHeight=this.currentBounds.y+i-this.currentBounds.height);for(var s=this.cellStartIndex;s<=this.cellEndIndex;s++){var a=this.treegrid.columns.getColumn(s);a.isTreeColumn&&(o=10*t.level);var l,h=(l=t.cells.getCell(s)).columnSpan+s>this.cellEndIndex+1&&1<l.columnSpan;if(!h)for(var d=1;d<l.columnSpan;d++)t.cells.getCell(s+d).isCellMergeContinue=!0;var p=0<this.treegridHeight?this.treegridHeight:this.currentBounds.height,p=new td(a.width,p);!this.checkIfDefaultFormat(a.format)&&this.checkIfDefaultFormat(l.style.format)&&(l.style.format=a.format),l.draw(this.currentGraphics,new id(n,p),h,o),e.isFinish=e.isFinish&&l.finishedDrawingCell,n.x+=a.width,this.currentBounds.y+=(o=0)<this.treegridHeight?this.treegridHeight:i,e.bounds=new id(new ed(e.bounds.x,e.bounds.y),new td(n.x,n.y))}},mKt.prototype.reCalculateHeight=function(e,t){for(var i=0,n=this.cellStartIndex;n<=this.cellEndIndex;n++)je(e.cells.getCell(n).remainingString)&&""!==e.cells.getCell(n).remainingString||(i=Math.max(i,e.cells.getCell(n).measureHeight()));return Math.max(t,i)},mKt);function mKt(e){e=cKt.call(this,e)||this;return e.columnRanges=[],e.repeatRowIndex=-1,e.currentBounds=new id(0,0,0,0),e}bk(vKt,fKt=Lg);var fKt,yKt=vKt;function vKt(e,t){return fKt.call(this,e,t)||this}bk(CKt,bKt=kg);var bKt,wKt=CKt;function CKt(e){return void 0===e?bKt.call(this)||this:bKt.call(this,e)||this}SKt=function(e,t){return(SKt=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}SKt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(IKt,AKt=Hg),Object.defineProperty(IKt.prototype,"size",{get:function(){return 0===this.treeGridSize.width&&0===this.treeGridSize.height&&(this.treeGridSize=this.calculateTreeGridSize()),this.treeGridSize},set:function(e){this.treeGridSize=e},enumerable:!0,configurable:!0}),IKt.prototype.draw=function(e,t,i,n){var o;return t instanceof ed&&void 0===t.width&&void 0===i?this.drawHelper(e,t.x,t.y):"number"==typeof t&&"number"==typeof i&&void 0===n?this.drawHelper(e,t,i,null):t instanceof id&&void 0!==t.width&&void 0===i?this.drawHelper(e,t,null):t instanceof ed&&void 0===t.width&&i instanceof kg?this.drawHelper(e,t.x,t.y,i):"number"==typeof t&&"number"==typeof i&&(n instanceof kg||null===n)?(o=e.graphics.clientSize.width-t,o=new id(t,i,o,0),this.drawHelper(e,o,n)):t instanceof id&&void 0!==t.width&&"boolean"==typeof i?this.drawHelper(e,t,null):this.drawHelper(e,t,i)},IKt.prototype.measureColumnsWidth=function(e){if(void 0!==e)for(var t=this.columns.getDefaultWidths(e.width-e.x),i=0;i<this.columns.count;i++)this.columns.getColumn(i).width<0&&(this.columns.getColumn(i).width=t[i]);else{for(var t=[],n=0,o=0,r=this.columns.count,i=0;i<r;i++){for(var s=this.rows.count,a=0;a<s;a++){var l=this.rows.getRow(a).cells.getCell(i).width,l=0<this.initialWidth?Math.min(this.initialWidth,l):l,n=Math.max(n,l);n=Math.max(this.columns.getColumn(i).width,n),this.columns.getColumn(i).isTreeColumn&&(o=Math.max(o,this.rows.getRow(a).level))}this.columns.getColumn(i).isTreeColumn?t.push(n+10*o):t.push(n),n=0}for(i=0;i<this.columns.count;i++)this.columns.getColumn(i).width<0&&(this.columns.getColumn(i).width=t[i])}},IKt.prototype.calculateTreeGridSize=function(){for(var e=0,t=this.columns.width,i=0;i<this.headers.count;i++)e+=this.headers.getHeader(i).height;for(i=0;i<this.rows.count;i++)e+=this.rows.getRow(i).height;return new td(t,e)},IKt.prototype.drawGrid=function(e,t,i,n){this.initialWidth=e.graphics.clientSize.width;var o=new id(0,0,e.getClientSize().height,0);return this.draw(e,o,n)},IKt.prototype.layout=function(e){var t,i;return 0===this.rows.count||je(t=0!==this.rows.getRow(0).cells.count?this.rows.getRow(0).cells.getCell(0).style:null)||1===t.borders.left.width||(i=t.borders.left.width/2,t=t.borders.top.width/2,e.bounds.x===sKt.default.right.width/2&&e.bounds.y===sKt.default.right.width/2&&(i=new id(new ed(i,t),new td(this.size.width,this.size.height)),e.bounds=i)),this.layouter=new gKt(this),this.layouter.layoutInternal(e)};var SKt,AKt,xKt=IKt;function IKt(){var e=AKt.call(this)||this;return e.treeGridSize=new td(0,0),e.treeColumnIndex=0,e.allowRowBreakAcrossPages=!0,e.enableHeader=!0,e.isFitToWidth=!1,e.columns=new VKt(e),e.rows=new BKt(e),e.headers=new LKt(e),e.style=new uKt,e.rowHeight=0,e}Object.defineProperty(EKt.prototype,"height",{get:function(){return 0===this.cellHeight&&(this.cellHeight=this.measureHeight()),this.cellHeight},set:function(e){this.cellHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(EKt.prototype,"width",{get:function(){return 0===this.cellWidth&&(this.cellWidth=this.measureWidth()),Math.round(this.cellWidth)},set:function(e){this.cellWidth=e},enumerable:!0,configurable:!0}),EKt.prototype.measureWidth=function(){var e,t=0,i=new Dd;return"string"==typeof this.value&&(e=new cg(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle),e=this.row.isParentRow?new cg(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,hd.Bold):new cg(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle),this.row.treegrid.ganttStyle.font&&(e=this.row.treegrid.ganttStyle.font),t=(t+=i.layout(this.value,e,this.style.format,new td(Number.MAX_VALUE,Number.MAX_VALUE),!1,new td(0,0)).actualSize.width)+2*(this.style.borders.left.width+this.style.borders.right.width)),void 0!==this.row.treegrid.style.cellPadding.left&&this.row.treegrid.style.cellPadding.hasLeftPad&&(t+=this.row.treegrid.style.cellPadding.left),void 0!==this.row.treegrid.style.cellPadding.right&&this.row.treegrid.style.cellPadding.hasRightPad&&(t+=this.row.treegrid.style.cellPadding.right),t+=this.row.treegrid.style.cellSpacing},EKt.prototype.measureHeight=function(){var e,t,i=this.row.treegrid.rowHeight,n=0,o=this.calculateWidth(),r=(o=(o-=this.row.treegrid.style.cellPadding.right+this.row.treegrid.style.cellPadding.left)-(this.style.borders?this.style.borders.left.width+this.style.borders.right.width:0),new Dd);return"string"!=typeof this.value&&"string"!=typeof this.remainingString||(e=this.value,this.finishedDrawingCell||(e=je(this.remainingString)||""===this.remainingString?this.value:this.remainingString),t=null,t=this.row.isParentRow?new cg(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,hd.Bold):new cg(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle),this.row.treegrid.ganttStyle.font&&(t=this.row.treegrid.ganttStyle.font),r=r.layout(e,t,this.style.format,new td(o-10,0),!1,new td(0,0)),t=Math.max(r.lineHeight,r.actualSize.height),80<e.length?n+=t+20:n+=t+r.size.height/2,n+=2*(this.style.borders.top.width+this.style.borders.bottom.width)),i<(n=(n+=this.row.treegrid.style.cellPadding.top+this.row.treegrid.style.cellPadding.bottom)+this.row.treegrid.style.cellSpacing)?n:i},EKt.prototype.calculateWidth=function(){for(var e=this.row.cells.indexOf(this),t=this.columnSpan,i=0,n=0;n<t;n++)i+=this.row.treegrid.columns.getColumn(e+n)?this.row.treegrid.columns.getColumn(e+n).width:0;return this.row.treegrid.columns.getColumn(e)&&this.row.treegrid.columns.getColumn(e).isTreeColumn&&(i-=10*this.row.level),i},EKt.prototype.draw=function(e,t,i,n){var o,r,s,a,l,h=null,d=(this.drawCellBackground(e,t),new Sd(this.style.fontColor)),p=null,p=this.row.isParentRow?(c=hd.Bold,this.style.fontStyle&&(c=this.style.fontStyle),new cg(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,c)):new cg(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle),c=(this.row.treegrid.ganttStyle.font&&(p=this.row.treegrid.ganttStyle.font),t);return this.isHeaderCell||(c.x=c.x,c.width=c.width),c.height>=e.clientSize.height&&(this.row.treegrid.allowRowBreakAcrossPages?(c.height-=c.y,t.height-=t.y):(c.height=e.clientSize.height,t.height=e.clientSize.height)),c=this.adjustContentLayoutArea(c),this.image&&this.value?(l=void 0,l=this.image.width<=c.width?new id(c.x,c.y,this.image.width,this.image.height):c,e.drawImage(this.image,l.x,l.y-5,l.width,l.height),o=null,r=void 0,a=(a=this.fontStyle)||this.style,s=new cg(a.fontFamily,a.fontSize,a.fontStyle),r=a.fontFamily?s:p,a=d,this.row.treegrid.ganttStyle.cell.fontBrush&&(a=new Sd(this.row.treegrid.ganttStyle.cell.fontBrush)),this.row.treegrid.ganttStyle.cell.format.alignment&&!this.isHeaderCell&&(this.style.format.alignment=this.row.treegrid.ganttStyle.cell.format.alignment),this.finishedDrawingCell?(o=""===this.remainingString?this.remainingString:this.value,e.drawString(o,r,null,a,c.x+n+(this.isHeaderCell&&l.width?l.width+8:0),this.isHeaderCell?c.y-16:c.y,c.width-n-10,c.height-10,this.style.format)):e.drawString(this.remainingString,r,null,a,c.x+n,this.isHeaderCell?c.y-16:c.y,this.style.format),h=e.stringLayoutResult):"string"==typeof this.value||"string"==typeof this.remainingString?(o=null,r=void 0,s=new cg(this.style.fontFamily,this.style.fontSize,this.style.fontStyle),r=this.style.fontFamily?s:p,a=d,this.row.treegrid.ganttStyle.cell.fontBrush&&(a=new Sd(this.row.treegrid.ganttStyle.cell.fontBrush)),this.row.treegrid.ganttStyle.cell.format.alignment&&!this.isHeaderCell&&(this.style.format.alignment=this.row.treegrid.ganttStyle.cell.format.alignment),this.finishedDrawingCell?(o=""===this.remainingString?this.remainingString:this.value,e.drawString(o,r,null,a,c.x+n,this.isHeaderCell?c.y-16:c.y-3,c.width-n-10,c.height-10,this.style.format)):e.drawString(this.remainingString,r,null,a,c.x+n,this.isHeaderCell?c.y-16:c.y,this.style.format),h=e.stringLayoutResult):this.value instanceof ec||this.value instanceof oc?(l=void 0,l=this.value.width<=c.width?new id(c.x,c.y,this.value.width,c.height):c,e.drawImage(this.value,l.x,l.y-10,l.width,l.height)):this.value instanceof am&&this.value.draw(e.currentPage,c),null!==this.style.borders&&this.drawCellBorder(e,t),h},EKt.prototype.drawCellBackground=function(e,t){var i=new Sd(this.style.backgroundColor);null!==i&&(e.save(),e.drawRectangle(i,t.x,t.y,t.width,t.height),e.restore())},EKt.prototype.adjustContentLayoutArea=function(e){var t,e=new id(new ed(e.x,e.y),new td(e.width,e.height)),i=this.style.padding;return this.value instanceof xKt?(t=this.value.size,this.style.format.alignment===Hh.Center?(e.x+=i.left+(e.width-t.width)/2,e.y+=i.top+(e.height-t.height)/2):this.style.format.alignment===Hh.Left?(e.x+=i.left,e.y+=i.top):this.style.format.alignment===Hh.Right&&(e.x+=i.left+(e.width-t.width),e.y+=i.top)):(e.x+=i.left,e.y+=i.top),e},EKt.prototype.drawCellBorder=function(e,t){var i,n,o;this.row.treegrid.style.borderOverlapStyle===tf.Inside&&(t.x+=this.style.borders.left.width,t.y+=this.style.borders.top.width,t.width-=this.style.borders.right.width,t.height-=this.style.borders.bottom.width),this.style.borders.isAll&&this.isHeaderCell?e.drawRectangle(this.style.borders.left,t.x,t.y,t.width,t.height):(i=new ed(t.x,t.y+t.height),n=new ed(t.x,t.y),(o=this.style.borders.left).lineCap=this.style.borders.left.dashStyle===Qh.Solid?Wh.Square:o.lineCap,e.drawLine(o,i,n),e.restore(),i=new ed(t.x+t.width,t.y),n=new ed(t.x+t.width,t.y+t.height),o=this.style.borders.right,t.x+t.width>e.clientSize.width-o.width/2&&(i=new ed(e.clientSize.width-o.width/2,t.y),n=new ed(e.clientSize.width-o.width/2,t.y+t.height)),o.lineCap=this.style.borders.right.dashStyle===Qh.Solid?Wh.Square:o.lineCap,e.drawLine(o,i,n),e.restore(),i=new ed(t.x,t.y),n=new ed(t.x+t.width,t.y),(o=this.style.borders.top).lineCap=this.style.borders.top.dashStyle===Qh.Solid?Wh.Square:o.lineCap,e.drawLine(o,i,n),e.restore(),i=new ed(t.x+t.width,t.y+t.height),n=new ed(t.x,t.y+t.height),o=this.style.borders.bottom,t.y+t.height>e.clientSize.height-o.width/2&&(i=new ed(t.x+t.width,e.clientSize.height-o.width/2),n=new ed(t.x,e.clientSize.height-o.width/2)),o.lineCap=this.style.borders.bottom.dashStyle===Qh.Solid?Wh.Square:o.lineCap,e.drawLine(o,i,n)),e.restore()};var TKt=EKt;function EKt(e){this.cellWidth=0,this.cellHeight=0,this.finishedDrawingCell=!0,je(e)?(this.rowSpan=1,this.columnSpan=1):this.row=e,this.style={}}MKt.prototype.getCell=function(e){if(e<0||e>=this.count)throw new Error("IndexOutOfRangeException");return this.cells[e]},Object.defineProperty(MKt.prototype,"count",{get:function(){return this.cells.length},enumerable:!0,configurable:!0}),MKt.prototype.add=function(e){var t;if(void 0===e)return t=new TKt,this.add(t),e;e.row=this.treegridRow,this.cells.push(e)},MKt.prototype.indexOf=function(e){return this.cells.indexOf(e)};var DKt=MKt;function MKt(e){this.treegridRow=e,this.cells=[]}Object.defineProperty(PKt.prototype,"cells",{get:function(){return je(this.treegridCells)&&(this.treegridCells=new DKt(this)),this.treegridCells},enumerable:!0,configurable:!0}),Object.defineProperty(PKt.prototype,"isParentRow",{get:function(){return this._isParentRow},set:function(e){this._isParentRow=e},enumerable:!0,configurable:!0}),Object.defineProperty(PKt.prototype,"treegrid",{get:function(){return this.pdfTreeGrid},set:function(e){this.pdfTreeGrid=e},enumerable:!0,configurable:!0}),Object.defineProperty(PKt.prototype,"rowBreakHeight",{get:function(){return void 0===this.treegridRowBreakHeight&&(this.treegridRowBreakHeight=0),this.treegridRowBreakHeight},set:function(e){this.treegridRowBreakHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(PKt.prototype,"rowOverflowIndex",{get:function(){return this.treegridRowOverflowIndex},set:function(e){this.treegridRowOverflowIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(PKt.prototype,"level",{get:function(){return this.intendLevel},set:function(e){this.intendLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(PKt.prototype,"height",{get:function(){return 0===this.rowHeight&&(this.rowHeight=this.measureHeight()),this.rowHeight},set:function(e){this.rowHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(PKt.prototype,"width",{get:function(){return 0===this.rowWidth&&(this.rowWidth=this.measureWidth()),this.rowWidth},enumerable:!0,configurable:!0}),Object.defineProperty(PKt.prototype,"rowIndex",{get:function(){return this.treegrid.rows.rowCollection.indexOf(this)},enumerable:!0,configurable:!0}),PKt.prototype.measureWidth=function(){for(var e=this.treegrid.columns.columns,t=0,i=0;i<e.length;i++)t+=e[i].width;return t},PKt.prototype.measureHeight=function(){for(var e=0===this.cells.count||je(this.cells.getCell(0).height)?33:this.cells.getCell(0).height,t=0;t<this.cells.count;t++){var i=this.cells.getCell(t),e=1===i.columnSpan||1===i.rowSpan?Math.max(e,i.height):Math.min(e,i.height);i.height=e}return e};var kKt=PKt;function PKt(e){this.treegridRowOverflowIndex=0,this.rowHeight=0,this.rowWidth=0,this._isParentRow=!1,this.intendLevel=0,this.pdfTreeGrid=e}Object.defineProperty(FKt.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),Object.defineProperty(FKt.prototype,"rowCollection",{get:function(){return this.rows},enumerable:!0,configurable:!0}),FKt.prototype.addRow=function(e){var t;if(void 0===e)return t=new kKt(this.treegrid),this.addRow(t),t;if(0===e.cells.count)for(var i=0;i<this.treegrid.columns.count;i++)e.cells.add(new TKt);this.rows.push(e)},FKt.prototype.getRow=function(e){return this.rows[e]};var BKt=FKt;function FKt(e){this.rows=[],this.treegrid=e}RKt.prototype.getHeader=function(e){return this.rows[e]},Object.defineProperty(RKt.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),RKt.prototype.add=function(e){this.rows.push(e)},RKt.prototype.indexOf=function(e){return this.rows.indexOf(e)};var LKt=RKt;function RKt(e){this.rows=[],this.treegrid=e,this.rows=[]}Object.defineProperty(NKt.prototype,"headerText",{get:function(){return this._headerText},set:function(e){this._headerText=e},enumerable:!0,configurable:!0}),Object.defineProperty(NKt.prototype,"field",{get:function(){return this._field},set:function(e){this._field=e},enumerable:!0,configurable:!0}),Object.defineProperty(NKt.prototype,"width",{get:function(){return this.columnWidth},set:function(e){this.columnWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(NKt.prototype,"isTreeColumn",{get:function(){return this.treeColumnIndex},set:function(e){this.treeColumnIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(NKt.prototype,"format",{get:function(){return je(this.stringFormat)&&(this.stringFormat=new xd),this.stringFormat},set:function(e){this.stringFormat=e},enumerable:!0,configurable:!0});var OKt=NKt;function NKt(e){this.columnWidth=0,this.treeColumnIndex=!1,this._headerText="",this._field="",this.treegrid=e}_Kt.prototype.add=function(e){for(var t=0;t<e;t++){this.internalColumns.push(new OKt(this.treegrid));for(var i=0;i<this.treegrid.rows.count;i++){var n=this.treegrid.rows.getRow(i),o=new TKt;o.value="",n.cells.add(o)}}},Object.defineProperty(_Kt.prototype,"count",{get:function(){return this.internalColumns.length},enumerable:!0,configurable:!0}),Object.defineProperty(_Kt.prototype,"width",{get:function(){return 0===this.columnWidth&&(this.columnWidth=this.measureColumnsWidth()),this.columnWidth},enumerable:!0,configurable:!0}),Object.defineProperty(_Kt.prototype,"columns",{get:function(){return this.internalColumns},enumerable:!0,configurable:!0}),_Kt.prototype.getColumn=function(e){if(0<=e&&e<=this.columns.length)return this.columns[e];throw Error("can not get the column from the index: "+e)},_Kt.prototype.measureColumnsWidth=function(){var e=0;this.treegrid.measureColumnsWidth();for(var t=0,i=this.internalColumns.length;t<i;t++)e+=this.internalColumns[t].width;return e},_Kt.prototype.getDefaultWidths=function(e){for(var t=[],i=this.count,n=0;n<this.count;n++)t[n]=this.internalColumns[n].width,0<this.internalColumns[n].width?(e-=this.internalColumns[n].width,i--):t[n]=0;for(n=0;n<this.count;n++)t[n]<=0&&(t[n]=e/i);return t};var VKt=_Kt;function _Kt(e){this.internalColumns=[],this.columnWidth=0,this.treegrid=e,this.internalColumns=[]}var HKt=function(){return(HKt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},zKt=(jKt.prototype.processToFit=function(){this.beforeSinglePageExport.zoomingProjectStartDate=this.parent.zoomingProjectStartDate,this.beforeSinglePageExport.zoomingProjectEndDate=this.parent.zoomingProjectEndDate,this.beforeSinglePageExport.cloneProjectStartDate=this.parent.cloneProjectStartDate,this.beforeSinglePageExport.cloneProjectEndDate=this.parent.cloneProjectEndDate,this.beforeSinglePageExport.customTimelineSettings=Pe({},this.parent.timelineModule.customTimelineSettings,null,!0),this.beforeSinglePageExport.isTimelineRoundOff=this.parent.isTimelineRoundOff,this.beforeSinglePageExport.topTier=this.parent.timelineModule.topTier,this.beforeSinglePageExport.topTierCellWidth=this.parent.timelineModule.topTierCellWidth,this.beforeSinglePageExport.topTierCollection=this.parent.timelineModule.topTierCollection,this.beforeSinglePageExport.bottomTier=this.parent.timelineModule.bottomTier,this.beforeSinglePageExport.bottomTierCellWidth=this.parent.timelineModule.bottomTierCellWidth,this.beforeSinglePageExport.bottomTierCollection=this.parent.timelineModule.bottomTierCollection,this.beforeSinglePageExport.totalTimelineWidth=this.parent.timelineModule.totalTimelineWidth,this.beforeSinglePageExport.timelineStartDate=this.parent.timelineModule.timelineStartDate,this.beforeSinglePageExport.timelineEndDate=this.parent.timelineModule.timelineEndDate,this.beforeSinglePageExport.timelineRoundOffEndDate=this.parent.timelineModule.timelineRoundOffEndDate,this.beforeSinglePageExport.perDayWidth=this.parent.perDayWidth,this.beforeSinglePageExport.updatedConnectorLineCollection=Pe([],this.parent.updatedConnectorLineCollection,null,!0),this.parent.timelineModule.isZoomToFit=!0,this.parent.timelineModule.isZooming=!1,this.parent.zoomingProjectStartDate||(this.parent.zoomingProjectStartDate=this.parent.cloneProjectStartDate,this.parent.zoomingProjectEndDate=this.parent.cloneProjectEndDate),this.parent.zoomingProjectStartDate>this.parent.cloneProjectStartDate&&(this.parent.cloneProjectStartDate=new Date(this.parent.allowUnscheduledTasks?this.parent.zoomingProjectStartDate:this.parent.cloneProjectStartDate)),this.parent.dataOperation.calculateProjectDates();var e,t,i,n=(this.parent.cloneProjectEndDate.getTime()-this.parent.cloneProjectStartDate.getTime())/864e5,o=(this.exportProps.fitToWidthSettings.gridWidth&&(o=parseInt(this.exportProps.fitToWidthSettings.gridWidth.split("%")[0],10)),this.exportProps.fitToWidthSettings.chartWidth?parseInt(this.exportProps.fitToWidthSettings.chartWidth.split("%")[0],10):this.exportProps.fitToWidthSettings.gridWidth?100-o:70),o=this.parent.pdfExportModule.pdfPageDimensions.width*o/100,r=o/n,s=this.parent.zoomingLevels.slice().sort(function(e,t){return e.perDayWidth||t.perDayWidth?e.perDayWidth<t.perDayWidth?1:-1:0});if(0!=r){for(var a=0;a<s.length;a++){if(t=s[a],a===s.length-1){e=s[a];break}if(i=s[a+1],r>=t.perDayWidth){e=s[a];break}if(r<t.perDayWidth&&r>i.perDayWidth){e=s[a+1];break}}var n=Pe({},{},e,!0),l=(this.parent.timelineModule.roundOffDateToZoom(this.parent.cloneProjectStartDate,!0,r,n.bottomTier.unit,e),this.parent.timelineModule.roundOffDateToZoom(this.parent.cloneProjectEndDate,!1,r,n.bottomTier.unit,e),this.parent.timelineModule.calculateNumberOfTimelineCells(n)),h=this.parent.pdfExportModule.pdfPageDimensions.height;n.timelineUnitSize=Math.abs(o-(h<=0?0:17))/l,this.parent.timelineModule.changeTimelineSettings(n),this.parent.timelineModule.isZoomToFit=!1,this.parent.timelineModule.isZooming=!1}},jKt.prototype.processGridExport=function(e,t,i){this.flatData=e,this.gantt=t,this.exportValueFormatter=new WKt(this.parent.locale),this.exportProps=i,this.rowIndex=0,this.colIndex=0,this.columns=this.parent.treeGrid.columns,this.gantt.treeColumnIndex=this.parent.treeColumnIndex,this.gantt.rowHeight=ae(this.parent.rowHeight),this.gantt.style.cellPadding.left=0,this.gantt.style.cellPadding.right=0,this.ganttStyle=this.gantt.ganttStyle,this.gantt.borderColor=this.ganttStyle.chartGridLineColor,this.parent.pdfExportModule.isPdfExport=!0,this.exportProps.fitToWidthSettings&&this.exportProps.fitToWidthSettings.isFitToWidth&&this.processToFit(),this.processHeaderContent(),this.processGanttContent(),this.processTimeline(),this.processTaskbar(),this.processPredecessor(),this.parent.pdfExportModule.isPdfExport=!1},jKt.prototype.processHeaderContent=function(){var t=this,i=(this.rowIndex++,this.row=this.gantt.rows.addRow(),0);this.columns.forEach(function(e){t.isColumnVisible(e)&&(t.processColumnHeader(e,i),i++)})},jKt.prototype.processColumnHeader=function(e,t){this.gantt.columns.add(1);var i=this.gantt.columns.getColumn(t),n=(this.parent.treeColumnIndex===t&&(i.isTreeColumn=!0),parseInt(e.width,10)),n=(i.width=ae(n),this.totalColumnWidth+=i.width,i.headerText=e.headerText,i.field=e.field,this.row.cells.getCell(t)),i=(n.value=e.headerText,n.isHeaderCell=!0,this.ganttStyle&&this.ganttStyle.columnHeader&&!je(this.ganttStyle.columnHeader.fontBrush)&&(n.style.fontBrush=new se(this.ganttStyle.columnHeader.fontBrush)),this.parent.timelineModule.isSingleTier?45:60),t=(this.copyStyles(this.ganttStyle.columnHeader,n,!1),this.row.height=ae(i),e.headerTextAlign&&(n.style.format.alignment=Hh[e.headerTextAlign]),n.fontStyle={fontSize:9},{cell:n,style:n.style,value:n.value,column:e,image:null,headerTemplate:{image:null,value:null,fontStyle:{fontBrush:null}}});this.parent.pdfColumnHeaderQueryCellInfo&&this.parent.trigger("pdfColumnHeaderQueryCellInfo",t),t.headerTemplate.image&&t.headerTemplate.value?(t.image=new oc(t.headerTemplate.image[0].base64),t.image.height=t.headerTemplate.image[0].height||t.image.height,t.image.width=t.headerTemplate.image[0].width||t.image.width,n.image=t.image,n.value=t.headerTemplate.value,n.fontStyle.fontSize=t.headerTemplate.fontStyle.fontSize,n.fontStyle.fontFamily=t.headerTemplate.fontStyle.fontFamily,n.fontStyle.fontBrush=t.headerTemplate.fontStyle.fontColor):n.value=t.value},jKt.prototype.isColumnVisible=function(e){return e.visible||this.exportProps.includeHiddenColumn},jKt.prototype.processGanttContent=function(){var t=this;0===this.flatData.length?this.renderEmptyGantt():this.flatData.forEach(function(e){t.row=t.gantt.rows.addRow(),e.hasChildRecords&&(t.gantt.rows.getRow(t.rowIndex).isParentRow=!0),t.processRecordRow(e),t.rowIndex++})},jKt.prototype.processTimeline=function(){this.parent.enableTimelineVirtualization&&(this.parent.timelineModule.pdfExportTopTierCollection=[],this.parent.timelineModule.pdfExportBottomTierCollection=[],this.parent.timelineModule.createTimelineSeries());var e,t=this.parent.timelineModule;this.gantt.chartHeader.topTierHeight=this.gantt.chartHeader.bottomTierHeight=this.parent.timelineModule.isSingleTier?45:30,this.gantt.chartHeader.topTierCellWidth=t.topTierCellWidth,this.gantt.chartHeader.bottomTierCellWidth=t.bottomTierCellWidth,this.gantt.chartHeader.topTier=Pe([],[],this.parent.enableTimelineVirtualization?t.pdfExportTopTierCollection:t.topTierCollection,!0),this.gantt.chartHeader.bottomTier=Pe([],[],this.parent.enableTimelineVirtualization?t.pdfExportBottomTierCollection:t.bottomTierCollection,!0),this.exportProps&&this.exportProps.fitToWidthSettings&&this.exportProps.fitToWidthSettings.isFitToWidth&&this.parent.enableTimelineVirtualization?(e="None"===t.topTier?"bottomTier":"topTier",this.gantt.chartHeader.width=t.calculateWidthBetweenTwoDate(e,t.timelineStartDate,t.timelineEndDate)):this.gantt.chartHeader.width=this.parent.enableTimelineVirtualization?this.parent.timelineModule.wholeTimelineWidth:t.totalTimelineWidth,this.gantt.chartHeader.height=je(this.gantt.rows.getRow(0).height)?65:this.gantt.rows.getRow(0).height,this.gantt.timelineStartDate=new Date(t.timelineStartDate.getTime())},jKt.prototype.processPredecessor=function(){var i=this;(je(this.exportProps.showPredecessorLines)||this.exportProps.showPredecessorLines)&&(this.parent.pdfExportModule.isPdfExport=!0,this.parent.predecessorModule.createConnectorLinesCollection(this.flatData),this.parent.updatedConnectorLineCollection.forEach(function(e){var t=i.gantt.predecessor.add();t.parentLeft=e.parentLeft,t.childLeft=e.childLeft,t.parentWidth=e.parentWidth,t.childWidth=e.childWidth,t.parentIndex=i.findIndexUsingParent(i.flatData,e.parentIndex),t.childIndex=i.findIndexUsingParent(i.flatData,e.childIndex),t.rowHeight=e.rowHeight,t.type=e.type,t.milestoneParent=e.milestoneParent,t.milestoneChild=e.milestoneChild,t.parentEndPoint=e.parentEndPoint,t.lineWidth=5<i.parent.connectorLineWidth?ae(5):ae(i.parent.connectorLineWidth),e.isCritical?t.connectorLineColor=i.ganttStyle.criticalConnectorLineColor:t.connectorLineColor=i.ganttStyle.connectorLineColor,i.gantt.predecessorCollection.push(t)}),this.parent.pdfExportModule.isPdfExport=!1)},jKt.prototype.findIndexUsingParent=function(e,t){return e.findIndex(function(e){return e.index===t})},jKt.prototype.processRecordRow=function(t){var i=this;this.colIndex=0,this.row.level=t.level,this.columns.forEach(function(e){i.isColumnVisible(e)&&(i.processRecordCell(t,e,i.row),i.colIndex++)})},jKt.prototype.processRecordCell=function(e,t,i){var n=i.cells.getCell(this.colIndex),o=this.parent.taskFields,r=e.ganttProperties,o=("datepickeredit"===t.editType||"datetimepickeredit"===t.editType?n.value=e[t.field]:t.field===o.duration?n.value=this.parent.getDurationString(r.duration,r.durationUnit):t.field===o.resourceInfo?n.value=r.resourceNames:t.field===o.work?n.value=this.parent.getWorkString(r.work,r.workUnit):n.value=je(e[t.field])?"":e[t.field].toString(),je(n.value)?"":n.value.toString()),r=je(o)?"":o,o=(n.isHeaderCell=!1,n.style.padding=new lKt,this.copyStyles(this.ganttStyle.cell,n,i.isParentRow),t.index!==this.parent.treeColumnIndex?n.style.format.alignment=Hh[t.textAlign]:n.style.format.paragraphIndent=10*n.row.level,{data:e,value:r,column:t,style:n.style,cell:n});o.value=this.exportValueFormatter.formatCellValue(o),this.parent.pdfQueryCellInfo&&(this.parent.trigger("pdfQueryCellInfo",o),o.style.backgroundColor&&(n.style.backgroundColor=o.style.backgroundColor),o.style.borderColor&&(n.style.borderColor=o.style.borderColor),o.style.fontBrush&&(n.style.fontBrush=o.style.fontBrush),o.style.fontColor&&(n.style.fontColor=o.style.fontColor),o.style.fontFamily?(i=o.style.fontFamily,e=this.getFontFamily(i),n.style.fontFamily=e):n.style.fontFamily=this.ganttStyle.fontFamily,o.style.fontSize&&(n.style.fontSize=o.style.fontSize),o.style.fontStyle?(r=o.style.fontStyle,t=this.getFontStyle(r),n.style.fontStyle=t):n.style.fontStyle=this.ganttStyle.footer.fontStyle,o.style.format&&(n.style.format=o.style.format),o.style.padding)&&(n.style.padding=o.style.padding),je(o.image)||je(o.image.base64)||(i=Pe({},o.image,null,!0),o.image=new oc(o.image.base64),o.image.height=i.height||o.image.height,o.image.width=i.width||o.image.width,n.image=o.image),n.value=o.value,je(o.hyperLink)||je(o.hyperLink.displayText)&&je(o.hyperLink.target)||(n.value=this.setHyperLink(o))},jKt.prototype.setHyperLink=function(e){var t=new am;return t.url=e.hyperLink.target,t.text=e.hyperLink.displayText||e.hyperLink.target,t.font=new cg(dd.Helvetica,9.75),t.brush=new Sd(new se(51,102,187)),t},jKt.prototype.processTaskbar=function(){var c=this;this.flatData.forEach(function(e){var r=c.gantt.taskbar.add(),t=e.ganttProperties,i=(r.left=t.left,r.width=t.width,r.left<0&&(r.width=r.width+r.left,r.left=0),r.progress=t.progress,r.isScheduledTask=rqt(t),je(t.endDate)&&je(t.duration)?r.unscheduledTaskBy="startDate":je(t.startDate)&&je(t.duration)?r.unscheduledTaskBy="endDate":(r.unscheduledTaskBy="duration",r.unscheduleStarteDate=c.parent.dateValidationModule.getValidStartDate(e.ganttProperties),r.unscheduleEndDate=c.parent.dateValidationModule.getValidEndDate(e.ganttProperties)),r.startDate=t.startDate,r.endDate=t.endDate,r.height=c.parent.chartRowsModule.taskBarHeight,r.indicators=t.indicators,r.autoStartDate=t.autoStartDate,r.autoEndDate=t.autoEndDate,r.isAutoSchedule=t.isAutoSchedule,r.autoWidth=t.autoWidth,r.autoLeft=t.autoLeft,r.segment=t.segments,r.isSpliterTask=!je(t.segments)&&0!==t.segments.length,r.isSpliterTask&&(r.segmentCollection=r.segment.map(function(e){return HKt({},e)})),r.baselineTop=c.parent.chartRowsModule.baselineTop,r.isMilestone=t.isMilestone,r.baselineStartDate=t.baselineStartDate,r.baselineEndDate=t.baselineEndDate,r.baselineLeft=t.baselineLeft,r.baselineWidth=t.baselineWidth,r.baselineLeft<0&&(r.baselineWidth=r.baselineWidth+r.baselineLeft,r.baselineLeft=0),r.milestoneColor=new se(c.ganttStyle.taskbar.milestoneColor),r.isParentTask=e.hasChildRecords,t.isMilestone&&(r.height=t.width),e[c.parent.labelSettings.leftLabel]&&(r.leftTaskLabel.value=e[c.parent.labelSettings.leftLabel].toString()),e[c.parent.labelSettings.rightLabel]&&(r.rightTaskLabel.value=e[c.parent.labelSettings.rightLabel].toString()),je(e[c.parent.labelSettings.taskLabel])||(r.taskLabel=e[c.parent.labelSettings.taskLabel].toString()),t.isMilestone?Math.floor(c.parent.chartRowsModule.taskBarHeight/2)+33:33),i=(r.rightTaskLabel.left=t.left+t.width+i,r.fontFamily=c.ganttStyle.fontFamily,r.progressWidth=t.progressWidth,r.labelColor=new se(c.ganttStyle.label.fontColor),r.progressFontColor=new se(c.ganttStyle.taskbar.progressFontColor),r.isParentTask?(r.taskColor=new se(c.ganttStyle.taskbar.parentTaskColor),r.taskBorderColor=new se(c.ganttStyle.taskbar.parentTaskBorderColor),r.progressColor=new se(c.ganttStyle.taskbar.parentProgressColor)):e.isCritical?(r.taskColor=new se(c.ganttStyle.taskbar.criticalTaskColor),r.progressColor=new se(c.ganttStyle.taskbar.criticalProgressColor),r.taskBorderColor=new se(c.ganttStyle.taskbar.criticalTaskBorderColor),r.milestoneColor=new se(c.ganttStyle.taskbar.criticalTaskColor)):(r.taskColor=new se(c.ganttStyle.taskbar.taskColor),r.progressColor=new se(c.ganttStyle.taskbar.progressColor),r.taskBorderColor=new se(c.ganttStyle.taskbar.taskBorderColor)),r.manualParentBorder=new se(c.ganttStyle.taskbar.manualParentBorder),r.manualChildBorder=new se(c.ganttStyle.taskbar.manualChildBorder),r.manuallineColor=new se(c.ganttStyle.taskbar.manualLineColor),r.unscheduledTaskBarColor=new se(c.ganttStyle.taskbar.unscheduledTaskBarColor),r.manualParentBackground=new se(c.ganttStyle.taskbar.manualParentBackground),r.manualParentProgress=new se(c.ganttStyle.taskbar.manualParentProgress),r.manualChildBackground=new se(c.ganttStyle.taskbar.manualChildBackground),r.manualChildProgress=new se(c.ganttStyle.taskbar.manualChildProgress),r.splitLineBackground=new se(c.ganttStyle.taskbar.splitLineBackground),r.baselineColor=new se(c.ganttStyle.taskbar.baselineColor),r.baselineBorderColor=new se(c.ganttStyle.taskbar.baselineBorderColor),r.gridLineColor=new se(c.ganttStyle.chartGridLineColor),{}),t=(i.leftLabel={value:null,image:null,fontStyle:{fontBrush:null}},i.rightLabel={value:null,image:null,fontStyle:{fontBrush:null}},i.taskLabel={value:null,image:null,fontStyle:{fontBrush:null}},r.labelSettings=i,{value:null,image:null,fontStyle:{fontBrush:null}}),n=(r.taskbarTemplate=t,c.gantt.taskbarCollection.push(r),{}),o=(n.progressFontColor=r.progressFontColor,n.taskColor=r.taskColor,n.taskBorderColor=r.taskBorderColor,n.progressColor=r.progressColor,n.milestoneColor=r.milestoneColor,n.baselineColor=r.baselineColor,n.baselineBorderColor=r.baselineBorderColor,{taskbar:n,data:e,indicators:e.ganttProperties.indicators,labelSettings:i,taskbarTemplate:t});if(c.parent.pdfQueryTaskbarInfo){var s=[];if(o.taskbar.taskSegmentStyles=null,o.data.ganttProperties.segments){for(var a=0;a<o.data.ganttProperties.segments.length;a++){var l={taskColor:o.taskbar.taskColor,taskBorderColor:o.taskbar.taskBorderColor,progressColor:o.taskbar.progressColor};s.push(l)}o.taskbar.taskSegmentStyles=s}c.parent.trigger("pdfQueryTaskbarInfo",o),r.taskSegmentStyles=o.taskbar.taskSegmentStyles,r.progressFontColor=o.taskbar.progressFontColor,r.taskColor=o.taskbar.taskColor,r.taskBorderColor=o.taskbar.taskBorderColor,r.progressColor=o.taskbar.progressColor,r.milestoneColor=o.taskbar.milestoneColor,r.baselineColor=o.taskbar.baselineColor,r.baselineBorderColor=o.taskbar.baselineBorderColor,r.indicators=o.indicators,r.labelSettings.leftLabel.value=o.labelSettings.leftLabel.value;var h=o.labelSettings.leftLabel.image,d=(r.labelSettings.rightLabel.value=o.labelSettings.rightLabel.value,o.labelSettings.rightLabel.image);if(je(o.labelSettings.taskLabel.value)||(r.taskLabel=o.labelSettings.taskLabel.value),!je(o.labelSettings.leftLabel.image)&&Array.isArray(o.labelSettings.leftLabel.image[0].base64)&&0<o.labelSettings.leftLabel.image[0].base64.length){var p=o.labelSettings.leftLabel.image[0].base64.length;r.labelSettings.leftLabel.image=[];for(a=0;a<p;a++)r.labelSettings.leftLabel.image.push({base64:h[0].base64[a],width:h[0].width,height:h[0].height})}else je(o.labelSettings.leftLabel.image)||(r.labelSettings.leftLabel.image=o.labelSettings.leftLabel.image);if(!je(o.labelSettings.rightLabel.image)&&Array.isArray(o.labelSettings.rightLabel.image[0].base64)&&0<o.labelSettings.rightLabel.image[0].base64.length){p=o.labelSettings.rightLabel.image[0].base64.length;r.labelSettings.rightLabel.image=[];for(a=0;a<p;a++)r.labelSettings.rightLabel.image.push({base64:d[0].base64[a],width:d[0].width,height:d[0].height})}else je(o.labelSettings.rightLabel.image)||(r.labelSettings.rightLabel.image=o.labelSettings.rightLabel.image);n=function(e,t){var i,n,o;e.progressFontColor=t.taskbar.progressFontColor,e.taskColor=new se(t.taskbar.taskColor),e.taskBorderColor=t.taskbar.taskBorderColor,e.progressColor=t.taskbar.progressColor,e.milestoneColor=t.taskbar.milestoneColor,je(t.taskbarTemplate.image)||je(t.taskbarTemplate.image[0].base64)||(i=t.taskbarTemplate.image[0].width,o=r.isMilestone&&t.taskbarTemplate.image[0].height<.7*c.parent.chartRowsModule.taskBarHeight?t.taskbarTemplate.image[0].height:.7*c.parent.chartRowsModule.taskBarHeight-2,n=!je(t.taskbarTemplate.image[0].height)&&t.taskbarTemplate.image[0].height<r.height?t.taskbarTemplate.image[0].height:r.height-2,o=r.isMilestone?o:n,e.taskbarTemplate.image=t.taskbarTemplate.image,e.taskbarTemplate.image[0].width=i,e.taskbarTemplate.image[0].height=o),je(t.taskbarTemplate.value)||(e.taskbarTemplate.value=t.taskbarTemplate.value,e.taskbarTemplate.value=t.taskbarTemplate.value,e.taskbarTemplate.fontStyle.fontColor=t.taskbarTemplate.fontStyle.fontColor,e.taskbarTemplate.fontStyle.fontSize=t.taskbarTemplate.fontStyle.fontSize,e.taskbarTemplate.fontStyle.fontFamily=t.taskbarTemplate.fontStyle.fontFamily,e.taskbarTemplate.fontStyle.fontStyle=t.taskbarTemplate.fontStyle.fontStyle,e.taskbarTemplate.fontStyle.fontBrush=t.taskbarTemplate.fontStyle.fontBrush)};(!o.data.hasChildRecords&&0!==o.data.ganttProperties.duration||o.data.hasChildRecords&&0!==o.data.ganttProperties.duration||0===o.data.ganttProperties.duration)&&n(r,o)}})},jKt.prototype.getHorizontalAlignment=function(e,t){switch(void 0===t&&(t=new xd),e){case"Right":t.alignment=Hh.Right;break;case"Center":t.alignment=Hh.Center;break;case"Justify":t.alignment=Hh.Justify;break;case"Left":t.alignment=Hh.Left}return t},jKt.prototype.getVerticalAlignment=function(e,t,i){switch(void 0===t&&(t=new xd,t=this.getHorizontalAlignment(i,t)),e){case"Bottom":t.lineAlignment=_h.Bottom;break;case"Middle":t.lineAlignment=_h.Middle;break;case"Top":t.lineAlignment=_h.Top}return t},jKt.prototype.getFontFamily=function(e){switch(e){case"TimesRoman":return 2;case"Courier":return 1;case"Symbol":return 3;case"ZapfDingbats":return 4;default:return 0}},jKt.prototype.getFontStyle=function(e){switch(e){case"Strikeout":return 8;case"Underline":return 4;case"Italic":return 2;case"Bold":return 1;default:return 0}},jKt.prototype.getFont=function(e){var t,i;return e.font||(i=this.exportProps.ganttStyle&&this.exportProps.ganttStyle.fontFamily?this.exportProps.ganttStyle.fontFamily:dd.TimesRoman,t=je(e.style.fontSize)?9.75:.75*e.style.fontSize,i=je(e.style.fontFamily)?i:this.getFontFamily(e.style.fontFamily),e=hd.Regular,new cg(i,t,e))},jKt.prototype.renderEmptyGantt=function(){var e=this.gantt.rows.addRow(),t=(0===e.cells.count&&e.cells.add(),e.cells.getCell(0).isHeaderCell=!1,e.height=ae(this.parent.rowHeight),this.copyStyles(this.ganttStyle.columnHeader,e.cells.getCell(0),e.isParentRow),this.columns.length);e.cells.getCell(0).value=this.parent.localeObj.getConstant("emptyRecord"),this.mergeCells(1,0,t)},jKt.prototype.mergeCells=function(e,t,i){this.gantt.rows.getRow(e).cells.getCell(t).columnSpan=i},jKt.prototype.copyStyles=function(e,t,i){t.style.fontColor=new se(e.fontColor),t.style.backgroundColor=new se(e.backgroundColor),t.style.borderColor=new se(e.borderColor),t.style.fontSize=e.fontSize,t.style.fontStyle=e.fontStyle,t.style.format=Object.assign(new xd,e.format),t.style.borders=new sKt,t.style.borders.all=new Ep(t.style.borderColor),t.style.padding=new lKt;var n=0,n=t.isHeaderCell?this.parent.timelineModule.isSingleTier?22.5:30:this.parent.rowHeight/2;t.style.padding.top=0<n-e.fontSize?n-e.fontSize:n,t.style.padding.bottom=0<n-e.fontSize?n-e.fontSize:0,t.style.padding.left=10,t.style.padding.right=10,e.padding&&(t.style.padding=e.padding),e.borders&&(t.style.borders=e.borders)},jKt.prototype.initializePdf=function(e){this.pdfDoc=e;var t=[],i=this.pdfDoc.pageSettings.width-82;if(this.exportProps&&this.exportProps.fitToWidthSettings&&this.exportProps.fitToWidthSettings.isFitToWidth){var n=void 0;n=this.exportProps.fitToWidthSettings.gridWidth?parseInt(this.exportProps.fitToWidthSettings.gridWidth.split("%")[0],10):this.exportProps.fitToWidthSettings.chartWidth?100-parseInt(this.exportProps.fitToWidthSettings.chartWidth.split("%")[0],10):30;for(var o=this.parent.pdfExportModule.pdfPageDimensions.width*n/100/this.gantt.columns.columns.length,r=0;r<this.gantt.columns.columns.length;r++)this.gantt.columns.getColumn(r).width=o}var s,a,l,h,d,n=this.parent.pdfExportModule.pdfPage,p=(this.totalColumnWidth>this.pdfDoc.pageSettings.width-82&&this.totalColumnWidth<n.getClientSize().width?this.gantt.style.allowHorizontalOverflow=!0:i/this.columns.length<t[0]&&(this.gantt.columns.getColumn(0).width=t[0]),(this.exportProps.enableFooter||je(this.exportProps.enableFooter))&&(i=this.parent.pdfExportModule.getPageSize(this.exportProps.pageSize),d=new id(0,0,i.width,35),t=new Ep(this.ganttStyle.footer.borderColor),a=new Gy(d),p=new Sd(this.ganttStyle.footer.backgroundColor),a.graphics.drawRectangle(t,p,0,0,i.width,35),t=new cg(this.ganttStyle.fontFamily,this.ganttStyle.footer.fontSize,this.ganttStyle.footer.fontStyle),this.ganttStyle.font&&(t=this.ganttStyle.font),p=new Sd(this.ganttStyle.footer.fontColor),i=new vm(t),s=new km(t,p),(t=new Sm(t,p,"Page {0}",i,s)).stringFormat=this.ganttStyle.footer.format,t.bounds=d,t.draw(a.graphics,new ed(0,0)),e.template.bottom=a),n.size),i=je(p)?this.pdfDoc.pageSettings.size:p;je(this.exportProps.header)||(s=this.exportProps.header,l=new ed(0,s.fromTop),h=new td(1.1*i.width,s&&s.height?.75*s.height:50),d=new id(l,h),e.template.top=this.drawPageTemplate(new Gy(d),s)),this.exportProps.enableFooter||je(this.exportProps.footer)||(a=this.exportProps.footer,l=new ed(0,i.width-80-(a&&a.fromBottom?.75*a.fromBottom:0)),h=new td(1.1*i.width,a&&a.height?.75*a.height:50),d=new id(l,h),this.pdfDoc.template.bottom=this.drawPageTemplate(new Gy(d),a))},jKt.prototype.drawPageTemplate=function(e,t){for(var i=0,n=t.contents;i<n.length;i++){var o=n[i];switch(o.type){case"Text":if(""===o.value||void 0===o.value||null===o.value||"string"!=typeof o.value)throw new Error("please enter the valid input value in text content...");this.drawText(e,o);break;case"PageNumber":this.drawPageNumber(e,o);break;case"Image":if(void 0===o.src||null===o.src||""===o.src)throw new Error("please enter the valid base64 string in image content...");this.drawImage(e,o);break;case"Line":this.drawLine(e,o);break;default:throw new Error("Please set valid content type...")}}return e},jKt.prototype.drawText=function(e,t){var i=this.getFont(t),n=(this.ganttStyle.font&&(i=this.ganttStyle.font),this.getBrushFromContent(t)),o=null,r=(je(t.style.textPenColor)||(r=this.hexToRgb(t.style.textPenColor),o=new Ep(new se(r.r,r.g,r.b))),null===n&&null===o&&(n=new Sd(new se(0,0,0))),t.value.toString()),s=.75*t.position.x,a=.75*t.position.y,l=new xd,t=(je(t.style.stringFormat)||(l.alignment=t.style.stringFormat.alignment),this.setContentFormat(t,l));null===t||je(t.format)||je(t.size)?e.graphics.drawString(r,i,o,n,s,a,l):e.graphics.drawString(r,i,o,n,s,a,t.size.width,t.size.height,t.format)},jKt.prototype.drawPageNumber=function(e,t){var i,n,o,r=this.getFont(t),s=null,a=(s=je(t.style.textBrushColor)?new Sd(new se(0,0,0)):(a=this.hexToRgb(t.style.textBrushColor),new Sd(new se(a.r,a.g,a.b))),new vm(r,s)),a=(a.numberStyle=this.getPageNumberStyle(t.pageNumberType),o=je(t.format)?new Sm(r,s,n="{0}",a):(o="$current",-1!==t.format.indexOf(l="$total")&&-1!==t.format.indexOf(o)?((i=new km(r)).numberStyle=this.getPageNumberStyle(t.pageNumberType),n=t.format.indexOf(l)>t.format.indexOf(o)?(n=t.format.replace(o,"0")).replace(l,"1"):(n=t.format.replace(o,"1")).replace(l,"0"),new Sm(r,s,n,a,i)):-1!==t.format.indexOf(o)&&-1===t.format.indexOf(l)?(n=t.format.replace(o,"0"),new Sm(r,s,n,a)):(i=new km(r),n=t.format.replace(l,"0"),new Sm(r,s,n,i))),.75*t.position.x),l=.75*t.position.y,r=this.setContentFormat(t,o.stringFormat);null===r||je(r.format)||je(r.size)||(o.stringFormat=r.format,o.bounds=new id(a,l,r.size.width,r.size.height)),o.draw(e.graphics,a,l)},jKt.prototype.drawImage=function(e,t){var i=.75*t.position.x,n=.75*t.position.y,o=je(t.size)||je(t.size.width)?void 0:.5*t.size.width,r=je(t.size)||je(t.size.height)?void 0:.75*t.size.height,t=new oc(t.src);je(o)?e.graphics.drawImage(t,i,n):e.graphics.drawImage(t,i,n,o,r)},jKt.prototype.drawLine=function(e,t){var i=.75*t.points.x1,n=.75*t.points.y1,o=.75*t.points.x2,r=.75*t.points.y2,s=this.getPenFromContent(t);je(t.style)||(je(t.style.penSize)||"number"!=typeof t.style.penSize||(s.width=.75*t.style.penSize),s.dashStyle=this.getDashStyle(t.style.dashStyle)),e.graphics.drawLine(s,i,n,o,r)},jKt.prototype.getPenFromContent=function(e){var t=new Ep(new se(0,0,0));return je(e.style)||null===e.style||je(e.style.penColor)||(e=this.hexToRgb(e.style.penColor),t=new Ep(new se(e.r,e.g,e.b))),t},jKt.prototype.getDashStyle=function(e){switch(e){case"Dash":return 1;case"Dot":return 2;case"DashDot":return 3;case"DashDotDot":return 4;default:return 0}},jKt.prototype.getBrushFromContent=function(e){var t=null;return je(e.style.textBrushColor)||(e=this.hexToRgb(e.style.textBrushColor),t=new Sd(new se(e.r,e.g,e.b))),t},jKt.prototype.hexToRgb=function(e){if(null===e||""===e||7!==e.length)throw new Error("please set valid hex value for color...");e=e.substring(1);e=parseInt(e,16);return{r:e>>16&255,g:e>>8&255,b:255&e}},jKt.prototype.setContentFormat=function(e,t){var i=e.size?.75*e.size.width:this.pdfDoc.pageSettings.size.width,n=e.size?.75*e.size.height:je(this.exportProps.footer)?0:.5*this.exportProps.footer.height;if(t=new xd(Hh.Left,_h.Middle),!je(e.style.hAlign))switch(e.style.hAlign){case"Right":t.alignment=Hh.Right;break;case"Center":t.alignment=Hh.Center;break;case"Justify":t.alignment=Hh.Justify;break;default:t.alignment=Hh.Left}return{format:t=je(e.style.vAlign)?t:this.getVerticalAlignment(e.style.vAlign,t),size:new td(i,n)}},jKt.prototype.getPageNumberStyle=function(e){switch(e){case"LowerLatin":return 2;case"LowerRoman":return 3;case"UpperLatin":return 4;case"UpperRoman":return 5;default:return 1}},jKt);function jKt(e){this.totalColumnWidth=0,this.beforeSinglePageExport={},this.baselineHeight=8,this.parent=e}QKt.prototype.returnFormattedValue=function(e,t){return!je(e.value)&&e.value?this.valueFormatter.getFormatFunction(t)(e.value):""},QKt.prototype.formatCellValue=function(e){var t;return e.isForeignKey&&(e.value=R(e.column.foreignKeyValue,DB(e.column,{},e.value)[0])),"number"===e.column.type&&void 0!==e.column.format&&""!==e.column.format?e.value?this.internationalization.getNumberFormat({format:e.column.format})(e.value):"":"boolean"===e.column.type?e.value?"true":"false":"date"!==e.column.type&&"datetime"!==e.column.type&&"time"!==e.column.type||void 0===e.column.format?(je(e.column.type)||je(e.value))&&je(e.value)?"":e.value.toString():("string"==typeof e.value&&(e.value=new Date(e.value)),"string"==typeof e.column.format?(t=void 0,t="date"===e.column.type?{type:"date",format:e.column.format}:"time"===e.column.type?{type:"time",format:e.column.format}:{type:"dateTime",format:e.column.format},this.returnFormattedValue(e,t)):e.column.format instanceof Object&&void 0===e.column.format.type?e.value.toString():(t=void 0,t="date"===e.column.type?{type:e.column.format.type,format:e.column.format.format,skeleton:e.column.format.skeleton}:"time"===e.column.type?{type:"time",format:e.column.format.format,skeleton:e.column.format.skeleton}:{type:"dateTime",format:e.column.format.format,skeleton:e.column.format.skeleton},this.returnFormattedValue(e,t)))};var WKt=QKt;function QKt(e){this.valueFormatter=new v0(e),this.internationalization=new Ti(e)}var UKt=function(){return(UKt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},qKt=(GKt.prototype.add=function(){return new GKt(this.parent)},GKt.prototype.GetNextPage=function(e){var t=e.section,e=t.indexOf(e);return e===t.count-1?t.add():t.getPages()[e+1]},GKt.prototype.isAutoFit=function(){return!!(this.parent.pdfExportModule&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth||this.parent.timelineModule.isZoomedToFit)},GKt.prototype.drawTaskbar=function(r,s,a,l,O,h,N){var e,t,d,p,i,V,_,n,H,o,z,j,W,Q,c,u,g,U,q,m,G,Y,X,K,f,J,Z,$,ee,y,v,b,w,C,te,S,A,x,I=this,T=r.graphics,ie=!1,E=r.getClientSize(),ne=(s.y+O>E.height&&((r=this.GetNextPage(r)).contentWidth=this.isAutoFit()?mqt(a.endPoint-a.startPoint):a.endPoint-a.startPoint,T=r.graphics,s.y=0,this.parent.pdfExportModule.gantt.enableHeader&&(this.parent.pdfExportModule.gantt.chartHeader.drawPageTimeline(r,s,a),s.y=ae(this.parent.timelineModule.isSingleTier?45:60)),ie=!0),this.drawLeftLabel(r,s,a,l,h),new cg(this.fontFamily,9,hd.Regular)),E=null,D=new Sd(this.progressFontColor),M=!je(h.taskbarTemplate.value)&&h.taskbarTemplate.fontStyle&&h.taskbarTemplate.fontStyle.fontFamily&&h.taskbarTemplate.fontStyle.fontSize?new cg(h.taskbarTemplate.fontStyle.fontFamily,h.taskbarTemplate.fontStyle.fontSize,h.taskbarTemplate.fontStyle.fontStyle):ne,k=!je(h.taskbarTemplate.value)&&h.taskbarTemplate.fontStyle&&h.taskbarTemplate.fontStyle.fontColor?new Sd(h.taskbarTemplate.fontStyle.fontColor):D,P=!je(h.taskbarTemplate.value)&&h.taskbarTemplate.fontStyle&&h.taskbarTemplate.fontStyle.fontBrush?new Ep(h.taskbarTemplate.fontStyle.fontBrush):E,B=(!je(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(ne=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),this.parent.pdfExportModule.helper.exportProps.ganttStyle),F=(h.labelSettings.taskLabel.fontStyle.fontSize?t=new cg(h.labelSettings.taskLabel.fontStyle.fontFamily,h.labelSettings.taskLabel.fontStyle.fontSize,h.labelSettings.taskLabel.fontStyle.fontStyle):B&&B.label&&B.label.fontBrush?e=new Sd(B.label.fontBrush):t=ne,e=h.labelSettings.taskLabel.fontStyle.fontColor?new Sd(h.labelSettings.taskLabel.fontStyle.fontColor):B&&B.label&&B.label.fontColor?new Sd(B.label.fontColor):D,je(B)||je(B.label)||je(B.label.fontBrush)||(E=new Ep(B.label.fontBrush)),je(B)||je(B.label)||je(B.label.fontSize)&&je(B.label.fontStyle)&&je(B.label.fontFamily)||(t=this.getPdfFont(B)),new xd),D=(F.lineAlignment=_h.Middle,F.alignment=Hh.Right,!1),L=(je(this.taskLabel)||!/^[a-zA-Z0-9]/.test(this.taskLabel)||"0"!==this.taskLabel&&"0%"!==this.taskLabel||(f=this.width,F.alignment=Hh.Left),(je(this.taskLabel)||!/^[a-zA-Z]/.test(this.taskLabel))&&je(h.taskbarTemplate.value)||(D=!0,F.alignment=Hh.Left),je(B)||je(B.label)||je(B.label.format)||(F=B.label.format),{left:0,right:0,top:0,bottom:0}),B=(je(B)||je(B.label)||je(B.label.padding)||(L=B.label.padding),-1),oe=new Ep(h.baselineBorderColor),re=new Sd(h.baselineColor),R=h.taskbarTemplate;return h.isMilestone?(this.drawMilestone(r,s,a,l,h,!1),this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&this.drawMilestone(r,s,a,l,h,!0)):(d=new Ep(h.taskBorderColor),p=new Sd(h.taskColor),i=new Ep(h.manualParentBorder),V=new Ep(h.manualChildBorder),_=new Ep(h.manuallineColor),new Ep(h.manualParentProgress),n=new Ep(h.manuallineColor),H=new Sd(h.manuallineColor),o=new Ep(h.splitLineBackground),z=new Sd(h.manualParentBackground),j=new Sd(h.manualChildBackground),W=new Sd(h.manualChildProgress),Q=new Sd(h.manualParentProgress),c=new Ep(h.progressColor),u=new Sd(h.progressColor),q=ae((this.parent.rowHeight-this.height)/2),U=ae((this.parent.rowHeight-this.height)/4.5),g=this.parent.renderBaseline?U:q,B=r.section.indexOf(r),U=je(this.unscheduleStarteDate)?this.startDate:this.unscheduleStarteDate,q=je(this.unscheduleEndDate)?this.endDate:this.unscheduleEndDate,a.startDate<=U&&q<=a.endDate?(this.isStartPoint||(this.taskStartPoint=UKt({},s),this.isStartPoint=!0),this.isScheduledTask||"duration"!==this.unscheduledTaskBy?(this.isScheduledTask||"endDate"!==this.unscheduledTaskBy)&&(this.isScheduledTask||"duration"===this.unscheduledTaskBy)?(h.isSpliterTask?(o.dashStyle=Qh.Dot,this.isAutoFit()?T.drawLine(o,new ed(s.x+(this.left-l)+.5,s.y+g+ae(h.height/2)),new ed(h.width+s.x+(this.left-l)+.5,s.y+g+ae(h.height/2))):T.drawLine(o,new ed(s.x+ae(this.left-l)+.5,s.y+g+ae(h.height/2)),new ed(ae(h.width)+s.x+ae(this.left-l)+.5,s.y+g+ae(h.height/2))),h.segment.map(function(e,t){var i,n,o=je(I.taskSegmentStyles)?d:new Ep(I.taskSegmentStyles[t].taskBorderColor),t=je(I.taskSegmentStyles)?p:new Sd(I.taskSegmentStyles[t].taskColor);I.isAutoFit()?(T.drawRectangle(o,t,s.x+(I.left+e.left-l)+.5,s.y+g,e.width,ae(h.height)),(R.value||R.image)&&(i=void 0,je(h.taskbarTemplate.image)?i=0:(i=h.taskbarTemplate.image[0].width,n=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(n,s.x+(I.left+e.left-l)+.5,s.y+g,ae(h.taskbarTemplate.image[0].width),ae(h.taskbarTemplate.image[0].height))),je(h.taskbarTemplate.value)||T.drawString(h.taskbarTemplate.value,M,P,k,s.x+(I.left+e.left-l)+.5+i,s.y+g,ae(e.width),ae(h.height),F))):(T.drawRectangle(o,t,s.x+ae(I.left+e.left-l)+.5,s.y+g,ae(e.width),ae(h.height)),(R.value||R.image)&&(i=void 0,je(h.taskbarTemplate.image)?i=0:(i=h.taskbarTemplate.image[0].width,n=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(n,s.x+ae(I.left+e.left-l)+.5,s.y+g,ae(h.taskbarTemplate.image[0].width),ae(h.taskbarTemplate.image[0].height))),je(h.taskbarTemplate.value)||T.drawString(h.taskbarTemplate.value,M,P,k,s.x+ae(I.left+e.left-l)+.5+i,s.y+g,ae(e.width),ae(h.height),F)))})):!h.isAutoSchedule&&h.isParentTask?(T.save(),(Z=new By).addEllipse(0,0,5,5),this.isAutoFit()?T.translateTransform(s.x+(this.left-l)+.5,s.y+g-2):T.translateTransform(s.x+ae(this.left-l)+.5,s.y+g-2),T.drawPath(_,H,Z),T.restore(),(J=new By).addEllipse(0,0,5,5),T.save(),this.isAutoFit()?T.translateTransform(s.x+(this.left-l)+.5+this.width,s.y+g-2):T.translateTransform(s.x+ae(this.left-l)+.5+ae(this.width),s.y+g-2),T.drawPath(_,H,J),T.restore(),n.dashStyle=Qh.Solid,this.isAutoFit()?T.drawLine(n,new ed(s.x+(this.left-l)+.5,s.y+g),new ed(h.width+s.x+(this.left-l)+.5,s.y+g)):T.drawLine(n,new ed(s.x+ae(this.left-l)+.5,s.y+g),new ed(ae(h.width)+s.x+ae(this.left-l)+.5,s.y+g))):h.isAutoSchedule||h.isParentTask?this.isAutoFit()?je(R.value)&&je(R.image)?T.drawRectangle(d,p,s.x+(this.left-l)+.5,s.y+g,h.width,ae(h.height)):(T.drawRectangle(d,p,s.x+(this.left-l)+.5,s.y+g,h.width,ae(h.height)),w=void 0,je(h.taskbarTemplate.image)?w=0:(w=h.taskbarTemplate.image[0].width/2,C=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(C,s.x+(this.left-l)+.5,s.y+g+(h.height-h.taskbarTemplate.image[0].height)/2,h.taskbarTemplate.image[0].width/2,h.taskbarTemplate.image[0].height/2)),h.taskbarTemplate.value&&(D&&(f=this.width),T.drawString(h.taskbarTemplate.value,M,P,k,s.x+(this.left-l)+w,s.y+g,f,ae(this.height),F))):je(R.value)&&je(R.image)?T.drawRectangle(d,p,s.x+ae(this.left-l)+.5,s.y+g,ae(h.width),ae(h.height)):(T.drawRectangle(d,p,s.x+ae(this.left-l)+.5,s.y+g,ae(h.width),ae(h.height)),w=void 0,je(h.taskbarTemplate.image)?w=0:(w=h.taskbarTemplate.image[0].width,C=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(C,s.x+ae(this.left-l)+1,s.y+g+1+ae((h.height-h.taskbarTemplate.image[0].height)/2),ae(h.taskbarTemplate.image[0].width),ae(h.taskbarTemplate.image[0].height))),je(h.taskbarTemplate.value)||T.drawString(h.taskbarTemplate.value,M,P,k,s.x+ae(this.left-l)+w,s.y+g,ae(f),ae(this.height),F)):(T.save(),T.setTransparency(.87),this.isAutoFit()?T.drawRectangle(V,j,s.x+(this.left-l)+.5,s.y+g,h.width,ae(h.height)):T.drawRectangle(V,j,s.x+ae(this.left-l)+.5,s.y+g,ae(h.width),ae(h.height)),T.restore(),this.isAutoFit()?T.drawRectangle(null,W,s.x+(this.left-l)+.5,s.y+g,h.progressWidth,ae(this.height)):T.drawRectangle(null,W,s.x+ae(this.left-l)+.5,s.y+g,ae(h.progressWidth),ae(this.height))),this.isScheduledTask&&h.isAutoSchedule&&!h.isSpliterTask?je(R.image)&&je(R.value)&&(this.isAutoFit()?T.drawRectangle(c,u,s.x+(this.left-l)+.5,s.y+g,h.progressWidth,ae(h.height)):T.drawRectangle(c,u,s.x+ae(this.left-l)+.5,s.y+g,ae(h.progressWidth),ae(h.height)),je(this.parent.labelSettings.taskLabel)||je(this.taskLabel)||("0"!==this.taskLabel&&"0%"!==this.taskLabel&&(f=this.progressWidth),D&&(f=this.width),this.isAutoFit()?T.drawString(this.taskLabel.toString(),t,E,e,s.x+(this.left-l)-(L.left+L.right),s.y+g-(L.top+L.bottom),f,ae(this.height),F):T.drawString(this.taskLabel.toString(),t,E,e,s.x+ae(this.left-l)-(L.left+L.right),s.y+g-(L.top+L.bottom),ae(f),ae(this.height),F))):h.isSpliterTask&&h.segment.map(function(e,t){var i=je(I.taskSegmentStyles)?c:new Ep(I.taskSegmentStyles[t].progressColor),t=je(I.taskSegmentStyles)?u:new Sd(I.taskSegmentStyles[t].progressColor);I.isAutoFit()?T.drawRectangle(i,t,s.x+(I.left+e.left-l)+.5,s.y+g,e.progressWidth,ae(h.height)):T.drawRectangle(i,t,s.x+ae(I.left+e.left-l)+.5,s.y+g,ae(e.progressWidth),ae(h.height))})):this.drawUnscheduledTask(T,s,l,g):(b=v=void 0,this.isAutoFit()?(v=new Jm(new ed(s.x+(this.left-l)+.5+h.width/2,0),new ed(s.x+(this.left-l),0),new se(h.unscheduledTaskBarColor),new se(255,255,255)),T.drawRectangle(v,s.x+(this.left-l)+.5,s.y+g,h.width,ae(h.height)),b=new Jm(new ed(s.x+(this.left-l)+.5+h.width,0),new ed(s.x+(this.left-l)+h.width/2,0),new se(255,255,255),new se(h.unscheduledTaskBarColor)),T.drawRectangle(b,s.x+(this.left-l)+.5+h.width/2,s.y+g,h.width/2,ae(h.height)),(R.value||R.image)&&(w=void 0,je(h.taskbarTemplate.image)?w=0:(w=h.taskbarTemplate.image[0].width,C=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(C,s.x+(this.left-l)+.5,s.y+g,ae(h.taskbarTemplate.image[0].width),ae(h.taskbarTemplate.image[0].height))),je(h.taskbarTemplate.value)||T.drawString(h.taskbarTemplate.value,M,P,k,s.x+(this.left-l)+.5+w,s.y+g,ae(h.width),ae(this.height),F))):(v=new Jm(new ed(s.x+ae(this.left-l)+.5+ae(h.width)/2,0),new ed(s.x+ae(this.left-l),0),new se(h.unscheduledTaskBarColor),new se(255,255,255)),T.drawRectangle(v,s.x+ae(this.left-l)+.5,s.y+g,ae(h.width),ae(h.height)),b=new Jm(new ed(s.x+ae(this.left-l)+.5+ae(h.width),0),new ed(s.x+ae(this.left-l)+ae(h.width)/2,0),new se(255,255,255),new se(h.unscheduledTaskBarColor)),T.drawRectangle(b,s.x+ae(this.left-l)+.5+ae(h.width)/2,s.y+g,ae(h.width)/2,ae(h.height)),(R.value||R.image)&&(w=void 0,je(h.taskbarTemplate.image)?w=0:(w=h.taskbarTemplate.image[0].width,C=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(C,s.x+ae(this.left-l)+.5,s.y+g,ae(h.taskbarTemplate.image[0].width),ae(h.taskbarTemplate.image[0].height))),je(h.taskbarTemplate.value)||T.drawString(h.taskbarTemplate.value,M,P,k,s.x+ae(this.left-l)+.5+w,s.y+g,ae(h.width),ae(this.height),F)))),this.isCompleted=!0,this.startPage=B,this.endPage=B):a.startDate<=U&&a.endDate>=U&&q>=a.endDate?(this.isStartPoint||(this.taskStartPoint=UKt({},s),this.isStartPoint=!0),te=this.width,G=A=m=0,this.width=this.width-(a.totalWidth-(this.left-l)),m=a.totalWidth-(this.left-l),A=a.totalWidth-(this.left-l),G=m=te<m?te:m,this.isScheduledTask||"duration"!==this.unscheduledTaskBy?this.isScheduledTask||"duration"===this.unscheduledTaskBy?!h.isAutoSchedule&&h.isParentTask?(T.save(),(Z=new By).addEllipse(0,0,5,5),this.isAutoFit()?T.translateTransform(s.x+(this.left-l)+.5,s.y+g-2):T.translateTransform(s.x+ae(this.left-l)+.5,s.y+g-2),T.drawPath(_,H,Z),T.restore(),n.dashStyle=Qh.Solid,this.isAutoFit()?T.drawLine(n,new ed(s.x+(this.left-l)+.5,s.y+g),new ed(m+s.x+(this.left-l)+.5,s.y+g)):T.drawLine(n,new ed(s.x+ae(this.left-l)+.5,s.y+g),new ed(ae(m)+s.x+ae(this.left-l)+.5,s.y+g))):h.isAutoSchedule||h.isParentTask?(this.isScheduledTask||"duration"===this.unscheduledTaskBy)&&(this.isScheduledTask||"endDate"!==this.unscheduledTaskBy)?(h.isSpliterTask?(X=!(Y=0),K=0,h.segment.map(function(e){K=e.left+e.width}),o.dashStyle=Qh.Dot,this.isAutoFit()?T.drawLine(o,new ed(s.x+(this.left-l)+.5,s.y+g+ae(h.height/2)),new ed(K+(this.left-l)+s.x,s.y+g+ae(h.height/2))):T.drawLine(o,new ed(s.x+ae(this.left-l)+.5,s.y+g+ae(h.height/2)),new ed(ae(K)+ae(this.left-l)+s.x,s.y+g+ae(h.height/2))),h.segment.map(function(e,t){var i,n,o=je(I.taskSegmentStyles)?d:new Ep(I.taskSegmentStyles[t].taskBorderColor),r=je(I.taskSegmentStyles)?p:new Sd(I.taskSegmentStyles[t].taskColor);I.isAutoFit()?(T.drawRectangle(o,r,s.x+(I.left-l)+.5+e.left,s.y+g,e.width,ae(h.height)),(R.value||R.image)&&(i=void 0,je(h.taskbarTemplate.image)?i=0:(i=h.taskbarTemplate.image[0].width,n=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(n,s.x+(I.left-l)+.5+e.left,s.y+g,h.taskbarTemplate.image[0].width,h.taskbarTemplate.image[0].height)),je(h.taskbarTemplate.value)||T.drawString(h.taskbarTemplate.value,M,P,k,s.x+(I.left-l)+.5+e.left+i,s.y+g,e.width,h.height,F))):(T.drawRectangle(o,r,s.x+ae(I.left-l)+.5+ae(e.left),s.y+g,ae(e.width),ae(h.height)),(R.value||R.image)&&(i=void 0,je(h.taskbarTemplate.image)?i=0:(i=h.taskbarTemplate.image[0].width,n=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(n,s.x+ae(I.left-l)+.5+ae(e.left),s.y+g,ae(h.taskbarTemplate.image[0].width),ae(h.taskbarTemplate.image[0].height))),je(h.taskbarTemplate.value)||T.drawString(h.taskbarTemplate.value,M,P,k,s.x+ae(I.left-l)+.5+ae(e.left)+i,s.y+g,ae(e.width),ae(h.height),F))),(Y=e.left+e.width)<=m?(I.segmentCollection[parseInt(t.toString(),10)].width=0,I.segmentCollection[parseInt(t.toString(),10)].left=0):(m>=Y-e.width?I.segmentCollection[parseInt(t.toString(),10)].left=0:I.segmentCollection[parseInt(t.toString(),10)].left=G-e.left,Y<=m?I.segmentCollection[parseInt(t.toString(),10)].width=0:X&&(I.segmentCollection[parseInt(t.toString(),10)].width=Y-m,X=!1)),G=G+e.width+e.left})):(this.isAutoFit()?je(R.value)&&je(R.image)?T.drawRectangle(d,p,s.x+(this.left-l)+.5,s.y+g,m,ae(h.height)):(T.drawRectangle(d,p,s.x+(this.left-l)+.5,s.y+g,m,ae(h.height)),je(h.taskbarTemplate.image)||(C=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(C,s.x+(this.left-l)+.5,s.y+g+ae((h.height-h.taskbarTemplate.image[0].height)/.5),h.taskbarTemplate.image[0].width/2,h.taskbarTemplate.image[0].height/2)),je(h.taskbarTemplate.value)||(w=je(h.taskbarTemplate.image)?0:h.taskbarTemplate.image[0].width,T.drawString(h.taskbarTemplate.value,M,P,k,s.x+(this.left-l)+w,s.y+g,ae(f),ae(this.height),F))):je(R.value)&&je(R.image)?T.drawRectangle(d,p,s.x+ae(this.left-l)+.5,s.y+g,ae(m),ae(h.height)):(T.drawRectangle(d,p,s.x+ae(this.left-l)+.5,s.y+g,ae(m),ae(h.height)),w=void 0,je(h.taskbarTemplate.image)?w=0:(w=h.taskbarTemplate.image[0].width,C=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(C,s.x+ae(this.left-l)+1,s.y+g+1+ae((h.height-h.taskbarTemplate.image[0].height)/2),ae(h.taskbarTemplate.image[0].width),ae(h.taskbarTemplate.image[0].height))),je(h.taskbarTemplate.value)||(this.stringLeft=ae(this.left),y=this.getWidth(h.taskbarTemplate.value,a.endPoint-this.stringLeft,15),T.drawString(y.lines[0].text,M,P,k,s.x+ae(this.left-l)+w,s.y+g,ae(f),ae(this.height),F),je(y.remainder))||(this.remainString=y.remainder,this.stringLeft=a.endPoint)),h.isAutoSchedule&&!h.isSpliterTask&&(x=0,x=this.progressWidth<=m?this.progressWidth:m,je(R.image)&&je(R.value)&&(this.isAutoFit()?T.drawRectangle(c,u,s.x+(this.left-l)+.5,s.y+g,x,ae(h.height)):T.drawRectangle(c,u,s.x+ae(this.left-l)+.5,s.y+g,ae(x),ae(h.height))),this.progressWidth-=x,this.parent.labelSettings.taskLabel)&&!je(this.taskLabel)&&(f=D?m:x,this.stringLeft=this.left,je(h.taskbarTemplate.value)?(y=this.getWidth(this.taskLabel.toString(),a.endPoint-this.stringLeft,15),T.drawString(y.lines[0].text,t,E,e,s.x+ae(this.left-l),s.y+g,ae(f),ae(this.height),F),je(y.remainder)||(this.remainString=y.remainder,this.stringLeft=a.endPoint)):this.isAutoFit()?T.drawString(this.taskLabel.toString(),t,E,e,s.x+(this.left-l)-(L.left+L.right),s.y+g-(L.top+L.bottom),f,ae(this.height),F):T.drawString(this.taskLabel.toString(),t,E,e,s.x+ae(this.left-l)-(L.left+L.right),s.y+g-(L.top+L.bottom),ae(f),ae(this.height),F))),h.isSpliterTask&&h.segment.map(function(e,t){var i=je(I.taskSegmentStyles)?c:new Ep(I.taskSegmentStyles[t].progressColor),n=je(I.taskSegmentStyles)?u:new Sd(I.taskSegmentStyles[t].progressColor);I.isAutoFit()?T.drawRectangle(i,n,s.x+(I.left+e.left-l)+.5,s.y+g,e.progressWidth,ae(h.height)):T.drawRectangle(i,n,s.x+ae(I.left+e.left-l)+.5,s.y+g,ae(e.progressWidth),ae(h.height)),0===I.segmentCollection[parseInt(t.toString(),10)].width?I.segmentCollection[parseInt(t.toString(),10)].progressWidth=0:e.width-I.segmentCollection[parseInt(t.toString(),10)].width<e.progressWidth&&e.width!==I.segmentCollection[t].width&&(I.segmentCollection[parseInt(t.toString(),10)].progressWidth=e.progressWidth-(e.width-I.segmentCollection[t].width))})):this.drawUnscheduledTask(T,s,l,g):(this.isAutoFit()?T.drawRectangle(V,null,s.x+(this.left-l)+.5,s.y+g,m,ae(h.height)):T.drawRectangle(V,null,s.x+ae(this.left-l)+.5,s.y+g,ae(m),ae(h.height)),T.save(),T.setTransparency(.87),this.isAutoFit()?T.drawRectangle(null,j,s.x+(this.left-l)+.5,s.y+g,m,ae(h.height)):T.drawRectangle(null,j,s.x+ae(this.left-l)+.5,s.y+g,ae(m),ae(h.height)),T.restore(),this.isAutoFit()?T.drawRectangle(null,W,s.x+(this.left-l)+.5,s.y+g,A,ae(h.height)):T.drawRectangle(null,W,s.x+ae(this.left-l)+.5,s.y+g,ae(A),ae(h.height)),h.progressWidth=h.progressWidth-A):this.drawUnscheduledTask(T,s,l,g):(b=v=void 0,this.isAutoFit()?(v=new Jm(new ed(s.x+(this.left-l)+.5+m/2,0),new ed(s.x+(this.left-l),0),new se(h.unscheduledTaskBarColor),new se(255,255,255)),T.drawRectangle(v,s.x+(this.left-l)+.5,s.y+g,m,ae(h.height)),b=new Jm(new ed(s.x+(this.left-l)+.5+m,0),new ed(s.x+(this.left-l)+m/2,0),new se(255,255,255),new se(h.unscheduledTaskBarColor)),T.drawRectangle(b,s.x+(this.left-l)+.5+m/2,s.y+g,m/2,ae(h.height)),(R.value||R.image)&&(w=void 0,je(h.taskbarTemplate.image)?w=0:(w=h.taskbarTemplate.image[0].width,C=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(C,s.x+(this.left-l)+.5,s.y+g,ae(h.taskbarTemplate.image[0].width),ae(h.taskbarTemplate.image[0].height))),je(h.taskbarTemplate.value)||T.drawString(h.taskbarTemplate.value,M,P,k,s.x+(this.left-l)+.5+w,s.y+g,ae(h.width),ae(this.height),F))):(v=new Jm(new ed(s.x+ae(this.left-l)+.5+ae(m)/2,0),new ed(s.x+ae(this.left-l),0),new se(h.unscheduledTaskBarColor),new se(255,255,255)),T.drawRectangle(v,s.x+ae(this.left-l)+.5,s.y+g,ae(m),ae(h.height)),b=new Jm(new ed(s.x+ae(this.left-l)+.5+ae(m),0),new ed(s.x+ae(this.left-l)+ae(m)/2,0),new se(255,255,255),new se(h.unscheduledTaskBarColor)),T.drawRectangle(b,s.x+ae(this.left-l)+.5+ae(m)/2,s.y+g,ae(m)/2,ae(h.height)),(R.value||R.image)&&(w=void 0,je(h.taskbarTemplate.image)?w=0:(w=h.taskbarTemplate.image[0].width,C=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(C,s.x+ae(this.left-l)+.5,s.y+g,ae(h.taskbarTemplate.image[0].width),ae(h.taskbarTemplate.image[0].height))),je(h.taskbarTemplate.value)||T.drawString(h.taskbarTemplate.value,M,P,k,s.x+ae(this.left-l)+.5+w,s.y+g,ae(h.width),ae(this.height),F)))),this.left=0,this.isCompleted=!1,this.startPage=B):q<=a.endDate&&a.startDate<=q&&!this.isCompleted?(this.isStartPoint||(this.taskStartPoint=UKt({},s),this.isStartPoint=!0),this.isScheduledTask||"duration"!==this.unscheduledTaskBy?!h.isAutoSchedule&&h.isParentTask?((J=new By).addEllipse(0,0,5,5),T.save(),Z=s.x+ae(this.left+.5),$=ae(h.width)+Z-5,ee=s.y+g,T.drawLine(n,Z,ee,$,ee),T.translateTransform($,ee-2),T.drawPath(_,H,J),T.restore(),n.dashStyle=Qh.Solid):h.isAutoSchedule||h.isParentTask?this.isScheduledTask||"endDate"!==this.unscheduledTaskBy?h.isSpliterTask?(o.dashStyle=Qh.Dot,T.drawLine(o,new ed(s.x+ae(this.left)+.5,s.y+g+ae(h.height/2)),new ed(ae(h.width)+s.x+ae(this.left),s.y+g+ae(h.height/2))),h.segmentCollection.map(function(e,t){var i=je(I.taskSegmentStyles)?d:new Ep(I.taskSegmentStyles[t].taskBorderColor),t=je(I.taskSegmentStyles)?p:new Sd(I.taskSegmentStyles[t].taskColor);0!==e.width&&(T.drawRectangle(i,t,s.x+ae(h.left+.5+e.left),s.y+g,ae(e.width),ae(h.height)),R.value||R.image)&&(i=void 0,je(h.taskbarTemplate.image)?i=0:(i=h.taskbarTemplate.image[0].width,t=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(t,s.x+ae(h.left+.5+e.left),s.y+g,ae(h.taskbarTemplate.image[0].width),ae(h.taskbarTemplate.image[0].height))),je(h.taskbarTemplate.value)||T.drawString(h.taskbarTemplate.value,M,P,k,s.x+ae(h.left+.5+e.left)+i,s.y+g,ae(e.width),ae(h.height),F))})):T.drawRectangle(d,p,s.x+ae(h.left+.5),s.y+g,ae(h.width),ae(h.height)):this.drawUnscheduledTask(T,s,l,g):(T.drawRectangle(V,null,s.x+ae(this.left+.5),s.y+g,ae(h.width),ae(h.height)),T.save(),T.setTransparency(.87),T.drawRectangle(null,j,s.x+ae(this.left+.5),s.y+g,ae(h.width),ae(h.height)),T.restore(),T.drawRectangle(null,W,s.x+ae(this.left+.5),s.y+g,ae(h.progressWidth),ae(h.height))):(b=v=void 0,v=new Jm(new ed(s.x+ae(h.left+.5)+ae(h.width)/2,0),new ed(s.x+ae(h.left+.5),0),new se(h.unscheduledTaskBarColor),new se(255,255,255)),T.drawRectangle(v,s.x+ae(h.left+.5),s.y+g,ae(h.width),ae(h.height)),b=new Jm(new ed(s.x+ae(h.left+.5)+ae(h.width),0),new ed(s.x+ae(h.left+.5)+ae(h.width)/2,0),new se(255,255,255),new se(h.unscheduledTaskBarColor)),T.drawRectangle(b,s.x+ae(h.left+.5)+ae(h.width)/2,s.y+g,ae(h.width)/2,ae(h.height)),(R.value||R.image)&&(w=void 0,je(h.taskbarTemplate.image)?w=0:(w=h.taskbarTemplate.image[0].width,C=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(C,s.x+ae(h.left+.5),s.y+g,ae(h.taskbarTemplate.image[0].width),ae(h.taskbarTemplate.image[0].height))),je(h.taskbarTemplate.value)||T.drawString(h.taskbarTemplate.value,M,P,k,s.x+ae(h.left+.5)+w,s.y+g,ae(h.width),ae(this.height),F))),this.isScheduledTask&&h.isAutoSchedule&&!h.isSpliterTask?(je(R.image)&&je(R.value)&&T.drawRectangle(c,u,s.x+ae(h.left+.5),s.y+g,ae(h.progressWidth),ae(h.height)),je(this.taskLabel)||(f=this.progressWidth,D&&(f=this.width),D&&je(h.taskbarTemplate.value)?je(this.remainString)||(y=this.getWidth(this.remainString,a.endPoint-this.stringLeft,15),T.drawString(y.lines[0].text,t,E,e,s.x+ae(this.left)-(L.left+L.right),s.y+g-(L.top+L.bottom),ae(f),ae(this.height),F)):je(this.taskLabel)||D||(f=this.progressWidth,D&&(f=this.width),T.drawString(this.taskLabel.toString(),t,E,e,s.x+ae(this.left)-(L.left+L.right),s.y+g-(L.top+L.bottom),ae(f),ae(this.height),F)))):h.isSpliterTask&&h.segmentCollection.map(function(e,t){var i=je(I.taskSegmentStyles)?c:new Ep(I.taskSegmentStyles[t].progressColor),t=je(I.taskSegmentStyles)?u:new Sd(I.taskSegmentStyles[t].progressColor);T.drawRectangle(i,t,s.x+ae(h.left+.5+e.left),s.y+g,ae(e.progressWidth),ae(h.height))}),this.isCompleted=!0,this.endPage=B):U<a.startDate&&q>a.endDate&&(this.isStartPoint||(this.taskStartPoint=UKt({},s),this.isStartPoint=!0),this.isScheduledTask||"duration"!==this.unscheduledTaskBy?this.isScheduledTask||"endDate"!==this.unscheduledTaskBy?h.isAutoSchedule||h.isParentTask?!h.isAutoSchedule&&h.isParentTask?(n.dashStyle=Qh.Solid,T.drawLine(n,s.x+ae(h.left)+.5,s.y+g,ae(a.totalWidth),s.y+g)):(T.drawRectangle(d,p,s.x+ae(h.left)+.5,s.y+g,ae(a.totalWidth),ae(h.height)),je(h.taskbarTemplate.value)||je(this.remainString)||(y=this.getWidth(this.remainString,a.endPoint-this.stringLeft,15),T.drawString(y.lines[0].text,M,P,k,s.x+ae(h.left)+.5,s.y+g,ae(a.totalWidth),ae(this.height),F)),this.isScheduledTask&&!h.isParentTask&&(x=0,x=this.progressWidth<=a.totalWidth?this.progressWidth:a.totalWidth,je(R.image)&&je(R.value)&&T.drawRectangle(c,u,s.x+ae(h.left)+.5,s.y+g,ae(x),ae(h.height)),this.progressWidth-=x,je(this.taskLabel)||(f=x,D&&(f=this.width),T.drawString(this.taskLabel.toString(),t,E,e,s.x+ae(this.left)-(L.left+L.right),s.y+g-(L.top+L.bottom),ae(f),ae(this.height),F)))):(T.drawRectangle(V,null,s.x+ae(h.left)+.5,s.y+g,ae(a.totalWidth),ae(h.height)),T.save(),T.setTransparency(.87),T.drawRectangle(null,j,s.x+ae(h.left)+.5,s.y+g,ae(a.totalWidth),ae(h.height)),T.restore(),x=0,x=this.progressWidth<=a.totalWidth?this.progressWidth:a.totalWidth,je(R.image)&&je(R.value)&&T.drawRectangle(c,u,s.x+ae(h.left)+.5,s.y+g,ae(x),ae(h.height)),this.progressWidth-=x,T.drawRectangle(null,W,s.x+ae(h.left)+.5,s.y+g,ae(x),ae(h.height))):this.drawUnscheduledTask(T,s,l,g):(b=v=void 0,v=new Jm(new ed(s.x+ae(h.left)+.5+ae(a.totalWidth)/2,0),new ed(s.x+ae(h.left),0),new se(h.unscheduledTaskBarColor),new se(255,255,255)),T.drawRectangle(v,s.x+ae(h.left)+.5,s.y+g,ae(a.totalWidth),ae(h.height)),b=new Jm(new ed(s.x+ae(h.left)+.5+ae(a.totalWidth),0),new ed(s.x+ae(h.left)+ae(a.totalWidth)/2,0),new se(255,255,255),new se(h.unscheduledTaskBarColor)),T.drawRectangle(b,s.x+ae(h.left)+.5+ae(a.totalWidth)/2,s.y+g,ae(a.totalWidth)/2,ae(h.height)),(R.value||R.image)&&(w=void 0,je(h.taskbarTemplate.image)?w=0:(w=h.taskbarTemplate.image[0].width,C=new oc(h.taskbarTemplate.image[0].base64),T.drawImage(C,s.x+ae(h.left)+.5,s.y+g,ae(h.taskbarTemplate.image[0].width),ae(h.taskbarTemplate.image[0].height))),je(h.taskbarTemplate.value)||T.drawString(h.taskbarTemplate.value,M,P,k,s.x+ae(h.left+.5)+w,s.y+g,ae(h.width),ae(this.height),F))),this.isCompleted=!1,this.width-=a.totalWidth),this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&(a.startDate<=h.baselineStartDate&&h.baselineEndDate<=a.endDate?(this.isStartPoint||(this.taskStartPoint=UKt({},s),this.isStartPoint=!0),this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&(this.isAutoFit()?T.drawRectangle(oe,re,s.x+(h.baselineLeft-l)+.5,s.y+g+ae(h.height+3),h.baselineWidth,ae(this.baselineHeight)):T.drawRectangle(oe,re,s.x+ae(h.baselineLeft-l)+.5,s.y+g+ae(h.height+3),ae(h.baselineWidth),ae(this.baselineHeight))),this.isCompletedBaseline=!0,this.startPage=B,this.endPage=B):a.startDate<=h.baselineStartDate&&a.endDate>=h.baselineStartDate&&h.baselineEndDate>=a.endDate?(this.isStartPoint||(this.taskStartPoint=UKt({},s),this.isStartPoint=!0),S=0,(te=this.baselineWidth)<(S=a.totalWidth-(h.baselineLeft-l))&&(S=te),this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&(this.isAutoFit()?T.drawRectangle(oe,re,s.x+(h.baselineLeft-l)+.5,s.y+g+ae(h.height+3),S,ae(this.baselineHeight)):T.drawRectangle(oe,re,s.x+ae(h.baselineLeft-l)+.5,s.y+g+ae(h.height+3),ae(S),ae(this.baselineHeight))),h.baselineWidth=h.baselineWidth-S,this.baselineLeft=0,this.isCompletedBaseline=!1,this.startPage=B):h.baselineEndDate<=a.endDate&&a.startDate<=h.baselineEndDate&&!this.isCompletedBaseline?(this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&(this.isAutoFit()?T.drawRectangle(oe,re,s.x+(h.baselineLeft+.5),s.y+g+ae(h.height+3),h.baselineWidth,ae(this.baselineHeight)):T.drawRectangle(oe,re,s.x+ae(h.baselineLeft+.5),s.y+g+ae(h.height+3),ae(h.baselineWidth),ae(this.baselineHeight))),this.isCompletedBaseline=!0,this.endPage=B):h.baselineStartDate<a.startDate&&h.baselineEndDate>a.endDate&&(this.parent.renderBaseline&&h.baselineStartDate&&h.baselineEndDate&&(this.isAutoFit()?T.drawRectangle(oe,re,s.x+h.baselineLeft+.5,s.y+g+ae(h.height+3),a.totalWidth,ae(h.baselineHeight)):T.drawRectangle(oe,re,s.x+ae(h.baselineLeft)+.5,s.y+g+ae(h.height+3),ae(a.totalWidth),ae(h.baselineHeight))),this.isCompletedBaseline=!1,this.baselineWidth-=a.totalWidth)),!this.isAutoSchedule&&h.isParentTask&&(a.startDate<=h.autoStartDate&&h.autoEndDate<=a.endDate?(this.isStartPoint||(this.taskStartPoint=UKt({},s),this.isStartPoint=!0),!h.isAutoSchedule&&h.isParentTask&&(this.isAutoFit()?T.drawRectangle(i,null,s.x+(this.autoLeft-l)+.5,s.y+g+10,this.autoWidth,ae(12)):T.drawRectangle(i,null,s.x+ae(this.autoLeft-l)+.5,s.y+g+10,ae(this.autoWidth),ae(12)),T.save(),T.setTransparency(.87),this.isAutoFit()?T.drawRectangle(null,z,s.x+(this.autoLeft-l)+.5,s.y+g+10,this.autoWidth,ae(12)):T.drawRectangle(null,z,s.x+ae(this.autoLeft-l)+.5,s.y+g+10,ae(this.autoWidth),ae(12)),T.restore(),this.isAutoFit()?T.drawRectangle(null,Q,s.x+(this.autoLeft-l)+.5,s.y+g+10,h.progressWidth,ae(12)):T.drawRectangle(null,Q,s.x+ae(this.autoLeft-l)+.5,s.y+g+10,ae(h.progressWidth),ae(12))),this.isCompletedAutotask=!0,this.startPage=B,this.endPage=B):a.startDate<=h.autoStartDate&&a.endDate>=h.autoStartDate&&h.autoEndDate>=a.endDate?(this.isStartPoint||(this.taskStartPoint=UKt({},s),this.isStartPoint=!0),A=S=0,S=a.totalWidth-(this.autoLeft-l),A=a.totalWidth-(this.autoLeft-l),!h.isAutoSchedule&&h.isParentTask&&(this.isAutoFit()?T.drawRectangle(i,null,s.x+(this.autoLeft-l)+.5,s.y+g+10,S,ae(12)):T.drawRectangle(i,null,s.x+ae(this.autoLeft-l)+.5,s.y+g+10,ae(S),ae(12)),T.save(),T.setTransparency(.87),this.isAutoFit()?T.drawRectangle(null,z,s.x+(this.autoLeft-l)+.5,s.y+g+10,S,ae(12)):T.drawRectangle(null,z,s.x+ae(this.autoLeft-l)+.5,s.y+g+10,ae(S),ae(12)),T.restore(),this.isAutoFit()?T.drawRectangle(null,Q,s.x+(this.autoLeft-l)+.5,s.y+g+10,h.progressWidth,ae(12)):T.drawRectangle(null,Q,s.x+ae(this.autoLeft-l)+.5,s.y+g+10,ae(A),ae(12)),h.autoWidth=h.autoWidth-S,h.progressWidth=h.progressWidth-A),this.autoLeft=0,this.isCompletedAutotask=!1,this.startPage=B):h.autoEndDate<=a.endDate&&a.startDate<=h.autoEndDate&&!this.isCompletedAutotask?(this.isStartPoint?!h.isAutoSchedule&&h.isParentTask&&(T.drawRectangle(i,null,s.x+ae(this.autoLeft+.5),s.y+g+10,ae(h.autoWidth),ae(12)),T.save(),T.setTransparency(.87),T.drawRectangle(z,s.x+ae(this.autoLeft+.5),s.y+g+10,ae(h.autoWidth),ae(12)),T.restore(),T.drawRectangle(null,Q,s.x+ae(this.autoLeft+.5),s.y+g+10,ae(h.progressWidth),ae(12))):(this.taskStartPoint=UKt({},s),this.isStartPoint=!0),this.isCompletedAutotask=!0,this.endPage=B):h.autoStartDate<a.startDate&&h.autoEndDate>a.endDate&&(this.isStartPoint||(this.taskStartPoint=UKt({},s),this.isStartPoint=!0),!h.isAutoSchedule&&h.isParentTask&&(x=0,x=this.progressWidth<=a.totalWidth?this.progressWidth:a.totalWidth,this.isAutoFit()?T.drawRectangle(null,Q,s.x+(this.autoLeft+.5),s.y+g+10,x,ae(12)):0!==h.progressWidth&&T.drawRectangle(null,Q,s.x+ae(this.autoLeft+.5),s.y+g+10,ae(x),ae(12)),this.progressWidth-=x,this.isAutoFit()?T.drawRectangle(i,null,s.x+this.autoLeft+.5,s.y+g+10,a.totalWidth,ae(12)):T.drawRectangle(i,null,s.x+ae(this.autoLeft)+.5,s.y+g+10,ae(a.totalWidth),ae(12)),T.save(),T.setTransparency(.87),this.isAutoFit()?T.drawRectangle(null,z,s.x+(this.autoLeft-l)+.5,s.y+g+10,a.totalWidth,ae(12)):T.drawRectangle(null,z,s.x+ae(this.autoLeft)+.5,s.y+g+10,ae(a.totalWidth),ae(12)),T.restore()),this.isCompletedAutotask=!1,this.autoWidth-=a.totalWidth)),!je(h.indicators)&&0<h.indicators.length&&h.indicators.map(function(e,t){var i,n,o=I.parent.dateValidationModule.getDateFromFormat(e.date,!0);a.startDate<=o&&o<=a.endDate&&(o=I.parent.chartRowsModule.getIndicatorleft(e.date),je(e.base64)||(i=new oc(e.base64),I.isAutoFit()?(T.drawImage(i,s.x+(o-l)+.5+10-I.parent.perDayWidth/2,s.y+g,10,10),n=T.save(),T.setClip(new id(s.x,s.y,r.contentWidth,O)),T.drawString(e.name,ne,null,jm.Black,s.x+(o-l)+.5+15+10-I.parent.perDayWidth/2,s.y+g,null)):(T.drawImage(i,s.x+ae(o-l)+.5+10,s.y+g,10,10),n=T.save(),T.setClip(new id(s.x,s.y,r.contentWidth,O)),T.drawString(e.name,ne,null,jm.Black,s.x+ae(o-l)+.5+15+10,s.y+g,null)),T.restore(n)))})),this.drawRightLabel(r,s,a,l),ie},GKt.prototype.getPdfFont=function(e){var t,i,n;return e&&e.label&&(e.label.fontSize||e.label.fontStyle||e.label.fontFamily)&&(t=e.label.fontSize||9,i=e.label.fontFamily,i=e.label.fontFamily?i:this.fontFamily,n=e.label.fontStyle,e=e.label.fontStyle?this.parent.pdfExportModule.helper.getFontStyle(n):hd.Regular,n=new cg(i,t,e)),n},GKt.prototype.drawRightLabel=function(e,t,i,n){var o=e.graphics;if(je(this.rightTaskLabel.value))if(je(this.labelSettings.rightLabel.image))this.labelSettings.rightLabel.value&&this.drawRightLabelValue(e,t,i,n,this.labelSettings.rightLabel.value);else{this.previousWidthofRightImage=0;for(var r,s=this.previousWidthofRightValue=0;s<this.labelSettings.rightLabel.image.length;s++)this.drawRigthlabelImage(e,t,i,n,this.labelSettings.rightLabel.image[s]),this.labelSettings.rightLabel.value&&(r=this.labelSettings.rightLabel.value.split(","))&&(this.rightTaskLabel.isCompleted=!1,this.drawRightLabelValue(e,t,i,n-this.spaceBetweenImageAndValue,r[s]))}else{var a,l,h,d,p,c,u,g=this.rightTaskLabel.isLeftCalculated||this.isAutoFit()?this.rightTaskLabel.left:ae(this.rightTaskLabel.left),m=void 0,m=this.isAutoFit()?g-n+t.x:g-ae(n)+t.x,g=this.isAutoFit()?ae(g):g;i.startPoint<=g&&g<i.endPoint&&!je(this.rightTaskLabel.value)&&!this.rightTaskLabel.isCompleted&&(g=this.getWidth(this.rightTaskLabel.value,i.endPoint-g,15),a=new cg(this.fontFamily,9),l=void 0,je(u=this.parent.pdfExportModule.helper.exportProps.ganttStyle)||je(u.label)||je(u.label.fontSize)&&je(u.label.fontStyle)&&je(u.label.fontFamily)||(l=this.getPdfFont(u)),je(l)||(a=l),l={left:0,right:0,top:0,bottom:0},je(u)||je(u.label)||je(u.label.padding)||(l=u.label.padding),!je(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(a=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),h=(ae(this.parent.rowHeight)-g.actualSize.height)/2,h=new ed(m+l.left,t.y+h+l.top),m=new td(e.contentWidth-m-(l.left+l.right),g.actualSize.height-(l.top+l.bottom)),l=new id(h,m),(h=new xd).alignment=Hh.Left,h.lineAlignment=_h.Middle,je(u)||je(u.label)||je(u.label.format)||je(u.label.format.alignment)||(h.alignment=u.label.format.alignment),0<g.actualSize.width?(u=this.parent.pdfExportModule.helper.exportProps.ganttStyle,d=new Sd(u&&u.label&&u.label.fontBrush?u.label.fontBrush:this.labelColor),p=null,je(u)||je(u.label)||je(u.label.backgroundColor)||(p=new Sd(u.label.backgroundColor)),c=null,je(u)||je(u.label)||je(u.label.borderColor)||(c=new Ep(u.label.borderColor)),u=a.measureString(g.lines[0].text),o.drawRectangle(c,p,l.x-3,l.y,u.width+6,u.height),o.drawString(g.lines[0].text,a,null,d,l.x,l.y,m.width,m.height,h),null!==g.remainder?(this.rightTaskLabel.value=g.remainder,this.rightTaskLabel.left=i.endPoint,this.rightTaskLabel.isLeftCalculated=!0):this.rightTaskLabel.isCompleted=!0):this.rightTaskLabel.left=i.endPoint)}},GKt.prototype.drawRigthlabelImage=function(e,t,i,n,o){var r,s,e=e.graphics;je(this.labelSettings.rightLabel)||je(this.labelSettings.rightLabel.image)||(s=void(this.labelSettings.isLeftCalculated?r=this.rightTaskLabel.left:this.isAutoFit()?1<this.labelSettings.rightLabel.image.length?(r=this.rightTaskLabel.left+ +this.previousWidthofRightValue,this.previousWidthofRightImage=o.width):r=this.rightTaskLabel.left:(s=void 0,je(this.labelSettings.rightLabel.value)||(s=this.labelSettings.rightLabel.value.split(",")),1<this.labelSettings.rightLabel.image.length&&1<s.length?(r=ae(this.rightTaskLabel.left)+this.previousWidthofRightValue,this.previousWidthofRightImage=o.width):1<this.labelSettings.rightLabel.image.length?(r=ae(this.rightTaskLabel.left)+this.previousWidthofRightImage,this.previousWidthofRightImage=o.width):r=ae(this.rightTaskLabel.left))),s=this.isAutoFit()?r-n+t.x:r-ae(n)+t.x,n=this.isAutoFit()?ae(r):r,i.startPoint<=n&&n<i.endPoint&&!je(this.labelSettings.rightLabel)&&!this.rightTaskLabel.isCompleted&&(r=new td(o.width,o.height),n=(ae(this.parent.rowHeight)-r.height)/2,s=new ed(s,t.y+n),t=new td(r.width,r.height),n=new id(s,t),s=new oc(o.base64),0<r.width?(e.drawImage(s,n.x,n.y,r.width,r.height),null!==this.labelSettings.rightLabel.value?this.rightTaskLabel.isLeftCalculated=!0:je(this.labelSettings.rightLabel.value)&&(this.rightTaskLabel.isCompleted=!0)):this.rightTaskLabel.left=i.endPoint))},GKt.prototype.drawRightLabelValue=function(e,t,i,n,o){var r,s,a,e=e.graphics;je(this.labelSettings.rightLabel.value)||(s=void(this.labelSettings.isLeftCalculated?a=this.rightTaskLabel.left:this.isAutoFit()?this.labelSettings.rightLabel.image?1<this.labelSettings.rightLabel.image.length?(a=this.rightTaskLabel.left+this.previousWidthofRightImage+this.previousWidthofRightValue,je(o)||(r=this.getWidthofrightLabel(o,i.endPoint-a,15),this.previousWidthofRightValue+=r.actualSize.width+this.previousWidthofRightImage)):a=this.rightTaskLabel.left+this.labelSettings.rightLabel.image[0].width:a=this.rightTaskLabel.left:this.labelSettings.rightLabel.image?1<this.labelSettings.rightLabel.image.length?(a=ae(this.rightTaskLabel.left)+this.previousWidthofRightImage+this.previousWidthofRightValue,je(o)||(r=this.getWidthofrightLabel(o,i.endPoint-a,15),this.previousWidthofRightValue+=r.actualSize.width+this.previousWidthofRightImage)):a=ae(this.rightTaskLabel.left)+this.labelSettings.rightLabel.image[0].width:a=ae(this.rightTaskLabel.left)),s=this.isAutoFit()?a-n+t.x:a-ae(n)+t.x,n=this.isAutoFit()?ae(a):a,i.startPoint<=n&&n<i.endPoint&&!je(o)&&!this.rightTaskLabel.isCompleted&&(r=this.getWidthofrightLabel(o,i.endPoint-n,15),a=new cg(this.fontFamily,9),!je(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(a=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),n=(ae(this.parent.rowHeight)-r.actualSize.height)/2,s=new ed(s,t.y+n),t=new td(r.actualSize.width,r.actualSize.height),n=new id(s,t),(s=new xd).alignment=Hh.Right,s.lineAlignment=_h.Middle,0<r.actualSize.width?(t=new Sd(this.labelColor),a=this.labelSettings.rightLabel.fontStyle.fontSize?new cg(this.labelSettings.rightLabel.fontStyle.fontFamily,this.labelSettings.rightLabel.fontStyle.fontSize,this.labelSettings.rightLabel.fontStyle.fontStyle):a,t=this.labelSettings.rightLabel.fontStyle.fontColor?new Sd(this.labelSettings.rightLabel.fontStyle.fontColor):t,e.drawString(o,a,null,t,n.x,n.y,r.actualSize.width,r.actualSize.height,s),je(r.remainder)||null===r.remainder?je(this.labelSettings.rightLabel.value)&&(this.rightTaskLabel.isCompleted=!0):(this.rightTaskLabel.value=r.remainder,this.rightTaskLabel.left=i.endPoint,this.rightTaskLabel.isLeftCalculated=!0)):this.rightTaskLabel.left=i.endPoint))},GKt.prototype.drawLeftLabel=function(e,t,i,n,o){var r=e.graphics;if(je(this.leftTaskLabel.value))if(je(this.labelSettings.leftLabel)||je(this.labelSettings.leftLabel.image))je(this.labelSettings.leftLabel)||je(this.labelSettings.leftLabel.value)||this.drawLeftLabelValue(e,t,i,n,this.labelSettings.leftLabel.value);else{this.previousWidthofLeftImage=0,this.previousWidthofLeftValue=0;for(var s=this.totalLeftWidth=0;s<this.labelSettings.leftLabel.image.length;s++){var a=void 0,l=void 0,h=(je(this.labelSettings.leftLabel.value)||(a=this.labelSettings.leftLabel.value.split(","),l=this.getWidth(a[s],Number.MAX_VALUE,15)),je(l)?0:l.actualSize.width);this.totalLeftWidth+=this.labelSettings.leftLabel.image[s].width+h}for(s=0;s<this.labelSettings.leftLabel.image.length;s++)this.drawLeftLabelImage(e,t,i,n,this.labelSettings.leftLabel.image[s]),this.labelSettings.leftLabel.value&&(a=this.labelSettings.leftLabel.value.split(","))&&this.drawLeftLabelValue(e,t,i,n-this.spaceBetweenImageAndValue,a[s])}else{var l,d,p,c,u,g,m=this.left,m=(this.leftTaskLabel.isLeftCalculated?p=this.leftTaskLabel.left:(l=this.getWidth(this.leftTaskLabel.value,Number.MAX_VALUE,15),d=this.isMilestone?Math.floor(this.parent.chartRowsModule.taskBarHeight/2)+33:33,p=this.isAutoFit()?m-d-l.actualSize.width:ae(m-d)-l.actualSize.width,this.leftTaskLabel.left=p,this.leftTaskLabel.isLeftCalculated=!0),void 0);this.isAutoFit()?(m=p-ae(n)+t.x,!o.isAutoSchedule&&o.isParentTask&&(g=o.left-o.autoLeft,m=o.left<o.autoLeft?p-n+t.x:p-n+t.x-g)):(m=p-ae(n)+t.x,!o.isAutoSchedule&&o.isParentTask&&(g=ae(o.left)-ae(o.autoLeft),m=o.left<o.autoLeft?p-ae(n)+t.x:p-ae(n)+t.x-g)),i.startPoint<=p&&p<i.endPoint&&!je(this.leftTaskLabel.value)&&!this.leftTaskLabel.isCompleted&&(l=this.getWidth(this.leftTaskLabel.value,i.endPoint-p,15),d=new cg(this.fontFamily,9),o=void 0,je(g=this.parent.pdfExportModule.helper.exportProps.ganttStyle)||je(g.label)||je(g.label.fontSize)&&je(g.label.fontStyle)&&je(g.label.fontFamily)||(o=this.getPdfFont(g)),je(o)||(d=o),!je(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(d=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),p={left:0,right:0,top:0,bottom:0},je(g)||je(g.label)||je(g.label.padding)||(p=g.label.padding),o=(ae(this.parent.rowHeight)-l.actualSize.height)/2,m=new ed(m+p.left,t.y+o+p.top),o=new td(l.actualSize.width-(p.left+p.right),l.actualSize.height-(p.top+p.bottom)),p=new id(m,o),(m=new xd).alignment=Hh.Right,m.lineAlignment=_h.Middle,0<l.actualSize.width?(o=new Sd(g&&g.label&&g.label.fontBrush?g.label.fontBrush:this.labelColor),c=null,je(g)||je(g.label)||je(g.label.backgroundColor)||(c=new Sd(g.label.backgroundColor)),u=null,je(g)||je(g.label)||je(g.label.borderColor)||(u=new Ep(g.label.borderColor)),g=d.measureString(l.lines[0].text),r.drawRectangle(u,c,p.x-3,p.y,g.width+6,g.height),r.drawString(l.lines[0].text,d,null,o,p.x,p.y,l.actualSize.width,l.actualSize.height,m),null!==l.remainder?(this.leftTaskLabel.value=l.remainder,this.leftTaskLabel.left=i.endPoint):this.leftTaskLabel.isCompleted=!0):this.leftTaskLabel.left=i.endPoint)}},GKt.prototype.drawLeftLabelImage=function(e,t,i,n,o){var r,s,a,l,e=e.graphics,h=this.left;je(this.labelSettings.leftLabel)||je(this.labelSettings.leftLabel.image)||(l=void(this.leftTaskLabel.isLeftCalculated?a=1<this.labelSettings.leftLabel.image.length?this.leftTaskLabel.left+this.previousWidthofLeftValue:this.leftTaskLabel.left:(r=new td(o.width,o.height),s=this.isMilestone?Math.floor(this.parent.chartRowsModule.taskBarHeight/2)+33:33,l=this.labelSettings.leftLabel.value.split(","),this.isAutoFit()?0<this.labelSettings.leftLabel.image.length&&0<l.length?(a=h-this.totalLeftWidth-r.width,this.previousWidthofLeftImage+=r.width):a=h-s-r.width:0<this.labelSettings.leftLabel.image.length&&0<l.length?(a=ae(h)-this.totalLeftWidth-r.width,this.previousWidthofLeftImage+=r.width):a=ae(h-s)-r.width,this.leftTaskLabel.left=a,this.leftTaskLabel.isLeftCalculated=!0)),this.isAutoFit(),l=a-ae(n)+t.x,i.startPoint<=a&&a<i.endPoint&&!je(o)&&!this.leftTaskLabel.isCompleted&&(r=new td(o.width,o.height),h=(ae(this.parent.rowHeight)-r.height)/2,s=new ed(l,t.y+h),n=new td(r.width,r.height),a=new id(s,n),l=new oc(o.base64),0<r.width?(e.drawImage(l,a.x,a.y,r.width,r.height),this.totalLeftWidth=this.totalLeftWidth-r.width):this.leftTaskLabel.left=i.endPoint))},GKt.prototype.drawLeftLabelValue=function(e,t,i,n,o){var r,s,a,l,h,d,p,c,u,e=e.graphics;je(o)||(l=0,l=this.left,c=void(this.leftTaskLabel.isLeftCalculated?1===(u=this.labelSettings.leftLabel.value.split(",")).length?(d=this.leftTaskLabel.left+(this.previousWidthofLeftImage||0),this.labelSettings.left=d,r=this.getWidthofLeftLabel(o,Number.MAX_VALUE,15),this.previousWidthofLeftValue+=this.previousWidthofLeftImage+r.actualSize.width):1<u.length?(s=0!==this.previousWidthofLeftValue?this.previousWidthofLeftValue+this.previousWidthofLeftImage:this.previousWidthofLeftImage,d=this.leftTaskLabel.left+s,this.labelSettings.left=d,r=this.getWidthofLeftLabel(o,Number.MAX_VALUE,15),this.previousWidthofLeftValue+=this.previousWidthofLeftImage+r.actualSize.width):d=this.leftTaskLabel.left:(r=this.getWidthofLeftLabel(o,Number.MAX_VALUE,15),h=this.isMilestone?Math.floor(this.parent.chartRowsModule.taskBarHeight/2)+33:33,u=this.labelSettings.leftLabel.value.split(","),this.isAutoFit()?(p=(c=!je(this.labelSettings.leftLabel.image))?this.labelSettings.leftLabel.image.length:0,1===u.length&&c&&1===p?(d=this.leftTaskLabel.left+this.previousWidthofLeftImage,this.labelSettings.left=d,a=this.getWidthofLeftLabel(o,Number.MAX_VALUE,15),this.previousWidthofLeftValue+=this.previousWidthofLeftImage+a.actualSize.width):1<u.length&&c&&1<p?(s=0!==this.previousWidthofLeftValue?this.previousWidthofLeftValue+this.previousWidthofLeftImage:this.previousWidthofLeftImage,d=this.leftTaskLabel.left+s,this.labelSettings.left=d,a=this.getWidthofLeftLabel(o,Number.MAX_VALUE,15),this.previousWidthofLeftValue+=this.previousWidthofLeftImage+a.actualSize.width):d=l-h-r.actualSize.width):d=ae(l-h)-r.actualSize.width,this.leftTaskLabel.left=d,this.leftTaskLabel.isLeftCalculated=!0)),this.isAutoFit(),c=d-ae(n)+t.x,p=this.isAutoFit()?ae(d):d,i.startPoint<=p&&p<i.endPoint&&!je(o)&&!this.leftTaskLabel.isCompleted&&(r=this.getWidthofLeftLabel(o,i.endPoint-p,15),s=new cg(this.fontFamily,9),!je(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(s=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),a=(ae(this.parent.rowHeight)-r.actualSize.height)/2,l=new ed(c,t.y+a),h=new td(r.actualSize.width,r.actualSize.height),n=new id(l,h),(d=new xd).alignment=Hh.Right,d.lineAlignment=_h.Middle,0<r.actualSize.width?(p=new Sd(this.labelColor),c=this.labelSettings.leftLabel.fontStyle.fontSize?new cg(this.labelSettings.leftLabel.fontStyle.fontFamily,this.labelSettings.leftLabel.fontStyle.fontSize,this.labelSettings.leftLabel.fontStyle.fontStyle):s,t=this.labelSettings.leftLabel.fontStyle.fontColor?new Sd(this.labelSettings.leftLabel.fontStyle.fontColor):p,e.drawString(o,c,null,t,n.x,n.y,r.actualSize.width,r.actualSize.height,d),u=this.labelSettings.leftLabel.value.split(","),je(r.remainder)||null===r.remainder?je(this.labelSettings.leftLabel.image)||1!==this.labelSettings.leftLabel.image.length||1!==u.length||(this.leftTaskLabel.isCompleted=!0):(this.leftTaskLabel.value=r.remainder,this.leftTaskLabel.left=i.endPoint)):this.leftTaskLabel.left=i.endPoint))},GKt.prototype.getWidth=function(e,t,i){var n=new cg(this.fontFamily,9),o=this.parent.pdfExportModule.helper.exportProps.ganttStyle,o=(je(o)||je(o.label)||je(o.label.fontSize)&&je(o.label.fontStyle)&&je(o.label.fontFamily)||(i=(n=this.getPdfFont(o)).height),!je(o)&&o.font&&(i=(n=o.font).height),new Dd),r=new xd;return r.alignment=Hh.Left,r.wordWrap=cd.Character,r.lineAlignment=_h.Middle,o.layout(e,n,r,new td(t,i),!1,new td(t,i))},GKt.prototype.getWidthofLeftLabel=function(e,t,i){var n=new cg(this.labelSettings.leftLabel.fontStyle.fontFamily,this.labelSettings.leftLabel.fontStyle.fontSize),n=this.labelSettings.leftLabel.fontStyle.fontSize?n:new cg(this.fontFamily,9),o=(!je(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(n=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),new Dd),r=new xd;return r.alignment=Hh.Left,r.wordWrap=cd.Character,r.lineAlignment=_h.Middle,o.layout(e,n,r,new td(t,i),!1,new td(t,i))},GKt.prototype.getWidthofrightLabel=function(e,t,i){var n=new cg(this.labelSettings.rightLabel.fontStyle.fontFamily,this.labelSettings.rightLabel.fontStyle.fontSize),n=this.labelSettings.rightLabel.fontStyle.fontSize?n:new cg(this.fontFamily,9),o=(!je(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(n=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),new Dd),r=new xd;return r.alignment=Hh.Left,r.wordWrap=cd.Character,r.lineAlignment=_h.Middle,o.layout(e,n,r,new td(t,i),!1,new td(t,i))},GKt.prototype.drawUnscheduledTask=function(e,t,i,n){var o=new Sd(this.taskColor);this.isAutoFit()?e.drawRectangle(o,t.x+(this.left-i),t.y+n,ae(3),ae(this.height)):e.drawRectangle(o,t.x+ae(this.left-i),t.y+n,ae(3),ae(this.height))},GKt.prototype.drawMilestone=function(e,t,i,n,o,r){var s,a,l,h,d,p,c,u;i.startDate<=this.startDate&&this.startDate<=i.endDate&&(i=e.graphics,e=e.section.indexOf(e),this.taskStartPoint=UKt({},t),s=new Ep(this.milestoneColor),a=ae((this.parent.rowHeight-this.height)/3),l=ae((this.parent.rowHeight-this.height)/2),a=this.parent.renderBaseline?a:l,l=new Sd(this.milestoneColor),d=new Ep(this.baselineBorderColor),p=new Sd(this.baselineColor),i.save(),h=Math.floor(.8*this.parent.chartRowsModule.taskBarHeight),r||(this.isAutoFit()?i.translateTransform(t.x+(this.left-n),t.y+a-.7*this.parent.chartRowsModule.taskBarHeight/2):i.translateTransform(t.x+ae(this.left-n),t.y+a-.7*this.parent.chartRowsModule.taskBarHeight/2)),r&&(this.isAutoFit()?i.translateTransform(t.x+(o.baselineLeft-n),t.y+a-.7*this.parent.chartRowsModule.taskBarHeight/2):i.translateTransform(t.x+ae(o.baselineLeft-n),t.y+a-.7*this.parent.chartRowsModule.taskBarHeight/2)),i.rotateTransform(45),this.parent.renderBaseline&&this.baselineStartDate&&this.baselineEndDate&&r&&i.drawRectangle(d,p,2,2,ae(h),ae(h)),r||i.drawRectangle(s,l,0,0,ae(h),ae(h)),i.restore(),this.isAutoFit()?je(o.taskbarTemplate.image)||(c=new oc(o.taskbarTemplate.image[0].base64),u=t.x+(this.left-n)-.7*this.parent.chartRowsModule.taskBarHeight/2+(.7*this.parent.chartRowsModule.taskBarHeight-o.taskbarTemplate.image[0].height),d=o.taskbarTemplate.image[0].width/2,p=o.taskbarTemplate.image[0].height/2,i.drawImage(c,u,t.y+a-.7*this.parent.chartRowsModule.taskBarHeight/2+(.7*this.parent.chartRowsModule.taskBarHeight-o.taskbarTemplate.image[0].height)/.5,d,p)):je(o.taskbarTemplate.image)||(c=new oc(o.taskbarTemplate.image[0].base64),u=t.x+ae(this.left-n)-.7*this.parent.chartRowsModule.taskBarHeight/2+ +ae(.7*this.parent.chartRowsModule.taskBarHeight-o.taskbarTemplate.image[0].height),i.drawImage(c,u,t.y+a-.7*this.parent.chartRowsModule.taskBarHeight/2+ae((.7*this.parent.chartRowsModule.taskBarHeight-o.taskbarTemplate.image[0].height)/.5),ae(o.taskbarTemplate.image[0].width),ae(o.taskbarTemplate.image[0].height-2))),this.endPage=this.startPage=e)},GKt);function GKt(e){this.baselineHeight=8,this.segment=[],this.segmentCollection=[],this.leftTaskLabel={},this.rightTaskLabel={},this.startPage=-1,this.endPage=-1,this.spaceBetweenImageAndValue=8,this.parent=e}XKt.prototype.drawTimeline=function(e,t,i){this.detailsTimeline=i;var n=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?mqt(Math.floor(i.totalWidth)):Math.round(i.totalWidth),o=0;for(this.topTierPoint.x=t.x,this.topTierPoint.y=t.y,this.prevTopTierIndex=this.topTierIndex,this.prevBottomTierIndex=this.bottomTierIndex;0<n;){var r,s=this.topTier[this.topTierIndex];this.topTier.length>this.topTierIndex?(a=!1,this.topTier[this.topTierIndex].isFinished||(n>=s.width?(o=s.width,s.isFinished=!0,s.completedWidth=o,a=!0):(o=n,s.isFinished=a=!1,s.width=s.width-n,s.completedWidth=o)),r=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?o:ae(o),this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,r,s.value,!0,this.parent.timelineModule.isSingleTier&&"Day"===this.parent.timelineSettings.topTier.unit?s.startDate:null),this.topTierPoint.x+=r,n-=o,a&&this.topTierIndex++):n=0}n=Math.round(i.totalWidth),i=this.parent.timelineModule.isSingleTier?0:this.topTierHeight;for(this.bottomTierPoint=new ed(t.x,ae(t.y+i));0<n;){var a,l,h=this.bottomTier[this.bottomTierIndex];this.bottomTier.length>this.bottomTierIndex?(a=!0,n<(l=h.width)&&(l=n,a=!1,h.completedWidth=l),this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?l:ae(l),h.value,!1,h.startDate),this.bottomTierPoint.x=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?this.bottomTierPoint.x+l:this.bottomTierPoint.x+ae(l),n-=l,h.completedWidth=l,this.bottomTierIndex++,0<n&&n<l&&(n=h.width-1)):n=0}this.timelineWidth=this.lastWidth},XKt.prototype.drawPageTimeline=function(e,t,i){this.topTierPoint=Pe({},{},t,!0);for(var n,o=this.prevTopTierIndex;o<=this.topTierIndex;o++)this.topTier.length>o&&0<(n=this.topTier[o]).completedWidth&&(this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?n.completedWidth:ae(n.completedWidth),n.value,!0,this.parent.timelineModule.isSingleTier&&"Day"===this.parent.timelineSettings.topTier.unit?n.startDate:null),this.topTierPoint.x+=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?n.completedWidth:ae(n.completedWidth));this.bottomTierPoint.x=t.x,this.bottomTierPoint.y=ae(t.y+this.topTierHeight);for(var r,o=this.prevBottomTierIndex;o<=this.bottomTierIndex;o++)this.bottomTier.length>o&&0<(r=this.bottomTier[o]).completedWidth&&(this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?r.width:ae(r.width),r.value,!1,r.startDate),this.bottomTierPoint.x=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?this.bottomTierPoint.x+r.width:this.bottomTierPoint.x+ae(r.width))},XKt.prototype.triggerQueryTimelinecell=function(e,o,t,i,r,n,s,a){var l,h,d=this,p=new Date(a).getDay(),c=e.graphics,u={},g=this.gantt.ganttStyle,m=(u.borderColor=new se(g.timeline.borderColor),u.fontColor=new se(g.timeline.fontColor),u.fontSize=g.timeline.fontSize,u.fontStyle=g.timeline.fontStyle,u.backgroundColor=new se(g.timeline.backgroundColor),g.timeline.padding&&(u.padding=g.timeline.padding),this.initializePdfStringFormat(g,s)),m=(u.format=m,{timelineCell:u,value:n}),u=(this.parent.pdfQueryTimelineCellInfo&&this.parent.trigger("pdfQueryTimelineCellInfo",m),m.timelineCell),f=new Sd(m.timelineCell.backgroundColor),n=this.parent.nonWorkingDayIndex,y=!1,v=new Sd(g.holiday.backgroundColor),n=(this.parent.highlightWeekends&&-1!==n.indexOf(p)&&("Day"===this.parent.timelineModule.bottomTier||"None"===this.parent.timelineModule.bottomTier&&"Day"===this.parent.timelineModule.topTier)&&(f=v,y=!0),this.parent.holidays.map(function(t){var i=new Date(t.from),e=new Date(t.to),n=new Date(a);i<=n&&n<=e&&("Day"===d.parent.timelineModule.bottomTier||"None"===d.parent.timelineModule.bottomTier&&"Day"===d.parent.timelineModule.topTier)?(f=v,i.getTime()===n.getTime()&&(d.holidayWidth=o),e.getTime()===n.getTime()&&(d.holidayLabel=t.label,(e=new Date(t.to)).setDate(e.getDate()+1),n=d.parent.dataOperation.getTaskWidth(i,e),d.holidayNumberOfDays=ae(n)/r,d.holidayCompleted=!0),y=!0):"Day"!==d.parent.timelineModule.bottomTier&&d.detailsTimeline.startDate<=i&&d.detailsTimeline.endDate>=i&&d.parent.timelineModule.bottomTierCollection.map(function(e){e.startDate<=i&&e.endDate>=i&&e.startDate===a&&(d.fitHolidayCompleted=!0,d.fromDataHoliday=t.from,d.holidayLabel=t.label)})}),y&&g.holiday&&g.holiday.borders?g.holiday.borders.left:y&&g.holiday&&g.holiday.borderColor?new Ep(g.holiday.borderColor):new Ep(m.timelineCell.borderColor)),p=(this.parent.pdfExportModule.gantt.taskbar.isAutoFit()||(this.lastWidth=o+r),y&&(g.holiday.borderColor||g.holiday.borders)?r-2:r),b=(c.drawRectangle(n,f,o,t,p,ae(i)),s||"Both"!==this.parent.gridLines&&"Vertical"!==this.parent.gridLines?null:new Ep(g.chartGridLineColor)),n=y&&(g.holiday.borderColor||g.holiday.borders)?n:b,b=(c.drawRectangle(n,f,o,t+ae(i),p,e.getClientSize().height),new cg(g.fontFamily,u.fontSize,u.fontStyle)),p=(g.font&&(b=g.font),this.getPdfFont(g)),p=(je(p)||(b=p),g.holiday&&g.holiday.fontColor?new Sd(g.holiday.fontColor):new Sd(new se(0,0,0))),w=g.holiday&&g.holiday.fontBrush?new Ep(new se(g.holiday.fontBrush)):null,C=(new xd,g.holiday&&g.holiday.format?g.holiday.format:null),S={left:0,right:0,top:0,bottom:0},A=(je(g)||je(g.holiday)||je(g.holiday.padding)||(S=g.holiday.padding),je(this.holidayLabel)||(l=b.measureString(this.holidayLabel)),this.holidayCompleted&&(A=c.save(),h=b.height,x=b.size,c.translateTransform(this.holidayWidth+r-x/2*this.holidayNumberOfDays-h+h/2+r*this.holidayNumberOfDays/2,40),c.rotateTransform(-90),c.translateTransform(-e.getClientSize().height/2,-((this.holidayWidth+r+x)/((this.holidayWidth+r)/r))),c.drawString(this.holidayLabel,b,w,p,5-(S.left+S.right),5-(S.top+S.bottom),l.width+10,l.height+10,C),c.restore(A),this.holidayCompleted=!1),this.fitHolidayCompleted&&(x=b.size,c.drawRectangle(n,v,o+r/2-x,t+ae(i),x,e.getClientSize().height),h=c.save(),c.translateTransform(o+r+r/2-x,40),c.rotateTransform(-90),c.translateTransform(-e.getClientSize().height/2,-((this.holidayWidth+r+x)/((this.holidayWidth+r)/r))),c.drawString(this.holidayLabel,b,w,p,5-(S.left+S.right),5-(S.top+S.bottom),l.width+10,l.height+10,C),c.restore(h),this.fitHolidayCompleted=!1),new cg(g.fontFamily,u.fontSize,u.fontStyle)),n=(g.font&&(A=g.font),new Sd(je(g.timeline.fontBrush)?m.timelineCell.fontColor:g.timeline.fontBrush)),e=g.timeline.padding?m.timelineCell.padding.left:0,x=g.timeline.padding?m.timelineCell.padding.top:0,b=c.save();c.setClip(new id(o,t,r,ae(i))),s?o=o+e+this.topTierValueLeftPadding:o+=e,c.drawString(m.value,A,null,n,o,t+x,ae(r),ae(i),u.format),c.restore(b)},XKt.prototype.initializePdfStringFormat=function(e,t){var i=new xd;return je(e.timeline.format)?t?(i.lineAlignment=_h.Middle,i.alignment=Hh.Left):(i.lineAlignment=_h.Middle,i.alignment=Hh.Center,i.wordWrap=cd.Character):i=e.timeline.format,i},XKt.prototype.getPdfFont=function(e){var t,i;return e&&e.holiday&&(e.holiday.fontSize||e.holiday.fontStyle||e.holiday.fontFamily)&&(t=e.holiday.fontSize||9,i=e.holiday.fontFamily||this.fontFamily,e=e.holiday.fontStyle||hd.Regular,i=new cg(i,t,e)),i};var YKt=XKt;function XKt(e){this.holidayCompleted=!1,this.holidayWidth=0,this.fitHolidayCompleted=!1,this.timelineWidth=0,this.lastWidth=0,this.topTierValueLeftPadding=8,this.width=0,this.gantt=e,this.parent=e.parent,this.topTierPoint=new ed,this.bottomTierPoint=new ed,this.topTierIndex=0,this.bottomTierIndex=0,this.prevTopTierIndex=0,this.prevBottomTierIndex=0}JKt.prototype.add=function(){return new JKt(this.parent)},JKt.prototype.drawPredecessor=function(e){var t,i,n=(this.pdfGantt=e).result.page.section.getPages(),o=e.taskbarCollection[this.parentIndex],r=e.taskbarCollection[this.childIndex],s=new Ou,a=new Ou,l="";if(r&&o){switch(this.type){case"FS":if(!(-1<r.startPage&&-1<o.endPage))return;s=n[o.endPage],a=n[r.startPage],t=e.pdfPageDetail[o.endPage-e.chartPageIndex],i=e.pdfPageDetail[r.startPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.parentLeft<this.childLeft&&this.childLeft>this.parentLeft+this.parentWidth+25?"FSType1":"FSType2":this.parentLeft<this.childLeft&&this.childLeft>this.parentLeft+this.parentWidth+25?"FSType3":"FSType4";break;case"SF":if(!(-1<r.endPage&&-1<o.startPage))return;s=n[o.startPage],a=n[r.endPage],t=e.pdfPageDetail[o.endPage-e.chartPageIndex],i=e.pdfPageDetail[r.startPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.parentLeft>this.childLeft+this.childWidth?"SFType1":"SFType2":this.parentLeft>this.childLeft+this.childWidth?"SFType3":"SFType4";break;case"FF":if(!(-1<r.endPage&&-1<o.endPage))return;s=n[o.endPage],a=n[r.endPage],t=e.pdfPageDetail[o.endPage-e.chartPageIndex],i=e.pdfPageDetail[r.endPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.childLeft+this.childWidth>=this.parentLeft+this.parentWidth?"FFType1":"FFType2":this.childLeft+this.childWidth>=this.parentLeft+this.parentWidth?"FFType3":"FFType4";break;case"SS":if(!(-1<r.startPage&&-1<o.startPage))return;s=n[o.startPage],a=n[r.startPage],t=e.pdfPageDetail[o.startPage-e.chartPageIndex],i=e.pdfPageDetail[r.startPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.parentLeft>=this.childLeft?"SSType1":"SSType2":this.parentLeft>=this.childLeft?"SSType3":"SSType4"}var h=Math.round((this.parent.rowHeight-15)/2),d=Math.round((this.parent.rowHeight-1)/2),p=Math.round((this.parent.rowHeight-10)/2),c=ae(this.parent.renderBaseline?p:!o.isAutoSchedule&&o.isParentTask||!r.isAutoSchedule&&r.isParentTask?h:d),u=void 0,g=void 0,m=void 0,f=void 0,y=void 0,v=void 0,u=g=m=f=y=v=new ed,p=(o.taskStartPoint.x,o.taskStartPoint.y),h=(r.taskStartPoint.x,r.taskStartPoint.y),b=p+t.startPoint.y,w=h+i.startPoint.y,C=void 0,S=void 0,A=void 0,x=void 0,I=void 0,I=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?(C=new ed(this.parentLeft+this.parentWidth,b+c),S=new ed(this.parentLeft-1,b+c),A=new ed(this.childLeft-20,w+c),x=new ed(this.childLeft-6-this.lineWidth-1,w+c),new ed(this.childLeft+this.childWidth+6+this.lineWidth+1,w+c)):(C=new ed(ae(this.parentLeft+this.parentWidth),b+c),S=new ed(ae(this.parentLeft)-1,b+c),A=new ed(ae(this.childLeft-20),w+c),x=new ed(ae(this.childLeft-6-this.lineWidth)-1,w+c),new ed(ae(this.childLeft+this.childWidth+6+this.lineWidth)+1,w+c));switch(l){case"FSType1":case"FSType3":u=C,g=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?new ed(this.childLeft-20,b+c):new ed(ae(this.childLeft-20),b+c),m=A,f=x,this.connectLines(s,a,u,g,m,f,r,c);break;case"FSType2":g=new ed((u=C).x+10,b+c),m=new ed(u.x+10,w+2),f=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?new ed(this.childLeft-20,w+2):new ed(ae(this.childLeft-20),w+2),y=A,v=x,this.connectLines(s,a,u,g,m,f,r,c,y,v);break;case"FSType4":g=new ed((u=C).x+10,b+c),m=new ed(u.x+10,b+2),f=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?new ed(this.childLeft-20,b+2):new ed(ae(this.childLeft-20),b+2),y=A,v=x,this.connectLines(s,a,u,g,m,f,r,c,y,v);break;case"FFType1":case"FFType3":g=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?(u=new ed(this.parentLeft+this.parentWidth+1,b+c),new ed(this.childLeft+this.childWidth+20,b+c)):(u=new ed(ae(this.parentLeft+this.parentWidth)+1,b+c),new ed(ae(this.childLeft+this.childWidth+20),b+c)),m=new ed(g.x,w+c),f=I,this.connectLines(s,a,u,g,m,f,r,c);break;case"FFType2":case"FFType4":g=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?(u=new ed(this.parentLeft+this.parentWidth+1,b+c),new ed(this.parentLeft+this.parentWidth+20,b+c)):(u=new ed(ae(this.parentLeft+this.parentWidth)+1,b+c),new ed(ae(this.parentLeft+this.parentWidth+20),b+c)),m=new ed(g.x,w+c),f=I,this.connectLines(s,a,u,g,m,f,r,c);break;case"SSType1":case"SSType3":u=S,g=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?new ed(this.childLeft-20,b+c):new ed(ae(this.childLeft-20),b+c),m=new ed(g.x,w+c),f=x,this.connectLines(s,a,u,g,m,f,r,c);break;case"SSType2":case"SSType4":u=S,g=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?new ed(this.parentLeft-20,b+c):new ed(ae(this.parentLeft-20),b+c),m=new ed(g.x,w+c),f=x,this.connectLines(s,a,u,g,m,f,r,c);break;case"SFType1":case"SFType3":u=S,g=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?new ed(this.childLeft+this.childWidth+20,b+c):new ed(ae(this.childLeft+this.childWidth+20),b+c),m=new ed(g.x,w+c),f=I,this.connectLines(s,a,u,g,m,f,r,c);break;case"SFType2":u=S,f=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?(g=new ed(this.parentLeft-20,b+c),new ed(this.childLeft+this.childWidth+20,w+2)):(g=new ed(ae(this.parentLeft-20),b+c),new ed(ae(this.childLeft+this.childWidth+20),w+2)),m=new ed(g.x,w+2),y=new ed(f.x,w+c),v=I,this.connectLines(s,a,u,g,m,f,r,c,y,v);break;case"SFType4":u=S,f=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?(g=new ed(this.parentLeft-20,b+c),new ed(this.childLeft+this.childWidth+20,b+2)):(g=new ed(ae(this.parentLeft-20),b+c),new ed(ae(this.childLeft+this.childWidth+20),b+2)),m=new ed(g.x,b+2),y=new ed(f.x,w+c),v=I,this.connectLines(s,a,u,g,m,f,r,c,y,v)}}},JKt.prototype.connectLines=function(e,t,i,n,o,r,s,a,l,h){this.drawLine(e,i,n),this.drawLine(e,n,o),this.drawLine(e,o,r),je(l)||je(h)||(this.drawLine(e,r,l),this.drawLine(e,l,h)),this.drawArrow(t,s,a)},JKt.prototype.contains=function(e,t,i){return e.x<=t&&t<e.x+e.width&&e.y<=i&&i<e.y+e.height},JKt.prototype.findPageIndex=function(e){for(var t=-1,i=0;i<this.pdfGantt.pdfPageDetail.length;i++){var n=this.pdfGantt.pdfPageDetail[i],n=new id(n.startPoint.x,n.startPoint.y,n.width,n.height);if(this.contains(n,e.x,e.y)){t=i;break}}return t},JKt.prototype.drawLine=function(e,t,i){var n,o,r=this.pdfGantt.result.page.section.getPages(),s=e.graphics,a={x:i.x,y:i.y},l={x:i.x,y:i.y},h={x:i.x,y:i.y},e=this.pdfGantt.pdfPageDetail[e.section.indexOf(e)-this.pdfGantt.chartPageIndex],d=new id(e.startPoint.x,e.startPoint.y,e.width,e.height),p=this.contains(d,t.x,t.y),c=this.contains(d,i.x,i.y),u=-1;t=new ed(t.x,t.y),i=new ed(i.x,i.y),!p&&!c||c&&!p?-1<(u=this.findPageIndex(t))&&(e=this.pdfGantt.pdfPageDetail[u],l=t,a=i,this.drawLine(r[u+this.pdfGantt.chartPageIndex],l,a)):!c&&p&&(c=d.x,o=d.x+d.width,n=d.y+d.height,d=d.y,c>i.x?(h.x=i.x=c-1,l.x=c-1):o<i.x?(h.x=i.x=o,l.x=o,h.x+=1):n<i.y?(h.y=i.y=n,l.y=n,h.y+=1,this.pdfGantt.enableHeader&&(l.y+=this.parent.timelineModule.isSingleTier?ae(45):ae(62))):d>i.y&&(l.y=h.y=d-1,i.y=d,this.pdfGantt.enableHeader)&&(h.y+=this.parent.timelineModule.isSingleTier?ae(45):ae(62),i.y+=this.parent.timelineModule.isSingleTier?ae(45):ae(62)),-1!==(u=this.findPageIndex(h)))&&this.drawLine(r[u+this.pdfGantt.chartPageIndex],l,a),p&&(t=new ed(t.x,t.y),i=new ed(i.x,i.y),t.x=t.x+e.pageStartX-e.startPoint.x,t.y=t.y-e.startPoint.y,i.x=i.x+e.pageStartX-e.startPoint.x,i.y=i.y-e.startPoint.y,c=new Sd(this.connectorLineColor),o=new Ep(c,ae(this.lineWidth)),s.drawLine(o,t,i))},JKt.prototype.drawArrow=function(e,t,i){var n,o=this.pdfGantt.pdfPageDetail[e.section.indexOf(e)-this.pdfGantt.chartPageIndex],r=new id(new ed(o.startPoint.x,o.startPoint.y),new td(o.width,o.height)),s=new ed,a=e.section.getPages(),l=6+this.lineWidth,s=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?"FS"===this.type||"SS"===this.type?new ed(this.childLeft-1,t.taskStartPoint.y+o.startPoint.y):new ed(this.childLeft+this.childWidth+1,t.taskStartPoint.y+o.startPoint.y):"FS"===this.type||"SS"===this.type?new ed(ae(this.childLeft)-1,t.taskStartPoint.y+o.startPoint.y):new ed(ae(this.childLeft+this.childWidth)+1,t.taskStartPoint.y+o.startPoint.y),r=(this.contains(r,s.x,s.y)||-1<(t=this.findPageIndex(s))&&(o=this.pdfGantt.pdfPageDetail[t],e=a[t+this.pdfGantt.chartPageIndex]),e.graphics),a=(s.x=s.x-o.startPoint.x+o.pageStartX,s.y=s.y-o.startPoint.y,new ed(s.x,s.y+i)),t=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?"FS"===this.type||"SS"===this.type?new ed(a.x-l,a.y-l):new ed(a.x+l,a.y-l):"FS"===this.type||"SS"===this.type?new ed(a.x-ae(l),a.y-ae(l)):new ed(a.x+ae(l),a.y-ae(l)),e=new Sd(this.connectorLineColor),o=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?(n=new ed(t.x,t.y+2*l),new Ep(e,this.lineWidth)):(n=new ed(t.x,t.y+ae(2*l)),new Ep(e,ae(this.lineWidth)));r.drawLine(o,a,t),r.drawLine(o,t,n),r.drawLine(o,n,a)};var KKt=JKt;function JKt(e,t){this.parent=e,this.pdfGantt=t}$Kt.prototype.drawEventMarker=function(e,t,i,n,o,r,s){var a,l,h,d,p,c,u=e.graphics,e=e.getClientSize(),g=new cg(dd.Helvetica,10),m=(!je(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(g=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),je(o.label)||(a=g.measureString(o.label)),s.eventMarker.lineStyle);m.dashStyle=s.eventMarker.lineStyle.dashStyle,n.startDate<=o.date&&o.date<=n.endDate&&((n=new xd).alignment=Hh.Center,n=je(s.eventMarker.label.format)?n:s.eventMarker.label.format,l=new Sd(s.eventMarker.label.backgroundColor),h=s.eventMarker.label&&s.eventMarker.label.fontColor?new Sd(s.eventMarker.label.fontColor):null,je(d=this.getPdfFont(s))&&(d=g),g=s.eventMarker.label.borders||null,s.eventMarker.label.borderColor&&((p=new sKt).all=new Ep(new se(s.eventMarker.label.borderColor)),g=p),p=je(g)||je(g.left)?null:g.left,g={left:0,right:0,top:0,bottom:0},je(s)||je(s.eventMarker)||je(s.eventMarker.label)||je(s.eventMarker.label.padding)||(g=s.eventMarker.label.padding),s=je(s.eventMarker.label.fontBrush)?null:new Ep(s.eventMarker.label.fontBrush),c=this.parent.dataOperation.getTaskLeft(this.parent.dateValidationModule.getDateFromFormat(o.date,!0),!1,!0),this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?(u.drawLine(m,new ed(t.x+(c-i)+10,r),new ed(t.x+(c-i)+10,e.height)),!je(o.label)&&0<o.label.length&&(u.save(),u.translateTransform(t.x+(c-i)+7+10,r+ae(50)+a.height/2),u.rotateTransform(45),u.drawRectangle(p,l,0,0,8,8),u.restore(),u.drawRectangle(p,l,t.x+(c-i)+7+10,r+ae(50),a.width+10,2*a.height),u.drawString(o.label,d,s,h,t.x+(c-i)+12+10-(g.left+g.right),r+ae(50)+ae(a.height/2)-(g.top+g.bottom),a.width,a.height,n))):(u.drawLine(m,new ed(t.x+ae(c-i)+10,r),new ed(t.x+ae(c-i)+10,e.height)),!je(o.label)&&0<o.label.length&&(u.save(),u.translateTransform(t.x+ae(c-i)+7+10,r+ae(50)+a.height/2),u.rotateTransform(45),u.drawRectangle(p,l,0,0,8,8),u.restore(),u.drawRectangle(p,l,t.x+ae(c-i)+7+10,r+ae(50),a.width+10,2*a.height),u.drawString(o.label,d,s,h,t.x+ae(c-i)+12+10-(g.left+g.right),r+ae(50)+ae(a.height/2)-(g.top+g.bottom),a.width,a.height,n))))},$Kt.prototype.getPdfFont=function(e){var t,i;return e&&e.eventMarker&&e.eventMarker.label&&(e.eventMarker.label.fontSize||e.eventMarker.label.fontStyle||e.eventMarker.label.fontFamily)&&(t=e.eventMarker.label.fontSize||9,i=e.eventMarker.label.fontFamily||this.fontFamily,e=e.eventMarker.label.fontStyle||hd.Regular,i=new cg(i,t,e)),i};var ZKt=$Kt;function $Kt(e){this.parent=e}eJt=function(e,t){return(eJt=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])}))(e,t)};var eJt,tJt,iJt=function(){return(iJt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},nJt=(function(e,t){function i(){this.constructor=e}eJt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(oJt,tJt=xKt),Object.defineProperty(oJt.prototype,"taskbar",{get:function(){return je(this.taskbars)&&(this.taskbars=new qKt(this.parent)),this.taskbars},enumerable:!0,configurable:!0}),oJt.prototype.drawChart=function(e){this.result=e,this.totalPages=this.result.page.section.count,this.perColumnPages=this.totalPages/this.layouter.columnRanges.length,this.calculateRange(),this.drawGantttChart(),this.drawPageBorder()},oJt.prototype.calculateRange=function(){for(var e=this.layouter.columnRanges[this.layouter.columnRanges.length-1],t=0,i=!0,n=0,o=0,r=0,s=ae(this.chartHeader.width),a=this.parent.timelineModule,l=e[0];l<=e[1];l++)t+=this.layouter.treegrid.columns.getColumn(l).width;for((t+=.5)+100<this.result.page.getClientSize().width?(o=this.result.page.getClientSize().width-t,this.chartPageIndex=this.startPageIndex=this.totalPages-this.perColumnPages,i=!1,this.startPoint=new ed(t,0)):(this.result.page.section.add(),this.chartPageIndex=this.startPageIndex=this.totalPages,i=!0,this.startPoint=new ed(r,0));Math.round(r)<Math.round(s);){i?n=this.result.page.getClientSize().width:(n=o,i=!0);var h={},d=[],p=ae(this.chartHeader.bottomTierCellWidth),c=0,u=(0!==this.chartHeader.bottomTierCellWidth&&(c=Math.floor(n/p)*p),s-(d[0]=r)<=c?h.totalWidth=mqt((d[1]=s)-r):(d[1]=r+c,h.totalWidth=mqt(c)),h.startPoint=d[0],h.endPoint=d[1],0===this.parent.cloneProjectStartDate.getHours()&&0===this.parent.cloneProjectStartDate.getMinutes()&&0===this.parent.cloneProjectStartDate.getSeconds()&&(this.changeCloneProjectDates=!0,this.parent.cloneProjectStartDate.setHours(8)),this.parent.dataOperation.getDateFromFormat(this.parent.timelineModule.timelineStartDate)),g=(je(a.customTimelineSettings.bottomTier.count)?a.customTimelineSettings.topTier:a.customTimelineSettings.bottomTier).count;switch(("None"===a.customTimelineSettings.bottomTier.unit?a.customTimelineSettings.topTier:a.customTimelineSettings.bottomTier).unit){case"Minutes":h.startDate=new Date(u.getTime());var m=Math.floor(mqt(h.startPoint)/this.chartHeader.bottomTierCellWidth),m=(h.startDate.setMinutes(h.startDate.getMinutes()+m*g),h.startDate.setSeconds(h.startDate.getSeconds()+1),h.endDate=new Date(h.startDate.getTime()),Math.floor(mqt(h.endPoint-h.startPoint)/this.chartHeader.bottomTierCellWidth));h.endDate.setMinutes(h.endDate.getMinutes()+m*g);break;case"Hour":h.startDate=new Date(u.getTime());var m=Math.floor(mqt(h.startPoint)/this.chartHeader.bottomTierCellWidth),f=(h.startDate.setHours(h.startDate.getHours()+m*g),h.startDate.setMinutes(h.startDate.getMinutes()+1),h.endDate=new Date(h.startDate.getTime()),Math.floor(mqt(h.endPoint-h.startPoint)/this.chartHeader.bottomTierCellWidth));h.endDate.setHours(h.endDate.getHours()+f*g);break;case"Day":h.startDate=new Date(u.getTime());var f=Math.round(h.startPoint/ae(this.chartHeader.bottomTierCellWidth)),y=(h.startDate.setDate(h.startDate.getDate()+f*g),Math.round((h.endPoint-h.startPoint)/ae(this.chartHeader.bottomTierCellWidth))-1),v=h.startDate,b=(v.setHours(0,0,0,0),1e3*this.parent.workingTimeRanges[0].to);h.endDate=new Date(v.getTime()),h.endDate.setDate(h.startDate.getDate()+y*g),h.endDate.setTime(h.endDate.getTime()+b);break;case"Week":h.startDate=new Date(u.getTime());v=h.startPoint/ae(this.chartHeader.bottomTierCellWidth)*7,y=(h.startDate.setDate(h.startDate.getDate()+v*g),7*Math.round((h.endPoint-h.startPoint)/ae(this.chartHeader.bottomTierCellWidth))-1);h.endDate=new Date(h.startDate.getTime()),h.endDate.setDate(h.startDate.getDate()+y*g);break;case"Month":h.startDate=new Date(u.getTime());var b=h.startPoint/ae(this.chartHeader.bottomTierCellWidth)*31,w=(h.startDate.setDate(h.startDate.getDate()+b*g),31*Math.round((h.endPoint-h.startPoint)/ae(this.chartHeader.bottomTierCellWidth))-1);h.endDate=new Date(h.startDate.getTime()),h.endDate.setDate(h.startDate.getDate()+w*g);break;case"Year":h.startDate=new Date(u.getTime());var w=h.startPoint/ae(this.chartHeader.bottomTierCellWidth)*365,C=(h.startDate.setDate(h.startDate.getDate()+w*g),365*Math.round((h.endPoint-h.startPoint)/ae(this.chartHeader.bottomTierCellWidth))-1);h.endDate=new Date(h.startDate.getTime()),h.endDate.setDate(h.startDate.getDate()+C*g)}this.headerDetails.push(h),r+=c}},oJt.prototype.drawPageBorder=function(){for(var e=this.result.page.section.getPages(),t=0;t<e.length;t++){var i=e[t],n=i.graphics,i=i.getClientSize(),o=new Ep(new se(this.ganttStyle.chartGridLineColor));n.drawRectangle(o,0,0,i.width,i.height)}},oJt.prototype.drawGantttChart=function(){var d,p,c=this,u=this.startPoint,g=new ed,m=0,f=0;this.headerDetails.forEach(function(n,e){var t=c.result.page.section.getPages()[c.startPageIndex];t.contentWidth=c.parent.pdfExportModule.gantt.taskbar.isAutoFit()?mqt(c.headerDetails[e].endPoint-c.headerDetails[e].startPoint):c.headerDetails[e].endPoint-c.headerDetails[e].startPoint,c.chartHeader.drawTimeline(t,c.startPoint,n),u.y=u.y+ae(c.parent.timelineModule.isSingleTier?45:60),d=u.x,f=ae(c.parent.timelineModule.isSingleTier?45:60),c.headerDetails[c.headerDetails.indexOf(n)].startIndex=c.startPageIndex,c.headerDetails[c.headerDetails.indexOf(n)].pageStartPoint=u,c.parent.eventMarkerColloction.map(function(e){var t=ae(c.parent.timelineModule.isSingleTier?45:60),i=c.result.page.section.getPages()[c.startPageIndex];c.eventMarker.drawEventMarker(i,u,m,n,e,t,c.ganttStyle)});for(var i=0;i<c.taskbarCollection.length;i++){var o=c.taskbarCollection[i],r=c.rows.getRow(i+1).height,s=c.result.page.section.getPages()[c.startPageIndex],a=s.graphics,l=new Ep(new se(c.ganttStyle.chartGridLineColor)),h=void 0;!t.contentWidth||"Both"!==c.parent.gridLines&&"Horizontal"!==c.parent.gridLines||(h=c.chartHeader.timelineWidth,a.drawRectangle(l,d,u.y,t.contentWidth+.5,r)),o.drawTaskbar(s,u,n,m,r,c.taskbarCollection[parseInt(i.toString(),10)],h)&&(c.enableHeader?u.y=ae(c.parent.timelineModule.isSingleTier?45:60):u.y=0,c.startPageIndex++,(p={}).height=f,p.pageStartX=d,p.startPoint=iJt({},g),c.parent.pdfExportModule.gantt.taskbar.isAutoFit(),p.width=n.totalWidth,c.pdfPageDetail.push(p),g.y+=p.height,f=c.enableHeader?c.chartHeader.height:u.y=0),u.y+=r,f+=r,c.parent.eventMarkerColloction.map(function(e){var t=ae(c.parent.timelineModule.isSingleTier?45:60),i=c.result.page.section.getPages()[c.startPageIndex];c.eventMarker.drawEventMarker(i,u,m,n,e,t,c.ganttStyle)})}c.headerDetails[e].endIndex=c.startPageIndex,m+=n.totalWidth,(p={}).height=f,p.pageStartX=d,p.startPoint=iJt({},g),c.parent.pdfExportModule.gantt.taskbar.isAutoFit()?p.width=n.totalWidth:p.width=ae(n.totalWidth),c.pdfPageDetail.push(p),g.x+=p.width,g.y=0,c.enableHeader?f=c.chartHeader.height:u.y=0,c.headerDetails.indexOf(n)!==c.headerDetails.length-1&&(c.result.page.section.add(),c.startPageIndex=c.result.page.section.count-1,u=c.startPoint=new ed(0,0))});for(var e=0;e<this.predecessorCollection.length;e++)this.predecessorCollection[e].drawPredecessor(this)},oJt);function oJt(e){var t=tJt.call(this)||this;return t.exportProps={},t.changeCloneProjectDates=!1,t.parent=e,t.chartHeader=new YKt(t),t.eventMarker=new ZKt(e),t.predecessor=new KKt(e,t),t.headerDetails=[],t.pdfPageDetail=[],t.taskbarCollection=[],t.predecessorCollection=[],t}rJt.prototype.getModuleName=function(){return"pdfExport"},rJt.prototype.destroy=function(){},rJt.prototype.initGantt=function(){this.pdfDocument=void 0,this.gantt=new nJt(this.parent)},rJt.prototype.export=function(i,n,o,e){var r=this,e=(this.isBlob=e,{requestType:"beforePdfExport",ganttObject:this.parent,cancel:!1});return this.parent.trigger("beforePdfExport",e),je(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType?this.parent.showSpinner():this.parent.showMaskRow(),R("cancel",e)?new Promise(function(e,t){return e()}):new Promise(function(e,t){r.exportWithData(o,e,i,n)})},rJt.prototype.exportWithData=function(e,t,i,n){var o=this,r=[],s=this.parent.getExpandedRecords(this.parent.updatedRecords),r=(i=je(i)?{}:i).fitToWidthSettings&&i.fitToWidthSettings.isFitToWidth?("CurrentViewData"===i.exportType?this.helper.beforeSinglePageExport.cloneFlatData=Pe([],this.parent.currentViewData,null,!0):"AllData"===i.exportType?this.helper.beforeSinglePageExport.cloneFlatData=Pe([],this.parent.flatData,null,!0):this.helper.beforeSinglePageExport.cloneFlatData=Pe([],s,null,!0),this.helper.beforeSinglePageExport.cloneCurrentViewData=Pe([],this.parent.currentViewData,null,!0),this.helper.beforeSinglePageExport.cloneFlatData):je(i.exportType)?s:"CurrentViewData"===i.exportType?this.parent.currentViewData:this.parent.flatData;this.initGantt(),je(e)?this.pdfDocument=new sg:this.pdfDocument=e,this.processExport(r,i,n).then(function(){o.parent.trigger("pdfExportComplete",o.isBlob?{promise:o.blobPromise}:{}),je(o.parent.loadingIndicator)||"Shimmer"!==o.parent.loadingIndicator.indicatorType?o.parent.hideSpinner():o.parent.hideMaskRow(),t(o.pdfDocument)})},rJt.prototype.processExport=function(i,n,t){var o=this,e=this.pdfDocument.sections.add();return this.processSectionExportProperties(e,n),this.pdfPage=e.pages.add(),this.pdfPageDimensions=this.pdfPage.getClientSize(),new Promise(function(e,t){o.helper.processGridExport(i,o.gantt,n),o.helper.initializePdf(o.pdfDocument),e()}).then(function(){var e=new wKt,e=(e.break=Kc.FitElement,o.gantt.drawGrid(o.pdfPage,0,0,e));return o.gantt.drawChart(e),o.helper.exportProps&&o.helper.exportProps.fitToWidthSettings&&o.helper.exportProps.fitToWidthSettings.isFitToWidth&&(o.parent.zoomingProjectStartDate=o.helper.beforeSinglePageExport.zoomingProjectStartDate,o.parent.zoomingProjectEndDate=o.helper.beforeSinglePageExport.zoomingProjectEndDate,o.parent.cloneProjectStartDate=o.helper.beforeSinglePageExport.cloneProjectStartDate,o.parent.cloneProjectEndDate=o.helper.beforeSinglePageExport.cloneProjectEndDate,o.parent.timelineModule.customTimelineSettings=o.helper.beforeSinglePageExport.customTimelineSettings,o.parent.isTimelineRoundOff=o.helper.beforeSinglePageExport.isTimelineRoundOff,o.parent.timelineModule.topTier=o.helper.beforeSinglePageExport.topTier,o.parent.timelineModule.topTierCellWidth=o.helper.beforeSinglePageExport.topTierCellWidth,o.parent.timelineModule.topTierCollection=o.helper.beforeSinglePageExport.topTierCollection,o.parent.timelineModule.bottomTier=o.helper.beforeSinglePageExport.bottomTier,o.parent.timelineModule.bottomTierCellWidth=o.helper.beforeSinglePageExport.bottomTierCellWidth,o.parent.timelineModule.bottomTierCollection=o.helper.beforeSinglePageExport.bottomTierCollection,o.parent.timelineModule.totalTimelineWidth=o.helper.beforeSinglePageExport.totalTimelineWidth,o.parent.timelineModule.timelineStartDate=o.helper.beforeSinglePageExport.timelineStartDate,o.parent.timelineModule.timelineEndDate=o.helper.beforeSinglePageExport.timelineEndDate,o.parent.timelineModule.timelineRoundOffEndDate=o.helper.beforeSinglePageExport.timelineRoundOffEndDate,o.parent.perDayWidth=o.helper.beforeSinglePageExport.perDayWidth,o.parent.updatedConnectorLineCollection=o.helper.beforeSinglePageExport.updatedConnectorLineCollection),o.gantt.changeCloneProjectDates&&(o.parent.cloneProjectStartDate.setHours(0),o.gantt.changeCloneProjectDates=!1),t||(o.isBlob?o.blobPromise=o.pdfDocument.save():!je(n)&&n.fileName?o.pdfDocument.save(n.fileName):o.pdfDocument.save("Export.pdf"),o.pdfDocument.destroy()),o.pdfDocument})},rJt.prototype.processSectionExportProperties=function(e,t){var i;je(t)||(i=new Ap,je(t.pageOrientation)||"Portrait"!==t.pageOrientation?i.orientation=up.Landscape:i.orientation=up.Portrait,je(t.pageSize)||(i.size=this.getPageSize(t.pageSize)),e.setPageSettings(i),je(t.ganttStyle))?this.gantt.ganttStyle=new iKt(t.theme).style:(e=new iKt(t.theme).style,this.gantt.ganttStyle=Pe({},e,t.ganttStyle,!0))},rJt.prototype.getPageSize=function(e){switch(e){case"Letter":return new td(612,792);case"Note":return new td(540,720);case"Legal":return new td(612,1008);case"A0":return new td(2380,3368);case"A1":return new td(1684,2380);case"A2":return new td(1190,1684);case"A3":return new td(842,1190);case"A5":return new td(421,595);case"A6":return new td(297,421);case"A7":return new td(210,297);case"A8":return new td(148,210);case"A9":return new td(105,148);case"B0":return new td(2836,4008);case"B1":return new td(2004,2836);case"B2":return new td(1418,2004);case"B3":return new td(1002,1418);case"B4":return new td(709,1002);case"B5":return new td(501,709);case"Archa":return new td(648,864);case"Archb":return new td(864,1296);case"Archc":return new td(1296,1728);case"Archd":return new td(1728,2592);case"Arche":return new td(2592,3456);case"Flsa":return new td(612,936);case"HalfLetter":return new td(396,612);case"Letter11x17":return new td(792,1224);case"Ledger":return new td(1224,792);default:return new td(595,842)}};QR=rJt;function rJt(e){this.isPdfExport=!1,this.parent=e,this.helper=new zKt(this.parent),this.pdfDocument=void 0}sJt.prototype.getModuleName=function(){return"virtualScroll"},sJt.prototype.bindTreeGridProperties=function(){this.parent.treeGrid.enableVirtualization=this.parent.enableVirtualization,eee.Inject(Xee)},sJt.prototype.getTopPosition=function(){var e=this.parent.ganttChartModule.scrollElement.querySelector(".e-virtualtable"),t=e.style.transform.split(",");return e=1<t.length?t[1].trim().split(")")[0]:(t=e.style.transform).substring(t.lastIndexOf("(")+1,t.lastIndexOf(")")),parseFloat(e)},sJt.prototype.destroy=function(){};Ck=sJt;function sJt(e){this.parent=e,this.bindTreeGridProperties()}u2t.Inject(h,cft,d2t,det,q$e,ts,IOt,SOt,Rft,Wo,Ir,wk,QR,Ck,DOt,vft);var aJt,lJt,hJt,dJt,zN=Object.freeze({__proto__:null,Gantt:u2t,get PdfHorizontalOverflowType(){return yXt},parentsUntil:oqt,isScheduledTask:rqt,isCountRequired:sqt,getSwapKey:aqt,isEmptyObject:lqt,getUniversalTime:hqt,isRemoteData:dqt,getTaskData:pqt,updateDates:cqt,formatString:uqt,getIndex:gqt,pixelToPoint:ae,pointToPixel:mqt,getUid:yqt,load:"load",rowDataBound:"rowDataBound",queryCellInfo:"queryCellInfo",toolbarClick:bXt,keyPressed:"key-pressed",Edit:ts,Reorder:det,Resize:q$e,Filter:h,Sort:d2t,Dependency:rXt,Selection:cft,Toolbar:SOt,DayMarkers:IOt,CriticalPath:DOt,UndoRedo:vft,ContextMenu:Rft,ExcelExport:Wo,ColumnMenu:wk,RowDD:Ir,PdfExport:QR,VirtualScroll:Ck,Column:YGt,DayWorkingTime:Tg,AddDialogFieldSettings:Xd,EditDialogFieldSettings:nf,EditSettings:sf,EventMarker:qf,FilterSettings:C4,SearchSettings:C5,Holiday:Iz,LabelSettings:Jj,SelectionSettings:$$,SplitterSettings:M$,TaskFields:EW,TimelineTierSettings:$W,TimelineSettings:IQ,TooltipSettings:b8,SortDescriptor:DQ,SortSettings:Wz,ResourceFields:Tft,LoadingIndicator:X$e,WeekWorkingTime:Met,TemporaryDictionary:oKt,PdfBorders:sKt,PdfPaddings:lKt,PdfTreeGridStyleBase:dKt,PdfTreeGridStyle:uKt,PdfGanttTheme:iKt,PdfTreeGridLayouter:gKt,PdfTreeGridLayoutResult:yKt,PdfTreeGridLayoutFormat:wKt,PdfTreeGridCell:TKt,PdfTreeGridCellCollection:DKt,PdfTreeGridRow:kKt,PdfTreeGridRowCollection:BKt,PdfTreeGridHeaderCollection:LKt,PdfTreeGridColumn:OKt,PdfTreeGridColumnCollection:VKt}),QN=(f$e.Inject(A$e,C$e,s$e,v$e,d$e,l$e,gRe),Object.freeze({__proto__:null,AjaxSettings:k$,defaultToolbarItems:nte,ToolbarSettings:z$,ToolbarItem:Ode,SearchSettings:P2,columnArray:D2,DetailsViewSettings:aN,fileItems:Xo,folderItems:x$,layoutItems:D$,ContextMenuSettings:_$,NavigationPaneSettings:H$,UploadSettings:mJ,Column:Oee,TOOLBAR_ID:nGe,LAYOUT_ID:oGe,NAVIGATION_ID:rGe,TREE_ID:sGe,GRID_ID:aGe,LARGEICON_ID:lGe,DIALOG_ID:hGe,ALT_DIALOG_ID:"_alt_dialog",IMG_DIALOG_ID:dGe,EXTN_DIALOG_ID:pGe,UPLOAD_DIALOG_ID:cGe,RETRY_DIALOG_ID:"_retry_dialog",CONTEXT_MENU_ID:uGe,SORTBY_ID:"_sortby",VIEW_ID:"_view",SPLITTER_ID:"_splitter",CONTENT_ID:gGe,BREADCRUMBBAR_ID:mGe,UPLOAD_ID:fGe,RETRY_ID:"_retry",SEARCH_ID:yGe,ROOT:vGe,CONTROL:bGe,CHECK_SELECT:wGe,ROOT_POPUP:CGe,MOBILE:SGe,MOB_POPUP:AGe,MULTI_SELECT:xGe,FILTER:IGe,LAYOUT:"e-layout",NAVIGATION:TGe,LAYOUT_CONTENT:EGe,LARGE_ICONS:DGe,TB_ITEM:MGe,LIST_ITEM:kGe,LIST_TEXT:PGe,LIST_PARENT:BGe,TB_OPTION_TICK:FGe,TB_OPTION_DOT:LGe,BLUR:RGe,ACTIVE:OGe,HOVER:NGe,FOCUS:VGe,FOCUSED:_Ge,CHECK:HGe,FRAME:zGe,CB_WRAP:jGe,ROW:WGe,ROWCELL:"e-rowcell",EMPTY:QGe,EMPTY_CONTENT:UGe,EMPTY_INNER_CONTENT:qGe,CLONE:GGe,DROP_FOLDER:YGe,DROP_FILE:XGe,FOLDER:KGe,ICON_IMAGE:JGe,ICON_MUSIC:ZGe,ICON_VIDEO:$Ge,LARGE_ICON:eYe,LARGE_EMPTY_FOLDER:tYe,LARGE_EMPTY_FOLDER_TWO:"e-empty-icon.e-fe-folder",LARGE_ICON_FOLDER:"e-fe-folder",SELECTED_ITEMS:"e-items",TEXT_CONTENT:"e-text-content",GRID_HEADER:iYe,TEMPLATE_CELL:"e-templatecell",TREE_VIEW:nYe,MENU_ITEM:oYe,MENU_ICON:rYe,SUBMENU_ICON:sYe,GRID_VIEW:aYe,GRID_CONTENT:lYe,ICON_VIEW:hYe,ICON_OPEN:dYe,ICON_UPLOAD:pYe,ICON_CUT:cYe,ICON_COPY:uYe,ICON_PASTE:gYe,ICON_DELETE:mYe,ICON_RENAME:fYe,ICON_NEWFOLDER:yYe,ICON_DETAILS:vYe,ICON_SHORTBY:bYe,ICON_REFRESH:wYe,ICON_SELECTALL:CYe,ICON_DOWNLOAD:SYe,ICON_OPTIONS:"e-icons e-fe-options",ICON_GRID:AYe,ICON_LARGE:xYe,ICON_BREADCRUMB:IYe,ICON_CLEAR:TYe,ICON_DROP_IN:"e-icons e-fe-drop-in",ICON_DROP_OUT:"e-icons e-fe-drop-out",ICON_NO_DROP:"e-icons e-fe-no-drop",ICONS:EYe,DETAILS_LABEL:"e-detailslabel",ERROR_CONTENT:DYe,STATUS:"e-status",BREADCRUMBS:"e-address",RTL:MYe,DISPLAY_NONE:kYe,COLLAPSED:"e-node-collapsed",FULLROW:PYe,ICON_COLLAPSIBLE:"e-icon-collapsible",SPLIT_BAR:BYe,HEADER_CHECK:FYe,OVERLAY:LYe,VALUE:RYe,isFile:"isFile",modelChanged:OYe,initialEnd:NYe,finalizeEnd:VYe,createEnd:_Ye,filterEnd:HYe,beforeDelete:"before-delete",pathDrag:zYe,deleteInit:jYe,deleteEnd:WYe,refreshEnd:QYe,resizeEnd:UYe,splitterResize:qYe,pathChanged:GYe,destroy:YYe,beforeRequest:XYe,upload:"upload",skipUpload:KYe,afterRequest:JYe,download:"download",layoutRefresh:ZYe,actionFailure:$Ye,search:eXe,openInit:tXe,openEnd:iXe,selectionChanged:nXe,selectAllInit:oXe,clearAllInit:rXe,clearPathInit:sXe,layoutChange:aXe,sortByChange:lXe,nodeExpand:hXe,detailsInit:dXe,menuItemData:pXe,renameInit:cXe,renameEndParent:uXe,renameEnd:gXe,showPaste:mXe,hidePaste:fXe,selectedData:yXe,cutCopyInit:vXe,pasteInit:bXe,pasteEnd:wXe,cutEnd:CXe,hideLayout:SXe,updateTreeSelection:AXe,treeSelect:"select-node",sortColumn:xXe,pathColumn:IXe,searchTextChange:TXe,beforeDownload:"before-download",downloadInit:EXe,dropInit:DXe,dragEnd:MXe,dropPath:kXe,dragHelper:"drag-helper",dragging:PXe,updateSelectionData:BXe,methodCall:FXe,permissionRead:LXe,permissionEdit:RXe,permissionEditContents:OXe,permissionCopy:"copy",permissionUpload:NXe,permissionDownload:VXe,FileManager:f$e,Toolbar:v$e,BreadCrumbBar:l$e,Virtualization:gRe,NavigationPane:C$e,DetailsView:A$e,LargeIconsView:s$e,createDialog:HZe,createExtDialog:zZe,createImageDialog:o$e,ContextMenu:d$e,read:aZe,createFolder:lZe,filter:hZe,rename:dZe,paste:pZe,Delete:cZe,GetDetails:uZe,isFileSystemData:gZe,Search:OZe,Download:VZe,sortComparer:function(e,t){var i=/\.\S+/.test(e),n=/\.\S+/.test(t);if(i&&!n)return 1;if(!i&&n)return-1;var o=[],r=[];for((e+"").replace(/(\d+)|(\D+)/g,function(e,t,i){return o.push([t||1/0,i||""]),""}),(t+"").replace(/(\d+)|(\D+)/g,function(e,t,i){return r.push([t||1/0,i||""]),""});o.length&&r.length;){var s=o.shift(),a=r.shift();if(s&&a){s=s[0]-a[0]||s[1].localeCompare(a[1]);if(s)return s}}return o.length-r.length},updatePath:QKe,getPath:UKe,getPathId:qKe,getPathNames:GKe,getParents:YKe,generatePath:XKe,removeActive:KKe,activeElement:JKe,addBlur:ZKe,removeBlur:$Ke,getModule:eJe,getAllChildItems:tJe,searchWordHandler:iJe,updateLayout:nJe,getTargetModule:oJe,refresh:rJe,openAction:sJe,getPathObject:aJe,copyFiles:lJe,cutFiles:hJe,fileType:dJe,getImageUrl:pJe,getFullPath:cJe,getName:uJe,getSortedData:gJe,getObject:mJe,createEmptyElement:fJe,getDirectories:yJe,setNodeId:vJe,setDateObject:bJe,getLocaleText:wJe,getCssClass:CJe,sortbyClickHandler:SJe,getSortField:AJe,setNextPath:xJe,openSearchFolder:IJe,pasteHandler:TJe,validateSubFolder:EJe,dropHandler:DJe,getParentPath:MJe,getDirectoryPath:kJe,doPasteUpdate:PJe,readDropPath:BJe,getDuplicateData:FJe,createVirtualDragElement:LJe,dragStopHandler:RJe,dragStartHandler:OJe,dragCancel:NJe,removeDropTarget:VJe,removeItemClass:_Je,scrollHandler:HJe,draggingHandler:zJe,objectToString:jJe,getItemName:WJe,updateRenamingData:QJe,doRename:UJe,doDownload:qJe,doDeleteFiles:GJe,doDownloadFiles:YJe,createDeniedDialog:XJe,getAccessClass:KJe,hasReadAccess:JJe,hasEditAccess:ZJe,hasContentAccess:$Je,hasUploadAccess:eZe,hasDownloadAccess:tZe,createNewFolder:iZe,uploadItem:nZe,closePopup:oZe,getTargetPath:rZe,getAccessDetails:sZe})),RV=Object.freeze({__proto__:null,XmlWriter:Ol,Namespace:Vl,XmlElement:Hl,XmlAttribute:jl,StreamWriter:Gl,Encoding:Ql,validateNullOrUndefined:ql,Save:Ll}),BV=Object.freeze({__proto__:null,CellStyle:yX,Font:vX,CellXfs:bX,Alignment:wX,CellStyleXfs:CX,CellStyles:SX,NumFmt:AX,Border:xX,Borders:IX,Cell:DX,Cells:MX,Column:PX,Row:LX,Rows:RX,Workbook:oK,BuiltInProperties:sK,Worksheet:WX,HyperLink:QX,Grouping:UX,FreezePane:qX,MergeCell:GX,MergeCells:YX,Worksheets:_X,CsvHelper:$X,ValueFormatter:JX,BlobHelper:tK}),u_=(qz.Inject($V),oU.Inject($V),lU.Inject($V),zU.Inject(JU,$V),wQ.Inject(JU),Object.freeze({__proto__:null,incrementalSearch:__,Search:H_,escapeCharRegExp:z_,resetIncrementalSearchValues:j_,highlightSearch:W_,revertHighlightSearch:Q_,VirtualScroll:$V,FieldSettings:HH,dropDownBaseClasses:_z,DropDownBase:Oz,dropDownListClasses:Qz,DropDownList:qz,Fields:q6,TreeSettings:X6,DropDownTree:Z6,ComboBox:oU,AutoComplete:lU,MultiSelect:zU,CheckBoxSelection:JU,createFloatLabel:gU,updateFloatLabelState:mU,removeFloating:fU,setPlaceHolder:yU,floatLabelFocus:vU,floatLabelBlur:bU,encodePlaceholder:wU,SelectionSettings:t7,ToolbarSettings:o7,ListBox:wQ,Mention:c7})),w_=Object.freeze({__proto__:null,Thickness:L0t,Margin:Vmt,Stop:o,Gradient:Rmt,LinearGradient:W0t,RadialGradient:q0t,ShapeStyle:Vee,StrokeStyle:J0t,TextStyle:est,Canvas:$vt,Container:Uvt,DrawingElement:zvt,ImageElement:nbt,PathElement:ybt,TextElement:Xvt,get RotateTransform(){return evt},get ElementAction(){return tvt},get ConnectorConstraints(){return ivt},get ThumbsConstraints(){return nvt},get SelectorConstraints(){return ovt},get NoOfSegments(){return rvt},get MatrixTypes(){return hvt},Matrix:cvt,identityMatrix:uvt,transformPointByMatrix:gvt,transformPointsByMatrix:function(e,t){for(var i=[],n=0,o=t;n<o.length;n++){var r=o[n];i.push(gvt(e,r))}return i},rotateMatrix:mvt,scaleMatrix:fvt,translateMatrix:function(e,t,i){e.type&hvt.Identity?(e.type=hvt.Translation,vvt(e,1,0,0,1,t,i)):e.type&hvt.Unknown?(e.offsetX+=t,e.offsetY+=i):(e.offsetX+=t,e.offsetY+=i,e.type|=hvt.Translation)},multiplyMatrix:yvt,Point:Cbt,Rect:dvt,Size:avt,CanvasRenderer:Abt,refreshDiagramElements:Ibt,DrawingRenderer:Tbt,SvgRenderer:Dbt,setAttributeSvg:kbt,createSvgElement:Pbt,createSvg:function(e,t,i){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return kbt(n,{id:e,width:t,height:i}),n},getParentSvg:function(e,t,i){return e&&e.id&&t&&"selector"===t?this.pdfViewer.adornerSvgLayer:i},randomId:kvt,cornersPointsBeforeRotation:Pvt,rotateSize:Bvt,getBounds:Fvt,textAlignToString:Lvt,wordBreakToString:Rvt,bBoxText:Ovt,bBoxTextHeight:Nvt,middleElement:function(e,t){return(e+t)/2},whiteSpaceToString:Vvt,rotatePoint:_vt,getOffset:Hvt,findNearestPoint:function(e,t,i){var n=Cbt.findLength(t,e),n=Cbt.findLength(i,e)<n?i:t,t=Cbt.findAngle(t,i),i=Cbt.findAngle(n,e),e=Cbt.findLength(n,e),t=i+2*(t-i);return{x:n.x+e*Math.cos(t*Math.PI/180),y:n.y+e*Math.sin(t*Math.PI/180)}},findElementUnderMouse:function(e,t,i){return Bbt(e.wrapper,t,i)},findTargetElement:Bbt,intersect3:Fbt,intersect2:function(e,t,i,n){return(e=Fbt(Lbt(e.x,e.y,t.x,t.y),Lbt(i.x,i.y,n.x,n.y))).enabled?e.intersectPt:{x:0,y:0}},getLineSegment:Lbt,getPoints:function(e,t,i){var n=[],o={x:t.topLeft.x-(i=i||0),y:t.topLeft.y},r={x:t.topRight.x+i,y:t.topRight.y},s={x:t.bottomRight.x,y:t.bottomRight.y-i},t={x:t.bottomLeft.x,y:t.bottomLeft.y+i};return n.push(o),n.push(r),n.push(s),n.push(t),n},getBezierDirection:function(e,t){return Math.abs(t.x-e.x)>Math.abs(t.y-e.y)?e.x<t.x?"right":"left":e.y<t.y?"bottom":"top"},updateStyle:function(e,t){for(var i=t.style,n=t,o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"fill":i.fill=e.fill,i instanceof J0t&&(i.fill="transparent");break;case"textOverflow":i.textOverflow=e.textOverflow;break;case"opacity":i.opacity=e.opacity;break;case"strokeColor":i.strokeColor=e.strokeColor;break;case"strokeDashArray":i.strokeDashArray=e.strokeDashArray;break;case"strokeWidth":i.strokeWidth=e.strokeWidth;break;case"bold":i.bold=e.bold;break;case"color":i.color=e.color;break;case"textWrapping":i.textWrapping=e.textWrapping;break;case"fontFamily":i.fontFamily=e.fontFamily;break;case"fontSize":i.fontSize=e.fontSize;break;case"italic":i.italic=e.italic;break;case"textAlign":i.textAlign=e.textAlign;break;case"whiteSpace":i.whiteSpace=e.whiteSpace;break;case"textDecoration":i.textDecoration=e.textDecoration}t instanceof Xvt&&n.refreshTextElement()},scaleElement:function e(t,i,n,o){if(void 0!==t.width&&void 0!==t.height&&(t.width*=i,t.height*=n),t instanceof Uvt){var r=uvt(),s=o.width||o.actualSize.width,a=o.height||o.actualSize.height;if(void 0!==s&&void 0!==a){var l=o.offsetX-s*o.pivot.x,h=o.offsetY-a*o.pivot.y,l={x:l+s*o.pivot.x,y:h+a*o.pivot.y},l=_vt(o.rotateAngle,o.offsetX,o.offsetY,l);mvt(r,-o.rotateAngle,l.x,l.y),mvt(r,o.rotateAngle,l.x,l.y);for(var d=0,p=t.children;d<p.length;d++){var c,u=p[d];void 0!==u.width&&void 0!==u.height&&(c=gvt(r,{x:u.offsetX,y:u.offsetY}),u.offsetX=c.x,u.offsetY=c.y,e(u,i,n,o))}}}},contains:Rbt,getPoint:function(e,t,i,n,o,r,s,a){var l={x:0,y:0},h=uvt();switch(mvt(h,o,r,s),a.x){case 0:switch(a.y){case 0:l=gvt(h,{x:e,y:t});break;case.5:l=gvt(h,{x:e,y:t+n/2});break;case 1:l=gvt(h,{x:e,y:t+n})}break;case.5:switch(a.y){case 0:l=gvt(h,{x:e+i/2,y:t});break;case.5:l=gvt(h,{x:e+i/2,y:t+n/2});break;case 1:l=gvt(h,{x:e+i/2,y:t+n})}break;case 1:switch(a.y){case 0:l=gvt(h,{x:e+i,y:t});break;case.5:l=gvt(h,{x:e+i,y:t+n/2});break;case 1:l=gvt(h,{x:e+i,y:t+n})}}return{x:l.x,y:l.y}},getChildNode:wvt,translatePoints:function(e,t){for(var i=[],n=0,o=t;n<o.length;n++){var r=o[n],r={x:e.offsetX-e.actualSize.width*e.pivot.x+r.x,y:e.offsetY-e.actualSize.height*e.pivot.y+r.y},s=void 0,a=e.rotateAngle+e.parentTransform;a&&mvt(s=uvt(),a,e.offsetX,e.offsetY),s&&(r=gvt(s,r)),i.push(r)}return i},measurePath:Cvt,measureText:Avt,getDiagramElement:xvt,createHtmlElement:Ivt,setAttributeHtml:Tvt,getAdornerLayerSvg:Evt,getSelectorElement:function(e,t){var i=null,t=Evt(e,t);return i=t?t.getElementById(e+"_SelectorElement"):i},createMeasureElements:Dvt,measureImage:Mvt,processPathData:rbt,parsePathData:sbt,getRectanglePath:abt,pathSegmentCollection:lbt,transformPath:hbt,updatedSegment:dbt,scalePathData:pbt,splitArrayCollection:cbt,getPathString:ubt,getString:gbt}),pJt=((h0=aJt=aJt||{})[h0.LeftToRight=0]="LeftToRight",h0[h0.RightToLeft=1]="RightToLeft",h0[h0.WordSplit=2]="WordSplit",h0[h0.Number=4]="Number",h0[h0.Tab=6]="Tab",(x_=lJt=lJt||{})[x_.English=0]="English",x_[x_.Hindi=1]="Hindi",x_[x_.Korean=2]="Korean",x_[x_.Chinese=3]="Chinese",x_[x_.Arabic=4]="Arabic",x_[x_.Hebrew=5]="Hebrew",x_[x_.Japanese=6]="Japanese",x_[x_.Thai=7]="Thai",x_[x_.SpecialCharacter=8]="SpecialCharacter",(l=hJt=hJt||{})[l.af_ZA=1078]="af_ZA",l[l.sq_AL=1052]="sq_AL",l[l.am_ET=1118]="am_ET",l[l.gsw_FR=1156]="gsw_FR",l[l.ar_DZ=5121]="ar_DZ",l[l.ar_BH=15361]="ar_BH",l[l.ar_EG=3073]="ar_EG",l[l.ar_IQ=2049]="ar_IQ",l[l.ar_JO=11265]="ar_JO",l[l.ar_KW=13313]="ar_KW",l[l.ar_LB=12289]="ar_LB",l[l.ar_LY=4097]="ar_LY",l[l.ar_MA=6145]="ar_MA",l[l.ar_OM=8193]="ar_OM",l[l.ar_QA=16385]="ar_QA",l[l.ar_SA=1025]="ar_SA",l[l.ar_SY=10241]="ar_SY",l[l.ar_TN=7169]="ar_TN",l[l.ar_AE=14337]="ar_AE",l[l.ar_YE=9217]="ar_YE",l[l.hy_AM=1067]="hy_AM",l[l.as_IN=1101]="as_IN",l[l.az_Cyrl_AZ=2092]="az_Cyrl_AZ",l[l.az_Latn_AZ=1068]="az_Latn_AZ",l[l.ba_RU=1133]="ba_RU",l[l.eu_ES=1069]="eu_ES",l[l.be_BY=1059]="be_BY",l[l.bn_BD=2117]="bn_BD",l[l.bn_IN=1093]="bn_IN",l[l.bs_Cyrl_BA=8218]="bs_Cyrl_BA",l[l.bs_Latn_BA=5146]="bs_Latn_BA",l[l.bg_BG=1026]="bg_BG",l[l.br_FR=1150]="br_FR",l[l.my_MM=1109]="my_MM",l[l.ca_ES=1027]="ca_ES",l[l.chr_US=1116]="chr_US",l[l.zh_HK=3076]="zh_HK",l[l.zh_MO=5124]="zh_MO",l[l.zh_CN=2052]="zh_CN",l[l.zh_SG=4100]="zh_SG",l[l.zh_TW=1028]="zh_TW",l[l.co_FR=1155]="co_FR",l[l.hr_BA=4122]="hr_BA",l[l.hr_HR=1050]="hr_HR",l[l.cs_CZ=1029]="cs_CZ",l[l.da_DK=1030]="da_DK",l[l.prs_AF=1164]="prs_AF",l[l.dv_MV=1125]="dv_MV",l[l.nl_BE=2067]="nl_BE",l[l.nl_NL=1043]="nl_NL",l[l.bin_NG=1126]="bin_NG",l[l.et_EE=1061]="et_EE",l[l.en_AU=3081]="en_AU",l[l.en_BZ=10249]="en_BZ",l[l.en_CA=4105]="en_CA",l[l.en_029=9225]="en_029",l[l.en_HK=15369]="en_HK",l[l.en_IN=16393]="en_IN",l[l.en_ID=14345]="en_ID",l[l.en_IE=6153]="en_IE",l[l.en_JM=8201]="en_JM",l[l.en_MY=17417]="en_MY",l[l.en_NZ=5129]="en_NZ",l[l.en_PH=13321]="en_PH",l[l.en_SG=18441]="en_SG",l[l.en_ZA=7177]="en_ZA",l[l.en_TT=11273]="en_TT",l[l.en_GB=2057]="en_GB",l[l.en_US=1033]="en_US",l[l.en_ZW=12297]="en_ZW",l[l.fo_FO=1080]="fo_FO",l[l.fil_PH=1124]="fil_PH",l[l.fi_FI=1035]="fi_FI",l[l.fr_BE=2060]="fr_BE",l[l.fr_CM=11276]="fr_CM",l[l.fr_CA=3084]="fr_CA",l[l.fr_CD=9228]="fr_CD",l[l.fr_CI=12300]="fr_CI",l[l.fr_FR=1036]="fr_FR",l[l.fr_HT=15372]="fr_HT",l[l.fr_LU=5132]="fr_LU",l[l.fr_ML=13324]="fr_ML",l[l.fr_MC=6156]="fr_MC",l[l.fr_MA=14348]="fr_MA",l[l.fr_RE=8204]="fr_RE",l[l.fr_SN=10252]="fr_SN",l[l.fr_CH=4108]="fr_CH",l[l.fy_NL=1122]="fy_NL",l[l.ff_NG=1127]="ff_NG",l[l.gd_GB=1084]="gd_GB",l[l.gl_ES=1110]="gl_ES",l[l.ka_GE=1079]="ka_GE",l[l.de_AT=3079]="de_AT",l[l.de_DE=1031]="de_DE",l[l.de_LI=5127]="de_LI",l[l.de_LU=4103]="de_LU",l[l.de_CH=2055]="de_CH",l[l.el_GR=1032]="el_GR",l[l.gn_PY=1140]="gn_PY",l[l.gu_IN=1095]="gu_IN",l[l.kl_GL=1135]="kl_GL",l[l.ha_Latn_NG=1128]="ha_Latn_NG",l[l.haw_US=1141]="haw_US",l[l.he_IL=1037]="he_IL",l[l.hi_IN=1081]="hi_IN",l[l.hu_HU=1038]="hu_HU",l[l.ibb_NG=1129]="ibb_NG",l[l.is_IS=1039]="is_IS",l[l.ig_NG=1136]="ig_NG",l[l.id_ID=1057]="id_ID",l[l.iu_Latn_CA=2141]="iu_Latn_CA",l[l.iu_Cans_CA=1117]="iu_Cans_CA",l[l.it_IT=1040]="it_IT",l[l.it_CH=2064]="it_CH",l[l.ga_IE=2108]="ga_IE",l[l.xh_ZA=1076]="xh_ZA",l[l.zu_ZA=1077]="zu_ZA",l[l.kn_IN=1099]="kn_IN",l[l.kr_NG=1137]="kr_NG",l[l.ks_Deva=2144]="ks_Deva",l[l.ks_Arab=1120]="ks_Arab",l[l.kk_KZ=1087]="kk_KZ",l[l.km_KH=1107]="km_KH",l[l.kok_IN=1111]="kok_IN",l[l.ko_KR=1042]="ko_KR",l[l.ky_KG=1088]="ky_KG",l[l.qut_GT=1158]="qut_GT",l[l.rw_RW=1159]="rw_RW",l[l.lo_LA=1108]="lo_LA",l[l.la_Latn=1142]="la_Latn",l[l.lv_LV=1062]="lv_LV",l[l.lt_LT=1063]="lt_LT",l[l.dsb_DE=2094]="dsb_DE",l[l.lb_LU=1134]="lb_LU",l[l.mk_MK=1071]="mk_MK",l[l.ms_BN=2110]="ms_BN",l[l.ms_MY=1086]="ms_MY",l[l.ml_IN=1100]="ml_IN",l[l.mt_MT=1082]="mt_MT",l[l.mni_IN=1112]="mni_IN",l[l.mi_NZ=1153]="mi_NZ",l[l.mr_IN=1102]="mr_IN",l[l.arn_CL=1146]="arn_CL",l[l.mn_MN=1104]="mn_MN",l[l.mn_Mong_CN=2128]="mn_Mong_CN",l[l.ne_NP=1121]="ne_NP",l[l.ne_IN=2145]="ne_IN",l[l.nb_NO=1044]="nb_NO",l[l.nn_NO=2068]="nn_NO",l[l.oc_FR=1154]="oc_FR",l[l.or_IN=1096]="or_IN",l[l.om_Ethi_ET=1138]="om_Ethi_ET",l[l.pap_AN=1145]="pap_AN",l[l.ps_AF=1123]="ps_AF",l[l.fa_IR=1065]="fa_IR",l[l.pl_PL=1045]="pl_PL",l[l.pt_BR=1046]="pt_BR",l[l.pt_PT=2070]="pt_PT",l[l.pa_IN=1094]="pa_IN",l[l.pa_PK=2118]="pa_PK",l[l.quz_BO=1131]="quz_BO",l[l.guz_EC=2155]="guz_EC",l[l.guz_PE=3179]="guz_PE",l[l.ro_RO=1048]="ro_RO",l[l.ro_MO=2072]="ro_MO",l[l.rm_CH=1047]="rm_CH",l[l.ru_RU=1049]="ru_RU",l[l.ru_MO=2073]="ru_MO",l[l.smn_FI=9275]="smn_FI",l[l.smj_NO=4155]="smj_NO",l[l.smj_SE=5179]="smj_SE",l[l.se_FI=3131]="se_FI",l[l.se_NO=1083]="se_NO",l[l.se_SE=2107]="se_SE",l[l.sms_FI=8251]="sms_FI",l[l.sma_NO=6203]="sma_NO",l[l.sma_SE=7227]="sma_SE",l[l.sa_IN=1103]="sa_IN",l[l.sr_Cyrl_BA=7194]="sr_Cyrl_BA",l[l.sr_Cyrl_CS=3098]="sr_Cyrl_CS",l[l.sr_Latn_BA=6170]="sr_Latn_BA",l[l.sr_Latn_CS=2074]="sr_Latn_CS",l[l.nso_ZA=1132]="nso_ZA",l[l.tn_ZA=1074]="tn_ZA",l[l.sd_Arab_PK=2137]="sd_Arab_PK",l[l.sd_Deva_IN=1113]="sd_Deva_IN",l[l.si_LK=1115]="si_LK",l[l.sk_SK=1051]="sk_SK",l[l.sl_SI=1060]="sl_SI",l[l.so_SO=1143]="so_SO",l[l.es_AR=11274]="es_AR",l[l.es_BO=16394]="es_BO",l[l.es_CL=13322]="es_CL",l[l.es_CO=9226]="es_CO",l[l.es_CR=5130]="es_CR",l[l.es_DO=7178]="es_DO",l[l.es_EC=12298]="es_EC",l[l.es_SV=17418]="es_SV",l[l.es_GT=4106]="es_GT",l[l.es_HN=18442]="es_HN",l[l.es_MX=2058]="es_MX",l[l.es_NI=19466]="es_NI",l[l.es_PA=6154]="es_PA",l[l.es_PY=15370]="es_PY",l[l.es_PE=10250]="es_PE",l[l.es_PR=20490]="es_PR",l[l.es_ES=3082]="es_ES",l[l.es_ES_tradnl=1034]="es_ES_tradnl",l[l.es_US=21514]="es_US",l[l.es_UY=14346]="es_UY",l[l.es_VE=8202]="es_VE",l[l.st_ZA=1072]="st_ZA",l[l.sw_KE=1089]="sw_KE",l[l.sv_FI=2077]="sv_FI",l[l.sv_SE=1053]="sv_SE",l[l.syr_SY=1114]="syr_SY",l[l.tg_Cyrl_TJ=1064]="tg_Cyrl_TJ",l[l.tzm_Arab_MA=1119]="tzm_Arab_MA",l[l.tzm_Latn_DZ=2143]="tzm_Latn_DZ",l[l.ta_IN=1097]="ta_IN",l[l.tt_RU=1092]="tt_RU",l[l.te_IN=1098]="te_IN",l[l.th_TH=1054]="th_TH",l[l.bo_CN=1105]="bo_CN",l[l.ti_ER=2163]="ti_ER",l[l.ti_ET=1139]="ti_ET",l[l.ts_ZA=1073]="ts_ZA",l[l.tr_TR=1055]="tr_TR",l[l.tk_TM=1090]="tk_TM",l[l.ug_CN=1152]="ug_CN",l[l.uk_UA=1058]="uk_UA",l[l.hsb_DE=1070]="hsb_DE",l[l.ur_PK=1056]="ur_PK",l[l.uz_Cyrl_UZ=2115]="uz_Cyrl_UZ",l[l.uz_Latn_UZ=1091]="uz_Latn_UZ",l[l.ve_ZA=1075]="ve_ZA",l[l.vi_VN=1066]="vi_VN",l[l.cy_GB=1106]="cy_GB",l[l.wo_SN=1160]="wo_SN",l[l.sah_RU=1157]="sah_RU",l[l.ii_CN=1144]="ii_CN",l[l.yi_Hebr=1085]="yi_Hebr",l[l.yo_NG=1130]="yo_NG",l[l.ja_JP=1041]="ja_JP",(k_=dJt=dJt||{}).EvenPage="EvenPage",k_.NewPage="NewPage",k_.Continuous="NoBreak",k_.OddPage="OddPage",{Tab:"\t",Paragraph:"\n",LineBreak:"\v",PageBreak:"\f",ColumnBreak:"",Image:"",Table:"",Row:"",Cell:"",Marker_Start:"",Marker_End:"",Field_Separator:"",Section_Break:""}),cJt=function(e,t,i){this.id=e,this.commentProperties=t,this.text=i},uJt=(Object.defineProperty(gJt.prototype,"length",{get:function(){return this.keysInternal.length},enumerable:!0,configurable:!0}),Object.defineProperty(gJt.prototype,"keys",{get:function(){return this.keysInternal},enumerable:!0,configurable:!0}),Object.defineProperty(gJt.prototype,"values",{get:function(){return this.valuesInternal},enumerable:!0,configurable:!0}),gJt.prototype.add=function(e,t){if(je(e))throw new ReferenceError("Provided key or value is not valid.");return this.keysInternal.indexOf(e)<0&&(this.keysInternal.push(e),this.valuesInternal.push(t)),1},gJt.prototype.get=function(e){if(je(e))throw new ReferenceError("Provided key is not valid.");e=this.keysInternal.indexOf(e);if(!(e<0||e>this.keysInternal.length-1))return this.valuesInternal[e]},gJt.prototype.set=function(e,t){if(je(e))throw new ReferenceError("Provided key is not valid.");e=this.keysInternal.indexOf(e);if(e<0||e>this.keysInternal.length-1)throw new RangeError("No item with the specified key has been added.");this.valuesInternal[e]=t},gJt.prototype.remove=function(e){if(je(e))throw new ReferenceError("Provided key is not valid.");e=this.keysInternal.indexOf(e);if(e<0||e>this.keysInternal.length-1)throw new RangeError("No item with the specified key has been added.");return this.keysInternal.splice(e,1),this.valuesInternal.splice(e,1),!0},gJt.prototype.containsKey=function(e){if(je(e))throw new ReferenceError("Provided key is not valid.");e=this.keysInternal.indexOf(e);return!(e<0||e>this.keysInternal.length-1)},gJt.prototype.clear=function(){this.keysInternal=[],this.valuesInternal=[]},gJt.prototype.destroy=function(){this.clear(),this.keysInternal=void 0,this.valuesInternal=void 0},gJt);function gJt(){this.keysInternal=[],this.valuesInternal=[]}fJt.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);break;case 11:n=this.isColumnFormatEqual(e,t,i)}return n},fJt.prototype.isNotEqual=function(e,t,i,n,o){var r=void 0,o=fJt.getPropertyType(o,e),s=(this.propertiesHash.containsKey(o)&&(r=this.propertiesHash.get(o)),void 0);return e===i?s=n:t.containsKey(o)&&(s=t.get(o)),!(r===s||!je(r)&&!je(s)&&r===s)},fJt.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);break;case 11:i=this.getColumnFormatType(t)}return i},fJt.getRowFormatType=function(e){switch(e){case"allowBreakAcrossPages":return 1;case"isHeader":return 2;case"height":return 3;case"heightType":return 4;case"gridBefore":return 5;case"gridBeforeWidth":return 6;case"gridBeforeWidthType":return 7;case"gridAfter":return 8;case"gridAfterWidth":return 9;case"gridAfterWidthType":return 10;case"leftMargin":return 11;case"topMargin":return 12;case"bottomMargin":return 13;case"rightMargin":return 14;case"leftIndent":return 15;default:return 0}},fJt.getListFormatType=function(e){switch(e){case"listId":return 1;case"listLevelNumber":return 2;case"nsid":return 3;default:return 0}},fJt.getTableFormatType=function(e){switch(e){case"leftMargin":return 1;case"rightMargin":return 2;case"topMargin":return 3;case"bottomMargin":return 4;case"cellSpacing":return 5;case"leftIndent":return 6;case"tableAlignment":return 7;case"preferredWidth":return 8;case"preferredWidthType":return 9;case"bidi":return 10;case"allowAutoFit":return 11;case"horizontalPositionAbs":return 12;case"horizontalPosition":return 13;default:return 0}},fJt.getListLevelType=function(e){switch(e){case"listLevelPattern":return 1;case"startAt":return 2;case"followCharacter":return 3;case"numberFormat":return 4;case"restartLevel":return 5;case"isLegalStyleNumbering":return 6;case"paraStyleName":return 7;default:return 0}},fJt.getShadingPropertyType=function(e){switch(e){case"backgroundColor":return 1;case"foregroundColor":return 2;case"textureStyle":return 3;default:return 0}},fJt.getCellFormatPropertyType=function(e){switch(e){case"leftMargin":return 1;case"rightMargin":return 2;case"topMargin":return 3;case"bottomMargin":return 4;case"columnSpan":return 5;case"rowSpan":return 6;case"verticalAlignment":return 7;case"preferredWidthType":return 8;case"preferredWidth":return 9;case"cellWidth":return 10;default:return 0}},fJt.getBorderPropertyType=function(e){switch(e){case"color":return 1;case"lineStyle":return 2;case"lineWidth":return 3;case"shadow":return 4;case"space":return 5;case"hasNoneStyle":return 6;default:return 0}},fJt.getCharacterFormatPropertyType=function(e){switch(e){case"fontColor":return 1;case"fontFamily":return 2;case"fontSize":return 3;case"bold":return 4;case"italic":return 5;case"underline":return 6;case"strikethrough":return 7;case"baselineAlignment":return 8;case"highlightColor":return 9;case"bidi":return 10;case"bdo":return 11;case"boldBidi":return 12;case"italicBidi":return 13;case"fontFamilyBidi":return 14;case"fontSizeBidi":return 15;case"allCaps":return 16;case"localeIdBidi":return 17;case"complexScript":return 18;case"fontFamilyFarEast":return 19;case"fontFamilyAscii":return 20;case"fontFamilyNonFarEast":return 21;case"localeIdAscii":return 22;case"localeIdFarEast":return 23;case"characterSpacing":return 24;case"scaling":return 25;case"hidden":return 26;case"underlineColor":return 27;case"fontHintType":return 28;default:return 0}},fJt.getParaFormatPropertyType=function(e){switch(e){case"leftIndent":return 1;case"rightIndent":return 2;case"firstLineIndent":return 3;case"textAlignment":return 4;case"beforeSpacing":return 5;case"afterSpacing":return 6;case"lineSpacing":return 7;case"lineSpacingType":return 8;case"outlineLevel":return 9;case"bidi":return 10;case"contextualSpacing":return 11;case"keepWithNext":return 12;case"keepLinesTogether":return 13;case"widowControl":return 14;case"spaceBeforeAuto":return 15;case"spaceAfterAuto":return 16;default:return 0}},fJt.getColumnFormatType=function(e){switch(e){case"width":return 1;case"space":return 2;default:return 0}},fJt.getSectionFormatType=function(e){switch(e){case"headerDistance":return 1;case"footerDistance":return 2;case"differentFirstPage":return 3;case"differentOddAndEvenPages":return 4;case"pageWidth":return 5;case"pageHeight":return 6;case"leftMargin":return 7;case"topMargin":return 8;case"rightMargin":return 9;case"bottomMargin":return 10;case"bidi":return 11;case"restartPageNumbering":return 12;case"pageStartingNumber":return 13;case"endnoteNumberFormat":return 14;case"endnotePosition":return 15;case"footNoteNumberFormat":return 16;case"footnotePosition":return 17;case"restartIndexForEndnotes":return 18;case"restartIndexForFootnotes":return 19;case"initialFootNoteNumber":return 20;case"initialEndNoteNumber":return 21;case"pageNumberStyle":return 22;case"numberOfColumns":return 23;case"equalWidth":return 24;case"lineBetweenColumns":return 25;case"columns":return 26;case"breakCode":return 27;default:return 0}},fJt.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))},fJt.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)||this.isNotEqual("localeIdBidi",e,t,i,2)||this.isNotEqual("localeIdAscii",e,t,i,2)||this.isNotEqual("localeIdFarEast",e,t,i,2)||this.isNotEqual("complexScript",e,t,i,2)||this.isNotEqual("hidden",e,t,i,2)||this.isNotEqual("fontFamilyFarEast",e,t,i,2)||this.isNotEqual("fontFamilyAscii",e,t,i,2)||this.isNotEqual("fontFamilyNonFarEast",e,t,i,2)||this.isNotEqual("characterSpacing",e,t,i,2)||this.isNotEqual("scaling",e,t,i,2)||this.isNotEqual("underlineColor",e,t,i,2)||this.isNotEqual("fontHintType",e,t,i,2))},fJt.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("spaceBeforeAuto",e,t,i,3)||this.isNotEqual("spaceAfterAuto",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)||this.isNotEqual("keepWithNext",e,t,i,3)||this.isNotEqual("keepLinesTogether",e,t,i,3)||this.isNotEqual("widowControl",e,t,i,3))},fJt.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))},fJt.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)},fJt.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))},fJt.prototype.isListFormatEqual=function(e,t,i){return!this.isNotEqual("listId",e,t,i,7)&&!this.isNotEqual("listLevelNumber",e,t,i,7)&&!this.isNotEqual("nsid",e,t,i,7)},fJt.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))},fJt.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("paraStyleName",e,t,i,9)||this.isNotEqual("restartLevel",e,t,i,9)||this.isNotEqual("isLegalStyleNumbering",e,t,i,9))},fJt.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)||this.isNotEqual("pageNumberStyle",e,t,i,10)||this.isNotEqual("numberOfColumns",e,t,i,10)||this.isNotEqual("equalWidth",e,t,i,10)||this.isNotEqual("lineBetweenColumns",e,t,i,10)||this.isNotEqual("breakCode",e,t,i,10))},fJt.prototype.isColumnFormatEqual=function(e,t,i){return!this.isNotEqual("width",e,t,i,11)&&!this.isNotEqual("space",e,t,i,11)},fJt.prototype.cloneItems=function(e,t,i,n){for(var o=fJt.getPropertyType(n,t),r=e.propertiesHash.keys,s=0;s<r.length;s++)r[s]===o?this.propertiesHash.add(o,i):this.propertiesHash.add(r[s],e.propertiesHash.get(r[s]));e.propertiesHash.containsKey(o)||this.propertiesHash.add(o,i)},fJt.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},fJt.prototype.cloneProperties=function(){for(var e=new uJt,t=this.propertiesHash.keys,i=0;i<t.length;i++)e.add(t[i],this.propertiesHash.get(t[i]));return e},fJt.prototype.destroy=function(){je(this.propertiesHash)||this.propertiesHash.destroy(),this.propertiesHash=void 0,this.referenceCount=void 0,this.uniqueFormatType=void 0};var mJt=fJt;function fJt(e){this.referenceCount=0,this.uniqueFormatType=e,this.propertiesHash=new uJt}yJt.prototype.addUniqueFormat=function(e,t){for(var i=void 0,n=0;n<this.items.length;n++)if(this.items[n].isEqual(e,void 0,void 0)){i=this.items[n];break}return je(i)?((i=new mJt(t)).propertiesHash=e,i.referenceCount=1,this.items.push(i)):i.referenceCount++,i},yJt.prototype.updateUniqueFormat=function(e,t,i){for(var n=void 0,o=0;o<this.items.length;o++)if(this.items[o].isEqual(e.propertiesHash,t,i)){n=this.items[o];break}return je(n)?((n=new mJt(e.uniqueFormatType)).cloneItems(e,t,i,e.uniqueFormatType),n.referenceCount=1,this.items.push(n)):n.referenceCount++,this.remove(e),n},yJt.prototype.remove=function(e){e.referenceCount--,e.referenceCount<=0&&(this.items.splice(this.items.indexOf(e),1),e.destroy())},yJt.prototype.clear=function(){if(je(this.items))for(var e=0;e<this.items.length;e++)this.items[e].destroy();this.items=[]},yJt.prototype.destroy=function(){this.clear(),this.items=void 0};Det=yJt;function yJt(){this.items=[]}bJt.prototype.send=function(e,t,i){var n=this,o=(this.xmlHttpRequest=new XMLHttpRequest,0);i=!!je(i)||i,je(t)||(this.xmlHttpRequest.withCredentials=t.withCredentials,o=0<=t.timeout?t.timeout:0,this.customHeaders=t.headers),this.xmlHttpRequest.onreadystatechange=function(){n.stateChange(n)},this.xmlHttpRequest.onerror=function(){n.error(n)},this.mode?this.sendRequest(e,o,i):setTimeout(function(){n.sendRequest(e,o,i)})},bJt.prototype.sendRequest=function(e,t,i){this.xmlHttpRequest.open("POST",this.url,i),i&&(this.xmlHttpRequest.timeout=t),this.contentType&&this.xmlHttpRequest.setRequestHeader("Content-Type",this.contentType),this.setCustomAjaxHeaders(),this.responseType&&(this.xmlHttpRequest.responseType=this.responseType);i=e instanceof FormData?e:JSON.stringify(e);this.xmlHttpRequest.send(i)},bJt.prototype.stateChange=function(e){var t;4===e.xmlHttpRequest.readyState&&200===e.xmlHttpRequest.status?(t={name:"onSuccess",data:this.responseType?e.xmlHttpRequest.response:e.xmlHttpRequest.responseText,readyState:e.xmlHttpRequest.readyState,status:e.xmlHttpRequest.status},e.successHandler(t)):4===e.xmlHttpRequest.readyState&&200!==e.xmlHttpRequest.status&&(t={name:"onFailure",status:e.xmlHttpRequest.status,statusText:e.xmlHttpRequest.statusText,url:e.url},e.failureHandler(t))},bJt.prototype.error=function(e){var t={name:"onError",status:this.xmlHttpRequest.status,statusText:this.xmlHttpRequest.statusText};e.errorHandler(t)},bJt.prototype.successHandler=function(e){return this.onSuccess&&this.onSuccess(e),e},bJt.prototype.failureHandler=function(e){return this.onFailure&&this.onFailure(e),e},bJt.prototype.errorHandler=function(e){return this.onError&&this.onError(e),e},bJt.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 o=n[i];this.xmlHttpRequest.setRequestHeader(o,t[o])}};var vJt=bJt;function bJt(){this.mode=!0}var wJt="internalZoomFactorChange",CJt="contentChange",SJt="documentChange",AJt="selectionChange",xJt="zoomFactorChange",IJt="beforeFieldFill",TJt="afterFieldFill",EJt="afterFormFieldFill",DJt="beforeFormFieldFill",MJt="serviceFailure",kJt="viewChange",PJt="customContextMenuSelect",BJt="customContextMenuBeforeOpen",FJt="contentControl",LJt="beforeContentControlFill",RJt="afterContentControlFill",OJt="commentBegin",NJt="commentEnd",VJt="beforeCommentAction",_Jt="commentDelete",HJt="beforeAcceptRejectChanges",zJt="beforePaneSwitch",jJt="requestNavigate",WJt="actionComplete",QJt="trackChange",UJt="searchResultsChange",qJt="toolbarClick",GJt="beforeFileOpen",YJt="internalviewChange",XJt="beforeXmlHttpRequestSend",KJt="protectionTypeChange",JJt="internalDocumentEditorSettingsChange",ZJt="internalStyleCollectionChange",$Jt="Times New Roman",eZt="internalAutoResize",tZt="beforeAutoResize",iZt="trackChanges",nZt="internalOptionPaneChange",oZt="documentLoadFailed",rZt=["sections","sec"],sZt=["fontSubstitutionTable","fst"],aZt=["characterFormat","cf"],lZt=["paragraphFormat","pf"],hZt=["lists","li"],dZt=["abstractLists","al"],pZt=["background","bg"],cZt=["styles","sty"],uZt=["comments","cm"],gZt=["revisions","r"],mZt=["customXml","cx"],fZt=["defaultTabWidth","dtw"],yZt=["formatting","fmt"],vZt=["trackChanges","tc"],bZt=["protectionType","pt"],wZt=["enforcement","enf"],CZt=["hashValue","hv"],SZt=["saltValue","sv"],AZt=["dontUseHTMLParagraphAutoSpacing","dhtml"],xZt=["alignTablesRowByRow","atrr"],IZt=["formFieldShading","ffs"],TZt=["lastParagraphMarkCopied","lpmc"],EZt=["footnotes","fn"],DZt=["endnotes","en"],MZt=["compatibilityMode","comp"],kZt=["themeFontLanguages","tfl"],PZt=["themes","thm"],BZt=["name","n"],FZt=["basedOn","b"],LZt=["next","nx"],RZt=["link","l"],OZt=["localeId","id"],NZt=["localeIdFarEast","idfe"],VZt=["localeIdBidi","idbi"],_Zt=["bold","b"],HZt=["italic","i"],zZt=["underline","u"],jZt=["underlineColor","uc"],WZt=["fontHintType","fht"],QZt=["baselineAlignment","ba"],UZt=["strikethrough","st"],qZt=["highlightColor","hc"],GZt=["fontSize","fsz"],YZt=["fontColor","fc"],XZt=["fontFamily","ff"],KZt=["styleName","stn"],JZt=["bidi","bi"],ZZt=["bdo","bdo"],$Zt=["breakClearType","bct"],e$t=["fontSizeBidi","fszbi"],t$t=["fontFamilyBidi","ffbi"],i$t=["boldBidi","bbi"],n$t=["italicBidi","ibi"],o$t=["allCaps","ac"],r$t=["complexScript","cs"],s$t=["fontFamilyAscii","ffa"],a$t=["fontFamilyFarEast","fffe"],l$t=["fontFamilyNonFarEast","ffnfe"],h$t=["revisionIds","rids"],d$t=["listId","lid"],p$t=["characterSpacing","csp"],c$t=["scaling","sc"],u$t=["listLevelNumber","lilno"],g$t=["leftIndent","lin"],m$t=["rightIndent","rin"],f$t=["firstLineIndent","fin"],y$t=["textAlignment","ta"],v$t=["afterSpacing","as"],b$t=["beforeSpacing","bs"],w$t=["spaceAfterAuto","saa"],C$t=["spaceBeforeAuto","sba"],S$t=["lineSpacing","ls"],A$t=["lineSpacingType","lst"],x$t=["listFormat","lif"],I$t=["keepWithNext","kwn"],T$t=["widowControl","wc"],E$t=["keepLinesTogether","klt"],D$t=["outlineLevel","ol"],M$t=["contextualSpacing","cs"],k$t=["borders","bdrs"],P$t=["tabs","tb"],B$t=["headerDistance","hd"],F$t=["footerDistance","fd"],L$t=["differentFirstPage","dfp"],R$t=["differentOddAndEvenPages","doep"],O$t=["pageWidth","pw"],N$t=["pageHeight","ph"],V$t=["leftMargin","lm"],_$t=["rightMargin","rm"],H$t=["topMargin","tm"],z$t=["bottomMargin","bm"],j$t=["restartPageNumbering","rpn"],W$t=["pageStartingNumber","psn"],Q$t=["endnoteNumberFormat","enf"],U$t=["footNoteNumberFormat","fnf"],q$t=["restartIndexForFootnotes","rif"],G$t=["restartIndexForEndnotes","rie"],Y$t=["initialFootNoteNumber","ifn"],X$t=["initialEndNoteNumber","ien"],K$t=["pageNumberStyle","pgns"],J$t=["columns","cols"],Z$t=["numberOfColumns","ncols"],$$t=["equalWidth","eqw"],eei=["lineBetweenColumns","lbtc"],tei=["breakCode","bc"],iei=["cellWidth","cw"],nei=["columnSpan","colsp"],oei=["rowSpan","rwsp"],rei=["verticalAlignment","va"],sei=["allowBreakAcrossPages","abrk"],aei=["isHeader","hdr"],lei=["heightType","ht"],hei=["gridBefore","gb"],dei=["gridBeforeWidth","gbw"],pei=["gridBeforeWidthType","gbwt"],cei=["gridAfter","ga"],uei=["gridAfterWidth","gaw"],gei=["gridAfterWidthType","gawt"],mei=["allowAutoFit","auft"],fei=["cellSpacing","csp"],yei=["shading","sd"],vei=["tableAlignment","ta"],bei=["preferredWidth","pw"],wei=["preferredWidthType","pwt"],Cei=["horizontalPositionAbs","hpa"],Sei=["texture","t"],Aei=["backgroundColor","bgc"],xei=["foregroundColor","fgc"],Iei=["shadow","sh"],Tei=["hasNoneStyle","hns"],Eei=["vertical","v"],Dei=["horizontal","h"],Mei=["diagonalUp","du"],kei=["diagonalDown","dd"],Pei=["lineStyle","ls"],Bei=["lineWidth","lw"],Fei=["layout","l"],Lei=["dataFormat","df"],Rei=["yValue","y"],Oei=["chartData","chd"],Nei=["categoryXName","cx"],Vei=["line","l"],_ei=["foreColor","fc"],Hei=["layoutX","x"],zei=["layoutY","y"],jei=["direction","dir"],Wei=["endStyle","est"],Qei=["numberValue","no"],Uei=["markerStyle","mst"],qei=["markerColor","mc"],Gei=["markerSize","msz"],Yei=["forward","fw"],Xei=["backward","bw"],Kei=["intercept","itr"],Jei=["isDisplayRSquared","idrs"],Zei=["isDisplayEquation","ideq"],$ei=["seriesName","sn"],eti=["dataLabel","sl"],tti=["errorBar","eb"],iti=["seriesFormat","sf"],nti=["trendLines","tl"],oti=["dataPoints","dp"],rti=["firstSliceAngle","fsa"],sti=["holeSize","hsz"],ati=["isLegendKey","lk"],lti=["isBubbleSize","bsz"],hti=["isCategoryName","icn"],dti=["isSeriesName","isn"],pti=["isValue","iv"],cti=["isPercentage","ip"],uti=["isLeaderLines","il"],gti=["showSeriesKeys","sk"],mti=["hasHorzBorder","hhbdr"],fti=["hasVertBorder","hvbdr"],yti=["hasBorders","hbdr"],vti=["categoryType","ct"],bti=["chartCategory","c"],wti=["chartSeries","cs"],Cti=["chartArea","ca"],Sti=["chartTitleArea","cta"],Ati=["plotArea","pa"],xti=["chartLegend","cl"],Iti=["chartPrimaryCategoryAxis","cpca"],Tti=["chartPrimaryValueAxis","cpva"],Eti=["chartTitle","ctt"],Dti=["chartType","ct"],Mti=["gapWidth","gw"],kti=["overlap","o"],Pti=["chartDataTable","cdt"],Bti=["text","tlp"],Fti=["shapeId","sid"],Lti=["alternativeText","at"],Rti=["visible","v"],Oti=["belowText","b"],Nti=["horizontalRule","ihr"],Vti=["width","w"],_ti=["height","h"],Hti=["widthScale","ws"],zti=["heightScale","hs"],jti=["lineFormat","lf"],Wti=["fillFormat","ff"],Qti=["textWrappingStyle","tws"],Uti=["textWrappingType","twt"],qti=["verticalRelativePercent","vrp"],Gti=["horizontalRelativePercent","hrp"],Yti=["heightRelativePercent","hrp"],Xti=["widthRelativePercent","wrp"],Kti=["zOrderPosition","z"],Jti=["layoutInCell","lc"],Zti=["lockAnchor","la"],$ti=["autoShapeType","ast"],eii=["textFrame","tf"],tii=["color","c"],iii=["fill","f"],nii=["textVerticalAlignment","tva"],oii=["imageString","img"],rii=["metaFileImageString","mtimg"],sii=["isInlineImage","inimg"],aii=["isMetaFile","imf"],lii=["top","tp"],hii=["bottom","bt"],dii=["right","rg"],pii=["left","lt"],cii=["getimageheight","gih"],uii=["getimagewidth","giw"],gii=["hasFieldEnd","hfe"],mii=["formFieldData","ffd"],fii=["fieldType","ft"],yii=["enabled","e"],vii=["helpText","h"],bii=["statusText","st"],wii=["textInput","ti"],Cii=["checkBox","c"],Sii=["dropDownList","ddl"],Aii=["maxLength","ml"],xii=["defaultValue","dv"],Iii=["format","f"],Tii=["sizeType","szt"],Eii=["size","sz"],Dii=["checked","chk"],Mii=["dropDownItems","ddi"],kii=["selectedIndex","si"],Pii=["commentId","cid"],Bii=["commentCharacterType","cct"],Fii=["author","a"],Lii=["initial","i"],Rii=["date","dt"],Oii=["done","dn"],Nii=["replyComments","rc"],Vii=["revisionType","rt"],_ii=["revisionId","rid"],Hii=["itemID","iid"],zii=["xml","x"],jii=["footnoteType","fnt"],Wii=["symbolCode","sc"],Qii=["symbolFontName","sfn"],Uii=["customMarker","cm"],qii=["inlines","i"],Gii=["contentControlProperties","ccp"],Yii=["lockContentControl","lcc"],Xii=["lockContents","lc"],Kii=["tag","tg"],Jii=["title","tt"],Zii=["hasPlaceHolderText","hpt"],$ii=["multiline","mul"],eni=["isTemporary","it"],tni=["dateCalendarType","dtct"],ini=["dateStorageFormat","dtsf"],nni=["dateDisplayLocale","dtdl"],oni=["dateDisplayFormat","dtdf"],rni=["isChecked","ichk"],sni=["uncheckedState","uchk"],ani=["checkedState","chks"],lni=["contentControlListItems","ccli"],hni=["xmlMapping","x"],dni=["font","f"],pni=["value","v"],cni=["displayText","dt"],uni=["isMapped","imap"],gni=["isWordMl","iwml"],mni=["prefixMapping","pmap"],fni=["xPath","xp"],yni=["storeItemId","siid"],vni=["customXmlPart","cxp"],bni=["id","i"],wni=["cellFormat","tcpr"],Cni=["rowFormat","trpr"],Sni=["cells","c"],Ani=["rows","r"],xni=["description","desc"],Ini=["wrapTextAround","wta"],Tni=["isLegalStyleNumbering","isLgl"],Eni=["positioning","p"],Dni=["tableFormat","tblpr"],Mni=["allowOverlap","ao"],kni=["distanceTop","dt"],Pni=["distanceRight","dr"],Bni=["distanceLeft","dl"],Fni=["distanceBottom","db"],Lni=["verticalOrigin","vo"],Rni=["verticalPosition","vp"],Oni=["horizontalOrigin","ho"],Nni=["horizontalAlignment","ha"],Vni=["horizontalPosition","hp"],_ni=["blocks","b"],Hni=["header","h"],zni=["footer","f"],jni=["evenHeader","eh"],Wni=["evenFooter","ef"],Qni=["firstPageHeader","fph"],Uni=["firstPageFooter","fpf"],qni=["headersFooters","hf"],Gni=["sectionFormat","secpr"],Yni=["listLevelPattern","lilp"],Xni=["followCharacter","fchar"],Kni=["startAt","sa"],Jni=["restartLevel","rl"],Zni=["levelNumber","lvlno"],$ni=["numberFormat","nf"],eoi=["paraStyleName","psty"],toi=["abstractListId","alid"],ioi="nsid",noi=["levels","lvl"],ooi=["overrideListLevel","o"],roi=["levelOverrides","lo"],soi=["separator","s"],aoi=["continuationSeparator","cs"],loi=["continuationNotice","cn"],hoi=["bookmarkType","bkt"],doi=["properties","p"],poi=["tabJustification","tj"],coi=["position","p"],uoi=["deletePosition","dp"],goi=["tabLeader","tl"],moi=["editRangeId","erid"],foi=["columnFirst","cft"],yoi=["columnLast","clt"],voi=["user","u"],boi=["group","g"],woi=["editableRangeStart","ers"],Coi=["space","sp"],Soi=["fontScheme","fsc"],Aoi=["fontSchemeName","fscn"],xoi=["majorFontScheme","majfs"],Ioi=["minorFontScheme","minfs"],Toi=["fontSchemeList","fsl"],Eoi=["fontTypeface","ft"],Doi=["typeface","t"],Moi=["panose","p"],koi=["type","t"],Poi=["majorUnit","maju"],Boi=["isAutoMajor","iam"],Foi=["maximumValue","maxv"],Loi=["minimumValue","minv"],Roi=["hasMajorGridLines","hmajgl"],Ooi=["hasMinorGridLines","hmingl"],Noi=["majorTickMark","majtm"],Voi=["minorTickMark","mintm"],_oi=["tickLabelPosition","tlp"],Hoi=["rgb","rgb"],zoi=["appearance","a"],joi=["lineFormatType","lft"],Woi=["allowSpaceOfSameStyleInTable","stytbl"],Qoi=["weight","w"],Uoi=["inlineFormat","inf"],qoi=["fontName","fn"],Goi=["isCompressed","comp"],Yoi=["columnIndex","ci"],Xoi=["images","imgs"],Koi=["isAfterParagraphMark","apm"],Joi=["isAfterCellMark","acm"],Zoi=["isAfterRowMark","arm"],$oi=["grid","grd"],eri=["columnCount","colc"],tri=["isAfterTableMark","atm"],iri=["iOps"],nri=["hidden","hdn"],ori=["editingpoints","ep"],rri=(sri.prototype.getModuleName=function(){return"Print"},sri.prototype.print=function(e,t){this.printWindow(e,void 0!==navigator?navigator.userAgent:"",t)},sri.prototype.printWindow=function(e,t,i){var n=this.getPageHeight(e.pages),o=this.getPageWidth(e.pages),r=document.createElement("div"),s=(r.style.width="100%",r.style.height="100%",r.style.overflow="scroll",this.generatePrintContent(e,r),je(i)&&(i=window.open("","print","height=452,width=1024,tabbar=no")),this.windowPrint=i,o.toString()+"px "+n.toString()+"px"),a=(n<o&&(s="landscape"),-1!==t.indexOf("Chrome")?(i.document.write("<!DOCTYPE html>"),i.document.write("<html><head><title>"+e.owner.documentName+"</title><style>img { height: 100%; width: 100%; display: block;}img { box-sizing: border-box; }br, button { display: none; }@page{ margin: 0cm; size:"+s+"; }@media print{ body { margin: 0cm; size:"+s+"; }}</style></head> <body><center>")):-1!==t.indexOf("Firefox")?(i.document.write("<!DOCTYPE html>"),i.document.write("<html moznomarginboxes mozdisallowselectionprint><head><title>"+e.owner.documentName+"</title><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:"+s+"; }@media print{ body { margin: 0cm; size:"+s+"; }}</style></head> <body><center>")):i.document.write("<html><head><title>"+e.owner.documentName+"</title><style>@page{margin:0;size:"+s+";}</style></head><body><center>"),i.document.write(r.innerHTML+"</center><script> (function() { window.ready = true; })(); <\/script></body></html>"),r=void 0,i.document.close(),i.focus(),window.addEventListener("beforeunload",this.closePrintWindow),Number(setInterval(function(){i.ready&&(i.print(),i.close(),clearInterval(a))},500)))},sri.prototype.exportAsImage=function(e,t,i){var n,o,r;return!je(t)&&t<=e.pages.length&&1<=t&&(o=(t=e.pages[t-1]).boundingRectangle.height,r=t.boundingRectangle.width,e.render.isPrinting=!0,e.render.renderWidgets(t,0,0,0,0),t=e.render.pageCanvas.toDataURL(i,1),e.render.isPrinting=!1,(n=new Image).src=t,n.style.cssText="margin: 0px; display: block; width: "+r+"px; height: "+o+"px;"),n},sri.prototype.generatePrintContent=function(e,t){t.innerHTML="";for(var i=0;i<e.pages.length;i++){var n=e.pages[i],o=n.boundingRectangle.height,r=n.boundingRectangle.width,n=(e.render.isPrinting=!0,e.render.renderWidgets(n,0,0,r,0),e.render.pageCanvas.toDataURL()),s=(e.render.isPrinting=!1,document.createElement("div")),a=document.createElement("img"),n=(a.src=n,"margin:0px;display:block;width:"+r+"px;height:"+o+"px");rt(a,n),s.appendChild(a),t.appendChild(s),i!==e.pages.length-1&&t.appendChild(document.createElement("br"))}},sri.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},sri.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},sri.prototype.destroy=function(){window.removeEventListener("beforeunload",this.closePrintWindow),this.windowPrint=void 0},sri);function sri(){var e=this;this.windowPrint=void 0,this.closePrintWindow=function(){e.windowPrint&&!e.windowPrint.closed&&e.windowPrint.close()}}Object.defineProperty(lri.prototype,"headerDistance",{get:function(){return this.getPropertyValue("headerDistance")},set:function(e){this.setPropertyValue("headerDistance",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"footerDistance",{get:function(){return this.getPropertyValue("footerDistance")},set:function(e){this.setPropertyValue("footerDistance",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"differentFirstPage",{get:function(){return this.getPropertyValue("differentFirstPage")},set:function(e){this.setPropertyValue("differentFirstPage",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"differentOddAndEvenPages",{get:function(){return this.getPropertyValue("differentOddAndEvenPages")},set:function(e){this.setPropertyValue("differentOddAndEvenPages",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"pageHeight",{get:function(){return this.getPropertyValue("pageHeight")},set:function(e){this.setPropertyValue("pageHeight",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"rightMargin",{get:function(){return this.getPropertyValue("rightMargin")},set:function(e){this.setPropertyValue("rightMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"pageWidth",{get:function(){return this.getPropertyValue("pageWidth")},set:function(e){this.setPropertyValue("pageWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"leftMargin",{get:function(){return this.getPropertyValue("leftMargin")},set:function(e){this.setPropertyValue("leftMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"bottomMargin",{get:function(){return this.getPropertyValue("bottomMargin")},set:function(e){this.setPropertyValue("bottomMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"topMargin",{get:function(){return this.getPropertyValue("topMargin")},set:function(e){this.setPropertyValue("topMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"bidi",{get:function(){return this.getPropertyValue("bidi")},set:function(e){this.setPropertyValue("bidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"restartPageNumbering",{get:function(){return this.getPropertyValue("restartPageNumbering")},set:function(e){this.setPropertyValue("restartPageNumbering",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"pageStartingNumber",{get:function(){return this.getPropertyValue("pageStartingNumber")},set:function(e){this.setPropertyValue("pageStartingNumber",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"endnoteNumberFormat",{get:function(){return this.getPropertyValue("endnoteNumberFormat")},set:function(e){this.setPropertyValue("endnoteNumberFormat",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"restartIndexForEndnotes",{get:function(){return this.getPropertyValue("restartIndexForEndnotes")},set:function(e){this.setPropertyValue("restartIndexForEndnotes",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"restartIndexForFootnotes",{get:function(){return this.getPropertyValue("restartIndexForFootnotes")},set:function(e){this.setPropertyValue("restartIndexForFootnotes",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"footNoteNumberFormat",{get:function(){return this.getPropertyValue("footNoteNumberFormat")},set:function(e){this.setPropertyValue("footNoteNumberFormat",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"initialFootNoteNumber",{get:function(){return this.getPropertyValue("initialFootNoteNumber")},set:function(e){this.setPropertyValue("initialFootNoteNumber",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"initialEndNoteNumber",{get:function(){return this.getPropertyValue("initialEndNoteNumber")},set:function(e){this.setPropertyValue("initialEndNoteNumber",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"pageNumberStyle",{get:function(){return this.getPropertyValue("pageNumberStyle")},set:function(e){this.setPropertyValue("pageNumberStyle",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"numberOfColumns",{get:function(){return this.getPropertyValue("numberOfColumns")},set:function(e){this.setPropertyValue("numberOfColumns",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"equalWidth",{get:function(){return this.getPropertyValue("equalWidth")},set:function(e){this.setPropertyValue("equalWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"lineBetweenColumns",{get:function(){return this.getPropertyValue("lineBetweenColumns")},set:function(e){this.setPropertyValue("lineBetweenColumns",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"breakCode",{get:function(){return this.getPropertyValue("breakCode")},set:function(e){this.setPropertyValue("breakCode",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"firstPageHeader",{get:function(){return this.getPropertyValue("firstPageHeader")},set:function(e){this.setPropertyValue("firstPageHeader",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"firstPageFooter",{get:function(){return this.getPropertyValue("firstPageFooter")},set:function(e){this.setPropertyValue("firstPageFooter",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"oddPageHeader",{get:function(){return this.getPropertyValue("oddPageHeader")},set:function(e){this.setPropertyValue("oddPageHeader",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"oddPageFooter",{get:function(){return this.getPropertyValue("oddPageFooter")},set:function(e){this.setPropertyValue("oddPageFooter",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"evenPageHeader",{get:function(){return this.getPropertyValue("evenPageHeader")},set:function(e){this.setPropertyValue("evenPageHeader",e)},enumerable:!0,configurable:!0}),Object.defineProperty(lri.prototype,"evenPageFooter",{get:function(){return this.getPropertyValue("evenPageFooter")},set:function(e){this.setPropertyValue("evenPageFooter",e)},enumerable:!0,configurable:!0}),lri.prototype.destroy=function(){je(this.uniqueSectionFormat)||lri.uniqueSectionFormats.remove(this.uniqueSectionFormat),this.uniqueSectionFormat=void 0,this.ownerBase=void 0,this.columns=void 0,this.removedHeaderFooters=void 0},lri.prototype.hasValue=function(e){return!je(this.uniqueSectionFormat)&&(e=mJt.getPropertyType(this.uniqueSectionFormat.uniqueFormatType,e),this.uniqueSectionFormat.propertiesHash.containsKey(e))},lri.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;break;case"pageNumberStyle":t="Arabic";break;case"numberOfColumns":t=1;break;case"equalWidth":t=!0;break;case"lineBetweenColumns":t=!1;break;case"breakCode":t="NewPage";break;case"firstPageHeader":case"firstPageFooter":case"oddPageHeader":case"oddPageFooter":case"evenPageHeader":case"evenPageFooter":t=void 0}return t},lri.prototype.getPropertyValue=function(e){if(this.hasValue(e)){var t=mJt.getPropertyType(lri.uniqueFormatType,e);if(!je(this.uniqueSectionFormat)&&this.uniqueSectionFormat.propertiesHash.containsKey(t))return this.uniqueSectionFormat.propertiesHash.get(t)}return lri.getPropertyDefaultValue(e)},lri.prototype.setPropertyValue=function(e,t){var i;!je(t)&&""!==t||(t=lri.getPropertyDefaultValue(e)),je(this.uniqueSectionFormat)?this.initializeUniqueSectionFormat(e,t):(i=mJt.getPropertyType(this.uniqueSectionFormat.uniqueFormatType,e),this.uniqueSectionFormat.propertiesHash.containsKey(i)&&this.uniqueSectionFormat.propertiesHash.get(i)===t||(this.uniqueSectionFormat=lri.uniqueSectionFormats.updateUniqueFormat(this.uniqueSectionFormat,e,t)))},lri.prototype.initializeUniqueSectionFormat=function(e,t){var i=new uJt;this.addUniqueSectionFormat("headerDistance",e,t,i),this.addUniqueSectionFormat("footerDistance",e,t,i),this.addUniqueSectionFormat("differentFirstPage",e,t,i),this.addUniqueSectionFormat("differentOddAndEvenPages",e,t,i),this.addUniqueSectionFormat("pageWidth",e,t,i),this.addUniqueSectionFormat("pageHeight",e,t,i),this.addUniqueSectionFormat("leftMargin",e,t,i),this.addUniqueSectionFormat("topMargin",e,t,i),this.addUniqueSectionFormat("rightMargin",e,t,i),this.addUniqueSectionFormat("bottomMargin",e,t,i),this.addUniqueSectionFormat("bidi",e,t,i),this.addUniqueSectionFormat("restartPageNumbering",e,t,i),this.addUniqueSectionFormat("pageStartingNumber",e,t,i),this.addUniqueSectionFormat("endnoteNumberFormat",e,t,i),this.addUniqueSectionFormat("endnotePosition",e,t,i),this.addUniqueSectionFormat("footNoteNumberFormat",e,t,i),this.addUniqueSectionFormat("footnotePosition",e,t,i),this.addUniqueSectionFormat("restartIndexForEndnotes",e,t,i),this.addUniqueSectionFormat("restartIndexForFootnotes",e,t,i),this.addUniqueSectionFormat("initialFootNoteNumber",e,t,i),this.addUniqueSectionFormat("initialEndNoteNumber",e,t,i),this.addUniqueSectionFormat("pageNumberStyle",e,t,i),this.addUniqueSectionFormat("numberOfColumns",e,t,i),this.addUniqueSectionFormat("equalWidth",e,t,i),this.addUniqueSectionFormat("lineBetweenColumns",e,t,i),this.addUniqueSectionFormat("breakCode",e,t,i),this.uniqueSectionFormat=lri.uniqueSectionFormats.addUniqueFormat(i,lri.uniqueFormatType)},lri.prototype.addUniqueSectionFormat=function(e,t,i,n){var o=mJt.getPropertyType(lri.uniqueFormatType,e);e===t?n.add(o,i):n.add(o,lri.getPropertyDefaultValue(e))},lri.prototype.copyFormat=function(e,t){t&&(t.isUndoing||t.isRedoing)?(this.uniqueSectionFormat=e.uniqueSectionFormat,this.columns=e.columns,this.removedHeaderFooters=e.removedHeaderFooters):je(e)||(this.removedHeaderFooters=e.removedHeaderFooters,!je(e.uniqueSectionFormat)&&e.uniqueSectionFormat.propertiesHash&&(this.updateUniqueSectionFormat(e),this.columns=e.columns))},lri.prototype.updateUniqueSectionFormat=function(e){var t=void 0;this.uniqueSectionFormat&&(t=this.uniqueSectionFormat.mergeProperties(e.uniqueSectionFormat),0===this.uniqueSectionFormat.referenceCount)&&(lri.uniqueSectionFormats.remove(this.uniqueSectionFormat),this.uniqueSectionFormat=void 0),this.uniqueSectionFormat=new mJt(lri.uniqueFormatType),je(t)&&(t=this.uniqueSectionFormat.mergeProperties(e.uniqueSectionFormat)),this.uniqueSectionFormat=lri.uniqueSectionFormats.addUniqueFormat(t,lri.uniqueFormatType)},lri.prototype.cloneFormat=function(){var e=new lri;return e.uniqueSectionFormat=this.uniqueSectionFormat,e.columns=this.columns,e},lri.clear=function(){this.uniqueSectionFormats.clear()},lri.uniqueSectionFormats=new Det,lri.uniqueFormatType=10;var ari=lri;function lri(e){this.uniqueSectionFormat=void 0,this.columns=[],this.ownerBase=e,this.columns=[],this.removedHeaderFooters=[]}dri.prototype.destroy=function(){je(this.uniqueColumnFormat)||dri.uniqueColumnFormats.remove(this.uniqueColumnFormat),this.uniqueColumnFormat=void 0,this.ownerBase=void 0},dri.prototype.hasValue=function(e){return!je(this.uniqueColumnFormat)&&(e=mJt.getPropertyType(this.uniqueColumnFormat.uniqueFormatType,e),this.uniqueColumnFormat.propertiesHash.containsKey(e))},Object.defineProperty(dri.prototype,"index",{get:function(){return this.indexIn},set:function(e){this.indexIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(dri.prototype,"width",{get:function(){return this.getPropertyValue("width")},set:function(e){this.setPropertyValue("width",e)},enumerable:!0,configurable:!0}),Object.defineProperty(dri.prototype,"space",{get:function(){return this.getPropertyValue("space")},set:function(e){this.setPropertyValue("space",e)},enumerable:!0,configurable:!0}),dri.prototype.getPropertyValue=function(e){if(this.hasValue(e)){var t=mJt.getPropertyType(dri.uniqueFormatType,e);if(!je(this.uniqueColumnFormat)&&this.uniqueColumnFormat.propertiesHash.containsKey(t))return this.uniqueColumnFormat.propertiesHash.get(t)}return dri.getPropertyDefaultValue(e)},dri.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"width":t=36;break;case"space":t=0}return t},dri.prototype.setPropertyValue=function(e,t){var i;!je(t)&&""!==t||(t=dri.getPropertyDefaultValue(e)),je(this.uniqueColumnFormat)?this.initializeUniqueColumnFormat(e,t):(i=mJt.getPropertyType(this.uniqueColumnFormat.uniqueFormatType,e),this.uniqueColumnFormat.propertiesHash.containsKey(i)&&this.uniqueColumnFormat.propertiesHash.get(i)===t||(this.uniqueColumnFormat=dri.uniqueColumnFormats.updateUniqueFormat(this.uniqueColumnFormat,e,t)))},dri.prototype.initializeUniqueColumnFormat=function(e,t){var i=new uJt;this.addUniqueColumnFormat("width",e,t,i),this.addUniqueColumnFormat("space",e,t,i),this.uniqueColumnFormat=dri.uniqueColumnFormats.addUniqueFormat(i,dri.uniqueFormatType)},dri.prototype.addUniqueColumnFormat=function(e,t,i,n){var o=mJt.getPropertyType(dri.uniqueFormatType,e);e===t?n.add(o,i):n.add(o,dri.getPropertyDefaultValue(e))},dri.prototype.updateUniqueColumnFormat=function(e){var t=void 0;this.uniqueColumnFormat&&(t=this.uniqueColumnFormat.mergeProperties(e.uniqueColumnFormat),0===this.uniqueColumnFormat.referenceCount)&&(dri.uniqueColumnFormats.remove(this.uniqueColumnFormat),this.uniqueColumnFormat=void 0),this.uniqueColumnFormat=new mJt(dri.uniqueFormatType),je(t)&&(t=this.uniqueColumnFormat.mergeProperties(e.uniqueColumnFormat)),this.uniqueColumnFormat=dri.uniqueColumnFormats.addUniqueFormat(t,dri.uniqueFormatType)},dri.prototype.cloneFormat=function(){var e=new dri(void 0);return e.width=this.width,e.space=this.space,e},dri.prototype.copyFormat=function(e){je(e)||je(e.uniqueColumnFormat)||(this.width=e.width,this.space=e.space)},dri.clear=function(){this.uniqueColumnFormats.clear()},dri.uniqueColumnFormats=new Det,dri.uniqueFormatType=11;var hri=dri;function dri(e){this.uniqueColumnFormat=void 0,this.ownerBase=e}Object.defineProperty(cri.prototype,"color",{get:function(){return this.getPropertyValue("color")},set:function(e){this.setPropertyValue("color",e)},enumerable:!0,configurable:!0}),Object.defineProperty(cri.prototype,"lineStyle",{get:function(){return this.getPropertyValue("lineStyle")},set:function(e){this.setPropertyValue("lineStyle",e)},enumerable:!0,configurable:!0}),Object.defineProperty(cri.prototype,"lineWidth",{get:function(){return this.getPropertyValue("lineWidth")},set:function(e){this.setPropertyValue("lineWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(cri.prototype,"shadow",{get:function(){return this.getPropertyValue("shadow")},set:function(e){this.setPropertyValue("shadow",e)},enumerable:!0,configurable:!0}),Object.defineProperty(cri.prototype,"space",{get:function(){return this.getPropertyValue("space")},set:function(e){this.setPropertyValue("space",e)},enumerable:!0,configurable:!0}),Object.defineProperty(cri.prototype,"hasNoneStyle",{get:function(){return this.getPropertyValue("hasNoneStyle")},set:function(e){this.setPropertyValue("hasNoneStyle",e)},enumerable:!0,configurable:!0}),Object.defineProperty(cri.prototype,"isBorderDefined",{get:function(){return"None"!==this.lineStyle||this.hasNoneStyle&&this.hasValue("hasNoneStyle")},enumerable:!0,configurable:!0}),cri.prototype.getPropertyValue=function(e){if(this.hasValue(e)){var t=mJt.getPropertyType(cri.uniqueFormatType,e);if(!je(this.uniqueBorderFormat)){t=this.uniqueBorderFormat.propertiesHash.get(t);if(!je(t))return t}}return cri.getPropertyDefaultValue(e)},cri.prototype.setPropertyValue=function(e,t){var i;!je(t)&&""!==t||(t=cri.getPropertyDefaultValue(e)),je(this.uniqueBorderFormat)?this.initializeUniqueBorder(e,t):(i=mJt.getPropertyType(this.uniqueBorderFormat.uniqueFormatType,e),this.uniqueBorderFormat.propertiesHash.containsKey(i)&&this.uniqueBorderFormat.propertiesHash.get(i)===t||(this.uniqueBorderFormat=cri.uniqueBorderFormats.updateUniqueFormat(this.uniqueBorderFormat,e,t)))},cri.prototype.initializeUniqueBorder=function(e,t){var i=new uJt;this.addUniqueBorderFormat("color",e,t,i),this.addUniqueBorderFormat("lineStyle",e,t,i),this.addUniqueBorderFormat("lineWidth",e,t,i),this.addUniqueBorderFormat("shadow",e,t,i),this.addUniqueBorderFormat("space",e,t,i),this.addUniqueBorderFormat("hasNoneStyle",e,t,i),this.uniqueBorderFormat=cri.uniqueBorderFormats.addUniqueFormat(i,cri.uniqueFormatType)},cri.prototype.addUniqueBorderFormat=function(e,t,i,n){var o=mJt.getPropertyType(cri.uniqueFormatType,e);e===t&&n.add(o,i)},cri.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},cri.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.5<=this.lineWidth?this.lineWidth:.5;case"SingleWavy":return 1.5===this.lineWidth?3:2.5;case"DoubleWavy":return 6.75;case"DashDotStroked":case"Outset":return.5<=this.lineWidth?this.lineWidth:.5}return.5<=this.lineWidth?this.lineWidth:.5},cri.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++)0<=i[parseInt(n.toString(),10)]?i[parseInt(n.toString(),10)]=i[parseInt(n.toString(),10)]*t:i[parseInt(n.toString(),10)]=Math.abs(i[parseInt(n.toString(),10)]);return i},cri.prototype.getBorderWeight=function(){var e=0,t=(this.getNumberOfLines(),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=this.lineWidth*t;break;case"Dot":case"DashLargeGap":e=1}return e},cri.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},cri.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},cri.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},cri.prototype.hasValues=function(){return this.hasValue("color")||this.hasValue("lineStyle")||this.hasValue("lineWidth")||this.hasValue("shadow")||this.hasValue("space")||this.hasValue("hasNoneStyle")},cri.prototype.hasValue=function(e){return!je(this.uniqueBorderFormat)&&(e=mJt.getPropertyType(this.uniqueBorderFormat.uniqueFormatType,e),this.uniqueBorderFormat.propertiesHash.containsKey(e))},cri.prototype.cloneFormat=function(){var e=new cri(void 0);return e.color=this.color,e.lineStyle=this.lineStyle,e.lineWidth=this.lineWidth,e.shadow=this.shadow,e.space=this.space,e},cri.prototype.clearFormat=function(){je(this.uniqueBorderFormat)||cri.uniqueBorderFormats.remove(this.uniqueBorderFormat),this.uniqueBorderFormat=void 0},cri.prototype.destroy=function(){this.clearFormat(),this.ownerBase=void 0},cri.prototype.isEqualFormat=function(e){var t=!1;return t=this.color===e.color&&this.lineStyle===e.lineStyle&&this.lineWidth===e.lineWidth&&this.shadow===e.shadow&&this.space===e.space?!0:t},cri.prototype.copyFormat=function(e){je(e)||je(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.hasValue("hasNoneStyle")&&(this.hasNoneStyle=e.hasNoneStyle))},cri.clear=function(){this.uniqueBorderFormats.clear()},cri.uniqueBorderFormats=new Det,cri.uniqueFormatType=1;var pri=cri;function cri(e){this.uniqueBorderFormat=void 0,this.ownerBase=void 0,this.ownerBase=e}Object.defineProperty(gri.prototype,"left",{get:function(){return this.ownerBase instanceof bri?this.getPropertyValue("left"):this.leftIn},set:function(e){this.leftIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(gri.prototype,"right",{get:function(){return this.ownerBase instanceof bri?this.getPropertyValue("right"):this.rightIn},set:function(e){this.rightIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(gri.prototype,"top",{get:function(){return this.ownerBase instanceof bri?this.getPropertyValue("top"):this.topIn},set:function(e){this.topIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(gri.prototype,"bottom",{get:function(){return this.ownerBase instanceof bri?this.getPropertyValue("bottom"):this.bottomIn},set:function(e){this.bottomIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(gri.prototype,"horizontal",{get:function(){return this.ownerBase instanceof bri?this.getPropertyValue("horizontal"):this.horizontalIn},set:function(e){this.horizontalIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(gri.prototype,"vertical",{get:function(){return this.ownerBase instanceof bri?this.getPropertyValue("vertical"):this.verticalIn},set:function(e){this.verticalIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(gri.prototype,"diagonalUp",{get:function(){return this.diagonalUpIn},set:function(e){this.diagonalUpIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(gri.prototype,"diagonalDown",{get:function(){return this.diagonalDownIn},set:function(e){this.diagonalDownIn=e},enumerable:!0,configurable:!0}),gri.prototype.getPropertyValue=function(e){var t=this.getBorder(e);if(this.isParsing)return t;if(t.hasValues())return t;var i=this.ownerBase.baseStyle;if(!je(i)){for(var n=this;!je(i);){var o=void 0;if(this.ownerBase.listFormat.hasValue("listId")||(o=i.paragraphFormat.getListPargaraphFormat(e)),i.paragraphFormat.borders.getBorder(e).hasValues()){n=i.paragraphFormat.borders;break}if(!je(o)&&o.borders.getBorder(e).hasValues()){n=o.borders;break}i=i.basedOn}if(!je(i))return n.getBorder(e)}return this.getDefaultValue(e)},gri.prototype.getDefaultValue=function(e){var t,i=this.documentParagraphFormat();return t=je(i)||je(i.borders)?t:i.borders.getBorder(e)},gri.prototype.documentParagraphFormat=function(){var e;return e=this.ownerBase instanceof bri?this.ownerBase.getDocumentParagraphFormat():e},gri.prototype.getBorder=function(e){switch(e){case"left":return this.leftIn;case"right":return this.rightIn;case"top":return this.topIn;case"bottom":return this.bottomIn;case"vertical":return this.verticalIn;case"horizontal":return this.horizontalIn}},gri.prototype.clearFormat=function(){je(this.leftIn)||this.leftIn.clearFormat(),je(this.topIn)||this.topIn.clearFormat(),je(this.bottomIn)||this.bottomIn.clearFormat(),je(this.rightIn)||this.rightIn.clearFormat(),je(this.horizontalIn)||this.horizontalIn.clearFormat(),je(this.verticalIn)||this.verticalIn.clearFormat(),je(this.diagonalDown)||this.diagonalDown.clearFormat(),je(this.diagonalUp)||this.diagonalUp.clearFormat()},gri.prototype.destroy=function(){je(this.leftIn)||this.leftIn.destroy(),je(this.topIn)||this.topIn.destroy(),je(this.bottomIn)||this.bottomIn.destroy(),je(this.rightIn)||this.rightIn.destroy(),je(this.horizontalIn)||this.horizontalIn.destroy(),je(this.verticalIn)||this.verticalIn.destroy(),je(this.diagonalDown)||this.diagonalDown.destroy(),je(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.ownerBase=void 0},gri.prototype.cloneFormat=function(){var e=new gri(void 0);return e.top=je(this.topIn)?void 0:this.topIn.cloneFormat(),e.bottom=je(this.bottomIn)?void 0:this.bottomIn.cloneFormat(),e.left=je(this.leftIn)?void 0:this.leftIn.cloneFormat(),e.right=je(this.rightIn)?void 0:this.rightIn.cloneFormat(),e.horizontal=je(this.horizontalIn)?void 0:this.horizontalIn.cloneFormat(),e.vertical=je(this.verticalIn)?void 0:this.verticalIn.cloneFormat(),e.diagonalUp=je(this.diagonalUp)?void 0:this.diagonalUp.cloneFormat(),e.diagonalDown=je(this.diagonalDown)?void 0:this.diagonalDown.cloneFormat(),e},gri.prototype.copyFormat=function(e){var t;!je(e.getBorder("left"))&&e.getBorder("left")instanceof pri&&((t=new pri(this)).copyFormat(e.getBorder("left")),this.left=t),!je(e.getBorder("right"))&&e.getBorder("right")instanceof pri&&((t=new pri(this)).copyFormat(e.getBorder("right")),this.right=t),!je(e.getBorder("top"))&&e.getBorder("top")instanceof pri&&((t=new pri(this)).copyFormat(e.getBorder("top")),this.top=t),!je(e.getBorder("bottom"))&&e.getBorder("bottom")instanceof pri&&((t=new pri(this)).copyFormat(e.getBorder("bottom")),this.bottom=t),!je(e.getBorder("horizontal"))&&e.getBorder("horizontal")instanceof pri&&((t=new pri(this)).copyFormat(e.getBorder("horizontal")),this.horizontal=t),!je(e.getBorder("vertical"))&&e.getBorder("vertical")instanceof pri&&((t=new pri(this)).copyFormat(e.getBorder("vertical")),this.vertical=t),!je(e.diagonalDown)&&e.diagonalDown instanceof pri&&(this.diagonalDown=new pri(this),this.diagonalDown.copyFormat(e.diagonalDown)),!je(e.diagonalUp)&&e.diagonalUp instanceof pri&&(this.diagonalUp=new pri(this),this.diagonalUp.copyFormat(e.diagonalUp))};var uri=gri;function gri(e){this.leftIn=new pri(this),this.rightIn=new pri(this),this.topIn=new pri(this),this.bottomIn=new pri(this),this.horizontalIn=new pri(this),this.verticalIn=new pri(this),this.diagonalUpIn=new pri(this),this.diagonalDownIn=new pri(this),this.isParsing=!1,this.ownerBase=e}Object.defineProperty(fri.prototype,"nsid",{get:function(){return this.getPropertyValue("nsid")},set:function(e){this.setPropertyValue("nsid",e)},enumerable:!0,configurable:!0}),Object.defineProperty(fri.prototype,"listId",{get:function(){return this.getPropertyValue("listId")},set:function(e){var t;0<=e?je(this.ownerBase)||je(t=this.ownerBase.getDocumentHelperObject())||(this.list=t.getListById(e)):!je(this.list)&&e<0&&(this.list=void 0),this.setPropertyValue("listId",e)},enumerable:!0,configurable:!0}),Object.defineProperty(fri.prototype,"listLevelNumber",{get:function(){return this.getPropertyValue("listLevelNumber")},set:function(e){this.setPropertyValue("listLevelNumber",e)},enumerable:!0,configurable:!0}),Object.defineProperty(fri.prototype,"listLevel",{get:function(){var e=void 0;if(je(this.list))for(var t=this.baseStyle;!je(t)&&t instanceof _ri;){if(t.paragraphFormat.listFormat.list){e=t.paragraphFormat.listFormat.list;break}t=t.basedOn}else e=this.list;if(!je(e))return e.getListLevel(this.listLevelNumber)},enumerable:!0,configurable:!0}),fri.prototype.getPropertyValue=function(e){if(this.hasValue(e)){t=mJt.getPropertyType(fri.uniqueFormatType,e);if(!je(this.uniqueListFormat)&&this.uniqueListFormat.propertiesHash.containsKey(t))return this.uniqueListFormat.propertiesHash.get(t)}else if(this.baseStyle instanceof _ri){for(var t,i=this.baseStyle;!je(i)&&!i.paragraphFormat.listFormat.hasValue(e);)i=i.basedOn;if(!je(i))return t=mJt.getPropertyType(fri.uniqueFormatType,e),i.paragraphFormat.listFormat.uniqueListFormat.propertiesHash.get(t)}return fri.getPropertyDefaultValue(e)},fri.prototype.setPropertyValue=function(e,t){var i;!je(t)&&""!==t||(t=fri.getPropertyDefaultValue(e)),je(this.uniqueListFormat)?this.initializeUniqueListFormat(e,t):(i=mJt.getPropertyType(this.uniqueListFormat.uniqueFormatType,e),this.uniqueListFormat.propertiesHash.containsKey(i)&&this.uniqueListFormat.propertiesHash.get(i)===t||(this.uniqueListFormat=fri.uniqueListFormats.updateUniqueFormat(this.uniqueListFormat,e,t)))},fri.prototype.initializeUniqueListFormat=function(e,t){var i=new uJt;this.addUniqueListFormat("listId",e,t,i),this.addUniqueListFormat("listLevelNumber",e,t,i),this.addUniqueListFormat("nsid",e,t,i),this.uniqueListFormat=fri.uniqueListFormats.addUniqueFormat(i,fri.uniqueFormatType)},fri.prototype.addUniqueListFormat=function(e,t,i,n){var o=mJt.getPropertyType(fri.uniqueFormatType,e);e===t&&n.add(o,i)},fri.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"listId":t=-1;break;case"listLevelNumber":t=0;break;case"nsid":t=-1}return t},fri.prototype.copyFormat=function(e){je(e)||(je(e.uniqueListFormat)||(this.listId=e.listId,this.listLevelNumber=e.listLevelNumber,this.nsid=e.nsid),je(e.baseStyle)||(this.baseStyle=e.baseStyle),je(e.list))||(this.list=e.list)},fri.prototype.hasValue=function(e){return!je(this.uniqueListFormat)&&(e=mJt.getPropertyType(this.uniqueListFormat.uniqueFormatType,e),this.uniqueListFormat.propertiesHash.containsKey(e))},fri.prototype.clearFormat=function(){je(this.uniqueListFormat)||0!==this.uniqueListFormat.referenceCount||fri.uniqueListFormats.remove(this.uniqueListFormat),this.uniqueListFormat=void 0,this.list=void 0},fri.prototype.destroy=function(){je(this.uniqueListFormat)||fri.uniqueListFormats.remove(this.uniqueListFormat),this.uniqueListFormat=void 0,this.list=void 0,this.ownerBase=void 0,this.baseStyle=void 0},fri.clear=function(){this.uniqueListFormats.clear()},fri.prototype.applyStyle=function(e){this.baseStyle=e},fri.prototype.getValue=function(e){return this.hasValue(e)?this.getPropertyValue(e):void 0},fri.prototype.cloneListFormat=function(){var e=new fri(void 0);return e.list=this.list,e.listId=this.listId,e.nsid=this.nsid,e.baseStyle=this.baseStyle,e.listLevelNumber=this.listLevelNumber,e.uniqueListFormat=this.uniqueListFormat,e},fri.uniqueListFormats=new Det,fri.uniqueFormatType=7;var mri=fri;function fri(e){this.uniqueListFormat=void 0,this.ownerBase=void 0,this.baseStyle=void 0,this.list=void 0,this.ownerBase=e}Object.defineProperty(vri.prototype,"position",{get:function(){return this.positionIn},set:function(e){this.positionIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(vri.prototype,"deletePosition",{get:function(){return this.deletePositionIn},set:function(e){this.deletePositionIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(vri.prototype,"tabJustification",{get:function(){return this.justification},set:function(e){this.justification=e},enumerable:!0,configurable:!0}),Object.defineProperty(vri.prototype,"tabLeader",{get:function(){return this.leader},set:function(e){this.leader=e},enumerable:!0,configurable:!0}),vri.prototype.clone=function(){var e=new vri;return e.deletePosition=this.deletePosition,e.position=this.position,e.tabJustification=this.tabJustification,e.tabLeader=this.tabLeader,e},vri.prototype.equals=function(e){return this.position===e.position&&this.deletePosition===e.deletePosition&&this.tabJustification===e.tabJustification&&this.tabLeader===e.tabLeader},vri.prototype.destroy=function(){this.position=void 0,this.deletePosition=void 0,this.tabJustification=void 0,this.leader=void 0};var yri=vri;function vri(){}wri.prototype.getUpdatedTabs=function(){for(var e=[],t=new uJt,i=0,n=this.getTabStopsFromListFormat();i<n.length;i++){var o=n[i];t.containsKey(o.position)||t.add(o.position,o)}if(!je(this.baseStyle)&&this.baseStyle instanceof _ri){for(var r=this.baseStyle;!je(r);){for(var s=0,a=r.paragraphFormat.tabs;s<a.length;s++){var l=a[s];t.containsKey(l.position)||t.add(l.position,l)}r=r.basedOn}var h=[];t.keys.forEach(function(e){h.push(t.get(e))});for(var d=0;d<h.length;d++){o=h[d];this.isValidTabStop(h,o)||t.remove(o.position)}for(var p=0,c=t.keys;p<c.length;p++){var u=c[p];this.hasTabStop(parseFloat(u.toFixed(4)))||e.push(t.get(u))}}return 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})},wri.prototype.getTabStopsFromListFormat=function(){if(-1<this.listFormat.listId&&-1<this.listFormat.listLevelNumber){var e=this.listFormat.listLevel;if(e&&e.paragraphFormat)return e.paragraphFormat.tabs}return[]},wri.prototype.isValidTabStop=function(e,t){for(var i=0;i<e.length;i++)if(t!=e[i]&&(parseFloat(e[i].position.toFixed(4))===parseFloat(t.position.toFixed(4))||parseFloat(e[i].deletePosition.toFixed(4))===parseFloat(t.position.toFixed(4))))return!1;return!0},wri.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(wri.prototype,"leftIndent",{get:function(){return this.getPropertyValue("leftIndent")},set:function(e){this.setPropertyValue("leftIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"rightIndent",{get:function(){return this.getPropertyValue("rightIndent")},set:function(e){this.setPropertyValue("rightIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"firstLineIndent",{get:function(){return this.getPropertyValue("firstLineIndent")},set:function(e){this.setPropertyValue("firstLineIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"beforeSpacing",{get:function(){return this.getPropertyValue("beforeSpacing")},set:function(e){this.setPropertyValue("beforeSpacing",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"afterSpacing",{get:function(){return this.getPropertyValue("afterSpacing")},set:function(e){this.setPropertyValue("afterSpacing",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"spaceBeforeAuto",{get:function(){return this.getPropertyValue("spaceBeforeAuto")},set:function(e){this.setPropertyValue("spaceBeforeAuto",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"spaceAfterAuto",{get:function(){return this.getPropertyValue("spaceAfterAuto")},set:function(e){this.setPropertyValue("spaceAfterAuto",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"lineSpacing",{get:function(){return this.getPropertyValue("lineSpacing")},set:function(e){this.setPropertyValue("lineSpacing",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"lineSpacingType",{get:function(){return this.getPropertyValue("lineSpacingType")},set:function(e){this.setPropertyValue("lineSpacingType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"textAlignment",{get:function(){var e=this.getPropertyValue("textAlignment");return this.bidi&&("Left"===e?e="Right":"Right"===e&&(e="Left")),e},set:function(e){this.setPropertyValue("textAlignment",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"keepWithNext",{get:function(){return this.getPropertyValue("keepWithNext")},set:function(e){this.setPropertyValue("keepWithNext",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"keepLinesTogether",{get:function(){return this.getPropertyValue("keepLinesTogether")},set:function(e){this.setPropertyValue("keepLinesTogether",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"widowControl",{get:function(){return this.getPropertyValue("widowControl")},set:function(e){this.setPropertyValue("widowControl",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"outlineLevel",{get:function(){return this.getPropertyValue("outlineLevel")},set:function(e){this.setPropertyValue("outlineLevel",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"bidi",{get:function(){return this.getPropertyValue("bidi")},set:function(e){this.setPropertyValue("bidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(wri.prototype,"contextualSpacing",{get:function(){return this.getPropertyValue("contextualSpacing")},set:function(e){this.setPropertyValue("contextualSpacing",e)},enumerable:!0,configurable:!0}),wri.prototype.getListFormatParagraphFormat=function(e){var t=this.getListPargaraphFormat(e);if(!je(t))return t.uniqueParagraphFormat.propertiesHash.get(mJt.getPropertyType(wri.uniqueFormatType,e))},wri.prototype.getListPargaraphFormat=function(e){var t,i;return this.listFormat.hasValue("listId")&&-1<this.listFormat.listId&&-1<this.listFormat.listLevelNumber?(t=this.listFormat.listLevel,i=mJt.getPropertyType(wri.uniqueFormatType,e),je(t)||je(t.paragraphFormat.uniqueParagraphFormat)||!t.paragraphFormat.uniqueParagraphFormat.propertiesHash.containsKey(i)?void 0:t.paragraphFormat):!this.listFormat.hasValue("listId")||-1!==this.listFormat.listId||"leftIndent"!==e&&"firstLineIndent"!==e?void 0:(i=new wri,this.hasValue("leftIndent")||(i.leftIndent=0),this.hasValue("firstLineIndent")||(i.firstLineIndent=0),i)},wri.prototype.getPropertyValue=function(e){if(this.hasValue(e)){s=mJt.getPropertyType(wri.uniqueFormatType,e);if(!je(this.uniqueParagraphFormat)&&this.uniqueParagraphFormat.propertiesHash.containsKey(s))return this.uniqueParagraphFormat.propertiesHash.get(s)}else{var t=this.getListFormatParagraphFormat(e);if(this.baseStyle instanceof _ri){for(var i=this,n=this.baseStyle;!je(n);){var o=void 0;if(this.listFormat.hasValue("listId")||(o=n.paragraphFormat.getListPargaraphFormat(e)),n.paragraphFormat.hasValue(e)){i=n.paragraphFormat;break}if(!je(o)&&o.hasValue(e)){if(n.paragraphFormat.listFormat.listLevelNumber!==this.listFormat.listLevelNumber){var r=this.listFormat.listLevel,s=mJt.getPropertyType(wri.uniqueFormatType,e);if(!je(r)&&!je(r.paragraphFormat.uniqueParagraphFormat)&&r.paragraphFormat.uniqueParagraphFormat.propertiesHash.containsKey(s)){i=r.paragraphFormat;break}}i=o;break}n=n.basedOn}if(!je(n))return!je(t)&&this.listFormat.hasValue("listId")&&-1===i.listFormat.listId&&i.listFormat.listLevelNumber<=1||!je(t)&&this.listFormat.listId!==i.listFormat.listId&&i.listFormat.listLevelNumber<=1?t:(s=mJt.getPropertyType(wri.uniqueFormatType,e),i.uniqueParagraphFormat.propertiesHash.get(s))}if(!je(t))return t}return this.getDefaultValue(e)},wri.prototype.getDefaultValue=function(e){var t=mJt.getPropertyType(wri.uniqueFormatType,e),i=this.getDocumentParagraphFormat(),n=!0,o=(this.ownerBase&&this.ownerBase instanceof Lai&&(n=this.ownerBase.containerWidget instanceof bai||this.ownerBase.containerWidget instanceof Zli||this.ownerBase.containerWidget instanceof Uai),!je(this.ownerBase)&&!je(this.ownerBase.bodyWidget)&&this.ownerBase.bodyWidget.page&&!je(this.ownerBase.bodyWidget.page.documentHelper)&&this.ownerBase.bodyWidget.page.documentHelper.owner.editorModule&&this.ownerBase.bodyWidget.page.documentHelper.owner.editorModule.isPaste);if(n&&!o&&!je(i)&&!je(i.uniqueParagraphFormat)){n=i.uniqueParagraphFormat.propertiesHash.get(t);if(!je(n))return n}return wri.getPropertyDefaultValue(e)},wri.prototype.getDocumentParagraphFormat=function(){var e,t;return e=je(this.ownerBase)||je(t=this.getDocumentHelperObject())?e:t.paragraphFormat},wri.prototype.getDocumentHelperObject=function(){var e,t;return this.ownerBase instanceof Lai&&(je(t=this.ownerBase.bodyWidget)||je(t.page)||je(t.page.documentHelper)||(e=t.page.documentHelper)),e},wri.prototype.setPropertyValue=function(e,t,i){(je(t)||""===t&&!i)&&(t=wri.getPropertyDefaultValue(e)),je(this.uniqueParagraphFormat)||je(this.uniqueParagraphFormat.propertiesHash)&&je(this.uniqueParagraphFormat.uniqueFormatType)&&je(this.uniqueParagraphFormat.referenceCount)?this.initializeUniqueParagraphFormat(e,t):(i=mJt.getPropertyType(this.uniqueParagraphFormat.uniqueFormatType,e),this.uniqueParagraphFormat.propertiesHash.containsKey(i)&&this.uniqueParagraphFormat.propertiesHash.get(i)===t||(this.uniqueParagraphFormat=wri.uniqueParagraphFormats.updateUniqueFormat(this.uniqueParagraphFormat,e,t)))},wri.prototype.initializeUniqueParagraphFormat=function(e,t){var i=new uJt;this.addUniqueParaFormat("leftIndent",e,t,i),this.addUniqueParaFormat("rightIndent",e,t,i),this.addUniqueParaFormat("firstLineIndent",e,t,i),this.addUniqueParaFormat("textAlignment",e,t,i),this.addUniqueParaFormat("beforeSpacing",e,t,i),this.addUniqueParaFormat("afterSpacing",e,t,i),this.addUniqueParaFormat("spaceBeforeAuto",e,t,i),this.addUniqueParaFormat("spaceAfterAuto",e,t,i),this.addUniqueParaFormat("lineSpacing",e,t,i),this.addUniqueParaFormat("lineSpacingType",e,t,i),this.addUniqueParaFormat("outlineLevel",e,t,i),this.addUniqueParaFormat("bidi",e,t,i),this.addUniqueParaFormat("contextualSpacing",e,t,i),this.addUniqueParaFormat("keepWithNext",e,t,i),this.addUniqueParaFormat("keepLinesTogether",e,t,i),this.addUniqueParaFormat("widowControl",e,t,i),this.uniqueParagraphFormat=wri.uniqueParagraphFormats.addUniqueFormat(i,wri.uniqueFormatType)},wri.prototype.addUniqueParaFormat=function(e,t,i,n){var o=mJt.getPropertyType(wri.uniqueFormatType,e);e===t&&n.add(o,i)},wri.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"spaceBeforeAuto":case"spaceAfterAuto":t=!1;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":case"keepWithNext":case"keepLinesTogether":t=!1;break;case"widowControl":t=!0}return t},wri.prototype.clearIndent=function(){this.clearPropertyValue("leftIndent"),this.clearPropertyValue("firstLineIndent")},wri.prototype.clearPropertyValue=function(e){this.setPropertyValue(e,void 0,!0),je(this.uniqueParagraphFormat)||(e=mJt.getPropertyType(this.uniqueParagraphFormat.uniqueFormatType,e),this.uniqueParagraphFormat.propertiesHash.containsKey(e)&&this.uniqueParagraphFormat.propertiesHash.remove(e))},wri.prototype.clearFormat=function(){je(this.listFormat)||this.listFormat.clearFormat(),je(this.borders)||this.borders.clearFormat(),je(this.uniqueParagraphFormat)||0!==this.uniqueParagraphFormat.referenceCount||wri.uniqueParagraphFormats.remove(this.uniqueParagraphFormat),this.uniqueParagraphFormat=void 0,je(this.getDocumentHelperObject())||(this.baseStyle=this.getDocumentHelperObject().styles.findByName("Normal"))},wri.prototype.destroy=function(){if(je(this.uniqueParagraphFormat)||wri.uniqueParagraphFormats.remove(this.uniqueParagraphFormat),this.uniqueParagraphFormat=void 0,je(this.listFormat)||this.listFormat.destroy(),this.listFormat=void 0,this.tabs&&0<this.tabs.length){for(var e=0;e<this.tabs.length;e++)this.tabs[e].destroy();this.tabs=[],this.tabs=void 0}je(this.borders)||this.borders.destroy(),this.borders=void 0,this.baseStyle=void 0,this.ownerBase=void 0},wri.prototype.copyFormat=function(e){if(!je(e)&&(je(e.uniqueParagraphFormat)||this.updateUniqueParagraphFormat(e),je(e.borders)||(je(this.borders)&&(this.borders=new uri(this)),this.borders.copyFormat(e.borders)),je(e.listFormat)||(je(this.listFormat)&&(this.listFormat=new mri(this)),this.listFormat.copyFormat(e.listFormat)),je(e.baseStyle)||(this.baseStyle=e.baseStyle),!je(e.tabs)))for(var t=0;t<e.tabs.length;t++)this.tabs[t]=e.tabs[t]},wri.prototype.updateUniqueParagraphFormat=function(e){var t=void 0;this.uniqueParagraphFormat&&(t=this.uniqueParagraphFormat.mergeProperties(e.uniqueParagraphFormat),0===this.uniqueParagraphFormat.referenceCount)&&(wri.uniqueParagraphFormats.remove(this.uniqueParagraphFormat),this.uniqueParagraphFormat=void 0),this.uniqueParagraphFormat=new mJt(wri.uniqueFormatType),je(t)&&(t=this.uniqueParagraphFormat.mergeProperties(e.uniqueParagraphFormat)),this.uniqueParagraphFormat=wri.uniqueParagraphFormats.addUniqueFormat(t,wri.uniqueFormatType)},wri.prototype.cloneFormat=function(){var e=new wri(void 0);return e.uniqueParagraphFormat=this.uniqueParagraphFormat,e.baseStyle=this.baseStyle,je(this.listFormat)?e.listFormat=void 0:(e.listFormat=this.listFormat.cloneListFormat(),e.listFormat.ownerBase=e),e.borders=je(this.borders)?void 0:this.borders.cloneFormat(),e},wri.prototype.hasValue=function(e){return!je(this.uniqueParagraphFormat)&&!je(this.uniqueParagraphFormat.propertiesHash)&&(e=mJt.getPropertyType(this.uniqueParagraphFormat.uniqueFormatType,e),this.uniqueParagraphFormat.propertiesHash.containsKey(e))},wri.clear=function(){this.uniqueParagraphFormats.clear()},wri.prototype.applyStyle=function(e){this.baseStyle=e,this.listFormat.applyStyle(this.baseStyle)},wri.prototype.getValue=function(e){return this.hasValue(e)?this.getPropertyValue(e):void 0},wri.prototype.assignFormat=function(e,t){t=!je(t)&&t,e.hasValue("leftIndent")&&(this.leftIndent=e.getValue("leftIndent")),e.hasValue("rightIndent")&&(this.rightIndent=e.getValue("rightIndent")),e.hasValue("firstLineIndent")&&(this.firstLineIndent=e.getValue("firstLineIndent")),e.hasValue("beforeSpacing")&&(this.beforeSpacing=e.getValue("beforeSpacing")),e.hasValue("afterSpacing")&&(this.afterSpacing=e.getValue("afterSpacing")),e.hasValue("spaceBeforeAuto")&&(this.spaceBeforeAuto=e.getValue("spaceBeforeAuto")),e.hasValue("spaceAfterAuto")&&(this.spaceAfterAuto=e.getValue("spaceAfterAuto")),e.hasValue("lineSpacing")&&(this.lineSpacing=e.getValue("lineSpacing")),e.hasValue("lineSpacingType")&&(this.lineSpacingType=e.getValue("lineSpacingType")),e.hasValue("textAlignment")&&(this.textAlignment=e.getValue("textAlignment")),e.hasValue("outlineLevel")&&(this.outlineLevel=e.getValue("outlineLevel")),!t&&e.hasValue("bidi")&&(this.bidi=e.getValue("bidi")),e.hasValue("contextualSpacing")&&(this.contextualSpacing=e.getValue("contextualSpacing")),e.hasValue("keepWithNext")&&(this.keepWithNext=e.getValue("keepWithNext")),e.hasValue("keepLinesTogether")&&(this.keepLinesTogether=e.getValue("keepLinesTogether")),e.hasValue("widowControl")&&(this.widowControl=e.getValue("widowControl"))},wri.uniqueParagraphFormats=new Det,wri.uniqueFormatType=3;var bri=wri;function wri(e){this.uniqueParagraphFormat=void 0,this.ownerBase=void 0,this.baseStyle=void 0,this.tabs=void 0,this.ownerBase=e,this.listFormat=new mri(this),this.borders=new uri(this),this.tabs=[]}Object.defineProperty(Sri.prototype,"gridBefore",{get:function(){return this.getPropertyValue("gridBefore")},set:function(e){this.setPropertyValue("gridBefore",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Sri.prototype,"gridBeforeWidth",{get:function(){return this.getPropertyValue("gridBeforeWidth")},set:function(e){this.setPropertyValue("gridBeforeWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Sri.prototype,"gridBeforeWidthType",{get:function(){return this.getPropertyValue("gridBeforeWidthType")},set:function(e){this.setPropertyValue("gridBeforeWidthType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Sri.prototype,"gridAfter",{get:function(){return this.getPropertyValue("gridAfter")},set:function(e){this.setPropertyValue("gridAfter",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Sri.prototype,"gridAfterWidth",{get:function(){return this.getPropertyValue("gridAfterWidth")},set:function(e){this.setPropertyValue("gridAfterWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Sri.prototype,"gridAfterWidthType",{get:function(){return this.getPropertyValue("gridAfterWidthType")},set:function(e){this.setPropertyValue("gridAfterWidthType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Sri.prototype,"allowBreakAcrossPages",{get:function(){return this.getPropertyValue("allowBreakAcrossPages")},set:function(e){this.setPropertyValue("allowBreakAcrossPages",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Sri.prototype,"isHeader",{get:function(){return this.getPropertyValue("isHeader")},set:function(e){this.setPropertyValue("isHeader",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Sri.prototype,"rightMargin",{get:function(){return this.getPropertyValue("rightMargin")},set:function(e){this.setPropertyValue("rightMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Sri.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(Sri.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(Sri.prototype,"bottomMargin",{get:function(){return this.getPropertyValue("bottomMargin")},set:function(e){this.setPropertyValue("bottomMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Sri.prototype,"leftIndent",{get:function(){return this.getPropertyValue("leftIndent")},set:function(e){this.setPropertyValue("leftIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Sri.prototype,"topMargin",{get:function(){return this.getPropertyValue("topMargin")},set:function(e){this.setPropertyValue("topMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Sri.prototype,"leftMargin",{get:function(){return this.getPropertyValue("leftMargin")},set:function(e){this.setPropertyValue("leftMargin",e)},enumerable:!0,configurable:!0}),Sri.prototype.getPropertyValue=function(e){if(this.hasValue(e)){var t=mJt.getPropertyType(Sri.uniqueFormatType,e);if(!je(this.uniqueRowFormat)&&this.uniqueRowFormat.propertiesHash.containsKey(t))return this.uniqueRowFormat.propertiesHash.get(t)}return Sri.getPropertyDefaultValue(e)},Sri.prototype.setPropertyValue=function(e,t){var i;!je(t)&&""!==t||(t=Sri.getPropertyDefaultValue(e)),je(this.uniqueRowFormat)?this.initializeUniqueRowFormat(e,t):(i=mJt.getPropertyType(this.uniqueRowFormat.uniqueFormatType,e),this.uniqueRowFormat.propertiesHash.containsKey(i)&&this.uniqueRowFormat.propertiesHash.get(i)===t||(this.uniqueRowFormat=Sri.uniqueRowFormats.updateUniqueFormat(this.uniqueRowFormat,e,t)))},Sri.prototype.initializeUniqueRowFormat=function(e,t){var i=new uJt;this.addUniqueRowFormat("allowBreakAcrossPages",e,t,i),this.addUniqueRowFormat("isHeader",e,t,i),this.addUniqueRowFormat("height",e,t,i),this.addUniqueRowFormat("heightType",e,t,i),this.addUniqueRowFormat("gridBefore",e,t,i),this.addUniqueRowFormat("gridBeforeWidth",e,t,i),this.addUniqueRowFormat("gridBeforeWidthType",e,t,i),this.addUniqueRowFormat("gridAfter",e,t,i),this.addUniqueRowFormat("gridAfterWidth",e,t,i),this.addUniqueRowFormat("gridgridAfterWidth",e,t,i),this.addUniqueRowFormat("gridBeforeWidthType",e,t,i),this.addUniqueRowFormat("leftMargin",e,t,i),this.addUniqueRowFormat("rightMargin",e,t,i),this.addUniqueRowFormat("topMargin",e,t,i),this.addUniqueRowFormat("bottomMargin",e,t,i),this.addUniqueRowFormat("leftIndent",e,t,i),this.uniqueRowFormat=Sri.uniqueRowFormats.addUniqueFormat(i,Sri.uniqueFormatType)},Sri.prototype.addUniqueRowFormat=function(e,t,i,n){var o=mJt.getPropertyType(Sri.uniqueFormatType,e);e===t&&n.add(o,i)},Sri.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},Sri.prototype.containsMargins=function(){return!(je(this.leftMargin)&&je(this.rightMargin)&&je(this.bottomMargin)&&je(this.topMargin))},Sri.prototype.cloneFormat=function(){var e=new Sri;return e.allowBreakAcrossPages=this.allowBreakAcrossPages,e.heightType=this.heightType,e.height=this.height,e.isHeader=this.isHeader,e.gridBefore=this.gridBefore,e.gridBeforeWidth=this.gridBeforeWidth,e.gridBeforeWidthType=this.gridBeforeWidthType,e.gridAfter=this.gridAfter,e.gridAfterWidth=this.gridAfterWidth,e.gridAfterWidthType=this.gridAfterWidthType,e.leftMargin=this.leftMargin,e.rightMargin=this.rightMargin,e.topMargin=this.topMargin,e.bottomMargin=this.bottomMargin,e.leftIndent=this.leftIndent,0<this.revisions.length?e.removedIds=Ari.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice(),e},Sri.prototype.hasValue=function(e){return!je(this.uniqueRowFormat)&&(e=mJt.getPropertyType(this.uniqueRowFormat.uniqueFormatType,e),this.uniqueRowFormat.propertiesHash.containsKey(e))},Sri.prototype.copyFormat=function(e){je(e)||(je(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,this.revisions=e.revisions),je(e.borders)||(this.borders=new uri(this),this.borders.ownerBase=e,this.borders.copyFormat(e.borders)),0<e.revisions.length?this.removedIds=Ari.cloneRevisions(e.revisions):this.removedIds=e.removedIds.slice())},Sri.prototype.destroy=function(){je(this.borders)||this.borders.destroy(),je(this.uniqueRowFormat)||Sri.uniqueRowFormats.remove(this.uniqueRowFormat),this.beforeWidth=void 0,this.afterWidth=void 0,this.borders=void 0,this.uniqueRowFormat=void 0},Sri.clear=function(){this.uniqueRowFormats.clear()},Sri.uniqueRowFormats=new Det,Sri.uniqueFormatType=6;var Cri=Sri;function Sri(e){this.uniqueRowFormat=void 0,this.borders=new uri(this),this.ownerBase=void 0,this.beforeWidth=0,this.afterWidth=0,this.revisions=[],this.removedIds=[],this.ownerBase=e}xri.prototype.handleAcceptReject=function(e,t){this.owner.selectionModule.selectRevision(this);var i,n=this.owner.selectionModule,o=n.start,r=n.end,s=(n.start.isExistBefore(n.end)||(o=n.end,r=n.start),n.getParagraphInfo(o)),a=!je(e)&&("MoveFrom"===this.revisionType||"Deletion"===this.revisionType)&&e||("Insertion"===this.revisionType||"MoveTo"===this.revisionType)&&!e,l=(a&&(0<(l=this.owner.editorModule.getSelectedComments()).commentEndInfo.length||0<l.commentStartInfo.length?i=this.owner.editorModule.checkAndRemoveComments(!1,!0):a=!1),this.owner.editorModule.initHistory(e?"Accept Change":"Reject Change"),n.getHyperlinkField());if(e&&"Deletion"===this.revisionType&&!je(l)&&-1!==this.range.indexOf(l)&&-1!==this.range.indexOf(l.fieldEnd)&&this.range.indexOf(l.fieldSeparator)===this.range.indexOf(l.fieldEnd)-1&&(this.owner.editorHistoryModule.currentBaseHistoryInfo.isHyperlinkField=!0),this.owner.editorHistoryModule.currentBaseHistoryInfo.markerData.push(this.owner.editorModule.getMarkerData(void 0,void 0,this)),"Deletion"===this.revisionType&&(s=n.getParagraphInfo(this.owner.selectionModule.start)),n.editPosition=this.owner.selectionModule.getHierarchicalIndex(s.paragraph,s.offset.toString()),this.owner.editorModule.updateInsertPosition(),this.isContentRemoved=!1,this.canSkipTableItems=!1,this.skipUnLinkElement=!1,"Insertion"===this.revisionType||"Deletion"===this.revisionType||"MoveFrom"===this.revisionType||"MoveTo"===this.revisionType){this.owner.isShiftingEnabled=!0;for(var h,d=0;0<this.range.length&&(this.range[d]instanceof Xai||this.range[d]instanceof Eri||this.range[d]instanceof Cri);)this.range[d]instanceof Dli&&e&&"Deletion"===this.revisionType&&(h=this.range[d],this.owner.documentHelper.bookmarks.containsKey(h.name))&&this.owner.documentHelper.bookmarks.remove(h.name),this.unlinkRangeItem(this.range[d],this,e,o,r)?d++:d=0}if(this.isTableRevision=!1,this.isContentRemoved?(l=n.getTextPosBasedOnLogicalIndex(n.editPosition),this.owner.selectionModule.selectContent(l,!0),this.owner.editorModule.updateEndPosition()):(n.selectRange(o,r),this.owner.editorModule.updateHistoryPosition(r,!1)),this.owner.editorHistoryModule&&this.owner.editorHistoryModule.currentBaseHistoryInfo&&"BackSpace"!==this.owner.editorHistoryModule.currentBaseHistoryInfo.action&&this.owner.editorHistoryModule.currentBaseHistoryInfo.removedNodes.reverse(),this.owner.editorHistoryModule){this.owner.trackChangesPane.isTrackingPageBreak&&(this.owner.editorHistoryModule.currentBaseHistoryInfo.action="TrackingPageBreak",this.owner.trackChangesPane.isTrackingPageBreak=!1);l=this.owner.editorHistoryModule;if(!l.currentHistoryInfo||"Accept All"!==l.currentHistoryInfo.action&&"Reject All"!==l.currentHistoryInfo.action||this.owner.documentHelper.blockToShift&&this.owner.documentHelper.layout.shiftLayoutedItems(!1),l.updateHistory(),a&&this.owner.editorHistory&&!je(this.owner.editorHistory.currentHistoryInfo)){for(var p=0;p<i.length;p++)this.owner.editorModule.initInsertInline(i[p],!1);this.owner.editorHistory.currentHistoryInfo.endPosition=this.owner.selection.startOffset,this.owner.editorHistory.updateComplexHistory()}}t&&this.owner.selectionModule.start.paragraph.isInsideTable&&(n=this.owner.selectionModule.start.paragraph.containerWidget.ownerTable,this.owner.documentHelper.layout.reLayoutTable(n)),this.owner.editorModule.reLayout(this.owner.selectionModule),s.paragraph.isInHeaderFooter&&this.owner.editorModule.updateHeaderFooterWidget()},xri.prototype.handleGroupAcceptReject=function(e){if(this.owner.trackChangesPane.tableRevisions.containsKey(this)){this.owner.editorModule.initComplexHistory(e?"Accept All":"Reject All");for(var t,i=this.owner.trackChangesPane.tableRevisions.get(this),n=i.length-1;0<=n;n--)e?i[n].handleAcceptReject(!0):i[n].handleAcceptReject(!1);this.owner.editorHistoryModule&&this.owner.editorHistoryModule.updateComplexHistory(),this.owner.selectionModule.start.paragraph.isInsideTable&&(t=this.owner.selectionModule.start.paragraph.containerWidget.ownerTable,this.owner.documentHelper.layout.reLayoutTable(t))}},xri.prototype.accept=function(){var e={author:this.author,cancel:!1,revisionType:this.revisionType,actionType:"Accept",source:this};this.owner.trigger(HJt,e),e.cancel||this.owner.documentHelper.isTrackedOnlyMode||(!this.owner.revisions.skipGroupAcceptReject&&this.range[0]instanceof Cri&&this.owner.trackChangesPane.tableRevisions.containsKey(this)?this.handleGroupAcceptReject(!0):this.handleAcceptReject(!0,!0))},xri.prototype.reject=function(){var e={author:this.author,cancel:!1,revisionType:this.revisionType,actionType:"Reject",source:this};this.owner.trigger(HJt,e),e.cancel||this.owner.documentHelper.isTrackedOnlyMode||(!this.owner.revisions.skipGroupAcceptReject&&this.range[0]instanceof Cri&&this.owner.trackChangesPane.tableRevisions.containsKey(this)?this.handleGroupAcceptReject(!1):this.handleAcceptReject(!1,!0))},xri.prototype.select=function(){this.owner.selectionModule.selectRevision(this)},xri.prototype.unlinkRangeItem=function(e,t,i,n,o){if(this.isTableRevision)this.removeRangeRevisionForItem(e),0===t.range.length&&this.owner.revisions.remove(t);else{var r,s,a=!je(i)&&("MoveFrom"===t.revisionType||"Deletion"===t.revisionType)&&i||("Insertion"===t.revisionType||"MoveTo"===t.revisionType)&&!i;if(this.owner.selectionModule.isTOC())if(a)this.owner.editorModule.deleteSelectedContents(this.owner.selectionModule,!0),0===t.range.length&&this.owner.revisions.remove(t),this.isContentRemoved=!0,this.owner.editorHistoryModule.currentBaseHistoryInfo.action="BackSpace";else{for(;0<this.range.length;){var l=this.range[0];this.removeRangeRevisionForItem(l),0===t.range.length&&this.owner.revisions.remove(t)}this.owner.editorModule.addRemovedNodes(this.revisionID),this.owner.editorHistoryModule.currentBaseHistoryInfo.action="AcceptTOC"}else{if(e instanceof Xai&&!this.canSkipTableItems)if(a){if(this.skipeElementRemoval(e))return this.skipUnLinkElement=!0;this.owner.editorModule.addRemovedNodes(e.clone())}else{var h=this.owner.selectionModule.getHyperlinkField();i||je(h)||h!=e||je(h.fieldEnd)?(this.owner.editorHistoryModule.currentBaseHistoryInfo.action="ClearRevisions",this.updateRevisionID(),this.removeRevisionFromPara(n,o)):(this.owner.editorModule.initComplexHistory("ClearRevisions"),this.owner.editorHistoryModule.currentBaseHistoryInfo.action="ClearRevisions",this.updateRevisionID(),this.removeRevisionFromPara(n,o),je(this.owner.editorHistoryModule)||(this.owner.editorHistoryModule.currentBaseHistoryInfo.isHyperlinkField=!0,h=this.owner.selectionModule.getParagraphInfo(o),h=this.owner.selectionModule.getHierarchicalIndex(h.paragraph,h.offset.toString()),this.owner.editorHistoryModule.currentBaseHistoryInfo.endPosition=h,this.owner.editorHistoryModule.currentBaseHistoryInfo.selectionEnd=h,this.owner.editorHistoryModule.updateHistory()),this.owner.enableTrackChanges?(this.owner.enableTrackChanges=!1,this.owner.editorModule.updateHyperlinkFormat(this.owner.selectionModule),this.owner.enableTrackChanges=!0):this.owner.editorModule.updateHyperlinkFormat(this.owner.selectionModule),this.owner.editorHistoryModule&&!je(this.owner.editorHistoryModule.currentHistoryInfo)&&this.owner.editorHistoryModule.updateComplexHistory()),this.owner.trackChangesPane.isTrackingPageBreak=!1}else!this.canSkipTableItems&&e instanceof Eri&&!a?(this.owner.editorHistoryModule.currentBaseHistoryInfo.action="ClearRevisions",this.updateRevisionID(),this.removeRevisionFromPara(n,o)):e instanceof Cri&&!a&&(this.isTableRevision=!0,r=e.ownerBase.ownerTable,s=e.ownerBase,this.owner.editorHistoryModule.currentBaseHistoryInfo.action="RemoveRowTrack",this.owner.editorModule.cloneTableToHistoryInfo(r.combineWidget(this.owner.viewer)));if(a=a&&!this.canSkipTableItems,e instanceof Xai&&a){var h=e.line.paragraph;this.removeRevisionItemsFromRange(e),e instanceof fli?"Footnote"===e.footnoteType?this.owner.editorModule.removeFootnote(e):this.owner.editorModule.removeEndnote(e):e instanceof Xli&&this.owner.editorModule.removeDeletedShapeRevision(e),this.removeItem(e),this.isContentRemoved=!0,!je(h)&&!je(h.bodyWidget)&&h.bodyWidget instanceof Iai&&(je(h.bodyWidget.page)||!je(h.bodyWidget.page)&&-1===h.bodyWidget.page.index)||this.owner.documentHelper.layout.reLayoutParagraph(h,0,0),je(h.childWidgets)&&(h=this.owner.selectionModule.getTextPosBasedOnLogicalIndex(this.owner.selectionModule.editPosition),this.owner.selectionModule.selectContent(h,!0))}else if(e instanceof Eri&&a){if(this.isContentRemoved=!0,this.skipUnLinkElement=!1,this.removeRevisionItemsFromRange(e),1===t.range.length)this.owner.editorModule.deleteSelectedContents(this.owner.selectionModule,!0);else{this.owner.editorModule.deleteSelectedContents(this.owner.selectionModule,!0),this.removeRevisionFromPara(n,o);h=t.range.indexOf(e);for(t.range.splice(h,1),this.owner.trackChangesPane.updateCurrentTrackChanges(t);0<this.range.length;)this.removeRangeRevisionForItem(this.range[0])}this.owner.editorHistoryModule.currentBaseHistoryInfo.action="BackSpace",this.owner.editorHistoryModule.currentBaseHistoryInfo.isAcceptOrReject=i?"Accept":"Reject"}else e instanceof Cri&&a&&(r=(r=e.ownerBase.ownerTable).combineWidget(this.owner.viewer),s=e.ownerBase,this.removeRevisionItemsFromRange(e),this.owner.editorHistoryModule.currentBaseHistoryInfo.action="DeleteCells",this.owner.editorModule.cloneTableToHistoryInfo(r),this.owner.editorModule.removeDeletedCellRevision(s),this.isContentRemoved=!0,r.removeChild(r.childWidgets.indexOf(s)),this.canSkipTableItems=!0,this.owner.editorModule.removeFieldInBlock(s),this.owner.editorModule.removeFieldInBlock(s,!0),this.owner.editorModule.removeFieldInBlock(s,void 0,!0),0===r.childWidgets.length?(this.owner.selectionModule.editPosition=this.owner.selectionModule.getHierarchicalIndex(r,"0"),this.owner.editorModule.removeBlock(r)):this.owner.editorModule.updateTable(r,!0));e instanceof Cri&&a||this.skipUnLinkElement||(this.removeRangeRevisionForItem(e),a&&e instanceof Dli&&this.owner.editorModule.removedBookmarkElements.push(e),e instanceof Dli&&this.owner.documentHelper.bookmarks.containsKey(e.name)&&(this.owner.enableCollaborativeEditing&&!je(this.owner.editorHistory.currentBaseHistoryInfo)&&this.owner.editorHistory.currentBaseHistoryInfo.markerData.push({bookmarkName:e.name}),this.owner.documentHelper.bookmarks.remove(e.name))),0===t.range.length&&this.owner.revisions.remove(t)}}return!1},xri.prototype.removeRevisionFromPara=function(e,t){for(var e=this.owner.selectionModule.getParagraphInfo(e),i=this.owner.selectionModule.getParagraphInfo(t),n=e.paragraph;n instanceof Lai;){if(0<n.characterFormat.revisions.length)for(var o,r=0;r<n.characterFormat.revisions.length;r++)0===n.characterFormat.revisions[r].range.length&&(o=n.characterFormat.revisions.indexOf(n.characterFormat.revisions[r]),n.characterFormat.revisions.splice(o,1),r--);n=i.paragraph===n?void 0:n.nextWidget}},xri.prototype.updateRevisionID=function(){for(this.owner.editorModule.addRemovedNodes(this.revisionID);0<this.range.length;)this.removeRangeRevisionForItem(this.range[0],!0);this.owner.trackChangesPane.updateCurrentTrackChanges(this)},xri.prototype.removeRevisionItemsFromRange=function(e){if(0<e.revisions.length)for(var t=0;t<e.revisions.length;t++){var i,n=e.revisions[t];this.revisionID!==n.revisionID&&(i=n.range.indexOf(e),e.revisions[t].range.splice(i,1),this.owner.trackChangesPane.updateCurrentTrackChanges(e.revisions[t])),0===n.range.length&&this.owner.revisions.remove(n)}},xri.prototype.removeRangeRevisionForItem=function(e,t){var i=e.revisions.indexOf(this);0<=i&&(e.revisions.splice(i,1),i=this.range.indexOf(e),this.range.splice(i,1),t||this.owner.trackChangesPane.updateCurrentTrackChanges(this))},xri.prototype.skipeElementRemoval=function(e){var t=e.paragraph;if(0<t.characterFormat.revisions.length)for(var i=0;i<t.characterFormat.revisions.length;i++){var n=t.characterFormat.revisions[i];if(0<=n.range.indexOf(e)&&n.revisionID===this.revisionID)return!0}return!1},xri.prototype.removeRevisionFromRow=function(e){this.owner.editorModule.unlinkRangeFromRevision(e.rowFormat);for(var t=0;t<e.childWidgets.length;t++){var i=e.childWidgets[t];this.owner.editorModule.removeRevisionForCell(i,!1)}},xri.prototype.removeItem=function(e){var t=e.line.paragraph,i=(this.owner.editorModule.unLinkFieldCharacter(e),e.line.children.indexOf(e)),n=e.previousNode,i=(e.line.children.splice(i,1),je(n)||this.owner.editorModule.combineElementRevisionToPrevNxt(n),e.line.paragraph.floatingElements.indexOf(e)),n=(e.line.paragraph.floatingElements.splice(i,1),e.line.paragraph.bodyWidget.floatingElements.indexOf(e));-1<n&&e.line.paragraph.bodyWidget.floatingElements.splice(n,1),this.owner.editorModule.removeEmptyLine(t)},xri.prototype.canSkipCloning=function(){if(!je(this.owner)&&this.owner.editorHistoryModule&&this.owner.editorHistoryModule.currentBaseHistoryInfo&&"DeleteCells"===this.owner.editorHistoryModule.currentBaseHistoryInfo.action)return!0;return!1},xri.prototype.destroy=function(){this.author=void 0,this.revisionType=void 0,this.revisionID=void 0,this.date=void 0,this.range=[],this.range=void 0,this.owner=void 0},xri.prototype.clone=function(){var e;return this.canSkipCloning()?this:((e=new xri(void 0,this.author,this.date)).revisionID=this.revisionID,e.revisionType=this.revisionType,e)},xri.cloneRevisions=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i].revisionID);return t};var Ari=xri;function xri(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,je(this.author)&&(this.author="Unknown"),this.date=i,this.owner=e}Tri.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(Tri.prototype,"length",{get:function(){return this.changes.length},enumerable:!0,configurable:!0}),Tri.prototype.remove=function(e){var t,i,n;je(e)||this.changes.indexOf(e)<0||(this.changes.splice(this.changes.indexOf(e),1),-1!==this.owner.trackChangesPane.revisions.indexOf(e)&&(t=this.owner.trackChangesPane.revisions.indexOf(e),i=!(this.owner.trackChangesPane.tableRevisions.containsKey(e)&&this.owner.trackChangesPane.tableRevisions.get(e)[this.owner.trackChangesPane.tableRevisions.get(e).length-1]!==e),n=this.owner.trackChangesPane.changes.get(e),i&&this.owner.trackChangesPane.changesInfoDiv.removeChild(n.outerSingleDiv),this.owner.trackChangesPane.revisions.splice(t,1),this.owner.trackChangesPane.changes.remove(e),this.owner.trackChangesPane.renderedChanges.containsKey(e)&&this.owner.trackChangesPane.renderedChanges.remove(e),this.owner.trackChangesPane.tableRevisions.containsKey(e))&&this.owner.trackChangesPane.tableRevisions.remove(e))},Tri.prototype.acceptAll=function(){this.owner.isReadOnly||this.owner.documentHelper.isTrackedOnlyMode||this.handleRevisionCollection(!0)},Tri.prototype.rejectAll=function(){this.owner.isReadOnly||this.owner.documentHelper.isTrackedOnlyMode||this.handleRevisionCollection(!1)},Tri.prototype.handleRevisionCollection=function(e,t){this.skipGroupAcceptReject=!0;var i=this.owner.selectionModule,n=i.start,o=i.end,r=t||this.changes;if(!(r.length<=0)){for(i.start.isExistBefore(i.end)||(n=i.end,o=i.start),n=n.clone(),o=o.clone(),e?this.owner.editorModule.initComplexHistory("Accept All"):this.owner.editorModule.initComplexHistory("Reject All");0<r.length;)e?r[0].accept():r[0].reject(),t&&r.splice(0,1),this.owner.enableHeaderAndFooter&&this.owner.editorModule.updateHeaderFooterWidget();je(i.editPosition)||(n=i.getTextPosBasedOnLogicalIndex(i.editPosition),this.owner.selectionModule.selectContent(n,!0)),this.owner.editorHistoryModule&&(this.owner.editorHistoryModule.updateComplexHistory(),je(i.editPosition))&&this.owner.editorHistoryModule.undoStack.pop(),this.owner.editorModule.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.owner.editorModule.reLayout(this.owner.selectionModule,!1),this.owner.editorModule.isSkipOperationsBuild=!1,this.skipGroupAcceptReject=!1}},Tri.prototype.clear=function(){this.changes=[]},Tri.prototype.destroy=function(){if(this.changes){for(var e=0;e<this.changes.length;e++)this.changes[e].destroy();this.changes=[]}this.changes=void 0,this.owner=void 0};var Iri=Tri;function Tri(e){this.changes=[],this.skipGroupAcceptReject=!1,this.owner=e}Object.defineProperty(Dri.prototype,"bold",{get:function(){return this.getPropertyValue("bold")},set:function(e){this.setPropertyValue("bold",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"italic",{get:function(){return this.getPropertyValue("italic")},set:function(e){this.setPropertyValue("italic",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"fontSize",{get:function(){return this.getPropertyValue("fontSize")},set:function(e){this.setPropertyValue("fontSize",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"characterSpacing",{get:function(){return this.getPropertyValue("characterSpacing")},set:function(e){this.setPropertyValue("characterSpacing",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"scaling",{get:function(){return this.getPropertyValue("scaling")},set:function(e){this.setPropertyValue("scaling",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"fontFamily",{get:function(){return this.getPropertyValue("fontFamily")},set:function(e){this.setPropertyValue("fontFamily",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"underline",{get:function(){return this.getPropertyValue("underline")},set:function(e){this.setPropertyValue("underline",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"underlineColor",{get:function(){return this.getPropertyValue("underlineColor")},set:function(e){this.setPropertyValue("underlineColor",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"fontHintType",{get:function(){return this.getPropertyValue("fontHintType")},set:function(e){this.setPropertyValue("fontHintType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"strikethrough",{get:function(){return this.getPropertyValue("strikethrough")},set:function(e){this.setPropertyValue("strikethrough",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"baselineAlignment",{get:function(){return this.getPropertyValue("baselineAlignment")},set:function(e){this.setPropertyValue("baselineAlignment",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"highlightColor",{get:function(){return this.getPropertyValue("highlightColor")},set:function(e){this.setPropertyValue("highlightColor",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"fontColor",{get:function(){return this.getPropertyValue("fontColor")},set:function(e){this.setPropertyValue("fontColor",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"bidi",{get:function(){return this.getPropertyValue("bidi")},set:function(e){this.setPropertyValue("bidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"localeIdBidi",{get:function(){return this.getPropertyValue("localeIdBidi")},set:function(e){this.setPropertyValue("localeIdBidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"localeIdFarEast",{get:function(){return this.getPropertyValue("localeIdFarEast")},set:function(e){this.setPropertyValue("localeIdFarEast",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"localeIdAscii",{get:function(){return this.getPropertyValue("localeIdAscii")},set:function(e){this.setPropertyValue("localeIdAscii",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"bdo",{get:function(){return this.getPropertyValue("bdo")},set:function(e){this.setPropertyValue("bdo",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"boldBidi",{get:function(){return this.getPropertyValue("boldBidi")},set:function(e){this.setPropertyValue("boldBidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"italicBidi",{get:function(){return this.getPropertyValue("italicBidi")},set:function(e){this.setPropertyValue("italicBidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"fontSizeBidi",{get:function(){return this.getPropertyValue("fontSizeBidi")},set:function(e){this.setPropertyValue("fontSizeBidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"fontFamilyBidi",{get:function(){return this.getPropertyValue("fontFamilyBidi")},set:function(e){this.setPropertyValue("fontFamilyBidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"allCaps",{get:function(){return this.getPropertyValue("allCaps")},set:function(e){this.setPropertyValue("allCaps",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"Lowercase",{get:function(){return this.getPropertyValue("Lowercase")},set:function(e){this.setPropertyValue("Lowercase",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"Uppercase",{get:function(){return this.getPropertyValue("Uppercase")},set:function(e){this.setPropertyValue("Uppercase",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"SentenceCase",{get:function(){return this.getPropertyValue("SentenceCase")},set:function(e){this.setPropertyValue("SentenceCase",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"ToggleCase",{get:function(){return this.getPropertyValue("ToggleCase")},set:function(e){this.setPropertyValue("ToggleCase",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"CapitalizeEachWord",{get:function(){return this.getPropertyValue("CapitalizeEachWord")},set:function(e){this.setPropertyValue("CapitalizeEachWord",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"complexScript",{get:function(){return this.getPropertyValue("complexScript")},set:function(e){this.setPropertyValue("complexScript",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"hidden",{get:function(){return this.getPropertyValue("hidden")},set:function(e){this.setPropertyValue("hidden",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"fontFamilyFarEast",{get:function(){return this.getPropertyValue("fontFamilyFarEast")},set:function(e){this.setPropertyValue("fontFamilyFarEast",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"fontFamilyAscii",{get:function(){return this.getPropertyValue("fontFamilyAscii")},set:function(e){this.setPropertyValue("fontFamilyAscii",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Dri.prototype,"fontFamilyNonFarEast",{get:function(){return this.getPropertyValue("fontFamilyNonFarEast")},set:function(e){this.setPropertyValue("fontFamilyNonFarEast",e)},enumerable:!0,configurable:!0}),Dri.prototype.getPropertyValue=function(e){if(this.hasValue(e)){var t=mJt.getPropertyType(Dri.uniqueFormatType,e);if(!je(this.uniqueCharacterFormat)&&this.uniqueCharacterFormat.propertiesHash.containsKey(t))return this.uniqueCharacterFormat.propertiesHash.get(t)}else{t=this.checkCharacterStyle(e);if(!je(t))return t;if(!je(this.baseCharStyle)){var t=void 0,i=void 0;if(je(this.ownerBase)||(t=this.ownerBase.paragraph,i=this.ownerBase.line),!je(t)&&!je(i))for(var n=i.children.length,o=0;o<n;o++){var r=this.ownerBase.line.children[o];r instanceof pli&&(r=r.text).startsWith("HYPERLINK")&&-1!==r.indexOf("_Toc")&&(this.baseCharStyle=this.ownerBase.paragraph.paragraphFormat.baseStyle)}}t=this.checkBaseStyle(e);if(!je(t))return t}return this.getDefaultValue(e)},Dri.prototype.getDefaultValue=function(e){var t=mJt.getPropertyType(Dri.uniqueFormatType,e),i=this.documentCharacterFormat();return je(i)||je(i.uniqueCharacterFormat)||!i.uniqueCharacterFormat.propertiesHash.containsKey(t)?Dri.getPropertyDefaultValue(e):i.uniqueCharacterFormat.propertiesHash.get(t)},Dri.prototype.documentCharacterFormat=function(){if(!je(this.ownerBase)&&(this.ownerBase instanceof Xai?e=this.ownerBase.paragraph:this.ownerBase instanceof Lai&&(e=this.ownerBase),e)){var e=e.bodyWidget;if(e&&e.page&&e.page.documentHelper)return e.page.documentHelper.characterFormat}},Dri.prototype.checkBaseStyle=function(e){var t,i;for(je(this.ownerBase)||(je(this.ownerBase.paragraph)?this.ownerBase instanceof Lai&&!je(this.ownerBase.paragraphFormat)?t=this.ownerBase.paragraphFormat.baseStyle:je(this.ownerBase instanceof _ri)||(t=this.ownerBase.basedOn):t=this.ownerBase.paragraph.paragraphFormat.baseStyle);!je(t)&&!t.characterFormat.hasValue(e);){if(!je(t.link)&&je(t.basedOn)&&"Character"==t.link.type&&t.link.characterFormat.hasValue(e)&&"Normal"!=t.name){t=t.link;break}t=t.basedOn}if(!je(t))return i=mJt.getPropertyType(Dri.uniqueFormatType,e),t.characterFormat.uniqueCharacterFormat.propertiesHash.get(i)},Dri.prototype.checkCharacterStyle=function(e){var t,i=this.baseCharStyle;if(!je(i))for(;!je(i)&&"Default Paragraph Font"!==i.name;){if(i.characterFormat.hasValue(e))return"bold"===e&&!je(this.ownerBase)&&this.ownerBase instanceof pli&&!je(this.ownerBase.paragraph)&&!je(this.ownerBase.paragraph.paragraphFormat.baseStyle)&&this.ownerBase.paragraph.paragraphFormat.baseStyle instanceof _ri&&this.ownerBase.paragraph.paragraphFormat.baseStyle.characterFormat&&i.name!==this.ownerBase.paragraph.paragraphFormat.baseStyle.name&&i.characterFormat.hasValue(e)===this.ownerBase.paragraph.paragraphFormat.baseStyle.characterFormat.hasValue(e)?this.hasValue(e):(t=mJt.getPropertyType(Dri.uniqueFormatType,e),i.characterFormat.uniqueCharacterFormat.propertiesHash.get(t));i=i.basedOn}},Dri.prototype.setPropertyValue=function(e,t){var i;!je(t)&&""!==t||(t=Dri.getPropertyDefaultValue(e)),je(this.uniqueCharacterFormat)||je(this.uniqueCharacterFormat.propertiesHash)&&je(this.uniqueCharacterFormat.uniqueFormatType)&&je(this.uniqueCharacterFormat.referenceCount)?this.initializeUniqueCharacterFormat(e,t):(i=mJt.getPropertyType(this.uniqueCharacterFormat.uniqueFormatType,e),this.uniqueCharacterFormat.propertiesHash.containsKey(i)&&this.uniqueCharacterFormat.propertiesHash.get(i)===t||(this.uniqueCharacterFormat=Dri.uniqueCharacterFormats.updateUniqueFormat(this.uniqueCharacterFormat,e,t)))},Dri.prototype.initializeUniqueCharacterFormat=function(e,t){var i=new uJt;this.addUniqueCharacterFormat("fontColor",e,t,i),this.addUniqueCharacterFormat("fontFamily",e,t,i),this.addUniqueCharacterFormat("fontSize",e,t,i),this.addUniqueCharacterFormat("bold",e,t,i),this.addUniqueCharacterFormat("italic",e,t,i),this.addUniqueCharacterFormat("underline",e,t,i),this.addUniqueCharacterFormat("underlineColor",e,t,i),this.addUniqueCharacterFormat("fontHintType",e,t,i),this.addUniqueCharacterFormat("strikethrough",e,t,i),this.addUniqueCharacterFormat("baselineAlignment",e,t,i),this.addUniqueCharacterFormat("highlightColor",e,t,i),this.addUniqueCharacterFormat("styleName",e,t,i),this.addUniqueCharacterFormat("bidi",e,t,i),this.addUniqueCharacterFormat("bdo",e,t,i),this.addUniqueCharacterFormat("fontFamilyBidi",e,t,i),this.addUniqueCharacterFormat("fontSizeBidi",e,t,i),this.addUniqueCharacterFormat("boldBidi",e,t,i),this.addUniqueCharacterFormat("italicBidi",e,t,i),this.addUniqueCharacterFormat("allCaps",e,t,i),this.addUniqueCharacterFormat("Uppercase",e,t,i),this.addUniqueCharacterFormat("Lowercase",e,t,i),this.addUniqueCharacterFormat("SentenceCase",e,t,i),this.addUniqueCharacterFormat("ToggleCase",e,t,i),this.addUniqueCharacterFormat("CapitalizeEachWord",e,t,i),this.addUniqueCharacterFormat("localeIdAscii",e,t,i),this.addUniqueCharacterFormat("localeIdFarEast",e,t,i),this.addUniqueCharacterFormat("localeIdBidi",e,t,i),this.addUniqueCharacterFormat("fontFamilyFarEast",e,t,i),this.addUniqueCharacterFormat("fontFamilyAscii",e,t,i),this.addUniqueCharacterFormat("fontFamilyNonFarEast",e,t,i),this.addUniqueCharacterFormat("complexScript",e,t,i),this.addUniqueCharacterFormat("characterSpacing",e,t,i),this.addUniqueCharacterFormat("scaling",e,t,i),this.addUniqueCharacterFormat("hidden",e,t,i),this.uniqueCharacterFormat=Dri.uniqueCharacterFormats.addUniqueFormat(i,Dri.uniqueFormatType)},Dri.prototype.addUniqueCharacterFormat=function(e,t,i,n){var o=mJt.getPropertyType(Dri.uniqueFormatType,e);e===t&&n.add(o,i)},Dri.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"bold":case"italic":t=!1;break;case"fontSize":t=11;break;case"underline":t="None";break;case"underlineColor":t=void 0;break;case"fontHintType":t="Default";break;case"strikethrough":t="None";break;case"baselineAlignment":t="Normal";break;case"highlightColor":t="NoColor";break;case"fontColor":t="#00000000";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":case"Uppercase":case"Lowercase":case"CapitalizeEachWord":case"SentenceCase":case"ToggleCase":t=!1;break;case"localeIdAscii":case"localeIdFarEast":case"localeIdBidi":t=0;break;case"complexScript":case"hidden":t=!1;break;case"fontFamilyFarEast":case"fontFamilyAscii":case"fontFamilyNonFarEast":t=void 0;break;case"characterSpacing":t=0;break;case"scaling":t=100}return t},Dri.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&&this.Uppercase===e.Uppercase&&this.Lowercase===e.Lowercase&&this.ToggleCase===e.ToggleCase&&this.SentenceCase===e.SentenceCase&&this.CapitalizeEachWord===e.CapitalizeEachWord&&this.localeIdBidi===e.localeIdBidi&&this.localeIdAscii===e.localeIdAscii&&this.localeIdFarEast===e.localeIdFarEast&&this.complexScript===e.complexScript&&this.fontFamilyAscii===e.fontFamilyAscii&&this.fontFamilyBidi===e.fontFamilyBidi&&this.fontFamilyFarEast===e.fontFamilyFarEast&&this.characterSpacing===e.characterSpacing&&this.scaling===e.scaling&&this.fontFamilyNonFarEast===e.fontFamilyNonFarEast&&this.hidden===e.hidden},Dri.prototype.isSameFormat=function(e){return this.baseCharStyle===e.baseCharStyle&&this.uniqueCharacterFormat===e.uniqueCharacterFormat},Dri.prototype.cloneFormat=function(){var e=new Dri(void 0);return e.uniqueCharacterFormat=this.uniqueCharacterFormat,e.baseCharStyle=this.baseCharStyle,0<this.revisions.length?e.removedIds=Ari.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice(),e},Dri.prototype.hasValue=function(e){return!je(this.uniqueCharacterFormat)&&!je(this.uniqueCharacterFormat.propertiesHash)&&(e=mJt.getPropertyType(this.uniqueCharacterFormat.uniqueFormatType,e),this.uniqueCharacterFormat.propertiesHash.containsKey(e))},Dri.prototype.clearFormat=function(){je(this.uniqueCharacterFormat)||0!==this.uniqueCharacterFormat.referenceCount||Dri.uniqueCharacterFormats.remove(this.uniqueCharacterFormat),this.uniqueCharacterFormat=void 0,this.baseCharStyle=void 0},Dri.prototype.destroy=function(){je(this.uniqueCharacterFormat)||Dri.uniqueCharacterFormats.remove(this.uniqueCharacterFormat),this.uniqueCharacterFormat=void 0,this.baseCharStyle=void 0,this.ownerBase=void 0},Dri.prototype.copyFormat=function(e){je(e)||(!je(e.uniqueCharacterFormat)&&e.uniqueCharacterFormat.propertiesHash&&this.updateUniqueCharacterFormat(e),je(e.baseCharStyle)||(this.baseCharStyle=e.baseCharStyle),0<e.revisions.length?this.removedIds=Ari.cloneRevisions(e.revisions):this.removedIds=e.removedIds.slice())},Dri.prototype.isEqualTocFormat=function(e){return this.fontFamily===e.fontFamily&&this.bold===e.bold&&this.italic===e.italic&&this.strikethrough===e.strikethrough&&this.highlightColor===e.highlightColor&&this.fontFamilyAscii===e.fontFamilyAscii&&this.fontFamilyFarEast===e.fontFamilyFarEast&&this.fontFamilyNonFarEast===e.fontFamilyNonFarEast},Dri.prototype.copyTocFormat=function(e){je(e.bold)||(this.bold=e.bold),je(e.italic)||(this.italic=e.italic),je(e.strikethrough)||(this.strikethrough=e.strikethrough),je(e.highlightColor)||(this.highlightColor=e.highlightColor),je(e.fontFamily)||(this.fontFamily=e.fontFamily,this.fontFamilyAscii=e.fontFamily,this.fontFamilyFarEast=e.fontFamily,this.fontFamilyNonFarEast=e.fontFamily)},Dri.prototype.updateUniqueCharacterFormat=function(e){var t=void 0;this.uniqueCharacterFormat&&(t=this.uniqueCharacterFormat.mergeProperties(e.uniqueCharacterFormat),0===this.uniqueCharacterFormat.referenceCount)&&(Dri.uniqueCharacterFormats.remove(this.uniqueCharacterFormat),this.uniqueCharacterFormat=void 0),this.uniqueCharacterFormat=new mJt(Dri.uniqueFormatType),je(t)&&(t=this.uniqueCharacterFormat.mergeProperties(e.uniqueCharacterFormat)),this.uniqueCharacterFormat=Dri.uniqueCharacterFormats.addUniqueFormat(t,Dri.uniqueFormatType)},Dri.clear=function(){this.uniqueCharacterFormats.clear()},Dri.prototype.applyStyle=function(e){this.baseCharStyle=e},Dri.prototype.getValue=function(e){return this.hasValue(e)?this.getPropertyValue(e):void 0},Dri.prototype.mergeFormat=function(e){je(this.getValue("bold"))&&(this.bold=e.getValue("bold")),je(this.getValue("italic"))&&(this.italic=e.getValue("italic")),je(this.getValue("fontSize"))&&(this.fontSize=e.getValue("fontSize")),je(this.getValue("boldBidi"))&&(this.boldBidi=e.getValue("boldBidi")),je(this.getValue("italicBidi"))&&(this.italicBidi=e.getValue("italicBidi")),je(this.getValue("fontSizeBidi"))&&(this.fontSizeBidi=e.getValue("fontSizeBidi")),je(this.getValue("characterSpacing"))&&(this.characterSpacing=e.getValue("characterSpacing")),je(this.getValue("scaling"))&&(this.scaling=e.getValue("scaling")),je(this.getValue("fontFamily"))?this.fontFamily=e.getValue("fontFamily"):(je(this.getValue("fontFamilyAscii"))&&(this.fontFamilyAscii=e.getValue("fontFamily")),je(this.getValue("fontFamilyFarEast"))&&(this.fontFamilyFarEast=e.getValue("fontFamily")),je(this.getValue("fontFamilyNonFarEast"))&&(this.fontFamilyNonFarEast=e.getValue("fontFamily"))),je(this.getValue("underline"))&&(this.underline=e.getValue("underline")),je(this.getValue("fontHintType"))&&(this.fontHintType=e.getValue("fontHintType")),je(this.getValue("strikethrough"))&&(this.strikethrough=e.getValue("strikethrough")),je(this.getValue("baselineAlignment"))&&(this.baselineAlignment=e.getValue("baselineAlignment")),je(this.getValue("highlightColor"))&&(this.highlightColor=e.getValue("highlightColor")),je(this.getValue("fontColor"))&&(this.fontColor=e.getValue("fontColor")),je(this.getValue("bidi"))&&(this.bidi=e.getValue("bidi")),je(this.getValue("bdo"))&&(this.bdo=e.getValue("bdo")),je(this.getValue("allCaps"))&&(this.allCaps=e.getValue("allCaps")),je(this.getValue("Lowercase"))&&(this.Lowercase=e.getValue("Lowercase")),je(this.getValue("SentenceCase"))&&(this.SentenceCase=e.getValue("SentenceCase")),je(this.getValue("ToggleCase"))&&(this.ToggleCase=e.getValue("ToggleCase")),je(this.getValue("CapitalizeEachWord"))&&(this.CapitalizeEachWord=e.getValue("CapitalizeEachWord")),je(this.getValue("Uppercase"))&&(this.Uppercase=e.getValue("Uppercase")),je(this.getValue("localeIdBidi"))&&(this.localeIdBidi=e.getValue("localeIdBidi")),je(this.getValue("localeIdAscii"))&&(this.localeIdAscii=e.getValue("localeIdAscii")),je(this.getValue("localeIdFarEast"))&&(this.localeIdFarEast=e.getValue("localeIdFarEast")),je(this.getValue("complexScript"))&&(this.complexScript=e.getValue("complexScript")),je(this.getValue("fontFamilyAscii"))&&(this.fontFamilyAscii=e.getValue("fontFamilyAscii")),je(this.getValue("fontFamilyBidi"))&&(this.fontFamilyBidi=e.getValue("fontFamilyBidi")),je(this.getValue("fontFamilyFarEast"))&&(this.fontFamilyFarEast=e.getValue("fontFamilyFarEast")),je(this.getValue("fontFamilyNonFarEast"))&&(this.fontFamilyNonFarEast=e.getValue("fontFamilyNonFarEast"))},Dri.prototype.assignFormat=function(e){e.hasValue("bold")&&(this.bold=e.getValue("bold")),e.hasValue("italic")&&(this.italic=e.getValue("italic")),e.hasValue("fontSize")&&(this.fontSize=e.getValue("fontSize")),e.hasValue("characterSpacing")&&(this.characterSpacing=e.getValue("characterSpacing")),e.hasValue("scaling")&&(this.scaling=e.getValue("scaling")),e.hasValue("fontFamily")&&(this.fontFamily=e.getValue("fontFamily"),this.fontFamilyFarEast=e.getValue("fontFamily"),this.fontFamilyAscii=e.getValue("fontFamily"),this.fontFamilyNonFarEast=e.getValue("fontFamily"),this.fontFamilyBidi=e.getValue("fontFamily")),e.hasValue("underline")&&(this.underline=e.getValue("underline")),e.hasValue("fontHintType")&&(this.fontHintType=e.getValue("fontHintType")),e.hasValue("strikethrough")&&(this.strikethrough=e.getValue("strikethrough")),e.hasValue("baselineAlignment")&&(this.baselineAlignment=e.getValue("baselineAlignment")),e.hasValue("highlightColor")&&(this.highlightColor=e.getValue("highlightColor")),e.hasValue("fontColor")&&(this.fontColor=e.getValue("fontColor")),e.hasValue("bidi")&&(this.bidi=e.getValue("bidi")),e.hasValue("bdo")&&(this.bdo=e.getValue("bdo")),e.hasValue("allCaps")&&(this.allCaps=e.getValue("allCaps")),e.hasValue("Lowercase")&&(this.Lowercase=e.getValue("Lowercase")),e.hasValue("SentenceCase")&&(this.SentenceCase=e.getValue("SentenceCase")),e.hasValue("ToggleCase")&&(this.ToggleCase=e.getValue("ToggleCase")),e.hasValue("CapitalizeEachWord")&&(this.CapitalizeEachWord=e.getValue("CapitalizeEachWord")),e.hasValue("Uppercase")&&(this.Uppercase=e.getValue("Uppercase")),e.hasValue("localeIdBidi")&&(this.localeIdBidi=e.getValue("localeIdBidi")),e.hasValue("localeIdAscii")&&(this.localeIdAscii=e.getValue("localeIdAscii")),e.hasValue("localeIdFarEast")&&(this.localeIdFarEast=e.getValue("localeIdFarEast")),e.hasValue("complexScript")&&(this.complexScript=e.getValue("complexScript"))},Dri.prototype.hasValueWithParent=function(e){var t=this.hasValue(e),i=(!t&&!je(this.baseCharStyle)&&this.baseCharStyle instanceof jri&&(t=this.baseCharStyle.characterFormat.hasValue(e)),this.documentCharacterFormat());return t=t||je(i)?t:i.hasValue(e)},Dri.uniqueCharacterFormats=new Det,Dri.uniqueFormatType=2;var Eri=Dri;function Dri(e){this.uniqueCharacterFormat=void 0,this.ownerBase=void 0,this.baseCharStyle=void 0,this.removedIds=[],this.revisions=[],this.ownerBase=e}Mri.insert=function(e,t,i){return 0<=t?[e.slice(0,t)+i+e.slice(t)].join(""):i+this},Mri.replaceSpecialChars=function(e){return e=(e=(e=e.replace("^[\\s]*","")).replace("^[#@!~\\$%^&\\*\\(\\)\\-_\\+\\.=\\{\\}\\[\\]:;,<>\\?'\\\\\"\\“\\”\\//0123456789]+","")).replace("[#@!~\\$%^&\\*\\(\\)\\-_\\+\\.=\\{\\}\\[\\]:;,<>\\?'\\\\\"\\“\\”\\//0123456789]+$","")},Mri.getSpellCheckData=function(e){for(var t=[],i=0,n=(e=(e=(e=(e=(e=(e=(e=e.replace("\r\n"," ")).replace("\n"," ")).replace("\r"," ")).replace("\v"," ")).replace("\t"," ")).replace("/"," ")).replace(String.fromCharCode(160)," ")).split(" ");i<n.length;i++){var o=n[i],r={};r.Text=this.replaceSpecialChars(o),r.HasSpellError=!1,t.push(r)}return t},Mri.checkTextFormat=function(e){return!(!/^(M{0,3})(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/i.test(e)&&!/^[0-9]+$/.test(e))},Mri.sanitizeString=function(e){return je(e)?"":go.sanitize(e).replace(/&amp;/g,"&").replace(/&nbsp;/g,String.fromCharCode(160)).replace(/&gt;/g,">").replace(/&lt;/g,"<")},Mri.getSfdtDocument=function(e){var t;return je((e=e instanceof Object?e:JSON.parse(e)).sfdt)||((t=new Zl).open(JSON.stringify(e.sfdt)),t=t.items[0],t=new Uint8Array(t.data),t=new TextDecoder("utf-8").decode(t),e=JSON.parse(t)),e},Mri.generateUniqueId=function(e,t){var i=!je(t),n=Math.floor(1e8*Math.random());return i?this.isSameListIDExists(n,void 0,t,i)?this.generateUniqueId(void 0,t):n:this.isSameListIDExists(n,e)?this.generateUniqueId(e):n},Mri.generateHexDecimal=function(){return(Math.floor(373e7*Math.random())+27e7).toString(16).toUpperCase()},Mri.numberToHexDecimal=function(e){return(e>>>0).toString(16).toUpperCase()},Mri.isSameListIDExists=function(e,t,i,n){if(n){for(var o=0;o<i.length;o++)if(e===i[parseInt(o.toString(),10)].nsid)return!0}else for(var r=0;r<t.length;r++)if(e===t[parseInt(r.toString(),10)].nsid)return!0;return!1},Mri.remove=function(e,t){return 0===t?e.substring(t+1,e.length):e.substring(0,t)+e.substring(t+1,e.length)},Mri.indexOfAny=function(e,t){for(var i=void 0,n=0;n<t.length;n++){var o=e.indexOf(t[parseInt(n.toString(),10)]);(-1!==o&&je(i)||-1!==o&&o<i)&&(i=o)}return je(i)?-1:i},Mri.lastIndexOfAny=function(e,t){for(var i=e.length-1;0<=i;i--)for(var n=0;n<=t.length-1;n++)if(e[parseInt(i.toString(),10)]===t[parseInt(n.toString(),10)])return i;return-1},Mri.convertArgbToRgb=function(e){return 8<=e.length?e.substr(0,6):e},Mri.convertRgbToHex=function(e){e=Number(e).toString(16);return e=e.length<2?"0"+e:e},Mri.getNumberFromString=function(e){for(var t=[],i="",n=0,o=e;n<o.length;n++){var r=o[n];/\d|\./.test(r)?i+=r:i&&(t.push(parseFloat(i)),i="")}return i&&t.push(parseFloat(i)),parseFloat(t.join(""))},Mri.convertHexToRgb=function(e){var t,i,n,o;if(e)return e=e.replace(/[^0-9A-â€Œâ€‹F]/gi,""),o=parseInt(e,16),8===e.length?(t=o>>32&255,i=o>>16&255,n=o>>8&255):6===e.length&&(t=o>>16&255,i=o>>8&255,n=255&o),{r:t,g:i,b:n}},Mri.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)},Mri.convertNodeListToArray=function(e){var t=[];if(!je(e))for(var i=0;i<e.length;i++)t.push(e[parseInt(i.toString(),10)]);return t},Mri.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},Mri.isVeryDark=function(e){e=e.substring(1);return(299*parseInt(e.substr(0,2),16)+587*parseInt(e.substr(2,2),16)+114*parseInt(e.substr(4,2),16))/1e3<=60},Mri.getColor=function(e){return 0<e.length&&"#"===e[0]&&7<e.length?e.substr(0,7):e},Mri.getTextVerticalAlignment=function(e){switch(e){case 0:return"Top";case 1:return"Middle";case 2:return"Bottom";default:return e}},Mri.convertPointToPixel=function(e){return e=Mri.round(e,5),Mri.round(96*e/72,5)},Mri.convertPixelToPoint=function(e){return Mri.round(72*e/96,5)},Mri.isLinkedFieldCharacter=function(e){return e instanceof Zai&&0===e.fieldType?!je(e.fieldEnd):e instanceof Zai&&2===e.fieldType?!je(e.fieldBegin)&&!je(e.fieldEnd):!je(e.fieldBegin)},Mri.removeSpace=function(e){if(!je(e)&&0!==e.length)for(var t=0;t<e.length;t++)" "===e.charAt(t)&&(e=e.replace(" ",""));return e},Mri.trimStart=function(e){for(var t=0;t<e.length&&" "===e[parseInt(t.toString(),10)];t++);return e.substring(t,e.length)},Mri.trimEnd=function(e){for(var t=e.length-1;0<=t&&" "===e[parseInt(t.toString(),10)];t--);return e.substring(0,t+1)},Mri.endsWith=function(e){return!je(e)&&0!==e.length&&" "===e[e.length-1]},Mri.addSpace=function(e){var t="";if(0<e)for(var i=0;i<e;i++)t+=" ";return t},Mri.getBoolValue=function(e){return e?1:0},Mri.getBoolInfo=function(e,t){return 1===t?this.getBoolValue(e):e},Mri.parseBoolValue=function(e){return e instanceof String?!je(e)&&"f"!==e&&"0"!==e&&"off"!==e&&"false"!==e:1==e},Mri.getBaselineAlignmentEnumValue=function(e){switch(e){case"Normal":return 0;case"Superscript":return 1;case"Subscript":return 2}},Mri.getFontHintTypeEnumValue=function(e){switch(e){case"Default":return 0;case"EastAsia":return 1;case"CS":return 2}},Mri.getUnderlineEnumValue=function(e){switch(e){case"None":return 0;case"Single":return 1;case"Words":return 2;case"Double":return 3;case"Dotted":return 4;case"Thick":return 5;case"Dash":return 6;case"DashLong":return 7;case"DotDash":return 8;case"DotDotDash":return 9;case"Wavy":return 10;case"DottedHeavy":return 11;case"DashHeavy":return 12;case"DashLongHeavy":return 13;case"DotDashHeavy":return 14;case"DotDotDashHeavy":return 15;case"WavyHeavy":return 16;case"WavyDouble":return 17}},Mri.getStrikeThroughEnumValue=function(e){switch(e){case"None":return 0;case"SingleStrike":return 1;case"DoubleStrike":return 2}},Mri.getHighlightColorEnumValue=function(e){switch(e){case"NoColor":return 0;case"Yellow":return 1;case"BrightGreen":return 2;case"Turquoise":return 3;case"Pink":return 4;case"Blue":return 5;case"Red":return 6;case"DarkBlue":return 7;case"Teal":return 8;case"Green":return 9;case"Violet":return 10;case"DarkRed":return 11;case"DarkYellow":return 12;case"Gray50":return 13;case"Gray25":return 14;case"Black":return 15}},Mri.getBiDirectionalOverride=function(e){switch(e){case"None":return 0;case"LTR":return 1;case"RTL":return 2}},Mri.getBreakClearType=function(e){switch(e){case"None":return 0;case"Left":return 1;case"Right":return 2;case"All":return 3}},Mri.getOutlineLevelEnumValue=function(e){switch(e){case"BodyText":return 0;case"Level1":return 1;case"Level2":return 2;case"Level3":return 3;case"Level4":return 4;case"Level5":return 5;case"Level6":return 6;case"Level7":return 7;case"Level8":return 8;case"Level9":return 9}},Mri.getTextAlignmentEnumValue=function(e){switch(e){case"Left":return 0;case"Center":return 1;case"Right":return 2;case"Justify":return 3}},Mri.getLineStyleEnumValue=function(e){switch(e){case"Single":return 0;case"None":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;case"Cleared":return 26}},Mri.getLineSpacingTypeEnumValue=function(e){switch(e){case"Multiple":return 0;case"AtLeast":return 1;case"Exactly":return 2}},Mri.writeBorder=function(e,t){var i={};return i[tii[t]]=e.hasValue("color")?e.color:void 0,i[Tei[t]]=e.hasValue("hasNoneStyle")?Mri.getBoolInfo(e.hasNoneStyle,t):void 0,i[Pei[t]]=e.hasValue("lineStyle")?1==t?this.getLineStyleEnumValue(e.lineStyle):e.lineStyle:void 0,i[Bei[t]]=e.hasValue("lineWidth")?e.lineWidth:void 0,i[Iei[t]]=e.hasValue("shadow")?Mri.getBoolInfo(e.shadow,t):void 0,i[Coi[t]]=e.hasValue("space")?e.space:void 0,i},Mri.writeBorders=function(e,t){var i={};return i[lii[t]]=this.writeBorder(e.getBorder("top"),t),i[pii[t]]=this.writeBorder(e.getBorder("left"),t),i[dii[t]]=this.writeBorder(e.getBorder("right"),t),i[hii[t]]=this.writeBorder(e.getBorder("bottom"),t),i[Dei[t]]=this.writeBorder(e.getBorder("horizontal"),t),i[Eei[t]]=this.writeBorder(e.getBorder("vertical"),t),i},Mri.writeParagraphFormat=function(e,t,i,n){n=je(n)?0:n,e[k$t[n]]=this.writeBorders(i.borders,n),e[g$t[n]]=t?i.leftIndent:i.getValue("leftIndent"),e[m$t[n]]=t?i.rightIndent:i.getValue("rightIndent"),e[f$t[n]]=t?i.firstLineIndent:i.getValue("firstLineIndent"),e[y$t[n]]=t?1==n?this.getTextAlignmentEnumValue(i.textAlignment):i.textAlignment:1==n?this.getTextAlignmentEnumValue(i.getValue("textAlignment")):i.getValue("textAlignment"),e[b$t[n]]=t?i.beforeSpacing:i.getValue("beforeSpacing"),e[v$t[n]]=t?i.afterSpacing:i.getValue("afterSpacing"),e[C$t[n]]=t?Mri.getBoolInfo(i.spaceBeforeAuto,n):i.getValue("spaceBeforeAuto"),e[w$t[n]]=t?Mri.getBoolInfo(i.spaceAfterAuto,n):i.getValue("spaceAfterAuto"),e[S$t[n]]=t?i.lineSpacing:i.getValue("lineSpacing"),e[A$t[n]]=t?1==n?this.getLineSpacingTypeEnumValue(i.lineSpacingType):i.lineSpacingType:1==n?this.getLineSpacingTypeEnumValue(i.getValue("lineSpacingType")):i.getValue("lineSpacingType"),e[KZt[n]]=je(i.baseStyle)?void 0:i.baseStyle.name,e[D$t[n]]=t?1==n?this.getOutlineLevelEnumValue(i.outlineLevel):i.outlineLevel:1==n?this.getOutlineLevelEnumValue(i.getValue("outlineLevel")):i.getValue("outlineLevel"),e[JZt[n]]=t?Mri.getBoolInfo(i.bidi,n):i.getValue("bidi"),e[E$t[n]]=t?Mri.getBoolInfo(i.keepLinesTogether,n):i.getValue("keepLinesTogether"),e[I$t[n]]=t?Mri.getBoolInfo(i.keepWithNext,n):i.getValue("keepWithNext"),e[M$t[n]]=t?Mri.getBoolInfo(i.contextualSpacing,n):i.getValue("contextualSpacing"),e[T$t[n]]=t?Mri.getBoolInfo(i.widowControl,n):i.getValue("widowControl")},Mri.writeCharacterFormat=function(e,t,i,n,o){n=je(n)?0:n,e[_Zt[n]]=o||t?Mri.getBoolInfo(i.bold,n):i.getValue("bold"),e[HZt[n]]=o||t?Mri.getBoolInfo(i.italic,n):i.getValue("italic"),e[GZt[n]]=o?i.fontSize:t?this.toWriteInline(i,"fontSize"):i.getValue("fontSize"),e[XZt[n]]=o?i.fontFamily:t?this.toWriteInline(i,"fontFamily"):i.getValue("fontFamily"),e[zZt[n]]=o?i.underline:t?1==n?Mri.getUnderlineEnumValue(i.underline):i.underline:1==n?Mri.getUnderlineEnumValue(i.getValue("underline")):i.getValue("underline"),e[jZt[n]]=o?i.underlineColor:t?this.toWriteInline(i,"underlineColor"):i.getValue("underlineColor"),e[WZt[n]]=o?i.fontHintType:t?1==n?Mri.getFontHintTypeEnumValue(i.fontHintType):i.fontHintType:1==n?Mri.getFontHintTypeEnumValue(i.getValue("fontHintType")):i.getValue("fontHintType"),e[UZt[n]]=o?i.strikethrough:t?1==n?Mri.getStrikeThroughEnumValue(i.strikethrough):i.strikethrough:1==n?Mri.getStrikeThroughEnumValue(i.getValue("strikethrough")):i.getValue("strikethrough"),e[QZt[n]]=o?i.baselineAlignment:t?1==n?Mri.getBaselineAlignmentEnumValue(i.baselineAlignment):i.baselineAlignment:1==n?Mri.getBaselineAlignmentEnumValue(i.getValue("baselineAlignment")):i.getValue("baselineAlignment"),e[qZt[n]]=o?i.highlightColor:t?1==n?Mri.getHighlightColorEnumValue(i.highlightColor):i.highlightColor:1==n?Mri.getHighlightColorEnumValue(i.getValue("highlightColor")):i.getValue("highlightColor"),e[YZt[n]]=o?i.fontColor:t?this.toWriteInline(i,"fontColor"):i.getValue("fontColor"),e[KZt[n]]=je(i.baseCharStyle)?void 0:i.baseCharStyle.name,e[JZt[n]]=o?i.bidi:t?Mri.getBoolInfo(i.bidi,n):i.getValue("bidi"),e[ZZt[n]]=o?i.bdo:t?1==n?Mri.getBiDirectionalOverride(i.bdo):i.bdo:1==n?Mri.getBiDirectionalOverride(i.getValue("bdo")):i.getValue("bdo"),e[i$t[n]]=o?i.boldBidi:t?Mri.getBoolInfo(i.boldBidi,n):i.getValue("boldBidi"),e[n$t[n]]=o?i.italicBidi:t?Mri.getBoolInfo(i.italicBidi,n):i.getValue("italicBidi"),e[e$t[n]]=o||t?i.fontSizeBidi:i.getValue("fontSizeBidi"),e[t$t[n]]=o||t?i.fontFamilyBidi:i.getValue("fontFamilyBidi"),e[o$t[n]]=o?i.allCaps:t?Mri.getBoolInfo(i.allCaps,n):i.getValue("allCaps"),e[VZt[n]]=o||t?i.localeIdBidi:i.getValue("localeIdBidi"),e[OZt[n]]=o?i.localeIdBidi:t?i.localeIdAscii:i.getValue("localeIdAscii"),e[NZt[n]]=o||t?i.localeIdFarEast:i.getValue("localeIdFarEast"),e[r$t[n]]=o?i.complexScript:t?Mri.getBoolInfo(i.complexScript,n):i.getValue("complexScript"),i.hasValue("hidden")&&(e[nri[n]]=o?i.hidden:t?Mri.getBoolInfo(i.hidden,n):i.getValue("hidden")),e[s$t[n]]=o?i.fontFamilyAscii:t?this.toWriteInline(i,"fontFamilyAscii"):i.getValue("fontFamilyAscii"),e[l$t[n]]=o?i.fontFamilyNonFarEast:t?this.toWriteInline(i,"fontFamilyNonFarEast"):i.getValue("fontFamilyNonFarEast"),e[a$t[n]]=o?i.fontFamilyFarEast:t?this.toWriteInline(i,"fontFamilyFarEast"):i.getValue("fontFamilyFarEast"),e[p$t[n]]=o?i.characterSpacing:t?this.toWriteInline(i,"characterSpacing"):i.getValue("characterSpacing"),e[c$t[n]]=o?i.scaling:t?this.toWriteInline(i,"scaling"):i.getValue("scaling"),(i.hasValue("fontFamily")||o)&&(je(e[s$t[n]])&&(e[s$t[n]]=i.fontFamily),je(e[l$t[n]]))&&(e[l$t[n]]=i.fontFamily)},Mri.isThemeFont=function(e){return"majorAscii"==e||"majorBidi"==e||"majorEastAsia"==e||"majorHAnsi"==e||"minorAscii"==e||"minorBidi"==e||"minorEastAsia"==e||"minorHAnsi"==e},Mri.toWriteInline=function(e,t){return je(e.ownerBase)||!(e.ownerBase instanceof Xai)||e.hasValue(t)?e[t]:e.getValue(t)},Mri.round=function(e,t){for(var i=e,n=0;n<t;n++)i*=10;for(i=Math.round(i),n=0;n<t;n++)i/=10;return i},Mri.removeInvalidXmlChars=function(e){return e.replace(/[^\x09\x0A\x0C\x0D\v\f\r\u000E\x20-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]/gu,"")},Mri.commentInlines=function(e,r,s){var a=this,t=[];return e.split(/<\/?div>/).filter(Boolean).map(function(e){return e.trim()}).filter(Boolean).map(function(e){return"<br>"===e?e:e.split(/<br\s*\/?>/)}).flat().forEach(function(e){var o={};o[qii[s]]=[],""!==e&&"<br>"!==e&&e.match(/(<[^>]+>[^<]*<\/[^>]+>|[^<]+)/g).forEach(function(e){var t,i,n={"&nbsp;":" ","&lt;":"<","&gt;":">","&amp;":"&"};0===(e=e.replace(/&nbsp;|&lt;|&gt;|&amp;/g,function(e){return n[e]})).indexOf("<span")?(i=(i=e.match(/<span[^>]*>([^<]*)<\/span>/))?i[1].trim():"",t=a.getEmailIdByName(i,r),o=a.serializeMentions(i,t,o,s)):((i={})[Bti[s]]=e,o[qii[s]].push(i))}),t.push(o)}),0==t.length&&((e={})[qii[s]]=[],e[qii[s]].push({}),t.push(e)),t},Mri.parseCommentAsText=function(e){var t=document.createElement("div"),i=(t.innerHTML=e.text,t.querySelectorAll("span.e-mention-chip")),e=JSON.stringify(e.mentions),n=JSON.parse(e),o=0;if(i.length!==n.length)throw new Error("The lengths of spanElements and inputData do not match");return i.forEach(function(e){var t,i;o in n&&((t=n[o])&&"string"==typeof t.value&&"string"==typeof t.text&&((i=document.createElement("a")).href="mailto:"+t.value,i.textContent="@"+t.text,e.replaceWith(i)),o++)}),t.innerHTML.replace(/<br>/g,"\r\n")},Mri.getEmailIdByName=function(e,t){for(var i=0,n=t;i<n.length;i++){var o=n[i];if(o.text===e)return je(o.value)?o.text+".com":o.value}return""},Mri.serializeMentions=function(e,t,i,n){var o={},o=(o[aZt[n]]={},o[fii[n]]=0,o[gii[n]]=!0,i[qii[n]].push(o),{}),t=(o[aZt[n]]={},o[Bti[n]]=' HYPERLINK "mailto:'+t+'" ',i[qii[n]].push(o),{}),o=(t[aZt[n]]={},t[fii[n]]=2,i[qii[n]].push(t),{}),t=(o[aZt[n]]={underline:"Single",fontColor:"#0563c1",bidi:!1},o[Bti[n]]=e,i[qii[n]].push(o),{});return t[aZt[n]]={},t[fii[n]]=1,i[qii[n]].push(t),i},Mri.reverseString=function(e){return e=je(e)||""===e?e:e.split("").reverse().join("")},Mri.formatClippedString=function(e){var t="",i="";return this.startsWith(e,"data:image/svg+xml;base64,")?(t=".svg",i=e.replace("data:image/svg+xml;base64,","")):this.startsWith(e,"data:image/svg+xml;utf8,")?(t=".svg",i=e.replace("data:image/svg+xml;utf8,","")):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}},Mri.startsWith=function(e,t){return 0<t.length&&e.substring(0,t.length)===t},Mri.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},Mri.formatNumber=function(e,t){var i=new Ti,n=(t=t.split(".")[0],i.parseNumber(t));return"NaN"===t.toString()?"":i.formatNumber(n,{format:e=""===e?"0":e})},Mri.formatDate=function(e,t){var i=new Ti,n=new Date(t);return isNaN(n.getDate())?"":""===e?t:(-1!==e.indexOf("am/pm")&&(e=e.replace(/am\/pm/gi,"a")),i.formatDate(n,{format:e}))},Mri.capitaliseFirst=function(e,t,i){var n="";if("Titlecase"===t){for(var o=i?e.split(i):e.split(" "),r=0;r<o.length;r++)n+=i?o[parseInt(r.toString(),10)].charAt(0).toUpperCase()+o[parseInt(r.toString(),10)].slice(1,o[parseInt(r.toString(),10)].length):this.capitaliseFirstInternal(o[parseInt(r.toString(),10)]),0<=o.length&&!i&&(n+=" ");i||(n=this.capitaliseFirst(n,"Titlecase","\r"))}else"FirstCapital"===t&&(n=this.capitaliseFirstInternal(e));return n},Mri.lowerFirstChar=function(e){return e.charAt(0).toLowerCase()+e.slice(1,e.length)},Mri.capitaliseFirstInternal=function(e){return e.charAt(0).toUpperCase()+e.slice(1,e.length).toLowerCase()},Mri.getModifiedDate=function(e){e=Mri.getLocaleDate(e);return e.toLocaleDateString([],{year:"numeric",month:"long",day:"numeric"})+" "+e.toLocaleTimeString([],{hour:"numeric",minute:"numeric"})},Mri.getUtcDate=function(e){return je(e)&&(e=new Date),new Date(e.getTime()-6e4*e.getTimezoneOffset()).toISOString()},Mri.getLocaleDate=function(e){e=new Date(e);return new Date(e.getTime()+6e4*e.getTimezoneOffset())},Mri.getCompatibilityModeValue=function(e){var t;switch(e){case 1:t="11";break;case 2:t="12";break;case 3:t="14";break;default:t="15"}return t},Mri.getUniqueElementId=function(){return"de_element"+Date.now().toString(36)+Math.random().toString(36).substring(2)},Mri.splitSpaceInTextElementBox=function(e,t){var i=e.text,n="";if(t)for(;Mri.startsWith(i," ");)n+=" ",i=i.substring(1);else for(;Mri.endsWith(i);)n+=" ",i=i.slice(0,-1);if(""!=n){var o=new pli;if(o.characterFormat.copyFormat(e.characterFormat),0<e.revisions.length){for(var r=0;r<e.revisions.length;r++){var s=e.revisions[r],a=(o.revisions.push(s),s.range.indexOf(e));a<0?s.range.push(o):s.range.splice(a+1,0,o)}o.isMarkedForRevision=e.isMarkedForRevision}o.line=e.line;var l=o.line.children;t?(e.text=n,o.text=i):(e.text=i,o.text=n),l.splice(l.indexOf(e)+1,0,o)}},Mri.getTextIndexAfterWhitespace=function(e,t){var i=e.length,n=e.indexOf(" ",t)+1;if(0!==n&&n!==i)for(;" "===e[n]&&++n!==i;);return n},Mri.splitWordByMaxLength=function(e,t,i){for(var n=e.text,o=0,r=n.length,s=e.characterFormat,a=e.revisions,l=t.children.indexOf(e);o<r;){var h=o+90,d=Mri.getTextIndexAfterWhitespace(n,h=r<h?r:h);if((0===d||r<d)&&(d=h),h=n.substring(o,d),0===o)e.text=h,e.isWidthUpdated=!1;else{var p=new pli;if(p.text=h,p.line=t,p.characterFormat.copyFormat(s),0<a.length)for(var c=0;c<a.length;c++){var u=a[c],g=(p.revisions.push(u),u.range.indexOf(e));i||g<0?u.range.push(p):u.range.splice(g+1,0,p)}i?t.children.push(p):(t.children.splice(l+1,0,p),l++)}o=d}},Mri.wordBefore="\\b",Mri.wordAfter="\\b",Mri.wordSplitCharacters=[" ",",",".",":",";","<",">","=","+","-","_","{","}","[","]","`","~","!","@","#","$","%","^","&","*","(",")",'"',"?","/","|","\\","”","　","،","؟","؛","’","‘"];var Y=Mri;function Mri(){}Object.defineProperty(Pri.prototype,"x",{get:function(){return this.xIn},set:function(e){this.xIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(Pri.prototype,"y",{get:function(){return this.yIn},set:function(e){this.yIn=e},enumerable:!0,configurable:!0}),Pri.prototype.copy=function(e){this.xIn=e.xIn,this.yIn=e.yIn},Pri.prototype.destroy=function(){this.xIn=void 0,this.yIn=void 0};var kri=Pri;function Pri(e,t){this.xIn=0,this.yIn=0,this.xIn=e,this.yIn=t}Fri.prototype.encodeString=function(e){var t,i,n,o,r,s,a="",l=0;for(e=this.unicodeEncode(e);l<e.length;)n=(t=e.charCodeAt(l++))>>2,o=(3&t)<<4|(t=e.charCodeAt(l++))>>4,r=(15&t)<<2|(i=e.charCodeAt(l++))>>6,s=63&i,isNaN(t)?r=s=64:isNaN(i)&&(s=64),a=a+this.keyStr.charAt(n)+this.keyStr.charAt(o)+this.keyStr.charAt(r)+this.keyStr.charAt(s);return a},Fri.prototype.unicodeEncode=function(e){for(var t=e.replace(/\r\n/g,"\n"),i="",n=0;n<t.length;n++){var o=t.charCodeAt(n);o<128?i+=String.fromCharCode(o):i=127<o&&o<2048?(i+=String.fromCharCode(o>>6|192))+String.fromCharCode(63&o|128):(i=(i+=String.fromCharCode(o>>12|224))+String.fromCharCode(o>>6&63|128))+String.fromCharCode(63&o|128)}return i},Fri.prototype.decodeString=function(e){var t,i,n,o,r,s,a=0,l=0,h=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===this.keyStr.charAt(64)&&h--,e.charAt(e.length-2)===this.keyStr.charAt(64)&&h--,h%1!=0)throw new Error("Invalid base64 input, bad content length.");for(var d=new Uint8Array(0|h);a<e.length;)n=this.keyStr.indexOf(e.charAt(a++)),t=(15&(o=this.keyStr.indexOf(e.charAt(a++))))<<4|(r=this.keyStr.indexOf(e.charAt(a++)))>>2,i=(3&r)<<6|(s=this.keyStr.indexOf(e.charAt(a++))),d[l++]=n<<2|o>>4,64!==r&&(d[l++]=t),64!==s&&(d[l++]=i);return d},Fri.prototype.destroy=function(){this.keyStr=void 0};var Bri=Fri;function Fri(){this.keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}Object.defineProperty(Rri.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0});var Lri=Rri;function Rri(e,t){this.x=0,this.width=0,this.x=e,this.width=t}function Ori(){}Nri=function(e,t){return(Nri=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])}))(e,t)};var Nri,Vri,wce=function(e,t){function i(){this.constructor=e}Nri(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},_ri=(wce(Hri,Vri=Ori),Hri.prototype.clear=function(){this.characterFormat&&this.characterFormat.clearFormat(),this.paragraphFormat&&this.paragraphFormat.clearFormat()},Hri.prototype.destroy=function(){this.characterFormat&&(this.characterFormat.destroy(),this.characterFormat=void 0),this.paragraphFormat&&(this.paragraphFormat.destroy(),this.paragraphFormat=void 0),this.ownerBase=void 0,this.name=void 0,this.next=void 0,this.basedOn=void 0,this.link=void 0},Hri.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)},Hri);function Hri(e){var t=Vri.call(this)||this;return t.ownerBase=e,t.paragraphFormat=new bri(t),t.characterFormat=new Eri(t),t}wce(Wri,zri=Ori),Wri.prototype.clear=function(){this.characterFormat&&this.characterFormat.clearFormat()},Wri.prototype.destroy=function(){this.characterFormat&&(this.characterFormat.destroy(),this.characterFormat=void 0),this.ownerBase=void 0,this.name=void 0,this.next=void 0,this.basedOn=void 0,this.link=void 0},Wri.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)};var zri,jri=Wri;function Wri(e){var t=zri.call(this)||this;return t.ownerBase=e,t.characterFormat=new Eri(t),t}wce(qri,Qri=Ori),qri.prototype.destroy=function(){this.ownerBase=void 0,this.name=void 0,this.next=void 0,this.basedOn=void 0,this.link=void 0};var Qri,Uri=qri;function qri(e){var t=Qri.call(this)||this;return t.ownerBase=e,t}Object.defineProperty(Yri.prototype,"length",{get:function(){return this.collection.length},enumerable:!0,configurable:!0}),Yri.prototype.remove=function(t){this.collection=this.collection.filter(function(e){return e.name!==t.name})},Yri.prototype.push=function(e){return null!=e&&void 0!==e&&this.collection.push(e),1},Yri.prototype.getItem=function(e){return this.collection.length>e?this.collection[parseInt(e.toString(),10)]:null},Yri.prototype.indexOf=function(e){return this.collection.indexOf(e)},Yri.prototype.contains=function(e){e=this.collection.indexOf(e);return-1<e&&e<this.collection.length},Yri.prototype.clear=function(){if(this.collection&&0<this.collection.length)for(var e=0;e<this.collection.length;e++){var t=this.collection[parseInt(e.toString(),10)];(t instanceof jri||t instanceof _ri)&&t.clear()}this.collection=[]},Yri.prototype.findByName=function(e,t){for(var i,n=0,o=this.collection;n<o.length;n++){var r=o[n];r.name===e&&(i=r,je(t)||r.type!==t&&(i=void 0))}return i},Yri.prototype.getStyleNames=function(t){return this.collection.filter(function(e){return e.type===t}).map(function(e){return e.name})},Yri.prototype.getStyles=function(t){for(var e=[],i=0,n=this.collection.filter(function(e){return e.type===t}).map(function(e){return e});i<n.length;i++){var o=n[i],r={},s={};"Paragraph"===t&&(s.paragraphFormat={},Y.writeParagraphFormat(s.paragraphFormat,!0,o.paragraphFormat)),"Table"!==t&&(s.characterFormat={},Y.writeCharacterFormat(s.characterFormat,!0,o.characterFormat)),r.name=o.name,r.style=JSON.stringify(s),je(t)||(r.type=t,"Paragraph"!==r.type)||je(o.link)||(r.type="Linked"),e.push(r)}return e},Yri.prototype.destroy=function(){if(this.collection&&0<this.collection.length)for(var e=0;e<this.collection.length;e++){var t=this.collection[parseInt(e.toString(),10)];(t instanceof jri||t instanceof _ri||t instanceof Uri)&&t.destroy()}this.collection=[],this.collection=void 0};var Gri=Yri;function Yri(){this.collection=[]}Object.defineProperty(Kri.prototype,"backgroundColor",{get:function(){return this.getPropertyValue("backgroundColor")},set:function(e){this.setPropertyValue("backgroundColor",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Kri.prototype,"foregroundColor",{get:function(){return this.getPropertyValue("foregroundColor")},set:function(e){this.setPropertyValue("foregroundColor",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Kri.prototype,"textureStyle",{get:function(){return this.getPropertyValue("textureStyle")},set:function(e){this.setPropertyValue("textureStyle",e)},enumerable:!0,configurable:!0}),Kri.prototype.getPropertyValue=function(e){if(this.hasValue(e)){var t=mJt.getPropertyType(Kri.uniqueFormatType,e);if(!je(this.uniqueShadingFormat)&&this.uniqueShadingFormat.propertiesHash.containsKey(t))return this.uniqueShadingFormat.propertiesHash.get(t)}return Kri.getPropertyDefaultValue(e)},Kri.prototype.setPropertyValue=function(e,t){var i;!je(t)&&""!==t||(t=Kri.getPropertyDefaultValue(e)),je(this.uniqueShadingFormat)?this.initializeUniqueShading(e,t):(i=mJt.getPropertyType(this.uniqueShadingFormat.uniqueFormatType,e),this.uniqueShadingFormat.propertiesHash.containsKey(i)&&this.uniqueShadingFormat.propertiesHash.get(i)===t||(this.uniqueShadingFormat=Kri.uniqueShadingFormats.updateUniqueFormat(this.uniqueShadingFormat,e,t)))},Kri.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"backgroundColor":case"foregroundColor":t="empty";break;case"textureStyle":t="TextureNone"}return t},Kri.prototype.initializeUniqueShading=function(e,t){var i=new uJt;this.addUniqueShading("backgroundColor",e,t,i),this.addUniqueShading("foregroundColor",e,t,i),this.addUniqueShading("textureStyle",e,t,i),this.uniqueShadingFormat=Kri.uniqueShadingFormats.addUniqueFormat(i,Kri.uniqueFormatType)},Kri.prototype.addUniqueShading=function(e,t,i,n){var o=mJt.getPropertyType(Kri.uniqueFormatType,e);e===t?n.add(o,i):n.add(o,Kri.getPropertyDefaultValue(e))},Kri.prototype.destroy=function(){je(this.uniqueShadingFormat)||Kri.uniqueShadingFormats.remove(this.uniqueShadingFormat),this.uniqueShadingFormat=void 0},Kri.prototype.cloneFormat=function(){var e=new Kri(void 0);return e.backgroundColor=this.backgroundColor,e.foregroundColor=this.foregroundColor,e.textureStyle=this.textureStyle,e},Kri.prototype.copyFormat=function(e){je(e)||je(e.uniqueShadingFormat)||(this.backgroundColor=e.backgroundColor,this.foregroundColor=e.foregroundColor,this.textureStyle=e.textureStyle)},Kri.prototype.hasValue=function(e){return!je(this.uniqueShadingFormat)&&(e=mJt.getPropertyType(this.uniqueShadingFormat.uniqueFormatType,e),this.uniqueShadingFormat.propertiesHash.containsKey(e))},Kri.clear=function(){this.uniqueShadingFormats.clear()},Kri.uniqueShadingFormats=new Det,Kri.uniqueFormatType=5;var Xri=Kri;function Kri(e){this.uniqueShadingFormat=void 0,this.ownerBase=void 0,this.ownerBase=e}Object.defineProperty(Zri.prototype,"title",{get:function(){return this._title},set:function(e){this._title=e},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"description",{get:function(){return this._description},set:function(e){this._description=e},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"allowAutoFit",{get:function(){return this.getPropertyValue("allowAutoFit")},set:function(e){this.setPropertyValue("allowAutoFit",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"cellSpacing",{get:function(){return this.getPropertyValue("cellSpacing")},set:function(e){if(e<0||264.6<e)throw new RangeError("The measurement must be between 0 px and 264.6 px.");this.setPropertyValue("cellSpacing",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"leftMargin",{get:function(){return this.getPropertyValue("leftMargin")},set:function(e){this.setPropertyValue("leftMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"topMargin",{get:function(){return this.getPropertyValue("topMargin")},set:function(e){this.setPropertyValue("topMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"rightMargin",{get:function(){return this.getPropertyValue("rightMargin")},set:function(e){this.setPropertyValue("rightMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"bottomMargin",{get:function(){return this.getPropertyValue("bottomMargin")},set:function(e){this.setPropertyValue("bottomMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"tableAlignment",{get:function(){return this.getPropertyValue("tableAlignment")},set:function(e){this.setPropertyValue("tableAlignment",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"leftIndent",{get:function(){return this.getPropertyValue("leftIndent")},set:function(e){if(e<-1440||1440<e)throw new RangeError("The measurement must be between -1440 px and 1440 px.");this.setPropertyValue("leftIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"preferredWidth",{get:function(){return this.getPropertyValue("preferredWidth")},set:function(e){this.setPropertyValue("preferredWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"preferredWidthType",{get:function(){return this.getPropertyValue("preferredWidthType")},set:function(e){this.setPropertyValue("preferredWidthType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"bidi",{get:function(){return this.getPropertyValue("bidi")},set:function(e){this.setPropertyValue("bidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"horizontalPositionAbs",{get:function(){return this.getPropertyValue("horizontalPositionAbs")},set:function(e){this.setPropertyValue("horizontalPositionAbs",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"horizontalPosition",{get:function(){return this.getPropertyValue("horizontalPosition")},set:function(e){this.setPropertyValue("horizontalPosition",e)},enumerable:!0,configurable:!0}),Object.defineProperty(Zri.prototype,"styleName",{get:function(){return this._styleName},set:function(e){this._styleName=e},enumerable:!0,configurable:!0}),Zri.prototype.getPropertyValue=function(e){if(this.hasValue(e)){var t=mJt.getPropertyType(Zri.uniqueFormatType,e);if(!je(this.uniqueTableFormat)&&this.uniqueTableFormat.propertiesHash.containsKey(t))return this.uniqueTableFormat.propertiesHash.get(t)}return Zri.getPropertyDefaultValue(e)},Zri.prototype.setPropertyValue=function(e,t){var i;!je(t)&&""!==t||(t=Zri.getPropertyDefaultValue(e)),je(this.uniqueTableFormat)?this.initializeUniqueTableFormat(e,t):(i=mJt.getPropertyType(this.uniqueTableFormat.uniqueFormatType,e),this.uniqueTableFormat.propertiesHash.containsKey(i)&&this.uniqueTableFormat.propertiesHash.get(i)===t||(this.uniqueTableFormat=Zri.uniqueTableFormats.updateUniqueFormat(this.uniqueTableFormat,e,t)))},Zri.prototype.initializeUniqueTableFormat=function(e,t){var i=new uJt;this.addUniqueTableFormat("allowAutoFit",e,t,i),this.addUniqueTableFormat("cellSpacing",e,t,i),this.addUniqueTableFormat("leftMargin",e,t,i),this.addUniqueTableFormat("topMargin",e,t,i),this.addUniqueTableFormat("bottomMargin",e,t,i),this.addUniqueTableFormat("rightMargin",e,t,i),this.addUniqueTableFormat("leftIndent",e,t,i),this.addUniqueTableFormat("tableAlignment",e,t,i),this.addUniqueTableFormat("preferredWidth",e,t,i),this.addUniqueTableFormat("preferredWidthType",e,t,i),this.addUniqueTableFormat("bidi",e,t,i),this.addUniqueTableFormat("horizontalPositionAbs",e,t,i),this.addUniqueTableFormat("horizontalPosition",e,t,i),this.uniqueTableFormat=Zri.uniqueTableFormats.addUniqueFormat(i,Zri.uniqueFormatType)},Zri.prototype.addUniqueTableFormat=function(e,t,i,n){var o=mJt.getPropertyType(Zri.uniqueFormatType,e);e===t&&n.add(o,i)},Zri.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},Zri.prototype.assignTableMarginValue=function(e,t,i,n){this.leftMargin=e,this.topMargin=t,this.rightMargin=i,this.bottomMargin=n},Zri.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},Zri.prototype.destroy=function(){je(this.borders)||this.borders.destroy(),je(this.shading)||this.shading.destroy(),je(this.uniqueTableFormat)||Zri.uniqueTableFormats.remove(this.uniqueTableFormat),this.uniqueTableFormat=void 0,this.ownerBase=void 0,this.borders=void 0,this.shading=void 0},Zri.prototype.cloneFormat=function(){var e=new Zri(void 0);return e.leftIndent=this.leftIndent,e.tableAlignment=this.tableAlignment,e.cellSpacing=this.cellSpacing,e.leftMargin=this.leftMargin,e.rightMargin=this.rightMargin,e.topMargin=this.topMargin,e.bottomMargin=this.bottomMargin,e.preferredWidth=this.preferredWidth,e.preferredWidthType=this.preferredWidthType,e.horizontalPositionAbs=this.horizontalPositionAbs,e.horizontalPosition=this.horizontalPosition,e.borders=je(this.borders)?void 0:this.borders.cloneFormat(),e.shading=je(this.shading)?void 0:this.shading.cloneFormat(),e.bidi=this.bidi,e.allowAutoFit=this.allowAutoFit,e.styleName=this.styleName,e.title=this.title,e.description=this.description,e},Zri.prototype.hasValue=function(e){return!je(this.uniqueTableFormat)&&(e=mJt.getPropertyType(this.uniqueTableFormat.uniqueFormatType,e),this.uniqueTableFormat.propertiesHash.containsKey(e))},Zri.prototype.copyFormat=function(e){je(e)||(je(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,this.styleName=e.styleName),je(e.borders)||(this.borders=new uri(this),this.borders.copyFormat(e.borders)),je(e.shading)||(this.shading=new Xri(this),this.shading.copyFormat(e.shading)),je(e.title)||(this.title=e.title),je(e.description))||(this.description=e.description)},Zri.clear=function(){this.uniqueTableFormats.clear()},Zri.uniqueTableFormats=new Det,Zri.uniqueFormatType=8;var Jri=Zri;function Zri(e){this.uniqueTableFormat=void 0,this.borders=new uri(this),this.shading=new Xri(this),this._title=void 0,this._description=void 0,this.ownerBase=void 0,this._styleName=void 0,this.ownerBase=e,this.assignTableMarginValue(5.4,0,5.4,0)}Object.defineProperty(esi.prototype,"leftMargin",{get:function(){return this.getPropertyValue("leftMargin")},set:function(e){this.setPropertyValue("leftMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(esi.prototype,"rightMargin",{get:function(){return this.getPropertyValue("rightMargin")},set:function(e){this.setPropertyValue("rightMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(esi.prototype,"topMargin",{get:function(){return this.getPropertyValue("topMargin")},set:function(e){this.setPropertyValue("topMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(esi.prototype,"bottomMargin",{get:function(){return this.getPropertyValue("bottomMargin")},set:function(e){this.setPropertyValue("bottomMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(esi.prototype,"cellWidth",{get:function(){return this.getPropertyValue("cellWidth")},set:function(e){this.setPropertyValue("cellWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(esi.prototype,"columnSpan",{get:function(){return this.getPropertyValue("columnSpan")},set:function(e){this.setPropertyValue("columnSpan",e)},enumerable:!0,configurable:!0}),Object.defineProperty(esi.prototype,"rowSpan",{get:function(){return this.getPropertyValue("rowSpan")},set:function(e){this.setPropertyValue("rowSpan",e)},enumerable:!0,configurable:!0}),Object.defineProperty(esi.prototype,"preferredWidth",{get:function(){return this.getPropertyValue("preferredWidth")},set:function(e){this.setPropertyValue("preferredWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(esi.prototype,"verticalAlignment",{get:function(){return this.getPropertyValue("verticalAlignment")},set:function(e){this.setPropertyValue("verticalAlignment",e)},enumerable:!0,configurable:!0}),Object.defineProperty(esi.prototype,"preferredWidthType",{get:function(){return this.getPropertyValue("preferredWidthType")},set:function(e){this.setPropertyValue("preferredWidthType",e)},enumerable:!0,configurable:!0}),esi.prototype.getPropertyValue=function(e){if(this.hasValue(e)){var t=mJt.getPropertyType(esi.uniqueFormatType,e);if(!je(this.uniqueCellFormat)&&this.uniqueCellFormat.propertiesHash.containsKey(t))return this.uniqueCellFormat.propertiesHash.get(t)}return esi.getPropertyDefaultValue(e)},esi.prototype.setPropertyValue=function(e,t){var i;!je(t)&&""!==t||(t=esi.getPropertyDefaultValue(e)),je(this.uniqueCellFormat)?this.initializeUniqueCellFormat(e,t):(i=mJt.getPropertyType(this.uniqueCellFormat.uniqueFormatType,e),this.uniqueCellFormat.propertiesHash.containsKey(i)&&this.uniqueCellFormat.propertiesHash.get(i)===t||(this.uniqueCellFormat=esi.uniqueCellFormats.updateUniqueFormat(this.uniqueCellFormat,e,t)))},esi.prototype.initializeUniqueCellFormat=function(e,t){var i=new uJt;this.addUniqueCellFormat("leftMargin",e,t,i),this.addUniqueCellFormat("topMargin",e,t,i),this.addUniqueCellFormat("bottomMargin",e,t,i),this.addUniqueCellFormat("rightMargin",e,t,i),this.addUniqueCellFormat("cellWidth",e,t,i),this.addUniqueCellFormat("columnSpan",e,t,i),this.addUniqueCellFormat("rowSpan",e,t,i),this.addUniqueCellFormat("preferredWidth",e,t,i),this.addUniqueCellFormat("verticalAlignment",e,t,i),this.addUniqueCellFormat("preferredWidthType",e,t,i),this.uniqueCellFormat=esi.uniqueCellFormats.addUniqueFormat(i,esi.uniqueFormatType)},esi.prototype.addUniqueCellFormat=function(e,t,i,n){var o=mJt.getPropertyType(esi.uniqueFormatType,e);e===t&&n.add(o,i)},esi.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},esi.prototype.containsMargins=function(){return!(je(this.leftMargin)&&je(this.rightMargin)&&je(this.bottomMargin)&&je(this.topMargin))},esi.prototype.destroy=function(){je(this.borders)||this.borders.destroy(),je(this.shading)||this.shading.destroy(),je(this.uniqueCellFormat)||esi.uniqueCellFormats.remove(this.uniqueCellFormat),this.uniqueCellFormat=void 0,this.borders=void 0,this.shading=void 0},esi.prototype.cloneFormat=function(){var e=new esi(void 0);return e.verticalAlignment=this.verticalAlignment,e.leftMargin=this.leftMargin,e.rightMargin=this.rightMargin,e.topMargin=this.topMargin,e.bottomMargin=this.bottomMargin,e.preferredWidth=this.preferredWidth,e.preferredWidthType=this.preferredWidthType,e.cellWidth=this.cellWidth,e.borders=je(this.borders)?void 0:this.borders.cloneFormat(),e.shading=je(this.shading)?void 0:this.shading.cloneFormat(),e},esi.prototype.hasValue=function(e){return!je(this.uniqueCellFormat)&&(e=mJt.getPropertyType(this.uniqueCellFormat.uniqueFormatType,e),this.uniqueCellFormat.propertiesHash.containsKey(e))},esi.prototype.copyFormat=function(e){je(e)||(je(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),je(e.shading)||(this.shading=new Xri(this),this.shading.copyFormat(e.shading)),je(e.borders))||(this.borders=new uri(this),this.borders.copyFormat(e.borders))},esi.prototype.initializeCellBorders=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},esi.clear=function(){this.uniqueCellFormats.clear()},esi.uniqueCellFormats=new Det,esi.uniqueFormatType=4;var $ri=esi;function esi(e){this.uniqueCellFormat=void 0,this.borders=new uri(this),this.shading=new Xri(this),this.ownerBase=e,this.borders=new uri(this),this.shading=new Xri(this)}Object.defineProperty(isi.prototype,"abstractListId",{get:function(){return this.abstractListIdIn},set:function(e){this.abstractListIdIn=e},enumerable:!0,configurable:!0}),isi.prototype.clear=function(){if(!je(this.levels)){for(var e=0;e<this.levels.length;e++){var t=this.levels[parseInt(e.toString(),10)];t.clearFormat(),this.levels.splice(this.levels.indexOf(t),1),e--}this.levels=[]}},isi.prototype.destroy=function(){if(!je(this.levels)){for(var e=0;e<this.levels.length;e++){var t=this.levels[parseInt(e.toString(),10)];t.destroy(),this.levels.splice(this.levels.indexOf(t),1),e--}this.levels=[]}this.levels=void 0},isi.prototype.clone=function(){for(var e=new isi,t=0;t<this.levels.length;t++)e.levels.push(this.levels[parseInt(t.toString(),10)].clone(e));return e};var tsi=isi;function isi(){this.abstractListIdIn=-1,this.nsid=-1,this.levels=[],this.nsid=parseInt(Y.generateHexDecimal(),16)}osi.prototype.clear=function(){je(this.overrideListLevel)||this.overrideListLevel.clearFormat(),this.overrideListLevel=void 0},osi.prototype.destroy=function(){je(this.overrideListLevel)||this.overrideListLevel.destroy(),this.levelNumber=void 0,this.startAt=void 0,this.overrideListLevel=void 0},osi.prototype.clone=function(){var e=new osi;return e.startAt=this.startAt,e.levelNumber=this.levelNumber,je(this.overrideListLevel)||(e.overrideListLevel=this.overrideListLevel.clone(e)),e};var nsi=osi;function osi(){}Object.defineProperty(ssi.prototype,"listLevelPattern",{get:function(){return this.getPropertyValue("listLevelPattern")},set:function(e){this.setPropertyValue("listLevelPattern",e)},enumerable:!0,configurable:!0}),Object.defineProperty(ssi.prototype,"followCharacter",{get:function(){return this.getPropertyValue("followCharacter")},set:function(e){this.setPropertyValue("followCharacter",e)},enumerable:!0,configurable:!0}),Object.defineProperty(ssi.prototype,"startAt",{get:function(){return this.getPropertyValue("startAt")},set:function(e){this.setPropertyValue("startAt",e)},enumerable:!0,configurable:!0}),Object.defineProperty(ssi.prototype,"numberFormat",{get:function(){return this.getPropertyValue("numberFormat")},set:function(e){this.setPropertyValue("numberFormat",e)},enumerable:!0,configurable:!0}),Object.defineProperty(ssi.prototype,"paraStyleName",{get:function(){return this.getPropertyValue("paraStyleName")},set:function(e){this.setPropertyValue("paraStyleName",e)},enumerable:!0,configurable:!0}),Object.defineProperty(ssi.prototype,"restartLevel",{get:function(){return this.getPropertyValue("restartLevel")},set:function(e){this.setPropertyValue("restartLevel",e)},enumerable:!0,configurable:!0}),Object.defineProperty(ssi.prototype,"isLegalStyleNumbering",{get:function(){return this.getPropertyValue("isLegalStyleNumbering")},set:function(e){this.setPropertyValue("isLegalStyleNumbering",e)},enumerable:!0,configurable:!0}),ssi.prototype.getPropertyValue=function(e){var t=mJt.getPropertyType(ssi.uniqueFormatType,e);return!je(this.uniqueListLevel)&&this.uniqueListLevel.propertiesHash.containsKey(t)?this.uniqueListLevel.propertiesHash.get(t):ssi.getPropertyDefaultValue(e)},ssi.prototype.setPropertyValue=function(e,t){var i;!je(t)&&""!==t||(t=ssi.getPropertyDefaultValue(e)),je(this.uniqueListLevel)?this.initializeUniqueWListLevel(e,t):(i=mJt.getPropertyType(this.uniqueListLevel.uniqueFormatType,e),this.uniqueListLevel.propertiesHash.containsKey(i)&&this.uniqueListLevel.propertiesHash.get(i)===t||(this.uniqueListLevel=ssi.uniqueListLevels.updateUniqueFormat(this.uniqueListLevel,e,t)))},ssi.prototype.initializeUniqueWListLevel=function(e,t){var i=new uJt;this.addUniqueWListLevel("listLevelPattern",e,t,i),this.addUniqueWListLevel("startAt",e,t,i),this.addUniqueWListLevel("followCharacter",e,t,i),this.addUniqueWListLevel("numberFormat",e,t,i),this.addUniqueWListLevel("paraStyleName",e,t,i),this.addUniqueWListLevel("restartLevel",e,t,i),this.addUniqueWListLevel("isLegalStyleNumbering",e,t,i),this.uniqueListLevel=ssi.uniqueListLevels.addUniqueFormat(i,ssi.uniqueFormatType)},ssi.prototype.addUniqueWListLevel=function(e,t,i,n){var o=mJt.getPropertyType(ssi.uniqueFormatType,e);e===t?n.add(o,i):n.add(o,ssi.getPropertyDefaultValue(e))},ssi.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"paraStyleName":case"numberFormat":t="";break;case"restartLevel":t=0;break;case"isLegalStyleNumbering":t=!1}return t},ssi.prototype.destroy=function(){je(this.uniqueListLevel)||ssi.uniqueListLevels.remove(this.uniqueListLevel),this.uniqueListLevel=void 0,je(this.characterFormat)||(this.characterFormat.destroy(),this.characterFormat=void 0),je(this.paragraphFormat)||(this.paragraphFormat.destroy(),this.paragraphFormat=void 0)},ssi.prototype.clearFormat=function(){je(this.uniqueListLevel)||ssi.uniqueListLevels.remove(this.uniqueListLevel),this.uniqueListLevel=void 0,this.characterFormat&&this.characterFormat.clearFormat(),this.characterFormat=void 0,this.paragraphFormat&&this.paragraphFormat.clearFormat(),this.paragraphFormat=void 0},ssi.clear=function(){this.uniqueListLevels.clear()},ssi.prototype.clone=function(e){e=new ssi(e);return e.paragraphFormat=this.paragraphFormat.cloneFormat(),e.characterFormat=this.characterFormat.cloneFormat(),this.uniqueListLevel&&(e.uniqueListLevel=this.uniqueListLevel,e.uniqueListLevel.referenceCount++),e},ssi.dotBullet=String.fromCharCode(61623),ssi.squareBullet=String.fromCharCode(61607),ssi.arrowBullet=String.fromCharCode(10148),ssi.circleBullet=String.fromCharCode(61551)+String.fromCharCode(32),ssi.uniqueListLevels=new Det,ssi.uniqueFormatType=9;var rsi=ssi;function ssi(e){this.uniqueListLevel=void 0,this.paragraphFormat=void 0,this.characterFormat=void 0,0 instanceof tsi,this.ownerBase=e,this.characterFormat=new Eri(void 0),this.paragraphFormat=new bri(void 0)}var asi=function(){return(asi=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},lsi=(Object.defineProperty(hsi.prototype,"paragraphMark",{get:function(){return"¶"},enumerable:!0,configurable:!0}),Object.defineProperty(hsi.prototype,"lineBreakMark",{get:function(){return"↲"},enumerable:!0,configurable:!0}),hsi.prototype.getEnSpaceCharacter=function(){return String.fromCharCode(8194)},hsi.prototype.repeatChar=function(e,t){for(var i="",n=0;n<t;n++)i+=e;return i},hsi.prototype.getParagraphMarkWidth=function(e){return this.getParagraphMarkSize(e).Width},hsi.prototype.getParagraphMarkSize=function(e){var t,i=this.getFormatText(e);return this.paragraphMarkInfo[""+i]||(t={Width:this.getWidth(this.paragraphMark,e),Height:(t=this.getHeight(e)).Height,BaselineOffset:t.BaselineOffset},e.hidden?t:this.paragraphMarkInfo[""+i]=t)},hsi.prototype.getTextSize=function(e,t){var i=0,n=t.bidi||this.isRTLText(e.text),n=this.setText(e.text,n,t.bdo),n=("\r"===n&&(n=String.fromCharCode(182)),i=this.getWidth(n,t,e.scriptType),e.width=i,this.getHeight(t,e.scriptType));return"Word2003"===this.documentHelper.compatibilityMode&&e.isColumnBreak||(e.height=n.Height),e.baselineOffset=n.BaselineOffset," "===e.text[e.text.length-1]&&(i=this.getWidth(Y.trimEnd(e.text),t,e.scriptType)),e.trimEndWidth=i},hsi.prototype.getHeight=function(e,t){var t=this.getFontNameToRender(t,e),i=this.getFormatText(e,t);return je(this.documentHelper.heightInfoCollection[""+i])?(t=this.documentHelper.owner.textMeasureHelper.getHeightInternal(e,t),this.documentHelper.heightInfoCollection[""+i]=asi({},t),e.hidden&&(t.Height=0),t):e.hidden?((t=asi({},this.documentHelper.heightInfoCollection[""+i])).Height&&(t.Height=0),t):this.documentHelper.heightInfoCollection[""+i]},hsi.prototype.getFormatText=function(e,t){var i="",i=(je(t)?e.fontFamily:t).toLocaleLowerCase(),t=e.bidi||e.complexScript;return i+=";"+(t?e.fontSizeBidi:e.fontSize),(t?e.boldBidi:e.bold)&&(i+=";bold"),(t?e.italicBidi:e.italic)&&(i+=";italic"),i},hsi.prototype.measureTextExcludingSpaceAtEnd=function(e,t,i){return this.getWidth(Y.trimEnd(e),t,i)},hsi.prototype.getWidth=function(e,t,i){if(t.hidden)return 0;e.match("\v")&&e.replace("\v",this.lineBreakMark);var n=t.bidi||t.complexScript,o=n?t.fontSizeBidi:t.fontSize,r=n?t.boldBidi?"bold":"":t.bold?"bold":"",n=n?t.italicBidi?"italic":"":t.italic?"italic":"",i=this.getFontNameToRender(i,t),o=0===o?.5:o/("Normal"===t.baselineAlignment?1:1.5),r=(this.context.font=r+" "+n+" "+o+'pt "'+i+'"',this.context.letterSpacing=t.characterSpacing+"pt",t.scaling/100);return"̶"===(e=t.allCaps?e.toUpperCase():e)&&(e+="A"),Math.abs(this.context.measureText(e).width*r)},hsi.prototype.setText=function(e,t,i,n){return je(n)&&(n=!1),0===e.length?"":(!(t=t)&&"RTL"===i||t&&"LTR"===i?e=Y.reverseString(e):n&&t&&Y.endsWith(e)&&(i=e.length-Y.trimEnd(e).length,e=Y.addSpace(i)+Y.trimEnd(e)),e)},hsi.prototype.measureText=function(e,t,i){e=this.getWidth(e,t,i),t=this.getHeight(t,i);return{Width:e,Height:t.Height,BaselineOffset:t.BaselineOffset}},hsi.prototype.updateTextSize=function(e,t){var i,n,o,r,s;e.characterFormat.hidden&&0===t.height||(i=new Eri(void 0),r=e.listLevel.characterFormat,t=t.characterFormat,i.fontSize=(r.hasValue("fontSize")?r:t).fontSize,i.fontFamily=(r.hasValue("fontFamily")?r:t).fontFamily,o=n="",s=("Normal"===r.baselineAlignment?t:r).baselineAlignment,n=r.hasValue("bold")?r.bold?"bold":"":t.bold?"bold":"",o=r.hasValue("italic")?r.italic?"italic":"":t.italic?"italic":"",i.baselineAlignment=s,n&&(i.bold=!0),o&&(i.italic=!0),r=i.bidi||this.isRTLText(e.text),t=this.setText(e.text,r,i.bdo),e.width=this.getWidth(t,i),s=this.getHeight(i),e.height=s.Height,e.baselineOffset=s.BaselineOffset,i.destroy())},hsi.prototype.containsSpecialCharAlone=function(e){for(var t=0;t<e.length;t++)if(-1==="*|.:[]{}-`;()@&$#%!~?, '".indexOf(e.charAt(t)))return!1;return!0},hsi.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},hsi.prototype.containsCombinationText=function(e){return!(!e.text.match(/^[0-9]+$/)||!e.paragraph.bidi)},hsi.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}},hsi.prototype.containsSpecialChar=function(e){for(var t=0;t<e.length;t++)if(-1!=="*|.:[]{}-`;()@&$#%!~? ".indexOf(e.charAt(t)))return!0;return!1},hsi.prototype.isRTLText=function(e){var t=!1;if(!je(e))for(var i=0;i<e.length;i++){var n=e[i];if(n>=String.fromCharCode(1424)&&n<=String.fromCharCode(1535)||n>=String.fromCharCode(64285)&&n<=String.fromCharCode(64335)||n>=String.fromCharCode(1536)&&n<=String.fromCharCode(1791)||n>=String.fromCharCode(1872)&&n<=String.fromCharCode(1919)||n>=String.fromCharCode(2208)&&n<=String.fromCharCode(2303)||n>=String.fromCharCode(64336)&&n<=String.fromCharCode(65023)||n>=String.fromCharCode(65136)&&n<=String.fromCharCode(65279)||n>=String.fromCharCode(43392)&&n<=String.fromCharCode(43487)||n>=String.fromCharCode(1792)&&n<=String.fromCharCode(1871)||n>=String.fromCharCode(1920)&&n<=String.fromCharCode(1983)||n>=String.fromCharCode(2112)&&n<=String.fromCharCode(2143)||n>=String.fromCharCode(1984)&&n<=String.fromCharCode(2047)||n>=String.fromCharCode(2048)&&n<=String.fromCharCode(2111)||n>=String.fromCharCode(11568)&&n<=String.fromCharCode(11647)){t=!0;break}}return t},hsi.prototype.isUnicodeText=function(e,t){var i=!1;if(!je(e))for(var n=0;n<e.length;n++){var o=e[n];if(("　"<=o&&o<="ヿ"||"＀"<=o&&o<="￯"||"一"<=o&&o<="龯"||"㐀"<=o&&o<="䶿"||"가"<=o&&o<="￯"||"඀"<=o&&o<="෿")&&0!==t){i=!0;break}}return i},hsi.prototype.getRtlLanguage=function(e){return je(e)||""===e?{isRtl:!1,id:0}:e>=String.fromCharCode(1424)&&e<=String.fromCharCode(1535)?{isRtl:!0,id:1}:e>=String.fromCharCode(1536)&&e<=String.fromCharCode(1791)||e>=String.fromCharCode(1872)&&e<=String.fromCharCode(1919)||e>=String.fromCharCode(2208)&&e<=String.fromCharCode(2303)||e>=String.fromCharCode(64336)&&e<=String.fromCharCode(65023)||e>=String.fromCharCode(65136)&&e<=String.fromCharCode(65279)?{isRtl:!0,id:2}:e>=String.fromCharCode(43392)&&e<=String.fromCharCode(43487)?{isRtl:!0,id:3}:e>=String.fromCharCode(1792)&&e<=String.fromCharCode(1871)?{isRtl:!0,id:4}:e>=String.fromCharCode(1920)&&e<=String.fromCharCode(1983)?{isRtl:!0,id:5}:e>=String.fromCharCode(2112)&&e<=String.fromCharCode(2143)?{isRtl:!0,id:6}:e>=String.fromCharCode(1984)&&e<=String.fromCharCode(2047)?{isRtl:!0,id:7}:e>=String.fromCharCode(2048)&&e<=String.fromCharCode(2111)?{isRtl:!0,id:8}:e>=String.fromCharCode(11568)&&e<=String.fromCharCode(11647)?{isRtl:!0,id:9}:{isRtl:!1,id:0}},hsi.prototype.splitTextByConsecutiveLtrAndRtl=function(e,t,i,n,o,r){var s=n.length,a=[];if(!je(e)&&""!==e){for(var l=-1,h="",d="",p="",c="",u=0;u<e.length;u++){var g=0,m=!1;(je(o.value)?t:!o.value)&&this.isNumber(e[u])?(c+=e[u],g=4):this.isWordSplitChar(e[u])?(g=2,m=t||32==e.charCodeAt(u)&&""==p,p+=e[u]):this.isRTLText(e[u])&&!this.isNumber(e[u])?(o.value=!1,r.value=!0,d+=e[u],g=1):(o.value=!0,h+=e[u]),""!=c&&4!=g&&(a.push(c),n.push(aJt.Number),c=""),""!=d&&1!=g&&(a.push(d),n.push(aJt.RightToLeft),d=""),""!=h&&0!=g&&(a.push(h),l=a.length-1,n.push(aJt.LeftToRight),h=""),""==p||2==g&&!m||(a.push(p),n.push(aJt.WordSplit),p="")}if(""!=c?(a.push(c),n.push(aJt.Number)):""!=d?(a.push(d),n.push(aJt.RightToLeft)):""!=h?(a.push(h),l=a.length-1,n.push(aJt.LeftToRight)):""!=p&&(a.push(p),n.push(aJt.WordSplit)),r.value||!je(o.value)&&!o.value)for(u=1;u<a.length;u++)(y=n[u+s])==aJt.WordSplit&&1==a[u].length&&u+s+1<n.length&&n[u+s-1]!=aJt.WordSplit&&(n[u+s-1]!=aJt.Number||hsi.isNumberNonReversingCharacter(a[u],t))&&n[u+s-1]==n[u+s+1]&&(a[u-1]=a[u-1]+a[u]+a[u+1],a.splice(u,1),a.splice(u,1),n.splice(u+s,1),n.splice(u+s,1),u--);else if(-1!=l)if(t){for(u=1;u<l;u++)if((y=n[u+s])==aJt.WordSplit&&u<l&&n[u+s-1]==aJt.LeftToRight){for(var h="",f=u+1;f<=l;f++)h+=a[f],a.splice(f,1),n.splice(f+s,1),f--,l--;a[u-1]=a[u-1]+a[u]+h,a.splice(u,1),n.splice(u+s,1),u--,l--}}else a.length=0,a.push(e);else t||(a.length=0,a.push(e));if(t)for(var y,u=1;u<a.length;u++)(y=n[u+s])==aJt.WordSplit&&1==a[u].length&&u+s+1<n.length&&n[u+s-1]!=aJt.WordSplit&&(n[u+s-1]!=aJt.Number||hsi.isNumberNonReversingCharacter(a[u],t)||!i)&&n[u+s-1]==n[u+s+1]?(a[u-1]=a[u-1]+a[u]+a[u+1],a.splice(u,1),a.splice(u,1),n.splice(u+s,1),n.splice(u+s,1),u--):y==aJt.WordSplit&&n[u+s-1]==aJt.Number&&this.isNonWordSplitCharacter(a[u])&&!i?(a[u-1]=a[u-1]+a[u],a.splice(u,1),n.splice(u+s,1),u--):y!=aJt.LeftToRight||n[u+s-1]!=aJt.Number&&n[u+s-1]!=aJt.LeftToRight||(a[u-1]=a[u-1]+a[u],n[u+s-1]=aJt.LeftToRight,a.splice(u,1),n.splice(u+s,1),u--)}return a},hsi.prototype.isRightToLeftLanguage=function(e){return 14337==e||15361==e||5121==e||3073==e||2049==e||11265==e||13313==e||12289==e||4097==e||8193==e||16385==e||1025==e||10241==e||7169==e||9217==e||10655==e},hsi.prototype.isNumber=function(e){return!isNaN(parseInt(e,10))||e>=String.fromCharCode(1632)&&e<=String.fromCharCode(1641)||e>=String.fromCharCode(1776)&&e<=String.fromCharCode(1785)},hsi.prototype.isWordSplitChar=function(e){for(var t=0;t<hsi.wordSplitCharacters.length;t++)if(hsi.wordSplitCharacters[t]===e)return!0;return!1},hsi.isNumberNonReversingCharacter=function(e,t){for(var i=0;i<hsi.numberNonReversingCharacters.length;i++){var n=hsi.numberNonReversingCharacters[i];if(e[0]==n&&(47!=n.charCodeAt(0)||!t))return!0}return!1},hsi.prototype.isNonWordSplitCharacter=function(e){for(var t=!1,i=0;i<e.length;i++){var n=e.charCodeAt(i);if(35!=n&&36!=n&&37!=n){t=!1;break}t=!0}return t},hsi.prototype.getFontNameToRender=function(e,t){return je(e)?t.fontFamily:t.bidi||t.complexScript?this.getFontNameBidiToRender(e,t):(this.isEastAsiaScript(e)||"EastAsia"===t.fontHintType&&e===lJt.SpecialCharacter)&&!je(t.fontFamilyFarEast)?this.getFontNameEAToRender(e,t):this.getFontNameAsciiToRender(e,t)},hsi.prototype.isEastAsiaScript=function(e){return e==lJt.Japanese||e==lJt.Korean||e==lJt.Chinese},hsi.prototype.getFontNameEAToRender=function(e,t){var i=t.fontFamilyFarEast;return je(i)||Y.isThemeFont(i)?this.getFontNameFromTheme(t,i,e,"EastAsia"):i},hsi.prototype.getFontNameAsciiToRender=function(e,t){var i=t.fontFamilyAscii;return Y.isThemeFont(i)?this.getFontNameFromTheme(t,i,e,"Default"):t.fontFamily},hsi.prototype.getFontNameBidiToRender=function(e,t){var i=t.fontFamilyBidi;return!je(i)||Y.isThemeFont(i)?this.getFontNameFromTheme(t,i,e,"CS"):i},hsi.prototype.getFontNameFromTheme=function(e,t,i,n){var o,r;return!this.documentHelper.hasThemes||je(this.documentHelper.themes)||ee(this.documentHelper.themes.fontScheme)||(o=this.documentHelper.themes.fontScheme),"majorAscii"==t||"majorBidi"==t||"majorEastAsia"==t||"majorHAnsi"==t?(r=void 0,null!=o&&null!=o.majorFontScheme&&(r=o.majorFontScheme),t=this.updateFontNameFromTheme(e,r,i,t,n)):"minorAscii"!=t&&"minorBidi"!=t&&"minorEastAsia"!=t&&"minorHAnsi"!=t||(r=void 0,null!=o&&null!=o.majorFontScheme&&(r=o.minorFontScheme),t=this.updateFontNameFromTheme(e,r,i,t,n)),t=je(t)||Y.isThemeFont(t)?$Jt:t},hsi.prototype.updateFontNameFromTheme=function(e,t,i,n,o){var r="";if(null!=t&&null!=t.fontSchemeList&&0<t.fontSchemeList.length&&t.fontSchemeList.forEach(function(e){("cs"!=e.name||"majorBidi"!=n&&"minorBidi"!=n)&&("ea"!=e.name||"majorEastAsia"!=n&&"minorEastAsia"!=n)&&("latin"!=e.name||"majorAscii"!=n&&"majorHAnsi"!=n&&"minorAscii"!=n&&"minorHAnsi"!=n)||(r=e.typeface)}),null!=t&&null!=t.fontTypeface)if("CS"==o)(e.complexScript||e.bidi||"majorAscii"!==n&&"majorHAnsi"!==n&&"minorAscii"!==n&&"minorHAnsi"!==n)&&(!e.bidi||"majorHAnsi"!==n&&"minorHAnsi"!==n)?t.fontTypeface.containsKey("Arab")&&(r=t.fontTypeface.get("Arab")):n=r;else if("EastAsia"==o)je(this.documentHelper.themeFontLanguage)||je(n=this.getFontNameWithFontScript(t,this.documentHelper.themeFontLanguage.localeIdFarEast,o))||(r=n);else if(je(r)&&!je(this.documentHelper.themeFontLanguage)&&("minorBidi"===n||"majorBidi"===n))return n=this.getFontNameWithFontScript(t,this.documentHelper.themeFontLanguage.localeIdBidi,o);return je(r)&&(r=$Jt),n=r},hsi.prototype.getFontNameWithFontScript=function(e,t,i){var n=null,o=t.toString(),e=e.fontTypeface;return("gu_IN"!=o&&1095!=t||!e.containsKey("Gujr"))&&("hi_IN"!=o&&"mr_IN"!=o&&1081!=t&&1102!=t||!e.containsKey("Deva"))&&("ko_KR"!=o&&1042!=t||!e.containsKey("Hang"))?"zh_CN"!=o&&"zh_SG"!=o&&2052!=t||!e.containsKey("Hans")?("zh_TW"!=o&&"zh_HK"!=o&&"zh_MO"!=o||!e.containsKey("Hant"))&&!(("ja_JP"==o||1041==t)&&e.containsKey("Jpan")||("ta_IN"==o||1097==t)&&e.containsKey("Taml")||("te_IN"==o||1098==t)&&e.containsKey("Telu")||("he_IL"==o||"yi_Hebr"==o||1037==t)&&e.containsKey("Hebr"))?"th_TH"!=o&&1054!=t||!e.containsKey("Thai")?"CS"==i&&e.containsKey("Arab")&&(n=e.get("Arab")):n=e.get("Thai"):n=e.get("Arab"):n=e.get("Hans"):n=e.get("Arab"),n},hsi.prototype.destroy=function(){this.documentHelper=void 0,this.context=void 0,this.paragraphMarkInfo={},this.paragraphMarkInfo=void 0},hsi.wordSplitCharacters=[String.fromCharCode(32),String.fromCharCode(33),String.fromCharCode(34),String.fromCharCode(35),String.fromCharCode(36),String.fromCharCode(37),String.fromCharCode(38),String.fromCharCode(39),String.fromCharCode(40),String.fromCharCode(41),String.fromCharCode(42),String.fromCharCode(43),String.fromCharCode(44),String.fromCharCode(45),String.fromCharCode(46),String.fromCharCode(47),String.fromCharCode(58),String.fromCharCode(59),String.fromCharCode(60),String.fromCharCode(61),String.fromCharCode(62),String.fromCharCode(63),String.fromCharCode(64),String.fromCharCode(91),String.fromCharCode(92),String.fromCharCode(93),String.fromCharCode(94),String.fromCharCode(95),String.fromCharCode(96),String.fromCharCode(123),String.fromCharCode(124),String.fromCharCode(125),String.fromCharCode(126),String.fromCharCode(1548),String.fromCharCode(1563),String.fromCharCode(8211),String.fromCharCode(8212),String.fromCharCode(8216),String.fromCharCode(8217),String.fromCharCode(8221),String.fromCharCode(12288),String.fromCharCode(8207)],hsi.numberNonReversingCharacters=[String.fromCharCode(44),String.fromCharCode(46),String.fromCharCode(47),String.fromCharCode(58),String.fromCharCode(1548)],hsi);function hsi(e){this.paragraphMarkInfo={},je(this.documentHelper=e)||(this.context=e.containerContext)}psi.prototype.isSameStyle=function(e,t){var i=void 0;if(t?e.nextWidget instanceof Lai&&(i=e.nextWidget):e.previousWidget instanceof Lai&&(i=e.previousWidget),je(i)){if(e.paragraphFormat.contextualSpacing&&e.isInsideTable&&(!this.documentHelper.allowSpaceOfSameStyleInTable||"Word2013"===this.documentHelper.compatibilityMode))if(0===e.index)i=this.updateFirstParagraphSpacingBasedOnContextualSpacing(e,t);else if(e.index===e.associatedCell.childWidgets.length-1&&(i=this.updateLastParagraphSpacingBasedOnContextualSpacing(e))===e)return!0;if(je(i))return!1}if(!(i instanceof Lai&&e.paragraphFormat.baseStyle===i.paragraphFormat.baseStyle)||e.isInsideTable&&this.documentHelper.allowSpaceOfSameStyleInTable)return!1;if(0<=e.paragraphFormat.listFormat.listId&&0<=i.paragraphFormat.listFormat.listId&&!e.paragraphFormat.contextualSpacing){if(t&&e.paragraphFormat.spaceAfterAuto)return!0;if(!t&&e.paragraphFormat.spaceBeforeAuto)return!0}return e.paragraphFormat.contextualSpacing},psi.prototype.updateFirstParagraphSpacingBasedOnContextualSpacing=function(e,t){var i=e.associatedCell,n=i.ownerRow,o=n.ownerTable,r=t?je(e.nextRenderedWidget)?je(i.nextRenderedWidget)?void 0:i.nextRenderedWidget.firstChild:e.nextRenderedWidget:je(e.previousRenderedWidget)?je(i.previousRenderedWidget)?void 0:i.previousRenderedWidget.firstChild:e.previousRenderedWidget;if(0===i.index&&0===e.index){if(0!==n.index)return je(r)&&"Normal"===e.paragraphFormat.baseStyle.name&&e.paragraphFormat.listFormat.listId<0?e:r;if(!o.isInsideTable||0!=o.index)return o.previousRenderedWidget;r=this.checkOwnerTablePrevItem(o,e)}else if(0===e.index&&!t){o=n.childWidgets[i.index-1];if(o.childWidgets[o.childWidgets.length-1]instanceof _ai&&"Normal"===e.paragraphFormat.baseStyle.name&&e.paragraphFormat.listFormat.listId<0)return e}return r},psi.prototype.updateLastParagraphSpacingBasedOnContextualSpacing=function(e){var t=e.associatedCell,i=t.ownerRow;if(t.index===i.childWidgets.length-1&&e.index===t.childWidgets.length-1){if("Normal"===e.paragraphFormat.baseStyle.name&&e.paragraphFormat.listFormat.listId<0)return e}else if(e.index===t.childWidgets.length-1)for(var n=i.childWidgets[t.index+1].firstChild;n instanceof _ai;)n=n.childWidgets[0].childWidgets[0].childWidgets[0];return n},psi.prototype.checkOwnerTablePrevItem=function(e,t){e=e.associatedCell.ownerRow;if(0<e.index){if("Normal"===t.paragraphFormat.baseStyle.name&&t.paragraphFormat.listFormat.listId<0)return t}else{if(!e.ownerTable.isInsideTable||0!==e.ownerTable.index)return e.ownerTable.previousRenderedWidget;this.checkOwnerTablePrevItem(e.ownerTable,t)}},Object.defineProperty(psi.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),psi.prototype.layout=function(){},psi.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.isSkipFirstLineIndent=void 0,this.isFieldCode=void 0,this.footnoteHeight=void 0,this.isMultiColumnDoc=void 0,this.isIFfield=void 0,this.isPastingContent=void 0},psi.prototype.layoutItems=function(e,t,i){for(var n,o=this,r=0,s=0,a=0;a<e.length;a++){var l,h,d,p,c=e[a],u=(1<c.sectionFormat.numberOfColumns&&(this.isMultiColumnDoc=!0),e[a+1]),g=(this.viewer.columnLayoutArea.setColumns(c.sectionFormat),this.documentHelper.pages[this.documentHelper.pages.length-1]),m=void 0,m=(je(g)||je(g.bodyWidgets[g.bodyWidgets.length-1])||0!==g.bodyWidgets[g.bodyWidgets.length-1].childWidgets.length||je(g.bodyWidgets[g.bodyWidgets.length-1].previousSplitWidget)||(m=g.bodyWidgets[g.bodyWidgets.length-1].previousSplitWidget),!(0<a)||je(m)||je(m.lastChild)||m.lastChild instanceof _ai||(l=(m=m.lastChild).previousRenderedWidget,m.isSectionBreak&&l instanceof Lai&&l.isEndsWithPageBreak&&(m=l),"Word2013"===this.documentHelper.compatibilityMode&&(m.isEndsWithPageBreak||m.isEndsWithColumnBreak)&&0===g.bodyWidgets[0].childWidgets.length&&(this.documentHelper.pages.splice(this.documentHelper.pages.length-1,1)[0].destroy(),g=this.documentHelper.pages[this.documentHelper.pages.length-1])),c.sectionFormat.breakCode),f=void 0,y=(0===a||"Word2010"!==this.documentHelper.compatibilityMode||"NewColumn"!==m||!(1<(f=(y=e[a-1].getSplitWidgets())[y.length-1]).sectionFormat.columns.length&&1<c.sectionFormat.columns.length&&f.sectionFormat.columns.length===c.sectionFormat.columns.length&&f.sectionFormat.columns.length-1!==f.columnIndex)||f.lastChild instanceof Lai&&f.lastChild.isEndsWithPageBreak||je(y=this.viewer.columnLayoutArea.getNextColumnByBodyWidget(f))||(c.columnIndex=y.index,c.isWord2010NextColumn=!0,c.y=f.y,this.viewer.clientActiveArea.height-=c.y-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=c.y),c.isWord2010NextColumn||"NoBreak"===m||(m="NewPage"),void 0);if(0!==a&&(y=g.bodyWidgets[g.bodyWidgets.length-1].lastChild)&&(l=y.previousRenderedWidget,y instanceof Lai)&&y.isSectionBreak&&l instanceof Lai&&(y=l),0===a&&!i||0!==a&&!c.isWord2010NextColumn&&(je(m)||"NewPage"===m||r!==c.sectionFormat.pageHeight||s!==c.sectionFormat.pageWidth||!je(y)&&y.isEndsWithPageBreak)?n=this.viewer.createNewPage(c):(m=this.documentHelper.viewer.clientActiveArea.y,h=this.documentHelper.viewer.clientActiveArea.height,i&&(p=this.getBodyWidget(g.bodyWidgets[g.bodyWidgets.length-1],!0),d=this.getNextWidgetHeight(p),this.viewer.updateClientArea(p,p.page),h=this.viewer.clientActiveArea.height-(d-this.viewer.clientActiveArea.y),m=d,i=!1),(n=g).bodyWidgets.push(c),n.bodyWidgets[n.bodyWidgets.length-1].page=n,this.documentHelper.viewer.updateClientArea(c,n),this.documentHelper.viewer.clientActiveArea.y=m,this.documentHelper.viewer.clientActiveArea.height=h),r=c.sectionFormat.pageHeight,s=c.sectionFormat.pageWidth,this.addBodyWidget(this.viewer.clientActiveArea,c),1<this.documentHelper.pages.length){for(var v=0,b=0;b<this.documentHelper.pages.length;b++){var w=this.documentHelper.pages[b],C=w.sectionIndex;if(c.index<C||w===n)break;v++}v<this.documentHelper.pages.length-1&&this.documentHelper.insertPage(v,n)}this.layoutSection(c,0,u),c.isWord2010NextColumn&&!je(f)&&(p=this.getNextWidgetHeight(f),this.viewer.clientActiveArea.y<p)&&(this.viewer.updateClientArea(f,f.page),this.viewer.clientActiveArea.height=this.viewer.clientActiveArea.height-(p-this.viewer.clientActiveArea.y),this.viewer.clientActiveArea.y=p)}t||this.layoutComments(this.documentHelper.comments),this.updateFieldElements(),"Pages"===this.documentHelper.owner.layoutType&&this.layoutEndNoteElement(),setTimeout(function(){o.documentHelper&&(o.documentHelper.isScrollHandler=!0,o.documentHelper.clearContent(),o.viewer.updateScrollBars(),o.documentHelper.isScrollHandler=!1,o.isInitialLoad=!1)},50)},psi.prototype.layoutComments=function(e){je(e)||this.viewer.owner.commentReviewPane.layoutComments(e)},psi.prototype.layoutSection=function(e,t,i){var n,o,r,s=e.firstChild;do{}while(!this.isLayoutWhole&&s instanceof _ai&&"Auto"===s.tableFormat.preferredWidthType&&!s.tableFormat.allowAutoFit&&s.calculateGrid(),je(s)||(this.viewer.updateClientAreaForBlock(s,!0,void 0,!0,!0),s.containerWidget.indexInOwner,n=this.layoutBlock(s,t),t=0,this.viewer.updateClientAreaForBlock(s,!1),s=n),s);for(s=e.firstChild,this.viewer instanceof nai&&1<e.sectionFormat.numberOfColumns&&!je(i)&&"NoBreak"===i.sectionFormat.breakCode&&("NoBreak"===e.sectionFormat.breakCode||e.sectionIndex===e.page.bodyWidgets[0].sectionIndex)&&(this.getColumnBreak(e)?(i=(i=e.getSplitWidgets())[i.length-1],je(e.page.nextPage)?(o=this.getBodyWidget(i,!0),this.viewer.updateClientArea(o,o.page),o=this.getNextWidgetHeight(o),this.viewer.clientActiveArea.height-=o-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=o):this.splitBodyWidgetBasedOnColumn(i)):(je(e.page.nextPage)||(e=this.documentHelper.pages[this.documentHelper.pages.length-1].bodyWidgets[0]),this.splitBodyWidgetBasedOnColumn(e))),s&&s.bodyWidget&&s.bodyWidget.page&&(r=s.bodyWidget.page);r;)r=(r.footnoteWidget&&this.layoutfootNote(r.footnoteWidget),r.nextPage);r=void 0},psi.prototype.reLayoutMultiColumn=function(e,t,i){this.isInitialLoad=!0,e=e.getSplitWidgets()[0],this.combineMultiColumnForRelayout(e),1<e.sectionFormat.numberOfColumns&&(this.isMultiColumnDoc=!0),this.isMultiColumnSplit=!1;var n=e.previousRenderedWidget,o=e.nextRenderedWidget,r=!1;if(!t&&!je(e.firstChild)&&e.firstChild instanceof Lai&&e.y!==e.firstChild.y&&(e.y=e.firstChild.y),t&&o&&e.page!==o.page&&e.firstChild instanceof Lai){var t=0,s=(t=(a=e.firstChild).isEmpty()?this.documentHelper.textHelper.getParagraphMarkSize(a.characterFormat).Height:(s=a.childWidgets[0],this.getMaxElementHeight(s)),a.previousRenderedWidget);e.y===this.viewer.clientActiveArea.y&&t>this.viewer.clientActiveArea.height&&(s=je(s)?a:s,this.moveBlocksToNextPage(s),this.viewer.columnLayoutArea.setColumns(e.sectionFormat),this.viewer.updateClientArea(e,e.page),r=!0)}else if(!je(n)&&n.page!==e.page&&e.firstChild instanceof Lai&&n.lastChild instanceof Lai){var t=n.lastChild,a=e.firstChild;if(e instanceof Sai&&n.lastChild&&t instanceof Lai&&"NoBreak"===n.sectionFormat.breakCode&&e.page.index!==n.page.index&&e.index!==n.index){s=n,t=(1<s.sectionFormat.columns.length&&(s=this.getBodyWidget(s,!0)),Y.round(this.getNextWidgetHeight(s)+a.height,2));if(!n.lastChild.isEndsWithPageBreak&&!n.lastChild.isEndsWithColumnBreak&&t<=Y.round(this.viewer.clientActiveArea.bottom,2)){for(var l=n.page,h=e.page,d=0;d<h.bodyWidgets.length;d++){var p=h.bodyWidgets[d];h.bodyWidgets.splice(h.bodyWidgets.indexOf(p),1),l.bodyWidgets.splice(l.bodyWidgets.length,0,p),p.page=l,d--}e.y=this.viewer.clientActiveArea.y,this.documentHelper.removeEmptyPages()}}}r||(this.viewer.columnLayoutArea.setColumns(e.sectionFormat),this.viewer.updateClientArea(e,e.page),this.viewer.clientActiveArea.height-=e.y-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=e.y),this.addBodyWidget(this.viewer.clientActiveArea,e),this.clearBlockWidget(e.childWidgets,!0,!0,!0),this.isMultiColumnLayout=!0,this.reLayoutMultiColumnBlock(e,o,i),this.isMultiColumnLayout=!1,this.isInitialLoad=!1;s=e.getSplitWidgets(),a=s[s.length-1],t=this.getBodyWidget(a,!0),this.viewer.updateClientArea(t,t.page),n=this.getNextWidgetHeight(t);this.viewer.clientActiveArea.height-=n-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=n,je(a)||je(a.nextRenderedWidget)||(o=a.nextRenderedWidget,r=this.documentHelper.viewer.clientActiveArea.y,i=this.documentHelper.viewer.clientActiveArea.height,this.documentHelper.viewer.updateClientArea(o,o.page),this.documentHelper.viewer.clientActiveArea.y=r,this.documentHelper.viewer.clientActiveArea.height=i,this.documentHelper.blockToShift=o.firstChild),(je(a.nextRenderedWidget)||!je(a.nextRenderedWidget)&&"NoBreak"!==a.sectionFormat.breakCode&&a.nextRenderedWidget.sectionFormat.pageHeight!==a.sectionFormat.pageHeight&&a.nextRenderedWidget.sectionFormat.pageWidth!==a.sectionFormat.pageWidth)&&(this.documentHelper.blockToShift=void 0)},psi.prototype.combineMultiColumnForRelayout=function(e){var t=e.getSplitWidgets(),i=t[0];for(e=t[t.length-1];e!==i;){for(var n=e.previousRenderedWidget,o=!1,r=0;r<e.childWidgets.length;r++)e.childWidgets[r]instanceof Dai&&!je(e.childWidgets[r].previousSplitWidget)&&!je(e.childWidgets[r].previousSplitWidget.previousSplitWidget)&&e.childWidgets[r].previousSplitWidget.bodyWidget.page!==e.childWidgets[r].previousSplitWidget.previousSplitWidget.bodyWidget.page&&(o=!0),e.childWidgets[r]instanceof Dai&&!je(e.childWidgets[r].previousSplitWidget)&&e.childWidgets[r].previousSplitWidget.bodyWidget.page===e.childWidgets[r].bodyWidget.page&&!o?(e.childWidgets[r].combineWidget(this.viewer),n.lastChild instanceof _ai&&this.updateCellHeightInCombinedTable(n.lastChild)):(n.childWidgets.push(e.childWidgets[r]),e.childWidgets[r].containerWidget=n,e.childWidgets[r].containerWidget.page=n.page,e.childWidgets.splice(0,1)),r--;e=e.previousRenderedWidget}this.documentHelper.removeEmptyPages()},psi.prototype.reLayoutMultiColumnBlock=function(e,t,i){for(var n,o,r=e.firstChild;r instanceof _ai&&"Auto"===r.tableFormat.preferredWidthType&&!r.tableFormat.allowAutoFit&&r.calculateGrid(),je(r)||(this.viewer.updateClientAreaForBlock(r,!0,void 0,!0),n=this.layoutBlock(r,0,r.index<i),this.viewer.updateClientAreaForBlock(r,!1),r=n),r&&-1!==e.getSplitWidgets().indexOf(r.bodyWidget););r=e.firstChild,this.viewer instanceof nai&&1<e.sectionFormat.numberOfColumns&&!je(t)&&"NoBreak"===t.sectionFormat.breakCode&&("NoBreak"===e.sectionFormat.breakCode||e.sectionIndex===e.page.bodyWidgets[0].sectionIndex)&&(t=(t=e.getSplitWidgets())[t.length-1],this.getColumnBreak(e)?e.page!==t.page?this.splitBodyWidgetBasedOnColumn(t):(o=this.getBodyWidget(t,!0),this.viewer.updateClientArea(o,o.page),o=this.getNextWidgetHeight(o),this.viewer.clientActiveArea.height-=o-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=o):je(e.page.nextPage)||this.splitBodyWidgetBasedOnColumn(t))},psi.prototype.splitBodyWidgetBasedOnColumn=function(e){var t,i=e=this.getBodyWidget(e,!0);this.isMultiColumnSplit=!0,!this.isInitialLoad&&e.sectionFormat.equalWidth&&(n=this.documentHelper.selection.startOffset,t=this.documentHelper.selection.endOffset,this.combineMultiColumn(e),this.layoutMultiColumnBody(e,!1),n!==this.documentHelper.selection.startOffset)&&this.documentHelper.selection.select(n,t),this.combineMultiColumn(e);for(var n=this.getCountOrLine(e,void 0,void 0,!0).lineCount,o=Math.round(n/e.sectionFormat.numberOfColumns);e;){var r=this.getCountOrLine(e,o,!0,!1),s=r.lineWidget,r=r.lineCount;if(!je(s)){if(s.paragraph.containerWidget instanceof Sai)this.moveToNextLine(s,!0,s.indexInOwner);else if(s.paragraph.containerWidget instanceof Uai){for(var a=[s.paragraph.containerWidget.ownerTable],l=[s.paragraph.containerWidget.ownerRow],h=s.paragraph.containerWidget.index,r=(a[a.length-1].isInsideTable&&(a[a.length-1]=this.getParentTable(a[a.length-1]),l[l.length-1]=this.getParentRow(l[l.length-1])),this.updateWidgetsToTable(a,l,l[l.length-1],!1,r,h,!0),a[a.length-1]),d=l[l.length-1].nextRenderedWidget;d;)this.clearRowWidget(d,!0,!0,!1),d=(d=this.layoutRow(a,d)).nextRenderedWidget;!je(r.nextRenderedWidget)&&e.sectionFormat.equalWidth&&(this.documentHelper.blockToShift=r.nextRenderedWidget,this.documentHelper.layout.shiftLayoutedItems(!1))}h=this.getBodyWidget(s.paragraph.bodyWidget,!0),l=this.getBodyWidget(h,!1);!h.sectionFormat.equalWidth&&l.sectionFormat.numberOfColumns-1===l.columnIndex&&je(l.nextSplitWidget)&&(s=this.getCountOrLine(r=h).lineCount,this.layoutMultiColumnBody(r,!0),s!==this.getCountOrLine(h).lineCount)&&this.splitBodyWidgetBasedOnColumn(h),je(l.nextSplitWidget)&&(this.viewer.updateClientArea(h,h.page),r=this.getNextWidgetHeight(h),this.viewer.clientActiveArea.height-=r-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=r,this.viewer.clientArea.y=this.viewer.clientActiveArea.y,this.viewer.clientArea.height=this.viewer.clientActiveArea.height)}if(!je(e=e.nextRenderedWidget)&&e.columnIndex===e.sectionFormat.numberOfColumns-1)break}this.isMultiColumnSplit=!1,this.isInitialLoad||je((e=this.getBodyWidget(i,!1)).nextRenderedWidget)||(this.documentHelper.blockToShift=e.nextRenderedWidget.firstChild)},psi.prototype.getColumnBreak=function(e){var t=this.getBodyWidget(e,!0);if(!(t.sectionFormat.numberOfColumns<=1))for(;t;){if(t.lastChild instanceof Lai&&t.lastChild.isEndsWithColumnBreak)return!0;if(je(t.nextRenderedWidget)||t.index!==t.nextRenderedWidget.index)break;t=t.nextRenderedWidget}return!1},psi.prototype.layoutMultiColumnBody=function(e,t){for(var i=!1;e;){i||(this.viewer.updateClientArea(e,e.page),this.viewer.clientActiveArea.height-=e.y-this.viewer.clientActiveArea.y,e instanceof Pai?(this.viewer.clientArea.height=Number.POSITIVE_INFINITY,this.viewer.clientActiveArea.height=Number.POSITIVE_INFINITY):this.viewer.clientActiveArea.y=e.y);for(var i=!t,n=0;n<e.childWidgets.length;n++){var o=e.childWidgets[n],r=(o instanceof _ai&&this.clearTableWidget(o,!0,!0,!0),this.viewer.updateClientAreaForBlock(o,!0),!1);o instanceof Lai&&!je(o.paragraphFormat)&&-1!==o.paragraphFormat.listFormat.listId&&(r=0===o.paragraphFormat.listFormat.listLevelNumber),this.layoutBlock(o,0,r),this.viewer.updateClientAreaForBlock(o,!1)}if(e.columnIndex===e.sectionFormat.numberOfColumns-1||!je(e.nextRenderedWidget)&&e.sectionIndex!==e.nextRenderedWidget.sectionIndex)break;e=e.nextRenderedWidget}},psi.prototype.getNextWidgetHeight=function(e){for(var t=0,i=0;e&&0<e.childWidgets.length;){var n=e.lastChild,t=(n=n instanceof Lai&&n.isSectionBreak&&n.previousRenderedWidget instanceof _ai&&"Word2013"!==this.documentHelper.compatibilityMode?n.previousRenderedWidget:n).height;if(n instanceof _ai&&(t=this.getHeight(n)),i<(t+=n.y)&&(i=t),!je(e)&&e.columnIndex===e.sectionFormat.numberOfColumns-1||0===e.sectionFormat.numberOfColumns||!je(e.nextRenderedWidget)&&e.sectionIndex!==e.nextRenderedWidget.sectionIndex)break;e=e.nextRenderedWidget}return i},psi.prototype.getHeight=function(e){for(var t=0,i=0;i<e.childWidgets.length;i++)t+=e.childWidgets[i].height;return t},psi.prototype.getBookmarkMargin=function(e){for(var t=0,i=0;i<e.children.length;i++){var n=e.children[i];if(!je(n.margin)&&n instanceof Dli){t=n.margin.top+n.margin.bottom;break}}return t},psi.prototype.getCountOrLine=function(e,t,i,n){for(var o,r,s=0,a=!1,l=0,h=0,d=0;e;){for(var p=0;p<e.childWidgets.length;p++){var c=e.childWidgets[p];if(c instanceof Lai){if(c.isSectionBreak)continue;for(var u=0;u<c.childWidgets.length;u++){var g=c.childWidgets[u],d=0;if(je(g.margin)||(d=g.margin.top+g.margin.bottom+this.getBookmarkMargin(g)),i){if(l+=g.height-d,Math.round(t)<Math.round(l)){o=c.childWidgets[u],a=!0;break}}else s++,l+=g.height-d}}else c instanceof _ai&&(r=this.getCountOrLineTable(c,t,i,l,!1,n),n?l+=r.lineCount:i?je(r.lineWidget)?l=r.lineCount:(o=r.lineWidget,h=r.lineCount,a=!0):s+=r.lineCount);if(a&&i)break}if(a&&i)break;if(!je(e.nextRenderedWidget)&&e.index!==e.nextRenderedWidget.index)break;e=e.nextRenderedWidget}return n?{lineWidget:void 0,lineCount:l}:i?{lineWidget:o,lineCount:h}:{lineWidget:void 0,lineCount:s}},psi.prototype.getCountOrLineTable=function(e,t,i,n,o,r){for(var s,a,l=0,h=!1,d=0,p=0,c=0,u=0,g=0,m=0,f=0;f<e.childWidgets.length;f++){for(var y=e.childWidgets[f],v=void 0,b=void 0,c=0,u=0,g=0,m=0,w=0;w<y.childWidgets.length;w++){for(var C=y.childWidgets[w],S=0;S<C.childWidgets.length;S++)if((x=C.childWidgets[S])instanceof Lai&&0<x.childWidgets.length)for(var A=0;A<x.childWidgets.length;A++)c++,v=C,g+=x.childWidgets[A].height;else c+=(a=this.getCountOrLineTable(x,t,i,n,!0,r)).lineCount,g+=a.lineCount;u<c&&(u=c),m<g&&(m=g,b=v),g=c=0}if(!i||o)d+=u,p+=m;else for(var x,I=0,T=0;T<b.childWidgets.length;T++){if((x=b.childWidgets[T])instanceof Lai)for(w=0;w<x.childWidgets.length;w++){if(n+=x.childWidgets[w].height,Math.round(t)<Math.round(n)){s=x.childWidgets[w],h=!0,n=0,l=I;break}if(I++,h&&i)break}else{if(!je((a=this.getCountOrLineTable(x,t,i,n,!1,r)).lineWidget)){h=!0,n=0,s=a.lineWidget,l=I+=a.lineCount;break}I+=a.lineCount,n+=x.height}if(h&&i)break}if(u=0,h&&i)break}return r?{lineWidget:void 0,lineCount:p}:!i||je(s)&&o?{lineWidget:void 0,lineCount:d}:i&&je(s)&&!o?{lineWidget:void 0,lineCount:n}:{lineWidget:s,lineCount:l}},psi.prototype.combineMultiColumn=function(e){for(e=this.getBodyWidget(e,!1);e&&0!==e.columnIndex;){var t=e.previousRenderedWidget;if(t.lastChild instanceof Lai&&t.lastChild.isEndsWithColumnBreak)break;for(var i=!1,n=0;n<e.childWidgets.length;n++)e.childWidgets[n]instanceof Dai&&!je(e.childWidgets[n].previousSplitWidget)&&!je(e.childWidgets[n].previousSplitWidget.previousSplitWidget)&&e.childWidgets[n].previousSplitWidget.bodyWidget.page!==e.childWidgets[n].previousSplitWidget.previousSplitWidget.bodyWidget.page&&(i=!0),e.childWidgets[n]instanceof Dai&&!je(e.childWidgets[n].previousSplitWidget)&&e.childWidgets[n].previousSplitWidget.bodyWidget.page===e.childWidgets[n].bodyWidget.page&&!i?(e.childWidgets[n].combineWidget(this.viewer),t.lastChild instanceof _ai&&this.updateCellHeightInCombinedTable(t.lastChild)):(t.childWidgets.push(e.childWidgets[n]),e.childWidgets[n].containerWidget=t,e.childWidgets[n].containerWidget.page=t.page,e.childWidgets.splice(0,1)),n--;e=e.previousRenderedWidget}this.documentHelper.removeEmptyPages()},psi.prototype.updateCellHeightInCombinedTable=function(e){for(var t=0,i=0,n=0;n<e.childWidgets.length;n++){for(var o=e.childWidgets[n],r=0;r<o.childWidgets.length;r++){for(var s=o.childWidgets[r],a=0;a<s.childWidgets.length;a++)i+=s.childWidgets[a].height;t<i&&(t=i);for(var i=0,l=0;l<o.childWidgets.length;l++)o.childWidgets[l].height=t}t=0}},psi.prototype.layoutHeaderFooter=function(e,t,i){var n,o,r=t.getCurrentPageHeaderFooter(e,!0);r&&(je((n=r).page)&&(r.page=i,r.height=0,this.clearBlockWidget(r.childWidgets,!0,!0,!0),t.updateHFClientArea(e.sectionFormat,!0),this.layoutHeaderFooterItems(t,r)),(r=n.clone()).parentHeaderFooter=n,this.clearBlockWidget(r.childWidgets,!0,!0,!0),(o=r).page=i,o.height=0,this.updateRevisionsToHeaderFooter(o,i),t.updateHFClientArea(e.sectionFormat,!0),i.headerWidget=this.layoutHeaderFooterItems(t,o),e.sectionFormat.topMargin<i.boundingRectangle.bottom)&&0<i.headerWidget.floatingElements.length&&"Behind"!==i.headerWidget.floatingElements[0].textWrappingStyle&&(i.headerWidget=this.shiftItemsForVerticalAlignment(o)),(r=t.getCurrentPageHeaderFooter(e,!1))&&(je((n=r).page)&&(r.page=i,r.height=0,this.clearBlockWidget(r.childWidgets,!0,!0,!0),t.updateHFClientArea(e.sectionFormat,!1),this.layoutHeaderFooterItems(t,r)),(r=n.clone()).parentHeaderFooter=n,this.clearBlockWidget(r.childWidgets,!0,!0,!0),(o=r).page=i,o.height=0,t.updateHFClientArea(e.sectionFormat,!1),this.updateRevisionsToHeaderFooter(o,i),i.footerWidget=this.layoutHeaderFooterItems(t,o))},psi.prototype.shiftItemsForVerticalAlignment=function(e){for(var t=e.floatingElements,i=0;i<t.length;i++){var n=t[i],o=n.verticalOrigin,r=n.paragraph;if("Margin"===o&&!r.isInsideTable){o=n.verticalPosition;if(0!=o){var s=(o+=this.viewer.clientActiveArea.y)-n.y;if(n.y=o,n instanceof Xli)for(var a=0;a<n.textFrame.childWidgets.length;a++){var l=n.textFrame.childWidgets[a];l instanceof Lai&&(l.y=l.y+s)}}}}return e},psi.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 o=0;o<n.childWidgets.length;o++){var r=n.childWidgets[o];r instanceof _ai&&this.clearTableWidget(r,!1,!0)}return n},psi.prototype.updateRevisionsToHeaderFooter=function(e,t){var i=e.childWidgets;if(e instanceof Iai&&0<i.length)for(var n=0;n<i.length;n++)if(0<i[n].childWidgets.length)for(var o=i[n].childWidgets,r=0;r<o.length;r++){var s=o[r].children;if(s)for(var a=0;a<s.length;a++)if(0<s[a].removedIds.length)for(var l=s[a].removedIds,h=0;h<l.length;h++){var d=this.documentHelper.revisionsInternal.get(l[h]);s[a].revisions[h]=d,this.updateRevisionRange(d,t)}}},psi.prototype.updateRevisionRange=function(e,t){for(var i=0;i<e.range.length;i++){var n=e.range[i];n instanceof pli?je(n.line.paragraph.bodyWidget.page)&&(n.line.paragraph.bodyWidget.page=t):n instanceof Eri&&je(n.ownerBase.bodyWidget.page)&&(n.ownerBase.bodyWidget.page=t)}},psi.prototype.linkFieldInHeaderFooter=function(e){for(var t=e.firstChild;t instanceof Lai?this.linkFieldInParagraph(t):this.linkFieldInTable(t),t=t.nextWidget;);},psi.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 o,r=i.children[n];if(r instanceof Zai&&(0!==r.fieldType||0===r.fieldType&&-1===this.documentHelper.fields.indexOf(r))&&r.linkFieldCharacter(this.documentHelper),r instanceof Sli&&!je(r.previousElement)&&r.previousElement instanceof Zai&&r.fieldBegin!==r.previousElement.fieldBegin&&(r.fieldBegin=r.previousElement.fieldBegin),r instanceof Xli){var s=r.textFrame.firstChild;if(s)for(;s instanceof Lai?this.linkFieldInParagraph(s):this.linkFieldInTable(s),s=s.nextWidget;);}else r instanceof Khi&&(je(o=this.getCommentById(this.documentHelper.comments,r.commentId))||(0===r.commentType?o.commentStart=r:o.commentEnd=r,r.comment=o))}},psi.prototype.getCommentById=function(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n.commentId===t)return n}},psi.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 o=i.childWidgets[n],r=0;r<o.childWidgets.length;r++){var s=o.childWidgets[r];s instanceof Lai?this.linkFieldInParagraph(s):this.linkFieldInTable(s)}},psi.prototype.layoutHeaderFooterItems=function(e,t){var i;this.viewer.updateClientAreaLocation(t,e.clientActiveArea),0===t.childWidgets.length&&(i=new Lai,r=new Gai(i),i.childWidgets.push(r),t.childWidgets.push(i),i.containerWidget=t),this.linkFieldInHeaderFooter(t);for(var n=0;n<t.childWidgets.length;n++){var o=t.childWidgets[n];o instanceof _ai&&"Auto"===o.tableFormat.preferredWidthType&&!o.tableFormat.allowAutoFit&&!o.isGridUpdated&&o.calculateGrid(),e.updateClientAreaForBlock(o,!0),this.layoutBlock(o,0),e.updateClientAreaForBlock(o,!1)}var r=t.headerFooterType;return"OddFooter"!==r&&"EvenFooter"!==r&&"FirstPageFooter"!==r||this.shiftChildLocation(e.clientArea.y-e.clientActiveArea.y,t),t},psi.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 o=t.y=i,r=0;r<t.childWidgets.length;r++){var s=t.childWidgets[r];if(s instanceof Lai){s.x=s.x,s.y=0===r?s.y+e:o,o+=s.height;for(var a=0;a<s.childWidgets.length;a++)for(var l=s.childWidgets[a],h=0;h<l.children.length;h++){var d,p=l.children[h];p instanceof qli&&"Inline"!==p.textWrappingStyle&&("Paragraph"===p.verticalOrigin||"Line"===p.verticalOrigin?p.y=s.y+p.verticalPosition:(d=this.getFloatingItemPoints(p),p.y=d.y),p instanceof Xli)&&(d=p.textFrame.marginTop,this.updateChildLocationForCellOrShape(p.y+d,p))}}else this.shiftChildLocationForTableWidget(s,e),o+=s.height}},psi.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 jai&&this.shiftChildLocationForTableRowWidget(n,t)}},psi.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)},psi.prototype.shiftChildLocationForTableCellWidget=function(e,t){e.y=e.y+t;for(var i=0;i<e.childWidgets.length;i++)e.childWidgets[i]instanceof Lai?(e.childWidgets[i].x=e.childWidgets[i].x,e.childWidgets[i].y=e.childWidgets[i].y+t):this.shiftChildLocationForTableWidget(e.childWidgets[i],t)},psi.prototype.layoutBlock=function(e,t,i){var n;return e instanceof Lai?((this.isInitialLoad||!this.isRelayout&&e.paragraphFormat.bidi&&this.isDocumentContainsRtl)&&(e.splitTextRangeByScriptType(0),e.splitLtrAndRtlText(0),e.combineconsecutiveRTL(0)),n=this.layoutParagraph(e,t,i),(i=this.checkAndRelayoutPreviousOverlappingBlock(e))&&(n=i)):(n=this.layoutTable(e,t),this.checkAndRelayoutPreviousOverlappingBlock(e),this.updateTableYPositionBasedonTextWrap(n)),n.nextRenderedWidget},psi.prototype.updateTableYPositionBasedonTextWrap=function(i){var n,o,r=this;je(i.bodyWidget)||i.containerWidget instanceof Zli||(n=i.y,o=new pai(i.x,i.y,i.width,i.height),i.bodyWidget.floatingElements.forEach(function(e){var t;e instanceof Xli&&!e.paragraph.isInsideTable&&(t=new pai(e.x,e.y,e.width,e.height),"TopAndBottom"===e.textWrappingStyle||"Square"===e.textWrappingStyle)&&o.isIntersecting(t)&&(i.y=e.y+e.height+e.distanceBottom,r.updateChildLocationForTable(i.y,i),t=i.y-n,r.viewer.cutFromTop(r.viewer.clientActiveArea.y+t))}))},psi.prototype.shiftWrapStyle=function(e){return"InFrontOfText"===e.textWrappingStyle||"Behind"===e.textWrappingStyle||"Inline"===e.textWrappingStyle},psi.prototype.checkAndRelayoutPreviousOverlappingBlock=function(e){if(!(e.containerWidget instanceof Zli||this.isRelayoutOverlap)){var t=e.previousWidget;if(e instanceof Lai)if(0<e.floatingElements.length)for(var i=0,n=0;n<e.floatingElements.length;n++){var o=e.floatingElements[n];if(!this.shiftWrapStyle(o)){for(var r,s=new pai(o.x,o.y,o.width,o.height);t;){if(e.isInsideTable&&i>this.viewer.clientArea.height){this.startOverlapWidget=void 0,this.endOverlapWidget=void 0;break}t instanceof Lai&&(r=new pai(t.x,t.y,t.width,t.height),s.isIntersecting(r))&&this.startOverlapWidget!==t&&(this.startOverlapWidget=t,this.endOverlapWidget=e),i+=t.height,t=t.previousWidget}t=e.previousWidget}}else{var a=e.getSplitWidgets();if(a)return a[a.length-1]}else{var a=e;if(!a.wrapTextAround)return a;for(var l,h=new pai(a.x,a.y,a.getTableCellWidth(),a.height);t;)t instanceof Lai&&(l=new pai(t.x,t.y,t.width,t.height),h.isIntersecting(l))&&this.startOverlapWidget!==t&&(this.startOverlapWidget=t,this.endOverlapWidget=e),t=t.previousWidget;t=e.previousWidget}e instanceof Lai&&e.containerWidget instanceof Sai&&0<e.floatingElements.length&&!this.shiftWrapStyle(e.floatingElements[0])&&e.containerWidget.firstChild!=e&&e.y+e.floatingElements[0].height>this.viewer.clientArea.bottom&&(a=e.previousWidget)&&a instanceof Lai&&a.y+a.height+this.getLineHeigth(e,e.floatingElements[0].line)+e.floatingElements[0].height>this.viewer.clientArea.bottom&&(this.moveToNextPage(this.viewer,e.floatingElements[0].line,!1,!1,!0),this.startOverlapWidget=e,this.endOverlapWidget=e),this.startOverlapWidget&&(this.isRelayoutOverlap=!0,this.skipRelayoutOverlap=!0,this.layoutStartEndBlocks(this.startOverlapWidget,e),this.isRelayoutOverlap=!1,this.skipRelayoutOverlap=!1),this.startOverlapWidget=void 0,this.endOverlapWidget=void 0}return e},psi.prototype.getLineHeigth=function(e,t){for(var i=0,n=0;n<e.childWidgets.length;n++)t!=e.childWidgets[n]&&(i+=e.childWidgets[n].height);return i},psi.prototype.addParagraphWidget=function(e,t){return t.isEmpty()&&!je(t.paragraphFormat)&&("Center"===t.paragraphFormat.textAlignment||"Right"===t.paragraphFormat.textAlignment||"Justify"===t.paragraphFormat.textAlignment&&t.paragraphFormat.bidi)&&-1===t.paragraphFormat.listFormat.listId?(this.updateXPositionForEmptyParagraph(e,t),t.y=e.y):(this.viewer.clientActiveArea.width<=0&&this.viewer instanceof sai?t.x=this.previousPara:(t.x=e.x,this.previousPara=t.x),t.width=e.width,t.y=e.y,t.clientX=void 0,t.hasOwnProperty("absoluteXPosition")&&delete t.absoluteXPosition),t},psi.prototype.updateXPositionForEmptyParagraph=function(e,t){var i,n;t.isEmpty()&&!je(t.paragraphFormat)&&(i=this.documentHelper.textHelper.getParagraphMarkWidth(t.characterFormat),t.clientX=e.x,n=e.x,t.absoluteXPosition={width:e.width,x:e.x},"Center"===t.paragraphFormat.textAlignment?n+=(e.width-i)/2:n+=e.width-i,t.width=i,t.x=n)},psi.prototype.addLineWidget=function(e){var t=void 0;return(t=new Gai(e)).width=e.width,e.childWidgets.push(t),t.paragraph=e,t},psi.prototype.isFirstElementWithPageBreak=function(e){var t=!1;if(this.viewer instanceof nai){e=e.childWidgets[0];if(e)for(var i=e.children[0];i;){if(!(i instanceof Dli&&0<=i.name.indexOf("_"))){i instanceof pli&&("\f"===i.text||i.text===String.fromCharCode(14))&&(t=!0);break}i=i.nextElement}}return t},psi.prototype.layoutfootNote=function(e){if("Pages"===this.documentHelper.owner.layoutType){for(var t,i,n,o,r=e.page.index,s=this.viewer.clientActiveArea.clone(),a=this.viewer.clientArea.clone(),l=("Footnote"===e.footNoteType&&1<e.sectionFormat.columns.length&&!this.isInitialLoad&&(this.updateColumnIndex(e.bodyWidgets[0],!1),this.layoutMultiColumnBody(e.bodyWidgets[0],!0)),"Endnote"===e.footNoteType&&1<e.bodyWidgets[0].sectionFormat.numberOfColumns&&(this.isInitialLoad||this.updateColumnIndex(e.bodyWidgets[0],!1),this.layoutMultiColumnBody(e.bodyWidgets[0],!0),this.viewer.clientActiveArea=s),0),h=(1<e.sectionFormat.columns.length&&"Footnote"===e.footNoteType&&(this.viewer.updateClientArea(e,e.page),l=this.viewer.clientActiveArea.width),"Footnote"===e.footNoteType&&(this.viewer.updateFootnoteClientArea(e.sectionFormat,e),1<e.sectionFormat.columns.length)&&(this.viewer.clientActiveArea.width=l,this.viewer.clientArea.width=l),void(e.height=0)),d=0,p=(this.isRelayoutFootnote=!1,0),c=(this.viewer instanceof nai&&0<e.bodyWidgets.length&&("Footnote"===e.footNoteType&&1<e.sectionFormat.columns.length||"Endnote"===e.footNoteType&&1<e.bodyWidgets[0].sectionFormat.columns.length)&&(this.isLayoutWhole&&this.updateColumnIndex(e.bodyWidgets[0],!1),this.splitFootNoteWidgetBasedOnColumn(e.bodyWidgets[0])),e.bodyWidgets[0]),u=0;u<e.bodyWidgets.length;u++){e.bodyWidgets[u].columnIndex!==c.columnIndex&&("Footnote"===e.footNoteType&&1<e.sectionFormat.columns.length||"Endnote"===e.footNoteType&&1<e.bodyWidgets[u].sectionFormat.columns.length)&&(this.viewer.updateClientArea(e.bodyWidgets[u],e.bodyWidgets[u].page),l=this.viewer.clientActiveArea.width,t=this.viewer.clientActiveArea.x,"Footnote"===e.footNoteType&&this.viewer.updateFootnoteClientArea(e.sectionFormat,e),this.viewer.clientActiveArea.x=t,this.viewer.clientArea.x=t,this.viewer.clientActiveArea.width=l,this.viewer.clientArea.width=l,this.viewer.cutFromTop(e.y+d)),0===u&&((t=new Lai).characterFormat=new Eri,t.paragraphFormat=new bri,t.index=0,i=new Gai(t),t.childWidgets.push(i),d=this.documentHelper.textHelper.getParagraphMarkSize(t.characterFormat).Height,e.height+=d,e.y=this.viewer.clientActiveArea.y,"Endnote"===e.footNoteType&&this.viewer.updateClientArea(e.bodyWidgets[u],e.bodyWidgets[u].page,!0),this.viewer.cutFromTop(e.y+d),e.margin=new gai(0,d,0,0));for(var p="Endnote"===e.footNoteType?0:p,g=0;g<e.bodyWidgets[u].childWidgets.length&&(h=e.bodyWidgets[u].childWidgets[g],"Footnote"!==e.footNoteType&&1!==e.bodyWidgets[u].getSplitWidgets().length||(h.index=p,p++),h.containerWidget=e.bodyWidgets[u],h.containerWidget.page=e.page,h.containerWidget.containerWidget=e,this.viewer.updateClientAreaForBlock(h,!0),h instanceof _ai&&(this.clearTableWidget(h,!0,!0,!0),this.isRelayoutFootnote=!0,"Footnote"===e.footNoteType)&&(this.viewer.clientArea.height=Number.POSITIVE_INFINITY,this.viewer.clientActiveArea.height=Number.POSITIVE_INFINITY),this.layoutBlock(h,0),!je(e.bodyWidgets[u]));g++)e.bodyWidgets[u].columnIndex===c.columnIndex&&(e.height+=h.height),this.viewer.updateClientAreaForBlock(h,!1);c=e.bodyWidgets[u]}1<e.sectionFormat.columns.length&&(n=this.getFootNoteBodyHeight(e.bodyWidgets[0]),e.height=n+d),"Footnote"===e.footNoteType&&this.shiftChildWidgetInFootnote(e),"Footnote"===e.footNoteType&&1<e.sectionFormat.columns.length&&1<e.page.bodyWidgets[e.page.bodyWidgets.length-1].sectionFormat.columns.length&&(n=this.getBodyWidget(e.page.bodyWidgets[e.page.bodyWidgets.length-1],!0),this.getNextWidgetHeight(n)>e.y)&&(this.footnoteHeight=e.height,o=this.isLayoutWhole,this.isLayoutWhole=!1,this.layoutMultiColumnBody(n,!0),this.isLayoutWhole=o),this.viewer.clientActiveArea=s,this.viewer.clientArea=a,this.islayoutFootnote||this.viewer.clientActiveArea.y+this.viewer.clientActiveArea.height>e.y&&(this.viewer.clientActiveArea.height-=e.height,n=this.viewer.clientActiveArea.y+this.viewer.clientActiveArea.height-e.y,this.viewer.clientActiveArea.height-=n),"Endnote"===e.footNoteType&&(o=void 0,je(e.page.nextPage)||je(e.page.nextPage.endnoteWidget)?e.page.index!==r&&(o=e):o=e.page.nextPage.endnoteWidget,je(o)||(s=this.getBodyWidget(o.page.bodyWidgets[o.page.bodyWidgets.length-1],!0),this.viewer.updateClientArea(s,s.page),this.layoutfootNote(o)))}return this.footnoteHeight=0,e},psi.prototype.getFootNoteBodyHeight=function(e){for(var t=0;e&&0===e.columnIndex;){for(var i=0;i<e.childWidgets.length;i++)t+=e.childWidgets[i].height;e=e.nextRenderedWidget}return t},psi.prototype.splitFootNoteWidgetBasedOnColumn=function(e){for(var t=this.getCountOrLine(e,void 0,void 0,!0).lineCount,i=Math.round(t/e.sectionFormat.numberOfColumns);e;){var n,o=this.getCountOrLine(e,i,!0,!1),r=this.viewer.clientActiveArea.clone(),s=this.viewer.clientArea.clone();if(0===o.lineWidget.paragraph.indexInOwner&&0===o.lineWidget.indexInOwner?this.updateColumnIndex(o.lineWidget.paragraph.bodyWidget,!0):(this.splitParagraph(o.lineWidget.paragraph,o.lineWidget.indexInOwner,void 0),n=this.moveBlocksToNextPage(o.lineWidget.paragraph.previousRenderedWidget),this.viewer.clientActiveArea=r,this.viewer.clientArea=s,je(n.nextRenderedWidget)||this.updateColumnIndex(n.nextRenderedWidget,!0)),o.lineWidget.paragraph.bodyWidget.columnIndex===o.lineWidget.paragraph.bodyWidget.sectionFormat.numberOfColumns-1)break;e=e.nextRenderedWidget}},psi.prototype.updateColumnIndex=function(e,t){for(;e;)t?e.columnIndex++:e.columnIndex=0,e=e.nextRenderedWidget},psi.prototype.shiftChildWidgetInFootnote=function(e){for(var t,i=e.page,n=e.y-e.height,o=(1===i.bodyWidgets[0].childWidgets.length&&i.bodyWidgets[0].firstChild&&n<(t=i.bodyWidgets[0].firstChild.y)+(i=this.getBodyWidgetHeight(i.bodyWidgets[0]))&&(n=t+i),e.y=n,n+=e.margin.top),r=e.bodyWidgets[0],s=0;s<e.bodyWidgets.length;s++){e.bodyWidgets[s].columnIndex!==r.columnIndex&&(n=o);for(var r=e.bodyWidgets[s],a=0;a<e.bodyWidgets[s].childWidgets.length;a++){var l=e.bodyWidgets[s].childWidgets[a];l instanceof Lai?l.y=n:this.shiftChildLocationForTableWidget(l,n-l.y),n+=l.height}}},psi.prototype.getBodyWidgetHeight=function(e){for(var t=0,i=0;i<e.childWidgets.length;i++)t+=e.childWidgets[i].height;return t},psi.prototype.checkBlockHasField=function(e){if(!(e instanceof Lai))return this.checkTableHasField(e);for(var t=0,i=e.childWidgets;t<i.length;t++)for(var n=0,o=i[t].children;n<o.length;n++){var r=o[n];if(r instanceof Zai&&(2===r.fieldType||1===r.fieldType)&&0<this.documentHelper.fieldStacks.length&&r.fieldBegin===this.documentHelper.fieldStacks[this.documentHelper.fieldStacks.length-1])return!0}return!1},psi.prototype.checkTableHasField=function(e){for(var t=0,i=e.childWidgets;t<i.length;t++)for(var n=0,o=i[t].childWidgets;n<o.length;n++)for(var r=0,s=o[n].childWidgets;r<s.length;r++){var a=s[r];if(this.checkBlockHasField(a))return!0}return!1},psi.prototype.layoutParagraph=function(e,t,i){if(this.isFieldCode&&!this.checkBlockHasField(e))0===e.childWidgets.length&&this.addLineWidget(e),e.isFieldCodeBlock=!0;else if(!(e.isSectionBreak&&e.previousRenderedWidget instanceof _ai&&"Word2013"!==this.documentHelper.compatibilityMode)){e.x=0,e.textWrapWidth=!1,this.addParagraphWidget(this.viewer.clientActiveArea,e);var n=!0;if(this.isFirstElementWithPageBreak(e)||(this.layoutListItems(e,i),n=!1),e.isEmptyInternal(!0)&&!this.checkIsFieldParagraph(e))this.layoutEmptyLineWidget(e,!0);else{var o,r=t<e.childWidgets.length?e.childWidgets[t]:void 0;for(this.isRelayoutOverlap||e.containerWidget instanceof Zli||this.layoutFloatElements(e);r instanceof Gai;)e!==r.paragraph&&0===r.indexInOwner&&n&&(r.previousLine.isEndsWithColumnBreak?(this.viewer.updateClientAreaForBlock(e,!0),this.layoutListItems(r.paragraph),this.viewer.updateClientAreaForBlock(e,!1)):this.layoutListItems(r.paragraph)),r.isFirstLine()&&je(this.fieldBegin)&&(je(e.paragraphFormat)||(o=-Y.convertPointToPixel(e.paragraphFormat.firstLineIndent),this.viewer.updateClientWidth(o))),r.marginTop=0,e=(r=this.layoutLine(r,0)).paragraph,r=r.nextLine}this.updateWidgetToPage(this.viewer,e),e.isLayouted=!0,e.isFieldCodeBlock=!1}return e},psi.prototype.checkIsFieldParagraph=function(e){if(!je(e.childWidgets)&&0!==e.childWidgets.length)for(var t=0;t<e.childWidgets.length;t++)for(var i=e.childWidgets[t],n=0;n<i.children.length;n++){var o=i.children[n];if(o instanceof Zai&&o.hasFieldEnd)return!0}return!1},psi.prototype.clearLineMeasures=function(){this.maxBaseline=0,this.maxTextBaseline=0,this.maxTextHeight=0},psi.prototype.layoutFloatElements=function(e){var t=this;e.floatingElements.forEach(function(e){e instanceof qli&&"Inline"!==e.textWrappingStyle&&(t.isRelayoutOverlap||t.layoutShape(e))})},psi.prototype.layoutShape=function(e){if(!(e instanceof Xli&&e.isHorizontalRule)){"Inline"!==e.textWrappingStyle?(t=this.getFloatingItemPoints(e),e.x=t.x,e.y=t.y,!e.paragraph.isInsideTable&&0!==e.paragraph.indexInOwner&&0<=e.verticalPosition&&Math.round(e.paragraph.y)>=Math.round(e.y)&&this.viewer.clientArea.bottom<=e.y+e.height&&("Line"==e.verticalOrigin||"Paragraph"==e.verticalOrigin)&&"InFrontOfText"!==e.textWrappingStyle&&"Behind"!==e.textWrappingStyle&&(this.moveToNextPage(this.viewer,e.line),this.updateShapeBaseLocation(e.line.paragraph)),-1===(t=e.paragraph.bodyWidget).floatingElements.indexOf(e)&&(t.floatingElements.push(e),t.floatingElements.sort(function(e,t){return e.y-t.y})),-1===e.paragraph.floatingElements.indexOf(e)&&e.paragraph.floatingElements.push(e)):0===e.width&&0!==e.widthScale&&(t=Y.convertPointToPixel(e.line.paragraph.getContainerWidth()),e.width=t/100*e.widthScale);var t=this.viewer.clientArea,i=this.viewer.clientActiveArea;if(e instanceof Xli){var n=e.textFrame.childWidgets;this.viewer.updateClientAreaForTextBoxShape(e,!0);for(var o=0;o<n.length;o++){var r=n[o];this.viewer.updateClientAreaForBlock(r,!0),r instanceof _ai&&this.clearTableWidget(r,!0,!0),this.layoutBlock(r,0),this.viewer.updateClientAreaForBlock(r,!1)}}this.viewer.clientActiveArea=i,this.viewer.clientArea=t}},psi.prototype.moveElementFromNextLine=function(e){var t=e.nextLine;for(t&&!e.paragraph.bodyWidget.sectionFormat.equalWidth&&e.paragraph.bodyWidget.columnIndex!==t.paragraph.bodyWidget.columnIndex&&(t=void 0);t instanceof Gai;){if(0<t.children.length){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}},psi.prototype.layoutLine=function(e,t){var i=e.paragraph,n=(0===e.children.length&&this.moveElementFromNextLine(e),e.children[t]),o=!0;if(n instanceof Zai&&e.children[e.children.length-1]instanceof Zai)for(var o=!1,r=0;r<e.children.length;r++)if(2==e.children[r].fieldType&&null!=e.children[r].nextElement&&!(e.children[r].nextElement instanceof Zai)){o=!0;break}this.clearLineMeasures(),e.marginTop=0;for(i.bodyWidget.indexInOwner,e.indexInOwner;n instanceof Xai;)if(n instanceof lhi||(n.padding.left=0),o?this.layoutElement(n,i):(this.layoutElement(n,i,!0),o=!0),e=n.line,n instanceof pli&&!je((a=n).errorCollection)&&0<a.errorCollection.length&&(a.ischangeDetected=!0),this.isRTLLayout)n=void 0,this.isRTLLayout=!1;else{var s=i.childWidgets.indexOf(n.line);if(0<s&&this.hasFloatingElement)this.hasFloatingElement=!1,0<i.bodyWidget.floatingElements.length&&n instanceof pli&&!(i.containerWidget instanceof Uai)&&(n=i.childWidgets[s].children[0]);else{if(this.hasFloatingElement=!1,!this.is2013Justification||je(this.nextElementToLayout)||!je(n.paragraph.containerWidget.containerShape)&&n.paragraph.containerWidget.containerShape===this.nextElementToLayout){if((n=n.nextElement)instanceof pli&&0==n.text.indexOf(" ")&&2<n.text.length&&je(n.nextElement)&&0<n.text.trim().length){n.text=n.text.substring(1,n.text.length),n.isWidthUpdated=!1;var a,s=n.line.children.indexOf(n);if(n.line.children.splice(s,1),(a=new pli).text=" ",a.line=n.line,a.characterFormat.copyFormat(n.characterFormat),0<n.revisions.length)for(var l=0;l<n.revisions.length;l++){var h=n.revisions[l],d=(a.revisions.push(h),h.range.indexOf(n));d<0?h.range.push(a):h.range.splice(d,0,a)}n.line.children.splice(s,0,a),n.line.children.splice(s+1,0,n),n=a}}else n=this.nextElementToLayout;this.nextElementToLayout=void 0}}return e},psi.prototype.layoutElement=function(e,t,i){if(!((e.isColumnBreak||e.isPageBreak)&&t.isInHeaderFooter||e instanceof Xli&&e.isHorizontalRule)){var n=e.line,o="",r=e.indexInOwner;if(this.viewer.owner.editorModule&&this.viewer.owner.editorHistoryModule&&this.viewer.owner.editorHistoryModule.isRedoing&&!je(e.paragraph.containerWidget.footNoteReference)&&this.viewer.owner.enableTrackChanges&&0<e.removedIds.length&&this.viewer.owner.editorModule.constructRevisionFromID(e,!0),e instanceof Zai)0===e.fieldType&&(-1===this.documentHelper.fields.indexOf(e)&&this.documentHelper.fields.push(e),je(e.formFieldData)||-1!==this.documentHelper.formFields.indexOf(e)||this.isInsertFormField||this.documentHelper.formFields.push(e)),this.layoutFieldCharacters(e),e.line.isLastLine()&&je(e.nextNode)&&!this.isFieldCode?(!je(t.containerWidget)&&0<t.floatingElements.length&&!(t.containerWidget instanceof Zli)&&this.isConsiderAsEmptyLineWidget(e.line)&&this.layoutEmptyLineWidget(t,!1,e.line),this.moveToNextLine(n)):je(e.nextElement)&&0<this.viewer.clientActiveArea.width&&!e.line.isLastLine()?(this.moveElementFromNextLine(n),e.line.isLastLine()&&je(e.nextNode)&&!this.isFieldCode&&(2!==e.fieldType&&je(e.fieldSeparator)&&this.layoutEmptyLineWidget(t,!1,e.line),this.moveToNextLine(n))):je(e.nextElement)&&0===this.viewer.clientActiveArea.width?(this.moveToNextLine(n),n.paragraph.lastChild===n&&!je(n.nextLine)&&0<=this.viewer.clientActiveArea.height&&this.moveFromNextPage(n)):i&&(i=this.documentHelper.textHelper.getHeight(t.characterFormat),e.height=i.Height);else if(e instanceof lhi||this.isFieldCode||e instanceof Dli||e instanceof phi||e instanceof ghi||e instanceof Pli||e instanceof qli&&"Inline"!==e.textWrappingStyle){if(!this.isInitialLoad&&e instanceof Pli&&0===e.type&&"Block"===e.contentControlWidgetType&&!je(e.paragraph)&&e.paragraph.firstChild.children[0]===e&&!je(e.reference)&&!je(e.reference.paragraph)&&e.reference.paragraph.lastChild.children[e.reference.paragraph.lastChild.children.length-1]!==e.reference){e.contentControlWidgetType="Inline",e.reference.contentControlWidgetType="Inline",e.contentControlProperties.contentControlWidgetType="Inline";var s=e.paragraph;for(s===e.reference.paragraph&&e.reference.paragraph.contentControlProperties&&(e.reference.paragraph.contentControlProperties=void 0);s instanceof Lai&&s&&s.contentControlProperties&&s!==e.reference.paragraph;)s.contentControlProperties=void 0,s=s.nextRenderedWidget}if(e instanceof Dli)if(0!==e.bookmarkType||this.documentHelper.bookmarks.containsKey(e.name))if(1===e.bookmarkType&&this.documentHelper.bookmarks.containsKey(e.name)){var i=this.documentHelper.bookmarks.get(e.name);if((je(i.reference)||je(i.reference.paragraph)||je(i.reference.paragraph.bodyWidget))&&((i.reference=e).reference=i),je(i.properties))je(this.documentHelper.selection)||je(w=i.reference.paragraph.associatedCell)||(w.isRenderBookmarkEnd=!1,this.documentHelper.selection.isRenderBookmarkAtEnd(i.reference)&&(w.isRenderBookmarkEnd=!0));else if(!je(e.paragraph.associatedCell)){var a=this.documentHelper.selection.getLastParagraph(e.paragraph.associatedCell).lastChild;if(!je(a))if(a.children[a.children.length-1]==e){for(var i=parseInt(e.reference.properties.columnLast),l=e.paragraph.associatedCell.ownerRow,h=void 0,d=i;je(h)&&-1<d;)je(h=l.getCellUsingColumnIndex(l.rowIndex,d))&&d--;je(h)||(l.isRenderBookmarkEnd=!0)}}}else 0===e.bookmarkType&&this.documentHelper.bookmarks.containsKey(e.name)&&(je(e.reference)&&this.documentHelper.bookmarks.remove(e.name),je(e.properties)||(b=parseInt(e.properties.columnFirst),e.paragraph.isInsideTable&&!je(w=(p=e.paragraph.associatedCell.ownerRow).getCellUsingColumnIndex(p.rowIndex,b))&&(w.isRenderBookmarkStart=!0)));else this.documentHelper.bookmarks.add(e.name,e),je(e.properties)||(b=parseInt(e.properties.columnFirst),e.paragraph.isInsideTable&&!je(w=(p=e.paragraph.associatedCell.ownerRow).getCellUsingColumnIndex(p.rowIndex,b))&&(w.isRenderBookmarkStart=!0));if(e instanceof ghi||e instanceof phi)if(e instanceof ghi&&(i=""!==e.user?e.user:e.group,this.documentHelper.editRanges.containsKey(i)?-1===(b=this.documentHelper.editRanges.get(i)).indexOf(e)&&b.push(e):((b=[]).push(e),this.documentHelper.editRanges.add(i,b))),e instanceof ghi&&(this.documentHelper.owner.currentUser===e.user||"Everyone"===e.group&&""===e.user))-1==e.columnFirst||-1==e.columnLast||je(w=(p=e.paragraph.associatedCell.ownerRow).getCellUsingColumnIndex(p.rowIndex,e.columnFirst))||(w.isRenderEditRangeStart=!0,p.editRangeID.add(e.editRangeId,e));else if(e instanceof phi&&(this.documentHelper.owner.currentUser===e.editRangeStart.user||"Everyone"===e.editRangeStart.group&&""===e.editRangeStart.user)&&-1!=e.editRangeStart.columnFirst&&-1!=e.editRangeStart.columnLast){var p=e.paragraph.associatedCell.ownerRow;if(p.editRangeID.containsKey(e.editRangeStart.editRangeId))je(w=p.getCellUsingColumnIndex(p.rowIndex,e.editRangeStart.columnFirst))||w.isRenderEditRangeStart&&(w.isRenderEditRangeEnd=!0);else for(var c=e.paragraph.associatedCell.ownerTable,u=p.rowIndex-1;0<=u;u--){var g=c.childWidgets[u];if(g.editRangeID.containsKey(e.editRangeStart.editRangeId)){g=g.getCellUsingColumnIndex(g.rowIndex,e.editRangeStart.columnFirst);if(!je(g)&&g.isRenderEditRangeStart){g.isRenderEditRangeEnd=!0;break}}}}if(e instanceof qli&&"Inline"!==e.textWrappingStyle&&-1==t.floatingElements.indexOf(e)&&e instanceof Xli&&(-1===t.floatingElements.indexOf(e)&&t.floatingElements.push(e),-1===t.bodyWidget.floatingElements.indexOf(e))&&t.bodyWidget.floatingElements.push(e),e instanceof Pli&&-1===this.documentHelper.contentControlCollection.indexOf(e)){if(0===e.type)this.isInitialLoad?this.documentHelper.contentControlCollection.push(e):this.documentHelper.owner.editorModule.insertContentControlInCollection(e);else if(1===e.type)for(var m=e.paragraph.bodyWidget.page,u=0;u<this.documentHelper.contentControlCollection.length;u++){var f=this.documentHelper.contentControlCollection[u],y=f.line.paragraph.isInHeaderFooter;(!y||e.contentControlProperties!==f.contentControlProperties||m!==f.line.paragraph.bodyWidget.page)&&(y||e.contentControlProperties!==f.contentControlProperties)||((e.reference=f).reference=e)}e instanceof Pli&&0<t.bodyWidget.floatingElements.length&&this.adjustPosition(e,e.line.paragraph.bodyWidget)}je(e.nextElement)&&0<this.viewer.clientActiveArea.width&&!e.line.isLastLine()&&this.moveElementFromNextLine(n),e.line.isLastLine()&&je(e.nextElement)&&((!this.hasValidElement(n.paragraph)||t.isContainsShapeAlone())&&(this.isInitialLoad||this.hasValidElement(n.paragraph)||!n.paragraph.paragraphFormat.bidi||-1===n.paragraph.paragraphFormat.listFormat.listId)?this.layoutEmptyLineWidget(n.paragraph,!1,n,!1):this.moveToNextLine(n))}else{e instanceof pli&&"NoColor"!=e.characterFormat.highlightColor&&""!=e.text.trim()&&e.text!=e.text.trim()&&(i=t.firstChild,a=t.lastChild,!je(i)&&i instanceof Gai&&0<i.children.length&&e===i.children[0]&&Y.splitSpaceInTextElementBox(e,!0),!je(a))&&a instanceof Gai&&0<a.children.length&&e===a.children[a.children.length-1]&&Y.splitSpaceInTextElementBox(e,!1);var v,b=e.width,w=(e instanceof Sli&&!this.isTocField(e.fieldBegin)?""!==(o=this.documentHelper.getFieldResult(e.fieldBegin,e.paragraph.bodyWidget.page))?e.text=o:o=e.text:e instanceof fli?""!==(o=this.startAt(e,o))&&(e.text=o):e instanceof pli&&(!je(e.paragraph.containerWidget.footNoteReference)&&e.line.isFirstLine()&&0===e.paragraph.index&&0===e.indexInOwner&&!this.documentHelper.owner.editorModule.handledEnter&&e instanceof mdi&&(e.text=e.paragraph.containerWidget.footNoteReference.text),this.checkAndSplitTabOrLineBreakCharacter(e.text,e),o=e.text),e instanceof pli&&(!e.isWidthUpdated||0===e.width||this.isInitialLoad||this.viewer.owner.editorModule&&this.viewer.owner.editorModule.isMeasureParaWidth?(b=this.documentHelper.textHelper.getTextSize(e,e.characterFormat),e.isWidthUpdated=!0):b=e.trimEndWidth,"\t"===e.text?(b=this.getTabWidth(t,this.viewer,r,n,e),e.width=b):e.text!==String.fromCharCode(31)&&e.text!==String.fromCharCode(14)||(e.width=b=0)),je(t.containerWidget)||!(0<t.bodyWidget.floatingElements.length)||e instanceof Xli&&"Inline"==e.textWrappingStyle||t.containerWidget instanceof Zli||e instanceof Khi||t.containerWidget instanceof Uai&&t.containerWidget.ownerTable.containerWidget instanceof Zli||(this.adjustPosition(e,e.line.paragraph.bodyWidget),t.textWrapWidth&&(t.x-=e.padding.left,t.textWrapWidth=!1)),n.isFirstLine()&&0===e.indexInOwner?this.getBeforeSpacing(t):0);if(this.viewer instanceof nai&&(e instanceof Xli&&"Inline"===e.textWrappingStyle||!(e instanceof Xli))&&this.viewer.clientActiveArea.height<w+e.height&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y&&(!(e instanceof pli&&("\f"!==e.text&&e.text!==String.fromCharCode(14)||"\f"===e.text&&t.isPageBreak()&&"Word2013"===this.documentHelper.compatibilityMode))&&e instanceof pli||this.moveToNextPage(this.viewer,n),e instanceof Sli&&this.updateFieldText(e),!e.previousElement||!(e.previousElement instanceof Xli&&"Inline"===e.previousElement.textWrappingStyle)&&e.previousElement instanceof Xli||this.cutClientWidth(e.previousElement,void 0,e instanceof pli&&"\f"===e.text)),e instanceof Xli&&"Inline"===e.textWrappingStyle&&(-1===t.floatingElements.indexOf(e)&&t.floatingElements.push(e),e.width>this.viewer.clientActiveArea.width&&(this.splitElementForClientArea(t,e),this.checkLineWidgetWithClientArea(n,e)),p=this.is2013Justification,this.layoutShape(e),this.is2013Justification=p),e instanceof fli&&(!e.isLayout||this.isLayoutWhole)&&"Pages"===this.documentHelper.owner.layoutType&&this.layoutFootEndNoteElement(e),e instanceof fli&&(this.isfootMove&&(this.moveToNextPage(this.viewer,e.line),!e.previousElement||!(e.previousElement instanceof Xli&&"Inline"===e.previousElement.textWrappingStyle)&&e.previousElement instanceof Xli||this.cutClientWidth(e.previousElement),this.isfootMove=!1),t.paragraphFormat.keepWithNext)&&t.paragraphFormat.keepLinesTogether&&e.isLayout&&!this.isLayoutWhole&&!je(t.bodyWidget.page.footnoteWidget)&&0!==t.bodyWidget.page.footnoteWidget.y&&t.bodyWidget.page.footnoteWidget.y<this.viewer.clientActiveArea.y+this.viewer.clientActiveArea.height&&(i=this.viewer.clientActiveArea.y+this.viewer.clientActiveArea.height-t.bodyWidget.page.footnoteWidget.y,this.viewer.clientActiveArea.height-=i),parseFloat(b.toFixed(4))<=parseFloat(this.viewer.clientActiveArea.width.toFixed(4))||!this.viewer.textWrap)this.addElementToLine(t,e),je(e.nextElement)&&!e.line.isLastLine()&&(a=e.line.nextLine.children[0])instanceof pli&&0==a.text.indexOf(" ")&&this.moveElementFromNextLine(n),je(e.nextElement)&&0<this.viewer.clientActiveArea.width&&!e.line.isLastLine()?this.moveElementFromNextLine(n):!e.line.isLastLine()&&je(e.nextElement)&&0===this.viewer.clientActiveArea.width&&(this.moveToNextLine(n),n.paragraph.lastChild===n)&&0<=this.viewer.clientActiveArea.height&&this.moveFromNextPage(n);else if(e instanceof pli){if("\t"===e.text){w=e.line,p=!1;if(0!==e.indexInOwner&&e instanceof Ili?(p=!0,this.addSplittedLineWidget(w,w.children.indexOf(e)-1)):(this.isWrapText&&this.viewer.clientActiveArea.x+this.viewer.clientActiveArea.width===this.viewer.clientActiveArea.right&&(this.isWrapText=!1),this.addSplittedLineWidget(w,w.children.indexOf(e))),this.moveToNextLine(w),0<w.paragraph.bodyWidget.floatingElements.length&&p)return this.nextElementToLayout=e,void(this.hasFloatingElement=!0);e.width=this.getTabWidth(t,this.viewer,r,e.line,e),p&&(this.addElementToLine(t,e),je(e.nextElement))&&0<this.viewer.clientActiveArea.width&&!e.line.isLastLine()&&this.moveElementFromNextLine(e.line)}else do{if(n=e.line,e.previousElement instanceof Zai&&2==e.previousElement.fieldType&&!je(e.previousElement.fieldBeginInternal)&&e.previousElement.fieldBeginInternal.formFieldData instanceof lli||this.splitTextForClientArea(n,e,e.text,e.trimEndWidth,e.characterFormat),this.checkLineWidgetWithClientArea(n,e),e instanceof Sli&&!this.isInitialLoad&&this.updateFieldText(e),e.line!==n&&!je(this.nextElementToLayout)&&this.is2013Justification)return}while(e.line!==n&&this.cutClientWidth(e))}else for(;n=e.line,this.splitElementForClientArea(t,e),this.checkLineWidgetWithClientArea(n,e),e instanceof Sli&&this.updateFieldText(e),e.line!==n&&this.cutClientWidth(e,!0););if(!je(e.nextNode)&&e.nextNode instanceof Pli&&(v=e.nextNode),"\v"!==o&&"\f"!==o&&"\r"!==o&&o!==String.fromCharCode(14)||v||-1<(i=n.children.indexOf(e))&&this.addSplittedLineWidget(n,i),e.line.isLastLine()&&je(e.nextElement)||"\v"===o||"\f"===o||"\r"===o||o===String.fromCharCode(14)){if(this.isXPositionUpdated)return void(this.isXPositionUpdated=!1);this.moveToNextLine(e.line),"\v"===o&&je(e.nextNode)?this.layoutEmptyLineWidget(t,!0,n,!0):"\f"!==o&&o!==String.fromCharCode(14)||!(this.viewer instanceof nai)||e.line.paragraph.containerWidget instanceof Uai||(b=this.isRTLLayout,this.isRTLLayout=!1,je(e.nextNode)||e.nextNode instanceof Pli?o===String.fromCharCode(14)?(this.moveToNextPage(this.viewer,e.line.nextLine,!1),this.layoutEmptyLineWidget(e.line.nextLine.paragraph,!1,e.line.nextLine,!0)):(a=t.nextWidget,"\f"===o&&a instanceof Lai&&a.isSectionBreak||this.moveToNextPage(this.viewer,e.line,!0)):je(e.line.nextLine)||this.moveToNextPage(this.viewer,e.line.nextLine,!1),this.isRTLLayout=b)}this.isXPositionUpdated=!1}}},psi.prototype.adjustPosition=function(e,t){var i=this.viewer.clientActiveArea,n=this.viewer.clientActiveArea.x,o=this.viewer.clientActiveArea.y,r=this.viewer.clientActiveArea.width,i=this.adjustClientAreaBasedOnTextWrap(e,new pai(i.x,i.y,i.width,i.height)),i=(this.viewer.clientActiveArea.width=i.width,this.viewer.clientActiveArea.x-n);e.line.isFirstLine()&&this.getFirstElement(e.line)===e&&0<i&&!this.isSkipFirstLineIndent&&(n=e.line.paragraph.paragraphFormat.firstLineIndent,i+=Y.convertPointToPixel(0<n?n:0)),this.isSkipFirstLineIndent=!1,e.padding.left=0<i?i:0,r!==this.viewer.clientActiveArea.width&&(n=new Lri(this.viewer.clientActiveArea.x,this.viewer.clientActiveArea.width),this.updateWrapPosition(n)),0===this.viewer.clientActiveArea.width&&(this.isWrapText=!1),this.isYPositionUpdated&&(e.line.isFirstLine()?(je(e.line.paragraph.associatedCell)||(je(i=e.line.paragraph.previousRenderedWidget)?e.line.paragraph.associatedCell.height+=this.viewer.clientActiveArea.y-o:e.line.paragraph.associatedCell.height+=this.viewer.clientActiveArea.y-i.y+i.height),e.line.paragraph.y=this.viewer.clientActiveArea.y):e.line.children[0]===e&&(e.line.marginTop+=this.viewer.clientActiveArea.y-o),e.line.paragraph.containerWidget instanceof Iai&&(e.line.paragraph.containerWidget.height+=this.viewer.clientActiveArea.y-o),e instanceof lhi||(this.isYPositionUpdated=!1))},psi.prototype.getFirstElement=function(e){for(var t=0;t<e.children.length;t++){var i=e.children[t];if(!(i instanceof qli&&"Inline"!==i.textWrappingStyle))return i}},psi.prototype.updateWrapPosition=function(e){for(var t=0;t<this.wrapPosition.length;t++){var i=this.wrapPosition[t];if(!(1<Math.abs(i.right-e.right)))return}this.wrapPosition.push(e)},psi.prototype.isFirstitemInPage=function(e,t){return!e.line.paragraph.isInHeaderFooter&&Math.round(t)===this.viewer.clientArea.y},psi.prototype.isTextFitBelow=function(e,t,i){return!1},psi.prototype.isNeedToWrapForTopAndBottom=function(e,t,i,n,o,r,s,a,l,h,d,p,c){if(e.isInsideTable&&"TopAndBottom"===o&&!(l instanceof _ai)){var u=l.paragraph;if(!je(u)&&!je(u.associatedCell)){var g=u.isInsideTable,u=u.associatedCell,e=e.associatedCell;if(!je(u)&&!je(e)&&u!==e||!g&&"Word2013"!==this.documentHelper.compatibilityMode)return!1}}return i!==a&&n!==a&&"TopAndBottom"===o&&(d.y>=r.y&&d.y<r.bottom||(d.y+c>r.y||this.isTextFitBelow(r,d.y+c,l))&&d.y+c<r.bottom||d.y<r.y&&d.y+c>r.bottom&&0<r.height)&&!(s&&(h||t instanceof rhi&&"Inline"!==t.textWrappingStyle&&t.allowOverlap))},psi.prototype.isNeedToWrapForSquareTightAndThrough=function(e,t,i,n,o,r,s,a,l,h,d,p,c){return 0<e.floatingElements.length&&i!==a&&n!==a&&"Inline"!==o&&"Behind"!==o&&"TopAndBottom"!==o&&"InFrontOfText"!==o&&(Math.round(d.y+c)>Math.round(r.y)||this.isTextFitBelow(r,d.y+c,l))&&Math.round(d.y)<Math.round(r.y+r.height)&&!(s&&(h||t instanceof rhi&&"Inline"!==t.textWrappingStyle&&t.allowOverlap))},psi.prototype.isNeedToWrapForSquareTightAndThroughForTable=function(e,t,i,n,o,r,s,a,l,h,d,p,c){return 0<e.floatingElements.length&&i!==a&&n!==a&&"Inline"!==o&&"Behind"!==o&&"TopAndBottom"!==o&&"InFrontOfText"!==o&&(Math.round(d.y+c)>=Math.round(r.y)&&Math.round(d.y)<Math.round(r.bottom)||Math.round(d.y+c)<=Math.round(r.bottom)&&Math.round(d.y+c)>=Math.round(r.y))&&!(s&&h)},psi.prototype.isNeedToWrapLeafWidget=function(e,t){return 0<e.bodyWidget.floatingElements.length&&!(t instanceof qli&&("InFrontOfText"===t.textWrappingStyle||"Behind"===t.textWrappingStyle))},psi.prototype.getMinWidth=function(e,t,i,n){var o=e.text,r=o.split(" "),o=(""!==o&&""===o.trim()&&e&&e.line.paragraph&&e.previousNode&&e.nextNode&&e.line.paragraph.isEmpty&&(r=[""]),this.documentHelper.textHelper.measureText(r[0],e.characterFormat,e.scriptType).Width),e=this.getNextSibling(e);return 1===r.length&&e&&(r=e.text,o+=this.getNextTextRangeWidth(e,r,t,i,n)),o},psi.prototype.getNextTextRangeWidth=function(e,t,i,n,o){for(var r=e,s=new pai(0,0,0,0),a=this.isNextSibligSizeNeedToBeMeasure(s,e,o,i,n);a&&this.isLeafWidgetNextSiblingIsTextRange(r)&&i+s.width<o.width&&(r=this.getNextSibling(r),this.isNextSibligSizeNeedToBeMeasure(s,r,o,i,n));)r.text;return s.width},psi.prototype.isLeafWidgetNextSiblingIsTextRange=function(e){e=this.getNextSibling(e);return!!(e&&e instanceof pli)},psi.prototype.isNextSibligSizeNeedToBeMeasure=function(e,t,i,n,o){var r,s=null;if(t){if(-1!==(s=t.text).indexOf(" ")||-1!==s.indexOf("-")||-1!==s.indexOf("_")&&n+e.width+this.documentHelper.textHelper.measureText(s.split("-")[0],t.characterFormat,t.scriptType).Width<i.width||"\t"===t.text)return r=t.width,s!==s.split(" ")[0]&&(r=this.documentHelper.textHelper.measureText(s.split(" ")[0],t.characterFormat,t.scriptType).Width),n+e.width+r>i.width&&s.indexOf("-")&&s!==s.split("-")[0]+"-"&&(r=this.documentHelper.textHelper.measureText(s.split("-")[0]+"-",t.characterFormat,t.scriptType).Width),e.width+=r,!1;0<t.text.length&&(n=this.documentHelper.textHelper.measureText(t.text,t.characterFormat,t.scriptType),e.height+=n.Height,e.width+=n.Width)}return!0},psi.prototype.isNeedDoIntermediateWrapping=function(e,t,i,n,o,r,s,a,l){return l<e&&((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(r.x-o.x+o.leftIndent)<l||s instanceof pli&&this.isFloatingItemOnLeft(i,a,r))&&("Left"!==t||e<l)},psi.prototype.isFloatingItemOnLeft=function(e,t,i){return!1},psi.prototype.getNextSibling=function(e){for(var t=e.nextNode,i=!1;t;){if(t instanceof Zai||t instanceof Dli||i||t instanceof lhi)t instanceof Zai&&(0===t.fieldType?i=!0:2===t.fieldType&&(i=!1));else if(t instanceof pli)break;t=t.nextNode}return t},psi.prototype.adjustClientAreaBasedOnTextWrap=function(e,t){var i=e.line.paragraph,n=i.bodyWidget,o=this.viewer,r=t.y;this.isFirstitemInPage(e,r),je(i.previousWidget);if(this.isNeedToWrapLeafWidget(i,e)){var s=o.clientArea;n.floatingElements.sort(function(e,t){return e.y-t.y}),n.floatingElements.sort(function(e,t){return e.x-t.x});for(var a=0;a<n.floatingElements.length;a++){var l,h,d,p,c,u,g,m,f,y,v,b,w,C,S,A,x,I,T,E,D=n.floatingElements[a],M=!1,M=(D instanceof qli?D:D.positioning).allowOverlap;i.isInsideTable&&D instanceof _ai&&!D.isInsideTable||this.isRelayout&&!this.isRelayoutOverlap&&this.viewer.documentHelper.selection.isExistAfter(D instanceof _ai?D:D.line.paragraph,e.line.paragraph)||this.isRelayout&&this.isRelayoutOverlap&&this.viewer.documentHelper.selection.isExistAfter(D instanceof _ai?D:D.line.paragraph,this.endOverlapWidget)||(D.x,l=c=d=p=h=0,D instanceof qli?(h=D.distanceLeft,p=D.distanceTop,d=D.distanceRight,c=D.distanceBottom,l=D.width):(l=D.getTableCellWidth(),h=D.positioning.distanceLeft,p=D.positioning.distanceTop,d=D.positioning.distanceRight,c=D.positioning.distanceBottom),l=new pai(D.x-h,D.y-p,l+h+d,D.height+p+c),h=D instanceof _ai?"Square":D.textWrappingStyle,d=D instanceof _ai?"Both":D.textWrappingType,o.clientArea.y,D.height,s.x>l.right+(p=24))||s.right<l.x-p||(this.isNeedToWrapForSquareTightAndThrough(n,e,-1,-1,h,l,M,1,D,!1,t,e.width,e.height)?(E=u=c=0,g=Y.convertPointToPixel(e.paragraph.paragraphFormat.firstLineIndent),A=Y.convertPointToPixel(i.paragraphFormat.leftIndent),v=Y.convertPointToPixel(i.paragraphFormat.rightIndent),g=0===e.indexInOwner&&e.line.isFirstLine()&&0<g?g:0,m=e instanceof pli||e instanceof lhi?e:null,f=(D instanceof _ai?D:D.line.paragraph).containerWidget,I=!1,e.line.paragraph&&(t.x>=l.x&&"Left"!==d&&(c=v),t.x<l.x&&"Right"!==d&&(u=A),v=i.paragraphFormat.listFormat,y=this.getListLevel(v.list,v.listLevelNumber),t.x===s.x+A)&&v&&v.baseStyle&&y&&0!==y.paragraphFormat.leftIndent&&(E=A,I=!0),v=!1,b=void(y=0),w=void(S=0),D instanceof _ai&&(w=(b=D).positioning.horizontalAlignment,y=this.getMaximumRightCellBorderWidth(D),v=this.getDefaultBorderSpacingValue(y,v,w),S=D.tableFormat.borders.left.lineWidth/2),t.x+S>=l.x&&t.x<l.right&&"Left"!==d?(t.width=t.width-(l.right-t.x)-c,this.isWrapText=!0,je(b)||(p=this.getMinimumWidthRequiredForTable(v,w,y)),Math.round(t.width)<p||t.width<e.width&&"\t"===e.text||l.x<i.x+A?(t.width=this.viewer.clientArea.right-l.right-(I?E:0),x=0,x=je(m)?e.width:this.getMinWidth(e,e.width,e.height,t),Math.round(t.width)<p||t.width<x?(l.x-(i.x+i.leftIndent)>p&&this.viewer.clientArea.right-l.right>p?t.width=0:(this.isYPositionUpdated=!(T=0),t.width=this.viewer.clientArea.width,t.height-=l.bottom+T-t.y,t.y=l.bottom+T),this.viewer.updateClientAreaForTextWrap(t),this.isWrapText=!1):(C=t.x,t.x=l.right+(I?E:0)+g,t.width-=g,this.isSkipFirstLineIndent=!0,"Square"===h&&t.width<0&&0<e.width&&(this.isYPositionUpdated=!(T=0),t.width=this.viewer.clientArea.width,t.height-=l.bottom+T-t.y,t.y=l.bottom+T,t.x=C),this.viewer.updateClientAreaForTextWrap(t))):(C=t.x,t.x=l.right+(I?E:0)+g,t.width=this.viewer.clientArea.right-l.right-(I?E:0)-g,this.isSkipFirstLineIndent=!0,"Square"===h&&t.width<0&&0<e.width&&(this.isYPositionUpdated=!(T=0),t.width=this.viewer.clientArea.width,t.height-=l.bottom+T-t.y,t.y=l.bottom+T,t.x=C),this.isWrapText=!0,this.viewer.updateClientAreaForTextWrap(t))):l.x>=t.x&&t.right>l.x&&(t.width=l.x-t.x-c,S=0<(S=this.viewer.clientArea.right-l.right)?S:0,A=!(this.isWrapText=!0),x=0,x=je(m)?e.width:this.getMinWidth(m,e.width,e.height,t),je(b)||(p=this.getMinimumWidthRequiredForTable(v,w,y)),this.isNeedDoIntermediateWrapping(S,d,t,e.width,e.paragraph,l,e,x,p)?(t.width=S,this.isWrapText=!0,(t.x+x>l.x||"Right"===d||s.x>l.x-24)&&(t.x=l.right,t.width>x||"Right"===d?this.viewer.updateClientAreaForTextWrap(t):t.width<x&&e.line.children[0]!==e&&"Both"===d&&D instanceof qli&&(this.viewer.updateClientAreaForTextWrap(t),A=!0)),(t.width<p&&!(x<S&&"Tight"===h)||t.width<x&&Math.round(t.right)===Math.round(this.viewer.clientArea.right)&&"Both"===d)&&(I=l,Math.round(t.x)===Math.round(n.sectionFormat.leftMargin+i.paragraphFormat.leftIndent)?(t.y=I.bottom+(T=0),this.isYPositionUpdated=!0,t.width=this.viewer.clientArea.width,t.height=t.height-(I.height+T),this.viewer.updateClientAreaForTextWrap(t),this.isWrapText=!1):!A&&Math.round(t.right)>=Math.round(this.viewer.clientArea.right)&&"Both"===d?(t.y=I.bottom+(T=0),t.width=this.viewer.clientArea.width,t.height=t.height-(I.height+T),t.x=this.viewer.clientArea.x+u,this.viewer.updateClientAreaForTextWrap(t),this.isYPositionUpdated=!0,this.isWrapText=!1):(t.width=0,this.viewer.updateClientAreaForTextWrap(t)))):((e.line.isFirstLine()&&0===e.indexInOwner||0==S&&e.line.children[0]===e)&&"Square"===h&&Math.round(t.width)<=Math.round(x)&&i.containerWidget===f?(t.x=s.x,t.y=l.bottom,t.width=s.width,t.height-=l.bottom-t.y,this.isYPositionUpdated=!0):Math.round(t.width)<=Math.round(x)&&Math.round(t.x-u)!==Math.round(this.viewer.clientArea.x)&&(t.width=0),this.viewer.updateClientAreaForTextWrap(t))),"Both"!==d&&(this.isWrapText=!1)):this.isNeedToWrapForTopAndBottom(i,e,-1,-1,h,l,M,1,D,!1,t,e.width,e.height)&&(E=t.y,t.y=l.bottom+(T=0),this.isYPositionUpdated=!0,t.height=t.height-(l.bottom-E+T),t.y!==r&&e instanceof pli&&!(D instanceof _ai)&&e.line.isFirstLine()&&(t.y+=e.margin.top,r=t.y),this.viewer.updateClientAreaForTextWrap(t)))}}return t},psi.prototype.adjustClientAreaBasedOnTextWrapForTable=function(e,t){if(!je(e.containerWidget)&&!je(e.bodyWidget)){var i=e.bodyWidget,n=this.viewer;t.y,je(e.previousWidget);if(0<i.floatingElements.length){var o=n.clientActiveArea;i.floatingElements.sort(function(e,t){return e.y-t.y}),i.floatingElements.sort(function(e,t){return e.x-t.x});for(var r=0;r<i.floatingElements.length;r++){var s,a,l,h,d,p,c,u,g=i.floatingElements[r],m=!1,m=(g instanceof qli?g:g.positioning).allowOverlap;e.isInsideTable&&g instanceof _ai&&!g.isInsideTable||g instanceof _ai&&g.wrapTextAround&&g.positioning.allowOverlap&&e.wrapTextAround&&e.positioning.allowOverlap||(s=e.getTableCellWidth(),l=((a=g instanceof qli)?g:g.positioning).distanceLeft,d=(a?g:g.positioning).distanceTop,h=(a?g:g.positioning).distanceRight,p=(a?g:g.positioning).distanceBottom,a=a?g.width:g.getTableCellWidth(),a=new pai(g.x-l,g.y-d,a+l+h,g.height+d+p),l=g instanceof _ai?"Square":g.textWrappingStyle,h=g instanceof _ai?"Both":g.textWrappingType,d=0<e.childWidgets.length?e.childWidgets[0].rowFormat.height:0,p=this.getNestedTable(e).firstChild.firstChild.firstChild.characterFormat,d<(p=this.documentHelper.textHelper.measureText(" ",p)).Height&&(d=p.Height),o.x>a.right+24)||o.right<a.x-24||!this.isNeedToWrapForSquareTightAndThroughForTable(i,e,-1,-1,l,a,m,1,g,!1,t,s,d)||this.isRelayout&&g instanceof _ai&&"Paragraph"===g.positioning.verticalOrigin&&e.index<g.index||t.x>=a.x&&t.x<a.right&&"Left"!==h&&(t.width=t.width-(a.right-t.x),this.isWrapText=!0,Math.round(t.width)<24||t.width<s||a.x<e.x?(t.width=this.viewer.clientArea.right-a.right,p=s,Math.round(t.width)<24||t.width<p?(24<a.x-e.x&&24<this.viewer.clientArea.right-a.right?t.width=0:(this.isYPositionUpdated=!(u=0),t.width=this.viewer.clientArea.width,t.height-=a.bottom+u-t.y,t.y=a.bottom+u),this.viewer.updateClientAreaForTextWrap(t),this.isWrapText=!1):(c=t.x,t.x=a.right,"Square"===l&&t.width<0&&0<s&&(this.isYPositionUpdated=!0,t.height-=a.bottom+0-t.y,t.width=this.viewer.clientArea.width,t.y=a.bottom+0,t.x=c),this.viewer.updateClientAreaForTextWrap(t))):(c=t.x,t.x=a.right+e.firstChild.firstChild.leftMargin,t.width=this.viewer.clientArea.right-a.right,"Square"===l&&t.width<0&&0<s&&(this.isYPositionUpdated=!(u=0),t.width=this.viewer.clientArea.width,t.height-=a.bottom+u-t.y,t.y=a.bottom+u,t.x=c),this.viewer.updateClientAreaForTextWrap(t)))}}}return t},psi.prototype.getNestedTable=function(e){for(var t=e;t.firstChild.firstChild.firstChild instanceof _ai;)t=t.firstChild.firstChild.firstChild;return t},psi.prototype.startAt=function(e,t){return"Footnote"===e.footnoteType?(this.startat=e.paragraph.bodyWidget.sectionFormat.initialFootNoteNumber,this.getFootEndNote(e.paragraph.bodyWidget.sectionFormat.footNoteNumberFormat,this.documentHelper.footnoteCollection.indexOf(e)+this.startat)):(this.startat=e.paragraph.bodyWidget.sectionFormat.initialEndNoteNumber,this.getFootEndNote(e.paragraph.bodyWidget.sectionFormat.endnoteNumberFormat,this.documentHelper.endnoteCollection.indexOf(e)+this.startat))},psi.prototype.layoutFootEndNoteElement=function(e){var t,i=!(this.isFootnoteContentChanged=!0),n=this.documentHelper.footnoteCollection.indexOf(e),o=1,r=(this.islayoutFootnote=!0,new pai(this.viewer.clientArea.x,this.viewer.clientArea.y,this.viewer.clientArea.width,this.viewer.clientArea.height)),s=new pai(this.viewer.clientActiveArea.x,this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.width,this.viewer.clientActiveArea.height),a=e.paragraph.bodyWidget,l=!1,h=0;if(a.page.footnoteWidget)for(var d=0;d<a.page.footnoteWidget.bodyWidgets.length;d++){var o=a.page.footnoteWidget.bodyWidgets.length,p=this.documentHelper.footnoteCollection.indexOf(a.page.footnoteWidget.bodyWidgets[d].footNoteReference);if(n<p&&p-n==1){o=d,i=!0;break}}if(e.isLayout=!0,"Footnote"===e.footnoteType){a.page.footnoteWidget&&a.page.footnoteWidget instanceof Pai?t=a.page.footnoteWidget:(l=!0,(t=new Pai).footNoteType="Footnote",t.page=a.page,(g=new Lai).characterFormat=new Eri,g.paragraphFormat=new bri,g.index=0,c=new Gai(g),g.childWidgets.push(c),h=this.documentHelper.textHelper.getParagraphMarkSize(g.characterFormat).Height,t.margin=new gai(0,h,0,0)),this.isFootNoteLayoutStart=!0,l&&(a.page.footnoteWidget=t);var c,u=e.bodyWidget;this.viewer.updateClientArea(t,t.page),this.viewer.clientArea.y=r.y,this.viewer.clientActiveArea.y=s.y;for(var g,m=0;m<e.bodyWidget.childWidgets.length;m++){var f=e.bodyWidget.childWidgets[m];(f.containerWidget=u).page=a.page,u.sectionFormat=t.sectionFormat,f.containerWidget.containerWidget=t,this.viewer.updateClientAreaForBlock(f,!0),f instanceof _ai&&this.clearTableWidget(f,!0,!0),this.layoutBlock(f,0),h+=f.height,f.y=0,this.viewer.updateClientAreaForBlock(f,!1),u.height+=f.height}1<t.sectionFormat.columns.length&&!(0===t.bodyWidgets.length&&u.childWidgets.length<=1&&u.childWidgets[0].childWidgets.length<=1)&&(h/=t.sectionFormat.numberOfColumns),c=this.isFootNoteLayoutStart=!1,h>=s.height&&(this.isfootMove=!0),i?t.bodyWidgets.splice(o,0,u):t.bodyWidgets.push(u),e.line.paragraph.isInsideTable&&(je((g=this.getParentTable(e.line.paragraph.associatedCell.ownerTable)).footnoteElement)&&(g.footnoteElement=[]),-1==g.footnoteElement.indexOf(e))&&(g.footnoteElement.push(e),this.layoutedFootnoteElement.push(e),-1==(l=e.line.paragraph.containerWidget.ownerTable).footnoteElement.indexOf(e))&&l.footnoteElement.push(e),t.height+=h,c=!0,this.viewer.clientActiveArea=s,this.viewer.clientActiveArea.height-=h,this.footnoteHeight+=h,this.viewer.clientArea=r}return c},psi.prototype.layoutEndNoteElement=function(){var e=this.documentHelper.pages.length;if(0<this.documentHelper.endnoteCollection.length){var t,i=void 0,n=void 0,e=this.documentHelper.pages[e-1],o=e.bodyWidgets[0],e=e.bodyWidgets[e.bodyWidgets.length-1];this.viewer instanceof nai&&1<e.sectionFormat.numberOfColumns&&(e=this.getBodyWidget(e,!0),this.splitBodyWidgetBasedOnColumn(e));for(var r=0;r<this.documentHelper.endnoteCollection.length;r++){t=this.documentHelper.endnoteCollection[r],o.page.endnoteWidget instanceof Pai&&"Endnote"===o.page.endnoteWidget.footNoteType?i=o.page.endnoteWidget:(n=!0,(i=new Pai).footNoteType="Endnote",i.page=o.page);var s=t.bodyWidget;s.page=i.page;for(var a=0;a<t.bodyWidget.childWidgets.length;a++){var l=t.bodyWidget.childWidgets[a];l.containerWidget=s,l.containerWidget.containerWidget=i}-1===i.bodyWidgets.indexOf(s)&&(s.index=i.bodyWidgets.length,i.bodyWidgets.push(s),s.sectionFormat=i.page.bodyWidgets[i.page.bodyWidgets.length-1].sectionFormat),n&&(o.page.endnoteWidget=i)}this.layoutfootNote(i)}},psi.prototype.hasValidElement=function(e){var t=e.firstChild;if(t)for(var i=t.children[0];i;){if(i instanceof Zai&&!je(i=this.documentHelper.getNextValidElementForField(i))&&!i.line.paragraph.equals(e))return!1;if(i instanceof pli||i instanceof rhi)return!0;je(i)||(i=i.nextNode)}return!1},psi.prototype.isConsiderAsEmptyLineWidget=function(e){for(var t=0;t<e.children.length;t++){var i=e.children[t];if(!(i instanceof qli&&"Inline"!==i.textWrappingStyle)&&0<i.width)return!1}return!0},psi.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))},psi.prototype.checkLineWidgetWithClientArea=function(e,t){var i;(e!==t.line||t.line===e&&je(t.nextElement)&&!t.line.isLastLine())&&(this.moveToNextLine(e),"Word2013"!==this.documentHelper.compatibilityMode&&this.isOverlapFloatTable&&(i=void 0,t.line.paragraph.previousRenderedWidget instanceof _ai&&t.line.paragraph.previousRenderedWidget.wrapTextAround&&(i=t.line.paragraph.previousRenderedWidget,this.viewer.clientActiveArea.x=this.viewer.clientActiveArea.x-Y.convertPointToPixel(i.firstChild.firstChild.leftMargin)),this.viewer.clientActiveArea.x+=e.paragraph.leftIndent,this.isOverlapFloatTable=!1),e!==t.line)&&(this.isRTLLayout=!1),t.line!==e&&this.viewer instanceof nai&&this.viewer.clientActiveArea.height<t.height&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y?this.moveToNextPage(this.viewer,t.line):t.line===e&&je(t.nextElement)&&e.paragraph.lastChild===e&&!e.isLastLine()&&0<=this.viewer.clientActiveArea.height&&this.moveFromNextPage(e)},psi.prototype.checkAndSplitTabOrLineBreakCharacter=function(e,t){var i,n=Y.indexOfAny(e,["\t","\v","\f"]);-1<n&&("\t"===(i=e[n])&&"\t"!==e||"\v"===i&&"\v"!==e||"\f"===i&&"\f"!==e)&&this.splitByLineBreakOrTab(this.viewer,t,n,i)},psi.prototype.moveFromNextPage=function(e){var t,i=e.nextLine;i&&-1===e.paragraph.childWidgets.indexOf(i)&&(t=i.paragraph,i.paragraph.childWidgets.splice(i.indexInOwner,1),e.paragraph.childWidgets.push(i),i.paragraph=e.paragraph,0===t.childWidgets.length)&&t.destroy()},psi.prototype.cutClientWidth=function(e,t,i){if(this.is2013Justification)return!1;this.clearLineMeasures();for(var n=e.line,o=n.marginTop=0,r=0;r<n.children.length;r++){var s=n.children[r];if(t&&s instanceof Xli&&"Inline"===s.textWrappingStyle&&this.layoutShape(s),!this.isRelayoutOverlap&&s instanceof Ili&&"\t"===s.text&&(s.width=this.getTabWidth(n.paragraph,this.viewer,0,n,s)),o+=s.width,e===s)break}var a=this.viewer.clientActiveArea.width-o<0,l=e.line.paragraph.bodyWidget;return l&&0<l.floatingElements.length?(this.hasFloatingElement=!0,i||(this.isXPositionUpdated=!0),!1):(a?e.previousElement&&this.cutClientWidth(e.previousElement):(this.viewer.cutFromLeft(this.viewer.clientActiveArea.x+o),"Justify"===e.line.paragraph.paragraphFormat.textAlignment&&e instanceof pli&&this.splitTextElementWordByWord(e),je(e.nextElement)&&0<this.viewer.clientActiveArea.width&&!e.line.isLastLine()&&this.moveElementFromNextLine(n)),a)},psi.prototype.layoutFieldCharacters=function(e){var t,i;0===e.fieldType?(!je(e.formFieldData)&&this.isInitialLoad&&this.checkAndUpdateFieldData(e),this.isFieldCode||je(e.fieldEnd)&&!e.hasFieldEnd||(-1===this.documentHelper.fieldStacks.indexOf(e)&&this.documentHelper.fieldStacks.push(e),this.isRelayout&&(t=Y.trimEnd(this.documentHelper.selection.getFieldCode(e)),this.isIFfield=Y.startsWith(t,"IF")),this.isFieldCode=!0,e.hasFieldEnd=!0)):0<this.documentHelper.fieldStacks.length&&(2===e.fieldType?(i=this.documentHelper.fieldStacks[this.documentHelper.fieldStacks.length-1]).fieldSeparator!==e||je(i.fieldEnd)&&!i.hasFieldEnd||(this.isFieldCode=!1):e===(i=this.documentHelper.fieldStacks[this.documentHelper.fieldStacks.length-1]).fieldEnd&&(this.documentHelper.fieldStacks.pop(),this.isFieldCode=!1,this.isIFfield=!1))},psi.prototype.checkAndUpdateFieldData=function(e){var t,i,n;e.hasFieldEnd&&!je(e.fieldEnd)&&(je(e.fieldSeparator)&&((t=new Zai(2)).fieldBegin=e,t.fieldEnd=e.fieldEnd,t.line=e.line,e.line.children.splice(e.fieldEnd.indexInOwner,0,t),e.fieldSeparator=t,e.fieldEnd.fieldSeparator=t),(t=e.fieldEnd.previousNode)instanceof Zai)&&2===t.fieldType&&((t=e.formFieldData)instanceof rli?((i=new pli).skipformFieldLength=!0,i.line=e.line,n=e.line.children.indexOf(e.fieldEnd),e.line.children.splice(n,0,i),i.characterFormat.copyFormat(e.characterFormat),t.checked?i.text=String.fromCharCode(9745):i.text=String.fromCharCode(9744),this.setCheckBoxFontSize(t,i.characterFormat)):t instanceof lli&&((i=new pli).characterFormat.copyFormat(e.characterFormat),i.skipformFieldLength=!0,i.line=e.line,0<t.dropdownItems.length?i.text=t.dropdownItems[t.selectedIndex]:i.text=this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5),n=e.line.children.indexOf(e.fieldEnd),e.line.children.splice(n,0,i)))},psi.prototype.setCheckBoxFontSize=function(e,t){"Auto"!==e.sizeType?t.fontSize=1.35*e.size:t.fontSize=1.35*t.fontSize},psi.prototype.layoutEmptyLineWidget=function(e,t,i,n){this.clearLineMeasures();for(var o,r=e.paragraphFormat,s=0,a=(n=!je(n)&&n,r.borders),l=this.documentHelper.canRenderBorder(e),h=this.documentHelper.textHelper.getParagraphMarkSize(e.characterFormat).Height,d=0,p=(0<e.childWidgets.length&&!n?(this.isUpdateMarginForCurrentLine(i),0<(o=e.childWidgets[0]).children.length&&((r.bidi||this.isContainsRtl(o))&&this.shiftElementsForRTLLayouting(o,r.bidi),n=o.isFirstLine(),f=o.isLastLine(),p=0,n&&(d=this.getBeforeSpacing(e),p=Y.convertPointToPixel(r.firstLineIndent)),"Left"!==(b=r.textAlignment))&&this.viewer.textWrap&&("Justify"!==b||!f||"Justify"===b&&r.bidi)&&(s=(n=this.getSubWidth(o,"Justify"===b,0,p,f))[0].subWidth,n[0].spaceCount)):o=t?this.addLineWidget(e):i,o.isFirstLine()&&(d=this.getBeforeSpacing(e)),je(e.containerWidget)||!(0<e.bodyWidget.floatingElements.length)||e.containerWidget instanceof Zli||e.containerWidget instanceof Uai&&e.containerWidget.ownerTable.containerWidget instanceof Zli||(((r=new pli).line=o).children.push(r),r.text="¶",r.characterFormat=e.characterFormat,r.width=this.documentHelper.textHelper.getTextSize(r,r.characterFormat),this.adjustPosition(r,e.bodyWidget),e.x+=r.padding.left,0!==r.padding.left&&(e.textWrapWidth=!0),t&&this.checkInbetweenShapeOverlap(o),o.children.splice(r.indexInOwner,1)),!(this.viewer instanceof nai&&this.viewer.clientActiveArea.height<d+h&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y)||o.isFirstLine()&&je(o.paragraph.previousWidget)&&!o.isEndnoteLineWidget()||e.isSectionBreak||this.moveToNextPage(this.viewer,o),this.getLineSpacing(e,h)),c=0,u=0,g=0,m=h=!isNaN(this.maxTextHeight)&&h<this.maxTextHeight?this.maxTextHeight:h,f=e.paragraphFormat.lineSpacingType,y=("Multiple"===f?h<p?u+=p-h:c+=p-h:("Exactly"===f||c+m+u<p)&&(c+=p-(c+m+u)),c+=d,u+=Y.convertPointToPixel(this.getAfterSpacing(e)),"None"!=a.top.lineStyle&&o.isFirstLine()&&!l.skipTopBorder&&(c+=Y.convertPointToPixel(a.top.lineWidth+a.top.space)),"None"!=a.bottom.lineStyle&&o.isLastLine()&&!l.skipBottomBorder&&(u+=Y.convertPointToPixel(a.bottom.lineWidth+a.bottom.space)),o.renderedElements),v=0;v<y.length;v++){var b,w=y[v];if(0===v&&w instanceof lhi||e.paragraphFormat.bidi&&y[y.length-1]instanceof lhi){"Right"===(b=e.paragraphFormat.textAlignment)?g=s:"Center"===b&&(g=s/2),w.margin=new gai(g,c,0,u),(w.line=o).height=c+m+u;break}}o.margin=new gai(0,c,0,u),o.height=c+m+u,this.adjustPositionBasedOnTopAndBottom(o),(je(e.nextRenderedWidget)&&e.isInsideTable&&e.previousRenderedWidget instanceof _ai&&1==e.childWidgets.length||e.characterFormat.hidden)&&(o.height=0);n=e.previousRenderedWidget;e.isSectionBreak&&n instanceof Lai&&0<e.index?(this.layoutSectionBreakParagraph(e,n),n.isEndsWithPageBreak&&this.moveToNextPage(this.viewer,o,!0)):(this.viewer.cutFromTop(this.viewer.clientActiveArea.y+o.height),(i=e.previousRenderedWidget)&&(t=i.getSplitWidgets(),e.isSectionBreak)&&0<t.length&&t[t.length-1]instanceof _ai&&t[t.length-1].wrapTextAround&&this.viewer.cutFromTop(t[t.length-1].y+t[t.length-1].height)),this.wrapPosition=[]},psi.prototype.layoutSectionBreakParagraph=function(e,t){var i=t.lastChild,n=e.firstChild;i.margin&&(n.margin=new gai(0,i.margin.top,0,i.margin.bottom)),n.height=i.height,e.height=i.height,e.y=this.getLineYPosition(t),e.width=t.width,e.x=this.getLineXPosition(t)},psi.prototype.getLineYPosition=function(e){for(var t=e.y,i=0;i<e.childWidgets.length-1;i++)t+=e.childWidgets[i].height;return t},psi.prototype.getLineXPosition=function(e){var t=e.lastChild,i=this.documentHelper.textHelper.getParagraphMarkSize(e.characterFormat);return e.x+this.getLineWidth(t)+i.Width},psi.prototype.getLineWidth=function(e){for(var t=0,i=0;i<e.children.length;i++)e.children[i]instanceof Xli||(t+=e.children[i].width);return t},psi.prototype.isUpdateMarginForCurrentLine=function(e){var t=!0;if(!je(e)&&!e.isFirstLine()){for(var i=0;i<e.children.length;i++)if(!(e.children[i]instanceof ghi||e.children[i]instanceof phi)){t=!1;break}t&&(e.margin=new gai(0,0,0,0))}},psi.prototype.adjustPositionBasedOnTopAndBottom=function(e){!je(e.paragraph.bodyWidget)&&!je(e.paragraph.bodyWidget.page.headerWidget)&&0<e.paragraph.bodyWidget.page.headerWidget.floatingElements.length&&e.paragraph===e.paragraph.bodyWidget.childWidgets[0]&&0===e.indexInOwner&&this.checkInbetweenShapeOverlap(e,e.paragraph.bodyWidget.page.headerWidget.floatingElements)},psi.prototype.layoutListItems=function(e,t){this.isFieldCode||(!je(e.paragraphFormat)&&!je(e.paragraphFormat.listFormat)&&!je(this.documentHelper.getListById(e.paragraphFormat.listFormat.listId))&&0<=e.paragraphFormat.listFormat.listLevelNumber&&e.paragraphFormat.listFormat.listLevelNumber<9&&!t?(this.clearListElementBox(e),this.layoutList(e,this.documentHelper)):e.paragraphFormat.listFormat&&-1===e.paragraphFormat.listFormat.listId&&this.clearListElementBox(e))},psi.prototype.layoutList=function(e,t){var i=t.getListById(e.paragraphFormat.listFormat.listId),n=e.paragraphFormat.listFormat.listLevelNumber,o=this.getListLevel(i,n);if(!je(o)&&!je(o.numberFormat)){var r,s=e.childWidgets[0],a=(je(s)&&(s=new Gai(e),e.childWidgets.push(s)),new lhi(o,!1)),l=!1;if(e.characterFormat.hidden){if(e.isEmpty())l=!0;else for(var h=s.children[0];h;){if(!h.characterFormat.hidden){l=!1;break}l=!0,h=h.nextNode}l&&(a.characterFormat.hidden=!0)}a.line=s,"Bullet"===o.listLevelPattern?(a.text=o.numberFormat,this.updateListValues(i,n)):a.text=this.getListNumber(e.paragraphFormat.listFormat),""!==o.numberFormat&&(this.viewer.updateClientWidth(-Y.convertPointToPixel(e.paragraphFormat.firstLineIndent)),(this.documentHelper.isIosDevice||this.documentHelper.isLinuxOS)&&(i=(i=a.text)===String.fromCharCode(61623)?String.fromCharCode(9679):i===String.fromCharCode(61551)+String.fromCharCode(32)?String.fromCharCode(9675):i)!==a.text&&(a.text=i),t.textHelper.updateTextSize(a,e),this.viewer instanceof nai&&this.viewer.clientActiveArea.height<a.height&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y&&(r=!0),this.viewer.cutFromLeft(this.viewer.clientActiveArea.x+a.width),n=a,s.children.splice(0,0,a),"None"!==o.followCharacter&&(a=new lhi(o,!0),l&&(a.characterFormat.hidden=!0),"Tab"===o.followCharacter?(a.text="\t",i=s.children.indexOf(a),i=this.getTabWidth(e,this.viewer,i,s,a),t.textHelper.updateTextSize(a,e),l||(a.width=i)):(a.text=" ",t.textHelper.updateTextSize(a,e)),this.viewer.cutFromLeft(this.viewer.clientActiveArea.x+a.width),s.children.splice(1,0,a),a.line=s),je(e.containerWidget)||!(0<e.bodyWidget.floatingElements.length)||n instanceof Xli||e.containerWidget instanceof Zli||(this.adjustPosition(n,n.line.paragraph.bodyWidget),n instanceof lhi&&n.padding&&0<n.padding.left&&e.paragraphFormat.firstLineIndent<0&&(n.padding.left-=Y.convertPointToPixel(n.line.paragraph.paragraphFormat.firstLineIndent)),this.isYPositionUpdated&&(this.viewer.clientActiveArea.width>n.width+a.width&&(this.viewer.clientActiveArea.width-=n.width+a.width),this.isYPositionUpdated=!1)),r?(this.moveToNextPage(this.viewer,s,void 0,!0),this.cutClientWidth(a),this.hasFloatingElement=!1,this.isXPositionUpdated=!1):"None"!==o.followCharacter&&this.viewer.updateClientWidth(Y.convertPointToPixel(e.paragraphFormat.firstLineIndent)))}},psi.prototype.addBodyWidget=function(e,t){t=t||new Sai;return t.width=e.width,t.x=e.x,t.y=e.y,t},psi.prototype.addListLevels=function(e){for(var t=e.levels.length;t<9;t++){var i=new rsi(e),n=t%3;"Bullet"===e.levels[0].listLevelPattern?(i.listLevelPattern="Bullet",i.numberFormat=0==n?String.fromCharCode(61623):1==n?String.fromCharCode(61551)+String.fromCharCode(32):String.fromCharCode(61607),i.characterFormat.fontFamily=i.numberFormat===String.fromCharCode(61607)?"Wingdings":"Symbol"):(i.listLevelPattern=this.getListLevelPattern(n),i.numberFormat="%"+(t+1).toString()+".",i.startAt=1,i.restartLevel=t),i.paragraphFormat=new bri(void 0),i.paragraphFormat.leftIndent=48*(t+1),i.paragraphFormat.firstLineIndent=-24,e.levels.push(i)}},psi.prototype.addSplittedLineWidget=function(e,t,i){if(this.isWrapText)je(i)||(e.children.splice(t+1,0,i),i.line=e);else{var n=!1,o=e.paragraph,r=[],s=o.childWidgets.indexOf(e),a=(je(i)||r.push(i),void 0),i=e.children[t];i instanceof Khi&&0===i.commentType&&0!=t?t-=1:i.isColumnBreak&&je(i.nextNode)&&(n=!0);for(var l=t+1;l<e.children.length;l++)r.push(e.children[l]);if(0<r.length||n){for(var a=s===o.childWidgets.length-1?new Gai(o):o.childWidgets[s+1],h=0;h<r.length;h++)r[h].line=a;0<r.length&&(e.children.splice(t+1,e.children.length-1),!je(e.layoutedElements)&&0<e.layoutedElements.length&&e.layoutedElements.splice(t+1,e.layoutedElements.length-1),a.children=r.concat(a.children)),-1===o.childWidgets.indexOf(a)&&o.childWidgets.splice(s+1,0,a)}}},psi.prototype.addElementToLine=function(e,t){t instanceof qli&&"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 pli&&this.splitTextElementWordByWord(t),t instanceof rhi&&(t.line.skipClipImage=!t.isInlineImage)},psi.prototype.splitElementForClientArea=function(e,t){var i,n;0<t.line.children.length&&(i=t.previousElement,n=t.indexInOwner,1<t.line.children.length&&i&&this.viewer.clientActiveArea.x!==this.viewer.clientArea.x&&--n,this.addSplittedLineWidget(t.line,n))},psi.prototype.splitByWord=function(e,t,i,n,o,r){var s,a,o=this.getSplitIndexByWord(this.viewer.clientActiveArea.width,n,o,r,i.scriptType);0<o&&o<i.length&&(a=e.children.indexOf(i),s=new pli,n=n.substring(o)," "===(s.text=n)[0]&&(o+=n.length-(n=Y.trimStart(n)).length),s.characterFormat.copyFormat(i.characterFormat),s.width=this.documentHelper.textHelper.getWidth(s.text,r,s.scriptType)," "===s.text[s.text.length-1]?s.trimEndWidth=this.documentHelper.textHelper.getWidth(Y.trimEnd(s.text),r,s.scriptType):s.trimEndWidth=s.width,s.characterRange=i.characterRange,s.scriptType=i.scriptType,i.text=i.text.substr(0,o)," "!==i.text&&Y.endsWith(i.text)&&r.bidi&&i.characterRange===aJt.RightToLeft&&!this.isWrapText&&(n=this.spitTextElementByWhitespace(i,r),a=e.children.indexOf(n)),i.width=this.documentHelper.textHelper.getWidth(i.text,i.characterFormat,i.scriptType)," "===i.text[i.text.length-1]?i.trimEndWidth=this.documentHelper.textHelper.getWidth(Y.trimEnd(i.text),i.characterFormat,i.scriptType):i.trimEndWidth=i.width,0<i.revisions.length&&(this.updateRevisionForSplittedElement(i,s,!0),s.isMarkedForRevision=i.isMarkedForRevision),s.height=i.height,s.baselineOffset=i.baselineOffset,this.splitErrorCollection(i,s),this.addSplittedLineWidget(e,a,s),this.addElementToLine(t,i),0===i.width)&&e.children.splice(a,1)},psi.prototype.spitTextElementByWhitespace=function(e,t){var i=e.line,n=i.children.indexOf(e),o=e.text,r=new pli,s=o.length-1;return e.text=o.substring(0,s),r.text=o.substring(s),r.characterFormat.copyFormat(e.characterFormat),r.line=i,r.characterRange=aJt.WordSplit,r.scriptType=e.scriptType,r.height=e.height,r.baselineOffset=e.baselineOffset,r.width=this.documentHelper.textHelper.getWidth(r.text,t,r.scriptType),i.children.splice(n+1,0,r),0<e.revisions.length&&(this.updateRevisionForSplittedElement(e,r,0<s,!0),r.isMarkedForRevision=e.isMarkedForRevision),r},psi.prototype.splitErrorCollection=function(e,t){if(0<e.errorCollection.length){for(var i=[],n=e.ignoreOnceItems,o=0;o<e.errorCollection.length;o++)i.push(e.errorCollection[o]);for(var r=0;r<e.errorCollection.length;r++){var s=e.text.indexOf(e.errorCollection[r].text),a=e.errorCollection[r];s<0?(i.splice(0,1),t.errorCollection.push(a)):0<t.text.indexOf(a.text)&&t.errorCollection.push(a)}t.ignoreOnceItems=n,e.ignoreOnceItems=[],e.errorCollection=i}},psi.prototype.splitByCharacter=function(e,t,i,n,o){var r,s=e.paragraph,a="AtLeast"===s.paragraphFormat.lineSpacingType?s.paragraphFormat.afterSpacing:0,n=this.getTextSplitIndexByCharacter(this.viewer.clientArea.width,this.viewer.clientActiveArea.width,i,n,o,t.scriptType);0===n&&t.previousNode instanceof rhi&&"Right"===t.previousNode.textWrappingType||((n=(r=0)===n&&!je(t)&&0<t.length&&Math.max(t.height,a)<=this.viewer.clientArea.height&&0===this.viewer.clientActiveArea.width&&0===e.children.indexOf(t)?1:n)<t.length&&(r=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(i.substring(0,n),o,t.scriptType),i=i.substring(n)),r>this.viewer.clientActiveArea.width&&0<t.indexInOwner?this.addSplittedLineWidget(e,t.indexInOwner-1):(a=e.children.indexOf(t),n<t.length?((r=new pli).text=i,r.errorCollection=t.errorCollection,r.scriptType=t.scriptType,t.text=t.text.substr(0,n),r.characterFormat.copyFormat(t.characterFormat),r.width=this.documentHelper.textHelper.getWidth(r.text,o,r.scriptType)," "===r.text[r.text.length-1]?r.trimEndWidth=this.documentHelper.textHelper.getWidth(Y.trimEnd(r.text),o,r.scriptType):r.trimEndWidth=r.width,r.characterRange=t.characterRange,t.width=this.documentHelper.textHelper.getWidth(t.text,o,t.scriptType)," "===t.text[t.text.length-1]?t.trimEndWidth=this.documentHelper.textHelper.getWidth(Y.trimEnd(t.text),o,t.scriptType):t.trimEndWidth=t.width,r.height=t.height,r.baselineOffset=t.baselineOffset,e.children.splice(t.indexInOwner+1,0,r),0<t.revisions.length&&(this.updateRevisionForSplittedElement(t,r,0<n),r.isMarkedForRevision=t.isMarkedForRevision),this.addElementToLine(s,t),this.addSplittedLineWidget(e,a),0===t.width&&e.children.splice(a,1)):(this.addSplittedLineWidget(e,a),this.addElementToLine(s,t))))},psi.prototype.updateRevisionForSplittedElement=function(e,t,i,n){if(0<e.revisions.length)for(var o=0;o<e.revisions.length;o++){var r,s=e.revisions[o];i?(t.revisions.push(s),(r=s.range.indexOf(e))<0?s.range.push(t):n?s.range.splice(r,0,t):s.range.splice(r+1,0,t)):(r=s.range.indexOf(e),s.range.splice(r,1),s.range.splice(r,0,t),t.revisions.push(s))}},psi.prototype.splitTextElementWordByWord=function(e){var t=e.line,i=s=t.children.indexOf(e),n=e.padding.left;if((e.padding.left=0)<=(a=e.text).trim().indexOf(" ")){t.children.splice(s,1);for(var o,r,s,a,l=e.characterFormat,h=e.length-Y.trimStart(a).length;h<e.length&&0!==(h=this.getTextIndexAfterSpace(a,h))&&h!==e.length;)h<e.length&&(o=new pli,r=a.substring(0,h)," "===(a=a.substring(h)).substring(0,1)&&(h+=a.length-Y.trimStart(a).length),o.text=r,o.characterFormat.copyFormat(e.characterFormat),o.line=t,o.height=e.height,o.baselineOffset=e.baselineOffset,o.characterRange=e.characterRange,o.scriptType=e.scriptType,t.children.splice(s,0,o),0<e.revisions.length&&(this.updateRevisionForSplittedElement(e,o,0<h,!0),o.isMarkedForRevision=e.isMarkedForRevision)," "!==o.text&&Y.endsWith(o.text)&&l.bidi&&o.characterRange===aJt.RightToLeft&&(r=this.spitTextElementByWhitespace(o,l),s=t.children.indexOf(r)),o.width=this.documentHelper.textHelper.getWidth(o.text,l,o.scriptType)," "===o.text[o.text.length-1]?o.trimEndWidth=this.documentHelper.textHelper.getWidth(Y.trimEnd(o.text),l,o.scriptType):o.trimEndWidth=o.width,e.text=a,e.width=this.documentHelper.textHelper.getWidth(e.text,e.characterFormat,e.scriptType)," "===e.text[e.text.length-1]?e.trimEndWidth=this.documentHelper.textHelper.getWidth(Y.trimEnd(e.text),e.characterFormat,e.scriptType):e.trimEndWidth=e.width,0===e.width&&-1!==t.children.indexOf(e)&&t.children.splice(t.children.indexOf(e),1),h=0,s++);e.text=a,t.children.splice(s,0,e)}t.children[i].padding.left=n},psi.prototype.isSplitByHyphen=function(e,t){if(!je(e.previousElement)&&(e.previousElement instanceof pli||e.previousElement instanceof lhi))return e=e.previousElement.text,"-"===t.substring(0,1)&&" "!==e.substring(e.length-1,e.length);return"-"===t.substring(0,1)},psi.prototype.splitTextForClientArea=function(e,t,i,n,o){var r=e.paragraph,s=!0,a=-1;if(" "===i.substring(0,1)||this.isSplitByHyphen(t,i))a=1;else{var l=n,h=0,h=Y.trimEnd(i).indexOf(" ")+1;if(0<(a=h=0==h?Y.trimEnd(i).indexOf("-")+1:h)&&(l=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(i.slice(0,a),o,t.scriptType)),this.viewer.clientActiveArea.width<l&&!this.documentHelper.textHelper.isUnicodeText(i,t.scriptType)&&!this.isWordFittedByJustification(t,l)&&(s=this.checkPreviousElement(e,e.children.indexOf(t))))return}h=!0;this.documentHelper.textHelper.isUnicodeText(i,t.scriptType)&&3===t.scriptType&&i.length-1===i.indexOf(" ")&&(h=!1),n<=this.viewer.clientActiveArea.width?this.addElementToLine(r,t):s&&(0<a||-1!==i.indexOf(" ")&&h||-1!==i.indexOf("-"))?this.splitByWord(e,r,t,i,n,o):this.splitByCharacter(e,t,i,n,o)},psi.prototype.splitByLineBreakOrTab=function(e,t,i,n){var o,r=t.line.children.indexOf(t),s=t.text,a=s.substring(i),l=new("\t"===n?Ili:pli);l.line=t.line,this.updateRevisionForSplittedElement(t,l,!0),l.characterFormat.copyFormat(t.characterFormat),l.characterRange=t.characterRange,t.line.children.splice(r+1,0,l),t.isWidthUpdated=!1,0<i&&1===a.length?(l.text=s.substring(i),t.text=s.substring(0,i)):0<i?(l.text=n,(o=new pli).line=t.line,o.text=s.substring(i+1),this.updateRevisionForSplittedElement(t,o,!0),o.characterFormat.copyFormat(t.characterFormat),o.characterRange=t.characterRange,t.line.children.splice(r+2,0,o),t.text=s.substring(0,i)):""!==a&&(l.text=s.substring(i+1),t.text=n)},psi.prototype.moveToNextLine=function(e,t,i){var n,o,r=e.paragraph,s=r.paragraphFormat,a=e.isFirstLine(),l=e.isLastLine(),h=0,d=0,p=0,O=0,c=0,u=0,g=s.borders,m=(this.updateLineWidget(e),d=(h=this.maxTextHeight)-this.maxTextBaseline,0),f=!1,N=this.documentHelper.canRenderBorder(r),y=(!r.bodyWidget||r.bodyWidget instanceof Iai||(m=this.documentHelper.pages.indexOf(r.bodyWidget.page)),a&&(O=this.getBeforeSpacing(r,m),u=Y.convertPointToPixel(s.firstLineIndent)),l&&(p=Y.convertPointToPixel(this.getAfterSpacing(r))),(s.bidi||this.isContainsRtl(e))&&(this.shiftElementsForRTLLayouting(e,s.bidi),this.isRTLLayout=!0),d=isNaN(this.maxTextHeight)?(h=(a=this.documentHelper.textHelper.measureText("a",r.characterFormat)).Height)-a.BaselineOffset:(h=this.maxTextHeight)-this.maxTextBaseline,c=this.getLineSpacing(r,h),(e.skipClipImage||14<=r.paragraphFormat.lineSpacing||c<0)&&"Exactly"===s.lineSpacingType&&c<d+this.maxBaseline&&(c=d+this.maxBaseline),0),v=0,b=s.textAlignment,a=0,w=0;if("Left"!==b&&this.viewer.textWrap&&("Justify"!==b||!l||"Justify"===b&&s.bidi||this.is2013Justification&&l)&&(y=(n=this.getSubWidth(e,"Justify"===b,v,u,l))[0].subWidth,v=n[0].spaceCount,a=n[0].totalSpaceCount,w=n[0].trimmedSpaceWidth,f=e.isEndsWithPageBreak||e.isEndsWithColumnBreak||e.isEndsWithLineBreak||e.paragraph.bidi||this.isRTLLayout),!f&&n&&1===n.length&&0<this.viewer.clientActiveArea.width&&!l&&!this.is2013Justification&&"Justify"===b&&"Word2013"===this.documentHelper.compatibilityMode)u=this.viewer.clientActiveArea.width,f=this.getTotalSpaceWidth(e),o=0,this.viewer.clientActiveArea.x-=o=u/a/(f/a)*100<=33?f/8:f/4,this.viewer.clientActiveArea.width+=o,this.is2013Justification=!0,t?this.splitParagraphForMultiColumn(e,i):(this.moveElementFromNextLine(e),this.nextElementToLayout=e.children[e.children.length-1]);else{this.is2013Justification&&l&&0<y&&(v=y=0),this.is2013Justification=!1,this.nextElementToLayout=void 0;for(var V=!1,C=0,_=s.lineSpacingType,H=!1,S=e.renderedElements,z=0,j=0,W=0,A=this.viewer.clientArea.x,x=!0,I=0;I<S.length;I++){var T=0,E=0,D=0,M=S[I];if(x&&!M.characterFormat.hidden&&(x=!1),!je(n)&&H&&0<M.padding.left&&n.length>C+1&&(k=y,"Justify"===b?k=y*n[C].spaceCount:"Center"===b&&(k=y/2),M.padding.left=M.padding.left-k,y=(k=n[++C]).subWidth,v=k.spaceCount),!(M instanceof qli&&"Inline"!==M.textWrappingStyle)){var H=!0,k=this.alignLineElements(M,T,E,d,V,y,b,v,I===S.length-1);if("Justify"===b&&M instanceof qli&&"Inline"===M.textWrappingStyle&&0!==y&&(M.x=A,M instanceof Xli))for(var P=0;P<M.textFrame.childWidgets.length;P++){var Q=(L=M.textFrame.childWidgets[P]).bidi?L.rightIndent:L.leftIndent;L.x=A+Y.convertPointToPixel(Q+M.textFrame.marginLeft)}A+=M.width,e.maxBaseLine=this.maxBaseline,T=k.topMargin,E=k.bottomMargin,V=k.addSubWidth,v=k.whiteSpaceCount,"Multiple"===_?h<c?E+=c-h:T+=c-h:("Exactly"===_||c>T+M.height+E)&&(T+=c-(T+M.height+E)),0<m&&r===r.bodyWidget.childWidgets[0]&&this.documentHelper.pages[m].sectionIndex===this.documentHelper.pages[m-1].sectionIndex?T+=0:T+=O,"None"!=g.top.lineStyle&&e.isFirstLine()&&!N.skipTopBorder&&(T+=Y.convertPointToPixel(g.top.lineWidth+g.top.space)),"None"!=g.bottom.lineStyle&&e.isLastLine()&&!N.skipBottomBorder&&(E+=Y.convertPointToPixel(g.bottom.lineWidth+g.bottom.space)),E+=p;var B=0<I?S[I-1]:void 0;if((0===I||!(M instanceof qli&&"Inline"!==M.textWrappingStyle)&&B instanceof qli&&"Inline"!==B.textWrappingStyle&&B.indexInOwner<M.indexInOwner||0<M.padding.left)&&(e.height=T+M.height+E,"Right"===b||"Justify"===b&&s.bidi&&(l||w<0)?D=w<0?w:y:"Center"===b&&(D=y<0?y:y/2)),M.margin=new gai(D,T,0,E),M.line=e,z<M.height&&(z=M.height,j=M.margin.bottom,W=M.margin.top),M instanceof Xli&&"Inline"===M.textWrappingStyle){if(0!==I||0<M.margin.left){var F=S[0].margin.left;M.x+=F;for(var L,R=0;R<M.textFrame.childWidgets.length;R++)(L=M.textFrame.childWidgets[R])instanceof _ai?L.updateChildWidgetLeft(L.x+F):L.x+=F}this.updateShapeYPosition(M)}}}x&&(e.height=0),e.margin=new gai(0,W,0,j),this.adjustPositionBasedOnTopAndBottom(e),this.checkInbetweenShapeOverlap(e),!t&&e.isLastLine()&&0===e.indexInOwner&&e.paragraph.paragraphFormat.widowControl?je(u=e.paragraph.previousSplitWidget)||u.isEndsWithPageBreak||u.isEndsWithColumnBreak||0===u.indexInOwner||(a=u.childWidgets.length-1,2===u.childWidgets.length&&(a=0),this.splitParagraph(u,a,e.paragraph),this.updateClientAreaForNextBlock(e,e.paragraph)):t&&this.splitParagraphForMultiColumn(e,i),t||this.viewer.cutFromTop(this.viewer.clientActiveArea.y+e.height),this.wrapPosition=[]}},psi.prototype.updateShapeYPosition=function(e){if(0<e.margin.top){e.y+=e.margin.top;for(var t=0;t<e.textFrame.childWidgets.length;t++)e.textFrame.childWidgets[t].y+=e.margin.top}},psi.prototype.getBodyWidget=function(e,t){if(t)for(;e&&0!==e.columnIndex;)e=e.previousRenderedWidget;else for(;e&&!je(e.nextRenderedWidget)&&e.columnIndex!==e.sectionFormat.numberOfColumns-1&&e.index===e.nextRenderedWidget.index;)e=e.nextRenderedWidget;return e},psi.prototype.splitParagraphForMultiColumn=function(e,t){this.splitParagraph(e.paragraph,t,void 0),je(e.paragraph.previousRenderedWidget)&&0==t||!je(e.paragraph.previousRenderedWidget)&&e.paragraph.previousRenderedWidget.bodyWidget.sectionIndex!==e.paragraph.bodyWidget.sectionIndex?this.moveBlocksToNextPage(e.paragraph):this.moveBlocksToNextPage(e.paragraph.previousRenderedWidget);var t=this.viewer.clientActiveArea.height;this.viewer.updateClientArea(e.paragraph.bodyWidget,e.paragraph.bodyWidget.page),this.viewer.clientActiveArea.y=e.paragraph.bodyWidget.y,this.viewer.clientActiveArea.height=t,!e.paragraph.bodyWidget.sectionFormat.equalWidth&&e.paragraph.bodyWidget.sectionFormat.numberOfColumns-1!==e.paragraph.bodyWidget.columnIndex||(t=e.paragraph,this.documentHelper.blockToShift=t,this.shiftLayoutedItems(!1,!0))},psi.prototype.checkInbetweenShapeOverlap=function(r,e){var s,a,l,h,d,p=this;r.paragraph.containerWidget instanceof Zli||!r.paragraph.bodyWidget||(a=this.getLineY(r),l=r.paragraph.isInsideTable,h=r.paragraph.y,d=!0,je(e)&&(d=!1,e=r.paragraph.bodyWidget.floatingElements),e.sort(function(e,t){return e.y-t.y}),e.forEach(function(e){var t,i,n,o;l&&e.line&&!e.line.paragraph.isInsideTable||je(e.line)||(t="TopAndBottom"===e.textWrappingStyle&&e instanceof rhi&&!r.paragraph.isEmpty()?new pai(r.paragraph.x,p.viewer.clientActiveArea.y,r.paragraph.width,r.children[0].height):new pai(r.paragraph.x,p.viewer.clientActiveArea.y,r.paragraph.width,r.height),i=new pai(e.x,e.y-e.distanceTop,e.width,e.height),e.line&&p.isRelayout&&!p.isRelayoutOverlap&&p.viewer.documentHelper.selection.isExistAfter(e.line.paragraph,r.paragraph))||p.isRelayout&&p.isRelayoutOverlap&&p.viewer.documentHelper.selection.isExistAfter(e.line.paragraph,p.endOverlapWidget)||(n="TopAndBottom"===e.textWrappingStyle,o=e.y+e.height+e.distanceBottom-a,s&&n&&s.y+s.height+s.distanceBottom+r.height>e.y-e.distanceTop&&s.y-s.distanceTop<e.y-e.distanceTop&&e.y+e.height+e.distanceBottom>s.y+s.height+s.distanceBottom?(s=e,r.paragraph.isEmpty()&&d?(r.paragraph.y=h,r.paragraph.y+=o):r.marginTop=o):n&&!s&&t.isIntersecting(i)&&(s=e,r.paragraph.isEmpty()&&d?r.paragraph.y+=o:r.marginTop=o))}),s?this.viewer.cutFromTop(s.y+s.height+s.distanceBottom):this.isRelayoutOverlap&&(r.marginTop=0))},psi.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},psi.prototype.updateLineWidget=function(e){for(var t,i=0,n=0,o=!1,r=!1,s=0;s<e.children.length;s++){var a,l,h,d=e.children[s];(r=d instanceof Zai&&2===d.fieldType?!1:r)||d.characterFormat.hidden||(d instanceof Zai&&0===d.fieldType&&(r=!0),d instanceof qli&&"Inline"!==d.textWrappingStyle)||(d instanceof pli&&0===d.text.replace(/\s+/g,"").length&&d.text!==String.fromCharCode(160)?i<d.height&&(i=d.height,n=d.baselineOffset):d instanceof pli||d instanceof lhi?(a=d.height,l=d.baselineOffset,h=!1,d instanceof pli&&d.isCheckBoxElement&&!je(d.previousNode)&&d.previousNode instanceof Pli&&("Cell"===d.previousNode.contentControlWidgetType||"Inline"===d.previousNode.contentControlWidgetType)&&(h=!0),d instanceof pli&&d.isCheckBoxElement&&!h&&(a/=1.35,l/=1.35),this.maxTextHeight<a&&(this.maxTextHeight=a,this.maxTextBaseline=l),this.maxBaseline<this.maxTextBaseline&&(this.maxBaseline=this.maxTextBaseline)):this.maxBaseline<d.height&&(this.maxBaseline=d.height,d instanceof rhi)&&(o=!0))}0===this.maxTextHeight&&0!==i&&(o?(this.maxTextHeight=0,this.maxTextBaseline=0):(e.isLastLine()&&this.documentHelper.selection?(t=this.documentHelper.selection.getParagraphMarkSize(e.paragraph,0,0),this.maxTextHeight=t.height):this.maxTextHeight=i,this.maxTextBaseline=n,this.maxBaseline<this.maxTextBaseline&&(this.maxBaseline=this.maxTextBaseline)))},psi.prototype.reLayoutEndnote=function(){var e,t,i=this.documentHelper.pages[this.documentHelper.pages.length-1];je(i)||je(i.endnoteWidget)||(e=this.viewer.clientActiveArea.clone(),t=this.getBodyWidget(i.bodyWidgets[i.bodyWidgets.length-1],!0),this.viewer.updateClientArea(t,t.page),0<(t=this.getNextWidgetHeight(t))&&(this.viewer.clientActiveArea.height-=t-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=t),this.layoutfootNote(i.endnoteWidget),this.viewer.clientActiveArea=e)},psi.prototype.moveEndnoteToNextPage=function(e,t,i,n){if(i){var i=this.createSplitBody(t),o=this.viewer.createNewPage(i);this.viewer.updateClientArea(i,i.page),i.y=t.y=this.viewer.clientActiveArea.y;for(var r=0;r<e.bodyWidgets.length;r++)e.bodyWidgets[r].page=o,e.bodyWidgets[r].containerWidget=e;e.page.endnoteWidget=void 0,(o.endnoteWidget=e).page=o}else{var s=t.page;if(je(s.endnoteWidget)){var a=new Pai;a.footNoteType="Endnote",a.page=s,a.bodyWidgets.push(t),t.containerWidget=a;for(r=n+1;r<e.bodyWidgets.length;r++){var l=e.bodyWidgets[r];e.bodyWidgets.splice(r,1),a.bodyWidgets.push(l),l.containerWidget=a,l.page=s,r--}s.endnoteWidget=a}else{-1===s.endnoteWidget.bodyWidgets.indexOf(t)&&(s.endnoteWidget.bodyWidgets.splice(0,0,t),t.containerWidget=s.endnoteWidget);for(r=e.bodyWidgets.length-1;n<r;r--){l=e.bodyWidgets[r];s.endnoteWidget.bodyWidgets.unshift(l),l.containerWidget=s.endnoteWidget,l.page=s,e.bodyWidgets.splice(r,1)}}}},psi.prototype.moveToNextPage=function(e,t,i,n,o){if(!this.isFootNoteLayoutStart){var r=t.paragraph,s=!1,a=!1,l=!1,h=0;if(r&&(je(r.containerWidget)||je(r.containerWidget.containerWidget)||!(r.containerWidget.containerWidget instanceof Pai)||"Footnote"!==r.containerWidget.containerWidget.footNoteType)){var d=0;if(r instanceof Pai)return;if(!je(r.containerWidget)&&!je(r.containerWidget.containerWidget)&&r.containerWidget.containerWidget instanceof Pai&&"Endnote"===r.containerWidget.containerWidget.footNoteType&&(l=!0),je(t)||(0===(d=r.childWidgets.indexOf(t))||(!r.paragraphFormat.keepLinesTogether||je(r.previousWidget)||t.previousLine.isEndsWithColumnBreak)&&(1!=d||t.previousLine.isEndsWithPageBreak||t.previousLine.isEndsWithColumnBreak||!r.paragraphFormat.widowControl||je(r.previousWidget))||(s=!(d=0)),(0<d||i)&&(r.height=e.clientActiveArea.y-r.y),0!==d)||r.isEndsWithPageBreak||r.isEndsWithColumnBreak||je((p=this.alignBlockElement(r)).node)||(d=(u=p.node instanceof jai?this.splitRow(p.node):p.node)instanceof _ai?0:parseInt(p.position.index,10),a=!(s=!1),(r=u)instanceof Lai?this.viewer.owner.isDocumentLoaded&&this.viewer.owner.editorModule&&!r.paragraphFormat.keepWithNext&&!n&&this.viewer.owner.editorModule.updateWholeListItems(r):this.viewer.owner.isDocumentLoaded&&this.viewer.owner.editorModule&&!n&&this.viewer.owner.editorModule.updateWholeListItems(r)),je(r.bodyWidget)||je(r.bodyWidget.containerWidget)||r.bodyWidget.containerWidget instanceof Pai||void 0===r.bodyWidget.page.footnoteWidget||this.layoutfootNote(r.bodyWidget.page.footnoteWidget),this.isMultiColumnSplit)if(je(this.viewer.columnLayoutArea.getNextColumnByBodyWidget(r.bodyWidget)))return;var p=r.bodyWidget.page;if(i&&0===d&&!je(r.bodyWidget.lastChild)&&r===r.bodyWidget.lastChild&&this.endOverlapWidget&&(this.isRelayoutOverlap=!1),l&&je(p.nextPage)&&0===r.bodyWidget.index&&0===r.index&&0===d)return c=r.containerWidget.containerWidget,void this.moveEndnoteToNextPage(c,r.bodyWidget,!0);var c,u=this.moveBlocksToNextPage(r,0===d,d,!1,l);if(l&&(n=(c=r.containerWidget.containerWidget).bodyWidgets.indexOf(r.bodyWidget),u.footNoteReference=r.bodyWidget.footNoteReference,this.moveEndnoteToNextPage(c,u,!1,n)),p!==u.page&&this.viewer.updateClientArea(u,u.page),this.viewer.updateClientAreaForBlock(r,!0),0<d){if(t.isLastLine()&&i)return;var g=void 0,g=u.firstChild instanceof Lai&&u.firstChild.equals(r)?u.firstChild:new Lai;(g=this.moveChildsToParagraph(r,d,g)).containerWidget=u;for(var m=0;m<g.floatingElements.length;m++){var f=g.floatingElements[m];f.line.paragraph.bodyWidget!==r.bodyWidget&&"Inline"!==f.textWrappingStyle&&r.bodyWidget.floatingElements.splice(r.bodyWidget.floatingElements.indexOf(f),1)}n=this.getFootNoteWidgetsOf(g);this.moveFootNotesToPage(n,r.bodyWidget,u),r=g,this.viewer.clientActiveArea.height-=this.getFootNoteHeight(n)}else i||(r.containerWidget.removeChild(r.indexInOwner),r instanceof Lai&&0<r.floatingElements.length&&this.addRemoveFloatElementsFromBody(r,r.containerWidget,!1),l&&0===r.containerWidget.childWidgets.length&&!je(r.containerWidget.containerWidget)&&r.containerWidget.containerWidget instanceof Pai&&((c=r.containerWidget.containerWidget).bodyWidgets.splice(c.bodyWidgets.indexOf(r.containerWidget),1),u.footNoteReference.bodyWidget=u,je(c.page.endnoteWidget)||0!==c.page.endnoteWidget.bodyWidgets.length||(c.page.endnoteWidget=void 0)));if(!i){if(-1===u.childWidgets.indexOf(r)&&(u.childWidgets.splice(0,0,r),r instanceof Lai)&&0<r.floatingElements.length&&this.addRemoveFloatElementsFromBody(r,u,!0),r.containerWidget=u,this.viewer.updateClientAreaLocation(r,this.viewer.clientActiveArea),s||a){r.bodyWidget.page.footnoteWidget&&this.layoutfootNote(r.bodyWidget.page.footnoteWidget),(t.paragraph!==r||r.paragraphFormat.widowControl&&this.isImagePresent(r))&&(r instanceof _ai&&this.clearTableWidget(r,!0,!0,!1),this.layoutBlock(r,0,!0),e.updateClientAreaForBlock(r,!1));var y=t.paragraph;if(a){var v=r.nextWidget;if(!je(v))do{if(e.updateClientAreaForBlock(v,!0),v===y){this.viewer.updateClientAreaLocation(v,this.viewer.clientActiveArea);break}}while(v instanceof _ai&&this.clearTableWidget(v,!0,!0,!1),this.layoutBlock(v,0,!0),e.updateClientAreaForBlock(v,!1),v=v.nextWidget)}this.updateClientAreaForNextBlock(t,y)}!t.isFirstLine()||0!==t.indexInOwner||t.children[0]instanceof lhi||o||(h=-Y.convertPointToPixel(t.paragraph.paragraphFormat.firstLineIndent),this.viewer.updateClientWidth(h))}}if(i||this.updateShapeBaseLocation(r),o&&this.viewer.updateClientWidth(h),this.isRelayoutOverlap&&this.endOverlapWidget&&(!this.skipRelayoutOverlap||this.endOverlapWidget instanceof _ai&&this.endOverlapWidget.wrapTextAround)){var b=this.endOverlapWidget.previousRenderedWidget,w=t.paragraph;for(this.startOverlapWidget=w,w=(t=this.endOverlapWidget.childWidgets[0]).paragraph;w;)w.floatingElements.forEach(function(e){-1!==b.bodyWidget.floatingElements.indexOf(e)&&"Inline"!==e.textWrappingStyle&&(b.bodyWidget.floatingElements.splice(b.bodyWidget.floatingElements.indexOf(e),1),t.paragraph.bodyWidget.floatingElements.push(e))}),w=w!==this.endOverlapWidget?w.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}}},psi.prototype.isImagePresent=function(e){for(var t=0;t<e.childWidgets.length;t++)for(var i=e.childWidgets[t],n=0;n<i.children.length;n++)if(i.children[n]instanceof rhi)return!0;return!1},psi.prototype.updateShapeBaseLocation=function(e){if(e instanceof Lai&&0<e.floatingElements.length)for(var t=0;t<e.floatingElements.length;t++){var i=e.floatingElements[t],n=this.getFloatingItemPoints(i);i.y=n.y,i.x=n.x,i instanceof Xli&&this.updateChildLocationForCellOrShape(i.y,i)}},psi.prototype.moveChildsToParagraph=function(e,t,i){i=this.addParagraphWidget(this.viewer.clientActiveArea,i);for(var n=0,o=t;o<e.childWidgets.length;o++){var r=e.childWidgets[o];(r.paragraph=i).childWidgets.splice(n,0,r),r.paragraph=i,n++}i.paragraphFormat=e.paragraphFormat,i.characterFormat=e.characterFormat,i.index=e.index,e.childWidgets.splice(t);for(o=0;o<e.floatingElements.length;o++){var s=e.floatingElements[o];s.line.paragraph!==e&&(i.floatingElements.push(s),e.floatingElements.splice(e.floatingElements.indexOf(s),1),o--)}return i},psi.prototype.addRemoveFloatElementsFromBody=function(e,t,i){if(0<e.floatingElements.length)for(var n=0;n<e.floatingElements.length;n++)i?-1===t.floatingElements.indexOf(e.floatingElements[n])&&"Inline"!==e.floatingElements[n].textWrappingStyle&&t.floatingElements.push(e.floatingElements[n]):-1!==t.floatingElements.indexOf(e.floatingElements[n])&&t.floatingElements.splice(t.floatingElements.indexOf(e.floatingElements[n]),1)},psi.prototype.alignBlockElement=function(e){if(e instanceof Lai&&(e.isEndsWithPageBreak||e.isEndsWithColumnBreak))return{node:void 0,position:{index:""}};for(var t,i=0,n=this.getPreviousBlock(e);n;){if(n instanceof Lai){if(!n.paragraphFormat.keepWithNext||n.isEndsWithPageBreak||n.isEndsWithColumnBreak)break;if((t=n).paragraphFormat.keepLinesTogether)je(this.getPreviousBlock(n))?t=void 0:i=0;else if(je(this.getPreviousBlock(n))&&1===n.childWidgets.length)t=void 0;else if(n.paragraphFormat.widowControl){if(0!==(i=1===(i=n.lastChild.indexInOwner-1)||i<0?0:i))break}else if(0!==(i=n.lastChild.indexInOwner))break}else if(n instanceof jai){var o=n.childWidgets[0];if(!(0<o.childWidgets.length))break;o=this.documentHelper.getFirstParagraphInCell(o);if(!o.paragraphFormat.keepWithNext&&(!(e instanceof jai&&e.rowFormat.isHeader&&n.rowFormat.isHeader)||je(n.ownerTable.previousWidget)))break;je(this.getPreviousBlock(n))?t=void 0:i=(t=n).indexInOwner}n=this.getPreviousBlock(n)}return{node:t=!je(t)&&t instanceof Lai&&0===t.indexInOwner&&t.paragraphFormat.keepWithNext&&t.paragraphFormat.widowControl?e:t,position:{index:i.toString()}}},psi.prototype.getPreviousBlock=function(e){var t;return e instanceof Lai?(t=e.previousWidget,!this.isInitialLoad&&je(t)&&e.containerWidget instanceof Sai&&!je(e.containerWidget.previousRenderedWidget)&&e.containerWidget.sectionIndex===e.containerWidget.previousRenderedWidget.sectionIndex&&!je(e.previousRenderedWidget)&&e.previousRenderedWidget instanceof Lai&&(t=e.previousRenderedWidget)):e instanceof jai&&je(t=e.previousWidget)&&(t=e.ownerTable.previousWidget),t=t instanceof _ai?t.lastChild:t},psi.prototype.splitRow=function(e){var t=e.ownerTable;if(0===e.indexInOwner)return t;for(var i=this.createTableWidget(t),n=e.indexInOwner;n<t.childWidgets.length;){var o=t.childWidgets.splice(n,1)[0];i.childWidgets.push(o),o.containerWidget=i,t.height-=o.height,i.height+=o.height}return t.containerWidget.childWidgets.splice(t.indexInOwner+1,0,i),i.containerWidget=t.containerWidget,i},psi.prototype.splitParagraph=function(e,t,i){if(0===t&&je(i))return e;for(var n,o=!1,r=(je(i)?((i=new Lai).containerWidget=e.containerWidget,e.containerWidget.childWidgets.splice(e.indexInOwner+1,0,i),i.paragraphFormat=e.paragraphFormat,i.characterFormat=e.characterFormat,i.index=e.index):0===t&&(o=!0,n=e,e=i,i=n),0),s=t;s<e.childWidgets.length;s++){var a=e.childWidgets[s];a.paragraph=i,o?i.childWidgets.push(a):i.childWidgets.splice(r,0,a),i.height+=a.height,e.height-=a.height,a.paragraph=i,r++}return i.width=e.width,o?(i.containerWidget.childWidgets.splice(i.indexInOwner,1),i.y=e.y,i.x=e.x,i.containerWidget=e.containerWidget,e.containerWidget.childWidgets.unshift(i)):e.childWidgets.splice(t),0!==e.childWidgets.length&&!o||e.containerWidget.childWidgets.splice(e.indexInOwner,1),i},psi.prototype.updateClientPositionForBlock=function(e,t){var i=e instanceof jai?e.ownerTable:e,n=!1;do{if(i instanceof Lai){if(t instanceof Lai&&t.equals(i)){n=!0;break}this.viewer.updateClientAreaForBlock(i,!0),this.addParagraphWidget(this.viewer.clientActiveArea,i),this.viewer.cutFromTop(this.viewer.clientActiveArea.y+i.height),this.viewer.updateClientAreaForBlock(i,!1)}else if(i instanceof _ai){this.viewer.updateClientAreaForBlock(i,!0),"Word2013"===this.documentHelper.compatibilityMode||i.isInsideTable||(this.viewer.clientActiveArea.x=this.viewer.clientActiveArea.x-Y.convertPointToPixel(i.firstChild.firstChild.leftMargin)),this.addTableWidget(this.viewer.clientActiveArea,[i]);var o=i.firstChild;if(t instanceof jai&&i.equals(t.ownerTable)&&!je(o)){do{if(o.equals(t)){n=!0;break}}while(this.addTableRowWidget(this.viewer.clientActiveArea,[o]),this.updateChildLocationForRow(this.viewer.clientActiveArea.y,o),this.viewer.cutFromTop(this.viewer.clientActiveArea.y+o.height),i.height+=o.height,o=o.nextWidget)}else this.updateChildLocationForTable(i.y,i),this.viewer.cutFromTop(this.viewer.clientActiveArea.y+i.height),this.viewer.updateClientAreaForBlock(i,!1)}}while((i=i.nextWidget)&&!n)},psi.prototype.updateClientAreaForNextBlock=function(e,t){for(var i=0;i<t.childWidgets.length;i++){var n=t.childWidgets[i];if(e===n)break;this.updateShapeBaseLocation(t),this.checkInbetweenShapeOverlap(n),this.viewer.cutFromTop(this.viewer.clientActiveArea.y+n.height)}},psi.prototype.layoutStartEndBlocks=function(e,t){var i=e;for(this.isOverlapFloatTable=!0,this.viewer.clientActiveArea.height=this.viewer.clientActiveArea.bottom-e.y,this.viewer.clientActiveArea.y=e.y,e=e instanceof _ai?this.documentHelper.getFirstParagraphInFirstCell(e):e,this.viewer.owner.isDocumentLoaded&&this.viewer.owner.editorModule&&this.viewer.owner.editorModule.updateWholeListItems(e);i;){this.viewer.updateClientAreaForBlock(i,!0),i instanceof Lai?this.layoutParagraph(i,0):(this.clearTableWidget(i,!0,!0,!0),this.layoutTable(i,0)),this.viewer.updateClientAreaForBlock(i,!1);var n=!je(i.nextWidget)&&i.nextWidget instanceof _ai&&i.nextWidget===t&&"Paragraph"===i.nextWidget.positioning.verticalOrigin,i=i===t||n?void 0:i.nextWidget}},psi.prototype.alignLineElements=function(e,t,i,n,o,r,s,a,l){var h,d,p;return 0<e.width&&(e instanceof pli||e instanceof lhi)?(h=e instanceof pli?e:void 0,d=(e instanceof pli?h:e).baselineOffset,t+=this.maxBaseline-d,i+=n-(e.height-d),!je(h)&&"Justify"===s&&0<a&&(h.isWidthUpdated=!1,d=h.width,s=h.text,o=o||0<(s=Y.trimStart(s)).length)&&(p=s.length-Y.removeSpace(s).length,l&&(p-=s.length-Y.trimEnd(s).length),a<p&&(d=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(s,h.characterFormat,h.scriptType),p=a),0<p)&&(h.width=d+r*p,a-=p)):(o=!0,t+=this.maxBaseline-e.height,i+=n),{topMargin:t,bottomMargin:i,addSubWidth:o,whiteSpaceCount:a}},psi.prototype.updateWidgetToPage=function(e,t,i){if(t.isInsideTable){var n=t.associatedCell;if(t.height=e.clientActiveArea.y-t.y,je(t.associatedCell)||je(t.associatedCell.ownerRow)||je(t.associatedCell.ownerRow.rowFormat))return;"Exactly"===t.associatedCell.ownerRow.rowFormat.heightType?n.height=Y.convertPointToPixel(t.associatedCell.ownerRow.rowFormat.height):[n].length<=1&&"AtLeast"===t.associatedCell.ownerRow.rowFormat.heightType&&!i?n.height=Math.max(Y.convertPointToPixel(t.associatedCell.ownerRow.rowFormat.height),this.getCellContentHeight(n,!1,t.indexInOwner)):n.height=n.height+t.height,t.containerWidget=n}else(!t.isEndsWithPageBreak&&!t.isEndsWithColumnBreak||e instanceof sai)&&(t.height=e.clientActiveArea.y-t.y);this.isRelayoutFootnote&&t.bodyWidget instanceof Pai&&(t.isInsideTable||(t.containerWidget.height+=t.height),this.shiftFootnoteChildLocation(t.bodyWidget,this.viewer)),t.bodyWidget instanceof Iai&&(t.isInsideTable||(t.containerWidget.height+=t.height),this.viewer.owner.enableHeaderAndFooter)&&-1!==t.bodyWidget.headerFooterType.indexOf("Footer")&&this.shiftFooterChildLocation(t.bodyWidget,this.viewer),e instanceof sai&&t.containerWidget instanceof Sai&&(t.containerWidget.height+=t.height)},psi.prototype.shiftFooterChildLocation=function(e,t){var i,n,o=e.page.bodyWidgets[0].sectionFormat.pageHeight;-1!==e.headerFooterType.indexOf("Footer")&&(i=e.page.bodyWidgets[0].sectionFormat.footerDistance,o=Y.convertPointToPixel(o-i),e.y+e.height>o?n=o-(e.y+e.height):e.y+e.height<o&&(n=e.y+e.height-o),je(n)||(n=o-(e.y+e.height),this.shiftChildLocation(n,e),t.clientActiveArea.y+=n))},psi.prototype.shiftFootnoteChildLocation=function(e,t){var i,n=e.page.bodyWidgets[0].sectionFormat.pageHeight,o=(e.page.bodyWidgets[0].sectionFormat.footerDistance,e.page.bodyWidgets[0].sectionFormat.bottomMargin),n=Y.convertPointToPixel(n-o);e.y+e.height>n?i=n-(e.y+e.height):e.y+e.height<n&&(i=e.y+e.height-n),je(i)||(i=n-(e.y+e.height),this.shiftChildLocation(i,e),t.clientActiveArea.y+=i)},psi.prototype.checkPreviousElement=function(e,t){for(var i=e.paragraph,n=!1,o=0,r="Justify"===i.paragraphFormat.textAlignment,s=t-1;0<=s;s--){var a=e.children[s];if(a instanceof pli&&(0<a.width||!r&&"\t"===a.text)){var l=a.text,o=s;if(0<l.length&&(" "===l[l.length-1]||"-"===l[l.length-1])){if(s===t-1)return this.addSplittedLineWidget(e,t-1),!0;n=!0;break}if(!this.isRelayoutOverlap&&!r&&a instanceof Ili&&"\t"===l&&0!==o){o--,n=!0;break}if("\t"===l||this.documentHelper.textHelper.isUnicodeText(l,a.scriptType))return!1;if(0<=l.indexOf(" ")){var n=!0,h=l.lastIndexOf(" ")+1,d=new pli;d.text=l.substr(h),d.characterFormat.copyFormat(a.characterFormat),d.characterRange=a.characterRange,0<a.revisions.length&&(this.updateRevisionForSplittedElement(a,d,0<h),d.isMarkedForRevision=a.isMarkedForRevision),a.text=l.substr(0,h),this.documentHelper.textHelper.getTextSize(d,a.characterFormat),a.width-=d.width," "===a.text[a.text.length-1]?a.trimEndWidth=this.documentHelper.textHelper.getWidth(Y.trimEnd(a.text),a.characterFormat,a.scriptType):a.trimEndWidth=a.width,a.height=d.height,0===a.width&&(e.children.splice(s,1),!je(e.layoutedElements))&&0<e.layoutedElements.length&&e.layoutedElements.splice(s,1),e.children.splice(s+1,0,d),je(e.layoutedElements)||e.layoutedElements.splice(s+1,0,d);break}}else if(!(a instanceof lhi||a instanceof Zai||a instanceof pli&&0===a.width||a instanceof Khi||a instanceof Pli)){o=s,n=!0;break}}if(n&&++o<e.children.length){for(var p=0,s=o;s<e.children.length;s++)p+=e.children[s].width,this.addSplittedLineWidget(e,s-1),s--;"Justify"===i.paragraphFormat.textAlignment&&"Word2013"===this.documentHelper.compatibilityMode||this.viewer.updateClientWidth(p)}return n},psi.prototype.clearListElementBox=function(e){if(0!==e.childWidgets.length){var t=e.childWidgets[0];if(!je(t.children)){for(var i=t.children.length-1;0<i&&t.children[i]instanceof lhi;i--)t.children.splice(i,1);for(i=0;i<t.children.length&&t.children[i]instanceof lhi;i++)t.children.splice(i,1),i--}}},psi.prototype.clearInvalidList=function(e){e&&(-1===e.abstractListId&&-1!==this.documentHelper.abstractLists.indexOf(e.abstractList)&&this.documentHelper.abstractLists.splice(this.documentHelper.abstractLists.indexOf(e.abstractList),1),-1===e.listId)&&-1!==this.documentHelper.lists.indexOf(e)&&this.documentHelper.lists.splice(this.documentHelper.lists.indexOf(e),1)},psi.prototype.getListNumber=function(e,t){var i,n=this.documentHelper.getListById(e.listId),o=e.listLevelNumber,e=this.getListLevel(n,e.listLevelNumber),r=je(n.levelOverrides)?void 0:n.levelOverrides[o];return!je(r)&&-1===this.documentHelper.renderedLevelOverrides.indexOf(n)&&je(r.overrideListLevel)&&(this.documentHelper.renderedLevelOverrides.push(n),r=this.documentHelper.getAbstractListById(n.abstractListId),this.documentHelper.renderedLists.containsKey(r))&&(i=this.documentHelper.renderedLists.get(r)).containsKey(o)&&(i.remove(o),this.ClearSubListLevelValues(n,r,o)),je(t)&&this.updateListValues(n,o),this.getListText(n,o,e)},psi.prototype.ClearSubListLevelValues=function(e,t,i){for(var n=this.documentHelper.renderedLists.get(t),o=i+1;o<t.levels.length;){var r=this.getListLevel(e,o);n.containsKey(o)&&r.restartLevel>i&&n.remove(o),o++}},psi.prototype.getListStartValue=function(e,t){var i=je(t.levelOverrides)?void 0:t.levelOverrides[e];return(je(i)||!je(i.overrideListLevel))&&je(i=this.getListLevel(t,e))?0:i.startAt},psi.prototype.updateListValues=function(e,t){var i=this.documentHelper.getAbstractListById(e.abstractListId),n=this.getListLevel(e,t);if(this.documentHelper.renderedLists.containsKey(i)){var o=this.documentHelper.renderedLists.get(i);if(o.containsKey(t))for(var r=o.get(t),s=(o.set(t,r+1),t+1);s<this.documentHelper.getAbstractListById(e.abstractListId).levels.length;){l=this.getListLevel(e,s);o.containsKey(s)&&(l.restartLevel>t||"Bullet"===n.listLevelPattern)&&o.remove(s),s++}else{for(s=t;!o.containsKey(s-1)&&0<s;){l=this.getListLevel(e,s-1);o.add(s-1,this.getListStartValue(s-1,e)),s--}r=this.getListStartValue(t,e);o.add(t,r)}}else for(var a=new uJt,l=(this.documentHelper.renderedLists.add(i,a),this.getListLevel(e,t)),h=0;h<=t;h++)a.add(h,this.getListStartValue(h,e))},psi.prototype.getListText=function(e,t,i){var n=i.numberFormat;if(this.documentHelper.renderedLists.containsKey(this.documentHelper.getAbstractListById(e.abstractListId)))for(var o=this.documentHelper.renderedLists.get(this.documentHelper.getAbstractListById(e.abstractListId)),r=o.keys,s=0;s<r.length;s++){var a=r[s],l="%"+(a+1).toString(),h=this.getListLevel(e,a),d=s<t?"LeadingZero"!==h.listLevelPattern?"Arabic":h.listLevelPattern:void 0;if(n.match(l)){if(t<a)return"";n=o.containsKey(a)&&!je(h)?n.replace(l,this.getListTextListLevel(h,o.get(a),i.isLegalStyleNumbering?d:void 0)):n.replace(l,"0")}}return n},psi.prototype.getAsLetter=function(e){for(var t=e/26,e=e%26,i=(0===e&&(e=26,t--),String.fromCharCode(64+e)),n="";0<=t;)n+=i.toString(),t--;return n},psi.prototype.getListTextListLevel=function(e,t,i){switch(je(i)?e.listLevelPattern:i){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":return t.toString();case"OrdinalText":return(3082===e.characterFormat.localeIdAscii||3082===this.documentHelper.characterFormat.localeIdAscii?this.getOrdinalTextInSpanish(!0,t.toString()):this.getOrdinalText(!0,t.toString())).toUpperCase();case"Ordinal":return this.getAsOrdinal(t,e.characterFormat).toString();case"FarEast":case"Special":return t.toString();default:return""}},psi.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()}},psi.prototype.generateNumber=function(e,t,i){for(var n="";t<=e;)n+=i,this.value=e-=t;return n.toString()},psi.prototype.getAsLeadingZero=function(e){return e<10?"0"+e.toString():e.toString()},psi.prototype.getAsRoman=function(e){var t="";return this.value=e,(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t+=this.generateNumber(this.value,1e3,"M"))+this.generateNumber(this.value,900,"CM"))+this.generateNumber(this.value,500,"D"))+this.generateNumber(this.value,400,"CD"))+this.generateNumber(this.value,100,"C"))+this.generateNumber(this.value,90,"XC"))+this.generateNumber(this.value,50,"L"))+this.generateNumber(this.value,40,"XL"))+this.generateNumber(this.value,10,"X"))+this.generateNumber(this.value,9,"IX"))+this.generateNumber(this.value,5,"V"))+this.generateNumber(this.value,4,"IV"))+this.generateNumber(this.value,1,"I")).toString()},psi.prototype.getOrdinalText=function(e,t){if(e){t=t.trim();for(var i=0;i<t.length;i++)if(/[a-zA-Z]/.test(t.charAt(i))){e=!1;break}e&&(t=this.numberToWords(parseInt(t),!1))}return t},psi.prototype.numberToWords=function(e,t){var i,n;return 0===e?"zero":(i="",0<Math.floor(e/1e6)&&(i+=this.numberToWords(Math.floor(e/1e6),t)+" million ",t||e%10!=0||(i+="th "),e%=1e6),0<Math.floor(e/1e3)&&(i+=this.numberToWords(Math.floor(e/1e3),t)+" thousand ",t||e%10!=0||(i+="th "),e%=1e3),0<Math.floor(e/100)&&(i+=this.numberToWords(Math.floor(e/100),t)+" hundred ",t||e%10!=0||(i+="th "),e%=100),0<e&&(""!==i&&t&&(i+="and "),n=null,n=t?["","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"]:["","first","second","third","fourth","fifth","sixth","seventh","eighth","ninth","tenth","eleventh","twelfth","thirteenth","fourteenth","fifteenth","sixteenth","seventeenth","eighteenth","nineteenth"],e<20?i+=n[e]:((t||0<e%10)&&(i+=["","ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"][Math.floor(e/10)]),e%10!=0||t?0<e%10&&(i+="-"+n[e%10]):i+=["","tenth","twentieth","thirtieth","fortieth","fiftieth","sixtieth","seventieth","eightieth","ninetieth"][Math.floor(e/10)])),i)},psi.prototype.getOrdinalTextInSpanish=function(e,t){if(e){t=t.trim();for(var i=0;i<t.length;i++)if(/[a-zA-Z]/.test(t.charAt(i))){e=!1;break}e&&(t=this.numberToSpanishWords(parseInt(t),!1))}return t},psi.prototype.numberToSpanishWords=function(e,t){var i,n,o,r;return 0===e&&t?"cero":(i="",0<Math.floor(e/1e3)&&e<=1e4&&(i+=(t?["","mil","dos mil","tres mil","cuatro mil","cinco mil","seis mil","siete mil","ocho mil","nueve mil","diez mil"]:["","milésimo","dosmilésimo","tresmilésimo","cuatromilésimo","cincomilésimo","seismilésimo","sietemilésimo","ochomilésimo","nuevemilésimo","diezmilésimo"])[Math.floor(e/1e3)],e%=1e3),0<Math.floor(e/100)&&(""!==i&&(i+=" "),i+=(t?["","ciento","doscientos","trescientos","cuatrocientos","quinientos","seiscientos","setecientos","ochocientos","novecientos"]:["","centésimo","ducentésimo","tricentésimo","cuadringentésimo","quingentésimo","sexcentésimo","septingentésimo","octingentésimo","noningentésimo"])[Math.floor(e/100)],e%=100),0<e&&e<100&&(""!==i&&(i+=" "),n=null,n=t?["","uno","dos","tres","cuatro","cinco","seis","siete","ocho","nueve","diez","once","doce","trece","catorce","quince","dieciséis","diecisiete","dieciocho","diecinueve"]:["","primero","segundo","tercero","cuarto","quinto","sexto","séptimo","octavo","noveno","décimo","undécimo","duodécimo","decimotercero","decimocuarto","decimoquinto","decimosexto","decimoséptimo","decimoctavo","decimonoveno"],o=["","diez","veinte","treinta","cuarenta","cincuenta","sesenta","setenta","ochenta","noventa"],r=["","décimo","vigésimo","trigésimo","cuadragésimo","quincuagésimo","sexagésimo","septuagésimo","octogésimo","nonagésimo"],e<20?i+=n[e]:20<e&&e<30&&t?i+=["","veintiuno","veintidós","veintitrés","veinticuatro","veinticinco","veintiséis","veintisiete","veintiocho","veintinueve"][e%10]:((t&&0<e%10||t&&e%10==0)&&(i+=o[Math.floor(e/10)]),0<e%10&&!t&&(i+=r[Math.floor(e/10)]),e%10!=0||t?0<e%10&&(i+=t?" y "+n[e%10]:" "+n[e%10]):i+=r[Math.floor(e/10)])),i)},psi.prototype.getAsOrdinal=function(e,t){switch(t.localeIdAscii){case 1069:case 8218:case 5146:case 4122:case 1050:case 1029:case 1061:case 1035:case 3079:case 1031:case 5127:case 4103:case 2055:case 1038:case 1060:case 1055:case 1044:case 2068:case 1045:case 6170:case 2074:return e.toString()+".";case 2060:case 11276:case 3084:case 9228:case 12300:case 1036:case 15372:case 5132:case 13324:case 6156:case 14348:case 8204:case 10252:case 4108:return 1==e?e.toString()+"er":e.toString()+"e";case 2067:case 1043:return e.toString()+"e";case 1032:return e.toString()+"o";case 1040:case 2064:return e.toString()+String.fromCharCode(176);case 5130:case 7178:case 12298:case 17418:case 4106:case 1046:case 2070:case 11274:case 16394:case 13322:case 9226:case 18442:case 2058:case 19466:case 6154:case 15370:case 10250:case 20490:case 3082:case 1034:case 21514:case 14346:case 8202:return e.toString()+String.fromCharCode(186);case 1049:case 2073:return e.toString()+"-"+String.fromCharCode(1081);case 2077:case 1053:return this.getOrdinalInSwedish(e);case 1027:return this.getOrdinalInCatalan(e);case 1030:return this.getOrdinalInDanish(e);default:return this.getOrdinalInEnglish(e)}},psi.prototype.getOrdinalInEnglish=function(e){switch(e%100){case 11:case 12:case 13:return e.toString()+"th"}switch(e%10){case 1:return e.toString()+"st";case 2:return e.toString()+"nd";case 3:return e.toString()+"rd";default:return e.toString()+"th"}},psi.prototype.getOrdinalInSwedish=function(e){return 11!=e&&12!=e&&(e%10==1||e%10==2)?e.toString()+":a":e.toString()+":e"},psi.prototype.getOrdinalInCatalan=function(e){switch(e){case 1:return e.toString()+".";case 2:return e.toString()+"n";case 3:return e.toString()+"r";case 4:return e.toString()+"t";case 14:return e.toString()+String.fromCharCode(232)+"h";default:return e.toString()+String.fromCharCode(232)}},psi.prototype.getOrdinalInDanish=function(e){if(0==e)return e.toString()+"te";switch(e%100){case 0:return e.toString()+"ende";case 1:return e.toString()+"ste";case 2:return e.toString()+"nden";case 3:return e.toString()+"dje";case 4:return e.toString()+"rde";case 5:case 6:case 11:case 12:case 30:return e.toString()+"te";default:return e.toString()+"nde"}},psi.prototype.getListLevel=function(e,t){if(!je(e)){var i=this.documentHelper.getAbstractListById(e.abstractListId),n=(!je(e)&&i.levels.length<=t&&0<=t&&t<9&&this.addListLevels(i),void 0);if(!je(e.levelOverrides)&&!je(n=this.getOverrideListLevel(e.levelOverrides,t))&&!je(n.overrideListLevel))return je(n.startAt)&&(n.overrideListLevel.startAt=i.levels[t].startAt),n.overrideListLevel;if(!je(i)&&0<=t&&t<i.levels.length)return i.levels[t]}},psi.prototype.getOverrideListLevel=function(e,t){for(var i=0;i<e.length;i++)if(e[i].levelNumber==t)return e[i]},psi.prototype.getTabWidth=function(e,t,i,n,o){if(o.characterFormat.hidden)return 0;var r=0,s=!1,a=e.paragraphFormat.getUpdatedTabs(),l=!1,h=e.bodyWidget.sectionFormat,d=(Y.convertPointToPixel(h.leftMargin),!1),h=(je(e.paragraphFormat.listFormat.listLevel)||je(e.paragraphFormat.listFormat.listLevel.paragraphFormat)||(h=e.paragraphFormat.listFormat.listLevel.paragraphFormat,e.paragraphFormat.leftIndent!==h.leftIndent&&(l=!0)),0),p=t.clientActiveArea.x,c=Y.convertPointToPixel(e.paragraphFormat.firstLineIndent),u=Y.convertPointToPixel(e.paragraphFormat.leftIndent);if(!je(o)&&n.isFirstLine()?(h=this.viewer.clientArea.x+c,l&&(p+=c)):h=this.viewer.clientArea.x,p<h&&("Word2003"!==this.documentHelper.compatibilityMode||0===a.length))return t.clientArea.x-t.clientActiveArea.x;for(var g=t.clientActiveArea.x-(t.clientArea.x-Y.convertPointToPixel(e.paragraphFormat.leftIndent)),m=0;m<a.length;m++){var f=a[m],y=Y.convertPointToPixel(f.position);y<u&&(d=parseFloat(g.toFixed(2))<parseFloat(y.toFixed(2)))}if(n.isFirstLine()&&0<u&&c<0&&(o instanceof lhi||!d)){if(0<t.clientArea.x-t.clientActiveArea.x)return t.clientArea.x-t.clientActiveArea.x;0===a.length&&e.paragraphFormat.listFormat&&e.paragraphFormat.listFormat.listLevel&&(a=e.paragraphFormat.listFormat.listLevel.paragraphFormat.tabs)}var v=Y.convertPointToPixel(this.documentHelper.defaultTabWidth);if(0===a.length&&(0<g&&v>Math.round(g)&&l||v===this.defaultTabWidthPixel&&v>Math.round(g)&&0<g))return v-g;var b=!1;if(0<a.length){for(m=a.length-1;-1<m;m--){var f=a[m],w=Y.convertPointToPixel(f.position);if(!(parseFloat(w.toFixed(2))>parseFloat(g.toFixed(2))||0<m&&Y.convertPointToPixel(a[m-1].position)>parseFloat(g.toFixed(2)))){m!=a.length-1&&(v=(w=this.getJustificationTabWidth(a[m+1],o,n,e,v,g,r)).defaultTabWidth,r=w.fPosition,g=w.position,s=!0),b=!0;break}}b||(v=(p=this.getJustificationTabWidth(a[0],o,n,e,v,g,r)).defaultTabWidth,r=p.fPosition,g=p.position,s=!0)}return s||((h=parseFloat((100*g%(100*v)/100).toFixed(2)))<0&&l&&(h+=v),r=(1+(g-h)/v)*v),parseFloat(r.toFixed(1))!==parseFloat(g.toFixed(1))&&0<r-g?r-g:v},psi.prototype.getJustificationTabWidth=function(e,t,i,n,o,r,s){var a,l,h=t?this.documentHelper.textHelper.getTextSize(t,t.characterFormat):0;return s="Left"===e.tabJustification||"List"===e.tabJustification?Y.convertPointToPixel(e.position):(a=Y.convertPointToPixel(e.position)-r,(i=this.getRightTabWidth(t.indexInOwner+1,i,n))<a&&"Decimal"!=e.tabJustification?"Right"===e.tabJustification?(o=a-i,n=Y.convertPointToPixel(n.rightIndent),l=this.viewer.clientActiveArea.width+n-o,this.viewer.clientActiveArea.width+=n,l<0?o+=l-i:l<i&&(o-=i-l)):o=a-i/2:o="Center"===e.tabJustification&&i/2<a?a-i/2:"Decimal"===e.tabJustification?!je(t.nextElement)&&t.nextElement instanceof pli?-1!=(n=t.nextElement).text.indexOf(".")?(l=n.text.indexOf("."),l=n.text.substring(0,l),a-this.documentHelper.textHelper.getWidth(l,n.characterFormat,n.scriptType)):i<a?a-i:a:a:"Right"===e.tabJustification?0:h,r),t instanceof Ili&&(t.tabLeader=e.tabLeader,t.tabText=""),{defaultTabWidth:o,fPosition:s,position:r}},psi.prototype.getRightTabWidth=function(e,t,i){for(var n,o=0,r=!1,s=t.children[e];s;){if(s instanceof Zai||s instanceof Dli||r?(s instanceof Zai&&(0===s.fieldType?r=!0:2===s.fieldType&&(r=!1)),s.width=0):(s instanceof Sli&&!this.isTocField(s.fieldBegin)&&""!==(n=this.documentHelper.getFieldResult(s.fieldBegin,s.paragraph.bodyWidget.page))&&(s.text=n),s instanceof pli&&this.documentHelper.textHelper.getTextSize(s,s.characterFormat)),s instanceof pli&&"\t"===s.text)return o;o=s instanceof Xli&&"Inline"!==s.textWrappingStyle?o:o+s.width,s=s.nextNode}return o},psi.prototype.getSplitIndexByWord=function(e,t,i,n,o){for(var r=0,s=t.length;r<s;){var a=this.getTextIndexAfterSpace(t,r),l=i;if(!((l=((a=0!==a&&a!==s?a:s-1)<s-1||a===s-1&&" "===t[a-1])&&r!==a?this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(t.slice(0,a),n,o):l)<=e)){0===r&&" "===t[0]&&(r=this.getTextIndexAfterSpace(t,0));break}r=a}return r},psi.prototype.getTextSplitIndexByCharacter=function(e,t,i,n,o,r){for(var s=i.length,a=0;a<s;a++){var l=n;if(t<(l=a+1<s?this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(i.substring(0,a+1),o,r):l))return 0===a&&e<l?1<s&&" "===i[1]?this.getTextIndexAfterSpace(i,1):1:" "===i[a]?this.getTextIndexAfterSpace(i,a):a}return 0},psi.prototype.getSubWidth=function(e,t,i,n,o){var r=0,s=!0,a="",l=0,h=e.paragraph.paragraphFormat.bidi;if(0<this.wrapPosition.length){var d=this.getSubWidthBasedOnTextWrap(e,t,i,n,o);if(0<d.length)return d}for(var p=e.renderedElements,c=p.length-1;0<=c;c--){var u=p[c];if(0<u.width&&u instanceof pli){var g=u.text,a=g+a;!(s=t&&h?" "===g&&0<=c-1&&" "===p[c-1].text:s)||""===g.trim()&&"\t"!==g?s?l+=u.width:r+=u.width:(Y.endsWith(g)?(r+=g=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(g,u.characterFormat,u.scriptType),l+=u.width-g):r+=u.width,s=!1)}else{if(a="a"+a,s=!1,u instanceof qli&&"Inline"!==u.textWrappingStyle)continue;r+=u.width}t||(r=Math.round(r))}d=a.length-Y.removeSpace(a).length,i=(a=a.trim()).length-Y.removeSpace(a).length,e=this.viewer.clientArea.width-n-r,n=this.viewer.clientArea.width-n-(r+l);return h&&t&&(n<0?l=-l:e=n),e<=0&&!this.is2013Justification||0===i&&t&&!h?e=i=0:t?!o&&0<i||o&&this.is2013Justification&&0<i?e/=i:i=0:0<l&&h&&o&&(e-=l),[{trimmedSpaceWidth:l,subWidth:e,spaceCount:i,totalSpaceCount:d}]},psi.prototype.getSubWidthBasedOnTextWrap=function(e,t,i,n,o){for(var r=[],s=0,a="",l=this.wrapPosition.length-1,h=!0,d=e.children.length-1;0<=d;d--){var p=e.children[d];if(0<p.width&&p instanceof pli?(a=(u=p.text)+a,!h||""===u.trim()&&"\t"!==u?h||(s+=p.width):(Y.endsWith(u)?s+=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(u,p.characterFormat,p.scriptType):s+=p.width,h=!1)):(a="a"+a,h=!1,p instanceof qli&&"Inline"!==p.textWrappingStyle||(s+=p.width)),(0<p.padding.left||0===d)&&0<=l){for(var c=this.wrapPosition[l--];c.width<=0&&0<=l;)c=this.wrapPosition[l--];var u=this.getSubWidthInfo(e,c.width,s,a,i,t,o);je(u)||(s=0,a="",r.unshift(u))}}return r},psi.prototype.isWordFittedByJustification=function(e,t){var e=e.line,i=e.paragraph.paragraphFormat,n=i.textAlignment,o=e.isLastLine(),r=0,s=(e.isFirstLine()&&(r=Y.convertPointToPixel(i.firstLineIndent)),this.viewer.clientActiveArea.width);if(0!=t&&t/2<=s){var a=void 0,l=0;if("Left"!==n&&this.viewer.textWrap&&("Justify"!==n||!o||"Justify"===n&&i.bidi||this.is2013Justification&&o)&&((a=this.getSubWidth(e,"Justify"===n,0,r,o))[0].spaceCount,l=a[0].totalSpaceCount),!je(a)&&1==a.length&&0<s&&"Justify"===n&&"Word2013"===this.documentHelper.compatibilityMode&&!this.is2013Justification&&0===i.rightIndent&&0===i.leftIndent){r=0,o=this.getTotalSpaceWidth(e,l),a=o/l;if(t<=s+(r=((s+o)/l-a)/a*100<=33?o/8:o/4))return this.viewer.clientActiveArea.x-=r,this.viewer.clientActiveArea.width+=r,this.is2013Justification=!0}}return!1},psi.prototype.getTotalSpaceWidth=function(e,t){var i=0,n=0;if(e)for(var o=0;o<e.children.length;o++){var r,s=e.children[o];if(s instanceof pli&&0<(r=s.text.length-Y.removeSpace(s.text).length)&&(i+=r*this.documentHelper.textHelper.getWidth(" ",s.characterFormat,s.scriptType),n+=r),!je(t)&&t<=n)break}return i},psi.prototype.getSubWidthInfo=function(e,t,i,n,o,r,s){if(0<t)return t=t-i,o=(n=n.trim()).length-Y.removeSpace(n).length,(i=t)<=0||0===o&&r&&!e.paragraph.paragraphFormat.bidi?i=o=0:r&&(!s&&0<o?i/=o:o=0),{trimmedSpaceWidth:0,subWidth:i,spaceCount:o,totalSpaceCount:o}},psi.prototype.getBeforeSpacing=function(e,t){var i,n,o,r=0;return this.documentHelper.dontUseHtmlParagraphAutoSpacing?r=e.paragraphFormat.beforeSpacing:(i=e.previousWidget)instanceof Lai?(n=this.getAfterSpacing(i),o=e.paragraphFormat.beforeSpacing,n<(o=e.paragraphFormat.spaceBeforeAuto?14:o)&&(r=o-n)):i instanceof _ai?r=e.paragraphFormat.spaceBeforeAuto?14:e.paragraphFormat.beforeSpacing:0<t&&e===e.bodyWidget.childWidgets[0]?this.documentHelper.pages[t].sectionIndex!==this.documentHelper.pages[t-1].sectionIndex&&(r=e.paragraphFormat.spaceBeforeAuto?14:e.paragraphFormat.beforeSpacing):r=e.paragraphFormat.spaceBeforeAuto?0:e.paragraphFormat.beforeSpacing,this.isSameStyle(e,!1)?0:Y.convertPointToPixel(r)},psi.prototype.getAfterSpacing=function(e){var t=e.paragraphFormat.afterSpacing;return!this.documentHelper.dontUseHtmlParagraphAutoSpacing&&e.paragraphFormat.spaceAfterAuto&&(t=je(e.nextWidget)&&e.isInsideTable?0:14),this.isSameStyle(e,!0)?0:t},psi.prototype.getLineSpacing=function(e,t,i){if(je(e.paragraphFormat))return 0;var n=0;switch(e.paragraphFormat.lineSpacingType){case"AtLeast":case"Exactly":n=Y.convertPointToPixel(e.paragraphFormat.lineSpacing);break;default:n=e.paragraphFormat.lineSpacing,i&&(n-=1),n*=t}return n},psi.prototype.isParagraphFirstLine=function(e,t){var i=e;return!(!je(i.childWidgets)&&0!==i.childWidgets.indexOf(t)||0<t.children.length&&!je(e.previousWidget)&&e.previousWidget instanceof Lai&&t.paragraph.index===e.previousWidget.index)},psi.prototype.isParagraphLastLine=function(e){var t=e.line.paragraph,t=t.childWidgets[t.childWidgets.length-1],t=t.children[t.children.length-1];return e===t&&(t instanceof Zai||!(t instanceof pli&&"\v"===t.text))},psi.prototype.getTextIndexAfterSpace=function(e,t){var i=e.length,n=0,o=0,n=e.indexOf(" ",t)+1,r=(0<(o=1==(o=e.indexOf("-",t)+1)?e.indexOf("-",o+1)+1:o)&&0<n?n=Math.min(n,o):0<o&&0==n&&(n=o),n);if(0!==r&&r!==i)for(;" "===e[r]&&++r!==i;);return r},psi.prototype.moveNextWidgetsToTable=function(e,t,i){for(var n=t.indexInOwner,o=e[e.length-1],r=(i&&(n+=1),t.containerWidget.childWidgets.splice(n)),s=0;s<r.length;s++)o.childWidgets.push(r[s]),r[s].containerWidget=o},psi.prototype.addTableCellWidget=function(e,t,i,n){var o,r=0,s=0,a=0,l=(je(e.cellFormat)||(a=e.cellFormat.containsMargins()?(s=je(e.cellFormat.leftMargin)?Y.convertPointToPixel(e.ownerTable.tableFormat.leftMargin):Y.convertPointToPixel(e.cellFormat.leftMargin),je(e.cellFormat.rightMargin)?Y.convertPointToPixel(e.ownerTable.tableFormat.rightMargin):Y.convertPointToPixel(e.cellFormat.rightMargin)):(s=0===e.columnIndex&&e.ownerRow.rowFormat.hasValue("leftMargin")?Y.convertPointToPixel(e.ownerRow.rowFormat.leftMargin):Y.convertPointToPixel(e.ownerTable.tableFormat.leftMargin),e.columnIndex===e.ownerTable.tableHolder.columns.length-1&&e.ownerRow.rowFormat.hasValue("rightMargin")?Y.convertPointToPixel(e.ownerRow.rowFormat.rightMargin):Y.convertPointToPixel(e.ownerTable.tableFormat.rightMargin))),0===(o=je(e.ownerTable)||je(e.ownerTable.tableFormat)?0:Y.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing))&&e.ownerTable.isContainInsideTable&&!e.ownerTable.header&&(l=Uai.getCellTopBorder(e),0===e.topMargin&&.75===l.lineWidth&&(i+=Y.convertPointToPixel(.5)),l=Uai.getCellLeftBorder(e),e.leftMargin<=.5)&&.75===l.lineWidth&&(s+=Y.convertPointToPixel(.8)),e.margin=new gai(s,i,a,n),e.ownerTable.tableFormat.allowAutoFit,e.cellFormat.cellWidth),i=("Percent"===e.cellFormat.preferredWidthType&&0!==e.cellFormat.preferredWidth&&l<=0&&(s=Y.convertPointToPixel(e.ownerTable.getTableClientWidth(e.ownerTable.getContainerWidth())),l=e.ownerTable.getCellWidth(e.cellFormat.preferredWidth,e.cellFormat.preferredWidthType,s,e)),e.width=Y.convertPointToPixel(l),0),a=((r=je(e.previousWidget)?r:e.previousWidget.columnIndex+e.previousWidget.cellFormat.columnSpan)<e.columnIndex&&(i=Y.convertPointToPixel(e.ownerTable.tableHolder.getPreviousSpannedCellWidth(r,e.columnIndex)),0===r)&&(i-=o/2),e.x=t.x+i+e.margin.left,e.y=t.y+e.margin.top+o,e.width=e.width-e.margin.left-e.margin.right,0<o&&(e.x+=o,1===e.ownerTable.tableHolder.columns.length?e.width-=2*o:0===e.columnIndex||e.columnIndex===e.ownerTable.tableHolder.columns.length-1?e.width-=2*o-o/2:e.width-=o),Y.convertPointToPixel(Uai.getCellLeftBorder(e).getLineWidth())),n=Y.convertPointToPixel(Uai.getCellRightBorder(e).getLineWidth()),s=!1,l=(e.leftBorderWidth=e.ownerTable.isBidiTable?n:a,"None"===e.cellFormat.borders.left.lineStyle),r="None"===e.cellFormat.borders.right.lineStyle;e.x+=!l||0<e.leftBorderWidth?0:e.leftBorderWidth,e.width-=!l||0<e.leftBorderWidth?0:e.leftBorderWidth,e.ownerTable.isBidiTable?e.cellIndex:(e.cellIndex,e.ownerRow.childWidgets.length);return(0<o||e.columnIndex===e.ownerTable.tableHolder.columns.length-1||e.index===e.containerWidget.childWidgets.length-1)&&(e.rightBorderWidth=e.ownerTable.isBidiTable?a:n,e.ownerTable.tableFormat.allowAutoFit||(e.width-=e.rightBorderWidth),this.isInsertTable()||(s=this.checkPreviousMargins(e.ownerTable))),e.margin.right+=r&&!s?0:e.rightBorderWidth,e},psi.prototype.checkPreviousMargins=function(e){for(var t=0;t<e.childWidgets.length;t++)for(var i=e.childWidgets[t],n=0;n<i.childWidgets.length;n++)if("None"!==i.childWidgets[i.childWidgets.length-1].cellFormat.borders.right.lineStyle)return!0;return!1},psi.prototype.addWidgetToTable=function(e,t,i,n,o,r,s,a,l){var h=t[0],d=h.childWidgets.length,p=void 0,c=i.indexOf(n),u=[];if(0<c?p=i[c-1]:n.previousRenderedWidget instanceof jai&&n.previousRenderedWidget.ownerTable.equals(n.ownerTable)&&(p=n.previousRenderedWidget),je(p)||(d=(h=p.containerWidget).childWidgets.indexOf(p)+1,Math.round(n.y)!==Math.round(p.y+p.height)&&((p=t.indexOf(h))+1>=t.length&&this.addTableWidget(e.clientActiveArea,t,!0),d=(h=t[p+1]).childWidgets.length),0<c&&(d=0)),this.updateRowHeightBySpannedCell(h,n,d),this.updateRowHeightByCellSpacing(t,n,e),n.containerWidget&&n.containerWidget!==h&&-1!==n.containerWidget.childWidgets.indexOf(n)&&n.containerWidget.childWidgets.splice(n.containerWidget.childWidgets.indexOf(n),1),-1===h.childWidgets.indexOf(n)&&(h.childWidgets.splice(d,0,n),l)&&(h.bodyWidget.page.repeatHeaderRowTableWidget=!0),n.containerWidget=h,!n.ownerTable.isInsideTable){if(0<o.length)je(o)||(u=this.getFootnoteBody(o));else if(!je(n))for(var g=0;g<n.childWidgets.length;g++)for(var m=n.childWidgets[g],f=0;f<m.childWidgets.length;f++)for(var y=this.getFootNoteWidgetsOf(m.childWidgets[f],!0),v=0;v<y.length;v++)u.splice(u.length,0,y[v]);0<u.length&&je(u[0].containerWidget)?this.layoutFootnoteInSplittedRow(n,u):!je(u)&&0<u.length&&void 0!==n.bodyWidget.previousRenderedWidget&&a!==n.bodyWidget.page.index&&u[0].containerWidget.page.index!==n.bodyWidget.page.index?this.moveFootNotesToPage(u,u[0].containerWidget.page.bodyWidgets[0],n.bodyWidget):0<u.length&&!this.isInitialLoad&&!je(n.bodyWidget.page.footnoteWidget)&&this.layoutfootNote(n.bodyWidget.page.footnoteWidget),o.length=0}h.height=h.height+n.height,this.viewer instanceof nai&&(je(h.containerWidget)||!(0<=h.containerWidget.childWidgets.indexOf(h))||h.containerWidget instanceof Iai||(h.containerWidget.height+=n.height)),this.updateHeightForRowWidget(e,!1,t,i,n,!1,r,s),e.cutFromTop(n.y+n.height),this.viewer.clientActiveArea.height-=this.getFootNoteHeight(u),n.ownerTable.isInsideTable||(this.existFootnoteHeight=0)},psi.prototype.layoutFootnoteInSplittedRow=function(e,t){if(t&&0<t.length){je(e.ownerTable.bodyWidget.page.footnoteWidget)&&this.addEmptyFootNoteToBody(e.ownerTable.bodyWidget);var i=e.ownerTable.bodyWidget.page.footnoteWidget;if(i){for(var n=0;n<t.length;n++)i.bodyWidgets.push(t[n]),t[n].containerWidget=i;this.layoutfootNote(i)}}},psi.prototype.getFootNoteHeight=function(e){var t=0;if(Array.isArray(e))for(var i=0;i<e.length;i++)t+=this.getFootnoteHeightInternal(e[i],i);else t=this.getFootnoteHeightInternal(e,0);return t},psi.prototype.getFootnoteHeightInternal=function(e,t){for(var i=0,n=0;n<e.childWidgets.length;n++)i+=e.childWidgets[n].height,(0===e.indexInOwner||-1!==e.indexInOwner&&e.containerWidget&&0===this.existFootnoteHeight&&0===t)&&0===n&&(i+=e.containerWidget.margin.top);return i},psi.prototype.updateRowHeightBySpannedCell=function(e,t,i){var n=1;if(0===e.childWidgets.length||0===i)this.updateRowHeight(t,t);else{for(var o=0;o<t.childWidgets.length;o++){var r=t.childWidgets[o],n=je(r)||je(r.cellFormat)?n:r.cellFormat.rowSpan;this.updateSpannedRowCollection(n,t,r)}if(!je(t.ownerTable))for(o=0;o<t.ownerTable.spannedRowCollection.length;o++)if(t.ownerTable.spannedRowCollection.keys[o]===t.index){for(var s=0;s<i;s++){var a=e.childWidgets[s];this.updateRowHeight(a,t)}t.ownerTable.spannedRowCollection.remove(t.ownerTable.spannedRowCollection.keys[o]);break}}},psi.prototype.updateRowHeight=function(e,t){for(var i=t.index,n=1,o=0;o<e.childWidgets.length;o++){var r=e.childWidgets[o],n=je(r)||je(r.cellFormat)?n:r.cellFormat.rowSpan;this.updateSpannedRowCollection(n,t,r),i-r.rowIndex==n-1&&(r=r.y+r.height+r.margin.bottom-t.y,"Exactly"!==t.rowFormat.heightType||"Exactly"===t.rowFormat.heightType&&t.rowFormat.height>r)&&t.height<r&&(t.height=r)}},psi.prototype.updateSpannedRowCollection=function(e,t,i){1<e&&!je(t.ownerTable)&&(t.ownerTable.spannedRowCollection.containsKey(t.index+e-1)||t.ownerTable.spannedRowCollection.add(t.index+e-1,t.index))},psi.prototype.updateRowHeightByCellSpacing=function(e,t,i){0<t.ownerTable.tableFormat.cellSpacing&&1<e.length&&t.y===i.clientArea.y&&i instanceof nai&&(t.height=t.height-Y.convertPointToPixel(t.ownerTable.tableFormat.cellSpacing)/2)},psi.prototype.isRowSpanEnd=function(e,t){for(var i=e.index,n=1,o=0;o<this.documentHelper.splittedCellWidgets.length;o++){var r=this.documentHelper.splittedCellWidgets[o],n=je(r)||je(r.cellFormat)?n:r.cellFormat.rowSpan;if(i-r.rowIndex==n-1)return!0}return!1},psi.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},psi.prototype.splitWidgets=function(e,t,i,n,o,r,s,a,l,h,d){if((!h||0!==a)&&this.isFirstLineFitForRow(t.clientArea.bottom,e)&&0<e.childWidgets.length){if(o=this.getSplittedWidgetForRow(t.clientArea.bottom,i,n,e,s,a,h,void 0,d),s=[],0<this.documentHelper.splittedCellWidgets.length||o!==e){if(r)for(var p=0;p<o.childWidgets.length;p++)o.childWidgets[p].rowIndex!==o.index&&(o.childWidgets.splice(p,1),p--);this.insertSplittedCellWidgets(t,i,o,e.index-1)}}else this.insertSplittedCellWidgets(t,i,o,e.index-1);return o},psi.prototype.getSplittedWidgetForRow=function(e,t,i,n,o,r,s,a,l){for(var h=void 0,d=n.index,p=this.isRelayoutneed=!1,c=n.height,u=c,g=0,m=0;m<n.childWidgets.length;m++){var f=n.childWidgets[m];if(0===m&&0<f.childWidgets.length&&0===f.columnIndex&&1===f.cellFormat.rowSpan&&"Word2013"===this.documentHelper.compatibilityMode&&0===this.documentHelper.splittedCellWidgets.length&&1===i.length){var y=this.documentHelper.getFirstParagraphInCell(f);if((!je(y)&&y.paragraphFormat.keepWithNext||n.rowFormat.isHeader)&&!je(this.getPreviousBlock(n)))return n}var v=this.getSplittedWidget(e,!0,t,i,f,o,r,s,a);if(s&&!je(v)&&0!==v.childWidgets.length&&c>f.height&&(c=f.height),!je(o)&&0<o.length)for(var b=0;b<o.length;b++)-1===o[b].paragraph.containerWidget.indexInOwner&&o.splice(b,1);if(je(v)&&f===n.childWidgets[n.childWidgets.length-1]&&this.isRowSpanEnd(n,this.viewer)&&0<this.documentHelper.splittedCellWidgets.length&&l&&(h=this.getSplittedWidgetForSpannedRow(e,n,t,i,o),v=void 0),!je(v)){if(v===f)return 1<i.length&&this.combineSplittedRowWidgets(i,u),n;var w=0;if(f.ownerTable.isInsideTable)for(var C=0;C<f.childWidgets.length;C++)w+=f.childWidgets[C].height;f.ownerTable.isInsideTable?g<w&&(g=w):f.height>g&&(g=f.height),-1!==n.childWidgets.indexOf(v)&&n.childWidgets.splice(n.childWidgets.indexOf(v),1),n.height-=v.height,(0===m||n.height<g+f.margin.top+f.margin.bottom)&&(n.height=g+f.margin.top+f.margin.bottom),je(h)&&((h=new jai).containerWidget=n.containerWidget,h.index=n.index,h.rowFormat=n.rowFormat,h.isRenderBookmarkEnd=n.isRenderBookmarkEnd,this.updateWidgetLocation(n,h),i.push(h));y=je(v)||je(v.cellFormat)?1:v.cellFormat.rowSpan;d-v.rowIndex==y-1&&h.height<v.height+v.margin.top+v.margin.bottom?h.height=v.height+v.margin.top+v.margin.bottom:("Exactly"===n.rowFormat.heightType||"AtLeast"===n.rowFormat.heightType&&h.height<n.rowFormat.height)&&(h.height=n.rowFormat.height),h.childWidgets.push(v),v.containerWidget=h,this.isRelayoutneed=!0;for(var S=m;0<S&&!p;){var A=n.childWidgets[S-1],v=this.getSplittedWidget(e,!0,t,i,A,o);h.childWidgets.splice(0,0,v),v.containerWidget=h,S--}p=!0}}if(s&&c!==u){for(m=0;m<n.childWidgets.length;m++)n.childWidgets[m].height=c;n.height=c}return h},psi.prototype.combineSplittedRowWidgets=function(e,t){for(var i=e[0],n=1;n<e.length;n++){for(var o=e[n],r=0;r<o.childWidgets.length;r++){var s=i.childWidgets[r],a=o.childWidgets[r];if(0<a.childWidgets.length)for(var l=0;l<a.childWidgets.length;l++){var h=a.childWidgets[l];if(h instanceof Lai){var d=s.childWidgets[l];if(d.index===h.index){var p=h;if(0<p.childWidgets.length)for(var c=0;c<p.childWidgets.length;c++){var u=p.childWidgets[c];d.childWidgets.push(u),(u.paragraph=d).height+=u.height}}else s.childWidgets.push(h),h.containerWidget=s;s.height+=h.height}else h instanceof _ai&&(s.childWidgets.push(h),(h.containerWidget=s).height+=h.height)}}e.splice(n,1)}i.height=t},psi.prototype.getSplittedWidgetForSpannedRow=function(e,t,i,n,o){for(var r=void 0,s=void 0,a=!1,l=!1,h=0;h<this.documentHelper.splittedCellWidgets.length;h++){for(var s=this.documentHelper.splittedCellWidgets[h],d=this.documentHelper.splittedCellWidgets[h+1],p=je(d)?0:d.columnIndex,c=this.documentHelper.splittedCellWidgets[h].columnIndex,u=this.documentHelper.splittedCellWidgets[h];u&&u.cellFormat.rowSpan===this.documentHelper.splittedCellWidgets[h].cellFormat.rowSpan&&0<c&&!a;)c=u.columnIndex,u=(f=u.containerWidget).getCell(f.rowIndex,c-1);var g,m=this.documentHelper.splittedCellWidgets[h].columnIndex;for(u=this.documentHelper.splittedCellWidgets[h];u&&u.cellFormat.rowSpan===this.documentHelper.splittedCellWidgets[h].cellFormat.rowSpan&&m<u.containerWidget.childWidgets.length-1&&(!a||l);){var f,m=u.columnIndex;u=(f=u.containerWidget).getCell(f.rowIndex,m+1)}for(je(r)&&((r=new jai).containerWidget=t.containerWidget,r.index=t.index,r.rowFormat=t.rowFormat,r.isRenderBookmarkEnd=t.isRenderBookmarkEnd,this.updateWidgetLocation(t,r),n.push(r)),r.childWidgets.push(s),s.containerWidget=r,this.isRelayoutneed=!0;0<c&&!a;)je(g=t.getCell(t.index,c-1))?c--:(s=this.getSplittedWidget(e,!0,i,n,g,o),r.childWidgets.splice(0,0,s),s.containerWidget=r,c--);for(;m<t.childWidgets[t.childWidgets.length-1].columnIndex&&(!a||l);){if(je(g=t.getCell(t.index,m+1)));else{if(d&&g.columnIndex>p){l=!0;break}s=this.getSplittedWidget(e,!0,i,n,g,o),r.childWidgets.push(s),s.containerWidget=r}m++}a=!0}return r},psi.prototype.getFootNoteHeightInLine=function(e){for(var t=0,i=0;i<e.children.length;i++){var n=e.children[i];n instanceof fli&&(t+=this.getFootNoteHeight(n.bodyWidget))}return t},psi.prototype.getFootnoteFromLine=function(e,t){for(var i=0;i<e.children.length;i++)e.children[i]instanceof fli&&t.push(e.children[i])},psi.prototype.updateWidgetsToTable=function(e,t,i,O,n,o,r){for(var N=i.bodyWidget.page.index,s=this.getRowHeight(i,[i]),a=this.viewer,l=i.rowFormat.isHeader,h=i.rowFormat.allowBreakAcrossPages,d=i.rowFormat.heightType,p=0,c=i,u=!1,g=this.layoutedFootnoteElement,m=!1,f=(void 0!==c.bodyWidget.page.footnoteWidget?(this.footHeight=this.getFootNoteHeight(c.bodyWidget.page.footnoteWidget.bodyWidgets),0===this.footnoteHeight&&(this.footnoteHeight=this.footHeight)):this.footHeight=0,i.ownerTable.continueHeader&&!l&&(i.ownerTable.continueHeader=!1),i.ownerTable.isInsideTable),y=!1,v=je(i.ownerTable)||je(i.ownerTable.tableFormat)?0:Y.convertPointToPixel(i.ownerTable.tableFormat.cellSpacing);p<t.length;){if(p=t.length,this.isRowSpanEnd(i,a)&&"Exactly"===i.rowFormat.heightType&&1===this.documentHelper.splittedCellWidgets.length&&(this.documentHelper.splittedCellWidgets=[]),!r&&(i.ownerTable.isInsideTable||0===this.documentHelper.splittedCellWidgets.length&&c.y+c.height+v+this.footHeight<=a.clientArea.bottom))!this.isVerticalMergedCellContinue(i)||c.y!==a.clientArea.y&&c.y!==this.viewer.clientArea.y+c.ownerTable.headerHeight||this.insertSplittedCellWidgets(a,e,c,c.index-1),this.addWidgetToTable(a,e,t,c,g,void 0,f,N,m),!je(i.bodyWidget)&&i.bodyWidget instanceof Sai&&0<this.documentHelper.splittedCellWidgets.length&&je(t[t.length-1].nextRow)?(p--,y=!0):!je(i.bodyWidget)&&i.bodyWidget instanceof Sai&&0<this.documentHelper.splittedCellWidgets.length&&!je(t[t.length-1].nextRow)&&!this.isRowSpanEnd(t[t.length-1].nextRow,a)&&p--,f=!1;else{g=[],f=!1;if(0<this.documentHelper.splittedCellWidgets.length&&c.y+c.height+this.footHeight<=a.clientArea.bottom)if(!this.isRowSpanEnd(i,a)){this.isVerticalMergedCellContinue(i)&&(c.y===a.clientArea.y||c.y===this.viewer.clientArea.y+c.ownerTable.headerHeight&&!l)&&(this.insertSplittedCellWidgets(a,e,c,c.index-1,!0),this.updateChildLocationForRow(c.y,c)),this.addWidgetToTable(a,e,t,c,g);continue}var b=c,w=e[e.length-1];if(r||s+c.y+this.footHeight>a.clientArea.bottom)if(!h||l&&i.ownerTable.continueHeader||"AtLeast"===d&&Y.convertPointToPixel(i.rowFormat.height)<a.clientArea.bottom){var C=!h&&je(c.previousWidget)&&1<e.length;"AtLeast"===d&&Y.convertPointToPixel(i.rowFormat.height)<a.clientActiveArea.height&&(h||C)||"Exactly"!==d&&c.y===a.clientArea.y||"Auto"===d&&h?je(b=this.splitWidgets(c,a,e,t,b,y,g,n,o,r))&&c.y===a.clientArea.y?this.addWidgetToTable(a,e,t,c,g):je(b)&&"AtLeast"===d&&c.containerWidget.lastChild!==c&&(b=c):"AtLeast"===d&&Y.convertPointToPixel(i.rowFormat.height)>a.clientActiveArea.height&&0<this.documentHelper.splittedCellWidgets.length&&this.isRowSpanEnd(i,a)&&this.insertSplittedCellWidgets(a,e,c,c.index-1),"Exactly"===d&&c.y===a.clientArea.y&&(this.addWidgetToTable(a,e,t,c,g),p++),this.updateHeader(i,l,a)}else if("Auto"!==d&&"AtLeast"!==d||!h)"Exactly"===d&&c.y===a.clientArea.y&&(this.addWidgetToTable(a,e,t,c,g),p++);else if(Y.convertPointToPixel(i.rowFormat.height)>a.clientArea.bottom&&c.y!==a.clientArea.y){if("AtLeast"===d&&Y.convertPointToPixel(i.rowFormat.height)>a.clientArea.bottom&&c.ownerTable.wrapTextAround&&c.y-Y.convertPointToPixel(c.ownerTable.positioning.verticalPosition)===a.clientArea.y&&c.bodyWidget.firstChild===c.ownerTable&&je(b=this.splitWidgets(c,a,e,t,b,y,g,n,o,r))){this.addWidgetToTable(a,e,t,c,g),p++;continue}}else je(b=this.splitWidgets(c,a,e,t,b,y,g,n,o,r))&&c.y===a.clientArea.y&&this.addWidgetToTable(a,e,t,c,g);else{var C=!1,S=0;if(je(c.ownerTable.headerHeight)||(S=c.ownerTable.headerHeight),this.isVerticalMergedCellContinue(i)&&(h||(C=c.y===a.clientArea.y||c.y===this.viewer.clientArea.y+S)))if(!C||l&&je(c.previousWidget)){if(je(b=this.splitWidgets(c,a,e,t,b,y,g,void 0,void 0,void 0,!0))){if(C=c.y===a.clientArea.y||c.y===this.viewer.clientArea.y+S){this.insertSplittedCellWidgets(a,e,c,c.indexInOwner-1),p--;continue}this.isRowSpanEnd(i,a)&&(b=c)}}else this.insertSplittedCellWidgets(a,e,b,c.indexInOwner-1);else y&&!h?b=this.splitWidgets(c,a,e,t,b,y,g):this.isRowSpanEnd(i,a)&&!h&&je(b="AtLeast"===d&&0<i.ownerTable.spannedRowCollection.keys.length?this.splitWidgets(c,a,e,t,b,y,g,n,o,r,!0):b)&&this.addWidgetToTable(a,e,t,c,g);this.updateHeader(i,l,a)}if(!je(b)&&(je(this.documentHelper.owner.editorModule)||this.documentHelper.owner.editorModule&&!this.documentHelper.owner.editorModule.isTableInsert)&&!(b.bodyWidget.containerWidget instanceof Pai)){if(b!==c)this.addWidgetToTable(a,e,t,c,g,c.nextRow,void 0,void 0,m),this.updateWidgetsToPage(e,t,i.ownerTable,O,c.nextRow),e.indexOf(c.containerWidget)+1>=e.length&&this.addTableWidget(a.clientActiveArea,e,!0),c=b;else{if(0<i.index)this.updateWidgetsToPage(e,t,i.ownerTable,O,i),i.previousRenderedWidget instanceof jai&&(x=i.previousRenderedWidget,Y.round(c.y,2)===Y.round(x.y+x.height,2))&&!(e.indexOf(x.containerWidget)+1>=e.length)||this.addTableWidget(a.clientActiveArea,e,!0);else if("Exactly"===d&&s+c.y+this.footHeight<a.clientArea.bottom&&c.y>=a.clientArea.y){this.addWidgetToTable(a,e,t,c,g),p++;continue}u=!0,p--}var A,w=e[e.length-1],x=i,I=!1,T=(i.ownerTable.containerWidget.index,!1),E=void 0,D=void 0,M=(D=u&&1===e.length?e[e.length-1]:e[e.length-2],!0),k=(!u||1!==t.length||je((k=this.alignBlockElement(i)).node)||((A=k.node)instanceof jai&&0===A.indexInOwner?1<e.length&&0===e[e.length-1].childWidgets.length&&(e.pop(),(w=e[e.length-1]).height=0):k.node instanceof Lai&&(D=this.splitParagraph(k.node,parseInt(k.position.index,10)),1<e.length&&0===e[e.length-1].childWidgets.length&&(e.pop(),w=e[e.length-1]),M=!1),A instanceof jai&&(T=0===A.indexInOwner,(x=A).ownerTable.equals(i.ownerTable)||(D=x.ownerTable,M=!1)),I=!0),E=this.moveBlocksToNextPage(!(D instanceof Lai)&&(!I||!T||je(D.previousWidget))?D:D.previousWidget,I,void 0,void 0,void 0,!0),e[e.length-1]),T=(u&&M&&0===x.index&&k.containerWidget&&-1!==k.containerWidget.childWidgets.indexOf(k)&&k.containerWidget.childWidgets.splice(k.containerWidget.childWidgets.indexOf(k),1),M&&(-1!==E.childWidgets.indexOf(k)&&E.childWidgets.splice(E.childWidgets.indexOf(k),1),E.childWidgets.unshift(k),this.shiftFloatingItemsFromTable(k,E)),k.containerWidget=E,(u&&0<x.index||1<t.length)&&(A=u?t[t.length-1]:t[t.length-2],I&&(A=x),this.moveNextWidgetsToTable(e,A,!u),x=i),I&&this.updateClientPositionForBlock(M?k:D,i),u=!1),D=this.documentHelper.viewer.clientArea.bottom-c.bottomBorderWidth-v;if(x.ownerTable.header&&(b.x=b.x,b.y=this.viewer.clientArea.y+w.headerHeight,this.updateChildLocationForRow(b.y,b),T=this.isFirstLineFitForRow(D,b)),T&&x.ownerTable.header&&!I){a instanceof nai&&(m=E.page.repeatHeaderRowTableWidget=!0),a.updateClientAreaForBlock(x.ownerTable,!0,e),b.x=b.x,b.y=w.y+x.ownerTable.headerHeight;var P=v/2;this.updateChildLocationForRow(w.y+x.ownerTable.headerHeight-P,b,w.containerWidget)}else{if(a.updateClientAreaForBlock(x.ownerTable,!0,e),1<b.bodyWidget.sectionFormat.columns.length){for(var D=new pai(this.viewer.clientArea.x,this.viewer.clientArea.y,this.viewer.clientArea.width,this.viewer.clientArea.height),T=new pai(this.viewer.clientActiveArea.x,this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.width,this.viewer.clientActiveArea.height),V=(b.x=this.viewer.clientActiveArea.x,b.y=this.viewer.clientActiveArea.y,this.getMaxTopCellMargin(b)),_=this.getMaxBottomCellMargin(b),B=0;B<b.childWidgets.length;B++){var F=b.childWidgets[B];F.height=0,this.addTableCellWidget(F,this.viewer.clientActiveArea,V+b.topBorderWidth,_+b.bottomBorderWidth),this.viewer.updateClientAreaForCell(F,!0);for(var H=0;H<F.childWidgets.length;H++){var L=F.childWidgets[H];a.updateClientAreaForBlock(L,!0),L.containerWidget=F,this.layoutBlock(L,0),a.updateClientAreaForBlock(L,!1)}this.viewer.updateClientAreaForCell(F,!1)}this.viewer.clientActiveArea=T,this.viewer.clientArea=D}b.x=b.x,b.y=w.y;P=v/2;this.updateChildLocationForRow(w.y-P,b,w.containerWidget,!0)}if(M&&0<this.shiftedFloatingItemsFromTable.length){for(B=0;B<this.shiftedFloatingItemsFromTable.length;B++){var R=this.shiftedFloatingItemsFromTable[B],z=this.getFloatingItemPoints(R);R.y=z.y,R.x=z.x,R instanceof Xli&&this.updateChildLocationForCellOrShape(R.y,R)}this.shiftedFloatingItemsFromTable=[]}}y=!1}if(l)if(i.ownerTable.continueHeader&&(i.ownerTable.header=!0,i.ownerTable.headerHeight=s+i.ownerTable.headerHeight),!je(I=this.getHeader(i.ownerTable))&&i.index===I.index)if(((S=this.getHeaderHeight(i.ownerTable,i,t))>i.ownerTable.headerHeight||S>i.ownerTable.headerHeight)&&(i.ownerTable.headerHeight=S),i.ownerTable.headerHeight>a.clientArea.height){i.ownerTable.header=!1,i.ownerTable.continueHeader=!1,i.ownerTable.headerHeight=0;for(var j=this.documentHelper.pages,B=0;B<j.length;B++)j[B].repeatHeaderRowTableWidget&&(j[B].repeatHeaderRowTableWidget=!1)}r=!1,2<e.length&&i.ownerTable.header&&c.height<a.clientActiveArea.bottom&&!a.documentHelper.currentRenderingPage.repeatHeaderRowTableWidget&&(a.documentHelper.currentRenderingPage.repeatHeaderRowTableWidget=!0)}},psi.prototype.updateHeader=function(e,t,i){if(t&&e.ownerTable.continueHeader){e.ownerTable.header=!1;var n=void(e.ownerTable.headerHeight=0);if(!je(n=i instanceof nai?this.documentHelper.pages:n))for(var o=0;o<n.length;o++)!n[o].repeatHeaderRowTableWidget||je(n[o].bodyWidgets[0].firstChild)||n[o].bodyWidgets[0].firstChild instanceof _ai&&n[o].bodyWidgets[0].firstChild.header||(n[o].repeatHeaderRowTableWidget=!1,e.ownerTable.continueHeader=!1)}},psi.prototype.getHeader=function(e){var t=void 0,i=!0;e=e.getSplitWidgets()[0];for(var n=0;n<e.childWidgets.length;n++){var o=e.childWidgets[n];if(o.rowFormat.isHeader?t=o:i=!1,!i)break}return t},psi.prototype.getHeaderHeight=function(e,t,i){var n=0;if(0<t.ownerTable.childWidgets.length&&e.childWidgets[0].rowFormat.isHeader)for(var o=0;o<e.childWidgets.length;o++){var r=e.childWidgets[o];if(!r.rowFormat.isHeader)break;n+=r.height}return n},psi.prototype.getHeaderHeightForSpannedRow=function(e){for(var t=0,i=1,n=this.getHeader(e),o=0;o<e.childWidgets.length;o++){var r=e.childWidgets[o];if(r.rowFormat.isHeader&&(t+=r.height,r==n)){for(var s=0;s<n.childWidgets.length;s++)var a=n.childWidgets[s],i=Math.max(i,a.cellFormat.rowSpan);if(1<i&&o+i<e.childWidgets.length)for(var l=1;l<i;l++){var h=e.childWidgets[o+l];je(h)||(t+=h.height)}}}return t},psi.prototype.updateWidgetToRow=function(e){var t,i=e.ownerRow;e.containerWidget=i,!je(e.ownerRow)&&"Exactly"!==e.ownerRow.rowFormat.heightType&&0<Y.convertPointToPixel(e.ownerRow.rowFormat.height)&&0===e.cellIndex&&(i.height=i.height+Y.convertPointToPixel(e.ownerRow.rowFormat.height)),1===e.cellFormat.rowSpan&&(t=void 0,t="Exactly"===i.rowFormat.heightType?e.height+e.margin.bottom:e.height+e.margin.top+e.margin.bottom,i.height-Y.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing)<t)&&(i.height=t+Y.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing))},psi.prototype.updateHeightForRowWidget=function(e,t,i,n,o,r,s,a){for(var l=0;l<o.childWidgets.length;l++){var h,d,p,c,u=0,g=void 0,m=(g=o.childWidgets[l]).cellFormat.rowSpan,u=Y.convertPointToPixel(g.ownerTable.tableFormat.cellSpacing);1<m?(m=(h=o.containerWidget.childWidgets.indexOf(o))+m-1-(o.index-g.rowIndex),!je(o.rowFormat)&&o.rowFormat.isHeader&&!je(o.ownerTable)&&!je(o.ownerTable.previousWidget)&&e.clientArea.bottom<g.y+g.height+g.margin.bottom&&(y=void 0,c=p=!1,y=i[i.length-1],je((d=this.alignBlockElement(o)).node)||((d=d.node)instanceof jai&&0===d.indexInOwner&&1<i.length&&0===i[i.length-1].childWidgets.length&&(i.pop(),i[i.length-1].height=0),d instanceof jai&&(p=0===d.indexInOwner,je((d=d).ownerTable)||d.ownerTable.equals(o.ownerTable)||(y=d.ownerTable)),c=!0),this.moveBlocksToNextPage(!(y instanceof Lai)&&(!c||!p||je(y.previousWidget))?y:y.previousWidget,c,void 0,void 0,void 0,!0),this.updateClientPositionForBlock(y,o),this.addTableRowWidget(this.viewer.clientActiveArea,[o]),this.updateChildLocationForRow(this.viewer.clientActiveArea.y,o)),!a&&(e.clientArea.bottom<g.y+g.height+g.margin.bottom||h+1<=m)&&(1===n.length||1<=n.length&&o===n[n.length-1])&&(d=this.footHeight,this.footHeight=this.existFootnoteHeight=je(o.bodyWidget.page.footnoteWidget)?0:o.bodyWidget.page.footnoteWidget.height,this.splitSpannedCellWidget(g,i,n,e),this.footHeight=this.existFootnoteHeight=d),p=o,0<m&&(m<o.containerWidget.childWidgets.length?(c=o.containerWidget.childWidgets[m])instanceof jai&&(p=c)===s&&(p=o):p=o.containerWidget.childWidgets[o.containerWidget.childWidgets.length-1]),g.y+g.height+g.margin.bottom<p.y+p.height?g.height=p.y+p.height-p.bottomBorderWidth-g.y-g.margin.bottom:r&&p&&0!==p.y&&0!==p.height&&g.y+g.height+g.margin.bottom>p.y+p.height&&("Exactly"!==p.rowFormat.heightType||"Exactly"===p.rowFormat.heightType&&p.rowFormat.height>g.y+g.height+g.margin.bottom-p.y?p.height=g.y+g.height+g.margin.bottom-p.y:g.height=p.y-g.y+p.height)):(0<u&&1<i.length&&o.y===e.clientArea.y&&e instanceof nai&&(u/=2),g.height=o.height-g.margin.top-g.margin.bottom-u),this.updateHeightForCellWidget(e,i,n,g);for(var f=o.containerWidget;f.containerWidget instanceof fai;)f=f.containerWidget;var y=void 0;f instanceof Sai&&(y=f.page),(e instanceof nai&&-1!==e.visiblePages.indexOf(y)||t)&&this.updateCellVerticalPosition(g,!1,g.ownerTable.isInsideTable)}},psi.prototype.updateHeightForCellWidget=function(e,t,i,n){for(var o=0;o<n.childWidgets.length;o++)n.childWidgets[o]instanceof _ai&&this.updateHeightForTableWidget(t,i,n.childWidgets[o])},psi.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 jai&&(i=t[n].height+i);i=Math.max(i,e.rowFormat.height)}return i},psi.prototype.splitSpannedCellWidget=function(e,t,i,n){t=this.getSplittedWidget(n.clientArea.bottom,!1,t,i,e,void 0,void 0,void 0,void 0,!0);je(t)||(this.documentHelper.splittedCellWidgets.push(t),t.isSplittedCell=!0,je(t.ownerTable))||!t.ownerTable.isInsideTable||je(t.ownerTable.nextSplitWidget)||je((i=t.ownerTable.nextSplitWidget).firstChild)||(e=i.firstChild,this.insertSplittedCellWidgets(n,[i],e,e.index-1,!0))},psi.prototype.insertSplittedCellWidgets=function(e,t,i,n,o){if(!je(i)){for(var r=i.x,s=!1,a=Y.convertPointToPixel(i.ownerTable.tableHolder.tableWidth),l=0;l<i.childWidgets.length;l++){var h=i.childWidgets[l],d="None"===h.cellFormat.borders.right.lineStyle,p=je(h.ownerTable)||je(h.ownerTable.tableFormat)?0:Y.convertPointToPixel(h.ownerTable.tableFormat.cellSpacing);if(Math.round(r)<Math.round(h.x-h.margin.left-p)){if(this.insertRowSpannedWidget(i,e,r,l,o)){l--;continue}if(1===t.length&&0===this.documentHelper.splittedCellWidgets.length)break;var c=i.childWidgets.length;if(this.insertEmptySplittedCellWidget(i,t,r,l,n),c<i.childWidgets.length){l--;continue}}r+=h.margin.left+h.width+h.margin.right,(0<p||h.columnIndex===h.ownerTable.tableHolder.columns.length-1||h.index===h.containerWidget.childWidgets.length-1)&&(h.ownerTable.tableFormat.allowAutoFit||(c=Y.convertPointToPixel(Uai.getCellLeftBorder(h).getLineWidth()),p=Y.convertPointToPixel(Uai.getCellRightBorder(h).getLineWidth()),h.rightBorderWidth=h.ownerTable.isBidiTable?c:p,r+=h.rightBorderWidth),this.isInsertTable()||(s=this.checkPreviousMargins(h.ownerTable))),r-=d&&!s?0:h.rightBorderWidth,l===i.childWidgets.length-1&&Math.round(r)<Math.round(i.x+a)&&(this.insertRowSpannedWidget(i,e,r,l+1)||this.insertEmptySplittedCellWidget(i,t,r,l+1,n))}if((je(i.childWidgets)||0===i.childWidgets.length)&&0<this.documentHelper.splittedCellWidgets.length)for(var u=0;u<this.documentHelper.splittedCellWidgets.length;u++){var g=this.documentHelper.splittedCellWidgets[u];if(Math.round(r)<=Math.round(g.x-g.margin.left)){if(this.insertRowSpannedWidget(i,e,r,u)){u--;continue}var m=i.childWidgets.length;if(this.insertEmptySplittedCellWidget(i,t,r,u,n),m<i.childWidgets.length){u--;continue}}r+=g.margin.left+g.width+g.margin.right,u===i.childWidgets.length-1&&Math.round(r)<Math.round(i.x+a)&&(this.insertRowSpannedWidget(i,e,r,u+1)||this.insertEmptySplittedCellWidget(i,t,r,u+1,n))}0<this.documentHelper.splittedCellWidgets.length&&(this.documentHelper.splittedCellWidgets=[])}},psi.prototype.insertRowSpannedWidget=function(e,t,i,n,o){var r=0;0<e.ownerTable.tableFormat.cellSpacing&&(r=Y.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing));for(var s=0;s<this.documentHelper.splittedCellWidgets.length;s++){var a=this.documentHelper.splittedCellWidgets[s];if(Math.round(i)===Math.round(a.x-a.margin.left))return e.childWidgets.splice(n,0,a),a.containerWidget=e,!o&&a.height>e.height&&(e.height=a.height),a.y!==e.y+a.margin.top+r&&this.updateChildLocationForRow(e.y,e),this.documentHelper.splittedCellWidgets.splice(s,1),!0}return!1},psi.prototype.insertEmptySplittedCellWidget=function(e,t,i,n,o){for(var r,s=t[t.length-1],a=t.length-1;0<=a;a--)for(var l=t[a],h=l.childWidgets.length-1;0<=h;h--){var d=l.childWidgets[h];if(d.index===o){r=d;break}}r&&(s=r.ownerTable,o=r.indexInOwner);for(var p=o;0<=p;p--)for(var c=s.childWidgets[p],u=c.x,a=0;a<c.childWidgets.length;a++){var g=c.childWidgets[a],m=je(g.ownerTable)||je(g.ownerTable.tableFormat)?0:Y.convertPointToPixel(g.ownerTable.tableFormat.cellSpacing);if(Math.round(u)!==Math.round(g.x-g.margin.left-m)&&(u=g.x-g.margin.left-m),Math.round(i)===Math.round(u))if(1<(je(g)||je(g.cellFormat)?1:g.cellFormat.rowSpan)&&0===c.firstChild.columnIndex&&!this.isColumnExistsInCurrentRow(e,g.columnIndex))return this.isVerticalMergedCellContinue(e)&&"Exactly"!==e.rowFormat.heightType&&!je(e.previousRenderedWidget)&&e.previousRenderedWidget instanceof jai&&e.previousRenderedWidget.y+e.previousRenderedWidget.height<g.y+g.height?(this.isRelayoutneed=!0,m=this.getSplittedWidget(e.previousRenderedWidget.y+e.previousRenderedWidget.height,!0,t,void 0,g,void 0,void 0,void 0,void 0,!0),this.isRelayoutneed=!1,e.childWidgets.splice(n,0,m),m.containerWidget=e):(m=this.createCellWidget(g),e.childWidgets.splice(n,0,m),m.containerWidget=e),void this.updateChildLocationForRow(e.y,e);u+=g.margin.left+g.width+g.margin.right}},psi.prototype.isColumnExistsInCurrentRow=function(e,t){for(var i=0;i<e.childWidgets.length;i++)if(e.childWidgets[i].columnIndex===t)return!0;return!1},psi.prototype.getSplittedWidget=function(e,t,i,n,o,r,s,a,l,h){var d=void 0;if(a||o.y+o.height>e-this.footHeight-o.margin.bottom)for(var p=0,c=(o.ownerTable.isInsideTable&&(p=l),!1),u=0;u<o.childWidgets.length;u++)if(o.childWidgets[u]instanceof Lai){var g=o.childWidgets[u],m=g;if(c||(m=this.getSplittedWidgetForPara(e-o.margin.bottom,g,r,s,a,p)),a&&(p+=g.childWidgets.length),!je(m)){if(c=!0,0===u&&m===g&&!h)return o;-1!==o.childWidgets.indexOf(m)&&(o.childWidgets.splice(o.childWidgets.indexOf(m),1),u--),o.height-=m.height,(d=je(d)?this.createCellWidget(o):d).height+=m.height,d.childWidgets.push(m),m.containerWidget=d}}else{var f=o.childWidgets[u],g=[f],y=0;if(!je(f.footnoteElement))for(var v=0;v<f.footnoteElement.length;v++)y+=this.getFootNoteHeight(f.footnoteElement[v].bodyWidget);var b=this.existFootnoteHeight+y;if(!je(r))for(v=0;v<r.length;v++)b+=this.getFootNoteHeight(r[v].bodyWidget);if(a||e-o.margin.bottom<f.y+f.height+b){var m=f.height,w=void 0;if(je(w=c?f:this.getSplittedWidgetForTable(e-o.margin.bottom,g,f,r,s,a,p))&&!f.childWidgets[0].rowFormat.allowBreakAcrossPages&&(w=f),!je(w)){if(0===u&&w===f)return o;-1!==o.childWidgets.indexOf(w)?(o.childWidgets.splice(o.childWidgets.indexOf(w),1),u--,o.height-=w.height):o.height-=m-f.height,(d=je(d)?this.createCellWidget(o):d).height+=w.height,d.childWidgets.push(w),w.containerWidget=d}}else if(0<f.footnoteElement.length)for(v=0;v<f.footnoteElement.length;v++)r.push(f.footnoteElement[v])}else this.updateFootHeight(o,r);return d=je(d)&&t&&this.isRelayoutneed?this.createCellWidget(o):d},psi.prototype.getNextFootNoteHeight=function(e,t){var i=0;if(!je(e.ownerTable.footnoteElement)&&0<e.ownerTable.footnoteElement.length){for(var n=e.indexInOwner+1;n<e.ownerRow.childWidgets.length;n++)for(var o,r=e.ownerRow.childWidgets[n],s=0;s<r.childWidgets.length;s++)r.childWidgets[s]instanceof Lai?i+=this.getFootHeightFromPara(r.childWidgets[s],t):r.childWidgets[s]instanceof _ai&&(o=r.childWidgets[s],i+=this.getFootHeightFromTable(o,t));e.ownerTable.isInsideTable&&(i+=this.getNextFootNoteHeight(e.ownerTable.containerWidget,t))}return i},psi.prototype.getFootHeightFromTable=function(e,t){for(var i=0,n=0;n<e.childWidgets.length;n++)for(var o=e.childWidgets[n],r=0;r<o.childWidgets.length;r++)for(var s=o.childWidgets[r],a=0;a<s.childWidgets.length;a++)s.childWidgets[a]instanceof Lai?i+=this.getFootHeightFromPara(s.childWidgets[a],t):s.childWidgets[a]instanceof _ai&&(i+=this.getFootHeightFromTable(s.childWidgets[a],t));return i},psi.prototype.getFootHeightFromPara=function(e,t){for(var i=0,n=0;n<e.childWidgets.length;n++){var o=e.childWidgets[n],r=this.getFootNoteHeightInLine(o);t>o.height+e.y&&(i+=r)}return i},psi.prototype.updateFootHeight=function(e,t){if(!je(t))for(var i=0;i<e.childWidgets.length;i++)if(e.childWidgets[i]instanceof Lai)for(var n=e.childWidgets[i],o=0;o<n.childWidgets.length;o++)this.getFootnoteFromLine(n.childWidgets[o],t);else e.childWidgets[i]instanceof _ai&&this.updateFootHeightForTable(e.childWidgets[i],t)},psi.prototype.updateFootHeightForTable=function(e,t){for(var i=0;i<e.childWidgets.length;i++)for(var n=e.childWidgets[i],o=0;o<n.childWidgets.length;o++){var r=n.childWidgets[o];this.updateFootHeight(r,t)}},psi.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"}},psi.prototype.createCellWidget=function(e){var t=new Uai;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},psi.prototype.createTableWidget=function(e){var t,i=new _ai;return e.header&&(i.header=e.header,t=this.getHeaderHeightForSpannedRow(e),i.headerHeight=t>e.headerHeight?t:e.headerHeight),i.index=e.index,i.tableFormat=e.tableFormat,i.tableHolder=e.tableHolder,i.footnoteElement=e.footnoteElement,i.isGridUpdated=e.isGridUpdated,i.wrapTextAround=e.wrapTextAround,i.positioning=e.positioning,i.isContainInsideTable=e.isContainInsideTable,i.isBidiTable=e.isBidiTable,i},psi.prototype.getSplittedWidgetForPara=function(e,t,i,n,o,r){for(var s=t.y,a=void 0,l=!1,h=!1,d=0,p=0;p<t.childWidgets.length;p++){var c=this.getNextFootNoteHeight(t.containerWidget,t.y+d),u=t.childWidgets[p],g=this.getFootNoteHeightInLine(u);if(g+=this.existFootnoteHeight+c,!je(i))for(var m=0;m<i.length;m++)g+=this.getFootNoteHeight(i[m].bodyWidget);c=0;if(d+=c=(u.children[0]instanceof qli?u.children[0]:u).height,o&&n<=r||e<s+g+c){if(t.paragraphFormat.keepLinesTogether&&(0!==t.index||0===t.index&&!je(t.associatedCell.ownerRow.previousWidget)))l=!0,u=t.childWidgets[p=0];else if(t.paragraphFormat.widowControl){if(!je(t.associatedCell)&&1===p&&e<s+c&&!h){var f=t.associatedCell.ownerRow.containerWidget,y=t.height-t.childWidgets[0].height;if(!(f.indexInOwner<=0&&t.associatedCell.ownerRow.indexInOwner<=0&&(t.indexInOwner<=0||e<y)||"Word2013"!==this.documentHelper.compatibilityMode))return t;h=!0}1!==p||h||(l=!0,u=t.childWidgets[p=0])}if(0===p){if(u.paragraph.containerWidget instanceof Uai&&!l&&!o&&0===t.indexInOwner&&e<s+c&&u.paragraph.associatedCell.ownerRow.y===this.viewer.clientArea.y){s+=u.height;continue}a=t;break}-1!==t.childWidgets.indexOf(u)&&(t.childWidgets.splice(t.childWidgets.indexOf(u),1),p--),t.height-=u.height,je(a)?((a=new Lai).characterFormat=t.characterFormat,a.paragraphFormat=t.paragraphFormat,a.index=t.index,this.updateWidgetLocation(t,a),a.height=u.height):a.height+=u.height,a.childWidgets.push(u),u.paragraph=a}this.getFootnoteFromLine(u,i),s+=u.height,r++}return a},psi.prototype.getSplittedWidgetForTable=function(e,t,i,n,o,r,s){for(var a=i.y,l=void 0,h=0;h<i.childWidgets.length;h++){var d=void 0,p=(d=i.childWidgets[h]).height,c=this.existFootnoteHeight;if(a+p+c<e&&je(l))for(var u=0;u<d.childWidgets.length;u++)this.updateFootHeight(d.childWidgets[u],n);if(!je(n))for(var g=0;g<n.length;g++)c+=this.getFootNoteHeight(n[g].bodyWidget);if(r||e<a+p+c||!je(l)){var m=void 0,f=!0;if((f=je(d)||je(d.rowFormat)?f:d.rowFormat.allowBreakAcrossPages)?m=je(l)&&this.isFirstLineFitForRow(e,d)?this.getSplittedWidgetForRow(e,t,[d],d,n,o,r,s):d:je(i.containerWidget.containerWidget.previousWidget)&&this.isFirstLineFitForRow(e,d)||i.isInsideTable&&!i.containerWidget.containerWidget.rowFormat.allowBreakAcrossPages?m=this.getSplittedWidgetForRow(e,t,[d],d,n,o,r,s):je(i.containerWidget.containerWidget.previousWidget)||(m=d),!je(m)){if(0===h&&m===d)return i;-1!==i.childWidgets.indexOf(m)?(i.childWidgets.splice(i.childWidgets.indexOf(m),1),h--,i.height-=m.height):i.height-=p-d.height,je(l)?(l=this.createTableWidget(i),this.updateWidgetLocation(i,l),l.height=m.height):l.height+=m.height,l.childWidgets.push(m),m.containerWidget=l}}a+=d.height}return l},psi.prototype.isFirstLineFitForPara=function(e,t){var i=t.childWidgets[0],n=i.height,o=this.getFootNoteHeightInLine(i),o=(n+=o+=this.existFootnoteHeight,i.paragraph.containerWidget);if(t.paragraphFormat.keepLinesTogether&&Math.floor(o.containerWidget.y)!==this.viewer.clientArea.y&&(n=t.height),this.documentHelper.isFirstLineFitInShiftWidgets){if(this.viewer.clientActiveArea.y===this.viewer.clientArea.y&&t.y+n>=e)return!0}else if(!o.ownerTable.isInsideTable&&o.containerWidget.y===this.viewer.clientArea.y&&t.y+n>=e)return!0;return t.y+n<=e},psi.prototype.isFirstLineFitForTable=function(e,t){var i=!1,t=t.childWidgets[0];return i=je(t)?i:this.isFirstLineFitForRow(e,t)},psi.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},psi.prototype.isFirstLineFitForCell=function(e,t){var i;return 0===t.childWidgets.length||(t.childWidgets[0]instanceof Lai?(i=t.childWidgets[0],this.isFirstLineFitForPara(e-t.margin.bottom,i)):(i=t.childWidgets[0],this.isFirstLineFitForTable(e-t.margin.bottom,i)))},psi.prototype.updateWidgetLocation=function(e,t){t.x=e.x,t.y=e.y,t.width=e.width},psi.prototype.updateChildLocationForTable=function(e,t,i,n){for(var o=0;o<t.childWidgets.length;o++){var r=t.childWidgets[o];r.y=e,this.updateChildLocationForRow(e,r,i,n),e+=r.height}},psi.prototype.updateChildLocationForRow=function(e,t,i,n){var o=0;0<t.ownerTable.tableFormat.cellSpacing&&(o=Y.convertPointToPixel(t.ownerTable.tableFormat.cellSpacing));for(var r=0;r<t.childWidgets.length;r++){var s=t.childWidgets[r];s.index=s.cellIndex,s.y=e+s.margin.top+o,this.updateChildLocationForCellOrShape(s.y,s,i,n)}},psi.prototype.updateChildLocationForCellOrShape=function(e,t,i,n,o){var r=t;t instanceof Xli&&(r=t.textFrame);for(var s=0;s<r.childWidgets.length;s++){var a=!1;if(r.childWidgets[s]instanceof _ai&&r.childWidgets[s].wrapTextAround&&!je(r.childWidgets[s+1])&&r.childWidgets[s+1].y>r.childWidgets[s].y&&r.childWidgets[s+1].y<r.childWidgets[s].y+r.childWidgets[s].height&&(a=!0),!je(r.childWidgets[s].floatingElements)&&0<r.childWidgets[s].floatingElements.length&&n&&(this.viewer.clientActiveArea.height=this.viewer.clientActiveArea.bottom-e,this.viewer.clientActiveArea.y=e),r.childWidgets[s].x=r.childWidgets[s].x,r.childWidgets[s].y=e,t instanceof Xli&&"Inline"==t.textWrappingStyle&&o&&this.updateShapeYPosition(t),!je(i)&&t instanceof Uai&&r.childWidgets[s]instanceof Lai){var l=r.childWidgets[s],h=t.ownerTable.bodyWidget.floatingElements,d=!1;if(t.ownerTable.bodyWidget!==i||je(t.ownerTable.previousSplitWidget)||(h=t.ownerTable.previousSplitWidget.bodyWidget.floatingElements,d=!0),0<l.floatingElements.length)for(var p=0;p<l.floatingElements.length;p++){var c=l.floatingElements[p],u=this.viewer.clientActiveArea.x;if(this.viewer.clientActiveArea.x=c.x,this.layoutShape(c),this.viewer.clientActiveArea.x=u,!je(l.firstChild))for(var g=l.childWidgets[0],m=0;m<g.children.length;m++){var f=g.children[m];f instanceof qli&&"Inline"==f.textWrappingStyle&&(this.adjustPosition(f,t.ownerTable.bodyWidget),e=l.y)}-1<h.indexOf(c)&&"Inline"!==c.textWrappingStyle&&(d||(i.floatingElements.push(c),je(u=i.previousSplitWidget))||-1===u.floatingElements.indexOf(c)||u.floatingElements.splice(u.floatingElements.indexOf(c),1),-1!==h.indexOf(c))&&h.splice(h.indexOf(c),1)}}r.childWidgets[s]instanceof _ai&&this.updateChildLocationForTable(e,r.childWidgets[s],i,n),a||(e+=r.childWidgets[s].height)}},psi.prototype.updateCellVerticalPosition=function(e,t,i){var n=e.ownerTable.containerWidget;(n instanceof bai||n instanceof Zli||i)&&(n=this.getDisplacement(e,t),this.updateCellContentVerticalPosition(e,n,t))},psi.prototype.updateCellContentVerticalPosition=function(e,t,i){if(0!==t)for(var n,o=e.y+t,r=0;r<e.childWidgets.length;r++)e.childWidgets[r]instanceof Lai?((n=e.childWidgets[r]).y=o,this.updateShapeInsideCell(n,t)):this.updateTableWidgetLocation(e.childWidgets[r],o,i),o+=e.childWidgets[r].height},psi.prototype.updateShapeInsideCell=function(e,t){for(var i=0;i<e.floatingElements.length;i++){var n=e.floatingElements[i];n.y+=t,n instanceof Xli&&this.updateChildLocationForCellOrShape(n.y,n)}},psi.prototype.updateTableWidgetLocation=function(e,t,i){e.y=t+=e.topBorderWidth;for(var n=0;n<e.childWidgets.length;n++){var o=e.childWidgets[n];o.y=t;for(var r=0;r<o.childWidgets.length;r++){var s=o.childWidgets[r];s.y=t+s.margin.top+0,this.updateCellVerticalPosition(s,i,!0)}t+=o.height}return t},psi.prototype.getDisplacement=function(e,t){var i=0,n=e.containerWidget,o=e.margin.top+e.margin.bottom,i=!je(e.cellFormat)&&1<e.cellFormat.rowSpan?e.height:(je(n)?0:n.height)-o,n=this.getCellContentHeight(e,!0),o=0;return n<i&&i<=this.viewer.clientArea.height&&!e.isSplittedCell&&(o=i-n,"Center"===e.cellFormat.verticalAlignment?o/=2:"Top"!==e.cellFormat.verticalAlignment&&!t||(o=0)),o},psi.prototype.getCellContentHeight=function(e,t,i){if(je(e.childWidgets))return 0;for(var n=0,o=e.y,r=0,s=0,a=!1,l=!1,h=0;h<e.childWidgets.length;h++)if(e.childWidgets[h]instanceof Lai){var d=e.childWidgets[h];n+=e.childWidgets[h].height,!t&&0<d.floatingElements.length&&i===d.indexInOwner&&(n+=this.getFloatingItemsHeight(d,e));for(var p=0;p<d.floatingElements.length;p++){var a=!0,c=d.floatingElements[p],u=c.textWrappingStyle,g=c.y+c.height,m=d.y+d.height;o+e.containerWidget.height>g&&s<g?(r=Math.abs(o-g),s=g,l=!1):m<g&&d.x+d.width>c.x&&s<g&&"InFrontOfText"!==u&&"Behind"!==u&&("Word2013"===this.documentHelper.compatibilityMode||d.floatingElements[p].layoutInCell)?(n+=0===s?g-m:g-s,s=g):l=!0}}else this.considerPositionTableHeight(e,e.childWidgets[h])&&(n+=e.childWidgets[h].height);return s<o+n&&(a=!1),t&&a?r:t&&l?e.ownerRow.height:n},psi.prototype.getFloatingItemsHeight=function(e,t){for(var i=0,n=0,o=0;o<e.floatingElements.length;o++){var r=e.floatingElements[o],s=r.textWrappingStyle,a=r.y+r.height,l=e.y+e.height;a<this.viewer.clientArea.bottom&&r.y!==e.y&&a<l&&e.x+e.width>r.x&&i<a&&"InFrontOfText"!==s&&"Behind"!==s&&"Inline"!==s&&("Word2013"===this.documentHelper.compatibilityMode||e.floatingElements[o].layoutInCell)&&(n+=0===i?a-t.y:a-i,i=a)}return n},psi.prototype.considerPositionTableHeight=function(e,t){if(t.isLayouted&&t.wrapTextAround)for(var i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i];if(t!==n&&(n.y===t.y||n.y+n.height<t.y))return!1}return!0},psi.prototype.getTableLeftBorder=function(e){var t;return je(e.left)?((t=new pri(e)).lineStyle="Single",t.lineWidth=.66,t):e.left},psi.prototype.getTableRightBorder=function(e){var t;return je(e.right)?((t=new pri(e)).lineStyle="Single",t.lineWidth=.66,t):e.right},psi.prototype.getTableTopBorder=function(e){var t;return je(e.top)?((t=new pri(e)).lineStyle="Single",t.lineWidth=.66,t):e.top},psi.prototype.getTableBottomBorder=function(e){var t;return je(e.bottom)?((t=new pri(e)).lineStyle="Single",t.lineWidth=.66,t):e.bottom},psi.prototype.getCellDiagonalUpBorder=function(e){return e.cellFormat.borders.diagonalUp},psi.prototype.getCellDiagonalDownBorder=function(e){return e.cellFormat.borders.diagonalDown},psi.prototype.getTableWidth=function(e){for(var t=0,i=0;i<e.childWidgets.length;i++){for(var n=e.childWidgets[i],o=0,r=0;r<n.childWidgets.length;r++){var s=n.childWidgets[r];o+=Y.convertPointToPixel(s.cellFormat.cellWidth)}t<o&&(t=o)}return t},psi.prototype.layoutNextItemsBlock=function(e,t,i,n){for(var o=e.bodyWidget.sectionIndex,r=(h=e).getSplitWidgets(),s=r[r.length-1].nextRenderedWidget,a=(!je(s)&&this.documentHelper.blockToShift!==h||(this.documentHelper.blockToShift=void 0),!0);s instanceof Dai&&(s.bodyWidget.sectionIndex===o||"NoBreak"===s.bodyWidget.sectionFormat.breakCode&&h.bodyWidget.sectionFormat.pageWidth===s.bodyWidget.sectionFormat.pageWidth&&h.bodyWidget.sectionFormat.pageHeight===s.bodyWidget.sectionFormat.pageHeight)&&(je(i)||!i||s.isLayouted||!this.isInitialLoad);){var l=h.getSplitWidgets(),l=l[l.length-1],h=s,a=(this.documentHelper.blockToShift===h&&(this.documentHelper.blockToShift=void 0),!1),d=h.getSplitWidgets()[0];if(0===this.documentHelper.fieldStacks.length&&!je(d)&&l.containerWidget===d.containerWidget&&Y.round(d.y,2)===Y.round(l.y+l.height,2)){(!je(this.documentHelper.blockToShift)||this.documentHelper.owner.editorModule.isFootnoteElementRemoved||d.bodyWidget&&(0<(d=d.bodyWidget.floatingElements.length)||0===d&&je(this.documentHelper.blockToShift)&&n))&&(this.documentHelper.blockToShift=h);break}if(a=!0,t.owner.isShiftingEnabled&&(0===this.documentHelper.fieldStacks.length||this.viewer.owner.editorModule.isInsertingTOC)||this.isIFfield&&!this.checkBlockHasField(h)){this.documentHelper.blockToShift=h;break}!je(this.viewer.owner.editorModule)&&this.viewer.owner.editorModule.isInsertingTOC||(h=h.combineWidget(this.viewer),l.containerWidget===h.containerWidget||l instanceof Lai&&(!(l instanceof Lai)||l.isEndsWithPageBreak||l.isEndsWithColumnBreak||l.containerWidget.page===h.containerWidget.page||h.bodyWidget instanceof Sai&&"NoBreak"===h.bodyWidget.sectionFormat.breakCode)||this.updateContainerWidget(h,l.containerWidget,l.indexInOwner+1,!1),h instanceof _ai&&(this.clearTableWidget(h,!0,!0),h.isGridUpdated=!1),t.updateClientAreaForBlock(h,!0),(this.viewer instanceof sai||h.bodyWidget instanceof Iai)&&(h.containerWidget.height-=h.height),this.documentHelper.layout.layoutBlock(h,0),t.updateClientAreaForBlock(h,!1)),s=(r=s.getSplitWidgets())[r.length-1].nextRenderedWidget}t.owner.isShiftingEnabled&&this.documentHelper.blockToShift===h||this.isPastingContent||this.viewer.owner.editorModule.updateListItemsTillEnd(h,a)},psi.prototype.updateClientAreaForLine=function(e){e.marginTop=0;var e=this.documentHelper.selection.getTop(e),t=this.viewer.clientArea.x;this.viewer.cutFromTop(e),this.viewer.cutFromLeft(t)},psi.prototype.isAuto=function(e){var t=!1;if("Auto"!==e.tableFormat.preferredWidthType||0!==e.tableFormat.preferredWidth||!e.tableFormat.allowAutoFit)return!1;for(var i=0;i<e.childWidgets.length;i++)for(var n=e.childWidgets[i],o=0;o<n.childWidgets.length;o++){var r=n.childWidgets[o];if("Auto"!==r.cellFormat.preferredWidthType||0!==r.cellFormat.preferredWidth)return!1;t=!0}return t=t&&e.isInsideTable&&e.containerWidget instanceof Uai?this.isAuto(e.containerWidget.ownerTable):t},psi.prototype.getParentTable=function(e){for(var t=e;t.containerWidget;){if(t.containerWidget instanceof bai||t.containerWidget instanceof Zli)return t;t=t.containerWidget}},psi.prototype.reLayoutParagraph=function(e,t,i,n,o){if(!(this.isReplaceAll||this.viewer.owner.editorModule&&this.viewer.owner.editorModule.restrictLayout)){this.isRelayout=!0,e.containerWidget instanceof Zli&&"Inline"===e.containerWidget.containerShape.textWrappingStyle&&(t=e.containerWidget.containerShape.line.indexInOwner,e=e.containerWidget.containerShape.paragraph),n=!je(n)&&n;var r=!(this.isRelayout=!0),s=(this.documentHelper.blockToShift===e?(this.layoutBodyWidgetCollection(e.index,e.containerWidget,e,!1),r=this.isBidiReLayout=!0):this.isBidiReLayout&&(this.isBidiReLayout=!1),!1);if(!r)if(e.isInsideTable){this.isBidiReLayout=!0,this.documentHelper.owner.editorHistoryModule&&this.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo&&this.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo.isEmptySelection&&(s=!0);var r=this.getParentTable(e),a=r.containerWidget;if(!this.isReplacingAll&&s&&a instanceof Sai&&je(a.containerWidget)){var l,h=r.tableHolder.clone(),d=!0;if(r.tableFormat.allowAutoFit){var p=1<r.getSplitWidgets().length?r.clone().combineWidget(this.viewer):r;if(p.isGridUpdated=!1,p.buildTableColumns(),p.isGridUpdated=!0,h.columns.length===p.tableHolder.columns.length){for(var c=0;c<p.tableHolder.columns.length;c++)if(p.tableHolder.columns[c].preferredWidth!==h.columns[c].preferredWidth){d=!1;break}}else d=!1}d?(e.associatedCell.ownerTable.footnoteElement&&0<e.associatedCell.ownerTable.footnoteElement.length&&this.clearFootnoteReference(e.associatedCell.ownerTable,!0),this.viewer.updateClientAreaForCell(e.associatedCell,!0),this.viewer.updateClientAreaForBlock(e,!0),this.viewer.owner.isDocumentLoaded&&this.viewer.owner.editorModule&&this.viewer.owner.editorModule.updateWholeListItems(e),this.layoutParagraph(e,0),this.viewer.updateClientAreaForBlock(e,!1),s=0,(a=this.getParentTable(e)).containerWidget instanceof Sai&&(s=(l=a.getSplitWidgets())[l.length-1].containerWidget.page.index),a=(r=a.combineWidget(this.viewer)).containerWidget,this.viewer instanceof sai&&(a.height-=r.height),this.viewer.updateClientArea(a,a.page),this.viewer.owner.isDocumentLoaded&&this.viewer.owner.editorModule&&(a=this.documentHelper.getFirstParagraphInFirstCell(r),this.viewer.owner.editorModule.updateWholeListItems(a)),this.viewer.updateClientAreaForBlock(r,!0),r.x-=r.leftBorderWidth,r.y-=r.topBorderWidth,a=this.getYPosition(r),this.viewer.cutFromTop(a),this.clearTableWidget(r,!0,!0,!1,!0,!0),this.shiftTableWidget(r,this.viewer),this.viewer.updateClientAreaForBlock(r,!1),a=0,r.containerWidget instanceof Sai&&(a=(l=r.getSplitWidgets())[l.length-1].containerWidget.page.index),this.viewer.owner.isDocumentLoaded&&this.viewer.owner.editorModule&&r.nextRenderedWidget&&this.viewer.owner.editorModule.updateWholeListItems(r.nextRenderedWidget),this.layoutNextItemsBlock(r,this.viewer,void 0,s!==a)):this.isReplacingAll||this.reLayoutTable(e)}else this.isReplacingAll||this.reLayoutTable(e);!this.isFootnoteContentChanged||je(e.bodyWidget)||je(e.bodyWidget.page.footnoteWidget)||(l=e.bodyWidget.page.footnoteWidget,this.layoutfootNote(l)),this.isBidiReLayout=!1}else this.reLayoutLine(e,t,n,o,void 0);e.bodyWidget instanceof Iai&&-1!==e.bodyWidget.headerFooterType.indexOf("Footer")&&this.shiftFooterChildLocation(e.bodyWidget,this.viewer)}},psi.prototype.getParentRow=function(e){return this.getParentCell(e).ownerRow},psi.prototype.getParentCell=function(e){for(var t=e;null!==t.ownerTable&&t.ownerTable.isInsideTable;)t=t.ownerTable.associatedCell;return t},psi.prototype.reLayoutRow=function(e){e instanceof Lai&&(e=e.associatedCell);var t=this.getParentRow(e).getSplitWidgets()[0];if(je(t)||t.ownerTable.tableFormat.allowAutoFit)this.currentCell=e,this.reLayoutTable(e),this.currentCell=void 0;else{for(var i=t.ownerTable.getSplitWidgets()[0].combineWidget(this.viewer),n=t;this.isVerticalMergedCellContinue(n);){var o=n.previousWidget;if(je(o))break;n=o}var r=i.containerWidget,e=(this.viewer instanceof sai&&(r.height-=i.height),!this.viewer.owner.enableHeaderAndFooter&&!e.isInHeaderFooter||r instanceof Zli?r instanceof Zli?this.viewer.updateClientAreaForTextBoxShape(r.containerShape,!0):this.viewer.updateClientArea(r,r.page):(e.bodyWidget.isEmpty=!1,r.height-=i.height,this.viewer.updateHeaderFooterClientAreaWithTop(i.bodyWidget.sectionFormat,this.documentHelper.isBlockInHeader(i),r.page)),new pai(this.viewer.clientArea.x,this.viewer.clientArea.y,this.viewer.clientArea.width,this.viewer.clientArea.height)),r=new pai(e.x,e.y,e.width,e.height);for(this.viewer.owner.isDocumentLoaded&&this.viewer.owner.editorModule&&(e=this.documentHelper.getFirstParagraphInFirstCell(i),this.viewer.owner.editorModule.updateWholeListItems(e)),this.viewer.updateClientAreaForBlock(i,!0),this.viewer.cutFromTop(n.y),this.viewer.clientActiveArea.height=Number.POSITIVE_INFINITY,i.height=0;this.clearRowWidget(t,!0,!0,!0),this.layoutRow([i],t,!0),n!==t&&(n=n.nextRow)&&n!==t;);this.updateChildLocationForTable(i.y,i),this.viewer.clientArea=r,this.viewer.clientActiveArea=new pai(r.x,r.y,r.width,r.height),this.viewer.updateClientAreaForBlock(i,!0),i.x-=i.leftBorderWidth,i.y-=i.topBorderWidth,this.viewer.cutFromTop(i.y),this.shiftTableWidget(i,this.viewer,!0),this.layoutNextItemsBlock(i,this.viewer)}},psi.prototype.reLayoutTable=function(e,t){if(!this.viewer.owner.editorModule||!this.viewer.owner.editorModule.restrictLayout){var i=this.getParentTable(e);if(i.header)for(var n=i.getSplitWidgets(),o=1;o<n.length;o++)n[o].bodyWidget.page.repeatHeaderRowTableWidget=!1;var r,s=0,a=(i.containerWidget instanceof Sai&&(s=(r=i.getSplitWidgets())[r.length-1].containerWidget.page.index),i.combineWidget(this.viewer)),l=a.containerWidget,i=(this.viewer instanceof sai&&(l.height-=a.height),!this.viewer.owner.enableHeaderAndFooter&&!e.isInHeaderFooter||l instanceof Zli?l instanceof Zli?this.viewer.updateClientAreaForTextBoxShape(l.containerShape,!0):this.viewer.updateClientArea(l,l.page):(e.bodyWidget.isEmpty=!1,l.height-=a.height,this.viewer.updateHeaderFooterClientAreaWithTop(i.bodyWidget.sectionFormat,this.documentHelper.isBlockInHeader(i),l.page)),this.viewer.owner.isDocumentLoaded&&this.viewer.owner.editorModule&&(e=this.documentHelper.getFirstParagraphInFirstCell(a),this.viewer.owner.editorModule.updateWholeListItems(e)),this.viewer.updateClientAreaForBlock(a,!0),a.x-=a.leftBorderWidth,a.y-=a.topBorderWidth,this.getYPosition(a)),l=(this.viewer.cutFromTop(i),this.clearTableWidget(a,!0,!0,!0,!0),this.isBidiReLayout=!0,this.layoutBlock(a,0),this.viewer.updateClientAreaForBlock(a,!1),0);a.containerWidget instanceof Sai&&(l=(r=a.getSplitWidgets())[r.length-1].containerWidget.page.index),this.layoutNextItemsBlock(a,this.viewer,t,s!==l)}},psi.prototype.getYPosition=function(e){if(e.wrapTextAround){for(var t=e.previousWidget;t;){if(t instanceof Lai)return t.y+t.height;if(t instanceof _ai){if(!t.wrapTextAround)return t.y+t.height;t=t.previousWidget}}return this.viewer.clientActiveArea.y}return e.y},psi.prototype.clearFootnoteReference=function(e,t){if(e.footnoteElement&&0<e.footnoteElement.length){for(var i=e.bodyWidget.page,n=e.footnoteElement.length-1;0<=n;n--){var o,r=e.footnoteElement[n],s=(r.isLayout=!1,r.bodyWidget.containerWidget);s&&-1!==s.bodyWidgets.indexOf(r.bodyWidget)&&(o=this.getFootNoteHeight(r.bodyWidget),s.height-=o,s.bodyWidgets.splice(r.bodyWidget.indexInOwner,1),t)&&s.page===i&&(this.viewer.clientActiveArea.height+=o,this.viewer.clientArea.height+=o),s&&0===s.bodyWidgets.length&&s.page&&(s.page.footnoteWidget=void 0),r.bodyWidget.containerWidget=void 0}e.footnoteElement=[]}},psi.prototype.clearTableWidget=function(e,t,i,n,o,r){e.height=0,n&&(e.isGridUpdated=!1),t&&(e.y=0,e.x=0,e.footnoteElement)&&0<e.footnoteElement.length&&this.clearFootnoteReference(e,o),e.leftBorderWidth=0,e.rightBorderWidth=0,e.topBorderWidth=0;for(var s=e.bottomBorderWidth=0;s<e.childWidgets.length;s++){var a=e.childWidgets[s];this.clearRowWidget(a,t,i,n,r)}},psi.prototype.clearRowWidget=function(e,t,i,n,o){e.height=0,t&&(e.y=0,e.x=0),e.topBorderWidth=0;for(var r=e.bottomBorderWidth=0;r<e.childWidgets.length;r++){var s=e.childWidgets[r];this.clearCellWidget(s,t,i,n,o)}},psi.prototype.clearCellWidget=function(e,t,i,n,o){e.height=0,t&&(e.y=0,e.x=0),e.leftBorderWidth=0,e.rightBorderWidth=0,this.clearBlockWidget(e.childWidgets,t,i,n,o)},psi.prototype.clearBlockWidget=function(e,t,i,n,o){for(var r=0;r<e.length;r++){var s=e[r];s instanceof Lai?(t&&!o&&(s.y=0,s.x=0),i&&!o&&(s.height=0)):this.clearTableWidget(s,t,i,n,void 0,o)}},psi.prototype.layoutBodyWidgetCollection=function(e,t,i,n,o,r){if(je(i)||!i.isFieldCodeBlock){if(!je(this.documentHelper.owner)&&this.documentHelper.owner.isLayoutEnabled){if(this.viewer.owner.editorModule&&this.viewer.owner.editor.restrictLayout)return;if(t instanceof bai||t instanceof Zli){i=this.checkAndGetBlock(t,e);if(t instanceof Sai&&je(i)&&!je(t.nextRenderedWidget)&&"NoBreak"===t.nextRenderedWidget.sectionFormat.breakCode&&(i=t.nextRenderedWidget.firstChild,t=t.nextRenderedWidget),je(i))return;if(this.viewer instanceof sai&&(i.containerWidget.height-=i.height),t instanceof Iai)t.isEmpty=!1,this.viewer.updateHeaderFooterClientAreaWithTop(t.sectionFormat,-1!==t.headerFooterType.indexOf("Header"),t.page),i.containerWidget.height-=i.height;else if(t instanceof Zli)this.viewer.updateClientAreaForTextBoxShape(t.containerShape,!0,!n);else if(!je(t.containerWidget)&&t.containerWidget instanceof Pai){if(this.viewer.updateClientArea(t,t.page,!0),"Footnote"!==t.containerWidget.footNoteType)return this.viewer.cutFromTop(t.containerWidget.y),void this.layoutfootNote(t.containerWidget);this.isRelayoutFootnote=!0,this.viewer.clientArea.height=Number.POSITIVE_INFINITY,this.viewer.clientActiveArea.height=Number.POSITIVE_INFINITY,this.viewer.clientActiveArea.y=i.containerWidget.containerWidget.y}else je(t.page.footnoteWidget)||t.page.footnoteWidget.footNoteType,this.viewer.updateClientArea(t,t.page,!0);var s=0,a=0;if(i.containerWidget instanceof Sai&&(s=(h=i.getSplitWidgets())[h.length-1].containerWidget.page.index),0<e||"NoBreak"===i.bodyWidget.sectionFormat.breakCode&&0!==i.bodyWidget.index&&i===t.firstChild){var l=(i=i.combineWidget(this.viewer)).getSplitWidgets()[0].previousRenderedWidget;for(!je(l)&&l.wrapTextAround&&!je(l.getSplitWidgets()[0].previousRenderedWidget)&&l.bodyWidget.index===l.getSplitWidgets()[0].previousRenderedWidget.bodyWidget.index&&l.y<l.getSplitWidgets()[0].previousRenderedWidget.y&&(l=l.getSplitWidgets()[0].previousRenderedWidget);l instanceof Dai&&l.isFieldCodeBlock;)l=l.getSplitWidgets()[0].previousRenderedWidget;!(je(l)||l instanceof Lai)||l instanceof Lai&&!l.isEndsWithPageBreak&&!l.isEndsWithColumnBreak?je(o)&&i.containerWidget!==l.containerWidget?(e=i.containerWidget,o=l.containerWidget,d=this.getFootNoteWidgetsOf(i),this.moveFootNotesToPage(d,e,o),"NoBreak"!==i.bodyWidget.sectionFormat.breakCode||i.bodyWidget.index===l.bodyWidget.index?(this.viewer.cutFromTop(l.y+l.height),this.updateContainerWidget(i,o,l.indexInOwner+1,!1)):i.bodyWidget.sectionIndex!==l.bodyWidget.sectionIndex&&1<l.bodyWidget.sectionFormat.numberOfColumns&&i.bodyWidget.page===l.bodyWidget.page?(d=this.getBodyWidget(l.bodyWidget,!0),e=this.getNextWidgetHeight(d),this.viewer.clientActiveArea.height-=e-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=e,this.viewer.clientArea.y=this.viewer.clientActiveArea.y,this.viewer.clientArea.height=this.viewer.clientActiveArea.height):(this.viewer.updateClientArea(i.bodyWidget,i.bodyWidget.page,!0),this.viewer.cutFromTop(l.y+l.height))):(l instanceof Lai&&l.height<=0&&this.isMultiColumnDoc&&(o=l,this.viewer.updateClientAreaForBlock(o,!0),this.layoutParagraph(o,0),this.viewer.updateClientArea(o.bodyWidget,o.bodyWidget.page,!0)),this.viewer.cutFromTop(l.y+l.height)):l instanceof Lai&&(l.isEndsWithPageBreak||l.isEndsWithColumnBreak)&&l.containerWidget===i.containerWidget&&this.moveBlocksToNextPage(l,!1)}var h,d=void 0,e=(d=(i=i.combineWidget(this.viewer))instanceof _ai?(this.clearTableWidget(i,!0,!0),i.isGridUpdated=!1,this.documentHelper.getFirstParagraphInFirstCell(i)):i,this.viewer.owner.isDocumentLoaded&&this.viewer.owner.editorModule&&this.viewer.owner.editorModule.updateWholeListItems(d),this.viewer.updateClientAreaForBlock(i,!0,void 0,!1,!0),this.isRelayout=!0,this.documentHelper.layout.layoutBlock(i,0),this.isRelayout=!1,this.viewer.updateClientAreaForBlock(i,!1),!je(t.containerWidget)&&t.containerWidget instanceof Pai&&"Footnote"===t.containerWidget.footNoteType&&this.layoutfootNote(t.containerWidget),t);null!=t.containerWidget||t instanceof Zli||null==e.page||null==e.page.footnoteWidget||"Footnote"===e.page.footnoteWidget.footNoteType&&this.layoutfootNote(e.page.footnoteWidget),i.containerWidget instanceof Sai&&(a=(h=i.getSplitWidgets())[h.length-1].containerWidget.page.index),n?this.shiftNextWidgets(i):this.layoutNextItemsBlock(i,this.viewer,void 0,s!==a)}else t instanceof Uai&&!r&&this.reLayoutTable(t.ownerTable)}this.isRelayoutFootnote=!1}},psi.prototype.checkAndGetBlock=function(e,t){if(e instanceof Zli)return e.childWidgets[t];var i=e.indexInOwner;if(e.page.bodyWidgets.length<=1)for(;e&&e.indexInOwner===i;){if(0<e.childWidgets.length&&e.firstChild.index<=t&&e.lastChild.index>=t)for(var n=0;n<e.childWidgets.length;n++)if((o=e.childWidgets[n]).index===t)return o;if(!(e instanceof Sai))break;e=e.nextRenderedWidget}else for(;e;){if(0<e.childWidgets.length)for(var o,n=0;n<e.childWidgets.length;n++)if((o=e.childWidgets[n]).index===t)return o;if(!(e instanceof Sai))break;e=e.nextRenderedWidget}},psi.prototype.layoutTable=function(e,t){if(this.isFieldCode&&!this.checkTableHasField(e)&&!this.isRelayout)return e.isFieldCodeBlock=!0,e;!je(e.previousWidget)&&this.viewer.clientActiveArea.height<0&&!e.wrapTextAround&&this.moveBlocksToNextPage(e.previousWidget,!1),e.isBidiTable=e.bidi,e.isGridUpdated||(e.buildTableColumns(),e.isGridUpdated=!0),"Word2013"===this.documentHelper.compatibilityMode||e.isInsideTable||je(e.firstChild.firstChild.leftMargin)||(this.viewer.clientActiveArea.x=this.viewer.clientActiveArea.x-Y.convertPointToPixel(e.firstChild.firstChild.leftMargin));var i,n,o,r=[e],s=(this.addTableWidget(this.viewer.clientActiveArea,r),this.viewer.updateClientAreaTopOrLeft(e,!0),0),a=(e.wrapTextAround?(i=this.viewer.clientActiveArea.clone(),n=this.viewer.clientArea.clone(),this.updateClientAreaForWrapTable(r,e,!0,i,n)):e.containerWidget instanceof Zli||(this.adjustClientAreaBasedOnTextWrapForTable(e,this.viewer.clientActiveArea),this.isWrapText&&(s=this.viewer.clientActiveArea.x-this.viewer.clientArea.x,this.isWrapText=!1,e.x=this.viewer.clientActiveArea.x)),0<e.childWidgets.length&&(o=e.childWidgets[0].rowFormat.isHeader,e.header=o,e.continueHeader=o,e.headerHeight=0),e.childWidgets[t]);for(this.updateFootnoteHeight(e,!0);a;)a=(a=this.layoutRow(r,a)).nextRow;return this.updateFootnoteHeight(e,!1),this.documentHelper.viewer instanceof nai&&e.wrapTextAround&&("Bottom"===e.positioning.verticalAlignment||"Center"===e.positioning.verticalAlignment||"Outside"===e.positioning.verticalAlignment)&&(this.updateTableFloatPoints(e),this.updateChildLocationForTable(e.y,e)),this.updateWidgetsToPage(r,[],e,!0),0<s&&(this.viewer.clientArea.x=this.viewer.clientArea.x-s),e.wrapTextAround&&this.updateClientAreaForWrapTable(r,e,!1,i,n),r[r.length-1].isLayouted=!0,r[r.length-1].isFieldCodeBlock=!1,"Word2013"===this.documentHelper.compatibilityMode||e.isInsideTable||e.wrapTextAround||je(e.firstChild.firstChild.leftMargin)||(this.viewer.clientArea.x=this.viewer.clientArea.x+Y.convertPointToPixel(e.firstChild.firstChild.leftMargin)),r[r.length-1]},psi.prototype.updateFootnoteHeight=function(e,t,i){if((!this.isInitialLoad||i)&&!e.isInsideTable&&!je(e.bodyWidget)&&!je(e.bodyWidget.page.footnoteWidget)&&"Footnote"===e.bodyWidget.page.footnoteWidget.footNoteType){var e=e.bodyWidget.page,n=e.bodyWidgets[0],o=Y.convertPointToPixel(n.sectionFormat.pageHeight),r=Y.convertPointToPixel(n.sectionFormat.topMargin),s=Y.convertPointToPixel(n.sectionFormat.bottomMargin),a=.667+s,l=!1,h=48,d=48;if(je(n.sectionFormat)||(r=Y.convertPointToPixel(n.sectionFormat.topMargin),h=Y.convertPointToPixel(n.sectionFormat.headerDistance),d=Y.convertPointToPixel(n.sectionFormat.footerDistance)),je(e.headerWidget)||(l=e.headerWidget.isEmpty,0<=r?l&&!this.documentHelper.owner.enableHeaderAndFooter||(r=Math.min(Math.max(h+e.headerWidget.height,r),o/100*40)):r=Math.abs(r)),je(e.footerWidget)||(l=e.footerWidget.isEmpty,p=je(e.footnoteWidget)?0:e.footnoteWidget.height,p=Math.min(p,(o-r-a)/100*90),0<=a?l&&!this.documentHelper.owner.enableHeaderAndFooter||(a=.667+Math.min(o/100*40,Math.max(d+e.footerWidget.height,s))):a=Math.abs(a),i)||(a+=p),!je(e.footnoteWidget)){var p=je(e.footnoteWidget)?0:e.footnoteWidget.height,n=o-r-a;if(i)return n+this.viewer.clientArea.y;t&&n===this.viewer.clientArea.height?this.viewer.clientArea.height+=p:n+p===this.viewer.clientArea.height&&(this.viewer.clientArea.height-=p)}}return 0},psi.prototype.updateClientAreaForWrapTable=function(e,t,i,n,o){var r;if(i)t.wrapTextAround&&(this.updateTableFloatPoints(t),i=this.viewer.clientActiveArea.clone(),r=this.adjustClientAreaBasedOnTextWrapForTable(t,this.viewer.clientActiveArea),i.x!==r.x&&(t.x=this.viewer.clientActiveArea.x),i.y!==r.y)&&(t.y=this.viewer.clientActiveArea.y);else if(t.wrapTextAround&&t.bodyWidget)if(1==e.length)!je(t.previousWidget)||t.isInHeaderFooter||t.isInsideTable?(i=n.clone(),r=o.clone(),t.bodyWidget.lastChild!==e[e.length-1]&&(this.viewer.clientActiveArea=i,this.viewer.clientArea=r),!t.isLayouted&&i.height<t.height&&t.width>=i.width&&this.moveBlocksToNextPage(t.previousWidget,!1)):(this.documentHelper.tableLefts.pop(),this.viewer.updateClientArea(t.bodyWidget,t.bodyWidget.page)),-1===t.bodyWidget.floatingElements.indexOf(t)&&t.bodyWidget.floatingElements.push(t);else{if(!je(t.previousWidget)&&!t.isLayouted&&n.height<t.height&&t.width>=n.width)for(var s=t;this.moveBlocksToNextPage(s.previousWidget,!1),s=s.nextSplitWidget;);this.documentHelper.tableLefts.pop(),this.viewer.updateClientArea(t.bodyWidget,t.bodyWidget.page);for(var a=0;a<e.length;a++){var l=e[a].bodyWidget;je(l)||-1!==l.floatingElements.indexOf(e[a])||l.floatingElements.push(e[a])}o=e[e.length-1];this.viewer.cutFromTop(this.viewer.clientActiveArea.y+o.height+o.tableFormat.borders.bottom.lineWidth)}},psi.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,0<n.tableFormat.cellSpacing&&(n.height=n.height+Y.convertPointToPixel(n.tableFormat.cellSpacing),n.isBidiTable?(n.leftBorderWidth=Y.convertPointToPixel(this.getTableRightBorder(n.tableFormat.borders).getLineWidth()),n.rightBorderWidth=Y.convertPointToPixel(this.getTableLeftBorder(n.tableFormat.borders).getLineWidth())):(n.leftBorderWidth=Y.convertPointToPixel(this.getTableLeftBorder(n.tableFormat.borders).getLineWidth()),n.rightBorderWidth=Y.convertPointToPixel(this.getTableRightBorder(n.tableFormat.borders).getLineWidth())),n.topBorderWidth=Y.convertPointToPixel(this.getTableTopBorder(n.tableFormat.borders).getLineWidth()),n.bottomBorderWidth=Y.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},psi.prototype.updateWidgetsToPage=function(e,t,i,n,o){var r=this.viewer,s=e[e.length-1];if(!i.isInsideTable){for(var a=0;a<e.length;a++)this.updateHeightForTableWidget(e,t,e[a],o);0<s.childWidgets.length&&s.y!==s.childWidgets[0].y&&(s.y=s.childWidgets[0].y)}if(i.isBidiTable&&n)for(a=0;a<e.length;a++)for(var l=e[a],h=0;h<l.childWidgets.length;h++)l.childWidgets[h].shiftWidgetForRtlTable();0<i.tableFormat.cellSpacing&&(s.y+s.height+Y.convertPointToPixel(i.tableFormat.cellSpacing)>r.clientArea.bottom&&r instanceof sai&&(s.height=s.height-Y.convertPointToPixel(i.tableFormat.cellSpacing)/2),r.cutFromTop(s.y+s.height)),this.viewer instanceof sai&&(i.containerWidget.height+=i.height),i.bodyWidget instanceof Iai&&!i.wrapTextAround&&(i.containerWidget.height+=i.height,this.viewer.owner.enableHeaderAndFooter)&&-1!==i.bodyWidget.headerFooterType.indexOf("Footer")&&this.shiftFooterChildLocation(i.bodyWidget,this.viewer)},psi.prototype.updateHeightForTableWidget=function(e,t,i,n){for(var o=0;o<i.childWidgets.length;o++){var r=i.childWidgets[o];if(r===n)break;this.updateHeightForRowWidget(this.viewer,!0,e,t,r,!1,n)}},psi.prototype.layoutRow=function(e,t,i){for(var n=t.ownerTable.isInsideTable,o=(n||this.updateExistingFootnoteHeight(t),this.viewer),r=(this.addTableRowWidget(o.clientActiveArea,[t]),o.updateClientAreaForRow(t,!0),this.getMaxTopCellMargin(t)),s=this.getMaxBottomCellMargin(t),a=0;a<t.childWidgets.length;a++){var l=t.childWidgets[a];this.layoutCell(l,r+t.topBorderWidth,s+t.bottomBorderWidth)}o.updateClientAreaForRow(t,!1);o=[t];return i||this.updateWidgetsToTable(e,o,t,!1),n||(this.layoutedFootnoteElement=[]),o[o.length-1]},psi.prototype.updateExistingFootnoteHeight=function(e){this.layoutedFootnoteElement=[],je(e.bodyWidget.page.footnoteWidget)||0===e.bodyWidget.page.footnoteWidget.bodyWidgets.length?this.existFootnoteHeight=0:this.existFootnoteHeight=e.bodyWidget.page.footnoteWidget.height},psi.prototype.isIntersecting=function(e,t,i,n){return(Y.round(i,2)<=Y.round(e,2)||Y.round(i,2)<Y.round(t,2))&&Y.round(n,2)>Y.round(e,2)},psi.prototype.getAdjacentRowCell=function(e,t,i,n){var o=[],r=e.ownerTable.tableHolder.columns.length,s=e.ownerTable.childWidgets[n];if(!je(s)){var a=0,l=0,h=e.cellFormat.columnSpan,d=e.columnIndex;if(0<s.rowFormat.gridBefore){if(s.rowFormat.gridBefore>d+h)return o;a=s.rowFormat.beforeWidth,l=s.rowFormat.gridBefore}for(var p=0;p<s.childWidgets.length;p++){var c=s.childWidgets[p],u=c.x-c.margin.left,g=c.x+c.width+c.margin.right,m=c.columnIndex+c.cellFormat.columnSpan;if(p==s.childWidgets.length-1||Y.round(u,2)>Y.round(a,2)&&Y.round(u,2)>Y.round(t,2)){if(p==s.childWidgets.length-1&&0<s.rowFormat.gridAfter&&m+s.rowFormat.gridAfter===r)return o;if(this.isIntersecting(t,i,a,u))for(;0<h;){var f,y=s.getVerticalMergeStartCell(d,h);if(je(y))break;var v=y.cellFormat.columnSpan;if(o.push(y),f=y.x+y.width+y.margin.right,h-=(l=y.columnIndex+v)-d,d=l,Y.round(t=f,2)>=Y.round(i,2))break}}if(this.isIntersecting(t,i,u,g)&&(o.push(c),t=g,h-=m-d,d=m),Y.round(g,2)>=Y.round(i,2))break;a=g,l=m}}return o},psi.prototype.addTableRowWidget=function(e,t){var i=t[t.length-1],n=(0===i.rowFormat.beforeWidth&&0===i.rowFormat.gridBeforeWidth||this.documentHelper.alignTablesRowByRow&&"Left"!==i.ownerTable.tableFormat.tableAlignment?i.x=e.x:i.x+=0!==i.rowFormat.beforeWidth?i.rowFormat.beforeWidth:i.rowFormat.gridBeforeWidth,i.y=e.y,i.width=e.width,0);if(!je(i.ownerTable)&&!je(i.ownerTable.tableFormat)&&0<i.ownerTable.tableFormat.cellSpacing){i.height=i.height+Y.convertPointToPixel(i.ownerTable.tableFormat.cellSpacing);for(var o,r=0;r<i.childWidgets.length;r++)je(i.childWidgets[r].cellFormat)||je(i.childWidgets[r].cellFormat.borders)||n<(o=Uai.getCellBottomBorder(i.childWidgets[r]).getLineWidth())&&(n=o);if(i.bottomBorderWidth=Y.convertPointToPixel(n),0<i.index&&!je(i.previousWidget)){for(var s,a=i.previousWidget,n=0,l=0;l<a.childWidgets.length;l++)je(a.childWidgets[l].cellFormat)||je(a.childWidgets[l].cellFormat.borders)||n<(s=Uai.getCellBottomBorder(a.childWidgets[l]).getLineWidth())&&(n=s);i.topBorderWidth=Y.convertPointToPixel(n)}}if(!je(i.childWidgets))for(var h,l=0;l<i.childWidgets.length;l++)je(i.childWidgets[l].cellFormat)||je(i.childWidgets[l].cellFormat.borders)||n<(h=Uai.getCellTopBorder(i.childWidgets[l]).getLineWidth())&&(n=h);if(i.topBorderWidth=Y.convertPointToPixel(n),!je(i.ownerTable)&&!je(i.ownerTable.tableFormat)&&i.ownerTable.tableFormat.cellSpacing<=0&&i.rowIndex===i.ownerTable.childWidgets.length-1){for(var d,l=0;l<i.childWidgets.length;l++)je(i.childWidgets[l].cellFormat)||je(i.childWidgets[l].cellFormat.borders)||n<(d=Uai.getCellBottomBorder(i.childWidgets[l]).getLineWidth())&&(n=d);i.bottomBorderWidth=Y.convertPointToPixel(n)}return i},psi.prototype.getMaxTopCellMargin=function(e){if(je(e.childWidgets))return 0;for(var t=0,i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i],o=0;t<(o=n.cellFormat.hasValue("topMargin")?Y.convertPointToPixel(n.cellFormat.topMargin):e.rowFormat.hasValue("topMargin")?Y.convertPointToPixel(e.rowFormat.topMargin):Y.convertPointToPixel(e.ownerTable.tableFormat.topMargin))&&(t=o)}return t},psi.prototype.getMaxBottomCellMargin=function(e){if(je(e.childWidgets))return 0;for(var t=0,i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i],o=0;t<(o=n.cellFormat.hasValue("bottomMargin")?Y.convertPointToPixel(n.cellFormat.bottomMargin):e.rowFormat.hasValue("bottomMargin")?Y.convertPointToPixel(e.rowFormat.bottomMargin):Y.convertPointToPixel(e.ownerTable.tableFormat.bottomMargin))&&(t=o)}return t},psi.prototype.layoutCell=function(e,t,i){var n=this.viewer;this.addTableCellWidget(e,n.clientActiveArea,t,i),this.updateTopBorders(e),n.updateClientAreaForCell(e,!0),0===e.childWidgets.length&&((t=new Lai).characterFormat=new Eri,t.paragraphFormat=new bri,t.index=0,i=new Gai(t),t.childWidgets.push(i),e.childWidgets.push(t),t.paragraphFormat.borders=new uri);for(var o=0;o<e.childWidgets.length;o++){var r=e.childWidgets[o];n.updateClientAreaForBlock(r,!0),r.containerWidget=e,this.layoutBlock(r,0),n.updateClientAreaForBlock(r,!1)}this.updateWidgetToRow(e),n.updateClientAreaForCell(e,!1)},psi.prototype.isInsertTable=function(){return!(!this.documentHelper.owner.editorHistoryModule||!this.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo||"InsertTable"!==this.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo.action)},psi.prototype.updateTopBorders=function(e){if(e.updatedTopBorders=[],0===e.ownerTable.tableFormat.cellSpacing)for(var t=e.cellFormat.borders.top,i=((t=!t.isBorderDefined||t.isBorderDefined&&"None"===t.lineStyle&&0===t.lineWidth&&t.hasValue("color")?e.ownerRow.rowFormat.borders.horizontal:t).isBorderDefined||(t=e.ownerRow.ownerTable.tableFormat.borders.horizontal),e.x-e.margin.left),n=e.x+e.width+e.margin.right,o=this.getAdjacentRowCell(e,i,n,e.ownerRow.indexInOwner-1),r=0;r<o.length;r++){var s,a=o[r],l=a.cellFormat.borders.bottom,h=((l=!l.isBorderDefined||l.isBorderDefined&&"None"===l.lineStyle&&0===l.lineWidth&&l.hasValue("color")?a.ownerRow.rowFormat.borders.horizontal:l).isBorderDefined||(l=a.ownerRow.ownerTable.tableFormat.borders.horizontal),void 0),h="None"===t.lineStyle||"Cleared"===t.lineStyle?l:"Cleared"===l.lineStyle||"None"===l.lineStyle?t:e.getBorderBasedOnPriority(t,l),l=a.x-a.margin.left,a=a.x+a.width+a.margin.right;0===r&&i<l&&e.updatedTopBorders.push({border:t,width:l-i}),h&&(s=0,(s=Y.round(a,2)===Y.round(n,2)&&Y.round(l,2)===Y.round(i,2)?n-i:Y.round(l,2)>=Y.round(i,2)&&Y.round(a,2)>=Y.round(n,2)?n-l:Y.round(l,2)>=Y.round(i,2)&&Y.round(a,2)<=Y.round(n,2)?a-l:Y.round(l,2)<=Y.round(i,2)&&Y.round(a,2)<=Y.round(n,2)?a-i:(Y.round(l,2)<=Y.round(i,2)&&(Y.round(a,2),Y.round(n,2)),n-i))<0&&(s=0),e.updatedTopBorders.push({border:h,width:s})),r===o.length-1&&a<n&&e.updatedTopBorders.push({border:t,width:n-a})}},psi.prototype.shiftLayoutedItems=function(e,t){if(je(this.documentHelper.blockToShift)||je(this.documentHelper.blockToShift.containerWidget)||this.viewer.owner.editorModule&&this.viewer.owner.editorModule.restrictLayout)this.documentHelper.blockToShift=void 0,this.checkAndShiftEndnote(),e||this.documentHelper.removeEmptyPages();else{var i=this.documentHelper.blockToShift,n=this.getColumnBreak(i.bodyWidget),o=(!n&&this.viewer instanceof nai&&!this.isMultiColumnSplit&&i===i.bodyWidget.firstChild&&!je(i.bodyWidget.previousRenderedWidget)&&i.bodyWidget.sectionIndex!==i.bodyWidget.previousRenderedWidget.sectionIndex&&1<i.bodyWidget.previousRenderedWidget.sectionFormat.columns.length&&(v=i.bodyWidget.previousRenderedWidget,je((r=this.getBodyWidget(v,!1)).nextRenderedWidget)||r.page!==r.nextRenderedWidget.page||this.splitBodyWidgetBasedOnColumn(v)),!1),r=this.documentHelper.pages[this.documentHelper.pages.length-1];r.bodyWidgets[r.bodyWidgets.length-1];if((!n||e&&this.isSectionEndsWithColumnBreak(i.bodyWidget))&&this.viewer instanceof nai&&!this.isMultiColumnSplit&&1<i.bodyWidget.sectionFormat.columns.length){if(0!==i.bodyWidget.columnIndex||i!==i.bodyWidget.firstChild||je(i.previousRenderedWidget)||i.bodyWidget.page!==i.previousRenderedWidget.bodyWidget.page||(i.bodyWidget.y=this.viewer.clientActiveArea.y),o=i===i.bodyWidget.firstChild,this.reLayoutMultiColumn(i.bodyWidget,o,i.index),je(this.documentHelper.blockToShift))return;i=this.documentHelper.blockToShift}for(var s=i.bodyWidget.index,a=(this.reLayoutOrShiftWidgets(i,this.viewer,t),!0),l=i.getSplitWidgets(),h=l[l.length-1].nextRenderedWidget,d=[];h instanceof Dai&&(h.bodyWidget.index===s||"NoBreak"===h.bodyWidget.sectionFormat.breakCode&&i.bodyWidget.sectionFormat.pageWidth===h.bodyWidget.sectionFormat.pageWidth&&i.bodyWidget.sectionFormat.pageHeight===h.bodyWidget.sectionFormat.pageHeight);){if(t&&0===h.bodyWidget.sectionFormat.columns.length)return;if((!(n=this.getColumnBreak(h.bodyWidget))||e&&this.isSectionEndsWithColumnBreak(h.bodyWidget))&&this.viewer instanceof nai&&!this.isMultiColumnSplit&&1<h.bodyWidget.sectionFormat.columns.length){if(0!==h.bodyWidget.columnIndex||h!==h.bodyWidget.firstChild||je(h.previousRenderedWidget)||h.bodyWidget.page!==h.previousRenderedWidget.bodyWidget.page||(h.bodyWidget.y=this.viewer.clientActiveArea.y),o=h===h.bodyWidget.firstChild,this.reLayoutMultiColumn(h.bodyWidget,o,h.index),je(this.documentHelper.blockToShift))return;h=this.documentHelper.blockToShift}var p=(u=i.getSplitWidgets())[u.length-1],a=!1,c=void 0,u=(i=h).getSplitWidgets();if((i instanceof Lai||i instanceof _ai)&&(c=u[0]),!this.documentHelper.owner.editorModule.isFootnoteElementRemoved&&p.containerWidget===c.containerWidget&&Y.round(c.y,2)===Y.round(this.viewer.clientActiveArea.y,2)&&je(c.nextWidget))break;if(je(p.floatingElements),a=!0,i.isFieldCodeBlock||this.reLayoutOrShiftWidgets(i,this.viewer,t,d),this.keepWithNext&&(i=this.documentHelper.blockToShift,this.keepWithNext=!1),!this.isMultiColumnSplit&&n&&1<i.bodyWidget.sectionFormat.numberOfColumns&&i.bodyWidget.nextWidget&&i.nextRenderedWidget&&i.bodyWidget.index!==i.nextRenderedWidget.bodyWidget.index&&(u=this.viewer.clientActiveArea.y,c=this.viewer.clientActiveArea.height,this.viewer.updateClientArea(i.bodyWidget.nextWidget,i.bodyWidget.nextWidget.page),this.viewer.clientActiveArea.height=c,this.viewer.clientActiveArea.y=u),this.isMultiColumnSplit&&1<i.bodyWidget.sectionFormat.numberOfColumns&&i===i.bodyWidget.lastChild&&!je(i.bodyWidget.nextRenderedWidget)&&i.bodyWidget.sectionIndex!==i.bodyWidget.nextRenderedWidget.sectionIndex&&i.bodyWidget.page===i.bodyWidget.nextRenderedWidget.page)return;h=(l=i.getSplitWidgets())[l.length-1].nextRenderedWidget}this.viewer.owner.editorModule&&this.viewer.owner.editorModule.updateListItemsTillEnd(i,a),this.documentHelper.blockToShift=void 0;var g,m,f,y,v=this.viewer,b=(v.owner.editorModule.isFootnoteElementRemoved&&(f=(r=this.documentHelper.pages[this.documentHelper.pages.length-1]).bodyWidgets[r.bodyWidgets.length-1],je(r=r.endnoteWidget)||(g=this.viewer.clientArea.clone(),m=this.viewer.clientActiveArea.clone(),y=f.y,0<f.childWidgets.length&&(y=(f=f.childWidgets[f.childWidgets.length-1]).y+f.height),this.viewer.clientActiveArea.height=this.viewer.clientActiveArea.bottom-y,this.viewer.clientActiveArea.x=this.viewer.clientArea.x,this.viewer.clientActiveArea.width=this.viewer.clientArea.width,this.viewer.clientActiveArea.y=y,this.layoutfootNote(r),this.viewer.clientArea=g,this.viewer.clientActiveArea=m)),this.documentHelper.removeEmptyPages(),this.updateFieldElements(e),this.documentHelper.pages[0]);if(0<b.bodyWidgets[0].sectionIndex){for(var w=b;this.documentHelper.layout.layoutHeaderFooter(w.bodyWidgets[0],this.viewer,w),w=w.nextPage;);for(;0<b.bodyWidgets[0].sectionIndex;)this.documentHelper.owner.editorModule.updateSectionIndex(void 0,b.bodyWidgets[0],!1)}i.bodyWidget instanceof Pai||this.isRelayoutFootnote||!i.bodyWidget.page.endnoteWidget||this.checkAndShiftEndnote(!0),(this.documentHelper.owner.enableLockAndEdit||this.documentHelper.owner.enableHeaderAndFooter)&&e||this.isMultiColumnSplit||v.updateScrollBars()}},psi.prototype.isSectionEndsWithColumnBreak=function(e){return!je(e)&&0<e.childWidgets.length&&e.lastChild instanceof Lai&&e.lastChild.isEndsWithColumnBreak},psi.prototype.checkAndShiftEndnote=function(e){var t,i;this.documentHelper.owner.selectionModule&&(!(t=(t=this.documentHelper.owner.selectionModule.end.paragraph).isInsideTable?this.getParentTable(t):t)||t.isInHeaderFooter||t.bodyWidget.containerWidget instanceof Pai||!je(t.nextRenderedWidget)&&!e?this.isEndnoteContentChanged&&e&&!this.isRelayoutFootnote&&this.reLayoutEndnote():t.bodyWidget instanceof Pai||this.isRelayoutFootnote||!t.bodyWidget.page.endnoteWidget||(e=t.bodyWidget.page,t=this.viewer.clientActiveArea.clone(),i=this.getBodyWidget(e.bodyWidgets[e.bodyWidgets.length-1],!0),this.viewer.updateClientArea(i,i.page),0<(i=this.getNextWidgetHeight(i))&&(this.viewer.clientActiveArea.height-=i-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=i),this.layoutfootNote(e.endnoteWidget),this.viewer.clientActiveArea=t))},psi.prototype.updateFieldElements=function(e){for(var t=0;t<this.documentHelper.fields.length;t++){var i,n,o,r,s,a=this.documentHelper.fields[t];!(this.viewer instanceof nai||this.viewer instanceof sai&&!(a.line.paragraph.containerWidget instanceof Zli||a.line.paragraph.bodyWidget instanceof Iai))||je(this.documentHelper.selection)||(s=/^(?!.*\bhyperlink\b)(?!.*\bnumpages\b).*\bpage\b.*$/,je(r=this.documentHelper.selection.getFieldCode(a)))||!(r.toLowerCase().match("numpages")||r.toLowerCase().match("sectionpages")||s.test(r.toLowerCase())&&e)||je(a.fieldSeparator)||je(i=a.fieldSeparator.nextNode)||(n=i.text,!je((o=a.line.paragraph).containerWidget)&&o.containerWidget instanceof Sai&&-1===o.containerWidget.indexInOwner)||je(o.bodyWidget)||je(o.bodyWidget.page)||-1===o.bodyWidget.page.index||(s.test(r.toLowerCase())?(s=o.bodyWidget.page.index+1,i.text=s.toString()):i.text=this.documentHelper.pages.length.toString(),n!==i.text&&(i.isWidthUpdated=!1,r=o.childWidgets.indexOf(a.line),s=a.line.children.indexOf(i),o.isInsideTable?this.reLayoutParagraph(o,r,s):this.reLayoutLine(o,r,!1,!1,!0)))}},psi.prototype.reLayoutOrShiftWidgets=function(e,t,i,n){var o=e,r=!1;if(this.isNeedToRelayout(e.bodyWidget)||this.isPageBreakInsideContentControl(e)?(this.isMultiColumnSplit||this.updateContainerForTable(o,t),o instanceof _ai&&(o=o.combineWidget(this.viewer),this.clearTableWidget(o,!0,!0,!0)),t.updateClientAreaForBlock(o,!0),o.wrapTextAround&&(o.isLayouted=!1),this.isRelayout=!0,this.layoutBlock(o,0),this.isRelayout=!1,t.updateClientAreaForBlock(o,!1),r=!0):this.shiftWidgetsBlock(o,t,n),0<this.documentHelper.pages.indexOf(o.bodyWidget.page)&&o===o.bodyWidget.childWidgets[0]&&o instanceof Lai)for(var s=o.bodyWidget.childWidgets[0].childWidgets[0].children,a=0;a<s.length;a++){var l=s[a];0<l.margin.top&&l.margin.top===this.getBeforeSpacing(l.paragraph)&&(l.margin.top-=this.getBeforeSpacing(l.paragraph))}!this.viewer.owner.editorModule||r||i||this.viewer.owner.editorModule.updateRenderedListItems(o),!this.isRelayoutFootnote&&o.bodyWidget.page.footnoteWidget&&(this.islayoutFootnote=!0,this.layoutfootNote(o.bodyWidget.page.footnoteWidget))},psi.prototype.isNeedToRelayout=function(e){for(var t=0;t<e.floatingElements.length;t++){var i=e.floatingElements[t];if(i instanceof _ai||i instanceof qli&&("Square"===i.textWrappingStyle||"TopAndBottom"===i.textWrappingStyle))return!0}return!1},psi.prototype.shiftWidgetsBlock=function(e,t,i){e instanceof Lai?this.shiftWidgetsForPara(e,t,i):e instanceof _ai&&(!je(i)&&0<i.length&&e.previousRenderedWidget&&e.previousRenderedWidget.y+e.previousRenderedWidget.height+e.height>this.viewer.clientArea.bottom&&(i.length=0),this.shiftWidgetsForTable(e,t))},psi.prototype.shiftWidgetsForPara=function(e,t,i){if(!(e.height>t.clientArea.height+t.clientArea.y)||this.documentHelper.owner.enableHeaderAndFooter){if(e.isEmpty()){var n=e.previousRenderedWidget;if(e.isSectionBreak&&0<e.index){if(n instanceof Lai)return this.layoutSectionBreakParagraph(e,n),void(!n.isEndsWithPageBreak&&this.viewer.clientActiveArea.y<=e.y&&this.viewer.cutFromTop(e.y+e.height));if(n instanceof _ai&&"Word2013"!==this.documentHelper.compatibilityMode)return}}e.bodyWidget;for(var n=this.getBodyWidgetOfPreviousBlock(e,0),o=n.bodyWidget,r=n.index,s=void 0,a=!1,l=!0,h=0;h<e.getSplitWidgets().length;h++){var d=e.getSplitWidgets()[h],p=this.getBodyWidget(d.bodyWidget,!0);if(!this.isMultiColumnSplit||d===e){if(l&&!je(s)){var c=!!s.lastChild&&s.lastChild.isEndsWithPageBreak,u=!!s.lastChild&&s.lastChild.isEndsWithColumnBreak;if(this.shiftToPreviousWidget(d,t,s,c,u),this.updateFloatingElementPosition(s),(je(d.childWidgets)||0===d.childWidgets.length)&&!c&&!u){h--;continue}o!==d.containerWidget&&(o=d.containerWidget,c)&&s!==d.previousSplitWidget&&t.updateClientAreaByWidget(d),s=void 0}var g=[],m=(a||(g=this.getFootNoteWidgetsOf(d)),0),f=!1;if(!this.isMultiColumnSplit&&!d.isInsideTable&&!je(i)&&0<i.length&&this.isFitInClientArea(d,t,g)&&d.previousRenderedWidget&&d.bodyWidget.page===d.previousRenderedWidget.bodyWidget.page&&(m=this.getFootNoteHeight(i),w=this.updateFootnoteHeight(d,!1,!0),d.previousRenderedWidget.y+d.previousRenderedWidget.height+m+d.firstChild.height>w)&&this.viewer.clientArea.bottom<=w&&(f=!0),a=!1,this.isFitInClientArea(d,t,g)&&!f||t.clientActiveArea.height<d.firstChild.height&&this.viewer.clientActiveArea.y===this.viewer.clientArea.y||this.isMultiColumnSplit&&d.bodyWidget.sectionFormat.numberOfColumns-1!==d.bodyWidget.columnIndex){if(!je(i)&&!je(g)&&0<g.length)for(var y=0;y<g.length;y++)i.push(g[y]);if(this.keepWithNext&&(this.updateClientPositionForBlock(d.containerWidget.firstChild,d),this.keepWithNext=!1),t.updateClientAreaForBlock(s=d,!0,void 0,!1,!0),d.isEmpty()&&!je(d.paragraphFormat)&&("Center"===d.paragraphFormat.textAlignment||"Right"===d.paragraphFormat.textAlignment||"Justify"===d.paragraphFormat.textAlignment&&d.paragraphFormat.bidi)&&-1===d.paragraphFormat.listFormat.listId?this.updateXPositionForEmptyParagraph(t.clientActiveArea,d):d.x=t.clientActiveArea.x,t.updateClientAreaForBlock(d,!1),d.y=t.clientActiveArea.y,this.updateFloatingElementPosition(d),t.cutFromTop(t.clientActiveArea.y+d.height),je(o)||o===d.containerWidget||this.isMultiColumnSplit){if(d.containerWidget instanceof Sai&&d.containerWidget.firstChild===d&&d.previousRenderedWidget&&d.previousRenderedWidget instanceof Lai&&"NoBreak"==d.previousRenderedWidget.containerWidget.sectionFormat.breakCode&&d.containerWidget.page.index!==d.previousRenderedWidget.containerWidget.page.index&&d.containerWidget.index!==d.previousRenderedWidget.containerWidget.index){var v=d.previousRenderedWidget.bodyWidget,b=v.sectionFormat.breakCode,w=(je((v=1<v.sectionFormat.columns.length?this.getBodyWidget(v,!0):v).previousRenderedWidget)||"NoBreak"!==v.sectionFormat.breakCode||"NewPage"!=v.previousRenderedWidget.sectionFormat.breakCode||v.page.index!==v.previousRenderedWidget.page.index||(b=v.previousRenderedWidget.sectionFormat.breakCode),Y.round(this.getNextWidgetHeight(v)+d.height,2));if(!d.previousRenderedWidget.containerWidget.lastChild.isEndsWithPageBreak&&!d.previousRenderedWidget.containerWidget.lastChild.isEndsWithColumnBreak&&w<=Y.round(this.viewer.clientActiveArea.bottom,2)&&"NoBreak"===b){for(var C=d.previousRenderedWidget.bodyWidget.page,S=d.containerWidget.page,A=0;A<S.bodyWidgets.length;A++){var x=S.bodyWidgets[A];S.bodyWidgets.splice(S.bodyWidgets.indexOf(x),1),C.bodyWidgets.splice(C.bodyWidgets.length,0,x),x.page=C,A--}d.containerWidget.y=this.viewer.clientActiveArea.y,this.documentHelper.removeEmptyPages()}}}else if(r++,o.lastChild.isEndsWithPageBreak||o.lastChild.isEndsWithColumnBreak||this.isPageBreakInsideContentControl(o.lastChild)||this.updateContainerWidget(d,o,r,!0,g),0<g.length&&o.page.footnoteWidget)for(y=0;y<g.length;y++)-1===o.page.footnoteWidget.bodyWidgets.indexOf(g[y])&&d.bodyWidget.page.index!=g[y].page.index&&(o.page.footnoteWidget.bodyWidgets.push(g[y]),o.page.footnoteWidget.height+=g[y].height);!this.isInitialLoad&&l&&1<d.bodyWidget.sectionFormat.columns.length&&d===d.bodyWidget.firstChild&&!je(p.previousWidget)&&p.page===p.previousWidget.page&&(this.viewer.updateClientArea(d.bodyWidget,d.bodyWidget.page),p=this.getBodyWidget(p.previousWidget,!0),v=this.getNextWidgetHeight(p),d.bodyWidget.y=v,this.viewer.clientActiveArea.height-=v-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=v,l=!1,h--),(d.isEndsWithPageBreak&&!this.isPageBreakInsideField(d)||d.isEndsWithColumnBreak||this.isPageBreakInsideContentControl(d))&&this.viewer instanceof nai&&(x=this.createOrGetNextBodyWidget(o,this.viewer),x=this.moveBlocksToNextPage(d,!0),t.updateClientArea(x,x.page))}else{je(i)||(i.length=0);b=d.previousRenderedWidget,c=!1,u=!1,p=(b instanceof Lai&&b.isEndsWithPageBreak&&this.viewer instanceof nai&&(c=!0),b instanceof Lai&&b.isEndsWithColumnBreak&&this.viewer instanceof nai&&(u=!0),this.splitWidget(d,t,o,r+1,c,g,u,f?m:0));this.updateFloatingElementPosition(d),s=void 0,o!==d.containerWidget&&(o=d.containerWidget,h--,0<g.length)&&(a=!0),r=o.childWidgets.indexOf(d),p&&(o=e.getSplitWidgets()[h+1].containerWidget)}}}this.skipUpdateContainerWidget=!1}},psi.prototype.updateFloatingElementPosition=function(e){if(0<e.floatingElements.length)for(var t=0;t<e.floatingElements.length;t++){var i=e.floatingElements[t],n=0;if(i instanceof Xli&&"Inline"===i.textWrappingStyle){for(var o=i.line.indexInOwner,r=0,n=Y.convertPointToPixel(i.textFrame.marginTop),s=0;s<o;s++)je(e.childWidgets[s])||(r+=e.childWidgets[s].height);i.y=e.y+r}else{var a=this.getFloatingItemPoints(i);i.y=a.y,i.x=a.x}i instanceof Xli&&this.updateChildLocationForCellOrShape(i.y+n,i,void 0,!1,!0)}},psi.prototype.isPageBreakInsideField=function(e){for(var t=!1,i=!1,n=0,o=0;o<e.childWidgets.length;o++){var r=e.childWidgets[o];n+=r.height;for(var s=0;s<r.children.length;s++){var a=r.children[s];a instanceof Zai&&(0===a.fieldType?i=!0:2!==a.fieldType&&1!==a.fieldType||(i=!1)),t=!(!i&&"\f"===a.text)}}return t&&0===e.height&&this.viewer.cutFromTop(this.viewer.clientActiveArea.y+n),t},psi.prototype.isPageBreakInsideContentControl=function(e){var t=!1;return t=e instanceof Lai&&0<e.childWidgets.length&&0<(e=e.childWidgets[e.childWidgets.length-1]).children.length&&(e=e.children[e.children.length-1])instanceof Pli&&"Block"===e.contentControlWidgetType&&!je(e.previousElement)&&e.previousElement instanceof pli&&"\f"===e.previousElement.text?!0:t},psi.prototype.getFootNotesOfBlock=function(e,t){if(je(t)&&(t=[]),0<e.childWidgets.length)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},psi.prototype.getFootNotesWidgetsInLine=function(e){for(var t=[],i=0;i<e.children.length;i++){var n=e.children[i];n instanceof fli&&t.push(n)}return this.getFootNoteWidgetsBy(e.paragraph,t)},psi.prototype.getFootNoteWidgetsBy=function(e,t){var i=[];if(e.bodyWidget.page.footnoteWidget)for(var n=0;n<e.bodyWidget.page.footnoteWidget.bodyWidgets.length;n++)for(var o=0;o<t.length;o++)e.bodyWidget.page.footnoteWidget.bodyWidgets[n].footNoteReference===t[o]&&i.push(e.bodyWidget.page.footnoteWidget.bodyWidgets[n]);if(0===i.length&&!je(e.previousRenderedWidget)&&e.previousRenderedWidget.bodyWidget.page.footnoteWidget)for(n=0;n<e.previousRenderedWidget.bodyWidget.page.footnoteWidget.bodyWidgets.length;n++)for(o=0;o<t.length;o++)e.previousRenderedWidget.bodyWidget.page.footnoteWidget.bodyWidgets[n].footNoteReference===t[o]&&i.push(e.previousRenderedWidget.bodyWidget.page.footnoteWidget.bodyWidgets[n]);else if(!je(e.bodyWidget.previousRenderedWidget)&&e.bodyWidget.previousRenderedWidget.page.footnoteWidget)for(n=0;n<e.bodyWidget.previousRenderedWidget.page.footnoteWidget.bodyWidgets.length;n++)for(o=0;o<t.length;o++)e.bodyWidget.previousRenderedWidget.page.footnoteWidget.bodyWidgets[n].footNoteReference===t[o]&&i.push(e.bodyWidget.previousRenderedWidget.page.footnoteWidget.bodyWidgets[n]);else if(!je(e.bodyWidget.nextRenderedWidget)&&e.bodyWidget.nextRenderedWidget.page.footnoteWidget)for(n=0;n<e.bodyWidget.nextRenderedWidget.page.footnoteWidget.bodyWidgets.length;n++)for(o=0;o<t.length;o++)e.bodyWidget.nextRenderedWidget.page.footnoteWidget.bodyWidgets[n].footNoteReference===t[o]&&i.push(e.bodyWidget.nextRenderedWidget.page.footnoteWidget.bodyWidgets[n]);return i},psi.prototype.getFootNoteWidgetsOf=function(e,t){var i=[],n=[];if(e instanceof _ai)for(var o=0;o<e.childWidgets.length;o++)for(var r=e.childWidgets[o],s=0;s<r.childWidgets.length;s++)for(var a=r.childWidgets[s],l=0;l<a.childWidgets.length;l++){var h=a.childWidgets[l];if(h instanceof _ai)for(var d=this.getFootNoteWidgetsOf(h,t),p=0;p<d.length;p++)-1===i.indexOf(d[p])&&i.push(d[p]);else n=this.getFootNotesOfBlock(h,n);var c=this.getFootNoteWidgetsBy(h,n);if(t&&0===c.length)for(var u=0;u<n.length;u++)-1===i.indexOf(n[u].bodyWidget)&&i.push(n[u].bodyWidget);else for(p=0;p<c.length;p++)-1===i.indexOf(c[p])&&i.push(c[p])}else if(0<(n=this.getFootNotesOfBlock(e)).length&&(i=this.getFootNoteWidgetsBy(e,n)),t&&0===i.length)for(var g=0;g<n.length;g++)i.push(n[g].bodyWidget);return i},psi.prototype.getFootNodeWidgetsToShiftToPage=function(e){for(var t,i=e.getSplitWidgets(),n=[],o=e.containerWidget,r=0;r<i.length;r++)for(var s=this.getFootNoteWidgetsOf(i[r]),a=0;a<s.length;a++)o!==(t=s[a].containerWidget)&&n.push(s[a]);return{footNoteWidgets:n,fromBodyWidget:t,toBodyWidget:o}},psi.prototype.shiftTableWidget=function(e,t,i){void 0===i&&(i=!1),e.isBidiTable=e.bidi,"Word2013"===this.documentHelper.compatibilityMode||e.isInsideTable||je(e.firstChild.firstChild.leftMargin)||(this.viewer.clientActiveArea.x=this.viewer.clientActiveArea.x-Y.convertPointToPixel(e.firstChild.firstChild.leftMargin));var n,o,r,s=[e],a=(this.addTableWidget(this.viewer.clientActiveArea,s),this.viewer.updateClientAreaTopOrLeft(e,!0),0),l=(e.wrapTextAround?(n=this.viewer.clientActiveArea.clone(),o=this.viewer.clientArea.clone(),this.updateClientAreaForWrapTable(s,e,!0,n,o)):e.containerWidget instanceof Zli||(this.adjustClientAreaBasedOnTextWrapForTable(e,this.viewer.clientActiveArea),this.isWrapText&&(a=this.viewer.clientActiveArea.x-this.viewer.clientArea.x,this.isWrapText=!1,e.x=this.viewer.clientActiveArea.x)),0<e.childWidgets.length&&(r=e.childWidgets[0].rowFormat.isHeader,e.header=r,e.continueHeader=r,e.headerHeight=0),e.childWidgets[0]);for(this.updateFootnoteHeight(e,!0),this.documentHelper.viewer instanceof nai&&e.wrapTextAround&&("Bottom"===e.positioning.verticalAlignment||"Center"===e.positioning.verticalAlignment||"Outside"===e.positioning.verticalAlignment)&&(this.updateTableFloatPoints(e),this.updateChildLocationForTable(e.y,e));l;)l=(l=this.shiftRowWidget(s,l,i)).nextRow;return this.updateFootnoteHeight(e,!1),this.updateWidgetsToPage(s,[],e,!0),0<a&&(this.viewer.clientArea.x=this.viewer.clientArea.x-a),e.wrapTextAround&&this.updateClientAreaForWrapTable(s,e,!1,n,o),"Word2013"===this.documentHelper.compatibilityMode||e.isInsideTable||e.wrapTextAround||je(e.firstChild.firstChild.leftMargin)||(this.viewer.clientArea.x=this.viewer.clientArea.x+Y.convertPointToPixel(e.firstChild.firstChild.leftMargin)),s[s.length-1]},psi.prototype.shiftRowWidget=function(e,t,i){var n=this.viewer,o=((i=void 0===i?!1:i)&&(t.height=0),t.ownerTable.isInsideTable),r=(o||this.updateExistingFootnoteHeight(t),[t]);this.addTableRowWidget(n.clientActiveArea,r),n.updateClientAreaForRow(t,!0);for(var s=0;s<t.childWidgets.length;s++){var a=t.childWidgets[s];i&&(a.height=0),this.shiftCellWidget(a,this.getMaxTopCellMargin(t)+t.topBorderWidth,this.getMaxBottomCellMargin(t)+t.bottomBorderWidth,i)}return n.updateClientAreaForRow(t,!1),o||(n=this.footnoteHeight,this.updateFootnoteToBody(t,this.layoutedFootnoteElement),this.footnoteHeight=n),this.updateWidgetsToTable(e,r,t,!1),o||(this.layoutedFootnoteElement=[]),r[r.length-1]},psi.prototype.updateFootnoteToBody=function(e,t){this.layoutFootnoteInSplittedRow(e,this.getFootnoteBody(t)),je(e.ownerTable.footnoteElement)&&(e.ownerTable.footnoteElement=[]);for(var i=0;i<t.length;i++)e.ownerTable.footnoteElement.push(t[i])},psi.prototype.getFootnoteBody=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i].bodyWidget);return t},psi.prototype.shiftCellWidget=function(e,t,i,n){je(n)&&(n=!1);var o=this.viewer,t=(this.addTableCellWidget(e,o.clientActiveArea,t,i),this.viewer.clientActiveArea.height);o.updateClientAreaForCell(e,!0);for(var r=0;r<e.childWidgets.length;r++){var s=e.childWidgets[r],a=r!==e.childWidgets.length-1;o.updateClientAreaForBlock(s,!0),s instanceof Lai?this.shiftParagraphWidget(s,a):this.shiftTableWidget(s,o,n),o.updateClientAreaForBlock(s,!1)}this.updateWidgetToRow(e),o.updateClientAreaForCell(e,!1),e.ownerTable.isInsideTable||(this.viewer.clientActiveArea.height=t)},psi.prototype.shiftParagraphWidget=function(e,t){if(this.addParagraphWidget(this.viewer.clientActiveArea,e),0<e.floatingElements.length)for(var i=0;i<e.floatingElements.length;i++){var n=e.floatingElements[i],o=0;if(n instanceof Xli&&"Inline"===n.textWrappingStyle){for(var r=n.line.indexInOwner,s=0,o=Y.convertPointToPixel(n.textFrame.marginTop),a=0;a<r;a++)s+=e.childWidgets[a].height;n.y=e.y+s}else{var l=this.getFloatingItemPoints(n);n.y=l.y,n.x=l.x}n instanceof Xli&&this.updateChildLocationForCellOrShape(n.y+o,n)}this.viewer.cutFromTop(this.viewer.clientActiveArea.y+e.height);for(var h=this.getFootNoteWidgetsOf(e,!0),d=0;d<h.length;d++)this.layoutedFootnoteElement.push(h[d].footNoteReference);this.footnoteHeight+=this.getFootNoteHeight(h),this.updateWidgetToPage(this.viewer,e,t)},psi.prototype.updateContainerForTable=function(e,t){var i=this.getBodyWidgetOfPreviousBlock(e,0),n=i.bodyWidget,i=i.index,o=!je(n.lastChild)&&!je(n.lastChild.lastChild)&&n.lastChild.lastChild.isEndsWithPageBreak,r=!je(n.lastChild)&&!je(n.lastChild.lastChild)&&n.lastChild.lastChild.isEndsWithColumnBreak;n!==e.containerWidget&&(o||r?t.updateClientArea(e.bodyWidget,e.bodyWidget.page):this.updateContainerWidget(e,n,i+1,!0)),(e.isInHeaderFooter||this.viewer instanceof sai)&&(e.containerWidget.height-=e.height)},psi.prototype.shiftWidgetsForTable=function(e,t){this.updateContainerForTable(e,t),this.viewer.updateClientAreaForBlock(e,!0,void 0,!1,!0),this.updateVerticalPositionToTop(e,!0);t=e.combineWidget(this.viewer);this.documentHelper.layout.updateChildLocationForTable(t.y,t),this.clearTableWidget(t,!0,!1,!1,!0),this.shiftTableWidget(t,this.viewer),this.updateVerticalPositionToTop(e,!1),this.viewer.updateClientAreaForBlock(e,!1)},psi.prototype.updateVerticalPositionToTop=function(e,t){for(var i=0;i<e.getSplitWidgets().length;i++)for(var n=e.getSplitWidgets()[i],o=0;o<n.childWidgets.length;o++)for(var r=n.childWidgets[o],s=0;s<r.childWidgets.length;s++){var a=r.childWidgets[s];this.documentHelper.layout.updateCellVerticalPosition(a,t,!1)}},psi.prototype.splitWidget=function(e,t,i,n,o,r,s,a){var l=e.childWidgets[0],h=e.paragraphFormat.keepLinesTogether&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y?e.height:this.getMaxElementHeight(l),d=e.getSplitWidgets(),p=e.containerWidget,h=this.getMaximumLineHeightToSplit(e,h,t),c=this.getFootNotesWidgetsInLine(l);if(je(e.previousWidget)&&0<c.length)for(var u=0;u<c.length;u++)for(var g=0;g<c[u].childWidgets.length;g++)h+=c[u].childWidgets[g].height;l=0;if(!je(a)&&0<a&&(l=a),t.clientActiveArea.height>=h+l&&!o&&!s){var m=void 0,a=d.indexOf(e);a<d.length-1?p=(m=d[a+1]).containerWidget:((m=new Lai).index=e.index,m.characterFormat=e.characterFormat,m.paragraphFormat=e.paragraphFormat,m.width=e.width,m.x=e.x,m.y=e.y,d.push(m)),i===e.containerWidget||this.skipUpdateContainerWidget||this.updateContainerWidget(e,i,n,!0);for(u=e.childWidgets.length-1;0<u;u--){var f=e.childWidgets[u];if(this.isFitInClientArea(e,t,void 0)){1===m.childWidgets.length&&(this.updateParagraphWidgetInternal(f,m,0),this.skipUpdateContainerWidget=!0);break}f=e.childWidgets[u];this.updateParagraphWidgetInternal(f,m,0)}if(je(m.containerWidget)&&0<m.childWidgets.length){var l=t.clientActiveArea.y,o=new pai(t.clientArea.x,t.clientArea.y,t.clientArea.width,t.clientArea.height),s=new pai(t.clientActiveArea.x,t.clientActiveArea.y,t.clientActiveArea.width,t.clientActiveArea.height),y=e.bodyWidget.page,p=this.moveBlocksToNextPage(e,!1,-1);if((m.containerWidget=p).childWidgets.splice(0,0,m),y===p.page)return e.x!==e.containerWidget.x&&(e.x=e.containerWidget.x),e.y=l,t.updateClientArea(p,p.page),m=this.addParagraphWidget(this.viewer.clientActiveArea,m),!0;if(p.height+=m.height,p!=i&&this.moveFootNotesToPage(r,i,p),1===p.childWidgets.length&&p.firstChild instanceof Lai&&p.firstChild.equals(e))return e.y=l,!0;t.clientArea=o,t.clientActiveArea=s}}else{a=!1,d=0,n=(t.columnLayoutArea.setColumns(i.sectionFormat),p=this.createOrGetNextBodyWidget(i,this.viewer),this.alignBlockElement(e));if(this.isInitialLoad||je(n.node)||e.isEndsWithPageBreak||e.isEndsWithColumnBreak||!je(e.previousSplitWidget)||(l=n.node instanceof jai?this.splitRow(n.node):n.node).containerWidget instanceof Sai&&l.containerWidget.firstChild!==l&&(d=l instanceof _ai?0:parseInt(n.position.index,10),a=!0,!je((e=l).nextRenderedWidget))&&e.nextRenderedWidget instanceof Lai&&(this.keepWithNext=!0,this.documentHelper.blockToShift=e.nextRenderedWidget),e.containerWidget!==p||a){y=e.bodyWidget.page;if(i!==(p=this.moveBlocksToNextPage(e,!0))){if(t.updateClientArea(p,p.page),0<d&&this.keepWithNext){this.viewer.updateClientAreaForBlock(e,!0);var v=void 0;e instanceof _ai?this.addTableWidget(this.viewer.clientActiveArea,[e]):v=p.firstChild instanceof Lai&&p.firstChild.equals(e)?p.firstChild:new Lai,(v=this.moveChildsToParagraph(e,d,v)).containerWidget=p;for(var b=0;b<v.floatingElements.length;b++){var w=v.floatingElements[b];w.line.paragraph.bodyWidget!==e.bodyWidget&&"Inline"!==w.textWrappingStyle&&e.bodyWidget.floatingElements.splice(e.bodyWidget.floatingElements.indexOf(w),1)}e=v,-1===p.childWidgets.indexOf(e)&&p.childWidgets.splice(0,0,e),this.viewer.updateClientAreaLocation(e,this.viewer.clientActiveArea),this.layoutBlock(e,0,!0),this.viewer.updateClientAreaForBlock(e,!1)}else this.updateContainerWidget(e,p,0,!0),e instanceof _ai?this.addTableWidget(this.viewer.clientActiveArea,[e]):this.addParagraphWidget(this.viewer.clientActiveArea,e);this.moveFootNotesToPage(r,i,p)}if(i.page===p.page)return i!==p||(t.updateClientArea(p,p.page),!1)}}return i===e.containerWidget?(e.y=t.clientActiveArea.y,t.cutFromTop(t.clientActiveArea.y+e.height)):t.updateClientArea(p,p.page),!1},psi.prototype.getMaximumLineHeightToSplit=function(e,t,i){if(i.clientActiveArea.height>=t&&!e.paragraphFormat.keepLinesTogether&&e.paragraphFormat.widowControl&&!je(e.previousWidget)&&je(e.previousSplitWidget))for(var n=e.height,o=e.childWidgets.length-1;0<=o;o--){var r=e.childWidgets[o],s=this.getMaxElementHeight(r);if(r.height>s&&(n-=r.height-s),i.clientActiveArea.height>=n){0===o&&(t=e.height);break}n-=r.height}return t},psi.prototype.moveFootNotesToPage=function(e,t,i){if(0<e.length&&t.page.footnoteWidget&&t.page!==i.page){for(var n=void 0,o=0,r=!1,s=0;s<e.length;s++)if(n=e[s],0<=(a=t.page.footnoteWidget.bodyWidgets.indexOf(n))){void 0===i.page.footnoteWidget&&this.addEmptyFootNoteToBody(i);for(var a,l,h=0;h<i.page.footnoteWidget.bodyWidgets.length;h++)i.page.footnoteWidget.bodyWidgets[h].footNoteReference===n.footNoteReference&&(r=!0);t.page.footnoteWidget.bodyWidgets.splice(a,1),i.page.footnoteWidget.bodyWidgets.indexOf(n)<0&&!r&&(i.page.footnoteWidget.bodyWidgets.length,a=this.documentHelper.pages.indexOf(t.page),l=this.documentHelper.pages.indexOf(i.page),n.containerWidget=i.page.footnoteWidget,n.page=i.page,l<a?(i.page.footnoteWidget.bodyWidgets.push(n),o++):i.page.footnoteWidget.bodyWidgets.splice(o++,0,n),i.page.footnoteWidget.height+=n.height),t.page.footnoteWidget.height-=n.height}t.page.footnoteWidget&&0===t.page.footnoteWidget.bodyWidgets.length&&(t.page.footnoteWidget=void 0),void 0!==t.page.footnoteWidget&&this.layoutfootNote(t.page.footnoteWidget),void 0!==i.page.footnoteWidget&&this.layoutfootNote(i.page.footnoteWidget)}},psi.prototype.addEmptyFootNoteToBody=function(e){var t=new Pai,i=(t.footNoteType="Footnote",t.page=e.page,new Lai),n=(i.characterFormat=new Eri,i.paragraphFormat=new bri,i.index=0,new Gai(i));i.childWidgets.push(n),t.height=this.documentHelper.textHelper.getParagraphMarkSize(i.characterFormat).Height,t.margin=new gai(0,t.height,0,0),e.page.footnoteWidget=t},psi.prototype.getMaxElementHeight=function(e){var t=0;if(0===e.children.length||1===e.children.length&&e.children[0]instanceof lhi||2===e.children.length&&e.children[0]instanceof lhi&&e.children[1]instanceof lhi){t=this.documentHelper.selection.getParagraphMarkSize(e.paragraph,0,0).height;t+=0,0<e.children.length&&t<(i=e.children[0]).margin.top+i.height&&(t=i.margin.top+i.height)}else for(var i,n=0;n<e.children.length;n++)t<(i=e.children[n]).margin.top+i.height&&(t=i.margin.top+i.height);return t},psi.prototype.createOrGetNextBodyWidget=function(e,t){var i,n,o,r;return t.columnLayoutArea.setColumns(e.sectionFormat),je(t.columnLayoutArea.getNextColumnByBodyWidget(e))?(i=0,i=this.documentHelper.pages.indexOf(e.page),r=n=void 0,r=e.index,(i===this.documentHelper.pages.length-1||this.documentHelper.pages[i+1].sectionIndex!==r?((o=new Sai).sectionFormat=e.sectionFormat,o.index=e.index,n=t.createNewPage(o),this.documentHelper.pages[i+1].sectionIndex!==r&&this.documentHelper.insertPage(i+1,n),n):n=this.documentHelper.pages[i+1]).bodyWidgets[0]):this.createOrGetNextColumnBody(e)},psi.prototype.isFitInClientArea=function(e,t,i){var n=e.childWidgets[e.childWidgets.length-1],e=e.height,o=this.getMaxElementHeight(n),r=(n.height>o&&(e-=n.height-o),0);if(!je(i)&&0<i.length){i[0].containerWidget instanceof Pai&&(r=i[0].containerWidget.margin.top);for(var s=0;s<i.length;s++)for(var a=0;a<i[s].childWidgets.length;a++)r+=i[s].childWidgets[a].height}return t.clientActiveArea.height>=e+r},psi.prototype.isLineInFootNote=function(e,t){for(var i=0;i<t.length;i++)if(t[i].line===e)return!0;return!1},psi.prototype.shiftToPreviousWidget=function(e,t,i,n,o){var r=e.containerWidget,s=i.containerWidget,a=[],l=[];s!==r&&(a=this.getFootNotesOfBlock(e));for(var h=0;h<e.childWidgets.length;h++){var d=e.childWidgets[h],p=this.getMaxElementHeight(d);if(this.isLineInFootNote(d,a)){for(var c=this.getFootNoteWidgetsBy(d.paragraph,a),u=0,g=0;g<c.length;g++)for(var m=c[g],f=0;f<m.childWidgets.length;f++)u+=m.childWidgets[f].height;0<c.length&&c[0].containerWidget&&(u+=c[0].containerWidget.margin.top),p+=u}if(!(t.clientActiveArea.height>=p)||n||o){var p=i.containerWidget,y=(t.updateClientArea(p,p.page),this.createOrGetNextBodyWidget(p,t));p!==(y=e.containerWidget!==y?this.moveBlocksToNextPage(e,!0):y)&&(0<(a=this.getFootNotesOfBlock(e)).length&&(l=l.concat(this.getFootNoteWidgetsBy(e,a)),s=y),this.updateContainerWidget(e,y,0,!0)),t.updateClientArea(y,y.page);break}if(0<a.length&&this.isLineInFootNote(d,a)&&(l=l.concat(this.getFootNoteWidgetsBy(d.paragraph,a))),this.updateParagraphWidgetInternal(d,i,i.childWidgets.length),h--,t.cutFromTop(t.clientActiveArea.y+d.height),je(e.childWidgets))break}!je(l)&&0<l.length&&r.page.footnoteWidget&&r!=s&&this.moveFootNotesToPage(l,r,s)},psi.prototype.updateParagraphWidgetInternal=function(e,t,i){!je(e.paragraph)&&(e.paragraph.childWidgets.splice(e.paragraph.childWidgets.indexOf(e),1),e.paragraph.height-=e.height,je(e.paragraph.containerWidget)||(e.paragraph.containerWidget.height-=e.height),je(e.paragraph.childWidgets)||0===e.paragraph.childWidgets.length)&&e.paragraph.destroyInternal(this.viewer),!je(e.paragraph)&&0<e.paragraph.floatingElements.length&&this.shiftFloatingElements(e,t),t.childWidgets.splice(i,0,e),(e.paragraph=t).height+=e.height,je(t.containerWidget)||(t.containerWidget.height+=e.height)},psi.prototype.shiftFloatingElements=function(e,t){for(var i,n=0;n<e.children.length;n++)e.children[n]instanceof Xli&&"Inline"===e.children[n].textWrappingStyle&&0<=(i=e.paragraph.floatingElements.indexOf(e.children[n]))&&(e.paragraph.floatingElements.splice(i,1),t.floatingElements.splice(i,0,e.children[n]))},psi.prototype.shiftNextWidgets=function(e){for(var t=e;t.nextWidget instanceof Dai;){if(t=t.nextWidget,this.viewer instanceof nai&&!this.isMultiColumnSplit&&1<t.bodyWidget.sectionFormat.columns.length){var i=this.getBodyWidget(t.bodyWidget,!1);if(!je(i.nextRenderedWidget)&&i.page===i.nextRenderedWidget.page){this.splitBodyWidgetBasedOnColumn(t.bodyWidget);break}}this.reLayoutOrShiftWidgets(t,this.viewer)}},psi.prototype.updateContainerWidget=function(e,t,i,n,o){if(!(e.containerWidget&&e.containerWidget.containerWidget instanceof Pai)){var r=e.containerWidget;if(je(e.containerWidget)||(e.containerWidget.childWidgets.splice(e.containerWidget.childWidgets.indexOf(e),1),e.containerWidget.height-=t.height,(je(e.containerWidget.childWidgets)||0===e.containerWidget.childWidgets.length)&&e.containerWidget instanceof Sai&&e.containerWidget!==t&&n&&(n=e.containerWidget.page,this.documentHelper.pages[this.documentHelper.pages.length-1]===n&&-1!==this.viewer.visiblePages.indexOf(n)&&this.documentHelper.scrollToBottom(),je(n.endnoteWidget))&&(je(n.nextPage)||n.nextPage.bodyWidgets[0].index!==e.containerWidget.index)&&(!je((n=e.containerWidget).nextRenderedWidget)&&1<n.nextRenderedWidget.sectionFormat.columns.length&&(n.nextRenderedWidget.columnIndex=n.columnIndex),e.containerWidget.destroyInternal(this.viewer))),t.childWidgets.splice(i,0,e),e instanceof Lai&&!je(e.floatingElements))for(var s=0;s<e.floatingElements.length;s++){var a=e.floatingElements[s];"Inline"!==a.textWrappingStyle&&(t.floatingElements.push(a),e.bodyWidget.floatingElements.splice(e.bodyWidget.floatingElements.indexOf(a),1),t.floatingElements.sort(function(e,t){return e.y-t.y}))}e instanceof _ai&&e.wrapTextAround&&-1!==e.bodyWidget.floatingElements.indexOf(e)&&e.bodyWidget.floatingElements.splice(e.bodyWidget.floatingElements.indexOf(e),1),t.height+=t.height,e.containerWidget=t,r&&r.page&&r.page.footnoteWidget&&o&&0<o.length&&this.moveFootNotesToPage(o,r,t)}},psi.prototype.getBodyWidgetOfPreviousBlock=function(e,t){var i=void 0,n=e.previousRenderedWidget,i=n&&n.containerWidget.equals(e.containerWidget)?n.containerWidget:e instanceof _ai&&!je(e.containerWidget.previousRenderedWidget)&&e.containerWidget.index===e.containerWidget.previousRenderedWidget.index?e.containerWidget.previousRenderedWidget:e.containerWidget;return t=n&&n.containerWidget.equals(e.containerWidget)?i.childWidgets.indexOf(n):e.containerWidget.childWidgets.indexOf(e),{bodyWidget:i,index:t}},psi.prototype.moveBlocksToNextPage=function(e,t,i,n,o,r){var s=e.bodyWidget,a=(this.viewer.columnLayoutArea.setColumns(s.sectionFormat),this.viewer.columnLayoutArea.getNextColumnByBodyWidget(e.bodyWidget)),l=void 0,h=void 0;if(!(je(a)||e instanceof Lai&&e.isEndsWithPageBreak)&&((h=this.moveToNextColumnByBodyWidget(e,i)).columnIndex=a.index,h.y=e.bodyWidget.y,this.viewer.updateClientArea(h,h.page),this.viewer.clientActiveArea.height-=h.y-this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.y=h.y,1<e.bodyWidget.sectionFormat.columns.length))for(var i=e.bodyWidget.columnIndex,d=e.bodyWidget.x+e.bodyWidget.sectionFormat.columns[i].width+e.bodyWidget.sectionFormat.columns[i].space,p=0;p<e.bodyWidget.floatingElements.length;p++)e.bodyWidget.floatingElements[p]instanceof Xli&&d<e.bodyWidget.floatingElements[p].x+e.bodyWidget.floatingElements[p].width&&h.floatingElements.push(e.bodyWidget.floatingElements[p]);if(je(h)){var c,a=!1,i=s.page,u=i.index+1;if(this.documentHelper.pages.length>u&&!this.isMultiColumnLayout&&(l=this.documentHelper.pages[u],!o||je(l)||je(l.endnoteWidget)?je(l)||0===l.bodyWidgets.length||s.sectionFormat.pageHeight!==l.bodyWidgets[0].sectionFormat.pageHeight||s.sectionFormat.pageWidth!==l.bodyWidgets[0].sectionFormat.pageWidth||"NoBreak"!==s.sectionFormat.breakCode?0===l.bodyWidgets.length||!s.equals(l.bodyWidgets[0])||s.sectionIndex!==l.bodyWidgets[0].sectionIndex&&("NewPage"===s.sectionFormat.breakCode||!s.isWord2010NextColumn&&"NoBreak"!==s.sectionFormat.breakCode)?a=!(l=void 0):(h=l.bodyWidgets[0],this.viewer.updateClientArea(h,h.page)):l.bodyWidgets[0].index===s.index?(h=l.bodyWidgets[0],this.viewer.updateClientArea(h,h.page)):(h=this.createSplitBody(s),l.bodyWidgets.splice(0,0,h),h.page=l,this.viewer.updateClientArea(h,h.page),h.y=this.viewer.clientActiveArea.y):l.endnoteWidget.bodyWidgets[0].index===s.index?(h=l.endnoteWidget.bodyWidgets[0],this.viewer.updateClientArea(h,h.page)):(h=this.createSplitBody(s),(c=new Pai).footNoteType="Endnote",c.page=l,c.bodyWidgets.push(h),h.containerWidget=c,h.page=l,this.viewer.updateClientArea(h,h.page),h.y=this.viewer.clientActiveArea.y)),this.isMultiColumnLayout&&(a=!0),je(l)&&(h=this.createSplitBody(s),this.documentHelper.owner.editorHistoryModule&&this.documentHelper.owner.editorHistoryModule.isRedoing&&this.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo&&"SectionBreakContinuous"===this.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo.action&&"NoBreak"===e.bodyWidget.sectionFormat.breakCode||n||(o?(c=i.bodyWidgets[s.page.bodyWidgets.length-1],n=this.createSplitBody(c),l=this.viewer.createNewPage(n,u),this.viewer.updateClientArea(n,n.page),n.y=h.y=this.viewer.clientActiveArea.y,h.page=l):(l=this.viewer.createNewPage(h,u),this.viewer.updateClientArea(h,h.page),h.y=this.viewer.clientActiveArea.y)),a&&!je(l)&&this.documentHelper.insertPage(u,l),this.clearLineMeasures()),l)for(;;){var g=s.page.bodyWidgets[s.page.bodyWidgets.length-1];if(this.isSectionBreakCont||s===g||s.containerWidget instanceof Pai)break;s.page.bodyWidgets.splice(s.page.bodyWidgets.indexOf(g),1),l.bodyWidgets.splice(1,0,g),g.page=l}}if(this.isTextFormat){o=s.childWidgets.indexOf(e),i=s.childWidgets.slice(o);s.childWidgets.splice(o);for(var m=0,f=i;m<f.length;m++){var y=f[m];h.childWidgets.push(y),y.containerWidget=h}}else for(;;){var v,b=void 0,b=s.lastChild instanceof Pai?s.lastChild.previousWidget:s.lastChild;if((t||r&&e!==b&&!(b instanceof _ai)&&b.isLayouted)&&(v=this.getFootNoteWidgetsOf(b),this.moveFootNotesToPage(v,s,h)),e===b)break;if(s.childWidgets.splice(s.childWidgets.indexOf(b),1),h.childWidgets.splice(0,0,b),b instanceof _ai&&-1!==s.floatingElements.indexOf(b)&&s.floatingElements.splice(s.floatingElements.indexOf(b),1),b instanceof Lai&&0<b.floatingElements.length)for(var w=0;w<b.floatingElements.length;w++)-1!==s.floatingElements.indexOf(b.floatingElements[w])&&"Inline"!==b.floatingElements[w].textWrappingStyle&&(s.floatingElements.splice(s.floatingElements.indexOf(b.floatingElements[w]),1),h.floatingElements.push(b.floatingElements[w]));(b.containerWidget=h).height+=b.height}return h},psi.prototype.createSplitBody=function(e){var t=this.addBodyWidget(this.viewer.clientActiveArea);return t.sectionFormat=e.sectionFormat,t.index=e.index,t},psi.prototype.createOrGetNextColumnBody=function(e){var t;return je(t=e.nextRenderedWidget&&e.columnIndex+1===e.nextRenderedWidget.columnIndex?e.nextRenderedWidget:t)&&((t=new Sai).sectionFormat=e.sectionFormat,t.index=e.index,t.page=e.page,t.y=e.y,e.containerWidget instanceof Pai?(e.containerWidget.bodyWidgets.splice(e.containerWidget.bodyWidgets.indexOf(e)+1,0,t),t.containerWidget=e.containerWidget):e.page.bodyWidgets.splice(e.page.bodyWidgets.indexOf(e)+1,0,t)),t},psi.prototype.moveToNextColumnByBodyWidget=function(e,t){e=e.containerWidget;return this.createOrGetNextColumnBody(e)},psi.prototype.reLayoutLine=function(e,t,i,n,o){this.documentHelper.owner.editorModule.isFootnoteElementRemoved||(this.isFootnoteContentChanged=!1),this.viewer.owner.isDocumentLoaded&&this.viewer.owner.editorModule&&!o&&this.viewer.owner.editorModule.updateWholeListItems(e),o=e.paragraphFormat.listFormat&&-1!==e.paragraphFormat.listFormat.listId?e.getSplitWidgets()[0].firstChild:e.childWidgets[t],je(r=e.containerWidget instanceof Sai&&1<e.containerWidget.sectionFormat.numberOfColumns&&e.containerWidget.sectionFormat.equalWidth?o.previousLine:r)&&(r=o),this.allowLayout&&(r.paragraph.splitTextRangeByScriptType(r.indexInOwner),r.paragraph.splitLtrAndRtlText(r.indexInOwner),r.paragraph.combineconsecutiveRTL(r.indexInOwner));var r,t=e.containerWidget,o=(t.height-=e.height,!this.viewer.owner.enableHeaderAndFooter&&!e.isInHeaderFooter||t instanceof Zli?t instanceof Zli?this.viewer.updateClientAreaForTextBoxShape(t.containerShape,!0):this.viewer.updateClientArea(t,t.page,!0):(e.bodyWidget.isEmpty=!1,this.viewer.updateHeaderFooterClientAreaWithTop(e.bodyWidget.sectionFormat,this.documentHelper.isBlockInHeader(e),t.page)),this.viewer.updateClientAreaForBlock(e,!0),0);if(e.containerWidget instanceof Sai&&(o=(l=e.getSplitWidgets())[l.length-1].containerWidget.page.index),!je(e.containerWidget)&&!je(e.containerWidget.containerWidget)&&e.containerWidget.containerWidget instanceof Pai)a=e.bodyWidget.containerWidget.y,this.viewer.cutFromTop(a),this.documentHelper.owner.editorModule.isFootNoteInsert=!0,this.layoutfootNote(e.containerWidget.containerWidget),this.documentHelper.owner.editorModule.isFootNoteInsert=!1;else{if(r.paragraph.isEmptyInternal(!0)&&je(r.paragraph.nextSplitWidget))this.viewer.cutFromTop(e.y),this.layoutParagraph(e,0);else{for(this.updateClientAreaForLine(r),this.layoutListItems(r.paragraph),r.isFirstLine()&&!je(e.paragraphFormat)&&(t=-Y.convertPointToPixel(e.paragraphFormat.firstLineIndent),this.viewer.updateClientWidth(t));e=(r=this.layoutLine(r,0)).paragraph,r=r.nextLine;);this.updateWidgetToPage(this.viewer,e)}this.viewer.updateClientAreaForBlock(e,!1);var s,a,t=0,l=(e.containerWidget instanceof Sai&&(t=(l=e.getSplitWidgets())[l.length-1].containerWidget.page.index),this.layoutNextItemsBlock(e,this.viewer,void 0,o!==t),e.getSplitWidgets()[0].previousRenderedWidget),l=(je(l)||e.isEndsWithPageBreak||e.isEndsWithColumnBreak||l instanceof Lai&&(!(l instanceof Lai)||l.isEndsWithPageBreak||l.isEndsWithColumnBreak)||(this.viewer.cutFromTop(e.y+e.height),e.containerWidget===l.containerWidget)||je(l.containerWidget)||(o=e.containerWidget,t=l.containerWidget,l=this.getFootNoteWidgetsOf(e),je(t.page.footnoteWidget))||this.moveFootNotesToPage(l,t,o),this.documentHelper.pages.length),t=this.documentHelper.pages[l-1],o=t.bodyWidgets[t.bodyWidgets.length-1];!this.documentHelper.owner.editorModule.isFootnoteElementRemoved&&!this.isFootnoteContentChanged||je(e.bodyWidget.page.footnoteWidget)||(s=e.bodyWidget.page.footnoteWidget,this.layoutfootNote(s)),je(this.viewer.owner.editorHistoryModule)||!this.viewer.owner.editorHistoryModule.isRedoing||je(o.page.endnoteWidget)||(this.isEndnoteContentChanged=!0),!this.documentHelper.owner.editorModule.isEndnoteElementRemoved&&!this.isEndnoteContentChanged||je(o.page.endnoteWidget)||(s=o.page.endnoteWidget,l=this.viewer.clientArea.clone(),t=this.viewer.clientActiveArea.clone(),a=o.y,0<o.childWidgets.length&&(a=(o=o.childWidgets[o.childWidgets.length-1]).y+o.height),this.viewer.clientActiveArea.height=this.viewer.clientActiveArea.bottom-a,this.viewer.clientActiveArea.x=this.viewer.clientArea.x,this.viewer.clientActiveArea.width=this.viewer.clientArea.width,this.viewer.clientActiveArea.y=a,this.layoutfootNote(s),this.viewer.clientArea=l,this.viewer.clientActiveArea=t),!je(this.viewer.owner.editorHistoryModule)&&this.viewer.owner.editorHistoryModule.isRedoing&&(this.isEndnoteContentChanged=!1)}},psi.prototype.isContainsRtl=function(e){if(this.viewer.documentHelper.isSelectionChangedOnMouseMoved&&!this.isDocumentContainsRtl)return!1;for(var t=!1,i=0;i<e.children.length;i++)if(e.children[i]instanceof pli&&(t=e.children[i].characterFormat.bidi||"RTL"===e.children[i].characterFormat.bdo||this.documentHelper.textHelper.isRTLText(e.children[i].text))){this.isDocumentContainsRtl||(this.isDocumentContainsRtl=t);break}return t},psi.prototype.shiftElementsForRTLLayouting=function(e,t){var i=this.hasTextRangeBidi(e);if(this.isContainsRTLText(e)||t||i){for(var n=[],o=[],r=0;r<e.children.length;r++){var s,a,l,h=e.children[r];h instanceof pli&&0<h.height&&!h.isPageBreak&&"\v"!==h.text?(o.push((l=h).characterFormat.bidi),"\t"==l.text?n.push(aJt.Tab):n.push(l.characterRange),h.isRightToLeft=n[n.length-1]==aJt.RightToLeft):h instanceof Khi||h instanceof Dli||h instanceof ghi||h instanceof phi||h instanceof Pli||h instanceof Zai?(a=this.isStartMarker(h),s=this.isEndMarker(h),a&&r<e.children.length-1?!je(a=this.getNextValidWidget(r+1,e))&&a instanceof pli&&0<a.height?(o.push((l=a).characterFormat.bidi),"\t"===a.text?n.push(aJt.Tab):n.push(l.characterRange)):(o.push(!1),n.push(aJt.LeftToRight)):!s&&0<r?(o.push(o[o.length-1]),n.push(n[n.length-1])):(o.push(!1),n.push(aJt.LeftToRight))):h instanceof lhi&&t?(o.push(t),n.push(aJt.RightToLeft)):(o.push(!1),n.push(aJt.LeftToRight))}for(var d=-1,p=void 0,r=0;r<n.length;r++)if(r+1<o.length&&o[r]!=o[r+1])-1!=d&&(this.updateCharacterRange(e,r,d,o,n),d=-1),p=null;else{if(0<r&&r!=n.length-1&&n[r]==aJt.WordSplit&&o[r]&&n[r-1]==aJt.Number&&o[r-1]&&n[r+1]==aJt.Number&&o[r+1]&&this.isNumberNonReversingCharacter(e.children[r]))n[r]=aJt.Number;else if(n[r]==aJt.RightToLeft||n[r]==aJt.LeftToRight||n[r]==aJt.Number&&-1!=d||(je(p)||!p)&&o[r])if(-1==d&&n[r]!=aJt.LeftToRight)d=r;else{if(-1==d){n[r]==aJt.LeftToRight?p=!0:n[r]==aJt.RightToLeft&&(p=!1);continue}n[r]==aJt.LeftToRight&&(this.updateCharacterRange(e,r,d,o,n),d=n[r]==aJt.RightToLeft||n[r]==aJt.Number&&-1!=d?r:-1)}n[r]==aJt.LeftToRight?p=!0:n[r]==aJt.RightToLeft&&(p=!1)}if(-1!=d&&d<n.length-1&&(this.updateCharacterRange(e,n.length-1,d,o,n),d=-1),n.length!=e.children.length)throw new Error("Splitted Widget count mismatch while reordering layouted child widgets of a line");i=this.reorderElements(e,n,o,t);(n.length=o.length=0)<e.children.length&&(e.layoutedElements=i)}return t},psi.prototype.isNumberNonReversingCharacter=function(e){if(e instanceof pli){if(!e.characterFormat.hasValueWithParent("localeIdBidi"))return lsi.isNumberNonReversingCharacter(e.text,e.characterFormat.bidi);var t=e.text.charCodeAt(0);if(47==t&&!this.isNumberReverseLangForSlash(e.characterFormat.localeIdBidi)||(35==t||36==t||37==t||43==t||45==t)&&!this.isNumberReverseLangForOthers(e.characterFormat.localeIdBidi)||44==t||46==t||58==t||1548==t)return!0}return!1},psi.prototype.isNumberReverseLangForSlash=function(e){return this.isNumberReverseLangForOthers(e)||6145==e||1164==e||1125==e||1120==e||1123==e||1065==e||2137==e||1114==e||1119==e||1152==e||1056==e},psi.prototype.isNumberReverseLangForOthers=function(e){return 14337==e||15361==e||5121==e||3073==e||2049==e||11265==e||13313==e||12289==e||4097==e||8193==e||16385==e||1025==e||10241==e||7169==e||9217==e},psi.prototype.isStartMarker=function(e){return e instanceof Khi?0===e.commentType:e instanceof Dli?0===e.bookmarkType:e instanceof ghi||(e instanceof Pli?0===e.type:e instanceof Zai&&0===e.fieldType)},psi.prototype.isEndMarker=function(e){return e instanceof Khi?1===e.commentType:e instanceof Dli?1===e.bookmarkType:e instanceof ghi||(e instanceof Pli?1===e.type:e instanceof Zai&&1===e.fieldType)},psi.prototype.getNextValidWidget=function(e,t){for(var i=e;i<t.children.length;i++){var n=t.children[i];if(!(n instanceof Khi||n instanceof Dli||n instanceof ghi||n instanceof phi||n instanceof Pli||n instanceof Zai))return n[i]}return null},psi.prototype.hasTextRangeBidi=function(e){for(var t=0;t<e.children.length;t++){var i=e.children[t];if(i instanceof pli)if(i.characterFormat.bidi)return!0}return!1},psi.prototype.isContainsRTLText=function(e){for(var t=e.paragraph.bodyWidget.page.documentHelper.textHelper,i=!1,n=0;n<e.children.length&&!(e.children[n]instanceof pli&&(i=e.children[n].characterFormat.bidi||1==e.children[n].characterFormat.bidi||t.isRTLText(e.children[n].text)));n++);return i},psi.prototype.updateCharacterRange=function(e,t,i,n,o){var r=t;if(!n[t]){o[t]===aJt.LeftToRight&&r--;for(var s=r;i<=s;s--)if(o[s]!=aJt.WordSplit){r=s;break}}for(var a,l,s=i;s<=r;s++)o[s]==aJt.WordSplit&&(o[s]=aJt.RightToLeft|aJt.WordSplit,l=s+1,0<=(a=s-1))&&l<o.length&&o[a]==aJt.RightToLeft&&(o[l]==aJt.RightToLeft||o[l]==aJt.Number)&&e.children[s]instanceof pli&&"Times New Roman"==(a=e.children[s]).characterFormat.fontFamilyBidi&&(l=a.text.split("").reverse().join(""),a.text=l)},psi.prototype.reorderElements=function(e,t,i,n){for(var o=0,r=-1,s=0,a=0,l=[],h=aJt.LeftToRight,d=!1,p=0;p<e.children.length;p++){var c=e.children[p],u=c,g=(u.characterRange=t[p],(u.characterRange&aJt.RightToLeft)==aJt.RightToLeft||u.characterRange==aJt.Number),m=i[p];if(t[p]==aJt.Tab){if(n){h=aJt.LeftToRight,d=!(r=-1),l.splice(o=0,s=0,c);continue}m=m&&!1}0<p&&d!=m&&(n?(r=-1,s=o=0):r=l.length-1,a=0),m||g?g||m&&u.characterRange==aJt.WordSplit&&(h==aJt.RightToLeft||this.isInsertWordSplitToLeft(t,i,p))?(s++,o=r+1,u.characterRange==aJt.Number&&(h==aJt.Number&&(o+=a),a++),l.splice(o,0,c)):(l.splice(o,0,c),o++,s=0):(n?(0<s&&d==m&&(o+=s),l.splice(o,0,c),o++):(l.push(c),o=p+1),s=0,r=n?o-1:l.length-1),u.characterRange!=aJt.Number&&(a=0),u.characterRange!=aJt.WordSplit&&(h=u.characterRange),d=m}return l},psi.prototype.isInsertWordSplitToLeft=function(e,t,i){for(var n=i+1;n<e.length;n++){if((e[n]&aJt.RightToLeft)==aJt.RightToLeft)return!0;if(e[n]==aJt.LeftToRight)return!t[n]}return!0},psi.prototype.shiftLayoutFloatingItems=function(e){for(var t=0;t<e.floatingElements.length;t++){var i=e.floatingElements[t],n=this.getFloatingItemPoints(i),o=n.y-i.y;if(i.x=n.x,i.y=n.y,i instanceof Xli)for(var r=0;r<i.textFrame.childWidgets.length;r++){var s=i.textFrame.childWidgets[r];s instanceof Lai?s.y=s.y+o:s instanceof _ai&&this.shiftChildLocationForTableWidget(s,o)}}},psi.prototype.getFloatingItemPoints=function(e){var t=e.line.paragraph,i=t.bodyWidget.sectionFormat,n=0,o=0;if(t){var r=Y.convertPointToPixel(i.leftMargin),s=Y.convertPointToPixel(i.rightMargin),a=Y.convertPointToPixel(i.topMargin),l=0<i.bottomMargin?Y.convertPointToPixel(i.bottomMargin):48,h=Y.convertPointToPixel(i.headerDistance),d=Y.convertPointToPixel(i.footerDistance),p=Y.convertPointToPixel(i.pageWidth),c=Y.convertPointToPixel(i.pageHeight),u=p-(r+s),g=c-a-l,a=t.isInHeaderFooter&&i.topMargin<=0?0<Math.abs(a)?Math.abs(a):Y.convertPointToPixel(i.headerDistance)+t.height:0<a?a:48,m=(!t.isInHeaderFooter&&a<this.viewer.clientArea.y&&(a=this.viewer.clientArea.y),"InFrontOfText"),f=!1,y=e.verticalOrigin,v=e.horizontalOrigin,b=e.horizontalAlignment,w=e.verticalAlignment,C=e.verticalRelativePercent,S=(e.horizontalRelativePercent,e.height),A=e.width,x=e.verticalPosition,I=e.horizontalPosition,T=e.layoutInCell,E=e.heightRelativePercent,D=e.widthRelativePercent,M=void 0;if(e instanceof Xli&&(M=e.autoShapeType),t.isInsideTable&&T)f=!0,o=this.getVerticalPosition(e,x,y,m),n=this.getHorizontalPosition(e.width,e,b,v,I,m,t.associatedCell.cellFormat.cellWidth);else if(this.documentHelper.viewer instanceof sai)o="Line"===y?this.documentHelper.selection.getTop(e.line):this.viewer.clientActiveArea.y,n="Character"===v?this.viewer.clientActiveArea.x:"Center"===b?this.viewer.clientArea.width/2-e.width/2:this.viewer.clientArea.x;else{switch(y){case"Page":case"TopMargin":switch(o=x,w){case"Top":o=x;break;case"Center":"TopMargin"===y?o=(a-S)/2:0<E&&0<D?(o=(c-c*(E/100))/2,e.height=c*(E/100)):o=(c-S)/2;break;case"Outside":case"Bottom":o="Page"===y&&"Bottom"===w?c-S:"TopMargin"===y?a-S:(t.bodyWidget.page.index+1)%2!=0?c-S-d/2:h/2;break;case"Inside":"Page"===y?o=(t.bodyWidget.page.index+1)%2==0?c-S-d/2:h/2:(t.bodyWidget.page.index+1)%2==0&&(o=(a-S)/2-h);break;case"None":o=Math.abs(C)<=1e3?c*(C/100):x}break;case"Line":switch(o=x,w){case"Inside":case"Top":o=this.viewer.clientActiveArea.y;break;case"Center":o=this.viewer.clientActiveArea.y-S/2;break;case"Outside":case"Bottom":o=this.viewer.clientActiveArea.y-S;break;case"None":o=Math.round(t.y)+x}break;case"BottomMargin":switch(o=x,w){case"Inside":case"Top":o=c-l;break;case"Center":o=c-l+(l-S)/2;break;case"Outside":case"Bottom":o=t.bodyWidget.page.index+1!==0&&"Outside"===w?c-l:c-S;break;case"None":o=c-l+x}break;case"InsideMargin":case"OutsideMargin":switch(o=x,w){case"Inside":o="InsideMargin"===y?t.bodyWidget.page.index+1===0?c-S:0:(t.bodyWidget.page.index+1)%2!=0?c-l:a-S;break;case"Top":o="InsideMargin"===y?(t.bodyWidget.page.index+1)%2==0?c-l:0:(t.bodyWidget.page.index+1)%2!=0?c-l:0;break;case"Center":o="OutsideMargin"===y?(t.bodyWidget.page.index+1)%2!=0?c-l+(l-S)/2:(a-S)/2:(t.bodyWidget.page.index+1)%2==0?c-l+(l-S)/2:(a-S)/2;break;case"Outside":o="InsideMargin"===y?(t.bodyWidget.page.index+1)%2==0?c-l:a-S:(t.bodyWidget.page.index+1)%2!=0?a-S:c-l;break;case"Bottom":o="OutsideMargin"===y?t.bodyWidget.page.index+1!==0?c-S:a-S:(t.bodyWidget.page.index+1)%2==0?c-S:a-S}break;case"Paragraph":o=Math.round(t.y)+0+x;break;case"Margin":switch(o=t.isInHeaderFooter&&a<h?h+t.height+x:a+x,w){case"Top":o=a;break;case"Center":o=a+(g-S)/2;break;case"Outside":case"Bottom":o=(t.bodyWidget.page.index+1)%2!=0?a+g-S:a;break;case"Inside":o=(t.bodyWidget.page.index+1)%2==0?a+g-S:a}break;default:o=this.viewer.clientArea.y-x}switch(v){case"Page":switch(n=I,b){case"Center":f?n=(t.associatedCell.cellFormat.cellWidth-A)/2:0<E&&0<D?(n=(p-p*(D/100))/2,e.width=p*(D/100)):n=(p-A)/2;break;case"Left":n=0;break;case"Outside":case"Right":n=f?t.associatedCell.cellFormat.cellWidth-A:p-A;break;case"None":n=f?t.associatedCell.x+I:(0 instanceof Xli,I)}n<0&&f&&(n=t.associatedCell.x);break;case"Column":var k=!1,n=!(this.viewer.clientActiveArea.x<t.x)&&!e.paragraph.isInsideTable&&("StraightConnector"===M||"Rectangle"===M||e instanceof rhi)?(k=!0,I+t.bodyWidget.x):t.x+I;switch(t.paragraphFormat.leftIndent&&!k&&(n-=Y.convertPointToPixel(t.leftIndent)),b){case"Center":n=this.viewer.clientActiveArea.x+(this.viewer.clientActiveArea.width-A)/2;break;case"Left":n=this.viewer.clientActiveArea.x;break;case"Right":n=this.viewer.clientActiveArea.x+this.viewer.clientActiveArea.width-A}break;case"Margin":if(t.bodyWidget)switch(n=r+I,b){case"Center":n=r+(u-A)/2;break;case"Left":n=r;break;case"Outside":(t.bodyWidget.page.index+1)%2!=0&&(n=r+u-A);break;case"Right":n=r+u-A;break;case"Inside":(t.bodyWidget.page.index+1)%2==0&&(n=r+u-A)}else n=this.viewer.clientArea.x+I;break;case"Character":n="Right"===b||"Center"===b?this.getLeftMarginHorizPosition(r,b,I,A,m):this.viewer.clientArea.x+I;break;case"LeftMargin":n=this.getLeftMarginHorizPosition(r,b,I,A,m);break;case"RightMargin":n=this.getRightMarginHorizPosition(p,s,b,I,A,m);break;case"InsideMargin":n=(t.bodyWidget.page.index+1)%2==0?this.getRightMarginHorizPosition(p,s,b,I,A,m):this.getLeftMarginHorizPosition(r,b,I,A,m);break;case"OutsideMargin":n=(t.bodyWidget.page.index+1)%2==0?this.getLeftMarginHorizPosition(r,b,I,A,m):this.getRightMarginHorizPosition(p,s,b,I,A,m);break;default:n=this.viewer.clientArea.x+I}}!t||"Paragraph"!==y&&"Line"!==y||"InFrontOfText"===e.textWrappingStyle||"Behind"===e.textWrappingStyle||"Word2013"!==this.documentHelper.compatibilityMode||t.isInHeaderFooter||(o=o+e.height>this.viewer.clientArea.bottom?this.viewer.clientArea.bottom-e.height:o)<i.topMargin&&(o=i.topMargin)}return new kri(n,o)},psi.prototype.getLeftMarginHorizPosition=function(e,t,i,n,o){var r=i;switch(t){case"Center":r=(e-n)/2;break;case"Left":r=0;break;case"Right":r=e-n}return r=r<0&&"InFrontOfText"!==o&&"Behind"!==o?0:r},psi.prototype.getRightMarginHorizPosition=function(e,t,i,n,o,r){var s=e-t,a=s+n;switch(i){case"Center":a=s+(t-o)/2;break;case"Left":a=s;break;case"Right":a=e-o}return a=(a<0||e<a+o)&&"InFrontOfText"!==r&&"Behind"!==r?e-o:a},psi.prototype.getVerticalPosition=function(e,t,i,n){var o=e.line.paragraph,r=e,s=0,a=o.associatedCell.y;switch(i){case"Page":case"Margin":case"TopMargin":case"InsideMargin":case"BottomMargin":case"OutsideMargin":s=a+t;break;case"Line":case"Paragraph":s=o.y+t+0;"Square"==r.textWrappingStyle&&(s=s<=o.associatedCell.y?o.associatedCell.y:s);break;default:s=this.viewer.clientActiveArea.y+t}return s},psi.prototype.getHorizontalPosition=function(e,t,i,n,o,r,s){var a=0,t=t.line.paragraph.associatedCell,l=s-t.leftMargin-t.rightMargin,h=t.cellFormat.cellWidth,d=t.x,p=d-t.leftMargin;switch(n){case"Page":switch(a=o,i){case"Center":a=p+(l-e)/2;break;case"Left":a=p;break;case"Right":a=l-e+p;break;case"None":a=p+o}break;case"Column":case"Margin":switch(i){case"Center":a=d+(h-e)/2;break;case"Left":a=d;break;case"Right":a=d+(h-e);break;case"None":a=d+o}break;default:a=d+o}return a},psi.prototype.updateTableFloatPoints=function(e){var t,i,n,o,r;e.wrapTextAround&&(t=e.getTableCellWidth(),i=e.positioning,n=e.bodyWidget.sectionFormat,this.documentHelper.viewer instanceof sai?"Margin"!==i.horizontalOrigin&&"Page"!==i.horizontalOrigin&&"Column"!==i.horizontalOrigin||("Right"===i.horizontalAlignment||"Outside"===i.horizontalAlignment?this.viewer.clientActiveArea.x=this.viewer.clientArea.width-t:this.viewer.clientActiveArea.x=this.viewer.clientArea.x):e.containerWidget instanceof Zli||e.isInsideTable?e.isInsideTable&&(r=(o=e.containerWidget).cellFormat,"Page"===i.verticalOrigin?(this.viewer.clientActiveArea.y=o.y,this.viewer.clientActiveArea.y+=Y.convertPointToPixel(i.verticalPosition)):"Margin"===i.verticalOrigin?(this.viewer.clientActiveArea.y+=Y.convertPointToPixel(i.verticalPosition),(this.viewer.clientActiveArea.y<o.y||"Top"===i.verticalAlignment)&&(this.viewer.clientActiveArea.y=o.y)):this.viewer.clientActiveArea.y+Y.convertPointToPixel(i.verticalPosition)<o.y?this.viewer.clientActiveArea.y=o.y:this.viewer.clientActiveArea.y+=Y.convertPointToPixel(i.verticalPosition),"Page"===i.horizontalOrigin?"Left"===i.horizontalAlignment||"Inside"===i.horizontalAlignment?this.viewer.clientActiveArea.x=o.x:"Right"!==i.horizontalAlignment&&"Outside"!==i.horizontalAlignment||(this.viewer.clientActiveArea.x=o.x+r.preferredWidth-t):"Margin"!==i.horizontalOrigin&&"Column"!==i.horizontalOrigin||("Left"===i.horizontalAlignment||"Inside"===i.horizontalAlignment?this.viewer.clientActiveArea.x=o.x+o.leftMargin:"Right"!==i.horizontalAlignment&&"Outside"!==i.horizontalAlignment||(this.viewer.clientActiveArea.x=o.x+r.preferredWidth-(t+o.rightMargin))),0<Math.round(i.horizontalPosition)&&(this.viewer.clientActiveArea.x=o.x,"Margin"===i.horizontalOrigin&&(this.viewer.clientActiveArea.x+=o.leftMargin),this.viewer.clientActiveArea.x+=Y.convertPointToPixel(i.horizontalPosition)),"Center"===i.horizontalAlignment)&&(this.viewer.clientActiveArea.x=r.preferredWidth/2-t/2):("Page"===i.verticalOrigin?"Top"===i.verticalAlignment||"Inside"===i.verticalAlignment?this.viewer.clientActiveArea.y=0:!je(i.verticalAlignment)&&"None"!==i.verticalAlignment||(this.viewer.clientActiveArea.y=Y.convertPointToPixel(i.verticalPosition)):"Margin"===i.verticalOrigin?"Top"===i.verticalAlignment||"Inside"===i.verticalAlignment?this.viewer.clientActiveArea.y=Y.convertPointToPixel(n.topMargin):0==Math.round(i.verticalPosition)||je(n.topMargin)?this.viewer.clientActiveArea.y=Y.convertPointToPixel(i.verticalPosition):this.viewer.clientActiveArea.y=Y.convertPointToPixel(n.topMargin+i.verticalPosition):"Paragraph"!==i.verticalOrigin||!je(i.verticalAlignment)&&"None"!==i.verticalAlignment||(this.viewer.clientActiveArea.y+=Y.convertPointToPixel(i.verticalPosition)),"Page"===i.horizontalOrigin?"Left"===i.horizontalAlignment||"Inside"===i.horizontalAlignment?this.viewer.clientActiveArea.x=0:"Right"===i.horizontalAlignment||"Outside"===i.horizontalAlignment?this.viewer.clientActiveArea.x=Y.convertPointToPixel(n.pageWidth)-t:"Center"===i.horizontalAlignment&&(this.viewer.clientActiveArea.x=(Y.convertPointToPixel(n.pageWidth)-t)/2):"Margin"!==i.horizontalOrigin&&"Column"!==i.horizontalOrigin||("Left"===i.horizontalAlignment?(this.viewer.clientActiveArea.x=Y.convertPointToPixel(n.leftMargin),"Word2013"===this.documentHelper.compatibilityMode||e.isInsideTable||(this.viewer.clientActiveArea.x=this.viewer.clientActiveArea.x-Y.convertPointToPixel(e.firstChild.firstChild.leftMargin))):"Inside"===i.horizontalAlignment?this.viewer.clientActiveArea.x=Y.convertPointToPixel(n.leftMargin):"Right"===i.horizontalAlignment||"Outside"===i.horizontalAlignment?this.viewer.clientActiveArea.x=Y.convertPointToPixel(n.pageWidth)-(Y.convertPointToPixel(n.rightMargin)+t):"Center"===i.horizontalAlignment&&(this.viewer.clientActiveArea.x=Y.convertPointToPixel(n.leftMargin)+(Y.convertPointToPixel(n.pageWidth-n.rightMargin-n.leftMargin)-t)/2)),(0<Math.round(i.horizontalPosition)||"Margin"===i.horizontalOrigin&&"Left"===i.horizontalAlignment)&&(this.viewer.clientActiveArea.x+=Y.convertPointToPixel(i.horizontalPosition)))),e.x=this.viewer.clientActiveArea.x,e.y=this.viewer.clientActiveArea.y},psi.prototype.isTocField=function(e){if(e instanceof Zai){var t=e.nextNode;if(e instanceof Zai&&0===e.fieldType&&t instanceof pli&&-1!==t.text.trim().toLowerCase().indexOf("toc"))return!0}return!1},psi.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},psi.prototype.getMaximumRightCellBorderWidth=function(e){for(var t=0,i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i],n=n.childWidgets[n.childWidgets.length-1].cellFormat.borders.right.lineWidth;t<n&&(t=n)}return t},psi.prototype.getDefaultBorderSpacingValue=function(e,t,i){return 0==e?(e="Word2013"!=this.documentHelper.compatibilityMode&&"Center"==i?1.5:.75,!0):t},psi.prototype.getMinimumWidthRequiredForTable=function(e,t,i){var n=0,n="Word2013"==this.documentHelper.compatibilityMode?"Center"==t?e?18.5+Math.round(.375):18.5+Math.round(i/2):e?19.25:18.5+i:"Center"==t?e?19.25:18.5+i/2:.25==i?18.5:19.3;return Y.convertPointToPixel(n)},psi.prototype.shiftFloatingItemsFromTable=function(e,t){if(e.containerWidget instanceof Sai)for(var i=0;i<e.containerWidget.floatingElements.length;i++){var n=e.containerWidget.floatingElements[i];!(n instanceof _ai)&&n.paragraph.containerWidget instanceof Uai&&n.paragraph.containerWidget.ownerTable.containerWidget.ownerTable==e&&(t.floatingElements.push(e.containerWidget.floatingElements[i]),e.containerWidget.floatingElements.splice(e.containerWidget.floatingElements.indexOf(e.containerWidget.floatingElements[i]),1),this.shiftedFloatingItemsFromTable.push(n),i--)}};var dsi=psi;function psi(e){this.islayoutFootnote=!1,this.isMultiColumnDoc=!1,this.allowLayout=!0,this.isReplaceAll=!1,this.isTextFormat=!1,this.isSectionBreakCont=!1,this.isReplacingAll=!1,this.footHeight=0,this.existFootnoteHeight=0,this.isfootMove=!1,this.footnoteHeight=0,this.isTableFootNote=!1,this.isRelayout=!1,this.isRelayoutneed=!1,this.isOverlapFloatTable=!1,this.isInitialLoad=!0,this.isInsertFormField=!1,this.fieldBegin=void 0,this.maxTextHeight=0,this.maxBaseline=0,this.maxTextBaseline=0,this.isFieldCode=!1,this.isRtlFieldCode=!1,this.isRTLLayout=!1,this.isSkipFirstLineIndent=!1,this.currentCell=void 0,this.isFootnoteContentChanged=!1,this.isEndnoteContentChanged=!1,this.keepWithNext=!1,this.is2013Justification=!1,this.nextElementToLayout=void 0,this.endNoteHeight=0,this.isMultiColumnSplit=!1,this.isMultiColumnLayout=!1,this.skipUpdateContainerWidget=!1,this.isIFfield=!1,this.isLayoutWhole=!1,this.isBidiReLayout=!1,this.defaultTabWidthPixel=48,this.isRelayoutFootnote=!1,this.isRelayoutOverlap=!1,this.skipRelayoutOverlap=!1,this.isWrapText=!1,this.isYPositionUpdated=!1,this.isXPositionUpdated=!1,this.hasFloatingElement=!1,this.isFootNoteLayoutStart=!1,this.wrapPosition=[],this.shiftedFloatingItemsFromTable=[],this.isDocumentContainsRtl=!1,this.isPastingContent=!1,this.layoutedFootnoteElement=[],this.isAllColumnHasAutoWidthType=!1,this.documentHelper=e}usi.prototype.getContext=function(e,t){return this.context},usi.prototype.toDataURL=function(e,t){return this.context.renderedPath};var csi=usi;function usi(){this.style={},this.context=new gsi}Object.defineProperty(msi.prototype,"globalAlpha",{set:function(e){this.renderedPath+="GA:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(msi.prototype,"globalCompositeOperation",{set:function(e){this.renderedPath+="GCP:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(msi.prototype,"fillStyle",{set:function(e){this.renderedPath+="FS:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(msi.prototype,"strokeStyle",{set:function(e){this.renderedPath+="SS:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(msi.prototype,"direction",{set:function(e){this.renderedPath+="Dir:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(msi.prototype,"font",{set:function(e){this.renderedPath+="Fn:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(msi.prototype,"textAlign",{set:function(e){this.renderedPath+="TA:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(msi.prototype,"textBaseline",{set:function(e){this.renderedPath+="TBL:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(msi.prototype,"lineWidth",{set:function(e){this.renderedPath+="LW:"+e+";"},enumerable:!0,configurable:!0}),Object.defineProperty(msi.prototype,"lineCap",{set:function(e){this.renderedPath+="LC:"+e+";"},enumerable:!0,configurable:!0}),msi.prototype.drawImage=function(e,t,i,n,o,r,s,a,l){this.renderedPath+="LC:"+e.src+";",this.renderedPath+="sx:"+t+";",this.renderedPath+="sy:"+i+";",this.renderedPath+="sw:"+n+";",this.renderedPath+="sh:"+o+";",r&&(this.renderedPath+="dx:"+r+";"),s&&(this.renderedPath+="dy:"+s+";"),a&&(this.renderedPath+="dw:"+a+";"),l&&(this.renderedPath+="dh:"+l+";")},msi.prototype.beginPath=function(){this.renderedPath+="BP;"},msi.prototype.clip=function(e){this.renderedPath+="Cl;"},msi.prototype.fill=function(e){this.renderedPath+="Fl;"},msi.prototype.stroke=function(){this.renderedPath+="Stk;"},msi.prototype.closePath=function(){this.renderedPath+="CP;"},msi.prototype.lineTo=function(e,t){this.renderedPath+="LT:x:"+e+";y:"+t+";"},msi.prototype.moveTo=function(e,t){this.renderedPath+="MT:x:"+e+";y:"+t+";"},msi.prototype.rect=function(e,t,i,n){this.renderedPath+="Rt:x:"+e+";y:"+t+";w:"+i+";h:"+n+";"},msi.prototype.setLineDash=function(e){this.renderedPath+="Sgm:"+e.toString()+";"},msi.prototype.clearRect=function(e,t,i,n){this.renderedPath+="CR:x:"+e+";y:"+t+";w:"+i+";h:"+n+";"},msi.prototype.fillRect=function(e,t,i,n){this.renderedPath+="FR:x:"+e+";y:"+t+";w:"+i+";h:"+n+";"},msi.prototype.strokeRect=function(e,t,i,n){this.renderedPath+="SR:x:"+e+";y:"+t+";w:"+i+";h:"+n+";"},msi.prototype.restore=function(){this.renderedPath+="RES;"},msi.prototype.save=function(){this.renderedPath+="S;"},msi.prototype.fillText=function(e,t,i,n){this.renderedPath+="FT:"+e+";x:"+t+";y:"+i+";",n&&(this.renderedPath+="MW:"+n+";")},msi.prototype.measureText=function(e){return{width:30}},msi.prototype.strokeText=function(e,t,i,n){this.renderedPath+="ST:"+e+";x:"+t+";y:"+i+";",n&&(this.renderedPath+="MW:"+n+";")},msi.prototype.scale=function(e,t){this.renderedPath+="SC:x:"+e+";y:"+t+";"};var gsi=msi;function msi(){this.renderedPath=""}function fsi(e){var t,i=[],n=function(e){var t=/([a-z]+)|([+-]?(?:\d+\.?\d*|\.\d+))/gi,i=[],n=[],o={},r=(t.lastIndex=0,!1);o=t.exec(e);for(;o;)r="e"===o[1]||(o[1]?i="zm"===o[1].toLowerCase()?(i.length&&n.push(i),n.push(["Z"]),[o[1].substring(1,2)]):(i.length&&n.push(i),[o[1]]):(i.length||(i=[]),r||i.push(Number(o[2]))),!1),o=t.exec(e);i.length&&n.push(i);return n}(e);if(0<n.length)for(var o=0;o<n.length;o++){var r=n[parseInt(o.toString(),10)],s="";switch((s=r[0]).toLowerCase()){case"m":for(t=1;t<r.length;t++)i.push({command:s,x:r[parseInt(t.toString(),10)],y:r[t+1]}),t+=1,"m"===s?s="l":"M"===s&&(s="L");break;case"l":case"t":for(t=1;t<r.length;t++)i.push({command:s,x:r[parseInt(t.toString(),10)],y:r[t+1]}),t+=1;break;case"h":for(t=1;t<r.length;t++)i.push({command:s,x:r[parseInt(t.toString(),10)]});break;case"v":for(t=1;t<r.length;t++)i.push({command:s,y:r[parseInt(t.toString(),10)]});break;case"z":i.push({command:s});break;case"c":for(t=1;t<r.length;t++)i.push({command:s,x1:r[parseInt(t.toString(),10)],y1:r[t+1],x2:r[t+2],y2:r[t+3],x:r[t+4],y:r[t+5]}),t+=5;break;case"s":for(t=1;t<r.length;t++)i.push({command:s,x2:r[parseInt(t.toString(),10)],y2:r[t+1],x:r[t+2],y:r[t+3]}),t+=3;break;case"q":for(t=1;t<r.length;t++)i.push({command:s,x1:r[parseInt(t.toString(),10)],y1:r[t+1],x:r[t+2],y:r[t+3]}),t+=3;break;case"a":for(t=1;t<r.length;t++)i.push({command:s,r1:r[parseInt(t.toString(),10)],r2:r[t+1],angle:r[t+2],largeArc:r[t+3],sweep:r[t+4],x:r[t+5],y:r[t+6]}),t+=6}}return i}function ysi(e){for(var t="",i=0;i<e.length;i++)t+=0===i?vsi(e[parseInt(i.toString(),10)]):" "+vsi(e[parseInt(i.toString(),10)]);return t}function vsi(e){var t="";switch(e.command){case"Z":case"z":t=e.command;break;case"M":case"m":case"L":case"l":t=e.command+" "+e.x+" "+e.y;break;case"C":case"c":t=e.command+" "+e.x1+" "+e.y1+" "+e.x2+" "+e.y2+" "+e.x+" "+e.y;break;case"Q":case"q":t=e.command+" "+e.x1+" "+e.y1+" "+e.x+" "+e.y;break;case"A":case"a":var i=e.command,n=e.angle,o=e.largeArc?"1":"0",r=e.sweep?"1":"0",t=i+" "+e.r1+" "+e.r2+" "+n+" "+o+" "+r+" "+e.x+" "+e.y;break;case"H":case"h":t=e.command+" "+e.x;break;case"V":case"v":t=e.command+" "+e.y;break;case"S":case"s":t=e.command+" "+e.x2+" "+e.y2+" "+e.x+" "+e.y;break;case"T":case"t":t=e.command+" "+e.x+" "+e.y}return t}function bsi(e,t,i,n,o,r,s,a){for(var l,h,d,p,c=0,u=0,g=0,m=e.length;g<m;++g){var f=e[g],y=f.command;"x"in f&&(c=f.x),"y"in f&&(u=f.y),"y1"in f&&(h=f.y1),"y2"in f&&(p=f.y2),"x1"in f&&(l=f.x1),"x2"in f&&(d=f.x2),n?(void 0!==c&&(c=wsi(c,t,o,s)),void 0!==u&&(u=wsi(u,i,r,a)),void 0!==l&&(l=wsi(l,t,o,s)),void 0!==h&&(h=wsi(h,i,r,a)),void 0!==d&&(d=wsi(d,t,o,s)),void 0!==p&&(p=wsi(p,i,r,a))):(void 0!==c&&(c=Number((c+t).toFixed(2))),void 0!==u&&(u=Number((u+i).toFixed(2))),void 0!==l&&(l=Number((l+t).toFixed(2))),void 0!==h&&(h=Number((h+i).toFixed(2))),void 0!==d&&(d=Number((d+t).toFixed(2))),void 0!==p&&(p=Number((p+i).toFixed(2)))),(y=function(e,t,i,n,o,r){switch(t){case"M":case"L":e.x=i.x,e.y=i.y;break;case"H":e.x=i.x;break;case"V":e.y=i.y;break;case"C":e.x=i.x,e.y=i.y,e.x1=i.x1,e.y1=i.y1,e.x2=i.x2,e.y2=i.y2;break;case"S":e.x=i.x,e.y=i.y,e.x2=i.x2,e.y2=i.y2;break;case"Q":e.x=i.x,e.y=i.y,e.x1=i.x1,e.y1=i.y1;break;case"T":e.x=i.x,e.y=i.y;break;case"A":var s=i.r1,a=i.r2;n&&(i.r1=s*=o,i.r2=a*=r),e.x=i.x,e.y=i.y,e.r1=i.r1,e.r2=i.r2;break;case"z":case"Z":e={command:"Z"}}return e}(f,y,{x:c,y:u,x1:l,y1:h,x2:d,y2:p,r1:f.r1,r2:f.r2},n,t,i))&&(e[g]=y)}return ysi(e)}function wsi(e,t,i,n){return e!==i?e=n!==i?e*t-(Number(i)*t-Number(i))+(n-Number(i)):Number(e)*t-(Number(i)*t-Number(i)):n!==i&&(e=n),Number(e.toFixed(2))}Object.defineProperty(Ssi.prototype,"pageCanvas",{get:function(){return this.isPrinting?(je(this.pageCanvasIn)&&(this.pageCanvasIn=document.createElement("canvas"),this.pageCanvasIn.getContext("2d").save()),this.pageCanvasIn):this.isExporting?(je(this.exportPageCanvas)&&(this.exportPageCanvas=new csi),this.exportPageCanvas):je(this.viewer)?void 0:this.documentHelper.containerCanvas},enumerable:!0,configurable:!0}),Object.defineProperty(Ssi.prototype,"spellChecker",{get:function(){try{return this.documentHelper.owner.spellCheckerModule}catch(e){}},enumerable:!0,configurable:!0}),Object.defineProperty(Ssi.prototype,"selectionCanvas",{get:function(){return je(this.viewer)?void 0:this.documentHelper.selectionCanvas},enumerable:!0,configurable:!0}),Object.defineProperty(Ssi.prototype,"pageContext",{get:function(){return this.pageCanvas.getContext("2d")},enumerable:!0,configurable:!0}),Object.defineProperty(Ssi.prototype,"selectionContext",{get:function(){return this.selectionCanvas.getContext("2d")},enumerable:!0,configurable:!0}),Object.defineProperty(Ssi.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),Ssi.prototype.renderWidgets=function(e,t,i,n,o){if(!(je(this.pageCanvas)||je(e)||je(e.bodyWidgets))){var r;this.pageContext.fillStyle=Y.getColor(this.documentHelper.backgroundColor),this.pageContext.beginPath(),this.viewer instanceof sai?(o=o>this.documentHelper.visibleBounds.height?o:this.documentHelper.visibleBounds.height,r=i,0===e.index&&(r=i-this.viewer.padding.top),this.pageContext.fillRect(t-this.viewer.padding.left,r,n+this.viewer.padding.left,o+this.viewer.padding.top)):this.pageContext.fillRect(t,i,n,o),this.pageContext.closePath(),this.viewer instanceof nai&&(this.pageContext.strokeStyle=this.documentHelper.owner.pageOutline,this.pageContext.strokeRect(t,i,n,o)),this.pageLeft=t,this.pageTop=i,this.pageIndex=e.index,this.isPrinting?this.setPageSize(e):(this.pageContext.beginPath(),this.pageContext.save(),this.pageContext.rect(t,i,n,o),this.pageContext.clip()),this.height=o,e.headerWidget&&this.renderHFWidgets(e,e.headerWidgetIn,n,!0),e.footerWidget&&this.renderHFWidgets(e,e.footerWidgetIn,n,!1);for(var s=0;s<e.bodyWidgets.length;s++)this.render(e,e.bodyWidgets[parseInt(s.toString(),10)]),e.footnoteWidget&&"Pages"===this.documentHelper.owner.layoutType&&this.renderfootNoteWidget(e,e.footnoteWidget,n);e.endnoteWidget&&"Pages"===this.documentHelper.owner.layoutType&&this.renderfootNoteWidget(e,e.endnoteWidget,n),this.documentHelper.owner.enableHeaderAndFooter&&!this.isPrinting&&this.renderHeaderSeparator(e,this.pageLeft,this.pageTop,e.headerWidgetIn),this.pageLeft=0,this.pageTop=0,this.pageContext.restore()}},Ssi.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,e=e.boundingRectangle.height,i=Math.max(window.devicePixelRatio,this.documentHelper.owner.documentEditorSettings.printDevicePixelRatio);this.pageCanvas.width===t*i&&this.pageCanvas.height===e*i||(this.pageCanvas.height=e*i,this.pageCanvas.width=t*i,this.pageCanvas.style.height=e+"px",this.pageCanvas.style.width=t+"px",this.pageContext.globalAlpha=1,this.pageContext.scale(i,i)),this.pageContext.fillStyle="#FFFFFF",this.pageContext.fillRect(0,0,this.pageCanvas.width,this.pageCanvas.height),this.pageContext.fillStyle="#000000"},Ssi.prototype.renderHFWidgets=function(e,t,i,n){this.isFieldCode&&(this.isFieldCode=!1),this.isPrinting||(this.pageContext.globalAlpha=this.documentHelper.owner.enableHeaderAndFooter?1:.65);var o,r=!1,s=e.boundingRectangle.height/100*40;n?(o=Y.convertPointToPixel(e.bodyWidgets[0].sectionFormat.topMargin),s<Math.max(t.y+t.height,o)&&(r=!0,this.pageContext.beginPath(),this.pageContext.save(),this.pageContext.rect(this.pageLeft,this.pageTop,i,this.getScaledValue(s)),this.pageContext.clip())):(o=Y.convertPointToPixel(e.bodyWidgets[0].sectionFormat.footerDistance),i=void 0,je(e.footerWidgetIn.sectionFormat),i=e.boundingRectangle.height-Math.max(e.footerWidgetIn.height+o,Y.convertPointToPixel(e.footerWidgetIn.sectionFormat.bottomMargin)),Math.max(e.boundingRectangle.height-s,i),e.boundingRectangle.height),this.renderFloatingItems(e,t.floatingElements,"Behind");for(var a=0;a<t.childWidgets.length;a++){var l=t.childWidgets[parseInt(a.toString(),10)];n||l.height,this.renderWidget(e,l)}this.renderFloatingItems(e,t.floatingElements,"InFrontOfText"),r&&this.pageContext.restore(),this.isPrinting||(this.pageContext.globalAlpha=this.documentHelper.owner.enableHeaderAndFooter?.5:1)},Ssi.prototype.renderHeaderSeparator=function(e,t,i,n){var o,r,s,a,l,h=Y.convertPointToPixel(e.bodyWidgets[0].sectionFormat.topMargin),h=this.getScaledValue(Math.max(n.y+n.height,Math.abs(h))),d=this.getScaledValue(e.boundingRectangle.width),p=this.pageContext,c=(p.save(),p.globalAlpha=.85,this.getScaledValue(e.boundingRectangle.height)/100*40),h=Math.min(h,c),u=(this.renderDashLine(p,t,i+h,d,"#000000",!1),this.getHeaderFooterType(e,!0)),n=this.viewer.getHeaderFooter(n.headerFooterType),g=e.sectionIndex,m=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),f=(m.setLocale(this.documentHelper.owner.locale),1<this.documentHelper.headersFooters.length&&(o=g+1,u=u+" -"+m.getConstant("Section")+" "+o+"-"),p.font="9pt Arial",p.measureText(u).width);this.renderHeaderFooterMark(p,t+5,i+h,f+10,20),this.renderHeaderFooterMarkText(p,u,t+10,h+i+15),this.documentHelper.headersFooters[parseInt(g.toString(),10)]&&(r=this.documentHelper.headersFooters[parseInt(g.toString(),10)][parseInt(n.toString(),10)]),0===g||r||(a=m.getConstant("Same as Previous"),u=p.measureText(a).width,l=this.viewer.containerWidth-u-75+t,this.renderHeaderFooterMark(p,l,i+h,u+10,20),this.renderHeaderFooterMarkText(p,a,l+5,h+i+15)),e.footerWidget&&(n=Y.convertPointToPixel(e.bodyWidgets[0].sectionFormat.footerDistance),g=this.getScaledValue(e.boundingRectangle.height)-this.getScaledValue(Math.max(e.footerWidgetIn.height+n,Math.abs(Y.convertPointToPixel(e.footerWidgetIn.sectionFormat.bottomMargin)))),g=Math.max(this.getScaledValue(e.boundingRectangle.height)-c,g),this.renderDashLine(p,t,i+g,d,"#000000",!1),r=this.getHeaderFooterType(e,!1),u=e.sectionIndex,1<this.documentHelper.headersFooters.length&&(o=u+1,r=r+" -"+m.getConstant("Section")+" "+o+"-"),f=p.measureText(r).width,this.renderHeaderFooterMark(p,t+5,i+g-20,f+10,20),this.renderHeaderFooterMarkText(p,r,t+10,i+g-5),h=this.viewer.getHeaderFooter(e.footerWidget.headerFooterType),this.documentHelper.headersFooters[parseInt(u.toString(),10)]&&(s=this.documentHelper.headersFooters[parseInt(u.toString(),10)][parseInt(h.toString(),10)]),0===u||s||(a=m.getConstant("Same as Previous"),n=p.measureText(a).width,l=this.viewer.containerWidth-n-75+t,this.renderHeaderFooterMark(p,l,i+g-20,n+10,20),this.renderHeaderFooterMarkText(p,a,l+5,i+g-5)),p.restore())},Ssi.prototype.getFooterHeight=function(e){var t=e.boundingRectangle.height/100*40,i=Y.convertPointToPixel(e.bodyWidgets[0].sectionFormat.footerDistance),i=e.boundingRectangle.height-Math.max(e.footerWidgetIn.height+i,Y.convertPointToPixel(e.footerWidgetIn.sectionFormat.bottomMargin));return Math.max(e.boundingRectangle.height-t,i)},Ssi.prototype.getHeaderFooterType=function(e,t){var i,n=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);return n.setLocale(this.documentHelper.owner.locale),i=t?n.getConstant("Header"):n.getConstant("Footer"),e.bodyWidgets[0].sectionFormat.differentFirstPage&&(je(e.previousPage)||e.sectionIndex!==e.previousPage.sectionIndex)?i=t?n.getConstant("First Page Header"):n.getConstant("First Page Footer"):e.bodyWidgets[0].sectionFormat.differentOddAndEvenPages&&(i=(this.documentHelper.pages.indexOf(e)+1)%2==0?t?n.getConstant("Even Page Header"):n.getConstant("Even Page Footer"):t?n.getConstant("Odd Page Header"):n.getConstant("Odd Page Footer")),i},Ssi.prototype.renderDashLine=function(e,t,i,n,o,r){e.beginPath(),e.strokeStyle=o,e.lineWidth=1,r?e.setLineDash([3,2]):e.setLineDash([6,4]),e.moveTo(t,i),e.lineTo(t+n,i),e.stroke(),e.setLineDash([]),e.closePath()},Ssi.prototype.renderSolidLine=function(e,t,i,n,o){e.beginPath(),e.strokeStyle=o,e.lineWidth=.5,e.moveTo(t,i),e.lineTo(t+n,i),e.stroke(),e.closePath()},Ssi.prototype.renderHeaderFooterMark=function(e,t,i,n,o){e.beginPath(),e.fillStyle="lightgray",e.fillRect(t,i,n,o),e.strokeStyle="black",e.strokeRect(t,i,n,o),e.closePath()},Ssi.prototype.renderHeaderFooterMarkText=function(e,t,i,n){e.beginPath(),e.fillStyle="#000000",e.textBaseline="alphabetic",e.fillText(t,i,n),e.closePath()},Ssi.prototype.render=function(e,t){this.isFieldCode&&(this.isFieldCode=!1);for(var i=0;i<e.bodyWidgets.length;i++)je(e.bodyWidgets[i].floatingElements)||this.renderFloatingItems(e,e.bodyWidgets[i].floatingElements,"Behind");var n,o,r,s=!1;je(t.nextRenderedWidget)||t.columnIndex+1!==t.nextRenderedWidget.columnIndex||(n=t.nextRenderedWidget),this.viewer instanceof sai||!(1<t.sectionFormat.columns.length)||je(n)||(n=e.bodyWidgets.indexOf(t),r=o=void 0,r=0===t.columnIndex?(o=e.bodyWidgets[n].x-Y.convertPointToPixel(e.bodyWidgets[n].sectionFormat.leftMargin),Y.convertPointToPixel(e.bodyWidgets[n].sectionFormat.leftMargin)+t.sectionFormat.columns[t.columnIndex].width+t.sectionFormat.columns[t.columnIndex].space/2):n===t.sectionFormat.columns.length-1?(o=e.bodyWidgets[n].x-t.sectionFormat.columns[t.columnIndex-1].space/2,Y.convertPointToPixel(e.bodyWidgets[n].sectionFormat.rightMargin)+t.sectionFormat.columns[t.columnIndex].width+t.sectionFormat.columns[t.columnIndex-1].space/2):(o=e.bodyWidgets[n].x-t.sectionFormat.columns[t.columnIndex].space/2,t.sectionFormat.columns[t.columnIndex].width+t.sectionFormat.columns[t.columnIndex].space),this.clipRect(o,e.bodyWidgets[n].y,this.getScaledValue(r),this.getScaledValue(e.boundingRectangle.height)),s=!0);for(i=0;i<t.childWidgets.length;i++){var a=t.childWidgets[parseInt(i.toString(),10)];0===i&&t.childWidgets[0]instanceof _ai&&0<t.childWidgets[0].childWidgets.length&&e.repeatHeaderRowTableWidget&&this.renderHeader(e,a,this.documentHelper.layout.getHeader(t.childWidgets[0])),this.renderWidget(e,a)}s&&this.pageContext.restore();for(i=0;i<e.bodyWidgets.length;i++)je(e.bodyWidgets[i].floatingElements)||this.renderFloatingItems(e,e.bodyWidgets[i].floatingElements,"InFrontOfText");for(var l,h,d,p,i=0;i<e.bodyWidgets.length;i++)!0===e.bodyWidgets[parseInt(i.toString(),10)].sectionFormat.lineBetweenColumns&&0!==e.bodyWidgets[parseInt(i.toString(),10)].columnIndex&&1<e.bodyWidgets.length&&(h=Y.convertPointToPixel(e.bodyWidgets[0].sectionFormat.topMargin),h=this.getScaledValue(Math.max(e.headerWidgetIn.y+e.headerWidgetIn.height,h)),l=this.getScaledValue(e.boundingRectangle.height)/100*40,p=Y.convertPointToPixel(e.bodyWidgets[0].sectionFormat.footerDistance),p=this.getScaledValue(e.boundingRectangle.height)-this.getScaledValue(Math.max(e.footerWidgetIn.height+p,Y.convertPointToPixel(e.footerWidgetIn.sectionFormat.bottomMargin))),p=Math.max(this.getScaledValue(e.boundingRectangle.height)-l,p),l=(e.bodyWidgets[parseInt(i.toString(),10)].x-(e.bodyWidgets[parseInt(i.toString(),10)].previousRenderedWidget.x+e.bodyWidgets[parseInt(i.toString(),10)].previousRenderedWidget.width))/2+(e.bodyWidgets[parseInt(i.toString(),10)].previousRenderedWidget.x+e.bodyWidgets[parseInt(i.toString(),10)].previousRenderedWidget.width),p=h/this.documentHelper.zoomFactor,h=l,e.footnoteWidget?(e.footerWidgetIn.height,e.footnoteWidget.height,this.documentHelper.zoomFactor,this.documentHelper.zoomFactor):(e.footerWidgetIn.height,this.documentHelper.zoomFactor),d=this.documentHelper.layout.getBodyWidget(e.bodyWidgets[parseInt(i.toString(),10)],!0),d=this.documentHelper.layout.getNextWidgetHeight(d),p=e.bodyWidgets[parseInt(i.toString(),10)].y,this.renderSingleBorder("#000000",l,p,h,d,.5,"Single"))},Ssi.prototype.renderFloatingItems=function(e,t,i){if(!je(t)&&0<t.length){var n=new uJt;t.sort(function(e,t){return e instanceof _ai||t instanceof _ai?0:e.zOrderPosition-t.zOrderPosition});for(var o=0;o<t.length;o++)t[o]instanceof _ai||(r=t[o],"Behind"===i&&"Behind"!==r.textWrappingStyle)||"Behind"!==i&&"Behind"===r.textWrappingStyle||(!this.isOverLappedShapeWidget(r)||n.containsKey(r.zOrderPosition)?r instanceof rhi?this.renderImageElementBox(r,r.x,r.y,0):r instanceof Xli&&(s=this.getScaledValue(r.x,1),a=this.getScaledValue(r.y,2),this.renderShapeElementBox(r,s,a,e)):n.containsKey(r.zOrderPosition)||n.add(r.zOrderPosition,r));if(0<n.length)for(var r,s,a,l=n.keys.sort(),h=0;h<l.length;h++)(r=n.get(l[h]))instanceof rhi?this.renderImageElementBox(r,r.x,r.y,0):r instanceof Xli&&(s=this.getScaledValue(r.x,1),a=this.getScaledValue(r.y,2),this.renderShapeElementBox(r,s,a,e))}},Ssi.prototype.isOverLappedShapeWidget=function(e){return e instanceof rhi&&"Inline"!==e.textWrappingStyle&&"Behind"!==e.textWrappingStyle&&!("Word2013"!==this.documentHelper.compatibilityMode&&e.isBelowText&&"InFrontOfText"!==e.textWrappingStyle)||e instanceof Xli&&"Inline"!==e.textWrappingStyle&&"Behind"!==e.textWrappingStyle&&!("Word2013"!==this.documentHelper.compatibilityMode&&e.isBelowText&&"InFrontOfText"!==e.textWrappingStyle)},Ssi.prototype.renderShapeElementBox=function(e,t,i,n){if(!e.isHorizontalRule){var o=0===e.height,r=e.autoShapeType,s=e.textFrame.childWidgets,t=(this.pageContext.beginPath(),e.fillFormat&&e.fillFormat.color&&e.fillFormat.fill&&"StraightConnector"!==r?(this.pageContext.fillStyle=e.fillFormat.color,"Rectangle"===r?this.pageContext.fillRect(t,i,this.getScaledValue(e.width),this.getScaledValue(e.height)):this.renderPathElement(e,t,i)):e.fillFormat&&e.fillFormat.color&&"Oval"===r&&(this.pageContext.fillStyle=e.fillFormat.color,this.renderPathElement(e,t,i)),je(r)||e.lineFormat.line&&"None"!==e.lineFormat.lineFormatType&&(this.pageContext.lineWidth=e.lineFormat.weight,this.pageContext.strokeStyle=Y.getColor(e.lineFormat.color),"Rectangle"===r?this.pageContext.strokeRect(t,i,this.getScaledValue(e.width),this.getScaledValue(e.height)):"StraightConnector"===r&&(this.pageContext.moveTo(t,i),this.pageContext.lineTo(t+this.getScaledValue(e.width),i+this.getScaledValue(e.height)),this.pageContext.stroke())),this.pageContext.closePath(),!1);0!=e.width&&0!=e.height&&(t=!0,this.clipRect(e.x,e.y,this.getScaledValue(e.width),this.getScaledValue(e.height)));for(var a=0;a<s.length;a++)this.renderWidget(n,s[a]),o&&"StraightConnector"!==r&&(e.height=Y.round(e.height+s[a].height,5));o=o&&!1,t&&this.pageContext.restore()}},Ssi.prototype.renderPathElement=function(e,t,i){var n,o;if(e.autoShapeType&&"Unknown"!=e.autoShapeType)switch(e.autoShapeType){case"ElbowConnector":n=this.getConnectorPathData(e);break;case"CurvedConnector":n=this.getCurvedPathData(e);break;default:n=this.getShape(e.autoShapeType)}else e.autoShapeType&&(n=this.constructPath(e));n&&(o=this.calculatePathBounds(n),o=this.updatePath(n,o,e),this.drawPath(o,e,t,i))},Ssi.prototype.renderWidget=function(e,t){this.documentHelper.owner.enableLockAndEdit&&this.renderLockRegionBorder(e,t),t instanceof Lai?this.renderParagraphWidget(e,t):this.renderTableWidget(e,t)},Ssi.prototype.getConnectorPathData=function(e){var t=e.distanceTop,i=e.distanceLeft,n=e.distanceTop+this.getScaledValue(e.width),e=e.distanceLeft+this.getScaledValue(e.height),o=t+(n-t)/2,t="M "+t+","+i+" ";return(t+="L "+o+","+i+" ")+("L "+o+","+e+" ")+("L "+n+","+e)},Ssi.prototype.getCurvedPathData=function(e){var t=e.distanceTop,i=e.distanceLeft,n=e.distanceTop+this.getScaledValue(e.width),o=e.distanceLeft+this.getScaledValue(e.height);return"M "+t+","+i+" C "+(t+this.getScaledValue(e.width)/1.5)+","+i+" "+(n-this.getScaledValue(e.width)/1.5)+","+o+" "+n+","+o},Ssi.prototype.constructPath=function(e){var t,i=e.editingPoints,n={};for(t in i)i.hasOwnProperty(t)&&(n[t]=this.calculateCoord(i[t],400,400));return"\n      M "+n.connsiteX0+","+n.connsiteY0+"\n      L "+n.connsiteX1+","+n.connsiteY1+"\n      L "+n.connsiteX2+","+n.connsiteY2+"\n      L "+n.connsiteX3+","+n.connsiteY3+"\n      L "+n.connsiteX4+","+n.connsiteY4+"\n      Z\n    "},Ssi.prototype.calculateCoord=function(e,t,i){var e=e.split(" "),n=e[0],o=parseFloat(e[1]),t="w"===e[2]?t:i,i=parseFloat(e[3]);return"*/"===n?o/i*t:0},Ssi.prototype.drawPath=function(e,t,i,n){e=function(e){for(var t,i,n,o,r,s,a=[],l=0,h=0,d=0,p=e.length;d<p;++d){var c,u,g=e[d],m=g.command,f=("y1"in g&&(o=g.y1),"y2"in g&&(s=g.y2),"x1"in g&&(n=g.x1),"x2"in g&&(r=g.x2),"x"in g&&(l=g.x),"y"in g&&(h=g.y),a[a.length-1]);switch(m){case"M":a.push({command:"M",x:l,y:h});break;case"L":a.push({command:"L",x0:t,y0:i,x:l,y:h});break;case"H":a.push({command:"L",x0:t,y0:i,x:l,y:i});break;case"V":a.push({command:"L",x0:t,y0:i,x:t,y:h});break;case"C":a.push({command:"C",x0:t,y0:i,x1:n,y1:o,x2:r,y2:s,x:l,y:h});break;case"S":f&&(c=void 0,u={x:2*t-(c="C"===f.command||"S"===f.command?{x:f.x2,y:f.y2}:{x:t,y:i}).x,y:2*i-c.y},a.push({command:"C",x0:t,y0:i,x1:u.x,y1:u.y,x2:r,y2:s,x:l,y:h}));break;case"Q":a.push({command:"Q",x0:t,y0:i,x1:n,y1:o,x:l,y:h});break;case"T":f&&(c=void 0,u={x:2*t-(c="Q"===f.command?{x:f.x1,y:f.y1}:{x:t,y:i}).x,y:2*i-c.y},a.push({command:"Q",x0:t,y0:i,x1:u.x,y1:u.y,x:l,y:h}));break;case"A":var y=g;y.command="A",a.push(y);break;case"Z":case"z":a.push({command:"Z"}),l=t,h=i}t=l,i=h}return a}(fsi(e)),this.setStyle(t);var o=this.pageContext;o.translate&&(o.save(),o.beginPath(),o.translate(i,n),this.renderPath(o,e),o.fill(),t.lineFormat.line&&"None"!==t.lineFormat.lineFormatType&&(o.translate(-i,-n),o.stroke()),o.restore())},Ssi.prototype.renderPath=function(e,t){for(var i,n,o,r,s,a,l=e,h=t,d=0,p=0,c=0,u=h.length;c<u;++c){var g=h[parseInt(c.toString(),10)],m=g.command;switch("x1"in g&&(o=g.x1),"x2"in g&&(s=g.x2),"y1"in g&&(r=g.y1),"y2"in g&&(a=g.y2),"x"in g&&(d=g.x),"y"in g&&(p=g.y),m){case"M":l.moveTo(d,p),g.x=d,g.y=p;break;case"L":l.lineTo(d,p),g.x=d,g.y=p;break;case"C":l.bezierCurveTo(o,r,s,a,d,p),g.x=d,g.y=p,g.x1=o,g.y1=r,g.x2=s,g.y2=a;break;case"Q":l.quadraticCurveTo(o,r,d,p),g.x=d,g.y=p,g.x1=o,g.y1=r;break;case"A":var f=i,y=n,v=g.r1,b=g.r2,w=g.angle*(Math.PI/180),C=g.largeArc,S=g.sweep,A=d,x=p,I={x:Math.cos(w)*(f-A)/2+Math.sin(w)*(y-x)/2,y:-Math.sin(w)*(f-A)/2+Math.cos(w)*(y-x)/2},T=Math.pow(I.x,2)/Math.pow(v,2)+Math.pow(I.y,2)/Math.pow(b,2),T=(1<T&&(v*=Math.sqrt(T),b*=Math.sqrt(T)),Math.pow(b,2)*Math.pow(I.x,2)),C=(C===S?-1:1)*Math.sqrt((Math.pow(v,2)*Math.pow(b,2)-Math.pow(v,2)*Math.pow(I.y,2)-T)/(Math.pow(v,2)*Math.pow(I.y,2)+Math.pow(b,2)*Math.pow(I.x,2))),T=(C=isNaN(C)?0:C)*v*I.y/b,C=C*-b*I.x/v,f={x:(f+A)/2+Math.cos(w)*T-Math.sin(w)*C,y:(y+x)/2+Math.sin(w)*T+Math.cos(w)*C},A=this.a([1,0],[(I.x-T)/v,(I.y-C)/b]),y=[(I.x-T)/v,(I.y-C)/b],x=[(-I.x-T)/v,(-I.y-C)/b],T=this.a(y,x),I=(this.r(y,x)<=-1&&(T=Math.PI),S?1:-1),C=A+(T=1<=this.r(y,x)?0:T)/2*I;Math.cos(C),Math.sin(C);g.centp=f,g.xAxisRotation=w,g.rx=v,g.ry=b,g.a1=A,g.ad=T,g.sweep=S,null!=l&&(y=b<v?v:b,x=b<v?1:v/b,I=b<v?b/v:1,l.save(),l.translate(f.x,f.y),l.rotate(w),l.scale(x,I),l.arc(0,0,y,A,A+T,!S),l.scale(1/x,1/I),l.rotate(-w),l.translate(-f.x,-f.y),l.restore());break;case"Z":case"z":l.closePath(),d=i,p=n}i=d,n=p}},Ssi.prototype.m=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2))},Ssi.prototype.r=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(this.m(e)*this.m(t))},Ssi.prototype.a=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(this.r(e,t))},Ssi.prototype.updatePath=function(e,t,i){var n=!1,o="",r=-t.x,s=-t.y;return this.getScaledValue(i.width)===t.width&&this.getScaledValue(i.height)===t.height||(r=this.getScaledValue(i.width)/Number(t.width||1),s=this.getScaledValue(i.height)/Number(t.height||1),n=!0),i=function(e){for(var t,i,n,o,r,s,a=0,l=0,h=0,d=e.length;h<d;++h){var p=e[parseInt(h.toString(),10)],c=p.command;if(/[MLHVCSQTA]/.test(c))"x"in p&&(p.x=a=p.x),"y"in p&&(p.y=l=p.y);else{"x1"in p&&(p.x1=n=a+p.x1),"x2"in p&&(p.x2=r=a+p.x2),"y1"in p&&(p.y1=o=l+p.y1),"y2"in p&&(p.y2=s=l+p.y2),"x"in p&&(p.x=a+=p.x),"y"in p&&(p.y=l+=p.y);var u=void 0;switch(c){case"m":case"M":u={command:"M",x:a,y:l};break;case"l":case"L":u={command:"L",x:a,y:l};break;case"h":case"H":u={command:"H",x:a};break;case"v":case"V":u={command:"V",y:l};break;case"c":case"C":u={command:"C",x:a,y:l,x1:n,y1:o,x2:r,y2:s};break;case"s":case"S":u={command:"S",x:a,y:l,x2:r,y2:s};break;case"q":case"Q":u={command:"Q",x:a,y:l,x1:n,y1:o};break;case"t":case"T":u={command:"T",x:a,y:l};break;case"a":case"A":(u={command:"A",x:a,y:l}).r1=p.r1,u.r2=p.r2,u.angle=p.angle,u.largeArc=p.largeArc,u.sweep=p.sweep;break;case"z":case"Z":u={command:"Z"},a=t,l=i,u=e[parseInt(h.toString(),10)]}u&&(e[parseInt(h.toString(),10)]=u)}"M"!==c&&"m"!==c||(t=a,i=l)}return e}(fsi(e)),o=n?bsi(i,r,s,n,t.x,t.y,0,0):ysi(i),n=!1,o},Ssi.prototype.calculatePathBounds=function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","svg"),i=(document.body.appendChild(t),document.createElementNS("http://www.w3.org/2000/svg","path")),e=(i.setAttribute("d",e),t.appendChild(i),i.getBBox());return t.remove(),new pai(e.x,e.y,e.width,e.height)},Ssi.prototype.setStyle=function(e){var t=this.pageContext;"none"===e.lineFormat.color&&(e.lineFormat.color="transparent"),t.strokeStyle=Y.getColor(e.lineFormat.color),t.lineWidth=e.lineFormat.weight,0===e.lineFormat.weight&&(t.strokeStyle="transparent")},Ssi.prototype.renderLockRegionBorder=function(e,t){var i,n,o,r,s,a;!t.isInsideTable&&t instanceof Dai&&t.locked&&(r=this.documentHelper.owner.documentEditorSettings.collaborativeEditingSettings,e=e.bodyWidgets[0].sectionFormat,i=Y.convertPointToPixel(e.leftMargin)-5,e=e.pageWidth-e.leftMargin-e.rightMargin,e=Y.convertPointToPixel(e)+10,this.viewer instanceof sai&&(i=t.x-5,e=(this.documentHelper.visibleBounds.width-5*this.viewer.padding.right)/this.documentHelper.zoomFactor),n=t.previousRenderedWidget,o=t.nextRenderedWidget,r=t.lockedBy===this.documentHelper.owner.currentUser?r.editableRegionColor:r.lockedRegionColor,s=t.y,a=t.y+t.height,this.renderSingleBorder(r,i,s,i,a,1,"Single"),!je(n)&&n.locked&&t.lockedBy===n.lockedBy||this.renderSingleBorder(r,i,s,i+e,s,1,"Single"),this.renderSingleBorder(r,i+e,s,i+e,a,1,"Single"),!je(o)&&o.locked&&t.lockedBy===o.lockedBy||this.renderSingleBorder(r,i,a,i+e,a,1,"Single"))},Ssi.prototype.renderHeader=function(e,t,i){if(!je(i)){e.viewer.updateClientArea(e.bodyWidgets[0],e);var n=e.viewer.clientArea.y,o=i.ownerTable.getSplitWidgets()[0];if(0!==o.childWidgets.length&&-1===t.childWidgets.indexOf(i)){var r=o.clone();r.childWidgets=[],e.viewer.updateClientAreaLocation(r,new pai(e.viewer.clientArea.x,n,r.width,r.height)),this.updateTableHeaderRows(i,r,e,n),this.isRenderHeader=!0;for(var s=0;s<r.childWidgets.length;s++){for(var a,l=r.childWidgets[s],h=0;h<l.childWidgets.length;h++)a=l.childWidgets[h],this.renderTableCellWidget(e,a);n+=l.height}this.isRenderHeader=!1,t.y!==n&&e.documentHelper.layout.updateChildLocationForTable(n,t)}}},Ssi.prototype.updateTableHeaderRows=function(e,t,i,n){for(var o=e.ownerTable,r=1,s=0;s<o.childWidgets.length;s++){var a=o.childWidgets[s];if(a.rowFormat.isHeader){var l=a.clone();if(t.childWidgets.push(l),l.containerWidget=t,i.viewer.updateClientAreaLocation(l,new pai(i.viewer.clientArea.x,n,l.width,l.height)),i.documentHelper.layout.updateChildLocationForRow(n,l),n+=l.height,a==e){for(var h=0;h<e.childWidgets.length;h++)var d=e.childWidgets[h],r=Math.max(r,d.cellFormat.rowSpan);if(1<r&&s+r<o.childWidgets.length)for(var p=1;p<r;p++){var c=o.childWidgets[s+p];je(c)||(c=c.clone(),t.childWidgets.push(c),c.containerWidget=t,i.viewer.updateClientAreaLocation(c,new pai(i.viewer.clientArea.x,n,c.width,c.height)),i.documentHelper.layout.updateChildLocationForRow(n,c),n+=c.height)}}}}},Ssi.prototype.renderParagraphWidget=function(e,t){if(!this.isFieldCode||!t.isFieldCodeBlock){var i=t.y,n=t.x,o=!1,r=t.firstChild,s=0;if(!je(r))for(var a=0;a<r.children.length;a++){var l=r.children[a];if(l instanceof pli){s=l.padding.left;break}}0<s&&(this.clipRect(t.x+s,this.getScaledValue(e.boundingRectangle.y),this.getScaledValue(e.boundingRectangle.width),this.getScaledValue(e.boundingRectangle.height)),o=!0),t.containerWidget instanceof Iai&&t.containerWidget.isEmpty&&!je(this.documentHelper.owner.selectionModule)&&!je(this.documentHelper.selection.start.paragraph)&&!this.documentHelper.selection.start.paragraph.isInHeaderFooter||this.renderParagraphBorder(e,t),o&&this.pageContext.restore();for(a=0;a<t.childWidgets.length;a++){var h=t.childWidgets[a];i+=h.marginTop,this.renderLine(h,e,n,i),i+=h.height}}},Ssi.prototype.renderParagraphBorder=function(e,t){var i=t.paragraphFormat.borders.left,n=t.paragraphFormat.borders.top,o=t.paragraphFormat.borders.right,r=t.paragraphFormat.borders.bottom,s=0,a=0,l=0,h=0,d=0,p=t.firstChild,c=t.lastChild,u=this.documentHelper.canRenderBorder(t);je(i)||"None"===i.lineStyle||(l=s=this.documentHelper.getParagraphLeftPosition(t)-Y.convertPointToPixel(i.space),h=a+t.height,h="None"!==n.lineStyle&&p.isFirstLine()&&!u.skipTopBorder?(a=t.y+this.getTopMargin(t)-Y.convertPointToPixel(n.lineWidth+n.space))+t.height-(this.getTopMargin(t)-Y.convertPointToPixel(n.lineWidth+n.space)):(a=t.y)+t.height,"None"!==r.lineStyle&&c.isLastLine()&&!u.skipBottomBorder&&(h=h+Y.convertPointToPixel(r.lineWidth+r.space)-this.getBottomMargin(t)),d=Y.convertPointToPixel(i.lineWidth),this.renderSingleBorder(i.color,s,a,l,h,d,i.lineStyle)),je(n)||"None"===n.lineStyle||!p.isFirstLine()||u.skipTopBorder||(l=(s=this.documentHelper.getParagraphLeftPosition(t))+this.getContainerWidth(t,e),h=a=t.y+this.getTopMargin(t)-Y.convertPointToPixel(n.lineWidth+n.space),"None"!==i.lineStyle&&(s-=Y.convertPointToPixel(i.space)),"None"!==o.lineStyle&&(l+=Y.convertPointToPixel(o.space)),d=Y.convertPointToPixel(n.lineWidth),this.renderSingleBorder(n.color,s,a,l,h,d,n.lineStyle)),je(o)||"None"===o.lineStyle||(l=s=this.documentHelper.getParagraphLeftPosition(t)+this.getContainerWidth(t,e)+Y.convertPointToPixel(o.space),h=(a=h)+t.height,h="None"!==n.lineStyle&&p.isFirstLine()&&!u.skipTopBorder?(a=t.y+this.getTopMargin(t)-Y.convertPointToPixel(n.lineWidth+n.space))+t.height-(this.getTopMargin(t)-Y.convertPointToPixel(n.lineWidth+n.space)):(a=t.y)+t.height,"None"!==r.lineStyle&&c.isLastLine()&&!u.skipBottomBorder&&(h=h+Y.convertPointToPixel(r.lineWidth+r.space)-this.getBottomMargin(t)),d=Y.convertPointToPixel(o.lineWidth),this.renderSingleBorder(o.color,s,a,l,h,d,o.lineStyle)),je(r)||"None"===r.lineStyle||!c.isLastLine()||u.skipBottomBorder||(l=(s=this.documentHelper.getParagraphLeftPosition(t))+this.getContainerWidth(t,e),h=a=t.y+t.height+Y.convertPointToPixel(r.lineWidth+r.space)-this.getBottomMargin(t),"None"!==i.lineStyle&&(s-=Y.convertPointToPixel(i.space)),"None"!==o.lineStyle&&(l+=Y.convertPointToPixel(o.space)),d=Y.convertPointToPixel(r.lineWidth),this.renderSingleBorder(r.color,s,a,l,h,d,r.lineStyle))},Ssi.prototype.renderImgBorder=function(e,t,i,n,o,r,s,a){var l,h=e.width/this.documentHelper.zoomFactor,r=Y.convertPointToPixel(r),d=this.documentHelper.selection.getNextTextElement(e),p=this.documentHelper.selection.getPreviousTextElement(e),c="Subscript"===s?e.margin.top+(e.height-e.height/1.5):e.margin.top,s=e.height/("Normal"===s?1:1.5)+15,u=0,g=0,u=i+=0<c?c:0,g=i;this.renderSingleBorder(n,c=t,u,l=t+h,g,r,o),this.renderSingleBorder(n,c,g=u=i+s,l,g,r,o),u=i,l=t,p instanceof pli&&(o=p.line!==e.line||null==p.contentControlProperties?"Solid":"None"),this.renderSingleBorder(n,c,u,l,g,r,o),l=c=t+h,o=!(d instanceof pli)||d.line!==e.line||null==d.contentControlProperties?"Solid":"None",this.renderSingleBorder(n,c,u,l,g,r,o)},Ssi.prototype.getContainerWidth=function(e,t){var i,n,o=0;return e.paragraphFormat.firstLineIndent<0&&(o=Math.abs(e.paragraphFormat.firstLineIndent)),e.isInsideTable?(i=e.associatedCell).width+i.margin.left+i.margin.right-i.leftBorderWidth:this.viewer instanceof sai?(i=Y.convertPointToPixel(e.leftIndent+e.rightIndent),(this.documentHelper.visibleBounds.width-i-4*this.viewer.padding.right-2*this.viewer.padding.left)/this.documentHelper.zoomFactor):(i=e.bodyWidget)instanceof Sai&&1<i.sectionFormat.columns.length?(n=i.columnIndex,i.sectionFormat.columns[n].width+Y.convertPointToPixel(o-(e.rightIndent+e.leftIndent))):(n=i.sectionFormat.pageWidth-i.sectionFormat.leftMargin-i.sectionFormat.rightMargin,Y.convertPointToPixel(n+o-(e.rightIndent+e.leftIndent)))},Ssi.prototype.getTopMargin=function(e){var t;return e.isEmpty()?e.childWidgets[0].margin.top:je((t=e.childWidgets[e=0]).margin)?e:t.margin.top},Ssi.prototype.getBottomMargin=function(e){var t;return e.isEmpty()?e.childWidgets[e.childWidgets.length-1].margin.bottom:(t=0,je((e=e.childWidgets[e.childWidgets.length-1]).margin)?t:e.margin.bottom)},Ssi.prototype.renderfootNoteWidget=function(e,t,i){1!==t.page.bodyWidgets.length||1===t.page.bodyWidgets[0].childWidgets.length&&null!=t.page.bodyWidgets[0].childWidgets[0].isEmpty&&t.page.bodyWidgets[0].childWidgets[0].isEmpty()||t.page.bodyWidgets[0].childWidgets.length;var n=this.getFooterHeight(e),o=t.y+t.height;n<o&&(o=n-t.y),this.pageContext.beginPath(),this.pageContext.save(),this.pageContext.rect(this.pageLeft,this.getScaledValue(t.y,2),this.getScaledValue(i),this.getScaledValue(o)),this.pageContext.clip();for(var r=0;r<t.bodyWidgets.length;r++)for(var s=t.bodyWidgets[r],a=s.footNoteReference,l=0;l<s.childWidgets.length;l++){var h,d,p,c=s.childWidgets[l];0===r&&0===l&&(p=this.pageContext,h=e.bodyWidgets[0].x,1<e.bodyWidgets.length&&!je(s.nextWidget)&&"NoBreak"!==s.nextWidget.sectionFormat.breakCode?(d=e.bodyWidgets[0].width,this.renderSolidLine(p,this.getScaledValue(h,1),this.getScaledValue(t.y+t.margin.top/2+1,2),d*this.documentHelper.zoomFactor,"#000000")):this.renderSolidLine(p,this.getScaledValue(h,1),this.getScaledValue(t.y+t.margin.top/2+1,2),210*this.documentHelper.zoomFactor,"#000000")),je(a)||this.documentHelper.owner.editorModule.isFootNoteInsert||(d=this.documentHelper.getFirstParagraphBlock(c)).firstChild.children[0]instanceof pli&&""===(p=d.firstChild.children[0]).text&&(p.text=p.text.replace(p.text,a.text),p.width=a.width),this.renderWidget(e,c)}this.pageContext.restore()},Ssi.prototype.renderTableWidget=function(e,t){if(!this.isFieldCode)for(var i=0;i<t.childWidgets.length;i++){var n,o,r,s=t.childWidgets[i];this.renderTableRowWidget(e,s),0<t.tableFormat.cellSpacing&&this.renderTableOutline(t),s.isRenderBookmarkEnd&&this.documentHelper.owner.documentEditorSettings.showBookmarks&&(o=(n=s.lastChild).ownerTable.isBidiTable?Uai.getCellLeftBorder(n):Uai.getCellRightBorder(n),o=Y.convertPointToPixel(o.getLineWidth()),r=(s=this.documentHelper.selection.getLastParagraph(s.lastChild)).lastChild.height-s.lastChild.margin.bottom,this.renderBookmark(this.getScaledValue(n.x+n.width+n.margin.right-o/2+this.documentHelper.textHelper.getParagraphMarkWidth(s.characterFormat),1),this.getScaledValue(n.y-n.margin.top,2),this.getScaledValue(r),1))}},Ssi.prototype.renderTableRowWidget=function(e,t){for(var i=0;i<t.childWidgets.length;i++){var n,o=t.childWidgets[i];this.renderTableCellWidget(e,o),o.isRenderBookmarkEnd&&this.documentHelper.owner.documentEditorSettings.showBookmarks&&(n=(o=this.documentHelper.selection.getLastParagraph(o)).lastChild,o=this.documentHelper.selection.getEndPosition(o),this.renderBookmark(this.getScaledValue(o.x,1),this.getScaledValue(o.y,2),this.getScaledValue(n.height-n.margin.bottom),1))}},Ssi.prototype.renderTableCellWidget=function(e,t){if(!this.isPrinting&&!this.isExporting){var i=t.margin.top-t.containerWidget.topBorderWidth,n=t.margin.bottom-t.containerWidget.bottomBorderWidth;if(this.getScaledValue(t.y,2)+t.height+n*this.documentHelper.zoomFactor<0||this.getScaledValue(t.y,2)-i>this.documentHelper.visibleBounds.height)return}this.renderSelectionHighlightOnTable(e,t),this.renderTableCellOutline(e.documentHelper,t);for(var o,r,s=0;s<t.childWidgets.length;s++){var a=t.childWidgets[s],l=t.width+t.margin.left+t.margin.right-t.leftBorderWidth;this.isPrinting||a instanceof _ai&&l===a.width&&"Word2007"===this.documentHelper.compatibilityMode||this.clipRect(t.x-t.margin.left,t.y,this.getScaledValue(l),this.getScaledValue(this.height)),this.renderWidget(e,a),this.pageContext.restore()}t.isRenderEditRangeStart&&(i=(n=this.documentHelper.selection.getFirstParagraph(t).firstChild).paragraph.x,0<n.children.length&&!je(n.children[0].margin)&&0<n.children[0].margin.left&&(i+=n.children[0].margin.left),o=n.paragraph.y,this.documentHelper.owner.documentEditorSettings.highlightEditableRanges)&&(r=je(r=this.documentHelper.selection.editRegionHighlighters)?[]:r.get(n),r=je(r)||je(r[0])?"ffff00":r[0].color,this.renderBookmark(this.getScaledValue(i,1),this.getScaledValue(o,2),this.getScaledValue(n.height-n.margin.bottom),0,r))},Ssi.prototype.checkHeaderFooterLineWidget=function(e,t){if(e instanceof Gai?i=e.paragraph.bodyWidget:e instanceof Uai&&(i=e.bodyWidget),!je(i.parentHeaderFooter))for(var i=i.parentHeaderFooter,n=0;n<t.length;n++){var o=t[n];if(o instanceof Gai&&e instanceof Gai){var r=o.getHierarchicalIndex(""),s=e.getHierarchicalIndex("");if(o.paragraph.isInHeaderFooter&&i===o.paragraph.bodyWidget&&r.substring(r.indexOf(";"))===s.substring(s.indexOf(";")))return o}else if(o instanceof Uai&&e instanceof Uai){r=o.getHierarchicalIndex(""),s=e.getHierarchicalIndex("");if(o.ownerTable.isInHeaderFooter&&i===o.ownerTable.bodyWidget&&r.substring(r.indexOf(";"))===s.substring(s.indexOf(";")))return o}}},Ssi.prototype.renderEditregionContentHighlight=function(e,t,i){if(!je(this.documentHelper.owner.editorModule)&&e.documentHelper.selection&&!je(e.documentHelper.selection.contentControleditRegionHighlighters)){var n=e.documentHelper.selection.contentControls;if(!je(n))for(var o=0;o<n.length;o++){var r=n[o],s=this.documentHelper.selection.contentControleditRegionHighlighters.get(r);if(!je(s)){var a=s.keys.indexOf(t);if(-1!==a)for(var l=r.contentControlProperties.color,h=("#00000000"===l&&(l="#939393"),s.get(t)),d=0;d<h.length;d++){var p,c,u,g=t.paragraph,m=0,f=Y.convertPointToPixel(g.paragraphFormat.firstLineIndent),y=Y.convertPointToPixel(g.leftIndent),m=-1!==g.paragraphFormat.listFormat.listId?h[d].left-y-2:h[d].left-y-f-2,y=h[d].left+h[d].width+2,f=(s.length-1>a&&(y=this.documentHelper.getParagraphLeftPosition(g)+this.getContainerWidth(g,e)+Y.convertPointToPixel(g.paragraphFormat.borders.right.space)),i),v=i+t.height;this.renderSingleBorder(l,m,f,m,v,1,"single"),0===a||t===r.line?(this.renderSingleBorder(l,m,f,y,f,1,"single"),(1===s.length||je(g.nextWidget)&&t===g.lastChild)&&this.renderSingleBorder(l,m,v,y,v,1,"single")):t!==r.line&&t!==r.reference.line?(je(g.previousWidget)&&t===g.firstChild?this.renderSingleBorder(l,m,f,y,f,1,"single"):"Block"!==r.contentControlWidgetType&&(p=s.get(s.keys[a-1]),this.renderSingleBorder(l,m,f,p[d].left-2,f,1,"single")),je(g.nextWidget)&&t===g.lastChild&&(y=this.documentHelper.getParagraphLeftPosition(g)+this.getContainerWidth(g,e)+Y.convertPointToPixel(g.paragraphFormat.borders.right.space),this.renderSingleBorder(l,m,v,y,v,1,"single"))):a===s.length-1&&t===r.reference.line&&(p=s.get(s.keys[a-1]),je(g.previousWidget)&&t===g.firstChild?(y=this.documentHelper.getParagraphLeftPosition(g)+this.getContainerWidth(g,e)+Y.convertPointToPixel(g.paragraphFormat.borders.right.space),this.renderSingleBorder(l,m,f,y,f,1,"single")):m>p[d].left&&this.renderSingleBorder(l,p[d].left-2,f,m,f,1,"single"),je(u=g.lastChild)||je(e.nextPage)&&je(g.nextWidget)||t!==u||!(u.children[u.children.length-1]instanceof Pli)||u.children[u.children.length-1]!==r.reference||"Block"!==r.contentControlWidgetType?(this.renderSingleBorder(l,m,v,y,v,1,"single"),1<s.length&&(u=s.get(s.keys[a-1]),c=this.documentHelper.getParagraphLeftPosition(g)+this.getContainerWidth(g,e)+Y.convertPointToPixel(g.paragraphFormat.borders.right.space),this.renderSingleBorder(l,y,f,c,f,1,"single"),m<u[d].left-2)&&"Block"!==r.contentControlWidgetType&&this.renderSingleBorder(l,u[d].left-2,f,m,f,1,"single")):(y=this.documentHelper.getParagraphLeftPosition(g)+this.getContainerWidth(g,e)+Y.convertPointToPixel(g.paragraphFormat.borders.right.space),this.renderSingleBorder(l,m,v,y,v,1,"single"))),this.renderSingleBorder(l,y,f,y,v,1,"single"),t!==r.reference.line||je(r)||"ComboBox"!==r.contentControlProperties.type&&"DropDownList"!==r.contentControlProperties.type&&"Date"!==r.contentControlProperties.type||((c=document.getElementById("contenticon"))?(c.style.display="block",m=this.getScaledValue(y,1),f=this.getScaledValue(f,2),c.style.left=m+"px",c.style.top=f+"px",c.style.border="0.5px solid #7F7F7F",c.style.backgroundColor="#D3D3D3",c.style.height=t.height+"px",c):((u=document.createElement("div")).id="contenticon",u.style.display="block",u.style.position="sticky",m=this.getScaledValue(y,1),f=this.getScaledValue(f,2),u.style.left=m+"px",u.style.top=f+"px",u.style.border="0.5px solid #7F7F7F",u.style.backgroundColor="#D3D3D3",u.style.height=t.height+"px",u.classList.add("e-de-cmt-mark"),(g=document.createElement("span")).classList.add("e-icons"),g.classList.add("e-chevron-down-fill"),u.appendChild(g),this.documentHelper.pageContainer.appendChild(u),u)).addEventListener("click",this.documentHelper.owner.editor.contentControlDropDownChange.bind(this))}}}}},Ssi.prototype.renderEditRegionHighlight=function(e,t,i){if(e.documentHelper.selection&&!je(e.documentHelper.selection.editRegionHighlighters)){var n,e=this.documentHelper.selection.editRegionHighlighters.containsKey(t);if(!e&&t.paragraph.isInHeaderFooter&&(n=this.documentHelper.selection.editRegionHighlighters.keys,je(t=this.checkHeaderFooterLineWidget(t,n))||(e=!0)),e)for(var o=this.documentHelper.selection.editRegionHighlighters.get(t),r=0;r<o.length;r++)this.pageContext.fillStyle=""!==o[r].color?o[r].color:"#add8e6",this.pageContext.fillRect(this.getScaledValue(o[r].left,1),this.getScaledValue(i,2),this.getScaledValue(o[r].width),this.getScaledValue(t.height))}},Ssi.prototype.renderSearchHighlight=function(e,t,i){if(this.documentHelper.owner.searchModule&&!je(e.documentHelper.owner.searchModule.searchHighlighters)){var n,o=e.documentHelper.owner.searchModule.searchHighlighters.containsKey(t);if(this.validateRemoveSearchHighlighters(e),!o&&t.paragraph.isInHeaderFooter&&(n=e.documentHelper.owner.searchModule.searchHighlighters.keys,je(t=this.checkHeaderFooterLineWidget(t,n))||(o=!0)),o)for(var r=e.documentHelper.owner.searchModule.searchHighlighters.get(t),s=0;s<r.length;s++)this.pageContext.fillStyle=this.viewer.owner.documentEditorSettings.searchHighlightColor,this.pageContext.fillRect(this.getScaledValue(r[s].left,1),this.getScaledValue(i,2),this.getScaledValue(r[s].width),this.getScaledValue(t.height))}},Ssi.prototype.validateRemoveSearchHighlighters=function(e){for(var t=e.documentHelper.owner.searchModule.searchHighlighters.keys,i=0;i<t.length;i++){var n=t[i];n instanceof Gai&&!je(n.paragraph)&&!je(n.paragraph.containerWidget)||e.documentHelper.owner.searchModule.searchHighlighters.keys.splice(i,1)}},Ssi.prototype.renderSelectionHighlight=function(e,t,i){var n,o;!this.isPrinting&&e.documentHelper.owner.selectionModule&&!this.documentHelper.isScrollToSpellCheck&&0<e.documentHelper.owner.selectionModule.selectedWidgets.length&&(!(n=e.documentHelper.owner.selectionModule.selectedWidgets.containsKey(t))&&t.paragraph.isInHeaderFooter&&(o=e.documentHelper.owner.selectionModule.selectedWidgets.keys,je(t=this.checkHeaderFooterLineWidget(t,o))||(n=!0)),n)&&e.documentHelper.owner.selectionModule.addSelectionHighlight(this.selectionContext,t,i,e)},Ssi.prototype.renderSelectionHighlightOnTable=function(e,t){var i,n;!this.isPrinting&&e.documentHelper.owner.selectionModule&&0<e.documentHelper.owner.selectionModule.selectedWidgets.length&&(!(i=e.documentHelper.owner.selectionModule.selectedWidgets.containsKey(t))&&t.ownerTable.isInHeaderFooter&&(n=e.documentHelper.owner.selectionModule.selectedWidgets.keys,je(t=this.checkHeaderFooterLineWidget(t,n))||(i=!0)),i)&&e.documentHelper.owner.selectionModule.addSelectionHighlightTable(this.selectionContext,t,e)},Ssi.prototype.renderLine=function(e,t,i,n){this.renderSelectionHighlight(t,e,n);var o=e.paragraph.paragraphFormat,r=i;if(e.isFirstLine()&&!o.bidi&&(i+=Y.convertPointToPixel(o.firstLineIndent)),this.documentHelper&&this.documentHelper.selection&&!je(this.documentHelper.selection.formFieldHighlighters)&&this.documentHelper.selection.formFieldHighlighters.containsKey(e)&&this.documentHelper.owner.documentEditorSettings&&this.documentHelper.owner.documentEditorSettings.formFieldSettings.applyShading)for(var s=t.documentHelper.selection.formFieldHighlighters.get(e),a=0;a<s.length;a++){this.pageContext.fillStyle=this.documentHelper.owner.documentEditorSettings.formFieldSettings.shadingColor;var l,O,h=e.height,N=!1;e.isLastLine()&&(h-=Y.convertPointToPixel(this.documentHelper.layout.getAfterSpacing(e.paragraph)),1<e.paragraph.paragraphFormat.lineSpacing)&&(je(l=this.getFormfieldInLine(e))||(O=(l=this.documentHelper.textHelper.getHeight(l.characterFormat)).Height,"Multiple"===e.paragraph.paragraphFormat.lineSpacingType?h-=Y.convertPointToPixel(this.documentHelper.layout.getLineSpacing(e.paragraph,O,!0)):(n+=Y.convertPointToPixel(e.paragraph.paragraphFormat.beforeSpacing),h=l.Height,N=!0))),this.pageContext.fillRect(this.getScaledValue(s[a].left,1),this.getScaledValue(n,2),this.getScaledValue(s[a].width),this.getScaledValue(h)),N&&(N=!1,n-=Y.convertPointToPixel(e.paragraph.paragraphFormat.beforeSpacing))}this.renderSearchHighlight(t,e,n),this.renderEditRegionHighlight(t,e,n);var V=[],d=e.renderedElements,_=this.getUnderlineYPosition(e),p=[];!je(e.paragraph.associatedCell)&&e.paragraph.associatedCell.isRenderBookmarkStart&&e.paragraph.associatedCell.firstChild.firstChild==e&&p.push({x:i,y:n,height:e.height-e.margin.bottom,type:0});for(var c,u,g,m,f,y,a=0;a<d.length;a++){var v,b,w,C,S,A,x,I,T=d[a];if(!(T instanceof qli&&"Inline"!==T.textWrappingStyle)){if((T instanceof Khi||T instanceof ghi)&&(x=0,this.viewer instanceof nai&&(x=this.viewer.pageGap),I="display:block;position:absolute;",x=this.getScaledValue(n+(t.boundingRectangle.y-x*(t.index+1)))+x*(t.index+1)+"px;",T instanceof ghi&&(this.documentHelper.owner.currentUser===T.user||"Everyone"===T.group&&""===T.user)?(this.documentHelper.owner.documentEditorSettings.highlightEditableRanges&&-1==T.columnFirst&&(E=T.line.height-T.line.margin.bottom,D=i,!je(T.margin)&&0<T.margin.left&&(D+=T.margin.left),M=n,s=je(w=this.documentHelper.selection.editRegionHighlighters)?[]:w.get(e),C=je(s)||je(s[0])?"ffff00":s[0].color,this.renderBookmark(this.getScaledValue(D,1),this.getScaledValue(M,2),this.getScaledValue(e.height-e.margin.bottom),0,C)),this.documentHelper.owner.enableLockAndEdit?((v=new Cn("documenteditor",this.documentHelper.owner.defaultLocale)).setLocale(this.documentHelper.owner.locale),T.renderLockMark(this.documentHelper.owner.currentUser,v),b=this.documentHelper.owner.documentEditorSettings.collaborativeEditingSettings,I+="color:"+(C=T.user===this.documentHelper.owner.currentUser?b.editableRegionColor:b.lockedRegionColor)+";",b=Y.convertPointToPixel(t.bodyWidgets[0].sectionFormat.leftMargin),b=t.boundingRectangle.x+this.getScaledValue(b-20)+"px;",this.viewer instanceof sai&&(b=e.paragraph.x-5+"px;"),rt(T.editRangeMark,I=I+"left:"+b+"top:"+x)):T.editRangeMark&&rt(T.editRangeMark,"display:none")):T instanceof Khi&&0===T.commentType&&this.documentHelper.owner.selectionModule&&(this.documentHelper.owner.enableComment?(A=Y.convertPointToPixel(t.bodyWidgets[0].sectionFormat.rightMargin),S=Y.convertPointToPixel(t.bodyWidgets[0].sectionFormat.pageWidth),b=t.boundingRectangle.x+this.getScaledValue(S-A+A/4)+"px;",I=I+"left:"+(b=this.viewer instanceof sai?t.boundingRectangle.width-2*this.viewer.padding.right-2*this.viewer.padding.left+"px;":b)+"top:"+x,-1!==V.indexOf(T.commentId)||je(T.comment)||T.comment.isReply||(V.push(T.commentId),T.renderCommentMark(x,b),rt(T.commentMark,I))):T.commentMark&&rt(T.commentMark,"display:none"))),T instanceof phi&&(this.documentHelper.owner.currentUser===T.editRangeStart.user||"Everyone"===T.editRangeStart.group&&""===T.editRangeStart.user)&&-1==T.editRangeStart.columnFirst&&this.documentHelper.owner.documentEditorSettings.highlightEditableRanges&&(E=T.line.height-T.line.margin.bottom,D=i,M=n,s=je(w=this.documentHelper.selection.editRegionHighlighters)?[]:w.get(e),C=je(s)||je(s[0])?"ffff00":s[0].color,this.renderBookmark(this.getScaledValue(D,1),this.getScaledValue(M,2),this.getScaledValue(e.height-e.margin.bottom),1,C)),T instanceof Dli&&this.documentHelper.owner.documentEditorSettings.showBookmarks&&-1!==this.documentHelper.getBookmarks().indexOf(T.name)){var E=T.line.height-T.line.margin.bottom,D=i,M=(!je(T.margin)&&0<T.margin.left&&(D+=T.margin.left),n);if(1==T.bookmarkType){if(this.isBookmarkEndAtStart(T)&&je(T.properties)){for(var k=T.paragraph,P=void 0,B=!1;!B&&!je(k);){for(var H=0<=k.childWidgets.indexOf(T.line)?k.childWidgets.indexOf(T.line):k.childWidgets.length-1;0<=H;H--){for(var F=k.childWidgets[H],L=0<=F.children.indexOf(T)?F.children.indexOf(T):F.children.length-1;0<=L;L--)if(this.isRenderable(F.children[L])){P=F.children[L],B=!0;break}if(B)break}B||(k=this.documentHelper.selection.getPreviousParagraphBlock(k))}je(P)||(k.containerWidget instanceof Uai?D+=k.x+this.documentHelper.selection.getWidth(P.line,!1)+this.documentHelper.textHelper.getParagraphMarkWidth(T.line.paragraph.characterFormat):D+=this.documentHelper.selection.getWidth(P.line,!1)+this.documentHelper.textHelper.getParagraphMarkWidth(T.line.paragraph.characterFormat),M=this.documentHelper.selection.getTop(P.line))}je(T.properties)||(T.properties.isAfterParagraphMark&&(D+=this.documentHelper.textHelper.getParagraphMarkWidth(T.line.paragraph.characterFormat)),T.properties.isAfterCellMark&&(D+=this.documentHelper.textHelper.getWidth(String.fromCharCode(164),e.paragraph.characterFormat)))}1==T.bookmarkType?je(T.reference)||(je(T.reference.properties)?this.documentHelper.selection.isRenderBookmarkAtEnd(T)||p.push({x:D,y:M,height:E,type:T.bookmarkType}):je(T.paragraph.associatedCell)&&p.push({x:D,y:M,height:E,type:T.bookmarkType})):je(T.properties)&&p.push({x:D,y:M,height:E,type:T.bookmarkType})}T instanceof Zai||this.isFieldCode||0===T.width&&0===T.height?(this.isFieldCode&&(T.width=0),i+=T.width+T.margin.left,this.toSkipFieldCode(T)):!this.isPrinting&&(this.getScaledValue(n+T.margin.top,2)+T.height*this.documentHelper.zoomFactor<0||this.getScaledValue(n+T.margin.top,2)>this.documentHelper.visibleBounds.height)&&(i+=T.width+T.margin.left,T instanceof pli&&(this.documentHelper.owner.isSpellCheck&&(T.canTrigger=!0),T.isVisible=!1,(T.isSpellChecked||T.isSpellCheckTriggered)&&!T.line.paragraph.isChangeDetected||(T.ischangeDetected=!0)),!this.isExporting)||(T instanceof lhi?(i+=T.padding.left,this.renderListTextElementBox(T,i,n,_)):T instanceof rhi?(i+=T.padding.left,this.renderImageElementBox(T,i,n,_)):T instanceof Xli?(S=T.margin.left,A=T.margin.top,x=this.getScaledValue(i+S,1),I=this.getScaledValue(n+A,2),this.renderShapeElementBox(T,x,I,t)):(T.isVisible=!0,i+=T.padding.left,this.renderTextElementBox(T,i,n,_)),i+=T.width+T.margin.left,e.paragraph.bidi?r+=T.margin.left:r=i)}}if(this.renderEditregionContentHighlight(t,e,n),this.documentHelper.owner.documentEditorSettings.showBookmarks&&0<p.length)for(a=0;a<p.length;a++){var R=p[a];this.renderBookmark(this.getScaledValue(R.x,1),this.getScaledValue(R.y,2),this.getScaledValue(R.height),R.type)}this.documentHelper.owner.documentEditorSettings.showHiddenMarks&&!this.isPrinting&&(o="",c=e.paragraph.characterFormat,u=0,g=this.retriveCharacterformat(c),(v=new Cn("documenteditor",this.documentHelper.owner.defaultLocale)).setLocale(this.documentHelper.owner.locale),this.pageContext.fillStyle=Y.getColor(c.fontColor),m=0,!e.paragraph.bodyWidget||e.paragraph.bodyWidget instanceof Iai||(m=this.documentHelper.pages.indexOf(e.paragraph.bodyWidget.page)),0==d.length&&!e.isEndsWithLineBreak&&!je(e.paragraph)||1===e.paragraph.childWidgets.length?(u=e.paragraph.y+this.documentHelper.textHelper.getHeight(c).BaselineOffset+this.documentHelper.layout.getBeforeSpacing(e.paragraph,m),!e.isEndsWithLineBreak&&0<e.indexInOwner&&0==d.length&&(u=n+e.previousLine.maxBaseLine)):u=n+e.maxBaseLine,0<c.revisions.length&&(C=this.documentHelper.authors.get(c.revisions[0].author),this.pageContext.fillStyle=Y.getColor(C)),e.isEndsWithColumnBreak?(g=this.retriveCharacterformat(c,.7),o="....."+v.getConstant("Column Break")+"....."):e.isEndsWithPageBreak?(g=this.retriveCharacterformat(c,.7),o=this.getPageBreakText(e.paragraph,v),f=this.documentHelper.textHelper.getWidth(o,c,lJt.English),this.viewer instanceof nai?e.paragraph.bidi?r<f+this.viewer.clientActiveArea.x&&(o="....."):r>this.viewer.clientActiveArea.width&&(o="....."):e.paragraph.bidi?r-f<this.viewer.clientActiveArea.x&&(o="....."):r+f>this.viewer.clientActiveArea.width+this.viewer.clientActiveArea.x&&(o=".....")):e.isEndsWithLineBreak?o=e.paragraph.bidi?String.fromCharCode(8627):String.fromCharCode(8629):e.paragraph.isInsideTable&&je(e.nextLine)&&je(e.paragraph.nextWidget)?0!=e.height&&(o=String.fromCharCode(164)):je(e.nextLine)&&(o=String.fromCharCode(182)),e.paragraph.containerWidget instanceof Sai&&!je(e.paragraph.nextRenderedWidget)&&e.paragraph.containerWidget.sectionIndex!==e.paragraph.nextRenderedWidget.containerWidget.sectionIndex&&e.isLastLine()&&(o="NoBreak"===e.paragraph.nextRenderedWidget.containerWidget.sectionFormat.breakCode&&e.paragraph.containerWidget.index!==e.paragraph.nextRenderedWidget.containerWidget.index?":::::"+v.getConstant("Section Break Continuous")+":::::":":::::"+v.getConstant("Section Break Next Page")+":::::",g=this.retriveCharacterformat(c,.7),(m=e.paragraph.previousRenderedWidget)instanceof Lai&&m.isEndsWithPageBreak&&e.paragraph.isSectionBreak?(y=this.getPageBreakText(m,v),r=(r+=.7*this.documentHelper.textHelper.getWidth(y,m.characterFormat,lJt.English))-this.documentHelper.textHelper.getParagraphMarkSize(m.characterFormat).Width):e.isEndsWithPageBreak&&(o=e.paragraph.bidi?o+String.fromCharCode(182)+"....."+v.getConstant("Page Break")+".....":"....."+v.getConstant("Page Break")+"....."+String.fromCharCode(182)+o),f=this.documentHelper.textHelper.getWidth(o,c,lJt.English),this.viewer instanceof nai?e.paragraph.bidi?r<f+this.viewer.clientActiveArea.x&&(o=":::::",e.isEndsWithPageBreak)&&(o=":::::....."):r+f-this.viewer.clientActiveArea.x>this.viewer.clientActiveArea.width&&(o=":::::",e.isEndsWithPageBreak)&&(o=".....:::::"):e.paragraph.bidi?r-f<this.viewer.clientActiveArea.x&&(o=":::::",e.isEndsWithPageBreak)&&(o=":::::....."):r+f-this.documentHelper.pages[0].boundingRectangle.x>this.viewer.clientActiveArea.width&&(o=":::::",e.isEndsWithPageBreak)&&(o=".....:::::")),0<o.length)&&(!e.paragraph.characterFormat.hidden||0!==e.paragraph.height)&&(e.paragraph.bidi&&!e.paragraph.isEmpty()&&(r-=this.documentHelper.textHelper.getWidth(o,c,lJt.English)),this.pageContext.font=g,y=c.scaling<100?1:c.scaling/100,this.pageContext.letterSpacing=c.characterSpacing*this.documentHelper.zoomFactor+"pt",this.pageContext.save(),this.pageContext.scale(y,1),this.pageContext.fillText(o,this.getScaledValue(r,1)/y,this.getScaledValue(u,2)),this.pageContext.restore())},Ssi.prototype.getPageBreakText=function(e,t){return e.bidi?String.fromCharCode(182)+"....."+t.getConstant("Page Break")+".....":"....."+t.getConstant("Page Break")+"....."+String.fromCharCode(182)},Ssi.prototype.isBookmarkEndAtStart=function(e){for(var t=e.paragraph,i=0,n=t.childWidgets[i],o=!0;-1==n.children.indexOf(e)&&(n=t.childWidgets[++i],i!=t.childWidgets.length););if(e.line!=n)return!1;for(var r=0<=n.children.indexOf(e)?n.children.indexOf(e):-1;0<=r;r--){var s=n.children[r];this.isRenderable(s)&&(o=!1)}return!!o},Ssi.prototype.isRenderable=function(e){return!(e instanceof Dli||e instanceof ghi||e instanceof phi)},Ssi.prototype.combineHexColors=function(e,t){var e=e.replace("#",""),t=t.replace("#",""),i=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),e=parseInt(e.substring(4,6),16),o=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),t=parseInt(t.substring(4,6),16),i=Math.round(.35*i+.65*o),o=Math.round(.35*n+.65*r),n=Math.round(.35*e+.65*t);return"#"+i.toString(16)+o.toString(16)+n.toString(16)},Ssi.prototype.renderBookmark=function(e,t,i,n,o){this.isPrinting||(this.pageContext.beginPath(),this.pageContext.lineWidth=1.5,0==n&&(this.pageContext.moveTo(e+3,t),this.pageContext.lineTo(e,t),this.pageContext.lineTo(e,t+i),this.pageContext.lineTo(e+3,t+i)),1==n&&(this.pageContext.moveTo(e-3,t),this.pageContext.lineTo(e,t),this.pageContext.lineTo(e,t+i),this.pageContext.lineTo(e-3,t+i)),this.pageContext.strokeStyle="#7F7F7F",this.pageContext.stroke(),this.pageContext.closePath(),je(o))||(n=this.combineHexColors(o,"#7F7F7F"),this.pageContext.fillStyle=n,this.pageContext.fillRect(e,t,1.5,i))},Ssi.prototype.retriveCharacterformat=function(e,t){je(t)&&(t=1);this.pageContext.textBaseline="alphabetic";return(e.bold?"bold":"")+" "+(e.italic?"italic":"")+" "+(0===e.fontSize?.5:e.fontSize/("Normal"===e.baselineAlignment?1:1.5))*this.documentHelper.zoomFactor*t+'pt "'+e.fontFamily+'"'},Ssi.prototype.toSkipFieldCode=function(e){e instanceof Zai&&(0===e.fieldType?this.isFieldCode||je(e.fieldEnd)&&!e.hasFieldEnd||(this.fieldStacks.push(e),this.isFieldCode=!0):2!==e.fieldType&&1!==e.fieldType||0<this.fieldStacks.length&&e.fieldBegin===this.fieldStacks[this.fieldStacks.length-1]&&(this.fieldStacks.pop(),this.isFieldCode=!1))},Ssi.prototype.getUnderlineYPosition=function(e){for(var t=0,i=0,n=0;n<e.children.length;n++){var o=e.children[n];o instanceof Zai||0===o.width&&0===o.height||o instanceof Xli||o instanceof rhi&&"Inline"!==o.textWrappingStyle||t<o.height+o.margin.top&&(t=o.margin.top+o.height,i=o instanceof rhi?.9:o.height/20)}return t-2*i},Ssi.prototype.renderListTextElementBox=function(e,t,i,n){var o=e.margin.top,r=e.margin.left,s=e.listLevel.characterFormat,a=e.line.paragraph.characterFormat,l=(s.hasValue("fontColor")?s:a).fontColor,h=(this.pageContext.textBaseline="alphabetic",(s.hasValue("fontFamily")?s:a).fontFamily),d=(!this.documentHelper.isIosDevice&&!this.documentHelper.isLinuxOS||e.text!==String.fromCharCode(9679)&&e.text!==String.fromCharCode(9675)||(h=""),(s.hasValue("fontSize")?s:a).fontSize),p=(s.hasValue("baselineAlignment")?s:a).baselineAlignment,c=s.hasValue("bold")?s.bold?"bold":"":a.bold?"bold":"",u=s.hasValue("italic")?s.italic?"italic":"":a.italic?"italic":"",d=0===d?.5:d/("Normal"===p?1:1.5),g=(d=this.isPrinting?d:d*this.documentHelper.zoomFactor,(s.hasValue("strikethrough")?s:a).strikethrough),a=(s.hasValue("highlightColor")?s:a).highlightColor,a=("NoColor"!==a&&("#"!==a.substring(0,1)?this.pageContext.fillStyle=Y.getHighlightColorCode(a):this.pageContext.fillStyle=Y.getColor(a),this.pageContext.fillRect(Math.floor(this.getScaledValue(t+r,1)),Math.floor(this.getScaledValue(i+o,2)-1),Math.ceil(this.getScaledValue(e.width)+1),Math.ceil(this.getScaledValue(e.height)+1))),this.pageContext.font=c+" "+u+" "+d+'pt "'+h+'"',"Subscript"===p&&(o+=e.height-e.height/1.5),e.baselineOffset),o="Normal"===s.baselineAlignment?o+a:o+a/1.5,c=e.text,u=e.paragraph.paragraphFormat.bidi,h=(u&&(this.pageContext.direction="rtl",t+=e.width),"empty"===l||"#00000000"===l?(d=this.getBackgroundColorHeirachy(e),this.pageContext.fillStyle=this.getDefaultFontColor(d)):this.pageContext.fillStyle=Y.getColor(l),s.scaling<100?1:s.scaling/100);this.documentHelper.owner.documentEditorSettings.showHiddenMarks&&!this.isPrinting?(e instanceof lhi&&"\t"===e.text&&this.tabMark(e,s,t,i,r,o),this.pageContext.letterSpacing=s.characterSpacing*this.documentHelper.zoomFactor+"pt",this.pageContext.save(),this.pageContext.scale(h,1),this.pageContext.fillText(this.replaceSpace(c),this.getScaledValue(t+r,1)/h,this.getScaledValue(i+o,2),this.getScaledValue(e.width))):(this.pageContext.letterSpacing=s.characterSpacing*this.documentHelper.zoomFactor+"pt",this.pageContext.save(),this.pageContext.scale(h,1),this.pageContext.fillText(c,this.getScaledValue(t+r,1)/h,this.getScaledValue(i+o,2),this.getScaledValue(e.width))),this.pageContext.restore(),u&&(this.pageContext.direction="ltr",t-=e.width),"None"===s.underline||je(s.underline)||this.renderUnderline(e,t,i,n,l,s.underline,p),"None"!==g&&this.renderStrikeThrough(e,t,i,s.strikethrough,l,p)},Ssi.prototype.getDefaultFontColor=function(e){return Y.isVeryDark(e)?"#FFFFFF":"#000000"},Ssi.prototype.renderTextElementBox=function(e,t,i,n){var o=!1,r=e.line.paragraph.containerWidget,s=(r instanceof Uai&&(o="Exactly"===r.ownerRow.rowFormat.heightType),e.margin.top),a=e.margin.left,l=(o&&r instanceof Uai&&(h=r.width+r.margin.left+r.margin.right-r.leftBorderWidth,this.clipRect(r.x-r.margin.left,r.y,this.getScaledValue(h),this.getScaledValue(r.height))),e.characterFormat),h=!0,d=("NoColor"!=l.highlightColor&&""==e.text.trim()&&(d=e.line.paragraph.firstChild,u=e.line.paragraph.lastChild,!je(d)&&d instanceof Gai&&0<d.children.length&&e===d.children[0]&&(h=!1),!je(u))&&u instanceof Gai&&0<u.children.length&&e===u.children[u.children.length-1]&&(h=!1),"NoColor"!==l.highlightColor&&h&&("#"!==l.highlightColor.substring(0,1)?this.pageContext.fillStyle=Y.getHighlightColorCode(l.highlightColor):this.pageContext.fillStyle=Y.getColor(l.highlightColor),this.pageContext.fillRect(Math.floor(this.getScaledValue(t+a,1)),Math.floor(this.getScaledValue(i+s,2)-1),Math.ceil(this.getScaledValue(e.width)+1),Math.ceil(this.getScaledValue(e.height)+1))),this.checkRevisionType(e)),p=0<d.length?this.getRevisionColor(d):l.fontColor,c=(this.pageContext.textBaseline="alphabetic",l.bidi||this.documentHelper.textHelper.isRTLText(e.text)),u=c||l.complexScript,h=u?l.boldBidi?"bold":"":l.bold?"bold":"",g=u?l.italicBidi?"italic":"":l.italic?"italic":"",u=0===l.fontSize?.5:(u?l.fontSizeBidi:l.fontSize)/("Normal"===l.baselineAlignment?1:1.5),m=(u=this.isPrinting?u:u*this.documentHelper.zoomFactor,this.documentHelper.textHelper.getFontNameToRender(e.scriptType,l)),h=(this.pageContext.font=h+" "+g+" "+u+'pt "'+m+'"',"Subscript"===l.baselineAlignment&&(s+=e.height-e.height/1.5),e.baselineOffset),s="Normal"===l.baselineAlignment?s+h:s+h/1.5,u=("empty"===p||"#00000000"===p?(g=this.getBackgroundColorHeirachy(e),this.pageContext.fillStyle=this.getDefaultFontColor(g)):this.pageContext.fillStyle=Y.getColor(p),this.getScaledValue(e.width)),m=e.text,g=(e instanceof Ili&&(""!==(h=e).tabText||je(h.tabLeader)||"None"===h.tabLeader?""!==h.tabText&&(m=h.tabText):(m=this.getTabLeader(e),h.tabText=m)),m=this.documentHelper.textHelper.setText(m,c,l.bdo,!0),l.allCaps&&(m=m.toUpperCase()),e.characterRange),h=((g==aJt.WordSplit||(g&aJt.WordSplit)==aJt.WordSplit&&(g&aJt.RightToLeft)==aJt.RightToLeft)&&l.bidi&&(m=this.inverseCharacter(m)),l.scaling<100?1:l.scaling/100);if(g!==aJt.RightToLeft||Y.startsWith(m," ")||(this.pageContext.direction="rtl",t+=e.width),this.documentHelper.owner.documentEditorSettings.showHiddenMarks&&!this.isPrinting)(e instanceof Ili||e instanceof pli)&&"\t"===e.text&&this.tabMark(e,l,t,i,a,s),"\r"===m&&(m=String.fromCharCode(182)),this.pageContext.letterSpacing=l.characterSpacing*this.documentHelper.zoomFactor+"pt",this.pageContext.save(),this.pageContext.scale(h,1),this.pageContext.fillText(this.replaceSpace(m),this.getScaledValue(t+a,1)/h,this.getScaledValue(i+s,2),u);else if(this.pageContext.letterSpacing=l.characterSpacing*this.documentHelper.zoomFactor+"pt",this.pageContext.save(),this.pageContext.scale(h,1),e.paragraph.containerWidget.containerShape&&"Center"==e.paragraph.containerWidget.textVerticalAlignment){var f=e.paragraph.containerWidget.containerShape.height,y=this.getScaledValue(i+s,2)+this.getScaledValue(f)/4.5,v=0;if(e.paragraph.containerWidget.childWidgets&&0<e.paragraph.containerWidget.childWidgets.length)for(var b=0;b<e.paragraph.containerWidget.childWidgets.length;b++)v+=e.paragraph.containerWidget.childWidgets[b].height;v+this.getScaledValue(f)/2<this.getScaledValue(f)?this.pageContext.fillText(m,this.getScaledValue(t+a,1)/h,y,u):this.pageContext.fillText(m,this.getScaledValue(t+a,1)/h,this.getScaledValue(i+s,2),u)}else if(e.paragraph.containerWidget.containerShape&&"Bottom"==e.paragraph.containerWidget.textVerticalAlignment){f=e.paragraph.containerWidget.containerShape.height,y=this.getScaledValue(i+s,2)+this.getScaledValue(f)/2,v=0;if(e.paragraph.containerWidget.childWidgets&&0<e.paragraph.containerWidget.childWidgets.length)for(b=0;b<e.paragraph.containerWidget.childWidgets.length;b++)v+=e.paragraph.containerWidget.childWidgets[b].height;v+this.getScaledValue(f)/2<this.getScaledValue(f)?this.pageContext.fillText(m,this.getScaledValue(t+a,1)/h,y,u):this.pageContext.fillText(m,this.getScaledValue(t+a,1)/h,this.getScaledValue(i+s,2),u)}else this.pageContext.fillText(m,this.getScaledValue(t+a,1)/h,this.getScaledValue(i+s,2),u);if(this.pageContext.restore(),g!==aJt.RightToLeft||Y.startsWith(m," ")||(this.pageContext.direction="ltr",t-=e.width),this.documentHelper.owner.isSpellCheck&&this.documentHelper.owner.isSpellCheck&&!this.spellChecker.removeUnderline&&(this.documentHelper.triggerSpellCheck||e.canTrigger)&&" "!==e.text&&""!==e.text.trim()&&!this.documentHelper.textHelper.containsSpecialCharAlone(e.text)&&!this.documentHelper.isScrollHandler&&(je(e.previousNode)||!(e.previousNode instanceof Zai&&2===e.previousNode.fieldType))){e.canTrigger=!0,this.leftPosition=this.pageLeft,this.topPosition=this.pageTop;f=!1;if(!(f=!je(e.revisions)&&0<e.revisions.length?"Deletion"===e.revisions[0].revisionType:f)){var w=this.spellChecker.checktextElementHasErrors(e.text,e,t);if(w.errorFound&&!this.isPrinting)for(var p="#FF0000",C=(r instanceof Uai?r.cellFormat.shading:this.documentHelper).backgroundColor,S=this.spellChecker.errorWordCollection,b=0;b<w.elements.length;b++){var A=w.elements[b],x=this.spellChecker.manageSpecialCharacters(A.text,void 0,!0);-1===e.ignoreOnceItems.indexOf(x)&&(c?this.renderWavyLine(A,je(A.end)?t:A.end.location.x,i,n,p,"Single",l.baselineAlignment,C):this.renderWavyLine(A,je(A.start)?t:A.start.location.x,i,n,p,"Single",l.baselineAlignment,C),S.containsKey(x))&&-1===(x=S.get(x)).indexOf(A)&&x.push(A)}else(e.ischangeDetected||this.documentHelper.triggerElementsOnLoading)&&(this.handleChangeDetectedElements(e,n,t,i,l.baselineAlignment),e.isSpellCheckTriggered=!0)}}y=this.getRevisionType(d,!0);("None"===l.underline||je(l.underline))&&(je(y)||"Insertion"!==y.type&&"MoveTo"!==y.type)||this.renderUnderline(e,t,i,n,p,l.underline,l.baselineAlignment,y),y=this.getRevisionType(d,!1),("None"===l.strikethrough||je(l.strikethrough))&&(je(y)||"Deletion"!==y.type&&"MoveFrom"!==y.type)||this.renderStrikeThrough(e,t,i,l.strikethrough,p,l.baselineAlignment,y),o&&this.pageContext.restore()},Ssi.prototype.tabMark=function(e,t,i,n,o,r){var s=e.paragraph.bidi?String.fromCharCode(8592):String.fromCharCode(8594),a=this.documentHelper.textHelper.getWidth(s,t,e.scriptType),l=e.width/2,h=a/2,t=(this.pageContext.font=this.retriveCharacterformat(e.characterFormat),this.pageContext.letterSpacing=t.characterSpacing*this.documentHelper.zoomFactor+"pt",this.pageContext.save(),t.scaling<100?1:t.scaling/100);this.pageContext.scale(t,1),a<l?this.pageContext.fillText(s,this.getScaledValue(i+o+l-h,1)/t,this.getScaledValue(n+r,2)):this.pageContext.fillText(s,this.getScaledValue(i+o,1)/t,this.getScaledValue(n+r,2),this.getScaledValue(e.width)),this.pageContext.restore()},Ssi.prototype.replaceSpace=function(e){return e=(e=e.replace(new RegExp(String.fromCharCode(32),"g"),String.fromCharCode(183))).replace(new RegExp(String.fromCharCode(160),"g"),String.fromCharCode(176))},Ssi.prototype.inverseCharacter=function(e){switch(e){case String.fromCharCode(40):return String.fromCharCode(41);case String.fromCharCode(41):return String.fromCharCode(40);case String.fromCharCode(60):return String.fromCharCode(62);case String.fromCharCode(62):return String.fromCharCode(60);case String.fromCharCode(123):return String.fromCharCode(125);case String.fromCharCode(125):return String.fromCharCode(123);case String.fromCharCode(91):return String.fromCharCode(93);case String.fromCharCode(93):return String.fromCharCode(91);default:return e}},Ssi.prototype.getBackgroundColorHeirachy=function(e){if(e.paragraph.isInsideTable){var t=e.paragraph.containerWidget,i=t.cellFormat.shading.backgroundColor,n=t.cellFormat.shading.foregroundColor;if(t.cellFormat.shading.hasValue("textureStyle")&&"empty"===n&&("empty"===i||"#00000000"===i))return this.drawTextureStyle(t.cellFormat.shading.textureStyle,Y.getColor(n),Y.getColor(i),!0,!0);if("empty"!==i&&"#00000000"!==i)return i;if("empty"!==(i=t.ownerTable.tableFormat.shading.backgroundColor)&&"#00000000"!==i)return i}else if(e.paragraph.containerWidget instanceof Zli&&!je(e.paragraph.containerWidget.containerShape)&&!je(e.paragraph.containerWidget.containerShape.fillFormat)&&"#000000FF"===e.paragraph.containerWidget.containerShape.fillFormat.color)return e.paragraph.containerWidget.containerShape.fillFormat.color;return this.documentHelper.backgroundColor},Ssi.prototype.handleChangeDetectedElements=function(i,n,o,r,s){var a=this,l=i.text.trim(),h=this.pageIndex;if("\v"!==i.text&&!this.spellChecker.checkElementCanBeCombined(i,n,h,!0)){var e=l.split(/[\s]+/),t=i.line.getOffset(i,0);if(1<e.length){if(i.previousElement instanceof Zai)for(var d=0;d<i.line.children.length;d++)i.line.children[d]instanceof Zai&&t--;for(d=0;d<e.length;d++){var p=e[d],c=this.spellChecker.manageSpecialCharacters(p,void 0,!0);-1===this.spellChecker.ignoreAllItems.indexOf(c)&&-1===i.ignoreOnceItems.indexOf(c)&&(this.handleUnorderedElements(c,i,n,d,t,d===e.length-1,h),t+=p.length+1)}}else{var u,g,m,f,c=this.spellChecker.manageSpecialCharacters(l,void 0,!0);0<l.length&&(-1===this.spellChecker.ignoreAllItems.indexOf(c)&&-1===i.ignoreOnceItems.indexOf(c)&&(u=i.indexInOwner,g=i.line.paragraph.indexInOwner,(m=this.spellChecker.checkSpellingInPageInfo(c)).isElementPresent&&this.spellChecker.enableOptimizedSpellCheck?(f=JSON.parse('{"HasSpellingError":'+m.hasSpellError+"}"),this.spellChecker.handleWordByWordSpellCheck(f,i,o,r,n,s,!0)):this.spellChecker.isInUniqueWords(c)?(m=!!this.spellChecker.isErrorWord(c),f=JSON.parse('{"HasSpellingError":'+m+"}"),this.spellChecker.handleWordByWordSpellCheck(f,i,o,r,n,s,!0)):this.documentHelper.owner.editorModule.triggerPageSpellCheck&&!this.documentHelper.triggerElementsOnLoading||!this.documentHelper.triggerSpellCheck||this.spellChecker.callSpellChecker(this.spellChecker.languageID,l,!0,this.spellChecker.allowSpellCheckAndSuggestion).then(function(e){var t,e=JSON.parse(e);je(a.spellChecker)||(t=(h===a.pageIndex||i.isVisible)&&u===i.indexInOwner&&g===i.line.paragraph.indexInOwner,a.spellChecker.handleWordByWordSpellCheck(e,i,o,r,n,s,t,l))})),i.ischangeDetected=!1)}}},Ssi.prototype.handleUnorderedElements=function(t,i,n,o,r,s,e){var a,l,h,d=this,p=i.indexInOwner,c=i.line.paragraph.indexInOwner;0<t.length&&((l=this.spellChecker.checkSpellingInPageInfo(t)).isElementPresent&&this.spellChecker.enableOptimizedSpellCheck?(h=JSON.parse('{"HasSpellingError":'+l.hasSpellError+"}"),this.spellChecker.handleSplitWordSpellCheck(h,t,i,!0,n,o,r,s)):(a=i.isVisible&&p===i.indexInOwner&&c===i.line.paragraph.indexInOwner,this.spellChecker.isInUniqueWords(t)?(l=!!this.spellChecker.isErrorWord(t),h=JSON.parse('{"HasSpellingError":'+l+"}"),this.spellChecker.handleSplitWordSpellCheck(h,t,i,a,n,o,r,s)):this.documentHelper.owner.editorModule.triggerPageSpellCheck&&!this.documentHelper.triggerElementsOnLoading||!this.documentHelper.triggerSpellCheck||(this.spellChecker.callSpellChecker(this.spellChecker.languageID,t,!0,this.spellChecker.allowSpellCheckAndSuggestion).then(function(e){e=JSON.parse(e);je(d.spellChecker)||d.spellChecker.handleSplitWordSpellCheck(e,t,i,a,n,o,r,s)}),i.ischangeDetected=!1)))},Ssi.prototype.renderWavyLine=function(e,t,i,n,o,r,s,a){var l,h,d,p;this.isPrinting||1<e.text.length&&(d=e.height/("Normal"===s?1:1.5),p=e.margin.top,h=d/20,l=0,"Subscript"===s||e instanceof lhi?(l=d-2*h+i,l+=0<(p+=e.height-d)?p:0):l=n+i,s=this.spellChecker.getSpecialCharactersInfo(e),h=this.spellChecker.getWhiteSpaceCharacterInfo(e),d=(t+s.beginningWidth+(h.isBeginning?h.width:0)+e.margin.left)*this.documentHelper.zoomFactor+this.leftPosition,p=l*this.documentHelper.zoomFactor+this.topPosition,n=d+this.getScaledValue(e.width-(s.beginningWidth+s.endWidth)-h.width),i=new kri(d,p),t=new kri(n,p),this.drawWavy(i,t,.5*(n-d),1,.7,o,e.height,a))},Ssi.prototype.drawWavy=function(e,t,i,n,o,r,s,a,l){this.pageContext.save(),this.pageContext.fillStyle=je(a)?this.documentHelper.backgroundColor:a,this.pageContext.fillRect(e.x,e.y-n,t.x-e.x,3*n),this.pageContext.restore(),this.pageContext.lineWidth=1,this.pageContext.lineCap="round",this.pageContext.strokeStyle=r,this.pageContext.beginPath();for(var h,d,a=e.x,r=e.y,p=t.x,t=t.y,c=0,u=Math.atan2(t-r,p-a),g=Math.sqrt((a-p)*(a-p)+(r-t)*(r-t)),m=+n,f=Math.PI*i;c<=g;c+=o)d=Math.sin(c/g*f)*m,h=e.x+Math.cos(u)*c+Math.cos(u-Math.PI/2)*d,d=e.y+Math.sin(u)*c+Math.sin(u-Math.PI/2)*d,0<c?this.pageContext.lineTo(h,d):this.pageContext.moveTo(h,d);this.pageContext.stroke(),this.pageContext.restore()},Ssi.prototype.getTabLeader=function(e){var t=this.getTabLeaderString(e.tabLeader),i=t,n=this.documentHelper.textHelper.getWidth(i,e.characterFormat,e.scriptType),o=Math.floor(e.width/n);0==n&&(o=0);for(var r=0;r<=o;r++)i+=t;return i.slice(0,-1)},Ssi.prototype.getTabLeaderString=function(e){var t="";switch(e){case"Dot":t=".";break;case"Hyphen":t="-";break;case"Underscore":case"Single":t="_"}return t},Ssi.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()},Ssi.prototype.getTrimmedWidth=function(e){var t=e.width;return t=e instanceof pli&&!(e instanceof Ili)&&je(e.nextNode)?this.documentHelper.textHelper.getWidth(Y.trimEnd(e.text),e.characterFormat,e.scriptType):t},Ssi.prototype.renderUnderline=function(e,t,i,n,o,r,s,a){var l=e.height/("Normal"===s?1:1.5),h=e.margin.top,d=l/20,p=0,c=l/20,u=("Subscript"===s||e instanceof lhi?(p=l-2*d+i,p+=0<(h+=e.height-l)?h:0):p=n+i,0);for("Double"===(r=je(a)?r:"MoveTo"===a.type?"Double":"Single")&&(p-=c),e instanceof rhi&&(d=.9);u<("Double"===r?2:1);){u++;var g=this.getTrimmedWidth(e);this.pageContext.fillRect(this.getScaledValue(t+e.margin.left,1),this.getScaledValue(p,2),this.getScaledValue(g),this.getScaledValue(d)),p+=2*c}},Ssi.prototype.renderStrikeThrough=function(e,t,i,n,o,r,s){var a=e.height/("Normal"===r?1:1.5),l=e.margin.top,h=("Subscript"===r&&(l+=e.height-a),i+=0<l?l:0,a/20),d=a/2+.5*h,p=0;for(je(s)||(n="Deletion"===s.type?"SingleStrike":"DoubleStrike"),e instanceof rhi&&(h=.9),"DoubleStrike"===n&&(d-=h);p<("DoubleStrike"===n?2:1);){p++;var c=this.getTrimmedWidth(e);this.pageContext.fillRect(this.getScaledValue(t+e.margin.left,1),this.getScaledValue(d+i,2),this.getScaledValue(c),this.getScaledValue(h)),d+=2*h}},Ssi.prototype.renderImageElementBox=function(i,t,n,e){var o=this,r=i.margin.top,s=i.margin.left,a=this.checkRevisionType(i),l=0<a.length?this.getRevisionColor(a):"black",h=!(this.pageContext.textBaseline="top"),d=i.line.paragraph.containerWidget,p=!1,c=this.getScaledValue(t+s,1),u=this.getScaledValue(n+r,2),g=this.getScaledValue(i.width),m=this.getScaledValue(i.height);if(d instanceof Uai&&(p="Exactly"===d.ownerRow.rowFormat.heightType),"Inline"===i.textWrappingStyle&&(r<0||i.line.paragraph.width<i.width?d instanceof Uai&&(d.childWidgets[v=0]instanceof Lai&&(v=d.childWidgets[0].paragraphFormat.leftIndent),v=d.width+d.margin.left-d.leftBorderWidth-v,h=!0,this.clipRect(t+s,n+r,this.getScaledValue(v),this.getScaledValue(d.height))):p&&(v=d.width+d.margin.left-d.leftBorderWidth,h=!0,this.clipRect(d.x,d.y,this.getScaledValue(v),this.getScaledValue(d.height)))),i.isMetaFile&&!je(i.metaFileImageString))i.isCrop?this.pageContext.drawImage(i.element,i.cropX,i.cropY,i.cropWidth,i.cropHeight,c,u,g,m):this.pageContext.drawImage(i.element,c,u,g,m);else{var f="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";try{var y=this;i.element.onload=function(){var e=i.element.getAttribute("lastLoaded");je(y.documentHelper)||e===i.element.src||(i.isCrop?y.pageContext.drawImage(i.element,i.cropX,i.cropY,i.cropWidth,i.cropHeight,c,u,g,m):y.pageContext.drawImage(i.element,c,u,g,m))},i.element.onerror=function(){var e=f,t=o.documentHelper.getImageString(i);t&&(Y.startsWith(t,"http://")||Y.startsWith(t,"https://"))&&(t=o.viewer.documentHelper.images.get(parseInt(i.imageString)))&&1<t.length&&(e=t[1]),i.element.src=e},i.isCrop?this.pageContext.drawImage(i.element,i.cropX,i.cropY,i.cropWidth,i.cropHeight,c,u,g,m):this.pageContext.drawImage(i.element,c,u,g,m)}catch(e){p=this.documentHelper.getImageString(i);p&&(Y.startsWith(p,"http://")||Y.startsWith(p,"https://"))?(v=this.viewer.documentHelper.images.get(parseInt(i.imageString)))&&1<v.length?i.element.src=v[1]:i.element.src=f:(i.imageString=f,this.documentHelper.addBase64StringInCollection(i),i.element.src=this.documentHelper.getImageString(i)),this.pageContext.drawImage(i.element,this.getScaledValue(t+s,1),this.getScaledValue(n+r,2),this.getScaledValue(i.width),this.getScaledValue(i.height))}}this.pageContext.fillStyle=Y.getColor(l);var v,d=this.getRevisionType(a,!1);je(d)||"Deletion"!==d.type&&"MoveFrom"!==d.type||this.renderStrikeThrough(i,t,n,"SingleStrike",l,"Normal",d),je(d=this.getRevisionType(a,!0))||"Insertion"!==d.type&&"MoveTo"!==d.type||(p=this.getUnderlineYPosition(i.line),this.renderUnderline(i,t,n,p,l,"Single","Normal")),this.documentHelper.owner.picturePositionY=this.getScaledValue(n+r,2),je(this.documentHelper.selection)||!this.documentHelper.selection.checkContentControlLocked()||this.documentHelper.selection.start.currentWidget!==i.line||je(v=this.documentHelper.owner.getImageContentControl())||"Picture"!=v.contentControlProperties.type||(s=i.characterFormat,v.contentControlProperties.color,this.renderImgBorder(i,t,n,"black","Solid",.5,s.baselineAlignment)),h&&this.pageContext.restore()},Ssi.prototype.renderTableOutline=function(e){var t=new dsi(this.documentHelper),i=e,n=(e.width=this.documentHelper.layout.getTableWidth(i),i.isBidiTable?t.getTableRightBorder(i.tableFormat.borders):t.getTableLeftBorder(i.tableFormat.borders)),o=Y.convertPointToPixel(n.getLineWidth());this.renderSingleBorder(n.color,e.x-e.margin.left-o/2,e.y,e.x-e.margin.left-o/2,e.y+e.height,o,n.lineStyle),n=t.getTableTopBorder(i.tableFormat.borders),o=Y.convertPointToPixel(n.getLineWidth()),this.renderSingleBorder(n.color,e.x-e.margin.left-o,e.y-o/2,e.x+e.width+o+e.margin.right,e.y-o/2,o,n.lineStyle),n=i.isBidiTable?t.getTableLeftBorder(i.tableFormat.borders):t.getTableRightBorder(i.tableFormat.borders),o=Y.convertPointToPixel(n.getLineWidth()),this.renderSingleBorder(n.color,e.x+e.width+e.margin.right+o/2,e.y,e.x+e.width+e.margin.right+o/2,e.y+e.height,o,n.lineStyle),n=t.getTableBottomBorder(i.tableFormat.borders),o=Y.convertPointToPixel(n.getLineWidth()),this.renderSingleBorder(n.color,e.x-e.margin.left-o,e.y+e.height-o/2,e.x+e.width+o+e.margin.right,e.y+e.height-o/2,o,n.lineStyle)},Ssi.prototype.renderTableCellOutline=function(e,t){var e=e.layout,i=t,n=0,o=0,r=0,s=0,a=0,l=t.ownerTable.isBidiTable,s=(i.cellFormat.borders,t.containerWidget instanceof jai&&(o=t.margin.bottom-t.containerWidget.bottomBorderWidth,n=t.margin.top-t.containerWidget.topBorderWidth),r=t.margin.left-t.leftBorderWidth,t.margin.right-t.rightBorderWidth),a=je(i.ownerRow)||"Exactly"!==i.ownerRow.rowFormat.heightType?!je(i.ownerRow)&&[i.ownerRow].length<=1?Math.max(Y.convertPointToPixel(i.ownerRow.rowFormat.height),t.height)+n+o:t.height+n+o:Y.convertPointToPixel(i.ownerRow.rowFormat.height)+n+o,h=l?Uai.getCellRightBorder(i):Uai.getCellLeftBorder(i),d=0,a=(d=Y.convertPointToPixel(h.getLineWidth()),this.renderCellBackground(a,t,r,s,d),d);if(0===i.index||1===i.cellFormat.rowSpan||1<i.cellFormat.rowSpan&&0===i.columnIndex)this.renderSingleBorder(h.color,t.x-r-d,t.y-t.margin.top,t.x-r-d,t.y+t.height+o,d,h.lineStyle);else for(var p=0;p<i.ownerTable.childWidgets.length;p++){for(var c=i.ownerTable.childWidgets[p],u=void 0,g=0;g<c.childWidgets.length;g++){var m=c.childWidgets[g];if(l?m.columnIndex===i.columnIndex+i.cellFormat.columnSpan:m.columnIndex+m.cellFormat.columnSpan-1==i.columnIndex-1){u=m;break}if(!l&&m.columnIndex>=i.columnIndex&&m.previousWidget){u=m.previousWidget;break}}if(u&&(l?u.columnIndex===i.columnIndex+i.cellFormat.columnSpan:u.columnIndex+u.cellFormat.columnSpan-1==i.columnIndex-1)){var f=l?Uai.getCellLeftBorder(u):Uai.getCellRightBorder(u),y=Y.convertPointToPixel(f.getLineWidth()),r=i.margin.left-y;if(!(u.y+u.height<i.y))if(u.y<i.y&&u.y+u.height>i.y)this.renderSingleBorder(f.color,i.x-r-y,i.y-n,i.x-r-y,u.y+u.height+u.margin.bottom,y,f.lineStyle);else if(u.y===i.y||u.y>i.y&&u.y+u.height<i.y+i.height)this.renderSingleBorder(f.color,i.x-r-y,u.y-u.margin.top,i.x-r-y,u.y+u.height+u.margin.bottom,y,f.lineStyle);else if(u.y<i.y+i.height&&u.y+u.height>=i.y+i.height)this.renderSingleBorder(f.color,i.x-r-y,u.y-u.margin.top,i.x-r-y,u.y+u.height+o,y,f.lineStyle);else if(u.y>i.y+i.height)break}}if(i.updatedTopBorders&&1<i.updatedTopBorders.length)for(var v=l?t.x+t.width+t.margin.right-a/2:t.x-t.margin.left-a/2,b=t.y-t.margin.top,w=0;w<i.updatedTopBorders.length;w++){var C=i.updatedTopBorders[w];"None"!==(h=C.border).lineStyle&&h.lineWidth<Uai.getCellTopBorder(i).lineWidth&&(h.lineWidth=Uai.getCellTopBorder(i).lineWidth),je(h)||(d=Y.convertPointToPixel(h.getLineWidth()),this.renderSingleBorder(h.color,v,b+d/2,v+(l?-C.width:C.width),b+d/2,d,h.lineStyle),v+=l?-C.width:C.width)}else{h=Uai.getCellTopBorder(i);d=Y.convertPointToPixel(h.getLineWidth());this.renderSingleBorder(h.color,t.x-t.margin.left-a/2,t.y-t.margin.top+d/2,t.x+t.width+t.margin.right+0,t.y-t.margin.top+d/2,d,h.lineStyle)}for(var S=!1,S=l?0===i.columnIndex:i.cellIndex===i.ownerRow.childWidgets.length-1,A=i.containerWidget.getPreviousRowSpannedCells(),x=!1,I=0;I<A.length;I++){var T=A[I];if(i.rowIndex<T.rowIndex+T.cellFormat.rowSpan&&i.columnIndex<T.columnIndex){x=!0;break}}!(0<i.ownerTable.tableFormat.cellSpacing||S)||!l&&i.columnIndex+i.cellFormat.columnSpan!==i.ownerTable.tableHolder.columns.length&&x||(h=l?Uai.getCellLeftBorder(i):Uai.getCellRightBorder(i),d=Y.convertPointToPixel(h.getLineWidth()),this.renderSingleBorder(h.color,t.x+t.width+t.margin.right-d/2,t.y-t.margin.top,t.x+t.width+t.margin.right-d/2,t.y+t.height+o,d,h.lineStyle));var E=i.ownerRow.nextWidget,D=!1,M=void 0,k=(je(E)||(k=void(E.lastChild&&(M=(k=E.lastChild).columnIndex+k.cellFormat.columnSpan)),(k=E)instanceof jai&&t.containerWidget instanceof jai&&t.containerWidget.containerWidget instanceof _ai&&(D=-1!==t.containerWidget.containerWidget.childWidgets.indexOf(k))),!je(E)&&S&&!(0<E.rowFormat.gridAfter||0<E.rowFormat.gridBefore)&&E.lastChild.columnIndex+E.lastChild.cellFormat.columnSpan>i.ownerRow.lastChild.columnIndex&&E.lastChild.columnIndex+E.lastChild.cellFormat.columnSpan<i.ownerRow.lastChild.columnIndex+i.ownerRow.lastChild.cellFormat.columnSpan&&!je(E.childWidgets)&&E.childWidgets.length<i.ownerRow.childWidgets.length+i.cellFormat.columnSpan-1&&t.x+t.width>E.lastChild.x+E.lastChild.width+E.lastChild.margin.right&&"Cleared"!==i.cellFormat.borders.bottom.lineStyle);(0<i.ownerTable.tableFormat.cellSpacing||i.ownerRow.rowIndex===i.ownerTable.childWidgets.length-1||1<i.cellFormat.rowSpan&&i.ownerRow.rowIndex+i.cellFormat.rowSpan>=i.ownerTable.childWidgets.length||!D||this.isRenderHeader||M&&E.childWidgets.length<i.ownerRow.childWidgets.length&&M<i.columnIndex+i.cellFormat.columnSpan||!je(i.cellFormat.borders.bottom)&&"Cleared"!==i.cellFormat.borders.bottom.lineStyle&&1===i.cellFormat.rowSpan&&!l&&(!je(E)&&t.x<E.firstChild.x-E.firstChild.margin.left&&0<E.rowFormat.gridBefore&&(0!==E.rowFormat.beforeWidth||0!==E.rowFormat.gridBeforeWidth)||!je(E)&&t.x+t.width>E.lastChild.x+E.lastChild.width+E.lastChild.margin.right&&0<E.rowFormat.gridAfter&&(0!==E.rowFormat.afterWidth||0!==E.rowFormat.gridAfterWidth))||k)&&(h=(je(S=i.cellFormat.borders.bottom)||"Cleared"!==S.lineStyle)&&1<i.cellFormat.rowSpan&&i.ownerRow.rowIndex+i.cellFormat.rowSpan===i.ownerTable.childWidgets.length?i.getBorderBasedOnPriority(i.getBorderBasedOnPriority(i.cellFormat.borders.bottom,i.ownerRow.rowFormat.borders.bottom),i.ownerTable.tableFormat.borders.bottom):Uai.getCellBottomBorder(i),D=t.x-t.margin.left-a/2,S=t.x+t.width+t.margin.right,(!(M&&E.childWidgets.length<i.ownerRow.childWidgets.length&&M<i.columnIndex+i.cellFormat.columnSpan||je(E)||l||!(0<E.rowFormat.gridAfter)||0===E.rowFormat.afterWidth&&0===E.rowFormat.gridAfterWidth||je(E.lastChild)||je(Uai.getCellTopBorder(E.lastChild))||"None"===Uai.getCellTopBorder(E.lastChild).lineStyle)&&t.x<E.lastChild.x+E.lastChild.width+E.lastChild.margin.right||k)&&(D=E.lastChild.x+E.lastChild.width+E.lastChild.margin.right),!(M&&E.childWidgets.length<i.ownerRow.childWidgets.length&&M<i.columnIndex+i.cellFormat.columnSpan||je(E)||l||!(0<E.rowFormat.gridBefore)||0===E.rowFormat.beforeWidth&&0===E.rowFormat.gridBeforeWidth||je(E.firstChild)||je(Uai.getCellTopBorder(E.firstChild))||"None"===Uai.getCellTopBorder(E.firstChild).lineStyle)&&t.x+t.width>E.firstChild.x-E.firstChild.margin.left&&(S=E.firstChild.x-E.firstChild.margin.left),d=Y.convertPointToPixel(h.getLineWidth()),this.renderSingleBorder(h.color,D,t.y+t.height+o+d/2,S,t.y+t.height+o+d/2,d,h.lineStyle)),h=e.getCellDiagonalUpBorder(i),0<(d=Y.convertPointToPixel(h.getLineWidth()))&&this.renderSingleBorder(h.color,t.x-r,t.y+t.height+o,t.x+t.width+s,t.y-n,d,h.lineStyle),h=e.getCellDiagonalDownBorder(i),0<(d=Y.convertPointToPixel(h.getLineWidth()))&&this.renderSingleBorder(h.color,t.x-r,t.y-n,t.x+t.width+s,t.y+t.height+o,d,h.lineStyle)},Ssi.prototype.renderCellBackground=function(e,t,i,n,o){var r,s,a=t.cellFormat,l=t.x-i-o,h=t.margin.top-t.containerWidget.topBorderWidth,h=t.y-h,i=t.width+i+n+o/2,n=t.ownerTable.tableFormat.shading.backgroundColor,o=a.shading.backgroundColor;"empty"!==(o=0<t.ownerRow.rowFormat.revisions.length?"Insertion"===t.ownerRow.rowFormat.revisions[t.ownerRow.rowFormat.revisions.length-1].revisionType?"#e1f2fa":"#fce6f4":o)&&(r=Uai.getCellLeftBorder(t),s=Uai.getCellTopBorder(t),t===t.ownerRow.lastChild||"None"!==r.lineStyle&&"Cleared"!==r.lineStyle||(i+=.5),t.ownerRow.ownerTable.lastChild===t.ownerRow||"None"!==s.lineStyle&&"Cleared"!==s.lineStyle||(e+=.5)),0<t.ownerTable.tableFormat.cellSpacing&&this.renderBackgroundColor(n,l,h,i,e),this.renderBackgroundColor(o,l,h,i,e),a.shading.hasValue("foregroundColor")&&"TextureNone"!==a.shading.textureStyle&&(this.pageContext.beginPath(),this.pageContext.fillStyle=this.drawTextureStyle(a.shading.textureStyle,Y.getColor(a.shading.foregroundColor),Y.getColor(a.shading.backgroundColor),"empty"===a.shading.foregroundColor,"empty"===a.shading.backgroundColor),this.pageContext.fillRect(this.getScaledValue(l,1),this.getScaledValue(h,2),this.getScaledValue(i),this.getScaledValue(e)),this.pageContext.closePath())},Ssi.prototype.renderBackgroundColor=function(e,t,i,n,o){this.pageContext.beginPath(),"empty"!==e&&(this.pageContext.fillStyle=Y.getColor(e),this.pageContext.fillRect(this.getScaledValue(t,1),this.getScaledValue(i,2),this.getScaledValue(n),this.getScaledValue(o)),this.pageContext.closePath())},Ssi.prototype.drawTextureStyle=function(e,t,i,n,o){var r;return o&&(i="#ffffff"),n&&(t="#000000"),-1<e.indexOf("Percent")?(r=e.replace("Texture","").replace("Percent","").replace("Pt","."),r=parseInt(r),this.getForeColor(t,i,r,n,o)):"TextureSolid"===e?t:"#FFFFFF"},Ssi.prototype.getForeColor=function(e,t,i,n,o){var e=Y.convertHexToRgb(e),t=Y.convertHexToRgb(t),r=this.getColorValue(e.r,t.r,i,n,o),s=this.getColorValue(e.g,t.g,i,n,o),e=this.getColorValue(e.b,t.b,i,n,o);return"#"+Y.convertRgbToHex(r)+Y.convertRgbToHex(s)+Y.convertRgbToHex(e)},Ssi.prototype.getColorValue=function(e,t,i,n,o){return 100==i?e:n?o?Math.round(255*(1-i/100)):Math.round(t*(1-i/100)):o?Math.round(e*(i/100)):t+Math.round(e*(i/100))-Math.round(t*(i/100))},Ssi.prototype.renderSingleBorder=function(e,t,i,n,o,r,s){this.pageContext.beginPath(),this.pageContext.moveTo(this.getScaledValue(t,1),this.getScaledValue(i,2)),this.pageContext.lineTo(this.getScaledValue(n,1),this.getScaledValue(o,2)),this.pageContext.lineWidth=this.getScaledValue(r),this.pageContext.strokeStyle=Y.getColor(e),"None"!==s&&"Cleared"!==s&&this.pageContext.stroke(),this.pageContext.closePath()},Ssi.prototype.getScaledValue=function(e,t){return this.isPrinting?e:(je(t)&&(t=0),e*this.documentHelper.zoomFactor+(1===t?this.pageLeft:2===t?this.pageTop:0))},Ssi.prototype.checkRevisionType=function(e){for(var t=[],i=e.revisions.length,n=0;n<i;n++){var o=e.revisions[n],r=this.documentHelper.authors.get(o.author);t.push({type:o.revisionType,color:r})}return t},Ssi.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;return 0<e.length?e[0].color:void 0},Ssi.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=Y.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=Y.getColor(n.color),e.splice(i,1),n}},Ssi.prototype.getFormfieldInLine=function(e){for(var t=0;t<e.children.length;t++)if(e.children[t]instanceof Zai&&!je(e.children[t].formFieldData))return e.children[t]},Ssi.prototype.getShape=function(e){return this.shapes[e.toString()]},Ssi.prototype.destroy=function(){this.documentHelper=void 0,this.shapes=null,je(this.pageCanvasIn)||(this.pageCanvasIn.innerHTML=""),this.pageCanvasIn=void 0};var Csi=Ssi;function Ssi(e){this.commentMarkDictionary=new uJt,this.isPrinting=!1,this.isExporting=!1,this.pageLeft=0,this.pageTop=0,this.pageIndex=-1,this.isFieldCode=!1,this.isRenderHeader=!1,this.leftPosition=0,this.topPosition=0,this.height=0,this.fieldStacks=[],this.shapes={Rectangle:"M0,0 L50,0 L50,50 L0,50 z",Oval:"M80.5,12.5 C80.5,19.127417 62.59139,24.5 40.5,24.5 C18.40861,24.5 0.5,19.127417 0.5,12.5C0.5,5.872583 18.40861,0.5 40.5,0.5 C62.59139,0.5 80.5,5.872583 80.5,12.5 z",IsoscelesTriangle:"M45,0 L90,45 L0,45 L45,0 z",RightTriangle:"M836.293,292.9238 L776.293,292.9238 L776.293,254.8408 L836.293,292.9238 z",Parallelogram:"M30,0 L60,0 L45,30 L15,30 z",Trapezoid:"M 1873 358 l -506 1332 h -686 l -506 -1332 z",Diamond:"M397.784,287.875 L369.5,316.159 L341.216,287.875 L369.5,259.591 L397.784,287.875 z",RegularPentagon:"M30,0 L60,30 L50,70 L10,70 L0,30 L30,0 z",Hexagon:"M30,0 L60,0 L90,30 L60,60 L30,60 L0,30 L30,0 z",Heptagon:"M223.7783,195.7134 L207.1303,174.8364 L213.0713,148.8034 L237.1303,137.2174 L261.1883,148.8034 L267.1303,174.8364L250.4813,195.7134 L223.7783,195.7134 z",Octagon:"M98.7319,196.4653 L81.1579,178.8923 L81.1579,154.0393 L98.7319,136.4653 L123.5849,136.4653L141.1579,154.0393 L141.1579,178.8923 L123.5849,196.4653 L98.7319,196.4653 z",Decagon:"M657.3379,302.4141 L642.3369,291.5161 L636.6089,273.8821 L642.3369,256.2481 L657.3379,245.3511 L675.8789,245.3511L690.8789,256.2481 L696.6089,273.8821L690.8789,291.5161 L675.8789,302.4141 L657.3379,302.4141 z",Dodecagon:"M-69.20000457763672,-17.685555555555553L-50.656966313962585,-48.31444444444445L-18.543038263674127,-66L18.543038263674134,-66L50.656966313962585,-48.31444444444445L69.20000457763672,-17.685555555555553L69.20000457763672,17.685555555555553L50.656966313962585,48.31444444444445L18.543038263674134,66L-18.543038263674127,66L-50.656966313962585,48.31444444444445L-69.20000457763672,17.685555555555553Z",Pie:"M 1024 1894 q -120 0 -231 -31 q -111 -31 -208 -88 q -97 -57 -176 -136 q -79 -79 -136 -176 q -57 -97 -88 -208 q -31 -111 -31 -231 q 0 -109 26 -212 q 26 -102 75 -194 q 48 -92 117 -170 q 68 -78 153 -138 q 84 -59 183 -98 q 99 -39 207 -52 l 58 -7 v 922 h 922 l -7 58 q -13 109 -52 207 q -39 99 -98 183 q -60 85 -138 153 q -78 69 -170 117 q -92 49 -194 75 q -103 26 -212 26 z",Chord:"M 1024 1894 q -120 0 -231 -31 q -111 -31 -208 -88 q -97 -57 -176 -136 q -79 -79 -136 -176 q -57 -97 -88 -208 q -31 -111 -31 -231 q 0 -116 29 -224 q 29 -108 82 -203 q 53 -94 128 -173 q 75 -79 167 -137 q 92 -57 198 -92 q 106 -34 222 -40 l 23 -1 l 891 891 l -1 23 q -6 116 -40 222 q -35 106 -92 198 q -58 92 -137 167 q -79 75 -173 128 q -95 53 -203 82 q -108 29 -224 29 z",Teardrop:"M 1024 1894 q -120 0 -231 -31 q -111 -31 -208 -88 q -97 -57 -176 -136 q -79 -79 -136 -176 q -57 -97 -88 -208 q -31 -111 -31 -231 q 0 -120 31 -231 q 31 -111 88 -208 q 57 -97 136 -176 q 79 -79 176 -136 q 97 -57 208 -88 q 111 -31 231 -31 h 870 v 870 q 0 120 -31 231 q -31 111 -88 208 q -57 97 -136 176 q -79 79 -176 136 q -97 57 -208 88 q -111 31 -231 31 z",Frame:"M 1894 154 v 1740 h -1740 v -1740 m 1433 307 h -1126 v 1126 h 1126 z",HalfFrame:"M 154 154 h 1668 l -307 307 h -1054 v 1054 l -307 307 z",L_Shape:"M 870 154 v 1024 h 1024 v 716 h -1740 v -1740 z",DiagonalStripe:"M 154 943 l 789 -789 h 879 l -1668 1668 z",Cross:"M 666 1894 v -512 h -512 v -716 h 512 v -512 h 716 v 512 h 512 v 716 h -512 v 512 z",Plaque:"M 563 1894 v -51 q 0 -66 -31 -131 q -31 -64 -81 -115 q -51 -50 -115 -81 q -65 -31 -131 -31 h -51 v -922 h 51 q 66 0 131 -31 q 64 -31 115 -82 q 50 -50 81 -115 q 31 -64 31 -130 v -51 h 922 v 51 q 0 66 31 130 q 31 65 82 115 q 50 51 115 82 q 64 31 130 31 h 51 v 922 h -51 q -66 0 -130 31 q -65 31 -115 81 q -51 51 -82 115 q -31 65 -31 131 v 51 z",Cube:"M 1946 102 v 1280 l -564 564 h -1280 v -1280 l 564 -564 m 665 615 h -1126 v 1126 h 1126 m 51 -1229 l 410 -409 h -1075 l -410 409 m 1536 -307 l -409 410 v 1024 l 409 -410 z",Bevel:"M 1946 102 v 1844 h -1844 v -1844 m 175 103 l 205 205 h 1084 l 205 -205 m -235 1331 v -1024 h -1024 v 1024 m -307 235 l 205 -205 v -1084 l -205 -205 m 1566 1566 l -205 -205 h -1084 l -205 205 m 1566 -1566 l -205 205 v 1084 l 205 205 z",Donut:"M 1024 154 q 120 0 231 31 q 111 31 208 88 q 97 57 176 136 q 79 79 136 176 q 57 97 88 208 q 31 111 31 231 q 0 120 -31 231 q -31 111 -88 208 q -57 97 -136 176 q -79 79 -176 136 q -97 57 -208 88 q -111 31 -231 31 q -120 0 -231 -31 q -111 -31 -208 -88 q -97 -57 -176 -136 q -79 -79 -136 -176 q -57 -97 -88 -208 q -31 -111 -31 -231 q 0 -120 31 -231 q 31 -111 88 -208 q 57 -97 136 -176 q 79 -79 176 -136 q 97 -57 208 -88 q 111 -31 231 -31 m 0 1331 q 95 0 179 -37 q 84 -36 147 -99 q 62 -62 99 -146 q 36 -84 36 -179 q 0 -95 -36 -179 q -37 -84 -99 -147 q -63 -62 -147 -99 q -84 -36 -179 -36 q -95 0 -179 36 q -84 37 -146 99 q -63 63 -99 147 q -37 84 -37 179 q 0 95 37 179 q 36 84 99 146 q 62 63 146 99 q 84 37 179 37 z",NoSymbol:"M 1024 154 q 124 0 237 30 q 112 30 209 85 q 96 56 175 134 q 78 79 134 175 q 55 97 85 209 q 30 113 30 237 q 0 124 -30 236 q -30 113 -85 209 q -56 97 -134 175 q -79 79 -175 134 q -97 56 -209 86 q -113 30 -237 30 q -124 0 -236 -30 q -113 -30 -209 -86 q -97 -55 -175 -134 q -79 -78 -134 -175 q -56 -96 -86 -209 q -30 -112 -30 -236 q 0 -124 30 -237 q 30 -112 86 -209 q 55 -96 134 -175 q 78 -78 175 -134 q 96 -55 209 -85 q 112 -30 236 -30 m 273 1369 l -772 -772 l -28 74 q -36 96 -36 199 q 0 116 45 218 q 44 103 121 179 q 76 77 179 121 q 102 45 218 45 q 103 0 199 -36 m 328 -328 q 36 -96 36 -199 q 0 -116 -44 -219 q -45 -102 -121 -179 q -77 -76 -179 -121 q -103 -44 -219 -44 q -103 0 -199 36 l -74 28 l 772 772 z",BlockArc:"M 1485 1485 v -51 q 0 -96 -36 -180 q -37 -84 -99 -147 q -63 -62 -147 -98 q -84 -36 -179 -36 q -95 0 -179 36 q -84 36 -146 98 q -63 63 -99 147 q -37 84 -37 180 v 51 h -409 v -51 q 0 -120 31 -231 q 31 -111 88 -208 q 57 -97 136 -177 q 79 -79 176 -136 q 97 -57 208 -88 q 111 -31 231 -31 q 120 0 231 31 q 111 31 208 88 q 97 57 176 136 q 79 80 136 177 q 57 97 88 208 q 31 111 31 231 v 51 z",FoldedCorner:"M 1946 102 v 1229 l -615 615 h -1229 v -1844 m 1229 1699 l 470 -470 h -470 m 512 -1126 h -1638 v 1638 h 1024 v -614 h 614 zM 154 1894 v -1740 h 1740 v 1156 l -584 584 z",SmileyFace:"M 1024 102 q 127 0 245 33 q 118 33 221 93 q 102 60 186 144 q 84 84 144 186 q 60 103 93 221 q 33 118 33 245 q 0 127 -33 245 q -33 118 -93 220 q -60 103 -144 187 q -84 84 -186 144 q -103 60 -221 93 q -118 33 -245 33 q -127 0 -245 -33 q -118 -33 -220 -93 q -103 -60 -187 -144 q -84 -84 -144 -187 q -60 -102 -93 -220 q -33 -118 -33 -245 q 0 -127 33 -245 q 33 -118 93 -221 q 60 -102 144 -186 q 84 -84 187 -144 q 102 -60 220 -93 q 118 -33 245 -33 m 0 1741 q 113 0 218 -30 q 104 -29 195 -82 q 91 -53 166 -128 q 75 -75 128 -166 q 53 -91 83 -196 q 29 -104 29 -217 q 0 -113 -29 -218 q -30 -104 -83 -195 q -53 -91 -128 -166 q -75 -75 -166 -128 q -91 -53 -195 -83 q -105 -29 -218 -29 q -113 0 -217 29 q -105 30 -196 83 q -91 53 -166 128 q -75 75 -128 166 q -53 91 -82 195 q -30 105 -30 218 q 0 113 30 217 q 29 105 82 196 q 53 91 128 166 q 75 75 166 128 q 91 53 196 82 q 104 30 217 30 m 358 -1331 q 32 0 60 12 q 28 12 49 33 q 21 21 33 49 q 12 28 12 60 q 0 32 -12 59 q -12 28 -33 49 q -21 21 -49 33 q -28 12 -60 12 q -32 0 -59 -12 q -28 -12 -49 -33 q -21 -21 -33 -49 q -12 -27 -12 -59 q 0 -32 12 -60 q 12 -28 33 -49 q 21 -21 49 -33 q 27 -12 59 -12 m 52 102 h -103 v 103 h 103 m -768 -205 q 31 0 59 12 q 28 12 49 33 q 21 21 33 49 q 12 28 12 60 q 0 32 -12 59 q -12 28 -33 49 q -21 21 -49 33 q -28 12 -59 12 q -32 0 -60 -12 q -28 -12 -49 -33 q -21 -21 -33 -49 q -12 -27 -12 -59 q 0 -32 12 -60 q 12 -28 33 -49 q 21 -21 49 -33 q 28 -12 60 -12 m 51 102 h -103 v 103 h 103 m 823 512 q -18 87 -66 162 q -48 75 -117 130 q -69 55 -154 86 q -86 31 -179 31 q -93 0 -178 -31 q -86 -31 -155 -86 q -69 -55 -117 -130 q -48 -75 -66 -162 h 106 q 17 66 57 122 q 39 56 94 97 q 55 42 122 65 q 66 23 137 23 q 71 0 138 -23 q 66 -23 121 -65 q 55 -41 95 -97 q 39 -56 56 -122 z",Heart:"M 997 1758 q -401 -286 -612 -551 q -212 -265 -231 -504 v -101 q 9 -106 45 -187 q 35 -80 87 -135 q 52 -55 114 -85 q 62 -30 122 -36 q 21 -2 41 -3 q 19 -1 38 -1 q 67 0 119 12 q 51 13 96 38 q 44 26 85 65 q 40 39 84 91 l 39 46 l 39 -46 q 44 -52 85 -91 q 40 -39 85 -65 q 44 -25 96 -38 q 51 -12 118 -12 q 19 0 39 1 q 19 1 40 3 q 60 6 122 36 q 62 31 114 86 q 51 56 87 137 q 36 82 45 189 v 100 q -19 240 -229 503 q -211 264 -609 548 l -30 21 z",LightningBolt:"M-8,-55L7,-24L1,-20L19,6L13,11L36,55L-3,21L5,16L-19,-6L-11,-12L-36,-35Z",Sun:"M69.60002899169922,0L41.51352437242167,8.416795119701419L41.51352437242167,-8.416795119701426ZM49.209798275982905,-41.47314036934465L36.41601824906962,-18.783766017986338L22.290725499983694,-30.686752034954836ZM0,-58.64998245239259L9.988224375410937,-34.982276749768076L-9.988224375410944,-34.982276749768076ZM-49.216242723111755,-41.47314036934465L-22.290725499983694,-30.686752034954836L-36.416018249069616,-18.783766017986338ZM-69.60002899169922,0L-41.51352437242167,-8.416795119701426L-41.51352437242167,8.416795119701419ZM-49.216242723111755,41.46770981541388L-36.416018249069616,18.783766017986338L-22.290725499983694,30.68675203495485ZM0,58.64998245239259L-9.988224375410944,34.98227674976806L9.988224375410937,34.98227674976806ZM49.209798275982905,41.46770981541388L22.290725499983694,30.68675203495485L36.41601824906962,18.783766017986338ZM-34.80001449584961,0Q-34.800014495849624,-12.14680908236253,-24.607326235405417,-20.735900154279413Q-14.414637974961238,-29.32499122619629,-1.4210854715202004e-14,-29.324991226196296Q14.414637974961224,-29.324991226196293,24.60732623540541,-20.735900154279413Q34.80001449584961,-12.146809082362545,34.80001449584961,-7.105427357601002e-15Q34.80001449584961,12.146809082362523,24.60732623540541,20.735900154279406Q14.414637974961224,29.32499122619629,0,29.32499122619629Q-14.414637974961217,29.32499122619629,-24.607326235405388,20.73590015427945Q-34.8000144958496,12.146809082362552,-34.80001449584961,7.105427357601002e-15Z",Moon:"M36.80000305175781,60.90000915527344Q6.313882332939066,60.90000915527344,-15.243060359409363,43.06280944801668Q-36.80000305175781,25.22560974075992,-36.80000305175781,7.105427357601002e-15Q-36.800003051757834,-25.225609740759907,-15.243060359409384,-43.062809448016665Q6.3138823329390235,-60.90000915527342,36.8000030517578,-60.90000915527344Q6.313882332939052,-41.98080184970351,0.9246466598519447,-10.765702362004177Q-4.464589013235177,20.449397125695157,18.400001525878878,45.67500686645508Q26.28571646554125,54.375008174351294,36.800003051757784,60.90000915527344Z",Cloud:"M 1024 1792 q -60 0 -115 -20 q -55 -19 -100 -54 q -46 -34 -79 -83 q -34 -48 -50 -106 l -24 -86 l -62 65 q -37 38 -83 58 q -47 21 -101 21 q -54 0 -101 -21 q -47 -20 -81 -55 q -35 -35 -54 -83 q -20 -47 -20 -100 q 0 -48 18 -91 q 18 -42 50 -78 l 25 -28 l -19 -32 q -38 -64 -56 -135 q -18 -71 -18 -145 q 0 -116 44 -219 q 44 -102 121 -179 q 76 -76 179 -121 q 102 -44 219 -44 q 106 0 206 38 q 99 39 177 113 l 39 37 l 35 -41 q 61 -72 140 -110 q 79 -37 171 -37 q 85 0 160 32 q 74 33 130 88 q 55 56 87 130 q 32 75 32 160 q 0 70 -23 135 q -23 66 -71 123 l -28 34 l 30 32 q 45 51 69 112 q 23 61 23 127 q 0 74 -28 139 q -28 65 -76 114 q -49 49 -114 77 q -66 28 -140 28 q -63 0 -126 -24 l -44 -17 l -20 43 q -23 47 -56 84 q -34 38 -76 64 q -42 27 -90 41 q -48 14 -100 14 z",Arc:"M-1.4210854715202004e-14,-45.200008392333984Q15.408730615404892,-45.200008392334,26.304348523034477,-31.96123244390823Q37.19996643066406,-18.722456495482472,37.19996643066406,-2.1316282072803006e-14Q37.19996643066406,-1.4210854715202004e-14,37.19996643066406,-1.4210854715202004e-14",DoubleBracket:"M 717 1843 v 103 h -307 q -63 0 -119 -25 q -56 -24 -98 -66 q -42 -42 -66 -98 q -25 -56 -25 -119 v -1228 q 0 -63 25 -119 q 24 -56 66 -98 q 42 -42 98 -67 q 56 -24 119 -24 h 307 v 103 h -307 q -42 0 -79 16 q -38 16 -66 44 q -28 28 -44 65 q -16 38 -16 80 v 1228 q 0 42 16 79 q 16 38 44 66 q 28 28 66 44 q 37 16 79 16 m 1228 -1741 q 63 0 119 24 q 56 25 98 67 q 42 42 67 98 q 24 56 24 119 v 1228 q 0 63 -24 119 q -25 56 -67 98 q -42 42 -98 66 q -56 25 -119 25 h -307 v -103 h 307 q 42 0 80 -16 q 37 -16 65 -44 q 28 -28 44 -66 q 16 -37 16 -79 v -1228 q 0 -42 -16 -80 q -16 -37 -44 -65 q -28 -28 -65 -44 q -38 -16 -80 -16 h -307 v -103 z",DoubleBrace:"M 1843 1126 q -38 0 -75 8 q -37 9 -66 32 q -29 23 -46 62 q -18 40 -18 103 v 410 q 0 77 -22 118 q -23 42 -55 61 q -33 20 -68 23 q -35 3 -59 3 h -103 v -103 q 14 -1 25 -1 q 10 0 18 0 q 15 0 27 0 q 11 1 33 1 q 38 0 59 -16 q 20 -15 30 -35 q 11 -22 13 -51 v -410 q 0 -62 18 -113 q 17 -51 46 -90 q 29 -39 66 -66 q 36 -26 75 -38 q -39 -12 -75 -40 q -37 -27 -66 -67 q -29 -40 -46 -91 q -18 -50 -18 -109 v -410 q 0 -38 -16 -59 q -16 -20 -35 -30 q -23 -11 -51 -13 h -103 v -103 h 103 q 57 3 102 26 q 19 10 38 24 q 18 15 32 37 q 14 22 23 51 q 9 29 9 67 v 410 q 0 59 18 98 q 17 39 46 63 q 29 24 66 34 q 37 10 75 10 m -1638 0 q 38 0 75 -10 q 37 -10 66 -34 q 29 -24 47 -63 q 17 -39 17 -98 v -410 q 0 -38 9 -67 q 9 -29 23 -51 q 14 -22 33 -37 q 18 -14 37 -24 q 45 -23 102 -26 h 103 v 103 h -103 q -29 2 -51 13 q -20 10 -35 30 q -16 21 -16 59 v 410 q 0 59 -17 109 q -18 51 -47 91 q -29 40 -65 67 q -37 28 -76 40 q 39 12 76 38 q 36 27 65 66 q 29 39 47 90 q 17 51 17 113 v 410 q 2 29 13 51 q 10 20 31 35 q 20 16 58 16 q 22 0 33 -1 q 11 0 27 0 q 8 0 19 0 q 10 0 24 1 v 103 h -103 q -24 0 -59 -3 q -35 -3 -67 -23 q -33 -19 -55 -61 q -23 -41 -23 -118 v -410 q 0 -63 -17 -103 q -18 -39 -47 -62 q -29 -23 -66 -32 q -37 -8 -75 -8 z",LeftBracket:"M 1331 1843 v 103 h -307 q -63 0 -119 -25 q -56 -24 -98 -66 q -42 -42 -66 -98 q -24 -56 -24 -119 v -1228 q 0 -63 24 -119 q 24 -56 66 -98 q 42 -42 98 -67 q 56 -24 119 -24 h 307 v 103 h -307 q -42 0 -79 16 q -38 16 -66 44 q -28 28 -44 65 q -16 38 -16 80 v 1228 q 0 42 16 79 q 16 38 44 66 q 28 28 66 44 q 37 16 79 16 z",RightBracket:"M 1024 102 q 63 0 119 24 q 56 25 98 67 q 42 42 66 98 q 24 56 24 119 v 1228 q 0 63 -24 119 q -24 56 -66 98 q -42 42 -98 66 q -56 25 -119 25 h -307 v -103 h 307 q 42 0 80 -16 q 37 -16 65 -44 q 28 -28 44 -66 q 16 -37 16 -79 v -1228 q 0 -42 -16 -80 q -16 -37 -44 -65 q -28 -28 -65 -44 q -38 -16 -80 -16 h -307 v -103 z",LeftBrace:"M 717 922 q 38 0 75 -10 q 37 -10 66 -34 q 29 -24 47 -63 q 17 -39 17 -98 v -410 q 0 -38 9 -67 q 9 -29 23 -51 q 14 -22 33 -37 q 18 -14 37 -24 q 45 -23 102 -26 h 103 v 103 h -103 q -29 2 -51 13 q -20 10 -35 30 q -16 21 -16 59 v 410 q 0 59 -17 109 q -18 51 -47 91 q -29 40 -65 67 q -37 28 -76 40 q 39 12 76 38 q 36 27 65 66 q 29 39 47 90 q 17 51 17 113 v 410 q 2 29 13 51 q 10 20 31 35 q 20 16 58 16 q 22 0 33 -1 q 11 0 27 0 q 8 0 19 0 q 10 0 24 1 v 103 h -103 q -24 0 -59 -3 q -35 -3 -67 -23 q -33 -19 -55 -61 q -23 -41 -23 -118 v -410 q 0 -63 -17 -103 q -18 -39 -47 -62 q -29 -23 -66 -32 q -37 -8 -75 -8 z",RightBrace:"M 1229 1126 q -39 0 -75 8 q -37 9 -66 32 q -29 23 -46 62 q -18 40 -18 103 v 410 q 0 51 -10 86 q -11 35 -28 58 q -18 23 -40 35 q -22 13 -44 18 q -23 6 -45 7 q -22 1 -38 1 h -102 v -103 q 14 -1 25 -1 q 10 0 18 0 q 15 0 26 0 q 11 1 33 1 q 38 0 59 -16 q 21 -15 31 -35 q 11 -22 13 -51 v -410 q 0 -62 18 -113 q 17 -51 46 -90 q 28 -39 65 -66 q 36 -26 75 -38 q -39 -12 -75 -40 q -37 -27 -65 -67 q -29 -40 -46 -91 q -18 -50 -18 -109 v -410 q 0 -38 -16 -59 q -16 -20 -36 -30 q -23 -11 -51 -13 h -102 v -103 h 102 q 57 3 102 26 q 19 10 38 24 q 18 15 33 37 q 14 22 23 51 q 9 29 9 67 v 410 q 0 59 18 98 q 17 39 46 63 q 29 24 66 34 q 36 10 75 10 z",Plus:"M696.6084,158.2656 L674.8074,158.2656 L674.8074,136.4656 L658.4084,136.4656 L658.4084,158.2656 L636.6084,158.2656L636.6084,174.6646 L658.4084,174.6646 L658.4084,196.4656 L674.8074,196.4656 L674.8074,174.6646 L696.6084,174.6646L696.6084,158.2656 z",Star:"M540.3643,137.9336 L546.7973,159.7016 L570.3633,159.7296 L550.7723,171.9366 L558.9053,194.9966 L540.3643,179.4996L521.8223,194.9966 L529.9553,171.9366 L510.3633,159.7296 L533.9313,159.7016 L540.3643,137.9336 z",Can:"M 542.802,362.009C 542.802,368.452 525.341,373.676 503.802,373.676C 482.263,373.676 464.802,368.452 464.802,362.009L 464.802,466.484C 464.802,472.928 482.263,478.151 503.802,478.151C 525.341,478.151 542.802,472.928 542.802,466.484L 542.802,362.016C 542.802,368.459 525.341,373.534 503.802,373.534C 482.263,373.534 464.802,368.31 464.802,361.867L 464.802,362.016C 464.802,355.572 482.263,350.349 503.802,350.349C 525.341,350.349 542.802,355.572 542.802,362.016",FlowChartProcess:"M419.511,76.687L359.511,76.687L359.511,43.086L419.511,43.086z",FlowChartAlternateProcess:"M 456 1690 q -62 0 -117 -24 q -55 -24 -96 -65 q -41 -41 -65 -96 q -24 -55 -24 -118 v -726 q 0 -63 24 -118 q 24 -55 65 -96 q 41 -41 96 -65 q 55 -24 117 -24 h 1136 q 62 0 117 24 q 55 24 96 65 q 41 41 65 96 q 24 55 24 118 v 726 q 0 63 -24 118 q -24 55 -65 96 q -41 41 -96 65 q -55 24 -117 24 z",FlowChartPunchedTape:"M 563 1894 q -94 0 -169 -15 q -76 -15 -129 -38 q -54 -23 -82 -50 q -29 -27 -29 -50 v -1276 q 69 45 175 71 q 105 27 234 27 q 109 0 203 -20 q 94 -19 163 -54 q 68 -34 107 -81 q 39 -46 39 -101 q 0 -23 29 -50 q 29 -27 83 -50 q 53 -23 129 -38 q 75 -15 169 -15 q 94 0 170 15 q 75 15 128 38 q 53 23 82 50 q 29 27 29 50 v 1276 q -69 -45 -174 -72 q -106 -26 -235 -26 q -110 0 -203 19 q -94 20 -162 54 q -69 35 -108 81 q -39 47 -39 102 q 0 23 -29 50 q -29 27 -82 50 q -54 23 -129 38 q -76 15 -170 15 Z",FlowChartDecision:"M 253.005,115.687L 200.567,146.071L 148.097,115.687L 200.534,85.304L 253.005,115.687 Z",FlowChartDocument:"M 60 31.9 c 0 0 -11 -7.7 -30 0 s -30 0 -30 0 V 0 h 60 V 31.9 Z",FlowChartPredefinedProcess:"M 0,0 L 50,0 L 50,50 L 0,50 Z  M 8.334,0 L 8.334,50 M 41.667,0 L 41.667,50",FlowChartTerminator:"M 269.711,29.33C 269.71,44.061 257.77,56 243.04,56L 158.058,56C 143.33,56 131.39,44.061 131.39,29.33L 131.39,29.33C 131.391,14.6057 143.33,2.669 158.058,2.669L 243.044,2.669C 257.772,2.669 269.711,14.6057 269.711,29.333 Z",PaperTap:"M0.0009,17.2042 L0.0009,47.165 C0.001,47.165 14.403,53.5455 25.00,47.165 C35.599,40.7852 44.403,43.5087 50.00,47.165L50.001,17.2042 M50.001,32.7987 L50.001,2.8405 C50.001,2.8405 35.599,-3.5427 25.001,2.8405C14.403,9.2237 5.599,6.494 0.0009,2.8405 L0.0009,32.7987",DirectData:"M 132.62 0 L 17.38 0 C 7.78 0 0 13.43 0 30 C 0 46.57 7.78 60 17.38 60 L 132.62 60 M 132.62 0C 123.02 0 115.24 13.43 115.24 30 C 115.24 46.57 123.02 60 132.62 60 C 142.22 60 150 46.57 150 30 C 150 13.43 142.22 0 132.62 0 z ",SequentialData:"M0.0029,24.999 C0.0029,11.1922 10.433,0.0021 23.295,0.0021 C36.159,0.00216 46.585,11.1922 46.585,24.999C46.585,38.8057 36.159,49.9979 23.295,49.9979 C10.433,49.9979 0.0029,38.8057 0.0029,24.999 z M23.294,49.999 L50.002,49.999",FlowChartSort:"M50.001,24.9971 L25.001,49.9971 L0.00097,24.9971 L25.001,-0.00286865 L50.001,24.9971 z M0.000976562,24.9971 L50.001,24.9971",FlowChartMultiDocument:"M43.6826,40 C44.8746,40.6183 45.8586,41.3502 46.8366,42.1122 L46.8366,4.74487 L3.09857,4.74487 L3.09857,10.9544 M46.837,35.143 C48.027,35.765 49.025,36.604 50.003,37.369 L50.003,0.002 L6.264,0.002 L6.264,4.744 M43.682,47.113 L43.682,10.765 L0.0025,10.7652 L0.0025,47.1132 C0.0025,47.1132 12.5846,53.6101 21.8426,47.1132 C31.1006,40.6163 38.792,43.393 43.6826,47.1132 z",FlowChartCollate:"M50.001,0.0028 L25.001,25.0029 L0.00097,0.0028 L50.001,0.002 z M0.0009,50.002 L25.001,25.002L50.001,50.002 L0.0009,50.0029 z",FlowChartSummingJunction:"M7.3252,42.6768 L42.6772,7.3247 M42.6768,42.6768 L7.3248,7.3247 M0.0009,25.001 C0.0009,11.193 11.197,0.0009 25.001,0.0009 C38.809,0.0009 50.001,11.193 50.001,25.001 C50.001,38.809 38.809,50.001 25.001,50.001 C11.197,50.00 0.0009,38.809 0.0009,25.00 z",FlowChartOr:"M 0 50 L 100 50 M 50 100 L 50 0.0 M 0 50 C 0 22.384 22.392 0 50 0 C 77.616 0 100 22.384 100 50 C 100 77.616 77.616 100 50 100 C 22.392 100 0 77.616 0 50 Z",FlowChartInternalStorage:"M 0 3.81946A 2.5,3.81946 0 0,1 2.5,0L 47.5 0A 2.5,3.81946 0 0,1 50,3.81946L 50 45.836A 2.5,3.819446 0 0,1 47.5,49.652778L 2.5 49.652778A 2.5,3.819446 0 0,1 0,45.8336L 0 3.819446ZM 0 11.45834L 50 11.4583334M 12.5 0L 12.5 49.652778",FlowChartExtract:"M0,35 L30,0 L60,35 Z",FlowChartManualOperation:"M46.4,28.8 L14.8,28.8 L0,0 L60,0 Z",FlowChartMagneticDisk:"M 1024 1690 q -128 0 -242 -13 q -115 -12 -211 -34 q -97 -22 -174 -52 q -78 -30 -131 -64 q -54 -34 -83 -71 q -29 -37 -29 -74 v -716 q 0 -36 29 -74 q 29 -37 83 -71 q 53 -34 131 -64 q 77 -30 174 -52 q 96 -22 211 -35 q 114 -12 242 -12 q 128 0 243 12 q 114 13 211 35 q 96 22 174 52 q 77 30 131 64 q 53 34 82 71 q 29 38 29 74 v 716 q 0 37 -29 74 q -29 37 -82 71 q -54 34 -131 64 q -78 30 -174 52 q -97 22 -211 34 q -115 13 -243 13 Z",FlowChartConnector:"M 973 1792 q -113 0 -217 -30 q -105 -29 -196 -82 q -91 -53 -166 -128 q -75 -75 -128 -166 q -53 -91 -82 -196 q -30 -104 -30 -217 q 0 -113 30 -218 q 29 -104 82 -195 q 53 -91 128 -166 q 75 -75 166 -128 q 91 -53 196 -83 q 104 -29 217 -29 q 113 0 218 29 q 104 30 195 83 q 91 53 166 128 q 75 75 128 166 q 53 91 83 195 q 29 105 29 218 q 0 113 -29 217 q -30 105 -83 196 q -53 91 -128 166 q -75 75 -166 128 q -91 53 -195 82 q -105 30 -218 30 Z",FlowChartOffPageConnector:"M 358 1407 v -1253 h 1332 v 1253 l -666 476 Z",FlowChartDirectAccessStorage:"M 358 1024 q 0 -128 13 -243 q 12 -114 34 -211 q 22 -96 52 -174 q 30 -77 64 -131 q 34 -53 71 -82 q 37 -29 74 -29 h 716 q 36 0 74 29 q 37 29 71 82 q 34 54 64 131 q 30 78 52 174 q 22 97 35 211 q 12 115 12 243 q 0 128 -12 242 q -13 115 -35 211 q -22 97 -52 174 q -30 78 -64 131 q -34 54 -71 83 q -38 29 -74 29 h -716 q -37 0 -74 -29 q -37 -29 -71 -83 q -34 -53 -64 -131 q -30 -77 -52 -174 q -22 -96 -34 -211 q -13 -114 -13 -242 Z",FlowChartMerge:"M60,0 L30,35 L0,0 Z",OffPageReference:"M60,33.3 L30.1,39 L0,33.3 L0,0 L60,0 Z",FlowChartSequentialAccessStorage:"M 60 30 C 60 13.4 46.6 0 30 0 S 0 13.4 0 30 s 13.4 30 30 30 h 28.6 v -6.5 h -9.9C 55.5 48 60 39.5 60 30 Z",Annotation:"M49.9984,50.0029 L-0.00271199,50.0029 L-0.00271199,0.00286865 L49.9984,0.00286865",Annotation2:"M49.9977,50.0029 L25.416,50.0029 L25.416,0.00286865 L49.9977,0.00286865 M25.4166,25.0029 L-0.00227869,25.0029",FlowChartData:"M 10 0 L 40 0 L 30 40 L 0 40 Z",FlowChartCard:"M275,60 L400,60 L400,110 L260,110 L260,75 Z",FlowChartDelay:"M0,0 L12.029,0 C14.212999,0 16,1.7869979 16,3.9709952 C16,6.1549926 14.212999,7.9409904 12.029,7.9409904 L0,7.9409904 z",FlowChartPreparation:"M 1048.17 572 C 1051.06 568.86 1055.17 567.05 1059.5 567 L 1094.51 567 C 1098.84 567.05 1102.95 568.86 1105.84 572 L 1126.43 595 C 1127.01 596.28 1127.01 597.72 1126.43 599 L 1105.84 622 C 1102.95 625.14 1098.84 626.95 1094.51 627 L 1059.5 627 C 1055.17 626.95 1051.06 625.14 1048.17 622 L 1027.58 599 C 1027 597.72 1027 596.28 1027.58 595 L 1048.17 572 Z",FlowChartDisplay:"M47.8809,19.2914 L32.7968,-0.00594145 L11.3902,-0.00594145 C7.93166,-0.00594145 0.00124586,11.187 0.00124586,24.9968C0.00124586,38.8032 7.93166,49.9962 11.3902,49.9962 L32.7968,49.99 L47.615,31.038 C47.615,31.0388 52.798,24.9968 47.880,19.2914 z",FlowChartManualInput:"M 912 732 L 1006.85 707 C 1008.2 707 1009.5 707.53 1010.46 708.46 C 1011.41 709.4 1011.95 710.67 1011.95 712 L 1011.95 762C 1012 764.41 1010.28 766.52 1007.87 767 L 917.1 767 C 915.75 767 914.45 766.47 913.49 765.54 C 912.54 764.6 912 763.33 912 762 L 912 732 Z",LoopLimit:"M 8 9 L 27 9 L 33 15 L 33 26 C 33 27 33 27 32 27 L 4 27 C 3 27 2 27 2 26 L 2 15 L 8 9 Z",FlowChartStoredData:"M 5.55 0L 50 0A 1.5,30 0 0,1 50,0A 5.555,25 0 0,0 50,50A 1.5,30 0 0,1 50,50L 5.555 50A 5.55,25 0 0,1 5.555,0Z",RightArrow:"M 1178 1382 h -1024 v -716 h 1024 v -338 l 695 696 l -695 696 z",LeftArrow:"M 870 666 h 1024 v 716 h -1024 v 338 l -695 -696 l 695 -696 z",UpArrow:"M 1382 870 v 1024 h -716 v -1024 h -338 l 696 -695 l 696 695 z",DownArrow:"M 666 1178 v -1024 h 716 v 1024 h 338 l -696 695 l -696 -695 z",LeftRightArrow:"M 1382 1280 h -716 v 235 l -491 -491 l 491 -491 v 235 h 716 v -235 l 491 491 l -491 491 z",UpDownArrow:"M 768 1382 v -716 h -235 l 491 -491 l 491 491 h -235 v 716 h 235 l -491 491 l -491 -491 z",QuadArrow:"M 738 1587 h 132 v -409 h -409 v 132 l -286 -286 l 286 -286 v 132 h 409 v -409 h -132 l 286 -286 l 286 286 h -132 v 409 h 409 v -132 l 286 286 l -286 286 v -132 h -409 v 409 h 132 l -286 286 z",LeftRightUpArrow:"M 461 1485 v 132 l -286 -286 l 286 -286 v 133 h 409 v -615 h -132 l 286 -286 l 286 286 h -132 v 615 h 409 v -133 l 286 286 l -286 286 v -132 z",BentArrow:"M 154 1894 v -1126 q 0 -63 24 -119 q 24 -56 66 -98 q 41 -42 97 -66 q 56 -24 120 -24 h 1024 v -235 l 388 388 l -388 389 v -235 h -768 q -53 0 -99 20 q -47 20 -82 55 q -35 35 -55 81 q -20 47 -20 100 v 870 z",UTurnArrow:"M 154 1894 v -1075 q 0 -92 24 -177 q 24 -85 67 -159 q 43 -73 104 -134 q 61 -61 135 -104 q 73 -43 158 -67 q 85 -24 177 -24 h 103 q 92 0 177 24 q 85 24 159 67 q 73 43 134 104 q 61 61 104 134 q 43 74 67 159 q 24 85 24 177 v 359 h 235 l -388 388 l -389 -388 h 235 v -359 q 0 -74 -28 -139 q -28 -65 -77 -114 q -49 -49 -114 -77 q -65 -28 -139 -28 h -103 q -74 0 -139 28 q -65 28 -114 77 q -49 49 -77 114 q -28 65 -28 139 v 1075 z",LeftUpArrow:"M 175 1434 l 388 -389 v 235 h 717 v -717 h -235 l 389 -388 l 388 388 h -235 v 1024 h -1024 v 235 z",BentUpArrow:"M 154 1894 v -307 h 1126 v -1024 h -235 l 389 -388 l 388 388 h -235 v 1331 z",CurvedRightArrow:"M 1280 1587 h -205 q -99 0 -190 -26 q -92 -25 -171 -72 q -80 -47 -145 -112 q -66 -65 -113 -145 q -47 -80 -72 -172 q -26 -91 -26 -190 q 0 -99 26 -191 q 25 -91 72 -171 q 47 -79 113 -145 q 65 -65 145 -112 q 79 -46 171 -72 q 91 -25 190 -25 h 205 v 307 h -205 q -108 0 -208 31 q -101 31 -187 88 q -87 57 -155 137 q -68 81 -110 180 l -10 25 l 14 23 q 50 79 116 141 q 66 62 144 105 q 78 43 166 66 q 87 23 179 23 h 256 v -235 l 388 389 l -388 388 z",CurvedLeftArrow:"M 768 1822 l -388 -388 l 388 -389 v 235 h 256 q 92 0 180 -23 q 87 -23 165 -66 q 78 -43 144 -105 q 66 -62 116 -141 l 14 -23 l -10 -25 q -42 -99 -110 -180 q -68 -80 -154 -137 q -87 -57 -187 -88 q -101 -31 -209 -31 h -205 v -307 h 205 q 99 0 191 25 q 91 26 171 72 q 79 47 145 112 q 65 66 112 145 q 47 80 73 171 q 25 92 25 191 q 0 99 -25 190 q -26 92 -73 172 q -47 80 -112 145 q -66 65 -145 112 q -80 47 -171 72 q -92 26 -191 26 h -205 z",CurvedUpArrow:"M 1587 768 v 205 q 0 99 -25 190 q -26 92 -73 171 q -47 80 -112 145 q -65 66 -145 113 q -80 47 -171 72 q -92 26 -191 26 q -99 0 -190 -26 q -92 -25 -171 -72 q -80 -47 -145 -113 q -66 -65 -112 -145 q -47 -79 -72 -171 q -26 -91 -26 -190 v -205 h 307 v 205 q 0 108 31 208 q 31 101 88 187 q 57 87 138 155 q 80 68 179 110 l 25 10 l 23 -14 q 79 -50 141 -116 q 62 -66 105 -144 q 43 -78 66 -166 q 23 -87 23 -179 v -256 h -235 l 389 -388 l 388 388 z",CurvedDownArrow:"M 1822 1280 l -388 388 l -389 -388 h 235 v -256 q 0 -92 -23 -180 q -23 -87 -66 -165 q -43 -78 -105 -144 q -62 -66 -141 -116 l -23 -14 l -25 10 q -99 42 -179 110 q -81 68 -138 154 q -57 87 -88 187 q -31 101 -31 209 v 205 h -307 v -205 q 0 -99 26 -191 q 25 -91 72 -171 q 46 -79 112 -145 q 65 -65 145 -112 q 79 -47 171 -73 q 91 -25 190 -25 q 99 0 191 25 q 91 26 171 73 q 80 47 145 112 q 65 66 112 145 q 47 80 73 171 q 25 92 25 191 v 205 z",StripedRightArrow:"M 102 614 h 103 v 820 h -103 m 205 -820 h 103 v 820 h -103 m 819 409 v -409 h -614 v -820 h 614 v -409 l 820 819 m -717 307 v 265 l 572 -572 l -572 -572 v 265 h -615 v 614 z",NotchedRightArrow:"M 1126 1843 v -409 h -1024 l 512 -410 l -512 -410 h 1024 v -409 l 820 819 m -717 307 v 265 l 572 -572 l -572 -572 v 265 h -835 l 384 307 l -384 307 z",Pentagon:"M 154 1690 v -1434 h 1002 l 717 717 l -717 717 z",Chevron:"M 226 1690 l 717 -717 l -717 -717 h 930 l 717 717 l -717 717 z",RightArrowCallout:"M 154 154 h 1024 v 716 h 307 v -234 l 388 388 l -388 388 v -234 h -307 v 716 h -1024 z",DownArrowCallout:"M 154 154 h 1740 v 1024 h -716 v 307 h 234 l -388 388 l -388 -388 h 234 v -307 h -716 z",LeftArrowCallout:"M 1894 154 v 1740 h -1024 v -716 h -307 v 234 l -388 -388 l 388 -388 v 234 h 307 v -716 z",UpArrowCallout:"M 1894 1894 h -1740 v -1024 h 716 v -307 h -234 l 388 -388 l 388 388 h -234 v 307 h 716 z",LeftRightArrowCallout:"M 666 1894 v -716 h -205 v 132 l -286 -286 l 286 -286 v 132 h 205 v -716 h 716 v 716 h 205 v -132 l 286 286 l -286 286 v -132 h -205 v 716 z",QuadArrowCallout:"M 738 1587 h 132 v -205 h -204 v -204 h -205 v 132 l -286 -286 l 286 -286 v 132 h 205 v -204 h 204 v -205 h -132 l 286 -286 l 286 286 h -132 v 205 h 204 v 204 h 205 v -132 l 286 286 l -286 286 v -132 h -205 v 204 h -204 v 205 h 132 l -286 286 z",CircularArrow:"M 1045 1382 h 235 v -460 q 0 -74 -28 -140 q -28 -65 -77 -114 q -49 -48 -114 -77 q -65 -28 -139 -28 h -103 q -74 0 -139 28 q -65 29 -114 77 q -49 49 -77 114 q -28 66 -28 140 v 665 h -307 v -665 q 0 -92 24 -177 q 24 -85 67 -159 q 43 -74 104 -135 q 61 -60 135 -104 q 73 -43 158 -67 q 85 -24 177 -24 h 103 q 92 0 177 24 q 85 24 159 67 q 73 44 134 104 q 61 61 104 135 q 43 74 67 159 q 24 85 24 177 v 460 h 235 l -388 389 z",Explosion1:"M 833 1509 l -270 225 v -352 h -282 l 309 -193 l -374 -421 h 450 v -337 l 260 260 l 354 -443 v 418 h 361 l -226 317 l 381 297 h -394 l 228 457 l -479 -218 l -134 312 z",Explosion2:"M 591 1480 l -324 -1 l 208 -249 l -270 -360 h 492 l -135 -270 l 247 82 l 39 -239 l 187 281 l 168 -418 l 35 281 l 417 -186 l -135 408 l 253 42 l -215 172 l 246 206 h -300 l 174 346 l -347 -173 v 353 l -305 -175 l -416 270 z",Star4Point:"M 848 1200 l -572 -176 l 572 -176 l 176 -572 l 176 572 l 572 176 l -572 176 l -176 572 z",Star5Point:"M 1219 768 h 603 l -446 446 l 175 612 l -527 -352 l -527 352 l 175 -612 l -446 -446 h 598 l 202 -521 z",Star6Point:"M 786 1485 h -580 l 350 -461 l -350 -461 h 580 l 238 -367 l 238 367 h 580 l -350 461 l 350 461 h -580 l -238 367 z",Star7Point:"M 1024 1541 l -395 307 l -42 -422 l -396 -176 l 314 -314 l -207 -373 h 461 l 265 -372 l 265 372 h 461 l -207 373 l 314 314 l -396 176 l -42 422 z",Star8Point:"M 738 1587 h -277 v -277 l -286 -286 l 286 -286 v -277 h 282 l 281 -286 l 286 286 h 277 v 277 l 286 286 l -286 286 v 277 h -277 l -286 286 z",Star10Point:"M 828 1635 l -367 48 v -286 l -277 -93 l 198 -280 l -198 -280 l 277 -93 v -286 l 367 48 l 196 -231 l 196 231 l 370 -48 v 286 l 274 92 l -198 281 l 198 280 l -277 93 v 286 l -367 -48 l -196 231 z",Star12Point:"M 868 1611 l -305 231 v -357 h -357 l 231 -305 l -241 -156 l 241 -156 l -231 -305 h 357 v -357 l 305 231 l 156 -241 l 156 241 l 305 -231 v 357 h 357 l -231 305 l 241 156 l -241 156 l 231 305 h -357 v 357 l -305 -231 l -156 241 z",Star16Point:"M-51.20001220703125,0L-37.66234497940063,-6.9061855534744225L-47.302667277832036,-18.06249483215332L-31.9284556123352,-19.667176728401184L-36.204040631713866,-33.375589842071534L-21.333893086395264,-29.434036096916195L-19.593220671386717,-43.60713318054199L-7.491457786102288,-34.71996375514984L0,-47.19999694824219L7.491457786102288,-34.71996375514984L19.593220671386717,-43.60713318054199L21.33389308639528,-29.434036096916195L36.20404063171388,-33.375589842071534L31.928455612335213,-19.667176728401184L47.30266727783204,-18.06249483215332L37.66234497940066,-6.9061855534744225L51.20001220703125,0L37.66234497940066,6.9061855534744225L47.30266727783204,18.06249483215332L31.928455612335213,19.667176728401188L36.20404063171388,33.37558984207155L21.33389308639528,29.434036096916202L19.593220671386717,43.60713318054199L7.491457786102288,34.71996375514985L0,47.19999694824219L-7.491457786102288,34.71996375514985L-19.593220671386717,43.60713318054199L-21.333893086395264,29.434036096916202L-36.204040631713866,33.37558984207155L-31.9284556123352,19.667176728401188L-47.302667277832036,18.06249483215332L-37.66234497940063,6.9061855534744225Z",Star24Point:"M-51.20001220703125,0L-38.071305076904295,-4.620761701240539L-49.45541409708704,-12.216258138985935L-35.47700045837402,-13.546871124114986L-44.34051124536243,-23.599998474121094L-30.464647263336182,-21.55010260665893L-36.20387582842581,-33.3754379140864L-23.37638957336425,-28.084588184165955L-25.600006103515625,-40.87639641572571L-14.694915503540031,-32.70534988540649L-13.251538268661228,-45.59169605307234L-5.012353195037839,-35.096973730773925L0,-47.19999694824219L5.012353195037846,-35.096973730773925L13.251538268661236,-45.59169605307234L14.694915503540045,-32.70534988540649L25.600006103515625,-40.87639641572571L23.37638957336425,-28.084588184165955L36.20387582842582,-33.3754379140864L30.464647263336204,-21.55010260665893L44.340511245362435,-23.599998474121094L35.47700045837402,-13.546871124114986L49.45541409708704,-12.216258138985935L38.07130507690431,-4.620761701240539L51.20001220703125,0L38.07130507690431,4.620761701240539L49.45541409708704,12.216258138985935L35.47700045837402,13.546871124114993L44.340511245362435,23.599998474121094L30.464647263336204,21.550102606658925L36.20387582842582,33.375437914086405L23.37638957336425,28.084588184165966L25.600006103515625,40.87639641572571L14.694915503540045,32.70534988540649L13.251538268661236,45.59169605307234L5.012353195037846,35.096973730773925L0,47.19999694824219L-5.012353195037839,35.096973730773925L-13.251538268661228,45.59169605307234L-14.694915503540031,32.70534988540649L-25.600006103515625,40.87639641572571L-23.37638957336425,28.084588184165966L-36.20387582842581,33.375437914086405L-30.464647263336182,21.550102606658925L-44.34051124536243,23.599998474121094L-35.47700045837402,13.546871124114993L-49.45541409708704,12.216258138985935L-38.071305076904295,4.620761701240539Z",Star32Point:"M-54,0L-40.30479,-3.52872L-52.96266,-9.36432L-38.75607,-10.45008L-49.889520000000005,-18.368640000000003L-35.71776,-16.9704L-44.89938,-26.667360000000002L-31.306905,-22.838040000000007L-38.18376618407357,-33.94112549695428L-25.692795000000004,-27.828360000000004L-30.00078,-39.910560000000004L-19.091700000000003,-31.749120000000005L-20.664719999999996,-44.34624L-11.756339999999994,-34.44984L-10.534859999999995,-47.077920000000006L-3.9698099999999954,-35.82648L0,-48L3.9698100000000025,-35.82648L10.534860000000009,-47.077920000000006L11.756340000000009,-34.44984L20.664720000000003,-44.34624L19.091700000000003,-31.749120000000005L30.000780000000006,-39.910560000000004L25.692795000000004,-27.828360000000004L38.183766184073576,-33.94112549695428L31.306905000000015,-22.838040000000007L44.89938000000001,-26.667360000000002L35.71776000000001,-16.9704L49.889520000000005,-18.368640000000003L38.75607000000001,-10.45008L52.962660000000014,-9.36432L40.30479000000001,-3.52872L54,0L40.30479000000001,3.52872L52.962660000000014,9.36432L38.75607000000001,10.45008L49.889520000000005,18.36864L35.71776000000001,16.970399999999998L44.89938000000001,26.667359999999988L31.306905000000015,22.838039999999992L38.183766184073576,33.941125496954285L25.692795000000004,27.828360000000004L30.000780000000006,39.91055999999999L19.091700000000003,31.749120000000005L20.664720000000003,44.346239999999995L11.756340000000009,34.449839999999995L10.534860000000009,47.077920000000006L3.9698100000000025,35.826480000000004L0,48L-3.9698099999999954,35.826480000000004L-10.534859999999995,47.077920000000006L-11.756339999999994,34.449839999999995L-20.664719999999996,44.346239999999995L-19.091700000000003,31.749120000000005L-30.00078,39.91055999999999L-25.692795000000004,27.828360000000004L-38.18376618407357,33.941125496954285L-31.306905,22.838039999999992L-44.89938,26.667359999999988L-35.71776,16.970399999999998L-49.889520000000005,18.36864L-38.75607,10.45008L-52.96266,9.36432L-40.30479,3.52872Z",UpRibbon:"M 1741 1075 l 205 461 h -717 v -205 h -410 v 205 h -717 l 205 -461 l -205 -461 h 410 v -204 h 1024 v 204 h 410 m -512 615 v -717 h -820 v 717 m -102 -512 h -252 l 159 358 l -159 359 h 252 m 1117 -359 l 159 -358 h -252 v 717 h 252 m -1071 -103 h -103 v 103 h 103 m 717 0 v -103 h -103 v 103 z",DownRibbon:"M 1946 410 l -205 460 l 205 461 h -410 v 205 h -1024 v -205 h -410 l 205 -461 l -205 -460 h 717 v 204 h 410 v -204 m -615 307 v 717 h 820 v -717 m 102 512 h 252 l -159 -359 l 159 -358 h -252 m -1117 358 l -159 359 h 252 v -717 h -252 m 1174 0 h -103 v 102 h 103 m -820 -102 v 102 h 103 v -102 z",CurvedUpRibbon:"M 1741 1075 l 205 666 q -62 -57 -130 -102 q -29 -19 -62 -38 q -34 -18 -70 -33 q -36 -14 -73 -23 q -38 -9 -75 -9 h -307 v -256 q 0 -10 -16 -20 q -16 -9 -44 -16 q -28 -7 -65 -11 q -38 -4 -80 -4 q -42 0 -79 4 q -38 4 -66 11 q -28 7 -44 16 q -16 10 -16 20 v 256 h -307 q -38 0 -75 9 q -38 9 -74 23 q -36 15 -69 33 q -33 19 -62 38 q -69 45 -130 102 l 205 -666 l -205 -461 q 60 -75 122 -117 q 62 -41 119 -62 q 56 -20 104 -25 q 47 -4 78 -4 q 19 -43 65 -80 q 45 -37 111 -64 q 66 -27 149 -42 q 82 -15 174 -15 q 92 0 175 15 q 82 15 148 42 q 66 27 112 64 q 45 37 64 80 q 31 0 79 4 q 47 5 104 25 q 56 21 118 62 q 62 42 122 117 m -1659 876 q 116 -56 225 -56 v -926 l -8 -1 q -21 0 -51 4 q -30 4 -65 16 q -35 12 -73 34 q -39 22 -78 58 l 184 456 m 296 256 h -103 v 103 h 103 m 307 -308 q 72 0 124 8 q 52 9 87 23 q 35 15 55 33 q 20 19 30 39 h 114 v -773 l -4 -9 q -9 -21 -41 -46 q -32 -24 -83 -45 q -52 -21 -123 -35 q -71 -14 -159 -14 q -88 0 -159 14 q -71 14 -123 35 q -52 21 -83 45 q -32 25 -41 46 l -4 9 v 773 h 114 q 10 -20 30 -39 q 20 -18 55 -33 q 35 -14 87 -23 q 52 -8 124 -8 m 410 308 v -103 h -103 v 103 m 296 -380 l 184 -435 q -39 -36 -77 -58 q -39 -22 -74 -34 q -35 -12 -64 -16 q -30 -4 -51 -4 h -9 v 927 q 109 0 225 56 z",CurvedDownRibbon:"M 307 870 l -205 -665 q 61 58 130 103 q 29 19 62 37 q 33 19 69 33 q 36 14 74 23 q 37 9 75 9 h 307 v 256 q 0 11 16 20 q 16 9 44 16 q 28 7 66 11 q 37 4 79 4 q 42 0 80 -4 q 37 -4 65 -11 q 28 -7 44 -16 q 16 -9 16 -20 v -256 h 307 q 37 0 75 -9 q 37 -9 73 -23 q 36 -14 70 -33 q 33 -18 62 -37 q 68 -45 130 -103 l -205 665 l 205 461 q -55 69 -112 110 q -57 41 -110 63 q -54 23 -100 30 q -47 7 -80 7 q -6 0 -11 -1 q -5 0 -10 0 q -19 43 -64 80 q -46 37 -112 64 q -66 27 -148 42 q -83 15 -175 15 q -92 0 -174 -15 q -83 -15 -149 -42 q -66 -27 -111 -64 q -46 -37 -65 -80 q -5 0 -10 0 q -6 1 -11 1 q -33 0 -79 -7 q -47 -7 -100 -30 q -54 -22 -111 -63 q -57 -41 -112 -110 m 1659 -875 q -120 56 -225 56 v 926 h 8 q 21 0 51 -4 q 30 -4 65 -16 q 35 -12 74 -34 q 38 -22 77 -58 l -184 -456 m -296 -256 h 103 v -102 h -103 m -307 307 q -72 0 -124 -9 q -52 -8 -87 -22 q -35 -14 -55 -33 q -20 -18 -30 -38 h -114 v 773 l 4 9 q 9 21 41 45 q 31 25 83 45 q 52 21 123 35 q 71 14 159 14 q 88 0 159 -14 q 71 -14 123 -35 q 51 -20 83 -45 q 32 -24 41 -45 l 4 -9 v -773 h -114 q -10 20 -30 38 q -20 19 -55 33 q -35 14 -87 22 q -52 9 -124 9 m -410 -307 v 102 h 103 v -102 m -296 380 l -184 434 q 39 36 78 58 q 38 22 73 34 q 35 12 65 16 q 29 4 50 4 h 9 v -926 q -105 0 -225 -56 z",VerticalScroll:"M 1690 102 q 53 0 100 20 q 46 20 81 55 q 35 35 55 81 q 20 47 20 100 q 0 53 -20 100 q -20 47 -55 81 q -35 35 -81 55 q -47 20 -100 20 h -52 v 1178 q 0 32 -12 60 q -12 28 -32 49 q -21 21 -49 33 q -28 12 -60 12 h -1178 q -42 0 -79 -17 q -38 -16 -65 -44 q -28 -27 -44 -65 q -17 -37 -17 -79 q 0 -42 17 -80 q 16 -37 44 -65 q 27 -28 65 -44 q 37 -16 79 -16 h 103 v -1280 q 0 -32 12 -60 q 12 -28 33 -49 q 20 -21 48 -33 q 28 -12 60 -12 m 51 308 q 0 -41 16 -78 q 15 -36 42 -64 q 26 -28 62 -45 q 35 -16 76 -18 h -247 q -21 0 -36 15 q -15 15 -15 36 v 1587 h 973 q 21 0 36 -15 q 15 -15 15 -36 v -1178 h -717 q -42 0 -79 -16 q -38 -16 -66 -44 q -28 -27 -44 -65 q -16 -37 -16 -79 m 1076 102 q 31 0 59 -12 q 28 -12 49 -33 q 21 -21 33 -49 q 12 -28 12 -60 q 0 -31 -12 -59 q -12 -28 -33 -49 q -21 -21 -49 -33 q -28 -12 -59 -12 h -863 q 41 2 77 18 q 36 17 63 45 q 26 28 42 64 q 15 37 15 78 q 0 28 -7 53 q -7 26 -20 49 m -587 1126 h -103 q -21 0 -39 8 q -19 8 -33 22 q -14 14 -22 33 q -8 19 -8 40 q 0 21 8 39 q 8 19 22 33 q 14 14 33 22 q 18 8 39 8 h 103 m 409 -1331 q 21 0 40 -8 q 19 -8 33 -22 q 14 -14 22 -33 q 8 -18 8 -39 q 0 -21 -8 -40 q -8 -19 -22 -33 q -14 -14 -33 -22 q -19 -8 -40 -8 q -21 0 -39 8 q -19 8 -33 22 q -14 14 -22 33 q -8 19 -8 40 q 0 21 8 39 q 8 19 22 33 q 14 14 33 22 q 18 8 39 8 z",HorizontalScroll:"M 1741 102 q 42 0 80 16 q 37 17 65 44 q 27 28 44 65 q 16 38 16 80 v 1178 q 0 32 -12 60 q -12 28 -33 48 q -21 21 -49 33 q -28 12 -60 12 h -1178 v 52 q 0 53 -20 99 q -20 47 -54 82 q -35 35 -82 55 q -47 20 -100 20 q -53 0 -99 -20 q -47 -20 -82 -55 q -35 -35 -55 -82 q -20 -46 -20 -99 v -1127 q 0 -32 12 -60 q 12 -28 33 -49 q 21 -20 49 -32 q 28 -12 60 -12 h 1280 v -103 q 0 -42 16 -80 q 16 -37 44 -65 q 28 -27 66 -44 q 37 -16 79 -16 m 102 410 h -1587 q -21 0 -36 15 q -15 15 -15 36 v 248 q 1 -41 18 -77 q 17 -36 45 -63 q 27 -26 64 -42 q 37 -15 78 -15 q 42 0 80 16 q 37 16 65 44 q 27 28 43 65 q 16 38 16 80 v 717 h 1178 q 21 0 36 -15 q 15 -15 15 -36 m -1433 -461 q -41 0 -78 -16 q -37 -15 -64 -42 q -28 -26 -45 -62 q -17 -35 -18 -76 v 862 q 0 32 12 59 q 12 28 33 49 q 21 21 49 33 q 27 12 59 12 q 32 0 60 -12 q 28 -12 49 -33 q 21 -21 33 -49 q 12 -27 12 -59 v -693 q -23 13 -48 20 q -26 7 -54 7 m 1433 -717 q 0 -21 -8 -40 q -8 -18 -22 -32 q -14 -14 -32 -22 q -19 -8 -40 -8 q -21 0 -40 8 q -19 8 -33 22 q -14 14 -22 32 q -8 19 -8 40 v 103 h 205 m -1331 409 q 0 -21 -8 -40 q -8 -18 -22 -32 q -14 -14 -32 -22 q -19 -8 -40 -8 q -21 0 -40 8 q -19 8 -33 22 q -14 14 -22 32 q -8 19 -8 40 q 0 21 8 40 q 8 19 22 33 q 14 14 33 22 q 19 8 40 8 q 21 0 40 -8 q 18 -8 32 -22 q 14 -14 22 -33 q 8 -19 8 -40 z",Wave:"M 1383 1894 q -42 0 -84 -8 q -43 -7 -77 -16 q -34 -9 -55 -17 q -22 -7 -23 -7 q -8 -5 -26 -17 q -18 -11 -39 -25 q -21 -13 -41 -27 q -20 -13 -32 -24 l -38 -33 q -40 -35 -89 -76 q -49 -41 -106 -77 q -58 -35 -123 -59 q -66 -23 -138 -23 q -68 0 -122 10 q -55 10 -99 27 q -44 17 -78 39 q -34 23 -59 47 v -1275 q 24 -16 77 -47 q 52 -30 126 -59 q 73 -29 165 -51 q 91 -22 195 -22 q 72 0 130 17 q 57 18 104 47 q 46 29 85 65 q 38 37 74 75 q 35 39 70 75 q 34 37 72 66 q 38 29 83 46 q 44 18 99 18 q 78 0 147 -24 q 69 -23 127 -59 q 57 -36 104 -80 q 47 -44 82 -85 v 1356 q -16 18 -57 55 q -41 38 -105 75 q -64 37 -149 65 q -86 28 -191 28 z",DoubleWave:"M 1690 1894 q -58 0 -100 -19 q -42 -19 -75 -48 q -33 -28 -62 -61 q -29 -33 -61 -62 q -32 -28 -71 -47 q -39 -19 -92 -19 q -51 0 -92 19 q -42 19 -77 47 q -35 29 -65 62 q -30 33 -59 61 q -29 29 -57 48 q -29 19 -60 19 q -35 0 -73 -19 q -39 -19 -79 -48 q -40 -28 -80 -61 q -40 -33 -79 -62 q -40 -28 -78 -47 q -38 -19 -72 -19 q -26 0 -52 10 q -27 11 -53 27 q -27 17 -52 38 q -25 22 -47 44 v -1480 q 19 -20 45 -42 q 26 -21 54 -39 q 27 -18 55 -30 q 27 -12 50 -12 q 24 0 55 19 q 31 19 67 47 q 36 29 77 62 q 41 33 84 61 q 43 29 88 48 q 45 19 90 19 q 48 0 87 -19 q 38 -19 71 -48 q 33 -28 63 -61 q 29 -33 59 -62 q 30 -28 62 -47 q 31 -19 68 -19 q 36 0 68 19 q 31 19 63 47 q 31 29 64 62 q 33 33 72 61 q 39 29 87 48 q 47 19 107 19 q 70 0 120 -17 q 50 -16 84 -40 v 1477 q -5 6 -17 17 q -12 11 -35 21 q -24 11 -61 18 q -37 8 -91 8 z",MathPlus:"M 1894 1280 h -614 v 614 h -512 v -614 h -614 v -512 h 614 v -614 h 512 v 614 h 614 z",MathMinus:"M 154 768 h 1740 v 512 h -1740 z",MathMultiply:"M 1409 1771 l -435 -435 l -434 435 l -362 -362 l 434 -435 l -434 -434 l 362 -362 l 434 434 l 435 -434 l 362 362 l -435 434 l 435 435 z",MathDivision:"M 1024 1792 q -32 0 -60 -12 q -28 -12 -49 -33 q -21 -21 -33 -49 q -12 -28 -12 -60 q 0 -31 12 -59 q 12 -28 33 -49 q 21 -21 49 -33 q 28 -12 60 -12 q 32 0 60 12 q 28 12 49 33 q 21 21 33 49 q 12 28 12 59 q 0 32 -12 60 q -12 28 -33 49 q -21 21 -49 33 q -28 12 -60 12 m 0 -1229 q -32 0 -60 -12 q -28 -12 -49 -33 q -21 -21 -33 -49 q -12 -27 -12 -59 q 0 -32 12 -60 q 12 -28 33 -49 q 21 -21 49 -33 q 28 -12 60 -12 q 32 0 60 12 q 28 12 49 33 q 21 21 33 49 q 12 28 12 60 q 0 32 -12 59 q -12 28 -33 49 q -21 21 -49 33 q -28 12 -60 12 m -870 205 h 1740 v 512 h -1740 z",MathEqual:"M 154 358 h 1740 v 512 h -1740 m 0 205 h 1740 v 512 h -1740 z",MathNotEqual:"M 1372 870 l -136 205 h 658 v 512 h -1000 l -205 307 h -389 l 205 -307 h -351 v -512 h 693 l 136 -205 h -829 v -512 h 1170 l 137 -204 h 389 l -137 204 h 181 v 512 z",RoundedRectangle:"M 20,0 h 160 a 20,20 0 0 1 20,20 v 60 a 20,20 0 0 1 -20,20 h -160 a 20,20 0 0 1 -20,-20 v -60 a 20,20 0 0 1 20,-20 z",SnipSingleCornerRectangle:"M 154 1690 v -1332 h 1258 l 482 482 v 850 z",SnipSameSideCornerRectangle:"M 154 1690 v -850 l 482 -482 h 776 l 482 482 v 850 z",SnipDiagonalCornerRectangle:"M 636 1690 l -482 -482 v -850 h 1258 l 482 482 v 850 z",SnipAndRoundSingleCornerRectangle:"M 154 1690 v -1029 q 0 -63 24 -118 q 24 -55 65 -96 q 41 -41 96 -65 q 55 -24 117 -24 h 956 l 482 482 v 850 z",RoundSingleCornerRectangle:"M 154 1690 v -1332 h 1438 q 62 0 117 24 q 55 24 96 65 q 41 41 65 96 q 24 55 24 118 v 1029 z",RoundSameSideCornerRectangle:"M 154 1690 v -1029 q 0 -63 24 -118 q 24 -55 65 -96 q 41 -41 96 -65 q 55 -24 117 -24 h 1136 q 62 0 117 24 q 55 24 96 65 q 41 41 65 96 q 24 55 24 118 v 1029 z",RoundDiagonalCornerRectangle:"M 456 1690 q -62 0 -117 -24 q -55 -24 -96 -65 q -41 -41 -65 -96 q -24 -55 -24 -118 v -1029 h 1438 q 62 0 117 24 q 55 24 96 65 q 41 41 65 96 q 24 55 24 118 v 1029 z"},this.documentHelper=e}xsi.prototype.setZoomFactor=function(){this.onZoomFactorChanged(),je(this.documentHelper.selection)||this.documentHelper.selection.updateCaretPosition(),this.documentHelper.updateTouchMarkPosition(),je(this.documentHelper.owner.imageResizerModule)||this.documentHelper.owner.imageResizerModule.updateImageResizerPosition(),this.documentHelper.owner.fireZoomFactorChange()},Object.defineProperty(xsi.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),xsi.prototype.onZoomFactorChanged=function(){5<this.documentHelper.zoomFactor?this.documentHelper.zoomFactor=5:this.documentHelper.zoomFactor<.1&&(this.documentHelper.zoomFactor=.1),this.zoom()},xsi.prototype.zoom=function(){var e=this.viewer;this.documentHelper.clearContent(),e.handleZoom(),this.documentHelper.updateFocus()},xsi.prototype.destroy=function(){this.documentHelper=void 0};var Asi=xsi;function xsi(e){var i=this;this.onMouseWheelInternal=function(e){var t;!0===e.ctrlKey&&(e.preventDefault(),e.pageX-i.documentHelper.viewerContainer.offsetLeft<i.documentHelper.pageContainer.offsetWidth)&&(t=(t=(t=void 0)!==navigator?navigator.userAgent.match("Firefox"):t)?e.detail<0:F.isIE?0<e.wheelDelta:e.deltaY<0,e=i.documentHelper.zoomFactor,t?e<=4.9?e+=.1:e=5:.2<=e?e-=.1:e=.1,i.documentHelper.zoomFactor=e)},this.documentHelper=e}Tsi.prototype.initUserDialog=function(e,t){this.target=Q("div",{className:"e-de-user-dlg"});var i=Q("div",{innerHTML:e.getConstant("Enter User"),className:"e-bookmark-dlgfields"}),i=(this.target.appendChild(i),Q("div",{className:"e-de-user-dlg-common"})),n=(this.target.appendChild(i),Q("div",{className:"e-de-user-dlg-list"})),t=(i.appendChild(n),t&&n.classList.add("e-de-rtl"),this.textBoxInput=Q("input",{className:"e-input e-de-user-dlg-textbox-input",attrs:{autofocus:"true"}}),this.textBoxInput.setAttribute("type","text"),n.appendChild(this.textBoxInput),this.textBoxInput.addEventListener("keyup",this.onKeyUpOnDisplayBox),Q("button",{innerHTML:e.getConstant("Add"),attrs:{type:"button"}})),n=(n.appendChild(t),t.addEventListener("click",this.addButtonClick),this.addButton=new zv({cssClass:"e-de-user-add-btn"}),this.addButton.disabled=!0,this.addButton.appendTo(t),this.addButton.addEventListener("click",this.addButtonClick),Q("div")),t=(i.appendChild(n),Q("div",{innerHTML:e.getConstant("Users"),className:"e-de-user-dlg-user"})),i=(n.appendChild(t),Q("div"));n.appendChild(i),this.userList=new MH({cssClass:"e-de-user-listview"}),this.userList.appendTo(i)},Tsi.prototype.bindListData=function(e){-1===this.documentHelper.userCollection.indexOf(e)&&this.documentHelper.userCollection.push(e),this.userList&&(this.userList.dataSource=this.documentHelper.userCollection.slice(),this.userList.dataBind())},Tsi.prototype.validateUserName=function(e){var t;return-1!==e.indexOf("@")&&-1!==(e=e.split("@")[1]).indexOf(".")&&(t=(e=e.split("."))[1],!(2<e.length||4<t.length||t.length<2))},Tsi.prototype.destroy=function(){this.textBoxInput&&(this.textBoxInput=void 0),this.addButton&&(this.addButton.destroy(),this.addButton=void 0),this.userList&&(this.userList.destroy(),this.userList=void 0),this.documentHelper=void 0};var Isi=Tsi;function Tsi(e){var t=this;this.show=function(){var e=new Cn("documenteditor",t.documentHelper.owner.defaultLocale);e.setLocale(t.documentHelper.owner.locale),t.target||t.initUserDialog(e,t.documentHelper.owner.enableRtl),t.documentHelper.dialog.header=e.getConstant("Add Users"),t.documentHelper.dialog.height="auto",t.documentHelper.dialog.width="auto",t.documentHelper.dialog.content=t.target,t.documentHelper.dialog.beforeOpen=t.loadUserDetails,t.documentHelper.dialog.close=t.documentHelper.updateFocus,t.documentHelper.dialog.buttons=[{click:t.okButtonClick,buttonModel:{content:e.getConstant("Ok"),cssClass:"e-flat",isPrimary:!0}},{click:t.hideDialog,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat"}},{click:t.deleteButtonClick,buttonModel:{content:e.getConstant("Delete"),cssClass:"e-flat e-user-delete"}}],t.documentHelper.dialog.dataBind(),t.documentHelper.dialog.show()},this.loadUserDetails=function(){t.userList.dataSource=t.documentHelper.userCollection.slice(),t.userList.dataBind(),t.documentHelper.restrictEditingPane.addedUser.dataSource=t.documentHelper.userCollection.slice(),t.documentHelper.restrictEditingPane.addedUser.dataBind()},this.okButtonClick=function(){t.documentHelper.restrictEditingPane.isAddUser=!0,t.documentHelper.restrictEditingPane.showStopProtectionPane(!1),t.documentHelper.restrictEditingPane.addUserCollection(),t.documentHelper.restrictEditingPane.isAddUser=!1,t.documentHelper.dialog.hide()},this.hideDialog=function(){t.textBoxInput.value="",t.documentHelper.dialog.hide()},this.onKeyUpOnDisplayBox=function(){t.addButton.disabled=""===t.textBoxInput.value},this.addButtonClick=function(){t.validateUserName(t.textBoxInput.value)?(t.bindListData(t.textBoxInput.value),t.textBoxInput.value=""):WC.alert("Invalid user name")},this.deleteButtonClick=function(){var e=t.documentHelper.userCollection.indexOf(t.userList.getSelectedItems().text);-1<e&&(t.documentHelper.userCollection.splice(e,1),t.userList.dataSource=t.documentHelper.userCollection.slice(),t.userList.dataBind())},this.documentHelper=e}Object.defineProperty(Dsi.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),Dsi.prototype.initDialog=function(e){this.target=Q("div",{className:"e-de-enforce"});var t=Q("div",{className:"e-de-container-row"}),i=(this.passwordTextBox=Q("input",{attrs:{type:"password",autofocus:"true"},className:"e-input"}),t.appendChild(this.passwordTextBox),Q("div"));this.confirmPasswordTextBox=Q("input",{attrs:{type:"password"},className:"e-input"}),i.appendChild(this.confirmPasswordTextBox),this.target.appendChild(t),this.target.appendChild(i),new fV({placeholder:e.getConstant("Enter new password"),floatLabelType:"Always",cssClass:"e-de-enforce-dlg-input"},this.passwordTextBox),new fV({placeholder:e.getConstant("Reenter new password to confirm"),floatLabelType:"Always"},this.confirmPasswordTextBox)},Dsi.prototype.destroy=function(){this.documentHelper=void 0,this.owner=void 0};var Esi=Dsi;function Dsi(e,t){var i=this;this.show=function(){i.localeValue=new Cn("documenteditor",i.viewer.owner.defaultLocale),i.localeValue.setLocale(i.viewer.owner.locale),i.target||i.initDialog(i.localeValue),i.documentHelper.dialog.header=i.localeValue.getConstant("Start Enforcing Protection"),i.documentHelper.dialog.height="auto",i.documentHelper.dialog.content=i.target,i.documentHelper.dialog.width="auto",i.documentHelper.dialog.buttons=[{click:i.okButtonClick,buttonModel:{content:i.localeValue.getConstant("Ok"),cssClass:"e-flat",isPrimary:!0}},{click:i.hideDialog,buttonModel:{content:i.localeValue.getConstant("Cancel"),cssClass:"e-flat"}}],i.passwordTextBox.value="",i.confirmPasswordTextBox.value="",i.documentHelper.dialog.show()},this.hideDialog=function(){i.passwordTextBox.value="",i.confirmPasswordTextBox.value="",i.documentHelper.dialog.hide()},this.okButtonClick=function(){i.passwordTextBox.value!==i.confirmPasswordTextBox.value?WC.alert(i.localeValue.getConstant("Password Mismatch")):(i.password=go.sanitize(i.passwordTextBox.value),i.viewer.owner.editorModule.addProtection(i.password,i.owner.protectionType))},this.documentHelper=e,this.owner=t}Object.defineProperty(ksi.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),ksi.prototype.initDialog=function(e){var t=this.viewer.owner.containerId+"_enforce_protection",t=(this.target=Q("div",{id:t,className:"e-de-enforce"}),Q("div")),e=Q("div",{className:"e-de-unprotect-dlg-title",innerHTML:e.getConstant("Password")});this.passwordTextBox=Q("input",{attrs:{type:"password"},id:this.viewer.owner.containerId+"_display_text",className:"e-input e-de-enforce-dlg-input"}),t.appendChild(e),t.appendChild(this.passwordTextBox),this.target.appendChild(t)},ksi.prototype.destroy=function(){this.documentHelper=void 0,this.owner=void 0};var Msi=ksi;function ksi(e,t){var i=this;this.show=function(){i.localObj=new Cn("documenteditor",i.viewer.owner.defaultLocale),i.localObj.setLocale(i.viewer.owner.locale),i.target||i.initDialog(i.localObj),i.documentHelper.dialog.header="Unprotect Document",i.documentHelper.dialog.height="auto",i.documentHelper.dialog.width="auto",i.documentHelper.dialog.content=i.target,i.documentHelper.dialog.buttons=[{click:i.okButtonClick,buttonModel:{content:i.localObj.getConstant("Ok"),cssClass:"e-flat",isPrimary:!0}},{click:i.hideDialog,buttonModel:{content:i.localObj.getConstant("Cancel"),cssClass:"e-flat"}}],i.documentHelper.dialog.dataBind(),i.passwordTextBox.value="",i.documentHelper.dialog.show()},this.okButtonClick=function(){var e=i.passwordTextBox.value;e.length==="".length&&""===e?WC.alert(i.localObj.getConstant("The password is incorrect")):i.viewer.owner.editorModule.stopProtection(e)},this.hideDialog=function(){i.passwordTextBox.value="",i.documentHelper.dialog.hide()},this.documentHelper=e,this.owner=t}Object.defineProperty(Bsi.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),Bsi.prototype.showHideRestrictPane=function(e){this.restrictPane||(this.localObj=new Cn("documenteditor",this.viewer.owner.defaultLocale),this.localObj.setLocale(this.viewer.owner.locale),this.initPane(this.localObj,this.documentHelper.owner.enableRtl)),e?(this.restrictPane.style.display="block",this.isShowRestrictPane=!0,this.documentHelper.selection.isHighlightEditRegion=!0,this.wireEvents(),this.documentHelper.updateViewerSize(),this.loadPaneValue(),this.addUserCollection()):(this.closePane(),this.documentHelper.owner.enableAutoFocus&&this.documentHelper.updateFocus()),this.documentHelper.owner.triggerResize()},Bsi.prototype.initPane=function(e,t){this.restrictPane=Q("div",{className:"e-de-restrict-pane"}),t&&this.restrictPane.classList.add("e-rtl");var t=Q("div",{className:"e-de-rp-whole-header"}),i=Q("div",{innerHTML:e.getConstant("Restrict Editing"),className:"e-de-rp-header"}),i=(this.closeButton=Q("button",{className:"e-de-rp-close-icon e-de-close-icon e-btn e-flat e-icon-btn",attrs:{type:"button"}}),this.closeButton.setAttribute("aria-label",this.localObj.getConstant("Close")),t.appendChild(this.closeButton),t.appendChild(i),Q("span",{className:"e-de-op-close-icon e-de-close-icon e-btn-icon e-icons"}));this.closeButton.appendChild(i),this.restrictPane.appendChild(t),this.initRestrictEditingPane(e);rt(this.documentHelper.optionsPaneContainer,"display:inline-flex;"),this.documentHelper.optionsPaneContainer.insertBefore(this.restrictPane,this.documentHelper.viewerContainer)},Bsi.prototype.initRestrictEditingPane=function(e){this.restrictPaneWholeDiv=Q("div");var t=Q("div",{className:"e-de-rp-sub-div"}),i=Q("div",{innerHTML:e.getConstant("Formatting restrictions"),className:"e-de-rp-format"}),i=(t.appendChild(i),Q("input",{attrs:{type:"checkbox"}})),i=(t.appendChild(i),this.allowFormat=this.createCheckBox(e.getConstant("Allow formatting"),i),this.restrictPaneWholeDiv.appendChild(t),Q("div",{className:"e-de-rp-sub-div"})),t=(Q("input",{attrs:{type:"checkbox"}}),Q("input",{className:"e-prop-font-style"})),n=(i.appendChild(t),[{Value:"Read only",Name:e.getConstant("Read only")},{Value:"Filling in forms",Name:e.getConstant("Filling in forms")},{Value:"Comments",Name:e.getConstant("Comments")},{Value:"Tracked changes",Name:e.getConstant("Tracked changes")}]),n=(this.protectionTypeDrop=new qz({dataSource:n,cssClass:"e-de-prop-dropdown",floatLabelType:"Always",placeholder:e.getConstant("Editing restrictions"),fields:{text:"Name",value:"Value"},enableRtl:this.documentHelper.owner.enableRtl}),this.protectionTypeDrop.value="Read only",this.protectionTypeDrop.appendTo(t),this.restrictPaneWholeDiv.appendChild(i),this.userWholeDiv=Q("div",{className:"e-de-rp-sub-div"}),Q("div",{innerHTML:e.getConstant("Exceptions Optional"),className:"e-de-rp-format"})),t=(this.userWholeDiv.appendChild(n),Q("div",{innerHTML:e.getConstant("Select Part Of Document And User"),className:"e-de-rp-sub-content-div"})),i=(this.userWholeDiv.appendChild(t),Q("div",{className:"e-de-rp-user"})),n=(this.userWholeDiv.appendChild(i),this.addedUser=new MH({cssClass:"e-de-user-listView",dataSource:[{text:"Everyone"}],showCheckBox:!0,select:this.selectHandler.bind(this),enableRtl:this.documentHelper.owner.enableRtl}),this.addedUser.appendTo(i),this.addUser=Q("button",{className:"e-btn e-primary e-flat e-de-rp-mu-btn",innerHTML:e.getConstant("More users")+"...",attrs:{type:"button"}}),this.addUser.setAttribute("aria-label",e.getConstant("More users")),this.userWholeDiv.appendChild(this.addUser),this.restrictPaneWholeDiv.appendChild(this.userWholeDiv),Q("div",{className:"e-de-rp-enforce"})),t=(this.restrictPaneWholeDiv.appendChild(n),this.enforceProtection=Q("button",{innerHTML:e.getConstant("Enforcing Protection"),className:"e-btn e-de-rp-btn-enforce",attrs:{type:"button"}}),this.enforceProtection.setAttribute("aria-label",e.getConstant("Enforcing Protection")),n.appendChild(this.enforceProtection),this.restrictPane.appendChild(this.restrictPaneWholeDiv),this.stopProtectionDiv=Q("div",{styles:"display:none"}),Q("div",{innerHTML:e.getConstant("Your permissions"),className:"e-de-rp-stop-div1"})),i=(this.stopProtectionDiv.appendChild(t),Q("div",{className:"e-de-rp-stop-div2"})),n=(this.stopProtectionDiv.appendChild(i),e.getConstant("Protected Document")),t=(this.contentDiv1=Q("div",{innerHTML:n}),i.appendChild(this.contentDiv1),e.getConstant("ReadOnlyProtection")),n=(this.contentDiv2=Q("div",{innerHTML:t}),i.appendChild(this.contentDiv2),this.stopReadOnlyOptions=Q("div"),this.stopProtectionDiv.appendChild(this.stopReadOnlyOptions),Q("div",{className:"e-de-rp-enforce-nav"})),t=Q("button",{innerHTML:e.getConstant("Find Next Region I Can Edit"),className:"e-btn e-de-rp-nav-btn",attrs:{type:"button"}}),i=(n.appendChild(t),t.addEventListener("click",this.navigateNextRegion.bind(this)),this.stopReadOnlyOptions.appendChild(n),Q("div",{className:"e-de-rp-enforce-nav"})),t=Q("button",{innerHTML:e.getConstant("Show All Regions I Can Edit"),className:"e-btn e-de-rp-nav-btn",attrs:{type:"button"}}),n=(i.appendChild(t),t.addEventListener("click",this.showAllRegion),this.stopReadOnlyOptions.appendChild(i),Q("div",{className:"e-de-rp-nav-lbl e-de-rp-more-less"})),t=Q("input",{attrs:{type:"checkbox"},className:"e-btn e-de-rp-nav-btn"}),i=(n.appendChild(t),this.stopReadOnlyOptions.appendChild(n),this.highlightCheckBox=new ib({label:e.getConstant("Highlight the regions I can edit"),change:this.changeHighlightOptions.bind(this),enableRtl:this.documentHelper.owner.enableRtl},t),Q("div",{className:"e-de-rp-enforce"}));this.stopProtection=Q("button",{innerHTML:e.getConstant("Stop Protection"),className:"e-btn e-de-rp-btn-stop-enforce",attrs:{type:"button"}}),i.appendChild(this.stopProtection),this.stopProtectionDiv.appendChild(i),this.restrictPane.appendChild(this.stopProtectionDiv)},Bsi.prototype.showStopProtectionPane=function(e){switch(e?(this.stopProtectionDiv.style.display="block",this.restrictPaneWholeDiv.style.display="none"):(this.stopProtectionDiv.style.display="none",this.restrictPaneWholeDiv.style.display="block"),this.documentHelper.protectionType){case"ReadOnly":case"CommentsOnly":this.stopReadOnlyOptions.style.display="block";break;default:this.stopReadOnlyOptions.style.display="none"}this.documentHelper.owner.showHideRulers(),this.documentHelper.owner.triggerResize()},Bsi.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))},Bsi.prototype.changeHighlightOptions=function(){var e=this;this.documentHelper.owner.documentEditorSettings.highlightEditableRanges=this.highlightCheckBox.checked,setTimeout(function(){e.documentHelper&&e.documentHelper.owner.focusIn()},10)},Bsi.prototype.enableFormatting=function(e){this.documentHelper.restrictFormatting=!e.checked},Bsi.prototype.stopProtectionTriggered=function(e){!je(this.documentHelper.saltValue)&&""!==this.documentHelper.saltValue||!je(this.documentHelper.hashValue)&&""!==this.documentHelper.hashValue?this.unProtectDialog.show():this.documentHelper.owner.editorModule.unProtectDocument()},Bsi.prototype.protectionTypeDropChanges=function(e){switch(e.value){case"Read only":this.protectionType="ReadOnly",this.userWholeDiv.style.display="block",this.contentDiv1.innerHTML=this.localObj.getConstant("Protected Document"),this.contentDiv2.innerHTML=this.localObj.getConstant("ReadOnlyProtection"),this.previousProtectionType=e.previousItemData.Value;break;case"Filling in forms":this.protectionType="FormFieldsOnly",this.userWholeDiv.style.display="none",this.contentDiv1.innerHTML=this.localObj.getConstant("Protected Document"),this.contentDiv2.innerHTML=this.localObj.getConstant("FormFieldsOnly"),this.previousProtectionType=e.previousItemData.Value,this.showRemovedIgnoreDialog();break;case"Comments":this.protectionType="CommentsOnly",this.userWholeDiv.style.display="block",this.contentDiv1.innerHTML=this.localObj.getConstant("Protected Document"),this.contentDiv2.innerHTML=this.localObj.getConstant("CommentsOnly"),this.previousProtectionType=e.previousItemData.Value;break;case"Tracked changes":this.protectionType="RevisionsOnly",this.userWholeDiv.style.display="none",this.contentDiv1.innerHTML=this.localObj.getConstant("Protected Document"),this.contentDiv2.innerHTML=this.localObj.getConstant("TrackChangesOnly"),this.previousProtectionType=e.previousItemData.Value,this.showRemovedIgnoreDialog();break;default:this.protectionType="NoProtection",this.addedUser.uncheckAllItems(),this.viewer.owner.editorModule.removeAllEditRestrictions()}},Bsi.prototype.showRemovedIgnoreDialog=function(){this.documentHelper.selection&&0<this.documentHelper.editRanges.length&&(this.documentHelper.dialog.height=" Auto",this.documentHelper.dialog.width=" 600px",this.documentHelper.dialog.header=this.localObj.getConstant("Information"),this.documentHelper.dialog.content=this.localObj.getConstant("RemovedIgnoreExceptions")+"<br><br>"+this.localObj.getConstant("RemovedIgnore"),this.documentHelper.dialog.buttons=[{click:this.onYesButtonClick,buttonModel:{content:this.localObj.getConstant("Yes")}},{click:this.onCancelButtonClick,buttonModel:{content:this.localObj.getConstant("Cancel")}},{click:this.onNoButtonClick,buttonModel:{content:this.localObj.getConstant("No")}}],this.documentHelper.dialog.dataBind(),this.documentHelper.dialog.show())},Bsi.prototype.selectHandler=function(e){e.isChecked?(this.viewer.owner.editorModule.insertEditRangeElement(e.text),e.event.target.classList.add("e-check")):this.viewer.owner.editorModule.removeUserRestrictions(e.text)},Bsi.prototype.highlightClicked=function(e){this.documentHelper.selection.isHighlightEditRegion=e.checked},Bsi.prototype.protectDocument=function(){this.enforceProtectionDialog.show()},Bsi.prototype.createCheckBox=function(e,t){e=new ib({label:e,enableRtl:this.documentHelper.owner.enableRtl});return e.appendTo(t),e},Bsi.prototype.loadPaneValue=function(){switch(this.allowFormat.checked=!this.documentHelper.restrictFormatting,this.documentHelper.protectionType){case"ReadOnly":this.protectionTypeDrop.value="Read only";break;case"FormFieldsOnly":this.protectionTypeDrop.value="Filling in forms";break;case"CommentsOnly":this.protectionTypeDrop.value="Comments";break;case"RevisionsOnly":this.protectionTypeDrop.value="Tracked changes"}this.highlightCheckBox.checked=this.documentHelper.owner.documentEditorSettings.highlightEditableRanges,this.documentHelper.selection.isHighlightEditRegion=this.documentHelper.owner.documentEditorSettings.highlightEditableRanges,this.addedUser.enablePersistence=!0,this.addedUser.dataSource=this.usersCollection.slice(),this.addedUser.dataBind(),this.showStopProtectionPane(this.documentHelper.isDocumentProtected)},Bsi.prototype.navigateNextRegion=function(){this.documentHelper.selection.navigateToNextEditingRegion()},Bsi.prototype.addUserCollection=function(){if(this.documentHelper.selection&&0<this.documentHelper.selection.editRangeCollection.length)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()},Bsi.prototype.updateUserInformation=function(){var e,t;this.addedUser.uncheckAllItems(),this.documentHelper.selection.checkSelectionIsAtEditRegion&&(e=this.documentHelper.selection.getEditRangeStartElement())&&(-1<(t=this.addedUser.dataSource.indexOf(e.user))&&this.addedUser.element.querySelectorAll("li")[t].querySelector(".e-icons").classList.add("e-check"),-1<(t=this.addedUser.dataSource.indexOf(e.group)))&&this.addedUser.element.querySelectorAll("li")[t].querySelector(".e-icons").classList.add("e-check")},Bsi.prototype.destroy=function(){this.addUserDialog&&this.addUserDialog.destroy(),this.addUserDialog=void 0,this.enforceProtectionDialog&&this.enforceProtectionDialog.destroy(),this.enforceProtectionDialog=void 0,this.unProtectDialog&&this.unProtectDialog.destroy(),this.unProtectDialog=void 0,this.base64&&this.base64.destroy(),this.base64=void 0,this.addedUser&&(this.addedUser.destroy(),this.addedUser=void 0),this.allowFormat&&(this.allowFormat.destroy(),this.allowFormat=void 0),this.protectionTypeDrop&&(this.protectionTypeDrop.destroy(),this.protectionTypeDrop=void 0),this.highlightCheckBox&&(this.highlightCheckBox.destroy(),this.highlightCheckBox=void 0),this.addUser&&(this.addUser.innerHTML="",this.addUser.remove(),this.addUser=void 0),this.restrictPane&&(this.restrictPane.innerHTML="",this.restrictPane.remove(),this.restrictPane=void 0),this.enforceProtection&&(this.enforceProtection.innerHTML="",this.enforceProtection.remove(),this.enforceProtection=void 0),this.stopProtection&&(this.stopProtection.innerHTML="",this.stopProtection.remove(),this.stopProtection=void 0),this.stopProtectionDiv&&(this.stopProtectionDiv.innerHTML="",this.stopProtectionDiv.remove(),this.stopProtectionDiv=void 0),this.stopReadOnlyOptions&&(this.stopReadOnlyOptions.innerHTML="",this.stopReadOnlyOptions.remove(),this.stopReadOnlyOptions=void 0),this.contentDiv1&&(this.contentDiv1.innerHTML="",this.contentDiv1.remove(),this.contentDiv1=void 0),this.contentDiv2&&(this.contentDiv2.innerHTML="",this.contentDiv2.remove(),this.contentDiv2=void 0),this.closeButton&&(this.closeButton.innerHTML="",this.closeButton.remove(),this.closeButton=void 0),this.userWholeDiv&&(this.userWholeDiv.innerHTML="",this.userWholeDiv.remove(),this.userWholeDiv=void 0),this.restrictPaneWholeDiv&&(this.restrictPaneWholeDiv.innerHTML="",this.restrictPaneWholeDiv.remove(),this.restrictPaneWholeDiv=void 0),this.usersCollection=[],this.usersCollection=void 0,this.previousProtectionType=void 0,this.currentHashValue=void 0,this.currentSaltValue=void 0,this.documentHelper=void 0};var Psi=Bsi;function Bsi(e){var t=this;this.addRemove=!0,this.protectionType="ReadOnly",this.previousProtectionType="Read only",this.isShowRestrictPane=!1,this.isAddUser=!1,this.usersCollection=["Everyone"],this.closePane=function(){t.isShowRestrictPane=!1,t.restrictPane.style.display="none",t.documentHelper.owner.showHideRulers(),t.documentHelper.owner.triggerResize()},this.onYesButtonClick=function(){t.viewer.owner.editorModule.removeAllEditRestrictions(),t.documentHelper.dialog.hide()},this.onCancelButtonClick=function(e){t.protectionTypeDrop.value=t.previousProtectionType,t.documentHelper.dialog.hide()},this.onNoButtonClick=function(){t.documentHelper.dialog.hide()},this.showAllRegion=function(){t.documentHelper.selection.showAllEditingRegion()},this.documentHelper=e,this.addUserDialog=new Isi(e),this.enforceProtectionDialog=new Esi(e,this),this.unProtectDialog=new Msi(e,this),this.base64=new Bri}Lsi.prototype.initPopup=function(){this.popupElement=Q("div",{className:"e-de-form-popup"}),this.textBoxContainer=this.initTextBoxInput(),this.popupElement.appendChild(this.textBoxContainer),this.popupElement.appendChild(this.initNumericTextBox()),this.popupElement.appendChild(this.initDatePicker()),this.popupElement.appendChild(this.initDropDownList()),this.target=this.popupElement,this.owner.documentHelper.viewerContainer.appendChild(this.popupElement)},Lsi.prototype.initTextBoxInput=function(){this.textBoxDiv=Q("div",{className:"e-de-txt-field"});var e=Q("input",{className:"e-de-txt-form"}),t=new fV;return this.textBoxInput=e,this.textBoxButtonDiv=Q("div",{className:"e-de-cmt-action-button"}),this.textBoxOkButton=Q("button"),this.textBoxCancelButton=Q("button"),this.textBoxOkButton.addEventListener("click",this.applyTextFormFieldValueClickHandler),this.textBoxCancelButton.addEventListener("click",this.closeButtonClickHandler),this.textBoxDiv.appendChild(e),this.textBoxButtonDiv.appendChild(this.textBoxOkButton),this.textBoxButtonDiv.appendChild(this.textBoxCancelButton),this.textBoxDiv.appendChild(this.textBoxButtonDiv),t.appendTo(e),new zv({cssClass:"e-de-save e-primary",iconCss:"e-de-save-icon"},this.textBoxOkButton),new zv({cssClass:"e-de-cancel",iconCss:"e-de-cancel-icon"},this.textBoxCancelButton),this.textBoxInstance=t,this.textBoxDiv},Lsi.prototype.initNumericTextBox=function(){this.numericDiv=Q("div",{className:"e-de-num-field"});var e=Q("input",{className:"e-de-txt-form"}),t=new NL;return this.numberInput=e,this.textBoxButtonNumericDiv=Q("div",{className:"e-de-cmt-action-button"}),this.textBoxOkButtonNumeric=Q("button"),this.textBoxCancelButtonNumeric=Q("button"),this.textBoxOkButtonNumeric.addEventListener("click",this.applyNumberFormFieldValueClickHandler),this.textBoxCancelButtonNumeric.addEventListener("click",this.closeButtonClickHandler),this.numericDiv.appendChild(e),this.textBoxButtonNumericDiv.appendChild(this.textBoxOkButtonNumeric),this.textBoxButtonNumericDiv.appendChild(this.textBoxCancelButtonNumeric),this.numericDiv.appendChild(this.textBoxButtonNumericDiv),t.appendTo(e),new zv({cssClass:"e-de-save e-primary",iconCss:"e-de-save-icon"},this.textBoxOkButtonNumeric),new zv({cssClass:"e-de-cancel",iconCss:"e-de-cancel-icon"},this.textBoxCancelButtonNumeric),this.numericTextBoxInstance=t,this.numericDiv},Lsi.prototype.initDatePicker=function(){this.dateDiv=Q("div",{className:"e-de-date-field"});var e=Q("input",{className:"e-de-txt-form"}),t=new jq({strictMode:!0,change:this.enableDisableDatePickerOkButton});return this.dateInput=e,this.textBoxButtonDateDiv=Q("div",{className:"e-de-cmt-action-button"}),this.textBoxOkButtonDate=Q("button"),this.textBoxCancelButtonDate=Q("button"),this.textBoxOkButtonDate.addEventListener("click",this.applyDateFormFieldValueClickHandler),this.textBoxCancelButtonDate.addEventListener("click",this.closeButtonClickHandler),this.dateDiv.appendChild(e),this.textBoxButtonDateDiv.appendChild(this.textBoxOkButtonDate),this.textBoxButtonDateDiv.appendChild(this.textBoxCancelButtonDate),this.dateDiv.appendChild(this.textBoxButtonDateDiv),t.appendTo(e),this.dataPickerOkButton=new zv({cssClass:"e-de-save e-primary",iconCss:"e-de-save-icon"},this.textBoxOkButtonDate),new zv({cssClass:"e-de-cancel",iconCss:"e-de-cancel-icon"},this.textBoxCancelButtonDate),this.datePickerInstance=t,this.dateDiv},Lsi.prototype.initDropDownList=function(){this.dropDownDiv=Q("div",{className:"e-de-ddl-field"});var e=Q("input",{className:"e-de-txt-form"}),t=new qz;return this.dropDownInput=e,this.textBoxButtonDropDownDiv=Q("div",{className:"e-de-cmt-action-button"}),this.textBoxOkButtonDropDown=Q("button"),this.textBoxCancelButtonDropDown=Q("button"),this.textBoxOkButtonDropDown.addEventListener("click",this.applyDropDownFormFieldValueClickHandler),this.textBoxCancelButtonDropDown.addEventListener("click",this.closeButtonClickHandler),this.dropDownDiv.appendChild(e),this.textBoxButtonDropDownDiv.appendChild(this.textBoxOkButtonDropDown),this.textBoxButtonDropDownDiv.appendChild(this.textBoxCancelButtonDropDown),this.dropDownDiv.appendChild(this.textBoxButtonDropDownDiv),t.appendTo(e),new zv({cssClass:"e-de-save e-primary",iconCss:"e-de-save-icon"},this.textBoxOkButtonDropDown),new zv({cssClass:"e-de-cancel",iconCss:"e-de-cancel-icon"},this.textBoxCancelButtonDropDown),this.ddlInstance=t,this.dropDownDiv},Lsi.prototype.onApplyTextFormFieldValueClick=function(){this.applyTextFormFieldValue()},Lsi.prototype.onApplyNumberFormFieldValueClick=function(){this.applyNumberFormFieldValue()},Lsi.prototype.onApplyDateFormFieldValueClick=function(){this.applyDateFormFieldValue()},Lsi.prototype.onApplyDropDownFormFieldValueClick=function(){this.applyDropDownFormFieldValue()},Lsi.prototype.showPopUp=function(e){var t,i,n,o,r,s=this;e&&(this.formField=e,this.owner.selectionModule.selectField(),je(this.target)&&this.initPopup(),mt(this.target,[],["e-de-txt-form","e-de-num-form","e-de-date-form","e-de-ddl-form"]),(t=e.formFieldData)&&(t instanceof ili?(o=e.resultText,r=RegExp(this.owner.documentHelper.textHelper.getEnSpaceCharacter(),"gi"),""===o.replace(r,"")&&(o=""),r=t.maxLength,o=o||"","Text"===(n=t.type)||"Calculation"===n?(mt(this.target,["e-de-txt-form"],[]),i=this.textBoxInput,this.textBoxInstance.value=o):"Number"===t.type?(mt(this.target,["e-de-num-form"],[]),i=this.numberInput,this.numericTextBoxInstance.format=t.format,this.numericTextBoxInstance.value=parseFloat(o.replace(/,/gi,""))):"Date"===n&&(mt(this.target,["e-de-date-form"],[]),i=this.dateInput,-1!==(n=t.format).indexOf("am/pm")&&(n=n.replace(/am\/pm/gi,"a")),this.datePickerInstance.format=n,this.datePickerInstance.value=new Date(o),this.dataPickerOkButton.disabled=!0),i&&(0<r?i.maxLength=r:i.removeAttribute("maxlength"),setTimeout(function(){i.focus()}))):t instanceof lli&&(mt(this.target,["e-de-ddl-form"],[]),this.ddlInstance.refresh(),this.ddlInstance.dataSource=t.dropdownItems,this.ddlInstance.index=t.selectedIndex,setTimeout(function(){s.ddlInstance.showPopup()},50)),n=this.owner.selectionModule.getLeftInternal(e.line,e,0),o=e.line.height*this.owner.documentHelper.zoomFactor,r=this.owner.selectionModule.getTooltipPosition(e.line,n,this.target,!0),this.popupObject||(this.popupObject=new Sv(this.target,{height:"auto",width:"auto",relateTo:this.owner.documentHelper.viewerContainer.parentElement,position:{X:r.x,Y:r.y+o}})),this.target.style.display="block",this.popupObject.show()),this.owner.documentHelper.isFormFilling=!0)},Lsi.prototype.onCloseButtonClick=function(){this.closeButton()},Lsi.prototype.destroy=function(){this.formField&&this.formField.destroy(),this.formField=void 0,this.owner=void 0,this.removeEvents(),this.removeElements()},Lsi.prototype.removeEvents=function(){this.textBoxOkButton&&this.textBoxOkButton.removeEventListener("click",this.applyTextFormFieldValueClickHandler),this.textBoxCancelButton&&this.textBoxCancelButton.removeEventListener("click",this.closeButtonClickHandler),this.textBoxOkButtonNumeric&&this.textBoxOkButtonNumeric.removeEventListener("click",this.applyNumberFormFieldValueClickHandler),this.textBoxCancelButtonNumeric&&this.textBoxCancelButtonNumeric.removeEventListener("click",this.closeButtonClickHandler),this.textBoxOkButtonDate&&this.textBoxOkButtonDate.removeEventListener("click",this.applyDateFormFieldValueClickHandler),this.textBoxCancelButtonDate&&this.textBoxCancelButtonDate.removeEventListener("click",this.closeButtonClickHandler),this.textBoxOkButtonDropDown&&this.textBoxOkButtonDropDown.removeEventListener("click",this.applyDropDownFormFieldValueClickHandler),this.textBoxCancelButtonDropDown&&this.textBoxCancelButtonDropDown.removeEventListener("click",this.closeButtonClickHandler)},Lsi.prototype.removeElements=function(){this.popupElement&&(this.popupElement.remove(),this.popupElement=void 0),this.textBoxDiv&&(this.textBoxDiv.remove(),this.textBoxDiv=void 0),this.textBoxButtonDiv&&(this.textBoxButtonDiv.remove(),this.textBoxButtonDiv=void 0),this.textBoxOkButton&&(this.textBoxOkButton.remove(),this.textBoxOkButton=void 0),this.textBoxCancelButton&&(this.textBoxCancelButton.remove(),this.textBoxCancelButton=void 0),this.numericDiv&&(this.numericDiv.remove(),this.numericDiv=void 0),this.textBoxButtonNumericDiv&&(this.textBoxButtonNumericDiv.remove(),this.textBoxButtonNumericDiv=void 0),this.textBoxOkButtonNumeric&&(this.textBoxOkButtonNumeric.remove(),this.textBoxOkButtonNumeric=void 0),this.textBoxCancelButtonNumeric&&(this.textBoxCancelButtonNumeric.remove(),this.textBoxCancelButtonNumeric=void 0),this.dateDiv&&(this.dateDiv.remove(),this.dateDiv=void 0),this.textBoxButtonDateDiv&&(this.textBoxButtonDateDiv.remove(),this.textBoxButtonDateDiv=void 0),this.textBoxOkButtonDate&&(this.textBoxOkButtonDate.remove(),this.textBoxOkButtonDate=void 0),this.textBoxCancelButtonDate&&(this.textBoxCancelButtonDate.remove(),this.textBoxCancelButtonDate=void 0),this.dropDownDiv&&(this.dropDownDiv.remove(),this.dropDownDiv=void 0),this.textBoxButtonDropDownDiv&&(this.textBoxButtonDropDownDiv.remove(),this.textBoxButtonDropDownDiv=void 0),this.textBoxOkButtonDropDown&&(this.textBoxOkButtonDropDown.remove(),this.textBoxOkButtonDropDown=void 0),this.textBoxCancelButtonDropDown&&(this.textBoxCancelButtonDropDown.remove(),this.textBoxCancelButtonDropDown=void 0),this.target&&(this.target.remove(),this.target=void 0),this.textBoxContainer&&(this.textBoxContainer.remove(),this.textBoxContainer=void 0),this.textBoxInput&&(this.textBoxInput.remove(),this.textBoxInput=void 0),this.numberInput&&(this.numberInput.remove(),this.numberInput=void 0),this.dateInput&&(this.dateInput.remove(),this.dateInput=void 0),this.dropDownInput&&(this.dropDownInput.remove(),this.dropDownInput=void 0),this.numbericInput&&(this.numbericInput.remove(),this.numbericInput=void 0),this.popupObject&&(this.popupObject.destroy(),this.popupObject=void 0),this.textBoxInstance&&(this.textBoxInstance.destroy(),this.textBoxInstance=void 0),this.numericTextBoxInstance&&(this.numericTextBoxInstance.destroy(),this.numericTextBoxInstance=void 0),this.datePickerInstance&&(this.datePickerInstance.destroy(),this.datePickerInstance=void 0),this.ddlInstance&&(this.ddlInstance.destroy(),this.ddlInstance=void 0),this.dataPickerOkButton&&(this.dataPickerOkButton.destroy(),this.dataPickerOkButton=void 0)};var Fsi=Lsi;function Lsi(e){var i=this;this.applyTextFormFieldValueClickHandler=this.onApplyTextFormFieldValueClick.bind(this),this.applyDropDownFormFieldValueClickHandler=this.onApplyDropDownFormFieldValueClick.bind(this),this.closeButtonClickHandler=this.onCloseButtonClick.bind(this),this.applyDateFormFieldValueClickHandler=this.onApplyDateFormFieldValueClick.bind(this),this.applyNumberFormFieldValueClickHandler=this.onApplyNumberFormFieldValueClick.bind(this),this.applyTextFormFieldValue=function(){i.owner.editorModule.updateFormField(i.formField,i.textBoxInstance.value),i.owner.trigger(EJt,{fieldName:i.formField.formFieldData.name,value:i.formField.resultText,isCanceled:!1}),i.hidePopup()},this.applyNumberFormFieldValue=function(){i.owner.editorModule.updateFormField(i.formField,i.numberInput.value.toString()),i.owner.trigger(EJt,{fieldName:i.formField.formFieldData.name,value:i.formField.resultText,isCanceled:!1}),i.hidePopup()},this.applyDateFormFieldValue=function(){je(i.datePickerInstance.value)||(i.owner.editorModule.updateFormField(i.formField,i.dateInput.value),i.owner.trigger(EJt,{fieldName:i.formField.formFieldData.name,value:i.formField.resultText,isCanceled:!1}),i.hidePopup())},this.applyDropDownFormFieldValue=function(){i.owner.editorModule.updateFormField(i.formField,i.ddlInstance.index),i.owner.trigger(EJt,{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,t=(i.hidePopup(),{fieldName:e.formFieldData.name});e.formFieldData instanceof ili?t.value=e.resultText:e.formFieldData instanceof rli?t.value=e.formFieldData.checked:t.value=e.formFieldData.selectedIndex,t.isCanceled=!0,i.owner.trigger(EJt,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}Osi.prototype.initPopup=function(){this.popupElement=Q("div",{className:"e-de-form-popup"}),this.popupElement.appendChild(this.initDropDownList()),this.target=this.popupElement,this.owner.documentHelper.viewerContainer.appendChild(this.popupElement)},Osi.prototype.initDropDownList=function(){this.dropDownDiv=Q("div",{className:"e-de-ddl-field"});var e=Q("input",{className:"e-de-txt-form"}),t=new qz({fields:{text:"displayText"}});return this.dropDownInput=e,this.textBoxButtonDiv=Q("div",{className:"e-de-cmt-action-button"}),this.textBoxOkButton=Q("button"),this.textBoxCancelButton=Q("button"),this.textBoxOkButton.addEventListener("click",this.applyDropDownFormFieldValueHandler),this.textBoxCancelButton.addEventListener("click",this.closeButtonClickedHandler),this.dropDownDiv.appendChild(e),this.textBoxButtonDiv.appendChild(this.textBoxOkButton),this.textBoxButtonDiv.appendChild(this.textBoxCancelButton),this.dropDownDiv.appendChild(this.textBoxButtonDiv),t.appendTo(e),new zv({cssClass:"e-de-save e-primary",iconCss:"e-de-save-icon"},this.textBoxOkButton),new zv({cssClass:"e-de-cancel",iconCss:"e-de-cancel-icon"},this.textBoxCancelButton),this.ddlInstance=t,this.dropDownDiv},Osi.prototype.onapplyDropDownFormFieldValue=function(){this.applyDropDownFormFieldValue()},Osi.prototype.showPopUp=function(e){var t,i,n=this;e&&(this.contenControl=e,je(this.target)&&this.initPopup(),mt(this.target,[],["e-de-txt-form","e-de-num-form","e-de-date-form","e-de-ddl-form"]),mt(this.target,["e-de-ddl-form"],[]),this.ddlInstance.refresh(),t=e.contentControlProperties.contentControlListItems.map(function(e){var t,i={};for(t in e)i[""+t]=e[""+t];return i}),this.ddlInstance.dataSource=t,setTimeout(function(){n.ddlInstance.showPopup()},50),t=this.owner.selectionModule.getLeftInternal(e.line,e,0),i=e.line.height*this.owner.documentHelper.zoomFactor,e=this.owner.selectionModule.getTooltipPosition(e.line,t,this.target,!0),this.popupObject||(this.popupObject=new Sv(this.target,{height:"auto",width:"auto",relateTo:this.owner.documentHelper.viewerContainer.parentElement,position:{X:e.x,Y:e.y+i}})),this.target.style.display="block",this.popupObject.show())},Osi.prototype.onCloseButtonClicked=function(){this.closeButton()},Osi.prototype.destroy=function(){this.contenControl&&this.contenControl.destroy(),this.removeEvents(),this.removeElements(),this.contenControl=void 0,this.owner=void 0},Osi.prototype.removeEvents=function(){this.textBoxOkButton&&this.textBoxOkButton.removeEventListener("click",this.applyDropDownFormFieldValueHandler),this.textBoxCancelButton&&this.textBoxCancelButton.removeEventListener("click",this.closeButtonClickedHandler)},Osi.prototype.removeElements=function(){this.target&&this.target.remove(),this.dataPickerOkButton&&this.dataPickerOkButton.element&&this.dataPickerOkButton.element.parentNode&&(this.dataPickerOkButton.destroy(),this.dataPickerOkButton=void 0),this.ddlInstance&&(this.ddlInstance.destroy(),this.ddlInstance=void 0),this.dataPickerOkButton&&(this.dataPickerOkButton.destroy(),this.dataPickerOkButton=void 0),this.popupElement&&(this.popupElement.remove(),this.popupElement=void 0),this.dropDownDiv&&(this.dropDownDiv.remove(),this.dropDownDiv=void 0),this.textBoxButtonDiv&&(this.textBoxButtonDiv.remove(),this.textBoxButtonDiv=void 0),this.textBoxOkButton&&(this.textBoxOkButton.remove(),this.textBoxOkButton=void 0),this.textBoxCancelButton&&(this.textBoxCancelButton.remove(),this.textBoxCancelButton=void 0),this.target=void 0,this.dropDownInput=void 0,this.ddlInstance=void 0,this.dropDownDiv=void 0,this.textBoxButtonDiv=void 0,this.textBoxOkButton=void 0,this.textBoxCancelButton=void 0};var Rsi=Osi;function Osi(e){var t=this;this.applyDropDownFormFieldValueHandler=this.onapplyDropDownFormFieldValue.bind(this),this.closeButtonClickedHandler=this.onCloseButtonClicked.bind(this),this.applyDropDownFormFieldValue=function(){t.owner.editorModule.dropDownChange(t.contenControl,t.ddlInstance.text),t.hidePopup()},this.enableDisableDatePickerOkButton=function(e){e.isInteracted&&(t.dataPickerOkButton.disabled=!1)},this.closeButton=function(){t.hidePopup()},this.hidePopup=function(){t.contenControl=void 0,t.target&&(t.target.style.display="none"),t.popupObject&&(t.popupObject.hide(),t.popupObject.destroy(),t.popupObject=void 0)},this.owner=e}Object.defineProperty(Vsi.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(Vsi.prototype,"currentSelectedRevision",{get:function(){return this.currentSelectedRevisionInternal},set:function(e){var t=ge(".e-de-trckchanges-inner-select",this.changesInfoDiv);je(e)?je(t)||t.classList.remove("e-de-trckchanges-inner-select"):(e!==this.currentSelectedRevisionInternal||je(t))&&(t&&t.classList.remove("e-de-trckchanges-inner-select"),0<this.changes.length)&&this.changes.containsKey(e)&&this.changes.get(e).singleInnerDiv.classList.add("e-de-trckchanges-inner-select"),this.currentSelectedRevisionInternal=e,je(t=ge(".e-de-trckchanges-inner-select",this.changesInfoDiv))||t.parentElement.scrollIntoView({block:"nearest"})},enumerable:!0,configurable:!0}),Vsi.prototype.initTrackChangePane=function(){this.changes=new uJt,this.renderedChanges=new uJt,this.trackChangeDiv=Q("div",{className:"e-de-tc-pane"}),this.trackChangeDiv.appendChild(this.initPaneHeader()),this.changesInfoDiv=Q("div",{id:"e-de-tc-pane-revision",styles:"overflow:auto",className:this.owner.documentEditorSettings.showHiddenMarks?"":"e-de-tc-hide-para-mark"}),this.trackChangeDiv.appendChild(this.changesInfoDiv),this.noChangeDivElement=Q("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()},Vsi.prototype.showHiddenParaMark=function(){this.owner.documentEditorSettings.showHiddenMarks?this.changesInfoDiv.classList.contains("e-de-tc-hide-para-mark")&&this.changesInfoDiv.classList.remove("e-de-tc-hide-para-mark"):this.changesInfoDiv.classList.contains("e-de-tc-hide-para-mark")||this.changesInfoDiv.classList.add("e-de-tc-hide-para-mark")},Vsi.prototype.initPaneHeader=function(){var t=this;this.toolbarElement=Q("div",{className:"e-de-track-toolbar"}),this.toolbar=new U3({enableRtl:this.owner.enableRtl,items:[{text:this.locale.getConstant("User")+":",cssClass:"e-de-track-toolbar-overlay",disabled:!0},{template:Q("div",{id:"e-de-user-list",attrs:{role:"button"}})},{type:"Separator"},{text:this.locale.getConstant("View")+":",cssClass:"e-de-track-toolbar-overlay",disabled:!0},{template:Q("div",{id:"e-de-revision-list",attrs:{role:"button"}})},{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:Q("div",{id:"e-de-menu-option",attrs:{role:"button"}}),align:"Right",cssClass:"e-de-tc-tbr",tooltipText:this.locale.getConstant("More Options")+"..."}]}),this.toolbar.appendTo(this.toolbarElement),ge(".e-de-nvgte-left",this.toolbarElement).firstChild.classList.add("e-tc-nvgte");ge(".e-de-nvgte-right",this.toolbarElement).firstChild.classList.add("e-tc-nvgte");var e=ge("#e-de-user-list",this.toolbarElement),e=(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(e){t.beforeDropDownItemRender(e,t.selectedUser)}},this.userDropDownButton=new u2(this.userDropDown),this.userDropDownButton.appendTo(e),this.userDropDownButton.content=this.getSpanView(this.userDropDown.items[0].text,0),ge("#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 u2({items:this.viewTypeitems,cssClass:"e-de-track-pane-drop-btn e-tc-btn-bg-clr",select:this.onTypeSelect.bind(this),beforeItemRender:function(e){t.beforeDropDownItemRender(e,t.selectedType)}}),this.viewTypeDropDownButton.content=this.getSpanView(this.viewTypeitems[0].text,1),this.viewTypeDropDownButton.appendTo(e),this.menuoptionEle=ge("#e-de-menu-option",this.toolbarElement);e={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 u2(e),this.menuDropDownButton.appendTo(this.menuoptionEle),this.toolbarElement},Vsi.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"))},Vsi.prototype.onUserOpen=function(e){e=e.element;e.style.maxHeight="200px",e.style.overflowY="auto"},Vsi.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))},Vsi.prototype.getSpanView=function(e,t){return(0===t?'<span class="e-de-track-span-user">':'<span class="e-de-track-span-view">')+e+"</span>"},Vsi.prototype.onMenuSelect=function(e){var t=this,e=e.item.text;e.match(this.locale.getConstant("Accept all"))?setTimeout(function(){t.owner.revisionsInternal.handleRevisionCollection(!0,t.sortedRevisions)},0):e.match(this.locale.getConstant("Reject all"))&&setTimeout(function(){t.owner.revisionsInternal.handleRevisionCollection(!1,t.sortedRevisions)},0),this.updateUsers()},Vsi.prototype.onSelection=function(e){this.currentSelectedRevision=e},Vsi.prototype.onUserSelect=function(e){e=e.item.text;this.selectedUser=e,this.userDropDownButton.content=this.getSpanView(e,0),this.sortCollectionToDisplay()},Vsi.prototype.onTypeSelect=function(e){e=e.item.text;this.selectedType=e,this.viewTypeDropDownButton.content=this.getSpanView(e,1),this.sortCollectionToDisplay()},Vsi.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),this.owner.documentHelper.isDocumentProtected||this.owner.isReadOnly?this.menuDropDownButton.disabled=!0:this.menuDropDownButton.disabled=!1},Vsi.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":this.selectedUser===this.locale.getConstant("All")&&this.selectedType!==this.locale.getConstant("All")?this.locale.getConstant(i.revisionType)===this.selectedType?n.style.display="block":n.style.display="none":this.selectedUser!==this.locale.getConstant("All")&&this.selectedType===this.locale.getConstant("All")?i.user===this.selectedUser?n.style.display="block":n.style.display="none":i.user===this.selectedUser&&this.locale.getConstant(i.revisionType)===this.selectedType?n.style.display="block":n.style.display="none","block"===n.style.display&&this.sortedRevisions.push(this.revisions[t]),e=!0}this.setNoChangesVisibility=!e},Vsi.prototype.enableDisableButton=function(e){this.enableButtons=e,this.updateTrackChanges()},Vsi.prototype.isUpdateTrackChanges=function(e){var t=!1,i=!1;return je(this.changesInfoDiv)||(1===this.changesInfoDiv.childNodes.length&&"e-de-tc-no-chng"==this.changesInfoDiv.childNodes[0].className?i=!0:e!==this.changesInfoDiv.childNodes.length&&(t=!0)),t=i||0<e?!0:t},Vsi.prototype.updateCurrentTrackChanges=function(e){var t;if(je(e)||(t=this.owner.trackChangesPane.changes.get(e)),!je(t)&&0<e.range.length){for(var i=t.singleInnerDiv.querySelector("#textDiv");i.firstChild;)t.removeInnerChilds(i.firstChild),i.removeChild(i.firstChild);t.layoutElementText(e.range,i)}je(e)||0!==e.range.length||this.owner.revisions.remove(e)},Vsi.prototype.updateTrackChanges=function(e){if(e||je(e)){if(this.owner.isUpdateTrackChanges){for(var t=0;t<this.tableRevisions.keys.length;t++){var i=this.tableRevisions.keys[t],n=this.revisions.indexOf(i),o=this.tableRevisions.get(i)[this.tableRevisions.get(i).length-1]===i;je(this.changes)||(this.changes.get(i),o&&!je(this.changesInfoDiv)&&((o=this.changes.get(i)).removeEvents(),o.removeInnerChilds(o.outerSingleDiv),this.changesInfoDiv.removeChild(o.outerSingleDiv))),this.renderedChanges.containsKey(i)&&this.renderedChanges.remove(i),this.changes.containsKey(i)&&this.changes.remove(i),this.revisions.splice(n,1)}this.tableRevisions.clear()}else this.tableRevisions.clear(),this.renderedChanges.clear(),this.removeAllChanges();if(this.enableButtons||this.menuoptionEle.classList.contains("e-de-overlay")?!this.menuoptionEle.classList.contains("e-de-overlay")||this.owner.documentHelper.isDocumentProtected||this.owner.isReadOnly||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}),this.owner.isUpdateTrackChanges){for(var r=0,t=0;t<this.owner.revisions.changes.length;t++){i=this.owner.revisions.changes[t],h=this.owner.revisions.changes[t].range[0];if(this.changes.containsKey(i))je(s=this.renderedChanges.get(i))||(this.enableButtons?s.acceptButtonElement.classList.contains("e-de-overlay")&&!this.owner.documentHelper.isTrackedOnlyMode&&(s.acceptButtonElement.classList.remove("e-de-overlay"),s.rejectButtonElement.classList.remove("e-de-overlay")):s.acceptButtonElement.classList.contains("e-de-overlay")||(s.acceptButtonElement.classList.add("e-de-overlay"),s.rejectButtonElement.classList.add("e-de-overlay")),r++);else if(h instanceof Cri)if(1<(l=this.groupTableRevisions(this.owner.revisions.changes,t)).length){0===r&&(r=t);for(d=void 0,p=0;p<l.length;p++){u=l[p];0===p?(s=new _si(this.owner,this),this.changesInfoDiv.insertBefore(s.createSingleChangesDiv(u),this.changesInfoDiv.children[r+1]),this.revisions.splice(t,0,u),this.changes.add(u,s),this.renderedChanges.add(u,s),d=this.changes.get(i)):(c=u.range[0],d.appendRowToTable(c,p),this.revisions.splice(t+p,0,u),this.changes.add(u,d)),this.tableRevisions.add(u,l)}r++}else{var s=new _si(this.owner,this);this.changesInfoDiv.insertBefore(s.createSingleChangesDiv(i),this.changesInfoDiv.children[t+1]),this.revisions.splice(t,0,i),this.changes.add(i,s),this.renderedChanges.add(i,s),this.tableRevisions.add(i,l)}}for(var a=document.getElementsByClassName("e-de-track-chngs-count").length,t=0;t<a;t++)document.getElementsByClassName("e-de-track-chngs-count")[t].innerHTML=this.locale.getConstant("Changes")+" "+(t+1).toString()+" "+this.locale.getConstant("of")+" "+a.toString()}else{for(t=0;t<this.owner.revisions.changes.length;t++){var l,i=this.owner.revisions.changes[t],h=this.owner.revisions.changes[t].range[0];if(!((h instanceof pli||h instanceof Zai)&&h.paragraph.containerWidget instanceof Iai&&je(h.paragraph.containerWidget.sectionFormat)))if(!this.changes.containsKey(i))if(h instanceof Cri)if(1<(l=this.groupTableRevisions(this.owner.revisions.changes,t)).length)for(var d=void 0,p=0;p<l.length;p++){var c,u=l[p];0===p?(this.addChanges(u),d=this.changes.get(i)):(c=u.range[0],d.appendRowToTable(c,p),this.revisions.push(u),this.changes.add(u,d)),this.tableRevisions.add(u,l)}else this.addChanges(i);else this.addChanges(i)}for(t=0;t<this.renderedChanges.keys.length;t++)(d=this.renderedChanges.get(this.renderedChanges.keys[t])).updateRevisionIndexAndCount(t+1,this.renderedChanges.keys.length)}this.sortCollectionToDisplay(),this.updateUsers(),e&&(this.currentSelectedRevision=this.currentSelectedRevisionInternal,this.updateHeight(),this.owner.resize())}else this.currentSelectedRevision=void 0},Vsi.prototype.groupTableRevisions=function(e,t){for(var i=e[t],n=[i],o=i.revisionType,r=i.range[0].ownerBase,s=r.ownerTable,a=r.index,l=this.owner.documentHelper.layout.getParentTable(s),h=t+1;h<e.length;h++){var d=e[h],p=d.revisionType,c=d.range[0];if(!(c instanceof Cri)){var u=void 0;if(c instanceof Eri?u=c.ownerBase:c instanceof Xai&&(u=c.line.paragraph),u instanceof Lai&&u.isInsideTable){g=u.associatedCell.ownerTable,u=this.owner.documentHelper.layout.getParentTable(g);if(s.equals(g)||!s.equals(g)&&!je(l)&&l.equals(u))continue}break}var u=c.ownerBase,g=u.ownerTable,c=u.index;if(s.equals(g)||je(l)||!l.equals(this.owner.documentHelper.layout.getParentTable(g))){if(o!==p||i.author!==d.author||!s.equals(g)||a+1!==c)break;n.push(d),a=c}}return n},Vsi.prototype.updateUsers=function(){0<this.users.length&&(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}))},Vsi.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"},Vsi.prototype.removeAllChanges=function(){for(;1<this.changesInfoDiv.childNodes.length;)this.changesInfoDiv.removeChild(this.changesInfoDiv.lastChild);if(this.revisions=[],this.changes&&0<this.changes.length){for(var e=0;e<this.changes.length;e++){var t=this.changes.keys[e];this.changes.get(t).clear()}this.changes.clear()}},Vsi.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},Vsi.prototype.destroy=function(){if(this.changes&&0<this.changes.length){for(var e=0;e<this.changes.length;e++){var t=this.changes.keys[e];this.changes.get(t).destroy()}this.changes.clear()}this.changes=void 0,this.toolbar&&(this.toolbar.destroy(),this.toolbar=void 0),this.closeButton&&this.closeButton.parentElement&&this.closeButton.parentElement.removeChild(this.closeButton),this.closeButton=void 0,this.userDropDownButton&&(this.userDropDownButton.destroy(),this.userDropDownButton=void 0),this.menuDropDownButton&&(this.menuDropDownButton.destroy(),this.menuDropDownButton=void 0),this.viewTypeDropDownButton&&(this.viewTypeDropDownButton.destroy(),this.viewTypeDropDownButton=void 0),this.userDropDown&&(this.userDropDown=void 0),0<this.users.length&&(this.users=[],this.users=void 0),this.trackChangeDiv&&(this.trackChangeDiv.innerHTML="",this.trackChangeDiv.parentElement)&&this.trackChangeDiv.parentElement.removeChild(this.trackChangeDiv),this.trackChangeDiv=void 0,this.changesInfoDiv&&(this.changesInfoDiv.innerHTML="",this.changesInfoDiv.parentElement)&&this.changesInfoDiv.parentElement.removeChild(this.changesInfoDiv),this.changesInfoDiv=void 0,this.commentReviewPane&&(this.commentReviewPane=void 0),this.tableRevisions&&(this.tableRevisions.destroy(),this.tableRevisions=void 0),this.renderedChanges&&(this.renderedChanges.destroy(),this.renderedChanges=void 0),this.currentSelectedRevisionInternal=void 0,this.selectedUser=void 0,this.selectedType=void 0,this.sortedRevisions=[],this.sortedRevisions=void 0,this.viewTypeitems=[],this.viewTypeitems=void 0,this.userDropDownitems=[],this.userDropDownitems=void 0,this.revisions=[],this.revisions=void 0,this.owner=void 0},Vsi.prototype.addChanges=function(e){var t=new _si(this.owner,this);this.changesInfoDiv.appendChild(t.createSingleChangesDiv(e)),this.enableButtons?t.acceptButtonElement.classList.contains("e-de-overlay")&&!this.owner.documentHelper.isTrackedOnlyMode&&(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),this.renderedChanges.add(e,t)},Vsi.prototype.navigatePreviousChanges=function(){this.revisionNavigateInternal(!1)},Vsi.prototype.navigateNextChanges=function(){this.revisionNavigateInternal(!0)},Vsi.prototype.revisionNavigateInternal=function(e){var t,i,n=this.renderedChanges.keys;if(!this.currentSelectedRevisionInternal){if(0===n.length)return;this.currentSelectedRevision=n[0]}this.currentSelectedRevision&&(i=this.currentSelectedRevision,t=(n=n).indexOf(i),i=e?t===n.length-1?n[0]:n[t+1]:0===t?n[n.length-1]:n[t-1],(this.owner.documentHelper.currentSelectedRevision=i).range[0]instanceof Cri?(e=this.groupTableRevisions(this.owner.revisions.changes,this.owner.revisions.changes.indexOf(i)),this.owner.selectionModule.selectTableRevision(e)):this.owner.selectionModule.selectRevision(i)),this.currentSelectedRevision=this.owner.documentHelper.currentSelectedRevision};var Nsi=Vsi;function Vsi(e,t){this.users=[],this.enableButtons=!0,this.viewTypeitems=[],this.sortedRevisions=[],this.noChangesVisibleInternal=!0,this.isTrackingPageBreak=!1,this.tableRevisions=new uJt,this.owner=e,this.commentReviewPane=t,this.locale=new Cn("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,F.isIE||this.commentReviewPane.reviewTab.refresh(),this.owner.enableRtl?this.closeButton=Q("button",{className:"e-de-close-icon e-btn e-flat e-icon-btn",id:"close",attrs:{type:"button",style:"position:absolute;top:6px;left:1px"}}):this.closeButton=Q("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=this.locale.getConstant("Close"),this.closeButton.setAttribute("aria-label",this.locale.getConstant("Close"));e=Q("span",{className:"e-de-op-close-icon e-de-close-icon e-btn-icon e-icons"});this.closeButton.appendChild(e),this.commentReviewPane.reviewTab.element.appendChild(this.closeButton),this.closeButton.addEventListener("click",this.commentReviewPane.closePane.bind(this.commentReviewPane))}Hsi.prototype.updateRevisionIndexAndCount=function(e,t){this.changesCount.innerHTML=this.locale.getConstant("Changes")+" "+e.toString()+" "+this.locale.getConstant("of")+" "+t.toString()},Hsi.prototype.createSingleChangesDiv=function(e){this.revision=e,this.user=e.author,this.outerSingleDiv=Q("div",{className:"e-de-tc-outer"}),this.singleInnerDiv=Q("div",{className:"e-de-trckchanges-inner"}),this.singleInnerDiv.addEventListener("click",this.selectRevisionHandler),this.outerSingleDiv.appendChild(this.singleInnerDiv);var t=Q("div",{className:"e-de-track-usernme-div"}),i=Q("div",{className:"e-de-track-user-nme"}),i=(i.textContent=go.sanitize(e.author),je(e.author)||(t.style.display="flex",this.owner.documentHelper.getAvatar(t,i,void 0,e)),Q("div")),i=("Insertion"===e.revisionType?(this.revisionType="Inserted",i.innerHTML=this.locale.getConstant("Inserted").toUpperCase(),i.classList.add("e-de-track-insert")):"Deletion"===e.revisionType?(this.revisionType="Deleted",i.innerHTML=this.locale.getConstant("Deleted").toUpperCase(),i.classList.add("e-de-track-delete")):"MoveFrom"===e.revisionType?(this.revisionType="MoveFrom",i.innerHTML=this.locale.getConstant("Move From").toUpperCase(),i.classList.add("e-de-track-delete"),i.style.whiteSpace="nowrap"):"MoveTo"===e.revisionType&&(this.revisionType="MoveTo",i.innerHTML=this.locale.getConstant("Move To").toUpperCase(),i.classList.add("e-de-track-insert"),i.style.whiteSpace="nowrap"),t.appendChild(i),this.singleInnerDiv.appendChild(t),Q("div",{className:"e-de-track-date",innerHTML:Y.getModifiedDate(e.date)})),t=(this.singleInnerDiv.appendChild(i),Q("div",{id:"textDiv",className:"e-de-track-chngs-text"})),i=(this.layoutElementText(e.range,t),this.singleInnerDiv.appendChild(t),Q("div",{styles:"display:inline-block;width:100%"})),t=(this.singleInnerDiv.appendChild(i),Q("div",{styles:"float:left;"})),t=(this.acceptButtonElement=Q("button",{className:"e-de-track-accept-button"}),this.acceptButton=new zv({cssClass:"e-outline e-success",content:this.locale.getConstant("Accept")}),this.acceptButtonElement.setAttribute("aria-label",this.locale.getConstant("Accept")),t.appendChild(this.acceptButtonElement),i.appendChild(t),this.acceptButton.appendTo(this.acceptButtonElement),this.owner.documentHelper.isTrackedOnlyMode&&this.acceptButtonElement.classList.add("e-de-overlay"),this.acceptButtonElement.addEventListener("click",this.acceptButtonClickHandler),t=Q("div",{styles:"float:left;"}),this.rejectButtonElement=Q("button",{className:"e-de-track-reject-button"}),this.rejectButton=new zv({cssClass:"e-outline e-danger",content:this.locale.getConstant("Reject")}),this.rejectButtonElement.setAttribute("aria-label",this.locale.getConstant("Reject")),t.appendChild(this.rejectButtonElement),i.appendChild(t),this.rejectButton.appendTo(this.rejectButtonElement),this.owner.documentHelper.isTrackedOnlyMode&&this.rejectButtonElement.classList.add("e-de-overlay"),this.rejectButtonElement.addEventListener("click",this.rejectButtonClickHandler),this.changesCount=Q("div",{className:"e-de-track-chngs-count",styles:"float:right;"}),this.owner.revisions.changes.indexOf(e)+1),e=this.owner.revisions.changes.length;return this.changesCount.innerHTML=this.locale.getConstant("Changes")+" "+t.toString()+" "+this.locale.getConstant("of")+" "+e.toString(),i.appendChild(this.changesCount),this.outerSingleDiv},Hsi.prototype.appendRowToTable=function(e,t){this.tableElement.insertRow();for(var i=0;i<e.ownerBase.childWidgets.length;i++)this.tableElement.rows[t].insertCell(),this.tableElement.rows[t].cells[i].classList.add("e-de-tc-tble-cell")},Hsi.prototype.selectRevision=function(){var e;this.revision.range[0]instanceof Cri?(e=this.trackChangesPane.groupTableRevisions(this.owner.revisions.changes,this.owner.revisions.changes.indexOf(this.revision)),this.owner.selectionModule.selectTableRevision(e)):(this.owner.selectionModule.selectRevision(this.revision),this.trackChangesPane.onSelection(this.revision))},Hsi.prototype.layoutElementText=function(e,t){for(var i="",n=!(t.style.width="100%"),o=!1,r=0;r<e.length;r++){var s,a,l=e[r];if(l instanceof Zai&&1===l.fieldType)n=!1;else if((o=l instanceof Zai&&0===l.fieldType&&(s=this.owner.selectionModule.getFieldCode(l)).match("HYPERLINK ")&&e[e.indexOf(l.fieldEnd)-1]instanceof pli?!0:o)&&l instanceof Zai&&(2===l.fieldType||1===l.fieldType))o=n=!1;else if(!(n||l instanceof yhi))if(l instanceof Zai&&0===l.fieldType&&(n=!0),l instanceof pli)i+=l.text;else if(l instanceof Zai&&0===l.fieldType){if((s=this.owner.selectionModule.getFieldCode(l)).match("TOC ")||s.match("Toc"))return i+="<Table of Content>",void t.appendChild(this.addSpan(i));s.match("HYPERLINK ")&&!o||s.match("MERGEFIELD")||s.match("FORMTEXT")||s.match("PAGE ")?i+=this.owner.editorModule.retrieveFieldResultantText(l.fieldEnd):l.formFieldData&&(h=this.owner.documentHelper.textHelper.repeatChar(this.owner.documentHelper.textHelper.getEnSpaceCharacter(),5),""!==i&&(t.appendChild(this.addSpan(i)),i=""),l.formFieldData instanceof ili?t.appendChild(this.addSpan(""===l.formFieldData.defaultValue?h:l.formFieldData.defaultValue,"e-de-tc-field")):l.formFieldData instanceof lli?t.appendChild(this.addSpan(0<l.formFieldData.dropdownItems.length?l.formFieldData.dropdownItems[0]:h,"e-de-tc-field")):t.appendChild(this.addSpan(l.formFieldData.checked?String.fromCharCode(9745):String.fromCharCode(9744),"e-de-tc-field")))}else if(l instanceof rhi){""!==i&&(t.appendChild(this.addSpan(i)),i="");var h=Q("img");h.setAttribute("src",this.owner.documentHelper.getImageString(l)),h.classList.add("e-de-tc-shrink-img"),t.appendChild(h)}else{if(l instanceof Cri){this.tableElement=Q("table"),this.tableElement.classList.add("e-de-track-chng-table"),this.tableElement.insertRow();for(var d=0;d<l.ownerBase.childWidgets.length;d++)this.tableElement.rows[0].insertCell(),this.tableElement.rows[0].cells[d].classList.add("e-de-tc-tble-cell");return void t.appendChild(this.tableElement)}l instanceof Eri&&(""!==i&&(t.appendChild(this.addSpan(i)),i=""),a="¶",l.ownerBase instanceof Lai&&l.ownerBase.isEndsWithPageBreak&&(a="............Page Break............"+a),t.appendChild(this.addSpan(a,"e-de-tc-pmark")),t.appendChild(Q("br")))}}t.appendChild(this.addSpan(i))},Hsi.prototype.addSpan=function(e,t){var i=Q("span");return i.textContent=e,t&&i.classList.add(t),i},Hsi.prototype.acceptButtonClick=function(){this.revision.accept(),this.owner.enableHeaderAndFooter&&this.owner.editorModule.updateHeaderFooterWidget()},Hsi.prototype.rejectButtonClick=function(){this.revision.reject(),this.owner.enableHeaderAndFooter&&this.owner.editorModule.updateHeaderFooterWidget()},Hsi.prototype.removeFromParentCollec=function(){this.trackChangesPane.changes.containsKey(this.revision)&&this.trackChangesPane.changes.remove(this.revision),-1!==this.trackChangesPane.revisions.indexOf(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()},Hsi.prototype.removeInnerChilds=function(e){if(e)for(;e.firstChild;)0<e.firstChild.childNodes.length&&this.removeInnerChilds(e.firstChild),e.removeChild(e.firstChild)},Hsi.prototype.removeEvents=function(){this.outerSingleDiv&&this.outerSingleDiv.removeEventListener("click",this.selectRevisionHandler),this.acceptButtonElement&&this.acceptButtonElement.removeEventListener("click",this.acceptButtonClickHandler),this.rejectButtonElement&&this.rejectButtonElement.removeEventListener("click",this.rejectButtonClickHandler)},Hsi.prototype.clear=function(){this.removeFromParentCollec(),this.removeEvents(),this.removeInnerChilds(this.outerSingleDiv),this.acceptButton&&(this.acceptButton.destroy(),this.acceptButton=void 0),this.rejectButton&&(this.rejectButton.destroy(),this.rejectButton=void 0),this.acceptButtonElement&&(this.acceptButtonElement.innerHTML="",this.acceptButtonElement.parentElement&&this.acceptButtonElement.parentElement.removeChild(this.acceptButtonElement),this.acceptButtonElement=void 0),this.rejectButtonElement&&(this.rejectButtonElement.innerHTML="",this.rejectButtonElement.parentElement&&this.rejectButtonElement.parentElement.removeChild(this.rejectButtonElement),this.rejectButtonElement=void 0),this.tableElement&&(this.tableElement.innerHTML="",this.tableElement.parentElement&&this.tableElement.parentElement.removeChild(this.tableElement),this.tableElement=void 0),this.singleInnerDiv&&(this.singleInnerDiv.innerHTML="",this.singleInnerDiv.parentElement&&this.singleInnerDiv.parentElement.removeChild(this.singleInnerDiv),this.singleInnerDiv=void 0),this.outerSingleDiv&&(this.outerSingleDiv.innerHTML="",this.outerSingleDiv.parentElement&&this.outerSingleDiv.parentElement.removeChild(this.outerSingleDiv),this.outerSingleDiv=void 0)},Hsi.prototype.destroy=function(){this.removeEvents(),this.removeInnerChilds(this.outerSingleDiv),this.acceptButton&&(this.acceptButton.destroy(),this.acceptButton=void 0),this.rejectButton&&(this.rejectButton.destroy(),this.rejectButton=void 0),this.acceptButtonElement&&(this.acceptButtonElement.innerHTML="",this.acceptButtonElement.parentElement&&this.acceptButtonElement.parentElement.removeChild(this.acceptButtonElement),this.acceptButtonElement=void 0),this.rejectButtonElement&&(this.rejectButtonElement.innerHTML="",this.rejectButtonElement.parentElement&&this.rejectButtonElement.parentElement.removeChild(this.rejectButtonElement),this.rejectButtonElement=void 0),this.tableElement&&(this.tableElement.innerHTML="",this.tableElement.parentElement&&this.tableElement.parentElement.removeChild(this.tableElement),this.tableElement=void 0),this.singleInnerDiv&&(this.singleInnerDiv.innerHTML="",this.singleInnerDiv.parentElement&&this.singleInnerDiv.parentElement.removeChild(this.singleInnerDiv),this.singleInnerDiv=void 0),this.outerSingleDiv&&(this.outerSingleDiv.innerHTML="",this.outerSingleDiv.parentElement&&this.outerSingleDiv.parentElement.removeChild(this.outerSingleDiv),this.outerSingleDiv=void 0),this.revision=void 0,this.user=void 0,this.revisionType=void 0,this.trackChangesPane=void 0,this.owner=void 0};var _si=Hsi;function Hsi(e,t){this.selectRevisionHandler=this.selectRevision.bind(this),this.acceptButtonClickHandler=this.acceptButtonClick.bind(this),this.rejectButtonClickHandler=this.rejectButtonClick.bind(this),this.owner=e,this.locale=new Cn("documenteditor",this.owner.defaultLocale),this.locale.setLocale(this.owner.locale),this.trackChangesPane=t}Object.defineProperty(jsi.prototype,"fontTypeface",{get:function(){return this.fntTypeface},set:function(e){this.fntTypeface=e},enumerable:!0,configurable:!0}),Object.defineProperty(jsi.prototype,"fontSchemeList",{get:function(){return this.fntSchemeList},set:function(e){this.fntSchemeList=e},enumerable:!0,configurable:!0}),jsi.prototype.copyFormat=function(e){je(e)||(this.fntTypeface=e.fntTypeface,this.fntSchemeList=e.fntSchemeList)},jsi.prototype.destroy=function(){this.fntTypeface=void 0,this.fntSchemeList=void 0};var zsi=jsi;function jsi(){this.fntTypeface=new uJt,this.fntSchemeList=[],this.fntTypeface=new uJt,this.fntSchemeList=[]}Object.defineProperty(Qsi.prototype,"fontSchemeName",{get:function(){return this.schemeName},set:function(e){this.schemeName=e},enumerable:!0,configurable:!0}),Object.defineProperty(Qsi.prototype,"majorFontScheme",{get:function(){return this.majFontScheme},set:function(e){this.majFontScheme=e},enumerable:!0,configurable:!0}),Object.defineProperty(Qsi.prototype,"minorFontScheme",{get:function(){return this.minFontScheme},set:function(e){this.minFontScheme=e},enumerable:!0,configurable:!0}),Qsi.prototype.copyFormat=function(e){je(e)||(this.schemeName=e.schemeName,this.majFontScheme.copyFormat(e.majFontScheme),this.minFontScheme.copyFormat(e.minFontScheme))},Qsi.prototype.destroy=function(){this.schemeName=void 0,this.majFontScheme=void 0,this.minFontScheme=void 0};var Wsi=Qsi;function Qsi(e){this.majFontScheme=new zsi,this.minFontScheme=new zsi}Object.defineProperty(qsi.prototype,"name",{get:function(){return this.fontName},set:function(e){this.fontName=e},enumerable:!0,configurable:!0}),Object.defineProperty(qsi.prototype,"typeface",{get:function(){return this.fontTypeface},set:function(e){this.fontTypeface=e},enumerable:!0,configurable:!0}),Object.defineProperty(qsi.prototype,"panose",{get:function(){return this.pnose},set:function(e){this.pnose=e},enumerable:!0,configurable:!0}),qsi.prototype.copyFormat=function(e){je(e)||(this.fontName=e.fontName,this.fontTypeface=e.fontTypeface,this.pnose=e.panose)},qsi.prototype.destroy=function(){this.fontName=void 0,this.fontTypeface=void 0,this.pnose=void 0};var Usi=qsi;function qsi(){}Object.defineProperty(Ysi.prototype,"fontScheme",{get:function(){return this.fntScheme},set:function(e){this.fntScheme=e},enumerable:!0,configurable:!0}),Ysi.prototype.copyFormat=function(e){je(e)||this.fntScheme.copyFormat(e.fntScheme)},Ysi.prototype.destroy=function(){this.fntScheme=void 0};var Gsi=Ysi;function Ysi(e){this.fntScheme=new Wsi}Xsi=function(e,t){return(Xsi=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])}))(e,t)};var Xsi,tte=function(e,t){function i(){this.constructor=e}Xsi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ksi=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},Jsi=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Zsi=(Object.defineProperty($si.prototype,"visibleBounds",{get:function(){return this.visibleBoundsIn},enumerable:!0,configurable:!0}),Object.defineProperty($si.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),Object.defineProperty($si.prototype,"containerCanvas",{get:function(){return je(this.containerCanvasIn)&&(this.containerCanvasIn=document.createElement("canvas"),this.containerCanvasIn.getContext("2d").save()),je(this.pageContainer)||this.containerCanvasIn.parentElement===this.pageContainer||this.pageContainer.appendChild(this.containerCanvasIn),this.containerCanvasIn},enumerable:!0,configurable:!0}),$si.prototype.openTextFile=function(e){this.layout.isTextFormat=!0;for(var t=[],i=(t=(e=e.replace(/\r\n/g,"\n")).split("\n"),new Sai),n=(i.sectionFormat=new ari(i),i.childWidgets=[],new Lai),o=new Gai(n),r=0;r<t.length;r++)if(r===t.length-1&&0===t[r].length)n.childWidgets.push(o),n.index=r,(n.containerWidget=i).childWidgets.push(n);else{var s=new Lai,a=new Gai(s);if(0<t[r].length)if(90<t[r].length)for(var l=0,h=90,d=void 0,p=t[r].length/90+1,c=0;c<p;){p-1!=c||(h=t[r].length%90);var u,d=t[r].substring(l,h);(u=new pli).text=d,a.children.push(u),u.line=a,c++,h+=90,l+=90}else(u=new pli).text=t[r],a.children.push(u),u.line=a;s.childWidgets.push(a),s.index=r,(s.containerWidget=i).childWidgets.push(s)}this.onDocumentChanged([i]),this.layout.isTextFormat=!1},Object.defineProperty($si.prototype,"selectionCanvas",{get:function(){return je(this.selectionCanvasIn)&&(this.selectionCanvasIn=document.createElement("canvas"),this.selectionCanvas.getContext("2d").save()),je(this.pageContainer)||this.selectionCanvasIn.parentElement===this.pageContainer||this.pageContainer.appendChild(this.selectionCanvasIn),this.selectionCanvasIn},enumerable:!0,configurable:!0}),Object.defineProperty($si.prototype,"containerContext",{get:function(){return this.containerCanvas.getContext("2d")},enumerable:!0,configurable:!0}),Object.defineProperty($si.prototype,"selectionContext",{get:function(){return this.selectionCanvas.getContext("2d")},enumerable:!0,configurable:!0}),Object.defineProperty($si.prototype,"currentRenderingPage",{get:function(){if(0!==this.pages.length)return this.pages[this.pages.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty($si.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($si.prototype,"selection",{get:function(){return this.owner.selectionModule},enumerable:!0,configurable:!0}),Object.defineProperty($si.prototype,"selectionStartPage",{get:function(){return this.selectionStartPageIn},set:function(e){this.selectionStartPageIn=e},enumerable:!0,configurable:!0}),Object.defineProperty($si.prototype,"selectionEndPage",{get:function(){return this.selectionEndPageIn},set:function(e){this.selectionEndPageIn=e},enumerable:!0,configurable:!0}),Object.defineProperty($si.prototype,"dialog",{get:function(){return this.dialogInternal||this.initDialog(this.owner.enableRtl),this.dialogInternal},enumerable:!0,configurable:!0}),Object.defineProperty($si.prototype,"dialog2",{get:function(){return this.dialogInternal2||this.initDialog2(this.owner.enableRtl),this.dialogInternal2},enumerable:!0,configurable:!0}),Object.defineProperty($si.prototype,"dialog3",{get:function(){return this.dialogInternal3||this.initDialog3(this.owner.enableRtl),this.dialogInternal3},enumerable:!0,configurable:!0}),Object.defineProperty($si.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($si.prototype,"currentSelectedRevision",{get:function(){return this.currentSelectedRevisionInternal},set:function(e){this.currentSelectedRevisionInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty($si.prototype,"isInlineFormFillProtectedMode",{get:function(){return this.isFormFillProtectedMode&&"Inline"===this.owner.documentEditorSettings.formFieldSettings.formFillingMode},enumerable:!0,configurable:!0}),Object.defineProperty($si.prototype,"isFormFillProtectedMode",{get:function(){return this.isDocumentProtected&&"FormFieldsOnly"===this.protectionType},enumerable:!0,configurable:!0}),Object.defineProperty($si.prototype,"isCommentOnlyMode",{get:function(){return this.isDocumentProtected&&"CommentsOnly"===this.protectionType},enumerable:!0,configurable:!0}),Object.defineProperty($si.prototype,"isTrackedOnlyMode",{get:function(){return this.isDocumentProtected&&"RevisionsOnly"===this.protectionType},enumerable:!0,configurable:!0}),$si.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("Heading 7",'{"type":"Paragraph","name":"Heading 7","basedOn":"Normal","next":"Normal","link":"Heading 7 Char","characterFormat":{"italic":true,"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":"Level7"}}'),this.preDefinedStyles.add("Heading 8",'{"type":"Paragraph","name":"Heading 8","basedOn":"Normal","next":"Normal","link":"Heading 8 Char","characterFormat":{"fontSize":10.5,"fontFamily":"Calibri Light","fontColor":"#333333"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level8"}}'),this.preDefinedStyles.add("Heading 9",'{"type":"Paragraph","name":"Heading 9","basedOn":"Normal","next":"Normal","link":"Heading 9 Char","characterFormat":{"fontSize":10.5,"italic":true,"fontFamily":"Calibri Light","fontColor":"#333333"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level9"}}'),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("Heading 7 Char",'{"type":"Character","name":"Heading 7 Char","basedOn":"Default Paragraph Font","characterFormat":{"italic":true,"fontFamily":"Calibri Light","fontColor":"#1F3763"}}'),this.preDefinedStyles.add("Heading 8 Char",'{"type":"Character","name":"Heading 8 Char","basedOn":"Default Paragraph Font","characterFormat":{"fontSize":10.5,"fontFamily":"Calibri Light","fontColor":"#333333"}}'),this.preDefinedStyles.add("Heading 9 Char",'{"type":"Character","name":"Heading 9 Char","basedOn":"Default Paragraph Font","characterFormat":{"fontSize":10.5,"italic":true,"fontFamily":"Calibri Light","fontColor":"#333333"}}'),this.preDefinedStyles.add("Hyperlink",'{"type":"Character","name":"Hyperlink","basedOn":"Default Paragraph Font","next":"Normal","characterFormat":{"fontColor":"#0563C1","underline": "Single"}}'),this.preDefinedStyles.add("TOC 1",'{"type":"Paragraph","name":"TOC 1","basedOn":"Normal","next":"Normal","paragraphFormat":{"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 2",'{"type":"Paragraph","name":"TOC 2","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :11.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 3",'{"type":"Paragraph","name":"TOC 3","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :22.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 4",'{"type":"Paragraph","name":"TOC 4","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :33.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 5",'{"type":"Paragraph","name":"TOC 5","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :44.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 6",'{"type":"Paragraph","name":"TOC 6","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :55.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 7",'{"type":"Paragraph","name":"TOC 7","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :66.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 8",'{"type":"Paragraph","name":"TOC 8","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :77.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("TOC 9",'{"type":"Paragraph","name":"TOC 9","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :88.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("Header",'{"type":"Paragraph","name":"Header","basedOn":"Normal","next":"Header","paragraphFormat":{"afterSpacing":0,"lineSpacing":1,"lineSpacingType":"Multiple"}}'),this.preDefinedStyles.add("Footer",'{"type":"Paragraph","name":"Footer","basedOn":"Normal","next":"Footer","paragraphFormat":{"afterSpacing":0,"lineSpacing":1,"lineSpacingType":"Multiple"}}')},$si.prototype.clearDocumentItems=function(){this.owner.editorModule&&this.owner.editorModule.clear(),this.owner.searchModule&&this.owner.searchModule.clearSearchHighlight(),this.owner.selectionModule&&this.owner.selectionModule.clear(),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()}if(this.comments=[],this.bookmarks.clear(),this.endBookmarksUpdated=[],this.styles.clear(),this.stylesMap.clear(),this.pages&&0<this.pages.length){for(e=0;e<this.pages.length;e++)this.pages[e].componentDestroy();this.pages=[]}if(this.authors.clear(),this.revisionsInternal.clear(),this.owner.revisions.clear(),this.characterFormat.clearFormat(),this.themeFontLanguage.clearFormat(),this.paragraphFormat.clearFormat(),this.owner.trackChangesPane&&this.owner.trackChangesPane.clear(),this.owner.xmlPaneModule&&this.owner.xmlPaneModule.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.contentDropDown&&this.contentDropDown.hidePopup(),this.customXmlData.clear(),this.fontSubstitutionTable.clear(),this.images.clear(),this.contentControlCollection=[],this.backgroundColor="#FFFFFF",this.endnotes.clear(),this.footnotes.clear(),this.footnoteCollection=[],this.endnoteCollection=[],this.lists&&0<this.lists.length)for(e=0;e<this.lists.length;e++)this.lists[e].clear();this.lists=[],this.abstractLists=[],this.themes=new Gsi,this.hasThemes=!1,this.isRestartNumbering=!1},$si.prototype.setDefaultDocumentFormat=function(){this.owner.parser.parseCharacterFormat(0,this.owner.characterFormat,this.characterFormat),this.owner.parser.parseParagraphFormat(0,this.owner.paragraphFormat,this.paragraphFormat)},$si.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.allCaps=!1},$si.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.keepWithNext=!1,e.keepLinesTogether=!1,e.widowControl=!0,e.outlineLevel="BodyText"},$si.prototype.getAbstractListById=function(e,t){if(!je(this.abstractLists))for(var i=0;i<this.abstractLists.length;i++){var n=this.abstractLists[i];if(!je(n)){if(t&&n.nsid===e)return n;if(n.abstractListId===e)return n}}},$si.prototype.getListById=function(e,t){if(!je(this.lists))for(var i=0;i<this.lists.length;i++){var n=this.lists[i];if(!je(n)){if(t&&n.nsid===e)return n;if(n.listId===e)return n}}},$si.getListLevelNumber=function(e){return e.ownerBase instanceof nsi?e.ownerBase.levelNumber:e.ownerBase instanceof tsi&&!je(e.ownerBase.levels)?e.ownerBase.levels.indexOf(e):-1},$si.prototype.getImageString=function(e){var t=this.images.get(parseInt(e.imageString)),e=e.isMetaFile&&".svg"!==Y.formatClippedString(t[0]).extension||".tif"===Y.formatClippedString(t[0]).extension?t[1]:t[0];return e},$si.prototype.addBase64StringInCollection=function(a){return Ksi(this,void 0,void 0,function(){var t,i,n,o,r,s;return Jsi(this,function(e){for(t=0<this.images.length?Math.max.apply(Math,this.images.keys)+1:0,i=!0,n=[],o=0;o<this.images.length;o++){if(r=this.images.keys[parseInt(o.toString(),10)],s=this.images.get(r),a.isMetaFile&&a.metaFileImageString===s[0]){t=r,i=!1;break}if(a.imageString===s[0]){t=r,i=!1;break}}return i&&(a.isMetaFile?(n.push(je(a.metaFileImageString)?a.imageString:a.metaFileImageString),n.push(""===a.imageString?a.metaFileImageString:a.imageString)):n.push(a.imageString),this.images.add(t,n)),a.isMetaFile&&!je(a.metaFileImageString)&&(a.metaFileImageString=t.toString()),a.imageString=t.toString(),[2]})})},$si.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},$si.prototype.selectComment=function(e){var t=this;this.owner.selectionModule&&this.owner.commentReviewPane&&(this.owner.showComments=!0,setTimeout(function(){t.owner&&t.owner.selectionModule&&t.owner.selectionModule.selectComment(e)}))},$si.prototype.showComments=function(e){this.owner&&e&&this.owner.enableComment&&this.owner.trigger(zJt,{type:"Comment"}),this.owner.commentReviewPane.reviewTab.hideTab(0,!1),this.owner.commentReviewPane.reviewTab.hideTab(1,!1),this.owner.commentReviewPane.showHidePane(e&&this.owner.enableComment,"Comments")},$si.prototype.showRevisions=function(e){this.showRevision=e,this.owner&&e&&this.owner.trigger(zJt,{type:"comment"}),!e&&this.owner.showComments?(this.owner.commentReviewPane.reviewTab.hideTab(0,!1),this.owner.commentReviewPane.showHidePane(!0,"Comments")):(this.owner.commentReviewPane.showHidePane(e,"Changes"),this.owner.enableComment,this.showRevision=!1),e&&this.owner.trackChangesPane.enableDisableButton(!this.owner.isReadOnly&&!this.isDocumentProtected)},$si.prototype.initializeComponents=function(){var e,t=this.owner.element;je(t)||(this.optionsPaneContainer=Q("div",{className:"e-documenteditor-optionspane"}),this.optionsPaneContainer.contentEditable="false",t.appendChild(this.optionsPaneContainer),this.owner.enableRtl&&(e="direction:ltr;"),this.viewerContainer=Q("div",{id:this.owner.containerId+"_viewerContainer"}),this.viewerContainer.style.cssText="position:relative;backgroundColor:#FBFBFB;overflow:auto;"+e,this.optionsPaneContainer.appendChild(this.viewerContainer),this.viewerContainer.tabIndex=-1,this.viewerContainer.style.outline="none",this.pageContainer=Q("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",F.isDevice?this.createEditableDiv(t):this.createEditableIFrame(),this.owner.enableImageResizerMode&&this.owner.imageResizerModule.initializeImageResizer(),this.updateViewerSizeInternal(t),this.layout=new dsi(this),this.textHelper=new lsi(this),this.zoomModule=new Asi(this),this.initTouchEllipse(),this.wireEvent(),this.restrictEditingPane=new Psi(this),this.owner.commentReviewPane=new spi(this.owner),this.owner.trackChangesPane=new Nsi(this.owner,this.owner.commentReviewPane),mA({target:this.owner.element,cssClass:"e-spin-overlay"}))},$si.prototype.measureScrollbarWidth=function(e){var t=document.createElement("div"),e=(t.style.cssText="visibility:hidden;overflow:scroll;",e.appendChild(t),document.createElement("div"));t.appendChild(e),this.scrollbarWidth=t.getBoundingClientRect().width-e.getBoundingClientRect().width,t.parentNode.removeChild(t)},$si.prototype.createEditableDiv=function(e){this.editableDiv=document.createElement("div"),this.editableDiv.contentEditable=this.owner.isReadOnlyMode?"false":"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)},$si.prototype.createEditableIFrame=function(){this.iframe=Q("iframe",{attrs:{scrolling:"no",title:"Document Editor",style:"pointer-events:none;position:absolute;left:0px;top:0px;outline:none;background-color:transparent;width:0px;height:0px;overflow:hidden",tabindex:"0"},className:"e-de-text-target"}),this.viewerContainer.appendChild(this.iframe),this.initIframeContent()},$si.prototype.initIframeContent=function(){var e='<!DOCTYPE html>\n            <html lang="'+this.owner.locale+'">\n            <head></head>\n            <body spellcheck="false">\n                <div contenteditable="true"></div>\n            </body>\n            </html>';je(this.iframe.contentDocument)||(this.iframe.contentDocument.open(),this.iframe.contentDocument.write(e),this.iframe.contentDocument.close(),this.editableDiv=this.iframe.contentDocument.body.children[0],rt(this.iframe.contentDocument.body,e="background-color:transparent;width:100%;height:100%;padding: 0px; margin: 0px"),rt(this.editableDiv,e))},$si.prototype.wireEvent=function(){je(this.owner.selectionModule)||this.selection.initCaret(),this.wireInputEvents(),je(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),window.addEventListener("touchend",this.onImageResizer),window.addEventListener("copy",this.onCopy),this.viewerContainer.addEventListener("touchstart",this.onTouchStartInternal),this.viewerContainer.addEventListener("touchmove",this.onTouchMoveInternal),this.viewerContainer.addEventListener("touchend",this.onTouchUpInternal),void 0!==navigator&&navigator.userAgent.match("Firefox")&&this.viewerContainer.addEventListener("DOMMouseScroll",this.zoomModule.onMouseWheelInternal),this.viewerContainer.addEventListener("mousewheel",this.zoomModule.onMouseWheelInternal),this.editableDiv.addEventListener("focus",this.updateFocus)},$si.prototype.wireInputEvents=function(){je(this.editableDiv)||(this.editableDiv.addEventListener("paste",this.onPaste),F.isDevice?this.editableDiv.addEventListener("input",this.onTextInputInternal):(this.editableDiv.addEventListener("keypress",this.onKeyPressInternal),"chrome"===F.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))},$si.prototype.onIframeLoad=function(){je(this.iframe)||0!==this.iframe.contentDocument.body.children.length||(this.initIframeContent(),this.wireInputEvents())},$si.prototype.getEditableDivTextContent=function(){return this.editableDiv.textContent},$si.prototype.updateAuthorIdentity=function(){for(var e=this.owner.revisions.changes,t=0;t<e.length;t++)this.getAuthorColor(e[t].author)},$si.prototype.getAvatar=function(e,t,i,n){var o,r,s;je(i)?r=n.author:(r=i.author,o=i.initial),je(r)||(n=Q("div",{className:"e-de-cmt-avatar"}),(i=Q("div",{className:"e-de-ff-cmt-avatar"})).style.backgroundColor=this.owner.documentHelper.getAuthorColor(r),""===o||je(o)?(s=(r=r.split(" "))[0].charAt(0),1<r.length&&""!==r[r.length-1]&&(s+=r[r.length-1][0]),i.innerText=s.toUpperCase()):2<o.length?i.innerText=o.substring(0,2):i.innerText=o,n.appendChild(i),n.appendChild(t),e.appendChild(n))},$si.prototype.getAuthorColor=function(e){var t;return this.authors.containsKey(e)?this.authors.get(e):(t=0===this.authors.length?"#b5082e":this.generateRandomColor(),this.authors.add(e,t),t)},$si.prototype.generateRandomColor=function(){return["#b5082e","#2e97d3","#bb00ff","#f37e43","#03a60b","#881824","#e09a2b","#50565e"][this.authors.length%8]},$si.prototype.positionEditableTarget=function(){var e=this.selection.getRect(this.selection.start),t=this.selection.getSelectionPage(this.selection.start),i=t.bodyWidgets[0].sectionFormat,t=t.boundingRectangle.x+Y.convertPointToPixel(i.leftMargin)*this.zoomFactor,n=e.y,i=i.pageWidth-i.leftMargin-i.rightMargin,o="left:"+t+"px;",o=(o+="top:"+n+"px;")+"width:"+Y.convertPointToPixel(i)*this.zoomFactor+"px;";rt(this.iframe,o+="height:250px;outline-style:none;position:absolute");n=(n=(n=(n="background-color:transparent;width:100%;height:250px;padding: 0px; margin: 0px;")+"text-indent:"+(e.x-t)+"px;color:transparent;pointer-events:none;outline-style:none;")+"font-size:"+Y.convertPointToPixel(this.selection.characterFormat.fontSize)*this.zoomFactor+"px;")+"font-family"+this.selection.characterFormat.fontFamily+";";rt(this.editableDiv,n+="overflow:hidden;text-decoration:none;white-space:normal;")},$si.prototype.initDialog=function(e){this.dialogInternal||(this.dialogTarget1=Q("div",{className:"e-de-dlg-target"}),this.dialogTarget1.contentEditable="false",document.body.appendChild(this.dialogTarget1),e&&this.dialogTarget1.classList.add("e-de-rtl"),this.dialogInternal=new pS({target:this.owner.documentEditorSettings.popupTarget,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))},$si.prototype.initDialog3=function(e){this.dialogInternal3||(this.dialogTarget3=Q("div",{className:"e-de-dlg-target"}),this.dialogTarget3.contentEditable="false",document.body.appendChild(this.dialogTarget3),e&&this.dialogTarget3.classList.add("e-de-rtl"),this.dialogInternal3=new pS({target:this.owner.documentEditorSettings.popupTarget,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))},$si.prototype.hideDialog=function(){this.dialog.hide(),this.updateFocus()},$si.prototype.initDialog2=function(e){this.dialogInternal2||(this.dialogTarget2=Q("div",{className:"e-de-dlg-target"}),this.dialogTarget2.contentEditable="false",document.body.appendChild(this.dialogTarget2),e&&this.dialogTarget2.classList.add("e-de-rtl"),this.dialogInternal2=new pS({target:this.owner.documentEditorSettings.popupTarget,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))},$si.prototype.getBase64=function(t,r,s){return Ksi(this,void 0,void 0,function(){return Jsi(this,function(e){return[2,new Promise(function(n,e){var o=new Image;o.onload=function(){var e=Math.max(1,window.devicePixelRatio||1),t=document.createElement("canvas"),i=(t.width=r*e,t.height=s*e,t.getContext("2d")),e=(i.scale(e,e),i.drawImage(o,0,0,r,s),t.toDataURL("image/png",1));n(e)},o.onerror=function(){e()},t&&(Y.startsWith(t,"http://")||Y.startsWith(t,"https://"))&&fetch(t,{cache:"no-cache"}).then(function(e){return e.blob()}).then(function(n){return new Promise(function(e,t){var i=new FileReader;i.onloadend=function(){return e(i.result)},i.onerror=t,i.readAsDataURL(n)})}).then(function(e){o.src=e}).catch(function(){e()})})]})})},$si.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"},$si.prototype.onDocumentChanged=function(e,t){var i=this;this.clearContent(),this.owner.editorModule&&(this.owner.editorModule.tocStyles={},this.owner.editorModule.tocBookmarkId=0),this.heightInfoCollection={},this.owner.isDocumentLoaded=!1,this.viewer.columnLayoutArea.clear(),this.layout.isDocumentContainsRtl=!1,this.layout.isMultiColumnDoc=!1,this.isMappedContentControlUpdated=!0,this.isSpellCheckPending=!1,this.updateAuthorIdentity();for(var n=0;n<this.pages.length;n++)for(var o=0;o<this.pages[n].bodyWidgets.length;o++)this.pages[n].bodyWidgets[o].destroy();if(this.pages=[],je(this.renderedLists)||this.renderedLists.clear(),je(this.renderedLevelOverrides)||(this.renderedLevelOverrides=[]),je(this.owner.editorHistoryModule)||this.owner.editorHistoryModule.destroy(),this.owner.isDocumentLoaded=!0,this.owner.isUpdateTrackChanges=!1,this.layout.isInitialLoad=!0,this.layout.footHeight=0,this.layout.footnoteHeight=0,this.layout.layoutItems(e,!1),this.owner.selectionModule&&(this.selection.previousSelectedFormField=void 0,0<this.formFields.length&&this.owner.selectionModule.highlightFormFields(),this.owner.selectionModule.editRangeCollection=[],this.owner.selectionModule.selectRange(this.owner.documentStart,this.owner.documentStart),this.isDocumentProtected&&"FormFieldsOnly"==this.protectionType&&this.owner.selectionModule.navigateToNextFormField(),this.isDocumentProtected)&&this.restrictEditingPane.showHideRestrictPane(!0),!je(t)&&this.owner.editorModule&&this.owner.editorModule.intializeDefaultStyles(),this.owner.enableCollaborativeEditing&&this.owner.collaborativeEditingHandlerModule&&this.owner.enableEditor){if(this.owner.editorModule.isRemoteAction=!0,this.owner.editorModule.isIncrementalSave=!0,t&&!je(t[iri[0]])&&!je(0<t[iri[0]].length))for(var r=0;r<t[iri[0]].length;r++)this.owner.collaborativeEditingHandlerModule.applyRemoteAction("action",t[iri[0]][r]);this.owner.editorModule.isRemoteAction=!1,this.owner.editorModule.isIncrementalSave=!1,this.owner.selectionModule.selectRange(this.owner.documentStart,this.owner.documentStart)}this.owner.optionsPaneModule&&this.owner.optionsPaneModule.showHideOptionsPane(!1),this.restrictEditingPane.restrictPane&&!this.isDocumentProtected&&this.restrictEditingPane.showHideRestrictPane(!1),this.owner.xmlPaneModule&&(this.owner.editor.XMLFilesNameSpaceCount=1,this.owner.xmlPaneModule.showXmlProperties(!1),this.owner.xmlPaneModule.isXmlPaneShow=!1),!je(this.owner.selectionModule)&&this.owner.selectionModule.isViewPasteOptions&&(this.owner.selectionModule.isViewPasteOptions=!1,this.owner.selectionModule.showHidePasteOptions(void 0,void 0)),this.owner.fireDocumentChange(),this.owner.showHideRulers(),setTimeout(function(){!je(i.owner)&&i.owner.showRevisions&&i.showRevisions(!0),je(i.owner)||(i.owner.isUpdateTrackChanges=!0)}),je(document.getElementById(this.owner.element.id+"PICTURE_CONTENT_CONTROL"))||this.owner.renderPictureContentControlElement(this.owner,!1,!1),this.layout.isInitialLoad=!1},$si.prototype.initTouchEllipse=function(){var e="height: 30px;width: 30px;position: absolute;background-color: transparent;margin: 0px;padding: 0px;z-index:5",t=" 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;",i=(this.touchStart=Q("div",{className:"e-touch-ellipse",styles:e}),Q("div",{styles:t})),e=(this.touchEnd=Q("div",{className:"e-touch-ellipse",styles:e}),this.touchStart.style.display="none",Q("div",{styles:t}));this.touchStart.appendChild(i),this.touchEnd.appendChild(e),this.touchEnd.style.display="none",this.viewerContainer.appendChild(this.touchStart),this.viewerContainer.appendChild(this.touchEnd)},$si.prototype.updateTouchMarkPosition=function(){var e,t,i;"none"===this.touchStart.style.display||je(this.selection)||(this.selection.isEmpty?this.selection.updateCaretPosition():(e=this.selection.getCaretBottom(this.selection.start,!1),i=(t=this.selection.getPage(this.selection.start.paragraph)).boundingRectangle.y-this.owner.viewer.pageGap*(this.pages.indexOf(t)+1)*this.zoomFactor+this.owner.viewer.pageGap*(this.pages.indexOf(t)+1),this.touchStart.style.left=t.boundingRectangle.x+(Math.round(this.selection.start.location.x)*this.zoomFactor-14)+"px",this.touchStart.style.top=i+e*this.zoomFactor+"px",this.selection.isEmpty||(e=this.selection.getCaretBottom(this.selection.end,!1),t=this.selection.getPage(this.selection.end.paragraph)),this.touchEnd.style.left=t.boundingRectangle.x+(Math.round(this.selection.end.location.x)*this.zoomFactor-14)+"px",this.touchEnd.style.top=i+e*this.zoomFactor+"px"))},$si.prototype.autoScrollOnSelection=function(i){var n=this;this.scrollMoveTimer&&(i.y<=0||50<i.y||i.y<this.viewerContainer.offsetHeight-50)?(clearInterval(this.scrollMoveTimer),this.scrollMoveTimer=0):i.y<60?(clearInterval(this.scrollMoveTimer),this.scrollMoveTimer=setInterval(function(){n.viewerContainer.scrollTop-=20,setTimeout(function(){var e=n.owner.viewer.findFocusedPage(i,!n.owner.enableHeaderAndFooter),t=n.getLineWidget(e);n.selection.updateTextPosition(t,e)},200)},200)):i.y>this.viewerContainer.offsetHeight-70&&(clearInterval(this.scrollMoveTimer),this.scrollMoveTimer=setInterval(function(){n.viewerContainer.scrollTop+=20,setTimeout(function(){var e=n.owner.viewer.findFocusedPage(i,!n.owner.enableHeaderAndFooter),t=n.getLineWidget(e);n.selection.updateTextPosition(t,e)},200)},200))},$si.prototype.scrollForwardOnSelection=function(e){var t;this.viewerContainer&&(this.viewerContainer.scrollTop=this.viewerContainer.scrollTop+200,e=this.owner.viewer.findFocusedPage(e,!this.owner.enableHeaderAndFooter),t=this.owner.selectionModule.end,this.owner.enableImageResizerMode&&this.owner.imageResizerModule.isImageResizerVisible&&!this.owner.imageResizerModule.isShapeResize||(this.skipScrollToPosition=!0,this.owner.selectionModule.moveTextPosition(e,t,!0)))},$si.prototype.scrollBackwardOnSelection=function(e){this.viewerContainer.scrollTop=this.viewerContainer.scrollTop-200;var e=this.owner.viewer.findFocusedPage(e,!this.owner.enableHeaderAndFooter),t=this.owner.selectionModule.end;this.owner.enableImageResizerMode&&this.owner.imageResizerModule.isImageResizerVisible&&!this.owner.imageResizerModule.isShapeResize||(this.skipScrollToPosition=!0,this.owner.selectionModule.moveTextPosition(e,t,!0))},$si.prototype.navigateToEndNote=function(e,t,i){for(var n,o=this.pages.length-1;0<=o&&!je(n=this.pages[o].endnoteWidget);){for(var r=0;r<n.bodyWidgets.length;r++)if(je(n.bodyWidgets[r].previousSplitWidget)){var s=n.bodyWidgets[r].footNoteReference;if(e.text===s.text){t.setPositionParagraph(n.bodyWidgets[r].childWidgets[0].childWidgets[0],0),i.setPositionParagraph(n.bodyWidgets[r].childWidgets[0].childWidgets[0],0),this.selection.selectRange(t,i);break}}o--}},$si.prototype.moveSelectedContent=function(){this.isDragStarted=!1;var e,t,i,n=this.owner.editor.getSelectionInfo(!0),o=(this.owner.selection.start.paragraph.isInsideTable&&(n=this.owner.selection.updateSelectionInfo(n)),this.selection.getTextPosBasedOnLogicalIndex(n.start)),r=this.selection.getTextPosBasedOnLogicalIndex(n.end),n=(this.selection.isForward||(o=this.selection.getTextPosBasedOnLogicalIndex(n.end),r=this.selection.getTextPosBasedOnLogicalIndex(n.start)),this.selection.getParagraphInfo(o)),o=this.selection.getParagraphInfo(r),r=this.selection.getHierarchicalIndex(n.paragraph,n.offset.toString()),s=this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString()),a=this.selection.getTextPosBasedOnLogicalIndex(r),l=this.selection.getTextPosBasedOnLogicalIndex(s),h=this.selection.getHierarchicalIndex(this.dragStartParaInfo.paragraph,this.dragStartParaInfo.offset.toString()),d=this.selection.getHierarchicalIndex(this.dragEndParaInfo.paragraph,this.dragEndParaInfo.offset.toString()),h=this.selection.getTextPosBasedOnLogicalIndex(h),d=this.selection.getTextPosBasedOnLogicalIndex(d),p=!1;n.paragraph===h.paragraph&&(p=!0),a.isExistBefore(h)||l.isExistAfter(d)?(this.owner.editorModule.initComplexHistory("DragAndDropContent"),this.selection.start=h,this.selection.end=d,(e=this.owner.enableLocalPaste)||(this.owner.enableLocalPaste=!0),i=!1,((t=this.dragEndParaInfo.paragraph.getLength())<this.dragEndParaInfo.offset||!this.dragStartParaInfo.paragraph.equals(this.dragEndParaInfo.paragraph))&&(i=!0),this.owner.editorModule.cut(),this.dragEndParaInfo.paragraph.equals(n.paragraph)&&this.dragEndParaInfo.offset<n.offset&&!this.owner.enableTrackChanges&&(t-=this.dragEndParaInfo.paragraph.getLength(),n.offset-=t,o.offset-=t,r=this.selection.getHierarchicalIndex(n.paragraph,n.offset.toString()),s=this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString())),i&&(this.dragEndParaInfo.paragraph.equals(o.paragraph)||p)||(r=this.selection.getHierarchicalIndex(n.paragraph,n.offset.toString()),s=this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString())),a=this.selection.getTextPosBasedOnLogicalIndex(r),l=this.selection.getTextPosBasedOnLogicalIndex(s),this.selection.start=a,this.selection.end=l,this.owner.editorModule.copiedTextContent="",this.owner.editorModule.paste(),e||(this.owner.enableLocalPaste=!1),this.owner.editorHistoryModule.updateComplexHistory()):this.owner.selectionModule.selectPosition(h,d),this.dragStartParaInfo=void 0,this.dragEndParaInfo=void 0,this.selection.caret.classList.add("e-de-cursor-animation")},$si.prototype.isSelectionInListText=function(e){var t=this.getLineWidget(e);if(!je(t)&&t.children[0]instanceof lhi){var i=this.getLeftValue(t),n=t.children[0].width,o=t.children[0].height;if(this.isInsideRect(i,t.paragraph.y,n,o,e))return this.selectionLineWidget=t,!0}return!1},$si.prototype.isInShapeBorder=function(e,t){if(!je(e)){var i=e.width,n=e.height;if(this.isInsideRect(e.x-e.margin.left,e.y-e.margin.top,i,n,t)){if(e instanceof rhi)return!0;if(e instanceof Xli){var o=e.lineFormat.weight;if(!this.isInsideRect(e.x+o,e.y+o+e.textFrame.marginTop,i-2*o,n-(2*o+e.textFrame.marginTop+e.textFrame.marginBottom),t))return!0}}}return!1},$si.prototype.isInsideRect=function(e,t,i,n,o){return o.x>e&&o.x<=e+i&&o.y>t&&o.y<=t+n},$si.prototype.getLeftValue=function(e){var t=e.paragraph.x,i=e.paragraph.paragraphFormat,i=(this.selection.isParagraphFirstLine(e)&&("Right"===i.textAlignment?t=(t-=Y.convertPointToPixel(i.firstLineIndent))-Y.convertPointToPixel(i.leftIndent):t+=Y.convertPointToPixel(i.firstLineIndent)),e.children[0]);return i instanceof lhi&&(t+=i.margin.left),t},$si.prototype.isLeftButtonPressed=function(e){return this.isTouchInput=!1,1===(e.which||e.button)},$si.prototype.updateSelectionOnTouch=function(e,t){this.zoomX=void 0,this.zoomY=void 0,!this.isMouseDown||this.isSelectionChangedOnMouseMoved||je(this.currentPage)||je(this.owner.selectionModule.start)||(je(this.currentSelectedComment)||!this.owner.commentReviewPane||this.owner.commentReviewPane.commentPane.isEditMode||(this.currentSelectedComment=void 0),0===this.touchDownOnSelectionMark&&(this.updateTextPositionForSelection(new kri(t.x,t.y),this.tapCount),2===this.tapCount)&&this.selection.checkAndEnableHeaderFooter(e,t),this.owner.selectionModule.isEmpty&&this.selection.updateCaretPosition(),this.selection.checkForCursorVisibility())},$si.prototype.getTouchOffsetValue=function(e){var t=this.viewerContainer.getBoundingClientRect(),i=e.touches[0],e=(i=je(i)?e.changedTouches[0]:i).clientX-t.left,i=i.clientY-t.top;return new kri(e,i)},$si.prototype.onPinchInInternal=function(e){this.preZoomFactor=this.zoomFactor;var t=this.zoomFactor-.01;t<5&&2<t&&(t-=.01),this.zoomFactor=t=t<.1?.1:t},$si.prototype.onPinchOutInternal=function(e){this.preZoomFactor=this.zoomFactor;var t=this.zoomFactor+.01;2<t&&(t+=.01),this.zoomFactor=t=5<t?5:t},$si.prototype.getPageWidth=function(e){return e.boundingRectangle.width},$si.prototype.removePage=function(e){this.currentPage===e&&(this.currentPage=void 0),e.headerWidgetIn&&(e.headerWidgetIn.page=void 0),e.footerWidgetIn&&(e.footerWidgetIn.page=void 0),e.headerWidget&&e.headerWidget.page===e&&(e.headerWidget.page=void 0),e.footerWidget&&e.footerWidget.page===e&&(e.footerWidget.page=void 0);for(var t,i=this.pages.indexOf(e),n=(-1<i&&this.pages.splice(i,1),je(this.owner.viewer.visiblePages)||-1<this.owner.viewer.visiblePages.indexOf(e)&&(t=this.owner.viewer.visiblePages.indexOf(e),this.owner.viewer.visiblePages.splice(t,1)),0);n<this.pages.length;n++)this.pages[n].boundingRectangle.height;e.boundingRectangle.height;var o=20;if(0<i&&(o+=this.pages[i-1].boundingRectangle.bottom),-1!==i)for(n=i;n<this.pages.length;n++)(e=this.pages[n]).boundingRectangle=new pai(e.boundingRectangle.x,o,e.boundingRectangle.width,e.boundingRectangle.height),o=e.boundingRectangle.bottom+20,!(0<e.bodyWidgets.length)||je(e.bodyWidgets[0].firstChild)||e.bodyWidgets[0].firstChild instanceof _ai&&e.bodyWidgets[0].firstChild.header||(e.repeatHeaderRowTableWidget=!1)},$si.prototype.updateViewerSize=function(){var t=this,e=this.owner.getDocumentEditorElement();this.updateViewerSizeInternal(e),this.owner.viewer.updateScrollBars(),this.owner.viewer instanceof sai&&!je(this.owner)&&!je(e)&&(this.resizerTimer&&clearTimeout(this.resizerTimer),this.resizerTimer=setTimeout(function(){var e;je(t.owner)||(e=void 0,e=je(t.visibleBounds)?0:t.visibleBounds.width,je(t.owner.viewer.preVisibleWidth)&&(t.owner.viewer.preVisibleWidth=0),je(t.visibleBounds)||e===t.owner.viewer.preVisibleWidth||(t.owner.editorModule.layoutWholeDocument(),t.owner.viewer.preVisibleWidth=e),t.resizerTimer&&clearTimeout(t.resizerTimer))},50)),je(this.selection)||this.selection.updateCaretPosition()},$si.prototype.triggerAutoResizeInterval=function(){var t=this,i=0,n=this.owner.element,e={cancel:!1},o=(this.owner.notify(tZt,e),(n=je(e.element)?n:e.element).style.visibility="hidden",kA(n),0),e=this.owner.documentEditorSettings.autoResizeSettings.interval;this.isAutoResizeCanStart?i=setInterval(function(){o++;var e=t.owner.element.getBoundingClientRect();0!==e.width&&0!==e.height?(e={cancel:t.isAutoResizeCanStart=!1},t.owner.notify(eZt,e),clearInterval(i),e.cancel||t.owner.resize(),BA(n),n.style.visibility="visible"):o>t.owner.documentEditorSettings.autoResizeSettings.iterationCount&&(clearInterval(i),BA(n),n.style.visibility="visible")},e):(BA(n),n.style.visibility="visible")},$si.prototype.updateViewerSizeInternal=function(e){var t,i,n,o,r,s,a;je(e)||(t=getComputedStyle(e),s=parseFloat(t.height.replace("px","")),t=parseFloat(t.width.replace("px","")),this.isAutoResizeCanStart=0===t&&0===s,i=(i=a=0)<s?s:200,s=this.restrictEditingPane&&this.restrictEditingPane.isShowRestrictPane?this.getComputedWidth(this.restrictEditingPane.restrictPane):void 0,n=this.owner.optionsPaneModule&&this.owner.optionsPaneModule.isOptionsPaneShow?this.getComputedWidth(this.owner.optionsPaneModule.optionsPane):void 0,o=0,this.owner.commentReviewPane&&this.owner.commentReviewPane.parentPaneElement&&(o=this.getComputedWidth(this.owner.commentReviewPane.parentPaneElement)),r=this.owner.xmlPaneModule&&this.owner.xmlPaneModule.isXmlPaneShow?this.getComputedWidth(this.owner.xmlPaneModule.element):void 0,a=s||n||o||r?(s=s||0,0<t-(s=(s+=n||0)+(o||0)+(r||0))?t-s:200):0<t?t:200,this.viewerContainer.style.height=i.toString()+"px",this.viewerContainer.style.width=Math.ceil(a)+"px",this.visibleBoundsIn=new pai(0,0,a,i),this.containerCanvas.width=a,this.containerCanvas.height=i,this.containerCanvas.style.width=a+"px",this.containerCanvas.style.height=i+"px",this.selectionCanvas.width=a,this.selectionCanvas.height=i,this.selectionCanvas.style.width=a+"px",this.selectionCanvas.style.height=i+"px",this.measureScrollbarWidth(e))},$si.prototype.getComputedWidth=function(e){e=getComputedStyle(e);return"block"===e.display?parseFloat(e.width.replace("px","")):0},$si.prototype.insertPage=function(e,t){-1<this.pages.indexOf(t)&&this.pages.splice(this.pages.indexOf(t),1),this.pages.splice(e,0,t);var i=20;0<e&&(i+=this.pages[e-1].boundingRectangle.bottom);for(var n=e;n<this.pages.length;n++)(t=this.pages[n]).boundingRectangle=new pai(t.boundingRectangle.x,i,t.boundingRectangle.width,t.boundingRectangle.height),i=t.boundingRectangle.bottom+20},$si.prototype.updateTextPositionForSelection=function(e,t){var i=this.getLineWidget(e);je(i)||this.selection.updateTextPosition(i,e),1<t&&(this.isMouseDown=!1,this.useTouchSelectionMark=!1,0===this.pages.length||je(this.currentPage)||je(this.owner.selectionModule.start)||(t%2==0?this.owner.selectionModule.selectCurrentWord():this.isDragStarted||this.owner.selectionModule.selectParagraph()))},$si.prototype.scrollToPosition=function(e,t,i,n){if(this.skipScrollToPosition||this.isWebPrinting||this.owner.editorModule&&this.owner.editorModule.isRemoteAction)this.skipScrollToPosition=!1;else if(!(this.owner.enableImageResizerMode&&this.owner.imageResizerModule.isImageResizing||this.isMouseDownInFooterRegion||this.isRowOrCellResizing)){var o=this.selection.getLineWidgetInternal(t.currentWidget,t.offset,!0);if(!je(o)){this.selection.getTop(o),(o=this.isMouseDown&&(a=this.selection.getLineWidgetInternal(t.currentWidget,t.offset,!1),r=this.selection.getTop(a),a!==o)&&t.location.y>=r?a:o).height;var r=this.selection.getPage(o.paragraph),s=(this.currentPage=r,0),a=0;this.owner.viewer instanceof nai,this.owner.viewer;if(!je(r)){var o=r.boundingRectangle.width,a=((s=(this.visibleBounds.width-o*this.zoomFactor)/2)<30&&(s=30),r.boundingRectangle.y*this.zoomFactor+(this.pages.indexOf(r)+1)*this.owner.viewer.pageGap*(1-this.zoomFactor)),o=this.viewerContainer.scrollTop,l=this.viewerContainer.scrollLeft,h=this.visibleBounds.height,d=this.selection.updateCaretSize(this.owner.selectionModule.end,!0),p=d.topMargin,d=d.height,c=(s+=t.location.x*this.zoomFactor,a+=(t.location.y+p)*this.zoomFactor,n?this.viewerContainer.scrollTop=a-96:a<o+20?this.viewerContainer.scrollTop=a-10:o+h<a+d&&(this.viewerContainer.scrollTop=a+d-h+10),i||this.selection.updateCaretToPage(e,r),this.viewerContainer.offsetWidth-this.viewerContainer.clientWidth);if(s<l)this.viewerContainer.scrollLeft=s-this.pageContainer.offsetWidth/100*20;else if(l+this.visibleBounds.width<s+c)for(this.viewerContainer.scrollLeft=l+this.pageContainer.offsetWidth/100*15+c;s<this.owner.viewer.containerWidth&&this.viewerContainer.scrollLeft+this.visibleBounds.width<s+c&&(this.viewerContainer.scrollLeft=this.viewerContainer.scrollLeft+this.pageContainer.offsetWidth/100*15+c,0!==this.viewerContainer.scrollLeft););}}}},$si.prototype.getLineWidget=function(e){return this.getLineWidgetInternal(e,!1)},$si.prototype.getLineWidgetInternal=function(e,t){var i=void 0;if(!je(this.currentPage)){var n,o,r,s=void 0;if(this.owner.enableHeaderAndFooter)return u=(o=this.currentPage).boundingRectangle.height,n=Math.max(o.headerWidget.y+o.headerWidget.height,Y.convertPointToPixel(o.bodyWidgets[0].sectionFormat.topMargin))*this.zoomFactor,r=Y.convertPointToPixel(o.bodyWidgets[0].sectionFormat.footerDistance),o=o.boundingRectangle.height-Math.max(o.footerWidget.height+r,2*r),t?s=this.isBlockInHeader(this.selection.start.paragraph)?this.currentPage.headerWidget:this.currentPage.footerWidget:e.y<=u&&e.y>=o?s=this.currentPage.footerWidget:0<=e.y&&e.y<=n&&(s=this.currentPage.headerWidget),je(s)?void 0:(r=this.checkFloatingItems(s,e,t)).isShapeSelected?r.isInShapeBorder?r.element.line:this.selection.getLineWidgetBodyWidget(r.element.textFrame,e):this.selection.getLineWidgetBodyWidget(s,e);for(var a=void 0,l=void 0,h=0;h<this.currentPage.bodyWidgets.length;h++){var d=this.currentPage.bodyWidgets[h],a=this.checkFloatingItems(d,e,t,!1),l=this.checkFloatingItems(d,e,t,!0);if(a.isShapeSelected||l.isShapeSelected)break}if(a.isShapeSelected&&!this.isEmptyShape(a)){if(a.isInShapeBorder)return a.element.line;a.element instanceof Xli&&(i=this.selection.getLineWidgetBodyWidget(a.element.textFrame,e))}else if(t&&this.isFootnoteWidget){if(void 0!==this.selection.start.paragraph.bodyWidget.footNoteReference&&this.selection.start.paragraph.bodyWidget.containerWidget instanceof Pai&&"Footnote"===this.selection.start.paragraph.bodyWidget.containerWidget.footNoteType)return this.selection.getLineWidgetBodyWidget(this.currentPage.footnoteWidget,e);if(void 0!==this.selection.start.paragraph.bodyWidget.footNoteReference&&this.selection.start.paragraph.bodyWidget.containerWidget instanceof Pai&&"Endnote"===this.selection.start.paragraph.bodyWidget.containerWidget.footNoteType)return this.selection.getLineWidgetBodyWidget(this.currentPage.endnoteWidget,e)}else{if(!t&&this.currentPage.footnoteWidget&&this.isInFootnoteWidget(this.currentPage.footnoteWidget,e))(i=this.selection.getLineWidgetBodyWidget(this.currentPage.footnoteWidget,e))&&(this.isFootnoteWidget=!0);else if(!t&&this.currentPage.endnoteWidget&&this.isInFootnoteWidget(this.currentPage.endnoteWidget,e))(i=this.selection.getLineWidgetBodyWidget(this.currentPage.endnoteWidget,e))&&(this.isFootnoteWidget=!0);else for(var p=0;p<this.currentPage.bodyWidgets.length;p++){var c=this.currentPage.bodyWidgets[p];if(p<this.currentPage.bodyWidgets.length-1&&e.x<=c.x+c.width&&!je(i=this.selection.getLineWidgetBodyWidget(c,e,!0))&&i.paragraph.y<=e.y&&i.paragraph.y+i.paragraph.height>=e.y){this.isFootnoteWidget=!1;break}if(e.x>c.x+c.width&&this.layout.getNextWidgetHeight(c)>=e.y&&c.y<=e.y&&(je(c.nextRenderedWidget)||!(this.layout.getNextWidgetHeight(c.nextRenderedWidget)>=e.y&&c.nextRenderedWidget.y<=e.y))&&!je(i=this.selection.getLineWidgetBodyWidget(c,e,!0))&&i.paragraph.y<=e.y&&i.paragraph.y+i.paragraph.height>=e.y){this.isFootnoteWidget=!1;break}if(p==this.currentPage.bodyWidgets.length-1&&!je(i=this.selection.getLineWidgetBodyWidget(c,e,!0))&&i.paragraph.y<=e.y&&i.paragraph.y+i.paragraph.height>=e.y){this.isFootnoteWidget=!1;break}if(e.x<c.x&&p<this.currentPage.bodyWidgets.length-1){if(!je(i=this.selection.getLineWidgetBodyWidget(c,e,!0))&&i.paragraph.y<=e.y&&i.paragraph.y+i.paragraph.height>=e.y){this.isFootnoteWidget=!1;break}if(!je(i)&&p===this.currentPage.bodyWidgets.length-1){this.isFootnoteWidget=!1;break}}}var u=this.checkInlineShapeItems(i,e,t);if(u.isShapeSelected){if(u.isInShapeBorder)return u.element.line;u.element instanceof Xli&&(i=this.selection.getLineWidgetBodyWidget(u.element.textFrame,e))}else if(!this.checkPointIsInLine(i,e)&&l.isShapeSelected){if(l.isInShapeBorder)return l.element.line;l.element instanceof Xli&&(i=this.selection.getLineWidgetBodyWidget(l.element.textFrame,e))}}}return i},$si.prototype.checkInlineShapeItems=function(e,t,i){var n,o=!1,r=!1,s=this.selection.isInShape;if(!je(e)&&0<e.children.length)if(i&&s){var a=this.owner.selectionModule.getCurrentTextFrame();a&&(n=a.containerShape,o=!0)}else{for(var l=0;l<e.children.length;l++)if(e.children[l]instanceof Xli&&"Inline"===e.children[l].textWrappingStyle&&(n=e.children[l],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){o=!0,this.isInShapeBorder(n,t)&&(r=!0);break}i&&!s&&(o=!1)}return{element:n,caretPosition:t,isInShapeBorder:r,isShapeSelected:o}},$si.prototype.checkPointIsInLine=function(e,t){if(!je(e)&&0<e.children.length){for(var i,n=e.paragraph.x,o=this.selection.getTop(e),r=e.children.indexOf(e.children[0]);r<e.children.length;r++)if(!((i=e.children[r])instanceof qli&&"Inline"!==i.textWrappingStyle)){if(t.x<n+i.margin.left+i.width+i.padding.left&&t.x>n&&t.y<o+e.height&&t.y>o)return!0;n+=i.margin.left+i.width+i.padding.left}}else if(!je(e)&&0===e.children.length){var n=e.paragraph.x,s=this.selection.getTop(e);if(t.x<n+e.width&&t.x>n&&t.y<s+e.height&&t.y>s)return!0}return!1},$si.prototype.isInFootnoteWidget=function(e,t){for(var i=0;i<e.bodyWidgets.length;i++)for(var n=0;n<e.bodyWidgets[i].childWidgets.length;n++){var o=e.bodyWidgets[i].childWidgets[n];if(o instanceof fai&&o.y<=t.y&&o.y+o.height>=t.y)return!0}return!1},$si.prototype.checkFloatingItems=function(e,t,i,n){var o,r=!1,s=!1,a=this.selection.isInShape,l=i&&a;if(0<e.floatingElements.length){this.currentPage;if(e.floatingElements.sort(function(e,t){return e instanceof _ai||t instanceof _ai?0:e.zOrderPosition-t.zOrderPosition}),l){l=this.owner.selectionModule.getCurrentTextFrame();l&&(o=l.containerShape,r=!0)}else{for(var h=e.floatingElements.length-1;0<=h;h--)if(!(e.floatingElements[h]instanceof _ai||(!je(n)&&n?"Behind"!==e.floatingElements[h].textWrappingStyle:"Behind"===e.floatingElements[h].textWrappingStyle))&&(o=e.floatingElements[h],t.x<o.x+o.margin.left+o.width)&&t.x>o.x&&t.y<o.y+o.margin.top+o.height&&t.y>o.y){r=!0,this.isInShapeBorder(o,t)&&(s=!0);break}i&&!a&&(r=!1)}}return{element:o,caretPosition:t,isShapeSelected:r,isInShapeBorder:s}},$si.prototype.isBlockInHeader=function(e){for(;!(e.containerWidget instanceof Iai);){if(!e.containerWidget)return!1;(e=e.containerWidget)instanceof Zli&&(e=e.containerShape.paragraph)}return-1!==e.containerWidget.headerFooterType.indexOf("Header")},$si.prototype.clearSelectionHighlight=function(){this.isControlPressed&&this.isMouseDown;this.owner.selectionModule.clearSelectionHighlightInSelectedWidgets()&&this.selectionContext.clearRect(0,0,this.selectionCanvas.width,this.selectionCanvas.height)},$si.prototype.removeEmptyPages=function(e){for(var t=!1,i=!1,n=this.selection.startPage-1,o=0;o<this.pages.length;o++){for(var r,s=this.pages[o],a=0;a<s.bodyWidgets.length;a++)0!==s.bodyWidgets.length&&0!==s.bodyWidgets[a].childWidgets.length||1<=s.bodyWidgets.length&&(r=s.bodyWidgets.indexOf(s.bodyWidgets[a]),s.bodyWidgets.splice(r,1),a--);if(s.bodyWidgets.length<=0){if(o===this.pages.length-1&&this.owner.viewer instanceof nai&&-1!==this.owner.viewer.visiblePages.indexOf(this.pages[o])&&(t=!0),!je(s.endnoteWidget)&&0<s.endnoteWidget.bodyWidgets.length){var l=s.endnoteWidget,h=s.previousPage;if(!je(h)){je(h.endnoteWidget)&&(h.endnoteWidget=new Pai,h.endnoteWidget.footNoteType="Endnote",h.endnoteWidget.page=h);for(var d=0;d<l.bodyWidgets.length;d++){var p,c=l.bodyWidgets[d],u=!1;0<h.endnoteWidget.bodyWidgets.length&&(p=h.endnoteWidget.bodyWidgets[h.endnoteWidget.bodyWidgets.length-1],c.index===p.index)&&c.footNoteReference===p.footNoteReference&&(p.combineWidget(this.owner.viewer),l.bodyWidgets.splice(d,1),u=!0),u||(l.bodyWidgets.splice(d,1),c.index=h.endnoteWidget.bodyWidgets.length,h.endnoteWidget.bodyWidgets.push(c),c.containerWidget=h.endnoteWidget,c.page=h),d--}je(s.endnoteWidget)||0!==s.endnoteWidget.bodyWidgets.length||(s.endnoteWidget=void 0),t=!(i=!0)}}-1===this.pages.indexOf(s)||je(this.pages[o])||this.removePage(this.pages[o]),o--}}je(this.pages[n])||((s=this.pages[n]).headerWidget&&(s.headerWidget.page=s),s.footerWidget&&(s.footerWidget.page=s)),i&&!e&&this.layout.reLayoutEndnote(),t&&this.scrollToBottom()},$si.prototype.scrollToBottom=function(){var e,t;this.selection.start.paragraph&&this.selection.start.paragraph.bodyWidget&&(e=this.selection.start.paragraph.bodyWidget.page,t=this.visibleBounds.height,this.viewerContainer.scrollTop=e.boundingRectangle.bottom-t)},$si.prototype.getFieldResult=function(e,t){if(!je(t)&&!je(this.selection)&&!je(e)){var i,n,e=this.selection.getFieldCode(e).split("*"),o=e[0].replace(/[^\w\s]/gi,"").trim().toLowerCase(),r="";switch(""==(r=1<e.length&&" MERGEFORMAT"!==e[1]?e[1].replace(/[^\w\s]/gi,"").trim():r)&&(r=t.bodyWidgets[0].sectionFormat.pageNumberStyle),o=-1!==o.indexOf(" ")?o.split(" ")[0]:o){case"page":return t.bodyWidgets[0].sectionFormat.restartPageNumbering&&0!==t.sectionIndex?(i=t.sectionIndex,n=t.previousPage,this.isRestartNumbering=!0,i!==n.sectionIndex&&n.bodyWidgets[n.bodyWidgets.length-1].sectionIndex!==i?t.currentPageNum=t.bodyWidgets[0].sectionFormat.pageStartingNumber:(1===n.currentPageNum&&i!==n.sectionIndex&&(n.currentPageNum=t.bodyWidgets[0].sectionFormat.pageStartingNumber),t.currentPageNum=n.currentPageNum+1)):t.bodyWidgets[0].sectionFormat.restartPageNumbering&&0===t.sectionIndex?t.currentPageNum=t.bodyWidgets[0].sectionFormat.pageStartingNumber+t.index:!je(t.previousPage)&&(t.previousPage.bodyWidgets[0].sectionFormat.restartPageNumbering&&1<=t.previousPage.currentPageNum||this.isRestartNumbering&&1!==t.previousPage.currentPageNum)?(t.previousPage.bodyWidgets[0].sectionFormat.restartPageNumbering&&(this.isRestartNumbering=!0),t.currentPageNum=t.previousPage.currentPageNum+1):t.currentPageNum=t.index+1,this.getFieldText(r,t.currentPageNum);case"numpages":return this.getFieldText(r,t.documentHelper.pages.length);case"sectionpages":for(var s=t.sectionIndex,a=0,l=0;l<t.documentHelper.pages.length;l++)if(t.documentHelper.pages[l].sectionIndex===s)a++;else if(0!==a)break;return this.getFieldText(r,a)}}return""},$si.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":case"RomanUpper":return this.layout.getAsRoman(t).toUpperCase();case"RomanLower":return this.layout.getAsRoman(t).toLowerCase();case"LetterUpper":return this.layout.getAsLetter(t).toUpperCase();case"LetterLower":return this.layout.getAsLetter(t).toLowerCase();default:return t.toString()}},$si.prototype.isEmptyShape=function(e){return e.element instanceof rhi||0===e.element.textFrame.childWidgets.length},$si.prototype.destroy=function(){var t=this;if(je(this.owner)||this.unWireEvent(),this.vRuler&&(this.vRuler.childNodes.forEach(function(e){t.vRuler.removeChild(e)}),this.vRuler.innerHTML="",this.vRuler.remove(),this.vRuler=null),this.hRuler&&(this.hRuler.childNodes.forEach(function(e){t.hRuler.removeChild(e)}),this.hRuler.innerHTML="",this.hRuler.remove(),this.hRuler=null),this.markIndicator&&this.markIndicator.remove(),this.styles&&(this.styles.destroy(),this.styles=void 0),this.stylesMap&&(this.stylesMap.destroy(),this.stylesMap=void 0),this.characterFormat&&(this.characterFormat.destroy(),this.characterFormat=void 0),this.themeFontLanguage&&(this.themeFontLanguage.destroy(),this.themeFontLanguage=void 0),this.paragraphFormat&&(this.paragraphFormat.destroy(),this.paragraphFormat=void 0),this.pages&&0<this.pages.length){for(var e=0;e<this.pages.length;e++)this.pages[e].componentDestroy();this.pages=[]}if(this.pages=void 0,this.lists&&0<this.lists.length){for(e=0;e<this.lists.length;e++)this.lists[e].destroy();this.lists=[]}if(this.lists=void 0,this.formFillPopup&&(this.formFillPopup.destroy(),this.formFillPopup=void 0),this.contentDropDown&&(this.contentDropDown.destroy(),this.contentDropDown=void 0),this.L10n=void 0,this.currentPage=void 0,this.selectionStartPageIn=void 0,this.selectionEndPageIn=void 0,this.fieldStacks=[],this.fieldStacks=void 0,this.splittedCellWidgets=[],this.splittedCellWidgets=void 0,this.fields=[],this.fields=void 0,this.abstractLists=[],this.abstractLists=void 0,je(this.owner)||this.renderedLists.destroy(),this.renderedLists=void 0,je(this.owner)||this.authors.destroy(),this.authors=void 0,je(this.owner)||this.revisionsInternal.destroy(),this.revisionsInternal=void 0,je(this.owner)||this.preDefinedStyles.destroy(),this.preDefinedStyles=void 0,je(this.owner)||this.bookmarks.destroy(),this.bookmarks=void 0,je(this.owner)||this.editRanges.destroy(),this.editRanges=void 0,je(this.owner)||this.customXmlData.destroy(),je(this.owner)||this.images.destroy(),je(this.owner)||this.fontSubstitutionTable.destroy(),this.fontSubstitutionTable=void 0,this.customXmlData=void 0,this.images=void 0,this.blockToShift=void 0,this.cachedPages=[],this.cachedPages=void 0,this.comments&&0<this.comments.length){for(e=0;e<this.comments.length;e++)this.comments[e].destroy();this.comments=[]}this.comments=void 0,this.compositionEnd=void 0,this.compositionStart=void 0,this.compositionUpdated=void 0,this.contentControlCollection=[],this.contentControlCollection=void 0,this.renderedLevelOverrides=[],this.renderedLevelOverrides=void 0,this.headersFooters=[],this.headersFooters=void 0,this.listParagraphs=[],this.listParagraphs=void 0,this.formFields=[],this.formFields=void 0,this.fieldCollection=[],this.fieldCollection=void 0,this.userCollection=[],this.userCollection=void 0,this.footnotes&&(this.footnotes.componentDestroy(),this.footnotes=void 0),this.endnotes&&(this.endnotes.componentDestroy(),this.endnotes=void 0),this.zoomModule&&(this.zoomModule.destroy(),this.zoomModule=void 0),this.footnoteCollection=[],this.footnoteCollection=void 0,this.endnoteCollection=[],this.endnoteCollection=void 0,this.restrictEditingPane&&(this.restrictEditingPane.destroy(),this.restrictEditingPane=void 0),this.layout&&this.layout.destroy(),this.layout=void 0,je(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,je(this.touchStart)||(this.touchStart.innerHTML="",je(this.touchStart.parentElement))||this.touchStart.parentElement.removeChild(this.touchStart),this.touchStart=void 0,this.textHelper&&this.textHelper.destroy(),this.textHelper=void 0,je(this.touchEnd)||(this.touchEnd.innerHTML="",je(this.touchEnd.parentElement))||this.touchEnd.parentElement.removeChild(this.touchEnd),this.touchEnd=void 0,je(this.containerCanvasIn)||(this.containerCanvasIn.innerHTML="",je(this.containerCanvasIn.parentElement))||this.containerCanvasIn.parentElement.removeChild(this.containerCanvasIn),this.containerCanvasIn=void 0,je(this.selectionCanvasIn)||(this.selectionCanvasIn.innerHTML="",je(this.selectionCanvasIn.parentElement))||this.selectionCanvasIn.parentElement.removeChild(this.selectionCanvasIn),this.selectionCanvasIn=void 0,je(this.editableDiv)||(this.editableDiv.innerHTML="",je(this.editableDiv.parentElement))||this.editableDiv.parentElement.removeChild(this.editableDiv),this.editableDiv=void 0,je(this.pageContainer)||(this.pageContainer.innerHTML="",je(this.pageContainer.parentElement))||this.pageContainer.parentElement.removeChild(this.pageContainer),this.pageContainer=void 0,je(this.viewerContainer)||(this.viewerContainer.innerHTML="",je(this.viewerContainer.parentElement))||this.viewerContainer.parentElement.removeChild(this.viewerContainer),je(this.iframe)||(this.iframe.innerHTML="",je(this.iframe.parentElement)||this.iframe.parentElement.removeChild(this.iframe),this.iframe=void 0),this.optionsPaneContainer&&(this.optionsPaneContainer.innerHTML="",je(this.optionsPaneContainer.parentElement)||this.optionsPaneContainer.parentElement.removeChild(this.optionsPaneContainer)),this.optionsPaneContainer=void 0,this.visibleBoundsIn=void 0,this.mouseDownOffset=void 0,this.viewerContainer=void 0,this.currentPage=void 0,this.selectionStartPageIn=void 0,this.selectionEndPageIn=void 0,this.currentSelectedCommentInternal=void 0,this.currentSelectedRevisionInternal=void 0,this.owner=void 0,this.heightInfoCollection=void 0,this.isRestartNumbering=!1},$si.prototype.unWireEvent=function(){this.viewerContainer.removeEventListener("scroll",this.scrollHandler),this.viewerContainer.removeEventListener("mousedown",this.onMouseDownInternal),this.viewerContainer.removeEventListener("mousemove",this.onMouseMoveInternal),F.isDevice?this.editableDiv.removeEventListener("input",this.onTextInputInternal):(this.editableDiv.removeEventListener("keypress",this.onKeyPressInternal),"chrome"===F.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),je(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),window.removeEventListener("touchend",this.onImageResizer),window.removeEventListener("copy",this.onCopy),void 0!==navigator&&navigator.userAgent.match("Firefox")&&this.viewerContainer.removeEventListener("DOMMouseScroll",this.zoomModule.onMouseWheelInternal),this.viewerContainer.removeEventListener("mousewheel",this.zoomModule.onMouseWheelInternal)},$si.prototype.updateCursor=function(e){var t,i,n,o,r,s=void 0,a=this.viewerContainer,l=new kri(e.offsetX,e.offsetY),l=this.owner.viewer.findFocusedPage(l,!0),h=this.getLineWidget(l),d=this.owner.isReadOnlyMode?void 0:this.owner.editorModule,p=!!d&&d.tableResize.isInRowResizerArea(l),d=!!d&&d.tableResize.isInCellResizerArea(l),c=(this.selection.checkAllFloatingElements(h,l),""),u=(this.owner.enableImageResizerMode&&(u=this.owner.imageResizerModule.getImagePoint(l),this.owner.imageResizerModule.selectedResizeElement=u.selectedElement,c=u.resizePosition),0),g=void 0,m=(this.checkPointIsInLine(h,l),je(h)||(u=this.selection.getLineStartLeft(h),je(s=this.selection.getHyperLinkFieldInCurrentSelection(h,l))&&(g=this.selection.getHyperLinkFieldInCurrentSelection(h,l,!0)),je(s)||0!==(n=this.selection.getFieldCode(s)).toLowerCase().indexOf("ref ")||n.match("\\h")||(s=void 0),n=this.selection.updateTextPositionIn(h,void 0,0,l,!0),t=this.selection.getLeft(h),i=this.selection.getTop(h),je(s)&&!je(g)&&this.isDocumentProtected&&"FormFieldsOnly"===this.protectionType&&!this.isFormFilling?this.selection.setHyperlinkContentToToolTip(g,h,l.x,!0):this.selection.setHyperlinkContentToToolTip(s,h,l.x,!1),g&&(o=g.formFieldData instanceof ili&&"Text"===g.formFieldData.type,"Inline"===this.owner.documentEditorSettings.formFieldSettings.formFillingMode)&&o&&(g=void 0),this.owner.enableLockAndEdit&&(o=!1,(r=(r=h.paragraph).isInsideTable?this.layout.getParentTable(r):r).locked&&r.lockedBy!==this.owner.currentUser&&(o=!0),m=(m=h.paragraph.bodyWidget.sectionFormat).pageWidth-m.rightMargin-m.leftMargin,m=Y.convertPointToPixel(m)*this.zoomFactor,this.viewer instanceof sai&&(m=(this.visibleBounds.width-5*this.viewer.padding.right)/this.zoomFactor),o&&l.x>=u&&l.x<u+m?this.selection.setLockInfoTooptip(h,l.x,r.lockedBy):this.selection.setLockInfoTooptip(void 0,l.x,""))),je(h)||"Pages"==this.owner.layoutType&&(o=this.selection.getFootNoteElementInCurrentSelection(h,l))instanceof fli&&this.selection.setFootnoteContentToToolTip(o,h,l.x),this.isIosDevice?e.metaKey:e.ctrlKey);!je(s)&&(m&&this.owner.useCtrlClickToFollowHyperlink||!this.owner.useCtrlClickToFollowHyperlink)||g?je(g)?a.style.cursor="pointer":this.isFormFillProtectedMode&&(a.style.cursor="default"):(l.x>=u&&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,l)?"default":"text":a.style.cursor="default",je(c)||""===c?!je(n)&&n.isImageSelected&&t<l.x&&i<l.y&&t+h.width>l.x&&i+h.height>l.y&&(a.style.cursor="move"):(!this.owner.imageResizerModule.isShapeResize||this.owner.imageResizerModule.isShapeResize&&"move"!==c)&&(a.style.cursor=c),p?a.style.cursor="row-resize":d&&(a.style.cursor="col-resize"))},$si.prototype.updateDialogTabHeight=function(e,t){var i=e.getElementsByClassName("e-dlg-header-content")[0],n=e.getElementsByClassName("e-dlg-content")[0],o=e.getElementsByClassName("e-footer-content")[0],n=getComputedStyle(n),r=getComputedStyle(e),s=parseInt(n.paddingTop,10),a=parseInt(n.paddingBottom,10),s=(isNaN(s)?0:s)+(isNaN(a)?0:a),a=parseInt(r.borderTop,10),l=parseInt(r.borderBottom,10),a=(isNaN(a)?0:a)+(isNaN(l)?0:l),l=e.offsetHeight-(i.offsetHeight+o.offsetHeight+s+a),i=(t.style.height=l+"px",parseInt(n.paddingLeft,10)),o=parseInt(n.paddingRight,10),s=(isNaN(i)?0:i)+(isNaN(o)?0:o),a=parseInt(r.borderLeft,10),t=parseInt(r.borderRight,10),l=(isNaN(a)?0:a)+(isNaN(t)?0:t);return e.offsetWidth-(s+l)},$si.prototype.canRenderBorder=function(e){var t,i,n,o,r=!1,s=!1,a=e.previousRenderedWidget,l=e.nextRenderedWidget,h=this.getParagraphLeftPosition(e),d=0,p=0;return!je(a)&&a instanceof Lai&&(d=this.getParagraphLeftPosition(a)),!je(l)&&l instanceof Lai&&(p=this.getParagraphLeftPosition(l)),{skipTopBorder:r=!je(a)&&a instanceof Lai&&h===d&&(t=this.checkEqualBorder(e.paragraphFormat.borders.top,a.paragraphFormat.borders.top),i=this.checkEqualBorder(e.paragraphFormat.borders.bottom,a.paragraphFormat.borders.bottom),n=this.checkEqualBorder(e.paragraphFormat.borders.left,a.paragraphFormat.borders.left),o=this.checkEqualBorder(e.paragraphFormat.borders.right,a.paragraphFormat.borders.right),t)&&i&&n&&o&&!je(a.paragraphFormat.borders.horizontal)&&"None"===a.paragraphFormat.borders.horizontal.lineStyle?!0:r,skipBottomBorder:s=!je(l)&&l instanceof Lai&&(h===p||this.owner.documentHelper.layout.isInitialLoad&&this.skipBottomBorder(e,l))&&(t=this.checkEqualBorder(e.paragraphFormat.borders.top,l.paragraphFormat.borders.top),i=this.checkEqualBorder(e.paragraphFormat.borders.bottom,l.paragraphFormat.borders.bottom),n=this.checkEqualBorder(e.paragraphFormat.borders.left,l.paragraphFormat.borders.left),o=this.checkEqualBorder(e.paragraphFormat.borders.right,l.paragraphFormat.borders.right),i)&&t&&n&&o?!0:s}},$si.prototype.checkEqualBorder=function(e,t){return je(e)||je(t)?!(!je(e)||!je(t)):e.isEqualFormat(t)},$si.prototype.getParagraphLeftPosition=function(e){var t=0;return e.paragraphFormat.firstLineIndent<0&&(t=Y.convertPointToPixel(Math.abs(e.paragraphFormat.firstLineIndent)),t=parseFloat(t.toFixed(5))),e.isEmpty()&&("Left"!==e.paragraphFormat.textAlignment&&"Justify"!==e.paragraphFormat.textAlignment||"Justify"===e.paragraphFormat.textAlignment&&e.paragraphFormat.bidi)?e.clientX>t?e.clientX-t:e.clientX:e.x>t?e.x-t:e.x},$si.prototype.skipBottomBorder=function(e,t){var i,n;return e.paragraphFormat.leftIndent===t.paragraphFormat.leftIndent||(i=e.paragraphFormat.firstLineIndent<0?Math.abs(e.paragraphFormat.firstLineIndent):0,n=t.paragraphFormat.firstLineIndent<0?Math.abs(t.paragraphFormat.firstLineIndent):0,(e.paragraphFormat.leftIndent>i?e.paragraphFormat.leftIndent-i:0)==(t.paragraphFormat.leftIndent>n?t.paragraphFormat.leftIndent-n:0))},$si.prototype.isPageInVisibleBound=function(e,t){var i=this.visibleBounds.height,n=this.viewerContainer.scrollTop,e=e.boundingRectangle.height*this.zoomFactor;return n<=t&&t<=n+i||n<=t+e&&t+e<=n+i||t<=n&&n+i<=t+e},$si.prototype.getFirstParagraphInCell=function(e){e=e.childWidgets[0];return e instanceof Lai?e:this.getFirstParagraphInFirstCell(e)},$si.prototype.getFirstParagraphInFirstCell=function(e){if(!je(e.childWidgets)&&0<e.childWidgets.length)return e=e.childWidgets[0].childWidgets[0].childWidgets[0],this.getFirstParagraphBlock(e)},$si.prototype.getLastParagraphInLastCell=function(e){if(!je(e.childWidgets)&&0<e.childWidgets.length)return e=e.lastChild.lastChild.lastChild,this.getLastParagraphBlock(e)},$si.prototype.getFirstParagraphBlock=function(e){return e instanceof Lai?e:e instanceof _ai?this.getFirstParagraphInFirstCell(e):void 0},$si.prototype.getLastParagraphBlock=function(e){return e instanceof Lai?e:e instanceof _ai?this.getLastParagraphInLastCell(e):void 0},$si.prototype.getLastParagraphInFirstRow=function(e){if(0<e.childWidgets.length)return e=e.firstChild.lastChild.lastChild,this.getLastParagraphBlock(e)},$si.prototype.getFirstParagraphInLastRow=function(e){if(0<e.childWidgets.length)return e=e.childWidgets[e.childWidgets.length-1].childWidgets[0].childWidgets[0],this.getFirstParagraphBlock(e)},$si.prototype.addToStylesMap=function(e){var t,i={},n={};je(e)||(t=this.owner?this.L10n.getConstant(e.name):e.name,i.StyleName=""===t?e.name:t,"Paragraph"==e.type&&(n.paragraphFormat={},Y.writeParagraphFormat(n.paragraphFormat,!0,e.paragraphFormat)),n.characterFormat={},Y.writeCharacterFormat(n.characterFormat,!0,e.characterFormat),i.Style=this.parseStyle(JSON.stringify(n)),je(e.type)||(i.type=e.type,"Paragraph"!=i.type)||je(e.link)||(i.type="Linked"),i.IconClass="Paragraph"==i.type?"e-list-icon e-de-listview-icon e-de-e-paragraph-style-mark e-icons":"Character"==i.type?"e-list-icon e-de-listview-icon e-de-e-character-style-mark e-icons":"e-list-icon e-de-listview-icon e-de-e-linked-style-mark e-icons",this.stylesMap.get(i.type)?this.stylesMap.get(i.type).push(i):this.stylesMap.add(i.type,[i]))},$si.prototype.parseStyle=function(e){var t="",e=JSON.parse(e),i="";if(!je(e.characterFormat.baselineAlignment)&&"Normal"!==e.characterFormat.baselineAlignment){var n="";switch(e.characterFormat.baselineAlignment){case"Superscript":n="super";break;case"Subscript":n="sub"}1<n.length&&(t+="vertical-align:"+n+";")}return je(e.characterFormat.underline)||"None"===e.characterFormat.underline||(i+="underline "),je(e.characterFormat.strikethrough)||"None"===e.characterFormat.strikethrough||(i+="line-through "),je(e.characterFormat.fontSize)||(t+="font-size:"+e.characterFormat.fontSize+"px;"),je(e.characterFormat.fontFamily)||(t+="font-family:"+e.characterFormat.fontFamily+";"),!je(e.characterFormat.bold)&&e.characterFormat.bold&&(t+="font-weight:bold;"),!je(e.characterFormat.italic)&&e.characterFormat.italic&&(t+="font-style:italic;"),1<i.length&&(t+="text-decoration:"+i+";"),t},$si.prototype.getNextValidElement=function(e){var t=void 0;if(e instanceof Dli&&1===e.bookmarkType)return e;for(;e instanceof Zai;){if(0===e.fieldType&&!je(e.fieldEnd))return je(t)?e:t;1!==e.fieldType||je(e.fieldBegin)||(t=e),e=e.nextNode}return je(t)?e:t},$si.prototype.getNextValidElementForField=function(e){e instanceof Zai&&0===e.fieldType&&Y.isLinkedFieldCharacter(e)&&(e=je((t=e).fieldSeparator)?t.fieldEnd:t.fieldSeparator);var t=void 0;return t=je(e.nextNode)?t:this.getNextValidElement(e.nextNode)},$si);function $si(e){var d=this;this.isCompleted=!0,this.isCopying=!1,this.isSelectionCompleted=!0,this.scrollbarWidth=0,this.isWebPrinting=!1,this.isHeaderFooter=!1,this.isSpellCheckPending=!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.isDragging=!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.allowSpaceOfSameStyleInTable=!1,this.alignTablesRowByRow=!1,this.compatibilityMode="Word2013",this.lists=[],this.comments=[],this.authors=new uJt,this.revisionsInternal=new uJt,this.commentUserOptionId=1,this.abstractLists=[],this.styles=new Gri,this.stylesMap=new uJt,this.preDefinedStyles=void 0,this.isRowOrCellResizing=!1,this.endBookmarksUpdated=[],this.formFields=[],this.isMouseDownInFooterRegion=!1,this.pageFitTypeIn="None",this.fieldCollection=[],this.isPageField=!1,this.mouseDownOffset=new kri(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.isLinuxOS=!1,this.isFormFilling=!1,this.fontSubstitutionTable=void 0,this.themes=new Gsi,this.hasThemes=!1,this.footnotes=new uli,this.endnotes=new uli,this.isFootnoteWidget=!1,this.isDragStarted=!1,this.isMouseDownInSelection=!1,this.isBookmarkInserted=!0,this.isMappedContentControlUpdated=!0,this.isAutoResizeCanStart=!1,this.isRestartNumbering=!1,this.onTextInput=function(e){d.isComposingIME||(e.preventDefault(),e=e.data,d.owner.editorModule.handleTextInput(e))},this.compositionStart=function(){F.isDevice||d.owner.isReadOnlyMode||(d.isComposingIME=!0,d.positionEditableTarget(),d.owner.editorHistoryModule&&d.owner.editorModule.initComplexHistory("IMEInput")),d.isCompositionStart=!0},this.compositionUpdated=function(){d.isComposingIME&&!d.owner.isReadOnlyMode&&setTimeout(function(){d.owner.editorModule.insertIMEText(d.getEditableDivTextContent(),!0)},0),d.isCompositionUpdated=!0},this.compositionEnd=function(e){var t;d.isComposingIME&&!d.owner.isReadOnlyMode&&(t=d.getEditableDivTextContent(),setTimeout(function(){""!==t&&d.owner.editorModule.insertIMEText(t,!1),d.isComposingIME=!1,d.lastComposedText="";var e="pointer-events:none;position:absolute;left:"+d.owner.viewer.containerLeft+"px;top:"+d.owner.viewer.containerTop+"px;outline:none;background-color:transparent;width:0px;height:0px;overflow:hidden";rt(d.iframe,e),d.editableDiv.innerHTML="",d.owner.editorHistoryModule&&(""!==t&&(d.owner.editorModule.isSkipOperationsBuild=d.owner.enableCollaborativeEditing),d.owner.editorHistoryModule.updateComplexHistory(),""===t&&(d.owner.editorModule.isSkipOperationsBuild=d.owner.enableCollaborativeEditing,d.owner.editorHistoryModule.undo(),d.owner.editorHistoryModule.redoStack.pop()),d.owner.editorModule.isSkipOperationsBuild=!1)},0)),e.preventDefault(),d.isCompositionUpdated=!1,d.isCompositionEnd=!0},this.onImageResizer=function(e){!je(d.owner)&&!je(d.owner.imageResizerModule)&&d.owner.imageResizerModule.isImageResizerVisible&&d.owner.imageResizerModule.isImageResizing&&(e instanceof MouseEvent?d.onMouseUpInternal(e):e instanceof TouchEvent&&d.onTouchUpInternal(e)),d.scrollMoveTimer&&(d.isMouseEntered=!0,clearInterval(d.scrollMoveTimer))},this.onKeyPressInternal=function(e){var t,i=e.which||e.keyCode,n=(d.triggerElementsOnLoading=!1,!(!e.ctrlKey&&!e.metaKey)||17===i),i=e.altKey||18===i;(n=F.isIE&&i?n&&!1:n)&&"v"===e.key||n&&"a"===e.key||(n||d.isControlPressed&&F.isIE)&&"p"===e.key?F.isIE&&(d.isControlPressed=!1):((!d.owner.isReadOnlyMode&&d.owner.editorModule.canEditContentControl||"FormFieldsOnly"===d.owner.documentHelper.protectionType&&d.owner.editorModule.canEditContentControl&&!je(d.owner.documentHelper.selection)&&d.owner.documentHelper.selection.checkContentControlLocked()||!je(d.selection)&&d.selection.isInlineFormFillMode())&&(i="",(t=e.keyCode||e.charCode)?i=String.fromCharCode(t):e.key&&(i=e.key)," "===i||"\r"===i||"\b"===i||i===String.fromCharCode(27)||n?" "===i&&(d.isSpellCheckPending=!1,d.triggerSpellCheck=!0,d.owner.editorModule.handleTextInput(" "),d.triggerSpellCheck=!1):(d.triggerSpellCheck=!1,d.isSpellCheckPending=!0,d.owner.editorModule.handleTextInput(i)),e.preventDefault()),d.owner.focusIn())},this.onTextInputInternal=function(e){d.owner.isReadOnlyMode?d.editableDiv.innerText="":d.owner.editorModule.onTextInputInternal()},this.onCopy=function(e){!d.isCopying||je(d.selection)||d.selection.isEmpty||(d.owner.selection.onCopy(e),e.preventDefault())},this.onPaste=function(e){(!d.owner.isReadOnlyMode&&d.owner.editorModule.canEditContentControl||d.selection.isInlineFormFillMode())&&d.owner.editorModule.pasteInternal(e),d.editableDiv.innerText="",e.preventDefault()},this.onFocusOut=function(){je(d.selection)||d.owner.contextMenuModule&&d.owner.contextMenuModule.contextMenuInstance&&"block"===d.owner.contextMenuModule.contextMenuInstance.element.style.display||d.selection.hideCaret()},this.updateFocus=function(){d.owner.enableCollaborativeEditing&&d.owner.editorModule.isRemoteAction||(je(d.currentSelectedComment)||d.owner.commentReviewPane.commentPane.isEditMode?!d.selection||d.isMobileDevice&&d.owner.isReadOnly||(void 0===navigator||F.isDevice||F.isIE||navigator.userAgent.match("Edge")||je(d.iframe)||d.iframe.focus(),je(d.editableDiv)||d.editableDiv.focus(),d.selection.showCaret()):(d.owner.commentReviewPane&&d.owner.commentReviewPane.commentPane.isEditMode&&d.owner.commentReviewPane.commentPane.selectComment(d.currentSelectedComment),d.selection.hideCaret()))},this.scrollHandler=function(){d.scrollTimer&&clearTimeout(d.scrollTimer),d.clearContent(),d.isScrollHandler=!0,F.isDevice||d.isComposingIME||(d.iframe.style.top=d.owner.viewer.containerTop+"px",d.iframe.style.left=d.owner.viewer.containerLeft+"px"),d.owner.hRuler&&(d.hRuler=document.getElementById(d.owner.element.id+"_hRulerBottom"),d.hRuler.style.top=d.viewerContainer.scrollTop+"px",d.markIndicator=document.getElementById(d.owner.element.id+"_markIndicator"),d.markIndicator)&&(d.markIndicator.style.top=d.viewerContainer.scrollTop+"px"),d.owner.vRuler&&(d.vRuler=document.getElementById(d.owner.element.id+"_vRulerBottom"),d.vRuler.style.left=d.viewerContainer.scrollLeft+"px",d.markIndicator=document.getElementById(d.owner.element.id+"_markIndicator"),d.markIndicator)&&(d.markIndicator.style.left=d.viewerContainer.scrollLeft+"px"),d.owner.rulerHelper&&!je(d.owner.rulerHelper.vRulerBottom)&&(d.owner.rulerHelper.vRulerBottom.style.height=d.pageContainer.offsetHeight+"px"),d.owner.viewer.updateScrollBars();var e=d.owner.viewer.containerTop+d.visibleBounds.height-(d.owner.viewer.padding.top+d.owner.viewer.padding.bottom);e>d.pageContainer.offsetHeight&&(d.viewerContainer.scrollTop=d.owner.viewer.containerTop-(e-d.pageContainer.offsetHeight)),d.owner.viewer instanceof nai&&!je(d.owner)&&d.owner.fireViewChange(),d.isScrollHandler=!1,d.scrollTimer=setTimeout(function(){d.isScrollHandler||je(d.owner)||!d.owner.isSpellCheck||(d.isScrollToSpellCheck=!0,d.owner.viewer.updateScrollBars())},200)},this.onWindowResize=function(){!je(d.owner)&&d.owner.isContainerResize?d.owner.isContainerResize=!1:(d.resizeTimer&&clearTimeout(d.resizeTimer),d.resizeTimer=setTimeout(function(){je(d.owner)||je(d.owner.element)||(d.updateViewerSize(),d.owner.rulerHelper&&d.owner.documentEditorSettings&&d.owner.documentEditorSettings.showRuler&&d.owner.rulerHelper.updateRuler(d.owner,!0),d.owner.enableCollaborativeEditing&&d.owner.collaborativeEditingHandlerModule&&d.owner.collaborativeEditingHandlerModule.updateCaretPosition(),d.clearContent(),d.owner.viewer.updateScrollBars(),je(d.selection)||d.selection.updateCaretPosition(),d.updateTouchMarkPosition(),d.owner.contextMenuModule&&d.owner.contextMenuModule.contextMenuInstance&&d.owner.contextMenuModule.contextMenuInstance.close(),d.resizeTimer&&clearTimeout(d.resizeTimer))},200))},this.onContextMenu=function(e){d.owner.contextMenuModule&&(d.isMouseDown&&(d.isMouseDown=!1),d.owner.contextMenuModule.onContextMenuInternal(e),d.updateFocus())},this.onMouseDownInternal=function(e){var t,i=e.target;d.owner.focusIn(),!je(i)&&i!==d.viewerContainer||d.owner.isTableMarkerDragging||d.isTouchInput||e.offsetX>d.visibleBounds.width-(d.visibleBounds.width-d.viewerContainer.clientWidth)||e.offsetY>d.visibleBounds.height-(d.visibleBounds.height-d.viewerContainer.clientHeight)||(d.isFootnoteWidget=!1,je(d.selection))||(d.updateCursor(e),d.formFillPopup&&d.formFillPopup.hidePopup(),d.contentDropDown&&d.contentDropDown.hidePopup(),d.isLeftButtonPressed(e)&&!d.owner.isReadOnlyMode&&d.owner.enableImageResizerMode&&!je(d.owner.imageResizerModule.selectedResizeElement)&&(d.selection.isInShape&&(i=d.owner.selectionModule.getCurrentTextFrame().containerShape,d.selection.selectShape(i)),d.owner.imageResizerModule.isImageResizing=!0),e.preventDefault(),d.isTouchInput||d.selection.hideCaret(),i=new kri(e.offsetX,e.offsetY),t=d.owner.viewer.findFocusedPage(i,!0,!0),d.mouseDownOffset.x=t.x,d.mouseDownOffset.y=t.y,d.isMouseDownInFooterRegion=d.selection.isCursorInsidePageRect(i,d.currentPage)&&d.selection.isCursorInFooterRegion(i,d.currentPage),d.isSelectionChangedOnMouseMoved=!1,d.owner.isReadOnlyMode||!d.owner.editorModule.tableResize.isInCellResizerArea(t)&&!d.owner.editorModule.tableResize.isInRowResizerArea(t)?(e.ctrlKey&&(d.isControlPressed=!0),d.owner.selectionModule.isEmpty&&(d.useTouchSelectionMark=!1),i=d.getLineWidget(t),3===e.which&&!d.owner.selectionModule.isEmpty&&d.selection.checkCursorIsInSelection(i,t)?e.preventDefault():(d.owner&&d.owner.documentEditorSettings&&d.owner.documentEditorSettings.allowDragAndDrop&&!d.owner.selectionModule.isEmpty&&d.selection.checkCursorIsInSelection(i,t)&&(d.isMouseDownInSelection=!0),d.isTouchInput=!1,d.isMouseDown=!0,d.updateFocus(),d.timer=setTimeout(function(){d.tapCount++,1<d.tapCount&&(d.tapCount=1),d.isScrollHandler||je(d.owner)||!d.owner.isSpellCheck||(d.isScrollToSpellCheck=!0,d.owner.viewer.updateScrollBars())},100))):(d.selection.hideCaret(),d.isMouseDown=!0,d.isSelectionChangedOnMouseMoved=!1,d.isLeftButtonPressed(e)&&(d.owner.editorModule.tableResize.startingPoint.x=t.x,d.owner.editorModule.tableResize.startingPoint.y=t.y,d.owner.editorModule.tableResize.handleResize(t))))},this.onMouseMoveInternal=function(e){var t,i,n,o,r,s,a;!je(e.target)&&e.target!==d.viewerContainer||d.owner.isTableMarkerDragging||(e.preventDefault(),je(d.selection))||(!d.owner.isReadOnlyMode&&d.owner.enableImageResizerMode&&d.owner.imageResizerModule.isImageResizing?d.owner.imageResizerModule.isImageMoveToNextPage||d.owner.imageResizerModule.handleImageResizingOnMouse(e):(t=new kri(e.offsetX,e.offsetY),i=d.owner.viewer.findFocusedPage(t,!d.owner.enableHeaderAndFooter),n=d.getLineWidget(i),d.isMouseDown&&(je(d.currentPage)||(o=i.x,r=i.y,!d.owner.isReadOnlyMode&&d.isRowOrCellResizing?(a=d.owner.editorModule.tableResize.currentResizingTable,s=d.selection.setPositionForBlock(a,!0),a=d.selection.setPositionForBlock(a,!1),d.owner.documentHelper.isDocumentProtected&&!d.selection.checkSelectionIsAtEditRegion(s,a)||d.owner.editorModule.tableResize.handleResizing(i)):((!d.isDragStarted&&d.isMouseDownInSelection&&d.isLeftButtonPressed(e)&&!d.owner.selectionModule.isEmpty&&d.selection.checkCursorIsInSelection(n,i)||!d.owner.isReadOnlyMode&&d.owner.enableImageResizerMode&&!d.isDragStarted&&d.isLeftButtonPressed(e)&&!d.owner.selectionModule.isEmpty&&!je(n)&&d.owner.imageResizerModule.selectedImageWidget.containsKey(n)&&!d.owner.imageResizerModule.isImageResizing)&&(d.isDragStarted=!0,d.isMouseDownInSelection=!1,d.selection.isForward?(d.dragStartParaInfo=d.selection.getParagraphInfo(d.selection.start),d.dragEndParaInfo=d.selection.getParagraphInfo(d.selection.end)):(d.dragStartParaInfo=d.selection.getParagraphInfo(d.selection.end),d.dragEndParaInfo=d.selection.getParagraphInfo(d.selection.start)),d.selection.caret.classList.remove("e-de-cursor-animation")),d.isTouchInput||d.isSelectionChangedOnMouseMoved||0<d.touchDownOnSelectionMark||d.isDragStarted||(d.updateTextPositionForSelection(i,1),je(d.currentSelectedComment))||!d.owner.commentReviewPane||d.owner.commentReviewPane.commentPane.isEditMode||(d.currentSelectedComment=void 0),d.isLeftButtonPressed(e)&&!d.isDragStarted&&(e.preventDefault(),s=d.owner.selectionModule.end,a=new kri(o,r),d.owner.enableImageResizerMode&&d.owner.imageResizerModule.isImageResizerVisible&&!d.owner.imageResizerModule.isShapeResize||(d.isCompleted=!1,d.owner.selectionModule.moveTextPosition(a,s)),d.isSelectionChangedOnMouseMoved=!0),d.isDragStarted&&d.isLeftButtonPressed(e)&&(d.autoScrollOnSelection(t),d.selection.updateTextPosition(n,i)))),d.selection.checkForCursorVisibility()),d.isRowOrCellResizing||d.isSelectionChangedOnMouseMoved||d.updateCursor(e),d.isRowOrCellResizing&&d.selection.hideCaret()))},this.onMouseLeaveInternal=function(e){e.preventDefault();var t,i=new kri(e.offsetX,e.offsetY);d.isMouseDown&&(t=d.viewerContainer.scrollTop,clearInterval(d.scrollMoveTimer),e.offsetY+t>t?d.scrollMoveTimer=setInterval(function(){d.scrollForwardOnSelection(i)},100):d.scrollMoveTimer=setInterval(function(){d.scrollBackwardOnSelection(i)},100),d.isMouseEntered)&&(d.isMouseEntered=!1),d.isDragStarted&&(d.selection.hideCaret(),d.scrollMoveTimer)&&(clearInterval(d.scrollMoveTimer),d.scrollMoveTimer=0)},this.onMouseEnterInternal=function(e){d.isMouseEntered||d.owner.viewer.updateScrollBars(),d.isMouseEntered=!0,d.scrollMoveTimer&&clearInterval(d.scrollMoveTimer),!d.isLeftButtonPressed(e)&&d.isDragStarted&&(d.selection.caret.classList.contains("e-de-cursor-animation")||d.selection.caret.classList.add("e-de-cursor-animation"),d.isDragStarted=!1),!d.isLeftButtonPressed(e)&&d.isMouseDown&&d.onMouseUpInternal(e)},this.onDoubleTap=function(e){if(d.owner.focusIn(),(je(e.target)||e.target===d.viewerContainer)&&!je(d.selection)){d.isTouchInput=!1;var e=new kri(e.offsetX,e.offsetY),t=d.owner.viewer.findFocusedPage(e,!0);if(!d.selection.checkAndEnableHeaderFooter(e,d.owner.viewer.findFocusedPage(e,!0))){e=d.getLineWidget(t);if(!je(e)){e=d.selection.getHyperLinkFieldInCurrentSelection(e,t,!0);if(je(e)&&(e=d.selection.getCurrentFormField()),d.isDocumentProtected||!d.owner.enableFormField||d.owner.isReadOnlyMode)d.isDocumentProtected&&e&&e.formFieldData instanceof ili&&"Text"===e.formFieldData.type&&d.selection.selectField();else{t=d.selection.getFormFieldType(e);if(t)switch(""!==t.toString()&&d.selection.selectField(e),t){case"Text":d.owner.textFormFieldDialogModule.show();break;case"CheckBox":d.owner.checkBoxFormFieldDialogModule.show();break;case"DropDown":d.owner.dropDownFormFieldDialogModule.show()}}var e=d.selection.start.clone(),t=d.selection.end.clone(),i=e.currentWidget.getInline(e.offset,0).element;if("Pages"===d.owner.layoutType)if(i instanceof fli)if("Footnote"===i.footnoteType){for(var n=d.currentPage.footnoteWidget,o=void 0,o=0;o<=n.bodyWidgets.length;o++){var r=n.bodyWidgets[o].footNoteReference;if(i.text===r.text)break}e.setPositionParagraph(n.bodyWidgets[o].childWidgets[0].childWidgets[0],0),t.setPositionParagraph(n.bodyWidgets[o].childWidgets[0].childWidgets[0],0),d.selection.selectRange(e,t)}else d.navigateToEndNote(i,e,t);else i instanceof pli&&(d.selection.isinEndnote||d.selection.isinFootnote)&&d.selection.footnoteReferenceElement(e,t,i);!d.selection.isEmpty||je(d.currentPage)||je(d.owner.selectionModule.start)||(d.owner.selectionModule.selectCurrentWord(),d.selection.checkForCursorVisibility(),d.tapCount=2)}}}},this.onMouseUpInternal=function(e){if((je(e.target)||e.target===d.viewerContainer)&&!d.owner.isTableMarkerDragging){e.preventDefault(),d.isListTextSelected=!1;var t=new kri(e.offsetX,e.offsetY),i=d.owner.viewer.findFocusedPage(t,!0);if(!je(d.selection)){var n=1,o=(F.isIE?n=d.tapCount:2<e.detail&&(n=e.detail),d.isRowOrCellResizing&&d.owner.editorModule.tableResize.updateResizingHistory(i),!je(d.owner.editor)&&d.selection.checkContentControlLocked()&&d.owner.editorModule.insertContentControlPlaceholder(),!d.isMouseDown||d.isSelectionChangedOnMouseMoved||je(d.currentPage)||je(d.owner.selectionModule.start)||d.owner.enableImageResizerMode&&d.owner.imageResizerModule.isImageResizing||(0!==d.touchDownOnSelectionMark||d.isRowOrCellResizing||(e.shiftKey?(o=d.owner.selectionModule.end,d.owner.selectionModule.moveTextPosition(i,o)):(d.updateTextPositionForSelection(i,n),d.owner.selectionModule.isImageSelected?(o=d.owner.getImageContentControl())instanceof Pli&&"Picture"==o.contentControlProperties.type&&(o=d.owner.picturePositionY,d.owner.renderPictureContentControlElement(d.owner,!0,!1,o)):d.owner.renderPictureContentControlElement(d.owner,!1,!1)),F.isIE&&2===n&&d.selection.checkAndEnableHeaderFooter(t,i)),d.selection.checkForCursorVisibility(),je(d.currentSelectedComment))||!d.owner.commentReviewPane||d.owner.commentReviewPane.commentPane.isEditMode||(d.currentSelectedComment=void 0),d.isIosDevice?e.metaKey:e.ctrlKey);if(je(d.owner.editorModule)||je(d.owner.selectionModule)||(h=d.owner.selection.currentContentControl,n=d.owner.selectionModule.checkContentControlLocked(),(je(h)||h.contentControlProperties.lockContents||!n||0!==e.button)&&(je(h)||h.contentControlProperties.lockContents||"FormFieldsOnly"!=d.protectionType||0!==e.button)||d.owner.isReadOnly||(d.isDocumentProtected?(d.selection.checkSelectionIsAtEditRegion()||d.isFormFillProtectedMode)&&"CheckBox"===h.contentControlProperties.type&&(d.owner.editor.toggleContentControlCheckBox(h,!h.contentControlProperties.isChecked),h.contentControlProperties.isTemporary)&&d.owner.editor.removeContentControl():"CheckBox"===h.contentControlProperties.type&&(d.owner.editor.toggleContentControlCheckBox(h,!h.contentControlProperties.isChecked),h.contentControlProperties.isTemporary)&&d.owner.editor.removeContentControl()),h&&d.selection.selectPlaceHolderText(h)),je(d.currentPage)||je(d.owner.selectionModule.start)||!d.owner.selectionModule.isEmpty&&!d.owner.selectionModule.isImageSelected||!(o&&d.owner.useCtrlClickToFollowHyperlink||!d.owner.useCtrlClickToFollowHyperlink)||!0!==d.isLeftButtonPressed(e)||d.selection.navigateHyperLinkOnEvent(i,!1),d.isMouseDown&&d.isLeftButtonPressed(e)&&d.isDocumentProtected&&"FormFieldsOnly"===d.protectionType&&d.selection){var r,t=d.getLineWidget(i);if(je(t))return;(r=je(r=d.selection.getHyperLinkFieldInCurrentSelection(t,i,!0))?d.selection.getCurrentFormField(!0):r)&&r.formFieldData&&r.formFieldData.enabled&&!d.selection.isInlineFormFillMode(r)&&(n={fieldName:r.formFieldData.name},r.formFieldData instanceof ili?n.value=r.resultText:r.formFieldData instanceof rli?n.value=r.formFieldData.checked:n.value=r.formFieldData.selectedIndex,n.isCanceled=!1,"Popup"===d.owner.documentEditorSettings.formFieldSettings.formFillingMode&&(d.selection.previousSelectedFormField,d.selection.getCurrentFormField()),d.owner.trigger(DJt,n),n.isCanceled||("Popup"===d.owner.documentEditorSettings.formFieldSettings.formFillingMode&&!(r.formFieldData instanceof rli)||r.formFieldData instanceof ili&&"Text"!==r.formFieldData.type||r.formFieldData instanceof lli?d.formFillPopup.showPopUp(r):(d.owner.editorModule.toggleCheckBoxFormField(r),n.value=r.formFieldData.checked,n.isCanceled=!1,d.owner.trigger(EJt,n)))),r||!d.isFormFillProtectedMode||(o=!1,o=!je(h=d.owner.selection.currentContentControl)&&h instanceof Pli&&!h.contentControlProperties.lockContentControl||o)||d.selection.navigateToNextFormField()}else d.isMouseDown&&(0<d.formFields.length&&((r=d.selection.getCurrentFormField(!0))&&r.formFieldData instanceof ili?d.selection.selectField():d.isLeftButtonPressed(e)&&r&&r.formFieldData instanceof lli&&(t=r.line.getOffset(r,0),n=d.selection.getPhysicalPositionInternal(r.line,t,!1),d.selection.selectInternal(r.line,r,0,n))),0<d.contentControlCollection.length&&d.selection.triggerContentControlFillEvent(),d.isSelectionChangedOnMouseMoved)&&d.selection.fireSelectionChanged(!0);if(!d.owner.isReadOnlyMode&&d.isSelectionInListText(i)&&d.selection.selectListText(),!d.owner.isReadOnlyMode&&d.owner.enableImageResizerMode&&d.owner.imageResizerModule.isImageResizing&&(d.owner.imageResizerModule.mouseUpInternal(),d.scrollToPosition(d.owner.selectionModule.start,d.owner.selectionModule.end),d.owner.imageResizerModule.isImageResizing=!1),d.owner.enableImageResizerMode&&d.owner.imageResizerModule.isImageResizerVisible&&!je(d.selection.caret)&&(d.selection.caret.style.display="none"),d.isDragStarted){if(0!==d.selection.selectedWidgets.length||je(d.dragStartParaInfo)||je(d.dragEndParaInfo)||!d.dragEndParaInfo.paragraph.equals(d.dragStartParaInfo.paragraph)){if(0<d.selection.selectedWidgets.length)for(var s=0;s<d.selection.selectedWidgets.values.length;s++){var a=d.selection.selectedWidgets.values[s];if(!je(a.floatingItems)&&0<a.floatingItems.length)for(var l=0;l<a.floatingItems.length;l++)if(a.floatingItems[l]instanceof rhi&&"Inline"!==a.floatingItems[l].textWrappingStyle){d.isDragStarted=!1;break}if(!d.isDragStarted)break}}else{var h=d.dragStartParaInfo.paragraph.getInline(d.dragEndParaInfo.offset,0);!je(h.element)&&h.element instanceof rhi&&"Inline"!==h.element.textWrappingStyle&&(d.isDragStarted=!1)}d.isDragStarted||(d.dragStartParaInfo=void 0,d.dragEndParaInfo=void 0,d.selection.caret.classList.add("e-de-cursor-animation"))}d.isDragStarted&&(d.isDragging=!0,d.moveSelectedContent(),d.isDragging=!1),d.isMouseDown&&d.updateFocus(),d.isMouseDownInSelection=!1,d.isMouseDown=!1,d.isFootnoteWidget=!1,d.isSelectionChangedOnMouseMoved=!1,d.isTouchInput=!1,d.useTouchSelectionMark=!0,d.isControlPressed=!1,d.isListTextSelected&&d.selection.hideCaret(),d.owner.enableImageResizerMode&&((o=d.owner.imageResizerModule).isImageResizing=!1,o.isImageMoveToNextPage=!1,o.leftValue=void 0,o.topValue=void 0),d.isMouseDownInFooterRegion=!1}d.selection&&(d.selection.isCellPrevSelected=!1),0<d.owner.documentHelper.contentControlCollection.length&&(d.clearContent(),d.owner.documentHelper.viewer.updateScrollBars())}},this.onTouchStartInternal=function(e){var t,i,n;d.selection&&(d.isTouchMoved=!1,d.isCompositionStart=!1,d.isCompositionEnd=!1,d.isCompositionUpdated=!1,d.isCompositionCanceled=!0,d.isTouchInput=!0,d.isTimerStarted?1===d.tapCount?d.tapCount=2:(d.tapCount=3,d.isTimerStarted=!1):(d.isTimerStarted=!0,d.tapCount=1),1===e.touches.length&&(d.zoomX=e.touches[0].clientX,d.zoomY=e.touches[0].clientY,d.owner.selectionModule.isEmpty&&(d.useTouchSelectionMark=!1),d.isMouseDown=!0,d.isSelectionChangedOnMouseMoved=!1,t=void 0,d.isMouseDown&&(t=d.getTouchOffsetValue(e)),t=d.owner.viewer.findFocusedPage(t,!0,!0),d.owner.enableImageResizerMode&&(i=d.owner.imageResizerModule.getImagePointOnTouch(t),d.owner.imageResizerModule.selectedResizeElement=i.selectedElement),d.owner.enableImageResizerMode&&!je(d.owner.imageResizerModule.selectedResizeElement)&&(d.owner.imageResizerModule.isImageResizing=!0),F.isDevice&&(d.editableDiv.contentEditable=d.owner.isReadOnlyMode?"false":"true"),i=d.owner.selectionModule.end.location.x,n=d.selection.getCaretBottom(d.owner.selectionModule.end,d.owner.selectionModule.isEmpty)+9,d.touchDownOnSelectionMark=(t.y<=n&&t.y>=n-20||t.y>=n&&t.y<=n+20)&&(t.x<=i&&t.x>=i-20||t.x>=i&&t.x<=i+20)?1:0,d.owner.selectionModule.isEmpty||0!==d.touchDownOnSelectionMark||(i=d.owner.selectionModule.start.location.x,n=d.selection.getCaretBottom(d.owner.selectionModule.start,!1)+9,d.touchDownOnSelectionMark=(t.y<=n&&t.y>=n-20||t.y>=n&&t.y<=n+20)&&(t.x<=i&&t.x>=i-20||t.x>=i&&t.x<=i+20)?2:0)),!je(d.owner.contextMenuModule)&&d.owner.contextMenuModule.contextMenuInstance&&d.owner.contextMenuModule.contextMenuInstance.close(),(d.touchDownOnSelectionMark||1<e.touches.length)&&e.preventDefault(),d.longTouchTimer=setTimeout(d.onLongTouch,500,e),d.timer=setTimeout(function(){d.isTimerStarted=!1},200),d.owner.focusIn())},this.onLongTouch=function(e){var t,i,n,o,r,s,a;je(d.owner)||je(d.viewerContainer)||d.isTouchMoved||1!==e.touches.length||(t=d.getTouchOffsetValue(e),i=d.owner.viewer.findFocusedPage(t,!0),n=d.selection.start,o=d.selection.end,a=!1,d.selection.isForward||(n=d.selection.end,o=d.selection.start),r=n.location,s=o.location,a=n.currentWidget!==o.currentWidget?!(i.x>=r.x&&i.x<=s.x||i.y>=r.y&&i.y<=s.y):!(i.x>=r.x&&i.x<=s.x&&i.y>=r.y&&i.y<=s.y),1===e.changedTouches.length&&a&&(d.updateSelectionOnTouch(t,i),d.isMouseDown=!1,d.touchDownOnSelectionMark=0,d.useTouchSelectionMark=!0,d.isSelectionChangedOnMouseMoved=!1),d.selection.isEmpty&&d.selection.selectCurrentWord(),!je(d.owner.contextMenuModule)&&d.owner.contextMenuModule.contextMenuInstance&&d.owner.contextMenuModule.onContextMenuInternal(e))},this.onTouchMoveInternal=function(e){d.isTouchMoved=!0;var t,i,n,o=e.touches;if(!je(d.selection)){if(d.owner.editorModule&&d.owner.enableImageResizerMode&&d.owner.imageResizerModule.isImageResizing)return e.preventDefault(),void(d.owner.imageResizerModule.isImageMoveToNextPage||(d.owner.imageResizerModule.handleImageResizingOnTouch(e),d.selection.caret.style.display="none"));d.isMouseDown&&(t=d.getTouchOffsetValue(e),t=d.owner.viewer.findFocusedPage(t,!0),0<d.touchDownOnSelectionMark&&(d.isCompleted=!1,e.preventDefault(),n=t.y,i=d.owner.selectionModule.end,t.y<=26?n-=t.y<0?0:t.y+.5:n-=36.5,i=2===d.touchDownOnSelectionMark?d.selection.start:d.selection.end,t=new kri(t.x,n),d.owner.selectionModule.moveTextPosition(t,i),d.isSelectionChangedOnMouseMoved=!0),d.selection.checkForCursorVisibility(),d.updateTouchMarkPosition())}1<o.length&&(e.preventDefault(),d.isMouseDown=!1,d.zoomX=(o[0].clientX+o[1].clientX)/2,d.zoomY=(o[0].clientY+o[1].clientY)/2,n=Math.sqrt(Math.pow(o[0].clientX-o[1].clientX,2)+Math.pow(o[0].clientY-o[1].clientY,2)),-1<d.preDifference?n>d.preDifference?d.onPinchOutInternal(e):n<d.preDifference&&d.onPinchInInternal(e):d.zoomFactor<2?-1!==d.preDifference&&n>d.preDifference&&d.onPinchInInternal(e):-1===d.preDifference&&2<d.zoomFactor&&n>d.preDifference&&d.onPinchInInternal(e),d.preDifference=n),d.longTouchTimer&&(clearTimeout(d.longTouchTimer),d.longTouchTimer=void 0)},this.onTouchUpInternal=function(e){var t,i;je(d.selection)||(t=d.getTouchOffsetValue(e),i=d.owner.viewer.findFocusedPage(t,!0),1===e.changedTouches.length&&((!d.isTouchMoved||d.owner.enableImageResizerMode&&d.owner.imageResizerModule.isImageResizing)&&(d.updateSelectionOnTouch(t,i),je(d.currentPage)||je(d.selection.start)||d.isSelectionChangedOnMouseMoved||!(d.selection.isEmpty||d.selection.isImageField()&&(!d.owner.enableImageResizerMode||d.owner.enableImageResizerMode&&!d.owner.imageResizerModule.isImageResizing))||d.selection.navigateHyperLinkOnEvent(i,!0)),d.isSelectionChangedOnMouseMoved&&d.selection.fireSelectionChanged(!0),d.isMouseDown=!1,d.touchDownOnSelectionMark=0,d.useTouchSelectionMark=!0,d.isSelectionChangedOnMouseMoved=!1),d.owner.enableImageResizerMode&&d.owner.imageResizerModule.isImageResizing&&(d.owner.imageResizerModule.mouseUpInternal(),d.owner.imageResizerModule.isImageResizing=!1,d.owner.imageResizerModule.isImageMoveToNextPage=!1,d.scrollToPosition(d.owner.selectionModule.start,d.owner.selectionModule.end)),d.owner.enableImageResizerMode&&d.owner.imageResizerModule.isImageResizerVisible&&d.isTouchInput&&(d.touchStart.style.display="none",d.touchEnd.style.display="none"),e.preventDefault()),d.preDifference=-1,d.isTouchInput=!1,d.longTouchTimer&&(clearTimeout(d.longTouchTimer),d.longTouchTimer=void 0),d.isTimerStarted||(d.tapCount=1),d.isListTextSelected&&d.selection.hideCaret(),d.owner.focusIn()},this.onKeyUpInternal=function(e){F.isDevice&&e.target===d.editableDiv&&window.getSelection().anchorOffset!==d.prefix.length&&d.selection.setEditableDivCaretPosition(d.editableDiv.innerText.length),!e.ctrlKey&&17!==e.keyCode&&17!==e.which||(d.isControlPressed=!1)},this.onKeyDownInternal=function(e){if(je(e.target)||e.target===d.editableDiv||"container_editor_iconsplitbtn"===e.target.id){d.owner.focusIn();var t=!1,i={event:e,isHandled:!1,source:d.owner};if(d.owner.trigger("keyDown",i),!i.isHandled){var i=e.which||e.keyCode,n=!(!e.ctrlKey&&!e.metaKey)||17===i,o=e.shiftKey||16===i,r=e.altKey||18===i;if(n&&!o&&!r)switch(i){case 80:e.preventDefault(),d.owner.print(),t=!0;break;case 83:e.preventDefault(),d.owner.save(""===d.owner.documentName?"sample":d.owner.documentName,"Sfdt"),t=!0}8!==e.keyCode&&46!==e.keyCode&&!je(d.owner.editor)&&d.selection.checkContentControlLocked()&&d.owner.editorModule.insertContentControlPlaceholder(),t||je(d.selection)||(d.selection.caret.classList.remove("e-de-cursor-animation"),d.selection.onKeyDownInternal(e,n,o,r)),!je(d.owner.documentHelper)&&0<d.owner.documentHelper.contentControlCollection.length&&(d.clearContent(),d.owner.documentHelper.viewer.updateScrollBars()),t&&e.preventDefault(),d.timer=setTimeout(function(){d.isScrollHandler||je(d.owner)||!d.owner.isSpellCheck||(d.isScrollToSpellCheck=!0,d.owner.viewer.updateScrollBars())},100),je(d.selection)||d.selection.caret.classList.contains("e-de-cursor-animation")||d.selection.caret.classList.add("e-de-cursor-animation")}}},this.owner=e,this.pages=[],this.lists=[],this.abstractLists=[],this.render=new Csi(this),this.characterFormat=new Eri(this),this.themeFontLanguage=new Eri(this),this.paragraphFormat=new bri(this),this.renderedLists=new uJt,this.renderedLevelOverrides=[],this.headersFooters=[],this.styles=new Gri,this.stylesMap=new uJt,this.owner&&(this.L10n=new Cn("documenteditor",this.owner.defaultLocale),this.L10n.setLocale(this.owner.locale)),this.preDefinedStyles=new uJt,this.initalizeStyles(),this.bookmarks=new uJt,this.editRanges=new uJt,this.isIosDevice="undefined"!=typeof window&&/Mac|iPad|iPod/i.test(navigator.userAgent),this.isMobileDevice="undefined"!=typeof window&&/Android|Windows Phone|webOS/i.test(navigator.userAgent),this.isLinuxOS="undefined"!=typeof window&&/Linux/i.test(navigator.userAgent),this.formFillPopup=new Fsi(this.owner),this.contentDropDown=new Rsi(this.owner),this.customXmlData=new uJt,this.fontSubstitutionTable=new uJt,this.contentControlCollection=[],this.footnoteCollection=[],this.endnoteCollection=[],this.themes=new Gsi,this.images=new uJt}Object.defineProperty(tai.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),Object.defineProperty(tai.prototype,"pageFitType",{get:function(){return this.pageFitTypeIn},set:function(e){this.pageFitTypeIn=e,this.onPageFitTypeChanged(this.pageFitTypeIn)},enumerable:!0,configurable:!0}),tai.prototype.updateClientArea=function(e,t,i){je(e)||(n=e.sectionFormat,this.columnLayoutArea.setColumns(n));var n,o,r,s,a,l,h,d,p=0,c=0;this instanceof sai?((p=(this.documentHelper.visibleBounds.width-4*this.padding.right-2*this.padding.left)/this.documentHelper.zoomFactor)<0&&(p=0),c=Number.POSITIVE_INFINITY,this.clientArea=new pai(this.padding.left/this.documentHelper.zoomFactor,0,p,c)):(o=0,d=a=48,r=Y.convertPointToPixel(n.pageHeight),s=Y.convertPointToPixel(n.bottomMargin),je(n)||(o=Y.convertPointToPixel(n.topMargin),a=Y.convertPointToPixel(n.headerDistance),d=Y.convertPointToPixel(n.footerDistance)),h=!1,je(t.headerWidget)||(h=t.headerWidget.isEmpty,0<=o?h&&!this.owner.enableHeaderAndFooter||(o=Math.min(Math.max(a+t.headerWidget.height,o),r/100*40)):o=Math.abs(o)),a=.667+s,je(t.footerWidget)||(h=t.footerWidget.isEmpty,l=je(t.footnoteWidget)?0:t.footnoteWidget.height,l=Math.min(l,(r-o-a)/100*90),0<=a?h&&!this.owner.enableHeaderAndFooter||(a=.667+Math.min(r/100*40,Math.max(d+t.footerWidget.height,s))):a=Math.abs(a),a+=l),je(n)||(p=Y.convertPointToPixel(n.pageWidth-n.leftMargin-n.rightMargin),c=r-o-a),p<0&&(p=0),h=new pai(Y.convertPointToPixel(n.leftMargin),o,p,r-o-a),t.footnoteWidget&&i&&!this.documentHelper.owner.editorModule.isFootNote&&0!==t.footnoteWidget.y&&this.clientArea.y+this.clientArea.height>t.footnoteWidget.y&&(d=this.clientArea.y+this.clientArea.height-t.footnoteWidget.y,this.clientArea.height-=d/2),0!==e.page.bodyWidgets[0].columnIndex&&this.owner.editorModule.updateColumnIndex(e,!1),this.setClientArea(e,h)),this.clientActiveArea=new pai(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height)},tai.prototype.setClientArea=function(e,t){this.clientArea=this.columnLayoutArea.getColumnBoundsByBodyWidget(e,t),e.x=this.clientArea.x,e.width=this.clientArea.width},tai.prototype.updateClientAreaTopOrLeft=function(e,t){t&&(this.clientActiveArea.y=this.clientActiveArea.y+e.topBorderWidth,this.clientActiveArea.x=this.clientActiveArea.x+e.leftBorderWidth)},tai.prototype.updateClientAreaForTable=function(e){this.clientActiveArea.x=this.clientArea.x=e.x,this.clientActiveArea.width=this.clientArea.width=e.width},tai.prototype.updateClientAreaForRow=function(e,t){e=e.ownerTable;t||(this.clientActiveArea.x=this.clientArea.x=e.x,this.clientActiveArea.width=this.clientArea.width=e.width,this.clientArea=new pai(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height),this.clientActiveArea=new pai(this.clientActiveArea.x,this.clientActiveArea.y,this.clientActiveArea.width,this.clientActiveArea.height))},tai.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=0<n.width?n.width:0,this instanceof nai&&(this.clientActiveArea.height=Number.POSITIVE_INFINITY)):(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-Y.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing),e.ownerTable.isInsideTable||(this.clientActiveArea.height=0<this.clientArea.bottom-i.y?this.clientArea.bottom-i.y:0,!e.ownerTable.wrapTextAround&&0<this.documentHelper.layout.existFootnoteHeight&&(t=this.clientActiveArea.height-this.documentHelper.layout.existFootnoteHeight,this.clientActiveArea.height=t<0?0:t))),this.clientArea=new pai(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height),this.clientActiveArea=new pai(this.clientActiveArea.x,this.clientActiveArea.y,this.clientActiveArea.width,this.clientActiveArea.height)},tai.prototype.updateClientAreaForTextBoxShape=function(e,t,i){var n,o,r,s;"Inline"!==e.textWrappingStyle||i||(e.y=this.clientActiveArea.y,e.x=this.clientActiveArea.x),t&&(i=Y.convertPointToPixel(e.textFrame.marginLeft),t=Y.convertPointToPixel(e.textFrame.marginRight),n=Y.convertPointToPixel(e.textFrame.marginTop),o=Y.convertPointToPixel(e.textFrame.marginBottom),r=e.width,s=Number.POSITIVE_INFINITY,this.clientArea=new pai(e.x+i,e.y+n,r-i-t,s-n-o),this.clientActiveArea=new pai(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height))},tai.prototype.updateClientAreaByWidgetFootNote=function(e){this.clientArea.x=e.x,this.clientArea.y=e.y,this.clientActiveArea.x=e.x,this.clientActiveArea.y=e.y},tai.prototype.updateClientAreaForTextWrap=function(e){this.clientActiveArea=new pai(e.x,e.y,e.width,e.height)},tai.prototype.updateBoundsBasedOnTextWrap=function(e){var t=e-this.clientActiveArea.y;this.clientActiveArea.y=e,this.clientActiveArea.height=this.clientActiveArea.height-t},tai.prototype.updateBoundsBasedOnTextWrapTable=function(e){var t=e-this.clientArea.y;this.clientArea.y=e,this.clientArea.height=this.clientArea.height-t,this.clientActiveArea=new pai(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height)},tai.prototype.updateClientAreaByWidget=function(e){this.clientArea.x=e.x,this.clientArea.y=e.y,this.clientActiveArea.x=e.x,this.clientActiveArea.y=e.y},tai.prototype.updateClientAreaLocation=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width},tai.prototype.updateClientAreaForBlock=function(e,t,i,n,o){var r,s,a=Y.convertPointToPixel(e.leftIndent),l=Y.convertPointToPixel(e.rightIndent),h=e.bidi,d=0;t?e instanceof _ai&&i?(t=i[0],e.bodyWidget.sectionFormat.columns.length<=1&&(this.clientActiveArea.x=this.clientArea.x=t.x,this.clientActiveArea.width=this.clientArea.width=t.width),(t=i[i.length-1]).x=this.clientActiveArea.x,t.y=this.clientActiveArea.y):(e instanceof _ai&&!je(e.tableFormat)&&(e.isGridUpdated||(e.buildTableColumns(),e.isGridUpdated=!0),"Left"!==(r=this.tableAlignmentForBidi(e,h)))&&(i=(i=0)===(i=Y.convertPointToPixel(e.tableHolder.getTotalWidth(0)))?0===e.tableHolder.tableWidth?e.getTableClientWidth(e.getOwnerWidth(!1)):e.tableHolder.tableWidth:i,this.owner.editorModule&&this.owner.editorModule.tableResize.currentResizingTable===e&&0===this.owner.editorModule.tableResize.resizerPosition&&(i=Y.convertPointToPixel(e.tableHolder.tableWidth)),a="Center"===r?(this.documentHelper.isRowOrCellResizing||(i=e.getTableCellWidth()),(this.clientArea.width-i)/2):this.clientArea.width-i,h&&(l=a-=Y.convertPointToPixel(e.leftIndent)),e.isInsideTable,this.documentHelper.tableLefts.push(a)),d=this.clientArea.width-(a+Y.convertPointToPixel(e.rightIndent)),s=this.clientArea.x+(h?l:a),d=0<d?d:0,this.clientActiveArea.x=this.clientArea.x=s,this.clientActiveArea.width=this.clientArea.width=d,n&&this.updateParagraphYPositionBasedonTextWrap(e,new pai(this.clientActiveArea.x,this.clientActiveArea.y,this.clientActiveArea.width,this.clientActiveArea.height)),o&&(e instanceof Lai?this.updateParagraphXPositionBasedOnTextWrap(e):this.updateTableXPositionBasedOnTextWrap(e))):(e instanceof _ai&&!je(e.tableFormat)&&(r=this.tableAlignmentForBidi(e,h),e.isGridUpdated||(e.buildTableColumns(),e.isGridUpdated=!0),"Left"!==r)&&0<this.documentHelper.tableLefts.length&&(a=this.documentHelper.tableLefts.pop(),h)&&(l=a),d=this.clientArea.width+a+Y.convertPointToPixel(e.rightIndent),s=this.clientArea.x-(h?l:a),d=0<d?d:0,this.clientActiveArea.x=this.clientArea.x=s,this.clientActiveArea.width=this.clientArea.width=d),this.clientArea=new pai(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height),this.clientActiveArea=new pai(this.clientActiveArea.x,this.clientActiveArea.y,this.clientActiveArea.width,this.clientActiveArea.height)},tai.prototype.updateParagraphYPositionBasedonTextWrap=function(e,t){var i=e.bodyWidget,n=this.clientActiveArea;if(i&&0<i.floatingElements.length&&e instanceof Lai&&!(e.containerWidget instanceof Zli)&&!e.isInsideTable&&!(e.containerWidget instanceof Pai)){var o="Word2013"===this.documentHelper.compatibilityMode,r=e,s=r.isEmpty(),a=r.height;if(0===a&&(a=this.documentHelper.textHelper.getParagraphMarkSize(r.characterFormat).Height),!r.isInHeaderFooter||r.isInsideTable||o){var l=t.y,h=!1,d=(i.floatingElements.sort(function(e,t){return e.y-t.y}),i.floatingElements.sort(function(e,t){return e.x-t.x}),r.previousRenderedWidget);d&&d instanceof _ai&&d.wrapTextAround&&!s&&!r.isContainsShapeAlone()&&o&&t.y<d.y&&(t.y=d.y);for(var p=0;p<i.floatingElements.length;p++){var c,u,g,m,f,y,v=i.floatingElements[p],b=!1,b=v instanceof qli?v.paragraph.isInHeaderFooter:v.bodyWidget instanceof Iai;r.isInsideTable&&v instanceof _ai&&!v.isInsideTable||(c=this.getTextWrappingBound(v),u=v instanceof _ai?"Square":v.textWrappingStyle,g=v instanceof _ai?"Both":v.textWrappingType,n.x>c.right+24)||n.right<c.x-24||((t.y+(v instanceof _ai&&!s&&0===r.floatingElements.length?a:r.height)>c.y||h)&&t.y<c.bottom&&"Inline"!==u&&"TopAndBottom"!==u&&"InFrontOfText"!==u&&"Behind"!==u?(y=0,m=Y.convertPointToPixel(r.paragraphFormat.rightIndent),f=Y.convertPointToPixel(r.paragraphFormat.firstLineIndent),f=!s&&r.childWidgets[0].isFirstLine()&&0<f?f:0,y=(y=t.x>=c.x&&"Left"!==g?m:y)<0?y:0,t.x<c.x&&t.x>c.x&&"Left"!==g?(t.right>c.x&&(t.width=t.width-(t.right-c.right)),t.width<24?(!o&&v instanceof _ai&&d===v||(this.updateBoundsBasedOnTextWrap(c.bottom),t=this.clientActiveArea),((!s&&r.childWidgets[0].isFirstLine()||s)&&o||!b)&&(r.y=this.clientActiveArea.y)):t.x=c.right):t.x>=c.x&&t.x<c.right?(t.width=t.width-(c.right-t.x)-y,(t.width<24||h)&&(t.width=this.clientActiveArea.right-c.right-y,f=!1,t.width<24||h)?(this.clientActiveArea.x+24<c.x&&!je(m=this.getIntersectingItemBounds(i.floatingElements,v,l))&&m.bottom<=c.bottom&&(this.updateBoundsBasedOnTextWrap(m.bottom),t=this.clientActiveArea,f=!0,r.x=m.x),o&&!f&&(v instanceof _ai&&d===v?this.updateBoundsBasedOnTextWrapTable(c.bottom):this.updateBoundsBasedOnTextWrap(c.bottom),t=this.clientActiveArea),((!s&&r.childWidgets[0].isFirstLine()||s)&&o||!b)&&(r.y=this.clientActiveArea.y)):t.x=c.right):c.x>t.x&&t.right>c.x&&(t.width=c.x-t.x,t.width<24)&&(t.width=this.clientActiveArea.right-c.right-y,t.width<24?(!o&&v instanceof _ai&&d===v||(this.updateBoundsBasedOnTextWrap(c.bottom),t=this.clientActiveArea),((!s&&r.childWidgets[0].isFirstLine()||s)&&o||!b)&&(r.y=this.clientActiveArea.y)):t.x=c.right)):0<i.floatingElements.length&&(t.y>=c.y&&t.y<c.bottom||t.y+a>=c.y&&t.y+a<c.bottom)&&"TopAndBottom"===u&&(!o&&v instanceof _ai&&d===v||(this.updateBoundsBasedOnTextWrap(c.bottom),!o&&(!s&&r.childWidgets[0].isFirstLine()||s)&&(h=!0)),(!s&&r.childWidgets[0].isFirstLine()||s)&&o||!b)&&(r.y=this.clientActiveArea.y))}}}},tai.prototype.updateParagraphXPositionBasedOnTextWrap=function(e){var t="Word2013"===this.documentHelper.compatibilityMode,i=e.containerWidget,n=this.clientActiveArea;if(this instanceof nai&&!je(i)&&e instanceof Lai&&!je(i.page)&&!je(i.page.headerWidget)){var o=i.page.headerWidget.floatingElements;if(0<o.length&&(!e.isInHeaderFooter||e.isInsideTable||t)&&!(e.containerWidget instanceof Pai)&&!(e.bodyWidget instanceof Zli))for(var r=e,s=0;s<o.length;s++){var a,l,h=o[s];r.isInsideTable&&h instanceof _ai&&!h.isInsideTable||(a=this.getTextWrappingBound(h),l=h instanceof _ai?"Square":h.textWrappingStyle,h instanceof _ai||h.textWrappingType,r.isInsideTable)||n.x>a.right+24||n.right<a.x-24||0<o.length&&n.y+r.height>a.y&&n.y<a.bottom&&"Inline"!==l&&"TopAndBottom"!==l&&"InFrontOfText"!==l&&"Behind"!==l&&(h=Y.convertPointToPixel(r.paragraphFormat.rightIndent),"Left"!=r.paragraphFormat.textAlignment&&n.x<a.x&&n.x+r.width>a.x?r.x=n.x:n.x>=a.x&&n.x<a.right&&!r.paragraphFormat.bidi?(n.width=n.width-(a.right-n.x)-h,n.width<24?(n.width=this.clientActiveArea.right-a.right-h,n.width<24?(r.x=n.x,n.width=n.width,n.height=a.bottom-n.x,n.y=a.bottom):n.x=a.right):("Word2007"===this.documentHelper.compatibilityMode||n.y<=a.bottom)&&Y.convertPointToPixel(r.paragraphFormat.leftIndent)+Y.convertPointToPixel(r.paragraphFormat.firstLineIndent)+n.x<a.right&&(n.x=a.right)):(a.x-24>n.x&&n.right>a.x||n.x>a.x&&n.x>a.right)&&(r.x=n.x))}}},tai.prototype.updateTableXPositionBasedOnTextWrap=function(e){var t=Y.convertPointToPixel(e.childWidgets[0].getFirstRowWidth()),i=e.bodyWidget;if(this instanceof nai&&!je(i)&&!je(i.page)&&!je(i.page.headerWidget)){var n=i.page.headerWidget.floatingElements;if(!(!(0<n.length)||e.isInHeaderFooter&&e.isInsideTable&&"Word2013"!==this.documentHelper.compatibilityMode||e.containerWidget instanceof Zli))for(var o=this.clientActiveArea,r=0;r<n.length;r++){var s=n[r],a=this.getTextWrappingBound(s),l=s instanceof _ai?"Square":s.textWrappingStyle,s=(s instanceof _ai?s.positioning:s).allowOverlap,h=this.documentHelper.getFirstParagraphInFirstCell(e),h=this.documentHelper.textHelper.getParagraphMarkSize(h.characterFormat).Height,d=e.childWidgets[0]instanceof jai?e.childWidgets[0].height:0,d=(h<d&&(h=d),Y.convertPointToPixel(e.getTableClientWidth(e.getContainerWidth())));this.clientArea.x>a.right+24||this.clientArea.right<a.x-24||this.isFloatingItemIntersect(e,o,a,l,s,h,d)&&o.x>=a.x&&o.x<a.right&&(o.width=o.width-(a.right-o.x),(o.width<24||o.width<t&&0<t)&&(o.width=this.clientActiveArea.right-a.right,o.width<24||o.width<t&&0<t&&this.clientArea.right<=t+a.right)?(l=a.bottom>o.y?a.bottom-o.y:0,o.y=a.bottom,o.width=this.clientArea.width,o.height=o.height-l):o.x=a.right,this.updateClientAreaForTextWrap(o))}}},tai.prototype.isFloatingItemIntersect=function(e,t,i,n,o,r,s){return(Math.round(t.y+r)>=Math.round(i.y)&&Math.round(t.y)<Math.round(i.bottom)||Math.round(t.y+r)<=Math.round(i.bottom)&&Math.round(t.y+r)>=Math.round(i.y))&&"Inline"!==n&&"TopAndBottom"!==n&&"InFrontOfText"!==n&&"Behind"!==n&&!(o&&null!==e.tableFormat&&e.wrapTextAround&&e.positioning.allowOverlap)},tai.prototype.getIntersectingItemBounds=function(e,t,i){e=this.getMinBottomFloatingItem(e,this.getIntersectingFloatingItems(e,t,i));if(!je(e))return this.getTextWrappingBound(e)},tai.prototype.getMinBottomFloatingItem=function(e,t){var i=-1,n=Number.MAX_VALUE,o=0;e.sort(function(e,t){return e.x-t.x});for(var r=0;r<t.length;r++){var s=e[r],a=this.getTextWrappingBound(s);n>a.bottom&&(s&&t.indexOf(s)+1<t.length?o++:(n=a.bottom,i=t.indexOf(s)))}return i-o==0?t[i]:null},tai.prototype.getIntersectingFloatingItems=function(e,t,i){for(var n=[],o=0;o<e.length;o++){var r=e[o],s=this.getTextWrappingBound(r),a=this.getTextWrappingBound(t);i<=s.bottom&&a.bottom>=s.bottom&&s.right>this.clientActiveArea.x&&s.x<a.x&&n.push(r)}return n},tai.prototype.getTextWrappingBound=function(e){var t=0,i=0,n=0,o=0,r=0;return e instanceof qli?(t=e.distanceLeft,i=e.distanceTop,n=e.distanceRight,o=e.distanceBottom,r=e.width):(r=e.getTableCellWidth(),t=e.positioning.distanceLeft,i=e.positioning.distanceTop,n=e.positioning.distanceRight,o=e.positioning.distanceBottom),new pai(e.x-t,e.y-i,r+t+n,e.height+i+o)},tai.prototype.tableAlignmentForBidi=function(e,t){e=e.tableFormat.tableAlignment;return t&&("Left"===e?e="Right":"Right"===e&&(e="Left")),e},tai.prototype.cutFromLeft=function(e){(e=e<this.clientActiveArea.x?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},tai.prototype.cutFromTop=function(e){(e=e<this.clientActiveArea.y?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},tai.prototype.updateClientWidth=function(e){this.clientActiveArea.x-=e,0<this.clientActiveArea.width+e?this.clientActiveArea.width+=e:this.clientActiveArea.width=0},tai.prototype.findFocusedPage=function(e,t,i){var n=new kri(e.x,e.y);n.x+=this.documentHelper.viewerContainer.scrollLeft,n.y+=this.documentHelper.viewerContainer.scrollTop;for(var o=0;o<this.documentHelper.pages.length;o++){var r=this.documentHelper.pages[o],s=(r.boundingRectangle.y-this.pageGap*(o+1))*this.documentHelper.zoomFactor+this.pageGap*(o+1),a=r.boundingRectangle.height*this.documentHelper.zoomFactor+this.pageGap,l=r.boundingRectangle.x,h=void 0,h=this instanceof nai?(r.boundingRectangle.right-l)*this.documentHelper.zoomFactor+l:r.boundingRectangle.right+l;if(s<=n.y&&s+a>=n.y)return t&&(this.documentHelper.currentPage=r,i)&&(je(r.headerWidget)||(r.headerWidget.page=r),je(r.footerWidget)||(r.footerWidget.page=r)),n.y=(n.y-s)/this.documentHelper.zoomFactor,n.x>h?n.x=r.boundingRectangle.right:n.x<l?n.x=0:n.x=(n.x-l)/this.documentHelper.zoomFactor,n}return n},tai.prototype.getPageHeightAndWidth=function(e,t,i,n){for(var o=e=0;o<this.documentHelper.pages.length;o++)e+=this.documentHelper.pages[o].boundingRectangle.height;for(o=t=0;o<this.documentHelper.pages.length;o++)t<this.documentHelper.pages[o].boundingRectangle.width&&(t=this.documentHelper.pages[o].boundingRectangle.width);return{height:e,width:t,viewerWidth:this.documentHelper.visibleBounds.width,viewerHeight:this.documentHelper.visibleBounds.height}},tai.prototype.renderVisiblePages=function(){if(!(je(this.visiblePages)||this.visiblePages.length<1)){this.documentHelper.clearContent();for(var e=0;e<this.visiblePages.length;e++){var t=this.visiblePages[e],i=t.boundingRectangle.width*this.documentHelper.zoomFactor,n=t.boundingRectangle.height*this.documentHelper.zoomFactor,o=t.boundingRectangle.x,r=(t.boundingRectangle.y-this.pageGap*(e+1))*this.documentHelper.zoomFactor+this.pageGap*(e+1);this.owner.viewer.renderPage(t,o,r,i,n)}}},tai.prototype.handleZoom=function(){var e=this.documentHelper.preZoomFactor,t=null,i=0,n=!1;this.documentHelper.selection&&je(this.documentHelper.zoomX&&je(this.documentHelper.zoomY))&&(s=p=0,a=this.documentHelper.selection.getPage(this.documentHelper.selection.end.currentWidget.paragraph),(p=(this.documentHelper.visibleBounds.width-a.boundingRectangle.width*e)/2)<30&&(p=30),s=a.boundingRectangle.y*e+(this.documentHelper.pages.indexOf(a)+1)*this.pageGap*(1-e),l=(a=this.documentHelper.selection.updateCaretSize(this.owner.selectionModule.end,!0)).topMargin,a.height,p+=this.documentHelper.selection.end.location.x*e,s+=(this.documentHelper.selection.end.location.y+l)*e,p>=this.containerLeft)&&p<=this.documentHelper.visibleBounds.width&&s>=this.containerTop&&s<=this.containerTop+this.documentHelper.visibleBounds.height&&(n=!0);for(var o=0;o<this.documentHelper.pages.length;o++)i+=this.documentHelper.pages[o].boundingRectangle.height;for(var r=0,o=0;o<this.documentHelper.pages.length;o++)r<this.documentHelper.pages[o].boundingRectangle.width&&(r=this.documentHelper.pages[o].boundingRectangle.width);var s,a=i*this.documentHelper.zoomFactor+(this.documentHelper.pages.length+1)*this.pageGap*(1-this.documentHelper.zoomFactor)-this.documentHelper.visibleBounds.height,l=r*this.documentHelper.zoomFactor-this.documentHelper.visibleBounds.width;if(this.documentHelper.visibleBounds.width-r*this.documentHelper.zoomFactor<60&&(l+=60),0<a){var h=this.containerTop;if(0<this.visiblePages.length){for(var d=((t=this.visiblePages[0]).boundingRectangle.y-(t.index+1)*this.pageGap)*e+(t.index+1)*this.pageGap,p=this.documentHelper.zoomY,c=h+(p=this.documentHelper.visibleBounds.height/2);c>d+t.boundingRectangle.height*e;){var u=t.index+1;if(u===this.documentHelper.pages.length)break;d=((t=this.documentHelper.pages[u]).boundingRectangle.y-(t.index+1)*this.pageGap)*e+(t.index+1)*this.pageGap}h=(t.boundingRectangle.y-(t.index+1)*this.pageGap)*this.documentHelper.zoomFactor+(t.index+1)*this.pageGap+(c-d<0?c-d:(c-d)*(this.documentHelper.zoomFactor/e))-p,p=this.documentHelper.visibleBounds.height/2}this.documentHelper.viewerContainer.scrollTop=h}else this.documentHelper.viewerContainer.scrollTop=0;0<l?(h=this.containerLeft,0<this.visiblePages.length&&(null===t&&(t=this.visiblePages[0]),je(s=this.documentHelper.zoomX)&&(s=this.documentHelper.visibleBounds.width/2),a=t.boundingRectangle.width*e/t.boundingRectangle.width,h=t.boundingRectangle.x+((p=h+s)-t.boundingRectangle.x<0?p-t.boundingRectangle.x:(p-t.boundingRectangle.x)*(this.documentHelper.zoomFactor/a))-s,s=this.documentHelper.visibleBounds.width/2),this.documentHelper.viewerContainer.scrollLeft=h):this.documentHelper.viewerContainer.scrollLeft=0,this.updateScrollBars(),n&&this.documentHelper.scrollToPosition(this.documentHelper.selection.start,this.documentHelper.selection.end),this instanceof sai&&this.owner.editorModule.layoutWholeDocument()},tai.prototype.updateCanvasWidthAndHeight=function(e,t,i,n,o,r){this instanceof nai?this.documentHelper.visibleBounds.width!==this.documentHelper.viewerContainer.clientWidth?e-=this.documentHelper.visibleBounds.width-this.documentHelper.viewerContainer.clientWidth:t<i&&(e-=this.documentHelper.viewerContainer.offsetWidth-this.documentHelper.viewerContainer.clientWidth):t<i&&(e-=this.documentHelper.scrollbarWidth,n-=this.documentHelper.scrollbarWidth),e<n&&(t-=this.documentHelper.scrollbarWidth),o=e<n?n:e,r=t<i?i:t,parseInt(this.documentHelper.pageContainer.style.width.replace("px",""),10)===o&&parseInt(this.documentHelper.pageContainer.style.height.replace("px",""),10)===o||(this.documentHelper.pageContainer.style.width=o.toString()+"px",this.documentHelper.pageContainer.style.height=r.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:r,width:o,viewerWidth:e,viewerHeight:t,containerHeight:i,containerWidth:n}},tai.prototype.updateScrollBarPosition=function(e,t,i,n,o,r){this.owner.viewer.containerTop=this.documentHelper.viewerContainer.scrollTop,this.owner.viewer.containerWidth=e,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"},tai.prototype.destroy=function(){this.clientArea=void 0,this.clientActiveArea=void 0},tai.prototype.componentDestroy=function(){this.clientArea=void 0,this.clientActiveArea=void 0,this.owner=void 0};var eai=tai;function tai(e){this.visiblePages=[],this.padding=new uai(10,10,30,10),this.textWrap=!0,this.pageFitTypeIn="None",this.containerTop=0,this.containerWidth=0,this.containerLeft=0,this.owner=e,this.columnLayoutArea=new lai(this)}tte(oai,iai=eai),Object.defineProperty(oai.prototype,"pageGap",{get:function(){return this.owner.pageGap},enumerable:!0,configurable:!0}),Object.defineProperty(oai.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),oai.prototype.createNewPage=function(e,t){var i=this.pageGap,n=(0<this.documentHelper.pages.length&&(i=this.documentHelper.pages[this.documentHelper.pages.length-1].boundingRectangle.bottom+this.pageGap),new tdi(this.documentHelper));return this.updatePageBoundingRectangle(e,n,i),je(t)?this.documentHelper.pages.push(n):this.documentHelper.pages.splice(t,0,n),n.bodyWidgets.push(e),n.bodyWidgets[n.bodyWidgets.length-1].page=n,this.updateClientArea(e,n),this.documentHelper.layout.layoutHeaderFooter(e,this,n),this.updateClientArea(e,n),this.documentHelper.layout.footnoteHeight=0,n},oai.prototype.updatePageBoundingRectangle=function(e,t,i){var n=je(e.sectionFormat)?816:Y.convertPointToPixel(e.sectionFormat.pageWidth),e=je(e.sectionFormat)?1056:Y.convertPointToPixel(e.sectionFormat.pageHeight),o=(this.documentHelper.visibleBounds.width-n*this.documentHelper.zoomFactor)/2;o<this.pageLeft&&(o=this.pageLeft),t.boundingRectangle=new pai(o,i,n,e)},oai.prototype.onPageFitTypeChanged=function(e){var t,i=this.documentHelper.visibleBounds.width,n=this.documentHelper.visibleBounds.height,o=this.visiblePages[0].bodyWidgets[0],r=Y.convertPointToPixel(o.sectionFormat.pageWidth),s=Y.convertPointToPixel(o.sectionFormat.pageHeight);switch(e){case"FitOnePage":0<n&&0<s&&((t=(this.documentHelper.visibleBounds.height-2*this.pageGap-(this.pageGap-2))/s)===this.documentHelper.zoomFactor?je(this.owner.selectionModule)||je(this.owner.selectionModule.start)||je(this.owner.selectionModule.end)||this.documentHelper.scrollToPosition(this.owner.selectionModule.start,this.owner.selectionModule.end):this.documentHelper.zoomFactor=t);break;case"FitPageWidth":0<i&&0<r&&(this.documentHelper.zoomFactor=(this.documentHelper.visibleBounds.width-80)/r);break;default:this.documentHelper.zoomFactor=1}},oai.prototype.getCurrentPageHeaderFooter=function(e,t){return this.getCurrentHeaderFooter(this.getHeaderFooterType(e,t),e.index)},oai.prototype.getHeaderFooterType=function(e,t){var i=t?"OddHeader":"OddFooter",n=e.page;return e.sectionFormat.differentFirstPage&&(je(n.previousPage)||!je(n.previousPage)&&n.sectionIndex!==n.previousPage.sectionIndex&&n.previousPage.bodyWidgets[n.previousPage.bodyWidgets.length-1].sectionIndex!==n.bodyWidgets[0].sectionIndex)?i=t?"FirstPageHeader":"FirstPageFooter":e.sectionFormat.differentOddAndEvenPages&&(n.index+1)%2==0&&(i=t?"EvenHeader":"EvenFooter"),i},oai.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 o=0<t?t-1:t;!n&&-1!==o;)n=this.documentHelper.headersFooters[o][i],o--;n||((n=this.createHeaderFooterWidget(e)).isEmpty=!0),0==t&&(this.documentHelper.headersFooters[t][i]=n)}return n}if(0<t)return this.getCurrentHeaderFooter(e,t-1)},oai.prototype.createHeaderFooterWidget=function(e){var t=new Iai(e),i=new Lai;return i.childWidgets.push(new Gai(i)),e=-1!==e.indexOf("Header")?this.documentHelper.styles.findByName("Header"):this.documentHelper.styles.findByName("Footer"),i.paragraphFormat.baseStyle=e,i.paragraphFormat.listFormat.baseStyle=e,t.childWidgets.push(i),i.containerWidget=t},oai.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}},oai.prototype.updateHFClientArea=function(e,t){var i=Y.convertPointToPixel(e.pageWidth-e.leftMargin-e.rightMargin);i<0&&(i=0),this.clientArea=new pai(Y.convertPointToPixel(e.leftMargin),t?Y.convertPointToPixel(e.headerDistance):Y.convertPointToPixel(e.pageHeight-e.footerDistance),i,Number.POSITIVE_INFINITY),this.clientActiveArea=new pai(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height)},oai.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)},oai.prototype.updateFootnoteClientArea=function(e,t,i,n){var o=Y.convertPointToPixel(e.pageWidth-e.leftMargin-e.rightMargin),r=Y.convertPointToPixel(e.leftMargin),s=Y.convertPointToPixel(e.bottomMargin),a=Y.convertPointToPixel(e.footerDistance),e=Y.convertPointToPixel(e.pageHeight)-Math.max(a+t.page.footerWidget.height,s);this.clientArea=new pai(r,e,o,Number.POSITIVE_INFINITY),this.clientActiveArea=new pai(this.clientArea.x,this.clientArea.y,this.clientArea.width,Number.POSITIVE_INFINITY)},oai.prototype.scrollToPage=function(e){for(var t=0,i=0;i<this.documentHelper.pages.length&&(t=this.documentHelper.pages[i].boundingRectangle.y*(1<this.documentHelper.zoomFactor?this.documentHelper.zoomFactor:1)-this.pageGap/2,i!==e);i++);this.documentHelper.viewerContainer.scrollTop=t,this.updateScrollBars()},oai.prototype.updateScrollBars=function(){var e=this.getPageHeightAndWidth(0,0,0,0),t=e.width*this.documentHelper.zoomFactor+2*this.pageLeft,i=e.height*this.documentHelper.zoomFactor+(this.documentHelper.pages.length+1)*this.pageGap,n=this.updateCanvasWidthAndHeight(e.viewerWidth,e.viewerHeight,i,t,e.width,e.height),i=n.containerHeight,t=n.containerWidth;this.documentHelper.containerContext.globalAlpha=1,this.documentHelper.selectionContext.globalAlpha=.4;for(var o=0;o<this.documentHelper.pages.length;o++){var r=(n.width-this.documentHelper.pages[o].boundingRectangle.width*this.documentHelper.zoomFactor)/2;r>this.pageLeft?this.documentHelper.pages[o].boundingRectangle=new pai(r,this.documentHelper.pages[o].boundingRectangle.y,this.documentHelper.pages[o].boundingRectangle.width,this.documentHelper.pages[o].boundingRectangle.height):this.documentHelper.pages[o].boundingRectangle=new pai(this.pageLeft,this.documentHelper.pages[o].boundingRectangle.y,this.documentHelper.pages[o].boundingRectangle.width,this.documentHelper.pages[o].boundingRectangle.height)}this.updateScrollBarPosition(t,i,n.viewerWidth,n.viewerHeight,n.width,n.height),this.updateVisiblePages(),this.documentHelper.isScrollToSpellCheck=!1},oai.prototype.updateVisiblePages=function(){this.visiblePages=[];for(var e=0;e<this.documentHelper.pages.length;e++){var t=this.documentHelper.pages[e],i=(t.boundingRectangle.y-this.pageGap*(e+1))*this.documentHelper.zoomFactor+this.pageGap*(e+1),n=t.boundingRectangle.x;this.documentHelper.isPageInVisibleBound(t,i)&&this.addVisiblePage(t,n,i)}},oai.prototype.addVisiblePage=function(t,i,n){var o=this,r=t.boundingRectangle.width*this.documentHelper.zoomFactor,s=t.boundingRectangle.height*this.documentHelper.zoomFactor,e=(this.owner.enableImageResizerMode&&void 0!==this.owner.imageResizerModule.currentPage&&this.owner.imageResizerModule.currentPage===t&&this.owner.imageResizerModule.isImageResizerVisible&&this.owner.imageResizerModule.setImageResizerPositions(i,n,r,s),document.getElementById(this.owner.element.id+"PICTURE_CONTENT_CONTROL"));je(e)||"none"===e.style.display||this.owner.setPictureContentControlPositions(e),this.visiblePages.push(t),this.documentHelper.owner.isSpellCheck&&this.documentHelper.owner.spellCheckerModule.enableOptimizedSpellCheck&&(this.owner.documentHelper.triggerElementsOnLoading||this.owner.documentHelper.isScrollHandler)&&(this.documentHelper.cachedPages.indexOf(t.index)<0||this.owner.editorModule.isPasteContentCheck)&&(this.owner.documentHelper.cachedPages.push(t.index),e=void 0,0<(e=this.owner.editorModule.isPasteContentCheck?je(this.owner.editorModule.copiedTextContent)?"":this.owner.editorModule.copiedTextContent:this.documentHelper.owner.spellCheckerModule.getPageContent(t)).trim().length)?(t.allowNextPageRendering=!1,je(this.owner)||je(this.owner.spellCheckerModule)||this.owner.spellCheckerModule.updateUniqueWords(Y.getSpellCheckData(e)),this.owner.spellCheckerModule.callSpellChecker(this.owner.spellCheckerModule.languageID,e,!0,!1,!1,!0).then(function(e){e=JSON.parse(e);je(o.owner)||(je(o.owner.spellCheckerModule)||o.owner.spellCheckerModule.updateUniqueWords(e.SpellCollection),je(t)||(t.allowNextPageRendering=!0),je(o.documentHelper))||(o.documentHelper.triggerElementsOnLoading=!0,o.documentHelper.triggerSpellCheck=!0,o.documentHelper.triggerElementsOnLoading=!0,o.renderPage(t,i,n,r,s),o.documentHelper.triggerSpellCheck=!1,o.documentHelper.triggerElementsOnLoading=!1)}).catch(),je(t)||(t.allowNextPageRendering=!0)):this.renderPage(t,i,n,r,s)},oai.prototype.renderPage=function(e,t,i,n,o){this.documentHelper.render.renderWidgets(e,t-this.owner.viewer.containerLeft,i-this.owner.viewer.containerTop,n,o)};var iai,nai=oai;function oai(e){var t=iai.call(this,e)||this;return t.pageLeft=30,t.owner=e,t}tte(aai,rai=eai),Object.defineProperty(aai.prototype,"documentHelper",{get:function(){try{return this.owner.documentHelper}catch(e){}},enumerable:!0,configurable:!0}),Object.defineProperty(aai.prototype,"pageGap",{get:function(){return 0},enumerable:!0,configurable:!0}),aai.prototype.createNewPage=function(e,t){var i,n=0;return 0<this.documentHelper.pages.length&&(n=this.documentHelper.pages[this.documentHelper.pages.length-1].boundingRectangle.bottom),i=new tdi(this.documentHelper),0===this.documentHelper.pages.length?i.boundingRectangle=new pai(10,n,this.documentHelper.visibleBounds.width,this.documentHelper.visibleBounds.height):i.boundingRectangle=new pai(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},aai.prototype.onPageFitTypeChanged=function(e){this.documentHelper.zoomFactor=1},aai.prototype.scrollToPage=function(e){this.updateScrollBars()},aai.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},aai.prototype.getContentWidth=function(){for(var e=this.documentHelper.visibleBounds.width,t=e,i=0;i<this.documentHelper.pages.length;i++){for(var n,o=this.documentHelper.pages[i],r=0;r<o.bodyWidgets[0].childWidgets.length;r++)o.bodyWidgets[0].childWidgets[r]instanceof _ai&&(n=o.bodyWidgets[0].childWidgets[r],t<(n=Y.convertPointToPixel(n.getTableWidth())*this.documentHelper.zoomFactor+4*this.padding.left+4*this.padding.right+o.boundingRectangle.x))&&(t=e=n);o.boundingRectangle.width=e}return e},aai.prototype.updateScrollBars=function(){var e=this.getPageHeightAndWidth(0,0,0,0),t=this.getContentWidth()*this.documentHelper.zoomFactor,i=this.getContentHeight()*this.documentHelper.zoomFactor+this.padding.top+this.padding.bottom,e=this.updateCanvasWidthAndHeight(e.viewerWidth,e.viewerHeight,i,t,e.width,e.height);this.documentHelper.containerContext.globalAlpha=1,this.documentHelper.selectionContext.globalAlpha=.4,this.updateScrollBarPosition(t,i,e.viewerWidth,e.viewerHeight,e.width,e.height),this.updateVisiblePages(),this.documentHelper.isScrollToSpellCheck=!1},aai.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,o=(n=this.documentHelper.pages[i]).boundingRectangle.y*this.documentHelper.zoomFactor,r=n.boundingRectangle.height*this.documentHelper.zoomFactor;(t<=o&&o<=t+e||t<=o+r&&o+r<=t+e||o<=t&&t+e<=o+r)&&this.addVisiblePage(n,this.padding.left,o)}},aai.prototype.addVisiblePage=function(t,i,n){var o=this,r=this.getContentWidth(),s=this.getContentHeight()*this.documentHelper.zoomFactor+this.padding.top+this.padding.bottom,e=(this.owner.enableImageResizerMode&&void 0!==this.owner.imageResizerModule.currentPage&&this.owner.imageResizerModule.currentPage===t&&this.owner.imageResizerModule.isImageResizerVisible&&this.owner.imageResizerModule.setImageResizerPositions(i,n,r,s),document.getElementById(this.owner.element.id+"PICTURE_CONTENT_CONTROL"));je(e)||"none"===e.style.display||this.owner.setPictureContentControlPositions(e),this.visiblePages.push(t),this.documentHelper.owner.isSpellCheck&&this.documentHelper.owner.spellCheckerModule.enableOptimizedSpellCheck&&(this.owner.documentHelper.triggerElementsOnLoading||this.owner.documentHelper.isScrollHandler)&&(this.documentHelper.cachedPages.indexOf(t.index)<0||this.owner.editorModule.isPasteContentCheck)&&(this.owner.documentHelper.cachedPages.push(t.index),e=void 0,0<(e=this.owner.editorModule.isPasteContentCheck?je(this.owner.editorModule.copiedTextContent)?"":this.owner.editorModule.copiedTextContent:this.documentHelper.owner.spellCheckerModule.getPageContent(t)).trim().length)?(t.allowNextPageRendering=!1,je(this.owner)||je(this.owner.spellCheckerModule)||this.owner.spellCheckerModule.updateUniqueWords(Y.getSpellCheckData(e)),this.owner.spellCheckerModule.callSpellChecker(this.owner.spellCheckerModule.languageID,e,!0,!1,!1,!0).then(function(e){e=JSON.parse(e);je(o.owner)||(je(o.owner)||je(o.owner.spellCheckerModule)||o.owner.spellCheckerModule.updateUniqueWords(e.SpellCollection),t.allowNextPageRendering=!0,je(o.documentHelper))||(o.documentHelper.triggerSpellCheck=!0,o.documentHelper.triggerElementsOnLoading=!0,o.renderPage(t,i,n,r,s),o.documentHelper.triggerSpellCheck=!1,o.documentHelper.triggerElementsOnLoading=!1)}).catch(),je(t)||(t.allowNextPageRendering=!0)):this.renderPage(t,i,n,r,s)},aai.prototype.renderPage=function(e,t,i,n,o){this.documentHelper.render.renderWidgets(e,t-this.owner.viewer.containerLeft,i-this.owner.viewer.containerTop,n,o)};var rai,sai=aai;function aai(e){var t=rai.call(this,e)||this;return t.visiblePages=[],t.owner=e,t}Object.defineProperty(hai.prototype,"currentIndex",{get:function(){return this.currentIndexIn},set:function(e){0<=e&&(this.currentIndexIn=e)},enumerable:!0,configurable:!0}),Object.defineProperty(hai.prototype,"columnCount",{get:function(){var e;return e=0<(e=je(this.columnIn)?e:this.numberOfColumnsIn)?e:1},enumerable:!0,configurable:!0}),hai.prototype.setColumns=function(e){if(this.pageWidth=Y.convertPointToPixel(e.pageWidth-e.leftMargin-e.rightMargin),this.numberOfColumnsIn=e.numberOfColumns,!je(e.columns)){for(var t=e.columns,i=[],n=0;n<e.numberOfColumns;n++){var o=this.defaultSpaceIn,r=0,r=(!je(t)&&0<t.length&&(o=t[n].space,r=t[n].width),this.getColumnObj(r,o,e.numberOfColumns,e.equalWidth));r.index=n,i.push(r)}this.columnIn=i}},hai.prototype.clear=function(){this.currentIndexIn=0,this.defaultSpaceIn=36,this.columnIn=null,this.pageWidth=0},hai.prototype.reset=function(){this.currentIndex=0},hai.prototype.getColumnBounds=function(e,t){var i=this.currentIndexIn;return this.getColumnBoundsByIndex(i,t)},hai.prototype.getColumnBoundsByBodyWidget=function(e,t){e=e.columnIndex;return this.getColumnBoundsByIndex(e,t)},hai.prototype.getNextColumnByBodyWidget=function(e){e=e.columnIndex;return this.getColumnByIndex(e+1)},hai.prototype.getColumnByIndex=function(e){if(0<=e&&e<this.columnCount&&!je(this.columnIn)&&0<this.columnIn.length)return this.columnIn[e]},hai.prototype.getColumnObj=function(e,t,i,n){var o=(i-1)*t,r=new hri;return!n&&0!==e||je(this.pageWidth)||(e=(this.pageWidth-o)/i),r.width=e,r.space=t,r},hai.prototype.getColumnBoundsByIndex=function(e,t){var i=new pai(t.x,t.y,t.width,t.height);if(0<=e&&0<this.columnIn.length){var n;if(!je(this.columnIn[e])){t=this.getColumnByIndex(e),i.width=t.width;for(var o=0;o<e;o++)n=this.columnIn[o],i.x+=n.width,i.x+=n.space}}return i};var lai=hai;function hai(e){this.viewerIn=e,this.clear()}dai=function(e,t){return(dai=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])}))(e,t)};var dai,pJ=function(e,t){function i(){this.constructor=e}dai(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},pai=(Object.defineProperty(cai.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(cai.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),cai.prototype.isIntersecting=function(e){return!(e.y>this.bottom||this.y>e.bottom||e.x>this.right||this.x>e.right)},cai.prototype.clone=function(){return new cai(this.x,this.y,this.width,this.height)},cai);function cai(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n}var uai=function(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},gai=(mai.prototype.clone=function(){return new mai(this.left,this.top,this.right,this.bottom)},mai.prototype.destroy=function(){this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0},mai);function mai(e,t,i,n){this.left=e,this.top=t,this.right=i,this.bottom=n}Object.defineProperty(yai.prototype,"indexInOwner",{get:function(){return this instanceof Sai&&this.page?(this.containerWidget instanceof Pai?this.containerWidget:this.page).bodyWidgets.indexOf(this):this.containerWidget&&this.containerWidget.childWidgets?this.containerWidget.childWidgets.indexOf(this):this instanceof Pai?0:-1},enumerable:!0,configurable:!0}),Object.defineProperty(yai.prototype,"firstChild",{get:function(){return 0<this.childWidgets.length?this.childWidgets[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(yai.prototype,"lastChild",{get:function(){return this.childWidgets&&0<this.childWidgets.length?this.childWidgets[this.childWidgets.length-1]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(yai.prototype,"previousWidget",{get:function(){var e=this,t=this.indexInOwner;return e=e instanceof Sai?0<t?e.page.bodyWidgets[t-1]:void 0:0<t?e.containerWidget.childWidgets[t-1]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(yai.prototype,"nextWidget",{get:function(){var e=this,t=this.indexInOwner;if(-1!==t)return e=e instanceof Sai?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(yai.prototype,"previousRenderedWidget",{get:function(){var e=this,t=this.indexInOwner;if(!(t<0)){if(e instanceof Sai)if(0<t&&!(e.containerWidget instanceof Pai))e=e.page.bodyWidgets[t-1];else if(e.containerWidget instanceof Pai&&!e.page.documentHelper.owner.editorModule.removeEditRange){if(t<=0)return;e=e.containerWidget.bodyWidgets[t-1]}else e=(i=e.page.previousPage)&&0<i.bodyWidgets.length?i.bodyWidgets[i.bodyWidgets.length-1]:void 0;else if(e instanceof Pai)for(var i=e.page;i.previousPage&&je(e=(i=i.previousPage).footnoteWidget););else if(0<t)e=e.containerWidget.childWidgets[t-1];else{var n=void 0;for(e.containerWidget instanceof Uai?n=e.containerWidget.getPreviousSplitWidget():e.containerWidget&&e.containerWidget.containerWidget instanceof Pai&&"Endnote"===e.containerWidget.containerWidget.footNoteType?n=e.containerWidget.previousWidget||e.containerWidget.previousRenderedWidget:e.containerWidget instanceof jai||e.containerWidget instanceof Iai||e.containerWidget&&e.containerWidget.containerWidget instanceof Pai||(n=e.containerWidget.previousRenderedWidget);n&&0===n.childWidgets.length&&!je(n=n.previousRenderedWidget););e=n&&n.constructor===e.containerWidget.constructor?n.lastChild:void 0}return e}},enumerable:!0,configurable:!0}),Object.defineProperty(yai.prototype,"nextRenderedWidget",{get:function(){var e=this,t=this.indexInOwner;if(!(t<0)){if(e instanceof Sai)if(t<e.page.bodyWidgets.length-1&&!(e.containerWidget instanceof Pai))e=e.page.bodyWidgets[t+1];else if(e.containerWidget instanceof Pai){if(t>=e.containerWidget.bodyWidgets.length-1&&!e.page.documentHelper.owner.editorModule.removeEditRange)return;e=e.containerWidget.bodyWidgets[t+1]}else e=e.page.allowNextPageRendering&&(i=e.page.nextPage)&&0<i.bodyWidgets.length?i.bodyWidgets[0]:void 0;else if(e instanceof Pai)for(var i=e.page;i.allowNextPageRendering&&i.nextPage&&je(e=(i=i.nextPage).footnoteWidget););else if(t<e.containerWidget.childWidgets.length-1)e=e.containerWidget.childWidgets[t+1];else{var n=void 0;for(e.containerWidget instanceof Uai?n=e.containerWidget.getNextSplitWidget():e.containerWidget&&e.containerWidget.containerWidget instanceof Pai&&"Endnote"===e.containerWidget.containerWidget.footNoteType?n=e.containerWidget.nextWidget||e.containerWidget.nextRenderedWidget:e.containerWidget instanceof jai||e.containerWidget instanceof Iai||e.containerWidget&&e.containerWidget.containerWidget instanceof Pai||(n=e.containerWidget.nextRenderedWidget);n&&0===n.childWidgets.length&&!(n instanceof Uai)&&!je(n=n.nextRenderedWidget););e=n&&n.constructor===e.containerWidget.constructor?n.firstChild:void 0}return e}},enumerable:!0,configurable:!0}),Object.defineProperty(yai.prototype,"previousSplitWidget",{get:function(){var e=this;if(e instanceof Uai)return e.getPreviousSplitWidget();var t=e.previousRenderedWidget;if(e instanceof Sai&&t instanceof Sai&&e.equals(t)&&!(e.containerWidget instanceof Pai&&"Endnote"===e.containerWidget.footNoteType))return t;if(t instanceof Dai&&e.index===t.index&&e.equals(t))return t;if(e instanceof Sai&&e.containerWidget instanceof Pai&&"Endnote"===e.containerWidget.footNoteType&&!je(e.page.previousPage)&&!je(e.page.previousPage.endnoteWidget)){if((t=e.page.previousPage.endnoteWidget.bodyWidgets[e.page.previousPage.endnoteWidget.bodyWidgets.length-1])&&t instanceof Sai&&e.index===t.index&&e.equals(t))return t}else if(e instanceof Dai&&e.bodyWidget&&e.bodyWidget.containerWidget instanceof Pai&&"Endnote"===e.bodyWidget.containerWidget.footNoteType&&!je(e.bodyWidget.page.previousPage)&&!je(e.bodyWidget.page.previousPage.endnoteWidget)&&0<e.bodyWidget.page.previousPage.endnoteWidget.bodyWidgets.length){var i=e.bodyWidget.page.previousPage.endnoteWidget,i=i.bodyWidgets[i.bodyWidgets.length-1];if((t=i.childWidgets[i.childWidgets.length-1])&&t instanceof Dai&&e.index===t.index&&e.equals(t))return t}},enumerable:!0,configurable:!0}),Object.defineProperty(yai.prototype,"nextSplitWidget",{get:function(){var e=this;if(e instanceof Uai)return e.getNextSplitWidget();var t=e.nextRenderedWidget;if(e instanceof Sai&&t instanceof Sai&&e.equals(t)&&!(e.containerWidget instanceof Pai&&"Endnote"===e.containerWidget.footNoteType))return t;if(t instanceof Dai&&e.index===t.index&&e.equals(t))return t;if(e instanceof Sai&&e.containerWidget instanceof Pai&&"Endnote"===e.containerWidget.footNoteType&&!je(e.page.nextPage)&&!je(e.page.nextPage.endnoteWidget)){if((t=e.page.nextPage.endnoteWidget.bodyWidgets[0])&&t instanceof Sai&&e.index===t.index&&e.equals(t))return t}else if(e instanceof Dai&&e.bodyWidget&&e.bodyWidget.containerWidget instanceof Pai&&"Endnote"===e.bodyWidget.containerWidget.footNoteType&&!je(e.bodyWidget.page.nextPage)&&!je(e.bodyWidget.page.nextPage.endnoteWidget)&&0<e.bodyWidget.page.nextPage.endnoteWidget.bodyWidgets.length&&(t=e.bodyWidget.page.nextPage.endnoteWidget.bodyWidgets[0].childWidgets[0])&&t instanceof Dai&&e.index===t.index&&e.equals(t))return t},enumerable:!0,configurable:!0}),yai.prototype.getPreviousSplitWidgets=function(){for(var e=[],t=this.previousSplitWidget;t&&(e.unshift(t),!(t=t.previousSplitWidget)||t!=t.previousSplitWidget););return e},yai.prototype.getSplitWidgets=function(){for(var e=this.getPreviousSplitWidgets(),t=this;t;)e.push(t),t=t.nextSplitWidget;return e},yai.prototype.combineWidget=function(e){var t=this,i=this.getSplitWidgets();if(1<i.length)for(t=i.shift();0<i.length;){var n=i.shift();t.combine(n,e)}return t instanceof _ai&&t.combineRows(e),t},yai.prototype.combine=function(e,t){var i,n;0<e.childWidgets.length&&((i=this.lastChild)instanceof _ai?i.combineWidget(t):(n=e.firstChild,!(e instanceof _ai)&&i instanceof yai&&n instanceof yai&&i.index===n.index&&i.combine(e.childWidgets.shift(),t)),this.addWidgets(e.childWidgets),e.childWidgets=[]),e.destroyInternal(t)},yai.prototype.addWidgets=function(e){for(;0<e.length;){var t,i=e.shift();if(i instanceof Gai&&this instanceof Lai?(i.paragraph=this).height+=i.height:i instanceof yai&&(t=this.lastChild,i.containerWidget=this,i.y=t instanceof yai?t.y+t.height:this.y,this.height+=i.height),i instanceof jai)for(var n=this.childWidgets[this.childWidgets.length-1],o=0;o<n.childWidgets.length;o++){var r=n.childWidgets[o];if(1<r.cellFormat.rowSpan)for(var s=0;s<i.childWidgets.length;s++){var a=i.childWidgets[s];if(a.columnIndex===r.columnIndex&&a.isSplittedCell&&a.cellFormat.rowSpan===r.cellFormat.rowSpan){for(var l=0;l<a.childWidgets.length;l++){var h=a.childWidgets[l];a.childWidgets.splice(h.indexInOwner,1),r.childWidgets.push(h),h.containerWidget=r,l--}a.ownerRow.childWidgets.splice(a.indexInOwner,1),a.containerWidget=void 0,s--}}}this.childWidgets.push(i)}},yai.prototype.removeChild=function(e){-1<e&&e<this.childWidgets.length&&this.childWidgets.splice(e,1)},yai.prototype.destroy=function(){if(this.childWidgets)for(;0<this.childWidgets.length;){var e=this.childWidgets.pop();(e instanceof Gai||e instanceof yai)&&e.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},yai.prototype.componentDestroy=function(){if(this.childWidgets)for(;0<this.childWidgets.length;){var e=this.childWidgets.pop();(e instanceof Gai||e instanceof yai)&&e.componentDestroy()}this.childWidgets=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,this.index=void 0,this.containerWidget=void 0};var fai=yai;function yai(){this.childWidgets=[],this.x=0,this.y=0,this.width=0,this.height=0,this.index=0}pJ(wai,vai=fai),Object.defineProperty(wai.prototype,"sectionFormat",{get:function(){return this instanceof Sai?this.sectionFormatIn:this.page&&!je(this.page.bodyWidgets)?this.page.bodyWidgets[0].sectionFormat:void 0},set:function(e){this instanceof Sai&&(this.sectionFormatIn=e)},enumerable:!0,configurable:!0}),Object.defineProperty(wai.prototype,"sectionIndex",{get:function(){var e=0;return this instanceof Sai?e=this.index:this.page&&(e=this.page.bodyWidgets[0].index),e},enumerable:!0,configurable:!0}),wai.prototype.getHierarchicalIndex=function(e){return e=this instanceof Sai?this.index+";"+e:this instanceof Pai?"Footnote"===this.footNoteType?"FN;"+e:"EN;"+e:-1!==this.headerFooterType.indexOf("Header")?"H;"+e:"F;"+e,je(this.page)?e:this.page.documentHelper.pages.indexOf(this.page)+";"+e},wai.prototype.componentDestroy=function(){this.sectionFormatIn&&this.sectionFormatIn.destroy(),this.sectionFormatIn=void 0,this.floatingElements=[],this.removedHeaderFooters=[],this.footNoteReference=void 0,this.page=void 0,vai.prototype.componentDestroy.call(this)};var vai,bai=wai;function wai(){var e=null!==vai&&vai.apply(this,arguments)||this;return e.floatingElements=[],e.footNoteReference=void 0,e.sectionFormatIn=void 0,e.columnIndex=0,e.isWord2010NextColumn=!1,e}pJ(Aai,Cai=bai),Aai.prototype.equals=function(e){return e instanceof Aai&&e.sectionFormat===this.sectionFormat},Aai.prototype.getHierarchicalIndex=function(e){return e=this.containerWidget instanceof Pai?(e=this.containerWidget.bodyWidgets.indexOf(this)+";"+e,"Footnote"===this.containerWidget.footNoteType?"FN;"+e:"EN;"+e):this.page&&-1!==this.page.bodyWidgets.indexOf(this)?this.page.bodyWidgets.indexOf(this)+";"+e:this.index+";"+e,je(this.page)?e:this.page.documentHelper.pages.indexOf(this.page)+";"+e},Aai.prototype.getTableCellWidget=function(e){for(var t=0;t<this.childWidgets.length;t++)if(this.childWidgets[t]instanceof _ai){var i=this.childWidgets[t],n=0;if(i.wrapTextAround&&(n=i.getTableCellWidth()),!i.wrapTextAround&&i.y<=e.y&&i.y+i.height>=e.y)return i.getTableCellWidget(e);if(i.wrapTextAround&&i.x<=e.x&&i.x+n>=e.x&&i.y<=e.y&&i.y+i.height>=e.y)return i.getTableCellWidget(e)}var o=void 0;return o=0<this.childWidgets.length?(this.childWidgets[0].y<=e.y?this.childWidgets[this.childWidgets.length-1]:this.childWidgets[0]).getTableCellWidget(e):o},Aai.prototype.destroyInternal=function(e){var t;this.height;if(!je(this.childWidgets)){for(var i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i];if(0 instanceof Lai,n.destroyInternal(e),je(this.childWidgets))break;i--}this.childWidgets=void 0}je(this.page)||(t=this.indexInOwner,-1<this.indexInOwner&&(this.page.bodyWidgets.splice(t,1),0===this.page.bodyWidgets.length?this.page.destroy():this instanceof Iai&&this.page.headerWidget===this?this.page.headerWidget=void 0:this instanceof Iai&&this.page.footerWidget===this&&(this.page.footerWidget=void 0),this.page=void 0)),this.destroy()},Aai.prototype.destroy=function(){this.sectionFormatIn=void 0,this.page&&this.page.headerWidgetIn&&(this.page.headerWidgetIn.page=void 0),this.page&&this.page.footerWidgetIn&&(this.page.footerWidgetIn.page=void 0),this.page=void 0,Cai.prototype.destroy.call(this)},Aai.prototype.componentDestroy=function(){Cai.prototype.componentDestroy.call(this)};var Cai,Sai=Aai;function Aai(){return Cai.call(this)||this}pJ(Tai,xai=bai),Tai.prototype.getTableCellWidget=function(e){for(var t=0;t<this.childWidgets.length;t++)if(this.childWidgets[t]instanceof _ai){var i=this.childWidgets[t],n=0;if(i.wrapTextAround&&(n=i.getTableCellWidth()),!i.wrapTextAround&&i.y<=e.y&&i.y+i.height>=e.y)return i.getTableCellWidget(e);if(i.wrapTextAround&&i.x<=e.x&&i.x+n>=e.x&&i.y<=e.y&&i.y+i.height>=e.y)return i.getTableCellWidget(e)}var o=void 0;return o=0<this.childWidgets.length?(this.childWidgets[0].y<=e.y?this.childWidgets[this.childWidgets.length-1]:this.childWidgets[0]).getTableCellWidget(e):o},Tai.prototype.equals=function(e){return e instanceof Tai&&e.containerWidget===this.containerWidget},Tai.prototype.clone=function(){for(var e=new Tai(this.headerFooterType),t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t].clone();e.childWidgets.push(i),i.index=t,i.containerWidget=e}return e.isEmpty=this.isEmpty,e.x=this.x,e.y=this.y,e.height=0,e.width=0,e},Tai.prototype.destroyInternal=function(e){this.page=void 0,xai.prototype.destroy.call(this)},Tai.prototype.componentDestroy=function(){xai.prototype.componentDestroy.call(this),this.parentHeaderFooter=void 0};var xai,Iai=Tai;function Tai(e){var t=xai.call(this)||this;return t.isEmpty=!1,t.headerFooterType=e,t}pJ(Mai,Eai=fai),Object.defineProperty(Mai.prototype,"bodyWidget",{get:function(){for(var e=this;e.containerWidget;){if(e.containerWidget instanceof Zli){var t=e.containerWidget.containerShape.line.paragraph;if(t)return t.bodyWidget}else if(e.containerWidget instanceof bai)return e.containerWidget;e=e.containerWidget}},enumerable:!0,configurable:!0}),Object.defineProperty(Mai.prototype,"leftIndent",{get:function(){return this instanceof Lai&&this.paragraphFormat instanceof bri?this.paragraphFormat.leftIndent:this instanceof _ai&&this.tableFormat instanceof Jri?this.tableFormat.leftIndent:0},enumerable:!0,configurable:!0}),Object.defineProperty(Mai.prototype,"rightIndent",{get:function(){return this instanceof Lai&&this.paragraphFormat instanceof bri?this.paragraphFormat.rightIndent:0},enumerable:!0,configurable:!0}),Object.defineProperty(Mai.prototype,"isInsideTable",{get:function(){return this.containerWidget instanceof Uai},enumerable:!0,configurable:!0}),Object.defineProperty(Mai.prototype,"isInHeaderFooter",{get:function(){return this.bodyWidget instanceof Iai},enumerable:!0,configurable:!0}),Object.defineProperty(Mai.prototype,"associatedCell",{get:function(){if(this.containerWidget instanceof Uai)return this.containerWidget},enumerable:!0,configurable:!0}),Mai.prototype.isPageBreak=function(){var e=!1;return e=this instanceof Lai&&null!=this&&1===this.childWidgets.length&&1===this.firstChild.children.length?this.firstChild.children[0].isPageBreak:e},Mai.prototype.isColumnBreak=function(){var e=!1;return e=this instanceof Lai&&null!=this&&1===this.childWidgets.length&&1===this.firstChild.children.length?this.firstChild.children[0].isColumnBreak:e},Mai.prototype.getHierarchicalIndex=function(e){if(e=this.containerWidget.childWidgets.indexOf(this)+";"+e,!je(this.containerWidget)){if(this.containerWidget instanceof Zli)return this.containerWidget.getHierarchicalIndex(e);if(this.containerWidget instanceof Mai)return this.containerWidget.getHierarchicalIndex(e);this.containerWidget instanceof bai&&(e=this.containerWidget.getHierarchicalIndex(e))}return e},Mai.prototype.getIndex=function(){return this instanceof Lai||this instanceof _ai?this.containerWidget.childWidgets.indexOf(this):this instanceof jai?this.ownerTable.childWidgets.indexOf(this):this instanceof Uai?this.ownerRow.childWidgets.indexOf(this):0},Mai.prototype.getContainerWidth=function(){if(this.isInsideTable){if(this instanceof _ai&&"Auto"===this.tableFormat.preferredWidthType&&this.associatedCell.ownerTable.isGridUpdated){for(var e=0,t=this.associatedCell.cellFormat.columnSpan,i=this.associatedCell.columnIndex,n=0;n<t;n++)e+=this.associatedCell.ownerTable.tableHolder.columns[i].preferredWidth,i++;if(0<e)return e}return this.associatedCell.getCellWidth(this)}var o,r,s,a;return this.containerWidget instanceof Zli?(o=this.containerWidget.containerShape,Y.convertPixelToPoint(o.width)-Y.convertPixelToPoint(o.textFrame.marginLeft)-Y.convertPixelToPoint(o.textFrame.marginRight)):(r=(o=this.bodyWidget).sectionFormat,s=0,!je(o.page)&&!je(o.page.documentHelper)&&"Word2013"!==o.page.documentHelper.compatibilityMode&&!this.isInsideTable&&this instanceof _ai&&(s=(a=this.firstChild).firstChild.leftMargin+a.lastChild.rightMargin),o instanceof Sai&&1<r.columns.length?(a=o.columnIndex,Y.convertPixelToPoint(r.columns[a].width)):r.pageWidth-(r.leftMargin+r.rightMargin)+s)},Object.defineProperty(Mai.prototype,"bidi",{get:function(){return this instanceof Lai&&this.paragraphFormat instanceof bri?this.paragraphFormat.bidi:this instanceof _ai&&this.tableFormat instanceof Jri&&this.tableFormat.bidi},enumerable:!0,configurable:!0}),Mai.prototype.componentDestroy=function(){Eai.prototype.componentDestroy.call(this),this.contentControlProperties=void 0};var Eai,Dai=Mai;function Mai(){var e=null!==Eai&&Eai.apply(this,arguments)||this;return e.isLayouted=!1,e.isFieldCodeBlock=!1,e.locked=!1,e.lockedBy="",e}pJ(Bai,kai=bai),Bai.prototype.getMinimumAndMaximumWordWidth=function(e,t){throw new Error("Method not implemented.")},Bai.prototype.getTableCellWidget=function(e){},Bai.prototype.equals=function(e){return e instanceof Bai&&e.containerWidget===this.containerWidget},Bai.prototype.clone=function(){for(var e=new Bai,t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t].clone();e.childWidgets.push(i),i.index=t,i.containerWidget=e}return e.block=this.block,e},Bai.prototype.destroyInternal=function(e){this.block=void 0,kai.prototype.destroy.call(this)},Bai.prototype.componentDestroy=function(){if(this.bodyWidgets&&0<this.bodyWidgets.length){for(var e=0;e<this.bodyWidgets.length;e++)this.bodyWidgets[e].componentDestroy();this.bodyWidgets=[]}this.bodyWidgets=void 0,this.block=void 0,kai.prototype.componentDestroy.call(this)};var kai,Pai=Bai;function Bai(){var e=null!==kai&&kai.apply(this,arguments)||this;return e.bodyWidgets=[],e}pJ(Rai,Fai=Dai),Object.defineProperty(Rai.prototype,"isEndsWithPageBreak",{get:function(){return 0<this.childWidgets.length&&this.lastChild.isEndsWithPageBreak},enumerable:!0,configurable:!0}),Object.defineProperty(Rai.prototype,"isEndsWithColumnBreak",{get:function(){return 0<this.childWidgets.length&&this.lastChild.isEndsWithColumnBreak},enumerable:!0,configurable:!0}),Rai.prototype.equals=function(e){return e instanceof Rai&&e.paragraphFormat===this.paragraphFormat},Rai.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++){var o=i.children[n];if(!(o instanceof qli)||o instanceof qli&&"Inline"===o.textWrappingStyle)return!1;e=!0}return!!e},Rai.prototype.isEmptyInternal=function(e){if(!je(this.childWidgets)&&0!==this.childWidgets.length)for(var t=0;t<this.childWidgets.length;t++)for(var i=this.childWidgets[t],n=0;n<i.children.length;n++){var o=i.children[n];if(0!==o.length&&(o instanceof pli||o instanceof rhi||o instanceof Dli||o instanceof phi||o instanceof ghi||o instanceof yhi||o instanceof Xli||o instanceof Pli||o instanceof Khi&&!e||o instanceof Zai&&Y.isLinkedFieldCharacter(o)))return!1}return!0},Rai.prototype.isEmpty=function(){return this.isEmptyInternal(!1)},Rai.prototype.getInline=function(e,t){for(var i=void 0,n=0,o=!1,r=this.getSplitWidgets(),s=0;s<r.length;s++)for(var a=r[s],l=0;l<a.childWidgets.length;l++)for(var h=a.childWidgets[l],d=0;d<h.children.length;d++)if(!((i=h.children[d])instanceof lhi)){if((o=!o&&(i instanceof pli||i instanceof rhi||i instanceof Xli||i instanceof Dli||i instanceof Zai&&Y.isLinkedFieldCharacter(i))||i instanceof yhi||i instanceof Pli||i instanceof Khi?!0:o)&&e<=n+i.length)return{element:i,index:t=e-n};n+=i.length}return{element:i,index:t=n<e?je(i)?e:i.length:t}},Rai.prototype.getLength=function(){var e=0;if(!je(this.childWidgets))for(var t=0;t<this.childWidgets.length;t++)for(var i=this.childWidgets[t],n=0;n<i.children.length;n++){var o=i.children[n];o instanceof lhi||(e+=o.length)}return e},Rai.prototype.getTotalLength=function(){for(var e=0,t=this.getSplitWidgets(),i=0;i<t.length;i++)e+=t[i].getLength();return e},Rai.prototype.getTableCellWidget=function(e){},Rai.prototype.getMinimumAndMaximumWordWidth=function(e,t){if(e=Y.convertPointToPixel(e),t=Y.convertPointToPixel(t),0<this.childWidgets.length){for(var i,n=this.childWidgets[0].children[0],o="",r=new uJt,s=[];;){if(n instanceof pli&&""!==n.text?(r.add(n,o.length),o+=n.text):n instanceof Zai&&0===n.fieldType?je((i=n).fieldEnd)||(n=je(i.fieldSeparator)?i.fieldEnd:i.fieldSeparator):n instanceof rhi&&s.push(n.width),je(n)||je(n.nextNode))break;n=n.nextNode}for(var a,l=void 0,l=this.isInsideTable&&this.containerWidget instanceof Uai&&this.containerWidget.ownerTable&&this.containerWidget.ownerTable.bodyWidget&&this.containerWidget.ownerTable.bodyWidget.page&&this.containerWidget.ownerTable.bodyWidget.page.documentHelper&&this.containerWidget.ownerTable.bodyWidget.page.documentHelper.layout&&this.bodyWidget.page.documentHelper.layout.isAllColumnHasAutoWidthType?new RegExp("[^\\s\\-\\u4E00-\\u9FFF]+","g"):new RegExp("\\b\\w+\\b","g"),h=[];!je(a=l.exec(o));)h.push(a);for(var d=0;d<h.length;d++){for(var p,c=h[d],u=0,o="",g="",m=c.index,f=c.index,y=0;y<r.keys.length;y++){var v=r.keys[y],b=r.get(v),w=v.length;if(f<=b+w&&(p=f-b,c.index+c[0].length<=b+w?m=c.index+c[0].length-(b+p):f+=m=w-p,g+=o=v.text.substring(p,p+m)),""!==o&&(u+=this.bodyWidget.page.documentHelper.textHelper.getWidth(o,v.characterFormat,v.scriptType)),g===c[0])break}0!==u&&(0===e||e<u)&&(e=u)}var C=0,C=(0<s.length&&(C=Math.max.apply(null,s)),(0===e||e<C)&&(e=C),this.measureParagraph());(0===t||t<C)&&(t=C)}var S,C=0;return this.isEmpty()||0!=this.floatingElements.length||je(this.paragraphFormat)||!(0<this.paragraphFormat.leftIndent)||je(this.associatedCell)||je(this.associatedCell.cellFormat)||"Point"!==this.associatedCell.cellFormat.preferredWidthType||(S=this.paragraphFormat.leftIndent+this.paragraphFormat.firstLineIndent)+e>this.associatedCell.cellFormat.preferredWidth&&(C=S),{maximumWordWidth:Y.convertPixelToPoint(t),minimumWordWidth:Y.convertPixelToPoint(e)+C}},Rai.prototype.measureParagraph=function(){for(var e,t=0,i=this.childWidgets[0].children[0];i instanceof pli&&""!==i.text?i.isWidthUpdated&&" "!==i.text[i.text.length-1]?t+=i.trimEndWidth:t+=this.bodyWidget.page.documentHelper.textHelper.getWidth(i.text,i.characterFormat,i.scriptType):i instanceof Zai&&0===i.fieldType?null!=(e=i).fieldEnd&&(i=je(e.fieldSeparator)?e.fieldEnd:e.fieldSeparator):i instanceof rhi&&(t+=i.width),!je(i)&&!je(i.nextNode);)i=i.nextNode;return 0<this.leftIndent&&(t+=this.leftIndent),0<this.rightIndent&&(t+=this.rightIndent),t},Rai.prototype.isArabicChar=function(e){return e>=String.fromCharCode(1536)&&e<=String.fromCharCode(1791)||e>=String.fromCharCode(1872)&&e<=String.fromCharCode(1919)||e>=String.fromCharCode(2208)&&e<=String.fromCharCode(2303)||e>=String.fromCharCode(64336)&&e<=String.fromCharCode(65023)||e>=String.fromCharCode(65136)&&e<=String.fromCharCode(65279)},Rai.prototype.isHebrewChar=function(e){return e>=String.fromCharCode(1424)&&e<=String.fromCharCode(1535)||e>=String.fromCharCode(64285)&&e<=String.fromCharCode(64335)},Rai.prototype.isHindiChar=function(e){return e>=String.fromCharCode(2304)&&e<=String.fromCharCode(2431)||e>=String.fromCharCode(43232)&&e<=String.fromCharCode(43263)||e>=String.fromCharCode(7376)&&e<=String.fromCharCode(7423)},Rai.prototype.isKoreanChar=function(e){return e>=String.fromCharCode(44032)&&e<=String.fromCharCode(55203)||e>=String.fromCharCode(4352)&&e<=String.fromCharCode(4607)||e>=String.fromCharCode(12592)&&e<=String.fromCharCode(12687)||e>=String.fromCharCode(43360)&&e<=String.fromCharCode(43391)||e>=String.fromCharCode(55216)&&e<=String.fromCharCode(55295)||e>=String.fromCharCode(44032)&&e<=String.fromCharCode(55215)},Rai.prototype.isJapanese=function(e){return e>=String.fromCharCode(12448)&&e<=String.fromCharCode(12543)||e>=String.fromCharCode(12352)&&e<=String.fromCharCode(12447)},Rai.prototype.isThaiCharacter=function(e){return e>=String.fromCharCode(3584)&&e<=String.fromCharCode(3711)},Rai.prototype.isChineseChar=function(e){return e>=String.fromCharCode(19968)&&e<=String.fromCharCode(40959)||e>=String.fromCharCode(13312)&&e<=String.fromCharCode(19903)||e>=String.fromCharCode(55360)&&e<=String.fromCharCode(55401)||e>=String.fromCharCode(56320)&&e<=String.fromCharCode(57055)||e>=String.fromCharCode(43360)&&e<=String.fromCharCode(43391)||e>=String.fromCharCode(65280)&&e<=String.fromCharCode(65519)||e>=String.fromCharCode(12288)&&e<=String.fromCharCode(12351)||e>=String.fromCharCode(63744)&&e<=String.fromCharCode(64255)},Rai.prototype.isSpecialCharacters=function(e){return e>=String.fromCharCode(8192)&&e<=String.fromCharCode(10175)},Rai.prototype.getFontScriptType=function(e,t){return this.isHindiChar(e)?lJt.Hindi:this.isKoreanChar(e)?lJt.Korean:this.isJapanese(e)?lJt.Japanese:this.isChineseChar(e)?lJt.Chinese:this.isArabicChar(e)?lJt.Arabic:this.isHebrewChar(e)?lJt.Hebrew:this.isThaiCharacter(e)?lJt.Thai:this.isSpecialCharacters(e)&&t?lJt.SpecialCharacter:lJt.English},Rai.prototype.splitTextByFontScriptType=function(e,t,i){var n=[];if(!je(e)&&(je(e)||""!==e)){for(var o="",r=lJt.English,s=lJt.English,a=/[\uD800-\uDFFF]/,l=0;l<e.length;l++)e[l]==String.fromCharCode(32)||a.test(e[l])||(s=this.getFontScriptType(e[l],i)),""!=o&&s!==r&&(n.push(o),t.push(r),o=""),o+=e[l],r=s;""!=o&&(n.push(o),t.push(s),o="")}return n},Rai.prototype.splitTextRangeByScriptType=function(e){var t=!1,i=1;if(0<this.childWidgets.length){for(var n=this.childWidgets[e],o=e+1;o<this.childWidgets.length;o++){for(var r=this.childWidgets[o],s=0;s<r.children.length;s++){var a=r.children[s];n.children.push(a),a.line=n}this.childWidgets.splice(o,1),o--}for(o=0;o<n.children.length;o+=i){var l=n.children[o],i=1,h=void 0;if(l instanceof pli&&(h=l),l instanceof Zai&&0==l.fieldType?t=!0:l instanceof Zai&&2===l.fieldType&&(t=!1),null!=h&&!t){var l="EastAsia"===h.characterFormat.fontHintType&&h.characterFormat.hasValue("fontFamilyFarEast"),d=[],p=this.splitTextByFontScriptType(h.text,d,l);if(1<p.length)for(var c=0;c<p.length;c++){var u,g=p[c];0<c?((u=h.clone()).text=g,u.scriptType=d[c],n.children.splice(o+c,0,u),u.line=n,i++,0<h.revisions.length&&this.updateTextElementInRevisionRange(h,u)):(h.text=g,h.scriptType=d[c])}else 0<p.length&&(h.scriptType=d[0]);d.length=0}}}},Rai.prototype.splitLtrAndRtlText=function(e){var t={value:null},i=1,n={value:null},o=[],r=!1,s=this.bodyWidget.page.documentHelper.textHelper;if(0<this.childWidgets.length){for(var a=this.childWidgets[e],l=0;l<a.children.length;l+=i){var h=a.children[l],i=1,d=void 0;if(h instanceof pli&&(d=h),h instanceof Zai&&0==h.fieldType?r=!0:h instanceof Zai&&2===h.fieldType&&(r=!1),null!=d&&!r){var p=d.text,c=d.characterFormat.bidi,u=!1,g=o.length,m=(c&&(u=s.isRightToLeftLanguage(h.characterFormat.localeIdBidi)),s.splitTextByConsecutiveLtrAndRtl(p,c,u,o,t,n));if(1<m.length)for(var f=0;f<m.length;f++){var y,p=m[f];0<f?((y=d.clone()).text=p,y.characterRange=o[f+g],a.children.splice(l+f,0,y),y.line=a,i++,0<d.revisions.length&&this.updateTextElementInRevisionRange(d,y)):(d.text=p,d.characterRange=o[g])}else 0<m.length&&(d.characterRange=o[g])}}o.length=0}},Rai.prototype.updateTextElementInRevisionRange=function(e,t){for(var i=0;i<e.revisions.length;i++){var n=e.revisions[i],o=n.range.indexOf(e);n.range.splice(o+1,0,t),t.revisions.push(n),t.removedIds=[]}},Rai.prototype.combineconsecutiveRTL=function(e){for(var t=!1,i=this.bodyWidget.page.documentHelper.textHelper,n=e;n<this.childWidgets.length;n++)for(var o=this.childWidgets[n],r=0;r<=o.children.length-2;r++){var s,a=o.children[r];a instanceof Zai&&0===a.fieldType?t=!0:a instanceof Zai&&2===a.fieldType&&(t=!1),!t&&a instanceof pli&&o.children[r+1]instanceof pli&&(s=o.children[r+1],((a=a).characterFormat.complexScript&&a.scriptType==s.scriptType||a.characterFormat.bidi&&a.scriptType!==lJt.Hebrew&&a.characterRange==aJt.RightToLeft&&s.characterRange==aJt.RightToLeft)&&0<a.text.length&&0<s.text.length&&!i.isWordSplitChar(a.text[a.text.length-1])&&!i.isWordSplitChar(s.text[0])&&a.characterFormat.isEqualFormat(s.characterFormat)&&this.compareRevisions(a.revisions,s.revisions)||a.characterRange==aJt.RightToLeft&&s.characterRange==aJt.RightToLeft&&0<a.text.length&&0<s.text.length&&i.isWordSplitChar(a.text[a.text.length-1])&&i.isWordSplitChar(s.text[0])&&a.characterFormat.isEqualFormat(s.characterFormat)&&this.compareRevisions(a.revisions,s.revisions))&&(a.text=a.text+s.text,o.children.splice(r+1,1),r--)}},Rai.prototype.compareRevisions=function(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},Rai.prototype.clone=function(){var e=new Rai;e.paragraphFormat.copyFormat(this.paragraphFormat),e.characterFormat.copyFormat(this.characterFormat);for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t].clone();e.childWidgets.push(i);for(var n=0;n<i.children.length;n++){var o=i.children[n];(o instanceof rhi&&"Inline"!==o.textWrappingStyle||o instanceof Xli)&&e.floatingElements.push(o)}i.paragraph=e}return e.x=this.x,e.y=this.y,e.height=this.height,e.width=this.width,e.absoluteXPosition=je(this.absoluteXPosition)?void 0:{width:this.absoluteXPosition.width,x:this.absoluteXPosition.x},this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e},Rai.prototype.destroyInternal=function(e){var t=this.height;if(!je(this.childWidgets)){for(var i=0;i<this.childWidgets.length;i++){if(this.childWidgets[i].destroy(),1===this.childWidgets.length&&je(this.childWidgets[0].children)&&(this.childWidgets=void 0),je(this.childWidgets))break;i--}this.childWidgets=void 0}je(this.containerWidget)||je(this.containerWidget.childWidgets)||-1===this.containerWidget.childWidgets.indexOf(this)||(this.containerWidget.childWidgets.splice(this.containerWidget.childWidgets.indexOf(this),1),this.containerWidget.height-=t,this.containerWidget=void 0),this.hasOwnProperty("absoluteXPosition")&&delete this.absoluteXPosition,this.destroy()},Rai.prototype.destroy=function(){this.paragraphFormat=void 0,this.characterFormat=void 0,Fai.prototype.destroy.call(this)},Rai.prototype.componentDestroy=function(){this.paragraphFormat&&this.paragraphFormat.destroy(),this.paragraphFormat=void 0,this.characterFormat&&this.characterFormat.destroy(),this.characterFormat=void 0,Fai.prototype.componentDestroy.call(this)};var Fai,Lai=Rai;function Rai(){var e=Fai.call(this)||this;return e.isSectionBreak=!1,e.isChangeDetected=!1,e.textWrapWidth=!1,e.clientX=void 0,e.floatingElements=[],e.paragraphFormat=new bri(e),e.characterFormat=new Eri(e),e}Nai.prototype.clone=function(){var e=new Nai;return e.allowOverlap=this.allowOverlap,e.distanceTop=this.distanceTop,e.distanceRight=this.distanceRight,e.distanceLeft=this.distanceLeft,e.distanceBottom=this.distanceBottom,e.verticalAlignment=this.verticalAlignment,e.verticalOrigin=this.verticalOrigin,e.verticalPosition=this.verticalPosition,e.horizontalAlignment=this.horizontalAlignment,e.horizontalOrigin=this.horizontalOrigin,e.horizontalPosition=this.horizontalPosition,e};var Oai=Nai;function Nai(){}pJ(Hai,Vai=Dai),Object.defineProperty(Hai.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(Hai.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(Hai.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(Hai.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}),Hai.prototype.equals=function(e){return e instanceof Hai&&e.tableFormat===this.tableFormat},Hai.prototype.combineRows=function(e){for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t];if(!je(i.firstChild)&&0!==i.firstChild.index&&1===i.getSplitWidgets().length)for(var n=0;n<i.childWidgets.length;n++)i.childWidgets[n].index--;0===i.childWidgets.length?(i.destroy(),t--):i.combineCells(e)}},Hai.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)},Hai.prototype.getOwnerWidth=function(e){var t=this.getContainerWidth();return 0<=(t="Auto"===this.tableFormat.preferredWidthType?t-this.leftIndent-this.rightIndent:t)?t:0},Hai.prototype.getTableWidth=function(){for(var e=0,t=0;t<this.childWidgets.length;t++){for(var i=0,n=this.childWidgets[t],o=0;o<n.childWidgets.length;o++)i+=n.childWidgets[o].cellFormat.cellWidth;e<i&&(e=i)}return e},Hai.prototype.getTableCellWidth=function(){for(var e=0,t=0;t<this.childWidgets.length;t++){for(var i=0,n=this.childWidgets[t],o=0;o<n.childWidgets.length;o++){var r=n.childWidgets[o],s=r.width;0===s&&((s=r.cellFormat.cellWidth)>r.cellFormat.preferredWidth&&0!==r.cellFormat.preferredWidth&&"Percent"!==r.cellFormat.preferredWidthType&&(s=r.cellFormat.preferredWidth),s=Y.convertPointToPixel(s-(r.margin.left+r.margin.right))),i+=s+r.margin.left+r.margin.right}e<i&&(e=i)}return e},Hai.prototype.getTableClientWidth=function(e){return"Point"===this.tableFormat.preferredWidthType&&0<this.tableFormat.preferredWidth?e=this.tableFormat.preferredWidth:"Percent"===this.tableFormat.preferredWidthType&&0<this.tableFormat.preferredWidth&&(e=e*this.tableFormat.preferredWidth/100),e},Hai.prototype.getCellWidth=function(e,t,i,n){var o=e;return"Percent"===t?o=e*i/100:"Point"===t?o=e:je(n)||(o=this.getMinimumPreferredWidth(n)),o},Hai.prototype.getMinimumPreferredWidth=function(e){return 0!==e.cellFormat.preferredWidth||0===e.cellFormat.cellWidth||e.ownerTable&&e.ownerTable.bodyWidget&&e.ownerTable.bodyWidget.page&&e.ownerTable.bodyWidget.page.documentHelper&&e.ownerTable.bodyWidget.page.documentHelper.layout&&this.bodyWidget.page.documentHelper.layout.isAllColumnHasAutoWidthType?e.getMinimumPreferredWidth():e.cellFormat.cellWidth},Hai.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 o=0;o<n.childWidgets.length;o++)n.childWidgets[o].cellFormat.cellWidth*=t,n.childWidgets[o].cellFormat.preferredWidth*=t}},Hai.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},Hai.prototype.calculateGrid=function(e){var t=[],i=[],n=[],o=this.getOwnerWidth(!0),r=this.getTableClientWidth(o);this.tableCellInfo=new uJt;for(var s=0;s<this.childWidgets.length;s++){var a=this.childWidgets[s],l=new uJt,h=a.rowFormat,d=a.rowFormat.gridBefore,p=0,c=(t.indexOf(p)<0&&(t.push(p),i.push(p)),p+=this.getCellWidth(h.gridBeforeWidth,h.gridBeforeWidthType,r,null),parseFloat(p.toFixed(2)));t.indexOf(c)<0&&(t.push(c),i.push(p));for(var u=0;u<a.childWidgets.length;u++){for(var g,m,f=a.childWidgets[u],y=0;y<n.length;y++)n[y].columnIndex<d||(g=n[y].cellFormat.rowSpan,m=!0,n[y].columnIndex>d?(m=!1,u===a.childWidgets.length-1&&0<a.rowFormat.gridAfter&&(this.updateValidPreferredWidth(n[y]),p+=this.getCellWidth(n[y].cellFormat.preferredWidth,n[y].cellFormat.preferredWidthType,r,null))):(this.updateValidPreferredWidth(n[y]),p+=this.getCellWidth(n[y].cellFormat.preferredWidth,n[y].cellFormat.preferredWidthType,r,null),d=n[y].columnIndex+n[y].cellFormat.columnSpan),(m=m||u!==a.childWidgets.length-1?m:!0)&&s-n[y].ownerRow.rowIndex==g-1&&(n.splice(y,1),y--));if(1<f.cellFormat.rowSpan)if(0===n.length||n[n.length-1].columnIndex<=d)n.push(f);else for(var v=n.length;0<v;v--)n[v-1].columnIndex>d&&n.splice(v-1,0,f);l.containsKey(f.cellIndex)||l.add(f.cellIndex,parseFloat((p-c).toFixed(2))),d+=f.cellFormat.columnSpan,this.updateValidPreferredWidth(f),p+=this.getCellWidth(f.cellFormat.preferredWidth,f.cellFormat.preferredWidthType,r,null);var b=parseFloat(p.toFixed(2));t.indexOf(b)<0&&(t.push(b),i.push(p)),u===a.childWidgets.length-1&&0<h.gridAfter&&(p+=this.getCellWidth(h.gridAfterWidth,"Point",r,null),t.indexOf(parseFloat(p.toFixed(2)))<0&&(t.push(parseFloat(p.toFixed(2))),i.push(p)),d+=h.gridAfter),this.tableCellInfo.containsKey(a.rowIndex)||this.tableCellInfo.add(a.rowIndex,l)}}t.sort(function(e,t){return e-t}),i.sort(function(e,t){return e-t}),0<this.tableHolder.columns.length&&(t.length-1!==this.tableHolder.columns.length||e)&&this.updateColumnSpans(t,r,i),this.tableCellInfo.clear(),this.tableCellInfo=void 0},Hai.prototype.updateValidPreferredWidth=function(e){var t;"Point"===e.cellFormat.preferredWidthType&&e.cellFormat.preferredWidth!==e.cellFormat.cellWidth&&e.ownerColumn&&e.cellFormat.preferredWidth<e.ownerColumn.minimumWidth&&(0===e.indexInOwner?e.cellFormat.preferredWidth=e.ownerColumn.endOffset:(t=e.ownerRow.childWidgets[e.indexInOwner-1]).ownerColumn&&(e.cellFormat.preferredWidth=e.ownerColumn.endOffset-t.ownerColumn.endOffset))},Hai.prototype.updateColumnSpans=function(e,t,i){for(var n=0;n<this.childWidgets.length;n++){var o=this.childWidgets[n];0<=o.rowFormat.gridBeforeWidth&&(o.rowFormat.gridBefore=o.getGridCount(e,void 0,-1,t,i));for(var r=0;r<o.childWidgets.length;r++){var s=o.childWidgets[r],a=o.getGridCount(e,s,s.getIndex(),t,i);0<a&&s.cellFormat.columnSpan!==a&&(s.cellFormat.columnSpan=a)}0<=o.rowFormat.gridAfterWidth&&(o.rowFormat.gridAfter=o.getGridCount(e,void 0,o.childWidgets.length,t,i))}},Hai.prototype.getMinimumAndMaximumWordWidth=function(e,t){this.checkTableColumns();var i=this.tableHolder.isAllColumnHasPointWidthType(),n=i?this.tableHolder.getTotalWidth(0):this.tableHolder.getTotalWidth(1);return{minimumWordWidth:e=e<n?n:e,maximumWordWidth:t=t<(n=i?n:this.tableHolder.getTotalWidth(2))?n:t}},Hai.prototype.checkTableColumns=function(){this.isGridUpdated||(!this.isAutoFit()&&0!==this.tableHolder.columns.length||this.buildTableColumns(),this.isGridUpdated=!1)},Hai.prototype.isAutoFit=function(){var e=this.bodyWidget;return!je(e)&&!je(e.page)&&e.page.documentHelper.layout.getParentTable(this).tableFormat.allowAutoFit},Hai.prototype.buildTableColumns=function(){if(!this.isGridUpdated){this.tableHolder.resetColumns();var e=0,t=[],i="Auto"===this.tableFormat.preferredWidthType||"Point"===this.tableFormat.preferredWidthType&&0===this.tableFormat.preferredWidth,n=this.tableFormat.allowAutoFit,e=!(!je(this.bodyWidget.page)&&this.bodyWidget.page.viewer instanceof sai&&n)||this.isInsideTable||this.containerWidget instanceof Zli?this.getOwnerWidth(!0):Y.convertPixelToPoint(this.bodyWidget.page.viewer.clientArea.width-3*this.bodyWidget.page.viewer.padding.right);!je(this.bodyWidget.page)&&this.bodyWidget.page.documentHelper&&this.bodyWidget.page.documentHelper.layout&&(this.bodyWidget.page.documentHelper.layout.isAllColumnHasAutoWidthType=this.bodyWidget.page.documentHelper.layout.isAuto(this)),e=this.tableFormat.preferredWidth>e?this.tableFormat.preferredWidth:e;for(var o=i&&0===this.tableFormat.preferredWidth&&!n,r=this.getTableClientWidth(e),s=this.getContainerWidth(),a=(o&&!this.isDefaultFormatUpdated&&n&&this.splitWidthToTableCells(r,o),!1),l=0;l<this.childWidgets.length;l++){var h=this.childWidgets[l],d=h.rowFormat,p=0,c=0,u=new ddi,g=0;0<d.gridBefore&&(0!==h.rowFormat.beforeWidth||0!==h.rowFormat.gridBeforeWidth)&&(!this.bodyWidget.page.documentHelper.alignTablesRowByRow||"Left"===h.ownerTable.tableFormat.tableAlignment||"Word2003"===this.bodyWidget.page.documentHelper.compatibilityMode&&0<h.ownerTable.firstChild.rowFormat.gridAfter)&&(c=this.getCellWidth(d.gridBeforeWidth,h.rowFormat.gridAfterWidthType,r,null),u.minimumWidth=c,this.tableHolder.addColumns(p,p=d.gridBefore,c,u,g=c,"Point"));for(var m=0;m<h.childWidgets.length;m++){var f=h.childWidgets[m];(1<f.cellFormat.rowSpan||1<f.cellFormat.columnSpan)&&(a=!0),0===t.length&&(f.columnIndex=p);for(var y=0;y<t.length;y++){var v,b,w=t[y];w.columnIndex<p?f.columnIndex=p:(b=1,v=!0,b=w.cellFormat.rowSpan,w.columnIndex>p?(f.columnIndex=p,v=!1):(u=w.getCellSizeInfo(n),c=this.getCellWidth(w.cellFormat.preferredWidth,w.cellFormat.preferredWidthType,r,w),0<this.tableHolder.columns.length?this.tableHolder.addColumns(p,p=this.tableHolder.columns.indexOf(w.ownerColumn)+w.cellFormat.columnSpan,c,u,g+=c,f.cellFormat.preferredWidthType):this.tableHolder.addColumns(p,p=w.columnIndex+w.cellFormat.columnSpan,c,u,g+=c,f.cellFormat.preferredWidthType),f.columnIndex=p),(v=v||m!==h.childWidgets.length-1?v:!0)&&l-w.ownerRow.rowIndex==b-1&&(t.splice(y,1),y--))}if(1<f.cellFormat.rowSpan)if(0===t.length||t[t.length-1].columnIndex<=p)t.push(f);else{for(var C=0,S=t.length;0<S;S--)t[S-1].columnIndex>p&&(C=S-1);t.splice(C,0,f)}u=f.getCellSizeInfo(n),c=this.getCellWidth(f.cellFormat.preferredWidth,f.cellFormat.preferredWidthType,r,f),this.tableHolder.addColumns(p,p+=f.cellFormat.columnSpan,c,u,g+=c,f.cellFormat.preferredWidthType),m===h.childWidgets.length-1&&0<d.gridAfterWidth&&(c=this.getCellWidth(d.gridAfterWidth,"Point",r,null),u.minimumWordWidth=u.maximumWordWidth=u.minimumWidth=c,this.tableHolder.addColumns(p,p+=d.gridAfter,c,u,g+=c,"Point"))}}!je(this.bodyWidget.page)&&this.bodyWidget.page.documentHelper&&this.bodyWidget.page.documentHelper.layout&&this.bodyWidget.page.documentHelper.layout.isAllColumnHasAutoWidthType&&(this.bodyWidget.page.documentHelper.layout.isAllColumnHasAutoWidthType=!1),o&&!this.isDefaultFormatUpdated&&(this.isDefaultFormatUpdated=!0),this.tableHolder.validateColumnWidths(),n?this.tableHolder.autoFitColumn(e,r,i,this.isInsideTable,n,a,this.leftIndent+this.rightIndent,s,this.tableFormat.preferredWidthType):this.tableHolder.fitColumns(e,r,i,n,this.leftIndent+this.rightIndent),this.setWidthToCells(r,i)}},Hai.prototype.setWidthToCells=function(e,t){for(var i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i],o=n.rowFormat;0<o.gridBefore&&(o.beforeWidth=this.tableHolder.getCellWidth(0,o.gridBefore,e));for(var r=0;r<n.childWidgets.length;r++){var s=n.childWidgets[r];s.cellFormat.cellWidth=this.tableHolder.getCellWidth(s.columnIndex,s.cellFormat.columnSpan,e)}0<o.gridAfter&&(o.afterWidth=this.tableHolder.getCellWidth(0,o.gridAfter,e))}},Hai.prototype.updateProperties=function(e,t,i){if(e&&(this.tableFormat.allowAutoFit="FixedColumnWidth"!==i),this!==t)t.updateProperties(!1,t,i);else if("FixedColumnWidth"===i){this.tableFormat.preferredWidth=0,this.tableFormat.preferredWidthType="Auto";for(var n=0;n<this.childWidgets.length;n++)for(var o=this.childWidgets[n],r=0;r<o.childWidgets.length;r++){var s=o.childWidgets[r];s.cellFormat.preferredWidthType="Point",s.cellFormat.preferredWidth=s.cellFormat.cellWidth}}else if("FitToWindow"===i){var a=this.tableHolder.getTotalWidth(0);this.tableFormat.leftIndent=0,this.tableFormat.preferredWidth=100,this.tableFormat.preferredWidthType="Percent";for(n=0;n<this.childWidgets.length;n++)for(var l=this.childWidgets[n],h=0;h<l.childWidgets.length;h++)"Percent"!==(d=l.childWidgets[h]).cellFormat.preferredWidthType&&(d.cellFormat.preferredWidthType="Percent",d.cellFormat.preferredWidth=d.cellFormat.cellWidth/a*100)}else{this.tableFormat.preferredWidth=0,this.tableFormat.preferredWidthType="Auto";for(n=0;n<this.childWidgets.length;n++){(l=this.childWidgets[n]).rowFormat.beforeWidth=0,l.rowFormat.gridBefore=0,l.rowFormat.gridBeforeWidth=0,l.rowFormat.gridBeforeWidthType="Auto",l.rowFormat.afterWidth=0,l.rowFormat.gridAfter=0,l.rowFormat.gridAfterWidth=0,l.rowFormat.gridAfterWidthType="Auto";for(var d,r=0;r<l.childWidgets.length;r++)(d=l.childWidgets[r]).cellFormat.preferredWidth=0,d.cellFormat.preferredWidthType="Auto"}}},Hai.prototype.getMaxRowWidth=function(e){for(var t=0,i=0;i<this.childWidgets.length;i++){for(var n=this.childWidgets[i],o=0,r=0;r<n.childWidgets.length;r++){var s=n.childWidgets[r];o+=this.getCellWidth(s.cellFormat.preferredWidth,s.cellFormat.preferredWidthType,e,s)}t<o&&(t=o)}return t},Hai.prototype.updateWidth=function(e){var t=this.tableHolder.getTotalWidth(0),i=this.getOwnerWidth(!0),n=this.getTableClientWidth(i);n<=t&&"Auto"===this.tableFormat.preferredWidthType&&(this.tableFormat.preferredWidthType="Point"),"Auto"!==this.tableFormat.preferredWidthType&&("Point"===this.tableFormat.preferredWidthType?this.tableFormat.preferredWidth=this.getMaxRowWidth(n):this.tableFormat.preferredWidth=t/i*100)},Hai.prototype.convertPointToPercent=function(e,t){e=e/t*100;return(e=Math.round(e))<100?e:100},Hai.prototype.updateChildWidgetLeft=function(e){for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t];i.x=e,i.updateChildWidgetLeft(e)}},Hai.prototype.shiftWidgetsForRtlTable=function(e,t){var i=t.x,n=e.right,o=0;t.tableFormat&&0<t.tableFormat.cellSpacing&&(o=t.tableFormat.cellSpacing);for(var r=0;r<t.childWidgets.length;r++)for(var s=t.childWidgets[r],a=n-(s.x-i),l=0;l<s.childWidgets.length;l++){var h=s.childWidgets[l];a-=h.width+h.margin.left+h.margin.right-h.rightBorderWidth+o,h.updateWidgetLeft(a+h.margin.left)}},Hai.prototype.clone=function(){var e=new Hai;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 i=this.childWidgets[t].clone();e.childWidgets.push(i),i.containerWidget=e,i.index=t}return e.x=this.x,e.y=this.y,e.height=this.height,e.width=this.width,e.isBidiTable=this.isBidiTable,e.containerWidget=this.containerWidget,this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e},Hai.getTableOf=function(e){var t;if(e instanceof uri)return je(t=jai.getRowOf(e))?e.ownerBase instanceof Jri&&e.ownerBase.ownerBase instanceof Hai?e.ownerBase.ownerBase:void 0:t.ownerTable},Hai.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 i=this.childWidgets[t],n=0;n<i.childWidgets.length;n++)for(var o=i.childWidgets[n],r=0;r<o.childWidgets.length;r++)o.childWidgets[r]instanceof Hai&&o.childWidgets[r].fitChildToClientArea()},Hai.prototype.getColumnCellsForSelection=function(e,t){for(var i=[],n=e.columnIndex,o=t.columnIndex+t.cellFormat.columnSpan,r=0;r<this.childWidgets.length;r++)for(var s=this.childWidgets[r],a=0;a<s.childWidgets.length;a++){var l=s.childWidgets[a],h=l.columnIndex,d=l.cellFormat.columnSpan;n<h+d&&h+d<o||n<h&&h<o?i.indexOf(l)<0&&i.push(l):(n<h&&h<o&&h+d<o||h<n&&o<h+d||h===n||h+d===o)&&i.indexOf(l)<0&&i.push(l)}return i},Hai.prototype.splitWidthToTableCells=function(e,t){for(var i=0;i<this.childWidgets.length;i++)this.childWidgets[i].splitWidthToRowCells(e,t)},Hai.prototype.insertTableRowsInternal=function(e,t,i,n){for(var o=e.length-1;0<=o;o--){var r=e.splice(o,1)[0];if(r.containerWidget=this,n)for(var s=0;s<r.childWidgets.length;s++)r.childWidgets[s].cellFormat.initializeCellBorders();this.childWidgets.splice(t,0,r)}this.updateRowIndex(t),this.isGridUpdated=!1,i&&(this.calculateGrid(!0),this.buildTableColumns()),this.isGridUpdated=!0},Hai.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++}},Hai.prototype.getCellStartOffset=function(e){var t,i=0;return i=e&&this.tableCellInfo&&this.tableCellInfo.containsKey(e.ownerRow.rowIndex)&&(t=this.tableCellInfo.get(e.ownerRow.rowIndex)).containsKey(e.cellIndex)?t.get(e.cellIndex):i},Hai.prototype.destroyInternal=function(e){var t=this.height;if(!je(this.childWidgets)){for(var i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i];if(je(n)||n.destroyInternal(e),je(this.childWidgets))break;i--}this.childWidgets=void 0}je(this.containerWidget)||(this.containerWidget instanceof Sai&&-1!==this.containerWidget.floatingElements.indexOf(this)&&this.containerWidget.floatingElements.splice(this.containerWidget.floatingElements.indexOf(this),1),je(this.containerWidget.childWidgets)||(-1!==this.containerWidget.childWidgets.indexOf(this)&&this.containerWidget.childWidgets.splice(this.containerWidget.childWidgets.indexOf(this),1),this.containerWidget.height-=t),this.containerWidget=void 0),this.destroy()},Hai.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.isDefaultFormatUpdated=void 0,Vai.prototype.destroy.call(this)},Hai.prototype.componentDestroy=function(){this.tableFormat&&this.tableFormat.destroy(),this.tableFormat=void 0,this.spannedRowCollection&&this.spannedRowCollection.destroy(),this.spannedRowCollection=void 0,this.tableHolder&&this.tableHolder.destroy(),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.isDefaultFormatUpdated=void 0,Vai.prototype.componentDestroy.call(this)};var Vai,_ai=Hai;function Hai(){var e=Vai.call(this)||this;return e.flags=0,e.leftMargin=0,e.topMargin=0,e.rightMargin=0,e.bottomMargin=0,e.isDefaultFormatUpdated=!1,e.isContainInsideTable=!1,e.footnoteElement=[],e.margin=new gai(e.leftMargin,e.topMargin,e.rightMargin,e.bottomMargin),e.leftBorderWidth=0,e.rightBorderWidth=0,e.topBorderWidth=0,e.bottomBorderWidth=0,e.tableFormat=new Jri(e),e.tableHolder=new ndi,e.spannedRowCollection=new uJt,e}pJ(Wai,zai=Dai),Object.defineProperty(Wai.prototype,"rowIndex",{get:function(){return this.containerWidget?this.containerWidget.childWidgets.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(Wai.prototype,"ownerTable",{get:function(){if(this.containerWidget instanceof _ai)return this.containerWidget},enumerable:!0,configurable:!0}),Object.defineProperty(Wai.prototype,"nextRow",{get:function(){var e=this.indexInOwner;if(-1<e&&e<this.ownerTable.childWidgets.length-1)return this.ownerTable.childWidgets[e+1]},enumerable:!0,configurable:!0}),Wai.prototype.equals=function(e){return e instanceof Wai&&e.rowFormat===this.rowFormat},Wai.prototype.combineCells=function(e){for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t];i.combineWidget(e),je(i.cellFormat)||1!==i.cellFormat.rowSpan?je(i.cellFormat)&&t--:(i.height,i.margin.top,i.margin.bottom,this.height-this.ownerTable.tableFormat.cellSpacing<i.height&&(this.height=this.ownerTable.tableFormat.cellSpacing+i.height))}},Wai.getRowOf=function(e){var t;if(e instanceof uri)return je(t=Uai.getCellOf(e))?e.ownerBase instanceof Cri&&e.ownerBase.ownerBase instanceof Wai?e.ownerBase.ownerBase:void 0:t.ownerRow},Wai.prototype.getCell=function(e,t,i){for(var n=0;n<this.childWidgets.length;n++){var o=this.childWidgets[n];if(o.rowIndex===e&&(je(i)?o.columnIndex===t:o.cellIndex===i))return o}},Wai.prototype.getCellUsingColumnIndex=function(e,t){for(var i,n=0;n<this.childWidgets.length;n++)if((i=this.childWidgets[n]).rowIndex===e&&i.columnIndex===t)return i;if(!je(i=this.getCell(e,t)))return i},Wai.prototype.splitWidthToRowCells=function(e,t){for(var i=this.childWidgets,n=e/i.length,o=0;o<i.length;o++)if(t&&0===i[o].cellFormat.preferredWidth)i[o].cellFormat.preferredWidth=n,this.ownerTable.isDefaultFormatUpdated=!1;else{if(t){this.ownerTable.isDefaultFormatUpdated=!0;break}i[o].cellFormat.preferredWidth=n}},Wai.prototype.getGridCount=function(e,t,i,n,o){var r=0,s=0,a=this.ownerTable,l=this.rowFormat,s=-1===i?a.getCellWidth(l.gridBeforeWidth,l.gridBeforeWidthType,n,null):(r+=a.getCellWidth(l.gridBeforeWidth,l.gridBeforeWidthType,n,null),0<=i&&(r+=a.getCellStartOffset(t)),i<this.childWidgets.length?a.getCellWidth(t.cellFormat.preferredWidth,t.cellFormat.preferredWidthType,n,null):a.getCellWidth(l.gridAfterWidth,l.gridAfterWidthType,n,null)),i=o[e.indexOf(r)],t=this.getOffsetIndex(e,r),a=parseFloat((s+r).toFixed(2)),l=parseFloat((s+i).toFixed(2))===a||je(i)?this.getOffsetIndex(e,r+s):this.getOffsetIndex(e,i+s);return l-t},Wai.prototype.getOffsetIndex=function(e,t){t=parseFloat(t.toFixed(2));var i=0;if(0<=e.indexOf(t))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},Wai.prototype.getCellOffset=function(e,t){for(var i=0,n=this.ownerTable,o=0;o<this.childWidgets.length;o++){var r=this.childWidgets[o].cellFormat;if(o===e)break;i+=n.getCellWidth(r.preferredWidth,r.preferredWidthType,t,null)}return i},Wai.prototype.updateRowBySpannedCells=function(){for(var e=this.getPreviousRowSpannedCells(),t=this.rowIndex,i=0;i<e.length;i++){var n=e[i];t<=n.ownerRow.rowIndex+n.cellFormat.rowSpan-1&&--n.cellFormat.rowSpan}},Wai.prototype.getPreviousRowSpannedCells=function(e){for(var t=[],i=e?this:this.previousWidget;!je(i);){for(var n=0;n<i.childWidgets.length;n++){var o=i.childWidgets[n];1<o.cellFormat.rowSpan&&t.splice(0,0,o)}i=i.previousWidget}return t},Wai.prototype.isCellsHaveSameWidthUnit=function(){if(0<this.childWidgets.length)for(var e=this.childWidgets[0].cellFormat.preferredWidthType,t=1;t<this.childWidgets.length;t++)if(e!=this.childWidgets[t].cellFormat.preferredWidthType)return!1;return!0},Wai.prototype.updateUniformWidthUnitForCells=function(){var e=!1;this.ownerTable&&this.ownerTable.tableHolder&&this.ownerTable.tableHolder.columns&&this.childWidgets.length!==this.ownerTable.tableHolder.columns.length&&(e=!0);for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t];i.cellFormat.preferredWidthType="Point",i.cellFormat.preferredWidth=e?i.getMinimumPreferredWidth():i.cellFormat.cellWidth}},Wai.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 n=0<this.childWidgets.length?(this.childWidgets[0].x<=e.x?this.childWidgets[this.childWidgets.length-1]:this.childWidgets[0]).getTableCellWidget(e):n},Wai.prototype.getFirstRowWidth=function(){for(var e=0,t=0;t<this.childWidgets.length;t++)e+=this.childWidgets[t].getCellWidth(this.ownerTable);return e},Wai.prototype.getCellWidget=function(e,t){var i=this.ownerTable.tableHolder.getValidColumnIndex(e),n=(e<i&&(t-=i-e,e=i),0);0<this.rowFormat.gridBefore&&(n+=this.rowFormat.gridBefore);for(var o=0;o<this.childWidgets.length;o++){var r=this.childWidgets[o],s=r.cellFormat.columnSpan;if(n<r.columnIndex&&(n<=e||n<e+t)&&r.columnIndex>e)return null;if((r.columnIndex<=e||r.columnIndex<e+t)&&r.columnIndex+s>e)return r;if(r.columnIndex>e)break;n+=s}return null},Wai.prototype.getVerticalMergeStartCell=function(e,t){var i,n,o=this.ownerTable.tableHolder.columns;return 0<this.rowFormat.gridBefore&&this.rowFormat.gridBefore>e+t?null:je(i=this.getCellWidget(e,t))?e+this.rowFormat.gridAfter!==o.length&&(je(o=this.previousWidget)||(n=o.getVerticalMergeStartCell(e,t)),!je(n))&&1<n.cellFormat.rowSpan&&this.index===n.rowIndex+n.cellFormat.rowSpan-1?n:null:i},Wai.prototype.getMinimumAndMaximumWordWidth=function(e,t){return{minimumWordWidth:e,maximumWordWidth:t}},Wai.prototype.destroyInternal=function(e){var t=this.height;if(!je(this.childWidgets)){for(var i=0;i<this.childWidgets.length;i++){if(this.childWidgets[i].destroyInternal(e),je(this.childWidgets))break;i--}this.childWidgets=void 0}je(this.containerWidget)||je(this.containerWidget.childWidgets)||(this.containerWidget.childWidgets.splice(this.containerWidget.childWidgets.indexOf(this),1),(je(this.containerWidget.childWidgets)||0===this.containerWidget.childWidgets.length)&&this.containerWidget instanceof _ai?this.containerWidget.destroyInternal(e):this.containerWidget.containerWidget instanceof Sai&&(this.containerWidget.containerWidget.height-=t),this.containerWidget.height-=t),this.destroy()},Wai.prototype.clone=function(){var e=new Wai;e.rowFormat.copyFormat(this.rowFormat),e.topBorderWidth=this.topBorderWidth,e.bottomBorderWidth=this.bottomBorderWidth,e.isRenderBookmarkEnd=this.isRenderBookmarkEnd;for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t].clone();e.childWidgets.push(i),i.containerWidget=e,i.index=t,i.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},Wai.prototype.updateChildWidgetLeft=function(e,t){var i=0;0<this.ownerTable.tableFormat.cellSpacing&&(i=this.ownerTable.tableFormat.cellSpacing);for(var n=0;n<this.childWidgets.length;n++){var o=this.childWidgets[n];e+=i+o.margin.left,o.x=e,o.updateChildWidgetLeft(o.x),e+=o.width+o.margin.right}},Wai.prototype.shiftWidgetForRtlTable=function(){for(var e=this.ownerTable,t=e.x,i=0,n=(null!=e.tableFormat&&0<e.tableFormat.cellSpacing&&(i=e.tableFormat.cellSpacing),e=Y.convertPointToPixel(e.getTableWidth()),this.x),o=t+e-(n-t),r=0,s=0;s<this.childWidgets.length;s++){var a=this.childWidgets[s],l=0;(l=je(a.previousWidget)?l:a.previousWidget.columnIndex+a.previousWidget.cellFormat.columnSpan)<a.columnIndex&&(r=Y.convertPointToPixel(a.ownerTable.tableHolder.getPreviousSpannedCellWidth(l,a.columnIndex)),0===l)&&(r-=i/2),o-=a.width+a.margin.left+a.margin.right+i,a.updateWidgetLeft(o+a.margin.left-r)}},Wai.prototype.destroy=function(){this.rowFormat=void 0,this.topBorderWidth=void 0,this.bottomBorderWidth=void 0,zai.prototype.destroy.call(this)},Wai.prototype.componentDestroy=function(){this.rowFormat&&this.rowFormat.destroy(),this.rowFormat=void 0,this.topBorderWidth=void 0,this.bottomBorderWidth=void 0,this.isRenderBookmarkEnd=void 0,zai.prototype.componentDestroy.call(this)};var zai,jai=Wai;function Wai(){var e=zai.call(this)||this;return e.isRenderBookmarkEnd=!1,e.topBorderWidth=0,e.bottomBorderWidth=0,e.rowFormat=new Cri(e),e.editRangeID=new uJt,e}pJ(qai,Qai=Dai),Object.defineProperty(qai.prototype,"ownerColumn",{get:function(){return this.ownerTable.tableHolder.columns[this.columnIndex]},enumerable:!0,configurable:!0}),Object.defineProperty(qai.prototype,"leftMargin",{get:function(){return this.cellFormat&&this.cellFormat.hasValue("leftMargin")?this.cellFormat.leftMargin:!je(this.ownerRow)&&this.ownerRow.rowFormat.hasValue("leftMargin")?this.ownerRow.rowFormat.leftMargin:je(this.ownerTable)||je(this.ownerTable.tableFormat)||!this.ownerTable.tableFormat.hasValue("leftMargin")?0:this.ownerTable.tableFormat.leftMargin},enumerable:!0,configurable:!0}),Object.defineProperty(qai.prototype,"topMargin",{get:function(){return this.cellFormat&&this.cellFormat.hasValue("topMargin")?this.cellFormat.topMargin:!je(this.ownerRow)&&this.ownerRow.rowFormat.hasValue("topMargin")?this.ownerRow.rowFormat.topMargin:je(this.ownerTable)||je(this.ownerTable.tableFormat)||!this.ownerTable.tableFormat.hasValue("topMargin")?0:this.ownerTable.tableFormat.topMargin},enumerable:!0,configurable:!0}),Object.defineProperty(qai.prototype,"rightMargin",{get:function(){return this.cellFormat&&this.cellFormat.hasValue("rightMargin")?this.cellFormat.rightMargin:!je(this.ownerRow)&&this.ownerRow.rowFormat.hasValue("rightMargin")?this.ownerRow.rowFormat.rightMargin:je(this.ownerTable)||je(this.ownerTable.tableFormat)||!this.ownerTable.tableFormat.hasValue("rightMargin")?0:this.ownerTable.tableFormat.rightMargin},enumerable:!0,configurable:!0}),Object.defineProperty(qai.prototype,"bottomMargin",{get:function(){return this.cellFormat&&this.cellFormat.hasValue("bottomMargin")?this.cellFormat.bottomMargin:!je(this.ownerRow)&&this.ownerRow.rowFormat.hasValue("bottomMargin")?this.ownerRow.rowFormat.bottomMargin:je(this.ownerTable)||je(this.ownerTable.tableFormat)||!this.ownerTable.tableFormat.hasValue("bottomMargin")?0:this.ownerTable.tableFormat.bottomMargin},enumerable:!0,configurable:!0}),Object.defineProperty(qai.prototype,"cellIndex",{get:function(){return this.ownerRow?this.ownerRow.childWidgets.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(qai.prototype,"ownerTable",{get:function(){if(this.containerWidget instanceof jai)return this.containerWidget.ownerTable},enumerable:!0,configurable:!0}),Object.defineProperty(qai.prototype,"ownerRow",{get:function(){return this.containerWidget},enumerable:!0,configurable:!0}),Object.defineProperty(qai.prototype,"sizeInfo",{get:function(){return this.sizeInfoInternal},enumerable:!0,configurable:!0}),qai.prototype.equals=function(e){return e instanceof qai&&e.cellFormat===this.cellFormat},qai.prototype.getContainerTable=function(){for(var e=this.ownerTable;e instanceof _ai&&e.associatedCell instanceof qai;)e=e.associatedCell.getContainerTable();return e},qai.prototype.getPreviousSplitWidget=function(){if(this.containerWidget instanceof jai){var e=this.containerWidget;do{if(je(e=e.previousRenderedWidget)||e.index<this.rowIndex)break;var t=e.getCell(this.rowIndex,this.columnIndex);if(t&&this.equals(t))return t}while(e)}},qai.prototype.getNextSplitWidget=function(){var e=this.cellFormat.rowSpan;if(this.containerWidget instanceof jai){var t=this.containerWidget;do{if(je(t=t.nextRenderedWidget)||t.index>this.rowIndex+e)break;var i=t.getCell(this.rowIndex,this.columnIndex);if(i&&this.equals(i))return i}while(t)}},qai.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 i=0<this.childWidgets.length?(this.childWidgets[0].y<=e.y?this.childWidgets[this.childWidgets.length-1]:this.childWidgets[0]).getTableCellWidget(e):i},qai.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},qai.prototype.getCellWidth=function(e){var t=this.ownerTable,i=t?t.getTableClientWidth(t.getOwnerWidth(!0)):0,n=i,o=je(this.leftMargin)?0:this.leftMargin,r=je(this.rightMargin)?0:this.rightMargin;return t&&"Auto"===t.tableFormat.preferredWidthType&&t.tableFormat.allowAutoFit?n=0===this.cellFormat.preferredWidth?i:"Percent"===this.cellFormat.preferredWidthType?this.cellFormat.preferredWidth*i/100-o-r:this.cellFormat.preferredWidth-o-r:"Percent"===this.cellFormat.preferredWidthType?n=this.cellFormat.preferredWidth*i/100-o-r:"Point"===this.cellFormat.preferredWidthType&&(n=e instanceof _ai&&"Percent"===e.tableFormat.preferredWidthType?this.cellFormat.cellWidth-o-r:this.cellFormat.preferredWidth-o-r),n},qai.prototype.convertPointToPercent=function(e){var t=this.ownerTable.getOwnerWidth(!0),e=e/this.ownerTable.getTableClientWidth(t)*100;return(e=Math.round(e))<100?e:100},qai.getCellLeftBorder=function(e){var t=void 0,i=e.cellFormat.borders,n=je(e.ownerRow)?void 0:e.ownerRow.rowFormat.borders,o=je(e.ownerTable)?void 0:e.ownerTable.tableFormat.borders;return je(i.left)||(t=i.left),je(t)&&(t=e.getLeftBorderToRenderByHierarchy(t,n,o)),t=je(t=0<e.ownerTable.tableFormat.cellSpacing?e.getLeftBorderToRenderByHierarchy(t,n,o):(i=this.getPreviousCell(e),e.getPreviousCellLeftBorder(t,i)))?new pri(e.cellFormat.borders):t},qai.getPreviousCell=function(e){var t,i=void 0;return je(e.previousWidget)||(t=e.previousWidget).columnIndex+t.cellFormat.columnSpan===e.columnIndex&&(i=t),i},qai.prototype.getLeftBorderWidth=function(){var e=0;return e=null!==this.cellFormat&&null!==this.cellFormat.borders?qai.getCellLeftBorder(this).getLineWidth():e},qai.prototype.getRightBorderWidth=function(){var e=0;this.ownerTable;return e=null!==this.cellFormat&&null!==this.cellFormat.borders?qai.getCellRightBorder(this).getLineWidth():e},qai.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},qai.prototype.getCellSizeInfo=function(e){var t=!0,i=void 0,e=(je(this.bodyWidget)||je(this.bodyWidget.page)||je(this.bodyWidget.page.documentHelper)||(i=this.bodyWidget.page.documentHelper.layout),je(i)||je(i.currentCell)||(t=!1,this===i.currentCell&&(t=!0)),t&&!this.sizeInfo.hasMinimumWidth&&(this.sizeInfo.minimumWidth=this.getMinimumPreferredWidth()),e&&t&&!this.sizeInfo.hasMinimumWordWidth&&(i=this.getMinimumAndMaximumWordWidth(0,0),this.sizeInfo.minimumWordWidth=i.minimumWordWidth+this.sizeInfo.minimumWidth,this.sizeInfo.maximumWordWidth=i.maximumWordWidth+this.sizeInfo.minimumWidth),new ddi);return e.minimumWidth=this.sizeInfo.minimumWidth,e.minimumWordWidth=this.sizeInfo.minimumWordWidth,e.maximumWordWidth=this.sizeInfo.maximumWordWidth,e},qai.prototype.getMinimumPreferredWidth=function(){return this.leftMargin+this.rightMargin+this.getLeftBorderWidth()+this.getRightBorderWidth()+this.getCellSpacing()},qai.prototype.getPreviousCellLeftBorder=function(e,t){var i;return!je(t)&&(je(e)||"None"!==e.lineStyle||e.hasNoneStyle)||je(e)||e.ownerBase.ownerBase instanceof Jri||(e=this.getLeftBorderToRenderByHierarchy(e,jai.getRowOf(e.ownerBase).rowFormat.borders,_ai.getTableOf(e.ownerBase).tableFormat.borders)),je(t)?e:(i=void 0,je(t.cellFormat.borders)||je(t.cellFormat.borders.right)||"None"===t.cellFormat.borders.right.lineStyle||(i=t.cellFormat.borders.right),je(i)||"None"===i.lineStyle?je(e)||e.ownerBase.ownerBase instanceof Jri?e:this.getLeftBorderToRenderByHierarchy(e,jai.getRowOf(e.ownerBase).rowFormat.borders,_ai.getTableOf(e.ownerBase).tableFormat.borders):this.getBorderBasedOnPriority(i,e))},qai.prototype.getBorderBasedOnPriority=function(e,t){var i,n,o,r,s,a,l,h,d,p;return je(e)?t:je(t)?e:(i=e.getBorderWeight())===(n=t.getBorderWeight())?(o=e.getPrecedence())===(r=t.getPrecedence())?(d=(a=Y.convertHexToRgb(e.color)).r,s=a.g,a=a.b,h=(p=Y.convertHexToRgb(t.color)).r,l=p.g,(d=d+a+2*s)===(p=h+(h=p.b)+2*l)&&(d=a+2*s)===(p=h+2*l)?s!==l&&l<s?t:e:p<d?t:e):r<o?e:t:n<i?e:t},qai.prototype.getLeftBorderToRenderByHierarchy=function(e,t,i){var n,o,r,s=qai.getCellOf(e.ownerBase);return!je(s)&&(r=o=n=!1,(n=0===s.columnIndex||0===s.cellIndex&&0<s.ownerRow.rowFormat.gridBefore?!0:n)&&!je(t.left)?r=t.left.hasNoneStyle:n||je(t.vertical)||(r=t.vertical.hasNoneStyle),je(t.left)||"None"===t.left.lineStyle||!t.left.isBorderDefined||r||je(e)||"None"!==e.lineStyle||!e.isBorderDefined||e.hasValue("color")||(o=!0),!je(e)&&"None"===e.lineStyle&&(!e.isBorderDefined&&!r||o)||je(e))&&(n?(!je(e=t.left)&&"None"===e.lineStyle||je(e))&&(e=i.left):(!je(e=t.vertical)&&"None"===e.lineStyle||je(e))&&(e=i.vertical)),e},qai.getCellRightBorder=function(e){var t=void 0,i=e.cellFormat.borders,n=je(e.ownerRow)?void 0:e.ownerRow.rowFormat.borders,o=je(e.ownerTable)?void 0:e.ownerTable.tableFormat.borders;return je(i.right)||(t=i.right),je(t)&&(t=e.getRightBorderToRenderByHierarchy(t,n,o)),t=je(t=0<e.ownerTable.tableFormat.cellSpacing?e.getRightBorderToRenderByHierarchy(t,n,o):(i=this.getNextCell(e),e.getAdjacentCellRightBorder(t,i)))?new pri(e.cellFormat.borders):t},qai.getNextCell=function(e){var t,i=void 0,n=e.cellFormat.columnSpan;return je(e.nextWidget)||(t=e.nextWidget,e.columnIndex+n===t.columnIndex&&(i=t)),i},qai.prototype.getAdjacentCellRightBorder=function(e,t){var i;return!je(t)&&(je(e)||"None"!==e.lineStyle||e.hasNoneStyle)||je(e)||e.ownerBase.ownerBase instanceof Jri||(e=this.getRightBorderToRenderByHierarchy(e,jai.getRowOf(e.ownerBase).rowFormat.borders,_ai.getTableOf(e.ownerBase).tableFormat.borders)),je(t)?e:(i=void 0,je(t.cellFormat.borders)||je(t.cellFormat.borders.left)||"None"===t.cellFormat.borders.left.lineStyle||(i=t.cellFormat.borders.left),je(i)||"None"===i.lineStyle?je(e)||e.ownerBase.ownerBase instanceof Jri?e:this.getRightBorderToRenderByHierarchy(e,jai.getRowOf(e.ownerBase).rowFormat.borders,_ai.getTableOf(e.ownerBase).tableFormat.borders):this.getBorderBasedOnPriority(e,i))},qai.prototype.getRightBorderToRenderByHierarchy=function(e,t,i){var n,o,r,s=qai.getCellOf(e.ownerBase);return!je(s)&&(r=o=n=!1,(n=s.columnIndex+s.cellFormat.columnSpan!==s.ownerTable.tableHolder.columns.length&&s.cellIndex!==s.ownerRow.childWidgets.length-1?n:!0)&&!je(t.right)?r=t.right.hasNoneStyle:n||je(t.vertical)||(r=t.vertical.hasNoneStyle),je(t.right)||"None"===t.right.lineStyle||!t.right.isBorderDefined||r||je(e)||"None"!==e.lineStyle||!e.isBorderDefined||e.hasValue("color")||(o=!0),!je(e)&&"None"===e.lineStyle&&(!e.isBorderDefined&&!r||o)||je(e))&&(n?(!je(e=t.right)&&"None"===e.lineStyle||je(e))&&(e=i.right):(!je(e=t.vertical)&&"None"===e.lineStyle||je(e))&&(e=i.vertical)),e},qai.getCellTopBorder=function(e){var t=void 0,i=e.cellFormat.borders,n=je(e.ownerRow)?void 0:e.ownerRow.rowFormat.borders,o=je(e.ownerTable)?void 0:e.ownerTable.tableFormat.borders;return je(i.top)||(t=i.top),je(t)&&(t=e.getTopBorderToRenderByHierarchy(t,n,o)),t=je(t=0<e.ownerTable.tableFormat.cellSpacing?e.getTopBorderToRenderByHierarchy(t,n,o):(i=e.getTopAdjacentCell(),e.getPreviousCellTopBorder(t,i)))?new pri(e.cellFormat.borders):t},qai.prototype.getTopAdjacentCell=function(){var e,t=this.ownerRow.previousWidget;return e=je(t)?e:t.getVerticalMergeStartCell(this.columnIndex,this.cellFormat.columnSpan)},qai.prototype.getPreviousCellTopBorder=function(e,t){var i;return!je(t)&&(je(e)||"None"!==e.lineStyle||e.hasNoneStyle)||je(e)||e.ownerBase.ownerBase instanceof Jri||(e=this.getTopBorderToRenderByHierarchy(e,jai.getRowOf(e.ownerBase).rowFormat.borders,_ai.getTableOf(e.ownerBase).tableFormat.borders)),je(t)?e:(i=void 0,je(t.cellFormat.borders)||je(t.cellFormat.borders.bottom)||(i=this.getBottomBorderToRenderByHierarchy(t.cellFormat.borders.bottom,t.ownerRow.rowFormat.borders,t.ownerTable.tableFormat.borders)),je(i)||"None"===i.lineStyle?je(e)||e.ownerBase.ownerBase instanceof Jri?e:this.getTopBorderToRenderByHierarchy(e,jai.getRowOf(e.ownerBase).rowFormat.borders,_ai.getTableOf(e.ownerBase).tableFormat.borders):this.getBorderBasedOnPriority(e,i))},qai.prototype.getTopBorderToRenderByHierarchy=function(e,t,i){var n,o,r=qai.getCellOf(e.ownerBase);return!je(r)&&(o=n=!1,(r=je(r.ownerRow.previousWidget))&&!je(t.top)?o=t.top.hasNoneStyle:r||je(t.horizontal)||(o=t.horizontal.hasNoneStyle),je(t.top)||"None"===t.top.lineStyle||!t.top.isBorderDefined||o||je(e)||"None"!==e.lineStyle||!e.isBorderDefined||e.hasValue("color")||(n=!0),!je(e)&&"None"===e.lineStyle&&(!e.isBorderDefined&&!o||n)||je(e))&&(r?(!je(e=t.top)&&"None"===e.lineStyle||je(e))&&(e=i.top):(!je(e=t.horizontal)&&"None"===e.lineStyle||je(e))&&(e=i.horizontal)),e},qai.getCellBottomBorder=function(e){var t=void 0,i=e.cellFormat.borders,n=je(e.ownerRow)?void 0:e.ownerRow.rowFormat.borders,o=je(e.ownerTable)?void 0:e.ownerTable.tableFormat.borders;if(je(i.bottom)||(t=i.bottom),je(t)&&(t=e.getBottomBorderToRenderByHierarchy(t,n,o)),0<e.ownerTable.tableFormat.cellSpacing)t=e.getBottomBorderToRenderByHierarchy(t,n,o);else{var i=void 0,r=void 0,s=e.cellFormat.rowSpan;if(1===s)r=e.ownerRow.nextWidget;else if(1<s){var a=e.containerWidget;do{if(je(a=a.nextWidget))break;if(a.index===e.rowIndex+s){r=a;break}}while(a)}je(r)||(i=r.getCellWidget(e.columnIndex,e.cellFormat.columnSpan)),t=e.getAdjacentCellBottomBorder(t,i)}return t=je(t)?new pri(e.cellFormat.borders):t},qai.prototype.getAdjacentCellBottomBorder=function(e,t){var i;return!je(t)&&(je(e)||"None"!==e.lineStyle||e.hasNoneStyle)||je(e)||e.ownerBase.ownerBase instanceof Jri||(e=this.getBottomBorderToRenderByHierarchy(e,jai.getRowOf(e.ownerBase).rowFormat.borders,_ai.getTableOf(e.ownerBase).tableFormat.borders)),je(t)?e:(i=void 0,je(t.cellFormat.borders)||je(t.cellFormat.borders.top)||"None"===t.cellFormat.borders.top.lineStyle||(i=t.cellFormat.borders.top),je(i)||"None"===i.lineStyle?je(e)||e.ownerBase.ownerBase instanceof Jri?e:this.getBottomBorderToRenderByHierarchy(e,jai.getRowOf(e.ownerBase).rowFormat.borders,_ai.getTableOf(e.ownerBase).tableFormat.borders):this.getBorderBasedOnPriority(e,i))},qai.prototype.getBottomBorderToRenderByHierarchy=function(e,t,i){var n,o,r=qai.getCellOf(e.ownerBase);return!je(r)&&(o=n=!1,(r=je(r.ownerRow.nextWidget))&&!je(t.bottom)?o=t.bottom.hasNoneStyle:r||je(t.horizontal)||(o=t.horizontal.hasNoneStyle),je(t.bottom)||"None"===t.bottom.lineStyle||!t.bottom.isBorderDefined||o||je(e)||"None"!==e.lineStyle||!e.isBorderDefined||e.hasValue("color")||(n=!0),!je(e)&&"None"===e.lineStyle&&(!e.isBorderDefined&&!o||n)||je(e))&&(r?(!je(e=t.bottom)&&"None"===e.lineStyle||je(e))&&(e=i.bottom):(!je(e=t.horizontal)&&"None"===e.lineStyle||je(e))&&(e=i.horizontal)),e},qai.getCellOf=function(e){return e instanceof uri&&e.ownerBase instanceof $ri&&e.ownerBase.ownerBase instanceof qai?e.ownerBase.ownerBase:void 0},qai.prototype.updateWidgetLeft=function(e){this.x=e,this.updateChildWidgetLeft(e)},qai.prototype.updateChildWidgetLeft=function(e){for(var t=0;t<this.childWidgets.length;t++){var i,n,o=this.childWidgets[t];o.x=e,o instanceof Lai&&(n=Y.convertPointToPixel(o.leftIndent),i=Y.convertPointToPixel(o.rightIndent),o.x=e+(o.bidi?i:n)),o instanceof _ai&&((i=o).updateChildWidgetLeft(e),i.isBidiTable)&&(n=new pai(i.x,i.y,i.width,i.height),i.shiftWidgetsForRtlTable(n,i))}},qai.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}},qai.prototype.destroyInternal=function(e){if(!je(this.childWidgets)){for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t];0 instanceof Lai,i.destroyInternal(e),t--}this.childWidgets=void 0,je(e.documentHelper.selection)||e.documentHelper.selection.selectedWidgets.containsKey(this)&&e.documentHelper.selection.selectedWidgets.remove(this)}this.destroy()},qai.prototype.clone=function(){var e=new qai;e.cellFormat.copyFormat(this.cellFormat);for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t].clone();e.childWidgets.push(i),i.containerWidget=e,i.index=t}return e.leftBorderWidth=this.leftBorderWidth,e.rightBorderWidth=this.rightBorderWidth,e.isRenderBookmarkEnd=this.isRenderBookmarkEnd,e.isRenderBookmarkStart=this.isRenderBookmarkStart,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},qai.prototype.destroy=function(){this.cellFormat=void 0,this.rowIndex=void 0,this.columnIndex=void 0,this.isSplittedCell=void 0,Qai.prototype.destroy.call(this)},qai.prototype.componentDestroy=function(){this.cellFormat&&this.cellFormat.destroy(),this.cellFormat=void 0,this.contentControlProperties=void 0,this.rowIndex=void 0,this.columnIndex=void 0,this.isRenderBookmarkStart=void 0,this.isRenderBookmarkEnd=void 0,Qai.prototype.componentDestroy.call(this)};var Qai,Uai=qai;function qai(){var e=Qai.call(this)||this;return e.rowIndex=-1,e.sizeInfoInternal=new ddi,e.updatedTopBorders=[],e.isRenderBookmarkStart=!1,e.isRenderBookmarkEnd=!1,e.isRenderEditRangeStart=!1,e.isRenderEditRangeEnd=!1,e.isSplittedCell=!1,e.margin=new gai(e.leftMargin,e.topMargin,e.rightMargin,e.bottomMargin),e.leftBorderWidth=0,e.rightBorderWidth=0,e.cellFormat=new $ri(e),e}Object.defineProperty(Yai.prototype,"renderedElements",{get:function(){return je(this.layoutedElements)?this.children:this.layoutedElements},enumerable:!0,configurable:!0}),Object.defineProperty(Yai.prototype,"indexInOwner",{get:function(){return this.paragraph&&this.paragraph.childWidgets?this.paragraph.childWidgets.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(Yai.prototype,"nextLine",{get:function(){var e=this.paragraph,t=this.indexInOwner;if(t<=e.childWidgets.length-2)return e.childWidgets[t+1];if(e.nextSplitWidget){t=e.nextSplitWidget.firstChild;if(t instanceof Yai&&t.paragraph.equals(this.paragraph))return t}},enumerable:!0,configurable:!0}),Object.defineProperty(Yai.prototype,"previousLine",{get:function(){var e=this.paragraph,t=this.indexInOwner,i=e.previousSplitWidget;if(0<t)return e.childWidgets[t-1];if(i instanceof Lai){e=i.lastChild;if(e instanceof Yai&&e.paragraph.equals(this.paragraph))return e}},enumerable:!0,configurable:!0}),Object.defineProperty(Yai.prototype,"isEndsWithPageBreak",{get:function(){if(0<this.children.length){var e=this.children[this.children.length-1];if(e instanceof pli)return e.isPageBreak}return!1},enumerable:!0,configurable:!0}),Object.defineProperty(Yai.prototype,"isEndsWithColumnBreak",{get:function(){if(0<this.children.length){var e=this.children[this.children.length-1];if(e instanceof pli)return e.isColumnBreak}return!1},enumerable:!0,configurable:!0}),Object.defineProperty(Yai.prototype,"isEndsWithLineBreak",{get:function(){if(0<this.children.length){var e=this.children[this.children.length-1];if(e instanceof pli)return"\v"===e.text}return!1},enumerable:!0,configurable:!0}),Yai.prototype.isFirstLine=function(){var e=this.indexInOwner;return!!(-1<e&&(void 0===this.paragraph.previousSplitWidget||this.paragraph.previousSplitWidget instanceof Lai&&(this.paragraph.previousSplitWidget.isEndsWithColumnBreak||this.paragraph.previousSplitWidget.isEndsWithPageBreak)))&&0===e},Yai.prototype.isLastLine=function(){var e=this.indexInOwner;return-1<e&&void 0===this.paragraph.nextSplitWidget&&e===this.paragraph.childWidgets.length-1},Yai.prototype.getOffset=function(e,t){if(je(e))return t;for(var i=t,n=e.line,o=0;o<n.children.length;o++){var r=n.children[o];if(e===r)break;r instanceof lhi||(i+=r.length)}return i},Yai.prototype.getEndOffset=function(){for(var e=0,t=0,i=0;i<this.children.length;i++){var n=this.children[i];0===n.length||n instanceof lhi||(n.characterFormat.hidden||(n instanceof pli||n instanceof Khi||n instanceof ghi||n instanceof rhi||n instanceof phi||n instanceof Dli||n instanceof Pli||n instanceof Zai&&Y.isLinkedFieldCharacter(n))&&(e=t+n.length),t+=n.length)}return e},Yai.prototype.getInline=function(e,t,i,n,o){i=je(i)?this.paragraph.bidi:i;var r=void 0,s=0,a=!1;if(0===this.children.length&&this.previousLine){i=this.previousLine.children[this.previousLine.children.length-1];if(i instanceof pli&&"\v"===i.text)return{element:r=this.previousLine.children[this.previousLine.children.length-1],index:t=1}}for(var l,h=0;h<this.children.length;h++)if(!((r=this.children[h])instanceof lhi)){if((a=!a&&(r instanceof pli||r instanceof rhi||r instanceof Xli||r instanceof Pli||r instanceof Dli||r instanceof phi||r instanceof ghi||r instanceof Khi||r instanceof Zai&&Y.isLinkedFieldCharacter(r))?!0:a)&&e<=s+r.length)return r instanceof pli&&" "===r.text&&0===r.revisions.length&&n&&!o?{element:r=je(l=this.getNextTextElement(this,h+1))?r:l,index:t=je(l)?e-s:0}:e===s+r.length&&this.children[h+1]instanceof fli?{element:this.children[h+1],index:t}:{element:r,index:t=e-s};s+=r.length}return{element:r,index:t=s<e?je(r)?e:r.length:t}},Yai.prototype.isEndnoteLineWidget=function(){return!je(this.paragraph.containerWidget)&&this.paragraph.containerWidget.containerWidget instanceof Pai&&"Endnote"===this.paragraph.containerWidget.containerWidget.footNoteType},Yai.prototype.getNextTextElement=function(e,t){return t<e.children.length-1&&e.children[t]?e.children[t]:null},Yai.prototype.getHierarchicalIndex=function(e){return e=this.paragraph.childWidgets.indexOf(this)+";"+e,this.paragraph instanceof Dai?this.paragraph.getHierarchicalIndex(e):e},Yai.prototype.clone=function(){for(var e=new Yai(void 0),t=0;t<this.children.length;t++){var i=this.children[t].clone();e.children.push(i),i.line=e}return e.width=this.width,e.height=this.height,je(this.margin)||(e.margin=this.margin.clone()),e},Yai.prototype.destroy=function(){if(!je(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},Yai.prototype.componentDestroy=function(){if(!je(this.children)){for(var e=0;e<this.children.length;e++)this.children[e].componentDestroy();this.children=[]}this.children=void 0,this.paragraph=void 0,this.layoutedElements=[],this.layoutedElements=void 0,this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0};var Gai=Yai;function Yai(e){this.children=[],this.x=0,this.y=0,this.width=0,this.height=0,this.marginTop=0,this.maxBaseLine=0,this.skipClipImage=!1,this.paragraph=e}Object.defineProperty(Kai.prototype,"isPageBreak",{get:function(){return this instanceof pli&&"\f"===this.text},enumerable:!0,configurable:!0}),Object.defineProperty(Kai.prototype,"isColumnBreak",{get:function(){return this instanceof pli&&this.text===String.fromCharCode(14)},enumerable:!0,configurable:!0}),Object.defineProperty(Kai.prototype,"isValidNodeForTracking",{get:function(){return!(this instanceof Dli||this instanceof Khi||this instanceof ghi||this instanceof phi||this instanceof Pli)},enumerable:!0,configurable:!0}),Object.defineProperty(Kai.prototype,"isCheckBoxElement",{get:function(){return this instanceof pli&&!je(this.text)&&(this.text===String.fromCharCode(9745)||this.text===String.fromCharCode(9744))},enumerable:!0,configurable:!0}),Kai.prototype.linkFieldCharacter=function(e){this instanceof Zai&&(0===this.fieldType?je(this.fieldEnd)&&(this.linkFieldTraversingForward(this.line,this,this),-1===e.fields.indexOf(this)&&e.fields.push(this),je(this.formFieldData)||-1!==e.formFields.indexOf(this)||e.layout.isInsertFormField||e.formFields.push(this)):2===this.fieldType?(je((e=this).fieldBegin)&&this.linkFieldTraversingBackwardSeparator(this.line,e,e),je(e.fieldBegin)||(je((e.fieldBegin.fieldSeparator=e).fieldEnd)&&this.linkFieldTraversingForward(this.line,e.fieldBegin,e)&&(e.fieldEnd=e.fieldBegin.fieldEnd),e.fieldEnd&&(e.fieldEnd.fieldSeparator=e))):je(this.fieldBegin)&&this.linkFieldTraversingBackward(this.line,this,this))},Kai.prototype.linkFieldTraversingBackward=function(e,t,i){for(var n=e.children.length-1,o=n=-1<e.children.indexOf(i)?e.children.indexOf(i)-1:n;0<=o;o--){var r=e.children[o];if(r instanceof Zai)if(0===r.fieldType){if(je(r.fieldEnd))return je((t.fieldBegin=r).fieldEnd)&&(r.fieldEnd=t),t.fieldSeparator&&je(t.fieldSeparator.fieldBegin)&&je((t.fieldSeparator.fieldBegin=r).fieldSeparator)&&(r.fieldSeparator=t.fieldSeparator),!je(t.fieldBegin)}else 2===r.fieldType&&je(r.fieldEnd)&&((t.fieldSeparator=r).fieldEnd=t,je(r.fieldBegin)||(t.fieldBegin=r.fieldBegin))}return e.previousLine?this.linkFieldTraversingBackward(e.previousLine,t,this):e.paragraph.previousRenderedWidget instanceof Lai&&0<e.paragraph.previousRenderedWidget.childWidgets.length&&(i=e.paragraph.previousRenderedWidget,this.linkFieldTraversingBackward(i.childWidgets[i.childWidgets.length-1],t,this)),!0},Kai.prototype.linkFieldTraversingForward=function(e,t,i,n){var o=0;je(n)&&(n=0);for(var r=o=-1<e.children.indexOf(i)?e.children.indexOf(i)+1:o;r<e.children.length;r++){var s=e.children[r];if(s instanceof Zai)if(0===s.fieldType&&n++,1===s.fieldType){if(0===n)return je(s.fieldBegin)&&(t.fieldEnd=s),t.fieldEnd&&je(t.fieldEnd.fieldBegin)&&(t.fieldEnd.fieldBegin=t),!0;n--}else if(je(t.fieldSeparator)){if(2!==s.fieldType||!je(s.fieldBegin))return!1;if(t.fieldSeparator=s,t.fieldSeparator&&je(t.fieldSeparator.fieldBegin)&&(t.fieldSeparator.fieldBegin=t),!je(s.fieldEnd))return t.fieldEnd=s.fieldEnd,t.fieldSeparator.fieldEnd=t.fieldEnd,!0}}return e.nextLine?this.linkFieldTraversingForward(e.nextLine,t,this,n):e.paragraph.nextRenderedWidget instanceof Lai&&0<e.paragraph.nextRenderedWidget.childWidgets.length?this.linkFieldTraversingForward(e.paragraph.nextRenderedWidget.childWidgets[0],t,this,n):e.paragraph.nextRenderedWidget instanceof _ai&&!je((i=(i=e.paragraph.nextRenderedWidget).getSplitWidgets().pop()).nextRenderedWidget)&&i.nextRenderedWidget instanceof Lai&&0<i.nextRenderedWidget.childWidgets.length&&this.linkFieldTraversingForward(i.nextRenderedWidget.childWidgets[0],t,this,n),!0},Kai.prototype.linkFieldTraversingBackwardSeparator=function(e,t,i){for(var n=e.children.length-1,o=n=-1<e.children.indexOf(i)?e.children.indexOf(i)-1:n;0<=o;o--){var r=e.children[o];if(r instanceof Zai&&r instanceof Zai&&0===r.fieldType)return je(r.fieldSeparator)&&(t.fieldBegin=r),!je(t.fieldBegin)}if(e.previousLine)this.linkFieldTraversingBackwardSeparator(e.previousLine,t,this);else{if(!(e.paragraph.previousRenderedWidget instanceof Lai&&0<e.paragraph.previousRenderedWidget.childWidgets.length))return!0;e=e.paragraph.previousRenderedWidget.childWidgets[e.paragraph.previousRenderedWidget.childWidgets.length-1],this.linkFieldTraversingBackwardSeparator(e,t,this)}return!0},Object.defineProperty(Kai.prototype,"length",{get:function(){return this.getLength()},enumerable:!0,configurable:!0}),Object.defineProperty(Kai.prototype,"indexInOwner",{get:function(){return this.line instanceof Gai&&this.line.children?this.line.children.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(Kai.prototype,"previousElement",{get:function(){var e=this.indexInOwner;if(0<e&&e<this.line.children.length)return this.line.children[e-1]},enumerable:!0,configurable:!0}),Object.defineProperty(Kai.prototype,"nextElement",{get:function(){var e=this.indexInOwner;if(-1<e&&e<this.line.children.length-1)return this.line.children[e+1]},enumerable:!0,configurable:!0}),Object.defineProperty(Kai.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(Kai.prototype,"nextValidNodeForTracking",{get:function(){for(var e=this;!je(e)&&(e instanceof Dli||e instanceof Khi||e instanceof ghi||e instanceof phi||e instanceof Pli);)e=e.nextNode;return e},enumerable:!0,configurable:!0}),Object.defineProperty(Kai.prototype,"previousValidNodeForTracking",{get:function(){for(var e=this;!je(e)&&(e instanceof Dli||e instanceof Khi||e instanceof ghi||e instanceof phi||e instanceof Pli);)e=e.previousNode;return e},enumerable:!0,configurable:!0}),Object.defineProperty(Kai.prototype,"previousNode",{get:function(){var e=this.line.children.indexOf(this),t=this.line.paragraph.childWidgets.indexOf(this.line);return 0<e?this.line.children[e-1]:0<t?(e=this.line.paragraph.childWidgets[t-1]).children[e.children.length-1]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(Kai.prototype,"paragraph",{get:function(){if(this.line)return this.line.paragraph},enumerable:!0,configurable:!0}),Kai.prototype.destroy=function(){var e;!je(this.line)&&this.line.children&&-1<this.line.children.indexOf(this)&&(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},Kai.prototype.componentDestroy=function(){this.characterFormat&&this.characterFormat.destroy(),this.characterFormat=void 0,this.margin&&this.margin.destroy(),this.margin=void 0,this.padding&&this.padding.destroy(),this.padding=void 0,this.contentControlProperties=void 0,this.line=void 0,this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0},Kai.objectCharacter=String.fromCharCode(65532);var Xai=Kai;function Kai(){this.x=0,this.y=0,this.width=0,this.height=0,this.isWidthUpdated=!1,this.margin=new gai(0,0,0,0),this.padding=new gai(0,0,0,0),this.characterFormat=void 0,this.isRightToLeft=!1,this.canTrigger=!1,this.ischangeDetected=!1,this.isVisible=!1,this.isSpellChecked=!1,this.isSpellCheckTriggered=!1,this.revisions=[],this.canTrack=!1,this.removedIds=[],this.isMarkedForRevision=!1,this.skipformFieldLength=!1,this.characterRange=void 0,this.characterFormat=new Eri(this),this.margin=new gai(0,0,0,0)}pJ($ai,Jai=Xai),Object.defineProperty($ai.prototype,"fieldBegin",{get:function(){return this.fieldBeginInternal},set:function(e){this.fieldBeginInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty($ai.prototype,"fieldSeparator",{get:function(){return this.fieldSeparatorInternal},set:function(e){this.fieldSeparatorInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty($ai.prototype,"fieldEnd",{get:function(){return this.fieldEndInternal},set:function(e){this.fieldEndInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty($ai.prototype,"resultText",{get:function(){if(!je(this.formFieldData)&&0===this.fieldType&&!je(this.fieldSeparator)&&!je(this.fieldEnd)){var e=this.fieldSeparator.nextElement,t="";do{if(e instanceof pli&&(t+=e.text),(e=e.nextNode)===this.fieldEnd)break}while(e);return t}},enumerable:!0,configurable:!0}),$ai.prototype.getLength=function(){return 1},$ai.prototype.clone=function(){var e=new $ai(this.fieldType);if(0!==this.fieldType||je(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,!je(this.paragraph)&&this.paragraph.isInHeaderFooter){if(0<this.revisions.length)for(var t=0;t<this.revisions.length;t++){var i=this.revisions[t];e.revisions.push(i.clone())}}else 0<this.revisions.length?(e.removedIds=Ari.cloneRevisions(this.revisions),this.fieldEnd&&(e.hasFieldEnd=this.hasFieldEnd)):(e.removedIds=this.removedIds.slice(),je(this.fieldEnd)||je(this.fieldEnd.paragraph)||this.fieldEnd.paragraph.containerWidget instanceof Uai||(e.hasFieldEnd=this.hasFieldEnd));return e.fieldCodeType=this.fieldCodeType,e},$ai.prototype.destroy=function(){this.fieldType=void 0,this.hasFieldEnd=void 0,this.fieldBeginInternal=void 0,this.fieldEndInternal=void 0,this.fieldSeparatorInternal=void 0,Jai.prototype.destroy.call(this)},$ai.prototype.componentDestroy=function(){this.formFieldData&&this.formFieldData.destroy(),this.formFieldData=void 0,this.fieldCodeType=void 0,this.fieldBeginInternal=void 0,this.fieldEndInternal=void 0,this.fieldSeparatorInternal=void 0,Jai.prototype.componentDestroy.call(this)};var Jai,Zai=$ai;function $ai(e){var t=Jai.call(this)||this;return t.fieldType=0,t.fieldCodeType="",t.hasFieldEnd=!1,t.fieldBeginInternal=void 0,t.fieldSeparatorInternal=void 0,t.fieldEndInternal=void 0,t.fieldType=e,t}eli.prototype.destroy=function(){this.name=void 0,this.helpText=void 0,this.statusText=void 0};P$e=eli;function eli(){this.name="",this.enabled=!0,this.helpText="",this.statusText=""}pJ(nli,tli=P$e),nli.prototype.clone=function(){var e=new nli;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},nli.prototype.getFormFieldInfo=function(){return{defaultValue:this.defaultValue,enabled:this.enabled,format:this.format,helpText:this.helpText,maxLength:this.maxLength,type:this.type,name:this.name}},nli.prototype.copyFieldInfo=function(e){je(e.defaultValue)||(this.defaultValue=e.defaultValue),je(e.enabled)||(this.enabled=e.enabled),je(e.format)||(this.format=e.format),je(e.helpText)||(this.helpText=e.helpText),je(e.maxLength)||(this.maxLength=e.maxLength),je(e.type)||(this.type=e.type)},nli.prototype.destroy=function(){this.format=void 0,this.defaultValue=void 0,tli.prototype.destroy.call(this)};var tli,ili=nli;function nli(){var e=null!==tli&&tli.apply(this,arguments)||this;return e.type="Text",e.maxLength=0,e.defaultValue="",e.format="",e}pJ(sli,oli=P$e),sli.prototype.clone=function(){var e=new sli;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},sli.prototype.getFormFieldInfo=function(){return{defaultValue:this.defaultValue,enabled:this.enabled,helpText:this.helpText,size:this.size,sizeType:this.sizeType,name:this.name}},sli.prototype.copyFieldInfo=function(e){je(e.defaultValue)||(this.defaultValue=e.defaultValue,this.checked=e.defaultValue),je(e.enabled)||(this.enabled=e.enabled),je(e.size)||(this.size=e.size),je(e.helpText)||(this.helpText=e.helpText),je(e.sizeType)||(this.sizeType=e.sizeType)},sli.prototype.destroy=function(){oli.prototype.destroy.call(this)};var oli,rli=sli;function sli(){var e=null!==oli&&oli.apply(this,arguments)||this;return e.sizeType="Auto",e.size=11,e.defaultValue=!1,e.checked=!1,e}pJ(hli,ali=P$e),hli.prototype.clone=function(){var e=new hli;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},hli.prototype.getFormFieldInfo=function(){return{dropdownItems:this.dropdownItems.slice(),enabled:this.enabled,helpText:this.helpText,name:this.name}},hli.prototype.copyFieldInfo=function(e){je(e.dropdownItems)||(this.dropdownItems=e.dropdownItems),je(e.enabled)||(this.enabled=e.enabled),je(e.helpText)||(this.helpText=e.helpText)},hli.prototype.destroy=function(){this.dropdownItems=[],this.dropdownItems=void 0,ali.prototype.destroy.call(this)};var ali,lli=hli;function hli(){var e=null!==ali&&ali.apply(this,arguments)||this;return e.dropdownItems=[],e.selectedIndex=0,e}pJ(cli,dli=Xai),cli.prototype.getLength=function(){return this.text?this.text.length:0},cli.prototype.clone=function(){var e=new cli;if(e.characterFormat.copyFormat(this.characterFormat),e.text=this.text,this.margin&&(e.margin=this.margin.clone()),e.baselineOffset=this.baselineOffset,!je(this.paragraph)&&this.paragraph.isInHeaderFooter){if(0<this.revisions.length)for(var t=0;t<this.revisions.length;t++){var i=this.revisions[t];e.revisions.push(i.clone())}}else this.paragraph&&this.paragraph.isInsideTable&&this.paragraph.containerWidget instanceof Uai&&this.paragraph.containerWidget.ownerRow.rowFormat.isHeader?e.revisions=this.revisions:0<this.revisions.length?e.removedIds=Ari.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice();return e.width=this.width,e.height=this.height,this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e},cli.prototype.destroy=function(){this.text=void 0,dli.prototype.destroy.call(this)},cli.prototype.componentDestroy=function(){this.text=void 0,dli.prototype.componentDestroy.call(this)};var dli,pli=cli;function cli(){var e=dli.call(this)||this;return e.baselineOffset=0,e.text="",e.trimEndWidth=0,e.ignoreOnceItems=[],e.istextCombined=!1,e.scriptType=lJt.English,e.renderedFontFamily=void 0,e.errorCollection=[],e}gli.prototype.clear=function(){if(this.separator){for(var e=0;e<this.separator.length;e++)this.separator[e].destroy();this.separator=[]}if(this.continuationSeparator){for(e=0;e<this.continuationSeparator.length;e++)this.continuationSeparator[e].destroy();this.continuationSeparator=[]}if(this.continuationNotice){for(e=0;e<this.continuationNotice.length;e++)this.continuationNotice[e].destroy();this.continuationNotice=[]}},gli.prototype.destroy=function(){this.separator=[],this.continuationSeparator=[],this.continuationNotice=[]},gli.prototype.componentDestroy=function(){if(this.separator){for(var e=0;e<this.separator.length;e++)this.separator[e].componentDestroy();this.separator=[]}if(this.separator=void 0,this.continuationSeparator){for(e=0;e<this.continuationSeparator.length;e++)this.continuationSeparator[e].componentDestroy();this.continuationSeparator=[]}if(this.continuationSeparator=void 0,this.continuationNotice){for(e=0;e<this.continuationNotice.length;e++)this.continuationNotice[e].componentDestroy();this.continuationNotice=[]}this.continuationNotice=void 0};var uli=gli;function gli(){this.separator=[],this.continuationNotice=[],this.continuationSeparator=[]}pJ(yli,mli=pli),yli.prototype.clone=function(){var e=new yli;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;for(var t=0;t<this.bodyWidget.childWidgets.length;t++){var i=this.bodyWidget.childWidgets[t];(i instanceof Lai||i instanceof _ai)&&(i=this.bodyWidget.childWidgets[t].clone()),e.bodyWidget.childWidgets.push(i)}if(e.bodyWidget.page=this.bodyWidget.page,!je(this.paragraph)&&this.paragraph.isInHeaderFooter){if(0<this.revisions.length)for(t=0;t<this.revisions.length;t++){var n=this.revisions[t];e.revisions.push(n.clone())}}else 0<this.revisions.length?e.removedIds=Ari.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice();return this.margin&&(e.margin=this.margin.clone()),e},yli.prototype.getLength=function(){return 1},yli.prototype.destroy=function(){this.symbolCode="",this.symbolFontName="",this.customMarker=""},yli.prototype.componentDestroy=function(){this.characterFormat&&(this.characterFormat.destroy(),this.characterFormat=void 0),this.symbolCode="",this.symbolFontName="",this.customMarker="",this.bodyWidget&&this.bodyWidget.componentDestroy(),this.bodyWidget=void 0,mli.prototype.componentDestroy.call(this)};var mli,fli=yli;function yli(){var e=mli.call(this)||this;return e.isLayout=!1,e.bodyWidget=new Sai,e.bodyWidget.footNoteReference=e}pJ(wli,vli=pli),Object.defineProperty(wli.prototype,"start",{get:function(){return this.startIn},set:function(e){this.startIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(wli.prototype,"end",{get:function(){return this.endIn},set:function(e){this.endIn=e},enumerable:!0,configurable:!0}),wli.prototype.destroy=function(){this.start=void 0,this.end=void 0},wli.prototype.componentDestroy=function(){this.startIn&&this.startIn.destroy(),this.startIn=void 0,this.endIn&&this.endIn.destroy(),this.endIn=void 0,vli.prototype.componentDestroy.call(this)};var vli,bli=wli;function wli(){var e=vli.call(this)||this;return e.startIn=void 0,e.endIn=void 0,e}pJ(Ali,Cli=pli),Object.defineProperty(Ali.prototype,"text",{get:function(){return this.fieldText},set:function(e){this.fieldText=e},enumerable:!0,configurable:!0}),Ali.prototype.clone=function(){var e=new Ali;if(e.characterFormat.copyFormat(this.characterFormat),e.fieldBegin=this.fieldBegin,e.text=this.text,this.margin&&(e.margin=this.margin.clone()),!je(this.paragraph)&&this.paragraph.isInHeaderFooter){if(0<this.revisions.length)for(var t=0;t<this.revisions.length;t++){var i=this.revisions[t];e.revisions.push(i.clone())}}else 0<this.revisions.length?e.removedIds=Ari.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice();return e.width=this.width,e.height=this.height,e},Ali.prototype.componentDestroy=function(){this.fieldText=void 0,this.fieldBegin=void 0,Cli.prototype.componentDestroy.call(this)};var Cli,Sli=Ali;function Ali(){var e=Cli.call(this)||this;return e.fieldText="",e}pJ(Tli,xli=pli),Tli.prototype.destroy=function(){this.tabText=void 0,this.tabLeader=void 0},Tli.prototype.componentDestroy=function(){this.tabText=void 0,this.tabLeader=void 0,xli.prototype.componentDestroy.call(this)},Tli.prototype.clone=function(){var e=new Tli;if(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,!je(this.paragraph)&&this.paragraph.isInHeaderFooter){if(0<this.revisions.length)for(var t=0;t<this.revisions.length;t++){var i=this.revisions[t];e.revisions.push(i.clone())}}else 0<this.revisions.length?e.removedIds=Ari.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice();return e};var xli,Ili=Tli;function Tli(){var e=xli.call(this)||this;return e.tabText="",e.tabLeader="None",e}pJ(Mli,Eli=Xai),Object.defineProperty(Mli.prototype,"bookmarkType",{get:function(){return this.bookmarkTypeIn},enumerable:!0,configurable:!0}),Object.defineProperty(Mli.prototype,"properties",{get:function(){return this.propertiesIn},set:function(e){this.propertiesIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(Mli.prototype,"name",{get:function(){return this.nameIn},set:function(e){this.nameIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(Mli.prototype,"reference",{get:function(){return this.refereneceIn},set:function(e){this.refereneceIn=e},enumerable:!0,configurable:!0}),Mli.prototype.getLength=function(){return 1},Mli.prototype.destroy=function(){this.name=void 0,this.reference=void 0,this.bookmarkTypeIn=void 0},Mli.prototype.componentDestroy=function(){this.name=void 0,this.reference=void 0,this.bookmarkTypeIn=void 0,Eli.prototype.componentDestroy.call(this)},Mli.prototype.clone=function(){var e=new Mli(this.bookmarkType);return e.name=this.name,e.reference=this.reference,e.properties=this.properties,this.margin&&(e.margin=this.margin.clone()),0<this.revisions.length?e.removedIds=Ari.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice(),e.width=this.width,e.height=this.height,this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e};var Eli,Dli=Mli;function Mli(e){var t=Eli.call(this)||this;return t.bookmarkTypeIn=0,t.refereneceIn=void 0,t.nameIn="",t.bookmarkTypeIn=e,t}pJ(Bli,kli=Xai),Bli.prototype.getLength=function(){return 1},Bli.prototype.clone=function(){var e=new Bli(this.contentControlWidgetType);if(e.characterFormat.copyFormat(this.characterFormat),e.contentControlProperties=this.contentControlProperties,e.contentControlWidgetType=this.contentControlWidgetType,this.margin&&(e.margin=this.margin.clone()),!je(this.paragraph)&&this.paragraph.isInHeaderFooter){if(0<this.revisions.length)for(var t=0;t<this.revisions.length;t++){var i=this.revisions[t];e.revisions.push(i.clone())}}else 0<this.revisions.length?e.removedIds=Ari.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice();return e.type=this.type,e.width=this.width,e.height=this.height,e.reference=this.reference,e},Bli.prototype.destroy=function(){this.contentControlProperties=void 0,this.contentControlWidgetType=void 0,kli.prototype.destroy.call(this)},Bli.prototype.componentDestroy=function(){this.contentControlProperties&&(this.contentControlProperties.destroy(),this.contentControlProperties=void 0),this.contentControlWidgetType=void 0,kli.prototype.componentDestroy.call(this)};var kli,Pli=Bli;function Bli(e){var t=kli.call(this)||this;return t.contentControlWidgetType=e,t.contentControlProperties=new Fli(e),t}Lli.prototype.destroy=function(){this.characterFormat&&(this.characterFormat.destroy(),this.characterFormat=void 0),this.xmlMapping&&(this.xmlMapping.destroy(),this.xmlMapping=void 0),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},Lli.prototype.clone=function(){var e=new Lli(this.contentControlWidgetType);if(e.lockContentControl=this.lockContentControl,e.lockContents=this.lockContents,e.tag=this.tag,e.color=this.color,e.title=this.title,e.appearance=this.appearance,e.type=this.type,e.hasPlaceHolderText=this.hasPlaceHolderText,e.multiline=this.multiline,e.isTemporary=this.isTemporary,e.isChecked=this.isChecked,e.dateCalendarType=this.dateCalendarType,e.dateStorageFormat=this.dateStorageFormat,e.dateDisplayLocale=this.dateDisplayLocale,e.dateDisplayFormat=this.dateDisplayFormat,0<this.contentControlListItems.length)for(var t=0;t<this.contentControlListItems.length;t++)e.contentControlListItems.push(this.contentControlListItems[t].clone());return this.checkedState&&(e.checkedState=this.checkedState.clone()),this.uncheckedState&&(e.uncheckedState=this.uncheckedState.clone()),this.xmlMapping&&(e.xmlMapping=this.xmlMapping.clone()),e};var Fli=Lli;function Lli(e){this.contentControlListItems=[],this.contentControlWidgetType=e,this.characterFormat=new Eri}Oli.prototype.destroy=function(){this.displayText=void 0,this.value=void 0},Oli.prototype.clone=function(){var e=new Oli;return e.displayText=this.displayText,e.value=this.value,e};var Rli=Oli;function Oli(){}Vli.prototype.destroy=function(){this.font=void 0,this.value=void 0},Vli.prototype.clone=function(){var e=new Vli;return e.font=this.font,e.value=this.value,e};var Nli=Vli;function Vli(){}Hli.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},Hli.prototype.clone=function(){var e=new Hli;return e.isMapped=this.isMapped,e.isWordMl=this.isWordMl,e.prefixMapping=this.prefixMapping,e.xPath=this.xPath,e.storeItemId=this.storeItemId,this.customXmlPart&&(e.customXmlPart=this.customXmlPart.clone()),e};var _li=Hli;function Hli(){}jli.prototype.destroy=function(){this.id=void 0,this.xml=void 0},jli.prototype.clone=function(){var e=new jli;return e.id=this.id,e.xml=this.xml,e};var zli=jli;function jli(){}pJ(Qli,Wli=Xai),Qli.prototype.getLength=function(){return 1},Qli.prototype.clone=function(){return new Xli};var Wli,H$e=Qli;function Qli(){var e=null!==Wli&&Wli.apply(this,arguments)||this;return e.name="",e.alternateText="",e.title="",e}pJ(Gli,Uli=H$e);var Uli,qli=Gli;function Gli(){var e=null!==Uli&&Uli.apply(this,arguments)||this;return e.verticalPosition=0,e.horizontalPosition=0,e.textWrappingStyle="Inline",e.distanceBottom=0,e.distanceLeft=0,e.distanceRight=0,e.distanceTop=0,e}pJ(Kli,Yli=qli),Kli.prototype.clone=function(){var e=new Kli;if(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.alternateText=this.alternateText,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.heightRelativePercent=this.heightRelativePercent,e.widthRelativePercent=this.widthRelativePercent,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.editingPoints=this.editingPoints,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()),!je(this.paragraph)&&this.paragraph.isInHeaderFooter){if(0<this.revisions.length)for(var t=0;t<this.revisions.length;t++){var i=this.revisions[t];e.revisions.push(i.clone())}}else 0<this.revisions.length?e.removedIds=Ari.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice();return e};var Yli,Xli=Kli;function Kli(){return null!==Yli&&Yli.apply(this,arguments)||this}pJ($li,Jli=fai),$li.prototype.equals=function(){return!1},$li.prototype.destroyInternal=function(){},$li.prototype.getHierarchicalIndex=function(e){var t=this.containerShape.line,i=t.getOffset(this.containerShape,0).toString();return t.getHierarchicalIndex(i)},$li.prototype.getTableCellWidget=function(){},$li.prototype.clone=function(){var e=new $li;e.textVerticalAlignment=this.textVerticalAlignment,e.marginBottom=this.marginBottom,e.marginLeft=this.marginLeft,e.marginRight=this.marginRight,e.marginTop=this.marginTop;for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t].clone();e.childWidgets.push(i),i.index=t,i.containerWidget=e}return e};var Jli,Zli=$li;function $li(){var e=null!==Jli&&Jli.apply(this,arguments)||this;return e.marginLeft=0,e.marginRight=0,e.marginTop=0,e.marginBottom=0,e}thi.prototype.clone=function(){var e=new thi;return e.lineFormatType=this.lineFormatType,e.color=this.color,e.weight=this.weight,e.dashStyle=this.dashStyle,e.line=this.line,e};var ehi=thi;function thi(){}nhi.prototype.clone=function(){var e=new nhi;return e.color=this.color,e.fill=this.fill,e};var ihi=nhi;function nhi(){}pJ(shi,ohi=qli),Object.defineProperty(shi.prototype,"isCrop",{get:function(){return this.crop},set:function(e){var t;(this.crop=e)&&((t=e=0)!==this.left?this.cropX=this.left*this.cropWidthScale/100:this.cropX=0,0!==this.top?this.cropY=this.top*this.cropHeightScale/100:this.cropY=0,0!==this.right&&(e=this.right*this.cropWidthScale/100),0!==this.bottom&&(t=this.bottom*this.cropHeightScale/100),this.cropWidth=this.cropWidthScale-(this.cropX+e),this.cropHeight=this.cropHeightScale-(this.cropY+t))},enumerable:!0,configurable:!0}),Object.defineProperty(shi.prototype,"isInlineImage",{get:function(){return this.isInlineImageIn},enumerable:!0,configurable:!0}),Object.defineProperty(shi.prototype,"element",{get:function(){return je(this.imgElement)&&(this.imgElement=document.createElement("img")),this.imgElement},enumerable:!0,configurable:!0}),Object.defineProperty(shi.prototype,"length",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(shi.prototype,"imageString",{get:function(){return this.imageStr},set:function(e){this.imageStr=e},enumerable:!0,configurable:!0}),shi.prototype.getLength=function(){return 1},shi.prototype.clone=function(){var e=new shi(this.isInlineImage);if(e.characterFormat.copyFormat(this.characterFormat),e.imageString=this.imageString,e.element.src=this.element.src,e.isMetaFile=this.isMetaFile,e.isCompressed=this.isCompressed,e.metaFileImageString=this.metaFileImageString,e.width=this.width,e.height=this.height,e.top=this.top,e.left=this.left,e.bottom=this.bottom,e.right=this.right,e.cropHeightScale=this.cropHeightScale,e.cropWidthScale=this.cropWidthScale,e.cropX=this.cropX,e.cropY=this.cropY,e.isCrop=this.isCrop,e.x=this.x,e.y=this.y,this.margin&&(e.margin=this.margin.clone()),!je(this.paragraph)&&this.paragraph.isInHeaderFooter){if(0<this.revisions.length)for(var t=0;t<this.revisions.length;t++){var i=this.revisions[t];e.revisions.push(i.clone())}}else 0<this.revisions.length?e.removedIds=Ari.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice();return e.name=this.name,e.alternateText=this.alternateText,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},shi.prototype.destroy=function(){this.imgElement=void 0,this.imageString=void 0,this.isInlineImageIn=void 0,ohi.prototype.destroy.call(this)};var ohi,rhi=shi;function shi(e){var t=ohi.call(this)||this;return t.imageStr="",t.imgElement=void 0,t.isInlineImageIn=!0,t.crop=!1,t.left=0,t.top=0,t.right=0,t.bottom=0,t.isMetaFile=!1,t.isCompressed=!1,t.isInlineImageIn=e,t}pJ(hhi,ahi=Xai),hhi.prototype.getLength=function(){return this.text?this.text.length:0},hhi.prototype.clone=function(){var e=new hhi(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},hhi.prototype.destroy=function(){this.text=void 0,ahi.prototype.destroy.call(this)};var ahi,lhi=hhi;function hhi(e,t){var i=ahi.call(this)||this;return i.baselineOffset=0,i.trimEndWidth=0,i.isFollowCharacter=!1,i.listLevel=e,i.isFollowCharacter=t,i}pJ(chi,dhi=Xai),chi.prototype.getLength=function(){return 1},chi.prototype.destroy=function(){this.editRangeStart=void 0},chi.prototype.clone=function(){var e=new chi;return this.editRangeStart&&(this.editRangeStart.editRangeEnd=e),e.editRangeStart=this.editRangeStart,e.editRangeId=this.editRangeId,e};var dhi,phi=chi;function chi(){var e=dhi.call(this)||this;return e.editRangeStart=void 0,e.editRangeId=-1,e}pJ(mhi,uhi=Xai),mhi.prototype.getLength=function(){return 1},mhi.prototype.renderLockMark=function(e,t){var i;je(this.editRangeMark)&&(e=e===this.user?"you":this.user,this.editRangeMark=document.createElement("div"),this.editRangeMark.style.display="none",this.editRangeMark.classList.add("e-de-lock-mark"),(i=document.createElement("span")).className="e-icons e-de-ctnr-lock",this.editRangeMark.appendChild(i),this.editRangeMark.title=t.getConstant("This region is locked by")+" "+e),this.line&&je(this.editRangeMark.parentElement)&&this.line.paragraph.bodyWidget.page.documentHelper.pageContainer.appendChild(this.editRangeMark)},mhi.prototype.removeEditRangeMark=function(){this.editRangeMark&&(this.editRangeMark.parentElement.removeChild(this.editRangeMark),this.editRangeMark=void 0)},mhi.prototype.destroy=function(){this.user=void 0,this.columnFirst=void 0,this.columnLast=void 0},mhi.prototype.clone=function(){var e=new mhi;return e.columnFirst=this.columnFirst,e.columnLast=this.columnLast,e.user=this.user,e.group=this.group,this.editRangeEnd&&(this.editRangeEnd.editRangeStart=e),e.editRangeEnd=this.editRangeEnd,e.editRangeId=this.editRangeId,e};var uhi,ghi=mhi;function mhi(){var e=uhi.call(this)||this;return e.columnFirst=-1,e.columnLast=-1,e.user="",e.group="",e.editRangeId=-1,e}pJ(vhi,fhi=rhi),vhi.prototype.getLength=function(){return 1},Object.defineProperty(vhi.prototype,"title",{get:function(){return this.chartTitle},set:function(e){this.chartTitle=e},enumerable:!0,configurable:!0}),Object.defineProperty(vhi.prototype,"type",{get:function(){return this.chartType},set:function(e){this.chartType=e},enumerable:!0,configurable:!0}),Object.defineProperty(vhi.prototype,"chartGapWidth",{get:function(){return this.gapWidth},set:function(e){this.gapWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(vhi.prototype,"chartOverlap",{get:function(){return this.overlap},set:function(e){this.overlap=e},enumerable:!0,configurable:!0}),Object.defineProperty(vhi.prototype,"targetElement",{get:function(){return je(this.div)&&(this.div=Q("div")),this.div},enumerable:!0,configurable:!0}),Object.defineProperty(vhi.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}),vhi.prototype.onChartLoaded=function(){var t=this;this.officeChart.convertChartToImage(this.officeChart.chart,this.width,this.height).then(function(e){t.imageString=e,t.element.src=e})},vhi.prototype.clone=function(){var e=new vhi;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(var t=0;t<this.chartCategory.length;t++){var i=this.chartCategory[t].clone();e.chartCategory.push(i)}for(t=0;t<this.chartSeries.length;t++){var n=this.chartSeries[t].clone();e.chartSeries.push(n)}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},vhi.prototype.destroy=function(){fhi.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};var fhi,yhi=vhi;function vhi(){var e=fhi.call(this)||this;return e.chartTitle="",e.chartType="",e.chartElement=void 0,e.chartCategory=[],e.chartSeries=[],e.chartArea=new bhi,e.chartPlotArea=new bhi,e.chartTitleArea=new Nhi,e.chartLegend=new Ihi,e.chartPrimaryCategoryAxis=new Uhi,e.chartPrimaryValueAxis=new Uhi,e.chartDataTable=new Ghi,e}Object.defineProperty(whi.prototype,"chartForeColor",{get:function(){return this.foreColor},set:function(e){this.foreColor=e},enumerable:!0,configurable:!0}),whi.prototype.clone=function(){var e=new whi;return e.foreColor=this.foreColor,e},whi.prototype.destroy=function(){this.foreColor=void 0};var bhi=whi;function whi(){}Object.defineProperty(Shi.prototype,"xName",{get:function(){return this.categoryXName},set:function(e){this.categoryXName=e},enumerable:!0,configurable:!0}),Shi.prototype.clone=function(){var e=new Shi;e.categoryXName=this.categoryXName;for(var t=0;t<this.chartData.length;t++){var i=this.chartData[t].clone();e.chartData.push(i)}return e},Shi.prototype.destroy=function(){this.categoryXName=void 0,this.chartData=[]};var Chi=Shi;function Shi(){this.categoryXName="",this.chartData=[]}Object.defineProperty(xhi.prototype,"yAxisValue",{get:function(){return this.yValue},set:function(e){this.yValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(xhi.prototype,"xAxisValue",{get:function(){return this.xValue},set:function(e){this.xValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(xhi.prototype,"bubbleSize",{get:function(){return this.size},set:function(e){this.size=e},enumerable:!0,configurable:!0}),xhi.prototype.clone=function(){var e=new xhi;return e.yValue=this.yValue,e.xValue=this.xValue,e.size=this.size,e},xhi.prototype.destroy=function(){this.xValue=void 0,this.yValue=void 0,this.size=void 0};var Ahi=xhi;function xhi(){}Object.defineProperty(Thi.prototype,"chartLegendPostion",{get:function(){return this.legendPostion},set:function(e){this.legendPostion=e},enumerable:!0,configurable:!0}),Thi.prototype.clone=function(){var e=new Thi;return e.legendPostion=this.legendPostion,e.chartTitleArea=this.chartTitleArea.clone(),e},Thi.prototype.destroy=function(){this.legendPostion=void 0,this.chartTitleArea=void 0};var Ihi=Thi;function Thi(){this.chartTitleArea=new Nhi}Object.defineProperty(Dhi.prototype,"seriesName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!0,configurable:!0}),Object.defineProperty(Dhi.prototype,"firstSliceAngle",{get:function(){return this.sliceAngle},set:function(e){this.sliceAngle=e},enumerable:!0,configurable:!0}),Object.defineProperty(Dhi.prototype,"doughnutHoleSize",{get:function(){return this.holeSize},set:function(e){this.holeSize=e},enumerable:!0,configurable:!0}),Dhi.prototype.clone=function(){var e=new Dhi;e.name=this.name,e.sliceAngle=this.sliceAngle,e.holeSize=this.holeSize,e.errorBar=this.errorBar.clone(),e.dataLabels=this.dataLabels.clone(),e.seriesFormat=this.seriesFormat.clone();for(var t=0;t<this.chartDataFormat.length;t++){var i=this.chartDataFormat[t].clone();e.chartDataFormat.push(i)}for(t=0;t<this.trendLines.length;t++){var n=this.trendLines[t].clone();e.trendLines.push(n)}return e},Dhi.prototype.destroy=function(){this.name=void 0,this.errorBar=void 0,this.trendLines=void 0,this.chartDataFormat=[]};var Ehi=Dhi;function Dhi(){this.chartDataFormat=[],this.trendLines=[],this.errorBar=new Mhi,this.dataLabels=new Fhi,this.seriesFormat=new Phi}Object.defineProperty(khi.prototype,"errorType",{get:function(){return this.type},set:function(e){this.type=e},enumerable:!0,configurable:!0}),Object.defineProperty(khi.prototype,"errorDirection",{get:function(){return this.direction},set:function(e){this.direction=e},enumerable:!0,configurable:!0}),Object.defineProperty(khi.prototype,"errorEndStyle",{get:function(){return this.endStyle},set:function(e){this.endStyle=e},enumerable:!0,configurable:!0}),Object.defineProperty(khi.prototype,"numberValue",{get:function(){return this.errorValue},set:function(e){this.errorValue=e},enumerable:!0,configurable:!0}),khi.prototype.clone=function(){var e=new khi;return e.type=this.type,e.errorDirection=this.errorDirection,e.endStyle=this.endStyle,e.errorValue=this.errorValue,e},khi.prototype.destroy=function(){this.type=void 0,this.errorDirection=void 0,this.endStyle=void 0};var Mhi=khi;function khi(){}Object.defineProperty(Bhi.prototype,"markerStyle",{get:function(){return this.style},set:function(e){this.style=e},enumerable:!0,configurable:!0}),Object.defineProperty(Bhi.prototype,"markerColor",{get:function(){return this.color},set:function(e){this.color=e},enumerable:!0,configurable:!0}),Object.defineProperty(Bhi.prototype,"numberValue",{get:function(){return this.size},set:function(e){this.size=e},enumerable:!0,configurable:!0}),Bhi.prototype.clone=function(){var e=new Bhi;return e.style=this.style,e.color=this.color,e.size=this.size,e},Bhi.prototype.destroy=function(){this.style=void 0,this.color=void 0,this.size=void 0};var Phi=Bhi;function Bhi(){}Object.defineProperty(Lhi.prototype,"labelPosition",{get:function(){return this.position},set:function(e){this.position=e},enumerable:!0,configurable:!0}),Object.defineProperty(Lhi.prototype,"fontName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!0,configurable:!0}),Object.defineProperty(Lhi.prototype,"fontColor",{get:function(){return this.color},set:function(e){this.color=e},enumerable:!0,configurable:!0}),Object.defineProperty(Lhi.prototype,"fontSize",{get:function(){return this.size},set:function(e){this.size=e},enumerable:!0,configurable:!0}),Object.defineProperty(Lhi.prototype,"isLegendKey",{get:function(){return this.isLegend},set:function(e){this.isLegend=e},enumerable:!0,configurable:!0}),Object.defineProperty(Lhi.prototype,"isBubbleSize",{get:function(){return this.isBubble},set:function(e){this.isBubble=e},enumerable:!0,configurable:!0}),Object.defineProperty(Lhi.prototype,"isCategoryName",{get:function(){return this.isCategory},set:function(e){this.isCategory=e},enumerable:!0,configurable:!0}),Object.defineProperty(Lhi.prototype,"isSeriesName",{get:function(){return this.isSeries},set:function(e){this.isSeries=e},enumerable:!0,configurable:!0}),Object.defineProperty(Lhi.prototype,"isValue",{get:function(){return this.isValueEnabled},set:function(e){this.isValueEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(Lhi.prototype,"isPercentage",{get:function(){return this.isPercentageEnabled},set:function(e){this.isPercentageEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(Lhi.prototype,"isLeaderLines",{get:function(){return this.showLeaderLines},set:function(e){this.showLeaderLines=e},enumerable:!0,configurable:!0}),Lhi.prototype.clone=function(){var e=new Lhi;return e.position=this.position,e.name=this.name,e.color=this.color,e.size=this.size,e.isBubble=this.isBubble,e.isLegend=this.isLegend,e.isCategory=this.isCategory,e.isSeries=this.isSeries,e.isValueEnabled=this.isValueEnabled,e.isPercentageEnabled=this.isPercentageEnabled,e.showLeaderLines=this.showLeaderLines,e},Lhi.prototype.destroy=function(){this.position=void 0};var Fhi=Lhi;function Lhi(){}Object.defineProperty(Ohi.prototype,"trendLineType",{get:function(){return this.type},set:function(e){this.type=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ohi.prototype,"trendLineName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ohi.prototype,"interceptValue",{get:function(){return this.intercept},set:function(e){this.intercept=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ohi.prototype,"forwardValue",{get:function(){return this.forward},set:function(e){this.forward=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ohi.prototype,"backwardValue",{get:function(){return this.backward},set:function(e){this.backward=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ohi.prototype,"isDisplayRSquared",{get:function(){return this.displayRSquared},set:function(e){this.displayRSquared=e},enumerable:!0,configurable:!0}),Object.defineProperty(Ohi.prototype,"isDisplayEquation",{get:function(){return this.displayEquation},set:function(e){this.displayEquation=e},enumerable:!0,configurable:!0}),Ohi.prototype.clone=function(){var e=new Ohi;return e.type=this.type,e.name=this.name,e.forward=this.forward,e.backward=this.backward,e.intercept=this.intercept,e.displayEquation=this.displayEquation,e.displayRSquared=this.displayRSquared,e},Ohi.prototype.destroy=function(){this.type=void 0,this.name=void 0,this.forward=void 0,this.backward=void 0};var Rhi=Ohi;function Ohi(){}Object.defineProperty(Vhi.prototype,"chartfontName",{get:function(){return this.fontName},set:function(e){this.fontName=e},enumerable:!0,configurable:!0}),Object.defineProperty(Vhi.prototype,"chartFontSize",{get:function(){return this.fontSize},set:function(e){this.fontSize=e},enumerable:!0,configurable:!0}),Vhi.prototype.clone=function(){var e=new Vhi;return e.fontName=this.fontName,e.fontSize=this.fontSize,e.dataFormat=this.dataFormat.clone(),e.layout=this.layout.clone(),e},Vhi.prototype.destroy=function(){this.fontName=void 0,this.fontSize=void 0,this.dataFormat=void 0,this.layout=void 0};var Nhi=Vhi;function Vhi(){this.dataFormat=new _hi,this.layout=new Whi}Hhi.prototype.clone=function(){var e=new Hhi;return e.fill=this.fill.clone(),e.line=this.line.clone(),e},Hhi.prototype.destroy=function(){this.fill=void 0,this.line=void 0};var _hi=Hhi;function Hhi(){this.fill=new zhi,this.line=new zhi}Object.defineProperty(jhi.prototype,"color",{get:function(){return this.fillColor},set:function(e){this.fillColor=e},enumerable:!0,configurable:!0}),Object.defineProperty(jhi.prototype,"rgb",{get:function(){return this.fillRGB},set:function(e){this.fillRGB=e},enumerable:!0,configurable:!0}),jhi.prototype.clone=function(){var e=new jhi;return e.fillColor=this.fillColor,e.fillRGB=this.fillRGB,e},jhi.prototype.destroy=function(){this.fillColor=void 0,this.fillRGB=void 0};var zhi=jhi;function jhi(){}Object.defineProperty(Qhi.prototype,"chartLayoutLeft",{get:function(){return this.layoutX},set:function(e){this.layoutX=e},enumerable:!0,configurable:!0}),Object.defineProperty(Qhi.prototype,"chartLayoutTop",{get:function(){return this.layoutY},set:function(e){this.layoutY=e},enumerable:!0,configurable:!0}),Qhi.prototype.clone=function(){var e=new Qhi;return e.layoutX=this.layoutX,e.layoutY=this.layoutY,e},Qhi.prototype.destroy=function(){this.layoutX=void 0,this.layoutY=void 0};var Whi=Qhi;function Qhi(){}Object.defineProperty(qhi.prototype,"majorTick",{get:function(){return this.majorTickMark},set:function(e){this.majorTickMark=e},enumerable:!0,configurable:!0}),Object.defineProperty(qhi.prototype,"minorTick",{get:function(){return this.minorTickMark},set:function(e){this.minorTickMark=e},enumerable:!0,configurable:!0}),Object.defineProperty(qhi.prototype,"tickPosition",{get:function(){return this.tickLabelPostion},set:function(e){this.tickLabelPostion=e},enumerable:!0,configurable:!0}),Object.defineProperty(qhi.prototype,"minorGridLines",{get:function(){return this.hasMinorGridLines},set:function(e){this.hasMinorGridLines=e},enumerable:!0,configurable:!0}),Object.defineProperty(qhi.prototype,"majorGridLines",{get:function(){return this.hasMajorGridLines},set:function(e){this.hasMajorGridLines=e},enumerable:!0,configurable:!0}),Object.defineProperty(qhi.prototype,"interval",{get:function(){return this.majorUnit},set:function(e){this.majorUnit=e},enumerable:!0,configurable:!0}),Object.defineProperty(qhi.prototype,"isAutoInternal",{get:function(){return this.isAutoMajor},set:function(e){this.isAutoMajor=e},enumerable:!0,configurable:!0}),Object.defineProperty(qhi.prototype,"max",{get:function(){return this.maximumValue},set:function(e){this.maximumValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(qhi.prototype,"min",{get:function(){return this.minimumValue},set:function(e){this.minimumValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(qhi.prototype,"categoryAxisTitle",{get:function(){return this.title},set:function(e){this.title=e},enumerable:!0,configurable:!0}),Object.defineProperty(qhi.prototype,"categoryAxisType",{get:function(){return this.categoryType},set:function(e){this.categoryType=e},enumerable:!0,configurable:!0}),Object.defineProperty(qhi.prototype,"categoryNumberFormat",{get:function(){return this.numberFormat},set:function(e){this.numberFormat=e},enumerable:!0,configurable:!0}),Object.defineProperty(qhi.prototype,"axisFontSize",{get:function(){return this.fontSize},set:function(e){this.fontSize=e},enumerable:!0,configurable:!0}),Object.defineProperty(qhi.prototype,"axisFontName",{get:function(){return this.fontName},set:function(e){this.fontName=e},enumerable:!0,configurable:!0}),qhi.prototype.clone=function(){var e=new qhi;return e.title=this.title,e.categoryType=this.categoryType,e.numberFormat=this.numberFormat,e.fontSize=this.fontSize,e.fontName=this.fontName,e.hasMajorGridLines=this.hasMajorGridLines,e.hasMinorGridLines=this.hasMinorGridLines,e.minimumValue=this.minimumValue,e.maximumValue=this.maximumValue,e.majorUnit=this.majorUnit,e.isAutoMajor=this.isAutoMajor,e.majorTickMark=this.majorTickMark,e.minorTickMark=this.minorTickMark,e.tickLabelPostion=this.tickLabelPostion,e.chartTitleArea=this.chartTitleArea.clone(),e},qhi.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};var Uhi=qhi;function qhi(){this.chartTitleArea=new Nhi}Object.defineProperty(Yhi.prototype,"showSeriesKeys",{get:function(){return this.isSeriesKeys},set:function(e){this.isSeriesKeys=e},enumerable:!0,configurable:!0}),Object.defineProperty(Yhi.prototype,"hasHorzBorder",{get:function(){return this.isHorzBorder},set:function(e){this.isHorzBorder=e},enumerable:!0,configurable:!0}),Object.defineProperty(Yhi.prototype,"hasVertBorder",{get:function(){return this.isVertBorder},set:function(e){this.isVertBorder=e},enumerable:!0,configurable:!0}),Object.defineProperty(Yhi.prototype,"hasBorders",{get:function(){return this.isBorders},set:function(e){this.isBorders=e},enumerable:!0,configurable:!0}),Yhi.prototype.clone=function(){var e=new Yhi;return e.isSeriesKeys=this.isSeriesKeys,e.isHorzBorder=this.isHorzBorder,e.isVertBorder=this.isVertBorder,e.isBorders=this.isBorders,e},Yhi.prototype.destroy=function(){this.isSeriesKeys=void 0,this.isHorzBorder=void 0,this.isVertBorder=void 0,this.isBorders=void 0};var Ghi=Yhi;function Yhi(){}pJ(Jhi,Xhi=Xai),Object.defineProperty(Jhi.prototype,"comment",{get:function(){return this.commentInternal},set:function(e){this.commentInternal=e},enumerable:!0,configurable:!0}),Jhi.prototype.getLength=function(){return 1},Jhi.prototype.clone=function(){var e=new Jhi(this.commentType);return e.commentId=this.commentId,e.commentType=this.commentType,je(this.commentInternal)||(e.commentInternal=this.commentInternal.clone()),e},Jhi.prototype.renderCommentMark=function(e,t){for(var i,n,o=this.line.paragraph.bodyWidget.page.documentHelper,r=o.render.commentMarkDictionary,s=(0===this.commentType&&je(this.commentMark)&&(this.commentMark=document.createElement("div"),this.commentMark.style.display="none",this.commentMark.classList.add("e-de-cmt-mark"),(i=document.createElement("span")).classList.add("e-icons"),i.classList.add("e-de-cmt-mark-icon"),this.commentMark.appendChild(i)),this.line&&je(this.commentMark.parentElement)&&(o.pageContainer.appendChild(this.commentMark),this.commentMark.addEventListener("click",this.selectComment.bind(this))),!1),a=0;a<r.length;a++)if(this.elementsOverlap(r.keys[a],e,t)){s=!0,n=r.keys[a];break}if(s){for(var l=!0,a=0;a<r.get(n).length;a++)if(r.get(n)[a]===this){l=!1;break}l&&r.get(n).push(this)}else r.add(this.commentMark,[this]);for(a=0;a<r.length;a++){var h=r.keys[a];if(1==r.get(h).length&&r.get(h)[0].commentMark&&(r.get(h)[0].commentMark.firstElementChild.classList.contains("e-de-multi-cmt-mark")?mt(r.get(h)[0].commentMark.firstElementChild,["e-de-cmt-mark-icon"],["e-de-multi-cmt-mark"]):r.get(h)[0].commentInternal.isResolved&&r.get(h)[0].commentMark.firstElementChild.classList.contains("e-de-cmt-mark-icon")?mt(r.get(h)[0].commentMark.firstElementChild,["e-de-cmt-resolve-icon"],["e-de-cmt-mark-icon"]):!r.get(h)[0].commentInternal.isResolved&&r.get(h)[0].commentMark.firstElementChild.classList.contains("e-de-cmt-resolve-icon")&&mt(r.get(h)[0].commentMark.firstElementChild,["e-de-cmt-mark-icon"],["e-de-cmt-resolve-icon"])),1<r.get(h).length)for(var d=0;d<r.get(h).length;d++){for(var p=!0,c=0;c<r.get(h).length;c++)if(r.get(h)[c].commentInternal&&!r.get(h)[c].commentInternal.isResolved){p=!1;break}r.get(h)[d].commentMark&&(r.get(h)[d].commentMark.firstElementChild.classList.contains("e-de-cmt-mark-icon")?mt(r.get(h)[d].commentMark.firstElementChild,["e-de-multi-cmt-mark"],["e-de-cmt-mark-icon"]):!p&&r.get(h)[d].commentMark.firstElementChild.classList.contains("e-de-multi-cmt-resolve")?mt(r.get(h)[d].commentMark.firstElementChild,["e-de-multi-cmt-mark"],["e-de-multi-cmt-resolve"]):p&&mt(r.get(h)[d].commentMark.firstElementChild,["e-de-multi-cmt-resolve"],["e-de-multi-cmt-mark"]))}}},Jhi.prototype.elementsOverlap=function(e,t,i){var n=e.offsetWidth,o=e.offsetHeight,r=parseFloat(e.style.top),e=parseFloat(e.style.left),s=r+o,a=e+n,t=parseFloat(t),i=parseFloat(i);return!(t+o<r||a<i||s<t||i+n<e)},Jhi.prototype.selectComment=function(){for(var e=this.line.paragraph.bodyWidget.page.documentHelper,t=e.render.commentMarkDictionary,i=this.commentMark.style.top,n=this.commentMark.style.left,o=0,r=[],s=0;s<t.keys.length;s++)if(this.elementsOverlap(t.keys[s],i,n)){r=t.get(t.keys[s]);break}if(e.owner.documentHelper.currentSelectedComment){for(s=0;s<r.length;s++)if(r[s].comment===e.owner.documentHelper.currentSelectedComment){o=s;break}o<r.length-1?o+=1:o=0}else o=0;e.owner&&(e.owner.commentReviewPane.commentPane.isEditMode?e.owner.showComments=!0:e.selectComment(r[o].comment))},Jhi.prototype.removeCommentMark=function(){this.commentMark&&this.commentMark.parentElement&&(this.commentMark.removeEventListener("click",this.selectComment.bind(this)),this.commentMark.parentElement.removeChild(this.commentMark))},Jhi.prototype.destroy=function(){this.commentMark&&this.removeCommentMark(),this.commentMark=void 0,this.commentInternal=void 0,this.commentId=void 0,Xhi.prototype.componentDestroy.call(this)};var Xhi,Khi=Jhi;function Jhi(e){var t=Xhi.call(this)||this;return t.commentType=0,t.commentId="",t.commentType=e,t}pJ(edi,Zhi=Khi),Object.defineProperty(edi.prototype,"commentStart",{get:function(){return this.commentStartIn},set:function(e){this.commentStartIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(edi.prototype,"commentEnd",{get:function(){return this.commentEndIn},set:function(e){this.commentEndIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(edi.prototype,"author",{get:function(){return this.authorIn},set:function(e){this.authorIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(edi.prototype,"initial",{get:function(){return this.initialIn},set:function(e){this.initialIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(edi.prototype,"isResolved",{get:function(){return this.done},set:function(e){this.done=e},enumerable:!0,configurable:!0}),Object.defineProperty(edi.prototype,"date",{get:function(){return this.createdDate},enumerable:!0,configurable:!0}),Object.defineProperty(edi.prototype,"text",{get:function(){return this.textIn},set:function(e){this.textIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(edi.prototype,"mentions",{get:function(){return this.mentionsIn},set:function(e){this.mentionsIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(edi.prototype,"isPosted",{get:function(){return this.posted},set:function(e){this.posted=e},enumerable:!0,configurable:!0}),edi.prototype.getLength=function(){return 1},edi.prototype.clone=function(){var e=new edi(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},edi.prototype.destroy=function(){if(this.replyComments&&0<this.replyComments.length){for(var e=0;e<this.replyComments.length;e++)this.replyComments[e].destroy();this.replyComments=[]}this.replyComments=void 0,this.commentStartIn&&(this.commentStartIn.destroy(),this.commentStartIn=void 0),this.commentEndIn&&(this.commentEndIn.destroy(),this.commentEndIn=void 0),this.commentId=void 0,this.createdDate=void 0,this.initialIn=void 0,this.textIn=void 0,this.authorIn=void 0,this.ownerComment=void 0,Zhi.prototype.destroy.call(this)};var Zhi,$hi=edi;function edi(e){var t=Zhi.call(this,0)||this;return t.authorIn="",t.initialIn="",t.done=!1,t.posted=!1,t.textIn="",t.isReply=!1,t.ownerComment=void 0,t.mentionsIn=[],t.createdDate=e,t.replyComments=[],t}Object.defineProperty(idi.prototype,"headerWidget",{get:function(){return!je(this.headerWidgetIn)&&this.headerWidgetIn.parentHeaderFooter?this.headerWidgetIn.parentHeaderFooter:this.headerWidgetIn},set:function(e){this.headerWidgetIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(idi.prototype,"footerWidget",{get:function(){return!je(this.footerWidgetIn)&&this.footerWidgetIn.parentHeaderFooter?this.footerWidgetIn.parentHeaderFooter:this.footerWidgetIn},set:function(e){this.footerWidgetIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(idi.prototype,"index",{get:function(){return this.documentHelper?this.documentHelper.pages.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(idi.prototype,"previousPage",{get:function(){var e=this.index;if(0<e)return this.documentHelper.pages[e-1]},enumerable:!0,configurable:!0}),Object.defineProperty(idi.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(idi.prototype,"sectionIndex",{get:function(){return 0<this.bodyWidgets.length?this.bodyWidgets[0].index:-1},enumerable:!0,configurable:!0}),Object.defineProperty(idi.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),idi.prototype.destroy=function(){this.headerWidget&&this.headerWidget.page===this&&(this.headerWidget.page=void 0),this.footerWidget&&this.footerWidget.page===this&&(this.footerWidget.page=void 0),this.headerWidgetIn&&!je(this.headerWidgetIn.parentHeaderFooter)&&(this.viewer&&this.documentHelper.owner.editorModule&&(this.documentHelper.owner.editorModule.removeFieldInWidget(this.headerWidgetIn),this.documentHelper.owner.editorModule.removeFieldInWidget(this.headerWidgetIn,!1,!0)),this.headerWidgetIn.destroy(),this.headerWidget=void 0),this.footerWidgetIn&&!je(this.footerWidgetIn.parentHeaderFooter)&&(this.viewer&&this.documentHelper.owner.editorModule&&(this.documentHelper.owner.editorModule.removeFieldInWidget(this.footerWidgetIn),this.documentHelper.owner.editorModule.removeFieldInWidget(this.footerWidgetIn,!1,!0)),this.footerWidgetIn.destroy(),this.footerWidgetIn=void 0),this.bodyWidgets=[],this.bodyWidgets=void 0,je(this.documentHelper)||je(this.documentHelper.pages)||this.documentHelper.removePage(this),this.documentHelper=void 0},idi.prototype.componentDestroy=function(){if(this.headerWidgetIn&&(this.headerWidgetIn.componentDestroy(),this.headerWidgetIn=void 0),this.footerWidgetIn&&(this.footerWidgetIn.componentDestroy(),this.footerWidgetIn=void 0),this.bodyWidgets){for(var e=0;e<this.bodyWidgets.length;e++)this.bodyWidgets[e].componentDestroy();this.bodyWidgets=[],this.bodyWidgets=void 0}this.documentHelper=void 0};var tdi=idi;function idi(e){this.boundingRectangle=new pai(96,96,816,1056),this.repeatHeaderRowTableWidget=!1,this.bodyWidgets=[],this.headerWidgetIn=void 0,this.footerWidgetIn=void 0,this.footnoteWidget=void 0,this.endnoteWidget=void 0,this.currentPageNum=1,this.allowNextPageRendering=!0,this.documentHelper=e}Object.defineProperty(odi.prototype,"columns",{get:function(){return this.tableColumns},enumerable:!0,configurable:!0}),odi.prototype.resetColumns=function(){for(var e=0;e<this.tableColumns.length;e++)this.tableColumns[e].destroy();this.tableColumns=[]},odi.prototype.getPreviousSpannedCellWidth=function(e,t){for(var i=0,n=e;n<t;n++)i+=this.tableColumns[n].preferredWidth;return i},odi.prototype.addColumns=function(e,t,i,n,o,r){for(var s=this.columns.length;s<t;s++)this.columns.push(new rdi);for(var a=0,l=e;l<t;l++)a+=this.columns[l].preferredWidth;!(1<t-e)&&a<i&&(this.columns[t-1].preferredWidth+=i-a),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),o>this.columns[t-1].endOffset&&(this.columns[t-1].endOffset=o),this.columns[t-1].widthType=r},odi.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},odi.prototype.isFitColumns=function(e,t,i){var n=this.getTotalWidth(0);if(this.tableWidth=i&&n<t?n:t,n!==this.tableWidth)for(var o=this.tableWidth/n,o=isNaN(o)||o==1/0?1:o,r=0;r<this.columns.length;r++){var s=this.columns[r];if(o*s.preferredWidth<s.minWidth)return!1}return!0},odi.prototype.isAllColumnHasPointWidthType=function(){for(var e=!0,t=0;t<this.columns.length;t++)"Point"!=this.columns[t].widthType&&(e=!1);return e},odi.prototype.autoFitColumn=function(e,t,i,n,o,r,s,a,l){for(var h=0,d=0,p=0,c=this.columns.every(function(e){return"Point"===e.widthType}),u=0,g=[],m=this.getTotalWidth(0),f=!i&&"Point"===l&&c&&!r&&Y.round(t,2)<Y.round(m,2),y=0;y<this.columns.length;y++){0===(S=this.columns[y]).minimumWordWidth&&0===S.maximumWordWidth&&0===S.minWidth&&(S.minimumWordWidth=S.preferredWidth,S.maximumWordWidth=S.preferredWidth,S.minWidth=S.preferredWidth),f&&(this.columns[y].preferredWidth=this.columns[y].preferredWidth/m*t);var v=0,b=(h+=S.preferredWidth>S.maximumWordWidth?S.preferredWidth:S.maximumWordWidth,d+=S.preferredWidth>S.minimumWordWidth?S.preferredWidth:S.minimumWordWidth,0!==S.preferredWidth&&S.preferredWidth>S.minimumWordWidth?S.preferredWidth:S.minimumWordWidth);p+=0<(v=S.maximumWordWidth-b)?v:0,S.preferredWidth<S.minimumWordWidth?u+=S.minimumWordWidth-S.preferredWidth:g.push(y)}if(h<=t){for(y=0;y<this.columns.length;y++)"Point"===(S=this.columns[y]).widthType?S.preferredWidth<S.minimumWordWidth&&(S.preferredWidth=S.minimumWordWidth):S.preferredWidth<S.maximumWordWidth&&(S.preferredWidth=S.maximumWordWidth);i||this.fitColumns(e,t,i,o)}else{var w=this.getTotalWidth(0);if(c&&!r&&e<d&&(w<e&&(u-=e-w),0<g.length)&&0<u){for(var C=u/this.columns.length,y=0;y<this.columns.length;y++){var S=this.columns[y];-1===g.indexOf(y)?w>S.minimumWordWidth&&(S.preferredWidth=S.minimumWordWidth):(S.preferredWidth=S.preferredWidth-C,S.preferredWidth<S.minimumWordWidth&&(S.preferredWidth=S.minimumWordWidth))}w=this.getTotalWidth(0)}if(!i){l=t<d&&d+(je(s)?0:s)<e;if(f&&l){if(t<d&&0<u){w<t&&(u-=t-w);for(C=u/g.length,y=0;y<this.columns.length;y++){S=this.columns[y];-1===g.indexOf(y)?S.preferredWidth=S.minimumWordWidth:S.preferredWidth=S.preferredWidth-C}w=this.getTotalWidth(0)}return}return void this.fitColumns(e,l?d:t,i,o)}if(d<=t||d<=e){var A=t<e?e:t;A-=d;for(y=0;y<this.columns.length;y++)"Point"!==(S=this.columns[y]).widthType&&((0===S.preferredWidth||S.preferredWidth<S.minimumWordWidth)&&(S.preferredWidth=S.minimumWordWidth),T=A*((v=0<(v=S.maximumWordWidth-S.preferredWidth)?v:0)/p),S.preferredWidth+=isNaN(T)?0:T)}else{var x=this.getTotalWidth(1),s=this.getTotalWidth(3);if(2112<s)for(var I=2112/this.columns.length,y=0;y<this.columns.length;y++)this.columns[y].preferredWidth=I;else{A=0;if(s<e&&1<=e-s&&!c||c&&!r&&e<x){A=e-s;for(y=0;y<this.columns.length;y++){var T=A*(S=this.columns[y]).minimumWordWidth/x;T=isNaN(T)?0:T,S.preferredWidth=(0==S.minimumWidth?1:S.minimumWidth)+T}}else if(e<w)for(T=e/w,y=0;y<this.columns.length;y++)(S=this.columns[y]).preferredWidth=S.preferredWidth*T}}}this.tableWidth=this.getTotalWidth(0)},odi.prototype.getValidColumnIndex=function(e){for(var t=0,i=0;i<this.columns.length;i++){var n=this.columns[i];if(i<e)t=n.endOffset;else{if(t!==n.endOffset)break;e++}}return e},odi.prototype.fitColumns=function(e,t,i,n,o){je(o)&&(o=0);var r=this.getTotalWidth(0);if(i&&(r-=o),this.tableWidth=i?r:t,r!==this.tableWidth)for(var s=this.tableWidth/r,s=isNaN(s)||s==1/0?1:s,a=0;a<this.columns.length;a++){var l,h=this.columns[a];"Percent"===h.widthType&&!i&&!n&&r>this.tableWidth?0!==a&&h.endOffset>this.tableWidth&&(l=this.getCellWidth(0,a+1,t))>this.tableWidth&&(h.preferredWidth-=l-this.tableWidth,0===h.preferredWidth||h.preferredWidth<h.minimumWidth)&&(h.preferredWidth=0<h.minimumWidth?h.minimumWidth:1,this.columns[0].preferredWidth-=h.preferredWidth):h.preferredWidth=s*h.preferredWidth}},odi.prototype.getCellWidth=function(e,t,i){for(var n=0,o=0;o<t;o++)n+=this.tableColumns[o+e].preferredWidth;return n},odi.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&&(0===this.columns[e-1].endOffset?this.columns[e].preferredWidth=this.columns[e].endOffset-this.getPreviousValidOffset(e-2):this.columns[e].preferredWidth=this.columns[e].endOffset-this.columns[e-1].endOffset)},odi.prototype.getPreviousValidOffset=function(e){for(var t=e;0<=t;t--)if(0!==this.columns[t].endOffset)return this.columns[t].endOffset;return 0},odi.prototype.clone=function(){var e=new odi;e.tableWidth=this.tableWidth;for(var t=0;t<this.columns.length;t++)e.columns.push(this.columns[t].clone());return e},odi.prototype.destroy=function(){if(!je(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};var ndi=odi;function odi(){this.tableColumns=[],this.tableWidth=0}sdi.prototype.clone=function(){var e=new sdi;return e.preferredWidth=this.preferredWidth,e.minWidth=this.minWidth,e.maxWidth=this.maxWidth,e},sdi.prototype.destroy=function(){this.preferredWidth=void 0,this.minWidth=void 0,this.maxWidth=void 0};var rdi=sdi;function sdi(){this.preferredWidth=0,this.minWidth=0,this.maxWidth=0,this.endOffset=0,this.minimumWordWidth=0,this.maximumWordWidth=0,this.minimumWidth=0}function adi(){}function ldi(){}var hdi,ddi=function(){this.minimumWordWidth=0,this.maximumWordWidth=0,this.minimumWidth=0,this.hasMinimumWidth=!1,this.hasMinimumWordWidth=!1,this.hasMaximumWordWidth=!1},pdi=(pJ(cdi,hdi=pli),cdi.prototype.clone=function(){var e=hdi.prototype.clone.call(this);return e.breakClearType=this.breakClearType,e},cdi.prototype.destroy=function(){this.breakClearType=void 0,hdi.prototype.destroy.call(this)},cdi.prototype.componentDestroy=function(){this.breakClearType=void 0,hdi.prototype.componentDestroy.call(this)},cdi);function cdi(){return hdi.call(this)||this}function udi(){}pJ(fdi,gdi=pli),fdi.prototype.getLength=function(){return 1},fdi.prototype.clone=function(){var e=new fdi;if(e.characterFormat.copyFormat(this.characterFormat),e.text=this.text,this.margin&&(e.margin=this.margin.clone()),e.baselineOffset=this.baselineOffset,!je(this.paragraph)&&this.paragraph.isInHeaderFooter){if(0<this.revisions.length)for(var t=0;t<this.revisions.length;t++){var i=this.revisions[t];e.revisions.push(i.clone())}}else 0<this.revisions.length?e.removedIds=Ari.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice();return e.width=this.width,e.height=this.height,this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e};var gdi,mdi=fdi;function fdi(){return null!==gdi&&gdi.apply(this,arguments)||this}var ydi="_contextmenu_lock",vdi="_contextmenu_unlock",bdi="_contextmenu_copy",wdi="_contextmenu_cut",Cdi="_contextmenu_paste",Sdi="_add_comment",Adi="_contextmenu_update_field",xdi="_contextmenu_edit_field",Idi="_contextmenu_hyperlink",Tdi="_contextmenu_open_hyperlink",Edi="_contextmenu_copy_hyperlink",Ddi="_contextmenu_remove_hyperlink",Mdi="_properties",kdi="_contextmenu_edit_hyperlink",Pdi="_contextmenu_font_dialog",Bdi="_contextmenu_paragraph_dialog",Fdi="_contextmenu_table_dialog",Ldi="_contextmenu_insert_table",Rdi="_contextmenu_delete_table",Odi="_contextmenu_insert_above",Ndi="_contextmenu_insert_below",Vdi="_contextmenu_insert_right",_di="_contextmenu_insert_left",Hdi="_contextmenu_complete_table_delete",zdi="_contextmenu_delete_row",jdi="_contextmenu_delete_column",Wdi="_contextmenu_merge_cell",Qdi="_contextmenu_auto_fit",Udi="_contextmenu_auto_fit_contents",qdi="_contextmenu_auto_fit_window",Gdi="_contextmenu_fixed_column_width",Ydi="_contextmenu_continue_numbering",Xdi="_contextmenu_restart_at",Kdi="_contextmenu_spelling_dialog",Jdi="_contextmenu_otherSuggestions_spellcheck_",Zdi="_contextmenu_no_suggestion",$di="_contextmenu_accept_changes",epi="_contextmenu_reject_changes",tpi="_contextmenu_note_options",ipi="_remove_content_control",npi="_content_control_properties",opi=(Object.defineProperty(rpi.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),Object.defineProperty(rpi.prototype,"spellChecker",{get:function(){try{return this.documentHelper.owner.spellCheckerModule}catch(e){}},enumerable:!0,configurable:!0}),rpi.prototype.getModuleName=function(){return"ContextMenu"},rpi.prototype.initContextMenu=function(e,t){var i=this,n=this.documentHelper.owner.element.id,o=(this.contextMenu=document.createElement("div"),this.contextMenu.id=this.documentHelper.owner.containerId+"e-de-contextmenu",document.body.appendChild(this.contextMenu),document.createElement("ul")),o=(o.contentEditable="false",o.style.width="auto",o.id=this.documentHelper.owner.containerId+"e-de-contextmenu-list",o.style.listStyle="none",o.style.margin="0px",o.style.maxHeight="auto",o.oncontextmenu=this.disableBrowserContextmenu,this.contextMenu.appendChild(o),this.menuItems=[{text:e.getConstant("Lock"),iconCss:"e-icons e-de-ctnr-lock",id:n+ydi},{text:e.getConstant("Unlock"),iconCss:"e-icons",id:n+vdi},{text:e.getConstant("Cut"),iconCss:"e-icons e-de-cut",id:n+wdi},{text:e.getConstant("Copy"),iconCss:"e-icons e-de-copy",id:n+bdi},{text:e.getConstant("Paste"),iconCss:"e-icons e-de-paste",id:n+Cdi},{separator:!0},{text:e.getConstant("Remove Content Control"),iconCss:"e-icons",id:n+ipi},{text:e.getConstant("Content Control Properties"),iconCss:"e-icons e-de-formproperties",id:n+npi},{separator:!0},{text:e.getConstant("New Comment"),iconCss:"e-icons e-de-cmt-add",id:n+Sdi},{separator:!0},{text:e.getConstant("Accept Changes"),iconCss:"e-icons e-de-acceptchange",id:n+$di},{text:e.getConstant("Reject Changes"),iconCss:"e-icons e-de-rejectchange",id:n+epi},{text:e.getConstant("Update Field"),iconCss:"e-icons e-de-update-field",id:n+Adi},{text:e.getConstant("Edit Field")+"...",iconCss:"e-icons e-de-edit_field",id:n+xdi},{text:e.getConstant("Continue Numbering"),iconCss:"e-icons e-de-continue-numbering",id:n+Ydi},{text:e.getConstant("Restart At")+" 1",iconCss:"e-icons e-de-restart-at",id:n+Xdi},{separator:!0},{text:e.getConstant("Hyperlink")+"...",iconCss:"e-icons e-de-insertlink",id:n+Idi},{text:e.getConstant("Edit Hyperlink")+"...",iconCss:"e-icons e-de-edit-hyperlink",id:n+kdi},{text:e.getConstant("Open Hyperlink"),iconCss:"e-icons e-de-open-hyperlink",id:n+Tdi},{text:e.getConstant("Copy Hyperlink"),iconCss:"e-icons e-de-copy-hyperlink",id:n+Edi},{text:e.getConstant("Remove Hyperlink"),iconCss:"e-icons e-de-remove-hyperlink",id:n+Ddi},{text:e.getConstant("Properties"),iconCss:"e-icons e-de-formproperties",id:n+Mdi},{separator:!0},{text:e.getConstant("Font")+"...",iconCss:"e-icons e-de-fonts",id:n+Pdi},{text:e.getConstant("Paragraph")+"...",iconCss:"e-icons e-de-paragraph",id:n+Bdi},{text:e.getConstant("Notes Options")+"...",id:n+tpi},{separator:!0},{text:e.getConstant("Table Properties")+"...",id:n+Fdi,iconCss:"e-icons e-de-table"},{text:e.getConstant("Merge Cells"),id:n+Wdi,iconCss:"e-icons e-de-ctnr-mergecell"},{text:e.getConstant("AutoFit"),id:n+Qdi,iconCss:"e-icons",items:[{text:e.getConstant("AutoFit to Contents"),id:n+Udi,iconCss:"e-icons e-de-icon-autofit e-de-autofit-contents"},{text:e.getConstant("AutoFit to Window"),id:n+qdi,iconCss:"e-icons e-de-icon-auto-fitwindow e-de-autofit-window"},{text:e.getConstant("Fixed Column Width"),id:n+Gdi,iconCss:"e-icons e-de-icon-fixed-columnwidth e-de-fixed-column"}]},{text:e.getConstant("Insert"),id:n+Ldi,iconCss:"e-icons",items:[{text:e.getConstant("Insert Above"),id:n+Odi,iconCss:"e-icons e-de-insertabove"},{text:e.getConstant("Insert Below"),id:n+Ndi,iconCss:"e-icons e-de-insertbelow"},{text:e.getConstant("Insert Left"),id:n+_di,iconCss:"e-icons e-de-insertleft"},{text:e.getConstant("Insert Right"),id:n+Vdi,iconCss:"e-icons e-de-insertright"}]},{text:e.getConstant("Delete"),id:n+Rdi,iconCss:"e-icons",items:[{text:e.getConstant("Delete Table"),id:n+Hdi,iconCss:"e-icons e-de-delete-table"},{text:e.getConstant("Delete Row"),id:n+zdi,iconCss:"e-icons e-de-deleterow"},{text:e.getConstant("Delete Column"),id:n+jdi,iconCss:"e-icons e-de-deletecolumn"}]}],{target:"#"+this.documentHelper.owner.containerId+"e-de-contextmenu",enableRtl:t,items:this.addMenuItems(this.menuItems),cssClass:"e-de-contextmenu-wrapper",select:function(e){e=e.element.id;i.handleContextMenuItem(e)}});this.contextMenuInstance=new D4(o,"#"+this.documentHelper.owner.containerId+"e-de-contextmenu-list"),this.contextMenuInstance.beforeOpen=function(){for(var e=0;e<i.customMenuItems.length;e++)void 0!==i.customMenuItems[e].id?i.ids[e]=i.customMenuItems[e].id:i.ids[e]=i.customMenuItems[e+1].id;if(i.documentHelper.owner.fireCustomContextMenuBeforeOpen(i.ids),i.enableCustomContextMenu)for(e=0;e<i.menuItems.length;e++)void 0!==i.menuItems[e].id?document.getElementById(i.menuItems[e].id).style.display="none":document.getElementById(i.menuItems[e-1].id).nextSibling.style.display="none";i.viewer&&i.documentHelper.selection&&(mt(i.documentHelper.selection.caret,[],["e-de-cursor-animation"]),i.documentHelper.selection.showCaret())},je(this.documentHelper.owner.documentEditorSettings.popupTarget)||this.documentHelper.owner.documentEditorSettings.popupTarget.append(document.getElementsByClassName("e-de-contextmenu-wrapper")[0]),this.contextMenuInstance.onClose=function(){i.viewer&&i.documentHelper.selection&&(mt(i.documentHelper.selection.caret,["e-de-cursor-animation"],[]),n+Pdi!==i.itemsmenu)&&n+Idi!==i.itemsmenu&&n+Fdi!==i.itemsmenu&&n+Bdi!==i.itemsmenu&&i.documentHelper.updateFocus()}},rpi.prototype.disableBrowserContextmenu=function(){return!1},rpi.prototype.openPasteDialog=function(){var e=this,t=Q("div"),i=Q("div"),n=Q("p"),o=this.locale.getConstant("Paste Content Dialog"),o=(this.documentHelper.isIosDevice?n.textContent=o+" Command + V.":n.textContent=o+" Ctrl + V.",i.appendChild(n),t.appendChild(i),Q("div"));this.pasteCheckBoxDialog=Q("input",{attrs:{type:"checkbox"}}),o.appendChild(this.pasteCheckBoxDialog),new ib({label:this.locale.getConstant("Paste Content CheckBox")}).appendTo(this.pasteCheckBoxDialog),t.appendChild(o),JSON.parse(localStorage.getItem("ej_de_hidePasteAlert"))||WC.alert({title:this.locale.getConstant("Information"),content:t,okButton:{text:this.locale.getConstant("Ok")},showCloseIcon:!0,closeOnEscape:!0,animationSettings:{effect:"Zoom"},close:function(){e.pasteCheckBoxDialog.checked&&localStorage.setItem("ej_de_hidePasteAlert","true")}})},rpi.prototype.handleContextMenuItem=function(e){var t=this.documentHelper.owner.element.id;switch(this.itemsmenu=e){case t+ydi:this.documentHelper.owner.collaborativeEditingModule&&this.documentHelper.owner.collaborativeEditingModule.lockContent(this.documentHelper.owner.currentUser);break;case t+vdi:this.documentHelper.owner.collaborativeEditingModule&&this.documentHelper.owner.collaborativeEditingModule.unlockContent(this.documentHelper.owner.currentUser);break;case t+bdi:this.documentHelper.selection.copy();break;case t+wdi:this.documentHelper.owner.editorModule.cut();break;case t+Cdi:this.documentHelper.owner.isReadOnlyMode||(this.documentHelper.owner.enableLocalPaste?this.documentHelper.owner.editorModule.pasteInternal(void 0):this.openPasteDialog());break;case t+Sdi:this.documentHelper.owner.isReadOnlyMode&&!this.documentHelper.isCommentOnlyMode||(this.documentHelper.owner.editorModule.isUserInsert=!0,this.documentHelper.owner.editorModule.insertComment(),this.documentHelper.owner.editorModule.isUserInsert=!1);break;case t+Adi:var i=this.documentHelper.owner.isReadOnlyMode;!this.documentHelper.selection.isReferenceField()||i&&"FormFieldsOnly"!==this.documentHelper.protectionType?this.documentHelper.owner.isReadOnlyMode||this.documentHelper.owner.editorModule.updateToc():this.documentHelper.selection.updateRefField();break;case t+xdi:this.documentHelper.owner.isReadOnlyMode||this.documentHelper.owner.tableOfContentsDialogModule.show();break;case t+Pdi:this.documentHelper.owner.fontDialogModule&&this.documentHelper.owner.fontDialogModule.showFontDialog();break;case t+ipi:!je(this.documentHelper.selection)&&this.documentHelper.selection.checkContentControlLocked&&this.documentHelper.owner.editor.removeContentControl();break;case t+npi:!je(this.documentHelper.selection)&&this.documentHelper.selection.checkContentControlLocked&&this.documentHelper.owner.contentControlPropertiesDialogModule&&this.documentHelper.owner.contentControlPropertiesDialogModule.show();break;case t+Tdi:this.documentHelper.selection.navigateHyperlink();break;case t+Edi:this.documentHelper.selection.copyHyperlink();break;case t+kdi:case t+Idi:this.documentHelper.owner.hyperlinkDialogModule&&this.documentHelper.owner.hyperlinkDialogModule.show();break;case t+Ddi:this.documentHelper.owner.editorModule.removeHyperlink();break;case t+Bdi:this.documentHelper.owner.paragraphDialogModule&&this.documentHelper.owner.paragraphDialogModule.show();break;case t+Fdi:this.documentHelper.owner.tablePropertiesDialogModule.show();break;case t+Wdi:this.documentHelper.owner.editorModule.mergeCells();break;case t+Odi:this.documentHelper.owner.editorModule.insertRow(!0);break;case t+Ndi:this.documentHelper.owner.editorModule.insertRow(!1);break;case t+_di:this.documentHelper.owner.editorModule.insertColumn(!0);break;case t+Vdi:this.documentHelper.owner.editorModule.insertColumn(!1);break;case t+Hdi:this.documentHelper.owner.editorModule.deleteTable();break;case t+zdi:this.documentHelper.owner.editorModule.deleteRow();break;case t+jdi:this.documentHelper.owner.editorModule.deleteColumn();break;case t+Ydi:this.documentHelper.owner.editorModule.applyContinueNumbering();break;case t+Xdi:this.documentHelper.owner.editorModule.applyRestartNumbering(this.documentHelper.selection);break;case t+Udi:this.documentHelper.owner.editorModule.autoFitTable("FitToContents");break;case t+qdi:this.documentHelper.owner.editorModule.autoFitTable("FitToWindow");break;case t+Gdi:this.documentHelper.owner.editorModule.autoFitTable("FixedColumnWidth");break;case t+Kdi:i=this.spellChecker.retriveText();this.currentContextInfo=null,this.documentHelper.owner.spellCheckDialogModule.show(i.text,i.element);break;case t+$di:this.documentHelper.selection.handleAcceptReject(!0);break;case t+epi:this.documentHelper.selection.handleAcceptReject(!1);break;case t+Mdi:i=this.documentHelper.selection.getCurrentFormField();i instanceof Zai&&(i.formFieldData instanceof ili?this.documentHelper.owner.textFormFieldDialogModule.show():i.formFieldData instanceof rli?this.documentHelper.owner.checkBoxFormFieldDialogModule.show():i.formFieldData instanceof lli&&this.documentHelper.owner.dropDownFormFieldDialogModule.show());break;case t+tpi:this.documentHelper.owner.showFootNotesDialog();break;default:var i=this.documentHelper.owner.element.id+Jdi;e.substring(0,i.length)!==i?this.documentHelper.owner.fireCustomContextMenuSelect(e):(i=e.substring(e.lastIndexOf("_")+1),this.callSelectedOption(i))}},rpi.prototype.callSelectedOption=function(e){"Add to Dictionary"===e?this.spellChecker.handleAddToDictionary():"Ignore All"===e?this.spellChecker.handleIgnoreAllItems():this.spellChecker.manageReplace(e)},rpi.prototype.addCustomMenu=function(e,t,i){var n=JSON.parse(Y.sanitizeString(JSON.stringify(e)));this.destroy(),0===this.spellContextItems.length&&(this.customItems=e);for(var o=0;o<n.length;o++)this.customMenuItems.push(n[o]),this.customMenuItems[o].id=this.documentHelper.owner.element.id+this.customMenuItems[o].id;this.enableCustomContextMenu=t,this.enableCustomContextMenuBottom=i,this.initContextMenu(this.locale)},rpi.prototype.addMenuItems=function(e){return this.enableCustomContextMenuBottom?e.concat(this.customMenuItems):this.customMenuItems.concat(e)},rpi.prototype.showContextMenuOnSel=function(e){var t,i=!(e instanceof MouseEvent),n=0,o=0;i?(n=(t=this.documentHelper.getTouchOffsetValue(e)).x,o=t.y):(o=(F.isIE?e.clientY:e.y)+document.body.scrollTop+document.documentElement.scrollTop,n=(F.isIE?e.clientX:e.x)+document.body.scrollLeft+document.documentElement.scrollLeft),this.showHideElements(this.documentHelper.selection)&&(i&&(this.documentHelper.isMouseDown=!1),this.contextMenuInstance.open(o,n),e.preventDefault())},rpi.prototype.hideSpellContextItems=function(){if(0<this.spellContextItems.length)for(var e,t=0;t<this.spellContextItems.length;t++)-1!==this.customItems.indexOf(this.spellContextItems[t])||je(e=document.getElementById(this.documentHelper.owner.element.id+this.spellContextItems[t].id))||(e.style.display="none")},rpi.prototype.processSuggestions=function(e,t,i){this.spellContextItems=this.constructContextmenu(e,t),this.addCustomMenu(this.spellContextItems),this.noSuggestion=document.getElementById(this.documentHelper.owner.element.id+Zdi),je(this.noSuggestion)||(this.noSuggestion.style.display="block",mt(this.noSuggestion,["e-disabled"],["e-focused"])),this.showContextMenuOnSel(i)},rpi.prototype.constructContextmenu=function(e,t){var i=0<this.customItems.length?this.customItems.slice():[];if(je(e)||0===e.length)i.push({text:this.locale.getConstant("no suggestions"),id:Zdi,classList:["e-focused"],iconCss:""});else for(var n=0;n<e.length;n++)i.push({text:e[n],id:Jdi+e[n],iconCss:""});return i.push({separator:!0,id:"_contextmenu_suggestion_separator"}),!je(t)&&1<t.length?(i.push({text:this.locale.getConstant("More Suggestion"),items:t}),i.push({separator:!0,id:"_contextmenu_moreSuggestion_separator"})):i.push({text:this.locale.getConstant("Add to Dictionary"),id:"_contextmenu_otherSuggestions_spellcheck_Add to Dictionary",iconCss:""}),i.push({text:this.locale.getConstant("Ignore Once"),id:"_contextmenu_otherSuggestions_spellcheck_Ignore Once",iconCss:""}),i.push({text:this.locale.getConstant("Ignore All"),id:"_contextmenu_otherSuggestions_spellcheck_Ignore All",iconCss:""}),i.push({separator:!0,id:"_contextmenu_change_separator"}),i.push({text:this.locale.getConstant("Spelling"),id:Kdi,iconCss:"e-icons e-de-spellcheck",items:[]}),i.push({separator:!0,id:"_contextmenu_spelling_separator"}),i},rpi.prototype.showHideElements=function(e){if(je(e))return!1;e.hideToolTip();var t=this.documentHelper.owner,i=t.element.id,n=document.getElementById(i+ydi),o=document.getElementById(i+vdi),r=document.getElementById(i+bdi),s=document.getElementById(i+wdi),a=document.getElementById(i+Cdi),l=document.getElementById(i+Adi),h=document.getElementById(i+xdi),d=document.getElementById(i+Pdi),p=document.getElementById(i+Bdi),c=document.getElementById(i+Fdi),u=document.getElementById(i+Ldi),g=document.getElementById(i+Rdi),m=document.getElementById(i+Wdi),f=document.getElementById(i+Idi),y=document.getElementById(i+Tdi),v=document.getElementById(i+kdi),b=document.getElementById(i+Edi),w=document.getElementById(i+Ddi),C=document.getElementById(i+Mdi),S=document.getElementById(i+Ydi),A=document.getElementById(i+Xdi),x=document.getElementById(i+Qdi),I=document.getElementById(i+Sdi),T=document.getElementById(i+tpi),E=document.getElementById(i+ipi),D=document.getElementById(i+npi),n=(this.documentHelper.owner.enableLockAndEdit?this.documentHelper.editRanges.containsKey(this.documentHelper.owner.currentUser)?(n.style.display="none",o.style.display="block",this.documentHelper.selection.isSelectionInEditRegion()?mt(o,["e-blankicon"],["e-disabled"]):mt(o,["e-disabled","e-blankicon"],[])):(n.style.display="block",this.documentHelper.owner.collaborativeEditingModule&&this.documentHelper.owner.collaborativeEditingModule.canLock()?mt(o,["e-disabled"],[]):mt(o,[],["e-disabled"]),o.style.display="none"):(n.style.display="none",o.style.display="none"),!1),o=(s.style.display="none",a.style.display="none",a.nextSibling.style.display="none",document.getElementById(i+$di)),i=document.getElementById(i+epi),M=(f.style.display="none",T.style.display="none",T.nextSibling.style.display="none",d.previousSibling.style.display="none",y.style.display="none",b.style.display="none",v.style.display="none",w.style.display="none",w.nextSibling.style.display="none",C.style.display="none",m.style.display="none",x.style.display="none",d.style.display="none",p.style.display="none",E.style.display="none",D.style.display="none",u.style.display="none",g.style.display="none",c.style.display="none",l.style.display="none",e.getHyperlinkField()),k=!1,P=(o.style.display="none",i.style.display="none",this.documentHelper.owner.selection.currentContentControl),B=this.documentHelper.owner.getImageContentControl(),E=(!je(P)&&P instanceof Pli&&!P.contentControlProperties.lockContentControl&&!this.documentHelper.owner.isReadOnlyMode||B instanceof Pli&&!B.contentControlProperties.lockContentControl&&"Picture"==B.contentControlProperties.type&&!this.documentHelper.owner.isReadOnlyMode?E.style.display="block":E.style.display="none",!this.documentHelper.owner.isReadOnlyMode&&!je(P)&&P instanceof Pli||B instanceof Pli&&"Picture"==B.contentControlProperties.type&&!this.documentHelper.owner.isReadOnlyMode?(D.style.display="block",D.nextSibling.style.display="block"):(D.style.display="none",D.nextSibling.style.display="none"),M instanceof Zai&&e.isReferenceField(M)&&(k=!0),M instanceof Zai&&k&&("FormFieldsOnly"===this.documentHelper.protectionType||!this.documentHelper.owner.isReadOnlyMode)&&(l.style.display="block"),h.style.display="none",S.style.display="none",A.style.display="none",A.nextSibling.style.display="none",e.isEmpty),P=(mt(s,E?["e-disabled"]:[],E?[]:["e-disabled"]),mt(r,E?["e-disabled"]:[],E?[]:["e-disabled"]),this.documentHelper.owner.isReadOnlyMode||this.documentHelper.owner.enableHeaderAndFooter||!this.documentHelper.owner.enableComment);return I.style.display=P?"none":"block",this.documentHelper.isCommentOnlyMode&&(I.style.display="block"),I.nextSibling.style.display=P?"none":"block",t.isReadOnlyMode?!je(M)&&M instanceof Zai&&(y.style.display="block",b.style.display="block"):(this.viewer&&this.documentHelper.owner&&this.documentHelper.owner.commentReviewPane&&this.documentHelper.owner.commentReviewPane.commentPane.isEditMode||this.documentHelper.owner.selection.isinFootnote||this.documentHelper.owner.selection.isinEndnote?mt(I,["e-disabled"],[]):mt(I,[],["e-disabled"]),o.previousSibling.style.display="none",s.style.display="block",a.style.display="block",a.nextSibling.style.display="block",mt(u,["e-blankicon"],[]),mt(g,["e-blankicon"],[]),mt(h,["e-blankicon"],[]),mt(x,["e-blankicon"],[]),F.isIE||JSON.parse(localStorage.getItem("ej_de_hidePasteAlert"))&&mt(a,(B=t.enableLocalPaste&&!je(t.editorModule.copiedData))?[]:["e-disabled"],B?["e-disabled"]:[]),"TableOfContents"===e.contextType?(l.style.display="block",h.style.display="block"):(D=e.start,r=e.end,"List"===e.contextType&&"Bullet"!==t.selectionModule.getListLevel(D.paragraph).listLevelPattern&&(S.style.display="block",A.style.display="block",A.nextSibling.style.display="block"),D.paragraph.isInsideTable&&(!r.paragraph.isInsideTable||D.paragraph.associatedCell!==r.paragraph.associatedCell||e.isCellSelected(D.paragraph.associatedCell,D,r))?f.classList.add("e-disabled"):f.classList.contains("e-disabled")&&f.classList.remove("e-disabled"),M instanceof Zai&&!k?(y.style.display="block",e.isImageField()||(b.style.display="block"),t.hyperlinkDialogModule&&(v.style.display="block"),w.style.display="block",w.nextSibling.style.display="block",n=!0,C.style.display="none"):t.hyperlinkDialogModule&&(f.style.display="block",d.previousSibling.style.display="block",n=!0),e.isFormField()&&this.documentHelper.owner.enableFormField&&(f.style.display="none",C.style.display="block"),M instanceof Zai&&k&&(f.style.display="none",l.style.display="block")),this.documentHelper.owner.selectionModule.start.paragraph.isInsideTable&&this.documentHelper.owner.selectionModule.end.paragraph.isInsideTable&&(t.tablePropertiesDialogModule&&(c.style.display="block"),u.style.display="block",g.style.display="block",this.documentHelper.owner.editorModule.canMergeCells()&&(m.style.display="block"),x.style.display=this.documentHelper.selection.isTableSelected()?"block":"none"),this.documentHelper.owner.fontDialogModule&&(d.style.display="block"),this.documentHelper.owner.paragraphDialogModule?p.style.display="block":n||this.documentHelper.owner.fontDialogModule||P||(I.nextSibling.style.display="none"),"Image"===e.contextType&&(d.style.display="none",p.style.display="none",d.previousSibling.style.display="none",w.nextSibling.style.display="none"),this.documentHelper.selection.hasRevisions()&&(o.previousSibling.style.display=this.documentHelper.owner.enableHeaderAndFooter?"none":"block",this.documentHelper.isTrackedOnlyMode?(o.style.display="none",i.style.display="none"):(o.style.display="block",i.style.display="block")),(this.documentHelper.selection.isinFootnote||this.documentHelper.selection.isinEndnote)&&(T.style.display="block")),!0},rpi.prototype.destroy=function(){this.contextMenuInstance&&this.contextMenuInstance.destroy(),this.contextMenuInstance=void 0,this.contextMenu&&this.contextMenu.parentElement&&(this.contextMenu.parentElement.removeChild(this.contextMenu),this.contextMenu.innerHTML=""),this.contextMenu=void 0,this.menuItems=[],this.customMenuItems=[],this.ids=[]},rpi.prototype.componentDestroy=function(){this.contextMenuInstance&&this.contextMenuInstance.destroy(),this.contextMenuInstance=void 0,this.contextMenu&&this.contextMenu.parentElement&&(this.contextMenu.parentElement.removeChild(this.contextMenu),this.contextMenu.innerHTML=""),this.contextMenu=void 0,this.menuItems=[],this.menuItems=void 0,this.customMenuItems=[],this.customMenuItems=void 0,this.ids=[],this.ids=void 0,this.customItems=[],this.customItems=void 0,this.spellContextItems=[],this.spellContextItems=void 0,this.documentHelper=void 0},rpi);function rpi(e){var r=this;this.contextMenuInstance=void 0,this.menuItems=[],this.customMenuItems=[],this.ids=[],this.spellContextItems=[],this.customItems=[],this.onContextMenuInternal=function(t){var i,n,o;0 instanceof MouseEvent;r.documentHelper.owner.isSpellCheck&&r.spellChecker.allowSpellCheckAndSuggestion&&(t.preventDefault(),r.currentContextInfo=r.spellChecker.findCurretText(),!je(o=r.spellChecker.manageSpecialCharacters(r.currentContextInfo.text,void 0,!0)))&&r.spellChecker.errorWordCollection.containsKey(o)?(r.spellChecker.currentContextInfo=r.currentContextInfo,r.spellChecker.errorSuggestions.containsKey(o)?(n=r.spellChecker.errorSuggestions.get(o).slice(),i=r.spellChecker.handleSuggestions(n),r.processSuggestions(n,i,t)):r.spellChecker.enableOptimizedSpellCheck?r.spellChecker.callSpellChecker(r.spellChecker.languageID,o,!1,!0,!1,!1).then(function(e){e=JSON.parse(e);n=e.Suggestions,je(r.documentHelper)||(je(n)||(r.spellChecker.errorSuggestions.add(o,n.slice()),i=r.spellChecker.handleSuggestions(n)),r.processSuggestions(n,i,t))}):r.processSuggestions(n,i,t)):(r.hideSpellContextItems(),r.showContextMenuOnSel(t))},je(e)||(this.documentHelper=e,this.locale=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),this.locale.setLocale(this.documentHelper.owner.locale),this.initContextMenu(this.locale,this.documentHelper.owner.enableRtl))}Object.defineProperty(api.prototype,"previousSelectedComment",{get:function(){return this.previousSelectedCommentInt},set:function(e){if(!je(e)&&e!==this.previousSelectedCommentInt&&this.commentPane.comments.containsKey(e)){var t=this.commentPane.getCommentStart(e).commentMark,i=(t&&(mt(t,[],["e-de-cmt-mark-selected"]),this.commentPane.removeSelectionMark("e-de-cmt-selection"),this.commentPane.removeSelectionMark("e-de-cmt-mark-selected")),this.commentPane.comments.get(e));i.hideDrawer();for(var n=0;n<e.replyComments.length;n++)(i=this.commentPane.comments.get(e.replyComments[n]))&&(i.hideDrawer(),i.hideMenuItems())}this.previousSelectedCommentInt=e},enumerable:!0,configurable:!0}),api.prototype.selectReviewTab=function(e){"Changes"===e?this.reviewTab.select(1):this.reviewTab.select(0)},api.prototype.showHidePane=function(e,t){this.parentPaneElement&&(this.updateTabHeaderWidth(),e?(this.parentPaneElement.style.display="block","Changes"===t&&this.owner.showRevisions?(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,isUserClosed:!1}),this.reviewTab.select(0)),this.owner.trackChangesPane.updateTrackChanges(this.owner.showRevisions),this.commentPane.updateCommentStatus()):this.parentPaneElement.style.display="none",this.owner.showRevisions||(this.owner.trackChangesPane.isChangesTabVisible=!1,this.owner.notify("reviewPane",{comment:this.isCommentTabVisible,changes:this.owner.trackChangesPane.isChangesTabVisible}),this.reviewTab.hideTab(1,!0)),this.owner.showComments||(this.isCommentTabVisible=!1,this.owner.notify("reviewPane",{comment:this.isCommentTabVisible,changes:this.owner.trackChangesPane.isChangesTabVisible}),this.reviewTab.hideTab(0,!0))),e&&(this.enableDisableItems(),this.commentPane.updateHeight()),this.owner&&(this.owner.resize(),this.owner.enableAutoFocus)&&this.owner.documentHelper.updateFocus()},api.prototype.reviewPaneHelper=function(e){var t=this;if(je(e.isUserClosed)){if(this.isUserClosed)return}else{if(e.isUserClosed===this.isUserClosed)return;this.isUserClosed=e.isUserClosed,this.owner&&setTimeout(function(){t.owner&&t.owner.resize()},10)}je(e.comment)&&je(e.changes)||(e.comment||e.changes?"none"===this.parentPaneElement.style.display&&(this.parentPaneElement.style.display="block"):this.parentPaneElement.style.display="none",this.owner&&setTimeout(function(){t.owner&&t.owner.resize()},10))},api.prototype.updateTabHeaderWidth=function(){var e=this.reviewTab.getRootElement().getElementsByClassName("e-tab-wrap");e[0].style.padding="0 8px",e[1].style.padding="0 8px"},api.prototype.initReviewPane=function(e){var t=this.owner.documentHelper.optionsPaneContainer;t.style.display="flex",this.initPaneHeader(e),t.appendChild(this.addReviewTab(e)),this.initCommentPane(),this.owner.on("reviewPane",this.reviewPaneHelper,this)},api.prototype.addReviewTab=function(e){var t=Q("div",{innerHTML:e.getConstant("Comments")}),e=Q("div",{innerHTML:e.getConstant("Changes")}),t=(this.parentPaneElement=Q("div",{styles:"height:100%;overflow:auto;display:none",className:"e-de-review-pane"}),this.element=Q("div",{className:"e-de-property-tab",id:this.owner.element.id+"Review_Tab"}),[{header:{text:t},content:this.reviewPane},{header:{text:e}}]);return this.reviewTab=new k5({items:t,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.parentPaneElement},api.prototype.initPaneHeader=function(e){return this.headerContainer=Q("div"),this.reviewPane=Q("div",{className:"e-de-cmt-pane"}),this.owner.enableRtl&&mt(this.reviewPane,["e-rtl"],[]),this.headerContainer.appendChild(this.initToolbar(e)),this.reviewPane.appendChild(this.headerContainer),this.reviewPane.style.display="block",this.reviewPane},api.prototype.closePane=function(){var e;this.commentPane&&this.commentPane.isEditMode?!je(this.commentPane.currentEditingComment)&&this.commentPane.isInsertingReply&&""===this.commentPane.currentEditingComment.replyViewTextBox.innerText?(this.owner.documentHelper.currentSelectedComment=void 0,this.commentPane.currentEditingComment.cancelReply(),this.owner.showComments=!1):this.isNewComment||!je(this.commentPane.currentEditingComment)&&this.commentPane.isInsertingReply&&""!==this.commentPane.currentEditingComment.replyViewTextBox.innerText||!je(this.commentPane.currentEditingComment)&&!this.commentPane.isInsertingReply&&this.commentPane.currentEditingComment.textArea.innerText!==this.commentPane.currentEditingComment.comment.text?((e=new Cn("documenteditor",this.owner.defaultLocale)).setLocale(this.owner.locale),this.confirmDialog=WC.confirm({title:e.getConstant("Un-posted comments"),content:e.getConstant("Discard Comment"),okButton:{text:e.getConstant("Discard"),click:this.discardButtonClick.bind(this)},cancelButton:{text:e.getConstant("Cancel"),click:this.closeDialogUtils.bind(this)},showCloseIcon:!0,closeOnEscape:!0,animationSettings:{effect:"Zoom"},position:{X:"center",Y:"center"}})):(this.owner.documentHelper.currentSelectedComment=void 0,this.commentPane.currentEditingComment.cancelEditing(),this.owner.showComments=!1):(this.owner.showComments=!1,this.owner.documentHelper.currentSelectedComment=void 0,this.owner.documentHelper.currentSelectedRevision=void 0,this.owner.notify("reviewPane",{changes:!1,comment:!1,isUserClosed:!0}))},api.prototype.discardButtonClick=function(){this.commentPane.currentEditingComment&&(this.isNewComment,this.commentPane.currentEditingComment&&this.commentPane.isInsertingReply?this.commentPane.currentEditingComment.cancelReply():this.commentPane.currentEditingComment.cancelEditing(),this.owner.documentHelper.currentSelectedComment=void 0,this.closeDialogUtils(),this.owner.showComments=!1)},api.prototype.closeDialogUtils=function(){this.confirmDialog.close(),this.confirmDialog=void 0},api.prototype.initToolbar=function(e){return this.toolbarElement=Q("div"),this.toolbar=new U3({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},api.prototype.insertComment=function(){this.owner&&this.owner.editorModule&&(this.owner.editorModule.isUserInsert=!0,this.owner.editorModule.insertComment(""),this.owner.editorModule.isUserInsert=!1)},api.prototype.addComment=function(e,t,i){this.isNewComment=t,this.owner.documentHelper.currentSelectedComment=e,this.commentPane.insertComment(e),this.selectReviewTab("Comments"),t||(this.commentPane.comments.get(e).cancelEditing(),this.enableDisableToolbarItem()),i&&this.selectComment(e)},api.prototype.deleteComment=function(e){this.commentPane&&this.commentPane.deleteComment(e)},api.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))},api.prototype.resolveComment=function(e){this.commentPane.resolveComment(e)},api.prototype.reopenComment=function(e){this.commentPane.reopenComment(e)},api.prototype.addReply=function(e,t,i){this.isNewComment=t,this.postReply=!0,this.commentPane.insertReply(e),this.postReply=!1,t||(this.commentPane.comments.get(e).cancelEditing(),this.enableDisableToolbarItem()),i&&this.selectComment(e.ownerComment)},api.prototype.navigatePreviousComment=function(){this.owner&&this.owner.editorModule&&this.owner.selectionModule.navigatePreviousComment()},api.prototype.navigateNextComment=function(){this.owner&&this.owner.editorModule&&this.owner.selectionModule.navigateNextComment()},api.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?(je(i.replyViewTextBox)||(i.replyViewTextBox.style.display="none"),i.menuBar.style.display="none",i.resolveView&&(i.resolveView.style.display="none")):(je(i.replyViewTextBox)||(i.replyViewTextBox.style.display="block"),i.menuBar.style.display="block",i.resolveView&&(i.resolveView.style.display=""))}},api.prototype.enableDisableToolbarItem=function(){var e,t;this.toolbar&&(e=!0,this.commentPane.isEditMode&&(e=!this.commentPane.isEditMode),this.owner.isReadOnly&&(e=!this.owner.isReadOnly),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))},api.prototype.initCommentPane=function(){this.commentPane=new lpi(this.owner,this),this.commentPane.initCommentPane()},api.prototype.layoutComments=function(e){for(var t=0;t<e.length;t++){var i=e[t];if(this.isUnreferredComment(i))e.splice(t,1),t--;else{for(var n=0;n<i.replyComments.length;n++)this.isUnreferredComment(i.replyComments[n])&&(i.replyComments.splice(n,1),n--);this.commentPane.addComment(i)}}},api.prototype.isUnreferredComment=function(e){return!(!je(e.commentStart)&&!je(e.commentEnd))},api.prototype.clear=function(){this.previousSelectedCommentInt=void 0,this.isNewComment=!1,this.isUserClosed=!1,this.isNewComment=!1,this.commentPane.clear()},api.prototype.discardComment=function(e){e&&(this.owner.editorHistoryModule?(0<this.owner.editorHistoryModule.undoStack.length&&"InsertComment"===this.owner.editorHistoryModule.undoStack[this.owner.editorHistoryModule.undoStack.length-1].action&&(this.owner.editorHistoryModule.undo(),this.owner.editorHistoryModule.redoStack.pop()),this.owner.editorModule.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.owner.editorModule.deleteCommentInternal(e),this.owner.editorModule.isSkipOperationsBuild=!1):this.owner.editorModule&&this.owner.editorModule.deleteCommentInternal(e))},api.prototype.destroy=function(){this.commentPane&&this.commentPane.destroy(),this.commentPane=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.isDestroyed||this.owner.off("reviewPane",this.reviewPaneHelper),je(this.reviewTab)||this.reviewTab.destroy(),this.reviewTab=void 0,je(this.confirmDialog)||this.confirmDialog.destroy(),this.confirmDialog=void 0,je(this.previousSelectedCommentInt)||this.previousSelectedCommentInt.destroy(),this.previousSelectedCommentInt=void 0,this.reviewPane&&(this.reviewPane.innerHTML="",this.reviewPane.parentElement)&&this.reviewPane.parentElement.removeChild(this.reviewPane),this.reviewPane=void 0,this.parentPaneElement&&(this.parentPaneElement.innerHTML="",this.parentPaneElement.parentElement)&&this.parentPaneElement.parentElement.removeChild(this.parentPaneElement),this.parentPaneElement=void 0,this.owner=void 0};var spi=api;function api(e){var t=this,e=(this.isNewComment=!1,this.isUserClosed=!1,this.postReply=!1,this.selectedTab=0,this.onTabSelection=function(e){e.preventFocus=!0,t.selectedTab=e.selectedIndex,(1===t.selectedTab?t.owner.trackChangesPane:t.commentPane).updateHeight(),setTimeout(function(){t.owner&&t.owner.resize()},10)},this.owner=e,new Cn("documenteditor",this.owner.defaultLocale));e.setLocale(this.owner.locale),this.initReviewPane(e),this.parentPaneElement.style.display="none"}Object.defineProperty(hpi.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(OJt):this.owner.trigger(NJt))},enumerable:!0,configurable:!0}),hpi.prototype.initCommentPane=function(){this.commentPane=Q("div",{className:"e-de-cmt-container e-de-scrollbar-hide"});var e=new Cn("documenteditor",this.owner.defaultLocale);e.setLocale(this.owner.locale),this.noCommentIndicator=Q("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)},hpi.prototype.addComment=function(e){var t=new dpi(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 o=new dpi(this.owner,this,e.replyComments[n]);this.comments.add(e.replyComments[n],o),i.insertBefore(o.layoutComment(!0),t.replyViewContainer)}this.updateCommentStatus(),t.hideDrawer()},hpi.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"},hpi.prototype.insertReply=function(e){var t=e.ownerComment,i=this.comments.get(t),n=new dpi(this.owner,this,e),o=(this.comments.add(e,n),n.layoutComment(!0)),e=t.replyComments.indexOf(e);e===t.replyComments.length-1?i.parentElement.insertBefore(o,i.replyViewContainer):(t=t.replyComments[e+1],i.parentElement.insertBefore(o,this.comments.get(t).parentElement)),n.editComment()},hpi.prototype.insertComment=function(e){var t=new dpi(this.owner,this,e),i=t.layoutComment(!1);this.comments.add(e,t),this.owner.documentHelper.comments.indexOf(e)===this.owner.documentHelper.comments.length-1?this.commentPane.appendChild(i):(e=this.owner.documentHelper.comments.indexOf(e),e=this.comments.get(this.owner.documentHelper.comments[e+1]).parentElement,this.commentPane.insertBefore(i,e),i.focus()),this.updateCommentStatus(),t.editComment()},hpi.prototype.removeSelectionMark=function(e){if(this.parent)for(var t=this.parent.getElementsByClassName(e),i=0;i<t.length;i++)mt(t[i],[],[e])},hpi.prototype.selectComment=function(e){var t,i;this.removeSelectionMark("e-de-cmt-selection"),(e=e.isReply?e.ownerComment:e)&&(this.owner.notify("reviewPane",{comment:!0,changes:this.owner.trackChangesPane.isChangesTabVisible}),(i=(t=this.comments.get(e)).parentElement)&&(mt(i,["e-de-cmt-selection"],[]),i.focus()),(i=this.getCommentStart(e)).commentMark||i.renderCommentMark(),mt(i.commentMark,["e-de-cmt-mark-selected"],[]),t.showDrawer())},hpi.prototype.getCommentStart=function(e){var t=new Cn("documenteditor",this.owner.defaultLocale),i=(t.setLocale(this.owner.locale),void 0);return void 0!==(i=e&&e.commentStart?e.commentStart:i).commentMark&&(i.commentMark.title=t.getConstant("Click to see this comment")),this.getFirstCommentInLine(i)},hpi.prototype.getFirstCommentInLine=function(e){for(var t=0;t<e.line.children.length;t++){var i=e.line.children[t];if(i instanceof Khi&&0===i.commentType)return i}return e},hpi.prototype.deleteComment=function(e){var t=this.comments.get(e);if(!je(t)){je(this.currentEditingComment)||t.comment.commentId!=this.currentEditingComment.comment.commentId||(this.isEditMode=!1,this.currentEditingComment=void 0),t.parentElement&&t.parentElement.parentElement&&t.parentElement.parentElement.removeChild(t.parentElement);for(var i=0;i<e.replyComments.length;i++){var n=e.replyComments[i];this.comments.containsKey(n)&&this.comments.remove(n)}this.comments.remove(e),t.destroy()}this.updateCommentStatus()},hpi.prototype.resolveComment=function(e){e=this.comments.get(e);e&&e.resolveComment()},hpi.prototype.reopenComment=function(e){e=this.comments.get(e);e&&e.reopenComment()},hpi.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.owner.showComments&&(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()},hpi.prototype.clear=function(){this.isEditMode=!1,this.currentEditingComment=void 0,this.isInsertingReply=!1,this.removeChildElements(),this.commentPane.innerHTML="",this.updateCommentStatus()},hpi.prototype.removeChildElements=function(){for(var e=this.comments.keys,t=0;t<e.length;t++)this.comments.get(e[t]).destroy();this.comments.clear()},hpi.prototype.destroy=function(){this.removeChildElements(),this.noCommentIndicator&&this.noCommentIndicator&&this.noCommentIndicator.parentElement.removeChild(this.noCommentIndicator),this.noCommentIndicator=void 0,this.commentPane&&(this.commentPane.innerHTML="",this.commentPane.parentElement)&&this.commentPane.parentElement.removeChild(this.commentPane),this.commentPane=void 0,this.parent&&(this.parent.innerHTML="",this.parent.parentElement)&&this.parent.parentElement.removeChild(this.parent),this.parent=void 0,this.parentPane=void 0,this.currentEditingComment=void 0,this.owner=void 0};var lpi=hpi;function hpi(e,t){this.isEditModeInternal=!1,this.isInsertingReply=!1,this.owner=e,this.parentPane=t,this.parent=t.reviewPane,this.comments=new uJt}ppi.prototype.layoutComment=function(e){var t="e-de-cmt-sub-container",e=((this.isReply=e)&&(t+=" e-de-cmt-reply"),new Cn("documenteditor",this.owner.defaultLocale));return e.setLocale(this.owner.locale),this.parentElement=Q("div",{className:t}),this.initCommentHeader(e),this.initCommentView(e),this.initDateView(),this.comment.isReply?this.menuBar.style.display="none":(this.parentElement.tabIndex=0,this.initReplyView(e),this.initResolveOption(e),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},ppi.prototype.initCommentHeader=function(e){var t=Q("div",{className:"e-de-cmt-view"}),i=(this.resolveDiv=Q("div",{className:"e-de-cmt-view"}),Q("div",{className:"e-de-cmt-view"})),n=Q("div",{className:"e-de-resolve-mark"}),o=Q("span",{className:"e-de e-icons e-check"}),r=Q("span",{className:""}),o=(r.innerHTML="Resolved",o.style.display="inline-block",n.style.display="flex",n.style.justifyContent="center",n.style.alignItems="center",n.style.width="20px",n.style.height="20px",n.style.borderRadius="100%",n.style.marginRight="6px",n.appendChild(o),i.appendChild(n),i.appendChild(r),this.resolveDiv.appendChild(i),i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",this.resolveDiv.style.display="none",Q("div",{className:"e-de-cmt-author"})),n=(o.style.marginTop="8px",Q("div",{className:"e-de-cmt-author-name"})),r=(n.textContent=this.comment.author,je(this.comment.author)||(o.style.display="flex",this.owner.documentHelper.getAvatar(o,n,this.comment,void 0)),this.menuBar=Q("button",{className:"e-de-cp-option",attrs:{type:"button"}}),[{text:e.getConstant("Edit")},{text:e.getConstant("Delete")},{text:e.getConstant("Reply")},{text:e.getConstant("Resolve")}]),i=new u2({items:this.isReply?r.splice(0,2):r,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")+"...",i.appendTo(this.menuBar),o.appendChild(this.menuBar),this.dropDownButton=i,t.appendChild(o),this.commentView=t,this.parentElement.appendChild(t),t.addEventListener("click",this.selectComment.bind(this))},ppi.prototype.selectComment=function(){var e;this.commentPane&&(this.commentPane.isEditMode?this.commentPane.isEditMode&&this.commentPane.isInsertingReply&&this.commentPane.currentEditingComment&&""===this.commentPane.currentEditingComment.replyViewTextBox.innerText&&((e=(e=this.comment)&&e.isReply?this.comment.ownerComment:e)&&this.owner.documentHelper.currentSelectedComment===e||(this.commentPane.currentEditingComment.cancelReply(),this.owner.selectionModule.selectComment(this.comment))):this.owner.selectionModule.selectComment(this.comment))},ppi.prototype.initCommentView=function(e){this.commentText=Q("div",{className:"e-de-cmt-readonly e-mention"}),this.commentText.innerHTML=this.comment.text,this.commentView.appendChild(this.commentText),this.initEditView(e)},ppi.prototype.initEditView=function(e){var t=this,i=(this.textAreaContainer=Q("div",{styles:"display:none"}),this.textArea=Q("div",{className:"e-de-cmt-textarea e-input"}),this.textArea.addEventListener("paste",function(e){t.updatePastedText(e,t.textArea)}),this.textArea.style.borderWidth="0 0 2px 0",this.textArea.setAttribute("placeholder",e.getConstant("Type your comment here")),this.editMention=new c7({dataSource:this.owner.documentEditorSettings.mentionSettings.dataSource,fields:this.owner.documentEditorSettings.mentionSettings.fields,select:this.onSelect.bind(this)}),this.textArea.innerHTML=this.comment.text,this.textArea.addEventListener("keydown",this.updateTextAreaHeight.bind(this)),this.textArea.addEventListener("keyup",this.enableDisablePostButton.bind(this)),Q("div",{className:"e-de-cmt-action-button"})),n=Q("button",{className:"e-de-cmt-post-btn e-btn e-flat",attrs:{type:"button"}}),o=(this.postButton=new zv({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"),n.setAttribute("aria-label",e.getConstant("Post")),Q("button",{className:"e-de-cmt-cancel-btn e-btn e-flat",attrs:{type:"button"}}));this.cancelButton=new zv({cssClass:"e-btn e-flat",iconCss:"e-de-cmt-cancel"},o),o.title=e.getConstant("Cancel"),o.setAttribute("aria-label",e.getConstant("Cancel")),o.addEventListener("click",this.cancelEditing.bind(this)),i.appendChild(n),i.appendChild(o),i.style.marginTop="8px",this.textAreaContainer.appendChild(this.textArea),this.textAreaContainer.appendChild(i),this.commentView.appendChild(this.textAreaContainer),this.editMention.appendTo(this.textArea)},ppi.prototype.updatePastedText=function(e,t){e.preventDefault();var e=e.clipboardData.getData("text/plain");e&&(e=this.convertToHtml(e),t.innerHTML=t.innerHTML+e),this.enableDisableReplyPostButton()},ppi.prototype.convertToHtml=function(e){return e.split(/(?:\r?\n|\r)/).map(function(e){return e?"<div>"+e+"</div>":"<div><br></div>"}).join("")},ppi.prototype.onSelect=function(e){this.owner.documentEditorSettings.mentionSettings.fields;var t={},e=e.itemData;t.text=e[this.owner.documentEditorSettings.mentionSettings.fields.text],t.value=e[this.owner.documentEditorSettings.mentionSettings.fields.value],this.itemData.push(t)},ppi.prototype.initDateView=function(){this.commentDate=Q("div",{className:"e-de-cmt-date"}),this.commentDate.innerText=Y.getModifiedDate(this.comment.date),this.commentView.appendChild(this.commentDate)},ppi.prototype.initDrawer=function(){this.drawerElement=Q("div",{styles:"display:none;",className:"e-de-cmt-drawer-cnt"});var e=Q("div",{className:"e-de-cmt-drawer"}),t=Q("span");e.appendChild(t),this.drawerElement.appendChild(e),this.drawerSpanElement=t,this.drawerAction=e,this.drawerAction.addEventListener("click",this.showOrHideDrawer.bind(this)),this.parentElement.appendChild(this.drawerElement)},ppi.prototype.initReplyView=function(e){var t=this,i=(this.replyViewContainer=Q("div",{className:"e-de-cmt-rply-view"}),this.commentPane.parentPane.isNewComment&&(this.replyViewContainer.style.display="none"),this.replyViewTextBox=Q("div",{className:"e-de-cmt-textarea e-input"}),this.replyViewTextBox.addEventListener("paste",function(e){t.updatePastedText(e,t.replyViewTextBox)}),this.replyViewTextBox.style.borderWidth="0 0 1px 0",this.replyViewTextBox.setAttribute("placeholder",e.getConstant("Reply")),this.replyViewTextBox.addEventListener("click",this.enableReplyView.bind(this)),this.replyViewTextBox.addEventListener("keydown",this.updateReplyTextAreaHeight.bind(this)),this.replyViewTextBox.addEventListener("keyup",this.enableDisableReplyPostButton.bind(this)),Q("div",{styles:"display:none",className:"e-de-cmt-action-button"})),n=Q("button",{className:"e-de-cmt-post-btn e-de-overlay e-btn e-flat",attrs:{type:"button"}}),o=(this.replyPostButton=new zv({cssClass:"e-btn e-flat e-primary",iconCss:"e-de-cmt-post",disabled:!0},n),this.replyMention=new c7({dataSource:this.owner.documentEditorSettings.mentionSettings.dataSource,fields:this.owner.documentEditorSettings.mentionSettings.fields,select:this.onSelect.bind(this)}),n.addEventListener("click",this.postReply.bind(this)),n.title=e.getConstant("Post"),Q("button",{className:"e-de-cmt-cancel-btn e-btn e-flat",attrs:{type:"button"}}));o.setAttribute("aria-label",e.getConstant("Cancel")),this.replyCancelButton=new zv({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),i.style.marginTop="8px",this.replyFooter=i,this.replyViewContainer.appendChild(this.replyViewTextBox),this.replyViewContainer.appendChild(i),this.parentElement.appendChild(this.replyViewContainer),this.replyMention.appendTo(this.replyViewTextBox)},ppi.prototype.initResolveOption=function(e){var t=Q("div",{className:"e-de-cmt-resolve-btn"}),i=Q("div",{className:"e-de-cmt-resolve-btn"}),n=Q("div",{className:"e-de-cmt-resolve-btn"}),o=Q("button",{className:"e-de-cmt-post-btn e-btn e-flat",attrs:{type:"button"}}),r=(this.reopenButton=new zv({cssClass:"e-btn e-flat",iconCss:"e-de-cmt-reopen"},o),o.title=e.getConstant("Reopen"),o.setAttribute("aria-label",e.getConstant("Reopen")),o.addEventListener("click",this.reopenButtonClick.bind(this)),Q("button",{className:"e-de-cmt-cancel-btn e-btn e-flat",attrs:{type:"button"}}));r.title=e.getConstant("Delete"),r.setAttribute("aria-label",e.getConstant("Delete")),this.deleteButton=new zv({cssClass:"e-btn e-flat",iconCss:"e-de-cmt-delete"},r),r.addEventListener("click",this.deleteComment.bind(this)),t.appendChild(o),t.appendChild(r),i.appendChild(this.resolveDiv),n.appendChild(o),n.appendChild(r),t.appendChild(i),i.appendChild(n),i.style.display="flex",i.style.justifyContent="space-between",i.style.alignItems="center",n.style.display="flex",n.style.justifyContent="center",n.style.alignItems="center",n.style.marginTop="0px",this.resolveView=t,this.parentElement.appendChild(t)},ppi.prototype.reopenButtonClick=function(){this.owner.editorModule.reopenComment(this.comment)},ppi.prototype.deleteComment=function(){var e={author:this.comment.author,cancel:!1},e=(this.owner.trigger(_Jt,e),{author:this.comment.author,cancel:e.cancel,type:"Delete",mentions:this.comment.mentions});this.owner.trigger(VJt,e),e.cancel||this.owner.editorModule.deleteCommentInternal(this.comment)},ppi.prototype.updateReplyTextAreaHeight=function(e){var t=this;e&&this.preventKeyboardShortcuts(e),setTimeout(function(){var e;je(t.replyViewTextBox)||(t.replyViewTextBox.style.height="auto",e=t.replyViewTextBox.scrollHeight,t.replyViewTextBox.style.height=e+"px")})},ppi.prototype.preventKeyboardShortcuts=function(e){var t=e.which||e.keyCode,i=!(!e.ctrlKey&&!e.metaKey)||17===t,n=e.shiftKey||16===t,o=e.altKey||18===t,o=i&&66===t||i&&73===t||i&&85===t||o&&n&&53===t||i&&190===t||i&&188===t||i&&n&&76===t||i&&n&&55===t||i&&220===t||i&&n&&76===t||i&&n&&69===t||i&&n&&82===t||i&&n&&74===t||n&&9===t||i&&o&&49<=t&&t<=54||i&&n&&81===t?!0:!1;o&&(e.preventDefault(),e.stopPropagation())},ppi.prototype.enableDisableReplyPostButton=function(){this.replyPostButton.disabled=""===this.replyViewTextBox.innerText,this.replyPostButton.disabled?mt(this.replyPostButton.element,["e-de-overlay"],[]):this.replyPostButton.element.classList.contains("e-de-overlay")&&mt(this.replyPostButton.element,[],["e-de-overlay"])},ppi.prototype.enableReplyView=function(){var e,t=this;this.commentPane.isEditMode||(e={author:this.comment.author,cancel:!1,type:"Reply",mentions:this.comment.mentions},this.owner.trigger(VJt,e),e.cancel&&"Reply"===e.type)||((this.commentPane.currentEditingComment=this).commentPane.isInsertingReply=!0,this.owner.documentHelper.currentSelectedComment!==this.comment&&this.owner.selectionModule.selectComment(this.comment),this.commentPane.isEditMode=!0,this.replyFooter.style.display="block",setTimeout(function(){t.replyViewTextBox.focus()}))},ppi.prototype.postReply=function(){var e=this.replyViewTextBox.innerText;this.cancelReply(),this.updateReplyTextAreaHeight(),this.owner.editorModule.replyComment(this.comment,e,this.itemData),this.itemData&&(this.itemData=[]),this.owner.editorModule.isSkipOperationsBuild||this.owner.editorModule.isRemoteAction||this.owner.fireContentChange(),this.owner.editorModule.isSkipOperationsBuild=!1},ppi.prototype.cancelReply=function(){this.commentPane.currentEditingComment=void 0,this.commentPane.isInsertingReply=!0,this.commentPane.isEditMode=!1,this.replyPostButton.disabled=!0,this.replyViewTextBox.innerText="",this.replyFooter.style.display="none"},ppi.prototype.updateTextAreaHeight=function(e){var t=this;e&&this.preventKeyboardShortcuts(e),setTimeout(function(){var e;je(t.textArea)||(t.textArea.style.height="auto",e=t.textArea.scrollHeight,t.textArea.style.height=e+"px")})},ppi.prototype.showMenuItems=function(){!this.comment.isReply||this.owner.isReadOnly||this.commentPane.isEditMode||je(this.comment)||this.comment.isResolved||(this.menuBar.style.display="block");var e=this.commentPane.getCommentStart(this.comment);je(e)||je(e.commentMark)||e.commentMark.classList.add("e-de-cmt-mark-hover")},ppi.prototype.hideMenuItemOnMouseLeave=function(){var e;this.comment.isReply&&this.owner.documentHelper.currentSelectedComment!==this.comment.ownerComment&&this.hideMenuItems(),!this.commentPane||je(e=this.commentPane.getCommentStart(this.comment))||je(e.commentMark)||e.commentMark.classList.remove("e-de-cmt-mark-hover")},ppi.prototype.hideMenuItems=function(){this.menuBar.style.display="none"},ppi.prototype.enableDisablePostButton=function(){this.postButton.disabled=""===this.textArea.innerText,this.postButton.disabled?mt(this.postButton.element,["e-de-overlay"],[]):this.postButton.element.classList.contains("e-de-overlay")&&mt(this.postButton.element,[],["e-de-overlay"])},ppi.prototype.editComment=function(){var e=this;if(!je(this.commentPane.parentPane)&&!this.commentPane.parentPane.postReply){var t={author:this.comment.author,cancel:!1,type:"Edit",mentions:this.comment.mentions};if(this.owner.trigger(VJt,t),t.cancel&&"Edit"===t.type)return}(this.commentPane.currentEditingComment=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()})},ppi.prototype.resolveComment=function(){mt(this.parentElement,["e-de-cmt-resolved"],[]),this.resolveDiv.style.display="inline";var e=new Cn("documenteditor",this.owner.defaultLocale);e.setLocale(this.owner.locale),this.dropDownButton.items=[{text:e.getConstant("Reopen")},{text:e.getConstant("Delete")}]},ppi.prototype.reopenComment=function(){mt(this.parentElement,[],["e-de-cmt-resolved"]),this.resolveDiv.style.display="none";var e=new Cn("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()},ppi.prototype.postComment=function(){this.comment.isPosted=!0,this.itemData&&(this.comment.mentions=this.itemData,this.itemData=[]);var e,t={author:this.comment.author,cancel:!1,type:"Post",text:this.textArea.innerText,mentions:this.comment.mentions};this.owner.trigger(VJt,t),t.cancel&&"Post"===t.type||(t=this.textArea.innerHTML,this.owner.editorModule&&""!=this.comment.text&&this.comment.text!=t&&(this.owner.editorModule.initHistory("EditComment"),e={commentId:this.comment.commentId,text:this.comment.text},this.owner.editorHistoryModule.currentBaseHistoryInfo.modifiedProperties.push(e),this.owner.editorHistoryModule.currentBaseHistoryInfo.removedNodes.push(this.comment),this.owner.editorHistoryModule.updateHistory()),this.commentText.innerHTML=t,this.comment.text=t,this.showCommentView(),this.commentPane&&this.commentPane.parentPane&&(this.commentPane.parentPane.isNewComment=!1),je(this.replyViewContainer)||(this.replyViewContainer.style.display=""),this.owner.editorModule.isSkipOperationsBuild)||this.owner.editorModule.isRemoteAction||this.owner.fireContentChange()},ppi.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"},ppi.prototype.cancelEditing=function(){var e;this.showCommentView(),this.textArea.innerHTML=this.comment.text.trim(),this.commentPane.parentPane.isNewComment&&(this.commentPane&&this.commentPane.parentPane&&(this.commentPane.parentPane.isNewComment=!1),(e=this.owner).editorModule.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.commentPane.parentPane.discardComment(this.comment),e.editorModule.isSkipOperationsBuild=!1)},ppi.prototype.showOrHideDrawer=function(){this.isDrawerExpand?this.hideDrawer():this.showDrawer()},ppi.prototype.hideDrawer=function(){if(this.parentElement){var e=new Cn("documenteditor",this.owner.defaultLocale),t=(e.setLocale(this.owner.locale),this.parentElement.getElementsByClassName("e-de-cmt-sub-container"));if(1<t.length){for(var i=1;i<t.length;i++)t[i].style.display="none";this.drawerElement.style.display="block",mt(this.drawerSpanElement,[],["e-de-nav-up"]),this.drawerSpanElement.innerText="+"+(t.length-1)+" "+e.getConstant("more")+"..."}this.isDrawerExpand=!1}},ppi.prototype.showDrawer=function(){if(this.parentElement){var e=this.parentElement.getElementsByClassName("e-de-cmt-sub-container");if(1<e.length){for(var t=0;t<e.length;t++)e[t].style.display="block";this.drawerElement.style.display="block",this.drawerSpanElement.innerText="",mt(this.drawerSpanElement,["e-de-nav-up"],[])}this.isDrawerExpand=!0}},ppi.prototype.userOptionSelectEvent=function(e){var e=e.item.text,t=new Cn("documenteditor",this.owner.defaultLocale);switch(t.setLocale(this.owner.locale),e){case t.getConstant("Edit"):this.editComment();break;case t.getConstant("Reply"):this.enableReplyView();break;case t.getConstant("Delete"):this.deleteComment();break;case t.getConstant("Resolve"):this.owner.editorModule.resolveComment(this.comment);break;case t.getConstant("Reopen"):this.owner.editorModule.reopenComment(this.comment)}},ppi.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)))},ppi.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.cancelButton=void 0,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.parentElement&&(this.parentElement.innerHTML="",this.parentElement.parentElement)&&this.parentElement.parentElement.removeChild(this.parentElement),this.parentElement=void 0,this.commentView&&(this.commentView.innerHTML="",this.commentView.parentElement)&&this.commentView.parentElement.removeChild(this.commentView),this.commentView=void 0,this.replyViewContainer&&(this.replyViewContainer.innerHTML="",this.replyViewContainer.remove(),this.replyViewContainer=null),this.replyViewTextBox=void 0,this.replyFooter=void 0,this.resolveView&&(this.resolveView.innerHTML="",this.resolveView.remove(),this.resolveView=null),this.menuBar=void 0,this.drawerAction=void 0,this.commentText=void 0,this.commentDate=void 0,this.textAreaContainer&&(this.textAreaContainer.innerHTML="",this.textAreaContainer.remove(),this.textAreaContainer=null),this.drawerElement=void 0,this.drawerSpanElement=void 0,this.commentPane=void 0,this.owner=void 0};var dpi=ppi;function ppi(e,t,i){this.isReply=!1,this.isDrawerExpand=!1,this.itemData=[],this.owner=e,this.comment=i,this.commentPane=t}upi.prototype.getModuleName=function(){return"HyperlinkDialog"},upi.prototype.initHyperlinkDialog=function(e,t){this.target=Q("div",{className:"e-de-hyperlink"}),this.container=Q("div"),this.displayText1=Q("div",{className:"e-de-dlg-container"}),this.displayTextBox=Q("input",{className:"e-input"}),this.displayTextBox.addEventListener("keyup",this.keyUpOnDisplayBoxClickHandler),this.displayText1.appendChild(this.displayTextBox),this.container.appendChild(this.displayText1),this.addressText=Q("div",{className:"e-de-dlg-container"}),this.urlTextBox=Q("input",{className:"e-input",attrs:{autofocus:"true"}}),this.urlTextBox.addEventListener("input",this.onKeyUpOnUrlBoxClickHandler),this.urlTextBox.addEventListener("keyup",this.onKeyUpOnUrlBoxClickHandler),this.addressText.appendChild(this.urlTextBox),this.container.appendChild(this.addressText),this.screenTipText1=Q("div",{className:"e-de-dlg-container"}),this.screenTipTextBox=Q("input",{className:"e-input"}),this.screenTipTextBox.addEventListener("keyup",this.onScreenTipTextBoxClickHandler),this.screenTipText1.appendChild(this.screenTipTextBox),this.container.appendChild(this.screenTipText1),this.bookmarkDiv=Q("div",{styles:"display:none;"}),this.bookmarkText=Q("div",{className:"e-de-dlg-container"}),this.bookmarkValue=Q("input"),this.bookmarkText.appendChild(this.bookmarkValue),this.bookmarkDropdown=new qz({dataSource:[],change:this.onBookmarkchange,noRecordsTemplate:e.getConstant("No bookmarks found"),placeholder:e.getConstant("Bookmark"),floatLabelType:"Always"}),this.bookmarkDropdown.appendTo(this.bookmarkValue),this.bookmarkDiv.appendChild(this.bookmarkText),this.container.appendChild(this.bookmarkDiv),this.bookmarkCheckDiv=Q("div"),this.bookmarkCheck=Q("input",{attrs:{type:"checkbox"}}),this.bookmarkCheckDiv.appendChild(this.bookmarkCheck),this.bookmarkCheckbox=new ib({label:e.getConstant("Use bookmarks"),enableRtl:t,change:this.onUseBookmarkChange}),this.bookmarkCheckbox.appendTo(this.bookmarkCheck),this.container.appendChild(this.bookmarkCheckDiv),this.target.appendChild(this.container),new fV({placeholder:e.getConstant("Text to display"),floatLabelType:"Always"},this.displayTextBox),new fV({placeholder:e.getConstant("Address"),floatLabelType:"Always"},this.urlTextBox),new fV({placeholder:e.getConstant("ScreenTip text"),floatLabelType:"Always"},this.screenTipTextBox)},upi.prototype.show=function(){this.localObj=new Cn("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()},upi.prototype.hide=function(){this.closeHyperlinkDialog()},upi.prototype.onKeyUpOnUrlBoxClick=function(e){this.onKeyUpOnUrlBox(e)},upi.prototype.onKeyUpOnDisplayBoxClick=function(){this.onKeyUpOnDisplayBox()},upi.prototype.onScreenTipTextBoxClick=function(){this.onScreenTipTextBox()},upi.prototype.enableOrDisableInsertButton=function(){je(this.insertButton)||(this.bookmarkCheckbox.checked?this.insertButton.disabled=""===this.bookmarkDropdown.value||null==this.bookmarkDropdown.value:this.insertButton.disabled=""===this.urlTextBox.value||""===this.displayTextBox.value)},upi.prototype.onInsertHyperlink=function(){var e=go.sanitize(this.displayTextBox.value.trim()),t=this.urlTextBox.value.trim(),i=((Y.startsWith(t,"http://")||Y.startsWith(t,"https://"))&&(t=go.sanitize(t.replace(/\s/g,""))),go.sanitize(this.screenTipTextBox.value.trim())),n=!1;je(this.bookmarkDropdown.value)||""===this.bookmarkDropdown.value||!0!==this.bookmarkCheckbox.checked||(t=this.bookmarkDropdown.value,n=!0),""===t?this.documentHelper.hideDialog():(""!==i&&(t=t+'"\\o "'+i),e=""===e&&""!==t?t:this.displayTextBox.value,je(this.navigationUrl)?(i=(this.documentHelper.selection.text!==e||-1===this.documentHelper.selection.text.indexOf("\r"))&&!this.displayTextBox.disabled,this.documentHelper.owner.editorModule.insertHyperlinkInternal(t,e,i,n)):this.documentHelper.owner.editorModule.editHyperlink(this.documentHelper.selection,t,e,n),this.documentHelper.hideDialog(),this.navigationUrl=void 0)},upi.prototype.clearValue=function(){this.displayTextBox.value="",this.urlTextBox.value="",this.screenTipText="",this.screenTipTextBox.value="",this.displayText="",this.displayTextBox.disabled=!1,this.bookmarks=[]},upi.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.screenTipTextBox&&(this.screenTipTextBox.parentElement.removeChild(this.screenTipTextBox),this.screenTipTextBox=void 0),this.documentHelper=void 0,je(this.target)||(this.target.parentElement&&this.target.parentElement.removeChild(this.target),this.target.innerHTML="",this.target=void 0),this.removeEvents(),this.removeElements()},upi.prototype.removeEvents=function(){this.displayTextBox&&this.displayTextBox.removeEventListener("keyup",this.keyUpOnDisplayBoxClickHandler),this.urlTextBox&&(this.urlTextBox.removeEventListener("input",this.onKeyUpOnUrlBoxClickHandler),this.urlTextBox.removeEventListener("keyup",this.onKeyUpOnUrlBoxClickHandler)),this.screenTipTextBox&&this.screenTipTextBox.removeEventListener("keyup",this.onScreenTipTextBoxClickHandler)},upi.prototype.removeElements=function(){this.container&&(this.container.remove(),this.container=void 0),this.displayText1&&(this.displayText1.remove(),this.displayText1=void 0),this.addressText&&(this.addressText.remove(),this.addressText=void 0),this.screenTipText1&&(this.screenTipText1.remove(),this.screenTipText1=void 0),this.bookmarkDiv&&(this.bookmarkDiv.remove(),this.bookmarkDiv=void 0),this.bookmarkText&&(this.bookmarkText.remove(),this.bookmarkText=void 0),this.bookmarkValue&&(this.bookmarkValue.remove(),this.bookmarkValue=void 0),this.bookmarkCheckDiv&&(this.bookmarkCheckDiv.remove(),this.bookmarkCheckDiv=void 0),this.bookmarkCheck&&(this.bookmarkCheck.remove(),this.bookmarkCheck=void 0)};var cpi=upi;function upi(e){var o=this;this.displayText="",this.navigationUrl=void 0,this.screenTipText="",this.bookmarkDropdown=void 0,this.bookmarkCheckbox=void 0,this.keyUpOnDisplayBoxClickHandler=this.onKeyUpOnDisplayBoxClick.bind(this),this.onKeyUpOnUrlBoxClickHandler=this.onKeyUpOnUrlBoxClick.bind(this),this.onScreenTipTextBoxClickHandler=this.onScreenTipTextBoxClick.bind(this),this.bookmarks=[],this.onKeyUpOnUrlBox=function(e){13===e.keyCode?""!==o.displayTextBox.value&&""!==o.urlTextBox.value&&o.onInsertHyperlink():("www."===(e=o.urlTextBox.value).substring(0,4).toLowerCase()&&(o.urlTextBox.value="http://"+e),""===o.displayText&&(o.displayTextBox.value=e),o.enableOrDisableInsertButton())},this.onKeyUpOnDisplayBox=function(){o.displayText=o.displayTextBox.value,o.enableOrDisableInsertButton()},this.onScreenTipTextBox=function(){o.screenTipText=o.screenTipTextBox.value},this.onInsertButtonClick=function(){o.onInsertHyperlink()},this.onCancelButtonClick=function(){o.documentHelper.dialog.hide(),o.clearValue(),o.documentHelper.updateFocus()},this.loadHyperlinkDialog=function(){o.documentHelper.updateFocus(),o.bookmarks=[];for(var e=0;e<o.documentHelper.bookmarks.keys.length;e++){var t=o.documentHelper.bookmarks.keys[parseInt(e.toString(),10)];0!==t.indexOf("_")&&o.bookmarks.push(t)}var i,n=o.documentHelper.selection.getHyperlinkField();je(n)?(o.displayText=o.documentHelper.selection.getText(!0),""!==o.displayText&&(-1!==o.displayText.indexOf(String.fromCharCode(65532))||-1!==o.displayText.indexOf("\r")&&-1!==o.displayText.lastIndexOf("\r")&&-1!==o.displayText.slice(0,-1).indexOf("\r")?(o.displayTextBox.value="<<Selection in document>>",o.displayTextBox.disabled=!0):o.displayTextBox.value=o.displayText)):(je(n.fieldSeparator)||(i=o.documentHelper.selection.getHyperlinkDisplayText(n.fieldSeparator.line.paragraph,n.fieldSeparator,n.fieldEnd,!1,void 0),o.displayText=i.displayText,o.displayTextBox.disabled=i.isNestedField),o.displayTextBox.value=o.displayText,o.screenTipTextBox.value=o.documentHelper.selection.getLinkText(n,!1),i=o.documentHelper.selection.getLinkText(n,!0),o.urlTextBox.value=o.navigationUrl=i,o.documentHelper.dialog.header=o.localObj.getConstant("Edit Hyperlink")),o.bookmarkDiv.style.display="none",o.addressText.style.display="block",o.urlTextBox.style.display="block",o.bookmarkCheckbox.checked=!1,o.bookmarkDropdown.dataSource=o.documentHelper.bookmarks.keys,o.insertButton=document.getElementsByClassName("e-hyper-insert")[0],o.enableOrDisableInsertButton(),o.urlTextBox.focus(),"none"!==o.documentHelper.selection.caret.style.display&&(o.documentHelper.selection.caret.style.display="none")},this.closeHyperlinkDialog=function(){o.clearValue(),o.documentHelper.updateFocus()},this.onUseBookmarkChange=function(e){e.checked?(o.bookmarkDiv.style.display="block",o.bookmarkDropdown.dataSource=o.bookmarks,o.addressText.style.display="none",o.urlTextBox.style.display="none"):(o.bookmarkDiv.style.display="none",o.addressText.style.display="block",o.urlTextBox.style.display="block"),o.enableOrDisableInsertButton()},this.onBookmarkchange=function(){""!==o.bookmarkDropdown.value&&(o.insertButton.disabled=!1)},this.documentHelper=e}mpi.prototype.getModuleName=function(){return"TableDialog"},mpi.prototype.initTableDialog=function(e){this.target=Q("div",{className:"e-de-insert-table"}),this.parentDiv=Q("div"),this.columnValue=Q("div",{className:"e-de-container-row"}),this.columnsCountBox=Q("input",{attrs:{type:"text"}}),this.columnValue.appendChild(this.columnsCountBox),this.columnsCountBox.setAttribute("aria-labelledby",e.getConstant("Insert Table")),this.rowValue=Q("div"),this.rowsCountBox=Q("input",{attrs:{type:"text"}}),this.rowValue.appendChild(this.rowsCountBox),this.parentDiv.appendChild(this.columnValue),this.parentDiv.appendChild(this.rowValue),this.target.appendChild(this.parentDiv),this.rowValueTextBox=new NL({format:"#",value:2,min:1,strictMode:!0,enablePersistence:!1,placeholder:e.getConstant("Number of rows"),floatLabelType:"Always"}),this.rowValueTextBox.appendTo(this.rowsCountBox),this.rowsCountBox.setAttribute("aria-labelledby",e.getConstant("Number of rows")),this.columnValueTexBox=new NL({format:"#",value:2,min:1,strictMode:!0,enablePersistence:!1,placeholder:e.getConstant("Number of columns"),floatLabelType:"Always"}),this.columnsCountBox.setAttribute("aria-labelledby",e.getConstant("Number of columns")),this.parentDiv.setAttribute("aria-labelledby",e.getConstant("Insert Table")),this.parentDiv.setAttribute("aria-describedby",e.getConstant("Insert Table")),this.columnValueTexBox.appendTo(this.columnsCountBox)},mpi.prototype.show=function(){var e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.localeValue=e,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()},mpi.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,this.removeElements(),!je(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[parseInt(e.toString(),10)]),e--;this.target=void 0}},mpi.prototype.removeElements=function(){this.parentDiv&&(this.parentDiv.remove(),this.parentDiv=void 0),this.columnValue&&(this.columnValue.remove(),this.columnValue=void 0),this.rowValue&&(this.rowValue.remove(),this.rowValue=void 0)};var gpi=mpi;function mpi(e){var i=this;this.onCancelButtonClick=function(){i.documentHelper.dialog.hide(),i.documentHelper.updateFocus()},this.onInsertTableClick=function(){var e,t;i.columnValueTexBox.value<1||i.columnValueTexBox.value>i.documentHelper.owner.documentEditorSettings.maximumColumns?(e=i.localeValue.getConstant("Number of columns must be between")+" 1 "+i.localeValue.getConstant("and")+" "+i.documentHelper.owner.documentEditorSettings.maximumColumns.toString(),WC.alert(e).enableRtl=i.documentHelper.owner.enableRtl):i.rowValueTextBox.value<1||i.rowValueTextBox.value>i.documentHelper.owner.documentEditorSettings.maximumRows?(e=i.localeValue.getConstant("Number of rows must be between")+" 1 "+i.localeValue.getConstant("and")+" "+i.documentHelper.owner.documentEditorSettings.maximumColumns.toString(),WC.alert(e).enableRtl=i.documentHelper.owner.enableRtl):i.rowValueTextBox.value<=i.documentHelper.owner.documentEditorSettings.maximumRows&&i.columnValueTexBox.value<=i.documentHelper.owner.documentEditorSettings.maximumColumns&&(e=i.rowValueTextBox.value,t=i.columnValueTexBox.value,je(e)&&je(t)||i.documentHelper.owner.editorModule.insertTable(e,t),i.documentHelper.hideDialog())},this.documentHelper=e}ypi.prototype.getModuleName=function(){return"BookmarkDialog"},ypi.prototype.initBookmarkDialog=function(e,t,i){var n=this.documentHelper.owner.containerId+"_insert_bookmark",n=(this.target=Q("div",{id:n,className:"e-de-bookmark"}),e.getConstant("Bookmark name")+":"),n=(this.dlgFields=Q("div",{innerHTML:n,className:"e-bookmark-dlgfields"}),this.target.appendChild(this.dlgFields),this.commonDiv=Q("div",{className:"e-bookmark-common"}),this.target.appendChild(this.commonDiv),this.searchDiv=Q("div",{className:"e-bookmark-list"}),this.commonDiv.appendChild(this.searchDiv),i&&this.searchDiv.classList.add("e-de-rtl"),this.textBoxDiv=Q("div",{className:"e-bookmark-textboxdiv"}),this.searchDiv.appendChild(this.textBoxDiv),this.textBoxInput=Q("input",{className:"e-input e-bookmark-textbox-input",id:"bookmark_text_box",attrs:{autofocus:"true"}}),this.textBoxInput.setAttribute("type","text"),this.textBoxInput.setAttribute("aria-label",e.getConstant("Bookmark name")),this.textBoxDiv.appendChild(this.textBoxInput),this.listviewDiv=Q("div",{className:"e-bookmark-listViewDiv",id:"bookmark_listview",attrs:{tabindex:"-1",role:"listbox"}}),this.listviewDiv.setAttribute("aria-label",e.getConstant("BookMarkList")),this.searchDiv.appendChild(this.listviewDiv),this.listviewInstance=new MH({dataSource:t,cssClass:"e-bookmark-listview"}),void 0===t||0===t.length);this.listviewInstance.appendTo(this.listviewDiv),this.listviewInstance.addEventListener("select",this.listViewInstanceClickHandler),this.buttonDiv=Q("div",{className:"e-bookmark-button"}),this.commonDiv.appendChild(this.buttonDiv),this.addbuttonDiv=Q("div",{className:"e-bookmark-addbutton"}),this.buttonDiv.appendChild(this.addbuttonDiv),this.addButtonElement=Q("button",{innerHTML:e.getConstant("Add"),id:"add",attrs:{type:"button"}}),this.addButtonElement.setAttribute("aria-label",e.getConstant("Add")),this.addbuttonDiv.appendChild(this.addButtonElement),this.addButton=new zv({cssClass:"e-button-custom"}),this.addButton.disabled=!0,this.addButton.appendTo(this.addButtonElement),this.textBoxInput.addEventListener("input",this.onKeyUpOnTextBoxClickHandler),this.textBoxInput.addEventListener("keyup",this.onKeyUpOnTextBoxClickHandler),this.addButtonElement.addEventListener("click",this.addBookmarkClickHandler),this.deleteButtonDiv=Q("div",{className:"e-bookmark-deletebutton"}),this.buttonDiv.appendChild(this.deleteButtonDiv),this.deleteButtonElement=Q("button",{innerHTML:e.getConstant("Delete"),id:"delete",attrs:{type:"button"}}),this.deleteButtonElement.setAttribute("aria-label",e.getConstant("Delete")),this.deleteButtonDiv.appendChild(this.deleteButtonElement),this.deleteButton=new zv({cssClass:"e-button-custom"}),this.deleteButton.disabled=n,this.deleteButton.appendTo(this.deleteButtonElement),this.deleteButtonElement.addEventListener("click",this.deleteBookmarkClickHandler),this.gotoButtonDiv=Q("div",{className:"e-bookmark-gotobutton"}),this.buttonDiv.appendChild(this.gotoButtonDiv),this.gotoButtonElement=Q("button",{innerHTML:e.getConstant("Go To"),id:"goto",attrs:{type:"button"}}),this.gotoButtonElement.setAttribute("aria-label",e.getConstant("Go To")),this.gotoButtonDiv.appendChild(this.gotoButtonElement),this.gotoButton=new zv({cssClass:"e-button-custom"}),this.gotoButton.disabled=n,this.gotoButton.appendTo(this.gotoButtonElement),this.gotoButtonElement.addEventListener("click",this.gotoBookmarkClickHandler)},ypi.prototype.onListInstanceClicked=function(e){this.selectHandler(e)},ypi.prototype.onKeyUpOnTextBoxClicked=function(){this.onKeyUpOnTextBox()},ypi.prototype.onAddBookmarkClicked=function(){this.addBookmark()},ypi.prototype.onDeleteBookmarkClicked=function(){this.deleteBookmark()},ypi.prototype.onGotoBookmarkClicked=function(){this.gotoBookmark()},ypi.prototype.show=function(){var e=this.documentHelper.getBookmarks(),t=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);t.setLocale(this.documentHelper.owner.locale),this.initBookmarkDialog(t,e,this.documentHelper.owner.enableRtl),this.documentHelper.dialog.header=t.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:t.getConstant("Cancel"),cssClass:"e-flat e-hyper-insert",isPrimary:!0}}],this.documentHelper.dialog.dataBind(),void 0!==e&&0!==e.length&&(t=e[0],this.listviewInstance.selectItem(t)),this.documentHelper.dialog.show()},ypi.prototype.enableOrDisableButton=function(){var e=this.textBoxInput.value.trim();je(this.addButton)||(this.addButton.disabled=!/^[_a-zA-Z0-9]+$/.test(e))},ypi.prototype.focusTextBox=function(e){this.textBoxInput.value=e;var t=document.getElementById("bookmark_text_box");t.setSelectionRange(0,e.length),t.focus(),this.enableOrDisableButton()},ypi.prototype.removeObjects=function(){this.documentHelper.hideDialog()},ypi.prototype.destroy=function(){this.removeEvents(),this.removeElements(),this.textBoxInput&&(this.textBoxInput.remove(),this.textBoxInput=void 0),this.listviewInstance&&(this.listviewInstance.destroy(),this.listviewInstance=void 0),this.documentHelper=void 0},ypi.prototype.removeElements=function(){this.dlgFields&&(this.dlgFields.remove(),this.dlgFields=void 0),this.commonDiv&&(this.commonDiv.remove(),this.commonDiv=void 0),this.target&&(this.target.remove(),this.target=void 0),this.textBoxDiv&&(this.textBoxDiv.remove(),this.textBoxDiv=void 0),this.searchDiv&&(this.searchDiv.remove(),this.searchDiv=void 0),this.listviewDiv&&(this.listviewDiv.remove(),this.listviewDiv=void 0),this.buttonDiv&&(this.buttonDiv.remove(),this.buttonDiv=void 0),this.addbuttonDiv&&(this.addbuttonDiv.remove(),this.addbuttonDiv=void 0),this.deleteButtonDiv&&(this.deleteButtonDiv.remove(),this.deleteButtonDiv=void 0),this.gotoButtonDiv&&(this.gotoButtonDiv.remove(),this.gotoButtonDiv=void 0),this.addButtonElement&&(this.addButtonElement.remove(),this.addButtonElement=void 0),this.deleteButtonElement&&(this.deleteButtonElement.remove(),this.deleteButtonElement=void 0),this.gotoButtonElement&&(this.gotoButtonElement.remove(),this.gotoButtonElement=void 0),this.addButton&&(this.addButton.destroy(),this.addButton=void 0),this.deleteButton&&(this.deleteButton.destroy(),this.deleteButton=void 0),this.gotoButton&&(this.gotoButton.destroy(),this.gotoButton=void 0)},ypi.prototype.removeEvents=function(){this.listviewInstance&&this.listviewInstance.removeEventListener("select",this.listViewInstanceClickHandler),this.textBoxInput&&(this.textBoxInput.removeEventListener("input",this.onKeyUpOnTextBoxClickHandler),this.textBoxInput.removeEventListener("keyup",this.onKeyUpOnTextBoxClickHandler)),this.addButtonElement&&this.addButtonElement.removeEventListener("click",this.addBookmarkClickHandler),this.deleteButtonElement&&this.deleteButtonElement.removeEventListener("click",this.deleteBookmarkClickHandler),this.gotoButtonElement&&this.gotoButtonElement.removeEventListener("click",this.gotoBookmarkClickHandler)};var fpi=ypi;function ypi(e){var t=this;this.listViewInstanceClickHandler=this.onListInstanceClicked.bind(this),this.onKeyUpOnTextBoxClickHandler=this.onKeyUpOnTextBoxClicked.bind(this),this.addBookmarkClickHandler=this.onAddBookmarkClicked.bind(this),this.deleteBookmarkClickHandler=this.onDeleteBookmarkClicked.bind(this),this.gotoBookmarkClickHandler=this.onGotoBookmarkClicked.bind(this),this.onKeyUpOnTextBox=function(){t.enableOrDisableButton()},this.addBookmark=function(){t.documentHelper.owner.editorModule.insertBookmark(go.sanitize(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}bpi.prototype.getModuleName=function(){return"TableOfContentsDialog"},bpi.prototype.initTableOfContentDialog=function(e,t){var i=this.documentHelper.owner.containerId,n=(this.target=Q("div",{id:i+"_toc_dialog",className:"e-de-toc-dlg-container"}),this.generalDiv=Q("div",{id:"general_div",className:"e-de-toc-dlg-sub-container"}),this.target.appendChild(this.generalDiv),this.genLabel=Q("div",{id:i+"_genLabel",className:"e-de-toc-dlg-main-heading",styles:"margin-bottom: 13px;",innerHTML:e.getConstant("General")}),this.generalDiv.appendChild(this.genLabel),this.topContainer=Q("div",{className:"e-de-container-row"}),this.leftGeneralDiv=Q("div",{className:"e-de-subcontainer-left"}),this.topContainer.appendChild(this.leftGeneralDiv),this.rightGeneralDiv=Q("div",{className:"e-de-subcontainer-right"}),this.topContainer.appendChild(this.rightGeneralDiv),this.generalDiv.appendChild(this.topContainer),this.bottomContainer=Q("div",{className:"e-de-dlg-row"}),this.leftBottomGeneralDiv=Q("div",{className:"e-de-subcontainer-left"}),this.bottomContainer.appendChild(this.leftBottomGeneralDiv),this.rightBottomGeneralDiv=Q("div",{className:"e-de-subcontainer-right"}),this.bottomContainer.appendChild(this.rightBottomGeneralDiv),this.pageNumberDiv=Q("div",{className:"e-de-toc-dlg-sub-container"}),this.pageNumber1=Q("input",{attrs:{type:"checkbox"},id:this.target.id+"_pageNumber"}),this.pageNumberDiv.appendChild(this.pageNumber1),this.rightAlignDiv=Q("div",{className:"e-de-toc-dlg-sub-container"}),this.rightAlign1=Q("input",{attrs:{type:"checkbox"},id:this.target.id+"_rightAlign"}),this.rightAlignDiv.appendChild(this.rightAlign1),this.pageNumber=new ib({label:e.getConstant("Show page numbers"),enableRtl:t,checked:!0,change:this.changePageNumberValue}),this.rightAlign=new ib({label:e.getConstant("Right align page numbers"),enableRtl:t,checked:!0,change:this.changeRightAlignValue}),this.pageNumber.appendTo(this.pageNumber1),this.rightAlign.appendTo(this.rightAlign1),this.tabDivContainer=Q("div",{className:"e-de-container-row"}),this.tabDiv=Q("div",{className:"e-de-subcontainer-left"}),this.tabLeaderLabelDiv=Q("div"),this.tabLeaderLabel=Q("label",{className:"e-de-toc-dlg-heading",innerHTML:e.getConstant("Tab leader")+":"}),this.tabLeaderLabelDiv.appendChild(this.tabLeaderLabel),this.tabLeaderDiv=Q("div",{id:"tabLeader_div"}),this.tabLeader1=Q("select",{id:i+"_tabLeader",innerHTML:'<option value="None">('+e.getConstant("None").toLocaleLowerCase()+')</option><option value="Dot" selected>....................</option><option value="Hyphen">-------------------</option><option value="Underscore">____________</option>'}),this.tabLeaderDiv.appendChild(this.tabLeader1),this.tabDiv.appendChild(this.tabLeaderLabelDiv),this.tabDiv.appendChild(this.tabLeaderDiv),this.leftGeneralDiv.appendChild(this.pageNumberDiv),this.leftGeneralDiv.appendChild(this.rightAlignDiv),this.tabDivContainer.appendChild(this.tabDiv),this.tabLeader=new qz({enableRtl:t}),this.tabLeader.appendTo(this.tabLeader1),this.hyperlink1=Q("input",{attrs:{type:"checkbox"},id:this.target.id+"_hyperlink"}),this.rightGeneralDiv.appendChild(this.hyperlink1),this.hyperlink=new ib({label:e.getConstant("Use hyperlinks instead of page numbers"),cssClass:"e-de-toc-label",enableRtl:t,checked:!0}),this.hyperlink.appendTo(this.hyperlink1),this.showDiv=Q("div",{className:"e-de-subcontainer-right"}),this.showLevelLabelDiv=Q("div",{className:"e-de-toc-dlg-show-level-div"}),this.showLevelLabel=Q("label",{className:"e-de-toc-dlg-heading",innerHTML:e.getConstant("Show levels")+":"}),this.showLevelLabelDiv.appendChild(this.showLevelLabel),this.showLevelDiv=Q("div",{className:"e-de-toc-dlg-showlevel-div"}),this.showLevel1=Q("input",{id:i+"_showLevel",attrs:{type:"text","aria-label":"showLevel"}}),this.showLevelDiv.appendChild(this.showLevel1),this.showDiv.appendChild(this.showLevelLabelDiv),this.showDiv.appendChild(this.showLevelDiv),this.tabDivContainer.appendChild(this.showDiv),this.generalDiv.appendChild(this.tabDivContainer),this.showLevel=new NL({format:"#",value:3,min:1,max:9,change:this.changeShowLevelValue.bind(this)}),this.showLevel.appendTo(this.showLevel1),t&&(this.hyperlink.cssClass="e-de-toc-label-rtl",this.showLevelLabelDiv.classList.add("e-de-rtl"),this.showLevelDiv.classList.add("e-de-rtl"),this.rightBottomGeneralDiv.classList.add("e-de-rtl")),this.buildTableLabel=Q("div",{className:"e-de-toc-dlg-main-heading e-de-toc-dlg-build-table",innerHTML:e.getConstant("Build table of contents from")+":"}),this.generalDiv.appendChild(this.bottomContainer),Q("input",{attrs:{type:"checkbox"},id:this.target.id+"_style"})),n=(this.leftBottomGeneralDiv.appendChild(this.buildTableLabel),this.leftBottomGeneralDiv.appendChild(n),this.style=new ib({label:e.getConstant("Styles"),enableRtl:t,checked:!0,change:this.changeStyleValue}),this.style.appendTo(n),this.table=Q("TABLE",{styles:"margin-top:3px;"}),this.tr1=Q("tr"),this.td1=Q("td",{styles:"width:120px;padding-left:10px;"}),this.availableLabel=Q("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"}),this.td1.appendChild(this.availableLabel),this.td2=Q("td"),this.tocLabel=Q("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"}),this.td2.appendChild(this.tocLabel),this.tr1.appendChild(this.td1),this.tr1.appendChild(this.td2),this.table.appendChild(this.tr1),this.tableDiv=Q("div",{id:"table_div",className:"e-de-toc-table-div"}),this.table1=Q("TABLE"),this.tr2=Q("tr"),this.td3=Q("td"),this.heading1Label=Q("label",{innerHTML:e.getConstant("Heading")+" 1",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading1Label"}),this.td3.appendChild(this.heading1Label),this.td4=Q("td"),this.heading1=Q("input",{id:"_heading1",className:"e-input e-de-toc-dlg-toc-level",attrs:{"aria-label":e.getConstant("Heading")+" 1"}}),this.heading1.value="1",this.heading1.addEventListener("keyup",this.changeStyleClickHandler),this.td4.appendChild(this.heading1),this.tr2.appendChild(this.td3),this.tr2.appendChild(this.td4),this.tr3=Q("tr"),this.td5=Q("td"),this.heading2Label=Q("label",{innerHTML:e.getConstant("Heading")+" 2",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading2Label"}),this.td5.appendChild(this.heading2Label),this.td6=Q("td"),this.heading2=Q("input",{id:"_heading2",className:"e-input e-de-toc-dlg-toc-level",attrs:{"aria-label":e.getConstant("Heading")+" 2"}}),this.heading2.value="2",this.heading2.addEventListener("keyup",this.changeStyleClickHandler),this.td6.appendChild(this.heading2),this.tr3.appendChild(this.td5),this.tr3.appendChild(this.td6),this.tr4=Q("tr"),this.td7=Q("td"),this.heading3Label=Q("label",{innerHTML:e.getConstant("Heading")+" 3",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading3Label"}),this.td7.appendChild(this.heading3Label),this.td8=Q("td"),this.heading3=Q("input",{id:"_heading3",className:"e-input e-de-toc-dlg-toc-level",attrs:{"aria-label":e.getConstant("Heading")+" 3"}}),this.heading3.value="3",this.heading3.addEventListener("keyup",this.changeStyleClickHandler),this.td8.appendChild(this.heading3),this.tr4.appendChild(this.td7),this.tr4.appendChild(this.td8),this.tr5=Q("tr"),this.td9=Q("td"),this.heading4Label=Q("label",{innerHTML:e.getConstant("Heading")+" 4",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading4Label"}),this.td9.appendChild(this.heading4Label),this.td10=Q("td"),this.heading4=Q("input",{id:"_heading4",className:"e-input e-de-toc-dlg-toc-level",attrs:{"aria-label":e.getConstant("Heading")+" 4"}}),this.heading4.addEventListener("keyup",this.changeStyleClickHandler),this.td10.appendChild(this.heading4),this.tr5.appendChild(this.td9),this.tr5.appendChild(this.td10),this.tr6=Q("tr"),this.td11=Q("td"),this.heading5Label=Q("label",{innerHTML:e.getConstant("Heading")+" 5",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading5Label"}),this.td11.appendChild(this.heading5Label),this.td12=Q("td"),this.heading5=Q("input",{id:"_heading5",className:"e-input e-de-toc-dlg-toc-level",attrs:{"aria-label":e.getConstant("Heading")+" 5"}}),this.heading5.addEventListener("keyup",this.changeStyleClickHandler),this.td12.appendChild(this.heading5),this.tr6.appendChild(this.td11),this.tr6.appendChild(this.td12),this.tr7=Q("tr"),this.td13=Q("td"),this.heading6Label=Q("label",{innerHTML:e.getConstant("Heading")+" 6",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading6Label"}),this.td13.appendChild(this.heading6Label),this.td14=Q("td"),this.heading6=Q("input",{id:"_heading6",className:"e-input e-de-toc-dlg-toc-level",attrs:{"aria-label":e.getConstant("Heading")+" 6"}}),this.heading6.addEventListener("keyup",this.changeStyleClickHandler),this.td14.appendChild(this.heading6),this.tr7.appendChild(this.td13),this.tr7.appendChild(this.td14),this.tr8=Q("tr"),this.td15=Q("td"),this.heading7Label=Q("label",{innerHTML:e.getConstant("Heading")+" 7",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading7Label"}),this.td15.appendChild(this.heading7Label),this.td16=Q("td"),this.heading7=Q("input",{id:"_heading7",className:"e-input e-de-toc-dlg-toc-level",attrs:{"aria-label":e.getConstant("Heading")+" 7"}}),this.heading7.addEventListener("keyup",this.changeStyleClickHandler),this.td16.appendChild(this.heading7),this.tr8.appendChild(this.td15),this.tr8.appendChild(this.td16),this.tr9=Q("tr"),this.td17=Q("td"),this.heading8Label=Q("label",{innerHTML:e.getConstant("Heading")+" 8",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading8Label"}),this.td17.appendChild(this.heading8Label),this.td18=Q("td"),this.heading8=Q("input",{id:"_heading8",className:"e-input e-de-toc-dlg-toc-level",attrs:{"aria-label":e.getConstant("Heading")+" 8"}}),this.heading8.addEventListener("keyup",this.changeStyleClickHandler),this.td18.appendChild(this.heading8),this.tr9.appendChild(this.td17),this.tr9.appendChild(this.td18),this.tr10=Q("tr"),this.td19=Q("td"),this.heading9Label=Q("label",{innerHTML:e.getConstant("Heading")+" 9",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading9Label"}),this.td19.appendChild(this.heading9Label),this.td20=Q("td"),this.heading9=Q("input",{id:"_heading9",className:"e-input e-de-toc-dlg-toc-level",attrs:{"aria-label":e.getConstant("Heading")+" 9"}}),this.heading9.addEventListener("keyup",this.changeStyleClickHandler),this.td20.appendChild(this.heading9),this.tr10.appendChild(this.td19),this.tr10.appendChild(this.td20),this.tr12=Q("tr"),this.td23=Q("td"),this.normalLabel=Q("label",{innerHTML:e.getConstant("Normal"),className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_normalLabel"}),this.td23.appendChild(this.normalLabel),this.td24=Q("td"),this.normal=Q("input",{id:"_normal",className:"e-input e-de-toc-dlg-toc-level",attrs:{"aria-label":e.getConstant("Normal")}}),this.normal.addEventListener("keyup",this.changingStyleClickHandler),this.td24.appendChild(this.normal),this.tr12.appendChild(this.td23),this.tr12.appendChild(this.td24),t&&(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")),this.table1.appendChild(this.tr2),this.table1.appendChild(this.tr3),this.table1.appendChild(this.tr4),this.table1.appendChild(this.tr5),this.table1.appendChild(this.tr6),this.table1.appendChild(this.tr7),this.table1.appendChild(this.tr8),this.table1.appendChild(this.tr9),this.table1.appendChild(this.tr10),this.table1.appendChild(this.tr12),this.tableDiv.appendChild(this.table1),this.stylesLevelDiv=Q("div",{className:"e-de-toc-styles-table-div"}),this.stylesLevelDiv.appendChild(this.table),this.stylesLevelDiv.appendChild(this.tableDiv),this.leftBottomGeneralDiv.appendChild(this.stylesLevelDiv),this.fieldsDiv=Q("div",{id:"fields_div",styles:"display: flex;"}),this.leftBottomGeneralDiv.appendChild(this.fieldsDiv),this.outDiv=Q("div",{id:"out_div"}),this.outlineDiv=Q("div",{id:"outline_div",className:"e-de-toc-dlg-sub-container e-de-toc-dlg-outline-levels"}),this.outline1=Q("input",{attrs:{type:"checkbox"},id:"_outline"}),this.outlineDiv.appendChild(this.outline1),this.outDiv.appendChild(this.outlineDiv),this.fieldsDiv.appendChild(this.outDiv),this.outline=new ib({label:e.getConstant("Outline levels"),enableRtl:t,checked:!0,cssClass:"e-de-outline-rtl"}),this.outline.appendTo(this.outline1),this.resetButtonDiv=Q("div",{className:"e-de-toc-reset-button"}),this.fieldsDiv.appendChild(this.resetButtonDiv),this.resetElement=Q("button",{innerHTML:e.getConstant("Reset"),id:"reset",attrs:{type:"button"}}),this.resetButtonDiv.appendChild(this.resetElement),this.resetButton=new zv({cssClass:"e-btn e-flat"}),this.resetButton.appendTo(this.resetElement),this.resetElement.addEventListener("click",this.resetClickHandler),this.tocStylesLabel=Q("div",{id:i+"_tocStylesLabel",className:"e-de-toc-dlg-main-heading",innerHTML:e.getConstant("Styles")+":"}),this.rightBottomGeneralDiv.appendChild(this.tocStylesLabel),this.textBoxDiv=Q("div"),this.rightBottomGeneralDiv.appendChild(this.textBoxDiv),this.textBoxInput=Q("input",{className:"e-input",attrs:{"aria-label":"Type of TOC"}}),this.textBoxInput.setAttribute("type","text"),this.textBoxDiv.appendChild(this.textBoxInput),this.listViewDiv=Q("div",{className:"e-de-toc-list-view"}),this.styleLocaleValue(["TOC 1","TOC 2","TOC 3","TOC 4","TOC 5","TOC 6","TOC 7","TOC 8","TOC 9"],e));this.listViewInstance=new MH({dataSource:n,cssClass:"e-toc-list-view"}),this.listViewInstance.appendTo(this.listViewDiv),this.listViewInstance.addEventListener("select",this.selectHandlerClickHandler),this.rightBottomGeneralDiv.appendChild(this.listViewDiv),this.modifyButtonDiv=Q("div",{className:"e-de-toc-modify-button"}),this.rightBottomGeneralDiv.appendChild(this.modifyButtonDiv),this.modifyElement=Q("button",{innerHTML:e.getConstant("Modify")+"...",id:"modify",attrs:{type:"button"}}),this.modifyButtonDiv.appendChild(this.modifyElement),this.modifyButton=new zv({cssClass:"e-btn e-flat"}),this.modifyButton.appendTo(this.modifyElement),this.modifyElement.addEventListener("click",this.showDialogHandler),t&&(this.resetButtonDiv.classList.add("e-de-rtl"),this.tocStylesLabel.classList.add("e-de-rtl"),this.textBoxDiv.classList.add("e-de-rtl"),this.listViewDiv.classList.add("e-de-rtl"),this.modifyButtonDiv.classList.add("e-de-rtl"))},bpi.prototype.styleLocaleValue=function(e,t){for(var i=[],n=0;n<e.length;n++)i.push(t.getConstant(e[n]));return i},bpi.prototype.show=function(){var e=new Cn("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()},bpi.prototype.onSelectHandlerClick=function(e){this.selectHandler(e)},bpi.prototype.onShowDialog=function(){this.showStyleDialog()},bpi.prototype.changeShowLevelValue=function(e){switch(e.value){case 1:this.changeByValue(["1",null,null,null,null,null,null,null,null]);break;case 2:this.changeByValue(["1","2",null,null,null,null,null,null,null]);break;case 3:this.changeByValue(["1","2","3",null,null,null,null,null,null]);break;case 4:this.changeByValue(["1","2","3","4",null,null,null,null,null]);break;case 5:this.changeByValue(["1","2","3","4","5",null,null,null,null]);break;case 6:this.changeByValue(["1","2","3","4","5","6",null,null,null]);break;case 7:this.changeByValue(["1","2","3","4","5","6","7",null,null]);break;case 8:this.changeByValue(["1","2","3","4","5","6","7","8",null]);break;case 9:this.changeByValue(["1","2","3","4","5","6","7","8","9"])}},bpi.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]},bpi.prototype.onResetClick=function(){this.reset()},bpi.prototype.onChangeStyleClick=function(e){this.changeStyle(e)},bpi.prototype.initAlertDialog=function(e){var t=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),e=(t.setLocale(this.documentHelper.owner.locale),e?t.getConstant("The number must be between"):t.getConstant("The Invalid number"));WC.alert({title:t.getConstant("Information"),content:e,closeOnEscape:!0,showCloseIcon:!0,position:{X:"center",Y:"center"}}).enableRtl=this.documentHelper.owner.enableRtl},bpi.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)},bpi.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"}},bpi.prototype.onChangingStyleClick=function(e){this.changeHeadingStyle(e)},bpi.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}},bpi.prototype.applyLevelSetting=function(e){for(var t=0,i=0,n=!(e.levelSettings={}),o=1;o<=e.endLevel;o++){var r=this.getTOCInputValue(o);if(o===(l=this.getHeadingLevel(o))&&r.match(/^[0-9]+$/))0===t&&(t=o,n=!1),n||(i=o);else{if(n=!0,!r.match(/^[0-9]+$/))return this.initAlertDialog(!1),!1;if(l<1||9<l)return this.initAlertDialog(!0),!1;r="Heading "+o.toString();e.levelSettings[r]=l}}if(e.startLevel=t,e.endLevel=i)for(var s=i+1;s<=9;s++){var a=this.getTOCInputValue(s),l=this.getHeadingLevel(s);if(!a.match(/^[0-9]+$/)&&""!==a)return this.initAlertDialog(!1),!1;if(l<1||9<l)return this.initAlertDialog(!0),!1}if(""!==this.normal.value){var h=parseInt(this.normal.value);if(!this.normal.value.match(/^[0-9]+$/))return this.initAlertDialog(!1),!1;if(h<1||9<h)return this.initAlertDialog(!0),!1;e.levelSettings.Normal=h}return!0},bpi.prototype.getTOCInputValue=function(e){switch(e){case 1:return this.heading1.value;case 2:return this.heading2.value;case 3:return this.heading3.value;case 4:return this.heading4.value;case 5:return this.heading5.value;case 6:return this.heading6.value;case 7:return this.heading7.value;case 8:return this.heading8.value;case 9:return this.heading9.value;default:return""}},bpi.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.removeEvents(),this.removeElements(),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,!je(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}},bpi.prototype.removeEvents=function(){this.heading1&&this.heading1.removeEventListener("keyup",this.changeStyleClickHandler),this.heading2&&this.heading2.removeEventListener("keyup",this.changeStyleClickHandler),this.heading3&&this.heading3.removeEventListener("keyup",this.changeStyleClickHandler),this.heading4&&this.heading4.removeEventListener("keyup",this.changeStyleClickHandler),this.heading5&&this.heading5.removeEventListener("keyup",this.changeStyleClickHandler),this.heading6&&this.heading6.removeEventListener("keyup",this.changeStyleClickHandler),this.heading7&&this.heading7.removeEventListener("keyup",this.changeStyleClickHandler),this.heading8&&this.heading8.removeEventListener("keyup",this.changeStyleClickHandler),this.heading9&&this.heading9.removeEventListener("keyup",this.changeStyleClickHandler),this.normal&&this.normal.removeEventListener("keyup",this.changingStyleClickHandler),this.resetElement&&this.resetElement.removeEventListener("click",this.resetClickHandler),this.listViewInstance&&this.listViewInstance.removeEventListener("select",this.selectHandlerClickHandler),this.modifyElement&&this.modifyElement.removeEventListener("click",this.showDialogHandler)},bpi.prototype.removeElements=function(){this.generalDiv&&(this.generalDiv.remove(),this.generalDiv=void 0),this.genLabel&&(this.genLabel.remove(),this.genLabel=void 0),this.topContainer&&(this.topContainer.remove(),this.topContainer=void 0),this.leftGeneralDiv&&(this.leftGeneralDiv.remove(),this.leftGeneralDiv=void 0),this.rightGeneralDiv&&(this.rightGeneralDiv.remove(),this.rightGeneralDiv=void 0),this.bottomContainer&&(this.bottomContainer.remove(),this.bottomContainer=void 0),this.leftBottomGeneralDiv&&(this.leftBottomGeneralDiv.remove(),this.leftBottomGeneralDiv=void 0),this.rightBottomGeneralDiv&&(this.rightBottomGeneralDiv.remove(),this.rightBottomGeneralDiv=void 0),this.pageNumberDiv&&(this.pageNumberDiv.remove(),this.pageNumberDiv=void 0),this.pageNumber1&&(this.pageNumber1.remove(),this.pageNumber1=void 0),this.rightAlignDiv&&(this.rightAlignDiv.remove(),this.rightAlignDiv=void 0),this.rightAlign1&&(this.rightAlign1.remove(),this.rightAlign1=void 0),this.tabDivContainer&&(this.tabDivContainer.remove(),this.tabDivContainer=void 0),this.tabDiv&&(this.tabDiv.remove(),this.tabDiv=void 0),this.tabLeaderLabelDiv&&(this.tabLeaderLabelDiv.remove(),this.tabLeaderLabelDiv=void 0),this.tabLeaderLabel&&(this.tabLeaderLabel.remove(),this.tabLeaderLabel=void 0),this.tabLeaderDiv&&(this.tabLeaderDiv.remove(),this.tabLeaderDiv=void 0),this.tabLeader1&&(this.tabLeader1.remove(),this.tabLeader1=void 0),this.hyperlink1&&(this.hyperlink1.remove(),this.hyperlink1=void 0),this.hyperlink1&&(this.hyperlink1.remove(),this.hyperlink1=void 0),this.showDiv&&(this.showDiv.remove(),this.showDiv=void 0),this.showLevelLabelDiv&&(this.showLevelLabelDiv.remove(),this.showLevelLabelDiv=void 0),this.showLevelLabel&&(this.showLevelLabel.remove(),this.showLevelLabel=void 0),this.showLevelDiv&&(this.showLevelDiv.remove(),this.showLevelDiv=void 0),this.showLevel1&&(this.showLevel1.remove(),this.showLevel1=void 0),this.buildTableLabel&&(this.buildTableLabel.remove(),this.buildTableLabel=void 0),this.table&&(this.table.remove(),this.table=void 0),this.tr1&&(this.tr1.remove(),this.tr1=void 0),this.td1&&(this.td1.remove(),this.td1=void 0),this.availableLabel&&(this.availableLabel.remove(),this.availableLabel=void 0),this.td2&&(this.td2.remove(),this.td2=void 0),this.tocLabel&&(this.tocLabel.remove(),this.tocLabel=void 0),this.tableDiv&&(this.tableDiv.remove(),this.tableDiv=void 0),this.table1&&(this.table1.remove(),this.table1=void 0),this.tr2&&(this.tr2.remove(),this.tr2=void 0),this.td3&&(this.td3.remove(),this.td3=void 0),this.heading1Label&&(this.heading1Label.remove(),this.heading1Label=void 0),this.td4&&(this.td4.remove(),this.td4=void 0),this.tr3&&(this.tr3.remove(),this.tr3=void 0),this.td5&&(this.td5.remove(),this.td5=void 0),this.heading2Label&&(this.heading2Label.remove(),this.heading2Label=void 0),this.td6&&(this.td6.remove(),this.td6=void 0),this.tr4&&(this.tr4.remove(),this.tr4=void 0),this.td7&&(this.td7.remove(),this.td7=void 0),this.heading3Label&&(this.heading3Label.remove(),this.heading3Label=void 0),this.td8&&(this.td8.remove(),this.td8=void 0),this.tr5&&(this.tr5.remove(),this.tr5=void 0),this.td9&&(this.td9.remove(),this.td9=void 0),this.heading4Label&&(this.heading4Label.remove(),this.heading4Label=void 0),this.td10&&(this.td10.remove(),this.td10=void 0),this.tr6&&(this.tr6.remove(),this.tr6=void 0),this.td11&&(this.td11.remove(),this.td11=void 0),this.heading5Label&&(this.heading5Label.remove(),this.heading5Label=void 0),this.td12&&(this.td12.remove(),this.td12=void 0),this.tr7&&(this.tr7.remove(),this.tr7=void 0),this.td13&&(this.td13.remove(),this.td13=void 0),this.heading6Label&&(this.heading6Label.remove(),this.heading6Label=void 0),this.td14&&(this.td14.remove(),this.td14=void 0),this.tr8&&(this.tr8.remove(),this.tr8=void 0),this.td15&&(this.td15.remove(),this.td15=void 0),this.heading7Label&&(this.heading7Label.remove(),this.heading7Label=void 0),this.td16&&(this.td16.remove(),this.td16=void 0),this.tr9&&(this.tr9.remove(),this.tr9=void 0),this.td17&&(this.td17.remove(),this.td17=void 0),this.heading8Label&&(this.heading8Label.remove(),this.heading8Label=void 0),this.td18&&(this.td18.remove(),this.td18=void 0),this.tr10&&(this.tr10.remove(),this.tr10=void 0),this.td19&&(this.td19.remove(),this.td19=void 0),this.heading9Label&&(this.heading9Label.remove(),this.heading9Label=void 0),this.td20&&(this.td20.remove(),this.td20=void 0),this.tr12&&(this.tr12.remove(),this.tr12=void 0),this.td23&&(this.td23.remove(),this.td23=void 0),this.normalLabel&&(this.normalLabel.remove(),this.normalLabel=void 0),this.td24&&(this.td24.remove(),this.td24=void 0),this.stylesLevelDiv&&(this.stylesLevelDiv.remove(),this.stylesLevelDiv=void 0),this.fieldsDiv&&(this.fieldsDiv.remove(),this.fieldsDiv=void 0),this.outDiv&&(this.outDiv.remove(),this.outDiv=void 0),this.outlineDiv&&(this.outlineDiv.remove(),this.outlineDiv=void 0),this.outline1&&(this.outline1.remove(),this.outline1=void 0),this.resetButtonDiv&&(this.resetButtonDiv.remove(),this.resetButtonDiv=void 0),this.resetElement&&(this.resetElement.remove(),this.resetElement=void 0),this.resetButton&&(this.resetButton.destroy(),this.resetButton=void 0),this.tocStylesLabel&&(this.tocStylesLabel.remove(),this.tocStylesLabel=void 0),this.textBoxDiv&&(this.textBoxDiv.remove(),this.textBoxDiv=void 0),this.listViewDiv&&(this.listViewDiv.remove(),this.listViewDiv=void 0),this.modifyButtonDiv&&(this.modifyButtonDiv.remove(),this.modifyButtonDiv=void 0),this.modifyElement&&(this.modifyElement.remove(),this.modifyElement=void 0),this.modifyButton&&(this.modifyButton.destroy(),this.modifyButton=void 0)};var vpi=bpi;function bpi(e){var n=this;this.changeStyleClickHandler=this.onChangeStyleClick.bind(this),this.changingStyleClickHandler=this.onChangingStyleClick.bind(this),this.resetClickHandler=this.onResetClick.bind(this),this.selectHandlerClickHandler=this.onSelectHandlerClick.bind(this),this.showDialogHandler=this.onShowDialog.bind(this),this.loadTableofContentDialog=function(){n.documentHelper.updateFocus(),n.pageNumber.checked=!0,n.rightAlign.disabled=!1,n.rightAlign.checked=!0,n.tabLeader.enabled=!0,n.hyperlink.checked=!0,n.style.checked=!0,n.outline.checked=!0,n.outline.disabled=!1,n.showLevel.enabled=!0},this.closeTableOfContentDialog=function(){n.unWireEventsAndBindings(),n.documentHelper.updateFocus()},this.onCancelButtonClick=function(){n.documentHelper.dialog3.hide(),n.unWireEventsAndBindings(),n.documentHelper.updateFocus()},this.selectHandler=function(e){n.textBoxInput.value=e.text;var t=n.textBoxInput;t.setSelectionRange(0,e.text.length),t.focus()},this.showStyleDialog=function(){je(n.documentHelper.owner.styleDialogModule)||n.documentHelper.owner.styleDialogModule.show(n.textBoxInput.value)},this.reset=function(){n.showLevel.enabled=!0,n.showLevel.value=3,n.outline.disabled=!1,n.outline.checked=!0;n.changeByValue(["1","2","3",null,null,null,null,null,null]),n.normal.value=null},this.changeStyle=function(e){var t,i=0;je(e.srcElement.value)||(t=e.srcElement.value,i=parseInt(t),t.match(/^[0-9]+$/)||""===t?i<1||9<i?n.initAlertDialog(!0):t!==n.getElementValue(e.srcElement)&&""!==t?n.showLevel.enabled=!1:(n.showLevel.enabled=!0,n.checkLevel()):n.initAlertDialog(!1))},this.changeHeadingStyle=function(e){var t,i=0;je(e.srcElement.value)||(t=e.srcElement.value,i=parseInt(t),t.match(/^[0-9]+$/)||""===t?i<1||9<i?n.initAlertDialog(!0):(n.showLevel.enabled=""===t,n.normal===e.srcElement&&(n.outline.checked=!1,n.outline.disabled=!0)):n.initAlertDialog(!1))},this.changePageNumberValue=function(e){e.checked?(n.rightAlign.checked=!0,n.rightAlign.disabled=!1,n.tabLeader.enabled=!0):(n.rightAlign.disabled=!0,n.tabLeader.enabled=!1)},this.changeRightAlignValue=function(e){e.checked?n.tabLeader.enabled=!0:n.tabLeader.enabled=!1},this.changeStyleValue=function(e){e.checked?(n.heading1.disabled=!1,n.heading2.disabled=!1,n.heading3.disabled=!1,n.heading4.disabled=!1,n.heading5.disabled=!1,n.heading6.disabled=!1,n.heading7.disabled=!1,n.heading8.disabled=!1,n.heading9.disabled=!1,n.normal.disabled=!1):(n.heading1.disabled=!0,n.heading2.disabled=!0,n.heading3.disabled=!0,n.heading4.disabled=!0,n.heading5.disabled=!0,n.heading6.disabled=!0,n.heading7.disabled=!0,n.heading8.disabled=!0,n.heading9.disabled=!0,n.normal.disabled=!0)},this.applyTableOfContentProperties=function(){var e={startLevel:1,endLevel:n.showLevel.value,includeHyperlink:n.hyperlink.checked,includePageNumber:n.pageNumber.checked,rightAlign:n.rightAlign.checked,tabLeader:n.tabLeader.value,includeOutlineLevels:n.outline.checked};n.applyLevelSetting(e)&&(n.documentHelper.owner.editorModule.insertTableOfContents(e),n.documentHelper.dialog3.hide(),n.documentHelper.updateFocus())},this.unWireEventsAndBindings=function(){n.pageNumber.checked=!1,n.rightAlign.checked=!1,n.tabLeader&&(n.tabLeader.value=""),n.hyperlink.checked=!1,n.style.checked=!1,n.outline.checked=!1,n.normal&&(n.normal.value="")},this.documentHelper=e}Cpi.prototype.getModuleName=function(){return"PageSetupDialog"},Cpi.prototype.initPageSetupDialog=function(e,t){this.target=Q("div"),this.ejtabContainer=Q("div"),this.target.appendChild(this.ejtabContainer),this.marginTab=Q("div",{styles:"position: relative;",className:"e-de-dlg-tab-first-child"}),this.paperTab=Q("div",{styles:"position: relative;",className:"e-de-dlg-tab-first-child"}),this.layoutTab=Q("div",{styles:"position: relative;",className:"e-de-dlg-tab-first-child"}),this.ejtab=Q("div",{className:"e-de-page-setup-ppty-tab"}),this.headerContainer=Q("div",{className:"e-tab-header"}),this.marginHeader=Q("div",{innerHTML:e.getConstant("Margin")}),this.paperHeader=Q("div",{innerHTML:e.getConstant("Paper")}),this.layoutHeader=Q("div",{innerHTML:e.getConstant("Layout")}),this.headerContainer.appendChild(this.marginHeader),this.headerContainer.appendChild(this.paperHeader),this.headerContainer.appendChild(this.layoutHeader),this.marginContent=Q("div"),this.paperContent=Q("div"),this.layoutContent=Q("div"),this.marginContent.appendChild(this.marginTab),this.paperContent.appendChild(this.paperTab),this.layoutContent.appendChild(this.layoutTab),this.ejtabContainer.appendChild(this.ejtab),this.initMarginProperties(this.marginTab,e,t),this.initPaperSizeProperties(this.paperTab,e,t),this.initLayoutProperties(this.layoutTab,e,t);e=[{header:{text:this.marginHeader},content:this.marginContent},{header:{text:this.paperHeader},content:this.paperContent},{header:{text:this.layoutHeader},content:this.layoutContent}];new k5({items:e,enableRtl:t},this.ejtab).isStringTemplate=!0,this.target.addEventListener("keyup",this.keyUpInsertPageSettingsClickHandler)},Cpi.prototype.initMarginProperties=function(e,t,i){this.marginDiv=Q("div"),this.leftMarginDiv=Q("div",{className:"e-de-container-row"}),this.marginDiv.appendChild(this.leftMarginDiv),this.rightMarginDiv=Q("div",{className:"e-de-container-row"}),this.marginDiv.appendChild(this.rightMarginDiv),i&&(this.leftMarginDiv.classList.add("e-de-rtl"),this.rightMarginDiv.classList.add("e-de-rtl")),this.topTextBox=Q("input",{attrs:{type:"text"}}),this.bottomTextBox=Q("input",{attrs:{type:"text"}}),this.topContainer=Q("div",{className:"e-de-subcontainer-left"}),this.topContainer.appendChild(this.topTextBox),this.leftMarginDiv.appendChild(this.topContainer),this.bottomContainer=Q("div",{className:"e-de-subcontainer-right"}),this.bottomContainer.appendChild(this.bottomTextBox),this.leftMarginDiv.appendChild(this.bottomContainer),this.leftTextBox=Q("input",{attrs:{type:"text"},id:this.target.id+"_left"}),this.rightTextBox=Q("input",{attrs:{type:"text"}}),this.leftContainer=Q("div",{className:"e-de-subcontainer-left"}),this.leftContainer.appendChild(this.leftTextBox),this.rightMarginDiv.appendChild(this.leftContainer),this.rightContainer=Q("div",{className:"e-de-subcontainer-right"}),this.rightContainer.appendChild(this.rightTextBox),this.rightMarginDiv.appendChild(this.rightContainer),e.appendChild(this.marginDiv),this.topMarginBox=new NL({value:71,max:1584,min:-1584,width:170,decimals:2,floatLabelType:"Always",placeholder:t.getConstant("Top")}),this.topMarginBox.appendTo(this.topTextBox),this.leftMarginBox=new NL({value:73,max:1584,min:0,width:170,decimals:2,floatLabelType:"Always",placeholder:t.getConstant("Left")}),this.leftMarginBox.appendTo(this.leftTextBox),this.bottomMarginBox=new NL({value:72,max:1584,min:-1584,width:170,decimals:2,floatLabelType:"Always",placeholder:t.getConstant("Bottom")}),this.bottomMarginBox.appendTo(this.bottomTextBox),this.rightMarginBox=new NL({value:74,max:1584,min:0,width:170,decimals:2,floatLabelType:"Always",placeholder:t.getConstant("Right")}),this.rightMarginBox.appendTo(this.rightTextBox),this.orientationDiv=Q("div"),this.orientationLabeldiv=Q("div",{className:"e-de-para-dlg-heading",innerHTML:t.getConstant("Orientation")}),this.orientationPropDiv=Q("div",{styles:"display: flex;"}),this.topTextBox.setAttribute("aria-labelledby",t.getConstant("Top")),this.bottomTextBox.setAttribute("aria-labelledby",t.getConstant("Bottom")),this.leftTextBox.setAttribute("aria-labelledby",t.getConstant("Left")),this.rightTextBox.setAttribute("aria-labelledby",t.getConstant("Right")),this.portraitDiv=Q("div",{id:"_portraitDiv",styles:i?"padding-left: 30px;":"padding-right: 30px;"});var n=Q("input",{attrs:{type:"radiobutton"}}),o=(this.landscapeDiv=Q("div",{id:"_landscapeDiv"}),Q("input",{attrs:{type:"radiobutton"}}));this.portraitDiv.appendChild(n),this.landscapeDiv.appendChild(o),this.orientationPropDiv.appendChild(this.portraitDiv),this.orientationPropDiv.appendChild(this.landscapeDiv),this.orientationDiv.appendChild(this.orientationLabeldiv),this.orientationDiv.appendChild(this.orientationPropDiv),this.portrait=new cb({label:t.getConstant("Portrait"),checked:!0,enableRtl:i,change:this.onPortrait}),this.landscape=new cb({label:t.getConstant("Landscape"),enableRtl:i,change:this.onLandscape}),this.portrait.appendTo(n),this.landscape.appendTo(o),e.appendChild(this.orientationDiv),n.setAttribute("aria-label",t.getConstant("Portrait")),o.setAttribute("aria-label",t.getConstant("Landscape"))},Cpi.prototype.initPaperSizeProperties=function(e,t,i){this.sizeDiv=Q("div",{className:"e-de-container-row"}),this.leftSizeDiv=Q("div",{className:"e-de-subcontainer-left"}),this.sizeDiv.appendChild(this.leftSizeDiv),this.rightSizeDiv=Q("div",{className:"e-de-subcontainer-right"}),this.sizeDiv.appendChild(this.rightSizeDiv),i&&(this.leftSizeDiv.classList.add("e-de-rtl"),this.rightSizeDiv.classList.add("e-de-rtl")),this.widthTextBox=Q("input",{attrs:{type:"text"}}),this.leftSizeDiv.appendChild(this.widthTextBox),this.heightTextBox=Q("input",{attrs:{type:"text"}}),this.rightSizeDiv.appendChild(this.heightTextBox),e.appendChild(this.sizeDiv),this.widthBox=new NL({value:612,width:170,decimals:2,floatLabelType:"Always",placeholder:t.getConstant("Width")}),this.widthBox.appendTo(this.widthTextBox),this.heightBox=new NL({value:792,width:170,decimals:2,floatLabelType:"Always",placeholder:t.getConstant("Height")}),this.heightBox.appendTo(this.heightTextBox),this.widthTextBox.setAttribute("arial-label",t.getConstant("Width")),this.heightTextBox.setAttribute("arial-label",t.getConstant("Height")),this.paperSizeDiv=Q("div");t=Q("select",{styles:"width:170px;padding-bottom: 20px;",innerHTML:'<option value="letter">'+t.getConstant("Letter")+'</option><option value="tabloid">'+t.getConstant("Tabloid")+'</option><option value="legal">'+t.getConstant("Legal")+'</option><option value="statement">'+t.getConstant("Statement")+'</option><option value="executive">'+t.getConstant("Executive")+'</option><option value="a3">'+t.getConstant("A3")+'</option><option value="a4">'+t.getConstant("A4")+'</option><option value="a5">'+t.getConstant("A5")+'</option><option value="b4">'+t.getConstant("B4")+'</option><option value="b5">'+t.getConstant("B5")+'</option><option value="customsize">'+t.getConstant("Custom Size")+"</option>"});this.paperSizeDiv.appendChild(t),this.paperSize=new qz({change:this.changeByPaperSize,width:"170px",enableRtl:i}),this.paperSize.appendTo(t),this.paperSize.htmlAttributes={"aria-labelledby":"PaperSize","aria-describedby":"PaperSize"},e.appendChild(this.paperSizeDiv)},Cpi.prototype.initLayoutProperties=function(e,t,i){this.layoutDiv=Q("div",{className:"e-de-dlg-container"}),this.firstPageDiv=Q("div",{styles:"height: 27px;"});var n=Q("input",{attrs:{type:"checkbox"}}),o=(this.firstPageDiv.appendChild(n),this.oddOrEvenDiv=Q("div",{styles:"height: 27px;"}),Q("input",{attrs:{type:"checkbox"}})),n=(this.firstPageDiv.setAttribute("aria-label",t.getConstant("Different first page")),this.oddOrEvenDiv.setAttribute("aria-label",t.getConstant("Different odd and even")),this.oddOrEvenDiv.appendChild(o),this.layoutDiv.appendChild(this.firstPageDiv),this.layoutDiv.appendChild(this.oddOrEvenDiv),this.checkBox1=new ib({label:t.getConstant("Different odd and even"),enableRtl:i}),this.checkBox2=new ib({label:t.getConstant("Different first page"),enableRtl:i}),this.checkBox1.appendTo(n),this.checkBox2.appendTo(o),e.appendChild(this.layoutDiv),this.textLabelDiv=Q("div"),this.textLabel=Q("label",{className:"e-de-para-dlg-heading",innerHTML:t.getConstant("From edge")}),this.textLabelDiv.appendChild(this.textLabel),e.appendChild(this.textLabelDiv),this.propertyDiv=Q("div",{className:"e-de-dlg-row"}),this.leftLayoutDiv=Q("div",{className:"e-de-subcontainer-left"}),this.propertyDiv.appendChild(this.leftLayoutDiv),this.rightLayoutDiv=Q("div",{className:"e-de-subcontainer-right"}),this.propertyDiv.appendChild(this.rightLayoutDiv),i&&(this.rightLayoutDiv.classList.add("e-de-rtl"),this.leftLayoutDiv.classList.add("e-de-rtl")),Q("input",{attrs:{type:"text"}})),o=(this.leftLayoutDiv.appendChild(n),Q("input",{attrs:{type:"text"}}));this.rightLayoutDiv.appendChild(o),e.appendChild(this.propertyDiv),this.headerBox=new NL({value:612,width:170,decimals:2,floatLabelType:"Always",placeholder:t.getConstant("Header")}),this.headerBox.appendTo(n),this.footerBox=new NL({value:792,width:170,decimals:2,floatLabelType:"Always",placeholder:t.getConstant("Footer")}),this.footerBox.appendTo(o),n.setAttribute("aria-labelledby",t.getConstant("Header")),o.setAttribute("aria-labelledby",t.getConstant("Footer"))},Cpi.prototype.show=function(){var e=new Cn("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(),this.dialogElement=this.documentHelper.dialog.element,this.dialogElement&&this.documentHelper.updateDialogTabHeight(this.dialogElement,this.target)},Cpi.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?"b5":"customsize"},Cpi.prototype.onKeyUpInsertPageSettingsClick=function(e){this.keyUpInsertPageSettings(e)},Cpi.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,this.removeEvents(),this.removeElements(),!je(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[parseInt(e.toString(),10)]),e--;this.target=void 0}},Cpi.prototype.removeEvents=function(){this.target&&this.target.removeEventListener("keyup",this.keyUpInsertPageSettingsClickHandler)},Cpi.prototype.removeElements=function(){this.ejtabContainer&&(this.ejtabContainer.remove(),this.ejtabContainer=void 0),this.marginTab&&(this.marginTab.remove(),this.marginTab=void 0),this.paperTab&&(this.paperTab.remove(),this.paperTab=void 0),this.layoutTab&&(this.layoutTab.remove(),this.layoutTab=void 0),this.ejtab&&(this.ejtab.remove(),this.ejtab=void 0),this.headerContainer&&(this.headerContainer.remove(),this.headerContainer=void 0),this.marginHeader&&(this.marginHeader.remove(),this.marginHeader=void 0),this.paperHeader&&(this.paperHeader.remove(),this.paperHeader=void 0),this.layoutHeader&&(this.layoutHeader.remove(),this.layoutHeader=void 0),this.marginContent&&(this.marginContent.remove(),this.marginContent=void 0),this.paperContent&&(this.paperContent.remove(),this.paperContent=void 0),this.layoutContent&&(this.layoutContent.remove(),this.layoutContent=void 0),this.marginDiv&&(this.marginDiv.remove(),this.marginDiv=void 0),this.leftMarginDiv&&(this.leftMarginDiv.remove(),this.leftMarginDiv=void 0),this.rightMarginDiv&&(this.rightMarginDiv.remove(),this.rightMarginDiv=void 0),this.topTextBox&&(this.topTextBox.remove(),this.topTextBox=void 0),this.bottomTextBox&&(this.bottomTextBox.remove(),this.bottomTextBox=void 0),this.topContainer&&(this.topContainer.remove(),this.topContainer=void 0),this.bottomContainer&&(this.bottomContainer.remove(),this.bottomContainer=void 0),this.leftTextBox&&(this.leftTextBox.remove(),this.leftTextBox=void 0),this.rightTextBox&&(this.rightTextBox.remove(),this.rightTextBox=void 0),this.leftContainer&&(this.leftContainer.remove(),this.leftContainer=void 0),this.rightContainer&&(this.rightContainer.remove(),this.rightContainer=void 0),this.orientationDiv&&(this.orientationDiv.remove(),this.orientationDiv=void 0),this.orientationLabeldiv&&(this.orientationLabeldiv.remove(),this.orientationLabeldiv=void 0),this.orientationPropDiv&&(this.orientationPropDiv.remove(),this.orientationPropDiv=void 0),this.portraitDiv&&(this.portraitDiv.remove(),this.portraitDiv=void 0),this.landscapeDiv&&(this.landscapeDiv.remove(),this.landscapeDiv=void 0),this.portrait&&(this.portrait.destroy(),this.portrait=void 0),this.landscape&&(this.landscape.destroy(),this.landscape=void 0),this.sizeDiv&&(this.sizeDiv.remove(),this.sizeDiv=void 0),this.leftSizeDiv&&(this.leftSizeDiv.remove(),this.leftSizeDiv=void 0),this.rightSizeDiv&&(this.rightSizeDiv.remove(),this.rightSizeDiv=void 0),this.widthTextBox&&(this.widthTextBox.remove(),this.widthTextBox=void 0),this.heightTextBox&&(this.heightTextBox.remove(),this.heightTextBox=void 0),this.sizeDiv&&(this.sizeDiv.remove(),this.sizeDiv=void 0),this.paperSizeDiv&&(this.paperSizeDiv.remove(),this.paperSizeDiv=void 0),this.layoutDiv&&(this.layoutDiv.remove(),this.layoutDiv=void 0),this.firstPageDiv&&(this.firstPageDiv.remove(),this.firstPageDiv=void 0),this.oddOrEvenDiv&&(this.oddOrEvenDiv.remove(),this.oddOrEvenDiv=void 0),this.textLabelDiv&&(this.textLabelDiv.remove(),this.textLabelDiv=void 0),this.propertyDiv&&(this.propertyDiv.remove(),this.propertyDiv=void 0),this.leftLayoutDiv&&(this.leftLayoutDiv.remove(),this.leftLayoutDiv=void 0),this.rightLayoutDiv&&(this.rightLayoutDiv.remove(),this.rightLayoutDiv=void 0),this.dialogElement&&(this.dialogElement.remove(),this.dialogElement=void 0)};var wpi=Cpi;function Cpi(e){var d=this;this.isPortrait=!0,this.keyUpInsertPageSettingsClickHandler=this.onKeyUpInsertPageSettingsClick.bind(this),this.loadPageSetupDialog=function(){d.documentHelper.updateFocus();var e=d.documentHelper.selection.sectionFormat;d.topMarginBox.value=e.topMargin,d.leftMarginBox.value=e.leftMargin,d.bottomMarginBox.value=e.bottomMargin,d.rightMarginBox.value=e.rightMargin,d.widthBox.value=e.pageWidth,d.heightBox.value=e.pageHeight,d.checkBox1.checked=e.differentOddAndEvenPages,d.checkBox2.checked=e.differentFirstPage,d.headerBox.value=e.headerDistance,d.footerBox.value=e.footerDistance,d.widthBox.value>d.heightBox.value?d.landscape.checked=!0:d.portrait.checked=!0,d.setPageSize(d.portrait.checked,parseFloat(e.pageWidth.toFixed(1)),parseFloat(e.pageHeight.toFixed(1)))},this.closePageSetupDialog=function(){d.unWireEventsAndBindings(),d.documentHelper.updateFocus()},this.onCancelButtonClick=function(){d.documentHelper.dialog.hide(),d.unWireEventsAndBindings(),d.documentHelper.updateFocus()},this.keyUpInsertPageSettings=function(e){13===e.keyCode&&d.applyPageSetupProperties()},this.applyPageSetupProperties=function(){var e=new ari,t=new Cn("documenteditor",d.documentHelper.owner.defaultLocale),i=(t.setLocale(d.documentHelper.owner.locale),d.documentHelper.selection.sectionFormat);if(e.bottomMargin=d.bottomMarginBox.value,e.topMargin=d.topMarginBox.value,e.leftMargin=d.leftMarginBox.value,e.rightMargin=d.rightMarginBox.value,e.pageWidth=d.widthBox.value,e.pageHeight=d.heightBox.value,e.differentOddAndEvenPages=d.checkBox1.checked,e.differentFirstPage=d.checkBox2.checked,e.headerDistance=d.headerBox.value,e.footerDistance=d.footerBox.value,d.widthBox.value<d.leftMarginBox.value+d.rightMarginBox.value)WC.alert(t.getConstant("Left and right margins."));else if(d.widthBox.value<d.leftMarginBox.value+d.rightMarginBox.value+36)WC.alert(t.getConstant("Column width cannot be less than 36 pt."));else if(Math.abs(d.topMarginBox.value+d.bottomMarginBox.value)>d.heightBox.value)WC.alert(t.getConstant("The top/bottom margins are too large for the page height in some sections."));else{e.numberOfColumns=i.numberOfColumns,e.equalWidth=i.equalWidth,e.lineBetweenColumns=i.lineBetweenColumns;for(var n=[],o=Y.convertPointToPixel(e.pageWidth-e.leftMargin-e.rightMargin),r=0;r<i.columns.length;r++){var s=new hri,a=Y.convertPointToPixel(i.columns[parseInt(r.toString(),10)].width),l=Y.convertPointToPixel(i.columns[parseInt(r.toString(),10)].space),h=(i.numberOfColumns-1)*l;!i.equalWidth&&0!==a||je(o)||(a=(o-h)/i.numberOfColumns),s.width=a,s.space=l,s.index=r,n.push(s)}e.columns=n,i.pageHeight===e.pageHeight&&i.pageWidth===e.pageWidth&&(e.breakCode=i.breakCode),d.documentHelper.owner.editorModule.onApplySectionFormat(void 0,e),d.documentHelper.hideDialog()}},this.changeByPaperSize=function(e){e=e.value;d.documentHelper.selection.sectionFormat.pageWidth>d.documentHelper.selection.sectionFormat.pageHeight||d.landscape.checked?(d.isPortrait=!1,d.portrait.checked=!1):d.isPortrait=!0,"letter"===e?d.isPortrait?(d.widthBox.value=612,d.heightBox.value=792):(d.widthBox.value=792,d.heightBox.value=612):"tabloid"===e?d.isPortrait?(d.widthBox.value=792,d.heightBox.value=1224):(d.widthBox.value=1224,d.heightBox.value=792):"legal"===e?d.isPortrait?(d.widthBox.value=612,d.heightBox.value=1008):(d.widthBox.value=1008,d.heightBox.value=612):"statement"===e?d.isPortrait?(d.widthBox.value=392,d.heightBox.value=612):(d.widthBox.value=612,d.heightBox.value=392):"executive"===e?d.isPortrait?(d.widthBox.value=522,d.heightBox.value=756):(d.widthBox.value=756,d.heightBox.value=522):"a3"===e?d.isPortrait?(d.widthBox.value=841.9,d.heightBox.value=1190.55):(d.widthBox.value=1190.55,d.heightBox.value=841.9):"a4"===e?d.isPortrait?(d.widthBox.value=595.3,d.heightBox.value=841.9):(d.widthBox.value=841.9,d.heightBox.value=595.3):"a5"===e?d.isPortrait?(d.widthBox.value=419.55,d.heightBox.value=595.3):(d.widthBox.value=595.3,d.heightBox.value=419.55):"b4"===e?d.isPortrait?(d.widthBox.value=728.5,d.heightBox.value=1031.8):(d.widthBox.value=1031.8,d.heightBox.value=728.5):"b5"===e?d.isPortrait?(d.widthBox.value=515.9,d.heightBox.value=728.5):(d.widthBox.value=728.5,d.heightBox.value=515.9):"customsize"===e&&(d.isPortrait,d.widthBox.value=d.documentHelper.selection.sectionFormat.pageWidth,d.heightBox.value=d.documentHelper.selection.sectionFormat.pageHeight)},this.onPortrait=function(){d.landscape.checked=!1;var e=d.widthBox.value,t=d.heightBox.value;t<e&&(d.widthBox.value=t,d.heightBox.value=e)},this.onLandscape=function(){d.portrait.checked=!1;var e=d.widthBox.value,t=d.heightBox.value;e<t&&(d.widthBox.value=t,d.heightBox.value=e)},this.unWireEventsAndBindings=function(){d.paperSize.value=void 0,d.topMarginBox.value=void 0,d.bottomMarginBox.value=void 0,d.leftMarginBox.value=void 0,d.rightMarginBox.value=void 0,d.headerBox.value=void 0,d.footerBox.value=void 0,d.widthBox.value=void 0,d.heightBox.value=void 0,d.checkBox1.checked=!1,d.checkBox2.checked=!1,d.portrait.checked=!1,d.landscape.checked=!1},this.documentHelper=e}Object.defineProperty(Api.prototype,"owner",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),Api.prototype.getModuleName=function(){return"ParagraphDialog"},Api.prototype.initParagraphDialog=function(e){var t=Q("div"),i=(this.ejtab=Q("div"),(this.instance=this).documentHelper.owner.containerId),t=(this.indentContainer=Q("div",{className:"e-de-dlg-tab-first-child e-de-para-dlg-container"}),(this.target=t).appendChild(this.ejtab),this.div=Q("div",{styles:"width:400px;"}),this.generalDiv=Q("div"),this.genLabel=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("General")}),this.generalDiv.appendChild(this.genLabel),this.alignmentWholeDiv=Q("div",{className:"e-de-container-row"}),this.generalDiv.appendChild(this.alignmentWholeDiv),this.alignmentDiv=Q("div",{className:"e-de-subcontainer-left"}),this.alignmentWholeDiv.appendChild(this.alignmentDiv),Q("select",{id:i+"_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>"})),n=Q("select",{id:i+"_Outline",innerHTML:'<option value="BodyText">'+e.getConstant("BodyText")+'</option><option value="Level1">'+e.getConstant("Level1")+'</option><option value="Level2">'+e.getConstant("Level2")+'</option><option value="Level3">'+e.getConstant("Level3")+'</option><option value="Level4">'+e.getConstant("Level4")+'</option><option value="Level5">'+e.getConstant("Level5")+'</option><option value="Level6">'+e.getConstant("Level6")+'</option><option value="Level7">'+e.getConstant("Level7")+'</option><option value="Level8">'+e.getConstant("Level8")+'</option><option value="Level9">'+e.getConstant("Level9")+"</option>"}),o=(this.alignmentDiv.appendChild(t),this.alignmentDiv.setAttribute("aria-labelledby",t.innerText),this.alignmentDiv.appendChild(n),this.alignmentDiv.setAttribute("aria-labelledby",n.innerText),this.dirLabel=Q("div",{className:"e-de-dlg-sub-header",innerHTML:e.getConstant("Direction")}),this.directionDiv=Q("div",{className:"e-de-container-row"}),this.rtlDiv=Q("div",{className:"e-de-rtl-btn-div"}),this.rtlInputELe=Q("input",{id:i+"_rtlEle"}),this.rtlDiv.appendChild(this.rtlInputELe),this.directionDiv.appendChild(this.rtlDiv),this.documentHelper.owner.enableRtl),r=(o&&this.rtlDiv.classList.add("e-de-rtl"),this.ltrDiv=Q("div",{className:"e-de-ltr-btn-div"}),this.ltrInputELe=Q("input",{id:i+"_ltrEle"}),this.ltrDiv.appendChild(this.ltrInputELe),this.directionDiv.appendChild(this.ltrDiv),this.generalDiv.appendChild(this.dirLabel),this.generalDiv.appendChild(this.directionDiv),this.rtlButton=new cb({label:e.getConstant("Right-to-left"),enableRtl:o,value:"rtl",cssClass:"e-small",change:this.changeBidirectional}),this.rtlButton.appendTo(this.rtlInputELe),this.rtlInputELe.setAttribute("aria-label",e.getConstant("Right-to-left")),this.ltrButton=new cb({label:e.getConstant("Left-to-right"),enableRtl:o,value:"ltr",cssClass:"e-small",change:this.changeBidirectional}),this.ltrButton.appendTo(this.ltrInputELe),this.ltrInputELe.setAttribute("aria-label",e.getConstant("Left-to-right")),this.indentionWholeDiv=Q("div"),this.indentLabel=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Indentation")}),this.indentionWholeDiv.appendChild(this.indentLabel),this.indentionSubDiv1=Q("div",{className:"e-de-container-row"}),this.indentionWholeDiv.appendChild(this.indentionSubDiv1),this.indentionSubDiv2=Q("div",{className:"e-de-container-row"}),this.indentionWholeDiv.appendChild(this.indentionSubDiv2),this.beforeTextDiv=Q("div",{className:"e-de-subcontainer-left"}),this.indentionSubDiv1.appendChild(this.beforeTextDiv),this.afterTextDiv=Q("div",{className:"e-de-subcontainer-right"}),this.indentionSubDiv1.appendChild(this.afterTextDiv),this.specialDiv=Q("div",{className:"e-de-subcontainer-left"}),this.indentionSubDiv2.appendChild(this.specialDiv),this.byDiv=Q("div",{className:"e-de-subcontainer-right"}),this.indentionSubDiv2.appendChild(this.byDiv),this.spacingDiv=Q("div"),this.leftSpacingDiv=Q("div"),this.spacingDiv.appendChild(this.leftSpacingDiv),this.contextSpacingDiv=Q("div",{className:"e-de-container-row"}),this.spacingDiv.appendChild(this.contextSpacingDiv),this.rightSpacingDiv=Q("div",{className:"e-de-container-row"}),this.spacingDiv.appendChild(this.rightSpacingDiv),this.contextInputEle=Q("input",{attrs:{type:"checkbox"},id:i+"_contextSpacing"}),this.contextSpacingDiv.appendChild(this.contextInputEle),Q("input",{id:i+"_leftIndent",attrs:{type:"text"}})),s=Q("input",{id:i+"_rightIndent",attrs:{type:"text"}}),a=(this.beforeTextDiv.appendChild(r),this.beforeTextDiv.setAttribute("aria-labelledby",e.getConstant("Indent from left")),this.afterTextDiv.appendChild(s),this.afterTextDiv.setAttribute("aria-labelledby",e.getConstant("Indent from right")),Q("select",{id:i+"_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> "})),l=(this.by=Q("input",{id:i+"_By",attrs:{type:"text"}}),this.specialDiv.setAttribute("aria-labelledby","Special"),this.specialDiv.appendChild(a),this.byDiv.appendChild(this.by),this.byDiv.setAttribute("aria-labelledby","By"),this.spaceLabel=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Spacing")}),this.spacingWholeDiv=Q("div",{className:"e-de-container-row"}),this.beforeSpacingWholeDiv=Q("div",{className:"e-de-subcontainer-left"}),Q("input",{id:i+"_beforeSpacing",attrs:{type:"text"}})),h=(this.afterSpacingWholeDiv=Q("div",{className:"e-de-subcontainer-right"}),Q("input",{id:i+"_afterSpacing",attrs:{type:"text"}})),d=(this.leftSpacingDiv.appendChild(this.spaceLabel),this.leftSpacingDiv.appendChild(this.spacingWholeDiv),this.beforeSpacingWholeDiv.appendChild(l),this.spacingWholeDiv.appendChild(this.beforeSpacingWholeDiv),this.afterSpacingWholeDiv.appendChild(h),this.spacingWholeDiv.appendChild(this.afterSpacingWholeDiv),this.lineSpacingDiv=Q("div",{className:"e-de-subcontainer-left"}),Q("select",{id:i+"_lineSpacing",innerHTML:'<option value="At least">'+e.getConstant("At least")+'</option><option value="Exactly">'+e.getConstant("Exactly")+'</option><option value="Multiple">'+e.getConstant("Multiple")+"</option>"})),i=(this.lineTypeDiv=Q("div",{className:"e-de-subcontainer-right"}),this.lineSpacingAt=Q("input",{id:i+"_lineSpacingAt",attrs:{type:"text"}}),this.lineSpacingDiv.appendChild(d),this.rightSpacingDiv.appendChild(this.lineSpacingDiv),this.lineTypeDiv.appendChild(this.lineSpacingAt),this.rightSpacingDiv.appendChild(this.lineTypeDiv),this.div.appendChild(this.generalDiv),this.div.appendChild(this.indentionWholeDiv),this.div.appendChild(this.spacingDiv),this.indentContainer.appendChild(this.div),this.leftIndentIn=new NL({format:"n1",value:0,min:-1584,max:1584,enablePersistence:!1,floatLabelType:"Always",placeholder:e.getConstant("Before text"),change:this.changeLeftIndent}),this.leftIndentIn.appendTo(r),this.rightIndentIn=new NL({format:"n1",value:0,min:-1584,max:1584,enablePersistence:!1,floatLabelType:"Always",placeholder:e.getConstant("After text"),change:this.changeRightIndent}),this.rightIndentIn.appendTo(s),this.byIn=new NL({format:"n1",value:0,min:0,max:1584,enablePersistence:!1,floatLabelType:"Always",placeholder:e.getConstant("By"),change:this.changeFirstLineIndent}),this.byIn.appendTo(this.by),this.beforeSpacingIn=new NL({format:"n1",value:0,min:-1,max:1584,step:6,enablePersistence:!1,floatLabelType:"Always",placeholder:e.getConstant("Before"),change:this.changeBeforeSpacing,focus:this.focusBeforeSpacing,blur:this.blurBeforeSpacing}),this.beforeSpacingIn.appendTo(l),this.beforeSpacingSpinDown=this.beforeSpacingWholeDiv.getElementsByClassName("e-input-group-icon e-spin-down")[0],this.beforeSpacingSpinDown.addEventListener("click",this.clickBeforeSpacingClickHandler),this.afterSpacingIn=new NL({format:"n1",value:0,min:-1,max:1584,step:6,enablePersistence:!1,floatLabelType:"Always",placeholder:e.getConstant("After"),change:this.changeAfterSpacing,focus:this.focusAfterSpacing,blur:this.blurAfterSpacing}),this.afterSpacingIn.appendTo(h),this.afterSpacingSpinDown=this.afterSpacingWholeDiv.getElementsByClassName("e-input-group-icon e-spin-down")[0],this.afterSpacingSpinDown.addEventListener("click",this.clickAfterSpacingClickHandler),this.atIn=new NL({format:"n1",value:0,min:1,max:1584,step:.5,enablePersistence:!1,floatLabelType:"Always",placeholder:e.getConstant("At"),change:this.changeLineSpacingValue}),this.special=new qz({change:this.changeByValue,enableRtl:o,floatLabelType:"Always",placeholder:e.getConstant("Special")}),this.special.appendTo(a),this.lineSpacing=new qz({change:this.changeBySpacing,enableRtl:o,floatLabelType:"Always",placeholder:e.getConstant("Line Spacing"),htmlAttributes:{"aria-labelledby":e.getConstant("Line Spacing")}}),this.lineSpacing.appendTo(d),this.alignment=new qz({change:this.changeByTextAlignment,enableRtl:o,floatLabelType:"Always",placeholder:e.getConstant("Alignment"),htmlAttributes:{"aria-labelledby":e.getConstant("Alignment")}}),this.alignment.appendTo(t),this.outlineLevel=new qz({change:this.changeByOutlineLevel,enableRtl:o,floatLabelType:"Always",placeholder:e.getConstant("OutlineLevel"),htmlAttributes:{"aria-labelledby":e.getConstant("OutlineLevel")}}),this.outlineLevel.appendTo(n),this.atIn.appendTo(this.lineSpacingAt),this.contextSpacing=new ib({change:this.changeContextualSpacing,label:e.getConstant("Contextual Spacing"),enableRtl:o}),this.contextSpacing.appendTo(this.contextInputEle),this.contextInputEle.setAttribute("aria-labelledby",e.getConstant("Contextual Spacing")),this.indentContainer.addEventListener("keyup",this.instance.keyUpParagraphSettingsClickHandler),o&&(this.afterSpacingWholeDiv.classList.add("e-de-rtl"),this.lineTypeDiv.classList.add("e-de-rtl")),this.lineBreakContainer=Q("div",{className:"e-de-dlg-tab-first-child"}),Q("div",{className:"e-de-para-dlg-sub-container"})),r=(this.paginationDiv=i,this.paginationLabel=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Pagination")}),i.appendChild(this.paginationLabel),this.widowContorlContainer=Q("div",{styles:"display:block"}),i.appendChild(this.widowContorlContainer),this.keepNextContainer=Q("div",{styles:"display:block"}),i.appendChild(this.keepNextContainer),this.keepLines=Q("div",{styles:"display:block"}),i.appendChild(this.keepLines),this.keepWithNext1=Q("input",{attrs:{type:"checkbox"}}),this.keepNextContainer.appendChild(this.keepWithNext1),this.keepWithNext=new ib({change:this.changeKeepWithNext,label:e.getConstant("Keep With Next"),enableRtl:o,cssClass:"e-de-para-dlg-cs-check-box"}),this.keepWithNext.appendTo(this.keepWithNext1),this.keepWithNext1.setAttribute("aria-label",e.getConstant("Keep With Next")),this.keepLinesTogether1=Q("input",{attrs:{type:"checkbox"}}),this.keepLines.appendChild(this.keepLinesTogether1),this.keepLinesTogether=new ib({change:this.changeKeepLinesTogether,label:e.getConstant("Keep Lines Together"),enableRtl:o,cssClass:"e-de-para-dlg-cs-check-box"}),this.keepLinesTogether.appendTo(this.keepLinesTogether1),this.keepLinesTogether1.setAttribute("aria-label",e.getConstant("Keep Lines Together")),this.widowControl=Q("input",{attrs:{type:"checkbox"}}),this.widowContorlContainer.appendChild(this.widowControl),this.widowControlIn=new ib({change:this.changeWidowControl,label:e.getConstant("WidowControl"),enableRtl:o,cssClass:"e-de-para-dlg-cs-check-box"}),this.widowControlIn.appendTo(this.widowControl),this.widowControl.setAttribute("aria-label",e.getConstant("WidowControl")),this.lineBreakContainer.appendChild(i),[{header:{text:e.getConstant("Indents and Spacing")},content:this.indentContainer},{header:{text:e.getConstant("Line and Page Breaks")},content:this.lineBreakContainer}]);this.tabObj=new k5({items:r,enableRtl:o,animation:{previous:{effect:"None"},next:{effect:"None"}}},this.ejtab),this.tabObj.isStringTemplate=!0},Api.prototype.onKeyUpParagraphSettingsClick=function(e){this.keyUpParagraphSettings(e)},Api.prototype.onClickBeforeSpacingClick=function(){this.clickBeforeSpacing()},Api.prototype.onClickAfterSpacingClick=function(){this.clickAfterSpacing()},Api.prototype.changeAlignmentByBidi=function(){"Left"===this.textAlignment?this.textAlignment="Right":"Right"===this.textAlignment&&(this.textAlignment="Left"),je(this.textAlignment)?0===this.alignment.index?this.textAlignment="Center":this.textAlignment="Justify":this.alignment.index=this.getAlignmentValue(this.textAlignment)},Api.prototype.getAlignmentValue=function(e){e="Center"===e?0:"Left"===e?1:"Right"===e?2:3;return e},Api.prototype.isHeadingStyle=function(){var e=this.documentHelper.selection.paragraphFormat.styleName;return"Heading 1"===e||"Heading 2"===e||"Heading 3"===e||"Heading 4"===e||"Heading 5"===e||"Heading 6"===e||"Heading 7"===e||"Heading 8"===e||"Heading 9"===e},Api.prototype.getOutlineValue=function(e){e="BodyText"===e?0:"Level1"===e?1:"Level2"===e?2:"Level3"===e?3:"Level4"===e?4:"Level5"===e?5:"Level6"===e?6:"Level7"===e?7:"Level8"===e?8:9;return e},Api.prototype.onParagraphFormat=function(e){var t,i=this.documentHelper.selection;!je(i)&&i.checkContentControlLocked(!0)||((t=e.bidi&&-1!==i.paragraphFormat.listId)||(this.documentHelper.layout.isBidiReLayout=!0),this.documentHelper.owner.editorModule.setPreviousBlockToLayout(),this.documentHelper.owner.editorModule.initHistory("ParagraphFormat"),this.documentHelper.owner.isShiftingEnabled=!0,this.documentHelper.selection.isEmpty?(this.documentHelper.owner.editorModule.applyParaFormatProperty(i.start.paragraph,void 0,e,!1),this.documentHelper.owner.editorModule.isMeasureParaWidth=!0,this.documentHelper.owner.editorModule.layoutItemBlock(i.start.paragraph,!1),this.documentHelper.owner.editorModule.isMeasureParaWidth=!0):this.documentHelper.owner.editorModule.updateSelectionParagraphFormatting("ParagraphFormat",e,!1),this.documentHelper.owner.editorModule.reLayout(i),t)||(this.documentHelper.layout.isBidiReLayout=!1)},Api.prototype.show=function(e){e?(this.isStyleDialog=!0,this.paragraphFormat=e):this.isStyleDialog=!1;var e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),e=(e.setLocale(this.documentHelper.owner.locale),this.target||this.initParagraphDialog(e),this.loadParagraphDialog(),this.documentHelper.dialog.header=e.getConstant("Paragraph"),this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.height="auto",this.documentHelper.dialog.width="auto",this.documentHelper.dialog.buttons=[{click:this.openTabDialog,buttonModel:{content:e.getConstant("Tabs")+"....",cssClass:"e-flat e-de-para-tab",enableRtl:this.documentHelper.owner.enableRtl}},{click:this.applyParagraphFormat,buttonModel:{content:e.getConstant("Ok"),cssClass:"e-flat e-para-okay",isPrimary:!0}},{click:this.closeParagraphDialog,buttonModel:{content:e.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.alignment.focusIn(),this.documentHelper.dialog.show(),this.documentHelper.dialog.element);e&&(e=this.documentHelper.updateDialogTabHeight(e,this.target),this.paginationDiv.style.width=e.toString()+"px")},Api.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.outlineLevel&&(this.outlineLevel.change=void 0,this.outlineLevel.destroy()),this.outlineLevel=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.removeEvents(),this.removeElements(),this.special=void 0,!je(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[parseInt(e.toString(),10)]),e--;this.target=void 0,this.paragraphFormat&&(this.paragraphFormat.destroy(),this.paragraphFormat=void 0),this.documentHelper=void 0}},Api.prototype.removeEvents=function(){this.beforeSpacingSpinDown&&this.beforeSpacingSpinDown.removeEventListener("click",this.clickBeforeSpacingClickHandler),this.afterSpacingSpinDown&&this.afterSpacingSpinDown.removeEventListener("click",this.clickAfterSpacingClickHandler),this.indentContainer&&this.indentContainer.removeEventListener("keyup",this.instance.keyUpParagraphSettingsClickHandler)},Api.prototype.removeElements=function(){this.ejtab&&(this.ejtab.remove(),this.ejtab=void 0),this.div&&(this.div.remove(),this.div=void 0),this.generalDiv&&(this.generalDiv.remove(),this.generalDiv=void 0),this.genLabel&&(this.genLabel.remove(),this.genLabel=void 0),this.alignmentWholeDiv&&(this.alignmentWholeDiv.remove(),this.alignmentWholeDiv=void 0),this.alignmentDiv&&(this.alignmentDiv.remove(),this.alignmentDiv=void 0),this.dirLabel&&(this.dirLabel.remove(),this.dirLabel=void 0),this.rtlDiv&&(this.rtlDiv.remove(),this.rtlDiv=void 0),this.rtlInputELe&&(this.rtlInputELe.remove(),this.rtlInputELe=void 0),this.ltrDiv&&(this.ltrDiv.remove(),this.ltrDiv=void 0),this.ltrInputELe&&(this.ltrInputELe.remove(),this.ltrInputELe=void 0),this.indentionWholeDiv&&(this.indentionWholeDiv.remove(),this.indentionWholeDiv=void 0),this.indentLabel&&(this.indentLabel.remove(),this.indentLabel=void 0),this.indentionSubDiv1&&(this.indentionSubDiv1.remove(),this.indentionSubDiv1=void 0),this.indentionSubDiv2&&(this.indentionSubDiv2.remove(),this.indentionSubDiv2=void 0),this.beforeTextDiv&&(this.beforeTextDiv.remove(),this.beforeTextDiv=void 0),this.afterTextDiv&&(this.afterTextDiv.remove(),this.afterTextDiv=void 0),this.specialDiv&&(this.specialDiv.remove(),this.specialDiv=void 0),this.byDiv&&(this.byDiv.remove(),this.byDiv=void 0),this.by&&(this.by.remove(),this.by=void 0),this.spacingDiv&&(this.spacingDiv.remove(),this.spacingDiv=void 0),this.leftSpacingDiv&&(this.leftSpacingDiv.remove(),this.leftSpacingDiv=void 0),this.contextSpacingDiv&&(this.contextSpacingDiv.remove(),this.contextSpacingDiv=void 0),this.rightSpacingDiv&&(this.rightSpacingDiv.remove(),this.rightSpacingDiv=void 0),this.contextInputEle&&(this.contextInputEle.remove(),this.contextInputEle=void 0),this.spaceLabel&&(this.spaceLabel.remove(),this.spaceLabel=void 0),this.spacingWholeDiv&&(this.spacingWholeDiv.remove(),this.spacingWholeDiv=void 0),this.beforeSpacingWholeDiv&&(this.beforeSpacingWholeDiv.remove(),this.beforeSpacingWholeDiv=void 0),this.afterSpacingWholeDiv&&(this.afterSpacingWholeDiv.remove(),this.afterSpacingWholeDiv=void 0),this.lineSpacingDiv&&(this.lineSpacingDiv.remove(),this.lineSpacingDiv=void 0),this.lineTypeDiv&&(this.lineTypeDiv.remove(),this.lineTypeDiv=void 0),this.lineSpacingAt&&(this.lineSpacingAt.remove(),this.lineSpacingAt=void 0),this.lineBreakContainer&&(this.lineBreakContainer.remove(),this.lineBreakContainer=void 0),this.paginationLabel&&(this.paginationLabel.remove(),this.paginationLabel=void 0),this.widowContorlContainer&&(this.widowContorlContainer.remove(),this.widowContorlContainer=void 0),this.keepNextContainer&&(this.keepNextContainer.remove(),this.keepNextContainer=void 0),this.keepLines&&(this.keepLines.remove(),this.keepLines=void 0),this.widowControl&&(this.widowControl.remove(),this.widowControl=void 0),this.keepWithNext1&&(this.keepWithNext1.remove(),this.keepWithNext1=void 0),this.keepLinesTogether1&&(this.keepLinesTogether1.remove(),this.keepLinesTogether1=void 0),this.beforeSpacingSpinDown&&(this.beforeSpacingSpinDown.remove(),this.beforeSpacingSpinDown=void 0),this.afterSpacingSpinDown&&(this.afterSpacingSpinDown.remove(),this.afterSpacingSpinDown=void 0),this.indentContainer&&(this.indentContainer.remove(),this.indentContainer=void 0)};var Spi=Api;function Api(e){var n=this;this.leftIndent=void 0,this.rightIndent=void 0,this.beforeSpacing=void 0,this.afterSpacing=void 0,this.spaceBeforeAuto=!1,this.spaceAfterAuto=!1,this.textAlignment=void 0,this.paraOutlineLevel=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.keepWithNextValue=void 0,this.keepLineTogetherValue=void 0,this.widowControlValue=void 0,this.tabObj=void 0,this.clickBeforeSpacingClickHandler=this.onClickBeforeSpacingClick.bind(this),this.clickAfterSpacingClickHandler=this.onClickAfterSpacingClick.bind(this),this.keyUpParagraphSettingsClickHandler=this.onKeyUpParagraphSettingsClick.bind(this),this.keyUpParagraphSettings=function(e){13===e.keyCode&&n.applyParagraphFormat()},this.changeBeforeSpacing=function(e){var t=new Cn("documenteditor",n.documentHelper.owner.defaultLocale);t.setLocale(n.documentHelper.owner.locale),-1===e.value?(n.beforeSpacingIn.element.value=t.getConstant("Auto"),n.beforeSpacingIn.step=1,n.spaceBeforeAuto=!0,n.beforeSpacing=5):(n.beforeSpacing=e.value,n.beforeSpacingIn.step=6,n.spaceBeforeAuto=!1)},this.focusBeforeSpacing=function(e){var t=new Cn("documenteditor",n.documentHelper.owner.defaultLocale);t.setLocale(n.documentHelper.owner.locale),-1===e.value&&(n.beforeSpacingIn.element.value=t.getConstant("Auto"))},this.blurBeforeSpacing=function(e){var t,i=new Cn("documenteditor",n.documentHelper.owner.defaultLocale);i.setLocale(n.documentHelper.owner.locale),-1===e.value&&(t=n.beforeSpacingIn,setTimeout(function(){t.element.value=i.getConstant("Auto")},0))},this.clickBeforeSpacing=function(){var e=new Cn("documenteditor",n.documentHelper.owner.defaultLocale);e.setLocale(n.documentHelper.owner.locale),"-1.0"===n.beforeSpacingIn.element.value&&(n.beforeSpacingIn.element.value=e.getConstant("Auto"))},this.changeAfterSpacing=function(e){var t=new Cn("documenteditor",n.documentHelper.owner.defaultLocale);t.setLocale(n.documentHelper.owner.locale),-1===e.value?(n.afterSpacingIn.element.value=t.getConstant("Auto"),n.afterSpacingIn.step=1,n.spaceAfterAuto=!0,n.afterSpacing=5):(n.afterSpacing=e.value,n.afterSpacingIn.step=6,n.spaceAfterAuto=!1)},this.focusAfterSpacing=function(e){var t=new Cn("documenteditor",n.documentHelper.owner.defaultLocale);t.setLocale(n.documentHelper.owner.locale),-1===e.value&&(n.afterSpacingIn.element.value=t.getConstant("Auto"))},this.blurAfterSpacing=function(e){var t,i=new Cn("documenteditor",n.documentHelper.owner.defaultLocale);i.setLocale(n.documentHelper.owner.locale),-1===e.value&&(t=n.afterSpacingIn,setTimeout(function(){t.element.value=i.getConstant("Auto")},0))},this.clickAfterSpacing=function(){var e=new Cn("documenteditor",n.documentHelper.owner.defaultLocale);e.setLocale(n.documentHelper.owner.locale),"-1.0"===n.afterSpacingIn.element.value&&(n.afterSpacingIn.element.value=e.getConstant("Auto"))},this.changeLeftIndent=function(e){n.leftIndent=e.value},this.changeRightIndent=function(e){n.rightIndent=e.value},this.changeLineSpacingValue=function(e){n.lineSpacingIn=e.value},this.changeFirstLineIndent=function(e){n.firstLineIndent=e.value,2===n.special.index&&(n.firstLineIndent=-n.firstLineIndent,n.leftIndent=n.leftIndentIn.value+e.value)},this.changeByTextAlignment=function(e){n.textAlignment=e.value},this.changeByOutlineLevel=function(e){n.paraOutlineLevel=e.value},this.changeBidirectional=function(e){"ltr"===e.value?(n.rtlButton.checked=!n.ltrButton.checked,n.bidi=!1):(n.ltrButton.checked=!n.rtlButton.checked,n.bidi=!0),n.changeAlignmentByBidi()},this.changeContextualSpacing=function(e){n.contextualSpacing=e.checked},this.changeKeepWithNext=function(e){n.keepWithNextValue=e.checked},this.changeKeepLinesTogether=function(e){n.keepLineTogetherValue=e.checked},this.changeWidowControl=function(e){n.widowControlValue=e.checked},this.changeByValue=function(){var e=n.documentHelper.selection.paragraphFormat;switch(n.special.index){case 0:0!==e.firstLineIndent&&(n.byIn.value=0,n.leftIndent=n.leftIndentIn.value);break;case 1:0===e.firstLineIndent||je(e.firstLineIndent)?n.byIn.value=.1:e.firstLineIndent<0&&(n.byIn.value=-e.firstLineIndent,Math.abs(e.firstLineIndent)<=n.leftIndent)&&(n.leftIndent=e.firstLineIndent+n.leftIndent);break;case 2:0===e.firstLineIndent||je(e.firstLineIndent)?e.firstLineIndent=-.1:0<e.firstLineIndent&&(n.byIn.value=e.firstLineIndent,je(n.leftIndent)?n.leftIndent=e.firstLineIndent:n.leftIndent=n.leftIndent+e.firstLineIndent)}},this.changeBySpacing=function(){if(!je(n.lineSpacing))switch(n.lineSpacing.index){case 0:n.lineSpacingType="AtLeast",n.atIn.value=12;break;case 1:n.lineSpacingType="Exactly",n.atIn.value=12;break;case 2:n.lineSpacingType="Multiple",n.atIn.value=1}},this.loadParagraphDialog=function(){n.isStyleDialog?n.directionDiv.classList.add("e-de-disabledbutton"):n.directionDiv.classList.remove("e-de-disabledbutton"),e=n.paragraphFormat||n.documentHelper.selection.paragraphFormat;var e,t=n.getAlignmentValue(e.textAlignment),t=(n.alignment.index=t,n.getOutlineValue(e.outlineLevel)),t=(n.outlineLevel.index=t,n.isHeadingStyle()?n.outlineLevel.readonly=!0:n.outlineLevel.readonly=!1,e.spaceBeforeAuto?n.beforeSpacingIn.value=-1:-1===e.beforeSpacing?n.beforeSpacingIn.value=void 0:n.beforeSpacingIn.value=e.beforeSpacing,e.spaceAfterAuto?n.afterSpacingIn.value=-1:-1===e.afterSpacing?n.afterSpacingIn.value=void 0:n.afterSpacingIn.value=e.afterSpacing,n.leftIndentIn.value=e.leftIndent,n.rightIndentIn.value=e.rightIndent,n.byIn.value=Math.abs(e.firstLineIndent),n.lineSpacing.index);n.keepWithNextValue=void 0,n.keepLineTogetherValue=void 0,n.widowControlValue=void 0,0<e.firstLineIndent?n.special.index=1:e.firstLineIndent<0&&(n.special.index=2,n.leftIndentIn.value=e.leftIndent-n.byIn.value),t="AtLeast"===e.lineSpacingType?0:"Exactly"===e.lineSpacingType?1:2,n.lineSpacing.index=t,n.atIn.value=e.lineSpacing,"none"!==n.documentHelper.selection.caret.style.display&&(n.documentHelper.selection.caret.style.display="none"),e.bidi?(n.rtlButton.checked=!0,n.ltrButton.checked=!1):(n.ltrButton.checked=!0,n.rtlButton.checked=!1),je(e.keepWithNext)?n.keepWithNext.indeterminate=!0:n.keepWithNext.checked=e.keepWithNext,je(e.keepLinesTogether)?n.keepLinesTogether.indeterminate=!0:n.keepLinesTogether.checked=e.keepLinesTogether,je(e.widowControl)?n.widowControlIn.indeterminate=!0:n.widowControlIn.checked=e.widowControl,n.contextSpacing.checked=e.contextualSpacing},this.applyParagraphFormat=function(){var e,t,i=n.paragraphFormat?(e=n.paragraphFormat,!1):!((e=new bri).borders=void 0);je(n.beforeSpacing)||(e.beforeSpacing=n.beforeSpacing),je(n.afterSpacing)||(e.afterSpacing=n.afterSpacing),je(n.spaceBeforeAuto)||(e.spaceBeforeAuto=n.spaceBeforeAuto),je(n.spaceAfterAuto)||(e.spaceAfterAuto=n.spaceAfterAuto),je(n.lineSpacingType)||(e.lineSpacingType=n.lineSpacingType),je(n.leftIndent)||(e.leftIndent=n.leftIndent),je(n.rightIndent)||(e.rightIndent=n.rightIndent),je(n.lineSpacingIn)||(e.lineSpacing=n.lineSpacingIn),je(n.firstLineIndent)||(e.firstLineIndent=Math.abs(n.firstLineIndent),2===n.special.index&&(e.firstLineIndent=-e.firstLineIndent,e.leftIndent=n.leftIndentIn.value+n.byIn.value)),je(n.paraOutlineLevel)||(e.outlineLevel=n.paraOutlineLevel),je(n.bidi)||(e.bidi=n.bidi),je(n.textAlignment)||(t=n.textAlignment,e.bidi&&("Right"===t?t="Left":"Left"===t&&(t="Right")),e.textAlignment=t),je(n.contextualSpacing)||(e.contextualSpacing=n.contextualSpacing),je(n.keepWithNextValue)?n.documentHelper.selection.paragraphFormat.keepWithNext&&(e.keepWithNext=n.documentHelper.selection.paragraphFormat.keepWithNext):e.keepWithNext=n.keepWithNextValue,je(n.keepLineTogetherValue)?n.documentHelper.selection.paragraphFormat.keepLinesTogether&&(e.keepLinesTogether=n.documentHelper.selection.paragraphFormat.keepLinesTogether):e.keepLinesTogether=n.keepLineTogetherValue,je(n.widowControlValue)?n.documentHelper.selection.paragraphFormat.widowControl&&(e.widowControl=n.documentHelper.selection.paragraphFormat.widowControl):e.widowControl=n.widowControlValue,i?n.onParagraphFormat(e):n.documentHelper.owner.styleDialogModule.updateParagraphFormat(e),n.documentHelper.hideDialog()},this.openTabDialog=function(){n.documentHelper.hideDialog(),n.documentHelper.owner.tabDialogModule.show()},this.closeParagraphDialog=function(){n.leftIndent=void 0,n.afterSpacing=void 0,n.beforeSpacing=void 0,n.firstLineIndent=void 0,n.textAlignment=void 0,n.paraOutlineLevel=void 0,n.rightIndent=void 0,n.lineSpacingIn=void 0,n.lineSpacingType=void 0,n.paragraphFormat=void 0,n.documentHelper.hideDialog()},this.documentHelper=e}Ipi.prototype.getListLevel=function(e){var t=this.getLevelOverride(e);return je(t)||je(t.overrideListLevel)?this.abstractList.levels[parseInt(e.toString(),10)]:t.overrideListLevel},Ipi.prototype.getLevelOverride=function(e){for(var t=0;t<this.levelOverrides.length;t++)if(this.levelOverrides[parseInt(t.toString(),10)]instanceof nsi){var i=this.levelOverrides[parseInt(t.toString(),10)];if(i.levelNumber===e)return i}},Ipi.prototype.clear=function(){if(!je(this.levelOverrides)){for(var e=0;e<this.levelOverrides.length;e++)this.levelOverrides[parseInt(e.toString(),10)].clear();this.levelOverrides=[]}this.abstractList&&this.abstractList.clear(),this.abstractList=void 0},Ipi.prototype.destroy=function(){if(!je(this.levelOverrides)){for(var e=0;e<this.levelOverrides.length;e++)this.levelOverrides[parseInt(e.toString(),10)].destroy();this.levelOverrides=[]}this.levelOverrides=void 0,this.abstractList&&(this.abstractList.destroy(),this.abstractList=void 0),this.abstractListId=void 0,this.listId=void 0,this.sourceListId=void 0},Ipi.prototype.mergeList=function(e){je(this.abstractListId)||-1===this.abstractListId||(this.abstractListId=e.abstractListId),je(this.listId)||-1===this.listId||(this.listId=e.listId),je(this.sourceListId)||-1===this.sourceListId||(this.sourceListId=e.sourceListId),je(this.levelOverrides)||0===this.levelOverrides.length||(this.levelOverrides=e.levelOverrides)},Ipi.prototype.clone=function(){for(var e=new Ipi,t=0;t<this.levelOverrides.length;t++)e.levelOverrides.push(this.levelOverrides[parseInt(t.toString(),10)].clone());return e};var xpi=Ipi;function Ipi(){this.nsid=-1,this.listId=-1,this.sourceListId=-1,this.abstractListId=-1,this.abstractList=void 0,this.levelOverrides=[]}Object.defineProperty(Epi.prototype,"levelNumber",{get:function(){return this.levelNumberIn},set:function(e){this.levelNumberIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(Epi.prototype,"list",{get:function(){return this.listIn},set:function(e){je(e)?this.createList():this.listIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(Epi.prototype,"listLevel",{get:function(){var e;if(!je(this.list)&&0<=this.levelNumber&&this.levelNumber<9)return(je(this.dialog.documentHelper.getAbstractListById(this.list.abstractListId))?(this.dialog.documentHelper.lists.push(this.list),e=this.list.abstractList,this.list.abstractList||((e=new tsi).abstractListId=this.list.abstractListId),this.dialog.documentHelper.abstractLists.push(e),(e=this.dialog.documentHelper.getAbstractListById(this.list.abstractListId)).levels.length<=this.levelNumber&&this.dialog.documentHelper.layout.addListLevels(this.list.abstractList),e):(this.dialog.documentHelper.getAbstractListById(this.list.abstractListId).levels.length<=this.levelNumber&&this.dialog.documentHelper.layout.addListLevels(this.list.abstractList),this.dialog.documentHelper.getAbstractListById(this.list.abstractListId))).levels[this.levelNumber]},enumerable:!0,configurable:!0}),Object.defineProperty(Epi.prototype,"listLevelPattern",{get:function(){return je(this.listLevel)?"Arabic":this.listLevel.listLevelPattern},set:function(e){je(this.listLevel)||(this.listLevel.listLevelPattern=e)},enumerable:!0,configurable:!0}),Object.defineProperty(Epi.prototype,"followCharacter",{get:function(){return je(this.listLevel)?"None":this.listLevel.followCharacter},set:function(e){je(this.listLevel)||(this.listLevel.followCharacter=e)},enumerable:!0,configurable:!0}),Epi.prototype.createList=function(){this.list=new xpi,this.list.listId=this.dialog.documentHelper.lists.length+1;var e=new tsi,t=(e.abstractListId=this.dialog.documentHelper.abstractLists.length+1,this.list.abstractListId=e.abstractListId,this.list.abstractList=e,this.dialog.documentHelper.lists.push(this.list),new rsi(e));t.paragraphFormat=new bri(t),t.paragraphFormat.leftIndent=48,t.paragraphFormat.firstLineIndent=-24,t.characterFormat=new Eri(t),t.numberFormat="%1.",t.startAt=1,e.levels.push(t),this.dialog.documentHelper.abstractLists.push(e)},Epi.prototype.addListLevels=function(){if(!je(this.list)&&!je(this.list.abstractListId))for(var e=this.dialog.documentHelper.getAbstractListById(this.list.abstractListId).levels.length;e<9;e++){var t=new rsi(this.dialog.documentHelper.getAbstractListById(this.list.abstractListId));t.characterFormat=new Eri(t),t.paragraphFormat=new bri(t),t.paragraphFormat.leftIndent=48*(e+1),t.paragraphFormat.firstLineIndent=-24,t.numberFormat="%"+(e+1).toString()+".",t.listLevelPattern="Arabic",t.followCharacter="Tab",t.startAt=1,t.restartLevel=e,this.dialog.documentHelper.getAbstractListById(this.list.abstractListId).levels.push(t)}},Epi.prototype.destroy=function(){this.dialog&&this.listIn&&this.dialog.documentHelper.layout.clearInvalidList(this.listIn),this.listIn=void 0,this.levelNumberIn=void 0,this.listLevelPattern=void 0};var Tpi=Epi;function Epi(){this.listIn=void 0,this.levelNumberIn=void 0,this.dialog=void 0,this.levelNumber=0}Object.defineProperty(Mpi.prototype,"listLevel",{get:function(){if(!je(this.viewModel))return this.viewModel.listLevel},enumerable:!0,configurable:!0}),Object.defineProperty(Mpi.prototype,"list",{get:function(){if(!je(this.viewModel))return this.viewModel.list},enumerable:!0,configurable:!0}),Object.defineProperty(Mpi.prototype,"levelNumber",{get:function(){return this.listLevel.ownerBase instanceof nsi?this.listLevel.ownerBase.levelNumber:this.listLevel.ownerBase instanceof tsi&&!je(this.listLevel.ownerBase.levels)?this.listLevel.ownerBase.levels.indexOf(this.listLevel):-1},enumerable:!0,configurable:!0}),Object.defineProperty(Mpi.prototype,"owner",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),Mpi.prototype.getModuleName=function(){return"ListDialog"},Mpi.prototype.showListDialog=function(){var e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),t=(e.setLocale(this.documentHelper.owner.locale),!1),i=(this.target||(this.initListDialog(e,this.documentHelper.owner.enableRtl),t=!0),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,this.documentHelper.owner.enableRtl),n=i?"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:n}},{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.element;this.documentHelper.dialog2.dataBind(),t&&this.wireAndBindEvent(e,i),this.documentHelper.dialog2.beforeOpen=this.loadListDialog,this.documentHelper.dialog2.close=this.closeListDialog,this.documentHelper.dialog2.position={X:"center",Y:"top"},this.documentHelper.dialog2.show()},Mpi.prototype.initListDialog=function(e,t){var i,n=this.documentHelper.owner.containerId;this.target=Q("div",{id:n+"_insert_list",className:"e-de-list-dlg"}),this.listLevelDiv=Q("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(this.listLevelDiv),this.div=Q("div"),this.numberStyleDiv=Q("div",{innerHTML:(i=t?'<div style="float:right;display:block;width:241px;">':'<div style="float:left;display:block;">')+'<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">'}),this.div.appendChild(this.numberStyleDiv),this.numberFormatDiv=Q("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" aria-label="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>"}),this.div.appendChild(this.numberFormatDiv),this.target.appendChild(this.div),this.indentsDiv=Q("div",{innerHTML:i+'<label id="'+n+'_IndentsLabel" style='+(i=t?"display:block;position:relative; ":"display:block; ")+"class=e-de-list-ddl-header>"+e.getConstant("Position")+'</label><label id="'+n+'_textIndentLabel" style='+i+"class=e-de-list-ddl-subheader>"+e.getConstant("Text indent at")+'</label><input type="text" id="'+n+'_textIndent"><label id="'+n+'_followCharacterLabel" style='+i+"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(this.indentsDiv)},Mpi.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")),this.startAtTextBox=document.getElementById(i+"_startAt"),this.startAtTextBox.setAttribute("aria-label","startAt"),this.textIndentAtTextBox=document.getElementById(i+"_textIndent"),this.textIndentAtTextBox.setAttribute("aria-label","textIndent"),this.alignedAtTextBox=document.getElementById(i+"_alignedAt"),this.alignedAtTextBox.setAttribute("aria-label","alignedAt"),this.startAt=new NL({format:"#",decimals:0,min:0,max:50,width:"180px",enablePersistence:!1}),this.startAt.addEventListener("change",this.startedValueChangedClickHandler),this.startAt.appendTo(this.startAtTextBox),this.textIndent=new NL({format:"#",decimals:0,min:0,max:1584,width:"180px",step:4,enablePersistence:!1}),this.textIndent.addEventListener("change",this.textIndentChangedClickHandler),this.textIndent.appendTo(this.textIndentAtTextBox),this.alignedAt=new NL({format:"#",max:1584,step:6,width:"180px",enablePersistence:!1}),this.alignedAt.addEventListener("change",this.alignedAtValueChangedClickHandler),this.alignedAt.appendTo(this.alignedAtTextBox),this.listLevel1=document.getElementById(i+"_listLevel"),this.listLevelElement=new qz({popupHeight:"150px",width:"180px",enableRtl:t,change:this.onListLevelValueChanged}),this.listLevelElement.appendTo(this.listLevel1),this.followCharacterElement=document.getElementById(i+"_followCharacter"),this.followNumberWith=new qz({popupHeight:"150px",width:"180px",enableRtl:t,change:this.onFollowCharacterValueChanged}),this.followNumberWith.appendTo(this.followCharacterElement),this.numberStyleEle=document.getElementById(i+"_numberStyle"),this.numberStyle=new qz({popupHeight:"150px",width:"180px",enableRtl:t,change:this.onLevelPatternValueChanged}),this.numberStyle.appendTo(this.numberStyleEle),this.numberFormat=document.getElementById(i+"_numberFormat"),this.numberFormat.addEventListener("change",this.numberFormatChangedClickHandler),this.restartElement=document.getElementById(i+"_restartBy"),this.restartBy=new qz({popupHeight:"150px",width:"180px",enableRtl:t}),this.restartBy.appendTo(this.restartElement),this.button=document.getElementById(i+"_list_info"),this.formatInfoToolTip=new NS({width:200}),this.formatInfoToolTip.content=e.getConstant("Number format tooltip information"),this.formatInfoToolTip.position="RightTop",this.formatInfoToolTip.appendTo(this.button)},Mpi.prototype.onTextIndentChangedClick=function(e){this.onTextIndentChanged(e)},Mpi.prototype.onStartedValueChangedClick=function(e){this.onStartValueChanged(e)},Mpi.prototype.onNumberFormatChangedClick=function(e){this.onNumberFormatChanged(e)},Mpi.prototype.onAlignedAtValueChangedClick=function(e){this.onAlignedAtValueChanged(e)},Mpi.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;)i.options.remove(n);if(0!==t.selectedIndex)for(n=t.selectedIndex;0<n;n--){var o=document.createElement("option");o.value="Level "+n,o.innerHTML="Level "+n,i.appendChild(o)}(e=document.createElement("option")).value="No Restart",e.innerHTML="No Restart",i.appendChild(e),i.selectedIndex=0},Mpi.prototype.listPatternConverter=function(e){switch(e){case"Arabic":return 0;case"UpRoman":return 1;case"LowRoman":return 2;case"UpLetter":return 3;case"LowLetter":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}},Mpi.prototype.followCharacterConverter=function(e){switch(e){case"Tab":return 0;case"Space":return 1;default:return 2}},Mpi.prototype.calculateAlignedAt=function(){return this.viewModel.listLevel.paragraphFormat.firstLineIndent<0?this.viewModel.listLevel.paragraphFormat.leftIndent+this.viewModel.listLevel.paragraphFormat.firstLineIndent:this.viewModel.listLevel.paragraphFormat.firstLineIndent},Mpi.prototype.updateDialogValues=function(){je(this.listLevel.characterFormat)&&(this.listLevel.characterFormat=new Eri(this.viewModel.listLevel)),je(this.listLevel.paragraphFormat)&&(this.listLevel.paragraphFormat=new bri(this.viewModel.listLevel)),je(this.viewModel)||je(this.viewModel.listLevel)||(this.startAt.value=this.viewModel.listLevel.startAt,this.textIndent.value=this.viewModel.listLevel.paragraphFormat.leftIndent,this.alignedAt.value=this.calculateAlignedAt(),this.followNumberWith.index=this.followCharacterConverter(this.viewModel.followCharacter),this.numberFormat.value=this.viewModel.listLevel.numberFormat,this.numberFormat.style.fontFamily=this.viewModel.listLevel.characterFormat.fontFamily,this.numberStyle.index=this.listPatternConverter(this.viewModel.listLevelPattern),this.listLevelElement.index=this.viewModel.levelNumber)},Mpi.prototype.updateCharacterFormat=function(e){this.listLevel.characterFormat.copyFormat(e)},Mpi.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()},Mpi.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,!je(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[parseInt(e.toString(),10)]),e--;this.target=void 0}this.removeEvents(),this.removeElements(),this.documentHelper=void 0,this.viewModel=void 0},Mpi.prototype.removeEvents=function(){this.startAt&&this.startAt.removeEventListener("change",this.startedValueChangedClickHandler),this.textIndent&&this.textIndent.removeEventListener("change",this.textIndentChangedClickHandler),this.alignedAt&&this.alignedAt.removeEventListener("change",this.alignedAtValueChangedClickHandler),this.numberFormat&&this.numberFormat.removeEventListener("change",this.numberFormatChangedClickHandler)},Mpi.prototype.removeElements=function(){this.listLevelDiv&&(this.listLevelDiv.remove(),this.listLevelDiv=void 0),this.div&&(this.div.remove(),this.div=void 0),this.numberStyleDiv&&(this.numberStyleDiv.remove(),this.numberStyleDiv=void 0),this.indentsDiv&&(this.indentsDiv.remove(),this.indentsDiv=void 0),this.numberFormatDiv&&(this.numberFormatDiv.remove(),this.numberFormatDiv=void 0),this.startAtTextBox&&(this.startAtTextBox.remove(),this.startAtTextBox=void 0),this.textIndentAtTextBox&&(this.textIndentAtTextBox.remove(),this.textIndentAtTextBox=void 0),this.alignedAtTextBox&&(this.alignedAtTextBox.remove(),this.alignedAtTextBox=void 0),this.listLevel1&&(this.listLevel1.remove(),this.listLevel1=void 0),this.followCharacterElement&&(this.followCharacterElement.remove(),this.followCharacterElement=void 0),this.numberStyleEle&&(this.numberStyleEle.remove(),this.numberStyleEle=void 0),this.restartElement&&(this.restartElement.remove(),this.restartElement=void 0),this.button&&(this.button.remove(),this.button=void 0),this.formatInfoToolTip&&(this.formatInfoToolTip.destroy(),this.formatInfoToolTip=void 0),this.startAtTextBox&&(this.startAtTextBox.remove(),this.startAtTextBox=void 0)};var Dpi=Mpi;function Mpi(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.startedValueChangedClickHandler=this.onStartedValueChangedClick.bind(this),this.textIndentChangedClickHandler=this.onTextIndentChangedClick.bind(this),this.alignedAtValueChangedClickHandler=this.onAlignedAtValueChangedClick.bind(this),this.numberFormatChangedClickHandler=this.onNumberFormatChangedClick.bind(this),this.isListCharacterFormat=!1,this.onTextIndentChanged=function(e){e.isInteracted&&(i.viewModel.listLevel.paragraphFormat.leftIndent=e.value)},this.onStartValueChanged=function(e){!e.isInteracted||je(i.viewModel)||je(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,je(i.listLevel)||(i.updateDialogValues(),i.updateRestartLevelBox())},this.onNumberFormatChanged=function(e){i.viewModel.listLevel.numberFormat=e.target.value},this.onAlignedAtValueChanged=function(e){e.isInteracted&&(i.viewModel.listLevel.paragraphFormat.firstLineIndent=i.alignedAt.value-i.viewModel.listLevel.paragraphFormat.leftIndent)},this.onFollowCharacterValueChanged=function(e){e.isInteracted&&(i.viewModel.followCharacter=e.value)},this.onLevelPatternValueChanged=function(e){var t;e.isInteracted&&(i.viewModel.listLevelPattern=e.value,e="%"+(i.levelNumber+1).toString(),t=document.getElementById(i.documentHelper.owner.containerId+"_numberFormat"),"Bullet"===i.listLevel.listLevelPattern?i.listLevel.numberFormat=String.fromCharCode(61623):("None"===i.listLevel.listLevelPattern&&(i.listLevel.numberFormat=""),i.listLevel.numberFormat.match(e)||"None"===i.listLevel.listLevelPattern||(i.listLevel.numberFormat=e+".")),t.value=i.listLevel.numberFormat)},this.loadListDialog=function(){i.documentHelper.updateFocus(),je(i.documentHelper.owner)||(i.viewModel=new Tpi,0<(i.viewModel.dialog=i).documentHelper.selection.paragraphFormat.listLevelNumber&&(i.viewModel.levelNumber=i.documentHelper.selection.paragraphFormat.listLevelNumber),i.viewModel.list=i.documentHelper.selection.paragraphFormat.getList(),je(i.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,!0)},this.onApplyList=function(){je(i.owner)||i.documentHelper.selection.paragraphFormat.setList(i.list,!0),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 Tpi}Ppi.prototype.getModuleName=function(){return"StyleDialog"},Ppi.prototype.initStyleDialog=function(e,t){this.localObj=e,this.target=Q("div",{className:"e-de-style-dialog"}),this.container=Q("div"),this.properties=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Properties")}),this.container.appendChild(this.properties),this.styleNameTypeDiv=Q("div",{className:"e-de-container-row"}),this.container.appendChild(this.styleNameTypeDiv),this.nameWholeDiv=Q("div",{className:"e-de-subcontainer-left"}),this.styleNameTypeDiv.appendChild(this.nameWholeDiv),this.nameValue=Q("input",{className:"e-input e-de-style-dlg-name-input"}),this.nameValue.addEventListener("keyup",this.updateOkButtonClickHandler),this.nameValue.addEventListener("input",this.updateOkButtonClickHandler),this.nameValue.addEventListener("blur",this.updateNextStyleHandler),this.nameWholeDiv.appendChild(this.nameValue),new fV({placeholder:e.getConstant("Name")+":",floatLabelType:"Always"},this.nameValue),this.styleTypeWholeDiv=Q("div",{className:"e-de-subcontainer-right"}),this.styleNameTypeDiv.appendChild(this.styleTypeWholeDiv),this.styleTypeDivElement=Q("div"),this.styleTypeValue=Q("select"),this.styleTypeValue.innerHTML='<option value="Paragraph">'+e.getConstant("Paragraph")+'</option><option value="Character">'+e.getConstant("Character")+'</option><option value="Linked Style">'+e.getConstant("Linked Style")+"</option>",this.styleTypeDivElement.appendChild(this.styleTypeValue),this.styleType=new qz({change:this.styleTypeChange,popupHeight:"253px",enableRtl:t,placeholder:e.getConstant("Style type")+":",floatLabelType:"Always"}),this.styleType.appendTo(this.styleTypeValue),this.styleTypeWholeDiv.appendChild(this.styleTypeDivElement),this.styleBasedParaDiv=Q("div",{className:"e-de-container-row"}),this.container.appendChild(this.styleBasedParaDiv),this.styleBasedOnWholeDiv=Q("div",{className:"e-de-subcontainer-left"}),this.styleBasedParaDiv.appendChild(this.styleBasedOnWholeDiv),this.styleBasedOnDivElement=Q("div",{className:"e-de-style-style-based-on-div"}),this.styleBasedOnValue=Q("input"),this.styleBasedOnDivElement.appendChild(this.styleBasedOnValue),this.styleBasedOn=new qz({dataSource:[],select:this.styleBasedOnChange,popupHeight:"253px",enableRtl:t,placeholder:e.getConstant("Style based on")+":",floatLabelType:"Always"}),this.styleBasedOn.appendTo(this.styleBasedOnValue),this.styleBasedOnWholeDiv.appendChild(this.styleBasedOnDivElement),this.styleParagraphWholeDiv=Q("div",{className:"e-de-subcontainer-right"}),this.styleBasedParaDiv.appendChild(this.styleParagraphWholeDiv),t&&(this.nameWholeDiv.classList.add("e-de-rtl"),this.styleBasedOnWholeDiv.classList.add("e-de-rtl"),this.styleParagraphWholeDiv.classList.add("e-de-rtl")),this.styleParagraphDivElement=Q("div"),this.styleParagraphValue=Q("input"),this.styleParagraphDivElement.appendChild(this.styleParagraphValue),this.styleParagraph=new qz({dataSource:[],select:this.styleParagraphChange,popupHeight:"253px",enableRtl:t,placeholder:e.getConstant("Style for following paragraph")+":",floatLabelType:"Always"}),this.styleParagraph.appendTo(this.styleParagraphValue),this.styleParagraphWholeDiv.appendChild(this.styleParagraphDivElement),this.formatting=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Formatting")}),this.container.appendChild(this.formatting),this.optionsDiv=Q("div",{className:"e-de-style-options-div"}),this.container.appendChild(this.optionsDiv),this.fontOptionsDiv=Q("div",{styles:"display:flex;margin-bottom: 14px;"}),this.optionsDiv.appendChild(this.fontOptionsDiv),this.createFontOptions(this.fontOptionsDiv,t),this.paragraphOptionsDiv=Q("div",{styles:"display:flex",className:"e-style-paragraph"}),this.optionsDiv.appendChild(this.paragraphOptionsDiv),this.createParagraphOptions(this.paragraphOptionsDiv),this.createFormatDropdown(this.container,e,t),this.target.appendChild(this.container)},Ppi.prototype.createFormatDropdown=function(e,t,i){var n=this,e=(this.formatBtn=Q("button",{id:"style_format_dropdown",innerHTML:t.getConstant("Format"),attrs:{type:"button"}}),this.formatBtn.style.height="31px",e.appendChild(this.formatBtn),[{text:t.getConstant("Font")+"...",id:"style_font"},{text:t.getConstant("Paragraph")+"...",id:"style_paragraph"},{text:t.getConstant("Numbering")+"...",id:"style_numbering"}]);this.styleDropdwn=new u2({items:e,cssClass:"e-de-style-format-dropdwn",enableRtl:i,beforeItemRender:function(e){n.styleType.value===t.getConstant("Character")?("style_paragraph"===e.item.id&&e.element.classList.add("e-disabled"),"style_numbering"===e.item.id&&e.element.classList.add("e-disabled")):("style_paragraph"===e.item.id&&e.element.classList.remove("e-disabled"),"style_numbering"===e.item.id&&e.element.classList.remove("e-disabled"))}}),this.styleDropdwn.appendTo(this.formatBtn),this.styleDropdwn.addEventListener("select",this.openDialogHandler)},Ppi.prototype.onOpenDialog=function(e){this.openDialog(e)},Ppi.prototype.createFontOptions=function(e,t){for(var i=this,n=(this.fontFamilyElement=Q("input",{id:this.target.id+"_fontName"}),ao(function(e){return'<span style="font-family: '+e.FontName+';">'+e.FontName+"</span>"})),o=(e.appendChild(this.fontFamilyElement),this.fontFamily=new oU({dataSource:void 0,query:(new ya).select(["FontName"]),fields:{text:"FontName",value:"value"},allowCustom:!0,width:"123px",popupWidth:"123px",cssClass:"e-style-font-fmaily-right",enableRtl:t,change:this.fontFamilyChanged,showClearButton:!1,itemTemplate:n}),this.fontFamily.appendTo(this.fontFamilyElement),this.fontFamily.isStringTemplate=!0,this.documentHelper.owner.documentEditorSettings.fontFamilies),r=0;r<o.length;r++){var s=o[r];this.fontFamily.addItem({FontName:s,value:s},r)}this.fontFamily.focus=function(){i.fontFamily.element.select()},this.fontFamily.element.parentElement.setAttribute("title",this.localObj.getConstant("Font")),this.fontSizeElement=Q("input"),e.appendChild(this.fontSizeElement);this.fontSize=new oU({dataSource:[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72],width:"73px",cssClass:"e-style-font-fmaily-right",enableRtl:t,change:this.fontSizeUpdate}),this.fontSize.showClearButton=!1,this.fontSize.appendTo(this.fontSizeElement),this.fontGroupButton=Q("div",{className:"e-de-style-font-group-button"}),e.appendChild(this.fontGroupButton),this.bold=this.createButtonElement(this.fontGroupButton,"e-de-bold","e-de-style-bold-button-size",this.documentHelper.owner.containerId+"_style_bold"),this.bold.setAttribute("aria-label","bold"),this.bold.addEventListener("click",this.setBoldPropertyHandler),this.italic=this.createButtonElement(this.fontGroupButton,"e-de-italic","e-de-style-icon-button-size",this.documentHelper.owner.containerId+"_style_italic"),this.italic.setAttribute("aria-label","italic"),this.italic.addEventListener("click",this.setItalicPropertyHandler),this.underline=this.createButtonElement(this.fontGroupButton,"e-de-underline","e-de-style-icon-button-size",this.documentHelper.owner.containerId+"_style_underline"),this.underline.setAttribute("aria-label","underline"),this.underline.addEventListener("click",this.setUnderlinePropertyHandler),this.fontColorElement=Q("input",{attrs:{type:"color"},className:"e-de-style-icon-button-size"}),e.appendChild(this.fontColorElement);var n=this.documentHelper.owner.documentEditorSettings.colorPickerSettings,e=n.columns,a=n.createPopupOnClick,l=n.disabled,h=n.enablePersistence,d=(n.enableRtl,n.inline),p=n.mode,c=n.modeSwitcher,u=n.noColor,g=n.presetColors,n=n.showButtons;this.fontColor=new cV({cssClass:"e-de-style-font-color-picker",enableRtl:t,change:this.fontColorUpdate,locale:this.documentHelper.owner.locale,enableOpacity:!1,mode:p,modeSwitcher:c,showButtons:n,columns:e,createPopupOnClick:a,disabled:l,enablePersistence:h,inline:d,noColor:u,presetColors:g}),this.documentHelper.fontColor=this.fontColor,this.fontColor.appendTo(this.fontColorElement)},Ppi.prototype.onSetBoldProperty=function(){this.setBoldProperty()},Ppi.prototype.onSetItalicProperty=function(){this.setItalicProperty()},Ppi.prototype.onSetUnderlineProperty=function(){this.setUnderlineProperty()},Ppi.prototype.createParagraphOptions=function(e){this.alignmentDiv=Q("div",{className:"e-de-style-paragraph-group-button"}),e.appendChild(this.alignmentDiv),this.leftAlign=this.createButtonElement(this.alignmentDiv,"e-de-align-left","e-de-style-icon-button-size"),this.leftAlign.setAttribute("aria-label","leftAlign"),this.leftAlign.addEventListener("click",this.setLeftAlignmentClickHandler),this.centerAlign=this.createButtonElement(this.alignmentDiv,"e-de-align-center","e-de-style-icon-button-size"),this.centerAlign.setAttribute("aria-label","centerAlign"),this.centerAlign.addEventListener("click",this.setCenterAlignmentClickHandler),this.rightAlign=this.createButtonElement(this.alignmentDiv,"e-de-align-right","e-de-style-icon-button-size"),this.rightAlign.setAttribute("aria-label","rightAlign"),this.rightAlign.addEventListener("click",this.setRightAlignmentClickHandler),this.justify=this.createButtonElement(this.alignmentDiv,"e-de-justify","e-de-style-icon-button-last-size"),this.justify.setAttribute("aria-label","justify"),this.justify.addEventListener("click",this.setJustifyAlignmentClickHandler),this.lineSpacingDiv=Q("div",{className:"e-de-style-paragraph-group-button"}),e.appendChild(this.lineSpacingDiv),this.singleLineSpacing=this.createButtonElement(this.lineSpacingDiv,"e-de-single-spacing","e-de-style-icon-button-first-size"),this.singleLineSpacing.setAttribute("aria-label","singleLineSpacing"),this.singleLineSpacing.addEventListener("click",this.setSingleLineSpacingClickHandler),this.onePointFiveLineSpacing=this.createButtonElement(this.lineSpacingDiv,"e-de-one-point-five-spacing","e-de-style-icon-button-size"),this.onePointFiveLineSpacing.setAttribute("aria-label","onePointFiveLineSpacing"),this.onePointFiveLineSpacing.addEventListener("click",this.setOnePointFiveLineSpacingClickHandler),this.doubleLineSpacing=this.createButtonElement(this.lineSpacingDiv,"e-de-double-spacing","e-de-style-icon-button-last-size"),this.doubleLineSpacing.setAttribute("aria-label","doubleLineSpacing"),this.doubleLineSpacing.addEventListener("click",this.setDoubleLineSpacingClickHandler),this.spacingDiv=Q("div",{className:"e-de-style-paragraph-group-button"}),e.appendChild(this.spacingDiv),this.beforeSpacingEle=this.createButtonElement(this.spacingDiv,"e-de-before-spacing","e-de-style-icon-button-first-size"),this.beforeSpacingEle.setAttribute("aria-label","beforeSpacing"),this.afterSpacingEle=this.createButtonElement(this.spacingDiv,"e-de-after-spacing","e-de-style-icon-button-last-size"),this.afterSpacingEle.setAttribute("aria-label","afterSpacing"),this.beforeSpacingEle.addEventListener("click",this.increaseBeforeAfterSpacingValueHandler),this.afterSpacingEle.addEventListener("click",this.decreaseBeforeAfterSpacingValueHandler),this.indentingDiv=Q("div",{className:"e-de-style-paragraph-indent-group-button"}),e.appendChild(this.indentingDiv),this.decreaseIndent=this.createButtonElement(this.indentingDiv,"e-de-indent","e-de-style-icon-button-first-size"),this.decreaseIndent.setAttribute("aria-label","decreaseIndent"),this.decreaseIndent.addEventListener("click",this.decreaseIndentValueHandler),this.increaseindent=this.createButtonElement(this.indentingDiv,"e-de-outdent","e-de-style-icon-button-size"),this.increaseindent.setAttribute("aria-label","increaseindent"),this.increaseindent.addEventListener("click",this.increaseIndentValueHandler)},Ppi.prototype.setSingleLineSpacing=function(){this.lineSpacing=1,this.updateParagraphFormat()},Ppi.prototype.setOnePointFiveLineSpacing=function(){this.lineSpacing=1.5,this.updateParagraphFormat()},Ppi.prototype.setDoubleLineSpacing=function(){this.lineSpacing=2,this.updateParagraphFormat()},Ppi.prototype.increaseIndentValue=function(){this.leftIndent+=36},Ppi.prototype.decreaseIndentValue=function(){36<=this.leftIndent?this.leftIndent-=36:this.leftIndent=0},Ppi.prototype.onSetLeftAlignmentClick=function(){this.setLeftAlignment()},Ppi.prototype.onSetRightAlignmentClick=function(){this.setRightAlignment()},Ppi.prototype.onSetCenterAlignmentClick=function(){this.setCenterAlignment()},Ppi.prototype.onSetJustifyAlignmentClick=function(){this.setJustifyAlignment()},Ppi.prototype.createButtonElement=function(e,t,i,n){var o=Q("button",{attrs:{type:"button"}});return je(n)||(o.id=n),e.appendChild(o),new zv({iconCss:t,cssClass:i}).appendTo(o),o},Ppi.prototype.onIncreaseBeforeAfterSpacing=function(){this.increaseBeforeAfterSpacing()},Ppi.prototype.onDecreaseBeforeAfterSpacing=function(){this.decreaseBeforeAfterSpacing()},Ppi.prototype.toggleDisable=function(){var e;this.styleType.value===this.localObj.getConstant("Character")?this.styleParagraph.enabled=!(e="display:flex;pointer-events:none;opacity:0.5"):(e="display:flex",this.styleParagraph.enabled=!0,this.target.getElementsByClassName("e-style-paragraph").item(0).removeAttribute("style")),rt(this.target.getElementsByClassName("e-style-paragraph").item(0),e),this.styleBasedOn.enabled=!0},Ppi.prototype.onUpdateNextStyle=function(e){this.updateNextStyle(e)},Ppi.prototype.onUpdateOkButtonClick=function(){this.updateOkButton()},Ppi.prototype.show=function(e,t){var i=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),n=(this.isEdit=!je(e)&&0<e.length,this.editStyleName=e,this.abstractList=new tsi,this.documentHelper.styles.findByName(e));this.style=this.isEdit?n||this.getStyle(e):new _ri,i.setLocale(this.documentHelper.owner.locale),this.target||this.initStyleDialog(i,this.documentHelper.owner.enableRtl),this.isEdit?this.styleType.value=this.style instanceof jri?"Character":"Paragraph":this.styleType.value="Paragraph",je(t)&&(t=i.getConstant("Create New Style")),this.documentHelper.dialog2.header=t,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:i.getConstant("Ok"),cssClass:"e-flat e-style-okay",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:i.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()},Ppi.prototype.updateList=function(){var t=this.style.paragraphFormat.listFormat.listId;-1<t&&(0!==this.documentHelper.lists.filter(function(e){return e.listId===t}).length&&(this.documentHelper.lists=this.documentHelper.lists.filter(function(e){return e.listId!==t})),this.documentHelper.lists.push(this.style.paragraphFormat.listFormat.list)),-1!==this.abstractList.abstractListId&&this.documentHelper.abstractLists.push(this.abstractList)},Ppi.prototype.createLinkStyle=function(e,t){var i=t?this.documentHelper.styles.findByName(e+" Char","Character"):new jri;return 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")},Ppi.prototype.updateCharacterFormat=function(e){je(e)||(this.characterFormat=e.cloneFormat()),this.fontFamily.value=this.characterFormat.fontFamily,this.fontSize.value=this.characterFormat.fontSize;e=this.characterFormat.fontColor;this.fontColor.value="empty"===e||"#00000000"===e?"#000000":e,this.fontButtonClicked()},Ppi.prototype.updateParagraphFormat=function(e){je(e)||(this.paragraphFormat=e.cloneFormat(),this.textAlignment=e.textAlignment,this.lineSpacing=e.lineSpacing),je(this.paragraphFormat)||("Left"===this.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.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.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.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.lineSpacing?(this.singleLineSpacing.classList.add("e-active"),this.onePointFiveLineSpacing.classList.remove("e-active"),this.doubleLineSpacing.classList.remove("e-active")):1.5===this.lineSpacing?(this.singleLineSpacing.classList.remove("e-active"),this.onePointFiveLineSpacing.classList.add("e-active"),this.doubleLineSpacing.classList.remove("e-active")):2===this.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")))},Ppi.prototype.enableOrDisableOkButton=function(){je(this.okButton)||(this.okButton.disabled=""===this.styleNameElement.value)},Ppi.prototype.getTypeValue=function(e){e=je(e)?this.styleType.value:e;return"Linked Style"===e||"Paragraph"===e?"Paragraph":"Character"},Ppi.prototype.updateStyleNames=function(e,t){for(var i,n,o,r=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),s=(r.setLocale(this.documentHelper.owner.locale),this.documentHelper.styles.getStyleNames(e)),a=[],l=0;l<s.length;l++)""===(o=r.getConstant(s[parseInt(l.toString(),10)]))&&(o=s[parseInt(l.toString(),10)]),a.push(o);this.styleParagraph.dataSource=a,this.styleParagraph.index=null,t?(this.styleBasedOn.dataSource=a.filter(function(e){return e!==t}),this.styleBasedOn.index=null,(i=this.getStyle(t)).basedOn instanceof String||je(i.basedOn)?this.styleBasedOn.enabled=!1:this.styleBasedOn.index=-1<s.indexOf(i.basedOn.name)?s.indexOf(i.basedOn.name):0,"Paragraph"===i.type?je(i.link)?this.styleType.index=0:this.styleType.index=2:this.styleType.index=1,je(i.next)||(i=i.next.name,n=0,-1<s.indexOf(i)&&(n=s.indexOf(i)),this.styleParagraph.index=n,this.isUserNextParaUpdated=i!==t)):(this.styleBasedOn.dataSource=a,this.styleBasedOn.index=null,n=0,this.documentHelper.owner.selectionModule&&(o=void 0,o=("Character"===e?this.documentHelper.owner.selectionModule.characterFormat:this.documentHelper.owner.selectionModule.paragraphFormat).styleName,n=s.indexOf(o)),this.styleBasedOn.index=n,this.styleParagraph.index=0),this.isEdit?this.styleType.enabled=!1:this.styleType.enabled=!0},Ppi.prototype.getStyle=function(e){return je(this.documentHelper.styles.findByName(e))&&this.documentHelper.owner.editorModule.createStyle(this.documentHelper.preDefinedStyles.get(e)),this.documentHelper.styles.findByName(e)},Ppi.prototype.destroy=function(){if(!je(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.characterFormat&&(this.characterFormat.destroy(),this.characterFormat=void 0),this.paragraphFormat&&(this.paragraphFormat.destroy(),this.paragraphFormat=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.destroy(),this.style=void 0),this.abstractList&&(this.abstractList.destroy(),this.abstractList=void 0),this.numberingBulletDialog&&(this.numberingBulletDialog.destroy(),this.numberingBulletDialog=void 0),this.styleDropdwn&&(this.styleDropdwn.destroy(),this.styleDropdwn=void 0),this.textAlignment&&(this.textAlignment=void 0),this.lineSpacing&&(this.lineSpacing=void 0),this.leftIndent&&(this.leftIndent=void 0),this.beforeSpacing&&(this.beforeSpacing=void 0),this.afterSpacing&&(this.afterSpacing=void 0),this.removeEvents(),this.removeElements(),this.documentHelper=void 0},Ppi.prototype.removeEvents=function(){this.nameValue&&(this.nameValue.removeEventListener("input",this.updateOkButtonClickHandler),this.nameValue.removeEventListener("keyup",this.updateOkButtonClickHandler),this.nameValue.removeEventListener("blur",this.updateNextStyleHandler)),this.styleDropdwn&&this.styleDropdwn.removeEventListener("select",this.openDialogHandler),this.bold&&this.bold.removeEventListener("click",this.setBoldPropertyHandler),this.italic&&this.italic.removeEventListener("click",this.setItalicPropertyHandler),this.underline&&this.underline.removeEventListener("click",this.setUnderlinePropertyHandler),this.leftAlign&&this.leftAlign.removeEventListener("click",this.setLeftAlignmentClickHandler),this.centerAlign&&this.centerAlign.removeEventListener("click",this.setCenterAlignmentClickHandler),this.rightAlign&&this.rightAlign.removeEventListener("click",this.setRightAlignmentClickHandler),this.justify&&this.justify.removeEventListener("click",this.setJustifyAlignmentClickHandler),this.singleLineSpacing&&this.singleLineSpacing.removeEventListener("click",this.setSingleLineSpacingClickHandler),this.onePointFiveLineSpacing&&this.onePointFiveLineSpacing.removeEventListener("click",this.setOnePointFiveLineSpacingClickHandler),this.doubleLineSpacing&&this.doubleLineSpacing.removeEventListener("click",this.setDoubleLineSpacingClickHandler),this.beforeSpacingEle&&this.beforeSpacingEle.removeEventListener("click",this.increaseBeforeAfterSpacingValueHandler),this.afterSpacingEle&&this.afterSpacingEle.removeEventListener("click",this.decreaseBeforeAfterSpacingValueHandler),this.decreaseIndent&&this.decreaseIndent.removeEventListener("click",this.decreaseIndentValueHandler),this.increaseindent&&this.increaseindent.removeEventListener("click",this.increaseIndentValueHandler)},Ppi.prototype.removeElements=function(){this.container&&(this.container.remove(),this.container=void 0),this.properties&&(this.properties.remove(),this.properties=void 0),this.styleNameTypeDiv&&(this.styleNameTypeDiv.remove(),this.styleNameTypeDiv=void 0),this.nameWholeDiv&&(this.nameWholeDiv.remove(),this.nameWholeDiv=void 0),this.nameValue&&(this.nameValue.remove(),this.nameValue=void 0),this.styleTypeWholeDiv&&(this.styleTypeWholeDiv.remove(),this.styleTypeWholeDiv=void 0),this.styleTypeDivElement&&(this.styleTypeDivElement.remove(),this.styleTypeDivElement=void 0),this.styleTypeValue&&(this.styleTypeValue.remove(),this.styleTypeValue=void 0),this.styleBasedParaDiv&&(this.styleBasedParaDiv.remove(),this.styleBasedParaDiv=void 0),this.styleBasedOnWholeDiv&&(this.styleBasedOnWholeDiv.remove(),this.styleBasedOnWholeDiv=void 0),this.styleBasedOnDivElement&&(this.styleBasedOnDivElement.remove(),this.styleBasedOnDivElement=void 0),this.styleBasedOnValue&&(this.styleBasedOnValue.remove(),this.styleBasedOnValue=void 0),this.styleParagraphWholeDiv&&(this.styleParagraphWholeDiv.remove(),this.styleParagraphWholeDiv=void 0),this.styleParagraphDivElement&&(this.styleParagraphDivElement.remove(),this.styleParagraphDivElement=void 0),this.styleParagraphValue&&(this.styleParagraphValue.remove(),this.styleParagraphValue=void 0),this.formatting&&(this.formatting.remove(),this.formatting=void 0),this.optionsDiv&&(this.optionsDiv.remove(),this.optionsDiv=void 0),this.fontOptionsDiv&&(this.fontOptionsDiv.remove(),this.fontOptionsDiv=void 0),this.paragraphOptionsDiv&&(this.paragraphOptionsDiv.remove(),this.paragraphOptionsDiv=void 0),this.formatBtn&&(this.formatBtn.remove(),this.formatBtn=void 0),this.fontFamilyElement&&(this.fontFamilyElement.remove(),this.fontFamilyElement=void 0),this.fontSizeElement&&(this.fontSizeElement.remove(),this.fontSizeElement=void 0),this.fontGroupButton&&(this.fontGroupButton.remove(),this.fontGroupButton=void 0),this.fontColorElement&&(this.fontColorElement.remove(),this.fontColorElement=void 0),this.alignmentDiv&&(this.alignmentDiv.remove(),this.alignmentDiv=void 0),this.lineSpacingDiv&&(this.lineSpacingDiv.remove(),this.lineSpacingDiv=void 0),this.spacingDiv&&(this.spacingDiv.remove(),this.spacingDiv=void 0),this.beforeSpacingEle&&(this.beforeSpacingEle.remove(),this.beforeSpacingEle=void 0),this.afterSpacingEle&&(this.afterSpacingEle.remove(),this.afterSpacingEle=void 0),this.indentingDiv&&(this.indentingDiv.remove(),this.indentingDiv=void 0),this.decreaseIndent&&(this.decreaseIndent.remove(),this.decreaseIndent=void 0),this.increaseindent&&(this.increaseindent.remove(),this.increaseindent=void 0)};var kpi=Ppi;function Ppi(e){var s=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.textAlignment=void 0,this.lineSpacing=void 0,this.leftIndent=void 0,this.beforeSpacing=void 0,this.afterSpacing=void 0,this.setLeftAlignmentClickHandler=this.onSetLeftAlignmentClick.bind(this),this.setCenterAlignmentClickHandler=this.onSetCenterAlignmentClick.bind(this),this.setRightAlignmentClickHandler=this.onSetRightAlignmentClick.bind(this),this.setJustifyAlignmentClickHandler=this.onSetJustifyAlignmentClick.bind(this),this.setSingleLineSpacingClickHandler=this.setSingleLineSpacing.bind(this),this.setOnePointFiveLineSpacingClickHandler=this.setOnePointFiveLineSpacing.bind(this),this.setDoubleLineSpacingClickHandler=this.setDoubleLineSpacing.bind(this),this.increaseIndentValueHandler=this.increaseIndentValue.bind(this),this.decreaseIndentValueHandler=this.decreaseIndentValue.bind(this),this.increaseBeforeAfterSpacingValueHandler=this.onIncreaseBeforeAfterSpacing.bind(this),this.decreaseBeforeAfterSpacingValueHandler=this.onDecreaseBeforeAfterSpacing.bind(this),this.setUnderlinePropertyHandler=this.onSetUnderlineProperty.bind(this),this.setItalicPropertyHandler=this.onSetItalicProperty.bind(this),this.setBoldPropertyHandler=this.onSetBoldProperty.bind(this),this.openDialogHandler=this.onOpenDialog.bind(this),this.updateOkButtonClickHandler=this.onUpdateOkButtonClick.bind(this),this.updateNextStyleHandler=this.onUpdateNextStyle.bind(this),this.openDialog=function(e){switch(e.item.id){case"style_font":s.showFontDialog();break;case"style_paragraph":s.showParagraphDialog();break;case"style_numbering":s.showNumberingBulletDialog()}},this.setBoldProperty=function(){s.characterFormat.bold=!s.characterFormat.bold,s.fontButtonClicked()},this.setItalicProperty=function(){s.characterFormat.italic=!s.characterFormat.italic,s.fontButtonClicked()},this.setUnderlineProperty=function(){s.characterFormat.underline="None"===s.characterFormat.underline?"Single":"None",s.fontButtonClicked()},this.fontButtonClicked=function(){s.characterFormat.bold?s.bold.classList.contains("e-active")||s.bold.classList.add("e-active"):s.bold.classList.contains("e-active")&&s.bold.classList.remove("e-active"),s.characterFormat.italic?s.italic.classList.contains("e-active")||s.italic.classList.add("e-active"):s.italic.classList.contains("e-active")&&s.italic.classList.remove("e-active"),void 0!==s.characterFormat.underline&&"None"!==s.characterFormat.underline?s.underline.classList.contains("e-active")||(s.underline.classList.add("e-active"),s.characterFormat.underline="Single"):s.underline.classList.contains("e-active")&&(s.underline.classList.remove("e-active"),s.characterFormat.underline="None")},this.fontSizeUpdate=function(e){s.characterFormat.fontSize=e.value},this.fontFamilyChanged=function(e){s.characterFormat.fontFamily=e.value.toString()},this.fontColorUpdate=function(e){s.characterFormat.fontColor=e.currentValue.hex},this.setLeftAlignment=function(){"Left"===s.textAlignment?s.textAlignment="Justify":s.textAlignment="Left",s.updateParagraphFormat()},this.setRightAlignment=function(){"Right"===s.textAlignment?s.textAlignment="Left":s.textAlignment="Right",s.updateParagraphFormat()},this.setCenterAlignment=function(){"Center"===s.textAlignment?s.textAlignment="Left":s.textAlignment="Center",s.updateParagraphFormat()},this.setJustifyAlignment=function(){"Justify"===s.textAlignment?s.textAlignment="Left":s.textAlignment="Justify",s.updateParagraphFormat()},this.increaseBeforeAfterSpacing=function(){s.beforeSpacing+=6,s.afterSpacing+=6},this.decreaseBeforeAfterSpacing=function(){6<=s.beforeSpacing?s.beforeSpacing-=6:s.beforeSpacing=0,6<=s.afterSpacing?s.afterSpacing-=6:s.afterSpacing=0},this.updateNextStyle=function(e){var t,e=e.srcElement.value;s.getTypeValue()!==s.localObj.getConstant("Paragraph")||je(e)||""===e||s.isUserNextParaUpdated||(t=s.documentHelper.styles.getStyleNames(s.getTypeValue()),(t=s.isEdit?t.filter(function(e){return e!==s.editStyleName}):t).push(e),s.styleParagraph.dataSource=t,s.styleParagraph.index=null,s.styleParagraph.index=t.indexOf(e))},this.updateOkButton=function(){s.target.getElementsByClassName("e-input e-de-style-dlg-name-input").item(0).value;s.enableOrDisableOkButton()},this.styleTypeChange=function(e){var t;e.isInteracted&&(t=void 0,"Character"===e.value&&(s.style=new jri,t="Character"),"Paragraph"!==e.value&&"Linked Style"!==e.value||(s.style=new _ri,t="Paragraph"),s.toggleDisable(),s.updateStyleNames(t))},this.styleBasedOnChange=function(){},this.styleParagraphChange=function(e){e.isInteracted&&(s.isUserNextParaUpdated=!0)},this.showFontDialog=function(){je(s.documentHelper.owner.fontDialogModule)||s.documentHelper.owner.showFontDialog(s.characterFormat),s.updateCharacterFormat()},this.showParagraphDialog=function(){je(s.documentHelper.owner.paragraphDialogModule)||s.documentHelper.owner.showParagraphDialog(s.paragraphFormat)},this.showNumberingBulletDialog=function(){s.numberingBulletDialog=new Bpi(s.documentHelper),s.style instanceof _ri&&!je(s.style.paragraphFormat)&&s.numberingBulletDialog.showNumberBulletDialog(s.style.paragraphFormat.listFormat,s.abstractList)},this.onOkButtonClick=function(){var e=s.documentHelper.owner.stylesDialogModule.getStyleName(go.sanitize(s.styleNameElement.value));if(!(0<e.length))throw new Error("Enter valid Style name");var t,i,n,o,r=s.documentHelper.styles.findByName(e);je(r)?((o=new("Paragraph"===s.getTypeValue()?_ri:jri)).copyStyle(s.style),"Character"===s.getTypeValue()&&o.characterFormat.copyFormat(s.characterFormat),t=s.documentHelper.styles.findByName(s.documentHelper.owner.stylesDialogModule.getStyleName(s.styleBasedOn.value)),"Paragraph"!==s.styleType.value&&"Linked Style"!==s.styleType.value||(e===s.documentHelper.owner.stylesDialogModule.getStyleName(s.styleParagraph.value)?o.next=o:o.next=s.documentHelper.styles.findByName(s.documentHelper.owner.stylesDialogModule.getStyleName(s.styleParagraph.value)),s.updateList()),o.link="Linked Style"===s.styleType.value?s.createLinkStyle(e):void 0,o.type=s.getTypeValue(),o.name=e,o.basedOn=t,o.characterFormat=s.characterFormat,o.paragraphFormat=s.paragraphFormat,s.documentHelper.styles.push(o),s.documentHelper.addToStylesMap(o),t=e,s.documentHelper.owner.editorHistoryModule.initializeHistory("ModifyStyle"),s.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo&&"ModifyStyle"===s.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo.action&&(n=o instanceof _ri?o.paragraphFormat.listFormat.listId:-1,(n=s.documentHelper.owner.getStyleObject(o,n)).isNew=!0,s.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo.modifiedProperties.push(n),s.applyParagraphFormat()),s.documentHelper.owner.editorHistoryModule.updateHistory(),o=s.style instanceof _ri?s.style.paragraphFormat.listFormat.listId:-1,s.documentHelper.owner.setStyleData(t,o),s.documentHelper.owner.editorModule.isSkipOperationsBuild="Character"===s.styleType.value&&s.documentHelper.owner.enableCollaborativeEditing,s.documentHelper.owner.editorModule.applyStyle(t,!0),s.documentHelper.owner.editorModule.isSkipOperationsBuild=!1,s.documentHelper.owner.notify(ZJt,{})):(s.documentHelper.owner.editorHistoryModule.initializeHistory("ModifyStyle"),"Paragraph"!==s.styleType.value&&"Linked Style"!==s.styleType.value||s.updateList(),s.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo&&"ModifyStyle"===s.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo.action&&(i=r instanceof _ri?r.paragraphFormat.listFormat.listId:-1,n=s.documentHelper.owner.getStyleObject(r,i),s.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo.modifiedProperties.push(n),s.applyParagraphFormat()),s.documentHelper.owner.editorHistoryModule.updateHistory(),s.style.type=s.getTypeValue(),s.style.basedOn=s.documentHelper.styles.findByName(s.documentHelper.owner.stylesDialogModule.getStyleName(s.styleBasedOn.value)),"Paragraph"!==s.styleType.value&&"Linked Style"!==s.styleType.value||(s.style.next=s.documentHelper.styles.findByName(s.documentHelper.owner.stylesDialogModule.getStyleName(s.styleParagraph.value)),s.style.characterFormat.assignFormat(s.characterFormat),s.style.paragraphFormat.assignFormat(s.paragraphFormat,!0),s.style.link="Linked Style"===s.styleType.value?s.createLinkStyle(e,s.isEdit):void 0),s.style.name=r.name,t=r.name,s.style,o=s.style instanceof _ri?s.style.paragraphFormat.listFormat.listId:-1,s.documentHelper.owner.setStyleData(t,o),s.documentHelper.owner.isShiftingEnabled=!0,s.documentHelper.owner.editorModule.isSkipOperationsBuild=s.documentHelper.owner.enableCollaborativeEditing,s.documentHelper.owner.editorModule.layoutWholeDocument(),s.documentHelper.owner.editorModule.isSkipOperationsBuild=!1,s.documentHelper.owner.isShiftingEnabled=!1),s.documentHelper.dialog2.hide(),s.documentHelper.updateFocus(),s.style,s.documentHelper.updateFocus()},this.loadStyleDialog=function(){var e;s.documentHelper.updateFocus(),s.isUserNextParaUpdated=!1,s.styleNameElement=s.target.getElementsByClassName("e-input e-de-style-dlg-name-input").item(0),s.styleNameElement.value=null,s.isEdit||(s.styleType.index=0),s.isEdit&&((e=new Cn("documenteditor",s.documentHelper.owner.defaultLocale)).setLocale(s.documentHelper.owner.locale),""===(e=e.getConstant(s.editStyleName))&&(e=s.editStyleName),s.styleNameElement.value=e,e=s.editStyleName),s.okButton=s.documentHelper.dialog2.element.getElementsByClassName("e-flat e-style-okay").item(0),s.enableOrDisableOkButton(),s.updateStyleNames(s.getTypeValue(),e),s.updateCharacterFormat(s.style.characterFormat),s.updateParagraphFormat(s.style.paragraphFormat)},this.applyParagraphFormat=function(){je(s.paragraphFormat)&&(s.paragraphFormat=new bri),je(s.textAlignment)||(s.paragraphFormat.textAlignment=s.textAlignment),je(s.beforeSpacing)||(s.paragraphFormat.beforeSpacing=s.beforeSpacing),je(s.afterSpacing)||(s.paragraphFormat.afterSpacing=s.afterSpacing),je(s.leftIndent)||(s.paragraphFormat.leftIndent=s.leftIndent),je(s.lineSpacing)||(s.paragraphFormat.lineSpacing=s.lineSpacing),s.updateParagraphFormat()},this.onCancelButtonClick=function(){s.style=void 0,s.characterFormat=void 0,s.paragraphFormat=void 0,s.textAlignment=void 0,s.lineSpacing=void 0,s.leftIndent=void 0,s.beforeSpacing=void 0,s.afterSpacing=void 0,s.documentHelper.dialog2.hide(),s.documentHelper.updateFocus()},this.closeStyleDialog=function(){s.documentHelper.updateFocus(),s.textAlignment=void 0,s.lineSpacing=void 0,s.leftIndent=void 0,s.beforeSpacing=void 0,s.afterSpacing=void 0},this.documentHelper=e}Fpi.prototype.getModuleName=function(){return"BulletsAndNumberingDialog"},Fpi.prototype.initNumberingBulletDialog=function(e){var t=this.documentHelper.owner.containerId;this.target=Q("div",{id:t+"_insertNumberBulletDialog",className:"e-de-number-bullet-dlg"}),this.tabTarget=Q("div",{id:t+"_tabNumberBulletDialog",className:"e-de-tab-number-bullet-dlg"}),this.target.appendChild(this.tabTarget),this.createNumberList(t,e),this.createBulletList(t,e),this.tabObj=new k5({items:[{header:{text:Q("div",{innerHTML:e.getConstant("Numbering")})},content:this.numberListDiv},{header:{text:Q("div",{innerHTML:e.getConstant("Bullets")})},content:this.bulletListDiv}],heightAdjustMode:"None",width:"auto",selecting:this.onTabSelect.bind(this)}),this.tabObj.isStringTemplate=!0,this.tabObj.appendTo(this.tabTarget)},Fpi.prototype.onTabSelect=function(e){e.preventFocus=!0,1===e.selectingIndex&&(this.bulletListDiv.style.display="block")},Fpi.prototype.createNumberList=function(e,t){this.numberListDiv=Q("div",{className:"e-de-style-numbered-list",id:e+"_Number"});var e=this.numberListDiv,t=(this.ulTag=Q("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"}),e.appendChild(this.ulTag),this.createNumberNoneListTag(this.ulTag,t)),i=this.createNumberListTag(this.ulTag,"1.","2.","3.","e-de-list-numbered-number-dot"),n=this.createNumberListTag(this.ulTag,"1)","2)","3)","e-de-list-numbered-number-brace"),o=this.createNumberListTag(this.ulTag,"I.","II.","III.","e-de-list-numbered-up-roman"),r=this.createNumberListTag(this.ulTag,"A.","B.","C.","e-de-list-numbered-up-letter"),s=this.createNumberListTag(this.ulTag,"a.","b.","c.","e-de-numbered-low-letter-dot"),a=this.createNumberListTag(this.ulTag,"a)","b)","c)","e-de-list-numbered-low-letter-brace"),l=this.createNumberListTag(this.ulTag,"i.","ii.","iii.","e-de-list-numbered-low-roman");t.addEventListener("click",this.numberListClickHandler),i.addEventListener("click",this.numberListClickHandler),n.addEventListener("click",this.numberListClickHandler),o.addEventListener("click",this.numberListClickHandler),r.addEventListener("click",this.numberListClickHandler),a.addEventListener("click",this.numberListClickHandler),s.addEventListener("click",this.numberListClickHandler),l.addEventListener("click",this.numberListClickHandler),this.target.appendChild(e)},Fpi.prototype.createNumberListTag=function(e,t,i,n,o){this.liTag=Q("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(this.liTag);o="<div>"+t+'<span class="e-de-ui-list-line"></span></div><div>'+i+'<span class="e-de-ui-list-line">';return this.liInnerDiv=Q("div",{className:"e-de-ui-list-header-presetmenu",id:"e-de-ui-zlist0",innerHTML:o+="</span></div><div>"+n+'<span class="e-de-ui-list-line"> </span></div >'}),this.liTag.style.cssFloat="left",this.liTag.appendChild(this.liInnerDiv),this.liTag},Fpi.prototype.createNumberNoneListTag=function(e,t){this.liTag1=Q("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(this.liTag1);e='<div class="e-de-ui-bullets e-de-bullet-icons">'+t.getConstant("None")+"</div>";return this.liInnerDiv1=Q("div",{className:"e-de-ui-list-header-presetmenu",id:"e-de-ui-zlist0",innerHTML:e}),this.liTag1.style.cssFloat="left",this.liTag1.appendChild(this.liInnerDiv1),this.liTag1},Fpi.prototype.createBulletListTag=function(e,t,i,n){this.liTag2=Q("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 "+i}),e.appendChild(this.liTag2);e="e-bullet-none"===i;return this.liInnerDiv2=Q("div",{className:"e-de-ui-bullet-list-header-presetmenu e-de-bullet-icon-size",styles:e?"font-size:9px;text-align: center;top: 13px;left:-2px;line-height:normal;position: relative":""}),this.liNextDiv=Q("div",{className:e?"":t,innerHTML:e?n.getConstant("None"):""}),this.liInnerDiv2.appendChild(this.liNextDiv),this.liTag2.appendChild(this.liInnerDiv2),this.liTag2},Fpi.prototype.createBulletList=function(e,t){this.bulletListDiv=Q("div",{className:"e-de-ui-bullet-list-header-presetmenu",id:e+"_Bullet"});var e=this.bulletListDiv,t=(e.style.display="none",this.ulTag1=Q("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"}),e.appendChild(this.ulTag1),this.createBulletListTag(this.ulTag1,"e-de-icon-bullet-list-none e-de-bullet-icons","e-bullet-none",t)),i=this.createBulletListTag(this.ulTag1,"e-de-icon-bullet-list-dot e-de-bullet-icons","e-bullet-dot"),n=this.createBulletListTag(this.ulTag1,"e-de-icon-bullet-list-circle e-de-bullet-icons","e-bullet-circle"),o=this.createBulletListTag(this.ulTag1,"e-de-icon-bullet-list-square e-de-bullet-icons","e-bullet-square"),r=this.createBulletListTag(this.ulTag1,"e-de-icon-bullet-list-flower e-de-bullet-icons","e-bullet-flower"),s=this.createBulletListTag(this.ulTag1,"e-de-icon-bullet-list-arrow e-de-bullet-icons","e-bullet-arrow"),a=this.createBulletListTag(this.ulTag1,"e-de-icon-bullet-list-tick e-de-bullet-icons","e-bullet-tick");t.addEventListener("click",this.bulletListClickHandler),i.addEventListener("click",this.bulletListClickHandler),n.addEventListener("click",this.bulletListClickHandler),o.addEventListener("click",this.bulletListClickHandler),r.addEventListener("click",this.bulletListClickHandler),s.addEventListener("click",this.bulletListClickHandler),a.addEventListener("click",this.bulletListClickHandler),this.target.appendChild(e)},Fpi.prototype.showNumberBulletDialog=function(e,t){je(e)?this.listFormat=new mri:this.listFormat=e,je(this.listFormat.list)&&(this.listFormat.list=new xpi),je(t)?this.abstractList=new tsi:this.abstractList=t;e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.target||this.initNumberingBulletDialog(e),this.documentHelper.dialog.header=e.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:e.getConstant("Ok"),cssClass:"e-flat e-numbering-bullet-okay",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-numbering-bullet-cancel"}}],this.documentHelper.dialog.dataBind(),this.documentHelper.dialog.show(),this.tabObj.refresh()},Fpi.prototype.onNumberListClick=function(e){this.numberListClick(e)},Fpi.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")},Fpi.prototype.onBulletListClick=function(e){this.bulletListClick(e)},Fpi.prototype.unWireEventsAndBindings=function(){},Fpi.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[parseInt(e.toString(),10)]),e--;this.target=void 0}this.removeEvents(),this.removeElements(),this.bulletListDiv=void 0,this.numberListDiv=void 0},Fpi.prototype.removeEvents=function(){this.liTag&&this.liTag.removeEventListener("click",this.numberListClickHandler),this.liTag1&&this.liTag1.removeEventListener("click",this.numberListClickHandler),this.liTag2&&this.liTag2.removeEventListener("click",this.numberListClickHandler),this.liTag&&this.liTag.removeEventListener("click",this.bulletListClickHandler),this.liTag1&&this.liTag1.removeEventListener("click",this.bulletListClickHandler),this.liTag2&&this.liTag2.removeEventListener("click",this.bulletListClickHandler)},Fpi.prototype.removeElements=function(){this.ulTag&&(this.ulTag.remove(),this.ulTag=void 0),this.ulTag1&&(this.ulTag1.remove(),this.ulTag1=void 0),this.liTag&&(this.liTag.remove(),this.liTag=void 0),this.liTag1&&(this.liTag1.remove(),this.liTag1=void 0),this.liTag2&&(this.liTag2.remove(),this.liTag2=void 0),this.liNextDiv&&(this.liNextDiv.remove(),this.liNextDiv=void 0),this.liInnerDiv&&(this.liInnerDiv.remove(),this.liInnerDiv=void 0),this.liInnerDiv1&&(this.liInnerDiv1.remove(),this.liInnerDiv1=void 0),this.liInnerDiv2&&(this.liInnerDiv2.remove(),this.liInnerDiv2=void 0)};var Bpi=Fpi;function Fpi(e){var t=this;this.isBullet=!1,this.numberListClickHandler=this.onNumberListClick.bind(this),this.bulletListClickHandler=this.onBulletListClick.bind(this),this.numberListClick=function(e){t.isBullet=!1,t.setActiveElement(e),e.currentTarget.classList.contains("e-de-list-numbered-none")?(t.numberFormat=void 0,t.listLevelPattern=void 0):e.currentTarget.classList.contains("e-de-list-numbered-number-dot")?(t.numberFormat="%1.",t.listLevelPattern="Arabic"):e.currentTarget.classList.contains("e-de-list-numbered-number-brace")?(t.numberFormat="%1)",t.listLevelPattern="Arabic"):e.currentTarget.classList.contains("e-de-list-numbered-up-roman")?(t.numberFormat="%1.",t.listLevelPattern="UpRoman"):e.currentTarget.classList.contains("e-de-list-numbered-up-letter")?(t.numberFormat="%1.",t.listLevelPattern="UpLetter"):e.currentTarget.classList.contains("e-de-list-numbered-low-letter-brace")?(t.numberFormat="%1)",t.listLevelPattern="LowLetter"):e.currentTarget.classList.contains("e-de-numbered-low-letter-dot")?(t.numberFormat="%1.",t.listLevelPattern="LowLetter"):e.currentTarget.classList.contains("e-de-list-numbered-low-roman")&&(t.numberFormat="%1.",t.listLevelPattern="LowRoman")},this.bulletListClick=function(e){t.isBullet=!0,t.setActiveElement(e),e.currentTarget.classList.contains("e-bullet-none")?(t.symbol=void 0,t.fontFamily=void 0):e.currentTarget.classList.contains("e-bullet-dot")?(t.symbol=String.fromCharCode(61623),t.fontFamily="Symbol"):e.currentTarget.classList.contains("e-bullet-circle")?(t.symbol=String.fromCharCode(61551)+String.fromCharCode(32),t.fontFamily="Symbol"):e.currentTarget.classList.contains("e-bullet-square")?(t.symbol=String.fromCharCode(61607),t.fontFamily="Wingdings"):e.currentTarget.classList.contains("e-bullet-flower")?(t.symbol=String.fromCharCode(61558),t.fontFamily="Wingdings"):e.currentTarget.classList.contains("e-bullet-arrow")?(t.symbol=String.fromCharCode(61656),t.fontFamily="Wingdings"):e.currentTarget.classList.contains("e-bullet-tick")&&(t.symbol=String.fromCharCode(61692),t.fontFamily="Wingdings")},this.loadNumberingBulletDialog=function(){t.documentHelper.updateFocus()},this.closeNumberingBulletDialog=function(){t.unWireEventsAndBindings(),t.documentHelper.updateFocus()},this.onCancelButtonClick=function(){t.isBullet=!1,t.listLevelPattern=void 0,t.numberFormat=void 0,t.symbol=void 0,t.fontFamily=void 0,t.documentHelper.dialog.hide(),t.unWireEventsAndBindings()},this.onOkButtonClick=function(){0<t.documentHelper.owner.documentHelper.lists.length?(t.listFormat.list.listId=t.documentHelper.owner.documentHelper.lists[t.documentHelper.owner.documentHelper.lists.length-1].listId+1,t.listFormat.listId=t.listFormat.list.listId):(t.listFormat.list.listId=0,t.listFormat.listId=0),0<t.documentHelper.owner.documentHelper.abstractLists.length?t.abstractList.abstractListId=t.documentHelper.owner.documentHelper.abstractLists[t.documentHelper.owner.documentHelper.abstractLists.length-1].abstractListId+1:t.abstractList.abstractListId=0,t.listFormat.list.abstractListId=t.abstractList.abstractListId,t.listFormat.nsid=t.listFormat.list.nsid=t.abstractList.nsid;var e=new rsi(t.abstractList);e.listLevelPattern=je(t.listLevelPattern)?"Bullet":t.listLevelPattern,e.numberFormat=t.isBullet?t.symbol:t.numberFormat,"Bullet"!==e.listLevelPattern&&(e.startAt=1),e.characterFormat.fontFamily=je(t.fontFamily)?"Verdana":t.fontFamily,e.paragraphFormat.leftIndent=36,e.paragraphFormat.firstLineIndent=-18,t.abstractList.levels.push(e),t.listFormat.listLevelNumber=0,t.listFormat.list.abstractList=t.abstractList,t.documentHelper.hideDialog()},this.documentHelper=e}Object.defineProperty(Rpi.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}),Rpi.prototype.getModuleName=function(){return"FontDialog"},Rpi.prototype.createInputElement=function(e,t,i){return Q("input",{attrs:{type:e},id:t,className:i})},Rpi.prototype.initFontDialog=function(e,t){this.documentHelper.owner.containerId;this.target=Q("div",{className:"e-de-font-dlg"});var i=this.getFontDiv(e,t),i=(this.target.appendChild(i),this.getFontSizeDiv(e,t)),i=(this.target.appendChild(i),this.colorDiv=Q("div",{className:"e-de-container-row"}),this.fontColorDiv=Q("div",{className:"e-de-font-dlg-display"}),this.fontColorLabel=Q("label",{className:"e-de-font-dlg-header-font-color e-de-font-color-margin",innerHTML:e.getConstant("Font color")}),t&&this.fontColorLabel.classList.add("e-de-rtl"),this.fontColorDiv.appendChild(this.fontColorLabel),this.fontColorElement=this.createInputElement("color",this.target.id+"_ColorDiv","e-de-font-dlg-color"),this.fontColorDiv.appendChild(this.fontColorElement),this.colorDiv.appendChild(this.fontColorDiv),this.target.appendChild(this.colorDiv),this.fontEffectsDiv=Q("div"),this.fontEffectSubDiv1=Q("div"),this.effectLabel=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Effects")}),this.fontEffectSubDiv1.appendChild(this.effectLabel),this.fontEffectsDiv.appendChild(this.fontEffectSubDiv1),this.target.appendChild(this.fontEffectsDiv),this.effectsProperties=Q("div",{className:"e-de-container-row"}),this.fontEffectSubDiv2=Q("div",{className:"e-de-subcontainer-left"}),this.strikeThroughElement=this.createInputElement("checkbox",this.target.id+"_strikeThrough",""),this.fontEffectSubDiv2.appendChild(this.strikeThroughElement),this.checkBoxDiv=Q("div",{className:"e-de-font-checkbox"}),this.subScriptElement=this.createInputElement("checkbox",this.target.id+"_subScript",""),this.checkBoxDiv.appendChild(this.subScriptElement),this.fontEffectSubDiv2.appendChild(this.checkBoxDiv),this.checkBoxDiv=Q("div",{className:"e-de-font-checkbox"}),this.allCapsElement=this.createInputElement("checkbox",this.target.id+"_allCaps",""),this.checkBoxDiv.appendChild(this.allCapsElement),this.fontEffectSubDiv2.appendChild(this.checkBoxDiv),this.effectsProperties.appendChild(this.fontEffectSubDiv2),this.fontEffectSubDiv3=Q("div",{className:"e-de-subcontainer-right"}),this.superScriptElement=this.createInputElement("checkbox",this.target.id+"_superScript",""),this.fontEffectSubDiv3.appendChild(this.superScriptElement),this.checkBoxDiv=Q("div",{className:"e-de-font-checkbox"}),this.doubleStrikeThroughElement=this.createInputElement("checkbox",this.target.id+"_doubleStrikeThrough",""),this.checkBoxDiv.appendChild(this.doubleStrikeThroughElement),this.fontEffectSubDiv3.appendChild(this.checkBoxDiv),this.effectsProperties.appendChild(this.fontEffectSubDiv3),this.target.appendChild(this.effectsProperties),this.documentHelper.owner.documentEditorSettings.colorPickerSettings),n=i.columns,o=i.createPopupOnClick,r=i.cssClass,s=i.disabled,a=i.enablePersistence,l=i.inline,h=i.mode,d=i.modeSwitcher,p=i.noColor,c=i.presetColors,i=i.showButtons;this.colorPicker=new cV({change:this.fontColorUpdate,value:"#000000",enableRtl:t,locale:this.documentHelper.owner.locale,enableOpacity:!1,mode:h,modeSwitcher:d,showButtons:i,columns:n,createPopupOnClick:o,cssClass:r,disabled:s,enablePersistence:a,inline:l,noColor:p,presetColors:c}),this.colorPicker.appendTo(this.fontColorElement),this.strikethroughBox=new ib({change:this.singleStrikeUpdate,cssClass:"e-de-font-content-label",label:e.getConstant("Strikethrough"),enableRtl:t}),this.documentHelper.colorPicker=this.colorPicker,this.strikethroughBox.appendTo(this.strikeThroughElement),this.doublestrikethrough=new ib({change:this.doubleStrikeUpdate,label:e.getConstant("Double strikethrough"),enableRtl:t}),this.doublestrikethrough.appendTo(this.doubleStrikeThroughElement),this.subscript=new ib({label:e.getConstant("Subscript"),cssClass:"e-de-font-content-label-width",change:this.subscriptUpdate,enableRtl:t}),this.subscript.appendTo(this.subScriptElement),this.superscript=new ib({label:e.getConstant("Superscript"),cssClass:"e-de-font-content-label",change:this.superscriptUpdate,enableRtl:t}),this.superscript.appendTo(this.superScriptElement),this.allcaps=new ib({label:e.getConstant("All caps"),cssClass:"e-de-font-content-label-caps",change:this.allcapsUpdate,enableRtl:t}),this.allcaps.appendTo(this.allCapsElement),t&&(this.fontEffectSubDiv2.classList.add("e-de-rtl"),this.fontEffectSubDiv3.classList.add("e-de-rtl"),this.fontEffectSubDiv1.classList.remove("e-de-font-content-checkbox-label"))},Rpi.prototype.getFontSizeDiv=function(e,t){this.documentHelper.owner.containerId;this.getSizeDiv=Q("div",{className:"e-de-container-row"}),this.sizeSubDiv1=Q("div",{className:"e-de-subcontainer-left"});var i=e.getConstant("Size"),n=(this.getFontSize=Q("select",{id:this.target.id+"_fontSize"}),this.getFontSize.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>",this.sizeSubDiv1.appendChild(this.getFontSize),this.getSizeDiv.appendChild(this.sizeSubDiv1),this.sizeSubDiv2=Q("div",{className:"e-de-subcontainer-right"}),t&&this.sizeSubDiv2.classList.add("e-de-rtl"),e.getConstant("Underline style"));return this.underlineElement=Q("select",{id:this.target.id+"_underLine"}),this.underlineElement.innerHTML='<option value="None">'+e.getConstant("None")+'</option><option value="Single">________</option>',this.sizeSubDiv2.appendChild(this.underlineElement),this.getSizeDiv.appendChild(this.sizeSubDiv2),this.fontSizeText=new oU({change:this.fontSizeUpdate,allowCustom:!0,showClearButton:!1,enableRtl:t,floatLabelType:"Always",placeholder:i,htmlAttributes:{"aria-labelledby":i}}),this.fontSizeText.appendTo(this.getFontSize),this.underlineDrop=new qz({change:this.underlineUpdate,enableRtl:t,floatLabelType:"Always",placeholder:n,htmlAttributes:{"aria-labelledby":n}}),this.underlineDrop.appendTo(this.underlineElement),this.getSizeDiv},Rpi.prototype.getFontDiv=function(e,t){this.documentHelper.owner.containerId;this.fontDiv=Q("div",{className:"e-de-container-row"}),this.fontSubDiv1=Q("div",{className:"e-de-subcontainer-left"});for(var i=e.getConstant("Font"),n=(this.fontNameValues=Q("select",{id:this.target.id+"_fontName"}),this.documentHelper.owner.documentEditorSettings.fontFamilies),o=0;o<n.length;o++)this.fontNameValues.innerHTML+="<option>"+n[o]+"</option>";this.fontSubDiv1.appendChild(this.fontNameValues),this.fontDiv.appendChild(this.fontSubDiv1),this.fontSubDiv2=Q("div",{className:"e-de-subcontainer-right"}),t&&this.fontSubDiv2.classList.add("e-de-rtl");var r=e.getConstant("Font style");return this.fontStyleValues=Q("select",{id:this.target.id+"_fontStyle"}),this.fontStyleValues.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>",this.fontSubDiv2.appendChild(this.fontStyleValues),this.fontDiv.appendChild(this.fontSubDiv2),this.fontNameList=new oU({change:this.fontFamilyUpdate,enableRtl:t,floatLabelType:"Always",placeholder:i}),this.fontNameList.showClearButton=!1,this.fontNameList.appendTo(this.fontNameValues),this.fontStyleText=new qz({change:this.fontStyleUpdate,enableRtl:t,floatLabelType:"Always",placeholder:r}),this.fontStyleText.appendTo(this.fontStyleValues),this.fontDiv},Rpi.prototype.showFontDialog=function(e,t){e&&(this.characterFormat=e),this.isListDialog=t;e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.target||this.initFontDialog(e,this.documentHelper.owner.enableRtl),this.documentHelper.dialog.header=e.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:e.getConstant("Ok"),cssClass:"e-flat e-font-okay",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-font-cancel"}}],this.documentHelper.dialog.dataBind(),this.documentHelper.dialog.show()},Rpi.prototype.onCharacterFormat=function(e,t){!je(e)&&e.checkContentControlLocked(!0)||(this.documentHelper.owner.editorModule.initHistory("CharacterFormat"),e.isEmpty?(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)),this.documentHelper.updateFocus()):(this.documentHelper.owner.editorModule.setOffsetValue(this.documentHelper.selection),this.documentHelper.owner.editorModule.updateSelectionCharacterFormatting("CharacterFormat",t,!1)))},Rpi.prototype.enableCheckBoxProperty=function(e){this.strikethroughBox.checked&&this.doublestrikethrough.checked&&(this.strikethroughBox.checked=!1,this.doublestrikethrough.checked=!1,e.event.currentTarget.innerText===this.target.id+"Double strikethrough"?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.innerText===this.target.id+"Subscript"?this.subscript.checked=!0:this.superscript.checked=!0)},Rpi.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},Rpi.prototype.destroy=function(){if(this.documentHelper=void 0,this.characterFormat&&(this.characterFormat.destroy(),this.characterFormat=void 0),!je(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.removeElements(),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},Rpi.prototype.removeElements=function(){this.effectLabel&&(this.effectLabel.remove(),this.effectLabel=void 0),this.strikeThroughElement&&(this.strikeThroughElement.remove(),this.strikeThroughElement=void 0),this.superScriptElement&&(this.superScriptElement.remove(),this.superScriptElement=void 0),this.subScriptElement&&(this.subScriptElement.remove(),this.subScriptElement=void 0),this.doubleStrikeThroughElement&&(this.doubleStrikeThroughElement.remove(),this.doubleStrikeThroughElement=void 0),this.allCapsElement&&(this.allCapsElement.remove(),this.allCapsElement=void 0),this.fontEffectSubDiv1&&(this.fontEffectSubDiv1.remove(),this.fontEffectSubDiv1=void 0),this.fontDiv&&(this.fontDiv.remove(),this.fontDiv=void 0),this.colorDiv&&(this.colorDiv.remove(),this.colorDiv=void 0),this.fontColorLabel&&(this.fontColorLabel.remove(),this.fontColorLabel=void 0),this.fontColorElement&&(this.fontColorElement.remove(),this.fontColorElement=void 0),this.fontEffectsDiv&&(this.fontEffectsDiv.remove(),this.fontEffectsDiv=void 0),this.effectsProperties&&(this.effectsProperties.remove(),this.effectsProperties=void 0),this.fontEffectSubDiv2&&(this.fontEffectSubDiv2.remove(),this.fontEffectSubDiv2=void 0),this.checkBoxDiv&&(this.checkBoxDiv.remove(),this.checkBoxDiv=void 0),this.fontEffectSubDiv3&&(this.fontEffectSubDiv3.remove(),this.fontEffectSubDiv3=void 0),this.getSizeDiv&&(this.getSizeDiv.remove(),this.getSizeDiv=void 0),this.sizeSubDiv1&&(this.sizeSubDiv1.remove(),this.sizeSubDiv1=void 0),this.sizeSubDiv2&&(this.sizeSubDiv2.remove(),this.sizeSubDiv2=void 0),this.getFontSize&&(this.getFontSize.remove(),this.getFontSize=void 0),this.underlineElement&&(this.underlineElement.remove(),this.underlineElement=void 0),this.fontNameValues&&(this.fontNameValues.remove(),this.fontNameValues=void 0),this.fontSubDiv2&&(this.fontSubDiv2.remove(),this.fontSubDiv2=void 0),this.fontStyleValues&&(this.fontStyleValues.remove(),this.fontStyleValues=void 0),this.fontSubDiv1&&(this.fontSubDiv1.remove(),this.fontSubDiv1=void 0)};var Lpi=Rpi;function Rpi(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.isListDialog=!1,this.characterFormat=void 0,this.loadFontDialog=function(){var e,t;i.documentHelper.updateFocus(),e=i.characterFormat||i.documentHelper.owner.selectionModule.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),je(e.fontSize)||(i.fontSizeText.value=e.fontSize),je(e.fontColor)?i.colorPicker.value="#000000":(t=e.fontColor,i.colorPicker.value=t="empty"!==t&&"#00000000"!==t?t:"#000000"),"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,t=i.characterFormat||new Eri(void 0);je(i.bold)||(t.bold=i.bold),je(i.italic)||(t.italic=i.italic),!je(i.fontSize)&&0<i.fontSize&&(t.fontSize=i.fontSize),je(i.fontColor)||(t.fontColor=i.fontColor),je(i.baselineAlignment)||(t.baselineAlignment=i.baselineAlignment),je(i.strikethrough)||(t.strikethrough=i.strikethrough),je(i.underline)||(t.underline=i.underline),je(i.fontFamily)||(e=go.sanitize(i.fontFamily),t.fontFamily=e,t.fontFamilyAscii=e,t.fontFamilyFarEast=e,t.fontFamilyNonFarEast=e,t.fontFamilyBidi=e),je(i.allCaps)||(t.allCaps=i.allCaps),i.characterFormat?i.isListDialog?i.documentHelper.owner.listDialogModule.updateCharacterFormat(t):i.documentHelper.owner.styleDialogModule.updateCharacterFormat():i.onCharacterFormat(i.documentHelper.selection,t),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){je(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}Object.defineProperty(Npi.prototype,"cellFormat",{get:function(){return je(this.cellFormatIn)?this.cellFormatIn=new $ri:this.cellFormatIn},set:function(e){this.cellFormatIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(Npi.prototype,"tableFormat",{get:function(){return je(this.tableFormatIn)&&(this.tableFormatIn=new Jri),this.tableFormatIn},set:function(e){this.tableFormatIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(Npi.prototype,"paraFormat",{get:function(){return je(this.tableFormatIn)&&(this.paraFormatIn=new bri),this.paraFormatIn},set:function(e){this.paraFormatIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(Npi.prototype,"rowFormat",{get:function(){return je(this.rowFormatInternal)&&(this.rowFormatInternal=new Cri),this.rowFormatInternal},enumerable:!0,configurable:!0}),Npi.prototype.getModuleName=function(){return"TablePropertiesDialog"},Npi.prototype.initTablePropertyDialog=function(e,t){this.localValue=e;for(var i=this.documentHelper.owner.containerId+"_TablePropertiesDialog",i=(this.target=Q("div",{id:i,className:"e-de-table-properties-dlg"}),Q("div",{id:this.target.id+"_TabContainer"})),n=(this.target.appendChild(i),this.tableTab=Q("div",{id:this.target.id+"_TablePropertiesContentDialogTab",className:"e-de-table-ppty-dlg-tabs"}),this.rowTab=Q("div",{id:this.target.id+"_RowPropertiesDialogTab",className:"e-de-table-ppty-dlg-tabs"}),this.cellTab=Q("div",{id:this.target.id+"_CellPropertiesDialogTab",className:"e-de-table-ppty-dlg-tabs"}),this.altTab=Q("div",{id:this.target.id+"_AltPropertiesDialogTab",className:"e-de-table-ppty-dlg-tabs"}),Q("div",{className:"e-de-table-dialog-separator-line"})),o=Q("div",{id:this.target.id+"_TablePropertiesDialogTab",className:"e-de-table-ppty-tab"}),r=Q("div",{className:"e-tab-header"}),s=Q("div",{id:this.target.id+"_tableHeader",innerHTML:e.getConstant("Table")}),a=Q("div",{id:this.target.id+"_rowHeader",innerHTML:e.getConstant("Row")}),l=Q("div",{id:this.target.id+"_cellHeader",innerHTML:e.getConstant("Cell")}),h=Q("div",{id:this.target.id+"_altHeader",innerHTML:e.getConstant("Alt Text")}),r=(r.appendChild(s),r.appendChild(a),r.appendChild(l),r.appendChild(h),Q("div",{id:this.target.id+"_tableContent"})),d=Q("div",{id:this.target.id+"_rowContent"}),p=Q("div",{id:this.target.id+"_cellContent"}),c=Q("div",{id:this.target.id+"_altContent"}),s=[{header:{text:s},content:r},{header:{text:a},content:d},{header:{text:l},content:p},{header:{text:h},content:c}],u=(r.appendChild(this.tableTab),d.appendChild(this.rowTab),p.appendChild(this.cellTab),c.appendChild(this.altTab),i.appendChild(o),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.initTableAltProperties(this.altTab,e,this.documentHelper.owner.enableRtl),this.tabObj=new k5({items:s,enableRtl:t},o),this.tabObj.isStringTemplate=!0,this.target.appendChild(n),this.tableTab.getElementsByClassName(this.tableTab.id+"e-de-table-alignment")),g=0;g<u.length;g++)u[parseInt(g.toString(),10)].addEventListener("click",this.changeTableAlignment);for(var m=this.cellTab.getElementsByClassName(this.cellTab.id+"e-de-table-cell-alignment"),g=0;g<m.length;g++)m[parseInt(g.toString(),10)].addEventListener("click",this.changeCellAlignment)},Npi.prototype.show=function(){var e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),e=(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.animationSettings={effect:"None",duration:400,delay:0},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(),this.documentHelper.dialog2.element);e&&this.documentHelper.updateDialogTabHeight(e,this.target)},Npi.prototype.isEqualTableFormat=function(e,t){return!(t.hasValue("preferredWidth")&&e.preferredWidth!==t.preferredWidth||t.hasValue("preferredWidthType")&&e.preferredWidthType!==t.preferredWidthType||t.hasValue("tableAlignment")&&e.tableAlignment!==t.tableAlignment||t.hasValue("leftIndent")&&e.leftIndent!==t.leftIndent||t.hasValue("bidi")&&e.bidi!==t.bidi||(je(e.title)?""!==t.title:e.title!==t.title)||(je(e.description)?""!==t.description:e.description!==t.description))},Npi.prototype.isEqualRowFormat=function(e,t){return!(t.hasValue("height")&&e.height!==t.height||t.hasValue("heightType")&&e.heightType!==t.heightType||t.hasValue("allowBreakAcrossPages")&&e.allowBreakAcrossPages!==t.allowBreakAcrossPages||t.hasValue("isHeader")&&e.isHeader!==t.isHeader)},Npi.prototype.isEqualCellFormat=function(e,t){return!(t.hasValue("preferredWidth")&&e.preferredWidth!==t.preferredWidth||t.hasValue("preferredWidthType")&&e.preferredWidthType!==t.preferredWidthType||t.hasValue("verticalAlignment")&&e.verticalAlignment!==t.verticalAlignment)},Npi.prototype.calculateGridValue=function(e){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);e=this.documentHelper.owner.editorHistoryModule;e&&e.currentBaseHistoryInfo&&(0<e.currentBaseHistoryInfo.modifiedProperties.length&&e.currentBaseHistoryInfo.updateSelection(),e.updateHistory()),this.documentHelper.owner.editorModule.fireContentChange()},Npi.prototype.loadTableProperties=function(){this.setTableProperties(),this.setTableRowProperties(),this.setTableCellProperties(),this.setTableAltProperties(),this.documentHelper.owner.bordersAndShadingDialogModule?this.bordersAndShadingButton.disabled=!1:this.bordersAndShadingButton.disabled=!0,this.tableOptionButton.disabled=!1,this.cellOptionButton.disabled=!1},Npi.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)},Npi.prototype.initTableProperties=function(e,t,i){var n=Q("div",{className:"e-de-table-dialog-size-label"}),o=Q("div",{innerHTML:t.getConstant("Size"),className:"e-de-para-dlg-heading"}),r=Q("div",{className:"e-de-table-ppty-options-break"}),s=Q("input",{attrs:{type:"checkbox"}}),a=Q("div",{className:"e-de-container-row"}),l=Q("div",{className:"e-de-subcontainer-left e-de-table-dialog-row-height"}),h=(this.preferredWidth=Q("input"),Q("div",{className:"e-de-subcontainer-right"})),d=Q("select",{innerHTML:'<option value="Points">'+t.getConstant("Points")+'</option><option value="Percent">'+t.getConstant("Percent")+"</option>"}),p=Q("div",{className:"e-de-dlg-row"}),c=Q("div",{className:"e-de-subcontainer-left"}),u=Q("div",{innerHTML:t.getConstant("Alignment"),className:"e-de-table-dlg-alignment-heading"}),g=Q("div",{className:"e-de-container-row"}),m=e.id+"e-de-table-alignment e-de-table-dialog-alignment-icon",f=Q("div"),y=Q("div",{className:"e-de-table-dia-align-div"}),v=(this.left=Q("div",{className:"e-icons e-de-table-properties-alignment e-de-table-left-alignment "+m,id:e.id+"_left_alignment"}),y.appendChild(this.left),y.setAttribute("aria-label",t.getConstant("Left")),Q("div",{className:"e-de-table-dia-align-div"})),m=(this.center=Q("div",{className:"e-icons e-de-table-properties-alignment  e-de-table-center-alignment "+m,id:e.id+"_center_alignment"}),v.appendChild(this.center),v.setAttribute("aria-label",t.getConstant("Center")),this.right=Q("div",{className:"e-icons e-de-table-properties-alignment  e-de-table-right-alignment "+m,id:e.id+"_right_alignment"}),Q("div",{className:"e-de-table-dia-align-div"})),b=(m.appendChild(this.right),m.setAttribute("aria-label",t.getConstant("Right")),Q("label",{innerHTML:t.getConstant("Left"),className:"e-de-table-dia-align-label"})),w=Q("label",{innerHTML:t.getConstant("Center"),className:"e-de-table-dia-align-label"}),C=Q("label",{innerHTML:t.getConstant("Right"),className:"e-de-table-dia-align-label"}),S=Q("div",{className:"e-de-subcontainer-right"}),A=(this.leftIndent=Q("input"),Q("div",{innerHTML:t.getConstant("Table direction"),className:"e-de-para-dlg-heading"})),x=Q("div",{className:"e-de-dlg-row"}),I=Q("div",{className:"e-de-tbl-rtl-btn-div"}),T=Q("input"),E=(I.appendChild(T),x.appendChild(I),Q("div",{className:"e-de-tbl-ltr-btn-div"})),D=Q("input"),E=(E.appendChild(D),x.appendChild(E),this.rtlButton=new cb({label:t.getConstant("Right-to-left"),value:"rtl",cssClass:"e-small",change:this.changeBidirectional,enableRtl:i}),this.rtlButton.appendTo(T),T.setAttribute("aria-label",t.getConstant("Right-to-left")),this.ltrButton=new cb({label:t.getConstant("Left-to-right"),value:"ltr",cssClass:"e-small",change:this.changeBidirectional,enableRtl:i}),this.ltrButton.appendTo(D),D.setAttribute("aria-label",t.getConstant("Left-to-right")),Q("div",{className:"e-de-tbl-dlg-border-btn"}));this.bordersAndShadingButton=Q("button",{innerHTML:t.getConstant("Borders and Shading")+"...",className:"e-control e-btn e-de-ok-button",attrs:{type:"button"}}),this.tableOptionButton=Q("button",{className:"e-control e-btn",innerHTML:t.getConstant("Options")+"...",attrs:{type:"button"}}),this.tableOptionButton.addEventListener("click",this.showTableOptionsDialog),this.bordersAndShadingButton.addEventListener("click",this.showBordersShadingsPropertiesDialog),E.appendChild(this.bordersAndShadingButton),E.appendChild(this.tableOptionButton),S.appendChild(this.leftIndent),g.appendChild(f),c.appendChild(u),f.appendChild(y),c.appendChild(g),g.appendChild(v),g.appendChild(m),y.appendChild(b),v.appendChild(w),m.appendChild(C),p.appendChild(c),n.appendChild(o),e.appendChild(n),r.appendChild(s),n.appendChild(r),l.appendChild(this.preferredWidth),n.appendChild(a),h.appendChild(d),p.appendChild(S),a.appendChild(l),a.appendChild(h),e.appendChild(p),e.appendChild(A),e.appendChild(x),e.appendChild(E),this.tableWidthBox=new NL({value:0,decimals:2,min:0,max:1584,enablePersistence:!1}),this.tableWidthBox.appendTo(this.preferredWidth),this.leftIndentBox=new NL({value:0,decimals:2,min:-1584,max:1584,enablePersistence:!1,floatLabelType:"Always",placeholder:t.getConstant("Indent from left")}),this.leftIndentBox.appendTo(this.leftIndent),this.preferCheckBox=new ib({label:t.getConstant("Preferred Width"),enableRtl:i}),this.preferCheckBox.appendTo(s),s.setAttribute("aria-label",t.getConstant("Preferred Width")),this.leftIndent.setAttribute("aria-labelledby",t.getConstant("Indent from left")),this.tableWidthType=new qz({enableRtl:i,floatLabelType:"Always",placeholder:t.getConstant("Measure in"),htmlAttributes:{"aria-labelledby":t.getConstant("Measure in")}}),this.tableWidthType.appendTo(d),i&&(I.classList.add("e-de-rtl"),S.classList.add("e-de-rtl"),E.classList.add("e-de-rtl"),y.classList.add("e-de-rtl"),v.classList.add("e-de-rtl"),m.classList.add("e-de-rtl"))},Npi.prototype.onTableWidthChange=function(){this.tableFormat.preferredWidth=this.tableWidthBox.value},Npi.prototype.onTableWidthTypeChange=function(){var e,t=Y.convertPixelToPoint(this.documentHelper.owner.viewer.clientArea.width);"Percent"===this.tableWidthType.value&&"Percent"!==this.documentHelper.selection.tableFormat.preferredWidthType?(e=this.tableWidthBox.value/t*100,this.formatNumericTextBox(this.tableWidthBox,"Percent",e)):"Points"===this.tableWidthType.value&&"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.value?t/100*this.tableWidthBox.value:this.tableWidthBox.value:"Percent"===this.tableWidthType.value?this.tableWidthBox.value/t*100:this.tableWidthBox.value,this.formatNumericTextBox(this.tableWidthBox,"Points"===this.tableWidthType.value?"Point":this.tableWidthType.value,e)),this.tableFormat.preferredWidthType="Points"===this.tableWidthType.value?"Point":this.tableWidthType.value},Npi.prototype.onLeftIndentChange=function(){this.tableFormat.leftIndent=this.leftIndentBox.value},Npi.prototype.setTableAltProperties=function(){var e=this.documentHelper.selection.tableFormat;je(e.title)?this.titleTextBox.value="":this.titleTextBox.value=e.title,je(e.description)?this.descriptionTextBox.value="":this.descriptionTextBox.value=e.description},Npi.prototype.setTableProperties=function(){var e=this.documentHelper.selection.tableFormat,t=0<e.preferredWidth,i=e.preferredWidth;je(e.preferredWidth)?(this.preferCheckBox.indeterminate=!0,i=this.documentHelper.selection.start.paragraph.associatedCell.ownerTable.combineWidget(this.documentHelper.owner.viewer).tableFormat.preferredWidth):this.preferCheckBox.checked=t,this.tableWidthBox.enabled=t,this.tableWidthType.enabled=t,this.formatNumericTextBox(this.tableWidthBox,e.preferredWidthType,i),"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)},Npi.prototype.activeTableAlignment=function(e,t){t=t?this.tableFormat.tableAlignment:void 0;je(t)&&(e.bidi?"Left"===e.tableAlignment?t="Right":"Right"===e.tableAlignment&&(t="Left"):t=e.tableAlignment),e.bidi?(this.leftIndentBox.enabled="Right"===t,this.leftIndentBox.placeholder=this.localValue.getConstant("Indent from right")):(this.leftIndentBox.enabled="Left"===t,this.leftIndentBox.placeholder=this.localValue.getConstant("Indent from left")),this.leftIndentBox.value=e.leftIndent,mt(this.left,[],["e-de-table-alignment-active"]),mt(this.right,[],["e-de-table-alignment-active"]),mt(this.center,[],["e-de-table-alignment-active"]),"Left"===t?mt(this.left,["e-de-table-alignment-active"],["e-de-table-properties-alignment"]):"Center"===t?mt(this.center,["e-de-table-alignment-active"],["e-de-table-properties-alignment"]):"Right"===t&&mt(this.right,["e-de-table-alignment-active"],["e-de-table-properties-alignment"])},Npi.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[parseInt(i.toString(),10)].classList.contains("e-de-table-alignment-active"))return 0===i?this.ltrButton.checked?"Left":"Right":1===i?"Center":this.ltrButton.checked?"Right":"Left"},Npi.prototype.updateClassForAlignmentProperties=function(e){for(var t=e.id,i=e.getElementsByClassName(t+"e-de-table-alignment"),n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)];o.classList.contains("e-de-table-alignment-active")&&mt(o,["e-de-table-properties-alignment"],["e-de-table-alignment-active"])}},Npi.prototype.initTableRowProperties=function(e,t,i){var n=Q("div",{className:"e-de-table-dialog-size-label"}),o=Q("div",{innerHTML:t.getConstant("Size"),className:"e-de-para-dlg-heading"}),r=Q("div",{className:"e-de-table-ppty-options-break"}),s=Q("input",{attrs:{type:"checkbox"}}),a=Q("div",{className:"e-de-container-row"}),l=Q("div",{className:"e-de-subcontainer-left e-de-table-dialog-row-height"}),h=(this.rowHeight=Q("input",{attrs:{type:"text"}}),Q("div",{className:"e-de-subcontainer-right"})),d=Q("select",{innerHTML:'<option value="AtLeast">'+t.getConstant("At least")+'</option><option value="Exactly">'+t.getConstant("Exactly")+"</option>"}),o=(n.appendChild(o),e.appendChild(n),r.appendChild(s),n.appendChild(r),a.appendChild(l),n.appendChild(a),l.appendChild(this.rowHeight),h.appendChild(d),a.appendChild(h),Q("div",{innerHTML:t.getConstant("Options")+"...",className:"e-de-para-dlg-heading"})),r=Q("div",{className:"e-de-table-ppty-options-break"}),n=Q("div",{className:"e-de-table-ppty-options-header-row"}),l=Q("input",{attrs:{type:"checkbox"}}),a=Q("input",{attrs:{type:"checkbox"}});r.appendChild(l),n.appendChild(a),e.appendChild(o),e.appendChild(r),e.appendChild(n),this.rowHeightBox=new NL({value:0,decimals:2,min:0,max:1584,enablePersistence:!1}),this.rowHeightBox.appendTo(this.rowHeight),this.rowHeightCheckBox=new ib({label:t.getConstant("Specify height"),enableRtl:i}),this.rowHeightCheckBox.appendTo(s),s.setAttribute("aria-label",t.getConstant("Specify height")),this.rowHeightType=new qz({enableRtl:i,floatLabelType:"Always",placeholder:t.getConstant("Row height is"),htmlAttributes:{"aria-labelledby":t.getConstant("Row height is")}}),this.rowHeightType.appendTo(d),this.allowRowBreak=new ib({label:t.getConstant("Allow row to break across pages"),enableRtl:i}),this.allowRowBreak.appendTo(l),l.setAttribute("aria-label",t.getConstant("Allow row to break across pages")),this.repeatHeader=new ib({label:t.getConstant("Repeat as header row at the top of each page"),enableRtl:i}),this.repeatHeader.appendTo(a),a.setAttribute("aria-label",t.getConstant("Repeat as header row at the top of each page"))},Npi.prototype.setTableRowProperties=function(){var e=this.documentHelper.selection.rowFormat,t=0<e.height||"Exactly"===e.heightType,t=(t?this.rowHeightCheckBox.checked=!0:void 0===e.heightType?t=this.rowHeightCheckBox.indeterminate=!0:this.rowHeightCheckBox.checked=!1,this.rowHeightBox.enabled=t,this.rowHeightType.enabled=t,!this.enableRepeatHeader());je(this.documentHelper.selection.rowFormat.isHeader)?(this.repeatHeader.indeterminate=!0,this.repeatHeader.disabled=!0):(this.documentHelper.selection.rowFormat.isHeader?(this.repeatHeader.checked=!t,this.repeatHeader.indeterminate=t):(this.repeatHeader.checked=!1,this.repeatHeader.indeterminate=!1),this.repeatHeader.disabled=t),je(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},Npi.prototype.onRowHeightChange=function(){this.rowHeightValue=this.rowHeightBox.value},Npi.prototype.onRowHeightTypeChange=function(){this.rowFormat.heightType=this.rowHeightType.text},Npi.prototype.onAllowBreakAcrossPage=function(){this.rowFormat.allowBreakAcrossPages=this.allowRowBreak.checked},Npi.prototype.onRepeatHeader=function(){this.rowFormat.isHeader=this.repeatHeader.checked},Npi.prototype.enableRepeatHeader=function(){var e=this.documentHelper.selection,t=e.start,i=e.end,e=(e.isForward||(t=e.end,i=e.start),t.paragraph.associatedCell),t=i.paragraph.associatedCell;return 0===e.ownerRow.index&&t.ownerTable.equals(e.ownerTable)},Npi.prototype.initTableAltProperties=function(e,t,i){var n=Q("div",{className:"e-de-table-dialog-size-label"}),e=(e.appendChild(n),Q("div",{innerHTML:t.getConstant("Title"),className:"e-de-para-dlg-heading"})),e=(n.appendChild(e),Q("div",{className:"e-de-table-ppty-options-break"})),o=Q("input",{}),e=(this.titleTextBox=new fV({floatLabelType:"Never"}),n.appendChild(e),e.appendChild(o),this.titleTextBox.appendTo(o),Q("div",{innerHTML:t.getConstant("Description"),className:"e-de-para-dlg-heading"})),o=(n.appendChild(e),Q("div",{className:"e-de-table-ppty-options-break"})),t=Q("textarea",{});this.descriptionTextBox=new fV({floatLabelType:"Never"}),o.appendChild(t),this.descriptionTextBox.appendTo(t),n.appendChild(o)},Npi.prototype.initTableCellProperties=function(e,t,i){var n=Q("div",{className:"e-de-table-dialog-size-label"}),o=Q("div",{innerHTML:t.getConstant("Size"),className:"e-de-para-dlg-heading"}),r=Q("div",{className:"e-de-table-ppty-options-break"}),s=Q("input",{attrs:{type:"checkbox"}}),a=Q("div",{className:"e-de-container-row"}),l=Q("div",{className:"e-de-subcontainer-left e-de-table-dialog-row-height"}),h=(this.preferredCellWidth=Q("input",{attrs:{type:"text"}}),Q("div",{className:"e-de-subcontainer-right"})),d=Q("select",{innerHTML:'<option value="Points">'+t.getConstant("Points")+'</option><option value="Percent">'+t.getConstant("Percent")+"</option>"}),o=(n.appendChild(o),e.appendChild(n),r.appendChild(s),s.setAttribute("aria-label",t.getConstant("Preferred Width")),n.appendChild(r),l.appendChild(this.preferredCellWidth),n.appendChild(a),a.appendChild(l),a.appendChild(h),h.appendChild(d),Q("div",{innerHTML:t.getConstant("Vertical alignment"),className:"e-de-para-dlg-heading"})),r=e.id+"e-de-table-cell-alignment e-de-tablecell-dialog-alignment-icon",n=Q("div",{className:"e-de-container-row"}),l=Q("div"),a=Q("div",{className:"e-de-tablecell-dia-align-div"}),h=(this.cellTopAlign=Q("div",{id:e.id+"_cell_top-alignment",className:"e-icons e-de-tablecell-alignment  e-de-tablecell-top-alignment "+r}),a.appendChild(this.cellTopAlign),a.setAttribute("aria-label",t.getConstant("Top")),Q("div",{className:"e-de-tablecell-dia-align-div"})),p=(this.cellCenterAlign=Q("div",{id:e.id+"_cell_center-alignment",className:"e-icons e-de-tablecell-alignment  e-de-tablecell-center-alignment "+r}),h.appendChild(this.cellCenterAlign),h.setAttribute("aria-label",t.getConstant("Center")),Q("div",{className:"e-de-tablecell-dia-align-div"})),r=(this.cellBottomAlign=Q("div",{id:e.id+"_cell_bottom-alignment",className:"e-icons e-de-tablecell-alignment e-de-tablecell-bottom-alignment  "+r}),p.appendChild(this.cellBottomAlign),p.setAttribute("aria-label",t.getConstant("Bottom")),Q("label",{innerHTML:t.getConstant("Top"),className:"e-de-table-dia-align-label"})),c=Q("label",{innerHTML:t.getConstant("Center"),className:"e-de-table-dia-align-label"}),u=Q("label",{innerHTML:t.getConstant("Bottom"),className:"e-de-table-dia-align-label"});this.cellOptionButton=Q("button",{innerHTML:t.getConstant("Options")+"...",className:"e-control e-btn",attrs:{type:"button"}}),this.cellOptionButton.style.cssFloat=i?"left":"right",n.appendChild(l),l.appendChild(a),n.appendChild(h),n.appendChild(p),a.appendChild(r),h.appendChild(c),p.appendChild(u),e.appendChild(o),e.appendChild(n),e.appendChild(this.cellOptionButton),this.cellOptionButton.addEventListener("click",this.showCellOptionsDialog),this.cellWidthBox=new NL({value:0,decimals:2,min:0,max:1584,enablePersistence:!1}),this.cellWidthBox.appendTo(this.preferredCellWidth),this.preferredCellWidthCheckBox=new ib({label:t.getConstant("Preferred Width"),enableRtl:i}),this.preferredCellWidthCheckBox.appendTo(s),s.setAttribute("aria-label",t.getConstant("Preferred Width")),this.cellWidthType=new qz({enableRtl:i,floatLabelType:"Always",placeholder:t.getConstant("Measure in"),htmlAttributes:{"aria-labelledby":t.getConstant("Measure in")}}),this.cellWidthType.appendTo(d)},Npi.prototype.setTableCellProperties=function(){var e=this.documentHelper.selection.cellFormat,t=(this.hasCellWidth=0<e.preferredWidth,e.preferredWidth);je(e.preferredWidth)?(this.preferredCellWidthCheckBox.indeterminate=!0,t=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,t),mt(this.cellTopAlign,["e-de-tablecell-alignment"],["e-de-table-alignment-active"]),mt(this.cellCenterAlign,["e-de-tablecell-alignment"],["e-de-table-alignment-active"]),mt(this.cellBottomAlign,["e-de-tablecell-alignment"],["e-de-table-alignment-active"]),"Top"===e.verticalAlignment?mt(this.cellTopAlign,["e-de-table-alignment-active"],["e-de-tablecell-alignment"]):"Center"===e.verticalAlignment?mt(this.cellCenterAlign,["e-de-table-alignment-active"],["e-de-tablecell-alignment"]):"Bottom"===e.verticalAlignment&&mt(this.cellBottomAlign,["e-de-table-alignment-active"],["e-de-tablecell-alignment"])},Npi.prototype.updateClassForCellAlignment=function(e){for(var t=e.getElementsByClassName(e.id+"e-de-table-cell-alignment"),i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];n.classList.contains("e-de-table-alignment-active")&&mt(n,["e-de-tablecell-alignment"],["e-de-table-alignment-active"])}},Npi.prototype.formatNumericTextBox=function(e,t,i){e.format="Auto"===t||"Point"===t?"n2":"#'%'",e.step=1,e.decimals=2,e.value=i,e.htmlAttributes={"aria-label":"cellWidth"}},Npi.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[parseInt(i.toString(),10)].classList.contains("e-de-table-alignment-active"))return 0===i?"Top":1===i?"Center":"Bottom";return this.documentHelper.selection.cellFormat.verticalAlignment},Npi.prototype.onCellWidthChange=function(){this.cellFormat.preferredWidth=this.cellWidthBox.value},Npi.prototype.onCellWidthTypeChange=function(){var e,t=this.documentHelper.selection.start.paragraph.associatedCell.ownerTable,i=t.getOwnerWidth(!0),t=t.getTableClientWidth(i);"Percent"===this.cellWidthType.value&&"Percent"!==this.documentHelper.selection.cellFormat.preferredWidthType?(e=this.cellWidthBox.value/t*100,this.formatNumericTextBox(this.cellWidthBox,"Percent",e)):"Points"===this.cellWidthType.value&&"Point"!==this.documentHelper.selection.cellFormat.preferredWidthType?(e=t/100*this.cellWidthBox.value,this.formatNumericTextBox(this.cellWidthBox,"Point",e)):(e="#'%'"===this.cellWidthBox.format?"Points"===this.cellWidthType.value?t/100*this.cellWidthBox.value:this.cellWidthBox.value:"Percent"===this.cellWidthType.value?this.cellWidthBox.value/t*100:this.cellWidthBox.value,this.formatNumericTextBox(this.cellWidthBox,"Points"===this.cellWidthType.value?"Point":this.cellWidthType.value,e)),this.cellFormat.preferredWidthType="Points"===this.cellWidthType.value?"Point":this.cellWidthType.value},Npi.prototype.destroy=function(){if(!je(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[parseInt(e.toString(),10)]),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.titleTextBox=void 0,this.descriptionTextBox=void 0,this.altTab=void 0,this.paraFormatIn&&(this.paraFormatIn.destroy(),this.paraFormatIn=void 0),this.tableFormatIn&&this.tableFormatIn.destroy(),this.cellFormatIn&&this.cellFormatIn.destroy(),this.tableFormatIn=void 0,this.cellFormatIn=void 0};var Opi=Npi;function Npi(e){var l=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(){l.documentHelper.updateFocus(),l.loadTableProperties()},this.onCloseTablePropertyDialog=function(){l.unWireEvent.bind(l),l.documentHelper.updateFocus()},this.applyTableProperties=function(){var e=l.documentHelper.selection;if(e.tableFormat.title===l.titleTextBox.value||je(l.titleTextBox.value)||(l.tableFormat.title=go.sanitize(l.titleTextBox.value)),e.tableFormat.description===l.descriptionTextBox.value||je(l.descriptionTextBox.value)||(l.tableFormat.description=go.sanitize(l.descriptionTextBox.value)),l.preferCheckBox.checked||l.preferCheckBox.indeterminate||!je(e.tableFormat.preferredWidth)&&0===e.tableFormat.preferredWidth||(l.tableFormat.preferredWidth=0,l.tableFormat.preferredWidthType="Point"),!l.tableFormat.hasValue("tableAlignment")||"Left"===l.tableFormat.tableAlignment||!je(e.tableFormat.leftIndent)&&0===e.tableFormat.leftIndent||(l.tableFormat.leftIndent=0),l.rowHeightCheckBox.checked||l.rowHeightCheckBox.indeterminate||!je(e.rowFormat.height)&&0===e.rowFormat.height||(l.rowFormat.heightType="AtLeast",l.rowFormat.height=0),l.preferredCellWidthCheckBox.checked||l.preferredCellWidthCheckBox.indeterminate){for(var t=l.documentHelper.selection.start.paragraph.associatedCell.ownerTable,i=t.getOwnerWidth(!0),n=t.getTableClientWidth(i),o=0;o<t.childWidgets.length;o++)for(var r=t.childWidgets[parseInt(o.toString(),10)],s=0;s<r.childWidgets.length;s++){var a=r.childWidgets[parseInt(s.toString(),10)];"Percent"===l.cellFormat.preferredWidthType&&"Point"===a.cellFormat.preferredWidthType?(a.cellFormat.preferredWidthType="Percent",a.cellFormat.preferredWidth=a.cellFormat.preferredWidth/n*100):"Point"===l.cellFormat.preferredWidthType&&"Percent"===a.cellFormat.preferredWidthType&&(a.cellFormat.preferredWidthType="Point",a.cellFormat.preferredWidth=a.cellFormat.cellWidth)}"Percent"!==l.cellFormat.preferredWidthType||l.tableFormat.hasValue("preferredWidth")||l.tableFormat.hasValue("preferredWidthType")||0!==l.documentHelper.selection.start.paragraph.associatedCell.ownerTable.tableFormat.preferredWidth||(i=l.documentHelper.selection.start.paragraph.associatedCell.ownerTable.getOwnerWidth(!0),i=l.documentHelper.selection.start.paragraph.associatedCell.ownerTable.getTableClientWidth(i),l.tableFormat.preferredWidthType="Percent",l.tableFormat.preferredWidth=i/Y.convertPixelToPoint(l.documentHelper.owner.viewer.clientArea.width)*100)}else!je(e.cellFormat.preferredWidth)&&0===e.cellFormat.preferredWidth||(l.cellFormat.preferredWidthType="Point",l.cellFormat.preferredWidth=0);l.rowHeightValue&&(l.rowFormat.hasValue("heightType")||e.rowFormat.heightType===l.rowFormat.heightType||(l.rowFormat.heightType=e.rowFormat.heightType),l.rowFormat.height=l.rowHeightValue),l.isEqualTableFormat(e.tableFormat,l.tableFormat)&&l.isEqualRowFormat(e.rowFormat,l.rowFormat)&&l.isEqualCellFormat(e.cellFormat,l.cellFormat)||(l.documentHelper.owner.editorModule.initComplexHistory("TableProperties"),l.documentHelper.owner.editorModule.onTableFormat(l.tableFormat),l.documentHelper.owner.editorModule.onRowFormat(l.rowFormat),l.documentHelper.owner.editorModule.onCellFormat(l.cellFormat),l.documentHelper.owner.editorHistoryModule.updateComplexHistory()),l.closeTablePropertiesDialog(),l.documentHelper.updateFocus()},this.applyTableSubProperties=function(){var e;l.isCellOptionsUpdated&&(e=l.documentHelper.owner.cellOptionsDialogModule.cellFormat,l.documentHelper.owner.cellOptionsDialogModule.applySubCellOptions(e)),l.isTableOptionsUpdated&&(e=l.documentHelper.owner.tableOptionsDialogModule.tableFormat,l.documentHelper.owner.tableOptionsDialogModule.applySubTableOptions(e)),l.isCellOptionsUpdated=!1,l.isTableOptionsUpdated=!1},this.unWireEvent=function(){l.preferCheckBox.change=void 0,l.tableWidthBox.change=void 0,l.tableWidthType.change=void 0,l.leftIndentBox.change=void 0,l.rowHeightCheckBox.change=void 0,l.rowHeightBox.change=void 0,l.rowHeightType.change=void 0,l.repeatHeader.change=void 0,l.allowRowBreak.change=void 0,l.preferredCellWidthCheckBox.change=void 0,l.cellWidthBox.change=void 0,l.cellWidthType.change=void 0,l.cellFormat.destroy(),l.rowFormat.destroy(),l.tableFormat.destroy(),l.rowHeightValue=void 0,l.documentHelper.dialog2.open=l.documentHelper.selection.hideCaret.bind(l.documentHelper.owner.viewer)},this.closeTablePropertiesDialog=function(){l.documentHelper.dialog2.hide(),l.documentHelper.updateFocus()},this.changeBidirectional=function(e){"ltr"===e.value?(l.rtlButton.checked=!l.ltrButton.checked,l.tableFormat.bidi=!1):(l.ltrButton.checked=!l.rtlButton.checked,l.tableFormat.bidi=!0),l.tableFormat.bidi&&"Left"===l.tableFormat.tableAlignment?l.tableFormat.tableAlignment="Right":l.tableFormat.bidi||"Right"!==l.tableFormat.tableAlignment||(l.tableFormat.tableAlignment="Left"),l.activeTableAlignment(l.tableFormat,!0)},this.changeTableCheckBox=function(){var e=l.preferCheckBox.checked||l.preferCheckBox.indeterminate;l.tableWidthBox.enabled=e,l.tableWidthType.enabled=e,l.tableFormat.preferredWidthType=e?"Points"===l.tableWidthType.value?"Point":l.tableWidthType.value:l.documentHelper.selection.tableFormat.preferredWidthType},this.changeTableAlignment=function(e){l.updateClassForAlignmentProperties(l.tableTab);var e=e.target,t=(mt(e,["e-de-table-alignment-active"],["e-de-table-properties-alignment"]),l.tableFormat.bidi||l.rtlButton.checked);e.classList.contains("e-de-table-left-alignment")&&!t||e.classList.contains("e-de-table-right-alignment")&&t?l.leftIndentBox.enabled=!0:l.leftIndentBox.enabled=!1,l.tableFormat.tableAlignment=l.getTableAlignment()},this.changeTableRowCheckBox=function(){l.rowHeightType.enabled=l.rowHeightCheckBox.checked,l.rowHeightBox.enabled=l.rowHeightCheckBox.checked,l.rowHeightType.enabled?l.rowFormat.heightType=l.rowHeightType.value:l.rowFormat.heightType=l.documentHelper.selection.rowFormat.heightType},this.changeTableCellCheckBox=function(){l.cellWidthType.enabled=l.preferredCellWidthCheckBox.checked,l.cellWidthBox.enabled=l.preferredCellWidthCheckBox.checked},this.changeCellAlignment=function(e){l.updateClassForCellAlignment(l.cellTab),mt(e.target,["e-de-table-alignment-active"],["e-de-tablecell-alignment"]),l.cellFormat.verticalAlignment=l.getCellAlignment()},this.showTableOptionsDialog=function(){l.documentHelper.owner.tableOptionsDialogModule.show(),l.documentHelper.dialog2.element.style.pointerEvents="none"},this.showBordersShadingsPropertiesDialog=function(){l.documentHelper.owner.bordersAndShadingDialogModule.show(),l.documentHelper.dialog2.element.style.pointerEvents="none"},this.showCellOptionsDialog=function(){l.documentHelper.owner.cellOptionsDialogModule.show(),l.documentHelper.dialog2.element.style.pointerEvents="none"},this.documentHelper=e}_pi.prototype.getModuleName=function(){return"BordersAndShadingDialog"},_pi.prototype.initBordersAndShadingsDialog=function(e,t){this.target=Q("div",{id:this.documentHelper.owner.containerId+"_table_border_shadings",className:"e-de-table-border-shading-dlg"}),this.displayText=Q("div",{innerHTML:e.getConstant("Borders"),className:"e-de-table-border-heading"}),this.settingAndPreviewContainer=Q("div",{className:"e-de-dlg-row"}),this.settingsContiner=Q("div",{}),this.styleContainer=Q("div",{}),this.previewContiner=Q("div",{className:"e-de-table-border-preview-container"}),this.previewSubContainer1=Q("div",{className:"e-de-dlg-row"}),this.previewSubContainer2=Q("div",{}),this.styleSubContainer=Q("div",{className:"e-de-container-row"}),this.dropdownListDiv=Q("div",{className:"e-de-subcontainer-left"}),this.dropDownList=Q("input",{}),this.widthcontainerDiv=Q("div",{className:"e-de-container-row"}),this.widthNumericDiv=Q("div",{className:"e-de-subcontainer-left"}),this.widthNumeric=Q("input",{}),this.colorDiv=Q("div",{className:"e-de-subcontainer-right"}),this.colorText=Q("div",{innerHTML:e.getConstant("Color"),className:"e-de-table-border-clr-heading"}),this.borderColorPickerElement=Q("input",{attrs:{type:"color"},className:"e-dlg-clr-pkr-top"}),this.settingText=Q("div",{innerHTML:e.getConstant("Setting"),className:"e-de-table-setting-heading"}),this.settingsSubContiner=Q("div",{className:"e-de-dlg-row"}),this.noneDivContainer=Q("div",{id:this.target.id+"_None_Div_Container"}),this.noneDiv=Q("div",{id:this.target.id+"_None_Div",className:"e-de-table-border-inside-setting e-de-table-border-setting-genral"}),this.noneDivLabel=Q("label",{innerHTML:e.getConstant("None"),className:"e-de-table-setting-labels-heading",id:this.target.id+"_None_Div_Label"}),this.boxDivContainer=Q("div",{id:this.target.id+"_Box_Div_Container"}),this.boxDiv=Q("div",{id:this.target.id+"_Box_Div",className:"e-de-table-border-inside-setting e-de-table-border-setting-genral"}),this.boxDivLabel=Q("label",{innerHTML:e.getConstant("Box"),className:"e-de-table-setting-labels-heading",id:this.target.id+"_Box_Div_Label"}),this.allDivContainer=Q("div",{id:this.target.id+"_All_Div_Container"}),this.allDiv=Q("div",{id:this.target.id+"_All_Div",className:"e-de-table-border-inside-setting e-de-table-border-setting-genral"}),this.allDivLabel=Q("label",{innerHTML:e.getConstant("All"),className:"e-de-table-setting-labels-heading",id:this.target.id+"_All_Div_Label"}),this.customDivContainer=Q("div",{id:this.target.id+"_Custom_Div_Container"}),this.customDiv=Q("div",{id:this.target.id+"_Custom_Div",className:"e-de-table-border-inside-setting e-de-table-border-setting-genral"}),this.customDivLabel=Q("label",{innerHTML:e.getConstant("Custom"),className:"e-de-table-setting-labels-heading",id:this.target.id+"_Custom_Div_Label"}),this.noneDivTransparent=Q("div",{id:this.target.id+"_None_Div_Transparent",className:"e-icons e-de-table-border-setting e-de-table-border-none-setting"}),this.boxDivTransparent=Q("div",{id:this.target.id+"_Box_Div_Transparent",className:"e-icons e-de-table-border-setting e-de-table-border-box-setting"}),this.allDivTransparent=Q("div",{id:this.target.id+"_All_Div_Transparent",className:"e-icons e-de-table-border-setting e-de-table-border-all-setting"}),this.customDivTransparent=Q("div",{id:this.target.id+"_Custom_Div_Transparent",className:"e-icons e-de-table-border-setting e-de-table-border-custom-setting"}),t&&(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")),this.previewText=Q("div",{innerHTML:e.getConstant("Preview"),className:"e-de-table-setting-heading"}),this.previewDiv=Q("div",{id:this.target.id+"_Preview_Div",className:"e-de-border-dlg-preview-div",styles:"position: relative"}),this.previewRightDiagonalDiv=Q("div",{styles:"position: absolute;width:1px;height:111px;left: 38px;top: -17px;transform: rotate(135deg); background-color: black",id:this.target.id+"_Preview_Div_Right_Diagonal",className:"e-de-border-dlg-preview-inside-divs"}),this.previewLeftDiagonalDiv=Q("div",{styles:"position: absolute;width: 1px;height: 111px;left: 38px;top: -17px;transform:rotate(45deg); background-color: black",id:this.target.id+"_Preview_Div_Left_Diagonal",className:"e-de-border-dlg-preview-inside-divs"}),this.previewVerticalDiv=Q("div",{styles:"width: 1px;height: 80px;position: absolute;left: 39px;top: -1px; background-color: black",id:this.target.id+"_Preview_Div_Vertical",className:"e-de-border-dlg-preview-inside-divs"}),this.previewHorizontalDiv=Q("div",{styles:"width: 80px;height: 1px;position: absolute;left: -1px;top: 41px; background-color: black",id:this.target.id+"_Preview_Div_Horizontal",className:"e-de-border-dlg-preview-inside-divs"}),this.previewDivVerticalContainer=Q("div"),this.previewDivTopTopContainer=Q("div",{styles:"margin-top: 0",className:"e-de-table-border-icon-container",id:this.target.id+"_Preview_Div_TopTop_Container"}),this.previewDivTopTop=Q("div",{id:this.target.id+"_Preview_Div_TopTop",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivTopCenterContainer=Q("div",{className:"e-de-table-border-icon-container",id:this.target.id+"_Preview_Div_TopCenter_Container"}),this.previewDivTopCenter=Q("div",{id:this.target.id+"_Preview_Div_TopCenter",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivTopBottomContainer=Q("div",{className:"e-de-table-border-icon-container",id:this.target.id+"_Preview_Div_TopBottom_Container"}),this.previewDivTopBottom=Q("div",{id:this.target.id+"_Preview_Div_TopBottom",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivLeftDiagonalContainer=Q("div",{className:"e-de-table-border-icon-container",id:this.target.id+"_Preview_Div_LeftDiagonal_Container"}),this.previewDivLeftDiagonal=Q("div",{id:this.target.id+"_Preview_Div_LeftDiagonal",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivHorizontalContainer=Q("div",{className:"e-de-dlg-row"}),this.previewDivBottomLeftContainer=Q("div",{id:this.target.id+"_Preview_Div_BottomLeft_Container",className:"e-de-table-border-icon-container"}),this.previewDivBottomLeft=Q("div",{id:this.target.id+"_Preview_Div_BottomLeft",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivBottomcenterContainer=Q("div",{id:this.target.id+"_Preview_Div_BottomCenter_Container",className:"e-de-table-border-icon-container"}),this.previewDivBottomcenter=Q("div",{id:this.target.id+"_Preview_Div_BottomCenter",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivBottomRightContainer=Q("div",{id:this.target.id+"_Preview_Div_BottomRight_Container",className:"e-de-table-border-icon-container"}),this.previewDivBottomRight=Q("div",{id:this.target.id+"_Preview_Div_BottomRight",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivDiagonalRightContainer=Q("div",{className:"e-de-table-border-icon-container",id:this.target.id+"_Preview_Div_RightDiagonal_Container"}),this.previewDivDiagonalRight=Q("div",{id:this.target.id+"_Preview_Div_RightDiagonal",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivTopTopTransParent=Q("div",{id:this.target.id+"_previewDivTopTopTransParent",className:"e-icons e-de-table-border-preview e-de-table-border-toptop-alignment"}),this.previewDivTopCenterTransParent=Q("div",{id:this.target.id+"_previewDivTopCenterTransParent",className:"e-icons e-de-table-border-preview e-de-table-border-topcenter-alignment"}),this.previewDivTopBottomTransParent=Q("div",{id:this.target.id+"_previewDivTopBottomTransParent",className:"e-icons e-de-table-border-preview e-de-table-border-topbottom-alignment"}),this.previewDivLeftDiagonalTransParent=Q("div",{id:this.target.id+"_previewDivLeftDiagonalTransParent",className:"e-icons e-de-table-border-preview e-de-table-border-diagionalup-alignment"}),this.previewDivBottomLeftTransparent=Q("div",{id:this.target.id+"_previewDivBottomLeftTransparent",className:"e-icons e-de-table-border-preview e-de-table-border-bottomleft-alignment"}),this.previewDivBottomcenterTransparent=Q("div",{id:this.target.id+"_previewDivBottomcenterTransparent",className:"e-icons e-de-table-border-preview e-de-table-border-bottomcenter-alignment"}),this.previewDivBottomRightTransparent=Q("div",{id:this.target.id+"_previewDivBottomRightTransparent",className:"e-icons e-de-table-border-preview e-de-table-border-bottomright-alignment"}),this.previewDivDiagonalRightTransparent=Q("div",{id:this.target.id+"_previewDivDiagonalRightTransparent",className:"e-icons e-de-table-border-preview e-de-table-border-diagionaldown-alignment"}),this.shadingContiner=Q("div",{}),this.shadingText=Q("div",{innerHTML:e.getConstant("Shading"),className:"e-de-table-border-heading"}),this.shadings=Q("div",{className:"e-de-dlg-row"}),this.colorPickerDiv=Q("div",{className:"e-de-table-border-clr-left-container"}),this.label=Q("div",{innerHTML:e.getConstant("Fill"),className:"e-de-table-border-clr-heading"}),this.shadingColorPickerElement=Q("input",{attrs:{type:"color"},id:this.target.id+"_shading_color"}),this.shdApply=Q("div",{className:"e-de-subcontainer-right"});var i=Q("input",{id:this.target.id+"_shading"}),n=[{Value:"Cell",Name:e.getConstant("Cell ")},{Value:"Table",Name:e.getConstant("Table")},{Value:"Paragraph",Name:e.getConstant("Paragraph")}],o=(this.shdApply.appendChild(i),this.noneDiv.appendChild(this.noneDivTransparent),this.boxDiv.appendChild(this.boxDivTransparent),this.allDiv.appendChild(this.allDivTransparent),this.customDiv.appendChild(this.customDivTransparent),this.noneDivContainer.appendChild(this.noneDiv),this.noneDivContainer.appendChild(this.noneDivLabel),this.boxDivContainer.appendChild(this.boxDiv),this.boxDivContainer.appendChild(this.boxDivLabel),this.allDivContainer.appendChild(this.allDiv),this.allDivContainer.appendChild(this.allDivLabel),this.customDivContainer.appendChild(this.customDiv),this.customDivContainer.appendChild(this.customDivLabel),this.settingsContiner.appendChild(this.settingText),this.settingsContiner.appendChild(this.settingsSubContiner),this.settingsSubContiner.appendChild(this.noneDivContainer),this.settingsSubContiner.appendChild(this.boxDivContainer),this.settingsSubContiner.appendChild(this.allDivContainer),this.settingsSubContiner.appendChild(this.customDivContainer),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),this.previewContiner.appendChild(this.previewText),this.previewContiner.appendChild(this.previewSubContainer1),this.previewSubContainer1.appendChild(this.previewDivVerticalContainer),this.previewSubContainer1.appendChild(this.previewSubContainer2),this.previewSubContainer2.appendChild(this.previewDiv),this.previewSubContainer2.appendChild(this.previewDivHorizontalContainer),this.previewDiv.appendChild(this.previewLeftDiagonalDiv),this.previewDiv.appendChild(this.previewRightDiagonalDiv),this.previewDiv.appendChild(this.previewHorizontalDiv),this.previewDiv.appendChild(this.previewVerticalDiv),this.previewDivHorizontalContainer.appendChild(this.previewDivBottomLeftContainer),this.previewDivHorizontalContainer.appendChild(this.previewDivBottomcenterContainer),this.previewDivHorizontalContainer.appendChild(this.previewDivBottomRightContainer),this.previewDivHorizontalContainer.appendChild(this.previewDivDiagonalRightContainer),this.previewDivVerticalContainer.appendChild(this.previewDivTopTopContainer),this.previewDivVerticalContainer.appendChild(this.previewDivTopCenterContainer),this.previewDivVerticalContainer.appendChild(this.previewDivTopBottomContainer),this.previewDivVerticalContainer.appendChild(this.previewDivLeftDiagonalContainer),this.shadings.appendChild(this.colorPickerDiv),this.colorPickerDiv.appendChild(this.label),this.colorPickerDiv.appendChild(this.shadingColorPickerElement),this.shadings.appendChild(this.shdApply),this.shadingContiner.appendChild(this.shadingText),this.shadingContiner.appendChild(this.shadings),this.styleContainer.appendChild(this.styleSubContainer),this.styleSubContainer.appendChild(this.dropdownListDiv),this.dropdownListDiv.appendChild(this.dropDownList),this.styleContainer.appendChild(this.widthcontainerDiv),this.widthcontainerDiv.appendChild(this.widthNumericDiv),this.widthNumericDiv.appendChild(this.widthNumeric),this.widthcontainerDiv.appendChild(this.colorDiv),this.colorDiv.appendChild(this.colorText),this.colorDiv.appendChild(this.borderColorPickerElement),this.borderColorPickerElement.setAttribute("aria-label",this.colorText.innerHTML),this.settingAndPreviewContainer.appendChild(this.settingsContiner),this.settingAndPreviewContainer.appendChild(this.previewContiner),this.target.appendChild(this.displayText),this.target.appendChild(this.settingAndPreviewContainer),this.target.appendChild(this.styleContainer),this.target.appendChild(this.shadingContiner),this.noneDivContainer.addEventListener("click",this.handleSettingCheckBoxActionHandler),this.boxDivContainer.addEventListener("click",this.handleSettingCheckBoxActionHandler),this.allDivContainer.addEventListener("click",this.handleSettingCheckBoxActionHandler),this.customDivContainer.addEventListener("click",this.handleSettingCheckBoxActionHandler),this.previewDivBottomcenterContainer.addEventListener("click",this.handlePreviewCheckBoxActionHandler),this.previewDivBottomLeftContainer.addEventListener("click",this.handlePreviewCheckBoxActionHandler),this.previewDivBottomRightContainer.addEventListener("click",this.handlePreviewCheckBoxActionHandler),this.previewDivTopTopContainer.addEventListener("click",this.handlePreviewCheckBoxActionHandler),this.previewDivTopBottomContainer.addEventListener("click",this.handlePreviewCheckBoxActionHandler),this.previewDivTopCenterContainer.addEventListener("click",this.handlePreviewCheckBoxActionHandler),this.previewDivDiagonalRightContainer.addEventListener("click",this.handlePreviewCheckBoxActionHandler),this.previewDivLeftDiagonalContainer.addEventListener("click",this.handlePreviewCheckBoxActionHandler),this.borderWidth=new NL({value:.5,min:.25,max:6,decimals:2,step:.25,floatLabelType:"Always",placeholder:e.getConstant("Width"),enablePersistence:!1}),this.borderWidth.appendTo(this.widthNumeric),this.widthNumeric.setAttribute("aria-labelledby",e.getConstant("width")),ao(function(e){return"<div>"+e.Svg+"</div>"})),o=(this.borderStyle=new qz({popupHeight:"150px",dataSource:[{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 5.5H98" stroke-linejoin="round"/></svg></div>',LineStyle:"Single"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 5.5H98" stroke-linejoin="round" stroke-dasharray="1 1"/></svg></div>',LineStyle:"Dot"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_1347_1852)"><path d="M3.05176e-05 5.5H98" stroke-linejoin="round" stroke-dasharray="4 1"/></g><defs><clipPath id="clip0_1347_1852"><rect width="98" height="10" fill="white"/></clipPath></defs></svg></div>',LineStyle:"DashSmallGap"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 5.5H98" stroke-linejoin="round" stroke-dasharray="4 4"/></svg></div>',LineStyle:"DashLargeGap"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 5.5H98" stroke-linejoin="round" stroke-dasharray="7 3 3 3"/></svg></div>',LineStyle:"DashDot"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 4.5H98" stroke-linejoin="round" stroke-dasharray="6 2 2 2 2 2"/></svg></div>',LineStyle:"DashDotDot"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3.5H98" stroke-linejoin="round"/><path d="M0 5.5H98" stroke-linejoin="round"/></svg></div>',LineStyle:"Double"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 5.5H98" stroke-linejoin="round"/><path d="M0 3.5H98" stroke-linejoin="round"/><path d="M0 7.5H98" stroke-linejoin="round"/></svg></div>',LineStyle:"Triple"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 4H98" stroke-width="4" stroke-linejoin="round"/><path d="M0 4H98" stroke-width="4" stroke-linejoin="round"/><path d="M0 7.5H98" stroke-linejoin="round"/></svg></div>',LineStyle:"ThinThickSmallGap"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 6H98" stroke-width="4" stroke-linejoin="round"/><path d="M0 2.5H98" stroke-linejoin="round"/></svg></div>',LineStyle:"ThickThinSmallGap"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 5H98" stroke-width="4" stroke-linejoin="round"/><path d="M0 1.5H98" stroke-linejoin="round"/><path d="M0 8.5H98" stroke-linejoin="round"/></svg></div>',LineStyle:"ThinThickThinSmallGap"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 3H98" stroke-width="4" stroke-linejoin="round"/><path d="M0 8H98" stroke-width="2" stroke-linejoin="round"/></svg></div>',LineStyle:"ThickThinMediumGap"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 7H98" stroke-width="4" stroke-linejoin="round"/><path d="M0 2H98" stroke-width="2" stroke-linejoin="round"/></svg></div>',LineStyle:"ThinThickMediumGap"},{Svg:'<div class="e-de-svg-border-fill-color"><svg style="width:98%;" height="23" viewBox="0 0 98 23" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M98 8H0V9H98V8ZM98 10H0V14H98V10ZM0 15H98V16H0V15Z" /></svg></div>',LineStyle:"ThinThickThinMediumGap"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 8.5H98" stroke-linejoin="round"/><path d="M0 3H98" stroke-width="2" stroke-linejoin="round"/></svg></div>',LineStyle:"ThinThickLargeGap"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 2.5H98" stroke-linejoin="round"/><path d="M0 8H98" stroke-width="2" stroke-linejoin="round"/></svg></div>',LineStyle:"ThickThinLargeGap"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_1347_1892)"><g clip-path="url(#clip0_1407_5)"><path d="M0 0.5H98" stroke-linejoin="round"/><path d="M0 9.5H98" stroke-linejoin="round"/><path d="M0 5H98" stroke-width="2" stroke-linejoin="round"/></g><defs><clipPath id="clip0_1407_5"><rect width="98" height="10" fill="white"/></clipPath></defs></svg></div>',LineStyle:"ThinThickThinLargeGap"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3 3H5V4H3V3ZM2 5V4H3V5H2ZM1 6V5H2V6H1ZM1 6V7H0V6H1ZM6 5H5V4H6V5ZM7 6H6V5H7V6ZM9 6V7H7V6H9ZM10 5V6H9V5H10ZM11 4V5H10V4H11ZM13 4H11V3H13V4ZM14 5H13V4H14V5ZM15 6H14V5H15V6ZM17 6V7H15V6H17ZM18 5V6H17V5H18ZM19 4V5H18V4H19ZM21 4H19V3H21V4ZM22 5H21V4H22V5ZM23 6H22V5H23V6ZM25 6V7H23V6H25ZM26 5V6H25V5H26ZM27 4V5H26V4H27ZM29 4H27V3H29V4ZM30 5H29V4H30V5ZM31 6H30V5H31V6ZM33 6V7H31V6H33ZM34 5V6H33V5H34ZM35 4V5H34V4H35ZM37 4H35V3H37V4ZM38 5H37V4H38V5ZM39 6H38V5H39V6ZM41 6V7H39V6H41ZM42 5V6H41V5H42ZM43 4V5H42V4H43ZM45 4H43V3H45V4ZM46 5H45V4H46V5ZM47 6H46V5H47V6ZM49 6V7H47V6H49ZM50 5V6H49V5H50ZM51 4V5H50V4H51ZM53 4H51V3H53V4ZM54 5H53V4H54V5ZM55 6H54V5H55V6ZM57 6V7H55V6H57ZM58 5V6H57V5H58ZM59 4V5H58V4H59ZM61 4H59V3H61V4ZM62 5H61V4H62V5ZM63 6H62V5H63V6ZM65 6V7H63V6H65ZM66 5V6H65V5H66ZM67 4V5H66V4H67ZM69 4H67V3H69V4ZM70 5H69V4H70V5ZM71 6H70V5H71V6ZM73 6V7H71V6H73ZM74 5V6H73V5H74ZM75 4V5H74V4H75ZM77 4H75V3H77V4ZM78 5H77V4H78V5ZM79 6H78V5H79V6ZM81 6V7H79V6H81ZM82 5V6H81V5H82ZM83 4V5H82V4H83ZM85 4H83V3H85V4ZM86 5H85V4H86V5ZM87 6H86V5H87V6ZM89 6V7H87V6H89ZM90 5V6H89V5H90ZM91 4V5H90V4H91ZM93 4H91V3H93V4ZM94 5H93V4H94V5ZM95 6V5H94V6H95ZM95 6V7H97V6H95Z" fill="black"/></svg></div>',LineStyle:"SingleWavy"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3 2H5V3H3V2ZM2 4V3H3V4H2ZM2 4V5H1V4H2ZM6 4H5V3H6V4ZM9 4V5H6V4H9ZM10 3V4H9V3H10ZM12 3H10V2H12V3ZM13 4H12V3H13V4ZM16 4V5H13V4H16ZM17 3V4H16V3H17ZM19 3H17V2H19V3ZM20 4H19V3H20V4ZM23 4V5H20V4H23ZM24 3V4H23V3H24ZM26 3H24V2H26V3ZM27 4H26V3H27V4ZM30 4V5H27V4H30ZM31 3V4H30V3H31ZM33 3H31V2H33V3ZM34 4H33V3H34V4ZM37 4V5H34V4H37ZM38 3V4H37V3H38ZM40 3H38V2H40V3ZM41 4H40V3H41V4ZM44 4V5H41V4H44ZM45 3V4H44V3H45ZM47 3H45V2H47V3ZM48 4H47V3H48V4ZM51 4V5H48V4H51ZM52 3V4H51V3H52ZM54 3H52V2H54V3ZM55 4H54V3H55V4ZM58 4V5H55V4H58ZM59 3V4H58V3H59ZM61 3H59V2H61V3ZM62 4H61V3H62V4ZM65 4V5H62V4H65ZM66 3V4H65V3H66ZM68 3H66V2H68V3ZM69 4H68V3H69V4ZM72 4V5H69V4H72ZM73 3V4H72V3H73ZM75 3H73V2H75V3ZM76 4H75V3H76V4ZM79 4V5H76V4H79ZM80 3V4H79V3H80ZM82 3H80V2H82V3ZM83 4H82V3H83V4ZM86 4V5H83V4H86ZM87 3V4H86V3H87ZM89 3H87V2H89V3ZM90 4H89V3H90V4ZM93 4V5H90V4H93ZM94 3V4H93V3H94ZM96 3H94V2H96V3ZM96 3H97V4H96V3ZM2 7H1V8H2V7ZM3 6H2V7H3V6ZM5 6H3V5H5V6ZM6 7H5V6H6V7ZM9 7V8H6V7H9ZM10 6V7H9V6H10ZM12 6H10V5H12V6ZM13 7H12V6H13V7ZM16 7H13V8H16V7ZM17 6H16V7H17V6ZM19 6V5H17V6H19ZM20 7V6H19V7H20ZM23 7H20V8H23V7ZM24 6H23V7H24V6ZM26 6V5H24V6H26ZM27 7V6H26V7H27ZM30 7V8H27V7H30ZM31 6V7H30V6H31ZM33 6H31V5H33V6ZM34 7H33V6H34V7ZM37 7V8H34V7H37ZM38 6V7H37V6H38ZM40 6H38V5H40V6ZM41 7H40V6H41V7ZM44 7H41V8H44V7ZM45 6H44V7H45V6ZM47 6V5H45V6H47ZM48 7V6H47V7H48ZM51 7H48V8H51V7ZM52 6H51V7H52V6ZM54 6V5H52V6H54ZM55 7V6H54V7H55ZM58 7V8H55V7H58ZM59 6V7H58V6H59ZM61 6H59V5H61V6ZM62 7H61V6H62V7ZM65 7V8H62V7H65ZM66 6V7H65V6H66ZM68 6H66V5H68V6ZM69 7H68V6H69V7ZM72 7H69V8H72V7ZM73 6H72V7H73V6ZM75 6V5H73V6H75ZM76 7V6H75V7H76ZM79 7H76V8H79V7ZM80 6H79V7H80V6ZM82 6V5H80V6H82ZM83 7V6H82V7H83ZM86 7V8H83V7H86ZM87 6V7H86V6H87ZM89 6H87V5H89V6ZM90 7H89V6H90V7ZM93 7V8H90V7H93ZM94 6V7H93V6H94ZM96 6H94V5H96V6ZM96 6V7H97V6H96Z" fill="black"/></svg></div>',LineStyle:"DoubleWavy"},{Svg:'<div class="e-de-svg-border-fill-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 3H4V4H3V5H2V6H1V7H0V3ZM3 6V5H4V6H3ZM5 5V6H4V7H9V6H10V7H11V6H12V7H17V6H18V7H19V6H20V7H25V6H26V7H27V6H28V7H33V6H34V7H35V6H36V7H41V6H42V7H43V6H44V7H49V6H50V7H51V6H52V7H57V6H58V7H59V6H60V7H65V6H66V7H67V6H68V7H73V6H74V7H75V6H76V7H81V6H82V7H83V6H84V7H89V6H90V7H91V6H92V7H97V6H98V5V3H95V4H94V3H93V4H92V3H87V4H86V3H85V4H84V3H79V4H78V3H77V4H76V3H71V4H70V3H69V4H68V3H63V4H62V3H61V4H60V3H55V4H54V3H53V4H52V3H47V4H46V3H45V4H44V3H39V4H38V3H37V4H36V3H31V4H30V3H29V4H28V3H23V4H22V3H21V4H20V3H15V4H14V3H13V4H12V3H7V4H6V3H5V4H4V5H5ZM5 5H6V4H5V5ZM12 5V4H11V5H10V6H11V5H12ZM13 5V6H12V5H13ZM13 5V4H14V5H13ZM20 5V4H19V5H18V6H19V5H20ZM21 5H22V4H21V5ZM21 5H20V6H21V5ZM28 5V4H27V5H26V6H27V5H28ZM29 5V6H28V5H29ZM29 5H30V4H29V5ZM36 5V4H35V5H34V6H35V5H36ZM37 5V4H38V5H37ZM37 5H36V6H37V5ZM44 5V4H43V5H42V6H43V5H44ZM45 5V6H44V5H45ZM45 5V4H46V5H45ZM52 5V4H51V5H50V6H51V5H52ZM53 5H54V4H53V5ZM53 5H52V6H53V5ZM60 5V4H59V5H58V6H59V5H60ZM61 5V6H60V5H61ZM61 5H62V4H61V5ZM68 5V4H67V5H66V6H67V5H68ZM69 5V4H70V5H69ZM69 5H68V6H69V5ZM76 5V4H75V5H74V6H75V5H76ZM77 5V6H76V5H77ZM77 5V4H78V5H77ZM84 5V4H83V5H82V6H83V5H84ZM85 5H86V4H85V5ZM85 5H84V6H85V5ZM92 5V4H91V5H90V6H91V5H92ZM93 5V6H92V5H93ZM93 5H94V4H93V5ZM3 6H2V7H3V6Z" /></svg></div>',LineStyle:"DashDotStroked"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 8H98" stroke-width="2" stroke-linejoin="round"/><path d="M0 5H98" stroke="#808080" stroke-width="4" stroke-linejoin="round"/><path d="M0 2H98" stroke="#C0C0C0" stroke-width="2" stroke-linejoin="round"/></svg></div>',LineStyle:"Emboss3D"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 2H98" stroke-width="2" stroke-linejoin="round"/><path d="M0 5H98" stroke="#808080" stroke-width="4" stroke-linejoin="round"/><path d="M0 8H98" stroke="#C0C0C0" stroke-width="2" stroke-linejoin="round"/></svg></div>',LineStyle:"Engrave3D"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 1.5H98" stroke="#A0A0A0" stroke-linejoin="round"/><path d="M0 8.5H98" stroke-linejoin="round"/></svg></div>',LineStyle:"Outset"},{Svg:'<div class="e-de-svg-border-color"><svg style="width:98%;" height="10" viewBox="0 0 98 10" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 1.5H98" stroke-linejoin="round"/><path d="M0 8.5H98" stroke="#A0A0A0" stroke-linejoin="round"/></svg></div>',LineStyle:"Inset"}],floatLabelType:"Always",fields:{text:"Svg",value:"LineStyle"},itemTemplate:o,valueTemplate:o,placeholder:e.getConstant("Style"),enableRtl:t}),this.borderStyle.appendTo(this.dropDownList),this.dropDownList.setAttribute("aria-lablledby",e.getConstant("Style")),this.ulelementShading=new qz({dataSource:n,fields:{text:"Name",value:"Value"},change:this.applyTableCellPreviewBoxes,index:1,floatLabelType:"Always",placeholder:e.getConstant("Apply To"),enableRtl:t,htmlAttributes:{"aria-labelledby":e.getConstant("Apply To")}}),this.ulelementShading.appendTo(i),this.documentHelper.owner.documentEditorSettings.colorPickerSettings),n=o.columns,e=o.createPopupOnClick,i=(o.cssClass,o.disabled),r=o.enablePersistence,s=o.inline,a=o.mode,l=o.modeSwitcher,h=o.noColor,d=o.presetColors,o=o.showButtons;this.borderColorPicker=new cV({value:"#000000",change:this.applyPreviewTableBorderColor,enableRtl:t,locale:this.documentHelper.owner.locale,cssClass:"e-de-dlg-clr-picker",enableOpacity:!1,mode:a,modeSwitcher:l,showButtons:o,columns:n,createPopupOnClick:e,disabled:i,enablePersistence:r,inline:s,noColor:h,presetColors:d}),this.documentHelper.borderColorPicker=this.borderColorPicker,this.borderColorPicker.appendTo(this.borderColorPickerElement),this.shadingColorPicker=new cV({value:"#FFFFFF",change:this.applyPreviewTableBackgroundColor,enableRtl:t,locale:this.documentHelper.owner.locale,cssClass:"e-de-dlg-clr-picker",enableOpacity:!1,mode:a,modeSwitcher:l,showButtons:o,columns:n,createPopupOnClick:e,disabled:i,enablePersistence:r,inline:s,noColor:h,presetColors:d}),this.documentHelper.shadingColorPicker=this.shadingColorPicker,this.shadingColorPicker.appendTo(this.shadingColorPickerElement),t&&this.label.classList.add("e-de-rtl")},_pi.prototype.updateBorder=function(e,t){"Single"===t.lineStyle&&"None"===e.lineStyle&&(e.lineStyle="Single",e.lineWidth=t.lineWidth)},_pi.prototype.applyFormat=function(){var e=this.documentHelper.owner.editorModule;"Paragraph"!==this.ulelementShading.value&&(e.initComplexHistory("BordersAndShading"),e.isBordersAndShadingDialog=!0,"Cell"===this.ulelementShading.value?e.onCellFormat(this.cellFormat):"Table"===this.ulelementShading.value&&e.onTableFormat(this.tableFormat,!0),je(this.documentHelper.owner.editorHistoryModule.currentHistoryInfo)||this.documentHelper.owner.editorHistoryModule.updateComplexHistory(),"Cell"===this.ulelementShading.value?e.isCellFormatApplied=!0:e.isCellFormatApplied=!1),"Cell"===this.ulelementShading.value?e.isCellFormatApplied=!0:e.isCellFormatApplied=!1,e.isBordersAndShadingDialog=!1},_pi.prototype.getBorder=function(e){var t=new pri;return t.color=this.borderColorPicker.value,t.lineStyle=this.borderStyle.value,t.lineWidth=this.borderWidth.value,t.space="left"===e||"right"===e?4:1,t},_pi.prototype.checkClassName=function(e){return e.classList.contains("e-de-table-border-inside-preview-click")},_pi.prototype.show=function(){var e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.target||this.initBordersAndShadingsDialog(e,this.documentHelper.owner.enableRtl),this.loadBordersShadingsPropertiesDialog(e),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()},_pi.prototype.onhandleSettingCheckBoxActionClicked=function(e){this.handleSettingCheckBoxAction(e)},_pi.prototype.onhandlePreviewCheckBoxActionClicked=function(e){this.handlePreviewCheckBoxAction(e)},_pi.prototype.updateClassForSettingDivElements=function(){for(var e,t=this.target.getElementsByClassName("e-de-table-border-inside-setting"),i=0;i<t.length;i++)-1!==t[parseInt(i.toString(),10)].className.indexOf("e-de-table-border-inside-setting-click")&&(e=(e=t[parseInt(i.toString(),10)].className).replace("e-de-table-border-inside-setting-click",""),t[parseInt(i.toString(),10)].className=e)},_pi.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":"Cell"===this.ulelementShading.value||"Table"===this.ulelementShading.value?(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.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.previewDivTopCenter.classList.remove("e-de-table-border-inside-preview-click")),this.isShowHidePreviewTableElements("all")}},_pi.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":"Cell"===this.ulelementShading.value||"Table"===this.ulelementShading.value?(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"):(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")}},_pi.prototype.handlePreviewCheckBoxShowHide=function(e,t,i){i.classList.contains(t)?i.classList.remove(t):i.classList.add(t)},_pi.prototype.showHidePreviewDivElements=function(e,t,i,n,o){i=document.getElementById(e+i),e=document.getElementById(e+n);"TopTop"===o?this.setPropertyPreviewDivElement(i,e,t,"border-top"):"TopCenter"===o?this.setPropertyPreviewDivElement(i,e,t,"display"):"TopBottom"===o?this.setPropertyPreviewDivElement(i,e,t,"border-bottom"):"LeftDiagonal"===o?this.setPropertyPreviewDivElement(i,e,t,"display"):"BottomLeft"===o?this.setPropertyPreviewDivElement(i,e,t,"border-left"):"BottomCenter"===o?this.setPropertyPreviewDivElement(i,e,t,"display"):"BottomRight"===o?this.setPropertyPreviewDivElement(i,e,t,"border-right"):"RightDiagonal"===o&&this.setPropertyPreviewDivElement(i,e,t,"display")},_pi.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"},_pi.prototype.loadBordersShadingsPropertiesDialog=function(e){var t,i,n;je(this.documentHelper.selection.tableFormat.table)?(this.shadingContiner.style.display="none",this.ulelementShading.dataSource=[{Value:"Paragraph",Name:e.getConstant("Paragraph")}],this.ulelementShading.dataBind(),n=this.documentHelper.selection.start.paragraph.paragraphFormat,this.ulelementShading.value="Paragraph",this.cloneBorders(n.borders),n=(n=this.getSelectionBorderFormat()).hasValues()?(t=this.getLineStyle(n.lineStyle),i=n.color,n.lineWidth):(t=0,i="#000000",.5),this.shadingColorPicker.disabled=!0):(this.shadingContiner.style.display="block",this.ulelementShading.dataSource=[{Value:"Cell",Name:e.getConstant("Cell")},{Value:"Table",Name:e.getConstant("Table")},{Value:"Paragraph",Name:e.getConstant("Paragraph")}],this.ulelementShading.dataBind(),je(e=this.documentHelper.selection.tableFormat.table.tableFormat)||je(e.borders)||(this.cloneBorders(e.borders),e=je(e.borders)||je(e.borders.top)?(n=t=0,i="#000000"):(t=this.getLineStyle(e.borders.top.lineStyle),i=e.borders.top.color,n=e.borders.top.getLineWidth(),e.shading.backgroundColor),this.ulelementShading.value="Table",this.shadingColorPicker.value=e,this.shadingColorPicker.disabled=!1)),this.borderColorPicker.value=i,this.previewDivLeftDiagonal.style.display="none",this.previewDivDiagonalRight.style.display="none",this.borderWidth.value=n,this.borderStyle.index=t},_pi.prototype.getSelectionBorderFormat=function(){var e=new pri,t=this.documentHelper.selection.paragraphFormat.borders;return"None"!==t.top.lineStyle?this.copyToBorder(e,t.top):"None"!==t.left.lineStyle?this.copyToBorder(e,t.left):"None"!==t.bottom.lineStyle?this.copyToBorder(e,t.bottom):"None"!==t.right.lineStyle?this.copyToBorder(e,t.right):e},_pi.prototype.copyToBorder=function(e,t){return je(t.lineStyle)||(e.lineStyle=t.lineStyle),je(t.color)||(e.color=t.color),je(t.lineWidth)||(e.lineWidth=t.lineWidth),e},_pi.prototype.cloneBorders=function(e){var t=!1,i=!1,n=!1,o=!1,r=!1,s=!1,a=!1,l=!1,h=!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)&&(o=!0),e.horizontal&&(e.horizontal.hasNoneStyle||"None"!==e.horizontal.lineStyle)&&(r=!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)&&(h=!0),t&&i&&n&&o?r&&s&&!h&&!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):(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&&o&&!r&&!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"),t||i||n||o||r||s?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"),"Cell"===this.ulelementShading.value||"Table"===this.ulelementShading.value?t?this.previewDivTopTop.classList.add("e-de-table-border-inside-preview-click"):this.previewDivTopTop.classList.remove("e-de-table-border-inside-preview-click"):t?(this.previewDivTopTop.classList.add("e-de-table-border-inside-preview-click"),this.previewDiv.style.borderTop="1px solid rgba(0,0,0,.54)"):(this.previewDivTopTop.classList.remove("e-de-table-border-inside-preview-click"),this.previewDiv.style.borderTop="0px"),"Cell"==this.ulelementShading.value||"Table"===this.ulelementShading.value?i?this.previewDivTopBottom.classList.add("e-de-table-border-inside-preview-click"):this.previewDivTopBottom.classList.remove("e-de-table-border-inside-preview-click"):i?(this.previewDivTopBottom.classList.add("e-de-table-border-inside-preview-click"),this.previewDiv.style.borderBottom="1px solid rgba(0,0,0,.54)"):(this.previewDivTopBottom.classList.remove("e-de-table-border-inside-preview-click"),this.previewDiv.style.borderBottom="0px"),"Cell"==this.ulelementShading.value||"Table"===this.ulelementShading.value?n?this.previewDivBottomLeft.classList.add("e-de-table-border-inside-preview-click"):this.previewDivBottomLeft.classList.remove("e-de-table-border-inside-preview-click"):n?(this.previewDivBottomLeft.classList.add("e-de-table-border-inside-preview-click"),this.previewDiv.style.borderLeft="1px solid rgba(0,0,0,.54)"):(this.previewDivBottomLeft.classList.remove("e-de-table-border-inside-preview-click"),this.previewDiv.style.borderLeft="0px"),"Cell"==this.ulelementShading.value||"Table"===this.ulelementShading.value?o?this.previewDivBottomRight.classList.add("e-de-table-border-inside-preview-click"):this.previewDivBottomRight.classList.remove("e-de-table-border-inside-preview-click"):o?(this.previewDivBottomRight.classList.add("e-de-table-border-inside-preview-click"),this.previewDiv.style.borderRight="1px solid rgba(0,0,0,.54)"):(this.previewDivBottomRight.classList.remove("e-de-table-border-inside-preview-click"),this.previewDiv.style.borderRight="0px"),s?this.previewDivBottomcenter.classList.add("e-de-table-border-inside-preview-click"):this.previewDivBottomcenter.classList.remove("e-de-table-border-inside-preview-click"),r?this.previewDivTopCenter.classList.add("e-de-table-border-inside-preview-click"):this.previewDivTopCenter.classList.remove("e-de-table-border-inside-preview-click")):("Cell"!==this.ulelementShading.value&&"Table"!==this.ulelementShading.value&&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")))},_pi.prototype.getLineStyle=function(e){switch(e){case"Single":return 0;case"Dot":return 1;case"DashSmallGap":return 2;case"DashLargeGap":return 3;case"DashDot":return 4;case"DashDotDot":return 5;case"Double":return 6;case"Triple":return 7;case"ThinThickSmallGap":return 8;case"ThickThinSmallGap":return 9;case"ThinThickThinSmallGap":return 10;case"ThinThickMediumGap":return 11;case"ThickThinMediumGap":return 12;case"ThinThickThinMediumGap":return 13;case"ThinThickLargeGap":return 14;case"ThickThinLargeGap":return 15;case"ThinThickThinLargeGap":return 16;case"SingleWavy":return 17;case"DoubleWavy":return 18;case"DashDotStroked":return 29;case"Emboss3D":return 20;case"Engrave3D":return 21;case"Outset":return 22;case"Inset":return 23}return 0},_pi.prototype.destroy=function(){if(!je(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.paragraphFormat&&(this.paragraphFormat.destroy(),this.paragraphFormat=void 0),this.dialog=void 0,this.target=void 0,je(this.borderStyle)||this.borderStyle.destroy(),this.borderStyle=void 0,je(this.borderColorPicker)||this.borderColorPicker.destroy(),this.borderColorPicker=void 0,je(this.shadingColorPicker)||this.shadingColorPicker.destroy(),this.shadingColorPicker=void 0,je(this.ulelementShading)||this.ulelementShading.destroy(),this.removeEvents(),this.removeElements(),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,this.displayText=void 0,this.settingAndPreviewContainer=void 0,this.settingsContiner=void 0,this.styleContainer=void 0,this.previewContiner=void 0,this.previewSubContainer1=void 0,this.previewSubContainer2=void 0,this.styleSubContainer=void 0,this.dropdownListDiv=void 0,this.dropDownList=void 0,this.widthcontainerDiv=void 0,this.widthNumericDiv=void 0,this.widthNumeric=void 0,this.colorDiv=void 0,this.colorText=void 0,this.borderColorPickerElement=void 0,this.settingText=void 0,this.settingsSubContiner=void 0,this.noneDivContainer=void 0,this.noneDivLabel=void 0,this.boxDivContainer=void 0,this.boxDivLabel=void 0,this.allDivContainer=void 0,this.allDivLabel=void 0,this.customDivContainer=void 0,this.customDivLabel=void 0,this.previewDivHorizontalContainer=void 0,this.previewDivVerticalContainer=void 0,this.previewText=void 0,this.shadingText=void 0,this.shadings=void 0,this.colorPickerDiv=void 0,this.label=void 0,this.shadingColorPickerElement=void 0,this.shdApply=void 0,this.documentHelper=void 0},_pi.prototype.removeEvents=function(){this.noneDivContainer&&this.noneDivContainer.removeEventListener("click",this.handleSettingCheckBoxActionHandler),this.boxDivContainer&&this.boxDivContainer.removeEventListener("click",this.handleSettingCheckBoxActionHandler),this.allDivContainer&&this.allDivContainer.removeEventListener("click",this.handleSettingCheckBoxActionHandler),this.customDivContainer&&this.customDivContainer.removeEventListener("click",this.handleSettingCheckBoxActionHandler),this.previewDivBottomcenterContainer&&this.previewDivBottomcenterContainer.removeEventListener("click",this.handlePreviewCheckBoxActionHandler),this.previewDivBottomLeftContainer&&this.previewDivBottomLeftContainer.removeEventListener("click",this.handlePreviewCheckBoxActionHandler),this.previewDivBottomRightContainer&&this.previewDivBottomRightContainer.removeEventListener("click",this.handlePreviewCheckBoxActionHandler),this.previewDivTopBottomContainer&&this.previewDivTopBottomContainer.removeEventListener("click",this.handlePreviewCheckBoxActionHandler),this.previewDivTopCenterContainer&&this.previewDivTopCenterContainer.removeEventListener("click",this.handlePreviewCheckBoxActionHandler),this.previewDivTopTopContainer&&this.previewDivTopTopContainer.removeEventListener("click",this.handlePreviewCheckBoxActionHandler),this.previewDivDiagonalRightContainer&&this.previewDivDiagonalRightContainer.removeEventListener("click",this.handlePreviewCheckBoxActionHandler),this.previewDivLeftDiagonalContainer&&this.previewDivLeftDiagonalContainer.removeEventListener("click",this.handlePreviewCheckBoxActionHandler)},_pi.prototype.removeElements=function(){this.noneDivTransparent&&(this.noneDivTransparent.remove(),this.noneDivTransparent=void 0),this.boxDivTransparent&&(this.boxDivTransparent.remove(),this.boxDivTransparent=void 0),this.allDivTransparent&&(this.allDivTransparent.remove(),this.allDivTransparent=void 0),this.customDivTransparent&&(this.customDivTransparent.remove(),this.customDivTransparent=void 0),this.previewDiv&&(this.previewDiv.remove(),this.previewDiv=void 0),this.previewRightDiagonalDiv&&(this.previewRightDiagonalDiv.remove(),this.previewRightDiagonalDiv=void 0),this.previewLeftDiagonalDiv&&(this.previewLeftDiagonalDiv.remove(),this.previewLeftDiagonalDiv=void 0),this.previewVerticalDiv&&(this.previewVerticalDiv.remove(),this.previewVerticalDiv=void 0),this.previewHorizontalDiv&&(this.previewHorizontalDiv.remove(),this.previewHorizontalDiv=void 0),this.previewDivTopTopContainer&&(this.previewDivTopTopContainer.remove(),this.previewDivTopTopContainer=void 0),this.previewDivTopTop&&(this.previewDivTopTop.remove(),this.previewDivTopTop=void 0),this.previewDivTopCenterContainer&&(this.previewDivTopCenterContainer.remove(),this.previewDivTopCenterContainer=void 0),this.previewDivTopCenter&&(this.previewDivTopCenter.remove(),this.previewDivTopCenter=void 0),this.previewDivTopBottomContainer&&(this.previewDivTopBottomContainer.remove(),this.previewDivTopBottomContainer=void 0),this.previewDivTopBottom&&(this.previewDivTopBottom.remove(),this.previewDivTopBottom=void 0),this.previewDivLeftDiagonalContainer&&(this.previewDivLeftDiagonalContainer.remove(),this.previewDivLeftDiagonalContainer=void 0),this.previewDivLeftDiagonal&&(this.previewDivLeftDiagonal.remove(),this.previewDivLeftDiagonal=void 0),this.previewDivBottomLeftContainer&&(this.previewDivBottomLeftContainer.remove(),this.previewDivBottomLeftContainer=void 0),this.previewDivBottomLeft&&(this.previewDivBottomLeft.remove(),this.previewDivBottomLeft=void 0),this.previewDivBottomcenterContainer&&(this.previewDivBottomcenterContainer.remove(),this.previewDivBottomcenterContainer=void 0),this.previewDivBottomcenter&&(this.previewDivBottomcenter.remove(),this.previewDivBottomcenter=void 0),this.previewDivBottomRightContainer&&(this.previewDivBottomRightContainer.remove(),this.previewDivBottomRightContainer=void 0),this.previewDivBottomRight&&(this.previewDivBottomRight.remove(),this.previewDivBottomRight=void 0),this.previewDivDiagonalRightContainer&&(this.previewDivDiagonalRightContainer.remove(),this.previewDivDiagonalRightContainer=void 0),this.previewDivDiagonalRight&&(this.previewDivDiagonalRight.remove(),this.previewDivDiagonalRight=void 0),this.previewDivTopTopTransParent&&(this.previewDivTopTopTransParent.remove(),this.previewDivTopTopTransParent=void 0),this.previewDivTopCenterTransParent&&(this.previewDivTopCenterTransParent.remove(),this.previewDivTopCenterTransParent=void 0),this.previewDivTopBottomTransParent&&(this.previewDivTopBottomTransParent.remove(),this.previewDivTopBottomTransParent=void 0),this.previewDivLeftDiagonalTransParent&&(this.previewDivLeftDiagonalTransParent.remove(),this.previewDivLeftDiagonalTransParent=void 0),this.previewDivBottomLeftTransparent&&(this.previewDivBottomLeftTransparent.remove(),this.previewDivBottomLeftTransparent=void 0),this.previewDivBottomcenterTransparent&&(this.previewDivBottomcenterTransparent.remove(),this.previewDivBottomcenterTransparent=void 0),this.previewDivBottomRightTransparent&&(this.previewDivBottomRightTransparent.remove(),this.previewDivBottomRightTransparent=void 0),this.previewDivDiagonalRightTransparent&&(this.previewDivDiagonalRightTransparent.remove(),this.previewDivDiagonalRightTransparent=void 0),this.shadingContiner&&(this.shadingContiner.remove(),this.shadingContiner=void 0),this.noneDiv&&(this.noneDiv.remove(),this.noneDiv=void 0),this.customDiv&&(this.customDiv.remove(),this.customDiv=void 0),this.allDiv&&(this.allDiv.remove(),this.allDiv=void 0),this.boxDiv&&(this.boxDiv.remove(),this.boxDiv=void 0),this.displayText&&(this.displayText.remove(),this.displayText=void 0),this.settingAndPreviewContainer&&(this.settingAndPreviewContainer.remove(),this.settingAndPreviewContainer=void 0),this.settingsContiner&&(this.settingsContiner.remove(),this.settingsContiner=void 0),this.styleContainer&&(this.styleContainer.remove(),this.styleContainer=void 0),this.previewContiner&&(this.previewContiner.remove(),this.previewContiner=void 0),this.previewSubContainer1&&(this.previewSubContainer1.remove(),this.previewSubContainer1=void 0),this.previewSubContainer2&&(this.previewSubContainer2.remove(),this.previewSubContainer2=void 0),this.styleSubContainer&&(this.styleSubContainer.remove(),this.styleSubContainer=void 0),this.dropdownListDiv&&(this.dropdownListDiv.remove(),this.dropdownListDiv=void 0),this.dropDownList&&(this.dropDownList.remove(),this.dropDownList=void 0),this.widthcontainerDiv&&(this.widthcontainerDiv.remove(),this.widthcontainerDiv=void 0),this.widthNumericDiv&&(this.widthNumericDiv.remove(),this.widthNumericDiv=void 0),this.widthNumeric&&(this.widthNumeric.remove(),this.widthNumeric=void 0),this.colorDiv&&(this.colorDiv.remove(),this.colorDiv=void 0),this.colorText&&(this.colorText.remove(),this.colorText=void 0),this.borderColorPickerElement&&(this.borderColorPickerElement.remove(),this.borderColorPickerElement=void 0),this.settingText&&(this.settingText.remove(),this.settingText=void 0),this.settingsSubContiner&&(this.settingsSubContiner.remove(),this.settingsSubContiner=void 0),this.noneDivContainer&&(this.noneDivContainer.remove(),this.noneDivContainer=void 0),this.noneDivLabel&&(this.noneDivLabel.remove(),this.noneDivLabel=void 0),this.boxDivContainer&&(this.boxDivContainer.remove(),this.boxDivContainer=void 0),this.boxDivLabel&&(this.boxDivLabel.remove(),this.boxDivLabel=void 0),this.allDivContainer&&(this.allDivContainer.remove(),this.allDivContainer=void 0),this.allDivLabel&&(this.allDivLabel.remove(),this.allDivLabel=void 0),this.customDivContainer&&(this.customDivContainer.remove(),this.customDivContainer=void 0),this.customDivLabel&&(this.customDivLabel.remove(),this.customDivLabel=void 0),this.previewDivHorizontalContainer&&(this.previewDivHorizontalContainer.remove(),this.previewDivHorizontalContainer=void 0),this.previewDivVerticalContainer&&(this.previewDivVerticalContainer.remove(),this.previewDivVerticalContainer=void 0),this.previewText&&(this.previewText.remove(),this.previewText=void 0),this.shadingText&&(this.shadingText.remove(),this.shadingText=void 0),this.shadings&&(this.shadings.remove(),this.shadings=void 0),this.colorPickerDiv&&(this.colorPickerDiv.remove(),this.colorPickerDiv=void 0),this.label&&(this.label.remove(),this.label=void 0),this.shadingColorPickerElement&&(this.shadingColorPickerElement.remove(),this.shadingColorPickerElement=void 0),this.shdApply&&(this.shdApply.remove(),this.shdApply=void 0)};var Vpi=_pi;function _pi(e){var u=this;this.cellFormat=new $ri,this.tableFormat=new Jri,this.isShadingChanged=!1,this.handleSettingCheckBoxActionHandler=this.onhandleSettingCheckBoxActionClicked.bind(this),this.handlePreviewCheckBoxActionHandler=this.onhandlePreviewCheckBoxActionClicked.bind(this),this.applyBordersShadingsProperties=function(){var e=u.documentHelper.owner.tablePropertiesDialogModule,t=u.documentHelper.selection.start.paragraph.associatedCell,i=void 0,n=((u.checkClassName(u.previewDivTopTop)||u.checkClassName(u.previewDivTopBottom)||u.checkClassName(u.previewDivTopCenter)||u.checkClassName(u.previewDivBottomcenter)||u.checkClassName(u.previewDivBottomLeft)||u.checkClassName(u.previewDivBottomRight)||u.checkClassName(u.previewDivDiagonalRight)||u.checkClassName(u.previewDivLeftDiagonal))&&(i=new uri,u.checkClassName(u.previewDivTopTop)&&(i.top=u.getBorder("top")),u.checkClassName(u.previewDivTopBottom)&&(i.bottom=u.getBorder("bottom")),u.checkClassName(u.previewDivBottomLeft)&&(i.left=u.getBorder("left")),u.checkClassName(u.previewDivBottomRight)&&(i.right=u.getBorder("right")),u.checkClassName(u.previewDivTopCenter)&&(i.horizontal=u.getBorder("horizontal")),u.checkClassName(u.previewDivBottomcenter)&&(i.vertical=u.getBorder("vertical")),u.checkClassName(u.previewDivLeftDiagonal)&&(i.diagonalDown=u.getBorder("diagonalDown")),u.checkClassName(u.previewDivDiagonalRight))&&(i.diagonalUp=u.getBorder("diagonalUp")),new Xri),o=u.documentHelper.owner.editorModule;if(n.backgroundColor=u.shadingColorPicker.value,"Cell"===u.ulelementShading.value)e&&(e.isCellBordersAndShadingUpdated=!0),u.cellFormat.borders=new uri,je(i)?u.noneDiv.classList.contains("e-de-table-border-inside-setting-click")&&o.applyBordersInternal(u.cellFormat.borders,new uri):o.applyBordersInternal(u.cellFormat.borders,i),je(t.cellFormat.shading)||(n.foregroundColor=t.cellFormat.shading.foregroundColor,n.textureStyle=t.cellFormat.shading.textureStyle),u.cellFormat.shading=new Xri,o.applyShading(u.cellFormat.shading,n);else if("Table"===u.ulelementShading.value){e&&(e.isTableBordersAndShadingUpdated=!0);t=u.documentHelper.owner.selectionModule.tableFormat.table.tableFormat;if(u.tableFormat.copyFormat(t),u.tableFormat.borders=new uri,!je(i)||u.noneDiv.classList.contains("e-de-table-border-inside-setting-click"))for(var r=u.documentHelper.owner.selectionModule.tableFormat.table,s=0,a=r.childWidgets;s<a.length;s++){var l=a[s],h=(u.updateBorder(r.tableFormat.borders.left,l.rowFormat.borders.left),u.updateBorder(r.tableFormat.borders.top,l.rowFormat.borders.top),u.updateBorder(r.tableFormat.borders.right,l.rowFormat.borders.right),u.updateBorder(r.tableFormat.borders.bottom,l.rowFormat.borders.bottom),l.rowFormat.borders.horizontal),d=r.tableFormat.borders.horizontal,d=(("Single"===h.lineStyle&&"None"===d.lineStyle||"Cleared"===h.lineStyle&&"Cleared"===d.lineStyle)&&(d.lineStyle="Single",d.lineWidth=h.lineWidth),l.rowFormat.borders.vertical),h=r.tableFormat.borders.vertical;("Single"===d.lineStyle&&"None"===h.lineStyle||"Cleared"===d.lineStyle&&"Cleared"===h.lineStyle)&&(h.lineStyle="Single",h.lineWidth=d.lineWidth),l.rowFormat.borders.clearFormat();for(var p=0,c=l.childWidgets;p<c.length;p++)c[p].cellFormat.borders.clearFormat()}je(i)?u.noneDiv.classList.contains("e-de-table-border-inside-setting-click")&&o.applyBordersInternal(u.tableFormat.borders,new uri):o.applyBordersInternal(u.tableFormat.borders,i),je(t.shading)||(n.foregroundColor=t.shading.foregroundColor,n.textureStyle=t.shading.textureStyle),u.tableFormat.shading=new Xri,u.isShadingChanged=t.shading.backgroundColor!==n.backgroundColor,o.applyShading(u.tableFormat.shading,n)}else"Paragraph"===u.ulelementShading.value&&(e=u.noneDiv.classList.contains("e-de-table-border-inside-setting-click"),je(u.paragraphFormat)?o.onApplyParagraphFormat("borders",e?new uri:i,!1,!1):o.applyBordersInternal(u.paragraphFormat.borders,e?new uri:i));u.applyFormat(),u.closeDialog()},this.closeDialog=function(){u.documentHelper.dialog.hide(),u.closeBordersShadingsDialog()},this.closeBordersShadingsDialog=function(){u.paragraphFormat=void 0,u.documentHelper.dialog2.element.style.pointerEvents="",u.documentHelper.updateFocus()},this.handleSettingCheckBoxAction=function(e){var e=e.target.id,t=u.target.id;e===t+"_None_Div"||e===t+"_None_Div_Container"||e===t+"_None_Div_Transparent"?(u.updateClassForSettingDivElements(),u.noneDiv.classList.add("e-de-table-border-inside-setting-click"),u.setSettingPreviewDivElement("none")):e===t+"_Box_Div"||e===t+"_Box_Div_Container"||e===t+"_Box_Div_Transparent"?(u.updateClassForSettingDivElements(),u.boxDiv.classList.add("e-de-table-border-inside-setting-click"),u.setSettingPreviewDivElement("box")):e===t+"_All_Div"||e===t+"_All_Div_Container"||e===t+"_All_Div_Transparent"?(u.updateClassForSettingDivElements(),u.allDiv.classList.add("e-de-table-border-inside-setting-click"),u.setSettingPreviewDivElement("all")):(u.ulelementShading.value,u.updateClassForSettingDivElements(),u.customDiv.classList.add("e-de-table-border-inside-setting-click"),u.setSettingPreviewDivElement("customDiv"))},this.handlePreviewCheckBoxAction=function(e){var e=e.target.id,t=u.target.id,i="e-de-table-border-inside-preview-click";u.customDiv.click(),e===t+"_Preview_Div_TopTop_Container"||e===t+"_Preview_Div_TopTop"||e===t+"_previewDivTopTopTransParent"?(u.handlePreviewCheckBoxShowHide(t,i,u.previewDivTopTop),u.showHidePreviewDivElements(t,i,"_Preview_Div","_Preview_Div_TopTop","TopTop")):e===t+"_Preview_Div_TopCenter_Container"||e===t+"_Preview_Div_TopCenter"||e===t+"_previewDivTopCenterTransParent"?(u.handlePreviewCheckBoxShowHide(t,i,u.previewDivTopCenter),u.showHidePreviewDivElements(t,i,"_Preview_Div_Horizontal","_Preview_Div_TopCenter","TopCenter")):e===t+"_Preview_Div_TopBottom_Container"||e===t+"_Preview_Div_TopBottom"||e===t+"_previewDivTopBottomTransParent"?(u.handlePreviewCheckBoxShowHide(t,i,u.previewDivTopBottom),u.showHidePreviewDivElements(t,i,"_Preview_Div","_Preview_Div_TopBottom","TopBottom")):e===t+"_Preview_Div_LeftDiagonal_Container"||e===t+"_Preview_Div_LeftDiagonal"||e===t+"_previewDivLeftDiagonalTransParent"?(u.handlePreviewCheckBoxShowHide(t,i,u.previewDivLeftDiagonal),u.showHidePreviewDivElements(t,i,"_Preview_Div_Left_Diagonal","_Preview_Div_LeftDiagonal","LeftDiagonal")):e===t+"_Preview_Div_BottomLeft_Container"||e===t+"_Preview_Div_BottomLeft"||e===t+"_previewDivBottomLeftTransparent"?(u.handlePreviewCheckBoxShowHide(t,i,u.previewDivBottomLeft),u.showHidePreviewDivElements(t,i,"_Preview_Div","_Preview_Div_BottomLeft","BottomLeft")):e===t+"_Preview_Div_BottomCenter_Container"||e===t+"_Preview_Div_BottomCenter"||e===t+"_previewDivBottomcenterTransparent"?(u.handlePreviewCheckBoxShowHide(t,i,u.previewDivBottomcenter),u.showHidePreviewDivElements(t,i,"_Preview_Div_Vertical","_Preview_Div_BottomCenter","BottomCenter")):e===t+"_Preview_Div_BottomRight_Container"||e===t+"_Preview_Div_BottomRight"||e===t+"_previewDivBottomRightTransparent"?(u.handlePreviewCheckBoxShowHide(t,i,u.previewDivBottomRight),u.showHidePreviewDivElements(t,i,"_Preview_Div","_Preview_Div_BottomRight","BottomRight")):e!==t+"_Preview_Div_RightDiagonal_Container"&&e!==t+"_Preview_Div_RightDiagonal"&&e!==t+"_previewDivDiagonalRightTransparent"||(u.handlePreviewCheckBoxShowHide(t,i,u.previewDivDiagonalRight),u.showHidePreviewDivElements(t,i,"_Preview_Div_Right_Diagonal","_Preview_Div_RightDiagonal","RightDiagonal"))},this.applyTableCellPreviewBoxes=function(){je(u.ulelementShading)||("Cell"===u.ulelementShading.value?(u.shadingColorPicker.disabled=!1,u.previewDivBottomcenterContainer.style.visibility="hidden",u.previewDivTopCenterContainer.style.visibility="hidden",u.previewVerticalDiv.style.display="none",u.previewHorizontalDiv.style.display="none",u.previewDivLeftDiagonal.style.display="",u.previewDivDiagonalRight.style.display="",u.previewDivBottomRightContainer.style.left="80px",mt(u.noneDivTransparent,["e-de-table-border-none-setting"],["e-de-para-border-none-setting"]),mt(u.boxDivTransparent,["e-de-table-border-box-setting"],["e-de-para-border-box-setting"]),mt(u.allDivTransparent,["e-de-table-border-all-setting"],["e-de-para-border-shadow-setting"]),mt(u.customDivTransparent,["e-de-table-border-custom-setting"],["e-de-para-border-custom-setting"])):"Table"===u.ulelementShading.value?(u.shadingColorPicker.disabled=!1,u.previewDivLeftDiagonal.style.display="none",u.previewDivDiagonalRight.style.display="none",u.previewDivBottomcenterContainer.style.visibility="visible",u.previewDivTopCenterContainer.style.visibility="visible",u.previewVerticalDiv.style.display="",u.previewHorizontalDiv.style.display="",u.previewDivBottomRightContainer.style.left="110px",mt(u.noneDivTransparent,["e-de-table-border-none-setting"],["e-de-para-border-none-setting"]),mt(u.boxDivTransparent,["e-de-table-border-box-setting"],["e-de-para-border-box-setting"]),mt(u.allDivTransparent,["e-de-table-border-all-setting"],["e-de-para-border-shadow-setting"]),mt(u.customDivTransparent,["e-de-table-border-custom-setting"],["e-de-para-border-custom-setting"])):(u.shadingColorPicker.disabled=!0,u.previewDivBottomcenterContainer.style.visibility="hidden",u.previewDivTopCenterContainer.style.visibility="hidden",u.previewVerticalDiv.style.display="none",u.previewHorizontalDiv.style.display="none",u.previewLeftDiagonalDiv.style.display="none",u.previewRightDiagonalDiv.style.display="none",mt(u.noneDivTransparent,["e-de-para-border-none-setting"],["e-de-table-border-none-setting"]),mt(u.boxDivTransparent,["e-de-para-border-box-setting"],["e-de-table-border-box-setting"]),mt(u.allDivTransparent,["e-de-para-border-shadow-setting"],["e-de-table-border-all-setting"]),mt(u.customDivTransparent,["e-de-para-border-custom-setting"],["e-de-table-border-custom-setting"])))},this.applyPreviewTableBackgroundColor=function(e){je(e.currentValue)||(e=e.currentValue.hex,u.previewDiv.style.backgroundColor=e)},this.applyPreviewTableBorderColor=function(e){je(e.currentValue)||(e=e.currentValue.hex,u.previewDiv.style.borderColor=e,u.previewRightDiagonalDiv.style.backgroundColor=e,u.previewLeftDiagonalDiv.style.backgroundColor=e,u.previewVerticalDiv.style.backgroundColor=e,u.previewHorizontalDiv.style.backgroundColor=e)},this.documentHelper=e}Object.defineProperty(zpi.prototype,"tableFormat",{get:function(){return je(this.tableFormatIn)?this.tableFormatIn=new Jri:this.tableFormatIn},enumerable:!0,configurable:!0}),zpi.prototype.getModuleName=function(){return"TableOptionsDialog"},zpi.prototype.initTableOptionsDialog=function(e,t){this.target=Q("div",{id:this.documentHelper.owner.containerId+"_insertCellMarginsDialog",className:"e-de-table-options-dlg"}),this.innerDiv=Q("div"),this.innerDivLabel=Q("Label",{id:this.target.id+"_innerDivLabel",className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Default cell margins")}),this.innerDiv.appendChild(this.innerDivLabel),jpi.getCellMarginDialogElements(this,this.innerDiv,e,!1),this.div=Q("div"),this.cellSpaceLabel=Q("Label",{className:"e-de-para-dlg-heading",id:this.target.id+"_cellSpaceLabel"}),this.cellSpaceLabel.innerHTML=e.getConstant("Default cell spacing"),this.div.appendChild(this.cellSpaceLabel),this.table2=Q("TABLE",{styles:"height: 30px;"}),this.tr3=Q("tr"),this.td5=Q("td"),this.allowSpaceCheckBox1=Q("input",{attrs:{type:"checkbox"},id:this.target.id+"_cellcheck"}),this.td6=Q("td",{styles:t?"padding-right:25px;":"padding-left:25px;"}),this.cellspacingTextBox=Q("input",{attrs:{type:"text"},id:this.target.id+"_cellspacing"}),this.td5.appendChild(this.allowSpaceCheckBox1),this.td6.appendChild(this.cellspacingTextBox),this.tr3.appendChild(this.td5),this.tr3.appendChild(this.td6),this.table2.appendChild(this.tr3),this.div.appendChild(this.table2),this.divBtn=document.createElement("div"),this.target.appendChild(this.div),this.target.appendChild(this.divBtn),this.cellSpaceTextBox=new NL({value:0,min:0,max:264.5,width:174,decimals:2,enablePersistence:!1}),this.cellSpaceTextBox.appendTo(this.cellspacingTextBox),this.allowSpaceCheckBox=new ib({label:e.getConstant("Allow spacing between cells"),change:this.changeAllowSpaceCheckBox,enableRtl:t,cssClass:"e-de-tbl-margin-sub-header"}),this.allowSpaceCheckBox.appendTo(this.allowSpaceCheckBox1),this.allowSpaceCheckBox1.setAttribute("aria-label",e.getConstant("Allow spacing between cells")),this.cellspacingTextBox.setAttribute("aria-label","cell spacing")},zpi.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,0<e.cellSpacing?(this.allowSpaceCheckBox.checked=!0,this.cellSpaceTextBox.enabled=!0):(this.allowSpaceCheckBox.checked=!1,this.cellSpaceTextBox.enabled=!1)},zpi.prototype.applySubTableOptions=function(e,t){this.documentHelper.owner.editorHistoryModule.initComplexHistory(this.documentHelper.selection,"TableMarginsSelection"),this.applyTableOptionsHistory(e,t),je(this.documentHelper.owner.editorHistoryModule.currentHistoryInfo)||this.documentHelper.owner.editorHistoryModule.updateComplexHistory()},zpi.prototype.applyTableOptionsHelper=function(e){this.applySubTableOptionsHelper(e,void 0)},zpi.prototype.applyTableOptionsHistory=function(e,t){this.documentHelper.owner.editorModule.initHistory("TableOptions"),this.applySubTableOptionsHelper(e,t)},zpi.prototype.applySubTableOptionsHelper=function(e,t){var i=(t=je(t)?(t=this.documentHelper.selection.start.currentWidget.paragraph.associatedCell.ownerTable).combineWidget(this.documentHelper.owner.viewer):t).tableFormat;je(this.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo)||this.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo.addModifiedTableOptions(i),i.cellSpacing=e.cellSpacing,i.leftMargin=e.leftMargin,i.topMargin=e.topMargin,i.rightMargin=e.rightMargin,i.bottomMargin=e.bottomMargin,this.documentHelper.owner.tablePropertiesDialogModule.calculateGridValue(t)},zpi.prototype.applyTableOptions=function(e){e.leftMargin=this.leftMarginBox.value,e.topMargin=this.topMarginBox.value,e.bottomMargin=this.bottomMarginBox.value,e.rightMargin=this.rightMarginBox.value,e.cellSpacing=this.cellSpaceTextBox.value},zpi.prototype.show=function(){var e=new Cn("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()},zpi.prototype.destroy=function(){if(!je(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.tableFormatIn&&(this.tableFormatIn.destroy(),this.tableFormatIn=void 0),this.removeElements(),this.dialog=void 0,this.target=void 0,this.documentHelper=void 0,this.cellspacingTextBox=void 0,this.allowSpaceCheckBox=void 0},zpi.prototype.removeElements=function(){this.innerDiv&&(this.innerDiv.remove(),this.innerDiv=void 0),this.innerDivLabel&&(this.innerDivLabel.remove(),this.innerDivLabel=void 0),this.div&&(this.div.remove(),this.div=void 0),this.cellSpaceLabel&&(this.cellSpaceLabel.remove(),this.cellSpaceLabel=void 0),this.table2&&(this.table2.remove(),this.table2=void 0),this.tr3&&(this.tr3.remove(),this.tr3=void 0),this.td5&&(this.td5.remove(),this.td5=void 0),this.allowSpaceCheckBox1&&(this.allowSpaceCheckBox1.remove(),this.allowSpaceCheckBox1=void 0),this.td6&&(this.td6.remove(),this.td6=void 0),this.divBtn&&(this.divBtn.remove(),this.divBtn=void 0)};var Hpi=zpi;function zpi(e){var t=this;this.applyTableCellProperties=function(){var e=t.documentHelper.selection.tableFormat;je(t.bottomMarginBox.value||t.leftMarginBox.value||t.rightMarginBox.value||t.topMarginBox.value||t.cellSpaceTextBox.value)||e.bottomMargin===t.bottomMarginBox.value&&e.leftMargin===t.leftMarginBox.value&&e.rightMargin===t.rightMarginBox.value&&e.topMargin===t.topMarginBox.value&&e.cellSpacing===t.cellSpaceTextBox.value||(t.documentHelper.owner.tablePropertiesDialogModule.isTableOptionsUpdated=!0,t.applyTableOptions(t.tableFormat),t.documentHelper.owner.tablePropertiesDialogModule.applyTableSubProperties()),t.closeCellMarginsDialog()},this.closeCellMarginsDialog=function(){t.documentHelper.dialog.hide(),t.documentHelper.dialog.element.style.pointerEvents="",t.documentHelper.updateFocus()},this.changeAllowSpaceCheckBox=function(){t.allowSpaceCheckBox.checked?t.cellSpaceTextBox.enabled=!0:(t.cellSpaceTextBox.enabled=!1,t.cellSpaceTextBox.value=0)},this.removeEvents=function(){t.documentHelper.dialog2.element.style.pointerEvents="",t.documentHelper.updateFocus()},this.documentHelper=e}Object.defineProperty(Wpi.prototype,"cellFormat",{get:function(){return je(this.cellFormatIn)?this.cellFormatIn=new $ri:this.cellFormatIn},enumerable:!0,configurable:!0}),Wpi.prototype.getModuleName=function(){return"CellOptionsDialog"},Wpi.prototype.onChangeSameAsTable=function(){this.changeSameAsTable()},Wpi.prototype.initCellMarginsDialog=function(e,t){this.owner=this.documentHelper.owner.viewer,this.target=Q("div",{className:"e-de-table-cell-margin-dlg"}),this.innerDiv=Q("div"),this.innerDivLabel=Q("Label",{className:"e-de-para-dlg-heading"}),this.innerDivLabel.innerHTML=e.getConstant("Cell margins"),this.innerDiv.appendChild(this.innerDivLabel),this.table=Q("TABLE",{styles:"padding-bottom: 8px;padding-top: 8px;",className:"e-de-cell-margin-top"}),this.tr=Q("tr"),this.td=Q("td",{className:"e-de-tbl-btn-separator"});var i=Q("input",{attrs:{type:"checkbox"},id:this.target.id+"_sameAsCheckBox"});i.setAttribute("aria-label",e.getConstant("Same as the whole table")),this.td.appendChild(i),this.tr.appendChild(this.td),this.table.appendChild(this.tr),this.innerDiv.appendChild(this.table),Wpi.getCellMarginDialogElements(this,this.innerDiv,e,!0),this.divBtn=document.createElement("div"),this.target.appendChild(this.divBtn),this.sameAsTableCheckBox=new ib({label:e.getConstant("Same as the whole table"),change:this.changeSameAsTable,enableRtl:t}),i.setAttribute("aria-label",e.getConstant("Same as the whole table")),this.sameAsTableCheckBox.appendTo(i),this.sameAsTableCheckBox.addEventListener("change",this.changeSameAsTableClickHandler)},Wpi.prototype.show=function(){var e=new Cn("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:"center"},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()},Wpi.prototype.loadCellMarginsDialog=function(){var e,t=this.documentHelper.selection.cellFormat;this.sameAsTable=je(t.leftMargin||t.topMargin||t.rightMargin||t.bottomMargin),this.sameAsTable?(e=this.documentHelper.selection.tableFormat,this.loadCellProperties(e,!1,!0)):this.loadCellProperties(t,!0,!1)},Wpi.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},Wpi.prototype.applySubCellOptions=function(e){this.documentHelper.owner.editorHistoryModule.initComplexHistory(this.documentHelper.selection,"CellMarginsSelection"),this.documentHelper.owner.editorModule.initHistory("CellOptions"),je(this.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo)||(this.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo.insertedFormat=e),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),je(this.documentHelper.owner.editorHistoryModule.currentHistoryInfo)||this.documentHelper.owner.editorHistoryModule.updateComplexHistory()},Wpi.prototype.applyCellMarginValue=function(e,t,i,n){this.applyCellMarginsInternal(e,n),i.paragraph.associatedCell.ownerRow===e||je(e=e.nextWidget)||this.applyCellMarginValue(e,t,i,n)},Wpi.prototype.applyCellMarginsInternal=function(e,t){var i;je(this.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo)||(i=e.childWidgets[0].cellFormat,t=this.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo.addModifiedCellOptions(i,t,e.ownerTable)),je(t)||this.applyCellMarginsForCells(e,t)},Wpi.prototype.applyCellMarginsForCells=function(e,t){e=e.childWidgets;this.iterateCells(e,t)},Wpi.prototype.iterateCells=function(e,t){for(var i=0;i<e.length;i++)this.applySubCellMargins(e[parseInt(i.toString(),10)].cellFormat,t);this.documentHelper.owner.tablePropertiesDialogModule.calculateGridValue(e[0].ownerTable)},Wpi.prototype.applySubCellMargins=function(e,t){e.leftMargin=t.leftMargin,e.topMargin=t.topMargin,e.rightMargin=t.rightMargin,e.bottomMargin=t.bottomMargin},Wpi.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)},Wpi.prototype.destroy=function(){if(!je(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[parseInt(e.toString(),10)]),e--;this.target=void 0}this.removeElements(),this.unWireEvents(),this.dialog=void 0,this.target=void 0,this.documentHelper=void 0,this.sameAsTableCheckBox=void 0},Wpi.prototype.removeElements=function(){this.table&&(this.table.remove(),this.table=void 0),this.innerDiv&&(this.innerDiv.remove(),this.innerDiv=void 0),this.innerDivLabel&&(this.innerDivLabel.remove(),this.innerDivLabel=void 0),this.tr&&(this.tr.remove(),this.tr=void 0),this.td&&(this.td.remove(),this.td=void 0),this.divBtn&&(this.divBtn.remove(),this.divBtn=void 0)},Wpi.prototype.unWireEvents=function(){this.sameAsTableCheckBox&&this.sameAsTableCheckBox.removeEventListener("change",this.changeSameAsTableClickHandler)},Wpi.getCellMarginDialogElements=function(e,t,i,n){var o,r,s,a,l,h,d,p;je(e)||(o=Q("div"),r=Q("div",{className:"e-de-container-row"}),l=Q("div",{className:"e-de-subcontainer-left"}),s=Q("input",{attrs:{type:"text"},styles:"width:100%"}),l.appendChild(s),h=Q("div",{className:"e-de-subcontainer-right"}),a=Q("input",{attrs:{type:"text"},styles:"width:100%"}),h.appendChild(a),r.appendChild(l),r.appendChild(h),l=Q("div",{className:n?"e-de-dlg-row":"e-de-container-row"}),h=Q("div",{className:"e-de-subcontainer-left"}),n=Q("input",{attrs:{type:"text"},styles:"width:100%"}),h.appendChild(n),d=Q("div",{className:"e-de-subcontainer-right"}),p=Q("input",{attrs:{type:"text"},styles:"width:100%"}),d.appendChild(p),l.appendChild(h),l.appendChild(d),o.appendChild(r),o.appendChild(l),t.appendChild(o),e.target.appendChild(t),e.topMarginBox=new NL({value:0,min:0,max:1584,decimals:2,enablePersistence:!1,placeholder:i.getConstant("Top"),floatLabelType:"Always"}),e.topMarginBox.appendTo(s),e.leftMarginBox=new NL({value:0,min:0,max:1584,decimals:2,enablePersistence:!1,placeholder:i.getConstant("Left"),floatLabelType:"Always"}),e.leftMarginBox.appendTo(a),e.bottomMarginBox=new NL({value:0,min:0,max:1584,decimals:2,enablePersistence:!1,placeholder:i.getConstant("Bottom"),floatLabelType:"Always"}),e.bottomMarginBox.appendTo(n),e.rightMarginBox=new NL({value:0,min:0,max:1584,decimals:2,enablePersistence:!1,placeholder:i.getConstant("Right"),floatLabelType:"Always"}),e.rightMarginBox.appendTo(p),p.setAttribute("aria-labelledby",i.getConstant("Right")),a.setAttribute("aria-labelledby",i.getConstant("Left")),n.setAttribute("aria-labelledby",i.getConstant("Bottom")),s.setAttribute("aria-labelledby",i.getConstant("Top")))};var jpi=Wpi;function Wpi(e){var t=this;this.changeSameAsTableClickHandler=this.onChangeSameAsTable.bind(this),this.removeEvents=function(){t.documentHelper.dialog2.element.style.pointerEvents="",t.documentHelper.updateFocus()},this.changeSameAsTable=function(){t.sameAsTableCheckBox.checked?(t.leftMarginBox.enabled=!1,t.rightMarginBox.enabled=!1,t.bottomMarginBox.enabled=!1,t.topMarginBox.enabled=!1):(t.leftMarginBox.enabled=!0,t.rightMarginBox.enabled=!0,t.bottomMarginBox.enabled=!0,t.topMarginBox.enabled=!0)},this.applyTableCellProperties=function(){var e=t.documentHelper.selection.cellFormat;je(t.bottomMarginBox.value||t.leftMarginBox.value||t.rightMarginBox.value||t.topMarginBox.value)||e.bottomMargin===t.bottomMarginBox.value&&e.leftMargin===t.leftMarginBox.value&&e.rightMargin===t.rightMarginBox.value&&e.topMargin===t.topMarginBox.value||(t.documentHelper.owner.tablePropertiesDialogModule.isCellOptionsUpdated=!0,t.applyTableOptions(t.cellFormat),t.documentHelper.owner.tablePropertiesDialogModule.applyTableSubProperties()),t.closeCellMarginsDialog()},this.closeCellMarginsDialog=function(){t.documentHelper.dialog.hide(),t.documentHelper.dialog.element.style.pointerEvents=""},this.documentHelper=e}Upi.prototype.getModuleName=function(){return"StylesDialog"},Upi.prototype.initStylesDialog=function(e,t,i){var n=this.documentHelper.owner.containerId+"_insert_styles",n=(this.target=Q("div",{id:n,className:"e-de-styles"}),e.getConstant("Styles"));this.dlgFields=Q("div",{innerHTML:n,className:"e-de-para-dlg-heading"}),this.target.appendChild(this.dlgFields),this.commonDiv=Q("div",{className:"e-styles-common"}),this.target.appendChild(this.commonDiv),this.searchDiv=Q("div",{className:"e-styles-list"}),this.commonDiv.appendChild(this.searchDiv),i&&this.searchDiv.classList.add("e-de-rtl"),this.listviewDiv=Q("div",{className:"e-styles-listViewDiv",id:"styles_listview"}),this.searchDiv.appendChild(this.listviewDiv),this.listviewInstance=new MH({dataSource:t,cssClass:"e-styles-listview",fields:{text:"StyleName",iconCss:"IconClass"},showIcon:!0}),this.listviewInstance.appendTo(this.listviewDiv),this.listviewInstance.addEventListener("select",this.selecHandlerClickHandler),this.buttonDiv=Q("div",{className:"e-styles-button"}),this.commonDiv.appendChild(this.buttonDiv),this.newButtonDiv=Q("div",{className:"e-styles-addbutton"}),this.buttonDiv.appendChild(this.newButtonDiv),this.newButtonElement=Q("button",{innerHTML:e.getConstant("New")+"...",id:"new",attrs:{type:"button"}}),this.newButtonDiv.appendChild(this.newButtonElement),this.newbutton=new zv({cssClass:"e-button-custom"}),this.newbutton.appendTo(this.newButtonElement),this.newButtonElement.addEventListener("click",this.addNewStyleClickHandler),this.modifybuttonDiv=Q("div",{className:"e-styles-addbutton"}),this.buttonDiv.appendChild(this.modifybuttonDiv),this.modifyButtonElement=Q("button",{innerHTML:e.getConstant("Modify")+"...",id:"modify",attrs:{type:"button"}}),this.modifybuttonDiv.appendChild(this.modifyButtonElement),this.addbutton=new zv({cssClass:"e-button-custom"}),this.addbutton.appendTo(this.modifyButtonElement),this.modifyButtonElement.addEventListener("click",this.modifyStyleClickHandler)},Upi.prototype.show=function(){for(var e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),t=(e.setLocale(this.documentHelper.owner.locale),this.updateStyleNames("Paragraph").filter(function(e){return"Paragraph"===e.Type})),i=this.updateStyleNames("Paragraph").filter(function(e){return"Linked"===e.Type}),n=this.updateStyleNames("Character").filter(function(e){return"Character"===e.Type}),o=0,r=i;o<r.length;o++)for(var s=r[o],a=0,l=n;a<l.length;a++){var h=l[a];if(s.StyleName+" Char"===h.StyleName){n.splice(n.indexOf(h),1);break}}t=t.concat(i,n);this.localValue=e,this.initStylesDialog(e,t,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()},Upi.prototype.updateStyleNames=function(e){for(var t=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),i=(t.setLocale(this.documentHelper.owner.locale),this.documentHelper.owner.documentHelper.styles.getStyles(e)),n=[],o=0;o<i.length;o++){var r=t.getConstant(i[parseInt(o.toString(),10)].name);""===r&&(r=i[parseInt(o.toString(),10)].name),"Paragraph"===i[parseInt(o.toString(),10)].type?n.push({StyleName:r,IconClass:"e-de-listview-icon e-de-e-paragraph-style-mark e-icons",Type:i[parseInt(o.toString(),10)].type}):"Character"===i[parseInt(o.toString(),10)].type?n.push({StyleName:r,IconClass:"e-de-listview-icon e-de-e-character-style-mark e-icons",Type:i[parseInt(o.toString(),10)].type}):n.push({StyleName:r,IconClass:"e-de-listview-icon e-de-e-linked-style-mark e-icons",Type:i[parseInt(o.toString(),10)].type})}return n},Upi.prototype.defaultStyleName=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[parseInt(i.toString(),10)]);return t},Upi.prototype.onModifyStyleClick=function(){this.modifyStyles()},Upi.prototype.onSelecHandlerClick=function(e){this.selectHandler(e)},Upi.prototype.getStyleName=function(e){var t=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);return t.setLocale(this.documentHelper.owner.locale),t.getConstant("Heading 1")===e?e="Heading 1":t.getConstant("Heading 2")===e?e="Heading 2":t.getConstant("Heading 3")===e?e="Heading 3":t.getConstant("Heading 4")===e?e="Heading 4":t.getConstant("Heading 5")===e?e="Heading 5":t.getConstant("Heading 6")===e?e="Heading 6":t.getConstant("Normal")===e?e="Normal":t.getConstant("Header")===e?e="Header":t.getConstant("Footer")===e&&(e="Footer"),e},Upi.prototype.hideObjects=function(){this.documentHelper.dialog.hide(),this.documentHelper.updateFocus()},Upi.prototype.onAddNewStyleClick=function(){this.addNewStyles()},Upi.prototype.destroy=function(){this.listviewInstance&&(this.listviewInstance.destroy(),this.listviewInstance=void 0),this.removeEvents(),this.removeElements(),this.documentHelper=void 0,this.styleName=void 0,this.localValue=void 0,this.target=void 0},Upi.prototype.removeEvents=function(){this.newButtonElement&&this.newButtonElement.removeEventListener("click",this.addNewStyleClickHandler),this.modifyButtonElement&&this.modifyButtonElement.removeEventListener("click",this.modifyStyleClickHandler),this.listviewInstance&&this.listviewInstance.removeEventListener("select",this.selecHandlerClickHandler)},Upi.prototype.removeElements=function(){this.dlgFields&&(this.dlgFields.remove(),this.dlgFields=void 0),this.commonDiv&&(this.commonDiv.remove(),this.commonDiv=void 0),this.searchDiv&&(this.searchDiv.remove(),this.searchDiv=void 0),this.listviewDiv&&(this.listviewDiv.remove(),this.listviewDiv=void 0),this.buttonDiv&&(this.buttonDiv.remove(),this.buttonDiv=void 0),this.newButtonDiv&&(this.newButtonDiv.remove(),this.newButtonDiv=void 0),this.newButtonElement&&(this.newButtonElement.remove(),this.newButtonElement=void 0),this.newbutton&&(this.newbutton.destroy(),this.newbutton=void 0),this.modifybuttonDiv&&(this.modifybuttonDiv.remove(),this.modifybuttonDiv=void 0),this.modifyButtonElement&&(this.modifyButtonElement.remove(),this.modifyButtonElement=void 0),this.addbutton&&(this.addbutton.destroy(),this.addbutton=void 0)};var Qpi=Upi;function Upi(e){var t=this;this.selecHandlerClickHandler=this.onSelecHandlerClick.bind(this),this.addNewStyleClickHandler=this.onAddNewStyleClick.bind(this),this.modifyStyleClickHandler=this.onModifyStyleClick.bind(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=t.getStyleName(e.text)},this.addNewStyles=function(){t.documentHelper.dialog.hide(),t.documentHelper.owner.styleDialogModule.show()},this.documentHelper=e}Object.defineProperty(Gpi.prototype,"parent",{get:function(){return this.documentHelper.owner},enumerable:!0,configurable:!0}),Gpi.prototype.getModuleName=function(){return"SpellCheckDialog"},Gpi.prototype.onSelectHandlerClick=function(e){this.selectHandler(e)},Gpi.prototype.onIgnoreClick=function(){this.onIgnoreClicked()},Gpi.prototype.removeErrors=function(){var e;!je(this.errorText)&&this.parent.spellCheckerModule.errorWordCollection.containsKey(this.errorText)&&((e=this.parent.spellCheckerModule.errorWordCollection.get(this.errorText)).splice(0,1),0===e.length)&&this.parent.spellCheckerModule.errorWordCollection.remove(this.errorText),0===this.parent.spellCheckerModule.errorWordCollection.length&&this.documentHelper.hideDialog()},Gpi.prototype.onIgnoreAllClick=function(){this.onIgnoreAllClicked()},Gpi.prototype.onAddToDictClick=function(){this.addToDictClicked()},Gpi.prototype.onChangeButtonClick=function(){this.changeButtonClicked()},Gpi.prototype.onChangeAllButtonClick=function(){this.changeAllButtonClicked()},Gpi.prototype.show=function(e,t){this.target=void 0,this.localValue=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),this.localValue.setLocale(this.documentHelper.owner.locale),this.target||this.updateSuggestionDialog(e,t)},Gpi.prototype.updateSuggestionDialog=function(t,e){var i,n=this;this.elementBox=e,this.isSpellChecking?this.parent.spellCheckerModule.callSpellChecker(this.parent.spellCheckerModule.languageID,t,!1,!0).then(function(e){e=JSON.parse(e);i=e.Suggestions,n.isSpellChecking=!1,n.handleRetrievedSuggestion(t,i)}):(t=this.parent.spellCheckerModule.manageSpecialCharacters(t,void 0,!0),i=this.parent.spellCheckerModule.errorSuggestions.containsKey(t)?this.parent.spellCheckerModule.errorSuggestions.get(t):[],this.handleRetrievedSuggestion(t,i))},Gpi.prototype.handleRetrievedSuggestion=function(e,t){e=this.parent.spellCheckerModule.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=this.localValue.getConstant("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(),BA(this.documentHelper.dialog.element)},Gpi.prototype.initSpellCheckDialog=function(e,t,i,n){var o=this.documentHelper.owner.containerId+"_add_SpellCheck";this.target=Q("div",{id:o,className:"e-de-insert-spellchecker"}),this.errorText=t,this.textContainer=Q("div",{className:"e-de-dlg-sub-header",innerHTML:e.getConstant("Spelling")}),this.target.appendChild(this.textContainer),this.spellContainer=Q("div",{className:"e-de-spellcheck-error-container"}),this.listviewDiv=Q("div",{className:"e-de-dlg-spellcheck-listview"}),this.spellContainer.appendChild(this.listviewDiv),this.spellingListView=new MH({dataSource:[t],cssClass:"e-dlg-spellcheck-listitem"}),this.spellingListView.appendTo(this.listviewDiv),this.buttonDiv=Q("div",{className:"e-de-spellcheck-btncontainer"}),this.spellContainer.appendChild(this.buttonDiv),this.ignoreButtonElement=Q("button",{innerHTML:e.getConstant("Ignore")}),this.buttonDiv.appendChild(this.ignoreButtonElement),this.ignoreButtonElement.setAttribute("aria-label",e.getConstant("Ignore")),this.ignorebutton=new zv({cssClass:"e-control e-de-ok-button e-de-spellcheck-btn"}),this.ignorebutton.appendTo(this.ignoreButtonElement),this.ignoreButtonElement.addEventListener("click",this.ignoreClickHandler),this.ignoreAllButtonElement=Q("button",{innerHTML:e.getConstant("Ignore All")}),this.ignoreAllButtonElement.setAttribute("aria-label",e.getConstant("Ignore All")),this.buttonDiv.appendChild(this.ignoreAllButtonElement),this.ignoreAllbutton=new zv({cssClass:"e-control e-de-ok-button e-de-spellcheck-btn"}),this.ignoreAllbutton.appendTo(this.ignoreAllButtonElement),this.ignoreAllButtonElement.addEventListener("click",this.ignoreAllClickHandler),this.addDictButtonElement=Q("button",{innerHTML:e.getConstant("Add to Dictionary")}),this.addDictButtonElement.setAttribute("aria-label",e.getConstant("Add to Dictionary")),this.buttonDiv.appendChild(this.addDictButtonElement),this.addDictButton=new zv({cssClass:"e-control e-de-ok-button e-de-spellcheck-btn"}),this.addDictButton.appendTo(this.addDictButtonElement),this.addDictButtonElement.addEventListener("click",this.addToDictClickHandler),this.target.appendChild(this.spellContainer),this.suggestionDiv=Q("div",{className:"e-de-dlg-sub-header",innerHTML:e.getConstant("Suggestions")}),this.target.appendChild(this.suggestionDiv),this.suggestionContainer=Q("div",{className:"e-de-spellcheck-suggestion-container"}),this.target.appendChild(this.suggestionContainer),this.suggestListDiv=Q("div",{className:"e-de-dlg-spellcheck-listview"}),this.suggestListDiv.setAttribute("aria-label",e.getConstant("Suggestions")),this.suggestionContainer.appendChild(this.suggestListDiv),this.suggestionListView=new MH({dataSource:i,cssClass:"e-dlg-spellcheck-listitem"}),this.suggestionListView.appendTo(this.suggestListDiv),this.suggestionListView.addEventListener("select",this.selectHandlerClickHandler),this.suggestBtnContainder=Q("div",{className:"e-de-spellcheck-btncontainer"}),this.suggestionContainer.appendChild(this.suggestBtnContainder),this.changeButtonElement=Q("button",{innerHTML:e.getConstant("Change")}),this.changeButtonElement.setAttribute("aria-label",e.getConstant("Change")),this.suggestBtnContainder.appendChild(this.changeButtonElement),this.changeButton=new zv({cssClass:"e-control e-de-ok-button e-de-spellcheck-btn"}),this.changeButton.appendTo(this.changeButtonElement),this.changeButtonElement.addEventListener("click",this.changeButtonClickHandler),this.changeAllButtonElement=Q("button",{innerHTML:e.getConstant("Change All")}),this.changeAllButtonElement.setAttribute("aria-label",e.getConstant("Change All")),this.suggestBtnContainder.appendChild(this.changeAllButtonElement),this.changeAllbutton=new zv({cssClass:"e-control e-de-ok-button e-de-spellcheck-btn"}),this.changeAllbutton.appendTo(this.changeAllButtonElement),this.changeAllButtonElement.addEventListener("click",this.onChangeAllButtonClickHandler),!je(i)&&0!==i.length||(this.changeButton.disabled=!0,this.changeAllbutton.disabled=!0)},Gpi.prototype.destroy=function(){this.target&&(this.target.remove(),this.target=void 0),this.elementBox&&(this.elementBox.destroy(),this.elementBox=void 0),this.documentHelper=void 0,this.spellingListView&&(this.spellingListView.destroy(),this.spellingListView=void 0),this.suggestionListView&&(this.suggestionListView.destroy(),this.suggestionListView=void 0),this.selectedText=void 0,this.removeEvents(),this.removeElements()},Gpi.prototype.removeEvents=function(){this.ignoreButtonElement&&this.ignoreButtonElement.removeEventListener("click",this.ignoreClickHandler),this.ignoreAllButtonElement&&this.ignoreAllButtonElement.removeEventListener("click",this.ignoreAllClickHandler),this.addDictButtonElement&&this.addDictButtonElement.removeEventListener("click",this.addToDictClickHandler),this.changeButtonElement&&this.changeButtonElement.removeEventListener("click",this.changeButtonClickHandler),this.changeAllButtonElement&&this.changeAllButtonElement.removeEventListener("click",this.onChangeAllButtonClickHandler),this.suggestionListView&&this.suggestionListView.removeEventListener("select",this.selectHandlerClickHandler)},Gpi.prototype.removeElements=function(){this.textContainer&&(this.textContainer.remove(),this.textContainer=void 0),this.spellContainer&&(this.spellContainer.remove(),this.spellContainer=void 0),this.listviewDiv&&(this.listviewDiv.remove(),this.listviewDiv=void 0),this.buttonDiv&&(this.buttonDiv.remove(),this.buttonDiv=void 0),this.ignoreButtonElement&&(this.ignoreButtonElement.remove(),this.ignoreButtonElement=void 0),this.ignorebutton&&(this.ignorebutton.destroy(),this.ignorebutton=void 0),this.ignoreAllButtonElement&&(this.ignoreAllButtonElement.remove(),this.ignoreAllButtonElement=void 0),this.ignoreAllbutton&&(this.ignoreAllbutton.destroy(),this.ignoreAllbutton=void 0),this.addDictButtonElement&&(this.addDictButtonElement.remove(),this.addDictButtonElement=void 0),this.addDictButton&&(this.addDictButton.destroy(),this.addDictButton=void 0),this.suggestionDiv&&(this.suggestionDiv.remove(),this.suggestionDiv=void 0),this.suggestionContainer&&(this.suggestionContainer.remove(),this.suggestionContainer=void 0),this.suggestListDiv&&(this.suggestListDiv.remove(),this.suggestListDiv=void 0),this.suggestBtnContainder&&(this.suggestBtnContainder.remove(),this.suggestBtnContainder=void 0),this.changeButtonElement&&(this.changeButtonElement.remove(),this.changeButtonElement=void 0),this.changeButton&&(this.changeButton.destroy(),this.changeButton=void 0),this.changeAllButtonElement&&(this.changeAllButtonElement.remove(),this.changeAllButtonElement=void 0),this.changeAllbutton&&(this.changeAllbutton.destroy(),this.changeAllbutton=void 0)};var qpi=Gpi;function Gpi(e){var a=this;this.ignoreClickHandler=this.onIgnoreClick.bind(this),this.ignoreAllClickHandler=this.onIgnoreAllClick.bind(this),this.addToDictClickHandler=this.onAddToDictClick.bind(this),this.selectHandlerClickHandler=this.onSelectHandlerClick.bind(this),this.changeButtonClickHandler=this.onChangeButtonClick.bind(this),this.onChangeAllButtonClickHandler=this.onChangeAllButtonClick.bind(this),this.selectHandler=function(e){a.selectedText=e.text},this.onCancelButtonClick=function(){a.documentHelper.clearSelectionHighlight(),a.documentHelper.hideDialog()},this.onIgnoreClicked=function(){je(a.elementBox)||(kA(a.documentHelper.dialog.element),a.parent.spellCheckerModule.manageReplace("Ignore Once",a.elementBox),a.removeErrors(),a.parent.spellCheckerModule.checkForNextError(),BA(a.documentHelper.dialog.element))},this.onIgnoreAllClicked=function(){var e;je(a.elementBox)||(kA(a.documentHelper.dialog.element),e=a.elementBox.text,a.parent.spellCheckerModule.handleIgnoreAllItems({element:a.elementBox,text:e}),a.parent.spellCheckerModule.checkForNextError(),BA(a.documentHelper.dialog.element))},this.addToDictClicked=function(){je(a.elementBox)||(kA(a.documentHelper.dialog.element),a.parent.spellCheckerModule.handleAddToDictionary({element:a.elementBox,text:a.elementBox.text}),a.parent.spellCheckerModule.errorWordCollection.containsKey(a.errorText)&&a.parent.spellCheckerModule.errorWordCollection.remove(a.errorText),a.parent.spellCheckerModule.checkForNextError(),a.documentHelper.hideDialog())},this.changeButtonClicked=function(){je(a.selectedText)||(a.isSpellChecking=!0,kA(a.documentHelper.dialog.element),a.parent.spellCheckerModule.manageReplace(a.selectedText,a.elementBox),a.removeErrors(),a.parent.spellCheckerModule.checkForNextError(),BA(a.documentHelper.dialog.element),a.selectedText=void 0)},this.changeAllButtonClicked=function(){if(!je(a.selectedText)){a.isSpellChecking=!0,a.parent.spellCheckerModule.isChangeAll=!0,kA(a.documentHelper.dialog.element);for(var e=a.parent.spellCheckerModule.errorWordCollection.get(a.errorText),t=e.length-1;0<=t;t--)if(e[t]instanceof bli&&!e[t].ischangeDetected)a.parent.spellCheckerModule.manageReplace(a.selectedText,e[t]);else if(e[t]instanceof pli){var i=a.parent.spellCheckerModule.getMatchedResultsFromElement(e[t]),n=i.textResults,o=e[t].ischangeDetected?e[t].start.offset:e[t].line.getOffset(e[t],0);a.parent.searchModule.textSearch.updateMatchedTextLocation(i.matches,n,i.elementInfo,0,e[t],!1,null,o);for(var r=0;r<n.length;r++){var s=a.parent.spellCheckerModule.createErrorElementWithInfo(n.innerList[r],e[t]);a.parent.spellCheckerModule.manageReplace(a.selectedText,s)}}a.parent.spellCheckerModule.errorWordCollection.containsKey(a.errorText)&&a.parent.spellCheckerModule.errorWordCollection.remove(a.errorText),a.parent.spellCheckerModule.checkForNextError(),a.documentHelper.hideDialog(),BA(a.documentHelper.dialog.element),a.parent.spellCheckerModule.isChangeAll=!1,a.selectedText=void 0}},this.documentHelper=e,mA({target:this.documentHelper.dialog.element,cssClass:"e-spin-overlay"})}Object.defineProperty(Xpi.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),Xpi.prototype.getModuleName=function(){return"CheckBoxFormFieldDialog"},Xpi.prototype.initCheckBoxDialog=function(e,t){this.target=Q("div"),this.dialogDiv=Q("div"),this.headingLabel=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Check box size")}),this.sizeParentDiv=Q("div",{className:"e-de-container-row"}),this.autoDiv=Q("div",{className:"e-de-ff-radio-scnd-div"}),this.exactDiv=Q("div",{className:"e-de-ff-radio-scnd-div"}),this.autoEle=Q("input",{className:"e-de-rtl-btn-div",attrs:{"aria-label":e.getConstant("Auto")}}),this.exactEle=Q("input",{className:"e-de-rtl-btn-div",attrs:{"aria-label":e.getConstant("Exactly")}}),this.autoButton=new cb({label:e.getConstant("Auto"),cssClass:"e-small",change:this.changeBidirectional,checked:!0,enableRtl:t}),this.exactButton=new cb({label:e.getConstant("Exactly"),value:"exact",cssClass:"e-small",change:this.changeBidirectional,enableRtl:t}),this.exactNumberDiv=Q("div",{className:"e-de-ff-chck-exact"}),this.exactNumber=Q("input",{attrs:{type:"text","aria-label":e.getConstant("Exactly")}}),this.exactlyNumber=new NL({format:"n",value:10,min:1,max:1584,enablePersistence:!1,enabled:!1,cssClass:"e-de-check-exactnumbr-width",enableRtl:t}),this.defaultValueLabel=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Default value")}),this.defaultcheckDiv=Q("div",{className:"e-de-container-row"}),this.notcheckDiv=Q("div",{className:"e-de-ff-radio-div"}),this.checkDiv=Q("div",{className:"e-de-ff-radio-div"}),this.notcheckEle=Q("input",{className:"e-de-rtl-btn-div",attrs:{"aria-label":e.getConstant("Not checked")}}),this.checkEle=Q("input",{className:"e-de-rtl-btn-div",attrs:{"aria-label":e.getConstant("Checked")}}),this.notCheckedButton=new cb({label:e.getConstant("Not checked"),enableRtl:t,cssClass:"e-small",change:this.changeBidirect}),this.checkedButton=new cb({label:e.getConstant("Checked"),value:"check",enableRtl:t,cssClass:"e-small",change:this.changeBidirect,checked:!0}),this.fieldSettingsLabel=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Field settings")}),this.settingsTotalDiv=Q("div",{className:"e-de-container-row"}),this.totalToolTipDiv=Q("div",{className:"e-de-subcontainer-left"}),this.totalBookmarkDiv=Q("div",{className:"e-de-subcontainer-right"}),this.tooltipInputText=Q("input",{className:"e-input e-bookmark-textbox-input",attrs:{"aira-label":e.getConstant("Tooltip")}}),this.bookmarkInputText=Q("input",{className:"e-input e-bookmark-textbox-input",attrs:{"aira-label":e.getConstant("Name")}}),this.checkBoxEnableDiv=Q("div"),this.checBoxEnableEle=Q("input",{attrs:{type:"checkbox"}}),this.checBoxEnableEle.setAttribute("aria-label",e.getConstant("Check box enabled")),this.checBoxEnableElement=new ib({cssClass:"e-de-ff-dlg-check",label:e.getConstant("Check box enabled"),enableRtl:t}),t&&(this.autoDiv.classList.add("e-de-rtl"),this.exactDiv.classList.add("e-de-rtl"),this.exactNumberDiv.classList.add("e-de-rtl"),this.notcheckDiv.classList.add("e-de-rtl"),this.checkDiv.classList.add("e-de-rtl"),this.totalToolTipDiv.classList.add("e-de-rtl"),this.totalBookmarkDiv.classList.add("e-de-rtl")),this.target.appendChild(this.dialogDiv),this.dialogDiv.appendChild(this.defaultValueLabel),this.dialogDiv.appendChild(this.defaultcheckDiv),this.defaultcheckDiv.appendChild(this.notcheckDiv),this.notcheckDiv.appendChild(this.notcheckEle),this.notCheckedButton.appendTo(this.notcheckEle),this.defaultcheckDiv.appendChild(this.checkDiv),this.checkDiv.appendChild(this.checkEle),this.checkedButton.appendTo(this.checkEle),this.dialogDiv.appendChild(this.headingLabel),this.dialogDiv.appendChild(this.sizeParentDiv),this.sizeParentDiv.appendChild(this.autoDiv),this.autoDiv.appendChild(this.autoEle),this.autoButton.appendTo(this.autoEle),this.sizeParentDiv.appendChild(this.exactDiv),this.exactDiv.appendChild(this.exactEle),this.exactButton.appendTo(this.exactEle),this.exactDiv.appendChild(this.exactNumberDiv),this.exactNumberDiv.appendChild(this.exactNumber),this.exactlyNumber.appendTo(this.exactNumber),this.dialogDiv.appendChild(this.fieldSettingsLabel),this.dialogDiv.appendChild(this.settingsTotalDiv),this.settingsTotalDiv.appendChild(this.totalToolTipDiv),this.settingsTotalDiv.appendChild(this.totalBookmarkDiv),this.totalToolTipDiv.appendChild(this.tooltipInputText),this.totalBookmarkDiv.appendChild(this.bookmarkInputText),this.dialogDiv.appendChild(this.checkBoxEnableDiv),this.checkBoxEnableDiv.appendChild(this.checBoxEnableEle),this.checBoxEnableElement.appendTo(this.checBoxEnableEle),new fV({placeholder:e.getConstant("Tooltip"),floatLabelType:"Always"},this.tooltipInputText),new fV({placeholder:e.getConstant("Name"),floatLabelType:"Always"},this.bookmarkInputText)},Xpi.prototype.show=function(){var e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),je(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()},Xpi.prototype.loadCheckBoxDialog=function(){var e=this.owner.selectionModule.getCurrentFormField();e instanceof Zai&&(this.fieldBegin=e,(e=this.fieldBegin.formFieldData).defaultValue?(this.checkedButton.checked=!0,this.notCheckedButton.checked=!1):(this.checkedButton.checked=!1,this.notCheckedButton.checked=!0),"Auto"!==e.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),e.size&&(this.exactlyNumber.value=e.size),e.enabled?this.checBoxEnableElement.checked=!0:this.checBoxEnableElement.checked=!1,e.name&&""!==e.name?this.bookmarkInputText.value=e.name:this.bookmarkInputText.value="",e.helpText&&""!==e.helpText?this.tooltipInputText.value=e.helpText:this.tooltipInputText.value="")},Xpi.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,this.removeElements()},Xpi.prototype.removeElements=function(){this.dialogDiv&&(this.dialogDiv.remove(),this.dialogDiv=void 0),this.headingLabel&&(this.headingLabel.remove(),this.headingLabel=void 0),this.sizeParentDiv&&(this.sizeParentDiv.remove(),this.sizeParentDiv=void 0),this.autoDiv&&(this.autoDiv.remove(),this.autoDiv=void 0),this.exactDiv&&(this.exactDiv.remove(),this.exactDiv=void 0),this.autoEle&&(this.autoEle.remove(),this.autoEle=void 0),this.exactEle&&(this.exactEle.remove(),this.exactEle=void 0),this.exactNumber&&(this.exactNumber.remove(),this.exactNumber=void 0),this.defaultValueLabel&&(this.defaultValueLabel.remove(),this.defaultValueLabel=void 0),this.defaultcheckDiv&&(this.defaultcheckDiv.remove(),this.defaultcheckDiv=void 0),this.notcheckDiv&&(this.notcheckDiv.remove(),this.notcheckDiv=void 0),this.checkDiv&&(this.checkDiv.remove(),this.checkDiv=void 0),this.notcheckEle&&(this.notcheckEle.remove(),this.notcheckEle=void 0),this.checkEle&&(this.checkEle.remove(),this.checkEle=void 0),this.checkBoxEnableDiv&&(this.checkBoxEnableDiv.remove(),this.checkBoxEnableDiv=void 0),this.checBoxEnableEle&&(this.checBoxEnableEle.remove(),this.checBoxEnableEle=void 0),this.fieldSettingsLabel&&(this.fieldSettingsLabel.remove(),this.fieldSettingsLabel=void 0),this.settingsTotalDiv&&(this.settingsTotalDiv.remove(),this.settingsTotalDiv=void 0),this.totalToolTipDiv&&(this.totalToolTipDiv.remove(),this.totalToolTipDiv=void 0),this.totalBookmarkDiv&&(this.totalBookmarkDiv.remove(),this.totalBookmarkDiv=void 0)};var Ypi=Xpi;function Xpi(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 rli;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.editorModule.editFormField("CheckBox",e)},this.closeCheckBoxField=function(){t.documentHelper.dialog.hide(),t.documentHelper.dialog.element.style.pointerEvents=""},this.owner=e}Object.defineProperty(Jpi.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),Jpi.prototype.getModuleName=function(){return"TextFormFieldDialog"},Jpi.prototype.initTextDialog=function(i,e){var t=this,n=(this.target=Q("div"),this.dialogDiv=Q("div"),this.firstDiv=Q("div",{className:"e-de-container-row"}),this.typeDiv=Q("div",{className:"e-de-subcontainer-left"}),this.defaultTextDiv=Q("div",{className:"e-de-subcontainer-right"}),[{Value:"Regular text",Name:i.getConstant("Regular text")},{Value:"Number",Name:i.getConstant("Number")},{Value:"Date",Name:i.getConstant("Date")}]),n=(this.typeDropDownList=Q("input"),this.typeDropDown=new qz({dataSource:n,popupHeight:"150px",value:"Regular text",change:this.changeTypeDropDown.bind(this),floatLabelType:"Always",placeholder:i.getConstant("Type"),fields:{text:"Name",value:"Value"},htmlAttributes:{"aria-labelledby":i.getConstant("Type")}}),this.defaultTextInput=Q("input",{className:"e-input e-bookmark-textbox-input"}),this.secondDiv=Q("div",{className:"e-de-container-row"}),this.maxLengthDiv=Q("div",{className:"e-de-subcontainer-left"}),this.maxLength=Q("input",{attrs:{"aria-labelledby":i.getConstant("Maximum length")}}),this.maxLengthNumber=new NL({format:"n",value:0,min:0,max:32767,width:"100%",enablePersistence:!1,placeholder:i.getConstant("Maximum length"),floatLabelType:"Always",change:function(e){e.value||(this.element.value=i.getConstant("Unlimited"))},focus:function(e){e.value||(this.element.value=i.getConstant("Unlimited"))},blur:function(e){var t;e.value||(t=this,setTimeout(function(){t.element.value=i.getConstant("Unlimited")},0))}}),this.textFromatDiv=Q("div",{className:"e-de-subcontainer-right"}),this.textFormatList=Q("input"),[{Value:"Uppercase",Name:i.getConstant("Uppercase")},{Value:"Lowercase",Name:i.getConstant("Lowercase")},{Value:"FirstCapital",Name:i.getConstant("FirstCapital")},{Value:"Titlecase",Name:i.getConstant("TitleCase")}]);this.textFormatDropDown=new oU({dataSource:n,popupHeight:"150px",allowCustom:!0,showClearButton:!1,change:this.updateTextFormtas.bind(this),placeholder:i.getConstant("Text format"),floatLabelType:"Always",fields:{text:"Name",value:"Value"}}),this.textFormatDropDown.focus=function(){t.textFormatDropDown.element.select()},this.fileSettingsLabel=Q("div",{className:"e-de-ff-dlg-heading",innerHTML:i.getConstant("Field settings")}),this.thirdDiv=Q("div",{className:"e-de-container-row"}),this.toolTipTotalDiv=Q("div",{className:"e-de-subcontainer-left"}),this.bookmarkTotalDiv=Q("div",{className:"e-de-subcontainer-right"}),this.tooltipTextInput=Q("input",{className:"e-input e-bookmark-textbox-input"}),this.bookmarkTextInput=Q("input",{className:"e-input e-bookmark-textbox-input"}),this.fillInEnableDiv=Q("div"),this.fillInEnableEle=Q("input",{attrs:{type:"checkbox"}}),this.fillInEnableEle.setAttribute("aria-label",i.getConstant("Fillin enabled")),this.fillInEnable=new ib({cssClass:"e-de-ff-dlg-check",label:i.getConstant("Fillin enabled"),enableRtl:e}),e&&(this.typeDiv.classList.add("e-de-rtl"),this.maxLengthDiv.classList.add("e-de-rtl"),this.toolTipTotalDiv.classList.add("e-de-rtl"),this.bookmarkTotalDiv.classList.add("e-de-rtl")),this.target.appendChild(this.dialogDiv),this.dialogDiv.appendChild(this.firstDiv),this.firstDiv.appendChild(this.typeDiv),this.typeDiv.appendChild(this.typeDropDownList),this.typeDropDown.appendTo(this.typeDropDownList),this.firstDiv.appendChild(this.defaultTextDiv),this.defaultTextDiv.appendChild(this.defaultTextInput),this.dialogDiv.appendChild(this.secondDiv),this.secondDiv.appendChild(this.maxLengthDiv),this.maxLengthDiv.appendChild(this.maxLength),this.maxLengthNumber.appendTo(this.maxLength),this.secondDiv.appendChild(this.textFromatDiv),this.textFromatDiv.appendChild(this.textFormatList),this.textFormatDropDown.appendTo(this.textFormatList),this.dialogDiv.appendChild(this.fileSettingsLabel),this.dialogDiv.appendChild(this.thirdDiv),this.thirdDiv.appendChild(this.toolTipTotalDiv),this.toolTipTotalDiv.appendChild(this.tooltipTextInput),this.thirdDiv.appendChild(this.bookmarkTotalDiv),this.bookmarkTotalDiv.appendChild(this.bookmarkTextInput),this.dialogDiv.appendChild(this.fillInEnableDiv),this.fillInEnableDiv.appendChild(this.fillInEnableEle),this.fillInEnable.appendTo(this.fillInEnableEle),this.defaultTextLabel=new fV({placeholder:i.getConstant("Default text"),floatLabelType:"Always"},this.defaultTextInput),new fV({placeholder:i.getConstant("Tooltip"),floatLabelType:"Always"},this.tooltipTextInput),new fV({placeholder:i.getConstant("Name"),floatLabelType:"Always",htmlAttributes:{"aria-labelledby":i.getConstant("Name")}},this.bookmarkTextInput),this.defaultTextInput.setAttribute("aria-labelledby",i.getConstant("Default text")),this.tooltipTextInput.setAttribute("aria-labelledby",i.getConstant("Tooltip")),this.bookmarkTextInput.setAttribute("aria-labelledby",i.getConstant("Name"))},Jpi.prototype.show=function(){this.localObj=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),this.localObj.setLocale(this.documentHelper.owner.locale),je(this.target)&&this.initTextDialog(this.localObj,this.documentHelper.owner.enableRtl),this.loadTextDialog(this.localObj),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()},Jpi.prototype.changeTypeDropDown=function(e){e.isInteracted&&(this.defaultTextInput.value="",this.textFormatDropDown.value=""),"Regular text"===e.value?(this.textFormatDropDown.fields={text:"Name",value:"Value"},this.defaultTextLabel.placeholder=this.localObj.getConstant("Default text"),this.textFormatDropDown.placeholder=this.localObj.getConstant("Text format"),this.textFormatDropDown.dataSource=[{Value:"Uppercase",Name:this.localObj.getConstant("Uppercase")},{Value:"Lowercase",Name:this.localObj.getConstant("Lowercase")},{Value:"FirstCapital",Name:this.localObj.getConstant("FirstCapital")},{Value:"Titlecase",Name:this.localObj.getConstant("TitleCase")}]):"Number"===e.value?(this.textFormatDropDown.fields={text:null,value:null},this.defaultTextLabel.placeholder=this.localObj.getConstant("Default number"),this.textFormatDropDown.placeholder=this.localObj.getConstant("Number format"),this.textFormatDropDown.dataSource=["0","0.00","#,##0","#,##0.00","$#,##0.00;($#,##0.00)","0%"]):"Date"===e.value&&(this.textFormatDropDown.fields={text:null,value:null},this.defaultTextLabel.placeholder=this.localObj.getConstant("Default date"),this.textFormatDropDown.placeholder=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"]),this.defaultTextLabel.dataBind(),this.textFormatDropDown.dataBind()},Jpi.prototype.loadTextDialog=function(e){var t=this.owner.selectionModule.getCurrentFormField();t instanceof Zai&&(0<(t=(this.fieldBegin=t).formFieldData).maxLength?this.maxLengthNumber.value=t.maxLength:(this.maxLengthNumber.value=0,this.maxLengthNumber.element.value=e?e.getConstant("Unlimited"):"Unlimited"),"Date"===t.type?this.typeDropDown.value="Date":"Number"===t.type?this.typeDropDown.value="Number":this.typeDropDown.value="Regular text",t.format?this.textFormatDropDown.value=t.format:this.textFormatDropDown.value="",this.defaultTextInput.value=je(t.defaultValue)?"":t.defaultValue,this.fillInEnable.checked=t.enabled,this.tooltipTextInput.value=je(t.helpText)?"":t.helpText,this.bookmarkTextInput.value=je(t.name)?"":t.name)},Jpi.prototype.updateFormats=function(e){var t,i=je(this.textFormatDropDown.value)?"":this.textFormatDropDown.value.toString();return"Regular text"===this.typeDropDown.value?Y.formatText(i,e):"Number"===this.typeDropDown.value?"NaN"!==(t=Y.formatNumber(i,e)).toString()?t:"":"Date"===this.typeDropDown.value?Y.formatDate(i,e):""},Jpi.prototype.isValidDateFormat=function(){var e=this.defaultTextInput.value;if(""!==e){e=new Date(e);if(isNaN(e.getDate()))return!1}return!0},Jpi.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,this.removeElements()},Jpi.prototype.removeElements=function(){this.dialogDiv&&(this.dialogDiv.remove(),this.dialogDiv=void 0),this.firstDiv&&(this.firstDiv.remove(),this.firstDiv=void 0),this.typeDiv&&(this.typeDiv.remove(),this.typeDiv=void 0),this.typeDropDownList&&(this.typeDropDownList.remove(),this.typeDropDownList=void 0),this.secondDiv&&(this.secondDiv.remove(),this.secondDiv=void 0),this.maxLengthDiv&&(this.maxLengthDiv.remove(),this.maxLengthDiv=void 0),this.maxLength&&(this.maxLength.remove(),this.maxLength=void 0),this.textFromatDiv&&(this.textFromatDiv.remove(),this.textFromatDiv=void 0),this.textFormatList&&(this.textFormatList.remove(),this.textFormatList=void 0),this.fileSettingsLabel&&(this.fileSettingsLabel.remove(),this.fileSettingsLabel=void 0),this.thirdDiv&&(this.thirdDiv.remove(),this.thirdDiv=void 0),this.toolTipTotalDiv&&(this.toolTipTotalDiv.remove(),this.toolTipTotalDiv=void 0),this.bookmarkTotalDiv&&(this.bookmarkTotalDiv.remove(),this.bookmarkTotalDiv=void 0),this.fillInEnableDiv&&(this.fillInEnableDiv.remove(),this.fillInEnableDiv=void 0),this.fillInEnableEle&&(this.fillInEnableEle.remove(),this.fillInEnableEle=void 0)};var Kpi=Jpi;function Jpi(e){var n=this;this.updateTextFormtas=function(){var e=n.updateFormats(n.defaultTextInput.value);n.defaultTextInput.value=je(e)?"":e},this.onCancelButtonClick=function(){n.documentHelper.dialog.hide()},this.insertTextField=function(){var e,t,i=!0;(i="Date"===n.typeDropDown.value?n.isValidDateFormat():i)?(n.updateTextFormtas(),n.defaultTextInput.value.length>n.maxLengthNumber.value&&!je(n.maxLengthNumber.value)&&0!==n.maxLengthNumber.value?WC.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"}}).enableRtl=n.owner.enableRtl:(i=void 0,i="Date"===n.typeDropDown.value?"Date":"Number"===n.typeDropDown.value?"Number":"Text",e=go.sanitize(n.textFormatDropDown.value),(t=new ili).type=i,t.defaultValue=n.defaultTextInput.value,t.maxLength=n.maxLengthNumber.value,t.format=je(e)?"":e,t.name=n.bookmarkTextInput.value,t.helpText=n.tooltipTextInput.value,t.enabled=n.fillInEnable.checked,n.owner.editorModule.editFormField("Text",t),n.closeTextField())):WC.alert({content:"A valid date or time is required",showCloseIcon:!0,closeOnEscape:!0,position:{X:"center",Y:"center"},animationSettings:{effect:"Zoom"}}).enableRtl=n.owner.enableRtl},this.closeTextField=function(){n.documentHelper.dialog.hide(),n.documentHelper.dialog.element.style.pointerEvents=""},this.owner=e}Object.defineProperty($pi.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),$pi.prototype.getModuleName=function(){return"DropDownFormFieldDialog"},$pi.prototype.initTextDialog=function(e,t){this.target=Q("div"),this.dialogDiv=Q("div"),this.firstDiv=Q("div",{className:"e-de-drp-dwn-frst-div"}),this.drpDownItemsInput=Q("input",{className:"e-input e-bookmark-textbox-input",id:"fielditems_text_box"}),this.drpDownItemsInput.addEventListener("keyup",this.keyUpOnTextBoxClickHandler),this.secondDiv=Q("div",{className:"e-de-ff-drpdwn-dlg-scndiv"}),this.itemsDrpItemsLabel=Q("div",{className:"e-de-ff-dlg-drpdwn-heading",innerHTML:e.getConstant("Items in dropdown list")}),this.listviewDiv=Q("div",{className:"e-bookmark-listViewDiv e-de-ff-drpdwn-listview",attrs:{style:"height:100%"}}),this.listviewInstance=new MH({cssClass:"e-bookmark-listview",select:this.selectHandler}),this.buttonDiv=Q("div"),this.addButtonDiv=Q("div",{className:"e-bookmark-addbutton"}),this.addButtonEle=Q("button",{innerHTML:e.getConstant("ADD"),attrs:{type:"button",style:"height:36px;width:100%"}}),this.addButton=new zv({cssClass:"e-button-custom"}),this.addButton.disabled=!0,this.addButtonEle.setAttribute("aria-label",e.getConstant("ADD")),this.addButtonEle.addEventListener("click",this.addItemtoListClickHandler),this.editButtonDiv=Q("div",{className:"e-bookmark-addbutton"}),this.editButtonDiv.style.display="none",this.editButtonEle=Q("button",{innerHTML:"EDIT",attrs:{type:"button",style:"height:36px;width:100%"}}),this.editButton=new zv({cssClass:"e-button-custom"}),this.editButtonEle.setAttribute("aria-label","EDIT"),this.removeButtonDiv=Q("div",{className:"e-bookmark-addbutton"}),this.removeButtonEle=Q("button",{innerHTML:e.getConstant("REMOVE"),attrs:{type:"button",style:"height:36px;width:100%"}}),this.removeButtonEle.setAttribute("aria-label",e.getConstant("REMOVE")),this.removeButton=new zv({cssClass:"e-button-custom"}),this.removeButtonEle.addEventListener("click",this.removeItemFromListClickHandler),this.moveBtnDiv=Q("div",{attrs:{style:"display:inline-flex"}}),this.moveUpButtonDiv=Q("div",{className:"e-bookmark-addbutton"}),this.moveUpButtonEle=Q("button",{attrs:{type:"button",style:"height:36px;width:40px"},className:"e-de-ff-drpdwn-mvup"}),this.moveUpButtonEle.setAttribute("aria-label","moveUp"),this.moveUpButton=new zv({cssClass:"e-button-custom",iconCss:"e-de-arrow-up"}),this.moveUpButtonEle.addEventListener("click",this.moveUpItemClickHandler),this.moveDownButtonDiv=Q("div",{className:"e-bookmark-addbutton"}),this.moveDownButtonEle=Q("button",{attrs:{type:"button",style:"height:36px;width:40px"},className:"e-de-ff-drpdwn-mvdn"}),this.moveDownButtonEle.setAttribute("aria-label","moveDown"),this.moveDownButton=new zv({cssClass:"e-button-custom",iconCss:"e-de-arrow-down"}),this.moveDownButtonEle.addEventListener("click",this.moveDownItemClickHandler),this.fileSettingsLabel=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Field settings")}),this.thirdDiv=Q("div",{className:"e-de-container-row"}),this.toolTipDiv=Q("div",{className:"e-de-subcontainer-left"}),this.bookmarkDiv=Q("div",{className:"e-de-subcontainer-right"}),this.tooltipInput=Q("input",{className:"e-input e-bookmark-textbox-input"}),this.bookmarkInput=Q("input",{className:"e-input e-bookmark-textbox-input"}),this.dropDownEnableDiv=Q("div"),this.dropDownEnableEle=Q("input",{attrs:{type:"checkbox"}}),this.dropDownEnable=new ib({cssClass:"e-de-ff-dlg-check",label:e.getConstant("Dropdown enabled"),enableRtl:t}),t&&(this.listviewDiv.classList.add("e-de-rtl"),this.moveUpButtonEle.classList.add("e-de-rtl"),this.toolTipDiv.classList.add("e-de-rtl"),this.bookmarkDiv.classList.add("e-de-rtl")),this.dropDownEnableDiv.setAttribute("aria-label",e.getConstant("Dropdown enabled")),this.target.appendChild(this.dialogDiv),this.dialogDiv.appendChild(this.firstDiv),this.firstDiv.appendChild(this.drpDownItemsInput),this.dialogDiv.appendChild(this.itemsDrpItemsLabel),this.dialogDiv.appendChild(this.secondDiv),this.secondDiv.appendChild(this.listviewDiv),this.listviewInstance.appendTo(this.listviewDiv),this.secondDiv.appendChild(this.buttonDiv),this.buttonDiv.appendChild(this.addButtonDiv),this.addButtonDiv.appendChild(this.addButtonEle),this.addButton.appendTo(this.addButtonEle),this.buttonDiv.appendChild(this.editButtonDiv),this.editButtonDiv.appendChild(this.editButtonEle),this.editButton.appendTo(this.editButtonEle),this.buttonDiv.appendChild(this.removeButtonDiv),this.removeButtonDiv.appendChild(this.removeButtonEle),this.removeButton.appendTo(this.removeButtonEle),this.buttonDiv.appendChild(this.moveBtnDiv),this.moveBtnDiv.appendChild(this.moveUpButtonDiv),this.moveUpButtonDiv.appendChild(this.moveUpButtonEle),this.moveUpButton.appendTo(this.moveUpButtonEle),this.moveBtnDiv.appendChild(this.moveDownButtonDiv),this.moveDownButtonDiv.appendChild(this.moveDownButtonEle),this.moveDownButton.appendTo(this.moveDownButtonEle),this.dialogDiv.appendChild(this.fileSettingsLabel),this.dialogDiv.appendChild(this.thirdDiv),this.thirdDiv.appendChild(this.toolTipDiv),this.toolTipDiv.appendChild(this.tooltipInput),this.thirdDiv.appendChild(this.bookmarkDiv),this.bookmarkDiv.appendChild(this.bookmarkInput),this.dialogDiv.appendChild(this.dropDownEnableDiv),this.dropDownEnableDiv.appendChild(this.dropDownEnableEle),this.dropDownEnable.appendTo(this.dropDownEnableEle),new fV({placeholder:e.getConstant("Tooltip"),floatLabelType:"Always"},this.tooltipInput),new fV({placeholder:e.getConstant("Name"),floatLabelType:"Always"},this.bookmarkInput),new fV({placeholder:e.getConstant("Dropdown items"),floatLabelType:"Always"},this.drpDownItemsInput),this.tooltipInput.setAttribute("aria-labelledby",e.getConstant("Tooltip")),this.bookmarkInput.setAttribute("aria-labelledby",e.getConstant("Name")),this.drpDownItemsInput.setAttribute("aria-labelledby",e.getConstant("Dropdown items"))},$pi.prototype.show=function(){var e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),je(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()},$pi.prototype.loadDropDownDialog=function(){var e=this.owner.selectionModule.getCurrentFormField();e instanceof Zai&&(this.fieldBegin=e,this.dropDownInstance=e.formFieldData,0<this.dropDownInstance.dropdownItems.length&&(e=this.dropDownInstance.selectedIndex,this.currentSelectedItem=this.dropDownInstance.dropdownItems[e]),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())},$pi.prototype.updateList=function(){var e;this.listviewInstance.dataSource=this.dropDownItems.slice(),this.listviewInstance.dataBind(),this.currentSelectedItem&&(e=this.currentSelectedItem,this.listviewInstance.selectItem(e))},$pi.prototype.onAddItemtoListClick=function(){this.addItemtoList()},$pi.prototype.onRemoveItemFromListClick=function(){this.removeItemFromList()},$pi.prototype.onMoveUpItemClick=function(){this.moveUpItem()},$pi.prototype.onMouseDownItemClick=function(){this.moveDownItem()},$pi.prototype.getSelectedIndex=function(){for(var e=0;e<this.dropDownItems.length;e++)if(this.dropDownItems[e]===this.currentSelectedItem)return e;return 0},$pi.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 o=this.dropDownItems[e];this.dropDownItems[e]=this.dropDownItems[t],this.dropDownItems[t]=o}},$pi.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 o=this.dropDownItems[e];this.dropDownItems[e]=this.dropDownItems[t],this.dropDownItems[t]=o}},$pi.prototype.onKeyUpOnTextBoxClick=function(){this.onKeyUpOnTextBox()},$pi.prototype.enableOrDisableButton=function(){je(this.addButton)||(this.addButton.disabled=""===this.drpDownItemsInput.value)},$pi.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.removeEvents(),this.removeElements(),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},$pi.prototype.removeEvents=function(){this.addButtonEle&&this.addButtonEle.removeEventListener("click",this.addItemtoListClickHandler),this.removeButtonEle&&this.removeButtonEle.removeEventListener("click",this.removeItemFromListClickHandler),this.moveUpButtonEle&&this.moveUpButtonEle.removeEventListener("click",this.moveUpItemClickHandler),this.moveDownButtonEle&&this.moveDownButtonEle.removeEventListener("click",this.moveDownItemClickHandler),this.drpDownItemsInput&&this.drpDownItemsInput.removeEventListener("keyup",this.keyUpOnTextBoxClickHandler)},$pi.prototype.removeElements=function(){this.dialogDiv&&(this.dialogDiv.remove(),this.dialogDiv=void 0),this.firstDiv&&(this.firstDiv.remove(),this.firstDiv=void 0),this.secondDiv&&(this.secondDiv.remove(),this.secondDiv=void 0),this.itemsDrpItemsLabel&&(this.itemsDrpItemsLabel.remove(),this.itemsDrpItemsLabel=void 0),this.listviewDiv&&(this.listviewDiv.remove(),this.listviewDiv=void 0),this.buttonDiv&&(this.buttonDiv.remove(),this.buttonDiv=void 0),this.addButtonDiv&&(this.addButtonDiv.remove(),this.addButtonDiv=void 0),this.addButtonEle&&(this.addButtonEle.remove(),this.addButtonEle=void 0),this.editButtonDiv&&(this.editButtonDiv.remove(),this.editButtonDiv=void 0),this.editButtonEle&&(this.editButtonEle.remove(),this.editButtonEle=void 0),this.removeButtonDiv&&(this.removeButtonDiv.remove(),this.removeButtonDiv=void 0),this.removeButtonEle&&(this.removeButtonEle.remove(),this.removeButtonEle=void 0),this.moveBtnDiv&&(this.moveBtnDiv.remove(),this.moveBtnDiv=void 0),this.moveUpButtonDiv&&(this.moveUpButtonDiv.remove(),this.moveUpButtonDiv=void 0),this.moveUpButtonEle&&(this.moveUpButtonEle.remove(),this.moveUpButtonEle=void 0),this.moveDownButtonDiv&&(this.moveDownButtonDiv.remove(),this.moveDownButtonDiv=void 0),this.moveDownButtonEle&&(this.moveDownButtonEle.remove(),this.moveDownButtonEle=void 0),this.fileSettingsLabel&&(this.fileSettingsLabel.remove(),this.fileSettingsLabel=void 0),this.thirdDiv&&(this.thirdDiv.remove(),this.thirdDiv=void 0),this.toolTipDiv&&(this.toolTipDiv.remove(),this.toolTipDiv=void 0),this.bookmarkDiv&&(this.bookmarkDiv.remove(),this.bookmarkDiv=void 0),this.dropDownEnableDiv&&(this.dropDownEnableDiv.remove(),this.dropDownEnableDiv=void 0),this.dropDownEnableEle&&(this.dropDownEnableEle.remove(),this.dropDownEnableEle=void 0)};var Zpi=$pi;function $pi(e){var t=this;this.moveDownItemClickHandler=this.onMouseDownItemClick.bind(this),this.keyUpOnTextBoxClickHandler=this.onKeyUpOnTextBoxClick.bind(this),this.addItemtoListClickHandler=this.onAddItemtoListClick.bind(this),this.moveUpItemClickHandler=this.onMoveUpItemClick.bind(this),this.removeItemFromListClickHandler=this.onRemoveItemFromListClick.bind(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 lli;e.dropdownItems=t.dropDownItems,e.selectedIndex=0,e.name=t.bookmarkInput.value,e.helpText=t.tooltipInput.value,e.enabled=t.dropDownEnable.checked,t.owner.editorModule.editFormField("DropDown",e),t.closeDropDownField()},this.closeDropDownField=function(){t.documentHelper.dialog.hide(),t.documentHelper.dialog.element.style.pointerEvents=""},this.owner=e}var eci=function(){},tci=(ici.prototype.getModuleName=function(){return"ColumnsDialog"},ici.prototype.initColumnsDialog=function(e,t){this.columns=[],this.target=Q("div",{id:this.documentHelper.owner.containerId+"_Columns",className:"e-de-table-border-shading-dlg"}),this.displayText=Q("div",{innerHTML:e.getConstant("Presets"),className:"e-de-para-dlg-heading"}),this.PresetsContainer=Q("div",{className:"e-de-dlg-row"}),this.oneDivContainer=Q("div",{id:this.target.id+"_One_Div_Container",className:"e-de-preset-container"}),this.oneDiv=Q("div",{id:this.target.id+"_One_Div",className:"e-icons e-de-ctnr-columns-one e-de-columns-presets-genral"}),this.oneDivLabel=Q("label",{innerHTML:e.getConstant("One"),className:"e-de-column-label",id:this.target.id+"_One_Div_Label"}),this.twoDivContainer=Q("div",{id:this.target.id+"_Two_Div_Container",className:"e-de-preset-container"}),this.twoDiv=Q("div",{id:this.target.id+"_Two_Div",className:"e-icons e-de-ctnr-columns-two e-de-columns-presets-genral"}),this.twoDivLabel=Q("label",{innerHTML:e.getConstant("Two"),className:"e-de-column-label",id:this.target.id+"_Two_Div_Label"}),this.threeDivContainer=Q("div",{id:this.target.id+"_Three_Div_Container",className:"e-de-preset-container"}),this.threeDiv=Q("div",{id:this.target.id+"_Three_Div",className:"e-icons e-de-ctnr-columns-three  e-de-columns-presets-genral"}),this.threeDivLabel=Q("label",{innerHTML:e.getConstant("Three"),className:"e-de-column-label",id:this.target.id+"_Three_Div_Label"}),this.leftDivContainer=Q("div",{id:this.target.id+"_Left_Div_Container",className:"e-de-preset-container"}),this.leftDiv=Q("div",{id:this.target.id+"_Left_Div",className:"e-icons e-de-ctnr-columns-left e-de-columns-presets-genral"}),this.leftDivLabel=Q("label",{innerHTML:e.getConstant("Left"),className:"e-de-column-label",id:this.target.id+"_Left_Div_Label"}),this.rightDivContainer=Q("div",{id:this.target.id+"_Right_Div_Container",className:"e-de-preset-container"}),this.rightDiv=Q("div",{id:this.target.id+"_Right_Div",className:"e-icons e-de-ctnr-columns-right e-de-columns-presets-genral"}),this.rightDivLabel=Q("label",{innerHTML:e.getConstant("Right"),className:"e-de-column-label",id:this.target.id+"_Right_Div_Label"}),this.nuberOfColumnsContainer=Q("div",{className:"e-de-container-row e-de-columns-padding-alignment"}),this.subcontainer=Q("div",{className:"e-de-subcontainer-left"}),this.oneDivContainer.setAttribute("aria-label",e.getConstant("One")),this.twoDivContainer.setAttribute("aria-label",e.getConstant("Two")),this.threeDivContainer.setAttribute("aria-label",e.getConstant("Three")),this.leftDivContainer.setAttribute("aria-label",e.getConstant("Left")),this.rightDivContainer.setAttribute("aria-label",e.getConstant("Right")),t&&(this.oneDiv.classList.add("e-de-rtl"),this.twoDiv.classList.add("e-de-rtl"),this.threeDiv.classList.add("e-de-rtl"),this.leftDiv.classList.add("e-de-rtl"),this.rightDiv.classList.add("e-de-rtl"),this.oneDivContainer.classList.add("e-de-rtl"),this.twoDivContainer.classList.add("e-de-rtl"),this.threeDivContainer.classList.add("e-de-rtl"),this.leftDivContainer.classList.add("e-de-rtl"),this.rightDivContainer.classList.add("e-de-rtl"),this.oneDivLabel.classList.add("e-de-rtl"),this.twoDivLabel.classList.add("e-de-rtl"),this.threeDivLabel.classList.add("e-de-rtl"),this.leftDivLabel.classList.add("e-de-rtl"),this.rightDivLabel.classList.add("e-de-rtl")),this.columnsCountBox=Q("input",{attrs:{type:"text"}}),this.subcontainer.appendChild(this.columnsCountBox),this.nuberOfColumnsContainer.appendChild(this.subcontainer),this.section=this.documentHelper.selection.sectionFormat,this.pageWidth=this.section.pageWidth-this.section.leftMargin-this.section.rightMargin,this.columnValueTexBox=new NL({format:"#",value:1,min:1,strictMode:!0,placeholder:e.getConstant("Number of columns"),floatLabelType:"Always",change:this.createTextBox}),this.columnValueTexBox.appendTo(this.columnsCountBox),this.subcontainer1=Q("div",{className:"e-de-subcontainer-right"}),this.lineCheckDiv=Q("div",{className:"e-de-columns-padding-alignment"}),this.lineCheck=Q("input",{attrs:{type:"checkbox"}}),this.subcontainer1.appendChild(this.lineCheckDiv),this.lineCheckDiv.appendChild(this.lineCheck),this.lineCheck.setAttribute("aria-labelledby",e.getConstant("Line between column")),this.columnsCountBox.setAttribute("aria-labelledby",e.getConstant("Number of columns")),this.lineCheckbox=new ib({label:e.getConstant("Line between column")}),this.widthAndSpacingContainer=Q("div",{className:"e-de-dlg-row"}),this.widthAndSpacingContainerDiv=Q("div",{}),this.widthAndSpacingText=Q("div",{innerHTML:e.getConstant("Width and Spacing"),className:"e-de-para-dlg-heading"}),this.columnElementDiv=Q("div",{className:"e-width-space-div "}),this.widthcontainerDiv1=Q("div",{className:"e-de-container-row"}),this.widthContainer=Q("div",{className:"e-de-container-row"}),this.tableElement=Q("table"),this.tableElement.style.width="96%";var t=this.tableElement.insertRow(),i=t.insertCell(),t=(i.innerHTML=e.getConstant("Column"),i.style.width="20%",i.style.display="table-cell",i.classList.add("e-de-dlg-sub-header"),(i=t.insertCell()).innerHTML=e.getConstant("Width"),i.style.width="40%",i.style.display="table-cell",i.classList.add("e-de-dlg-sub-header"),(i=t.insertCell()).innerHTML=e.getConstant("Spacing"),i.style.width="40%",i.style.display="table-cell",i.classList.add("e-de-dlg-sub-header"),this.columnDiv=Q("div",{styles:"width:100%;height:100px;overflow-y: scroll;overflow-x: hidden;"}),this.columnTable=Q("table",{styles:"width:100%;"}),this.columnTable.insertRow()),i=t.insertCell(),n=(i.style.width="20%",new eci),i=(this.columnCountBox1=Q("input",{}),n.index=new NL({format:"#",min:1,value:1,enabled:!1,cssClass:"index1",showSpinButton:!1,floatLabelType:"Always",change:this.spaceChange}),i.appendChild(this.columnCountBox1),n.index.appendTo(this.columnCountBox1),t.insertCell()),i=(i.style.width="40%",this.widthCountBox1=Q("input",{attrs:{type:"text"}}),n.width=new NL({min:36,decimals:2,strictMode:!0,enablePersistence:!1,cssClass:"width1",floatLabelType:"Always",change:this.widthChange}),i.appendChild(this.widthCountBox1),i.style.width="40%",n.width.appendTo(this.widthCountBox1),t.insertCell());i.style.width="40%",this.spacingCountBox1=Q("input",{attrs:{type:"text"}}),n.space=new NL({min:0,decimals:2,strictMode:!0,enablePersistence:!1,cssClass:"space1",floatLabelType:"Always",change:this.spaceChange}),i.appendChild(this.spacingCountBox1),n.space.appendTo(this.spacingCountBox1),this.columns.push(n),n.space.enabled=!1,this.widthCountBox1.setAttribute("aria-labelledby","Width"),this.spacingCountBox1.setAttribute("aria-labelledby","Space"),this.equalCheckDiv=Q("div",{className:"e-de-columns-padding-alignment"}),this.equalCheck=Q("input",{attrs:{type:"checkbox"}}),this.equalCheckDiv.appendChild(this.equalCheck),this.equalCheckDiv.setAttribute("aria-label",e.getConstant("Equal column width")),this.equalCheckbox=new ib({label:e.getConstant("Equal column width"),change:this.checkBox}),this.equalCheckbox.appendTo(this.equalCheck),this.lineCheckbox.appendTo(this.lineCheck),this.nuberOfColumnsContainer.appendChild(this.subcontainer1),this.oneDivContainer.appendChild(this.oneDiv),this.oneDivContainer.appendChild(this.oneDivLabel),this.twoDivContainer.appendChild(this.twoDiv),this.twoDivContainer.appendChild(this.twoDivLabel),this.threeDivContainer.appendChild(this.threeDiv),this.threeDivContainer.appendChild(this.threeDivLabel),this.leftDivContainer.appendChild(this.leftDiv),this.leftDivContainer.appendChild(this.leftDivLabel),this.rightDivContainer.appendChild(this.rightDiv),this.rightDivContainer.appendChild(this.rightDivLabel),this.PresetsContainer.appendChild(this.oneDivContainer),this.PresetsContainer.appendChild(this.twoDivContainer),this.PresetsContainer.appendChild(this.threeDivContainer),this.PresetsContainer.appendChild(this.leftDivContainer),this.PresetsContainer.appendChild(this.rightDivContainer),this.widthAndSpacingContainerDiv.appendChild(this.widthAndSpacingText),this.widthAndSpacingContainerDiv.appendChild(this.tableElement),this.columnDiv.appendChild(this.columnTable),this.widthAndSpacingContainerDiv.appendChild(this.columnDiv),this.widthAndSpacingContainer.appendChild(this.widthAndSpacingContainerDiv),this.target.appendChild(this.displayText),this.target.appendChild(this.PresetsContainer),this.target.appendChild(this.nuberOfColumnsContainer),this.target.appendChild(this.widthAndSpacingContainer),this.target.appendChild(this.equalCheckDiv),this.oneDivContainer.addEventListener("click",this.handleSettingCheckBoxActionHandler),this.twoDivContainer.addEventListener("click",this.handleSettingCheckBoxActionHandler),this.threeDivContainer.addEventListener("click",this.handleSettingCheckBoxActionHandler),this.leftDivContainer.addEventListener("click",this.handleSettingCheckBoxActionHandler),this.rightDivContainer.addEventListener("click",this.handleSettingCheckBoxActionHandler),this.widthcontainerDiv1.style.display="flex",this.equalCheckbox.checked=!0,this.equalCheckbox.disabled=!0,this.lineCheckbox.disabled=!0},ici.prototype.createColumn=function(e,t,i){this.widthContainer=Q("div",{className:"e-de-container-row"}),this.widthContainer.style.display="flex";var n=this.columnTable.insertRow(),o=n.insertCell(),r=(o.style.width="20%",new eci),e=(this.columnCount=Q("input",{}),r.index=new NL({format:"#",min:1,value:e,enabled:!1,cssClass:"column1",showSpinButton:!1,floatLabelType:"Always"}),o.appendChild(this.columnCount),r.index.appendTo(this.columnCount),n.insertCell()),o=(e.style.width="40%",Q("input",{attrs:{type:"text"}})),t=(r.width=new NL({min:36,decimals:2,strictMode:!0,enablePersistence:!1,cssClass:"width1",floatLabelType:"Always",change:this.widthChange}),je(t)||(r.width.value=t),e.appendChild(o),r.width.appendTo(o),n.insertCell()),e=(t.style.width="40%",Q("input",{attrs:{type:"text"}}));r.space=new NL({min:0,decimals:2,strictMode:!0,enablePersistence:!1,cssClass:"space1",floatLabelType:"Always",change:this.spaceChange}),je(i)||(r.space.value=i),t.appendChild(e),r.space.appendTo(e),this.columns.push(r)},ici.prototype.show=function(){var e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.target||this.initColumnsDialog(e,this.documentHelper.owner.enableRtl),this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.header=e.getConstant("Columns"),this.documentHelper.dialog.beforeOpen=this.openColumnsDialog,this.documentHelper.dialog.close=this.closeColumnsDialog,this.documentHelper.dialog.position={X:"center",Y:"center"},this.documentHelper.dialog.width="auto",this.documentHelper.dialog.height="auto",this.documentHelper.dialog.buttons=[{click:this.applyColumnDialog,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()},ici.prototype.onhandleSettingCheckBoxActionClicked=function(e){this.handleSettingCheckBoxAction(e)},ici.prototype.setSettingPreviewDivElement=function(e,t){var i=this;switch(this.equalCheckbox.checked=!0,e){case"one":this.columnValueTexBox.value=1;break;case"two":this.columnValueTexBox.value=2,setTimeout(function(){var e;"left"!==t&&"right"!==t||(i.equalCheckbox.checked=!1),"left"===t?(i.numberOfColumns=2,i.leftDiv.classList.add("e-de-table-border-inside-setting-click"),i.twoDiv.classList.remove("e-de-table-border-inside-setting-click"),e=(i.pageWidth-72)/3,i.columns[0].width.value=e,i.columns[1].width.value=e+e+36,i.columns[1].space.value=void 0):"right"===t&&(i.numberOfColumns=2,i.rightDiv.classList.add("e-de-table-border-inside-setting-click"),i.twoDiv.classList.remove("e-de-table-border-inside-setting-click"),e=(i.pageWidth-72)/3,i.columns[0].width.value=e+e+36,i.columns[1].width.value=e,i.columns[1].space.value=void 0)},5);break;case"three":this.columnValueTexBox.value=3}},ici.prototype.destroy=function(){this.removeElements(),this.removeEvents(),this.target=void 0,this.oneDiv=void 0,this.twoDiv=void 0,this.threeDiv=void 0,this.leftDiv=void 0,this.rightDiv=void 0,this.documentHelper=void 0},ici.prototype.removeEvents=function(){this.oneDivContainer&&this.oneDivContainer.removeEventListener("click",this.handleSettingCheckBoxActionHandler),this.twoDivContainer&&this.twoDivContainer.removeEventListener("click",this.handleSettingCheckBoxActionHandler),this.threeDivContainer&&this.threeDivContainer.removeEventListener("click",this.handleSettingCheckBoxActionHandler),this.leftDivContainer&&this.leftDivContainer.removeEventListener("click",this.handleSettingCheckBoxActionHandler),this.rightDivContainer&&this.rightDivContainer.removeEventListener("click",this.handleSettingCheckBoxActionHandler)},ici.prototype.removeElements=function(){this.target&&this.target.remove(),this.oneDiv&&(this.oneDiv.remove(),this.oneDiv=void 0),this.twoDiv&&(this.twoDiv.remove(),this.twoDiv=void 0),this.threeDiv&&(this.threeDiv.remove(),this.threeDiv=void 0),this.leftDiv&&(this.leftDiv.remove(),this.leftDiv=void 0),this.rightDiv&&(this.rightDiv.remove(),this.rightDiv=void 0),this.columnsCountBox&&(this.columnsCountBox.remove(),this.columnsCountBox=void 0),this.columnValueTexBox&&this.columnValueTexBox.element&&this.columnValueTexBox.element.parentNode&&(this.columnValueTexBox.destroy(),this.columnValueTexBox=void 0),this.lineCheckbox&&(this.lineCheckbox.destroy(),this.lineCheckbox=void 0),this.equalCheckbox&&(this.equalCheckbox.destroy(),this.equalCheckbox=void 0),this.columnCountBox1&&(this.columnCountBox1.remove(),this.columnCountBox1=void 0),this.widthCountBox1&&(this.widthCountBox1.remove(),this.widthCountBox1=void 0),this.spacingCountBox1&&(this.spacingCountBox1.remove(),this.spacingCountBox1=void 0),this.columnTable&&(this.columnTable.remove(),this.columnTable=void 0),this.displayText&&(this.displayText.remove(),this.displayText=void 0),this.PresetsContainer&&(this.PresetsContainer.remove(),this.PresetsContainer=void 0),this.oneDivContainer&&(this.oneDivContainer.remove(),this.oneDivContainer=void 0),this.oneDivLabel&&(this.oneDivLabel.remove(),this.oneDivLabel=void 0),this.twoDivContainer&&(this.twoDivContainer.remove(),this.twoDivContainer=void 0),this.twoDivLabel&&(this.twoDivLabel.remove(),this.twoDivLabel=void 0),this.threeDivContainer&&(this.threeDivContainer.remove(),this.threeDivContainer=void 0),this.threeDivLabel&&(this.threeDivLabel.remove(),this.threeDivLabel=void 0),this.leftDivContainer&&(this.leftDivContainer.remove(),this.leftDivContainer=void 0),this.leftDivLabel&&(this.leftDivLabel.remove(),this.leftDivLabel=void 0),this.rightDivContainer&&(this.rightDivContainer.remove(),this.rightDivContainer=void 0),this.rightDivLabel&&(this.rightDivLabel.remove(),this.rightDivLabel=void 0),this.nuberOfColumnsContainer&&(this.nuberOfColumnsContainer.remove(),this.nuberOfColumnsContainer=void 0),this.subcontainer&&(this.subcontainer.remove(),this.subcontainer=void 0),this.subcontainer1&&(this.subcontainer1.remove(),this.subcontainer1=void 0),this.lineCheckDiv&&(this.lineCheckDiv.remove(),this.lineCheckDiv=void 0),this.lineCheck&&(this.lineCheck.remove(),this.lineCheck=void 0),this.widthAndSpacingContainer&&(this.widthAndSpacingContainer.remove(),this.widthAndSpacingContainer=void 0),this.widthAndSpacingContainerDiv&&(this.widthAndSpacingContainerDiv.remove(),this.widthAndSpacingContainerDiv=void 0),this.widthAndSpacingText&&(this.widthAndSpacingText.remove(),this.widthAndSpacingText=void 0),this.tableElement&&(this.tableElement.remove(),this.tableElement=void 0),this.columnDiv&&(this.columnDiv.remove(),this.columnDiv=void 0),this.columnCount&&(this.columnCount.remove(),this.columnCount=void 0),this.equalCheckDiv&&(this.equalCheckDiv.remove(),this.equalCheckDiv=void 0),this.equalCheck&&(this.equalCheck.remove(),this.equalCheck=void 0)},ici);function ici(e){var y=this;this.lineCheckbox=void 0,this.equalCheckbox=void 0,this.handleSettingCheckBoxActionHandler=this.onhandleSettingCheckBoxActionClicked.bind(this),this.checkBox=function(e){for(var t=0;t<y.columns.length;t++){var i=y.columns[parseInt(t.toString(),10)];!0===y.equalCheckbox.checked?0!==t&&(i.width.enabled=!1,i.space.enabled=!1):(i.width.enabled=!0,i.space.enabled=!0)}},this.createTextBox=function(e){if(1===y.columnValueTexBox.value?(y.oneDiv.classList.add("e-de-table-border-inside-setting-click"),y.twoDiv.classList.remove("e-de-table-border-inside-setting-click"),y.threeDiv.classList.remove("e-de-table-border-inside-setting-click"),y.leftDiv.classList.remove("e-de-table-border-inside-setting-click"),y.rightDiv.classList.remove("e-de-table-border-inside-setting-click")):2===y.columnValueTexBox.value?(y.oneDiv.classList.remove("e-de-table-border-inside-setting-click"),y.twoDiv.classList.add("e-de-table-border-inside-setting-click"),y.threeDiv.classList.remove("e-de-table-border-inside-setting-click"),y.leftDiv.classList.remove("e-de-table-border-inside-setting-click"),y.rightDiv.classList.remove("e-de-table-border-inside-setting-click")):3===y.columnValueTexBox.value&&(y.oneDiv.classList.remove("e-de-table-border-inside-setting-click"),y.twoDiv.classList.remove("e-de-table-border-inside-setting-click"),y.threeDiv.classList.add("e-de-table-border-inside-setting-click"),y.leftDiv.classList.remove("e-de-table-border-inside-setting-click"),y.rightDiv.classList.remove("e-de-table-border-inside-setting-click")),y.numberOfColumns=e.value,1<=e.value){y.equalCheckbox.disabled=!1,y.lineCheckbox.disabled=!1;for(var t=e.previousValue;t<y.numberOfColumns;)y.createColumn(t+1),t++;for(;t>y.numberOfColumns;)y.columnTable.deleteRow(y.columnTable.rows.length-1),y.columns.splice(y.columns.length-1,y.columns.length),1===y.numberOfColumns&&(y.equalCheckbox.disabled=!0,y.columns[0].space.enabled=!1),t--;y.canUpdateColumnWidthAndSpacing(e.value,void 0,void 0,void 0)}},this.widthChange=function(e){!0===e.isInteracted&&(e.event.target.parentElement.classList.replace("width1","Width"),y.checkAndApplyColumnFormatWidth(e.value))},this.spaceChange=function(e){!0===e.isInteracted&&(e.event.target.parentElement.classList.replace("space1","Space"),y.checkAndApplyColumnFormatSpace(e.value))},this.checkAndApplyColumnFormatWidth=function(e){if(1===y.numberOfColumns)e>y.pageWidth?y.columns[0].width.value=e-1:y.columns[0].width.value=e+1;else{if(!0===y.equalCheckbox.checked)for(var t=0;t<y.columns.length;t++){var i,n=y.columns[parseInt(t.toString(),10)];36<=e&&0<=y.columns[0].space.value?(i=(y.pageWidth-y.numberOfColumns*e)/(y.numberOfColumns-1),n.width.value=e,t<y.columns.length-1&&(n.space.value=i)):y.columns[0].width.value=y.columns[1].width.value}if(!1===y.equalCheckbox.checked)for(t=0;t<y.columns.length;t++){var o,n=y.columns[parseInt(t.toString(),10)];if(e===y.columns[parseInt(t.toString(),10)].width.value)if((o=t)+1!==y.columns.length)if(e>y.columns[0].width.value||e>y.columns[y.columns.length-1].width.value)for(var r=o+1;r<=y.columns.length;r++){var s=y.columns[parseInt(r.toString(),10)];if(r<y.columns.length&&36<s.width.value&&(s.width.value=s.width.value-1),0===y.columns[0].space.value)for(var a=o-1;0<=a;a--){var l=y.columns[parseInt(a.toString(),10)];36<l.width.value&&(l.width.value=l.width.value-1)}if(r>=y.columns.length&&36===y.columns[0].width.value||36===y.columns[r-1].width.value&&0!==y.columns[0].space.value)for(var h=0;h<y.columns.length-1;h++){var d=y.columns[parseInt(h.toString(),10)];0<d.space.value&&h<y.columns.length-1&&(d.space.value=d.space.value-1)}if(36===y.columns[0].width.value&&0===y.columns[0].space.value||36===y.columns[r-1].width.value&&0===y.columns[0].space.value)for(h=0;h<y.columns.length;h++){var p=y.columns[parseInt(h.toString(),10)];36!==p.width.value&&e>y.pageWidth-36*(y.numberOfColumns-1)&&(p.width.value=e-1)}}else for(r=o+1;r<y.columns.length;r++){var c=y.columns[parseInt(r.toString(),10)];36<c.width.value&&(c.width.value=c.width.value+1)}else if(e>y.columns[0].width.value||e>y.columns[y.columns.length-1].width.value)for(r=o+1;r<=y.columns.length;r++){if(0===y.columns[0].space.value)for(a=o-1;0<=a;a--){var u=y.columns[parseInt(a.toString(),10)];36<u.width.value&&(u.width.value=u.width.value-1)}if(r<=y.columns.length&&0!==y.columns[0].space.value)for(h=0;h<y.columns.length-1;h++){var g=y.columns[parseInt(h.toString(),10)];0<g.space.value&&h<y.columns.length-1&&(g.space.value=g.space.value-1)}if(36===y.columns[0].width.value&&0===y.columns[0].space.value)for(h=0;h<y.columns.length;h++){var m=y.columns[parseInt(h.toString(),10)];36!==m.width.value&&e>y.pageWidth-36*(y.numberOfColumns-1)&&(m.width.value=e-1)}}else for(r=o+1;r<y.columns.length;r++){var f=y.columns[parseInt(r.toString(),10)];36<f.width.value&&(f.width.value=f.width.value+1)}}}},this.checkAndApplyColumnFormatSpace=function(e){if(!0===y.equalCheckbox.checked)for(var t=0;t<y.columns.length;t++){var i,n=y.columns[parseInt(t.toString(),10)];0<=e&&36<=y.columns[0].width.value?(i=(y.pageWidth-e*(y.numberOfColumns-1))/y.numberOfColumns,n.width.value=i,t<y.columns.length-1&&(n.space.value=e)):y.columns[0].space.value=y.columns[1].space.value}if(!1===y.equalCheckbox.checked)for(t=0;t<y.columns.length;t++){var n=y.columns[parseInt(t.toString(),10)],o=void 0;if(e===y.columns[parseInt(t.toString(),10)].space.value)if((o=t)+1!==y.columns.length)if(y.columns[y.columns.length-1].space.value=0,e>y.columns[0].space.value||e>y.columns[y.columns.length-2].space.value)for(var r=o+1;r<=y.columns.length;r++){var s=y.columns[parseInt(r.toString(),10)];if(r<y.columns.length&&36<s.width.value&&(s.width.value=s.width.value-1),36===y.columns[o+1].width.value&&36<y.columns[parseInt(o.toString(),10)].width.value)for(var a=o;0<=a;a--){var l=y.columns[parseInt(a.toString(),10)];36<l.width.value&&(l.width.value=l.width.value-1)}if(36===y.columns[parseInt(o.toString(),10)].width.value&&(0!==y.columns[0].space.value||0!==y.columns[o+1].space.value))for(var h=0;h<y.columns.length-1;h++){var d=y.columns[parseInt(h.toString(),10)];0<d.space.value&&h<y.columns.length-1&&(d.space.value=d.space.value-1,y.columns[parseInt(o.toString(),10)].space.value=e)}if(36===y.columns[0].width.value&&(0===y.columns[0].space.value||0===y.columns[o+1].space.value))for(a=0;a<y.columns.length;a++){var p=y.columns[parseInt(a.toString(),10)];0!==p.space.value&&e>y.pageWidth-36*y.numberOfColumns&&(p.space.value=e-1)}}else for(r=o+1;r<y.columns.length;r++){var c=y.columns[parseInt(r.toString(),10)];36<c.width.value&&(c.width.value=c.width.value+.5)}else y.columns[parseInt(o.toString(),10)].space.value=0}},this.canUpdateColumnWidthAndSpacing=function(e,t,i,n){var o=(y.pageWidth-36*(e-1))/e,r=(y.pageWidth-36*e)/(e-1);if(2===e&&(y.equalCheckbox.checked=!0),!0===y.equalCheckbox.checked){if(1<e){y.columns[e-1].index.value=e;for(var s=0;s<e;s++){var a=y.columns[parseInt(s.toString(),10)];a.width.value=e<=6?o:36,a.width.value=o,s<e-1&&(a.space.value=e<=6?36:r),a.width.enabled=!1,a.space.enabled=!1}}else y.columns[0].width.value=y.pageWidth;y.columns[0].width.enabled=!0,y.columns[0].space.enabled=1<e}if(!1===y.equalCheckbox.checked)if(2<e){y.columns[e-1].index.value=e;for(s=0;s<e;s++){var l=y.columns[parseInt(s.toString(),10)];l.width.value=o,s<e-1&&(l.width.value<=36?l.space.value=r:l.space.value=36),l.width.enabled=!0,l.space.enabled=!0}}else y.columns[0].width.value=y.pageWidth},this.closeDialog=function(){y.documentHelper.dialog.hide(),y.unWireEventsAndBindings(),y.closeColumnsDialog()},this.closeColumnsDialog=function(){y.documentHelper.dialog2.element.style.pointerEvents="",y.unWireEventsAndBindings(),y.documentHelper.updateFocus()},this.unWireEventsAndBindings=function(){y.equalCheckbox.checked=!0,y.lineCheckbox.checked=!1,y.equalCheckbox.disabled=!0;for(var e=0;e<y.columns.length;e++)y.columns.splice(1,y.columns.length-1),y.columns[0].space.enabled=!1;for(;1<y.columnTable.rows.length;)y.columnTable.deleteRow(y.columnTable.rows.length-1)},this.openColumnsDialog=function(){var e=y.documentHelper.selection.sectionFormat,t=e.pageWidth-e.leftMargin-e.rightMargin;switch(y.columnValueTexBox.max=t/36,y.columns[0].width.value=t,y.documentHelper.updateFocus(),y.equalCheckbox.checked=e.equalWidth,y.lineCheckbox.checked=e.lineBetweenColumns,y.columnValueTexBox.value=0===e.columns.length?1:e.columns.length,y.columnValueTexBox.value){case 1:y.oneDiv.classList.add("e-de-table-border-inside-setting-click"),y.twoDiv.classList.remove("e-de-table-border-inside-setting-click"),y.threeDiv.classList.remove("e-de-table-border-inside-setting-click"),y.leftDiv.classList.remove("e-de-table-border-inside-setting-click"),y.rightDiv.classList.remove("e-de-table-border-inside-setting-click");break;case 2:y.twoDiv.classList.add("e-de-table-border-inside-setting-click"),y.oneDiv.classList.remove("e-de-table-border-inside-setting-click"),y.threeDiv.classList.remove("e-de-table-border-inside-setting-click"),y.leftDiv.classList.remove("e-de-table-border-inside-setting-click"),y.rightDiv.classList.remove("e-de-table-border-inside-setting-click");break;case 3:y.threeDiv.classList.add("e-de-table-border-inside-setting-click"),y.twoDiv.classList.remove("e-de-table-border-inside-setting-click"),y.oneDiv.classList.remove("e-de-table-border-inside-setting-click"),y.leftDiv.classList.remove("e-de-table-border-inside-setting-click"),y.rightDiv.classList.remove("e-de-table-border-inside-setting-click")}1!==y.columnValueTexBox.value&&(y.columns[0].space.value=e.columns[0].space,y.columns[0].width.value=e.columns[0].width),1===y.columnValueTexBox.value&&(y.columns[0].space.value=0);for(var i=1;i<y.columnValueTexBox.value;i++)y.createColumn(i+1,e.columns[i].width,e.columns[i].space)},this.handleSettingCheckBoxAction=function(e){var e=e.target.id,t=y.target.id;e===t+"_One_Div"||e===t+"_One_Div_Container"?(y.oneDiv.classList.add("e-de-table-border-inside-setting-click"),y.setSettingPreviewDivElement("one")):e===t+"_Two_Div"||e===t+"_Two_Div_Container"?(y.twoDiv.classList.add("e-de-table-border-inside-setting-click"),y.setSettingPreviewDivElement("two")):e===t+"_Three_Div"||e===t+"_Three_Div_Container"?(y.threeDiv.classList.add("e-de-table-border-inside-setting-click"),y.setSettingPreviewDivElement("three")):e===t+"_Left_Div"||e===t+"_Left_Div_Container"?(y.oneDiv.classList.remove("e-de-table-border-inside-setting-click"),y.threeDiv.classList.remove("e-de-table-border-inside-setting-click"),y.rightDiv.classList.remove("e-de-table-border-inside-setting-click"),y.setSettingPreviewDivElement("two","left")):e!==t+"_Right_Div"&&e!==t+"_Right_Div_Container"||(y.oneDiv.classList.remove("e-de-table-border-inside-setting-click"),y.threeDiv.classList.remove("e-de-table-border-inside-setting-click"),y.leftDiv.classList.remove("e-de-table-border-inside-setting-click"),y.setSettingPreviewDivElement("two","right"))},this.applyColumnDialog=function(){y.documentHelper.selection.isEmpty||(y.documentHelper.owner.editorHistory&&y.documentHelper.owner.editor.initComplexHistory("InsertSectionBreak"),t=y.documentHelper.selection.getParagraphInfo(y.documentHelper.selection.start),e=y.documentHelper.selection.getParagraphInfo(y.documentHelper.selection.end),t=y.documentHelper.selection.getHierarchicalIndex(t.paragraph,t.offset.toString()),e=y.documentHelper.selection.getHierarchicalIndex(e.paragraph,e.offset.toString()),y.documentHelper.selection.select(e,e),y.documentHelper.owner.editorModule.insertSectionBreak(dJt.Continuous),y.documentHelper.selection.select(t,t),y.documentHelper.owner.editorModule.insertSectionBreak(dJt.Continuous));for(var e=new ari,t=y.documentHelper.selection.sectionFormat,i=(e.bottomMargin=t.bottomMargin,e.topMargin=t.topMargin,e.leftMargin=t.leftMargin,e.rightMargin=t.rightMargin,e.pageWidth=t.pageWidth,e.pageHeight=t.pageHeight,e.differentOddAndEvenPages=t.differentOddAndEvenPages,e.differentFirstPage=t.differentFirstPage,e.headerDistance=t.headerDistance,e.footerDistance=t.footerDistance,e.numberOfColumns=y.numberOfColumns,e.equalWidth=y.equalCheckbox.checked,e.lineBetweenColumns=y.lineCheckbox.checked,[]),n=0;n<y.columns.length;n++){var o=new hri;o.width=Y.convertPointToPixel(y.columns[parseInt(n.toString(),10)].width.value),o.space=Y.convertPointToPixel(y.columns[parseInt(n.toString(),10)].space.value),i.push(o)}e.columns=i,e.breakCode=t.breakCode,y.documentHelper.owner.editorModule.onApplySectionFormat(void 0,e),y.documentHelper.owner.editorHistory&&y.documentHelper.owner.editorHistory.updateComplexHistory(),y.documentHelper.hideDialog()},this.documentHelper=e}oci.prototype.getModuleName=function(){return"TabDialog"},oci.prototype.onTextBoxInputChangeClick=function(e){this.textBoxInputChange(e)},oci.prototype.onSetButtonClick=function(e){this.setButtonClick(e)},oci.prototype.onClearAllButtonClick=function(e){this.clearAllButtonClick(e)},oci.prototype.onClearButtonClick=function(e){this.clearButtonClick(e)},oci.prototype.initTabsDialog=function(e,t){var i=this.documentHelper.owner.containerId,i=(this.target=Q("div",{id:i+"_tab",className:"e-de-tab"}),this.commonDiv=Q("div",{className:"e-de-container-row"}),this.target.appendChild(this.commonDiv),this.tabStopLabelDiv=Q("div",{innerHTML:e.getConstant("Tab stop position")+":",className:"e-de-para-dlg-heading"}),this.tabStopDiv=Q("div",{className:"e-de-subcontainer-left"}),this.tabStopDiv.appendChild(this.tabStopLabelDiv),this.tabListDiv=Q("div",{className:"e-tab-list"}),this.tabStopDiv.appendChild(this.tabListDiv),t&&this.tabListDiv.classList.add("e-de-rtl"),this.textBoxDiv=Q("div",{className:"e-bookmark-textboxdiv"}),this.tabListDiv.appendChild(this.textBoxDiv),this.textBoxInput=Q("input",{className:"e-input e-tab-textbox-input",attrs:{autofocus:"true"}}),this.textBoxInput.setAttribute("type","text"),this.textBoxInput.setAttribute("aria-label",e.getConstant("Tab stop position")),this.textBoxDiv.appendChild(this.textBoxInput),this.textBoxDiv.addEventListener("keyup",this.textBoxInputChangeClickHandler),this.textBoxInput.value=!je(this.tabStopList)&&0<this.tabStopList.length?this.tabStopList[0].displayText:"",this.listviewDiv=Q("div",{className:"e-tab-listViewDiv",attrs:{tabindex:"-1"}}),this.listviewDiv.setAttribute("aria-label",e.getConstant("TabMarkList")),this.tabListDiv.appendChild(this.listviewDiv),this.listviewInstance=new MH({dataSource:this.tabStopList,fields:{text:"displayText"},cssClass:"e-bookmark-listview"}),this.listviewInstance.appendTo(this.listviewDiv),this.listviewInstance.addEventListener("select",this.selectHandlerClickHandler),this.commonDiv.appendChild(this.tabStopDiv),this.defaultTablabelDiv=Q("div",{innerHTML:e.getConstant("Default tab stops")+":",className:"e-de-para-dlg-heading"}),this.defaultTabDiv=Q("div",{className:"e-de-subcontainer-right"}),this.commonDiv.appendChild(this.defaultTabDiv),this.defaultTabStopDiv=Q("div",{className:"e-de-dlg-container"}),this.defaultTabStop=Q("input",{attrs:{type:"text"}}),this.defaultTabStopDiv.appendChild(this.defaultTablabelDiv),this.defaultTabStopDiv.appendChild(this.defaultTabStop),this.defaultTabDiv.appendChild(this.defaultTabStopDiv),this.defaultTabStopIn=new NL({format:"# pt",value:this.documentHelper.defaultTabWidth,min:0,max:1584,step:1,enablePersistence:!1,placeholder:e.getConstant("Default tab stops")}),this.defaultTabStopIn.appendTo(this.defaultTabStop),this.defaultTabWarningDiv=Q("div",{innerHTML:e.getConstant("Tab stops to be cleared")+":",className:"e-de-dlg-container"}),this.defaultTabDiv.appendChild(this.defaultTabWarningDiv),this.displayDiv=Q("div",{className:"e-defaultTablabelDiv"}),this.documentHelper.owner.enableRtl?this.displayDiv.style.marginRight="20px":this.displayDiv.style.marginLeft="20px",this.defaultTabDiv.appendChild(this.displayDiv),this.alignmentDiv=Q("div",{className:"e-de-dlg-container"}),this.target.appendChild(this.alignmentDiv),this.alignmentLabelDiv=Q("div",{innerHTML:e.getConstant("Alignment")+":",className:"e-de-para-dlg-heading"}),this.alignmentDiv.appendChild(this.alignmentLabelDiv),this.alignmentPropertyDiv=Q("div",{styles:"display: flex;"}),this.alignmentDiv.appendChild(this.alignmentPropertyDiv),this.alignmentPropertyDiv1=Q("div",{styles:"display: flex; flex-direction: column; width: 33.33%"}),this.leftDiv=Q("div"),this.leftRadioBtn=Q("input",{attrs:{type:"radiobutton"}}),this.decimalDiv=Q("div"),this.decimalRadioBtn=Q("input",{attrs:{type:"radiobutton"}}),this.leftDiv.appendChild(this.leftRadioBtn),this.decimalDiv.appendChild(this.decimalRadioBtn),this.alignmentPropertyDiv1.appendChild(this.leftDiv),this.alignmentPropertyDiv1.appendChild(this.decimalDiv),this.alignmentPropertyDiv.appendChild(this.alignmentPropertyDiv1),this.left=new cb({label:e.getConstant("Left"),name:"alignment",value:"left",cssClass:"e-small",checked:!0,enableRtl:t,change:this.onTabAlignmentButtonClick}),this.decimal=new cb({label:e.getConstant("Decimal"),name:"alignment",value:"decimal",cssClass:"e-small",enableRtl:t,change:this.onTabAlignmentButtonClick}),this.left.appendTo(this.leftRadioBtn),this.decimal.appendTo(this.decimalRadioBtn),this.leftRadioBtn.setAttribute("aria-label",e.getConstant("Left")),this.decimalRadioBtn.setAttribute("aria-label",e.getConstant("Decimal")),this.alignmentPropertyDiv2=Q("div",{styles:"display: flex; flex-direction: column; width: 33.33%"}),this.centerDiv=Q("div"),this.centerRadioBtn=Q("input",{attrs:{type:"radiobutton"}}),this.barDiv=Q("div"),this.barRadioBtn=Q("input",{attrs:{type:"radiobutton"}}),this.barDiv.appendChild(this.barRadioBtn),this.centerDiv.appendChild(this.centerRadioBtn),this.alignmentPropertyDiv2.appendChild(this.centerDiv),this.alignmentPropertyDiv2.appendChild(this.barDiv),this.bar=new cb({label:e.getConstant("Bar"),name:"alignment",value:"bar",cssClass:"e-small",enableRtl:t,change:this.onBarClick}),this.center=new cb({label:e.getConstant("Center"),name:"alignment",value:"center",cssClass:"e-small",enableRtl:t,change:this.onTabAlignmentButtonClick}),this.bar.appendTo(this.barRadioBtn),this.center.appendTo(this.centerRadioBtn),this.barRadioBtn.setAttribute("aria-label",e.getConstant("Bar")),this.centerRadioBtn.setAttribute("aria-label",e.getConstant("Center")),this.alignmentPropertyDiv.appendChild(this.alignmentPropertyDiv2),this.alignmentPropertyDiv3=Q("div",{styles:"display: flex; flex-direction: column;width: 33.33%"}),this.rightDiv=Q("div"),this.rightRadioBtn=Q("input",{attrs:{type:"radiobutton"}}),this.rightDiv.appendChild(this.rightRadioBtn),this.alignmentPropertyDiv3.appendChild(this.rightDiv),this.right=new cb({label:e.getConstant("Right"),name:"alignment",value:"right",cssClass:"e-small",enableRtl:t,change:this.onTabAlignmentButtonClick}),this.right.appendTo(this.rightRadioBtn),this.rightRadioBtn.setAttribute("aria-label",e.getConstant("Right")),this.alignmentPropertyDiv.appendChild(this.alignmentPropertyDiv3),this.tabLeaderDiv=Q("div",{className:"e-de-dlg-container"}),this.tabLeaderLabelDiv=Q("div",{innerHTML:e.getConstant("Leader")+":",className:"e-de-para-dlg-heading"}),this.tabLeaderDiv.appendChild(this.tabLeaderLabelDiv),this.target.appendChild(this.tabLeaderDiv),this.tabLeaderPropertyDiv=Q("div",{styles:"display: flex;"}),this.tabLeaderDiv.appendChild(this.tabLeaderPropertyDiv),this.tabLeaderPropertyDiv1=Q("div",{styles:"display: flex; flex-direction: column; width: 33.33%"}),this.noneDiv=Q("div"),this.noneRadioBtn=Q("input",{attrs:{type:"radiobutton"}}),this.underscoreDiv=Q("div"),this.underscoreRadioBtn=Q("input",{attrs:{type:"radiobutton"}}),this.noneDiv.appendChild(this.noneRadioBtn),this.underscoreDiv.appendChild(this.underscoreRadioBtn),this.tabLeaderPropertyDiv1.appendChild(this.noneDiv),this.tabLeaderPropertyDiv1.appendChild(this.underscoreDiv),this.none=new cb({label:"1 "+e.getConstant("None"),name:"tabLeader",value:"none",cssClass:"e-small",checked:!0,enableRtl:t}),this.underscore=new cb({label:"4 _____",name:"tabLeader",value:"underscore",cssClass:"e-small",enableRtl:t}),this.none.appendTo(this.noneRadioBtn),this.underscore.appendTo(this.underscoreRadioBtn),this.tabLeaderPropertyDiv.appendChild(this.tabLeaderPropertyDiv1),this.tabLeaderPropertyDiv2=Q("div",{styles:"display: flex; flex-direction: column; width: 33.33%"}),this.dottedDiv=Q("div"),this.dottedRadioBtn=Q("input",{attrs:{type:"radiobutton"}}),this.singleDiv=Q("div"),this.singleRadioBtn=Q("input",{attrs:{type:"radiobutton"}}),this.dottedDiv.appendChild(this.dottedRadioBtn),this.singleDiv.appendChild(this.singleRadioBtn),this.dotted=new cb({label:"2 .......",name:"tabLeader",value:"dotted",cssClass:"e-small",enableRtl:t}),this.single=new cb({label:"5 -------",name:"tabLeader",value:"single",cssClass:"e-small",enableRtl:t}),this.dotted.appendTo(this.dottedRadioBtn),this.single.appendTo(this.singleRadioBtn),this.tabLeaderPropertyDiv2.appendChild(this.dottedDiv),this.tabLeaderPropertyDiv2.appendChild(this.singleDiv),this.tabLeaderPropertyDiv.appendChild(this.tabLeaderPropertyDiv2),this.tabLeaderPropertyDiv3=Q("div",{styles:"display: flex; flex-direction: column; width: 33.33%"}),this.HyphenDiv=Q("div"),this.HyphenRadioBtn=Q("input",{attrs:{type:"radiobutton"}}),this.HyphenDiv.appendChild(this.HyphenRadioBtn),this.tabLeaderPropertyDiv3.appendChild(this.HyphenDiv),this.Hyphen=new cb({label:"3 -------",name:"tabLeader",value:"hyphen",cssClass:"e-small",enableRtl:t}),this.Hyphen.appendTo(this.HyphenRadioBtn),this.tabLeaderPropertyDiv.appendChild(this.tabLeaderPropertyDiv3),this.buttonDiv=Q("div",{className:"e-de-tab-button",styles:"display: flex;"}),this.target.appendChild(this.buttonDiv),this.tableElement=Q("table"),this.buttonDiv.appendChild(this.tableElement),this.tableElement.style.width="100%",this.tableElement.insertRow()),t=i.insertCell();this.setbuttonDiv=Q("div",{className:"e-de-tab-setBtn"}),this.buttonDiv.appendChild(this.setbuttonDiv),this.setButtonElement=Q("button",{innerHTML:e.getConstant("Set"),attrs:{type:"button"}}),this.setButtonElement.setAttribute("aria-label",e.getConstant("Set")),this.setbuttonDiv.appendChild(this.setButtonElement),this.setButton=new zv({cssClass:"e-button-custom"}),this.setButton.appendTo(this.setButtonElement),t.appendChild(this.setbuttonDiv),this.setButtonElement.addEventListener("click",this.setButtonClickHandler),t.style.width="33.33%",t.style.display="table-cell",t=i.insertCell(),this.clearbuttonDiv=Q("div",{className:"e-de-tab-clearBtn"}),this.buttonDiv.appendChild(this.clearbuttonDiv),this.clearButtonElement=Q("button",{innerHTML:e.getConstant("Clear"),attrs:{type:"button"}}),this.clearButtonElement.setAttribute("aria-label",e.getConstant("Clear")),this.clearbuttonDiv.appendChild(this.clearButtonElement),this.clearButton=new zv({cssClass:"e-button-custom"}),this.clearButton.appendTo(this.clearButtonElement),this.clearButtonElement.addEventListener("click",this.clearButtonClickHandler),t.appendChild(this.clearbuttonDiv),t.style.width="33.33%",t.style.display="table-cell",t=i.insertCell(),this.clearAllbuttonDiv=Q("div",{className:"e-de-tab-clearAllBtn"}),this.buttonDiv.appendChild(this.clearAllbuttonDiv),this.clearAllButtonElement=Q("button",{innerHTML:e.getConstant("Clear All"),attrs:{type:"button"}}),this.clearAllButtonElement.setAttribute("aria-label",e.getConstant("Clear All")),this.clearAllbuttonDiv.appendChild(this.clearAllButtonElement),this.clearAllButton=new zv({cssClass:"e-button-custom"}),this.clearAllButton.appendTo(this.clearAllButtonElement),this.clearAllButtonElement.addEventListener("click",this.clearAllButtonClickHandler),t.appendChild(this.clearAllbuttonDiv),t.style.width="33.33%",t.style.display="table-cell",this.selectedTabStop=!je(this.tabStopList)&&0<this.tabStopList.length?this.tabStopList[0]:void 0,this.updateButtons()},oci.prototype.getTabAlignmentValue=function(){return this.left.checked?"Left":this.center.checked?"Center":this.right.checked?"Right":this.decimal.checked?"Decimal":this.bar.checked?"Bar":"Left"},oci.prototype.getTabLeaderValue=function(){return this.none.checked?"None":this.dotted.checked?"Dot":this.Hyphen.checked?"Hyphen":this.underscore.checked?"Underscore":this.single.checked?"Single":"None"},oci.prototype.onSelectHandlerClick=function(e){this.selectHandler(e)},oci.prototype.updateButtons=function(){je(this.selectedTabStop)?(this.updateTabAlignmentButton("Left"),this.updateTabLeaderButton("None")):(this.updateTabAlignmentButton(this.selectedTabStop.value.tabJustification),this.updateTabLeaderButton(this.selectedTabStop.value.tabLeader))},oci.prototype.updateTabLeaderButton=function(e){if(this.clearTabLeaderButton(),"Bar"!==this.getTabAlignmentValue())switch(e){case"None":this.none.checked=!0;break;case"Single":this.single.checked=!0;break;case"Dot":this.dotted.checked=!0;break;case"Hyphen":this.Hyphen.checked=!0;break;case"Underscore":this.underscore.checked=!0;break;default:this.none.checked=!0}},oci.prototype.updateTabAlignmentButton=function(e){switch(this.clearTabAlignmentButton(),e){case"Left":this.left.checked=!0;break;case"Center":this.center.checked=!0;break;case"Right":this.right.checked=!0;break;case"Decimal":this.decimal.checked=!0;break;case"Bar":return this.bar.checked=!0,this.clearTabLeaderButton(),void this.disableOrEnableTabLeaderButton(!0)}this.disableOrEnableTabLeaderButton(!1)},oci.prototype.clearTabLeaderButton=function(){this.none.checked=!1,this.single.checked=!1,this.dotted.checked=!1,this.Hyphen.checked=!1,this.underscore.checked=!1},oci.prototype.disableOrEnableTabLeaderButton=function(e){this.none.disabled=e,this.single.disabled=e,this.dotted.disabled=e,this.Hyphen.disabled=e,this.underscore.disabled=e},oci.prototype.clearTabAlignmentButton=function(){this.left.checked=!1,this.center.checked=!1,this.right.checked=!1,this.decimal.checked=!1,this.bar.checked=!1},oci.prototype.focusTextBox=function(e){this.textBoxInput.value=e;var t=this.textBoxInput;t.setSelectionRange(0,e.length),t.focus()},oci.prototype.show=function(){var e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),t=(e.setLocale(this.documentHelper.owner.locale),this.localeValue=e,this.documentHelper.owner.editorModule.getTabsInSelection());this.tabStopList=[];for(var i=0;i<t.length;i++){var n={displayText:parseFloat(t[i].position.toFixed(2))+" pt",value:t[i].clone()};this.tabStopList.push(n)}this.initTabsDialog(e,this.documentHelper.owner.enableRtl),this.documentHelper.dialog.header=e.getConstant("Tabs"),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.applyParagraphFormat,buttonModel:{content:e.getConstant("Ok"),cssClass:"e-flat e-para-okay",isPrimary:!0}},{click:this.closeTabDialog,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-para-cancel"}}],this.documentHelper.dialog.show()},oci.prototype.destroy=function(){this.removeEvents(),this.removeElements(),this.target=void 0,this.textBoxInput=void 0,this.defaultTabStopIn=void 0,this.left=void 0,this.right=void 0,this.center=void 0,this.decimal=void 0,this.bar=void 0,this.none=void 0,this.dotted=void 0,this.single=void 0,this.Hyphen=void 0,this.setButton=void 0,this.clearButton=void 0,this.clearAllButton=void 0,this.listviewInstance&&(this.listviewInstance.destroy(),this.listviewInstance=void 0),this.selectedTabStop=void 0,this.isBarClicked=void 0,this.removedItems=void 0,this.tabStopList=void 0,this.localeValue=void 0},oci.prototype.removeEvents=function(){this.textBoxDiv&&this.textBoxDiv.removeEventListener("keyup",this.textBoxInputChangeClickHandler),this.setButtonElement&&this.setButtonElement.removeEventListener("click",this.setButtonClickHandler),this.clearButtonElement&&this.clearButtonElement.removeEventListener("click",this.clearButtonClickHandler),this.clearAllButtonElement&&this.clearAllButtonElement.removeEventListener("click",this.clearAllButtonClickHandler),this.listviewInstance&&this.listviewInstance.removeEventListener("select",this.selectHandlerClickHandler)},oci.prototype.removeElements=function(){this.commonDiv&&(this.commonDiv.remove(),this.commonDiv=void 0),this.tabStopLabelDiv&&(this.tabStopLabelDiv.remove(),this.tabStopLabelDiv=void 0),this.tabStopDiv&&(this.tabStopDiv.remove(),this.tabStopDiv=void 0),this.tabListDiv&&(this.tabListDiv.remove(),this.tabListDiv=void 0),this.textBoxDiv&&(this.textBoxDiv.remove(),this.textBoxDiv=void 0),this.listviewDiv&&(this.listviewDiv.remove(),this.listviewDiv=void 0),this.defaultTablabelDiv&&(this.defaultTablabelDiv.remove(),this.defaultTablabelDiv=void 0),this.defaultTabDiv&&(this.defaultTabDiv.remove(),this.defaultTabDiv=void 0),this.defaultTabStopDiv&&(this.defaultTabStopDiv.remove(),this.defaultTabStopDiv=void 0),this.defaultTabWarningDiv&&(this.defaultTabWarningDiv.remove(),this.defaultTabWarningDiv=void 0),this.defaultTabStop&&(this.defaultTabStop.remove(),this.defaultTabStop=void 0),this.displayDiv&&(this.displayDiv.remove(),this.displayDiv=void 0),this.alignmentDiv&&(this.alignmentDiv.remove(),this.alignmentDiv=void 0),this.alignmentLabelDiv&&(this.alignmentLabelDiv.remove(),this.alignmentLabelDiv=void 0),this.alignmentPropertyDiv&&(this.alignmentPropertyDiv.remove(),this.alignmentPropertyDiv=void 0),this.alignmentPropertyDiv1&&(this.alignmentPropertyDiv1.remove(),this.alignmentPropertyDiv1=void 0),this.leftDiv&&(this.leftDiv.remove(),this.leftDiv=void 0),this.leftRadioBtn&&(this.leftRadioBtn.remove(),this.leftRadioBtn=void 0),this.decimalDiv&&(this.decimalDiv.remove(),this.decimalDiv=void 0),this.decimalRadioBtn&&(this.decimalRadioBtn.remove(),this.decimalRadioBtn=void 0),this.alignmentPropertyDiv2&&(this.alignmentPropertyDiv2.remove(),this.alignmentPropertyDiv2=void 0),this.centerDiv&&(this.centerDiv.remove(),this.centerDiv=void 0),this.centerRadioBtn&&(this.centerRadioBtn.remove(),this.centerRadioBtn=void 0),this.barDiv&&(this.barDiv.remove(),this.barDiv=void 0),this.barRadioBtn&&(this.barRadioBtn.remove(),this.barRadioBtn=void 0),this.alignmentPropertyDiv3&&(this.alignmentPropertyDiv3.remove(),this.alignmentPropertyDiv3=void 0),this.rightDiv&&(this.rightDiv.remove(),this.rightDiv=void 0),this.rightRadioBtn&&(this.rightRadioBtn.remove(),this.rightRadioBtn=void 0),this.tabLeaderDiv&&(this.tabLeaderDiv.remove(),this.tabLeaderDiv=void 0),this.tabLeaderLabelDiv&&(this.tabLeaderLabelDiv.remove(),this.tabLeaderLabelDiv=void 0),this.tabLeaderPropertyDiv&&(this.tabLeaderPropertyDiv.remove(),this.tabLeaderPropertyDiv=void 0),this.tabLeaderPropertyDiv1&&(this.tabLeaderPropertyDiv1.remove(),this.tabLeaderPropertyDiv1=void 0),this.noneDiv&&(this.noneDiv.remove(),this.noneDiv=void 0),this.noneRadioBtn&&(this.noneRadioBtn.remove(),this.noneRadioBtn=void 0),this.underscoreDiv&&(this.underscoreDiv.remove(),this.underscoreDiv=void 0),this.underscoreRadioBtn&&(this.underscoreRadioBtn.remove(),this.underscoreRadioBtn=void 0),this.tabLeaderPropertyDiv2&&(this.tabLeaderPropertyDiv2.remove(),this.tabLeaderPropertyDiv2=void 0),this.dottedDiv&&(this.dottedDiv.remove(),this.dottedDiv=void 0),this.dottedRadioBtn&&(this.dottedRadioBtn.remove(),this.dottedRadioBtn=void 0),this.singleDiv&&(this.singleDiv.remove(),this.singleDiv=void 0),this.singleRadioBtn&&(this.singleRadioBtn.remove(),this.singleRadioBtn=void 0),this.tabLeaderPropertyDiv3&&(this.tabLeaderPropertyDiv3.remove(),this.tabLeaderPropertyDiv3=void 0),this.HyphenDiv&&(this.HyphenDiv.remove(),this.HyphenDiv=void 0),this.HyphenRadioBtn&&(this.HyphenRadioBtn.remove(),this.HyphenRadioBtn=void 0),this.buttonDiv&&(this.buttonDiv.remove(),this.buttonDiv=void 0),this.tableElement&&(this.tableElement.remove(),this.tableElement=void 0),this.setbuttonDiv&&(this.setbuttonDiv.remove(),this.setbuttonDiv=void 0),this.setButtonElement&&(this.setButtonElement.remove(),this.setButtonElement=void 0),this.setButton&&(this.setButton.destroy(),this.setButton=void 0),this.clearbuttonDiv&&(this.clearbuttonDiv.remove(),this.clearbuttonDiv=void 0),this.clearButtonElement&&(this.clearButtonElement.remove(),this.clearButtonElement=void 0),this.clearButton&&(this.clearButton.destroy(),this.clearButton=void 0),this.clearAllbuttonDiv&&(this.clearAllbuttonDiv.remove(),this.clearAllbuttonDiv=void 0),this.clearAllButtonElement&&(this.clearAllButtonElement.remove(),this.clearAllButtonElement=void 0),this.clearAllButton&&(this.clearAllButton.destroy(),this.clearAllButton=void 0),this.textBoxInput&&(this.textBoxInput.remove(),this.textBoxInput=void 0)};var nci=oci;function oci(e){var s=this;this.isBarClicked=!1,this.removedItems=[],this.tabStopList=[],this.isAddUnits=!0,this.textBoxInputChangeClickHandler=this.onTextBoxInputChangeClick.bind(this),this.selectHandlerClickHandler=this.onSelectHandlerClick.bind(this),this.setButtonClickHandler=this.onSetButtonClick.bind(this),this.clearButtonClickHandler=this.onClearButtonClick.bind(this),this.clearAllButtonClickHandler=this.onClearAllButtonClick.bind(this),this.applyParagraphFormat=function(){if(s.defaultTabStopIn.value!==s.documentHelper.defaultTabWidth&&(s.documentHelper.defaultTabWidth=s.defaultTabStopIn.value),0<s.removedItems.length){for(var e=[],t=0;t<s.removedItems.length;t++)e.push(s.removedItems[parseInt(t.toString(),10)].value);s.documentHelper.owner.editorModule.removeTabStops(s.documentHelper.selection.getParagraphsInSelection(),e)}for(var i,n=je(s.selectedTabStop)?new yri:s.selectedTabStop.value,o=(n.deletePosition=0,n.tabJustification=s.getTabAlignmentValue(),n.tabLeader=s.getTabLeaderValue(),[]),t=0;t<s.tabStopList.length;t++)o.push(s.tabStopList[parseInt(t.toString(),10)].value);je(s.selectedTabStop)&&"NaN"!==(i=Y.getNumberFromString(s.textBoxInput.value)).toString()&&(n.position=i,o.push(n)),s.documentHelper.owner.editorModule.onApplyParagraphFormat("tabStop",o,!1,!1),s.closeTabDialog()},this.textBoxInputChange=function(e){for(var t=Y.getNumberFromString(s.textBoxInput.value),i=0;i<s.tabStopList.length;i++){if(Y.getNumberFromString(s.tabStopList[parseInt(i.toString(),10)].displayText)===t){s.selectedTabStop=s.tabStopList[parseInt(i.toString(),10)];break}s.selectedTabStop=void 0}s.isAddUnits=!1;var n=s.listviewInstance.dataSource.indexOf(s.selectedTabStop),n=0<=n?s.listviewInstance.dataSource[parseInt(n.toString(),10)]:void 0;s.listviewInstance.selectItem(n),s.isAddUnits=!0},this.setButtonClick=function(e){if(je(s.selectedTabStop)){r=parseFloat(Y.getNumberFromString(s.textBoxInput.value).toFixed(2));if("NaN"!==r.toString()){for(var t=new yri,i=(t.position=r,t.tabJustification=s.getTabAlignmentValue(),t.tabLeader=s.getTabLeaderValue(),[]),n=t.deletePosition=0;n<s.tabStopList.length;n++)i.push(s.tabStopList[parseInt(n.toString(),10)].value);var o=s.documentHelper.owner.editorModule.addTabStopToCollection(i,t,!0),t={displayText:parseFloat(r.toFixed(2))+" pt",value:t};s.tabStopList.splice(o,0,t),s.selectedTabStop=t,s.listviewInstance.dataSource=s.tabStopList,s.listviewInstance.refresh(),s.listviewInstance.selectItem(s.selectedTabStop)}}else{var r;(r=s.selectedTabStop.value).tabJustification=s.getTabAlignmentValue(),r.tabLeader=s.getTabLeaderValue()}},this.clearAllButtonClick=function(e){for(var t=0;t<s.tabStopList.length;t++)s.removedItems.push(s.tabStopList[parseInt(t.toString(),10)]);s.displayDiv.innerText=s.localeValue.getConstant("All"),s.tabStopList=[],s.listviewInstance.dataSource=[],s.listviewInstance.refresh(),s.selectedTabStop=void 0,s.textBoxInput.value="",s.updateButtons()},this.clearButtonClick=function(e){s.removedItems.push(s.selectedTabStop),s.displayDiv.innerText!==s.localeValue.getConstant("All")&&(""!==s.displayDiv.innerText&&(s.displayDiv.innerText+=", "),s.displayDiv.innerText+=s.selectedTabStop.displayText);var t=s.tabStopList.indexOf(s.selectedTabStop);t===s.tabStopList.length-1?(s.tabStopList.splice(t,1),s.selectedTabStop=s.tabStopList[t-1]):0===s.tabStopList.length?s.selectedTabStop=void 0:(s.tabStopList.splice(t,1),s.selectedTabStop=s.tabStopList[parseInt(t.toString(),10)]),s.listviewInstance.refresh(),je(s.selectedTabStop)?s.textBoxInput.value="":s.textBoxInput.value=!je(s.selectedTabStop)&&0<s.tabStopList.length?s.selectedTabStop.displayText:"",s.updateButtons()},this.closeTabDialog=function(){s.documentHelper.hideDialog()},this.selectHandler=function(e){s.isAddUnits&&s.focusTextBox(e.text),s.selectedTabStop=e.data,je(s.selectedTabStop)||"Bar"!==s.selectedTabStop.value.tabJustification||(s.isBarClicked=!0),s.updateButtons()},this.onBarClick=function(e){s.clearTabLeaderButton(),s.disableOrEnableTabLeaderButton(!0),s.isBarClicked=!0},this.onTabAlignmentButtonClick=function(e){s.disableOrEnableTabLeaderButton(!1),s.isBarClicked&&(s.updateTabLeaderButton("None"),s.isBarClicked=!1)},this.documentHelper=e}Object.defineProperty(sci.prototype,"paragraph",{get:function(){return this.currentWidget.paragraph},enumerable:!0,configurable:!0}),Object.defineProperty(sci.prototype,"isAtParagraphStart",{get:function(){return this.offset===this.owner.selectionModule.getStartOffset(this.paragraph)},enumerable:!0,configurable:!0}),Object.defineProperty(sci.prototype,"isAtParagraphEnd",{get:function(){return this.owner.selectionModule.isParagraphLastLine(this.currentWidget)&&this.offset===this.owner.selectionModule.getLineLength(this.currentWidget)},enumerable:!0,configurable:!0}),Object.defineProperty(sci.prototype,"isCurrentParaBidi",{get:function(){return!je(this.currentWidget.paragraph)&&this.currentWidget.paragraph.paragraphFormat.bidi},enumerable:!0,configurable:!0}),Object.defineProperty(sci.prototype,"selection",{get:function(){return this.owner.selectionModule},enumerable:!0,configurable:!0}),Object.defineProperty(sci.prototype,"hierarchicalPosition",{get:function(){return this.getHierarchicalIndexInternal()},enumerable:!0,configurable:!0}),Object.defineProperty(sci.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),sci.prototype.clone=function(){var e=new sci(this.owner);return e.currentWidget=this.currentWidget,e.offset=this.offset,e.location=this.location,e},sci.prototype.containsRtlText=function(e){for(var t=0;t<e.children.length;t++)if(e.children[t].isRightToLeft)return!0;return!1},sci.prototype.setPositionForSelection=function(e,t,i,n){var o=!1;je(t)?this.currentWidget=e:(this.currentWidget=t.line,t.nextNode instanceof Zai&&i>t.length&&(o=this.selection.isLastRenderedInline(t,t.length))),this.location=n,this.offset=o?this.selection.getParagraphLength(this.currentWidget.paragraph)+1:this.currentWidget.getOffset(t,i)},sci.prototype.setPositionFromLine=function(e,t,i){this.currentWidget=e,this.offset=t,i instanceof kri&&this.location.copy(i)},sci.prototype.setPosition=function(e,t){this.currentWidget=e,this.offset=t?this.selection.getStartOffset(e.paragraph):e.paragraph.lastChild.getEndOffset()+1,this.updatePhysicalPosition(!0)},sci.prototype.setPositionInternal=function(e){this.currentWidget=e.currentWidget,this.offset=e.offset,this.location=e.location},sci.prototype.setPositionForCurrentIndex=function(e){var e={index:e},t=this.getParagraphWidget(e);this.offset=parseFloat(e.index),this.setPositionParagraph(t,this.offset)},sci.prototype.getPage=function(e){var t=e.index.indexOf(";"),i="0";return 0<=t&&(i=e.index.substring(0,t),e.index=e.index.substring(t).replace(";","")),t=parseInt(i,10),this.documentHelper.pages[t]},sci.prototype.getParagraphWidget=function(e){var t;if(!je(e.index))return t=this.getPage(e),this.getLineWidget(void 0,e,t)},sci.prototype.getLineWidget=function(e,t,i){if(!je(t.index)){var n,o=t.index.indexOf(";"),r="0";if(0<=o&&(r=t.index.substring(0,o),t.index=t.index.substring(o).replace(";","")),"H"===r||"F"===r?e="H"===r?i.headerWidget:i.footerWidget:"FN"===r||"EN"===r?(s=t.index.indexOf(";"),n=t.index.substring(0,s),t.index=t.index.substring(s).replace(";",""),e=("FN"===r?i.footnoteWidget:i.endnoteWidget).bodyWidgets[n]):je(i)||(e=parseInt(r,10)<i.bodyWidgets.length?i.bodyWidgets[parseInt(r,10)]:i.bodyWidgets[0]),o=parseInt(r,10),e instanceof bai&&(o=t.index.indexOf(";"),r="0",r=t.index.substring(0,o),t.index=t.index.substring(o).replace(";",""),o=parseInt(r,10)),e instanceof jai&&o>=e.childWidgets.length&&(t.index="0;0",o=e.childWidgets.length-1),0<=o&&o<e.childWidgets.length){var s=e.childWidgets[o];if(s instanceof Gai)return 0<t.index.indexOf(";")&&(t.index="0"),s;if(s instanceof fai)return 0<t.index.indexOf(";")?this.getLineWidget(s,t):s instanceof _ai?this.getLineWidget(this.documentHelper.getFirstParagraphInFirstCell(s),t):s instanceof jai&&-1===t.index.indexOf(";")?this.documentHelper.getFirstParagraphInFirstCell(s.ownerTable).childWidgets[0]:void 0}else if(e.nextRenderedWidget instanceof fai)return t.index="0",e.nextRenderedWidget instanceof _ai?this.documentHelper.getFirstParagraphInFirstCell(e.nextRenderedWidget).firstChild:this.getLineWidget(e.nextRenderedWidget,t)}},sci.prototype.updatePhysicalPosition=function(e){this.currentWidget&&this.owner.isLayoutEnabled&&this.isUpdateLocation&&(this.location=this.selection.getPhysicalPositionInternal(this.currentWidget,this.offset,e))},sci.prototype.isAtSamePosition=function(e){return this.currentWidget===e.currentWidget&&this.offset===e.offset},sci.prototype.isInSameParagraphIndex=function(e){if(je(e))throw new Error("textPosition is undefined.");return this.paragraph.index===e.paragraph.index},sci.prototype.isInSameParagraph=function(e){if(je(e))throw new Error("textPosition is undefined.");return this.paragraph===e.paragraph},sci.prototype.isInSameListParagraph=function(e){if(je(e))throw new Error("textPosition is undefined.");return this.paragraph.paragraphFormat.listFormat.listId===e.paragraph.paragraphFormat.listFormat.listId},sci.prototype.isExistBefore=function(e){if(je(e))throw new Error("textPosition is undefined.");var t,i;return this.currentWidget===e.currentWidget?this.offset<e.offset:(t=this.currentWidget.paragraph)===(i=e.currentWidget.paragraph)?t.childWidgets.indexOf(this.currentWidget)<i.childWidgets.indexOf(e.currentWidget):t.containerWidget===i.containerWidget?t.isInsideTable?t.associatedCell.childWidgets.indexOf(t)<i.associatedCell.childWidgets.indexOf(i):t.containerWidget.childWidgets.indexOf(t)<i.containerWidget.childWidgets.indexOf(i):this.owner.selectionModule.isExistBefore(t,i)},sci.prototype.isExistAfter=function(e){if(je(e))throw new Error("textPosition is undefined.");var t;return this.currentWidget===e.currentWidget?this.offset>e.offset:this.currentWidget.paragraph===e.currentWidget.paragraph?this.currentWidget.paragraph.childWidgets.indexOf(this.currentWidget)>e.currentWidget.paragraph.childWidgets.indexOf(e.currentWidget):(t=this.currentWidget.paragraph,e=e.currentWidget.paragraph,!je(t)&&!je(e)&&(t.containerWidget instanceof Sai&&e.containerWidget instanceof Sai&&t.containerWidget===e.containerWidget?t.isInsideTable&&e.isInsideTable?t.associatedCell.childWidgets.indexOf(t)>e.associatedCell.childWidgets.indexOf(e):t.containerWidget.childWidgets.indexOf(t)>e.containerWidget.childWidgets.indexOf(e):this.owner.selectionModule.isExistAfter(t,e)))},sci.prototype.getHierarchicalIndexInternal=function(){return this.getHierarchicalIndex(this.currentWidget,this.offset.toString())},sci.prototype.getHierarchicalIndex=function(e,t){return e?e.getHierarchicalIndex(t):t},sci.prototype.setPositionParagraph=function(e,t){this.currentWidget=e,this.offset=t,this.updatePhysicalPosition(!0)},sci.prototype.setPositionForLineWidget=function(e,t){var i,n,o=this.selection.getLineLength(e),r=e.paragraph.childWidgets.indexOf(e);e.isLastLine()&&(je(e.paragraph.bodyWidget.footNoteReference)?o+=1:o+=e.paragraph.bodyWidget.footNoteReference.text.length),o<t?(n=void 0,r>=e.paragraph.childWidgets.length-1?(i=this.selection.getNextRenderedBlock(e.paragraph))&&i.index===e.paragraph.index&&(n=i.firstChild):n=e.paragraph.childWidgets[r+1],this.setPositionForLineWidget(n,t-o)):t<0?(i=e.paragraph.childWidgets[r-1],n=this.selection.getLineLength(i)+t,this.setPositionForLineWidget(i,n)):(this.currentWidget=e,this.offset=t,this.updatePhysicalPosition(!0))},sci.prototype.moveNextPosition=function(e){if(je(e)&&(e=!0),(n=this.selection.getNextStartInline(this.currentWidget,this.offset))instanceof Zai&&0===n.fieldType&&!je(n.fieldEnd)){if(e)return this.moveNextPositionInternal(n),void this.moveNextPosition();var e=n.fieldEnd.line,t=n.fieldEnd,t=e.getOffset(t,1),e=this.getHierarchicalIndex(e,t.toString());if(sci.isForwardSelection(this.selection.end.getHierarchicalIndexInternal(),e))return void this.selection.end.moveToInline(n.fieldEnd,1);this.moveToInline(n.fieldEnd,1)}var t=this.selection.getNextValidOffset(this.currentWidget,this.offset),e=this.paragraph.childWidgets.indexOf(this.currentWidget),i=0;if(t>this.offset){this.offset=t;var t=this.currentWidget.getInline(this.offset,i),n=t.element,i=t.index;!je(n)&&i===n.length&&(n.nextNode instanceof Zai||n.nextNode instanceof Dli)&&((t=this.documentHelper.getNextValidElement(n.nextNode))instanceof Zai&&1===t.fieldType||t instanceof Dli&&1===t.bookmarkType)&&(this.currentWidget=(n=t).line,this.offset=this.currentWidget.getOffset(n,this.documentHelper.isFormFillProtectedMode?0:1))}else if(e+1<this.paragraph.childWidgets.length){for(var o=this.paragraph.childWidgets[e+1];o&&0===o.height;){if(je(o.nextLine))if(!je(this.selection.getNextParagraphBlock(o.paragraph)))return this.currentWidget=o,void this.updateOffsetToNextParagraph(i,!1);o=o.nextLine}o&&(this.currentWidget=o,this.offset=this.selection.getStartLineOffset(this.currentWidget));t=this.currentWidget.getInline(this.offset,i);n=t.element,i=t.index,n instanceof Zai&&0===n.fieldType&&this.offset++}else this.updateOffsetToNextParagraph(i,!1);this.updatePhysicalPosition(!0)},sci.prototype.moveToPreviousParagraphInTable=function(e){var t=this.currentWidget.paragraph,e=t.isInsideTable?e.getPreviousSelectionCell(t.associatedCell):e.getPreviousParagraphBlock(t);je(e)||(this.currentWidget=e.childWidgets[e.childWidgets.length-1],this.offset=this.currentWidget.getEndOffset()+1)},sci.prototype.nextValidVisibleBlock=function(e,t){for(var i=e;e&&(e.characterFormat.hidden&&0===e.height||!e.isEmpty()&&!e.characterFormat.hidden&&0===e.height&&e.firstChild.children[0].characterFormat.hidden);)e=t?this.selection.getNextParagraphBlock(e):this.selection.getPreviousParagraphBlock(e);return je(e)?i:e},sci.prototype.setPositionForValidLine=function(e,t,i){var n;t?(n=this.selection.getFirstParagraph(e),n=this.nextValidVisibleBlock(n,!0),this.setPosition(this.getValidVisibleLine(n.childWidgets[0],t),i)):(n=this.selection.getLastParagraph(e),n=this.nextValidVisibleBlock(n,!1),this.setPosition(this.getValidVisibleLine(n.childWidgets[n.childWidgets.length-1],t),i))},sci.prototype.updateOffsetToNextParagraph=function(e,t){var i=!1,n=void 0,o=this.paragraph.childWidgets.indexOf(this.currentWidget),o=(t?o+1<this.paragraph.childWidgets.length?(o=this.paragraph.childWidgets[o+1])&&(this.currentWidget=o,this.offset=1):je(n=this.selection.getNextSelectionBlock(this.paragraph))||n.containerWidget instanceof Uai&&(i=!this.selection.start.paragraph.isInsideTable||!this.selection.getContainerCellOf(this.selection.start.paragraph.associatedCell,n.associatedCell).ownerTable.contains(n.associatedCell)):(n=this.selection.getNextParagraphBlock(this.paragraph),n=this.nextValidVisibleBlock(n,!0)),!je(n)&&0<n.childWidgets.length&&(i?(this.currentWidget=this.getValidVisibleLine(n.lastChild,!1),this.offset=this.selection.getLineLength(this.currentWidget)+1):(this.currentWidget=this.getValidVisibleLine(n.firstChild,!0),this.offset=t?1:this.selection.getStartLineOffset(this.currentWidget))),this.currentWidget.getInline(this.offset,e)),i=o.element;e=o.index,i instanceof Zai&&0===i.fieldType&&this.offset++},sci.prototype.getValidVisibleLine=function(e,t){var i=e;if(t)for(;e&&0===e.height;)e=e.nextLine;else for(;e&&0===e.height;)e=e.previousLine;return e||i},sci.prototype.updateOffsetToPrevPosition=function(e,t){var i=this.paragraph.childWidgets.indexOf(this.currentWidget),n=this.selection.getPreviousValidOffset(this.currentWidget,this.offset),o=!0;if(this.offset>n)this.offset=n,o=!1;else if(0<i){for(var r=this.paragraph.childWidgets[i-1];r&&0===r.height;){if(je(r.previousLine))if(!je(this.selection.getPreviousParagraphBlock(r.paragraph))){this.currentWidget=r,o=!0;break}r=r.previousLine}if(r){o=!1,this.currentWidget=r;for(var n=this.currentWidget.getEndOffset(),s=(this.offset=0<n?n-1:n,0),a=this.selection.getElementInfo(this.currentWidget,this.offset).element;!je(a)&&a.characterFormat.hidden;)s+=a.length,a=a.previousElement;this.offset-=s}}o&&(i=void 0,n=!1,t?je(i=this.selection.getPreviousSelectionBlock(this.paragraph))||i.containerWidget instanceof Uai&&(n=!this.selection.start.paragraph.isInsideTable||!this.selection.getContainerCellOf(this.selection.start.paragraph.associatedCell,i.associatedCell).ownerTable.contains(i.associatedCell)):(i=this.selection.getPreviousParagraphBlock(this.paragraph),i=this.nextValidVisibleBlock(i,!1)),je(i)||(n?(this.currentWidget=this.getValidVisibleLine(i.firstChild,!0),this.offset=this.selection.getStartLineOffset(this.currentWidget)):(this.currentWidget=this.getValidVisibleLine(i.lastChild,!1),this.offset=this.currentWidget.isEndsWithPageBreak||this.currentWidget.isEndsWithColumnBreak?this.currentWidget.getEndOffset()-1:this.currentWidget.getEndOffset()))),n=(t=this.currentWidget.getInline(this.offset,0)).element,t.index,n instanceof Zai&&0===n.fieldType&&this.offset++,n instanceof Zai&&(je(i=this.selection.getPreviousValidElement(n))||(this.currentWidget=(n=i).line,this.offset=this.currentWidget.getOffset(n,n.length),n instanceof Zai&&0===n.fieldType&&this.offset--)),this.updatePhysicalPosition(!0)},sci.prototype.moveToNextParagraphStartInternal=function(){var e=this.currentWidget.paragraph;je(this.selection.getNextParagraphBlock(e))||(this.currentWidget=this.selection.getNextParagraphBlock(e).firstChild,this.offset=this.selection.getStartOffset(e),this.updatePhysicalPosition(!0))},sci.prototype.movePreviousPosition=function(){var e=this.currentWidget.getInline(this.offset,0),t=e.element,e=e.index;this.paragraph.childWidgets.indexOf(this.currentWidget);(t instanceof Zai&&1===t.fieldType&&!je(t.fieldBegin)||t instanceof Dli&&1===t.bookmarkType)&&this.movePreviousPositionInternal(t),this.updateOffsetToPrevPosition(e,!1)},sci.prototype.moveNextPositionInternal=function(e){var t;!je(e.fieldSeparator)&&(t=e.fieldSeparator,this.currentWidget=t.line,this.currentWidget!==e.fieldEnd.line||this.selection.hasValidInline(this.paragraph,t,e.fieldEnd))||(t=e.fieldEnd),this.currentWidget=t.line,this.offset=this.currentWidget.getOffset(t,1)},sci.prototype.moveBackward=function(){var e=this.currentWidget.getInline(this.offset,0),t=e.element,e=e.index;if(!this.owner.selectionModule.isEmpty&&!je(t)){var i=this.selection.getNextRenderedElementBox(t,e);if(i instanceof Zai&&0===i.fieldType){var n=this.owner.selectionModule.start.getHierarchicalIndexInternal(),o=i.fieldEnd.line.getOffset(i.fieldEnd,1),r=this.getHierarchicalIndex(i.fieldEnd.line,o.toString());if(!sci.isForwardSelection(r,n))return void this.owner.selectionModule.start.setPositionParagraph(i.fieldEnd.line,o)}}if(t instanceof Zai&&1===t.fieldType&&!je(t.fieldBegin)){n=this.owner.selectionModule.start.getHierarchicalIndexInternal(),o=t.line.getOffset(t,1),r=this.getHierarchicalIndex(t.line,o.toString());if(!sci.isForwardSelection(n,r))return i=t.fieldBegin.line.getOffset(t.fieldBegin,0),this.currentWidget=t.fieldBegin.line,this.offset=i,void this.updatePhysicalPosition(!0);this.movePreviousPositionInternal(t)}this.updateOffsetToPrevPosition(e,!0)},sci.prototype.moveForward=function(){var e=0,t=this.currentWidget.getInline(this.offset,e),i=t.element;if(e=t.index,!je(i)){if(!this.owner.selectionModule.isEmpty&&e===i.length&&i instanceof Zai&&1===i.fieldType){var t=this.owner.selectionModule.start.getHierarchicalIndexInternal(),n=i.fieldBegin.line.getOffset(i.fieldBegin,0),o=this.getHierarchicalIndex(i.fieldBegin.line,n.toString());if(!sci.isForwardSelection(t,o))return void this.owner.selectionModule.start.setPositionParagraph(i.fieldBegin.line,n)}i=this.selection.getNextRenderedElementBox(i,e)}if(i instanceof Zai&&!je(i.fieldEnd)){t=this.owner.selectionModule.start.paragraph.getInline(this.owner.selectionModule.start.offset,0),o=t.element,n=t.index;if(this.selection.getNextRenderedElementBox(o,n)!==i)return i=i.fieldEnd,this.currentWidget=i.line,this.offset=this.currentWidget.getOffset(i,1),void this.updatePhysicalPosition(!0);this.moveNextPositionInternal(i)}else i instanceof Zai&&(0===i.fieldType||1===i.fieldType)&&(this.currentWidget=i.line,this.offset=this.currentWidget.getOffset(i,1));e=0;var r,t=this.selection.getNextValidOffset(this.currentWidget,this.offset),o=this.selection.getLineLength(this.currentWidget),n=this.selection.isParagraphLastLine(this.currentWidget);this.offset<t?(this.offset=t,i=(r=this.currentWidget.getInline(this.offset,e)).element,e=r.index,!je(i)&&e===i.length&&i.nextNode instanceof Zai&&(r=this.documentHelper.getNextValidElement(i.nextNode))instanceof Zai&&1===r.fieldType&&(this.offset=this.currentWidget.getOffset(i=r,1))):this.offset===t&&i instanceof Zai&&1===i.fieldType&&i.previousNode instanceof rhi?this.offset=t:this.offset===t&&this.offset<o+1&&n?this.offset=o+1:this.updateOffsetToNextParagraph(e,!0),this.updatePhysicalPosition(!0)},sci.prototype.moveToInline=function(e,t){this.currentWidget=e.line,this.offset=this.currentWidget.getOffset(e,t),this.updatePhysicalPosition(!0)},sci.isForwardSelection=function(e,t){if(e===t)return!0;e=e.replace(/S;/g,""),t=t.replace(/S;/g,""),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,""),e=e.replace(/FN;/g,""),t=t.replace(/FN;/g,""),e=e.replace(/EN;/g,""),t=t.replace(/EN;/g,"");var i=e.split(";"),n=t.split(";"),o=i.length;o>n.length&&(o=n.length-1);for(var r=0;r<o;r++){var s=parseFloat(i[r]),a=parseFloat(n[r]);if(s!==a)return s<a}return!1},sci.prototype.movePreviousPositionInternal=function(e){var e=e instanceof Zai&&je(e.fieldSeparator)?this.selection.getPreviousValidElement(e.fieldBegin):this.selection.getPreviousValidElement(e),t=(this.currentWidget=e.line,e instanceof Zai||e instanceof Dli&&1===e.bookmarkType?0:e.length);this.offset=this.currentWidget.getOffset(e,t)},sci.prototype.moveToWordStartInternal=function(e){var t=this.currentWidget.getEndOffset(),i=this.currentWidget.paragraph,n=this.selection;if(2!==e||this.offset!==t&&this.offset!==t+1){if(this.offset===t+1)this.offset=t;else if(this.offset===n.getStartOffset(i)&&this.currentWidget===i.childWidgets[0]){t=n.getPreviousParagraphBlock(i);if(je(t))return;this.currentWidget=t.childWidgets[t.childWidgets.length-1],this.offset=this.currentWidget.getEndOffset()}else{this.offset===n.getStartLineOffset(this.currentWidget)&&0<=(t=i.childWidgets.indexOf(this.currentWidget))-1&&(this.currentWidget=i.childWidgets[t-1],this.offset=this.currentWidget.getEndOffset());i=this.currentWidget.getInline(this.offset,0),t=i.element,i=i.index;this.getPreviousWordOffset(t,n,i,e,t instanceof Zai&&1===t.fieldType,!1,!1,this)}1===e&&this.calculateOffset(),this.updatePhysicalPosition(!0)}},sci.prototype.getNextWordOffset=function(e,t,i,n,o,r,s){e instanceof pli?this.getNextWordOffsetSpan(e,t,i,n,o,r,s):e instanceof rhi?this.getNextWordOffsetImage(e,t,i,n,o,r,s):e instanceof Zai&&0===e.fieldType?this.getNextWordOffsetFieldBegin(e,t,i,n,o,r,s):e instanceof Zai&&2===e.fieldType||e instanceof Dli&&0===e.bookmarkType?this.getNextWordOffsetFieldSeparator(e,t,i,n,o,r,s):e instanceof Zai&&1===e.fieldType||e instanceof Dli&&1===e.bookmarkType?this.getNextWordOffsetFieldEnd(e,t,i,n,o,r,s):e instanceof Khi?this.getNextWordOffsetComment(e,t,i,n,o,r,s):e instanceof Pli&&this.getNextWordOffsetContentControl(e,t,i,n,o,r,s)},sci.prototype.getNextWordOffsetFieldBegin=function(e,t,i,n,o,r,s){var a=e.line.getOffset(e,0);e.length;je(e.fieldSeparator)?this.getNextWordOffsetFieldEnd(e.fieldEnd,0,i,n,o,r,s):0===i?this.getNextWordOffsetFieldSeparator(e.fieldSeparator,0,i,n,o,r,s):je(e.fieldEnd)||((n=e.fieldSeparator).line.paragraph!==e.fieldEnd.line.paragraph||this.selection.hasValidInline(n.line.paragraph,n,e.fieldEnd)||(n=e.fieldEnd),this.getNextWordOffset(n,0,i,!(r.paragraph===e.line.paragraph&&r.offset===a),o,r,s),o&&!je(e.fieldSeparator)&&r.paragraph===e.line.paragraph&&r.offset===e.fieldSeparator.line.getOffset(e.fieldSeparator,e.fieldSeparator.length)?r.setPositionParagraph(e.line,a):o||r.setPositionParagraph(e.fieldEnd.line,e.fieldEnd.line.getOffset(e.fieldEnd,e.fieldEnd.length)))},sci.prototype.getNextWordOffsetImage=function(e,t,i,n,o,r,s){n?(r.setPositionParagraph(e.line,e.line.getOffset(e,t)),o=!1):0===t?(t=e.line.getOffset(e,0),o=!0,r.offset===t?je(e.nextNode)?r.setPositionParagraph(e.line,t+e.length):this.getNextWordOffset(e.nextNode,0,i,n,o,r,s):r.setPositionParagraph(e.line,t)):je(e.nextNode)||this.getNextWordOffset(e.nextNode,0,i,n,o,r,s)},sci.prototype.getNextWordOffsetSpan=function(e,t,i,n,o,r,s){if("\t"===e.text||"\v"===e.text)n?(r.setPositionParagraph(e.line,e.line.getOffset(e,t)),o=!1):0===t?(o=!0,h=e.line.getOffset(e,0),r.offset===h?r.setPositionParagraph(e.line,h+e.length):r.setPositionParagraph(e.line,h)):je(e.nextNode)||this.getNextWordOffset(e.nextNode,0,i,n,o,r,s);else{var a=0;if(0===t&&o&&-1===Y.wordSplitCharacters.indexOf(e.text[0]))r.setPositionParagraph(e.line,e.line.getOffset(e,t));else if(t<e.length){var l=0<t&&e.text.length-1>=t?e.text.slice(t,e.length):e.text;if(-1!==(a=-1===(a=Y.indexOfAny(l,Y.wordSplitCharacters))&&e.nextNode instanceof Khi&&je(e.nextNode.nextNode)?e.length:a))if(n)o=!1;else{var h=e.line.getOffset(e,a+t),d=[" ","　"];if(!s&&-1!==d.indexOf(l[a])||o||e.line.paragraph!==r.paragraph||h===r.offset){var p=!1;for(-1!==d.indexOf(l[a])&&-1===d.indexOf(l[a+1])&&(p=!0,a++);a<l.length&&!p&&-1!==Y.wordSplitCharacters.indexOf(l[a]);)if(-1!==d.indexOf(l[++a])&&-1===d.indexOf(l[a+1])&&-1!==Y.wordSplitCharacters.indexOf(l[a+1])){a++;break}o=!0;var c=void 0;je(e.nextNode)||(c=e.nextNode.text),a<l.length||!je(c)&&e.line==e.nextNode.line&&-1!==d.indexOf(l[l.length-1])&&-1===d.indexOf(c[0])||je(e.nextNode)?r.setPositionParagraph(e.line,e.line.getOffset(e,a+t)):this.getNextWordOffset(e.nextNode,0,i,n,o,r,s)}else o=!0,r.setPositionParagraph(e.line,h)}else je(e.nextNode)?r.setPositionParagraph(e.line,e.line.getEndOffset()):this.getNextWordOffset(e.nextNode,0,i,n,o,r,s)}else je(e.nextNode)||this.getNextWordOffset(e.nextNode,0,i,n,o,r,s)}},sci.prototype.getNextWordOffsetFieldSeparator=function(e,t,i,n,o,r,s){je(e.nextNode)||this.getNextWordOffset(e.nextNode,0,i,n,o,r,s)},sci.prototype.getNextWordOffsetComment=function(e,t,i,n,o,r,s){je(e.nextNode)||this.getNextWordOffset(e.nextNode,0,i,n,o,r,s)},sci.prototype.getNextWordOffsetContentControl=function(e,t,i,n,o,r,s){je(e.nextNode)?r.setPositionParagraph(e.line,e.line.getEndOffset()):this.getNextWordOffset(e.nextNode,0,i,n,o,r,s)},sci.prototype.getNextWordOffsetFieldEnd=function(e,t,i,n,o,r,s){var a=e.line.getOffset(e,0),l=a+e.length;r.offset===a&&(r.setPositionParagraph(e.line,l),je(e.nextNode))||!je(e.nextNode)&&(this.getNextWordOffset(e.nextNode,0,i,!1,o,r,s),r.offset!==l)||r.setPositionParagraph(e.line,a)},sci.prototype.getPreviousWordOffset=function(e,t,i,n,o,r,s,a){e instanceof pli?this.getPreviousWordOffsetSpan(e,t,i,n,o,r,s,a):e instanceof rhi?this.getPreviousWordOffsetImage(e,t,i,n,o,r,s,a):e instanceof Zai&&0===e.fieldType?this.getPreviousWordOffsetFieldBegin(e,t,i,n,o,r,s,a):e instanceof Zai&&2===e.fieldType?this.getPreviousWordOffsetFieldSeparator(e,t,i,n,o,r,s,a):e instanceof Zai&&1===e.fieldType?this.getPreviousWordOffsetFieldEnd(e,t,i,n,o,r,s,a):e instanceof Dli?this.getPreviousWordOffsetBookMark(e,t,i,n,o,r,s,a):e instanceof lhi&&e.previousNode?this.getPreviousWordOffsetSpan(e.previousNode,t,i,n,o,r,s,a):e instanceof Khi?this.getPreviousWordOffsetComment(e,t,i,n,o,r,s,a):e instanceof Pli&&this.getPreviousWordOffsetContentControl(e,t,i,n,o,r,s,a)},sci.prototype.getPreviousWordOffsetBookMark=function(e,t,i,n,o,r,s,a){var l;e.previousNode?e.previousNode instanceof pli&&(l=e.previousNode,Y.lastIndexOfAny(l.text,Y.wordSplitCharacters)!==l.text.length-1?this.getPreviousWordOffset(l,t,i,n,o,r,s,a):a.setPositionParagraph(e.line,e.line.getOffset(e,0))):a.setPositionParagraph(e.line,t.getStartLineOffset(e.line))},sci.prototype.getPreviousWordOffsetFieldEnd=function(e,t,i,n,o,r,s,a){var l,h=e.line.getOffset(e,0),d=h+e.length;je(e.fieldSeparator)?this.getPreviousWordOffsetFieldBegin(e.fieldBegin,t,0,n,o,r,s,a):0!==n||je(e.previousNode)?je(e.fieldBegin)||0===n||((je(l=e.previousNode)||l.line.paragraph===e.fieldBegin.line.paragraph&&!t.hasValidInline(l.line.paragraph,l,e.fieldBegin))&&(l=e.fieldBegin),this.getPreviousWordOffset(l,t,l.length,n,!(a.paragraph===e.line.paragraph&&a.offset===d),r,s,a),s&&a.paragraph===e.line.paragraph&&a.offset===h?a.setPositionParagraph(e.line,d):s||a.setPositionParagraph(e.fieldBegin.line,e.fieldBegin.line.getOffset(e.fieldBegin,0))):(l=e.previousNode,this.getPreviousWordOffset(l,t,l.length,n,l instanceof Zai&&1===l.fieldType,r,s,a))},sci.prototype.getPreviousWordOffsetFieldSeparator=function(e,t,i,n,o,r,s,a){this.getPreviousWordOffsetFieldBegin(e.fieldBegin,t,e.fieldBegin.length,n,o,r,s,a)},sci.prototype.getPreviousWordOffsetComment=function(e,t,i,n,o,r,s,a){var l;e.previousNode?(l=e.previousNode,e.previousNode instanceof pli&&Y.lastIndexOfAny(l.text,Y.wordSplitCharacters)===l.text.length-1&&t.isSelectCurrentWord?a.setPositionParagraph(e.line,e.line.getOffset(e,1)):this.getPreviousWordOffset(e.previousNode,t,e.previousNode.length,n,o,r,s,a)):a.setPositionParagraph(e.line,t.getStartLineOffset(e.line))},sci.prototype.getPreviousWordOffsetContentControl=function(e,t,i,n,o,r,s,a){e.previousNode?this.getPreviousWordOffset(e.previousNode,t,e.previousNode.length,n,o,r,s,a):a.setPositionParagraph(e.line,t.getStartLineOffset(e.line))},sci.prototype.getPreviousWordOffsetFieldBegin=function(e,t,i,n,o,r,s,a){var l=e.line.getOffset(e,0),h=l+e.length;a.offset===h&&a.setPositionParagraph(e.line,l),je(e.previousNode)?e.fieldSeparator?a.setPositionParagraph(e.line,e.fieldSeparator.line.getOffset(e.fieldSeparator,e.fieldSeparator.length)):a.setPositionParagraph(e.line,t.getStartLineOffset(e.line)):(this.getPreviousWordOffset(e.previousNode,t,e.previousNode.length,n,!1,r,s,a),a.offset!==l||0===n||je(e.fieldSeparator)||a.setPositionParagraph(e.line,e.fieldSeparator.line.getOffset(e.fieldSeparator,e.fieldSeparator.length)))},sci.prototype.getPreviousWordOffsetImage=function(e,t,i,n,o,r,s,a){o?(a.setPositionParagraph(e.line,e.line.getOffset(e,i)),s=!1):i===e.length?(i=e.line.getOffset(e,e.length))===a.offset?a.setPositionParagraph(e.line,i-e.length):a.setPositionParagraph(e.line,i):je(e.previousNode)||this.getPreviousWordOffset(e.previousNode,t,e.previousNode.length,n,o,r,s,a)},sci.prototype.getPreviousWordOffsetSpan=function(e,t,i,n,o,r,s,a){if("\t"===e.text||"\v"===e.text)o?s=!1:i===e.length?(s=!0,(h=e.line.getOffset(e,e.length))===a.offset?a.setPositionParagraph(e.line,h-e.length):a.setPositionParagraph(e.line,h)):je(e.previousNode)||this.getPreviousWordOffset(e.previousNode,t,e.previousNode.length,n,o,r,s,a);else{var l=0;if(!r){for(;0<i&&" "===e.text[i-1];)i--;a.setPositionParagraph(e.line,e.line.getOffset(e,i))}if(0<i)if(r=!0,0===i&&s&&-1===Y.wordSplitCharacters.indexOf(e.text[0]))a.setPositionParagraph(e.line,e.line.getOffset(e,i)),s=!0;else{var h,d,p=e.text.length>i?e.text.slice(0,i):e.text;if(-1!==(l=Y.lastIndexOfAny(p,Y.wordSplitCharacters)))if(o)s=!1;else{for(;0<l&&s&&" "!==p[l]&&-1!==Y.wordSplitCharacters.indexOf(p[l-1]);)l--;" "===p[l]&&!je(e.nextElement)&&e.nextElement instanceof Khi&&1===e.nextElement.commentType&&l++," "!==p[l]&&"　"!==p[l]&&s||l++,s=!0,0<l?(d=e.line.getOffset(e,l),e.line.paragraph===a.paragraph&&d===a.offset?this.getPreviousWordOffsetSpan(e,t,i,n,o,r,s,a):a.setPositionParagraph(e.line,d)):e.previousNode instanceof pli?(h=e.previousNode.text,-1!==Y.wordSplitCharacters.indexOf(e.text[0])&&-1===Y.wordSplitCharacters.indexOf(h[h.length-1])?(d=e.line.getOffset(e,l),a.setPositionParagraph(e.line,d)):this.getPreviousWordOffset(e.previousNode,t,e.previousNode.length,n,o,r,s,a)):a.setPositionParagraph(e.line,e.line.getOffset(e,0))}else this.setPreviousWordOffset(e,t,i,n,o,r,s,a)}else this.setPreviousWordOffset(e,t,i,n,o,r,s,a)}},sci.prototype.setPreviousWordOffset=function(e,t,i,n,o,r,s,a){e.previousNode instanceof Xai&&e.line===e.previousNode.line?this.getPreviousWordOffset(e.previousNode,t,e.previousNode.length,n,o,r,s,a):a.setPositionParagraph(e.line,t.getStartLineOffset(e.line))},sci.prototype.validateForwardFieldSelection=function(e,t){var i=new sci(this.owner),n=(i.setPositionForCurrentIndex(e),i.isUpdateLocation=!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);e!==t&&sci.isForwardSelection(e,t);){if(!n)if(i.moveNextPosition(!1),e===i.getHierarchicalIndexInternal())break;var o=i.currentWidget.getInline(i.offset,0),r=o.element,o=o.index;if(!je(r)){var s=this.selection.start.getHierarchicalIndexInternal();if(o===r.length&&r instanceof Zai&&1===r.fieldType){if(r.line.getOffset(r,0)===this.offset)return;var a=r.fieldBegin.line,l=a.getOffset(r.fieldBegin,0),h=this.getHierarchicalIndex(a,l.toString());sci.isForwardSelection(s,h)||this.selection.start.setPositionParagraph(a,l)}s=this.selection.getNextRenderedElementBox(r,o);!je(s)&&s instanceof Xai&&(r=s)}if(n=r instanceof Zai&&0===r.fieldType&&!je(r.fieldEnd)){if(r.line.getOffset(r,0)===this.offset)return;h=r.fieldEnd,a=(h.line.paragraph,h.line.getOffset(h,1)),l=this.getHierarchicalIndex(h.line,a.toString());if(!sci.isForwardSelection(l,t))return void this.moveToInline(r.fieldEnd,1);i.moveToInline(r.fieldEnd,1)}e=i.getHierarchicalIndexInternal()}},sci.prototype.validateBackwardFieldSelection=function(e,t){for(var i=new sci(this.owner),n=(i.setPositionForCurrentIndex(e),i.isUpdateLocation=!1),o=((n=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)||(je(this.selection.start.paragraph.previousRenderedWidget)&&this.selection.start.paragraph===this.selection.end.paragraph&&this.selection.end.offset===this.selection.getStartOffset(this.selection.end.paragraph)||this.selection.start.paragraph!==this.selection.end.paragraph)&&this.selection.start.offset===this.selection.start.currentWidget.getEndOffset()&&this.selection.start.currentWidget.isLastLine()?!0:n)&&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),this.selection.start.getHierarchicalIndexInternal());e!==t&&sci.isForwardSelection(t,e);){var r=i.currentWidget.getInline(i.offset,0),s=r.element,r=r.index;if(je(s)||(r=this.selection.getNextRenderedElementBox(s,r))instanceof Zai&&0===r.fieldType&&(r=(a=r.fieldEnd.line).getOffset(r.fieldEnd,1),l=this.getHierarchicalIndex(a,r.toString()),sci.isForwardSelection(l,o)||(this.selection.start.setPositionParagraph(a,r),o=l)),s instanceof Zai&&1===s.fieldType&&!je(s.fieldBegin)){var a=s.fieldBegin.line,r=s.fieldBegin,l=a.getOffset(r,0),r=this.getHierarchicalIndex(a,l.toString());if(!sci.isForwardSelection(t,r))return void this.moveToInline(s.fieldBegin,0);i.moveToInline(s.fieldBegin,0)}else i.movePreviousPosition();e=i.getHierarchicalIndexInternal()}},sci.prototype.paragraphStartInternal=function(e,t){var i=e.getStartLineOffset(this.currentWidget);this.offset===i&&t?this.moveToNextParagraphInTableCheck()?this.moveToPreviousParagraphInTable(e):je(e.getPreviousParagraphBlock(this.currentWidget.paragraph))||(t=e.getPreviousParagraphBlock(this.currentWidget.paragraph),this.currentWidget=t.childWidgets[0],this.offset=e.getStartLineOffset(this.currentWidget)):(this.currentWidget=this.currentWidget.paragraph.getSplitWidgets()[0].childWidgets[0],this.offset=i),this.calculateOffset()},sci.prototype.calculateOffset=function(){var e=this.owner.selectionModule.start.getHierarchicalIndexInternal(),t=this.getHierarchicalIndexInternal();e!==t&&this.validateBackwardFieldSelection(e,t),this.updatePhysicalPosition(!0)},sci.prototype.moveToParagraphStartInternal=function(e,t){for(var i=this.currentWidget.paragraph;i.previousSplitWidget;)i=i.previousSplitWidget;var n=e.getStartOffset(i),n=(this.offset===n&&t?this.moveToNextParagraphInTableCheck()?this.moveToPreviousParagraphInTable(e):je(e.getPreviousParagraphBlock(this.paragraph))||(this.currentWidget=e.getPreviousParagraphBlock(this.paragraph).firstChild,this.offset=e.getStartOffset(this.paragraph)):(this.currentWidget=i.firstChild,this.offset=e.getStartLineOffset(this.currentWidget)),this.owner.selectionModule.start.getHierarchicalIndexInternal()),t=this.getHierarchicalIndexInternal();n!==t&&this.validateBackwardFieldSelection(n,t),this.updatePhysicalPosition(!1)},sci.prototype.moveToParagraphEndInternal=function(e,t){for(var i=this.currentWidget.paragraph;i.nextSplitWidget;)i=i.nextSplitWidget;this.currentWidget=i.childWidgets[i.childWidgets.length-1];var n=this.currentWidget.getEndOffset()+1;this.offset===n&&t?this.moveToNextParagraphInTableCheck()?this.moveToNextParagraphInTable():je(e.getNextParagraphBlock(this.currentWidget.paragraph))||(t=e.getNextParagraphBlock(this.currentWidget.paragraph),this.currentWidget=t.childWidgets[t.childWidgets.length-1],this.offset=this.currentWidget.getEndOffset()+1):this.offset=n,this.calculateOffset()},sci.prototype.moveUp=function(e,t){var i=this.currentWidget.paragraph,n=(this.moveToLineStartInternal(e,!0),this.movePreviousPosition(),void 0),o=this.currentWidget.paragraph;if(i.isInsideTable&&i!==o&&i.associatedCell!==o.associatedCell&&!je(o.associatedCell)&&i.associatedCell.ownerRow===o.associatedCell.ownerRow){var r=o.associatedCell.ownerRow;if(r.previousRenderedWidget instanceof jai){var s=e.getFirstCellInRegion(r.previousRenderedWidget,o.associatedCell,t,!0);this.setPositionForValidLine(s,!1,!0)}else{for(var a=r.ownerTable.previousRenderedWidget;(a=a instanceof _ai?e.getLastBlockInLastCell(a):a)instanceof _ai;);a instanceof Lai&&(a=this.nextValidVisibleBlock(a,!1),this.setPosition(this.getValidVisibleLine(a.childWidgets[a.childWidgets.length-1],!1),!1))}}else!i.isInsideTable&&this.currentWidget.paragraph.isInsideTable?(s=e.getFirstCellInRegion(this.currentWidget.paragraph.associatedCell.ownerRow,this.currentWidget.paragraph.associatedCell,this.owner.selectionModule.upDownSelectionLength,!0),this.setPositionForValidLine(s,!1,!1)):i.isInsideTable&&!je(this.currentWidget.paragraph.associatedCell)&&i.associatedCell.ownerRow.previousRenderedWidget!==i.associatedCell.ownerRow.previousSplitWidget&&i.associatedCell.ownerRow.previousRenderedWidget===this.currentWidget.paragraph.associatedCell.ownerRow&&(s=e.getLastCellInRegion(this.currentWidget.paragraph.associatedCell.ownerRow,this.currentWidget.paragraph.associatedCell,this.owner.selectionModule.upDownSelectionLength,!0),this.setPositionForValidLine(s,!1,!1));n=e.getLineWidgetParagraph(this.offset,this.currentWidget),o=e.getTop(n);(this.currentWidget.isEndsWithPageBreak||this.currentWidget.isEndsWithColumnBreak)&&this.offset===this.currentWidget.getEndOffset()-1&&(t=this.location.x),e.updateTextPositionWidget(n,new kri(t,o),this,!1)},sci.prototype.moveDown=function(e,t){var i=this.currentWidget.paragraph,n=this.currentWidget,o=(this.moveToLineEndInternal(e,!0),this.selection.getParagraphLength(this.currentWidget.paragraph)),o=(this.offset>o&&(this.offset=o),this.moveNextPosition(),void 0);if(i.isInsideTable&&i!==this.currentWidget.paragraph&&i.associatedCell!==this.currentWidget.paragraph.associatedCell&&!je(this.currentWidget.paragraph.associatedCell)&&i.associatedCell.ownerRow===this.currentWidget.paragraph.associatedCell.ownerRow){var r=this.currentWidget.paragraph.associatedCell.ownerRow;if((r=i.isInsideTable&&this.currentWidget.paragraph.isInsideTable&&1<i.associatedCell.cellFormat.rowSpan&&i.associatedCell.cellFormat.rowSpan+i.associatedCell.ownerRow.rowIndex===i.associatedCell.ownerTable.childWidgets.length?this.currentWidget.paragraph.associatedCell.ownerTable.childWidgets[this.currentWidget.paragraph.associatedCell.ownerTable.childWidgets.length-1]:r).nextRenderedWidget instanceof jai){var s=this.selection.getLastCellInRegion(r.nextRenderedWidget,this.currentWidget.paragraph.associatedCell,t,!1);this.setPositionForValidLine(s,!0,!0)}else{for(var a=this.selection.getNextRenderedBlock(r.ownerTable);(a=a instanceof _ai?this.selection.getFirstBlockInFirstCell(a):a)instanceof _ai;);a instanceof Lai&&(a=this.nextValidVisibleBlock(a,!0),this.setPosition(this.getValidVisibleLine(a.childWidgets[0],!0),!0))}}else!i.isInsideTable&&this.currentWidget.paragraph.isInsideTable?(s=this.selection.getLastCellInRegion(this.currentWidget.paragraph.associatedCell.ownerRow,this.currentWidget.paragraph.associatedCell,this.owner.selectionModule.upDownSelectionLength,!1),this.setPositionForValidLine(s,!0,!0)):i.isInsideTable&&!je(this.currentWidget.paragraph.associatedCell)&&i.associatedCell.ownerRow.nextRenderedWidget!==i.associatedCell.ownerRow.nextSplitWidget&&(i.associatedCell.ownerRow.nextRenderedWidget===this.currentWidget.paragraph.associatedCell.ownerRow?(s=e.getLastCellInRegion(this.currentWidget.paragraph.associatedCell.ownerRow,this.currentWidget.paragraph.associatedCell,this.owner.selectionModule.upDownSelectionLength,!0),this.setPositionForValidLine(s,!0,!1)):this.currentWidget.paragraph.isInsideTable&&i.associatedCell.ownerRow.nextRenderedWidget instanceof jai&&i.associatedCell.ownerRow!==this.currentWidget.paragraph.associatedCell.ownerRow&&(s=this.selection.getLastCellInRegion(i.associatedCell.ownerRow.nextRenderedWidget,this.currentWidget.paragraph.associatedCell,t,!1),this.setPositionForValidLine(s,!0,!0)));o=e.getLineWidgetParagraph(this.offset,this.currentWidget),r=this.selection.getTop(o);o!==n&&this.selection.updateTextPositionWidget(o,new kri(t,r),this,!1)},sci.prototype.moveToLineStartInternal=function(e,t){this.location.x>this.viewer.clientActiveArea.right&&(this.offset=this.offset-1);var i,n,t=e.getLineWidgetInternal(this.currentWidget,this.offset,t),t=e.getFirstElementInternal(t),o=(this.documentHelper.moveCaretPosition=1,e.getStartOffset(this.currentWidget.paragraph));je(t)&&this.offset>o?(n=(i=this.currentWidget.getInline(this.offset,0)).element,i.index,n instanceof pli&&"\v"!==n.text&&(this.offset=o)):je(t)||(o=0,o+=t instanceof Pli&&e.isHomeEnd?t.length:0,this.currentWidget=t.line,this.offset=this.currentWidget.getOffset(t,o),n=(i=this.currentWidget.getInline(this.offset,o=0)).element,o=i.index,n instanceof Zai&&(je(t=e.getPreviousValidElement(n))||(this.currentWidget=(n=t).line,this.offset=this.currentWidget.getOffset(n,n.length),n instanceof Zai&&this.offset--))),this.updatePhysicalPosition(!0)},sci.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))},sci.prototype.moveToWordEndInternal=function(e,t){var i=0,n=this.currentWidget.getEndOffset();if(this.selection.isParagraphFirstLine(this.currentWidget)&&(this.currentWidget.children[0]instanceof lhi&&(i=1),this.currentWidget.children[1]instanceof lhi)&&(i=2),this.offset+i!==n&&this.offset!==n+1||!je(this.currentWidget.nextLine)){var i=this.currentWidget.getInline(this.offset,0),o=i.element,i=i.index;this.getNextWordOffset(o,i,e,!1,!1,this,t)}else if(this.offset===n&&0!==e)this.setPositionParagraph(this.currentWidget,n+1);else{o=this.selection.getNextParagraphBlock(this.currentWidget.paragraph);if(je(o))return;this.currentWidget=o.childWidgets[0],this.offset=this.selection.getStartLineOffset(this.currentWidget),1===e&&(this.moveToNextParagraphInTableCheck()?this.moveToNextParagraphInTable():this.moveToWordEndInternal(e,t))}0!==e&&(i=this.owner.selectionModule.start.getHierarchicalIndexInternal())!==(n=this.getHierarchicalIndexInternal())&&this.validateForwardFieldSelection(i,n),this.updatePhysicalPosition(!0)},sci.prototype.moveToNextParagraphInTable=function(){var e=this.currentWidget.paragraph,e=e.isInsideTable?this.selection.getNextSelectionCell(e.associatedCell):this.selection.getNextParagraphBlock(e);je(e)||(this.currentWidget=e.childWidgets[e.childWidgets.length-1],this.offset=this.currentWidget.getEndOffset()+1)},sci.prototype.moveToPreviousParagraph=function(e){var t=e.getStartOffset(this.currentWidget.paragraph);this.offset!==t||je(e.getPreviousParagraphBlock(this.currentWidget.paragraph))||(t=e.getPreviousParagraphBlock(this.currentWidget.paragraph),this.currentWidget=t.childWidgets[0]),this.offset=e.getStartOffset(this.currentWidget.paragraph),this.updatePhysicalPosition(!0)},sci.prototype.moveToPreviousLine=function(e,t){var i=this.getHierarchicalIndexInternal(),n=e.getLineWidgetParagraph(this.offset,this.currentWidget),o=(this.moveToLineStartInternal(e,!0),this.currentWidget.paragraph.isInsideTable?this.moveUpInTable(e):this.moveBackward(),e.getLineWidgetParagraph(this.offset,this.currentWidget)),r=e.getLeft(o),t=(t<=e.getWidth(o,!0)+r&&n!==o&&(r=e.getTop(o),n=new kri(t,r),e.updateTextPositionWidget(o,n,this,!0)),this.getHierarchicalIndexInternal());this.validateBackwardFieldSelection(i,t)},sci.prototype.moveToLineEndInternal=function(e,t){this.location.x>this.viewer.clientActiveArea.right&&(this.offset=this.offset-1);var i=e.getLineWidgetParagraph(this.offset,this.currentWidget),n=e.getFirstElementInternal(i),o=this.currentWidget.paragraph.paragraphFormat.bidi;if(this.documentHelper.moveCaretPosition=2,je(n)&&this.offset===e.getStartLineOffset(this.currentWidget))this.offset=e.getParagraphLength(this.paragraph)+1,this.updatePhysicalPosition(!0);else if(!je(n)){var n=void 0,r=(o&&this.containsRtlText(i)?(o=i.getEndOffset(),n=i.getInline(o,0).element):(n=i.children[i.children.length-1])instanceof lhi&&2<i.children.length&&(n=i.children[i.children.length-3]),0);if(r+=n instanceof pli?n.length:n instanceof Pli&&e.isHomeEnd?0:1,this.currentWidget=n.line,r===n.length&&je(n.nextNode)&&e.isParagraphLastLine(this.currentWidget)){o=e.getLineLength(this.currentWidget);this.offset=t?o+1:o}else{for(var s=n;!je(s)&&s.length===r&&s.nextNode instanceof Zai;){var a=this.documentHelper.getNextValidElement(s.nextNode);s!==a&&(s=a,r=0),s instanceof Zai&&0===s.fieldType&&!je(s.fieldEnd)&&(!je((a=s).fieldSeparator)&&(s=a.fieldSeparator,this.currentWidget=s.line,this.currentWidget!==a.fieldEnd.line||e.hasValidInline(this.currentWidget.paragraph,s,a.fieldEnd))||(s=a.fieldEnd),this.currentWidget=s.line),s instanceof Zai&&(r=1)}r===s.length&&je(s.nextNode)&&r++,!t&&s instanceof Xai&&"\v"===s.text&&r--,this.offset=this.currentWidget.getOffset(s,r)}this.updatePhysicalPosition(t)}},sci.prototype.moveToNextLine=function(e){var t=this.selection,i=new sci(this.owner),n=(i.setPositionInternal(this),this.getHierarchicalIndexInternal()),o=(t.getLineWidgetParagraph(this.offset,this.currentWidget),this.moveToLineEndInternal(t,!0),!i.isAtSamePosition(this)),r=(i.setPositionInternal(this),this.currentWidget.paragraph.isInsideTable?this.moveDownInTable(t):(this.moveNextPosition(),0!==this.offset&&this.moveForward()),t.getLineWidgetParagraph(this.offset,this.currentWidget)),s=t.getLeft(r),a=t.getFirstElementInternal(r),a=je(a)?t.getWidth(r,!0):t.getLeftInternal(r,a,1)-s,a=(s<e&&a/2<e-s?(a=t.getTop(r),a=new kri(e,a),t.updateTextPositionWidget(r,a,this,!0),t.getWidth(r,!0)<e-s&&this.moveToLineEndInternal(t,!0)):o&&this.currentWidget.paragraph.isInsideTable&&this.currentWidget===this.owner.selectionModule.start.currentWidget?this.setPositionInternal(i):o||this.moveToLineEndInternal(t,!0),this.getHierarchicalIndexInternal());this.validateForwardFieldSelection(n,a)},sci.prototype.moveUpInTable=function(e){var t=!1,i=this.owner.selectionModule.end,n=!this.owner.selectionModule.isEmpty;if(t=i.paragraph.isInsideTable){var o=this.currentWidget.paragraph.associatedCell,r=i.paragraph.associatedCell,s=e.getContainerCellOf(r,o);if(t=s.ownerTable.contains(o)){e.getSelectedCell(r,s),o=e.getSelectedCell(o,s);var a,l,r=e.containsCell(s,this.currentWidget.paragraph.associatedCell),i=(i=e.isCellSelected(s,this,i))||this.currentWidget.paragraph===e.getFirstParagraph(s)&&this.isAtParagraphStart;if((r&&i||!r)&&!je(o.ownerRow.previousRenderedWidget))return a=o.ownerRow.previousRenderedWidget,a=e.getFirstCellInRegion(a,s,this.owner.selectionModule.upDownSelectionLength,!0),l=e.getLastParagraph(a),void this.setPosition(l.childWidgets[0],!0);(r&&i&&je(o.ownerRow.previousRenderedWidget)||!r)&&(n?(o=o.ownerRow.childWidgets[0],l=e.getFirstParagraph(o),this.setPosition(l.childWidgets[0],!0)):(o=o.ownerRow.childWidgets[o.ownerRow.childWidgets.length-1],l=e.getLastParagraph(o),this.setPosition(l.childWidgets[0],!1)))}}t||(a=e.getContainerCell(this.currentWidget.paragraph.associatedCell),n?(a=a.ownerRow.childWidgets[0],l=e.getFirstParagraph(a),this.setPosition(l.childWidgets[0],!0)):(a=a.ownerRow.childWidgets[a.ownerRow.childWidgets.length-1],l=e.getLastParagraph(a),this.setPosition(l.childWidgets[0],!1))),this.moveBackward()},sci.prototype.moveDownInTable=function(e){var t=!1,i=this.owner.selectionModule.isEmpty||this.owner.selectionModule.isForward;if(t=this.owner.selectionModule.start.paragraph.isInsideTable){var n=this.owner.selectionModule.start.paragraph.associatedCell,o=this.currentWidget.paragraph.associatedCell,r=e.getContainerCellOf(n,o);if(t=r.ownerTable.contains(o)){e.getSelectedCell(n,r),o=e.getSelectedCell(o,r);var s,a,n=e.containsCell(r,this.currentWidget.paragraph.associatedCell),l=e.isCellSelected(r,this.owner.selectionModule.start,this);if((n&&l||!n)&&!je(o.ownerRow.nextRenderedWidget))return s=o.ownerRow.nextRenderedWidget,s=e.getLastCellInRegion(s,r,this.owner.selectionModule.upDownSelectionLength,!1),a=e.getLastParagraph(s),void this.setPosition(a.childWidgets[a.childWidgets.length-1],!1);(n&&l&&je(o.ownerRow.nextRenderedWidget)||!n)&&(i?(o=o.ownerRow.childWidgets[o.ownerRow.childWidgets.length-1],a=e.getLastParagraph(o),this.setPosition(a.childWidgets[a.childWidgets.length-1],!1)):(o=o.ownerRow.childWidgets[0],a=e.getFirstParagraph(o),this.setPosition(a.childWidgets[a.childWidgets.length-1],!0)))}}t||(s=e.getContainerCell(this.currentWidget.paragraph.associatedCell),i?(s=s.ownerRow.childWidgets[s.ownerRow.childWidgets.length-1],a=e.getLastParagraph(s),this.setPosition(a.childWidgets[a.childWidgets.length-1],!1)):s.ownerRow.nextRenderedWidget&&(s=s.ownerRow.nextRenderedWidget.childWidgets[0],a=e.getFirstParagraph(s),this.setPosition(a.childWidgets[a.childWidgets.length-1],!0))),this.moveForward()},sci.prototype.destroy=function(){this.offset=void 0,this.isUpdateLocation=void 0,je(this.location)||this.location.destroy(),this.location=void 0,this.currentWidget=void 0,this.owner=void 0,this.documentHelper=void 0};var rci=sci;function sci(e){this.location=new kri(0,0),this.isUpdateLocation=!0,this.owner=e,this.documentHelper=this.owner.documentHelper}Object.defineProperty(lci.prototype,"left",{get:function(){return this.leftIn},set:function(e){this.leftIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(lci.prototype,"width",{get:function(){return this.widthIn},set:function(e){this.widthIn=e},enumerable:!0,configurable:!0}),lci.prototype.destroy=function(){this.widthIn=void 0,this.leftIn=void 0,this.floatingItems=[],this.floatingItems=void 0};var aci=lci;function lci(e,t){this.leftIn=0,this.widthIn=0,this.color="",this.leftIn=e,this.widthIn=t}Object.defineProperty(dci.prototype,"screenTip",{get:function(){return this.screenTipText},enumerable:!0,configurable:!0}),Object.defineProperty(dci.prototype,"navigationLink",{get:function(){return this.linkInternal},enumerable:!0,configurable:!0}),Object.defineProperty(dci.prototype,"localReference",{get:function(){return this.localRef},enumerable:!0,configurable:!0}),Object.defineProperty(dci.prototype,"linkType",{get:function(){return this.typeInternal},enumerable:!0,configurable:!0}),Object.defineProperty(dci.prototype,"isCrossRef",{get:function(){return this.isCrossRefField},enumerable:!0,configurable:!0}),dci.prototype.parseFieldValues=function(e,t){var i=e.split("\\o "),n=(2===i.length&&(this.screenTipText=this.parseFieldValue(i[1],'"'===i[1]?'"':void 0,t),this.screenTipText=this.screenTipText.substring(0,this.screenTipText.length-1),e=i[0],i=void 0),i=e.split(" "),!1),o=!0;if(t)for(var r=0;r<i.length;r++){var s=i[r];s.length<1||("\\t"===s||"\\l"===s?n=!0:"\\n"===s?this.opensNewWindow=!0:(s=this.parseFieldValue(s,'"'===s[0]?'"':void 0,t),n?(this.localRef=s,o=n=!1):this.linkInternal=o?this.parseFieldValue(e,'"'===e[0]?'"':void 0,t):s))}else this.localRef=i[0];this.setLinkType()},dci.prototype.parseFieldValue=function(e,t,i){e=i?e.substring(1):e.substring(0);i=t?e.indexOf(t):-1;return i<0&&(i=e.length),e.substring(0,i).trim()},dci.prototype.setLinkType=function(){je(this.linkInternal)||this.linkInternal.length<1?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")},dci.prototype.destroy=function(){this.linkInternal=void 0,this.localRef=void 0,this.typeInternal=void 0,this.opensNewWindow=void 0,this.screenTipText=void 0};var hci=dci;function dci(e,t){this.linkInternal="",this.localRef="",this.opensNewWindow=!1,this.isCrossRefField=!1,this.screenTipText="";t=t.getFieldCode(e),e=t.toLowerCase();"hyperlink"===e.substring(0,9)?this.parseFieldValues(t.substring(9).trim(),!0):0===e.indexOf("ref ")&&e.match("\\h")?(this.parseFieldValues(t.substring(4).trim(),!1),this.isCrossRefField=!0):0===e.indexOf("pageref")&&this.parseFieldValues(t.substring(7).trim(),!1)}cci.prototype.destroy=function(){this.width=void 0,this.height=void 0,this.alternatetext=void 0};var pci=cci;function cci(e){this.width=0,this.height=0,this.width=e.width,this.height=e.height,this.alternatetext=e.alternateText}Object.defineProperty(gci.prototype,"ownerListLevel",{get:function(){return this.ownerListLevelIn},set:function(e){this.ownerListLevelIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(gci.prototype,"modifiedListLevel",{get:function(){return this.modifiedListLevelIn},set:function(e){this.modifiedListLevelIn=e},enumerable:!0,configurable:!0}),gci.prototype.destroy=function(){this.ownerListLevel=void 0,this.modifiedListLevel=void 0};var uci=gci;function gci(e,t){this.ownerListLevelIn=void 0,this.modifiedListLevelIn=void 0,this.ownerListLevel=e,this.modifiedListLevel=t}Object.defineProperty(fci.prototype,"ownerFormat",{get:function(){return this.ownerFormatIn},set:function(e){this.ownerFormatIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(fci.prototype,"modifiedFormat",{get:function(){return this.modifiedFormatIn},set:function(e){this.modifiedFormatIn=e},enumerable:!0,configurable:!0}),fci.prototype.destroy=function(){this.modifiedFormat&&this.modifiedFormat.destroy(),this.modifiedFormat=void 0,this.ownerFormat=void 0};var mci=fci;function fci(e,t){this.ownerFormatIn=void 0,this.modifiedFormatIn=void 0,this.ownerFormat=e,this.modifiedFormat=t}vci.prototype.revertChanges=function(e,t,i){var n=this.rowFormat.heightType,o=i.childWidgets[this.rowFormat.ownerBase.index];t.editorModule.tableResize.updateRowHeight(o,e?this.displacement:-this.displacement),t.documentHelper.layout.reLayoutTable(i),this.rowFormat.heightType!==this.rowHeightType&&(this.rowFormat.heightType=this.rowHeightType),this.rowHeightType=n};var yci=vci;function vci(e,t,i,n){this.startingPoint=t,this.rowFormat=i,this.rowHeightType=i.heightType,this.tableHierarchicalIndex=n.selectionModule.getHierarchicalIndex(e,"0")}wci.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[parseInt(t.toString(),10)],n=new Aci;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 o=0;o<i.childWidgets.length;o++){var r=i.childWidgets[parseInt(o.toString(),10)],s=new xci;s.columnIndex=r.columnIndex,s.columnSpan=r.cellFormat.columnSpan,s.preferredWidth=r.cellFormat.preferredWidth,s.preferredWidthType=r.cellFormat.preferredWidthType,n.cells.push(s)}this.rows.push(n)}this.tableHierarchicalIndex=this.owner.selectionModule.getHierarchicalIndex(e,"0")},wci.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)};var bci=wci;function wci(e,t){this.tableHolder=new ndi,this.tableFormat=new Sci,this.rows=[],this.owner=t,this.copyProperties(e)}function Cci(e){this.startingPoint=e}var Sci=function(){},Aci=function(){this.cells=[]},xci=function(){},Ici=(Object.defineProperty(Tci.prototype,"owner",{get:function(){return this.ownerIn},enumerable:!0,configurable:!0}),Object.defineProperty(Tci.prototype,"editorHistory",{get:function(){return this.owner.editorHistoryModule},enumerable:!0,configurable:!0}),Object.defineProperty(Tci.prototype,"action",{get:function(){return this.actionIn},set:function(e){this.actionIn=e,this.owner.enableCollaborativeEditing&&!this.editorHistory.isUndoing&&0===this.cellOperation.length&&("DeleteColumn"===e||"DeleteCells"===e||"ClearCells"===e||"MergeCells"===e?(this.owner.selectionModule.isTableSelected(!0)||this.owner.selectionModule.isRowSelect())&&"ClearCells"!==e&&"MergeCells"!==e||(this.insertedText=pJt.Cell,this.deleteColumnOperation(this.action)):"Accept Change"===e||"Reject Change"===e?this.createAcceptRejectOperation(this.action):"SectionBreak"===e?(this.insertedText=pJt.Section_Break,this.type="NewPage"):"SectionBreakContinuous"===e&&(this.insertedText=pJt.Section_Break,this.type="Continuous"))},enumerable:!0,configurable:!0}),Object.defineProperty(Tci.prototype,"modifiedProperties",{get:function(){return this.modifiedPropertiesIn},enumerable:!0,configurable:!0}),Object.defineProperty(Tci.prototype,"removedNodes",{get:function(){return this.removedNodesIn},enumerable:!0,configurable:!0}),Object.defineProperty(Tci.prototype,"selectionStart",{get:function(){return this.selectionStartIn},set:function(e){this.selectionStartIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(Tci.prototype,"selectionEnd",{get:function(){return this.selectionEndIn},set:function(e){this.selectionEndIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(Tci.prototype,"insertPosition",{get:function(){return this.insertPositionIn},set:function(e){this.insertPositionIn=e,!this.owner.enableCollaborativeEditing||this.owner.editorModule.isRemoteAction||""===e||je(e)||-1!==e.indexOf("C")||(this.insertIndex=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(e))},enumerable:!0,configurable:!0}),Object.defineProperty(Tci.prototype,"endPosition",{get:function(){return this.endPositionIn},set:function(e){this.endPositionIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(Tci.prototype,"viewer",{get:function(){return this.ownerIn.viewer},enumerable:!0,configurable:!0}),Tci.prototype.updateSelection=function(){this.updateCollaborativeSelection(this.owner.selectionModule.start.clone(),this.owner.selectionModule.end.clone());var e=this.owner.selectionModule.getParagraphInfo(this.owner.selectionModule.start);this.selectionStart=this.owner.selectionModule.getHierarchicalIndex(e.paragraph,e.offset.toString()),e=this.owner.selectionModule.getParagraphInfo(this.owner.selectionModule.end),this.selectionEnd=this.owner.selectionModule.getHierarchicalIndex(e.paragraph,e.offset.toString())},Tci.prototype.updateCollaborativeSelection=function(e,t){var i;this.owner.enableCollaborativeEditing&&!this.owner.editorModule.isRemoteAction&&("RemoveEditRange"===this.action?(i=this.owner.selectionModule.getEditRangeStartElement(),e=(i=this.owner.selectionModule.getPosition(i)).startPosition,t=i.endPosition):this.updateTableSelection(e,t),this.startIndex=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(e),this.owner.selectionModule.isEndOffset=!0,this.endIndex=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(t),this.owner.selectionModule.isEndOffset=!1,(i=this.owner.selectionModule.isForward)?this.startIndex-=this.owner.selectionModule.getTableRelativeValue(e,t):this.endIndex-=this.owner.selectionModule.getTableRelativeValue(t,e),!(i?e.paragraph.equals(t.paragraph)&&e.isAtParagraphStart:e.paragraph.equals(t.paragraph)&&t.isAtParagraphStart)&&e.paragraph.equals(t.paragraph)||(i?this.endIndex+=this.paraInclude(t):this.startIndex+=this.paraInclude(e)),this.owner.enableTrackChanges||this.splitOperationForDelete(e,t))},Tci.prototype.paraInclude=function(e){var t=this.owner.selectionModule.getParagraphInfo(e);return!(e.paragraph.getTotalLength()<t.offset)||e.paragraph.isInsideTable&&e.paragraph.equals(e.paragraph.associatedCell.lastChild)?0:1},Tci.prototype.updateTableSelection=function(e,t){var i,n=e,o=t;this.owner.selectionModule.isForward||(n=t,o=e),n.paragraph.isInsideTable?(t=this.owner.selectionModule.getFirstParagraph(n.paragraph.associatedCell),o.paragraph.isInsideTable?n.paragraph.associatedCell.equals(o.paragraph.associatedCell)||(i=this.owner.selectionModule.getLastParagraph(o.paragraph.associatedCell),n.setPosition(t.firstChild,!0),o.setPositionParagraph(i.lastChild,i.lastChild.getEndOffset()+1)):n.setPosition(t.firstChild,!0)):o.paragraph.isInsideTable&&(i=this.owner.selectionModule.getLastParagraph(o.paragraph.associatedCell),o.setPositionParagraph(i.lastChild,i.lastChild.getEndOffset()+1))},Tci.prototype.splitOperationForDelete=function(e,t){var i,n,o,r,s=e,a=t;this.owner.selectionModule.isForward||(s=t,a=e),s.paragraph.isInsideTable||!a.paragraph.isInsideTable||"BackSpace"!==this.action&&"Delete"!==this.action||this.owner.selectionModule.getLastBlockInLastCell(a.paragraph.associatedCell.ownerTable).associatedCell.equals(a.paragraph.associatedCell)||(t=this.startIndex,i=s.currentWidget,n=s.offset,s.setPosition(s.paragraph.firstChild,!0),this.startIndex=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(s),o=this.startIndex,r=this.owner.documentHelper.layout.getParentTable(a.paragraph.associatedCell.ownerTable),a=this.owner.selectionModule.getPositionInfoForHeaderFooter({paragraph:null,offset:0},{position:0,done:!1},r).position,this.startIndex=a+1,this.cellOperation.push(this.getDeleteOperation(this.action)),this.startIndex=a+3,0!==n&&(this.pasteContent=this.owner.sfdtExportModule.write(this.owner.documentEditorSettings.optimizeSfdt?1:0,s.currentWidget,s.offset,i,n,!1,!0),this.cellOperation.push(this.getPasteOpertion(this.pasteContent,t-o))),this.endIndex=a,this.startIndex=o,this.cellOperation.push(this.getDeleteOperation(this.action))),"PasteColumn"!==this.action&&"PasteOverwrite"!==this.action&&"PasteRow"!==this.action||(r=e.paragraph.associatedCell.ownerTable,this.startIndex=this.owner.selectionModule.getPositionInfoForHeaderFooter({paragraph:null,offset:0},{position:0,done:!1},r).position,this.endIndex=this.startIndex+this.owner.selectionModule.getBlockLength(void 0,r,0,{done:!1},!0,void 0,void 0))},Tci.prototype.setBookmarkInfo=function(e){this.removedNodes.push({bookmark:e,startIndex:e.indexInOwner,endIndex:e.reference.indexInOwner})},Tci.prototype.setContentControlInfo=function(e){this.removedNodes.push({contentcontrol:e,startIndex:e.indexInOwner,endIndex:e.reference.indexInOwner})},Tci.prototype.setFormFieldInfo=function(e,t){this.removedNodes.push({formField:e,value:t})},Tci.prototype.setEditRangeInfo=function(e){this.removedNodes.push({editStart:e,startIndex:e.indexInOwner,endIndex:e.editRangeEnd.indexInOwner})},Tci.prototype.setContentControlCheckBox=function(e,t){this.removedNodes.push({contentControlCheckBox:e,value:t})},Tci.prototype.revertFormTextFormat=function(){var e=this.removedNodes[0],t=e.value,e=e.formField;this.editorHistory.isUndoing?(this.owner.editorModule.applyTextFormatInternal(e,t),this.editorHistory.recordChanges(this)):(t=Y.formatText(e.formFieldData.format,t),this.owner.editorModule.applyTextFormatInternal(e,t),this.editorHistory.undoStack.push(this))},Tci.prototype.revertFormField=function(){var e=this.removedNodes[0],t=e.formField;t.formFieldData instanceof rli?this.owner.editorModule.toggleCheckBoxFormField(t,!0,e.value):this.owner.editorModule.updateFormField(t,e.value)},Tci.prototype.revertContentControl=function(){var e,t=this.removedNodes[0],i=t.contentcontrol;this.editorHistory.isUndoing?(e=this.owner.editorModule.getMarkerData(i),this.markerData.push(e),i.line.children.splice(t.startIndex,0,i),this.documentHelper.owner.editorModule.insertContentControlInCollection(i),this.markerData.push(e),i.reference.line.children.splice(t.endIndex,0,i.reference),this.owner.editorModule.updatePropertiesToBlock(i,!0),this.owner.selectionModule.updateContentControlHighlightSelection(),this.editorHistory.recordChanges(this),this.viewer.updateScrollBars(),this.owner.editorModule.fireContentChange()):(this.owner.editorModule.removeContentControlInternal(),this.editorHistory.undoStack.push(this))},Tci.prototype.revertBookmark=function(){var e,t,i=this.removedNodes[0],n=i.bookmark;!(je(n)||-1!==n.line.indexInOwner&&-1!==n.line.paragraph.indexInOwner||je(this.owner.documentHelper))&&0<this.owner.documentHelper.bookmarks.length&&(n=this.owner.documentHelper.bookmarks.get(n.name),this.removedNodes[0].bookmark=n),this.editorHistory.isUndoing?(e=this.owner.editorModule.getMarkerData(n),this.documentHelper.bookmarks.add(n.name,n),this.markerData.push(e),n.line.children.splice(i.startIndex,0,n),(t=n.previousNode)instanceof Zai&&!je(t.formFieldData)&&(t.formFieldData.name=n.name),this.markerData.push(e),n.reference.line.children.splice(i.endIndex,0,n.reference),this.editorHistory.currentHistoryInfo&&"InsertBookmark"===this.editorHistory.currentHistoryInfo.action||this.editorHistory.recordChanges(this),!0===this.owner.documentEditorSettings.showBookmarks&&this.viewer.updateScrollBars(),this.owner.editorModule.fireContentChange()):(this.owner.editorModule.deleteBookmarkInternal(n),this.editorHistory.currentHistoryInfo&&"InsertBookmark"===this.editorHistory.currentHistoryInfo.action||this.editorHistory.undoStack.push(this))},Tci.prototype.revertComment=function(){var e,t,i=this.insertPosition,n=this.removedNodes[0],o=!1;"ResolveComment"===this.action?(this.editorHistory.currentBaseHistoryInfo=this).owner.editorModule.resolveOrReopenComment(n,!n.isResolved):"EditComment"===this.action?(t=this.modifiedProperties[0],(e=(this.editorHistory.currentBaseHistoryInfo=this).owner.commentReviewPane.commentPane.comments.get(n)).commentText.innerText=t.text,t.text=n.text,n.text=e.commentText.innerText,this.owner.editorHistoryModule.updateHistory(),this.owner.fireContentChange()):("InsertCommentWidget"===this.action?o=this.editorHistory.isRedoing:"DeleteCommentWidget"===this.action&&(o=this.editorHistory.isUndoing),o?n&&(this.insertedElement=n.clone(),n.isReply?this.owner.editorModule.addReplyComment(n,this.insertPosition):this.owner.editorModule.addCommentWidget(n,!1,!0,!0)):(t=this.owner.editorModule.getCommentElementBox(i),this.owner.editorModule.deleteCommentWidget(t)))},Tci.prototype.revertEditRangeRegion=function(){var e,t=this.removedNodes[0],i=t.editStart;this.editorHistory.isUndoing?(e=""===i.user?i.group:i.user,this.owner.editorModule.updateRangeCollection(i,e),this.markerData.push(this.owner.editorModule.getMarkerData(i)),this.markerData.push(this.owner.editorModule.getMarkerData(i.editRangeEnd)),i.line.children.splice(t.startIndex,0,i),i.editRangeEnd.line.children.splice(t.endIndex,0,i.editRangeEnd),this.editorHistory.recordChanges(this)):(this.owner.editorModule.removeUserRestrictionsInternal(i),this.editorHistory.undoStack.push(this)),this.owner.editorModule.fireContentChange()},Tci.prototype.revertContentControlProperties=function(){var e,t=this.selectionStart,i=this.selectionEnd;!je(this.selectionStart)&&!je(this.selectionEnd)&&(t=this.owner.selectionModule.getTextPosBasedOnLogicalIndex(t),i=this.owner.selectionModule.getTextPosBasedOnLogicalIndex(i),this.owner.selectionModule.selectRange(t,i),t=this.owner.selection.currentContentControl)&&("CheckBox"===t.contentControlProperties.type&&0===this.modifiedProperties.length?(i=this.removedNodes[0],this.owner.editorModule.toggleContentControlCheckBox(t,!i.value),i.value=!i.value):(i=this.modifiedProperties.pop(),e=(this.editorHistory.currentBaseHistoryInfo=this).owner.editorModule.getContentControlPropObject(t.contentControlProperties),this.owner.editorModule.assignContentControl(t.contentControlProperties,i),this.modifiedProperties.push(e),this.format=JSON.stringify(i))),this.editorHistory.isUndoing?this.editorHistory.recordChanges(this):this.editorHistory.undoStack.push(this),this.owner.editorModule.fireContentChange()},Tci.prototype.revert=function(){if("FormTextFormat"===this.action)this.revertFormTextFormat();else if("UpdateFormField"===this.action)this.revertFormField();else if("DeleteBookmark"===this.action)this.revertBookmark();else if("RemoveContentControl"===this.action)this.revertContentControl();else if("RemoveEditRange"===this.action)this.revertEditRangeRegion();else if("InsertCommentWidget"===this.action||"DeleteCommentWidget"===this.action||"ResolveComment"===this.action||"EditComment"===this.action)this.revertComment();else if("UpdateContentControl"===this.action)this.revertContentControlProperties();else{"ListFormat"===this.action&&""!==this.owner.editorModule.listNumberFormat&&(t=(e=this.documentHelper.lists[0].abstractList.levels[this.owner.editorModule.listLevelNumber]).listLevelPattern,i=e.numberFormat,e.listLevelPattern=this.owner.editorModule.listLevelPattern,e.numberFormat=this.owner.editorModule.listNumberFormat,this.owner.editorModule.listLevelPattern=t,this.owner.editorModule.listNumberFormat=i),this.owner.isShiftingEnabled=!0;var e=void 0,t=void 0,i=this.selectionStart,n=this.selectionEnd,o=(this.collabStart=this.selectionStart,this.collabEnd=this.selectionEnd,rci.isForwardSelection(i,n));if(0<this.modifiedProperties.length||"Selection"===this.action||"ClearCharacterFormat"===this.action||"ClearParagraphFormat"===this.action)e=je(i)?void 0:this.owner.selectionModule.getTextPosBasedOnLogicalIndex(i),t=je(n)?void 0:this.owner.selectionModule.getTextPosBasedOnLogicalIndex(n),this.owner.enableCollaborativeEditing&&this.updateCollaborativeSelection(e,t),this.revertModifiedProperties(e,t);else{this.owner.enableCollaborativeEditing&&(je(this.insertPosition)||(this.insertIndex=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(this.insertPosition)),je(this.endPosition)||(r=this.owner.selection.getTextPosBasedOnLogicalIndex(this.insertPosition),s=this.owner.selection.getTextPosBasedOnLogicalIndex(this.endPosition),this.updateCollaborativeSelection(r,s)));var r=this.owner.selectionModule,s=this.removedNodes;if(0<this.removedNodes.length){if("InsertTable"===this.action&&this.editorHistory.isRedoing)for(var a=0;a<this.removedNodes.length;a++)this.insertedNodes.push(this.removedNodes[parseInt(a.toString(),10)]);this.isRemovedNodes=!0}else this.isRemovedNodes=!1;this.removedNodesIn=[],je(this.endPosition)&&(this.endPosition=this.insertPosition);var l=rci.isForwardSelection(this.insertPosition,this.endPosition),h=r.getTextPosBasedOnLogicalIndex(l?this.insertPosition:this.endPosition),l=r.getTextPosBasedOnLogicalIndex(l?this.endPosition:this.insertPosition);if("RemoveRowTrack"===this.action&&this.editorHistory.isUndoing&&(this.owner.selectionModule.select(this.selectionEnd,this.selectionEnd),d=this.owner.selectionModule.start.paragraph===this.owner.editor.getLastParaForBodywidgetCollection(this.owner.selectionModule.start.paragraph),this.owner.selectionModule.start.paragraph.isInsideTable||d&&this.owner.selectionModule.end.paragraph.isEmpty()&&0<s.length&&s[0]instanceof _ai)&&(this.endRevisionLogicalIndex=this.selectionEnd),this.editorHistory.isUndoing&&(this.lastElementRevision&&je(this.isAcceptOrReject)&&0<s.length&&s[0]instanceof Lai&&s[0].isEmpty()||"Delete"===this.action&&this.editorHistory.currentHistoryInfo&&"RemoveHyperlink"===this.editorHistory.currentHistoryInfo.action&&this.lastElementRevision instanceof Zai?this.endRevisionLogicalIndex=this.selectionEnd:this.lastElementRevision&&je(this.endRevisionLogicalIndex)?this.updateEndRevisionInfo():"RemoveRowTrack"===this.action&&(this.endRevisionLogicalIndex=this.selectionEnd)),"ClearRevisions"===this.action&&(f=r.getHyperlinkField(),this.isHyperlinkField&&!je(f)?(m=f.fieldSeparator.line.getOffset(f.fieldSeparator,1),l.setPositionParagraph(f.fieldSeparator.line,m),this.undoRevisionForElements(h,l,s[s.length-1]),y=f.fieldEnd,h.setPositionParagraph(y.line,y.line.getOffset(y,0)),l.setPositionParagraph(y.line,y.line.getOffset(y,1))):this.owner.selectionModule.select(this.selectionEnd,this.selectionEnd),this.undoRevisionForElements(h,l,s[s.length-1]),d=s[s.length-1],-1===this.removedNodes.indexOf(d)&&this.removedNodes.push(d),s=[]),"Uppercase"===this.action)return r.selectPosition(h,l),(p=(this.editorHistory.currentBaseHistoryInfo=this).owner.editorModule).changeSelectedTextCase(r,h,l,this.action.toString(),s),void p.reLayout(r);if("Lowercase"===this.action)return r.selectPosition(h,l),(p=(this.editorHistory.currentBaseHistoryInfo=this).owner.editorModule).changeSelectedTextCase(r,h,l,this.action.toString(),s),void p.reLayout(r);if("CapitalizeEachWord"===this.action)return r.selectPosition(h,l),(p=(this.editorHistory.currentBaseHistoryInfo=this).owner.editorModule).changeSelectedTextCase(r,h,l,this.action.toString(),s),void p.reLayout(r);if("SentenceCase"===this.action)return r.selectPosition(h,l),(p=(this.editorHistory.currentBaseHistoryInfo=this).owner.editorModule).changeSelectedTextCase(r,h,l,this.action.toString(),s),void p.reLayout(r);if("ToggleCase"===this.action)return r.selectPosition(h,l),(p=(this.editorHistory.currentBaseHistoryInfo=this).owner.editorModule).changeSelectedTextCase(r,h,l,this.action.toString(),s),void p.reLayout(r);h.isAtSamePosition(l)?r.selectContent(h,!0):r.selectPosition(h,l),"InsertHyperlink"===this.action&&this.editorHistory.isRedoing&&!je(f=this.owner.selectionModule.getHyperlinkField())&&(m=f.line.getOffset(f,0),h.setPositionParagraph(f.line,m),this.owner.selectionModule.start.setPositionInternal(h),m=f.fieldEnd.line.getOffset(f.fieldEnd,1),l.setPositionParagraph(f.fieldEnd.line,m)),(this.editorHistory.currentBaseHistoryInfo=this).selectionStart=this.insertPosition,this.insertPosition=void 0,this.selectionEnd=this.endPosition,this.endPosition=void 0;var d=!1,p=!1;if("DeleteCells"!==this.action&&"RemoveRowTrack"!==this.action||(p=!0),this.endRevisionLogicalIndex&&0<s.length&&(m=r.getTextPosBasedOnLogicalIndex(this.endRevisionLogicalIndex),(this.editorHistory.isUndoing&&!this.editorHistory.currentBaseHistoryInfo.isRevisionEndInAnotherCell||this.editorHistory.isRedoing&&h.isAtSamePosition(l))&&r.selectPosition(h,m),this.collabEnd=this.endRevisionLogicalIndex,this.owner.enableCollaborativeEditing&&(this.endIndex=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(m),this.endIndex+=this.paraInclude(m)),this.editorHistory.isUndoing||this.editorHistory.isRedoing&&!this.owner.selectionModule.isEmpty&&0<s.length)&&(this.owner.editorModule.deleteSelectedContents(r,!0,p),d=!0),h.isAtSamePosition(l)||d?"SectionBreakContinuous"===this.action&&h&&this.editorHistory.isUndoing?0===h.offset&&!je(h.paragraph.previousRenderedWidget)&&h.paragraph.previousRenderedWidget instanceof Lai&&h.paragraph.previousRenderedWidget.isEndsWithPageBreak&&h.paragraph.containerWidget instanceof Sai&&h.currentWidget===h.currentWidget.paragraph.firstChild&&"NoBreak"===h.paragraph.containerWidget.sectionFormat.breakCode&&(m=h.paragraph.previousRenderedWidget.containerWidget,this.owner.editorModule.combineSectionInternal(this.owner.selectionModule,m,h.paragraph.containerWidget),this.owner.editorModule.layoutWholeDocument()):(d=!1,h.isAtSamePosition(l)||(d="BackSpace"===this.action||"Delete"===this.action||"ClearCells"===this.action||"DeleteCells"===this.action)):(d="BackSpace"===this.action||"Delete"===this.action||"ClearCells"===this.action||"DeleteCells"===this.action||"PasteOverwrite"===this.action||"PasteRow"===this.action||"PasteNested"===this.action,m=0<s.length&&"ParaMarkTrack"===this.action||"ClearRevisions"===this.action||"AcceptTOC"===this.action,d||"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||(r.end.setPositionInternal(l),this.owner.selectionModule.isEmpty)||m||(this.editorHistory.isRedoing&&"Accept Change"!==this.action&&"ParaMarkTrack"!==this.action&&"ParaMarkReject"!==this.action&&"RemoveRowTrack"!==this.action?this.owner.editorModule.removeSelectedContents(r):(f=r.getHyperlinkField(),this.isHyperlinkField&&!je(f)&&this.editorHistory.isRedoing&&"Accept Change"===this.action?(y=f.fieldEnd,r.start.setPositionParagraph(f.line,f.line.getOffset(f,0)),r.end.setPositionParagraph(f.fieldSeparator.line,f.fieldSeparator.line.getOffset(f.fieldSeparator,1)),this.owner.editorModule.deleteSelectedContents(r,!0),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.editorHistory.currentBaseHistoryInfo.removedNodes.reverse(),r.start.setPositionParagraph(y.line,y.line.getOffset(y,0)),r.end.setPositionParagraph(y.line,y.line.getOffset(y,1)),this.owner.editorModule.deleteSelectedContents(r,!0),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.editorHistory.currentBaseHistoryInfo.removedNodes.reverse()):this.owner.editorModule.deleteSelectedContents(r,!0)),!je(this.editorHistory.currentHistoryInfo)&&"PageBreak"===this.editorHistory.currentHistoryInfo.action&&this.documentHelper.blockToShift&&this.documentHelper.layout.shiftLayoutedItems(!1))),"Paste"===this.action&&0<this.pastedComments.length)if(this.editorHistory.isUndoing)for(a=0;a<this.pastedComments.length;a++){var c=this.pastedComments[a];this.owner.editorModule.deleteCommentWidget(c)}else if(this.editorHistory.isRedoing)for(var u=0;u<this.pastedComments.length;u++){c=this.pastedComments[u];if(this.owner.editorModule.addCommentWidget(c,!1,this.owner.showComments,!1),0<c.replyComments.length)for(var g=0;g<c.replyComments.length;g++)this.owner.commentReviewPane.addReply(c.replyComments[g],!1,!1)}var m=this.editorHistory.isRedoing&&!d;d=!this.lastElementRevision&&d,this.revertModifiedNodes(s,m,o?i:n,i===n,o?n:i),d&&this.removeContent(h,l,p)}var f=!1,y=!1,r=(je(this.editorHistory.currentHistoryInfo)||"Reject All"!==this.editorHistory.currentHistoryInfo.action&&"Accept All"!==this.editorHistory.currentHistoryInfo.action&&"Paste"!==this.editorHistory.currentHistoryInfo.action||(y=!0),("TrackingPageBreak"!==this.action&&((this.editorHistory.isUndoing||this.endRevisionLogicalIndex||"RemoveRowTrack"===this.action||y)&&je(this.editorHistory.currentHistoryInfo)||y)||("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))&&(t="RemoveRowTrack"===this.action&&this.editorHistory.isRedoing?(e=je(this.selectionStart)?void 0:this.owner.selectionModule.getTextPosBasedOnLogicalIndex(this.selectionStart),je(this.selectionEnd)?void 0:this.owner.selectionModule.getTextPosBasedOnLogicalIndex(this.selectionEnd)):(e=je(i)?void 0:this.owner.selectionModule.getTextPosBasedOnLogicalIndex(i),je(n)?void 0:this.owner.selectionModule.getTextPosBasedOnLogicalIndex(n)),"ModifyStyle"!==this.action&&this.owner.selectionModule.selectRange(e,t),this.documentHelper.updateFocus(),f=!0),this.owner.trackChangesPane.isTrackingPageBreak=!1,this.insertIndex);this.insertPosition=i,this.endPosition=n,"InsertHyperlink"===this.action&&(this.insertIndex=r),je(this.editorHistory.currentHistoryInfo)||"Accept All"!==this.editorHistory.currentHistoryInfo.action&&"Reject All"!==this.editorHistory.currentHistoryInfo.action&&"RemoveComment"!==this.editorHistory.currentHistoryInfo.action||this.owner.documentHelper.blockToShift&&this.owner.documentHelper.layout.shiftLayoutedItems(!1),this.owner.editorModule.reLayout(this.owner.selectionModule,this.owner.selectionModule.isEmpty),this.editorHistory.isUndoing&&"SectionBreak"===this.action&&(this.owner.editorModule.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.owner.editorModule.layoutWholeDocument(),this.owner.editorModule.isSkipOperationsBuild=!1),f&&this.documentHelper.scrollToPosition(this.owner.selectionModule.start,this.owner.selectionModule.end),this.highlightListText()}},Tci.prototype.highlightListText=function(){var e;je(this.editorHistory.currentHistoryInfo)||("ListCharacterFormat"===this.action||"ListSelect"===this.editorHistory.currentHistoryInfo.action&&"ListFormat"===this.action)&&(e=this.owner.selectionModule.getTextPosBasedOnLogicalIndex(this.selectionStart).currentWidget,this.documentHelper.selection.highlightListText(e))},Tci.prototype.removeContent=function(e,t,i){(!je(e.paragraph.containerWidget)&&e.paragraph.containerWidget instanceof Sai&&!je(t.paragraph.containerWidget)&&t.paragraph.containerWidget instanceof Sai||!je(e.paragraph.containerWidget)&&!je(t.paragraph.containerWidget)&&e.paragraph.containerWidget instanceof Uai&&t.paragraph.containerWidget instanceof Uai&&!je(e.paragraph.bodyWidget)||!je(e.paragraph.containerWidget)&&!je(t.paragraph.containerWidget)&&e.paragraph.containerWidget instanceof Zli&&t.paragraph.containerWidget instanceof Zli)&&(this.owner.selectionModule.selectRange(e,t),this.documentHelper.updateFocus(),e=!1,"BackSpace"!==this.action&&"Uppercase"!==this.action&&"RemoveRowTrack"!==this.action||(e=!0),this.owner.editorModule.deleteSelectedContents(this.owner.selectionModule,e,i))},Tci.prototype.updateEndRevisionInfo=function(){this.lastElementRevision=this.checkAdjacentNodeForMarkedRevision(this.lastElementRevision);var e,t=this.retrieveEndPosition(this.lastElementRevision),t=this.owner.selectionModule.getParagraphInfo(t),i=t.paragraph==this.owner.editor.getLastParaForBodywidgetCollection(t.paragraph),n=(t.paragraph.isInsideTable&&t.paragraph==this.owner.selection.getLastParagraph(t.paragraph.associatedCell)&&(i=!0),!!je(this.selectionEnd));je(this.selectionEnd)||(e=this.owner.selectionModule.getTextPosBasedOnLogicalIndex(this.selectionEnd),n=(e=this.owner.selectionModule.getParagraphInfo(e)).paragraph!==t.paragraph||e.paragraph.getLength()+1===e.offset),t.paragraph.getLength()==t.offset&&n&&!i&&t.offset++,this.endRevisionLogicalIndex=this.owner.selectionModule.getHierarchicalIndex(t.paragraph,t.offset.toString()),this.lastElementRevision.isMarkedForRevision=!1},Tci.prototype.retrieveEndPosition=function(e){var t=new rci(this.owner),i=e.line.getOffset(e,0)+e.length;return t.setPositionFromLine(e.line,i),t},Tci.prototype.checkAdjacentNodeForMarkedRevision=function(e){for(var t,i=e.nextNode;!je(i)&&i.isMarkedForRevision;)i=(t=i).nextNode;return je(t)?e:t},Tci.prototype.revertModifiedProperties=function(e,t){"CellFormat"!==this.action&&"CellOptions"!==this.action&&"TableOptions"!==this.action||(this.owner.isShiftingEnabled=!1),je(e)||je(t)||this.owner.selectionModule.selectRange(e,t),this.documentHelper.updateFocus(),"RowResizing"===this.action||"CellResizing"===this.action?this.revertResizing():"CellOptions"===this.action||"TableOptions"===this.action?this.revertTableDialogProperties(this.action):"Selection"!==this.action&&this.revertProperties()},Tci.prototype.redoAction=function(){var e=this.owner.editorModule;switch(this.action=this.action,this.action){case"BackSpace":e.singleBackspace(this.owner.selectionModule,!0);break;case"Delete":e.singleDelete(this.owner.selectionModule,!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.selectionModule,!0);break;case"SectionBreakContinuous":e.insertSection(this.owner.selectionModule,!0,void 0,!0);break;case"TableAutoFitToContents":e.autoFitTable("FitToContents");break;case"TableAutoFitToWindow":e.autoFitTable("FitToWindow");break;case"TableFixedColumnWidth":e.autoFitTable("FixedColumnWidth");break;case"RemoveRowTrack":this.owner.selectionModule.handleAcceptReject(!0)}},Tci.prototype.revertModifiedNodes=function(e,t,i,n,o){var r,s,a,l;(!t||"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&&"SectionBreakContinuous"!==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&&"SectionBreakContinuous"!==this.action))&&0<e.length&&(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?(t=this.selectionStart,r=this.owner.editorModule.getBlock({index:t}).node,a=e[e.length-1],(r instanceof _ai||r.previousRenderedWidget instanceof _ai||r.isInsideTable)&&a instanceof _ai?(r instanceof Lai&&!r.isInsideTable?r=r.previousRenderedWidget:r instanceof Lai&&r.isInsideTable&&(r=r.associatedCell.ownerTable),r=r.combineWidget(this.viewer),this.owner.enableCollaborativeEditing&&(this.startIndex=this.owner.selectionModule.getPositionInfoForHeaderFooter({paragraph:null,offset:0},{position:0,done:!1},r).position,this.endIndex=this.startIndex+this.owner.selectionModule.getBlockLength(void 0,r,0,{done:!1},!0,void 0,void 0),l=this.getDeleteOperation("Delete"),this.owner.enableTrackChanges&&(je(l.markerData)&&(l.markerData={}),l.markerData.isSkipTracking=!0),this.cellOperation.push(l)),this.owner.editorModule.insertTableInternal(r,a,!1),"PasteColumn"===this.action||"PasteRow"===this.action||"PasteOverwrite"===this.action||"PasteNested"===this.action?this.removedNodes.push(r):(e.splice(e.indexOf(a),1),0<e.length&&(!je(e[e.length-1])&&!je(a.nextRenderedWidget)&&a.nextRenderedWidget instanceof Lai&&(this.owner.selectionModule.start.setPositionParagraph(a.nextRenderedWidget.firstChild,0),this.owner.selectionModule.end.setPositionParagraph(a.nextRenderedWidget.firstChild,0)),this.insertRemovedNodes(e,e[e.length-1])))):a instanceof _ai&&"RemoveRowTrack"!==this.action?this.owner.editorModule.insertBlock(a):this.insertRemovedNodes(e,e[e.length-1])):(r=this.owner.editorModule.getBlock({index:i}).node,0<e.length&&("BackSpace"===this.action&&n||!(r instanceof _ai)&&!(r instanceof Iai))&&((a=e[0])instanceof Sai&&!je(e[1])&&(a=e[1]),("TrackingPageBreak"===this.action||("SectionBreak"===this.action||"SectionBreakContinuous"===this.action)&&a instanceof Sai||!je(this.editorHistory.currentHistoryInfo)&&"PageBreak"===this.editorHistory.currentHistoryInfo.action)&&(a=e[1]),t=!1,!je(this.isAcceptOrReject)&&(t=!0,!je(this.owner.selectionModule.start.paragraph.nextRenderedWidget)&&this.owner.selectionModule.start.paragraph.nextRenderedWidget instanceof _ai||"BackSpace"===this.action&&2==e.length&&a instanceof Lai&&a.isEmpty()&&e[1]instanceof Lai&&e[1].isEmpty())&&(t=!1),a instanceof Lai&&0<this.owner.selectionModule.start.offset&&!t&&(this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&"Paste"===this.editorHistory.currentBaseHistoryInfo.action&&1===e.length?this.owner.editorModule.insertNewParagraphWidget(a,!1):this.owner.editorModule.insertNewParagraphWidget(a,!0),0<a.characterFormat.removedIds.length&&this.owner.editorModule.constructRevisionFromID(a.characterFormat,void 0),e.splice(e.indexOf(a),1),je(r))&&(s=this.documentHelper.selection.getNextParagraphBlock(a.getSplitWidgets().pop()),this.owner.selectionModule.getNextRenderedBlock(a),n=this.owner.selectionModule.start.paragraph,je(s=!(s&&n&&n.bodyWidget instanceof Sai)||n.isInsideTable||this.owner.selectionModule.isinEndnote||this.owner.selectionModule.isinFootnote||n.bodyWidget.equals(s.bodyWidget)?s:void 0))&&this.owner.selectionModule.selectParagraphInternal(a,!0),a instanceof _ai)&&0<this.owner.selectionModule.start.offset&&(t=e[e.length-1])instanceof Lai&&(this.owner.editorModule.insertNewParagraphWidget(t,!0),e.splice(e.indexOf(t),1),je(r))&&je(s=this.documentHelper.selection.getNextParagraphBlock(t.getSplitWidgets().pop()))&&this.owner.selectionModule.selectParagraphInternal(t,!0),0<e.length&&(n=e[e.length-1],r instanceof _ai&&(r=r.combineWidget(this.viewer),n instanceof _ai)&&(this.owner.enableCollaborativeEditing&&(s=(a=this.owner.selectionModule.getPositionInfoForHeaderFooter({paragraph:null,offset:0},{position:0,done:!1},r).position)+this.owner.selectionModule.getBlockLength(void 0,r,0,{done:!1},!0,void 0,void 0),(l=this.getDeleteOperation("Delete")).offset=a,l.length=s-a,this.cellOperation.push(l)),this.owner.editorModule.insertTableInternal(r,n,!0),e.splice(e.indexOf(n),1),this.insertPosition=i,r=(t=n.getSplitWidgets().pop()).nextRenderedWidget instanceof _ai?t.nextRenderedWidget:this.owner.editorModule.getBlock({index:i}).node),n instanceof Lai&&0<this.owner.selectionModule.start.offset&&this.owner.selectionModule.start.offset===this.owner.selectionModule.getLineLength(this.owner.selectionModule.start.paragraph.lastChild)?((s=this.owner.editorModule).insertNewParagraphWidget(n,!1),0<n.characterFormat.removedIds.length&&this.owner.editorModule.constructRevisionFromID(n.characterFormat,void 0),e.splice(e.indexOf(n),1),"Paste"!==this.action&&this.owner.selectionModule.start.paragraph!==n.containerWidget.lastChild&&s.removeBlock(this.owner.selectionModule.start.paragraph),je(a=this.documentHelper.selection.getNextParagraphBlock(n.getSplitWidgets().pop()))||n===n.containerWidget.lastChild?je(n)||this.owner.selectionModule.selectParagraphInternal(n,!1):this.owner.selectionModule.selectParagraphInternal(a,!0)):e[0]instanceof _ai&&1!==e.length&&(l=e[1])instanceof Lai&&l.isEmpty()&&e.splice(e.indexOf(l),1)),0<e.length&&(r instanceof _ai&&(r=r.combineWidget(this.viewer)),this.insertRemovedNodes(e,r,o))))},Tci.prototype.insertRemovedNodes=function(e,t,i){for(var n=!1,o=this.owner.selection.start.paragraph.isInsideTable,r=e.length-1;-1<r;r--){var s=e[r];if(0===r&&(o=!1),this.isHyperlinkField&&!je(i)&&s instanceof Zai&&1===s.fieldType&&(this.owner.selectionModule.start.setPositionInternal(this.owner.selectionModule.getTextPosBasedOnLogicalIndex(i)),this.owner.selectionModule.end.setPositionInternal(this.owner.selectionModule.start)),s instanceof Xai)this.owner.editorModule.insertInlineInSelection(this.owner.selectionModule,s);else if(s instanceof Lai&&void 0===s.childWidgets)this.owner.selection.moveToNextParagraph();else if(s instanceof Dai)s instanceof jai?t instanceof _ai&&(t.childWidgets.splice(0,0,s),this.owner.editorModule.updateNextBlocksIndex(s,!0),0!==r&&e[r-1]instanceof jai||this.documentHelper.layout.layoutBodyWidgetCollection(t.index,t.containerWidget,t,!1)):t instanceof _ai&&"RemoveRowTrack"!==this.action?this.owner.editorModule.insertBlockTable(this.owner.selectionModule,s,t):s instanceof Lai&&!s.isInsideTable&&"RemoveRowTrack"===this.action?this.owner.editorModule.insertNewParagraphWidget(s,!1):s instanceof _ai&&"RemoveRowTrack"===this.action?(this.owner.editorModule.insertTableInternal(s,s,!1,!0),!je(e[r-1])&&!je(s.nextRenderedWidget)&&s.nextRenderedWidget instanceof Lai&&(this.owner.selectionModule.start.setPositionParagraph(s.nextRenderedWidget.firstChild,0),this.owner.selectionModule.end.setPositionParagraph(s.nextRenderedWidget.firstChild,0))):this.owner.editorModule.insertBlock(s,o);else if(s instanceof Eri){var a=this.selectionStart,l=this.owner.editorModule.getBlock({index:a}).node;if(l instanceof Lai)if(0<s.removedIds.length)l.characterFormat.removedIds=s.removedIds.slice(),this.owner.editorModule.constructRevisionFromID(l.characterFormat,!0);else if(0<l.characterFormat.revisions.length){for(var h=0;h<l.characterFormat.revisions.length;h++){var d=(u=l.characterFormat.revisions[h]).range.indexOf(l.characterFormat);-1!==d&&(u.range.splice(d,1),this.owner.trackChangesPane.updateCurrentTrackChanges(u),0===u.range.length)&&this.owner.revisions.remove(u)}(s.ownerBase=l).characterFormat=s}}else if(s instanceof Sai)je(s.removedHeaderFooters)||0===s.removedHeaderFooters.length||(this.owner.documentHelper.headersFooters.splice(s.sectionIndex,0,s.removedHeaderFooters[0]),s.removedHeaderFooters=void 0),this.owner.editorModule.insertSection(this.owner.selectionModule,!(n=!0),!0,void 0,void 0,s.sectionFormat);else if("string"==typeof s&&"AcceptTOC"===this.action){var a=this.selectionStart,p=this.owner.editorModule.getBlock({index:a}).node,c=this.owner.editorModule.getBlock({index:this.selectionEnd}).node,u=this.owner.documentHelper.revisionsInternal.get(s);if(this.editorHistory.isUndoing){for(;p instanceof Lai&&p!==c;)this.owner.editorModule.insertRevisionForBlock(p,u.revisionType,!0,u),p=this.documentHelper.selection.getNextParagraphBlock(p.getSplitWidgets().pop());this.owner.editorModule.insertRevisionForBlock(c,u.revisionType,!0,u)}else for(;0<u.range.length;){var g=u.range[0],m=g.revisions.indexOf(u);0<=m&&(g.revisions.splice(m,1),m=u.range.indexOf(g),u.range.splice(m,1),this.owner.trackChangesPane.updateCurrentTrackChanges(u)),0===u.range.length&&this.owner.revisions.remove(u)}this.owner.editorModule.addRemovedNodes(u.revisionID)}}n&&(this.documentHelper.contentControlCollection=[],this.owner.editorModule.layoutWholeDocument(!0))},Tci.prototype.undoRevisionForElements=function(e,t,i){var n=e.paragraph,o=t.paragraph,r=this.documentHelper.revisionsInternal.get(i),s=this.owner.selectionModule.getParagraphInfo(e).offset,a=this.owner.selectionModule.getParagraphInfo(t).offset,e=e.paragraph===t.paragraph,l=!1;if(this.editorHistory.isUndoing){for(;n!==o;){var l=!1,h=0,h=je(n.previousSplitWidget)?n.getLength():(s=n.previousSplitWidget.getLength()+1,n.previousSplitWidget.getLength()+n.getLength());this.owner.editorModule.applyRevisionForCurrentPara(n,s,h,i,!0),!je(n=this.documentHelper.selection.getNextParagraphBlock(n))&&!je(n.previousRenderedWidget)&&n.previousRenderedWidget instanceof Lai&&n.previousRenderedWidget.nextSplitWidget&&n===o&&(l=!0),n!==o&&(s=0)}n===o&&(e||(s=0),l&&(s=n.previousRenderedWidget.getLength()),this.owner.editorModule.applyRevisionForCurrentPara(n,s,a,i,!1))}else for(;0<r.range.length;){var d=r.range[0],p=d.revisions.indexOf(r);if(0<=p&&(d.revisions.splice(p,1),p=r.range.indexOf(d),r.range.splice(p,1)),0===r.range.length&&this.owner.revisions.remove(r),0<n.characterFormat.revisions.length&&this.editorHistory.isRedoing)for(var c=0;c<n.characterFormat.revisions.length;c++)0===n.characterFormat.revisions[c].range.length&&(n.characterFormat.revisions.splice(c,1),c--)}this.owner.trackChangesPane.updateCurrentTrackChanges(r),this.removedNodes.push(i)},Tci.prototype.revertResizing=function(){var e,t,i;"RowResizing"===(this.editorHistory.currentBaseHistoryInfo=this).action?this.modifiedProperties[0]instanceof yci&&(t=this.modifiedProperties[0].tableHierarchicalIndex,(i=this.owner.editorModule.getBlock({index:t}).node)instanceof _ai)&&this.modifiedProperties[0].revertChanges(this.editorHistory.isRedoing,this.owner,i):this.modifiedProperties[0]instanceof bci&&(0===this.owner.selectionModule.selectedWidgets.length&&this.owner.selectionModule.highlightSelection(!0),t=(e=this.modifiedProperties[0]).tableHierarchicalIndex,(i=this.owner.editorModule.getBlock({index:t}).node)instanceof _ai)&&(t=this.owner.editorModule.tableResize,this.owner.editorModule.setOffsetValue(this.owner.selectionModule),i=i.combineWidget(this.owner.viewer),t.currentResizingTable=i,this.modifiedProperties.splice(0,1),this.editorHistory.isUndoing||this.editorHistory.isRedoing)&&(i=new bci(i,this.owner),this.modifiedProperties.splice(0,0,i),this.owner.isLayoutEnabled=!1,t.applyProperties(t.currentResizingTable,e),t.currentResizingTable.isGridUpdated=!0,this.owner.isLayoutEnabled=!0,t.updateGridValue(t.currentResizingTable,!1),e.destroy())},Tci.prototype.revertTableDialogProperties=function(e){var t,i;this.owner.isShiftingEnabled=!1,(this.editorHistory.currentBaseHistoryInfo=this).currentPropertyIndex=0,"CellOptions"===e?(t=this.owner.selectionModule,i=this.modifiedProperties[0],this.owner.editorModule.updateCellMargins(t,i)):"TableOptions"===e&&this.owner.tableOptionsDialogModule.applyTableOptionsHelper(this.modifiedProperties[0]),this.currentPropertyIndex=0,this.owner.isShiftingEnabled=!0},Tci.prototype.addModifiedPropertiesForSection=function(e,t,i){var n;return this.editorHistory.isUndoing||this.editorHistory.isRedoing?(n=this.modifiedProperties,n=this.currentPropertyIndex<n.length?n[this.currentPropertyIndex]:n[n.length-1],je(t)?(i=n,this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=e.cloneFormat():this.modifiedProperties[this.modifiedProperties.length-1]=e.cloneFormat()):(i=n.getPropertyValue(t),n.copyFormat(e)),this.currentPropertyIndex++):je(t)?this.modifiedProperties.push(e.cloneFormat()):((n=new ari).copyFormat(e),this.modifiedProperties.push(n)),i},Tci.prototype.addModifiedProperties=function(e,t,i){var n,o,r;return this.editorHistory.isUndoing||this.editorHistory.isRedoing?(n=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1],o=!1,e.ownerBase instanceof Xai&&(r=this.modifiedNodeLength[this.currentPropertyIndex],e.ownerBase.length<r)&&(o=!0,this.modifiedNodeLength[this.currentPropertyIndex]=e.ownerBase.length,this.modifiedNodeLength.splice(this.currentPropertyIndex+1,0,r-e.ownerBase.length),(r=new Eri(void 0)).copyFormat(n),this.modifiedProperties.splice(this.currentPropertyIndex+1,0,r)),"ClearCharacterFormat"===this.action?this.editorHistory.isUndoing?(i=n,o||(this.modifiedProperties.splice(this.currentPropertyIndex,1),this.currentPropertyIndex--)):this.modifiedProperties.push(e.cloneFormat()):(i=n,this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=e.cloneFormat():this.modifiedProperties[this.modifiedProperties.length-1]=e.cloneFormat()),this.currentPropertyIndex++):(je(t)?this.modifiedProperties.push(e.cloneFormat()):((r=new Eri(void 0)).copyFormat(e),this.modifiedProperties.push(r)),e.ownerBase instanceof Xai?this.modifiedNodeLength.push(e.ownerBase.length):this.modifiedNodeLength.push(0)),i},Tci.prototype.buildCharacterFormatOperation=function(e,t){var i=this.owner.selectionModule.getElementPosition(e,!0).startPosition,n=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(i),e=(i.offset+=e.length,this.owner.selectionModule.getAbsolutePositionFromRelativePosition(i)),i=this.owner.sfdtExportModule.writeCharacterFormat(t,0,!0),t={action:"Format",offset:n,length:e-n,format:JSON.stringify(i),type:"CharacterFormat"};this.modifiedFormatOperation.push(t)},Tci.prototype.addModifiedPropertiesForParagraphFormat=function(e,t,i){if(this.editorHistory.isUndoing||this.editorHistory.isRedoing){var n=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1];if("ClearParagraphFormat"===this.action)return this.editorHistory.isUndoing?(i=n,this.modifiedProperties.splice(this.currentPropertyIndex,1),this.currentPropertyIndex--):this.modifiedProperties.push(e.cloneFormat()),this.currentPropertyIndex++,i;if(je(t))return i=n,this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=e.cloneFormat():this.modifiedProperties[this.modifiedProperties.length-1]=e.cloneFormat(),this.currentPropertyIndex++,i;if("listFormat"===t)return(i=new bri(void 0)).copyFormat(n),n.listFormat=new mri(n),n.listFormat.copyFormat(e.listFormat),this.currentPropertyIndex++,i;if("tabStop"===t){i=[];for(var o=0;o<n.tabs.length;o++)i.push(n.tabs[o]);return(r=new bri(void 0)).copyFormat(e),this.modifiedProperties[this.currentPropertyIndex]=r,this.currentPropertyIndex++,i}if("styleName"===t)return je(n.baseStyle)?void(je(e.baseStyle)||(n.baseStyle=new _ri,n.baseStyle.copyStyle(e.baseStyle))):((i=new _ri).copyStyle(n.baseStyle),this.currentPropertyIndex++,je(e.baseStyle)||(n.baseStyle=new _ri,n.baseStyle.copyStyle(e.baseStyle)),i);i="borders"===t?n.borders.cloneFormat():0<=this.action.indexOf("Border")?n.borders.getBorder(t.replace("Border","")):n.getPropertyValue(t),n.copyFormat(e),this.currentPropertyIndex++}else{var r;je(t)?this.modifiedProperties.push(e.cloneFormat()):((r=new bri(void 0)).copyFormat(e),this.modifiedProperties.push(r))}return i},Tci.prototype.getParagraohFormatOperation=function(e,t){var i;(1<this.modifiedProperties.length||0<this.modifiedFormatOperation.length)&&!je(e)&&(i=this.owner.selectionModule.setPositionForBlock(e,!0),this.startIndex=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(i),this.endIndex=this.startIndex+this.owner.selectionModule.getBlockLength(void 0,e,0,{done:!1},!0,void 0,void 0)-1,this.insertedFormat=t,(i=this.modifiedFormatOperation).push.apply(i,this.getActionInfo(!0)))},Tci.prototype.addModifiedPropertiesForContinueNumbering=function(e,t){var i;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.cloneFormat():this.modifiedProperties[this.modifiedProperties.length-1]=e.cloneFormat(),this.currentPropertyIndex++):((i=new bri).copyFormat(e),this.modifiedProperties.push(i)),t},Tci.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++):this.modifiedProperties.push(e.listId),t},Tci.prototype.addModifiedPropertiesForList=function(e){var t,i;return this.editorHistory.isUndoing||this.editorHistory.isRedoing?(t=i=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1],i=new uci(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++):(this.modifiedProperties.push(new uci(e,this.owner.editorModule.cloneListLevel(e))),t=e),t},Tci.prototype.revertProperties=function(){(this.editorHistory.currentBaseHistoryInfo=this).currentPropertyIndex=0;var e=this.getProperty();if(this.viewer.owner.editorModule.setOffsetValue(this.documentHelper.selection),"ClearCharacterFormat"===this.action||this.modifiedProperties[0]instanceof Eri){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 bri){if("ContinueNumbering"===this.action)return void this.owner.editorModule.revertContinueNumbering(this.owner.selectionModule,this.modifiedProperties[0]);if("StyleName"===this.action&&this.modifiedProperties[0]instanceof bri)return void this.owner.editorModule.updateSelectionParagraphFormatting(e,this.modifiedProperties[0].baseStyle,!1);this.owner.editorModule.setPreviousBlockToLayout(),this.owner.editorModule.updateSelectionParagraphFormatting(e,void 0,!1)}else if("LinkToPrevious"===this.action&&this.modifiedProperties[0]instanceof ari){var t=parseInt(this.selectionStart.split(";")[0]);this.owner.editorModule.updateHeaderFooters(e,void 0,t,this.modifiedProperties[0].removedHeaderFooters[0])}else if(this.modifiedProperties[0]instanceof ari)this.owner.editorModule.updateSectionFormat(e,void 0);else{if("RestartNumbering"===this.action)return void this.owner.editorModule.restartListAtInternal(this.owner.selectionModule,this.modifiedProperties[0]);if(this.modifiedProperties[0]instanceof pci){var t=this.modifiedProperties[0];this.insertedData={width:Y.convertPixelToPoint(t.width),height:Y.convertPixelToPoint(t.height),alternativeText:t.alternatetext},this.owner.selectionModule.updateImageSize(t)}else if(this.modifiedProperties[0]instanceof uci){for(var i=new uJt,n=0;n<this.modifiedProperties.length;n++){var o=this.modifiedProperties[n];i.add(n,o)}this.editorHistory.updateListChanges(i),i.destroy(),i=void 0}else this.modifiedProperties[0]instanceof Jri?this.owner.editorModule.updateTableFormat(this.owner.selectionModule,e,void 0):this.modifiedProperties[0]instanceof $ri?(this.owner.isShiftingEnabled=!0,this.owner.editorModule.updateCellFormat(this.owner.selectionModule,e,void 0)):this.modifiedProperties[0]instanceof Cri?this.owner.editorModule.updateRowFormat(this.owner.selectionModule,e,void 0):"ModifyStyle"===this.action&&(t=this.modifiedProperties.pop(),this.owner.editor.updateStyleObject(t))}this.currentPropertyIndex=0,"ClearCharacterFormat"!==this.action&&"ClearParagraphFormat"!==this.action||this.owner.editorModule.getOffsetValue(this.documentHelper.selection),this.owner.editorModule.startParagraph=void 0,this.owner.editorModule.endParagraph=void 0},Tci.prototype.addModifiedCellOptions=function(e,t,i){i=je(e.bottomMargin)&&je(e.topMargin)&&je(e.rightMargin)&&je(e.leftMargin)?this.copyCellOptions(i.tableFormat):this.copyCellOptions(e);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]=this.copyCellOptions(e):this.modifiedProperties[this.modifiedProperties.length-1]=this.copyCellOptions(e),this.currentPropertyIndex++):this.modifiedProperties.push(i),t},Tci.prototype.copyCellOptions=function(e){var t=new $ri;return t.topMargin=e.topMargin,t.rightMargin=e.rightMargin,t.bottomMargin=e.bottomMargin,t.leftMargin=e.leftMargin,t},Tci.prototype.addModifiedTableOptions=function(e){e=this.copyTableOptions(e);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,e):this.modifiedProperties.splice(this.modifiedProperties.length-1,1,e),this.currentPropertyIndex++):this.modifiedProperties.push(e)},Tci.prototype.copyTableOptions=function(e){var t=new Jri;return t.topMargin=e.topMargin,t.rightMargin=e.rightMargin,t.bottomMargin=e.bottomMargin,t.leftMargin=e.leftMargin,t.cellSpacing=e.cellSpacing,t},Tci.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"DifferentOddAndEvenPages":return"differentOddAndEvenPages";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";case"LinkToPrevious":return"linkToPrevious";case"LeftBorder":case"TopBorder":case"RightBorder":case"BottomBorder":case"HorizontalBorder":case"VerticalBorder":case"Borders":return this.action[0].toLowerCase()+this.action.slice(1);case"TabStop":return"tabStop"}},Tci.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},Tci.prototype.addModifiedTableProperties=function(e,t,i){if(this.editorHistory.isUndoing||this.editorHistory.isRedoing){var n=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1];if(je(t))return i=n,this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=e.cloneFormat():this.modifiedProperties[this.modifiedProperties.length-1]=e.cloneFormat(),this.currentPropertyIndex++,i;i="shading"===t?n.shading:n.getPropertyValue(t),n.copyFormat(e),this.currentPropertyIndex++}else{t=new Jri;t.copyFormat(e),this.modifiedProperties.push(t)}return i},Tci.prototype.addModifiedRowProperties=function(e,t,i){if(this.editorHistory.isUndoing||this.editorHistory.isRedoing){var n,o,r=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1];if(this.owner.enableCollaborativeEditing&&1<this.modifiedProperties.length&&e.ownerBase&&(o=(s=this.owner.selectionModule.getPositionInfoForHeaderFooter({paragraph:null,offset:0},{position:0,done:!1},e.ownerBase).position)+1,n={},je(this.owner.sfdtExportModule)||this.owner.sfdtExportModule.assignRowFormat(n,r,0),o={action:"Format",offset:s,length:o-s,format:JSON.stringify(n),type:"RowFormat"},this.modifiedFormatOperation.push(o)),je(t))return i=r,this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=e.cloneFormat():this.modifiedProperties[this.modifiedProperties.length-1]=e.cloneFormat(),this.currentPropertyIndex++,i;i=r.getPropertyValue(t),r.copyFormat(e),this.currentPropertyIndex++}else{var s=new Cri;s.copyFormat(e),this.modifiedProperties.push(s)}return i},Tci.prototype.addModifiedCellProperties=function(e,t,i){if(this.editorHistory.isUndoing||this.editorHistory.isRedoing){var n=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1];if(je(t))return i=n,this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=e.cloneFormat():this.modifiedProperties[this.modifiedProperties.length-1]=e.cloneFormat(),this.currentPropertyIndex++,i;i="shading"===t?n.shading:n.getPropertyValue(t),n.copyFormat(e),this.currentPropertyIndex++}else{t=new $ri;t.copyFormat(e),this.modifiedProperties.push(t)}return i},Tci.prototype.destroy=function(){if(this.selectionStart=void 0,this.selectionEnd=void 0,this.insertPosition=void 0,this.endPosition=void 0,je(this.modifiedNodeLength)||(this.modifiedNodeLength=[],this.modifiedNodeLength=void 0),!je(this.modifiedProperties)){for(var e=0;e<this.modifiedProperties.length;e++){var t=this.modifiedProperties[e];(t instanceof Eri||t instanceof bri||t instanceof ari||t instanceof uci)&&t.destroy(),this.modifiedProperties.splice(this.modifiedProperties.indexOf(t),1),e--}this.modifiedPropertiesIn=void 0}if(!je(this.removedNodes)){for(e=0;e<this.removedNodes.length;e++)(i=this.removedNodes[e])instanceof Lai?i.destroyInternal(this.viewer):i instanceof Xai&&!(i instanceof Khi)&&i.destroy(),this.removedNodes.splice(this.removedNodes.indexOf(i),1),e--;this.removedNodesIn=void 0}if(!je(this.insertedNodes)){for(var i,e=0;e<this.insertedNodes.length;e++)(i=this.insertedNodes[e])instanceof Lai?i.destroyInternal(this.viewer):i instanceof Xai&&!(i instanceof Khi)&&i.destroy(),this.insertedNodes.splice(this.insertedNodes.indexOf(i),1),e--;this.insertedNodes=void 0}this.ownerIn=void 0},Tci.prototype.recordInsertRevisionDeletetion=function(e,t,i){this.startIndex>this.endIndex&&(r=this.startIndex,this.startIndex=this.endIndex,this.endIndex=r);var n=this.startIndex,o=this.endIndex;if(e instanceof pli||e instanceof rhi||e instanceof Zai||e instanceof Dli){if(0<e.revisions.length){var r=this.owner.selectionModule.getElementPosition(e,!0).startPosition,s=(t=je(t)?0:t,i=je(i)?e.length:i,r.setPositionParagraph(e.line,t+r.offset),this.startIndex=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(r),this.endIndex=this.startIndex+i,this.owner.editorModule.retrieveRevisionInOder(e)),a=""===this.owner.currentUser?"Guest user":this.owner.currentUser;if("Insertion"===s.revisionType&&s.author!==a)this.revisionOperation.push(this.getFormatOperation());else if("Insertion"===s.revisionType){var l=this.getDeleteOperation("Delete",void 0,void 0);this.revisionOperation.push(l),o-=l.length}else if("Deletion"===s.revisionType&&s.author!==a){l=this.getFormatOperation(e);if(0<e.removedIds.length)for(var h=0;h<e.removedIds.length;h++)je(l.markerData.removedIds)||(l.markerData.removedIds=[]),l.markerData.removedIds.push(e.removedIds[h]);this.revisionOperation.push(l)}}}else if(e instanceof Lai){for(var d=!0,h=0;h<e.childWidgets.length;h++){var p=e.childWidgets[h];0===p.children.length&&(d=!1);for(var c=0;c<p.children.length;c++){var u=p.children[c];(u.revisions.length<=0||"Insertion"!==u.revisions[0].revisionType)&&(d=!1)}}if(d){t=new rci(this.owner),r=(t.setPositionParagraph(e.childWidgets[0],0),this.startIndex=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(t),this.owner.selectionModule.getBlockLength(void 0,e,0,{done:!1},!0,void 0,void 0));(a=""===this.owner.currentUser?"Guest user":this.owner.currentUser)===(s=this.owner.editorModule.retrieveRevisionInOder(e.childWidgets[0].children[0])).author&&(this.endIndex=this.startIndex+r,this.revisionOperation.push(this.getDeleteOperation(this.action,void 0,this.getRemovedText(e))),o-=r)}else for(h=0;h<e.childWidgets.length;h++)for(c=0;c<e.childWidgets[h].children.length;c++)this.recordInsertRevisionDeletetion(e.childWidgets[h].children[c]),n=this.startIndex,o=this.endIndex}this.startIndex=n,this.endIndex=o},Tci.prototype.getDeleteOperationsForTrackChanges=function(){var e=[],t=this.startIndex,i=this.endIndex;this.insertIndex;this.startIndex=t,this.endIndex=i;for(var n=0;n<this.revisionOperation.length;n++)"Format"==this.revisionOperation[n].action&&je(this.revisionOperation[n].markerData)&&(this.revisionOperation[n].markerData=this.markerData.pop()),e.push(this.revisionOperation[n]);for(n=this.removedNodes.length-1;0<=n;n--){var o=this.removedNodes[n];if(o instanceof pli||o instanceof rhi||o instanceof Zai||o instanceof Dli){if(0===o.removedIds.length){if(!je((a=this.getFormatOperation()).markerData))for(var r=0;r<this.markerData.length;r++)"Deletion"===this.markerData[r].revisionType&&(je(a.markerData.splittedRevisions)&&(a.markerData.splittedRevisions=[]),this.checkValidRevision(this.markerData[r].revisionId)&&a.markerData.splittedRevisions.push(this.markerData[r]),this.markerData.splice(r,1),r--);e.push(a);break}}else if(o instanceof Lai)if(0<o.characterFormat.revisions.length)e.push(this.getDeleteOperation(this.action));else{if(0<o.characterFormat.removedIds.length){var s,a=this.getDeleteOperation(this.action);je(this.isAcceptOrReject)||(a.markerData.isAcceptOrReject=this.isAcceptOrReject),e.push(a),this.owner.selectionModule.getTextPosBasedOnLogicalIndex(this.insertPosition).isAtParagraphStart||(s=this.endIndex,this.endIndex=this.startIndex,e.push(this.getDeleteOperation("Delete")),this.endIndex=s);break}if(0===o.characterFormat.revisions.length){for(a=this.getFormatOperation(),r=0;r<this.markerData.length;r++)"Deletion"===this.markerData[r].revisionType&&(je(a.markerData.splittedRevisions)&&(a.markerData.splittedRevisions=[]),this.checkValidRevision(this.markerData[r].revisionId)&&a.markerData.splittedRevisions.push(this.markerData[r]),this.markerData.splice(r,1),r--);this.markerData=[],e.push(a);break}}}return e},Tci.prototype.checkValidRevision=function(e){for(var t=0;t<this.owner.revisions.changes.length;t++)if(this.owner.revisions.changes[t].revisionID===e)return!0;return!1},Tci.prototype.getDeleteOperationForTrackChanges=function(e){var t;if(e instanceof pli||e instanceof rhi||e instanceof Zai||e instanceof Dli)if(0===e.removedIds.length)t=this.getFormatOperation(e);else if(0<e.removedIds.length){var i=e.removedIds[0],i=this.owner.editorModule.getRevision(i),n=""===this.owner.currentUser?"Guest user":this.owner.currentUser;if("Insertion"===i.revisionType&&i.author!==n)t=this.getFormatOperation(e);else if("Insertion"===i.revisionType)t=this.getDeleteOperation(this.action,void 0,this.getRemovedText(e));else if("Deletion"===i.revisionType&&i.author!==n&&(t=this.getFormatOperation(e),0<e.removedIds.length))for(var o=0;o<e.removedIds.length;o++)je(t.markerData.removedIds)||(t.markerData.removedIds=[]),t.markerData.removedIds.push(e.removedIds[o])}return"Enter"===this.action||e instanceof Lai||!je(t)&&"Delete"===t.action||(this.startIndex+=e.length),t},Tci.prototype.getActionInfo=function(e){var t,i=this.action,n=[];switch((i=je(this.isAcceptOrReject)||"Reject"!==this.isAcceptOrReject?i:"Reject Change").toString()){case"Insert":case"InsertTextParaReplace":case"Enter":case"InsertInline":case"SectionBreak":case"SectionBreakContinuous":if(0<this.removedNodes.length&&je(this.dropDownIndex)&&(this.owner.enableTrackChanges&&!this.editorHistory.isUndoing?(n=this.getDeleteOperationsForTrackChanges(),"InsertInline"!==i&&(this.insertIndex=this.endIndex)):("InsertTextParaReplace"===i&&(this.startIndex>this.endIndex?this.startIndex:--this.endIndex),l=this.getDeleteOperation(i),"Enter"===i&&this.owner.enableTrackChanges&&this.editorHistory.isUndoing&&(l.markerData={isSkipTracking:!0}),n.push(l))),"Enter"===i||0<this.insertedText.length)if(this.editorHistory.isUndoing||this.editorHistory.isRedoing&&"Enter"!==i&&"SectionBreak"!==i&&"SectionBreakContinuous"!==i)this.isRemovedNodes&&(t=this.getDeleteContent(i),n=n.concat(t));else{var o=this.getInsertOperation(i);if(this.owner.enableTrackChanges&&"Enter"!==this.action){this.insertedElement instanceof fli&&(o.markerData=this.markerData[0],this.markerData.splice(0,1),o.text=pJt.Marker_Start,o.markerData.type=this.insertedElement.footnoteType,o.markerData.revisionForFootnoteEndnoteContent=this.markerData.pop()),n.push(o);for(var r=0;r<this.splittedRevisions.length;r++)je(o.markerData)&&(o.markerData={}),je(o.markerData.splittedRevisions)&&(o.markerData.splittedRevisions=[]),o.markerData.splittedRevisions.push(this.splittedRevisions[r])}else n.push(o)}var s=n[n.length-1];"Insert"!==i||je(s.text)||(s.length=s.text.length),je(this.dropDownIndex)||(s.markerData={type:"Field",dropDownIndex:this.dropDownIndex},s.offset=this.getElementAbsolutePosition(this.fieldBegin),s.type="DropDown");break;case"InsertTable":case"InsertTableBelow":if(0<this.removedNodes.length&&n.push(this.getDeleteOperation(i)),this.editorHistory.isUndoing&&this.isRemovedNodes)n.push(this.getUndoRedoOperation(i));else for(var a=this.buildTableRowCellOperation(i),r=0;r<a.length;r++)n.push(a[r]);break;case"InsertRowAbove":case"InsertRowBelow":case"InsertColumnLeft":case"InsertColumnRight":if(this.editorHistory.isUndoing){for(r=0;r<this.cellOperation.length;r++)n.push(this.cellOperation[r]);var o=this.getUndoRedoOperation(i,!0);this.owner.enableTrackChanges&&je(o.markerData)&&(o.markerData={isSkipTracking:!0}),n.push(o)}else{var s=this.buildTableRowCellOperation(i);n=("InsertRowAbove"===i||"InsertRowBelow"===i?s:s.reverse()).slice()}break;case"BackSpace":case"Delete":case"Cut":case"DeleteBookmark":case"RemoveEditRange":case"RemoveContentControl":if(this.editorHistory.isUndoing)"DeleteBookmark"==i||"RemoveEditRange"==i?(--this.startIndex,this.insertIndex=this.startIndex,this.insertedText=pJt.Marker_Start,n.push(this.getInsertOperation(i)),this.insertedText=pJt.Marker_End,n.push(this.getInsertOperation(i,!0)),"RemoveEditRange"===i&&--(o=n[n.length-1]).offset,this.startIndex+=1):this.endRevisionLogicalIndex&&this.editorHistory.isUndoing&&(0<this.removedNodes.length&&((l=this.getDeleteOperation(i)).markerData={isSkipTracking:!0},n.push(l)),!this.isRemovedNodes)||(t=this.getDeleteContent(i),n=n.concat(t));else if(0<this.cellOperation.length)n=this.cellOperation,this.cellOperation=[];else if(0<this.removedNodes.length)if(this.owner.enableTrackChanges)this.editorHistory.isRedoing?(0<this.removedNodes.length&&((l=this.getDeleteOperation(i)).markerData={isSkipTracking:!0},n.push(l)),this.isRemovedNodes&&(t=this.getDeleteContent(i),n=n.concat(t))):n=this.getDeleteOperationsForTrackChanges();else{var l=this.getDeleteOperation(i);n.push(l);for(r=0;r<this.removedNodes.length;r++){var h=this.removedNodes[parseInt(r.toString(),10)];if(h instanceof Sai)for(var d=h.removedHeaderFooters,p=0;p<d.length;p++){var c=d[parseInt(p.toString(),10)];if(0<Object.keys(c).length){n.push(this.getDeleteOperation("DeleteHeaderFooter",void 0));break}}}"DeleteBookmark"===i||"RemoveEditRange"===i?(n.push(this.getDeleteOperation(i,!0)),"RemoveEditRange"===i&&--(o=n[n.length-1]).offset):"RemoveContentControl"===i&&((o=this.getDeleteOperation(i,!0)).text=pJt.Marker_End,n.push(o))}this.markerData=[];break;case"ResolveComment":case"EditComment":for(r=0;r<this.removedNodes.length;r++){var o=this.getUpdateOperation();n.push(this.getCommentOperation(o,i,this.removedNodes[r]))}break;case"ClearRevisions":case"TrackingPageBreak":case"AcceptTOC":if(this.editorHistory.isUndoing||this.editorHistory.isRedoing)0<this.removedNodes.length&&((l=this.getDeleteOperation(i)).markerData={isSkipTracking:!0},n.push(l)),this.isRemovedNodes&&(u=void 0,(u="string"==typeof this.removedNodes[0]?this.owner.editorModule.getRevision(this.removedNodes[0]):u)&&u.range[0]instanceof Eri?n.push(this.getInsertOperation("Enter")):(t=this.getDeleteContent(i),n=n.concat(t)));else if(0<this.removedNodes.length){var u=this.owner.editorModule.getRevision(this.removedNodes[0]);if("TrackingPageBreak"===i&&"string"!=typeof this.removedNodes[0]){(o=this.getDeleteOperation(i)).markerData.isAcceptOrReject="Reject",n.push(o);break}n.push(this.getRevisionOperation(u))}break;case"Reject Change":this.isRemovedNodes?(t=this.getDeleteContent(i),n=n.concat(t)):((o=this.getDeleteOperation(i)).markerData.isAcceptOrReject="Reject",n.push(o));break;case"Accept Change":this.isRemovedNodes?(t=this.getDeleteContent(i),n=n.concat(t)):((l=this.getDeleteOperation(i)).markerData.isAcceptOrReject="Accept",n.push(l));break;case"Paste":case"PasteColumn":case"PasteOverwrite":case"PasteRow":this.editorHistory.isUndoing||this.editorHistory.isRedoing?(0<this.removedNodes.length&&n.push(this.getDeleteOperation("Delete")),this.isRemovedNodes&&("Paste"===this.action?(t=this.getDeleteContent(i),n=n.concat(t)):n.push(this.getUndoRedoOperation(i,!0)))):(0<this.removedNodes.length&&n.push(this.getDeleteOperation("Delete")),s=this.getPasteContentLength(),"Paste"!==i&&this.owner.selectionModule.start.paragraph.isInsideTable&&(s=this.owner.selectionModule.getBlockLength(void 0,this.owner.selectionModule.start.paragraph.associatedCell.ownerTable,0,{done:!1},!0,void 0,void 0)),u={action:"Insert",offset:this.startIndex,length:s,pasteContent:JSON.stringify(this.pasteContent),type:je(this.type)?"Paste":this.type,markerData:this.markerData.pop()},n.push(u));break;case"InsertHyperlink":je(this.fieldBegin)?(n.push(this.getDeleteOperation("BackSpace")),this.isRemovedNodes&&(t=this.getDeleteContent(i),n=n.concat(t))):n=this.isEditHyperlink?this.getEditHyperlinkOperation():this.getFieldOperation(),this.fieldBegin=void 0;break;case"UpdateFormField":this.insertedText="";l=this.getInsertOperation("UpdateFormField");l.text=pJt.Marker_Start,l.markerData={type:"Field",checkBoxValue:this.fieldBegin.formFieldData.checked},l.offset=this.getElementAbsolutePosition(this.fieldBegin),n.push(l);break;case"DeleteRow":case"DeleteCells":case"DeleteColumn":case"DeleteTable":case"ClearCells":case"MergeCells":if(this.editorHistory.isUndoing)"DeleteTable"==i?n.push(this.getUndoRedoOperation(i)):(n=this.cellOperation.slice(),this.insertIndex=this.startIndex,n.push(this.getUndoRedoOperation(i,!0)),this.cellOperation=[]);else if(0<this.removedNodes.length){if(0<this.cellOperation.length){for(r=0;r<this.cellOperation.length;r++)n.push(this.cellOperation[r]);"MergeCells"===i?(n.push(this.getPasteMergeOperation()),n.push(this.getFormatOperation()),this.type=void 0):n.reverse()}else this.owner.enableTrackChanges?n.push(this.getFormatOperation(void 0,i)):n.push(this.getDeleteOperation(i));this.cellOperation=[]}break;case"RemoveRowTrack":this.editorHistory.isUndoing?this.isRemovedNodes&&this.editorHistory.isUndoing&&(n=this.cellOperation.slice(),je((t=this.getDeleteContent(i))[0].markerData)&&(t[0].markerData={isSkipTracking:!0}),n.push.apply(n,t)):0<this.removedNodes.length&&(0<this.cellOperation.length?n.push.apply(n,this.cellOperation):(n=this.revisionOperation.slice(),this.getTrackchangesOperation(n)));break;case"RowResizing":case"CellResizing":n=this.getResizingOperation(i);break;case"ImageResizing":n.push(this.getFormatOperation());break;case"Bold":case"Italic":case"Underline":case"FontSize":case"Strikethrough":case"BaselineAlignment":case"HighlightColor":case"FontColor":case"FontFamily":case"Uppercase":case"Lowercase":case"CapitalizeEachWord":case"SentenceCase":case"ToggleCase":case"CharacterFormat":this.editorHistory.isUndoing||this.editorHistory.isRedoing?"Uppercase"===i?(n.push(this.getDeleteOperation(i)),this.removedNodes&&(t=this.getDeleteContent(i),n=n.concat(t))):(n=this.modifiedFormatOperation,this.modifiedFormatOperation=[]):n=this.buildFormatOperation(i,!0).slice();break;case"AfterSpacing":case"BeforeSpacing":case"RightIndent":case"LeftIndent":case"FirstLineIndent":case"LineSpacing":case"LineSpacingType":case"TextAlignment":case"Borders":case"TopBorder":case"BottomBorder":case"LeftBorder":case"RightBorder":case"HorizontalBorder":case"VerticalBorder":case"ListFormat":case"ParagraphFormat":case"StyleName":case"ClearParagraphFormat":case"SpaceBeforeAuto":case"SpaceAfterAuto":case"ParagraphBidi":case"ContextualSpacing":case"ContinueNumbering":case"List":if(0<this.modifiedFormatOperation.length&&!e)n=this.modifiedFormatOperation,this.modifiedFormatOperation=[];else{if("ContinueNumbering"===(i=e&&this.editorHistory.isUndoing&&("ListFormat"===i||"ClearParagraphFormat"===i)?"ParagraphFormat":i)&&(this.type=i.toString()),"Borders"===i&&this.removedNodes[this.removedNodes.length-1]instanceof _ai){this.insertedText=pJt.Cell,this.type="CellFormat",this.createCellFormat(i),n=this.getSelectedCellOperation(i,void 0,!0,!1,!0);break}n=this.buildFormatOperation(i,!1).slice()}break;case"TableAlignment":case"DefaultCellSpacing":case"TableLeftIndent":case"DefaultCellLeftMargin":case"DefaultCellRightMargin":case"DefaultCellTopMargin":case"DefaultCellBottomMargin":case"TablePreferredWidth":case"TablePreferredWidthType":case"TableBidi":this.createTableFormat(i),this.type="TableFormat",n.push(this.getFormatOperation()),this.format=void 0;break;case"RestartNumbering":this.type=i.toString();s=this.getFormatOperation(void 0,i);this.createListFormat(i,s),n.push(s);break;case"Shading":this.createCellFormat(i),this.type="CellFormat",n=this.getSelectedCellOperation(i,void 0,void 0,!0,!0);break;case"TableAutoFitToContents":case"TableAutoFitToWindow":case"TableFixedColumnWidth":this.editorHistory.isUndoing?n=this.getDeleteContent("Insert"):(this.createTableFormat(i),this.type="TableFormat",this.insertedText=i.toString(),n.push(this.getFormatOperation()),this.format=void 0);break;case"SectionFormat":case"HeaderDistance":case"FooterDistance":case"DifferentFirstPage":case"DifferentOddAndEvenPages":case"PageWidth":case"PageHeight":case"LeftMargin":case"TopMargin":case"RightMargin":case"BottomMargin":case"RestartPageNumbering":case"PageStartingNumber":case"EndnoteNumberFormat":case"FootNoteNumberFormat":case"RestartIndexForEndnotes":case"RestartIndexForFootnotes":case"InitialFootNoteNumber":case"InitialEndNoteNumber":case"LineBetweenColumns":case"EqualWidth":case"BreakCode":case"LinkToPrevious":this.createSectionFormat(i),this.type="SectionFormat",n.push(this.getFormatOperation(void 0)),"LinkToPrevious"===i&&((o=n[n.length-1]).offset=this.insertIndex);break;case"RowHeight":case"RowHeightType":case"AllowBreakAcrossPages":case"RowHeader":this.editorHistory.isUndoing||this.editorHistory.isRedoing&&1<this.modifiedProperties.length?(n=this.modifiedFormatOperation,this.modifiedFormatOperation=[]):(this.createRowFormat(i),this.type="RowFormat",n.push(this.getFormatOperation(void 0)),this.format=void 0);break;case"CellContentVerticalAlignment":case"CellLeftMargin":case"CellRightMargin":case"CellBottomMargin":case"CellTopMargin":case"CellPreferredWidth":case"CellPreferredWidthType":this.createCellFormat(i),this.type="CellFormat",n=this.getSelectedCellOperation(i,!1,!1,!1,!0).slice(),this.format=void 0;break;case"UpdateContentControl":0<this.modifiedProperties.length?((o=this.getFormatOperation()).text=pJt.Marker_Start,n.push(o)):0<this.removedNodes.length&&((o=this.getFormatOperation()).text=pJt.Marker_Start,u=this.removedNodes[0],o.markerData={type:"ContentControlCheckBox",checkBoxValue:u.value},n.push(o))}return this.cellOperation=[],this.revisionOperation=[],this.isRemovedNodes=!1,n},Tci.prototype.getTrackchangesOperation=function(e){for(var t,i,n,o=this.markerData,r=o.length-1;0<=r;r--)je(o[r].revisionId)||((t=this.getRevision(o[r].revisionId))&&0<t.range.length?t.range[0]instanceof Cri?e.push(this.buildRowOperationForTrackChanges(t.range[0].ownerBase,"RemoveRowTrack")):(i=new rci(this.owner),n=new rci(this.owner),this.owner.selection.selectRevision(t,i,n),this.startIndex=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(i),this.endIndex=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(n),e.push(this.getFormatOperation(void 0))):this.owner.editorModule.removeMarkerInfoRevision(o[r].revisionId,o))},Tci.prototype.getRevision=function(e){for(var t=0;t<this.owner.revisions.changes.length;t++)if(this.owner.revisions.changes[t].revisionID===e)return this.owner.revisions.changes[t]},Tci.prototype.getElementAbsolutePosition=function(e){if(e)return e=this.owner.selectionModule.getElementPosition(e),this.owner.selectionModule.getAbsolutePositionFromRelativePosition(e.startPosition)},Tci.prototype.getFieldOperation=function(){var e=[],t=this.fieldBegin,i=!1,n=this.insertIndex;if(!je(t))do{var o,r=void 0,s=void 0,a=void 0,l=void 0,h=void 0}while(t.skipformFieldLength||(t instanceof Zai?(0===t.fieldType&&""!==this.getRemovedText()&&(e.push(this.getDeleteOperation("Delete")),(o=e[e.length-1]).offset=n,!je(o.markerData))&&this.owner.enableTrackChanges&&(o.markerData.isSkipTracking=!0),r=0===t.fieldType?pJt.Marker_Start:1===t.fieldType?pJt.Marker_End:2===t.fieldType?pJt.Field_Separator:"",0===t.fieldType&&t.formFieldData?(h=this.formFieldType,(s=je(s=0<t.revisions.length?this.owner.editorModule.getRevisionMarkerData(s,t.revisions[0]):s)?{}:s).type="Field",s.formFieldData=JSON.stringify(t.formFieldData)):(s=je(s=0<t.revisions.length?this.owner.editorModule.getRevisionMarkerData(s,t.revisions[0]):s)?{}:s).type="Field",a=t.length):this.fieldBegin.formFieldData&&t instanceof Dli?(r=0===t.bookmarkType?pJt.Marker_Start:pJt.Marker_End,s={bookmarkName:t.name,type:"Bookmark"},a=t.length):t instanceof pli&&(r=t.text,a=t.length,0<t.revisions.length)&&(s=this.owner.editorModule.getRevisionMarkerData(s,t.revisions[0])),t instanceof Dli||(o=this.owner.sfdtExportModule.writeCharacterFormat(t.characterFormat,0),l=JSON.stringify(o)),e.push({action:"Insert",offset:n,type:h,text:r,length:a,markerData:s,format:l}),n+=t.length,l=h=s=void 0,t instanceof Zai&&1===t.fieldType&&(i=!0,this.fieldBegin.formFieldData)&&t.nextNode instanceof Dli&&(r=0===(h=t.nextNode).bookmarkType?pJt.Marker_Start:pJt.Marker_End,(s=je(s=0<h.revisions.length?this.owner.editorModule.getRevisionMarkerData(s,h.revisions[0]):s)?{}:s).bookmarkName=h.name,s.type="Bookmark",a=h.length,e.push({action:"Insert",offset:n,text:r,length:a,markerData:s}))),t=t.nextNode,!i&&!je(t));return e},Tci.prototype.getDeleteContent=function(e){var t=[],i=this.owner.selectionModule.getTextPosBasedOnLogicalIndex(this.collabStart),n=this.owner.selectionModule.getTextPosBasedOnLogicalIndex(this.collabEnd),o=n.clone();return o.offset=n.offset-1,i.isAtParagraphStart&&o.isAtParagraphEnd&&!i.currentWidget.paragraph.isInsideTable?(t.push(this.getInsertOperation("Enter",!1,!0)),t.push(this.getUndoRedoOperation(e))):i.paragraph==n.paragraph?i.isAtSamePosition(n)?(this.owner.selectionModule.isEmpty&&"BackSpace"===e&&--this.insertIndex,t.push(this.getUndoRedoOperation(e,!1,!0))):t.push(this.getUndoRedoOperation(e)):i.currentWidget.paragraph.isInsideTable?(t=this.cellOperation.slice()).push(this.getUndoRedoOperation(e,!0)):(t.push(this.getUndoRedoOperation(e)),this.startIndex=this.endIndex+1,i.isAtParagraphStart||o.isAtParagraphEnd||(n=this.getDeleteOperation("Delete"),this.owner.enableTrackChanges&&(n.markerData={isSkipTracking:!0}),t.push(n))),t},Tci.prototype.getEditHyperlinkOperation=function(){var e,t,i,n=[],o=this.fieldBegin;return o&&(e=this.getElementAbsolutePosition(o),n.push(this.getDeleteOperation("Delete")),(t=n[n.length-1]).offset=e,i=this.getRemovedFieldCode(),t.length=i.length,t.text=i,n.push(this.getInsertOperation("InsertHyperlink")),(t=n[n.length-1]).offset=e,i=this.owner.selectionModule.getFieldCode(o,!0),t.text=i,t.length=i.length),n},Tci.prototype.getPasteContentLength=function(){for(var e=0,t=0;t<this.insertedNodes.length;t++){var i=this.insertedNodes[t];i instanceof pli?e+=i.length:e+=this.owner.selectionModule.getBlockLength(void 0,i,0,{done:!1},!0,void 0,void 0)}return this.insertedNodes=[],e},Tci.prototype.getUpdateOperation=function(){return{action:"Update"}},Tci.prototype.getResizingOperation=function(e){var t=[],i=this.owner.editorModule.tableResize;if(!je((n=i.currentResizingTable).childWidgets)){var n=n.combineWidget(this.owner.viewer),o=i.resizerPosition,r={paragraph:null,offset:0};if("RowResizing"==e){je(d=n.childWidgets[o])&&(d=this.modifiedProperties[0].rowFormat.ownerBase),this.startIndex=this.owner.selectionModule.getPositionInfoForHeaderFooter(r,{position:0,done:!1},d).position,this.endIndex=this.startIndex+this.getRowLength(d);var s={};je(this.owner.sfdtExportModule)||this.owner.sfdtExportModule.assignRowFormat(s,d.rowFormat,0),this.format=JSON.stringify(s),this.insertedText=pJt.Row,t.push(this.getFormatOperation())}else{var a=o,l=o-1,e=(this.insertedText=pJt.Cell,!1);if(this.owner.selectionModule.isEmpty){e=!0;for(d=n.firstChild;d;){for(c=d.firstChild;c;)c.index!=a&&c.index!=l||(p={},je(this.owner.sfdtExportModule)||(p=this.owner.sfdtExportModule.writeCellFormat(c.cellFormat,0)),this.startIndex=this.owner.selectionModule.getPositionInfoForHeaderFooter(r,{position:0,done:!1},c).position,this.endIndex=this.startIndex+this.owner.selectionModule.calculateCellLength(c)+1,this.type="CellFormat",this.format=JSON.stringify(p),t.push(this.getFormatOperation())),c=c.nextWidget;s={};je(this.owner.sfdtExportModule)||this.owner.sfdtExportModule.assignRowFormat(s,d.rowFormat,0),this.format=JSON.stringify(s),this.type="RowFormat",this.startIndex=this.owner.selectionModule.getPositionInfoForHeaderFooter(r,{position:0,done:!1},d).position,this.endIndex=this.startIndex+this.getRowLength(d),t.push(this.getFormatOperation()),d=d.getSplitWidgets().pop().nextRenderedWidget}}else{o=i.getTableCellWidget(i.startingPoint);if(o&&(this.owner.selectionModule.selectedWidgets.containsKey(o)||o.previousWidget&&this.owner.selectionModule.selectedWidgets.containsKey(o.previousWidget)))for(var e=!0,i=this.owner.selectionModule.getSelectedCells(),o=i[0],i=i[i.length-1],o=n.childWidgets.indexOf(o.ownerRow),h=n.childWidgets.indexOf(i.ownerRow),d=n.childWidgets[o];d&&d.index<=h;){for(var p,c=d.firstChild;c;)c.index!=a&&c.index!=l||(p={},je(this.owner.sfdtExportModule)||(p=this.owner.sfdtExportModule.writeCellFormat(c.cellFormat,0)),this.startIndex=this.owner.selectionModule.getPositionInfoForHeaderFooter(r,{position:0,done:!1},c).position,this.endIndex=this.startIndex+this.owner.selectionModule.calculateCellLength(c)+1,this.type="CellFormat",this.format=JSON.stringify(p),t.push(this.getFormatOperation())),c=c.nextWidget;var s={};je(this.owner.sfdtExportModule)||this.owner.sfdtExportModule.assignRowFormat(s,d.rowFormat,0),this.format=JSON.stringify(s),this.type="RowFormat",this.startIndex=this.owner.selectionModule.getPositionInfoForHeaderFooter(r,{position:0,done:!1},d).position,this.endIndex=this.startIndex+this.getRowLength(d),t.push(this.getFormatOperation()),d=d.getSplitWidgets().pop().nextRenderedWidget}}e&&(i={},i=this.owner.sfdtExportModule?this.owner.sfdtExportModule.writeTableFormat(n.tableFormat,0):{},this.format=JSON.stringify(i),this.type="TableFormat",this.startIndex=this.owner.selectionModule.getPositionInfoForHeaderFooter(r,{position:0,done:!1},n).position,this.endIndex=this.startIndex+this.owner.selectionModule.getBlockLength(void 0,n,0,{done:!1},!0,void 0,void 0)-1,t.push(this.getFormatOperation()))}this.owner.documentHelper.layout.reLayoutTable(n)}return this.format=void 0,t},Tci.prototype.getRowLength=function(e){for(var t=0,i=0;i<e.childWidgets.length;i++)t+=this.owner.selectionModule.calculateCellLength(e.childWidgets[i])+1;return t},Tci.prototype.getDeleteOperation=function(e,t,i){this.startIndex>this.endIndex&&(o=this.startIndex,this.startIndex=this.endIndex,this.endIndex=o),"Delete"===e&&this.endIndex<this.startIndex&&(o=this.startIndex,this.startIndex=this.endIndex,this.endIndex=o),this.endIndex===this.startIndex&&"DeleteBookmark"!==e&&"RemoveEditRange"!==e&&"InsertHyperlink"!==this.action&&("BackSpace"===e||"Insert"===e||"Enter"===e?this.startIndex--:this.endIndex++),"DeleteHeaderFooter"===e&&(this.startIndex=this.headerFooterStart,this.endIndex=this.headerFooterEnd);var n,o=je(i)?this.endIndex-this.startIndex:i.length,i=("DeleteBookmark"===e||"RemoveEditRange"===e||"RemoveContentControl"===e?(n=this.insertedText,o=1):"DeleteHeaderFooter"!==e&&("DeleteTable"===e||"DeleteRow"===e||"DeleteColumn"===e||"MergeCells"===e||"RemoveRowTrack"===e?(n=this.insertedText,"DeleteTable"!==e&&"DeleteRow"!==e&&(o=this.tableRelatedLength)):n=je(i)?this.getRemovedText():i),"Cut"===e&&" "===n[n.length-1]&&o<n.length&&(o=n.length),{action:"Delete",offset:t?this.endIndex:this.startIndex,text:n,length:"Paste"===e||0===o?n.length:o,skipOperation:"DeleteHeaderFooter"===e||void 0,markerData:this.markerData[0]});return this.removedNodes[0]instanceof fli&&(this.editorHistory.isUndoing&&3<=i.length?i.length+=1:(t={position:0,done:!1},e={paragraph:o=(n=this.removedNodes[0]).bodyWidget.lastChild,offset:this.owner.selectionModule.getParagraphLength(o)+1},this.owner.selectionModule.getPositionInfoForBodyContent(e,t,n.bodyWidget.firstChild),i.length+=t.position)),i},Tci.prototype.getInsertOperation=function(e,t,i){var n,o="Enter"===e?"\n":this.insertedText,e=("InsertTable"===e||"InsertTableBelow"===e||"InsertRowAbove"===e||"InsertRowBelow"===e||"InsertColumnLeft"===e||"InsertColumnRight"===e||"MergeCells"===e||"RemoveRowTrack"===e?(n=this.tableRelatedLength,"InsertTable"!==this.action&&"InsertTableBelow"!==this.action||(this.insertIndex=this.startIndex)):je(o)||(n=o.length),{action:"Insert",offset:t?this.endIndex:this.insertIndex,text:o,type:this.type,length:n,skipOperation:!1,imageData:this.insertedData,format:this.format});return je(this.markerData)||i||(e.markerData=this.markerData.pop()),this.insertedElement instanceof fli&&(e.length+=this.getFootNoteLength()),e},Tci.prototype.getFootNoteLength=function(){var e=this.insertedElement.bodyWidget.lastChild,t={position:0,done:!1},e={paragraph:e,offset:this.owner.selectionModule.getParagraphLength(e)+1};return this.owner.selectionModule.getPositionInfoForBodyContent(e,t,this.insertedElement.bodyWidget.firstChild),t.position},Tci.prototype.getUndoRedoOperation=function(e,t,i){var n,o,r,s,a,l=this.owner.selectionModule.getTextPosBasedOnLogicalIndex(this.collabStart),h=this.owner.selectionModule.getTextPosBasedOnLogicalIndex(this.collabEnd),d=0;return d=t?(r="BackSpace"===e||"Delete"===e||"Insert"===e?(o=l.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer),this.startIndex=this.owner.selectionModule.getPositionInfoForHeaderFooter({paragraph:null,offset:0},{position:0,done:!1},o).position,h.currentWidget.paragraph.isInsideTable?(n=(r=this.documentHelper.getLastParagraphBlock(h.currentWidget.paragraph.associatedCell.ownerTable)).lastChild,r.lastChild.getEndOffset()):(n=h.currentWidget,h.offset)):(o=this.owner.selectionModule.start.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer),n=(r=this.documentHelper.getLastParagraphBlock(o)).lastChild,r.lastChild.getEndOffset()),s=this.documentHelper.getFirstParagraphBlock(o).firstChild,this.owner.selectionModule.getBlockLength(void(a=0),o,0,{done:!1},!0,void 0,void 0)):(s=l.currentWidget,n=h.currentWidget,r=!i||"BackSpace"==e?h.offset:h.offset+1,a=i&&"BackSpace"===e?l.offset-1:l.offset,t=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(this.collabStart),this.owner.selectionModule.getAbsolutePositionFromRelativePosition(this.collabEnd)-t),this.pasteContent=this.owner.sfdtExportModule.write(this.owner.documentEditorSettings.optimizeSfdt?1:0,s,a,n,r,!1,!0),this.getPasteOpertion(this.pasteContent,d)},Tci.prototype.getPasteOpertion=function(e,t){t={action:"Insert",offset:this.startIndex,length:0<t?t:1,pasteContent:JSON.stringify(e),type:"Paste"};return this.owner.enableTrackChanges&&(t.markerData={isSkipTracking:!0}),!je(this.insertedElement)&&this.insertedElement instanceof fli&&(t.length+=this.getFootNoteLength()),t},Tci.prototype.buildTableRowCellOperation=function(e){var t,i=[];if(0<this.insertedNodes.length){this.insertedNodes[0]instanceof jai&&(a=this.insertedNodes[0],this.insertIndex=this.owner.selectionModule.getPositionInfoForHeaderFooter(m={paragraph:null,offset:0},{position:0,done:!1},this.insertedNodes[0]).position,t=this.insertedNodes.length,a.ownerTable.childWidgets.length===a.indexInOwner+t)&&--this.insertIndex,1<this.insertedNodes.length&&"InsertTable"===e&&(je((t=this.getInsertOperation("Enter",!1,!0)).markerData)&&(t.markerData={}),t.markerData.isSkipTracking=!0,i.push(t));for(var n=0;n<this.insertedNodes.length;n++)if(this.insertedNodes[n]instanceof _ai){var o=this.insertedNodes[n].combineWidget(this.owner.viewer),r=(this.tableRelatedLength="InsertTableBelow"===e?0:1,this.insertedText=pJt.Table,this.owner.sfdtExportModule?this.owner.sfdtExportModule.writeTableFormat(o.tableFormat,0):{});this.format=JSON.stringify(r),i.push(this.getInsertOperation(e,!1,!0));for(var s=0;s<o.childWidgets.length;s++){var a=o.childWidgets[s];i.push(this.buildRowOperation(a,e));for(var l=0;l<a.childWidgets.length;l++)for(var h=a.childWidgets[l],d=this.buildCellOperation(h,e,!0),p=0;p<d.length;p++)i.push(d[p])}}else if(this.insertedNodes[n]instanceof jai){a=this.insertedNodes[n];i.push(this.buildRowOperation(a,e));for(s=0;s<a.childWidgets.length;s++)for(h=a.childWidgets[s],d=this.buildCellOperation(h,e,!0),p=0;p<d.length;p++)i.push(d[p])}else if(this.insertedNodes[n]instanceof Uai)for(var c=(h=this.insertedNodes[n]).ownerTable.combineWidget(this.owner.viewer),u=0,s=0;s<c.childWidgets.length;s++)for(n=this.insertedNodes.length,a=c.childWidgets[s],l=0;l<a.childWidgets.length;l++){var g=a.childWidgets[l],m={paragraph:null,offset:0};if(-1!==this.insertedNodes.indexOf(g)){for(var f=this.owner.selectionModule.getPositionInfoForHeaderFooter(m,{position:0,done:!1},g).position,d=(this.insertIndex=f-u,g.ownerTable.childWidgets.length===g.ownerRow.indexInOwner+1&&-1!==this.insertedNodes.indexOf(a.childWidgets[a.childWidgets.length-1])&&--this.insertIndex,this.buildCellOperation(g,e,!0)),p=0;p<d.length;p++)i.push(d[p]);u+=2}else for(f=this.owner.selectionModule.getPositionInfoForHeaderFooter(m,{position:0,done:!1},g).position,d=(this.insertIndex=f-u,this.buildCellOperation(g,e,!1)),p=0;p<d.length;p++)i.push(d[p])}this.insertedNodes=[]}return i},Tci.prototype.assignRevisionData=function(e,t,i,n){return{revisionType:e,author:t,date:i,revisionId:n}},Tci.prototype.createAcceptRejectOperation=function(e){var t=this.owner.selectionModule.start;if(t.paragraph.isInsideTable){var i,n=t.paragraph.associatedCell.ownerRow,o=0,t=(this.insertedText=pJt.Row,0<n.rowFormat.revisions.length&&(t=n.rowFormat.revisions[0],i=void 0,"Accept Change"===e?i="Accept":"Reject Change"===e&&(i="Reject"),this.markerData.push(this.owner.editorModule.getMarkerData(void 0,void 0,t,i))),this.owner.selectionModule.getPositionInfoForHeaderFooter({paragraph:null,offset:0},{position:0,done:!1},n).position);if(0<n.rowFormat.revisions.length){if("Insertion"===n.rowFormat.revisions[0].revisionType){if("Accept Change"===e)this.startIndex=t,this.tableRelatedLength=1,this.cellOperation.push(this.getFormatOperation(void 0,"RemoveRowTrack"));else if("Reject Change"===e){this.startIndex=t;for(var r=0;r<n.childWidgets.length;r++)o+=this.owner.selectionModule.calculateCellLength(n.childWidgets[r])+1;this.tableRelatedLength=o,this.cellOperation.push(this.getDeleteOperation("RemoveRowTrack"))}}else if("Deletion"===n.rowFormat.revisions[0].revisionType)if("Accept Change"===e){this.startIndex=t;for(r=0;r<n.childWidgets.length;r++)o+=this.owner.selectionModule.calculateCellLength(n.childWidgets[r])+1;this.tableRelatedLength=o,this.cellOperation.push(this.getDeleteOperation("RemoveRowTrack"))}else if("Reject Change"===e){this.startIndex=t;for(r=0;r<n.childWidgets.length;r++)o+=this.owner.selectionModule.calculateCellLength(n.childWidgets[r])+1;this.tableRelatedLength=o,this.cellOperation.push(this.getFormatOperation(void 0,"RemoveRowTrack"))}this.markerData=[]}}},Tci.prototype.buildRowOperation=function(e,t){this.insertedText=pJt.Row;var i={},e=(je(this.owner.sfdtExportModule)||this.owner.sfdtExportModule.assignRowFormat(i,e.rowFormat,0),this.format=JSON.stringify(i),"InsertTable"===t&&0<e.rowFormat.revisions.length&&(i=e.rowFormat.revisions[e.rowFormat.revisions.length-1],!je(e=this.markerData[this.markerData.length-1])&&e.revisionId===i.revisionID||this.markerData.push(this.owner.editorModule.getMarkerData(void 0,void 0,i))),this.tableRelatedLength=1,this.getInsertOperation(t));return this.format=void 0,e},Tci.prototype.buildRowOperationForTrackChanges=function(e,t){var i=0,n=this.owner.selectionModule.getPositionInfoForHeaderFooter({paragraph:null,offset:0},{position:0,done:!1},e).position;this.startIndex=n;for(var o=0;o<e.childWidgets.length;o++)i+=this.owner.selectionModule.calculateCellLength(e.childWidgets[o])+1;this.tableRelatedLength=i,this.insertedText=pJt.Row;n=this.getFormatOperation(void 0,t);return this.insertedText="",n},Tci.prototype.buildCellOperation=function(e,t,i){var n=[],o=(this.tableRelatedLength=i?1:0,this.insertedText=pJt.Cell,this.type="CellFormat",je(this.owner.sfdtExportModule)?{}:this.owner.sfdtExportModule.writeCellFormat(e.cellFormat,0));return this.format=JSON.stringify(o),n.push(this.getInsertOperation(t,!1,!0)),i&&(this.tableRelatedLength=i?1:0,this.type="ParagraphFormat",o=this.owner.sfdtExportModule.writeParagraphFormat(e.childWidgets[0].paragraphFormat,0,!0),this.format=JSON.stringify(o),n.push(this.getInsertOperation(t,!1,!0)),this.tableRelatedLength=0,this.type="CharacterFormat",i=this.owner.sfdtExportModule.writeCharacterFormat(e.childWidgets[0].characterFormat,0,!0),this.format=JSON.stringify(i),n.push(this.getInsertOperation(t,!1,!0)),this.format=void 0,this.type=void 0),n},Tci.prototype.deleteColumnOperation=function(e){var t=this.owner.editorModule.getOwnerCell(this.owner.selectionModule.isForward),i=this.owner.editorModule.getOwnerCell(!this.owner.selectionModule.isForward),n=t.ownerTable.combineWidget(this.owner.viewer),o=[],r=0,s=0;if("DeleteColumn"===e)o=n.getColumnCellsForSelection(t,i);else for(var a=(d=this.owner.selectionModule.getCellLeft(t.ownerRow,t))+t.cellFormat.cellWidth,l=this.owner.selectionModule.getCellLeft(i.ownerRow,i),h=l+i.cellFormat.cellWidth,l=this.owner.editorModule.updateSelectedCellsInTable(d,a,l,h),d=l.start,a=l.end,s=n.childWidgets.indexOf(i.ownerRow),p=r=n.childWidgets.indexOf(t.ownerRow);p<=s;p++)for(var c=n.childWidgets[p],u=0;u<c.childWidgets.length;u++){var g=c.childWidgets[u],m=this.owner.selectionModule.getCellLeft(c,g);Y.round(d,2)<=Y.round(m,2)&&Y.round(m,2)<Y.round(a,2)&&o.push(g)}for(var f,y=this.owner.selectionModule.isRowSelect()&&r!=s,p=0;p<o.length;p++)"ClearCells"===e?this.deleteCell(e,o[p],!1):"MergeCells"===e?0!==p&&(f=y&&!o[0].ownerRow.equals(o[p].ownerRow)&&0==o[p].index,this.deleteCell(e,o[p],f)):this.deleteCell("DeleteColumn",o[p],!1);"MergeCells"===e&&(this.cellOperation.reverse(),this.deleteCell("ClearCells",o[0],!1))},Tci.prototype.getPasteMergeOperation=function(){var e=this.owner.selectionModule.start.paragraph.associatedCell,t=this.owner.selectionModule.getPositionInfoForHeaderFooter({paragraph:null,offset:0},{position:0,done:!1},e).position,i=this.owner.selectionModule.calculateCellLength(e)-1,n=this.owner.selectionModule.getFirstParagraph(e),o=this.owner.selectionModule.getLastParagraph(e),n=n.firstChild,o=o.lastChild,n=(this.pasteContent=this.owner.sfdtExportModule.write(this.owner.documentEditorSettings.optimizeSfdt?1:0,n,0,o,o.getEndOffset(),!1,!0),this.startIndex=t+1,{action:"Insert",offset:this.startIndex,length:i,pasteContent:JSON.stringify(this.pasteContent),type:"Paste"});return this.insertedText=pJt.Cell,this.type="CellFormat",this.startIndex=t,this.endIndex=t,this.format=JSON.stringify(this.owner.sfdtExportModule.writeCellFormat(e.cellFormat,0)),n},Tci.prototype.deleteCell=function(e,t,i){this.tableRelatedLength=this.owner.selectionModule.calculateCellLength(t)+1;this.startIndex=this.owner.selectionModule.getPositionInfoForHeaderFooter({paragraph:null,offset:0},{position:0,done:!1},t).position,this.startIndex-=i?1:0,this.tableRelatedLength+=i?1:0,this.owner.enableTrackChanges||("ClearCells"===e?(i=t.childWidgets[0],1===t.childWidgets.length&&i instanceof Lai&&i.isEmpty()||(this.endIndex=this.startIndex+this.tableRelatedLength-1,this.startIndex+=1,this.cellOperation.push(this.getDeleteOperation("ClearCells")))):this.cellOperation.push(this.getDeleteOperation("DeleteColumn")))},Tci.prototype.getFormatOperation=function(e,t,i){this.startIndex>this.endIndex&&(n=this.startIndex,this.startIndex=this.endIndex,this.endIndex=n);var n=0,i=(this.endIndex!==this.startIndex||i||"DeleteBookmark"===this.action||"RemoveEditRange"===this.action||"InsertHyperlink"===this.action||("BackSpace"===this.action?this.startIndex--:this.endIndex++),n="RemoveRowTrack"===t?this.tableRelatedLength:"RowResizing"===t||"CellResizing"===t||"ImageResizing"===t?this.insertedText.length:je(e)?this.endIndex-this.startIndex:e.length,{action:"Format",offset:this.startIndex,length:n,markerData:this.markerData[this.markerData.length-1],imageData:this.insertedData,text:this.insertedText,format:this.format});return this.markerData.pop(),je(t)?i.type=this.type:i.type=t.toString(),i},Tci.prototype.getRemovedText=function(e){var t="";if(je(e))for(var i,n=this.removedNodes.length-1;0<=n;n--)(i=this.removedNodes[n])instanceof Lai?t+=this.getParagraphText(i):i instanceof Xai?i instanceof pli?t+=i.text:i instanceof lhi||(t+=Xai.objectCharacter):i instanceof _ai?t+=this.getTableText(i):i instanceof jai&&(t+=this.getRowText(i));else(i=e)instanceof Lai?t+=this.getParagraphText(i):i instanceof Xai?i instanceof pli?t+=i.text:i instanceof lhi||(t+=Xai.objectCharacter):i instanceof _ai?t+=this.getTableText(i):i instanceof jai&&(t+=this.getRowText(i));return t},Tci.prototype.getRevisionOperation=function(e){return"Insertion"===e.revisionType?(this.markerData.push(this.owner.editorModule.getMarkerData(void 0,void 0,e,"Accept")),this.getFormatOperation()):"Deletion"===e.revisionType?(this.markerData.push(this.owner.editorModule.getMarkerData(void 0,void 0,e,"Reject")),this.getFormatOperation()):{}},Tci.prototype.getRemovedFieldCode=function(){for(var e="",t=!1,i=this.removedNodes.length-1;0<=i;i--){var n=this.removedNodes[i];if(n instanceof Xai){if(n instanceof Zai&&0===n.fieldType&&(t=!0),n&&n instanceof pli&&t&&(e+=n.text),n instanceof Zai&&(2===n.fieldType||1===n.fieldType))return e}else if(n instanceof Lai)for(var o=0;o<n.childWidgets.length;o++)for(var r=n.childWidgets[o],s=0;s<r.children.length;s++){var a=r.children[s];if(a instanceof Zai&&0===a.fieldType&&(t=!0),a instanceof pli&&t&&(e+=a.text),a instanceof Zai&&(2===a.fieldType||1===a.fieldType))return e}}},Tci.prototype.getParagraphText=function(e){var t="";if(je(e)||je(e.childWidgets))return t;for(var i=0;i<e.childWidgets.length;i++)for(var n=e.childWidgets[i],o=0;o<n.children.length;o++)n.children[o]instanceof lhi||(n.children[o]instanceof pli?t+=n.children[o].text:t+=Xai.objectCharacter);return t+"\n"},Tci.prototype.getTableText=function(e){for(var t=pJt.Table,i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i];t+=this.getRowText(n)}return t},Tci.prototype.getRowText=function(e){for(var t=pJt.Row,i=0;i<e.childWidgets.length;i++)for(var n=e.childWidgets[i],o=0;o<n.childWidgets.length;o++){t+=pJt.Cell;var r=n.childWidgets[o];r instanceof Lai?t+=this.getParagraphText(r):t+=this.getTableText(r)}return t},Tci.prototype.getCommentOperation=function(e,t,i){var n,o;return"InsertInline"===t||"RemoveInline"===t?(n=(o="RemoveInline"===t?this.removedNodes[0]:this.insertedElement).comment,e.text=0===o.commentType?pJt.Marker_Start:pJt.Marker_End,e.markerData={type:"Comment",commentId:o.commentId,ownerCommentId:n.isReply?n.ownerComment.commentId:void 0}):"InsertCommentWidget"===t||"DeleteCommentWidget"===t?(je(i)&&(i=this.removedNodes[0]),e.length=1,e.action="Format",e.offset=this.startIndex<this.endIndex?this.endIndex:this.startIndex,--e.offset,e.text=pJt.Marker_Start+pJt.Marker_End,e.markerData={type:"Comment",commentId:i.commentId,author:i.author,date:i.date,commentIndex:(i.isReply?i.ownerComment.replyComments:this.owner.documentHelper.comments).indexOf(i),initial:i.initial,done:i.isResolved,text:i.text,isReply:i.isReply},je(i.ownerComment)||(o=this.owner.selection.getElementPosition(i.ownerComment.commentEnd,!0).startPosition,e.offset=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(o)),"DeleteCommentWidget"===t?(e.offset=this.startIndex<this.endIndex?this.endIndex:this.startIndex,--e.offset,e.markerData.commentAction="remove"):"InsertCommentWidget"===t&&(e.markerData.commentAction="add")):"ResolveComment"===t?(e.action="Format",e.length=1,e.text=pJt.Marker_Start+pJt.Marker_End,e.offset=this.startIndex<this.endIndex?this.endIndex:this.startIndex,--e.offset,e.markerData={type:"Comment",commentId:i.commentId,done:i.isResolved}):"EditComment"===t&&(e.action="Format",e.length=1,e.text=pJt.Marker_Start+pJt.Marker_End,e.offset=this.startIndex<this.endIndex?this.endIndex:this.startIndex,--e.offset,e.markerData={type:"Comment",text:i.text}),e},Tci.prototype.getDeleteCommentOperation=function(e,t){for(var i=0;i<e.length;i++){var n,o=e[i];o instanceof Mci&&"DeleteComment"===o.action?this.getDeleteCommentOperation(o.modifiedActions,t):(n=o.getDeleteOperation(o.action),o.getCommentOperation(n,o.action),"DeleteCommentWidget"!==o.action||je(e[i+1])||(o=e[i+1],n.offset=o.startIndex<o.endIndex?o.startIndex:o.endIndex),t.push(n))}},Tci.prototype.buildFormatOperation=function(e,t){return("ApplyStyle"===e||"StyleName"===e)&&this.insertedFormat instanceof _ri?(this.insertedFormat=this.insertedFormat.name,this.type="ParagraphFormat",this.createParagraphFormat(e)):("ApplyStyle"!==e&&"StyleName"!==e||(this.insertedFormat instanceof Eri&&this.insertedFormat.baseCharStyle?this.insertedFormat=this.insertedFormat.baseCharStyle.name:this.insertedFormat=this.insertedFormat.name),t?(this.type="CharacterFormat",this.createCharacterFormat(e)):(this.type="ContinueNumbering"==e?"ContinueNumbering":"ParagraphFormat",this.createParagraphFormat(e))),e=this.getSelectedCellOperation(e,t),this.format=void 0,e},Tci.prototype.getSelectedCellOperation=function(e,t,i,n,o){var r=[],s=this.owner.selectionModule.start,a=this.owner.selectionModule.end;if(s.paragraph.isInsideTable&&a.paragraph.isInsideTable&&s.paragraph.associatedCell.ownerTable.equals(a.paragraph.associatedCell.ownerTable)&&this.owner.selectionModule.isCellSelected(s.paragraph.associatedCell,s,a))for(var l=this.owner.selectionModule.getSelectedCells(),h=0;h<l.length;h++){var d=l[h],p={paragraph:null,offset:0},c=(this.startIndex=this.owner.selectionModule.getPositionInfoForHeaderFooter(p,{position:0,done:!1},d).position,this.owner.selectionModule.calculateCellLength(d)+1);this.endIndex=this.startIndex+c,0===c&&t||(d=void(!this.editorHistory.isUndoing&&!this.editorHistory.isRedoing||t?this.writeBorderFormat(i,n,d):je(this.owner.sfdtExportModule)||(c=this.owner.sfdtExportModule.writeCellFormat(d.cellFormat,0),this.format=JSON.stringify(c))),"ListFormat"===e?((d=this.getFormatOperation(void 0,void 0,!0)).type="ListFormat",this.createListFormat(e,d)):d=this.getFormatOperation(void 0,void 0,!0),r.push(d))}else{a=void 0;if("ListFormat"===e)a=this.getFormatOperation(void 0,e),this.createListFormat(e,a);else{if(s.paragraph.isInsideTable&&o&&(this.startIndex=this.owner.selectionModule.getPositionInfoForHeaderFooter(p={paragraph:null,offset:0},{position:0,done:!1},s.paragraph.associatedCell).position,o=this.owner.selectionModule.calculateCellLength(s.paragraph.associatedCell)+1,this.endIndex=this.startIndex+o,this.writeBorderFormat(i,n,s.paragraph.associatedCell)),"ClearFormat"===e&&this.editorHistory.isUndoing)return this.buildclearFormatOperations(r),r;a=this.getFormatOperation(void 0,void 0,!0)}r.push(a)}return r},Tci.prototype.buildclearFormatOperations=function(e){var t=this.owner.selectionModule.getTextPosBasedOnLogicalIndex(this.collabStart),i=this.owner.selectionModule.getTextPosBasedOnLogicalIndex(this.collabEnd),n=t.paragraph,o=!1;do{var r,o=n.equals(i.paragraph)}while(n instanceof Lai?this.buildclearFormatOperation(n,e):(this.tableClearFormatOperation(n,i.paragraph,e,r={done:!1}),r.done&&(o=!0)),n=n.nextRenderedWidget,!o)},Tci.prototype.tableClearFormatOperation=function(e,t,i,n){for(var o=e.firstChild;o;){for(var r=o.firstChild;r;){var s=r.firstChild;if(s instanceof Lai)this.buildclearFormatOperation(s,i);else if(this.tableClearFormatOperation(s,t,i,n),n.done)return;if(t.equals(s))return void(n.done=!0);r=r.nextWidget}o=o.getSplitWidgets().pop().nextRenderedWidget}},Tci.prototype.buildclearFormatOperation=function(e,t){for(var i=!0,n=0;n<e.childWidgets.length;n++)for(var o,r,s=e.childWidgets[n],a=0;a<s.children.length;a++)s.children[a]instanceof pli&&(o=this.owner.selectionModule.getElementPosition(s.children[a],!0).startPosition,this.startIndex=this.owner.selectionModule.getAbsolutePositionFromRelativePosition(o),(o=this.getFormatOperation(s.children[a])).length+=1,i&&(r={action:"Format",offset:o.offset,length:o.length,type:"ParagraphFormat",format:JSON.stringify(this.owner.sfdtExportModule.writeParagraphFormat(e.paragraphFormat,0,!0))},t.push(r),i=!1),o.type="CharacterFormat",o.format=JSON.stringify(this.owner.sfdtExportModule.writeCharacterFormat(s.children[a].characterFormat,0,!0)),t.push(o))},Tci.prototype.writeBorderFormat=function(e,t,i){var n={};e&&(n.borders=Y.writeBorders(i.cellFormat.borders,0),this.format=JSON.stringify(n)),t&&(n.shading=this.owner.sfdtExportModule?this.owner.sfdtExportModule.writeShading(i.cellFormat.shading,0):{},this.format=JSON.stringify(n))},Tci.prototype.createListFormat=function(e,t){var i,n,o,r;"ListFormat"===e?(i=this.insertedFormat.listId,t.text=e.toString().charAt(0).toLowerCase()+e.toString().slice(1)):(i=this.insertedFormat.listId,n=this.insertedFormat.nsid),-1<i&&(o=this.owner.documentHelper.getListById(i),(r={}).optimizeSfdt=this.owner.documentEditorSettings.optimizeSfdt,je(this.owner.sfdtExportModule)||(this.owner.sfdtExportModule.keywordIndex=this.owner.documentEditorSettings.optimizeSfdt?1:0,r[hZt[this.owner.sfdtExportModule.keywordIndex]]=[],r[hZt[this.owner.sfdtExportModule.keywordIndex]].push(this.owner.sfdtExportModule.writeList(o)),r[dZt[this.owner.sfdtExportModule.keywordIndex]]=[],je(o)||r[dZt[this.owner.sfdtExportModule.keywordIndex]].push(this.owner.sfdtExportModule.writeAbstractList(o.abstractList)),"RestartNumbering"==e&&(r[d$t[this.owner.sfdtExportModule.keywordIndex]]=i,r.nsid=n)),t.listData=JSON.stringify(r))},Tci.prototype.createCharacterFormat=function(e){var t,i={};"Uppercase"===e?i.Uppercase=!0:"Lowercase"===e?i.Lowercase=!0:"SentenceCase"===e?i.SentenceCase=!0:"ToggleCase"===e?i.ToggleCase=!0:"CapitalizeEachWord"===e?i.CapitalizeEachWord=!0:"ApplyStyle"===e||"StyleName"===e?je(this.insertedFormat)?i.styleName=null:i.styleName=this.insertedFormat:"CharacterFormat"===e?(t=this.insertedFormat,i.bold=(t.hasValue("bold")?t:i).bold,i.italic=(t.hasValue("italic")?t:i).italic,i.fontSize=(t.hasValue("fontSize")?t:i).fontSize,i.underline=(t.hasValue("underline")?t:i).underline,i.strikethrough=(t.hasValue("strikethrough")?t:i).strikethrough,i.baselineAlignment=(t.hasValue("baselineAlignment")?t:i).baselineAlignment,i.highlightColor=(t.hasValue("highlightColor")?t:i).highlightColor,i.fontColor=(t.hasValue("fontColor")?t:i).fontColor,i.fontFamily=(t.hasValue("fontFamily")?t:i).fontFamily,i.allCaps=(t.hasValue("allCaps")?t:i).allCaps,i.LowerCase=(t.hasValue("Lowercase")?t:i).Lowercase,i.Uppercase=t.hasValue("Uppercase")?t.Lowercase:i.Uppercase,i.CapitalizeEachWord=(t.hasValue("CapitalizeEachWord")?t:i).CapitalizeEachWord,i.SentenceCase=(t.hasValue("SentenceCase")?t:i).SentenceCase,i.ToggleCase=(t.hasValue("ToggleCase")?t:i).ToggleCase):"increment"===this.insertedFormat||"decrement"===this.insertedFormat?(this.type=this.insertedFormat,i.fontSize=0):"ClearFormat"!==e&&(t=e.toString().charAt(0).toLowerCase()+e.toString().slice(1),this.insertedFormat instanceof Eri&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)&&(this.insertedFormat=this.insertedFormat[t]),i[t]=this.insertedFormat),this.format=JSON.stringify(i)},Tci.prototype.createParagraphFormat=function(e){var t,i,n={};"ParagraphFormat"===e||"ContinueNumbering"===e?(i=this.insertedFormat,n.afterSpacing=(i.hasValue("afterSpacing")?i:n).afterSpacing,n.beforeSpacing=(i.hasValue("beforeSpacing")?i:n).beforeSpacing,n.spaceAfterAuto=(i.hasValue("spaceAfterAuto")?i:n).spaceAfterAuto,n.spaceBeforeAuto=(i.hasValue("spaceBeforeAuto")?i:n).spaceBeforeAuto,n.rightIndent=(i.hasValue("rightIndent")?i:n).rightIndent,n.leftIndent=(i.hasValue("leftIndent")?i:n).leftIndent,n.firstLineIndent=(i.hasValue("firstLineIndent")?i:n).firstLineIndent,n.lineSpacing=(i.hasValue("lineSpacing")?i:n).lineSpacing,n.lineSpacingType=(i.hasValue("lineSpacingType")?i:n).lineSpacingType,n.textAlignment=(i.hasValue("textAlignment")?i:n).textAlignment,n.outlineLevel=(i.hasValue("outlineLevel")?i:n).outlineLevel,n.bidi=(i.hasValue("bidi")?i:n).bidi,n.bidi&&("Right"===n.textAlignment?n.textAlignment="Left":"Left"===n.textAlignment&&(n.textAlignment="Right")),n.borders=(i.hasValue("borders")?i:n).borders,-1!==i.listFormat.listId&&((t={}).listId=i.listFormat.listId,t.listLevelNumber=i.listFormat.listLevelNumber,t.nsid=i.listFormat.nsid,n.listFormat=t),n.styleName=i.hasValue("styleName")?n.styleName.name:void 0,n.contextualSpacing=(i.hasValue("contextualSpacing")?i:n).contextualSpacing,n.keepWithNext=(i.hasValue("keepWithNext")?i:n).keepWithNext,n.keepLinesTogether=(i.hasValue("keepLinesTogether")?i:n).keepLinesTogether,n.widowControl=(i.hasValue("contextualSpacing")?i:n).widowControl):"ListFormat"===e?(this.insertedFormat instanceof bri&&(this.insertedFormat=this.insertedFormat.listFormat),(t={}).listId=this.insertedFormat.listId,t.nsid=this.insertedFormat.nsid,t.listLevelNumber=this.insertedFormat.listLevelNumber,n.listFormat=t):"ApplyStyle"===e||"StyleName"===e?n.styleName=this.insertedFormat:"ParagraphBidi"===e?n.bidi=this.insertedFormat:"Borders"===e?n.borders=Y.writeBorders(this.insertedFormat,0):this.insertedFormat instanceof bri?(i=this.owner.sfdtExportModule.writeParagraphFormat(this.insertedFormat,0),n[e.toString().charAt(0).toLowerCase()+e.toString().slice(1)]=i):"List"===e?n=this.insertedFormat:n[e.toString().charAt(0).toLowerCase()+e.toString().slice(1)]=this.insertedFormat,this.format=JSON.stringify(n)},Tci.prototype.createTableFormat=function(e){this.startIndex=this.owner.selectionModule.getPositionInfoForHeaderFooter({paragraph:null,offset:0},{position:0,done:!1},this.owner.selectionModule.start.paragraph.associatedCell.ownerTable).position,this.endIndex=this.startIndex,this.endIndex+=this.owner.selectionModule.getBlockLength(void 0,this.owner.selectionModule.start.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer),0,{done:!1},!0,void 0,void 0)-1;var t,i={};"TableFormat"===e?je(t=this.insertedFormat)||(i.bidi=t.hasValue("bidi")?t.bidi:void 0,i.preferredWidth=t.hasValue("preferredWidth")?t.preferredWidth:void 0,i.preferredWidthType=t.hasValue("preferredWidthType")?t.preferredWidthType:void 0,i.tableAlignment=t.hasValue("tableAlignment")?t.tableAlignment:void 0,i.leftIndent=t.hasValue("leftIndent")?t.leftIndent:void 0):"TableOptions"===e?je(t=this.owner.selectionModule.start.paragraph.associatedCell.ownerTable.tableFormat)||(i.cellSpacing=t.hasValue("cellSpacing")?t.cellSpacing:void 0,i.leftMargin=t.hasValue("leftMargin")?t.leftMargin:void 0,i.topMargin=t.hasValue("topMargin")?t.topMargin:void 0,i.rightMargin=t.hasValue("rightMargin")?t.rightMargin:void 0,i.bottomMargin=t.hasValue("bottomMargin")?t.bottomMargin:void 0):"BordersAndShading"===e?(t=this.insertedFormat,i=je(this.owner.sfdtExportModule)?{}:this.owner.sfdtExportModule.writeTableFormat(t,0)):i[this.getTableFormatString(e)]=this.insertedFormat,this.format=JSON.stringify(i)},Tci.prototype.createRowFormat=function(e){var t,i={};this.editorHistory.isUndoing||this.editorHistory.isRedoing?je(this.owner.sfdtExportModule)||this.owner.sfdtExportModule.assignRowFormat(i,this.owner.selectionModule.start.paragraph.associatedCell.ownerRow.rowFormat,0):"RowFormat"===e?je(t=this.insertedFormat)||(i.height=t.hasValue("height")?t.height:void 0,i.heightType=t.hasValue("heightType")?t.heightType:void 0,i.isHeader=t.hasValue("isHeader")?t.isHeader:void 0,i.allowBreakAcrossPages=t.hasValue("allowBreakAcrossPages")?t.allowBreakAcrossPages:void 0):i[this.getRowString(e)]=this.insertedFormat,this.format=JSON.stringify(i)},Tci.prototype.createCellFormat=function(e){var t,i={};"CellFormat"===e?(t=this.insertedFormat,i.preferredWidth=t.hasValue("preferredWidth")?t.preferredWidth:void 0,i.preferredWidthType=t.hasValue("preferredWidthType")?t.preferredWidthType:void 0,i.verticalAlignment=t.hasValue("verticalAlignment")?t.verticalAlignment:void 0):"CellOptions"===e?(t=this.insertedFormat,i.leftMargin=t.leftMargin,i.rightMargin=t.rightMargin,i.bottomMargin=t.bottomMargin,i.topMargin=t.topMargin):"Shading"===e?i[this.getCellString(e)]=je(this.owner.sfdtExportModule)?{}:this.owner.sfdtExportModule.writeShading(this.insertedFormat,0):"Borders"===e?i.borders=Y.writeBorders(this.insertedFormat,0):"BordersAndShading"===e?(i.shading=je(this.owner.sfdtExportModule)?{}:this.owner.sfdtExportModule.writeShading(this.insertedFormat,0),i.borders=Y.writeBorders(this.insertedFormat.borders,0)):i[this.getCellString(e)]=this.insertedFormat,this.format=JSON.stringify(i)},Tci.prototype.getTableFormatString=function(e){switch(e){case"TableAlignment":return"tableAlignment";case"TableLeftIndent":return"leftIndent";case"DefaultCellLeftMargin":return"leftMargin";case"DefaultCellRightMargin":return"rightMargin";case"DefaultCellBottomMargin":return"bottomMargin";case"DefaultCellTopMargin":return"topMargin";case"TablePreferredWidth":return"preferredWidth";case"TablePreferredWidthType":return"preferredWidthType";case"Shading":return"shading";case"TableBidi":return"bidi";default:return"cellSpacing"}},Tci.prototype.createSectionFormat=function(e){var t,i,n={};if(this.editorHistory.isUndoing||this.editorHistory.isRedoing)je(this.owner.sfdtExportModule)||this.owner.sfdtExportModule.writeSectionFormat(this.owner.selectionModule.start.paragraph.bodyWidget.sectionFormat,n,0);else{if("LinkToPrevious"===e)return i=(t=this.owner.selectionModule.start.paragraph.bodyWidget).sectionIndex,t=t.headerFooterType,void(this.format=JSON.stringify({linkToPrevious:this.insertedFormat,sectionIndex:i,headerFooterType:t}));"SectionFormat"===e?(i=this.insertedFormat,this.owner.sfdtExportModule.writeSectionFormat(i,n,0)):n[e[0].toLowerCase()+e.slice(1)]=this.insertedFormat}this.format=JSON.stringify(n)},Tci.prototype.getRowString=function(e){switch(e){case"RowHeight":return"height";case"RowHeightType":return"heightType";case"RowHeader":return"isHeader";default:return"allowBreakAcrossPages"}},Tci.prototype.getCellString=function(e){switch(e){case"CellContentVerticalAlignment":return"verticalAlignment";case"CellLeftMargin":return"leftMargin";case"CellRightMargin":return"rightMargin";case"CellBottomMargin":return"bottomMargin";case"CellTopMargin":return"topMargin";case"CellPreferredWidth":return"preferredWidth";case"Shading":return"shading";default:return"preferredWidthType"}},Tci);function Tci(e){this.cellOperation=[],this.splittedRevisions=[],this.isRemovedNodes=!1,this.modifiedFormatOperation=[],this.revisionOperation=[],this.markerData=[],this.pastedComments=[],this.ownerIn=e,this.documentHelper=e.documentHelper,this.modifiedPropertiesIn=[],this.modifiedNodeLength=[],this.removedNodesIn=[],this.insertedNodes=[]}Eci=function(e,t){return(Eci=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Eci(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(kci,Dci=Ici),Object.defineProperty(kci.prototype,"hasAction",{get:function(){return!je(this.modifiedActions)},enumerable:!0,configurable:!0}),kci.prototype.addModifiedAction=function(e){this.editorHistory.isUndoing||this.editorHistory.isRedoing||(je(this.modifiedActions)&&(this.modifiedActions=[]),this.modifiedActions.push(e))},kci.prototype.getActionInfo=function(e){var t=this.action,i=[];switch(t){case"Insert":case"InsertContentControl":for(l=0;l<this.modifiedActions.length;l++){var n=this.modifiedActions[parseInt(l.toString(),10)];i.push(n.getInsertOperation(n.action))}break;case"InsertBookmark":case"RestrictEditing":if(this.editorHistory.isUndoing)for(l=0;l<this.modifiedActions.length;l++)"RestrictEditing"===t&&this.modifiedActions[parseInt(l.toString(),10)].markerData.push(this.owner.editorModule.getMarkerData(this.modifiedActions[parseInt(l.toString(),10)].removedNodes[0])),i.push(this.modifiedActions[parseInt(l.toString(),10)].getDeleteOperation("DeleteBookmark",0===l||void 0)),this.modifiedActions[parseInt(l.toString(),10)].markerData.shift();else for(l=0;l<this.modifiedActions.length;l++)"DeleteBookmark"===(n=this.modifiedActions[parseInt(l.toString(),10)]).action?(i.push(n.getDeleteOperation("DeleteBookmark")),i.push(n.getDeleteOperation("DeleteBookmark",!0))):i.push(n.getInsertOperation(t));break;case"BackSpace":case"Delete":case"RemoveEditRange":if(this.editorHistory.isUndoing){for(l=0;l<this.modifiedActions.length;l++)"InsertInline"===(n=this.modifiedActions[parseInt(l.toString(),10)]).action?(r=n.getDeleteOperation("DeleteBookmark",!0),i.push(r)):(h=n.getActionInfo(),i=i.concat(h),"RemoveEditRange"===n.action&&i.push(n.getDeleteOperation(t,!0)));i.reverse()}else for(l=0;l<this.modifiedActions.length;l++)"InsertInline"===(n=this.modifiedActions[parseInt(l.toString(),10)]).action?(r=n.getInsertOperation("InsertBookmark"),i.push(r)):(i.push(n.getDeleteOperation(t)),"RemoveEditRange"===n.action&&i.push(n.getDeleteOperation(t,!0)));break;case"PageBreak":case"ColumnBreak":if(this.owner.enableTrackChanges)for(l=0;l<this.modifiedActions.length;l++){0<(n=this.modifiedActions[parseInt(l.toString(),10)]).removedNodes.length&&(i=i.concat(n.getDeleteOperationsForTrackChanges()));var o=n.markerData[n.markerData.length-1],r=n.getInsertOperation("Enter"),s=this.getInsertOperation(t);r.markerData=o,s.markerData=this.owner.editorModule.getMarkerData(void 0,void 0,this.owner.editorModule.getRevision(o.revisionId)),i.push(r),i.push(s),i.push(r),r.markerData.skipOperation=!0}else if(this.editorHistory.isUndoing)for(l=0;l<this.modifiedActions.length;l++)(n=this.modifiedActions[parseInt(l.toString(),10)]).endIndex=n.startIndex,i.push(n.getDeleteOperation("Delete")),i.push(n.getDeleteOperation("Delete")),i.push(n.getDeleteOperation("Delete")),n.isRemovedNodes&&(h=n.getDeleteContent("BackSpace"),i=i.concat(h));else{for(l=0;l<this.modifiedActions.length;l++)0<(n=this.modifiedActions[parseInt(l.toString(),10)]).removedNodes.length&&i.push(n.getDeleteOperation(t));(r=this.getInsertOperation("Enter")).markerData={skipOperation:!0},i.push(r),i.push(r),i.push(this.getInsertOperation(t)),i.push(r)}break;case"InsertHyperlink":case"AutoFormatHyperlink":case"RemoveHyperlink":if(this.editorHistory.isUndoing&&"RemoveHyperlink"===t){for(var a=0,l=0;l<this.modifiedActions.length;l++)"FontColor"!==(n=this.modifiedActions[parseInt(l.toString(),10)]).action&&"Underline"!==n.action||(a=n.endIndex-n.startIndex);je(this.modifiedActions[parseInt((this.modifiedActions.length-1).toString(),10)].fieldBegin)||(this.modifiedActions[parseInt((this.modifiedActions.length-1).toString(),10)].endIndex=this.modifiedActions[parseInt((this.modifiedActions.length-1).toString(),10)].startIndex+a,(r=this.modifiedActions[parseInt((this.modifiedActions.length-1).toString(),10)].getDeleteOperation("Delete")).markerData=void 0,i.push(r),h=this.modifiedActions[parseInt((this.modifiedActions.length-1).toString(),10)].getFieldOperation(),i=i.concat(h))}else{for(l=0;l<this.modifiedActions.length;l++)"InsertHyperlink"===(n=this.modifiedActions[parseInt(l.toString(),10)]).action?i.push.apply(i,n.getActionInfo()):"InsertInline"===n.action?n.insertedText===pJt.Marker_Start||n.insertedText===pJt.Marker_End?this.editorHistory.isUndoing?i.push(n.getDeleteOperation(n.action)):i.push(n.getInsertOperation("InsertHyperlink")):this.editorHistory.isUndoing?i.push(n.getDeleteOperation(n.action)):i.push(n.getInsertOperation("Insert")):"Delete"===n.action?i.push(n.getDeleteOperation(n.action)):"Underline"!==n.action&&"FontColor"!==n.action||(i=i.concat(n.getActionInfo()));this.editorHistory.isUndoing&&i.reverse()}break;case"InsertComment":if(this.editorHistory.isUndoing)this.getDeleteCommentOperation(this.modifiedActions,i);else for(l=0;l<this.modifiedActions.length;l++){r=(n=this.modifiedActions[parseInt(l.toString(),10)]).getInsertOperation(n.action);n.insertedElement instanceof Khi&&"InsertInline"===n.action?i.push(n.getCommentOperation(r,n.action)):"InsertCommentWidget"===n.action&&(r=this.getUpdateOperation(),i.push(n.getCommentOperation(r,n.action)))}break;case"RemoveComment":if(this.editorHistory.isUndoing)for(l=this.modifiedActions.length-1;0<=l;l--){var r=void 0,h=[];"InsertInline"===(n=this.modifiedActions[parseInt(l.toString(),10)]).action&&n.insertedElement instanceof Khi?(r=n.getDeleteOperation(n.action),h.push(n.getCommentOperation(r,"InsertInline"))):"RemoveInline"===n.action?(r=n.getDeleteOperation(n.action),h.push(n.getCommentOperation(r,"InsertInline")),r=n.getInsertOperation(n.action),h.push(n.getCommentOperation(r,"InsertInline"))):"DeleteComment"===n.action?h=n.getActionInfo():(this.owner.sfdtExportModule.iscontentInsert=!1,h=n.getActionInfo(),this.owner.sfdtExportModule.iscontentInsert=!0),i=i.concat(h)}else for(l=0;l<this.modifiedActions.length;l++){r=void 0,h=[];"RemoveInline"===(n=this.modifiedActions[parseInt(l.toString(),10)]).action&&n.removedNodes[0]instanceof Khi?(r=n.getDeleteOperation(n.action),h.push(n.getCommentOperation(r,n.action))):"InsertInline"===n.action&&n.insertedElement instanceof Khi?(r=n.getInsertOperation(n.action),h.push(n.getCommentOperation(r,n.action))):h=n.getActionInfo(),i=i.concat(h)}break;case"DeleteComment":if(this.editorHistory.isUndoing)for(var d=this.modifiedActions.length-1;0<=d;d--){var p=this.modifiedActions[parseInt(d.toString(),10)],r=p.getInsertOperation(p.action);p.insertedElement instanceof Khi&&"RemoveInline"===p.action?i.push(p.getCommentOperation(r,"InsertInline")):"DeleteCommentWidget"===p.action?(r=this.getUpdateOperation(),i.push(p.getCommentOperation(r,"InsertCommentWidget"))):"DeleteComment"===p.action&&p.getActionInfo()}else this.getDeleteCommentOperation(this.modifiedActions,i);break;case"FormField":i=(n=this.modifiedActions.pop()).getFieldOperation();break;case"IMEInput":if(!e||this.editorHistory.isUndoing||this.editorHistory.isRedoing){n=this.modifiedActions[this.modifiedActions.length-1];if(this.editorHistory.isUndoing||this.editorHistory.isRedoing)for(l=0;l<this.modifiedActions.length;l++)0<(n=this.modifiedActions[parseInt(l.toString(),10)]).removedNodes.length&&i.push(n.getDeleteOperation(t)),n.isRemovedNodes&&(h=n.getDeleteContent("BackSpace"),i=i.concat(h)),n.isRemovedNodes=!1;else 0<n.removedNodes.length&&i.push(n.getDeleteOperation(t)),i.push(n.getInsertOperation(this.action));n.isRemovedNodes=!1}else{0<this.modifiedActions[0].removedNodes.length&&((c=this.modifiedActions[0].getDeleteOperation("Delete")).length=c.text.length,i.push(c));var c=this.modifiedActions[this.modifiedActions.length-1].getInsertOperation("Insert");c.length=c.text.length,i.push(c),i.reverse();for(l=0;l<i.length;l++)"Insert"===(r=i[parseInt(l.toString(),10)]).action?r.action="Delete":"Delete"===r.action&&(r.action="Insert")}break;case"Accept All":case"ReplaceAll":case"Reject All":if(this.editorHistory.isUndoing)for(l=this.modifiedActions.length-1;0<=l;l--)!je((n=this.modifiedActions[parseInt(l.toString(),10)]).cellOperation)&&0<n.cellOperation.length?(i.push(n.cellOperation[0]),n.cellOperation=[]):(u=n.getActionInfo(),i.push.apply(i,u));else for(var u,l=0;l<this.modifiedActions.length;l++)!je((n=this.modifiedActions[parseInt(l.toString(),10)]).cellOperation)&&0<n.cellOperation.length?(i.push(n.cellOperation[0]),n.cellOperation=[]):(u=n.getActionInfo(),i.push.apply(i,u));break;case"Paste":for(l=0;l<this.modifiedActions.length;l++){(n=this.modifiedActions[parseInt(l.toString(),10)]).type="PasteToc"===this.type?this.type:"Paste";var g=n.getActionInfo();i.push.apply(i,g)}break;case"TOC":if(this.modifiedActions)if(this.editorHistory.isUndoing)for(l=this.modifiedActions.length-1;0<=l;l--){(n=this.modifiedActions[parseInt(l.toString(),10)]).type="Paste"===n.action?"PasteToc":void 0;var m=n.getActionInfo();i.push.apply(i,m)}else for(l=0;l<this.modifiedActions.length;l++){m=((n=this.modifiedActions[parseInt(l.toString(),10)]).type="Paste"===n.action?"PasteToc":void 0,n.getActionInfo());i.push.apply(i,m)}break;case"DragAndDropContent":for(l=0;l<this.modifiedActions.length;l++){(n=this.modifiedActions[parseInt(l.toString(),10)]).type="Paste"===n.action?"Paste":void 0;var f=n.getActionInfo();i.push.apply(i,f)}break;case"ClearFormat":if(this.editorHistory.isUndoing)for(l=0;l<this.modifiedActions.length;l++)i.push.apply(i,this.modifiedActions[parseInt(l.toString(),10)].modifiedFormatOperation),this.modifiedActions[parseInt(l.toString(),10)].modifiedFormatOperation=[];else i=this.modifiedActions[this.modifiedActions.length-1].buildFormatOperation("ClearFormat",!0).slice();break;case"ApplyStyle":var y=[];if(this.modifiedActions[0]instanceof kci&&(i=(y=this.modifiedActions[0].modifiedActions[0].buildFormatOperation("ClearFormat",!0)).slice()),!(this.modifiedActions[this.modifiedActions.length-1]instanceof kci)){y=this.modifiedActions[this.modifiedActions.length-1].buildFormatOperation(t,!0);for(l=0;l<y.length;l++)i.push(y[parseInt(l.toString(),10)])}break;case"TableMarginsSelection":this.modifiedActions[this.modifiedActions.length-1].createTableFormat(this.modifiedActions[this.modifiedActions.length-1].action),this.modifiedActions[this.modifiedActions.length-1].type="TableFormat",i.push(this.modifiedActions[this.modifiedActions.length-1].getFormatOperation());break;case"BordersAndShading":"TableFormat"===this.modifiedActions[0].action?(this.modifiedActions[0].type="TableFormat",this.modifiedActions[0].createTableFormat("BordersAndShading"),i.push(this.modifiedActions[0].getFormatOperation())):(this.modifiedActions[0].createCellFormat("BordersAndShading"),this.modifiedActions[0].type="CellFormat",i=this.modifiedActions[0].getSelectedCellOperation("BordersAndShading",void 0,!0,!0,!0));break;case"AutoList":for(l=0;l<this.modifiedActions.length;l++){var v=(n=this.modifiedActions[parseInt(l.toString(),10)]).getActionInfo();i.push.apply(i,v)}break;case"TableProperties":for(l=0;l<this.modifiedActions.length;l++){var b=this.modifiedActions[parseInt(l.toString(),10)];if("TableFormat"===b.action)b.createTableFormat(b.action),b.type="TableFormat",i.push(b.getFormatOperation());else if("RowFormat"===b.action)this.editorHistory.isUndoing||this.editorHistory.isRedoing&&1<b.modifiedProperties.length?(i=b.modifiedFormatOperation,b.modifiedFormatOperation=[]):(b.createRowFormat(b.action),b.type="RowFormat",i.push(b.getFormatOperation()));else if("CellFormat"===b.action){b.createCellFormat(b.action),b.type="CellFormat";for(var w=b.getSelectedCellOperation(b.action,!1,!1,!1,!0),C=0;C<w.length;C++)i.push(w[parseInt(C.toString(),10)])}}break;case"CellMarginsSelection":this.modifiedActions[this.modifiedActions.length-1].createCellFormat("CellOptions"),this.modifiedActions[this.modifiedActions.length-1].type="CellFormat",i=this.modifiedActions[this.modifiedActions.length-1].getSelectedCellOperation("CellOptions",!1,!1,!1,!0).slice()}return i},kci.prototype.revert=function(){if("BordersAndShading"===(this.editorHistory.currentHistoryInfo=this).action&&(this.owner.editorModule.isBordersAndShadingDialog=!0),!je(this.modifiedActions))if(this.editorHistory.isUndoing)for(var e=this.modifiedActions.length;0<e;)this.modifiedActions[e-1].revert(),e-=1;else for(e=0;e<this.modifiedActions.length;)this.modifiedActions[parseInt(e.toString(),10)].revert(),e+=1;var t,i;"RestrictEditing"===this.action&&(t=""!==this.editRangeStart.user?this.editRangeStart.user:this.editRangeStart.group,this.editorHistory.isUndoing?-1!==(i=this.owner.documentHelper.editRanges.get(t).indexOf(this.editRangeStart))&&this.owner.documentHelper.editRanges.get(t).splice(i,1):this.owner.editorModule.updateRangeCollection(this.editRangeStart,t),this.owner.selectionModule.updateEditRangeCollection()),this.isChildHistoryInfo?this.editorHistory.updateComplexHistoryInternal():this.editorHistory.updateComplexHistory()},kci.prototype.destroy=function(){if(!je(this.modifiedActions)){for(;0<this.modifiedActions.length;){var e=this.modifiedActions[this.modifiedActions.length-1];e.destroy(),this.modifiedActions.splice(this.modifiedActions.indexOf(e),1)}this.modifiedActions=void 0}Dci.prototype.destroy.call(this)};var Eci,Dci,Mci=kci;function kci(e,t){var i=Dci.call(this,e)||this;return i.isChildHistoryInfo=!1,i.editRangeStart=void 0,i.documentHelper=e.documentHelper,i.isChildHistoryInfo=t,i}Object.defineProperty(Bci.prototype,"currentHistoryInfo",{get:function(){return this.historyInfoStack&&0<this.historyInfoStack.length?this.historyInfoStack[this.historyInfoStack.length-1]:void 0},set:function(e){e instanceof Mci?this.historyInfoStack.push(e):this.historyInfoStack.pop()},enumerable:!0,configurable:!0}),Object.defineProperty(Bci.prototype,"undoStack",{get:function(){return this.undoStackIn},enumerable:!0,configurable:!0}),Object.defineProperty(Bci.prototype,"redoStack",{get:function(){return this.redoStackIn},enumerable:!0,configurable:!0}),Object.defineProperty(Bci.prototype,"undoLimit",{get:function(){return je(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(Bci.prototype,"redoLimit",{get:function(){return je(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(Bci.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),Bci.prototype.getModuleName=function(){return"EditorHistory"},Bci.prototype.canUndo=function(){return!je(this.undoStack)&&0<this.undoStack.length},Bci.prototype.canRedo=function(){return!je(this.redoStack)&&0<this.redoStack.length},Bci.prototype.initializeHistory=function(e){je(this.currentBaseHistoryInfo)||this.currentBaseHistoryInfo.destroy(),this.currentBaseHistoryInfo=new Ici(this.owner),"ModifyStyle"!==(this.currentBaseHistoryInfo.action=e)&&this.currentBaseHistoryInfo.updateSelection(),!je(this.documentHelper.selection)&&this.documentHelper.selection.isEmpty&&("BackSpace"===e||"Delete"===e||"Insert"===e&&!je(this.documentHelper.owner.editor)&&this.documentHelper.owner.editor.handledTextInput)&&(this.currentBaseHistoryInfo.isEmptySelection=!0)},Bci.prototype.initComplexHistory=function(e,t){switch(this.currentHistoryInfo=new Mci(e.owner,!je(this.currentHistoryInfo)),this.currentHistoryInfo.action=t){case"PageBreak":this.currentHistoryInfo.insertedText=pJt.PageBreak,this.currentHistoryInfo.insertPosition=e.startOffset;break;case"ColumnBreak":this.currentHistoryInfo.insertedText=pJt.ColumnBreak,this.currentHistoryInfo.insertPosition=e.startOffset}this.currentHistoryInfo.updateSelection()},Bci.prototype.initResizingHistory=function(e,t){var i;1===t.resizeNode?(this.initializeHistory("RowResizing"),je(this.currentBaseHistoryInfo)||(t.currentResizingTable=t.currentResizingTable.combineWidget(this.viewer),this.currentBaseHistoryInfo.modifiedProperties.push(new yci(t.currentResizingTable,e,t.currentResizingTable.childWidgets[t.resizerPosition].rowFormat,this.owner)),this.documentHelper.layout.reLayoutTable(t.currentResizingTable))):(this.initializeHistory("CellResizing"),this.currentBaseHistoryInfo&&(t.currentResizingTable=t.currentResizingTable.combineWidget(this.viewer),(i=new bci(t.currentResizingTable,this.owner)).startingPoint=e,this.currentBaseHistoryInfo.modifiedProperties.push(i),this.documentHelper.layout.reLayoutTable(t.currentResizingTable)))},Bci.prototype.beginUndoAction=function(){this.isUndoGroupingEnded&&(this.owner.editorModule.initComplexHistory("Grouping"),this.isUndoGroupingEnded=!1,this.clearRedoStack())},Bci.prototype.endUndoAction=function(){this.isUndoGroupingEnded||(this.updateComplexHistory(),this.isUndoGroupingEnded=!0)},Bci.prototype.updateResizingHistory=function(e,t){var i;1===t.resizeNode?je(this.currentBaseHistoryInfo)||((i=this.currentBaseHistoryInfo.modifiedProperties[0]).startingPoint.y===e.y?this.currentBaseHistoryInfo.modifiedProperties.length=0:(i.displacement=Y.convertPixelToPoint(e.y-i.startingPoint.y),this.recordChanges(this.currentBaseHistoryInfo),this.owner.fireContentChange(),this.currentBaseHistoryInfo=void 0)):je(this.currentBaseHistoryInfo)||((i=this.currentBaseHistoryInfo.modifiedProperties[0]).startingPoint.x===e.x?this.currentBaseHistoryInfo.modifiedProperties.length=0:(i.displacement=Y.convertPixelToPoint(e.x-i.startingPoint.x),i.endIndex=t.getCellReSizerPosition(e),this.owner.editorHistoryModule.recordChanges(this.currentBaseHistoryInfo),this.owner.fireContentChange(),this.currentBaseHistoryInfo=void 0))},Bci.prototype.recordChanges=function(e){var t;this.owner.enableHistoryMode&&(this.isUndoing?(je(this.redoStack)&&(this.redoStackIn=[]),this.redoStack.length===this.redoLimit&&0<this.redoLimit&&(t=20<this.undoLimit?10:1,this.redoStackIn.splice(0,t)),this.redoStack.length<this.redoLimit&&this.redoStack.push(e)):(this.isRedoing||this.clearRedoStack(),je(this.undoStack)&&(this.undoStackIn=[]),this.undoStack.length===this.undoLimit&&0<this.undoLimit&&(t=20<this.undoLimit?10:1,this.undoStackIn.splice(0,t)),this.undoStack.length<this.undoLimit&&this.undoStackIn.push(e)),this.lastOperation=e)},Bci.prototype.updateHistory=function(){this.documentHelper.owner.enableHistoryMode&&!je(this.currentBaseHistoryInfo)&&(!je(this.currentBaseHistoryInfo)&&je(this.currentBaseHistoryInfo.endPosition)&&(this.currentBaseHistoryInfo.endPosition=this.currentBaseHistoryInfo.insertPosition),je(this.currentHistoryInfo)?this.recordChanges(this.currentBaseHistoryInfo):this.currentHistoryInfo.addModifiedAction(this.currentBaseHistoryInfo),this.currentBaseHistoryInfo=void 0)},Bci.prototype.isHandledComplexHistory=function(){var e=!1;return this.isUndoing||this.isRedoing||(0<this.owner.editorModule.removedBookmarkElements.length&&this.owner.editorModule.insertRemoveBookMarkElements(e)&&(e=!0),0<this.owner.editorModule.removedEditRangeEndElements.length&&this.owner.editorModule.insertRemovedEditRangeEndElements(e)&&(e=!0),0<this.owner.editorModule.removedEditRangeStartElements.length&&this.owner.editorModule.insertRemovedEditRangeStartElements(e)&&(e=!0),0<this.owner.editorModule.removedContentControlElements.length&&this.owner.editorModule.insertRemoveContentControlElements(e)&&(e=!0)),this.documentHelper.owner.enableHistoryMode&&!je(this.currentHistoryInfo)?"Grouping"!==this.currentHistoryInfo.action&&(this.updateHistory(),e=!0):this.owner.editorModule.isHandledComplex&&(e=!0),e},Bci.prototype.updateComplexHistory=function(){var e,t,i=this.documentHelper.selection;!je(this.currentHistoryInfo)&&this.currentHistoryInfo.hasAction&&("AutoFormatHyperlink"!==this.currentHistoryInfo.action&&"SkipCommentInline"!==this.currentHistoryInfo.action&&"DeleteCommentInline"!==this.currentHistoryInfo.action&&"RemoveComment"!==this.currentHistoryInfo.action||(i.owner.editorHistoryModule.isUndoing?(this.owner.editorModule.setPositionForCurrentIndex(i.start,this.currentHistoryInfo.selectionStart),this.owner.editorModule.setPositionForCurrentIndex(i.end,this.currentHistoryInfo.selectionEnd)):(this.owner.editorModule.setPositionForCurrentIndex(i.start,this.currentHistoryInfo.endPosition),this.owner.editorModule.setPositionForCurrentIndex(i.end,this.currentHistoryInfo.endPosition))),"InsertHyperlink"===this.currentHistoryInfo.action&&(e=new rci(i.owner),je(this.currentHistoryInfo.insertPosition)||(this.owner.editorModule.setPositionForCurrentIndex(e,this.currentHistoryInfo.insertPosition),t=new rci(i.owner),this.owner.editorModule.setPositionForCurrentIndex(t,this.currentHistoryInfo.endPosition),this.documentHelper.layout.reLayoutParagraph(e.paragraph,0,0),t.paragraph!==e.paragraph&&this.documentHelper.layout.reLayoutParagraph(t.paragraph,0,0))),"ReplaceAll"===this.currentHistoryInfo.action?(this.documentHelper.contentControlCollection=[],this.owner.editorModule.layoutWholeDocument()):i.owner.isShiftingEnabled&&(je(i.editRegionHighlighters)||i.editRegionHighlighters.clear(),this.documentHelper.layout.shiftLayoutedItems(!1),this.owner.enableHeaderAndFooter&&this.owner.editorModule.updateHeaderFooterWidget(),this.documentHelper.removeEmptyPages())),this.owner.showRevisions&&!this.owner.editorModule.restrictLayout&&this.owner.trackChangesPane.updateTrackChanges(),i.owner.isShiftingEnabled=!1,i.owner.isLayoutEnabled=!0,je(this.currentHistoryInfo)||"ApplyStyle"!==this.currentHistoryInfo.action?(i.start.updatePhysicalPosition(!0),i.isEmpty?i.end.setPositionInternal(i.start):i.end.updatePhysicalPosition(!0)):this.owner.editorModule.getOffsetValue(i),i.upDownSelectionLength=i.end.location.x,this.documentHelper.isScrollHandler=!0,this.owner.editorModule.restrictLayout||this.viewer.updateScrollBars(),i.fireSelectionChanged(!0),this.documentHelper.isScrollHandler=!1,this.owner.enableAutoFocus&&this.documentHelper.updateFocus(),this.updateComplexHistoryInternal(),this.owner.editorModule.isInsertingTOC||this.owner.editorModule.fireContentChange()},Bci.prototype.updateComplexHistoryInternal=function(){je(this.currentHistoryInfo)||(je(this.currentHistoryInfo.endPosition)&&(this.currentHistoryInfo.endPosition=this.currentHistoryInfo.insertPosition),1<this.historyInfoStack.length?this.historyInfoStack[this.historyInfoStack.length-2].addModifiedAction(this.currentHistoryInfo):this.recordChanges(this.currentHistoryInfo),this.currentHistoryInfo=void 0)},Bci.prototype.updateListChangesInHistory=function(e,t){this.currentBaseHistoryInfo=new Ici(this.documentHelper.owner),this.currentBaseHistoryInfo.action="List",this.currentBaseHistoryInfo.updateSelection();for(var i=new uJt,n=0;n<e.levels.length;n++){var o=this.documentHelper.getAbstractListById(t.abstractListId).levels[parseInt(n.toString(),10)],r=(this.currentBaseHistoryInfo.addModifiedPropertiesForList(o),new uci(o,e.levels[parseInt(n.toString(),10)]));je(o)||this.documentHelper.owner.editorModule.copyListLevel(o,e.levels[parseInt(n.toString(),10)]),i.add(n,r)}return i},Bci.prototype.applyListChanges=function(e,t){je(this.modifiedParaFormats)&&(this.modifiedParaFormats=new uJt);for(var i=[],n=0;n<this.documentHelper.listParagraphs.length;n++){var o,r=this.documentHelper.listParagraphs[parseInt(n.toString(),10)].paragraphFormat,s=this.documentHelper.getListById(r.listFormat.listId),s=this.documentHelper.layout.getListLevel(s,r.listFormat.listLevelNumber);t.containsKey(r.listFormat.listLevelNumber)&&t.get(r.listFormat.listLevelNumber).ownerListLevel===s&&((o=new bri(null)).leftIndent=r.leftIndent,o.firstLineIndent=r.firstLineIndent,o=new mci(r,o),i.push(o),this.owner.editorModule.copyFromListLevelParagraphFormat(r,s.paragraphFormat))}this.modifiedParaFormats.add(this.currentBaseHistoryInfo,i)},Bci.prototype.updateListChanges=function(e){this.documentHelper.owner.isLayoutEnabled=!1,this.owner.editorModule.updateListParagraphs();for(var t=0;t<e.keys.length;t++){var i=e.keys[parseInt(t.toString(),10)],i=e.get(i);je(this.currentBaseHistoryInfo)||(i=this.currentBaseHistoryInfo.addModifiedPropertiesForList(i.ownerListLevel)),this.owner.editorModule.copyListLevel(i.ownerListLevel,i.modifiedListLevel)}this.documentHelper.owner.isLayoutEnabled=!0,this.documentHelper.renderedLists.clear(),this.documentHelper.renderedLevelOverrides=[],this.owner.editorModule.layoutWholeDocument();var n=this.documentHelper.selection;n.start.updatePhysicalPosition(!0),n.isEmpty?n.end.setPositionInternal(n.start):n.end.updatePhysicalPosition(!0),n.upDownSelectionLength=n.end.location.x,n.fireSelectionChanged(!1),this.updateHistory()},Bci.prototype.undo=function(){var e;(!this.owner.isReadOnlyMode||this.owner.documentHelper.isCommentOnlyMode||"FormFieldsOnly"===this.owner.documentHelper.protectionType)&&this.canUndo()&&this.owner.enableHistoryMode&&(e=this.undoStack.pop(),this.isUndoing=!0,e.revert(),this.isUndoing=!1,this.owner.selectionModule.checkForCursorVisibility(),this.owner.editorModule.isBordersAndShadingDialog=!1)},Bci.prototype.redo=function(){var e;(!this.owner.isReadOnlyMode||this.owner.documentHelper.isCommentOnlyMode||"FormFieldsOnly"===this.owner.documentHelper.protectionType)&&this.canRedo()&&this.owner.enableHistoryMode&&("BordersAndShading"===(e=this.redoStack.pop()).action&&(this.owner.editorModule.isBordersAndShadingDialog=!0),this.isRedoing=!0,e.revert(),this.isRedoing=!1,this.owner.selectionModule.checkForCursorVisibility(),this.owner.editorModule.isBordersAndShadingDialog=!1)},Bci.prototype.destroy=function(){this.clearHistory(),this.undoStackIn=void 0,this.redoStackIn=void 0},Bci.prototype.clearHistory=function(){this.clearUndoStack(),this.clearRedoStack()},Bci.prototype.clearUndoStack=function(){if(this.canUndo())for(;0<this.undoStack.length;)this.undoStack.pop().destroy(),0},Bci.prototype.clearRedoStack=function(){if(this.canRedo())for(;0<this.redoStack.length;)this.redoStack.pop().destroy(),0};var Pci=Bci;function Bci(e){this.undoStackIn=[],this.redoStackIn=[],this.historyInfoStack=[],this.isUndoGroupingEnded=!0,this.isUndoing=!1,this.isRedoing=!1,this.owner=e,this.documentHelper=e.documentHelper,this.modifiedParaFormats=new uJt,this.undoLimitIn=500,this.redoLimitIn=500}Object.defineProperty(Lci.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),Lci.prototype.getModuleName=function(){return"TableResizer"},Lci.prototype.updateResizingHistory=function(e){this.owner.editorHistoryModule&&this.owner.editorHistoryModule.updateResizingHistory(e,this),this.documentHelper.isRowOrCellResizing=!1,this.resizerPosition=-1},Lci.prototype.handleResize=function(e){this.owner.documentHelper.isRowOrCellResizing=!0,this.startingPoint.x=e.x,this.startingPoint.y=e.y,this.owner.editorHistoryModule.initResizingHistory(e,this)},Lci.prototype.isInRowResizerArea=function(e){e=this.getRowReSizerPosition(void 0,e);return-1!==e&&(this.resizeNode=1,this.resizerPosition=e,!0)},Lci.prototype.isInCellResizerArea=function(e){e=this.getCellReSizerPosition(e);return-1===e?this.isResizerEnabled=!1:(this.resizeNode=0,this.isResizerEnabled=!0,this.resizerPosition=e,!0)},Lci.prototype.getCellReSizerPosition=function(e){var t=-1,i=this.getTableWidget(e),n=this.getTableCellWidget(e),o=je(i)?0:i.tableFormat.cellSpacing;if(i&&0<o){if(this.currentResizingTable=i,this.documentHelper.isInsideRect(i.x-Y.convertPointToPixel(i.leftBorderWidth)-.25,i.y,Y.convertPointToPixel(i.leftBorderWidth)+.5,i.height,e))return 0;for(var r=i.x,s=0;s<i.tableHolder.columns.length;s++){var a=Y.convertPointToPixel(i.tableHolder.columns[parseInt(s.toString(),10)].preferredWidth);if(this.documentHelper.isInsideRect(r-1,i.y,i.leftBorderWidth+2,i.height,e))return 0<s?s:0;if(0<s&&this.documentHelper.isInsideRect(r+a-1,i.y,2,i.height,e))return s+1;r+=a}}else if(!je(n)){if(this.currentResizingTable=n.ownerTable,this.documentHelper.isInsideRect(n.x-n.margin.left-1,n.y-n.margin.top,2,n.height+n.margin.top+n.margin.bottom,e))return n.columnIndex;if(je(n.nextRenderedWidget)&&this.documentHelper.isInsideRect(n.x+n.margin.right+n.width-1,n.y-n.margin.top,2,n.height+n.margin.top+n.margin.bottom,e))return n.columnIndex+n.cellFormat.columnSpan;if(0<n.childWidgets.length)return this.getCellReSizerPositionInternal(n,e)}return t},Lci.prototype.getCellReSizerPositionInternal=function(e,t){var i=-1,n=this.getTableWidgetFromWidget(t,e),e=void 0;if(!je(n)&&0<n.tableFormat.cellSpacing){if(this.currentResizingTable=n,this.documentHelper.isInsideRect(n.x-n.leftBorderWidth-.25,n.y,n.leftBorderWidth+.5,n.height,t))return 0;for(var o=n.x,r=0;r<n.tableHolder.columns.length;r++){var s=Y.convertPointToPixel(n.tableHolder.columns[parseInt(r.toString(),10)].preferredWidth);if(this.documentHelper.isInsideRect(o-1,n.y,n.leftBorderWidth+2,n.height,t))return 0<r?r:0;if(0<r&&this.documentHelper.isInsideRect(o+s-1,n.y,2,n.height,t))return r+1;o+=s}}else if(je(n)||(e=n.getTableCellWidget(t)),je(e))this.isResizerEnabled&&0===this.owner.selection.getSelectedCells().length&&this.owner.documentHelper.isMouseDown&&(i=this.resizerPosition);else{if(this.currentResizingTable=e.ownerTable,this.documentHelper.isInsideRect(e.x-e.margin.left-1,e.y-e.margin.top,2,e.height,t))return e.columnIndex;if(je(e.nextRenderedWidget)&&this.documentHelper.isInsideRect(e.x+e.margin.right+e.width-1,e.y-e.margin.top,2,e.height,t))return e.columnIndex+e.cellFormat.columnSpan;if(0<e.childWidgets.length)return this.getCellReSizerPositionInternal(e,t)}return i},Lci.prototype.getRowReSizerPosition=function(e,t){var i=void 0,n=void 0,o=(je(e)?(i=this.getTableWidget(t),n=this.getTableCellWidget(t)):i=this.getTableWidgetFromWidget(t,e),je(i)?0:i.tableFormat.cellSpacing);if(i&&0<o){if(this.currentResizingTable=i,this.owner.documentHelper.isInsideRect(i.x,i.y+i.height-o,this.getActualWidth(i.lastChild),je(i.nextSplitWidget)?i.bottomBorderWidth+o:0,t))return i.lastChild.rowIndex;for(var r=0;r<i.childWidgets.length;r++){var s=i.childWidgets[parseInt(r.toString(),10)];if(-1<i.childWidgets.indexOf(s)&&this.owner.documentHelper.isInsideRect(s.x,s.y+s.height+o/2,this.getActualWidth(s),o/2,t))return s.rowIndex}}else if(n=i?n&&this.getTableCellWidget(t):n){e=0,e=(s=n.containerWidget).rowIndex===s.ownerTable.childWidgets.length-1?s.bottomBorderWidth+2:s.nextRenderedWidget.topBorderWidth+2;if(this.owner.documentHelper.isInsideRect(s.x,s.y+s.height-e,s.width,2*e,t))return this.currentResizingTable=s.ownerTable,s.rowIndex;if(0<n.childWidgets.length)return this.getRowReSizerPosition(n,t)}return-1},Lci.prototype.handleResizing=function(e,t,i){this.owner.isShiftingEnabled=!0,t?0===this.resizeNode&&this.resizeTableCellColumn(i):0===this.resizeNode?(i=e.x-this.startingPoint.x,this.resizeTableCellColumn(i)):(i=e.y-this.startingPoint.y,this.resizeTableRow(i))},Lci.prototype.resizeTableRow=function(e){var t,i,n=this.currentResizingTable;je(n)||0===e||-1===this.resizerPosition||(i=this.owner.selectionModule,t=void(n.isInsideTable&&(this.owner.isLayoutEnabled=!1)),-1<this.resizerPosition&&((t=n.childWidgets[this.resizerPosition])&&this.updateRowHeight(t,e),i.selectPosition(i.start,i.end)),n.isInsideTable&&(i=this.owner.documentHelper.layout.getParentTable(n),this.owner.isLayoutEnabled=!0,n=i),this.startingPoint.y+=Y.convertPointToPixel(e),this.owner.documentHelper.layout.reLayoutTable(n),this.owner.editorModule.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.owner.editorModule.reLayout(this.owner.selectionModule),this.owner.editorModule.isSkipOperationsBuild=!1,t&&this.getRowReSizerPosition(void 0,this.startingPoint),!this.currentResizingTable)||void 0!==this.currentResizingTable.childWidgets&&void 0!==this.currentResizingTable.childWidgets[this.resizerPosition]||(this.resizerPosition=-1)},Lci.prototype.getTableWidget=function(e){var t=void 0,i=this.owner.documentHelper.currentPage;if(!je(i))for(var n=0;n<i.bodyWidgets.length;n++){var o=i.bodyWidgets[parseInt(n.toString(),10)];if(!je(t=this.getTableWidgetFromWidget(e,o)))break;if("Pages"===this.documentHelper.owner.layoutType){o=i.headerWidget;if(!je(t=this.getTableWidgetFromWidget(e,o)))break;o=i.footerWidget;if(!je(t=this.getTableWidgetFromWidget(e,o)))break}}return t},Lci.prototype.getTableWidgetFromWidget=function(e,t){for(var i=0;i<t.childWidgets.length;i++)if(t.childWidgets[parseInt(i.toString(),10)]instanceof _ai){var n=t.childWidgets[parseInt(i.toString(),10)],o=0;if(n.wrapTextAround&&(o=n.getTableCellWidth()),!n.wrapTextAround&&n.y<=e.y&&n.y+n.height>=e.y)return n;if(n.wrapTextAround&&n.x<=e.x&&n.x+o>=e.x&&n.y<=e.y&&n.y+n.height>=e.y)return n}},Lci.prototype.getTableCellWidget=function(e){var t=void 0,i=this.owner.documentHelper.currentPage;if(!je(i))for(var n=0;n<i.bodyWidgets.length;n++){if(!je(t=i.bodyWidgets[parseInt(n.toString(),10)].getTableCellWidget(e)))break;if("Pages"===this.documentHelper.owner.layoutType&&this.viewer.owner.enableHeaderAndFooter){if(!je(t=i.headerWidget.getTableCellWidget(e)))break;if(!je(t=i.footerWidget.getTableCellWidget(e)))break}}return t},Lci.prototype.updateRowHeight=function(e,t){var i,e=e.rowFormat;"Auto"===e.heightType?(e.heightType="AtLeast",i=e.ownerBase,2.7<=(i=this.owner.documentHelper.layout.getRowHeight(i,[i]))+t&&e.height!==i+t&&(e.height=i+t)):e.height!==e.height+t&&(e.height=e.height+t<2.7?2.7:e.height+t)},Lci.prototype.resizeTableCellColumn=function(e){var t=this.currentResizingTable;if(!(je(t)||0===e||je(t.childWidgets)||this.resizerPosition<0)){var i=!0,n=this.owner.selectionModule,o=(this.owner.editorModule.setOffsetValue(n),t=t.combineWidget(this.viewer),this.owner.isLayoutEnabled=!1,this.setPreferredWidth(t),t.getOwnerWidth(!0)),r=t.leftIndent,s=t.tableFormat.tableAlignment;if(i=n.isEmpty?i:this.resizeColumnWithSelection(n,t,e)){if(0===this.resizerPosition){var i=this.resizerPosition,a=t.tableHolder.columns[parseInt(i.toString(),10)],i=a.preferredWidth;if(0<e){var l=e;do{if((h=Y.round(a.preferredWidth-e,1))>=a.minimumWidth){a.preferredWidth=h,r=-1440<=(r=t.leftIndent+e)?r<=1440?r:1440:-1440;break}}while(l=e,(e+=h-a.minimumWidth)!==l)}else{var h,l=e;do{if((h=Y.round(a.preferredWidth-e,1))<=2112){a.preferredWidth=h,r=-1440<=(r=t.leftIndent+e)?r<=1440?r:1440:-1440;break}}while(l=e,(e-=h-2112)!==l)}var d=e;"Left"!==s&&t.tableHolder.getTotalWidth(0)>o&&"Auto"===t.tableFormat.preferredWidthType&&(t.tableHolder.isFitColumns(o,t.tableHolder.tableWidth,"Auto"===t.tableFormat.preferredWidthType)?t.tableHolder.fitColumns(o,t.tableHolder.tableWidth,"Auto"===t.tableFormat.preferredWidthType,t.tableFormat.allowAutoFit):a.preferredWidth=i,d=0),"Center"===s&&(t.tableHolder.getTotalWidth(0)<o||"Auto"!==t.tableFormat.preferredWidthType)&&(d/=2),t.tableFormat.leftIndent="Left"===s?r:0,t.tableHolder.tableWidth=t.tableHolder.getTotalWidth(0),this.updateCellPreferredWidths(t),"Auto"!==t.tableFormat.preferredWidthType&&t.updateWidth(e),this.updateGridValue(t,!0,d)}else if(null!==t&&this.resizerPosition===t.tableHolder.columns.length)this.resizeColumnAtLastColumnIndex(t,e,o);else{if(-1===this.resizerPosition)return void(this.owner.isLayoutEnabled=!0);this.resizeCellAtMiddle(t,e)}this.owner.isLayoutEnabled=!0,n.selectPosition(n.start,n.end)}else this.updateGridValue(t,!0)}},Lci.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 o=e.getSelectedCells();if(0===this.resizerPosition)this.resizeColumnAtStart(t,i,o);else{if(null!==t&&this.resizerPosition===t.tableHolder.columns.length){for(var r=this.getColumnCells(t,this.resizerPosition,!0),s=0;s<r.length;s++){var a=r[parseInt(s.toString(),10)];-1!==o.indexOf(a)&&this.increaseOrDecreaseWidth(a,i,!0)}this.updateRowsGridAfterWidth(t),t.updateWidth(i)}else{if(-1===this.resizerPosition)return!1;var n=this.resizerPosition,r=this.getColumnCells(t,n,!0),l=this.getColumnCells(t,n,!1),n=this.isColumnSelected(t,n);if(0<r.length&&!n)for(s=0;s<r.length;s++)-1===o.indexOf(r[parseInt(s.toString(),10)])&&(r.splice(s,1),s--);if(0<l.length&&!n)for(s=0;s<l.length;s++)-1===o.indexOf(l[parseInt(s.toString(),10)])&&(l.splice(s,1),s--);if(0===r.length&&0<l.length)for(s=0;s<l.length;s++)(a=l[parseInt(s.toString(),10)]).previousWidget&&r.push(a.previousWidget);else if(0===l.length&&0<r.length)for(s=0;s<r.length;s++)(a=r[parseInt(s.toString(),10)]).nextWidget&&l.push(a.nextWidget);this.changeWidthOfCells(t,r,l,i),t.tableFormat.allowAutoFit&&t.updateWidth(i)}t.tableFormat.allowAutoFit=!1,this.updateGridValue(t,!0,i)}e.selectPosition(e.start,e.end)}return!1},Lci.prototype.resizeColumnAtStart=function(e,t,i){var n=e.leftIndent,o=i[0].ownerRow,r=o.rowFormat;if(0<r.beforeWidth){var s=r.beforeWidth+t;if(0<s)this.updateGridBefore(o,t);else if(s<(l=this.getLeastGridBefore(e,o))&&0!==s){n=e.leftIndent+s,e.tableFormat.leftIndent=-1440<=n?n<=1440?n:1440:-1440;for(var a=0;a<e.childWidgets.length;a++)o!==(h=e.childWidgets[parseInt(a.toString(),10)])&&this.updateGridBefore(h,-s)}}else if(t<0)n=e.leftIndent+t,e.tableFormat.leftIndent=-1440<=n?n<=1440?n:1440:-1440,this.updateWidthForCells(e,i,t);else{var l=this.getLeastGridBefore(e,o),r=e.tableFormat.leftIndent;if(0===r)for(a=0;a<e.childWidgets.length;a++){var h=e.childWidgets[parseInt(a.toString(),10)];-1!==i.indexOf(h.childWidgets[0])&&(this.updateGridBefore(h,t),this.increaseOrDecreaseWidth(h.childWidgets[0],t,!1))}else if(0<l-t)n=e.leftIndent+t,e.tableFormat.leftIndent=-1440<=n?n<=1440?n:1440:-1440,this.updateWidthForCells(e,i,t);else{n=e.leftIndent+l,e.tableFormat.leftIndent=-1440<=n?n<=1440?n:1440:-1440;for(a=0;a<e.childWidgets.length;a++){h=e.childWidgets[parseInt(a.toString(),10)];-1!==i.indexOf(h.childWidgets[0])?(this.increaseOrDecreaseWidth(h.childWidgets[0],t,!1),this.updateGridBefore(h,t-l)):this.updateGridBefore(h,-l)}}}e.tableFormat.allowAutoFit=!1,this.updateGridValue(e,!0,t)},Lci.prototype.updateWidthForCells=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++){var o=e.childWidgets[parseInt(n.toString(),10)];-1!==t.indexOf(o.childWidgets[0])?this.increaseOrDecreaseWidth(o.childWidgets[0],i,!1):this.updateGridBefore(o,-i)}},Lci.prototype.resizeColumnAtLastColumnIndex=function(e,t,i){for(var n=e.tableFormat.tableAlignment,o=e.tableFormat.preferredWidth,r=this.resizerPosition,s=e.tableHolder.columns[r-1],a=0;t!==a;){var l=Y.round(s.preferredWidth+t,1);l>=s.minimumWidth?(s.preferredWidth=l,a=t):(a=t,t-=l-s.minimumWidth)}this.updateCellPreferredWidths(e),(o||e.tableHolder.getTotalWidth(0)>i)&&(e.tableFormat.allowAutoFit=!1,e.updateWidth(t),e.tableHolder.tableWidth=e.tableHolder.getTotalWidth(0));r=t;"Right"===n?r=0:"Center"===n&&(r/=2),this.updateGridValue(e,!0,r)},Lci.prototype.resizeCellAtMiddle=function(e,t){var i=this.resizerPosition,n=e.tableHolder.columns[i-1],o=e.tableHolder.columns[parseInt(i.toString(),10)];if(0<t)for(var r=!0;r;)(s=Y.round(o.preferredWidth-t,1))>=o.minimumWidth?(o.preferredWidth=s,n.preferredWidth=n.preferredWidth+t,r=!1):t+=s-o.minimumWidth;else for(var s,r=!0;r;)(s=Y.round(n.preferredWidth+t,1))>=n.minimumWidth?(n.preferredWidth=s,o.preferredWidth=o.preferredWidth-t,r=!1):t-=s-n.minimumWidth;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)},Lci.prototype.updateGridValue=function(e,t,i){t&&(e.calculateGrid(),e.isGridUpdated=!1),e.buildTableColumns(),e.isGridUpdated=!0,this.viewer.owner.isLayoutEnabled=!0,e.isInsideTable?(t=this.documentHelper.layout.getParentTable(e),this.documentHelper.layout.reLayoutTable(t)):this.documentHelper.layout.reLayoutTable(e),this.owner.editorModule.getOffsetValue(this.documentHelper.selection),this.owner.editorModule.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.owner.editorModule.reLayout(this.owner.selectionModule),this.owner.editorModule.isSkipOperationsBuild=!1,i&&(this.startingPoint.x+=Y.convertPointToPixel(i))},Lci.prototype.getColumnCells=function(e,t,i){for(var n=[],o=0;o<e.childWidgets.length;o++)for(var r=e.childWidgets[parseInt(o.toString(),10)],s=0;s<r.childWidgets.length;s++){var a=r.childWidgets[parseInt(s.toString(),10)];i?a.columnIndex+a.cellFormat.columnSpan===t&&n.push(a):a.columnIndex===t&&n.push(a)}return n},Lci.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)},Lci.prototype.getLeastGridBefore=function(e,t){for(var i=0,n=0,o=0;o<e.childWidgets.length;o++){var r=e.childWidgets[parseInt(o.toString(),10)];r!==t&&(0===n&&(i=r.rowFormat.beforeWidth,n++),r.rowFormat.beforeWidth<=i)&&(i=r.rowFormat.beforeWidth)}return i},Lci.prototype.increaseOrDecreaseWidth=function(e,t,i){var n=e.cellFormat.preferredWidth,o=("Auto"===e.cellFormat.preferredWidthType&&(n=e.cellFormat.cellWidth,e.cellFormat.preferredWidthType="Point"),e.ownerColumn.minWidth);"Percent"===e.cellFormat.preferredWidthType&&(o=e.convertPointToPercent(o)),e.cellFormat.preferredWidth=i?o<n+t?n+t:o:o<n-t?n-t:o},Lci.prototype.changeWidthOfCells=function(e,t,i,n){if(0<t.length){for(var o=!1,r=0;r<t.length;r++){var s=t[parseInt(r.toString(),10)];this.increaseOrDecreaseWidth(s,n,!0),s.cellIndex===s.ownerRow.childWidgets.length-1&&(o=!0)}o&&this.updateRowsGridAfterWidth(e)}if(0<i.length){for(var a,l=0,r=0;r<i.length;r++)0===(s=i[parseInt(r.toString(),10)]).cellIndex&&(0<=(a=s.ownerRow.rowFormat.beforeWidth+n)?this.updateGridBefore(s.ownerRow,n):(l!==a&&(l=a),s.ownerRow.rowFormat.gridBeforeWidth=0,s.ownerRow.rowFormat.gridBeforeWidthType="Auto")),this.increaseOrDecreaseWidth(s,n,!1);if(0!==l){var h=e.leftIndent+l;e.tableFormat.leftIndent=-1440<=h?h<=1440?h:1440:-1440;for(var d=0;d<e.childWidgets.length;d++){var p=e.childWidgets[parseInt(d.toString(),10)];-1===i.indexOf(p.childWidgets[0])&&this.updateGridBefore(p,0<l?l:-l)}}}},Lci.prototype.updateRowsGridAfterWidth=function(e){for(var t=this.getMaxRowWidth(e,!0),i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[parseInt(i.toString(),10)],o=this.getRowWidth(n,!0);o<=t&&n.rowFormat.afterWidth!==t-o&&(n.rowFormat.gridAfterWidth=o=t-o,n.rowFormat.afterWidth=o)}},Lci.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[parseInt(n.toString(),10)].cellFormat.cellWidth;return i},Lci.prototype.getMaxRowWidth=function(e,t){for(var i=0,n=0;n<e.childWidgets.length;n++){var o=e.childWidgets[parseInt(n.toString(),10)],r=0;t&&(r+=o.rowFormat.beforeWidth);for(var s=0;s<o.childWidgets.length;s++)r+=o.childWidgets[parseInt(s.toString(),10)].cellFormat.cellWidth;i<r&&(i=r)}return i},Lci.prototype.isColumnSelected=function(e,t){for(var i=this.owner.selectionModule.getSelectedCells(),n=this.getColumnCells(e,t,!0),o=this.getColumnCells(e,t,!1),r=!1,s=0;s<n.length;s++)var a=n[parseInt(s.toString(),10)],r=-1!==i.indexOf(a);if(!r)for(s=0;s<o.length;s++){a=o[parseInt(s.toString(),10)];r=-1!==i.indexOf(a)}return r},Lci.prototype.applyProperties=function(e,t){if(!je(t)){t.tableHolder&&(e.tableHolder=t.tableHolder.clone()),null!==t.tableFormat&&(e.tableFormat.leftIndent=t.tableFormat.leftIndent,e.tableFormat.preferredWidth=t.tableFormat.preferredWidth,e.tableFormat.preferredWidthType=t.tableFormat.preferredWidthType,e.tableFormat.allowAutoFit=t.tableFormat.allowAutoFit);for(var i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[parseInt(i.toString(),10)],o=t.rows[parseInt(i.toString(),10)];n.rowFormat.gridBefore=o.gridBefore,n.rowFormat.gridBeforeWidth=o.gridBeforeWidth,n.rowFormat.gridBeforeWidthType=o.gridBeforeWidthType,n.rowFormat.gridAfter=o.gridAfter,n.rowFormat.gridAfterWidth=o.gridAfterWidth,n.rowFormat.gridAfterWidthType=o.gridAfterWidthType;for(var r=0;r<n.childWidgets.length;r++){var s=n.childWidgets[parseInt(r.toString(),10)],a=o.cells[parseInt(r.toString(),10)];s.columnIndex=a.columnIndex,s.cellFormat.columnSpan=a.columnSpan,s.cellFormat.preferredWidth=a.preferredWidth,s.cellFormat.preferredWidthType=a.preferredWidthType}}var l=e.getOwnerWidth(!0),l=e.getTableClientWidth(l);e.setWidthToCells(l,"Auto"===e.tableFormat.preferredWidthType)}},Lci.prototype.getActualWidth=function(e){var t=0;if(0<e.childWidgets.length)for(var i=0;i<e.childWidgets.length;i++)t+=e.childWidgets[parseInt(i.toString(),10)].cellFormat.cellWidth;return t},Lci.prototype.setPreferredWidth=function(e){for(var t=0;t<e.childWidgets.length;t++){var i=e.childWidgets[parseInt(t.toString(),10)],n=i.rowFormat;0<n.gridBefore&&(n.gridBeforeWidth=n.beforeWidth,n.gridBeforeWidthType="Point");for(var o=0;o<i.childWidgets.length;o++){var r=i.childWidgets[parseInt(o.toString(),10)];r.cellFormat.preferredWidth=r.cellFormat.cellWidth,r.cellFormat.preferredWidthType="Point"}0<n.gridAfter&&(n.gridAfterWidth=n.afterWidth,n.gridAfterWidthType="Point")}},Lci.prototype.updateCellPreferredWidths=function(e){for(var t=e.tableHolder.tableWidth,i=0;i<e.childWidgets.length;i++){var n,o=e.childWidgets[parseInt(i.toString(),10)];0<o.rowFormat.gridBefore&&(n=e.tableHolder.getCellWidth(0,o.rowFormat.gridBefore,t),this.updateGridBeforeWidth(n,o));for(var r=0;r<o.childWidgets.length;r++){var s=o.childWidgets[parseInt(r.toString(),10)];s.updateWidth(e.tableHolder.getCellWidth(s.columnIndex,s.cellFormat.columnSpan,t))}0<o.rowFormat.gridAfter&&this.updateGridAfterWidth(e.tableHolder.getCellWidth(o.childWidgets.length,o.rowFormat.gridAfter,t),o)}},Lci.prototype.updateGridBeforeWidth=function(e,t){var i=t.rowFormat;e!==i.beforeWidth&&(i.beforeWidth=e,"Auto"===i.gridBeforeWidthType&&(i.gridBeforeWidthType="Point"),"Point"===i.gridBeforeWidthType?i.gridBeforeWidth=i.beforeWidth:(e=t.ownerTable.getTableClientWidth(t.ownerTable.getOwnerWidth(!0)),t=t.ownerTable.convertPointToPercent(i.beforeWidth,e),i.gridBeforeWidth=t))},Lci.prototype.updateGridAfterWidth=function(e,t){var i=t.rowFormat;e!==i.afterWidth&&(i.afterWidth=e),"Auto"===i.gridAfterWidthType&&(i.gridAfterWidthType="Point"),"Point"===i.gridAfterWidthType?i.gridAfterWidth=i.afterWidth:(e=t.ownerTable.getTableClientWidth(t.ownerTable.getOwnerWidth(!0)),t=t.ownerTable.convertPointToPercent(i.afterWidth,e),i.gridAfterWidth=t)},Lci.prototype.destroy=function(){this.documentHelper=void 0,this.owner=void 0};var Fci=Lci;function Lci(e){this.resizeNode=0,this.resizerPosition=-1,this.currentResizingTable=void 0,this.isResizerEnabled=!1,this.owner=e,this.documentHelper=this.owner.documentHelper,this.startingPoint=new kri(0,0)}var Rci=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},Oci=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Nci=(Object.defineProperty(c.prototype,"restrictFormatting",{get:function(){return this.documentHelper.isDocumentProtected&&(this.documentHelper.restrictFormatting||!this.documentHelper.restrictFormatting&&!this.selection.isSelectionInEditRegion())&&"RevisionsOnly"!==this.documentHelper.protectionType},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"restrictEditing",{get:function(){return this.documentHelper.isDocumentProtected&&(("ReadOnly"===this.documentHelper.protectionType||this.documentHelper.isCommentOnlyMode)&&!this.selection.isSelectionInEditRegion()||"FormFieldsOnly"===this.documentHelper.protectionType)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"canEditContentControl",{get:function(){var e=this.selection.currentContentControl;if(je(e)){if(this.selection.checkContentControlLocked())return!1}else if(e.contentControlProperties.lockContents||"DropDownList"===e.contentControlProperties.type)return!1;return!this.owner.isReadOnly},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"viewer",{get:function(){if(!je(this.owner))return this.owner.viewer},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"editorHistory",{get:function(){return this.documentHelper.owner.editorHistoryModule},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"selection",{get:function(){if(this.documentHelper)return this.documentHelper.selection},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"owner",{get:function(){if(this.documentHelper)return this.documentHelper.owner},enumerable:!0,configurable:!0}),c.prototype.getModuleName=function(){return"Editor"},c.prototype.beginBatchEdit=function(){this.restrictLayout=!0},c.prototype.endBatchEdit=function(){this.restrictLayout=!1,this.layoutWholeDocument()},c.prototype.setFieldInfo=function(e){je(this.selection.getHyperlinkField(!0))||(this.selection.selectField(),this.insertField(e.code,e.result))},c.prototype.insertField=function(e,t){this.isInsertField=!0;var i,n,o,r,s=e;"NUMPAGES"===(s=Y.trimStart(s)).substring(0,8)?this.insertPageCount(t):"PAGE"===s.substring(0,4)?this.insertPageNumber(t):(je(t)&&"MERGEFIELD"===s.substring(0,10)&&(i=(s=s.substring(10).trim()).indexOf("\\*"),t="«"+s.substring(0,i).trim()+"»"),s=new Lai,i=new Eri,n=this.selection.start.paragraph,this.selection.isForward||(n=this.selection.end.paragraph),o=this.selection.start.currentWidget.getInline(this.selection.start.offset,0),i=n.isEmpty()?n.characterFormat:je(o.element)?this.copyInsertFormat(i,!1):o.element.characterFormat,n=new Gai(s),(o=new Zai(0)).characterFormat.assignFormat(i),n.children.push(o),(r=new pli).characterFormat.assignFormat(i),r.text=e,n.children.push(r),(e=new Zai(2)).characterFormat.assignFormat(i),(e.fieldBegin=o).fieldSeparator=e,n.children.push(e),(r=new pli).text=t,r.characterFormat.assignFormat(i),!this.documentHelper.textHelper.isRTLText(t)&&r.characterFormat.bidi&&(r.characterFormat.bidi=!1),n.children.push(r),(t=new Zai(1)).characterFormat.assignFormat(i),t.fieldSeparator=e,(t.fieldBegin=o).fieldEnd=t,e.fieldEnd=t,n.children.push(t),o.line=n,s.childWidgets.push(n),this.documentHelper.fields.push(o),(r=new Sai).sectionFormat=new ari(r),r.childWidgets.push(s),this.pasteContentsInternal([r],!1)),this.isInsertField=!1},c.prototype.isLinkedStyle=function(e){return!je(this.documentHelper.styles.findByName(e).link)},c.prototype.applyStyle=function(e,t){t=!je(t)&&t;var i,n,o=void 0,r=void 0,s=this.documentHelper.styles.findByName(e);t&&(this.initComplexHistory("ApplyStyle"),this.setOffsetValue(this.selection),o=this.startOffset,r=this.endOffset,t=this.selection.isEmpty,this.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,!je(s)&&s instanceof jri&&"Character"===s.type?this.clearFormattingInternal(!1,!0):this.clearFormattingInternal(!0,!0),this.isSkipOperationsBuild=!1,t)&&!this.selection.isEmpty&&this.selection.end.setPositionInternal(this.selection.start),void 0!==s?s instanceof jri&&"Character"===s.type?this.selection.isEmpty&&(t=this.selection.start.offset,i=this.selection.start.clone(),n=this.selection.end.clone(),this.selection.selectCurrentWord(),t===this.selection.start.offset||t===this.selection.end.offset-1)?(this.selection.start=i,this.selection.end=n,this.selection.characterFormat.copyFormat(s.characterFormat)):this.onApplyCharacterFormat("styleName",s,!1,!0):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=o,this.endOffset=r,this.editorHistory.updateComplexHistory()),this.startParagraph=void 0,this.endParagraph=void 0},c.prototype.cut=function(){var e,t;this.owner.isReadOnlyMode||this.selection.isEmpty||!this.canEditContentControl||(e=this.selection.start,t=this.selection.end,e=0===e.offset?this.selection.getElementInfo(e.currentWidget,e.offset-1):this.selection.getElementInfo(e.currentWidget,this.selection.isForward?e.offset:e.offset+1),t=0===t.offset?this.selection.getElementInfo(t.currentWidget,t.offset-1):this.selection.getElementInfo(t.currentWidget,this.selection.isForward?t.offset+1:t.offset),!je(e)&&!je(t)&&e.element&&t.element&&-1!==e.index&&-1!==t.index&&e.element instanceof Dli&&t.element instanceof Dli&&e.element.name===t.element.name&&!(!je(e.element.nextElement)&&!je(t.element.previousElement)&&e.element.nextElement instanceof Zai&&t.element.previousElement instanceof Zai)&&(this.selection.isForward?(this.selection.start.setPositionParagraph(e.element.line,e.element.line.getOffset(e.element,0)),this.selection.end.setPositionParagraph(t.element.line,t.element.line.getOffset(t.element,1))):(this.selection.start.setPositionParagraph(e.element.line,e.element.line.getOffset(e.element,1)),this.selection.end.setPositionParagraph(t.element.line,t.element.line.getOffset(t.element,0)))),this.selection.copySelectedContent(!0),this.documentHelper.owner.parser.isCutPerformed=!0)},c.prototype.insertEditingRegion=function(e){this.insertEditRangeElement(e&&""!==e?e:"Everyone")},c.prototype.enforceProtection=function(e,t,i){var n,o;"boolean"==typeof t?(n=i?"ReadOnly":this.documentHelper.protectionType,o=t):n=t,je(o)||(this.documentHelper.restrictFormatting=o),this.documentHelper.protectionType=n,this.selection.isHighlightEditRegion=!0,this.addProtection(e,this.documentHelper.protectionType,!1)},c.prototype.enforceProtectionAsync=function(n,o,r){return Rci(this,void 0,void 0,function(){var t,i;return Oci(this,function(e){switch(e.label){case 0:return"boolean"==typeof o?(t=r?"ReadOnly":this.documentHelper.protectionType,i=o):(i=!0,t=o),this.documentHelper.restrictFormatting=i,this.documentHelper.protectionType=t,this.selection.isHighlightEditRegion=!0,[4,this.addProtection(n,this.documentHelper.protectionType,!0)];case 1:return e.sent(),[2]}})})},c.prototype.getCommentHierarchicalIndex=function(e){for(var t="";e.ownerComment;)je(e.ownerComment)?t=e.replyComments.indexOf(e)+";"+t:(t=e.ownerComment.replyComments.indexOf(e)+";"+t,e=e.ownerComment);return t="C;"+this.documentHelper.comments.indexOf(e)+";"+t},c.prototype.alertBox=function(){var e=new Cn("documenteditor",this.owner.defaultLocale);e.setLocale(this.owner.locale),WC.alert({title:e.getConstant("Information"),content:e.getConstant("Multiple Comment")})},c.prototype.insertReplyComment=function(e,t,i){var n,o=this.getCommentInfo(t),i={author:i.author||"Guest user",initial:this.constructCommentInitial(i.author||"Guest user"),text:je(o.innerText)?go.sanitize(t):go.sanitize(o.innerText),commentId:Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),done:!1,date:i.dateTime?Y.getUtcDate(i.dateTime):Y.getUtcDate()};if(0<this.documentHelper.comments.length)for(var r=0;r<this.documentHelper.comments.length;r++)if(this.documentHelper.comments[r].commentId===e){n=this.documentHelper.comments[r];break}this.replyComment(n,je(o.innerText)?t:o.innerText,o.itemData,i);o={author:i.author,isResolved:i.done,dateTime:this.parseDateTime(i.date)};return new cJt(i.commentId,o,t)},c.prototype.getCommentInfo=function(e){for(var t,i=[],n=[],o=/<a href="mailto:([^"]+)">([^<]+)<\/a>/g,r=0;null!==(t=o.exec(e));)t.index>r&&n.push({text:e.substring(r,t.index)}),n.push({mailto:t[1],text:t[2]}),r=o.lastIndex;r<e.length&&n.push({text:e.substring(r)});var s="";if(0<n.length)for(var a=0;a<n.length;a++)n[a].mailto?(i.push({text:n[a].text.replace("@",""),value:n[a].mailto}),s+='<span contenteditable="false" class="e-mention-chip">'+n[a].text.replace("@","")+"</span>"):n[a].text&&(s+=n[a].text.replace(/(\r\n|\n\r|\n|\r)/g,"<br>"));else""!==e&&(s=e.replace(/(\r\n|\n\r|\n|\r)/g,"<br>"));return{itemData:i,innerText:s}},c.prototype.insertComment=function(e,t){if(!(je(this.selection.start)||this.owner.isReadOnlyMode&&!this.documentHelper.isCommentOnlyMode||this.viewer.owner.enableHeaderAndFooter||!this.viewer.owner.enableComment||this.selection.isPlainContentControl())){if(this.viewer.owner.commentReviewPane.commentPane.isEditMode)return this.alertBox();je(e)&&(e="");var i={},n=this.getCommentInfo(e),o=(i=je(t)?{author:this.owner.currentUser?go.sanitize(this.owner.currentUser):"Guest user",initial:this.constructCommentInitial(this.owner.currentUser?go.sanitize(this.owner.currentUser):"Guest user"),text:go.sanitize(e),commentId:Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),done:!1,date:Y.getUtcDate()}:{author:o=je(t.author)?this.owner.currentUser:t.author,initial:this.constructCommentInitial(o),text:go.sanitize(""===n.innerText?e:n.innerText),commentId:Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),done:t.isResolved||!1,date:t.dateTime?Y.getUtcDate(t.dateTime):Y.getUtcDate()},this.insertCommentInternal(je(n.innerText)?"":n.innerText,i,n.itemData),{author:i.author,isResolved:i.done,dateTime:this.parseDateTime(i.date)});return new cJt(i.commentId,o,e)}},c.prototype.parseDateTime=function(e){e=new Date(e);return new Date(e.getTime()+6e4*e.getTimezoneOffset())},c.prototype.insertCommentInternal=function(e,t,i){this.documentHelper.layout.allowLayout=!1,this.selection.isEmpty&&(this.selection.start.isAtSamePosition(this.selection.end)&&this.selection.start.isAtParagraphEnd&&(n=this.selection.start.offset,this.selection.start.offset=n-1!=-1?n-1:n),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;var n=this.selection.getParagraphInfo(this.selection.start),n=this.selection.getHierarchicalIndex(n.paragraph,n.offset.toString()),o=this.selection.start,r=this.selection.end,s=new rci(this.owner),a=(this.selection.isForward||(o=this.selection.end,r=this.selection.start),s.setPositionInternal(o),this.initComplexHistory("InsertComment"),new Khi(0)),l=new Khi(1),n=(o.setPositionInternal(r),this.initInsertInline(l),!je(s.paragraph)&&-1!==s.currentWidget.indexInOwner||(n=this.selection.getTextPosBasedOnLogicalIndex(n),s.setPositionInternal(n)),o.setPositionInternal(s),r.setPositionInternal(s),this.initInsertInline(a),new $hi(t.date));i&&0<i.length&&(n.mentions=i),this.owner.editorHistoryModule&&(this.initHistory("InsertCommentWidget"),this.owner.editorHistoryModule.currentBaseHistoryInfo.insertedText=pJt.Marker_Start+pJt.Marker_End,this.owner.editorHistoryModule.currentBaseHistoryInfo.removedNodes.push(n)),this.updateCommentElement(n,a,l,t),this.addCommentWidget(n,!0,!0,!0),this.owner.isSpellCheck&&a.previousElement&&a.previousElement instanceof pli&&(a.previousElement.ischangeDetected=!0),this.owner.isSpellCheck&&l.previousElement&&l.previousElement instanceof pli&&a.line!==l.line&&(l.previousElement.ischangeDetected=!0),this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo.insertPosition=this.getCommentHierarchicalIndex(n),this.editorHistory.updateHistory()),this.editorHistory&&this.editorHistory.updateComplexHistory(),this.reLayout(this.selection,!1),this.documentHelper.layout.allowLayout=!0,this.isUserInsert||(o=this.owner.commentReviewPane.commentPane.comments.get(n),i&&0<i.length&&(o.itemData=i),o.postComment())},c.prototype.updateCommentElement=function(e,t,i,n){return e.author=n.author,e.initial=n.initial,e.text=n.text,e.commentId=n.commentId,je(n.done)||(e.isResolved=n.done),je(n.isReply)||(e.isReply=n.isReply),je(t)||je(i)||(t.comment=e,t.commentId=e.commentId,i.comment=e,i.commentId=e.commentId,e.commentStart=t,e.commentEnd=i),e},c.prototype.deleteAllComments=function(){if(0!==this.documentHelper.comments.length){var e;for(this.initComplexHistory("DeleteAllComments"),this.owner.isLayoutEnabled=!1,this.editorHistory&&this.editorHistory.currentHistoryInfo&&(e=this.editorHistory.currentHistoryInfo);0<this.documentHelper.comments.length;){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())}},c.prototype.deleteComment=function(e){var t;if(!(this.owner.isReadOnlyMode&&!this.documentHelper.isCommentOnlyMode||je(this.owner)||je(this.owner.viewer)||je(this.owner.documentHelper.currentSelectedComment)&&je(e)||this.owner.enableHeaderAndFooter)&&this.viewer.owner.enableComment)if(je(e))this.deleteCommentInternal(this.owner.documentHelper.currentSelectedComment);else{var i;if(0<this.documentHelper.comments.length)for(var n=0;n<this.documentHelper.comments.length;n++){if((i=this.documentHelper.comments[n]).commentId===e){t=this.documentHelper.comments[n];break}if(i.replyComments&&0<i.replyComments.length)for(var o=0;o<i.replyComments.length;o++)if(i.replyComments[o].commentId===e){t=i.replyComments[o];break}}if(je(t))throw new Error("Enter a valid comment id.");this.deleteCommentInternal(t)}},c.prototype.deleteCommentInternal=function(e){if(this.initComplexHistory("DeleteComment"),e){if(0<e.replyComments.length)for(var t=e.replyComments.length-1;0<=t;t--)this.deleteCommentInternal(e.replyComments[t]);this.deleteCommentWidgetInternal(e);var i=e.commentStart,n=e.commentEnd;-1!==n.indexInOwner&&this.removeInline(n),-1!==i.indexInOwner&&this.removeInline(i),i.removeCommentMark()}this.editorHistory&&this.editorHistory.updateComplexHistory()},c.prototype.deleteCommentWidgetInternal=function(e){this.owner.editorHistoryModule&&(this.initHistory("DeleteCommentWidget"),this.owner.editorHistoryModule.currentBaseHistoryInfo.insertPosition=this.getCommentHierarchicalIndex(e),this.owner.editorHistoryModule.currentBaseHistoryInfo.removedNodes.push(e)),this.deleteCommentWidget(e),this.editorHistory&&this.editorHistory.updateHistory()},c.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)},c.prototype.resolveComment=function(e){var t;this.owner.isReadOnlyMode&&!this.documentHelper.isCommentOnlyMode||(t={author:e.author,cancel:!1,type:"Resolve"},this.owner.trigger(VJt,t),t.cancel&&"Resolve"===t.type)||(this.initHistory("ResolveComment"),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.editorHistory.currentBaseHistoryInfo.removedNodes.push(e),this.resolveOrReopenComment(e,!0))},c.prototype.reopenComment=function(e){var t;this.owner.isReadOnlyMode&&!this.documentHelper.isCommentOnlyMode||(t={author:e.author,cancel:!1,type:"Reopen"},this.owner.trigger(VJt,t),t.cancel&&"Reopen"===t.type)||(this.initHistory("ResolveComment"),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.editorHistory.currentBaseHistoryInfo.removedNodes.push(e),this.resolveOrReopenComment(e,!1))},c.prototype.resolveOrReopenComment=function(e,t){e.isResolved=t;for(var i=0;i<e.replyComments.length;i++)e.replyComments[i].isResolved=t;this.owner.commentReviewPane&&(t?this.owner.commentReviewPane.resolveComment(e):this.owner.commentReviewPane.reopenComment(e)),this.reLayout(this.selection,!1,!1)},c.prototype.replyComment=function(e,t,i,n){var o,r,s,a,l;this.owner.isReadOnlyMode&&!this.documentHelper.isCommentOnlyMode||(e=e)&&(o=void 0,n?((o=new $hi(n.date)).author=n.author,o.text=t,o.mentions=i||[],o.commentId=n.commentId):((o=new $hi(Y.getUtcDate())).author=this.owner.currentUser?go.sanitize(this.owner.currentUser):"Guest user",o.text=t||"",o.mentions=i||[],o.commentId=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)),o.isReply=!0,n={author:o.author,cancel:!1,type:"Post",text:o.text,mentions:o.mentions},this.owner.trigger(VJt,n),n.cancel&&"Post"===n.type||(this.initComplexHistory("InsertComment"),t=e.commentStart,i=e.commentEnd,n=e.replyComments.length,s=t.line.getOffset(t,n+1),(r=new rci(this.documentHelper.owner)).setPositionParagraph(t.line,s),t=i.line.getOffset(i,n+1),(s=new rci(this.documentHelper.owner)).setPositionParagraph(i.line,t),this.selection.start.setPositionInternal(r),this.selection.end.setPositionInternal(s),r=this.selection.start,s=this.selection.end,(n=new rci(this.owner)).setPositionInternal(s),i=new Khi(0),t=new Khi(1),a=r.currentWidget===s.currentWidget,s.setPositionInternal(r),l=n.currentWidget.indexInOwner,this.initInsertInline(i),-1===n.currentWidget.indexInOwner&&(n.currentWidget=n.currentWidget.paragraph.childWidgets[l]),a&&n.setPositionParagraph(n.currentWidget,n.offset+i.length),r.setPositionInternal(n),s.setPositionInternal(n),this.initInsertInline(t),e.replyComments.push(o),o.ownerComment=e,this.owner.editorHistoryModule&&(this.initHistory("InsertCommentWidget"),this.owner.editorHistoryModule.currentBaseHistoryInfo.removedNodes.push(o),this.owner.editorHistoryModule.currentBaseHistoryInfo.insertedText=pJt.Marker_Start+pJt.Marker_End),i.comment=o,i.commentId=o.commentId,t.comment=o,t.commentId=o.commentId,o.commentStart=i,o.commentEnd=t,this.owner.commentReviewPane&&this.owner.commentReviewPane.addReply(o,!1,!0),this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo.insertPosition=this.getCommentHierarchicalIndex(o),this.editorHistory.updateHistory()),this.editorHistory&&this.editorHistory.updateComplexHistory(),this.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.reLayout(this.selection),this.isSkipOperationsBuild=!1))},c.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()},c.prototype.addCommentWidget=function(e,t,i,n){if(-1===this.documentHelper.comments.indexOf(e)){var o=!1;if(0<this.documentHelper.comments.length)for(var r=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(r.isExistBefore(a)){o=!0,this.documentHelper.comments.splice(s,0,e);break}}o||this.documentHelper.comments.push(e),this.owner.commentReviewPane&&(this.owner.showComments=i,this.owner.commentReviewPane.selectedTab=0,this.owner.commentReviewPane.addComment(e,t,n),this.owner.commentReviewPane.reviewTab.selectedItem=0,n)&&this.owner.selectionModule.selectComment(e)}},c.prototype.addReplyComment=function(e,t){var t=t.split(";"),i=this.documentHelper.comments[parseInt(t[1],10)];""!==t[2]&&(i.replyComments.splice(parseInt(t[2],10),0,e),e.ownerComment=i),this.owner.commentReviewPane&&(this.owner.showComments=!0,this.owner.commentReviewPane.addReply(e,!1,!0),this.owner.selectionModule.selectComment(e))},c.prototype.addProtection=function(s,a,l){return Rci(this,void 0,void 0,function(){var r=this;return Oci(this,function(e){return[2,new Promise(function(t,i){var e,n,o;l=!!je(l)||l,""===s?(r.protectDocument(a),t()):(r.currentProtectionType=a,e=new vJt,n={passwordBase64:r.base64.encodeString(s),saltBase64:"",spinCount:1e5},o=r.owner.serviceUrl+r.owner.serverActionSettings.restrictEditing,e.url=o,e.contentType="application/json;charset=UTF-8",e.onSuccess=function(e){r.enforceProtectionInternal(e),t()},e.onFailure=function(e){r.protectionFailureHandler(e),i()},e.onError=function(e){r.protectionFailureHandler(e),i()},e.customHeaders=r.owner.headers,o={serverActionType:"RestrictEditing",headers:r.owner.headers,timeout:0,cancel:!1,withCredentials:!1},r.owner.trigger(XJt,o),o.cancel?r.documentHelper.dialog.visible&&r.documentHelper.dialog.hide():e.send(n,o,l))})]})})},c.prototype.protectionFailureHandler=function(e){var t;this.owner&&((t=new Cn("documenteditor",this.owner.defaultLocale)).setLocale(this.documentHelper.owner.locale),"onError"===e.name?WC.alert(t.getConstant("Error in establishing connection with web server")):(this.owner.fireServiceFailure(e),console.error(e.statusText)))},c.prototype.enforceProtectionInternal=function(e){e=JSON.parse(e.data);this.enforceProtectionAssign(e[0],e[1],this.currentProtectionType),this.owner.showHideRulers()},c.prototype.enforceProtectionAssign=function(e,t,i){this.documentHelper&&(this.documentHelper.saltValue=e,this.documentHelper.hashValue=t,this.protectDocument(i))},c.prototype.toggleTrackChangesProtection=function(e){this.viewer.owner.enableTrackChanges=e,this.owner.trigger(QJt,{isTrackChangesEnabled:e})},c.prototype.protectDocument=function(e){this.documentHelper.owner.getSettingData("protection",null,this.documentHelper.hashValue,this.documentHelper.saltValue,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.visible)&&this.documentHelper.dialog.hide(),this.owner.notify(KJt,{}),"RevisionsOnly"===e&&this.toggleTrackChangesProtection(!0),this.owner.trackChangesPane.enableDisableButton(!1),this.documentHelper.owner.enableCollaborativeEditing||this.fireContentChange()},c.prototype.stopProtection=function(e){var t,i;this.documentHelper.isDocumentProtected&&(je(this.documentHelper.saltValue)||""!==this.documentHelper.saltValue||je(this.documentHelper.hashValue)||""!==this.documentHelper.hashValue||je(e)||""!==e?(t=new vJt,e={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),i={serverActionType:"RestrictEditing",headers:this.owner.headers,timeout:0,cancel:!1,withCredentials:!1},this.owner.trigger(XJt,i),i.cancel?this.documentHelper.dialog.visible&&this.documentHelper.dialog.hide():t.send(e,i,!1),this.owner.enableTrackChanges||this.toggleTrackChangesProtection(!1)):this.unProtectDocument())},c.prototype.stopProtectionAsync=function(s){return Rci(this,void 0,void 0,function(){var r=this;return Oci(this,function(e){return[2,new Promise(function(t,i){var e,n,o;r.documentHelper.isDocumentProtected&&(je(r.documentHelper.saltValue)||""!==r.documentHelper.saltValue||je(r.documentHelper.hashValue)||""!==r.documentHelper.hashValue||je(s)||""!==s?(e=new vJt,n={passwordBase64:r.base64.encodeString(s),saltBase64:r.documentHelper.saltValue,spinCount:1e5},e.url=r.owner.serviceUrl+r.owner.serverActionSettings.restrictEditing,e.contentType="application/json;charset=UTF-8",e.customHeaders=r.owner.headers,e.onSuccess=function(e){(r.onUnProtectionSuccess(e)?t:i)()},e.onFailure=function(e){r.protectionFailureHandler(e),i()},e.onError=function(e){r.protectionFailureHandler(e),i()},o={serverActionType:"RestrictEditing",headers:r.owner.headers,timeout:0,cancel:!1,withCredentials:!1},r.owner.trigger(XJt,o),o.cancel?r.documentHelper.dialog.visible&&r.documentHelper.dialog.hide():e.send(n,o),r.owner.enableTrackChanges||r.toggleTrackChangesProtection(!1)):(r.unProtectDocument(),t()))})]})})},c.prototype.onUnProtectionSuccess=function(e){e=JSON.parse(e.data),e=this.validateHashValue(e[1]);return this.owner.showHideRulers(),e},c.prototype.validateHashValue=function(e){this.currentHashValue=e;var t=new Cn("documenteditor",this.owner.defaultLocale),i=(t.setLocale(this.documentHelper.owner.locale),this.base64.decodeString(e)),e=this.documentHelper.hashValue,n=this.base64.decodeString(e),o=!0;if(i.length===n.length){for(var r=0;r<i.length;r++)if(i[r]!==n[r]){o=!1;break}}else o=!1;return o?(this.unProtectDocument(),!0):(WC.alert(t.getConstant("The password is incorrect")),!1)},c.prototype.unProtectDocument=function(){this.documentHelper.owner.getSettingData("protection",!1,this.currentHashValue),this.currentHashValue=null;var e=this.documentHelper.protectionType,t=(this.documentHelper.isDocumentProtected=!1,this.documentHelper.restrictFormatting=!1,this.documentHelper.protectionType="NoProtection",this.documentHelper.saltValue="",this.documentHelper.hashValue="",this.documentHelper.selection.highlightEditRegion(),this.documentHelper.restrictEditingPane.restrictPane);t&&"block"===t.style.display&&this.documentHelper.restrictEditingPane.showStopProtectionPane(!1),"RevisionsOnly"!==e||this.owner.enableTrackChanges||this.toggleTrackChangesProtection(!1),this.owner.trackChangesPane.enableDisableButton(!0),je(this.editorHistory)||this.owner.editorHistoryModule.clearHistory(),this.owner.notify(KJt,{}),this.documentHelper.dialog.visible&&this.documentHelper.dialog.hide(),this.owner.showHideRulers(),this.documentHelper.owner.enableCollaborativeEditing||this.fireContentChange()},c.prototype.fireContentChange=function(){this.owner.documentHelper.render.commentMarkDictionary.clear(),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.editorModule.isUserInsert||this.documentHelper.owner.isShiftingEnabled||this.isSkipOperationsBuild||this.isRemoteAction||this.documentHelper.owner.fireContentChange(),!je(this.owner.optionsPaneModule)&&this.owner.optionsPaneModule.isOptionsPaneShow&&!this.owner.optionsPaneModule.isUpdateHeading&&"BodyText"!==this.selection.paragraphFormat.outlineLevel&&this.owner.optionsPaneModule.isHeadingTab&&this.owner.optionsPaneModule.updateHeadingTab(),this.owner.isSpellCheck&&!je(this.selection.editPosition)&&(this.triggerPageSpellCheck=!1)},c.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)},c.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)},c.prototype.getPrefixAndSuffix=function(){var e=this.owner.documentHelper;if(""!==this.selection.text)e.prefix="";else{var t=this.selection.start.currentWidget.getInline(this.selection.start.offset,0),i=t.element;if(o=t.index,void 0!==i){var n=(t=this.selection.getElementBoxInternal(i,o)).element,o=t.index,r=0;if(!je(n)){var s=!1;for(n instanceof pli&&0<o&&n.line.isFirstLine()&&(e.prefix=""),i instanceof pli||(i=this.selection.getPreviousTextElement(i));(r=e.prefix.lastIndexOf(" "))<0&&i instanceof pli;)if(i.previousNode instanceof pli&&-1===e.prefix.indexOf(" ")){if(s?e.prefix=i.text+e.prefix:(e.prefix=i.text.substring(0,o),s=!0),(i=i.previousNode)instanceof lhi)break;i instanceof pli||(i=this.selection.getPreviousTextElement(i))}else if(!(i.previousNode instanceof pli)){s?e.prefix=i.text+e.prefix:(e.prefix=i.text.substring(0,o),s=!0);break}1<e.prefix.length&&" "===e.prefix[e.prefix.length-1]&&"."===e.prefix[e.prefix.length-2]?(r=-1,e.prefix=""):r=e.prefix.lastIndexOf(" "),e.prefix=r<0?e.prefix:e.prefix.substring(r),0===e.prefix.indexOf(" ")&&1<=e.prefix.length&&(e.prefix=e.prefix.substring(1));var a=this.selection.end.currentWidget.getInline(this.selection.end.offset,0),l=a.element,h=a.index,n=(t=this.selection.getElementBoxInternal(l,h)).element;if(h=t.index,n){var d=!1;for(n instanceof pli&&h<n.length&&(e.suffix="");(r=e.suffix.indexOf(" "))<0&&l instanceof pli;)if(l.nextNode instanceof pli&&-1===e.suffix.indexOf(" "))d?e.suffix=e.suffix+l.text:(e.suffix=n.text.substring(h),d=!0),l=l.nextNode;else if(!(l.nextNode instanceof pli)){d?e.suffix=e.suffix+l.text:(e.suffix=n.text.substring(h),d=!0);break}r=e.suffix.indexOf(" "),e.suffix=r<0?e.suffix:e.suffix.substring(0,r)}}}}},c.prototype.onKeyDownInternal=function(e,t,i,n){var o,r=e.which||e.keyCode;if(this.owner.focusIn(),!t||i||n)if(!i||t||n)if(i&&t&&!n)switch(r){case 13:this.owner.isReadOnlyMode||(e.preventDefault(),this.insertColumnBreak());break;case 68:this.owner.isReadOnlyMode||this.owner.selectionModule.toggleUnderline("Double");break;case 77:this.owner.isReadOnlyMode||this.owner.selectionModule.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:e.preventDefault(),this.owner.isReadOnlyMode||(o={isTrackChangesEnabled:!this.owner.enableTrackChanges},this.owner.trigger(QJt,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:this.owner.acceptTab?(e.preventDefault(),this.selection.handleTabKey(!0,!1)):this.documentHelper.editableDiv.blur();break;case 13:e.preventDefault(),this.owner.isSpellCheck&&(this.documentHelper.triggerSpellCheck=!0),this.handleEnterKey(),this.owner.isSpellCheck&&(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:this.owner.acceptTab?(e.preventDefault(),this.selection.handleTabKey(!1,!0)):this.documentHelper.editableDiv.blur();break;case 13:this.handleShiftEnter(),e.preventDefault();break;case 114:e.preventDefault(),this.changeCase(this.toggleChangeCase())}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();var a=0,l=this.documentHelper.selection.start.paragraph.paragraphFormat.beforeSpacing;12<l?a=12:0<l&&l<=12?a=0:0===l&&(a=12),this.onApplyParagraphFormat("beforeSpacing",a,!0,!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.documentEditorSettings.showNavigationPane=!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.selectionModule.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.selectionModule.toggleUnderline("Single");break;case 88:e.preventDefault(),this.owner.isReadOnlyMode||this.owner.editorModule.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")}},c.prototype.handleShiftEnter=function(){this.owner.isReadOnlyMode||this.handleTextInput("\v"),this.selection.checkForCursorVisibility()},c.prototype.handleBackKey=function(){(!this.owner.isReadOnlyMode&&this.canEditContentControl||"FormFieldsOnly"===this.documentHelper.protectionType&&this.canEditContentControl&&!je(this.documentHelper.selection)&&this.documentHelper.selection.checkContentControlLocked()||this.selection.isInlineFormFillMode())&&this.owner.editorModule.onBackSpace(),this.selection.checkForCursorVisibility()},c.prototype.handleDelete=function(){(!this.owner.isReadOnlyMode&&this.canEditContentControl||"FormFieldsOnly"===this.documentHelper.protectionType&&this.canEditContentControl&&!je(this.documentHelper.selection)&&this.documentHelper.selection.checkContentControlLocked()||this.selection.isInlineFormFillMode())&&this.owner.editorModule.delete(),this.selection.checkForCursorVisibility()},c.prototype.handleEnterKey=function(){var e=this.documentHelper.owner.selection.currentContentControl;(!this.owner.isReadOnlyMode&&!this.documentHelper.selection.checkContentControlLocked()||this.selection.isInlineFormFillMode()||("FormFieldsOnly"===this.documentHelper.protectionType||"NoProtection"==this.documentHelper.protectionType)&&e.contentControlProperties.multiline&&!je(this.documentHelper.selection)&&this.documentHelper.selection.checkContentControlLocked()||!je(e)&&"RichText"===e.contentControlProperties.type&&this.canEditContentControl&&("Block"===e.contentControlWidgetType||"Cell"===e.contentControlWidgetType))&&(F.isDevice&&(this.documentHelper.isCompositionStart=!1),this.owner.editorModule.onEnter()),this.selection.checkForCursorVisibility()},c.prototype.handleCtrlBackKey=function(){var e=this.selection.start,t=this.selection.end;this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||(this.selection.isForward||(e=t),this.selection.isEmpty?(this.selection.handleControlShiftLeftKey(),this.owner.editorModule.onBackSpace()):(je(e.paragraph.previousRenderedWidget)||e.paragraph.previousRenderedWidget instanceof _ai)&&0===e.offset||(this.selection.handleLeftKey(),this.selection.handleControlShiftLeftKey(),this.owner.editorModule.onBackSpace()))},c.prototype.handleCtrlDelete=function(){var e;(!this.owner.isReadOnlyMode&&this.canEditContentControl||this.selection.isInlineFormFillMode())&&(this.selection.isEmpty?this.selection.handleControlShiftRightKey():(this.selection.handleLeftKey(),this.selection.handleControlShiftRightKey(),e=this.selection.text,Y.endsWith(e)&&this.selection.handleShiftLeftKey()),this.owner.editorModule.delete())},c.prototype.handleTextInput=function(e){var t=this;(!this.owner.isReadOnlyMode&&this.canEditContentControl||"FormFieldsOnly"===this.documentHelper.protectionType&&this.canEditContentControl&&!je(this.documentHelper.selection)&&this.documentHelper.selection.checkContentControlLocked()||this.selection.isInlineFormFillMode())&&(this.animationTimer&&clearTimeout(this.animationTimer),mt(this.selection.caret,[],["e-de-cursor-animation"]),this.handledTextInput=!0,this.owner.editorModule.insertText(e),this.handledTextInput=!1,this.animationTimer=Number(setTimeout(function(){t.animationTimer&&clearTimeout(t.animationTimer),t.selection&&t.selection.caret&&mt(t.selection.caret,["e-de-cursor-animation"],[])},600))),this.selection.checkForCursorVisibility()},c.prototype.copyInsertFormat=function(e,t,i){var i=i?new Eri(i):new Eri,n=this.selection.characterFormat;return t&&i.copyFormat(e),je(n.bidi)||e.bidi===n.bidi||(i.bidi=n.bidi),je(n.bold)||e.bold===n.bold||(i.bold=n.bold),je(n.italic)||e.italic===n.italic||(i.italic=n.italic),0<n.fontSize&&e.fontSize!==n.fontSize&&(i.fontSize=n.fontSize),je(n.fontFamily)||e.fontFamily===n.fontFamily||(i.fontFamily=n.fontFamily),je(n.highlightColor)||e.highlightColor===n.highlightColor||(i.highlightColor=n.highlightColor),je(n.baselineAlignment)||e.baselineAlignment===n.baselineAlignment||(i.baselineAlignment=n.baselineAlignment),je(n.fontColor)||e.fontColor===n.fontColor||(i.fontColor=n.fontColor),je(n.underline)||e.underline===n.underline||(i.underline=n.underline),je(n.strikethrough)||e.strikethrough===n.strikethrough||(i.strikethrough=n.strikethrough),je(n.boldBidi)||e.boldBidi===n.boldBidi||(i.boldBidi=n.boldBidi),je(n.italicBidi)||e.italicBidi===n.italicBidi||(i.italicBidi=n.italicBidi),0<n.fontSizeBidi&&e.fontSizeBidi!==n.fontSizeBidi&&(i.fontSizeBidi=n.fontSizeBidi),i},c.prototype.getResultContentControlText=function(e){for(var t=e.nextNode,i="";!(t instanceof Pli||(t instanceof pli&&(i+=t.text),je(t)));)if(je(t.nextNode)){if(!t.paragraph.nextRenderedWidget)break;t=t.paragraph.nextRenderedWidget.firstChild.children[0]}else t=t.nextNode;return i},c.prototype.insertContentControlPlaceholder=function(){var e,t,i=this.owner.selection.currentContentControl;!je(i)&&i.nextElement instanceof Pli&&i.nextElement===i.reference&&(e=new pli,(t=new Cn("documenteditor",this.owner.defaultLocale)).setLocale(this.owner.locale),e.text=t.getConstant("Default Content Control Text"),"ComboBox"!==i.contentControlProperties.type&&"DropDownList"!==i.contentControlProperties.type||(e.text=t.getConstant("Choose an item")),"Date"===i.contentControlProperties.type&&(e.text=t.getConstant("Default Date Picker")),e.characterFormat=this.owner.editor.copyInsertFormat(this.selection.start.paragraph.characterFormat,!0),this.owner.editor.insertElementsInternal(this.owner.selectionModule.end,[e]),i.contentControlProperties.hasPlaceHolderText=!0)},c.prototype.insertContentControl=function(e,t,i){if(!this.selection.isPlainContentControl()){var n,o;switch(this.selection.isSelectionisInCC=!1,"string"!=typeof e?(n=e.type,t=e.value,i=e.items,o=e):n=e,je(o)&&(o={title:void 0,tag:void 0,value:String(t),canDelete:!1,canEdit:!1,type:n,xmlString:void 0,xmlPath:void 0}),je(o)||je(o.xmlString)||je(o.xmlString)||(t=(o=this.mapXmlStringPath(o)).value,this.owner.isXmlMapCC=!0),n){case"RichText":if(je(t))this.applyRichText();else try{var r=t;((r="object"!=typeof r?JSON.parse(t):r)&&"object"==typeof r||"sections"in r)&&this.applyRichText(t,o.title,o.tag,o.canDelete,o.canEdit)}catch(e){this.applyRichText(JSON.stringify({sections:[{blocks:[{inlines:[{text:t}]}]}]}),o.title,o.tag,o.canDelete,o.canEdit)}break;case"Text":je(t)?this.applyPlainText():this.applyPlainText(t,o.title,o.tag,o.canDelete,o.canEdit);break;case"Picture":this.applyPictureContentControl(n,t,o.title,o.tag,o.canDelete,o.canEdit);break;case"ComboBox":this.applyComboBox("ComboBox",i,t,o.title,o.tag,o.canDelete,o.canEdit);break;case"DropDownList":this.applyComboBox("DropDownList",i,t,o.title,o.tag,o.canDelete,o.canEdit);break;case"Date":this.applyDatePickerContentControl(n,t,o.title,o.tag,o.canDelete,o.canEdit);break;case"CheckBox":this.applyCheckBoxContentControl(n,String.fromCharCode(9744),t,o.title,o.tag,o.canDelete,o.canEdit)}e=this.selection.currentContentControl;if(!je(e))return{title:e.contentControlProperties.title,tag:e.contentControlProperties.tag,value:String(t),canDelete:e.contentControlProperties.lockContentControl,canEdit:e.contentControlProperties.lockContents,type:e.contentControlProperties.type,xmlString:o.xmlString,xmlPath:o.xmlPath}}},c.prototype.openContentDialog=function(e){var t=new Cn("documenteditor",this.owner.defaultLocale);t.setLocale(this.owner.locale),WC.alert({title:t.getConstant("Information"),content:e?t.getConstant("Rich text Controls"):t.getConstant("Plain text Controls"),showCloseIcon:!0,closeOnEscape:!0,animationSettings:{effect:"Zoom"},position:{X:"center",Y:"center"}})},c.prototype.updatePropertiesToBlock=function(e,t){var i=e.contentControlProperties;if("Block"===i.contentControlWidgetType)for(var i=e.line.paragraph,n=e.reference.line.paragraph,o=i.isInsideTable?this.documentHelper.layout.getParentTable(i):i,r=n.isInsideTable?this.documentHelper.layout.getParentTable(n):n;o;)o.contentControlProperties=t?e.contentControlProperties:void 0,o=o!==r?o.nextRenderedWidget:void 0},c.prototype.updateContentControlPosition=function(e,t){var i=e.currentWidget.getInline(e.offset,0),n=t.currentWidget.getInline(t.offset,0);i&&i.element instanceof Pli&&"Block"===i.element.contentControlWidgetType&&e.offset++,n&&n.element instanceof Pli&&"Block"===n.element.contentControlWidgetType&&t.offset--},c.prototype.applyRichText=function(e,t,i,n,o){var r=(this.selection.isForward?this.selection.start:this.selection.end).clone(),s=(this.selection.isForward?this.selection.end:this.selection.start).clone(),a=(this.selection.isParagraphMarkSelected()&&--s.offset,r.paragraph!==s.paragraph&&(r.isAtParagraphStart?r.isAtParagraphStart&&!s.isAtParagraphEnd&&(a=void 0,a=s.paragraph.previousRenderedWidget instanceof _ai?this.selection.getLastBlockInLastCell(s.paragraph.previousRenderedWidget):s.paragraph.previousRenderedWidget,s.setPositionParagraph(a.lastChild,a.lastChild.getEndOffset())):s.setPositionParagraph(r.paragraph.lastChild,r.paragraph.lastChild.getEndOffset())),!0),l=(r.isAtParagraphStart&&s.isAtParagraphEnd&&(a=!1),this.updateContentControlPosition(r,s),this.editorHistory&&this.initComplexHistory("InsertContentControl"),new Pli(a?"Inline":"Block")),h=new Pli(a?"Inline":"Block"),a=new Fli(a?"Inline":"Block");a.color="#00000000",r.isAtSamePosition(s)?a.hasPlaceHolderText=!0:a.hasPlaceHolderText=!1,a.isTemporary=!1,a.lockContentControl=!je(n)&&!n,a.lockContents=!je(o)&&!o,a.tag=je(i)?void 0:i,a.title=je(t)?void 0:t,a.multiline=!1,a.type="RichText",this.owner.isXmlMapCC&&this.addXmlProperties(a,this.owner.xPathString),l.contentControlProperties=a,h.contentControlProperties=l.contentControlProperties,l.type=0,h.type=1,a.hasPlaceHolderText?(n=new pli,(o=new Cn("documenteditor",this.owner.defaultLocale)).setLocale(this.owner.locale),n.text=o.getConstant("Default Content Control Text"),n.characterFormat=this.copyInsertFormat(this.selection.start.paragraph.characterFormat,!0),this.insertElementsInternal(r,[l]),this.insertElementsInternal(r,[n]),r.offset,n.length,this.insertElementsInternal(r,[h])):(r.currentWidget===s.currentWidget&&s.offset++,i=this.selection.getParagraphInfo(s),t=this.selection.getHierarchicalIndex(i.paragraph,i.offset.toString()),this.insertElementsInternal(r,[l]),s=this.owner.selection.getTextPosBasedOnLogicalIndex(t),this.insertElementsInternal(s,[h])),je(e)||(this.documentHelper.selection.selectContentInternal(l),this.paste(e),a.hasPlaceHolderText=!1),this.updatePropertiesToBlock(l,!0),a.hasPlaceHolderText?this.selection.selectPlaceHolderText(l):this.selection.selectContentInternal(l),this.selection.contentControleditRegionHighlighters.clear(),this.selection.onHighlightContentControl(),this.editorHistory&&this.editorHistory.updateComplexHistory(),this.documentHelper.viewer.updateScrollBars()},c.prototype.isInvalidElementPresent=function(e,t){for(var i=this.selection.getElementInfo(e.currentWidget,e.offset+1),n=this.selection.getElementInfo(t.currentWidget,t.offset),o=e.currentWidget.indexInOwner;o<t.currentWidget.indexInOwner+1;o++)for(var r=e.currentWidget.paragraph.childWidgets[o],s=i.element.indexInOwner;s<r.children.length;s++){var a=r.children[s];if(!(a instanceof pli))return!0;if(n.element==a)return!1}return!1},c.prototype.applyPlainText=function(e,t,i,n,o){var r,s,a,l,h,d=this.selection.currentContentControl;!je(d)&&"RichText"!==d.contentControlProperties.type||(d=(this.selection.isForward?this.selection.start:this.selection.end).clone(),r=(this.selection.isForward?this.selection.end:this.selection.start).clone(),this.selection.isParagraphMarkSelected()&&--r.offset,d.paragraph!==r.paragraph&&r.setPositionParagraph(d.paragraph.lastChild,d.paragraph.lastChild.getEndOffset()),l=!0,d.isAtParagraphStart&&r.isAtParagraphEnd&&(l=!1),!(h=d.isAtSamePosition(r))&&this.isInvalidElementPresent(d,r)?this.openContentDialog(!1):(s=new Pli(l?"Inline":"Block"),a=new Pli(l?"Inline":"Block"),(l=new Fli(l?"Inline":"Block")).color="#00000000",l.hasPlaceHolderText=!!h,l.isTemporary=!1,l.lockContentControl=!je(n)&&!n,l.lockContents=!je(o)&&!o,l.tag=je(i)?void 0:i,l.title=je(t)?void 0:t,l.multiline=!1,l.type="Text",this.owner.isXmlMapCC&&this.addXmlProperties(l,this.owner.xPathString),s.contentControlProperties=l,a.contentControlProperties=s.contentControlProperties,s.type=0,a.type=1,this.editorHistory&&this.initComplexHistory("InsertContentControl"),l.hasPlaceHolderText?(h=new pli,je(e)?((n=new Cn("documenteditor",this.owner.defaultLocale)).setLocale(this.owner.locale),h.text=n.getConstant("Default Content Control Text")):(h.text=e,l.hasPlaceHolderText=!1),h.characterFormat=this.copyInsertFormat(this.selection.start.paragraph.characterFormat,!0),this.insertElementsInternal(d,[s]),this.insertElementsInternal(d,[h]),d.offset,h.length,this.insertElementsInternal(d,[a])):(d.currentWidget===r.currentWidget&&r.offset++,o=this.selection.getParagraphInfo(r),i=this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString()),this.insertElementsInternal(d,[s]),r=this.owner.selection.getTextPosBasedOnLogicalIndex(i),this.insertElementsInternal(r,[a])),this.selection.start.currentWidget.getInline(this.selection.start.offset-1,0).element.contentControlProperties=l,this.updatePropertiesToBlock(s,!0),l.hasPlaceHolderText?this.selection.selectPlaceHolderText(s):this.selection.selectContentInternal(s),this.editorHistory&&this.editorHistory.updateComplexHistory(),this.documentHelper.viewer.updateScrollBars()))},c.prototype.applyComboBox=function(e,t,i,n,o,r,s){var a=this.selection.currentContentControl;if(je(a)||"RichText"===a.contentControlProperties.type){var a=new Pli("Inline"),l=new Pli("Inline"),h=new Fli("Inline"),d=(h.color="#00000000",h.type=e,h.tag=je(o)?void 0:o,h.title=je(n)?void 0:n,this.selection.isEmpty?h.hasPlaceHolderText=!0:h.hasPlaceHolderText=!1,h.isTemporary=!1,h.lockContentControl=!je(r)&&r,h.lockContents=!je(s)&&s,h.multiline=!1,[]);if(je(t)){var p=new Rli,c=new Cn("documenteditor",this.owner.defaultLocale);p.displayText=c.getConstant("Choose an item"),p.value=c.getConstant("Choose an item"),d.push(p)}else for(var u=0;u<t.length;u++)(p=new Rli).displayText=t[u],p.value=t[u],d.push(p);h.contentControlListItems=d,h.contentControlWidgetType="Inline",this.owner.isXmlMapCC&&this.addXmlProperties(h,this.owner.xPathString),a.contentControlProperties=h,l.contentControlProperties=a.contentControlProperties,a.type=0,l.type=1,this.editorHistory&&this.initComplexHistory("InsertContentControl");e=(this.selection.isForward?this.selection.start:this.selection.end).clone(),o=(this.selection.isForward?this.selection.end:this.selection.start).clone();o.paragraph!==e.paragraph&&(o=new rci(this.owner)).setPositionParagraph(e.paragraph.lastChild,e.paragraph.lastChild.getEndOffset()),h.hasPlaceHolderText?(p=new pli,c=new Cn("documenteditor",this.owner.defaultLocale),p.text=c.getConstant("Choose an item"),p.characterFormat=this.copyInsertFormat(this.selection.start.paragraph.characterFormat,!0),this.insertElementsInternal(e,[a]),this.insertElementsInternal(e,[p]),e.offset,p.length,this.insertElementsInternal(e,[l])):(this.insertElementsInternal(e,[a]),o.offset++,this.insertElementsInternal(o,[l])),this.selection.start.currentWidget.getInline(this.selection.start.offset-1,0).element.contentControlProperties=h,je(t)||this.dropDownChange(a,i),this.editorHistory&&this.editorHistory.updateComplexHistory(),this.documentHelper.viewer.updateScrollBars()}},c.prototype.applyDatePickerContentControl=function(e,t,i,n,o,r){this.dateValue=t;var s,a,l=this.selection.currentContentControl;!je(l)&&"RichText"!==l.contentControlProperties.type||(l=new Pli("Inline"),s=new Pli("Inline"),(a=new Fli("Inline")).color="#00000000",this.selection.isEmpty?a.hasPlaceHolderText=!0:a.hasPlaceHolderText=!1,a.isTemporary=!1,a.lockContentControl=!je(o)&&!o,a.lockContents=!je(r)&&!r,a.tag=je(n)?void 0:n,a.title=je(i)?void 0:i,a.multiline=!1,a.type=e,a.contentControlWidgetType="Inline",this.owner.isXmlMapCC&&this.addXmlProperties(a,this.owner.xPathString),l.contentControlProperties=a,s.contentControlProperties=l.contentControlProperties,l.type=0,s.type=1,this.editorHistory&&this.initComplexHistory("InsertContentControl"),o=(this.selection.isForward?this.selection.start:this.selection.end).clone(),(r=(this.selection.isForward?this.selection.end:this.selection.start).clone()).paragraph!==o.paragraph&&(r=new rci(this.owner)).setPositionParagraph(o.paragraph.lastChild,o.paragraph.lastChild.getEndOffset()),a.hasPlaceHolderText?(n=new pli,t?n.text=t:((i=new Cn("documenteditor",this.owner.defaultLocale)).setLocale(this.owner.locale),n.text=i.getConstant("Default Date Picker")),n.characterFormat=this.copyInsertFormat(this.selection.start.paragraph.characterFormat,!0),this.insertElementsInternal(o,[l]),this.insertElementsInternal(o,[n]),o.offset,n.length,this.insertElementsInternal(o,[s])):(this.insertElementsInternal(o,[l]),r.offset++,this.insertElementsInternal(r,[s])),this.selection.start.currentWidget.getInline(this.selection.start.offset-1,0).element.contentControlProperties=a,this.editorHistory&&this.editorHistory.updateComplexHistory(),this.documentHelper.viewer.updateScrollBars())},c.prototype.applyCheckBoxContentControl=function(e,t,i,n,o,r,s){var a,l,h=this.selection.currentContentControl;!je(h)&&"RichText"!==h.contentControlProperties.type||(h=new Pli("Inline"),a=new Pli("Inline"),(l=new Fli("Inline")).color="#00000000",l.hasPlaceHolderText=!1,l.isTemporary=!1,l.lockContentControl=!je(r)&&r,l.lockContents=!je(s)&&s,l.multiline=!1,l.type=e,l.tag=je(o)?void 0:o,l.title=je(n)?void 0:n,je(i)?l.isChecked=!1:l.isChecked=i,l.uncheckedState=new Nli,l.uncheckedState.font=this.selection.characterFormat.fontFamily,l.uncheckedState.value=String.fromCharCode(9744),l.checkedState=new Nli,l.checkedState.font=this.selection.characterFormat.fontFamily,l.checkedState.value=String.fromCharCode(9746),l.contentControlWidgetType="Inline",this.owner.isXmlMapCC&&this.addXmlProperties(l,this.owner.xPathString),h.contentControlProperties=l,a.contentControlProperties=h.contentControlProperties,h.type=0,a.type=1,this.editorHistory&&this.initComplexHistory("InsertContentControl"),r=(this.selection.isForward?this.selection.start:this.selection.end).clone(),(this.selection.isForward?this.selection.end:this.selection.start).clone().paragraph!==r.paragraph&&new rci(this.owner).setPositionParagraph(r.paragraph.lastChild,r.paragraph.lastChild.getEndOffset()),this.selection&&((s=new pli).text=t,s.characterFormat=this.copyInsertFormat(this.selection.start.paragraph.characterFormat,!0),this.insertElementsInternal(r,[h]),this.insertElementsInternal(r,[s]),r.offset,s.length,this.insertElementsInternal(r,[a])),this.editorHistory&&this.editorHistory.updateComplexHistory(),this.documentHelper.viewer.updateScrollBars())},c.prototype.applyPictureContentControl=function(e,t,i,n,o,r){var s,a,l=this.selection.currentContentControl;!je(l)&&"RichText"!==l.contentControlProperties.type||(l=new Pli("Inline"),s=new Pli("Inline"),(a=new Fli("Inline")).color="#00000000",a.hasPlaceHolderText=!1,a.isTemporary=!1,a.lockContentControl=!je(o)&&o,a.lockContents=!je(r)&&r,a.multiline=!1,a.type=e,a.tag=je(n)?void 0:n,a.title=je(i)?void 0:i,a.contentControlWidgetType="Inline",this.owner.isXmlMapCC&&this.addXmlProperties(a,this.owner.xPathString),l.contentControlProperties=a,s.contentControlProperties=l.contentControlProperties,l.type=0,s.type=1,this.editorHistory&&this.initComplexHistory("InsertContentControl"),o=this.selection.start.clone(),r=this.selection.end.clone(),this.selection.isForward||(l.type=1,s.type=0),this.selection.start.paragraph==this.selection.end.paragraph&&(this.insertElementsInternal(o,[l]),je(t)||this.insertImageAsync(t),this.insertElementsInternal(r,[s])),this.editorHistory&&this.editorHistory.updateComplexHistory(),this.documentHelper.viewer.updateScrollBars())},c.prototype.getPrefixMapping=function(e){e=(new DOMParser).parseFromString(e,"application/xml");this.documentHelper.owner.prefixMappings=e.documentElement.namespaceURI},c.prototype.addXmlProperties=function(e,t){e.xmlMapping=new _li,e.xmlMapping.isMapped=!0,je(this.documentHelper.owner.prefixMappings)?e.xmlMapping.prefixMapping=" ":e.xmlMapping.prefixMapping=this.documentHelper.owner.prefixMappings,e.xmlMapping.xPath=t,je(this.guid)&&(this.guid=this.createGuid()),e.xmlMapping.storeItemId="{"+this.guid+"}",this.documentHelper.customXmlData.add(e.xmlMapping.storeItemId,this.xmlStringValue)},c.prototype.createGuid=function(){var i=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=(i+16*Math.random())%16|0;return i=Math.floor(i/16),("x"===e?t:3&t|8).toString(16)})},c.prototype.mapXmlStringPath=function(e){this.getPrefixMapping(e.xmlString);var t=this.parseXml(e.xmlString),i=this.objectToArray(t),t=(this.setXmlData(t,i),this.xmlData,e.xmlPath.split("/").pop()),i=e.xmlPath.split("/"),i=i[i.length-2],i=this.getXmlValue(i,t);return this.owner.isXmlMapCC=!0,e.xmlPath=this.transformString(e.xmlPath),this.owner.xPathString="/"+e.xmlPath,e.value=i,e},c.prototype.setContentControlInfo=function(e){var t,i=this.documentHelper.selection.getContentControlInfo();if(!je(i))return i.xmlString=e.xmlString,i.xmlPath=e.xmlPath,i.title=e.title,i.tag=e.tag,i.value=e.value,i.canDelete=e.canDelete,i.canEdit=e.canEdit,e=this.selection.currentContentControl,t=this.documentHelper.owner.getImageContentControl(),je(e)&&je(t)||je(i)||(je(i.xmlString)||je(i.xmlString)||(i=this.mapXmlStringPath(i),this.documentHelper.owner.selection.selectContentInternal(e),this.insertText(i.value),t=this.getContentControl(),this.addXmlProperties(t.contentControlProperties,this.owner.xPathString),this.owner.isXmlMapCC=!1),je(i.tag)||i.tag===e.contentControlProperties.tag||(e.contentControlProperties.tag=i.tag),je(i.title)||i.title===e.contentControlProperties.title||(e.contentControlProperties.title=i.title),je(i.value)||e.nextElement.text===i.value||i.canEdit||this.insertText(i.value),je(i.canDelete)||i.canDelete===e.contentControlProperties.lockContentControl||(e.contentControlProperties.lockContentControl=i.canDelete),je(i.canEdit))||i.canEdit===e.contentControlProperties.lockContents||(e.contentControlProperties.lockContents=i.canEdit),i},c.prototype.transformString=function(e){return e.split("/").map(function(e){return e+"[1]"}).join("/")},c.prototype.getXmlValue=function(e,t){for(var i,n,o,r=0;r<this.xmlData.length;r++)if(this.xmlData[r].displayText==e&&(i=this.xmlData[r].id),i=Number(i),!isNaN(i)&&this.xmlData[r].displayText==t&&this.xmlData[i-1].displayText==e){n=this.xmlData[r].id,Number(n),o=(o=this.xmlData[r].displayValue).toString();break}return o},c.prototype.objectToArray=function(i){return Object.keys(i).map(function(e,t){return{index:String(t+1),data:i[e]}})},c.prototype.parseXml=function(e){this.xmlStringValue=e;try{var t=(new DOMParser).parseFromString(e,"text/xml"),i=this.xmlToJson(t.documentElement);return this.xmlTitle=t.documentElement.nodeName,i}catch(e){return console.error("Error parsing XML string:",e),null}},c.prototype.xmlToJson=function(e){var t={};if(e.hasChildNodes())for(var i=0;i<e.childNodes.length;i++){var n=e.childNodes[i];1===n.nodeType?n.nextSibling&&n.nextSibling.nodeName===n.nodeName?(t[n.nodeName]||(t[n.nodeName]=[]),t[n.nodeName].push(this.xmlToJson(n))):t[n.nodeName]=this.xmlToJson(n):3===n.nodeType&&(n=n.textContent.trim())&&(t=n)}return t},c.prototype.setXmlData=function(e,t){var i,n=2,o=(this.xmlData=[],this.xmlData.push({id:1,displayText:this.xmlTitle,hasChild:!0,expanded:!0}),0);for(i in e){for(var r=!0;o<t.length;o++){var s=t[o].data,r=s instanceof Object&&0<Object.keys(s).length;o+=1;break}this.xmlData.push({id:n++,displayText:i,displayValue:e[i],pid:"1",hasChild:r,expanded:r});for(var a=e[i],l=0;l<t.length;l++){var h=t[l].data,d=(n-1).toString();if(h instanceof Object&&h==a)for(var p in h)this.xmlData.push({id:n++,displayText:p,displayValue:a[p],pid:d})}}this.dictionaryObject[this.dictionaryObjectIndexIncrement++]={ID:"(no namespace)_"+this.dictionaryObjcetIDIncreament,Data:this.xmlData},this.dictionaryObjcetIDIncreament++},c.prototype.dropDownChange=function(e,t){je(e)||(this.documentHelper.selection.selectContentInternal(e),this.insertTextInternal(t,!0),e.contentControlProperties.isTemporary&&this.removeContentControl())},c.prototype.updateXmlMappedContentControl=function(){var e;this.isXmlMapped&&(e=this.selection.currentContentControl)&&e.contentControlProperties&&this.updateCustomXml(e.contentControlProperties.xmlMapping.storeItemId,e.contentControlProperties.xmlMapping.xPath,this.getResultContentControlText(e))},c.prototype.updateCustomXml=function(e,t,i){if(this.documentHelper.customXmlData.containsKey(e)&&!je(t)){var n=this.documentHelper.customXmlData.get(e),n=(new DOMParser).parseFromString(n,"text/xml"),t=t.substring(t.lastIndexOf("/")+1),o=(t=(t=(t=t.split("[")[0]).substring(t.lastIndexOf(":")+1)).substring(t.lastIndexOf("@")+1),n.getElementsByTagName(t));if(0<o.length)o[0].childNodes[0].nodeValue=i;else{if(!(0<n.documentElement.attributes.length&&null!==n.documentElement.attributes.getNamedItem(t)))return;n.documentElement.attributes.getNamedItem(t).value=i}o=(new XMLSerializer).serializeToString(n);this.documentHelper.customXmlData.set(e,o)}},c.prototype.insertText=function(e){je(e)||""===e||this.owner.isReadOnly||"ReadOnly"===this.documentHelper.protectionType&&!this.selection.isSelectionInEditRegion()||"CommentsOnly"===this.documentHelper.protectionType&&this.owner.isReadOnly||(this.isInsertingText=!0,this.insertTextInternal(e,!1),this.isInsertingText=!1)},c.prototype.insertTextInternal=function(e,t,i,n,o){if(0<=e.indexOf("\r")||0<=e.indexOf("\n"))"\r"===e||"\n"===e||"\r\n"===e?this.onEnter():(this.isInsertText=!0,this.pasteContents(e),this.isInsertText=!1);else{if("FormFieldsOnly"===this.documentHelper.protectionType&&this.selection.isInlineFormFillMode()){if(!(l=this.selection.currentFormField).formFieldData.enabled)return;var r=this.getFieldResultText(l),s=new RegExp(this.owner.documentHelper.textHelper.getEnSpaceCharacter(),"gi"),s=(0<r.length&&""===r.replace(s,"")&&(r="",this.selection.selectFieldInternal(l)),l.formFieldData.maxLength);if(0!==s&&r.length>=s)return}t&&(this.documentHelper.layout.isReplaceAll=!je(n)&&!n);var a,l,h,d,p,c,r=this.documentHelper.owner.selection.currentContentControl,s=(!je(r)&&r.contentControlProperties.hasPlaceHolderText&&(this.documentHelper.selection.selectContentInternal(r),r.contentControlProperties.hasPlaceHolderText=!1),this.documentHelper.selection),n=!0,u=!1,g=(i=this.owner.enableTrackChanges&&je(i)?"Insertion":i,this.checkAndRemoveComments(t)),m=(this.isListTextSelected(),this.documentHelper.isBookmarkInserted&&!s.isEmpty&&0<s.bookmarks.length&&this.extendSelectionToBookmarkStart(),!1),f=(s.isEmpty&&((f=(d=s.start.currentWidget.getInline(s.start.offset,0)).element)instanceof Dli&&1===f.bookmarkType&&!je(f.properties)&&f.properties.hasOwnProperty("isAfterParagraphMark")&&f.properties.isAfterParagraphMark&&(s.start.setPositionParagraph(f.line,f.line.getOffset(f,0)),s.end.setPositionInternal(s.start)),v=s.start.isAtParagraphStart,y=s.end.isAtParagraphEnd,v||y)&&f&&f instanceof Pli&&"Block"===f.contentControlWidgetType&&f.reference&&f.paragraph!==f.reference.paragraph&&(this.initComplexHistory("Insert"),m=!0,this.onEnter(),v)&&(y=f.paragraph.previousWidget)instanceof Lai&&y.isEmpty()&&s.moveToPreviousParagraph(),!je(i)&&"Insertion"!==i||(this.initHistory("Insert"),je(this.editorHistory))||je(this.editorHistory.currentBaseHistoryInfo)||(this.editorHistory.currentBaseHistoryInfo.insertedText=e,"FormFieldsOnly"===this.documentHelper.protectionType&&(v=this.documentHelper.selection.getCurrentFormField())&&v instanceof Zai&&v.formFieldData&&v.formFieldData instanceof lli&&(this.editorHistory.currentBaseHistoryInfo.fieldBegin=v,this.editorHistory.currentBaseHistoryInfo.dropDownIndex=v.formFieldData.selectedIndex)),this.selection.getParagraphInfo(s.start)),y=f.paragraph.paragraphFormat,v=(s.editPosition=s.getHierarchicalIndex(f.paragraph,f.offset.toString()),s.start.paragraph.paragraphFormat.bidi),b=(!s.isEmpty&&!s.isImageSelected||this.documentHelper.isListTextSelected&&"List"===s.contextType?(s.isSkipLayouting=!0,s.skipFormatRetrieval=!0,p=a=void 0,b=c=0,this.owner.enableTrackChanges&&(a=(this.selection.start.isExistBefore(this.selection.end)?(p=this.selection.getParagraphInfo(s.end),this.selection.end):(p=this.selection.getParagraphInfo(s.start),this.selection.start)).clone(),b=p.paragraph.getLength(),c=p.offset-1===b?p.offset-1:p.offset,this.skipReplace=!0),(n=this.removeSelectedContents(s))&&(this.updateInsertPosition(),u=!0),this.skipReplace=!1,!je(a)&&this.owner.searchModule&&this.owner.searchModule.isRepalceTracking?(this.owner.searchModule.isRepalceTracking=!1,this.selection.start.setPositionInternal(this.selection.start),this.selection.end.setPositionInternal(a)):0<c&&c<=b&&(b!==(a=p.paragraph.getLength())&&(c-=b-a),this.setPositionParagraph(p.paragraph,c,!0)),s.skipFormatRetrieval=!1,s.isSkipLayouting=!1):!s.isEmpty||this.documentHelper.isListTextSelected||t||(this.documentHelper.isTextInput=!0),(f=this.selection.getParagraphInfo(s.start)).paragraph.paragraphFormat.copyFormat(y),this.documentHelper.textHelper.containsSpecialCharAlone(e));if(n&&(s.owner.isShiftingEnabled=!0,u||this.updateInsertPosition(),(a=s.start).paragraph.isEmpty()?(p=new pli,w=this.copyInsertFormat(a.paragraph.characterFormat,!0),p.characterFormat.copyFormat(w),p.text=e,h=this.documentHelper.textHelper.getRtlLanguage(e).isRtl||this.selection.characterFormat.bidi,p.characterFormat.bidi=h,w.bidi=h,p.isRightToLeft=h,p.line=a.paragraph.childWidgets[0],p.margin=new gai(0,0,0,0),p.line.children.push(p),this.setCharFormatForCollaborativeEditing(p.characterFormat),this.owner.enableTrackChanges&&(0<p.paragraph.characterFormat.revisions.length&&0<(c=this.getMatchedRevisionsToCombine(p.paragraph.characterFormat.revisions,i)).length&&this.mapMatchedRevisions(c,p.paragraph.characterFormat,p,!0),this.checkToCombineRevisionWithPrevPara(p,i)||0!==p.revisions.length||this.insertRevision(p,i)),("Center"===a.paragraph.paragraphFormat.textAlignment||"Right"===a.paragraph.paragraphFormat.textAlignment||"Justify"===a.paragraph.paragraphFormat.textAlignment&&a.paragraph.paragraphFormat.bidi)&&-1===a.paragraph.paragraphFormat.listFormat.listId&&(a.paragraph.x=a.paragraph.clientX,a.paragraph.clientX=void 0,a.paragraph.hasOwnProperty("absoluteXPosition"))&&delete a.paragraph.absoluteXPosition,p instanceof pli&&90<p.text.length&&Y.splitWordByMaxLength(p,p.line),this.documentHelper.layout.reLayoutParagraph(a.paragraph,0,0)):(l=(d=a.currentWidget.getInline(a.offset,y=0,v,!t,this.documentHelper.owner.isSpellCheck)).element,y=d.index,l.ischangeDetected=!0,!l.paragraph.isInsideTable&&l instanceof Dli&&1===l.bookmarkType&&!je(l.properties)&&l.properties.hasOwnProperty("isAfterParagraphMark")&&delete l.properties.isAfterParagraphMark,l instanceof pli&&" "!==e&&this.documentHelper.owner.isSpellCheck&&(this.owner.spellCheckerModule.removeErrorsFromCollection({element:l,text:l.text}),t||(l.ignoreOnceItems=[])),l.canTrigger&&l.text.length<=1&&(l.canTrigger=!1),(w=this.copyInsertFormat(l.characterFormat,!0)).hidden&&(w.hidden=!1),h=this.documentHelper.textHelper.getRtlLanguage(e).isRtl||this.selection.characterFormat.bidi,this.documentHelper.textHelper.getRtlLanguage(e).id,u=0,p=c=!1,l instanceof pli&&(u=this.documentHelper.textHelper.getRtlLanguage(l.text).id,c=this.documentHelper.textHelper.getRtlLanguage(l.text).isRtl,p=this.documentHelper.textHelper.containsSpecialCharAlone(e)),!(h=!h&&l.characterFormat.bidi&&(0!==u||p&&c)||" "===e&&this.selection.characterFormat.bidi?!0:h)&&this.documentHelper.owner.isSpellCheck||(w.bidi=h),this.setCharFormatForCollaborativeEditing(w),(!this.documentHelper.owner.isSpellCheck||" "!==e&&" "!==l.text)&&!(l instanceof Pli)&&w.isSameFormat(l.characterFormat)&&this.canInsertRevision(l,i)||""===e.trim()&&!h&&l.characterFormat.bidi||c&&w.isSameFormat(l.characterFormat)&&b?(this.insertTextInline(l,s,e,y),this.setCharFormatForCollaborativeEditing(l.characterFormat)):((v=new pli).text=e,v.line=l.line,v.isRightToLeft=c,!je(l)&&l.contentControlProperties?(v.contentControlProperties=l.contentControlProperties,v.characterFormat.copyFormat(l.characterFormat)):v.characterFormat.copyFormat(w),this.setCharFormatForCollaborativeEditing(v.characterFormat),l instanceof fli&&(v.characterFormat.baselineAlignment="Normal"),d=!1,u=l.indexInOwner,p=v.revisions.length,y!==l.length||o?0!==y||o?(l instanceof pli&&((b=new pli).line=l.line,b.characterFormat.copyFormat(l.characterFormat),!je(l)&&l.contentControlProperties&&(b.contentControlProperties=l.contentControlProperties),b.text=l.text.substring(y),this.owner.enableTrackChanges||this.selection.isInField||this.updateRevisionForSpittedTextElement(l,b),l.text=l.text.slice(0,y),l.isWidthUpdated=!1,this.owner.enableTrackChanges?(d=this.checkToMapRevisionWithInlineText(l,y,v,h,i))||v.revisions.length>p?this.copyElementRevision(l,b,!0):v.revisions.length===p&&(this.updateRevisionForSpittedTextElement(l,b),this.insertRevision(v,i)):this.selection.isInField&&(this.copyElementRevision(l,b,!1),this.updateElementInFieldRevision(l,v,l.revisions,!0)),this.owner.isSpellCheck&&this.owner.spellCheckerModule.updateSplittedElementError(l,b),""!==b.text)&&l.line.children.splice(u+1,0,b),d||l.line.children.splice(u+1,0,v)):(this.owner.enableTrackChanges&&!(d=this.checkToMapRevisionWithInlineText(l,y,v,h,i))&&0===v.revisions.length&&this.checkToMapRevisionWithPreviousNode(l.previousNode,v,h,i),d||(l.line.children.splice(u,0,v),this.checkToCombineRevisionsinBlocks(v,p===v.revisions.length,!0,i))):(c=-1,c=u+1,(d=!this.owner.enableTrackChanges||l instanceof Dli||(d=this.checkToMapRevisionWithInlineText(l,y,v,h,i))||v.revisions.length!==p?d:(null==l.nextNode||1!=l.nextNode.revisions.length)&&1==l.paragraph.characterFormat.revisions.length&&"Deletion"==l.paragraph.characterFormat.revisions[0].revisionType?this.checkToMapRevisionWithNextNode(l.nextNode,v,h,i,l.paragraph):this.checkToMapRevisionWithNextNode(l.nextNode,v,h,i))||(l.line.children.splice(c,0,v),this.checkToCombineRevisionsinBlocks(v,p===v.revisions.length,!0,i))),v instanceof pli&&90<v.text.length&&Y.splitWordByMaxLength(v,v.line),(je(i)||"Deletion"!==i||a.paragraph.isLayouted)&&this.documentHelper.layout.reLayoutParagraph(a.paragraph,l.line.indexInOwner,0),l instanceof pli&&-1!==l.line.children.indexOf(l)&&""===l.text&&l.line.children.splice(l.line.children.indexOf(l),1))),!je(r)&&r.contentControlProperties.isTemporary&&this.removeContentControl(),this.documentHelper.layout.allowLayout=!0,this.setPositionParagraph(f.paragraph,f.offset+e.length,!0),this.updateEndPosition(),je(this.editorHistory)||je(this.editorHistory.currentHistoryInfo)||"ListSelect"!==this.editorHistory.currentHistoryInfo.action||!this.documentHelper.isListTextSelected||(this.editorHistory.updateHistory(),this.editorHistory.updateComplexHistory()),!je(i)&&"Insertion"!==i||this.isFieldOperation||this.reLayout(s),m&&this.editorHistory&&this.editorHistory.updateComplexHistory(),this.documentHelper.isTextInput=!1),this.updateXmlMappedContentControl(),!t&&n&&(" "===e||"\t"===e||"\v"===e)){var w=!1;if(!(w="\v"===e||this.isRemoteAction?w:this.checkAndConvertList(s,"\t"===e))){if(!je(s.getHyperlinkField()))return;this.checkAndConvertToHyperlink(s,!1)}}this.updateHistoryForComments(g)}},c.prototype.extendSelectionToBookmarkStart=function(){if(0<this.documentHelper.bookmarks.length)for(var e=this.selection.start,t=(this.selection.end,this.selection.isForward||(e=this.selection.end,this.selection.start),void 0),i=this.selection.bookmarks,n=0;n<i.length;n++){var o,r,t=this.documentHelper.bookmarks.get(i[n]);this.selection.isElementInSelection(t.reference,!1)&&!this.selection.isElementInSelection(t,!0)&&(r=t.line.paragraph,o=this.selection.getParagraphInfo(e),r.equals(o.paragraph))&&(r=t.line.getOffset(t,t.bookmarkType),t.line===e.currentWidget)&&o.offset===r+1&&e.offset--}},c.prototype.updateElementInFieldRevision=function(e,t,i,n){for(var o=0;o<i.length;o++){var r=i[o],s=r.range.indexOf(e);r.range.splice(n?s+1:s,0,t),this.owner.trackChangesPane.updateCurrentTrackChanges(r)}},c.prototype.retrieveFieldResultantText=function(e){var t="";if(1===e.fieldType){var i=e.previousElement;for(je(i)&&0===e.indexInOwner&&!je(e.line)&&!je(e.line.previousLine)&&e.line.previousLine.children[e.line.previousLine.children.length-1]instanceof pli&&(i=e.line.previousLine.children[e.line.previousLine.children.length-1]);!je(i)&&i instanceof pli;)t=i.text+t,i=je(i.previousNode)?void 0:i.previousNode.previousValidNodeForTracking}return t},c.prototype.checkToCombineRevisionsinBlocks=function(e,t,i,n){t&&this.owner.enableTrackChanges&&(e instanceof Dli||e instanceof Khi||e instanceof ghi||e instanceof phi||(i?this.combineRevisionWithNextPara(e,n):this.combineRevisionWithPrevPara(e,n))||this.insertRevision(e,n))},c.prototype.checkToMapRevisionWithNextNode=function(e,t,i,n,o){return je(o)||1!=o.characterFormat.revisions.length?!je(e)&&!je(e=e.nextValidNodeForTracking)&&this.checkToMapRevisionWithInlineText(e,0,t,i,n):!je(e=o.characterFormat)&&this.checkToMapRevisionWithInlineText(void 0,0,t,i,n,e)},c.prototype.checkToMapRevisionWithPreviousNode=function(e,t,i,n){return!je(e)&&!je(e=e.previousValidNodeForTracking)&&this.checkToMapRevisionWithInlineText(e,e.length,t,i,n)},c.prototype.checkToMapRevisionWithInlineText=function(e,t,i,n,o,r){if(je(r)){if(!je(e))if("Deletion"===o&&this.updateLastElementRevision(i),e.length===t&&null!=e.previousValidNodeForTracking){if(t=(e=e.previousValidNodeForTracking).length,0<e.revisions.length)return this.applyMatchedRevisionInorder(e,i,t,!1,n,o)}else if(0===t&&!je(e=e.nextValidNodeForTracking)&&0<e.revisions.length)return this.applyMatchedRevisionInorder(e,i,t,!0,n,o)}else if("Deletion"===o&&this.updateLastElementRevision(i),!je(r)&&0<r.revisions.length)return this.applyMatchedRevisionInorder(void 0,i,t,!0,n,o,r);return!1},c.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],o=0;o<t.revisions.length;o++){var r=t.revisions[i];-1===n.range.indexOf(t)&&r.revisionType===n.revisionType&&r.author===n.author&&(t.revisions.splice(o,1),n.range.push(t),t.revisions.splice(o,0,n),this.owner.trackChangesPane.updateCurrentTrackChanges(n))}},c.prototype.applyMatchedRevisionInorder=function(e,t,i,n,o,r,s){var a;return!je(s)&&je(e)?0<(a=this.getMatchedRevisionsToCombine(s.revisions,r)).length&&this.mapMatchedRevisions(a,s,t,n):0<(a=this.getMatchedRevisionsToCombine(e.revisions,r)).length&&this.mapMatchedRevisions(a,e,t,n),!1},c.prototype.copyElementRevision=function(e,t,i){if(!this.isTrackingFormField)for(var n=0;n<e.revisions.length;n++){var o=e.revisions[n],r=o.range.indexOf(e);t.revisions.splice(0,0,o),o.range.splice(r+(i?2:1),0,t),this.owner.trackChangesPane.updateCurrentTrackChanges(o)}},c.prototype.mapMatchedRevisions=function(e,t,i,n){for(var o=0;o<e.length;o++){var r,s=e[o];this.isRevisionAlreadyIn(i,s)||(i.revisions.splice(0,0,s),this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&0===this.editorHistory.currentBaseHistoryInfo.markerData.length&&this.editorHistory.currentBaseHistoryInfo.markerData.push(this.getMarkerData(void 0,void 0,s)),i instanceof fli&&this.insertRevisionForFootnoteWidget(i,s),r=s.range.indexOf(t),s.range.splice(n?r:r+1,0,i),this.owner.trackChangesPane.updateCurrentTrackChanges(s))}},c.prototype.isRevisionAlreadyIn=function(e,t){if(0<e.revisions.length)for(var i=0;i<e.revisions.length;i++)if(e.revisions[i].revisionID===t.revisionID)return!0;return!1},c.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},c.prototype.decideInlineForTrackChanges=function(e,t){var i,n=!1;return this.owner.enableTrackChanges&&!this.canInsertRevision(e,t)&&!je(i=e.nextValidNodeForTracking)&&this.canInsertRevision(i,t)&&(e=i,n=!0),{element:e,isMatched:n}},c.prototype.insertIMEText=function(e,t){var i,n;this.documentHelper.lastComposedText===e&&t||(n=this.selection.getParagraphInfo(this.selection.start),n=this.selection.getHierarchicalIndex(n.paragraph,n.offset.toString()),this.insertText(e),this.documentHelper.lastComposedText=e,i=this.selection.start,this.setPositionForCurrentIndex(i,n),(n=new rci(this.owner)).setPositionForLineWidget(i.currentWidget,i.offset+e.length),this.owner.enableTrackChanges?(t||this.selection.start.setPositionInternal(this.selection.end),this.selection.end.updatePhysicalPosition(!0)):this.selection.selectPosition(t?i:n,n))},c.prototype.insertSectionBreak=function(e,t){je(e)&&(e=dJt.NewPage);var i=this.documentHelper.selection;je(i)||this.owner.isReadOnlyMode||i.start.paragraph.isInHeaderFooter||(e===dJt.Continuous?this.initHistory("SectionBreakContinuous"):this.initHistory("SectionBreak"),i.isEmpty||i.selectContent(i.isForward?i.start:i.end,!0),this.documentHelper.owner.isShiftingEnabled=!0,this.updateInsertPosition(),e===dJt.Continuous?(this.documentHelper.layout.isSectionBreakCont=!0,this.insertSection(i,!0,void 0,!0,void 0,t)):this.insertSection(i,!0,void 0,void 0,!0,t),this.updateEndPosition(),this.reLayout(i,!0),this.layoutWholeDocument(!0),this.documentHelper.layout.isSectionBreakCont=!1)},c.prototype.combineRevisionWithBlocks=function(e,t){if(this.owner.enableTrackChanges&&!je(e)){for(;e instanceof Dli||e instanceof Khi||e instanceof lhi;)e=e.nextElement;if(!je(e)){var i=(e instanceof Lai?e:e.paragraph).previousRenderedWidget;if(!((i=e instanceof pli&&0===e.paragraph.firstChild.children[0].revisions.length?void 0:i)instanceof _ai)){var n,o=e instanceof Lai?e.characterFormat:e;if(!je(i)&&0<i.characterFormat.revisions.length){if(je(s=i.lastChild)||0===s.children.length)return;for(var r=s.children[s.children.length-1];r instanceof Dli||r instanceof Khi||r instanceof lhi;)r=r.previousElement;0<(r=i.isEmpty()?i.characterFormat:r).revisions.length&&this.compareElementRevision(i.characterFormat,o)&&(i=o.revisions[o.revisions.length-1],this.compareElementRevision(r,o))&&i!==(l=r.revisions[r.revisions.length-1])&&(a=l.range.indexOf(r)+1,l.range.filter(function(e){return e instanceof Eri})&&(a+=1),this.clearAndUpdateRevisons(i.range,l,a),this.owner.revisions.remove(i))}if(e instanceof Lai)n=e.characterFormat;else{for(var s=e.paragraph.lastChild;0==s.children.length&&!je(s.previousLine);)s=s.previousLine;e=null==(n=s.children[s.children.length-1])?e:n}var a=(e instanceof Lai?e:e.paragraph).nextRenderedWidget;if(!(a instanceof _ai)){if(!je(a)){for(var l,h=a.firstChild.children[0];h instanceof Dli||h instanceof Khi||h instanceof lhi;)h=h.nextElement;if(je(h=a.isEmpty()?a.characterFormat:h))return;0<h.revisions.length&&(i=h.revisions[h.revisions.length-1],this.compareElementRevision(o,h))&&this.compareElementRevision(o,h)&&i!==(l=o.revisions[o.revisions.length-1])&&(this.clearAndUpdateRevisons(l.range,i,0,!0),this.owner.revisions.remove(l))}e instanceof Xai&&0===e.revisions.length&&this.insertRevision(e,t)}}}}},c.prototype.checkToCombineRevisionWithNextPara=function(e,t){var i=e.paragraph.nextRenderedWidget;if(!(i instanceof _ai||je(i)||i.isEmpty())){for(var n=i.firstChild.children[0];n instanceof Dli||n instanceof Khi;)n=n.previousElement;if(je(n))return!1;if(0<n.revisions.length){i=this.getMatchedRevisionsToCombine(n.revisions,t);if(0<i.length)return this.mapMatchedRevisions(i,n,e,!0),!0}}return!1},c.prototype.checkToCombineRevisionWithPrevPara=function(e,t,i){var n=e instanceof Xai?e.paragraph.previousRenderedWidget:e;if(!(n instanceof _ai)&&!je(n)&&0<n.characterFormat.revisions.length){if(!this.isRevisionMatched(n.characterFormat,t))return!1;t=this.getMatchedRevisionsToCombine(n.characterFormat.revisions,t);if(0<t.length)return this.mapMatchedRevisions(t,n.characterFormat,e instanceof Xai?e:i.characterFormat,!1),!0}return!1},c.prototype.combineRevisionWithNextPara=function(e,t){var i=e.line.isLastLine(),n=e.nextNode;return!(!i||!je(n))&&this.checkToCombineRevisionWithNextPara(e,t)},c.prototype.combineRevisionWithPrevPara=function(e,t){var i=e.line.isFirstLine(),n=e.previousNode;return!(!i||!je(n))&&this.checkToCombineRevisionWithPrevPara(e,t)},c.prototype.removeRevision=function(e){var t=this.selection.start.currentWidget.getInline(this.selection.start.offset+1,0),i=t.element;if(0<t.element.revisions.length)for(var n=0;n<i.revisions.length;n++)if(i.revisions[n].revisionType===e.revisionType)for(var o=i.revisions[n],r=o.range.indexOf(i),s=r;r<o.range.length;r++)o.range[s].revisions.splice(n,1),o.range.splice(s,1),this.owner.trackChangesPane.updateCurrentTrackChanges(o)},c.prototype.clearElementRevision=function(e){if(!je(e))for(var t,i=0;i<e.range.length;i++)e.range[i]instanceof Xai&&((t=e.range[i]).revisions.splice(t.revisions.length-1,1),e.range.splice(i,1),this.owner.trackChangesPane.updateCurrentTrackChanges(e))},c.prototype.insertRevision=function(e,t,i,n,o,r,s){if(!this.isRemoteAction||!je(this.revisionData)||this.documentHelper.owner.parser.isPaste){!je(this.revisionData)&&0<this.revisionData.length&&(i=(a=this.revisionData.pop()).author,n=a.date,a=a.revisionId),je(s)||(a=s),i=je(i)?this.owner.currentUser||"Guest user":i;var a,s=je(n)?Y.getUtcDate():n;if(e instanceof Xai&&!je(e.line)&&e.line.paragraph.associatedCell||e instanceof Eri&&e.ownerBase instanceof Lai&&e.ownerBase.associatedCell){n=void 0;if(e instanceof Xai?n=e.line.paragraph.associatedCell:e instanceof Eri&&(n=e.ownerBase.associatedCell),0<n.ownerRow.rowFormat.revisions.length){var n=n.ownerRow.rowFormat,l=this.getMatchedRevisionsToCombine(n.revisions,t);if(0<l.length){!je(this.editorHistory)&&this.editorHistory.currentBaseHistoryInfo&&0===this.editorHistory.currentBaseHistoryInfo.markerData.length&&this.editorHistory.currentBaseHistoryInfo.markerData.push(this.getMarkerData(void 0,void 0,l[0]));for(var h=0;h<l.length;h++)e.revisions.splice(0,0,l[h]),l[h].range.push(e);return}}}n=new Ari(this.owner,i,s);return n.revisionType=t,this.owner.enableCollaborativeEditing&&this.isRemoteAction&&!je(a)&&""!=a?n.revisionID=a:n.revisionID=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),this.owner.enableCollaborativeEditing&&!je(this.getRevision(n.revisionID))&&(n=this.getRevision(n.revisionID)),!je(o)&&0<o.length&&this.clearAndUpdateRevisons(o,n,o.indexOf(e)),je(e)||(-1===e.revisions.indexOf(n)&&e.revisions.push(n),je(o)?n.range.push(e):-1===n.range.indexOf(e)&&n.range.splice(0,0,e)),this.isRemoteAction&&this.documentHelper.owner.parser.isPaste?this.remotePasteRevision.push(n):0<n.range.length&&this.updateRevisionCollection(n),je(e)||(e instanceof fli&&this.insertRevisionForFootnoteWidget(e,n),this.owner.enableCollaborativeEditing&&!je(this.editorHistory)&&this.editorHistory.currentBaseHistoryInfo&&!r&&this.editorHistory.currentBaseHistoryInfo.markerData.splice(0,0,this.getMarkerData(e,void 0,n))),n}},c.prototype.insertRevisionForFootnoteWidget=function(e,t){var i=e.bodyWidget.childWidgets;this.skipFootNoteDeleteTracking=!0,this.footnoteRevision=t;for(var n=0;n<i.length;n++)this.insertRevisionForBlock(i[n],t.revisionType,!1,t);this.footnoteRevision=void 0,this.skipFootNoteDeleteTracking=!1},c.prototype.clearAndUpdateRevisons=function(e,t,i,n){for(var o,r,s=0,a=0;a<e.length;a++)(e[a]instanceof Xai||e[a]instanceof Eri)&&(r=!1,(o=e[a])instanceof pli&&""===o.text?o.revisions.splice(o.revisions.length-1,1):(o.revisions[o.revisions.length-1].range===e&&(o.revisions[o.revisions.length-1].range.splice(o.revisions.length-1,1),r=!0,this.owner.trackChangesPane.updateCurrentTrackChanges(o.revisions[o.revisions.length-1])),o.revisions.splice(o.revisions.length-1,1),o.revisions.push(t),t.range.splice(n?s:i+s,0,o),this.owner.trackChangesPane.updateCurrentTrackChanges(t),r&&a--,s++))},c.prototype.splitRevisionByElement=function(e,t){var i;if(0<e.revisions.length)return e=(i=t.range).indexOf(e),t.range=i.splice(0,e+1),this.owner.trackChangesPane.updateCurrentTrackChanges(t),i},c.prototype.updateRevisionForSpittedTextElement=function(e,t){!je(this.editorHistory)&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.splittedRevisions=[]);for(var i=0;i<e.revisions.length;i++){var n=e.revisions[i],o=this.splitRevisionByElement(e,n),n=(t&&t instanceof pli&&""===t.text&&(t=void 0),this.insertRevision(t,n.revisionType,n.author,n.date,o,!0));this.isRemoteAction||this.editorHistory.currentBaseHistoryInfo.splittedRevisions.push(this.getMarkerData(void 0,void 0,this.getRevision(n.revisionID)))}},c.prototype.getRevision=function(e){for(var t=0;t<this.owner.documentHelper.revisionsInternal.length;t++){var i=this.owner.documentHelper.revisionsInternal.keys[t];if(i===e)return this.owner.documentHelper.revisionsInternal.get(i)}},c.prototype.isRevisionMatched=function(e,t){var i=this.owner.currentUser||"Guest user";if(e instanceof Ari){if((je(t)||t===e.revisionType)&&e.author===i)return!0}else if(0<e.revisions.length)for(var n=0;n<e.revisions.length;n++){var o=e.revisions[n];if((je(t)||t===o.revisionType)&&o.author===i)return!0}return!1},c.prototype.compareElementRevision=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],o=0;o<t.revisions.length;o++)if(n.author===t.revisions[o].author&&n.revisionType===t.revisions[o].revisionType)return!0;return!1},c.prototype.canInsertRevision=function(e,t){t=je(t)?"Insertion":t;return"Deletion"!==t&&(this.owner.enableTrackChanges?this.isRevisionMatched(e,t):!(0<e.revisions.length))},c.prototype.insertRevisionAtEnd=function(e,t,i){return!(t instanceof Dli||t instanceof Khi||t instanceof ghi||t instanceof phi||je(e=e.previousValidNodeForTracking))&&this.insertRevisionAtPosition(e,t,!0,i)},c.prototype.insertRevisionAtPosition=function(e,t,i,n){var o=t.revisions.length,r=this.checkToMapRevisionWithInlineText(e,i?e.length:0,t,!1,n);return i?r||t.revisions.length!==o||(r=this.checkToMapRevisionWithNextNode(e.nextNode,t,!1,n)):r||t.revisions.length!==o||(r=this.checkToMapRevisionWithPreviousNode(e.previousNode,t,!1,n)),r},c.prototype.insertRevisionAtBegining=function(e,t,i){return!(t instanceof Dli||t instanceof Khi||t instanceof ghi||t instanceof phi||je(e=e.nextValidNodeForTracking))&&this.insertRevisionAtPosition(e,t,!1,i)},c.prototype.splitRevisionForSpittedElement=function(e,t){for(var i=e.revisions.length-1;0<=i;i--){var n=e.revisions[i],o=this.splitRevisionByElement(e,n);this.insertRevision(t,n.revisionType,n.author,n.date,o)}},c.prototype.combineElementRevisionToPrevNxt=function(e){0<e.revisions.length&&e.nextNode instanceof Xai&&0<e.nextNode.revisions.length&&this.combineElementRevision(e.revisions,e.nextNode.revisions)},c.prototype.combineElementRevision=function(e,t,i){for(var n=0;n<e.length;n++)for(var o=0;o<t.length;o++){var r=e[n],s=t[o];if(r===s)break;if(r.author===s.author&&r.revisionType===s.revisionType){for(var a=s.range.length,l=0;l<a;l++){var h=s.range[0],d=(h.revisions.splice(h.revisions.indexOf(s),1),s.range.splice(0,1),this.owner.trackChangesPane.updateCurrentTrackChanges(s),-1),p=(i&&(h instanceof pli&&0===h.indexInOwner&&0===h.line.indexInOwner&&!je(h.paragraph.previousWidget)&&h.paragraph.previousWidget instanceof Lai?d=r.range.indexOf(h.paragraph.previousWidget.characterFormat):h instanceof pli&&0!==h.indexInOwner&&!je(h.previousElement)?d=r.range.indexOf(h.previousElement):h instanceof Eri&&!h.ownerBase.isEmpty()&&(p=h.ownerBase.lastChild.children[h.ownerBase.lastChild.children.length-1],d=r.range.indexOf(p))),-1!==d?r.range.splice(d+1,0,h):i?r.range.splice(l,0,h):r.range.push(h),void 0);je(r)||(p=this.owner.trackChangesPane.changes.get(r)),je(p)&&0<r.range.length&&this.updateRevisionCollection(r),this.owner.trackChangesPane.updateCurrentTrackChanges(r),h.revisions.push(r)}0===s.range.length&&(this.owner.revisions.remove(s),this.editorHistory)&&this.editorHistory.currentBaseHistoryInfo&&this.removeMarkerInfoRevision(s.revisionID,this.editorHistory.currentBaseHistoryInfo.markerData)}}},c.prototype.removeMarkerInfoRevision=function(e,t){for(var i=0;i<t.length;i++)je(t[i].revisionId)||t[i].revisionId!==e||t.splice(t.indexOf(t[i]),1)},c.prototype.combineRevisions=function(e,t,i){var n,o;this.owner.enableTrackChanges&&0<(e=this.selection.getLineInfo(e,t.offset).line.getInline(t.offset,0).element).revisions.length&&this.isRevisionMatched(e,"Insertion")&&!je(t=e.nextElement)&&0<t.revisions.length&&(n=e.revisions[e.revisions.length-1],o=t.revisions[t.revisions.length-1].range,n!==t.revisions[t.revisions.length-1])&&this.clearAndUpdateRevisons(o,n,n.range.indexOf(e)+1)},c.prototype.insertRevisionForBlock=function(e,t,i,n,o,r,s){var a=!1;if(0!==e.childWidgets.length&&this.owner.enableTrackChanges)if("Deletion"!==t||this.editorHistory.isUndoing){var l=!1;je(n)&&(g=this.owner.currentUser||"Guest user",(n=new Ari(this.owner,g,Y.getUtcDate())).revisionID=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),n.revisionType=t);for(I=0;I<e.childWidgets.length;I++){var h,d,p=e.childWidgets[I].children;0!==p.length||je(e.containerWidget)||(h=void 0,!je(h=0<(d=e.containerWidget.childWidgets.indexOf(e))?e.containerWidget.childWidgets[d-1]:h)&&h instanceof Lai&&0<h.characterFormat.revisions.length&&this.isRevisionMatched(h.characterFormat,t)&&0<(d=this.getMatchedRevisionsToCombine(h.characterFormat.revisions,t)).length&&(this.mapMatchedRevisions(d,h.characterFormat,e.characterFormat,!1),l=!0,n=void 0));for(var c,u=0;u<p.length;u++)0===u&&!i&&(c=p[I].revisions.length,this.checkToCombineRevisionsinBlocks(p[I],!0,!1,"Insertion"),p[I].revisions.length>c)?n=p[I].revisions[p[I].revisions.length-1]:(p[u].revisions.push(n),n.range.push(p[u]))}l||(e.characterFormat.revisions.push(n),n.range.push(e.characterFormat)),je(n)||(this.owner.trackChangesPane.updateCurrentTrackChanges(n),this.updateRevisionCollection(n))}else{var g=this.selection.editPosition,m=this.selection.start.clone(),f=this.selection.end.clone(),y=(this.documentHelper.layout.clearListElementBox(e),e==this.getLastParaForBodywidgetCollection(e)),v=this.selection.getNextParagraphBlock(e),b=this.selection.getParagraphInfo(this.selection.start),w=this.selection.getParagraphInfo(this.selection.end),C=this.selection.getHierarchicalIndex(b.paragraph,b.offset.toString()),S=this.selection.getHierarchicalIndex(w.paragraph,w.offset.toString()),A=!1,x=!1;(x=(y=e.isInsideTable&&e==this.selection.getLastParagraph(e.associatedCell)?!0:y)||je(v)&&e.isEmpty()||r?x:!0)&&(je(v)||v.isInsideTable||e.bodyWidget.sectionIndex===v.bodyWidget.sectionIndex||this.addRemovedNodes(e.bodyWidget),je(this.owner.editorHistoryModule)||je(this.owner.editorHistoryModule.currentBaseHistoryInfo)||this.owner.editorHistoryModule.currentBaseHistoryInfo.recordInsertRevisionDeletetion(e),s||(this.addRemovedNodes(e.clone()),A=this.handleDeleteParaMark(e,void 0)));for(var I=e.childWidgets.length-1;-1<I;I--){var T=e.childWidgets[I];this.removeContent(T,0,this.documentHelper.selection.getLineLength(T),void 0,!!s||!r&&!y)}x&&(A=s?this.handleDeleteParaMark(e,void 0):A)&&e.isEmpty()&&(a=!0,this.removeBlock(e)),je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||(e.isEmpty()&&this.selection.end.paragraph===e&&y?this.editorHistory.currentBaseHistoryInfo.endRevisionLogicalIndex=this.selection.endOffset:A&&(this.editorHistory.currentBaseHistoryInfo.endRevisionLogicalIndex=void 0));for(var E=e.lastChild;0==E.children.length&&!je(E.previousLine);)E=E.previousLine;0<E.children.length&&(v=E.children[E.children.length-1],this.combineElementRevision(e.characterFormat.revisions,v.revisions,!s)),this.selection.editPosition=g,this.selection.start.setPositionInternal(m),this.selection.end.setPositionInternal(f),this.removeEmptyLine(e),o||je(e.containerWidget)||(this.documentHelper.layout.reLayoutParagraph(e,0,0),-1===this.selection.start.currentWidget.indexInOwner&&-1!==b.paragraph.indexInOwner&&(x=this.selection.getTextPosBasedOnLogicalIndex(C),this.selection.start.setPositionInternal(x)),-1===this.selection.end.currentWidget.indexInOwner&&-1!==w.paragraph.indexInOwner&&(A=this.selection.getTextPosBasedOnLogicalIndex(S),this.selection.end.setPositionInternal(A)))}return a},c.prototype.getLastParaForBodywidgetCollection=function(e){var t=e.containerWidget;return t.containerWidget instanceof Pai?t.childWidgets[t.childWidgets.length-1]:e.isInsideTable&&e.associatedCell?e.associatedCell.lastChild:(e=(t=this.documentHelper.pages[this.documentHelper.pages.length-1]).bodyWidgets[t.bodyWidgets.length-1]).childWidgets[e.childWidgets.length-1]},c.prototype.updatePasteRevision=function(){for(var e=0;e<this.remotePasteRevision.length;e++)this.owner.revisions.changes.indexOf(this.remotePasteRevision[e])<0?this.updateRevisionCollection(this.remotePasteRevision[e]):this.owner.trackChangesPane.updateCurrentTrackChanges(this.remotePasteRevision[e]);this.remotePasteRevision=[]},c.prototype.updateRevisionCollection=function(e){var t=!1,i=void 0;if(this.owner.revisions.changes.indexOf(e)<0){if(this.documentHelper.revisionsInternal.containsKey(e.revisionID)||this.documentHelper.revisionsInternal.add(e.revisionID,e),0<this.owner.revisions.changes.length)for(var n=this.owner.selection.isForward?this.owner.selectionModule.start:this.owner.selectionModule.end,o=0;o<this.owner.revisions.changes.length;o++){var r=this.owner.revisions.changes[o].range[0];if(r instanceof Xai&&!je(r.line)&&r.line.paragraph.bodyWidget){var s=this.owner.revisions.changes[o].range[0];r instanceof mdi&&0<r.paragraph.containerWidget.footNoteReference.revisions.length&&(s=r.paragraph.containerWidget.footNoteReference),i=this.selection.getElementPosition(s).startPosition}else if(r instanceof Cri){var a=r.ownerBase,l=a.childWidgets[0];if(0===l.childWidgets.length)for(var h=1;h<a.childWidgets.length;h++)if(0<a.childWidgets[h].childWidgets.length){l=a.childWidgets[h];break}var d,s=void 0;this.selection.getFirstParagraph(l).bodyWidget&&(je((d=this.documentHelper.selection).editPosition)||(s=d.editPosition),this.updateEditPosition(l,d),i=this.selection.getTextPosBasedOnLogicalIndex(d.editPosition),je(s)||this.selection.start.paragraph.isInsideTable||(d.editPosition=s))}else r instanceof Eri&&(d=r.ownerBase).lastChild&&d.lastChild.paragraph.bodyWidget&&(p=d.getLength(),(c=new rci(this.owner)).setPositionParagraph(d.lastChild,p),i=c);if(this.footnoteRevision===this.owner.revisions.changes[o]){var p=this.owner.revisions.changes.indexOf(this.footnoteRevision),t=!0;this.owner.revisions.changes.splice(p+1,0,e);var c=(g=new _si(this.owner,this.owner.trackChangesPane)).createSingleChangesDiv(e),u=this.owner.trackChangesPane.changes.get(this.footnoteRevision).outerSingleDiv.nextSibling;u?this.owner.trackChangesPane.changesInfoDiv.insertBefore(c,u):this.owner.trackChangesPane.changesInfoDiv.appendChild(c),this.owner.trackChangesPane.revisions.splice(p+1,0,e),this.owner.trackChangesPane.changes.add(e,g),this.owner.trackChangesPane.renderedChanges.add(e,g);break}if(!je(i)&&!je(n)){u=this.selection.start.paragraph.isInsideTable&&this.selection.end.paragraph.isInsideTable&&this.selection.start.paragraph.associatedCell!==this.selection.end.paragraph.associatedCell;if(!(!n.isExistBefore(i)||e.range[0]instanceof Cri||u)){t=!0,this.owner.revisions.changes.splice(o,0,e);var g=new _si(this.owner,this.owner.trackChangesPane);this.owner.trackChangesPane.changesInfoDiv.insertBefore(g.createSingleChangesDiv(e),this.owner.trackChangesPane.changesInfoDiv.children[o+1]),this.owner.trackChangesPane.revisions.splice(o,0,e),this.owner.trackChangesPane.changes.add(e,g),this.owner.trackChangesPane.renderedChanges.add(e,g);break}if(e.range[0]instanceof Cri&&r instanceof Cri&&e.range[0].ownerBase.containerWidget===r.ownerBase.containerWidget&&e.range[0].ownerBase.index===r.ownerBase.index){t=!0,this.owner.revisions.changes.splice(o-e.range[0].ownerBase.indexInOwner,0,e);break}if(!je(i)&&!je(n)&&(n.isExistBefore(i)||n.isAtSamePosition(i)||n.paragraph.isInsideTable&&i.paragraph.isInsideTable&&n.paragraph.associatedCell===i.paragraph.associatedCell)){if(r instanceof Cri&&e.range[0]instanceof Cri&&r.ownerBase.containerWidget===e.range[0].ownerBase.containerWidget){if(r.ownerBase.index-1===e.range[0].ownerBase.index){this.owner.revisions.changes.splice(o,0,e),t=!0;break}this.owner.revisions.changes.splice(o+e.range[0].ownerBase.indexInOwner,0,e),t=!0;break}if(e.range[0]instanceof Cri){this.owner.revisions.changes.splice(o,0,e),t=!0;break}}}}t||(this.owner.revisions.changes.push(e),e.range[0]instanceof Cri)||(g=new _si(this.owner,this.owner.trackChangesPane),this.owner.trackChangesPane.changesInfoDiv.appendChild(g.createSingleChangesDiv(e)),this.owner.trackChangesPane.revisions.push(e),this.owner.trackChangesPane.changes.add(e,g),this.owner.trackChangesPane.renderedChanges.add(e,g)),this.documentHelper.updateAuthorIdentity()}},c.prototype.insertSection=function(e,t,i,n,o,r){var s,a,l,h,d=this.selection.start.paragraph;if(!n||i||d.isInsideTable||0!==e.start.offset||e.start.currentWidget!==d.firstChild||je(d.previousRenderedWidget)||!(d.previousRenderedWidget instanceof Lai)||!d.previousRenderedWidget.isEndsWithPageBreak)return d=je(r)?this.selection.start.paragraph.bodyWidget.sectionFormat.cloneFormat():r,e.start.paragraph.isInsideTable?(r=(r=this.documentHelper.layout.getParentTable(e.start.paragraph)).combineWidget(this.owner.viewer),l=!1,0===e.start.paragraph.associatedCell.rowIndex&&(l=!0),h=new Lai,a=r.previousRenderedWidget,s=l?r:(s=this.splitTable(r,e.start.paragraph.associatedCell.ownerRow),this.documentHelper.layout.layoutBodyWidgetCollection(s.index,s.containerWidget,s,!1),s.getSplitWidgets().pop()),r=0,!je(a)&&a.bodyWidget.equals(s.bodyWidget)||!l?(r=s.indexInOwner+1,h.index=s.index+1):h.index=r=0,s.containerWidget.childWidgets.splice(r,0,h),h.containerWidget=s.containerWidget,this.updateNextBlocksIndex(h,!0),this.documentHelper.layout.layoutBodyWidgetCollection(h.index,h.containerWidget,h,!1),s=h):(a=this.selection.getParagraphInfo(e.start),l=this.selection.getHierarchicalIndex(a.paragraph,a.offset.toString()),i||this.splitParagraphInternal(e,e.start.paragraph,e.start.currentWidget,e.start.offset,e.start.paragraph.characterFormat),this.setPositionForCurrentIndex(e.start,l),s=e.start.paragraph.getSplitWidgets().pop(),i&&void 0!==s.previousRenderedWidget&&(s=s.previousRenderedWidget)),r=this.splitBodyWidget(s.bodyWidget,d,s,n,o).firstChild,h=s.previousWidget,s instanceof Lai&&s.isEmpty()&&h instanceof Lai&&(s.isSectionBreak=!0,this.documentHelper.layout.reLayoutParagraph(s,0,0)),r instanceof _ai&&r.updateRowIndex(0),this.documentHelper.layout.layoutBodyWidgetCollection(r.index,r.containerWidget,r,!1),r instanceof _ai&&(r=this.documentHelper.getFirstParagraphInFirstCell(r)),t&&e.selectParagraphInternal(r,!0),r;this.selection.start.paragraph.bodyWidget.sectionFormat.breakCode="NoBreak",this.selection.start.paragraph.index=0,this.updateNextBlocksIndex(this.selection.start.paragraph,!0),this.updateSectionIndex(this.selection.start.paragraph.bodyWidget.sectionFormat,this.selection.start.paragraph.bodyWidget,!0),this.selection.moveToNextParagraph(),this.editorHistory.currentBaseHistoryInfo.insertPosition=void 0,this.updateInsertPosition()},c.prototype.splitBodyWidget=function(e,t,i,n,o){var r=!0,s=this.documentHelper.layout.moveBlocksToNextPage(i,!0,void 0,n);if((this.editorHistory.isUndoing||this.editorHistory.isRedoing&&!je(t.ownerBase))&&(i.bodyWidget.sectionFormat=t),void 0===s.page)s.page=e.page,e.page.bodyWidgets.splice(e.page.bodyWidgets.indexOf(e)+1,0,s);else if(1<e.page.bodyWidgets.length&&void 0!==s.page&&!this.editorHistory.isUndoing){for(i=s;!je(e.nextRenderedWidget)&&s!==e.nextRenderedWidget;){var a=e.nextRenderedWidget.page.bodyWidgets.indexOf(e.nextRenderedWidget);s.page.bodyWidgets.push(e.nextRenderedWidget),e.nextRenderedWidget.page.bodyWidgets.splice(a,1)}for(;!je(s.nextRenderedWidget);)s.nextRenderedWidget.page=s.page,s=s.nextRenderedWidget;(s=i).sectionFormat=new ari(s),1<t.numberOfColumns&&(this.viewer.owner.parser.parseSectionFormat(0,e.sectionFormat,s.sectionFormat),r=!1),s.sectionFormat.breakCode="NewPage"}return n&&(1<t.numberOfColumns&&r?(s.sectionFormat=t,this.viewer.owner.parser.parseSectionFormat(0,e.sectionFormat,s.sectionFormat)):(s.sectionFormat=new ari(s),(1<t.numberOfColumns||!je(e.page)&&!je(e.page.nextPage)&&this.documentHelper.getPageWidth(e.page)!==this.documentHelper.getPageWidth(e.page.nextPage))&&this.viewer.owner.parser.parseSectionFormat(0,e.sectionFormat,s.sectionFormat)),s.sectionFormat.breakCode="NoBreak"),o&&(1<t.numberOfColumns&&r?s.sectionFormat=t:s.sectionFormat=new ari(s),this.viewer.owner.parser.parseSectionFormat(0,e.sectionFormat,s.sectionFormat),s.sectionFormat.breakCode="NewPage"),this.updateSectionIndex(s.sectionFormat,s,!0),1<s.sectionFormat.numberOfColumns&&this.updateColumnIndex(s,!1),this.editorHistory&&!this.editorHistory.isUndoing&&this.insertRemoveHeaderFooter(s.sectionIndex,!0),this.updateBlockIndex(0,s.firstChild),this.owner.viewer.updateClientArea(s,s.page),s},c.prototype.insertRemoveHeaderFooter=function(e,t){this.documentHelper.headersFooters[e]?this.documentHelper.headersFooters.splice(e,0,{}):this.documentHelper.headersFooters[e]={}},c.prototype.updateBlockIndex=function(e,t){var i=t.bodyWidget.sectionIndex;do{for(var n=t.getSplitWidgets(),o=0;o<n.length;o++)n[o].index=e}while(e++,!je(t=n.pop().nextRenderedWidget)&&t.bodyWidget.sectionIndex===i)},c.prototype.updateSectionIndex=function(e,t,i){for(var n=t.sectionIndex,o=t;o.index===n&&e&&(o.sectionFormat=e),i?o.index++:o.index--,o=o.nextRenderedWidget;);},c.prototype.updateColumnIndex=function(e,t){for(var i=e;(t||0!==i.columnIndex)&&(t?i.columnIndex++:i.columnIndex--,je(i.nextRenderedWidget)||i.sectionIndex===i.nextRenderedWidget.sectionIndex)&&(i=i.nextRenderedWidget););},c.prototype.checkAndConvertList=function(e,t){if(!je(e.paragraphFormat.getList())||e.start.paragraph.containerWidget instanceof Pai)return!1;var i=!1,n=!1,o=e.start.currentWidget.getInline(e.start.offset-1,0),r=o.element,o=o.index;if(!(r instanceof pli))return!1;for(var s=(d=r).text.substring(0,o),a=0,l=0;!je(d.previousNode);){if(!(d.previousNode instanceof pli)||"\t"!==d.previousNode.text&&0!==d.previousNode.text.trim().length)return!1;"\t"===d.previousNode.text?a+=36:l=2.5*d.previousNode.text.length,d=d.previousNode}d=r;var h=0;for(h=0<=(p=s.lastIndexOf("\t"))?p+1:s.lastIndexOf(" ")+1;d.previousNode instanceof pli&&0===h;){var d,p,c=(d=d.previousNode).text,h=0<=(p=c.lastIndexOf("\t"))?p+1:c.lastIndexOf(" ")+1;s=(s=d.text+s).substring(h)}var u,g=(s=Y.trimStart(s)).substring(1,2),m=void 0,f=this.getListLevelPattern(s.substring(0,1));return"None"!==f&&this.checkNumberFormat(g,"Bullet"===f,s)?(m=this.checkNextLevelAutoList(s),i=!0):this.checkLeadingZero(s)?i=n=!0:je(m=this.checkNextLevelAutoList(s))||(i=!0),(i=!i||"Bullet"!==f||"- "!==r.text||je(r.paragraph.previousWidget)||r.paragraph.previousWidget.firstChild.children[0]instanceof lhi?i:!1)&&(this.initComplexHistory("AutoList"),u=r.paragraph,e.start.setPositionParagraph(u.childWidgets[0],u.childWidgets[0].getOffset(r,o+1)),e.end.setPositionParagraph(u.childWidgets[0],0),this.initHistory("Delete"),this.deleteSelectedContents(e,!1),this.reLayout(e,!1),r=t?"Tab":"Space",g=n?"%1"+s.substring(s.length-1,s.length):"%1"+g,u=s.substring(s.length-3,s.length-1),f=n?this.getListLevelPattern(u):f,"Bullet"===((t=new rsi(void 0)).listLevelPattern=f)?"*"===s?(t.numberFormat=String.fromCharCode(61623),t.characterFormat.fontFamily="Symbol"):"-"===s&&(t.numberFormat="-"):t.numberFormat=g,t.followCharacter=r,f=e.paragraphFormat.leftIndent,t.paragraphFormat.leftIndent=0!==a||0!==l?f+18+a+l:2<o?f+2.5*(o-2)+18:0<f?f+18:36,t.paragraphFormat.firstLineIndent=-18,!n&&"0"===s.substring(0,1)||"00"===u?t.startAt=0:t.startAt=1,je(m)?this.autoConvertList(e,t):e.paragraphFormat.setList(m),this.editorHistory&&!je(this.editorHistory.currentHistoryInfo)?this.editorHistory.updateComplexHistory():this.reLayout(e)),i},c.prototype.checkNextLevelAutoList=function(e){for(var t=this.documentHelper.selection,i=void 0,n=!1,o=t.start.paragraph,r=t.getPreviousParagraphBlock(o);!je(r)&&r instanceof Lai;){if(r.paragraphFormat.listFormat&&-1!==r.paragraphFormat.listFormat.listId){var s=r.paragraphFormat.listFormat.listLevelNumber;if(n=this.isConvertList(e,r)){this.listLevelNumber=s,this.isAutoList=!0;break}if("*"===e||"-"===e){n=this.isAutoList=!0;break}}r=t.getPreviousParagraphBlock(r,!0)}return i=n?this.documentHelper.getListById(r.paragraphFormat.listFormat.listId):i},c.prototype.isConvertList=function(e,t){var i=!1,t=this.documentHelper.layout.getListNumber(t.paragraphFormat.listFormat,!0),n=t.substring(0,t.length-1),o=e.substring(0,e.length-1);return t.substring(t.length-1)!==e.substring(e.length-1)?i=!1:o.match(/^[0-9]+$/)&&n.match(/^[0-9]+$/)?(t=parseInt(o,10),parseInt(n,10)!==t&&parseInt(n,10)+1!==t&&parseInt(n,10)+2!==t||(i=!0)):o.match(/^[a-zA-Z]+$/)&&n.match(/^[a-zA-Z]+$/)&&(n.charCodeAt(0)===e.charCodeAt(0)||n.charCodeAt(0)+1===e.charCodeAt(0)||n.charCodeAt(0)+2===e.charCodeAt(0)?i=!0:o.match(/^[MDCLXVImdclxvi]+$/)&&n.match(/^[MDCLXVImdclxvi]+$/)&&((t=this.getNumber(n.toUpperCase()))!==(e=this.getNumber(o.toUpperCase()))&&t+1!==e&&t+2!==e||(i=!0))),i},c.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,o=0;o<i.length;o++){var r=t[i[o]];r<t[i[o+1]]?n-=r:n+=r}return n},c.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"}},c.prototype.autoConvertList=function(e,t){e.start;e.isForward||e.end;var i=new xpi,n=(0<this.documentHelper.lists.length?i.listId=this.documentHelper.lists[this.documentHelper.lists.length-1].listId+1:i.listId=0,new tsi),o=this.documentHelper;0<o.abstractLists.length?n.abstractListId=o.abstractLists[o.abstractLists.length-1].abstractListId+1:n.abstractListId=0,i.abstractListId=n.abstractListId,i.abstractList=n,i.nsid=n.nsid=Y.generateUniqueId(o.lists),o.abstractLists.push(n),n.levels.push(t),t.ownerBase=n,e.paragraphFormat.setList(i),e.paragraphFormat.listLevelNumber=0},c.prototype.checkNumberFormat=function(e,t,i){return t?""===e:(t=i.indexOf(e),("."===e||")"===e||">"===e||"-"===e)&&""===i.substring(t,i.length-1))},c.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 o=void 0,o="1"===e.charAt(t)?e.charAt(t+1):e.charAt(t);return i&&this.checkNumberFormat(o,!1,e)},c.prototype.getPageFromBlockWidget=function(e){var t=void 0;return e.containerWidget instanceof Sai||e.containerWidget instanceof Iai?t=e.containerWidget.page:e.containerWidget instanceof Uai&&(t=e.containerWidget.bodyWidget.page),t},c.prototype.insertTextInline=function(e,t,i,n,o){var r,s,a;e instanceof pli?(e.text=Y.insert(e.text,n,i),e.isWidthUpdated=!1,this.owner.enableTrackChanges&&(r=e.revisions[0],je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||this.editorHistory.currentBaseHistoryInfo.markerData.push(this.getMarkerData(void 0,void 0,r)),this.owner.trackChangesPane.updateCurrentTrackChanges(r)),s=(r=e.line.paragraph).childWidgets.indexOf(e.line),a=e.line.children.indexOf(e),e instanceof pli&&90<e.text.length&&Y.splitWordByMaxLength(e,e.line),!je(o)&&o||this.documentHelper.layout.reLayoutParagraph(r,s,a,e.line.paragraph.bidi)):e instanceof rhi?this.insertImageText(e,t,i,n):e instanceof Zai?0===e.fieldType?this.insertFieldBeginText(e,t,i,n):2===e.fieldType?this.insertFieldSeparatorText(e,t,i,n):this.insertFieldEndText(e,t,i,n):(e instanceof Dli||e instanceof ghi||e instanceof phi)&&this.insertBookMarkText(e,i)},c.prototype.insertFieldBeginText=function(e,t,i,n){var o=new pli,i=(o.text=i,e.line.paragraph.childWidgets.indexOf(e.line)),r=e.line.children.indexOf(e);this.owner.enableCollaborativeEditing&&this.isRemoteAction&&r++,o.characterFormat.copyFormat(e.characterFormat),e.line.children.splice(r,0,o),o.line=e.line,this.documentHelper.layout.reLayoutParagraph(e.line.paragraph,i,r)},c.prototype.insertBookMarkText=function(e,t){var i=new pli,t=(i.text=t,e.line.paragraph.childWidgets.indexOf(e.line)),n=e.line.children.indexOf(e);i.characterFormat.copyFormat(e.characterFormat),e.line.children.splice(n+1,0,i),i.line=e.line,this.documentHelper.layout.reLayoutParagraph(e.line.paragraph,t,n)},c.prototype.insertFieldSeparatorText=function(e,t,i,n){var o=t.getPreviousTextInline(e),t=t.getNextTextInline(e),r=new pli,i=(r.text=i,e.line.children.indexOf(e)),t=(n===e.length&&i++,je(o)&&je(t)?r.characterFormat.copyFormat(e.line.paragraph.characterFormat):je(o)?r.characterFormat.copyFormat(t.characterFormat):this.owner.enableCollaborativeEditing&&this.isRemoteAction?(n=this.getCharacterFormat(this.selection),r.characterFormat.copyFormat(n)):r.characterFormat.copyFormat(o.characterFormat),e.line.children.splice(i,0,r),r.line=e.line,e.line.paragraph.childWidgets.indexOf(e.line));this.documentHelper.layout.reLayoutParagraph(e.line.paragraph,t,i)},c.prototype.insertFieldEndText=function(e,t,i,n){var o=new pli,r=(o.text=i,e.line.children.indexOf(e)),t=(o.characterFormat.copyFormat(e.characterFormat),t.isInlineFormFillMode()&&0==n?e.line.children.splice(r,0,o):e.line.children.splice(r+1,0,o),o.line=e.line,e.line.paragraph.childWidgets.indexOf(e.line));this.owner.enableTrackChanges&&(i=this.documentHelper.textHelper.getRtlLanguage(i).isRtl,this.checkToMapRevisionWithInlineText(e,n,o,i,"Insertion")||0!==o.revisions.length||this.checkToMapRevisionWithNextNode(e.nextNode,o,i,"Insertion")),this.documentHelper.layout.reLayoutParagraph(e.line.paragraph,t,r)},c.prototype.insertImageText=function(e,t,i,n){var o=t.getPreviousTextInline(e),t=t.getNextTextInline(e),r=e.line,s=new pli,a=r.paragraph,l=a.childWidgets.indexOf(r),i=(s.text=i,r.children.indexOf(e));n===e.length&&i++,je(o)&&je(t)?s.characterFormat.copyFormat(a.characterFormat):je(o)?s.characterFormat.copyFormat(t.characterFormat):s.characterFormat.copyFormat(o.characterFormat),r.children.splice(i,0,s),s.line=r,this.documentHelper.layout.reLayoutParagraph(a,l,i)},c.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)},c.prototype.checkAndConvertToHyperlink=function(e,t,i){if(t)l=(s=i.lastChild.children[i.lastChild.children.length-1]).text;else{var i=e.start.currentWidget.getInline(e.start.offset-1,0),n=i.element,i=i.index;if(!(n instanceof pli))return;l=(s=n).text.substring(0,i)}var o=0,r=l.lastIndexOf("\t");for(o=0<=r?r+1:l.lastIndexOf(" ")+1;s.previousElement instanceof pli&&0===o;)var s,a=(s=s.previousNode).text,o=0<=(r=a.lastIndexOf("\t"))?r+1:a.lastIndexOf(" ")+1,l=s.text+l;var h,n=(l=l.substring(o)).toLowerCase(),i=!1;"file:///"===n.substring(0,8)||"http://"===n.substring(0,7)&&7<n.length||"https://"===n.substring(0,8)&&8<n.length||"www."===n.substring(0,4)&&4<n.length||"\\"===n.substring(0,3)&&3<n.length||"mailto:"===n.substring(0,7)&&7<n.length?(i=!0,"www."===n.substring(0,4)&&4<n.length&&(l="http://"+l)):(n=l.indexOf("@"),h=l.lastIndexOf("."),0<n&&n<h&&h<l.length-1&&(i=!0,l="mailto:"+l)),i&&((n=new rci(this.documentHelper.owner)).setPositionParagraph(s.line,s.line.getOffset(s,o)),h=new rci(this.documentHelper.owner),t?h.setPositionParagraph(s.line,s.line.getEndOffset()):0===e.end.currentWidget.children.length&&0===e.end.offset?(i=e.end.currentWidget.previousLine,h.setPositionParagraph(i,i.getEndOffset())):h.setPositionParagraph(e.end.currentWidget,e.end.offset-1),this.autoFormatHyperlink(e,l,n,h))},c.prototype.autoFormatHyperlink=function(e,t,i,n){var o,r,s,a;this.owner.enableCollaborativeEditing&&this.isRemoteAction||(this.initComplexHistory("AutoFormatHyperlink"),o=this.selection.getParagraphInfo(i),r=this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString()),this.editorHistory&&this.editorHistory.currentHistoryInfo&&(this.editorHistory.currentHistoryInfo.insertPosition=r),e.start.setPositionInternal(i),e.end.setPositionInternal(n),a=this.getCharacterFormat(e),(s=new Eri).copyFormat(a),a=this.createHyperlinkElement(t,i,n,s),e.start.setPositionParagraph(a.line,a.line.getOffset(a,1)),e.start.moveNextPosition(),e.end.setPositionInternal(e.start),o=this.selection.getParagraphInfo(e.end),t=this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString()),this.editorHistory&&this.editorHistory.currentHistoryInfo?(this.editorHistory.currentHistoryInfo.endPosition=t,this.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.editorHistory.updateComplexHistory(),this.isSkipOperationsBuild=!1,this.reLayout(e)):this.updateComplexWithoutHistory(0,r,t))},c.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)},c.prototype.createHyperlinkElement=function(e,t,i,n){var o=this.selection,r=(this.documentHelper.layout.allowLayout=!1,this.documentHelper.layout.isReplaceAll=!0,this.appylingHyperlinkFormat(o),new Zai(1)),t=(r.characterFormat.copyFormat(n),r.line=o.end.currentWidget,o.start.setPositionInternal(o.end),this.initInsertInline(r),o.start.setPositionInternal(t),o.end.setPositionInternal(o.start),this.insertHyperlinkfield(o,n,e)),n=o.start.paragraph.childWidgets.indexOf(t.line),e=t.line.children.indexOf(t);return r.linkFieldCharacter(this.documentHelper),this.documentHelper.layout.isReplaceAll=!1,this.documentHelper.layout.allowLayout=!0,this.documentHelper.layout.reLayoutParagraph(o.start.paragraph,n,e),r},c.prototype.insertHyperlinkfield=function(e,t,i,n){var o=new Zai(0),r=(o.characterFormat.copyFormat(t),o.line=e.start.currentWidget,this.initInsertInline(o),new pli),n=(r.characterFormat.copyFormat(t),r.text=n?' HYPERLINK \\l "'+i+'" ':' HYPERLINK "'+i+'" ',r.line=e.start.currentWidget,this.initInsertInline(r),new Zai(2));return n.characterFormat.copyFormat(t),n.line=e.start.currentWidget,this.initInsertInline(n),o},c.prototype.unlinkRangeFromRevision=function(e,t){for(var i=0;i<e.revisions.length;i++){var n=e.revisions[i],o=n.range.indexOf(e);0<=o&&(n.range.splice(o,1),this.owner.trackChangesPane.updateCurrentTrackChanges(n)),0===n.range.length&&t&&(this.owner.revisions.remove(n),this.isRemoveRevision)&&this.documentHelper.revisionsInternal.containsKey(n.revisionID)&&(this.documentHelper.revisionsInternal.remove(n.revisionID),this.owner.trackChangesPane.updateTrackChanges())}this.constructRevisionnsForLink(e,!0)},c.prototype.constructRevisionnsForLink=function(e,t){if(e instanceof Zai&&2===e.fieldType&&!je(this.editorHistory)&&!je(this.editorHistory.historyInfoStack)&&0<this.editorHistory.historyInfoStack.length&&"InsertHyperlink"===this.editorHistory.historyInfoStack[0].action){var i=e.nextElement,n=!1;for(je(e.fieldEnd)||-1===e.fieldEnd.indexInOwner||(n=!0);!(je(i)||i instanceof Zai&&1===i.fieldType);)t?(this.unlinkRangeFromRevision(i),this.addRemovedRevisionInfo(i,void 0)):n&&0<i.removedIds.length&&this.constructRevisionFromID(i,!0,!1,i.previousElement),i=je(i.nextElement)?!je(i.paragraph)&&!je(i.paragraph.nextRenderedWidget)&&i.paragraph.nextRenderedWidget instanceof Lai&&!i.paragraph.nextRenderedWidget.isEmpty()?(t?(this.unlinkRangeFromRevision(i.paragraph.characterFormat),this.addRemovedRevisionInfo(i.paragraph.characterFormat,void 0)):n&&0<i.paragraph.characterFormat.removedIds.length&&this.constructRevisionFromID(i.paragraph.characterFormat,!0),i.paragraph.nextRenderedWidget.firstChild.children[0]):void 0:i.nextElement}},c.prototype.unlinkWholeRangeInRevision=function(e,t){for(var i=t,n=(e.revisions.splice(e.revisions.indexOf(e),1),i.range.length),o=0;o<n;o++)i.range.splice(0,1),this.owner.trackChangesPane.updateCurrentTrackChanges(i);0===i.range.length&&(this.owner.revisions.remove(i),this.isRemoveRevision)&&this.documentHelper.revisionsInternal.containsKey(i.revisionID)&&(this.documentHelper.revisionsInternal.remove(i.revisionID),this.owner.trackChangesPane.updateTrackChanges())},c.prototype.unLinkFieldCharacter=function(e){var t;e instanceof Zai&&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 Zai&&2===e.fieldType?je(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):e instanceof Zai&&1===e.fieldType&&e.fieldBegin&&(je(this.documentHelper)||(this.documentHelper.fieldToLayout=e.fieldBegin,this.documentHelper.fieldEndParagraph=e.line.paragraph),-1!==(t=this.documentHelper.fields.indexOf(e.fieldBegin))&&this.documentHelper.fields.splice(t,1),-1!==(t=this.documentHelper.formFields.indexOf(e.fieldBegin))&&this.documentHelper.formFields.splice(t,1),e.fieldBegin.fieldEnd=void 0,e.fieldBegin=void 0)},c.prototype.getCharacterFormat=function(e){return(e.start.paragraph.isEmpty()?e.start.paragraph:e.start.currentWidget.getInline(e.start.offset+1,0).element).characterFormat},c.prototype.insertHyperlink=function(e,t,i){(Y.startsWith(e,"http://")||Y.startsWith(e,"https://"))&&(e=e.replace(/\s/g,"")),je(t)&&(t=e),je(i)||(e=e+'" \\o "'+i),this.insertHyperlinkInternal(e,t,this.owner.selectionModule.text!==t,!1)},c.prototype.insertHyperlinkInternal=function(e,t,i,n){var o,r,s,a,l,h=this.documentHelper.selection;h.start.paragraph.associatedCell!==h.end.paragraph.associatedCell||this.selection.isPlainContentControl()||(a=h.start,o=h.end,h.isForward||(a=h.end,o=h.start),o.offset==o.paragraph.getLength()+1&&o.movePreviousPosition(),i?this.insertHyperlinkInternalInternal(h,e,t,n):(this.documentHelper.layout.allowLayout=!1,(i=new rci(this.documentHelper.owner)).setPositionInternal(a),t=this.getCharacterFormat(h),(l=new Eri(void 0)).copyFormat(t),this.initComplexHistory("InsertHyperlink"),t=this.selection.getParagraphInfo(a),r=this.selection.getHierarchicalIndex(t.paragraph,t.offset.toString()),this.editorHistory&&this.editorHistory.currentHistoryInfo&&(this.editorHistory.currentHistoryInfo.insertPosition=this.selection.getHierarchicalIndex(t.paragraph,t.offset.toString())),this.appylingHyperlinkFormat(h),a.setPositionInternal(o),(s=new Zai(1)).characterFormat.copyFormat(l),s.line=h.end.currentWidget,a.setPositionInternal(o),this.initInsertInline(s),a.setPositionInternal(i),o.setPositionInternal(a),i=this.insertHyperlinkfield(h,l,e,n),s.linkFieldCharacter(this.documentHelper),a=h.start.paragraph.childWidgets.indexOf(i.line),l=i.line.children.indexOf(i),this.documentHelper.layout.allowLayout=!0,this.documentHelper.layout.reLayoutParagraph(h.start.paragraph,a,l),e=s.line,h.selects(e,e.getOffset(s,s.length),!0),t=this.selection.getParagraphInfo(o),n=this.selection.getHierarchicalIndex(t.paragraph,t.offset.toString()),this.editorHistory&&this.editorHistory.currentHistoryInfo?(this.editorHistory.currentHistoryInfo.endPosition=this.selection.getHierarchicalIndex(t.paragraph,t.offset.toString()),this.editorHistory.updateComplexHistory()):this.updateComplexWithoutHistory(1,r,n)))},c.prototype.insertHyperlinkInternalInternal=function(e,t,i,n){var o,r,s,a;je(e.start)||this.editHyperlink(e,t,i)||(o=this.checkAndRemoveComments(),r=this.getCharacterFormat(e),this.initHistory("InsertHyperlink"),s=!0,e.isEmpty||(a=this.owner.enableTrackChanges,this.owner.enableTrackChanges=!1,s=this.removeSelectedContents(e),this.owner.enableTrackChanges=a),s&&((a=new Eri).copyFormat(r),this.insertHyperlinkByFormat(e,t,i,a,n)),this.updateHistoryForComments(o))},c.prototype.insertHyperlinkByFormat=function(e,t,i,n,o){this.updateInsertPosition(),e.owner.isShiftingEnabled=!0;var r=[],s=new Zai(0),a=(!je(this.editorHistory)&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.fieldBegin=s),r.push(s),new pli),o=(a.text=o?' HYPERLINK \\l "'+t+'" ':' HYPERLINK "'+t+'" ',r.push(a),new Zai(2)),t=(r.push(o),je(i)||""===i||((a=new pli).characterFormat.copyFormat(n),a.characterFormat.underline="Single",a.characterFormat.fontColor="#0563c1",a.text=i,r.push(a)),new Zai(1));r.push(t),s.fieldSeparator=t.fieldSeparator=o,s.fieldEnd=o.fieldEnd=t,o.fieldBegin=t.fieldBegin=s,this.insertElement(r),t.linkFieldCharacter(this.documentHelper),-1===this.documentHelper.fields.indexOf(s)&&this.documentHelper.fields.push(s),e.selects(t.line,t.line.getOffset(t,t.length),!0),this.updateEndPosition(),this.reLayout(e,!0)},c.prototype.initInsertInline=function(e,t,i){var n=this.selection;this.initHistory("InsertInline"),this.insertInlineInSelection(n,e),this.editorHistory&&this.editorHistory.updateHistory()},c.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()},c.prototype.editHyperlink=function(e,t,i,n){var o=e.getHyperlinkField();if(je(o))return!1;this.initHistory("InsertHyperlink"),this.editHyperlinkInternal=je(this.editorHistory)||this.editorHistory&&je(this.editorHistory.currentBaseHistoryInfo);var r="",s=!1,a=this.getCharacterFormat(e),l=new Eri,a=(l.copyFormat(a),void 0),h=(je(o.fieldSeparator)||(a=o.fieldSeparator,r=(h=e.getHyperlinkDisplayText(o.fieldSeparator.line.paragraph,o.fieldSeparator,o.fieldEnd,s,l)).displayText,s=h.isNestedField,l=h.format),o.line.getOffset(o,0));return e.start.setPositionParagraph(o.line,h),h=o.fieldEnd.line.getOffset(o.fieldEnd,1),e.end.setPositionParagraph(o.fieldEnd.line,h),this.skipFieldDeleteTracking=!0,this.deleteSelectedContents(e,!0),!s&&r!==i||je(a)?(this.insertHyperlinkByFormat(e,t,i,l,n),this.skipFieldDeleteTracking=!1):(this.updateInsertPosition(),s=new Zai(0),this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&(this.editorHistory.currentBaseHistoryInfo.fieldBegin=s,this.editorHistory.currentBaseHistoryInfo.isEditHyperlink=!0),s.characterFormat.copyFormat(o.characterFormat),s.line=e.start.currentWidget,this.insertInlineInternal(s),(r=new pli).characterFormat.copyFormat(o.characterFormat),r.text=n?' HYPERLINK \\l "'+t+'" ':' HYPERLINK "'+t+'" ',r.line=e.start.currentWidget,this.insertInlineInternal(r),i=this.editorHistory&&this.editorHistory.currentBaseHistoryInfo?this.editorHistory.currentBaseHistoryInfo.removedNodes:this.nodes,this.insertClonedFieldResult(e,i,a),e.end.currentWidget.getInline(e.end.offset,0).element.linkFieldCharacter(this.documentHelper),this.skipFieldDeleteTracking=!1,l=s.line.paragraph,o=s.line.paragraph.childWidgets.indexOf(s.line),n=s.line.children.indexOf(s),this.documentHelper.layout.reLayoutParagraph(l,o,n),h=s.fieldEnd.line.getOffset(s.fieldEnd,1),e.selects(s.fieldEnd.line,h,!0),this.updateEndPosition(),this.reLayout(e,!0)),this.editHyperlinkInternal=!1,this.nodes=[],!0},c.prototype.insertClonedFieldResult=function(e,t,i){for(var n=!1,o=t.length-1;-1<o;o--){var r,s,a=t[o];if(!n){if(i!==a){a instanceof Lai&&a===i.line.paragraph&&(n=!0,r=void 0,o===t.length-1?(r=e.start.paragraph,s=i.line.paragraph,this.getClonedFieldResultWithSel(s,e,i)):(r=this.getClonedFieldResult(i.line.paragraph,i),this.insertParagraph(r,!0)),e.selectParagraphInternal(e.getNextParagraphBlock(r),!0));continue}n=!0}a instanceof Xai?this.insertInlineInternal(a.clone()):a instanceof Dai&&this.insertBlock(a.clone())}},c.prototype.getClonedFieldResultWithSel=function(e,t,i){for(var n=e.childWidgets.indexOf(i.line),o=e.childWidgets[n].children.indexOf(i),r=n;r<e.childWidgets.length;r++)for(var s=e.childWidgets[r],a=o=r!==n?0:o;a<s.children.length;a++)this.insertInlineInternal(s.children[a].clone())},c.prototype.getClonedFieldResult=function(e,t){for(var i=new Lai,n=(i.characterFormat.copyFormat(e.characterFormat),i.paragraphFormat.copyFormat(e.paragraphFormat),e.childWidgets.indexOf(t.line)),o=e.childWidgets[n].children.indexOf(t),r=n;r<e.childWidgets.length;r++)for(var s=e.childWidgets[r],a=o=r!==n?0:o;a<s.children.length;a++)i.childWidgets[0].children.push(s.children[a]);return i},c.prototype.removeContentControl=function(){var e,t,i,n,o=this.documentHelper.owner.selection.currentContentControl;o instanceof Pli&&(e=o.reference,t=this.selection.start.clone(),i=this.selection.end.clone(),n=this.selection.getElementInfo(i.currentWidget,i.offset),this.selection.start.setPositionParagraph(o.line,o.line.getOffset(o,o.length)),this.selection.end.setPositionParagraph(e.line,e.line.getOffset(e,e.length)-1),this.initHistory("RemoveContentControl"),this.selection.selectPosition(t,i),this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Marker_Start,this.editorHistory.currentBaseHistoryInfo.markerData.push({text:"RemoveContentControl",type:o.contentControlWidgetType}),this.editorHistory.currentBaseHistoryInfo.setContentControlInfo(o)),this.removeContentControlInternal(o),this.editorHistory&&this.editorHistory.updateHistory(),n.element!==o)&&n.element!==e&&this.selection.end.setPositionParagraph(n.element.line,n.element.line.getOffset(n.element,n.index)),this.fireContentChange(),this.viewer.updateScrollBars()},c.prototype.removeContentControlInternal=function(e){"Picture"==(e=je(e)?this.documentHelper.owner.selection.currentContentControl:e).contentControlProperties.type&&this.owner.renderPictureContentControlElement(this.owner,!1,!1);var t=this.documentHelper.contentControlCollection.indexOf(e),t=(0<=t&&(this.updatePropertiesToBlock(e),this.documentHelper.contentControlCollection.splice(t,1),e.line.children.splice(e.indexInOwner,1),je(e.reference)||(e.reference.line.children.splice(e.reference.indexInOwner,1),this.updatePropertiesToBlock(e))),this.selection.updateContentControlHighlightSelection(),document.getElementById("contenticon")),e=document.getElementById(this.owner.element.id+"PICTURE_CONTENT_CONTROL");t&&(t.style.display="none"),e&&(e.style.display="none"),this.viewer.updateScrollBars()},c.prototype.removeHyperlink=function(){var e,t,i,n,o,r;this.owner.isReadOnlyMode||je(r=(e=this.selection).getHyperlinkField())||(t=r.fieldEnd,i=r.fieldSeparator,(n=new rci(e.owner)).setPositionParagraph(r.line,r.line.getOffset(r,0)),r=this.selection.getParagraphInfo(n),n=this.selection.getHierarchicalIndex(r.paragraph,r.offset.toString()),(o=new rci(e.owner)).setPositionParagraph(i.line,i.line.getOffset(i,i.length)),r=this.selection.getParagraphInfo(o),o=this.selection.getHierarchicalIndex(r.paragraph,r.offset.toString()),this.initComplexHistory("RemoveHyperlink"),e.start.setPositionParagraph(t.line,t.line.getOffset(t,0)),r=this.selection.getParagraphInfo(e.start),r=this.selection.getHierarchicalIndex(r.paragraph,r.offset.toString()),e.end.setPositionParagraph(t.line,t.line.getOffset(t,1)),this.delete(),e.start.setPositionInternal(this.selection.getTextPosBasedOnLogicalIndex(o)),this.initHistory("Underline"),this.updateCharacterFormatWithUpdate(e,"underline","None",!1),this.editorHistory&&this.editorHistory.updateHistory(),e.end.setPositionInternal(this.selection.getTextPosBasedOnLogicalIndex(r)),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(n)),this.initHistory("Delete"),this.deleteSelectedContents(e,!1),this.reLayout(e,!0),this.combineElementRevision(i.revisions,t.revisions),this.editorHistory&&!je(this.editorHistory.currentHistoryInfo)&&this.editorHistory.updateComplexHistory())},c.prototype.updateHyperlinkFormat=function(e){var t,i=e.getHyperlinkField();je(i)||(t=i.fieldEnd,i=i.fieldSeparator,e.start.setPositionParagraph(i.line,i.line.getOffset(i,i.length)),e.end.setPositionParagraph(t.line,t.line.getOffset(t,0)),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))},c.prototype.pasteInternal=function(e,t){if(this.currentPasteOptions=this.owner.defaultPasteOption,this.isHtmlPaste=!1,this.documentHelper.owner.enableLocalPaste)this.paste();else{this.selection.isViewPasteOptions=!0,this.selection.pasteElement&&(this.selection.pasteElement.style.display="none");var i="",n="",o="",r=(t=je(t)?window:t).clipboardData||e.clipboardData;if("msie"!==F.info.name&&(n=r.getData("Text/Rtf"),i=r.getData("Text/Html"),o=r.getData("application/json")),this.copiedTextContent=t=Y.sanitizeString(r.getData("Text")),this.previousCharFormat=new Eri,this.previousCharFormat.copyFormat(this.selection.start.paragraph.characterFormat),this.previousParaFormat=new bri,this.previousParaFormat.copyFormat(this.selection.start.paragraph.paragraphFormat),"FormFieldsOnly"===this.documentHelper.protectionType&&this.documentHelper.selection.isInlineFormFillMode()&&(n=i=""),""!==o)this.pasteFormattedContent({data:JSON.parse(o)});else if(""!==n)this.pasteAjax(n,".rtf");else if(""!==i)this.isHtmlPaste=!0,this.pasteAjax(i,".html");else if(null!==t&&""!==t)this.selection.currentPasteAction="TextOnly",this.pasteContents(t),this.applyPasteOptions(this.currentPasteOptions,!0),this.copiedContent=void 0,this.documentHelper.editableDiv.innerHTML="";else if("msie"!==F.info.name&&void 0!==r.items&&0!==r.items.length)for(var s=0;s<r.items.length;s++){var a=r.items[s];("image/png"===a.type||"image/svg+xml"===a.type&&"string"!==a.kind)&&this.pasteImage(a.getAsFile())}else"msie"===F.info.name&&void 0!==r.files&&0!==r.files.length&&"image/png"===r.files[0].type&&this.pasteImage(r.files[0])}},c.prototype.pasteImage=function(e){var t=this,i=new FileReader;i.onload=function(){t.onPasteImage(i.result)},i.readAsDataURL(e)},c.prototype.onPasteImage=function(e){var t=document.createElement("img"),i=this;t.addEventListener("load",function(){i.insertImageInternal(e,!0,this.width,this.height,this.alt)}),t.src=e},c.prototype.pasteAjax=function(e,t){e={content:e,type:t},this.pasteRequestHandler=new vJt,this.owner.documentHelper.viewerContainer.focus(),kA(this.owner.element),this.pasteRequestHandler.url=this.owner.serviceUrl+this.owner.serverActionSettings.systemClipboard,this.pasteRequestHandler.responseType="json",this.pasteRequestHandler.contentType="application/json;charset=UTF-8",this.pasteRequestHandler.customHeaders=this.owner.headers,this.pasteRequestHandler.onSuccess=this.pasteFormattedContent.bind(this),this.pasteRequestHandler.onFailure=this.onPasteFailure.bind(this),this.pasteRequestHandler.onError=this.onPasteFailure.bind(this),t={serverActionType:"SystemClipboard",headers:this.owner.headers,timeout:0,cancel:!1,withCredentials:!1,clipboardData:e};this.owner.trigger(XJt,t),t.cancel?BA(this.owner.element):this.pasteRequestHandler.send(e,t)},c.prototype.pasteFormattedContent=function(e){var t=this;this.isPasteListUpdated&&(this.isPasteListUpdated=!1),this.pasteContents(je(e.data)?this.copiedTextContent:Y.getSfdtDocument(e.data)),"KeepSourceFormatting"!==this.currentPasteOptions&&this.applyPasteOptions(this.currentPasteOptions),BA(this.owner.element),setTimeout(function(){je(t.viewer)||(t.documentHelper.isScrollHandler=!0,t.isPasteContentCheck=!0,t.viewer.updateScrollBars(),t.documentHelper.isScrollHandler=!1,t.isPasteContentCheck=!1)},0)},c.prototype.onPasteFailure=function(e){this.owner.fireServiceFailure(e),console.error(e.status,e.statusText),BA(this.owner.element),this.documentHelper.updateFocus()},c.prototype.paste=function(e,t){var i=this;je(e)&&(e=this.owner.enableLocalPaste?this.copiedData:void 0),je(t)||(this.currentPasteOptions=t),e&&(e=Y.getSfdtDocument(e),this.pasteContents(e,null,t),this.applyPasteOptions(this.currentPasteOptions),this.currentPasteOptions=void 0,this.chartType)&&(setTimeout(function(){je(i.viewer)||i.viewer.updateScrollBars()},30),this.chartType=!1)},c.prototype.getUniqueListOrAbstractListId=function(e){return e&&this.documentHelper.lists.length?(e=this.documentHelper.lists.slice().sort(function(e,t){return e.listId-t.listId}))[e.length-1].listId+1:this.documentHelper.abstractLists.length?(e=this.documentHelper.abstractLists.slice().sort(function(e,t){return e.abstractListId-t.abstractListId}))[e.length-1].abstractListId+1:0},c.prototype.getBlocksToUpdate=function(e){for(var t=[],i=0;i<e.length;i++){var n=e[i];if(n[lZt[this.keywordIndex]]&&n[lZt[this.keywordIndex]][x$t[this.keywordIndex]]&&0<Object.keys(n[lZt[this.keywordIndex]][x$t[this.keywordIndex]]).length)t.push(n);else if(n[Ani[this.keywordIndex]])for(var o=0;o<n[Ani[this.keywordIndex]].length;o++)for(var r=n[Ani[this.keywordIndex]][o],s=0;s<r[Sni[this.keywordIndex]].length;s++)var a=r[Sni[this.keywordIndex]][s],t=t.concat(this.getBlocksToUpdate(a[_ni[this.keywordIndex]]))}return t},c.prototype.updateListIdForBlocks=function(e,t,i,n,o,r,s){for(var a=!1,l=0;l<e.length;l++){var h=e[l];if(h[lZt[this.keywordIndex]]&&h[lZt[this.keywordIndex]][x$t[this.keywordIndex]]&&0<Object.keys(h[lZt[this.keywordIndex]][x$t[this.keywordIndex]]).length){var d=h[lZt[this.keywordIndex]][x$t[this.keywordIndex]],p=this.isNsIdMatchWithExistingAbstractList(t.nsid);d[d$t[this.keywordIndex]]===n&&(je(p)?(a=!0,d[d$t[this.keywordIndex]]=o):r?(a=!0,d[d$t[this.keywordIndex]]=o,d.nsid=s):(d.isUpdated||(d[d$t[this.keywordIndex]]=p.listId,d.isUpdated=!0),a=!1))}else if(h[Ani[this.keywordIndex]])for(var c=0;c<h[Ani[this.keywordIndex]].length;c++)for(var u=h[Ani[this.keywordIndex]][c],g=0;g<u[Sni[this.keywordIndex]].length;g++)var m=u[Sni[this.keywordIndex]][g],m=this.updateListIdForBlocks(m[_ni[this.keywordIndex]],t,i,n,o),a=a||m}return a},c.prototype.isNsIdMatchWithExistingAbstractList=function(e){for(var t=0;t<this.documentHelper.lists.length;t++){var i=this.documentHelper.lists[t];if(i.abstractList.nsid===e)return i}},c.prototype.updatePasteContent=function(h,d){for(var e,p,c=this,u=this.getUniqueListOrAbstractListId(!0),g=(0<h[hZt[this.keywordIndex]].filter(function(e){return e[d$t[c.keywordIndex]]===u}).length&&(e=h[hZt[this.keywordIndex]].slice().sort(function(e,t){return e[d$t[c.keywordIndex]]-t[d$t[c.keywordIndex]]}),u=e[e.length-1][d$t[this.keywordIndex]]+1),this.getUniqueListOrAbstractListId(!1)),m=(0<h[dZt[this.keywordIndex]].filter(function(e){return e[toi[c.keywordIndex]]===g}).length&&(e=h[dZt[this.keywordIndex]].slice().sort(function(e,t){return e[toi[c.keywordIndex]]-t[toi[c.keywordIndex]]}),g=e[e.length-1][toi[this.keywordIndex]]+1),h[hZt[this.keywordIndex]].length),f=this,t=0;t<h[hZt[this.keywordIndex]].length;t++)!function(e){var t=h[hZt[f.keywordIndex]][e],i=h[dZt[f.keywordIndex]].filter(function(e){return e[toi[c.keywordIndex]]===t[toi[c.keywordIndex]]})[0],n=f.documentHelper.lists.filter(function(e){return e.listId===t[d$t[c.keywordIndex]]});if(!je(i)){var o=!1,r=0;if(je(f.selection)||je(f.selection.start.paragraph)||(o=f.getPreviousParagraphListFormat(f.selection.start.paragraph,m))&&(r=Y.generateUniqueId(f.documentHelper.lists)),f.updateListIdForBlocks(h[rZt[f.keywordIndex]][d][_ni[f.keywordIndex]],i,n[0],t[d$t[f.keywordIndex]],u,o,r)){for(var s=i[toi[f.keywordIndex]],a=0;a<h[hZt[f.keywordIndex]].length;a++){var l=h[hZt[f.keywordIndex]][a];l[toi[f.keywordIndex]]===s&&(l[toi[f.keywordIndex]]=g)}i[toi[f.keywordIndex]]=g,t[d$t[f.keywordIndex]]=u,o&&0!==r&&(i.nsid=t.nsid=r),u++,g++}else h[hZt[f.keywordIndex]].splice(e,1),h[dZt[f.keywordIndex]].splice(h[dZt[f.keywordIndex]].indexOf(i),1),e--}p=e}(t),t=p;for(var i=this.getBlocksToUpdate(h[rZt[this.keywordIndex]][d][_ni[this.keywordIndex]]),n=0;n<i.length;n++)delete i[n][lZt[this.keywordIndex]][x$t[this.keywordIndex]].isUpdated},c.prototype.getPreviousParagraphListFormat=function(e,t){if(!je(this.documentHelper.layout)){for(var i=this.selection.getPreviousParagraphBlock(e);!je(i)&&(i.isEmpty()||!this.documentHelper.layout.hasValidElement(i));)i=this.selection.getPreviousParagraphBlock(i);if(!je(i)&&-1===i.paragraphFormat.listFormat.listId&&1===t)return!0}return!1},c.prototype.getBlocks=function(e,t,i,n,o,r){var s=[];if("string"==typeof e){var a=this.selection.start.paragraph,l=(this.selection.isForward||(a=this.selection.end.paragraph),[]),l=e.replace(/\r?\n/g,"\r").split("\r"),h=[];(b=new Sai).sectionFormat=new ari(b),b.childWidgets=h;for(var d=0;d<l.length;d++)if(d!==l.length-1||0!==l[d].length||this.isInsertText){var p=this.selection.start.currentWidget.getInline(this.selection.start.offset,0),c=this.selection.getPreviousValidElement(p.element),u=(c!==p.element&&(c=this.documentHelper.getNextValidElement(p.element)),void 0),p=(a.isEmpty()?u=a.characterFormat:je(c)||this.isInsertText?this.copyInsertFormat(a.characterFormat,!1):u=c.characterFormat,void 0),c=(this.isInsertText&&!this.selection.isEmpty?(p=new bri).copyFormat(this.selection.end.paragraph.paragraphFormat):p=this.documentHelper.selection.copySelectionParagraphFormat(),je(this.previousParaFormat)||(p=this.previousParaFormat),new Lai),g=(c.paragraphFormat.copyFormat(p),new Gai(c));if(0<l[d].length)for(var m=l[d].split(/(\s+)/),f=0;f<m.length;f++){var y=new pli;y.characterFormat.copyFormat(u),y.text=m[f],g.children.push(y),y.line=g}c.childWidgets.push(g),c.containerWidget=b,h.push(c)}s.push(b)}else{var v=this.documentHelper.owner.parser,b=(v.keywordIndex=this.keywordIndex,v.isPaste=t,v.isContextBasedPaste=!je(r)&&r,v.isHtmlPaste=this.isHtmlPaste,r||(v.addCustomStyles(e),e[uZt[this.keywordIndex]]&&0<e[uZt[this.keywordIndex]].length&&(v.commentsCollection=new uJt,v.commentStarts=new uJt,v.commentEnds=new uJt,v.parseComments(e,n||this.documentHelper.comments)),e[mZt[this.keywordIndex]]&&0<e[mZt[this.keywordIndex]].length&&v.parseCustomXml(e)),void 0);this.selection.currentPasteAction="DefaultPaste";for(var w,d=0;d<e[rZt[this.keywordIndex]].length;d++){if(!r&&(this.isPasteListUpdated||je(e[hZt[this.keywordIndex]])||(0<this.documentHelper.lists.length&&this.updatePasteContent(e,d),this.isPasteListUpdated=!0,je(e[dZt[this.keywordIndex]])||v.parseAbstractList(e,this.documentHelper.abstractLists),je(e[hZt[this.keywordIndex]]))||v.parseList(e,this.documentHelper.lists),!je(e[gZt[this.keywordIndex]])))if(t){var C=this.viewer.owner.revisionsInternal.changes,S=(je(v.revisionCollection)||(v.revisionCollection=void 0),this.isRemoteAction?v.revisionCollection=this.documentHelper.revisionsInternal:v.revisionCollection=new uJt,v.revisionCollection);if((!this.documentHelper.owner.sfdtExportModule.copyWithTrackChange||!v.isCutPerformed)&&1<=e[gZt[this.keywordIndex]].length)for(var A=0;A<e[gZt[this.keywordIndex]].length;A++){var x,I=!0;if(S.containsKey(e[gZt[this.keywordIndex]][A][_ii[this.keywordIndex]])){if(0<C.length)for(var T=0;T<C.length;T++)C[T].revisionID===e[gZt[this.keywordIndex]][A][_ii[this.keywordIndex]]&&(I=!1);I&&!this.isRemoteAction&&(x=S.get(e[gZt[this.keywordIndex]][A][_ii[this.keywordIndex]]),C.push(x))}else v.parseRevisions(e,C)}this.documentHelper.owner.sfdtExportModule.copyWithTrackChange=!1}else v.revisionCollection=this.documentHelper.revisionsInternal,v.parseRevisions(e,o);if((b=new Sai).sectionFormat=new ari(b),!t||r?i.unshift(b):s.push(b),t&&!r&&!je(e[cZt[this.keywordIndex]]))for(f=0;f<e[cZt[this.keywordIndex]].length;f++){var E=e[cZt[this.keywordIndex]][f][BZt[this.keywordIndex]];je(this.documentHelper.styles.findByName(E))&&v.parseStyle(e,e[cZt[this.keywordIndex]][f],this.documentHelper.styles)}if(v.parseBody(e[rZt[this.keywordIndex]][d][_ni[this.keywordIndex]],b.childWidgets,void 0,void 0,void 0,e[cZt[this.keywordIndex]]),((e[TZt[this.keywordIndex]]||this.owner.enableLocalPaste)&&this.selection.start.paragraph.isEmpty()&&1==this.documentHelper.pages.length&&1==this.documentHelper.pages[0].bodyWidgets[0].childWidgets.length||e[rZt[this.keywordIndex]][d][Gni[this.keywordIndex]]&&1<e[rZt[this.keywordIndex]][d][Gni[this.keywordIndex]][Z$t[this.keywordIndex]]||e[rZt[this.keywordIndex]][d][Gni[this.keywordIndex]]&&"NoBreak"===e[rZt[this.keywordIndex]][d][Gni[this.keywordIndex]][tei[this.keywordIndex]])&&v.parseSectionFormat(this.keywordIndex,e[rZt[this.keywordIndex]][d][Gni[this.keywordIndex]],b.sectionFormat),t&&!this.isRemoteAction&&!je(n)){for(var D=[],M=0;M<this.documentHelper.comments.length;M++)D.push(this.documentHelper.comments[M].commentId);for(var k=0;k<n.length;k++){var P,B=n[k];-1===D.indexOf(B.commentId)||je(B.commentStart)||je(B.commentEnd)||(P=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),B.commentId=B.commentStart.commentId=B.commentEnd.commentId=P),this.documentHelper.comments.push(B)}}v.isPaste=!1,v.isHtmlPaste=!1,v.isContextBasedPaste=!1}(e[TZt[this.keywordIndex]]&&!r||this.owner.documentEditorSettings.pasteAsNewParagraph)&&(this.isLastParaMarkCopied=!0,w=new Lai,b.childWidgets.push(w))}return"MergeWithExistingFormatting"!==this.currentPasteOptions||r||this.applyMergeFormat(s),s},c.prototype.applyMergeFormat=function(e){for(var t=this.selection.start.paragraph,i=this.selection.start.currentWidget.getInline(this.selection.start.offset,0),i=this.selection.getPreviousValidElement(i.element),n=i?i.characterFormat:this.copyInsertFormat(t.characterFormat,!0,t),o=this.documentHelper.selection.paragraphFormat,r=0;r<e.length;r++)for(var s=e[r].childWidgets,a=0;a<s.length;a++){var l=s[a];if(l instanceof Lai)this.applyParaFormatInternal(l.paragraphFormat,o),this.applyFormatInternal(l,n);else for(var h=0;h<l.childWidgets.length;h++)for(var d=l.childWidgets[h],p=0;p<d.childWidgets.length;p++)for(var c=d.childWidgets[p],u=0;u<c.childWidgets.length;u++)this.applyFormatInternal(c.childWidgets[u],n)}},c.prototype.applyParaFormatInternal=function(e,t){je(t.leftIndent)||(e.leftIndent=t.leftIndent),je(t.rightIndent)||(e.rightIndent=t.rightIndent),je(t.firstLineIndent)||(e.firstLineIndent=t.firstLineIndent),je(t.textAlignment)?e.textAlignment="Left":e.textAlignment=t.textAlignment,je(t.outlineLevel)?e.outlineLevel="BodyText":e.outlineLevel=t.outlineLevel,-1===t.beforeSpacing?e.beforeSpacing=0:e.beforeSpacing=t.beforeSpacing,-1===t.afterSpacing?e.afterSpacing=0:e.afterSpacing=t.afterSpacing,0===t.lineSpacing?e.lineSpacing=1:e.lineSpacing=t.lineSpacing,je(t.lineSpacingType)||(e.lineSpacingType=t.lineSpacingType),je(t.bidi)||(e.bidi=t.bidi),je(t.spaceAfterAuto)||(e.spaceAfterAuto=t.spaceAfterAuto),je(t.spaceBeforeAuto)||(e.spaceBeforeAuto=t.spaceBeforeAuto),je(t.keepWithNext)||(e.keepWithNext=t.keepWithNext),je(t.keepLinesTogether)||(e.keepLinesTogether=t.keepLinesTogether),je(t.widowControl)||(e.widowControl=t.widowControl),je(t.contextualSpacing)||(e.contextualSpacing=t.contextualSpacing),e.tabs&&(e.tabs=[])},c.prototype.applyFormatInternal=function(e,t){if(e instanceof Lai)for(var i=0;i<e.childWidgets.length;i++)for(var n=e.childWidgets[i],o=0;o<n.children.length;o++){var r=n.children[o].characterFormat.cloneFormat();r.bold&&(n.children[o].characterFormat.bold=r.bold),r.italic&&(n.children[o].characterFormat.italic=r.italic),"None"!==r.underline&&(n.children[o].characterFormat.underline=r.underline),"MergeWithExistingFormatting"!==this.currentPasteOptions||je(t)||(t.bold&&(n.children[o].characterFormat.bold=t.bold),t.italic&&(n.children[o].characterFormat.italic=t.italic),"None"!==t.underline&&(n.children[o].characterFormat.underline=t.underline),n.children[o].characterFormat.fontColor!==t.fontColor&&(n.children[o].characterFormat.fontColor=t.fontColor),n.children[o].characterFormat.fontSize!==t.fontSize&&(n.children[o].characterFormat.fontSize=t.fontSize,n.children[o].characterFormat.fontSizeBidi=t.fontSizeBidi),n.children[o].characterFormat.fontFamily!==t.fontFamily&&(n.children[o].characterFormat.fontFamily=t.fontFamily,n.children[o].characterFormat.fontFamilyBidi=t.fontFamilyBidi),n.children[o].characterFormat.fontFamilyAscii!==t.fontFamilyAscii&&(n.children[o].characterFormat.fontFamilyAscii=t.fontFamilyAscii),n.children[o].characterFormat.fontFamilyFarEast!==t.fontFamilyFarEast&&(n.children[o].characterFormat.fontFamilyFarEast=t.fontFamilyFarEast),n.children[o].characterFormat.fontFamilyAscii!==t.fontFamilyAscii&&(n.children[o].characterFormat.fontFamilyAscii=t.fontFamilyAscii))}else for(i=0;i<e.childWidgets.length;i++)for(var s=e.childWidgets[i],o=0;o<s.childWidgets.length;o++)for(var a=s.childWidgets[o],l=0;l<a.childWidgets.length;l++)this.applyFormatInternal(a.childWidgets[l],t)},c.prototype.applyPasteOptions=function(e,t){if(!je(this.copiedContent)&&""!==this.copiedTextContent&&!t){this.currentPasteOptions=e;var i=(this.selection.isForward?this.selection.start:this.selection.end).paragraph.paragraphFormat,t=this.copiedContent,n=this.copiedTextContent;switch(this.editorHistory&&this.editorHistory.canUndo()&&(this.editorHistory.undo(),this.editorHistory.redoStack.pop()),this.copiedContent=t,this.copiedTextContent=n,this.selection.isViewPasteOptions=!0,e){case"KeepSourceFormatting":this.pasteContents(""!==this.copiedContent?this.copiedContent:this.copiedTextContent);break;case"MergeWithExistingFormatting":this.pasteContents(""!==this.copiedContent?this.copiedContent:this.copiedTextContent,i);break;case"KeepTextOnly":this.pasteContents(this.copiedTextContent)}}},c.prototype.applyTablePasteOptions=function(e){if(!je(this.copiedContent)&&""!==this.copiedTextContent){this.isPaste=!0;var t=""!==this.copiedContent?this.copiedContent:this.copiedTextContent,i=(this.editorHistory&&this.editorHistory.canUndo()&&(this.editorHistory.undo(),this.editorHistory.redoStack.pop()),this.getBlocks(t,!0)),n=this.selection.start.paragraph.paragraphFormat;switch(e){case"NestTable":this.pasteAsNestedTable(i,n);break;case"InsertAsRows":this.pasteAsNewRow(i[0].childWidgets[0]);break;case"InsertAsColumns":this.pasteAsNewColumn(i[0].childWidgets[0]);break;case"OverwriteCells":this.pasteOverwriteCell(i[0].childWidgets[0])}this.isPaste=!1}},c.prototype.pasteContents=function(e,t,i){if(!je(e.optimizeSfdt)&&e.optimizeSfdt?this.keywordIndex=1:this.keywordIndex=0,"string"!=typeof e&&(this.copiedContent=e),!je(this.documentHelper)){var n;if("FormFieldsOnly"===this.documentHelper.protectionType&&this.documentHelper.selection.isInlineFormFillMode()&&(h=this.selection.getCurrentFormField(),l=this.getFieldResultText(),h=h.formFieldData.maxLength,n=this.documentHelper.selection.text.length,0<h)&&(0===n?(h=h-l.length,e=e.substring(0,h)):0<n&&(e=e.substring(0,n))),!je(e[Xoi[this.keywordIndex]])){var o=e[Xoi[this.keywordIndex]];if(0<this.documentHelper.images.length){this.pasteImageIndex=new uJt;var r,s={};for(r in o){var a=Math.max.apply(Math,this.documentHelper.images.keys)+1+parseInt(r);s[a]=o[r],this.pasteImageIndex.add(r,a.toString())}o=s}this.documentHelper.owner.parser.parseImages(o)}var l=[],h=this.getBlocks(e,!0,void 0,l);this.pasteContentsInternal(h,!0,t,i,l),!je(l)&&0<l.length&&this.documentHelper.layout.layoutComments(l),je(this.pasteImageIndex)||this.pasteImageIndex.destroy(),this.pasteImageIndex=void 0,this.isInsertField=!1,this.isPasteListUpdated=!1,this.isLastParaMarkCopied=!1}},c.prototype.pasteContentsInternal=function(e,t,i,n,o){this.isPaste=t;t=this.documentHelper.selection;if(t.start.paragraph.isInsideTable&&t.end.paragraph.isInsideTable&&!this.documentHelper.isDragging){var r=!1;if(r=1===e.length&&(s=e[0].childWidgets).length<3&&(1===s.length&&s[0]instanceof _ai||2===s.length&&s[0]instanceof _ai&&s[1].isEmpty())?!0:r){var s=t.start.paragraph.associatedCell,r=t.end.paragraph.associatedCell,a=e[0].childWidgets[0];if(je(n)||"MergeWithExistingFormatting"===n||"KeepSourceFormatting"===n||"KeepTextOnly"===n)s.ownerTable.equals(r.ownerTable)&&(0===t.start.paragraph.associatedCell.rowIndex&&0===t.end.paragraph.associatedCell.rowIndex&&s.equals(r)&&!this.selection.isCellSelected(s,t.start,t.end)?(this.selection.currentPasteAction="InsertAsColumns",this.pasteAsNewColumn(a)):(this.selection.currentPasteAction="OverwriteCells",this.pasteOverwriteCell(a)));else switch(n){case"InsertAsColumns":this.selection.currentPasteAction="InsertAsColumns",this.pasteAsNewColumn(a);break;case"OverwriteCells":this.selection.currentPasteAction="OverwriteCells",this.pasteOverwriteCell(a);break;case"NestTable":this.selection.currentPasteAction="NestTable",this.pasteAsNestedTable(e);break;case"InsertAsRows":this.selection.currentPasteAction="InsertAsRows",this.pasteAsNewRow(a)}return void(this.isPaste=!1)}}r=this.checkAndRemoveComments(),this.defaultPaste(e,i,o),this.updateHistoryForComments(r)},c.prototype.defaultPaste=function(e,t,i){var n,o=this.documentHelper.selection,r=!0,s=!1;this.initComplexHistory("Paste"),this.documentHelper.isListTextSelected&&(n=o.start.paragraph).paragraphFormat.listFormat&&-1!==n.paragraphFormat.listFormat.listId&&this.onApplyList(void 0),this.initHistory("Paste"),(r=(o.isEmpty||this.owner.documentHelper.isDragging&&this.owner.selection.isImageSelected)&&!this.documentHelper.isListTextSelected?r:this.removeSelectedContentInternal(o,o.start,o.end))?(s=this.pasteContent(e,t),this.owner.enableTrackChanges&&this.isInsertingTOC&&je(this.owner.documentHelper.blockToShift)&&(this.owner.documentHelper.blockToShift=this.selection.start.paragraph),this.isRemoteAction&&(this.updatePasteRevision(),this.owner.trackChangesPane.updateTrackChanges())):this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo=void 0),this.editorHistory&&this.editorHistory.currentHistoryInfo?(this.editorHistory.currentBaseHistoryInfo&&"Paste"===this.editorHistory.currentBaseHistoryInfo.action&&(this.editorHistory.currentBaseHistoryInfo.endRevisionLogicalIndex&&(this.editorHistory.currentBaseHistoryInfo.endRevisionLogicalIndex=void 0),n=this.selection.getTextPosBasedOnLogicalIndex(this.editorHistory.currentBaseHistoryInfo.insertPosition),r=this.selection.getTextPosBasedOnLogicalIndex(this.editorHistory.currentBaseHistoryInfo.endPosition),this.isRemoteAction||(e=je(this.owner.sfdtExportModule)?{}:this.owner.sfdtExportModule.write(this.owner.documentEditorSettings.optimizeSfdt?1:0,n.currentWidget,n.offset,r.currentWidget,r.offset,!1,!0),this.editorHistory.currentBaseHistoryInfo.pasteContent=e),!je(i))&&0<i.length&&(t=this.editorHistory.currentBaseHistoryInfo.pastedComments).push.apply(t,i),this.editorHistory.updateHistory(),this.editorHistory.updateComplexHistory(),o.isHighlightContentControlEditRegion=!0):this.reLayout(o,o.isEmpty),s&&(this.selection.pasteElement&&(this.selection.pasteElement.style.display="none"),this.restrictLayout||this.layoutWholeDocument(!0)),this.isPaste=!1},c.prototype.pasteAsNewColumn=function(e){if(!this.owner.isReadOnlyMode&&this.canEditContentControl&&this.selection.start.paragraph.isInsideTable){this.checkIsNotRedoing()&&this.initHistory("PasteColumn");var t=this.getOwnerCell(this.selection.isForward),i=t.ownerRow.ownerTable.combineWidget(this.owner.viewer),n=(this.editorHistory&&this.cloneTableToHistoryInfo(i),this.selection.owner.isLayoutEnabled=!1,e.clone()),e=n.childWidgets[0],o=n.childWidgets.length,e=e.childWidgets.length,r=t.columnIndex,s=void 0,a=void 0,l=e,h=[];o>i.childWidgets.length?(this.addRows(o-i.childWidgets.length,i),this.tableUpdate(i)):i.childWidgets.length>o&&(this.addRows(i.childWidgets.length-o,n,i),this.tableUpdate(i));for(var d=0;d<l;d++)for(var p=0;p<i.childWidgets.length;p++){var c=i.childWidgets[p],u=n.childWidgets[p].childWidgets[d],g=c.childWidgets[t.columnIndex],m=((a=this.createColumn(this.selection.getLastParagraph(t))).index=p,a.rowIndex=c.index,(a.containerWidget=c).previousWidget),f=this.rowspannedCollection(c,h);if(null!=g)a.cellFormat.copyFormat(g.cellFormat),a.cellFormat.rowSpan=1;else if(0<f.length)for(var y=0;y<f.length;y++)m.rowIndex+(f[y].cellFormat.rowSpan-1)>=c.rowIndex&&(a.cellFormat.copyFormat(f[y].cellFormat),a.cellFormat.rowSpan=1);u.containerWidget=a.containerWidget,a.childWidgets=u.childWidgets,je(s)&&(s=this.selection.getFirstParagraph(a)),0===r?c.childWidgets.splice(d,0,a):this.insertSpannedCells(c,h,a,r)}this.tableReLayout(i,s,a,!0)}},c.prototype.pasteAsNestedTable=function(e,t){var i=e[0].childWidgets[0];if(this.selection.start.paragraph.isInsideTable){this.checkIsNotRedoing()&&this.initHistory("PasteNested");var n=this.getOwnerCell(this.selection.isForward),o=n.ownerRow.ownerTable.combineWidget(this.owner.viewer),r=(this.editorHistory&&this.cloneTableToHistoryInfo(o),void 0),s=i.clone(),a=this.selection.end.paragraph.containerWidget,l=void 0;if(n!=a){for(var h=n.ownerRow;h!=a.ownerRow.nextRow;){for(var d=n.columnIndex;d<=a.columnIndex;d++){var l=h.childWidgets[d],p=s.clone(),c=new Lai;l.childWidgets=[],l.childWidgets[0]=p,(l.childWidgets[1]=c).containerWidget=l,p.containerWidget=l,p.index=0,c.index=1,h.childWidgets[d]=l,je(r)&&(r=this.selection.getFirstParagraph(l))}h=h.nextRow}this.tableReLayout(o,r,l)}else this.defaultPaste(e,t)}},c.prototype.pasteOverwriteCell=function(e){if(this.selection.start.paragraph.isInsideTable){this.checkIsNotRedoing()&&this.initHistory("PasteOverwrite");var t=this.getOwnerCell(this.selection.isForward),i=t.ownerRow.ownerTable.combineWidget(this.owner.viewer),n=(this.editorHistory&&this.cloneTableToHistoryInfo(i),e.clone()),o=n.childWidgets.length,r=this.getOwnerCell(!this.selection.isForward),e=(t.columnIndex,t.rowIndex),s=void 0,a=this.selection.start.paragraph.associatedCell.ownerRow,l=void 0,h=((m=n.childWidgets[0]).childWidgets.length,t.ownerRow);if(t!=r){for(var d=0,p=void 0,c=void 0,u=void 0,g=void 0;h!=r.ownerRow.nextRow;){for(var m,f=(m=n.childWidgets[d]||n.childWidgets[d=0]).childWidgets.length,y=0,v=t.columnIndex;v<=r.columnIndex;v++){1<p&&c===v&&(v++,p--,c=null),1<u&&f-(u-1)<=y&&(v+=(u=1)-1,y=0),g=(l=(m=n.childWidgets[d]).childWidgets[y]||m.childWidgets[y=0]).clone();for(var b=h.getCell(h.index,v),w=0;w<g.childWidgets.length;w++)(x=g.childWidgets[w]).containerWidget=b,g.childWidgets[w]=x;b.childWidgets=g.childWidgets,1<l.cellFormat.rowSpan&&(p=l.cellFormat.rowSpan,c=v),1<l.cellFormat.columnSpan&&(u=l.cellFormat.columnSpan),je(s)&&(s=this.selection.getFirstParagraph(g)),y++}h=h.nextRow,d++}this.tableReLayout(i,s,g,!0)}else{p=void 0,c=void 0,b=void 0;o>i.childWidgets.length-e&&(e=o-i.childWidgets.length+e,this.addRows(e,i));for(var C=0;C<o;C++){for(var v=t.columnIndex,S=(m=n.childWidgets[C]).childWidgets.length,A=0;A<S;A++){g=(l=m.childWidgets[A]).clone();1<p&&c===v&&(v++,p--,c=null),(b=a.childWidgets[v])||((b=g).containerWidget=a,b.index=v);for(var x,I=0;I<g.childWidgets.length;I++)(x=g.childWidgets[I]).containerWidget=b,g.childWidgets[I]=x;b.childWidgets=g.childWidgets,1<l.cellFormat.rowSpan&&(p=l.cellFormat.rowSpan,c=v),a.childWidgets.splice(v++,1,b),je(s)&&(s=this.selection.getFirstParagraph(b))}a=a.nextRow}this.tableReLayout(i,s,b,!0)}}},c.prototype.pasteAsNewRow=function(e){if(!this.owner.isReadOnlyMode&&this.canEditContentControl){this.checkIsNotRedoing()&&this.initHistory("PasteRow"),this.documentHelper.owner.isShiftingEnabled=!0;for(var t=this.getOwnerCell(this.selection.isForward).getSplitWidgets()[0],i=this.getOwnerCell(!this.selection.isForward).getSplitWidgets()[0],n=t.ownerTable.combineWidget(this.owner.viewer),t=i.ownerRow,o=(this.editorHistory&&this.cloneTableToHistoryInfo(n),this.getRowCountToInsert(),this.getColumnCountToInsert(),[]),i=t.rowIndex,r=(i++,e.childWidgets.length),s=0;s<r;s++){var a=e.childWidgets[s].clone();this.owner.enableTrackChanges&&this.insertRevision(a.rowFormat,"Insertion"),o.push(a)}n.insertTableRowsInternal(o,i,!1);t=void 0;if(n.childWidgets[i]instanceof jai)i=n.childWidgets[i].firstChild,t=this.selection.getFirstParagraph(i);else{for(var l=void 0;!(l instanceof _ai);)l=n.nextRenderedWidget;t=this.documentHelper.getFirstParagraphInFirstCell(l)}this.copyContent(n),this.documentHelper.layout.reLayoutTable(n),this.selection.selectParagraphInternal(t,!0),this.reLayout(this.selection,!0)}},c.prototype.tableUpdate=function(e){e.isGridUpdated=!1,e.calculateGrid(),e.buildTableColumns(),e.isGridUpdated=!0},c.prototype.rowspannedCollection=function(e,t){for(var i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i];1<n.cellFormat.rowSpan&&t.push(n)}return t},c.prototype.insertSpannedCells=function(e,t,i,n){for(var o=!1,r=0;r<e.childWidgets.length;r++){var s=e.childWidgets[r];if(1<s.cellFormat.rowSpan&&t.push(s),(s.columnIndex+s.cellFormat.columnSpan===n||n>s.columnIndex&&s.columnIndex+s.cellFormat.columnSpan>n&&n<s.columnIndex+s.cellFormat.columnSpan)&&(e.childWidgets.splice(s.cellIndex+1,0,i),o=!0),o)break}if(!o&&0<t.length)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+1,0,i),o=!0):n>l.columnIndex&&l.columnIndex+l.cellFormat.columnSpan>n&&n<l.columnIndex+l.cellFormat.columnSpan&&(e.childWidgets.splice(l.columnIndex,0,i),o=!0)),o)break}},c.prototype.addRows=function(e,t,i){var n,o,r;!this.owner.isReadOnlyMode&&this.canEditContentControl&&(n=this.selection.isForward?this.selection.start:this.selection.end,this.selection.isForward?this.selection.end:this.selection.start,o=t.childWidgets.length,r=(o=t.childWidgets[o-1]).childWidgets.length,n.paragraph.isInsideTable)&&(n=this.getOwnerCell(this.selection.isForward).getSplitWidgets()[0],r=(o=o.childWidgets[r-1]).ownerRow,this.rowInsertion(e,"Below",n,o,r,t,!1))},c.prototype.pasteContent=function(e,t){this.documentHelper.owner.isShiftingEnabled=!0;var i="",e=(i=this.editorHistory&&this.editorHistory.currentBaseHistoryInfo?(this.editorHistory.currentBaseHistoryInfo.insertPosition=void 0,this.updateInsertPosition(),this.editorHistory.currentBaseHistoryInfo.insertPosition):(n=this.selection.start,this.selection.isForward||(n=this.selection.end),n=this.selection.getParagraphInfo(n),this.selection.getHierarchicalIndex(n.paragraph,n.offset.toString())),this.documentHelper.owner.isLayoutEnabled=!0,this.documentHelper.owner.isPastingContent=!0,this.pasteCopiedData(e,t)),t="",n=(this.updateEndPosition(),t=this.editorHistory&&this.editorHistory.currentBaseHistoryInfo?this.editorHistory.currentBaseHistoryInfo.endPosition:(n=this.selection.getParagraphInfo(this.selection.start),this.selection.getHierarchicalIndex(n.paragraph,n.offset.toString())),this.selection.start.paragraph.isEmpty()&&this.selection.start.paragraph.paragraphFormat.bidi&&this.documentHelper.layout.reLayoutParagraph(this.selection.start.paragraph,0,0),new rci(this.documentHelper.owner)),i=(this.setPositionForCurrentIndex(n,i),new rci(this.documentHelper.owner));return this.setPositionForCurrentIndex(i,t),this.pasteTextPosition={startPosition:n,endPosition:i},this.documentHelper.owner.isPastingContent=!1,this.documentHelper.selection.fireSelectionChanged(!0),e},c.prototype.pasteCopiedData=function(e,t){var i,n=this.selection.start.paragraph.isInsideTable,o=!1,r=!1;this.documentHelper.layout.isBidiReLayout&&(this.documentHelper.layout.isBidiReLayout=!1),this.isPaste&&this.isSectionEmpty(this.selection)&&!this.selection.start.paragraph.isInHeaderFooter&&(this.previousSectionFormat=new ari,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 nai&&(i=this.selection.start.paragraph.bodyWidget.page,this.owner.viewer.updatePageBoundingRectangle(this.selection.start.paragraph.bodyWidget,i,i.boundingRectangle.y),this.owner.viewer.updateClientArea(this.selection.start.paragraph.bodyWidget,i)),o=!0),this.documentHelper.layout.isPastingContent=!0;for(var s=0;s<e.length;s++){0!==s&&this.insertSectionBreak(e[s].sectionFormat.breakCode,e[s].sectionFormat);for(var a=e[s].childWidgets,l=s===e.length-1,h=0;h<a.length;h++){var d,p=h===a.length-1,c=(p&&(n=!p),p&&l&&(this.documentHelper.layout.isPastingContent=!1),a[h]);if(c instanceof Lai&&0===c.childWidgets.length&&(c.childWidgets[0]=new Gai(c)),c instanceof Lai&&!je(t)&&(c.paragraphFormat.copyFormat(t),d=this.copyInsertFormat(this.selection.start.paragraph.characterFormat,!1),c.characterFormat.mergeFormat(d)),h!==a.length-1&&this.isPaste&&je(t)&&this.previousParaFormat&&c instanceof Lai&&!je(c.paragraphFormat.listFormat)&&je(c.paragraphFormat.listFormat.list)&&-1===c.paragraphFormat.listFormat.listId&&(this.previousParaFormat.listFormat&&this.previousParaFormat.listFormat.list&&-1!==this.previousParaFormat.listFormat.listId?(c.paragraphFormat.listFormat.copyFormat(this.previousParaFormat.listFormat),c.paragraphFormat.leftIndent=this.previousParaFormat.leftIndent):this.previousParaFormat.baseStyle&&this.previousParaFormat.baseStyle instanceof _ri&&this.previousParaFormat.baseStyle.paragraphFormat.listFormat&&this.previousParaFormat.baseStyle.paragraphFormat.listFormat.list&&-1!==this.previousParaFormat.baseStyle.paragraphFormat.listFormat.listId&&(d=this.previousParaFormat.baseStyle.paragraphFormat,c.paragraphFormat.listFormat.copyFormat(d.listFormat),c.paragraphFormat.leftIndent=d.leftIndent)),h===a.length-1&&c instanceof Lai&&!je(c.paragraphFormat.listFormat)&&je(c.paragraphFormat.listFormat.list)&&-1===c.paragraphFormat.listFormat.listId){var u,g=c;0<g.childWidgets.length&&0<g.childWidgets[0].children.length?("Center"!==(u=this.selection.start).paragraph.paragraphFormat.textAlignment&&"Right"!==u.paragraph.paragraphFormat.textAlignment||-1!==u.paragraph.paragraphFormat.listFormat.listId||(u.paragraph.x=this.owner.viewer.clientActiveArea.x),!je(this.editorHistory)&&this.editorHistory.currentBaseHistoryInfo&&this.editorHistory.currentBaseHistoryInfo.insertedNodes.push(g.clone()),r=this.insertElement(g.childWidgets[0].children,g.paragraphFormat)):p&&l&&(u=this.selection.start.paragraph,this.documentHelper.layout.reLayoutParagraph(u,0,0,u.paragraphFormat.bidi))}else if(c instanceof Dai){g=c,p=this.selection.start.paragraph;if(g instanceof _ai){var m,c=g;if(this.generateTableRevision(c),p.isInsideTable&&(m=p.getContainerWidth(),c.fitCellsToClientArea(m)),p.isEmpty()&&p.previousWidget instanceof _ai&&!this.isPaste)return this.insertTableRows(c,p.previousWidget),o}this.insertBlockInternal(g,void 0,n,this.isRemoteAction)}}}return this.documentHelper.layout.isPastingContent=!1,r&&(o=!0,"Footnote"===this.pasteFootNoteType?this.arrangeFootnoteCollection():"Endnote"===this.pasteFootNoteType&&this.arrangeEndnoteCollection()),!o&&je(this.documentHelper.blockToShift)&&this.shiftFootnoteContent(),o},c.prototype.arrangeEndnoteCollection=function(){for(var e=0;e<this.documentHelper.endnoteCollection.length;e++)for(var t=0;t<this.documentHelper.endnoteCollection.length-1-e;t++){var i=this.selection.getElementPosition(this.documentHelper.endnoteCollection[t]).startPosition,n=this.selection.getElementPosition(this.documentHelper.endnoteCollection[t+1]).startPosition;i.isExistBefore(n)||(i=this.documentHelper.endnoteCollection[t],this.documentHelper.endnoteCollection[t]=this.documentHelper.endnoteCollection[t+1],this.documentHelper.endnoteCollection[t+1]=i)}},c.prototype.arrangeFootnoteCollection=function(){for(var e=0;e<this.documentHelper.footnoteCollection.length;e++)for(var t=0;t<this.documentHelper.footnoteCollection.length-1-e;t++){var i=this.selection.getElementPosition(this.documentHelper.footnoteCollection[t]).startPosition,n=this.selection.getElementPosition(this.documentHelper.footnoteCollection[t+1]).startPosition;i.isExistBefore(n)||(i=this.documentHelper.footnoteCollection[t],this.documentHelper.footnoteCollection[t]=this.documentHelper.footnoteCollection[t+1],this.documentHelper.footnoteCollection[t+1]=i)}},c.prototype.generateTableRevision=function(e){if(this.owner.enableTrackChanges&&!je(e))for(var t=0;t<e.childWidgets.length;t++){var i=e.childWidgets[t];this.insertRevision(i.rowFormat,"Insertion");for(var n=0;n<i.childWidgets.length;n++)for(var o=i.childWidgets[n],r=0;r<o.childWidgets.length;r++){var s=o.childWidgets[r];je(s)||(s instanceof Lai?this.insertRevisionForBlock(s,"Insertion"):this.generateTableRevision(s))}}},c.prototype.isSectionEmpty=function(e){var t=e.start.paragraph;if(t){if(t.isInsideTable||t.isInHeaderFooter||t!==e.end.paragraph)return!1;var i=t.bodyWidget;if(i){var n=i.page;if(n&&(je(n.previousPage)||n.previousPage.sectionIndex!==n.sectionIndex)&&je(n.nextPage)&&t.isEmpty()&&1===i.childWidgets.length){var o=!0,n=e.start.paragraph.bodyWidget.sectionIndex,r=this.documentHelper.headersFooters[n];if(r){for(var s in r){var s=r[s];if(!(o=je(s)||(s=s.childWidgets[0])instanceof _ai||s instanceof Lai&&!s.isEmpty()?!1:o))break}return o}}}}return!1},c.prototype.insertTableInternal=function(e,t,i,n){var o,r=e.index,s=this.selection.start.paragraph;if(!e.isInsideTable&&t.isInsideTable&&(r=t.index,n=!0,o=s.containerWidget),i)for(var a=0,l=0;a<e.childWidgets.length;a++,l++){var h=e.childWidgets[a];t.childWidgets.splice(l,0,h),h.containerWidget=t,e.childWidgets.splice(a,1),a--}!s.isInsideTable&&je(o)?(e.containerWidget=s.containerWidget,o=s.containerWidget):je(o)&&(o=e.containerWidget),e.isInsideTable&&(o=o.combineWidget(this.owner.viewer)),this.constructRevisionsForTable(e,!1),n||this.removeBlock(e,!0),this.removeRevisionFromTable(t),o instanceof Uai?o=o.combineWidget(this.owner.viewer):(i=this.documentHelper.layout.checkAndGetBlock(o,r),-1!==o.childWidgets.indexOf(i)&&(r=o.childWidgets.indexOf(i))),o.childWidgets.splice(r,0,t),n||(e.containerWidget=void 0,t.index=e.index),t.containerWidget=o,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,o,t,!1)},c.prototype.removeRevisionFromTable=function(e){for(var t=0;t<e.childWidgets.length;t++){var i=e.childWidgets[t];if(0<i.rowFormat.revisions.length)for(var n,o=0;o<i.rowFormat.revisions.length;o++)0===i.rowFormat.revisions[o].range.length&&(n=i.rowFormat.revisions.indexOf(i.rowFormat.revisions[o]),i.rowFormat.revisions.splice(n,1),o--);for(o=0;o<i.childWidgets.length;o++)for(var r=i.childWidgets[o],s=0;s<r.childWidgets.length;s++){var a=r.childWidgets[s];a instanceof _ai&&this.removeRevisionFromTable(a)}}},c.prototype.canConstructRevision=function(e){return 0<e.revisions.length&&0===e.revisions[0].range.length||0<e.removedIds.length},c.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 o=0;o<n.childWidgets.length;o++)for(var r=n.childWidgets[o],s=0;s<r.childWidgets.length;s++)r.childWidgets[s]instanceof Lai?this.constructRevisionsForBlock(r.childWidgets[s],t):r.childWidgets[s]instanceof _ai&&this.constructRevisionsForTable(r.childWidgets[s],!0)}else this.removeDeletedCellRevision(n,!0)}},c.prototype.deleteRevision=function(e){if(0<e.rowFormat.revisions.length)for(var t=0;t<e.rowFormat.revisions.length;t++){for(var i=e.rowFormat.revisions[t],n=0;n<i.range.length;n++)i.range.splice(n,1),n--,this.owner.trackChangesPane.updateCurrentTrackChanges(i);0===i.range.length&&this.owner.revisions.remove(i)}},c.prototype.constructRevisionForFootnote=function(e,t){for(var i=0;i<e.bodyWidget.childWidgets.length;i++)e.bodyWidget.childWidgets[i]instanceof Lai&&this.constructRevisionsForBlock(e.bodyWidget.childWidgets[i],t)},c.prototype.constructRevisionsForBlock=function(e,t){for(var i=0;i<e.childWidgets.length;i++)for(var n,o=e.childWidgets[i],r=0;r<o.children.length;r++)t&&(o.children[r]instanceof Xai&&this.canConstructRevision(o.children[r])&&this.constructRevisionFromID(o.children[r],!0),o.children[r]instanceof fli)&&(n=o.children[r],this.constructRevisionForFootnote(n,t));this.canConstructRevision(e.characterFormat)&&this.constructRevisionFromID(e.characterFormat,!0)},c.prototype.applyRevisionForCurrentPara=function(e,t,i,n,o){for(var r=e.getInline(t+1,0),s=r.element,a=(r.element instanceof pli&&""===r.element.text&&!je(r.element.previousElement)&&(s=r.element.previousElement),!1),l=(t===e.getLength()&&(a=!0),t===i&&e.nextSplitWidget&&(i+=s.length),e.getInline(i,0).element),h=(je(e.nextSplitWidget)||(o=!1),0),d=e;d;)je(d)||(h+=d.getLength()),d=d.previousSplitWidget;if(je(e.previousSplitWidget)||0===h||t===h||(a=!1),h<i&&(o=!0),je(s)||je(l))je(s)||a?je(l)||(l.removedIds.push(n),this.constructRevisionFromID(l,!0,!0)):(s.removedIds.push(n),this.constructRevisionFromID(s,!0,!0));else if(a||s!==l){for(;!je(s)&&s!==l;)a||(s.removedIds.push(n),this.constructRevisionFromID(s,!0,!0)),je(s.nextNode)||(s=s.nextNode instanceof Dli?s.nextNode:s.nextNode.nextValidNodeForTracking),a=!1;je(s)||a||(s.removedIds.push(n),this.constructRevisionFromID(s,!0,!0))}else s.removedIds.push(n),this.constructRevisionFromID(s,!0,!0);o&&(0<e.characterFormat.removedIds.length&&(e.characterFormat.removedIds=[]),e.characterFormat.removedIds.push(n),this.constructRevisionFromID(e.characterFormat,!0,!0))},c.prototype.insertBlockTable=function(e,t,i){var n=e.start.offset,n=(e.start.paragraph.childWidgets.indexOf(e.start.currentWidget),t instanceof Lai&&0<n&&(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),0<n&&this.checkInsertPosition(e)&&this.updateHistoryPosition(e.start,!0),i.indexInOwner);i.containerWidget.childWidgets.splice(n,0,t),t.containerWidget=i.containerWidget,t.index=i.index,this.updateNextBlocksIndex(t,!0),t instanceof Lai&&this.constructRevisionsForBlock(t,!0),this.documentHelper.layout.layoutBodyWidgetCollection(t.index,t.containerWidget,t,!1),this.checkInsertPosition(e)&&(n=void 0,t instanceof Lai&&(n=t),t instanceof _ai&&(n=this.documentHelper.getFirstParagraphInFirstCell(t)),this.updateHistoryPosition(this.selection.getHierarchicalIndex(n,"0"),!0))},c.prototype.handleCut=function(e){var t=e.start,i=e.end,n=this.checkAndRemoveComments(),o=(e.isForward||(t=e.end,i=e.start),t.paragraph===i.paragraph&&t.offset+1===i.offset&&t.paragraph.getInline(i.offset,0).element,this.selection.getParagraphInfo(t)),o=(e.editPosition=this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString()),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),new rci(e.owner));this.setPositionForCurrentIndex(o,e.editPosition),e.selectContent(o,!0),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.checkEndPosition(e)&&this.updateHistoryPosition(e.end,!1),this.reLayout(e),this.updateHistoryForComments(n)},c.prototype.insertInlineInternal=function(e,t){var i,n=this.selection,o=e.length,r=this.selection.getParagraphInfo(n.start),s=(t=je(t)?"Insertion":t,n.start.paragraph.isEmpty()?("Center"!==(s=n.start.paragraph).paragraphFormat.textAlignment&&"Right"!==s.paragraphFormat.textAlignment||-1!==s.paragraphFormat.listFormat.listId||(s.x=this.owner.viewer.clientActiveArea.x),i=!je(this.editorHistory)&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing),s.childWidgets[0].children.push(e),e.line=s.childWidgets[0],this.owner.enableTrackChanges&&e.isValidNodeForTracking&&!i&&this.insertRevision(e,t),(0<e.removedIds.length||i)&&this.constructRevisionFromID(e,!0),e.linkFieldCharacter(this.documentHelper),e instanceof fli&&(this.constructRevisionForFootnote(e,!0),i&&(e.isLayout=!1),"Footnote"===e.footnoteType&&this.updateFootnoteCollection(e),"Endnote"===e.footnoteType)&&this.updateEndnoteCollection(e),this.documentHelper.layout.reLayoutParagraph(s,0,0,void 0,void 0)):(n=(s=n.start.currentWidget.getInline(n.start.offset,i=0)).element,i=s.index,this.insertElementInternal(n,e,i,t,!0)),e.revisions[0]);je(s)||this.owner.trackChangesPane.updateCurrentTrackChanges(s),this.setPositionParagraph(r.paragraph,r.offset+o,!0)},c.prototype.insertElement=function(e,t){var i=!1,n=this.selection,o=0,r=void 0,s=-1,a=void 0,l=0,h=void 0,d=this.selection.getParagraphInfo(n.start),p=this.owner.enableTrackChanges,c=void 0,u=void 0,g=0;n.start.paragraph.isEmpty()?(a=(r=n.start.paragraph).childWidgets[0],s=0):(c=(n=n.start.currentWidget.getInline(n.start.offset,g)).element,g=n.index,s=(r=c.line.paragraph).childWidgets.indexOf(c.line),l=c.indexInOwner,a=c.line,g===c.length?(l++,h=!1):0===g?(je(c.previousNode)&&(l=0),h=!0):(l++,(u=new pli).characterFormat.copyFormat(c.characterFormat),u.text=c.text.substring(g),c.text=c.text.slice(0,g),c.isWidthUpdated=!1,0<c.revisions.length&&!this.owner.enableTrackChanges&&this.splitRevisionForSpittedElement(c,u),a.children.splice(l,0,u),u.line=c.line));for(var m=0;m<e.length;m++){o+=e[m].length,e[m]instanceof pli&&0<=e[m].text.indexOf(" ")&&(this.documentHelper.triggerSpellCheck=!0);var f=e[m].revisions.length,y=(e[m].ischangeDetected=!0,a.children.splice(l,0,e[m]),e[m].line=a,e[m].linkFieldCharacter(this.documentHelper),this.updateRevisionForElement(c,e[m],g,0===m,u,h));p&&!y&&e[m].revisions.length===f&&this.checkToCombineRevisionsinBlocks(e[m],f===e[m].revisions.length,0<m&&m===e.length-1,"Insertion"),c=e[m],l++,e[m]instanceof fli&&(this.pasteFootNoteType=e[m].footnoteType,i=!0)}if(!this.isPaste&&t&&(je(r.paragraphFormat.listFormat.list)||!je(r.paragraphFormat.listFormat)&&-1===r.paragraphFormat.listFormat.listId)&&r.paragraphFormat.copyFormat(t),this.isPaste){if(this.isRemoteAction)for(var v=t.ownerBase.characterFormat.revisions,b=!1,m=0;m<v.length;m++){r.characterFormat.revisions.push(v[m]);for(var w=v[m].range,C=0;C<w.length;C++)if(w[C]instanceof Eri&&w[C]==t.ownerBase.characterFormat){w.splice(C,1),w.push(r.characterFormat),b=!0;break}if(b)break}r.textWrapWidth=!1,this.viewer.updateClientAreaForBlock(r,!0),r.x=this.viewer.clientActiveArea.x}return this.documentHelper.layout.reLayoutParagraph(r,s,0,this.isInsertField?void 0:r.paragraphFormat.bidi),this.setPositionParagraph(d.paragraph,d.offset+o,!0),i},c.prototype.updateRevisionForElement=function(e,t,i,n,o,r){if(this.owner.enableTrackChanges&&(!je(e)||!je(o))){var s=!!je(r),a=t.revisions.length;if(!n)return this.insertRevisionAtEnd(e,t,"Insertion");if(!s)return r?this.insertRevisionAtBegining(e,t,"Insertion"):this.insertRevisionAtEnd(e,t,"Insertion");this.checkToMapRevisionWithInlineText(e,i,t,!1,"Insertion")||t.revisions.length>a?this.copyElementRevision(e,o,!0):0===t.revisions.length&&(this.splitRevisionForSpittedElement(e,o),this.insertRevision(t,"Insertion"))}return!1},c.prototype.insertElementInternal=function(e,t,i,n,o,r){var s=e.line,a=s.paragraph,l=s.indexInOwner,h=e.indexInOwner,d=a.paragraphFormat.bidi&&e.isRightToLeft,p=!1,c=(n=je(n)?"Insertion":n,this.skipTracking()),u=this.owner.enableTrackChanges,g=!1,m=t.revisions.length;(p=this.owner.editorHistoryModule&&(this.owner.editorHistoryModule.isUndoing||this.owner.editorHistoryModule.isRedoing)&&t instanceof pli?e.characterFormat.isEqualFormat(t.characterFormat)&&this.documentHelper.textHelper.isRTLText(t.text):p)?(e.text=e.text.substring(0,i)+t.text+e.text.substring(i),e.isWidthUpdated=!1):i===e.length?(h=this.incrementCommentIndex(d,e,h),0<t.removedIds.length||c?this.constructRevisionFromID(t,!0,!1,e):!u||c||this.skipFieldDeleteTracking||(g=this.insertRevisionAtEnd(e,t,n)),t instanceof fli&&(0<t.revisions.length&&(this.footnoteRevision=t.revisions[0]),this.constructRevisionForFootnote(t,!0),this.footnoteRevision=void 0),s.children.splice(h,0,t),t instanceof Zai&&2===t.fieldType&&this.constructRevisionnsForLink(t,!1)):0===i?(0<t.removedIds.length?this.constructRevisionFromID(t,!1,!1,void 0,h):!u||c||this.skipFieldDeleteTracking||(g=this.insertRevisionAtBegining(e,t,n)),je(e.previousNode)?(e.line.children.splice(0,0,t),h=0):e.line.children.splice(h,0,t)):this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.editorHistory.currentBaseHistoryInfo.isHyperlinkField&&t instanceof Zai&&1===t.fieldType&&0<t.removedIds.length?(this.constructRevisionFromID(t,!1),s.children.splice(h,0,t)):(h=this.incrementCommentIndex(d,e,h),(p=new pli).characterFormat.copyFormat(e.characterFormat),p.text=e.text.substring(i),0<e.revisions.length&&!u&&!c&&0===t.removedIds.length&&this.splitRevisionForSpittedElement(e,p),e.text=e.text.substr(0,i),e.isWidthUpdated=!1,s.children.splice(h,0,p),p.line=e.line,g=!0,this.isTrackingFormField=e.previousElement instanceof Zai,0<t.removedIds.length&&!this.isTrackingFormField?(this.constructRevisionFromID(t,!1),this.copyElementRevision(e,p,!0)):this.owner.enableTrackChanges&&(t instanceof Dli||t instanceof Khi||t instanceof ghi||t instanceof phi?t instanceof Khi?(this.splitRevisionForSpittedElement(e,p),this.copyElementRevision(e,t,!1)):this.copyElementRevision(e,p,!1):this.checkToMapRevisionWithInlineText(e,i,t,d,n)||t.revisions.length>m?this.copyElementRevision(e,p,!0):t.revisions.length===m&&(this.splitRevisionForSpittedElement(e,p),this.insertRevision(t,n))),s.children.splice(h,0,t),--h),t.line=e.line,t instanceof Dli&&(d=this.documentHelper.bookmarks,t.reference&&(t.reference.reference=t),d.containsKey(t.name)||d.add(t.name,t)),!je(t.line.paragraph.containerWidget)&&!je(t.line.paragraph.containerWidget.containerWidget)&&t.line.paragraph.containerWidget.containerWidget instanceof Pai&&(t.line.paragraph.containerWidget.containerWidget.height+=t.height),t.linkFieldCharacter(this.documentHelper),t instanceof Pli&&0===t.type&&(this.insertContentControlInCollection(t),this.owner.editorHistoryModule)&&(this.owner.editorHistoryModule.isUndoing||this.owner.editorHistoryModule.isRedoing)&&this.updatePropertiesToBlock(t,!0),(t instanceof rhi&&"Inline"!==t.textWrappingStyle||t instanceof Xli)&&(-1===a.floatingElements.indexOf(t)&&a.floatingElements.push(t),-1===a.bodyWidget.floatingElements.indexOf(t))&&"Inline"!==t.textWrappingStyle&&a.bodyWidget.floatingElements.push(t),!u||g||c||this.skipFieldDeleteTracking||this.checkToCombineRevisionsinBlocks(t,m===t.revisions.length,i===e.length,n),t instanceof fli&&(c&&(t.isLayout=!1),"Footnote"===t.footnoteType&&(this.updateFootnoteCollection(t),this.updateFootNoteIndex()),"Endnote"===t.footnoteType)&&(this.updateEndnoteCollection(t),this.updateEndNoteIndex()),t instanceof Khi||this.combineElementRevisionToPrevNxt(t),o&&!r&&this.documentHelper.layout.reLayoutParagraph(a,l,h,void 0,void 0)},c.prototype.incrementCommentIndex=function(e,t,i){return this.owner.editorHistoryModule&&this.owner.editorHistoryModule&&this.owner.editorHistoryModule.currentHistoryInfo&&(!this.owner.editorHistoryModule||!this.owner.editorHistoryModule.currentHistoryInfo||"SkipCommentInline"===this.owner.editorHistoryModule.currentHistoryInfo.action&&("SkipCommentInline"!==this.owner.editorHistoryModule.currentHistoryInfo.action||this.owner.editorHistoryModule.currentHistoryInfo.modifiedActions[0]!==this.editorHistory.currentBaseHistoryInfo&&(this.owner.editorHistoryModule.currentHistoryInfo.modifiedActions[0]===this.editorHistory.currentBaseHistoryInfo||t instanceof Khi)))||i++,i},c.prototype.constructRevisionFromID=function(e,t,i,n,o){if(0<e.removedIds.length){for(var r=0;r<e.removedIds.length;r++){var s=void 0;if(this.documentHelper.revisionsInternal.containsKey(e.removedIds[r])){s=this.documentHelper.revisionsInternal.get(e.removedIds[r]),e.revisions.push(s),je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||this.editorHistory.currentBaseHistoryInfo.markerData.push(this.getMarkerData(e,void 0,s));var a=e instanceof Zai&&0===e.fieldType,a=(t=!!t||!a&&this.skipTracking(),!1);if(this.editorHistory.isUndoing&&this.owner.editorHistoryModule.currentBaseHistoryInfo&&this.owner.editorHistoryModule.currentBaseHistoryInfo.isHyperlinkField&&"Accept Change"===this.owner.editorHistoryModule.currentBaseHistoryInfo.action&&e instanceof Zai&&1===e.fieldType&&(a=!0),t&&(this.editorHistory.isRedoing&&this.owner.editorHistoryModule.currentBaseHistoryInfo&&"BackSpace"===this.owner.editorHistoryModule.currentBaseHistoryInfo.action&&this.selection.isTOC()&&(t=!1),this.editorHistory.isRedoing)&&this.owner.editorHistoryModule.currentHistoryInfo&&"RemoveHyperlink"===this.owner.editorHistoryModule.currentHistoryInfo.action&&e instanceof Zai&&0===e.fieldType&&(t=!1),!je(o)&&0<s.range.length&&s.range[s.range.length-1]instanceof pli&&s.range[s.range.length-1].paragraph.indexInOwner===this.selection.start.paragraph.indexInOwner)s.range.splice(o,0,e);else if(je(n)){var l=void 0;if(!je(this.owner.editorHistory)&&(this.owner.editorHistory.isUndoing||this.owner.editorHistory.isRedoing)&&!(e instanceof Cri)){for(var h=this.owner.selectionModule.start.paragraph.index,d=this.owner.selectionModule.start.paragraph.isInsideTable,p=(e instanceof Eri&&e.ownerBase?h=e.ownerBase.index:e instanceof pli&&e.paragraph&&d&&(h=e.paragraph.index),0),c=0;c<s.range.length;c++)if(s.range[c]instanceof pli?p=s.range[c].paragraph.index:s.range[c]instanceof Eri&&(p=s.range[c].ownerBase.index),h<p){l=c;break}t&&h===p&&je(l)&&0<s.range.length&&s.range[s.range.length-1]instanceof Eri&&(l=s.range.length-1)}je(l)&&(l=t?s.range.length:0),s.range.splice(l,0,e)}else{d=s.range.indexOf(n);0<=(d=-1===d&&a&&0<s.range.length?s.range.indexOf(s.range[s.range.length-1]):d)?s.range.splice(d+(t?1:0),0,e):s.range.splice(0,0,e)}i||this.owner.trackChangesPane.updateCurrentTrackChanges(s),this.updateRevisionCollection(s)}}e.removedIds=[]}else for(r=0;r<e.revisions.length;r++){var u=e.revisions[r];this.documentHelper.revisionsInternal.containsKey(u.revisionID)&&((u=this.documentHelper.revisionsInternal.get(u.revisionID)).range.splice(t?u.range.length:0,0,e),this.updateRevisionCollection(u))}},c.prototype.insertBlock=function(e,t){var i=!0,n=!1,o=this.selection;o.isEmpty||(i=this.removeSelectedContents(o),n=!0),i||o.selectContent(o.start,!1),this.insertBlockInternal(e,n,t),this.checkInsertPosition(o)&&(i=void 0,i=e instanceof Lai?e:this.documentHelper.getFirstParagraphInFirstCell(e),this.updateHistoryPosition(this.selection.getHierarchicalIndex(i,"0"),!0)),this.fireContentChange()},c.prototype.insertBlockInternal=function(e,t,i,n){var o=this.selection,r=this.selection.start.paragraph,s=this.selection.start.isAtParagraphStart;if(!o.start.isAtParagraphStart){if(e instanceof Lai)return a=o.start.clone(),this.isInsertingTOC||!this.owner.enableTrackChanges||this.skipTracking()||n||(o.start.isAtParagraphEnd&&this.isRevisionMatched(r.characterFormat,"Insertion")?this.insertRevisionForBlock(e,"Insertion",!1,this.retrieveRevisionByType(r.characterFormat,"Insertion")):this.insertRevisionForBlock(e,"Insertion")),je(this.editorHistory)||!this.editorHistory.currentBaseHistoryInfo||this.editorHistory.isUndoing||this.editorHistory.isRedoing||this.editorHistory.currentBaseHistoryInfo.insertedNodes.push(e.clone()),this.insertNewParagraphWidget(e,!1),void(this.isInsertingTOC||this.combineRevisions(e,a,this.selection.end));this.updateInsertPosition(),r=r.combineWidget(this.owner.viewer),je(this.editorHistory)||!this.editorHistory.currentBaseHistoryInfo||this.editorHistory.isUndoing||this.editorHistory.isRedoing||this.editorHistory.currentBaseHistoryInfo.insertedNodes.push(r),this.splitParagraph(r,r.firstChild,0,o.start.currentWidget,o.start.offset,!1),o.selectParagraphInternal(this.selection.start.paragraph,!0)}var a=o.start.paragraph.containerWidget,r=o.start.paragraph.index;je(a)||!je(this.editorHistory)&&(je(this.editorHistory.currentBaseHistoryInfo)||this.editorHistory.isUndoing||this.editorHistory.isRedoing||this.editorHistory.currentBaseHistoryInfo.insertedNodes.push(e.clone()),this.editorHistory.isRedoing)&&t&&a.firstChild instanceof Lai&&a.firstChild.isEmpty()&&a.firstChild===a.lastChild&&e instanceof Lai&&e.isEmpty()||(t=a.childWidgets.indexOf(o.start.paragraph),a.childWidgets[a.childWidgets.length-1]===o.start.paragraph&&e instanceof Lai&&e.isSectionBreak&&(t++,r++),o.start.paragraph.isEmpty()&&o.start.paragraph.index===e.index&&1===a.childWidgets.length&&o.start.paragraph.containerWidget.containerWidget instanceof Pai&&this.owner.editorHistory.isUndoing&&a.childWidgets.splice(0,1),a.childWidgets.splice(t,0,e),e.containerWidget=a,e.index=r,e.height=0,e instanceof _ai&&(e.isGridUpdated=!1,e.buildTableColumns(),e.isGridUpdated=!0),this.updateNextBlocksIndex(e,!0),!this.isInsertingTOC&&this.owner.enableTrackChanges&&!this.skipTracking()&&e instanceof Lai&&!n?this.insertRevisionForBlock(e,"Insertion"):e instanceof Lai?this.constructRevisionsForBlock(e,!0):e instanceof _ai&&this.constructRevisionsForTable(e,!0),this.documentHelper.owner.editorModule.isRemoteAction&&!s&&e instanceof _ai&&(this.updateNextBlocksIndex(e.nextWidget,!1),a.childWidgets.splice(e.indexInOwner+1,1)),e instanceof Lai&&this.documentHelper.layout.linkFieldInParagraph(e),this.isPaste&&!je(e.previousWidget)&&e.previousWidget instanceof Lai&&e instanceof Lai&&e.paragraphFormat.contextualSpacing&&!i&&this.documentHelper.layout.reLayoutParagraph(e.previousWidget,0,0),this.documentHelper.layout.layoutBodyWidgetCollection(r,a,e,!1,void 0,i))},c.prototype.insertImage=function(e,t,i,n){this.insertImageInternal(e,!1,t,i,n)},c.prototype.insertImageAsync=function(t,i,n,o){return Rci(this,void 0,void 0,function(){return Oci(this,function(e){switch(e.label){case 0:return[4,this.insertImageInternal(t,!1,i,n,o)];case 1:return e.sent(),[2]}})})},c.prototype.insertImageInternal=function(r,s,a,l,h){return Rci(this,void 0,void 0,function(){var o=this;return Oci(this,function(e){return[2,new Promise(function(e,t){var i,n=o.selection.getCurrentFormField(),n="FormFieldsOnly"===o.documentHelper.protectionType&&!je(n)&&n.formFieldData instanceof ili;!o.owner.isReadOnlyMode&&o.canEditContentControl||n?(je(a)||je(l)?(n=document.createElement("img"),i=o,n.addEventListener("load",function(){this.width=je(a)?this.width:a,this.height=je(l)?this.height:l,i.insertPicture(r,this.width,this.height,this.alt,!0),e()}),n.src=r):(o.insertPicture(r,a,l,h,s),e()),setTimeout(function(){je(o.documentHelper)||o.viewer.updateScrollBars()},30)):e()})]})})},c.prototype.insertTable=function(e,t){var i,n,o=this.selection.start;this.owner.isReadOnlyMode||!this.canEditContentControl||this.selection.isPlainContentControl()||(e=e||1,t=t||1,(i=new Cn("documenteditor",this.owner.defaultLocale)).setLocale(this.documentHelper.owner.locale),t<1||t>this.documentHelper.owner.documentEditorSettings.maximumColumns?(n=i.getConstant("Number of columns must be between")+" 1 "+i.getConstant("and")+" "+this.documentHelper.owner.documentEditorSettings.maximumColumns.toString(),WC.alert(n).enableRtl=this.documentHelper.owner.enableRtl):e<1||e>this.documentHelper.owner.documentEditorSettings.maximumRows?(n=i.getConstant("Number of rows must be between")+" 1 "+i.getConstant("and")+" "+this.documentHelper.owner.documentEditorSettings.maximumColumns.toString(),i.getConstant("Number of rows must be between 1 and 32767.").replace("32767",this.documentHelper.owner.documentEditorSettings.maximumRows.toString()),WC.alert(n).enableRtl=this.documentHelper.owner.enableRtl):(i=this.createTable(e,t),n=o.paragraph.getContainerWidth()-i.tableFormat.leftIndent,i.splitWidthToTableCells(n),e=o.paragraph.previousWidget,o.currentWidget.isFirstLine()&&0===o.offset&&e instanceof _ai?(this.insertTableRows(i,e),i.destroy()):(t=this.checkAndRemoveComments(),this.initHistory("InsertTable"),this.documentHelper.owner.isShiftingEnabled=!0,this.insertBlock(i),!je(i.containerWidget)&&!je(i.containerWidget.containerWidget)&&i.containerWidget.containerWidget instanceof Pai&&(i.containerWidget.containerWidget.height+=i.height,this.isTableInsert=!0),n=this.documentHelper.getFirstParagraphInFirstCell(i).childWidgets[0],o.setPosition(n,!0),this.selection.end.setPositionInternal(o),n=(e=this.documentHelper.getLastParagraphInLastCell(i.getSplitWidgets().pop())).getLength()+1,this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.endPosition=this.selection.getHierarchicalIndex(e,n.toString())),this.reLayout(this.selection),this.isTableInsert=!1,this.updateHistoryForComments(t))))},c.prototype.insertRow=function(e,t){var i,n,o,r,e=e?"Above":"Below";!this.owner.isReadOnlyMode&&this.canEditContentControl&&(i=this.selection.isForward?this.selection.start:this.selection.end,this.selection.isForward?this.selection.end:this.selection.start,i.paragraph.isInsideTable&&(this.checkIsNotRedoing()&&this.initHistory("Above"==e?"InsertRowAbove":"InsertRowBelow"),this.documentHelper.owner.isShiftingEnabled=!0,i=this.getOwnerCell(this.selection.isForward).getSplitWidgets()[0],n=this.getOwnerCell(!this.selection.isForward).getSplitWidgets()[0],o=i.ownerTable.combineWidget(this.owner.viewer),r=("Below"==e?n:i).ownerRow,this.editorHistory&&this.cloneTableToHistoryInfo(o),this.rowInsertion(t,e,i,n,r,o,!0)),this.reLayout(this.selection,!0))},c.prototype.rowInsertion=function(e,t,i,n,o,r,s){var a=e||this.getRowCountToInsert(),l=[],h=o.rowIndex;"Below"===t&&(h++,e=je(n.previousWidget)||n.columnIndex===n.previousWidget.columnIndex+1,n.cellIndex!==n.columnIndex&&e&&o.rowIndex+i.cellFormat.rowSpan-1===n.ownerRow.rowIndex||1<n.cellFormat.rowSpan&&!je(o.nextWidget)&&o.nextWidget instanceof jai&&(n.cellFormat.rowSpan+=a,o=o.nextWidget),o.bottomBorderWidth=0);for(var d=0;d<a;d++){var p=this.updateRowspan(o,"Below"===t?n:i,t),c=this.createRowAndColumn(p.count,d,h,r);c.rowFormat=o.rowFormat.cloneFormat(),c.rowFormat.ownerBase=c,this.owner.enableTrackChanges&&this.insertRevision(c.rowFormat,"Insertion"),this.updateCellFormatForInsertedRow(c,p.cellFormats),!je(this.editorHistory)&&this.editorHistory.currentBaseHistoryInfo&&this.editorHistory.currentBaseHistoryInfo.insertedNodes.push(c),l.push(c)}r.insertTableRowsInternal(l,h,s);var u,e=void 0;if(r.childWidgets[h]instanceof jai)u=r.childWidgets[h].firstChild,e=this.selection.getFirstParagraph(u);else{for(var g=void 0;!(g instanceof _ai);)g=r.nextRenderedWidget;e=this.documentHelper.getFirstParagraphInFirstCell(g)}s&&this.documentHelper.layout.reLayoutTable(r),this.selection.selectParagraphInternal(e,!0)},c.prototype.autoFitTable=function(e){!this.documentHelper.owner.isReadOnlyMode&&this.canEditContentControl&&this.insertAutoFitTable(e)},c.prototype.insertAutoFitTable=function(e,t){je(t)&&(n=this.selection.start,i=this.selection.end,this.selection.isForward||(n=this.selection.end,i=this.selection.start),t=(t=this.selection.getTable(n,i)).getSplitWidgets()[0]);var i,n=this.documentHelper.layout.getParentTable(t);je(n)||(this.setOffsetValue(this.selection),n=n.combineWidget(this.owner.viewer),this.initHistory("FitToContents"===e?"TableAutoFitToContents":"FitToWindow"===e?"TableAutoFitToWindow":"TableFixedColumnWidth"),this.documentHelper.owner.editorHistoryModule&&this.cloneTableToHistoryInfo(n),n.updateProperties(!0,t,e),this.documentHelper.owner.isShiftingEnabled=!0,this.documentHelper.layout.reLayoutTable(t),this.reLayout(this.selection,!0))},c.prototype.rowInsertionForCE=function(e,t,i,n,o,r,s,a){for(var l=[],h=0;h<i;h++){var d=this.createRowAndColumn(t,h,e,n);this.documentHelper.owner.parser.parseRowFormat(o,d.rowFormat,0);for(var p=0;p<t;p++){var c=d.childWidgets[p];this.documentHelper.owner.parser.parseCellFormat(r[p],c.cellFormat,0),this.documentHelper.owner.parser.parseParagraphFormat(0,s[p],c.childWidgets[0].paragraphFormat),this.documentHelper.owner.parser.parseCharacterFormat(0,a[p],c.childWidgets[0].characterFormat)}this.owner.enableTrackChanges&&this.insertRevision(d.rowFormat,"Insertion"),l.push(d)}n.insertTableRowsInternal(l,e,!0);var u,g=void 0;if(n.childWidgets[e]instanceof jai)u=n.childWidgets[e].firstChild,g=this.selection.getFirstParagraph(u);else{for(var m=void 0;!(m instanceof _ai);)m=n.nextRenderedWidget;g=this.documentHelper.getFirstParagraphInFirstCell(m)}this.documentHelper.layout.reLayoutTable(n),this.selection.selectParagraphInternal(g,!0),this.reLayout(this.selection,!0)},c.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},c.prototype.updateRowspan=function(e,t,i){for(var n=e.getPreviousRowSpannedCells(!0),o=0,r=[],s=0;s<e.childWidgets.length;s++){for(var a,l,h=e.childWidgets[s],d=!1,p=je(h.previousWidget)||h.columnIndex!==h.previousWidget.columnIndex+1,c=0;c<n.length;c++)p&&(l=(a=n[c]).ownerRow.rowIndex+a.cellFormat.rowSpan-1,h.columnIndex<a.columnIndex&&h.cellIndex!==h.columnIndex&&!d&&(d=!0,o++,r.push(h.cellFormat)),1===t.cellFormat.rowSpan?l>h.ownerRow.rowIndex?"Above"===i&&a.ownerRow===t.ownerRow||(a.cellFormat.rowSpan+=1,n.splice(c,1),c--):h.cellIndex!==h.columnIndex&&p&&l===h.ownerRow.rowIndex&&("Above"===i?a.cellFormat.rowSpan+=1:(o++,r.push(a.cellFormat)),n.splice(c,1),c--):a!==t&&("Above"!==i||a.ownerRow!==t.ownerRow&&a.columnIndex!==t.columnIndex)&&a.columnIndex!==t.columnIndex&&a.ownerRow.rowIndex!==h.ownerRow.rowIndex&&(l>t.ownerRow.rowIndex||"Above"===i&&l===t.ownerRow.rowIndex)&&(a.cellFormat.rowSpan+=1,n.splice(c,1),c--));(d=-1===n.indexOf(h)&&1<h.cellFormat.rowSpan?!0:d)||(o++,r.push(h.cellFormat))}return r.sort(function(e,t){return e.ownerBase.columnIndex-t.ownerBase.columnIndex}),{count:o,cellFormats:r}},c.prototype.getInsertedTable=function(e,t){e.childWidgets&&0<e.childWidgets.length&&(e.childWidgets.splice(0,t),this.editorHistory.currentBaseHistoryInfo.insertedNodes.push(e))},c.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],n=t.childWidgets.length,o=!1,r=e.tableFormat.borders,s=t.tableFormat.borders,r=(r.left.lineStyle===s.left.lineStyle&&r.top.lineStyle===s.top.lineStyle&&r.right.lineStyle===s.right.lineStyle&&r.bottom.lineStyle===s.bottom.lineStyle||(o=!0),t.insertTableRowsInternal(e.childWidgets,n,!0,o),t.clone()),s=(this.getInsertedTable(r,n),this.selection.getFirstParagraph(i.nextWidget.childWidgets[0]));t.isDefaultFormatUpdated=!1,this.documentHelper.layout.reLayoutTable(t),this.checkInsertPosition(this.selection)&&this.updateHistoryPosition(this.selection.getHierarchicalIndex(s,"0"),!0),this.selection.start.setPosition(s.firstChild,!0),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.updateHistoryPosition(this.selection.end,!1),this.selection.end.setPosition(s.firstChild,!0),this.reLayout(this.selection)},c.prototype.insertColumn=function(e,t){if(!this.owner.isReadOnlyMode&&this.canEditContentControl){e=e?"Left":"Right";if(this.selection.start.paragraph.isInsideTable){this.checkIsNotRedoing()&&this.initHistory("Left"==e?"InsertColumnLeft":"InsertColumnRight"),this.selection.owner.isShiftingEnabled=!0;for(var i=this.getOwnerCell(this.selection.isForward),n=this.getOwnerCell(!this.selection.isForward),o=i.ownerRow.ownerTable.combineWidget(this.owner.viewer),r=(this.editorHistory&&this.cloneTableToHistoryInfo(o),this.selection.owner.isLayoutEnabled=!1,i.columnIndex),s=("Right"==e&&(r=n.columnIndex+n.cellFormat.columnSpan),void 0),a=void 0,l=t||this.getColumnCountToInsert(),h=[],d=0;d<l;d++)for(var p=0;p<o.childWidgets.length;p++){var c=o.childWidgets[p];(a=this.createColumn(this.selection.getLastParagraph(i))).index=p,a.rowIndex=c.rowIndex,a.containerWidget=c,a.cellFormat.copyFormat(i.cellFormat),a.cellFormat.rowSpan=1,je(s)&&(s=this.selection.getFirstParagraph(a)),0===r?c.childWidgets.splice(r,0,a):this.insertSpannedCells(c,h,a,r),this.copyCellFormats(c,r),this.editorHistory.currentBaseHistoryInfo.insertedNodes.push(a)}this.tableReLayout(o,s,a)}}},c.prototype.cellInsertionForCE=function(e,t,i,n,o){var r=void 0,r=this.createColumn(void 0),s=new Gai(r.childWidgets[0]);r.childWidgets[0].childWidgets.push(s),r.index=t.index,r.rowIndex=t.rowIndex,r.containerWidget=t,this.documentHelper.owner.parser.parseCellFormat(i,r.cellFormat,0),this.documentHelper.owner.parser.parseParagraphFormat(0,n,r.childWidgets[0].paragraphFormat),this.documentHelper.owner.parser.parseCharacterFormat(0,o,r.childWidgets[0].characterFormat),r.cellFormat.rowSpan=1,t.childWidgets.splice(e,0,r)},c.prototype.copyCellFormats=function(e,t){var i=e.childWidgets[t];if(!je(i)){for(var i=i.childWidgets[0],e=(t==e.childWidgets.length-1?--t:++t,e.childWidgets[t]),n=e.childWidgets[0];n instanceof _ai;)n=n.childWidgets[0].childWidgets[0].childWidgets[0];var o,t=e.childWidgets[0],e=void 0;0<t.childWidgets.length&&0<(o=t.childWidgets[0]).children.length&&(e=o.children[0]),i.paragraphFormat.copyFormat(t.paragraphFormat),je(e)?i.characterFormat.copyFormat(t.characterFormat):i.characterFormat.copyFormat(e.characterFormat)}},c.prototype.copyContent=function(e){var t,i;this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.owner.enableCollaborativeEditing&&(i=this.documentHelper.getLastParagraphBlock(e),0===(e=this.documentHelper.getFirstParagraphBlock(e)).childWidgets.length&&(e.childWidgets[0]=new Gai(e)),0===i.childWidgets.length&&(i.childWidgets[0]=new Gai(i)),e=e.firstChild,t=i.lastChild,i=i.lastChild.getEndOffset(),e=je(this.owner.sfdtExportModule)?{}:this.owner.sfdtExportModule.write(this.owner.documentEditorSettings.optimizeSfdt?1:0,e,0,t,i,!1,!0),this.editorHistory.currentBaseHistoryInfo.pasteContent=e)},c.prototype.tableReLayout=function(e,t,i,n){e.updateRowIndex(0);var o=this.documentHelper.layout.getParentTable(e);(o||e).fitChildToClientArea(),this.selection.owner.isLayoutEnabled=!0,e.isGridUpdated=!1,e.buildTableColumns(),e.isGridUpdated=!0,this.documentHelper.skipScrollToPosition=!0,n&&this.copyContent(e),this.documentHelper.layout.reLayoutTable(e),this.selection.start.setPosition(t.firstChild,!0),this.selection.end.setPosition(this.selection.getLastParagraph(i).firstChild,!1),(this.checkIsNotRedoing()||je(this.editorHistory))&&this.reLayout(this.selection)},c.prototype.createTable=function(e,t){this.selection.start.paragraph;for(var i=new _ai,n=(i.tableFormat.preferredWidthType="Auto",i.tableFormat.leftIndent=this.selection.start.paragraph.leftIndent,i.tableFormat.initializeTableBorders(),0);n<e;){var o=this.createRowAndColumn(t,n);o.rowFormat.heightType="Auto",this.owner.enableTrackChanges&&this.insertRevision(o.rowFormat,"Insertion"),(o.containerWidget=i).childWidgets.push(o),n++}return i},c.prototype.createRowAndColumn=function(e,t,i,n){var o=n,r=this.selection.start.paragraph,s=new jai;s.rowFormat=new Cri(s),s.index=t;for(var a=0;a<e;a++){if(!je(i)&&!je(o))if(i&&0<i&&o.childWidgets[i-1]&&o.childWidgets[i-1].childWidgets[a]){for(var l=o.childWidgets[i-1].childWidgets[a].childWidgets[0];l instanceof _ai;)l=l.childWidgets[0].childWidgets[0].childWidgets[0];r=l}else if(0==i){for(l=o.childWidgets[i].childWidgets[a].childWidgets[0];l instanceof _ai;)l=l.childWidgets[0].childWidgets[0].childWidgets[0];r=l}var h=this.createColumn(r,!0);h.index=a,h.rowIndex=t,(h.containerWidget=s).childWidgets.push(h)}return s},c.prototype.createColumn=function(e,t){var i=new Uai,n=new Lai;return t&&(n.paragraphFormat.copyFormat(e.paragraphFormat),n.paragraphFormat.leftIndent=0,t=void(n.paragraphFormat.firstLineIndent=0),je(e.childWidgets[0])||(t=e.childWidgets[0].children[0]),je(t)?n.characterFormat.copyFormat(e.characterFormat):n.characterFormat.copyFormat(t.characterFormat)),e&&e.associatedCell&&(i.columnIndex=e.associatedCell.columnIndex),(n.containerWidget=i).childWidgets.push(n),i.cellFormat=new $ri(i),i},c.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 1;if(t.paragraph.associatedCell.ownerRow===i.paragraph.associatedCell.ownerRow)return e+i.paragraph.associatedCell.cellIndex-t.paragraph.associatedCell.cellIndex;for(var e=0,n=t.paragraph.associatedCell.ownerTable.getColumnCellsForSelection(t.paragraph.associatedCell,i.paragraph.associatedCell),o=0;o<n.length;o++)t.paragraph.associatedCell.ownerRow===n[o].ownerRow&&e++}return 0===e?1:e},c.prototype.getRowCountToInsert=function(){var e=1,t=this.selection.start,i=this.selection.end;return this.selection.isForward||(t=this.selection.end,i=this.selection.start),je(t)||je(i)||je(this.selection.getTable(t,i))?0===e?1:e:t.paragraph.associatedCell===i.paragraph.associatedCell||t.paragraph.associatedCell.ownerRow===i.paragraph.associatedCell.ownerRow?1:e+this.getOwnerRow(!this.selection.isForward).rowIndex-this.getOwnerRow(this.selection.isForward).rowIndex},c.prototype.getOwnerCell=function(e){for(var t=void 0,i=(e?this.selection.start:this.selection.end).paragraph.associatedCell,n=(e?this.selection.end:this.selection.start).paragraph.associatedCell,o=(t=i).ownerTable;!je(o)&&o.containerWidget instanceof Uai&&o!==n.ownerTable;)o=(t=o.containerWidget).ownerTable;return t},c.prototype.getOwnerRow=function(e){for(var t=(e?this.selection.start:this.selection.end).paragraph.associatedCell.ownerRow,i=(e?this.selection.end:this.selection.start).paragraph.associatedCell.ownerRow,n=t,o=n.ownerTable;!je(o)&&o.containerWidget instanceof Uai&&o!==i.ownerTable;)o=(n=o.containerWidget.ownerRow).ownerTable;return n},c.prototype.getOwnerTable=function(e){for(var t=void 0,i=this.selection.start.paragraph.associatedCell.ownerTable,n=this.selection.end.paragraph.associatedCell.ownerTable,t=e?i:n;t.containerWidget instanceof Uai&&t!==(e?n:i);)t=t.containerWidget.ownerTable;return t},c.prototype.mergeSelectedCellsInTable=function(){var e;this.canMergeCells()&&(this.owner.enableTrackChanges?((e=new Cn("documenteditor",this.owner.defaultLocale)).setLocale(this.owner.locale),this.alertDialog=WC.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"}}),this.alertDialog.enableRtl=this.owner.enableRtl):this.confirmCellMerge())},c.prototype.confirmCellMerge=function(){this.checkIsNotRedoing()&&this.initHistory("MergeCells"),this.selection.owner.isShiftingEnabled=!0;var e,t=this.selection.start,i=this.selection.end,n=(this.selection.isForward||(t=this.selection.end,i=this.selection.start),this.getOwnerCell(this.selection.isForward)),o=this.getOwnerCell(!this.selection.isForward),r=this.selection.getContainerCellOf(n,o);r.ownerTable.contains(o)&&!this.selection.containsCell(r,o)&&(e=n.ownerTable.combineWidget(this.owner.viewer),n=this.selection.getSelectedCell(n,r),o=this.selection.getSelectedCell(o,r),r=this.mergeSelectedCells(e,n,o),e=this.selection.getFirstParagraph(r),t.setPosition(e.firstChild,!0),n=this.selection.getLastParagraph(r),i.setPosition(n.lastChild,!1),this.selection.fireSelectionChanged(!1)),(this.checkIsNotRedoing()||je(this.editorHistory))&&this.reLayout(this.selection,!1),je(this.alertDialog)||(this.alertDialog.close(),this.alertDialog=void 0)},c.prototype.mergeSelectedCells=function(e,t,i){this.cloneTableToHistoryInfo(e);this.selection.owner.isLayoutEnabled=!1;for(var n,o=(a=this.selection.getCellLeft(t.ownerRow,t))+t.cellFormat.cellWidth,r=this.selection.getCellLeft(i.ownerRow,i),s=r+i.cellFormat.cellWidth,r=this.updateSelectedCellsInTable(a,o,r,s),a=r.start,o=r.end,s=i.cellFormat.rowSpan,l=e.childWidgets.indexOf(i.ownerRow),h=e.childWidgets.indexOf(t.ownerRow),d=void 0,p=h;p<=l;p++){for(var c,u=e.childWidgets[p],g=0;g<u.childWidgets.length;g++){var m=u.childWidgets[g],f=this.selection.getCellLeft(u,m);if(Y.round(a,2)<=Y.round(f,2)&&Y.round(f,2)<Y.round(o,2)){f=m.lastChild;if(f instanceof Lai&&f.isEmpty()&&m.childWidgets.pop(),je(d))d=m,n=f;else{p===h&&(d.cellFormat.preferredWidth+=m.cellFormat.preferredWidth,d.cellFormat.columnSpan+=m.cellFormat.columnSpan,this.mergeBorders(d,m));for(var y=0;y<m.childWidgets.length;y++){var v,b=m.childWidgets[y];((v=b.clone()).containerWidget=d).childWidgets.push(v),this.removeFieldInBlock(b),this.removeFieldInBlock(b,!0)}u.childWidgets.splice(g,1),m.destroy(),g--;for(var w=this.documentHelper.contentControlCollection.length-1;-1<w;w--)je(this.documentHelper.contentControlCollection[w].contentControlProperties)&&this.documentHelper.contentControlCollection.splice(w)}}}(0===d.childWidgets.length||1===d.childWidgets.length&&d.childWidgets[0]instanceof _ai)&&n&&(v=n.clone(),d.childWidgets.push(v),v.containerWidget=d),0===u.childWidgets.length&&(c=e.childWidgets.indexOf(u),u.updateRowBySpannedCells(),e.childWidgets.splice(c,1),l--,p--)}return!je(d)&&h<l&&(d.cellFormat.rowSpan=l-h+s),this.updateBlockIndexAfterMerge(d),e.updateRowIndex(0),e.calculateGrid(),e.isGridUpdated=!1,e.buildTableColumns(),e.isGridUpdated=!0,this.documentHelper.layout.reLayoutTable(e),this.selection.owner.isLayoutEnabled=!0,d},c.prototype.mergeBorders=function(e,t){var i=void 0,n=null;je(e.cellFormat.borders)||(i=e.cellFormat.borders),je(t.cellFormat.borders)||(n=t.cellFormat.borders),je(i)&&je(n)||(je(i)?(i=new uri(e.cellFormat)).copyFormat(n):je(n)||e.ownerRow.rowIndex===t.ownerRow.rowIndex&&(i.top=e.getBorderBasedOnPriority(i.top,n.bottom),i.bottom=e.getBorderBasedOnPriority(i.bottom,n.bottom)))},c.prototype.updateBlockIndexAfterMerge=function(e){for(var t=0;t<e.childWidgets.length;t++)e.childWidgets[t].index=t},c.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),t=this.getOwnerCell(!this.selection.isForward),i=this.selection.getContainerCellOf(e,t);if(!i.ownerTable.contains(t)||this.selection.containsCell(i,t))return!1;var e=this.selection.getSelectedCell(e,i),t=this.selection.getSelectedCell(t,i),n=1;if(e.ownerRow!==t.ownerRow)return this.canMergeSelectedCellsInTable(e.ownerTable,e,t);for(var o=e.ownerRow.childWidgets.indexOf(e),r=o;r<=e.ownerRow.childWidgets.indexOf(t);r++){var s=e.ownerRow.childWidgets[r],a=s.previousWidget;if(r!==o){if(s.cellFormat.rowSpan!==n)return!1;if(!je(a)&&s.columnIndex!==a.cellFormat.columnSpan+a.columnIndex)return!1}n=s.cellFormat.rowSpan}return!0},c.prototype.canMergeSelectedCellsInTable=function(e,t,i){for(var n=e.childWidgets.indexOf(i.ownerRow),o=e.childWidgets.indexOf(t.ownerRow),r=(s=this.selection.getCellLeft(t.ownerRow,t))+t.cellFormat.cellWidth,t=this.selection.getCellLeft(i.ownerRow,i),i=t+i.cellFormat.cellWidth,t=this.updateSelectedCellsInTable(s,r,t,i),s=t.start,r=t.end,a=0,l=0,h=!1,d=!1,p=[],c=o;c<=n;c++){for(var u=e.childWidgets[c],g=0,m=0,f=!1,y=0;y<u.childWidgets.length;y++){var v=u.childWidgets[y],b=this.selection.getCellLeft(u,v);if(this.checkCellWithInSelection(s,r,b)){d=h=!1,1<v.cellFormat.rowSpan&&p.push(v),f||(m=g=b,f=!0);var w=v.previousWidget,b=(0!==m&&Y.round(m,0)!==Y.round(b,0)&&(m=b),m+=Y.convertPointToPixel(v.cellFormat.cellWidth),this.checkPrevOrNextCellIsWithinSel(s,r,v,!0)),C=this.checkPrevOrNextCellIsWithinSel(s,r,v,!1),S=0===p.length||1===p.length&&p[0]===v,C=this.checkCurrentCell(p,v,b,C);if(c===n&&!je(w)&&v.cellFormat.rowSpan>w.cellFormat.rowSpan&&!C)return!1;if(c!==o)for(var A=0;A<p.length;A++){var x=p[A].ownerRow.rowIndex+p[A].cellFormat.rowSpan-1;if(x>=u.rowIndex){if(p[A].columnIndex>v.columnIndex?d=!0:h=!0,c===n&&p[A]!==v&&x>v.ownerRow.rowIndex+v.cellFormat.rowSpan-1)return!1;x!==u.rowIndex||this.checkPrevOrNextCellIsWithinSel(s,r,v,!1)||p.splice(p.indexOf(p[A]),1)}}if(b&&!je(w)&&S&&v.columnIndex!==w.columnIndex+1&&this.checkCellWidth(v))return!1}}if(c===o)a=g,l=m;else{if(0<m&&0<g&&(!h&&Math.round(a)!==Math.round(g)||!d&&Math.round(l)!==Math.round(m)))return!1;if(c===n)return!0}}return!1},c.prototype.checkCellWidth=function(e){var t=e.previousWidget,i=this.documentHelper.selection.getCellLeft(e.ownerRow,e),e=this.documentHelper.selection.getCellLeft(e.ownerRow,t)+Y.convertPointToPixel(t.cellFormat.cellWidth);return Y.round(e,2)!==Y.round(i,2)},c.prototype.checkCellWithInSelection=function(e,t,i){return Y.round(e,2)<=Y.round(i,2)&&Y.round(i,2)<Y.round(t,2)},c.prototype.checkPrevOrNextCellIsWithinSel=function(e,t,i,n){n=n?i.previousWidget:i.nextWidget;return!je(n)&&(i=this.documentHelper.selection.getCellLeft(n.ownerRow,n),this.checkCellWithInSelection(e,t,i))},c.prototype.checkCurrentCell=function(e,t,i,n){var o=t.ownerRow;if(0<e.length)for(var r=0;r<e.length;r++){var s=e[r].ownerRow,a=s.rowIndex+e[r].cellFormat.rowSpan-1;if(e[r]===t&&(1===e.length||this.checkRowSpannedCells(e,t))&&!n&&!i)return!0;if(e[r]!==t&&s.rowIndex<o.rowIndex&&a==o.rowIndex+t.cellFormat.rowSpan-1)return!0}return!1},c.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},c.prototype.insertNewParagraphWidget=function(e,t){if(this.updateInsertPosition(),this.insertParagraph(e,t),!t){for(var i=void 0,n=e;n=i=this.selection.getNextParagraphBlock(n),i&&i.equals(e););je(i)?this.selection.selectParagraphInternal(e,!0):this.selection.selectParagraphInternal(i,!0)}this.fireContentChange()},c.prototype.insertParagraph=function(e,t){var i=this.selection.start.currentWidget,n=this.selection.start.offset;this.editorHistory&&this.editorHistory.isUndoing&&this.editorHistory.currentBaseHistoryInfo&&"InsertTextParaReplace"===this.editorHistory.currentBaseHistoryInfo.action&&(n=0);var o=(o=this.selection.start.paragraph).combineWidget(this.owner.viewer);if(t){var r=this.selection.getLineLength(o.lastChild),s=e.firstChild?e.firstChild.children.length:0;if(this.moveInlines(o,e,s,n,i,r,o.lastChild),0<o.characterFormat.revisions.length)for(;0<o.characterFormat.revisions.length;){var a=o.characterFormat.revisions.shift();-1===e.characterFormat.revisions.indexOf(a)&&e.characterFormat.revisions.push(a)}if(this.updateCharacterFormatRevision(o,e),0<e.characterFormat.removedIds.length){for(;0<e.characterFormat.removedIds.length;)o.characterFormat.removedIds.push(e.characterFormat.removedIds.shift());this.constructRevisionFromID(o.characterFormat,!0)}}else if(0<n){s=o.getLength();if(this.moveInlines(o,e,0,0,o.firstChild,n,i),this.editorHistory&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)&&s===n&&0<o.characterFormat.revisions.length)for(;0<o.characterFormat.revisions.length;)e.characterFormat.revisions.push(o.characterFormat.revisions.shift())}r=o.getSplitWidgets(),i=(o=t?r[r.length-1]:r[0]).containerWidget.childWidgets.indexOf(o),t&&i++,s=o.containerWidget;e.index=o.index,(e.containerWidget=s).childWidgets.splice(i,0,e),this.constructRevisionsForBlock(e,!0),this.updateNextBlocksIndex(t?o:e,!0),e.height=0,e instanceof Lai&&this.documentHelper.layout.linkFieldInParagraph(e),this.documentHelper.layout.layoutBodyWidgetCollection(e.index,s,e,!1)},c.prototype.updateCharacterFormatRevision=function(e,t){for(var i=t.characterFormat.revisions,n=0;n<i.length;n++){var o=i[n];if(-1!==o.range.indexOf(e.characterFormat)){var r=o.range.indexOf(e.characterFormat);o.range.splice(r,1,t.characterFormat);break}}},c.prototype.moveInlines=function(e,t,i,n,o,r,s,a){0===t.childWidgets.length&&(l=new Gai(t),t.childWidgets.push(l));var l,h=!1;this.documentHelper.layout.clearListElementBox(e),this.documentHelper.layout.clearListElementBox(t);for(var d=0;d<e.childWidgets.length;d++){var p=e.childWidgets[d];if(o===p&&s===p){i=this.moveContent(p,n,r,i,t);break}if(s===p){i=this.moveContent(p,0,r,i,t);break}o===p?(h=!0,i=this.moveContent(p,n,this.documentHelper.selection.getLineLength(p),i,t)):h&&(i=this.moveContent(p,0,this.documentHelper.selection.getLineLength(p),i,t))}this.removeEmptyLine(e),e.isInsideTable||a||(this.viewer.updateClientArea(e.bodyWidget,e.bodyWidget.page),this.documentHelper.layout.reLayoutParagraph(e,0,0))},c.prototype.moveContent=function(e,t,i,n,o){for(var r=0,s=0;s<e.children.length;s++){var a=e.children[s];if(t>=r+a.length||a instanceof lhi)a instanceof lhi||(r+=a.length);else{var l,h=0,d=i-r;if(d>a.length&&(d=a.length),0<(h=r<t?t-r:h)&&(r+=h),0===h&&d===a.length?(a instanceof qli&&-1!==(l=e.paragraph.floatingElements.indexOf(a))&&e.paragraph.floatingElements.splice(l,1),o.firstChild.children.splice(n,0,a),a.line=o.firstChild,n++,e.children.splice(s,1),s--):a instanceof pli&&((l=new pli).characterFormat.copyFormat(a.characterFormat),l.text=a.text.substr(h,d-h),a.ischangeDetected=!0,l.ischangeDetected=!0,o.firstChild.children.splice(n,0,l),l.line=o.firstChild,n++,this.updateRevisionForMovedContent(a,l),a.text=a.text.slice(0,h)+a.text.slice(d),a.isWidthUpdated=!1,a.ischangeDetected=!0),i<=r+d-h)break;r+=d-h}}return n},c.prototype.updateRevisionForMovedContent=function(e,t){for(var i=0;i<e.revisions.length;i++){var n=e.revisions[i],o=n.range.indexOf(e);t.revisions.splice(0,0,n),n.range.splice(o,0,t),this.owner.trackChangesPane.updateCurrentTrackChanges(n)}},c.prototype.updateComplexWithoutHistory=function(e,t,i){var n,o=this.documentHelper.selection;0===e&&(n=new rci(o.owner),this.setPositionForCurrentIndex(n,t),this.documentHelper.layout.reLayoutParagraph(n.paragraph,0,0),this.setPositionForCurrentIndex(o.start,i),this.setPositionForCurrentIndex(o.end,i)),1===e&&(n=new rci(o.owner),this.setPositionForCurrentIndex(n,t),e=new rci(o.owner),this.setPositionForCurrentIndex(e,i),this.documentHelper.layout.reLayoutParagraph(n.paragraph,0,0),e.paragraph!==n.paragraph)&&this.documentHelper.layout.reLayoutParagraph(e.paragraph,0,0),o.owner.isShiftingEnabled&&(this.documentHelper.layout.shiftLayoutedItems(!1),this.documentHelper.owner.enableHeaderAndFooter)&&this.updateHeaderFooterWidget(),o.owner.isShiftingEnabled=!1,o.start.updatePhysicalPosition(!0),o.isEmpty?o.end.setPositionInternal(o.start):o.end.updatePhysicalPosition(!0),o.upDownSelectionLength=o.end.location.x,o.fireSelectionChanged(!0),this.documentHelper.updateFocus(),this.owner.viewer.updateScrollBars(),this.fireContentChange(),this.isHandledComplex=!0},c.prototype.reLayout=function(e,t,i){var n,o,r;je(this.previousBlockToLayout)||(n=this.previousBlockToLayout,this.documentHelper.layout.layoutBodyWidgetCollection(n.index,n.bodyWidget,n,!1,!1),this.previousBlockToLayout=void 0),!this.documentHelper.isComposingIME&&this.editorHistory&&this.editorHistory.isHandledComplexHistory()&&(this.editorHistory.currentHistoryInfo&&"ClearFormat"!==this.editorHistory.currentHistoryInfo.action&&"ApplyStyle"!==this.editorHistory.currentHistoryInfo.action&&("DragAndDropContent"===this.editorHistory.currentHistoryInfo.action&&this.documentHelper.layout.shiftLayoutedItems(!0),this.startParagraph=void 0,this.endParagraph=void 0),this.isHandledComplex=!1,!this.editorHistory.currentHistoryInfo||"ColumnBreak"!==this.editorHistory.currentHistoryInfo.action&&"PageBreak"!==this.editorHistory.currentHistoryInfo.action)?(this.shiftFootnoteContent(),this.selection.updateContentControlHighlightSelection()):(je(e.editRegionHighlighters)||e.editRegionHighlighters.clear(),je(this.documentHelper.blockToShift)&&(this.documentHelper.removeEmptyPages(),this.documentHelper.layout.updateFieldElements(),this.documentHelper.layout.checkAndShiftEndnote(!0),this.selection.updateContentControlHighlightSelection(),this.documentHelper.owner.enableHeaderAndFooter||this.owner.viewer.updateScrollBars(),e.owner.isShiftingEnabled&&!this.documentHelper.isRowOrCellResizing||(e.fireSelectionChanged(!0),this.startParagraph=void 0,this.endParagraph=void 0)),je(t)&&(t=e.isEmpty),this.owner.showRevisions&&this.owner.trackChangesPane.isUpdateTrackChanges(this.owner.revisions.length)&&this.owner.trackChangesPane.updateTrackChanges(),e.owner.isShiftingEnabled?(e.owner.isShiftingEnabled=!1,e.owner.isLayoutEnabled=!0,n=(t=(n=e.start.paragraph.bodyWidget).getSplitWidgets())[t.length-1],t=!!(this.editorHistory&&this.editorHistory.currentHistoryInfo&&"ColumnBreak"===this.editorHistory.currentHistoryInfo.action&&this.documentHelper.layout.isMultiColumnDoc),"Word2010"!==this.documentHelper.compatibilityMode||!(n.isWord2010NextColumn||!je(n.nextRenderedWidget)&&(n.nextRenderedWidget.isWord2010NextColumn||1<n.nextRenderedWidget.sectionFormat.numberOfColumns&&"NoBreak"===n.nextRenderedWidget.sectionFormat.breakCode))||n instanceof Iai||!je(n.containerWidget)&&n.containerWidget instanceof Pai?!(!je(n.nextRenderedWidget)&&"NoBreak"===n.nextRenderedWidget.sectionFormat.breakCode&&this.documentHelper.layout.isMultiColumnDoc||"NoBreak"===n.sectionFormat.breakCode&&n.sectionIndex===n.page.bodyWidgets[0].sectionIndex&&1<n.sectionFormat.numberOfColumns||t)||n instanceof Iai||!je(n.containerWidget)&&n.containerWidget instanceof Pai?this.documentHelper.layout.shiftLayoutedItems(!0):(t=this.documentHelper.selection.start,n=this.documentHelper.selection.end,o=this.selection.getParagraphInfo(t),r=this.selection.getParagraphInfo(n),o=this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString()),r=this.selection.getHierarchicalIndex(r.paragraph,r.offset.toString()),this.documentHelper.layout.shiftLayoutedItems(!0),this.setPositionForCurrentIndex(t,o),this.setPositionForCurrentIndex(n,r),this.documentHelper.selection.selectPosition(t,n),this.documentHelper.owner.enableHeaderAndFooter||this.owner.viewer.updateScrollBars()):this.layoutWholeDocument(!0,!0),this.documentHelper.owner.enableHeaderAndFooter&&(this.updateHeaderFooterWidget(),this.owner.viewer.updateScrollBars()),this.documentHelper.isRowOrCellResizing||(this.shiftFootnoteContent(),this.getOffsetValue(e),e.upDownSelectionLength=e.end.location.x,e.fireSelectionChanged(!0),this.owner.enableAutoFocus&&this.documentHelper.updateFocus(),this.startParagraph=void 0,this.endParagraph=void 0)):this.documentHelper.owner.enableHeaderAndFooter&&(this.updateHeaderFooterWidget(),this.owner.viewer.updateScrollBars()),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&("RowResizing"!==this.editorHistory.currentBaseHistoryInfo.action&&"CellResizing"!==this.editorHistory.currentBaseHistoryInfo.action||this.editorHistory.isUndoing||this.editorHistory.isRedoing)&&(0<this.editorHistory.currentBaseHistoryInfo.modifiedProperties.length&&this.editorHistory.currentBaseHistoryInfo.updateSelection(),this.editorHistory.undoStack&&0<this.editorHistory.undoStack.length&&this.editorHistory.undoStack[this.editorHistory.undoStack.length-1]instanceof Mci&&this.editorHistory.undoStack[this.editorHistory.undoStack.length-1].modifiedActions&&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()),i?!je(e)&&0<this.documentHelper.formFields.length&&e.highlightFormFields():(this.fireContentChange(),this.owner.enableLockAndEdit&&this.owner.viewer.updateScrollBars(),this.owner.documentHelper.layout.isRelayout=!1,this.isFootnoteElementRemoved=!1,this.isEndnoteElementRemoved=!1))},c.prototype.shiftFootnoteContent=function(){je(this.selection.start.paragraph)||!je(this.selection.start.paragraph.bodyWidget)&&!je(this.selection.start.paragraph.bodyWidget.containerWidget)&&this.selection.start.paragraph.bodyWidget.containerWidget instanceof Pai&&("Footnote"===this.selection.start.paragraph.bodyWidget.containerWidget.footNoteType?(this.documentHelper.layout.isRelayoutFootnote=!0,this.shiftFootnotePageContent(this.selection.start.paragraph.bodyWidget.containerWidget)):(this.documentHelper.layout.isRelayoutFootnote=!1,this.shiftFootnotePageContent()))},c.prototype.updateHeaderFooterWidget=function(e){je(e)&&(e=this.selection.start.paragraph.bodyWidget),this.updateHeaderFooterWidgetToPage(e),this.shiftPageContent(e.headerFooterType,e.sectionFormat)},c.prototype.updateHeaderFooterWidgetToPage=function(e){e.page;for(var t="EvenHeader"===e.headerFooterType||"EvenFooter"===e.headerFooterType,i="FirstPageHeader"===e.headerFooterType||"FirstPageFooter"===e.headerFooterType,n=0;n<this.documentHelper.pages.length;n++){var o=this.documentHelper.pages[n];o.bodyWidgets[0].sectionFormat.differentFirstPage&&i&&(o.headerWidgetIn.headerFooterType==e.headerFooterType||o.footerWidgetIn.headerFooterType==e.headerFooterType)?this.updateHeaderFooterWidgetToPageInternal(o,e,-1!==e.headerFooterType.indexOf("Header")):o.bodyWidgets[0].sectionFormat.differentFirstPage&&(i||!i&&0==o.index||o.sectionIndex!=o.previousPage.sectionIndex)||(!o.bodyWidgets[0].sectionFormat.differentOddAndEvenPages||t&&(n+1)%2==0?this.updateHeaderFooterWidgetToPageInternal(o,e,-1!==e.headerFooterType.indexOf("Header")):t||(n+1)%2==0||(0<n||!o.bodyWidgets[0].sectionFormat.differentFirstPage)&&this.updateHeaderFooterWidgetToPageInternal(o,e,-1!==e.headerFooterType.indexOf("Header")))}},c.prototype.updateHeaderFooterWidgetToPageInternal=function(e,t,i){var n;(i?t!=e.headerWidgetIn&&t.page.headerWidget==e.headerWidget:t!=e.footerWidgetIn&&t.page.footerWidget==e.footerWidget)&&(n=t.clone(),this.documentHelper.layout.clearBlockWidget(n.childWidgets,!0,!0,!0),n.page=e,n.parentHeaderFooter=t,this.owner.viewer.updateHFClientArea(n.sectionFormat,i),t=void(n=this.documentHelper.layout.layoutHeaderFooterItems(this.owner.viewer,n)),i?(t=e.headerWidgetIn,e.headerWidget=n):(t=e.footerWidgetIn,e.footerWidget=n),this.removeFieldInWidget(t),this.removeFieldInWidget(t,void 0,!0),t.destroy())},c.prototype.removeFieldInWidget=function(e,t,i,n){je(t)&&(t=!1);for(var o=0;o<e.childWidgets.length;o++)this.removeFieldInBlock(e.childWidgets[o],t,i,n)},c.prototype.removeFieldInBlock=function(e,t,i,n){var o;if(e instanceof _ai)e.wrapTextAround&&!je(e.bodyWidget)&&-1!==(o=e.bodyWidget.floatingElements.indexOf(e))&&e.bodyWidget.floatingElements.splice(o,1),this.removeFieldTable(e,t,i,n);else if(e instanceof jai)for(var r=0;r<e.childWidgets.length;r++)this.removeFieldInWidget(e.childWidgets[r],t,i,n);else this.removeField(e,t,i,n)},c.prototype.removeFieldTable=function(e,t,i,n){for(var o=0;o<e.childWidgets.length;o++)for(var r=e.childWidgets[o],s=0;s<r.childWidgets.length;s++)this.removeFieldInWidget(r.childWidgets[s],t,i,n)},c.prototype.shiftFootnotePageContent=function(e){var t,i=this.documentHelper.pages[0].bodyWidgets[0];je(e)||(t=this.documentHelper.pages.indexOf(e.page),i=this.documentHelper.pages[t].bodyWidgets[0]),je(i.page.footnoteWidget)||this.checkAndShiftFromBottom(i.page,i.page.footnoteWidget,!je(e)),je(i.page.endnoteWidget),this.documentHelper.blockToShift&&(this.documentHelper.renderedLists.clear(),this.documentHelper.renderedLevelOverrides=[],this.documentHelper.layout.shiftLayoutedItems(!1))},c.prototype.shiftPageContent=function(e,t){-1!==e.indexOf("First")?n=0:t.differentOddAndEvenPages?(i=-1!==e.indexOf("Even"),n=t.differentFirstPage?i?1:2:i?1:0):1===(n=t.differentFirstPage?1:0)&&1===this.documentHelper.pages.length&&(n=0);var i,n,o,r,s,a,l=this.documentHelper.pages[n].bodyWidgets[0];do{for(-1!==e.indexOf("Header")?(a=!(a=l.page.headerWidget).isEmpty||a.isEmpty&&this.owner.enableHeaderAndFooter,s=l.firstChild,o=Y.convertPointToPixel(t.topMargin),r=Y.convertPointToPixel(t.headerDistance),a&&(o=Math.max(r+l.page.headerWidget.height,o)),s.y!==o&&"NoBreak"!==l.sectionFormat.breakCode&&(this.owner.viewer.updateClientArea(l,l.page),!(a=(s=s.combineWidget(this.owner.viewer)).previousRenderedWidget)||!s.containerWidget.equals(a.containerWidget)||a.containerWidget.lastChild instanceof Lai&&(a.containerWidget.lastChild.isEndsWithPageBreak||a.containerWidget.lastChild.isEndsWithColumnBreak)||(this.owner.viewer.cutFromTop(a.y+a.height),this.documentHelper.layout.updateContainerWidget(s,a.containerWidget,a.indexInOwner+1,!1)),this.documentHelper.blockToShift=s)):this.checkAndShiftFromBottom(l.page,l.page.footerWidget),this.documentHelper.blockToShift&&(this.documentHelper.renderedLists.clear(),this.documentHelper.renderedLevelOverrides=[],this.documentHelper.layout.shiftLayoutedItems(!1));l;){var h=l;do{var d=l.getSplitWidgets(),l=d[d.length-1].nextRenderedWidget}while(l&&h.page===l.page);if(l){if(0===n)break;if(l.page.index+1===0&&1===n||l.page.index+1!==0&&2===n)break;var p=l.page.nextPage;if(!je(p)&&p.bodyWidgets[0].equals(l)){l=p.bodyWidgets[0];break}}}}while(l)},c.prototype.checkAndShiftFromBottom=function(e,t,i){var n,o=e.bodyWidgets[0];if(1<o.childWidgets.length){for(var r=0;r<o.childWidgets.length;r++){var s=o.childWidgets[r];if(s.y+s.height>t.y){n=s;break}if(!(t instanceof Pai)&&o.childWidgets.length-1===r&&s.y+s.height<t.y){n=s;break}}je(n)&&i&&(n=o.lastChild),je(n)||(this.owner.viewer.updateClientArea(o,e,!0),this.owner.viewer.cutFromTop(n.y),this.documentHelper.blockToShift=n)}},c.prototype.allowFormattingInFormFields=function(e){if("FormFieldsOnly"===this.documentHelper.protectionType&&this.selection.isInlineFormFillMode()&&!je(this.owner.documentEditorSettings.formFieldSettings.formattingExceptions))for(var t=0;t<this.owner.documentEditorSettings.formFieldSettings.formattingExceptions.length;t++)if(e.toLowerCase()===this.owner.documentEditorSettings.formFieldSettings.formattingExceptions[t].toLowerCase())return!0;return!1},c.prototype.insertContentControlInCollection=function(e){var t=this.documentHelper.contentControlCollection,i=this.selection.getElementPosition(e).startPosition,n=(je(i)&&(i=this.selection.isForward?this.selection.start:this.selection.end),!1);if(-1===t.indexOf(e))for(var o=0;o<t.length;o++){var r=t[o],r=this.selection.getElementPosition(r).startPosition;if(!je(i)&&!je(r)&&i.isExistBefore(r)){t.splice(o,0,e),n=!0;break}}n||t.push(e)},c.prototype.getContentControl=function(){var e=this.getContentControls();if(0<e.length)return e[e.length-1]},c.prototype.getContentControls=function(){for(var e=[],t=0;t<this.documentHelper.contentControlCollection.length;t++)if(!this.documentHelper.contentControlCollection[t].paragraph.isInHeaderFooter||"Continuous"!==this.documentHelper.owner.layoutType){var i=this.documentHelper.contentControlCollection[t];if(this.owner.enableHeaderAndFooter&&i.paragraph.isInHeaderFooter){if(this.pushContentControlByOrder(i,e))break}else if(!i.paragraph.isInHeaderFooter&&this.pushContentControlByOrder(i,e))break}return e},c.prototype.pushContentControlByOrder=function(e,t){var i=e.line;if(!je(i.children)&&!je(i.children.length)){i=this.selection.getPosition(e);if(i.startPosition&&i.endPosition){var n=i.startPosition,i=i.endPosition,o=this.selection.start,r=this.selection.end,o=(this.selection.isForward||(o=this.selection.end,r=this.selection.start),o.isExistAfter(n)||o.isAtSamePosition(n)),n=r.isExistBefore(i)||r.isAtSamePosition(i);if(o&&n)t.push(e);else if(!o)return!0}}return!1},c.prototype.checkPlainTextContentControl=function(){var e,t,i,n=this.selection.start,o=this.selection.end,r=(this.selection.isForward||(o=this.selection.start,n=this.selection.end),n.currentWidget.getInline(n.offset,0)),s=o.currentWidget.getInline(o.offset,0),r=(r.index,s.index,r.element),s=s.element;r&&r.contentControlProperties&&"Text"===r.contentControlProperties.type||s&&s.contentControlProperties&&"Text"===s.contentControlProperties.type?(!je(r=this.getContentControl())&&r.contentControlProperties?(t=r.line.getOffset(r,1),(e=new rci(this.owner)).setPositionParagraph(r.line,t)):e=n,s.contentControlProperties&&!je(r)&&r.reference?(t=(s=r.reference).line.getOffset(s,s.length),(i=new rci(this.owner)).setPositionParagraph(s.line,t)):i=o,this.selection.selectRange(e,i)):n.paragraph.contentControlProperties&&"Text"===n.paragraph.contentControlProperties.type&&this.selection.selectParagraph()},c.prototype.onApplyCharacterFormat=function(e,t,i,n){var o=this.documentHelper.isFormFillProtectedMode&&this.documentHelper.selection.isInlineFormFillMode()&&this.allowFormattingInFormFields(e);if(!(this.restrictFormatting&&!o||!je(this.selection)&&this.selection.checkContentControlLocked(!0))){this.documentHelper.layout.isBidiReLayout=!0;var r=this.documentHelper.selection;if((!r.owner.isReadOnlyMode||o)&&r.owner.isDocumentLoaded){i=!je(i)&&i,n=!je(n)&&n;var o=e[0].toUpperCase()+e.slice(1),s=r.start.paragraph;s.childWidgets[s.childWidgets.length-1];if(this.checkPlainTextContentControl(),r.isEmpty&&"List"!==r.contextType&&!n)r.skipFormatRetrieval=!0,r.end.isAtParagraphEnd?(this.initHistory(o),this.documentHelper.owner.isShiftingEnabled=!0,this.applyCharFormatValue(s.characterFormat,e,t,i),this.reLayout(this.documentHelper.selection),this.documentHelper.updateFocus()):r.fireSelectionChanged(!0),r.skipFormatRetrieval=!1;else{if("highlightColor"===e&&r.start.isInSameParagraph(r.end)){n=r.start,s=r.end;if(this.selection.isForward||(s=r.start,n=r.end),s.offset===r.getLineLength(s.currentWidget)+1&&s.offset-1===n.offset)return}this.setOffsetValue(r),this.initHistory(o),"List"===r.contextType?this.applyCharacterFormatForListText(r,e,t,i):this.updateSelectionCharacterFormatting(e,t,i),this.documentHelper.layout.isBidiReLayout=!1}}}},c.prototype.applyCharacterFormatForListText=function(e,t,i,n){var o=e.getListLevel(e.start.paragraph);if(!je(o)){var r=o.characterFormat;switch(t){case"bold":this.applyListCharacterFormatByValue(e,r,"bold",!r.bold);break;case"italic":this.applyListCharacterFormatByValue(e,r,"italic",!r.italic);break;case"fontColor":this.applyListCharacterFormatByValue(e,r,"fontColor",i);break;case"fontFamily":this.applyListCharacterFormatByValue(e,r,"fontFamily",i);break;case"fontSize":this.applyListCharacterFormatByValue(e,r,"fontSize",i);break;case"highlightColor":this.applyListCharacterFormatByValue(e,r,"highlightColor",i);break;case"baselineAlignment":r.baselineAlignment===i&&(i="Normal"),this.applyListCharacterFormatByValue(e,r,"baselineAlignment",i);break;case"strikethrough":r.strikethrough===i&&(i="None"),this.applyListCharacterFormatByValue(e,r,"strikethrough",i);break;case"underline":r.underline===i&&(i="None"),this.applyListCharacterFormatByValue(e,r,"underline",i);break;case"characterFormat":this.applyListCharacterFormatByValue(e,r,void 0,i)}}},c.prototype.applyListCharacterFormatByValue=function(e,t,i,n){this.initHistory("ListCharacterFormat"),this.applyCharFormatValue(t,i,n,!1),this.editorHistory.updateHistory(),this.reLayout(e),this.fireContentChange()},c.prototype.updateListCharacterFormat=function(e,t,i){this.updateListTextSelRange(e,t,i,!1)},c.prototype.updateListTextSelRange=function(e,t,i,n){this.documentHelper.owner.isShiftingEnabled=!0;var o=e.start,r=e.end,s=(e.isForward||(o=e.end,r=e.start),this.initHistoryPosition(e,o),e.getListLevel(e.start.paragraph));this.applyCharFormatValue(s.characterFormat,t,i,n),this.startSelectionReLayouting(o.paragraph,e,o,r)},c.prototype.updateInsertPosition=function(){var e=this.documentHelper.selection,t=e.start;e.isForward||(t=e.end),!this.editorHistory||je(this.editorHistory.currentBaseHistoryInfo)||je(t)||je(this.editorHistory.currentBaseHistoryInfo.insertPosition)&&this.updateHistoryPosition(t,!0)},c.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},c.prototype.toggleHighlightColor=function(e){var t=this.documentHelper.selection;!je(e)&&"NoColor"!==e||(e="Yellow"),t.characterFormat.highlightColor===e&&(e="NoColor"),this.selection.characterFormat.highlightColor=e},c.prototype.toggleSubscript=function(){var e;this.owner.isReadOnlyMode||this.restrictFormatting||(e="Subscript"===this.selection.characterFormat.baselineAlignment?"Normal":"Subscript",this.selection.characterFormat.baselineAlignment=e)},c.prototype.toggleSuperscript=function(){var e;this.owner.isReadOnlyMode||this.restrictFormatting||(e="Superscript"===this.selection.characterFormat.baselineAlignment?"Normal":"Superscript",this.selection.characterFormat.baselineAlignment=e)},c.prototype.increaseIndent=function(){this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.onApplyParagraphFormat("leftIndent",this.documentHelper.defaultTabWidth,!0,!1)},c.prototype.decreaseIndent=function(){this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.onApplyParagraphFormat("leftIndent",-this.documentHelper.defaultTabWidth,!0,!1)},c.prototype.clearList=function(){this.selection.owner.editorModule.onApplyList(void 0)},c.prototype.applyBullet=function(e,t){this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.applyBulletOrNumbering(e,"Bullet",t)},c.prototype.applyNumbering=function(e,t){this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.applyBulletOrNumbering(e,t,"Verdana")},c.prototype.toggleBaselineAlignment=function(e){this.updateProperty(2,e)},c.prototype.clearFormattingInternal=function(e,t){var i=this.documentHelper.selection;this.setPreviousBlockToLayout(),this.initComplexHistory("ClearFormat"),(i.isEmpty||!je(e)&&e)&&(i.start.moveToParagraphStartInternal(i,!1),i.end.moveToParagraphEndInternal(i,!1)),this.setOffsetValue(i),this.editorHistory&&this.editorHistory.initializeHistory("ClearCharacterFormat"),this.updateSelectionCharacterFormatting("ClearCharacterFormat",void 0,!1),this.getOffsetValue(i),this.editorHistory&&this.editorHistory.updateHistory(),this.setOffsetValue(i),(je(e)||e)&&(this.editorHistory&&this.editorHistory.initializeHistory("ClearParagraphFormat"),this.updateParagraphFormatInternal("ClearParagraphFormat",void 0,!1)),this.editorHistory&&this.editorHistory.updateHistory(),this.getOffsetValue(i),this.editorHistory&&!je(this.editorHistory.currentHistoryInfo)&&(t?this.editorHistory.updateComplexHistoryInternal():this.editorHistory.updateComplexHistory()),this.startParagraph=void 0,this.endParagraph=void 0},c.prototype.clearFormatting=function(){this.clearFormattingInternal()},c.prototype.updateProperty=function(e,t){var i,n,o,r=this.selection;(!this.owner.isReadOnlyMode&&!this.restrictFormatting||this.selection.isInlineFormFillMode())&&r.owner.isDocumentLoaded&&(o=r.start,r.end,r.isForward||(o=r.end,r.start),i=(n=o.currentWidget.getInline(o.offset,r=0)).element,r=n.index,n=o.paragraph,je(i)||i.length!==r||this.selection.isEmpty||(i=i.nextNode),1===e?(o="None",je(i)?je(n)||(o=n.characterFormat.underline):o=i.characterFormat.underline,this.selection.characterFormat.underline=t===o?"None":t):(r="Normal",je(i)?je(n)||(r=n.characterFormat.baselineAlignment):r=i.characterFormat.baselineAlignment,this.selection.characterFormat.baselineAlignment=t=r===t?"Normal":t))},c.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)+"]}"},c.prototype.intializeDefaultStyles=function(){for(var t=this.owner.getStyleNames("Paragraph"),e=0,i=["Normal","Heading 1","Heading 2","Heading 3","Heading 4","Heading 5","Heading 6","Heading 7","Heading 8","Heading 9","Header","Footer"].filter(function(e){return-1===t.indexOf(e)});e<i.length;e++){var n=i[e];this.createStyle(this.documentHelper.preDefinedStyles.get(n))}},c.prototype.createStyle=function(e,t){return this.createStyleIn(e,t).name},c.prototype.createStyleIn=function(e,t){var e=JSON.parse(e),i=this.documentHelper.styles.findByName(e.name),n=e.type;return je(i)||je(t)||!t?(void 0!==i&&(e.name=this.getUniqueStyleName(e.name)),this.documentHelper.owner.parser.parseStyle(JSON.parse(this.getCompleteStyles()),e,this.documentHelper.styles,!0)):n===i.type?this.setStyle(i,e):(e.name=this.getUniqueStyleName(e.name),this.documentHelper.owner.parser.parseStyle(JSON.parse(this.getCompleteStyles()),e,this.documentHelper.styles,!0)),this.owner.notify(ZJt,{}),this.documentHelper.styles.findByName(e.name)},c.prototype.setStyle=function(e,t){if(je(t.basedOn)||(je(n=this.documentHelper.styles.findByName(t.basedOn))?(o=void 0,o=je(i=this.getStyle(t.basedOn,JSON.parse(this.getCompleteStyles())))||i.type!==t.type?"Paragraph"===t.type?JSON.parse('{"type":"Paragraph","name":"Normal","next":"Normal"}'):JSON.parse('{"type": "Character","name": "Default Paragraph Font"}'):i,e.basedOn=this.documentHelper.styles.findByName(o.name)):n.type===t.type&&(e.basedOn=n)),je(t.next)||"Paragraph"===t.type&&(t.next===t.name||je(i=this.documentHelper.styles.findByName(t.next))||i.type!==e.type?e.next=e:e.next=i),!je(t.link)){var i,n,o=this.documentHelper.styles.findByName(t.link);if(je(o)||"Character"!==o.type?((n={}).characterFormat=t.characterFormat,void 0!==this.documentHelper.styles.findByName(t.name+" Char").name?n.name=this.getUniqueStyleName(t.name)+" Char":n.name=t.name+" Char",n.type="Character",n.basedOn="Default Paragraph Font",i=n,this.documentHelper.owner.parser.parseStyle(JSON.parse(this.getCompleteStyles()),i,this.documentHelper.styles),e.link=this.documentHelper.styles.findByName(i.name)):(this.documentHelper.owner.parser.parseCharacterFormat(0,t.characterFormat,o.characterFormat),e.link=o),"Character"==t.type)for(var r=0;r<this.documentHelper.styles.length;r++){var s=this.documentHelper.styles.getItem(r),a=s.link,a=void 0===a?"":a.name;"Paragraph"!==s.type||a!==t.link||je(s.characterFormat)||this.documentHelper.owner.parser.parseCharacterFormat(0,t.characterFormat,s.characterFormat)}}je(t.paragraphFormat)||this.documentHelper.owner.parser.parseParagraphFormat(0,t.paragraphFormat,e.paragraphFormat),je(t.characterFormat)||this.documentHelper.owner.parser.parseCharacterFormat(0,t.characterFormat,e.characterFormat)},c.prototype.getStyle=function(e,t){for(var i=0;i<t.styles.length;i++)if(t.styles[i].name===e)return t.styles[i]},c.prototype.getUniqueStyleName=function(e){for(var t=this.getUniqueName(e),i=this.documentHelper.styles.findByName(t);!je(i);)t=this.getUniqueStyleName(i.name),i=this.documentHelper.styles.findByName(t);return t},c.prototype.getUniqueName=function(e){var t=e.match(/\d+$/);return!je(t)&&0<t.length?e.replace(t[0],(parseInt(t[0],10)+1).toString()):e+"_1"},c.prototype.updateSelectionCharacterFormatting=function(e,t,i){switch(je(e)&&(e="CharacterFormat"),!je(this.editorHistory)&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.insertedFormat=t),e){case"bold":this.updateCharacterFormat("bold",t);break;case"italic":this.updateCharacterFormat("italic",t);break;case"fontColor":this.updateCharacterFormat("fontColor",t);break;case"fontFamily":this.updateCharacterFormat("fontFamily",t);break;case"fontSize":this.documentHelper.layout.isBidiReLayout=!1,this.updateCharacterFormatWithUpdate(this.documentHelper.selection,"fontSize",t,i);break;case"highlightColor":this.updateCharacterFormat("highlightColor",t);break;case"baselineAlignment":this.updateCharacterFormat("baselineAlignment",t);break;case"strikethrough":this.updateCharacterFormat("strikethrough",t);break;case"underline":this.updateCharacterFormat("underline",t);break;case"styleName":this.updateCharacterFormatWithUpdate(this.documentHelper.selection,"styleName",t,!0,!0);break;case"CharacterFormat":case"ClearCharacterFormat":this.updateCharacterFormat(void 0,t);break;case"allCaps":this.updateCharacterFormat("allCaps",t)}this.reLayout(this.documentHelper.selection)},c.prototype.updateCharacterFormat=function(e,t){this.updateCharacterFormatWithUpdate(this.documentHelper.selection,e,t,!1)},c.prototype.updateCharacterFormatWithUpdate=function(e,t,i,n,o){o=!je(o)&&o,this.documentHelper.owner.isShiftingEnabled=!0;var r,s,a=e.start,l=e.end;e.isEmpty||e.isForward||(a=e.end,l=e.start),e.isEmpty&&o&&(o=a.offset,r=a.clone(),s=l.clone(),this.selection.selectCurrentWord(),o!==this.selection.start.offset&&o!==this.selection.end.offset-1||(this.selection.start=r,this.selection.end=s)),this.applyCharFormatSelectedContent(a.paragraph,e,a,l,t,i,n)},c.prototype.applyCharFormatSelectedContent=function(e,t,i,n,o,r,s){if(!i.paragraph.isInsideTable||n.paragraph.isInsideTable&&i.paragraph.associatedCell===n.paragraph.associatedCell&&!t.isCellSelected(i.paragraph.associatedCell,i,n))for(a=e;a=a instanceof Lai?this.applyCharFormat(a,t,i,n,o,r,s):this.applyCharFormatForTable(0,a,t,i,n,o,r,s););else{i.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer),this.checkInsertPosition(t)&&this.updateHistoryPosition(i,!0),e=i.paragraph.associatedCell;for(var a=this.applyCharFormatCell(e,t,i,n,o,r,s);a;)a=a instanceof Lai?this.applyCharFormat(a,t,i,n,o,r,s):this.applyCharFormatForTable(0,a,t,i,n,o,r,s);e=e.ownerTable;this.documentHelper.layout.layoutBodyWidgetCollection(e.index,e.containerWidget,e,!1)}},c.prototype.applyCharFormatForSelectedPara=function(e,t,i,n,o){for(var r=0;r<e.childWidgets.length;r++)for(var s=e.childWidgets[r],a=0;a<s.children.length;a++){var l=s.children[a];l.isWidthUpdated=!1,this.applyCharFormatValue(l.characterFormat,i,n,o)}this.applyCharFormatValue(e.characterFormat,i,n,o)},c.prototype.splittedLastParagraph=function(e){e=e.getSplitWidgets();return e[e.length-1]},c.prototype.getNextParagraphForCharacterFormatting=function(e,t,i,n,o,r){var s=e.getSplitWidgets();return e=s[s.length-1],this.documentHelper.selection.getNextRenderedBlock(e)},c.prototype.applyCharFormat=function(e,t,i,n,o,r,s){var a=e.previousSplitWidget,l=!1,h=(!je(a)&&a instanceof Lai&&(l=!0),e=e.combineWidget(this.owner.viewer),0),a=t.getParagraphLength(e),d=-1!==e.childWidgets.indexOf(i.currentWidget)?e.childWidgets.indexOf(i.currentWidget):0,p=n.offset,c=-1!==e.childWidgets.indexOf(n.currentWidget)?e.childWidgets.indexOf(n.currentWidget):e.childWidgets.length-1;je(t)||e===i.paragraph&&(h=i.offset),e.equals(n.paragraph)?(x=e.childWidgets[e.childWidgets.length-1],t.isParagraphLastLine(x)&&n.currentWidget===x&&(p===t.getLineLength(x)+1||t.isEmpty&&t.end.isAtParagraphEnd)&&this.applyCharFormatValue(e.characterFormat,o,r,s)):(x=e.childWidgets[e.childWidgets.length-1],"highlightColor"===o&&t.isParagraphLastLine(x)&&i.currentWidget===x&&i.offset===t.getLineLength(x)||this.applyCharFormatValue(e.characterFormat,o,r,s),p=a);for(var u=d;u<=c;u++)for(var g=e.childWidgets[u],m=(u!==d&&(h=t.getStartLineOffset(g)),p=g===n.currentWidget?n.offset:t.getLineLength(g),0),f=void 0,y=-1,v=!0,b=0;b<g.children.length;v?b++:b--){var w=g.children[b];if(w.isWidthUpdated=!1,!(w instanceof lhi))if(f===w&&(b=y,y=-1,v=!(f=void 0)),h>=m+w.length)m+=w.length;else{var C=0,S=p-m,A=w.length,C=(A<S&&(S=A),this.applyCharFormatInline(w,t,C=m<h?h-m:C,S,o,r,s));if("fontColor"===o&&0!==e.characterFormat.revisions.length||e.equals(n.paragraph)||!this.isForHyperlinkFormat||!this.owner.enableTrackChanges||g.children[b].indexInOwner!==g.children.length-1||g!==g.paragraph.lastChild||!je(w)&&0<w.revisions.length&&(S=w.revisions[w.revisions.length-1],e.characterFormat.revisions.push(S),S.range.push(e.characterFormat),this.owner.trackChangesPane.updateCurrentTrackChanges(S)),b+=C,p<=m+A)break;m+=A}}var x=n.paragraph;if(this.documentHelper.layout.reLayoutParagraph(e,l?0:d,0),!e.equals(x))return this.getNextParagraphForCharacterFormatting(e,i,n,o,r,s)},c.prototype.toggleBold=function(){var e;(this.owner.isReadOnlyMode||this.restrictFormatting)&&!this.selection.isInlineFormFillMode()||(e=this.getCurrentSelectionValue("bold"),this.selection.characterFormat.bold=e)},c.prototype.toggleItalic=function(){var e;(this.owner.isReadOnlyMode||this.restrictFormatting)&&!this.selection.isInlineFormFillMode()||(e=this.getCurrentSelectionValue("italic"),this.selection.characterFormat.italic=e)},c.prototype.changeCase=function(e){var t,i,n;this.selection.isEmpty||(this.owner.isReadOnlyMode||this.restrictFormatting)&&!this.selection.isInlineFormFillMode()||(this.initHistory(e),this.documentHelper.owner.isShiftingEnabled=!0,i=(t=this.selection).start,n=t.end,t.isForward||(i=t.end,n=t.start),this.changeSelectedTextCase(t,i,n,e),this.reLayout(t))},c.prototype.changeSelectedTextCase=function(e,t,i,n,o){var r=this.selection.getParagraphInfo(t),r=(e.editPosition=this.selection.getHierarchicalIndex(r.paragraph,r.offset.toString()),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.checkInsertPosition(e)&&this.updateHistoryPosition(t,!0),this.editorHistory.isUndoing),o=(r&&!je(o)&&0<o.length&&(this.removedTextNodes=o),e.isForward?i.selection.endOffset:i.selection.startOffset);this.changeTextCase(t.paragraph,e,t,i,n,r),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(i=e.getTextPosBasedOnLogicalIndex(o),this.checkEndPosition(e)&&this.updateHistoryPosition(i,!1),e.selectPosition(t,i))},c.prototype.changeTextCase=function(e,t,i,n,o,r){!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,o,r):(e=void 0,i.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer),this.checkInsertPosition(t)&&this.updateHistoryPosition(i,!0),e=i.paragraph.associatedCell,this.changeCaseParaFormatInCell(e,i,n,o,r),t=e.ownerTable,this.documentHelper.layout.layoutBodyWidgetCollection(t.index,t.containerWidget,t,!1))},c.prototype.changeCaseParagraph=function(e,t,i,n,o,r){e=e.combineWidget(this.owner.viewer);var s=0,a=t.getParagraphLength(e),l=-1!==e.childWidgets.indexOf(i.currentWidget)?e.childWidgets.indexOf(i.currentWidget):0,h=n.offset,d=-1!==e.childWidgets.indexOf(n.currentWidget)?e.childWidgets.indexOf(n.currentWidget):e.childWidgets.length-1;je(t)||e===i.paragraph&&(s=i.offset),e.equals(n.paragraph)||(h=a);for(var p=l;p<=d;p++){this.checkLastLetterSpaceDot="",this.checkLastLetterSpace="";for(var c=e.childWidgets[p],u=(p!==l&&(s=t.getStartLineOffset(c)),h=c===n.currentWidget?n.offset:t.getLineLength(c),0),g=void 0,m=-1,f=!0,y=0;y<c.children.length;f?y++:y--){var v=c.children[y],b=!1;if((0===y||0<y&&c.children[y-1]instanceof pli)&&(b=!0,0<y)&&(w=c.children[y-1],this.checkLastLetterSpace=w.text.substr(-1),this.checkLastLetterSpaceDot=w.text.substr(-2)),!(v instanceof lhi))if(g===v&&(y=m,m=-1,f=!(g=void 0)),s>=u+v.length)u+=v.length;else{var w=0,C=h-u,S=v.length;if(S<C&&(C=S),y+=this.changeCaseInline(v,t,w=u<s?s-u:w,C,o,r,b),h<=u+S)break;u+=S}}}a=n.paragraph;this.documentHelper.layout.reLayoutParagraph(e,l,0),e.equals(a)||this.changeCaseNextBlock(e,i,n,o,r)},c.prototype.changeCaseInline=function(e,t,i,n,o,r,s){if(e instanceof pli){if(0!==i||n!==e.length)return this.changeCaseInlineInternal(e,t,i,n,o,r,s);this.changeCaseInlineInternal(e,t,i,n,o,r,s)}return 0},c.prototype.addRemovedTextNodes=function(e,t){e instanceof pli&&(je(this.editorHistory.currentBaseHistoryInfo)||(je(e=this.editorHistory.currentBaseHistoryInfo.removedNodes[0])&&((e=new pli).text="",this.editorHistory.currentBaseHistoryInfo.removedNodes.push(e)),e.text+=t,e.isWidthUpdated=!1))},c.prototype.changeCaseInlineInternal=function(e,t,i,n,o,r,s){var a,l=0,h=!1,d=e.line.children.indexOf(e),p=e.paragraph,c=p.childWidgets.indexOf(e.line),u=(e.isWidthUpdated=!1,0<i&&(u=e.text.substr(i,n-i),this.addRemovedTextNodes(e,u),(a=new pli).characterFormat.copyFormat(e.characterFormat),a.line=e.line,"CapitalizeEachWord"===o&&(h=" "===e.text.substr(i-1,1)),"SentenceCase"===o&&(h=". "===e.text.substr(i-2,2)),a.characterFormat.allCaps="Uppercase"===o&&!r,a.text=this.getChangeCaseText(u,o,r,h),a.isRightToLeft=e.isRightToLeft,e.line.children.splice(++d,0,a),l++),n<e.length&&((a=new pli).characterFormat.copyFormat(e.characterFormat),a.text=e.text.substring(n),a.line=e.line,a.isRightToLeft=e.isRightToLeft,e.line.children.splice(++d,0,a),l++),e);return 0===i?(d=u.text.substr(0,n),this.addRemovedTextNodes(e,d),"SentenceCase"===o?(". "===this.checkLastLetterSpaceDot?h=!0:0===c&&""===this.checkLastLetterSpaceDot&&(h=!s||p.childWidgets[0].children[0]===u),this.checkLastLetterSpaceDot=u.text.substr(-2)):"CapitalizeEachWord"==o&&(h=s?0===t.getIndexInInline(e)||" "===this.checkLastLetterSpace:!((u.previousElement instanceof Khi||u.previousElement instanceof Dli||u.previousElement instanceof Zai)&&(a=je(u.previousElement.previousElement)?void 0:u.previousElement.previousElement.text,!je(a))&&!Y.endsWith(a)),this.checkLastLetterSpace=u.text.charAt(u.length-1)),u.characterFormat.allCaps="Uppercase"===o&&!r,u.text=this.getChangeCaseText(d,o,r,h)):(n=u.text.substr(0,i),u.text=n),l},c.prototype.changeCaseNextBlock=function(e,t,i,n,o){je(e=this.getNextBlockForChangeCase(e,t,i,n,o))||(e instanceof Lai?this.changeCaseParagraph(e,this.documentHelper.selection,t,i,n,o):this.changeCaseForTable(0,e,this.documentHelper.selection,t,i,n,o))},c.prototype.getNextBlockForChangeCase=function(e,t,i,n,o){var r=e.getSplitWidgets();return e=r[r.length-1],e=this.documentHelper.selection.getNextRenderedBlock(e)},c.prototype.getChangeCaseText=function(e,t,i,n){var o;if(i)!je(this.removedTextNodes)&&0<this.removedTextNodes.length&&(o=(i=this.removedTextNodes[0]).text.substr(0,e.length),i.text=i.text.substr(o.length,i.length-o.length),e=o,""===i.text)&&this.removedTextNodes.splice(0,1);else switch(t){case"SentenceCase":e=this.sentencecase(e,n);break;case"Uppercase":e=e.toUpperCase();break;case"Lowercase":e=e.toLowerCase();break;case"CapitalizeEachWord":e=this.capitalizeFirst(e,n);break;case"ToggleCase":e=this.togglecase(e)}return e},c.prototype.capitalizeFirst=function(e,i){if(/\b\w+'\w+\b/g.test(e))return e.split(/[^a-zA-Z0-9'\-]+/).toString(),e.split(" ").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join(" ");for(var t=e.split(/[^\w]+/g).map(function(e,t){return 0!==t||i?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e.toLowerCase()}),n=e.split(/\w+/).filter(Boolean),o=[],r=0;r<Math.max(t.length,n.length);r++)t[r]&&o.push(t[r]),n[r]&&o.push(n[r]);return o.join("")},c.prototype.sentencecase=function(e,i){return e.split(". ").map(function(e,t){return 0!==t||i?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e.toLowerCase()}).join(". ")},c.prototype.togglecase=function(e){return e.split("").map(function(e){return e===e.toLowerCase()?e.toUpperCase():e.toLowerCase()}).join("")},c.prototype.changeCaseForTable=function(e,t,i,n,o,r,s){t=t.combineWidget(this.owner.viewer);for(var a=e;a<t.childWidgets.length;a++){for(var l=t.childWidgets[a],h=0;h<l.childWidgets.length;h++)this.changeCaseForSelectedCell(l.childWidgets[h],i,r,s);if(o.paragraph.isInsideTable&&i.containsRow(l,o.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,o,r,s)},c.prototype.changeCaseForSelectedCell=function(e,t,i,n){for(var o=0;o<e.childWidgets.length;o++){var r=e.childWidgets[o];r instanceof Lai?this.changeCaseForSelectedPara(r,t,i,n):this.changeCaseForSelTable(r,t,i,n)}},c.prototype.changeCaseForSelectedPara=function(e,t,i,n){for(var o=0;o<e.childWidgets.length;o++)for(var r=e.childWidgets[o],s="",a=0;a<r.children.length;a++){var l=r.children[a],h=(l.characterFormat.allCaps="Uppercase"===i&&!n,!1);!je(l)&&l instanceof pli&&(this.addRemovedTextNodes(l,l.text),"CapitalizeEachWord"===i?(h=0===a||" "===s,s=l.text.substr(l.length-1,1)):"SentenceCase"===i&&(h=". "===l.text.substr(l.length-2,2)||0===a),l.text=this.getChangeCaseText(l.text,i,n,h),l.isWidthUpdated=!1)}},c.prototype.changeCaseForSelTable=function(e,t,i,n){for(var o=0;o<e.childWidgets.length;o++)for(var r=e.childWidgets[o],s=0;s<r.childWidgets.length;s++)this.changeCaseForSelectedCell(r.childWidgets[s],t,i,n)},c.prototype.changeCaseParaFormatInCell=function(e,t,i,n,o){var r,s,a,l=this.documentHelper.selection;i.paragraph.isInsideTable?(r=l.getContainerCellOf(e,i.paragraph.associatedCell)).ownerTable.contains(i.paragraph.associatedCell)?(a=l.getSelectedCell(e,r),s=l.getSelectedCell(i.paragraph.associatedCell,r),l.containsCell(r,i.paragraph.associatedCell)?l.isCellSelected(r,t,i)?this.changeCaseParaForCellInternal(r,l,n,o):a===r?this.changeCaseParagraph(t.paragraph,l,t,i,n,o):this.changeCaseParaForRow(a.ownerRow,l,t,i,n,o):this.changeCaseParaForTableCell(r.ownerTable,r,s,n,o)):this.changeCaseParaForRow(r.ownerRow,l,t,i,n,o):(a=l.getContainerCell(e),this.changeCaseParaForRow(a.ownerRow,l,t,i,n,o))},c.prototype.changeCaseParaForTableCell=function(e,t,i,n,o){for(var r=this.documentHelper.selection,s=(h=r.getCellLeft(t.ownerRow,t))+t.cellFormat.cellWidth,a=r.getCellLeft(i.ownerRow,i),l=a+i.cellFormat.cellWidth,a=this.updateSelectedCellsInTable(h,s,a,l),h=a.start,s=a.end,d=e.childWidgets.indexOf(i.ownerRow),p=e.childWidgets.indexOf(t.ownerRow);p<=d;p++)for(var c=e.childWidgets[p],u=0;u<c.childWidgets.length;u++){var g=r.getCellLeft(c,c.childWidgets[u]);Math.round(h)<=Math.round(g)&&Math.round(g)<Math.round(s)&&this.changeCaseParaForCellInternal(c.childWidgets[u],r,n,o)}},c.prototype.changeCaseParaForCellInternal=function(e,t,i,n){for(var o=0;o<e.childWidgets.length;o++){var r=e.childWidgets[o];r instanceof Lai?this.changeCaseForSelectedPara(r,t,i,n):this.changeCaseParaFormatTableInternal(r,t,i,n)}},c.prototype.changeCaseParaFormatTableInternal=function(e,t,i,n){for(var o=0;o<e.childWidgets.length;o++)for(var r=e.childWidgets[o],s=0;s<r.childWidgets.length;s++)this.changeCaseParaForCellInternal(r.childWidgets[s],t,i,n)},c.prototype.changeCaseParaForRow=function(e,t,i,n,o,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.changeCaseParaForCellInternal(a.childWidgets[l],t,o,r);if(n.paragraph.isInsideTable&&this.documentHelper.selection.containsRow(a,n.paragraph.associatedCell))return}this.changeCaseNextBlock(e.ownerTable,i,n,o,r)},c.prototype.toggleAllCaps=function(){var e;this.documentHelper.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||(e=this.getCurrentSelectionValue("allCaps"),this.selection.characterFormat.allCaps=e)},c.prototype.toggleChangeCase=function(){var e=["Uppercase","Lowercase","CapitalizeEachWord"];return this.casingIndex++,this.casingIndex>=e.length&&(this.casingIndex=0),e[this.casingIndex]},c.prototype.getCurrentSelectionValue=function(e){var t,i=!1;return"bold"!==e&&"italic"!==e||(t=this.getSelectedCharacterFormat(),"bold"===e&&(i=!t.bold),"italic"===e&&(i=!t.italic)),i},c.prototype.getSelectedCharacterFormat=function(){var e,t=this.selection.start,i=(t=this.selection.isForward?t:this.selection.end).currentWidget,t=i.getInline(t.offset,0),n=t.element,t=t.index,o=i.paragraph.characterFormat;return je(n)||(this.selection.isEmpty&&"List"===this.selection.contextType?(e=this.selection.getListLevel(this.selection.start.paragraph)).characterFormat.uniqueCharacterFormat&&(o=e.characterFormat):o=(this.selection.isEmpty||t!==n.length?n:je(n.nextNode)?i.paragraph:n.nextNode).characterFormat),o},c.prototype.toggleUnderline=function(e){(this.owner.isReadOnlyMode||this.restrictFormatting)&&!this.selection.isInlineFormFillMode()||this.updateProperty(1,e)},c.prototype.toggleStrikethrough=function(e){var t;this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||(t=void 0,t=je(e)?"SingleStrike"===this.selection.characterFormat.strikethrough?"None":"SingleStrike":e,this.selection.characterFormat.strikethrough=t)},c.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(72<=e.fontSize&&e.fontSize<80)return 80;if(80<=e.fontSize)return e.fontSize+10;for(var n=0;n<i.length;n++)if(e.fontSize<i[n])return i[n]}else if("string"==typeof t&&"decrement"===t&&1<e.fontSize){if(e.fontSize<=8)return e.fontSize-1;if(72<e.fontSize&&e.fontSize<=80)return 72;if(80<e.fontSize)return e.fontSize-10;for(n=0;n<i.length;n++)if(e.fontSize<=i[n])return i[n-1]}return e.fontSize},c.prototype.applyCharFormatInline=function(e,t,i,n,o,r,s){return 0===i&&n===e.length?(this.applyCharFormatValue(e.characterFormat,o,r,s),0):e instanceof pli?this.formatInline(e,t,i,n,o,r,s):0},c.prototype.formatInline=function(e,t,i,n,o,r,s){var a,l=0,h=e,d=e.line.children.indexOf(h),p=(e.paragraph,0);return 0<i&&(p+=1,(a=new pli).characterFormat.copyFormat(e.characterFormat),je(e.contentControlProperties)||(a.contentControlProperties=e.contentControlProperties),a.line=e.line,a.text=e.text.substr(i,n-i),a.isRightToLeft=e.isRightToLeft,this.applyCharFormatValue(a.characterFormat,o,r,s),h.line.children.splice(++d,0,a),l++,this.updateRevisionForFormattedContent(e,a,p)),n<h.length&&(p+=1,(a=new pli).characterFormat.copyFormat(e.characterFormat),je(e.contentControlProperties)||(a.contentControlProperties=e.contentControlProperties),a.text=h.text.substring(n),a.line=e.line,a.isRightToLeft=e.isRightToLeft,h.line.children.splice(++d,0,a),l++,this.updateRevisionForFormattedContent(e,a,p)),0===i?(e.text=e.text.substr(0,n),this.applyCharFormatValue(e.characterFormat,o,r,s)):e.text=e.text.substr(0,i),l},c.prototype.updateRevisionForFormattedContent=function(e,t,i){for(var n=0;n<e.revisions.length;n++){var o=e.revisions[n],r=o.range.indexOf(e)+i;t.revisions.splice(0,0,o),o.range.splice(r,0,t),this.owner.trackChangesPane.updateCurrentTrackChanges(o)}},c.prototype.applyCharFormatCell=function(e,t,i,n,o,r,s){if(!n.paragraph.isInsideTable)return a=t.getContainerCell(e),this.applyCharFormatRow(a.ownerRow,t,i,n,o,r,s);var a=t.getContainerCellOf(e,n.paragraph.associatedCell);if(!a.ownerTable.contains(n.paragraph.associatedCell))return this.applyCharFormatRow(a.ownerRow,t,i,n,o,r,s);var l=t.getSelectedCell(e,a),h=t.getSelectedCell(n.paragraph.associatedCell,a);if(t.containsCell(a,n.paragraph.associatedCell)){if(!t.isCellSelected(a,i,n))return l===a?this.applyCharFormat(i.paragraph,t,i,n,o,r,s):this.applyCharFormatRow(l.ownerRow,t,i,n,o,r,s);r=this.getCharacterFormatValueOfCell(e,t,r,o),this.applyCharFormatForSelectedCell(a,t,o,r,s)}else this.applyCharFormatForTableCell(a.ownerTable,t,a,h,o,r,s)},c.prototype.applyCharFormatForSelectedCell=function(e,t,i,n,o){for(var r=0;r<e.childWidgets.length;r++){var s=e.childWidgets[r];s instanceof Lai?this.applyCharFormatForSelectedPara(s,t,i,n,o):this.applyCharFormatForSelTable(s,t,i,n,o)}},c.prototype.applyCharFormatRow=function(e,t,i,n,o,r,s){return r=this.getCharacterFormatValueOfCell(e.childWidgets[0],t,r,o),this.applyCharFormatForTable(e.rowIndex,e.ownerTable,t,i,n,o,r,s)},c.prototype.applyCharFormatForTable=function(e,t,i,n,o,r,s,a){t=t.combineWidget(this.owner.viewer);for(var l=e;l<t.childWidgets.length;l++){for(var h=t.childWidgets[l],d=0;d<h.childWidgets.length;d++)this.applyCharFormatForSelectedCell(h.childWidgets[d],i,r,s,a);if(o.paragraph.isInsideTable&&i.containsRow(h,o.paragraph.associatedCell))return void this.documentHelper.layout.layoutBodyWidgetCollection(t.index,t.containerWidget,t,!1)}return this.documentHelper.layout.layoutBodyWidgetCollection(t.index,t.containerWidget,t,!1),this.getNextParagraphForCharacterFormatting(t,n,o,r,s,a)},c.prototype.applyCharFormatForSelTable=function(e,t,i,n,o){for(var r=0;r<e.childWidgets.length;r++)for(var s=e.childWidgets[r],a=0;a<s.childWidgets.length;a++)this.applyCharFormatForSelectedCell(s.childWidgets[a],t,i,n,o)},c.prototype.applyCharFormatForTableCell=function(e,t,i,n,o,r,s){for(var a=(d=t.getCellLeft(i.ownerRow,i))+i.cellFormat.cellWidth,l=t.getCellLeft(n.ownerRow,n),h=l+n.cellFormat.cellWidth,l=this.updateSelectedCellsInTable(d,a,l,h),d=l.start,a=l.end,p=e.childWidgets.indexOf(n.ownerRow),c=!1,u=e.childWidgets.indexOf(i.ownerRow);u<=p;u++)for(var g=e.childWidgets[u],m=0;m<g.childWidgets.length;m++){var f=t.getCellLeft(g,g.childWidgets[m]);Y.round(d,2)<=Y.round(f,2)&&Y.round(f,2)<Y.round(a,2)&&(c||(r=this.getCharacterFormatValueOfCell(g.childWidgets[m],t,r,o),c=!0),this.applyCharFormatForSelectedCell(g.childWidgets[m],t,o,r,s))}},c.prototype.updateSelectedCellsInTable=function(e,t,i,n){var o=this.documentHelper.selection;return{start:e=(e=i<e?i:e)>o.upDownSelectionLength?o.upDownSelectionLength:e,end:t=(t=t<n?n:t)<o.upDownSelectionLength?o.upDownSelectionLength:t}},c.prototype.getCharacterFormatValueOfCell=function(e,t,i,n){return"boolean"!=typeof i&&(void 0!==i||"bold"!==n&&"italic"!==n)||(e=(t=t.getFirstParagraph(e)).characterFormat,i=!(e=0<t.childWidgets.length&&0<t.childWidgets[0].children.length?t.childWidgets[0].children[0].characterFormat:e).getPropertyValue(n)),i},c.prototype.applyCharFormatValueInternal=function(e,t,i,n){this.applyCharFormatValue(t,i,n,!1)},c.prototype.copyInlineCharacterFormat=function(e,t){t.uniqueCharacterFormat=e.uniqueCharacterFormat,t.baseCharStyle=e.baseCharStyle},c.prototype.applyCharFormatValue=function(e,t,i,n){if(n&&"fontSize"===t&&(i=this.updateFontSize(e,i)),this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&(i=this.editorHistory.currentBaseHistoryInfo.addModifiedProperties(e,t,i),this.editorHistory.currentBaseHistoryInfo.insertedFormat=i),i instanceof Eri)this.editorHistory&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)?(this.copyInlineCharacterFormat(i,e),this.owner.enableCollaborativeEditing&&e.ownerBase instanceof Xai&&this.editorHistory.currentBaseHistoryInfo.buildCharacterFormatOperation(e.ownerBase,e)):e.copyFormat(i);else{if(this.isForHyperlinkFormat&&this.owner.enableTrackChanges&&e.ownerBase instanceof Xai){var o,r,n=e.ownerBase,s=n.previousNode;for(!je(s)||je(r=n.paragraph.previousWidget)||r.isEmpty()||(s=(r=r.lastChild).children[r.children.length-1]);!(je(s)||s instanceof pli);)s=s.previousNode;!je(s)&&0<s.revisions.length?(o=s.revisions[s.revisions.length-1],"fontColor"===t&&0!==n.revisions.length||this.isRevisionAlreadyIn(n,o)||(n.revisions.push(o),o.range.push(n),this.owner.trackChangesPane.updateCurrentTrackChanges(o))):(o=n.revisions[n.revisions.length-1],("fontColor"!==t||0===n.revisions.length)&&!je(o)&&0<o.range.length&&(n.revisions.splice(n.revisions.length-1,1),r=o.range.indexOf(n),o.range.splice(r,1),this.owner.trackChangesPane.updateCurrentTrackChanges(o)),"fontColor"===t&&0!==n.revisions.length||this.insertRevision(n,"Insertion"))}je(i)&&je(t)?(e.clearFormat(),je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||(this.editorHistory.currentBaseHistoryInfo.insertedFormat=e[t])):("bold"===t?(this.isRTLFormat(e)&&(e.boldBidi=e.bold==e.boldBidi?i:!i),e.bold=i):"italic"===t?(this.isRTLFormat(e)&&(e.italicBidi=e.italic==e.italicBidi?i:!i),e.italic=i):"fontColor"===t?e.fontColor=i:"fontFamily"===t?(e.fontFamily=i,e.fontFamilyAscii=i,e.fontFamilyFarEast=i,e.fontFamilyNonFarEast=i,e.fontFamilyBidi=i):"fontSize"===t?(e.fontSize=i,this.isRTLFormat(e)&&(e.fontSizeBidi=i)):"highlightColor"===t?e.highlightColor=i:"baselineAlignment"===t?e.baselineAlignment=i:"strikethrough"===t?e.strikethrough=i:"underline"===t?e.underline=i:"styleName"===t?e.baseCharStyle=i:"allCaps"===t&&(e.allCaps=i),"fontColor"===t&&this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&(this.editorHistory.currentBaseHistoryInfo.insertedFormat=e.fontColor))}},c.prototype.isRTLFormat=function(e){return e.bidi||e.complexScript||!je(e.ownerBase)&&e.ownerBase instanceof pli&&this.documentHelper.textHelper.getRtlLanguage(e.ownerBase.text).isRtl},c.prototype.updateStyleObject=function(e){var t=new Gri,i=this.owner.parser.keywordIndex,n=(this.owner.parser.keywordIndex=1,this.owner.editor.isRemoteAction);this.owner.editor.isRemoteAction=!0,this.owner.parser.parseStyles(e,t);for(var o=0;o<t.length;o++){var r,s,a=t.getItem(o),l=this.owner.documentHelper.styles.findByName(a.name);je(e[dZt[1]])||(this.owner.parser.parseAbstractList(e,this.owner.documentHelper.abstractLists),je(e[hZt[1]]))||this.owner.parser.parseList(e,this.owner.documentHelper.lists),je(l)?(this.owner.editorHistory.isRedoing&&(r=a instanceof _ri?a.paragraphFormat.listFormat.listId:-1,(s=this.documentHelper.owner.getStyleObject(a,r)).isNew=!0,this.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo.modifiedProperties.push(s)),this.owner.documentHelper.styles.push(a)):(this.owner.editorHistoryModule&&(this.owner.editorHistoryModule.isUndoing||this.owner.editorHistoryModule.isRedoing)&&0===o&&this.owner.editorHistoryModule.currentBaseHistoryInfo&&"ModifyStyle"===this.owner.editorHistoryModule.currentBaseHistoryInfo.action&&(r=l instanceof _ri?l.paragraphFormat.listFormat.listId:-1,s=this.owner.getStyleObject(l,r),je(e.isNew)||(s.isNew=e.isNew),this.owner.editorHistoryModule.currentBaseHistoryInfo.modifiedProperties.push(s)),e.isNew&&this.owner.editorHistoryModule.isUndoing?this.owner.documentHelper.styles.remove(l):this.owner.updateStyle(l,a))}this.owner.editor.isRemoteAction=n,0<t.length&&(this.owner.isShiftingEnabled=!0,this.owner.editorModule.layoutWholeDocument(),this.owner.isShiftingEnabled=!1),this.owner.parser.keywordIndex=i},c.prototype.onImageFormat=function(e,t,i,n){var o=new pci(e);this.editorHistory&&(this.editorHistory.initializeHistory("ImageResizing"),this.editorHistory.currentBaseHistoryInfo.modifiedProperties.push(o),this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Image,this.editorHistory.currentBaseHistoryInfo.insertedData={width:Y.convertPixelToPoint(t),height:Y.convertPixelToPoint(i),alternativeText:n}),this.setOffsetValue(this.selection),e.width=t,e.height=i,e.alternateText=n,this.documentHelper.layout.reLayoutParagraph(e.line.paragraph,e.line.indexInOwner,0),this.reLayout(this.selection,!1),this.documentHelper.owner.imageResizerModule&&!this.isRemoteAction&&this.documentHelper.owner.imageResizerModule.positionImageResizer(e)},c.prototype.toggleTextAlignment=function(e){this.documentHelper.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||!this.documentHelper.owner.isDocumentLoaded||(je(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))},c.prototype.setPreviousBlockToLayout=function(){var e=this.documentHelper.selection.start,e=(e=this.documentHelper.selection.isForward?e:this.documentHelper.selection.end).paragraph;e.paragraphFormat.keepWithNext&&!je(e=e.bodyWidget)&&e instanceof Sai&&e.page&&(e=e.page.previousPage)&&(this.previousBlockToLayout=e.bodyWidgets[0].lastChild)},c.prototype.applyParagraphBorders=function(e,t,i){var n=new pri;switch(e){case"color":n.color=i;break;case"lineWidth":n.lineWidth=i;break;case"lineStyle":n.lineStyle=i;break;case"shadow":n.shadow=i;break;case"space":n.space=i}this.onApplyParagraphFormat(t,n,!1,!1)},c.prototype.applyRulerMarkerValues=function(e,t,i){var n,i=Y.convertPixelToPoint(i-t)/this.owner.zoomFactor;"firstLineIndent"===e?(n=this.owner.selectionModule.start.paragraph.paragraphFormat.firstLineIndent,this.onApplyParagraphFormat(e,n+i,!1,!1)):"hangingIndent"===e?(n=this.owner.selectionModule.start.paragraph.paragraphFormat.firstLineIndent,this.onApplyParagraphFormat("firstLineIndent",n-i,!1,!1),t=this.owner.selectionModule.start.paragraph.paragraphFormat.leftIndent+n,this.onApplyParagraphFormat("leftIndent",t-(n-=i),!1,!1,!0)):"leftIndent"===e?(n=this.owner.selectionModule.start.paragraph.paragraphFormat.leftIndent,this.onApplyParagraphFormat(e,n+i,!1,!1)):"rightIndent"===e&&(n=this.owner.selectionModule.start.paragraph.paragraphFormat.rightIndent,this.onApplyParagraphFormat(e,n+i,!1,!1))},c.prototype.onApplyParagraphFormat=function(e,t,i,n,o){var r=this.documentHelper.isFormFillProtectedMode&&this.documentHelper.selection.isInlineFormFillMode()&&this.allowFormattingInFormFields(e);if(!(this.restrictFormatting&&!r||!je(this.selection)&&this.selection.checkContentControlLocked(!0))){this.setPreviousBlockToLayout();var s="bidi"===e?"ParagraphBidi":e[0].toUpperCase()+e.slice(1),a=(this.documentHelper.owner.isShiftingEnabled=!0,this.documentHelper.selection),l=a.start.paragraph,h=!1;if(a.isForward||(l=a.end.paragraph),"leftIndent"==e&&(h=this.isFirstParaForList(a,l)),t<=0&&"leftIndent"==e&&!o){var o=Y.convertPointToPixel(t);if(l.x+o<this.viewer.clientArea.x&&!l.paragraphFormat.bidi)return void(this.documentHelper.owner.isShiftingEnabled=!1)}this.initHistory(s),this.owner.isReadOnlyMode&&!r||!this.owner.isDocumentLoaded||("leftIndent"===e&&!je(a.paragraphFormat.listId)&&-1!==a.paragraphFormat.listId&&i?h?this.updateListLevelIndent(t,l):this.updateListLevel(0<t):(!(t instanceof jri&&"styleName"==e&&a.isEmpty)&&a.isEmpty?(this.setOffsetValue(a),a.paragraphFormat.bidi&&("listFormat"===e||-1!==a.paragraphFormat.listId)||(this.documentHelper.layout.isBidiReLayout=!0),i&&"leftIndent"===e&&(t=this.getIndentIncrementValue(a.start.paragraph,t)),o=a.start.paragraph,this.documentHelper.layout,o=o.combineWidget(this.owner.viewer),this.applyParaFormatProperty(o,e,t,i),this.isMeasureParaWidth=!0,this.layoutItemBlock(o,!1),this.isMeasureParaWidth=!1):("ParagraphBidi"!==s&&this.setOffsetValue(a),this.updateSelectionParagraphFormatting(e,t,i)),this.reLayout(a)))}},c.prototype.updateListLevelIndent=function(e,t){var i,t=this.documentHelper.getListById(t.paragraphFormat.listFormat.listId),n=this.documentHelper.getAbstractListById(t.abstractListId),t=void 0;if(je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||(t=this.editorHistory.currentBaseHistoryInfo.action),this.initHistory("List"),0!=(e=e<0&&n.levels[0].paragraphFormat.leftIndent+e<=0?18-n.levels[0].paragraphFormat.leftIndent:e)){for(var o=0;o<n.levels.length;o++)this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&this.editorHistory.currentBaseHistoryInfo.addModifiedPropertiesForList(n.levels[o]),n.levels[o].paragraphFormat.leftIndent+=e;je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||je(t)||(this.editorHistory.currentBaseHistoryInfo.insertedFormat=((i={})[t.toString().charAt(0).toLowerCase()+t.toString().slice(1)]=e,i.isFirstParaForList=!0,i)),this.documentHelper.owner.isShiftingEnabled=!0,this.layoutWholeDocument(),this.documentHelper.owner.isShiftingEnabled=!1}},c.prototype.isFirstParaForList=function(e,t){var i=!1;return je(e.paragraphFormat.listId)||-1===e.paragraphFormat.listId||0!==t.paragraphFormat.listFormat.listLevelNumber||je(this.updateWholeListItems(t,!0,e.paragraphFormat.listId))&&(i=!0),i},c.prototype.updateListLevel=function(e){var t=this.documentHelper,i=(this.documentHelper.selection.start.paragraph.paragraphFormat.listFormat,this.documentHelper.selection.start.paragraph.paragraphFormat),n=t.getListById(i.listFormat.listId),e=(t.layout.getListLevel(n,i.listFormat.listLevelNumber),e?i.listFormat.listLevelNumber+1:i.listFormat.listLevelNumber-1);je(t.layout.getListLevel(n,e))||(this.onApplyListInternal(n,e),t.selection.start.updatePhysicalPosition(!0),t.selection.end.updatePhysicalPosition(!0),t.selection.updateCaretPosition())},c.prototype.onApplyListInternal=function(e,t){var i=new mri;!je(e)&&0<=t&&t<9&&(i.listId=e.listId,i.listLevelNumber=t),this.onApplyParagraphFormat("listFormat",i,!1,!1)},c.prototype.updateSelectionParagraphFormatting=function(e,t,i){var n=this.documentHelper.selection;"leftIndent"===e&&i&&(t=!je(n.start)&&n.start.isExistBefore(n.end)?this.getIndentIncrementValue(n.start.paragraph,t):this.getIndentIncrementValue(n.end.paragraph,t)),this.updateParagraphFormatInternal(e,t,i)},c.prototype.getIndentIncrementValue=function(e,t){var i,e=e.paragraphFormat.leftIndent;return e<0?t<0||0<=e+t?-e:(i=-this.getIndentIncrementValueInternal(-e,-t))%t==0?i:i+t:this.getIndentIncrementValueInternal(e,t)},c.prototype.getIndentIncrementValueInternal=function(e,t){var i,n=Math.abs(t);return 0===e||0===n?0<t?n:0:(i=100*Math.round(e)%(100*Math.round(n))/100,i=(Math.round(e)-i)/Math.round(n)*n,0<t&&(i+=n),i-e==0?t:i-e)},c.prototype.updateParagraphFormatInternal=function(e,t,i){switch(e=je(e)?"ParagraphFormat":e){case"afterSpacing":this.updateParagraphFormat("afterSpacing",t,!1);break;case"beforeSpacing":this.updateParagraphFormat("beforeSpacing",t,!1);break;case"spaceAfterAuto":this.updateParagraphFormat("spaceAfterAuto",t,!1);break;case"spaceBeforeAuto":this.updateParagraphFormat("spaceBeforeAuto",t,!1);break;case"rightIndent":this.updateParagraphFormat("rightIndent",t,!1);break;case"leftIndent":this.updateParagraphFormat("leftIndent",t,i);break;case"firstLineIndent":this.updateParagraphFormat("firstLineIndent",t,!1);break;case"lineSpacing":this.updateParagraphFormat("lineSpacing",t,!1);break;case"lineSpacingType":this.updateParagraphFormat("lineSpacingType",t,!1);break;case"textAlignment":this.updateParagraphFormat("textAlignment",t,!1);break;case"borders":case"topBorder":case"bottomBorder":case"leftBorder":case"rightBorder":case"horizontalBorder":case"verticalBorder":this.updateParagraphFormat(e,t,!1);break;case"listFormat":this.updateParagraphFormat("listFormat",t,!1);break;case"ParagraphFormat":this.updateParagraphFormat(void 0,t,!1);break;case"styleName":this.updateParagraphFormat("styleName",t,!1);break;case"ClearParagraphFormat":this.updateParagraphFormat(void 0,t,!1);break;case"bidi":var n=-1!==this.selection.paragraphFormat.listId;n||(this.documentHelper.layout.isBidiReLayout=!0),this.updateParagraphFormat("bidi",t,!1),n||(this.documentHelper.layout.isBidiReLayout=!1);break;case"contextualSpacing":this.updateParagraphFormat("contextualSpacing",t,!1);break;case"tabStop":this.updateParagraphFormat("tabStop",t,!1)}},c.prototype.updateParagraphFormat=function(e,t,i){var n=this.documentHelper.selection,o=n.start,r=n.end;n.isForward||(o=n.end,r=n.start),this.applyParaFormatSelectedContent(o,r,e,t,i)},c.prototype.applyParaFormatSelectedContent=function(e,t,i,n,o){var r,s=this.documentHelper.selection;!e.paragraph.isInsideTable||t.paragraph.isInsideTable&&e.paragraph.associatedCell===t.paragraph.associatedCell&&!s.isCellSelected(e.paragraph.associatedCell,e,t)?!je(n)&&!this.selection.isEmpty&&"styleName"===i&&this.applyCharacterStyle(e.paragraph,e,t,i,n,o)||this.applyParaFormat(e.paragraph,e,t,i,n,o):(r=void 0,e.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer),this.checkInsertPosition(s)&&this.updateHistoryPosition(e,!0),r=e.paragraph.associatedCell,this.applyParaFormatInCell(r,e,t,i,n,o),s=r.ownerTable,this.documentHelper.layout.layoutBodyWidgetCollection(s.index,s.containerWidget,s,!1))},c.prototype.applyParaFormatProperty=function(e,t,i,n){var o=e.paragraphFormat;n&&"leftIndent"===t&&(i=o.leftIndent+i),"listFormat"===t&&i instanceof mri&&((n=i).hasValue("listLevelNumber")||(this.isAutoList?(n.listLevelNumber=this.listLevelNumber,this.listLevelNumber=0,this.isAutoList=!1):n.listLevelNumber=o.listFormat.listLevelNumber)),this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&(i=this.editorHistory.currentBaseHistoryInfo.addModifiedPropertiesForParagraphFormat(o,t,i),this.editorHistory.currentBaseHistoryInfo.insertedFormat=i),i instanceof bri&&(je(t)?this.editorHistory&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)||this.isRemoteAction?this.copyParagraphFormat(i,o):o.copyFormat(i):"listFormat"===t&&(o.listFormat=i.listFormat,(o.listFormat.ownerBase=o).copyFormat(i)),this.editorHistory)&&!je(this.editorHistory.currentBaseHistoryInfo)&&this.owner.enableCollaborativeEditing&&this.editorHistory.isUndoing&&this.editorHistory.currentBaseHistoryInfo.getParagraohFormatOperation(e,o),je(i)?(o.clearFormat(),this.documentHelper.layout.reLayoutParagraph(o.ownerBase,0,0)):"afterSpacing"===t?o.afterSpacing=i:"beforeSpacing"===t?o.beforeSpacing=i:"leftIndent"===t?o.leftIndent=i:"lineSpacingType"===t?o.lineSpacingType=i:"lineSpacing"===t?o.lineSpacing=i:"rightIndent"===t?o.rightIndent=i:"firstLineIndent"===t?o.firstLineIndent=i:"textAlignment"===t?(n=i,!o.bidi||this.editorHistory.isUndoing||this.editorHistory.isRedoing||("Left"===n?n="Right":"Right"===n&&(n="Left")),o.textAlignment=n):"outlineLevel"===t?o.outlineLevel=i:"topBorder"===t?this.applyBorder(o.borders.top,i):"bottomBorder"===t?this.applyBorder(o.borders.bottom,i):"leftBorder"===t?this.applyBorder(o.borders.left,i):"rightBorder"===t?this.applyBorder(o.borders.right,i):"horizontalBorder"===t?this.applyBorder(o.borders.horizontal,i):"verticalBorder"===t?this.applyBorder(o.borders.vertical,i):"borders"===t?o.borders.copyFormat(i):"styleName"===t?("string"==typeof i&&(i=this.documentHelper.styles.findByName(i)),o.applyStyle(i)):"listFormat"===t?(i instanceof bri&&(i=i.listFormat),o.listFormat.copyFormat(i),this.documentHelper.layout.clearListElementBox(o.ownerBase),0<=o.listFormat.listId&&o.clearIndent(),this.layoutItemBlock(o.ownerBase,!1)):"bidi"===t?o.bidi=i:"keepWithNext"===t?o.keepWithNext=i:"keepLinesTogether"===t?o.keepLinesTogether=i:"widowControl"===t?o.widowControl=i:"contextualSpacing"===t?o.contextualSpacing=i:"spaceAfterAuto"===t?o.spaceAfterAuto=i:"spaceBeforeAuto"===t?o.spaceBeforeAuto=i:"tabStop"===t&&(n=this.editorHistory.isUndoing||this.editorHistory.isRedoing,this.updateTabStopCollection(e,i,n))},c.prototype.copyParagraphFormat=function(e,t){t.uniqueParagraphFormat=e.uniqueParagraphFormat,t.listFormat=e.listFormat,(t.listFormat.ownerBase=t).baseStyle=e.baseStyle},c.prototype.copyFromListLevelParagraphFormat=function(e,t){je(t.leftIndent)||(e.leftIndent=t.leftIndent),je(t.firstLineIndent)||(e.firstLineIndent=t.firstLineIndent)},c.prototype.applyContinueNumbering=function(){var e=this.selection;this.editorHistory&&this.editorHistory.initializeHistory("ContinueNumbering"),this.applyContinueNumberingInternal(e)},c.prototype.continueNumbering=function(){var e=this.selection;this.editorHistory&&this.editorHistory.initializeHistory("ContinueNumbering"),je(e)||this.applyContinueNumberingInternal(e)},c.prototype.applyContinueNumberingInternal=function(e,t){var i=e.start.paragraph,n=this.getContinueNumberingInfo(i);je(t)&&(t=this.getParagraphFormat(i,n.listLevelNumber,n.listPattern)),t=je(t)?i.paragraphFormat:t,je(n.currentList)||(this.changeListId(n.currentList,i,t,n.listLevelNumber,n.listPattern),this.reLayout(e,!1),this.owner.enableAutoFocus&&this.documentHelper.updateFocus())},c.prototype.getContinueNumberingInfo=function(e){var t=void 0,i=0,n="None",e=(je(e.paragraphFormat)||je(e.paragraphFormat.listFormat)||(t=this.documentHelper.getListById(e.paragraphFormat.listFormat.listId),i=e.paragraphFormat.listFormat.listLevelNumber),this.documentHelper);return{currentList:t,listLevelNumber:i,listPattern:n=0===i||je(t)||je(e.getAbstractListById(t.abstractListId))||je(e.getAbstractListById(t.abstractListId).levels[i])||je(e=this.documentHelper.layout.getListLevel(t,i))?n:e.listLevelPattern}},c.prototype.revertContinueNumbering=function(e,t){var i=e.start.paragraph,n=this.getContinueNumberingInfo(i);this.changeListId(n.currentList,i,t,n.listLevelNumber,n.listPattern),this.reLayout(e,!1),this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&this.editorHistory.updateHistory()},c.prototype.changeListId=function(e,t,i,n,o){var r;if(!je(t))return t instanceof Lai&&e.listId===t.paragraphFormat.listFormat.listId&&(this.editorHistory&&!je(r=this.editorHistory.currentBaseHistoryInfo)&&(i=r.addModifiedPropertiesForContinueNumbering(t.paragraphFormat,i),r.insertedFormat=i),n===t.paragraphFormat.listFormat.listLevelNumber?t.paragraphFormat.copyFormat(i):t.paragraphFormat.listFormat.listId=i.listFormat.listId,this.documentHelper.layout.reLayoutParagraph(t,0,0)),this.changeListId(e,t.nextRenderedWidget,i,n,o)},c.prototype.getParagraphFormat=function(e,t,i){if(!je(e.previousRenderedWidget)&&e.previousRenderedWidget instanceof Lai)return!je(e.previousRenderedWidget.paragraphFormat.listFormat)&&-1!==e.previousRenderedWidget.paragraphFormat.listFormat.listId&&t===e.previousRenderedWidget.paragraphFormat.listFormat.listLevelNumber?e.previousRenderedWidget.paragraphFormat:this.getParagraphFormat(e.previousRenderedWidget,t,i)},c.prototype.checkNumberArabic=function(e,t){return"Number"===e&&"Arabic"===t||"Number"===t&&"Arabic"===e},c.prototype.restartNumbering=function(){this.editorHistory&&this.editorHistory.initializeHistory("RestartNumbering");var e=this.documentHelper.selection;je(e)||this.restartListAt(e)},c.prototype.applyRestartNumbering=function(e){this.editorHistory&&this.editorHistory.initializeHistory("RestartNumbering"),this.restartListAt(e)},c.prototype.restartListAt=function(e){var t,i;e.paragraphFormat.getList()&&((t=(i=e.paragraphFormat.getList()).clone()).listId=this.documentHelper.lists[this.documentHelper.lists.length-1].listId+1,this.documentHelper.lists.push(t),(i=i.abstractList.clone()).abstractListId=this.documentHelper.abstractLists[this.documentHelper.abstractLists.length-1].abstractListId+1,t.abstractListId=i.abstractListId,t.nsid=i.nsid,t.abstractList=i,this.documentHelper.abstractLists.push(i),this.restartListAtInternal(e,t.listId,t.nsid))},c.prototype.restartListAtInternal=function(e,t,i){var n=this.getContinueNumberingInfo(e.start.paragraph);this.changeRestartNumbering(n.currentList,e.start.paragraph,t,i),this.reLayout(e,!1),this.documentHelper.updateFocus()},c.prototype.changeRestartNumbering=function(e,t,i,n){var o;if(!je(t))return t instanceof Lai&&e.listId===t.paragraphFormat.listFormat.listId&&(this.editorHistory&&!je(o=this.editorHistory.currentBaseHistoryInfo)&&(i=o.addModifiedPropertiesForRestartNumbering(t.paragraphFormat.listFormat,i),o.insertedFormat={listId:i,nsid:n}),t.paragraphFormat.listFormat.listId=i,this.documentHelper.layout.reLayoutParagraph(t,0,0)),this.changeRestartNumbering(e,t.nextRenderedWidget,i,n)},c.prototype.applyParaFormat=function(e,t,i,n,o,r){this.setOffsetValue(this.selection),e=e.combineWidget(this.owner.viewer),this.applyParaFormatProperty(e,n,o,r),this.isMeasureParaWidth=!0,this.layoutItemBlock(e,!1),this.isMeasureParaWidth=!1,this.getOffsetValue(this.selection),e.equals(i.paragraph)||this.getNextParagraphForFormatting(e,t,i,n,o,r)},c.prototype.applyCharacterStyle=function(e,t,i,n,o,r){var s=e.getSplitWidgets(),a=i.owner.selectionModule,l=i.currentWidget,t=0===t.offset&&(a.isParagraphLastLine(l)&&i.currentWidget===l&&i.offset===a.getLineLength(l)+1||i.isAtParagraphEnd);if(!t&&(i.paragraph===e||-1!==s.indexOf(i.paragraph))&&("Paragraph"===o.type&&o.link instanceof jri||"Character"===o.type))return a="Character"===o.type?o:o.link,this.updateSelectionCharacterFormatting(n,a,r),!0;return!1},c.prototype.applyParaFormatInCell=function(e,t,i,n,o,r){var s,a,l,h=this.documentHelper.selection;i.paragraph.isInsideTable?(s=h.getContainerCellOf(e,i.paragraph.associatedCell)).ownerTable.contains(i.paragraph.associatedCell)?(l=h.getSelectedCell(e,s),a=h.getSelectedCell(i.paragraph.associatedCell,s),h.containsCell(s,i.paragraph.associatedCell)?h.isCellSelected(s,t,i)?(o=this.getParaFormatValueInCell(s,n,o),this.applyParaFormatCellInternal(s,n,o,r)):l===s?this.applyParaFormat(t.paragraph,t,i,n,o,r):this.applyParagraphFormatRow(l.ownerRow,t,i,n,o,r):this.applyParaFormatTableCell(s.ownerTable,s,a,n,o,r)):this.applyParagraphFormatRow(s.ownerRow,t,i,n,o,r):(l=h.getContainerCell(e),this.applyParagraphFormatRow(l.ownerRow,t,i,n,o,r))},c.prototype.applyParaFormatCellInternal=function(e,t,i,n,o){for(var r=0;r<e.childWidgets.length;r++){var s=e.childWidgets[r];s instanceof Lai?("listFormat"===t&&i instanceof mri&&o&&s.paragraphFormat.listFormat.hasValue("listLevelNumber")&&i.listLevelNumber<s.paragraphFormat.listFormat.listLevelNumber&&(i.listLevelNumber=s.paragraphFormat.listFormat.listLevelNumber),this.isMeasureParaWidth=!0,this.applyParaFormatProperty(s,t,i,n),this.isMeasureParaWidth=!1):this.applyParagraphFormatTableInternal(s,t,i,n,o)}},c.prototype.getParaFormatValueInCell=function(e,t,i){return i="boolean"==typeof i?!this.documentHelper.selection.getFirstParagraph(e).paragraphFormat.getPropertyValue(t):i},c.prototype.applyParagraphFormatRow=function(e,t,i,n,o,r){o=this.getParaFormatValueInCell(e.childWidgets[0],n,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.applyParaFormatCellInternal(a.childWidgets[l],n,o,r);if(i.paragraph.isInsideTable&&this.documentHelper.selection.containsRow(a,i.paragraph.associatedCell))return}this.getNextParagraphForFormatting(e.ownerTable,t,i,n,o,r)},c.prototype.applyParaFormatTableCell=function(e,t,i,n,o,r){for(var s=this.documentHelper.selection,a=(d=s.getCellLeft(t.ownerRow,t))+t.cellFormat.cellWidth,l=s.getCellLeft(i.ownerRow,i),h=l+i.cellFormat.cellWidth,l=this.updateSelectedCellsInTable(d,a,l,h),d=l.start,a=l.end,p=e.childWidgets.indexOf(i.ownerRow),c=!1,u=e.childWidgets.indexOf(t.ownerRow);u<=p;u++)for(var g=e.childWidgets[u],m=0;m<g.childWidgets.length;m++){var f=s.getCellLeft(g,g.childWidgets[m]);Math.round(d)<=Math.round(f)&&Math.round(f)<Math.round(a)&&(c||(o=this.getParaFormatValueInCell(g.childWidgets[m],n,o),c=!0),this.applyParaFormatCellInternal(g.childWidgets[m],n,o,r))}},c.prototype.applyParaFormatTable=function(e,t,i,n,o,r,s){e=e.combineWidget(this.owner.viewer);for(var a=this.documentHelper.selection,l=0;l<e.childWidgets.length;l++){for(var h=e.childWidgets[l],d=0;d<h.childWidgets.length;d++)this.applyParaFormatCellInternal(h.childWidgets[d],n,o,r,s);if(i.paragraph.isInsideTable&&a.containsRow(h,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,o,r)},c.prototype.getNextParagraphForFormatting=function(e,t,i,n,o,r){var s=e.getSplitWidgets();e=s[s.length-1],je(e=this.documentHelper.selection.getNextRenderedBlock(e))||(e instanceof Lai?("listFormat"===n&&o instanceof mri&&e.paragraphFormat.listFormat.hasValue("listLevelNumber")&&o.listLevelNumber<e.paragraphFormat.listFormat.listLevelNumber&&(o.listLevelNumber=e.paragraphFormat.listFormat.listLevelNumber),this.applyParaFormat(e,t,i,n,o,r)):this.applyParaFormatTable(e,t,i,n,o,r,!0))},c.prototype.applyParagraphFormatTableInternal=function(e,t,i,n,o){for(var r=0;r<e.childWidgets.length;r++)for(var s=e.childWidgets[r],a=0;a<s.childWidgets.length;a++)this.applyParaFormatCellInternal(s.childWidgets[a],t,i,n,o)},c.prototype.onApplyColumnFormat=function(e,t){if(!this.restrictFormatting){this.initHistory("SectionFormat");for(var i,n=this.documentHelper.selection,o=(n.owner.isShiftingEnabled=!0,n.start),r=n.end,s=(n.isForward||(o=n.end,r=n.start),this.documentHelper.clearContent(),o.paragraph.bodyWidget.sectionIndex),a=r.paragraph.bodyWidget.sectionIndex,l=!1,h=0;h<this.documentHelper.pages.length;h++)this.documentHelper.pages[h].bodyWidgets[0].index===s?i=h:l=!0;for(h=i;h<this.documentHelper.pages.length;h++){var d=this.documentHelper.pages[h].bodyWidgets[0],p=h;if(d.index!==s&&!(d.index>=s&&d.index<=a)){p=h-1;break}}l&&"differentOddAndEvenPages"==e&&o.paragraph.isInHeaderFooter&&(i=0,p=this.documentHelper.pages.length-1);for(var c=!0,u=0,h=i;h<=p;h++)u!==this.documentHelper.pages[h].bodyWidgets[0].index&&(c=c||!0),this.applyPropertyValueForSection(this.documentHelper.pages[h].bodyWidgets[0].sectionFormat,e,t,c),u=this.documentHelper.pages[h].bodyWidgets[0].index,c=!1;this.layoutWholeDocument(),this.fireContentChange()}},c.prototype.onApplySectionFormat=function(e,t){var i;this.restrictFormatting||(je(e)?this.initHistory("SectionFormat"):(i=e[0].toUpperCase()+e.slice(1),this.initHistory(i)),this.updateSectionFormat(e,t))},c.prototype.removeInlineHeaderFooterWidget=function(e,t,i,n){var o,r,s,a;0!=e&&(o=this.documentHelper.headersFooters[e],r=this.viewer.getHeaderFooter(t),s=this.selection.start.paragraph.containerWidget.sectionFormat.cloneFormat(),je(n)||(je(i)||(a=i[0].toUpperCase()+i.slice(1),this.initHistory(a),this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&(this.editorHistory.currentBaseHistoryInfo.insertedFormat=n),a=this.selection.getParagraphInfo(this.selection.start),this.selection.editPosition=this.selection.getHierarchicalIndex(a.paragraph,a.offset.toString()),this.checkInsertPosition(this.selection)&&this.setPositionForHistory(this.selection.editPosition)),n?o&&!je(o[r])&&(s.removedHeaderFooters.push(o[r]),this.editorHistory.currentBaseHistoryInfo.addModifiedPropertiesForSection(s,i,n),delete o[r]):!je(a=this.viewer.getCurrentHeaderFooter(t,e))&&je(o[r])&&(t=a.clone(),o[r]=t,s.removedHeaderFooters.push(t),this.editorHistory.currentBaseHistoryInfo.addModifiedPropertiesForSection(s,i,n)),this.selection.updateTextPositionForBlockContainer(this.selection.start.paragraph.containerWidget),this.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.layoutWholeDocument(),this.isSkipOperationsBuild=!1,this.fireContentChange()))},c.prototype.updateHeaderFooters=function(e,t,i,n){var o=this.documentHelper.headersFooters[i],r=this.viewer.getHeaderFooter(n.headerFooterType),s=o[r];(this.editorHistory.isUndoing||this.editorHistory.isRedoing)&&(je(s)?this.documentHelper.headersFooters[i][r]=n:je(s)||delete o[r]),this.selection.updateTextPositionForBlockContainer(this.selection.start.paragraph.containerWidget),this.layoutWholeDocument()},c.prototype.updateSectionFormat=function(e,t){1===this.documentHelper.selection.startPage&&"differentFirstPage"===e&&(r=void 0,r=this.documentHelper.selection.start.paragraph.containerWidget instanceof Uai?this.getFirstChildOfTable(this.documentHelper.selection.start.paragraph.containerWidget):this.documentHelper.selection.start.paragraph.containerWidget.childWidgets[0],r=this.selection.getHierarchicalIndex(r,"0"),this.documentHelper.selection.select(r,r));for(var i,n,o=this.documentHelper.selection,r=(o.owner.isShiftingEnabled=!0,o.start),s=o.end,a=(o.isForward||(r=o.end,s=o.start),this.documentHelper.clearContent(),r.paragraph.bodyWidget.sectionIndex),l=s.paragraph.bodyWidget.sectionIndex,h=!1,d=!1,p=0;p<this.documentHelper.pages.length;p++){for(var c=0;c<this.documentHelper.pages[p].bodyWidgets.length;c++)if(this.documentHelper.pages[p].bodyWidgets[c].index===a){if(i=p,o.isForward){d=!0;break}}else h=!0;if(d)break}for(p=i;p<this.documentHelper.pages.length;p++)for(c=0;c<this.documentHelper.pages[p].bodyWidgets.length;c++){var u=this.documentHelper.pages[p].bodyWidgets[c];(u.index===a||u.index>=a&&u.index<=l)&&(n=p)}h&&"differentOddAndEvenPages"==e&&r.paragraph.isInHeaderFooter&&(i=0,n=this.documentHelper.pages.length-1);for(var g=!0,m=0,p=i;p<=n;p++)for(var f,c=0;c<this.documentHelper.pages[p].bodyWidgets.length;c++)(this.documentHelper.pages[p].bodyWidgets[c].index>=a&&this.documentHelper.pages[p].bodyWidgets[c].index<=l||!o.isForward&&this.documentHelper.pages[p].bodyWidgets[c].index<=a&&this.documentHelper.pages[p].bodyWidgets[c].index>=l)&&(m!==this.documentHelper.pages[p].bodyWidgets[c].index&&(g=g||!0),this.applyPropertyValueForSection(this.documentHelper.pages[p].bodyWidgets[c].sectionFormat,e,t,g),m=this.documentHelper.pages[p].bodyWidgets[c].index,g=!1,je((f=this.documentHelper.pages[p].bodyWidgets[c]).nextWidget)||f.sectionFormat.pageHeight===f.nextWidget.sectionFormat.pageHeight&&f.sectionFormat.pageWidth===f.nextWidget.sectionFormat.pageWidth||"NoBreak"!==f.nextWidget.sectionFormat.breakCode||(f.nextWidget.sectionFormat.breakCode="NewPage",je((f=this.documentHelper.layout.getBodyWidget(f.nextWidget,!1)).nextWidget))||(f.nextWidget.sectionFormat.breakCode="NewPage"));this.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.layoutWholeDocument(),this.isSkipOperationsBuild=!1,this.fireContentChange()},c.prototype.getFirstChildOfTable=function(e){return e.ownerTable.childWidgets[0].childWidgets[0].childWidgets[0]},c.prototype.onApplyTableFormat=function(e,t,i){var n,o;this.restrictFormatting||(n=this.getTableFormatAction(e),this.viewer.owner.isShiftingEnabled=!0,o=this.documentHelper.selection,i=(i=je(i)?o.start.paragraph.associatedCell.ownerTable:i).combineWidget(this.owner.viewer),o.isEmpty?(this.initHistory(n),this.applyTablePropertyValue(e,t,i)):this.updateSelectionTableFormat(this.selection,n,t),i.calculateGrid(),this.selection.owner.isLayoutEnabled=!0,this.documentHelper.layout.reLayoutTable(i),this.reLayout(o,!1))},c.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";case"title":return"TableTitle";case"description":return"TableDescription";default:return"DefaultCellSpacing"}},c.prototype.onApplyTableRowFormat=function(e,t){var i,n;this.restrictFormatting||(i=this.getRowAction(e),this.documentHelper.owner.isShiftingEnabled=!0,(n=this.documentHelper.selection).isEmpty?(this.initHistory(i),n.start.paragraph.associatedCell.ownerRow.ownerTable,this.applyRowPropertyValue(n,e,t,n.start.paragraph.associatedCell.ownerRow)):this.updateSelectionTableFormat(this.selection,i,t),this.reLayout(n,!1))},c.prototype.getRowAction=function(e){switch(e){case"height":return"RowHeight";case"heightType":return"RowHeightType";case"isHeader":return"RowHeader";default:return"AllowBreakAcrossPages"}},c.prototype.onApplyTableCellFormat=function(e,t){var i,n,o;this.restrictFormatting||(i=this.getTableCellAction(e),this.documentHelper.owner.isShiftingEnabled=!0,o=(o=(n=this.documentHelper.selection).start.paragraph.associatedCell.ownerTable).combineWidget(this.owner.viewer),n.isEmpty?(this.initHistory(i),this.applyCellPropertyValue(n,e,t,n.start.paragraph.associatedCell.cellFormat),o.calculateGrid(),this.selection.owner.isLayoutEnabled=!0,this.documentHelper.layout.reLayoutTable(o)):this.updateSelectionTableFormat(this.selection,i,t),this.reLayout(n,!1))},c.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"}},c.prototype.applyPropertyValueForSection=function(e,t,i,n){n&&this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&("columns"===t&&(e.numberOfColumns=i.length),i=this.editorHistory.currentBaseHistoryInfo.addModifiedPropertiesForSection(e,t,i),this.editorHistory.currentBaseHistoryInfo.insertedFormat=i),je(i)||(i instanceof ari?je(t)&&e.copyFormat(i,this.editorHistory):"pageHeight"===t?e.pageHeight=i:"pageWidth"===t?e.pageWidth=i:"leftMargin"===t?e.leftMargin=i:"rightMargin"===t?e.rightMargin=i:"topMargin"===t?e.topMargin=i:"bottomMargin"===t?e.bottomMargin=i:"differentFirstPage"===t?e.differentFirstPage=i:"differentOddAndEvenPages"===t?e.differentOddAndEvenPages=i:"headerDistance"===t?e.headerDistance=i:"footerDistance"===t?e.footerDistance=i:"pageStartingNumber"===t?e.pageStartingNumber=i:"restartPageNumbering"===t?e.restartPageNumbering=i:"endnoteNumberFormat"===t?e.endnoteNumberFormat=i:"footNoteNumberFormat"===t?e.footNoteNumberFormat=i:"restartIndexForEndnotes"===t?e.restartIndexForEndnotes=i:"restartIndexForFootnotes"===t?e.restartIndexForFootnotes=i:"initialFootNoteNumber"===t?e.initialFootNoteNumber=i:"initialEndNoteNumber"===t?e.initialEndNoteNumber=i:"numberOfColumns"==t?e.numberOfColumns=i:"equalWidth"==t?e.equalWidth=i:"lineBetweenColumns"==t?e.lineBetweenColumns=i:"columns"==t&&(e.columns=i))},c.prototype.layoutWholeDocument=function(e,t){this.documentHelper.layout.isInitialLoad=!0,this.documentHelper.layout.isLayoutWhole=!0;var i=this.documentHelper.selection.start,n=this.documentHelper.selection.end,o=(i.isExistAfter(n)&&(i=this.documentHelper.selection.end.clone(),n=this.documentHelper.selection.start.clone()),"Continuous"==this.owner.layoutType&&(this.documentHelper.selection.isinEndnote||this.documentHelper.selection.isinFootnote)&&(this.documentHelper.selection.footnoteReferenceElement(i,n),i=n),this.selection.getParagraphInfo(i)),r=this.selection.getParagraphInfo(n),o=this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString()),r=this.selection.getHierarchicalIndex(r.paragraph,r.offset.toString()),s=(this.documentHelper.renderedLists.clear(),this.documentHelper.renderedLevelOverrides=[],this.combineSection());t||this.documentHelper.clearContent(),this.documentHelper.layout.layoutItems(s,!0),this.documentHelper.owner.isShiftingEnabled=!1,this.setPositionForCurrentIndex(i,o),this.setPositionForCurrentIndex(n,r),this.documentHelper.selection.selectPosition(i,n),this.reLayout(this.documentHelper.selection,void 0,e),this.documentHelper.layout.isLayoutWhole=!1,this.documentHelper.layout.isInitialLoad=!1},c.prototype.combineSection=function(){var e=[],t=this.documentHelper.pages[0].bodyWidgets[0];for(this.documentHelper.removeEmptyPages(!0);t=this.combineSectionChild(t,e,!1););for(var i=0;i<this.documentHelper.pages.length;i++)this.documentHelper.pages[i].destroy(),i--;return e},c.prototype.combineFollowingSection=function(){for(var e=[],t=this.documentHelper.selection.start.paragraph.bodyWidget.getSplitWidgets()[0],i=(t.childWidgets[0]instanceof Lai?this.updateWholeListItems(t.childWidgets[0]):(i=this.documentHelper.getFirstParagraphInFirstCell(t.childWidgets[0]),this.viewer.owner.editorModule.updateWholeListItems(i)),this.documentHelper.pages.indexOf(t.page)),n=0===t.indexInOwner?i:i+1;t=this.combineSectionChild(t,e,!1););for(var o=n;o<this.documentHelper.pages.length;o++)this.documentHelper.pages[o].destroy(),o--;for(var r=i;r<this.documentHelper.pages.length;r++)for(var s=0;s<this.documentHelper.pages[r].bodyWidgets.length;s++)0===this.documentHelper.pages[r].bodyWidgets[s].childWidgets.length&&(this.documentHelper.pages[r].bodyWidgets.splice(s,1),s--);return e},c.prototype.combineSectionChild=function(e,t,i){var n=e,o=new Sai,r=!1;o.sectionFormat=e.sectionFormat,o.index=n.index;do{r=!1,(n=e).lastChild&&e.lastChild.combineWidget(this.owner.viewer),e=e.nextRenderedWidget;for(var s=0;s<n.childWidgets.length;s++){var a=n.childWidgets[s];a instanceof _ai?this.documentHelper.layout.clearTableWidget(a,!0,!0,!0):(a.x=0,a.y=0,a.width=0,a.height=0),o.childWidgets.push(a),n.childWidgets.splice(s,1),s--,a.containerWidget=o}for(var l=0;l<n.page.bodyWidgets.length;l++){if(0!==n.page.bodyWidgets[l].childWidgets.length){r=!1;break}r=!0}}while(r&&i&&n.page.destroy(),e&&n.index===e.index);return t.push(o),e},c.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);break;case"TableTitle":this.editorHistory.initializeHistory(t),this.updateTableFormat(e,"title",i);break;case"TableDescription":this.editorHistory.initializeHistory(t),this.updateTableFormat(e,"description",i)}},c.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(t,i,n.paragraph.associatedCell.ownerTable),this.editorHistory&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)&&this.documentHelper.layout.reLayoutTable(n.paragraph.associatedCell.ownerTable)},c.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)},c.prototype.updateRowFormat=function(e,t,i){var n=e.start,o=e.end;e.isForward||(n=e.end,o=e.start),this.initHistoryPosition(e,n),this.applyRowFormat(n.paragraph.associatedCell.ownerRow,n,o,t,i)},c.prototype.initHistoryPosition=function(e,t){this.documentHelper.owner.editorHistoryModule&&!je(this.editorHistory.currentBaseHistoryInfo)&&(je(t)?je(this.editorHistory.currentBaseHistoryInfo.insertPosition)&&(this.editorHistory.currentBaseHistoryInfo.insertPosition=e.start.getHierarchicalIndexInternal()):je(this.editorHistory.currentBaseHistoryInfo.insertPosition)&&(this.editorHistory.currentBaseHistoryInfo.insertPosition=t.getHierarchicalIndexInternal()))},c.prototype.startSelectionReLayouting=function(e,t,i,n){if(t.owner.isLayoutEnabled=!0,i.paragraph.isInsideTable){for(var o=i.paragraph.associatedCell.ownerTable;o.isInsideTable;)o=o.associatedCell.ownerTable;this.reLayoutSelectionOfTable(o,t,i,n)}else this.reLayoutSelection(e,t,i,n)},c.prototype.reLayoutSelectionOfTable=function(e,t,i,n){var o=!1;return this.documentHelper.layout.layoutBodyWidgetCollection(e.index,e.containerWidget,e,!1),!(je(n.paragraph.associatedCell)||!e.contains(n.paragraph.associatedCell))||(je(e=t.getNextRenderedBlock(e))?o:this.reLayoutSelectionOfBlock(e,t,i,n))},c.prototype.reLayoutSelection=function(e,t,i,n){var o,r,s,a;return i.paragraph===e?(i.offset,t.getParagraphLength(e),r=(s=e.getInline(i.offset,o=a=0)).element,a=s.index,je(r)||(o=(r=a!==r.length||je(r.nextNode)?r:r.nextNode).line.children.indexOf(r)),s=0,i.currentWidget.paragraph===e&&(s=e.childWidgets.indexOf(i.currentWidget),o=i.currentWidget.children.indexOf(r)),r instanceof pli&&!r.line&&0<o?this.documentHelper.layout.reLayoutParagraph(e,s,o-1):this.documentHelper.layout.reLayoutParagraph(e,s,o)):this.documentHelper.layout.reLayoutParagraph(e,0,0),n.paragraph===e||!je(a=t.getNextRenderedBlock(e))&&this.reLayoutSelectionOfBlock(a,t,i,n)},c.prototype.reLayoutSelectionOfBlock=function(e,t,i,n){if(e instanceof Lai)return this.reLayoutSelection(e,t,i,n)},c.prototype.layoutItemBlock=function(e,t){var i;e.containerWidget instanceof bai||e.containerWidget instanceof Zli?!je(this.documentHelper.owner)&&this.documentHelper.owner.isLayoutEnabled&&(i=(e=e.combineWidget(this.viewer)).containerWidget,this.documentHelper.layout.layoutBodyWidgetCollection(e.index,i,e,!1)):e.containerWidget instanceof Uai&&(i=e.containerWidget,i=this.documentHelper.selection.getContainerCell(i),!je(this.documentHelper.owner))&&this.documentHelper.owner.isLayoutEnabled&&this.documentHelper.layout.reLayoutTable(e)},c.prototype.removeSelectedContents=function(e){return this.removeSelectedContentInternal(e,e.start,e.end)},c.prototype.removeSelectedContentInternal=function(e,t,i){var n,o,r,s=t,a=i;return t.isExistBefore(i)||(s=i,a=t),s.paragraph===a.paragraph&&s.paragraph.childWidgets.indexOf(s.currentWidget)===s.paragraph.childWidgets.length-1&&s.offset===e.getParagraphLength(s.paragraph)&&s.offset+1===a.offset?(e.owner.isShiftingEnabled=!0,e.selectContent(s,!0),!0):(i=this.selection.getParagraphInfo(s),e.editPosition=this.selection.getHierarchicalIndex(i.paragraph,i.offset.toString()),i=(t=s.clone()).paragraph.containerWidget,o=t.currentWidget.isFirstLine(),n=this.checkMultipleSectionSelected(t,a),s=this.removeSelectedContent(a.paragraph,e,s,a),a=new rci(e.owner),n&&"DefaultPaste"==this.selection.currentPasteAction&&o&&t.offset<1&&(n=t.paragraph,o=new Lai,((r=new Gai(o)).paragraph=o).containerWidget=i,o.childWidgets.push(r),i.childWidgets.push(o),o.index=n.index,o.x=t.location.x,o.y=t.location.y),this.setPositionForCurrentIndex(a,e.editPosition),e.selectContent(a,!0),s)},c.prototype.checkMultipleSectionSelected=function(e,t){return this.getBodyWidgetIndex(e)!=this.getBodyWidgetIndex(t)},c.prototype.getBodyWidgetIndex=function(e){var e=e.hierarchicalPosition,t=e.indexOf(";"),t=(e.substring(0,t),(e=e.substring(t).replace(";","")).indexOf(";")),e=e.substring(0,t);return parseInt(e,10)},c.prototype.removeSelectedContent=function(e,t,i,n){return!(n.paragraph.isInsideTable&&n.paragraph!==this.documentHelper.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))},c.prototype.deleteSelectedContent=function(e,t,i,n,o,r){var s,a=n.offset===this.selection.getLineLength(n.currentWidget)+1,l=(i.isAtParagraphStart&&(a||n.isAtParagraphEnd)&&(s=i.currentWidget.getInline(i.offset,0).element,l=n.currentWidget.getInline(n.offset,0).element,s instanceof Pli)&&l instanceof Pli&&s.reference===l&&(i.offset+=1,n.offset-=a?2:1,s=this.selection.getParagraphInfo(i),t.editPosition=this.selection.getHierarchicalIndex(s.paragraph,s.offset.toString()),this.editorHistory)&&this.editorHistory.currentBaseHistoryInfo&&this.editorHistory.currentBaseHistoryInfo.updateSelection(),i.currentWidget.getInline(i.offset,0));l.element,l.index,(l=n.currentWidget.getInline(n.offset,0)).element;l.index,n.paragraph!==e?this.deleteSelectedContent(n.paragraph,t,i,n,o):n.paragraph.isInsideTable&&(!i.paragraph.isInsideTable||i.paragraph.associatedCell&&!i.paragraph.associatedCell.equals(n.paragraph.associatedCell)||t.isCellSelected(n.paragraph.associatedCell,i,n)&&r)?(n.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer),this.deleteTableCell(n.paragraph.associatedCell,t,i,n,o,r)):(a=void 0,this.owner.viewer instanceof nai&&1<e.bodyWidget.sectionFormat.numberOfColumns&&e===e.bodyWidget.lastChild&&!je(e.bodyWidget.nextRenderedWidget)&&e.bodyWidget.index!==e.bodyWidget.nextRenderedWidget.index&&e.bodyWidget.page===e.bodyWidget.nextRenderedWidget.page&&(a=e.nextRenderedWidget),this.deletePara(e,i,n,o),this.delBlockContinue&&this.delBlock&&(this.delSection&&(s=e.bodyWidget instanceof Sai?e.bodyWidget:void 0,this.deleteSection(t,this.delSection,s,o),this.delSection=void 0),this.deleteBlock(this.delBlock,t,i,n,o),this.delBlockContinue=!1,this.delBlock=void 0),this.owner.viewer instanceof nai&&void 0!==a&&(this.documentHelper.blockToShift=a))},c.prototype.mergeCells=function(){this.owner.isReadOnlyMode||!this.canEditContentControl||!this.owner.isDocumentLoaded||je(this.documentHelper)||this.selection.isEmpty||this.mergeSelectedCellsInTable()},c.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 t=this.getOwnerTable(this.selection.isForward).combineWidget(this.owner.viewer),i=(this.selection.selectTable(),[]),e=(this.selection.owner.isShiftingEnabled=!0,this.checkIsNotRedoing()&&(i=this.checkAndRemoveComments(),this.initHistory("DeleteTable"),this.updateHistoryPosition(e,!0)),!0);if(!this.skipTracking()){for(var n=0,o=0;o<t.childWidgets.length;o++){var r=t.childWidgets[o];1===r.rowFormat.revisions.length&&"Insertion"===r.rowFormat.revisions[0].revisionType&&r.rowFormat.revisions[0].author===(""===this.owner.currentUser?"Guest user":this.owner.currentUser)&&(this.isRemoveRevision=!0,this.unlinkRangeFromRevision(r.rowFormat,!0),this.isRemoveRevision=!1,0===r.rowFormat.revisions[0].range.length&&r.rowFormat.revisions.splice(0,1),n++)}n===t.childWidgets.length&&(e=!1)}var s=this.getParagraphForSelection(t);if(this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Table,this.editorHistory.currentBaseHistoryInfo.removedNodes.push(t.clone())),this.owner.enableTrackChanges&&e)for(var a,o=0;o<t.childWidgets.length;o++)0===o&&(a=t.childWidgets[0],s=this.selection.getFirstParagraph(a)),this.trackRowDeletion(t.childWidgets[o]);else this.removeBlock(t);this.selection.selectParagraphInternal(s,!0),(this.checkIsNotRedoing()||je(this.editorHistory))&&(this.reLayout(this.selection),this.updateHistoryForComments(i))}}},c.prototype.deleteColumn=function(){var e;!this.owner.isReadOnlyMode&&this.canEditContentControl&&(this.owner.enableTrackChanges?((e=new Cn("documenteditor",this.owner.defaultLocale)).setLocale(this.owner.locale),this.alertDialog=WC.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"}}),this.alertDialog.enableRtl=this.owner.enableRtl):this.onDeleteColumnConfirmed())},c.prototype.onDeleteColumnConfirmed=function(){var e,t,i,n,o,r=this.selection.isForward?this.selection.start:this.selection.end;this.selection.isForward?this.selection.end:this.selection.start;r.paragraph.isInsideTable&&(r=this.selection.start.clone(),t=this.selection.end.clone(),this.selection.selectColumn(),e=[],this.selection.owner.isShiftingEnabled=!0,this.checkIsNotRedoing()&&(e=this.checkAndRemoveComments(),this.selection.start.setPositionInternal(r),this.selection.end.setPositionInternal(t),this.initHistory("DeleteColumn")),this.selection.start.setPositionInternal(r),this.selection.end.setPositionInternal(t),r=this.getOwnerCell(this.selection.isForward),t=this.getOwnerCell(!this.selection.isForward),i=r.ownerTable.combineWidget(this.owner.viewer),n=void(this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.cloneTableToHistoryInfo(i)),t.nextWidget?(o=t.nextWidget,n=this.selection.getFirstParagraph(o)):r.previousWidget&&(o=r.previousWidget,n=this.selection.getFirstParagraph(o)),je(n)&&(n=this.getParagraphForSelection(i)),o=i.getColumnCellsForSelection(r,t),this.onDeleteColumn(i,o),0===i.childWidgets.length?(n=this.getParagraphForSelection(i),this.removeBlock(i),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.action="DeleteTable"),i.destroy()):this.updateTable(i),this.selection.selectParagraphInternal(n,!0),(je(this.editorHistory)||this.checkIsNotRedoing())&&(this.reLayout(this.selection,!0),this.updateHistoryForComments(e)),je(this.alertDialog)||(this.alertDialog.close(),this.alertDialog=void 0))},c.prototype.onDeleteColumn=function(e,t){for(var i=0,n=0;n<e.childWidgets.length;n++){var o=e.childWidgets[n];if(1===o.childWidgets.length)0<=t.indexOf(o.childWidgets[0])&&(this.removeFieldInWidget(o.childWidgets[0],!0),e.childWidgets.splice(e.childWidgets.indexOf(o),1),o.destroy(),i+=1,n--);else{for(var r=0;r<o.childWidgets.length;r++){var s=o.childWidgets[r];0<=t.indexOf(s)&&(this.removeFieldInWidget(s,!0),o.childWidgets.splice(r,1),s.destroy(),r--)}0===o.childWidgets.length&&(e.childWidgets.splice(e.childWidgets.indexOf(o),1),o.destroy(),i+=1,n--)}}return i},c.prototype.deleteRow=function(){if(!this.owner.isReadOnlyMode&&this.canEditContentControl){var e=this.selection.isForward?this.selection.start:this.selection.end,t=(this.selection.isForward?this.selection.end:this.selection.start,this.selection.getParagraphInfo(e)),t=this.selection.getHierarchicalIndex(t.paragraph,t.offset.toString());if(e.paragraph.isInsideTable){var i=this.getOwnerCell(this.selection.isForward),n=this.getOwnerCell(!this.selection.isForward),o=(this.selection.selectRow(),[]),r=(this.checkIsNotRedoing()&&(o=this.checkAndRemoveComments(),this.initHistory("DeleteRow")),this.selection.owner.isShiftingEnabled=!0,i.ownerTable.combineWidget(this.owner.viewer)),s=this.getOwnerRow(!0),a=(this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.cloneTableToHistoryInfo(r),void 0);if(s.nextWidget&&(l=s.nextWidget.childWidgets[0],a=this.selection.getFirstParagraph(l)),je(a)&&(a=this.getParagraphForSelection(r)),e=e.clone(),this.selection.isEmpty)this.owner.enableTrackChanges?this.trackRowDeletion(s,!0,!1):this.removeRow(s);else{var e=this.selection.getContainerCellOf(i,n);if(e.ownerTable.contains(n))if(i=this.selection.getSelectedCell(i,e),n=this.selection.getSelectedCell(n,e),this.selection.containsCell(e,n))s=i.ownerRow,this.owner.enableTrackChanges?(je(this.editorHistory.currentBaseHistoryInfo)||(this.editorHistory.currentBaseHistoryInfo.action="RemoveRowTrack",this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Row),this.trackRowDeletion(s,!0,!1)):this.removeRow(s);else{var l,s=i.ownerRow,h=n.ownerRow;a=void 0,h.nextWidget&&(l=h.nextWidget.childWidgets[0],a=this.selection.getFirstParagraph(l)),je(a)&&(a=this.getParagraphForSelection(r));for(var d=0;d<r.childWidgets.length;d++){var p=r.childWidgets[d];if(p.rowIndex>=s.rowIndex&&p.rowIndex<=h.rowIndex)if(this.owner.enableTrackChanges&&this.checkIsNotRedoing())this.trackRowDeletion(p,!0,!1);else{this.removeFieldInBlock(p,!0);for(var c=p.previousRenderedWidget;!je(c);){for(var u=0;u<c.childWidgets.length;u++){var g=c.childWidgets[u];p.rowIndex<g.ownerRow.rowIndex+g.cellFormat.rowSpan&&g.cellFormat.rowSpan--}c=c.previousRenderedWidget}for(var m=0;m<p.childWidgets.length;m++){var f,g=p.childWidgets[m],y=p.nextRenderedWidget;je(y)||y.rowIndex<g.ownerRow.rowIndex+g.cellFormat.rowSpan&&(g.cellFormat.rowSpan--,(f=this.createColumn(this.selection.getLastParagraph(g))).cellFormat.copyFormat(g.cellFormat),f.index=g.index,f.rowIndex=g.rowIndex,f.columnIndex=g.columnIndex,f.containerWidget=y,f.margin=g.margin.clone(),f.leftBorderWidth=g.leftBorderWidth,f.rightBorderWidth=g.rightBorderWidth,y.childWidgets.splice(f.columnIndex,0,f)),p.childWidgets.splice(m,1),m--}p.destroy(),d--}}0===r.childWidgets.length?(this.removeBlock(r),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.action="DeleteTable"),r.destroy()):this.updateTable(r)}}!this.owner.enableTrackChanges||je(r.childWidgets)?this.selection.selectParagraphInternal(a,!0):(e=this.selection.getTextPosBasedOnLogicalIndex(t),this.selection.selectContent(e,!0)),(je(this.editorHistory)||this.checkIsNotRedoing())&&(this.reLayout(this.selection,!0),this.updateHistoryForComments(o))}}},c.prototype.trackRowDeletion=function(e,t,i,n){var o=e.rowFormat;if(!je(o)){var r=!0;if(0<o.revisions.length){var s=this.retrieveRevisionInOder(o);if("Insertion"===s.revisionType){if(this.isRevisionMatched(o,void 0))return je(t)||t?this.removeRow(e):this.removeRevisionsInRow(e),!0}else"Deletion"===s.revisionType&&(this.unlinkWholeRangeInRevision(o,s),r=!(!this.owner.enableTrackChanges||this.skipTracking()))}r&&((je(i)||i)&&this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.action="RemoveRowTrack"),this.insertRevision(o,"Deletion"));for(var a=0;a<e.childWidgets.length;a++)for(var l,h=e.childWidgets[a],d=0;d<h.childWidgets.length;d++)h.childWidgets[d]instanceof _ai?this.trackInnerTable(h.childWidgets[d],t,i):(l=h.childWidgets[d],this.skipTableElements=!0,r&&!this.skipTracking()&&0!==n&&this.insertRevisionForBlock(l,"Deletion",void 0,void 0,!0,void 0,!0)&&d--,this.skipTableElements=!1)}return!1},c.prototype.trackInnerTable=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++)this.trackRowDeletion(e.childWidgets[n],t,i)},c.prototype.returnDeleteRevision=function(e){for(var t=0;t<e.length;t++)if("Deletion"===e[t].revisionType)return e[t]},c.prototype.removeRow=function(e){var t=e.ownerTable;0<e.rowFormat.revisions.length&&this.removeRevisionsInRow(e),1===t.childWidgets.length?(this.removeBlock(t),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.action="Delete"),t.destroy()):(this.removeFieldInBlock(e,!0),t.childWidgets.splice(t.childWidgets.indexOf(e),1),e.destroy(),this.updateTable(t))},c.prototype.updateTable=function(e,t){(e=t?e:e.combineWidget(this.viewer)).updateRowIndex(0),e.isGridUpdated=!1,e.buildTableColumns(),e.isGridUpdated=!0,this.documentHelper.layout.reLayoutTable(e)},c.prototype.getParagraphForSelection=function(e){var t=void 0,i=e.nextWidget||e.nextRenderedWidget,e=e.previousWidget||e.previousRenderedWidget;return i?t=i instanceof Lai?i:this.documentHelper.getFirstParagraphInFirstCell(i):e&&(t=e instanceof Lai?e:this.documentHelper.getLastParagraphInLastCell(e)),t},c.prototype.deletePara=function(e,t,i,n){e=e.combineWidget(this.owner.viewer);var o=this.documentHelper.selection,r=o.getStartOffset(e),s=o.getStartOffset(i.paragraph),a=r,l=0,h=!1,d=this.selection.getLineLength(e.lastChild),p=e,c=e.bodyWidget instanceof Sai?e.bodyWidget:void 0,u=void 0,g=void 0,m=this.combineLastBlock,f=!1,y=(e.isInsideTable&&t.paragraph.isInsideTable&&(f=t.paragraph!==e),e===t.paragraph?(a=t.offset,u=t.currentWidget,(v=a)+1===this.documentHelper.selection.getLineLength(e.lastChild)&&je(e.nextWidget)&&a++,h=(h=!i.paragraph.isInsideTable||this.owner.enableTrackChanges&&!this.skipTracking()?h:this.isEndInAdjacentTable(e,i.paragraph))||this.combineLastBlock,this.combineLastBlock=!1):u=e.firstChild,e!==t.paragraph&&o.isSkipLayouting&&(o.isSkipLayouting=!1),l=e===i.paragraph?(g=i.currentWidget,i.offset):(g=e.lastChild,this.documentHelper.selection.getLineLength(e.lastChild)),je(e.previousRenderedWidget)||t.paragraph===e?void 0:e.previousRenderedWidget.combineWidget(this.documentHelper.viewer));if(this.owner.enableTrackChanges&&!je(y)&&y instanceof _ai&&e.isEmpty()&&je(e.nextRenderedWidget))this.delBlockContinue=!0,this.delBlock=y;else{!(r<a&&t.currentWidget===e.lastChild&&a===d&&(e===i.paragraph&&i.offset===a+1||e.nextRenderedWidget===i.paragraph&&i.offset===s)||this.editorHistory&&this.editorHistory.isUndoing&&this.editorHistory.currentHistoryInfo&&"PageBreak"===this.editorHistory.currentHistoryInfo.action&&y&&y.isPageBreak()&&(0===a&&!t.currentWidget.isFirstLine||0<a)||t.paragraph!==i.paragraph&&2===n&&t.paragraph===e&&t.paragraph.nextWidget===i.paragraph&&!this.owner.enableTrackChanges)&&(e.nextRenderedWidget instanceof _ai||je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||!("Reject Change"===this.editorHistory.currentBaseHistoryInfo.action&&t.paragraph===e&&i.paragraph!=e&&r<=a||("Accept Change"===this.editorHistory.currentBaseHistoryInfo.action||"Accept"===this.editorHistory.currentBaseHistoryInfo.isAcceptOrReject&&this.editorHistory.isRedoing)&&t.currentWidget.isLastLine()&&(t.currentWidget==i.currentWidget&&t.offset+1>=i.paragraph.getLength()||t.currentWidget!==i.currentWidget&&t.paragraph===e)))||(h=!0),v+1===this.documentHelper.selection.getLineLength(e.lastChild)&&je(e.nextWidget)&&a--;var s=i.clone(),v=(s.offset=s.offset-1,!1),s=(!this.editorHistory||je(this.editorHistory.currentBaseHistoryInfo)||"Insert"!==this.editorHistory.currentBaseHistoryInfo.action&&"InsertTextParaReplace"!==this.editorHistory.currentBaseHistoryInfo.action||i.paragraph!==e||l!==o.getLineLength(e.lastChild)+1||(v=!0),t.paragraph===e&&t.isAtParagraphStart&&s.isAtParagraphEnd&&this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&"Insert"===this.editorHistory.currentBaseHistoryInfo.action),b=(s&&(this.editorHistory.currentBaseHistoryInfo.action="InsertTextParaReplace",i.paragraph!==e)&&this.owner.enableTrackChanges&&2===n&&(s=!1),t.paragraph===e);if(i.paragraph===e&&i.currentWidget!==e.lastChild||i.currentWidget===e.lastChild&&i.offset<=o.getLineLength(e.lastChild)||s)(i.currentWidget.isFirstLine()&&i.offset>r||!i.currentWidget.isFirstLine()||s)&&this.removeInlines(e,u,a,g,l,n),je(y)||b||s?(this.delBlockContinue=!1,this.delBlock=void 0):(this.delBlockContinue=!0,(A=(this.delBlock=y).bodyWidget instanceof Sai?y.bodyWidget:void 0)&&!c.equals(A)&&c.index!==A.index?this.delSection=A:this.delSection=void 0);else{if(t.paragraph===e&&(t.currentWidget!==e.firstChild||t.currentWidget===e.firstChild&&r<a))return this.delBlockContinue=!1,this.delBlock=void 0,4===n?void 0:void(this.skipTracking()&&"ParaMarkTrack"===this.editorHistory.currentBaseHistoryInfo.action?(this.addRemovedNodes(e.characterFormat.cloneFormat()),0<e.characterFormat.revisions.length&&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,a,!0,void 0,f),this.deleteParagraphMark(p,o,n,!0),this.addRemovedNodes(e)):(t.currentWidget===e.lastChild&&a===d+1&&a--,t.paragraph!==i.paragraph&&a!==e.getLength()?((w=new Lai).childWidgets=void 0,this.addRemovedNodes(w),this.handleDeleteParaMark(e,void 0)):(x=e==this.getLastParaForBodywidgetCollection(e))||this.handleDeleteParaMark(e,void 0),this.removeInlines(e,u,a,g,l,n),a!==d?(0<(w=e.lastChild).children.length&&(d=w.children[w.children.length-1],this.combineElementRevision(d.revisions,e.characterFormat.revisions)),e.isEmpty()?this.combineRevisionWithBlocks(e):this.combineRevisionWithBlocks(e.lastChild.children[e.lastChild.children.length-1])):this.combineRevisionWithValidElement(e)):t.currentWidget.isFirstLine()||e.lastChild!==i.currentWidget||h?(!je(this.editorHistory)&&!je(this.editorHistory.currentBaseHistoryInfo)&&"Reject Change"===this.editorHistory.currentBaseHistoryInfo.action&&t.paragraph===e&&i.paragraph!=e&&r<=a&&h&&(m=!0),je(p=this.splitParagraph(e,e.firstChild,0,u,a,!0,!0,f))||je(this.editorHistory)||!this.editorHistory.isUndoing&&!this.editorHistory.isRedoing||this.deletaRevisionIDs(p.characterFormat),w=!1,i.paragraph.isEmpty()||!h||this.editorHistory&&this.editorHistory.currentHistoryInfo&&"PageBreak"===this.editorHistory.currentHistoryInfo.action||(w=!0),this.insertParagraphPaste(e,p,t,i,h,n,m,w),this.removeRevisionForBlock(e,void 0,!1,!0),!je(this.owner.editorHistory)&&!je(this.owner.editorHistory.currentBaseHistoryInfo)&&"Paste"===this.owner.editorHistory.currentBaseHistoryInfo.action&&0<this.owner.editorHistory.historyInfoStack.length&&"DragAndDropContent"===this.owner.editorHistory.historyInfoStack[0].action?(this.addRemovedNodes(e.clone()),this.removeFieldInBlock(e),this.removeFieldInBlock(e,!0),this.removeFieldInBlock(e,void 0,!0),this.removeCommentsInBlock(e)):this.addRemovedNodes(e),m=!1):this.removeInlines(e,u,a,g,l,n));(!this.owner.enableTrackChanges||this.skipTracking())&&i.paragraph===e&&i.paragraph.isInsideTable&&(t.currentWidget.isFirstLine()&&t.offset>o.getStartOffset(t.paragraph)||!t.currentWidget.isFirstLine())&&i.offset>=o.getLineLength(i.paragraph.lastChild)&&i.paragraph.nextRenderedWidget&&(this.combineLastBlock=!0);var d=void 0,r=e.previousWidget,w=r instanceof Lai?r:void 0,u=e.nextRenderedWidget;if(n<4){var C,a=!1;if(e==this.getLastParaForBodywidgetCollection(e)&&e===t.paragraph&&!e.isInsideTable&&!je(e.containerWidget)&&je(e.containerWidget.containerWidget)&&this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&"Delete"!==this.editorHistory.currentBaseHistoryInfo.action&&"Enter"!==this.editorHistory.currentBaseHistoryInfo.action&&(a=!0),this.owner.enableTrackChanges&&!this.skipTracking()&&this.editorHistory.currentBaseHistoryInfo&&"TOC"!==this.editorHistory.currentBaseHistoryInfo.action){var S;this.editorHistory.currentBaseHistoryInfo&&this.editorHistory.currentBaseHistoryInfo.removedNodes.length,this.insertRevisionForBlock(e,"Deletion",void 0,void 0,void 0,v,void 0),e.characterFormat.revisions;if(e.isEmpty()?this.combineRevisionWithBlocks(e):this.combineRevisionWithBlocks(e.firstChild.children[0]),"Delete"!==this.editorHistory.currentBaseHistoryInfo.action||this.isInsertingTOC||((e===i.paragraph&&e.containerWidget&&!e.isEmpty()||je(t.paragraph.containerWidget)&&!je(i.paragraph.containerWidget)&&!i.paragraph.isEmpty())&&(S=this.selection.getParagraphInfo(i),this.selection.editPosition=this.selection.getHierarchicalIndex(S.paragraph,S.offset.toString())),e===t.paragraph&&je(this.selection.getParagraph({index:this.selection.editPosition}).paragraph)&&(S=this.selection.getParagraphInfo(i),this.selection.editPosition=this.selection.getHierarchicalIndex(S.paragraph,S.offset.toString()))),t.paragraph!==e&&!je(y))return this.delBlockContinue=!0,void(this.delBlock=y)}else{d=this.checkAndInsertBlock(e,t,i,n,w),this.removeRevisionForBlock(e,void 0,!1,!0);var A,x=e==this.getLastParaForBodywidgetCollection(e),g=(je(d)&&x||(a=!1),!1);if((this.owner.enableTrackChanges||a)&&(x||v)){for(var I=e.childWidgets.length-1;-1<I;I--){var T=e.childWidgets[I];this.removeContent(T,0,this.documentHelper.selection.getLineLength(T),void 0,!1)}g=!0}else{l=this.selection.getNextParagraphBlock(e);x||e.isInsideTable||je(l)||e.bodyWidget.sectionIndex===l.bodyWidget.sectionIndex||(this.deleteSection(o,e.bodyWidget,l.bodyWidget,n),b=!0),this.addRemovedNodes(e.clone())}je(y)||b||s||(A=(this.delBlock=y).bodyWidget instanceof Sai?y.bodyWidget:void 0)&&c.index!==A.index&&(r=e.bodyWidget instanceof Sai?e.bodyWidget:void 0,this.deleteSection(o,A,r,n)),g||this.removeBlock(e,void 0,void 0,f)}this.documentHelper.blockToShift===e&&(this.documentHelper.blockToShift=void 0),je(d)?e!==t.paragraph||!je(u)&&(je(u)||je(u.bodyWidget)||je(c)||c.index===u.bodyWidget.index)||je(w)||(C=void 0,a?(C=this.selection.getStartOffset(e),o.editPosition=this.selection.getHierarchicalIndex(e,C.toString())):(C=this.selection.getParagraphLength(w),o.editPosition=this.selection.getHierarchicalIndex(w,C.toString())),this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&(this.updateHistoryPosition(o.editPosition,!0),this.editorHistory.currentBaseHistoryInfo.endPosition=o.editPosition)):(o.editPosition=this.selection.getHierarchicalIndex(d,"0"),C=o.getParagraphLength(d)+1,this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&(this.editorHistory.currentBaseHistoryInfo.endPosition=this.selection.getHierarchicalIndex(d,C.toString())))}t.paragraph===e||je(y)?(this.delBlockContinue=!1,this.delBlock=void 0):(this.delBlockContinue=!0,this.delBlock=y)}this.insertParagraphPaste(e,p,t,i,h,n,m)}},c.prototype.deletaRevisionIDs=function(e){if(0<e.removedIds.length)for(;0<e.removedIds.length;)e.removedIds.splice(0,1)},c.prototype.deleteSection=function(e,t,i,n){var o,r,s,a;n<4&&(this.owner.enableCollaborativeEditing&&(s=r=void 0,je(a=this.owner.documentHelper.headersFooters[t.sectionIndex][0])||(r={paragraph:a.firstChild,offset:0},s=this.owner.selectionModule.getPositionInfoForHeaderFooter(r,{position:0,done:!1}),this.editorHistory.currentBaseHistoryInfo.headerFooterStart=s.position),0<(o=Object.keys(this.owner.documentHelper.headersFooters[t.sectionIndex]).length))&&(je(a=this.owner.documentHelper.headersFooters[t.sectionIndex][(o-1).toString()])||(o=this.owner.selectionModule.getParagraphLength(a.lastChild),r={paragraph:a.lastChild,offset:o+1},s=this.owner.selectionModule.getPositionInfoForHeaderFooter(r,{position:0,done:!1}),this.editorHistory.currentBaseHistoryInfo.headerFooterEnd=s.position)),this.combineSectionInternal(e,t,i)),2<n&&t.sectionFormat.copyFormat(i.sectionFormat)},c.prototype.combineSectionInternal=function(e,t,i){var n=t.getSplitWidgets()[0],o=[],r=n.y,o=(this.combineSectionChild(n,o,!0),(n=o[0]).lastChild.index),s=(this.updateBlockIndex(o+1,i.firstChild),0),a=i;a.y=r;for(var l=0;l<n.childWidgets.length;l++){var h=n.childWidgets.splice(l,1)[0];a.childWidgets.splice(s,0,h),h.containerWidget=a,this.documentHelper.layout.layoutBodyWidgetCollection(h.index,h.bodyWidget,h,!1),a=(h=h.getSplitWidgets().pop()).containerWidget,s=h.indexInOwner+1,l--}if(0<n.sectionIndex&&this.documentHelper.headersFooters[n.sectionIndex]){n.removedHeaderFooters=[];for(var d=this.documentHelper.headersFooters.splice(n.sectionIndex,1)[0],p=Object.keys(d),l=0;l<p.length;l++){var c=d[p[l]];this.removeFieldInWidget(c),this.removeFieldInWidget(c,!1,!0),c.page=void 0}n.removedHeaderFooters.push(d)}this.updateSectionIndex(void 0,i,!1),this.addRemovedNodes(n),this.documentHelper.removeEmptyPages(),!this.editorHistory||!this.editorHistory.isUndoing||this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.endRevisionLogicalIndex||this.editorHistory.currentBaseHistoryInfo.lastElementRevision)||(i.sectionFormat=t.sectionFormat);for(var u=i.page;this.documentHelper.layout.layoutHeaderFooter(u.bodyWidgets[0],this.viewer,u),u=u.nextPage;);},c.prototype.checkAndInsertBlock=function(e,t,i,n,o){if(e instanceof Lai&&e===t.paragraph||e instanceof _ai){var r=void 0;if(je(e.nextRenderedWidget)&&(je(o)||o.nextRenderedWidget instanceof _ai)){if(r=new Lai,1===n&&e instanceof Lai&&!je(e.paragraphFormat.baseStyle)&&"Normal"===e.paragraphFormat.baseStyle.name){if(r.characterFormat.copyFormat(e.characterFormat),je(e.previousRenderedWidget)&&0!==r.characterFormat.removedIds.length)for(;0<r.characterFormat.removedIds.length;)r.characterFormat.removedIds.splice(0,1);r.paragraphFormat.copyFormat(e.paragraphFormat)}r.index=e.index+1,r.containerWidget=e.containerWidget,e instanceof Lai&&(r.paragraphFormat.lineSpacing=e.paragraphFormat.lineSpacing,r.paragraphFormat.lineSpacingType=e.paragraphFormat.lineSpacingType,je(t=this.documentHelper.styles.findByName("Normal"))||(r.paragraphFormat.baseStyle=new _ri,r.paragraphFormat.baseStyle.copyStyle(t))),this.documentHelper.layout.layoutBodyWidgetCollection(r.index,r.bodyWidget,r,!1),e.containerWidget instanceof fai&&e.containerWidget.childWidgets.push(r)}return r}},c.prototype.splitParagraph=function(e,t,i,n,o,r,s,a){var l=new Lai,h=(l.paragraphFormat=new bri(l),l.characterFormat=new Eri(l),l.paragraphFormat.copyFormat(e.paragraphFormat),l.characterFormat.copyFormat(e.characterFormat),l.characterFormat.removedIds=[],new Gai(l)),h=(l.childWidgets.push(h),e.index),d=e.indexInOwner;if(this.moveInlines(e,l,0,i,t,o,n,r),e.containerWidget.childWidgets[d]){for(var p=[],c=e.containerWidget.childWidgets[d],u=0;u<c.childWidgets.length;u++)for(var g=c.childWidgets[u],m=0;m<g.children.length;m++){var f=g.children[m];f instanceof fli?this.removeFootnote(f):f instanceof Dli&&r&&(!this.owner.enableTrackChanges||this.owner.enableTrackChanges&&this.skipTracking())&&(this.editorHistory&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)||f instanceof Dli&&p.push(f),f instanceof Dli)&&this.documentHelper.bookmarks.containsKey(f.name)&&(this.owner.enableCollaborativeEditing&&!je(this.editorHistory.currentBaseHistoryInfo)&&this.editorHistory.currentBaseHistoryInfo.markerData.push({bookmarkName:f.name}),this.documentHelper.bookmarks.remove(f.name))}for(u=p.length-1;0<=u;u--)this.removedBookmarkElements.push(p[u])}return e.containerWidget.childWidgets.splice(d,0,l),l.index=h,l.containerWidget=e.containerWidget,this.updateNextBlocksIndex(l,!0),r&&this.removeBlock(e,void 0,s,a),this.documentHelper.layout.layoutBodyWidgetCollection(h,l.containerWidget,l,!1),l},c.prototype.removeCommentsInBlock=function(e){if(e instanceof _ai)for(var t=0;t<e.childWidgets.length;t++)for(var i=e.childWidgets[t],n=0;n<i.childWidgets.length;n++)for(var o=i.childWidgets[n],r=0;r<o.childWidgets.length;r++){var s=o.childWidgets[r];this.removeCommentsInBlock(s)}else this.removeCommentInPara(e)},c.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])},c.prototype.removeCommentsInline=function(e){e instanceof Khi&&1!==e.commentType&&e.removeCommentMark()},c.prototype.removeBlock=function(e,t,i,n){var o,r;i||(this.removeFieldInBlock(e),this.removeFieldInBlock(e,!0),this.removeFieldInBlock(e,void 0,!0),this.removeFieldInBlock(e,void 0,void 0,!0),this.removeCommentsInBlock(e)),e.isInsideTable?(r=e.associatedCell,o=e.associatedCell.childWidgets.indexOf(e),e.associatedCell.childWidgets,this.updateNextBlocksIndex(e,!1),e.associatedCell.childWidgets.splice(o,1),e.containerWidget=void 0,this.documentHelper.layout.layoutBodyWidgetCollection(e.index,r,e,!1,void 0,n)):(r=e.containerWidget,this.checkAndRemoveRevisionFromBlock(e,!0),o=r.childWidgets.indexOf(e),r.childWidgets,this.updateNextBlocksIndex(e,!1),r.childWidgets.splice(o,1),e.containerWidget=void 0,r.height-=e.height,!je(r.containerWidget)&&r.containerWidget instanceof Pai&&(r.containerWidget.height-=e.height),this.documentHelper.layout.layoutBodyWidgetCollection(e.index,r,e,!1,t,n))},c.prototype.checkAndRemoveRevisionFromBlock=function(e,t){for(var i=0;i<e.childWidgets.length;i++){var n=void 0;if(this.isPasteRevertAction()||(n=this.skipTracking()),e.childWidgets[i]instanceof jai&&!n&&(n=e.childWidgets[i],this.removeDeletedCellRevision(n,t)),e.childWidgets[i]instanceof Gai)for(var o=e.childWidgets[i],r=0;r<o.children.length;r++){var s=o.children[r];s instanceof fli&&!this.selection.isEmpty&&this.removeFootnote(s)}}},c.prototype.removePrevParaMarkRevision=function(e,t,i){var n,o,r;t=!je(t)&&t,(this.owner.enableTrackChanges||0!=e.characterFormat.revisions.length)&&(n=-1,o=void 0,r=e,0<=(n=0<(r=t||je(r.previousRenderedWidget)?r:r.previousRenderedWidget).characterFormat.revisions.length?(o=r.characterFormat.revisions[r.characterFormat.revisions.length-1]).range.indexOf(r.characterFormat):n))&&!je(o)&&o.range[n]instanceof Eri&&(o.range.splice(n,1),this.owner.trackChangesPane.updateCurrentTrackChanges(o),r.characterFormat&&-1<r.characterFormat.revisions.indexOf(o)&&(i&&e.characterFormat.removedIds.push(o.revisionID),r.characterFormat.revisions.splice(r.characterFormat.revisions.indexOf(o),1)),0==o.range.length)&&this.owner.revisionsInternal.remove(o)},c.prototype.isPasteRevertAction=function(){return!(je(this.editorHistory)||!this.editorHistory.currentBaseHistoryInfo||"Paste"!==this.editorHistory.currentBaseHistoryInfo.action)},c.prototype.toCheckForTrack=function(e){if(this.owner.enableTrackChanges&&!this.skipTracking()&&e instanceof _ai&&0<e.childWidgets.length){e=e.childWidgets[0].rowFormat;if(0<e.revisions.length&&"Insertion"!==e.revisions[0].revisionType&&e.revisions[0].author===(""===this.owner.currentUser?"Guest user":this.owner.currentUser)||0===e.revisions.length)return!0}return!1},c.prototype.removeFootnote=function(e,t){if(e.paragraph.bodyWidget.page.footnoteWidget){for(var i=e.paragraph.bodyWidget.page.footnoteWidget,n=0;n<i.bodyWidgets.length;n++)if(e===i.bodyWidgets[n].footNoteReference){if(i.height-=i.bodyWidgets[n].childWidgets[0].height,this.owner.enableTrackChanges)for(var o=0;o<i.bodyWidgets[n].childWidgets.length;o++)this.removeRevisionForBlock(i.bodyWidgets[n].childWidgets[o],void 0,!1,!0);i.bodyWidgets.splice(n,1),n--,this.isFootnoteElementRemoved=!0}0===i.bodyWidgets.length&&(e.paragraph.bodyWidget.page.footnoteWidget=void 0)}this.documentHelper.footnoteCollection.splice(this.documentHelper.footnoteCollection.indexOf(e),1),this.updateFootNoteIndex()},c.prototype.removeEndnote=function(e,t){var i=this.documentHelper.pages.length,i=this.documentHelper.pages[i-1].bodyWidgets[0];if(i.page.endnoteWidget){for(var n=i.page.endnoteWidget,o=0;o<n.bodyWidgets.length;o++)if(e===n.bodyWidgets[o].footNoteReference){if(n.height-=n.bodyWidgets[o].childWidgets[0].height,this.owner.enableTrackChanges)for(var r=0;r<n.bodyWidgets[o].childWidgets.length;r++)this.removeRevisionForBlock(n.bodyWidgets[o].childWidgets[r],void 0,!1,!0);n.bodyWidgets.splice(o,1),this.isEndnoteElementRemoved=!0,o--}0===n.bodyWidgets.length&&(i.page.endnoteWidget=void 0)}this.documentHelper.endnoteCollection.splice(this.documentHelper.endnoteCollection.indexOf(e),1),this.updateEndNoteIndex()},c.prototype.removeAutoShape=function(e){var t=e.line.paragraph.floatingElements.indexOf(e),i=e.line.paragraph.bodyWidget.floatingElements.indexOf(e);-1<i&&e.line.paragraph.bodyWidget.floatingElements.splice(i,1),e.line.paragraph.floatingElements.splice(t,1)},c.prototype.removeField=function(e,t,i,n){if(n)for(var o=this.documentHelper.editRanges.keys,r=0;r<o.length;r++){for(var s=this.documentHelper.editRanges.get(o[r]),a=0;a<s.length;a++)(m=s[a]).line.paragraph===e&&(s.splice(a,1),a--);0===s.length&&(this.documentHelper.editRanges.remove(o[r]),r--)}else{var l=this.documentHelper.fields;if(t?l=this.documentHelper.bookmarks.keys:i&&(l=this.documentHelper.contentControlCollection),0<e.floatingElements.length)for(var h=0;h<e.floatingElements.length;h++){var d=e.floatingElements[h];if(d instanceof Xli&&d.textFrame&&0<d.textFrame.childWidgets.length)for(r=0;r<d.textFrame.childWidgets.length;r++){var p=d.textFrame.childWidgets[r];this.removeFieldInBlock(p,t,i)}this.removeAutoShape(d),h--}for(var c,u,r=0;r<l.length;r++)((m=t?this.documentHelper.bookmarks.get(l[r]):l[r]).line.paragraph===e||m instanceof Dli&&!je(m.reference)&&m.reference.line.paragraph===e)&&(t?(this.documentHelper.bookmarks.remove(l[r]),m.line.children.splice(m.indexInOwner,1),je(m.line.paragraph.associatedCell)||((u=m.line.paragraph.associatedCell).isRenderBookmarkStart?u.isRenderBookmarkStart=!1:u.isRenderBookmarkEnd=!1),(c=m.reference)&&c.line.children.splice(c.indexInOwner,1),c&&!je(c.line.paragraph.associatedCell)&&((u=c.line.paragraph.associatedCell).isRenderBookmarkStart?u.isRenderBookmarkStart=!1:u.isRenderBookmarkEnd=!1)):i?this.documentHelper.contentControlCollection.splice(r,1):(this.documentHelper.fields.splice(r,1),-1!==this.documentHelper.formFields.indexOf(m)&&this.documentHelper.formFields.splice(this.documentHelper.formFields.indexOf(m),1)),r--)}if(0<this.documentHelper.footnoteCollection.length)for(r=0;r<this.documentHelper.footnoteCollection.length;r++)if((m=this.documentHelper.footnoteCollection[r]).line.paragraph===e){if(m.paragraph.bodyWidget.page.footnoteWidget){for(var g=m.paragraph.bodyWidget.page.footnoteWidget,a=0;a<g.bodyWidgets.length;a++)m===g.bodyWidgets[a].footNoteReference&&(g.height-=g.bodyWidgets[a].height,g.bodyWidgets.splice(a,1),a--);0===g.bodyWidgets.length&&(m.paragraph.bodyWidget.page.footnoteWidget=void 0)}this.documentHelper.footnoteCollection.splice(r,1),r--}if(0<this.documentHelper.endnoteCollection.length)for(var m,r=0;r<this.documentHelper.endnoteCollection.length;r++)if((m=this.documentHelper.endnoteCollection[r]).line.paragraph===e){if(m.paragraph.bodyWidget.page.endnoteWidget){for(var f=m.paragraph.bodyWidget.page.endnoteWidget,a=0;a<f.bodyWidgets.length;a++)m===f.bodyWidgets[a].footNoteReference&&(f.height-=f.bodyWidgets[a].height,f.bodyWidgets.splice(a,1),a--);0===f.bodyWidgets.length&&(m.paragraph.bodyWidget.page.endnoteWidget=void 0)}this.documentHelper.endnoteCollection.splice(r,1),r--}},c.prototype.getTabsInSelection=function(){var e=[],t=this.owner.selectionModule,i=[];if(0===t.selectedWidgets.keys.length)return t.start.paragraph.paragraphFormat.getUpdatedTabs();if(t.start.paragraph===t.end.paragraph)return t.start.paragraph.paragraphFormat.getUpdatedTabs();for(var t=0<(i=t.start.paragraph!==t.end.paragraph?this.owner.selectionModule.getParagraphsInSelection():i).length?i[0]:void 0,n=je(t)?[]:t.paragraphFormat.getUpdatedTabs(),o=!0,r=0;r<n.length;r++)e.push(n[r]);for(var s=1;s<i.length;s++){for(var a=i[s].paragraphFormat.getUpdatedTabs(),l=[],o=!0,h=0;h<e.length;h++){for(r=0;r<a.length;r++)if(a[r].equals(e[h])){o=!1;break}o&&l.push(e[h])}for(h=0;h<l.length;h++)e.splice(e.indexOf(l[h]),1)}return e},c.prototype.updateTabStopCollection=function(e,t,i){var n=e.paragraphFormat.tabs;if(i){e.paragraphFormat.tabs=[];for(var o=0;o<t.length;o++)e.paragraphFormat.tabs.push(t[o])}else for(o=0;o<t.length;o++){for(var r=t[o],s=-1,a=0;a<n.length;a++){var l=n[a];if(r.position===l.position){s=a;break}if(r.position<l.position)break}0<=s?this.modifyTabStop(n[s],r):this.addTabStopToCollection(n,r)}},c.prototype.modifyTabStop=function(e,t){e.deletePosition=t.deletePosition,e.tabJustification=t.tabJustification,e.tabLeader=t.tabLeader},c.prototype.removeTabStops=function(e,t){for(var i=0;i<e.length;i++)for(var n=e[i].paragraphFormat.tabs,o=0;o<t.length;o++)for(var r=t[o],s=0;s<n.length;s++)if(n[s].equals(r)){n.splice(s,1);break}},c.prototype.addTabStopToCollection=function(e,t,i){for(var n=-1,o=0;o<e.length;o++)if(e[o].position>t.position){n=o;break}return n=-1===n?e.length:n,i||e.splice(n,0,t.clone()),n},c.prototype.addRemovedNodes=function(e,t){e instanceof Khi&&0===e.commentType&&e.commentMark&&e.removeCommentMark(),e instanceof Pli&&(0===e.type?this.documentHelper.contentControlCollection.splice(this.documentHelper.contentControlCollection.indexOf(e),1):this.updatePropertiesToBlock(e.reference)),e instanceof Zai&&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&&!je(this.editorHistory.currentBaseHistoryInfo)?t?this.editorHistory.currentBaseHistoryInfo.removedNodes.splice(0,0,e):this.editorHistory.currentBaseHistoryInfo.removedNodes.push(e):this.editHyperlinkInternal&&this.nodes.push(e)},c.prototype.deleteBlock=function(e,t,i,n,o){var r;e instanceof Lai?(this.deletePara(e,i,n,o),this.delBlockContinue&&this.delBlock&&(this.delSection&&(r=e.bodyWidget instanceof Sai?e.bodyWidget:void 0,this.deleteSection(t,this.delSection,r,o),this.delSection=void 0),-1!==this.delBlock.indexInOwner&&this.deleteBlock(this.delBlock,t,i,n,o),this.delBlockContinue=!1,this.delBlock=void 0)):(this.deleteTableBlock(e,t,i,n,o),je(e.childWidgets)||!this.owner.enableTrackChanges||this.skipTracking()||this.documentHelper.layout.reLayoutTable(e))},c.prototype.deleteTableCell=function(e,t,i,n,o,r){var s,a,l=!(i.paragraph.isInsideTable&&e.ownerTable.contains(i.paragraph.associatedCell)),h=e.ownerTable.previousRenderedWidget;i.paragraph.isInsideTable?(s=t.getContainerCellOf(e,i.paragraph.associatedCell)).ownerTable.contains(i.paragraph.associatedCell)?(a=t.getSelectedCell(e,s),t.getSelectedCell(i.paragraph.associatedCell,s),t.containsCell(s,i.paragraph.associatedCell)?t.isCellSelected(s,i,n)?(this.updateEditPosition(s,t),1===o||r?this.deleteCellsInTable(e.ownerRow.ownerTable,t,i,n,o):!(r=this.deleteCell(s,t,o,!0))&&2!==o&&this.editorHistory?this.editorHistory.currentBaseHistoryInfo=void 0:r&&this.documentHelper.layout.reLayoutTable(s.ownerRow.ownerTable)):a===s?(this.deletePara(n.paragraph,i,n,o),this.delBlockContinue&&this.delBlock&&(this.delSection&&(r=(r=n.paragraph).bodyWidget instanceof Sai?r.bodyWidget:void 0,this.deleteSection(t,this.delSection,r,o),this.delSection=void 0),this.deleteBlock(this.delBlock,t,i,n,o),this.delBlockContinue=!1,this.delBlock=void 0)):this.deleteContainer(a,t,i,n,o):2===o?this.deleteCell(e,t,2,!1):(l=!1,this.deleteCellsInTable(s.ownerTable,t,i,n,o))):this.deleteContainer(s,t,i,n,o):(r=t.getContainerCell(e),je(this.editorHistory)||!this.editorHistory.isUndoing&&!this.editorHistory.isRedoing?this.deleteContainer(r,t,i,n,o):(this.deleteTableBlock(r.ownerTable,t,i,n,o),l=!1)),l&&(h.bodyWidget instanceof Sai&&h.bodyWidget,je(h)||this.deleteBlock(h,t,i,n,o))},c.prototype.deleteCellsInTable=function(e,t,i,n,o,r){var s,a=this,l="Delete",h=!1,d=i.paragraph.associatedCell,p=n.paragraph.associatedCell,c=(je(r)||(p=r),this.documentHelper.layout.getParentTable(d)),u=this.documentHelper.layout.getParentCell(d),g=this.documentHelper.layout.getParentCell(p),m=(je(r)&&i.paragraph.isInsideTable&&n.paragraph.isInsideTable&&this.selection.isCellSelected(u,i,n)&&(d=u,p=g),d.columnIndex),f=p.columnIndex+p.cellFormat.columnSpan-1,y=d.rowIndex,v=p.rowIndex,b=this.isWholeRowSelected(d.ownerRow,m,f);if(this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)){if(l=this.editorHistory.currentBaseHistoryInfo.action,h="BackSpace"===this.editorHistory.currentBaseHistoryInfo.action||"DeleteCells"===this.editorHistory.currentBaseHistoryInfo.action||"InsertTable"===this.editorHistory.currentBaseHistoryInfo.action||"RemoveRowTrack"===this.editorHistory.currentBaseHistoryInfo.action||je(d.ownerRow.previousWidget)&&je(p.ownerRow.nextWidget)&&"Cut"===this.editorHistory.currentBaseHistoryInfo.action,this.cloneTableToHistoryInfo(e,e===c),this.editorHistory.isRedoing&&"RemoveRowTrack"===this.editorHistory.currentBaseHistoryInfo.action)for(var w=0;w<e.childWidgets.length;w++){var C=e.childWidgets[w];C.index>=y&&C.index<=v&&b&&this.trackRowDeletion(C,!1)}if("RemoveRowTrack"===this.editorHistory.currentBaseHistoryInfo.action)return;this.editorHistory.currentBaseHistoryInfo.action=h?"DeleteCells":"ClearCells",t.owner.isLayoutEnabled=!1}!this.owner.enableTrackChanges||this.skipTracking()||(s=!1,b)?this.onConfirmedTableCellsDeletion(e,t,y,v,m,f,h,o,b,l):1===o?(u=(r=new Cn("documenteditor",this.owner.defaultLocale)).getConstant("UnTrack"),g=r.getConstant("Merge Track"),r.setLocale(this.owner.locale),this.alertDialog=WC.alert({title:u,content:g,showCloseIcon:!0,okButton:{text:"Ok",click:function(){s=!0,a.onConfirmedTableCellsDeletion(e,t,y,v,m,f,h,o,b,l)}},closeOnEscape:!0,position:{X:"center",Y:"center"},animationSettings:{effect:"Zoom"},close:function(){s||(a.documentHelper.layout.reLayoutTable(e),a.viewer.updateScrollBars())}}),this.alertDialog.enableRtl=this.owner.enableRtl):this.trackDeletedContentInTableCell(e,t,i,n,o,y,v,m,f)},c.prototype.removeDeletedCellRevision=function(e,t){0<e.rowFormat.revisions.length&&t&&this.unlinkRangeFromRevision(e.rowFormat,!0);for(var i=0;i<e.childWidgets.length;i++)for(var n=e.childWidgets[i],o=0;o<n.childWidgets.length;o++){var r=n.childWidgets[o];if(!je(r)&&r instanceof Lai){for(var s=0;s<r.childWidgets.length;s++){var a=r.childWidgets[s];if(!je(a.children))for(var l=0;l<a.children.length;l++){var h=a.children[l];0<h.revisions.length&&this.unlinkRangeFromRevision(h,!0)}}this.unlinkRangeFromRevision(r.characterFormat,!0)}else if(!je(r)&&r instanceof _ai)for(var d=0;d<r.childWidgets.length;d++){var p=r.childWidgets[d];this.removeDeletedCellRevision(p,!0)}}},c.prototype.removeDeletedShapeRevision=function(e){var t=e.textFrame;if(!je(t))for(var i=0;i<t.childWidgets.length;i++){var n=t.childWidgets[i];if(!je(n)&&n instanceof Lai){for(var o=0;o<n.childWidgets.length;o++){var r=n.childWidgets[o];if(!je(r.children))for(var s=0;s<r.children.length;s++){var a=r.children[s];0<a.revisions.length&&this.unlinkRangeFromRevision(a,!0)}}this.unlinkRangeFromRevision(n.characterFormat,!0)}}},c.prototype.insertShape=function(e,t){e=this.getShape(e,t);this.owner.documentHelper.selection.start.currentWidget.children.push(e),this.reLayout(this.owner.documentHelper.selection),this.documentHelper.currentPage.bodyWidgets[0].floatingElements.push(e)},c.prototype.getShape=function(e,t){var i=(new Xli).clone(),n=(i.shapeId=parseInt(Date.now().toString().slice(0,10),10),i.name=e+(" "+(this.documentHelper.currentPage.bodyWidgets[0].floatingElements.length+1)),t=je(t)?{}:t,i.x=je(t.x)?50:t.x,i.y=je(t.x)?50:t.y,"UpDownArrow"===(i.autoShapeType=e)?(i.height=je(t.height)?140:t.height,i.width=je(t.width)?96:t.width):"LeftRightArrow"===e||"LeftRightArrowCallout"===e?(i.height=je(t.height)?80:t.height,i.width=je(t.width)?140:t.width):(i.height=je(t.height)?96:t.height,i.width=je(t.width)?96:t.width),i.visible=!!je(t.visible)||t.visible,i.widthScale=je(t.widthScale)?100:t.widthScale,i.heightScale=je(t.heightScale)?100:t.heightScale,i.verticalPosition=je(t.verticalPosition)?i.y:t.verticalPosition,i.verticalOrigin=je(t.verticalOrigin)?"Paragraph":t.verticalOrigin,i.verticalAlignment=je(t.verticalAlignment)?"None":t.verticalAlignment,i.verticalRelativePercent=-34028235e31,i.horizontalPosition=je(t.horizontalPosition)?i.x:t.horizontalPosition,i.horizontalRelativePercent=-34028235e31,i.heightRelativePercent=-34028235e31,i.widthRelativePercent=0,i.horizontalOrigin=je(t.horizontalOrigin)?"Column":t.horizontalOrigin,i.horizontalAlignment=je(t.horizontalAlignment)?"None":t.horizontalAlignment,i.zOrderPosition=251659264,i.allowOverlap=!!je(t.allowOverLap)||t.allowOverLap,i.textWrappingStyle=je(t.textWrappingStyle)?"InFrontOfText":t.textWrappingStyle,i.textWrappingType=je(t.textWrappingType)?"Both":t.textWrappingType,i.isBelowText=!je(t.isBelowText)&&t.isBelowText,i.distanceBottom=je(t.distanceBottom)?0:t.distanceBottom,i.distanceTop=je(t.distanceTop)?0:t.distanceTop,i.distanceLeft=je(t.distanceLeft)?12:t.distanceLeft,i.distanceRight=je(t.distanceRight)?12:t.distanceRight,i.isHorizontalRule=!je(t.isHorizontalRule)&&t.isHorizontalRule,i.layoutInCell=!!je(t.layoutInCell)||t.layoutInCell,i.lockAnchor=!je(t.lockAnchor)&&t.lockAnchor,new Zli),n=(n.textVerticalAlignment="Arc"===e||"CurvedConnector"===e||"ElbowConnector"===e?"Top":"Middle",n.marginLeft=10,n.marginRight=10,n.marginTop=5,n.marginBottom=5,(i.textFrame=n).containerShape=i,new ihi),n=("Arc"===e||"CurvedConnector"===e||"ElbowConnector"===e||"DoubleBracket"===e||"DoubleBrace"===e||"RightBrace"===e||"LeftBrace"===e||"RightBracket"===e||"LeftBracket"===e?(n.color=je(t.fillColor)?"#FFFFFFFF":t.fillColor,n.fill=!!je(t.fill)||t.fill):(n.fill=!!je(t.fill)||t.fill,n.color=je(t.fillColor)?"#156082FF":t.fillColor),i.fillFormat=n,new ehi);return n.lineFormatType=je(t.lineFormatType)?"Solid":t.lineFormatType,n.dashStyle=je(t.dashStyle)?"Solid":t.dashStyle,n.line=!!je(t.line)||t.line,"Arc"===e||"CurvedConnector"===e||"ElbowConnector"===e||"DoubleBracket"===e||"DoubleBrace"===e||"RightBrace"===e||"LeftBrace"===e||"RightBracket"===e||"LeftBracket"===e?(n.color=je(t.lineColor)?"#156082FF":t.lineColor,n.weight=je(t.lineWeight)?.5:t.lineWeight):(n.color=je(t.lineColor)?"#042433FF":t.lineColor,n.weight=je(t.lineWeight)?1:t.lineWeight),i.lineFormat=n,i.line=this.owner.documentHelper.selection.start.currentWidget,i},c.prototype.trackDeletedContentInTableCell=function(e,t,i,n,o,r,s,a,l){var h,d=this.selection.hasMergedCells()?(p=this.selection.getCellFromSelectionInTable(0),this.selection.getCellFromSelectionInTable(1)):(p=this.selection.getCellFromSelection(0),this.selection.getCellFromSelection(1)),p=this.selection.getActualOffset(p,0),c=this.selection.getActualOffset(d,1),u=[],g=!1;this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&u.push.apply(u,this.editorHistory.currentBaseHistoryInfo.removedNodes);for(var m=0;m<e.childWidgets.length;m++){var f=e.childWidgets[m];if(f.index>=r&&f.index<=s)for(var y=0;y<f.childWidgets.length;y++){var v=f.childWidgets[y];if(v.columnIndex>=a&&v.columnIndex<=l)for(var b=f.childWidgets[y],w=b.childWidgets.length,C=0;C<b.childWidgets.length;C++){var S=b.childWidgets[C];if(S instanceof Lai){var A=S;this.insertRevisionForBlock(A,"Deletion",void 0,void 0,void 0,void 0,!0),w!==b.childWidgets.length&&(C--,w=b.childWidgets.length,g=!0),A.isEmpty()?this.combineRevisionWithBlocks(A):this.combineRevisionWithBlocks(A.lastChild.children[A.lastChild.children.length-1])}else for(var x=S,I=0;I<x.childWidgets.length;I++){var T=this.trackRowDeletion(x.childWidgets[I],void 0,!1);if(je(x.childWidgets)){C--;break}0<x.childWidgets.length&&T&&I--}}}}this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.removedNodes.length=0,(h=this.editorHistory.currentBaseHistoryInfo.removedNodes).push.apply(h,u),this.editorHistory.currentBaseHistoryInfo.isRevisionEndInAnotherCell=!0,this.editorHistory.currentBaseHistoryInfo.selectionStart=p,this.editorHistory.currentBaseHistoryInfo.insertPosition=p,this.editorHistory.currentBaseHistoryInfo.selectionEnd=c,this.editorHistory.currentBaseHistoryInfo.endPosition=c,g)&&(c=this.selection.getActualOffset(d,1),this.editorHistory.currentBaseHistoryInfo.selectionEnd=c,this.editorHistory.currentBaseHistoryInfo.endPosition=c,this.selection.editPosition=p)},c.prototype.onConfirmedTableCellsDeletion=function(e,t,i,n,o,r,s,a,l,h){for(var d=0;d<e.childWidgets.length;d++){var p=e.childWidgets[d],c=!1;if(p.index>=i&&p.index<=n&&(this.owner.enableTrackChanges&&!this.skipTracking()&&l&&!(c=this.trackRowDeletion(p,!1,void 0,a))||this.onConfirmedCellDeletion(p,t,i,n,o,r,s,a,l)),c||0===p.childWidgets.length){for(var u=e.childWidgets[d],g=u.previousRenderedWidget;!je(g);){for(var m=0;m<g.childWidgets.length;m++){var f=g.childWidgets[m];u.rowIndex<f.ownerRow.rowIndex+f.cellFormat.rowSpan&&f.cellFormat.rowSpan--}g=g.previousRenderedWidget}this.updateNextBlocksIndex(u,!1),e.childWidgets.splice(d,1),d--,n--}}t.owner.isLayoutEnabled=!0,0===e.childWidgets.length?(t.editPosition=this.selection.getHierarchicalIndex(e,"0"),this.setActionInternal(t,h),this.removeBlock(e)):(e.isGridUpdated=!1,e.buildTableColumns(),e.isGridUpdated=!0,this.documentHelper.layout.reLayoutTable(e)),je(this.alertDialog)||(h=t.getTextPosBasedOnLogicalIndex(t.editPosition),t.selectContent(h,!0),this.reLayout(t),this.alertDialog.close(),this.alertDialog=void 0)},c.prototype.onConfirmedCellDeletion=function(e,t,i,n,o,r,s,a,l){var h=!1;this.removeDeletedCellRevision(e,l);for(var d=0;d<e.childWidgets.length;d++){var p=e.childWidgets[d];if(p.columnIndex>=o&&p.columnIndex<=r)if(h||(this.updateEditPosition(p,t),h=!0),s){var c=e.childWidgets[d];this.updateNextBlocksIndex(c,!1);for(var u=0;u<c.childWidgets.length;u++)for(var g=c.childWidgets[u],m=0;m<g.childWidgets.length;m++){var f=g.childWidgets[m];if(f instanceof Gai)for(var y=f,v=0;v<y.children.length;v++){var b=y.children[v];b instanceof fli&&this.removeFootnote(b)}}var w,C=e.nextRenderedWidget;je(C)||C.rowIndex<c.ownerRow.rowIndex+c.cellFormat.rowSpan&&(c.cellFormat.rowSpan--,(w=this.createColumn(this.selection.getLastParagraph(c))).cellFormat.copyFormat(c.cellFormat),w.index=c.index,w.rowIndex=c.rowIndex,w.columnIndex=c.columnIndex,w.containerWidget=C,w.margin=c.margin.clone(),w.leftBorderWidth=c.leftBorderWidth,w.rightBorderWidth=c.rightBorderWidth,C.childWidgets.splice(w.columnIndex,0,w)),e.childWidgets.splice(d,1),d--}else a<4&&this.deleteCell(p,t,a,!1)}},c.prototype.removeRevisionForRow=function(e){0<e.rowFormat.revisions.length&&this.skipTracking()&&(this.unlinkRangeFromRevision(e.rowFormat,!0),this.addRemovedRevisionInfo(e.rowFormat,void 0))},c.prototype.removeRevisionsInRow=function(e){if(0<e.rowFormat.revisions.length)for(var t=0;t<e.rowFormat.revisions.length;t++){var i=e.rowFormat.revisions[t];this.unlinkWholeRangeInRevision(e.rowFormat,i)}},c.prototype.removeRevisionForCell=function(e,t){for(var i=0;i<e.childWidgets.length;i++)if(e.childWidgets[i]instanceof Lai)for(var n=e.childWidgets[i],o=0;o<n.childWidgets.length;o++)for(var r=n.childWidgets[o],s=0;s<r.children.length;s++){var a=r.children[s];!je(a)&&0<a.revisions.length&&(this.unlinkRangeFromRevision(a,t),this.addRemovedRevisionInfo(a,void 0))}else e.childWidgets[i]instanceof _ai&&this.removeRevisionForInnerTable(e.childWidgets[i])},c.prototype.removeRevisionForInnerTable=function(e){if(0<e.childWidgets.length)for(var t=0;t<e.childWidgets.length;t++){var i=e.childWidgets[t];je(i)||this.removeRevisionForRow(i)}},c.prototype.removeRevisionForBlock=function(e,t,i,n){if(0<e.characterFormat.revisions.length&&!i&&(n&&this.addRemovedRevisionInfo(e.characterFormat,void 0,!1),je(t)?this.unlinkRangeFromRevision(e.characterFormat,!0):this.unlinkRangeByRevision(e.characterFormat,t),e.characterFormat.revisions=[]),!je(e))for(var o=0;o<e.childWidgets.length;o++)for(var r=e.childWidgets[o],s=0;s<r.children.length;s++){var a,l=r.children[s];l instanceof fli&&("Footnote"===(a=l.nextValidNodeForTracking).footnoteType?this.removeFootnote(a):this.removeEndnote(a)),!je(l)&&0<l.revisions.length&&(n&&this.addRemovedRevisionInfo(l,void 0,!1),je(t)?this.unlinkRangeFromRevision(l,!0):this.unlinkRangeByRevision(l,t),l.revisions=[])}},c.prototype.unlinkRangeByRevision=function(e,t){for(var i=0;i<e.revisions.length;i++){var n=e.revisions[i];n.author===t.author&&n.revisionType===t.revisionType&&(e.revisions.splice(e.revisions.indexOf(t),1),n=t.range.indexOf(e),t.range.splice(n,1),this.owner.trackChangesPane.updateCurrentTrackChanges(t))}},c.prototype.isWholeRowSelected=function(e,t,i){return 0===t&&e.childWidgets.length-1===t+i},c.prototype.deleteCell=function(e,t,i,n){var o=e.childWidgets[0];if(1===e.childWidgets.length&&o instanceof Lai&&o.isEmpty())return!1;for(var r=e.childWidgets.length-1,s=e.childWidgets.length-1;-1<s;s--)if(o=e.childWidgets[s],i<4)if(o instanceof Lai&&s===r){var a=o;if(this.checkClearCells(t))a.isEmpty()||this.removeInlines(a,a.firstChild,0,a.lastChild,a.lastChild.getEndOffset(),i);else for(var l=a.childWidgets.length-1;0<=l;l--){for(var h=a.childWidgets[l],d=h.children.length-1;0<=d;d--){var p=h.children[d];p instanceof fli?this.removeFootnote(p):p instanceof Dli&&0===p.bookmarkType&&this.documentHelper.bookmarks.containsKey(p.name)&&this.documentHelper.bookmarks.remove(p.name),this.unLinkFieldCharacter(p),h.children.splice(d,1)}1<a.childWidgets.length&&a.childWidgets.splice(l,1)}}else this.removeBlock(o),this.checkClearCells(t)&&(this.addRemovedNodes(o),1===e.childWidgets.length)&&(t.editPosition=this.selection.getHierarchicalIndex(e.childWidgets[0],"0"),this.updateHistoryPosition(t.editPosition,!0));return!0},c.prototype.paragrapghBookmarkCollection=function(e,t){for(var i=this.documentHelper.bookmarks,n=0;n<i.length;n++){var o=this.documentHelper.bookmarks.get(i.keys[n]);o.paragraph===e&&t.push(o)}return t},c.prototype.deleteContainer=function(e,t,i,n,o){var r=e.ownerTable;if(t.containsRow(r.lastChild,n.paragraph.associatedCell)&&!this.owner.enableTrackChanges)this.deleteContent(r,t,o);else if(this.toCheckForTrack(r)){this.cloneTableToHistoryInfo(r);for(var s=0;s<r.childWidgets.length;s++){var a=r.childWidgets[s];if(this.trackRowDeletion(a),n.paragraph.isInsideTable&&t.containsRow(a,n.paragraph.associatedCell))return void this.documentHelper.layout.reLayoutTable(r)}}else if(0<r.childWidgets.length){e=r.childWidgets[r.childWidgets.length-1];if(t.containsRow(e,n.paragraph.associatedCell))if(this.owner.enableTrackChanges){this.cloneTableToHistoryInfo(r);for(var l=0;l<r.childWidgets.length;l++)this.trackRowDeletion(r.childWidgets[l],!1);je(r.childWidgets)||je(this.editorHistory)||!this.editorHistory.isUndoing&&!this.editorHistory.isRedoing||this.removeBlock(r)}else this.deleteContent(r,t,o);else for(var h=0;h<r.childWidgets.length;h++){var d=r.childWidgets[h];if(o<4&&(this.updateNextBlocksIndex(d,!1),r.childWidgets.splice(h,1),this.addRemovedNodes(d),h--),n.paragraph.isInsideTable&&t.containsRow(d,n.paragraph.associatedCell))return void this.documentHelper.layout.reLayoutTable(r)}}},c.prototype.deleteTableBlock=function(e,t,i,n,o){if(e=e.combineWidget(this.owner.viewer),i.paragraph.isInsideTable&&e.contains(i.paragraph.associatedCell)){var r=e.previousRenderedWidget,r=this.checkAndInsertBlock(e,i,n,o,r instanceof Lai?r:void 0);if(t.containsRow(e.firstChild,i.paragraph.associatedCell))if(this.owner.enableTrackChanges){this.cloneTableToHistoryInfo(e);for(var s=0;s<e.childWidgets.length;s++)if(this.trackRowDeletion(e.childWidgets[s])&&s--,je(e.childWidgets))break;je(e.childWidgets)||je(this.editorHistory)||!this.editorHistory.isUndoing&&!this.editorHistory.isRedoing||this.removeBlock(e)}else this.deleteContent(e,t,o);else this.owner.enableTrackChanges?je(n.paragraph.associatedCell)&&!n.paragraph.isInsideTable&&(a=e.lastChild.lastChild,this.deleteCellsInTable(e,t,i,n,o,a)):(a=this.splitTable(e,i.paragraph.associatedCell.ownerRow),this.deleteContent(e,t,o),this.documentHelper.layout.layoutBodyWidgetCollection(a.index,a.containerWidget,a,!1));je(r)||(t.editPosition=this.selection.getHierarchicalIndex(r,"0"),this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&(this.editorHistory.currentBaseHistoryInfo.endPosition=t.editPosition))}else{var a=e.previousRenderedWidget;if(this.owner.enableTrackChanges){this.cloneTableToHistoryInfo(e);for(s=0;s<e.childWidgets.length;s++)if(this.trackRowDeletion(e.childWidgets[s])&&s--,je(e.childWidgets))break;je(e.childWidgets)||je(this.editorHistory)||!this.editorHistory.isUndoing&&!this.editorHistory.isRedoing||this.removeBlock(e)}else this.deleteContent(e,t,o);je(a)||this.deleteBlock(a,t,i,n,o)}},c.prototype.splitTable=function(e,t){var i=new _ai;i.tableFormat.copyFormat(e.tableFormat),i.index=e.index;for(var n=0;n<e.childWidgets.length;n++){var o=e.childWidgets[n];if(o===t)break;i.childWidgets.push(o),o.containerWidget=i,e.childWidgets.splice(n,1),n--}var r=e.getIndex();return e.containerWidget.childWidgets.splice(r,0,i),i.containerWidget=e.containerWidget,this.updateNextBlocksIndex(i,!0),i},c.prototype.updateEditPosition=function(e,t){e=this.documentHelper.getFirstParagraphInCell(e);t.editPosition=this.selection.getHierarchicalIndex(e,"0")},c.prototype.deleteContent=function(e,t,i){i<4&&(this.removeBlock(e),this.addRemovedNodes(e))},c.prototype.setActionInternal=function(e,t){this.documentHelper.owner.enableHistoryMode&&!je(this.editorHistory.currentBaseHistoryInfo)&&(this.editorHistory.currentBaseHistoryInfo.action=t)},c.prototype.checkClearCells=function(e){return this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&"ClearCells"!==this.editorHistory.currentBaseHistoryInfo.action},c.prototype.isEndInAdjacentTable=function(e,t){e=this.selection.getHierarchicalIndex(e,""),t=this.selection.getHierarchicalIndex(t,""),e=e.split(";"),t=t.split(";");return e.length<t.length},c.prototype.cloneTableToHistoryInfo=function(e,t){var i;if(this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo))return(i=e.clone()).index=e.index,this.editorHistory.currentBaseHistoryInfo.removedNodes.push(i),(this.documentHelper.selection.start.paragraph.isInsideTable&&this.documentHelper.selection.start.paragraph.associatedCell.ownerTable===e||t)&&this.updateHistoryPosition(this.selection.getHierarchicalIndex(e,"0"),!0),i},c.prototype.insertParagraphPaste=function(e,t,i,n,o,r,s,a){if(this.editorHistory&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)&&!je(this.editorHistory.currentBaseHistoryInfo)&&"Paste"===this.editorHistory.currentBaseHistoryInfo.action){var l=this.selection.getNextParagraphBlock(t);if(l&&0<i.offset&&l===n.paragraph&&e===i.paragraph&&"Paste"===this.editorHistory.currentBaseHistoryInfo.action){var h=0;this.removeBlock(t),this.documentHelper.layout.clearListElementBox(l),this.documentHelper.layout.clearListElementBox(t);for(var d=0;d<t.childWidgets.length;d++){var p=t.childWidgets[d];l.childWidgets.splice(h,0,p),t.childWidgets.splice(d,1),d--,h++,p.paragraph=l}this.documentHelper.layout.reLayoutParagraph(l,0,0),o=!1;n=this.selection.editPosition.substring(this.selection.editPosition.lastIndexOf(";")+1);this.selection.editPosition=this.selection.getHierarchicalIndex(l,n)}}o&&this.deleteParagraphMark(t,this.selection,r,!1,s,a)},c.prototype.removeInlines=function(e,t,i,n,o,r){for(var s=!1,a=(this.documentHelper.layout.clearListElementBox(e),e.childWidgets.indexOf(t),this.selection.start.clone()),l=this.selection.end.clone(),h=this.selection.getElementInfo(a.currentWidget,0!==a.offset&&this.selection.isForward?a.offset+1:a.offset),d=this.selection.getElementInfo(l.currentWidget,0===l.offset||this.selection.isForward?l.offset:l.offset+1),p=((h.element instanceof Zai&&2!==h.element.fieldType&&!(d.element instanceof Zai)||d.element instanceof Zai&&2!==d.element.fieldType&&!(h.element instanceof Zai))&&(this.selection.isForward?h.element instanceof Zai&&0===h.element.fieldType&&!je(h.element.fieldEnd)?(u=h.element.fieldEnd.line.getOffset(h.element.fieldEnd,1),(g=new rci(this.owner)).setPositionParagraph(h.element.fieldEnd.line,u),l.isExistBefore(g)&&h.element.fieldSeparator&&(this.selection.start.setPositionParagraph(h.element.fieldSeparator.line,h.element.fieldSeparator.line.getOffset(h.element.fieldSeparator,1)),i=this.selection.start.offset,je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||(this.editorHistory.currentBaseHistoryInfo.selectionStart=this.owner.selection.startOffset,this.editorHistory.currentBaseHistoryInfo.insertPosition=this.owner.selection.startOffset,this.selection.editPosition=this.owner.selection.startOffset))):d.element instanceof Zai&&1===d.element.fieldType&&!je(d.element.fieldBegin)&&(p=d.element.fieldBegin.line.getOffset(d.element.fieldBegin,0),(c=new rci(this.owner)).setPositionParagraph(d.element.fieldBegin.line,p),a.isExistAfter(c))&&(this.selection.end.setPositionParagraph(d.element.line,d.element.line.getOffset(d.element,0)),o=this.selection.end.offset,je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||(this.editorHistory.currentBaseHistoryInfo.selectionEnd=this.owner.selection.endOffset)):h.element instanceof Zai&&1===h.element.fieldType&&!je(h.element.fieldBegin)?(p=h.element.fieldBegin.line.getOffset(h.element.fieldBegin,0),(c=new rci(this.owner)).setPositionParagraph(h.element.fieldBegin.line,p),l.isExistAfter(c)&&(this.selection.start.setPositionParagraph(h.element.line,h.element.line.getOffset(h.element,0)),o=this.selection.start.offset,je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||(this.editorHistory.currentBaseHistoryInfo.selectionStart=this.owner.selection.startOffset,this.editorHistory.currentBaseHistoryInfo.insertPosition=this.owner.selection.endOffset,this.selection.editPosition=this.owner.selection.endOffset))):d.element instanceof Zai&&0===d.element.fieldType&&d.element.fieldSeparator&&!je(d.element.fieldEnd)&&(u=d.element.fieldEnd.line.getOffset(d.element.fieldEnd,1),(g=new rci(this.owner)).setPositionParagraph(d.element.fieldEnd.line,u),a.isExistBefore(g))&&(this.selection.end.setPositionParagraph(d.element.fieldSeparator.line,d.element.fieldSeparator.line.getOffset(d.element.fieldSeparator,1)),i=this.selection.end.offset,je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||(this.editorHistory.currentBaseHistoryInfo.selectionEnd=this.owner.selection.endOffset,this.editorHistory.currentBaseHistoryInfo.insertPosition=this.owner.selection.endOffset,this.selection.editPosition=this.owner.selection.endOffset))),this.selection.getElementInfo(a.currentWidget,this.selection.isForward?a.offset:a.offset+1)),c=this.selection.getElementInfo(l.currentWidget,this.selection.isForward?l.offset+1:l.offset),h=!je(this.editorHistory)&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing),u=(this.selection.isExcludeBookmarkStartEnd||h||this.isInsertingText||this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&"Insert"===this.editorHistory.currentBaseHistoryInfo.action||je(p)||je(c)||!p.element||!c.element||!(p.element instanceof Dli)||!(c.element instanceof Dli)||p.element.name!==c.element.name||!je(p.element.nextElement)&&!je(c.element.previousElement)&&p.element.nextElement instanceof Dli&&c.element.previousElement instanceof Dli&&p.element.nextElement.name===c.element.previousElement.name||!je(p.element.nextElement)&&!je(c.element.previousElement)&&p.element.nextElement instanceof Zai&&c.element.previousElement instanceof Zai||(this.selection.isForward?(this.selection.start.setPositionParagraph(p.element.line,p.element.line.getOffset(p.element,0)),this.selection.end.setPositionParagraph(c.element.line,c.element.line.getOffset(c.element,1)),i=this.selection.start.offset,o=this.selection.end.offset,je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||(this.editorHistory.currentBaseHistoryInfo.selectionStart=this.owner.selection.startOffset,this.editorHistory.currentBaseHistoryInfo.selectionEnd=this.owner.selection.endOffset,this.editorHistory.currentBaseHistoryInfo.insertPosition=this.owner.selection.startOffset,this.selection.editPosition=this.owner.selection.startOffset)):(this.selection.start.setPositionParagraph(p.element.line,p.element.line.getOffset(p.element,1)),this.selection.end.setPositionParagraph(c.element.line,c.element.line.getOffset(c.element,0)),i=this.selection.end.offset,o=this.selection.start.offset,je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||(this.editorHistory.currentBaseHistoryInfo.selectionStart=this.owner.selection.startOffset,this.editorHistory.currentBaseHistoryInfo.selectionEnd=this.owner.selection.endOffset,this.editorHistory.currentBaseHistoryInfo.insertPosition=this.owner.selection.endOffset,this.selection.editPosition=this.owner.selection.endOffset))),this.selection.editPosition),g=this.selection.getParagraphInfo(this.selection.start),d=this.selection.getParagraphInfo(this.selection.end),h=this.selection.getHierarchicalIndex(g.paragraph,g.offset.toString()),p=this.selection.getHierarchicalIndex(d.paragraph,d.offset.toString()),m=e.childWidgets.length-1;0<=m;m--){var f=e.childWidgets[m];if(t===f&&n===f){this.removeContent(f,i,o,r),s=!0;break}if(n===f)s=!(e.isLayouted=!1),this.removeContent(f,0,o,r);else{if(t===f){this.removeContent(f,i,this.documentHelper.selection.getLineLength(f),r);break}s&&this.removeContent(f,0,this.documentHelper.selection.getLineLength(f),r)}}this.owner.enableTrackChanges&&!this.skipTracking()&&(this.selection.start.setPositionInternal(a),this.selection.end.setPositionInternal(l),this.skipReplace&&(this.editorHistory.currentBaseHistoryInfo.insertPosition=void 0,this.updateInsertPosition()),this.selection.editPosition=u),s&&(e.isLayouted=!0,this.removeEmptyLine(e),this.documentHelper.layout.reLayoutParagraph(e,0,0),-1===this.selection.start.currentWidget.indexInOwner&&this.owner.enableTrackChanges&&!this.skipTracking()&&(c=this.selection.getTextPosBasedOnLogicalIndex(h),this.selection.start.setPositionInternal(c)),-1===this.selection.end.currentWidget.indexInOwner)&&this.owner.enableTrackChanges&&!this.skipTracking()&&(g=this.selection.getTextPosBasedOnLogicalIndex(p),this.selection.end.setPositionInternal(g))},c.prototype.skipTracking=function(){return!(je(this.editorHistory)||!this.editorHistory.isUndoing&&!this.editorHistory.isRedoing)||!(je(this.editorHistory)||!this.editorHistory.currentBaseHistoryInfo||"Reject Change"!==this.editorHistory.currentBaseHistoryInfo.action&&"Accept Change"!==this.editorHistory.currentBaseHistoryInfo.action)},c.prototype.canHandleDeletion=function(){return!(je(this.editorHistory)||!this.editorHistory.currentBaseHistoryInfo||"DeleteRow"!==this.editorHistory.currentBaseHistoryInfo.action)},c.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)},c.prototype.removeContent=function(e,t,i,n,o){for(var r=this.selection.getLineLength(e),s=void 0,a=0,l=void 0,h=e.children.length-1;0<=h;h--){var d=e.children[h];if(this.owner.enableTrackChanges&&d instanceof pli&&""===d.text)e.children.splice(h,1);else{if(d.isWidthUpdated=!1,je(n)||2!==n&&1!==n)for(var p=0;p<e.children.length;p++){var c,u=e.children[p];u instanceof pli&&((c=u.text).length+a>t&&!(t<a)&&je(s=c[t-a-1])&&t-a==0&&(s=l),c.length+a>i&&(" "===c[i-a]&&0===t||" "===s&&" "===c[i-a])&&(i+=1),l=c[c.length-1]),a+=u.length}if(i<=r-d.length)r-=d.length;else{var g,m,f=d.length,y=(i<r&&r-f<i&&(f=i-(r-d.length)),0);if(r-d.length<t&&(y=t-(r-d.length)),i<r&&(r-=d.length-f),0===y&&f===d.length?((!this.owner.enableTrackChanges||this.owner.enableTrackChanges&&this.skipTracking())&&(this.editorHistory&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)||d instanceof Dli&&this.removedBookmarkElements.push(d),d instanceof Dli)&&this.documentHelper.bookmarks.containsKey(d.name)&&(this.owner.enableCollaborativeEditing&&!je(this.editorHistory.currentBaseHistoryInfo)&&this.editorHistory.currentBaseHistoryInfo.markerData.push({bookmarkName:d.name}),this.documentHelper.bookmarks.remove(d.name)),(d instanceof rhi&&"Inline"!==d.textWrappingStyle||d instanceof Xli)&&this.removeAutoShape(d),this.skipFieldDeleteTracking&&0<d.revisions.length&&(g=d)instanceof Zai&&(1!==g.fieldType&&2!==g.fieldType||(g=g.fieldBegin),this.clearFieldElementRevisions(g,d.revisions)),this.canHandleDeletion()||this.owner.enableTrackChanges&&!this.skipTracking()&&!this.skipFieldDeleteTracking?(this.skipTableElements||this.skipFootNoteDeleteTracking||o||(d instanceof Khi?this.addRemovedNodes(d):this.addRemovedNodes(d.clone())),this.handleDeleteTracking(d,t,i,h,o)):(d instanceof fli&&(d.isLayout=!1),this.unLinkFieldCharacter(d),this.unlinkRangeFromRevision(d,!0),this.addRemovedRevisionInfo(d,void 0),o||this.addRemovedNodes(d),d instanceof ghi?(this.editorHistory&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)||this.removedEditRangeStartElements.push(d),-1!=d.columnFirst&&-1!=d.columnLast&&this.removeEditRangeFromCollection(d)):d instanceof phi?this.editorHistory&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)||this.removedEditRangeEndElements.push(d):d instanceof Pli&&!this.isInsertingTOC&&this.removedContentControlElements.push(d),g=d.previousNode,e.children.splice(h,1),je(g)||this.combineElementRevisionToPrevNxt(g),!je(e.layoutedElements)&&0<e.layoutedElements.length&&e.layoutedElements.splice(h,1))):d instanceof pli&&(je(m=this.handleDeleteTracking(d,y,f))||this.skipTableElements||(0<d.revisions.length&&this.addRemovedRevisionInfo(d,m),this.addRemovedNodes(m))),(!this.owner.enableTrackChanges||this.editorHistory.isUndoing)&&d instanceof fli&&("Footnote"===d.footnoteType?this.removeFootnote(d):this.removeEndnote(d)),r-(f-y)<=t)break;r-=f-y,this.documentHelper.layout.clearListElementBox(e.paragraph)}}}},c.prototype.deleteCommentWidgetInline=function(e){},c.prototype.clearFieldElementRevisions=function(e,t){for(var i=t,n=0;n<i.length;n++)for(var o=i[n],r=0;r<o.range.length;r++)if(o.range[r]===e)for(var s=r;s<o.range.length;){if(o.range[r]instanceof Zai&&1===o.range[r].fieldType&&o.range[r].fieldBegin===e){o.removeRangeRevisionForItem(o.range[r]),0===o.range.length&&this.owner.revisions.remove(o);break}o.removeRangeRevisionForItem(o.range[r])}},c.prototype.addRemovedRevisionInfo=function(e,t,i){for(var n=0;n<e.revisions.length;n++){var o=e.revisions[n].revisionID;(je(t)?e:t).removedIds.push(o)}je(t)&&(je(i)||i)&&(e.revisions=[])},c.prototype.removeEmptyLine=function(e){if(1<e.childWidgets.length)for(var t=0;t<e.childWidgets.length;t++)0===e.childWidgets[t].children.length&&1<e.childWidgets.length&&(e.childWidgets.splice(t,1),t--)},c.prototype.cloneListLevel=function(e){var t=new rsi(void 0);return this.copyListLevel(t,e),t},c.prototype.copyListLevel=function(e,t){je(t.paragraphFormat)||(e.paragraphFormat=new bri(e),e.paragraphFormat.copyFormat(t.paragraphFormat)),je(t.characterFormat)||(e.characterFormat=new Eri(e),e.characterFormat.copyFormat(t.characterFormat)),je(t.followCharacter)||(e.followCharacter=t.followCharacter),je(t.listLevelPattern)||(e.listLevelPattern=t.listLevelPattern),je(t.numberFormat)||(e.numberFormat=t.numberFormat),je(t.restartLevel)||(e.restartLevel=t.restartLevel),je(t.startAt)||(e.startAt=t.startAt)},c.prototype.cloneLevelOverride=function(e){var t=new nsi;return je(e.startAt)||(t.startAt=e.startAt),je(e.overrideListLevel)||(t.overrideListLevel=e.overrideListLevel),je(e.levelNumber)||(t.levelNumber=e.levelNumber),t},c.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])},c.prototype.updateListParagraphsInBlock=function(e){if(e instanceof Lai)je(e.paragraphFormat)||je(e.paragraphFormat.listFormat)||je(e.paragraphFormat.listFormat.listId)||(0<=e.paragraphFormat.listFormat.listId&&e.paragraphFormat.clearIndent(),je(this.documentHelper.listParagraphs)&&(this.documentHelper.listParagraphs=[]),this.documentHelper.listParagraphs.push(e));else if(e instanceof _ai)for(var t=0;t<e.childWidgets.length;t++)for(var i=0;i<e.childWidgets[t].childWidgets.length;i++)for(var n=e.childWidgets[t].childWidgets[i],o=0;o<n.childWidgets.length;o++)this.updateListParagraphsInBlock(n.childWidgets[o])},c.prototype.onApplyList=function(e){var t=this.documentHelper.selection,i=(this.setOffsetValue(this.documentHelper.selection),this.initHistory("ListFormat"),new mri);je(e)||(i.listId=e.listId,i.nsid=e.nsid),this.documentHelper.owner.isShiftingEnabled=!0,t.isEmpty?(this.applyParaFormatProperty(t.start.paragraph,"listFormat",i,!1),this.isMeasureParaWidth=!0,this.layoutItemBlock(t.start.paragraph,!1),this.isMeasureParaWidth=!1):this.updateSelectionParagraphFormatting("listFormat",i,!1),this.documentHelper.owner.isShiftingEnabled=!0,this.layoutWholeDocument(),this.documentHelper.owner.isShiftingEnabled=!1,this.startParagraph=void 0,this.endParagraph=void 0},c.prototype.applyBulletOrNumbering=function(e,t,i){var n=this.documentHelper.selection,o=n.paragraphFormat.getList(),r=!1,s=n.start,a=(s=n.isForward?s:n.end).paragraph;if(je(o)){for(;!je(a.previousWidget)&&a.previousWidget instanceof Lai&&a.previousWidget.isEmpty()&&-1===a.previousWidget.paragraphFormat.listFormat.listId;)a=a.previousWidget;if(a.previousWidget&&a.previousWidget instanceof Lai&&-1!==a.previousWidget.paragraphFormat.listFormat.listId){for(var l=!1;!je(a.previousWidget)&&a.previousWidget instanceof Lai&&-1!==a.previousWidget.paragraphFormat.listFormat.listId&&s.paragraph.paragraphFormat.firstLineIndent<Math.abs(a.previousWidget.paragraphFormat.firstLineIndent);)a=a.previousWidget,l=!0;l||(a=a.previousWidget),o=this.documentHelper.getListById(a.paragraphFormat.listFormat.listId),r=!0}if(!r){for(;!je(a.nextWidget)&&a.nextWidget instanceof Lai&&a.nextWidget.isEmpty()&&-1===a.nextWidget.paragraphFormat.listFormat.listId;)a=a.nextWidget;a.nextWidget&&a.nextWidget instanceof Lai&&-1!==a.nextWidget.paragraphFormat.listFormat.listId&&(a=a.nextWidget,o=this.documentHelper.getListById(a.paragraphFormat.listFormat.listId),r=!0)}}var h,d=void 0,p=-1,c=!1;if(-1===a.paragraphFormat.listFormat.listId||je(a.paragraphFormat.listFormat.listLevel)||(this.listNumberFormat=a.paragraphFormat.listFormat.listLevel.numberFormat,this.listLevelPattern=a.paragraphFormat.listFormat.listLevel.listLevelPattern,je(a.previousWidget)&&0<a.paragraphFormat.listFormat.listLevelNumber?this.listLevelNumber=this.documentHelper.selection.start.paragraph.paragraphFormat.listFormat.listLevelNumber:this.listLevelNumber=a.paragraphFormat.listFormat.listLevelNumber),!je(o)){var u,p=(je(a.previousWidget)&&0<a.paragraphFormat.listFormat.listLevelNumber?this.documentHelper.selection.start.paragraph:a).paragraphFormat.listFormat.listLevelNumber,g=this.documentHelper.getListById(a.paragraphFormat.listFormat.listId),d=this.documentHelper.layout.getListLevel(g,p);if(0<p&&(c=!je(this.documentHelper.layout.getListLevel(g,0))&&0<p&&n.start.isInSameListParagraph(n.end)),0===(u=(u=g.abstractList)||this.documentHelper.getAbstractListById(o.abstractListId)).levels.length&&(d=this.documentHelper.layout.getListLevel(g,a.paragraphFormat.listFormat.listLevelNumber)),r){if("Bullet"!==t&&d.listLevelPattern===t&&(d.numberFormat===e||-1!==d.numberFormat.indexOf(e)))return n.paragraphFormat.listId=o.listId,n.paragraphFormat.listLevelNumber=p,void n.paragraphFormat.setList(o);d=u.levels[0]}}je(o)||!je(o)&&0===p&&(d.listLevelPattern!==t||d.numberFormat!==e||d.characterFormat.fontFamily!==i&&"Bullet"===d.listLevelPattern)?(r=!1,o=new xpi,0<this.documentHelper.lists.length?o.listId=this.documentHelper.lists[this.documentHelper.lists.length-1].listId+1:o.listId=0,u=new tsi,0<this.documentHelper.abstractLists.length?u.abstractListId=this.documentHelper.abstractLists[this.documentHelper.abstractLists.length-1].abstractListId+1:u.abstractListId=0,o.nsid=u.nsid,o.abstractListId=u.abstractListId,o.abstractList=u,this.documentHelper.abstractLists.push(u),"bullet"===e||"multiLevel"===e||"numbering"===e?this.addListLevels(u,e,n):((h=new rsi(u)).listLevelPattern=t,h.numberFormat=e,"Bullet"!==t?h.startAt=1:h.characterFormat.fontFamily=i,h.paragraphFormat.leftIndent=36,h.paragraphFormat.firstLineIndent=-18,u.levels.push(h),n.paragraphFormat.listLevelNumber=0),n.paragraphFormat.setList(o)):!c||je(o)||r?!je(o)&&r?n.paragraphFormat.setList(o):n.paragraphFormat.setList(void 0):(g=this.documentHelper.getListById(a.paragraphFormat.listFormat.listId),h=this.documentHelper.layout.getListLevel(g,p),"Bullet"===t?(h.numberFormat=e,h.characterFormat.fontFamily=i,h.listLevelPattern=t):(h.listLevelPattern=t,h.characterFormat.fontFamily=i,h.startAt=1,d=h.numberFormat.substring(h.numberFormat.length-1),h.numberFormat.length!==e.length&&0<p?h.numberFormat=e:e.substring(e.length-1)!==h.numberFormat.substring(h.numberFormat.length-1)&&(h.numberFormat=h.numberFormat.replace(d,e.substring(e.length-1)))),n.paragraphFormat.setList(g))},c.prototype.addListLevels=function(e,t,i){for(var n=[String.fromCharCode(61558),String.fromCharCode(61656),String.fromCharCode(61607),String.fromCharCode(61623),String.fromCharCode(61608)],o=e.levels.length;o<9;o++){var r=new rsi(e);if(t.match("bullet"))r.listLevelPattern="Bullet",r.numberFormat=n[o<5?o%5:o%5+1],r.characterFormat.fontFamily=o<3||5===o?"Wingdings":"Symbol";else{if(t.match("multiLevel")){for(var s=0;s<o+1;s++)r.numberFormat+="%"+(s+1).toString()+".";r.listLevelPattern="Number"}else r.numberFormat="%"+(o+1).toString()+")",r.listLevelPattern=o%3==0?"Number":o%3==1?"LowLetter":"LowRoman";r.startAt=1,r.restartLevel=o}r.paragraphFormat.leftIndent=0===o?36:36*o,r.paragraphFormat.firstLineIndent=-18,e.levels.push(r),i.paragraphFormat.listLevelNumber=o}},c.prototype.insertPageBreak=function(){this.owner.isReadOnlyMode||this.documentHelper.selection.start.paragraph.isInsideTable||this.documentHelper.selection.start.paragraph.isInHeaderFooter||(this.initComplexHistory("PageBreak"),this.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.onEnter("PageBreak"),this.isSkipOperationsBuild=!1,this.editorHistory&&!je(this.editorHistory.currentHistoryInfo)&&this.editorHistory.updateComplexHistory(),this.owner.enableAutoFocus&&this.selection.checkForCursorVisibility())},c.prototype.insertColumnBreak=function(){var e;this.owner.isReadOnlyMode||this.documentHelper.selection.start.paragraph.isInsideTable||this.documentHelper.selection.start.paragraph.isInHeaderFooter||(this.initComplexHistory("ColumnBreak"),e=this.documentHelper.selection.start.paragraph,this.viewer instanceof nai&&1<e.bodyWidget.sectionFormat.columns.length&&(je((e=this.documentHelper.layout.getBodyWidget(e.bodyWidget,!1)).nextRenderedWidget)||e.page!==e.nextRenderedWidget.page||this.documentHelper.layout.combineMultiColumn(e)),this.onEnter("ColumnBreak"),this.editorHistory&&!je(this.editorHistory.currentHistoryInfo)&&this.editorHistory.updateComplexHistory(),this.owner.enableAutoFocus&&this.selection.checkForCursorVisibility())},c.prototype.onEnter=function(e){this.handledEnter=!0;var t,i=this.documentHelper.selection,n=!1;if((je(i.start.paragraph.paragraphFormat.baseStyle)||"Normal"===i.start.paragraph.paragraphFormat.baseStyle.name||"Normal (Web)"===i.start.paragraph.paragraphFormat.baseStyle.name)&&((t=new sui(void 0)).cloneFormat(this.selection.characterFormat),i.start.paragraph.lastChild.children[i.start.paragraph.lastChild.children.length-1]instanceof fli)&&(t.baselineAlignment="Normal"),i.isEmpty&&i.start.paragraph.isInsideTable&&(i.start.paragraph.associatedCell.ownerTable.isInsideTable||1===i.startPage)&&0===i.start.paragraph.associatedCell.ownerTable.index&&0===i.start.paragraph.associatedCell.columnIndex&&0===i.start.paragraph.associatedCell.rowIndex&&0===i.start.paragraph.index&&0===i.start.offset&&(n=!0),!this.isXmlMapped){if(i.isEmpty){var o=i.getHyperlinkField();if(!je(o))return void i.fireRequestNavigate(o);if((o=i.start.paragraph).isEmpty()&&-1!==o.paragraphFormat.listFormat.listId&&!n)return void this.onApplyListInternal(this.documentHelper.getListById(o.paragraphFormat.listFormat.listId),o.paragraphFormat.listFormat.listLevelNumber-1)}var r=this.checkAndRemoveComments(),s=(this.initHistory("Enter"),!0);if(s=i.isEmpty||i.isImageSelected?s:this.removeSelectedContents(i)){i.isImageSelected&&!i.isForward&&(s=i.start,i.start=i.end,i.end=s),i.owner.isShiftingEnabled=!0,this.updateInsertPosition();var s=this.selection.getParagraphInfo(i.start),s=this.selection.getHierarchicalIndex(s.paragraph,s.offset.toString()),a=this.copyInsertFormat(this.selection.start.paragraph.characterFormat,!0);if(this.splitParagraphInternal(i,i.start.paragraph,i.start.currentWidget,i.start.offset,a,n),this.setPositionForCurrentIndex(i.start,s),!je(e)&&("PageBreak"===e||"ColumnBreak"===e)){var a=i.start.paragraph,s=new Lai,l=(s.characterFormat.copyFormat(a.characterFormat),s.paragraphFormat.copyFormat(a.paragraphFormat),new pli);switch(e){case"PageBreak":l.text="\f";break;case"ColumnBreak":l.text=String.fromCharCode(14)}var h=new Gai(s);h.children.push(l),l.line=h,s.childWidgets.push(h),this.owner.enableTrackChanges&&0<a.characterFormat.revisions.length&&((h=this.retrieveRevisionInOder(a.characterFormat)).range.push(s.characterFormat),s.characterFormat.revisions.push(h),this.owner.trackChangesPane.updateCurrentTrackChanges(h),s.characterFormat.removedIds=[]),this.insertParagraph(s,!0),i.selectParagraphInternal(s,!0)}var a=i.start.paragraph.nextWidget,d=(je(a)&&(a=i.getNextRenderedBlock(i.start.paragraph)),i.selectParagraphInternal(n?i.start.paragraph:a,!0),n||this.updateEndPosition(),!je(e)&&this.editorHistory&&this.owner.editorHistoryModule.updateHistory(),this.reLayout(i),this.selection.start.paragraph.containerWidget.firstChild);if(!je(d)){d.isChangeDetected=!1;for(var p=d.nextRenderedWidget;this.owner.isSpellCheck&&!je(p);)(d=p).isChangeDetected=!1,p=d.nextRenderedWidget}!je(o=i.start.paragraph.previousWidget)&&!o.isEmpty()&&o.lastChild.children[o.lastChild.children.length-1]instanceof pli&&this.checkAndConvertToHyperlink(i,!0,o)}je(t)||je(i.start.paragraph)||!i.start.paragraph.isEmpty()||n||(this.selection.isRetrieveFormatting=!0,this.selection.characterFormat.cloneFormat(t),this.selection.isRetrieveFormatting=!1),this.documentHelper.layout.islayoutFootnote=!1,this.updateHistoryForComments(r),this.handledEnter=!1}},c.prototype.combineRevisionWithValidElement=function(e){if(e.isEmpty()){var t=e.previousRenderedWidget;!je(t)&&t instanceof Lai&&(o=t.characterFormat)}else{var t=e.lastChild;if(0<t.children.length){for(var i=t.children[t.children.length-1];i instanceof Dli||i instanceof Khi||i instanceof lhi;)i=i.previousElement;o=i}}!je(o)&&0<o.revisions.length&&this.compareElementRevision(o,e.characterFormat)&&(t=e.characterFormat.revisions[e.characterFormat.revisions.length-1],this.compareElementRevision(o,e.characterFormat))&&t!==(n=o.revisions[o.revisions.length-1])&&(this.clearAndUpdateRevisons(t.range,n,n.range.indexOf(o)+1),this.owner.revisions.remove(t));var n,o=this.getPreviousValidElement(e);!je(o)&&0<o.revisions.length&&(t=o.revisions[o.revisions.length-1],this.compareElementRevision(e.characterFormat,o))&&this.compareElementRevision(e.characterFormat,o)&&t!==(n=e.characterFormat.revisions[e.characterFormat.revisions.length-1])&&(this.clearAndUpdateRevisons(n.range,t,0,!0),this.owner.revisions.remove(n))},c.prototype.getPreviousValidElement=function(e){e=e.nextRenderedWidget;if(e instanceof Lai)if(e.isEmpty()){if(!je(e)&&e instanceof Lai)return e.characterFormat}else{e=e.firstChild;if(0<e.children.length){for(var t=e.children[0];t instanceof Dli||t instanceof Khi||t instanceof lhi;)t=t.nextElement;return t}}},c.prototype.splitParagraphInternal=function(e,t,i,n,o,r){var s=0,a=t.index,l=t,h=!1;for(l.isChangeDetected=0===n;this.owner.isSpellCheck&&!je(l.nextRenderedWidget);)(l=l.nextRenderedWidget).isChangeDetected=!0;var d,p,c=new Lai,u=new Gai(c);c.childWidgets.push(u),c.paragraphFormat.ownerBase=c,i!==t.lastChild||n!==e.getLineLength(i)||t.isContainsShapeAlone()?(c.paragraphFormat.copyFormat(t.paragraphFormat),c.characterFormat.copyFormat(o),!(0<n)&&i.isFirstLine()||t.isContainsShapeAlone()?(u=!1,!je(e=t.previousRenderedWidget)&&e instanceof Lai&&(u=0<e.characterFormat.revisions.length),this.owner.enableTrackChanges&&(u?this.checkToMatchEmptyParaMark(t,c)||this.insertParaRevision(t):je(d=t.firstChild.children[0].previousValidNodeForTracking)||this.checkParaMarkMatchedWithElement(d,c.characterFormat,!0,"Insertion")?je(d)&&(s++,a++):this.insertParaRevision(c))):(t=t.combineWidget(this.owner.viewer),this.moveInlines(t,c,0,0,t.firstChild,n,i),this.owner.enableTrackChanges&&this.insertParaRevision(c,t.firstChild)),t=t.getSplitWidgets()[0]):(r||(t.paragraphFormat.baseStyle&&"Normal"!==t.paragraphFormat.baseStyle.name&&t.paragraphFormat.baseStyle.next instanceof _ri?(t.paragraphFormat.baseStyle.name===t.paragraphFormat.baseStyle.next.name?(c.paragraphFormat.copyFormat(t.paragraphFormat),c.characterFormat.copyFormat(t.characterFormat)):c.paragraphFormat.baseStyle=t.paragraphFormat.baseStyle.next,this.selection.skipFormatRetrieval=!1):(c.paragraphFormat.copyFormat(t.paragraphFormat),c.characterFormat.copyFormat(t.characterFormat)),0<t.lastChild.children.length&&t.characterFormat.copyFormat(t.lastChild.children[t.lastChild.children.length-1].characterFormat)),this.handledEnter&&this.selection.isEmpty&&this.selection.start.isAtParagraphEnd&&0<t.characterFormat.revisions.length&&(h=!0,c.characterFormat.removedIds=[]),this.owner.enableTrackChanges&&!je(o=t.lastChild)&&0<o.children.length&&(e=o.children[o.children.length-1].previousValidNodeForTracking,d=this.getPreviousValidElement(t),0<t.characterFormat.revisions.length&&d&&0<d.revisions.length?h?(u=this.compareElementRevision(t.characterFormat,d),n=this.isRevisionMatched(t.characterFormat,"Insertion")&&this.isRevisionMatched(d,"Insertion"),!je(e)&&n&&this.checkParaMarkMatchedWithElement(e,t.characterFormat,!1,"Insertion"),d&&0<d.revisions.length&&!n&&u&&(this.insertRevision(c.characterFormat,"Insertion"),this.updateRevisionForSpittedTextElement(t.characterFormat,d),c.characterFormat)&&(h=!1)):this.insertParaRevision(t):je(e)||this.checkParaMarkMatchedWithElement(e,t.characterFormat,!1,"Insertion")||(h?this.checkToCombineRevisionWithPrevPara(t,"Insertion",c)||this.insertParaRevision(c):this.insertParaRevision(t))),s++,a++),r?((p=t.associatedCell.ownerTable.containerWidget).childWidgets.splice(a=s=0,0,c),c.containerWidget=p,c.index=0,this.updateNextBlocksIndex(c,!0),this.owner.selectionModule.start.setPositionParagraph(c.firstChild,0),this.owner.selectionModule.end.setPositionParagraph(c.firstChild,1),je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||(this.editorHistory.currentBaseHistoryInfo.selectionStart=this.owner.selectionModule.startOffset,this.editorHistory.currentBaseHistoryInfo.selectionEnd=this.owner.selectionModule.startOffset,this.editorHistory.currentBaseHistoryInfo.insertPosition=this.owner.selectionModule.startOffset,this.editorHistory.currentBaseHistoryInfo.endPosition=this.owner.selectionModule.endOffset)):(s+=t.getIndex(),(p=t.containerWidget).childWidgets.splice(s,0,c),c.containerWidget=p,c.index=a,this.updateNextBlocksIndex(c,!0)),(!je(p.containerWidget)&&p.containerWidget instanceof Pai||p instanceof Uai&&!je(p.bodyWidget)&&p.bodyWidget.containerWidget instanceof Pai)&&(i=this.documentHelper.textHelper.getParagraphMarkSize(c.characterFormat).Height,p instanceof Uai?(p.bodyWidget.height+=i,p.bodyWidget.containerWidget.height+=i):(p.containerWidget.height+=i,p.height+=i)),this.owner.enableTrackChanges&&0===c.characterFormat.revisions.length&&(o=void 0,0!==t.characterFormat.revisions.length||r?(h||r)&&(o=c):o=t,je(o)||this.checkToMatchEmptyParaMark(o)||this.insertParaRevision(o)),this.documentHelper.layout.layoutBodyWidgetCollection(a,p,c,!1)},c.prototype.insertParaRevision=function(e,t){this.owner.enableTrackChanges&&je(t)&&!this.isRevisionMatched(e.characterFormat,"Insertion")&&(e.characterFormat.revisions=[],this.insertRevision(e.characterFormat,"Insertion")),je(t)||(t.paragraph.isInsideTable?this.insertRevision(e.characterFormat,"Insertion"):this.applyRevisionForParaMark(e,t,"Insertion",!0))},c.prototype.applyRevisionForParaMark=function(e,t,i,n){var o=t?t.children[0]:void 0,r=(je(o)||(o=o.nextValidNodeForTracking),e.lastChild),r=0===r.children.length?void 0:r.children[r.children.length-1].previousValidNodeForTracking,s=!1,a=e.characterFormat.revisions.length;if(je(r)||(s=this.checkParaMarkMatchedWithElement(r,e.characterFormat,!1,i)),!je(o))if(e.characterFormat.revisions.length>a){if(this.isRevisionMatched(o,i))for(var l=e.characterFormat.revisions[0],h=this.getMatchedRevisionsToCombine(o.revisions,i),d=0;d<h.length;d++)h[d]!==l&&(s=!0,this.clearAndUpdateRevisons(h[d].range,l,l.range.indexOf(e.characterFormat)+1))}else s=this.checkParaMarkMatchedWithElement(o,e.characterFormat,!0,i);!s&&(this.owner.enableTrackChanges||!je(t)&&0<t.paragraph.characterFormat.revisions.length)&&(this.insertRevision(e.characterFormat,i),n)&&0<r.revisions.length&&!je(o)&&0<o.revisions.length&&this.updateRevisionForSpittedTextElement(r,o)},c.prototype.checkParaMarkMatchedWithElement=function(e,t,i,n){n=this.getMatchedRevisionsToCombine(e.revisions,n);return 0<n.length&&(this.mapMatchedRevisions(n,e,t,i),!0)},c.prototype.checkToMatchEmptyParaMark=function(e,t){var i=e.previousRenderedWidget;if(!je(i)&&i instanceof Lai&&0<i.characterFormat.revisions.length){var n=this.getMatchedRevisionsToCombine(i.characterFormat.revisions,"Insertion");if(0<n.length)return je(t)?this.mapMatchedRevisions(n,i.characterFormat,e.characterFormat,!1):this.mapMatchedRevisions(n,i.characterFormat,t.characterFormat,!1),!0}return!1},c.prototype.checkToMatchEmptyParaMarkBack=function(e){var t,i=e.nextRenderedWidget,n=i.childWidgets[0],o=n.children[0];if(!je(i)&&i instanceof Lai&&0<i.characterFormat.revisions.length){if(0<(t=this.getMatchedRevisionsToCombine(i.characterFormat.revisions,"Deletion")).length)return null!=i&&null!=n&&null!=o&&1==o.revisions.length?this.mapMatchedRevisions(t,o,e.characterFormat,!0):this.mapMatchedRevisions(t,i.characterFormat,e.characterFormat,!0),!0}else if(null!=o&&1==o.revisions.length)if(0<(t=this.getMatchedRevisionsToCombine(o.revisions,"Deletion")).length)return this.mapMatchedRevisions(t,o,e.characterFormat,!0),!0;return!1},c.prototype.updateNextBlocksIndex=function(e,t){var i=e.containerWidget.childWidgets.indexOf(e)+1;if(e.containerWidget instanceof Sai&&!(e.containerWidget.containerWidget instanceof Pai))if(1<e.containerWidget.page.bodyWidgets.length&&1<e.containerWidget.sectionFormat.numberOfColumns)for(var n=e.containerWidget.indexInOwner,o=this.documentHelper.pages.indexOf(e.containerWidget.page);o<this.documentHelper.pages.length;o++){for(var r=this.documentHelper.pages[o],s=0;s<r.bodyWidgets.length;s++)if(r.bodyWidgets[s].indexInOwner===n){for(var a=i;a<r.bodyWidgets[s].childWidgets.length;a++){var l=r.bodyWidgets[s].childWidgets[a];this.updateIndex(l,t)}i=0,je(r.bodyWidgets[s].nextRenderedWidget)||r.bodyWidgets[s].nextRenderedWidget.sectionIndex!==r.bodyWidgets[s].sectionIndex||n++}n!==e.containerWidget.indexInOwner&&!je(r.bodyWidgets[r.bodyWidgets.length-1].nextRenderedWidget)&&1<r.bodyWidgets[r.bodyWidgets.length-1].nextRenderedWidget.sectionFormat.columns.length&&(n=0)}else if(1<e.containerWidget.page.bodyWidgets.length){for(var h=e.containerWidget.index,o=this.documentHelper.pages.indexOf(e.containerWidget.page);o<this.documentHelper.pages.length;o++)for(r=this.documentHelper.pages[o],s=0;s<r.bodyWidgets.length;s++)if(r.bodyWidgets[s].index===h){for(a=i;a<r.bodyWidgets[s].childWidgets.length;a++){l=r.bodyWidgets[s].childWidgets[a];this.updateIndex(l,t)}i=0}}else for(h=e.containerWidget.index,s=this.documentHelper.pages.indexOf(e.containerWidget.page);s<this.documentHelper.pages.length;s++){if((r=this.documentHelper.pages[s]).bodyWidgets[0].index!==h)return;for(a=i;a<r.bodyWidgets[0].childWidgets.length;a++){l=r.bodyWidgets[0].childWidgets[a];this.updateIndex(l,t)}i=0}else if(e.containerWidget instanceof Uai)for(var d=e.containerWidget.getSplitWidgets(),p=d.indexOf(e.containerWidget);p<d.length;p++){for(var c=d[p].childWidgets,u=i;u<c.length;u++)this.updateIndex(c[u],t);i=0}else if(e.containerWidget instanceof jai)for(o=i;o<e.containerWidget.childWidgets.length;o++){var g=e.containerWidget.childWidgets[o];g.rowIndex===e.containerWidget.index&&this.updateIndex(g,t)}else if(e.containerWidget instanceof _ai)for(o=i;o<e.containerWidget.childWidgets.length;o++){var m=e.containerWidget.childWidgets[o];this.updateIndex(m,t);for(s=0;s<m.childWidgets.length;s++)m.childWidgets[s].rowIndex=m.index}else if(e.containerWidget instanceof Iai||e.containerWidget instanceof Zli||!je(e.containerWidget)&&e.containerWidget.containerWidget instanceof Pai)for(o=i;o<e.containerWidget.childWidgets.length;o++){var f=e.containerWidget.childWidgets[o];this.updateIndex(f,t)}},c.prototype.updateIndex=function(e,t){t?e.index++:e.index--},c.prototype.updateEndPosition=function(){var e=this.documentHelper.selection;this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&this.updateHistoryPosition(e.start,!1)},c.prototype.checkAndRemoveComments=function(e,t){var i=this.selection;if(i.isEmpty||this.owner.enableTrackChanges&&!t||e)return[];var n=this.getSelectedComments();if(0<n.commentEndInfo.length||0<n.commentStartInfo.length){this.initComplexHistory("RemoveComment");for(var t=this.selection.start,e=this.selection.end,o=(this.selection.isForward||(t=this.selection.end,e=this.selection.start),this.selection.getParagraphInfo(t)),r=this.selection.getParagraphInfo(e),s=0;s<n.commentEndInfo.length;s++){var a=n.commentEndInfo[s].comment,l=a.commentStart,h=a.commentEnd,d=this.selection.getParagraphInfoInternal(l.line,l.line.getOffset(l,0)),l=this.selection.getParagraphInfoInternal(h.line,h.line.getOffset(h,0));if(r.paragraph===l.paragraph){if(0<a.replyComments.length)for(var p=0;p<a.replyComments.length;p++)je((c=a.replyComments[p]).commentEnd)||r.offset--;r.offset--}if(o.paragraph===d.paragraph){h=d.offset<o.offset;if(0<a.replyComments.length)for(var c,p=0;p<a.replyComments.length;p++)je((c=a.replyComments[p]).commentStart)||(this.selection.getParagraphInfoInternal(c.commentStart.line,c.commentStart.line.getOffset(c.commentStart,0)).offset<o.offset&&o.offset--,r.paragraph===d.paragraph&&r.offset--);h&&o.offset--,r.paragraph===d.paragraph&&r.offset--}this.deleteCommentInternal(a)}if(0<n.commentStartInfo.length)for(var u=0;u<n.commentStartInfo.length;u++)n.commentStartInfo[u].line.paragraph.equals(r.paragraph)&&r.offset--,this.removeInline(n.commentStartInfo[u]);t=i.getLineInfoBasedOnParagraph(o.paragraph,o.offset),e=(i.start.setPositionFromLine(t.line,t.offset),i.getLineInfoBasedOnParagraph(r.paragraph,r.offset));i.end.setPositionFromLine(e.line,e.offset)}return n.commentStartInfo},c.prototype.updateHistoryForComments=function(e){if(this.editorHistory&&!je(this.editorHistory.currentHistoryInfo)&&"RemoveComment"===this.editorHistory.currentHistoryInfo.action){if(!je(e))for(var t=0;t<e.length;t++)this.initInsertInline(e[t],!1);this.editorHistory.currentHistoryInfo.endPosition=this.selection.startOffset,this.editorHistory.updateComplexHistory()}},c.prototype.onBackSpace=function(){this.removeEditRange=!0;var e=this.documentHelper.selection;if(this.documentHelper.triggerSpellCheck=!0,!e.isEmpty&&0<e.bookmarks.length&&this.extendSelectionToBookmarkStart(),e.isEmpty)this.singleBackspace(e,!1);else{var t=this.checkAndRemoveComments(),i=(this.initHistory("BackSpace"),this.deleteSelectedContents(e,!0));if(this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(i?this.editorHistory.currentBaseHistoryInfo=void 0:(this.checkEndPosition(e)&&this.updateHistoryPosition(e.end,!1),this.isSkipOperationsBuild=!je(this.alertDialog),this.reLayout(e),this.isSkipOperationsBuild=!1,this.insertSpaceInFormField())),this.editorHistory&&!je(this.editorHistory.currentHistoryInfo)){for(var n=0;n<t.length;n++)this.initInsertInline(t[n],!1);this.editorHistory.currentHistoryInfo.endPosition=this.selection.startOffset,this.editorHistory.updateComplexHistory()}this.owner.isSpellCheck&&(this.documentHelper.triggerSpellCheck=!1)}this.removeEditRange=!1,this.documentHelper.layout.islayoutFootnote=!1,this.updateXmlMappedContentControl()},c.prototype.insertRemoveBookMarkElements=function(e){var t=!1;if(!this.isRemoteAction)for(var i=0;i<this.removedBookmarkElements.length;i++){var n,o,r,s=this.removedBookmarkElements[i];0===s.bookmarkType?(n=s)&&n.reference&&-1!==this.removedBookmarkElements.indexOf(n.reference)?(o=this.removedBookmarkElements.indexOf(n.reference),r=this.removedBookmarkElements.indexOf(n),this.removedBookmarkElements.splice(o,1),this.removedBookmarkElements.splice(r,1),i--):(this.editorHistory.currentBaseHistoryInfo&&!e&&(this.initComplexHistory(this.editorHistory.currentBaseHistoryInfo.action),this.editorHistory.updateHistory()),this.initInsertInline(n.clone(),void 0,!0),this.editorHistory.currentHistoryInfo&&i===this.removedBookmarkElements.length-1&&0===this.removedContentControlElements.length&&0===this.removedEditRangeStartElements.length&&0===this.removedEditRangeEndElements.length&&(this.editorHistory.updateComplexHistory(),t=!0)):(n=s)&&n.reference&&-1!==this.removedBookmarkElements.indexOf(n.reference)?(o=this.removedBookmarkElements.indexOf(n.reference),r=this.removedBookmarkElements.indexOf(n),this.removedBookmarkElements.splice(o,1),this.removedBookmarkElements.splice(r,1),i--):(this.editorHistory.currentBaseHistoryInfo&&!e&&(this.initComplexHistory(this.editorHistory.currentBaseHistoryInfo.action),this.editorHistory.updateHistory()),this.initInsertInline(n.clone(),void 0,!0),this.editorHistory.currentHistoryInfo&&i===this.removedBookmarkElements.length-1&&0===this.removedContentControlElements.length&&0===this.removedEditRangeStartElements.length&&0===this.removedEditRangeEndElements.length&&(this.editorHistory.updateComplexHistory(),t=!0))}return this.removedBookmarkElements=[],t},c.prototype.insertRemoveContentControlElements=function(e){var t=!1;if(!this.isRemoteAction)for(var i=0;i<this.removedContentControlElements.length;i++){var n,o,r,s=this.removedContentControlElements[i];0===s.type?(n=s)&&n.reference&&-1!==this.removedContentControlElements.indexOf(n.reference)?(o=this.removedContentControlElements.indexOf(n.reference),r=this.removedContentControlElements.indexOf(n),this.removedContentControlElements.splice(o,1),this.removedContentControlElements.splice(r,1),i--):(this.editorHistory.currentBaseHistoryInfo&&!e&&(this.initComplexHistory(this.editorHistory.currentBaseHistoryInfo.action),this.editorHistory.updateHistory()),this.initInsertInline(n.clone(),void 0,!0),this.editorHistory.currentHistoryInfo&&i===this.removedContentControlElements.length-1&&0===this.removedBookmarkElements.length&&0===this.removedEditRangeStartElements.length&&0===this.removedEditRangeEndElements.length&&(this.editorHistory.updateComplexHistory(),t=!0)):(n=s)&&n.reference&&-1!==this.removedContentControlElements.indexOf(n.reference)?(o=this.removedContentControlElements.indexOf(n.reference),r=this.removedContentControlElements.indexOf(n),this.removedContentControlElements.splice(o,1),this.removedContentControlElements.splice(r,1),i--):(this.editorHistory.currentBaseHistoryInfo&&!e&&(this.initComplexHistory(this.editorHistory.currentBaseHistoryInfo.action),this.editorHistory.updateHistory()),this.initInsertInline(n.clone(),void 0,!0),this.editorHistory.currentHistoryInfo&&i===this.removedContentControlElements.length-1&&0===this.removedBookmarkElements.length&&0===this.removedEditRangeStartElements.length&&0===this.removedEditRangeEndElements.length&&(this.editorHistory.updateComplexHistory(),t=!0))}return this.removedContentControlElements=[],t},c.prototype.insertRemovedEditRangeEndElements=function(e){var t=!1;if(!this.isRemoteAction)for(var i=this.removedEditRangeEndElements.length-1;0<=i;i--){var n,o,r=this.removedEditRangeEndElements[i];r&&-1!==this.removedEditRangeStartElements.indexOf(r.editRangeStart)?(o=this.removedEditRangeEndElements.indexOf(r),n=this.removedEditRangeStartElements.indexOf(r.editRangeStart),this.removedEditRangeEndElements.splice(o,1),this.removedEditRangeStartElements.splice(n,1),i--):(this.editorHistory.currentBaseHistoryInfo&&!e&&(this.initComplexHistory(this.editorHistory.currentBaseHistoryInfo.action),this.editorHistory.updateHistory()),this.initInsertInline(r.clone(),void 0,!0),(o=this.selection.start.paragraph.getInline(this.selection.start.offset,0)).element.editRangeStart.editRangeEnd=o.element,this.editorHistory.currentHistoryInfo&&0===i&&0===this.removedContentControlElements.length&&0===this.removedEditRangeStartElements.length&&0===this.removedBookmarkElements.length&&(this.editorHistory.updateComplexHistory(),t=!0))}return this.removedEditRangeEndElements=[],t},c.prototype.insertRemovedEditRangeStartElements=function(e){var t=!1;if(!this.isRemoteAction)for(var i=0;i<this.removedEditRangeStartElements.length;i++){var n,o,r=this.removedEditRangeStartElements[i];r&&-1!==this.removedEditRangeEndElements.indexOf(r.editRangeEnd)?(o=this.removedEditRangeEndElements.indexOf(r.editRangeEnd),n=this.removedEditRangeStartElements.indexOf(r),this.removedEditRangeEndElements.splice(o,1),this.removedEditRangeStartElements.splice(n,1),i--):(this.editorHistory.currentBaseHistoryInfo&&!e&&(this.initComplexHistory(this.editorHistory.currentBaseHistoryInfo.action),this.editorHistory.updateHistory()),this.initInsertInline(r.clone(),void 0,!0),(o=this.selection.start.paragraph.getInline(this.selection.start.offset,0)).element.editRangeEnd.editRangeStart=o.element,this.editorHistory.currentHistoryInfo&&i===this.removedEditRangeStartElements.length-1&&0===this.removedContentControlElements.length&&0===this.removedBookmarkElements.length&&0===this.removedEditRangeEndElements.length&&(this.editorHistory.updateComplexHistory(),t=!0))}return this.removedEditRangeStartElements=[],t},c.prototype.deleteSelectedContents=function(e,t,i){t=this.deleteSelectedContentInternal(e,t,e.start,e.end,i),i=e.getTextPosBasedOnLogicalIndex(e.editPosition);return e.selectContent(i,!0),t},c.prototype.removeWholeElement=function(e){this.initHistory("BackSpace"),this.deleteSelectedContents(e,!0),this.checkEndPosition(e)&&this.updateHistoryPosition(e.end,!1),this.reLayout(e)},c.prototype.getSelectedComments=function(){for(var e=this.documentHelper.comments,t=[],i=[],n=0;n<e.length;n++){var o=e[n],r=o.commentEnd,s=o.commentStart;if(!je(r)&&this.selection.isElementInSelection(r,!0))t.push(r);else if(!je(s)&&this.selection.isElementInSelection(s,!1)){i.push(s);for(var a=0;a<o.replyComments.length;a++)o.replyComments[a].commentStart&&i.push(o.replyComments[a].commentStart)}}return{commentStartInfo:i,commentEndInfo:t}},c.prototype.singleBackspace=function(e,t){var i=this.editorHistory;if(i&&!t&&!i.canRedo()&&i.canUndo()){var n=i.undoStack[i.undoStack.length-1],o=this.selection.getParagraphInfo(e.start),r=this.selection.getParagraphInfo(e.end);if("AutoFormatHyperlink"===n.action&&n.insertPosition===this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString())&&n.endPosition===this.selection.getHierarchicalIndex(r.paragraph,r.offset.toString()))return void i.undo()}for(var s,a=e.start.paragraph,o=e.start.currentWidget,l=e.start.offset,n=o.getInline(l,0),h=n.element,d=!1,p=l,c=!1;h instanceof Khi;){var u=h;if(je(h=h.previousNode)&&(h=s),je(h)||0!=h.commentType?h instanceof lhi&&(h=void 0):s=h.previousNode,h&&(p=h.length),!(0!==u.commentType||!je(h)&&h instanceof Khi)){p=je(h)?(h=u,0):h.length,c=!0;break}1===u.commentType&&(d||(this.initComplexHistory("RemoveComment"),d=!0),this.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.deleteCommentInternal(u.comment),c=!(this.isSkipOperationsBuild=!1))}if(je(h)||!h.characterFormat.hidden){if(c&&(je(h)?(S=a.childWidgets[0],e.start.setPositionParagraph(S,0),e.end.setPositionParagraph(S,0)):(a=h.line.paragraph,l=h.line.getOffset(h,p),e.start.setPositionParagraph(h.line,l),e.end.setPositionParagraph(h.line,l))),h instanceof Pli){var g=this.selection.currentContentControl;if(this.selection.selectContentControlInternal(g),!je(g)&&1===h.type&&g.contentControlProperties.lockContentControl||je(h.nextElement)){if(!this.selection.isEmpty)return;this.onBackSpace()}if(!je(g)&&0===h.type&&h.nextElement!==g.reference||!je(g)&&0===h.type&&(g.contentControlProperties.lockContentControl||this.documentHelper.isFormFillProtectedMode)&&h.nextElement===g.reference)return}if(this.selection.isInlineFormFillMode()){if(h instanceof Zai&&2===h.fieldType)return;if(1===this.getFieldResultText().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(n.index,h instanceof pli&&(h.ignoreOnceItems=[]),h instanceof pli&&(h.ignoreOnceItems=[]),h instanceof Zai&&2===h.fieldType)if(Y.isLinkedFieldCharacter(h))return T=h.fieldBegin,m=h.fieldEnd,T.nextNode instanceof Dli&&T.nextNode.reference&&(m=T.nextNode.reference),e.start.setPositionParagraph(T.line,T.line.getOffset(T,0)),e.end.setPositionParagraph(m.line,m.line.getOffset(m,0)+1),void e.fireSelectionChanged(!0);if(!this.owner.enableTrackChanges&&h instanceof fli&&("Footnote"===h.footnoteType?this.removeFootnote(h):this.removeEndnote(h)),h&&(h instanceof Pli||h.previousNode instanceof Pli)&&(h instanceof Pli&&h.previousNode&&!(h.previousElement instanceof lhi)&&(a=(h=h.previousNode).line.paragraph,l=h.line.getOffset(h,h.length)),h)&&1===h.length&&h.nextNode instanceof Pli&&h.previousNode instanceof Pli&&!this.documentHelper.isFormFillProtectedMode){var r=h.previousNode,m=h.nextNode;if(!r.contentControlProperties.lockContentControl)return e.start.setPositionParagraph(r.line,r.line.getOffset(r,0)),e.end.setPositionParagraph(m.line,m.line.getOffset(m,0)+1),void this.removeWholeElement(e)}if(h instanceof Zai&&1===h.fieldType&&!this.selection.isInlineFormFillMode()){i=e.getPreviousValidElement(h);if(i instanceof Zai&&0!==i.fieldType)return a=(h=i.fieldBegin).line.paragraph,l=h.line.getOffset(h,0),h.nextNode instanceof Dli&&h.nextNode.reference&&(o=h.nextNode.reference,e.start.setPositionParagraph(o.line,o.line.getOffset(o,1))),e.end.setPositionParagraph(h.line,l),void e.fireSelectionChanged(!0);i!==h&&(a=(h=i).line.paragraph,l=h.line.getOffset(h,h.length))}if(h instanceof ghi||h instanceof phi){if(h.nextNode instanceof phi&&h.editRangeEnd===h.nextNode||h.previousNode instanceof ghi&&h.editRangeStart===h.previousNode)return;if(h instanceof ghi&&!(h.previousNode instanceof phi))return;if(this.documentHelper.isDocumentProtected&&"ReadOnly"===this.documentHelper.protectionType&&(h instanceof ghi||h instanceof phi))return;if(h instanceof phi)for(;!je(h.previousNode)&&(a=(h=h.previousNode).line.paragraph,l=h.line.getOffset(h,h.length),h instanceof phi););if(1===h.length&&h.nextNode instanceof phi&&h.previousNode instanceof ghi)return n=h.previousNode,m=h.nextNode,e.start.setPositionParagraph(n.line,n.line.getOffset(n,0)),e.end.setPositionParagraph(m.line,m.line.getOffset(m,0)+1),void this.removeWholeElement(e)}if(h&&(h instanceof Dli||h.previousNode instanceof Dli)){if(this.documentHelper.isDocumentProtected&&"ReadOnly"===this.documentHelper.protectionType&&(h.previousNode&&h.previousNode instanceof ghi||h.previousNode instanceof phi))return;if(h instanceof Dli)if(h.previousNode){if((h=h.previousNode)instanceof Zai&&!this.selection.isInlineFormFillMode())return a=(h=h.fieldBegin).line.paragraph,l=h.line.getOffset(h,0),h.nextNode instanceof Dli&&h.nextNode.reference&&(r=h.nextNode.reference,e.start.setPositionParagraph(r.line,r.line.getOffset(r,1))),e.end.setPositionParagraph(h.line,l),void e.fireSelectionChanged(!0);a=h.line.paragraph,l=h.line.getOffset(h,h.length),e.start.setPositionFromLine(h.line,l),e.end.setPositionInternal(e.start)}else if(1===h.bookmarkType){if(a.previousRenderedWidget instanceof Lai)return o=(f=a.previousRenderedWidget).lastChild,e.start.setPositionParagraph(h.line,h.line.getOffset(h,0)),e.end.setPositionParagraph(o,o.getEndOffset()),void this.removeWholeElement(e)}else{if(!(h.paragraph.previousWidget instanceof Lai))return;e.start.setPositionFromLine(h.line,0),e.end.setPositionInternal(e.start),l=0}else if(h.nextNode instanceof Dli&&h instanceof Dli&&0===h.bookmarkType&&h.reference===h.nextNode)return void this.deleteBookmark(h.name);if(1===h.length&&h.nextNode instanceof Dli&&h.previousNode instanceof Dli)return T=h.previousNode,m=h.nextNode,e.start.setPositionParagraph(T.line,T.line.getOffset(T,0)),e.end.setPositionParagraph(m.line,m.line.getOffset(m,0)+1),void this.removeWholeElement(e)}if(t||this.initHistory("BackSpace"),l===e.getStartOffset(a)&&e.start.currentWidget.isFirstLine()){if(a.paragraphFormat.listFormat&&-1!==a.paragraphFormat.listFormat.listId)return void(!je(this.editorHistory)&&!je(this.editorHistory.undoStack)&&0<this.editorHistory.undoStack.length&&"ListFormat"===this.editorHistory.undoStack[this.editorHistory.undoStack.length-1].action?this.onApplyListInternal(this.documentHelper.getListById(a.paragraphFormat.listFormat.listId),a.paragraphFormat.listFormat.listLevelNumber-1):this.onApplyList(void 0));if(0!==a.paragraphFormat.firstLineIndent)return this.onApplyParagraphFormat("firstLineIndent",0,!1,!1),void(0!==a.paragraphFormat.leftIndent&&this.onApplyParagraphFormat("leftIndent",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 Lai){var f,y=a.previousRenderedWidget;if(y.characterFormat.hidden)return;if(e.owner.isShiftingEnabled=!0,this.owner.enableTrackChanges&&null!=a.previousRenderedWidget&&0==a.previousRenderedWidget.characterFormat.revisions.length){i=y.characterFormat.cloneFormat();b=(v=(this.checkToMatchEmptyParaMarkBack(y)||this.insertRevision(y.characterFormat,"Deletion"),this.documentHelper.selection.getLineLength(y.lastChild)),y.childWidgets.length-1),this.documentHelper.layout.reLayoutParagraph(y,b,0),e.selects(y.childWidgets[b],v,!0),this.addRemovedNodes(i)}else if(y.isEmpty()&&!this.owner.enableTrackChanges)this.removePrevParaMarkRevision(a),a!==a.bodyWidget.lastChild||y.bodyWidget.index===a.bodyWidget.index?(this.removeBlock(y),this.addRemovedNodes(y),(!je(f=a.previousRenderedWidget)&&f instanceof Lai&&f.isEmpty()&&f.bodyWidget.index!==a.bodyWidget.index||y.isSectionBreak)&&e.moveToPreviousCharacter()):(v=this.documentHelper.selection.getLineLength(y.lastChild),b=y.childWidgets.length-1,e.selects(y.childWidgets[b],v,!0));else if(this.owner.enableTrackChanges&&null!=y.characterFormat.revisions&&"Deletion"==y.characterFormat.revisions[0].revisionType){var v=this.documentHelper.selection.getLineLength(y.lastChild),b=y.childWidgets.length-1;this.documentHelper.layout.reLayoutParagraph(y,b,0),e.selects(y.childWidgets[b],v,!0),this.addRemovedNodes(a)}else if(this.owner.enableTrackChanges&&null!=y.characterFormat.revisions&&e.start.isAtParagraphStart&&y.isEmpty())this.addRemovedRevisionInfo(y.characterFormat,void 0,!1),this.addRemovedNodes(y),this.removePrevParaMarkRevision(a),this.removeBlock(y,!1,!0);else{n=!1;if(!(a===a.bodyWidget.lastChild&&y.bodyWidget.index!==a.bodyWidget.index||"NoBreak"===a.bodyWidget.sectionFormat.breakCode&&a===a.bodyWidget.firstChild)){if(0<a.characterFormat.revisions.length&&0<y.characterFormat.revisions.length&&"Insertion"==a.characterFormat.revisions[0].revisionType)this.addRemovedRevisionInfo(a.characterFormat,void 0,!1),this.removePrevParaMarkRevision(a,!0);else{this.removePrevParaMarkRevision(a,!1,!0);for(var w=0;w<a.characterFormat.revisions.length;w++){var C=a.characterFormat.revisions[w];-1!==C.range.indexOf(a.characterFormat)&&(A=C.range.indexOf(a.characterFormat),C.range.splice(A,1,y.characterFormat)),y.characterFormat.revisions.push(C)}}this.removeBlock(a,!1,!0),n=!0}var v=this.documentHelper.selection.getLineLength(y.lastChild),b=y.childWidgets.length-1,S=void 0;if(!a.isEmpty()&&n)for(w=0;w<a.childWidgets.length;w++){S=a.childWidgets[w],y.childWidgets.push(S);for(var A,x,I=0;I<S.children.length;I++)S.children[I]instanceof fli&&-1===(A=this.documentHelper.footnoteCollection.indexOf(S.children[I]))&&(S.children[I].isLayout=!1,x=parseInt(S.children[I].text),this.documentHelper.footnoteCollection.splice(x-1,0,S.children[I]));a.childWidgets.splice(w,1),w--,S.paragraph=y}this.documentHelper.layout.reLayoutParagraph(y,b,0),e.selects(y.childWidgets[b],v,!0),n&&this.addRemovedNodes(a)}this.setPositionForHistory(),0<this.documentHelper.layout.getFootNoteWidgetsOf(a).length&&(r=this.documentHelper.layout,o=a.bodyWidget,r.layoutfootNote(o.page.footnoteWidget)),this.reLayout(e)}else this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo=void 0)}else{t||(e.owner.isShiftingEnabled=!0);var T=this.selection.getParagraphInfo(e.start),S=e.start.currentWidget,m=l-1;m<0&&(S=S.previousLine,m=this.documentHelper.selection.getLineLength(S)+m),this.removeAtOffset(S,e,m),!je(g=this.selection.currentContentControl)&&g.contentControlProperties.isTemporary&&this.removeContentControl(),this.setPositionParagraph(T.paragraph,T.offset-1,!1),this.setPositionForHistory(),t?this.fireContentChange():this.reLayout(e)}d&&this.editorHistory&&this.editorHistory.currentHistoryInfo&&(this.editorHistory.currentHistoryInfo.endPosition=this.selection.startOffset,this.editorHistory.updateComplexHistory())}},c.prototype.setPositionForHistory=function(e){var t=this.documentHelper.selection;this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&(je(e)?(this.updateHistoryPosition(t.start,!0),this.editorHistory.currentBaseHistoryInfo.endPosition=this.editorHistory.currentBaseHistoryInfo.insertPosition):(this.editorHistory.currentBaseHistoryInfo.insertPosition=e,this.editorHistory.currentBaseHistoryInfo.endPosition=e))},c.prototype.removeAtOffset=function(e,t,i){for(var n=0,o=e.paragraph.childWidgets.indexOf(e),r=e.children.length,s=0;s<r;s++){var a=e.children[s];if(!(a instanceof lhi)){if(this.removeCharacter(a,i,n,e,o,s))break;n+=a.length}}},c.prototype.removeCharacter=function(e,t,i,n,o,r,s){var a,l,h,d=!1;return e instanceof Dli&&e.reference&&e.line!==e.reference.line&&!(n.children[r]instanceof Dli)?(je(e.line.previousLine)?je(e.line.paragraph.previousRenderedWidget)?je(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),n.children.splice(r,1),!je(n.layoutedElements)&&0<n.layoutedElements.length&&n.layoutedElements.splice(r,1),!0):(t<i+e.length&&(a=t-i,e.ischangeDetected=!0,this.owner.isSpellCheck&&(h=e.nextElement,l=e.previousElement,this.owner.spellCheckerModule.removeErrorsFromCollection({element:e,text:e.text}),!je(h)&&h instanceof pli&&(h.ischangeDetected=!0,this.owner.spellCheckerModule.removeErrorsFromCollection({element:h,text:h.text})),!je(l)&&l instanceof pli&&(l.ischangeDetected=!0,this.owner.spellCheckerModule.removeErrorsFromCollection({element:l,text:l.text})),e.canTrigger||(this.documentHelper.triggerSpellCheck=!1)),t===i&&1===e.length?(this.owner.enableTrackChanges&&!this.skipTracking()?(this.addRemovedNodes(e.clone()),this.handleDeleteTracking(e,a,1,r)):(this.unLinkFieldCharacter(e),this.unlinkRangeFromRevision(e,!0),this.addRemovedRevisionInfo(e,void 0),this.addRemovedNodes(e),this.owner.enableTrackChanges&&this.editorHistory.isRedoing&&e instanceof fli&&("Footnote"===e.footnoteType?this.removeFootnote(e):this.removeEndnote(e)),n.children.splice(r,1),!je(n.layoutedElements)&&0<n.layoutedElements.length&&(n.layoutedElements.splice(r,1),0===n.layoutedElements.length)&&(n.layoutedElements=void 0)),this.documentHelper.layout.reLayoutParagraph(n.paragraph,o,r,void 0,s)):(h=this.handleDeleteTracking(e,a,1),this.documentHelper.layout.reLayoutParagraph(n.paragraph,o,r,void 0,s),je(h)||(0<e.revisions.length&&this.addRemovedRevisionInfo(e,h),this.addRemovedNodes(h))),e instanceof ghi&&(this.selection.skipEditRangeRetrieval=!0,this.removeUserRestrictionsInternal(e,void 0,!0),this.selection.updateEditRangeCollection(),this.fireContentChange(),this.selection.skipEditRangeRetrieval=!1),e instanceof Dli&&0===e.bookmarkType&&this.documentHelper.bookmarks.containsKey(e.name)&&this.documentHelper.bookmarks.remove(e.name),d=!0),d)},c.prototype.removeCharacterInLine=function(e,t,i){var n,o=new pli;return e instanceof pli&&(e.isWidthUpdated=!1,o.characterFormat.copyFormat(e.characterFormat),o.text=e.text.substr(t,i=1===i?1:i-t),n=e.text,e.text=n.substring(0,t)+n.substring(t+i,n.length),e.contentControlProperties)&&(o.contentControlProperties=e.contentControlProperties.clone()),o},c.prototype.removeRevisionsInformation=function(e,t,i,n){var o=e.previousElement;"Insertion"===this.retrieveRevisionInOder(o).revisionType&&this.isRevisionMatched(o,void 0)&&e.line.children.splice(n,1)},c.prototype.handleDeleteTracking=function(e,t,i,n,o,r,s){var a=this.owner.enableTrackChanges,l=(je(this.editorHistory)||this.editorHistory.isUndoing||this.editorHistory.isRedoing,void 0);if(this.canHandleDeletion()||a&&(!this.skipTracking()||e.paragraph.isInsideTable&&!je(this.editorHistory)&&this.editorHistory.isRedoing&&this.editorHistory.currentBaseHistoryInfo&&"RemoveRowTrack"===this.editorHistory.currentBaseHistoryInfo.action)){if(e instanceof Dli||e instanceof Khi||e instanceof ghi||e instanceof phi){if(e instanceof Dli&&e.previousElement instanceof Zai&&e.previousElement.formFieldData)0<e.previousElement.revisions.length&&this.removeRevisionsInformation(e,t,i,n);else if(a&&e instanceof Dli)this.checkToCombineRevisionsInSides(e,"Deletion")||this.insertRevision(e,"Deletion"),this.updateLastElementRevision(e);else if(e instanceof Khi){for(var h=!1,d=0;d<this.owner.documentHelper.comments.length;d++)e.commentId===this.owner.documentHelper.comments[d].commentId&&(h=!0);h||e.line.children.splice(e.indexInOwner,1)}else e.line.children.splice(e.indexInOwner,1);return}a=!1;if(this.owner.editorHistoryModule&&(a=!je(this.owner.editorHistoryModule.currentBaseHistoryInfo)&&"Delete"===this.owner.editorHistoryModule.currentBaseHistoryInfo.action),this.skipTableElements||this.updateEndRevisionIndex(),0<e.revisions.length){var p,c,u=this.retrieveRevisionInOder(e),g=this.owner.revisions.changes.indexOf(u);if(je(this.owner.editorHistoryModule)||je(this.owner.editorHistoryModule.currentBaseHistoryInfo)||o||(o=je(n)?t:0,f=je(n)?1===i?1:i-t:e.length,this.owner.editorHistoryModule.currentBaseHistoryInfo.recordInsertRevisionDeletetion(e,o,f)),"Insertion"===u.revisionType)if(this.isRevisionMatched(e,void 0))je(n)?(l=this.removeCharacterInLine(e,t,i),je(o=e.revisions[0])||this.owner.trackChangesPane.updateCurrentTrackChanges(o)):(f=u.range.indexOf(e),u.range.splice(f,1),this.owner.trackChangesPane.updateCurrentTrackChanges(u),0===u.range.length&&this.owner.revisionsInternal.remove(u),this.unLinkFieldCharacter(e),e.line.children.splice(n,1),!je(e.line.layoutedElements)&&0<e.line.layoutedElements.length&&-1!==e.line.layoutedElements.indexOf(e)&&e.line.layoutedElements.splice(n,1),0===e.line.children.length&&(e.line.layoutedElements=void 0)),e instanceof fli&&("Footnote"===e.footnoteType?this.removeFootnote(e):this.removeEndnote(e));else if(je(n)){var m=this.removeCharacterInLine(e,t,i),o=e.revisions[0];if(je(o)||this.owner.trackChangesPane.updateCurrentTrackChanges(o),0===t){var f=e.previousElement;this.handleDeletionForInsertRevision(f,e,m,i,t,!0)}else if(e.length!==t)for(d=e.revisions.length-1;0<=d;d--){var y=e.revisions[d],v=y.range.indexOf(e),b=new pli,v=(b.characterFormat.copyFormat(e.characterFormat),b.line=e.line,b.text=e.text.substr(t),b.revisions.splice(0,0,y),y.range.splice(v+1,0,b),m.revisions.splice(0,0,y),m.line=e.line,m.isWidthUpdated=!1,y.range.splice(v+1,0,m),this.owner.trackChangesPane.updateCurrentTrackChanges(y),e.text=e.text.substr(0,t),e.isWidthUpdated=!1,e.indexInOwner);e.line.children.splice(v+1,0,b),e.line.children.splice(v+1,0,m),this.addRemovedNodes(m.clone()),this.insertRevision(m,"Deletion"),this.updateLastElementRevision(m)}else e.length===t?(o=e.nextElement,this.handleDeletionForInsertRevision(o,e,m,i,t,!1)):(1===i?a||(this.selection.start.movePreviousPosition(),this.selection.end.setPositionInternal(this.selection.start)):this.updateCursorForInsertRevision(e,t,i),this.addRemovedNodes(m.clone()),this.insertInlineInternal(m,"Deletion"))}else this.checkToCombineRevisionsInSides(e,"Deletion")||this.insertRevision(e,"Deletion"),this.updateLastElementRevision(e);else"Deletion"===u.revisionType&&(-1!==g&&u.author!==this.owner.currentUser&&0<u.range.length&&(o=(f=u.range)[0]instanceof Eri||f[0]instanceof Cri?0:f[0].line.getOffset(f[0],0),p=!1,c=void 0,0===t&&i>=this.selection.getLineLength(e.line)||t+1===i&&e instanceof pli&&1===e.length?(f.splice(f.indexOf(e),1),this.owner.trackChangesPane.updateCurrentTrackChanges(u),e.revisions.splice(e.revisions.indexOf(u),1),(c=!je(e.nextNode)&&0<e.nextNode.revisions.length?this.getMatchedRevisionsToCombine(e.nextNode.revisions,"Deletion"):c)&&0===c.length&&e.previousNode instanceof pli&&0<e.previousNode.revisions.length&&this.updateRevisionForSpittedTextElement(e.previousNode,void 0),this.checkToCombineRevisionsInSides(e,"Deletion")?this.combineElementRevision(e.revisions,e.revisions):(this.insertRevision(e,"Deletion"),p=!0,this.updateLastElementRevision(e)),p&&e.line.getOffset(e,0)===o&&-1!==this.owner.revisions.changes.indexOf(u)&&0===u.range.length&&this.owner.revisions.changes.splice(g,1)):1!==i&&(this.handleDeleteBySplitting(e,t,i),0<(e=(f=this.selection.start.currentWidget.getInline(this.selection.start.offset,0).element)?f:e).revisions.length)&&e.nextNode instanceof Xai&&0<e.nextNode.revisions.length&&this.combineElementRevision(e.revisions,e.nextNode.revisions)),1===i?(a?this.selection.start.moveNextPosition():this.selection.start.movePreviousPosition(),this.selection.end.setPositionInternal(this.selection.start)):this.isRevisionMatched(e,"Deletion")?this.updateCursorForInsertRevision(e,t,i):(c=u.range.indexOf(e),i<=e.line.getOffset(e,e.length)&&u.range.length>c+1?(this.updateRevisionForSpittedTextElement(e,u.range[c+1]),u.range.splice(u.range.indexOf(e),1),this.toCombineOrInsertRevision(e,"Deletion"),this.owner.trackChangesPane.updateCurrentTrackChanges(u)):1===u.range.length||0===t?(this.handleDeleteBySplitting(e,t,i),0<c&&1!==u.range.length&&(this.updateRevisionForSpittedTextElement(u.range[c-1],u.range[c]),(u=this.retrieveRevisionInOder(e)).range.splice(u.range.indexOf(e),1))):(u.range.splice(u.range.indexOf(e),1),this.toCombineOrInsertRevision(e,"Deletion"))),this.updateLastElementRevision(e))}else je(n)?this.handleDeleteBySplitting(e,t,i):(this.checkToCombineRevisionsInSides(e,"Deletion")||this.insertRevision(e,"Deletion"),this.skipFootNoteDeleteTracking||this.updateLastElementRevision(e))}else l=this.removeCharacterInLine(e,t,i),je(u=e.revisions[0])||this.owner.trackChangesPane.updateCurrentTrackChanges(u);return l},c.prototype.toCombineOrInsertRevision=function(e,t){this.checkToCombineRevisionsInSides(e,t)?this.combineElementRevision(e.revisions,e.revisions):(this.insertRevision(e,t),this.updateLastElementRevision(e))},c.prototype.updateLastElementRevision=function(e){this.skipTableElements||!this.editorHistory||!this.editorHistory.currentBaseHistoryInfo||this.skipReplace||!je(this.owner.searchModule)&&this.owner.searchModule.isRepalceTracking||(je(this.editorHistory.currentBaseHistoryInfo.lastElementRevision)&&(this.editorHistory.currentBaseHistoryInfo.lastElementRevision=e),e.isMarkedForRevision=!0)},c.prototype.updateEndRevisionIndex=function(){if(!je(this.editorHistory.undoStack)&&0<this.editorHistory.undoStack.length)for(var e=this.editorHistory.undoStack.length-1;0<=e;e--){var t=this.editorHistory.undoStack[e];if(t.lastElementRevision&&je(t.endRevisionLogicalIndex)){t.updateEndRevisionInfo();break}}},c.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]},c.prototype.handleDeletionForInsertRevision=function(e,t,i,n,o,r){var s;!je(e)&&0===t.revisions.length&&this.isRevisionMatched(e,"Deletion")?(this.addRemovedNodes(i.clone()),this.insertTextInline(e,this.selection,i.text,0)):(s=(e=t.revisions[t.revisions.length-1]).range.indexOf(t),e.range.splice(r?s:s+1,0,i),this.owner.trackChangesPane.updateCurrentTrackChanges(e),i.revisions.splice(0,0,e),r=!1,this.owner.editorHistoryModule&&(r=!je(this.owner.editorHistoryModule.currentBaseHistoryInfo)&&"Delete"===this.owner.editorHistoryModule.currentBaseHistoryInfo.action),1===n&&this.selection.isEmpty?r||(this.selection.start.movePreviousPosition(),this.selection.end.setPositionInternal(this.selection.start)):this.updateCursorForInsertRevision(t,o,n),this.addRemovedNodes(i.clone()),this.insertInlineInternal(i,"Deletion"))},c.prototype.handleDeleteBySplitting=function(e,t,i){var n,o=!1,r=(this.owner.editorHistoryModule&&(o=!je(this.owner.editorHistoryModule.currentBaseHistoryInfo)&&"Delete"===this.owner.editorHistoryModule.currentBaseHistoryInfo.action),1===i&&this.selection.isEmpty?0<(r=e.line.getOffset(e,0))?((s=new rci(this.owner)).setPositionForLineWidget(e.line,r+t),this.selection.start.setPositionInternal(s),this.selection.end.setPositionInternal(this.selection.start)):o||(this.selection.start.movePreviousPosition(),this.selection.end.setPositionInternal(this.selection.start)):this.updateCursorForInsertRevision(e,t,i),!1),s=(0<e.revisions.length&&e.length-1===t?!je(e.nextNode)&&0<e.nextNode.revisions.length&&!je(e.nextNode)&&0<e.nextNode.revisions.length&&(je(n=this.getMatchedRevisionsToCombine(e.nextNode.revisions,"Deletion"))||0!==n.length||(r=!0)):0<e.revisions.length&&(je(n=this.getMatchedRevisionsToCombine(e.revisions,"Deletion"))||0!==n.length||(r=!0)),this.removeCharacterInLine(e,t,i)),o=e.revisions[0];je(o)||this.owner.trackChangesPane.updateCurrentTrackChanges(o),0<e.revisions.length&&(s.removedIds=Ari.cloneRevisions(e.revisions)),this.addRemovedNodes(s.clone()),""!==s.text||this.owner.enableTrackChanges&&!this.skipTracking()?""!==s.text&&this.insertTextInternal(s.text,!1,"Deletion",!1,r):this.deleteParagraphMark(e.paragraph,this.selection,0,!0)},c.prototype.updateCursorForInsertRevision=function(e,t,i){var n=e.line.getOffset(e,0),n=(0<n&&(t=n+t,i=n+i),new rci(this.owner)),t=(n.setPositionFromLine(e.line,t),new rci(this.owner));t.setPositionFromLine(e.line,i),n.isExistBefore(t)?(this.selection.end.setPositionInternal(n),this.selection.start.setPositionInternal(n)):(this.selection.start.setPositionInternal(t),this.selection.end.setPositionInternal(t))},c.prototype.checkToCombineRevisionsInSides=function(e,t){var i,n=e.previousNode,o=e.nextNode,r=!1;return je(n)||je(n=n instanceof Dli?n:n.previousValidNodeForTracking)||0<(i=this.getMatchedRevisionsToCombine(n.revisions,t)).length&&(this.mapMatchedRevisions(i,n,e,!1),r=!0),je(o)||je(o=o instanceof Dli?o:o.nextValidNodeForTracking)||0<(i=this.getMatchedRevisionsToCombine(o.revisions,t)).length&&(r?this.combineElementRevision(e.revisions,o.revisions):this.mapMatchedRevisions(i,o,e,!0),r=!0),r},c.prototype.delete=function(){this.removeEditRange=!0;var e=this.documentHelper.selection;if(!e.isEmpty&&0<e.bookmarks.length&&this.extendSelectionToBookmarkStart(),e.isEmpty)this.singleDelete(e,!1);else{var t=this.checkAndRemoveComments(),i=(this.initHistory("Delete"),void 0),i=e.isForward?e.end:e.start,i=this.selection.getParagraphInfo(i),n=(this.deleteSelectedContentInternal(e,!1,e.start,e.end),new rci(e.owner)),o=this.selection.getHierarchicalIndex(i.paragraph,i.offset.toString());if(!this.owner.enableTrackChanges||this.skipTracking()||this.isInsertingTOC||-1===i.paragraph.indexInOwner||(e.editPosition=o),this.setPositionForCurrentIndex(n,e.editPosition),e.selectContent(n,!0),this.reLayout(e),this.insertSpaceInFormField(),this.editorHistory&&!je(this.editorHistory.currentHistoryInfo)&&"RemoveComment"===this.editorHistory.currentHistoryInfo.action){for(var r=0;r<t.length;r++)this.initInsertInline(t[r],!1);this.editorHistory.currentHistoryInfo.endPosition=this.selection.startOffset,this.editorHistory.updateComplexHistory()}}this.removeEditRange=!1,this.documentHelper.layout.islayoutFootnote=!1,this.updateXmlMappedContentControl()},c.prototype.deleteEditElement=function(e){this.initHistory("Delete"),this.deleteSelectedContentInternal(e,!1,e.start,e.end);var t=new rci(e.owner);this.setPositionForCurrentIndex(t,e.editPosition),e.selectContent(t,!0),this.reLayout(e)},c.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)},c.prototype.singleDelete=function(e,t){var i=e.start.currentWidget,n=e.start.paragraph,o=e.start.offset,r=0,i=i.getInline(e.start.offset,r),s=i.element;if(!n.characterFormat.hidden){if(this.selection.isInlineFormFillMode()){if(s instanceof Zai&&1===s.fieldType)return;var a=this.getFieldResultText();if(s instanceof pli||(s=s.nextElement),1===a.length&&s instanceof pli)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(s instanceof Zai&&1===s.fieldType)return}if(r=i.index,n.paragraphFormat.listFormat&&-1!==n.paragraphFormat.listFormat.listId&&this.documentHelper.isListTextSelected&&"List"===e.contextType)this.onApplyList(void 0);else{if(!je(s)&&r===s.length&&!je(s.nextNode)){if((s=s.nextNode)instanceof Zai&&1===s.fieldType&&!je(s.fieldBegin.formFieldData))return;if(s instanceof fli)return;r=0}for(var a=s instanceof Khi;s instanceof Khi;){if(!s.nextNode){r=1;break}s=s.nextNode,r=0}if(a&&(n=s.line.paragraph,o=s.line.getOffset(s,r),e.start.setPositionParagraph(s.line,o),e.end.setPositionParagraph(s.line,o)),!this.owner.enableTrackChanges&&s instanceof fli&&("Footnote"===s.footnoteType?this.removeFootnote(s):this.removeEndnote(s)),!je(s)){var a=void 0,l=this.documentHelper.getNextValidElement(s);if(s.characterFormat.hidden)return;if(!je(a=l instanceof Xai?l:a)&&a instanceof Zai&&0===a.fieldType)return n=(s=a.fieldEnd).line.paragraph,o=s.line.getOffset(s,1),e.end.setPositionParagraph(s.line,o),s.nextNode instanceof Dli&&(l=s.nextNode,e.end.setPositionParagraph(l.line,l.line.getOffset(l,1))),void e.fireSelectionChanged(!0);s!==a&&(n=(s=a).line.paragraph,o=s.line.getOffset(s,0),s instanceof Zai)&&1===s.fieldType&&o++}if(s instanceof ghi||s instanceof phi){if(s.nextNode instanceof phi&&s.editRangeEnd===s.nextNode||s.previousNode instanceof ghi&&s.editRangeStart===s.previousNode)return;if(this.documentHelper.isDocumentProtected&&"ReadOnly"===this.documentHelper.protectionType){if(s instanceof ghi||s instanceof phi)return}else s instanceof ghi?(o=(s=s.nextNode).line.getOffset(s,0),n=s.line.paragraph):s instanceof phi&&o++;if(1===s.length&&s.nextNode instanceof phi&&s.previousNode instanceof ghi)return l=s.previousNode,a=s.nextNode,e.start.setPositionParagraph(l.line,l.line.getOffset(l,0)),e.end.setPositionParagraph(a.line,a.line.getOffset(a,0)+1),void this.deleteEditElement(e)}if(s&&(s instanceof Pli||s.nextNode instanceof Pli)){if(s instanceof Pli&&s.nextNode)return n=(s=s.nextNode).line.paragraph,o=s.line.getOffset(s,0),e.start.setPositionParagraph(s.line,o),void e.end.setPositionParagraph(s.line,o);if(s&&1===s.length&&s.nextNode instanceof Pli&&s.previousNode instanceof Pli&&this.removeContentControlMark(s.previousNode,s.nextNode))return;if(s instanceof Pli&&s.previousNode instanceof Pli&&s.previousNode.reference===s&&!this.documentHelper.isFormFillProtectedMode&&this.removeContentControlMark(s.previousNode,s))return}if(s&&(s instanceof Dli&&0===s.bookmarkType||s.nextNode instanceof Dli)){if(s.nextNode&&s instanceof Dli&&(n=(s=s.nextNode).line.paragraph,o=s.line.getOffset(s,0),e.start.setPositionParagraph(s.line,o),e.end.setPositionParagraph(s.line,o)),1===s.length&&s.nextNode instanceof Dli&&s.previousNode instanceof Dli)return l=s.previousNode,a=s.nextNode,e.start.setPositionParagraph(l.line,l.line.getOffset(l,0)),e.end.setPositionParagraph(a.line,a.line.getOffset(a,0)+1),void this.deleteEditElement(e);s instanceof Dli&&(o=s.line.getOffset(s,1))}if(e.start.currentWidget.isLastLine()&&o>=this.documentHelper.selection.getLineLength(e.start.currentWidget)){if(n.isInsideTable&&je(n.nextWidget))return;l=void 0,a=e.getNextParagraphBlock(n);if(!je(a)){if(a.isEmpty()&&a.characterFormat.hidden)return;var h=a.firstChild;if(!je(h)){var h=h.children[0];if(!je(h)&&h.characterFormat.hidden)return}}if(je(a)){if(0<o)return;if(n.previousWidget instanceof Lai&&(l=n.previousWidget),n.previousWidget instanceof Pai)return;if(n.previousWidget instanceof _ai)return;if(je(l)||n.isEmpty()&&0<l.characterFormat.revisions.length)return}t||this.initHistory("Delete"),(n.isEndsWithPageBreak||n.isEndsWithColumnBreak)&&(o=(h=n.lastChild).children[h.children.length-1],this.selection.start.setPositionForSelection(h,o,0,this.selection.start.location));var d,h=this.selection.getParagraphInfo(e.start);e.editPosition=this.selection.getHierarchicalIndex(h.paragraph,h.offset.toString()),this.checkInsertPosition(e)&&this.setPositionForHistory(e.editPosition),e.owner.isShiftingEnabled=!0,n.isEmpty()?(this.removePrevParaMarkRevision(n,!0),!je(o=e.getNextParagraphBlock(n))&&o instanceof Lai&&o.bodyWidget.index!==n.bodyWidget.index&&(this.deleteSection(e,n.bodyWidget,o.bodyWidget,0),this.editorHistory.currentBaseHistoryInfo.type="SectionBreak"),this.removeBlock(n,!1,!0),this.addRemovedNodes(n),je(a)?je(l)?(h=e.getParagraphLength(void 0)+1,this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&(this.updateHistoryPosition(e.start,!0),this.editorHistory.currentBaseHistoryInfo.endPosition=this.selection.getHierarchicalIndex(void 0,h.toString()))):(e.selectParagraphInternal(l,!1),this.setPositionForHistory()):e.selectParagraphInternal(a,!0)):this.owner.enableTrackChanges&&n.nextRenderedWidget instanceof Lai?(h=(o=n.nextRenderedWidget).childWidgets.length-1,n=n.combineWidget(this.owner.viewer),d=this.splitParagraph(n,n.firstChild,0,e.start.currentWidget,e.start.offset,!0),null!=n&&0!=n.characterFormat.revisions.length&&"Insertion"==n.characterFormat.revisions[0].revisionType?(this.removePrevParaMarkRevision(n,!0),this.deleteParagraphMark(d,e,0),this.addRemovedNodes(n),this.setPositionForCurrentIndex(e.start,e.editPosition),e.selectContent(e.start,!0)):(this.removePrevParaMarkRevision(n,!0),this.deleteParagraphMark(d,e,0,!0),this.addRemovedNodes(n.characterFormat),this.setPositionForCurrentIndex(e.start,e.editPosition),e.selects(o.childWidgets[h],0,!0))):(n=n.combineWidget(this.owner.viewer),d=this.splitParagraph(n,n.firstChild,0,e.start.currentWidget,e.start.offset,!0),this.removePrevParaMarkRevision(n,!0),this.deleteParagraphMark(d,e,0),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&"SectionBreak"===this.editorHistory.currentBaseHistoryInfo.type&&this.addRemovedNodes(n),this.setPositionForCurrentIndex(e.start,e.editPosition),e.selectContent(e.start,!0)),this.reLayout(e)}else{l=i.element;if(l instanceof Pli){a=this.selection.currentContentControl;if(this.selection.selectContentControlInternal(a),!je(a)&&1===l.type&&a.contentControlProperties.lockContentControl&&je(l.nextElement)){if(!this.selection.isEmpty)return;this.delete()}if(!je(a)&&0===l.type&&l.nextElement!==a.reference||!je(a)&&0===l.type&&a.contentControlProperties.lockContentControl&&l.nextElement===a.reference)return}else this.singleDeleteInternal(e,t,n)}e.start.currentWidget.getInline(e.start.offset+1,0).element instanceof Dli&&(e.start.offset++,e.end.offset++)}}},c.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),o=e.start.currentWidget,r=e.start.offset,s=e.getLineLength(e.start.currentWidget);s<=r&&(o=o.nextLine,r-=s),this.removeAtOffset(o,e,r),(!this.owner.enableTrackChanges||je(this.editorHistory)||!this.editorHistory.currentBaseHistoryInfo||"Delete"!==this.editorHistory.currentBaseHistoryInfo.action||s===e.getLineLength(e.start.currentWidget))&&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)},c.prototype.deleteParagraphMark=function(e,t,i,n,o,r){if(!je(e.containerWidget)){e=e.combineWidget(this.owner.viewer);var s=t.getNextParagraphBlock(e);if(!(e.isInsideTable&&je(e.nextWidget)||je(s))){e.containerWidget instanceof Sai&&e.containerWidget;var a=void 0,a=t.getNextRenderedBlock(e)instanceof _ai?t.getNextRenderedBlock(e):void 0;if(s.isInsideTable&&!je(a)&&a.contains(s.associatedCell)){if(i<4){var l=0;this.removeBlock(e),this.documentHelper.layout.clearListElementBox(s),this.documentHelper.layout.clearListElementBox(e);for(var h=e.childWidgets.length-1;0<=h;h--)for(var d=e.childWidgets[h],p=d.children.length-1;0<=p;p--){var c=d.children[p];l+=c.length,s.firstChild.children.unshift(c),c.line=s.firstChild}this.documentHelper.layout.reLayoutParagraph(s,0,0),0<l&&(t.editPosition=this.selection.getHierarchicalIndex(s,l.toString()))}}else if(i<4){e.childWidgets.length;a=s.getSplitWidgets(),s=s.combineWidget(this.owner.viewer);if(this.documentHelper.layout.clearListElementBox(s),this.documentHelper.layout.clearListElementBox(e),this.updateEditPositionOnMerge(e,s),!(!je(n)&&n)||this.handleDeleteParaMark(e,a[0])){for(var n=e.childWidgets.length-1,h=(e.childWidgets[n].children.length,0);h<s.childWidgets.length;h++){var u=s.childWidgets[h];if(0<s.characterFormat.revisions.length){for(var g,m=0;m<s.characterFormat.revisions.length;m++)-1!==s.characterFormat.revisions[m].range.indexOf(s.characterFormat)&&(g=s.characterFormat.revisions[m].range.indexOf(s.characterFormat),s.characterFormat.revisions[m].range.splice(g,1),s.characterFormat.revisions[m].range.splice(g,0,e.characterFormat)),e.characterFormat.revisions.push(s.characterFormat.revisions[m]);s.characterFormat.revisions=[]}s.childWidgets.splice(h,1),e.childWidgets.push(u),u.paragraph=e,h--}for(h=0;h<s.floatingElements.length;h++){var f=s.floatingElements[h];s.floatingElements.splice(h,1),e.floatingElements.push(f),h--}s.bodyWidget.index!==e.bodyWidget.index&&(this.deleteSection(t,e.bodyWidget,s.bodyWidget,i),this.editorHistory.currentBaseHistoryInfo.type="SectionBreak"),0===s.childWidgets.length&&s.childWidgets.push(new Gai(s)),this.documentHelper.layout.reLayoutParagraph(e,0,0),this.removeBlock(s),!this.editorHistory||"Insert"===this.editorHistory.currentBaseHistoryInfo.action||r||this.addRemovedNodes(s,o)}}}}},c.prototype.handleDeleteParaMark=function(e,t){if(!this.owner.enableTrackChanges&&0<e.characterFormat.revisions.length)for(var i=0;i<e.characterFormat.revisions.length;i++){var n=e.characterFormat.revisions[i],o=n.range.indexOf(e.characterFormat);return n.range.splice(o,1),this.owner.trackChangesPane.updateCurrentTrackChanges(n),0===n.range.length&&this.owner.revisions.remove(n),!0}var r,s,a,l;return!(this.owner.enableTrackChanges&&(s=r=!1,0<e.characterFormat.revisions.length?(!je(a=this.retrieveRevisionByType(e.characterFormat,"Deletion"))&&this.isRevisionMatched(a,"Deletion")&&(l=e.characterFormat.revisions.indexOf(a),e.characterFormat.revisions.splice(l,1),a.range.splice(a.range.indexOf(e.characterFormat),1),this.owner.trackChangesPane.updateCurrentTrackChanges(a),0===a.range.length&&this.owner.revisions.remove(a),t=e.nextRenderedWidget instanceof Lai?e.nextRenderedWidget:void 0,this.applyRevisionForParaMark(e,t?t.firstChild:void 0,"Deletion",!1),r=!(s=!0)),!je(a=this.retrieveRevisionByType(e.characterFormat,"Insertion"))&&this.isRevisionMatched(e.characterFormat,"Insertion")&&(l=e.characterFormat.revisions.indexOf(a),e.characterFormat.revisions.splice(l,1),o=a.range.indexOf(e.characterFormat),a.range.splice(o,1),this.owner.trackChangesPane.updateCurrentTrackChanges(a),0===a.range.length&&this.owner.revisions.remove(a),r=!0),!r&&(s||this.applyRevisionForParaMark(e,t?t.firstChild:void 0,"Deletion",!1),1)):(this.applyRevisionForParaMark(e,t?t.firstChild:void 0,"Deletion",!1),1)))},c.prototype.insertDeleteParaMarkRevision=function(e,t){var i,n=e.lastChild,n=0<n.children.length?n.children[n.children.length-1].previousValidNodeForTracking:void 0;je(n)||0<(i=this.getMatchedRevisionsToCombine(n.revisions,"Deletion")).length&&this.mapMatchedRevisions(i,n,e.characterFormat,!1);t.firstChild.children[0].nextValidNodeForTracking},c.prototype.retrieveRevisionByType=function(e,t){for(var i=0;i<e.revisions.length;i++)if(e.revisions[i].revisionType===t)return e.revisions[i]},c.prototype.combineRevisionOnDeleteParaMark=function(e,t,i){t=(e=e.childWidgets[t].children[i]).nextNode.nextValidNodeForTracking,e=e.nextValidNodeForTracking;0<t.revisions.length&&0<e.revisions.length&&this.combineElementRevisions(e,t)},c.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()))},c.prototype.checkEndPosition=function(e){return this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&je(this.editorHistory.currentBaseHistoryInfo.endPosition)},c.prototype.checkInsertPosition=function(e){return this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&je(this.editorHistory.currentBaseHistoryInfo.insertPosition)},c.prototype.checkIsNotRedoing=function(){return this.documentHelper.owner.enableHistoryMode&&!this.editorHistory.isRedoing},c.prototype.deleteSelectedContentInternal=function(e,t,i,n,o){var r=i,s=n,n=(i.isExistBefore(n)||(r=n,s=i),this.selection.getParagraphInfo(r)),i=(e.editPosition=this.selection.getHierarchicalIndex(n.paragraph,n.offset.toString()),!1);return t&&r.isInSameParagraph(s)&&(r.offset<s.offset&&r.offset===e.getParagraphLength(s.paragraph)&&(i=e.getNextRenderedBlock(r.paragraph)instanceof _ai,je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||"Accept All"!==this.editorHistory.currentBaseHistoryInfo.action&&"Accept Change"!==this.editorHistory.currentBaseHistoryInfo.action&&"Reject All"!==this.editorHistory.currentBaseHistoryInfo.action&&"Reject Change"!==this.editorHistory.currentBaseHistoryInfo.action&&!this.editorHistory.isUndoing&&!this.editorHistory.isRedoing||(i=!1)),!(1===s.offset&&s.offset>e.getParagraphLength(s.paragraph))||s.paragraph.isInsideTable&&je(s.paragraph.nextWidget)||(t=!1)),i||(e.owner.isShiftingEnabled=!0,this.checkInsertPosition(e)&&(this.editorHistory.currentBaseHistoryInfo.insertPosition=e.editPosition),this.deleteSelectedContent(s.paragraph,e,r,s,t?1:0,o)),i},c.prototype.initHistory=function(e){this.documentHelper.owner.enableHistoryMode&&this.editorHistory.initializeHistory(e)},c.prototype.initComplexHistory=function(e){this.documentHelper.owner.enableHistoryMode&&this.editorHistory.initComplexHistory(this.documentHelper.selection,e)},c.prototype.insertPicture=function(e,t,i,n,o){var r=this,s=new rhi(!0);s.width=t,s.height=i,je(n)&&""==n||(s.alternateText=n),s.textWrappingStyle="Inline",".svg"===Y.formatClippedString(e).extension?(s.metaFileImageString=e,s.isMetaFile=!0,this.generateFallBackImage(e,t,i,s,o),this.owner.enableCollaborativeEditing||(this.documentHelper.addBase64StringInCollection(s),s.element.src=this.documentHelper.getImageString(s),this.insertPictureInternal(s,o))):je(this.documentHelper)||(s.imageString=e,s.element.crossOrigin="Anonymous",this.documentHelper.addBase64StringInCollection(s),je(n=this.documentHelper.getImageString(s))||!Y.startsWith(n,"http://")&&!Y.startsWith(n,"https://")||(new URL(n),this.viewer.documentHelper.getBase64(e,t,i).then(function(e){je(r.viewer)||je(r.viewer.documentHelper)||(r.viewer.documentHelper.images.get(parseInt(s.imageString))[1]=e,s.element.src=e)})),s.element.src=n,this.insertPictureInternal(s,o))},c.prototype.generateFallBackImage=function(e,n,o,r,s){var a=this,l=new Image;l.onload=function(){a.isImageInsert&&a.owner.enableCollaborativeEditing&&(a.isRemoteAction=!0);var e=Math.max(1,window.devicePixelRatio||1),t=document.createElement("canvas"),i=(t.width=n*e,t.height=o*e,t.getContext("2d"));i.scale(e,e),i.drawImage(l,0,0,n,o),a.owner.enableCollaborativeEditing&&(a.documentHelper.addBase64StringInCollection(r),r.element.src=a.documentHelper.getImageString(r),a.insertPictureInternal(r,s,a.isRemoteAction),a.isImageInsert=!1,a.isRemoteAction=!1),a.viewer.documentHelper.images.get(parseInt(r.imageString))[1]=t.toDataURL("image/png",1)},l.src=e,this.isRemoteAction&&this.insertInlineInSelection(this.selection,r)},c.prototype.insertPictureInternal=function(e,t,i){var n,o=this.documentHelper.selection,r=this.checkAndRemoveComments();this.initHistory("InsertInline"),t&&this.fitImageToPage(o,e),this.owner.enableCollaborativeEditing&&(n=t=void 0,e.isMetaFile?(t=this.documentHelper.images.get(parseInt(e.imageString))[1].toString(),n=this.documentHelper.images.get(parseInt(e.metaFileImageString))[0].toString()):t=this.documentHelper.images.get(parseInt(e.imageString)).toString(),t={imageString:t,height:Y.convertPixelToPoint(e.height),width:Y.convertPixelToPoint(e.width),metaString:n,alternativeText:e.alternateText},this.editorHistory.currentBaseHistoryInfo.insertedData=t,this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Image),i||this.insertInlineInSelection(o,e),this.reLayout(o),this.updateHistoryForComments(r)},c.prototype.fitImageToPage=function(e,t){var i,e=e.start.paragraph.bodyWidget,n=e.sectionFormat.pageHeight-e.sectionFormat.topMargin-e.sectionFormat.topMargin,o=0;o=e instanceof Sai&&1<e.sectionFormat.columns.length?(i=e.columnIndex,e.sectionFormat.columns[i].width):Y.convertPointToPixel(e.sectionFormat.pageWidth-e.sectionFormat.leftMargin-e.sectionFormat.rightMargin),t.width>o&&(t.height=t.height*o/t.width,t.width=o),t.height>n&&(t.width=t.width*n/t.height,t.height=n)},c.prototype.insertInlineInSelection=function(e,t){this.checkIsNotRedoing()&&(e.owner.isShiftingEnabled=!0),e.isEmpty||this.removeSelectedContents(e),!je(this.editorHistory)&&this.editorHistory.currentBaseHistoryInfo&&this.owner.enableCollaborativeEditing&&((this.editorHistory.currentBaseHistoryInfo.insertedElement=t)instanceof Khi?this.editorHistory.currentBaseHistoryInfo.insertedText=0==t.commentType?pJt.Marker_Start:pJt.Marker_End:t instanceof fli?(this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Marker_Start,this.editorHistory.currentBaseHistoryInfo.markerData.push(this.getMarkerData(t))):(t instanceof Dli||t instanceof ghi||t instanceof phi||t instanceof Zai||t instanceof pli&&0==t.removedIds.length)&&(this.editorHistory.currentBaseHistoryInfo.markerData.push(this.getMarkerData(t,this.editorHistory.isUndoing)),t instanceof Zai)&&0===t.fieldType&&(this.editorHistory.currentBaseHistoryInfo.fieldBegin=t)),this.updateInsertPosition(),this.insertInlineInternal(t),this.checkEndPosition(e)&&this.updateHistoryPosition(e.start,!1),this.fireContentChange()},c.prototype.onPortrait=function(){var e=new ari,t=this.documentHelper.selection.sectionFormat.pageWidth,i=this.documentHelper.selection.sectionFormat.pageHeight;i<t&&(e.pageWidth=i,e.pageHeight=t),this.onApplySectionFormat(void 0,e)},c.prototype.onLandscape=function(){var e=new ari,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)},c.prototype.copyValues=function(){var e=new ari;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},c.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)},c.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=612,t.pageHeight=792):(t.pageWidth=792,t.pageHeight=612):"tabloid"===e?i<n?(t.pageWidth=792,t.pageHeight=1224):(t.pageWidth=1224,t.pageHeight=792):"legal"===e?i<n?(t.pageWidth=612,t.pageHeight=1008):(t.pageWidth=1008,t.pageHeight=612):"statement"===e?i<n?(t.pageWidth=396,t.pageHeight=612):(t.pageWidth=612,t.pageHeight=396):"executive"===e?i<n?(t.pageWidth=522,t.pageHeight=756):(t.pageWidth=756,t.pageHeight=522):"a3"===e?i<n?(t.pageWidth=841.9,t.pageHeight=1190.55):(t.pageWidth=1190.55,t.pageHeight=841.9):"a4"===e?i<n?(t.pageWidth=595.3,t.pageHeight=841.9):(t.pageWidth=841.9,t.pageHeight=595.3):"a5"===e?i<n?(t.pageWidth=419.55,t.pageHeight=595.3):(t.pageWidth=595.3,t.pageHeight=419.55):"b4"===e?i<n?(t.pageWidth=728.5,t.pageHeight=1031.8):(t.pageWidth=1031.8,t.pageHeight=728.5):"b5"===e&&(i<n?(t.pageWidth=515.9,t.pageHeight=728.5):(t.pageWidth=728.5,t.pageHeight=515.9)),this.onApplySectionFormat(void 0,t)},c.prototype.updateListItemsTillEnd=function(e,t){var i=e.getSplitWidgets();if(!je(i[i.length-1].nextRenderedWidget))for(var n=t?this.documentHelper.selection.getNextRenderedBlock(e):e;!je(n)&&!this.documentHelper.isTextInput;)this.updateRenderedListItems(n),n=n.getSplitWidgets().pop().nextRenderedWidget},c.prototype.updateWholeListItems=function(e,t,i){this.documentHelper.renderedLists.clear(),this.documentHelper.renderedLevelOverrides=[];e.bodyWidget.index;for(var n,o=0;o<this.documentHelper.pages.length;o++){for(var r=this.documentHelper.pages[o],s=0;s<r.bodyWidgets.length&&je(n=this.getNextBlockForList(r.bodyWidgets[s].firstChild));s++);if(!je(n))break}do{if(!n)break;var a=t?{paragraph:null,listId:i}:null;if(this.updateListItems(n,e,a)){if(je(a))break;return a.paragraph==e?null:a.paragraph}}while(n=je(n=n.getSplitWidgets().pop().nextRenderedWidget)?n:this.getNextBlockForList(n));return null},c.prototype.getNextBlockForList=function(e){if(e instanceof Lai&&this.documentHelper.layout.isFirstElementWithPageBreak(e)){var t=e.nextRenderedWidget;if(!je(t)&&t.equals(e))return t}return e},c.prototype.updateListItems=function(e,t,i){return e instanceof Lai?this.updateListItemsForPara(e,t,i):this.updateListItemsForTable(e,t,i)},c.prototype.updateListItemsForTable=function(e,t,i){if(je(i)&&t instanceof _ai&&e.equals(t))return!0;var n=e.firstChild;do{if(this.updateListItemsForRow(n,t,i))return!0}while(n=n.getSplitWidgets().pop().nextRenderedWidget);return!1},c.prototype.updateListItemsForRow=function(e,t,i){var n=e.firstChild;do{var o=this.updateListItemsForCell(n,t,i);if(!je(i)&&!je(i.paragraph))return!0;if(o)return!0}while(n=n.nextRenderedWidget);return!1},c.prototype.updateListItemsForCell=function(e,t,i){if(0!==e.childWidgets.length){var n=e.firstChild;do{var o=this.updateListItems(n,t,i);if(!je(i)&&!je(i.paragraph))return!0;if(o)return!0}while(n=n.getSplitWidgets().pop().nextRenderedWidget)}return!1},c.prototype.updateRenderedListItems=function(e){e instanceof Lai?(e.isEndsWithColumnBreak&&(e=e.nextRenderedWidget),this.updateRenderedListItemsForPara(e)):this.updateRenderedListItemsForTable(e)},c.prototype.updateRenderedListItemsForTable=function(e){for(var t=e.firstChild;this.updateRenderedListItemsForRow(t),t=t.getSplitWidgets().pop().nextRenderedWidget;);},c.prototype.updateRenderedListItemsForRow=function(e){for(var t=e.firstChild;this.updateRenderedListItemsForCell(t),t=t.nextRenderedWidget;);},c.prototype.updateRenderedListItemsForCell=function(e){if(0!==e.childWidgets.length)for(var t=e.firstChild;this.updateRenderedListItems(t),t=t.getSplitWidgets().pop().nextRenderedWidget;);},c.prototype.updateListItemsForPara=function(e,t,i){if(e.equals(t))return je(i)||(i.paragraph=e),!0;var t=void 0,n=0;if(!je(e.paragraphFormat)&&!je(e.paragraphFormat.listFormat)){if(!je(i)&&e.paragraphFormat.listFormat.listId===i.listId)return i.paragraph=e,!0;t=this.documentHelper.getListById(e.paragraphFormat.listFormat.listId),n=e.paragraphFormat.listFormat.listLevelNumber}return je(t)||je(this.documentHelper.getAbstractListById(t.abstractListId))||je(this.documentHelper.getAbstractListById(t.abstractListId).levels[n])||(i=this.documentHelper.layout.getListLevel(t,n),this.updateListNumber(i,e,!1)),!1},c.prototype.updateRenderedListItemsForPara=function(e){var t,i;je(this.documentHelper.getListById(e.paragraphFormat.listFormat.listId))||(i=this.documentHelper.getListById(e.paragraphFormat.listFormat.listId),t=e.paragraphFormat.listFormat.listLevelNumber,je(i))||je(this.documentHelper.getAbstractListById(i.abstractListId))||je(this.documentHelper.getAbstractListById(i.abstractListId).levels[e.paragraphFormat.listFormat.listLevelNumber])||(i=this.documentHelper.layout.getListLevel(i,t),this.updateListNumber(i,e,!0))},c.prototype.updateListNumber=function(e,t,i){var n,o,r=void 0;!je(r=0<t.childWidgets.length&&0<(o=t.childWidgets[0]).children.length?o.children[0]:r)&&r.nextElement instanceof lhi&&(n=r.width+r.nextElement.width),!je(r)&&r instanceof lhi&&(o=this.documentHelper.layout.getListNumber(t.paragraphFormat.listFormat),i)&&(i=r.width,r.text=o,(this.documentHelper.isIosDevice||this.documentHelper.isLinuxOS)&&(o=(o=r.text)===String.fromCharCode(61623)?String.fromCharCode(9679):o===String.fromCharCode(61551)+String.fromCharCode(32)?String.fromCharCode(9675):o)!==r.text&&(r.text=o),i<(o=this.documentHelper.textHelper.getTextSize(r,r.characterFormat))&&(r.width=o),this.documentHelper.textHelper.updateTextSize(r,t),!je(n))&&r.width<n&&(r.nextElement.width=n-r.width)},c.prototype.getOffsetValue=function(e){var t;this.startParagraph&&(t=e.getLineInfoBasedOnParagraph(this.startParagraph,this.startOffset),e.start.setPositionFromLine(t.line,t.offset)),e.start.updatePhysicalPosition(!0),e.isEmpty?e.end.setPositionInternal(e.start):(this.endParagraph&&(t=e.getLineInfoBasedOnParagraph(this.endParagraph,this.endOffset),e.end.setPositionFromLine(t.line,t.offset)),e.end.updatePhysicalPosition(!0))},c.prototype.setPositionParagraph=function(e,t,i){var n=this.documentHelper.selection,e=n.getLineInfoBasedOnParagraph(e,t);n.start.setPositionFromLine(e.line,e.offset),n.end.setPositionInternal(n.start),i||n.fireSelectionChanged(!0)},c.prototype.setPositionForCurrentIndex=function(e,t){t=this.selection.getParagraph({index:t}),t=this.selection.getLineInfoBasedOnParagraph(t.paragraph,t.offset);e.setPositionForLineWidget(t.line,t.offset)},c.prototype.insertPageNumber=function(e){e=je(e)?"":" \\*"+e,this.createFields("PAGE "+e+" \\* MERGEFORMAT")},c.prototype.insertPageCount=function(e){e=je(e)?"":" *"+e,this.createFields("NUMPAGES "+e+" * MERGEFORMAT")},c.prototype.createFields=function(e){var t=new Lai,i=new Gai(t),n=new Zai(0),o=(i.children.push(n),new Sli),r=(o.fieldBegin=n,o.text="1",new pli),e=(r.text=e,i.children.push(r),new Zai(2)),r=((e.fieldBegin=n).fieldSeparator=e,i.children.push(e),i.children.push(o),new Zai(1)),o=(r.fieldBegin=n,(r.fieldSeparator=e).fieldEnd=r,n.fieldEnd=r,i.children.push(r),n.line=i,t.childWidgets.push(i),this.documentHelper.fields.push(n),new Sai);o.sectionFormat=new ari(o),o.childWidgets.push(t),this.pasteContentsInternal([o],!1)},c.prototype.insertBookmark=function(e,t){if(!je(this.owner.optionsPaneModule)&&this.owner.optionsPaneModule.isBuildHeading||!this.selection.isPlainContentControl()){var i=!1;if(this.documentHelper.bookmarks.containsKey(e)){var n=this.documentHelper.bookmarks.get(e),i=!0;if(this.initComplexHistory("InsertBookmark"),this.documentHelper.owner.editorModule.isRemoteAction=!0,this.deleteBookmark(e),this.documentHelper.owner.editorModule.isRemoteAction=!1,je(n.reference)||je(n.reference.paragraph.associatedCell))je(n.properties)||(o=parseInt(n.properties.columnFirst),!je(h=(r=n.paragraph.associatedCell.ownerRow).getCellUsingColumnIndex(r.rowIndex,o))&&h.isRenderBookmarkStart&&(h.isRenderBookmarkStart=!1));else if((r=n.reference.paragraph.associatedCell.ownerRow).isRenderBookmarkEnd&&(r.isRenderBookmarkEnd=!1),!je(n.properties)){for(var o=parseInt(n.properties.columnFirst),r=n.paragraph.associatedCell.ownerRow,r=(je(h=r.getCellUsingColumnIndex(r.rowIndex,o))||(h.isRenderBookmarkStart=!1),parseInt(n.properties.columnLast)),s=n.reference.paragraph.associatedCell.ownerRow,a=void 0,l=r;je(a)&&-1<l;)je(a=s.getCell(s.rowIndex,l))&&l--;a.isRenderBookmarkEnd&&(a.isRenderBookmarkEnd=!1)}}var o=this.createBookmarkElements(e),h=o[0],n=o[1];h.properties=this.selection.getBookmarkProperties(h),n.properties=this.selection.getBookmarkProperties(n),this.owner.isShiftingEnabled=!0,i||this.initComplexHistory("InsertBookmark"),this.insertElements([n],[h],!0,t),this.editorHistory&&this.editorHistory.updateComplexHistoryInternal(),this.documentHelper.owner.enableHeaderAndFooter&&this.updateHeaderFooterWidget(),this.documentHelper.bookmarks.add(e,h),je(h.properties)?(this.selection.start.setPositionForSelection(h.line,h,1,this.selection.start.location),r=0,je(n.properties)||n.properties.isAfterParagraphMark&&(this.selection.start.setPositionForSelection(h.line,h,0,this.selection.start.location),r=2),this.selection.end.setPositionForSelection(n.line,n,r,this.selection.end.location),!je(o=this.documentHelper.blockToShift)&&this.viewer instanceof nai&&1<o.bodyWidget.sectionFormat.columns.length&&(je((i=this.documentHelper.layout.getBodyWidget(o.bodyWidget,!1)).nextRenderedWidget)||"NoBreak"!==i.nextRenderedWidget.sectionFormat.breakCode||i.page!==i.nextRenderedWidget.page||this.reLayout(this.selection)),this.owner.isShiftingEnabled=!1,this.selection.fireSelectionChanged(!0)):(this.selection.selectBookmarkInTable(h),this.documentHelper.owner.isShiftingEnabled=!1),this.fireContentChange(),1==this.owner.documentEditorSettings.showBookmarks&&this.viewer.updateScrollBars()}},c.prototype.createBookmarkElements=function(e){var t=new Dli(0),i=(t.name=e,new Dli(1));return i.name=e,[(t.reference=i).reference=t,i]},c.prototype.deleteBookmark=function(e){var t,i,n,o,r,s,a,l=this.documentHelper.bookmarks.get(e);l instanceof Dli&&(t=l.reference,i=this.selection.start.clone(),n=this.selection.end.clone(),this.selection.isForward||(i=this.selection.end.clone(),n=this.selection.start.clone()),o=!1,s=r=void 0,(a=this.selection.getElementInfo(i.currentWidget,i.offset)).element!==l&&a.element.nextElement===l&&(s=this.selection.getElementInfo(i.currentWidget,i.offset),a=this.selection.getElementInfo(i.currentWidget,i.offset+1),i.offset+=1),a.element===l&&(o=!0,r=this.selection.getElementInfo(i.currentWidget,0===i.offset?i.offset+2:i.offset+1)),(a=this.selection.getElementInfo(n.currentWidget,n.offset)).element===t&&(a=this.selection.getElementInfo(n.currentWidget,n.offset-1)),this.selection.start.setPositionParagraph(l.line,l.line.getOffset(l,l.length)),this.selection.end.setPositionParagraph(t.line,t.line.getOffset(t,t.length)-1),this.initHistory("DeleteBookmark"),this.selection.selectPosition(i,n),this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Marker_Start,this.editorHistory.currentBaseHistoryInfo.markerData.push({bookmarkName:e}),this.editorHistory.currentBaseHistoryInfo.setBookmarkInfo(l)),this.deleteBookmarkInternal(l),this.editorHistory&&this.editorHistory.updateHistory(),o=!(!o||je(r)||r.element===l||r.element===t||(this.selection.start.setPositionParagraph(r.element.line,r.element.line.getOffset(r.element,r.index)-1),0)),a.element!==l&&a.element!==t&&this.selection.end.setPositionParagraph(a.element.line,a.element.line.getOffset(a.element,a.index)),a.element!==l||je(r)||r.element!==t||(o||je(s)?je(s)&&r.element===t&&(i.offset=0===i.offset?i.offset:i.offset-1,this.selection.selectPosition(i,i)):(this.selection.start.setPositionParagraph(s.element.line,s.element.line.getOffset(s.element,s.index)),this.selection.selectPosition(this.selection.start,this.selection.start)))),this.fireContentChange(),1==this.owner.documentEditorSettings.showBookmarks&&this.viewer.updateScrollBars()},c.prototype.deleteBookmarkInternal=function(e){var t=e.previousNode;if(t instanceof Zai&&0===t.fieldType&&!je(t.formFieldData)&&(t.formFieldData.name=""),je(e.properties))!this.documentHelper.selection.isRenderBookmarkAtEnd(e)||je(e.reference)||je(e.reference.paragraph.associatedCell)||(i=e.reference.paragraph.associatedCell.ownerRow).isRenderBookmarkEnd&&(i.isRenderBookmarkEnd=!1);else{var t=parseInt(e.properties.columnFirst),i=(i=e.paragraph.associatedCell.ownerRow).getCellUsingColumnIndex(i.rowIndex,t),t=(je(i)||(i.isRenderBookmarkStart=!1),parseInt(e.properties.columnLast));if(!je(e.reference)&&!je(e.reference.paragraph.associatedCell)){for(var n=e.reference.paragraph.associatedCell.ownerRow,o=void 0,r=t;je(o)&&-1<r;)je(o=n.getCell(n.rowIndex,r))&&r--;o.isRenderBookmarkEnd&&(o.isRenderBookmarkEnd=!1)}}this.documentHelper.bookmarks.remove(e.name),e.line.children.splice(e.indexInOwner,1),je(e.reference)||e.reference.line.children.splice(e.reference.indexInOwner,1);i=e.line.paragraph;e.line.paragraph.isInHeaderFooter&&(t=void 0,i.containerWidget instanceof Uai?t=i.containerWidget.getContainerTable().containerWidget:i.containerWidget instanceof Iai&&(t=i.containerWidget),this.updateHeaderFooterWidget(t))},c.prototype.getSelectionInfo=function(e){var t=this.selection.start,i=this.selection.end,n=(this.selection.isForward||(t=this.selection.end,i=this.selection.start),i.offset===this.selection.getLineLength(i.currentWidget)+1&&this.selection.isParagraphLastLine(i.currentWidget)||this.owner.documentHelper.isDragging||(i.offset+=1),this.selection.getParagraphInfo(t)),o=this.selection.getHierarchicalIndex(n.paragraph,n.offset.toString()),n=this.selection.getParagraphInfo(i),n=this.selection.getHierarchicalIndex(n.paragraph,n.offset.toString()),r=this.selection.selectedWidgets.keys;return je(e)||1!=e||this.selection.hasMergedCells()?(r[0]instanceof Uai&&t.paragraph.isInsideTable&&!je(e=this.selection.getCellFromSelectionInTable(0))&&e instanceof Uai&&(o=this.selection.getActualOffset(e,0)),r[r.length-1]instanceof Uai&&i.paragraph.isInsideTable&&!je(e=this.selection.getCellFromSelectionInTable(1))&&e instanceof Uai&&(n=this.selection.getActualOffset(e,1))):(t.paragraph.isInsideTable&&!je(r=this.selection.getCellFromSelection(0))&&r instanceof Uai&&(o=this.selection.getActualOffset(r,0)),i.paragraph.isInsideTable&&!je(e=this.selection.getCellFromSelection(1))&&e instanceof Uai&&(n=this.selection.getActualOffset(e,1))),{start:o,end:n}},c.prototype.insertElements=function(e,t,i,n){var o=this.getSelectionInfo(i);i&&!je(t[0].properties)&&0==t[0].bookmarkType&&(o=this.owner.selection.updateSelectionInfo(o)),je(t)||(this.insertElementsInternal(this.selection.getTextPosBasedOnLogicalIndex(o.start),t,void 0,n),this.owner.isSpellCheck&&i&&t[0].previousElement&&t[0].previousElement instanceof pli&&(t[0].previousElement.ischangeDetected=!0)),je(e)||(this.insertElementsInternal(this.selection.getTextPosBasedOnLogicalIndex(o.end),e,void 0,n),this.owner.isSpellCheck&&i&&e[0].reference.line!==e[0].line&&e[0].previousElement&&e[0].previousElement instanceof pli&&(e[0].previousElement.ischangeDetected=!0))},c.prototype.insertElementsInternal=function(e,t,i,n){this.selection.selectPosition(e,e),this.initHistory("InsertElements"),!je(this.editorHistory)&&this.editorHistory.currentBaseHistoryInfo&&((t[0]instanceof Dli&&this.editorHistory||t[0]instanceof ghi||t[0]instanceof phi||t[0]instanceof Pli)&&this.editorHistory.currentBaseHistoryInfo.markerData.push(this.getMarkerData(t[0])),t[0]instanceof pli)&&(this.editorHistory.currentBaseHistoryInfo.insertedText=t[0].text,this.setCharFormatForCollaborativeEditing(t[0].characterFormat)),this.updateInsertPosition();var o=this.selection.getParagraphInfo(this.selection.start);if(this.selection.start.paragraph.isEmpty()){var r=this.selection.start.paragraph;r.childWidgets[0].children.push(t[0]),t[0].line=r.childWidgets[0],t[0].linkFieldCharacter(this.documentHelper),this.documentHelper.layout.reLayoutParagraph(r,0,0),this.setPositionParagraph(o.paragraph,o.offset+length,!0),e.setPositionForSelection(t[0].line,t[0],t[0].length,this.selection.start.location)}else{for(var r=this.selection.start.currentWidget.getInline(this.documentHelper.selection.start.offset,0),o=r.element,r=r.index,s=t[0],a=(this.insertElementInternal(o,s,r,void 0,!0,n),s.indexInOwner),l=s,h=1;h<t.length;h++)l=t[h],s.line.children.splice(a+h,0,l);e.setPositionForSelection(l.line,l,l.length,this.selection.start.location)}this.selection.selectPosition(e,e),this.editorHistory&&(this.checkEndPosition()&&this.updateHistoryPosition(this.selection.start,!1),this.editorHistory.updateHistory())},c.prototype.getMarkerData=function(e,t,i,n){var o,r,s,a,l,h,d={};return(this.editorHistory.currentBaseHistoryInfo||this.editorHistory.isUndoing||this.editorHistory.isRedoing)&&(e instanceof Dli?(o=h="",l=a=s=r=void 0,0==e.bookmarkType?(this.editorHistory.isUndoing||this.editorHistory.isRedoing||(this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Marker_Start),je(e.properties)||(h=e.properties.columnFirst,o=e.properties.columnLast)):(this.editorHistory.isUndoing||this.editorHistory.isRedoing||(this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Marker_End),je(e.properties)||(r=e.properties.isAfterParagraphMark,s=e.properties.isAfterTableMark,a=e.properties.isAfterRowMark,l=e.properties.isAfterCellMark)),d={bookmarkName:e.name,type:"Bookmark",skipOperation:t,columnFirst:h,columnLast:o,isAfterParagraphMark:r,isAfterTableMark:s,isAfterRowMark:a,isAfterCellMark:l}):e instanceof ghi||e instanceof phi?(h=void 0,e instanceof ghi?(h=e,this.editorHistory.isUndoing||this.editorHistory.isRedoing||(this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Marker_Start)):(h=e.editRangeStart,this.editorHistory.isUndoing||this.editorHistory.isRedoing||(this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Marker_End)),d={user:""===h.user?h.group:h.user,type:"EditRange",editRangeId:h.editRangeId,skipOperation:t,columnFirst:je(h.columnFirst)?void 0:h.columnFirst.toString(),columnLast:je(h.columnLast)?void 0:h.columnLast.toString()}):e instanceof Zai?(0==e.fieldType?this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Marker_Start:2==e.fieldType?this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Field_Separator:this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Marker_End,d={type:"Field"}):e instanceof fli?d={type:e.footnoteType}:e instanceof pli?this.editorHistory.currentBaseHistoryInfo.insertedText=e.text:e instanceof Pli&&(d={type:"ContentControl",text:e.contentControlWidgetType},0==e.type?(je(this.editorHistory.currentBaseHistoryInfo)||(this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Marker_Start),d.contentControlProperties=JSON.stringify(this.getContentControlPropObject(e.contentControlProperties))):je(this.editorHistory.currentBaseHistoryInfo)||(this.editorHistory.currentBaseHistoryInfo.insertedText=pJt.Marker_End))),d=je(i)?d:this.getRevisionMarkerData(d,i,t,n)},c.prototype.getRevisionMarkerData=function(e,t,i,n){return(e=je(e)?{}:e).revisionId=t.revisionID,e.revisionType=t.revisionType,e.author=t.author,e.date=t.date,e.skipOperation=i,e.isAcceptOrReject=n,e},c.prototype.getCommentElementBox=function(e){var e=e.split(";"),t=this.documentHelper.comments[parseInt(e[1],10)];return 2<e.length&&""!==e[2]?t.replyComments[parseInt(e[2],10)]:t},c.prototype.getBlock=function(e){var t=this.selection.getBodyWidget(e);return this.getBlockInternal(t,e)},c.prototype.getBlockInternal=function(e,t){var i,n,o;if(""!==t.index&&!je(t))return o=t.index.indexOf(";"),n=t.index.substring(0,o),t.index=t.index.substring(o).replace(";",""),i=e,o=parseInt(n,10),(n=this.selection.getBlockByIndex(e,o))?(e=n,0<=t.index.indexOf(";")?e instanceof Lai?(0<=t.index.indexOf(";")&&(t.index="0"),{node:e,position:t}):e instanceof fai?{node:je(o=this.getBlockInternal(e,t))?void 0:o.node,position:je(o)?void 0:o.position}:{node:i,position:t}:{node:e,position:t}):{node:i,position:t}},c.prototype.updateHistoryPosition=function(e,t){var i,n;this.editorHistory&&!je(this.editorHistory.currentBaseHistoryInfo)&&(n=void 0,n=e instanceof rci?(i=this.selection.getParagraphInfo(e),this.selection.getHierarchicalIndex(i.paragraph,i.offset.toString())):e,t?this.editorHistory.currentBaseHistoryInfo.insertPosition=n:this.editorHistory.currentBaseHistoryInfo.endPosition=n)},c.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=(n=t.paragraph.associatedCell.ownerTable).combineWidget(this.owner.viewer),i=(this.editorHistory&&this.cloneTableToHistoryInfo(n),t.paragraph.associatedCell,i.paragraph.associatedCell),o=this.getBorder(e.borderColor,e.lineWidth,e.borderStyle);if(je(this.editorHistory.currentBaseHistoryInfo)||(this.editorHistory.currentBaseHistoryInfo.insertedFormat=t.paragraph.associatedCell.cellFormat.borders),this.documentHelper.selection.isTableSelected())"TopBorder"!==e.type&&"OutsideBorders"!==e.type&&"AllBorders"!==e.type||n.tableFormat.borders.top.copyFormat(o),"BottomBorder"!==e.type&&"OutsideBorders"!==e.type&&"AllBorders"!==e.type||n.tableFormat.borders.bottom.copyFormat(o),"LeftBorder"!==e.type&&"OutsideBorders"!==e.type&&"AllBorders"!==e.type||n.tableFormat.borders.left.copyFormat(o),"RightBorder"!==e.type&&"OutsideBorders"!==e.type&&"AllBorders"!==e.type||n.tableFormat.borders.right.copyFormat(o),"InsideHorizontalBorder"!==e.type&&"AllBorders"!==e.type&&"InsideBorders"!==e.type||n.tableFormat.borders.horizontal.copyFormat(o),"InsideVerticalBorder"!==e.type&&"AllBorders"!==e.type&&"InsideBorders"!==e.type||n.tableFormat.borders.vertical.copyFormat(o);else{if(this.selection.isEmpty)"OutsideBorders"!==e.type&&"AllBorders"!==e.type&&"LeftBorder"!==e.type||i.cellFormat.borders.left.copyFormat(o),"OutsideBorders"!==e.type&&"AllBorders"!==e.type&&"TopBorder"!==e.type||i.cellFormat.borders.top.copyFormat(o),"OutsideBorders"!==e.type&&"AllBorders"!==e.type&&"RightBorder"!==e.type||i.cellFormat.borders.right.copyFormat(o),"OutsideBorders"!==e.type&&"AllBorders"!==e.type&&"BottomBorder"!==e.type||i.cellFormat.borders.bottom.copyFormat(o),"AllBorders"!==e.type&&"InsideBorders"!==e.type&&"InsideVerticalBorder"!==e.type||i.cellFormat.borders.vertical.copyFormat(o),"AllBorders"!==e.type&&"InsideBorders"!==e.type&&"InsideHorizontalBorder"!==e.type||i.cellFormat.borders.horizontal.copyFormat(o),"NoBorder"===e.type&&this.clearAllBorderValues(i.cellFormat.borders);else{if("OutsideBorders"===e.type||"TopBorder"===e.type)for(var r=this.getTopBorderCellsOnSelection(),s=0;s<r.length;s++)r[s].cellFormat.borders.top.copyFormat(o);if("OutsideBorders"===e.type||"LeftBorder"===e.type)for(r=this.getLeftBorderCellsOnSelection(),s=0;s<r.length;s++)r[s].cellFormat.borders.left.copyFormat(o);if("OutsideBorders"===e.type||"RightBorder"===e.type)for(r=this.getRightBorderCellsOnSelection(),s=0;s<r.length;s++)r[s].cellFormat.borders.right.copyFormat(o);if("OutsideBorders"===e.type||"BottomBorder"===e.type)for(r=this.getBottomBorderCellsOnSelection(),s=0;s<r.length;s++)r[s].cellFormat.borders.bottom.copyFormat(o)}if("BottomBorder"===e.type||"AllBorders"===e.type||"OutsideBorders"===e.type||"NoBorder"===e.type)for(var a=this.getAdjacentCellToApplyBottomBorder(),s=0;s<a.length;s++){var l=a[s];"NoBorder"===e.type?l.cellFormat.borders.top.copyFormat(this.clearBorder()):l.cellFormat.borders.top.copyFormat(o)}if("AllBorders"===e.type||"OutsideBorders"===e.type||"RightBorder"===e.type||"NoBorder"===e.type){a=this.getAdjacentCellToApplyRightBorder();for(s=0;s<a.length;s++){l=a[s];"NoBorder"===e.type?l.cellFormat.borders.left.copyFormat(this.clearBorder()):l.cellFormat.borders.left.copyFormat(o)}}"AllBorders"!==e.type&&"NoBorder"!==e.type||this.applyAllBorders(o,e.type),"InsideBorders"!==e.type&&"InsideVerticalBorder"!==e.type&&"InsideHorizontalBorder"!==e.type&&"NoBorder"!==e.type||this.applyInsideBorders(o,e.type,n)}this.updateGridForTableDialog(n,!1),this.reLayout(this.selection,!1),this.editorHistory.updateHistory()},c.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))},c.prototype.applyInsideBorders=function(e,t,i){for(var n=this.selection.getSelectedCells(),o=0;o<n.length;o++){var r=n[o],s=r.ownerRow===n[n.length-1].ownerRow,a=r.columnIndex+r.cellFormat.columnSpan-1===n[n.length-1].columnIndex;if("NoBorder"===t?(r.cellFormat.borders.right.copyFormat(this.clearBorder()),r.cellFormat.borders.bottom.copyFormat(this.clearBorder())):(a||"InsideHorizontalBorder"===t||r.cellFormat.borders.right.copyFormat(e),s||"InsideVerticalBorder"===t||r.cellFormat.borders.bottom.copyFormat(e)),!s&&"InsideVerticalBorder"!==t){s=r.ownerRow.rowIndex+r.cellFormat.rowSpan,s=i.childWidgets[s];if(s)for(var l=this.getAdjacentBottomBorderOnEmptyCells(s,r,!0),h=0;h<l.length;h++)"NoBorder"===t?l[h].cellFormat.borders.top.copyFormat(this.clearBorder()):l[h].cellFormat.borders.top.copyFormat(e)}if(!a&&"InsideHorizontalBorder"!==t)for(var d=this.getSelectedCellsNextWidgets(r,i),p=0;p<d.length;p++)"NoBorder"===t?d[p].cellFormat.borders.left.copyFormat(this.clearBorder()):d[p].cellFormat.borders.left.copyFormat(e)}},c.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},c.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},c.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},c.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},c.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)},c.prototype.clearBorder=function(){var e=new pri;return e.lineStyle="Cleared",e},c.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=(n=t.paragraph.associatedCell.ownerTable).combineWidget(this.owner.viewer),o=t.paragraph.associatedCell,r=i.paragraph.associatedCell,t=r.ownerRow.rowIndex+r.cellFormat.rowSpan,s=n.childWidgets[t];if(s)if(1<r.cellFormat.columnSpan)for(var a=r.columnIndex;a<r.columnIndex+r.cellFormat.columnSpan;a++)s.childWidgets[a]&&e.push(s.childWidgets[a]);else if(e=this.getAdjacentBottomBorderOnEmptyCells(s,r),!this.selection.isEmpty)for(a=0;a<s.childWidgets.length;a++){var l=s.childWidgets[a].columnIndex;l>=o.columnIndex&&l<=r.columnIndex&&s.childWidgets[a]&&e.push(s.childWidgets[a])}return e},c.prototype.getAdjacentBottomBorderOnEmptyCells=function(e,t,i){var n=[];if(1<t.cellFormat.columnSpan)for(var o=t.columnIndex;o<t.columnIndex;o++)n.push(e.childWidgets[o]);else if(this.selection.isEmpty||i)for(o=0;o<e.childWidgets.length;o++)e.childWidgets[o].columnIndex===t.columnIndex&&n.push(e.childWidgets[o]);return n},c.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=(n=t.paragraph.associatedCell.ownerTable).combineWidget(this.owner.viewer);t.paragraph.associatedCell,i.paragraph.associatedCell;if(this.selection.isEmpty)i=t.paragraph.associatedCell,e=this.getSelectedCellsNextWidgets(i,n);else for(var o=this.getRightBorderCellsOnSelection(),r=0;r<o.length;r++){var s=o[r];e=e.concat(this.getSelectedCellsNextWidgets(s,n))}return e},c.prototype.getSelectedCellsNextWidgets=function(e,t){var i=[];if(!je(e.nextWidget)&&(i.push(e.nextWidget),1<e.cellFormat.rowSpan))for(var n=e.ownerRow.rowIndex+e.cellFormat.rowSpan,o=e.ownerRow.rowIndex+1;o<n;o++){var r=t.childWidgets[o];if(r)for(var s=0;s<r.childWidgets.length;s++)r.childWidgets[s].columnIndex===e.nextWidget.columnIndex&&i.push(r.childWidgets[s])}return i},c.prototype.getBorder=function(e,t,i){var n=new pri;return n.color=e||"#000000",n.lineWidth=t||1,n.lineStyle=i||"Single",n},c.prototype.applyBordersInternal=function(e,t){je(e)||je(e)||(je(e.top)||this.applyBorder(e.top,t.top),je(e.bottom)||this.applyBorder(e.bottom,t.bottom),je(e.left)||this.applyBorder(e.left,t.left),je(e.right)||this.applyBorder(e.right,t.right),je(e.horizontal)||this.applyBorder(e.horizontal,t.horizontal),je(e.vertical)||this.applyBorder(e.vertical,t.vertical),je(e.diagonalUp)||this.applyBorder(e.diagonalUp,t.diagonalUp),je(e.diagonalDown))||this.applyBorder(e.diagonalDown,t.diagonalDown)},c.prototype.applyShading=function(e,t){je(t)||je(e)||(je(t.backgroundColor)||e.backgroundColor===t.backgroundColor||(e.backgroundColor=t.backgroundColor),je(t.foregroundColor)||e.foregroundColor===t.foregroundColor||(e.foregroundColor=t.foregroundColor),je(t.textureStyle))||e.textureStyle===t.textureStyle||(e.textureStyle=t.textureStyle)},c.prototype.applyBorder=function(e,t){je(e)||je(t)||(je(t.color)||e.color===t.color||(e.color=t.color),je(t.lineStyle)||e.lineStyle===t.lineStyle||(e.lineStyle=t.lineStyle),je(t.lineWidth)||e.lineWidth===t.lineWidth||(e.lineWidth=t.lineWidth),je(t.shadow)||e.shadow===t.shadow||(e.shadow=t.shadow),je(t.space))||e.space===t.space||(e.space=t.space)},c.prototype.onTableFormat=function(e,t,i){if(!je(this.selection.tableFormat)){if(je(t)&&(t=!1),this.documentHelper.owner.isShiftingEnabled=!0,this.editorHistory.initializeHistory("TableFormat"),je(i)&&(i=this.selection.start.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer)),t)for(var n=0;n<i.childWidgets.length;n++)for(var o=i.childWidgets[n],r=0;r<o.childWidgets.length;r++)o.childWidgets[r].cellFormat.shading.copyFormat(e.shading);this.applyTableFormat(i,void 0,e),this.reLayout(this.selection,!1)}},c.prototype.applyTableFormat=function(e,t,i){this.applyTablePropertyValue(void 0,i,e)},c.prototype.applyTablePropertyValue=function(e,t,i){i=i.tableFormat;!je(this.editorHistory)&&this.editorHistory.currentBaseHistoryInfo&&(t=this.editorHistory.currentBaseHistoryInfo.addModifiedTableProperties(i,e,t),this.editorHistory.currentBaseHistoryInfo.insertedFormat=t),t instanceof Jri?je(e)&&this.handleTableFormat(i,t):("preferredWidth"===e?i.preferredWidth=t:"leftIndent"===e?i.leftIndent=t:"tableAlignment"===e?i.tableAlignment=t:"cellSpacing"===e?i.cellSpacing=t:"leftMargin"===e?i.leftMargin=t:"rightMargin"===e?i.rightMargin=t:"topMargin"===e?i.topMargin=t:"bottomMargin"===e?i.bottomMargin=t:"preferredWidthType"===e?i.preferredWidthType=t:"bidi"===e?i.bidi=t:"title"===e?i.title=t:"description"===e&&(i.description=t),"shading"===e?i.shading=t:"borders"===e&&(i.borders=t))},c.prototype.handleTableFormat=function(e,t){(this.isBordersAndShadingDialog||this.editorHistory.isUndoing||this.editorHistory.isRedoing)&&(je(e.borders)||this.applyBordersInternal(e.borders,t.borders),je(e.shading)||this.applyShading(e.shading,t.shading)),this.isBordersAndShadingDialog||(t.hasValue("bidi")&&t.bidi!==e.bidi&&(e.bidi=t.bidi),t.hasValue("preferredWidth")&&t.preferredWidth!==e.preferredWidth&&(e.preferredWidth=t.preferredWidth),t.hasValue("preferredWidthType")&&t.preferredWidthType!==e.preferredWidthType&&(e.preferredWidthType=t.preferredWidthType),t.hasValue("tableAlignment")&&t.tableAlignment!==e.tableAlignment&&(e.tableAlignment=t.tableAlignment),t.hasValue("leftIndent")&&t.leftIndent!==e.leftIndent&&(e.leftIndent=t.leftIndent)),this.updateGridForTableDialog(e.ownerBase,!1),t.title!==e.title&&(e.title=t.title),t.description!==e.description&&(e.description=t.description)},c.prototype.updateGridForTableDialog=function(e,t){e.tableHolder&&(e.updateRowIndex(0),e.isGridUpdated=!1),this.documentHelper.layout.reLayoutTable(e)},c.prototype.onRowFormat=function(e){var t,i;je(this.selection)||je(e)||(this.editorHistory.initializeHistory("RowFormat"),this.documentHelper.owner.isShiftingEnabled=!0,t=this.selection.isForward?this.selection.start:this.selection.end,i=this.selection.isForward?this.selection.end:this.selection.start,t.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer),this.applyRowFormat(t.paragraph.associatedCell.ownerRow,t,i,void 0,e),this.reLayout(this.selection,!1))},c.prototype.applyRowFormat=function(e,t,i,n,o){this.applyRowPropertyValue(this.documentHelper.selection,n,o,e),i.paragraph.associatedCell.ownerRow===e||je(e=e.nextWidget)||this.applyRowFormat(e,t,i,n,o)},c.prototype.applyRowPropertyValue=function(e,t,i,n){var o=n.rowFormat;je(this.editorHistory.currentBaseHistoryInfo)||(i=this.editorHistory.currentBaseHistoryInfo.addModifiedRowProperties(o,t,i),this.editorHistory.currentBaseHistoryInfo.insertedFormat=i),i instanceof Cri?je(t)&&this.handleRowFormat(i,o):("heightType"===t?o.heightType=i:"height"===t?o.height=i:"isHeader"===t?o.isHeader=i:"allowBreakAcrossPages"===t&&(o.allowBreakAcrossPages=i),je(n.ownerTable)||this.layoutItemBlock(n.ownerTable,!0))},c.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)},c.prototype.onCellFormat=function(e){je(this.selection)||je(e)||(this.editorHistory.initializeHistory("CellFormat"),this.updateFormatForCell(this.selection,void 0,e),this.reLayout(this.selection,!1))},c.prototype.onParaFormat=function(e){je(this.selection)||je(e)||(this.editorHistory.initializeHistory("ParagraphFormat"),this.updateParagraphFormat(void 0,e,!1),this.reLayout(this.selection,!1))},c.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)},c.prototype.updateFormatForCell=function(e,t,i){for(var n=e.start,o=e.end,r=(e.isForward||(n=e.end,o=e.start),n.paragraph.associatedCell),s=o.paragraph.associatedCell,e=r.ownerTable.combineWidget(this.owner.viewer),a=r.columnIndex;a<=s.columnIndex;a++)for(var l=this.getSelectedCellInColumn(r.ownerTable,r.ownerRow.rowIndex,a,s.ownerRow.rowIndex),h=0;h<l.length;h++)this.applyCellPropertyValue(this.documentHelper.selection,t,i,l[h].cellFormat);this.updateGridForTableDialog(e,!1)},c.prototype.getSelectedCellInColumn=function(e,t,i,n){for(var o=[],r=t;r<=n;r++)for(var s=e.childWidgets[r],a=0;a<s.childWidgets.length;a++)s.childWidgets[a].columnIndex===i&&o.push(s.childWidgets[a]);return o},c.prototype.getColumnCells=function(e,t,i){for(var n=[],o=0;o<e.childWidgets.length;o++)for(var r=e.childWidgets[o],s=0;s<r.childWidgets.length;s++){var a=r.childWidgets[s];i?a.columnIndex+a.cellFormat.columnSpan===t&&n.push(a):a.columnIndex===t&&n.push(a)}return n},c.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:Y.convertPixelToPoint(this.owner.viewer.clientArea.width)/100*e.tableFormat.preferredWidth:Y.convertPixelToPoint(this.documentHelper.layout.getTableWidth(e))},c.prototype.applyCellPropertyValue=function(e,t,i,n){if(je(this.editorHistory.currentBaseHistoryInfo)||(i=this.editorHistory.currentBaseHistoryInfo.addModifiedCellProperties(n,t,i),this.editorHistory.currentBaseHistoryInfo.insertedFormat=i),i instanceof $ri)return je(t)&&this.handleCellFormat(i,n),i;"leftMargin"===t?n.leftMargin=i:"topMargin"===t?n.topMargin=i:"rightMargin"===t?n.rightMargin=i:"bottomMargin"===t?n.bottomMargin=i:"preferredWidth"===t?(n.preferredWidth=i,n.cellWidth=i):"cellWidth"===t?n.cellWidth=i:"columnSpan"===t?n.columnSpan=i:"rowSpan"===t?n.rowSpan=i:"preferredWidthType"===t?n.preferredWidthType=i:"verticalAlignment"===t&&(n.verticalAlignment=i),"shading"===t?n.shading=i:"borders"===t&&(n.borders=i)},c.prototype.handleCellFormat=function(e,t){je(e)||je(t)||(this.isBordersAndShadingDialog?(je(e.borders)||this.applyBordersInternal(t.borders,e.borders),je(e.shading)||this.applyShading(t.shading,e.shading)):(e.hasValue("preferredWidth")&&t.preferredWidth!==e.preferredWidth&&(t.preferredWidth=e.preferredWidth),e.hasValue("preferredWidthType")&&t.preferredWidthType!==e.preferredWidthType&&(t.preferredWidthType=e.preferredWidthType),e.hasValue("verticalAlignment")&&t.verticalAlignment!==e.verticalAlignment&&(t.verticalAlignment=e.verticalAlignment)))},c.prototype.destroy=function(){this.tableResize&&(this.tableResize.destroy(),this.tableResize=void 0),this.previousCharFormat&&(this.previousCharFormat.destroy(),this.previousCharFormat=void 0),this.previousParaFormat&&(this.previousParaFormat.destroy(),this.previousParaFormat=void 0),this.alertDialog&&this.alertDialog.destroy(),this.alertDialog=void 0,this.base64&&this.base64.destroy(),this.base64=void 0,this.endParagraph=void 0,this.copiedData=void 0,this.copiedTextContent=void 0,this.listNumberFormat=void 0,this.nodes=[],this.removedTextNodes=[],this.removedBookmarkElements=[],this.editStartRangeCollection=[],this.documentHelper=void 0,this.editRangeID=void 0,this.isCellFormatApplied=void 0,this.removedContentControlElements=[]},c.prototype.updateToc=function(e){var t;je(e)&&(e=this.selection.getTocFieldInternal()),this.documentHelper.layout.isTocField(e)&&-1!==(t=this.selection.getFieldCode(e)).toLocaleLowerCase().indexOf("toc")&&this.insertTableOfContents(this.validateTocSettings(this.getTocSettings(t,e)))},c.prototype.getTocSettings=function(e,t){var i={includePageNumber:!0,rightAlign:!0};if("toc \\mergeformat"===e.toLowerCase())i.startLevel=1,i.endLevel=3;else for(var n=e.split("\\"),o=0;o<n.length;o++){var r,s=n[o];if(0!==s.length)switch(s[0]){case"o":je(s.match(/\d+/g))?(i.startLevel=1,i.endLevel=9):(r=s.match(/\d+/g).map(Number),i.startLevel=r[0],i.endLevel=r[1]);break;case"h":i.includeHyperlink=!0;break;case"n":i.includePageNumber=!1;break;case"p":i.rightAlign=!1;break;case"u":i.includeOutlineLevels=!0;break;case"t":this.decodeTSwitch(i,s)}}e=t.paragraph.paragraphFormat.getUpdatedTabs();return 0<e.length&&(i.tabLeader=e[e.length-1].tabLeader),i.rightAlign&&je(i.tabLeader)&&(i.tabLeader="Dot"),i},c.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++},c.prototype.insertTableOfContents=function(e){var t,i,n,o,r,s;this.selection.isPlainContentControl()||(this.isInsertingTOC=!0,t=this.checkAndRemoveComments(),this.initComplexHistory("TOC"),i=void(je(e)&&(e={startLevel:1,endLevel:3,includeHyperlink:!0,includeOutlineLevels:!0,includePageNumber:!0,rightAlign:!0,tabLeader:"Dot"})),r=void 0,(i="TableOfContents"===this.selection.contextType?this.selection.getTocFieldInternal():i)instanceof Zai&&(this.selection.start.setPositionForSelection(i.line,i,0,this.selection.start.location),n=2,o=(s=i.fieldEnd.paragraph).nextWidget,(s===s.bodyWidget.lastChild||o instanceof Lai&&o.isSectionBreak)&&n--,this.selection.end.setPositionForSelection(i.fieldEnd.line,i.fieldEnd,n,this.selection.end.location),this.delete()),r=this.constructTocFieldCode(e),s=this.selection.start.isAtParagraphStart,o=this.selection.getParagraphInfo(this.selection.start),i=this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString()),0<(n=this.buildToc(this.validateTocSettings(e),r,!0,s)).length?(o=new Lai,e=new Gai(o),o.childWidgets.push(e),r=0,s=n[r=s?r:1].childWidgets[0].children[0],this.appendEndField(s,e),n.push(o),this.appendEmptyPara(n)):((r=new Cn("documenteditor",this.owner.defaultLocale)).setLocale(this.owner.locale),WC.alert({title:r.getConstant("No Headings"),content:r.getConstant("Add Headings"),showCloseIcon:!0,closeOnEscape:!0,position:{X:"center",Y:"center"},animationSettings:{effect:"Zoom"}}).enableRtl=this.owner.enableRtl),this.setPositionForCurrentIndex(this.selection.start,i),this.selection.end.setPositionInternal(this.selection.start),(s=new Sai).sectionFormat=new ari(s),s.childWidgets=n,this.pasteContentsInternal([s],!1),this.updatePageRef(),this.isInsertingTOC=!1,this.editorHistory&&(this.editorHistory.updateComplexHistory(),this.updateHistoryForComments(t)),0===n.length&&(this.owner.editorHistoryModule.undo(),this.owner.editorHistoryModule.redoStack.pop()))},c.prototype.appendEmptyPara=function(e){var t=new Lai,i=new Gai(t);t.childWidgets.push(i),e.push(t)},c.prototype.constructTocFieldCode=function(e){var t="TOC",e=(je(e.startLevel)||0===e.startLevel||je(e.endLevel)||0===e.endLevel||(t=t+' \\o "'+e.startLevel+"-"+e.endLevel+'"'),e.includePageNumber&&!e.rightAlign&&(t+=' \\p " "'),e.includePageNumber||(t+=" \\n"),e.includeHyperlink&&(t+=" \\h \\z"),e.includeOutlineLevels&&(t+=" \\u"),this.constructTSwitch(e));return 6<e.length&&(t+=e),t},c.prototype.constructTSwitch=function(e){var t="";if(!je(e.levelSettings))for(var i=0,n=Object.keys(e.levelSettings);i<n.length;i++)var o=n[i],t=t+o+","+e.levelSettings[o].toString()+",";return t=' \\t "'+(t=t.slice(0,-1))+'"'},c.prototype.appendEndField=function(e,t){var i=new Zai(1);i.fieldSeparator=e.fieldSeparator,(e.fieldSeparator.fieldEnd=i).fieldBegin=e,(i.fieldBegin.fieldEnd=i).line=t,0<e.revisions.length&&((e=e.revisions[e.revisions.length-1]).range.push(i),this.owner.trackChangesPane.updateCurrentTrackChanges(e),i.revisions.push(e)),t.children.push(i)},c.prototype.validateTocSettings=function(e){return(je(e.startLevel)||e.startLevel<1)&&(e.startLevel=1),(je(e.endLevel)||e.endLevel<e.endLevel)&&(e.endLevel=3<e.startLevel?e.startLevel:3),je(e.includeHyperlink)&&(e.includeHyperlink=!1),je(e.includePageNumber)&&(e.includePageNumber=!1),je(e.rightAlign)&&(e.rightAlign=!1),je(e.levelSettings)&&(e.levelSettings={}),e},c.prototype.buildToc=function(e,t,i,n,o){var r,s=this.documentHelper.pages[0].bodyWidgets[0],a=[],l=(this.createHeadingLevels(e),e.includeOutlineLevels&&this.createOutlineLevels(e),this.selection.start.paragraph.bodyWidget.sectionFormat),h=s.childWidgets[0];for(!je(this.owner.optionsPaneModule)&&this.owner.optionsPaneModule.isHeadingTab&&(this.owner.optionsPaneModule.isBuildHeading=!0);void 0!==h;)!(h instanceof Lai)||o&&h.isInsideTable||!(this.isHeadingStyle(h)||e.includeOutlineLevels&&this.isOutlineLevelStyle(h))||je(r=this.insertTocBookmark(h,o))||(this.createTOCWidgets(h,a,t,r,e,i,n,l,o),i=!1),h=this.selection.getNextParagraphBlock(h.getSplitWidgets().pop());return this.tocStyles={},!je(this.owner.optionsPaneModule)&&this.owner.optionsPaneModule.isHeadingTab&&(this.owner.optionsPaneModule.isBuildHeading=!1),a},c.prototype.createOutlineLevels=function(e){for(var t=e.startLevel;t<=e.endLevel;t++){var i="Level"+t.toString();je(this.tocStyles[i])&&(this.tocStyles[i]=t)}},c.prototype.createHeadingLevels=function(e){for(var t=e.startLevel;t<=e.endLevel;t++){var i="Heading "+t.toString();je(this.tocStyles[i])&&(this.tocStyles[i]=t)}if(!je(e.levelSettings))for(var n=0,o=Object.keys(e.levelSettings);n<o.length;n++){var r=o[n];this.tocStyles[r]=e.levelSettings[r]}},c.prototype.isHeadingStyle=function(e){e=e.paragraphFormat.baseStyle;return void 0!==e&&!je(this.tocStyles[e.name])},c.prototype.isOutlineLevelStyle=function(e){e=e.paragraphFormat.outlineLevel;return!je(this.tocStyles[e])},c.prototype.createTocFieldElement=function(e,t,i){var n=new Zai(0),o=(n.hasFieldEnd=!0,(n.line=e).children.push(n),new pli),t=(o.text=t,(o.line=e).children.push(o),new Zai(2));return t.fieldBegin=n,((t.fieldBegin.fieldSeparator=t).line=e).children.push(t),n},c.prototype.createTOCWidgets=function(e,t,i,n,o,r,s,a,l){for(var h,d,p,c=void 0,u=void 0,g=void 0,m=!1,f=(1!==t.length||3!==t[0].childWidgets[0].children.length||je(r)||r?(u=new Lai,p=void 0,h=e.paragraphFormat.baseStyle.name,p=o.includeOutlineLevels&&je(this.tocStyles[h])?e.paragraphFormat.outlineLevel:h,h="TOC "+this.tocStyles[p],p="Heading "+this.tocStyles[p],d=void 0,l?je(d=this.documentHelper.styles.findByName(p,"Paragraph"))&&(this.documentHelper.owner.parser.parseStyle(JSON.parse(this.getCompleteStyles()),JSON.parse(this.documentHelper.preDefinedStyles.get(p)),this.documentHelper.styles,!0),d=this.documentHelper.styles.findByName(p,"Paragraph")):je(d=this.documentHelper.styles.findByName(h,"Paragraph"))&&(this.documentHelper.owner.parser.parseStyle(JSON.parse(this.getCompleteStyles()),JSON.parse(this.documentHelper.preDefinedStyles.get(h)),this.documentHelper.styles,!0),d=this.documentHelper.styles.findByName(h,"Paragraph")),u.paragraphFormat.applyStyle(d),o.rightAlign&&o.includePageNumber&&((p=new yri).position=a.pageWidth-(a.leftMargin+a.rightMargin),p.tabLeader=o.tabLeader,p.deletePosition=0,p.tabJustification="Right",u.paragraphFormat.tabs.push(p)),g=new Gai(u),u.childWidgets.push(g)):g=t[0].childWidgets[0],void 0!==r&&r&&(je(s)||s||(this.appendEmptyPara(t),m=!0),this.createTocFieldElement(g,i)),""),y=!1,v=e;v instanceof Lai;){for(var b=0;b<v.childWidgets.length;b++)for(var w=v.childWidgets[b],C=0;C<w.children.length;C++){var S=w.children[C];S.isPageBreak||S.isColumnBreak||(S instanceof Zai||S instanceof Dli||y?S instanceof Zai&&(0===S.fieldType?y=!0:2===S.fieldType&&(y=!1)):(S instanceof pli||S instanceof lhi)&&(f+=S=-1!==(S=S.text).indexOf("\t")?S.replace(new RegExp("\t","g")," "):S))}v=v.nextSplitWidget}""!==f&&(o.includeHyperlink&&void 0!==n?c=this.insertTocHyperlink(g,n,f,e):((h=new pli).text=f,(h.line=g).children.push(h)),o.includePageNumber&&void 0!==n&&(o.rightAlign&&((d=new Ili).text="\t",(d.line=g).children.push(d)),a=this.insertTocPageNumber(n,g,o.rightAlign,e),this.appendEndField(a,g)),o.includeHyperlink)&&void 0!==c&&this.appendEndField(c,g),je(u)||""===f&&!r||(t.push(u),l)||!this.owner.enableTrackChanges||je(u)||(1===t.length||m?this.insertRevisionForBlock(u,"Insertion",!0):(p=this.owner.revisionsInternal.changes[0],this.insertRevisionForBlock(u,"Insertion",!0,p)))},c.prototype.insertTocHyperlink=function(e,t,i,n){var t=this.createTocFieldElement(e,' HYPERLINK \\l "'+t+'" ',!0),o=new pli,i=(o.text=i,n.paragraphFormat.baseStyle.name);return this.documentHelper.styles.findByName(i,"Paragraph").characterFormat.isEqualTocFormat(n.characterFormat)?(i=this.documentHelper.styles.findByName("Normal","Paragraph"),o.characterFormat.copyTocFormat(i.characterFormat)):o.characterFormat.copyTocFormat(n.characterFormat),(o.line=e).children.push(o),t},c.prototype.getPageNumber=function(e){e=e.bodyWidget.sectionFormat.restartPageNumbering?e.bodyWidget.page.currentPageNum:this.documentHelper.pages.indexOf(e.bodyWidget.page)+1;return e},c.prototype.insertTocPageNumber=function(e,t,i,n){var o=this.createTocFieldElement(t," PAGEREF"+e+" \\h ",!0),n=this.getPageNumber(n).toString(),r=new Sli;return r.fieldBegin=o,r.text=n=i?n:" "+n,(r.line=t).children.push(r),this.pageRefFields[e]=r,o},c.prototype.updatePageRef=function(){for(var e=0,t=Object.keys(this.pageRefFields);e<t.length;e++){var i,n,o=t[e];this.documentHelper.bookmarks.containsKey(o)&&(i=this.documentHelper.bookmarks.get(o),(i=this.getPageNumber(i.paragraph).toString())!==(o=this.pageRefFields[o]).text)&&(o.isWidthUpdated=!1,o.text=i,n=(i=o.paragraph).childWidgets.indexOf(o.line),o=o.line.children.indexOf(o),je(i.containerWidget)||this.documentHelper.layout.reLayoutParagraph(i,n,o))}},c.prototype.insertTocBookmark=function(e,t){var i=void 0;if(0<e.childWidgets.length){var e=e.getSplitWidgets(),n=e[0],e=e.pop(),n=n.childWidgets[0],e=e.childWidgets[e.childWidgets.length-1];if(void 0!==n&&void 0!==e){var o=n.children[0];if(o instanceof lhi||o instanceof Khi)for(;(o=o.nextNode)instanceof lhi||o instanceof Khi;);if(!je(o)&&o instanceof Dli&&0===o.bookmarkType&&o.name.toLowerCase().match("^_toc"))return o.name;var r=e.children[e.children.length-1];void 0===o||void 0===r||this.isRemoteAction||(this.selection.start.setPositionForSelection(n,o,0,this.selection.start.location),this.selection.end.setPositionForSelection(e,r,r.length,this.selection.end.location),i=this.generateBookmarkName(),this.insertBookmark(i,t))}}return i},c.prototype.generateBookmarkName=function(){var e="";do{this.tocBookmarkId++;for(var t=10-this.tocBookmarkId.toString().length,i="";0<t-1;)i="0"+i,t--}while(e="_Toc"+i+this.tocBookmarkId,this.documentHelper.bookmarks.containsKey(e));return e},c.prototype.onCellContentAlignment=function(e,t){this.owner.isShiftingEnabled=!0;var i,n=this.owner.selectionModule;n.isEmpty&&n.start.paragraph.isInsideTable?(this.owner.editorHistoryModule&&this.owner.editorHistoryModule.initComplexHistory(n,"MultiSelection"),n.selectTableCell(),this.initHistory("CellContentVerticalAlignment"),i=n.start.paragraph.associatedCell.cellFormat,this.applyCellPropertyValue(n,"verticalAlignment",e,i),this.reLayout(n,!1),this.initHistory("TextAlignment"),this.updateParagraphFormat("textAlignment",t,!1),this.reLayout(this.owner.selectionModule,!1)):(this.owner.editorHistoryModule&&this.owner.editorHistoryModule.initComplexHistory(n,"MultiSelection"),je(n.getTable(n.start,n.end))||(this.updateSelectionTableFormat(n,"CellContentVerticalAlignment",e),this.reLayout(this.owner.selectionModule,!1),this.initHistory("TextAlignment"),this.updateSelectionParagraphFormatting("textAlignment",t,!1),this.reLayout(n,!1))),this.owner.editorHistoryModule&&this.owner.editorHistoryModule.updateComplexHistory()},c.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 o=i.ownerRow.childWidgets.indexOf(i),r=i.ownerRow.childWidgets.indexOf(n),s=[],a=[],l=o;l<=r;l++){var h=this.addEditElement(e),d=(l==o&&this.editorHistory&&this.editorHistory.currentHistoryInfo&&(this.editorHistory.currentHistoryInfo.editRangeStart=h),h.columnFirst=l,h.columnLast=l,h.line=t.start.currentWidget,h.editRangeEnd);d.line=t.end.currentWidget,s.push(h),a.push(d),this.insertElements(void 0,[h])}for(var p=this.selection.getLastParagraph(n).lastChild,c=0;c<a.length;c++)a[c].line=p,0==c&&(this.selection.start.setPositionParagraph(p,this.selection.getLineLength(p)),this.selection.end.setPositionParagraph(p,this.selection.getLineLength(p))),this.insertElements(void 0,[a[c]]);this.editorHistory&&this.editorHistory.updateComplexHistoryInternal();var u=s[0].line.getOffset(s[0],1);this.selection.start.setPositionParagraph(s[0].line,u),u=a[0].line.getOffset(a[0],1),this.selection.end.setPositionParagraph(a[0].line,u)}else{this.insertEditRangeInsideTable(i,n,e),this.editorHistory&&this.editorHistory.updateComplexHistoryInternal();i=this.documentHelper.getFirstParagraphInCell(i).childWidgets[0],n=this.selection.getLastParagraph(n).childWidgets[0],u=i.getOffset(i.children[0],1);this.selection.start.setPositionParagraph(i,u),u=n.getOffset(n.children[0],1),this.selection.end.setPositionParagraph(n,u)}this.selection.fireSelectionChanged(!0),this.fireContentChange()}else this.addRestrictEditingForSelectedArea(e);this.selection.skipEditRangeRetrieval=!1}},c.prototype.insertEditRangeInsideTable=function(e,t,i){for(var n=(d=e.ownerTable.combineWidget(this.owner.viewer)).childWidgets.indexOf(t.ownerRow),o=d.childWidgets.indexOf(e.ownerRow),r=(a=this.selection.getCellLeft(e.ownerRow,e))+e.cellFormat.cellWidth,s=this.selection.getCellLeft(t.ownerRow,t),t=s+t.cellFormat.cellWidth,s=this.updateSelectedCellsInTable(a,r,s,t),a=s.start,r=s.end,l=[],h=o;h<=n;h++){for(var d,p=(d=e.ownerTable.combineWidget(this.owner.viewer)).childWidgets[h],c=-1,u=-1,g=0;g<p.childWidgets.length;g++){var m=p.childWidgets[g],m=this.selection.getCellLeft(p,m);this.checkCellWithInSelection(a,r,m)&&(-1===c&&(c=g),u=g)}for(var f=[],y=c;y<=u;y++){var v=void 0,b=void 0,w=(c<=y&&y<=u&&(C=p.childWidgets[c],b=(v=this.documentHelper.getFirstParagraphInCell(C)).childWidgets[0]),this.addEditElement(i)),C=(y===c&&(this.editorHistory&&this.editorHistory.currentHistoryInfo&&(this.editorHistory.currentHistoryInfo.editRangeStart=w),this.selection.start.setPositionParagraph(b,this.selection.getStartOffset(v)),this.selection.end.setPositionParagraph(b,this.selection.getStartOffset(v))),w.columnFirst=y,w.columnLast=y,w.line=b,this.insertElements(void 0,[w]),w.editRangeEnd);if(f.push(C),0<l.length&&y===u){for(var S=0;S<l.length;S++)l[S].line=w.line,this.insertElements(void 0,[l[S]]);l=[]}}if(l=f,h===n&&0<l.length)for(var A=p.childWidgets[u],x=this.selection.getLastParagraph(A).lastChild,S=0;S<l.length;S++)l[S].line=x,0==S&&(this.selection.start.setPositionParagraph(x,this.selection.getLineLength(x)),this.selection.end.setPositionParagraph(x,this.selection.getLineLength(x))),this.insertElements(void 0,[l[S]])}},c.prototype.addRestrictEditingForSelectedArea=function(e){var e=this.addEditElement(e),t=e.editRangeEnd,i=(this.editorHistory&&this.editorHistory.currentHistoryInfo&&(this.editorHistory.currentHistoryInfo.editRangeStart=e),this.owner.isShiftingEnabled=!0,this.insertElements([t],[e]),this.editorHistory&&this.editorHistory.updateComplexHistoryInternal(),e.line.getOffset(e,1)),e=(this.selection.start.setPositionParagraph(e.line,i),i=t.line.getOffset(t,1),this.selection.end.setPositionParagraph(t.line,i),this.documentHelper.blockToShift);!je(e)&&this.viewer instanceof nai&&1<e.bodyWidget.sectionFormat.columns.length&&(je((t=this.documentHelper.layout.getBodyWidget(e.bodyWidget,!1)).nextRenderedWidget)||"NoBreak"!==t.nextRenderedWidget.sectionFormat.breakCode||t.page!==t.nextRenderedWidget.page||this.reLayout(this.selection)),this.owner.isShiftingEnabled=!1,this.selection.fireSelectionChanged(!0),this.fireContentChange()},c.prototype.addEditElement=function(e,t){var i=new ghi,e=("everyone"===e.toLocaleLowerCase()?i.group=e:i.user=e,new phi);return(e.editRangeStart=i).editRangeEnd=e,t?(i.editRangeId=t,e.editRangeId=t):(t=this.getEditRangeID(9),i.editRangeId=t,e.editRangeId=t),this.editStartRangeCollection.push(i),this.addEditCollectionToDocument(),this.editStartRangeCollection=[],i},c.prototype.getEditRangeID=function(e){var t=Math.pow(10,e-1),i=Math.pow(10,e)-1,i=Math.floor(Math.random()*(i-t+1))+t;return this.editRangeID.includes(i)?this.getEditRangeID(e):(this.editRangeID.push(i),i)},c.prototype.protect=function(e){this.documentHelper.isDocumentProtected=!0,this.documentHelper.protectionType=e,this.selection.highlightEditRegion(),this.editorHistory&&this.editorHistory.destroy()},c.prototype.addEditCollectionToDocument=function(){for(var e=0;e<this.editStartRangeCollection.length;e++){var t,i=this.editStartRangeCollection[e],n=""===i.user?i.group:i.user;0<this.documentHelper.editRanges.length&&this.documentHelper.editRanges.containsKey(n)?this.documentHelper.editRanges.get(n).push(i):((t=[]).push(i),this.documentHelper.editRanges.add(n,t))}this.selection.updateEditRangeCollection()},c.prototype.updateRangeCollection=function(e,t){var i;0<this.documentHelper.editRanges.length&&this.documentHelper.editRanges.containsKey(t)?-1===this.documentHelper.editRanges.get(t).indexOf(e)&&this.documentHelper.editRanges.get(t).push(e):((i=[]).push(e),this.documentHelper.editRanges.add(t,i))},c.prototype.removeUserRestrictions=function(e){var t,i,n;(this.selection.checkSelectionIsAtEditRegion()||this.selection.isEditRangeCellSelected())&&(this.selection.skipEditRangeRetrieval=!0,t=this.selection.getEditRangeStartElement(),this.selection.skipEditRangeRetrieval=!0,i=this.selection.start,n=this.selection.end,this.selection.isForward||(i=this.selection.end,n=this.selection.start),!this.selection.isEmpty&&i.paragraph.isInsideTable&&n.paragraph.isInsideTable&&this.selection.isCellSelected(i.paragraph.associatedCell,i,n)?(i=i.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer),n=n.paragraph.associatedCell,i.contains(n)&&this.removeEditRangeElementsOnTable(e)):this.removeEditRangeElements(t,e),this.fireContentChange(),this.selection.skipEditRangeRetrieval=!1)},c.prototype.removeEditRangeElements=function(e,t){this.initHistory("RemoveEditRange"),this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo.markerData.push(this.getMarkerData(e)),this.editorHistory.currentBaseHistoryInfo.setEditRangeInfo(e),this.editorHistory.updateHistory()),e.user!==t&&e.group!==t||this.removeUserRestrictionsInternal(e,t),this.selection.updateEditRangeCollection()},c.prototype.removeEditRangeElementsOnTable=function(e){var t=this.selection.selectedWidgets.keys;if(t){this.initComplexHistory("RemoveEditRange");for(var i=0;i<t.length;i++)if(t[i]instanceof Uai){var n=t[i],o=n.containerWidget.editRangeID.values;if(0<o.length){for(var r=void 0,s=0,a=o;s<a.length;s++){var l=a[s];l.columnFirst==n.index&&l.columnLast==n.index&&(r=l)}r&&(o=r.editRangeEnd,this.selection.start.setPositionParagraph(r.line,r.line.getOffset(r,r.length)),this.selection.end.setPositionParagraph(o.line,o.line.getOffset(o,o.length)-1),r.user!==e&&r.group!==e||this.removeEditRangeElements(r,e))}}this.editorHistory&&this.editorHistory.updateComplexHistoryInternal()}},c.prototype.removeUserRestrictionsInternal=function(e,t,i){var n=t,t=(je(t)&&(n=""===e.user?e.group:e.user),this.documentHelper.editRanges.get(n).indexOf(e));this.documentHelper.editRanges.get(n).splice(t,1),0===this.documentHelper.editRanges.get(n).length&&this.documentHelper.editRanges.remove(n),-1!=e.columnFirst&&-1!=e.columnLast&&this.removeEditRangeFromCollection(e),e.removeEditRangeMark(),i||(e.editRangeEnd.line.children.splice(e.editRangeEnd.indexInOwner,1),e.line.children.splice(e.indexInOwner,1))},c.prototype.removeEditRangeFromCollection=function(e){var t=e.paragraph.associatedCell.ownerRow;if(t.editRangeID.containsKey(e.editRangeId)){var i=t.getCellUsingColumnIndex(t.rowIndex,e.columnFirst);je(i)||i.isRenderEditRangeStart&&i.isRenderEditRangeEnd&&(i.isRenderEditRangeEnd=!1,i.isRenderEditRangeStart=!1,t.editRangeID.remove(e.editRangeId))}else for(var n=e.paragraph.associatedCell.ownerTable,o=t.rowIndex-1;0<=o;o--){var r=n.childWidgets[o];if(r.editRangeID.containsKey(e.editRangeId)){var s=r.getCellUsingColumnIndex(r.rowIndex,e.columnFirst);if(!je(s)&&s.isRenderEditRangeStart&&s.isRenderEditRangeEnd){s.isRenderEditRangeEnd=!1,s.isRenderEditRangeStart=!1,r.editRangeID.remove(e.editRangeId);break}}}},c.prototype.removeAllEditRestrictions=function(){this.selection.skipEditRangeRetrieval=!0;for(var e=this.selection.start,t=this.selection.end,i=[],n=this.documentHelper.editRanges.keys,o=0;o<n.length;o++)for(var i=this.documentHelper.editRanges.get(n[o]),r=0;r<i.length;r++)i[r].editRangeEnd.line.children.splice(i[r].editRangeEnd.indexInOwner,1),i[r].line.children.splice(i[r].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},c.prototype.insertFormField=function(e){var t;je(this.selection.start)||this.owner.enableHeaderAndFooter||this.selection.isPlainContentControl()||(this.initHistory("InsertHyperlink"),t=!0,(t=this.selection.isEmpty?t:this.removeSelectedContents(this.selection))&&this.insertFormFieldInternal(e))},c.prototype.insertFormFieldInternal=function(e){this.updateInsertPosition();var t=[],i=this.getCharacterFormat(this.selection),n=new Eri(void 0),i=(n.copyFormat(i),new Zai(0)),o=(i.formFieldData=this.getFormFieldData(e),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.formFieldType=e,this.editorHistory.currentBaseHistoryInfo.fieldBegin=i),i.characterFormat.copyFormat(n),t.push(i),new Dli(0)),r=(o.characterFormat.copyFormat(n),i.formFieldData.name=this.getBookmarkName(e,"Insert",this.formFieldCounter),o.name=i.formFieldData.name,t.push(o),new pli),r=(r.text=this.getFormFieldCode(e),t.push(r),new Zai(2)),s=(t.push(r),new pli),e=(s.characterFormat.copyFormat(n),"CheckBox"===e?(s.text=String.fromCharCode(9744),this.documentHelper.layout.setCheckBoxFontSize(i.formFieldData,s.characterFormat)):s.text=this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5),t.push(s),new Zai(1)),s=(e.characterFormat.copyFormat(n),t.push(e),i.fieldSeparator=e.fieldSeparator=r,i.fieldEnd=r.fieldEnd=e,r.fieldBegin=e.fieldBegin=i,new Dli(1)),r=(s.characterFormat.copyFormat(n),s.name=i.formFieldData.name,(s.reference=o).reference=s,t.push(s),this.documentHelper.layout.isInsertFormField=!0,this.insertElement(t),this.documentHelper.layout.isInsertFormField=!1,this.selection.start.paragraph,e.linkFieldCharacter(this.documentHelper),-1===this.documentHelper.fields.indexOf(i)&&this.documentHelper.fields.push(i),this.addFormFieldWidget(i),s.line.getOffset(s,1));this.selection.selects(s.line,r,!0),this.updateEndPosition(),this.reLayout(this.selection,!0)},c.prototype.addFormFieldWidget=function(e){if(-1===this.documentHelper.formFields.indexOf(e)){var t=!1;if(0<this.documentHelper.formFields.length)for(var i=this.selection.getElementPosition(e).startPosition,n=0;n<this.documentHelper.formFields.length;n++){var o=this.selection.getElementPosition(this.documentHelper.formFields[n]).startPosition;if(i.isExistBefore(o)){t=!0,this.documentHelper.formFields.splice(n,0,e);break}}t||this.documentHelper.formFields.push(e)}},c.prototype.getFormFieldData=function(e){switch(e){case"Text":return new ili;case"CheckBox":return new rli;case"DropDown":return new lli}},c.prototype.setFormField=function(e,t){var i,n;je(t.format)?je(t.sizeType)?je(t.dropdownItems)||(i="DropDown",n=new lli):(i="CheckBox",n=new rli):(i="Text",n=new ili),je(i)||je(n)||(n.name=(je(t.name)?e.formFieldData:t).name,n.copyFieldInfo(t),this.editFormField(i,n))},c.prototype.editFormField=function(e,t){var i,n=this.selection.getCurrentFormField();if(je(n)||je(n.formFieldData))return!1;this.initComplexHistory("FormField"),""!==t.name&&(n.formFieldData.name!==t.name&&this.documentHelper.bookmarks.containsKey(t.name)&&this.deleteBookmark(t.name),(l=new Dli(0)).name=t.name,(i=new Dli(1)).name=t.name,(l.reference=i).reference=l),this.initHistory("InsertHyperlink"),this.editHyperlinkInternal=je(this.editorHistory)||this.editorHistory&&je(this.editorHistory.currentBaseHistoryInfo);var o=n.characterFormat.cloneFormat(),r=new Eri,o=(r.copyFormat(o),n.fieldSeparator.nextElement.characterFormat.cloneFormat()),s=n.line.getOffset(n,0),a=(this.selection.start.setPositionParagraph(n.line,s),n.fieldEnd),n=(s=(a=n.nextNode&&n.nextNode instanceof Dli?n.nextNode.reference:a).line.getOffset(a,1),this.selection.end.setPositionParagraph(a.line,s),this.skipFieldDeleteTracking=!0,this.deleteSelectedContents(this.selection,!1),this.skipFieldDeleteTracking=!1,this.updateInsertPosition(),[]),a=new Zai(0),s=(a.formFieldData=t,this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.formFieldType=e,this.editorHistory.currentBaseHistoryInfo.fieldBegin=a),n.push(a),a.characterFormat.copyFormat(r),je(l)||n.push(l),new pli),l=(s.text=this.getFormFieldCode(e),n.push(s),new Zai(2)),o=(l.characterFormat.copyFormat(r),n.push(l),(s=new pli).characterFormat.copyFormat(o),s.text=this.getDefaultText(t),"CheckBox"===e?(s.characterFormat.copyFormat(a.characterFormat),"Exactly"===t.sizeType&&(s.characterFormat.fontSize=1.35*t.size)):t instanceof ili&&""!==t.defaultValue&&("Text"===t.type?s.text=Y.formatText(t.format,t.defaultValue):"Number"===t.type?s.text=Y.formatNumber(t.format,t.defaultValue):s.text=Y.formatDate(t.format,t.defaultValue)),n.push(s),new Zai(1)),e=(o.characterFormat.copyFormat(r),n.push(o),o),t=(je(i)||(e=i,n.push(i)),a.fieldSeparator=o.fieldSeparator=l,a.fieldEnd=l.fieldEnd=o,l.fieldBegin=o.fieldBegin=a,this.documentHelper.layout.isInsertFormField=!0,this.insertElement(n),this.documentHelper.layout.isInsertFormField=!1,this.selection.start.paragraph,o.linkFieldCharacter(this.documentHelper),-1===this.documentHelper.fields.indexOf(a)&&this.documentHelper.fields.push(a),this.addFormFieldWidget(a),e.line.getOffset(e,1));return this.selection.selects(e.line,t,!0),this.updateEndPosition(),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.editorHistory.updateHistory(),this.editorHistory&&this.editorHistory.currentHistoryInfo&&(this.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.editorHistory.updateComplexHistory(),this.isSkipOperationsBuild=!1),this.reLayout(this.selection,!0),this.editHyperlinkInternal=!1,this.nodes=[],!0},c.prototype.getDefaultText=function(e){var t="";return e instanceof rli?t=e.defaultValue?String.fromCharCode(9745):String.fromCharCode(9744):e instanceof lli?t=0<e.dropdownItems.length?e.dropdownItems[0]:this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5):e instanceof ili&&(t=""!==e.defaultValue?e.defaultValue:this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5)),t},c.prototype.getFormFieldCode=function(e){switch(e){case"Text":return"FORMTEXT";case"CheckBox":return"FORMCHECKBOX";case"DropDown":return"FORMDROPDOWN"}},c.prototype.toggleCheckBoxFormField=function(e,t,i){var n,o=e.formFieldData;o instanceof rli&&o.enabled&&(this.initHistory("UpdateFormField"),this.editorHistory&&(n=void 0,o instanceof rli&&(n=o.checked),this.editorHistory.currentBaseHistoryInfo.fieldBegin=e,this.editorHistory.currentBaseHistoryInfo.setFormFieldInfo(e,n),this.editorHistory.updateHistory()),o.checked=t?i:!o.checked,n=e.fieldSeparator.nextNode,o.checked?n.text=String.fromCharCode(9745):n.text=String.fromCharCode(9744),n.isWidthUpdated=!1,this.owner.documentHelper.layout.reLayoutParagraph(e.line.paragraph,0,0),this.reLayout(this.selection,!1))},c.prototype.toggleContentControlCheckBox=function(e,t){je(this.editorHistory)||this.editorHistory.isUndoing||this.editorHistory.isRedoing||(this.selection.selectContentInternal(e),this.initHistory("UpdateContentControl")),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.editorHistory.currentBaseHistoryInfo.setContentControlCheckBox(e,t);var i=e.nextNode,n=((i=(i=i instanceof ghi||i instanceof phi?i.nextNode:i)instanceof pli||je(this.selection)?i:this.selection.getNextTextElement(i)).isWidthUpdated=!1,t?e.contentControlProperties.checkedState:e.contentControlProperties.uncheckedState);je(n.font)||je(n.value)?i.text=String.fromCharCode(t?9746:9744):(i.characterFormat.fontFamily=n.font,i.characterFormat.fontFamilyAscii=n.font,i.characterFormat.fontFamilyFarEast=n.font,i.characterFormat.fontFamilyNonFarEast=n.font,i.text=n.value),e.contentControlProperties.isChecked=t,this.reLayout(this.selection,!0)},c.prototype.updateFormField=function(e,t,i){var n=e.formFieldData;n&&this.updateFormFieldInternal(e,n,t,i)},c.prototype.updateContentControl=function(e,t,i){var n;"RichText"===e.contentControlProperties.type||"Text"===e.contentControlProperties.type||"Date"===e.contentControlProperties.type||"Picture"===e.contentControlProperties.type?this.updateContentControlResult(e,t,i):"CheckBox"===e.contentControlProperties.type?this.toggleContentControlCheckBox(e,"true"===t&&!i):"ComboBox"!==e.contentControlProperties.type&&"DropDownList"!==e.contentControlProperties.type||(n=new Rli,i?(i=new Cn("documenteditor",this.owner.defaultLocale),n.displayText=i.getConstant("Choose an item"),n.value=i.getConstant("Choose an item")):(n.displayText=t,n.value=t),e.contentControlProperties.contentControlListItems.push(n),this.dropDownChange(e,n.displayText))},c.prototype.updateContentControlResult=function(e,t,i){if(this.selection.selectContentControlInternal(e),"Picture"===e.contentControlProperties.type)this.insertImageAsync(t=i?"":t);else if((i||je(t)||""===t)&&((i=new Cn("documenteditor",this.owner.defaultLocale)).setLocale(this.owner.locale),t="Date"===e.contentControlProperties.type?i.getConstant("Default Date Picker"):i.getConstant("Default Content Control Text")),"RichText"===e.contentControlProperties.type){try{"object"!=typeof t&&(t=JSON.parse(t))}catch(e){t=JSON.stringify({sections:[{blocks:[{inlines:[{text:t}]}]}]})}this.paste(t),this.updatePropertiesToBlock(e,!0)}else this.insertText(t)},c.prototype.getContentControlPropObject=function(e){return je(this.owner.sfdtExportModule)?{}:this.documentHelper.owner.sfdtExportModule.contentControlProperty(e,1)},c.prototype.assignContentControl=function(e,t){this.owner.parser&&this.owner.parser.parseContentControlProperties(t,e,1)},c.prototype.updateFormFieldInternal=function(e,t,i,n){t instanceof ili?(n=i=""===i?n?this.getDefaultText(t):this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5):i,"Text"===t.type&&""!==t.format&&(n=Y.formatText(t.format,i)),this.updateFormFieldResult(e,n)):t instanceof lli&&(n=t.dropdownItems[i],t.selectedIndex=i,this.updateFormFieldResult(e,n));t=e.fieldEnd.line.getOffset(e.fieldEnd,1),i=new rci(this.owner);i.setPositionParagraph(e.fieldEnd.line,t),this.documentHelper.selection.selectRange(i,i),this.reLayout(this.selection,!1)},c.prototype.updateFormFieldResult=function(e,t){this.selection.selectFieldInternal(e,!1,!0),this.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.insertText(t),this.isSkipOperationsBuild=!1},c.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},c.prototype.getBookmarkName=function(e,t,i){for(var n,o=!1;!1===o;)o=this.checkBookmarkAvailability(n=e+i,t),i+=1;return n},c.prototype.applyFormTextFormat=function(e){var t,i;je(e)||(t=i=this.getFieldResultText(e),i=Y.formatText(e.formFieldData.format,i),null!=e.fieldSeparator&&this.applyTextFormatInternal(e,i),this.initHistory("FormTextFormat"),this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo.setFormFieldInfo(e,t),this.editorHistory.updateHistory()))},c.prototype.insertSpaceInFormField=function(){var e;this.documentHelper.isInlineFormFillProtectedMode&&this.selection.isInlineFormFillMode()&&(0!==(e=this.getFieldResultText()).length&&"\r"!==e||(this.insertTextInternal(this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5),!0),this.selection.selectTextElementStartOfField(this.selection.getCurrentFormField())))},c.prototype.getFieldResultText=function(e){je(e)&&(e=this.selection.getCurrentFormField());var t=this.selection.startOffset,i=this.selection.endOffset,e=(this.selection.isModifyingSelectionInternally=!0,this.selection.selectFieldInternal(e,!1,!0),this.selection.getText(!1));return this.selection.select(t,i),this.selection.isModifyingSelectionInternally=!1,e},c.prototype.contentControlDropDownChange=function(){var e=this.documentHelper.selection.currentContentControl;je(e)||("ComboBox"==e.contentControlProperties.type||"DropDownList"==e.contentControlProperties.type?this.documentHelper.contentDropDown.showPopUp(e):"Date"==e.contentControlProperties.type&&this.documentHelper.owner.dateContentDialogModule.show())},c.prototype.applyTextFormatInternal=function(e,t){var i=e.fieldSeparator.nextElement,n=0;t=t.replace(/\r/g,"");do{if(!je(i)&&i instanceof pli&&(i.text=t.slice(n,n+i.text.length),n+=i.length),je(i.nextElement))if(je(i.line.nextLine)){this.documentHelper.layout.layoutBodyWidgetCollection(i.paragraph.index,i.paragraph.bodyWidget,i.paragraph,!0);var o=i.paragraph.nextRenderedWidget;if(je(o))break;for(o instanceof _ai&&(o=this.documentHelper.getFirstParagraphBlock(o));o.isEmpty();)o=o.nextRenderedWidget;i=o.childWidgets[0].children[0]}else i=i.line.nextLine.children[0];else i=i.nextElement}while(!(i instanceof Zai&&1===i.fieldType&&i.fieldBegin.formFieldData instanceof ili));this.documentHelper.layout.layoutBodyWidgetCollection(i.paragraph.index,i.paragraph.bodyWidget,i.paragraph,!0),this.selection.isFormatUpdated=!0,this.reLayout(this.selection,!1),this.selection.isFormatUpdated=!1},c.prototype.constructCommentInitial=function(e){for(var t=e.split(" "),i="",n=0;n<t.length;n++)0<t[n].length&&""!==t[n]&&(i+=t[n][0]);return i},c.prototype.insertFootnote=function(){if(!(this.selection.isinFootnote||this.selection.isinEndnote||this.selection.isPlainContentControl())){this.isFootNoteInsert=!0,this.isFootNote=!0;var e,t=new fli,i=(t.characterFormat.baselineAlignment="Superscript",t.footnoteType="Footnote",t.text="s",new Lai),n=new Gai(i),o=new mdi,o=(i.paragraphFormat.afterSpacing=0,o.characterFormat.baselineAlignment="Superscript",o.line=n,o.text="?",n.children.push(o),new pli);if(o.text=" ",(o.line=n).children.push(o),i.childWidgets.push(n),t.bodyWidget.childWidgets.push(i),this.selection.isEmpty||this.selection.handleRightKey(),this.initInsertInline(t),t.paragraph.bodyWidget.page.footnoteWidget)for(var r=0;r<t.paragraph.bodyWidget.page.footnoteWidget.bodyWidgets.length;r++)t.paragraph.bodyWidget.page.footnoteWidget.bodyWidgets[r].footNoteReference===t&&(e=t.paragraph.bodyWidget.page.footnoteWidget.bodyWidgets[r].childWidgets[0]);this.selection.start.setPositionForLineWidget(e.childWidgets[0],o.line.getOffset(o,t.text.length)),this.selection.end.setPositionInternal(this.selection.start),this.updateFootNoteIndex(),this.reLayout(this.selection,!1),this.documentHelper.layout.isLayoutWhole=!0,this.isSkipOperationsBuild=!0,this.layoutWholeDocument(),this.isSkipOperationsBuild=!1,this.documentHelper.layout.isLayoutWhole=!1,this.separator("footnote"),this.continuationSeparator("footnote"),this.isFootNote=!1,this.isFootNoteInsert=!1}},c.prototype.updateFootnoteCollection=function(e){if(-1===this.documentHelper.footnoteCollection.indexOf(e)){var t=!1;if(0<this.documentHelper.footnoteCollection.length)for(var i=this.selection.getElementPosition(e).startPosition,n=0;n<this.documentHelper.footnoteCollection.length;n++){var o=this.selection.getElementPosition(this.documentHelper.footnoteCollection[n]).startPosition;if(i.isExistBefore(o)){t=!0,this.documentHelper.footnoteCollection.splice(n,0,e);break}}t||this.documentHelper.footnoteCollection.push(e)}},c.prototype.insertEndnote=function(){if(!(this.selection.isinFootnote||this.selection.isinEndnote||this.selection.isPlainContentControl())){this.documentHelper.layout.isEndnoteContentChanged=!0;var e,t=new fli,i=(t.characterFormat.baselineAlignment="Superscript",t.footnoteType="Endnote",t.text="s",new Lai),n=new Gai(i),o=new mdi,r=(i.paragraphFormat.afterSpacing=0,o.characterFormat.baselineAlignment="Superscript",o.line=n,o.text="?",n.children.push(o),new pli),n=(r.text=" ",(r.line=n).children.push(r),i.childWidgets.push(n),t.bodyWidget.childWidgets.push(i),this.selection.isEmpty||this.selection.handleRightKey(),this.initInsertInline(t),this.documentHelper.pages.length),s=this.documentHelper.pages[n-1].bodyWidgets[0];if(s.page.endnoteWidget)for(var a=0;a<s.page.endnoteWidget.bodyWidgets.length;a++)s.page.endnoteWidget.bodyWidgets[a].footNoteReference===t&&(e=s.page.endnoteWidget.bodyWidgets[a].childWidgets[0]);this.selection.start.setPositionForLineWidget(e.childWidgets[0],o.line.getOffset(r,t.text.length)),this.selection.end.setPositionInternal(this.selection.start),this.updateEndNoteIndex(),this.reLayout(this.selection,!1),this.documentHelper.layout.isLayoutWhole=!0,this.isSkipOperationsBuild=this.owner.enableCollaborativeEditing,this.layoutWholeDocument(),this.isSkipOperationsBuild=!1,this.documentHelper.layout.isLayoutWhole=!1,this.owner.documentHelper.blockToShift=void 0,this.separator("endnote"),this.continuationSeparator("endnote"),this.documentHelper.layout.isEndnoteContentChanged=!1}},c.prototype.updateEndnoteCollection=function(e){if(-1===this.documentHelper.endnoteCollection.indexOf(e)){var t=!1;if(0<this.documentHelper.endnoteCollection.length)for(var i=this.selection.getElementPosition(e).startPosition,n=0;n<this.documentHelper.endnoteCollection.length;n++){var o=this.selection.getElementPosition(this.documentHelper.endnoteCollection[n]).startPosition;if(i.isExistBefore(o)){t=!0,this.documentHelper.endnoteCollection.splice(n,0,e);break}}t||this.documentHelper.endnoteCollection.push(e);var r=this.documentHelper.pages.length;if(0<this.documentHelper.endnoteCollection.length){var s,a,l=!1,h=void 0,d=this.documentHelper.endnoteCollection.indexOf(e),p=1,c=void 0,u=this.documentHelper.pages[r-1].bodyWidgets[0];if(u.page.endnoteWidget)for(var g=0;g<u.page.endnoteWidget.bodyWidgets.length;g++){var m=this.documentHelper.endnoteCollection.indexOf(u.page.endnoteWidget.bodyWidgets[g].footNoteReference);if(d<m&&m-d==1){p=g,l=!0;break}}s=e,u.page.endnoteWidget instanceof Pai&&"Endnote"===u.page.endnoteWidget.footNoteType?h=u.page.endnoteWidget:(c=!0,(h=new Pai).footNoteType="Endnote",h.page=u.page,(r=new Lai).characterFormat=new Eri,r.paragraphFormat=new bri,r.index=0,a=new Gai(r),r.childWidgets.push(a),this.viewer.cutFromTop(this.viewer.clientActiveArea.y+18));for(var f=s.bodyWidget,g=0;g<s.bodyWidget.childWidgets.length;g++){var y=s.bodyWidget.childWidgets[g];this.documentHelper.layout.isLayoutWhole?y.containerWidget=void 0:((y.containerWidget=f).page=u.page,f.sectionFormat=h.sectionFormat,y.containerWidget.containerWidget=h),l?h.bodyWidgets.splice(p,0,f):h.bodyWidgets.push(f)}p++,c&&(u.page.endnoteWidget=h),h.height+=0}}},c.prototype.updateEndNoteIndex=function(){for(var e=this.documentHelper.endnoteCollection,t=0;t<e.length;t++){var i=this.documentHelper.layout.getFootEndNote(e[t].paragraph.bodyWidget.sectionFormat.endnoteNumberFormat,t+1);if(""!=i){if(e[t].text=i,void 0!==e[t].revisions)for(var n=0;n<e[t].revisions.length;)this.owner.trackChangesPane.updateCurrentTrackChanges(e[t].revisions[n]),n++;var o=e[t].bodyWidget.childWidgets[0].childWidgets[0].children[0];if(!je(o)&&((o instanceof mdi||Y.checkTextFormat(o.text))&&(o.text=i,o.width=e[t].bodyWidget.footNoteReference.width),null!=o.revisions))for(n=0;n<o.revisions.length;)this.owner.trackChangesPane.updateCurrentTrackChanges(o.revisions[n]),n++}}},c.prototype.separator=function(e){var t=new Lai,i=new Gai(t),n=new pli;n.characterFormat.fontColor="#00000000",n.line=i,n.text=String.fromCharCode(3),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)},c.prototype.continuationSeparator=function(e){var t=new Lai,i=new Gai(t),n=new pli;n.characterFormat.fontColor="#00000000",n.line=i,n.text=String.fromCharCode(4),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)},c.prototype.updateFootNoteIndex=function(){for(var e=this.documentHelper.footnoteCollection,t=0;t<e.length;t++){var i=this.documentHelper.layout.getFootEndNote(e[t].paragraph.bodyWidget.sectionFormat.footNoteNumberFormat,t+1);if(""!=i){if(e[t].text=i,void 0!==e[t].revisions)for(var n=0;n<e[t].revisions.length;)this.owner.trackChangesPane.updateCurrentTrackChanges(e[t].revisions[n]),n++;var o=e[t].bodyWidget.childWidgets[0].childWidgets[0].children[0];if(!je(o)&&o instanceof mdi&&(o.text=i,o.width=e[t].bodyWidget.footNoteReference.width,null!=o.revisions))for(n=0;n<o.revisions.length;)this.owner.trackChangesPane.updateCurrentTrackChanges(o.revisions[n]),n++}}},c.prototype.setCharFormatForCollaborativeEditing=function(e){var t;je(this.editorHistory)||je(this.editorHistory.currentBaseHistoryInfo)||!this.owner.enableCollaborativeEditing||(Y.writeCharacterFormat(t={},!0,e,void 0,!0),this.editorHistory.currentBaseHistoryInfo.type="CharacterFormat",this.editorHistory.currentBaseHistoryInfo.format=JSON.stringify(t))},c.prototype.clear=function(){this.pageRefFields&&(this.pageRefFields={})},c);function c(e){var n=this;this.nodes=[],this.editHyperlinkInternal=!1,this.startParagraph=void 0,this.endParagraph=void 0,this.formFieldCounter=1,this.skipFieldDeleteTracking=!1,this.skipFootNoteDeleteTracking=!1,this.isForHyperlinkFormat=!1,this.isTrackingFormField=!1,this.isInsertText=!1,this.casingIndex=-1,this.checkLastLetterSpace="",this.checkLastLetterSpaceDot="",this.pasteFootNoteType="",this.isInsertingText=!1,this.keywordIndex=0,this.dictionaryObjcetIDIncreament=1,this.dictionaryObjectIndexIncrement=0,this.XMLFilesCount=1,this.XMLFilesNameSpaceCount=1,this.xmlData=[],this.dictionaryObject=[],this.isFootnoteElementRemoved=!1,this.isEndnoteElementRemoved=!1,this.handledEnter=!1,this.handledTextInput=!1,this.removeEditRange=!1,this.isRemoveRevision=!1,this.isFootNoteInsert=!1,this.isTableInsert=!1,this.isFootNote=!1,this.isHandledComplex=!1,this.isUserInsert=!1,this.tableResize=void 0,this.tocStyles={},this.triggerPageSpellCheck=!0,this.chartType=!1,this.removedBookmarkElements=[],this.removedEditRangeStartElements=[],this.removedEditRangeEndElements=[],this.removedContentControlElements=[],this.tocBookmarkId=0,this.copiedData=void 0,this.isPasteContentCheck=!1,this.pageRefFields={},this.delBlockContinue=!1,this.delBlock=void 0,this.delSection=void 0,this.isInsertingTOC=!1,this.isMeasureParaWidth=!1,this.editStartRangeCollection=[],this.skipReplace=!1,this.skipTableElements=!1,this.editRangeID=[],this.isImageInsert=!1,this.isSkipOperationsBuild=!1,this.isCellFormatApplied=!1,this.revisionData=void 0,this.splittedRevisions=[],this.isSkipComments=!1,this.isRemoteAction=!1,this.isIncrementalSave=!1,this.listNumberFormat="",this.listLevelNumber=0,this.isXmlMapped=!1,this.restrictLayout=!1,this.isAutoList=!1,this.isLastParaMarkCopied=!1,this.combineLastBlock=!1,this.remotePasteRevision=[],this.isFieldOperation=!1,this.copiedContent="",this.copiedTextContent="",this.previousParaFormat=void 0,this.previousCharFormat=void 0,this.previousSectionFormat=void 0,this.pasteTextPosition=void 0,this.isPaste=!1,this.isPasteListUpdated=!1,this.isHtmlPaste=!1,this.isInsertField=!1,this.isBordersAndShadingDialog=!1,this.pasteImageIndex=void 0,this.onTextInputInternal=function(){if(F.isDevice){var e=n.documentHelper,t=new RegExp(String.fromCharCode(160),"g"),i=new RegExp(String.fromCharCode(10),"g");e.prefix=e.prefix.replace(t," ").replace(i," ");i=(t=e.editableDiv.textContent.replace(t," ").replace(i," ")).substring(2);if(e.isCompositionStart&&e.isCompositionUpdated)e.isCompositionUpdated=!1,!e.owner.isReadOnlyMode&&e.owner.isDocumentLoaded&&n.canEditContentControl&&e.prefix.substring(2)!==i&&(n.selection.isEmpty&&n.selection.start.setPositionForLineWidget(e.selection.start.currentWidget,n.selection.start.offset-(e.prefix.length-2)),n.handleTextInput(i),e.prefix="@"+String.fromCharCode(160)+i);else if(e.isCompositionStart&&e.isCompositionEnd&&""===e.suffix)e.prefix.substring(2)!==i?n.selection.isEmpty&&e.isCompositionStart?(e.isCompositionStart=!1,n.selection.start.setPositionForLineWidget(e.selection.start.currentWidget,n.selection.start.offset-e.prefix.substring(2).length),n.selection.retrieveCurrentFormatProperties(),""!==e.suffix&&""!==i||n.handleTextInput(i)):n.selection.isEmpty||(e.isCompositionStart=!1,n.handleTextInput(i)):""===i?(e.isCompositionStart=!1,n.handleBackKey()):e.prefix.substring(2)===i&&""===e.suffix&&(e.isCompositionStart=!1,n.handleTextInput(" ")),e.isCompositionEnd=!1;else{if(e.isCompositionEnd||e.isCompositionStart&&!e.isCompositionUpdated){if(i.length<e.prefix.length&&i===e.prefix.substring(2,e.prefix.length-1)||e.editableDiv.innerText.length<2)return void n.handleBackKey();if(""!==e.suffix&&e.editableDiv.innerText[e.editableDiv.innerText.length-1]!==String.fromCharCode(160))return e.isCompositionStart=!1,n.selection.start.setPositionForLineWidget(e.selection.start.currentWidget,n.selection.start.offset-(e.prefix.length-2)),n.selection.end.setPositionForLineWidget(e.selection.end.currentWidget,n.selection.end.offset+e.suffix.length),n.selection.retrieveCurrentFormatProperties(),void n.handleTextInput(i)}"\r"!==t&&"\b"!==t&&t!==String.fromCharCode(27)&&!e.owner.isReadOnlyMode&&!1===e.isControlPressed&&n.canEditContentControl&&("@"===t||"@"!==t[0]||""===t||t.length<e.prefix.length&&i===e.prefix.substring(2,e.prefix.length-1)?(n.handleBackKey(),e.editableDiv.innerText.length<2&&n.predictText()):0===t.indexOf(e.prefix)&&t.length>e.prefix.length?n.handleTextInput(t.substring(e.prefix.length)):-1===t.indexOf(e.prefix)&&t[t.length-1]!==String.fromCharCode(160)&&" "!==t[t.length-1]?(i.charAt(0).toLowerCase()+i.slice(1)===e.prefix.substring(2)&&n.selection.start.setPositionParagraph(e.selection.start.currentWidget,n.selection.start.offset-(e.prefix.length-2)),n.handleTextInput(i)):2!==t.length&&n.handleTextInput(" "))}}else(t=n.documentHelper.editableDiv.innerText)!==String.fromCharCode(160)?"\r"!==t&&"\b"!==t&&t!==String.fromCharCode(27)&&!n.owner.isReadOnlyMode&&!1===n.documentHelper.isControlPressed&&n.canEditContentControl&&n.handleTextInput(t):n.handleTextInput(" "),n.documentHelper.editableDiv.innerText=""},this.onPaste=function(e){!n.owner.isReadOnlyMode&&n.canEditContentControl&&n.pasteInternal(e),e.preventDefault()},this.documentHelper=e,je(this.documentHelper)||(this.tableResize=new Fci(this.documentHelper.owner)),this.base64=new Bri}Object.defineProperty(_ci.prototype,"currentImageElementBox",{get:function(){return this.currentImageElementBoxIn},set:function(e){this.currentImageElementBoxIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(_ci.prototype,"resizeMarkSize",{get:function(){return this.resizeMarkSizeIn},set:function(e){this.resizeMarkSizeIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(_ci.prototype,"isShapeResize",{get:function(){return this.currentImageElementBox instanceof Xli},enumerable:!0,configurable:!0}),Object.defineProperty(_ci.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),_ci.prototype.getModuleName=function(){return"ImageResizer"},_ci.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 sai?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"},_ci.prototype.initializeImageResizer=function(){this.imageResizerDivElement=document.createElement("div"),this.imageResizerDivElement.style.zIndex="1",this.imageResizerDivElement.style.display="none",this.documentHelper.pageContainer.appendChild(this.imageResizerDivElement)},_ci.prototype.positionImageResizer=function(e){this.selectedImageWidget.clear(),je(this.documentHelper.currentPage)||(r=this.imageResizerDivElement),je(r)||r.contains(this.imageResizerDiv)||(this.imageResizerDiv=this.initResizeMarks(r,this)),this.imageResizerDiv.style.width=e.width+"px",this.imageResizerDiv.style.height=e.height+"px";var t,i=(this.currentImageElementBox=e).line,n=e instanceof rhi&&"Inline"!==e.textWrappingStyle?(t=e.y,e.x):(t=this.documentHelper.selection.getTop(i)+e.margin.top,this.documentHelper.selection.getLeftInternal(i,e,0)),o=this.documentHelper.selection.getPage(i.paragraph),r=(this.currentPage=o,je(r)||(this.owner.viewer instanceof sai&&(this.imageResizerDivElement.style.width=o.boundingRectangle.width-o.boundingRectangle.x-n-this.documentHelper.scrollbarWidth+"px"),this.imageResizerDivElement.style.display="block",this.owner.viewer instanceof sai?r.style.width=o.boundingRectangle.width-this.documentHelper.scrollbarWidth-o.boundingRectangle.x-n+"px":r.style.width=o.boundingRectangle.width+"px",r.style.height=o.boundingRectangle.height+"px",r.style.left=o.boundingRectangle.x+"px",r.style.top=o.boundingRectangle.y+"px",r.style.borderWidth="0px",r.style.backgroundColor="transparent",r.style.overflow="hidden",r.style.position="absolute"),this.documentHelper.getPageWidth(o)),o=parseFloat(this.imageResizerDivElement.style.width),r=((this.documentHelper.visibleBounds.width-o*this.documentHelper.zoomFactor)/2<30&&0,r<o&&this.documentHelper.zoomFactor,this.imageResizerDivElement),o=parseFloat(r.style.width),r=parseFloat(r.style.height),s=parseFloat(this.imageResizerDiv.style.width),a=parseFloat(this.imageResizerDiv.style.height),l=(this.resizeMarkSize-1)/2,s=s+2*l,a=a+2*l;s>(o-n)*this.documentHelper.zoomFactor+l&&(s=(o-n)*this.documentHelper.zoomFactor),a>(r-t)*this.documentHelper.zoomFactor+l&&(a=(r-t)*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",a=this.documentHelper.render.getScaledValue(e.height),s=this.documentHelper.render.getScaledValue(e.width),t=e instanceof rhi?(n=this.documentHelper.render.getScaledValue(n),this.documentHelper.render.getScaledValue(t)):(n=e.x*this.documentHelper.zoomFactor,e.y*this.documentHelper.zoomFactor),this.setImageResizerPosition(n,t,s,a,this),this.owner.selectionModule.isInShape?this.resizeContainerDiv.style.borderStyle="dashed":this.resizeContainerDiv.style.borderStyle="solid",this.selectedImageWidget.containsKey(i)||(o=new zci(e.height,e.width),this.selectedImageWidget.add(i,o))},_ci.prototype.showImageResizer=function(){je(this.imageResizerDivElement)||(this.imageResizerDivElement.style.display=""),je(this.resizeContainerDiv)||(this.resizeContainerDiv.style.display=""),je(this.bottomLeftRect)||(this.bottomLeftRect.style.display="",this.bottomLeftRectParent.style.display=""),je(this.bottomRightRect)||(this.bottomRightRect.style.display="",this.bottomRightRectParent.style.display=""),je(this.bottomMiddleRect)||(this.bottomMiddleRect.style.display="",this.bottomMiddleRectParent.style.display=""),je(this.rightMiddleRect)||(this.rightMiddleRect.style.display="",this.rightMiddleRectParent.style.display=""),je(this.topRightRect)||(this.topRightRect.style.display="",this.topRightRectParent.style.display=""),je(this.topLeftRect)||(this.topLeftRect.style.display="",this.topLeftRectParent.style.display=""),je(this.leftMiddleRect)||(this.leftMiddleRect.style.display="",this.leftMiddleRectParent.style.display=""),je(this.topMiddleRect)||(this.topMiddleRect.style.display="",this.topMiddleRectParent.style.display=""),this.isImageResizerVisible=!0},_ci.prototype.hideImageResizer=function(){je(this.imageResizerDivElement)||(this.imageResizerDivElement.style.display="none"),je(this.resizeContainerDiv)||(this.resizeContainerDiv.style.display="none"),je(this.bottomLeftRect)||(this.bottomLeftRect.style.display="none",this.bottomLeftRectParent.style.display="none"),je(this.bottomRightRect)||(this.bottomRightRect.style.display="none",this.bottomRightRectParent.style.display="none"),je(this.bottomMiddleRect)||(this.bottomMiddleRect.style.display="none",this.bottomMiddleRectParent.style.display="none"),je(this.rightMiddleRect)||(this.rightMiddleRect.style.display="none",this.rightMiddleRectParent.style.display="none"),je(this.topRightRect)||(this.topRightRect.style.display="none",this.topRightRectParent.style.display="none"),je(this.topLeftRect)||(this.topLeftRect.style.display="none",this.topLeftRectParent.style.display="none"),je(this.leftMiddleRect)||(this.leftMiddleRect.style.display="none",this.leftMiddleRectParent.style.display="none"),je(this.topMiddleRect)||(this.topMiddleRect.style.display="none",this.topMiddleRectParent.style.display="none"),this.isImageResizerVisible=!1,this.currentPage=void 0},_ci.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},_ci.prototype.setImageResizerPosition=function(e,t,i,n,o){o.resizeContainerDiv.style.width=i+"px",o.resizeContainerDiv.style.height=n+"px",o.resizeContainerDiv.style.left=e+"px",o.resizeContainerDiv.style.top=t+"px",o.topRightRect.style.left=e+i-5+"px",o.topRightRect.style.top=t-4+"px",o.topLeftRect.style.left=e-5+"px",o.topLeftRect.style.top=t-4+"px",o.topMiddleRect.style.left=parseFloat(o.topLeftRect.style.left)+i/2-4+"px",o.topMiddleRect.style.top=t-4+"px",o.bottomRightRect.style.left=o.topRightRect.style.left,o.bottomRightRect.style.top=parseFloat(o.topRightRect.style.top)+n+"px",o.bottomLeftRect.style.left=o.topLeftRect.style.left,o.bottomLeftRect.style.top=parseFloat(o.topLeftRect.style.top)+n+"px",o.bottomMiddleRect.style.left=o.topMiddleRect.style.left,o.bottomMiddleRect.style.top=parseFloat(o.topMiddleRect.style.top)+n+"px",o.rightMiddleRect.style.left=e+i-4+"px",o.rightMiddleRect.style.top=parseFloat(o.topRightRect.style.top)+n/2+"px",o.leftMiddleRect.style.left=o.topLeftRect.style.left,o.leftMiddleRect.style.top=parseFloat(o.topLeftRect.style.top)+n/2+"px",o.topRightRectParent.style.left=this.documentHelper.isTouchInput?e+i-15+"px":e+i-8+"px",o.topRightRectParent.style.top=this.documentHelper.isTouchInput?t-15+"px":t-7+"px",o.topLeftRectParent.style.left=this.documentHelper.isTouchInput?e-15+"px":e-8+"px",o.topLeftRectParent.style.top=this.documentHelper.isTouchInput?t-15+"px":t-7+"px",o.topMiddleRectParent.style.left=parseFloat(o.topLeftRectParent.style.left)+i/2-4+"px",o.topMiddleRectParent.style.top=this.documentHelper.isTouchInput?t-15+"px":t-7+"px",o.bottomRightRectParent.style.left=o.topRightRectParent.style.left,o.bottomRightRectParent.style.top=parseFloat(o.topRightRectParent.style.top)+n+"px",o.bottomLeftRectParent.style.left=o.topLeftRectParent.style.left,o.bottomLeftRectParent.style.top=parseFloat(o.topLeftRectParent.style.top)+n+"px",o.bottomMiddleRectParent.style.left=o.topMiddleRectParent.style.left,o.bottomMiddleRectParent.style.top=parseFloat(o.topMiddleRectParent.style.top)+n+"px",o.rightMiddleRectParent.style.left=this.documentHelper.isTouchInput?e+i-15+"px":e+i-7+"px",o.rightMiddleRectParent.style.top=parseFloat(o.topRightRectParent.style.top)+n/2+"px",o.leftMiddleRectParent.style.left=o.topLeftRectParent.style.left,o.leftMiddleRectParent.style.top=parseFloat(o.topLeftRectParent.style.top)+n/2+"px",this.setImageResizingPoints(o),this.documentHelper.isTouchInput?this.applyPropertiesForTouch():this.applyPropertiesForMouse()},_ci.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)},_ci.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"},_ci.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"},_ci.prototype.handleImageResizing=function(e,t,i){t/=this.documentHelper.zoomFactor,i/=this.documentHelper.zoomFactor,this.leftValue=je(this.leftValue)?t:this.leftValue,this.topValue=je(this.topValue)?i:this.topValue;var n,o,r,s,a=this.selectedResizeElement.id.split("_"),a=a[a.length-1];switch(a){case"TopRightRectParent":t=(n=this.topRightResizing(e)).left,i=n.top;break;case"TopLeftRectParent":t=-(n=this.topLeftResizing(e)).left,i=-n.top;break;case"TopMiddleRectParent":t=0,i=this.topMiddleResizing(e);break;case"BottomRightRectParent":t=(n=this.bottomRightResizing(e)).left,i=n.top;break;case"BottomLeftRectParent":t=-(n=this.bottomLeftResizing(e)).left,i=-n.top;break;case"BottomMiddleRectParent":i=e.y-i,t=0;break;case"RightMiddleRectParent":t=e.x-t,i=0;break;case"LeftMiddleRectParent":t=this.leftMiddleResizing(e),i=0}0===t&&0===i||(r=this.currentImageElementBox.line.paragraph,o=this.currentImageElementBox,je(r)||!r.isInsideTable||je(r=r.containerWidget)||(r=r.containerWidget,o=Y.convertPointToPixel(o.height),s=r.height-o,0<i&&r.y+s+o+i>this.viewer.clientArea.bottom&&(this.isImageMoveToNextPage=!0)),this.owner.enableHistoryMode&&this.initHistoryForImageResizer(this.currentImageElementBox),je(this.currentImageElementBox)||(r=10<this.currentImageElementBox.width+t?this.currentImageElementBox.width+t:10,s=10<this.currentImageElementBox.height+i?this.currentImageElementBox.height+i:10,"BottomRightRectParent"!==a&&"TopRightRectParent"!==a&&"BottomLeftRectParent"!==a&&"TopLeftRectParent"!==a||(s=this.currentImageElementBox.height/this.currentImageElementBox.width*r,r=this.currentImageElementBox.width/this.currentImageElementBox.height*s),this.currentImageElementBox.width=r,this.currentImageElementBox.height=s,this.currentImageElementBox.line.paragraph,this.positionImageResizer(this.currentImageElementBox)),this.isImageResizing=!0)},_ci.prototype.handleImageResizingOnMouse=function(e){var t,i;je(this.selectedResizeElement)||(t=parseFloat(this.selectedResizeElement.style.left),i=parseFloat(this.selectedResizeElement.style.top),e=new kri(e.offsetX,e.offsetY),e=this.viewer.findFocusedPage(e,!0),this.handleImageResizing(e,t,i))},_ci.prototype.topMiddleResizing=function(e){var t;return this.topValue>=e.y?(t=this.topValue/e.y,this.topValue=e.y,this.viewer instanceof nai&&this.topValue<=this.viewer.pageGap&&(t=1)):(t=-(e.y/this.topValue),this.topValue=e.y,0===this.topValue&&(t=-1)),t},_ci.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},_ci.prototype.topRightResizing=function(e){e=this.leftValue<=e.x&&this.topValue>=e.y?this.getOuterResizingPoint(e):this.getInnerResizingPoint(e);return e},_ci.prototype.topLeftResizing=function(e){e=this.leftValue>=e.x&&this.topValue>=e.y?this.getOuterResizingPoint(e):this.getInnerResizingPoint(e);return e},_ci.prototype.bottomRightResizing=function(e){e=this.leftValue<=e.x&&this.topValue<=e.y?this.getOuterResizingPoint(e):this.getInnerResizingPoint(e);return e},_ci.prototype.bottomLeftResizing=function(e){e=this.leftValue>=e.x&&this.topValue<=e.y?this.getOuterResizingPoint(e):this.getInnerResizingPoint(e);return e},_ci.prototype.getOuterResizingPoint=function(e){var t,i=e.x-this.leftValue;return this.leftValue=e.x,t=e.y-this.topValue,this.topValue=e.y,{left:i,top:t}},_ci.prototype.getInnerResizingPoint=function(e){var t,i=-(this.leftValue-e.x);return this.leftValue=e.x,t=-(this.topValue-e.y),this.topValue=e.y,{left:i,top:t}},_ci.prototype.handleImageResizingOnTouch=function(e){var t,i;je(this.selectedResizeElement)||(t=parseFloat(this.selectedResizeElement.style.left)+24,i=parseFloat(this.selectedResizeElement.style.top)+24,e=e.touches,e=new kri(e[0].clientX,e[0].clientY),e=this.viewer.findFocusedPage(e,!0),je(this.currentImageElementBox))||je(this.currentImageElementBox)||this.handleImageResizing(e,t,i)},_ci.prototype.getImagePoint=function(e){var t=this.documentHelper.render.getScaledValue(e.x,1),i=this.documentHelper.render.getScaledValue(e.y,2),t=(e=new kri(t,i),this.imageResizerPoints),i="",n=void 0,o=t.bottomMiddleRectParent,r=t.bottomRightRectParent,s=t.bottomLeftRectParent,a=t.topMiddleRectParent,l=t.topRightRectParent,h=t.topLeftRectParent,d=t.rightMiddleRectParent,t=t.leftMiddleRectParent;return je(this.bottomMiddleRectParent)||"none"===this.bottomMiddleRectParent.style.display||(e.x>o.x&&e.x<=o.x+15&&e.y>o.y&&e.y<=o.y+15?(n=this.bottomMiddleRectParent,i="s-resize"):e.x>r.x&&e.x<=r.x+15&&e.y>r.y&&e.y<=r.y+15?(n=this.bottomRightRectParent,i="se-resize"):e.x>s.x&&e.x<=s.x+15&&e.y>s.y&&e.y<=s.y+15?(n=this.bottomLeftRectParent,i="sw-resize"):e.x>a.x&&e.x<=a.x+15&&e.y>a.y&&e.y<=a.y+15?(n=this.topMiddleRectParent,i="n-resize"):e.x>l.x&&e.x<=l.x+15&&e.y>l.y&&e.y<=l.y+15?(n=this.topRightRectParent,i="ne-resize"):e.x>h.x&&e.x<=h.x+15&&e.y>h.y&&e.y<=h.y+15?(n=this.topLeftRectParent,i="nw-resize"):e.x>t.x&&e.x<=t.x+15&&e.y>t.y&&e.y<=t.y+15?(n=this.leftMiddleRectParent,i="w-resize"):e.x>d.x&&e.x<=d.x+15&&e.y>d.y&&e.y<=d.y+15?(n=this.rightMiddleRectParent,i="e-resize"):!je(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)&&(i="move")),{selectedElement:n,resizePosition:i}},_ci.prototype.applyPropertiesForMouse=function(){je(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")},_ci.prototype.getImagePointOnTouch=function(e){var t=this.documentHelper.render.getScaledValue(e.x,1),i=this.documentHelper.render.getScaledValue(e.y,2),t=(e=new kri(t,i),this.imageResizerPoints),i="",n=void 0,o=t.bottomMiddleRectParent,r=t.bottomRightRectParent,s=t.bottomLeftRectParent,a=t.topMiddleRectParent,l=t.topRightRectParent,h=t.topLeftRectParent,d=t.rightMiddleRectParent,t=t.leftMiddleRectParent;return je(this.bottomMiddleRectParent)||"none"===this.bottomMiddleRectParent.style.display||(e.x>o.x&&e.x<=o.x+25&&e.y>o.y&&e.y<=o.y+25?(n=this.bottomMiddleRectParent,i="s-resize"):e.x>r.x&&e.x<=r.x+25&&e.y>r.y&&e.y<=r.y+25?(n=this.bottomRightRectParent,i="se-resize"):e.x>s.x&&e.x<=s.x+25&&e.y>s.y&&e.y<=s.y+25?(n=this.bottomLeftRectParent,i="sw-resize"):e.x>a.x&&e.x<=a.x+25&&e.y>a.y&&e.y<=a.y+25?(n=this.topMiddleRectParent,i="n-resize"):e.x>l.x&&e.x<=l.x+25&&e.y>l.y&&e.y<=l.y+25?(n=this.topRightRectParent,i="ne-resize"):e.x>h.x&&e.x<=h.x+25&&e.y>h.y&&e.y<=h.y+25?(n=this.topLeftRectParent,i="nw-resize"):e.x>t.x&&e.x<=t.x+25&&e.y>t.y&&e.y<=t.y+25?(n=this.leftMiddleRectParent,i="w-resize"):e.x>d.x&&e.x<=d.x+25&&e.y>d.y&&e.y<=d.y+25?(n=this.rightMiddleRectParent,i="e-resize"):!je(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)&&(i="move")),{selectedElement:n,resizePosition:i}},_ci.prototype.applyPropertiesForTouch=function(){je(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")},_ci.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.selectionModule),this.documentHelper.layout.layoutBodyWidgetCollection(this.currentImageElementBox.line.paragraph.index,this.currentImageElementBox.line.paragraph.containerWidget,this.currentImageElementBox.line.paragraph,!1),this.updateHistoryForImageResizer(),this.owner.editorModule.reLayout(this.owner.selectionModule,!0),this.viewer.updateScrollBars()},_ci.prototype.initHistoryForImageResizer=function(e){!je(this.owner)&&je(this.baseHistoryInfo)&&(this.baseHistoryInfo=new Ici(this.owner),this.baseHistoryInfo.action="ImageResizing",this.baseHistoryInfo.updateSelection(),this.baseHistoryInfo.modifiedProperties.push(new pci(e)))},_ci.prototype.updateHistoryForImageResizer=function(){var e;je(this.owner)||je(this.baseHistoryInfo)||(e=this.baseHistoryInfo.modifiedProperties[0],this.currentImageElementBox.width===e.width&&this.currentImageElementBox.height===e.height?this.baseHistoryInfo.modifiedProperties.pop():(this.baseHistoryInfo.insertedText=pJt.Image,this.baseHistoryInfo.insertedData={width:Y.convertPixelToPoint(this.currentImageElementBox.width),height:Y.convertPixelToPoint(this.currentImageElementBox.height),alternativeText:this.currentImageElementBox.alternateText},this.owner.editorHistoryModule.recordChanges(this.baseHistoryInfo)),this.baseHistoryInfo=void 0)},_ci.prototype.updateImageResizerPosition=function(){var e,t,i,n,o,r;je(this.currentImageElementBox)||(this.currentImageElementBox instanceof rhi,o=(e=this.currentImageElementBox).line,n=i=t=void 0,this.currentImageElementBox instanceof rhi?(r=this.documentHelper.selection.getTop(o)+e.margin.top,t=this.documentHelper.selection.getLeftInternal(o,e,0),i=r*this.documentHelper.zoomFactor,n=t*this.documentHelper.zoomFactor):(n=e.x*this.documentHelper.zoomFactor,i=e.y*this.documentHelper.zoomFactor),o=this.documentHelper.render.getScaledValue(e.height,2),r=this.documentHelper.render.getScaledValue(e.width,1),this.setImageResizerPosition(n,i,r,o,this))},_ci.prototype.destroy=function(){je(this.resizeContainerDiv)||(this.resizeContainerDiv.innerHTML=""),je(this.topLeftRect)||(this.topLeftRect.innerHTML=""),je(this.topMiddleRect)||(this.topMiddleRect.innerHTML=""),je(this.topRightRect)||(this.topRightRect.innerHTML=""),je(this.bottomLeftRect)||(this.bottomLeftRect.innerHTML=""),je(this.bottomMiddleRect)||(this.bottomMiddleRect.innerHTML=""),je(this.bottomRightRect)||(this.bottomRightRect.innerHTML=""),je(this.leftMiddleRect)||(this.leftMiddleRect.innerHTML=""),je(this.rightMiddleRect)||(this.rightMiddleRect.innerHTML=""),je(this.imageResizerDiv)||(this.imageResizerDiv.innerHTML=""),je(this.selectedImageWidget)||this.selectedImageWidget.destroy(),je(this.imageResizerDivElement)||(this.imageResizerDivElement.innerHTML="",je(this.imageResizerDivElement.parentElement))||this.imageResizerDivElement.parentElement.removeChild(this.imageResizerDivElement),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.imageResizerPoints=void 0,this.resizeMarkSizeIn=void 0,this.currentPage=void 0,this.documentHelper=void 0,this.owner=void 0};var Vci=_ci;function _ci(e,t){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 uJt,this.documentHelper=t,this.imageResizerPoints=new Hci,je(this.imageResizerDiv)&&this.viewer&&this.documentHelper.pageContainer&&this.initializeImageResizer()}var Hci=function(){this.resizeContainerDiv=new kri(0,0),this.topLeftRectParent=new kri(0,0),this.topMiddleRectParent=new kri(0,0),this.topRightRectParent=new kri(0,0),this.bottomLeftRectParent=new kri(0,0),this.bottomMiddleRectParent=new kri(0,0),this.bottomRightRectParent=new kri(0,0),this.leftMiddleRectParent=new kri(0,0),this.rightMiddleRectParent=new kri(0,0)},zci=(Object.defineProperty(jci.prototype,"height",{get:function(){return this.heightIn},set:function(e){this.heightIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(jci.prototype,"width",{get:function(){return this.widthIn},set:function(e){this.widthIn=e},enumerable:!0,configurable:!0}),jci);function jci(e,t){this.heightIn=0,this.widthIn=0,this.heightIn=e,this.widthIn=t}Object.defineProperty(Wci.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),Object.defineProperty(Wci.prototype,"selection",{get:function(){return this.owner.selectionModule},enumerable:!0,configurable:!0}),Object.defineProperty(Wci.prototype,"collaborativeEditingSettings",{get:function(){return this.owner.documentEditorSettings.collaborativeEditingSettings},enumerable:!0,configurable:!0}),Wci.prototype.getModuleName=function(){return"CollaborativeEditing"},Wci.prototype.updateAction=function(e){Array.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];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)}}},Wci.prototype.transFormLockRegion=function(e){var t,i,n,o,r=e.selectionInfo.previousLockInfo;je(r)||(t=r.author,o=n=0,this.documentHelper.editRanges.containsKey(t)&&0<(t=this.documentHelper.editRanges.get(t)).length&&(t=this.selection.getPosition(t[0]),t=this.selection.getHierarchicalIndexByPosition(t.endPosition).split(";"),i=r.end.split(";"),n=parseInt(t[0],10)-parseInt(i[0],10),o=parseInt(t[1],10)-parseInt(i[1],10),e.selectionInfo.start.split(";")[0]===r.end.split(";")[0]?(e.selectionInfo.start=this.tranformPosition(e.selectionInfo.start,n,o),e.selectionInfo.end=this.tranformPosition(e.selectionInfo.end,n,o)):(e.selectionInfo.start=this.tranformPosition(e.selectionInfo.start,n,0),e.selectionInfo.end=this.tranformPosition(e.selectionInfo.end,n,0))))},Wci.prototype.lockContent=function(e){var t,i,n,o,r,s,a,l=this;this.canLock()&&(t=this.owner.selectionModule.start,i=this.owner.selectionModule.end,this.owner.selectionModule.isForward||(t=this.owner.selectionModule.end,i=this.owner.selectionModule.start),t.paragraph.isInsideTable?(o=this.owner.documentHelper.layout.getParentTable(t.paragraph),n=this.owner.documentHelper.getFirstParagraphBlock(o),t.setPosition(n.childWidgets[0],!0)):t.paragraphStartInternal(this.owner.selectionModule,!1),i.paragraph.isInsideTable?(o=this.owner.documentHelper.layout.getParentTable(i.paragraph),o=(n=this.owner.documentHelper.getLastParagraphBlock(o)).lastChild.getEndOffset(),i.setPositionParagraph(n.lastChild,o)):i.moveToParagraphEndInternal(this.owner.selectionModule,!1),n=this.owner.selectionModule.getHierarchicalIndexByPosition(t),o=this.owner.selectionModule.getHierarchicalIndexByPosition(i),r={start:n,end:o,roomName:this.owner.documentEditorSettings.collaborativeEditingSettings.roomName,author:je(e)?this.owner.currentUser:e,version:this.version},s=this.selection.getParagraphInfo(t),a=this.selection.getParagraphInfo(i),this.owner.selectionModule.select(n,o),(e=new vJt).url=this.owner.serviceUrl+this.owner.serverActionSettings.canLock,e.contentType="application/json;charset=UTF-8",e.onSuccess=function(e){l.successHandler(e,r,s,a)},e.onFailure=this.failureHandler.bind(this),e.onError=this.failureHandler.bind(this),e.customHeaders=this.owner.headers,e.send(r))},Wci.prototype.canLock=function(){var e=this.documentHelper.editRanges;if(e.containsKey(this.owner.currentUser))return!1;for(var t=e.keys,i=0;i<t.length;i++){var n=e.get(t[parseInt(i.toString(),10)]);if(!je(n)&&0<n.length&&this.isSelectionInEditableRange(n[0]))return!1}return!0},Wci.prototype.getPreviousLockedRegion=function(){var e=this.documentHelper.editRanges;if(!e.containsKey(this.owner.currentUser)){for(var t,i=e.keys,n=0;n<i.length;n++){var o=e.get(i[parseInt(n.toString(),10)])[0],r=this.selection.getPosition(o).startPosition;r.isExistBefore(this.selection.start)&&(je(t)||r.isExistAfter(this.selection.getPosition(t).startPosition))&&(t=o)}return t}},Wci.prototype.unlockContent=function(e){var t;this.documentHelper.editRanges.containsKey(e)&&(this.saveTimer&&clearTimeout(this.saveTimer),t=JSON.stringify(this.serializeEditableRegion(e)),t={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.editorHistoryModule.clearHistory(),this.owner.fireContentChange(),this.owner.trigger(WJt,t))},Wci.prototype.removeEditRange=function(e){this.documentHelper.editRanges.containsKey(e)&&(this.updateLockRegion(e,!1),this.owner.editorModule.removeUserRestrictionsInternal(this.documentHelper.editRanges.get(e)[0]),this.documentHelper.clearContent(),this.selection.updateEditRangeCollection(),this.documentHelper.owner.viewer.updateScrollBars())},Wci.prototype.saveContent=function(){var e=this,t=(this.saveTimer&&clearTimeout(this.saveTimer),this.collaborativeEditingSettings.saveTimeout);je(t)&&(t=3e3),this.saveTimer=Number(setTimeout(function(){e.saveContentInternal()},t))},Wci.prototype.saveContentInternal=function(){var e;this.documentHelper.editRanges.containsKey(this.owner.currentUser)&&(e=this.documentHelper.editRanges.get(this.owner.currentUser)[0],e=this.selection.getPosition(e),e={action:"SaveContent",author:this.owner.currentUser,version:this.version,data:JSON.stringify(this.serializeEditableRegion(this.owner.currentUser)),selectionInfo:{start:this.selection.getHierarchicalIndexByPosition(e.startPosition),end:this.selection.getHierarchicalIndexByPosition(e.endPosition),roomName:this.collaborativeEditingSettings.roomName,author:this.owner.currentUser,version:this.version},roomName:this.collaborativeEditingSettings.roomName},this.owner.trigger(WJt,e))},Wci.prototype.serializeEditableRegion=function(e){var e=this.documentHelper.editRanges.get(e)[0],t=e.editRangeEnd,i=new rci(this.owner),e=(i.setPosition(e.line,!0),new rci(this.owner)),t=(e.setPosition(t.line,!1),this.owner.sfdtExportModule.isPartialExport=!0,this.owner.sfdtExportModule.write(0,i.currentWidget,i.offset,e.currentWidget,e.offset,!1));return this.owner.sfdtExportModule.isPartialExport=!1,t},Wci.prototype.successHandler=function(e,t,i,n){JSON.parse(e.data).canLock?(t.start=this.selection.getHierarchicalIndex(i.paragraph,i.offset.toString()),t.end=this.selection.getHierarchicalIndex(n.paragraph,n.offset.toString()),(e=this.getPreviousLockedRegion())&&(i=this.selection.getPosition(e),t.previousLockInfo={start:this.selection.getHierarchicalIndexByPosition(i.startPosition),end:this.selection.getHierarchicalIndexByPosition(i.endPosition),author:e.user,roomName:"",version:0}),n={action:"LockContent",selectionInfo:t,author:this.owner.currentUser,version:this.version,data:"",roomName:this.collaborativeEditingSettings.roomName},this.owner.trigger(WJt,n)):((i=new Cn("documenteditor",this.owner.defaultLocale)).setLocale(this.owner.locale),WC.alert({content:i.getConstant("Already locked"),closeOnEscape:!0,showCloseIcon:!0,position:{X:"Center",Y:"Center"}}).enableRtl=this.owner.enableRtl)},Wci.prototype.failureHandler=function(){var e=new Cn("documenteditor",this.owner.defaultLocale);e.setLocale(this.owner.locale),WC.alert({content:e.getConstant("Error in establishing connection with web server"),closeOnEscape:!0,showCloseIcon:!0,position:{X:"Center",Y:"Center"}}).enableRtl=this.owner.enableRtl},Wci.prototype.lockRegion=function(e,t,i){e=this.selection.getTextPosBasedOnLogicalIndex(e),t=this.selection.getTextPosBasedOnLogicalIndex(t);this.lockRegionInternal(e,t,i)},Wci.prototype.lockRegionInternal=function(e,t,i){var n=this.owner.editorModule.addEditElement(i),o=n.editRangeEnd;this.insertElements(e,t,[o],[n]),this.updateLockInfo(n.paragraph,o.paragraph,i,!0),this.owner.viewer.updateScrollBars()},Wci.prototype.insertElements=function(e,t,i,n){var o=e.paragraph.equals(t.paragraph);je(n)||this.insertElementsInternal(e,n),je(i)||this.insertElementsInternal(t,i),this.documentHelper.layout.reLayoutParagraph(n[0].paragraph,0,0),o||this.documentHelper.layout.reLayoutParagraph(i[0].paragraph,0,0)},Wci.prototype.insertElementsInternal=function(e,t){if(e.paragraph.isEmpty()){var i=e.paragraph;i.childWidgets[0].children.push(t[0]),t[0].line=i.childWidgets[0]}else for(var n,i=e.currentWidget.getInline(e.offset,0),e=i.element,i=i.index,o=t[0],r=(this.insertElementInternal(e,o,i),o.indexInOwner),s=1;s<t.length;s++)n=t[parseInt(s.toString(),10)],o.line.children.splice(r+s,0,n)},Wci.prototype.insertElementInternal=function(e,t,i){var n=e.line,o=n.paragraph,r=e.indexInOwner,o=o.paragraphFormat.bidi&&e.isRightToLeft;i===e.length?(o||r++,n.children.splice(r,0,t)):0===i&&(je(e.previousNode)?(n.children.splice(0,0,t),r=0):n.children.splice(r,0,t)),t.line=e.line},Wci.prototype.setEditableRegion=function(){var e;this.documentHelper.editRanges.containsKey(this.owner.currentUser)&&(e=this.documentHelper.editRanges.get(this.owner.currentUser)[0],e=this.getParentBlock(e.paragraph),this.lockStart=this.owner.selectionModule.getHierarchicalIndex(e,"0").split(";"))},Wci.prototype.isSelectionInEditableRange=function(e){if(!je(this.owner.selectionModule)){var t=this.owner.selectionModule.start,i=this.owner.selectionModule.end,n=(this.owner.selectionModule.isForward||(t=(n=[i,t])[0],i=n[1]),this.owner.selectionModule.getPosition(e));if((t.isExistAfter(n.startPosition)||t.isAtSamePosition(n.startPosition))&&(i.isExistBefore(n.endPosition)||i.isAtSamePosition(n.endPosition))||(n.startPosition.isExistAfter(t)||n.startPosition.isAtSamePosition(t))&&(n.endPosition.isExistBefore(i)||n.endPosition.isAtSamePosition(i))||n.startPosition.isExistAfter(t)&&n.startPosition.isExistBefore(i)&&(i.isExistAfter(n.endPosition)||i.isExistBefore(n.endPosition))||n.endPosition.isExistBefore(i)&&n.endPosition.isExistAfter(t)&&(t.isExistBefore(n.startPosition)||t.isExistAfter(n.startPosition)))return!0}return!1},Wci.prototype.updateRegion=function(e,t){if(this.documentHelper.editRanges.containsKey(e)){for(var i=this.documentHelper.editRanges.get(e),i=(1===i.length&&(this.documentHelper.editRanges.remove(e),i[0].removeEditRangeMark()),this.setEditableRegion(),i[0]),n=i.editRangeEnd,o=this.getParentBlock(i.paragraph),r=this.getParentBlock(n.paragraph),n=this.isSelectionInEditableRange(i),i=void 0,s=void 0,a=(this.owner.editorModule.isRemoveRevision=!0,n||(i=this.owner.selectionModule.getParagraphInfo(this.owner.selectionModule.start),s=this.owner.selectionModule.getParagraphInfo(this.owner.selectionModule.end)),[]);r!==o;){var l=r.combineWidget(this.owner.viewer),h=((r=l.previousRenderedWidget).bodyWidget.index!==l.bodyWidget.index&&a.push(l.bodyWidget),l.containerWidget.childWidgets[l.indexInOwner]);this.removeDuplicateCollection(h),l.containerWidget.removeChild(l.indexInOwner)}if(!je(o)){var d=o.index,p=o.containerWidget,c=(a.push(p),o.containerWidget.childWidgets.indexOf(o)),h=p.childWidgets[c],u=(p.removeChild(c),this.removeDuplicateCollection(h),[]),g=[],p=[];if(this.owner.editorModule.isPasteListUpdated=!1,this.owner.editorModule.getBlocks(JSON.parse(t),!1,g,u,p),a.length!==g.length)if(1===a.length&&a.unshift(this.owner.editorModule.splitBodyWidget(y=a[0],g[g.length-2].sectionFormat,y.childWidgets[c-1])),a.length<g.length)for(var m=1;m<g.length-1;m++){var f=new tdi(this.owner.documentHelper),y=new Sai,v=(f.bodyWidgets.push(y),y.page=f,a.splice(m,0,y),y.index=a[m-1].index,y.sectionFormat=new ari(y),y.sectionFormat.copyFormat(g[m].sectionFormat),a[m-1].page.index);if(this.documentHelper.insertPage(v,f),this.owner.editorModule.updateSectionIndex(a[m-1].sectionFormat,a[m-1],!0),a.length===g.length)break}for(var b=0;b<a.length;b++){for(var w=a[b],C=0,S=0,A=(b===a.length-1&&(C=d,S=c),g[b].childWidgets),x=0;x<A.length;x++)A[x].containerWidget=w,A[x].index=C,w.childWidgets.splice(S,0,A[x]),S++,C++;(r=A[A.length-1]).nextRenderedWidget&&r.nextRenderedWidget.index!==r.index&&this.updateNextBlocksIndex(r,!0),this.documentHelper.layout.layoutBodyWidgetCollection(A[0].index,w,void 0,!1)}for(var I=0;I<u.length;I++){var T=u[I];if(this.owner.editorModule.addCommentWidget(T,!1,this.owner.showComments,!1),0<T.replyComments.length)for(b=0;b<T.replyComments.length;b++)this.owner.commentReviewPane.addReply(T.replyComments[b],!1,!1)}0<p.length&&this.updateRevisionCollection(p),this.owner.trackChangesPane.updateTrackChanges();t=this.documentHelper.editRanges.get(e);n?0<t.length&&(p=this.selection.getPosition(t[0]),this.selection.selectPosition(p.endPosition,p.endPosition)):this.tranformSelection(i,s),this.tranformHistoryPosition(),this.selection.updateEditRangeCollection(),this.updateLockRegion(e),this.documentHelper.removeEmptyPages(),this.owner.viewer.updateScrollBars(),this.owner.editorModule.isRemoveRevision=!1}}},Wci.prototype.updateRevisionCollection=function(e){var t=0,i=this.getRevisionTextPosition(e[0]),n=!1;if(0<this.owner.revisionsInternal.changes.length&&!je(i))for(var o=0;o<this.owner.revisionsInternal.changes.length;o++)if(this.getRevisionTextPosition(this.owner.revisionsInternal.changes[o]).isExistAfter(i)){t=o,n=!0;break}for(var r=0;r<e.length;r++)n?(this.owner.revisionsInternal.changes.splice(t,0,e[r]),t++):this.owner.revisionsInternal.changes.push(e[r])},Wci.prototype.getRevisionTextPosition=function(e){if(0<e.range.length){e=e.range[0];if(e instanceof Xai)return this.selection.getElementPosition(e).startPosition;if(e instanceof Cri){var t=e.ownerBase.firstChild.firstChild;if(t.bodyWidget)return this.selection.getTextPosBasedOnLogicalIndex(this.selection.getHierarchicalIndex(t,"0"))}else if(e instanceof Eri){var i,t=e.ownerBase;if(t.lastChild.paragraph.bodyWidget)return e=t.getLength(),(i=new rci(this.owner)).setPositionParagraph(t.lastChild,e),i}}},Wci.prototype.tranformSelection=function(e,t){this.documentHelper.skipScrollToPosition=!0;e=this.selection.getHierarchicalIndex(e.paragraph,e.offset.toString()),t=this.selection.getHierarchicalIndex(t.paragraph,t.offset.toString());this.selection.select(e,t)},Wci.prototype.tranformHistoryPosition=function(){var e,t;this.documentHelper.editRanges.containsKey(this.owner.currentUser)&&(t=this.documentHelper.editRanges.get(this.owner.currentUser)[0],t=this.getParentBlock(t.paragraph),t=this.selection.getHierarchicalIndex(t,"0").split(";"),!je(this.lockStart))&&1<this.lockStart.length&&(e=parseInt(t[0],10)-parseInt(this.lockStart[0],10),t=parseInt(t[1],10)-parseInt(this.lockStart[1],10),this.transformHistory(e,t))},Wci.prototype.transformHistory=function(e,t){if(this.owner.enableEditorHistory){var i=this.owner.editorHistoryModule.undoStack;if(!je(i))for(var n=0;n<i.length;n++)this.transformBaseHistoryInfo(i[n],e,t);var o=this.owner.editorHistoryModule.redoStack;if(!je(o))for(n=0;n<o.length;n++)this.transformBaseHistoryInfo(o[n],e,t)}},Wci.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 Mci)for(var n=e.modifiedActions,o=0;o<n.length;o++)this.transformBaseHistoryInfo(n[o],t,i)},Wci.prototype.tranformPosition=function(e,t,i){e=e.split(";");return e[0]=(parseInt(e[0],10)+t).toString(),e[1]=(parseInt(e[1],10)+i).toString(),e.join(";")},Wci.prototype.getParentBlock=function(e){return(e=e.isInsideTable?this.owner.documentHelper.layout.getParentTable(e):e).combineWidget(this.owner.viewer)},Wci.prototype.removeDuplicateCollection=function(e){if(this.removeFieldInBlock(e,!1,!1),this.removeFieldInBlock(e,!0,!1),this.removeFieldInBlock(e,!1,!0),e instanceof _ai)for(var t,i=0;i<e.childWidgets.length;i++)e.childWidgets[i]instanceof jai&&(t=e.childWidgets[i],this.owner.editorModule.removeDeletedCellRevision(t));else this.owner.editorModule.removeRevisionForBlock(e,void 0,!1,!1)},Wci.prototype.removeFieldInBlock=function(e,t,i){e instanceof _ai?this.removeFieldTable(e,t,i):(this.owner.editorModule.removeField(e,t,i),this.removeComment(e))},Wci.prototype.removeFieldTable=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++)for(var o=e.childWidgets[n],r=0;r<o.childWidgets.length;r++)for(var s=o.childWidgets[r],a=0;a<s.childWidgets.length;a++)this.removeFieldInBlock(s.childWidgets[a],t,i)},Wci.prototype.removeComment=function(e){if(0<this.documentHelper.comments.length)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--)}},Wci.prototype.updateNextBlocksIndex=function(e,t){var i=e.getSplitWidgets().pop().nextRenderedWidget,n=1,o=(i.bodyWidget.index===e.bodyWidget.index&&(n=e.index-i.index+1),e.containerWidget.childWidgets.indexOf(e)+1);if(e.containerWidget instanceof Sai)for(var r=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!==r)return;for(var l=o;l<a.bodyWidgets[0].childWidgets.length;l++)a.bodyWidgets[0].childWidgets[l].index+=n;o=0}},Wci.prototype.updateLockRegion=function(e,t){var i;je(e)&&(e=this.owner.currentUser),t=!!je(t)||t,this.documentHelper.editRanges.containsKey(e)&&1===(i=this.documentHelper.editRanges.get(e)).length&&!je(i[0].editRangeEnd)&&(i=i[0],this.updateLockInfo(i.paragraph,i.editRangeEnd.paragraph,e,t))},Wci.prototype.updateLockInfo=function(e,t,i,n){for(e.isInsideTable&&(e=this.documentHelper.layout.getParentTable(e)),t.isInsideTable&&(t=this.documentHelper.layout.getParentTable(t));e.lockedBy=n?i:void 0,e.locked=n,e!==t&&!je(e=e.nextRenderedWidget)&&e;);},Wci.prototype.pullAction=function(){var e,t=this;this.owner&&((e=new vJt).url=this.owner.serviceUrl+this.owner.serverActionSettings.getPendingActions,e.contentType="application/json;charset=UTF-8",e.onSuccess=function(e){"string"==typeof e&&(e=JSON.parse(e)),t.updateAction(JSON.parse(e.data)),BA(t.owner.element)},e.onFailure=this.failureHandler.bind(this),e.onError=this.failureHandler.bind(this),e.customHeaders=this.owner.headers,kA(this.owner.element),e.send({roomName:this.collaborativeEditingSettings.roomName,version:this.version}))},Wci.prototype.destroy=function(){this.owner=void 0};set=Wci;function Wci(e){this.version=0,this.owner=e}Object.defineProperty(Uci.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),Uci.prototype.getModuleName=function(){return"XmlPane"},Uci.prototype.enableDisableElements=function(e){e?mt(this.element,[],["e-de-overlay"]):mt(this.element,["e-de-overlay"],[])},Uci.prototype.initializeXmlMapping=function(){var e=this,t=new Cn("documenteditor",this.documentHelper.owner.defaultLocale,this.documentHelper.owner.locale),i="xml_mapping_properties",n=(this.element=Q("div",{id:this.documentHelper.owner.element.id+i,className:"e-de-op"}),this.createDivTemplate("_header_footer",this.element,"padding-bottom:0")),o=(mt(n,["e-de-cntr-pane-padding"],[]),n.style.paddingLeft="0px",Q("label",{className:"e-de-prop-header-label"})),r=(o.innerHTML=t.getConstant("XML Mapping"),Q("span",{id:"_header_footer_close",className:"e-de-ctnr-close e-de-close-icon e-icons",styles:"display:inline-block;cursor:pointer;"+(this.isRtl?"float:left;":"float:right;")})),o=(r.addEventListener("click",function(){e.onClose()}),n.appendChild(o),n.appendChild(r),this.createDivTemplate(i+"_xml",this.element)),n=(mt(o,["e-de-cntr-pane-padding"],[]),o.style.paddingLeft="0px",o.style.paddingRight="5px",o.style.width="275px",Q("label",{className:"e-de-ctnr-prop-label",styles:"height:20px;"})),r=(n.innerHTML=t.getConstant("Custom XML Part"),o.appendChild(n),this.createDivTemplate(i+"_xmlDiv",o)),t=this.createDivTemplate(i+"_firstPageDiv",r),n=(mt(t,["e-de-hdr-ftr-frst-div"],[]),Q("input",{id:i+"_firstPageDiv_dropdownlist",className:"e-de-prop-sub-label"})),o=(n.type="text",n.tabIndex=1,t.appendChild(n),this.positionLabelDiv=Q("div",{id:i+"_positionLabelDiv",className:"e-de-scrollbar-hide",styles:"width:270px;height:310px;list-style:none;padding-right:5px;overflow:auto;"}),this.element.appendChild(this.positionLabelDiv),Q("div",{id:"tree",className:"e-de-scrollbar-hide",styles:"width:270px;height:310px;list-style:none;padding-right:5px;overflow:auto;"})),r=document.createElement("ul");r.contentEditable="false",r.style.width="auto",r.className="e-list-parent e-ul",r.style.paddingLeft="0px",r.id="e-de-pane-contextmenu-list",r.style.listStyle="none",r.style.margin="0px",r.style.maxHeight="auto",r.oncontextmenu=this.disableBrowserContextmenu,this.treeviewObject=new PW({fields:this.field,cssClass:"e-de-custom-treeview"}),this.treeviewObject.appendTo(o),this.positionLabelDiv.appendChild(o),this.positionLabelDiv.appendChild(r),this.documentHelper.owner.editor.dictionaryObject[this.documentHelper.owner.editor.dictionaryObjectIndexIncrement++]={ID:"Default",Data:this.hierarchicalData},this.documentHelper.owner.editor.xmlData&&0===this.documentHelper.owner.editor.xmlData.length&&(this.documentHelper.owner.editor.xmlData=this.hierarchicalData)},Uci.prototype.initializeContextMenu=function(){var e={target:"#tree",items:[{text:"Insert Content control",id:"Insert",items:[{text:"Plain Text",id:"PlainText"},{text:"Picture",id:"Picture"},{text:"CheckBox",id:"CheckBox"},{text:"Combo Box",id:"ComboBox"},{text:"Dropdown List",id:"DropdownList"},{text:"Date Picker",id:"DatePicker"}]},{text:"Map to selected content control",id:"MapToSelectedContentControl"}],select:this.handleContextMenuItem.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this)};this.contextMenuInstance=new D4(e,"#e-de-pane-contextmenu-list")},Uci.prototype.intializeDropDownList=function(){this.dropDownListObject=new qz({dataSource:this.DropDownListData,fields:{text:"Value",value:"ID"},text:this.DropDownListData[0].Value,select:this.handleDropDownList.bind(this)}),this.dropDownListObject.appendTo("#xml_mapping_properties_firstPageDiv_dropdownlist")},Uci.prototype.handleDropDownList=function(e){for(var t,i=e.item.innerText,n=0;n<this.DropDownListData.length;n++)this.dropDownListObject.dataSource[n].Value==i&&(t=this.dropDownListObject.dataSource[n].ID);if("(Add new part...)"===i)this.documentHelper.owner.prefixMappings=" ",this.handleFileSelect();else if(/(no namespace)/.test(i)){this.documentHelper.owner.prefixMappings=" ";for(n=0;n<this.documentHelper.owner.editor.dictionaryObject.length;n++)t===this.documentHelper.owner.editor.dictionaryObject[n].ID&&this.handleTreeviewObject(n)}else if("Choose an XML file"===i)this.documentHelper.owner.prefixMappings=" ",this.handleTreeviewObject(0);else{this.documentHelper.owner.prefixMappings=i;for(n=0;n<this.documentHelper.owner.editor.dictionaryObject.length;n++)t===this.documentHelper.owner.editor.dictionaryObject[n].ID&&this.handleTreeviewObject(n)}},Uci.prototype.handleTreeviewObject=function(e){this.treeviewObject.fields.dataSource=this.documentHelper.owner.editor.dictionaryObject[e].Data,this.treeviewObject.dataBind(),this.documentHelper.owner.editor.xmlData=this.documentHelper.owner.editor.dictionaryObject[e].Data},Uci.prototype.contextMenuBeforeOpen=function(e){var t=this.documentHelper.owner.selection.currentContentControl,i=this.documentHelper.owner.getImageContentControl(),n=this.treeviewObject.selectedNodes;this.treeviewObject.getNode(n[0]).hasChildren&&(e.cancel=!0),je(this.contextMenuInstance)||(je(t)&&je(i)?this.contextMenuInstance.enableItems(["Map to selected content control"],!1):this.contextMenuInstance.enableItems(["Map to selected content control"],!0))},Uci.prototype.handleContextMenuItem=function(e){var t=e.element.id;switch(t){case"RichText":case"PlainText":case"Picture":case"ComboBox":case"DropdownList":case"CheckBox":case"DatePicker":this.applyContentControl(t);break;case"MapToSelectedContentControl":var i=this.documentHelper.owner.selection.currentContentControl,n=this.documentHelper.owner.getImageContentControl();je(i)&&je(n)||(this.documentHelper.owner.isXmlMapCC=!0,this.documentHelper.owner.isXmlMapCC&&!je(this.documentHelper.owner.editor.xmlData.length)&&0<this.documentHelper.owner.editor.xmlData.length&&this.getXmlPath(),this.documentHelper.owner.selection.selectContentInternal(i),"CheckBox"!==i.contentControlProperties.type&&this.insertContent(i))}},Uci.prototype.disableBrowserContextmenu=function(){return!1},Uci.prototype.applyContentControl=function(e){var t=this,i=(this.documentHelper.owner.isXmlMapCC=!0,this.documentHelper.owner.isXmlMapCC&&!je(this.documentHelper.owner.editor.xmlData.length)&&0<this.documentHelper.owner.editor.xmlData.length&&this.getXmlPath(),this.documentHelper.owner.selection.currentContentControl),n=this.documentHelper.owner.getImageContentControl();if(je(i)&&je(n))switch(e){case"PlainText":this.documentHelper.owner.editor.insertContentControl("Text"),this.insertContent();break;case"RichText":this.documentHelper.owner.editor.insertContentControl("RichText"),this.insertContent();break;case"Picture":this.documentHelper.owner.showDialog("PictureContentControl");break;case"ComboBox":this.documentHelper.owner.editor.insertContentControl("ComboBox"),this.insertContent();break;case"DropdownList":this.documentHelper.owner.editor.insertContentControl("DropDownList"),this.insertContent();break;case"CheckBox":this.documentHelper.owner.editor.insertContentControl("CheckBox");break;case"DatePicker":this.documentHelper.owner.editor.insertContentControl("Date"),this.insertContent()}else{i=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);i.setLocale(this.documentHelper.owner.locale),this.alertDialog=WC.alert({title:i.getConstant("Information"),content:i.getConstant("Discard Content Control"),okButton:{text:i.getConstant("Ok")},showCloseIcon:!0,closeOnEscape:!0,animationSettings:{effect:"Zoom"},position:{X:"center",Y:"center"},close:function(){t.closeDialogUtils.bind(t)}})}},Uci.prototype.insertContent=function(e){for(var t,i=this.treeviewObject.selectedNodes.toString(),n=1;n<this.documentHelper.owner.editor.xmlData.length;n++)i!=this.documentHelper.owner.editor.xmlData[n].id.toString()||je(this.documentHelper.owner.editor.xmlData[n].displayValue)||(t=this.documentHelper.owner.editor.xmlData[n].displayValue.toString(),e?this.documentHelper.owner.editor.getResultContentControlText(e)!==t&&(this.documentHelper.owner.editor.insertText(t),this.documentHelper.owner.editor.addXmlProperties(e.contentControlProperties,this.documentHelper.owner.xPathString)):this.documentHelper.owner.editor.insertText(t));this.documentHelper.owner.isXmlMapCC=!1},Uci.prototype.updateContent=function(e,t){if(e===String.fromCharCode(9744)||e===String.fromCharCode(9746))this.updateCheckBoxContentControl(e,t);else{this.documentHelper.owner.xmlPaneModule.isXmlPaneShow&&this.updateXMLData(e);for(var i=this.documentHelper.selection.start.clone(),n=this.documentHelper.selection.end.clone(),o=0;o<this.documentHelper.contentControlCollection.length;o++){var r=this.documentHelper.contentControlCollection[o];r.contentControlProperties.xmlMapping&&r.contentControlProperties.xmlMapping.xPath===t&&"CheckBox"!==r.contentControlProperties.type&&this.documentHelper.owner.editor.getResultContentControlText(r)!==e&&this.updateContentControl(r,e)}this.documentHelper.selection.selectRange(i,n)}},Uci.prototype.updateContentControl=function(e,t){this.documentHelper.selection.selectContentControlInternal(e),this.documentHelper.owner.editor.insertText(t)},Uci.prototype.updateCheckBoxContentControl=function(e,t){e===String.fromCharCode(9746)?i="true":e===String.fromCharCode(9744)&&(i="false"),this.documentHelper.owner.xmlPaneModule.isXmlPaneShow&&this.updateXMLData(e);for(var i,n=this.documentHelper.selection.start.clone(),o=this.documentHelper.selection.end.clone(),r=0;r<this.documentHelper.contentControlCollection.length;r++){var s=this.documentHelper.contentControlCollection[r];s.contentControlProperties.xmlMapping&&s.contentControlProperties.xmlMapping.xPath===t&&"CheckBox"!==s.contentControlProperties.type?this.updateContentControl(s,i):s.contentControlProperties.xmlMapping&&s.contentControlProperties.xmlMapping.xPath===t&&"CheckBox"===s.contentControlProperties.type&&this.updateContentControl(s,e)}this.documentHelper.selection.selectRange(n,o)},Uci.prototype.updateXMLData=function(e){for(var t=this.treeviewObject.selectedNodes.toString(),i=1;i<this.documentHelper.owner.editor.xmlData.length;i++)t!==this.documentHelper.owner.editor.xmlData[i].id.toString()||je(this.documentHelper.owner.editor.xmlData[i].displayValue)||(this.documentHelper.owner.editor.xmlData[i].displayValue=e)},Uci.prototype.getXmlPath=function(){for(var e=this.treeviewObject.selectedNodes.toString(),t="",i=Number(e)-1,n=this.documentHelper.owner.editor.xmlData.length-1;0<=n;n--)je(this.documentHelper.owner.editor.xmlData[i])||this.documentHelper.owner.editor.xmlData[i].pid!=this.documentHelper.owner.editor.xmlData[n].id.toString()||(t="\\"+this.documentHelper.owner.editor.xmlData[n].displayText+"[1]\\"+t,i=n);e=Number(e)-1;this.documentHelper.owner.editor.xmlData[e]&&(t=t+this.documentHelper.owner.editor.xmlData[e].displayText.toString()+"[1]",this.documentHelper.owner.xPathString=t)},Uci.prototype.closeDialogUtils=function(){this.alertDialog.close(),this.alertDialog=void 0},Uci.prototype.createDivTemplate=function(e,t,i){i=Q("div",i?{id:e,styles:i}:{id:e});return t.appendChild(i),i},Uci.prototype.onFileSelect=function(e){var t=this,i=new FileReader;i.onload=function(){var e=i.result;t.addDataFromCustomXML(e)},i.readAsText(e)},Uci.prototype.addDataFromCustomXML=function(e){this.documentHelper.owner.editor.getPrefixMapping(e);var e=this.documentHelper.owner.editor.parseXml(e),t=this.documentHelper.owner.editor.objectToArray(e);this.documentHelper.owner.editor.setXmlData(e,t),this.addingNewFileToDropDownList()},Uci.prototype.addingNewFileToDropDownList=function(){1==this.documentHelper.owner.editor.XMLFilesNameSpaceCount&&null==this.documentHelper.owner.prefixMappings?(this.DropDownListData.splice(this.DropDownListData.length-1,0,{ID:"(no namespace)_"+this.documentHelper.owner.editor.XMLFilesCount,Value:"(no namespace)"}),this.documentHelper.owner.editor.XMLFilesNameSpaceCount++):1<this.documentHelper.owner.editor.XMLFilesNameSpaceCount&&null==this.documentHelper.owner.prefixMappings?(this.DropDownListData.splice(this.DropDownListData.length-1,0,{ID:"(no namespace)_"+this.documentHelper.owner.editor.XMLFilesCount,Value:"(no namespace) ("+this.documentHelper.owner.editor.XMLFilesNameSpaceCount+")"}),this.documentHelper.owner.editor.XMLFilesNameSpaceCount++):this.documentHelper.owner.prefixMappings&&this.DropDownListData.splice(this.DropDownListData.length-1,0,{ID:"(no namespace)_"+this.documentHelper.owner.editor.XMLFilesCount,Value:this.documentHelper.owner.prefixMappings}),this.dropDownListObject.dataSource=this.DropDownListData,this.dropDownListObject.refresh(),this.dropDownListObject.value=this.DropDownListData[0].ID,this.dropDownListObject.text=this.DropDownListData[0].Value,this.documentHelper.owner.editor.XMLFilesCount++},Uci.prototype.showXmlProperties=function(e){if(this.isXmlPaneShow=e){if(this.localeValue=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),this.localeValue.setLocale(this.documentHelper.owner.locale),je(Uci)||(this.initializeXmlMapping(),this.documentHelper.owner.enableRtl,this.documentHelper.optionsPaneContainer.insertBefore(this.documentHelper.owner.xmlPaneModule.element,this.documentHelper.viewerContainer),this.documentHelper.owner.isXmlPaneTool=!0),this.documentHelper.owner.resize(),e&&!this.contextMenuInstance&&(this.initializeContextMenu(),this.intializeDropDownList(),!this.isAddedDocumentXml)){this.isAddedDocumentXml=!0;for(var t=0;t<this.documentHelper.customXmlData.length;t++){var i=this.documentHelper.customXmlData.keys[t],i=this.documentHelper.customXmlData.get(i);je(i)||this.addDataFromCustomXML(i)}}this.documentHelper.updateViewerSize()}else this.documentHelper.updateViewerSize(),je(this.element)||"none"!==this.element.style.display&&(this.element.style.display="none"),this.destroyInternal(),this.documentHelper.owner.isXmlPaneTool=!1,this.documentHelper.owner.triggerResize()},Uci.prototype.clear=function(){if(2<this.DropDownListData.length)for(var e=0;e<this.DropDownListData.length;e++){var t=this.DropDownListData[e].ID;"Choose"!==t&&"Add"!==t&&(this.DropDownListData.splice(e,1),e--)}this.isAddedDocumentXml=!1},Uci.prototype.destroyInternal=function(){this.treeviewObject&&(this.treeviewObject.destroy(),this.treeviewObject=void 0),this.contextMenuInstance&&(this.contextMenuInstance.destroy(),this.contextMenuInstance=void 0),this.positionLabelDiv&&(this.positionLabelDiv.innerHTML="",this.positionLabelDiv=void 0),this.dropDownListObject&&(this.dropDownListObject.destroy(),this.dropDownListObject=void 0),this.element&&(this.element.innerHTML="",this.element.parentElement)&&this.element.parentElement.removeChild(this.element),this.element=void 0},Uci.prototype.destroy=function(){this.treeviewObject&&(this.treeviewObject.destroy(),this.treeviewObject=void 0),this.contextMenuInstance&&(this.contextMenuInstance.destroy(),this.contextMenuInstance=void 0),this.positionLabelDiv&&(this.positionLabelDiv.innerHTML="",this.positionLabelDiv=void 0),this.dropDownListObject&&(this.dropDownListObject.destroy(),this.dropDownListObject=void 0),this.element&&(this.element.innerHTML="",this.element.parentElement)&&this.element.parentElement.removeChild(this.element),this.element=void 0,this.documentHelper=void 0};var Qci=Uci;function Uci(e,t){var i=this;this.isXmlPaneShow=!1,this.isAddedDocumentXml=!1,this.contextMenuInstance=void 0,this.DropDownListData=[{ID:"Choose",Value:"Choose an XML file"},{ID:"Add",Value:"(Add new part...)"}],this.hierarchicalData=[],this.field={dataSource:this.hierarchicalData,id:"id",text:"displayText",hasChildren:"hasChild",value:"displayValue",parentID:"pid",tooltip:"tooltip"},this.handleFileSelect=function(){var e=document.createElement("input");e.type="file",e.accept=".xml",e.onchange=function(e){var e=e.target;e.files&&0<e.files.length&&(e=e.files[0],i.onFileSelect(e))},e.click()},this.onClose=function(){i.showXmlProperties(!1),i.documentHelper.owner.selectionModule.closeXmlPane(),i.documentHelper.owner.documentEditorSettings.showNavigationPane=!1,i.documentHelper.updateFocus(),i.destroyInternal()},this.documentHelper=e,this.isRtl=t}Gci.prototype.find=function(e,t){e=this.findNext(e,t,"0;0;0");return je(e)||(t={source:this.documentHelper.owner},this.documentHelper.owner.trigger(UJt,t)),e},Gci.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},Gci.prototype.stringToRegex=function(e,t){if(-1<(e=-1<e.indexOf("\\")?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<e.indexOf("+")){for(var i="",n=0;n<e.length;n++)"("===e[parseInt(n.toString(),10)]||")"===e[parseInt(n.toString(),10)]||"."===e[parseInt(n.toString(),10)]||"["===e[parseInt(n.toString(),10)]||"]"===e[parseInt(n.toString(),10)]||"$"===e[parseInt(n.toString(),10)]||"{"===e[parseInt(n.toString(),10)]||"}"===e[parseInt(n.toString(),10)]||"*"===e[parseInt(n.toString(),10)]||"|"===e[parseInt(n.toString(),10)]||"^"===e[parseInt(n.toString(),10)]||"?"===e[parseInt(n.toString(),10)]||"+"===e[parseInt(n.toString(),10)]?i+="\\"+e[parseInt(n.toString(),10)]:i+=e[parseInt(n.toString(),10)];e=i}return"WholeWord"!==t&&"CaseSensitiveWholeWord"!==t||(e=this.wordBefore+e+this.wordAfter),RegExp(e,"CaseSensitive"===t||"CaseSensitiveWholeWord"===t?"g":"ig")},Gci.prototype.isPatternEmpty=function(e){var t=this.wordBefore+this.wordAfter,e=e.toString();return 0===e.length||e===t},Gci.prototype.findAll=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;if(this.findDocument(n,e,!1,t,i),0<n.length&&n.currentIndex<0&&(n.currentIndex=0),!je(n.currentSearchResult))return e={source:this.documentHelper.owner},this.documentHelper.owner.trigger(UJt,e),n},Gci.prototype.getElementInfo=function(e,t,i,n,o,r,s,a,l){var h=e,d="",p=new uJt,c=0;do{if(e instanceof pli&&!je(e.text)&&""!==e.text?(p.add(e,l?d.length+c:d.length),c=0,d+=e===h?e.text.substring(t):e.text):e instanceof Zai?je((u=e).fieldEnd)||(e=je(u.fieldSeparator)?u.fieldEnd:u.fieldSeparator):e instanceof Xli&&!je(e.textFrame)&&0<e.textFrame.childWidgets.length&&this.findInlineText(e.textFrame,n,o,r,s,a),e instanceof pli||e instanceof lhi||(c+=e.length),!je(e)&&je(e.nextNode)){var u=e.paragraph.nextSplitWidget;if(!l&&!je(u)&&u!==e.paragraph&&0<u.childWidgets.length&&u.childWidgets[0]instanceof Gai&&0<u.childWidgets[0].children.length){e=u.childWidgets[0].children[0];continue}break}if(!je(e)){if(!je(i)&&!i){var g=e.line.children,m=e.line.children.length;if(!(g.indexOf(e)<m-1)){e=void 0;break}}e=e.nextNode}}while(1);return{elementsWithOffset:p,fullText:d.toString()}},Gci.prototype.updateMatchedTextLocation=function(e,t,i,n,o,r,s,a){for(var l=0;l<e.length;l++){var h=e[parseInt(l.toString(),10)],d=void 0;if(je(a)||!(h.index<a)){for(var p=t.addResult(),c=i.keys,u=!1,g=0;g<c.length;g++){var m=c[parseInt(g.toString(),10)],f=i.get(m),y=m.length;if(m===o&&(y-=n),je(p.start)&&h.index<f+y&&(v=h.index-f,m===o&&(v+=n),w=m.line.getOffset(m,v),p.start=this.getTextPosition(m.line,w.toString()),p.start.location=this.owner.selectionModule.getPhysicalPositionInternal(m.line,w,!0),p.start.setPositionParagraph(m.line,w),p.startOffset=this.owner.selectionModule.getHierarchicalIndexByPosition(p.start)),h.index+h[0].length<=f+y){var v=h.index+h[0].length-f;if(m===o&&(v+=n),(je(this.owner.searchModule.textSearchResults)||0===this.owner.searchModule.textSearchResults.length)&&" "!==m.text.charAt(m.text.length-1)&&!je(m.nextElement)&&(m.nextElement instanceof Dli||m.nextElement instanceof Khi)){for(var b=m.nextElement;b&&!((b=b.nextElement)instanceof pli););if(b&&b instanceof pli&&" "!==b.text.charAt(0)){u=!0;continue}}var w=0;w=(u=(je(this.owner.searchModule.textSearchResults)||0===this.owner.searchModule.textSearchResults.length)&&m.previousElement&&(m.previousElement instanceof Dli||m.previousElement instanceof Khi)?!0:u)?m.line.getOffset(m,0)+m.length:m.line.getOffset(m,v),p.end=this.getTextPosition(m.line,w.toString()),p.end.location=this.owner.selectionModule.getPhysicalPositionInternal(m.line,w,!0),p.end.setPositionParagraph(m.line,w),p.endOffset=this.owner.selectionModule.getHierarchicalIndexByPosition(p.end),d=!0;break}}if(r){t.currentIndex=0;break}if(t.currentIndex<0&&!je(s)&&(s.isExistBefore(p.start)||s.isAtSamePosition(p.start))&&(t.currentIndex=t.indexOf(p)),!je(a)&&d)break}}},Gci.prototype.findDocument=function(e,t,i,n,o){if(!this.isPatternEmpty(t)){void 0===n&&(n="None");var r,s=void 0,a=void 0;if(void 0!==o&&(a=this.owner.selectionModule.end),void 0!==o&&i&&void 0!==a&&void 0!==a.paragraph&&a.paragraph instanceof Lai){var o=a.currentWidget.getInline(this.owner.selectionModule.start.offset,0);if(s=o.element,o=o.index,!je(s)){for(var l=void 0,l=this.findInline(s,t,n,o,i,e,a);0===e.length&&!je(l);){for(;!je(l)&&0===l.childWidgets.length;)l=this.owner.selectionModule.getNextParagraph(l.containerWidget);if(je(l))break;var h=l.childWidgets[0];if(je(s=h.children[0]instanceof lhi?h.children[2]instanceof pli?h.children[2]:void 0:h.children[0]))break;l=this.findInline(s,t,n,0,i,e,a)}if(0<e.length)return}}for(r=this.documentHelper.pages[0].bodyWidgets[0];!je(r)&&0===r.childWidgets.length;)r=r.nextWidget;if(!je(r)&&0!==r.childWidgets.length){this.findInlineText(r,t,n,i,e,a);for(var d=this.documentHelper.headersFooters,p=0;p<d.length;p++){var c=d[parseInt(p.toString(),10)];if(c)for(var u in c)!Object.prototype.hasOwnProperty.call(c,u)||je(u=c[parseInt(u.toString(),10)])||je(u.page)||this.findInlineText(u,t,n,i,e,a)}for(var g=this.documentHelper.endnoteCollection,p=0;p<g.length;p++){var m=g[parseInt(p.toString(),10)];!m||je(m)||je(m.bodyWidget.page)||this.findInlineText(m.bodyWidget,t,n,i,e,a)}for(var f=this.documentHelper.footnoteCollection,p=0;p<f.length;p++){var y=f[parseInt(p.toString(),10)];!y||je(y)||je(y.bodyWidget.page)||this.findInlineText(y.bodyWidget,t,n,i,e,a)}i&&!je(e)&&e.length}}},Gci.prototype.findInlineText=function(e,t,i,n,o,r){for(var s=this.owner.documentHelper.getFirstParagraphBlock(e.childWidgets[0]);!je(s)&&1===s.childWidgets.length&&0===s.childWidgets[0].children.length;)s=this.owner.selectionModule.getNextParagraphBlock(s);for(;!je(s)&&0<s.childWidgets.length;){var a=s.childWidgets[0].children[0];if(je(a))break;for(this.findInline(a,t,i,0,n,o,r),s=this.owner.selectionModule.getNextParagraphBlock(s);!je(s)&&(1===s.childWidgets.length&&0===s.childWidgets[0].children.length||!je(s.previousSplitWidget));)s=this.owner.selectionModule.getNextParagraphBlock(s)}n&&!je(o)&&o.length},Gci.prototype.findInline=function(e,t,i,n,o,r,s){for(var a,l=e,i=this.getElementInfo(e,n,void 0,t,i,o,r,s),h=i.fullText,d=[],i=i.elementsWithOffset;!je(a=t.exec(h));)d.push(a);if(this.updateMatchedTextLocation(d,r,i,n,l,o,s),!o)return this.owner.selectionModule.getNextParagraphBlock(e.line.paragraph)},Gci.prototype.getTextPosition=function(e,t){var i=new rci(this.owner),e=i.getHierarchicalIndex(e,t);return i.setPositionForCurrentIndex(e),i};var qci=Gci;function Gci(e){this.wordBefore="\\b",this.wordAfter="\\b",this.owner=e,this.documentHelper=this.owner.documentHelper}Object.defineProperty(Xci.prototype,"left",{get:function(){return this.leftInternal},set:function(e){this.leftInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(Xci.prototype,"width",{get:function(){return this.widthInternal},set:function(e){this.widthInternal=e},enumerable:!0,configurable:!0});var Yci=Xci;function Xci(e,t){this.leftInternal=0,this.widthInternal=0,this.leftInternal=e,this.widthInternal=t}Object.defineProperty(Jci.prototype,"start",{get:function(){return this.startIn},set:function(e){this.startIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(Jci.prototype,"end",{get:function(){return this.endIn},set:function(e){this.endIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(Jci.prototype,"text",{get:function(){var e=this.documentHelper.selection.getTextPosBasedOnLogicalIndex(this.startOffset),t=this.documentHelper.selection.getTextPosBasedOnLogicalIndex(this.endOffset);return this.documentHelper.selection.getTextInternal(e,t,!1)},enumerable:!0,configurable:!0}),Jci.prototype.destroy=function(){this.start=void 0,this.end=void 0,this.startOffset=void 0,this.endOffset=void 0};var Kci=Jci;function Jci(e){this.startIn=void 0,this.endIn=void 0,this.startOffset=void 0,this.endOffset=void 0,this.owner=e,this.documentHelper=this.owner.documentHelper}Object.defineProperty($ci.prototype,"length",{get:function(){return void 0===this.innerList?0:this.innerList.length},enumerable:!0,configurable:!0}),Object.defineProperty($ci.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}),$ci.prototype.addResult=function(){var e=new Kci(this.owner);return je(this.innerList)&&(this.innerList=[]),this.innerList.push(e),e},$ci.prototype.clearResults=function(){if(this.currentIndex=-1,!je(this.innerList))for(var e=this.innerList.length-1;0<=e;e--)this.innerList[parseInt(e.toString(),10)].destroy(),this.innerList.splice(e,1)},$ci.prototype.indexOf=function(e){return je(this.innerList)?-1:this.innerList.indexOf(e)},$ci.prototype.destroy=function(){je(this.innerList)||this.clearResults(),this.innerList=void 0};var Zci=$ci;function $ci(e){this.currentIndex=-1,this.owner=e}Object.defineProperty(tui.prototype,"length",{get:function(){return this.searchModule.textSearchResults.length},enumerable:!0,configurable:!0}),Object.defineProperty(tui.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}),tui.prototype.getTextSearchResultsOffset=function(){for(var e,t=[],i=0;i<this.searchModule.textSearchResults.innerList.length;i++)e=this.getOffset(this.searchModule.textSearchResults.innerList[parseInt(i.toString(),10)]),t.push(e);return t},tui.prototype.getOffset=function(e){var t=e.start,e=e.end,t=this.searchModule.documentHelper.owner.selectionModule.getParagraphInfo(t),i=this.searchModule.documentHelper.owner.selectionModule.getHierarchicalIndex(t.paragraph,t.offset.toString()),t=this.searchModule.documentHelper.owner.selectionModule.getParagraphInfo(e);return{startOffset:i,endOffset:this.searchModule.documentHelper.owner.selectionModule.getHierarchicalIndex(t.paragraph,t.offset.toString())}},tui.prototype.getModuleName=function(){return"SearchResults"},tui.prototype.replace=function(e){-1!==this.index&&this.searchModule.replaceInternal(e)},tui.prototype.replaceAll=function(e){-1!==this.index&&this.searchModule.replaceAllInternal(e)},tui.prototype.navigate=function(){this.searchModule.navigate(this.searchModule.textSearchResults.currentSearchResult),this.searchModule.highlight(this.searchModule.textSearchResults)},tui.prototype.clear=function(){this.searchModule.textSearchResults.clearResults(),this.searchModule.clearSearchHighlight(),this.searchModule.viewer.renderVisiblePages()};var eui=tui;function tui(e){this.searchModule=e}Object.defineProperty(nui.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),Object.defineProperty(nui.prototype,"searchResults",{get:function(){return this.searchResultsInternal},enumerable:!0,configurable:!0}),Object.defineProperty(nui.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),nui.prototype.getModuleName=function(){return"Search"},nui.prototype.find=function(e,t){je(t)&&(t="None");e=this.textSearch.find(e,t);je(e)||this.navigate(e)},nui.prototype.findAll=function(e,t){je(e||""===e)||(je(t)&&(t="None"),!je(e=this.textSearch.findAll(e,t))&&0<e.length&&(this.navigate(e.innerList[e.currentIndex]),this.highlight(e)))},nui.prototype.replace=function(e,t,i){if(je(this.viewer.owner)||this.viewer.owner.isReadOnlyMode||!this.viewer.owner.editorModule.canEditContentControl||je(i))return 0;je(this.viewer)||this.clearSearchHighlight(),this.navigate(t);var n=this.documentHelper.selection.start;if(this.owner.enableTrackChanges&&this.documentHelper.selection.start.currentWidget&&0<this.documentHelper.selection.end.currentWidget.getInline(this.owner.selectionModule.start.offset,0).element.revisions.length&&(this.isRepalceTracking=!0),i.indexOf(t)<0)return 0;this.owner.editorModule.insertTextInternal(e,!0);var i=t.end,t=new rci(this.viewer.owner),o=(0===i.currentWidget.children.length?(o=i.currentWidget.paragraph.childWidgets[0],t.setPositionParagraph(o,n.offset-e.length)):t.setPositionParagraph(i.currentWidget,n.offset-e.length),this.documentHelper.selection.selectRange(n,t),{source:this.viewer.owner});return this.viewer.owner.trigger(UJt,o),1},nui.prototype.replaceInternal=function(e,t){var i,n,o,r;""===e||je(e)||(je(t)&&(t="None"),i=this.textSearchResults.currentSearchResult.text,n=this.viewer.owner.searchModule.textSearch.stringToRegex(i,t),o=this.owner.selectionModule.end.getHierarchicalIndexInternal(),je(r=this.textSearchResults.currentSearchResult)&&(r=this.viewer.owner.searchModule.textSearch.findNext(n,t,o)),!je(r)&&(this.navigate(r),this.textSearchResults.addResult(),this.textSearchResults.innerList[0]=r,this.replace(e,r,this.textSearchResults),o=this.owner.selectionModule.end.getHierarchicalIndexInternal(),r=this.textSearch.findNext(i,t,o))&&(this.textSearchResults.addResult(),this.textSearchResults.innerList[0]=r,this.navigate(r)))},nui.prototype.replaceAll=function(e,t){if(this.documentHelper.layout.isReplacingAll=!0,je(this.viewer.owner)||this.viewer.owner.isReadOnlyMode||je(t))return 0;this.owner.editorHistoryModule&&this.owner.editorHistoryModule.initComplexHistory(this.owner.selectionModule,"ReplaceAll");for(var i=t.length,n=(this.viewer.owner.isLayoutEnabled=!1,t.innerList[0].text),o=i-1;0<=o;o--){var r,s=t.innerList[parseInt(o.toString(),10)];0===s.start.currentWidget.children.length?o=(t=this.textSearch.findAll(n)).length:(this.navigate(s),!this.viewer.owner.isReadOnlyMode&&this.viewer.owner.editorModule.canEditContentControl&&(r=!0,0<o&&t.innerList[o-1].start.paragraph.equals(s.start.paragraph)&&(r=!1),this.owner.editorModule.insertTextInternal(e,!0,void 0,r),s.destroy()))}return this.owner.editorHistoryModule&&!je(this.owner.editorHistoryModule.currentHistoryInfo)?this.owner.editorHistoryModule.updateComplexHistory():this.owner.editorModule.updateComplexWithoutHistory(2),this.searchResults.clear(),this.documentHelper.layout.isReplacingAll=!1,i},nui.prototype.replaceAllInternal=function(e,t){je(e)||0<this.textSearchResults.length&&(this.navigate(this.textSearchResults.innerList[this.textSearchResults.currentIndex]),this.highlight(this.textSearchResults),this.replaceAll(e,this.textSearchResults))},nui.prototype.navigate=function(e){var t;e&&(t=e.startOffset,e=e.endOffset,je(this.owner)||je(this.owner.selectionModule)||je(t)||je(e)||(this.owner.selectionModule.select(t,e),this.documentHelper.updateFocus()))},nui.prototype.highlight=function(e){this.searchHighlighters=new uJt;for(var t=0;t<e.innerList.length;t++){var i=e.innerList[parseInt(t.toString(),10)];this.highlightResult(i)}this.viewer.renderVisiblePages()},nui.prototype.highlightResult=function(e){this.highlightSearchResult(e.start.paragraph,e.start,e.end)},nui.prototype.highlightSearchResult=function(e,t,i){var n,o,t=this.documentHelper.selection.getStartLineWidget(e,t,null,0),r=t.index,s=(n=t.element)?n.line:e.childWidgets[0],t=this.documentHelper.selection.getEndLineWidget(i,null,0),a=t.index,l=(o=t.element)?o.line:i.paragraph.childWidgets[i.paragraph.childWidgets.length-1],h=this.documentHelper.selection.getTop(s),d=this.documentHelper.selection.getLeftInternal(s,n,r);if(je(s)||s!==l){if(!je(s)){e!==s.paragraph&&(e=s.paragraph);m=this.documentHelper.selection.getWidth(s,!0)-(d-s.paragraph.x);if(e.bidi||n instanceof pli&&n.isRightToLeft){var p=0,c=this.documentHelper.selection.getElementsForward(s,n,o,e.bidi);if(c)for(v=!1,g=0;g<c.length;g++){b=(y=c[g])instanceof pli?y.length:1;p=this.documentHelper.selection.getLeftInternal(s,y,b),v=!1,d=y===n?this.documentHelper.selection.getLeftInternal(s,y,r):this.documentHelper.selection.getLeftInternal(s,y,0),y instanceof pli&&(v=y.isRightToLeft),m=Math.abs(p-d),this.createHighlightBorder(s,m,v?p:d,h)}}else this.createHighlightBorder(s,m,d,h);for(var u=s.paragraph.childWidgets.indexOf(s),g=0;g<e.childWidgets.length;g++){if(e===s.paragraph&&(u+=1),this.highlightSearchResultParaWidget(e,u,l,o,a),e===l.paragraph)return;u=0,e=l.paragraph,g--}}}else{var p=this.documentHelper.selection.getLeftInternal(l,o,a),t=!1,m=(o instanceof pli&&(t=o.isRightToLeft),0);if(m=Math.abs(p-d),(t=!t&&n instanceof pli?n.isRightToLeft:t)||e.bidi){var f=this.documentHelper.selection.getElementsForward(s,n,o,e.bidi);if(f&&1<f.length)for(var g=0;g<f.length;g++){var y,v=!1,b=(y=f[g])instanceof pli?y.length:1;p=y===n?(d=this.documentHelper.selection.getLeftInternal(s,y,r),this.documentHelper.selection.getLeftInternal(s,y,b)):y===o?(d=this.documentHelper.selection.getLeftInternal(s,y,0),this.documentHelper.selection.getLeftInternal(s,y,a)):(d=this.documentHelper.selection.getLeftInternal(s,y,0),this.documentHelper.selection.getLeftInternal(s,y,b)),y instanceof pli&&(v=y.isRightToLeft),m=Math.abs(p-d),this.createHighlightBorder(s,m,v?p:d,h)}else this.createHighlightBorder(s,m,t?p:d,h)}else this.createHighlightBorder(s,m,d,h)}},nui.prototype.createHighlightBorder=function(e,t,i,n){var o=this.addSearchHighlightBorder(e),r=this.viewer.owner.selectionModule.getPage(e.paragraph);r.boundingRectangle.y,r.boundingRectangle.x,o.left=Math.ceil(i),o.width=Math.floor(t),Math.floor(e.height),this.documentHelper.containerContext},nui.prototype.addSearchHighlightBorder=function(e){var t=void 0,i=this.searchHighlighters,i=(i.containsKey(e)?t=i.get(e):i.add(e,t=[]),new Yci(0,0));return t.push(i),i},nui.prototype.highlightSearchResultParaWidget=function(e,t,i,n,o){for(var r=0,s=0,a=!1,l=t;l<e.childWidgets.length;l++){var h=e.childWidgets[l],d=(l===t&&(r=this.documentHelper.selection.getTop(h)),this.documentHelper.selection.getLeft(h));if(n instanceof pli&&(a=n.isRightToLeft),h===i){var p=0;if(a||e.bidi){for(var c=this.documentHelper.selection.getElementsBackward(h,n,n,e.bidi),u=0;u<c.length;u++){var g,m=c[u],f=!1,d=this.documentHelper.selection.getLeftInternal(h,m,0);p=m===n?this.documentHelper.selection.getLeftInternal(h,m,o):(g=m instanceof pli?m.length:1,this.documentHelper.selection.getLeftInternal(h,m,g)),m instanceof pli&&(f=m.isRightToLeft),s=Math.abs(p-d),this.createHighlightBorder(h,s,f?p:d,r)}return}return p=this.documentHelper.selection.getLeftInternal(i,n,o),s=Math.abs(p-d),void this.createHighlightBorder(h,s,a?p:d,r)}s=this.documentHelper.selection.getWidth(h,!0)-(d-e.x),this.createHighlightBorder(h,s,d,r),r+=h.height}},nui.prototype.addSearchResultItems=function(e){je(e)||(je(this.owner.findResultsList)&&(this.owner.findResultsList=[]),this.owner.findResultsList.push(e))},nui.prototype.addFindResultView=function(e){for(var t=0;t<e.innerList.length;t++){var i=e.innerList[t];this.addFindResultViewForSearch(i)}},nui.prototype.addFindResultViewForSearch=function(e){if(null!=e.start&&null!=e.end&&null!=e.start.paragraph&&null!=e.end.paragraph){var t=void 0,i=0,n=e.start.currentWidget.getInline(e.start.offset,i),o=n.element,r=(i=n.index,""),s=0,n=(o instanceof Zai&&(o=(n=this.owner.selectionModule.getRenderedInline(o,i)).element.nextNode instanceof pli?n.element.nextNode:n.element,i=n.index),this.owner.selectionModule.getElementBoxInternal(o,i)),a=n.element;if(i=n.index,null!=a){a instanceof pli&&0<i&&(r=a.text.substring(0,i));for(var l=a.line.children.indexOf(a),s=r.lastIndexOf(" ");s<0&&0<l&&a.line.children[l-1]instanceof pli;)r=a.line.children[l-1].text+r,l--,s=r.lastIndexOf(" ")}var o=r.lastIndexOf("\v"),i=(0<o?r=r.substring(0,o):(s=r.lastIndexOf(" "))<0||r.substring(s+1),e.text,0),o=e.end.currentWidget.getInline(e.end.offset,i),h=o.element,i=o.index,t="";if(null!=n&&(a=(n=this.owner.selectionModule.getElementBoxInternal(h,i)).element,i=n.index),null!=a){a instanceof pli&&i<a.length&&(t=a.text.substring(i));for(l=a.line.children.indexOf(a);l+1<a.line.children.length&&a.line.children[l+1]instanceof pli||a.line.children[l+1]instanceof Zai;)a.line.children[l+1]instanceof Zai?l+=2:(t+=a.line.children[l+1].text,l+=1)}s=t.lastIndexOf(" "),t="\v"===t?"":t;var o=void 0,h=e.start.paragraph.containerWidget,n=h instanceof Iai?h.headerFooterType:"",i=(-1!=n.indexOf("Header")?((o=document.createElement("span")).classList.add("e-de-header-footer-list"),o.textContent="Header: "):-1!=n.indexOf("Footer")&&((o=document.createElement("span")).classList.add("e-de-header-footer-list"),o.textContent="Footer: "),document.createElement("li")),n=(i.setAttribute("tabindex","0"),i.classList.add("e-de-search-result-item","e-de-op-search-txt"),o&&i.appendChild(o),r&&(h=document.createTextNode(r),i.appendChild(h)),document.createElement("span"));n.classList.add("e-de-op-search-word"),n.style.pointerEvents="none",n.textContent=e.text,i.appendChild(n),t&&(o=document.createTextNode(t),i.appendChild(o)),this.addSearchResultItems(i)}},nui.prototype.clearSearchHighlight=function(){je(this.searchHighlighters)||(this.searchHighlighters.clear(),this.searchHighlighters=void 0);var e={source:this.viewer.owner};this.viewer.owner.trigger(UJt,e)},nui.prototype.destroy=function(){this.textSearchResults&&this.textSearchResults.destroy(),this.textSearchResults=void 0,this.owner=void 0};var iui=nui;function nui(e){this.searchHighlighters=void 0,this.owner=e,this.searchHighlighters=new uJt,this.textSearch=new qci(this.owner),this.textSearchResults=new Zci(this.owner),this.searchResultsInternal=new eui(this)}Object.defineProperty(rui.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),rui.prototype.getModuleName=function(){return"OptionsPane"},rui.prototype.initOptionsPane=function(e,t){this.viewer;this.localeValue=e,this.optionsPane=Q("div",{className:"e-de-op",styles:"display:none;"}),this.optionsPane.addEventListener("keydown",this.onKeyDownOnOptionPane),this.findTab=Q("div",{id:this.documentHelper.owner.containerId+"_findTabDiv",className:"e-de-op-tab"}),this.optionsPane.appendChild(this.findTab),this.searchDiv=Q("div",{className:"e-de-op-header",innerHTML:e.getConstant(this.searchText)}),this.findTab.appendChild(this.searchDiv),this.closeButton=Q("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.closeButton.setAttribute("aria-label",e.getConstant("Close")),this.findTab.appendChild(this.closeButton);var i=Q("span",{className:"e-de-op-close-icon e-de-close-icon e-btn-icon e-icons"}),i=(this.closeButton.appendChild(i),this.focusedElement.push(this.closeButton),this.tabDiv=Q("div"),this.findTab.appendChild(this.tabDiv),this.findTabButton=Q("div",{innerHTML:e.getConstant(this.findPaneText)}),this.replaceTabButton=Q("div",{innerHTML:e.getConstant(this.replacePaneText)}),this.headingTabButton=Q("div",{innerHTML:e.getConstant(this.headingPaneText)}),[{header:{text:this.headingTabButton}},{header:{text:this.findTabButton}},{header:{text:this.replaceTabButton}}]),i=(this.tabInstance=new k5({items:i,enableRtl:t,selected:this.selectedTabItem.bind(this)}),this.tabInstance.isStringTemplate=!0,this.tabInstance.appendTo(this.tabDiv),this.findTabContentDiv=Q("div",{className:"e-de-search-tab-content",styles:"display:none;"}),this.findTab.appendChild(this.findTabContentDiv),this.searchTextBoxContainer=Q("div",{className:"e-input-group e-de-op-input-group"}),this.findTabContentDiv.appendChild(this.searchTextBoxContainer),this.searchInput=Q("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=Q("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=Q("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=Q("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),this.checkboxDiv=Q("div",{className:"e-de-op-more-less",styles:"display:none"}),this.matchInput=Q("input",{attrs:{type:"checkbox"},id:this.documentHelper.owner.containerId+"_matchCase"}),this.checkboxDiv.appendChild(this.matchInput),this.matchCase=new ib({label:e.getConstant("Match case"),enableRtl:t,checked:!1,change:this.matchChange.bind(this)}),this.matchCase.appendTo(this.matchInput),this.focusedElement.push(this.matchInput),this.matchInput.tabIndex=0,this.wholeInput=Q("input",{attrs:{type:"checkbox"},id:this.documentHelper.owner.containerId+"_wholeWord"+(t?"_e-de-rtl":"_e-de-ltr")}),this.checkboxDiv.appendChild(this.wholeInput),this.wholeWord=new ib({label:e.getConstant("Whole words"),enableRtl:t,checked:!1,change:this.wholeWordsChange.bind(this)}),this.wholeWord.appendTo(this.wholeInput),this.focusedElement.push(this.wholeInput),this.wholeInput.tabIndex=0,this.findTab.appendChild(this.checkboxDiv),this.replaceTabContentDiv=Q("div",{className:"e-de-op-replacetabcontentdiv",styles:"display:none;"}),this.findTab.appendChild(this.replaceTabContentDiv),this.createReplacePane(t),this.resultContainer=Q("div",{styles:"width:85%;display:none;",className:"e-de-op-result-container"}),this.findTab.appendChild(this.resultContainer),this.messageDiv=Q("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),Q("div",{id:this.documentHelper.owner.containerId+"_resultDiv"}));this.optionsPane.appendChild(i),this.findDiv=Q("div",{className:"findDiv",styles:"display:none;"}),i.appendChild(this.findDiv),this.resultsListBlock=Q("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.treeviewDiv=Q("div",{className:"e-de-scrollbar-hide",styles:"height:375px;overflow:auto;padding-top:5px",id:this.documentHelper.owner.containerId+"_treeDiv"}),this.initHeadingTab(),this.onWireEvents(),t&&(this.optionsPane.classList.add("e-de-rtl"),this.closeButton.classList.add("e-de-rtl"),this.searchDiv.classList.add("e-de-rtl"))},rui.prototype.updateHeadingTab=function(){je(this.treeviewDiv)||(this.isUpdateHeading=!0,this.treeviewDiv.innerHTML="",this.data=this.dataForTreeview(),this.initHeadingTab(),this.isUpdateHeading=!1)},rui.prototype.initHeadingTab=function(){var e=Q("div",{id:"tree"});!je(this.data)&&0<this.data.length?(this.treeviewObject=new PW({fields:{dataSource:this.data,id:"id",text:"name",parentID:"pid",hasChildren:"hasChild",tooltip:"tooltipText"},nodeClicked:this.nodeClick.bind(this),cssClass:"e-de-custom-treeview",nodeTemplate:ao(function(e){return this.customTemplate(e)},this)}),je(this.treeviewDiv)||(this.treeviewDiv.innerHTML="",this.treeviewObject.appendTo(e),this.treeviewDiv.appendChild(e),je(this.findTab))||this.findTab.appendChild(this.treeviewDiv)):je(this.treeviewDiv)||(this.treeviewDiv.innerHTML=this.localeValue.getConstant("No Headings"),this.findTab.appendChild(this.treeviewDiv))},rui.prototype.customTemplate=function(e){var t=document.createElement("span");return t.innerText=e.name,t.outerHTML},rui.prototype.nodeClick=function(e){var t=this.treeviewObject.selectedNodes[0];je(t)||this.documentHelper.selection.navigateBookmark(this.data[t-1].hyperlink.toString(),!0)},rui.prototype.dataForTreeview=function(){this.data=[];var e=this.createDataSourceForTreeview(),t=(this.documentHelper.blockToShift=void 0,[]);if(!je(this.treeviewDiv)){var i=1;if(!je(e)&&0<e.length)for(var n=0;n<e.length;n++){var o=null;if("Level1"!==e[n].paragraphFormat.outlineLevel&&0<n){var r=n-1;if(e[n].paragraphFormat.outlineLevel===e[n-1].paragraphFormat.outlineLevel)o=t[r].pid;else if(Number(e[n].paragraphFormat.outlineLevel.substr(5,1))>Number(e[r].paragraphFormat.outlineLevel.substr(5,1)))o=t[r].id,t[r].hasChild=!0,t[r].expanded=!0;else for(r--;0<r;){if(Number(e[n].paragraphFormat.outlineLevel.substr(5,1))>Number(e[r].paragraphFormat.outlineLevel.substr(5,1))){o=t[r].id,t[r].hasChild=!0,t[r].expanded=!0;break}if(Number(e[n].paragraphFormat.outlineLevel.substr(5,1))===Number(e[r].paragraphFormat.outlineLevel.substr(5,1))){o=t[r].pid;break}r--}}var s=e[n].childWidgets[0],a=void 0,l=void 0,h=void 0,s=(je(s.children[3])?(a=s.children[0].text,l=s.children[0].text,h="Toc00000000"+i,i++):(l=s.children[3].text,a=s.children[3].text,h=s.children[1].text),{pid:o,id:n+1,name:a,hyperlink:15<h.length?h.substring(15,h.length-2):h,tooltipText:l});t.push(s)}}return t},rui.prototype.createDataSourceForTreeview=function(){var e={startLevel:1,endLevel:9,includeOutlineLevels:!0,includeHyperlink:!0},t=this.documentHelper.selection.start.clone(),i=this.documentHelper.selection.end.clone(),n=(this.documentHelper.owner.editor.initComplexHistory("TOC"),this.constructHeadingFieldCode(e)),e=this.documentHelper.owner.editorModule.buildToc(this.validateHeadingSettings(e),n,!1,!0,!0);return this.documentHelper.owner.editorHistory&&(this.documentHelper.owner.editorHistory.updateComplexHistory(),1<this.documentHelper.owner.editorHistory.undoStack.length)&&!je(this.documentHelper.owner.editorHistory.undoStack[this.documentHelper.owner.editorHistory.undoStack.length-1].modifiedActions)&&this.documentHelper.owner.editorHistory.undoStack.pop(),this.documentHelper.selection.selectPosition(t,i),e},rui.prototype.validateHeadingSettings=function(e){return(je(e.startLevel)||e.startLevel<1)&&(e.startLevel=1),(je(e.endLevel)||e.endLevel<e.endLevel)&&(e.endLevel=3<e.startLevel?e.startLevel:3),je(e.includeHyperlink)&&(e.includeHyperlink=!1),je(e.includePageNumber)&&(e.includePageNumber=!1),je(e.rightAlign)&&(e.rightAlign=!1),je(e.levelSettings)&&(e.levelSettings={}),e},rui.prototype.constructHeadingFieldCode=function(e){var t="TOC",e=(je(e.startLevel)||0===e.startLevel||je(e.endLevel)||0===e.endLevel||(t=t+' \\o "'+e.startLevel+"-"+e.endLevel+'"'),e.includePageNumber&&!e.rightAlign&&(t+=' \\p " "'),e.includePageNumber||(t+=" \\n"),e.includeHyperlink&&(t+=" \\h \\z"),e.includeOutlineLevels&&(t+=" \\u"),this.constructTSwitch(e));return 6<e.length&&(t+=e),t},rui.prototype.constructTSwitch=function(e){var t="";if(!je(e.levelSettings))for(var i=0,n=Object.keys(e.levelSettings);i<n.length;i++)var o=n[i],t=t+o+","+e.levelSettings[o].toString()+",";return t=' \\t "'+(t=t.slice(0,-1))+'"'},rui.prototype.createReplacePane=function(e){this.replaceDiv=Q("div"),this.replaceTabContentDiv.appendChild(this.replaceDiv),this.replaceWith=Q("input",{className:"e-de-op-replacewith e-input",attrs:{placeholder:this.localeValue.getConstant("Replace with")}}),this.replaceDiv.appendChild(this.replaceWith),e=e?(t="text-align:left","margin-left:10px"):(t="text-align:right","margin-right:10px");var t=Q("div",{styles:t,className:"e-de-op-dlg-footer"}),e=(this.replaceDiv.appendChild(t),this.replaceButton=Q("button",{className:"e-control e-btn e-flat e-replace",styles:e,innerHTML:this.localeValue.getConstant(this.replaceButtonText),attrs:{type:"button"}}),t.appendChild(this.replaceButton),this.replaceButton.setAttribute("aria-label",this.localeValue.getConstant(this.replaceButtonText)),this.replaceAllButton=Q("button",{className:"e-control e-btn e-flat e-replaceall",innerHTML:this.localeValue.getConstant(this.replaceAllButtonText),attrs:{type:"button"}}),t.appendChild(this.replaceAllButton),this.replaceAllButton.setAttribute("aria-label",this.localeValue.getConstant(this.replaceAllButtonText)),this.matchDiv=Q("div",{styles:"display:none;padding-top:10px;"}),this.replaceDiv.appendChild(this.matchDiv),Q("div",{className:"e-de-op-search-replacediv"}));this.replaceDiv.appendChild(e),this.occurrenceDiv=Q("div",{styles:"display:none;"}),this.replaceDiv.appendChild(this.occurrenceDiv)},rui.prototype.selectedTabItem=function(e){var t,i,n=this.findTab.getElementsByClassName("e-content").item(0);e.previousIndex!==e.selectedIndex&&(i=n.children[0],t=n.children[1],i=i.firstElementChild)&&(i.parentElement&&i.parentElement.removeChild(i),t.appendChild(i)),je(n.children[0])||(0===e.selectedIndex?(this.isOptionsPane=!1,this.isHeadingTab=!0,this.onHeadingPane()):1===e.selectedIndex?(this.isHeadingTab=!1,this.isOptionsPane=!0,this.onFindPane()):(this.isHeadingTab=!1,this.isOptionsPane=!1,this.onReplacePane()))},rui.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";var t=this.documentHelper.owner.findResultsList,e=this.optionsPane.offsetHeight-this.findTab.offsetHeight;this.resultsListBlock.style.height=e+"px",this.clearFocusElement(),this.resultsListBlock.innerHTML="";for(var i=0;i<t.length;i++)this.resultsListBlock.appendChild(t[i]);for(i=0;i<this.resultsListBlock.children.length;i++)this.focusedElement.push(this.resultsListBlock.children[i]);e=this.results.currentIndex,this.messageDiv.innerHTML=this.localeValue.getConstant("Result")+" "+(e+1)+" "+this.localeValue.getConstant("of")+" "+this.resultsListBlock.children.length,e=this.resultsListBlock.children[e];e.classList.contains("e-de-search-result-item")&&(e.classList.remove("e-de-search-result-item"),e.classList.add("e-de-search-result-hglt"),e.children[0].classList.add("e-de-op-search-word-text"),this.scrollToPosition(e))},rui.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()},rui.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";var e=this.optionsPane.offsetHeight-this.findTab.offsetHeight;this.resultsListBlock.style.height=e+"px",this.searchOptionChange()},rui.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)},rui.prototype.onKeyDownInternal=function(){var e=document.getElementById(this.documentHelper.owner.containerId+"_option_search_text_box");if(!je(e)){e.blur();e=e.value;if(""!==e){1<=e.length&&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"));this.isOptionsPane;this.clearSearchResultItems(),this.documentHelper.owner.searchModule.clearSearchHighlight();var e=this.documentHelper.owner.searchModule.textSearch.stringToRegex(e,this.findOption),t=this.documentHelper.selection.end.getHierarchicalIndexInternal(),e=(this.results=this.documentHelper.owner.searchModule.textSearch.findAll(e,this.findOption,t),this.results);if(je(e)&&this.viewer.renderVisiblePages(),null!=e&&0<e.length){-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(e),this.documentHelper.owner.searchModule.addFindResultView(e),this.resultContainer.style.display="block",this.resultsListBlock.style.display="block";var t=this.optionsPane.offsetHeight-this.findTab.offsetHeight,i=(this.resultsListBlock.style.height=t+"px",this.documentHelper.owner.findResultsList);this.clearFocusElement(),this.resultsListBlock.innerHTML="";for(var n=0;n<i.length;n++)this.resultsListBlock.appendChild(i[n]);for(n=0;n<this.resultsListBlock.children.length;n++)this.focusedElement.push(this.resultsListBlock.children[n]);this.resultsListBlock.children;e=this.results.currentIndex,t=(this.messageDiv.innerHTML=this.localeValue.getConstant("Result")+" "+(e+1)+" "+this.localeValue.getConstant("of")+" "+this.resultsListBlock.children.length,this.resultsListBlock.children[e]);t.classList.contains("e-de-search-result-item")&&(t.classList.remove("e-de-search-result-item"),t.classList.add("e-de-search-result-hglt"),t.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=""}}},rui.prototype.onHeadingPane=function(){this.updateHeadingTab(),this.treeviewDiv.style.display="block",this.refreshHeadingPaneHeight(),this.messageDiv.classList.remove("e-de-op-msg"),this.messageDiv.classList.remove("e-de-op-replace-messagediv"),this.replaceDiv.style.display="none",this.occurrenceDiv.style.display="none",this.findDiv.style.display="none",this.findTabContentDiv.style.display="none",this.checkboxDiv.style.display="none",this.resultContainer.style.display="none"},rui.prototype.refreshHeadingPaneHeight=function(){var e;je(this.optionsPane)||je(this.searchDiv)||je(this.tabDiv)||(e=window.getComputedStyle(this.searchDiv),e=parseFloat(e.marginBottom),e=this.optionsPane.offsetHeight-(e+this.searchDiv.offsetHeight+this.tabDiv.offsetHeight),this.treeviewDiv.style.height=e+"px")},rui.prototype.onFindPane=function(){this.replaceDiv.style.display="none",this.occurrenceDiv.style.display="none",this.treeviewDiv.style.display="none",this.findDiv.style.display="block",this.findTabContentDiv.style.display="block",this.checkboxDiv.style.display="block",this.resultContainer.style.display="block",je(this.results)||0!==this.results.length||(this.resultsListBlock.innerHTML="",this.resultsListBlock.style.display="none",this.messageDiv.innerHTML=this.localeValue.getConstant("No matches"));this.isOptionsPane;var e=this.optionsPane.offsetHeight-(this.findTab.offsetHeight-this.replaceTabContentDiv.offsetHeight);this.resultsListBlock.style.height=e+"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()},rui.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"))},rui.prototype.onReplacePane=function(){this.findDiv.style.display="block",this.replaceDiv.style.display="block",this.replaceTabContentDiv.style.display="block",this.findDiv.style.display="block",this.treeviewDiv.style.display="none",this.findTabContentDiv.style.display="block",this.checkboxDiv.style.display="block",this.resultContainer.style.display="block";this.isOptionsPane;var e=this.optionsPane.offsetHeight-this.findTab.offsetHeight;this.resultsListBlock.style.height=e+"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:this.replaceWith).select(),this.getMessageDivHeight()},rui.prototype.replaceAll=function(){this.optionsPane;var e,t,i,n=this.searchInput.value,o=this.replaceWith.value;""===n||je(n)||(e=this.documentHelper.owner.searchModule.textSearch.stringToRegex(n,this.findOption),t=this.documentHelper.selection.end.getHierarchicalIndexInternal(),e=this.documentHelper.owner.searchModule.textSearch.findAll(e,this.findOption,t),t=je(o)?"":o,i=je(e)?0:e.length,this.documentHelper.owner.searchModule.replaceAll(t,e),this.documentHelper.layout.isReplacingAll=!1,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")+" "+i+" "+this.localeValue.getConstant("instances")+" "+this.localeValue.getConstant("of")+' "'+n+'" '+this.localeValue.getConstant("with")+' "'+o+'" ')},rui.prototype.hideMatchDiv=function(){this.matchDiv.style.display="none",this.occurrenceDiv.style.display="none"},rui.prototype.updateListItems=function(e){for(var t=this.resultsListBlock.getElementsByClassName("e-de-search-result-hglt"),i=0;i<t.length;i++){var n=t[i];mt(n,["e-de-search-result-item"],["e-de-search-result-hglt"]),mt(n.children[0],[],["e-de-op-search-word-text"])}var o=this.resultsListBlock.children[this.results.currentIndex];mt(o,["e-de-search-result-hglt"],["e-de-search-result-item"]),mt(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)},rui.prototype.scrollToPosition=function(e){var t=e.getBoundingClientRect();0<t.top?(t=t.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},rui.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},rui.prototype.showHideOptionsPane=function(e){var t,i,n;je(this.documentHelper.owner.selectionModule)||(this.documentHelper.owner.fireOptionPaneChange(e),e?(this.localeValue=new Cn("documenteditor",this.documentHelper.owner.defaultLocale),this.localeValue.setLocale(this.documentHelper.owner.locale),je(this.optionsPane)&&(this.initOptionsPane(this.localeValue,this.documentHelper.owner.enableRtl),e=void 0,e=this.documentHelper.owner.enableRtl?"display:inline-flex;direction:rtl;":"display:inline-flex;",rt(this.documentHelper.optionsPaneContainer,e),this.documentHelper.optionsPaneContainer.insertBefore(this.documentHelper.owner.optionsPaneModule.optionsPane,this.documentHelper.viewerContainer)),this.optionsPane.style.display="block",this.documentHelper.owner.isReadOnlyMode?this.tabInstance.hideTab(2):this.tabInstance.hideTab(2,!1),this.isReplace&&!this.documentHelper.owner.isReadOnlyMode?(this.tabInstance.select(2),this.isReplace=!1,this.isOptionsPane=!1):this.tabInstance.select(1),je(n=document.getElementById(this.documentHelper.owner.containerId+"_treeDiv"))||(n.innerHTML=""),this.searchDiv.innerHTML=this.localeValue.getConstant(this.searchText),this.isOptionsPaneShow=!0,e=document.getElementById(this.documentHelper.owner.getDocumentEditorElement().id+"_option_search_text_box"),je(i=this.documentHelper.owner.selectionModule.text)||(i=(t=Y.indexOfAny(i,["\v","\r"]))<0?i:i.substring(0,t)),e.value=i,e.select(),!je(e.value)&&e.value.match(/[!\@\#$%\^&*\(\)_\-+\=\[\]\{\};:"\|,.<>\/?`~\s\\؟°÷×،؛]/)&&""!==e.value?(this.wholeInput.checked=!1,this.wholeWord.disabled=!0):this.wholeWord.disabled=!1,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()):(je(this.optionsPane)||(this.clearSearchResultItems(),je(this.documentHelper.owner.searchModule)||this.documentHelper.owner.searchModule.clearSearchHighlight(),this.isOptionsPaneShow=!1,t=document.getElementById(this.documentHelper.owner.containerId+"_list_box_container"),i=document.getElementById(this.documentHelper.owner.containerId+"_search_status"),je(t)||je(i)||(t.style.display="none",this.clearFocusElement(),t.innerHTML="",i.innerHTML=this.localeValue.getConstant("No matches")),je(n=document.getElementById(this.documentHelper.owner.containerId+"_treeDiv")))||(n.innerHTML=""),this.documentHelper.updateViewerSize(),je(this.optionsPane)||"none"!==this.optionsPane.style.display&&(this.documentHelper.selection.updateCaretPosition(),this.optionsPane.style.display="none"),this.documentHelper.owner.enableAutoFocus&&this.documentHelper.updateFocus(),this.documentHelper.owner.enableAutoFocus&&(this.documentHelper.selection.caret.style.display="block")),this.documentHelper.owner.triggerResize())},rui.prototype.clearSearchResultItems=function(){je(this.documentHelper.owner.findResultsList)||(this.documentHelper.owner.findResultsList=[])},rui.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.treeviewDiv&&(this.treeviewDiv.innerHTML="",this.treeviewDiv=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),je(this.results)||this.results.destroy(),this.focusedElement&&(this.focusedElement=[]),this.focusedElement=void 0,this.destroyInternal(),this.documentHelper=void 0},rui.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),this.tabDiv&&(this.tabDiv=void 0)};var oui=rui;function rui(e){var a=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.headingPaneText="Heading",this.matchDivReplaceText="No matches",this.isHeadingTab=!1,this.isBuildHeading=!1,this.tabInstance=void 0,this.isReplace=!1,this.isUpdateHeading=!1,this.searchOptionChange=function(){a.clearSearchResultItems(),a.documentHelper.owner.searchModule.clearSearchHighlight();var e,t=a.searchInput.value;""!==t&&(t=a.documentHelper.owner.searchModule.textSearch.stringToRegex(t,a.findOption),e=a.documentHelper.selection.end.getHierarchicalIndexInternal(),a.results=a.documentHelper.owner.searchModule.textSearch.findAll(t,a.findOption,e),null!=a.results&&0<a.results.length?a.navigateSearchResult(!1):(a.viewer.renderVisiblePages(),a.messageDiv.innerHTML=a.localeValue.getConstant("No matches"),a.resultContainer.style.display="block",a.resultsListBlock.style.display="none",a.clearFocusElement(),a.resultsListBlock.innerHTML=""))},this.onEnableDisableReplaceButton=function(){0!==a.searchInput.value.length?(a.replaceButton.disabled=!1,a.replaceAllButton.disabled=!1):(a.replaceButton.disabled=!0,a.replaceAllButton.disabled=!0),!je(a.searchInput.value)&&a.searchInput.value.match(/[!\@\#$%\^&*\(\)_\-+\=\[\]\{\};:"\|,.<>\/?`~\s\\؟°÷×،؛]/)&&""!==a.searchInput.value?(a.wholeWord.checked=!1,a.wholeWord.disabled=!0):a.wholeWord.disabled=!1},this.onKeyDownOnOptionPane=function(e){var t,i,n;9===e.keyCode?(e.preventDefault(),t=void 0,t=e.shiftKey?0===a.focusedIndex||je(a.focusedIndex)?a.focusedElement.length-1:a.focusedIndex-1:a.focusedElement.length-1===a.focusedIndex||je(a.focusedIndex)?0:a.focusedIndex+1,(n=a.focusedElement[t]).focus(),n instanceof HTMLInputElement&&n.select(),a.focusedIndex=t,n instanceof HTMLLIElement&&a.scrollToPosition(n)):13===e.keyCode?(a.hideMatchDiv(),e.target!==a.searchInput&&e.target!==a.closeButton&&(e.preventDefault(),-1!==(i=a.focusedElement.indexOf(e.target)))&&((t=a.focusedElement[i]).click(),t.focus(),a.focusedIndex=i)):40!==e.keyCode&&38!==e.keyCode||"none"!==a.resultsListBlock.style.display&&(n=i=void 0,40===e.keyCode?7<a.focusedIndex?a.focusedIndex+1<a.focusedElement.length&&((n=a.focusedElement[a.focusedIndex+1]).focus(),a.focusedIndex=a.focusedIndex+1):(i=a.focusedElement.length-a.resultsListBlock.children.length+a.results.currentIndex+1)<a.focusedElement.length&&((n=a.focusedElement[i]).focus(),a.focusedIndex=i):6<a.focusedIndex&&(i=a.focusedIndex-1,(n=a.focusedElement[i]).focus(),a.focusedIndex=i))},this.onReplaceButtonClick=function(){a.optionsPane;var e,t,i=a.searchInput.value,n=a.replaceWith.value,o=a.documentHelper.owner.searchModule.textSearchResults;""===i||je(i)||null!=a.documentHelper.owner.selectionModule&&(t=a.documentHelper.owner.selectionModule.text,a.documentHelper.owner.selectionModule.isEmpty||(a.documentHelper.owner.selectionModule.isForward?a.documentHelper.owner.selectionModule.selectContent(a.documentHelper.owner.selectionModule.start,!0):a.documentHelper.owner.selectionModule.selectContent(a.documentHelper.owner.selectionModule.end,!0)),je(o)||je(o.currentSearchResult)?(a.documentHelper.owner.searchModule.findAll(i,a.findOption),a.messageDiv.style.display="block",a.messageDiv.innerHTML=a.localeValue.getConstant(a.matchDivReplaceText)):(e=o.currentSearchResult,a.documentHelper.owner.searchModule.navigate(e),e.text===t?(t=je(n)?"":n,a.documentHelper.owner.searchModule.replace(t,e,o),n=a.documentHelper.owner.searchModule.textSearch.stringToRegex(i,a.findOption),t=a.documentHelper.selection.end.getHierarchicalIndexInternal(),a.results=a.documentHelper.owner.searchModule.textSearch.findAll(n,a.findOption,t),je(a.results)||je(a.results.currentSearchResult)?(a.messageDiv.style.display="block",a.messageDiv.innerHTML=a.localeValue.getConstant(a.matchDivReplaceText)):a.documentHelper.owner.searchModule.navigate(a.results.currentSearchResult),a.documentHelper.owner.findResultsList=[],!je(a.results)&&0<a.results.innerList.length?a.navigateSearchResult(!0):a.resultsListBlock.innerHTML=""):a.documentHelper.owner.searchModule.findAll(i,a.findOption)))},this.onReplaceAllButtonClick=function(){a.replaceAll(),a.resultsListBlock.style.display="none",a.messageDiv.innerHTML="",a.documentHelper.updateFocus()},this.searchIconClickInternal=function(){var e=document.getElementById(a.documentHelper.owner.containerId+"_option_search_text_box"),t=e.value;""!==t&&(a.hideMatchDiv(),a.searchIcon.classList.contains("e-de-op-search-close-icon")?(a.searchIcon.classList.add("e-de-op-search-icon"),a.searchIcon.classList.remove("e-de-op-search-close-icon"),e.value="",a.messageDiv.innerHTML=a.localeValue.getConstant("No matches"),a.resultContainer.style.display="block",a.resultsListBlock.style.display="none",a.matchDiv.style.display="none",a.occurrenceDiv.style.display="none",a.onEnableDisableReplaceButton(),a.clearFocusElement(),a.resultsListBlock.innerHTML="",a.clearSearchResultItems(),a.documentHelper.owner.searchModule.clearSearchHighlight(),a.viewer.renderVisiblePages()):(a.searchIcon.classList.contains("e-de-op-search-icon")&&1<=t.length&&(a.searchIcon.classList.add("e-de-op-search-close-icon"),a.searchIcon.classList.remove("e-de-op-search-icon"),a.onEnableDisableReplaceButton()),a.clearSearchResultItems(),a.documentHelper.owner.searchModule.clearSearchHighlight(),e=a.documentHelper.owner.searchModule.textSearch.stringToRegex(t,a.findOption),t=a.documentHelper.selection.end.getHierarchicalIndexInternal(),a.results=a.documentHelper.owner.searchModule.textSearch.findAll(e,a.findOption,t),null!=a.results&&0<a.results.length?(e=a.results.innerList[a.results.currentIndex].start,t=a.results.innerList[a.results.currentIndex].end,a.documentHelper.scrollToPosition(e,t,!0),a.navigateSearchResult(!1),a.getMessageDivHeight(),a.isOptionsPane,e=a.optionsPane.offsetHeight-a.findTab.offsetHeight,a.resultsListBlock.style.height=e+"px"):(a.messageDiv.innerHTML=a.localeValue.getConstant("No matches"),a.resultContainer.style.display="block",a.resultsListBlock.style.display="none",a.clearFocusElement(),a.resultsListBlock.innerHTML="")))},this.navigateNextResultButtonClick=function(){if(null!=document.getElementById(a.documentHelper.owner.containerId+"_list_box_container")&&"none"!==document.getElementById(a.documentHelper.owner.containerId+"_list_box_container").style.display){for(var e=a.documentHelper.owner.selectionModule.end,t=void 0,i=0,n=i=e.isExistAfter(a.results.currentSearchResult.start)?a.results.currentIndex:i;n<a.results.length;n++){var o=a.results.innerList[n];if(e.isExistBefore(o.start)||e.isAtSamePosition(o.start)){t=o,a.results.currentIndex=n;break}}je(t)&&(a.results.currentIndex=0,t=a.results.innerList[0]),a.messageDiv.innerHTML=a.localeValue.getConstant("Result")+" "+(a.results.currentIndex+1)+" "+a.localeValue.getConstant("of")+" "+a.resultsListBlock.children.length,a.updateListItems(t),a.focusedIndex=a.focusedElement.indexOf(a.navigateToNextResult)}},this.navigatePreviousResultButtonClick=function(){if(null!=document.getElementById(a.documentHelper.owner.containerId+"_list_box_container")&&"none"!==document.getElementById(a.documentHelper.owner.containerId+"_list_box_container").style.display){for(var e=void 0,t=a.documentHelper.owner.selectionModule.start,i=a.results.currentIndex,n=i=t.isExistAfter(a.results.currentSearchResult.start)?a.results.length-1:i;0<=n;n--){var o=a.results.innerList[n];if(t.isExistAfter(o.start)||a.documentHelper.owner.selectionModule.end.isAtSamePosition(o.start)){e=o,a.results.currentIndex=n;break}}je(e)&&(a.results.currentIndex=a.results.length-1,e=a.results.innerList[a.results.currentIndex]),a.messageDiv.innerHTML=a.localeValue.getConstant("Result")+" "+(a.results.currentIndex+1)+" "+a.localeValue.getConstant("of")+" "+a.resultsListBlock.children.length,a.updateListItems(e),a.focusedIndex=a.focusedElement.indexOf(a.navigateToPreviousResult)}},this.onKeyDown=function(e){var t=e.which||e.keyCode;13===t&&9!==e.keyCode&&40!==e.keyCode?(e.preventDefault(),a.findDiv.style.height="",a.onKeyDownInternal()):8===t&&0===a.searchInput.value.length?a.resultContainer.style.display="block":9!==e.keyCode&&40!==e.keyCode&&27!==e.keyCode?(a.documentHelper.owner.searchModule.clearSearchHighlight(),a.clearSearchResultItems(),a.viewer.renderVisiblePages(),a.resultsListBlock.style.display="none",a.messageDiv.innerHTML=a.localeValue.getConstant("No matches"),a.resultContainer.style.display="none",a.clearFocusElement(),a.resultsListBlock.innerHTML="",a.searchIcon.classList.contains("e-de-op-search-close-icon")&&(a.searchIcon.classList.add("e-de-op-search-icon"),a.searchIcon.classList.remove("e-de-op-search-close-icon"))):27===t&&27===e.keyCode&&(a.showHideOptionsPane(!1),a.documentHelper.owner.documentEditorSettings.showNavigationPane=!1,a.documentHelper.updateFocus())},this.close=function(){a.clearFocusElement(),a.showHideOptionsPane(!1),a.documentHelper.owner.documentEditorSettings.showNavigationPane=!1,a.resultsListBlock.innerHTML="",a.focusedIndex=1,a.isOptionsPane=!0,a.documentHelper.updateFocus()},this.resultListBlockClick=function(e){for(var t,i=e.target,n=a.resultsListBlock.children,o=0,r=0;r<n.length;r++){var s=n[r];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(r=0;r<n.length;r++)i===n[r]&&(t=n[o=r]).classList.contains("e-de-search-result-item")&&(t.classList.remove("e-de-search-result-item"),t.classList.add("e-de-search-result-hglt"),t.children[0].classList.add("e-de-op-search-word-text"),a.focusedIndex=a.focusedElement.indexOf(t));e=a.results.innerList[o];a.results.currentIndex=o,a.messageDiv.innerHTML=a.localeValue.getConstant("Result")+" "+(o+1)+" "+a.localeValue.getConstant("of")+" "+a.resultsListBlock.children.length,a.documentHelper.owner.searchModule.navigate(e),a.documentHelper.owner.searchModule.highlight(a.results),t&&t.focus()},this.documentHelper=e}Object.defineProperty(aui.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(aui.prototype,"renderedFontFamily",{get:function(){return this.renderedFontFamilyIn},enumerable:!0,configurable:!0}),Object.defineProperty(aui.prototype,"fontFamily",{get:function(){return this.fontFamilyIn},set:function(e){e!==this.fontFamilyIn&&(this.fontFamilyIn=this.renderedFontFamilyIn=e,this.notifyPropertyChanged("fontFamily"))},enumerable:!0,configurable:!0}),Object.defineProperty(aui.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(aui.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(aui.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(aui.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(aui.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(aui.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(aui.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(aui.prototype,"allCaps",{get:function(){return this.allCapsIn},set:function(e){e!==this.allCapsIn&&(this.allCapsIn=e,this.notifyPropertyChanged("allCaps"))},enumerable:!0,configurable:!0}),aui.prototype.getPropertyValue=function(e){switch(e){case"bold":return this.bold;case"italic":return this.italic;case"fontSize":return 1<=this.fontSize?this.fontSize:void 0;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}},aui.prototype.notifyPropertyChanged=function(e){var t;!je(this.selection)&&(this.selection.isCleared||this.selection.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||!this.selection.owner.isDocumentLoaded||this.selection.owner.isPastingContent)&&!this.selection.isRetrieveFormatting||je(this.selection)||je(this.selection.start)||this.selection.isRetrieveFormatting||je(t=this.getPropertyValue(e))||this.selection.owner.editorModule.onApplyCharacterFormat(e,t)},aui.prototype.copyFormat=function(e,t){this.styleName=je(e.baseCharStyle)?"Default Paragraph Font":e.baseCharStyle.name,this.fontSize=e.fontSize,this.fontFamily=e.fontFamily,this.renderedFontFamilyIn=t,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,this.complexScript=e.complexScript},aui.prototype.combineFormat=function(e,t){je(this.bold)||this.bold===e.bold||(this.bold=void 0),je(this.italic)||this.italic===e.italic||(this.italic=void 0),0!==this.fontSize&&this.fontSize!==e.fontSize&&(this.fontSize=0),je(this.renderedFontFamily)||this.renderedFontFamily===t||(this.renderedFontFamilyIn=void 0),je(this.fontFamily)||this.fontFamily===e.fontFamily||(this.fontFamily=void 0),je(this.highlightColor)||this.highlightColor===e.highlightColor||(this.highlightColor=void 0),je(this.baselineAlignment)||this.baselineAlignment===e.baselineAlignment||(this.baselineAlignment=void 0),je(this.fontColor)||this.fontColor===e.fontColor||(this.fontColor=void 0),je(this.underline)||this.underline===e.underline||(this.underline=void 0),je(this.strikethrough)||this.strikethrough===e.strikethrough||(this.strikethrough=void 0),je(this.boldBidi)||this.boldBidi===e.boldBidi||(this.boldBidi=void 0),je(this.italicBidi)||this.italicBidi===e.italicBidi||(this.italicBidi=void 0),0!==this.fontSizeBidi&&this.fontSizeBidi!==e.fontSizeBidi&&(this.fontSizeBidi=0),je(this.fontFamilyBidi)||this.fontFamilyBidi===e.fontFamilyBidi||(this.fontFamilyBidi=void 0),je(this.bidi)||this.bidi===e.bidi||(this.bidi=void 0),je(this.bdo)||this.bdo===e.bdo||(this.bdo=void 0),je(this.allCaps)||this.allCaps===e.allCaps||(this.allCaps=void 0),je(this.complexScript)||this.complexScript===e.complexScript||(this.complexScript=void 0)},aui.prototype.canRetrieveNextCharacterFormat=function(){return!(je(this.bold)&&je(this.italic)&&0===this.fontSize&&je(this.fontFamily)&&je(this.highlightColor)&&je(this.baselineAlignment)&&je(this.fontColor)&&je(this.underline)&&je(this.strikethrough)&&je(this.boldBidi)&&je(this.italicBidi)&&0===this.fontSizeBidi&&je(this.fontFamilyBidi)&&je(this.bdo)&&je(this.allCaps))},aui.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,this.complexScript=e.complexScript},aui.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},aui.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,this.complexScript=void 0},aui.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,this.complexScript=void 0};var sui=aui;function aui(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.scriptType=lJt.English,this.fontColorIn=void 0,this.allCapsIn=void 0,this.boldBidi=void 0,this.italicBidi=void 0,this.complexScript=void 0,this.fontSizeBidi=0,this.bidi=void 0,this.bdo=void 0,this.selection=e}Object.defineProperty(hui.prototype,"color",{get:function(){return this.colorIn},set:function(e){e!==this.colorIn&&(this.colorIn=e,this.notifyPropertyChanged("color"))},enumerable:!0,configurable:!0}),Object.defineProperty(hui.prototype,"lineStyle",{get:function(){return this.lineStyleIn},set:function(e){e!==this.lineStyleIn&&(this.lineStyleIn=e,this.notifyPropertyChanged("lineStyle"))},enumerable:!0,configurable:!0}),Object.defineProperty(hui.prototype,"lineWidth",{get:function(){return this.lineWidthIn},set:function(e){e!==this.lineWidthIn&&(this.lineWidthIn=e,this.notifyPropertyChanged("lineWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(hui.prototype,"shadow",{get:function(){return this.shadowIn},set:function(e){e!==this.shadowIn&&(this.shadowIn=e,this.notifyPropertyChanged("shadow"))},enumerable:!0,configurable:!0}),Object.defineProperty(hui.prototype,"space",{get:function(){return this.spaceIn},set:function(e){e!==this.spaceIn&&(this.spaceIn=e,this.notifyPropertyChanged("space"))},enumerable:!0,configurable:!0}),hui.prototype.copyFormat=function(e){this.color=e.color,this.lineStyle=e.lineStyle,this.lineWidth=e.lineWidth,this.shadow=e.shadow,this.space=e.space},hui.prototype.combineFormat=function(e){je(this.color)||this.color===e.color||(this.color=void 0),je(this.lineStyle)||this.lineStyle===e.lineStyle||(this.lineStyle=void 0),je(this.lineWidth)||this.lineWidth===e.lineWidth||(this.lineWidth=void 0),je(this.shadow)||this.shadow===e.shadow||(this.shadow=void 0),je(this.space)||this.space===e.space||(this.space=void 0)},hui.prototype.getPropertyValue=function(e){switch(e){case"color":return this.color;case"lineStyle":return this.lineStyle;case"lineWidth":return this.lineWidth;case"space":return this.space;case"shadow":return this.shadow}},hui.prototype.notifyPropertyChanged=function(e){var t,i;!(je(this.selection)||(!this.selection.owner.isReadOnlyMode||this.selection.isInlineFormFillMode())&&this.selection.owner.isDocumentLoaded||this.selection.isRetrieveFormatting)||je(this.selection)||je(this.selection.start)||this.selection.isRetrieveFormatting||(t=this.selection.owner.editorModule,je(i=this.getPropertyValue(e)))||t.applyParagraphBorders(e,this.borderType,i)},hui.prototype.destroy=function(){je(this.colorIn)||(this.colorIn=void 0),je(this.lineStyleIn)||(this.lineStyleIn=void 0),je(this.lineWidthIn)||(this.lineWidthIn=void 0),je(this.spaceIn)||(this.spaceIn=void 0),je(this.shadowIn)||(this.shadowIn=void 0)};var lui=hui;function hui(e,t,i){this.colorIn=void 0,this.lineStyleIn=void 0,this.lineWidthIn=void 0,this.shadowIn=void 0,this.spaceIn=void 0,this.borderType=t,this.ownerBase=i,this.selection=e}Object.defineProperty(pui.prototype,"top",{get:function(){return this.topIn},enumerable:!0,configurable:!0}),Object.defineProperty(pui.prototype,"bottom",{get:function(){return this.bottomIn},enumerable:!0,configurable:!0}),Object.defineProperty(pui.prototype,"left",{get:function(){return this.leftIn},enumerable:!0,configurable:!0}),Object.defineProperty(pui.prototype,"right",{get:function(){return this.rightIn},enumerable:!0,configurable:!0}),Object.defineProperty(pui.prototype,"horizontal",{get:function(){return this.horizontalIn},enumerable:!0,configurable:!0}),Object.defineProperty(pui.prototype,"vertical",{get:function(){return this.verticalIn},enumerable:!0,configurable:!0}),pui.prototype.copyFormat=function(e){this.top.copyFormat(e.top),this.bottom.copyFormat(e.bottom),this.left.copyFormat(e.left),this.right.copyFormat(e.right),this.horizontal.copyFormat(e.horizontal),this.vertical.copyFormat(e.vertical)},pui.prototype.combineFormat=function(e){this.top.combineFormat(e.top),this.bottom.combineFormat(e.bottom),this.left.combineFormat(e.left),this.right.combineFormat(e.right),this.vertical.combineFormat(e.vertical),this.horizontal.combineFormat(e.horizontal)},pui.prototype.destroy=function(){je(this.topIn)||(this.topIn.destroy(),this.topIn=void 0),je(this.topIn)||(this.bottomIn.destroy(),this.bottomIn=void 0),je(this.leftIn)||(this.leftIn.destroy(),this.leftIn=void 0),je(this.rightIn)||(this.rightIn.destroy(),this.rightIn=void 0),je(this.horizontalIn)||(this.horizontalIn.destroy(),this.horizontalIn=void 0),je(this.verticalIn)||(this.verticalIn.destroy(),this.verticalIn=void 0)};var dui=pui;function pui(e,t){this.ownerBase=void 0,this.ownerBase=t,this.selection=e,this.topIn=new lui(this.selection,"topBorder",this),this.bottomIn=new lui(this.selection,"bottomBorder",this),this.rightIn=new lui(this.selection,"rightBorder",this),this.leftIn=new lui(this.selection,"leftBorder",this),this.horizontalIn=new lui(this.selection,"horizontalBorder",this),this.verticalIn=new lui(this.selection,"verticalBorder",this)}Object.defineProperty(uui.prototype,"borders",{get:function(){return this.bordersIn},enumerable:!0,configurable:!0}),Object.defineProperty(uui.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(uui.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(uui.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(uui.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(uui.prototype,"outlineLevel",{get:function(){return this.outlineLevelIn},set:function(e){e!==this.outlineLevelIn&&(this.outlineLevelIn=e,this.notifyPropertyChanged("outlineLevel"))},enumerable:!0,configurable:!0}),Object.defineProperty(uui.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(uui.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(uui.prototype,"spaceAfterAuto",{get:function(){return this.spaceAfterAutoIn},set:function(e){e!==this.spaceAfterAutoIn&&(this.spaceAfterAutoIn=e,this.notifyPropertyChanged("spaceAfterAuto"))},enumerable:!0,configurable:!0}),Object.defineProperty(uui.prototype,"spaceBeforeAuto",{get:function(){return this.spaceBeforeAutoIn},set:function(e){e!==this.spaceBeforeAutoIn&&(this.spaceBeforeAutoIn=e,this.notifyPropertyChanged("spaceBeforeAuto"))},enumerable:!0,configurable:!0}),Object.defineProperty(uui.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(uui.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(uui.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(uui.prototype,"bidi",{get:function(){return this.bidiIn},set:function(e){this.bidiIn=e,this.notifyPropertyChanged("bidi")},enumerable:!0,configurable:!0}),Object.defineProperty(uui.prototype,"keepWithNext",{get:function(){return this.keepWithNextIn},set:function(e){this.keepWithNextIn=e,this.notifyPropertyChanged("keepWithNext")},enumerable:!0,configurable:!0}),Object.defineProperty(uui.prototype,"keepLinesTogether",{get:function(){return this.keepLinesTogetherIn},set:function(e){this.keepLinesTogetherIn=e,this.notifyPropertyChanged("keepLinesTogether")},enumerable:!0,configurable:!0}),Object.defineProperty(uui.prototype,"widowControl",{get:function(){return this.widowControlIn},set:function(e){this.widowControlIn=e,this.notifyPropertyChanged("widowControl")},enumerable:!0,configurable:!0}),Object.defineProperty(uui.prototype,"contextualSpacing",{get:function(){return this.contextualSpacingIn},set:function(e){this.contextualSpacingIn=e,this.notifyPropertyChanged("contextualSpacing")},enumerable:!0,configurable:!0}),uui.prototype.validateLineSpacing=function(){return"Multiple"!==this.lineSpacingType&&this.lineSpacingIn<12},Object.defineProperty(uui.prototype,"listText",{get:function(){var e=void 0,t=this.documentHelper.getListById(this.listId);if(t instanceof xpi&&-1<this.listLevelNumberIn&&this.listLevelNumberIn<9){var i=t.getListLevel(this.listLevelNumber);if(i instanceof rsi)if("Bullet"===i.listLevelPattern)e=i.numberFormat;else{e=i.numberFormat;for(var n,o=0;o<9;o++)-1<e.indexOf("%"+(o+1))&&(o===this.listLevelNumberIn||t.getListLevel(o),e=(n=this.selection.getListTextElementBox(this.selection.start.paragraph))?n.text:"")}}return e},enumerable:!0,configurable:!0}),uui.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"spaceAfterAuto":return this.spaceAfterAuto;case"spaceBeforeAuto":return this.spaceBeforeAuto;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;case"keepWithNext":return this.keepWithNext;case"keepLinesTogether":return this.keepLinesTogether;case"widowControl":return this.widowControl;case"outlineLevel":return this.outlineLevel;default:return}},uui.prototype.notifyPropertyChanged=function(e){if((je(this.selection)||(!this.selection.owner.isReadOnlyMode||this.selection.isInlineFormFillMode())&&this.selection.owner.isDocumentLoaded||this.selection.isRetrieveFormatting)&&!je(this.selection)&&!je(this.selection.start)&&!this.selection.isRetrieveFormatting){var t=this.selection.owner.editorModule;if("lineSpacing"===e||"lineSpacingType"===e){var i=this.selection.owner.editorHistoryModule;if((!i||!i.isUndoing&&!i.isRedoing)&&this.validateLineSpacing())return this.selection.owner.editorHistoryModule.initComplexHistory(this.selection,"LineSpacing"),"lineSpacing"===e?(this.lineSpacingTypeIn="Multiple",i=this.getPropertyValue("lineSpacingType"),t.onApplyParagraphFormat("lineSpacingType",i,!1,!1),t.onApplyParagraphFormat(e,this.getPropertyValue(e),!1,!1)):(t.onApplyParagraphFormat(e,this.getPropertyValue(e),!1,!1),this.lineSpacingIn=12,t.onApplyParagraphFormat("lineSpacing",this.getPropertyValue("lineSpacing"),!1,!1)),void this.selection.owner.editorHistoryModule.updateComplexHistory()}i=this.getPropertyValue(e);("leftIndent"!==e&&"rightIndent"!==e&&"firstLineIndent"!==e||-1056<=i&&i<1056)&&("listLevelNumber"===e?t.onApplyListInternal(this.documentHelper.getListById(this.listId),this.listLevelNumber):t.onApplyParagraphFormat(e,i,"textAlignment"===e,!1))}},uui.prototype.copyFormat=function(e){this.styleName=je(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.spaceAfterAuto=e.spaceAfterAuto,this.spaceBeforeAuto=e.spaceBeforeAuto,this.lineSpacing=e.lineSpacing,this.lineSpacingType=e.lineSpacingType,this.textAlignment=e.textAlignment,this.outlineLevel=e.outlineLevel,this.bidi=e.bidi,this.keepLinesTogether=e.keepLinesTogether,this.keepWithNext=e.keepWithNext,this.widowControl=e.widowControl,this.contextualSpacing=e.contextualSpacing,this.borders.copyFormat(e.borders),je(e.listFormat)||je(e.listFormat.listId)?(this.listId=void 0,this.listLevelNumber=0):(this.listId=e.listFormat.listId,this.listLevelNumber=e.listFormat.listLevelNumber)},uui.prototype.copyToFormat=function(e){je(e)||(je(this.afterSpacing)||(e.afterSpacing=this.afterSpacing),je(this.beforeSpacing)||(e.beforeSpacing=this.beforeSpacing),je(this.spaceAfterAuto)||(e.spaceAfterAuto=this.spaceAfterAuto),je(this.spaceBeforeAuto)||(e.spaceBeforeAuto=this.spaceBeforeAuto),je(this.leftIndent)||(e.leftIndent=this.leftIndent),je(this.rightIndent)||(e.rightIndent=this.rightIndent),je(this.textAlignment)||(e.textAlignment=this.textAlignment),je(this.outlineLevel)||(e.outlineLevel=this.outlineLevel),je(this.lineSpacing)||(e.lineSpacing=this.lineSpacing),je(this.lineSpacingType)||(e.lineSpacingType=this.lineSpacingType),je(this.firstLineIndent)||(e.firstLineIndent=this.firstLineIndent),je(this.bidi)||(e.bidi=this.bidi),je(this.keepWithNext)||(e.keepWithNext=this.keepWithNext),je(this.keepLinesTogether)||(e.keepLinesTogether=this.keepLinesTogether),je(this.widowControl)||(e.widowControl=this.widowControl),je(this.contextualSpacing))||(e.contextualSpacing=this.contextualSpacing)},uui.prototype.combineFormat=function(e){je(this.leftIndent)||this.leftIndent===e.leftIndent||(this.leftIndent=void 0),je(this.rightIndent)||this.rightIndent===e.rightIndent||(this.rightIndent=void 0),je(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),je(this.spaceAfterAuto)||this.spaceAfterAuto===e.spaceAfterAuto||(this.spaceAfterAuto=void 0),je(this.spaceBeforeAuto)||this.spaceBeforeAuto===e.spaceBeforeAuto||(this.spaceBeforeAuto=void 0),je(this.lineSpacingType)||this.lineSpacingType===e.lineSpacingType||(this.lineSpacingType=void 0),je(this.textAlignment)||this.textAlignment===e.textAlignment||(this.textAlignment=void 0),je(this.outlineLevel)||this.outlineLevel===e.outlineLevel||(this.outlineLevel=void 0),0<=this.listLevelNumber&&!je(this.listId)&&(je(e.listFormat)||e.listFormat.listLevelNumber!==this.listLevelNumber)&&(this.listLevelNumber=-1),(je(e.listFormat)||je(e.listFormat.listId)||!je(this.listId)&&this.listId!==e.listFormat.listId)&&(this.listId=void 0),je(this.bidi)||this.bidi===e.bidi||(this.bidi=void 0),je(this.keepLinesTogether)||this.keepLinesTogether===e.keepLinesTogether||(this.keepLinesTogether=void 0),je(this.keepWithNext)||this.keepWithNext===e.keepWithNext||(this.keepWithNext=void 0),je(this.widowControl)||this.widowControl===e.widowControl||(this.widowControl=void 0),je(this.contextualSpacing)||this.contextualSpacing===e.contextualSpacing||(this.contextualSpacing=void 0),!je(this.styleName)&&e.baseStyle&&this.styleName!==e.baseStyle.name&&(this.styleName=void 0),this.borders.combineFormat(e.borders)},uui.prototype.clearFormat=function(){this.leftIndent=0,this.rightIndent=0,this.beforeSpacing=0,this.afterSpacing=0,this.spaceAfterAuto=void 0,this.spaceBeforeAuto=void 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},uui.prototype.getList=function(){var e=this.documentHelper.getListById(this.listId);if(!je(e)){var t=new xpi,i=new tsi,n=this.documentHelper.getAbstractListById(e.abstractListId),o=this.selection.owner.editorModule;if(je(n))i.levels.push(new rsi(i));else for(var r=0;r<n.levels.length;r++){var s=o.cloneListLevel(n.levels[r]);i.levels.push(s),s.ownerBase=i}if(!je(e.levelOverrides))for(r=0;r<e.levelOverrides.length;r++){var a=o.cloneLevelOverride(e.levelOverrides[r]);t.levelOverrides.push(a)}return t.abstractList=i,t.abstractListId=i.abstractListId,t.sourceListId=e.listId,t}},uui.prototype.setList=function(e,t){var i,n,o,r;this.documentHelper.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||!this.documentHelper.owner.isDocumentLoaded||!je(this.selection)&&this.selection.checkContentControlLocked(!0)||(i=this.documentHelper.getListById(this.listId),n=void 0,o=e?this.documentHelper.getAbstractListById(e.abstractListId):void 0,je(i)||je(e)||je(o)||e.sourceListId!==i.listId?je(e)?this.selection.owner.editorModule.onApplyList(void 0):(this.selection.owner.isLayoutEnabled=!1,je(o)||-1!==this.documentHelper.abstractLists.indexOf(o)||this.documentHelper.abstractLists.push(o),-1===this.documentHelper.lists.indexOf(e)&&this.documentHelper.lists.push(e),this.selection.owner.isLayoutEnabled=!0,this.selection.owner.editorModule.onApplyList(e)):(r=this.documentHelper.owner.editorHistoryModule,this.documentHelper.layout.getListLevel(i,1),this.selection.owner.isLayoutEnabled=!1,this.documentHelper.owner.editorModule.setOffsetValue(this.selection),r&&(n=r.updateListChangesInHistory(o,i)),this.documentHelper.owner.editorModule.updateListParagraphs(),r&&r.applyListChanges(this.selection,n),this.selection.owner.isLayoutEnabled=!0,this.documentHelper.renderedLists.clear(),this.documentHelper.renderedLevelOverrides=[],t&&this.documentHelper.layout.clearInvalidList(e),this.documentHelper.owner.editorModule.layoutWholeDocument(),this.documentHelper.owner.editorModule.updateSelectionTextPosition(!1),r&&r.currentBaseHistoryInfo&&(0<r.currentBaseHistoryInfo.modifiedProperties.length&&r.currentBaseHistoryInfo.updateSelection(),r.updateHistory()),this.documentHelper.owner.editorModule.fireContentChange()))},uui.prototype.destroy=function(){this.leftIndentIn=void 0,this.rightIndentIn=void 0,this.beforeSpacingIn=void 0,this.afterSpacingIn=void 0,this.spaceBeforeAutoIn=void 0,this.spaceAfterAutoIn=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,je(this.bordersIn)||(this.bordersIn.destroy(),this.bordersIn=void 0)};var cui=uui;function uui(e,t){this.leftIndentIn=0,this.rightIndentIn=0,this.beforeSpacingIn=0,this.afterSpacingIn=0,this.spaceAfterAutoIn=void 0,this.spaceBeforeAutoIn=void 0,this.textAlignmentIn=void 0,this.outlineLevelIn=void 0,this.firstLineIndentIn=0,this.lineSpacingIn=1,this.lineSpacingTypeIn=void 0,this.bidiIn=void 0,this.keepWithNextIn=void 0,this.keepLinesTogetherIn=void 0,this.widowControlIn=void 0,this.contextualSpacingIn=void 0,this.listLevelNumberIn=-1,this.selection=e,this.documentHelper=t,this.bordersIn=new dui(this.selection,this)}Object.defineProperty(mui.prototype,"linkToPrevious",{get:function(){return this.linkToPreviousIn},set:function(e){this.linkToPreviousIn=e,this.notifyPropertyChanged("linkToPrevious")},enumerable:!0,configurable:!0}),mui.prototype.notifyPropertyChanged=function(e){var t,i,n,o=this.selection;!je(o)&&(o.isCleared||o.owner.isPastingContent||o.owner.isReadOnlyMode||!o.owner.isDocumentLoaded)&&!o.isRetrieveFormatting||je(o)||je(o.start)||o.isRetrieveFormatting||je(t=this.getPropertyvalue(e))||(i=(n=o.start.paragraph.bodyWidget).sectionIndex,n=n.headerFooterType,o.owner.editorModule.removeInlineHeaderFooterWidget(i,n,e,t))},mui.prototype.getPropertyvalue=function(e){if("linkToPrevious"==e&&!je(this.linkToPrevious))return this.linkToPrevious};var gui=mui;function mui(e){this.linkToPreviousIn=!0,this.selection=e}Object.defineProperty(yui.prototype,"pageHeight",{get:function(){return this.pageHeightIn},set:function(e){this.pageHeightIn=e,this.notifyPropertyChanged("pageHeight")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"pageWidth",{get:function(){return this.pageWidthIn},set:function(e){this.pageWidthIn=e,this.notifyPropertyChanged("pageWidth")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"leftMargin",{get:function(){return this.leftMarginIn},set:function(e){this.leftMarginIn=e,this.notifyPropertyChanged("leftMargin")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"bottomMargin",{get:function(){return this.bottomMarginIn},set:function(e){this.bottomMarginIn=e,this.notifyPropertyChanged("bottomMargin")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"topMargin",{get:function(){return this.topMarginIn},set:function(e){this.topMarginIn=e,this.notifyPropertyChanged("topMargin")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"rightMargin",{get:function(){return this.rightMarginIn},set:function(e){this.rightMarginIn=e,this.notifyPropertyChanged("rightMargin")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"headerDistance",{get:function(){return this.headerDistanceIn},set:function(e){this.headerDistanceIn=e,this.notifyPropertyChanged("headerDistance")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"firstPageHeader",{get:function(){return this.firstPageHeaderIn},set:function(e){this.firstPageHeaderIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"firstPageFooter",{get:function(){return this.firstPageFooterIn},set:function(e){this.firstPageFooterIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"oddPageHeader",{get:function(){return this.oddPageHeaderIn},set:function(e){this.oddPageHeaderIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"oddPageFooter",{get:function(){return this.oddPageFooterIn},set:function(e){this.oddPageFooterIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"evenPageHeader",{get:function(){return this.evenPageHeaderIn},set:function(e){this.evenPageHeaderIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"evenPageFooter",{get:function(){return this.evenPageFooterIn},set:function(e){this.evenPageFooterIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"pageStartingNumber",{get:function(){return this.pageStartingNumberIn},set:function(e){this.pageStartingNumberIn=e,this.notifyPropertyChanged("pageStartingNumber")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"restartPageNumbering",{get:function(){return this.restartPageNumberingIn},set:function(e){this.restartPageNumberingIn=e,this.notifyPropertyChanged("restartPageNumbering")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"footerDistance",{get:function(){return this.footerDistanceIn},set:function(e){this.footerDistanceIn=e,this.notifyPropertyChanged("footerDistance")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"differentFirstPage",{get:function(){return this.differentFirstPageIn},set:function(e){this.differentFirstPageIn=e,this.notifyPropertyChanged("differentFirstPage")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"differentOddAndEvenPages",{get:function(){return this.differentOddAndEvenPagesIn},set:function(e){this.differentOddAndEvenPagesIn=e,this.notifyPropertyChanged("differentOddAndEvenPages")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"endnoteNumberFormat",{get:function(){return this.endnoteNumberFormatIn},set:function(e){this.endnoteNumberFormatIn=e,this.notifyPropertyChanged("endnoteNumberFormat")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"footNoteNumberFormat",{get:function(){return this.footNoteNumberFormatIn},set:function(e){this.footNoteNumberFormatIn=e,this.notifyPropertyChanged("footNoteNumberFormat")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"initialFootNoteNumber",{get:function(){return this.initialFootNoteNumberIn},set:function(e){this.initialFootNoteNumberIn=e,this.notifyPropertyChanged("initialFootNoteNumber")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"initialEndNoteNumber",{get:function(){return this.initialEndNoteNumberIn},set:function(e){this.initialEndNoteNumberIn=e,this.notifyPropertyChanged("initialEndNoteNumber")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"restartIndexForFootnotes",{get:function(){return this.restartIndexForFootnotesIn},set:function(e){this.restartIndexForFootnotesIn=e,this.notifyPropertyChanged("restartIndexForFootnotes")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"restartIndexForEndnotes",{get:function(){return this.restartIndexForEndnotesIn},set:function(e){this.restartIndexForEndnotesIn=e,this.notifyPropertyChanged("restartIndexForEndnotes")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"numberOfColumns",{get:function(){return 0==this.columns.length?1:this.columns.length},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"equalWidth",{get:function(){return this.equalWidthIn},set:function(e){this.equalWidthIn=e,this.notifyPropertyChanged("equalWidth")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"lineBetweenColumns",{get:function(){return this.lineBetweenColumnsIn},set:function(e){this.lineBetweenColumnsIn=e,this.notifyPropertyChanged("lineBetweenColumns")},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"columns",{get:function(){return this.columnsIn},set:function(e){this.columnsIn=e;var t=this.selection;!je(t)&&(t.isCleared||t.owner.isPastingContent||t.owner.isReadOnlyMode||!t.owner.isDocumentLoaded)&&!t.isRetrieveFormatting||je(t)||je(t.start)||t.isRetrieveFormatting||this.selection.owner.editorModule.onApplyColumnFormat("columns",e)},enumerable:!0,configurable:!0}),Object.defineProperty(yui.prototype,"breakCode",{get:function(){return this.breakCodeIn},set:function(e){this.breakCodeIn=e,this.notifyPropertyChanged("breakCode")},enumerable:!0,configurable:!0}),yui.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,this.equalWidth=e.equalWidth,this.lineBetweenColumns=e.lineBetweenColumns,this.columns=[];for(var t=0,i=e.columns;t<i.length;t++){var n=i[t],o=new Tui(this.selection);o.width=Y.convertPixelToPoint(n.width),o.space=Y.convertPixelToPoint(n.space),this.columns.push(o)}if(this.breakCode=e.breakCode,this.selection.owner.enableHeaderAndFooter){var e=this.selection.documentHelper.headersFooters,r=this.selection.start.paragraph.containerWidget,s=r.sectionIndex,r=r.headerFooterType,a=!1;if(0==s)this.oddPageHeader.linkToPrevious=!1,this.oddPageFooter.linkToPrevious=!1,this.evenPageHeader.linkToPrevious=!1,this.evenPageFooter.linkToPrevious=!1,this.firstPageHeader.linkToPrevious=!1,this.firstPageFooter.linkToPrevious=!1;else if(e[s]){var l=this.selection.viewer.getHeaderFooter(r),e=e[s][l];if(je(e)&&(a=!0),!je(e)||a)switch(r){case"OddHeader":this.oddPageHeader.linkToPrevious=!!a;break;case"OddFooter":this.oddPageFooter.linkToPrevious=!!a;break;case"EvenHeader":this.evenPageHeader.linkToPrevious=!!a;break;case"EvenFooter":this.evenPageFooter.linkToPrevious=!!a;break;case"FirstPageHeader":this.firstPageHeader.linkToPrevious=!!a;break;case"FirstPageFooter":this.firstPageFooter.linkToPrevious=!!a}}}},yui.prototype.applyColumnFormat=function(){},yui.prototype.notifyPropertyChanged=function(e){var t,i=this.selection;!je(i)&&(i.isCleared||i.owner.isPastingContent||i.owner.isReadOnlyMode||!i.owner.isDocumentLoaded)&&!i.isRetrieveFormatting||je(i)||je(i.start)||i.isRetrieveFormatting||je(t=this.getPropertyvalue(e))||i.owner.editorModule.onApplySectionFormat(e,t)},yui.prototype.getPropertyvalue=function(e){switch(e){case"pageHeight":return 0<this.pageHeight?this.pageHeight:void 0;case"pageWidth":return 0<this.pageWidth?this.pageWidth:void 0;case"leftMargin":return 0<=this.leftMargin?this.leftMargin:void 0;case"rightMargin":return 0<=this.rightMargin?this.rightMargin:void 0;case"topMargin":return 0<=this.topMargin?this.topMargin:void 0;case"bottomMargin":return 0<=this.bottomMargin?this.bottomMargin:void 0;case"differentFirstPage":return je(this.differentFirstPage)?void 0:this.differentFirstPage;case"differentOddAndEvenPages":return je(this.differentOddAndEvenPages)?void 0:this.differentOddAndEvenPages;case"headerDistance":return this.headerDistanceIn;case"footerDistance":return this.footerDistance;case"pageStartingNumber":return je(this.pageStartingNumber)?void 0:this.pageStartingNumber;case"restartPageNumbering":return je(this.restartPageNumbering)?void 0:this.restartPageNumbering;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;case"equalWidth":return this.equalWidthIn;case"lineBetweenColumns":return this.lineBetweenColumnsIn;case"columns":return this.columnsIn;case"breakCode":return this.breakCodeIn;default:return}},yui.prototype.combineFormat=function(e){0<this.pageHeight&&this.pageHeight!==e.pageHeight&&(this.pageHeight=0),0<this.pageWidth&&this.pageWidth!==e.pageWidth&&(this.pageWidth=0),-1<this.leftMargin&&this.leftMargin!==e.leftMargin&&(this.leftMargin=-1),-1<this.topMargin&&this.topMargin!==e.topMargin&&(this.topMargin=-1),-1<this.rightMargin&&this.rightMargin!==e.rightMargin&&(this.rightMargin=-1),-1<this.bottomMargin&&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),je(this.differentFirstPage)||this.differentFirstPage===e.differentFirstPage||(this.differentFirstPage=void 0),je(this.pageStartingNumber)||this.pageStartingNumber===e.pageStartingNumber||(this.pageStartingNumber=void 0),je(this.restartPageNumbering)||this.restartPageNumbering===e.restartPageNumbering||(this.restartPageNumbering=void 0),je(this.differentOddAndEvenPages)||this.differentOddAndEvenPages===e.differentOddAndEvenPages||(this.differentOddAndEvenPages=void 0),je(this.bidi)||this.bidi===e.bidi||(this.bidi=void 0),je(this.endnoteNumberFormat)||this.endnoteNumberFormat===e.endnoteNumberFormat||(this.endnoteNumberFormat=void 0),je(this.restartIndexForEndnotes)||this.restartIndexForEndnotes===e.restartIndexForEndnotes||(this.restartIndexForEndnotes=void 0),je(this.restartIndexForFootnotes)||this.restartIndexForFootnotes===e.restartIndexForFootnotes||(this.restartIndexForFootnotes=void 0),je(this.footNoteNumberFormat)||this.footNoteNumberFormat===e.footNoteNumberFormat||(this.footNoteNumberFormat=void 0),je(this.initialFootNoteNumber)||this.initialFootNoteNumber===e.initialFootNoteNumber||(this.initialFootNoteNumber=void 0),je(this.initialEndNoteNumber)||this.initialEndNoteNumber===e.initialEndNoteNumber||(this.initialEndNoteNumber=void 0)},yui.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},yui.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,this.firstPageHeaderIn=void 0,this.firstPageFooterIn=void 0,this.oddPageHeaderIn=void 0,this.oddPageFooterIn=void 0,this.evenPageHeaderIn=void 0,this.evenPageFooterIn=void 0};var fui=yui;function yui(e){this.differentFirstPageIn=void 0,this.differentOddAndEvenPagesIn=void 0,this.bidi=void 0,this.selection=e,this.firstPageHeaderIn=new gui(e),this.firstPageFooterIn=new gui(e),this.oddPageHeaderIn=new gui(e),this.oddPageFooterIn=new gui(e),this.evenPageHeaderIn=new gui(e),this.evenPageFooterIn=new gui(e)}Object.defineProperty(bui.prototype,"table",{get:function(){return this.tableIn},set:function(e){this.tableIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(bui.prototype,"title",{get:function(){return this.titleIn},set:function(e){je(this.table)||(this.titleIn=e,this.notifyPropertyChanged("title"))},enumerable:!0,configurable:!0}),Object.defineProperty(bui.prototype,"description",{get:function(){return this.descriptionIn},set:function(e){je(this.table)||(this.descriptionIn=e,this.notifyPropertyChanged("description"))},enumerable:!0,configurable:!0}),Object.defineProperty(bui.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(bui.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(bui.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(bui.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(bui.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(bui.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(bui.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(bui.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(bui.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(bui.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(bui.prototype,"bidi",{get:function(){return this.bidiIn},set:function(e){this.bidiIn=e,this.notifyPropertyChanged("bidi")},enumerable:!0,configurable:!0}),bui.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 Xri;return t.backgroundColor=this.background,t;case"preferredWidth":return this.preferredWidth;case"preferredWidthType":return this.preferredWidthType;case"bidi":return this.bidi;case"title":return this.title;case"description":return this.description;default:return}},bui.prototype.notifyPropertyChanged=function(e){var t;!je(this.selection)&&(this.selection.isCleared||!this.selection.owner.isDocumentLoaded||this.selection.owner.isReadOnlyMode||this.selection.owner.isPastingContent)&&!this.selection.isRetrieveFormatting||je(this.selection)||je(this.selection.start)||this.selection.isRetrieveFormatting||(t=this.getPropertyValue(e),"background"===e&&(e="shading"),je(t))||this.selection.owner.editorModule.onApplyTableFormat(e,t)},bui.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,this.title=e.title,this.description=e.description},bui.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},bui.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};var vui=bui;function bui(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}Object.defineProperty(Cui.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(Cui.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(Cui.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(Cui.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(Cui.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(Cui.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(Cui.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(Cui.prototype,"preferredWidth",{get:function(){return this.preferredWidthIn},set:function(e){e!==this.preferredWidthIn&&(this.preferredWidthIn=e,this.notifyPropertyChanged("preferredWidth"))},enumerable:!0,configurable:!0}),Cui.prototype.notifyPropertyChanged=function(e){var t=this.selection;je(t)||(t.isCleared||!t.owner.isDocumentLoaded||t.owner.isReadOnlyMode||t.owner.isPastingContent)&&!t.isRetrieveFormatting||je(this.selection.start)||this.selection.isRetrieveFormatting||(t=this.getPropertyValue(e),"background"===e&&(e="shading"),je(t))||this.selection.owner.editorModule.onApplyTableCellFormat(e,t)},Cui.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 Xri;return t.backgroundColor=this.background,t;default:return}},Cui.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,e.shading.hasValue("foregroundColor")&&"TextureNone"!==e.shading.textureStyle&&(this.background=e.shading.foregroundColor),this.verticalAlignment=e.verticalAlignment,this.preferredWidth=e.preferredWidth,this.preferredWidthType=e.preferredWidthType},Cui.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},Cui.prototype.combineFormat=function(e){je(this.leftMargin)||this.leftMargin===e.leftMargin||(this.leftMargin=void 0),je(this.topMargin)||this.topMargin===e.topMargin||(this.topMargin=void 0),je(this.rightMargin)||this.rightMargin===e.rightMargin||(this.rightMargin=void 0),je(this.bottomMargin)||this.bottomMargin===e.bottomMargin||(this.bottomMargin=void 0),je(this.background)||this.background===e.shading.backgroundColor||(this.background=void 0),je(this.verticalAlignment)||this.verticalAlignment===e.verticalAlignment||(this.verticalAlignment=void 0),je(this.preferredWidth)||this.preferredWidth===e.preferredWidth||(this.preferredWidth=void 0),je(this.preferredWidthType)||this.preferredWidthType===e.preferredWidthType||(this.preferredWidthType=void 0)},Cui.prototype.clearFormat=function(){this.background=void 0,this.bottomMargin=0,this.leftMargin=0,this.rightMargin=0,this.topMargin=0,this.verticalAlignment=void 0},Cui.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};var wui=Cui;function Cui(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}Object.defineProperty(Aui.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(Aui.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(Aui.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(Aui.prototype,"allowBreakAcrossPages",{get:function(){return this.allowRowBreakAcrossPagesIn},set:function(e){e!==this.allowRowBreakAcrossPagesIn&&(this.allowRowBreakAcrossPagesIn=e,this.notifyPropertyChanged("allowBreakAcrossPages"))},enumerable:!0,configurable:!0}),Aui.prototype.notifyPropertyChanged=function(e){var t,i=this.selection;!je(i)&&(i.isCleared||i.owner.isReadOnlyMode||!i.owner.isDocumentLoaded||i.owner.isPastingContent)&&!i.isRetrieveFormatting||je(i)||je(i.start)||i.isRetrieveFormatting||je(t=this.getPropertyValue(e))||i.owner.editorModule.onApplyTableRowFormat(e,t)},Aui.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}},Aui.prototype.copyFormat=function(e){this.height=e.height,this.heightType=e.heightType,this.allowBreakAcrossPages=e.allowBreakAcrossPages,this.isHeader=e.isHeader},Aui.prototype.combineFormat=function(e){je(this.height)||this.height===e.height||(this.height=void 0),je(this.heightType)||this.heightType===e.heightType||(this.heightType=void 0),je(this.allowBreakAcrossPages)||this.allowBreakAcrossPages===e.allowBreakAcrossPages||(this.allowBreakAcrossPages=void 0),je(this.isHeader)||this.isHeader===e.isHeader||(this.isHeader=void 0)},Aui.prototype.clearRowFormat=function(){this.height=void 0,this.heightType=void 0,this.allowBreakAcrossPages=void 0,this.isHeader=void 0},Aui.prototype.clearFormat=function(){this.height=0,this.heightType=void 0,this.allowBreakAcrossPages=void 0,this.isHeader=void 0},Aui.prototype.destroy=function(){this.heightIn=void 0,this.heightTypeIn=void 0,this.allowRowBreakAcrossPagesIn=void 0,this.isHeaderIn=void 0,this.selection=void 0};var Sui=Aui;function Aui(e){this.heightIn=void 0,this.heightTypeIn=void 0,this.isHeaderIn=void 0,this.allowRowBreakAcrossPagesIn=void 0,this.selection=e}Object.defineProperty(Iui.prototype,"width",{get:function(){return this.image?this.image.width:0},enumerable:!0,configurable:!0}),Object.defineProperty(Iui.prototype,"height",{get:function(){return this.image?this.image.height:0},enumerable:!0,configurable:!0}),Object.defineProperty(Iui.prototype,"alternateText",{get:function(){return this.image?this.image.alternateText:null},set:function(e){e!==this.alternateText&&(this.image.alternateText=e)},enumerable:!0,configurable:!0}),Iui.prototype.resize=function(e,t){this.updateImageFormat(e,t,this.alternateText)},Iui.prototype.applyImageAlternativeText=function(e){this.updateImageFormat(this.width,this.height,e)},Iui.prototype.updateImageFormat=function(e,t,i){this.image&&this.selection.owner.editorModule&&this.selection.owner.editorModule.onImageFormat(this.image,e,t,i)},Iui.prototype.copyImageFormat=function(e){this.image=e},Iui.prototype.clearImageFormat=function(){this.image=void 0};var xui=Iui;function Iui(e){this.selection=e}Eui.prototype.copyFormat=function(e){this.width=e.width,this.space=e.space},Object.defineProperty(Eui.prototype,"width",{get:function(){return this.widthIn},set:function(e){e!==this.widthIn&&(this.widthIn=e)},enumerable:!0,configurable:!0}),Object.defineProperty(Eui.prototype,"space",{get:function(){return this.spaceIn},set:function(e){e!==this.spaceIn&&(this.spaceIn=e)},enumerable:!0,configurable:!0}),Eui.prototype.getPropertyValue=function(e){switch(e){case"space":return this.space;case"width":return this.width;default:return}},Eui.prototype.notifyPropertyChanged=function(e){je(this.selection)||this.selection.owner.editorModule.onApplyColumnFormat("columns",this.selection.sectionFormat.columns)},Eui.prototype.clearFormat=function(){this.widthIn=0,this.spaceIn=0},Eui.prototype.destroy=function(){this.widthIn=void 0,this.spaceIn=void 0};var Tui=Eui;function Eui(e){this.widthIn=0,this.spaceIn=0,this.selection=e}Mui.prototype.writeHtml=function(e,t){this.keywordIndex=t?1:0;var i="";(this.document=e).hasOwnProperty(Xoi[this.keywordIndex])&&this.serializeImages(e[Xoi[this.keywordIndex]]);for(var n=0;n<e[rZt[this.keywordIndex]].length;n++)i+=this.serializeSection(e[rZt[this.keywordIndex]][n]);return i},Mui.prototype.serializeImages=function(e){for(var t in this.images=new uJt,e){var i;Array.isArray(e[""+t])?this.images.add(parseInt(t),e[""+t]):((i=[]).push(e[""+t]),this.images.add(parseInt(t),i))}},Mui.prototype.serializeSection=function(e){for(var t="",i=void 0,n=[],o=0;o<e[_ni[this.keywordIndex]].length;o++){var r=e[_ni[this.keywordIndex]][o];r.hasOwnProperty(qii[this.keywordIndex])?(t+=this.serializeParagraph(r,n),i=this.getListLevel(r)):r.hasOwnProperty(_ni[this.keywordIndex])?t+=this.serializeSection(r):t=(t+=this.closeList())+this.serializeTable(r)}if(0<n.length&&(je(i)||je(this.prevListLevel)||this.prevListLevel[Jni[this.keywordIndex]]===i[Jni[this.keywordIndex]]&&this.prevListLevel[lZt[this.keywordIndex]][g$t[this.keywordIndex]]===i[lZt[this.keywordIndex]][g$t[this.keywordIndex]]))for(;0<n.length;)t+=this.closeList(),n.pop();return t+=this.closeList(),this.prevListLevel=void 0,this.isOrdered=void 0,t},Mui.prototype.serializeParagraph=function(e,t){var i="",n=!1,o=!1,r=void 0,s=0,a=(je(this.prevListLevel)||(o=!0),[]),l=void 0;if(je(e[lZt[this.keywordIndex]][x$t[this.keywordIndex]])||(l=this.getListLevel(e),o||(this.prevListLevel=l),this.prevListLevel!==l&&(o=!1),je(t)||je(l)||je(this.prevListLevel)||!(this.prevListLevel[Jni[this.keywordIndex]]<l[Jni[this.keywordIndex]]&&this.prevListLevel!==l||this.prevListLevel[lZt[this.keywordIndex]][g$t[this.keywordIndex]]!==l[lZt[this.keywordIndex]][g$t[this.keywordIndex]])||(t.push(t.length),r=this.prevListLevel[Jni[this.keywordIndex]],s=this.prevListLevel[lZt[this.keywordIndex]][g$t[this.keywordIndex]]),this.prevListLevel=l),!je(t)&&0<t.length&&(je(l)||je(this.prevListLevel)||this.prevListLevel[Jni[this.keywordIndex]]===r&&this.prevListLevel[lZt[this.keywordIndex]][g$t[this.keywordIndex]]===s))for(;0<t.length;)i+=this.closeList(),t.pop();return o||t&&0!==t.length||(i+=this.closeList()),(n=je(l)?n:!0)&&!o&&(i+=this.getHtmlList(l,e[lZt[this.keywordIndex]][x$t[this.keywordIndex]][u$t[this.keywordIndex]])),a.push('style="'+this.serializeParagraphStyle(e,"",n)+';white-space:pre"'),n?i+=this.createAttributesTag("li",a):(this.prevListLevel=void 0,this.isOrdered=void 0,i+=this.createAttributesTag(this.getStyleName(e[lZt[this.keywordIndex]][KZt[this.keywordIndex]]),a)),0===e[qii[this.keywordIndex]].length?i+="<span />":i=this.serializeInlines(e,i),n?-1<(i+=this.endTag("li")).indexOf("<ul")?this.isOrdered=!1:-1<i.indexOf("<ol")&&(this.isOrdered=!0):i+=this.endTag(this.getStyleName(e[lZt[this.keywordIndex]][KZt[this.keywordIndex]])),i},Mui.prototype.closeList=function(){var e="";return je(this.isOrdered)||(e=this.isOrdered?this.endTag("ol"):this.endTag("ul"),this.isOrdered=void 0),e},Mui.prototype.getListLevel=function(e){for(var t=void 0,i=void 0,n=0;n<this.document[hZt[this.keywordIndex]].length;n++)if(this.document[hZt[this.keywordIndex]][n][d$t[this.keywordIndex]]===e[lZt[this.keywordIndex]][x$t[this.keywordIndex]][d$t[this.keywordIndex]]){i=this.document[hZt[this.keywordIndex]][n];break}if(i)for(var o=0;o<this.document[dZt[this.keywordIndex]].length;o++)if(this.document[dZt[this.keywordIndex]][o][toi[this.keywordIndex]]===i[toi[this.keywordIndex]]){var r=e[lZt[this.keywordIndex]][x$t[this.keywordIndex]][u$t[this.keywordIndex]],t=this.document[dZt[this.keywordIndex]][o][noi[this.keywordIndex]][r];break}return t},Mui.prototype.getHtmlList=function(e,t){var i="";if(e[Yni[this.keywordIndex]]===(1==this.keywordIndex?10:"Bullet")){switch(i+='<ul type="',t){case 0:i+="disc",e[aZt[this.keywordIndex]][XZt[this.keywordIndex]]="Symbol";break;case 1:i+="circle",e[aZt[this.keywordIndex]][XZt[this.keywordIndex]]="Symbol";break;case 2:i+="square",e[aZt[this.keywordIndex]][XZt[this.keywordIndex]]="Wingdings";break;default:i+="disc",e[aZt[this.keywordIndex]][XZt[this.keywordIndex]]="Symbol"}i+='">'}else{switch(i+='<ol type="',e[Yni[this.keywordIndex]]){case"UpRoman":case 2:i+="I";break;case"LowRoman":case 3:i+="i";break;case"UpLetter":case 4:i+="A";break;case"LowLetter":case 5:i+="a";break;default:i+="1"}i+='" start="'+e[Kni[this.keywordIndex]].toString()+'">'}return i},Mui.prototype.serializeInlines=function(e,t){for(var i=void 0,n=0,o=0;e[qii[this.keywordIndex]].length>n;){var r,i=e[qii[this.keywordIndex]][n];if(i.hasOwnProperty(Bti[this.keywordIndex])&&"\t"===i[Bti[this.keywordIndex]])o++;else if(0<o&&((r=[]).push('style="mso-tab-count:'+o.toString()+'"'),t+=this.createAttributesTag("span",r)+this.endTag("span"),o=0),i.hasOwnProperty(oii[this.keywordIndex]))t+=this.serializeImageContainer(i);else if(i.hasOwnProperty(fii[this.keywordIndex]))0===i[fii[this.keywordIndex]]?(je((s=e[qii[this.keywordIndex]][n+1])[Bti[this.keywordIndex]])&&(s=e[qii[this.keywordIndex]][n+2]),je(s)||je(s[Bti[this.keywordIndex]])||!(0<=s[Bti[this.keywordIndex]].indexOf("TOC")||0<=s[Bti[this.keywordIndex]].indexOf("HYPERLINK"))?this.fieldCheck=void 0:(this.fieldCheck=1,(r=[]).push('style="'+this.serializeInlineStyle(i[aZt[this.keywordIndex]])+'"'),t+=this.createAttributesTag("a",r))):2===i[fii[this.keywordIndex]]?je(this.fieldCheck)?this.fieldCheck=0:this.fieldCheck=2:(je(this.fieldCheck)||0===this.fieldCheck||(t+=this.endTag("a")),this.fieldCheck=0);else if(i.hasOwnProperty(Gii[this.keywordIndex]))t+=this.serializeContentInlines(i,t);else{var s=je(i[Bti[this.keywordIndex]])?"":i[Bti[this.keywordIndex]];if(i.hasOwnProperty(hoi[this.keywordIndex]))switch(i[hoi[this.keywordIndex]]){case 0:t+="<a name="+i[BZt[this.keywordIndex]]+">";break;case 1:t+="</a>"}0===this.fieldCheck&&(t+=this.serializeSpan(s,i[aZt[this.keywordIndex]])),1===this.fieldCheck&&(t=t+(' href= "'+s.replace(/"/g,"").replace("HYPERLINK","").trim())+'">'),2===this.fieldCheck&&(t+=this.serializeSpan(s,i[aZt[this.keywordIndex]]))}n++}return t},Mui.prototype.serializeContentInlines=function(e,t){return t=this.serializeInlines(e,t)},Mui.prototype.serializeSpan=function(e,t){var i,n="";return(-1!==e.indexOf("\v")?n+="<br>":-1!==e.indexOf("\f")?n+='<br style = "page-break-after:always;"/>':(i=[],this.serializeInlineStyle(t),i.push('style="'+this.serializeInlineStyle(t)+'"'),n=(n=(n+=this.createAttributesTag("span",i))+this.decodeHtmlNames(e.toString()))+this.endTag("span"))).toString()},Mui.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"p"}},Mui.prototype.serializeImageContainer=function(e){var t="",i=[],n=(this.serializeInlineStyle(e[aZt[this.keywordIndex]]),""),o=(je(e[oii[this.keywordIndex]])||(n=this.images.get(parseInt(e[oii[this.keywordIndex]]))[Y.parseBoolValue(e[aii[this.keywordIndex]])?1:0]),Y.convertPointToPixel(e[Vti[this.keywordIndex]])),e=Y.convertPointToPixel(e[_ti[this.keywordIndex]]);return i.push('width="'+o.toString()+'"'),i.push('height="'+e.toString()+'"'),i.push('src="'+n+'"'),(t=(t+=this.createAttributesTag("img",i))+this.endTag("img")).toString()},Mui.prototype.serializeCell=function(e,t){var i,n="",o=[],r="",o=[];je(e[wni[this.keywordIndex]])||(je(e[wni[this.keywordIndex]][yei[this.keywordIndex]][Aei[this.keywordIndex]])||"empty"===e[wni[this.keywordIndex]][yei[this.keywordIndex]][Aei[this.keywordIndex]]||o.push('bgcolor="'+Y.getColor(e[wni[this.keywordIndex]][yei[this.keywordIndex]][Aei[this.keywordIndex]])+'"'),!je(e[wni[this.keywordIndex]][nei[this.keywordIndex]])&&1<e[wni[this.keywordIndex]][nei[this.keywordIndex]]&&o.push('colspan="'+e[wni[this.keywordIndex]][nei[this.keywordIndex]].toString()+'"'),!je(e[wni[this.keywordIndex]][oei[this.keywordIndex]])&&1<e[wni[this.keywordIndex]][oei[this.keywordIndex]]&&o.push('rowspan="'+e[wni[this.keywordIndex]][oei[this.keywordIndex]].toString()+'"'),je(e[wni[this.keywordIndex]][iei[this.keywordIndex]])||0===e[wni[this.keywordIndex]][iei[this.keywordIndex]]||(i=Y.convertPointToPixel(e[wni[this.keywordIndex]][iei[this.keywordIndex]]),o.push('width="'+i.toString()+'"')),i=je(e[wni[this.keywordIndex]][rei[this.keywordIndex]])?"top":this.convertVerticalAlignment(e[wni[this.keywordIndex]][rei[this.keywordIndex]]),o.push('valign="'+i+'"'),je(e[wni[this.keywordIndex]][V$t[this.keywordIndex]])||0===e[wni[this.keywordIndex]][V$t[this.keywordIndex]]||(r+="padding-left:"+e[wni[this.keywordIndex]][V$t[this.keywordIndex]].toString()+"pt;"),je(e[wni[this.keywordIndex]][_$t[this.keywordIndex]])||0===e[wni[this.keywordIndex]][_$t[this.keywordIndex]]||(r+="padding-right:"+e[wni[this.keywordIndex]][_$t[this.keywordIndex]].toString()+"pt;"),je(e[wni[this.keywordIndex]][H$t[this.keywordIndex]])||0===e[wni[this.keywordIndex]][H$t[this.keywordIndex]]||(r+="padding-top:"+e[wni[this.keywordIndex]][H$t[this.keywordIndex]].toString()+"pt;"),je(e[wni[this.keywordIndex]][z$t[this.keywordIndex]])||0===e[wni[this.keywordIndex]][z$t[this.keywordIndex]]||(r+="padding-bottom:"+e[wni[this.keywordIndex]][z$t[this.keywordIndex]].toString()+"pt;"),je(e[wni[this.keywordIndex]][k$t[this.keywordIndex]]))||(r+=this.serializeCellBordersStyle(e[wni[this.keywordIndex]][k$t[this.keywordIndex]],t)),0!==r.length&&o.push('style="'+r+'"'),n+=this.createAttributesTag("td",o);for(var s=0;s<e[_ni[this.keywordIndex]].length;s++){var a=e[_ni[this.keywordIndex]][s];a.hasOwnProperty(Ani[this.keywordIndex])?n+=this.serializeTable(a):a.hasOwnProperty(_ni[this.keywordIndex])?n+=this.serializeSection(a):n+=this.serializeParagraph(a)}return n+=this.endTag("td")},Mui.prototype.convertVerticalAlignment=function(e){switch(e){case"Center":case 1:return"middle";case"Bottom":case 2:return"bottom";default:return"top"}},Mui.prototype.serializeTable=function(e){var t="";t+=this.createTableStartTag(e);for(var i=0;i<e[Ani[this.keywordIndex]].length;i++)t+=this.serializeRow(e[Ani[this.keywordIndex]][i]);return t+=this.createTableEndTag()},Mui.prototype.serializeRow=function(e){var t="";t+=this.createRowStartTag(e);for(var i=0;i<e[Sni[this.keywordIndex]].length;i++)t+=this.serializeCell(e[Sni[this.keywordIndex]][i],e);return t},Mui.prototype.serializeParagraphStyle=function(e,t,i,n){var o="",n=(je(this.keywordIndex)&&(this.keywordIndex=n),0<e[qii[this.keywordIndex]].length&&(o+=this.serializeCharacterFormat(e[aZt[this.keywordIndex]])),!1);return 0==e[qii[this.keywordIndex]].length&&(n=!0),o=(o+=this.serializeCharacterFormat(e[aZt[this.keywordIndex]],n))+this.serializeParagraphFormat(e[lZt[this.keywordIndex]],i)},Mui.prototype.serializeInlineStyle=function(e){return this.serializeCharacterFormat(e)},Mui.prototype.serializeTableBorderStyle=function(e){var t="",i={};return je(i=e[pii[this.keywordIndex]])||i[Pei[this.keywordIndex]]===(1==this.keywordIndex?1:"None")||i[Pei[this.keywordIndex]]===(1==this.keywordIndex?26:"Cleared")?!je(i)&&Y.parseBoolValue(i[Tei[this.keywordIndex]])&&(t+="border-left-style:none;"):(i[tii[this.keywordIndex]]=je(i[tii[this.keywordIndex]])?"#000000":i[tii[this.keywordIndex]],i[Bei[this.keywordIndex]]=je(i[Bei[this.keywordIndex]])?.5:i[Bei[this.keywordIndex]],t+=this.serializeBorderStyle(i,"left")),je(i=e[lii[this.keywordIndex]])||i[Pei[this.keywordIndex]]===(1==this.keywordIndex?1:"None")||i[Pei[this.keywordIndex]]===(1==this.keywordIndex?26:"Cleared")?!je(i)&&Y.parseBoolValue(i[Tei[this.keywordIndex]])&&(t+="border-top-style:none;"):(i[tii[this.keywordIndex]]=je(i[tii[this.keywordIndex]])?"#000000":i[tii[this.keywordIndex]],i[Bei[this.keywordIndex]]=je(i[Bei[this.keywordIndex]])?.5:i[Bei[this.keywordIndex]],t+=this.serializeBorderStyle(i,"top")),je(i=e[dii[this.keywordIndex]])||i[Pei[this.keywordIndex]]===(1==this.keywordIndex?1:"None")||i[Pei[this.keywordIndex]]===(1==this.keywordIndex?26:"Cleared")?!je(i)&&Y.parseBoolValue(i[Tei[this.keywordIndex]])&&(t+="border-right-style:none;"):(i[tii[this.keywordIndex]]=je(i[tii[this.keywordIndex]])?"#000000":i[tii[this.keywordIndex]],i[Bei[this.keywordIndex]]=je(i[Bei[this.keywordIndex]])?.5:i[Bei[this.keywordIndex]],t+=this.serializeBorderStyle(i,"right")),je(i=e[hii[this.keywordIndex]])||i[Pei[this.keywordIndex]]===(1==this.keywordIndex?1:"None")||i[Pei[this.keywordIndex]]===(1==this.keywordIndex?26:"Cleared")?!je(i)&&Y.parseBoolValue(i[Tei[this.keywordIndex]])&&(t+="border-bottom-style:none;"):(i[tii[this.keywordIndex]]=je(i[tii[this.keywordIndex]])?"#000000":i[tii[this.keywordIndex]],i[Bei[this.keywordIndex]]=je(i[Bei[this.keywordIndex]])?.5:i[Bei[this.keywordIndex]],t+=this.serializeBorderStyle(i,"bottom")),t},Mui.prototype.serializeCellBordersStyle=function(e,t){var i="",n={};return je(n=e[pii[this.keywordIndex]])||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?1:"None")||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?26:"Cleared")?!je(n)&&Y.parseBoolValue(n[Tei[this.keywordIndex]])?i+="border-left-style:none;":je(t[Cni[this.keywordIndex]][k$t[this.keywordIndex]][pii[this.keywordIndex]])||je(n=t[Cni[this.keywordIndex]][k$t[this.keywordIndex]][pii[this.keywordIndex]])||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?1:"None")||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?26:"Cleared")||(n[tii[this.keywordIndex]]=je(n[tii[this.keywordIndex]])?"#000000":n[tii[this.keywordIndex]],n[Bei[this.keywordIndex]]=je(n[Bei[this.keywordIndex]])?.5:n[Bei[this.keywordIndex]],i+=this.serializeBorderStyle(n,"left")):(n[tii[this.keywordIndex]]=je(n[tii[this.keywordIndex]])?"#000000":n[tii[this.keywordIndex]],n[Bei[this.keywordIndex]]=je(n[Bei[this.keywordIndex]])?.5:n[Bei[this.keywordIndex]],i+=this.serializeBorderStyle(n,"left")),je(n=e[lii[this.keywordIndex]])||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?1:"None")||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?26:"Cleared")?!je(n)&&Y.parseBoolValue(n[Tei[this.keywordIndex]])?i+="border-top-style:none;":je(t[Cni[this.keywordIndex]][k$t[this.keywordIndex]][lii[this.keywordIndex]])||je(n=t[Cni[this.keywordIndex]][k$t[this.keywordIndex]][lii[this.keywordIndex]])||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?1:"None")||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?26:"Cleared")||(n[tii[this.keywordIndex]]=je(n[tii[this.keywordIndex]])?"#000000":n[tii[this.keywordIndex]],n[Bei[this.keywordIndex]]=je(n[Bei[this.keywordIndex]])?.5:n[Bei[this.keywordIndex]],i+=this.serializeBorderStyle(n,"top")):(n[tii[this.keywordIndex]]=je(n[tii[this.keywordIndex]])?"#000000":n[tii[this.keywordIndex]],n[Bei[this.keywordIndex]]=je(n[Bei[this.keywordIndex]])?.5:n[Bei[this.keywordIndex]],i+=this.serializeBorderStyle(n,"top")),je(n=e[dii[this.keywordIndex]])||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?1:"None")||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?26:"Cleared")?!je(n)&&Y.parseBoolValue(n[Tei[this.keywordIndex]])?i+="border-right-style:none;":je(t[Cni[this.keywordIndex]][k$t[this.keywordIndex]][dii[this.keywordIndex]])||je(n=t[Cni[this.keywordIndex]][k$t[this.keywordIndex]][dii[this.keywordIndex]])||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?1:"None")||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?26:"Cleared")||(n[tii[this.keywordIndex]]=je(n[tii[this.keywordIndex]])?"#000000":n[tii[this.keywordIndex]],n[Bei[this.keywordIndex]]=je(n[Bei[this.keywordIndex]])?.5:n[Bei[this.keywordIndex]],i+=this.serializeBorderStyle(n,"right")):(n[tii[this.keywordIndex]]=je(n[tii[this.keywordIndex]])?"#000000":n[tii[this.keywordIndex]],n[Bei[this.keywordIndex]]=je(n[Bei[this.keywordIndex]])?.5:n[Bei[this.keywordIndex]],i+=this.serializeBorderStyle(n,"right")),je(n=e[hii[this.keywordIndex]])||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?1:"None")||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?26:"Cleared")?!je(n)&&Y.parseBoolValue(n[Tei[this.keywordIndex]])?i+="border-bottom-style:none;":je(t[Cni[this.keywordIndex]][k$t[this.keywordIndex]][hii[this.keywordIndex]])||je(n=t[Cni[this.keywordIndex]][k$t[this.keywordIndex]][hii[this.keywordIndex]])||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?1:"None")||n[Pei[this.keywordIndex]]===(1==this.keywordIndex?26:"Cleared")||(n[tii[this.keywordIndex]]=je(n[tii[this.keywordIndex]])?"#000000":n[tii[this.keywordIndex]],n[Bei[this.keywordIndex]]=je(n[Bei[this.keywordIndex]])?.5:n[Bei[this.keywordIndex]],i+=this.serializeBorderStyle(n,"bottom")):(n[tii[this.keywordIndex]]=je(n[tii[this.keywordIndex]])?"#000000":n[tii[this.keywordIndex]],n[Bei[this.keywordIndex]]=je(n[Bei[this.keywordIndex]])?.5:n[Bei[this.keywordIndex]],i+=this.serializeBorderStyle(n,"bottom")),i},Mui.prototype.serializeBorderStyle=function(e,t){var i=(i="")+("border-"+t+"-style:"+this.convertBorderLineStyle(e[Pei[this.keywordIndex]]))+";";return 0<e[Bei[this.keywordIndex]]&&(i+="border-"+t+"-width:"+e[Bei[this.keywordIndex]].toString()+"pt;"),je(e[tii[this.keywordIndex]])||(i+="border-"+t+"-color:"+Y.getColor(e[tii[this.keywordIndex]])+";"),i},Mui.prototype.convertBorderLineStyle=function(e){switch(e){case"Single":case 0:return"solid";case"None":case 1:return"none";case"Dot":case 2:return"dotted";case"DashSmallGap":case"DashLargeGap":case"DashDot":case"DashDotDot":case 3:case 4:case 5:case 6:return"dashed";case"Double":case"Triple":case"ThinThickSmallGap":case"ThickThinSmallGap":case"ThinThickThinSmallGap":case"ThinThickMediumGap":case"ThickThinMediumGap":case"ThinThickThinMediumGap":case"ThinThickLargeGap":case"ThickThinLargeGap":case"ThinThickThinLargeGap":case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:return"double";case"SingleWavy":case 18:return"solid";case"DoubleWavy":case 19:return"double";case"DashDotStroked":case 20:return"solid";case"Emboss3D":case 21:return"ridge";case"Engrave3D":case 22:return"groove";case"Outset":case 23:return"outset";case"Inset":case 24:return"inset";default:return"solid"}},Mui.prototype.serializeCharacterFormat=function(e,t){var i,n;return je(e[Uoi[this.keywordIndex]])?(n=(n="font-weight:")+(Y.parseBoolValue(e[_Zt[this.keywordIndex]])?"bold":"normal")+";font-style:",Y.parseBoolValue(e[HZt[this.keywordIndex]])?n+="italic":n+="normal",n=(n+=";")+this.serializeTextDecoration(e),e[QZt[this.keywordIndex]]!==(1==this.keywordIndex?1:"Superscript")&&e[QZt[this.keywordIndex]]!==(1==this.keywordIndex?2:"Subscript")||(n=(n+="vertical-align:")+(e[QZt[this.keywordIndex]]===(1==this.keywordIndex?1:"Superscript")?"super":"sub")+";"),je(e[qZt[this.keywordIndex]])||e[qZt[this.keywordIndex]]===(1==this.keywordIndex?0:"NoColor")||t||(n=(n+="background-color:")+(1==this.keywordIndex?this.getHighlightColorCode(e[qZt[this.keywordIndex]]):Y.getHighlightColorCode(e.highlightColor.toString()))+";"),je(i=e[YZt[this.keywordIndex]])||(n=(n+="color:")+Y.getColor(i)+";"),!je(e[o$t[this.keywordIndex]])&&Y.parseBoolValue(e[o$t[this.keywordIndex]])&&(n+="text-transform:uppercase;"),je(i=e[GZt[this.keywordIndex]])||(n=(n+="font-size:")+i.toString()+"pt;"),je(i=e[XZt[this.keywordIndex]])||(n=(n+="font-family:")+i.toString()+";"),je(i=e[p$t[this.keywordIndex]])||(n=(n+="letter-spacing:")+i.toString()+"pt;"),(n=je(i=e[c$t[this.keywordIndex]])?n:(n+="transform:scaleX(")+(i/100).toString()+");").toString()):this.serializeCharacterFormat(e[Uoi[this.keywordIndex]],t)},Mui.prototype.serializeTextDecoration=function(e){var t="";return e[UZt[this.keywordIndex]]!==(1==this.keywordIndex?1:"SingleStrike")&&e[UZt[this.keywordIndex]]!==(1==this.keywordIndex?2:"DoubleStrike")||(t+="line-through "),je(e[zZt[this.keywordIndex]])||e[zZt[this.keywordIndex]]===(1==this.keywordIndex?0:"None")||(t+="underline"),t=1<t.length?"text-decoration:"+t+";":t},Mui.prototype.serializeParagraphFormat=function(e,t,i){var n,o,r;return je(this.keywordIndex)&&(this.keywordIndex=i),je(e[Uoi[this.keywordIndex]])?(i="",je(r=this.getTextAlignment(e[y$t[this.keywordIndex]]))||(i+="text-align:"+r.toLowerCase()+";"),je(r=e[b$t[this.keywordIndex]])||(i+="margin-top:"+r.toString()+"pt; "),je(r=e[m$t[this.keywordIndex]])||(i+="margin-right:"+r.toString()+"pt; "),je(r=e[v$t[this.keywordIndex]])||(i+="margin-bottom:"+r.toString()+"pt; "),r=e[g$t[this.keywordIndex]],je(r=t?0:r)||(i+="margin-left:"+r.toString()+"pt; "),r=e[f$t[this.keywordIndex]],je(r=t?0:r)||0===r||(i+="text-indent:"+r.toString()+"pt;"),!je(e[P$t[this.keywordIndex]])&&0<e[P$t[this.keywordIndex]].length&&(i+=this.serializeTabs(e[P$t[this.keywordIndex]])),je(r=e[S$t[this.keywordIndex]])||(n=(o=e[A$t[this.keywordIndex]])===(1==this.keywordIndex?0:"Multiple"),o=o===(1==this.keywordIndex?0:"AtLeast"),1==r&&n?i+="line-height:normal;":n?i+="line-height:"+(100*Math.abs(r)).toString()+"%;":(!o||12<=r)&&(i+="line-height:"+r.toString()+"pt;")),i.toString()):this.serializeParagraphFormat(e[Uoi[this.keywordIndex]],t)},Mui.prototype.serializeTabs=function(e){for(var t="tab-stops:",i=0;i<e.length;i++){var n,o=e[i];o.hasOwnProperty(poi[this.keywordIndex])&&""!==(n=this.getTabJustification(o[poi[this.keywordIndex]]))&&(t+=n+" "),o.hasOwnProperty(goi[this.keywordIndex])&&""!==(n=this.getTabLeader(o[goi[this.keywordIndex]]))&&(t+=n+" "),o.hasOwnProperty(coi[this.keywordIndex])&&(t+=o[coi[this.keywordIndex]].toString()+"pt"),i!==e.length-1&&(t+=" ")}return t+=";"},Mui.prototype.getTabLeader=function(e){switch(e){case"Dot":case 2:return"dotted";case"Hyphen":case 3:return"dashed";case"Underscore":case 4:return"heavy";default:return""}},Mui.prototype.getTabJustification=function(e){switch(e){case"Bar":case 1:return"bar";case"Center":case 2:return"center";case"Decimal":case 3:return"decimal";case"Right":case 5:return"right";default:return""}},Mui.prototype.createAttributesTag=function(e,t){for(var i=(i="")+"<"+e,n=0;n<t.length;n++)i=(i+=" ")+t[n];return"a"!==e&&(i+=">"),i},Mui.prototype.createTag=function(e){var t="";return(t+="<")+e+">"},Mui.prototype.endTag=function(e){var t="";return t+"<"+"/"+e+">"},Mui.prototype.createTableStartTag=function(e){var t="",i="",n=[];return je(e[Dni[this.keywordIndex]])||(je(e[Dni[this.keywordIndex]][yei[this.keywordIndex]])||je(e[Dni[this.keywordIndex]][yei[this.keywordIndex]][Aei[this.keywordIndex]])||"empty"===e[Dni[this.keywordIndex]][yei[this.keywordIndex]][Aei[this.keywordIndex]]||n.push('bgcolor="'+Y.getColor(e[Dni[this.keywordIndex]][yei[this.keywordIndex]][Aei[this.keywordIndex]])+'"'),!je(e[Dni[this.keywordIndex]][fei[this.keywordIndex]])&&0<e[Dni[this.keywordIndex]][fei[this.keywordIndex]]?n.push('cellspacing="'+(72*e[Dni[this.keywordIndex]][fei[this.keywordIndex]]/96*2).toString()+'"'):i+="border-collapse:collapse;",n.push('cellpadding="0"'),je(e[Jii[this.keywordIndex]])||n.push('title="'+e[Jii[this.keywordIndex]]+'"'),je(e[xni[this.keywordIndex]])||n.push('summary="'+e[xni[this.keywordIndex]]+'"'),je(e[Dni[this.keywordIndex]][g$t[this.keywordIndex]])||0===e[Dni[this.keywordIndex]][g$t[this.keywordIndex]]||e[Dni[this.keywordIndex]][vei[this.keywordIndex]]!==(1==this.keywordIndex?0:"Left")||(i+="margin-left:"+e[Dni[this.keywordIndex]][g$t[this.keywordIndex]].toString()+"pt;"),je(e[Dni[this.keywordIndex]])||(i+=this.serializeTableWidth(e[Dni[this.keywordIndex]])),je(e[Dni[this.keywordIndex]][k$t[this.keywordIndex]]))||(i+=this.serializeTableBorderStyle(e[Dni[this.keywordIndex]][k$t[this.keywordIndex]])),0!==i.length&&n.push('style="',i.toString()+'"'),t+this.createAttributesTag("table",n)},Mui.prototype.serializeTableWidth=function(e){var t="";switch(e[wei[this.keywordIndex]]){case"Percent":case 1:t+="width: "+e[bei[this.keywordIndex]].toString()+"%;";break;case"Point":case 2:t+="width: "+e[bei[this.keywordIndex]].toString()+"pt;";break;case"Auto":case 0:t+="width: auto;"}return t},Mui.prototype.getHighlightColorCode=function(e){var t="#ffffff";switch(e){case 1:t="#ffff00";break;case 2:t="#00ff00";break;case 3:t="#00ffff";break;case 4:t="#ff00ff";break;case 5:t="#0000ff";break;case 6:t="#ff0000";break;case 7:t="#000080";break;case 8:t="#008080";break;case 9:t="#008000";break;case 10:t="#800080";break;case 11:t="#800000";break;case 12:t="#808000";break;case 13:t="#808080";break;case 14:t="#c0c0c0";break;case 15:t="#000000"}return t},Mui.prototype.getTextAlignment=function(e){switch(e){case 1:return"Center";case 2:return"Right";case 3:return"Justify";default:return"Left"}},Mui.prototype.createTableEndTag=function(){var e="";return e+=this.endTag("table")},Mui.prototype.createRowStartTag=function(e){var t="",i=[];return Y.parseBoolValue(e[Cni[this.keywordIndex]][aei[this.keywordIndex]])&&(t+=this.createTag("thead")),!je(e[Cni[this.keywordIndex]][_ti[this.keywordIndex]])&&0<e[Cni[this.keywordIndex]][_ti[this.keywordIndex]]&&(e=Y.convertPointToPixel(e[Cni[this.keywordIndex]][_ti[this.keywordIndex]]),i.push('height="'+e+'"')),t+this.createAttributesTag("tr",i)},Mui.prototype.createRowEndTag=function(e){var t="";return t+=this.endTag("tr"),Y.parseBoolValue(e[Cni[this.keywordIndex]][aei[this.keywordIndex]])&&(t+=this.endTag("thead")),t},Mui.prototype.decodeHtmlNames=function(e){if("\t"===e)return"&emsp;";var t=(e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;")).split(" "),i="";if(0<t.length)for(var i=t[0],n=0;n<t.length-1;n++)i+=" "+t[n+1];return i};var Dui=Mui;function Mui(){this.document=void 0,this.prevListLevel=void 0,this.isOrdered=void 0,this.keywordIndex=void 0,this.fieldCheck=0}Object.defineProperty(u.prototype,"isHighlightEditRegion",{get:function(){return this.isHighlightEditRegionIn},set:function(e){this.isHighlightEditRegionIn=e,this.onHighlight()},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"isHighlightContentControlEditRegion",{get:function(){return this.isHighlightContentControlEditRegionIn},set:function(e){this.isHighlightContentControlEditRegionIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"htmlWriter",{get:function(){return je(this.htmlWriterIn)&&(this.htmlWriterIn=new Dui),this.htmlWriterIn},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"start",{get:function(){if(!je(this.owner)&&!je(this.viewer))return je(this.startInternal)&&(this.startInternal=this.owner.documentStart),this.startInternal},set:function(e){this.startInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"characterFormat",{get:function(){return this.characterFormatIn},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"paragraphFormat",{get:function(){return this.paragraphFormatIn},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"sectionFormat",{get:function(){return this.sectionFormatIn},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"tableFormat",{get:function(){return this.tableFormatIn},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"cellFormat",{get:function(){return this.cellFormatIn},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"rowFormat",{get:function(){return this.rowFormatIn},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"imageFormat",{get:function(){return this.imageFormatInternal},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"end",{get:function(){return this.endInternal},set:function(e){this.endInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"startPage",{get:function(){return!this.owner.isDocumentLoaded||je(this.viewer)||this.viewer instanceof sai||je(this.documentHelper.selectionStartPage)?1:this.documentHelper.pages.indexOf(this.documentHelper.selectionStartPage)+1},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"endPage",{get:function(){return!this.owner.isDocumentLoaded||je(this.viewer)||this.viewer instanceof sai||je(this.documentHelper.selectionEndPage)?1:this.documentHelper.pages.indexOf(this.documentHelper.selectionEndPage)+1},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"isForward",{get:function(){return this.start.isExistBefore(this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"isinFootnote",{get:function(){return this.isFootNoteParagraph(this.start.paragraph)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"isinEndnote",{get:function(){return this.isEndNoteParagraph(this.start.paragraph)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"isEmpty",{get:function(){return!!je(this.start)||this.start.isAtSamePosition(this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"startOffset",{get:function(){return this.getHierarchicalIndexByPosition(this.start)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"endOffset",{get:function(){return this.getHierarchicalIndexByPosition(this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"isInShape",{get:function(){var e=this.start.paragraph.containerWidget;do{if(e instanceof Zli)return!0}while(e=e&&e.containerWidget);return!1},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"text",{get:function(){return this.getText(!1)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"contextType",{get:function(){return this.contextTypeInternal},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"bookmarks",{get:function(){return this.getSelBookmarks(!1)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"sfdt",{get:function(){if(this.owner.editorModule&&!this.isEmpty)return JSON.stringify(this.writeSfdt())},enumerable:!0,configurable:!0}),u.prototype.getBookmarks=function(e){return this.getSelBookmarks(e)},Object.defineProperty(u.prototype,"isCleared",{get:function(){return je(this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"isInField",{get:function(){return!je(this.getHyperlinkField(!0))},enumerable:!0,configurable:!0}),u.prototype.getFieldInfo=function(){var e=this.getHyperlinkField(!0);if(!je(e))return{code:this.getFieldCode(e),result:this.owner.editorModule.getFieldResultText(e)}},u.prototype.isFootNoteParagraph=function(e){e=this.getContainerWidget(e);return e instanceof Pai&&"Footnote"===e.footNoteType},u.prototype.isEndNoteParagraph=function(e){e=this.getContainerWidget(e);return e instanceof Pai&&"Endnote"===e.footNoteType},u.prototype.isFootEndNoteParagraph=function(e){return!!this.isFootNoteParagraph(e)||!!this.isEndNoteParagraph(e)},u.prototype.getSelBookmarks=function(e){for(var t,i,n,o,r,s=[],a=this.documentHelper.bookmarks,l=this.start,h=this.end,d=(this.isForward||(l=this.end,h=this.start),!1),p=this.getSelectedCells(),c=0;c<a.length;c++)(e||!e&&0!==a.keys[c].indexOf("_"))&&!je(r=(t=a.get(a.keys[c])).reference)&&(i=this.getElementPosition(t).startPosition,r=this.getElementPosition(r,!0).startPosition,(i.paragraph.isInsideTable||r.paragraph.isInsideTable)&&0<p.length?0<=p.indexOf(i.paragraph.associatedCell)||0<=p.indexOf(r.paragraph.associatedCell)?d=!0:(d=!1,(p.indexOf(i.paragraph.associatedCell)<0||p.indexOf(r.paragraph.associatedCell)<0)&&(n=h.paragraph.isInsideTable&&h.paragraph.associatedCell,o=r.paragraph.associatedCell,n)&&o&&n.ownerTable.equals(o.ownerTable)&&n.ownerTable&&p.indexOf(this.getCellInTable(n.ownerTable,o))):d=!1,(l.isExistAfter(i)||l.isAtSamePosition(i))&&(h.isExistBefore(r)||h.isAtSamePosition(r))||(i.isExistAfter(l)||i.isAtSamePosition(l))&&(r.isExistBefore(h)||r.isAtSamePosition(h))||i.isExistAfter(l)&&i.isExistBefore(h)&&(h.isExistAfter(r)||h.isExistBefore(r))||r.isExistBefore(h)&&r.isExistAfter(l)&&(l.isExistBefore(i)||l.isExistAfter(i))||d)&&s.push(t.name);return s},Object.defineProperty(u.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),u.prototype.getModuleName=function(){return"Selection"},u.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 nai(this.owner),this.owner.editorModule.layoutWholeDocument())},u.prototype.goToHeader=function(){this.checkLayout(),this.owner.enableHeaderAndFooter=!0,this.enableHeadersFootersRegion(this.start.paragraph.bodyWidget.page.headerWidget,this.start.paragraph.bodyWidget.page),this.isWebLayout=!1},u.prototype.goToFooter=function(){this.checkLayout(),this.owner.enableHeaderAndFooter=!0,this.enableHeadersFootersRegion(this.start.paragraph.bodyWidget.page.footerWidget,this.start.paragraph.bodyWidget.page),this.isWebLayout=!1},u.prototype.closeHeaderFooter=function(){this.disableHeaderFooter(),this.documentHelper.isHeaderFooter&&"Pages"===this.owner.layoutType&&(this.owner.layoutType="Continuous",this.documentHelper.isHeaderFooter=!1)},u.prototype.closeXmlPane=function(){this.disableXml(),this.owner.enableXMLPane=!1,this.documentHelper.isHeaderFooter&&"Pages"===this.owner.layoutType&&(this.owner.layoutType="Continuous",this.documentHelper.isHeaderFooter=!1)},u.prototype.goToPage=function(e){this.owner.scrollToPage(e),1<=e&&e<=this.owner.documentHelper.pages.length&&(e=this.owner.documentHelper.pages[e-1],this.updateTextPositionForBlockContainer(e.bodyWidgets[0]))},u.prototype.selectTable=function(){this.owner.enableSelection&&this.selectTableInternal()},u.prototype.selectRow=function(){this.owner.enableSelection&&this.selectTableRow()},u.prototype.selectColumn=function(){this.owner.enableSelection&&this.selectColumnInternal()},u.prototype.selectCell=function(){this.owner.enableSelection&&this.selectTableCell()},u.prototype.select=function(e,t){var i;"string"==typeof e?(i=this.getTextPosBasedOnLogicalIndex(e),t=this.getTextPosBasedOnLogicalIndex(t),this.selectPosition(i,t)):(i=new kri(e.x,e.y),t=this.viewer.findFocusedPage(i,!0),e.extend?this.moveTextPosition(t,this.end):this.documentHelper.updateTextPositionForSelection(t,1))},u.prototype.selectByHierarchicalIndex=function(e,t){e=this.getTextPosBasedOnLogicalIndex(e),t=this.getTextPosBasedOnLogicalIndex(t);this.selectPosition(e,t)},u.prototype.selectField=function(e){!this.isInField&&je(e)||(je(e)&&(e=this.getHyperlinkField(!0)),this.selectFieldInternal(e))},u.prototype.selectContentControlInternal=function(e){var t,i,n;e&&(n=e.line.getOffset(e,1),t=new rci(this.owner),i=e.reference,t.setPositionParagraph(e.line,n),e=i.line.getOffset(i,0),(n=new rci(this.owner)).setPositionParagraph(i.line,e),this.documentHelper.selection.selectRange(t,n))},u.prototype.selectFieldInternal=function(e,t,i){var n,o,r,s;e&&(n=this.documentHelper.isFormFillProtectedMode||i,o=e.fieldEnd,s=(e=n?e.fieldSeparator:e).line.getOffset(e,n?1:0),(r=new rci(this.owner)).setPositionParagraph(e.line,s),s=(o=e.nextNode instanceof Dli&&!n&&e.nextElement.reference?e.nextElement.reference:o).line.getOffset(o,n?0:1),(e=new rci(this.owner)).setPositionParagraph(o.line,s),this.documentHelper.selection.selectRange(r,e),i||this.triggerFormFillEvent(t))},u.prototype.selectContentInternal=function(e){var t,i,n;e&&(t=e.reference,n=e.line.getOffset(e,0),(i=new rci(this.owner)).setPositionParagraph(e.line,n),e=t.line.getOffset(t,0),(n=new rci(this.owner)).setPositionParagraph(t.line,e),i.offset++,n.offset,this.documentHelper.selection.selectRange(i,n))},u.prototype.selectShape=function(e){var t,i,n;e&&(i=e.line.getOffset(e,0),(t=new rci(this.owner)).setPositionParagraph(e.line,i),i=e.line.getOffset(e,1),(n=new rci(this.owner)).setPositionParagraph(e.line,i),this.documentHelper.selection.selectRange(t,n))},u.prototype.toggleBold=function(){this.owner.editorModule&&this.owner.editorModule.toggleBold()},u.prototype.toggleItalic=function(){this.owner.editorModule&&this.owner.editorModule.toggleItalic()},u.prototype.toggleAllCaps=function(){this.owner.editorModule&&this.owner.editorModule.toggleAllCaps()},u.prototype.toggleUnderline=function(e){this.owner.editorModule&&this.owner.editorModule.toggleUnderline(e)},u.prototype.toggleStrikethrough=function(e){this.owner.editorModule&&this.owner.editorModule.toggleStrikethrough(e)},u.prototype.toggleHighlightColor=function(e){this.owner.editorModule&&this.owner.editorModule.toggleHighlightColor(e)},u.prototype.toggleSubscript=function(){this.owner.editorModule&&this.owner.editorModule.toggleSubscript()},u.prototype.toggleSuperscript=function(){this.owner.editorModule&&this.owner.editorModule.toggleSuperscript()},u.prototype.toggleTextAlignment=function(e){this.owner.editorModule&&this.owner.editorModule.toggleTextAlignment(e)},u.prototype.increaseIndent=function(){this.owner.editorModule&&this.owner.editorModule.increaseIndent()},u.prototype.decreaseIndent=function(){this.owner.editorModule&&this.owner.editorModule.decreaseIndent()},u.prototype.navigateHyperlink=function(){var e=this.getHyperlinkField();e&&this.fireRequestNavigate(e)},u.prototype.fireRequestNavigate=function(e){var t=this.getFieldCode(e);0===t.toLowerCase().indexOf("ref ")&&!t.match("\\h")||(e={isHandled:!1,navigationLink:(t=new hci(e,this)).navigationLink,linkType:t.linkType,localReference:t.localReference,source:this.owner},this.owner.trigger(jJt,e),e.isHandled)||this.documentHelper.selection.navigateBookmark(t.localReference,!0)},u.prototype.copyHyperlink=function(){var e=this.getHyperlinkField(),e=this.getLinkText(e,!0);this.copyToClipboard(e)},u.prototype.isHideSelection=function(e){var t=e.bodyWidget,i=t.sectionFormat,i=i.pageHeight-i.footerDistance,t=t.page.boundingRectangle.height/100*40;return 0<=this.contextType.indexOf("Footer")&&e.y+e.height>Y.convertPointToPixel(i)||0<=this.contextType.indexOf("Header")&&e.y+e.height>t},u.prototype.highlightSelection=function(e,t){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,void 0,t)},u.prototype.createHighlightBorder=function(e,t,i,n,o,r){t<0&&(t=0);var s=e.paragraph,a=[];if(0<s.floatingElements.length)for(var l=0;l<s.floatingElements.length;l++){var h,d,p,c=s.floatingElements[l];c.line===e&&(h=this.start,d=this.end,this.isForward||(h=this.end,d=this.start),p=c.line.getOffset(c,0),h.currentWidget!==e&&d.currentWidget!==e||h.currentWidget===e&&h.offset<=p&&(d.currentWidget===e&&d.offset>=p+1||d.currentWidget!==e)||h.currentWidget!==e&&d.currentWidget===e&&d.offset>=p)&&a.push(c)}var u=this.getPage(e.paragraph),g=(e.height,this.selectedWidgets),m=void 0,f=void 0;if(this.isHighlightContentControlEditRegion&&!je(r))0===t&&(t=this.documentHelper.textHelper.getParagraphMarkSize(s.characterFormat).Width),this.addContentControlEditRegionHighlight(e,i,t,r);else if(this.isHightlightEditRegionInternal)this.addEditRegionHighlight(e,i,t);else if(this.isHighlightFormFields)this.addFormFieldHighlight(e,i,t);else{if(g.containsKey(e))g.get(e)instanceof aci?(m=g.get(e),o&&(g.remove(e),g.add(e,f=[]))):f=g.get(e);else if(o)g.add(e,f=[]);else{r=this.getWrapPosition(e,s);if(0<r.length){r=this.splitSelectionHighlightPosition(i,t,r);if(0<r.length)return r[0].floatingItems=a,g.add(e,r),void this.renderHighlight(u,e,r,n,a)}(m=new aci(i,t)).floatingItems=a,g.add(e,m)}void 0===m&&((m=new aci(i,t)).floatingItems=a,g.add(e,m)),this.renderHighlight(u,e,[m],n,a),o&&f.push(m)}},u.prototype.renderHighlight=function(e,t,i,n,o){var r=this.owner.documentHelper,s=this.getPageTop(e),a=e.boundingRectangle.x,l=t.height;if(this.viewer.containerTop<=s||s<this.viewer.containerTop+r.selectionCanvas.height){var h=r.zoomFactor;this.clipSelection(e,s);for(var d=0;d<i.length;d++){var p=i[d],c=p.left,p=p.width;this.documentHelper.isComposingIME?this.renderDashLine(r.selectionContext,e,t,a+c*h-this.viewer.containerLeft,n,p*h,l):(this.documentHelper.selectionContext.fillStyle="gray",r.selectionContext.globalAlpha=.4,r.selectionContext.fillRect(a+c*h-this.viewer.containerLeft,s+n*h-this.viewer.containerTop,p*h,l*h))}if(0<o.length)for(var u=0;u<o.length;u++){var c=o[u].x,g=o[u].y,m=o[u].width,f=o[u].height;r.selectionContext.fillRect(a+c*h-this.viewer.containerLeft,s+g*h-this.viewer.containerTop,m*h,f*h)}r.selectionContext.restore()}},u.prototype.getWrapPosition=function(e,t){var i=t.bodyWidget;if(!je(i)&&0<i.floatingElements.length&&0<e.children.length){for(var n=this.getLeftInternal(e,e.children[0],0),o=0,r=[],s=!1,a=0;a<e.children.length;a++){var l,h=e.children[a];h instanceof qli&&"Inline"!==h.textWrappingStyle||(0<h.padding.left&&(1===r.length&&0===r[0].end&&(r[0].end=r[0].start-t.x,r[0].start=t.x,n=t.x),(l={}).start=n+o,l.end=0,s&&(l.end=n+o+h.padding.left),r.push(l)),o+=h.padding.left+h.width,h instanceof pli&&(s=!0))}return 1===r.length&&0===r[0].end&&(r[0].end=r[0].start-t.x,r[0].start=t.x),r}return[]},u.prototype.splitSelectionHighlightPosition=function(e,t,i){for(var n=[],o=0;o<i.length;o++){var r=i[o];e<r.start&&e+t<r.end||e>r.end||(e<r.start&&e+t>r.end?(n.push(new aci(e,r.start-e)),t=e+t-r.end,e=r.end):e===r.start&&(t<r.end?(t=e+t-r.end,e=r.end):(e+=r.end,t-=r.end)),o===i.length-1&&n.push(new aci(e,t)))}return n},u.prototype.addEditRegionHighlight=function(e,t,i){var n=void 0,o=this.editRegionHighlighters,o=(o.containsKey(e)?n=o.get(e):o.add(e,n=[]),new aci(t,i));return this.isCurrentUser&&(o.color=""!==this.owner.userColor?this.owner.userColor:"#FFFF00"),n.push(o),o},u.prototype.addContentControlEditRegionHighlight=function(e,t,i,n){var o=this.contentControleditRegionHighlighters,r=[];o.containsKey(n)||o.add(n,new uJt);o.get(n).add(e,r);o=new aci(t,i);r.push(o)},u.prototype.addFormFieldHighlight=function(e,t,i){var n=void 0,o=this.formFieldHighlighters,o=(o.containsKey(e)?n=o.get(e):o.add(e,n=[]),new aci(t,i));n.push(o)},u.prototype.createHighlightBorderInsideTable=function(e){var t=this.getPage(e),i=void 0,n=e.x-e.margin.left+e.leftBorderWidth,o=e.width+e.margin.left+e.margin.right-e.leftBorderWidth-e.rightBorderWidth,r=e.y,s=e.height,a=this.getPageTop(t),l=t.boundingRectangle.x,h=this.documentHelper.isPageInVisibleBound(t,a),d=this.selectedWidgets;this.isHightlightEditRegionInternal||this.isHighlightFormFields||(d.containsKey(e)&&d.get(e)instanceof aci?(i=d.get(e),h&&this.documentHelper.selectionContext.clearRect(l+i.left*this.documentHelper.zoomFactor-this.viewer.containerLeft,a+r*this.documentHelper.zoomFactor-this.viewer.containerTop,i.width*this.documentHelper.zoomFactor,s*this.documentHelper.zoomFactor)):(i=new aci(n,o),d.containsKey(e)&&d.remove(d.get(e)),d.add(e,i))),h&&(this.documentHelper.selectionContext.fillStyle="gray",this.documentHelper.selectionContext.globalAlpha=.4,d=this.documentHelper.zoomFactor,this.clipSelection(t,a),this.documentHelper.selectionContext.fillRect(l+n*d-this.viewer.containerLeft,a+r*d-this.viewer.containerTop,o*d,s*d),this.documentHelper.selectionContext.restore())},u.prototype.clipSelection=function(e,t){var i,n=this.owner.documentHelper,o=this.viewer instanceof sai&&this.documentHelper.zoomFactor<1?(i=e.boundingRectangle.width/this.documentHelper.zoomFactor,e.boundingRectangle.height/this.documentHelper.zoomFactor):(i=e.boundingRectangle.width*this.documentHelper.zoomFactor,e.boundingRectangle.height*this.documentHelper.zoomFactor),e=e.boundingRectangle.x;n.selectionContext.beginPath(),n.selectionContext.save(),n.selectionContext.rect(e-this.viewer.containerLeft,t-this.viewer.containerTop,i,o),n.selectionContext.clip()},u.prototype.addSelectionHighlight=function(e,t,i,n){if(this.selectedWidgets.containsKey(t)){var o=this.documentHelper.render.getScaledValue(t.height),r=this.selectedWidgets.get(t),s=void 0;if(r instanceof aci?(s=[]).push(r):s=r,!je(s))for(var a=0;a<s.length;a++){var l=s[a],h=this.documentHelper.render.getScaledValue(s[a].width),d=this.documentHelper.render.getScaledValue(s[a].left,1);if(je(n)&&(n=this.owner.selectionModule.getPage(t.paragraph)),this.owner.selectionModule.clipSelection(n,this.owner.selectionModule.getPageTop(n)),this.documentHelper.isComposingIME)this.renderDashLine(e,n,t,d,i,h,o);else if(e.globalAlpha=.4,e.fillStyle="gray",e.fillRect(d,this.documentHelper.render.getScaledValue(i,2),h,o),l.floatingItems&&0<l.floatingItems.length)for(var p=0;p<l.floatingItems.length;p++){var c=l.floatingItems[p],h=this.documentHelper.render.getScaledValue(c.width),d=this.documentHelper.render.getScaledValue(c.x,1),u=this.documentHelper.render.getScaledValue(c.y,2);e.fillRect(d,u,h,this.documentHelper.render.getScaledValue(c.height))}e.restore()}}},u.prototype.renderDashLine=function(e,t,i,n,o,r,s){var a=this.characterFormat.fontColor,a=a?Y.getColor(a):"#000000",l=(e.globalAlpha=1,this.owner.editorModule.copyInsertFormat(new Eri,!1)),l=this.documentHelper.textHelper.getHeight(l),t=this.getPageTop(t),l=l.Height-l.BaselineOffset;o=this.documentHelper.render.getUnderlineYPosition(i)+o+4-l,this.documentHelper.render.renderDashLine(e,n,t-this.viewer.containerTop+o*this.documentHelper.zoomFactor,r,a,!0)},u.prototype.addSelectionHighlightTable=function(e,t,i){if(this.selectedWidgets.containsKey(t)){var n=this.selectedWidgets.get(t),o=void 0;if(n instanceof aci?(o=[]).push(n):o=n,!je(o))for(var r=0;r<o.length;r++){var s=this.documentHelper.render.getScaledValue(o[r].left,1),a=this.documentHelper.render.getScaledValue(t.y,2),l=this.documentHelper.render.getScaledValue(o[r].width),h=this.documentHelper.render.getScaledValue(t.height);e.fillStyle="gray",je(i)&&(i=this.owner.selectionModule.getPage(t)),this.owner.selectionModule.clipSelection(i,this.owner.selectionModule.getPageTop(i)),e.fillRect(s,a,l,h),e.restore()}}},u.prototype.removeSelectionHighlight=function(e){var t=0,i=0,n=void 0;if(e instanceof Gai){var o=e,n=je(o.paragraph)?void 0:this.getPage(o.paragraph);if(je(n))return;t=this.getTop(o),i=o.height}else if(e instanceof Uai){if(n=je(e)?void 0:this.getPage(e),je(n))return;t=e.y,i=e.height}if(!je(n)){var o=this.selectedWidgets.get(e),r=void 0;if(o instanceof aci?(r=[]).push(o):r=o,!je(r))for(var s=0;s<r.length;s++){var a=r[s].width,l=r[s].left,h=n.boundingRectangle,d=this.documentHelper.pages.indexOf(n),p=this.viewer.pageGap,p=(h.y-p*(d+1))*this.documentHelper.zoomFactor+p*(d+1),d=h.x,h=this.documentHelper.zoomFactor;(this.viewer.containerTop<=p||p<this.viewer.containerTop+this.documentHelper.selectionCanvas.height)&&this.documentHelper.selectionContext.clearRect(d+l*h-this.viewer.containerLeft-.5,p+t*h-this.viewer.containerTop-.5,a*h+.5,i*h+.5)}}},u.prototype.selectCurrentWord=function(e){this.isSelectCurrentWord=!0;var t=this.start.clone(),i=this.end.clone();this.selectCurrentWordRange(t,i,e||!1),this.selectRange(t,i),this.isSelectCurrentWord=!1},u.prototype.selectParagraph=function(){je(this.start)||(this.start.paragraphStartInternal(this,!1),this.end.moveToParagraphEndInternal(this,!1),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},u.prototype.selectLine=function(){je(this.start)||(this.moveToLineStart(),this.handleShiftEndKey())},u.prototype.moveToDocumentStart=function(){this.handleControlHomeKey()},u.prototype.moveToDocumentEnd=function(){this.handleControlEndKey()},u.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)},u.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)},u.prototype.moveToNextLine=function(){this.moveDown()},u.prototype.moveToPreviousLine=function(){this.moveUp()},u.prototype.moveToNextCharacter=function(){this.handleRightKey()},u.prototype.moveToPreviousCharacter=function(){this.handleLeftKey()},u.prototype.selectCurrentWordRange=function(e,t,i){var n,o,r;je(e)||(0<e.offset&&(n=e.clone(),r=(o=e.currentWidget.getInline(e.offset,0)).element,o.index,!je(r)&&r instanceof Zai&&1===r.fieldType?2<e.offset&&(!je(r.fieldSeparator)||je(r.fieldBegin))?(n.setPositionParagraph(n.currentWidget,e.offset-2),n.moveToWordEndInternal(0,!1),n.paragraph===e.paragraph&&n.offset===e.offset-1||e.moveToWordStartInternal(2)):3<e.offset&&je(r.fieldSeparator)&&(n.setPositionParagraph(n.currentWidget,e.offset-3),n.moveToWordEndInternal(0,!1),n.paragraph===e.paragraph&&n.offset===e.offset||e.moveToWordStartInternal(2)):(n.setPositionParagraph(n.currentWidget,e.offset-1),n.moveToWordEndInternal(0,!1),n.paragraph===e.paragraph&&n.offset===e.offset||e.moveToWordStartInternal(2))),t.moveToWordEndInternal(2,i))},u.prototype.extendToParagraphStart=function(){je(this.start)||(this.end.paragraphStartInternal(this,!0),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},u.prototype.extendToParagraphEnd=function(){je(this.start)||(this.end.moveToParagraphEndInternal(this,!0),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},u.prototype.moveNextPosition=function(){var e;je(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&&!this.getCurrentFormField()&&(e=this.getFormFieldInFormFillMode(),this.selectPrevNextFormField(!0,e)))},u.prototype.moveToNextParagraph=function(){je(this.start)||(this.end.moveToNextParagraphStartInternal(),this.start.setPositionInternal(this.end),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},u.prototype.nextFootnote=function(){if(this.isinFootnote)for(var e=this.start.paragraph.bodyWidget.footNoteReference,t=(this.documentHelper.footnoteCollection.length,this.documentHelper.footnoteCollection.indexOf(e)),i=this.documentHelper.footnoteCollection[t+1],n=(je(i)&&(i=e),this.start.clone()),o=this.end.clone(),r=0;r<this.documentHelper.pages.length;r++)for(var s=this.documentHelper.pages[r].footnoteWidget,a=1;a<s.bodyWidgets.length;a++)s.bodyWidgets[a].footNoteReference===i&&(n.setPositionParagraph(s.bodyWidgets[a].childWidgets[0].childWidgets[0],0),o.setPositionInternal(n),this.selectRange(n,o))},u.prototype.previousFootnote=function(){if(this.isinFootnote)for(var e=this.start.paragraph.bodyWidget.footNoteReference,t=(this.documentHelper.footnoteCollection.length,this.documentHelper.footnoteCollection.indexOf(e)),i=this.documentHelper.footnoteCollection[t-1],n=(je(i)&&(i=e),this.start.clone()),o=this.end.clone(),r=0;r<this.documentHelper.pages.length;r++)for(var s=this.documentHelper.pages[r].footnoteWidget,a=1;a<s.bodyWidgets.length;a++)s.bodyWidgets[a].footNoteReference===i&&(n.setPositionParagraph(s.bodyWidgets[a].childWidgets[0].childWidgets[0],0),o.setPositionInternal(n),this.selectRange(n,o))},u.prototype.nextEndnote=function(){if(this.isinEndnote)for(var e=this.start.paragraph.bodyWidget.footNoteReference,t=this.documentHelper.endnoteCollection.indexOf(e),i=this.documentHelper.endnoteCollection[t+1],n=(je(i)&&(i=e),this.start.clone()),o=this.end.clone(),r=this.documentHelper.pages[this.endPage-1].endnoteWidget,s=0;s<r.childWidgets.length;s++)r.bodyWidgets[s].footNoteReference===i&&(n.setPositionParagraph(r.bodyWidgets[s].childWidgets[0].childWidgets[0],0),o.setPositionInternal(n),this.selectRange(n,o))},u.prototype.previousEndnote=function(){if(this.isinEndnote)for(var e=this.start.paragraph.bodyWidget.footNoteReference,t=this.documentHelper.endnoteCollection.indexOf(e),i=this.documentHelper.endnoteCollection[t-1],n=(je(i)&&(i=e),this.start.clone()),o=this.end.clone(),r=this.documentHelper.pages[this.endPage-1].endnoteWidget,s=0;s<r.childWidgets.length;s++)r.bodyWidgets[s].footNoteReference===i&&(n.setPositionParagraph(r.bodyWidgets[s].childWidgets[0].childWidgets[0],0),o.setPositionInternal(n),this.selectRange(n,o))},u.prototype.movePreviousPosition=function(){var e;je(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&&!this.getCurrentFormField()&&(e=this.getFormFieldInFormFillMode(),this.selectPrevNextFormField(!1,e)))},u.prototype.moveToPreviousParagraph=function(){je(this.start)||(this.end.moveToPreviousParagraph(this),this.start.setPositionInternal(this.end),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},u.prototype.extendToPreviousLine=function(){je(this.start)||(this.end.moveToPreviousLine(this,this.upDownSelectionLength),this.fireSelectionChanged(!0))},u.prototype.extendToLineEnd=function(){je(this.start)||(this.end.moveToLineEndInternal(this,!0),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},u.prototype.extendToLineStart=function(){je(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))},u.prototype.moveUp=function(){if(this.documentHelper.isFormFillProtectedMode)this.selectPrevNextFormField(!1);else if(!je(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;var e,t=this.start.currentWidget.paragraph.bodyWidget.columnIndex,i=(this.start.currentWidget.paragraph.bodyWidget.sectionFormat.numberOfColumns,this.start.currentWidget.paragraph.bodyWidget.index),n=(this.start.moveUp(this,this.upDownSelectionLength),e=1<this.start.currentWidget.paragraph.bodyWidget.sectionFormat.numberOfColumns,this.start.currentWidget.paragraph.bodyWidget.columnIndex);if(e)if(t===n||i!==this.start.currentWidget.paragraph.bodyWidget.index&&1===this.start.currentWidget.paragraph.bodyWidget.sectionFormat.numberOfColumns)this.end.setPositionInternal(this.start);else for(;!(je(this.start.currentWidget.paragraph.previousRenderedWidget)||i!==this.start.currentWidget.paragraph.bodyWidget.index&&1===this.start.currentWidget.paragraph.bodyWidget.sectionFormat.numberOfColumns||i!==this.start.currentWidget.paragraph.bodyWidget.index&&1<this.start.currentWidget.paragraph.bodyWidget.sectionFormat.numberOfColumns&&t>this.start.currentWidget.paragraph.bodyWidget.columnIndex||(this.start.moveUp(this,this.upDownSelectionLength),t===this.start.currentWidget.paragraph.bodyWidget.columnIndex)););this.end.setPositionInternal(this.start),this.fireSelectionChanged(!0)}},u.prototype.moveDown=function(){if(this.documentHelper.isFormFillProtectedMode)this.selectPrevNextFormField(!0);else if(!je(this.start)){this.isEmpty||(this.isForward?this.start.setPositionInternal(this.end):this.end.setPositionInternal(this.start),this.upDownSelectionLength=this.start.location.x),this.upDownSelectionLength=this.start.location.x;var e=this.start.currentWidget.paragraph.bodyWidget.columnIndex,t=this.start.currentWidget.paragraph.bodyWidget.index,i=1<this.start.currentWidget.paragraph.bodyWidget.sectionFormat.numberOfColumns,n=(this.start.moveDown(this,this.upDownSelectionLength),this.start.currentWidget.paragraph.bodyWidget.columnIndex);if(i)if(e===n||t!==this.start.currentWidget.paragraph.bodyWidget.index&&1===this.start.currentWidget.paragraph.bodyWidget.sectionFormat.numberOfColumns)this.end.setPositionInternal(this.start);else for(;!(je(this.start.currentWidget.paragraph.nextRenderedWidget)||t!==this.start.currentWidget.paragraph.bodyWidget.index&&1===this.start.currentWidget.paragraph.bodyWidget.sectionFormat.numberOfColumns||t!==this.start.currentWidget.paragraph.bodyWidget.index&&1<this.start.currentWidget.paragraph.bodyWidget.sectionFormat.numberOfColumns&&this.documentHelper.layout.getBodyWidget(this.start.currentWidget.paragraph.bodyWidget,!1)===this.start.currentWidget.paragraph.bodyWidget||(this.start.moveDown(this,this.upDownSelectionLength),e===this.start.currentWidget.paragraph.bodyWidget.columnIndex)););this.end.setPositionInternal(this.start),this.fireSelectionChanged(!0)}},u.prototype.updateForwardSelection=function(){this.isEmpty||(this.isForward?this.start.setPositionInternal(this.end):this.end.setPositionInternal(this.start))},u.prototype.updateBackwardSelection=function(){this.isEmpty||(this.isForward?this.end.setPositionInternal(this.start):this.start.setPositionInternal(this.end))},u.prototype.getFirstBlockInFirstCell=function(e){if(0<e.childWidgets.length){var e=e.childWidgets[0];if(0<e.childWidgets.length)return 0===(e=e.childWidgets[0]).childWidgets.length?void 0:e.childWidgets[0]}},u.prototype.getFirstCellInRegion=function(e,t,i,n){var o,r=this.getCellLeft(e,t),s=r+t.cellFormat.cellWidth,a=!0;if(r<=i&&i<s)for(var l=0;l<e.childWidgets.length;l++){var h=this.getCellLeft(e,e.childWidgets[l]);if(Y.round(r,2)<=Y.round(h,2)&&Y.round(h,2)<Y.round(s,2))return a=!1,e.childWidgets[l]}else for(var d=0;d<e.childWidgets.length;d++){var p=this.getCellLeft(e,e.childWidgets[d]);if(p<=i&&p+e.childWidgets[d].cellFormat.cellWidth>i)return a=!1,e.childWidgets[d]}if(a){if(!je(e.previousRenderedWidget)&&n)return o=e.previousRenderedWidget,this.getFirstCellInRegion(o,t,i,n);if(!je(e.nextRenderedWidget)&&!n)return this.getFirstCellInRegion(e.nextRenderedWidget,t,i,n)}return e.childWidgets[0]},u.prototype.getFirstParagraph=function(e){for(;e.previousSplitWidget;)e=e.previousSplitWidget;var t=e.firstChild;return this.documentHelper.getFirstParagraphBlock(t)},u.prototype.getLastBlockInLastCell=function(e){if(0<e.childWidgets.length){for(var e=e.childWidgets[e.childWidgets.length-1],t=e.childWidgets[e.childWidgets.length-1];0===t.childWidgets.length&&!je(t.previousSplitWidget);)t=t.previousSplitWidget;return t.childWidgets[t.childWidgets.length-1]}},u.prototype.moveToLineStart=function(){je(this.start)||(this.updateBackwardSelection(),this.start.moveToLineStartInternal(this,!1),this.end.setPositionInternal(this.start),this.upDownSelectionLength=this.start.location.x,this.fireSelectionChanged(!0))},u.prototype.moveToLineEnd=function(){je(this.start)||(this.updateForwardSelection(),this.start.moveToLineEndInternal(this,!1),this.end.setPositionInternal(this.start),this.upDownSelectionLength=this.start.location.x,this.fireSelectionChanged(!0))},u.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)},u.prototype.moveTextPosition=function(e,t,i){var n;je(this.start)||(je(n=this.documentHelper.getLineWidgetInternal(e,!0))||this.updateTextPositionWidget(n,e,t,!0),this.upDownSelectionLength=t.location.x,(n=this.start.getHierarchicalIndexInternal())===(e=this.end.getHierarchicalIndexInternal())||i||(rci.isForwardSelection(n,e)?t.validateForwardFieldSelection(n,e):t.validateBackwardFieldSelection(n,e)),this.fireSelectionChanged(!0))},u.prototype.getDocumentStart=function(){var e=this.documentHelper.pages[0].bodyWidgets[0].childWidgets[0];return this.setPositionForBlock(e,!0)},u.prototype.getDocumentEnd=function(){for(var e,t=void 0,i=this.owner.documentStart,n=this.documentHelper.pages[this.documentHelper.pages.length-1];n.previousPage&&1===n.bodyWidgets.length&&0===n.bodyWidgets[0].childWidgets.length;)n=n.previousPage;return!je(i)&&0<n.bodyWidgets[n.bodyWidgets.length-1].childWidgets.length&&(i=void 0,(e=(e=n.bodyWidgets[n.bodyWidgets.length-1].childWidgets)[e.length-1])instanceof Dai&&(i=e),t=this.setPositionForBlock(i,!1)),t},u.prototype.handleControlEndKey=function(){this.isHomeEnd=!0;var e=void 0;je(this.owner.documentEnd)||(e=this.owner.documentEnd),je(e)||this.owner.selectionModule.selectContent(e,!0),this.owner.enableAutoFocus&&this.checkForCursorVisibility(),this.isHomeEnd=!1},u.prototype.handleControlHomeKey=function(){this.isHomeEnd=!0;var e=void 0;je(this.owner.documentStart)||(e=this.owner.documentStart),je(e)||this.owner.selectionModule.selectContent(e,!0),this.owner.enableAutoFocus&&this.checkForCursorVisibility(),this.isHomeEnd=!1},u.prototype.handleControlLeftKey=function(){this.extendToWordStartInternal(!0),this.checkForCursorVisibility()},u.prototype.handleControlRightKey=function(){this.extendToWordEndInternal(!0),this.checkForCursorVisibility()},u.prototype.handleControlDownKey=function(){this.moveToNextParagraph(),this.checkForCursorVisibility()},u.prototype.handleControlUpKey=function(){this.moveToPreviousParagraph(),this.checkForCursorVisibility()},u.prototype.handleShiftLeftKey=function(){this.extendBackward(),this.checkForCursorVisibility()},u.prototype.handleShiftUpKey=function(){this.extendToPreviousLine(),this.checkForCursorVisibility()},u.prototype.handleShiftRightKey=function(){this.extendForward(),this.checkForCursorVisibility()},u.prototype.handleShiftDownKey=function(){this.extendToNextLine(),this.checkForCursorVisibility()},u.prototype.handleControlShiftLeftKey=function(){(this.isForward?this.start:this.end).isCurrentParaBidi?this.extendToWordEndInternal(!1):this.extendToWordStartInternal(!1),this.checkForCursorVisibility()},u.prototype.handleControlShiftUpKey=function(){this.extendToParagraphStart(),this.checkForCursorVisibility()},u.prototype.handleControlShiftRightKey=function(){(this.isForward?this.start:this.end).isCurrentParaBidi?this.extendToWordStartInternal(!1):this.extendToWordEndInternal(!1),this.checkForCursorVisibility()},u.prototype.handleControlShiftDownKey=function(){this.extendToParagraphEnd(),this.checkForCursorVisibility()},u.prototype.handleLeftKey=function(){this.end.isCurrentParaBidi?this.moveNextPosition():this.movePreviousPosition(),this.owner.enableAutoFocus&&this.checkForCursorVisibility()},u.prototype.handleUpKey=function(){this.isMoveDownOrMoveUp=!0,this.moveUp(),this.isMoveDownOrMoveUp=!1,this.checkForCursorVisibility()},u.prototype.handleRightKey=function(){this.end.isCurrentParaBidi?this.movePreviousPosition():this.moveNextPosition(),this.owner.enableAutoFocus&&this.checkForCursorVisibility()},u.prototype.handleEndKey=function(){this.isHomeEnd=!0,this.moveToLineEnd(),this.checkForCursorVisibility(),this.isHomeEnd=!1},u.prototype.handleHomeKey=function(){this.isHomeEnd=!0,this.moveToLineStart(),this.checkForCursorVisibility(),this.isHomeEnd=!1},u.prototype.handleDownKey=function(){this.isMoveDownOrMoveUp=!0,this.moveDown(),this.isMoveDownOrMoveUp=!1,this.checkForCursorVisibility()},u.prototype.handleShiftEndKey=function(){this.isHomeEnd=!0,this.extendToLineEnd(),this.checkForCursorVisibility(),this.isHomeEnd=!1},u.prototype.handleShiftHomeKey=function(){this.isHomeEnd=!0,this.extendToLineStart(),this.checkForCursorVisibility(),this.isHomeEnd=!1},u.prototype.handleControlShiftEndKey=function(){this.isHomeEnd=!0;var e=void 0;je(this.owner.documentEnd)||(e=this.owner.documentEnd),je(e)||(this.end.setPosition(e.currentWidget,!1),this.fireSelectionChanged(!0)),this.checkForCursorVisibility(),this.isHomeEnd=!1},u.prototype.handleControlShiftHomeKey=function(){this.isHomeEnd=!0;var e=void 0;je(this.owner.documentStart)||(e=this.owner.documentStart),je(e)||(this.end.setPositionInternal(e),this.fireSelectionChanged(!0)),this.checkForCursorVisibility(),this.isHomeEnd=!1},u.prototype.handleSpaceBarKey=function(){this.owner.documentHelper.isDocumentProtected&&"FormFieldsOnly"===this.owner.documentHelper.protectionType&&"CheckBox"===this.getFormFieldType()&&this.owner.editorModule.toggleCheckBoxFormField(this.getCurrentFormField())},u.prototype.handleTabKey=function(e,t){var i=this.start,n=!1,o=!1;je(i=this.isForward?i:this.end)||(0!==i.offset&&(this.isForward||0!==this.end.offset)||-1!=i.paragraph.paragraphFormat.listFormat.listId||(i.currentWidget.isFirstLine()&&(n=!0),o=!0),this.start.paragraph.isInsideTable&&this.end.paragraph.isInsideTable&&(e||t)?this.owner.documentHelper.isDocumentProtected||"FormFieldsOnly"===this.documentHelper.protectionType||(t?this.selectPreviousCell():this.selectNextCell()):!e&&!t||je(i)||i.offset!==this.getStartOffset(i.paragraph)||je(i.paragraph.paragraphFormat)||je(i.paragraph.paragraphFormat.listFormat)||-1===i.paragraph.paragraphFormat.listFormat.listId||this.owner.isReadOnlyMode?this.owner.isReadOnlyMode||this.documentHelper.isFormFillProtectedMode||(n&&i.paragraph.paragraphFormat.firstLineIndent<this.documentHelper.defaultTabWidth?this.documentHelper.owner.editorModule.onApplyParagraphFormat("firstLineIndent",this.documentHelper.defaultTabWidth,!0,!1):o?t?this.owner.editorModule.decreaseIndent():Y.convertPointToPixel(i.paragraph.paragraphFormat.firstLineIndent+i.paragraph.paragraphFormat.leftIndent)<this.documentHelper.viewer.clientArea.width&&this.owner.editorModule.increaseIndent():this.owner.editorModule.handleTextInput("\t")):(e=this.documentHelper.selection,n=i.paragraph,e.isForward||(n=e.end.paragraph),this.owner.editorModule.isFirstParaForList(e,n)?t?this.owner.editorModule.updateListLevelIndent(-this.documentHelper.defaultTabWidth,n):this.owner.editorModule.updateListLevelIndent(this.documentHelper.defaultTabWidth,n):this.owner.editorModule.updateListLevel(!t)),"FormFieldsOnly"===this.documentHelper.protectionType&&0<this.documentHelper.formFields.length&&this.selectPrevNextFormField(!t),this.checkForCursorVisibility())},u.prototype.handlePageUpPageDownKey=function(t,i){var n=this,o=this.end.location.x,r=this.end.location.y,e=this.end.paragraph.bodyWidget.page,s=this.getPageTop(e),a=this.documentHelper.viewerContainer.scrollTop,r=r*this.documentHelper.zoomFactor+(s-a),o=o*this.documentHelper.zoomFactor+e.boundingRectangle.x,l=(t?this.documentHelper.viewerContainer.scrollTop+=this.documentHelper.visibleBounds.height:this.documentHelper.viewerContainer.scrollTop-=this.documentHelper.visibleBounds.height,!1);a===this.documentHelper.viewerContainer.scrollTop&&(l=!0),i&&(this.documentHelper.skipScrollToPosition=!0),setTimeout(function(){var e;l?i?(e=void 0,e=t?n.getDocumentEnd():n.getDocumentStart(),n.end.setPositionForLineWidget(e.currentWidget,e.offset),n.fireSelectionChanged(!0)):t?n.moveToDocumentEnd():n.moveToDocumentStart():n.select({x:o,y:r,extend:i})},0)},u.prototype.getFormFieldInFormFillMode=function(){for(var e,t=this.owner.selectionModule.start,i=this.documentHelper.formFields.length-1;0<=i;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},u.prototype.selectPrevNextFormField=function(e,t){if(this.documentHelper.isFormFillProtectedMode){t=t||this.getCurrentFormField();t=this.documentHelper.formFields.indexOf(t);if(-1!==t)if(e)for(var i=t;;i++){if(i===this.documentHelper.formFields.length-1?i=0:i+=1,this.documentHelper.formFields[i].formFieldData.enabled){this.selectFieldInternal(this.documentHelper.formFields[i],!0);break}i-=1}else for(i=t;;i--){if(0===i?i=this.documentHelper.formFields.length-1:i-=1,this.documentHelper.formFields[i].formFieldData.enabled){this.selectFieldInternal(this.documentHelper.formFields[i],!0);break}i+=1}}},u.prototype.navigateToNextFormField=function(){for(var e,t=this.owner.selectionModule.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 ili&&"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 ili&&"Text"===e.formFieldData.type&&this.documentHelper.isInlineFormFillProtectedMode?this.selectTextElementStartOfField(this.documentHelper.formFields[0]):this.selectFieldInternal(this.documentHelper.formFields[0]))}},u.prototype.selectTextElementStartOfField=function(e){var t=e.fieldSeparator.nextElement;if(t){for(;!(t instanceof pli);)t=t.nextElement;var i=e.line.getOffset(t,0),i=this.getPhysicalPositionInternal(e.line,i,!1);this.selectInternal(e.line,t,0,i)}},u.prototype.triggerFormFillEvent=function(e){var t,i=this.previousSelectedFormField,n=this.currentFormField;n!==i&&i&&i.formFieldData instanceof ili&&"Text"===i.formFieldData.type&&(t={fieldName:(i=""===i.formFieldData.format||this.isFormatUpdated||(this.owner.editorModule.applyFormTextFormat(i),je(this.previousSelectedFormField))?i:this.previousSelectedFormField).formFieldData.name,value:this.owner.editorModule.getFieldResultText(i)},this.owner.trigger(EJt,t)),n!==i&&n&&(n.formFieldData instanceof ili&&"Text"===n.formFieldData.type&&null==e||(n.formFieldData instanceof ili&&"Inline"===this.owner.documentEditorSettings.formFieldSettings.formFillingMode||n.formFieldData instanceof rli)&&e)&&(t={fieldName:n.formFieldData.name,value:this.owner.editorModule.getFieldResultText(n)},this.owner.trigger(DJt,t))},u.prototype.triggerContentControlFillEvent=function(){var e,t=this.currentContentControl,i=this.previousSelectedContentControl;!je(i)&&i.contentControlProperties&&(e={Text:this.owner.editor.getResultContentControlText(i)},this.owner.trigger(RJt,e),je(i.contentControlProperties.xmlMapping)||(i=i.contentControlProperties.xmlMapping.xPath,this.owner.xmlPaneModule.updateContent(e.Text,i))),!je(t)&&t.contentControlProperties&&(e={Text:this.owner.editor.getResultContentControlText(t)},this.owner.trigger(LJt,e))},u.prototype.selectPreviousCell=function(){var e,t=this.start.paragraph.associatedCell,i=t.ownerRow;i.ownerTable;je(t.previousWidget)?je(i.previousRenderedWidget)||(e=void 0,i.previousRenderedWidget instanceof jai&&(e=i.previousRenderedWidget),this.selectTableCellInternal(e.childWidgets[e.childWidgets.length-1],!0)):(i=void 0,t.previousWidget instanceof Uai&&(i=t.previousWidget),this.selectTableCellInternal(i,!0))},u.prototype.selectNextCell=function(){var e,t=this.start.paragraph.associatedCell,i=t.ownerRow;i.ownerTable;je(t.nextWidget)?je(i.nextRenderedWidget)&&!this.owner.isReadOnlyMode?this.owner.editorModule.insertRow(!1):(e=void 0,i.nextRenderedWidget instanceof jai&&(e=i.nextRenderedWidget),this.selectTableCellInternal(e.childWidgets[0],!0)):(i=void 0,t.nextRenderedWidget instanceof Uai&&(i=t.nextRenderedWidget),this.selectTableCellInternal(i,!0))},u.prototype.selectTableCellInternal=function(e,t){var i=this.getFirstParagraph(e),e=this.getLastParagraph(e);i===e&&e.isEmpty()?this.selectParagraphInternal(e,!0):(e=e.childWidgets[0],this.start.setPosition(i.childWidgets[0],!0),this.end.setPositionParagraph(e,e.getEndOffset()),this.fireSelectionChanged(!0))},u.prototype.selectTableInternal=function(){var e,t=this.start,i=this.end;this.isForward||(t=this.end,i=this.start),je(t)||je(i)||je(this.getTable(t,i))||(t=this.getContainerCellOf(t.paragraph.associatedCell,i.paragraph.associatedCell).ownerTable,i=this.documentHelper.getFirstParagraphBlock(t),e=(t=this.documentHelper.getLastParagraphBlock(t)).lastChild.getEndOffset(),this.start.setPosition(i.childWidgets[0],!0),this.end.setPositionParagraph(t.lastChild,e+1)),this.selectPosition(this.start,this.end)},u.prototype.getTableRevision=function(){var e,t=this.start.clone(),i=this.end.clone(),n=(this.isForward||(t=this.end.clone(),i=this.start.clone()),je(t)||je(i)||je(this.getTable(t,i))||(o=this.getContainerCellOf(t.paragraph.associatedCell,i.paragraph.associatedCell).ownerTable,n=this.documentHelper.getFirstParagraphBlock(o),e=(o=this.documentHelper.getLastParagraphBlock(o)).lastChild.getEndOffset(),t.setPosition(n.childWidgets[0],!0),i.setPositionParagraph(o.lastChild,e+1)),this.getAbsolutePositionFromRelativePosition(t)),o=this.getAbsolutePositionFromRelativePosition(i);return Math.abs(o-n)},u.prototype.selectColumnInternal=function(){var e,t,i,n,o,r=this.start,s=this.end;this.isForward||(r=this.end,s=this.start),je(r)||je(s)||je(this.getTable(r,s))||(e=this.getContainerCellOf(r.paragraph.associatedCell,s.paragraph.associatedCell)).ownerTable.contains(s.paragraph.associatedCell)&&(r=this.getSelectedCell(r.paragraph.associatedCell,e),t=this.getSelectedCell(s.paragraph.associatedCell,e),this.containsCell(e,s.paragraph.associatedCell)?(r.ownerRow,0<(s=e.ownerTable.getColumnCellsForSelection(e,e)).length&&(i=this.getFirstParagraph(s[0]),n=this.getLastParagraph(s[s.length-1]),this.start.setPosition(i.firstChild,!0),o=n.lastChild,this.end.setPositionParagraph(o,o.getEndOffset()+1))):(s=e.ownerTable.getColumnCellsForSelection(r,r),r=e.ownerTable.getColumnCellsForSelection(t,t),0<s.length&&0<r.length&&(i=this.getFirstParagraph(s[0]),n=this.getLastParagraph(r[r.length-1]),this.start.setPosition(i.firstChild,!0),o=n.lastChild,this.end.setPositionParagraph(o,o.getEndOffset()+1)))),this.selectPosition(this.start,this.end)},u.prototype.selectTableRow=function(){var e,t,i,n,o=this.start,r=this.end;this.isForward||(o=this.end,r=this.start),je(o)||je(r)||je(this.getTable(o,r))||(n=void 0,(n=this.getContainerCellOf(o.paragraph.associatedCell,r.paragraph.associatedCell)).ownerTable.contains(r.paragraph.associatedCell)&&(o=this.getSelectedCell(o.paragraph.associatedCell,n),e=this.getSelectedCell(r.paragraph.associatedCell,n),i=this.containsCell(n,r.paragraph.associatedCell)?(n=o.ownerRow,t=this.getFirstParagraph(n.childWidgets[0]),this.getLastParagraph(n.childWidgets[n.childWidgets.length-1])):(t=this.getFirstParagraph(o.ownerRow.childWidgets[0]),i=void 0,this.getLastParagraph(e.ownerRow.childWidgets[e.ownerRow.childWidgets.length-1])),this.start.setPosition(t.firstChild,!0),this.end.setPositionParagraph(i.lastChild,i.lastChild.getEndOffset()+1))),this.selectPosition(this.start,this.end)},u.prototype.selectTableCell=function(){var e,t,i,n=this.start,o=this.end;this.isForward||(n=this.end,o=this.start),je(this.getTable(n,o))||(this.isEmpty?n.paragraph.isInsideTable&&!je(n.paragraph.associatedCell)&&((t=this.getFirstParagraph(n.paragraph.associatedCell))===(i=this.getLastParagraph(o.paragraph.associatedCell))?this.start.setPosition(i.firstChild,!0):this.start.setPosition(t.firstChild,!0),this.end.setPositionParagraph(i.lastChild,i.lastChild.getEndOffset()+1)):(e=this.getContainerCell(n.paragraph.associatedCell),this.containsCell(e,n.paragraph.associatedCell)&&this.containsCell(e,o.paragraph.associatedCell)&&(t=this.getFirstParagraph(e),i=this.getLastParagraph(e),je(t)||je(i)||(this.start.setPosition(t.firstChild,!0),this.end.setPositionParagraph(i.lastChild,i.lastChild.getEndOffset()+1)))),this.selectPosition(this.start,this.end))},u.prototype.selectAll=function(){this.documentHelper.skipScrollToPosition=!0;var e=this.getContainerWidget(this.start.paragraph);if(this.owner.enableHeaderAndFooter)var t=this.getContainerWidget(this.start.paragraph),i=this.setPositionForBlock(t.firstChild,!0),n=this.setPositionForBlock(t.lastChild,!1);else if(this.isInShape){var t=this.getCurrentTextFrame();i=this.setPositionForBlock(t.firstChild,!0),n=this.setPositionForBlock(t.lastChild,!1)}else if(e instanceof Pai&&"Footnote"===e.footNoteType){for(var o=void 0,r=void 0,s=this.documentHelper.pages.length,o=0;o<=s-1;o++)if(!je(this.documentHelper.pages[o].footnoteWidget)){i=this.setPositionForBlock(this.documentHelper.pages[o].footnoteWidget.bodyWidgets[0].firstChild,!0);break}for(r=s-1;0<=r;r--)if(!je(this.documentHelper.pages[r].footnoteWidget)){var a=this.documentHelper.pages[r].footnoteWidget.bodyWidgets.length,l=this.documentHelper.pages[r].footnoteWidget.bodyWidgets[a-1].childWidgets.length;n=this.setPositionForBlock(this.documentHelper.pages[r].footnoteWidget.bodyWidgets[a-1].childWidgets[l-1],!1);break}}else n=e instanceof Pai&&"Endnote"===e.footNoteType?(t=this.getContainerWidget(this.start.paragraph),i=this.setPositionForBlock(t.bodyWidgets[0].firstChild,!0),this.setPositionForBlock(t.bodyWidgets[t.bodyWidgets.length-1].firstChild,!1)):(i=this.owner.documentStart,this.owner.documentEnd);je(i)||(this.start.setPositionInternal(i),this.end.setPositionParagraph(n.currentWidget,n.offset+1),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},u.prototype.extendBackward=function(){je(this.start)||((this.isForward?this.start:this.end).isCurrentParaBidi?this.end.moveForward():this.end.moveBackward(),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},u.prototype.extendForward=function(){je(this.start)||((this.isForward?this.start:this.end).isCurrentParaBidi?this.end.moveBackward():this.end.moveForward(),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},u.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))},u.prototype.extendToWordStart=function(){this.extendToWordStartInternal(!1)},u.prototype.extendToWordEnd=function(){this.extendToWordEndInternal(!1)},u.prototype.extendToWordStartInternal=function(e){je(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))},u.prototype.extendToWordEndInternal=function(e){je(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))},u.prototype.extendToNextLine=function(){je(this.start)||(this.end.moveToNextLine(this.upDownSelectionLength),this.fireSelectionChanged(!0))},u.prototype.getTextPosition=function(e){var t=new rci(this.owner);return t.setPositionForCurrentIndex(e),t},u.prototype.getText=function(e){var t,i;if(!(je(this.start)||je(this.end)||je(this.start.paragraph)||je(this.end.paragraph)))return t=this.start,i=this.end,t.isAtSamePosition(i)?"":this.getTextInternal(t,i,e)},u.prototype.getTextInternal=function(e,t,i){e.isExistAfter(t)&&(n=t,t=e,e=n);var n=e,o=t;if(!(je(e)||je(t)||je(e.paragraph)||je(t.paragraph))){var r=0,s=e.offset,a=t.offset,e=e.currentWidget.getInline(s,r),s=(r=e.index,e.element),e=(s instanceof Zai&&!je(s.fieldEnd)&&(s=(e=this.getRenderedInline(s,r)).element,r=e.index),t.currentWidget.getInline(a,0)),t=e.element,e=e.index,l="";if(s instanceof rhi&&i&&0===r?l=Xai.objectCharacter:s instanceof pli&&(l=je(s.text)||""===s.text||s.text.length<r?l:s.text.substring(r)),n.paragraph===o.paragraph)s instanceof Xai&&(s===t&&s instanceof pli?l=l.length<e-r?l:l.substring(0,e-r):s.nextNode instanceof Xai&&(l+=this.getTextInline(s.nextNode,o.paragraph,t,e,i)));else if(s instanceof Xai&&s.nextNode instanceof Xai)l+=this.getTextInline(s.nextNode,o.paragraph,t,e,i);else{var h=this.documentHelper.selection.getNextParagraphBlock(n.paragraph);for(l+="\r";!je(h)&&h.isEmpty();){if(l+="\r",h===o.paragraph)return l;h=this.documentHelper.selection.getNextParagraphBlock(h)}je(h)||h.isEmpty()||(l+=this.getTextInline(h.childWidgets[0].children[0],o.paragraph,t,e,i))}return a===o.currentWidget.getEndOffset()+1&&(l+="\r"),l}},u.prototype.getHierarchicalIndex=function(e,t){var i,n,o,r;if(e){if(i=e instanceof Iai?(o=-1!==e.headerFooterType.indexOf("Header")?"H":"F",r=e.page.index.toString(),e.page.sectionIndex+";"+o+";"+r+";"+t):e instanceof Sai&&!je(e.containerWidget)&&e.containerWidget instanceof Pai?e.containerWidget.bodyWidgets.indexOf(e)+";"+t:e.index+";"+t,e instanceof Zli)return n=e.containerShape.line.getOffset(e.containerShape,1),this.getHierarchicalIndex(e.containerShape.paragraph,i="S;"+n+";"+t);if(e instanceof Pai&&(o="Footnote"===e.footNoteType?"FN":"EN",r=e.page.index.toString(),i=e.page.sectionIndex+";"+o+";"+r+";"+t),e.containerWidget)return e instanceof Uai&&e.rowIndex!==e.containerWidget.index&&(i=e.rowIndex+";"+i,e=e.containerWidget),this.getHierarchicalIndex(e.containerWidget,i)}return i},u.prototype.getHierarchicalIndexByPosition=function(e){e=this.getParagraphInfo(e);return this.getHierarchicalIndex(e.paragraph,e.offset.toString())},u.prototype.getTextPosBasedOnLogicalIndex=function(e){var t=new rci(this.owner),e=this.getParagraph({index:e}),e=this.getLineInfoBasedOnParagraph(e.paragraph,e.offset);return t.setPositionForLineWidget(e.line,e.offset),t},u.prototype.getLineInfoBasedOnParagraph=function(e,t){var i=this.getParagraphLength(e),n=e.nextSplitWidget;for(i+1<t&&je(n)&&(t=i);i<t&&n instanceof Lai;)t-=i,e=n,i=this.getParagraphLength(e),n=e.nextSplitWidget;return this.getLineInfo(e,t)},u.prototype.getParagraph=function(e){return{paragraph:this.getParagraphInternal(this.getBodyWidget(e),e),offset:parseInt(e.index,10)}},u.prototype.getBodyWidget=function(e){var t=e.index.indexOf(";"),i=e.index.substring(0,t),n=(e.index=e.index.substring(t).replace(";",""),parseInt(i,10));parseInt(i,10);return 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))},u.prototype.getFootNoteWidget=function(e){var t=e.index.indexOf(";"),i=e.index.substring(0,t),n=(e.index=e.index.substring(t).replace(";",""),"FN"===i),t=e.index.indexOf(";"),i=e.index.substring(0,t),o=(e.index=e.index.substring(t).replace(";",""),t=parseInt(i,10),this.documentHelper.pages[t]);return t=e.index.indexOf(";"),i=e.index.substring(0,t),e.index=e.index.substring(t).replace(";",""),t=parseInt(i,10),(n?o.footnoteWidget:o.endnoteWidget).bodyWidgets[t]},u.prototype.getHeaderFooterWidget=function(e){var t=e.index.indexOf(";"),i=e.index.substring(0,t),n=(e.index=e.index.substring(t).replace(";",""),"H"===i),t=e.index.indexOf(";"),i=e.index.substring(0,t),e=(e.index=e.index.substring(t).replace(";",""),t=parseInt(i,10),this.documentHelper.pages[t]),i=n?e.headerWidget:e.footerWidget;return je(i)||(i.page=e),i},u.prototype.getBodyWidgetInternal=function(e,t){for(var i=0;i<this.documentHelper.pages.length;i++)for(var n=0;n<this.documentHelper.pages[i].bodyWidgets.length;n++){var o=this.documentHelper.pages[i].bodyWidgets[n];if(o.index===e&&0<o.childWidgets.length&&o.firstChild.index<=t&&o.lastChild.index>=t)return o;if(o.index>e)break}},u.prototype.getParagraphInternal=function(e,t,i){if(!je(t.index)){e instanceof jai&&je(i)&&(i=t.index);var n=t.index.indexOf(";"),o="0",r=(0<=n&&(o=t.index.substring(0,n),t.index=t.index.substring(n).replace(";","")),n=parseInt(o,10),e instanceof jai&&n>=e.childWidgets.length&&(n=e.childWidgets.length-1),this.getBlockByIndex(e,n,t));if(!je(i)&&je(r)&&e instanceof Uai&&e.containerWidget&&je(e.getSplitWidgets().pop().nextRenderedWidget)&&(n=i.indexOf(";"),n=parseInt(i.substring(0,n),10)-1,t.index=i.substring(i.indexOf(";")).replace(";",""),0<=n&&(r=this.getBlockByIndex(e.containerWidget,n)),i=void 0),r){"S"===(o=t.index.substring(0,1))&&(t.index=t.index.substring(1).replace(";",""),n=t.index.substring(0,t.index.indexOf(";")),t.index=t.index.substring(t.index.indexOf(";")).replace(";",""),o=t.index.substring(0,t.index.indexOf(";")),t.index=t.index.substring(t.index.indexOf(";")).replace(";",""),r=r.getInline(parseInt(n),0).element.textFrame.childWidgets[o]);n=r;if(n instanceof Lai)return 0<t.index.indexOf(";")&&(t.index="0"),n;if(n instanceof fai)return 0<t.index.indexOf(";")?this.getParagraphInternal(n,t,i):n instanceof _ai?this.documentHelper.getFirstParagraphInFirstCell(n):void 0}else if(e){o=e.getSplitWidgets().pop().nextRenderedWidget;if(o instanceof fai)return t.index="0",o instanceof _ai?this.documentHelper.getFirstParagraphInFirstCell(o):o}}},u.prototype.getBlockByIndex=function(e,t,i){var n;if(e){for(var o=0;o<e.childWidgets.length;o++)if(e.childWidgets[o].index===t){n=e.childWidgets[o];break}if(!je(n)&&n instanceof jai&&n.nextSplitWidget&&this.documentHelper.layout.isVerticalMergedCellContinue(n)){var r=(a=i.index).indexOf(";"),s=a.substring(0,r),a=a.substring(r).replace(";",""),l=this.getBlockByIndex(n,parseInt(s,10)),r=a.indexOf(";"),a=a.substring(0,r);if(l&&l instanceof Uai&&0<l.childWidgets.length&&l.lastChild.index<parseInt(a,10)){r=this.getBlockByIndex(n,parseInt(s,10)-1);if(r&&r instanceof Uai&&0<r.childWidgets.length&&r.lastChild.index<parseInt(a,10))return this.getBlockByIndex(e.nextSplitWidget,t,i)}}if(!(n||e instanceof Iai))return this.getBlockByIndex(e.nextSplitWidget,t,i)}return n},u.prototype.getParagraphInfo=function(e){return this.getParagraphInfoInternal(e.currentWidget,e.offset)},u.prototype.getCellFromSelection=function(e){var t=this.getSelectedCells();if(!this.hasMergedCells()){if(0==e&&0<t.length){if(!(this.selectedWidgets.keys[0]instanceof Uai))return;for(var i,n=(i=t[0]).rowIndex,o=i.columnIndex,r=i.ownerTable.index,s=0;s<t.length;s++)(a=t[s]).rowIndex<n&&(n=a.rowIndex),a.columnIndex<o&&(o=a.columnIndex),a.ownerTable.index<r&&(r=a.ownerTable.index);for(s=0;s<t.length;s++)n==(a=t[s]).rowIndex&&o==a.columnIndex&&r==a.ownerTable.index&&(i=a)}else if(1==e&&0<t.length){if(!(this.selectedWidgets.keys[this.selectedWidgets.length-1]instanceof Uai))return;for(n=(i=t[t.length-1]).rowIndex,o=i.columnIndex,r=i.ownerTable.index,s=t.length-1;0<=s;s--)(a=t[s]).rowIndex>n&&(n=a.rowIndex),a.columnIndex>o&&(o=a.columnIndex),a.ownerTable.index>r&&(r=a.ownerTable.index);for(var a,s=0;s<t.length;s++)n==(a=t[s]).rowIndex&&o==a.columnIndex&&r==a.ownerTable.index&&(i=a)}return i instanceof Uai?i:void 0}},u.prototype.getCellFromSelectionInTable=function(e){for(var t,i=this.getSelectedCells(),n=this.getCellBoundsInfo(),o=[],r=[],s=0;s<i.length;s++){var a=i[s];o.push(a.rowIndex),r.push(a.columnIndex)}if(o.sort(),r.sort(),1==e)for(var l=n.row.rowLast,h=n.column.colLast,d=!1;!d&&je(t);){for(s=0;s<i.length;s++){var p=i[s];if(p.rowIndex==l&&p.columnIndex==h){d=!0,t=p;break}}d||--l}else if(0==e){l=n.row.rowFirst,h=n.column.colFirst;for(d=!1;!d&&je(t);){for(s=0;s<i.length;s++){var c=i[s];if(c.rowIndex==l&&c.columnIndex==h){d=!0,t=c;break}}d||(h+=1)}}return t},u.prototype.getActualOffset=function(e,t){var i,n;return 0==t?(n=this.getFirstParagraph(e),i=this.getHierarchicalIndex(n,this.getStartOffset(n).toString())):1==t&&(t=(n=this.getLastParagraph(e)).lastChild,e=this.getParagraphLength(n,t)+this.getLineLength(t)+1,i=this.getHierarchicalIndex(n,e.toString())),i},u.prototype.getBookmarkProperties=function(e){var t=this.selectedWidgets.keys;if(0==e.bookmarkType){if(!(t[0]instanceof Uai))return;var i=this.getCellBoundsInfo();if(!je(i))return{columnFirst:i.column.colFirst.toString(),columnLast:i.column.colLast.toString()}}if(1==e.bookmarkType){if(t[t.length-1]instanceof Uai)return;i={},t=(this.isParagraphMarkSelected()&&this.end.paragraph.isInsideTable&&(i.isAfterParagraphMark=!0),e.reference),e=this.getSelectedCells();if(t&&!je(t.properties)&&1==e.length&&this.isCellSelected(e[0],this.start,this.end)&&(i.isAfterCellMark=!0,delete i.isAfterParagraphMark),this.isTableSelected()&&(i.isAfterTableMark=!0),this.isRowSelected()&&(i.isAfterRowMark=!0),!je(i.isAfterParagraphMark)||!je(i.isAfterCellMark))return i}},u.prototype.isParagraphMarkSelected=function(){var e=this.isForward?this.end:this.start,t=e.currentWidget,t=(t instanceof Gai&&(i=t.paragraph),this.getParagraphLength(i)),i=this.getHierarchicalIndexByPosition(e).split(";");return t<parseInt(i[i.length-1])},u.prototype.isRowSelected=function(){var e=this.start,t=this.end;if(this.isForward||(e=this.end,t=this.start),je(e.paragraph.associatedCell)||je(t.paragraph.associatedCell))return!1;var i,n,o=t.paragraph.associatedCell.ownerRow.getSplitWidgets();if(0<o[0].childWidgets.length){if(0===(n=o[0].childWidgets[0]).childWidgets.length)return;i=n.childWidgets[0]}for(var o=o[o.length-1],r=o.childWidgets[o.childWidgets.length-1];0===r.childWidgets.length&&!je(r.previousSplitWidget);)r=r.previousSplitWidget;return o=r.childWidgets[r.childWidgets.length-1],n.equals(i.associatedCell)&&t.paragraph.associatedCell.equals(o.associatedCell)&&(!i.associatedCell.equals(o.associatedCell)||0===e.offset&&t.offset===this.getLineLength(o.lastChild)+1)},u.prototype.getCellBoundsInfo=function(){var e=this.getSelectedCells();if(0<e.length){for(var t=e[0].columnIndex,i=e[e.length-1].columnIndex,n=e[0].rowIndex,o=e[e.length-1].rowIndex,r=0;r<e.length;r++){var s=e[r];s.columnIndex<t&&(t=s.columnIndex),s.columnIndex>i&&(i=s.columnIndex),s.rowIndex<n&&(n=s.rowIndex),s.rowIndex>o&&(o=s.rowIndex)}return{column:{colFirst:t,colLast:i},row:{rowFirst:n,rowLast:o}}}},u.prototype.hasMergedCells=function(){for(var e=this.getSelectedCells(),t=0;t<e.length;t++){var i=e[t];if(1<i.cellFormat.rowSpan||1<i.cellFormat.columnSpan)return!0}return!1},u.prototype.getParagraphInfoInternal=function(e,t){for(var i=e.paragraph,n=this.getParagraphLength(i,e)+t,o=i.previousSplitWidget;o instanceof Lai;)i=o,n+=this.documentHelper.selection.getParagraphLength(i),o=i.previousSplitWidget;return{paragraph:i,offset:n}},u.prototype.getListTextElementBox=function(e){var t;if(!je(e))return e.isEmpty()||1<(e=e.childWidgets[0]).children.length&&e.children[0]instanceof lhi&&(t=e.children[0]),t},u.prototype.getListLevel=function(e){var t=void 0,i=0;if(je(e.paragraphFormat)||je(e.paragraphFormat.listFormat)||(t=this.documentHelper.getListById(e.paragraphFormat.listFormat.listId),i=e.paragraphFormat.listFormat.listLevelNumber),!je(t)&&!je(this.documentHelper.getAbstractListById(t.abstractListId))&&!je(this.documentHelper.getAbstractListById(t.abstractListId).levels))return this.documentHelper.layout.getListLevel(t,i)},u.prototype.getTextInline=function(e,t,i,n,o){var r,s="";do{if(e===i)return e instanceof pli?je((r=e).text)||""===r.text||(r.text.length<n?s+=r.text:s+=r.text.substring(0,n)):e instanceof rhi&&o&&n===e.length&&(s+=Xai.objectCharacter),s}while((e instanceof pli?s+=e.text:e instanceof rhi&&o?s+=Xai.objectCharacter:e instanceof Zai&&!je(e.fieldEnd)&&(e=je(e.fieldSeparator)?e.fieldEnd:e.fieldSeparator),!je(e.nextNode))&&!je(e=e.nextNode));if(t!==e.line.paragraph){for(var a,l=this.documentHelper.selection.getNextParagraphBlock(e.line.paragraph);!je(l)&&l.isEmpty();){if(s+="\r",l===t)return s;l=this.documentHelper.selection.getNextParagraphBlock(l)}je(l)||l.isEmpty()||(a=l.childWidgets[0],je(l.previousSplitWidget)&&(s+="\r"),s+=this.getTextInline(a.children[0],t,i,n,o))}return s},u.prototype.getFieldCode=function(e,t){var i="";if(!(je(e)||e.fieldEnd instanceof Zai))return i;for(var n=e.paragraph,o=e.fieldEnd.paragraph,r=(e.fieldSeparator instanceof Zai&&(o=e.fieldSeparator.paragraph),e.line.indexInOwner),s=e.indexInOwner;i+=this.getFieldCodeInternal(n,r,s),n!==o&&(s=r=0,(n=this.getNextParagraphBlock(n))instanceof Lai););return t?i:i.trim()},u.prototype.getFieldCodeInternal=function(e,t,i){for(var n="",o=t;o<e.childWidgets.length;o++){for(var r=e.childWidgets[o],s=i;s<r.children.length;s++){var a=r.children[s];if(a instanceof pli&&(n+=a.text),a instanceof Zai&&(2===a.fieldType||1===a.fieldType))return n}i=0}return n},u.prototype.getTocFieldInternal=function(){var e=this.start.paragraph;for(this.isEmpty||this.isForward||(e=this.end.paragraph);e instanceof Lai&&0<e.childWidgets.length;){var t=e.firstChild;if(0<t.children.length){var t=t.children[0],i=t.nextNode;if(t instanceof Zai&&0===t.fieldType&&i instanceof pli&&0===i.text.trim().toLowerCase().indexOf("toc"))return t}e=e.previousRenderedWidget}},u.prototype.getNextParagraph=function(e){if(e.nextRenderedWidget instanceof Sai)return e=e.nextRenderedWidget.childWidgets[0],this.documentHelper.getFirstParagraphBlock(e)},u.prototype.getPreviousParagraph=function(e){if(e.previousRenderedWidget instanceof Sai)return e=(e=e.previousRenderedWidget).childWidgets[e.childWidgets.length-1],this.documentHelper.getLastParagraphBlock(e)},u.prototype.getNextStartInline=function(e,t){var e=e.getInline(t,0),t=e.element,e=e.index;return t=(!je(t)&&e===t.length&&t.nextNode instanceof Zai||t instanceof Xli)&&(e=this.documentHelper.getNextValidElement(t.nextNode))instanceof Zai&&0===e.fieldType?e:t},u.prototype.getPreviousTextInline=function(e){return e.previousNode instanceof pli?e.previousNode:e.previousNode instanceof Zai&&Y.isLinkedFieldCharacter(e.previousNode)?0===e.previousNode.fieldType||1===e.previousNode.fieldType?e.previousNode:e.previousNode.fieldBegin:je(e.previousNode)?void 0:this.getPreviousTextInline(e.previousNode)},u.prototype.getNextTextInline=function(e){return e.nextNode instanceof pli?e.nextNode:e.nextNode instanceof Zai&&Y.isLinkedFieldCharacter(e.nextNode)?1===e.nextNode.fieldType||0===e.nextNode.fieldType?e.nextNode:e.nextNode.fieldEnd:je(e.nextNode)?void 0:this.getNextTextInline(e.nextNode)},u.prototype.getContainerTable=function(e){if((e=e.isInsideTable?e.associatedCell.ownerTable.isInsideTable?this.getContainerTable(e.associatedCell.ownerTable):e.associatedCell.ownerTable:e)instanceof _ai)return e},u.prototype.isElementInSelection=function(e,t){var i=e.line.getOffset(e,t?1:0),n=new rci(this.owner),e=(n.setPositionParagraph(e.line,i),this.start),i=this.end;return this.isForward||(e=this.end,i=this.start),(n.isExistAfter(e)||n.isAtSamePosition(e)&&!t)&&(n.isExistBefore(i)||n.isAtSamePosition(i)&&t)},u.prototype.isSelectionInsideElement=function(e){var t,i,n;return!!this.isEmpty&&(i=e.line.getOffset(e,0),(t=new rci(this.owner)).setPositionParagraph(e.line,i),i=e.line.getOffset(e,e.length),(n=new rci(this.owner)).setPositionParagraph(e.line,i),this.start.isExistAfter(t)||this.start.isAtSamePosition(t))&&(this.start.isExistBefore(n)||this.start.isAtSamePosition(n))},u.prototype.isExistBefore=function(e,t){var i,n,o,r;return e.isInsideTable?(o=e.associatedCell,t.isInsideTable?o===(i=t.associatedCell)?o.childWidgets.indexOf(e)<o.childWidgets.indexOf(t):o.ownerRow===i.ownerRow?o.cellIndex<i.cellIndex:o.ownerTable===i.ownerTable?o.ownerRow.rowIndex<i.ownerRow.rowIndex:(r=this.getContainerCellOf(o,i)).ownerTable.contains(i)?(o=this.getSelectedCell(o,r),i=this.getSelectedCell(i,r),o===r?this.isExistBefore(e,i.ownerTable):i===r?this.isExistBefore(o.ownerTable,t):r.ownerRow===i.ownerRow?r.cellIndex<i.cellIndex:r.ownerTable===i.ownerTable?r.ownerRow.rowIndex<i.ownerRow.rowIndex:this.isExistBefore(o.ownerTable,i.ownerTable)):this.isExistBefore(r.ownerTable,this.getContainerTable(i.ownerTable)):(n=this.getContainerTable(e),this.isExistBefore(n,t))):t.isInsideTable?(n=this.getContainerTable(t),this.isExistBefore(e,n)):e.containerWidget===t.containerWidget?e.index<t.index:e.containerWidget instanceof Sai&&t.containerWidget instanceof Sai&&((o=this.documentHelper.pages.indexOf(e.containerWidget.page))===(r=this.documentHelper.pages.indexOf(t.containerWidget.page))?e.containerWidget.indexInOwner<t.containerWidget.indexInOwner:o===r&&e.containerWidget.containerWidget instanceof Pai&&t.containerWidget.containerWidget instanceof Pai?this.documentHelper.pages[o].footnoteWidget.bodyWidgets.indexOf(e.containerWidget)<this.documentHelper.pages[r].footnoteWidget.bodyWidgets.indexOf(t.containerWidget):o===r&&e.containerWidget.index!==t.containerWidget.index?this.documentHelper.pages[o].bodyWidgets.indexOf(e.containerWidget)<this.documentHelper.pages[r].bodyWidgets.indexOf(t.containerWidget):o<r)},u.prototype.isExistAfter=function(e,t){var i,n,o,r;return e.isInsideTable?(r=e.associatedCell,t.isInsideTable?r===(i=t.associatedCell)?r.childWidgets.indexOf(e)>r.childWidgets.indexOf(t):r.ownerRow===i.ownerRow?r.cellIndex>i.cellIndex:r.ownerTable===i.ownerTable?r.ownerRow.rowIndex>i.ownerRow.rowIndex:(n=this.getContainerCellOf(r,i)).ownerTable.contains(i)?(r=this.getSelectedCell(r,n),i=this.getSelectedCell(i,n),r===n?this.isExistAfter(e,i.ownerTable):i===n?this.isExistAfter(r.ownerTable,t):n.ownerRow===i.ownerRow?n.cellIndex>i.cellIndex:n.ownerTable===i.ownerTable?n.ownerRow.rowIndex>i.ownerRow.rowIndex:this.isExistAfter(r.ownerTable,i.ownerTable)):this.isExistAfter(n.ownerTable,this.getContainerTable(i.ownerTable)):(o=this.getContainerTable(e),this.isExistAfter(o,t))):t.isInsideTable?(o=this.getContainerTable(t),this.isExistAfter(e,o)):e.containerWidget===t.containerWidget?e.index>t.index:(e.containerWidget instanceof Sai&&t.containerWidget instanceof Sai||e.containerWidget instanceof Pai&&t.containerWidget instanceof Pai)&&(r=this.documentHelper.pages.indexOf(e.containerWidget.page),this.documentHelper.pages.indexOf(t.containerWidget.page)<r)},u.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);e=e.line.paragraph,t=t.line.paragraph;if(e.containerWidget===t.containerWidget){if(e.isInsideTable)return e.associatedCell.childWidgets.indexOf(e)<t.associatedCell.childWidgets.indexOf(t);if(!(e.containerWidget instanceof Iai))return e.containerWidget.childWidgets.indexOf(e)<t.containerWidget.childWidgets.indexOf(t)}return this.isExistBefore(e,t)},u.prototype.isExistAfterInline=function(e,t,i){if(e.line===t.line)return n=this.documentHelper.selection,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 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 Iai))return i.containerWidget.childWidgets.indexOf(i)>n.containerWidget.childWidgets.indexOf(n)}return this.isExistAfter(i,n)},u.prototype.getNextRenderedBlock=function(e){return je(e.nextWidget)?e.nextRenderedWidget:e.nextWidget},u.prototype.getPreviousRenderedBlock=function(e){return je(e.previousWidget)?e.previousRenderedWidget:e.previousWidget},u.prototype.getNextParagraphBlock=function(e){return e.nextRenderedWidget instanceof Lai?e.nextRenderedWidget:e.nextRenderedWidget instanceof _ai?this.documentHelper.getFirstParagraphInFirstCell(e.nextRenderedWidget):e.containerWidget instanceof Uai?this.getNextParagraphCell(e.containerWidget):e.containerWidget instanceof Sai?(e.containerWidget,this.getNextParagraph(e.containerWidget)):e.containerWidget instanceof Iai&&this.isMoveDownOrMoveUp?this.getFirstBlockInNextHeaderFooter(e):void 0},u.prototype.getFirstBlockInNextHeaderFooter=function(e){var t,e=e.containerWidget;if(-1!==e.headerFooterType.indexOf("Header"))t=e.page.footerWidget.firstChild;else{if(!e.page.nextPage)return;var e=e.page.nextPage,i=e.headerWidget;(i.page=e).footerWidget&&(e.footerWidget.page=e),t=i.firstChild}return t instanceof Lai?t:this.getFirstBlockInFirstCell(t)},u.prototype.getLastBlockInPreviousHeaderFooter=function(e){var t,e=e.containerWidget;if(-1!==e.headerFooterType.indexOf("Footer"))t=e.page.headerWidget.lastChild;else{if(!e.page.previousPage)return;var e=e.page.previousPage,i=e.footerWidget;(i.page=e).headerWidget&&(e.headerWidget.page=e),t=i.lastChild}return t instanceof Lai?t:this.getFirstBlockInFirstCell(t)},u.prototype.getPreviousParagraphBlock=function(e,t){return e.previousRenderedWidget instanceof Lai?e.previousRenderedWidget:e.previousRenderedWidget instanceof _ai?this.documentHelper.getLastParagraphInLastCell(e.previousRenderedWidget):e.containerWidget instanceof Uai?this.getPreviousParagraphCell(e.containerWidget):e.containerWidget instanceof Sai?this.getPreviousParagraph(e.containerWidget):e.containerWidget instanceof Iai&&this.isMoveDownOrMoveUp&&!t?this.getLastBlockInPreviousHeaderFooter(e):void 0},u.prototype.hasValidInline=function(e,t,i){for(var n=e.childWidgets.indexOf(t.line);n<e.childWidgets.length;n++)for(var o=0;o<e.childWidgets[n].children.length;o++){var r=e.childWidgets[n].children[o];if(0!==r.length){if(r===i)return!1;if(r instanceof pli||r instanceof rhi||r instanceof Zai&&Y.isLinkedFieldCharacter(r))return!0}}return!1},u.prototype.getParagraphLength=function(e,t,i,n){var o=0;if(!je(e))for(var r=0;r<e.childWidgets.length;r++){var s=e.childWidgets[r];if(t instanceof Gai&&t===s){i&&(o+=this.getLineLength(s,i,n));break}o+=this.getLineLength(s,void 0,n)}return o},u.prototype.getLineLength=function(e,t,i){for(var n=0,o=e.paragraph.bidi,r=o?e.children.length-1:0;o?-1<r:r<e.children.length;o?r--:r++){var s=e.children[r];if(!(s instanceof lhi)){if(i)if(s instanceof Xli)for(var a=0;a<s.textFrame.childWidgets.length;a++){var l=s.textFrame.childWidgets[a];n+=this.getParagraphLength(l)+1}else if(s instanceof fli)for(a=0;a<s.bodyWidget.childWidgets.length;a++){l=s.bodyWidget.childWidgets[a];n+=this.getParagraphLength(l)+1}if(t&&t.element instanceof Xai&&t.element===s){n+=t.index;break}n+=s.length}}return n},u.prototype.getLineInfo=function(e,t){for(var i,n=void 0,o=e.childWidgets.length,r=0;r<o&&(n=e.childWidgets[r],!(t<=(i=this.getLineLength(n))||r===o-1));r++)t-=i;return{line:n,offset:t}},u.prototype.getElementInfo=function(e,t){for(var i=void 0,n=0;n<e.children.length;n++)if(!((i=e.children[n])instanceof lhi)){if(!(t>i.length)||t===i.length+1&&je(i.nextNode))break;t-=i.length}return{element:i,index:t}},u.prototype.getStartOffset=function(e){return 0<e.childWidgets.length?(e=e.childWidgets[0],this.getStartLineOffset(e)):0},u.prototype.getStartLineOffset=function(e){for(var t=0,i=!0,n=0;n<e.children.length;n++){var o=e.children[n];if(0!==o.length)if(o instanceof Xai&&o.characterFormat.hidden)t+=o.length,i&&(t+=1,i=!1);else{if(o instanceof pli||o instanceof rhi||o instanceof Dli||o instanceof Xli||o instanceof ghi||o instanceof phi||o instanceof Khi||o instanceof Zai&&Y.isLinkedFieldCharacter(o)||o instanceof Pli)return t;o instanceof lhi||(t+=o.length)}}return t},u.prototype.getPreviousSelectionCell=function(e){var t;return je(e.previousRenderedWidget)?this.getPreviousSelectionRow(e.ownerRow):this.isForward?(t=(t=e.previousRenderedWidget.childWidgets)[t.length-1])instanceof Lai?t:this.getPreviousParagraphSelection(t.childWidgets[t.childWidgets.length-1]):(t=e.previousRenderedWidget.childWidgets[0])instanceof Lai?t:this.documentHelper.getFirstParagraphInLastRow(t)},u.prototype.getPreviousSelectionRow=function(e){return je(e.previousRenderedWidget)?this.getPreviousSelectionBlock(e.ownerTable):this.isForward?this.getPreviousParagraphSelection(e.previousRenderedWidget):(e=e.previousRenderedWidget.childWidgets[0].childWidgets[0],this.documentHelper.getFirstParagraphBlock(e))},u.prototype.getNextSelectionBlock=function(e){return e.nextRenderedWidget instanceof Lai?e.nextRenderedWidget:e.nextRenderedWidget instanceof _ai?this.isEmpty||this.isForward?this.documentHelper.getLastParagraphInFirstRow(e.nextRenderedWidget):this.getNextParagraphSelection(e.nextRenderedWidget.childWidgets[0]):e.containerWidget instanceof Uai?this.getNextSelectionCell(e.containerWidget):e.containerWidget instanceof Sai?this.getNextSelection(e.containerWidget):void 0},u.prototype.getNextSelectionCell=function(e){var t;return je(e.nextRenderedWidget)?this.getNextSelectionRow(e.ownerRow):this.isEmpty||this.isForward?(t=e.nextRenderedWidget.childWidgets[e.nextRenderedWidget.childWidgets.length-1],this.documentHelper.getLastParagraphBlock(t)):(t=e.nextRenderedWidget.childWidgets[0])instanceof Lai?t:this.getNextParagraphSelection(t.childWidgets[0])},u.prototype.getNextSelectionRow=function(e){var t;return je(e.nextRenderedWidget)?this.getNextSelectionBlock(e.ownerTable):this.isEmpty||this.isForward?(t=(t=e.nextRenderedWidget.childWidgets[e.nextRenderedWidget.childWidgets.length-1]).childWidgets[t.childWidgets.length-1],this.documentHelper.getLastParagraphBlock(t)):this.getNextParagraphSelection(e.nextRenderedWidget)},u.prototype.getNextSelection=function(e){if(e.nextRenderedWidget instanceof Sai)return(e=e.nextRenderedWidget.childWidgets[0])instanceof Lai?e:this.isEmpty||this.isForward?this.documentHelper.getLastParagraphInFirstRow(e):this.getNextParagraphSelection(e.childWidgets[0])},u.prototype.getNextParagraphSelection=function(e){var t,i=e.childWidgets[0],e=(this.start.paragraph.isInsideTable&&e.ownerTable.contains(this.start.paragraph.associatedCell)&&(t=this.getCellInTable(e.ownerTable,this.start.paragraph.associatedCell),i=this.getFirstCellInRegion(e,t,this.upDownSelectionLength,!1)),i.childWidgets[0]);return this.documentHelper.getFirstParagraphBlock(e)},u.prototype.getPreviousSelectionBlock=function(e){return e.previousRenderedWidget instanceof Lai?e.previousRenderedWidget:e.previousRenderedWidget instanceof _ai?this.isForward?this.getPreviousParagraphSelection(e.previousRenderedWidget.childWidgets[e.previousRenderedWidget.childWidgets.length-1]):this.documentHelper.getFirstParagraphInLastRow(e.previousRenderedWidget):e.containerWidget instanceof Uai?this.getPreviousSelectionCell(e.containerWidget):e.containerWidget instanceof Sai?this.getPreviousSelection(e.containerWidget):void 0},u.prototype.getPreviousSelection=function(e){if(e.previousRenderedWidget instanceof Sai)return(e=(e=e.previousRenderedWidget).childWidgets[e.childWidgets.length-1])instanceof Lai?e:this.isForward?this.getPreviousParagraphSelection(e.childWidgets[e.childWidgets.length-1]):this.documentHelper.getFirstParagraphInLastRow(e)},u.prototype.getPreviousParagraphSelection=function(e){var t,i=e.childWidgets[e.childWidgets.length-1],e=(this.start.paragraph.isInsideTable&&e.ownerTable.contains(this.start.paragraph.associatedCell)&&(t=this.getCellInTable(e.ownerTable,this.start.paragraph.associatedCell),i=this.getLastCellInRegion(e,t,this.upDownSelectionLength,!0)),i.childWidgets[i.childWidgets.length-1]);return this.documentHelper.getLastParagraphBlock(e)},u.prototype.getLastCellInRegion=function(e,t,i,n){var o=this.getCellLeft(e,t),r=o+t.cellFormat.cellWidth,s=!0;if(o<=i&&i<r)for(var a=e.childWidgets.length-1;0<=a;a--){var l=this.getCellLeft(e,e.childWidgets[a]);if(Y.round(o,2)<=Y.round(l,2)&&Y.round(l,2)<Y.round(r,2))return s=!1,e.childWidgets[a]}else for(a=e.childWidgets.length-1;0<=a;a--)if((l=this.getCellLeft(e,e.childWidgets[a]))<=i&&l+e.childWidgets[a].width>i)return s=!1,e.childWidgets[a];if(s){if(!je(e.previousRenderedWidget)&&n)return this.getLastCellInRegion(e.previousRenderedWidget,t,i,n);if(!je(e.nextRenderedWidget)&&!n)return this.getLastCellInRegion(e.nextRenderedWidget,t,i,n)}return e.childWidgets[e.childWidgets.length-1]},u.prototype.getCellInTable=function(e,t){for(;t.ownerTable.isInsideTable;){if(e.equals(t.ownerTable))return t;t=t.ownerTable.associatedCell}return t},u.prototype.getPreviousValidOffset=function(e,t){if(0===t)return 0;for(var i=0,n=0,o=0,r=0;r<e.children.length;r++){var s=e.children[r];if(!(0===s.length||s instanceof lhi)){if(s.characterFormat.hidden)o+=s.length;else{if(o=0,t<=n+s.length)return t-1===n?i:t-1;(s instanceof pli||s instanceof Pli||s instanceof rhi||s instanceof Khi||s instanceof Dli||s instanceof Zai&&Y.isLinkedFieldCharacter(s))&&(i=n+s.length)}n+=s.length}}return t-1===n?i:0<o?t-(o+1):t-1},u.prototype.getNextValidOffset=function(e,t){for(var i=0,n=0;n<e.children.length;n++){var o=e.children[n];if(!(0===o.length||o instanceof lhi)){if(!o.characterFormat.hidden){if(t<i+o.length&&(o instanceof pli||o instanceof Pli||o instanceof rhi||o instanceof Zai&&Y.isLinkedFieldCharacter(o)))return(i<t?t:i)+1;if(t===i+o.length&&o instanceof Zai&&1===o.fieldType&&o.previousNode instanceof rhi)return t}i+=o.length}}return t},u.prototype.getParagraphMarkSize=function(e,t,i){var n,o,r=this.documentHelper.textHelper.getParagraphMarkSize(e.characterFormat),s=r.BaselineOffset,a=r.Height,l=s;return e instanceof Lai&&(0<e.childWidgets.length&&e.childWidgets[0],n=this.documentHelper.layout.getLineSpacing(e,a),o=this.documentHelper.layout.getBeforeSpacing(e),t=l-s,i=a-l-(r.Height-s),"Multiple"===(l=e.paragraphFormat.lineSpacingType)?a<n?i+=n-a:t+=n-a:("Exactly"===l||n>t+r.Height+i)&&(t+=n-(t+r.Height+i)),t+=o,i+=this.documentHelper.layout.getAfterSpacing(e)),{width:r.Width,height:r.Height,topMargin:t,bottomMargin:i}},u.prototype.getPhysicalPositionInternal=function(e,t,i){var n,o,r;return e.paragraph.isEmpty()?(r=(n=e.paragraph).x,0<n.childWidgets.length&&(o=n.childWidgets[0],r=this.getLeft(o)),o=this.getParagraphMarkSize(e.paragraph,0,0),(0<t||0===t&&n.isEmpty()&&n.bidi)&&(r+=o.width),new kri(r,n.y+o.topMargin)):(o=(n=e.getInline(t,r=0,e.paragraph.bidi)).element,r=n.index,this.getPhysicalPositionInline(o,r,i))},u.prototype.highlightSelectedContent=function(e,t){var i,n,o,r,s,a;e.paragraph.isInsideTable&&(!t.paragraph.isInsideTable||!e.paragraph.associatedCell.equals(t.paragraph.associatedCell)||!this.documentHelper.isSelectionChangedOnMouseMoved&&this.isCellSelected(e.paragraph.associatedCell,e,t)||this.isCellPrevSelected)?(this.highlightCell(e.paragraph.associatedCell,this,e,t),this.isCellPrevSelected=!0):(i=void 0,n=0,this.owner.isReadOnlyMode||e.paragraph!==t.paragraph||(e.offset+1===t.offset?(i=(s=t.currentWidget.getInline(t.offset,n)).element,n=s.index,(i instanceof rhi||i instanceof Xli)&&e.currentWidget.getOffset(i,0)!==e.offset&&(i=void 0)):(a=(r=e.currentWidget.getInline(e.offset,s=0)).element,(s=r.index)===a.length&&(a=this.getNextRenderedElementBox(a,s)),o=(r=t.currentWidget.getInline(t.offset,s)).element,s=r.index,a instanceof Zai&&o instanceof Zai&&!je(a.fieldSeparator)&&(r=a.fieldSeparator.nextNode)instanceof rhi&&r.nextNode===o&&(i=r))),!this.owner.isReadOnlyMode&&this.owner.isDocumentLoaded&&(i instanceof rhi||i instanceof Xli)?(a=(s=this.getElementBoxInternal(i,n)).element,n=s.index,this.owner.enableImageResizerMode&&!this.owner.editorModule.isRemoteAction&&(this.owner.imageResizerModule.positionImageResizer(a),this.owner.imageResizerModule.showImageResizer()),this.documentHelper.isTouchInput&&(this.documentHelper.touchStart.style.display="none",this.documentHelper.touchEnd.style.display="none")):(e.paragraph.isInsideTable&&e.paragraph.associatedCell.equals(t.paragraph.associatedCell)&&t.paragraph.equals(this.getLastParagraph(t.paragraph.associatedCell))&&this.getParagraphLength(t.paragraph)+1==t.offset&&t.offset--,this.highlight(e.paragraph,e,t),this.isHighlightNext&&(this.hightLightNextParagraph===e.paragraph&&this.highlightNextBlock(this.hightLightNextParagraph,e,t),this.isHighlightNext=!1,this.hightLightNextParagraph=void 0)),this.isInShape&&this.showResizerForShape())},u.prototype.showResizerForShape=function(){var e=this.getCurrentTextFrame().containerShape;this.owner.imageResizerModule.positionImageResizer(e),this.owner.imageResizerModule.showImageResizer()},u.prototype.highlight=function(e,t,i,n){var o,r,s=void 0,a=void 0,t=this.getStartLineWidget(e,t,void 0,0),s=je(o=t.element)?e.childWidgets[0]:o.line,l=t.index,t=this.getEndLineWidget(i,void 0,0),a=(r=t.element)?r.line:i.paragraph.childWidgets[i.paragraph.childWidgets.length-1],h=t.index,d=0,p=0;if(je(s)||(d=this.getTop(s),p=this.getLeftInternal(s,o,l)),je(s)||s!==a){if(!je(s)){s.paragraph.x;g=(e!==s.paragraph&&(e=s.paragraph),this.getWidth(s,!0)-(p-s.paragraph.x));if(e.bidi||o instanceof pli&&o.isRightToLeft){var c=0,u=this.getElementsForward(s,o,r,e.bidi);if(u){for(v=!1,f=0;f<u.length;f++){b=(v=!1,p=(y=u[f])===o?this.getLeftInternal(s,y,l):this.getLeftInternal(s,y,0),y instanceof pli?y.length:1);c=this.getLeftInternal(s,y,b),y instanceof pli&&(v=y.isRightToLeft),g=Math.abs(c-p),this.createHighlightBorder(s,g,v?c:p,d,!0,n)}s.isLastLine()&&(w=u[u.length-1].line.paragraph.characterFormat,C=this.documentHelper.textHelper.getParagraphMarkSize(w).Width,p=e.bidi?this.getLineStartLeft(s)-C:v?s.paragraph.x+this.getWidth(s,!1):c,this.createHighlightBorder(s,C,p,d,!0,n))}else this.createHighlightBorder(s,g,p,d,!1,n)}else this.createHighlightBorder(s,g,p,d,!1,n);t=s.paragraph.childWidgets.indexOf(s);if(this.highlightParagraph(e,t+1,a,r,h,n),-1!==e.childWidgets.indexOf(i.currentWidget))return}this.isHideSelection(e)?this.isHighlightNext=!1:(this.isHighlightNext=!0,this.hightLightNextParagraph=e)}else{var c=this.getLeftInternal(a,r,h),g=0,t=!1;if(!(t=r instanceof pli?r.isRightToLeft:t)&&o instanceof pli&&(t=o.isRightToLeft),g=Math.abs(c-p),t||e.bidi){var m=this.getElementsForward(s,o,r,e.bidi);if(m&&1<m.length)for(var f=0;f<m.length;f++){var y,v=!1,b=(y=m[f])instanceof pli?y.length:1;if(c=y===o?(p=this.getLeftInternal(s,y,l),this.getLeftInternal(s,y,b)):y===r?(p=this.getLeftInternal(s,y,0),this.getLeftInternal(s,y,h)):(p=this.getLeftInternal(s,y,0),this.getLeftInternal(s,y,b)),y instanceof pli&&(v=y.isRightToLeft),g=Math.abs(c-p),y===r&&y instanceof pli&&h>y.length){var w=y.line.paragraph.characterFormat,C=this.documentHelper.textHelper.getParagraphMarkSize(w).Width;if(e.bidi&&!v){g-=C,this.createHighlightBorder(s,g,p,d,!0,n),p=this.getLineStartLeft(s)-C,this.createHighlightBorder(s,C,p,d,!0,n);continue}}this.createHighlightBorder(s,g,v?c:p,d,!0,n)}else r instanceof pli&&h>r.length?(w=r.line.paragraph.characterFormat,C=this.documentHelper.textHelper.getParagraphMarkSize(w).Width,!e.bidi&&t?(this.createHighlightBorder(s,g-=C,c+=C,d,!0,n),c+=r.width,this.createHighlightBorder(s,C,c,d,!0,n)):e.bidi&&!t?(this.createHighlightBorder(s,g-=C,p,d,!0,n),p=this.getLineStartLeft(s)-C,this.createHighlightBorder(s,C,p,d,!0,n)):this.createHighlightBorder(s,g,t?c:p,d,!1,n)):this.createHighlightBorder(s,g,t?c:p,d,!1,n)}else this.createHighlightBorder(s,g,e.bidi?c:p,d,!1,n)}},u.prototype.highlightNextBlock=function(e,t,i){e=e.nextRenderedWidget;je(e)||(e instanceof Lai?(this.isHighlightNext=!1,this.highlight(e,t,i),this.isHighlightNext&&(this.highlightNextBlock(this.hightLightNextParagraph,t,i),this.isHighlightNext=!1,this.hightLightNextParagraph=void 0)):this.highlightTable(e,t,i))},u.prototype.getStartLineWidget=function(e,t,i,n){var o=e===t.paragraph?t.offset:this.getStartOffset(e),r=void 0;return i=(r=(e===t.paragraph?t.currentWidget:e.firstChild).getInline(o,n)).element,n=r.index,i instanceof Zai&&(i=(e=this.getRenderedInline(i,n)).element,n=e.index),o===this.getParagraphLength(t.paragraph)+1&&n++,{index:n,element:i}},u.prototype.getEndLineWidget=function(e,t,i){var n=e.currentWidget.getInline(e.offset,i);return t=n.element,i=n.index,t instanceof Zai&&(t=(n=this.getRenderedInline(t,i)).element,i=n.index),{index:i=e.paragraph.childWidgets.indexOf(e.currentWidget)===e.paragraph.childWidgets.length-1&&e.offset===this.getLineLength(e.currentWidget)+1?t?t.length+1:1:i,element:t}},u.prototype.getLineWidgetInternal=function(e,t,i){var n;return 0===e.children.length&&e instanceof Gai?e:(n=(t=e.getInline(t,e=0)).element,e=t.index,n instanceof Xai?n.line:this.getLineWidgetInternalInline(n,e,i))},u.prototype.getLineWidgetParagraph=function(e,t){var i;return 0===t.children.length?t:(i=(e=t.getInline(e,t=0)).element,t=e.index,this.getLineWidget(i,t))},u.prototype.highlightCells=function(e,t,i){var n=this.getCellLeft(t.ownerRow,t),o=n+t.cellFormat.cellWidth,r=this.getCellLeft(i.ownerRow,i),s=r+i.cellFormat.cellWidth,a=((n=r<n?r:n)>this.upDownSelectionLength&&(n=this.upDownSelectionLength),(o=o<s?s:o)<this.upDownSelectionLength&&(o=this.upDownSelectionLength),e.getSplitWidgets()),l=a.indexOf(t.ownerRow.ownerTable),h=a.indexOf(i.ownerRow.ownerTable);if(l===h)for(var d=e.childWidgets.indexOf(i.ownerRow),p=e.childWidgets.indexOf(t.ownerRow);p<=d;p++)this.highlightRow(e.childWidgets[p],n,o);else for(var c=0,u=0,p=l;p<=h;p++){e=a[p];for(var c=p===l?e.childWidgets.indexOf(t.ownerRow):0,u=p===h?e.childWidgets.indexOf(i.ownerRow):e.childWidgets.length-1,g=c;g<=u;g++)this.highlightRow(e.childWidgets[g],n,o)}},u.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)},u.prototype.getCellLeft=function(e,t){var i=0;return i+=t.x-t.margin.left},u.prototype.getNextParagraphRow=function(e){var t;return je(e.nextRenderedWidget)?this.getNextParagraphBlock(e.ownerTable):je(t=(e=e.nextRenderedWidget.childWidgets[0]).childWidgets[0])?this.getNextParagraphCell(e):this.documentHelper.getFirstParagraphBlock(t)},u.prototype.getPreviousParagraphRow=function(e){return je(e.previousRenderedWidget)?this.getPreviousParagraphBlock(e.ownerTable):(e=(e=e.previousRenderedWidget.lastChild).lastChild||e.previousSplitWidget.lastChild,this.documentHelper.getLastParagraphBlock(e))},u.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)},u.prototype.highlightRow=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++){var o=this.getCellLeft(e,e.childWidgets[n]);Y.round(t,2)<=Y.round(o,2)&&Y.round(o,2)<Y.round(i,2)&&this.highlightCellWidget(e.childWidgets[n])}},u.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 jai&&this.highlightInternal(e.nextRenderedWidget,t,i)},u.prototype.getLastParagraph=function(e){for(;e.nextSplitWidget&&0<e.nextSplitWidget.childWidgets.length;)e=e.nextSplitWidget;var t=(0<e.childWidgets.length?e:e.previousSplitWidget).lastChild;return this.documentHelper.getLastParagraphBlock(t)},u.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},u.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)},u.prototype.getContainerCellOf=function(e,t){for(;e.ownerTable.isInsideTable;){if(e.ownerTable.contains(t))return e;e=e.ownerTable.associatedCell}return e},u.prototype.getSelectedCell=function(e,t){if(!e.ownerTable.equals(t.ownerTable))for(;e.ownerTable.isInsideTable;){if(e.ownerTable.associatedCell.equals(t))return e;e=e.ownerTable.associatedCell}return e},u.prototype.getSelectedCells=function(){for(var e=[],t=0;t<this.selectedWidgets.keys.length;t++){var i=this.selectedWidgets.keys[t];i instanceof Uai&&e.push(i)}return e},u.prototype.getLevelFormatNumber=function(){return"%"+((this.paragraphFormat.listLevelNumber<=0?0:this.paragraphFormat.listLevelNumber)+1)+"."},u.prototype.getNextParagraphCell=function(e){var t;return e.nextRenderedWidget&&e.nextRenderedWidget instanceof Uai?e.ownerRow.index===e.nextRenderedWidget.rowIndex?(t=(e=(e=e.nextRenderedWidget).getSplitWidgets()[0]instanceof Uai?e.getSplitWidgets()[0]:e).firstChild)?this.documentHelper.getFirstParagraphBlock(t):this.getNextParagraphCell(e):(e=e.nextRenderedWidget,this.getNextParagraphCell(e)):(e.nextSplitWidget&&0===e.nextSplitWidget.childWidgets.length&&(e=e.getSplitWidgets().pop()),this.getNextParagraphRow(e.containerWidget))},u.prototype.getPreviousParagraphCell=function(e){var t;return!je(e.previousRenderedWidget)&&e.previousRenderedWidget instanceof Uai?(t=(e=e.previousRenderedWidget).lastChild,this.documentHelper.getLastParagraphBlock(t)):this.getPreviousParagraphRow(e.ownerRow)},u.prototype.getContainerCell=function(e){for(;!je(e.ownerTable)&&e.ownerTable.isInsideTable;)e=e.ownerTable.associatedCell;return e},u.prototype.highlightCell=function(e,t,i,n){if(n.paragraph.isInsideTable){var o=this.getContainerCellOf(e,n.paragraph.associatedCell);if(o.ownerTable.contains(n.paragraph.associatedCell)){var r=this.getSelectedCell(e,o),s=this.getSelectedCell(n.paragraph.associatedCell,o);if(this.containsCell(o,n.paragraph.associatedCell))this.isCellSelected(o,i,n)?this.highlightCellWidget(o):r===o?(this.highlight(i.paragraph,i,n),this.isHighlightNext&&(this.highlightNextBlock(this.hightLightNextParagraph,i,n),this.isHighlightNext=!1,this.hightLightNextParagraph=void 0)):this.highlightContainer(r,i,n);else if(this.highlightCellWidget(o),o.ownerRow.equals(s.ownerRow))for(r=o;!je(r.nextRenderedWidget)&&(r=r.nextRenderedWidget,this.highlightCellWidget(r),r!==s););else this.highlightCells(o.ownerTable,o,s)}else this.highlightContainer(o,i,n)}else{o=this.getContainerCell(e);this.highlightContainer(o,i,n)}},u.prototype.highlightContainer=function(e,t,i){this.highlightInternal(e.containerWidget,t,i),this.highlightNextBlock(e.ownerTable.getSplitWidgets().pop(),t,i)},u.prototype.getPreviousValidElement=function(e){var t=void 0;if(this.documentHelper.isFormFillProtectedMode&&2===e.fieldType)return e;for(;e instanceof Zai;)Y.isLinkedFieldCharacter(e)&&(e instanceof Zai&&0===e.fieldType?t=e:e instanceof Zai&&1===e.fieldType&&!je((t=e).fieldSeparator)||(t=e=e.fieldBegin)),e=e.previousNode;return je(t)?e:t},u.prototype.validateTextPosition=function(e,t){var i=e.nextNode;return e.length===t&&(i instanceof Zai||!(e instanceof rhi)&&(i instanceof Dli||i instanceof Khi))?((i=this.documentHelper.getNextValidElement(e.nextNode))instanceof Zai&&1===i.fieldType||i instanceof Dli&&1===i.bookmarkType||i instanceof Khi&&1===i.commentType)&&(e=i,t=this.documentHelper.isFormFillProtectedMode?0:1):0===t&&e.previousNode instanceof Zai&&(t=(e=this.getPreviousValidElement(e.previousNode))instanceof Zai?0:e.length,e instanceof Zai)&&1===e.fieldType&&t++,{element:e,index:t}},u.prototype.getPhysicalPositionInline=function(e,t,i){var n=void 0,o=void 0;if(je(n=this.getElementBox(e,t,i).element)||je(n.line)){if(!(e instanceof Zai&&1===e.fieldType))return e instanceof Zai||e instanceof Dli||e instanceof Khi||e instanceof Pli?this.getFieldCharacterPosition(e):new kri(0,0);n=e}var r,s,i=n.margin,a=0;return n instanceof pli&&"\v"===n.text&&je(e.nextNode)&&!this.owner.editorModule.handledEnter?(o=this.getNextLineWidget(n.line.paragraph,n),t=0):o=n.line,a=this.getTop(o),n instanceof rhi&&"Inline"===n.textWrappingStyle?(r=n.line.paragraph.characterFormat,je(s=this.getPreviousTextElement(e))?je(e=this.getNextTextElement(e))||(r=e.characterFormat):r=s.characterFormat,e=this.documentHelper.textHelper.getHeight(r),0<n.margin.top+n.height-e.BaselineOffset&&(a+=n.margin.top+n.height-e.BaselineOffset)):n instanceof Zai||(a+=0<i.top?i.top:0),s=je(n)||je(o)?0:this.getLeftInternal(o,n,t),new kri(s,a)},u.prototype.getFieldCharacterPosition=function(e){var t=this.documentHelper.getNextValidElementForField(e);return je(t)?(e=e.line.paragraph,this.getEndPosition(e)):this.getPhysicalPositionInline(t,0,!0)},u.prototype.isRenderBookmarkAtEnd=function(e){var t,i=1==e.bookmarkType?e.reference:e;return!(!i||!je(i.properties)||je(t=i.reference?i.reference.paragraph.associatedCell:void 0)||je(i=(i=i.reference?i.reference.paragraph.associatedCell.ownerRow:void 0)?i.childWidgets[i.childWidgets.length-1]:void 0)||t!=i||1===e.bookmarkType&&!je(e.line)&&e.line.children.indexOf(e)!==e.line.children.length-1)},u.prototype.getEndPosition=function(e){var t=e.x,i=e.y,n=void 0,n=(0<e.childWidgets.length&&(n=e.childWidgets[e.childWidgets.length-1],e.paragraphFormat.bidi?t=this.getLeft(n):t+=this.getWidth(n,!1)),je(n)||(i=this.getTop(n)),this.getParagraphMarkSize(e,0,0));return new kri(t,i+n.topMargin)},u.prototype.getElementBox=function(e,t,i){var n=void 0;return{element:n=e instanceof Zai||e instanceof Dli||e instanceof Khi||e instanceof Pli?n:e,index:t}},u.prototype.getPreviousTextElement=function(e){return e.previousNode instanceof pli?e.previousNode:je(e.previousNode)?void 0:this.getPreviousTextElement(e.previousNode)},u.prototype.getNextTextElement=function(e){return e.nextNode instanceof pli?e.nextNode:je(e.nextNode)?void 0:this.getNextTextElement(e.nextNode)},u.prototype.getNextRenderedElementBox=function(e,t){if(e instanceof Zai){var i=e;if(0===i.fieldType&&i===(e=this.getRenderedField(i)))return i;t=1}for(;!je(e)&&t===e.length&&e.nextNode instanceof Zai;){var n=this.documentHelper.getNextValidElement(e.nextNode);if(n instanceof Zai&&0===n.fieldType){i=n;if(!je(e=this.getRenderedField(i))&&i===e)return i;t=1}else e=n}return e},u.prototype.getElementBoxInternal=function(e,t){return{element:e,index:t}},u.prototype.getLineWidget=function(e,t){return this.getLineWidgetInternalInline(e,t,!0)},u.prototype.getLineWidgetInternalInline=function(e,t,i){var n,o=this.getElementBox(e,t,i),r=o.element;return t=o.index,je(r)?je(e=this.documentHelper.getNextValidElementForField(o=e))?(n=void 0,0<(o=o.line.paragraph).childWidgets.length?o.childWidgets[o.childWidgets.length-1]:n):this.getLineWidget(e,0):i&&r instanceof pli&&"\v"===r.text&&1===t?this.getNextLineWidget(r.line.paragraph,r):r.line},u.prototype.getNextLineWidget=function(e,t){var i,n=void 0,o=e;return 0<o.childWidgets.length&&((i=o.childWidgets.indexOf(t.line))===o.childWidgets.length-1?(o=e,i=-1):i>o.childWidgets.length-1?(o=this.getNextParagraphBlock(e),i=-1):i<0&&(i=(o=e).childWidgets.indexOf(t.line)),n=o.childWidgets[i+1]),n},u.prototype.getCaretHeight=function(e,t,i,n,o,r){var t=this.getElementBox(e,t,!1).element,s=e;if(je(t))return s instanceof Zai?this.getFieldCharacterHeight(s,i,n,o,r):{height:this.documentHelper.textHelper.getHeight(i).Height,topMargin:o,isItalic:r};var s=t.margin,a=t.height,l=0;if(t instanceof rhi){var h=this.getPreviousTextElement(e),d=this.getNextTextElement(e);if(je(h)&&je(d)){var e=e.line.paragraph,p=this.getParagraphMarkSize(e,0,0),l=(p.topMargin,p.bottomMargin,p.height);r=e.characterFormat.italic,n||(l+=this.documentHelper.layout.getAfterSpacing(e))}else{if(je(h))return r=d.characterFormat.italic,this.getCaretHeight(d,0,d.characterFormat,n,o,r);if(je(d)||!(t instanceof rhi))return r=h.characterFormat.italic,this.getCaretHeight(h,h.length,h.characterFormat,n,o,r);var p=this.documentHelper.textHelper.getHeight(t.characterFormat),e=p.Height,d=p.BaselineOffset;l=t.margin.top<0&&d>t.margin.top+t.height?t.margin.top+t.height+e-d:e,n||(l+=t.margin.bottom)}}else{h=this.characterFormat.baselineAlignment,p=a;"Normal"!==h&&n&&(p/=1.5,"Subscript"===h)&&(o=a-p),l=(s.top<0?s.top:0)+p,n||(l+=s.bottom)}return n?{height:d=l<(d=this.documentHelper.textHelper.getHeight(i).Height)?l:d,topMargin:o,isItalic:r}:{height:l,topMargin:o,isItalic:r}},u.prototype.getFieldCharacterHeight=function(e,t,i,n,o){var r,s,a,l=this.documentHelper.getNextValidElementForField(e);return je(l)?(e=e.line.paragraph,r=this.documentHelper.textHelper.getParagraphMarkSize(t).Height,a=(s=this.getParagraphMarkSize(e,e=0,0)).height,s.topMargin,e=s.bottomMargin,i?{height:r=a<r?a:r,topMargin:n,isItalic:o}:{height:a+=e,topMargin:n,isItalic:o}):this.getCaretHeight(l,0,t,i,n,o)},u.prototype.getRenderedInline=function(e,t){if(this.documentHelper.isFormFillProtectedMode&&2===e.fieldType)return{element:e,index:t};for(var i=this.getPreviousValidElement(e);i instanceof Zai;)(i=this.getPreviousTextElement(i))instanceof Zai&&(i=i.previousNode);if(!je(i))return{element:i,index:t=i.length};var n=this.getNextRenderedElementBox(e,t=0);if(n instanceof Zai&&0===n.fieldType)for(n=(n=n.fieldSeparator).nextNode;n instanceof Zai;)n=(n=n instanceof Zai&&0===n.fieldType&&Y.isLinkedFieldCharacter(n)?je(n.fieldSeparator)?n.fieldEnd:n.fieldSeparator:n).nextNode;return{element:n,index:t}},u.prototype.getRenderedField=function(e){var t=e;if(!je(e.fieldSeparator)){var i=(t=e.fieldSeparator).line.paragraph;if(i!==e.fieldEnd.line.paragraph||this.hasValidInline(i,t,e.fieldEnd))return t}return t=e.fieldEnd},u.prototype.isLastRenderedInline=function(e,t){for(;t===e.length&&e.nextNode instanceof Zai;){var i=this.documentHelper.getNextValidElement(e.nextNode);if(t=0,(e=i instanceof Zai&&0===i.fieldType?i:e)instanceof Zai&&0===e.fieldType&&!je(e.fieldEnd)){i=e;if(je(i.fieldSeparator))e=i.fieldEnd,t=1;else{var n=(e=i.fieldSeparator).line.paragraph;if(t=1,n!==i.fieldEnd.line.paragraph||this.hasValidInline(n,e,i.fieldEnd))break;e=i.fieldEnd}}}return t===e.length&&je(e.nextNode)},u.prototype.getPage=function(e){var t,i=void 0;return e.containerWidget instanceof Zli?(t=e.containerWidget.containerShape).line&&(i=this.getPage(t.line.paragraph)):e.containerWidget instanceof bai?(e.containerWidget,i=e.containerWidget.page):je(e.containerWidget)||(i=this.getPage(e.containerWidget)),i},u.prototype.clearSelectionHighlightInSelectedWidgets=function(){var e=!1,t=this.selectedWidgets.keys;if(!this.viewer.documentHelper.isDragStarted){for(var i=0;i<t.length;i++)this.removeSelectionHighlight(t[i]),e=!0;this.selectedWidgets.clear()}return e},u.prototype.clearChildSelectionHighlight=function(e){for(var t=0;t<e.childWidgets.length;t++)e.childWidgets[t]instanceof Gai?this.clearSelectionHighlightLineWidget(e.childWidgets[t]):e.childWidgets[t]instanceof Uai?this.clearSelectionHighlight(e.childWidgets[t]):e.childWidgets[t]instanceof fai&&this.clearChildSelectionHighlight(e.childWidgets[t])},u.prototype.getLineWidgetBodyWidget=function(e,t,i){i=!!je(i)||i;var n=e;if(n instanceof bai)for(var o=0;o<n.floatingElements.length;o++){var r=n.floatingElements[o];if(r instanceof _ai){var s=r.getTableCellWidth();if(t.x<=r.x+s&&t.x>=r.x&&t.y<=r.y+r.height&&t.y>=r.y)return this.getLineWidgetTableWidget(r,t)}else if(r instanceof qli&&"Behind"!==r.textWrappingStyle&&r.x<=t.x&&r.x+r.width>=t.x&&r.y<=t.y&&r.y+r.height>=t.y)return r.line}if(e instanceof Pai)for(var a=void 0,l=!1,h=0;h<e.bodyWidgets.length;h++)if(e.sectionFormat.columns.length<=1){for(var d=0;d<e.bodyWidgets[h].childWidgets.length;d++)if((c=e.bodyWidgets[h].childWidgets[d])instanceof fai&&c.y<=t.y&&c.y+c.height>=t.y)return c instanceof Lai?this.getLineWidgetParaWidget(c,t):this.getLineWidgetTableWidget(c,t)}else{var p=e.bodyWidgets[h];if(p.firstChild.x+p.sectionFormat.columns[p.columnIndex].width>=t.x&&p.firstChild.x<=t.x&&p.firstChild.y<=t.y&&this.documentHelper.layout.getNextWidgetHeight(p)>=t.y||p.firstChild.x+p.sectionFormat.columns[p.columnIndex].width<t.x&&p.firstChild.y<=t.y&&this.documentHelper.layout.getNextWidgetHeight(p)>=t.y?a=p:e.x>t.x&&p.firstChild.y<=t.y&&this.documentHelper.layout.getNextWidgetHeight(p)>=t.y&&!l&&(a=p,l=!0),h===e.bodyWidgets.length-1&&!je(a))for(var c,d=0;d<a.childWidgets.length;d++)if((c=a.childWidgets[d])instanceof fai&&c.y<=t.y&&c.y+c.height>=t.y)return c instanceof Lai?this.getLineWidgetParaWidget(c,t):this.getLineWidgetTableWidget(c,t)}for(var u=0;u<e.childWidgets.length;u++){if((f=e.childWidgets[u])instanceof Pai)return f[u];if(f instanceof fai&&f.y<=t.y&&f.y+f.height>=t.y){if(f instanceof Lai)return this.getLineWidgetParaWidget(f,t);var g=f;if(!g.wrapTextAround)return this.getLineWidgetTableWidget(g,t)}}var m=void 0;if(i&&0<e.childWidgets.length){i=e.childWidgets[0];if(i instanceof fai&&i.y<=t.y)if(e.childWidgets[e.childWidgets.length-1]instanceof Lai)for(u=0;u<e.childWidgets.length;u++)m=this.getLineWidgetParaWidget(e.childWidgets[u],t);else for(u=0;u<e.childWidgets.length;u++)m=this.getLineWidgetTableWidget(e.childWidgets[u],t);else{var f=void 0;je(f=i instanceof fai?i:f)||(m=f instanceof Lai?this.getLineWidgetParaWidget(i,t):this.getLineWidgetTableWidget(i,t))}}return m},u.prototype.getLineWidgetParaWidget=function(e,t){for(var i=e.childWidgets,n=e.y,o=0;o<i.length;o++){var r=i[o],s=(n+=r.marginTop,r.height);if(r.nextLine&&0<r.nextLine.marginTop&&(s+=r.nextLine.marginTop),n<=t.y&&n+s>=t.y)return r;n+=r.height}var a=void 0;return a=0<i.length?e.y<=t.y?i[i.length-1]:i[0]:a},u.prototype.highlightParagraph=function(e,t,i,n,o,r){var s=0,a=0,l=!1,h=n;e.paragraphFormat.bidi&&0<i.children.indexOf(n)&&(h=i.children[0]);for(var d=t;d<e.childWidgets.length;d++){var p=e.childWidgets[d],c=(d===t?s=this.getTop(p):s+=p.marginTop,n instanceof pli&&(l=n.isRightToLeft),this.getLeft(p));if(p===i){var u=0;if(l||e.bidi){for(var g=this.getElementsBackward(p,h,n,e.bidi),m=0;m<g.length;m++){var f=g[m],y=!1;if(u=f===n?this.getLeftInternal(p,f,f.length):(v=f instanceof pli?f.length:1,this.getLeftInternal(p,f,v)),c=this.getLeftInternal(p,f,0),f instanceof pli&&(y=f.isRightToLeft),a=Math.abs(u-c),f===n&&f instanceof pli&&o>f.length){var v=this.documentHelper.textHelper.getParagraphMarkSize(f.line.paragraph.characterFormat).Width;if(!e.bidi&&y)u+=v;else if(e.bidi&&!y){a-=v,this.createHighlightBorder(p,a,c,s,!0,r),c=this.getLineStartLeft(p)-v,this.createHighlightBorder(p,v,c,s,!0,r);continue}}this.createHighlightBorder(p,a,y?u:c,s,!0,r)}return}return u=this.getLeftInternal(i,n,o,!0),a=Math.abs(u-c),void this.createHighlightBorder(p,a,l?u:c,s,!1,r)}a=this.getWidth(p,!0)-(c-e.x),e.bidi&&p.isLastLine()&&(c-=this.documentHelper.textHelper.getParagraphMarkSize(e.characterFormat).Width),this.createHighlightBorder(p,a,c,s,!1,r),s+=p.height}},u.prototype.getLineWidgetTableWidget=function(e,t){for(var i=void 0,n=0;n<e.childWidgets.length;n++){var o=e.childWidgets[n];if(o instanceof jai&&o.y<=t.y&&!("Exactly"===o.rowFormat.heightType&&o.y+Y.convertPointToPixel(o.rowFormat.height)<t.y)){var r,s,a=void 0,o=(!je(i=this.getLineWidgetRowWidget(o,t))&&i.paragraph.containerWidget instanceof Uai&&(a=i.paragraph.containerWidget),0),l=0,h=(je(a)||(s=a.ownerRow.containerWidget,o=Y.convertPointToPixel(s.tableFormat.cellSpacing),l=a.cellFormat.rowSpan),0),d=0,p=0,c=0;if(0<o&&(h=0===a.cellIndex?o:o/2,d=a.cellIndex===a.ownerRow.childWidgets.length-1?o:o/2,r=void 0,s=void(a.containerWidget instanceof jai&&(r=a.containerWidget)),a.containerWidget.containerWidget instanceof _ai&&(s=a.containerWidget.containerWidget),je(r)||je(s)||(p=0===a.ownerRow.rowIndex?o:o/2,c=a.ownerRow.rowIndex+l===a.ownerTable.childWidgets.length?o:o/2)),!je(i)&&i.paragraph.x<=t.x&&i.paragraph.x+i.width>=t.x&&i.paragraph.y<=t.y&&this.getTop(i)+i.height>=t.y||!je(a)&&a.x-a.margin.left-h<=t.x&&a.x+a.width+a.margin.right+d>=t.x&&a.y-a.margin.top-p<=t.y&&a.y+a.height+a.margin.bottom+c>=t.y)break}}return i},u.prototype.getLineWidgetRowWidget=function(e,t){for(var i=0;i<e.childWidgets.length;i++){var n,o=0,r=0;if(0<(n=Y.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing))&&(o=0===e.childWidgets[i].columnIndex?n:n/2,r=e.childWidgets[i].cellIndex===e.childWidgets[i].ownerRow.childWidgets.length-1?n:n/2),e.childWidgets[i].x-e.childWidgets[i].margin.left-o<=t.x&&e.childWidgets[i].x+e.childWidgets[i].width+e.childWidgets[i].margin.right+r>=t.x)return this.getLineWidgetCellWidget(e.childWidgets[i],t)}var s=void 0,a=this.documentHelper.layout.getTableWidth(e.ownerTable);return t.x>=e.x&&t.x<=a+e.x||0<e.childWidgets.length&&(s=e.childWidgets[0].x<=t.x?this.getLineWidgetCellWidget(e.childWidgets[e.childWidgets.length-1],t):this.getLineWidgetCellWidget(e.childWidgets[0],t)),s},u.prototype.getFirstBlock=function(e){if(0<e.childWidgets.length)return e.childWidgets[0]},u.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)},u.prototype.clearSelectionHighlight=function(e){this.selectedWidgets.containsKey(e)&&(this.removeSelectionHighlight(e),this.selectedWidgets.remove(e))},u.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 Lai?this.getLineWidgetParaWidget(e.childWidgets[i],t):this.getLineWidgetTableWidget(e.childWidgets[i],t);var n=void 0;return n=0<e.childWidgets.length&&e.childWidgets[0].y-e.margin.top<=t.y?e.childWidgets[e.childWidgets.length-1]instanceof Lai?this.getLineWidgetParaWidget(e.childWidgets[e.childWidgets.length-1],t):this.getLineWidgetTableWidget(e.childWidgets[0],t):n},u.prototype.updateTextPosition=function(e,t){var i=t,n=void 0,o=0,r=!1,s=(this.owner.enableHeaderAndFooter&&(-1!=(s=this.start.paragraph.bodyWidget).headerFooterType.indexOf("Header")?this.comparePageWidthAndMargins(s.page.headerWidget,s.page):this.comparePageWidthAndMargins(s.page.footerWidget,s.page)),this.updateTextPositionIn(e,n,o,t,!1));je(s)||(n=s.element,o=s.index,i=s.caretPosition,r=s.isImageSelected,this.isImageSelected=r),r?(this.selectInternal(e,n,o,i),0===o?this.extendForward():this.extendBackward()):(je(this.owner.imageResizerModule)||this.owner.imageResizerModule.selectedImageWidget.clear(),this.selectInternal(e,n,o,i))},u.prototype.updateTextPositionIn=function(e,t,i,n,o){var r=!1,s=this.getTop(e),a=e.paragraph.x,l=this.getFirstElement(e,a),h=l.element,d=!1,p=!1,a=l.left,c=e.renderedElements;if(je(h)){var l=this.getParagraphMarkSize(e.paragraph,0,0),u=l.topMargin;l.bottomMargin;(!(this.documentHelper.mouseDownOffset.y>=s&&this.documentHelper.mouseDownOffset.y<s+e.height)||this.documentHelper.mouseDownOffset.x<a+l.width)&&o&&n.x>a+l.width/2?(a+=l.width,0<c.length&&(i=(t=c[c.length-1]).length),i++):e.paragraph.isEmpty()&&e.paragraph.bidi&&(a+=l.width),n=new kri(a,0<u?s+u:s)}else if(!je(h)){if(n.x>a+h.margin.left||h instanceof qli&&"Inline"!==h.textWrappingStyle){var g=!1;0<e.paragraph.floatingElements.length&&(g=this.documentHelper.checkPointIsInLine(e,n));for(var m=c.indexOf(h);m<c.length;m++){if((h=c[m])instanceof qli&&"Inline"!==h.textWrappingStyle){if(!this.documentHelper.isInShapeBorder(h,n)||this.documentHelper.isSelectionChangedOnMouseMoved||g)continue;a=h.x,s=h.y;break}var f=!1;if((h instanceof lhi||h instanceof pli)&&(f=h.line.paragraph.paragraphFormat.bidi),n.x<a+h.margin.left+h.width+h.padding.left||m===c.length-1||c[m+1]instanceof lhi&&f)break;a+=h.margin.left+h.width+h.padding.left}if(h instanceof pli&&(d=h.isRightToLeft,p=h.line.paragraph.paragraphFormat.bidi),n.x>a+h.margin.left+h.width+h.padding.left&&!(h instanceof Xli))i=h instanceof pli?h.length:1,d&&p&&(i=0),(h instanceof pli&&"\v"!==h.text&&"\f"!==h.text&&h.text!==String.fromCharCode(14)||o)&&(a+=h.margin.left+h.width+h.padding.left);else if(h instanceof pli){h instanceof pli&&d&&(a+=h.width+h.padding.left);var y=0,y=d?a+h.margin.left-n.x:n.x-a-h.margin.left-h.padding.left;a+=h.margin.left+h.padding.left;for(var v=0,b=0,m=1;m<=h.length;m++){var w=0;if(y<(w=m===h.length?h.width+h.padding.left:this.documentHelper.textHelper.getWidth(h.text.substr(0,m),h.characterFormat,h.scriptType))||m===h.length){(w-v)/2<y-v?(d?a-=w:a+=w,b=m):(d?a-=v:a+=v,b=m-1,1!==m||h===c[0]||c[0]instanceof qli&&"Inline"!==c[0].textWrappingStyle||(C=c.indexOf(h),c[C-1]instanceof lhi)||d||(b=(h=(h=c[C-1])instanceof qli&&"Inline"!==h.textWrappingStyle&&0==b&&!je(h.previousElement)?c[c.indexOf(h)-1]:h)instanceof pli?h.length:1));break}v=w}i=b}else{var C,r=h instanceof rhi||h instanceof Xli;n.x-a-h.margin.left>h.width/2?(i=1,a+=h.margin.left+h.width+h.padding.left):h===c[0]||r||(C=c.indexOf(h),c[C-1]instanceof lhi)||(i=(h=c[C-1])instanceof pli?h.length:1)}h instanceof pli&&("\v"===h.text||"\f"===h.text||h.text===String.fromCharCode(14))&&(i=0)}else d=h.isRightToLeft,p=h.line.paragraph.paragraphFormat.bidi,i=h instanceof pli&&(p||d)&&n.x<a+h.margin.left+h.width+h.padding.left?this.getTextLength(h.line,h)+h.length:this.getTextLength(h.line,h),a+=h.margin.left;h instanceof pli?s+=0<h.margin.top?h.margin.top:0:(l=this.documentHelper.textHelper.getHeight(h.characterFormat),u=h.height,h instanceof Dli&&!this.documentHelper.layout.hasValidElement(h.line.paragraph)&&(u=l.Height),s+=h.margin.top+u-l.BaselineOffset),(t=h)instanceof Zai&&2===t.fieldType&&!je(t.fieldBegin)&&(t=t.fieldBegin,i=0),t instanceof phi&&(i=0),this.isMoveDownOrMoveUp&&h instanceof Pli&&(i=0===h.type?i+1:i-1),!je(t.previousElement)&&t.previousElement instanceof qli&&"Inline"!==t.previousElement.textWrappingStyle&&0==i&&(t=t.previousElement);p=this.validateTextPosition(t,i),u=(t=p.element,i=p.index,je(t.nextNode)&&i===t.length),l=t.line.isEndsWithLineBreak&&t instanceof pli&&"\v"===t.text;o&&t.nextNode instanceof Zai&&i===t.length&&(u=this.isLastRenderedInline(t,i)),(o&&u||l)&&(w=0,u?(w=this.documentHelper.textHelper.getParagraphMarkWidth(e.paragraph.characterFormat),(!(this.documentHelper.mouseDownOffset.y>=s&&this.documentHelper.mouseDownOffset.y<s+e.height)||this.documentHelper.mouseDownOffset.x<a+w)&&n.x>a+w/2&&(a+=w,i=t.length+1)):l&&(a+=w=h.width+h.padding.left)),n=new kri(a,s)}return{element:t,index:i,caretPosition:n,isImageSelected:r}},u.prototype.checkAllFloatingElements=function(e,t){var i,n=!1,o=!1;if(!je(e))for(var r=e.paragraph.bodyWidget,n=!1,o=!1,s=0;s<r.floatingElements.length;s++)if(!(r.floatingElements[s]instanceof _ai)&&(i=r.floatingElements[s],t.x<i.x+i.margin.left+i.width)&&t.x>i.x&&t.y<i.y+i.margin.top+i.height&&t.y>i.y){n=!0,this.documentHelper.isInShapeBorder(i,t)&&(o=!0);break}return{element:i,caretPosition:t,isShapeSelected:n,isInShapeBorder:o}},u.prototype.getTextLength=function(e,t){var i=0,n=e.renderedElements,o=n.indexOf(t);0<n.length&&n[0]instanceof lhi&&(n[1]instanceof lhi?o-=2:--o);for(var r=1;r<o;r++)i+=n[r].length;return i},u.prototype.getLeft=function(e){for(var t=e.paragraph.x,i=e.paragraph.paragraphFormat,n=(this.isParagraphFirstLine(e)&&!i.bidi&&"Right"!==i.textAlignment&&(t+=Y.convertPointToPixel(i.firstLineIndent)),e.renderedElements),o=0;o<n.length;o++){var r=n[o];if(!(r instanceof lhi)||i.bidi){t+=r.margin.left;break}0===o?(t+=r.margin.left+r.width,r.padding&&(t+=r.padding.left)):t+=r.width}return t},u.prototype.getTop=function(e){for(var t=e.paragraph.y,i=e.paragraph.childWidgets.indexOf(e),n=0;n<i;n++)var o=e.paragraph.childWidgets[n],t=t+o.height+o.marginTop;return t+=e.marginTop},u.prototype.getFirstElement=function(e,t){for(var i=0,n=(t+=i=this.isParagraphFirstLine(e)&&!e.paragraph.paragraphFormat.bidi?Y.convertPointToPixel(e.paragraph.paragraphFormat.firstLineIndent):i,void 0),o=e.renderedElements,r=0;r<o.length&&(n=o[r])instanceof lhi;r++)n=e.paragraph.paragraphFormat.bidi?void(t+=n.margin.left):void(t+=n.margin.left+n.width+n.padding.left);return{element:n,left:t}},u.prototype.getIndexInInline=function(e){var t=0;if(e instanceof pli)for(var i=e.line.children.indexOf(e),n=0;n<i;n++){var o=e.line.children[n];o instanceof Zai||o instanceof lhi||(t+=o.length)}return t},u.prototype.isParagraphFirstLine=function(e){return!(!je(e.paragraph.previousSplitWidget)||e!==e.paragraph.firstChild)},u.prototype.isParagraphLastLine=function(e){return!(!je(e.paragraph.nextSplitWidget)||e!==e.paragraph.lastChild)},u.prototype.getWidth=function(e,t){var i=0,n=e.paragraph.paragraphFormat;this.isParagraphFirstLine(e)&&!n.bidi&&(i+=Y.convertPointToPixel(n.firstLineIndent));for(var o=0;o<e.children.length;o++){var r=e.children[o];r instanceof qli&&"Inline"!==r.textWrappingStyle||(i+=r.margin.left+r.width+r.padding.left)}return t&&e.paragraph.childWidgets.indexOf(e)===e.paragraph.childWidgets.length-1&&je(e.paragraph.nextSplitWidget)&&(i+=this.documentHelper.textHelper.getParagraphMarkWidth(e.paragraph.characterFormat)),i},u.prototype.getLeftInternal=function(e,t,i,n){for(var o=e.paragraph.x,r=e.paragraph.paragraphFormat,s=(this.isParagraphFirstLine(e)&&!r.bidi&&(o+=Y.convertPointToPixel(e.paragraph.paragraphFormat.firstLineIndent)),e.renderedElements),a=s.indexOf(t),l=((1===s.length&&s[0]instanceof lhi||2===s.length&&s[0]instanceof lhi&&s[1]instanceof lhi)&&(a=s.length),!1),h=0;h<a;h++){var d=s[h];(l=d instanceof Zai&&2===d.fieldType?!1:l)||d instanceof qli&&"Inline"!==d.textWrappingStyle||(1===h&&d instanceof lhi?(o+=d.width,d.padding&&d.padding.left&&(o+=d.padding.left)):d instanceof Ili&&t===d?o+=d.margin.left:o+=d.margin.left+d.width+d.padding.left,d instanceof Zai&&0===d.fieldType&&(l=!0))}var p=!1,c=e.paragraph.bidi,n=(!je(t)&&(p=t.characterRange===aJt.RightToLeft,c=t.line.paragraph.paragraphFormat.bidi,o=0===i&&n?o+t.margin.left:o+t.margin.left+t.padding.left,t instanceof qli&&!je(t.nextElement)&&(o+=t.nextElement.margin.left+t.nextElement.padding.left),p||1===this.documentHelper.moveCaretPosition&&!p&&c)&&(o+=t.width),0);if(t instanceof pli){if(0!==this.documentHelper.moveCaretPosition&&(c||p))return(p&&c&&2===this.documentHelper.moveCaretPosition||p&&!c&&1===this.documentHelper.moveCaretPosition)&&(o-=t.width),this.documentHelper.moveCaretPosition=0,o;i!==t.length||p?i>t.length?(n=this.documentHelper.textHelper.getParagraphMarkWidth(t.line.paragraph.characterFormat),p?o-=t.width+n:o+=t.width+n):(n=i===t.length&&p&&"Justify"===r.textAlignment?t.width:this.documentHelper.textHelper.getWidth(t.text.substr(0,i),t.characterFormat,t.scriptType),p?o-=n:o+=n):o+=t.width,this.documentHelper.moveCaretPosition=0}else 0<i&&(je(t)||t instanceof lhi?o+=this.documentHelper.textHelper.getParagraphMarkWidth(e.paragraph.characterFormat):(t instanceof qli&&"Inline"!==t.textWrappingStyle||(o+=t.width),2===i&&(c=t.line.paragraph,o+=this.documentHelper.textHelper.getParagraphMarkWidth(c.characterFormat))));return o},u.prototype.getLineStartLeft=function(e){var t=e.paragraph.x,i=e.paragraph.paragraphFormat;return this.isParagraphFirstLine(e)&&!i.bidi&&(t+=Y.convertPointToPixel(i.firstLineIndent)),0<e.children.length&&(t+=e.children[0].margin.left),t},u.prototype.updateTextPositionWidget=function(e,t,i,n){var t=this.updateTextPositionIn(e,void 0,0,t,n),n=t.element,o=t.index,t=t.caretPosition;i.setPositionForSelection(e,n,o,t)},u.prototype.clearSelectionHighlightLineWidget=function(e){!je(this.owner)&&0<this.selectedWidgets.length&&this.clearSelectionHighlight(this)},u.prototype.getFirstElementInternal=function(e){for(var t=void 0,i=e.children.length,n=0;n<i&&(t=e.children[n])instanceof lhi;n++)t=void 0;return t},u.prototype.selectRange=function(e,t,i){this.start.setPositionInternal(e),this.end.setPositionInternal(t),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0,!0,i)},u.prototype.selectParagraphInternal=function(e,t){je(e)||je(e.firstChild)||(e=e.firstChild,t?this.start.setPosition(e,t):(t=e.getEndOffset(),this.start.setPositionParagraph(e,t))),this.end.setPositionInternal(this.start),this.upDownSelectionLength=this.start.location.x,this.fireSelectionChanged(!0)},u.prototype.setPositionForBlock=function(e,t){var i;return(e=e instanceof _ai?t?this.documentHelper.getFirstParagraphInFirstCell(e):this.documentHelper.getLastParagraphInLastCell(e):e)instanceof Lai&&(i=new rci(this.owner),t?i.setPosition(e.firstChild,!0):(t=e.lastChild,i.setPositionParagraph(t,t.getEndOffset()))),i},u.prototype.selectContent=function(e,t){if(je(e))throw new Error("textPosition is undefined.");this.start.setPositionInternal(e),this.end.setPositionInternal(e),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0)},u.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)},u.prototype.selects=function(e,t,i){this.documentHelper.clearSelectionHighlight(),this.start.setPositionForLineWidget(e,t),this.end.setPositionInternal(this.start),i||this.fireSelectionChanged(!0)},u.prototype.selectPosition=function(e,t){if(je(e)||je(t))throw new Error("TextPosition cannot be undefined");if(je(e.paragraph)||e.offset>this.getParagraphLength(e.paragraph)+1)throw new Error("Start TextPosition is not valid.");if(je(t.paragraph)||t.offset>this.getParagraphLength(t.paragraph)+1)throw new Error("End TextPosition is not valid.");e.isAtSamePosition(t)?this.selectRange(e,e):(e.isExistBefore(t)?t.validateForwardFieldSelection(e.getHierarchicalIndexInternal(),t.getHierarchicalIndexInternal()):e.validateForwardFieldSelection(t.getHierarchicalIndexInternal(),e.getHierarchicalIndexInternal()),this.selectRange(e,t))},u.prototype.fireSelectionChanged=function(e,t,i){this.isSelectBookmark||(this.isExcludeBookmarkStartEnd=!1),this.isEmpty||(this.isForward?(this.start.updatePhysicalPosition(!0),this.end.updatePhysicalPosition(!1)):(this.start.updatePhysicalPosition(!1),this.end.updatePhysicalPosition(!0))),this.isModifyingSelectionInternally||(0<this.documentHelper.formFields.length&&!this.owner.editor.isRemoteAction?this.currentFormField=this.getCurrentFormField():this.currentFormField=void 0,!je(this.previousSelectedFormField)&&je(this.previousSelectedFormField.fieldSeparator)&&(this.previousSelectedFormField=this.currentFormField),e&&(this.previousSelectedContentControl=this.currentContentControl),0<this.documentHelper.contentControlCollection.length?this.currentContentControl=this.owner.editor.getContentControl():this.currentContentControl=void 0,this.skipFormatRetrieval||!je(this.owner.optionsPaneModule)&&this.owner.optionsPaneModule.isBuildHeading||this.retrieveCurrentFormatProperties(),this.updateContentControlHighlightSelection(),this.documentHelper.clearSelectionHighlight(),this.hideToolTip(),this.owner.isLayoutEnabled&&!this.owner.isShiftingEnabled&&this.highlightSelection(!0,i),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.triggerSpellCheckWhenSelectionChanges(),this.owner.enableAutoFocus&&this.documentHelper.updateFocus(),this.documentHelper.isFormFillProtectedMode&&e&&(this.triggerFormFillEvent(t),this.previousSelectedFormField=this.currentFormField),this.owner.rulerHelper&&this.owner.documentEditorSettings&&this.owner.documentEditorSettings.showRuler&&!this.owner.isReadOnlyMode&&this.owner.rulerHelper.updateRuler(this.owner,!1))},u.prototype.updateContentControlHighlightSelection=function(){if(this.contentControleditRegionHighlighters.clear(),this.isHighlightContentControlEditRegion&&(0<this.documentHelper.contentControlCollection.length&&(je(this.owner.optionsPaneModule)||!this.owner.optionsPaneModule.isBuildHeading)?this.contentControls=this.owner.editor.getContentControls():this.contentControls=[],this.contentControls)&&0<this.contentControls.length)for(var e=0;e<this.contentControls.length;e++)this.highlightContentControlEditRegionInternal(this.contentControls[parseInt(e.toString(),10)])},u.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.isRetrieveFormatting=!1,this.setCurrentContextType()},u.prototype.triggerSpellCheckWhenSelectionChanges=function(){this.documentHelper.isSpellCheckPending&&this.documentHelper.owner.isSpellCheck&&!this.documentHelper.isTextInput&&(this.documentHelper.triggerElementsOnLoading=!0,this.documentHelper.triggerSpellCheck=!0,this.viewer.updateScrollBars(),this.documentHelper.isSpellCheckPending=!1,this.documentHelper.triggerElementsOnLoading=!1,this.documentHelper.triggerSpellCheck=!1)},u.prototype.retrieveImageFormat=function(e,t){var i;(i=e.currentWidget===t.currentWidget&&e.offset+1===t.offset&&(i=(t=t.currentWidget.getInline(t.offset,0)).element,t.index,i instanceof rhi)&&e.currentWidget.getOffset(i,0)!==e.offset?void 0:i)instanceof rhi?this.imageFormat.copyImageFormat(i):this.imageFormat.clearImageFormat()},u.prototype.getPreviousContextType=function(e){var t,i=this.start;if(0<i.offset)return t=i.currentWidget.getInline(i.offset,0).element,t=e?t.previousElement:i.currentWidget.getInline(i.offset-1,0).element,this.getContextElement(t)},u.prototype.getNextContextType=function(e){var t=this.start,i=t.currentWidget.getInline(t.offset,0).element,i=e&&i.nextElement?i.nextElement:t.currentWidget.getInline(t.offset+1,0).element;return this.getContextElement(i)},u.prototype.getContextElement=function(e){return e instanceof pli?"Text":e instanceof Zai||e instanceof Sli?"Field":e instanceof Dli?"Bookmark":e instanceof rhi?"Image":e instanceof Xli?"Shape":e instanceof $hi||e instanceof Khi?"Comment":e instanceof lhi?"List":e instanceof ghi||e instanceof phi?"EditRange":void 0},u.prototype.getContentControlPositions=function(e){var t=e.line.getOffset(e,1),i=new rci(this.owner),t=(i.setPositionParagraph(e.line,t),e.reference),e=t.line.getOffset(t,0),n=new rci(this.owner);return n.setPositionParagraph(t.line,e),{startPosition:i,endPosition:n}},u.prototype.getContentControlInfo=function(){var e=this.currentContentControl;if(!je(e)){var t="";if("Text"===e.contentControlProperties.type)var i=this.getContentControlPositions(e),t=this.documentHelper.selection.getTextInternal(i.startPosition,i.endPosition,!1);else if("RichText"===e.contentControlProperties.type){e.contentControlProperties.type="BuildingBlockGallery";i=this.getContentControlPositions(e),i=je(this.owner.sfdtExportModule)?{}:this.owner.sfdtExportModule.write(this.owner.documentEditorSettings.optimizeSfdt?1:0,i.startPosition.currentWidget,i.startPosition.offset,i.endPosition.currentWidget,i.endPosition.offset,!1,!0);t=JSON.stringify(i),e.contentControlProperties.type="RichText"}else if("CheckBox"===e.contentControlProperties.type)t=e.contentControlProperties.isChecked?"true":"false";else if("ComboBox"===e.contentControlProperties.type||"DropDownList"===e.contentControlProperties.type||"Date"===e.contentControlProperties.type)for(var n=e;n!==e.reference;)n instanceof pli&&(t+=n.text),n=n.nextNode;else"Picture"===e.contentControlProperties.type&&e.nextNode instanceof rhi&&(t=this.documentHelper.getImageString(e.nextNode));return{title:e.contentControlProperties.title,tag:e.contentControlProperties.tag,value:t,canDelete:e.contentControlProperties.lockContentControl,canEdit:e.contentControlProperties.lockContents,type:e.contentControlProperties.type}}},u.prototype.setCurrentContextType=function(){var e=!!this.imageFormat.image,t=!je(this.tableFormat)&&!je(this.tableFormat.table),i=this.start.paragraph.paragraphFormat.baseStyle;if(i instanceof _ri&&0===i.name.toLowerCase().indexOf("toc")&&!je(this.getTocFieldInternal()))return void(this.contextTypeInternal="TableOfContents");var i=this.getCurrentRevision();if(!je(i)&&this.owner.showRevisions&&this.owner.isUpdateTrackChanges?(this.owner.trackChangesPane.currentSelectedRevision=i[0],je(this.owner.documentHelper.currentSelectedComment)&&this.owner.commentReviewPane.selectReviewTab("Changes"),this.owner.notify("reviewPane",{comment:this.owner.showComments,changes:!0,isUserClosed:!1})):je(this.owner.trackChangesPane.currentSelectedRevision)||(this.owner.trackChangesPane.currentSelectedRevision=void 0),this.start.paragraph.isInHeaderFooter?(i=-1!==this.start.paragraph.bodyWidget.headerFooterType.indexOf("Header"),this.contextTypeInternal=t?e?i?"HeaderTableImage":"FooterTableImage":i?"HeaderTableText":"FooterTableText":e?i?"HeaderImage":"FooterImage":i?"HeaderText":"FooterText"):this.contextTypeInternal=t?e?"TableImage":"TableText":e?"Image":"Text",!je(this.owner.editor)&&!je(this.owner.editor.documentHelper)&&this.owner.editor.documentHelper.contentControlCollection&&0<this.owner.editor.documentHelper.contentControlCollection.length){i=this.currentContentControl,t=this.owner.getImageContentControl();if(!je(i)||!je(t))switch((i||t).contentControlProperties.type){case"RichText":this.contextTypeInternal="RichTextContentControl";break;case"Text":this.contextTypeInternal="PlainTextContentControl";break;case"Picture":this.contextTypeInternal="PictureContentControl";break;case"ComboBox":this.contextTypeInternal="ComboBoxContentControl";break;case"DropDownList":this.contextTypeInternal="DropDownListContentControl";break;case"CheckBox":this.contextTypeInternal="CheckBoxContentControl";break;case"Date":this.contextTypeInternal="DatePickerContentControl"}}},u.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()}},u.prototype.hasRevisions=function(){return!!this.getCurrentRevision()},u.prototype.getCurrentRevision=function(){var e=this.start,t=this.end,i=(this.isForward||(e=this.end,t=this.start),!1),n=((i=this.owner.enableTrackChanges&&this.owner.editorHistoryModule&&this.owner.editorHistoryModule.currentBaseHistoryInfo&&"BackSpace"===this.owner.editorHistoryModule.currentBaseHistoryInfo.action?!0:i)&&this.getLineLength(e.currentWidget)>=e.offset+1?e.currentWidget.getInline(e.offset+1,0):e.currentWidget.getInline(e.offset,0)).element,o=e.paragraph,i=(i&&this.getLineLength(e.currentWidget)>=e.offset+2?e.currentWidget.getInline(e.offset+2,0):e.currentWidget.getInline(e.offset+1,0)).element;if(n&&n===i){e=n.line.getOffset(n,n.length);if((i=new rci(this.owner)).setPositionParagraph(n.line,e),t.offset===i.offset&&!je(n.nextElement))return}if(!je(n)&&0<n.revisions.length)return n.revisions;if(o.isInsideTable){e=o.associatedCell;if(!je(e.ownerRow)&&0<e.ownerRow.rowFormat.revisions.length)return e.ownerRow.rowFormat.revisions}return t.offset>t.paragraph.getLength()&&0<t.paragraph.characterFormat.revisions.length?t.paragraph.characterFormat.revisions:void 0},u.prototype.processLineRevisions=function(e,t){for(var i=0;i<e.children.length;i++){var n=e.children[i];0<n.revisions.length&&this.addItemRevisions(n,t)}},u.prototype.handleAcceptReject=function(e){if(this.isEmpty){var t=this.start.currentWidget.getInline(this.start.offset+1,0).element,i=this.start.paragraph;if(!je(t)&&0<t.revisions.length&&this.addItemRevisions(t,e),i.isInsideTable){var n=i.associatedCell;if(je(n)){if(!i.isEmpty())for(var o=0;o<n.childWidgets.length;o++)for(var r=n.childWidgets[o],s=void 0;s<r.childWidgets.length;s++){var a=r.childWidgets[s];this.processLineRevisions(a,e)}}else 0<n.ownerRow.rowFormat.revisions.length&&this.addItemRevisions(n.ownerRow.rowFormat,e)}}else for(var l=this.getselectedRevisionElements(),o=0;o<l.length;o++)this.acceptReject(l[o],e)},u.prototype.acceptReject=function(e,t){this.selectRevision(e),t?e.accept():e.reject()},u.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 o=this.selectedWidgets.keys[n];if(o instanceof Gai)e=this.getSelectedLineRevisions(o,t,i,e);else if(o instanceof Uai){0<o.ownerRow.rowFormat.revisions.length&&(e=this.addRevisionsCollec(o.ownerRow.rowFormat.revisions,e));for(var r=0;r<o.childWidgets.length;r++)for(var s=o.childWidgets[r],a=0;a<s.childWidgets.length;a++)var l=s.childWidgets[a],e=this.getSelectedLineRevisions(l,t,i,e)}}return e},u.prototype.getSelectedLineRevisions=function(e,t,i,n){0<e.paragraph.characterFormat.revisions.length&&(n=this.addRevisionsCollec(e.paragraph.characterFormat.revisions,n));for(var o=0;o<e.children.length;o++){var r=e.children[o],s=r.line.getOffset(r,0),a=new rci(this.owner),l=(a.setPositionParagraph(r.line,s),s=r.line.getOffset(r,r.length),new rci(this.owner));l.setPositionParagraph(r.line,s),(l.isExistAfter(t)&&l.isExistBefore(i)||a.isExistAfter(t)&&a.isExistBefore(i)||a.isAtSamePosition(t)||t.isExistAfter(a)&&i.isExistBefore(l))&&0<r.revisions.length&&(n=this.addRevisionsCollec(r.revisions,n))}return n},u.prototype.addRevisionsCollec=function(e,t){for(var i=0;i<e.length;i++)-1===t.indexOf(e[i])&&t.push(e[i]);return t},u.prototype.retrieveTableFormat=function(e,t){var i=this.getTable(e,t);je(i)?this.tableFormat.clearFormat():(this.tableFormat.table=i,this.tableFormat.copyFormat(i.tableFormat),this.retrieveCellFormat(e,t),this.retrieveRowFormat(e,t))},u.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()},u.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()},u.prototype.getCellFormat=function(e,t,i){if(!t.paragraph.associatedCell.equals(i.paragraph.associatedCell))for(var n=!1,o=0;o<e.childWidgets.length;o++){var r=e.childWidgets[o];if(n=r===t.paragraph.associatedCell.ownerRow?!0:n)for(var s=0;s<r.childWidgets.length;s++){var a=r.childWidgets[s];if(this.isCellSelected(a,t,i)&&this.cellFormat.combineFormat(a.cellFormat),a===i.paragraph.associatedCell)return void this.cellFormat.combineFormat(a.cellFormat)}}},u.prototype.getRowFormat=function(e,t,i){t=t.paragraph.associatedCell.ownerRow;if(t!==i.paragraph.associatedCell.ownerRow)for(var n=e.childWidgets.indexOf(t)+1;n<e.childWidgets.length;n++){var o=e.childWidgets[n];if(this.rowFormat.combineFormat(o.rowFormat),o===i.paragraph.associatedCell.ownerRow)return}},u.prototype.getTable=function(e,t){if(!je(e.paragraph.associatedCell)&&!je(t.paragraph.associatedCell)){var i=e.paragraph.associatedCell.ownerTable,n=e.paragraph.associatedCell.ownerTable;if(i===n)return i;if(i.contains(e.paragraph.associatedCell))return i;if(n.contains(e.paragraph.associatedCell))return n;if(!i.isInsideTable||!n.isInsideTable)return;do{if((i=i.associatedCell.ownerTable)===n||i.contains(n.associatedCell))return i;if(n.contains(i.associatedCell))return n}while(!je(i.associatedCell))}},u.prototype.getContainerWidget=function(e){var t;if(e.containerWidget instanceof Zli)t=e.containerWidget.containerShape.line.paragraph.bodyWidget;else if(e.containerWidget instanceof bai)t=(!je(e.containerWidget.containerWidget)&&e.containerWidget.containerWidget instanceof Pai?e.containerWidget:e).containerWidget;else for(t=e.containerWidget;!(t instanceof bai);)t=(t=t instanceof Zli?t.containerShape.line.paragraph:t).containerWidget;return t},u.prototype.retrieveSectionFormat=function(e,t){e=this.getContainerWidget(e.paragraph),t=this.getContainerWidget(t.paragraph);if(!je(e)){this.sectionFormat.copyFormat(e.sectionFormat);for(var e=this.documentHelper.pages.indexOf(e.page),i=this.documentHelper.pages.indexOf(t.page),n=e+1;n<=i;n++)this.sectionFormat.combineFormat(this.documentHelper.pages[n].bodyWidgets[0].sectionFormat)}},u.prototype.retrieveParagraphFormat=function(e,t){this.getParagraphFormatForSelection(e.paragraph,this,e,t)},u.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),n.paragraph===e||je(e=this.getNextRenderedBlock(e))||this.getParagraphFormatInternalInBlock(e,i,n)):this.getParagraphFormatInternalInCell(i.paragraph.associatedCell,i,n)},u.prototype.getParagraphsInSelection=function(){var e=this.owner.selectionModule,t=e.selectedWidgets.keys,i=[];if(e.isEmpty||e.start.paragraph===e.end.paragraph)return[e.start.paragraph];for(var n=0;n<t.length;n++){var o=t[n];-1===i.indexOf(o.paragraph)&&i.push(o.paragraph)}return i},u.prototype.getParagraphFormatInternalInParagraph=function(e,t,i){t.paragraph===e?this.paragraphFormat.copyFormat(e.paragraphFormat):this.paragraphFormat.combineFormat(e.paragraphFormat)},u.prototype.getParagraphFormatInternalInBlock=function(e,t,i){var n;e instanceof Lai?(this.getParagraphFormatInternalInParagraph(e,t,i),i.paragraph===e||je(n=this.getNextRenderedBlock(e))||this.getParagraphFormatInternalInBlock(n,t,i)):this.getParagraphFormatInternalInTable(e,t,i)},u.prototype.getParagraphFormatInternalInTable=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++){for(var o=e.childWidgets[n],r=0;r<o.childWidgets.length;r++)this.getParagraphFormatInCell(o.childWidgets[r]);if(i.paragraph.isInsideTable&&this.containsRow(o,i.paragraph.associatedCell))return}var s=this.getNextRenderedBlock(e);this.getParagraphFormatInternalInBlock(s,t,i)},u.prototype.getParagraphFormatInCell=function(e){for(var t=0;t<e.childWidgets.length;t++)this.getParagraphFormatInBlock(e.childWidgets[t])},u.prototype.getParagraphFormatInBlock=function(e){e instanceof Lai?this.getParagraphFormatInParagraph(e):this.getParagraphFormatInTable(e)},u.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])},u.prototype.getParagraphFormatInParagraph=function(e){this.start.paragraph===e?this.paragraphFormat.copyFormat(e.paragraphFormat):this.paragraphFormat.combineFormat(e.paragraphFormat)},u.prototype.getParagraphFormatInternalInCell=function(e,t,i){var n,o,r,s;i.paragraph.isInsideTable?(n=this.getContainerCellOf(e,i.paragraph.associatedCell)).ownerTable.contains(i.paragraph.associatedCell)?(o=this.getSelectedCell(e,n),r=this.getSelectedCell(i.paragraph.associatedCell,n),this.containsCell(n,i.paragraph.associatedCell)?this.isCellSelected(n,t,i)?this.getParagraphFormatInCell(n):o===n?(this.getParagraphFormatInternalInParagraph(t.paragraph,t,i),i.paragraph===t.paragraph||je(s=this.getNextRenderedBlock(t.paragraph))||this.getParagraphFormatInternalInBlock(s,t,i)):this.getParagraphFormatInRow(o.ownerRow,t,i):this.getParaFormatForCell(n.ownerTable,n,r)):this.getParagraphFormatInRow(n.ownerRow,t,i):(s=this.getContainerCell(e),this.getParagraphFormatInRow(s.ownerRow,t,i))},u.prototype.getParaFormatForCell=function(e,t,i){for(var n=this.getCellLeft(t.ownerRow,t),o=n+t.cellFormat.cellWidth,r=this.getCellLeft(i.ownerRow,i),s=r+i.cellFormat.cellWidth,a=(o<s&&(o=s),(n=(n=r<n?r:n)>this.upDownSelectionLength?this.upDownSelectionLength:n)<this.upDownSelectionLength&&(n=this.upDownSelectionLength),e.childWidgets.indexOf(i.ownerRow)),l=e.childWidgets.indexOf(t.ownerRow);l<=a;l++)for(var h=e.childWidgets[l],d=0;d<h.childWidgets.length;d++){var p=h.childWidgets[d],c=this.getCellLeft(h,p);Y.round(n,2)<=Y.round(c,2)&&Y.round(c,2)<Y.round(o,2)&&this.getParagraphFormatInCell(p)}},u.prototype.getParagraphFormatInRow=function(e,t,i){for(var n=e.rowIndex;n<e.ownerTable.childWidgets.length;n++){for(var o=e.ownerTable.childWidgets[n],r=0;r<o.childWidgets.length;r++)this.getParagraphFormatInCell(o.childWidgets[r]);if(i.paragraph.isInsideTable&&this.containsRow(o,i.paragraph.associatedCell))return}var s=this.getNextRenderedBlock(e.ownerTable);this.getParagraphFormatInternalInBlock(s,t,i)},u.prototype.retrieveCharacterFormat=function(e,t){if(this.characterFormat.copyFormat(e.paragraph.characterFormat),e.paragraph.isEmpty()&&this.characterFormat.copyFormat(e.paragraph.characterFormat,this.documentHelper.textHelper.getFontNameToRender(0,e.paragraph.characterFormat)),e.paragraph!==t.paragraph||!e.currentWidget.isLastLine()||e.offset!==this.getLineLength(e.currentWidget)||e.offset+1!==t.offset){var i=e.paragraph;if(e.paragraph===t.paragraph&&this.isSelectList)(r=this.getListLevel(e.paragraph))&&r.characterFormat.uniqueCharacterFormat&&this.characterFormat.copyFormat(r.characterFormat);else{for(e.offset!==this.getParagraphLength(i)||this.isEmpty||(i=this.getNextParagraphBlock(i));!je(i)&&i!==t.paragraph&&i.isEmpty();)i=this.getNextParagraphBlock(i);var n,o,r=i===e.paragraph?e.offset:0;je(i)||i.isEmpty()||(n=new rci(this.owner),o=e.currentWidget.getInline(r,0),r=this.getPhysicalPositionInternal(e.currentWidget,r,!0),n.setPositionForSelection(e.currentWidget,o.element,o.index,r),this.getCharacterFormatForSelection(i,this,n,t))}}},u.prototype.getCharacterFormatForSelection=function(e,t,i,n){i.paragraph instanceof Lai&&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)},u.prototype.getCharacterFormatForTableRow=function(e,t,i){for(var n=e.rowIndex;n<e.ownerTable.childWidgets.length;n++){for(var o=e.ownerTable.childWidgets[n],r=0;r<o.childWidgets.length;r++)this.getCharacterFormatForSelectionCell(o.childWidgets[r],t,i);if(i.paragraph.isInsideTable&&this.containsRow(o,i.paragraph.associatedCell))return}var s=this.getNextRenderedBlock(e.ownerTable);this.getCharacterFormatForBlock(s,t,i)},u.prototype.getCharacterFormatInTableCell=function(e,t,i,n){var o,r,s;n.paragraph.isInsideTable?(o=this.getContainerCellOf(e,n.paragraph.associatedCell)).ownerTable.contains(n.paragraph.associatedCell)?(s=this.getSelectedCell(e,o),r=this.getSelectedCell(n.paragraph.associatedCell,o),this.containsCell(o,n.paragraph.associatedCell)?this.isCellSelected(o,i,n)?this.getCharacterFormatForSelectionCell(o,i,n):s===o?this.getCharacterFormat(i.paragraph,i,n):this.getCharacterFormatForTableRow(s.ownerRow,i,n):this.getCharacterFormatInternalInTable(o.ownerTable,o,r,i,n)):this.getCharacterFormatForTableRow(o.ownerRow,i,n):(s=this.getContainerCell(e),this.getCharacterFormatForTableRow(s.ownerRow,i,n))},u.prototype.getCharacterFormatInternalInTable=function(e,t,i,n,o){for(var r=this.getCellLeft(t.ownerRow,t),s=r+t.cellFormat.cellWidth,a=this.getCellLeft(i.ownerRow,i),l=a+i.cellFormat.cellWidth,h=((r=a<r?a:r)>this.upDownSelectionLength&&(r=this.upDownSelectionLength),(s=s<l?l:s)<this.upDownSelectionLength&&(s=this.upDownSelectionLength),e.childWidgets.indexOf(i.ownerRow)),d=e.childWidgets.indexOf(t.ownerRow);d<=h;d++)for(var p=e.childWidgets[d],c=0;c<p.childWidgets.length;c++){var u=p.childWidgets[c],g=this.getCellLeft(p,u);Y.round(r,2)<=Y.round(g,2)&&Y.round(g,2)<Y.round(s,2)&&this.getCharacterFormatForSelectionCell(u,n,o)}},u.prototype.getCharacterFormat=function(e,t,i){if((e===t.paragraph||e===i.paragraph||e.isEmpty()||(this.getCharacterFormatInternal(e,this),this.characterFormat.canRetrieveNextCharacterFormat()))&&(i.paragraph!==e||t.paragraph===e||0!==i.offset)){var n=0,o=this.getParagraphLength(e);if(e===t.paragraph){n=t.offset;if(this.setCharacterFormat(e,t,i,o))return}var r=-1!==e.childWidgets.indexOf(t.currentWidget)?e.childWidgets.indexOf(t.currentWidget):0,s=-1!==e.childWidgets.indexOf(i.currentWidget)?e.childWidgets.indexOf(i.currentWidget):e.childWidgets.length-1,a=i.offset;e!==i.paragraph&&(a=o);for(var l=r;l<=s;l++)for(var h=e.childWidgets[l],d=(l!==r&&(n=this.getStartLineOffset(h)),a=h===i.currentWidget?i.offset:this.getLineLength(h),0),p=0;p<h.children.length;p++){var c=h.children[p];if(!(c instanceof lhi))if(n>=d+c.length)d+=c.length;else if(c instanceof Zai&&0===c.fieldType&&Y.isLinkedFieldCharacter(c)){var u=je(c.fieldEnd)?c.fieldBegin:c.fieldEnd;for(p--;this.characterFormat.combineFormat(c.characterFormat),d+=c.length,l++,p++,!je(c=c.nextNode)&&c!==u;);}else{if((c instanceof pli||c instanceof Zai)&&this.characterFormat.combineFormat(c.characterFormat,this.documentHelper.textHelper.getFontNameToRender(c.scriptType,c.characterFormat)),je(c)||a<=d+c.length)break;d+=c.length}}i.paragraph===e||je(o=this.getNextRenderedBlock(e))||this.getCharacterFormatForBlock(o,t,i)}},u.prototype.setCharacterFormat=function(e,t,i,n){var o,r=t.offset,s=t.currentWidget.getInline(r,0),a=s.index,s=s.element;if(je(s)){t.paragraph.childWidgets.indexOf(t.currentWidget);if(t.currentWidget.previousLine)return s=t.currentWidget.previousLine.children[t.currentWidget.previousLine.children.length-1],this.characterFormat.copyFormat(s.characterFormat,this.documentHelper.textHelper.getFontNameToRender(s.scriptType,s.characterFormat)),!0}if(r<n){if(this.isEmpty)return s instanceof pli||s instanceof Zai&&(0===s.fieldType||1===s.fieldType)?(t=this.getPreviousTextElement(s),this.characterFormat.copyFormat((s=0===r&&t?t:s).characterFormat,this.documentHelper.textHelper.getFontNameToRender(s.scriptType,s.characterFormat))):je(this.getPreviousTextElement(s))?je(this.getNextTextElement(s))?this.characterFormat.copyFormat(e.characterFormat):(o=this.getNextTextElement(s),this.characterFormat.copyFormat(o.characterFormat,this.documentHelper.textHelper.getFontNameToRender(o.scriptType,s.characterFormat))):(o=this.getPreviousTextElement(s),this.characterFormat.copyFormat(o.characterFormat,this.documentHelper.textHelper.getFontNameToRender(o.scriptType,s.characterFormat))),!0;a!==s.length||je(s.nextNode)?s instanceof pli?this.characterFormat.copyFormat(s.characterFormat,this.documentHelper.textHelper.getFontNameToRender(s.scriptType,s.characterFormat)):s instanceof Zai&&this.characterFormat.copyFormat(this.getNextValidCharacterFormatOfField(s)):this.characterFormat.copyFormat(this.getNextValidCharacterFormat(s),this.documentHelper.textHelper.getFontNameToRender(s.scriptType,s.characterFormat))}else if(n===i.offset)return s instanceof pli||s instanceof Zai?this.characterFormat.copyFormat(s.characterFormat,this.documentHelper.textHelper.getFontNameToRender(s.scriptType,s.characterFormat)):je(s)?this.characterFormat.copyFormat(e.characterFormat):je(s=this.getPreviousTextElement(s))||this.characterFormat.copyFormat(s.characterFormat,this.documentHelper.textHelper.getFontNameToRender(s.scriptType,s.characterFormat)),!0;return!1},u.prototype.getCharacterFormatForBlock=function(e,t,i){e instanceof Lai?this.getCharacterFormat(e,t,i):this.getCharacterFormatInTable(e,t,i)},u.prototype.getCharacterFormatInTable=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++){for(var o=e.childWidgets[n],r=0;r<o.childWidgets.length;r++)this.getCharacterFormatForSelectionCell(o.childWidgets[r],t,i);if(i.paragraph.isInsideTable&&this.containsRow(o,i.paragraph.associatedCell))return}var s=this.getNextRenderedBlock(e);je(s)||this.getCharacterFormatForBlock(s,t,i)},u.prototype.getCharacterFormatForSelectionCell=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++)this.getCharacterFormatForBlock(e.childWidgets[n],t,i)},u.prototype.getCharacterFormatInternal=function(e,t){for(var i=0;i<e.childWidgets.length;i++)for(var n=e.childWidgets[i],o=0;o<n.children.length;o++){var r=n.children[o];r instanceof rhi||r instanceof Zai||r instanceof lhi||t.characterFormat.combineFormat(r.characterFormat)}},u.prototype.getNextValidCharacterFormat=function(e){var t=this.getNextTextElement(e);return(je(t)?e:(t instanceof Zai&&(void 0).fieldType,t)).characterFormat},u.prototype.getNextValidCharacterFormatOfField=function(e){var t=e,e=(Y.isLinkedFieldCharacter(e)&&(t=je(e.fieldSeparator)?e.fieldEnd:e.fieldSeparator),void 0);return je(t.nextNode)||(e=this.documentHelper.getNextValidElement(t.nextNode)),(je(e)?t:e).characterFormat},u.prototype.checkCursorIsInSelection=function(e,t){if(je(this.start)||this.isEmpty||je(e))return!1;var i=!1;do{if(this.selectedWidgets.containsKey(e)){var n=void 0,o=(e instanceof Gai?(n=this.owner.selectionModule.getTop(e),this.owner.selectionModule.getLeft(e)):(n=e.y,e.x),this.selectedWidgets.get(e));if(o instanceof aci)i=o.left<=t.x&&n<=t.y&&n+e.height>=t.y&&o.left+o.width>=t.x;else for(var r=o,s=0;s<r.length&&!(r[s]instanceof aci&&(i=r[s].left<=t.x&&n<=t.y&&n+e.height>=t.y&&r[s].left+r[s].width>=t.x));s++);}}while(!je(e=e instanceof Gai?e.paragraph:e.containerWidget)&&!i);return i},u.prototype.copySelectionParagraphFormat=function(){var e=new bri;return this.paragraphFormat.copyToFormat(e),e},u.prototype.getHyperlinkDisplayText=function(e,t,i,n,o){var r=e;if(r!==i.line.paragraph)return{displayText:"<<Selection in Document>>",isNestedField:n=!0,format:o};for(var s="",a=r.childWidgets.indexOf(t.line),l=r.childWidgets[a].children.indexOf(t),h=a;h<r.childWidgets.length;h++)for(var d=r.childWidgets[h],p=(l=h!==a?-1:l)+1;p<d.children.length;p++){var c=d.children[p];if(c===i)return{displayText:s,isNestedField:n,format:o};if(c instanceof pli)s+=c.text,o=c.characterFormat;else{if(!(c instanceof Zai))return{displayText:"<<Selection in Document>>",isNestedField:n=!0,format:o};c instanceof Zai&&0===c.fieldType&&!je(c.fieldEnd)&&(l=je(c.fieldSeparator)?d.children.indexOf(c.fieldEnd):d.children.indexOf(c.fieldSeparator))}}return{displayText:s,isNestedField:n,format:o}},u.prototype.navigateHyperLinkOnEvent=function(e,t){var i=this,n=this.documentHelper.getLineWidget(e);je(n)||je(n=this.getHyperLinkFieldInCurrentSelection(n,e))||(this.documentHelper.updateTextPositionForSelection(e,1),this.fireRequestNavigate(n),setTimeout(function(){i.viewer&&(i.documentHelper.isTouchInput=t,i.documentHelper.updateFocus(),i.documentHelper.isTouchInput=!1)}))},u.prototype.getLinkText=function(e,t){var e=new hci(e,this),i=e.navigationLink,n=e.screenTip;return t?(0<e.localReference.length&&("_"!==e.localReference[0]||!je(i)&&0!==i.length?e.isCrossRef?i+=e.localReference:i+="#"+e.localReference:i="Current Document"),e.destroy(),i):(e.destroy(),n)},u.prototype.setHyperlinkContentToToolTip=function(e,t,i,n){if(e){if(!this.owner.contextMenuModule||"block"!==this.owner.contextMenuModule.contextMenuInstance.element.style.display){this.toolTipElement||(this.toolTipElement=Q("div",{className:"e-de-tooltip"}),this.documentHelper.viewerContainer.appendChild(this.toolTipElement),this.screenTipElement=Q("p"),this.toolTipElement.appendChild(this.screenTipElement),this.toolTipTextElement=Q("p",{styles:"font-weight:bold"}),this.toolTipElement.appendChild(this.toolTipTextElement)),this.toolTipElement.style.display="block";var o=new Cn("documenteditor",this.owner.defaultLocale),o=(o.setLocale(this.owner.locale),o.getConstant("Click to follow link")),r=(this.owner.useCtrlClickToFollowHyperlink&&(o=this.documentHelper.isIosDevice?"Command+"+o:"Ctrl+"+o),this.getScreenTipText(e));if(n){n=e.formFieldData.helpText;if(je(n)||""===n)return;this.screenTipElement.innerText=n}else this.screenTipElement.innerText=r,this.toolTipTextElement.innerText=o;n=this.getTooltipPosition(e.line,i,this.toolTipElement,!1);this.showToolTip(n.x,n.y),je(this.toolTipField)||e===this.toolTipField||(this.toolTipObject.position={X:n.x,Y:n.y}),this.toolTipObject.show(),this.toolTipField=e}}else this.hideToolTip()},u.prototype.getScreenTipText=function(e){e=new hci(e,this);return e.screenTip||e.localReference?e.screenTip||e.localReference:e.navigationLink},u.prototype.setFootnoteContentToToolTip=function(e,t,i){var n,o;e?"block"===this.owner.contextMenuModule.contextMenuInstance.element.style.display&&this.owner.contextMenuModule||(this.toolTipElement||(this.toolTipElement=Q("div",{className:"e-de-tooltip"}),this.documentHelper.viewerContainer.appendChild(this.toolTipElement)),this.toolTipElement.style.display="block",n=void(o=new Cn("documenteditor",this.owner.defaultLocale)).setLocale(this.owner.locale),"Endnote"===e.footnoteType?n=o.getConstant("Click to View/Edit Endnote"):"Footnote"===e.footnoteType&&(n=o.getConstant("Click to View/Edit Footnote")),this.toolTipElement.innerHTML="<b>"+n+"</b>",o=this.getTooltipPosition(e.line,i,this.toolTipElement,!1),this.showToolTip(o.x,o.y),je(this.toolTipField)||(this.toolTipObject.position={X:o.x,Y:o.y}),this.toolTipObject.show()):this.hideToolTip()},u.prototype.setLockInfoTooptip=function(e,t,i){var n,o;e?this.owner.contextMenuModule&&"block"===this.owner.contextMenuModule.contextMenuInstance.element.style.display||(n=this.toolTipElement,this.toolTipElement||(n=Q("div",{className:"e-de-tooltip"}),this.documentHelper.viewerContainer.appendChild(n),this.toolTipElement=n),n.style.display="block",(o=new Cn("documenteditor",this.owner.defaultLocale)).setLocale(this.owner.locale),o=o.getConstant("This region is locked by"),n.innerHTML=o+" <b>"+i+"</b>",o=this.getTooltipPosition(e,t,n,!1),this.showToolTip(o.x,o.y),je(this.toolTipField)||i===this.toolTipField||(this.toolTipObject.position={X:o.x,Y:o.y}),this.toolTipObject.show(),this.toolTipField=i):this.hideToolTip()},u.prototype.getTooltipPosition=function(e,t,i,n){var o=this.getTop(e)*this.documentHelper.zoomFactor,r=this.getPage(e.paragraph),s=this.documentHelper.viewerContainer.getBoundingClientRect().width+this.documentHelper.viewerContainer.scrollLeft,t=r.boundingRectangle.x+t*this.documentHelper.zoomFactor,s=(t+i.clientWidth+10>s&&(t-=i.clientWidth-(s-t)+15),n?0:i.offsetHeight),n=(n=this.getPageTop(r)+(o-s))>this.documentHelper.viewerContainer.scrollTop?n:n+e.height+s;return new kri(t,n)},u.prototype.updateSelectionInfo=function(e){var t,i=this.selectedWidgets.keys;return i[0]instanceof Uai&&i[i.length-1]instanceof Uai&&0<i.length&&(t=i[0],i=i[i.length-1],t=t.ownerRow,i=i.ownerRow,t=t.getCell(t.rowIndex,void 0,0),t=this.owner.documentHelper.getFirstParagraphInCell(t),e.start=this.owner.documentHelper.selection.getHierarchicalIndex(t,"0"),t=i.getCell(i.rowIndex,void 0,i.childWidgets.length-1),i=this.getLastParagraph(t),t=this.getParagraphLength(i),e.end=this.owner.documentHelper.selection.getHierarchicalIndex(i,t.toString())),e},u.prototype.createPasteElement=function(e,t){var i,n=new Cn("documenteditor",this.owner.defaultLocale);switch(n.setLocale(this.owner.locale),this.currentPasteAction){case"DefaultPaste":r=[{text:n.getConstant("Keep source formatting"),iconCss:"e-icons e-de-paste-source"},{text:n.getConstant("Match destination formatting"),iconCss:"e-icons e-de-paste-merge"},{text:n.getConstant("Text only"),iconCss:"e-icons e-de-paste-text"}];break;case"TextOnly":r=[{text:n.getConstant("Text only"),iconCss:"e-icons e-de-paste-text"}];break;case"InsertAsColumns":case"OverwriteCells":case"InsertAsRows":var o,r=[{text:n.getConstant("NestTable"),iconCss:"e-icons e-de-paste-nested-table"},{text:n.getConstant("InsertAsRows"),iconCss:"e-icons e-de-paste-row"}];"InsertAsColumns"===this.currentPasteAction?(o={text:n.getConstant("InsertAsColumns"),iconCss:"e-icons e-de-paste-column"},r.unshift(o)):"OverwriteCells"===this.currentPasteAction&&(o={text:n.getConstant("OverwriteCells"),iconCss:"e-icons e-de-paste-overwrite-cells"},r.splice(2,0,o))}this.pasteElement?this.pasteDropDwn.items=r:(this.pasteElement=Q("div",{className:"e-de-tooltip"}),this.documentHelper.viewerContainer.appendChild(this.pasteElement),i=Q("button",{id:this.owner.containerId+"_iconsplitbtn"}),this.pasteElement.appendChild(i),this.pasteDropDwn=new u2({items:r,iconCss:"e-icons e-de-paste",select:this.pasteOptions}),this.pasteDropDwn.appendTo(i)),this.pasteElement.style.display="block",this.pasteElement.style.position="absolute",this.pasteElement.style.left=t,this.pasteElement.style.top=e,this.pasteDropDwn.dataBind()},u.prototype.getContextBasedPasteOptions=function(e){var e=Y.getSfdtDocument(e),t=(!je(e.optimizeSfdt)&&e.optimizeSfdt?this.owner.editorModule.keywordIndex=1:this.owner.editorModule.keywordIndex=0,[]),e=(this.owner.editorModule.getBlocks(e,!0,t,[],[],!0),this.documentHelper.selection);if(e.start.paragraph.isInsideTable&&e.end.paragraph.isInsideTable){var i=!1;if(i=1===t.length&&(n=t[0].childWidgets).length<3&&(1===n.length&&n[0]instanceof _ai||2===n.length&&n[0]instanceof _ai&&n[1].isEmpty())?!0:i){var n=e.start.paragraph.associatedCell,i=e.end.paragraph.associatedCell;t[0].childWidgets[0];if(n.ownerTable.equals(i.ownerTable))return 0===e.start.paragraph.associatedCell.rowIndex&&0===e.end.paragraph.associatedCell.rowIndex&&n.equals(i)&&!this.isCellSelected(n,e.start,e.end)?["NewColumn","NestTable","NewRow"]:["NestTable","NewRow","OverwriteCells"]}}return["KeepSourceFormatting","MergeWithExistingFormatting","KeepTextOnly"]},u.prototype.showToolTip=function(e,t){this.toolTipObject||(this.toolTipObject=new Sv(this.toolTipElement,{height:"auto",width:"auto",relateTo:this.documentHelper.viewerContainer.parentElement,position:{X:e,Y:t}}))},u.prototype.hideToolTip=function(){this.toolTipField=void 0,this.toolTipObject&&(this.toolTipElement.style.display="none",this.toolTipObject.hide(),this.toolTipObject.destroy(),this.toolTipObject=void 0)},u.prototype.getHyperLinkFieldInCurrentSelection=function(e,t,i){var n=this.getTop(e),o=this.getLineStartLeft(e),r=Y.convertPointToPixel(e.paragraph.paragraphFormat.leftIndent),s=Y.convertPointToPixel(e.paragraph.paragraphFormat.rightIndent);if(!(t.y<n||t.y>n+e.height||t.x<o||t.x>o+e.paragraph.width+r+s)){var a=e.paragraph.x,n=this.getFirstElement(e,a),a=n.left,l=n.element;if(je(l)){var h=this.documentHelper.textHelper.getParagraphMarkWidth(e.paragraph.characterFormat);if(t.x<=o+h||t.x>=o+h)return c=this.getHyperLinkFields(e.paragraph,[],!1,i),c}else{var d=e.renderedElements;if(t.x>a+l.margin.left)for(var p=d.indexOf(l);p<d.length&&(l=d[p],!(t.x<a+l.margin.left+l.width||p===d.length-1));p++)a+=l.margin.left+l.width;var c,r=l,h=l.margin.left+l.width;if(je(r.nextNode)&&(h+=this.documentHelper.textHelper.getParagraphMarkWidth(r.line.paragraph.characterFormat)),t.x<=a+h)return c=this.getHyperLinkFieldInternal(r.line.paragraph,r,[],!1,i),c}}},u.prototype.getFootNoteElementInCurrentSelection=function(e,t){var i=void 0,n=this.getTop(e),o=this.getLineStartLeft(e);if(!(t.y<n||t.y>n+e.height||t.x<o||t.x>o+e.paragraph.width)){var r=e.paragraph.x,n=this.getFirstElement(e,r),r=n.left,s=n.element;if(je(s)){var a=this.documentHelper.textHelper.getParagraphMarkWidth(e.paragraph.characterFormat);if(t.x<=o+a||t.x>=o+a)return(n=this.documentHelper.selection.start.currentWidget.getInline(this.documentHelper.selection.start.offset,0).element)instanceof fli?n:void 0}else{if(t.x>r+s.margin.left)for(var l=e.children.indexOf(s);l<e.children.length&&(s=e.children[l],!(t.x<r+s.margin.left+s.width||l===e.children.length-1));l++)r+=s.margin.left+s.width;s instanceof fli&&(i=s);a=s.margin.left+s.width;if(je(s.nextNode)&&(a+=this.documentHelper.textHelper.getParagraphMarkWidth(s.line.paragraph.characterFormat)),t.x<=r+a)return i}}},u.prototype.getHyperlinkField=function(e){var t,i,n,o;if(!je(this.end))return(t=this.documentHelper.selection).start,i=t.end,t.isForward||(t.end,i=t.start),(t=this.end.currentWidget.getInline(i.offset,0)).index,i=[],o=void 0,o=je(t=t.element)?this.getHyperLinkFields(this.end.paragraph,i,e):this.documentHelper.isFormFillProtectedMode&&t instanceof Dli&&t.previousNode instanceof Zai&&1===t.previousNode.fieldType?void 0:(n=t.line.paragraph,this.getHyperLinkFieldInternal(n,t,i,e,!1)),i=[],o},u.prototype.getHyperLinkFields=function(e,t,i,n){for(var o=0;o<this.documentHelper.fields.length;o++)if(-1===t.indexOf(this.documentHelper.fields[o])&&!je(this.documentHelper.fields[o].fieldSeparator)){t.push(this.documentHelper.fields[o]);var r=(r=this.getFieldCode(this.documentHelper.fields[o])).trim().toLowerCase(),s=this.paragraphIsInFieldResult(this.documentHelper.fields[o],e);if((i||!i&&r.match("hyperlink "))&&s)return this.documentHelper.fields[o];if(s&&n&&this.documentHelper.fields[o].formFieldData)return this.documentHelper.fields[o];if((i||!i&&r.match("ref "))&&s)return this.documentHelper.fields[o]}},u.prototype.getHyperLinkFieldInternal=function(e,t,i,n,o){for(var r=0;r<this.documentHelper.fields.length;r++)if(-1===i.indexOf(this.documentHelper.fields[r])&&!je(this.documentHelper.fields[r].fieldSeparator)){i.push(this.documentHelper.fields[r]);var s=(s=this.getFieldCode(this.documentHelper.fields[r])).trim().toLowerCase(),a=this.documentHelper.fields[r],l=a.fieldEnd,l=(n&&a.nextNode instanceof Dli&&a.nextNode.reference&&(l=a.nextNode.reference),this.inlineIsInFieldResult(a,l,a.fieldSeparator,t,n)||this.isImageField());if((n||!n&&s.match("hyperlink "))&&l)return this.documentHelper.fields[r];if(l&&o&&this.documentHelper.fields[r].formFieldData)return this.documentHelper.fields[r];if((n||!n&&s.match("ref "))&&l)return this.documentHelper.fields[r]}if(e.containerWidget instanceof Sai&&!(e instanceof Iai))return this.getHyperLinkFieldInternal(e.containerWidget,t,i,n,o)},u.prototype.getBlock=function(e){var t,i,n;if(""!==e&&!je(e))return t=this.start.getPage(e={index:e}),n=e.index.indexOf(";"),i=e.index.substring(0,n),e.index=e.index.substring(n).replace(";",""),n=t.bodyWidgets[parseInt(i,10)],this.getBlockInternal(n,e.index)},u.prototype.getBlockInternal=function(e,t){var i,n,o;if(""!==t&&!je(t))return n=t.indexOf(";"),o=t.substring(0,n),t=t.substring(n).replace(";",""),i=e,0<=(n=parseInt(o,10))&&n<e.childWidgets.length?(o=e.childWidgets[n],0<=t.indexOf(";")?o instanceof Lai?(0<=t.indexOf(";")&&(t="0"),o):o instanceof Dai?this.getBlockInternal(o,t):i:o):i},u.prototype.inlineIsInFieldResult=function(e,t,i,n,o){return!(je(t)||je(i)||!this.isExistBeforeInline(i,n))&&this.isExistAfterInline(t,n,o)},u.prototype.paragraphIsInFieldResult=function(e,t){if(!je(e.fieldEnd)&&!je(e.fieldSeparator)){var i=e.fieldSeparator.line.paragraph;if(e.fieldSeparator.line.paragraph===t||this.isExistBefore(i,t))return e.fieldEnd.line.paragraph!==t&&this.isExistAfter(i,t)}return!1},u.prototype.isImageField=function(){if(!this.start.paragraph.isEmpty()&&!this.end.paragraph.isEmpty()){var e=this.start,t=this.end,e=(this.isForward||(e=this.end,t=this.start),e.paragraph.getInline(e.offset,0)),i=e.element;(n=e.index)===i.length&&(i=this.getNextRenderedElementBox(i,n));t=(e=t.paragraph.getInline(t.offset,n)).element;if(e.index,i instanceof Zai&&0===i.fieldType&&t instanceof Zai&&1===t.fieldType&&i.fieldSeparator){var n=i.fieldSeparator.nextNode;if(n instanceof rhi&&n.nextNode===t)return!0}}return!1},u.prototype.isFormField=function(){var e=this.currentFormField;return!!(e instanceof Zai&&e.formFieldData)},u.prototype.isReferenceField=function(e){if(e=je(e)?this.getHyperlinkField(!0):e){var t=(t=this.getFieldCode(e)).toLowerCase();if(e instanceof Zai&&t.match("ref "))return!0}return!1},u.prototype.isInlineFormFillMode=function(e){return!!(this.documentHelper.isInlineFormFillProtectedMode&&(e=je(e)?this.currentFormField:e,e=je(e)?this.getCurrentFormField():e)&&e.formFieldData instanceof ili&&"Text"===e.formFieldData.type)},u.prototype.getFormFieldType=function(e){if((e=je(e)?this.currentFormField:e)instanceof Zai){if(e.formFieldData instanceof ili)return"Text";if(e.formFieldData instanceof rli)return"CheckBox";if(e.formFieldData instanceof lli)return"DropDown"}},u.prototype.getCurrentFormField=function(e){var t;if(e||this.documentHelper.isFormFillProtectedMode&&this.owner.documentEditorSettings.formFieldSettings&&"Inline"===this.owner.documentEditorSettings.formFieldSettings.formFillingMode)for(var i=0;i<this.documentHelper.formFields.length;i++){var n=this.documentHelper.formFields[i],o=this.start,r=this.end;if(this.isForward||(o=this.end,r=this.start),Y.isLinkedFieldCharacter(n)){var s=n.fieldSeparator.line.getOffset(n.fieldSeparator,1),a=new rci(this.owner),l=(a.setPositionParagraph(n.fieldSeparator.line,s),n.fieldEnd),s=l.line.getOffset(l,0),h=new rci(this.owner);if(h.setPositionParagraph(l.line,s),(o.isExistAfter(a)||o.isAtSamePosition(a))&&(r.isExistBefore(h)||r.isAtSamePosition(h))){t=n;break}}}else t=this.getHyperlinkField(!0);if(t instanceof Zai&&0===t.fieldType&&!je(t.formFieldData))return t},u.prototype.getCurrentTextFrame=function(){var e=this.start.paragraph.containerWidget;do{if(e instanceof Zli)return e}while(e=e&&e.containerWidget);return null},u.prototype.isTableSelected=function(e){var t=this.start,i=this.end;if(this.isForward||(t=this.end,i=this.start),je(t.paragraph.associatedCell)||je(i.paragraph.associatedCell))return!1;var n=t.paragraph.associatedCell.ownerTable.getSplitWidgets(),o=this.getFirstBlockInFirstCell(n[0]),n=this.getLastBlockInLastCell(n[n.length-1]);if(e){for(var r=n.associatedCell.ownerTable;r.containerWidget instanceof Uai;)r=r.containerWidget.ownerTable;n=this.getLastBlockInLastCell(r)}return t.paragraph.associatedCell.equals(o.associatedCell)&&i.paragraph.associatedCell.equals(n.associatedCell)&&(!o.associatedCell.equals(n.associatedCell)||0===t.offset&&i.offset===this.getLineLength(n.lastChild)+1)},u.prototype.selectListText=function(){var e=this.documentHelper.selectionLineWidget.getHierarchicalIndex("0"),t=this.getTextPosition(e),e=this.getTextPosition(e);this.isSelectList=!0,this.selectRange(t,e),this.isSelectList=!1,this.highlightListText(this.documentHelper.selectionLineWidget),this.contextTypeInternal="List"},u.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},u.prototype.updateImageSize=function(e){this.owner.isShiftingEnabled=!0;var t,i=this.start,n=this.end,o=(this.isForward||(i=this.end,n=this.start),null),r=i.paragraph;r===n.paragraph&&i.offset+1===n.offset&&(o=(i=r.getInline(n.offset,0)).element,i.index),(o instanceof rhi||o instanceof Xli)&&(n=o.width,i=o.height,t=o.alternateText,o.width=e.width,o.height=e.height,o.alternateText=e.alternatetext,e.width=n,e.height=i,e.alternatetext=t,null!==r)&&null!==r.containerWidget&&this.owner.editorModule&&(n=r.childWidgets.indexOf(o.line),i=o.line.children.indexOf(o),this.documentHelper.layout.reLayoutParagraph(r,n,i),this.highlightSelection(!1))},u.prototype.getSelectedCellsInTable=function(e,t,i){for(var n=t.columnIndex,o=i.columnIndex+i.cellFormat.columnSpan-1,r=t.ownerRow.index,s=i.ownerRow.index,a=[],l=0;l<e.childWidgets.length;l++){var h=e.childWidgets[l];if(h.index>=r&&h.index<=s)for(var d=0;d<h.childWidgets.length;d++){var p=h.childWidgets[d];p.columnIndex>=n&&p.columnIndex<=o&&a.push(p)}if(h.index>s)break}return a},u.prototype.copy=function(){this.isEmpty||this.copySelectedContent(!1)},u.prototype.copySelectedContent=function(e){je(this.owner.sfdtExportModule)||(this.documentHelper.isCopying=!0,this.htmlContent=this.getHtmlContent(),this.copyToClipboard(),this.documentHelper.isCopying=!1,e&&this.owner.editorModule&&this.owner.editorModule.handleCut(this),this.owner.enableAutoFocus&&this.documentHelper.updateFocus())},u.prototype.writeSfdt=function(){var e=this.start,t=this.end;return this.isForward||(e=this.end,t=this.start),this.owner.sfdtExportModule.write(this.owner.documentEditorSettings.optimizeSfdt?1:0,e.currentWidget,e.offset,t.currentWidget,t.offset,!0)},u.prototype.getHtmlContent=function(){var e=this.writeSfdt(),t=(this.sfdtContent=JSON.stringify(e),this.owner.editorModule&&(this.owner.editorModule.copiedData=JSON.stringify(e)),this.owner.documentEditorSettings.optimizeSfdt);return this.htmlWriter.writeHtml(e,t)},u.prototype.copyToClipboard=function(e){window.getSelection().removeAllRanges();var t,i=navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1<navigator.userAgent.indexOf("Macintosh")&&-1<navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome"),n=/Android|Windows Phone|iPhone|Trident|webOS/i.test(navigator.userAgent)||i,o=document.createElement("div"),i=(o.style.left="-10000px",o.style.top="-10000px",o.style.position="relative",je(e)?i&&(o.innerText="copy"):o.innerHTML=e,n?document.body.appendChild(o):((t=document.createElement("div")).attachShadow({mode:"open"}).appendChild(o),document.body.appendChild(t)),void 0!==navigator&&-1!==navigator.userAgent.indexOf("Firefox")&&(o.contentEditable="true"),document.createRange()),e=(i.selectNodeContents(o),window.getSelection().addRange(i),!1);try{e=document.execCommand("copy")}catch(e){}finally{window.getSelection().removeAllRanges(),o.parentNode.removeChild(o),n||t.parentNode.removeChild(t)}return e},u.prototype.onCopy=function(e){e.clipboardData&&!je(this.htmlContent)&&(e.clipboardData.clearData(),e.clipboardData.setData("text/html",this.htmlContent),e.clipboardData.setData("text/plain",this.text),e.clipboardData.setData("application/json",JSON.stringify(this.sfdtContent)),this.htmlContent=void 0,this.sfdtContent=void 0)},u.prototype.showCaret=function(){var e,t,i,n,o=je(this.documentHelper.currentPage)?this.documentHelper.currentRenderingPage:this.documentHelper.currentPage;je(o)||this.documentHelper.isRowOrCellResizing||this.owner.enableImageResizerMode&&this.owner.imageResizerModule.isImageResizerVisible&&!this.owner.imageResizerModule.isShapeResize||(e=o.boundingRectangle.x,o=this.viewer instanceof nai?o.boundingRectangle.width*this.documentHelper.zoomFactor+e:o.boundingRectangle.width-this.owner.viewer.padding.right-this.documentHelper.scrollbarWidth,this.owner.enableImageResizerMode&&this.owner.imageResizerModule.isImageResizerVisible&&!this.owner.imageResizerModule.isShapeResize||(this.isHideSelection(this.start.paragraph)?this.caret.style.display="none":this.isEmpty&&(!this.owner.isReadOnly||this.owner.enableCursorOnReadOnly||this.isInlineFormFillMode())?(t=parseInt(this.caret.style.left.replace("px",""),10),this.caret.style.display=t<e||o<t?"none":"block"):this.isImageSelected&&!this.owner.enableImageResizerMode?this.caret.style.display="block":"block"!==this.caret.style.display&&!je(this)||this.documentHelper.isComposingIME||(this.caret.style.display="none")),je(this)||!this.documentHelper.isTouchInput||this.owner.isReadOnlyMode?(this.documentHelper.touchStart.style.display="none",this.documentHelper.touchEnd.style.display="none"):(t=parseInt(this.documentHelper.touchStart.style.left.replace("px",""),10)+14,i=parseInt(this.documentHelper.touchEnd.style.left.replace("px",""),10)+14,(n=this.getSelectionPage(this.start))&&(this.documentHelper.touchEnd.style.display=i<e||o<i?"none":"block",this.isEmpty||(e=n.boundingRectangle.x,o=n.boundingRectangle.width*this.documentHelper.zoomFactor+e),this.documentHelper.touchStart.style.display=t<e||o<t?"none":"block")))},u.prototype.setEditableDivCaretPosition=function(e){this.documentHelper.editableDiv.focus();var t,i=this.documentHelper.editableDiv.childNodes[this.documentHelper.editableDiv.childNodes.length-1];i&&((t=document.createRange()).setStart(i,e),t.collapse(!0),window.getSelection().removeAllRanges(),window.getSelection().addRange(t))},u.prototype.initCaret=function(){this.caret=Q("div",{styles:"position:absolute",className:"e-de-blink-cursor e-de-cursor-animation"}),this.caret.style.display="none",this.owner.documentHelper.viewerContainer.appendChild(this.caret)},u.prototype.updateCaretPosition=function(){var e,t,i,n,o,r=this.end.location,s=this.getSelectionPage(this.end);s&&!je(this.caret)&&(e=s.boundingRectangle.x+Math.round(r.x)*this.documentHelper.zoomFactor+"px",this.caret.style.left=e,i=(t=this.updateCaretSize(this.owner.selectionModule.end)).topMargin,n=this.viewer,n=(s.boundingRectangle.y-n.pageGap*(this.documentHelper.pages.indexOf(s)+1))*this.documentHelper.zoomFactor+n.pageGap*(this.documentHelper.pages.indexOf(s)+1),this.caret.style.top=(o=n)+Math.round(r.y+i)*this.documentHelper.zoomFactor+"px","Subscript"===this.owner.selectionModule.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=s.boundingRectangle.x+(Math.round(r.x)*this.documentHelper.zoomFactor-14)+"px",this.documentHelper.touchStart.style.top=o+(r.y+t.height)*this.documentHelper.zoomFactor+"px",this.documentHelper.touchEnd.style.left=s.boundingRectangle.x+(Math.round(r.x)*this.documentHelper.zoomFactor-14)+"px",this.documentHelper.touchEnd.style.top=o+(r.y+t.height)*this.documentHelper.zoomFactor+"px"),F.isDevice)&&(this.documentHelper.editableDiv.style.left=e+"px",this.documentHelper.editableDiv.style.top=n+"px"),this.showHidePasteOptions(this.caret.style.top,this.caret.style.left)},u.prototype.showHidePasteOptions=function(e,t){F.isIE||(this.isViewPasteOptions?this.pasteElement&&"block"===this.pasteElement.style.display||this.createPasteElement(e,t):this.pasteElement&&(this.pasteElement.style.display="none",je(this.owner.editorModule)||(this.owner.editorModule.isHtmlPaste=!1)))},u.prototype.getRect=function(e){var t,i,n,o=e.location,e=this.getSelectionPage(e);return e?(t=this.owner.documentHelper,i=e.boundingRectangle.x+Math.round(o.x)*t.zoomFactor,n=this.viewer.pageGap,n=(e.boundingRectangle.y-n*(e.index+1))*t.zoomFactor+n*(e.index+1)+Math.round(o.y)*t.zoomFactor,new kri(i,n)):new kri(0,0)},u.prototype.getSelectionPage=function(e){e=this.getLineWidgetInternal(e.currentWidget,e.offset,!0);if(e)return this.getPage(e.paragraph)},u.prototype.updateCaretSize=function(e,t){var i=0,n=!1,o=0;if(this.characterFormat.italic&&(n=this.characterFormat.italic),e.paragraph.isEmpty()){var r=e.paragraph,r=this.getParagraphMarkSize(r,i,0),i=r.topMargin,r=(r.bottomMargin,r.height),s=this.characterFormat.baselineAlignment,a=r,o=(i="Normal"!==s&&(a/=1.5,"Subscript"===s)?r-a:i)<0?i+a:a;t||(this.caret.style.height=o*this.documentHelper.zoomFactor+"px"),i=0}else{var s=e.currentWidget.getInline(e.offset,0),a=s.index,e=s.element;if(!je(e)){if(o=(s=this.getCaretHeight(e,a,e.characterFormat,!0,i,n)).height,e.characterFormat.hidden&&0===s.height){for(var l=e;l&&l.characterFormat.hidden;)l=l.previousElement;if(je(l))for(l=e;l&&l.characterFormat.hidden;)l=l.nextElement;je(l)||(r=this.documentHelper.textHelper.getHeight(l.characterFormat).Height,o=s.height=r)}t||(this.caret.style.height=s.height*this.documentHelper.zoomFactor+"px")}}return t||(this.caret.style.transform=n?"rotate(13deg)":""),{topMargin:i,height:o}},u.prototype.updateCaretToPage=function(e,t){je(t)||(this.documentHelper.selectionEndPage=t,this.owner.selectionModule.isEmpty?this.documentHelper.selectionStartPage=t:(t=this.getLineWidgetParagraph(e.offset,e.paragraph.childWidgets[0]),je(e=this.getPage(t.paragraph))||(this.documentHelper.selectionStartPage=e))),this.owner.enableAutoFocus&&this.checkForCursorVisibility()},u.prototype.getCaretBottom=function(e,t){var i,n,o,r,s=e.location.y;return e.paragraph.isEmpty()?(o=e.paragraph,o=(n=this.getParagraphMarkSize(o,o=0,r=0)).topMargin,r=n.bottomMargin,s=s+n.height+o,t||(s+=r)):(i=(r=e.paragraph.getInline(e.offset,n=0)).element,n=r.index,o=(r=this.getCaretHeight(i,n,i.characterFormat,!1,o=0,!1)).topMargin,r.isItalic,s+=r.height,t&&(s-=Y.convertPointToPixel(this.documentHelper.layout.getAfterSpacing(e.paragraph)))),s},u.prototype.checkForCursorVisibility=function(){this.showCaret()},u.prototype.onKeyDownInternal=function(e,t,i,n){var o,r,s=e.which||e.keyCode;if(this.owner.focusIn(),!t||i||n)if(!i||t||n)if(i&&t&&!n)switch(s){case 32:this.owner.editorModule.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();break;case 56:this.owner.toggleShowHiddenMarksInternal()}else switch(s){case 33:e.preventDefault(),this.handlePageUpPageDownKey(!1,i);break;case 34:e.preventDefault(),this.handlePageUpPageDownKey(!0,i);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(this.documentHelper.isCompleted=!1,s){case 33:e.preventDefault(),this.handlePageUpPageDownKey(!1,i);break;case 34:e.preventDefault(),this.handlePageUpPageDownKey(!0,i);break;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,s){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.selectionModule.selectAll();break;case 67:e.preventDefault(),this.copy();break;case 70:e.preventDefault(),je(this.owner.optionsPaneModule)||(this.owner.documentEditorSettings.showNavigationPane=!0,this.owner.optionsPaneModule.showHideOptionsPane(!0))}this.isFormField()&&!this.documentHelper.isDocumentProtected&&(s=this.getCurrentFormField(!0))&&s.formFieldData instanceof lli&&(s=37===e.keyCode||38===e.keyCode||40===e.keyCode?s:s.nextElement instanceof Dli?s.nextElement.reference:s.fieldEnd,o=39===e.keyCode?1:0,r=s.line.getOffset(s,o),r=this.getPhysicalPositionInternal(s.line,r,!1),this.selectInternal(s.line,s,o,r)),(!this.owner.isReadOnlyMode||this.documentHelper.isCommentOnlyMode||this.isInlineFormFillMode()||this.documentHelper.isDocumentProtected&&"FormFieldsOnly"===this.documentHelper.protectionType&&this.documentHelper.owner.editor.canEditContentControl&&!je(this.documentHelper.selection)&&this.documentHelper.selection.checkContentControlLocked()||this.documentHelper.isDocumentProtected&&"FormFieldsOnly"===this.documentHelper.protectionType&&(9===e.keyCode||32===e.keyCode))&&this.owner.editorModule.onKeyDownInternal(e,t,i,n),this.owner.searchModule&&!je(this.owner.searchModule.searchHighlighters)&&0<this.owner.searchModule.searchHighlighters.length&&this.owner.searchModule.searchResults.clear(),27!==e.keyCode&&27!==e.which||(je(this.owner.optionsPaneModule)||(this.owner.optionsPaneModule.showHideOptionsPane(!1),this.documentHelper.updateFocus()),this.owner.enableHeaderAndFooter&&this.disableHeaderFooter())},u.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,i);if(this.isCursorInFooterRegion(e,i))return!this.owner.enableHeaderAndFooter&&this.enableHeadersFootersRegion(i.footerWidget,i)}return!!this.owner.enableHeaderAndFooter&&(this.owner.enableHeaderAndFooter=!1,this.documentHelper.updateTextPositionForSelection(t,1),!0)},u.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 nai||this.viewer.containerLeft+e.x>=t.boundingRectangle.x&&this.viewer.containerLeft+e.x<=t.boundingRectangle.x+t.boundingRectangle.width},u.prototype.isCursorInHeaderRegion=function(e,t){if(this.viewer instanceof nai){var i=this.getPageTop(t),n=0,o=t.headerWidget,o=(o&&(n=o.y+o.height),o.isEmpty&&!this.owner.enableHeaderAndFooter),r=Y.convertPointToPixel(t.bodyWidgets[0].sectionFormat.topMargin),t=Y.convertPointToPixel(t.bodyWidgets[0].sectionFormat.pageHeight),o=o?r:Math.min(Math.max(n,r),t/100*40);if(o*=this.documentHelper.zoomFactor,this.viewer.containerTop+e.y>=i&&this.viewer.containerTop+e.y<=i+o)return!0}return!1},u.prototype.isCursorInFooterRegion=function(e,t){if(this.viewer instanceof nai){var i=t.boundingRectangle,n=this.getPageTop(t),o=n+i.height*this.documentHelper.zoomFactor,r=Y.convertPointToPixel(t.bodyWidgets[0].sectionFormat.footerDistance),s=0,a=(t.footerWidget&&(s=t.footerWidget.height),Y.convertPointToPixel(t.bodyWidgets[0].sectionFormat.bottomMargin)),t=t.footerWidget.isEmpty&&!this.owner.enableHeaderAndFooter,l=i.height,l=t?(l-a)*this.documentHelper.zoomFactor:(l-Math.min(i.height/100*40,Math.max(s+r,a)))*this.documentHelper.zoomFactor;if(this.viewer.containerTop+e.y<=o&&this.viewer.containerTop+e.y>=n+l)return!0}return!1},u.prototype.enableHeadersFootersRegion=function(e,t){return this.viewer instanceof nai&&(this.owner.enableHeaderAndFooter=!0,e.page=t,this.comparePageWidthAndMargins(e,t),this.updateTextPositionForBlockContainer(e),this.shiftBlockOnHeaderFooterEnableDisable(),!0)},u.prototype.disableXml=function(){var e=this.getPage(this.start.paragraph);this.updateTextPositionForBlockContainer(e.bodyWidgets[0]),this.owner.enableHeaderAndFooter=!1,this.shiftBlockOnHeaderFooterEnableDisable()},u.prototype.comparePageWidthAndMargins=function(e,t){var i,n,o=-1!=e.headerFooterType.indexOf("Header"),r=!1,t=o?t.headerWidgetIn:t.footerWidgetIn;je(t)||(i=e.sectionFormat,n=t.sectionFormat,je(i)||je(n)||(o?e.width==t.width&&i.headerDistance==n.headerDistance||(r=!0):e.width==t.width&&i.footerDistance==n.footerDistance||(r=!0)),r&&(this.owner.viewer.updateHFClientArea(e.sectionFormat,o),this.documentHelper.layout.layoutHeaderFooterItems(this.owner.viewer,e)))},u.prototype.shiftBlockOnHeaderFooterEnableDisable=function(){for(var e=0;e<this.documentHelper.headersFooters.length;e++){var t=this.documentHelper.headersFooters[e],i=this.getBodyWidgetInternal(e,0);if(!je(i))for(var n=i.sectionFormat,o=0,r=Object.keys(t);o<r.length;o++){var s=t[r[o]];s.isEmpty&&this.owner.editorModule.shiftPageContent(s.headerFooterType,n)}}},u.prototype.updateTextPositionForBlockContainer=function(e){e=e.firstChild;e instanceof _ai&&(e=this.getFirstBlockInFirstCell(e))instanceof _ai&&(e=this.getFirstBlockInFirstCell(e)),this.selectParagraphInternal(e,!0)},u.prototype.disableHeaderFooter=function(){var e=this.getPage(this.start.paragraph);this.updateTextPositionForBlockContainer(e.bodyWidgets[0]),this.owner.enableHeaderAndFooter=!1,this.shiftBlockOnHeaderFooterEnableDisable()},u.prototype.clear=function(){this.editRegionHighlighters&&this.editRegionHighlighters.clear(),this.editRangeCollection=[],this.selectedWidgets&&this.selectedWidgets.clear(),this.contentControleditRegionHighlighters&&this.contentControleditRegionHighlighters.clear(),this.contentControls=[],this.currentContentControl=void 0},u.prototype.destroy=function(){je(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,this.upDownSelectionLength=void 0,this.isSkipLayouting=void 0,this.isImageSelected=void 0,je(this.documentHelper)||(this.documentHelper=void 0),this.contextTypeInternal=void 0,this.isRetrieveFormatting=void 0,this.characterFormatIn&&this.characterFormatIn.destroy(),this.characterFormatIn=void 0,this.paragraphFormatIn&&this.paragraphFormatIn.destroy(),this.paragraphFormatIn=void 0,this.sectionFormatIn&&this.sectionFormatIn.destroy(),this.sectionFormatIn=void 0,this.tableFormatIn&&this.tableFormatIn.destroy(),this.tableFormatIn=void 0,this.cellFormatIn&&this.cellFormatIn.destroy(),this.cellFormatIn=void 0,this.rowFormatIn&&this.rowFormatIn.destroy(),this.rowFormatIn=void 0,this.imageFormatInternal=void 0,this.skipFormatRetrieval=void 0,this.startInternal=void 0,this.endInternal=void 0,this.htmlWriterIn=void 0,this.toolTipElement=void 0,je(this.toolTipObject)||this.toolTipObject.destroy(),this.toolTipField=void 0,this.isMoveDownOrMoveUp=void 0,this.pasteElement=void 0,this.currentPasteAction=void 0,this.isViewPasteOptions=void 0,this.skipEditRangeRetrieval=void 0,this.editPosition=void 0,je(this.selectedWidgets)||this.selectedWidgets.destroy(),this.isHighlightEditRegionIn=void 0,this.isHighlightFormFields=void 0,this.editRangeCollection=[],this.editRangeCollection=void 0,this.isHightlightEditRegionInternal=void 0,this.isCurrentUser=void 0,this.isHighlightNext=void 0,this.hightLightNextParagraph=void 0,this.isWebLayout=void 0,je(this.editRegionHighlighters)||this.editRegionHighlighters.destroy(),je(this.formFieldHighlighters)||this.formFieldHighlighters.destroy(),je(this.contentControleditRegionHighlighters)||this.contentControleditRegionHighlighters.destroy(),this.isCellPrevSelected=void 0,this.currentFormField=void 0,this.contentControls=[]},u.prototype.getCellsToSelect=function(e,t,i,n){var o=e.childWidgets;if(!(je(n.paragraph.associatedCell)||!je(n.reference)&&je(n.reference.paragraph.associatedCell))){for(var e=n.paragraph.associatedCell.ownerRow.rowIndex,r=n.reference.paragraph.associatedCell.ownerRow.rowIndex,s=[],a=e;a<=r;a++)for(var l=o[a],h=t;h<=i;h++){var d=l.childWidgets[h];je(d)||s.push(d)}return s}},u.prototype.selectBookmarkInTable=function(e){this.documentHelper.clearSelectionHighlight();var t=parseInt(e.properties.columnFirst),i=parseInt(e.properties.columnLast),n=e.paragraph.associatedCell.ownerTable,o=this.getCellsToSelect(n,t,i,e);if(!je(o))for(var r=0;r<o.length;r++)this.highlightCellWidget(o[r])},u.prototype.navigateBookmark=function(e,t,i){var n,o=this.documentHelper.bookmarks;o.containsKey(e)&&(je((o=o.get(e)).properties)?(e=o.line.getOffset(o,0),i&&e++,(n=new rci(this.owner)).setPositionParagraph(o.line,e),t?this.documentHelper.selection.selectRange(n,n,!0):(e=o.reference,t=(e=o.reference&&null==o.reference.line.paragraph.bodyWidget?o:e).line.getOffset(e,1),e instanceof Dli&&!i&&(je(e.properties)||e.properties.isAfterParagraphMark&&(t=e.line.getOffset(e,1))),i&&t--,(i=new rci(this.owner)).setPositionParagraph(e.line,t),this.documentHelper.selection.selectRange(n,i,!0))):this.selectBookmarkInTable(o))},u.prototype.selectBookmark=function(e,t){this.isSelectBookmark=!0,this.isExcludeBookmarkStartEnd=t,this.navigateBookmark(e,void 0,t),this.isSelectBookmark=!1},u.prototype.getTocField=function(){for(var e=this.start.paragraph,t=void 0;void 0!==e&&this.isTocStyle(e);)e=(t=e).previousRenderedWidget;if(void 0!==t){var i=t.childWidgets[0];if(void 0!==i)return i.children[0]}},u.prototype.isTocStyle=function(e){e=e.paragraphFormat.baseStyle;return void 0!==e&&-1!==e.name.toLowerCase().indexOf("toc")},u.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 Zai){i=this.owner.selectionModule.getFieldCode(i);if(i.match("TOC ")||i.match("Toc"))return!0}}return!1},u.prototype.getElementsForward=function(e,t,i,n){if(!je(t)){for(var o=[],r=e.children.indexOf(t);0<=r;){for(var s=r;s<e.children.length;s++){var a=e.children[s];if(a.line!==e){r=-1;break}if(a===i){o.push(a),r=-1;break}o.push(a)}r=-1}return 0===o.length?void 0:o}},u.prototype.getElementsBackward=function(e,t,i,n){for(var o=[];n&&t&&t.previousElement&&(!t.isRightToLeft||t instanceof pli&&this.documentHelper.textHelper.isRTLText(t.text));)t=t.previousElement;for(var r=e.children.indexOf(t);0<=r;){for(var s=r;-1<s&&s<e.children.length;n?s++:s--){var a=e.children[s];if(a.line!==e){r=-1;break}if(o.push(a),a===i){r=-1;break}}r=-1}return o},u.prototype.navigatePreviousComment=function(){this.commentNavigateInternal(!1)},u.prototype.navigateNextComment=function(){this.commentNavigateInternal(!0)},u.prototype.commentNavigateInternal=function(e){if(!this.documentHelper.currentSelectedComment){if(0===this.documentHelper.comments.length)return;this.documentHelper.currentSelectedComment=this.documentHelper.comments[0]}var t,i,n;this.documentHelper.currentSelectedComment&&(t=this.documentHelper.comments,n=this.documentHelper.currentSelectedComment,i=t.indexOf(n),n=e?i===t.length-1?t[0]:t[i+1]:0===i?t[t.length-1]:t[i-1],this.documentHelper.currentSelectedComment=n,this.selectComment(n))},u.prototype.navigatePreviousRevision=function(){this.revisionNavigateInternal(!1)},u.prototype.navigateNextRevision=function(){this.revisionNavigateInternal(!0)},u.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)}var t,i,n;this.documentHelper.currentSelectedRevision&&(t=this.documentHelper.owner.revisions.changes,n=this.documentHelper.currentSelectedRevision,i=t.indexOf(n),n=e?i===t.length-1?t[0]:t[i+1]:0===i?t[t.length-1]:t[i-1],this.documentHelper.currentSelectedRevision=n,this.selectRevision(n)),this.owner.trackChangesPane.currentSelectedRevision=this.documentHelper.currentSelectedRevision},u.prototype.selectComment=function(e){var t,i;je(e)||(t=this.getElementPosition(e.commentStart,!0).startPosition,i=this.getElementPosition(e.commentEnd,!1).startPosition,this.owner.commentReviewPane&&this.owner.commentReviewPane.selectComment(e),this.selectPosition(t,i))},u.prototype.selectRevision=function(e,t,i){var n=!1;if(je(t)&&je(i)&&(n=!0),!je(e)&&0<e.range.length){var o=e.range[0],e=e.range[e.range.length-1],r=void 0;if(o instanceof Eri?r=o.ownerBase:o instanceof Cri||(r=o.line.paragraph),je(r)||je(r.bodyWidget)||!(r.bodyWidget instanceof Iai)||!je(r.bodyWidget.page)&&(je(r.bodyWidget.page)||-1!==r.bodyWidget.page.index))if(o instanceof Cri){var r=o.ownerBase,s=r.childWidgets[0],r=r.childWidgets[r.childWidgets.length-1],s=this.getFirstParagraph(s),r=this.getLastParagraph(r);this.start.setPosition(s.firstChild,!0),this.end.setPositionParagraph(r.lastChild,r.lastChild.getEndOffset()+1),this.selectPosition(this.start,this.end)}else if(o&&e){je(t)&&(t=new rci(this.owner));var a=0;if(o instanceof Eri){var l,a=1<(l=o.ownerBase).childWidgets.length?this.getParagraphLength(l)-this.getParagraphLength(l,l.lastChild):this.isEmptyWidget(l)?0:l.getLength();t.setPositionParagraph(l.lastChild,a)}else{a=o.line.getOffset(o,0);var h=o.line;if(h.isFirstLine())for(var d=0;d<h.children.length;d++){if(o===h.children[d]&&h.children[d]instanceof pli&&!(h.children[d]instanceof fli)){a=0;break}if(h.children[d]instanceof pli)break}t.setPositionForLineWidget(o.line,a)}je(i)&&(i=new rci(this.owner)),e instanceof Eri?(((l=(s=(l=e.ownerBase).getSplitWidgets())[s.length-1]).isEndsWithPageBreak||l.isEndsWithColumnBreak)&&(this.owner.trackChangesPane.isTrackingPageBreak=!0),a=1<l.childWidgets.length?this.getParagraphLength(l)-this.getParagraphLength(l,l.lastChild):l.getLength(),i.setPositionParagraph(l.lastChild,a+1)):(a=e.line.getOffset(e,0)+e.length,this.isTOC()&&(a+=1),i.setPositionForLineWidget(e.line,a));r=t.clone();t.isExistBefore(i)||(t=i,i=r),n&&this.selectPosition(t,i)}}},u.prototype.isEmptyWidget=function(e){if(e instanceof _ai)return!1;if(!e.isEmpty())for(var t=0;t<e.childWidgets.length;t++)for(var i=e.childWidgets[t],n=0;n<i.children.length;n++)if(i.children[n]instanceof pli)return!1;return!0},u.prototype.selectTableRevision=function(e){var t;!je(e)&&0<e[0].range.length&&(t=e[0].range[0],e=e[e.length-1].range[0],t instanceof Cri)&&(t=t.ownerBase.childWidgets[0],e=(e=e.ownerBase).childWidgets[e.childWidgets.length-1],t=this.getFirstParagraph(t),e=this.getLastParagraph(e),this.start.setPosition(t.firstChild,!0),this.end.setPositionParagraph(e.lastChild,e.lastChild.getEndOffset()+1),this.selectPosition(this.start,this.end))},u.prototype.updateEditRangeCollection=function(){if(0<this.editRangeCollection.length&&(this.editRangeCollection=[]),this.documentHelper.isDocumentProtected){if(this.documentHelper.editRanges.containsKey(this.owner.currentUser)){o=this.documentHelper.editRanges.get(this.owner.currentUser);for(i=0;i<o.length;i++)je(o[i].editRangeEnd)||this.editRangeCollection.push(o[i])}if(this.documentHelper.editRanges.containsKey("Everyone"))for(var e="Everyone",t=this.documentHelper.editRanges.get(e),i=0;i<t.length;i++)je(t[i].editRangeEnd)||this.editRangeCollection.push(t[i])}else for(var n=0;n<this.documentHelper.editRanges.length;n++)for(var e=this.documentHelper.editRanges.keys[n],o=this.documentHelper.editRanges.get(e),i=0;i<o.length;i++)je(o[i].editRangeEnd)||this.editRangeCollection.push(o[i])},u.prototype.onHighlight=function(){this.isHighlightEditRegion?this.highlightEditRegion():this.unHighlightEditRegion(),this.viewer.renderVisiblePages()},u.prototype.onHighlightContentControl=function(){if(this.isHighlightContentControlEditRegion&&0<this.documentHelper.contentControlCollection.length)for(var e=0;e<this.documentHelper.contentControlCollection.length;e++)this.documentHelper.contentControlCollection[e].paragraph.isInHeaderFooter&&"Continuous"===this.documentHelper.owner.layoutType||this.documentHelper.contentControlCollection[e].line.paragraph.bodyWidget.page&&this.documentHelper.contentControlCollection[e].line.paragraph.bodyWidget.page.documentHelper&&this.highlightContentControlEditRegionInternal(this.documentHelper.contentControlCollection[e])},u.prototype.highlightContentControlEditRegionInternal=function(e){var t=this.getPosition(e);if(!je(t.startPosition)&&!je(t.endPosition))for(var i=t.startPosition,n=t.endPosition,o=(this.highlight(e.line.paragraph,i,n,e),e.line.paragraph);o!==n.paragraph;){if(!(o.nextRenderedWidget instanceof Lai))return;o=o.nextRenderedWidget,this.highlight(o,i,n,e)}},u.prototype.selectPlaceHolderText=function(e){e.contentControlProperties&&e.contentControlProperties.hasPlaceHolderText&&("RichText"===e.contentControlProperties.type||"Text"===e.contentControlProperties.type)&&this.selectContentControlInternal(e)},u.prototype.isPlainContentControl=function(){var e=this.owner.editorModule.getContentControl();return!(!e||!e.contentControlProperties||"Text"!==e.contentControlProperties.type)},u.prototype.highlightEditRegion=function(){if(this.updateEditRangeCollection(),this.owner.enableLockAndEdit)this.viewer.updateScrollBars();else if(this.isHighlightEditRegion){this.isHightlightEditRegionInternal=!0,je(this.editRegionHighlighters)&&(this.editRegionHighlighters=new uJt),this.editRegionHighlighters.clear();for(var e=0;e<this.editRangeCollection.length;e++)this.highlightEditRegionInternal(this.editRangeCollection[e]);this.isHightlightEditRegionInternal=!1,this.viewer.updateScrollBars()}else this.unHighlightEditRegion()},u.prototype.highlightFormFields=function(){je(this.formFieldHighlighters)&&(this.formFieldHighlighters=new uJt),this.formFieldHighlighters.clear();var e=this.documentHelper.formFields;if(!je(e)&&0<e.length){for(var t=0;t<e.length;t++){var i,n,o,r=e[t];Y.isLinkedFieldCharacter(r)&&(n=r.line.getOffset(r,0),(i=new rci(this.owner)).setPositionParagraph(r.line,n),n=(r=r.fieldEnd).line.getOffset(r,1),(o=new rci(this.owner)).setPositionParagraph(r.line,n),this.isHighlightFormFields=!0,this.highlight(i.paragraph,i,o),this.isHighlightNext)&&(this.highlightNextBlock(this.hightLightNextParagraph,i,o),this.isHighlightNext=!1,this.hightLightNextParagraph=void 0)}this.isHighlightFormFields=!1,this.viewer.updateScrollBars()}},u.prototype.unHighlightEditRegion=function(){je(this.editRegionHighlighters)||(this.editRegionHighlighters.clear(),this.editRegionHighlighters=void 0),this.isHightlightEditRegionInternal=!1},u.prototype.highlightEditRegionInternal=function(e){var t=this.getPosition(e),i=t.startPosition,t=t.endPosition;this.isCurrentUser=!0,this.highlightEditRegions(e,i,t),this.isCurrentUser=!1},u.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,i=i.endPosition;this.highlightEditRegions(t,n,i)}},u.prototype.highlightEditRegions=function(e,t,i){if(!e.line.paragraph.isInsideTable||e.line.paragraph.isInsideTable&&!e.editRangeEnd.line.paragraph.isInsideTable||-1===e.columnFirst)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 o=0;o<n.childWidgets.length;o++)n.childWidgets[o]instanceof Lai&&(this.highlight(n.childWidgets[o],t,i),this.isHighlightNext)&&(this.highlightNextBlock(this.hightLightNextParagraph,t,i),this.isHighlightNext=!1,this.hightLightNextParagraph=void 0)}},u.prototype.navigateToNextEditingRegion=function(){var e,t,i=this.getEditRangeStartElement(!0);0<this.editRangeCollection.length&&(this.sortEditRangeCollection(),t=e=this.editRangeCollection.length,i=(t=je(i)?e:this.editRangeCollection.indexOf(i))<e-1?this.editRangeCollection[t+1]:this.editRangeCollection[0],t=(e=this.getPosition(i,!0)).startPosition,i=e.endPosition,this.selectRange(t,i))},u.prototype.sortEditRangeCollection=function(){for(var e=this.editRangeCollection.length-1;0<=e;e--)for(var t=1;t<=e;t++){var i=this.getPosition(this.editRangeCollection[t-1]).startPosition,n=this.getPosition(this.editRangeCollection[t]).startPosition;i.isExistAfter(n)&&(i=this.editRangeCollection[t-1],this.editRangeCollection[t-1]=this.editRangeCollection[t],this.editRangeCollection[t]=i)}},u.prototype.toggleEditingRegionHighlight=function(){this.isHighlightEditRegion=!this.isHighlightEditRegion},u.prototype.getEditRangeStartElement=function(e){for(var t=0;t<this.editRangeCollection.length;t++){var i=this.editRangeCollection[t],n=this.getPosition(i,e),o=n.startPosition,n=n.endPosition;if((this.start.isExistAfter(o)||this.start.isAtSamePosition(o))&&(this.end.isExistBefore(n)||this.end.isAtSamePosition(n)))return i}},u.prototype.isSelectionInEditRegion=function(){return!!this.documentHelper.isDocumentProtected&&this.checkSelectionIsAtEditRegion()},u.prototype.checkSelectionIsAtEditRegion=function(e,t){je(e)&&je(t)&&(e=this.start,t=this.end,this.isForward||(e=this.end,t=this.start)),0<this.editRangeCollection.length&&this.isFootEndNoteParagraph(e.paragraph)&&this.isFootEndNoteParagraph(t.paragraph)&&e.paragraph.containerWidget==t.paragraph.containerWidget&&(t=e=this.getElementPosition(e.paragraph.containerWidget.footNoteReference,!0).startPosition);for(var i=0;i<this.editRangeCollection.length;i++){var n=this.editRangeCollection[i];if(!n.line.paragraph.isInsideTable||n.line.paragraph.isInsideTable&&!n.editRangeEnd.line.paragraph.isInsideTable||-1===n.columnFirst){if(this.isSelectionInsideEditRange(n,e,t))return!0}else if(n.paragraph.isInsideTable&&n.editRangeEnd&&n.editRangeEnd.line.paragraph.isInsideTable){var o=n.paragraph.associatedCell.ownerRow,r=e.paragraph.associatedCell,s=t.paragraph.associatedCell;if(!je(r)&&!je(s)&&o.equals(r.ownerRow)&&o.equals(s.ownerRow)&&r.index>=n.columnFirst&&r.index<=n.columnLast)if(this.isEmpty&&r.index===n.line.paragraph.associatedCell.index){if(this.isSelectionInsideEditRange(n,e,t))return!0}else if(!this.isCellSelected(r,e,t))return!0}}return!1},u.prototype.isEditRangeCellSelected=function(e,t){je(e)&&je(t)&&(e=this.start,t=this.end,this.isForward||(e=this.end,t=this.start));for(var i=0;i<this.editRangeCollection.length;i++){var n=this.editRangeCollection[i];if(n.paragraph.isInsideTable&&n.editRangeEnd&&n.editRangeEnd.line.paragraph.isInsideTable){var o=e.paragraph.associatedCell,r=t.paragraph.associatedCell,s=n.paragraph.associatedCell;if(!je(o)&&!je(r)&&o.index>=n.columnFirst&&o.index<=n.columnLast&&this.isCellSelected(s,e,t))return!0}}return!1},u.prototype.isSelectionInsideEditRange=function(e,t,i){var e=this.getPosition(e),n=e.startPosition,e=e.endPosition;return!(!t.isExistAfter(n)&&!t.isAtSamePosition(n)||!i.isExistBefore(e)&&!i.isAtSamePosition(e))},u.prototype.getPosition=function(e,t){var i,n,o=e.line.getOffset(e,1),r=new rci(this.owner);return r.setPositionParagraph(e.line,o),e instanceof ghi?i=e.editRangeEnd:e instanceof Pli||e instanceof Dli?i=e.reference:e instanceof Khi&&(i=e.comment.commentEnd),i&&(e=i.line,je(i.line)||je(e.children)?n=r.clone():(o=i.line.getOffset(i,t||i instanceof Pli&&this.isSelectionisInCC?0:1),(n=new rci(this.owner)).setPositionParagraph(i.line,o))),{startPosition:r,endPosition:n}},u.prototype.checkContentControlLocked=function(e){this.owner.editorModule.isXmlMapped=!1,this.isSelectionisInCC=!0;for(var t=0;t<this.documentHelper.contentControlCollection.length;t++){var i=this.documentHelper.contentControlCollection[t];if(!je(i.reference)&&-1!==i.reference.indexInOwner){var n=this.getPosition(i),o=n.startPosition,n=n.endPosition,r=this.start,s=this.end;if(this.isForward||(r=this.end,s=this.start),je(e)){var a=(o.isExistAfter(r)||o.isAtSamePosition(r))&&(o.isExistBefore(s)||o.isAtSamePosition(s)),l=(n.isExistAfter(r)||n.isAtSamePosition(r))&&(n.isExistBefore(s)||n.isAtSamePosition(s));if(a&&l)return!(!i.contentControlProperties.lockContentControl&&!this.documentHelper.isFormFillProtectedMode||(this.owner.trigger(FJt),0));if((a||l)&&!o.isAtSamePosition(r)&&!n.isAtSamePosition(r)&&(i.contentControlProperties.lockContentControl||i.contentControlProperties.lockContents))return!0}if(e){a=(o.isExistAfter(r)||o.isAtSamePosition(r))&&(o.isExistBefore(s)||o.isAtSamePosition(s)),l=(n.isExistAfter(r)||n.isAtSamePosition(r))&&(n.isExistBefore(s)||n.isAtSamePosition(s));if(a&&l)return!!i.contentControlProperties.lockContents&&(this.owner.trigger(FJt),!0);if((a||l)&&!o.isAtSamePosition(r)&&!n.isAtSamePosition(r)&&i.contentControlProperties.lockContents)return!0}if((r.isExistAfter(o)||r.isAtSamePosition(o))&&(s.isExistBefore(n)||s.isAtSamePosition(n))){if(i.contentControlProperties.xmlMapping&&i.contentControlProperties.xmlMapping.isMapped&&(this.owner.editorModule.isXmlMapped=!0),i.contentControlProperties.lockContents)return this.owner.trigger(FJt),!0;if(je(e)&&("CheckBox"===i.contentControlProperties.type||"ComboBox"===i.contentControlProperties.type||"DropDownList"===i.contentControlProperties.type||"Date"===i.contentControlProperties.type||"Picture"===i.contentControlProperties.type||"Text"===i.contentControlProperties.type||"RichText"===i.contentControlProperties.type))return this.owner.trigger(FJt),!0}}}return!1},u.prototype.getElementPosition=function(e,t){var t=e.line.getOffset(e,t?0:1),i=new rci(this.owner);return i.setPositionParagraph(e.line,t),{startPosition:i,endPosition:void 0}},u.prototype.updateRefField=function(e){var t,i,n,o,r;je(e)&&(e=this.getHyperlinkField(!0)),je(e)||this.isReferenceField(e)&&0===(r=(r=this.getFieldCode(e).replace(/\s+/g," ")).trim()).toLowerCase().indexOf("ref")&&1<(r=r.split(" ")).length&&(r=r[1],this.documentHelper.bookmarks.containsKey(r))&&(t=this.start,i=this.end,this.isForward||(t=this.end,i=this.start),o=(r=this.documentHelper.bookmarks.get(r)).reference,!je(n=r.previousNode)&&n instanceof Zai||!o||!(o.previousNode instanceof Zai)||1!==o.previousNode.fieldType||je(o.previousNode.fieldBegin)||je(o.previousNode.fieldBegin.formFieldData)?n instanceof Zai&&0===n.fieldType&&!je(n.formFieldData)&&(r=n.fieldSeparator,o=n.fieldEnd):(r=o.previousNode.fieldBegin.fieldSeparator,o=o.previousNode.fieldBegin.fieldEnd),n=r.line.getOffset(r,1),t.setPositionParagraph(r.line,n),i.setPositionParagraph(o.line,o.line.getOffset(o,0)),r=this.owner.sfdtExportModule.write(this.owner.documentEditorSettings.optimizeSfdt?1:0,t.currentWidget,t.offset,i.currentWidget,i.offset,!1,!0),n=e.fieldSeparator,o=e.fieldEnd,t.setPositionParagraph(n.line,n.line.getOffset(n,1)),i.setPositionParagraph(o.line,o.line.getOffset(o,0)),this.owner.editorModule.pasteContents(r))},u.prototype.footnoteReferenceElement=function(e,t,i){var n=0;if(this.getContainerWidget(e.paragraph)instanceof Pai)for(var o=this.start.paragraph.bodyWidget.footNoteReference,r=0;r<this.documentHelper.pages.length;r++)for(var s=this.documentHelper.pages[r],a=n=0;a<s.bodyWidgets.length;a++)for(var l=s.bodyWidgets[a],h=0;h<l.childWidgets.length;h++){var d=l.childWidgets[h];if(d instanceof _ai)for(var p=0;p<d.childWidgets.length;p++)for(var c=d.childWidgets[p],u=0;u<c.childWidgets.length;u++)for(var g=c.childWidgets[u],m=0;m<g.childWidgets.length;m++)for(var f=g.childWidgets[m],y=0;y<f.childWidgets.length;y++){n=0;if(!je((b=f.childWidgets[y]).children))for(var v=0;v<b.children.length;v++)n+=(C=b.children[v]).length,C instanceof fli&&C===o&&(e.setPositionParagraph(b,n-1),t.setPositionParagraph(b,n),this.selectRange(e,t))}else for(var b,w=0;w<d.childWidgets.length;w++)if(n=0,!je((b=d.childWidgets[w]).children))for(var C,v=0;v<b.children.length;v++)n+=(C=b.children[v]).length,C instanceof fli&&C===o&&(e.setPositionParagraph(b,n-1),t.setPositionParagraph(b,n),this.selectRange(e,t))}},u.prototype.getAbsolutePositionFromRelativePosition=function(e){var e="string"==typeof e?this.getTextPosBasedOnLogicalIndex(e):e,e=this.getParagraphInfo(e),t={position:0,done:!1};return this.getPositionInfoForHeaderFooter(e,t),t.position},u.prototype.getPositionInfoForBodyContent=function(e,t,i,n){i=je(i)?this.documentHelper.pages[0].bodyWidgets[0].childWidgets[0]:i;return t.position+=this.getBlockIndex(i,e,t,n),t},u.prototype.getPositionInfoForHeaderFooter=function(e,t,i){return(t=this.getPositionInfoForBodyContent(e,t,void 0,i)).done||this.getBlockIndexFromHeaderFooter(e,t,i),t},u.prototype.getBlockIndexFromHeaderFooter=function(e,t,i){for(var n=0,o=this.documentHelper.headersFooters;n<o.length;n++)for(var r=o[n],s=0;s<6;s++){var a=r[s];if(a){if(t.position+=this.getBlockIndex(a.childWidgets[0],e,t,i),t.done)return t}else t.position+=1}return t},u.prototype.getBlockIndex=function(e,t,i,n){var o=0,r={length:0};do{if(e instanceof Lai&&!je(t)&&!je(t.paragraph)&&t.paragraph.equals(e)){o+=1;var s=e.getInline(t.offset,0);o+=this.getBlockOffsetByElement(t,e,s.element,s.index,r),i.done=!0;break}if(o=this.getBlockLength(t,e,o,i,!0,n,r),i.done)break;if(!je(e))if(e.containerWidget instanceof Sai&&e.containerWidget.containerWidget instanceof Pai){s=e.getSplitWidgets().pop().nextRenderedWidget;if(!je(s)&&e.containerWidget!==s.containerWidget)break;e=s}else e=e.getSplitWidgets().pop().nextRenderedWidget}while(e);return o},u.prototype.getBlockTotalLength=function(e,t,i,n,o){for(var r=0,s=!1,a=e.getSplitWidgets(),l=0;l<a.length;l++)for(var h=0;h<a[l].childWidgets.length;h++)for(var d=a[l].childWidgets[h],p=0;p<d.children.length;p++){var c=d.children[p];if(!(c instanceof lhi)){if((c instanceof Xli||c instanceof fli)&&(c instanceof Xli?0<c.textFrame.childWidgets.length&&(r+=this.getBlockIndex(c.textFrame.childWidgets[0],t,i,void 0)):r+=this.getBlockIndex(c.bodyWidget.childWidgets[0],t,i,void 0),i.done))return r;(s=c instanceof Zai&&0==c.fieldType&&c.formFieldData instanceof lli?!0:s)&&c instanceof Zai&&1==c.fieldType&&c.previousNode instanceof pli&&(o.length+=c.previousNode.length,s=!1),c.skipformFieldLength||(r+=c.length)}}return r},u.prototype.getBlockLength=function(e,t,i,n,o,r,s){var a;if(e&&t instanceof Lai&&!je(e.paragraph)&&e.paragraph.equals(t))i+=1,a=t.getInline(e.offset,0),i+=this.getBlockOffsetByElement(e,t,a.element,a.index,s),this.isEndOffset&&t.isInsideTable&&t.associatedCell.lastChild.equals(t)&&e.offset===this.getParagraphLength(t)+1&&(i+=1),n.done=!0;else if(t instanceof Lai)i=(i+=1)+(o?this.getBlockTotalLength(t,e,n,r,s):t.getTotalLength());else if(t instanceof _ai){if(i+=1,!je(r)&&r instanceof _ai&&r.equals(t))return n.done=!0,i;for(var l=t.firstChild;l;){if(i+=1,!je(r)&&r instanceof jai&&r.equals(l))return n.done=!0,i;for(var h=l.firstChild;h;){if(i+=1,!je(r)&&r instanceof Uai&&r.equals(h))return n.done=!0,i;for(var d=h.firstChild;d;){if(i=this.getBlockLength(e,d,i,n,o,r,s),n.done)return i;d=d.getSplitWidgets().pop().nextRenderedWidget}h=h.nextWidget}var p=l.ownerTable.index;(l=l.getSplitWidgets().pop().nextRenderedWidget)&&l.ownerTable.index!==p&&(l=void 0)}}return i},u.prototype.calculateCellLength=function(e){for(var t=e.firstChild,i=0,n={done:!1},o={paragraph:null,offset:0};t;)i=this.getBlockLength(o,t,i,n,!0,void 0,void 0),t=t.getSplitWidgets().pop().nextRenderedWidget;return i},u.prototype.getBlockOffsetByElement=function(e,t,i,n,o){for(var r=0,s=!1,a=t.getSplitWidgets(),l=0;l<a.length;l++)for(var h=0;h<a[l].childWidgets.length;h++)for(var d=a[l].childWidgets[h],p=0;p<d.children.length;p++){var c=d.children[p];if(!(c instanceof lhi)){if((s=c instanceof Zai&&0==c.fieldType&&c.formFieldData instanceof lli?!0:s)&&c instanceof Zai&&1==c.fieldType&&c.previousNode instanceof pli&&(o.length+=c.previousNode.length,s=!1),c===i)return r+n;if(c instanceof Xli||c instanceof fli)if(c instanceof Xli){if(0<c.textFrame.childWidgets.length)for(var u=0;u<c.textFrame.childWidgets.length;u++)r=this.getBlockLength(e,c.textFrame.childWidgets[u],r,{done:!1},!1,void 0,void 0)}else if(0<c.bodyWidget.childWidgets.length)for(u=0;u<c.bodyWidget.childWidgets.length;u++)r=this.getBlockLength(e,c.bodyWidget.childWidgets[u],r,{done:!1},!1,void 0,void 0);c.skipformFieldLength||(r+=c.length)}}return r},u.prototype.getTableRelativeValue=function(e,t){if(e.currentWidget.paragraph.isInsideTable){if(this.isTableSelected())return 3;if(this.isRowSelect()&&t.paragraph.isInsideTable&&e.paragraph.associatedCell.ownerTable.equals(t.paragraph.associatedCell.ownerTable))return 2;var i=e.paragraph.associatedCell.ownerTable.getSplitWidgets(),i=this.getFirstBlockInFirstCell(i[0]);if(e.paragraph.associatedCell.equals(i.associatedCell)){if(t.paragraph.isInsideTable){if(e.paragraph.associatedCell.ownerTable.equals(t.paragraph.associatedCell.ownerTable))return 0;for(var n=this.isRowSelect()?2:3,o=e.paragraph.associatedCell.ownerTable;o.containerWidget instanceof Uai&&(n+=3,!(o=o.containerWidget.ownerTable).equals(t.paragraph.associatedCell.ownerTable)););return n}return 3}return t.currentWidget.paragraph.isInsideTable&&e.paragraph.associatedCell.ownerTable.equals(t.paragraph.associatedCell.ownerTable)?0:2}return 0},u.prototype.isRowSelect=function(){var e=this.start,t=this.end;if(this.isForward||(e=this.end,t=this.start),je(e.paragraph.associatedCell)||je(t.paragraph.associatedCell)||e.paragraph.associatedCell.equals(t.paragraph.associatedCell)||this.isTableSelected(!0))return!1;var i=!1;if((n=t.paragraph.associatedCell.ownerTable).containerWidget instanceof Uai)for(;n.containerWidget instanceof Uai;)for(var n=n.containerWidget.ownerTable,o=0;o<n.childWidgets.length;o++){var r=n.childWidgets[o];r.childWidgets[r.childWidgets.length-1].equals(n.containerWidget)&&(i=!0)}else for(o=0;o<n.childWidgets.length;o++){var s=n.childWidgets[o];s.childWidgets[s.childWidgets.length-1].equals(t.paragraph.associatedCell)&&(i=!0)}var a,l=e.paragraph.associatedCell.ownerRow.getSplitWidgets();return 0<l[0].childWidgets.length&&(a=l[0].childWidgets[0]),e.paragraph.associatedCell.equals(a)&&i};var kui=u;function u(e){var i=this;this.upDownSelectionLength=0,this.isSkipLayouting=!1,this.isImageSelected=!1,this.isExcludeBookmarkStartEnd=!1,this.contextTypeInternal=void 0,this.caret=void 0,this.isRetrieveFormatting=!1,this.isSelectCurrentWord=!1,this.isSelectionisInCC=!1,this.skipFormatRetrieval=!1,this.isModifyingSelectionInternally=!1,this.isMoveDownOrMoveUp=!1,this.isSelectBookmark=!1,this.isHighlightContentControlEditRegionIn=!0,this.htmlContent=void 0,this.sfdtContent=void 0,this.isEndOffset=!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.contentControlHighlighters=void 0,this.editRegionHighlighters=void 0,this.contentControleditRegionHighlighters=void 0,this.formFieldHighlighters=void 0,this.isSelectList=!1,this.previousSelectedFormField=void 0,this.previousSelectedContentControl=void 0,this.currentContentControl=void 0,this.isFormatUpdated=!1,this.isCellPrevSelected=!1,this.currentFormField=void 0,this.contentControls=[],this.isHomeEnd=!1,this.pasteOptions=function(e){var t=new Cn("documenteditor",i.owner.defaultLocale);t.setLocale(i.owner.locale),e.item.text===t.getConstant("Keep source formatting")?i.owner.editorModule.applyPasteOptions("KeepSourceFormatting"):e.item.text===t.getConstant("Match destination formatting")?i.owner.editorModule.applyPasteOptions("MergeWithExistingFormatting"):e.item.text===t.getConstant("NestTable")?i.owner.editorModule.applyTablePasteOptions("NestTable"):e.item.text===t.getConstant("InsertAsRows")?i.owner.editorModule.applyTablePasteOptions("InsertAsRows"):e.item.text===t.getConstant("InsertAsColumns")?i.owner.editorModule.applyTablePasteOptions("InsertAsColumns"):e.item.text===t.getConstant("OverwriteCells")?i.owner.editorModule.applyTablePasteOptions("OverwriteCells"):i.owner.editorModule.applyPasteOptions("KeepTextOnly")},this.hideCaret=function(){je(i.caret)||(i.caret.style.display="none")},this.owner=e,this.documentHelper=this.owner.documentHelper,this.start=new rci(this.owner),this.end=new rci(this.owner),this.selectedWidgets=new uJt,this.characterFormatIn=new sui(this),this.paragraphFormatIn=new cui(this,this.documentHelper),this.sectionFormatIn=new fui(this),this.rowFormatIn=new Sui(this),this.cellFormatIn=new wui(this),this.tableFormatIn=new vui(this),this.imageFormatInternal=new xui(this),this.editRangeCollection=[],this.editRegionHighlighters=new uJt,this.contentControleditRegionHighlighters=new uJt,this.formFieldHighlighters=new uJt}Bui.prototype.getModuleName=function(){return"SpellChecker"},Object.defineProperty(Bui.prototype,"enableOptimizedSpellCheck",{get:function(){return this.performOptimizedCheck},set:function(e){this.performOptimizedCheck=e},enumerable:!0,configurable:!0}),Object.defineProperty(Bui.prototype,"uniqueWordsCount",{get:function(){return je(this.uniqueWordsCountInternal)?0:this.uniqueWordsCountInternal},set:function(e){this.uniqueWordsCountInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(Bui.prototype,"languageID",{get:function(){return je(this.langIDInternal)?0:this.langIDInternal},set:function(e){this.langIDInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(Bui.prototype,"allowSpellCheckAndSuggestion",{get:function(){return this.spellSuggestionInternal},set:function(e){this.spellSuggestionInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(Bui.prototype,"removeUnderline",{get:function(){return this.removeUnderlineInternal},set:function(e){this.removeUnderlineInternal=e,this.documentHelper.owner.editorModule.reLayout(this.documentHelper.selection)},enumerable:!0,configurable:!0}),Object.defineProperty(Bui.prototype,"enableSpellCheck",{get:function(){return this.enableSpellCheckInternal},set:function(e){this.enableSpellCheckInternal=e,this.documentHelper.owner.editorModule.reLayout(this.documentHelper.selection)},enumerable:!0,configurable:!0}),Object.defineProperty(Bui.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),Bui.prototype.manageReplace=function(e,t){this.documentHelper.triggerSpellCheck=!0;if(!je(t)&&t instanceof bli){var i=t.text;if(this.documentHelper.selection.start=t.start.clone(),this.documentHelper.selection.end=t.end.clone(),"Ignore Once"!==e)return e=this.manageSpecialCharacters(i,e),this.documentHelper.owner.editorModule.insertTextInternal(e,!0),this.documentHelper.selection.start.setPositionInternal(this.documentHelper.selection.end),void this.documentHelper.clearSelectionHighlight();this.currentContextInfo={text:i,element:t}}!je(this.currentContextInfo)&&this.currentContextInfo.element&&"Ignore Once"!==e?(i=this.currentContextInfo.element,this.currentContextInfo.element.text,this.documentHelper.selection.start=i.start.clone(),this.documentHelper.selection.end=i.end.clone()):this.handleReplace(e),"Ignore Once"!==e&&(this.documentHelper.owner.editorModule.insertTextInternal(e,!0),je(this.currentContextInfo)||this.removeErrorsFromCollection(this.currentContextInfo),this.documentHelper.selection.start.setPositionInternal(this.documentHelper.selection.end),this.documentHelper.clearSelectionHighlight()),this.documentHelper.triggerSpellCheck=!1},Bui.prototype.handleReplace=function(e){for(var t,i=this.documentHelper.selection.start,n=i.offset,o=i.currentWidget.getInline(n,0,!1,!0),r=(o.element.line.getOffset(o.element,0)+o.element.length===n&&this.retrieveExactElementInfo(o),o.element.text),s=new RegExp("^[#\\@\\!\\~\\$\\%\\^\\&\\*\\(\\)\\-\\_\\+\\=\\{\\}\\[\\]\\:\\;\\\"'\\,\\<\\.\\>\\/\\?\\`\\s]+","g"),a=[];!je(t=s.exec(r));)a.push(t);if("Ignore Once"===e)this.handleIgnoreOnce(o);else{i.offset=n-o.index,!je(a)&&0<a.length&&(i.offset+=a[0].toString().length),i.location=this.documentHelper.owner.selectionModule.getPhysicalPositionInternal(i.currentWidget,i.offset,!0),(i=this.documentHelper.owner.searchModule.textSearch.getTextPosition(i.currentWidget,i.offset.toString())).setPositionParagraph(i.currentWidget,i.offset);for(var e=i.offset+o.element.length-i.offset,n=i.currentWidget.getOffset(o.element,e),e=i.currentWidget,l=new RegExp("[#\\@\\!\\~\\$\\%\\^\\&\\*\\(\\)\\-\\_\\+\\=\\{\\}\\[\\]\\:\\;\\\"'\\,\\<\\.\\>\\/\\?\\s\\`]+$","g"),a=[];!je(t=l.exec(r));)a.push(t);!je(a)&&0<a.length&&(n-=a[0].toString().length),this.documentHelper.selection.end=this.documentHelper.owner.searchModule.textSearch.getTextPosition(e,n.toString()),this.documentHelper.selection.end.location=this.documentHelper.owner.selectionModule.getPhysicalPositionInternal(i.currentWidget,n,!0),this.documentHelper.selection.end.setPositionParagraph(e,n),this.currentContextInfo={element:o.element,text:o.element.text}}},Bui.prototype.retrieveExactElementInfo=function(e){var t=e.element.nextElement;!je(t)&&t instanceof pli&&""!=t.text.trim()&&(e.element=t)},Bui.prototype.handleIgnoreOnce=function(e){var e=e.element,t="",t=(!je(this.currentContextInfo)&&this.currentContextInfo.element?this.currentContextInfo.element:e).text;t=this.manageSpecialCharacters(t,void 0,!0),-1===e.ignoreOnceItems.indexOf(t)&&e.ignoreOnceItems.push(t),this.documentHelper.owner.editorModule.reLayout(this.documentHelper.selection)},Bui.prototype.handleIgnoreAllItems=function(e){var e=je(e)?this.retriveText():e,t=this.manageSpecialCharacters(e.text,void 0,!0);-1===this.ignoreAllItems.indexOf(t)&&(this.ignoreAllItems.push(t),this.removeErrorsFromCollection(e),this.documentHelper.triggerSpellCheck=!0,this.documentHelper.owner.editorModule.reLayout(this.documentHelper.selection),this.documentHelper.triggerSpellCheck=!1,this.documentHelper.clearSelectionHighlight())},Bui.prototype.handleAddToDictionary=function(e){var t=this,i=je(e)?this.retriveText():e,n=this.manageSpecialCharacters(i.text,void 0,!0);this.callSpellChecker(this.languageID,n,!1,!1,!0).then(function(e){je(t.documentHelper)||(t.documentHelper.triggerSpellCheck=!0,t.removeErrorsFromCollection(i),t.ignoreAllItems.push(n),t.documentHelper.owner.editorModule.reLayout(t.documentHelper.selection,!0),t.documentHelper.triggerSpellCheck=!1)})},Bui.prototype.manageSpecialCharacters=function(e,t,i){if(!je(e)){je(t)&&(t=e);for(var n=new RegExp("^[#\\@\\!\\$\\%\\^\\&\\*\\(\\)\\-\\_\\+\\=\\{\\}\\[\\]\\:\\;\\\"\\”'\\,\\<\\.\\>\\/\\?\\`\\s\\’]+","g"),o=[],r=void 0;!je(r=n.exec(e));)o.push(r);if(0<o.length)for(var s=0;s<o.length;s++){var a=o[s];t=i?t.replace(a[0],""):a[0]+t}var l=new RegExp("[#\\@\\!\\$\\%\\^\\&\\*\\(\\)\\-\\_\\+\\=\\{\\}\\[\\]\\:\\;\\\"\\”'\\,\\<\\.\\>\\/\\?\\s\\`\\’]+$","g"),o=[],h=t;for(i||(h=e);!je(r=l.exec(h));)o.push(r);if(0<o.length)for(s=0;s<o.length;s++){a=o[s];t=i?t.slice(0,a.index):t+a[0]}}return t},Bui.prototype.removeErrorsFromCollection=function(e){var t;!je(e.text)&&this.errorWordCollection.containsKey(e.text)&&(0<=(t=this.errorWordCollection.get(e.text)).indexOf(e.element)&&t.splice(0,1),0===t.length)&&this.errorWordCollection.remove(e.text)},Bui.prototype.retriveText=function(){var e,t,i,n;return!je(this.currentContextInfo)&&this.currentContextInfo.element?(i=this.currentContextInfo.element,n=this.currentContextInfo.element.text,this.documentHelper.selection.start=i.start.clone(),this.documentHelper.selection.end=i.end.clone()):(e=(t=this.documentHelper.selection.start).offset,i=(t=t.currentWidget.getInline(e,0)).element,n=t.element.text),{text:n,element:i}},Bui.prototype.handleSuggestions=function(e){this.spellCheckSuggestion=[],0!==e.length&&(e=3<e.length?this.constructInlineMenu(e):e),this.spellCheckSuggestion.push(this.documentHelper.owner.contextMenuModule.locale.getConstant("Add to Dictionary"));var t=[];if(0<this.spellCheckSuggestion.length)for(var i=0,n=this.spellCheckSuggestion;i<n.length;i++){var o=n[i];t.push({text:o,id:this.documentHelper.owner.element.id+"_contextmenu_otherSuggestions_spellcheck_"+(o===this.documentHelper.owner.contextMenuModule.locale.getConstant("Add to Dictionary")?"Add to Dictionary":o),iconCss:""})}return t},Bui.prototype.checktextElementHasErrors=function(e,t,i){var n=!1,o=[];if(e=e.replace(/[\s]+/g,""),!je(t.errorCollection)&&0<t.errorCollection.length){if(!this.documentHelper.isScrollHandler&&(t.ischangeDetected||t.paragraph.isChangeDetected))return this.updateStatusForGlobalErrors(t.errorCollection,t),t.errorCollection=[],t.ischangeDetected=!0,{errorFound:n,elements:o};for(var r=0;r<t.errorCollection.length;r++)this.handleErrorCollection(t.errorCollection[r])&&(n=!0,o.push(t.errorCollection[r]))}else!this.documentHelper.isScrollHandler&&t.paragraph.isChangeDetected?t.ischangeDetected=!0:!t.ischangeDetected&&this.handleErrorCollection(t)&&(n=!0,o.push(t));return{errorFound:n,elements:o}},Bui.prototype.updateStatusForGlobalErrors=function(e,t){if(0<e.length)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 o=this.errorWordCollection.get(n),r=0;r<o.length;r++)if(o[r]instanceof bli&&o[r]===e[i]){o[r].ischangeDetected=!0,o[r].start.offset=t.line.getOffset(t.istextCombined?this.getCombinedElement(t):t,0),o[r].line=t.line;break}}},Bui.prototype.handleErrorCollection=function(e){var t=this.errorWordCollection,i=this.manageSpecialCharacters(e.text,void 0,!0);return!(!(t.containsKey(i)&&1<e.length)||-1<this.ignoreAllItems.indexOf(i)&&(t.containsKey(i)&&t.remove(i),1))},Bui.prototype.constructInlineMenu=function(e){for(var t=e.length-1;0<t;t--)3<e.length&&(this.spellCheckSuggestion.push(e[t]),e.pop());return e},Bui.prototype.findCurretText=function(){var e,t,i=this.documentHelper.selection.start,n=i.currentWidget.getInline(this.documentHelper.selection.start.offset,0);if(!je(n.element)){if(!je(n.element.errorCollection)&&0<n.element.errorCollection.length)for(var o=0;o<n.element.errorCollection.length;o++){var r=n.element.errorCollection[o];if(r.start.location.x<=i.location.x&&r.end.location.x>=i.location.x){t=r.text,e=r;break}}else t=n.element.text;" "===t&&(t=(n=i.currentWidget.getInline(this.documentHelper.selection.start.offset+1,0)).element.text)}return{text:t,element:e}},Bui.prototype.addErrorCollection=function(e,t,i){var n;e=this.manageSpecialCharacters(e,void 0,!0),this.errorWordCollection.containsKey(e)?(n=this.errorWordCollection.get(e),t instanceof bli?this.compareErrorTextElement(t,n)||n.push(t):t instanceof pli&&(this.compareTextElement(t,n)||n.push(t))):(!je(i)&&0<i.length&&this.errorSuggestions.add(e,i),this.errorWordCollection.add(e,[t]),this.uniqueWordsCollection.containsKey(e)||this.uniqueWordsCollection.add(e,!0))},Bui.prototype.addCorrectWordCollection=function(e){e=this.manageSpecialCharacters(e,void 0,!0),this.uniqueWordsCollection.containsKey(e)||this.uniqueWordsCollection.add(e,!1)},Bui.prototype.isInUniqueWords=function(e){return e=e.replace(/[\s]+/g,""),this.uniqueWordsCollection.containsKey(e)},Bui.prototype.isErrorWord=function(e){return e=e.replace(/[\s]+/g,""),this.uniqueWordsCollection.get(e)},Bui.prototype.isCorrectWord=function(e){return e=e.replace(/[\s]+/g,""),!this.uniqueWordsCollection.get(e)},Bui.prototype.compareErrorTextElement=function(e,t){for(var i=[],n=!1,o=0;o<t.length;o++)i.push(t[o]);for(var r=t.length,o=0;o<r;o++)if(i[o]instanceof bli)if(i[o].ischangeDetected){var s=this.manageSpecialCharacters(i[o].text,void 0,!0),n=!0;this.removeErrorsFromCollection({element:i[o],text:s})}else{s=i[o];if(e.start.offset===s.start.offset&&e.end.offset===s.end.offset)return!0}return n&&this.errorWordCollection.add(this.manageSpecialCharacters(e.text,void 0,!0),[e]),!1},Bui.prototype.compareTextElement=function(e,t){for(var i=0;i<t.length;i++)if(t[i]instanceof pli)if(t[i]===e)return!0;return!1},Bui.prototype.handleWordByWordSpellCheck=function(e,t,i,n,o,r,s,a){je(a)&&(a=t.text),e.HasSpellingError&&s?(this.addErrorCollection(a,t,e.Suggestions),a===t.text.trim()&&(s=(t.line.paragraph.containerWidget instanceof Uai?t.line.paragraph.containerWidget.cellFormat.shading:this.documentHelper).backgroundColor,this.documentHelper.render.renderWavyLine(t,i,n,o,"#FF0000","Single",r,s),t.isSpellChecked=!0)):(this.addCorrectWordCollection(a),t.isSpellChecked=!0)},Bui.prototype.checkElementCanBeCombined=function(e,t,i,n,o,r,s,a){var l=je(o)?"":o,h=!je(a)&&a,a=!!je(s)||s,r=!!je(r)||r,d=[],p=this.documentHelper.selection.getLineWidget(e,0),c=p.children.indexOf(e),u=e.text;d.push(e);var g=!1,m=!1;if("\v"!==e.text){if(a){for(var f=void 0,y=c-(s?0:1);0<=y&&(je(f=p.children[y])||je(f.revisions)||!(0<f.revisions.length)||"Deletion"!==f.revisions[0].revisionType);y--)if(f instanceof pli&&!m){if(0!==u.indexOf(" ")&&f.text.lastIndexOf(" ")!==f.text.length-1)g=!je(o),l=f.text+l,u=f.text,m=!1,d.push(f),h=!0;else if(!je(f)){f=f.nextElement;break}}else f instanceof Zai&&1!==f.fieldType&&(m=!0);var v=h?f:e;if(this.lookThroughPreviousLine(l,u,v,t,i))return!0}s?l=g?l:e.text+l:l+=e.text;var m=!1,b=e.text;if(r){for(var w=!1,C=void 0,y=c+1;y<p.children.length&&(je(C=p.children[y])||je(C.revisions)||!(0<C.revisions.length)||"Deletion"!==C.revisions[0].revisionType);y++)if(C instanceof pli&&!m){if(b.lastIndexOf(" ")!==b.length-1&&0!==C.text.indexOf(" "))l+=C.text,b=C.text,m=!1,d.push(C),h=w=!0;else if(!je(C)){C=C.previousElement;break}}else C instanceof Zai&&2!==C.fieldType&&(m=!0);if("\f"!==(v=w?C:e).text&&v.text!==String.fromCharCode(14)&&this.lookThroughNextLine(l,u,v,t,i))return!0}}return h&&n&&!this.checkCombinedElementsBeIgnored(d,l)&&this.handleCombinedElements(e,l,t,i),h},Bui.prototype.lookThroughPreviousLine=function(e,t,i,n,o){if(!je(i)&&0===i.indexInOwner&&!je(i.line.previousLine)){var r=i.line.previousLine,s=r.children.length-1;if(!je(r.children[s])&&r.children[s]instanceof pli){r=r.children[s];if(!je(i.text)&&0!==i.text.indexOf(" ")&&r.text.lastIndexOf(" ")!==r.text.length-1)return e=0<e.length?e:t,this.checkElementCanBeCombined(r,n,o,!0,e,!1,!0,!0),!0}}return!1},Bui.prototype.lookThroughNextLine=function(e,t,i,n,o){if(i instanceof pli&&!je(i)&&i.indexInOwner===i.line.children.length-1&&!je(i.line.nextLine)){var r=i.line.nextLine;if(!je(r.children[0])&&r.children[0]instanceof pli){r=r.children[0];if(i.text.lastIndexOf(" ")!==i.text.length-1&&0!==r.text.indexOf(" "))return e=0<e.length?e:t,this.checkElementCanBeCombined(r,n,o,!0,e,!0,!1,!0),!0}}return!1},Bui.prototype.handleCombinedElements=function(e,t,i,n){e.istextCombined=!0;var o=t.split(/[\s]+/);if(-1===this.ignoreAllItems.indexOf(t)&&e instanceof pli&&-1===e.ignoreOnceItems.indexOf(t))if(1<o.length)for(var r=0;r<o.length;r++){var s=o[r],s=this.manageSpecialCharacters(s,void 0,!0);this.documentHelper.render.handleUnorderedElements(s,e,i,r,0,r===o.length-1,n)}else t=this.manageSpecialCharacters(t,void 0,!0),this.documentHelper.render.handleUnorderedElements(t,e,i,0,0,!0,n)},Bui.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},Bui.prototype.handleSplitWordSpellCheck=function(e,t,i,n,o,r,s,a){e.HasSpellingError&&" "!==i.text&&n?(n=this.getMatchedResultsFromElement(i,t),i.previousElement instanceof Zai&&1===i.previousElement.fieldType&&(n.elementInfo.values.pop(),n.elementInfo.values.push(0)),s=i.istextCombined?i.line.getOffset(this.getCombinedElement(i),0):s,this.documentHelper.owner.searchModule.textSearch.updateMatchedTextLocation(n.matches,n.textResults,n.elementInfo,0,i,!1,null,s),this.handleMatchedResults(n.textResults,i,o,r,e.Suggestions,a)):(this.addCorrectWordCollection(t),a&&(i.isSpellChecked=!0)),this.updateUniqueWords([{Text:t,HasSpellError:e.HasSpellingError}])},Bui.prototype.handleMatchedResults=function(e,t,i,n,o,r){if(0===e.length&&r)t.isSpellChecked=!0;else for(var s=0;s<e.length;s++){for(var a=this.createErrorElementWithInfo(e.innerList[s],t),l=(je(t.errorCollection)||this.checkArrayHasSameElement(t.errorCollection,a)||t.errorCollection.splice(n,0,a),this.addErrorCollection(a.text,a,o),this.errorWordCollection.get(a.text)),l=(je(l)||-1===l.indexOf(t)||l.indexOf(t)===l.indexOf(a)||l.splice(l.indexOf(t),1),(t.line.paragraph.containerWidget instanceof Uai?t.paragraph.containerWidget.cellFormat.shading:this.documentHelper).backgroundColor),h=t.line.paragraph,d=h.y,p=0;p<h.childWidgets.length&&h.childWidgets[p]!=t.line;p++)d+=h.childWidgets[p].height;t.isRightToLeft?this.documentHelper.render.renderWavyLine(a,a.end.location.x,d,i,"#FF0000","Single",t.characterFormat.baselineAlignment,l):this.documentHelper.render.renderWavyLine(a,a.start.location.x,d,i,"#FF0000","Single",t.characterFormat.baselineAlignment,l),r&&(t.isSpellChecked=!0)}},Bui.prototype.callSpellChecker=function(a,l,h,d,p,c){var u=this,g=this;return new Promise(function(t,i){var n,o,e,r,s;je(u)||(n=new XMLHttpRequest,o=u.documentHelper.owner.serviceUrl,o=c?o+u.documentHelper.owner.serverActionSettings.spellCheckByPage:o+u.documentHelper.owner.serverActionSettings.spellCheck,n.open("POST",o,!0),n.setRequestHeader("Content-Type","application/json"),s=u.documentHelper.owner.headers,c&&(l=l.replace(String.fromCharCode(160)," ")),s=(r={serverActionType:"SpellCheck",headers:s,timeout:0,cancel:!(e={LanguageID:a,TexttoCheck:l,CheckSpelling:h,CheckSuggestion:d,AddWord:p}),withCredentials:!1}).headers,u.documentHelper.owner.trigger(XJt,r),u.setCustomHeaders(n,r.headers),n.withCredentials=r.withCredentials,r.cancel||n.send(JSON.stringify(e)),n.onreadystatechange=function(){var e;4===n.readyState&&(200===n.status||304===n.status?t:(e={status:n.status.toString(),statusText:n.responseText,url:o,name:"onFailure"},je(g.documentHelper)||g.documentHelper.owner.fireServiceFailure(e),i))(n.response)})})},Bui.prototype.setCustomHeaders=function(e,t){if(!je(t))for(var i=0;i<t.length;i++)for(var n=t[i],o=0,r=Object.keys(n);o<r.length;o++){var s=r[o];e.setRequestHeader(s,n[s])}},Bui.prototype.checkForNextError=function(){if(!je(this.viewer)){var e=this.errorWordCollection;if(0<e.length)for(var t=0;t<e.length;t++){for(var i=e.get(e.keys[t]),n=0;n<i.length;n++){if(i[n]instanceof bli&&!i[n].ischangeDetected)this.updateErrorElementTextBox(e.keys[t],i[n]);else if(i[n]instanceof pli){var o=this.getMatchedResultsFromElement(i[n]),r=o.textResults,s=i[n].ischangeDetected?i[n].start.offset:i[n].line.getOffset(i[n],0);this.documentHelper.owner.searchModule.textSearch.updateMatchedTextLocation(o.matches,r,o.elementInfo,0,i[n],!1,null,s);for(var a=0;a<r.length;a++){var l=this.createErrorElementWithInfo(r.innerList[a],i[n]);this.updateErrorElementTextBox(l.text,l);break}}break}break}else this.documentHelper.clearSelectionHighlight()}},Bui.prototype.createErrorElementWithInfo=function(e,t){var i=new bli,n=!1;if(t instanceof bli&&(je(e.start)||je(e.end)||je(e.text))){i.text=t.text;for(var o=t.line,r=0;r<o.children.length;r++)if(o.children[r]instanceof pli){var s=o.children[r].text,a=t.text;if(-1!==s.indexOf(a)){t.start.offset=s.indexOf(a),t.end.offset=t.start.offset+a.length,i.start=t.start,i.end=t.end,i.start.currentWidget=t.line,i.end.currentWidget=t.line,n=!0;break}}n||(i.text=t.text,i.start=t.start,i.end=t.end,n=!0)}return n||(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=Math.abs(i.start.location.x-i.end.location.x),i},Bui.prototype.getMatchedResultsFromElement=function(e,t){for(var i,n=e.line,o=this.documentHelper.owner.searchModule.textSearch.stringToRegex(je(t)?e.text:t,"CaseSensitive"),t=(this.textSearchResults.clearResults(),this.textSearchResults),n=this.documentHelper.owner.searchModule.textSearch.getElementInfo(n.children[0],0,!1,o,void 0,void 0,void 0,void 0,!0),r=n.fullText,s=[],a=n.elementsWithOffset;!je(i=o.exec(r));)this.isChangeAll&&(i.index=a.get(e)),s.push(i);return{matches:s,elementInfo:a,textResults:t}},Bui.prototype.updateErrorElementTextBox=function(e,t){var i=t;this.documentHelper.clearSelectionHighlight(),this.documentHelper.selection.start=i.start.clone(),this.documentHelper.selection.end=i.end.clone(),this.documentHelper.selection.highlight(t.start.paragraph,t.start,t.end),this.documentHelper.owner.spellCheckDialogModule.updateSuggestionDialog(e,i)},Bui.prototype.getWhiteSpaceCharacterInfo=function(e){var t,i=e.text,n=e.characterFormat,o=0,r=0;if(!je(t=i.match(/[\s]+/))&&0<t.length)for(var s=0;s<t.length;s++)o+=this.documentHelper.textHelper.getWidth(t[s],n,e.scriptType),r+=t[s].length;return{width:o,wordLength:r,isBeginning:!je(t)&&0===t.index}},Bui.prototype.getSpecialCharactersInfo=function(e){for(var t=e.text,i=e.characterFormat,n=[],o=0,r=0,s=0,n=t.match(/^[\#\@\!\~\$\%\^\&\*\(\)\-\_\+\=\{\}\[\]\:\;\"\'\,\<\.\>\/\?\`]*/),a=0;a<n.length;a++)!je(n[a])&&0<n[a].length&&(o=this.documentHelper.textHelper.getWidth(n[a],i,e.scriptType)),s=n.length;n=t.match(/[\#\@\!\~\$\%\^\&\*\(\)\-\_\+\=\{\}\[\]\:\;\"\'\,\<\.\>\/\?\`]*$/);for(a=0;a<n.length;a++)!je(n[a])&&0<n[a].length&&(r=this.documentHelper.textHelper.getWidth(n[a],i,e.scriptType)),s=n.length;return{beginningWidth:o,endWidth:r,wordLength:s}},Bui.prototype.getCombinedElement=function(e){for(var t=e;!je(e)&&e instanceof pli&&e.istextCombined;)e=(t=e).previousElement;return t},Bui.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},Bui.prototype.updateSplittedElementError=function(e,t){var i=e.errorCollection.length;if(0<i){for(var n=[],o=0;o<i;o++)n.push(e.errorCollection[o]);for(o=0;o<i;o++)-1===e.text.indexOf(n[o].text)&&(t.ischangeDetected=!0,e.errorCollection.splice(0,1))}},Bui.prototype.getPageContent=function(e){var t,i,n="";return this.documentHelper.owner.sfdtExportModule&&(t=(i=this.documentHelper.owner.sfdtExportModule).keywordIndex,i.keywordIndex=0,i.Initialize(),e=i.writePage(e,!0),i.keywordIndex=t,this.documentHelper.owner.textExportModule)&&((i=this.documentHelper.owner.textExportModule).pageContent="",i.setDocument(e),i.writeInternal(),n=i.pageContent),n},Bui.prototype.updateUniqueWords=function(e){if(je(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 t=0;t<e.length;t++)this.checkForUniqueWords(e[t]);this.addUniqueWordsToLocalStorage(this.uniqueKey,JSON.stringify(this.uniqueSpelledWords)),this.uniqueSpelledWords={}},Bui.prototype.addUniqueWordsToLocalStorage=function(t,i){try{localStorage.setItem(t,i)}catch(e){"QuotaExceededError"===e.name&&(this.clearCache(),localStorage.setItem(t,i))}},Bui.prototype.checkForUniqueWords=function(e){this.uniqueSpelledWords[e.Text]||(this.uniqueSpelledWords[e.Text]=e.HasSpellError)},Bui.prototype.clearCache=function(){je(localStorage.getItem(this.uniqueKey))||localStorage.removeItem(this.uniqueKey)},Bui.prototype.createGuid=function(){var i=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=(i+16*Math.random())%16|0;return i=Math.floor(i/16),("x"===e?t:3&t|8).toString(16)})},Bui.prototype.checkSpellingInPageInfo=function(e){var t=JSON.parse(localStorage.getItem(this.uniqueKey));return je(t)||je(t[e])?{hasSpellError:!1,isElementPresent:!1}:{hasSpellError:t[e],isElementPresent:!0}},Bui.prototype.destroy=function(){this.errorWordCollection=void 0,this.ignoreAllItems=void 0,this.errorSuggestions=void 0,this.uniqueWordsCollection=void 0,this.uniqueSpelledWords={},this.textSearchResults=void 0,je(localStorage.getItem(this.uniqueKey))||localStorage.removeItem(this.uniqueKey),this.documentHelper=void 0};var Pui=Bui;function Bui(e){this.langIDInternal=0,this.enableSpellCheckInternal=!0,this.uniqueSpelledWords={},this.spellSuggestionInternal=!0,this.uniqueKey="",this.removeUnderlineInternal=!1,this.uniqueWordsCountInternal=15e3,this.performOptimizedCheck=!0,this.isChangeAll=!1,this.documentHelper=e,this.errorWordCollection=new uJt,this.uniqueWordsCollection=new uJt,this.errorSuggestions=new uJt,this.ignoreAllItems=[],this.uniqueSpelledWords={},this.textSearchResults=new Zci(this.documentHelper.owner),this.uniqueKey=this.documentHelper.owner.element.id+"_"+this.createGuid()}Lui.prototype.getModuleName=function(){return"Optimized"},Lui.prototype.getkeyFromCharFormat=function(e){var t=e.fontFamily.toLocaleLowerCase();return e.bold&&(t+=";bold"),e.italic&&(t+=";italic"),t},Lui.prototype.getFontInfo=function(e){var t=Q("iframe"),i=(document.body.appendChild(t),"<!DOCTYPE html><html><head></head><body></body></html>"),n=this.documentHelper.owner.externalFonts,n=(n&&0<n.length&&n.forEach(function(e){e.src&&(i+="<style>@font-face {font-family: '"+e.fontFamily+"'; src: "+e.src+"; }</style>")}),je(t.contentDocument)||(t.contentDocument.open(),t.contentDocument.write(i),t.contentDocument.close()),document.createElement("div")),o=(rt(n,"position:absolute;top:-1000px;left:-1000px;opacity:0;font-size:0px;line-height:normal"),1/window.devicePixelRatio),o=(n.style.transform="scale("+o.toString()+","+o.toString()+")",n.innerHTML="",document.createElement("span")),r=(o.className="e-de-font-info",o.style.cssText="font-size: 0; font-family: "+e.fontFamily+"; display: inline-block;",o.textContent="m",document.createElement("span")),e=(r.className="e-de-font-info",r.style.cssText="font-size: 288pt; font-family: "+e.fontFamily+"; "+(e.bold?"font-weight: bold; ":"")+(e.italic?"font-style: italic; ":"")+"display: inline-block;",r.textContent="m",n.appendChild(o),n.appendChild(r),t.contentDocument.body.appendChild(n),n.firstChild.offsetTop/n.lastChild.offsetHeight),o=parseFloat((n.lastChild.offsetHeight/288).toFixed(2));return document.body.removeChild(t),{HeightFactor:o,BaselineFactor:e}},Lui.prototype.getHeightInternal=function(e){var t,i,n=this.getkeyFromCharFormat(e),o=e.bidi||e.complexScript;return je(this.optimizedHeightCollection[""+n])?(t=this.getFontInfo(e),{Height:i=(this.optimizedHeightCollection[""+n]=t).HeightFactor*(o?e.fontSizeBidi:e.fontSize),BaselineOffset:t.BaselineFactor*i}):{Height:i=(t=this.optimizedHeightCollection[""+n]).HeightFactor*(o?e.fontSizeBidi:e.fontSize),BaselineOffset:t.BaselineFactor*i}},Lui.prototype.destroy=function(){this.documentHelper=void 0,this.optimizedHeightCollection=void 0};var Fui=Lui;function Lui(e){this.documentHelper=e,this.optimizedHeightCollection={}}Oui.prototype.getModuleName=function(){return"Regular"},Oui.prototype.getHeightInternal=function(e,t){var i=document.createElement("span"),n=(i.innerText="m",Q("iframe")),e=(document.body.appendChild(n),je(n.contentDocument)||(n.contentDocument.open(),n.contentDocument.write("<!DOCTYPE html><html><head></head><body></body></html>"),n.contentDocument.close()),this.applyStyle(i,e,t),document.createElement("div")),t=(e.style.cssText="display:inline-block;position:absolute;",document.createElement("div")),i=(t.style.cssText="display:inline-block;width: 1px; height: 0px;vertical-align: baseline;",e.appendChild(i),e.appendChild(t),n.contentDocument.body.appendChild(e),e=i.offsetHeight,i.offsetTop),t=t.offsetTop-i;return document.body.removeChild(n),{Height:e,BaselineOffset:t}},Oui.prototype.applyStyle=function(e,t,i){var n;je(e)||je(t)||(n="white-space:nowrap;",je(i)||""===i?n+="font-family:"+t.fontFamily+";":n+="font-family:"+i+";",n+="font-size:"+(i=(i=t.bidi||t.complexScript?t.fontSizeBidi:t.fontSize)<=.5?.5:i).toString()+"pt;",t.bold&&(n+="font-weight:bold;"),t.italic&&(n+="font-style:italic;"),rt(e,n))},Oui.prototype.destroy=function(){this.documentHelper=void 0};var Rui=Oui;function Oui(e){this.documentHelper=e}Object.defineProperty(Vui.prototype,"isPasting",{get:function(){return this.viewer&&this.viewer.owner.isPastingContent},enumerable:!0,configurable:!0}),Object.defineProperty(Vui.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),Vui.prototype.convertJsonToDocument=function(e,t){this.commentStarts=new uJt,this.commentEnds=new uJt,this.commentsCollection=new uJt,this.revisionCollection=new uJt,this.fontInfoCollection=new uJt,this.referedRevisions=[],this.keywordIndex=0,this.footnotes=new uli,this.endnotes=new uli;var i=[],e=Y.getSfdtDocument(e);return!je(e.optimizeSfdt)&&e.optimizeSfdt&&(this.keywordIndex=1),je(e[sZt[this.keywordIndex]])||this.parseFontSubstitutionTable(e[sZt[this.keywordIndex]]),je(e[aZt[this.keywordIndex]])?this.parseCharacterFormat(0,this.viewer.owner.characterFormat,this.documentHelper.characterFormat):(this.documentHelper.characterFormat.clearFormat(),this.parseCharacterFormat(this.keywordIndex,e[aZt[this.keywordIndex]],this.documentHelper.characterFormat)),je(e[lZt[this.keywordIndex]])?this.parseParagraphFormat(0,this.viewer.owner.paragraphFormat,this.documentHelper.paragraphFormat):this.parseParagraphFormat(this.keywordIndex,e[lZt[this.keywordIndex]],this.documentHelper.paragraphFormat),je(e[kZt[this.keywordIndex]])||this.parseCharacterFormat(this.keywordIndex,e[kZt[this.keywordIndex]],this.documentHelper.themeFontLanguage),this.parseDocumentProtection(e),je(e[fZt[this.keywordIndex]])||(this.documentHelper.defaultTabWidth=e[fZt[this.keywordIndex]]),je(e[vZt[this.keywordIndex]])||(this.documentHelper.owner.enableTrackChanges!==Y.parseBoolValue(e[vZt[this.keywordIndex]])&&(this.documentHelper.owner.skipSettingsOps=!0),this.documentHelper.owner.enableTrackChanges=Y.parseBoolValue(e[vZt[this.keywordIndex]])),je(e[AZt[this.keywordIndex]])||(this.documentHelper.dontUseHtmlParagraphAutoSpacing=Y.parseBoolValue(e[AZt[this.keywordIndex]])),je(e[Woi[this.keywordIndex]])||(this.documentHelper.allowSpaceOfSameStyleInTable=Y.parseBoolValue(e[Woi[this.keywordIndex]])),je(e[xZt[this.keywordIndex]])||(this.documentHelper.alignTablesRowByRow=Y.parseBoolValue(e[xZt[this.keywordIndex]])),je(e[pZt[this.keywordIndex]])||(this.documentHelper.backgroundColor=this.getColor(e[pZt[this.keywordIndex]][tii[this.keywordIndex]])),je(e[MZt[this.keywordIndex]])||(this.documentHelper.compatibilityMode=this.getCompatibilityMode(e[MZt[this.keywordIndex]]),je(this.documentHelper.owner.documentSettings))||(this.documentHelper.owner.documentSettings.compatibilityMode=this.getCompatibilityMode(e[MZt[this.keywordIndex]])),je(e[dZt[this.keywordIndex]])||this.parseAbstractList(e,this.documentHelper.abstractLists),je(e[hZt[this.keywordIndex]])||this.parseList(e,this.documentHelper.lists),je(e[cZt[this.keywordIndex]])||this.parseStyles(e,this.documentHelper.styles),je(e[uZt[this.keywordIndex]])||this.parseComments(e,this.documentHelper.comments),je(e[gZt[this.keywordIndex]])||this.parseRevisions(e,this.viewer.owner.revisionsInternal.changes),je(e[Xoi[this.keywordIndex]])||this.parseImages(e[Xoi[this.keywordIndex]]),je(e[rZt[this.keywordIndex]])||this.parseSections(e[rZt[this.keywordIndex]],i),je(e[mZt[this.keywordIndex]])||this.parseCustomXml(e),je(e[IZt[this.keywordIndex]])||(this.documentHelper.owner.documentEditorSettings.formFieldSettings.applyShading=Y.parseBoolValue(e[IZt[this.keywordIndex]])),je(e[EZt[this.keywordIndex]])||this.parseFootnotes(e[EZt[this.keywordIndex]],this.documentHelper.footnotes),je(e[DZt[this.keywordIndex]])||this.parseEndtnotes(e[DZt[this.keywordIndex]],this.documentHelper.endnotes),je(e[PZt[this.keywordIndex]])||this.parseThemes(e[PZt[this.keywordIndex]],this.documentHelper.themes),this.generalizeRevisions(),this.removeUnmappedBookmark(),je(e[iri[0]])||(t[iri[0]]=e[iri[0]]),this.documentHelper.fieldStacks&&0<this.documentHelper.fieldStacks.length&&(this.documentHelper.fieldStacks=[]),i},Vui.prototype.parseFontSubstitutionTable=function(e){if(!je(this.documentHelper)&&!je(this.documentHelper.fontSubstitutionTable)&&0<Object.keys(e).length)for(var t=0,i=Object.keys(e);t<i.length;t++){var n=i[t];this.documentHelper.fontSubstitutionTable.add(n,e[n])}},Vui.prototype.removeUnmappedBookmark=function(){for(var e,t=this.documentHelper.bookmarks.keys,i=this.documentHelper.endBookmarksUpdated,n=0;n<t.length;n++)-1===i.indexOf(t[n])&&((e=this.documentHelper.bookmarks.get(t[n]))&&e.line.children.splice(e.line.children.indexOf(e),1),this.documentHelper.bookmarks.remove(t[n]));this.documentHelper.endBookmarksUpdated=[]},Vui.prototype.generalizeRevisions=function(){var i=this,n=new uJt,o=[];this.referedRevisions.forEach(function(e){var t=i.documentHelper.revisionsInternal.get(e);-1===o.indexOf(t)&&(o.push(t),n.add(e,t))}),this.viewer.owner.revisionsInternal.changes=o,this.documentHelper.revisionsInternal=n},Vui.prototype.parseFootnotes=function(e,t){je(e[soi[this.keywordIndex]])||this.parseBody(e[soi[this.keywordIndex]],t.separator),je(e[loi[this.keywordIndex]])||this.parseBody(e[loi[this.keywordIndex]],t.continuationNotice),je(e[aoi[this.keywordIndex]])||this.parseBody(e[aoi[this.keywordIndex]],t.continuationSeparator)},Vui.prototype.parseImages=function(e){for(var t in e){var i;Array.isArray(e[""+t])?this.documentHelper.images.add(parseInt(t),e[""+t]):((i=[]).push(e[""+t]),this.documentHelper.images.add(parseInt(t),i))}},Vui.prototype.parseEndtnotes=function(e,t){je(e[soi[this.keywordIndex]])||this.parseBody(e[soi[this.keywordIndex]],t.separator),je(e[loi[this.keywordIndex]])||this.parseBody(e[loi[this.keywordIndex]],t.continuationNotice),je(e[aoi[this.keywordIndex]])||this.parseBody(e[aoi[this.keywordIndex]],t.continuationSeparator)},Vui.prototype.parseCustomXml=function(e){for(var t=0;t<e[mZt[this.keywordIndex]].length;t++){var i=e[mZt[this.keywordIndex]][t];this.documentHelper.customXmlData.containsKey(i[Hii[this.keywordIndex]])||this.documentHelper.customXmlData.add(i[Hii[this.keywordIndex]],i[zii[this.keywordIndex]])}},Vui.prototype.parseDocumentProtection=function(e){je(e[yZt[this.keywordIndex]])||(this.documentHelper.restrictFormatting=Y.parseBoolValue(e[yZt[this.keywordIndex]])),je(e[wZt[this.keywordIndex]])||(this.documentHelper.isDocumentProtected=Y.parseBoolValue(e[wZt[this.keywordIndex]])),je(e[bZt[this.keywordIndex]])||(this.documentHelper.protectionType=this.getProtectionType(e[bZt[this.keywordIndex]])),je(e[CZt[this.keywordIndex]])||(this.documentHelper.hashValue=e[CZt[this.keywordIndex]]),je(e[SZt[this.keywordIndex]])||(this.documentHelper.saltValue=e[SZt[this.keywordIndex]])},Vui.prototype.parseStyles=function(e,t){for(var i=0;i<e[cZt[this.keywordIndex]].length;i++){var n=this.documentHelper.owner.editorModule;(!je(n)&&n.isRemoteAction||je(this.documentHelper.styles.findByName(e[cZt[this.keywordIndex]][i][BZt[this.keywordIndex]])))&&this.parseStyle(e,e[cZt[this.keywordIndex]][i],t)}},Vui.prototype.parseRevisions=function(e,t){for(var i=0;i<e[gZt[this.keywordIndex]].length;i++){var n=e[gZt[this.keywordIndex]][i];if(!je(n[_ii[this.keywordIndex]])&&!je(n[Vii[this.keywordIndex]])){var o=this.parseRevision(n),r=!0;if(!this.documentHelper.owner.sfdtExportModule.copyWithTrackChange&&this.isPaste){if("Insertion"===this.getRevisionType(n[Vii[this.keywordIndex]])&&this.isPaste&&this.documentHelper.owner.enableTrackChanges&&!this.documentHelper.owner.editorModule.isRemoteAction)continue;this.revisionCollection.containsKey(n[_ii[this.keywordIndex]])||this.revisionCollection.add(n[_ii[this.keywordIndex]],o)}else this.revisionCollection.add(n[_ii[this.keywordIndex]],o);for(var s=0;s<t.length;s++)t[s].revisionID===o.revisionID&&(r=!1);r&&!this.documentHelper.owner.editorModule.isRemoteAction&&t.push(o)}}this.documentHelper.revisionsInternal=this.revisionCollection,this.documentHelper.owner.sfdtExportModule&&(this.documentHelper.owner.sfdtExportModule.copyWithTrackChange=!1)},Vui.prototype.parseRevision=function(e){var t;if(!je(e))return(t=new Ari(this.viewer.owner,e[Fii[this.keywordIndex]],e[Rii[this.keywordIndex]])).revisionID=e[_ii[this.keywordIndex]],t.revisionType=this.getRevisionType(e[Vii[this.keywordIndex]]),t},Vui.prototype.checkAndApplyRevision=function(e,t,i){if(!je(t[h$t[e]])&&0<t[h$t[e]].length)for(var n=0;n<t[h$t[e]].length;n++){var o=t[h$t[e]][n];this.revisionCollection.containsKey(o)&&(this.referedRevisions.push(o),o=this.revisionCollection.get(o),i instanceof bri||o.range.push(i),i.revisions.push(o),this.isPaste)&&this.documentHelper.owner.editorModule.isRemoteAction&&i instanceof Cri&&this.documentHelper.owner.editorModule.remotePasteRevision.push(o)}},Vui.prototype.parseComments=function(e,t){for(var i=0,n=0;n<e[uZt[this.keywordIndex]].length;n++){for(var o=e[uZt[this.keywordIndex]][n],r=void 0,r=this.parseComment(o,void 0);i<o[Nii[this.keywordIndex]].length;){var s=void 0;(s=this.parseComment(o[Nii[this.keywordIndex]][i],void 0)).ownerComment=r,s.isReply=!0,r.replyComments.push(s),this.commentsCollection.add(s.commentId,s),i++}this.commentsCollection.add(r.commentId,r),t.push(r),i=0}},Vui.prototype.parseComment=function(e,t){return(t=new $hi(e[Rii[this.keywordIndex]])).author=e[Fii[this.keywordIndex]],t.initial=e[Lii[this.keywordIndex]],t.commentId=e[Pii[this.keywordIndex]],t.isResolved=Y.parseBoolValue(e[Oii[this.keywordIndex]]),t.text=this.parseCommentText(e[_ni[this.keywordIndex]]),t.mentions=this.parseCommentMentions(e[_ni[this.keywordIndex]]),t.isPosted=!0,t},Vui.prototype.parseCommentText=function(e){for(var t="",i=!1,n=0;n<e.length;n++){if(0!==n&&(t+="<div>"),0<e[n][qii[this.keywordIndex]].length)for(var o=e[n][qii[this.keywordIndex]],r=0;r<o.length;r++){var s=o[r];0===s[fii[this.keywordIndex]]||1===s[fii[this.keywordIndex]]||2===s[fii[this.keywordIndex]]?0===s[fii[this.keywordIndex]]?r++:2===s[fii[this.keywordIndex]]&&(i=!0):(s=s[Bti[this.keywordIndex]],i?(t=t+'<span contenteditable="false" class="e-mention-chip">'+s+"</span>",i=!1):s&&(t+=s.replace(/</g,"&lt;").replace(/>/g,"&gt;")))}else t+=0===n?"<div><br></div>":"<br>";0!==n&&(t+="</div>")}return t},Vui.prototype.parseCommentMentions=function(e){for(var t=[],i=!1,n=!1,o=0;o<e.length;o++)for(var r=e[o][qii[this.keywordIndex]],s={},a=0;a<r.length;a++){var l,h=r[a];0===h[fii[this.keywordIndex]]||1===h[fii[this.keywordIndex]]||2===h[fii[this.keywordIndex]]?0===h[fii[this.keywordIndex]]?i=!0:2===h[fii[this.keywordIndex]]&&(n=!0):(h=h[Bti[this.keywordIndex]],i?(l=(l=h.replace(/.*"(.*)".*/,"$1")).replace("mailto:",""),s.value=l,i=!1):n&&(s.text=h,n=!1,t.push(s),s={}))}return t},Vui.prototype.parseStyle=function(e,t,i,n){var o,r,s,a,l,h=0,d=this.documentHelper.owner.editorModule;!je(n)&&n&&(h=this.keywordIndex,this.keywordIndex=0),je(t[koi[this.keywordIndex]])||("Paragraph"===this.getStyleType(t[koi[this.keywordIndex]])&&((o=new _ri).type="Paragraph"),"Character"===this.getStyleType(t[koi[this.keywordIndex]])&&((o=new jri).type="Character"),"Table"===this.getStyleType(t[koi[this.keywordIndex]])&&((o=new Uri).type="Table"),je(t[BZt[this.keywordIndex]])||(o.name=t[BZt[this.keywordIndex]]),i.push(o),je(t[FZt[this.keywordIndex]])||(r=void 0,r=(!je(d)&&d.isRemoteAction?this.documentHelper.styles:i).findByName(t[FZt[this.keywordIndex]]),je(r)?(a=void 0,je(l=this.getStyle(t[FZt[this.keywordIndex]],e))||this.getStyleType(l[koi[this.keywordIndex]])!==o.type?"Paragraph"===o.type?a=JSON.parse('{"type":"Paragraph","name":"Normal","next":"Normal"}'):"Character"===o.type&&(a=JSON.parse('{"type": "Character","name": "Default Paragraph Font"}')):a=l,this.parseStyle(e,a,i),!je(d)&&d.isRemoteAction?o.basedOn=this.documentHelper.styles.findByName(a[BZt[this.keywordIndex]]):o.basedOn=i.findByName(a[BZt[this.keywordIndex]])):r.type===o.type&&r.name!==o.name&&(o.basedOn=r,l=this.getStyle(t[FZt[this.keywordIndex]],e),this.isPaste)&&!je(l)&&"Paragraph"===o.type&&"Paragraph"===this.getStyleType(l[koi[this.keywordIndex]])&&this.updateParagraphFormatFromBaseStyle(t,l)),je(t[RZt[this.keywordIndex]])||(r=i.findByName(t[RZt[this.keywordIndex]]),l=this.getStyle(t[RZt[this.keywordIndex]],e),a=void(!je(d)&&d.isRemoteAction&&(r=this.documentHelper.styles.findByName(t[RZt[this.keywordIndex]]))),je(r)?(a=je(l)?((s={})[aZt[this.keywordIndex]]=t[aZt[this.keywordIndex]],s[BZt[this.keywordIndex]]=t[BZt[this.keywordIndex]]+" Char",s[koi[this.keywordIndex]]="Character",s[FZt[this.keywordIndex]]="Normal"===t[FZt[this.keywordIndex]]?"Default Paragraph Font":t[FZt[this.keywordIndex]]+" Char",s):l,s=void this.parseStyle(e,a,i),s=(!je(d)&&d.isRemoteAction?this.documentHelper.styles:i).findByName(a[BZt[this.keywordIndex]]),o.link=je(s)?t[RZt[this.keywordIndex]]:s):o.link=r),je(t[aZt[this.keywordIndex]])||this.parseCharacterFormat(this.keywordIndex,t[aZt[this.keywordIndex]],o.characterFormat),je(t[lZt[this.keywordIndex]])||this.parseParagraphFormat(this.keywordIndex,t[lZt[this.keywordIndex]],o.paragraphFormat),je(t[LZt[this.keywordIndex]]))||(t[LZt[this.keywordIndex]]===t[BZt[this.keywordIndex]]?o.next=o:(l=void 0,l=(!je(d)&&d.isRemoteAction?this.documentHelper.styles:i).findByName(t[LZt[this.keywordIndex]]),je(l)||l.type!==o.type?je(a=this.getStyle(t[LZt[this.keywordIndex]],e))?o.next=o:(this.parseStyle(e,a,i),!je(d)&&d.isRemoteAction?o.next=this.documentHelper.styles.findByName(a.name):o.next=i.findByName(a.name)):o.next=l)),!je(n)&&n&&(this.keywordIndex=h),je(o)||"Table"===o.type||this.documentHelper.addToStylesMap(o)},Vui.prototype.updateParagraphFormatFromBaseStyle=function(e,t){je(e[lZt[this.keywordIndex]])||je(t[lZt[this.keywordIndex]])||(e=e[lZt[this.keywordIndex]],t=t[lZt[this.keywordIndex]],!e.hasOwnProperty(g$t[this.keywordIndex])&&t.hasOwnProperty(g$t[this.keywordIndex])&&(e[g$t[this.keywordIndex]]=t[g$t[this.keywordIndex]]),!e.hasOwnProperty(m$t[this.keywordIndex])&&t.hasOwnProperty(m$t[this.keywordIndex])&&(e[m$t[this.keywordIndex]]=t[m$t[this.keywordIndex]]),!e.hasOwnProperty(b$t[this.keywordIndex])&&t.hasOwnProperty(b$t[this.keywordIndex])&&(e[b$t[this.keywordIndex]]=t[b$t[this.keywordIndex]]),!e.hasOwnProperty(v$t[this.keywordIndex])&&t.hasOwnProperty(v$t[this.keywordIndex])&&(e[v$t[this.keywordIndex]]=t[v$t[this.keywordIndex]]),!e.hasOwnProperty(S$t[this.keywordIndex])&&t.hasOwnProperty(S$t[this.keywordIndex])&&(e[S$t[this.keywordIndex]]=t[S$t[this.keywordIndex]]),!e.hasOwnProperty(A$t[this.keywordIndex])&&t.hasOwnProperty(A$t[this.keywordIndex])&&(e[A$t[this.keywordIndex]]=t[A$t[this.keywordIndex]]),!e.hasOwnProperty(y$t[this.keywordIndex])&&t.hasOwnProperty(y$t[this.keywordIndex])&&(e[y$t[this.keywordIndex]]=t[y$t[this.keywordIndex]]),!e.hasOwnProperty(D$t[this.keywordIndex])&&t.hasOwnProperty(D$t[this.keywordIndex])&&(e[D$t[this.keywordIndex]]=t[D$t[this.keywordIndex]]),!e.hasOwnProperty(M$t[this.keywordIndex])&&t.hasOwnProperty(M$t[this.keywordIndex])&&(e[M$t[this.keywordIndex]]=t[M$t[this.keywordIndex]]),!e.hasOwnProperty(I$t[this.keywordIndex])&&t.hasOwnProperty(I$t[this.keywordIndex])&&(e[I$t[this.keywordIndex]]=t[I$t[this.keywordIndex]]),!e.hasOwnProperty(E$t[this.keywordIndex])&&t.hasOwnProperty(E$t[this.keywordIndex])&&(e[E$t[this.keywordIndex]]=t[E$t[this.keywordIndex]]),!e.hasOwnProperty(T$t[this.keywordIndex])&&t.hasOwnProperty(T$t[this.keywordIndex])&&(e[T$t[this.keywordIndex]]=t[T$t[this.keywordIndex]]))},Vui.prototype.getStyle=function(e,t){for(var i=0;i<t[cZt[this.keywordIndex]].length;i++)if(t[cZt[this.keywordIndex]][i][BZt[this.keywordIndex]]===e)return t[cZt[this.keywordIndex]][i]},Vui.prototype.parseAbstractList=function(e,t){for(var i=0;i<e[dZt[this.keywordIndex]].length;i++){var n=new tsi,o=e[dZt[this.keywordIndex]][i];if(!je(o)&&(je(o[toi[this.keywordIndex]])||(n.abstractListId=o[toi[this.keywordIndex]]),je(o.nsid)||(n.nsid=o.nsid),!je(o[noi[this.keywordIndex]])))for(var r=0;r<o[noi[this.keywordIndex]].length;r++){var s=o[noi[this.keywordIndex]][r];je(s)||(s=this.parseListLevel(s,n),n.levels.push(s))}t.push(n)}},Vui.prototype.parseListLevel=function(e,t){t=new rsi(t);return"Bullet"===this.getListLevelPattern(e[Yni[this.keywordIndex]])?(t.listLevelPattern="Bullet",t.numberFormat=je(e[$ni[this.keywordIndex]])?"":e[$ni[this.keywordIndex]]):(t.listLevelPattern=this.getListLevelPattern(e[Yni[this.keywordIndex]]),t.startAt=e[Kni[this.keywordIndex]],t.numberFormat=je(e[$ni[this.keywordIndex]])?"":e[$ni[this.keywordIndex]],0<=e[Jni[this.keywordIndex]]?t.restartLevel=e[Jni[this.keywordIndex]]:t.restartLevel=e[Zni[this.keywordIndex]]),t.paraStyleName=je(e[eoi[this.keywordIndex]])?"":e[eoi[this.keywordIndex]],t.isLegalStyleNumbering=!je(e[Tni[this.keywordIndex]])&&Y.parseBoolValue(e[Tni[this.keywordIndex]]),t.followCharacter=this.getFollowCharacterType(e[Xni[this.keywordIndex]]),this.parseCharacterFormat(this.keywordIndex,e[aZt[this.keywordIndex]],t.characterFormat),this.parseParagraphFormat(this.keywordIndex,e[lZt[this.keywordIndex]],t.paragraphFormat),t},Vui.prototype.parseList=function(e,t){for(var i=0;i<e[hZt[this.keywordIndex]].length;i++){var n=new xpi,o=e[hZt[this.keywordIndex]][i];je(o[toi[this.keywordIndex]])||(n.abstractListId=o[toi[this.keywordIndex]],n.abstractList=this.documentHelper.getAbstractListById(o[toi[this.keywordIndex]])),t.push(n),je(o[d$t[this.keywordIndex]])||(n.listId=o[d$t[this.keywordIndex]]),je(o.nsid)?n.nsid=n.abstractList.nsid:n.nsid=o.nsid,o.hasOwnProperty(roi[this.keywordIndex])&&this.parseLevelOverride(o[roi[this.keywordIndex]],n)}},Vui.prototype.parseLevelOverride=function(e,t){if(!je(e))for(var i=0;i<e.length;i++){var n=new nsi,o=e[i];n.startAt=o[Kni[this.keywordIndex]],n.levelNumber=o[Zni[this.keywordIndex]],je(o[ooi[this.keywordIndex]])||(n.overrideListLevel=this.parseListLevel(o[ooi[this.keywordIndex]],n)),t.levelOverrides.push(n)}},Vui.prototype.parseSections=function(e,t){for(var i=0;i<e.length;i++){var n=new Sai,o=(n.sectionFormat=new ari(n),e[n.index=i]),r=e[i+1],r=r&&r[Gni[this.keywordIndex]]?r[Gni[this.keywordIndex]]:void 0,r=r&&r[tei[this.keywordIndex]]?r[tei[this.keywordIndex]]:"NewPage";je(o[Gni[this.keywordIndex]])||this.parseSectionFormat(this.keywordIndex,o[Gni[this.keywordIndex]],n.sectionFormat),je(o[qni[this.keywordIndex]])&&(o[qni[this.keywordIndex]]={}),this.documentHelper.headersFooters.push(this.parseHeaderFooter(o[qni[this.keywordIndex]],this.documentHelper.headersFooters)),this.isParseHeader=!1,this.parseTextBody(o[_ni[this.keywordIndex]],n,i+1<e.length,r);for(var s=0;s<n.childWidgets.length;s++)n.childWidgets[s].containerWidget=n;t.push(n)}},Vui.prototype.parseHeaderFooter=function(e,t){this.isParseHeader=!0;var i,n={};return je(e[Hni[this.keywordIndex]])||(i=new Iai("OddHeader"),this.parseTextBody(e[Hni[this.keywordIndex]][_ni[this.keywordIndex]],n[0]=i)),je(e[zni[this.keywordIndex]])||(i=new Iai("OddFooter"),this.parseTextBody(e[zni[this.keywordIndex]][_ni[this.keywordIndex]],n[1]=i)),je(e[jni[this.keywordIndex]])||(i=new Iai("EvenHeader"),this.parseTextBody(e[jni[this.keywordIndex]][_ni[this.keywordIndex]],n[2]=i)),je(e[Wni[this.keywordIndex]])||(i=new Iai("EvenFooter"),this.parseTextBody(e[Wni[this.keywordIndex]][_ni[this.keywordIndex]],n[3]=i)),je(e[Qni[this.keywordIndex]])||(i=new Iai("FirstPageHeader"),this.parseTextBody(e[Qni[this.keywordIndex]][_ni[this.keywordIndex]],n[4]=i)),je(e[Uni[this.keywordIndex]])||(i=new Iai("FirstPageFooter"),this.parseTextBody(e[Uni[this.keywordIndex]][_ni[this.keywordIndex]],n[5]=i)),n},Vui.prototype.parseTextBody=function(e,t,i,n){this.parseBody(e,t.childWidgets,t,i,void 0,void 0,n)},Vui.prototype.addCustomStyles=function(e){if(!je(e[cZt[this.keywordIndex]]))for(var t=0;t<e[cZt[this.keywordIndex]].length;t++)void 0===this.documentHelper.styles.findByName(e[cZt[this.keywordIndex]][t][BZt[this.keywordIndex]])&&this.parseStyle(e,e[cZt[this.keywordIndex]][t],this.documentHelper.styles)},Vui.prototype.parseBody=function(e,t,i,n,o,r,s,a){if(!je(e))for(var l=0;l<e.length;l++){var h=e[l],d=!1;if(h.hasOwnProperty(qii[this.keywordIndex])){var p,c=new Lai;c.characterFormat=new Eri(c),c.paragraphFormat=new bri(c),0<h[qii[this.keywordIndex]].length&&(d=this.parseParagraph(h[qii[this.keywordIndex]],c,!1,void 0,a&&0===l)),!n||h!==e[e.length-1]||0!==h[qii[this.keywordIndex]].length||d?(this.parseCharacterFormat(this.keywordIndex,h[aZt[this.keywordIndex]],c.characterFormat),this.parseParagraphFormat(this.keywordIndex,h[lZt[this.keywordIndex]],c.paragraphFormat),d=void 0,p="Normal",je(h[lZt[this.keywordIndex]])||je(h[lZt[this.keywordIndex]][KZt[this.keywordIndex]])||(p=h[lZt[this.keywordIndex]][KZt[this.keywordIndex]]),je(d=this.documentHelper.styles.findByName(p,"Paragraph"))||c.paragraphFormat.applyStyle(d)):n&&1===e.length||(c.isSectionBreak=!0),t.push(c),c.index=t.length-1,c.containerWidget=i}else if(h.hasOwnProperty(Ani[this.keywordIndex]))this.parseTable(h,t,t.length,i);else if(h.hasOwnProperty(Gii[this.keywordIndex])){var u=new Pli("Block"),g=new Pli("Block");this.parseContentControlProperties(h[Gii[this.keywordIndex]],u.contentControlProperties),g.contentControlProperties=u.contentControlProperties,u.type=0,g.type=1,this.parseBody(h[_ni[this.keywordIndex]],t,i,n,u.contentControlProperties);for(var m=0;m<2;m++){var f=t.length<h[_ni[this.keywordIndex]].length?t[0]:0===m?t[t.length-h[_ni[this.keywordIndex]].length]:t[t.length-1],y=void 0;f instanceof Lai?y=f:f instanceof _ai&&(y=0===m?f.firstChild.firstChild.firstChild:f.lastChild.lastChild.lastChild),je(y)||0!==y.childWidgets.length||(f=new Gai(y),y.childWidgets.push(f)),0===m?(y.firstChild.children.splice(0,0,u),u.line=y.firstChild):(y.lastChild.children.push(g),g.line=y.lastChild)}}je(o)||(t[t.length-1].contentControlProperties=o)}},Vui.prototype.parseTable=function(e,t,i,n){var o=new _ai;o.index=i,je(e[Dni[this.keywordIndex]])||this.parseTableFormat(e[Dni[this.keywordIndex]],o.tableFormat,this.keywordIndex),o.tableFormat.title=e[Jii[this.keywordIndex]],o.tableFormat.description=e[xni[this.keywordIndex]],this.parseTablePositioning(e,o);for(var r=0;r<e[Ani[this.keywordIndex]].length;r++){var s=new jai,a=(s.rowFormat=new Cri(s),e[Ani[this.keywordIndex]][r]);if(je(a[Gii[this.keywordIndex]])||(s.contentControlProperties=new Fli("Row"),this.parseContentControlProperties(a[Gii[this.keywordIndex]],s.contentControlProperties)),a.hasOwnProperty(Cni[this.keywordIndex])){this.parseRowFormat(a[Cni[this.keywordIndex]],s.rowFormat,this.keywordIndex),s.index=r;for(var l=0;l<a[Sni[this.keywordIndex]].length;l++){for(var h,d,p=new Uai,c=(p.cellFormat=new $ri(p),a[Sni[this.keywordIndex]][l]),u=(je(c[Gii[this.keywordIndex]])||(p.contentControlProperties=new Fli("Cell"),this.parseContentControlProperties(c[Gii[this.keywordIndex]],p.contentControlProperties)),s.childWidgets.push(p),p.containerWidget=s,p.index=l,p.rowIndex=r,p.columnIndex=l,c.hasOwnProperty(wni[this.keywordIndex])&&this.parseCellFormat(c[wni[this.keywordIndex]],p.cellFormat,this.keywordIndex),c[_ni[this.keywordIndex]]),g=0;g<u.length;g++)u[g].hasOwnProperty([Ani[this.keywordIndex]])&&(o.isContainInsideTable=!0);this.isPageBreakInsideTable=!0,this.parseTextBody(c[_ni[this.keywordIndex]],p,!1),je(p.contentControlProperties)||(c=new Pli("Cell"),h=new Pli("Cell"),c.contentControlProperties=p.contentControlProperties,h.contentControlProperties=p.contentControlProperties,c.type=0,h.type=1,0===p.firstChild.childWidgets.length&&(d=new Gai(p.firstChild),p.firstChild.childWidgets.push(d)),c.line=p.firstChild.firstChild,p.firstChild.firstChild.children.splice(0,0,c),0===p.lastChild.childWidgets.length&&(d=new Gai(p.lastChild),p.lastChild.childWidgets.push(d)),h.line=p.lastChild.lastChild,p.lastChild.lastChild.children.push(h)),je(s.contentControlProperties)||(s.firstChild===p?((c=new Pli("Row")).contentControlProperties=s.contentControlProperties,(c.type=0)===p.firstChild.childWidgets.length&&(d=new Gai(p.firstChild),p.firstChild.childWidgets.push(d)),c.line=p.firstChild.firstChild,p.firstChild.firstChild.children.splice(0,0,c)):s.lastChild===p&&((h=new Pli("Row")).contentControlProperties=s.contentControlProperties,h.type=1,0===p.lastChild.childWidgets.length&&(d=new Gai(p.lastChild),p.lastChild.childWidgets.push(d)),h.line=p.lastChild.lastChild,p.lastChild.lastChild.children.push(h))),this.isPageBreakInsideTable=!1}}0<s.childWidgets.length&&(o.childWidgets.push(s),s.containerWidget=o)}o.containerWidget=n,0<o.childWidgets.length&&t.push(o),o.isGridUpdated=!1},Vui.prototype.parseTablePositioning=function(e,t){t.wrapTextAround=!je(e[Ini[this.keywordIndex]])&&Y.parseBoolValue(e[Ini[this.keywordIndex]]),t.wrapTextAround&&(t.positioning=new Oai,t.positioning.allowOverlap=Y.parseBoolValue(e[Eni[this.keywordIndex]][Mni[this.keywordIndex]]),je(e[Eni[this.keywordIndex]][Fni[this.keywordIndex]])||(t.positioning.distanceBottom=Y.convertPointToPixel(e[Eni[this.keywordIndex]][Fni[this.keywordIndex]])),je(e[Eni[this.keywordIndex]][Bni[this.keywordIndex]])||(t.positioning.distanceLeft=Y.convertPointToPixel(e[Eni[this.keywordIndex]][Bni[this.keywordIndex]])),je(e[Eni[this.keywordIndex]][Pni[this.keywordIndex]])||(t.positioning.distanceRight=Y.convertPointToPixel(e[Eni[this.keywordIndex]][Pni[this.keywordIndex]])),je(e[Eni[this.keywordIndex]][kni[this.keywordIndex]])||(t.positioning.distanceTop=Y.convertPointToPixel(e[Eni[this.keywordIndex]][kni[this.keywordIndex]])),je(e[Eni[this.keywordIndex]][rei[this.keywordIndex]])||(t.positioning.verticalAlignment=this.getTableVerticalPosition(e[Eni[this.keywordIndex]][rei[this.keywordIndex]])),je(e[Eni[this.keywordIndex]][Lni[this.keywordIndex]])||(t.positioning.verticalOrigin=this.getTableVerticalRelation(e[Eni[this.keywordIndex]][Lni[this.keywordIndex]])),t.positioning.verticalPosition=e[Eni[this.keywordIndex]][Rni[this.keywordIndex]],je(e[Eni[this.keywordIndex]][Nni[this.keywordIndex]])||(t.positioning.horizontalAlignment=this.getTableHorizontalPosition(e[Eni[this.keywordIndex]][Nni[this.keywordIndex]])),je(e[Eni[this.keywordIndex]][Oni[this.keywordIndex]])||(t.positioning.horizontalOrigin=this.getTableHorizontalRelation(e[Eni[this.keywordIndex]][Oni[this.keywordIndex]])),t.positioning.horizontalPosition=e[Eni[this.keywordIndex]][Vni[this.keywordIndex]])},Vui.prototype.parseRowGridValues=function(e,t,i){je(e[hei[i]])||(t.gridBefore=e[hei[i]]),je(e[dei[i]])||(t.gridBeforeWidth=e[dei[i]]),je(e[pei[i]])||(t.gridBeforeWidthType=this.getWidthType(e[pei[i]])),je(e[cei[i]])||(t.gridAfter=e[cei[i]]),je(e[uei[i]])||(t.gridAfterWidth=e[uei[i]]),je(e[gei[i]])||(t.gridAfterWidthType=this.getWidthType(e[gei[i]]))},Vui.prototype.parseContentControlProperties=function(e,t,i){if(je(i)&&(i=this.keywordIndex),je(e[Yii[i]])||(t.lockContentControl=Y.parseBoolValue(e[Yii[i]])),je(e[Xii[i]])||(t.lockContents=Y.parseBoolValue(e[Xii[i]])),je(e[Kii[i]])?t.tag=void 0:t.tag=e[Kii[i]],je(e[tii[i]])||(t.color=e[tii[i]]),je(e[Jii[i]])?t.title=void 0:t.title=e[Jii[i]],je(e[zoi[i]])||(t.appearance=this.getContentControlAppearance(e[zoi[i]])),je(e[koi[i]])||(t.type=this.getContentControlType(e[koi[i]])),je(e[Zii[i]])||(t.hasPlaceHolderText=Y.parseBoolValue(e[Zii[i]])),je(e[$ii[i]])||(t.multiline=Y.parseBoolValue(e[$ii[i]])),je(e[eni[i]])||(t.isTemporary=Y.parseBoolValue(e[eni[i]])),je(e[aZt[i]])||this.parseCharacterFormat(i,e[aZt[i]],t.characterFormat),"CheckBox"===t.type)je(e[rni[i]])||(t.isChecked=Y.parseBoolValue(e[rni[i]])),je(e[sni[i]])||(t.uncheckedState=new Nli,t.uncheckedState.font=e[sni[i]][dni[i]],t.uncheckedState.value=e[sni[i]][pni[i]]),je(e[ani[i]])||(t.checkedState=new Nli,t.checkedState.font=e[ani[i]][dni[i]],t.checkedState.value=e[ani[i]][pni[i]]);else if("Date"===t.type)je(e[tni[i]])||(t.dateCalendarType=this.getDateCalendarType(e[tni[i]])),je(e[ini[i]])||(t.dateStorageFormat=this.getDateStorageFormat(e[ini[i]])),je(e[nni[i]])||(t.dateDisplayLocale=e[nni[i]]),je(e[oni[i]])||(t.dateDisplayFormat=e[oni[i]]);else if(("ComboBox"===t.type||"DropDownList"===t.type)&&!je(e[lni[i]])){t.contentControlListItems=[];for(var n=0;n<e[lni[i]].length;n++){var o=new Rli;o.displayText=e[lni[i]][n][cni[i]],o.value=e[lni[i]][n][pni[i]],t.contentControlListItems.push(o)}}je(e[hni[i]])||(t.xmlMapping=new _li,t.xmlMapping.isMapped=Y.parseBoolValue(e[hni[i]][uni[i]]),t.xmlMapping.isWordMl=Y.parseBoolValue(e[hni[i]][gni[i]]),je(e[hni[i]][mni[i]])||(t.xmlMapping.prefixMapping=e[hni[i]][mni[i]]),t.xmlMapping.xPath=e[hni[i]][fni[i]],t.xmlMapping.storeItemId=e[hni[i]][yni[i]],je(e[hni[i]][vni[i]]))||(t.xmlMapping.customXmlPart=new zli,t.xmlMapping.customXmlPart.id=e[hni[i]][vni[i]][bni[i]],t.xmlMapping.customXmlPart.xml=e[hni[i]][vni[i]][zii[i]])},Vui.prototype.parseSymbol=function(e,t){var i=e.split(" "),e=i.indexOf("SYMBOL");if(-1!==e){var e=i[e+1],n=new pli,e=(n.characterFormat=new Eri(n),n.text=String.fromCharCode(parseInt(e)),i.indexOf("\\f"));if(-1!==e){for(var o="",r=e+1;r<i.length&&"\\s"!==i[r];r++)o+=i[r]+" ";null!==o&&(o=(o=o.replace(/"/g,"")).trim(),n.characterFormat.fontFamily=o)}e=i.indexOf("\\s");-1!==e&&(n.characterFormat.fontSize=parseInt(i[e+1])),(n.line=t).children.push(n)}},Vui.prototype.parseParagraph=function(c,u,g,m,f){for(var y,v,b=this,e=!1,w=(je(m)?m=new Gai(u):e=!0,!1),C=this.viewer.owner.enableTrackChanges,S=0,A=!1,x=!1,I=void 0,T=this,t=0;t<c.length;t++)!function(e){var t=c[e];if(A=!1,t.hasOwnProperty([fii[T.keywordIndex]])&&(2===t[fii[T.keywordIndex]]&&(S=e),1===t[fii[T.keywordIndex]])&&S+1===e&&(A=!0,S=0),A&&T.documentHelper.isPageField)return(i=new Sli).characterFormat=new Eri(i),i.text="",(i.line=m).children.push(i),w=!0,v=--e;if(A&&!je(I)&&-1!==I.indexOf("SYMBOL")&&(T.parseSymbol(I,m),I=void 0,A=!1),t.hasOwnProperty(Bti[T.keywordIndex])||t.hasOwnProperty($Zt[T.keywordIndex])){var i=void 0;if(T.documentHelper.isPageField)(i=new Sli).fieldBegin=T.documentHelper.fieldStacks[T.documentHelper.fieldStacks.length-1];else if("\t"===t[Bti[T.keywordIndex]])i=new Ili;else{if("\f"===t[Bti[T.keywordIndex]]&&T.isPageBreakInsideTable)return v=e;if(t.hasOwnProperty($Zt[T.keywordIndex]))(i=new pdi).breakClearType=T.getBreakClearType(t[$Zt[T.keywordIndex]]);else if(""===t[Bti[T.keywordIndex]]||Y.checkTextFormat(t[Bti[T.keywordIndex]])&&0===m.children.length&&0===e&&f)i=new mdi;else if(i=new pli,0===t[Bti[T.keywordIndex]].length&&!je(t[h$t[T.keywordIndex]]))return v=e}if(i.characterFormat=new Eri(i),T.parseCharacterFormat(T.keywordIndex,t[aZt[T.keywordIndex]],i.characterFormat,g),T.applyCharacterStyle(t,i),i.text=i instanceof pdi?"\v":t[Bti[T.keywordIndex]],I=i.text,T.isHtmlPaste&&(i instanceof pli||i instanceof pdi)&&(s=void 0,0<m.children.length&&(s=m.children[m.children.length-1]),T.documentHelper.textHelper.isRTLText(i.text)?(i.characterFormat.bidi=!0,s instanceof pli&&" "===s.text&&(s.characterFormat.bidi=!0)):" "===i.text&&s&&s.characterFormat.bidi&&(i.characterFormat.bidi=!0)),T.documentHelper.owner.parser.isPaste&&!T.isCutPerformed){if(!je(t[h$t[T.keywordIndex]]))for(var n=0;n<t[h$t[T.keywordIndex]].length;n++)T.revisionCollection.containsKey(t[h$t[T.keywordIndex]][n])&&(je(y=C?T.revisionCollection.get(t[h$t[T.keywordIndex]][n]):y)||!(0<m.children.length)||je(m.children[e-1].revisions[n])||C&&"Deletion"!==y.revisionType||y.revisionID!==t[h$t[T.keywordIndex]][n]?(C||(y=T.documentHelper.revisionsInternal.get(t[h$t[T.keywordIndex]][n])),T.documentHelper.owner.editorModule.isRemoteAction?T.documentHelper.owner.editorModule.insertRevision(i,y.revisionType,y.author,void 0,void 0,!1,y.revisionID):T.documentHelper.owner.editorModule.insertRevision(i,y.revisionType,y.author,void 0,void 0,!1),t[h$t[T.keywordIndex]][n]=i.revisions[n].revisionID):(t[h$t[T.keywordIndex]][n]=m.children[e-1].revisions[n].revisionID,T.checkAndApplyRevision(T.keywordIndex,t,i)))}else T.checkAndApplyRevision(T.keywordIndex,t,i);for(var o=(i.line=m).children,r=o.length-1;0<o.length&&o[r]instanceof Dli&&!je(o[r].properties)&&!0===o[r].properties.isAfterParagraphMark;)r--;r!==o.length-1?o.splice(r+1,0,i):o.push(i),i instanceof pli&&90<i.text.length&&Y.splitWordByMaxLength(i,m,!0),w=!0}else if(t.hasOwnProperty(jii[T.keywordIndex])){var s=new fli;s.line=m,s.footnoteType=T.getFootnoteType(t[jii[T.keywordIndex]]),("Footnote"===s.footnoteType?T.documentHelper.footnoteCollection:T.documentHelper.endnoteCollection).push(s),s.symbolCode=t[Wii[T.keywordIndex]],s.symbolFontName=t[Qii[T.keywordIndex]],s.customMarker=t[Uii[T.keywordIndex]],s.characterFormat=new Eri(s),T.parseCharacterFormat(T.keywordIndex,t[aZt[T.keywordIndex]],s.characterFormat,g),T.applyCharacterStyle(t,s),T.checkAndApplyRevision(T.keywordIndex,t,s),T.parseBody(t[_ni[T.keywordIndex]],s.bodyWidget.childWidgets,s.bodyWidget,!1,void 0,void 0,void 0,!0),m.children.push(s),w=!0}else if(t.hasOwnProperty(Dti[T.keywordIndex])){T.documentHelper.owner.editorModule&&(T.documentHelper.owner.editorModule.chartType=!0);var s=new yhi,a=(s.title=t[Eti[T.keywordIndex]],s.type=t[Dti[T.keywordIndex]],s.chartGapWidth=t[Mti[T.keywordIndex]],s.chartOverlap=t[kti[T.keywordIndex]],T.parseChartTitleArea(t[Sti[T.keywordIndex]],s.chartTitleArea),T.parseChartArea(t[Cti[T.keywordIndex]],s.chartArea),T.parseChartArea(t[Ati[T.keywordIndex]],s.chartPlotArea),T.parseChartLegend(t[xti[T.keywordIndex]],s.chartLegend),T.parseChartData(t,s),T.parseChartCategoryAxis(t[Iti[T.keywordIndex]],s.chartPrimaryCategoryAxis),T.parseChartCategoryAxis(t[Tti[T.keywordIndex]],s.chartPrimaryValueAxis),null!=t[Pti[T.keywordIndex]]&&T.parseChartDataTable(t[Pti[T.keywordIndex]],s.chartDataTable),(s.line=m).children.push(s),s.height=Y.convertPointToPixel(t[_ti[T.keywordIndex]]),s.width=Y.convertPointToPixel(t[Vti[T.keywordIndex]]),new jVt);a.chartRender(t,T.keywordIndex),(s.officeChart=a).chart.appendTo(s.targetElement),w=!0}else if(t.hasOwnProperty(oii[T.keywordIndex])){var l=new rhi(Y.parseBoolValue(t[sii[T.keywordIndex]])),a=(l.isMetaFile=Y.parseBoolValue(t[aii[T.keywordIndex]]),l.isCompressed=t[Goi[T.keywordIndex]],l.metaFileImageString=t[rii[T.keywordIndex]],l.characterFormat=new Eri(l),l.line=m,T.checkAndApplyRevision(T.keywordIndex,t,l),m.children.push(l),Y.formatClippedString(t[oii[T.keywordIndex]]).formatClippedString);T.validateImageUrl(a)?T.isPaste&&!je(T.documentHelper.owner.editorModule.pasteImageIndex)?(l.imageString=T.documentHelper.owner.editorModule.pasteImageIndex.get(t[oii[T.keywordIndex]]),je(t[rii[T.keywordIndex]])||(l.metaFileImageString=T.documentHelper.owner.editorModule.pasteImageIndex.get(t[rii[T.keywordIndex]]))):l.imageString=t[oii[T.keywordIndex]]:l.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","NaN"===parseInt(t[oii[T.keywordIndex]]).toString()&&T.documentHelper.addBase64StringInCollection(l),l.width=Y.convertPointToPixel(t[Vti[T.keywordIndex]]),l.height=Y.convertPointToPixel(t[_ti[T.keywordIndex]]),T.isContextBasedPaste||(je(s=T.documentHelper.getImageString(l))||!Y.startsWith(s,"http://")&&!Y.startsWith(s,"https://")||(l.element.crossOrigin="Anonymous",T.viewer.documentHelper.getBase64(s,l.width,l.height).then(function(e){b.viewer.documentHelper.images.get(parseInt(l.imageString))[1]=e,l.element.src=e})),l.element.src=s),l.top=t[lii[T.keywordIndex]],l.left=t[pii[T.keywordIndex]],l.bottom=t[hii[T.keywordIndex]],l.right=t[dii[T.keywordIndex]],l.cropHeightScale=t[cii[T.keywordIndex]],l.cropWidthScale=t[uii[T.keywordIndex]],l.name=t[BZt[T.keywordIndex]],l.alternateText=t[Lti[T.keywordIndex]],l.title=t[Jii[T.keywordIndex]],l.visible=Y.parseBoolValue(t[Rti[T.keywordIndex]]),l.widthScale=t[Hti[T.keywordIndex]],l.heightScale=t[zti[T.keywordIndex]],l.verticalPosition=Y.convertPointToPixel(t[Rni[T.keywordIndex]]),l.verticalOrigin=T.getVerticalOrigin(t[Lni[T.keywordIndex]]),l.verticalAlignment=T.getShapeVerticalAlignment(t[rei[T.keywordIndex]]),l.horizontalPosition=Y.convertPointToPixel(t[Vni[T.keywordIndex]]),l.horizontalOrigin=T.getHorizontalOrigin(t[Oni[T.keywordIndex]]),l.horizontalAlignment=T.getShapeHorizontalAlignment(t[Nni[T.keywordIndex]]),l.allowOverlap=Y.parseBoolValue(t[Mni[T.keywordIndex]]),je(t[Qti[T.keywordIndex]])||(l.textWrappingStyle=T.getTextWrappingStyle(t[Qti[T.keywordIndex]])),je(t[Uti[T.keywordIndex]])||(l.textWrappingType=T.getTextWrappingType(t[Uti[T.keywordIndex]])),l.isBelowText=Y.parseBoolValue(t[Oti[T.keywordIndex]]),je(t[Fni[T.keywordIndex]])||(l.distanceBottom=Y.convertPointToPixel(t[Fni[T.keywordIndex]])),je(t[Bni[T.keywordIndex]])||(l.distanceLeft=Y.convertPointToPixel(t[Bni[T.keywordIndex]])),je(t[Pni[T.keywordIndex]])||(l.distanceRight=Y.convertPointToPixel(t[Pni[T.keywordIndex]])),je(t[kni[T.keywordIndex]])||(l.distanceTop=Y.convertPointToPixel(t[kni[T.keywordIndex]])),l.zOrderPosition=t[Kti[T.keywordIndex]],l.layoutInCell=Y.parseBoolValue(t[Jti[T.keywordIndex]]),(!je(t[lii[T.keywordIndex]])&&0!==t[lii[T.keywordIndex]]||!je(t[hii[T.keywordIndex]])&&0!==t[hii[T.keywordIndex]]||!je(t[pii[T.keywordIndex]])&&0!==t[pii[T.keywordIndex]]||!je(t[dii[T.keywordIndex]])&&0!==t[dii[T.keywordIndex]])&&(l.isCrop=!0),"Inline"!==T.getTextWrappingStyle(l.textWrappingStyle)&&u.floatingElements.push(l),T.parseCharacterFormat(T.keywordIndex,t[aZt[T.keywordIndex]],l.characterFormat),w=!0}else if(t.hasOwnProperty(gii[T.keywordIndex])||t.hasOwnProperty(fii[T.keywordIndex])&&0===t[fii[T.keywordIndex]]){x=!0;a=new Zai(0);T.parseCharacterFormat(T.keywordIndex,t[aZt[T.keywordIndex]],a.characterFormat,g),T.applyCharacterStyle(t,a),a.fieldCodeType=t.fieldCodeType,a.hasFieldEnd=t[gii[T.keywordIndex]],t.hasOwnProperty(mii[T.keywordIndex])&&(s=T.parseFormFieldData(T.keywordIndex,t,s=void 0),a.formFieldData=s,T.isContextBasedPaste||T.documentHelper.formFields.push(a)),T.documentHelper.fieldStacks.push(a),T.checkAndApplyRevision(T.keywordIndex,t,a),a.line=m,T.isContextBasedPaste||T.documentHelper.fields.push(a),m.children.push(a)}else if(t.hasOwnProperty([fii[T.keywordIndex]])){s=void 0;2===t[fii[T.keywordIndex]]||1===t[fii[T.keywordIndex]]&&x?(s=new Zai(2),T.parseCharacterFormat(T.keywordIndex,t[aZt[T.keywordIndex]],s.characterFormat,g),T.checkAndApplyRevision(T.keywordIndex,t,s),T.fieldSeparator=s,0<T.documentHelper.fieldStacks.length&&(s.fieldBegin=T.documentHelper.fieldStacks[T.documentHelper.fieldStacks.length-1],s.fieldBegin.fieldSeparator=s,2<=m.children.length)&&!je(a=T.containsFieldBegin(m))&&a instanceof pli&&(a.text.match("PAGE")||a.text.match("page"))&&(a.text.replace(/^\s+/g,"").startsWith("HYPERLINK")||(T.documentHelper.isPageField=!0)),1===t[fii[T.keywordIndex]]&&x&&(S=--e),x=!1):1===t[fii[T.keywordIndex]]&&(s=new Zai(1),T.parseCharacterFormat(T.keywordIndex,t[aZt[T.keywordIndex]],s.characterFormat,g),T.applyCharacterStyle(t,s),T.checkAndApplyRevision(T.keywordIndex,t,s),0<T.documentHelper.fieldStacks.length&&(s.fieldBegin=T.documentHelper.fieldStacks[T.documentHelper.fieldStacks.length-1],s.fieldBegin.fieldEnd=s),!je(s.fieldBegin)&&s.fieldBegin.fieldSeparator&&(s.fieldSeparator=s.fieldBegin.fieldSeparator,s.fieldBegin.fieldSeparator.fieldEnd=s,w=!0),T.documentHelper.fieldStacks.splice(T.documentHelper.fieldStacks.length-1,1),T.fieldSeparator=void 0,T.documentHelper.isPageField=!1,T.isContextBasedPaste||T.documentHelper.fieldCollection.push(s.fieldBegin),I=void 0),(s.line=m).children.push(s)}else if(t.hasOwnProperty([hoi[T.keywordIndex]])){a=void 0;(a=new Dli(t[hoi[T.keywordIndex]])).name=t[BZt[T.keywordIndex]],a.properties=t[doi[T.keywordIndex]],je(t[doi[T.keywordIndex]])||(je(t[doi[T.keywordIndex]][Koi[T.keywordIndex]])||(a.properties.isAfterParagraphMark=Y.parseBoolValue(t[doi[T.keywordIndex]][Koi[T.keywordIndex]])),je(t[doi[T.keywordIndex]][tri[T.keywordIndex]])||(a.properties.isAfterTableMark=Y.parseBoolValue(t[doi[T.keywordIndex]][tri[T.keywordIndex]])),je(t[doi[T.keywordIndex]][Zoi[T.keywordIndex]])||(a.properties.isAfterRowMark=Y.parseBoolValue(t[doi[T.keywordIndex]][Zoi[T.keywordIndex]])),je(t[doi[T.keywordIndex]][Joi[T.keywordIndex]])||(a.properties.isAfterCellMark=Y.parseBoolValue(t[doi[T.keywordIndex]][Joi[T.keywordIndex]])),je(t[doi[T.keywordIndex]][foi[T.keywordIndex]])||(a.properties.columnFirst=t[doi[T.keywordIndex]][foi[T.keywordIndex]]),je(t[doi[T.keywordIndex]][yoi[T.keywordIndex]]))||(a.properties.columnLast=t[doi[T.keywordIndex]][yoi[T.keywordIndex]]),T.checkAndApplyRevision(T.keywordIndex,t,a),m.children.push(a),a.line=m,T.isParseHeader&&!T.isPaste||(0===t[hoi[T.keywordIndex]]?(s=T.isPaste&&!T.documentHelper.bookmarks.containsKey(a.name),!T.isPaste||s&&!T.isContextBasedPaste?T.documentHelper.bookmarks.add(a.name,a):s||m.children.splice(m.children.indexOf(a),1)):1===t[hoi[T.keywordIndex]]&&T.documentHelper.bookmarks.containsKey(a.name)&&(s=T.documentHelper.bookmarks.get(a.name),h=T.isPaste&&je(s.reference),!T.isPaste||h&&!T.isContextBasedPaste?((s.reference=a).reference=s,T.documentHelper.endBookmarksUpdated.push(a.name)):h||m.children.splice(m.children.indexOf(a),1))),0!==a.name.indexOf("_")&&(w=!0)}else if(t.hasOwnProperty([moi[T.keywordIndex]]))t.hasOwnProperty(woi[T.keywordIndex])?(s=new phi,T.editableRanges.containsKey(t[moi[T.keywordIndex]])&&(h=T.editableRanges.get(t[moi[T.keywordIndex]]),(s.editRangeStart=h).editRangeEnd=s,je(t[moi[T.keywordIndex]])||(s.editRangeId=t[moi[T.keywordIndex]]),T.editableRanges.remove(t[moi[T.keywordIndex]])),m.children.push(s),s.line=m):(a=T.parseEditableRangeStart(t),m.children.push(a),a.line=m,T.editableRanges.containsKey(t[moi[T.keywordIndex]])||T.editableRanges.add(t[moi[T.keywordIndex]],a)),w=!0;else if(t.hasOwnProperty([Pii[T.keywordIndex]])){var h=t[Pii[T.keywordIndex]],s=void 0;T.commentStarts.containsKey(h)&&T.commentStarts.get(h);T.commentEnds.containsKey(h)&&T.commentEnds.get(h),t.hasOwnProperty([Bii[T.keywordIndex]])&&(0===t[Bii[T.keywordIndex]]?((a=new Khi(0)).commentId=h,T.commentStarts.containsKey(h)||T.commentStarts.add(h,a),(a.line=m).children.push(a),je(s=T.commentsCollection.get(h))||((s.commentStart=a).comment=s)):((a=new Khi(1)).commentId=h,T.commentEnds.containsKey(h)||T.commentEnds.add(h,a),(a.line=m).children.push(a),je(s=T.commentsCollection.get(h))||((s.commentEnd=a).comment=s)),!je(s))&&s.isReply&&(je(s.ownerComment.commentStart)&&(s.ownerComment.commentStart=s.commentStart),je(s.ownerComment.commentEnd))&&(s.ownerComment.commentEnd=s.commentEnd)}else if(t.hasOwnProperty([Fti[T.keywordIndex]])){h=new Xli;h.shapeId=t[Fti[T.keywordIndex]],h.name=t[BZt[T.keywordIndex]],h.alternateText=t[Lti[T.keywordIndex]],h.title=t[Jii[T.keywordIndex]],h.visible=Y.parseBoolValue(t[Rti[T.keywordIndex]]),h.width=Y.convertPointToPixel(t[Vti[T.keywordIndex]]),h.height=Y.convertPointToPixel(t[_ti[T.keywordIndex]]),0===h.height&&(h.isZeroHeight=!0),h.widthScale=t[Hti[T.keywordIndex]],h.heightScale=t[zti[T.keywordIndex]],h.verticalPosition=Y.convertPointToPixel(t[Rni[T.keywordIndex]]),h.verticalOrigin=T.getVerticalOrigin(t[Lni[T.keywordIndex]]),h.verticalAlignment=T.getShapeVerticalAlignment(t[rei[T.keywordIndex]]),h.verticalRelativePercent=t[qti[T.keywordIndex]],h.horizontalPosition=Y.convertPointToPixel(t[Vni[T.keywordIndex]]),h.horizontalOrigin=T.getHorizontalOrigin(t[Oni[T.keywordIndex]]),h.horizontalAlignment=T.getShapeHorizontalAlignment(t[Nni[T.keywordIndex]]),h.horizontalRelativePercent=t[Gti[T.keywordIndex]],h.heightRelativePercent=t[Yti[T.keywordIndex]],h.widthRelativePercent=t[Xti[T.keywordIndex]],h.zOrderPosition=t[Kti[T.keywordIndex]],h.allowOverlap=Y.parseBoolValue(t[Mni[T.keywordIndex]]),h.textWrappingStyle=T.getTextWrappingStyle(t[Qti[T.keywordIndex]]),h.textWrappingType=T.getTextWrappingType(t[Uti[T.keywordIndex]]),h.isBelowText=Y.parseBoolValue(t[Oti[T.keywordIndex]]),h.isHorizontalRule=Y.parseBoolValue(t[Nti[T.keywordIndex]]),je(t[Fni[T.keywordIndex]])||(h.distanceBottom=Y.convertPointToPixel(t[Fni[T.keywordIndex]])),je(t[Bni[T.keywordIndex]])||(h.distanceLeft=Y.convertPointToPixel(t[Bni[T.keywordIndex]])),je(t[Pni[T.keywordIndex]])||(h.distanceRight=Y.convertPointToPixel(t[Pni[T.keywordIndex]])),je(t[kni[T.keywordIndex]])||(h.distanceTop=Y.convertPointToPixel(t[kni[T.keywordIndex]])),h.layoutInCell=Y.parseBoolValue(t[Jti[T.keywordIndex]]),h.lockAnchor=Y.parseBoolValue(t[Zti[T.keywordIndex]]),h.autoShapeType=T.getAutoShapeType(t[$ti[T.keywordIndex]]),h.editingPoints=t[ori[T.keywordIndex]],t.hasOwnProperty(jti[T.keywordIndex])&&((a=new ehi).line=Y.parseBoolValue(t[jti[T.keywordIndex]][Vei[T.keywordIndex]]),a.lineFormatType=T.getLineFormatType(t[jti[T.keywordIndex]][joi[T.keywordIndex]]),a.color=t[jti[T.keywordIndex]][tii[T.keywordIndex]],a.weight=t[jti[T.keywordIndex]][Qoi[T.keywordIndex]],a.dashStyle=T.getLineDashStyle(t[jti[T.keywordIndex]][Pei[T.keywordIndex]]),h.lineFormat=a),t.hasOwnProperty(Wti[T.keywordIndex])&&((s=new ihi).color=t[Wti[T.keywordIndex]][tii[T.keywordIndex]],s.fill=Y.parseBoolValue(t[Wti[T.keywordIndex]][iii[T.keywordIndex]]),h.fillFormat=s),t.hasOwnProperty(eii[T.keywordIndex])&&((a=new Zli).textVerticalAlignment=T.getTextVerticalAlignment(t[eii[T.keywordIndex]][nii[T.keywordIndex]]),a.marginLeft=Y.convertPointToPixel(t[eii[T.keywordIndex]][V$t[T.keywordIndex]]),a.marginRight=Y.convertPointToPixel(t[eii[T.keywordIndex]][_$t[T.keywordIndex]]),a.marginTop=Y.convertPointToPixel(t[eii[T.keywordIndex]][H$t[T.keywordIndex]]),a.marginBottom=Y.convertPointToPixel(t[eii[T.keywordIndex]][z$t[T.keywordIndex]]),0===t[eii[T.keywordIndex]][_ni[T.keywordIndex]].length&&"DownArrow"===h.autoShapeType&&(s=1===T.keywordIndex?{i:[]}:{inlines:[]},t[eii[T.keywordIndex]][_ni[T.keywordIndex]].push(s)),T.parseBody(t[eii[T.keywordIndex]][_ni[T.keywordIndex]],a.childWidgets,a),(h.textFrame=a).containerShape=h),h.line=m,T.checkAndApplyRevision(T.keywordIndex,t,h),m.children.push(h),u.floatingElements.push(h)}else if(t.hasOwnProperty(Gii[T.keywordIndex])){for(var d=new Pli("Inline"),s=new Pli("Inline"),p=(T.parseContentControlProperties(t[Gii[T.keywordIndex]],d.contentControlProperties),s.contentControlProperties=d.contentControlProperties,d.line=m,s.line=m,d.type=0,s.type=1,m.children.push(d),T.parseParagraph(t[qii[T.keywordIndex]],u,g,m),m.children[m.children.length-1]);!(p instanceof Pli);)p.contentControlProperties=d.contentControlProperties,p=p.previousElement;m.children.push(s),w=!0}v=e}(t),t=v;return this.isCutPerformed=!1,e||u.childWidgets.push(m),w},Vui.prototype.parseFormFieldData=function(e,t,i){return i instanceof ili||i instanceof rli||i instanceof lli?(i instanceof rli?(i.sizeType=t.sizeType,i.size=t.size,i.defaultValue=t.defaultValue,i.checked=t.checked):i instanceof ili?(i.type=t.type,i.maxLength=t.maxLength,i.defaultValue=t.defaultValue,i.format=t.format):(i.dropdownItems=t.dropdownItems,i.selectedIndex=t.selectedIndex),i.name=t.name,i.enabled=t.enabled,i.helpText=t.helpText,i.statusText=t.statusText):(t[mii[e]].hasOwnProperty(wii[e])?((i=new ili).type=this.getTextFormFieldType(t[mii[e]][wii[e]][koi[e]]),i.maxLength=t[mii[e]][wii[e]][Aii[e]],i.defaultValue=t[mii[e]][wii[e]][xii[e]],i.format=this.getTextFormFieldFormat(t[mii[e]][wii[e]][Iii[e]])):t[mii[e]].hasOwnProperty(Cii[e])?((i=new rli).sizeType=this.getCheckBoxSizeType(t[mii[e]][Cii[e]][Tii[e]]),i.size=t[mii[e]][Cii[e]][Eii[e]],i.defaultValue=Y.parseBoolValue(t[mii[e]][Cii[e]][xii[e]]),i.checked=Y.parseBoolValue(t[mii[e]][Cii[e]][Dii[e]])):((i=new lli).dropdownItems=t[mii[e]][Sii[e]][Mii[e]],i.selectedIndex=t[mii[e]][Sii[e]][kii[e]]),i.name=t[mii[e]][BZt[e]],i.enabled=Y.parseBoolValue(t[mii[e]][yii[e]]),i.helpText=t[mii[e]][vii[e]],i.statusText=t[mii[e]][bii[e]]),i},Vui.prototype.applyCharacterStyle=function(e,t){je(e[aZt[this.keywordIndex]])||je(e[aZt[this.keywordIndex]][KZt[this.keywordIndex]])||(e=this.documentHelper.styles.findByName(e[aZt[this.keywordIndex]][KZt[this.keywordIndex]],"Character"),t.characterFormat.applyStyle(e))},Vui.prototype.parseEditableRangeStart=function(e){var t=new ghi;return je(e[foi[this.keywordIndex]])||(t.columnFirst=e[foi[this.keywordIndex]]),je(e[yoi[this.keywordIndex]])||(t.columnLast=e[yoi[this.keywordIndex]]),je(e[moi[this.keywordIndex]])||(t.editRangeId=e[moi[this.keywordIndex]]),je(e[voi[this.keywordIndex]])||(t.user=e[voi[this.keywordIndex]],-1===this.documentHelper.userCollection.indexOf(t.user)&&this.documentHelper.userCollection.push(t.user),this.addEditRangeCollection(t.user,t)),je(e[boi[this.keywordIndex]])||""===e[boi[this.keywordIndex]]||(t.group=e[boi[this.keywordIndex]],t.group="everyone"===t.group?"Everyone":t.group,-1===this.documentHelper.userCollection.indexOf(t.group)&&this.documentHelper.userCollection.push(t.group),this.addEditRangeCollection(t.group,t)),t},Vui.prototype.addEditRangeCollection=function(e,t){var i;this.documentHelper.editRanges.containsKey(e)?this.documentHelper.editRanges.get(e).push(t):((i=[]).push(t),this.documentHelper.editRanges.add(e,i))},Vui.prototype.parseChartTitleArea=function(e,t){t.chartfontName=e[qoi[this.keywordIndex]],t.chartFontSize=e[GZt[this.keywordIndex]],this.parseChartDataFormat(e[Lei[this.keywordIndex]],t.dataFormat),this.parseChartLayout(e[Fei[this.keywordIndex]],t.layout)},Vui.prototype.parseChartDataFormat=function(e,t){t.fill.color=e[iii[this.keywordIndex]][_ei[this.keywordIndex]],t.fill.rgb=e[iii[this.keywordIndex]][Hoi[this.keywordIndex]],t.line.color=e[Vei[this.keywordIndex]][tii[this.keywordIndex]],t.line.rgb=e[Vei[this.keywordIndex]][Hoi[this.keywordIndex]]},Vui.prototype.parseChartLayout=function(e,t){t.chartLayoutLeft=e[Hei[this.keywordIndex]],t.chartLayoutTop=e[zei[this.keywordIndex]]},Vui.prototype.parseChartLegend=function(e,t){t.chartLegendPostion=e[coi[this.keywordIndex]],this.parseChartTitleArea(e[Sti[this.keywordIndex]],t.chartTitleArea)},Vui.prototype.parseChartCategoryAxis=function(e,t){t.categoryAxisType=e[vti[this.keywordIndex]],t.categoryNumberFormat=e[$ni[this.keywordIndex]],e.hasOwnProperty(Boi[this.keywordIndex])&&(t.isAutoInternal=Y.parseBoolValue(e[Boi[this.keywordIndex]])),t.interval=e[Poi[this.keywordIndex]],t.axisFontSize=e[GZt[this.keywordIndex]],t.axisFontName=e[qoi[this.keywordIndex]],t.max=e[Foi[this.keywordIndex]],t.min=e[Loi[this.keywordIndex]],t.majorGridLines=Y.parseBoolValue(e[Roi[this.keywordIndex]]),t.minorGridLines=Y.parseBoolValue(e[Ooi[this.keywordIndex]]),t.majorTick=e[Noi[this.keywordIndex]],t.minorTick=e[Voi[this.keywordIndex]],t.tickPosition=e[_oi[this.keywordIndex]],t.categoryAxisTitle=e[Eti[this.keywordIndex]],null!=e[Eti[this.keywordIndex]]&&this.parseChartTitleArea(e[Sti[this.keywordIndex]],t.chartTitleArea)},Vui.prototype.parseChartDataTable=function(e,t){t.showSeriesKeys=Y.parseBoolValue(e[gti[this.keywordIndex]]),t.hasHorzBorder=Y.parseBoolValue(e[mti[this.keywordIndex]]),t.hasVertBorder=Y.parseBoolValue(e[fti[this.keywordIndex]]),t.hasBorders=Y.parseBoolValue(e[yti[this.keywordIndex]])},Vui.prototype.parseChartArea=function(e,t){t.chartForeColor=e[_ei[this.keywordIndex]]},Vui.prototype.parseChartData=function(e,t){for(var i=0;i<e[bti[this.keywordIndex]].length;i++){var n=new Chi,o=e[bti[this.keywordIndex]][i];o.hasOwnProperty(Nei[this.keywordIndex])&&(n.xName=o[Nei[this.keywordIndex]]);for(var r=0;r<o[Oei[this.keywordIndex]].length;r++){var s=new Ahi,a=o[Oei[this.keywordIndex]][r];s.yAxisValue=a[Rei[this.keywordIndex]],"Bubble"===e[Dti[this.keywordIndex]]&&(s.bubbleSize=a[Eii[this.keywordIndex]]),n.chartData.push(s)}t.chartCategory.push(n)}this.parseChartSeries(e,t)},Vui.prototype.parseChartSeries=function(e,t){for(var i=e[Dti[this.keywordIndex]],n="Pie"===i||"Doughnut"===i,o=0;o<e[wti[this.keywordIndex]].length;o++){var r,s,a=new Ehi,l=e[wti[this.keywordIndex]][o];l.hasOwnProperty($ei[this.keywordIndex])&&(a.seriesName=l[$ei[this.keywordIndex]],n&&(l.hasOwnProperty(rti[this.keywordIndex])&&(a.firstSliceAngle=l[rti[this.keywordIndex]]),"Doughnut"===i)&&(a.doughnutHoleSize=l[sti[this.keywordIndex]]),l.hasOwnProperty(eti[this.keywordIndex])&&this.parseChartDataLabels(l[eti[this.keywordIndex]],a),l.hasOwnProperty(iti[this.keywordIndex])&&(r=new Phi,s=l[iti[this.keywordIndex]],r.markerStyle=s[Uei[this.keywordIndex]],r.markerColor=s[qei[this.keywordIndex]],r.numberValue=s[Gei[this.keywordIndex]],a.seriesFormat=r),l.hasOwnProperty(tti[this.keywordIndex])&&((s=a.errorBar).errorType=l[tti[this.keywordIndex]][koi[this.keywordIndex]],s.errorDirection=l[tti[this.keywordIndex]][jei[this.keywordIndex]],s.errorEndStyle=l[tti[this.keywordIndex]][Wei[this.keywordIndex]],s.numberValue=l[tti[this.keywordIndex]][Qei[this.keywordIndex]]),l.hasOwnProperty(nti[this.keywordIndex])&&this.parseChartTrendLines(l[nti[this.keywordIndex]],a),this.parseChartSeriesDataPoints(l[oti[this.keywordIndex]],a)),t.chartSeries.push(a)}},Vui.prototype.parseChartDataLabels=function(e,t){var i=new Fhi;i.labelPosition=e[coi[this.keywordIndex]],i.fontName=e[qoi[this.keywordIndex]],i.fontColor=e[YZt[this.keywordIndex]],i.fontSize=e[GZt[this.keywordIndex]],i.isLegendKey=Y.parseBoolValue(e[ati[this.keywordIndex]]),i.isBubbleSize=Y.parseBoolValue(e[lti[this.keywordIndex]]),i.isCategoryName=Y.parseBoolValue(e[hti[this.keywordIndex]]),i.isSeriesName=Y.parseBoolValue(e[dti[this.keywordIndex]]),i.isValue=Y.parseBoolValue(e[pti[this.keywordIndex]]),i.isPercentage=Y.parseBoolValue(e[cti[this.keywordIndex]]),i.isLeaderLines=Y.parseBoolValue(e[uti[this.keywordIndex]]),t.dataLabels=i},Vui.prototype.parseChartSeriesDataPoints=function(e,t){for(var i=0;i<e.length;i++){var n=new _hi;e[i].hasOwnProperty(bni[this.keywordIndex])&&(n.id=e[i][bni[this.keywordIndex]]),this.parseChartDataFormat(e[i],n),t.chartDataFormat.push(n)}},Vui.prototype.parseChartTrendLines=function(e,t){for(var i=0;i<e.length;i++){var n=e[i],o=new Rhi;o.trendLineName=n[BZt[this.keywordIndex]],o.trendLineType=n[koi[this.keywordIndex]],o.forwardValue=n[Yei[this.keywordIndex]],o.backwardValue=n[Xei[this.keywordIndex]],o.interceptValue=n[Kei[this.keywordIndex]],o.isDisplayEquation=Y.parseBoolValue(n[Zei[this.keywordIndex]]),o.isDisplayRSquared=Y.parseBoolValue(n[Jei[this.keywordIndex]]),t.trendLines.push(o)}},Vui.prototype.parseTableFormat=function(e,t,i){this.parseBorders(i,e[k$t[i]],t.borders),je(e[mei[i]])||(t.allowAutoFit=Y.parseBoolValue(e[mei[i]])),je(e[fei[i]])||(t.cellSpacing=e[fei[i]]),je(e[V$t[i]])||(t.leftMargin=e[V$t[i]]),je(e[H$t[i]])||(t.topMargin=e[H$t[i]]),je(e[_$t[i]])||(t.rightMargin=e[_$t[i]]),je(e[z$t[i]])||(t.bottomMargin=e[z$t[i]]),je(e[g$t[i]])||(t.leftIndent=e[g$t[i]]),this.parseShading(e[yei[i]],t.shading,i),je(e[vei[i]])||(t.tableAlignment=this.getTableAlignment(e[vei[i]])),je(e[bei[i]])||(t.preferredWidth=e[bei[i]]),je(e[wei[i]])||(t.preferredWidthType=this.getWidthType(e[wei[i]])),je(e[JZt[i]])||(t.bidi=Y.parseBoolValue(e[JZt[i]])),je(e[Cei[i]])||(t.horizontalPositionAbs=this.getHorizontalPositionAbs(e[Cei[i]])),je(e[Vni[i]])||(t.horizontalPosition=e[Vni[i]]),je(e[KZt[i]])||(t.styleName=e[KZt[i]]),this.documentHelper.owner.enableCollaborativeEditing&&!je(e[Jii[i]])&&(t.title=e[Jii[i]]),this.documentHelper.owner.enableCollaborativeEditing&&!je(e[xni[i]])&&(t.description=e[xni[i]])},Vui.prototype.parseCellFormat=function(e,t,i){je(e)||(this.parseBorders(i,e[k$t[i]],t.borders),e.isSamePaddingAsTable||this.parseCellMargin(e,t,i),je(e[iei[i]])||(t.cellWidth=e[iei[i]]),je(e[nei[i]])||(t.columnSpan=e[nei[i]]),je(e[oei[i]])||(t.rowSpan=e[oei[i]]),this.parseShading(e[yei[i]],t.shading,i),je(e[rei[i]])||(t.verticalAlignment=this.getCellVerticalAlignment(e[rei[i]])),je(e[wei[i]])||(t.preferredWidthType=this.getWidthType(e[wei[i]])),je(e[bei[i]]))||(t.preferredWidth=e[bei[i]])},Vui.prototype.parseCellMargin=function(e,t,i){je(e[V$t[i]])||(t.leftMargin=e[V$t[i]]),je(e[_$t[i]])||(t.rightMargin=e[_$t[i]]),je(e[H$t[i]])||(t.topMargin=e[H$t[i]]),je(e[z$t[i]])||(t.bottomMargin=e[z$t[i]])},Vui.prototype.parseRowFormat=function(e,t,i){je(e)||(je(e[sei[i]])||(t.allowBreakAcrossPages=Y.parseBoolValue(e[sei[this.keywordIndex]])),je(e[aei[i]])||(t.isHeader=Y.parseBoolValue(e[aei[i]])),je(e[lei[i]])||(t.heightType=this.getHeightType(e[lei[i]])),je(e[_ti[i]])||(t.height=e[_ti[i]]),je(e[V$t[i]])||(t.leftMargin=e[V$t[i]]),je(e[H$t[i]])||(t.topMargin=e[H$t[i]]),je(e[_$t[i]])||(t.rightMargin=e[_$t[i]]),je(e[z$t[i]])||(t.bottomMargin=e[z$t[i]]),je(e[g$t[i]])||(t.leftIndent=e[g$t[i]]),!je(e[h$t[i]])&&0<e[h$t[i]].length&&this.checkAndApplyRevision(i,e,t),this.parseRowGridValues(e,t,i),this.parseBorders(i,e[k$t[i]],t.borders))},Vui.prototype.parseBorders=function(e,t,i){je(t)||(i.isParsing=!0,this.parseBorder(e,t[pii[e]],i.left),this.parseBorder(e,t[dii[e]],i.right),this.parseBorder(e,t[lii[e]],i.top),this.parseBorder(e,t[hii[e]],i.bottom),this.parseBorder(e,t[Eei[e]],i.vertical),this.parseBorder(e,t[Dei[e]],i.horizontal),this.parseBorder(e,t[kei[e]],i.diagonalDown),this.parseBorder(e,t[Mei[e]],i.diagonalUp),i.isParsing=!1)},Vui.prototype.parseBorder=function(e,t,i){je(t)||(je(t[tii[e]])||(i.color=this.getColor(t[tii[e]])),je(t[Pei[e]])||(i.lineStyle=this.getLineStyle(t[Pei[e]])),je(t[Bei[e]])||(i.lineWidth=t[Bei[e]]),je(t[Tei[e]])||(i.hasNoneStyle=Y.parseBoolValue(t[Tei[e]])),je(t[Coi[e]])||(i.space=t[Coi[e]]),je(t[Iei[e]]))||(i.shadow=Y.parseBoolValue(t[Iei[e]]))},Vui.prototype.parseShading=function(e,t,i){je(e)||(je(e[Aei[i]])||(t.backgroundColor=this.getColor(e[Aei[i]])),je(e[xei[i]])||(t.foregroundColor=this.getColor(e[xei[i]])),je(e[Sei[i]])&&je(e.textureStyle))||(t.textureStyle=je(e[Sei[i]])?this.getTextureStyle(e.textureStyle):this.getTextureStyle(e[Sei[i]]))},Vui.prototype.parseCharacterFormat=function(e,t,i,n){var o;je(t)||(n&&t.hasOwnProperty(Uoi[e])?this.parseCharacterFormat(e,t.inlineFormat,i):(je(t[QZt[e]])||(i.baselineAlignment=this.getBaseAlignment(t[QZt[e]])),je(t[zZt[e]])||(i.underline=this.getUnderline(t[zZt[e]])),je(t[jZt[e]])||(i.underlineColor=this.getColor(t[jZt[e]])),je(t[WZt[e]])||(i.fontHintType=this.getFontHintType(t[WZt[e]])),je(t[UZt[e]])||(i.strikethrough=this.getStrikethrough(t[UZt[e]])),je(t[GZt[e]])||(t[GZt[e]]=parseFloat(t[GZt[e]]),10*t[GZt[e]]%10!=0&&(n=10*t[GZt[e]].toFixed(1),t[GZt[e]]=n%5==0?t[GZt[e]].toFixed(1):Math.round(t[GZt[e]])),o=parseFloat(t[GZt[e]]),i.fontSize=o<0?0:o),je(t[XZt[e]])||(-1!==t[XZt[e]].indexOf('"')&&(t[XZt[e]]=t[XZt[e]].replace('"',"")),n=t[XZt[e]],je(this.documentHelper.fontSubstitutionTable)||!this.documentHelper.fontSubstitutionTable.containsKey(n)||this.isFontInstalled(n)||(n=this.documentHelper.fontSubstitutionTable.get(n)),i.fontFamily=n,je(t[s$t[e]])&&(i.fontFamilyAscii=n),je(t[l$t[e]])&&(i.fontFamilyNonFarEast=n)),je(t[_Zt[e]])||(i.bold=Y.parseBoolValue(t[_Zt[e]])),je(t[HZt[e]])||(i.italic=Y.parseBoolValue(t[HZt[e]])),je(t[qZt[e]])||(i.highlightColor=this.getHighlightColor(t[qZt[e]])),je(t[YZt[e]])||(i.fontColor=this.getColor(t[YZt[e]])),je(t[JZt[e]])||(i.bidi=Y.parseBoolValue(t[JZt[e]])),je(t[ZZt[e]])||(i.bdo=this.getBiDirectionalOverride(t[ZZt[e]])),je(t[e$t[e]])||(o=parseFloat(t[e$t[e]]),i.fontSizeBidi=o<0?0:o),je(t[t$t[e]])||(-1!==t[t$t[e]].indexOf('"')&&(t[t$t[e]]=t[t$t[e]].replace('"',"")),n=t[t$t[e]],je(this.documentHelper.fontSubstitutionTable)||!this.documentHelper.fontSubstitutionTable.containsKey(n)||this.isFontInstalled(n)||(n=this.documentHelper.fontSubstitutionTable.get(n)),i.fontFamilyBidi=n),je(t[i$t[e]])||(i.boldBidi=Y.parseBoolValue(t[i$t[e]])),je(t[n$t[e]])||(i.italicBidi=Y.parseBoolValue(t[n$t[e]])),!je(t[h$t[e]])&&0<t[h$t[e]].length&&this.checkAndApplyRevision(e,t,i),je(t[o$t[e]])||(i.allCaps=Y.parseBoolValue(t[o$t[e]])),je(t[VZt[e]])||(i.localeIdBidi=t[VZt[e]]),je(t[OZt[e]])||(i.localeIdAscii=t[OZt[e]]),je(t[NZt[e]])||(i.localeIdFarEast=t[NZt[e]]),je(t[r$t[e]])||(i.complexScript=Y.parseBoolValue(t[r$t[e]])),je(t[nri[e]])||(i.hidden=Y.parseBoolValue(t[nri[e]])),je(t[a$t[e]])||(-1!==t[a$t[e]].indexOf('"')&&(t[a$t[e]]=t[a$t[e]].replace('"',"")),o=t[a$t[e]],je(this.documentHelper.fontSubstitutionTable)||!this.documentHelper.fontSubstitutionTable.containsKey(o)||this.isFontInstalled(o)||(o=this.documentHelper.fontSubstitutionTable.get(o)),i.fontFamilyFarEast=o),je(t[s$t[e]])||(-1!==t[s$t[e]].indexOf('"')&&(t[s$t[e]]=t[s$t[e]].replace('"',"")),n=t[s$t[e]],je(this.documentHelper.fontSubstitutionTable)||!this.documentHelper.fontSubstitutionTable.containsKey(n)||this.isFontInstalled(n)||(n=this.documentHelper.fontSubstitutionTable.get(n)),i.fontFamilyAscii=n),je(t[l$t[e]])||(-1!==t[l$t[e]].indexOf('"')&&(t[l$t[e]]=t[l$t[e]].replace('"',"")),o=t[l$t[e]],je(this.documentHelper.fontSubstitutionTable)||!this.documentHelper.fontSubstitutionTable.containsKey(o)||this.isFontInstalled(o)||(o=this.documentHelper.fontSubstitutionTable.get(o)),i.fontFamilyNonFarEast=o),je(t[p$t[e]])||(i.characterSpacing=t[p$t[e]]),je(t[c$t[e]])||(i.scaling=t[c$t[e]])))},Vui.prototype.isFontInstalled=function(e){var t,i,n;return this.fontInfoCollection&&this.fontInfoCollection.containsKey(e)?this.fontInfoCollection.get(e):(n=this.getWidth("monospace"),t=this.getWidth("sans-serif"),i=this.getWidth("serif"),n=n!==this.getWidth(e+", monospace",n)||t!==this.getWidth(e+", sans-serif",t)||i!==this.getWidth(e+", serif",i),this.fontInfoCollection&&this.fontInfoCollection.add(e,n),n)},Vui.prototype.getWidth=function(e,t){var i=document.createElement("span");return i.innerHTML=Array(100).join("wi"),i.style.cssText=["position:absolute","width:auto","font-size:128px","left:-99999px"].join(" !important;"),i.style.fontFamily=e,document.body.appendChild(i),e=i.clientWidth,""!==i.style.fontFamily||je(t)||(e=t),document.body.removeChild(i),e},Vui.prototype.getColor=function(e){return e||"#ffffff"},Vui.prototype.parseThemes=function(e,t){this.parseFontScheme(e[Soi[this.keywordIndex]],t)},Vui.prototype.parseFontScheme=function(e,t){je(e[Aoi[this.keywordIndex]])||(t.fontScheme.fontSchemeName=e[Aoi[this.keywordIndex]]),je(e[xoi[this.keywordIndex]])||this.parseMajorMinorFontScheme(e[xoi[this.keywordIndex]],t.fontScheme.majorFontScheme),je(e[Ioi[this.keywordIndex]])||this.parseMajorMinorFontScheme(e[Ioi[this.keywordIndex]],t.fontScheme.minorFontScheme)},Vui.prototype.parseMajorMinorFontScheme=function(e,t){if(!je(e[Eoi[this.keywordIndex]])&&0<Object.keys(e[Eoi[this.keywordIndex]]).length){for(var i=0,n=Object.keys(e[Eoi[this.keywordIndex]]);i<n.length;i++){var o=n[i];t.fontTypeface.add(o,e[Eoi[this.keywordIndex]][o])}this.documentHelper.hasThemes=!0}if(!je(e[Toi[this.keywordIndex]])&&0<e[Toi[this.keywordIndex]].length){for(var r=0;r<e[Toi[this.keywordIndex]].length;r++){var s=e[Toi[this.keywordIndex]][r],a=new Usi;a.name=je(s.fontName)?s[BZt[this.keywordIndex]]:s[qoi[this.keywordIndex]],a.typeface=je(s.fontTypeface)?s[Doi[this.keywordIndex]]:s.fontTypeface,a.panose=je(s.pnose)?s[Moi[this.keywordIndex]]:s.pnose,t.fontSchemeList.push(a)}this.documentHelper.hasThemes=!0}},Vui.prototype.parseParagraphFormat=function(e,t,i){je(t)||(je(t[k$t[e]])||this.parseBorders(e,t[k$t[e]],i.borders),je(t[JZt[e]])||(i.bidi=Y.parseBoolValue(t[JZt[e]])),je(t[g$t[e]])||(i.leftIndent=t[g$t[e]]),je(t[m$t[e]])||(i.rightIndent=t[m$t[e]]),je(t[f$t[e]])||(i.firstLineIndent=t[f$t[e]]),je(t[v$t[e]])||(i.afterSpacing=t[v$t[e]]),je(t[b$t[e]])||(i.beforeSpacing=t[b$t[e]]),je(t[C$t[e]])||(i.spaceBeforeAuto=Y.parseBoolValue(t[C$t[e]])),je(t[w$t[e]])||(i.spaceAfterAuto=Y.parseBoolValue(t[w$t[e]])),je(t[S$t[e]])||(i.lineSpacing=t[S$t[e]]),je(t[A$t[e]])?je(t[S$t[e]])||(i.lineSpacingType="Multiple"):i.lineSpacingType=this.getLineSpacingType(t[A$t[e]]),je(t[y$t[e]])||(i.textAlignment=this.getTextAlignment(t[y$t[e]])),je(t[D$t[e]])||(i.outlineLevel=this.getOutlineLevel(t[D$t[e]])),je(t[M$t[e]])||(i.contextualSpacing=Y.parseBoolValue(t[M$t[e]])),je(t[I$t[e]])||(i.keepWithNext=Y.parseBoolValue(t[I$t[e]])),je(t[E$t[e]])||(i.keepLinesTogether=Y.parseBoolValue(t[E$t[e]])),je(t[T$t[e]])||(i.widowControl=Y.parseBoolValue(t[T$t[e]])),i.listFormat=new mri(i),t.hasOwnProperty(x$t[e])&&this.parseListFormat(e,t,i.listFormat),t.hasOwnProperty(P$t[e])&&this.parseTabStop(e,t[P$t[e]],i.tabs))},Vui.prototype.parseListFormat=function(e,t,i){je(t[x$t[e]])||(je(t[x$t[e]][d$t[e]])||(i.listId=t[x$t[e]][d$t[e]],i.list=this.documentHelper.getListById(t[x$t[e]][d$t[e]])),je(t[x$t[e]].nsid)?je(i.list)||(i.nsid=i.list.nsid):i.nsid=t[x$t[e]].nsid,je(t[x$t[e]][u$t[e]]))||(i.listLevelNumber=t[x$t[e]][u$t[e]])},Vui.prototype.parseSectionFormat=function(e,t,i){if(je(t[O$t[e]])||(i.pageWidth=t[O$t[e]]),je(t[N$t[e]])||(i.pageHeight=t[N$t[e]]),je(t[V$t[e]])||(i.leftMargin=t[V$t[e]]),je(t[H$t[e]])||(i.topMargin=t[H$t[e]]),je(t[_$t[e]])||(i.rightMargin=t[_$t[e]]),je(t[z$t[e]])||(i.bottomMargin=t[z$t[e]]),je(t[B$t[e]])||(i.headerDistance=t[B$t[e]]),je(t[F$t[e]])||(i.footerDistance=t[F$t[e]]),je(t[L$t[e]])||(i.differentFirstPage=Y.parseBoolValue(t[L$t[e]])),je(t[R$t[e]])||(i.differentOddAndEvenPages=Y.parseBoolValue(t[R$t[e]])),je(t[JZt[e]])||(i.bidi=Y.parseBoolValue(t[JZt[e]])),je(t[j$t[e]])||(i.restartPageNumbering=Y.parseBoolValue(t[j$t[e]])),je(t[W$t[e]])||(i.pageStartingNumber=t[W$t[e]]),je(t[Q$t[e]])||(i.endnoteNumberFormat=this.getFootEndNoteNumberFormat(t[Q$t[e]])),je(t[U$t[e]])||(i.footNoteNumberFormat=this.getFootEndNoteNumberFormat(t[U$t[e]])),je(t[q$t[e]])||(i.restartIndexForFootnotes=this.getFootnoteRestartIndex(t[q$t[e]])),je(t[G$t[e]])||(i.restartIndexForEndnotes=this.getFootnoteRestartIndex(t[G$t[e]])),je(t[Y$t[e]])||(i.initialFootNoteNumber=t[Y$t[e]]),je(t[X$t[e]])||(i.initialEndNoteNumber=t[X$t[e]]),je(t[K$t[e]])||(i.pageNumberStyle=t[K$t[e]]),!je(t[J$t[e]])&&!je(t[Z$t[e]])&&1<t[Z$t[e]]&&(i.numberOfColumns=t[Z$t[e]],i.equalWidth=Y.parseBoolValue(t[$$t[e]]),i.lineBetweenColumns=Y.parseBoolValue(t[eei[e]]),t[J$t[e]]))for(var n=0;n<t[J$t[e]].length;n++){var o=new hri;o.width=Y.convertPointToPixel(t[J$t[e]][n][Vti[e]]),o.space=Y.convertPointToPixel(t[J$t[e]][n][Coi[e]]),o.index=n,i.columns.push(o)}je(t[tei[e]])||(i.breakCode=t[tei[e]])},Vui.prototype.parseColumns=function(e,t){if(t=[],e)for(var i=0;i<e.length;i++){var n=new hri;n.width=Y.convertPointToPixel(e[i][Vti[this.keywordIndex]]),n.space=Y.convertPointToPixel(e[i][Coi[this.keywordIndex]]),n.index=i,t.push(n)}},Vui.prototype.parseTabStop=function(e,t,i){if(t)for(var n=0;n<t.length;n++){var o=!1,r=t[n];if(0<Object.keys(r).length){var s=new yri;s.position=r[coi[e]],s.tabLeader=this.getTabLeader(r[goi[e]]),s.deletePosition=r[uoi[e]],s.tabJustification=this.getTabJustification(r[poi[e]]);for(var a=0;a<i.length;a++){var l=i[a];if(l.position===s.position&&l.tabLeader===s.tabLeader&&l.deletePosition===s.deletePosition&&l.tabJustification===s.tabJustification){o=!0;break}}o||i.push(s)}}},Vui.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},Vui.prototype.containsFieldBegin=function(e){for(var t=void 0,i=e.children.length-1;0<=i;i--){if((t=e.children[i])instanceof Zai&&t.hasFieldEnd&&t.nextElement instanceof pli)return t.nextElement;if(t instanceof Zai)return}return t},Vui.prototype.getBaseAlignment=function(e){switch(e){case 0:return"Normal";case 1:return"Superscript";case 2:return"Subscript";default:return e}},Vui.prototype.getUnderline=function(e){switch(e){case 0:return"None";case 1:return"Single";case 2:return"Words";case 3:return"Double";case 4:return"Dotted";case 5:return"Thick";case 6:return"Dash";case 7:return"DashLong";case 8:return"DotDash";case 9:return"DotDotDash";case 10:return"Wavy";case 11:return"DottedHeavy";case 12:return"DashHeavy";case 13:return"DashLongHeavy";case 14:return"DotDashHeavy";case 15:return"DotDotDashHeavy";case 16:return"WavyHeavy";case 17:return"WavyDouble";default:return e}},Vui.prototype.getFontHintType=function(e){switch(e){case 0:return"Default";case 1:return"EastAsia";case 2:return"CS";default:return e}},Vui.prototype.getStrikethrough=function(e){switch(e){case 0:return"None";case 1:return"SingleStrike";case 2:return"DoubleStrike";default:return e}},Vui.prototype.getHighlightColor=function(e){switch(e){case 0:return"NoColor";case 1:return"Yellow";case 2:return"BrightGreen";case 3:return"Turquoise";case 4:return"Pink";case 5:return"Blue";case 6:return"Red";case 7:return"DarkBlue";case 8:return"Teal";case 9:return"Green";case 10:return"Violet";case 11:return"DarkRed";case 12:return"DarkYellow";case 13:return"Gray50";case 14:return"Gray25";case 15:return"Black";default:return e}},Vui.prototype.getLineSpacingType=function(e){switch(e){case 0:return"Multiple";case 1:return"AtLeast";case 2:return"Exactly";default:return e}},Vui.prototype.getOutlineLevel=function(e){switch(e){case 0:return"BodyText";case 1:return"Level1";case 2:return"Level2";case 3:return"Level3";case 4:return"Level4";case 5:return"Level5";case 6:return"Level6";case 7:return"Level7";case 8:return"Level8";case 9:return"Level9";default:return e}},Vui.prototype.getTextAlignment=function(e){switch(e){case 0:return"Left";case 1:return"Center";case 2:return"Right";case 3:return"Justify";default:return e}},Vui.prototype.getWidthType=function(e){switch(e){case 0:return"Auto";case 1:return"Percent";case 2:return"Point";default:return e}},Vui.prototype.getTableAlignment=function(e){switch(e){case 0:return"Left";case 1:return"Center";case 2:return"Right";default:return e}},Vui.prototype.getLineStyle=function(e){switch(e){case 0:return"Single";case 1:return"None";case 2:return"Dot";case 3:return"DashSmallGap";case 4:return"DashLargeGap";case 5:return"DashDot";case 6:return"DashDotDot";case 7:return"Double";case 8:return"Triple";case 9:return"ThinThickSmallGap";case 10:return"ThickThinSmallGap";case 11:return"ThinThickThinSmallGap";case 12:return"ThinThickMediumGap";case 13:return"ThickThinMediumGap";case 14:return"ThinThickThinMediumGap";case 15:return"ThinThickLargeGap";case 16:return"ThickThinLargeGap";case 17:return"ThinThickThinLargeGap";case 18:return"SingleWavy";case 19:return"DoubleWavy";case 20:return"DashDotStroked";case 21:return"Emboss3D";case 22:return"Engrave3D";case 23:return"Outset";case 24:return"Inset";case 25:return"Thick";case 26:return"Cleared";default:return e}},Vui.prototype.getTextureStyle=function(e){switch(e){case 0:return"TextureNone";case 1:return"Texture2Pt5Percent";case 2:return"Texture5Percent";case 3:return"Texture7Pt5Percent";case 4:return"Texture10Percent";case 5:return"Texture12Pt5Percent";case 6:return"Texture15Percent";case 7:return"Texture17Pt5Percent";case 8:return"Texture20Percent";case 9:return"Texture22Pt5Percent";case 10:return"Texture25Percent";case 11:return"Texture27Pt5Percent";case 12:return"Texture30Percent";case 13:return"Texture32Pt5Percent";case 14:return"Texture35Percent";case 15:return"Texture37Pt5Percent";case 16:return"Texture40Percent";case 17:return"Texture42Pt5Percent";case 18:return"Texture45Percent";case 19:return"Texture47Pt5Percent";case 20:return"Texture50Percent";case 21:return"Texture52Pt5Percent";case 22:return"Texture55Percent";case 23:return"Texture57Pt5Percent";case 24:return"Texture60Percent";case 25:return"Texture62Pt5Percent";case 26:return"Texture65Percent";case 27:return"Texture67Pt5Percent";case 28:return"Texture70Percent";case 29:return"Texture72Pt5Percent";case 30:return"Texture75Percent";case 31:return"Texture77Pt5Percent";case 32:return"Texture80Percent";case 33:return"Texture82Pt5Percent";case 34:return"Texture85Percent";case 35:return"Texture87Pt5Percent";case 36:return"Texture90Percent";case 37:return"Texture92Pt5Percent";case 38:return"Texture95Percent";case 39:return"Texture97Pt5Percent";case 40:return"TextureSolid";case 41:return"TextureDarkHorizontal";case 42:return"TextureDarkVertical";case 43:return"TextureDarkDiagonalDown";case 44:return"TextureDarkDiagonalUp";case 45:return"TextureDarkCross";case 46:return"TextureDarkDiagonalCross";case 47:return"TextureHorizontal";case 48:return"TextureVertical";case 49:return"TextureDiagonalDown";case 50:return"TextureDiagonalUp";case 51:return"TextureCross";case 52:return"TextureDiagonalCross";default:return e}},Vui.prototype.getHeightType=function(e){switch(e){case 0:return"AtLeast";case 1:return"Exactly";default:return e}},Vui.prototype.getCellVerticalAlignment=function(e){switch(e){case 0:return"Top";case 1:return"Center";case 2:return"Bottom";default:return e}},Vui.prototype.getListLevelPattern=function(e){switch(e){case 0:return"None";case 1:case 13:case"KanjiDigit":return"Arabic";case 2:return"UpRoman";case 3:return"LowRoman";case 4:return"UpLetter";case 5:return"LowLetter";case 6:return"Ordinal";case 7:return"Number";case 8:return"OrdinalText";case 9:return"LeadingZero";case 10:return"Bullet";case 11:return"FarEast";case 12:return"Special";default:return e}},Vui.prototype.getFollowCharacterType=function(e){switch(e){case 0:return"Tab";case 1:return"Space";case 2:return"None";default:return e}},Vui.prototype.getStyleType=function(e){switch(e){case 0:return"Paragraph";case 1:return"Character";case 2:return"Table";default:return e}},Vui.prototype.getProtectionType=function(e){switch(e){case 0:return"NoProtection";case 1:return"ReadOnly";case 2:return"FormFieldsOnly";case 3:return"CommentsOnly";case 4:return"RevisionsOnly";default:return e}},Vui.prototype.getRevisionType=function(e){switch(e){case 1:return"Insertion";case 2:return"Deletion";case 3:return"MoveTo";case 4:return"MoveFrom";default:return e}},Vui.prototype.getFootnoteType=function(e){switch(e){case 0:return"Footnote";case 1:return"Endnote";default:return e}},Vui.prototype.getFootnoteRestartIndex=function(e){switch(e){case 0:return"DoNotRestart";case 1:return"RestartForEachSection";case 2:return"RestartForEachPage";default:return e}},Vui.prototype.getFootEndNoteNumberFormat=function(e){switch(e){case 0:return"Arabic";case 1:return"UpperCaseRoman";case 2:return"LowerCaseRoman";case 3:return"UpperCaseLetter";case 4:return"LowerCaseLetter";default:return e}},Vui.prototype.getBiDirectionalOverride=function(e){switch(e){case 0:return"None";case 1:return"LTR";case 2:return"RTL";default:return e}},Vui.prototype.getBreakClearType=function(e){switch(e){case 0:return"None";case 1:return"Left";case 2:return"Right";case 3:return"All";default:return e}},Vui.prototype.getTextVerticalAlignment=function(e){switch(e){case 0:return"Top";case 1:return"Center";case 2:return"Bottom";default:return e}},Vui.prototype.getShapeVerticalAlignment=function(e){switch(e){case 0:return"None";case 1:return"Top";case 2:return"Center";case 3:return"Bottom";case 4:return"Inline";case 5:return"Inside";case 6:return"Outside";default:return e}},Vui.prototype.getShapeHorizontalAlignment=function(e){switch(e){case 0:return"None";case 1:return"Center";case 2:return"Inside";case 3:return"Left";case 4:return"Outside";case 5:return"Right";default:return e}},Vui.prototype.getVerticalOrigin=function(e){switch(e){case 0:return"Paragraph";case 1:return"BottomMargin";case 2:return"InsideMargin";case 3:return"Line";case 4:return"Margin";case 5:return"OutsideMargin";case 6:return"Page";case 7:return"TopMargin";default:return e}},Vui.prototype.getHorizontalOrigin=function(e){switch(e){case 0:return"Column";case 1:return"Character";case 2:return"InsideMargin";case 3:return"LeftMargin";case 4:return"Margin";case 5:return"OutsideMargin";case 6:return"Page";case 7:return"RightMargin";default:return e}},Vui.prototype.getTableVerticalRelation=function(e){switch(e){case 0:return"Paragraph";case 1:return"Margin";case 2:return"Page";default:return e}},Vui.prototype.getTableHorizontalRelation=function(e){switch(e){case 0:return"Column";case 1:return"Margin";case 2:return"Page";default:return e}},Vui.prototype.getTableVerticalPosition=function(e){switch(e){case 0:return"None";case 1:return"Top";case 2:return"Center";case 3:return"Bottom";case 4:return"Inside";case 5:return"Outside";default:return e}},Vui.prototype.getTableHorizontalPosition=function(e){switch(e){case 0:return"Left";case 1:return"Center";case 2:return"Inside";case 3:return"Outside";case 4:return"Right";default:return e}},Vui.prototype.getLineDashStyle=function(e){switch(e){case 0:return"Solid";case 1:return"Dash";case 2:return"DashDot";case 3:return"DashDotDot";case 4:return"DashDotGEL";case 5:return"DashGEL";case 6:return"Dot";case 7:return"DotGEL";case 8:return"LongDashDotDotGEL";case 9:return"LongDashDotGEL";case 10:return"LongDashGEL";default:return e}},Vui.prototype.getHorizontalPositionAbs=function(e){switch(e){case 0:return"Left";case 1:return"Center";case 2:return"Right";case 3:return"Inside";case 4:return"Outside";default:return e}},Vui.prototype.getTabJustification=function(e){switch(e){case 0:return"Left";case 1:return"Bar";case 2:return"Center";case 3:return"Decimal";case 4:return"List";case 5:return"Right";default:return e}},Vui.prototype.getTabLeader=function(e){switch(e){case 0:return"None";case 1:return"Single";case 2:return"Dot";case 3:return"Hyphen";case 4:return"Underscore";default:return e}},Vui.prototype.getTextFormFieldType=function(e){switch(e){case 0:return"Text";case 1:return"Number";case 2:return"Date";case 3:return"Calculation";default:return e}},Vui.prototype.getTextFormFieldFormat=function(e){switch(e){case 0:return"None";case 1:return"FirstCapital";case 2:return"Lowercase";case 3:return"Uppercase";case 4:return"Titlecase";default:return e}},Vui.prototype.getCheckBoxSizeType=function(e){switch(e){case 0:return"Auto";case 1:return"Exactly";default:return e}},Vui.prototype.getContentControlAppearance=function(e){switch(e){case 1:return"BoundingBox";case 2:return"Hidden";case 3:return"Tags";default:return e}},Vui.prototype.getContentControlType=function(e){switch(e){case 0:return"RichText";case 1:return"BuildingBlockGallery";case 2:return"CheckBox";case 3:return"ComboBox";case 4:return"Date";case 5:return"DropDownList";case 6:return"Group";case 7:return"Picture";case 8:return"RepeatingSection";case 9:return"Text";default:return e}},Vui.prototype.getDateCalendarType=function(e){switch(e){case 0:return"Gregorian";case 1:return"GregorianArabic";case 2:return"GregorianEnglish";case 3:return"GregorianMiddleEastFrench";case 4:return"GregorianTransliteratedEnglish";case 5:return"GregorianTransliteratedFrench";case 6:return"Hebrew";case 7:return"Hijri";case 8:return"Japan";case 9:return"Korean";case 10:return"Saka";case 11:return"Taiwan";case 12:return"Thai";default:return e}},Vui.prototype.getDateStorageFormat=function(e){switch(e){case 1:return"DateStorageDate";case 2:return"DateStorageDateTime";case 3:return"DateStorageText";default:return e}},Vui.prototype.getTextWrappingStyle=function(e){switch(e){case 0:return"Inline";case 1:return"InFrontOfText";case 2:return"Square";case 3:return"TopAndBottom";case 4:return"Behind";default:return e}},Vui.prototype.getTextWrappingType=function(e){switch(e){case 0:return"Both";case 1:return"Left";case 2:return"Right";case 3:return"Largest";default:return e}},Vui.prototype.getCompatibilityMode=function(e){switch(e){case 0:return"Word2013";case 1:return"Word2003";case 2:return"Word2007";case 3:return"Word2010";default:return e}},Vui.prototype.getLineFormatType=function(e){switch(e){case 0:return"Solid";case 1:return"Patterned";case 2:return"Gradient";case 3:return"None";default:return e}},Vui.prototype.getAutoShapeType=function(e){switch(e){case 1:return"Rectangle";case 2:return"RoundedRectangle";case 3:return"StraightConnector";case 4:return"Oval";case 5:return"IsoscelesTriangle";case 6:return"RightTriangle";case 7:return"Parallelogram";case 8:return"Trapezoid";case 9:return"Diamond";case 10:return"RegularPentagon";case 11:return"Hexagon";case 12:return"Heptagon";case 13:return"Octagon";case 14:return"Decagon";case 15:return"Dodecagon";case 16:return"Chord";case 17:return"Teardrop";case 18:return"Frame";case 19:return"HalfFrame";case 20:return"L_Shape";case 21:return"Pie";case 22:return"DiagonalStripe";case 23:return"Cross";case 24:return"Plaque";case 25:return"Can";case 26:return"Cube";case 27:return"Bevel";case 28:return"Donut";case 29:return"NoSymbol";case 30:return"BlockArc";case 31:return"FoldedCorner";case 32:return"SmileyFace";case 33:return"Heart";case 34:return"LightningBolt";case 35:return"Sun";case 36:return"Moon";case 37:return"Cloud";case 38:return"Arc";case 39:return"DoubleBracket";case 40:return"DoubleBrace";case 41:return"LeftBracket";case 42:return"RightBracket";case 43:return"LeftBrace";case 44:return"RightBrace";case 45:return"FlowChartProcess";case 46:return"FlowChartAlternateProcess";case 47:return"FlowChartDecision";case 48:return"FlowChartData";case 49:return"FlowChartPredefinedProcess";case 50:return"FlowChartInternalStorage";case 51:return"FlowChartDocument";case 52:return"FlowChartMultiDocument";case 53:return"FlowChartTerminator";case 54:return"FlowChartPreparation";case 55:return"FlowChartManualInput";case 56:return"FlowChartManualOperation";case 57:return"FlowChartConnector";case 58:return"FlowChartOffPageConnector";case 59:return"FlowChartCard";case 60:return"FlowChartPunchedTape";case 61:return"FlowChartSummingJunction";case 62:return"FlowChartOr";case 63:return"FlowChartCollate";case 64:return"FlowChartSort";case 65:return"FlowChartExtract";case 66:return"FlowChartMerge";case 67:return"FlowChartStoredData";case 68:return"FlowChartDelay";case 69:return"FlowChartSequentialAccessStorage";case 70:return"FlowChartMagneticDisk";case 71:return"FlowChartDirectAccessStorage";case 72:return"FlowChartDisplay";case 73:return"RightArrow";case 74:return"LeftArrow";case 75:return"UpArrow";case 76:return"DownArrow";case 77:return"LeftRightArrow";case 78:return"UpDownArrow";case 79:return"QuadArrow";case 80:return"LeftRightUpArrow";case 81:return"BentArrow";case 82:return"UTurnArrow";case 83:return"LeftUpArrow";case 84:return"BentUpArrow";case 85:return"CurvedRightArrow";case 86:return"CurvedLeftArrow";case 87:return"CurvedUpArrow";case 88:return"CurvedDownArrow";case 89:return"StripedRightArrow";case 90:return"NotchedRightArrow";case 91:return"Pentagon";case 92:return"Chevron";case 93:return"RightArrowCallout";case 94:return"DownArrowCallout";case 95:return"LeftArrowCallout";case 96:return"UpArrowCallout";case 97:return"LeftRightArrowCallout";case 98:return"QuadArrowCallout";case 99:return"CircularArrow";case 100:return"MathPlus";case 101:return"MathMinus";case 102:return"MathMultiply";case 103:return"MathDivision";case 104:return"MathEqual";case 105:return"MathNotEqual";case 106:return"Explosion1";case 107:return"Explosion2";case 108:return"Star4Point";case 109:return"Star5Point";case 110:return"Star6Point";case 111:return"Star7Point";case 112:return"Star8Point";case 113:return"Star10Point";case 114:return"Star12Point";case 115:return"Star16Point";case 116:return"Star24Point";case 117:return"Star32Point";case 118:return"UpRibbon";case 119:return"DownRibbon";case 120:return"CurvedUpRibbon";case 121:return"CurvedDownRibbon";case 122:return"VerticalScroll";case 123:return"HorizontalScroll";case 124:return"Wave";case 125:return"DoubleWave";case 126:return"SnipSingleCornerRectangle";case 127:return"SnipSameSideCornerRectangle";case 128:return"SnipDiagonalCornerRectangle";case 129:return"SnipAndRoundSingleCornerRectangle";case 130:return"RoundSingleCornerRectangle";case 131:return"RoundSameSideCornerRectangle";case 132:return"RoundDiagonalCornerRectangle";case 133:return"Unknown";case 134:return"ElbowConnector";case 135:return"CurvedConnector";default:return e}},Vui.prototype.destroy=function(){this.footnotes&&this.footnotes.destroy(),this.footnotes=void 0,this.endnotes&&this.endnotes.destroy(),this.endnotes=void 0,this.editableRanges&&this.editableRanges.destroy(),this.editableRanges=void 0,this.commentEnds&&this.commentEnds.destroy(),this.commentEnds=void 0,this.commentStarts&&this.commentStarts.destroy(),this.commentStarts=void 0,this.commentsCollection&&this.commentsCollection.destroy(),this.commentsCollection=void 0,this.revisionCollection&&this.revisionCollection.destroy(),this.revisionCollection=void 0,this.fontInfoCollection&&this.fontInfoCollection.destroy(),this.fontInfoCollection=void 0,this.documentHelper=void 0,this.keywordIndex=void 0};var Nui=Vui;function Vui(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.referedRevisions=[],this.isParseHeader=!1,this.footnotes=void 0,this.endnotes=void 0,this.keywordIndex=void 0,this.themes=void 0,this.isCutPerformed=!1,this.isPaste=!1,this.isContextBasedPaste=!1,this.isHtmlPaste=!1,this.documentHelper=e,this.editableRanges=new uJt}Hui.prototype.getModuleName=function(){return"WordExport"},Object.defineProperty(Hui.prototype,"bookmarks",{get:function(){return je(this.mBookmarks)&&(this.mBookmarks=[]),this.mBookmarks},enumerable:!0,configurable:!0}),Object.defineProperty(Hui.prototype,"documentImages",{get:function(){return void 0===this.mDocumentImages&&(this.mDocumentImages=new uJt),this.mDocumentImages},enumerable:!0,configurable:!0}),Object.defineProperty(Hui.prototype,"svgImages",{get:function(){return void 0===this.mSvgImages&&(this.mSvgImages=new uJt),this.mSvgImages},enumerable:!0,configurable:!0}),Object.defineProperty(Hui.prototype,"externalImages",{get:function(){return void 0===this.mExternalLinkImages&&(this.mExternalLinkImages=new uJt),this.mExternalLinkImages},enumerable:!0,configurable:!0}),Object.defineProperty(Hui.prototype,"headerFooterImages",{get:function(){return void 0===this.mHeaderFooterImages&&(this.mHeaderFooterImages=new uJt),this.mHeaderFooterImages},enumerable:!0,configurable:!0}),Object.defineProperty(Hui.prototype,"headerFooterSvgImages",{get:function(){return void 0===this.mHeaderFooterSvgImages&&(this.mHeaderFooterSvgImages=new uJt),this.mHeaderFooterSvgImages},enumerable:!0,configurable:!0}),Object.defineProperty(Hui.prototype,"documentCharts",{get:function(){return void 0===this.mDocumentCharts&&(this.mDocumentCharts=new uJt),this.mDocumentCharts},enumerable:!0,configurable:!0}),Object.defineProperty(Hui.prototype,"headersFooters",{get:function(){return void 0===this.mHeaderFooterColl&&(this.mHeaderFooterColl=new uJt),this.mHeaderFooterColl},enumerable:!0,configurable:!0}),Object.defineProperty(Hui.prototype,"endnotesFootnotes",{get:function(){return void 0===this.mFootEndnotesColl&&(this.mFootEndnotesColl=new uJt),this.mFootEndnotesColl},enumerable:!0,configurable:!0}),Hui.prototype.save=function(e,t,i){var n=this,e=(this.fileName=t,this.serialize(e,i),this.serializeExcelFiles());e&&0<e.length?Promise.all(e).then(function(){n.saveInternal(t,i)}):this.saveInternal(t,i),this.close()},Hui.prototype.saveInternal=function(e,t){"Docx"===t?this.mArchive.save(e+".docx").then(function(e){e.destroy()}):"Dotx"===t&&this.mArchive.save(e+".dotx").then(function(e){e.destroy()})},Hui.prototype.saveAsBlob=function(e,t){var i=this,n=(this.serialize(e,t),this.serializeExcelFiles());return new Promise(function(t,e){0<n.length?Promise.all(n).then(function(){i.mArchive.saveAsBlob().then(function(e){i.mArchive.destroy(),e=new Blob([e],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}),t(e)})}):i.mArchive.saveAsBlob().then(function(e){i.mArchive.destroy(),e=new Blob([e],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}),t(e)})})},Hui.prototype.serializeExcelFiles=function(){var i=this,n=this.excelFiles,o=[];if(n&&0<n.length){for(var e=0;e<n.length;e++)!function(e){var t=n.keys[parseInt(e.toString(),10)],e=n.get(t).saveAsBlob();o.push(e),e.then(function(e){e=new ih(e,t);i.mArchive.addItem(e)})}(e);this.excelFiles.clear()}return o},Hui.prototype.saveExcel=function(){var e=this.defaultEmbeddingPath+"Microsoft_Excel_Worksheet"+this.chartCount+".xlsx";this.excelFiles.add(e,this.mArchiveExcel),this.mArchiveExcel=void 0},Hui.prototype.destroy=function(){this.clearDocument(),this.mRelationShipID=void 0,this.mDocPrID=void 0,this.mDifferentFirstPage=void 0,this.fileName=void 0,this.imageRelationIds=void 0,this.svgImageRelationIds=void 0,this.mArchive&&(this.mArchive.destroy(),this.mArchive=void 0),this.mArchiveExcel&&(this.mArchiveExcel.destroy(),this.mArchiveExcel=void 0)},Hui.prototype.serialize=function(e,t){this.keywordIndex=e.owner.documentEditorSettings.optimizeSfdt?1:0;var i=e.owner.sfdtExportModule.write(this.keywordIndex);this.setDocument(i),this.mComments=e.comments,this.mCustomXML=e.customXmlData,this.mImages=e.images,this.revisions=e.owner.revisions.changes,this.mArchive=new Zl,this.mArchive.compressionLevel="Normal",this.commentParaIDInfo={},this.commentParaID=0,this.currentCommentId=0,this.commentId={},this.mVerticalMerge=new uJt,this.mGridSpans=new uJt,this.imageRelationIds=new uJt,this.svgImageRelationIds=new uJt,this.serializeDocument(),this.serializeStyles(),this.serializeNumberings(),this.serializeComments(),this.serializeCommentsExtended(),this.serializeThemes(),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,t),this.clearDocument()},Hui.prototype.setDocument=function(e,t){je(this.keywordIndex)&&(this.keywordIndex=t),this.document=e,this.mSections=e[rZt[this.keywordIndex]],this.mLists=e[hZt[this.keywordIndex]],this.mAbstractLists=e[dZt[this.keywordIndex]],this.defCharacterFormat=e[aZt[this.keywordIndex]],this.defParagraphFormat=e[lZt[this.keywordIndex]],this.defaultTabWidthValue=e[fZt[this.keywordIndex]],this.themeFontLang=e[kZt[this.keywordIndex]],this.dontUseHtmlParagraphAutoSpacing=Y.parseBoolValue(e[AZt[this.keywordIndex]]),this.mStyles=e[cZt[this.keywordIndex]],this.mThemes=e[PZt[this.keywordIndex]],this.formatting=Y.parseBoolValue(e[yZt[this.keywordIndex]]),this.enforcement=Y.parseBoolValue(e[wZt[this.keywordIndex]]),this.hashValue=e[CZt[this.keywordIndex]],this.saltValue=e[SZt[this.keywordIndex]],this.protectionType=e[bZt[this.keywordIndex]],this.formFieldShading=Y.parseBoolValue(e[IZt[this.keywordIndex]]),this.trackChanges=Y.parseBoolValue(e[vZt[this.keywordIndex]]),this.compatibilityMode=e[MZt[this.keywordIndex]],this.allowSpaceOfSameStyleInTable=Y.parseBoolValue(e[Woi[this.keywordIndex]])},Hui.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.keywordIndex=void 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.mSvgImages&&(this.mSvgImages.destroy(),this.mSvgImages=void 0),this.mExternalLinkImages&&(this.mExternalLinkImages.destroy(),this.mExternalLinkImages=void 0),this.mHeaderFooterImages&&(this.mHeaderFooterImages.destroy(),this.mHeaderFooterImages=void 0),this.mHeaderFooterSvgImages&&(this.mHeaderFooterSvgImages.destroy(),this.mHeaderFooterSvgImages=void 0),this.mDocumentCharts&&(this.mDocumentCharts.destroy(),this.mDocumentCharts=void 0),this.mFootEndnotesColl&&(this.mFootEndnotesColl.destroy(),this.mFootEndnotesColl=void 0)},Hui.prototype.serializeDocument=function(){var e=new Ol,e=(e.writeStartElement("w","document",this.wNamespace),this.writeCommonAttributeStrings(e),e.writeStartElement("w","background",this.wNamespace),e.writeAttributeString("w","color",void 0,this.getColor(this.document[pZt[this.keywordIndex]][tii[this.keywordIndex]])),e.writeEndElement(),this.serializeDocumentBody(e),e.writeEndElement(),new ih(e.buffer,this.documentPath));this.mArchive.addItem(e)},Hui.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")},Hui.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)},Hui.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)},Hui.prototype.serializeDocumentBody=function(e){e.writeStartElement(void 0,"body",this.wNamespace);for(var t=this.document[rZt[this.keywordIndex]].length,i=0;i<t;i++)this.section=this.document[rZt[this.keywordIndex]][parseInt(i.toString(),10)],this.lastSection=i===t-1,this.containerWidth=this.section[Gni[this.keywordIndex]][O$t[this.keywordIndex]]-(this.section[Gni[this.keywordIndex]][V$t[this.keywordIndex]]+this.section[Gni[this.keywordIndex]][_$t[this.keywordIndex]]),this.serializeSection(e,this.section,i===t-1),this.section=void 0;e.writeEndElement()},Hui.prototype.serializeSection=function(e,t,i){je((this.blockOwner=t)[_ni[this.keywordIndex]])||this.serializeBodyItems(e,t[_ni[this.keywordIndex]],i),i&&this.serializeSectionProperties(e,t),this.blockOwner=void 0},Hui.prototype.serializeComments=function(){var e;0===this.mComments.length||1===this.mComments.length&&""===this.mComments[0].text||((e=new Ol).writeStartElement("w","comments",this.wNamespace),this.serializeCommentCommonAttribute(e),this.serializeCommentInternal(e,this.mComments),e.writeEndElement(),e=new ih(e.buffer,this.commentsPath),this.mArchive.addItem(e))},Hui.prototype.serializeThemes=function(){if(!je(this.mThemes)){var e=new Ol;e.writeStartElement("a","theme",this.aNamespace),e.writeAttributeString(void 0,"name",void 0,"Office Theme"),e.writeStartElement(void 0,"themeElements",this.aNamespace),e.writeRaw('<a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000" /></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF" /></a:lt1><a:dk2><a:srgbClr val="44546A" /></a:dk2><a:lt2><a:srgbClr val="E7E6E6" /></a:lt2><a:accent1><a:srgbClr val="4472C4" /></a:accent1><a:accent2><a:srgbClr val="ED7D31" /></a:accent2><a:accent3><a:srgbClr val="A5A5A5" /></a:accent3><a:accent4><a:srgbClr val="FFC000" /></a:accent4><a:accent5><a:srgbClr val="5B9BD5" /></a:accent5><a:accent6><a:srgbClr val="70AD47" /></a:accent6><a:hlink><a:srgbClr val="0563C1" /></a:hlink><a:folHlink><a:srgbClr val="954F72" /></a:folHlink></a:clrScheme>'),e.writeStartElement(void 0,"fontScheme",this.aNamespace),e.writeAttributeString(void 0,"name",void 0,this.mThemes[Aoi[this.keywordIndex]]),e.writeStartElement(void 0,"majorFont",this.aNamespace);for(var t=0;t<this.mThemes[Soi[this.keywordIndex]][xoi[this.keywordIndex]][Toi[this.keywordIndex]].length;t++){var i=this.mThemes[Soi[this.keywordIndex]][xoi[this.keywordIndex]][Toi[this.keywordIndex]][parseInt(t.toString(),10)];this.themeFont(e,i)}for(var n=0,o=Object.keys(this.mThemes[Soi[this.keywordIndex]][xoi[this.keywordIndex]][Eoi[this.keywordIndex]]);n<o.length;n++){var r=o[n];this.themeType(e,r,this.mThemes[Soi[this.keywordIndex]][xoi[this.keywordIndex]][Eoi[this.keywordIndex]][""+r])}e.writeEndElement(),e.writeStartElement(void 0,"minorFont",this.aNamespace);for(t=0;t<this.mThemes[Soi[this.keywordIndex]][Ioi[this.keywordIndex]][Toi[this.keywordIndex]].length;t++){i=this.mThemes[Soi[this.keywordIndex]][Ioi[this.keywordIndex]][Toi[this.keywordIndex]][parseInt(t.toString(),10)];this.themeFont(e,i)}for(var s=0,a=Object.keys(this.mThemes[Soi[this.keywordIndex]][Ioi[this.keywordIndex]][Eoi[this.keywordIndex]]);s<a.length;s++){r=a[s];this.themeType(e,r,this.mThemes[Soi[this.keywordIndex]][Ioi[this.keywordIndex]][Eoi[this.keywordIndex]][""+r])}e.writeEndElement(),e.writeEndElement(),e.writeStartElement(void 0,"fmtScheme",this.aNamespace),e.writeAttributeString(void 0,"name",void 0,"Office"),e.writeRaw('<a:fillStyleLst><a:solidFill><a:schemeClr val="phClr" /></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000" /><a:satMod val="105000" /><a:tint val="67000" /></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="105000" /><a:satMod val="103000" /><a:tint val="73000" /></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="105000" /><a:satMod val="109000" /><a:tint val="81000" /></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0" /></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:satMod val="103000" /><a:lumMod val="102000" /><a:tint val="94000" /></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:satMod val="110000" /><a:lumMod val="100000" /><a:shade val="100000" /></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="99000" /><a:satMod val="120000" /><a:shade val="78000" /></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0" /></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="6350" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr" /></a:solidFill><a:prstDash val="solid" /><a:miter lim="800000" /></a:ln><a:ln w="12700" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr" /></a:solidFill><a:prstDash val="solid" /><a:miter lim="800000" /></a:ln><a:ln w="19050" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr" /></a:solidFill><a:prstDash val="solid" /><a:miter lim="800000" /></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst /></a:effectStyle><a:effectStyle><a:effectLst /></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="57150" dist="19050" dir="5400000" algn="ctr" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="63000" /></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr" /></a:solidFill><a:solidFill><a:schemeClr val="phClr"><a:tint val="95000" /><a:satMod val="170000" /></a:schemeClr></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="93000" /><a:satMod val="150000" /><a:shade val="98000" /><a:lumMod val="102000" /></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:tint val="98000" /><a:satMod val="130000" /><a:shade val="90000" /><a:lumMod val="103000" /></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="63000" /><a:satMod val="120000" /></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0" /></a:gradFill></a:bgFillStyleLst>'),e.writeEndElement(),e.writeEndElement(),e.writeEndElement();var l=new ih(e.buffer,this.themePath);this.mArchive.addItem(l)}},Hui.prototype.themeFont=function(e,t){"latin"!==t[BZt[this.keywordIndex]]&&"ea"!==t[BZt[this.keywordIndex]]&&"cs"!==t[BZt[this.keywordIndex]]||(e.writeStartElement(void 0,t[BZt[this.keywordIndex]],this.aNamespace),e.writeAttributeString(void 0,"typeface",void 0,t[Doi[this.keywordIndex]]),e.writeAttributeString(void 0,"panose",void 0,t[Moi[this.keywordIndex]]),e.writeEndElement())},Hui.prototype.themeType=function(e,t,i){e.writeStartElement(void 0,"font",this.aNamespace),e.writeAttributeString(void 0,"script",void 0,t),e.writeAttributeString(void 0,"typeface",void 0,i),e.writeEndElement()},Hui.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")},Hui.prototype.serializeCommentInternal=function(e,t){for(var i=0;i<t.length;i++){for(var n=t[parseInt(i.toString(),10)],o=(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),Y.commentInlines(n.text,n.mentions,this.keywordIndex)),r=0;r<o.length;r++)this.isInsideComment=!0,this.commentParaID++,this.serializeBodyItem(e,o[parseInt(r.toString(),10)],!0),this.isInsideComment=!1;0===o.length&&(this.isInsideComment=!0,this.commentParaID++),this.commentParaIDInfo[n.commentId]=this.commentParaID,this.isInsideComment=!1,e.writeEndElement(),0<n.replyComments.length&&this.serializeCommentInternal(e,n.replyComments)}},Hui.prototype.serializeCommentsExtended=function(){var e;0===this.mComments.length||1===this.mComments.length&&""===this.mComments[0].text||((e=new Ol).writeStartElement("w15","commentsEx",this.wNamespace),this.serializeCommentCommonAttribute(e),this.serializeCommentsExInternal(e,this.mComments,!1),e.writeEndElement(),e=new ih(e.buffer,this.commentsExtendedPath),this.mArchive.addItem(e))},Hui.prototype.serializeCommentsExInternal=function(e,t,i){for(var n=0;n<t.length;n++){var o=t[parseInt(n.toString(),10)],r=(e.writeStartElement("w15","commentEx",this.wNamespace),this.commentParaIDInfo[o.commentId]),s=(i&&(s=this.commentParaIDInfo[o.ownerComment.commentId],e.writeAttributeString("w15","paraIdParent",this.wNamespace,s.toString())),e.writeAttributeString("w15","paraId",this.wNamespace,r.toString()),o.done?1:0);e.writeAttributeString("w15","done",this.wNamespace,s.toString()),e.writeEndElement(),0<o.replyComments.length&&this.serializeCommentsExInternal(e,o.replyComments,!0)}},Hui.prototype.serializeSectionProperties=function(e,t){var i;je(this.document.optimizeSfdt)||(this.keywordIndex=this.document.optimizeSfdt?1:0),e.writeStartElement("w","sectPr",this.wNamespace),t[qni[this.keywordIndex]]&&this.serializeHFReference(e,t[qni[this.keywordIndex]]),je(t[Gni[this.keywordIndex]][tei[this.keywordIndex]])||(i=this.getSectionBreakCode(t[Gni[this.keywordIndex]][tei[this.keywordIndex]]),this.serializeSectionType(e,i)),this.serializePageSetup(e,t[Gni[this.keywordIndex]]),this.serializeColumns(e,t[Gni[this.keywordIndex]]),this.serializeFootNotesPr(e,t[Gni[this.keywordIndex]]),this.serializeEndNotesPr(e,t[Gni[this.keywordIndex]]),void 0!==t[Gni[this.keywordIndex]]&&Y.parseBoolValue(t[Gni[this.keywordIndex]][L$t[this.keywordIndex]])&&(e.writeStartElement(void 0,"titlePg",this.wNamespace),e.writeEndElement()),!je(t[Gni[this.keywordIndex]])&&Y.parseBoolValue(t[Gni[this.keywordIndex]][JZt[this.keywordIndex]])&&(e.writeStartElement(void 0,"bidi",this.wNamespace),e.writeEndElement()),e.writeEndElement()},Hui.prototype.getSectionBreakCode=function(e){switch(e){case"NoBreak":return"continuous";case"NewColumn":return"nextColumn";case"EvenPage":return"evenPage";case"Oddpage":return"oddPage";default:return"nextPage"}},Hui.prototype.serializeFootNotesPr=function(e,t){(t[U$t[this.keywordIndex]]||t[q$t[this.keywordIndex]])&&(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[U$t[this.keywordIndex]]&&(e.writeStartElement(void 0,"numFmt",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,this.getFootNoteNumberFormat(t[U$t[this.keywordIndex]])),e.writeEndElement()),void 0!==t[q$t[this.keywordIndex]]&&(e.writeStartElement(void 0,"numRestart",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,this.getFootNoteNumberRestart(t[q$t[this.keywordIndex]])),e.writeEndElement()),void 0!==t[Y$t[this.keywordIndex]]&&(e.writeStartElement(void 0,"numStart",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,t[Y$t[this.keywordIndex]].toString()),e.writeEndElement()),e.writeEndElement())},Hui.prototype.getFootNoteNumberFormat=function(e){var t;switch(e){case"UpperCaseRoman":case 1:t="upperRoman";break;case"LowerCaseRoman":case 2:t="lowerRoman";break;case"UpperCaseLetter":case 3:t="upperLetter";break;case"LowerCaseLetter":case 4:t="lowerLetter";break;default:t="decimal"}return t},Hui.prototype.getFootNoteNumberRestart=function(e){switch(e){case"RestartForEachSection ":case 1:return"eachSect";case"RestartForEachPage":case 2:return"eachPage";default:return"continuous"}},Hui.prototype.getPageNumberFormat=function(e){var t;switch(e){case"RomanUpper":t="upperRoman";break;case"RomanLower":t="lowerRoman";break;case"LetterUpper":t="upperLetter";break;case"LetterLower":t="lowerLetter";break;default:t="Arabic"}return t},Hui.prototype.serializeEndNotesPr=function(e,t){je(t[Q$t[this.keywordIndex]])&&je(t[G$t[this.keywordIndex]])||(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[Q$t[this.keywordIndex]]&&(e.writeStartElement(void 0,"numFmt",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,this.getFootNoteNumberFormat(t[Q$t[this.keywordIndex]])),e.writeEndElement()),void 0!==t[G$t[this.keywordIndex]]&&(e.writeStartElement(void 0,"numRestart",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,this.getFootNoteNumberRestart(t[G$t[this.keywordIndex]])),e.writeEndElement()),void 0!==t[X$t[this.keywordIndex]]&&(e.writeStartElement(void 0,"numStart",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,t[X$t[this.keywordIndex]].toString()),e.writeEndElement()),e.writeEndElement())},Hui.prototype.serializeColumns=function(e,t){if(void 0!==t[Z$t[this.keywordIndex]]&&1<t[Z$t[this.keywordIndex]]){if(e.writeStartElement(void 0,"cols",this.wNamespace),e.writeAttributeString(void 0,"num",this.wNamespace,t[Z$t[this.keywordIndex]].toString()),Y.parseBoolValue(t[eei[this.keywordIndex]])&&e.writeAttributeString(void 0,"sep",this.wNamespace,"1"),Y.parseBoolValue(t[$$t[this.keywordIndex]]))e.writeAttributeString(void 0,"equalWidth",this.wNamespace,"1");else if(e.writeAttributeString(void 0,"equalWidth",this.wNamespace,"0"),void 0!==t[J$t[this.keywordIndex]]&&0<t[J$t[this.keywordIndex]].length)for(var i=0;i<t[J$t[this.keywordIndex]].length;i++)e.writeStartElement(void 0,"col",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,this.roundToTwoDecimal(t[J$t[this.keywordIndex]][parseInt(i.toString(),10)][Vti[this.keywordIndex]]*this.twentiethOfPoint).toString()),e.writeAttributeString(void 0,"space",this.wNamespace,this.roundToTwoDecimal(t[J$t[this.keywordIndex]][parseInt(i.toString(),10)][Coi[this.keywordIndex]]*this.twentiethOfPoint).toString()),e.writeEndElement();e.writeEndElement()}},Hui.prototype.serializePageSetup=function(e,t){void 0!==t&&(this.serializePageSize(e,t),this.serializePageMargins(e,t),this.serializePageNumberType(e,t)),Y.parseBoolValue(t[j$t[this.keywordIndex]])&&(e.writeStartElement(void 0,"pgNumType",this.wNamespace),e.writeAttributeString(void 0,"start",this.wNamespace,t[W$t[this.keywordIndex]].toString()),e.writeEndElement()),e.writeStartElement(void 0,"pgBorders",this.wNamespace),e.writeEndElement()},Hui.prototype.serializePageSize=function(e,t){e.writeStartElement(void 0,"pgSz",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,this.roundToTwoDecimal(t[O$t[this.keywordIndex]]*this.twentiethOfPoint).toString()),e.writeAttributeString(void 0,"h",this.wNamespace,this.roundToTwoDecimal(t[N$t[this.keywordIndex]]*this.twentiethOfPoint).toString()),e.writeEndElement()},Hui.prototype.serializePageMargins=function(e,t){e.writeStartElement(void 0,"pgMar",this.wNamespace);var i=Math.round(t[H$t[this.keywordIndex]]*this.twentiethOfPoint);e.writeAttributeString(void 0,"top",this.wNamespace,i.toString()),i=Math.round(t[_$t[this.keywordIndex]]*this.twentiethOfPoint),e.writeAttributeString(void 0,"right",this.wNamespace,i.toString()),i=Math.round(t[z$t[this.keywordIndex]]*this.twentiethOfPoint),e.writeAttributeString(void 0,"bottom",this.wNamespace,i.toString()),i=Math.round(t[V$t[this.keywordIndex]]*this.twentiethOfPoint),e.writeAttributeString(void 0,"left",this.wNamespace,i.toString()),e.writeAttributeString(void 0,"header",this.wNamespace,this.roundToTwoDecimal(t[B$t[this.keywordIndex]]*this.twentiethOfPoint).toString()),e.writeAttributeString(void 0,"footer",this.wNamespace,this.roundToTwoDecimal(t[F$t[this.keywordIndex]]*this.twentiethOfPoint).toString()),e.writeAttributeString(void 0,"gutter",this.wNamespace,"0"),e.writeEndElement()},Hui.prototype.serializePageNumberType=function(e,t){void 0!==t[K$t[this.keywordIndex]]&&(e.writeStartElement(void 0,"pgNumType",this.wNamespace),e.writeAttributeString(void 0,"fmt",this.wNamespace,this.getPageNumberFormat(t[K$t[this.keywordIndex]])),e.writeEndElement())},Hui.prototype.serializeSectionType=function(e,t){e.writeStartElement("w","type",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,t),e.writeEndElement()},Hui.prototype.serializeHFReference=function(e,t){var i,n="";void 0!==t&&(this.mDifferentFirstPage=Y.parseBoolValue(this.section[Gni[this.keywordIndex]][R$t[this.keywordIndex]]),(i=t[Qni[this.keywordIndex]])&&i[_ni[this.keywordIndex]]&&0<i[_ni[this.keywordIndex]].length&&(e.writeStartElement(void 0,"headerReference",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"first"),n=this.getNextRelationShipID(),e.writeAttributeString(void 0,"id",this.rNamespace,n),this.addHeaderFooter(i,"FirstPageHeader",n),e.writeEndElement()),(i=t[Uni[this.keywordIndex]])&&i[_ni[this.keywordIndex]]&&0<i[_ni[this.keywordIndex]].length&&(e.writeStartElement(void 0,"footerReference",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"first"),n=this.getNextRelationShipID(),e.writeAttributeString(void 0,"id",this.rNamespace,n),this.addHeaderFooter(i,"FirstPageFooter",n),e.writeEndElement()),(i=t[jni[this.keywordIndex]])&&i[_ni[this.keywordIndex]]&&0<i[_ni[this.keywordIndex]].length&&(e.writeStartElement(void 0,"headerReference",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"even"),n=this.getNextRelationShipID(),e.writeAttributeString(void 0,"id",this.rNamespace,n),this.addHeaderFooter(i,"EvenHeader",n),e.writeEndElement()),(i=t[Wni[this.keywordIndex]])&&i[_ni[this.keywordIndex]]&&0<i[_ni[this.keywordIndex]].length&&(e.writeStartElement(void 0,"footerReference",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"even"),n=this.getNextRelationShipID(),e.writeAttributeString(void 0,"id",this.rNamespace,n),this.addHeaderFooter(i,"EvenFooter",n),e.writeEndElement()),(i=t[Hni[this.keywordIndex]])&&i[_ni[this.keywordIndex]]&&0<i[_ni[this.keywordIndex]].length&&(e.writeStartElement(void 0,"headerReference",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"default"),n=this.getNextRelationShipID(),e.writeAttributeString(void 0,"id",this.rNamespace,n),this.addHeaderFooter(i,"OddHeader",n),e.writeEndElement()),i=t[zni[this.keywordIndex]])&&i[_ni[this.keywordIndex]]&&0<i[_ni[this.keywordIndex]].length&&(e.writeStartElement(void 0,"footerReference",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"default"),n=this.getNextRelationShipID(),e.writeAttributeString(void 0,"id",this.rNamespace,n),this.addHeaderFooter(i,"OddFooter",n),e.writeEndElement())},Hui.prototype.addHeaderFooter=function(e,t,i){var n=new uJt;this.headersFooters.add(t,n),this.headersFooters.get(t).add(i,e)},Hui.prototype.serializeBodyItems=function(e,t,i){for(var n=0;n<t.length;n++)this.serializeBodyItem(e,t[parseInt(n.toString(),10)],i)},Hui.prototype.serializeContentControl=function(e,t,i,n,o){if(je(t))throw new Error("contentCOntrol should not be undefined");e.writeStartElement("w","sdt",this.wNamespace),e.writeStartElement(void 0,"sdtPr",this.wNamespace),je(t)||this.serializeContentProperties(e,t,i,n,o)},Hui.prototype.serializeContentProperties=function(e,t,i,n,o){var r;if(je(t[Jii[this.keywordIndex]])||(e.writeStartElement(void 0,"alias",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,t[Jii[this.keywordIndex]]),e.writeEndElement(),e.writeStartElement(void 0,"tag",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,t[Kii[this.keywordIndex]]),e.writeEndElement()),je(t[aZt[this.keywordIndex]])||this.serializeCharacterFormat(e,i[Gii[this.keywordIndex]][aZt[this.keywordIndex]]),(Y.parseBoolValue(t[Xii[this.keywordIndex]])||Y.parseBoolValue(t[Yii[this.keywordIndex]]))&&(e.writeStartElement(void 0,"lock",this.wNamespace),Y.parseBoolValue(t[Yii[this.keywordIndex]])&&Y.parseBoolValue(t[Xii[this.keywordIndex]])?e.writeAttributeString("w","val",this.wNamespace,"sdtContentLocked"):Y.parseBoolValue(t[Yii[this.keywordIndex]])?e.writeAttributeString("w","val",this.wNamespace,"sdtLocked"):Y.parseBoolValue(t[Xii[this.keywordIndex]])&&e.writeAttributeString("w","val",this.wNamespace,"contentLocked"),e.writeEndElement()),Y.parseBoolValue(t[Zii[this.keywordIndex]])&&(e.writeStartElement("w","placeholder",void 0),e.writeAttributeString("w","docPart",this.wNamespace,void 0),e.writeEndElement(),e.writeStartElement("w","showingPlcHdr",void 0),e.writeEndElement()),Y.parseBoolValue(t[eni[this.keywordIndex]])&&(e.writeStartElement("w","temporary",void 0),e.writeEndElement()),je(t[zoi[this.keywordIndex]])||(e.writeStartElement("w15","appearance",void 0),e.writeAttributeString("w15","val",void 0,(1===this.keywordIndex?this.getContentControlAppearance(t[zoi[this.keywordIndex]]):t[zoi[this.keywordIndex]]).toLowerCase()),e.writeEndElement()),je(t[tii[this.keywordIndex]])||(e.writeStartElement("w15","color",void 0),"empty"===t[tii[this.keywordIndex]]||"#00000000"===t[tii[this.keywordIndex]]?e.writeAttributeString("w","val",void 0,"auto"):e.writeAttributeString("w","val",void 0,this.getColor(t[tii[this.keywordIndex]])),e.writeEndElement()),je(t[koi[this.keywordIndex]])||t[koi[this.keywordIndex]]!==(1===this.keywordIndex?9:"Text")||(e.writeStartElement(void 0,"text",this.wNamespace),e.writeEndElement()),Y.parseBoolValue(t[$ii[this.keywordIndex]])&&(e.writeStartElement(void 0,"text",this.wNamespace),e.writeAttributeString("w","multiLine",this.wNamespace,"1"),e.writeEndElement()),je(t[hni[this.keywordIndex]])||Y.parseBoolValue(t[hni[this.keywordIndex]][uni[this.keywordIndex]])&&(e.writeStartElement("w","dataBinding",this.wNamespace),r=t[hni[this.keywordIndex]][mni[this.keywordIndex]],e.writeAttributeString("w","prefixMappings",void 0,r),r=t[hni[this.keywordIndex]][fni[this.keywordIndex]],e.writeAttributeString("w","xpath",void 0,r),r=t[hni[this.keywordIndex]][yni[this.keywordIndex]],e.writeAttributeString("w","storeItemID",void 0,r),e.writeEndElement()),t.picture&&(e.writeStartElement("w","picture",this.wNamespace),e.writeEndElement()),je(t[sni[this.keywordIndex]]||t[ani[this.keywordIndex]])||(e.writeStartElement("w14","checkbox",void 0),Y.parseBoolValue(t[rni[this.keywordIndex]])?(e.writeStartElement("w14","checked",void 0),e.writeAttributeString("w14","val",void 0,"1")):(e.writeStartElement("w14","checked",void 0),e.writeAttributeString("w14","val",void 0,"0")),e.writeEndElement(),t[sni[this.keywordIndex]]&&(e.writeStartElement("w14","uncheckedState",void 0),e.writeAttributeString("w14","val",void 0,this.toUnicode(t[sni[this.keywordIndex]][pni[this.keywordIndex]])),e.writeAttributeString("w14","font",void 0,t[sni[this.keywordIndex]][dni[this.keywordIndex]]),e.writeEndElement()),t[ani[this.keywordIndex]]&&(e.writeStartElement("w14","checkedState",void 0),e.writeAttributeString("w14","val",void 0,this.toUnicode(t[ani[this.keywordIndex]][pni[this.keywordIndex]])),e.writeAttributeString("w14","font",void 0,t[ani[this.keywordIndex]][dni[this.keywordIndex]]),e.writeEndElement()),e.writeEndElement()),je(t[lni[this.keywordIndex]])||t[koi[this.keywordIndex]]!==(1===this.keywordIndex?5:"DropDownList")||(r=t[lni[this.keywordIndex]],e.writeStartElement(void 0,"dropDownList",this.wNamespace),this.serializeContentControlList(e,r),e.writeEndElement()),je(t[lni[this.keywordIndex]])||t[koi[this.keywordIndex]]!==(1===this.keywordIndex?3:"ComboBox")||(r=t[lni[this.keywordIndex]],e.writeStartElement(void 0,"comboBox",this.wNamespace),this.serializeContentControlList(e,r),e.writeEndElement()),this.serializeContentControlDate(e,t),je(t[koi[this.keywordIndex]])||t[koi[this.keywordIndex]]===(1===this.keywordIndex?7:"Picture")&&(e.writeStartElement(void 0,"picture",this.wNamespace),e.writeEndElement()),e.writeEndElement(),e.writeStartElement("w","sdtContent",this.wNamespace),!o){if(i.hasOwnProperty(_ni[this.keywordIndex])&&je(i[wni[this.keywordIndex]]))for(var s=0;s<i[_ni[this.keywordIndex]].length;s++){var a,l=i[_ni[this.keywordIndex]][s];l.hasOwnProperty(qii[this.keywordIndex])?(this.paragraph=l,this.serializeParagraph(e,l,n),this.paragraph=void 0):l.hasOwnProperty(Cni[this.keywordIndex])?(a=new uJt,this.serializeRow(e,l,a)):l.hasOwnProperty(Gii[this.keywordIndex])?this.serializeContentControl(e,l[Gii[this.keywordIndex]],l,n):this.serializeTable(e,l)}else i.hasOwnProperty(Cni[this.keywordIndex])?0<i[Sni[this.keywordIndex]].length&&(a=new uJt,this.serializeRow(e,i,a)):i.hasOwnProperty(wni[this.keywordIndex])&&(a=new uJt,this.serializeCell(e,i,a));e.writeEndElement(),e.writeEndElement()}},Hui.prototype.toUnicode=function(e){return e.charCodeAt(0).toString(16)},Hui.prototype.serializeContentControlList=function(e,t){for(var i=0;i<t.length;i++)e.writeStartElement(void 0,"listItem",this.wNamespace),je(t[i][cni[this.keywordIndex]])||e.writeAttributeString("w","displayText",this.wNamespace,t[i][cni[this.keywordIndex]]),e.writeAttributeString("w","value",this.wNamespace,t[i][pni[this.keywordIndex]]),e.writeEndElement()},Hui.prototype.serializeContentParagraph=function(e,t){for(var i=0;i<t[_ni[this.keywordIndex]].length;i++){var n=t[_ni[this.keywordIndex]][i];if(n.hasOwnProperty(qii[this.keywordIndex]))for(var o=0;o<n[qii[this.keywordIndex]].length;o++){var r=n[qii[this.keywordIndex]][o];je(r[aZt[this.keywordIndex]])||this.serializeCharacterFormat(e,r[aZt[this.keywordIndex]])}}},Hui.prototype.serializeContentControlDate=function(e,t){t[koi[this.keywordIndex]]===(1==this.keywordIndex?4:"Date")&&(e.writeStartElement("w","date",this.wNamespace),je(t[tni[this.keywordIndex]])||(e.writeStartElement("w","calender",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,1==this.keywordIndex?this.getDateCalendarType(t[tni[this.keywordIndex]]):t[tni[this.keywordIndex]]),e.writeEndElement()),je(t[nni[this.keywordIndex]])||(e.writeStartElement("w","lid",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,t[nni[this.keywordIndex]]),e.writeEndElement()),je(t[ini[this.keywordIndex]])||(e.writeStartElement("w","storeMappedDataAs",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,1==this.keywordIndex?this.getDateStorageFormat(t[ini[this.keywordIndex]]):t[ini[this.keywordIndex]]),e.writeEndElement()),je(t[oni[this.keywordIndex]])||(e.writeStartElement("w","dateFormat",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,t[oni[this.keywordIndex]]),e.writeEndElement()),e.writeEndElement())},Hui.prototype.serializeBodyItem=function(e,t,i){if(je(t))throw new Error("BodyItem should not be undefined");if(t.hasOwnProperty(Gii[this.keywordIndex]))this.serializeContentControl(e,t[Gii[this.keywordIndex]],t,i);else if(t.hasOwnProperty(qii[this.keywordIndex]))this.paragraph=t,this.serializeParagraph(e,t,i),this.paragraph=void 0;else{for(var n=t,o=0;o<n[Ani[this.keywordIndex]].length;o++)if(0<n[Ani[this.keywordIndex]][o][Sni[this.keywordIndex]].length){this.serializeTable(e,n);break}t=this.blockOwner;!i&&t.hasOwnProperty(Gni[this.keywordIndex])&&t[_ni[this.keywordIndex]].indexOf(n)===t[_ni[this.keywordIndex]].length-1&&(e.writeStartElement("w","p",this.wNamespace),e.writeStartElement(void 0,"pPr",this.wNamespace),this.serializeSectionProperties(e,t),e.writeEndElement(),e.writeEndElement())}},Hui.prototype.serializeParagraph=function(e,t,i){if(je(t))throw new Error("Paragraph should not be undefined");je(this.document.optimizeSfdt)||(this.keywordIndex=this.document.optimizeSfdt?1:0),e.writeStartElement("w","p",this.wNamespace),this.isInsideComment&&e.writeAttributeString("w14","paraId",void 0,this.commentParaID.toString()),e.writeStartElement(void 0,"pPr",this.wNamespace),je(t[lZt[this.keywordIndex]])||this.serializeParagraphFormat(e,t[lZt[this.keywordIndex]],t),je(t[aZt[this.keywordIndex]])||this.serializeCharacterFormat(e,t[aZt[this.keywordIndex]]);var n=this.blockOwner;!i&&n.hasOwnProperty(Gni[this.keywordIndex])&&n[_ni[this.keywordIndex]].indexOf(t)===n[_ni[this.keywordIndex]].length-1&&this.serializeSectionProperties(e,n),e.writeEndElement(),this.prevRevisionIds=[],this.serializeParagraphItems(e,t[qii[this.keywordIndex]]),(this.isBookmarkAtEnd||this.isBookmarkAtRowEnd)&&!this.isVerticalMergeCell||e.writeEndElement(),this.isBookmarkAtEnd=!1},Hui.prototype.serializeRevisionStart=function(e,t,i){if(t.hasOwnProperty(h$t[this.keywordIndex])&&(je(i)||!i.hasOwnProperty(hoi[this.keywordIndex])||0!==i[hoi[this.keywordIndex]]||0<=i[BZt[this.keywordIndex]].indexOf("_Toc")||!je(t[h$t[this.keywordIndex]])))for(var n=t[h$t[this.keywordIndex]],o=0;o<n.length;o++){var r=this.retrieveRevision(n[o]);"Insertion"===r.revisionType&&this.serializeTrackChanges(e,"ins",r.author,r.date),"Deletion"===r.revisionType&&this.serializeTrackChanges(e,"del",r.author,r.date)}},Hui.prototype.serializeTrackChanges=function(e,t,i,n){e.writeStartElement("w",t,this.wNamespace),e.writeAttributeString("w","id",this.wNamespace,(this.trackChangesId++).toString()),"Unknown"!=i&&e.writeAttributeString("w","author",this.wNamespace,i),e.writeAttributeString("w","date",this.wNamespace,n)},Hui.prototype.retrieveRevision=function(e){for(var t=0;t<this.revisions.length;t++)if(this.revisions[t].revisionID===e)return this.revisions[t]},Hui.prototype.serializeParagraphItems=function(e,t,i){if(je(t))throw new Error("Paragraph should not be undefined");var n,o=void 0,r=!1;je(this.keywordIndex)&&(this.keywordIndex=i);for(var s=0;s<t.length;s++){var a=t[s],l=(a.hasOwnProperty(Gii[this.keywordIndex])&&(this.serializeContentControl(e,a[Gii[this.keywordIndex]],a,void 0,n=!0),this.serializeParagraphItems(e,a[qii[this.keywordIndex]])),a.hasOwnProperty(qii[this.keywordIndex])&&this.serializeParagraphItems(e,a),this.serializeRevisionStart(e,a,o),!1);a[aZt[this.keywordIndex]]&&(l=!je(a[aZt[this.keywordIndex]][ZZt[this.keywordIndex]])&&0!==a[aZt[this.keywordIndex]][ZZt[this.keywordIndex]])&&!r&&(this.serializeBiDirectionalOverride(e,a[aZt[this.keywordIndex]]),r=!0),r&&!l&&(e.writeEndElement(),r=!1),a.hasOwnProperty(fii[this.keywordIndex])?this.serializeFieldCharacter(e,a):a.hasOwnProperty(oii[this.keywordIndex])?this.serializePicture(e,a):a.hasOwnProperty(Fti[this.keywordIndex])?(l=this.paragraph,this.serializeShape(e,a),this.paragraph=l):a.hasOwnProperty(hoi[this.keywordIndex])?this.serializeBookMark(e,a):a.hasOwnProperty(moi[this.keywordIndex])?this.serializeEditRange(e,a):a.hasOwnProperty(Dti[this.keywordIndex])?(this.chart=a,this.serializeChart(e,a),this.serializeChartStructure()):a.hasOwnProperty(Bii[this.keywordIndex])?this.serializeComment(e,a):a.hasOwnProperty(jii[this.keywordIndex])?this.serializeEFReference(e,a):this.serializeTextRange(e,a,o),this.serializeRevisionEnd(e,a,o),o=a,n&&(e.writeEndElement(),e.writeEndElement(),n=!1)}r&&e.writeEndElement()},Hui.prototype.serializeEFReference=function(e,t){var i="",n=t[_ni[this.keywordIndex]];t[jii[this.keywordIndex]]===(1==this.keywordIndex?0:"Footnote")?(e.writeStartElement(void 0,"r",this.wNamespace),this.serializeCharacterFormat(e,t[aZt[this.keywordIndex]]),e.writeStartElement(void 0,"footnoteReference",this.wNamespace),this.document[EZt[this.keywordIndex]][loi[this.keywordIndex]]&&0===this.efRelationShipId&&(this.efRelationShipId=1),i=this.getEFNextRelationShipID(),e.writeAttributeString(void 0,"id",this.wNamespace,i),this.addFootnotesEndnotes(n,"footnote",i)):(e.writeStartElement(void 0,"r",this.wNamespace),this.serializeCharacterFormat(e,t[aZt[this.keywordIndex]]),e.writeStartElement(void 0,"endnoteReference",this.wNamespace),this.document[DZt[this.keywordIndex]][loi[this.keywordIndex]]&&0===this.efRelationShipId&&(this.efRelationShipId=1),i=this.getEFNextRelationShipID(),e.writeAttributeString(void 0,"id",this.wNamespace,i),this.addFootnotesEndnotes(n,"endnote",i)),e.writeEndElement(),e.writeEndElement()},Hui.prototype.addFootnotesEndnotes=function(e,t,i){var n=new uJt;this.endnotesFootnotes.add(t,n),this.endnotesFootnotes.get(t).add(i,e)},Hui.prototype.serializeEndnotesFootnote=function(e,t){if(0!==this.endnotesFootnotes.length&&this.endnotesFootnotes.containsKey(t))for(var i=this.endnotesFootnotes.get(t),n=0;n<i.keys.length;n++){var o=i.keys[n],r=i.get(o);"endnote"===t?(this.endnotesPath,this.endnotesRelationPath,this.serializeInlineEndnotes(e,r,o)):(this.footnotesPath,this.footnotesRelationPath,this.serializeInlineFootnotes(e,r,o))}},Hui.prototype.serializeInlineEndnotes=function(e,t,i){this.isSerializeFootEndNote="Endnote",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,this.isSerializeFootEndNote=void 0},Hui.prototype.serializeInlineFootnotes=function(e,t,i){this.isSerializeFootEndNote="Footnote",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,this.isSerializeFootEndNote=void 0},Hui.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")},Hui.prototype.serializeFootnotes=function(){var e;je(this.document[EZt[this.keywordIndex]])||((e=new Ol).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[EZt[this.keywordIndex]][soi[this.keywordIndex]],!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[EZt[this.keywordIndex]][aoi[this.keywordIndex]],!0),e.writeEndElement(),this.document[EZt[this.keywordIndex]][loi[this.keywordIndex]]&&(e.writeStartElement("w","footnote",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"continuationNotice"),e.writeAttributeString(void 0,"id",this.wNamespace,"1"),this.serializeBodyItems(e,this.document[EZt[this.keywordIndex]][loi[this.keywordIndex]],!0),e.writeEndElement()),this.serializeEndnotesFootnote(e,"footnote"),e.writeEndElement(),e=new ih(e.buffer,this.footnotesPath),this.mArchive.addItem(e))},Hui.prototype.serializeEndnotes=function(){var e;je(this.document[DZt[this.keywordIndex]])||((e=new Ol).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[DZt[this.keywordIndex]][soi[this.keywordIndex]],!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[DZt[this.keywordIndex]][aoi[this.keywordIndex]],!0),e.writeEndElement(),this.document[DZt[this.keywordIndex]][loi[this.keywordIndex]]&&(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[DZt[this.keywordIndex]][loi[this.keywordIndex]],!0),e.writeEndElement()),this.serializeEndnotesFootnote(e,"endnote"),e.writeEndElement(),e=new ih(e.buffer,this.endnotesPath),this.mArchive.addItem(e))},Hui.prototype.serializeRevisionEnd=function(e,t,i){if(t.hasOwnProperty(h$t[this.keywordIndex]))for(var n=0;n<t[h$t[this.keywordIndex]].length;n++){var o=this.retrieveRevision(t[h$t[this.keywordIndex]][n]);"Insertion"!==o.revisionType&&"Deletion"!==o.revisionType||e.writeEndElement()}},Hui.prototype.serializeComment=function(e,t){var i;1===this.mComments.length&&""===this.mComments[0].text||(0===t[Bii[this.keywordIndex]]?e.writeStartElement("w","commentRangeStart",this.wNamespace):1===t[Bii[this.keywordIndex]]&&e.writeStartElement("w","commentRangeEnd",this.wNamespace),je(i=this.commentId[t[Pii[this.keywordIndex]]])&&(i=this.commentId[t[Pii[this.keywordIndex]]]=this.currentCommentId++),e.writeAttributeString("w","id",this.wNamespace,i.toString()),e.writeEndElement(),1===t[Bii[this.keywordIndex]]&&this.serializeCommentItems(e,i))},Hui.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()},Hui.prototype.serializeBiDirectionalOverride=function(e,t){e.writeStartElement(void 0,"bdo",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,(1==this.keywordIndex?this.getBiDirectionalOverride(t[ZZt[this.keywordIndex]]):t[ZZt[this.keywordIndex]]).toLowerCase())},Hui.prototype.serializeEditRange=function(e,t){t.hasOwnProperty(woi[this.keywordIndex])?e.writeStartElement("w","permEnd",this.wNamespace):(e.writeStartElement("w","permStart",this.wNamespace),t[voi[this.keywordIndex]]&&""!==t[voi[this.keywordIndex]]&&e.writeAttributeString("w","ed",this.wNamespace,t[voi[this.keywordIndex]]),t[boi[this.keywordIndex]]&&""!==t[boi[this.keywordIndex]]&&e.writeAttributeString("w","edGrp",this.wNamespace,t[boi[this.keywordIndex]].toLowerCase()),je(t[foi[this.keywordIndex]])||-1===t[foi[this.keywordIndex]]||e.writeAttributeString("w","colFirst",this.wNamespace,t[foi[this.keywordIndex]].toString()),je(t[yoi[this.keywordIndex]])||-1===t[yoi[this.keywordIndex]]||e.writeAttributeString("w","colLast",this.wNamespace,t[yoi[this.keywordIndex]].toString())),e.writeAttributeString("w","id",this.wNamespace,t[moi[this.keywordIndex]]),e.writeEndElement()},Hui.prototype.serializeBookMark=function(e,t){var i=this.getBookmarkId(t[BZt[this.keywordIndex]]),n=t[BZt[this.keywordIndex]];0===t[hoi[this.keywordIndex]]?(e.writeStartElement("w","bookmarkStart",this.wNamespace),e.writeAttributeString("w","name",this.wNamespace,n),je(t[doi[this.keywordIndex]])||(e.writeAttributeString("w","colFirst",this.wNamespace,t[doi[this.keywordIndex]][foi[this.keywordIndex]].toString()),e.writeAttributeString("w","colLast",this.wNamespace,t[doi[this.keywordIndex]][yoi[this.keywordIndex]].toString()))):1===t[hoi[this.keywordIndex]]&&(je(t[doi[this.keywordIndex]])||this.isBookmarkAtEnd||this.isBookmarkAtRowEnd||(Y.parseBoolValue(t[doi[this.keywordIndex]][Koi[this.keywordIndex]])?(e.writeEndElement(),this.isBookmarkAtEnd=!0):Y.parseBoolValue(t[doi[this.keywordIndex]][Zoi[this.keywordIndex]])&&(e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),this.isBookmarkAtRowEnd=!0)),e.writeStartElement("w","bookmarkEnd",this.wNamespace)),e.writeAttributeString("w","id",this.wNamespace,i.toString()),e.writeEndElement()},Hui.prototype.getBookmarkId=function(e){var t=this.bookmarks.indexOf(e);return t<0&&(t=this.bookmarks.length,this.bookmarks.push(e)),t},Hui.prototype.serializePicture=function(e,t){0<=t[Vti[this.keywordIndex]]&&0<=t[_ti[this.keywordIndex]]&&(e.writeStartElement(void 0,"r",this.wNamespace),this.serializeCharacterFormat(e,t[aZt[this.keywordIndex]]),this.serializeDrawing(e,t),e.writeEndElement())},Hui.prototype.serializeShape=function(e,t){0<=t[Vti[this.keywordIndex]]&&0<=t[_ti[this.keywordIndex]]&&(e.writeStartElement(void 0,"r",this.wNamespace),this.serializeCharacterFormat(e,t[aZt[this.keywordIndex]]),0<t[Nti[this.keywordIndex]]?this.serializeHorizontalRule(e,t):this.serializeDrawing(e,t),e.writeEndElement())},Hui.prototype.serializeHorizontalRule=function(e,t){e.writeStartElement(void 0,"pict",this.wNamespace),e.writeStartElement("v","rect",void 0);var i=Math.round(t[Vti[this.keywordIndex]]),n=Math.round(t[_ti[this.keywordIndex]]);e.writeAttributeString(void 0,"style",void 0,"width:"+i.toString()+";height:"+n.toString()),0<t[Nni[this.keywordIndex]]&&(i=1==this.keywordIndex?this.getShapeHorizontalAlignment(t[Nni[this.keywordIndex]]):t[Nni[this.keywordIndex]].toString(),e.writeAttributeString("o","hralign",void 0,i.toLowerCase())),e.writeAttributeString("o","hrstd",void 0,"t"),e.writeAttributeString("o","hr",void 0,"t"),e.writeAttributeString(void 0,"fillcolor",void 0,this.getColor(t[Wti[this.keywordIndex]][tii[this.keywordIndex]])),e.writeAttributeString(void 0,"stroked",void 0,"f"),e.writeEndElement(),e.writeEndElement()},Hui.prototype.serializeDrawing=function(e,t){e.writeStartElement(void 0,"drawing",this.wNamespace),t.hasOwnProperty(Dti[this.keywordIndex])?this.serializeInlineCharts(e,t):t[Qti[this.keywordIndex]]===(1==this.keywordIndex?0:"Inline")?this.serializeInlinePictureAndShape(e,t):this.serializeWrappingPictureAndShape(e,t),e.writeEndElement()},Hui.prototype.serializeWrappingPictureAndShape=function(e,t){je(this.document.optimizeSfdt)||(this.keywordIndex=this.document.optimizeSfdt?1:0),e.writeStartElement("wp","anchor",this.wpNamespace),this.serializePictureAndShapeDistance(e,t),e.writeAttributeString(void 0,"simplePos",void 0,"0"),e.writeAttributeString(void 0,"relativeHeight",void 0,t[Kti[this.keywordIndex]]?Math.abs(t[Kti[this.keywordIndex]]).toString():"0");var i=t[Qti[this.keywordIndex]]&&t[Qti[this.keywordIndex]]===(1==this.keywordIndex?4:"Behind"),i=(e.writeAttributeString(void 0,"behindDoc",void 0,i?"1":"0"),1==this.keywordIndex?je(t[Zti[this.keywordIndex]])?"0":t[Zti[this.keywordIndex]].toString():t[Zti[this.keywordIndex]]?"1":"0"),i=(e.writeAttributeString(void 0,"locked",void 0,i),1==this.keywordIndex?je(t[Jti[this.keywordIndex]])?"0":t[Jti[this.keywordIndex]].toString():t[Jti[this.keywordIndex]]?"1":"0"),i=(e.writeAttributeString(void 0,"layoutInCell",void 0,i),1==this.keywordIndex?je(t[Mni[this.keywordIndex]])?"0":t[Mni[this.keywordIndex]].toString():t[Mni[this.keywordIndex]]?"1":"0"),i=(e.writeAttributeString(void 0,"allowOverlap",void 0,i),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),1==this.keywordIndex?this.getHorizontalOrigin(t[Oni[this.keywordIndex]]):t[Oni[this.keywordIndex]].toString()),i=(e.writeAttributeString(void 0,"relativeFrom",void 0,Y.formatText("firstlower",i)),t[Nni[this.keywordIndex]]===(1==this.keywordIndex?0:"None")?(e.writeStartElement("wp","posOffset",this.wpNamespace),i=Math.round(t[Vni[this.keywordIndex]]*this.emusPerPoint),e.writeString(i.toString())):(e.writeStartElement("wp","align",this.wpNamespace),i=1==this.keywordIndex?this.getShapeHorizontalAlignment(t[Nni[this.keywordIndex]]):t[Nni[this.keywordIndex]].toString(),e.writeString(i.toLowerCase())),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("wp","positionV",this.wpNamespace),1==this.keywordIndex?this.getVerticalOrigin(t[Lni[this.keywordIndex]]):t[Lni[this.keywordIndex]].toString()),i=(e.writeAttributeString(void 0,"relativeFrom",void 0,Y.formatText("firstlower",i)),t[rei[this.keywordIndex]]===(1==this.keywordIndex?0:"None")?(e.writeStartElement("wp","posOffset",this.wpNamespace),i=Math.round(t[Rni[this.keywordIndex]]*this.emusPerPoint),e.writeString(i.toString())):(e.writeStartElement("wp","align",this.wpNamespace),i=1==this.keywordIndex?this.getShapeVerticalAlignment(t[rei[this.keywordIndex]]):t[rei[this.keywordIndex]],e.writeString(i.toLowerCase())),e.writeEndElement(),e.writeEndElement(),e.writeStartElement(void 0,"extent",this.wpNamespace),Math.round(t[Vti[this.keywordIndex]]*this.emusPerPoint)),i=(e.writeAttributeString(void 0,"cx",void 0,i.toString()),Math.round(t[_ti[this.keywordIndex]]*this.emusPerPoint));e.writeAttributeString(void 0,"cy",void 0,i.toString()),e.writeEndElement(),je(t[oii[this.keywordIndex]])?this.serializeShapeDrawingGraphics(e,t):(this.serializeShapeWrapStyle(e,t),this.serializeDrawingGraphics(e,t)),e.writeEndElement()},Hui.prototype.serializeInlinePictureAndShape=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[Vti[this.keywordIndex]]*this.emusPerPoint),i=(e.writeAttributeString(void 0,"cx",void 0,i.toString()),Math.round(t[_ti[this.keywordIndex]]*this.emusPerPoint));e.writeAttributeString(void 0,"cy",void 0,i.toString()),e.writeEndElement(),je(t[oii[this.keywordIndex]])?this.serializeShapeDrawingGraphics(e,t):(this.serializeShapeWrapStyle(e,t),this.serializeDrawingGraphics(e,t)),e.writeEndElement()},Hui.prototype.serializePictureAndShapeDistance=function(e,t){var i=t[kni[this.keywordIndex]]?Math.round(t[kni[this.keywordIndex]]*this.emusPerPoint).toString():"0",i=(e.writeAttributeString(void 0,"distT",void 0,i),t[Fni[this.keywordIndex]]?Math.round(t[Fni[this.keywordIndex]]*this.emusPerPoint).toString():"0"),i=(e.writeAttributeString(void 0,"distB",void 0,i),t[Bni[this.keywordIndex]]?Math.round(t[Bni[this.keywordIndex]]*this.emusPerPoint).toString():"114300"),i=(e.writeAttributeString(void 0,"distL",void 0,i),t[Pni[this.keywordIndex]]?Math.round(t[Pni[this.keywordIndex]]*this.emusPerPoint).toString():"114300");e.writeAttributeString(void 0,"distR",void 0,i)},Hui.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")},Hui.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[Vti[this.keywordIndex]]*this.emusPerPoint),i=(e.writeAttributeString(void 0,"cx",void 0,i.toString()),Math.round(t[_ti[this.keywordIndex]]*this.emusPerPoint));e.writeAttributeString(void 0,"cy",void 0,i.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()},Hui.prototype.serializeDrawingGraphicsChart=function(e,t){t=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,t),e.writeEndElement(),e.writeEndElement(),e.writeEndElement()},Hui.prototype.getBase64ImageString=function(e){var t=je(e[rii[this.keywordIndex]])?this.mImages.get(parseInt(e[oii[this.keywordIndex]])):this.mImages.get(parseInt(e[rii[this.keywordIndex]])),e=t[Y.parseBoolValue(e[aii[this.keywordIndex]])?1:0];return{imageString:e,metaFileImageString:t[this.startsWith(e,"https://")||this.startsWith(e,"http://")||this.startsWith(e,"file://")?1:0]}},Hui.prototype.getNextChartName=function(){return"Chart"+ ++this.chartCount},Hui.prototype.serializeChart=function(e,t){e.writeStartElement("w","r",this.wNamespace),this.serializeCharacterFormat(e,t[aZt[this.keywordIndex]]),this.serializeDrawing(e,t),e.writeEndElement()},Hui.prototype.serializeChartStructure=function(){this.serializeChartXML(),this.serializeChartColors(),this.serializeChartExcelData(),this.serializeChartRelations(),this.chart=void 0,this.saveExcel()},Hui.prototype.serializeChartXML=function(){var e,t=new Ol,t=(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",new ih(t.buffer,e));this.mArchive.addItem(t)},Hui.prototype.serializeChartColors=function(){var e=new Ol,t="",e=(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(),new ih(e.buffer,t));this.mArchive.addItem(e)},Hui.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()},Hui.prototype.serializeChartExcelData=function(){je(this.excelFiles)&&(this.excelFiles=new uJt),this.mArchiveExcel=new Zl,this.mArchiveExcel.compressionLevel="Normal";var e=this.chart[Dti[this.keywordIndex]],e="Scatter_Markers"===e||"Bubble"===e;this.serializeWorkBook(),this.serializeSharedString(e),this.serializeExcelContentTypes(),this.serializeExcelData(e),this.serializeExcelStyles(),this.serializeExcelRelation(),this.serializeExcelGeneralRelations(),this.chartStringCount=0},Hui.prototype.serializeWorkBook=function(){var e=new Ol,e=(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(),new ih(e.buffer,"xl/workbook.xml"));this.mArchiveExcel.addItem(e)},Hui.prototype.serializeExcelStyles=function(){var e=new Ol,e=(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(),new ih(e.buffer,"xl/styles.xml"));this.mArchiveExcel.addItem(e)},Hui.prototype.serializeExcelData=function(e){var t=new Ol,e=(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(),new ih(t.buffer,"xl/worksheets/sheet1.xml"));this.mArchiveExcel.addItem(e)},Hui.prototype.serializeSharedString=function(e){for(var t=this.chart,i=new Ol,n=[],o=this.chart[Dti[this.keywordIndex]],r=t[wti[this.keywordIndex]].length,s=0;s<r;s++){var a=t[wti[this.keywordIndex]][s],l=a[$ei[this.keywordIndex]].match(/[a-z]/i);e&&0===s&&n.push("X-Values"),l&&(n.push(a[$ei[this.keywordIndex]]),this.chartStringCount++)}"Bubble"===o&&n.push("Size");for(var h=0;h<t[bti[this.keywordIndex]].length;h++){var d=t[bti[this.keywordIndex]][h],p=t[Iti[this.keywordIndex]][$ni[this.keywordIndex]],c=d[Nei[this.keywordIndex]],l=c.match(/[a-z]/i);(/^(((0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/\d{4})|((0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4})|((\d{4})\/(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])))/.test(c)||l||"m/d/yyyy"===p)&&(n.push(d[Nei[this.keywordIndex]]),this.chartStringCount++)}o=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,o.toString()),i.writeAttributeString(void 0,"uniqueCount",void 0,o.toString());for(var u=0;u<=n.length;u++)i.writeStartElement(void 0,"si",void 0),i.writeStartElement(void 0,"t",void 0),u!==n.length?i.writeString(n[u]):e||(i.writeAttributeString("xml","space",this.xmlNamespace,"preserve"),i.writeString(" ")),i.writeEndElement(),i.writeEndElement();i.writeEndElement();o=new ih(i.buffer,"xl/sharedStrings.xml");this.mArchiveExcel.addItem(o)},Hui.prototype.serializeExcelSheet=function(e,t){var i,n=this.chart,o="s",r="Bubble"===n[Dti[this.keywordIndex]],s=n[bti[this.keywordIndex]].length+1,a=n[Iti[this.keywordIndex]][$ni[this.keywordIndex]],l=n[wti[this.keywordIndex]].length+1,h=(r&&(i=l,l+=1),void 0),d=void 0,p=0;e.writeStartElement(void 0,"sheetData",void 0);for(var c=0;c<s;c++){e.writeStartElement(void 0,"row",void 0),e.writeAttributeString(void 0,"r",void 0,(c+1).toString());for(var u=0;u<l;u++){var g,m,f=String.fromCharCode("A".charCodeAt(0)+u)+(c+1).toString();e.writeStartElement(void 0,"c",void 0),e.writeAttributeString(void 0,"r",void 0,f),o=0!==c&&0===u?(g=(f=(h=n[bti[this.keywordIndex]][c-1])[Nei[this.keywordIndex]]).match(/[a-z]/i),!(/^(((0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/\d{4})|((0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4})|((\d{4})\/(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])))/.test(f)||je(g)&&"m/d/yyyy"===a)&&(!g||t)?"n":"s"):0===c&&0!==u&&u!==i?(g=(d=n[wti[this.keywordIndex]][u-1])[$ei[this.keywordIndex]].match(/[a-z]/i))?"s":"n":0===c&&r&&u===i||0===c&&0===u?"s":"n",e.writeAttributeString(void 0,"t",void 0,o),e.writeStartElement(void 0,"v",void 0),0!==c||0!==u||t?"s"===o&&p<this.chartStringCount?(e.writeString(p.toString()),p++):0!==c&&"s"!==o&&0===u&&u!==i?e.writeString(h[Nei[this.keywordIndex]]):0!==u&&"s"!==o&&0===c&&u!==i?e.writeString(d[$ei[this.keywordIndex]]):0!==c&&0!==u&&u!==i?je(m=h[Oei[this.keywordIndex]][u-1])||(f=m[Rei[this.keywordIndex]],e.writeString(f.toString())):0!==c&&r&&u===i&&!je(m=h[Oei[this.keywordIndex]][u-2])&&(f=m[Eii[this.keywordIndex]],e.writeString(f.toString())):e.writeString(this.chartStringCount.toString()),e.writeEndElement(),e.writeEndElement(),o=""}e.writeEndElement()}e.writeEndElement()},Hui.prototype.serializeExcelContentTypes=function(){var e=new Ol,e=(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(),new ih(e.buffer,this.contentTypesPath));this.mArchiveExcel.addItem(e)},Hui.prototype.serializeExcelRelation=function(){var e=new Ol,e=(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(),new ih(e.buffer,this.excelRelationPath));this.mArchiveExcel.addItem(e)},Hui.prototype.serializeExcelGeneralRelations=function(){var e=new Ol,e=(this.resetExcelRelationShipId(),e.writeStartElement(void 0,"Relationships",this.rpNamespace),this.serializeRelationShip(e,this.getNextExcelRelationShipID(),this.documentRelType,"xl/workbook.xml"),e.writeEndElement(),new ih(e.buffer,this.generalRelationPath));this.mArchiveExcel.addItem(e)},Hui.prototype.getNextExcelRelationShipID=function(){return"rId"+ ++this.eRelationShipId},Hui.prototype.getNextChartRelationShipID=function(){return"rId"+ ++this.cRelationShipId},Hui.prototype.serializeChartData=function(e,t){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),je(this.chart[Eti[this.keywordIndex]])||(e.writeStartElement("c","title",this.chartNamespace),this.serializeTextProperties(e,this.chart[Sti[this.keywordIndex]],this.chart[Eti[this.keywordIndex]]),e.writeEndElement()),this.serializeChartPlotArea(e,t),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()},Hui.prototype.serializeChartPlotArea=function(e,t){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();for(var i=this.chartType(t),n="pieChart"===i||"doughnutChart"===i,o="scatterChart"===i||"bubbleChart"===i,r=(e.writeStartElement("c",i,this.chartNamespace),"barChart"===i&&(u="",u="Column_Clustered"===t[Dti[this.keywordIndex]]||"Column_Stacked"===t[Dti[this.keywordIndex]]||"Column_Stacked_100"===t[Dti[this.keywordIndex]]?"col":"bar",e.writeStartElement("c","barDir",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,u),e.writeEndElement()),n||o||(u=this.chartGrouping(t[Dti[this.keywordIndex]]),e.writeStartElement("c","grouping",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,u),e.writeEndElement()),"scatterChart"===i&&(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(),0);r<t[wti[this.keywordIndex]].length;r++){var s,a=t[wti[this.keywordIndex]][r],l=(this.seriesCount=r,e.writeStartElement("c","ser",this.chartNamespace),e.writeStartElement("c","idx",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,r.toString()),e.writeEndElement(),e.writeStartElement("c","order",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,r.toString()),e.writeEndElement(),e.writeStartElement("c","tx",this.chartNamespace),e.writeStartElement("c","strRef",this.chartNamespace),e.writeStartElement("c","f",this.chartNamespace),String.fromCharCode("B".charCodeAt(0)+r)),l=(e.writeString((s="Sheet1!$"+l)+"$1"),s=s+"$2:$"+l+"$",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(a[$ei[this.keywordIndex]]),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),"Pie"===t[Dti[this.keywordIndex]]||"Doughnut"===t[Dti[this.keywordIndex]]?(this.parseChartDataPoint(e,a),e.writeStartElement("c","explosion",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement()):o||this.parseChartSeriesColor(e,a[oti[this.keywordIndex]],i),"scatterChart"===i&&(l=a[oti[this.keywordIndex]][0][iii[this.keywordIndex]][_ei[this.keywordIndex]],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,l,!1),e.writeEndElement()),a[eti[this.keywordIndex]]&&this.parseChartDataLabels(e,a[eti[this.keywordIndex]]),a[nti[this.keywordIndex]]&&this.parseChartTrendLines(e,a),a[tti[this.keywordIndex]]&&this.serializeChartErrorBar(e,a),"scatterChart"===i?this.serializeDefaultShapeProperties(e):"bubbleChart"===i&&this.serializeShapeProperties(e,a[oti[this.keywordIndex]][0][iii[this.keywordIndex]][_ei[this.keywordIndex]],!1),"cat"),h="strRef",d="strCache";"scatterChart"===i&&(l="xVal",h="numRef",d="numCache"),e.writeStartElement("c",l,this.chartNamespace),e.writeStartElement("c",h,this.chartNamespace),this.serializeChartCategory(e,t,d),e.writeEndElement(),e.writeEndElement(),this.serializeChartValue(e,s,i),e.writeEndElement()}e.writeStartElement("c","dLbls",this.chartNamespace),n&&(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(),n&&((a=this.chart[wti[this.keywordIndex]][g=u=0]).hasOwnProperty(rti[this.keywordIndex])&&(u=a[rti[this.keywordIndex]]),e.writeStartElement("c","firstSliceAng",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,u.toString()),e.writeEndElement(),"Doughnut"===t[Dti[this.keywordIndex]])&&(g=a[sti[this.keywordIndex]],e.writeStartElement("c","holeSize",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,g.toString()),e.writeEndElement()),"lineChart"===i||o?"bubbleChart"!==i&&(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[Mti[this.keywordIndex]].toString()),e.writeEndElement(),e.writeStartElement("c","overlap",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,this.chart[kti[this.keywordIndex]].toString()),e.writeEndElement()),"bubbleChart"===i&&(e.writeStartElement("c","sizeRepresents",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"area"),e.writeEndElement());var p,c,u=this.chart[Dti[this.keywordIndex]],g=(n||(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(),"Column_Stacked_100"===u||"Area_Stacked_100"===u||"Bar_Stacked_100"===u||"Line_Stacked_100"===u||"Line_Markers_Stacked_100"===u),u=this.chart[Iti[this.keywordIndex]][vti[this.keywordIndex]];n||(this.serializeCategoryAxis(e,u,g),this.serializeValueAxis(e,u,g)),this.chart.hasOwnProperty(Pti[this.keywordIndex])&&(n=this.chart[Pti[this.keywordIndex]],c=p=g=u=0,Y.parseBoolValue(n[gti[this.keywordIndex]])&&(c=1),Y.parseBoolValue(n[mti[this.keywordIndex]])&&(u=1),Y.parseBoolValue(n[fti[this.keywordIndex]])&&(g=1),Y.parseBoolValue(n[yti[this.keywordIndex]])&&(p=1),e.writeStartElement("c","dTable",this.chartNamespace),e.writeStartElement("c","showHorzBorder",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,u.toString()),e.writeEndElement(),e.writeStartElement("c","showVertBorder",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,g.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,c.toString()),e.writeEndElement(),e.writeEndElement()),this.serializeDefaultShapeProperties(e),e.writeEndElement(),je(this.chart[xti[this.keywordIndex]][coi[this.keywordIndex]])||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()},Hui.prototype.serializeChartLegend=function(e){var t=this.chartLegendPosition(this.chart[xti[this.keywordIndex]]),i=this.chart[xti[this.keywordIndex]][Sti[this.keywordIndex]],n=i[Lei[this.keywordIndex]][iii[this.keywordIndex]][_ei[this.keywordIndex]];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[GZt[this.keywordIndex]],n,i[qoi[this.keywordIndex]]),e.writeEndElement(),e.writeEndElement(),e.writeEndElement()},Hui.prototype.serializeChartErrorBar=function(e,t){var t=t[tti[this.keywordIndex]],i=this.errorBarValueType(t[koi[this.keywordIndex]]),n=0;"Cap"!==t[Wei[this.keywordIndex]]&&(n=1),e.writeStartElement("c","errBars",this.chartNamespace),e.writeStartElement("c","errBarType",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,t[jei[this.keywordIndex]].toLowerCase()),e.writeEndElement(),e.writeStartElement("c","errValType",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,i),e.writeEndElement(),e.writeStartElement("c","noEndCap",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,n.toString()),e.writeEndElement(),e.writeStartElement("c","val",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,t[Qei[this.keywordIndex]].toString()),e.writeEndElement(),this.serializeShapeProperties(e,"595959",!0),e.writeEndElement()},Hui.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},Hui.prototype.serializeCategoryAxis=function(e,t,i){var n="catAx",o=this.chart[Iti[this.keywordIndex]][$ni[this.keywordIndex]],r=this.chart[Dti[this.keywordIndex]],r="Scatter_Markers"===r||"Bubble"===r;"Time"===t&&(n="dateAx"),e.writeStartElement("c",n=r?"valAx":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[Iti[this.keywordIndex]],o,i),r||(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[Dti[this.keywordIndex]]&&(e.writeStartElement("c","noMultiLvlLbl",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement()),e.writeEndElement()},Hui.prototype.serializeValueAxis=function(e,t,i){var n=this.chart[Tti[this.keywordIndex]],t="Time"===t?"midCat":"between";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,t),e.writeEndElement(),0===n[Poi[this.keywordIndex]]||i||n[Boi[this.keywordIndex]]||(e.writeStartElement("c","majorUnit",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,n[Poi[this.keywordIndex]].toString()),e.writeEndElement()),e.writeEndElement()},Hui.prototype.serializeAxis=function(e,t,i,n,o){e.writeStartElement("c","scaling",this.chartNamespace),e.writeStartElement("c","orientation",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"minMax"),e.writeEndElement(),0===i[Foi[this.keywordIndex]]||o||(e.writeStartElement("c","max",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,i[Foi[this.keywordIndex]].toString()),e.writeEndElement(),e.writeStartElement("c","min",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,i[Loi[this.keywordIndex]].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(),Y.parseBoolValue(i[Roi[this.keywordIndex]])&&(e.writeStartElement("c","majorGridlines",this.chartNamespace),this.serializeShapeProperties(e,"D9D9D9",!0),e.writeEndElement()),Y.parseBoolValue(i[Ooi[this.keywordIndex]])&&(e.writeStartElement("c","minorGridlines",this.chartNamespace),this.serializeShapeProperties(e,"F2F2F2",!0),e.writeEndElement()),i[Eti[this.keywordIndex]]&&(e.writeStartElement("c","title",this.chartNamespace),this.serializeTextProperties(e,i[Sti[this.keywordIndex]],i[Eti[this.keywordIndex]]),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[Dti[this.keywordIndex]]?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[GZt[this.keywordIndex]],"595959",i[qoi[this.keywordIndex]]),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()},Hui.prototype.parseChartTrendLines=function(e,t){for(var i=0;i<t[nti[this.keywordIndex]].length;i++){var n=t[nti[this.keywordIndex]][i],o=this.chartTrendLineType(n[koi[this.keywordIndex]]),r=0,s=0,a=(Y.parseBoolValue(n[Zei[this.keywordIndex]])?s=1:Y.parseBoolValue(n[Jei[this.keywordIndex]])&&(r=1),t[oti[this.keywordIndex]][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[iii[this.keywordIndex]][_ei[this.keywordIndex]],!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,o),e.writeEndElement(),e.writeStartElement("c","forward",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,n[Yei[this.keywordIndex]].toString()),e.writeEndElement(),e.writeStartElement("c","backward",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,n[Xei[this.keywordIndex]].toString()),e.writeEndElement(),"NaN"!==n[Kei[this.keywordIndex]]&&(e.writeStartElement("c","intercept",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,n[Kei[this.keywordIndex]].toString()),e.writeEndElement()),e.writeStartElement("c","dispRSqr",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,r.toString()),e.writeEndElement(),e.writeStartElement("c","dispEq",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,s.toString()),e.writeEndElement(),e.writeEndElement()}},Hui.prototype.chartTrendLineType=function(e){var t="";switch(e){case"Linear":t="linear";break;case"Exponential":t="exp"}return t},Hui.prototype.parseChartDataLabels=function(e,t){var i="",n=0,o=0,r=0,s=0,a=0,l=0,h=0;switch(t[coi[this.keywordIndex]]){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[GZt[this.keywordIndex]],t[YZt[this.keywordIndex]],t[qoi[this.keywordIndex]]),e.writeEndElement(),e.writeEndElement(),Y.parseBoolValue(t[ati[this.keywordIndex]])?n=1:Y.parseBoolValue(t[lti[this.keywordIndex]])?o=1:Y.parseBoolValue(t[hti[this.keywordIndex]])?r=1:Y.parseBoolValue(t[dti[this.keywordIndex]])?s=1:Y.parseBoolValue(t[pti[this.keywordIndex]])?a=1:Y.parseBoolValue(t[cti[this.keywordIndex]])?l=1:Y.parseBoolValue(t[uti[this.keywordIndex]])&&(h=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,r.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,o.toString()),e.writeEndElement(),e.writeStartElement("c","showLeaderLines",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,h.toString()),e.writeEndElement(),e.writeEndElement()},Hui.prototype.serializeShapeProperties=function(e,t,i){var n=this.chart[Dti[this.keywordIndex]],o="Scatter_Markers"===n||"Bubble"===n;e.writeStartElement("c","spPr",this.chartNamespace),!o||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()},Hui.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()},Hui.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()},Hui.prototype.serializeTextProperties=function(e,t,i){var n=t[Lei[this.keywordIndex]][iii[this.keywordIndex]][_ei[this.keywordIndex]],o=100*t[GZt[this.keywordIndex]];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[GZt[this.keywordIndex]],n,t[qoi[this.keywordIndex]]),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,this.roundToTwoDecimal(o).toString()),e.writeAttributeString(void 0,"baseline",void 0,"0"),this.serializeChartSolidFill(e,n,!1),this.serializeFont(e,t[qoi[this.keywordIndex]]),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[GZt[this.keywordIndex]],n,t[qoi[this.keywordIndex]]),e.writeEndElement()},Hui.prototype.serializeChartTitleFont=function(e,t,i,n){t*=100;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,this.roundToTwoDecimal(t).toString()),e.writeAttributeString(void 0,"baseline",void 0,"0"),this.serializeChartSolidFill(e,i,!1),this.serializeFont(e,n),e.writeEndElement(),e.writeEndElement()},Hui.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[Dti[this.keywordIndex]]&&i&&(e.writeStartElement("a","alpha",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"75000"),e.writeEndElement()),e.writeEndElement(),e.writeEndElement()},Hui.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()},Hui.prototype.parseChartSeriesColor=function(e,t,i){for(var n=0;n<t.length;n++){var o,r=t[n];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,this.getColor(r[iii[this.keywordIndex]][Hoi[this.keywordIndex]]),!0):this.serializeChartSolidFill(e,r[Vei[this.keywordIndex]][tii[this.keywordIndex]],!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&&(r="none",o=0,this.chart[wti[this.keywordIndex]][n].hasOwnProperty(iti[this.keywordIndex])&&(r=this.chart[wti[this.keywordIndex]][n][iti[this.keywordIndex]][Uei[this.keywordIndex]],o=this.chart[wti[this.keywordIndex]][n][iti[this.keywordIndex]][Gei[this.keywordIndex]]),e.writeStartElement("c","marker",this.chartNamespace),e.writeStartElement("c","symbol",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,r.toLowerCase()),e.writeEndElement(),this.chart[wti[this.keywordIndex]][n].hasOwnProperty(iti[this.keywordIndex])&&(e.writeStartElement("c","size",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,o.toString()),e.writeEndElement()),e.writeEndElement())}},Hui.prototype.parseChartDataPoint=function(e,t){for(var i=t[oti[this.keywordIndex]],n=[],o=0;o<i.length;o++)n.push(i[o]),e.writeStartElement("c","dPt",this.chartNamespace),e.writeStartElement("c","idx",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,o.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[Dti[this.keywordIndex]]),e.writeEndElement(),n=[]},Hui.prototype.serializeChartCategory=function(e,t,i){var n=t[bti[this.keywordIndex]],t=n.length;e.writeStartElement("c","f",this.chartNamespace),e.writeString("Sheet1!$A$2:$A$"+(t+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,t.toString()),e.writeEndElement();for(var o=0;o<n.length;o++){var r=n[o];e.writeStartElement("c","pt",this.chartNamespace),e.writeAttributeString(void 0,"idx",void 0,o.toString()),e.writeStartElement("c","v",this.chartNamespace),""!==r[Nei[this.keywordIndex]]&&e.writeString(r[Nei[this.keywordIndex]]),e.writeEndElement(),e.writeEndElement()}e.writeEndElement()},Hui.prototype.serializeChartValue=function(e,t,i){var n="scatterChart"===i||"bubbleChart"===i?"yVal":"val";this.serializeChartYValue(e,n,t),"bubbleChart"===i&&this.serializeChartYValue(e,n="bubbleSize",t="Sheet1!$C$2:$C$"),"lineChart"!==i&&"scatterChart"!==i||(e.writeStartElement("c","smooth",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement())},Hui.prototype.serializeChartYValue=function(e,t,i){var n=this.chart[bti[this.keywordIndex]],o=n.length;e.writeStartElement("c",t,this.chartNamespace),e.writeStartElement("c","numRef",this.chartNamespace),e.writeStartElement("c","f",this.chartNamespace),e.writeString(i+(o+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,o.toString()),e.writeEndElement();for(var r=0;r<o;r++)for(var s,a=n[r],l=0;l<a[Oei[this.keywordIndex]].length;l++)l===this.seriesCount&&(s=a[Oei[this.keywordIndex]][this.seriesCount],e.writeStartElement("c","pt",this.chartNamespace),e.writeAttributeString(void 0,"idx",void 0,r.toString()),e.writeStartElement("c","v",this.chartNamespace),"bubbleSize"!==t?e.writeString(s[Rei[this.keywordIndex]].toString()):e.writeString(s[Eii[this.keywordIndex]].toString()),e.writeEndElement(),e.writeEndElement());e.writeEndElement(),e.writeEndElement(),e.writeEndElement()},Hui.prototype.chartType=function(e){var t=e[Dti[this.keywordIndex]];switch(t){case"Pie":t="pieChart";break;case"Doughnut":t="doughnutChart";break;case"Scatter_Markers":t="scatterChart";break;case"Bubble":t="bubbleChart"}return t="Line"!==(t="Bar_Stacked_100"!==(t="Area"!==t&&"Area_Stacked"!==t&&"Area_Stacked_100"!==t?t:"areaChart")&&"Bar_Stacked"!==t&&"Bar_Clustered"!==t&&"Column_Clustered"!==t&&"Column_Stacked"!==t&&"Column_Stacked_100"!==t?t:"barChart")&&"Line_Markers"!==t&&"Line_Markers_Stacked"!==t&&"Line_Stacked"!==t&&"Line_Markers_Stacked_100"!==t&&"Line_Stacked_100"!==t?t:"lineChart"},Hui.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},Hui.prototype.chartLegendPosition=function(e){var t=e[coi[this.keywordIndex]];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},Hui.prototype.updatechartId=function(e){var t="";return t=""===t?this.addChartRelation(this.documentCharts,e):t},Hui.prototype.addChartRelation=function(e,t){var i=this.getNextRelationShipID();return e.add(i,t),i},Hui.prototype.startsWith=function(e,t){return 0<t.length&&e.substring(0,t.length)===t},Hui.prototype.serializeShapeDrawingGraphics=function(e,t){var i=t[$ti[this.keywordIndex]],n=(t[Fti[this.keywordIndex]],this.serializeShapeWrapStyle(e,t),e.writeStartElement("wp","docPr",this.wpNamespace),e.writeAttributeString(void 0,"id",void 0,(this.mDocPrID++).toString()),e.writeAttributeString(void 0,"name",void 0,t[BZt[this.keywordIndex]]),e.writeAttributeString(void 0,"title",void 0,t[Jii[this.keywordIndex]]),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),Math.round(t[Vti[this.keywordIndex]]*this.emusPerPoint)),n=(e.writeAttributeString(void 0,"cx",void 0,n.toString()),Math.round(t[_ti[this.keywordIndex]]*this.emusPerPoint)),n=(e.writeAttributeString(void 0,"cy",void 0,n.toString()),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("a","prstGeom",this.aNamespace),i===(1==this.keywordIndex?3:"StraightConnector")?e.writeAttributeString(void 0,"prst",void 0,"straightConnector1"):i===(1==this.keywordIndex?2:"RoundedRectangle")?e.writeAttributeString(void 0,"prst",void 0,"roundRect"):"number"!=typeof i?e.writeAttributeString(void 0,"prst",void 0,this.getExportAutoShapeType(this.getAutoShapeTypeEnumValue(i))):e.writeAttributeString(void 0,"prst",void 0,this.getExportAutoShapeType(i)),e.writeStartElement("a","avLst",this.aNamespace),e.writeEndElement(),e.writeEndElement(),t[Wti[this.keywordIndex]]&&t[Wti[this.keywordIndex]][tii[this.keywordIndex]]&&Y.parseBoolValue(t[Wti[this.keywordIndex]][iii[this.keywordIndex]])?(e.writeStartElement("a","solidFill",this.aNamespace),e.writeStartElement("a","srgbClr",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,this.getColor(t[Wti[this.keywordIndex]][tii[this.keywordIndex]])),e.writeEndElement()):e.writeStartElement("a","noFill",this.aNamespace),e.writeEndElement(),t[jti[this.keywordIndex]][Qoi[this.keywordIndex]]?t[jti[this.keywordIndex]][Qoi[this.keywordIndex]]*this.emusPerPoint:this.emusPerPoint);e.writeStartElement("a","ln",this.aNamespace),e.writeAttributeString(void 0,"w",void 0,Math.round(n).toString()),!je(t[jti[this.keywordIndex]][joi[this.keywordIndex]])&&t[jti[this.keywordIndex]][joi[this.keywordIndex]]!==(1==this.keywordIndex?3:"None")&&Y.parseBoolValue(t[jti[this.keywordIndex]][Vei[this.keywordIndex]])?(e.writeStartElement("a","solidFill",this.aNamespace),e.writeStartElement("a","srgbClr",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,this.getColor(t[jti[this.keywordIndex]][tii[this.keywordIndex]])),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.writeStartElement("a","noFill",this.aNamespace),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),i!==(1==this.keywordIndex?1:"Rectangle")&&i!==(1==this.keywordIndex?2:"RoundedRectangle")||(e.writeStartElement("wps","txbx",this.wpShapeNamespace),e.writeStartElement(void 0,"txbxContent",this.wNamespace),this.serializeBodyItems(e,t[eii[this.keywordIndex]][_ni[this.keywordIndex]],!0),e.writeEndElement(),e.writeEndElement()),e.writeStartElement("wps","bodyPr",this.wpShapeNamespace),je(t[eii[this.keywordIndex]])||(n=void 0,0<=t[eii[this.keywordIndex]][V$t[this.keywordIndex]]&&(n=Math.round(t[eii[this.keywordIndex]][V$t[this.keywordIndex]]*this.emusPerPoint).toString(),e.writeAttributeString(void 0,"lIns",void 0,n)),0<=t[eii[this.keywordIndex]][H$t[this.keywordIndex]]&&(n=Math.round(t[eii[this.keywordIndex]][H$t[this.keywordIndex]]*this.emusPerPoint).toString(),e.writeAttributeString(void 0,"tIns",void 0,n)),0<=t[eii[this.keywordIndex]][_$t[this.keywordIndex]]&&(n=Math.round(t[eii[this.keywordIndex]][_$t[this.keywordIndex]]*this.emusPerPoint).toString(),e.writeAttributeString(void 0,"rIns",void 0,n)),0<=t[eii[this.keywordIndex]][z$t[this.keywordIndex]]&&(n=Math.round(t[eii[this.keywordIndex]][z$t[this.keywordIndex]]*this.emusPerPoint).toString(),e.writeAttributeString(void 0,"bIns",void 0,n)),t[eii[this.keywordIndex]][nii[this.keywordIndex]]&&(i=void 0,i=(1==this.keywordIndex?Y.getTextVerticalAlignment(t[eii[this.keywordIndex]][nii[this.keywordIndex]]):t[eii[this.keywordIndex]][nii[this.keywordIndex]]).toString().toLowerCase(),e.writeAttributeString(void 0,"anchor",void 0,this.getTextVerticalAlignmentProperty(i))),e.writeAttributeString(void 0,"anchorCtr",void 0,"0")),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeEndElement()},Hui.prototype.getTextVerticalAlignmentProperty=function(e){switch(e){case"top":return"t";case"middle":case"center":return"ctr";case"bottom":return"b";default:return e}},Hui.prototype.serializeShapeWrapStyle=function(e,t){var i,n=1==this.keywordIndex?this.getTextWrappingStyle(t[Qti[this.keywordIndex]]):t[Qti[this.keywordIndex]];"Inline"!==n&&(i="wrapNone",n&&"InFrontOfText"!==n&&"Behind"!==n&&(i="wrap"+n,"Tight"===n)&&(i="wrapSquare"),e.writeStartElement("wp",i,this.wpNamespace),n&&"InFrontOfText"!==n&&"Behind"!==n&&!je(t[Uti[this.keywordIndex]])&&(i=1==this.keywordIndex?this.getTextWrappingType(t[Uti[this.keywordIndex]]):"Both"===t[Uti[this.keywordIndex]]?"bothSides":t[Uti[this.keywordIndex]].toLowerCase(),e.writeAttributeString(void 0,"wrapText",void 0,i)),e.writeEndElement())},Hui.prototype.serializeDrawingGraphics=function(e,t){var i,n,o=this.getBase64ImageString(t),r=o.imageString,r=(Y.parseBoolValue(t[aii[this.keywordIndex]])&&".svg"!==(n=Y.formatClippedString(o.metaFileImageString).extension)&&(r=o.metaFileImageString),i=this.updateShapeId(t,!1),e.writeStartElement("wp","docPr",this.wpNamespace),e.writeAttributeString(void 0,"id",void 0,(this.mDocPrID++).toString()),je(t[Lti[this.keywordIndex]])||e.writeAttributeString(void 0,"descr",void 0,t[Lti[this.keywordIndex]]),e.writeAttributeString(void 0,"name",void 0,je(t[BZt[this.keywordIndex]])?"":t[BZt[this.keywordIndex]]),je(t[Jii[this.keywordIndex]])||e.writeAttributeString(void 0,"title",void 0,t[Jii[this.keywordIndex]]),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(r,"data:image")?e.writeAttributeString("r","embed",this.rNamespace,i):this.documentImages.containsKey(i)&&(this.documentImages.remove(i),this.externalImages.add(i,r),e.writeAttributeString(void 0,"link",this.rNamespace,i),!je(o.metaFileImageString))&&(this.startsWith(r,"https://")||this.startsWith(r,"http://")||this.startsWith(r,"file://"))&&(i=this.getNextRelationShipID(),this.documentImages.add(i,o.metaFileImageString),e.writeAttributeString("r","embed",this.rNamespace,i)),".svg"===n&&this.serializeBlipExtensions(e,t),e.writeEndElement(),(!je(t[lii[this.keywordIndex]])&&0!==t[lii[this.keywordIndex]]||!je(t[hii[this.keywordIndex]])&&0!==t[hii[this.keywordIndex]]||!je(t[pii[this.keywordIndex]])&&0!==t[pii[this.keywordIndex]]||!je(t[dii[this.keywordIndex]])&&0!==t[dii[this.keywordIndex]])&&(e.writeStartElement("a","srcRect",this.aNamespace),r=Math.round(1e3*t[pii[this.keywordIndex]]),e.writeAttributeString(void 0,"l",void 0,r.toString()),o=Math.round(1e3*t[lii[this.keywordIndex]]),e.writeAttributeString(void 0,"t",void 0,o.toString()),i=Math.round(1e3*t[dii[this.keywordIndex]]),e.writeAttributeString(void 0,"r",void 0,i.toString()),n=Math.round(1e3*t[hii[this.keywordIndex]]),e.writeAttributeString(void 0,"b",void 0,n.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),Math.round(t[Vti[this.keywordIndex]]*this.emusPerPoint)),o=(e.writeAttributeString(void 0,"cx",void 0,r.toString()),Math.round(t[_ti[this.keywordIndex]]*this.emusPerPoint));e.writeAttributeString(void 0,"cy",void 0,o.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()},Hui.prototype.serializeBlipExtensions=function(e,t){e.writeStartElement("a","extLst",this.aNamespace),e.writeStartElement("a","ext",this.aNamespace),e.writeAttributeString(void 0,"uri",void 0,"{96DAC541-7B7A-43D3-8B79-37D633B846F1}"),e.writeStartElement("asvg","svgBlip",this.svgNamespace);t=this.updateShapeId(t,!0);e.writeAttributeString("r","embed",void 0,t),e.writeEndElement(),e.writeEndElement(),e.writeEndElement()},Hui.prototype.updateShapeId=function(e,t){var i="",n=this.paragraph;return this.headerFooter?i=this.updateHFImageRels(this.headerFooter,e,t):""===i&&(n.hasOwnProperty(Gni[this.keywordIndex])||n.hasOwnProperty(qii[this.keywordIndex]))&&(i=this.addImageRelation(t?this.svgImages:this.documentImages,e,t)),i},Hui.prototype.addImageRelation=function(e,t,i){var n="";return(i?this.svgImageRelationIds:this.imageRelationIds).keys.indexOf(parseInt(t[oii[this.keywordIndex]]))<0||this.isHeaderFooter?(n=this.getNextRelationShipID(),(i?this.svgImageRelationIds:this.imageRelationIds).add(parseInt(t[oii[this.keywordIndex]]),n)):n=(i?this.svgImageRelationIds:this.imageRelationIds).get(parseInt(t[oii[this.keywordIndex]])),e.add(n,t),n},Hui.prototype.updateHFImageRels=function(e,t,i){for(var n="",o="",r=this.headersFooters.keys,s=0;s<r.length;s++)for(var a,l=this.headersFooters.get(r[s]),h=l.keys,d=0;d<h.length;d++)l.get(h[d])===e&&(o=h[d],a=void 0,i?this.headerFooterSvgImages.containsKey(o)?(a=this.headerFooterSvgImages.get(o),n=this.addImageRelation(a,t,!0)):(a=new uJt,n=this.addImageRelation(a,t,!0),this.headerFooterSvgImages.add(o,a)):this.headerFooterImages.containsKey(o)?(a=this.headerFooterImages.get(o),n=this.addImageRelation(a,t,!1)):(a=new uJt,n=this.addImageRelation(a,t,!1),this.headerFooterImages.add(o,a)));return n},Hui.prototype.serializeTable=function(e,t){if(je(this.keywordIndex)&&(this.keywordIndex=0),!(t[Ani[this.keywordIndex]].length<=0)){var i=this.table,n=(this.table=t,e.writeStartElement(void 0,"tbl",this.wNamespace),t[Ani[this.keywordIndex]][0][Cni[this.keywordIndex]]),o=(this.serializeTableFormat(e,n,t),this.serializeTableGrid(e,t),new uJt),r=new uJt,s=new uJt,a=t[Ani[this.keywordIndex]];if(0<a.length)for(var l=0;l<a.length;l++){var h=a[l];if(0<h[Sni[this.keywordIndex]].length)if(h.hasOwnProperty(Gii[this.keywordIndex]))this.serializeContentControl(e,h[Gii[this.keywordIndex]],h);else{for(var d=this.row,p=(this.row=h,e.writeStartElement(void 0,"tr",this.wNamespace),this.serializeRowFormat(e,h),h[Sni[this.keywordIndex]]),c=p.length,u=0,g=0;g<c;g++){var m=p[g],f=m[Yoi[this.keywordIndex]];if(m.hasOwnProperty(Gii[this.keywordIndex]))this.serializeContentControl(e,m[Gii[this.keywordIndex]],m);else{var y=m[wni[this.keywordIndex]];if(0<f-u)for(var v,b=0===g?0:u+1;b<f;b++)o.containsKey(b)&&(v=this.getMergeCellFormat(y,s.get(b),b<m[Yoi[this.keywordIndex]]),this.isVerticalMergeCell=!0,this.isBookmarkAtRowEnd=!0,this.serializeTableCell(e,m,v,!1),o.set(b,o.get(b)-1),1===o.get(b)&&(o.remove(b),s.remove(b),r.containsKey(b))&&r.remove(b),r.containsKey(b))&&(u+=r.get(b)-1,0<(b+=r.get(b)))&&b--;this.isVerticalMergeCell=!1,this.isBookmarkAtRowEnd=!1,u=f,1<y[oei[this.keywordIndex]]&&(o.add(f,y[oei[this.keywordIndex]]),s.add(f,y)),this.serializeTableCell(e,m,y,!0),1<y[nei[this.keywordIndex]]&&1<y[oei[this.keywordIndex]]&&r.add(f,y[nei[this.keywordIndex]]);for(var w=f+1;;w++)if(o.containsKey(w)){var C=this.getMergeCellFormat(y,s.get(w),w<m[Yoi[this.keywordIndex]]);this.serializeTableCell(e,m,C,!1),o.set(w,o.get(w)-1),u++,1===o.get(w)&&(o.remove(w),s.remove(w),r.containsKey(w))&&r.remove(w),r.containsKey(w)&&(u+=r.get(w)-1,w+=r.get(w))}else if(!(g===c-1&&w<t[eri[this.keywordIndex]]))break}}this.isBookmarkAtRowEnd||e.writeEndElement(),this.isBookmarkAtRowEnd=!1,this.row=d}}e.writeEndElement(),this.table=i}},Hui.prototype.getMergeCellFormat=function(e,t,i){return i?t[k$t[this.keywordIndex]][dii[this.keywordIndex]]=e[k$t[this.keywordIndex]][pii[this.keywordIndex]]:t[k$t[this.keywordIndex]][pii[this.keywordIndex]]=e[k$t[this.keywordIndex]][dii[this.keywordIndex]],t},Hui.prototype.serializeTableCell=function(e,t,i,n){var o,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[k$t[this.keywordIndex]],8,!1),e.writeEndElement(),this.serializeShading(e,t[wni[this.keywordIndex]][yei[this.keywordIndex]]),this.serializeTableCellDirection(e,i),this.serializeCellVerticalAlign(e,i[rei[this.keywordIndex]]),1<i[nei[this.keywordIndex]]&&(o=i[nei[this.keywordIndex]],e.writeStartElement(void 0,"gridSpan",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,o.toString()),e.writeEndElement()),1<i[oei[this.keywordIndex]]&&(e.writeStartElement(void 0,"vMerge",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,n?"restart":"continue"),e.writeEndElement()),e.writeEndElement(),t&&0<t[_ni[this.keywordIndex]].length)for(var s,a=0;a<t[_ni[this.keywordIndex]].length;)s=t[_ni[this.keywordIndex]][a],this.serializeBodyItem(e,s,!1),a+=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();this.isBookmarkAtRowEnd&&!this.isVerticalMergeCell||e.writeEndElement(),this.blockOwner=r},Hui.prototype.serializeTableGrid=function(e,t){e.writeStartElement(void 0,"tblGrid",this.wNamespace),0!==t[$oi[this.keywordIndex]].length&&this.serializeGridColumns(e,t[$oi[this.keywordIndex]]),e.writeEndElement()},Hui.prototype.serializeTableRows=function(e,t){var i=new uJt;if(0<t.length)for(var n=0;n<t.length;n++){var o=t[n];0<o[Sni[this.keywordIndex]].length&&(o.hasOwnProperty(Gii[this.keywordIndex])?this.serializeContentControl(e,o[Gii[this.keywordIndex]],o):this.serializeRow(e,o,i))}},Hui.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[Sni[this.keywordIndex]],i),this.isBookmarkAtRowEnd||e.writeEndElement(),this.isBookmarkAtRowEnd=!1,this.row=n},Hui.prototype.serializeRowFormat=function(e,t){this.serializeRowMargins(e,t[Cni[this.keywordIndex]]),e.writeStartElement(void 0,"trPr",this.wNamespace),0<t[Cni[this.keywordIndex]][_ti[this.keywordIndex]]&&(e.writeStartElement(void 0,"trHeight",this.wNamespace),t[Cni[this.keywordIndex]][lei[this.keywordIndex]]===(1==this.keywordIndex?1:"Exactly")?e.writeAttributeString("w","hRule",this.wNamespace,"exact"):t[Cni[this.keywordIndex]][lei[this.keywordIndex]]===(1==this.keywordIndex?0:"AtLeast")&&e.writeAttributeString("w","hRule",this.wNamespace,"atLeast"),n=this.roundToTwoDecimal(t[Cni[this.keywordIndex]][_ti[this.keywordIndex]]*this.twentiethOfPoint).toString(),e.writeAttributeString("w","val",this.wNamespace,n),e.writeEndElement());var i=t[Cni[this.keywordIndex]],n=i[hei[this.keywordIndex]],t=(0<n&&(e.writeStartElement(void 0,"gridBefore",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,n.toString()),e.writeEndElement()),i[cei[this.keywordIndex]]);if(0<t&&(e.writeStartElement(void 0,"gridAfter",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,t.toString()),e.writeEndElement()),0<n){switch(e.writeStartElement(void 0,"wBefore",this.wNamespace),i[pei[this.keywordIndex]]){case"Percent":case 1:var o=this.roundToTwoDecimal(i[dei[this.keywordIndex]]*this.percentageFactor).toString();e.writeAttributeString("w","w",this.wNamespace,o),e.writeAttributeString("w","type",this.wNamespace,"pct");break;case"Point":case 2:var r=this.roundToTwoDecimal(i[dei[this.keywordIndex]]*this.twipsInOnePoint).toString();e.writeAttributeString("w","w",this.wNamespace,r),e.writeAttributeString("w","type",this.wNamespace,"dxa")}e.writeEndElement()}if(0<t){switch(e.writeStartElement(void 0,"wAfter",this.wNamespace),i[gei[this.keywordIndex]]){case"Percent":case 1:o=this.roundToTwoDecimal(i[uei[this.keywordIndex]]*this.percentageFactor).toString();e.writeAttributeString("w","val",this.wNamespace,o),e.writeAttributeString("w","type",this.wNamespace,"pct");break;case"Point":case 2:r=this.roundToTwoDecimal(i[uei[this.keywordIndex]]*this.twipsInOnePoint).toString();e.writeAttributeString("w","val",this.wNamespace,r),e.writeAttributeString("w","type",this.wNamespace,"dxa")}e.writeEndElement()}je(i[sei[this.keywordIndex]])||Y.parseBoolValue(i[sei[this.keywordIndex]])||(e.writeStartElement(void 0,"cantSplit",this.wNamespace),e.writeEndElement()),Y.parseBoolValue(i[aei[this.keywordIndex]])&&(e.writeStartElement(void 0,"tblHeader",this.wNamespace),e.writeEndElement()),!je(i[h$t[this.keywordIndex]])&&0<i[h$t[this.keywordIndex]].length&&(this.serializeRevisionStart(e,i,void 0),this.serializeRevisionEnd(e,i,void 0)),e.writeEndElement()},Hui.prototype.serializeCells=function(e,t,i){for(var n=0;n<t.length;n++)t[n].hasOwnProperty(Gii[this.keywordIndex])?this.serializeContentControl(e,t[n][Gii[this.keywordIndex]],t[n]):this.serializeCell(e,t[n],i)},Hui.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[wni[this.keywordIndex]],!0,!0,i),0<t[_ni[this.keywordIndex]].length)for(var o,r=0;r<t[_ni[this.keywordIndex]].length;)o=t[_ni[this.keywordIndex]][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();this.isBookmarkAtRowEnd||e.writeEndElement();var s=1;if(i.containsKey(t[Yoi[this.keywordIndex]]+t[wni[this.keywordIndex]][nei[this.keywordIndex]]-1+s)&&1===this.row[Sni[this.keywordIndex]].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},Hui.prototype.createCellForMerge=function(e,t,i,n){for(;i.containsKey(t[Yoi[this.keywordIndex]]+t[wni[this.keywordIndex]][nei[this.keywordIndex]]-1+n)&&(this.row[Sni[this.keywordIndex]].indexOf(t)===this.row[Sni[this.keywordIndex]].length-1||this.row[Sni[this.keywordIndex]].indexOf(t)===t[Yoi[this.keywordIndex]])&&void 0===t.nextNode;){var o=t[Yoi[this.keywordIndex]]+t[wni[this.keywordIndex]][nei[this.keywordIndex]]-1+n,r=(e.writeStartElement(void 0,"tc",this.wNamespace),!0);je(this.spanCellFormat)?(e.writeStartElement(void 0,"tcPr",this.wNamespace),r=!1):i=this.serializeCellFormat(e,this.spanCellFormat,r=!1,r,i),this.serializeColumnSpan(o,e),e.writeStartElement(void 0,"vMerge",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,"continue"),e.writeEndElement(),je(this.spanCellFormat)&&(e.writeStartElement(void 0,"tcBorders",this.wNamespace),this.serializeBorders(e,t[wni[this.keywordIndex]][k$t[this.keywordIndex]],8,!1),e.writeEndElement()),r||e.writeEndElement(),i=this.checkMergeCell(o,i),e.writeStartElement("w","p",this.wNamespace),e.writeEndElement(),e.writeEndElement(),n++}return n},Hui.prototype.serializeCellFormat=function(e,t,i,n,o){var r=this.blockOwner;this.table[Dni[this.keywordIndex]],this.row[Cni[this.keywordIndex]];return e.writeStartElement(void 0,"tcPr",this.wNamespace),this.serializeCellWidth(e,t),this.serializeCellMargins(e,t),i&&(o=this.serializeCellMerge(e,t,o),this.serializeGridSpan(e,r)),e.writeStartElement(void 0,"tcBorders",this.wNamespace),this.serializeBorders(e,t[k$t[this.keywordIndex]],8,!1),e.writeEndElement(),this.serializeShading(e,r[wni[this.keywordIndex]][yei[this.keywordIndex]]),this.serializeTableCellDirection(e,t),this.serializeCellVerticalAlign(e,t[rei[this.keywordIndex]]),n&&e.writeEndElement(),o},Hui.prototype.serializeCellWidth=function(e,t){e.writeStartElement(void 0,"tcW",this.wNamespace),t[wei[this.keywordIndex]]===(1==this.keywordIndex?1:"Percent")?(e.writeAttributeString(void 0,"type",this.wNamespace,"pct"),e.writeAttributeString(void 0,"w",this.wNamespace,this.roundToTwoDecimal(t[bei[this.keywordIndex]]*this.percentageFactor).toString())):t[wei[this.keywordIndex]]===(1==this.keywordIndex?0:"Auto")?(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[bei[this.keywordIndex]]*this.twipsInOnePoint).toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa")),e.writeEndElement()},Hui.prototype.serializeCellMerge=function(e,t,i){var n,o=this.blockOwner,r=!1,s=o[Yoi[this.keywordIndex]],a=this.row[Sni[this.keywordIndex]].indexOf(o),l=(0<a?this.row[Sni[this.keywordIndex]][a-1]:o)[Yoi[this.keywordIndex]];if(!(r=o[Yoi[this.keywordIndex]]===a&&(n=o[Yoi[this.keywordIndex]],!0))){0===a&&(s=o[Yoi[this.keywordIndex]],l=-1);for(var h=l;h<s;h++)n=l+1,l+=1,0===n&&i.containsKey(n)&&(i=this.createMerge(e,n,o,i))}return 1<t[oei[this.keywordIndex]]?(e.writeStartElement(void 0,"vMerge",this.wNamespace),this.spanCellFormat=t,i.add(n,t[oei[this.keywordIndex]]-1),1<t[nei[this.keywordIndex]]&&this.mGridSpans.add(n,t[nei[this.keywordIndex]]),e.writeAttributeString("w","val",this.wNamespace,"restart"),e.writeEndElement()):i.containsKey(n)&&r&&(i=this.createMerge(e,n,o,i)),i},Hui.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[wni[this.keywordIndex]][k$t[this.keywordIndex]],8,!1),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[wni[this.keywordIndex]]),n=this.checkMergeCell(t,n)},Hui.prototype.serializeColumnSpan=function(e,t){0<this.mGridSpans.keys.length&&this.mGridSpans.containsKey(e)&&(t.writeStartElement(void 0,"gridSpan",this.wNamespace),t.writeAttributeString("w","val",this.wNamespace,this.mGridSpans.get(e).toString()),t.writeEndElement())},Hui.prototype.checkMergeCell=function(e,t){return t.get(e)-1==0?(t.remove(e),this.spanCellFormat=void 0,0<this.mGridSpans.keys.length&&this.mGridSpans.containsKey(e)&&this.mGridSpans.remove(e)):t.set(e,t.get(e)-1),t},Hui.prototype.serializeGridSpan=function(e,t){1<t[wni[this.keywordIndex]][nei[this.keywordIndex]]&&(t=t[wni[this.keywordIndex]][nei[this.keywordIndex]],e.writeStartElement(void 0,"gridSpan",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,t.toString()),e.writeEndElement())},Hui.prototype.serializeTableCellDirection=function(e,t){},Hui.prototype.serializeCellVerticalAlign=function(e,t){switch(e.writeStartElement(void 0,"vAlign",this.wNamespace),t){case"Center":case 1:e.writeAttributeString("w","val",this.wNamespace,"center");break;case"Bottom":case 2:e.writeAttributeString("w","val",this.wNamespace,"bottom");break;default:e.writeAttributeString("w","val",this.wNamespace,"top")}e.writeEndElement()},Hui.prototype.serializeGridColumns=function(e,t){for(var i=0,n=t.length;i<n;i++){var o=Math.round(20*t[i]);e.writeStartElement(void 0,"gridCol",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,o.toString()),e.writeEndElement()}},Hui.prototype.serializeTableFormat=function(e,t,i){e.writeStartElement(void 0,"tblPr",this.wNamespace),je(i[Dni[this.keywordIndex]][KZt[this.keywordIndex]])||(e.writeStartElement(void 0,"tblStyle",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,i[Dni[this.keywordIndex]][KZt[this.keywordIndex]]),e.writeEndElement()),this.serializeTablePositioning(e,i),this.serializeTableWidth(e,i),this.serializeTableAlignment(e,i[Dni[this.keywordIndex]]),this.serializeCellSpacing(e,i[Dni[this.keywordIndex]]),this.serializeTableIndentation(e,i[Dni[this.keywordIndex]]),this.serializeTableMargins(e,i[Dni[this.keywordIndex]]),this.serializeTableBorders(e,i[Dni[this.keywordIndex]]),this.serializeShading(e,i[Dni[this.keywordIndex]][yei[this.keywordIndex]]),Y.parseBoolValue(i[Dni[this.keywordIndex]][JZt[this.keywordIndex]])&&(e.writeStartElement(void 0,"bidiVisual",this.wNamespace),e.writeEndElement()),this.serializeTblLayout(e,i[Dni[this.keywordIndex]]),je(i)||e.writeEndElement()},Hui.prototype.serializeTablePositioning=function(e,t){var i;Y.parseBoolValue(t[Ini[this.keywordIndex]])&&(e.writeStartElement("w","tblpPr",this.wNamespace),0<t[Eni[this.keywordIndex]][Bni[this.keywordIndex]]&&(i=Math.round(t[Eni[this.keywordIndex]][Bni[this.keywordIndex]]*this.twipsInOnePoint).toString(),e.writeAttributeString("w","leftFromText",this.wNamespace,i)),0<t[Eni[this.keywordIndex]][Pni[this.keywordIndex]]&&(i=Math.round(t[Eni[this.keywordIndex]][Pni[this.keywordIndex]]*this.twipsInOnePoint).toString(),e.writeAttributeString("w","rightFromText",this.wNamespace,i)),0<t[Eni[this.keywordIndex]][kni[this.keywordIndex]]&&(i=Math.round(t[Eni[this.keywordIndex]][kni[this.keywordIndex]]*this.twipsInOnePoint).toString(),e.writeAttributeString("w","topFromText",this.wNamespace,i)),0<t[Eni[this.keywordIndex]][Fni[this.keywordIndex]]&&(i=Math.round(t[Eni[this.keywordIndex]][Fni[this.keywordIndex]]*this.twipsInOnePoint).toString(),e.writeAttributeString("w","bottomFromText",this.wNamespace,i)),je(t[Eni[this.keywordIndex]][Lni[this.keywordIndex]])||(i=t[Eni[this.keywordIndex]][Lni[this.keywordIndex]]===(1==this.keywordIndex?0:"Paragraph")?"text":(1==this.keywordIndex?this.getTableVerticalRelation(t[Eni[this.keywordIndex]][Lni[this.keywordIndex]]):this.getTableVerticalRelation(this.getTableVerticalRelationEnumValue(t[Eni[this.keywordIndex]][Lni[this.keywordIndex]]))).toLowerCase(),e.writeAttributeString("w","vertAnchor",this.wNamespace,i)),je(t[Eni[this.keywordIndex]][Oni[this.keywordIndex]])||t[Eni[this.keywordIndex]][Oni[this.keywordIndex]]===(1==this.keywordIndex?0:"Column")||(i=(1==this.keywordIndex?this.getTableHorizontalRelation(t[Eni[this.keywordIndex]][Oni[this.keywordIndex]]):t[Eni[this.keywordIndex]][Oni[this.keywordIndex]]).toLowerCase(),e.writeAttributeString("w","horzAnchor",this.wNamespace,i)),je(t[Eni[this.keywordIndex]][Nni[this.keywordIndex]])||t[Eni[this.keywordIndex]][Nni[this.keywordIndex]]===(1==this.keywordIndex?0:"Left")||(i=1==this.keywordIndex?this.getTableHorizontalAlignment(t[Eni[this.keywordIndex]][Nni[this.keywordIndex]]):t[Eni[this.keywordIndex]][Nni[this.keywordIndex]].toLowerCase(),e.writeAttributeString("w","tblpXSpec",this.wNamespace,i)),je(t[Eni[this.keywordIndex]][rei[this.keywordIndex]])||t[Eni[this.keywordIndex]][rei[this.keywordIndex]]===(1==this.keywordIndex?0:"None")||(i=1==this.keywordIndex?this.getTableVerticalAlignment(t[Eni[this.keywordIndex]][rei[this.keywordIndex]]):t[Eni[this.keywordIndex]][rei[this.keywordIndex]].toLowerCase(),e.writeAttributeString("w","tblpYSpec",this.wNamespace,i)),(!je(t[Eni[this.keywordIndex]][Nni[this.keywordIndex]])&&t[Eni[this.keywordIndex]][Nni[this.keywordIndex]]===(1==this.keywordIndex?0:"Left")||!t[Eni[this.keywordIndex]][Nni[this.keywordIndex]])&&0<t[Eni[this.keywordIndex]][Vni[this.keywordIndex]]&&(i=Math.round(t[Eni[this.keywordIndex]][Vni[this.keywordIndex]]*this.twipsInOnePoint).toString(),e.writeAttributeString("w","tblpX",this.wNamespace,i)),je(t[Eni[this.keywordIndex]][rei[this.keywordIndex]])||t[Eni[this.keywordIndex]][rei[this.keywordIndex]]!==(1==this.keywordIndex?0:"None")||(i=Math.round(t[Eni[this.keywordIndex]][Rni[this.keywordIndex]]*this.twipsInOnePoint).toString(),e.writeAttributeString("w","tblpY",this.wNamespace,i)),e.writeEndElement(),Y.parseBoolValue(t[Eni[this.keywordIndex]][Mni[this.keywordIndex]])||(e.writeStartElement("w","tblOverlap",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,"never"),e.writeEndElement())),je(t[xni[this.keywordIndex]])||(e.writeStartElement("w","tblDescription",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,t[xni[this.keywordIndex]]),e.writeEndElement()),je(t[Jii[this.keywordIndex]])||(e.writeStartElement("w","tblCaption",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,t[Jii[this.keywordIndex]]),e.writeEndElement())},Hui.prototype.serializeTableMargins=function(e,t){this.serializeMargins(e,t,"tblCellMar")},Hui.prototype.serializeRowMargins=function(e,t){e.writeStartElement(void 0,"tblPrEx",this.wNamespace),e.writeStartElement(void 0,"tblBorders",this.wNamespace),this.serializeBorders(e,t[k$t[this.keywordIndex]],8,!1),e.writeEndElement(),this.serializeMargins(e,t,"tblCellMar"),e.writeEndElement()},Hui.prototype.serializeCellMargins=function(e,t){this.serializeMargins(e,t,"tcMar")},Hui.prototype.serializeMargins=function(e,t,i){void 0===t[H$t[this.keywordIndex]]&&void 0===t[V$t[this.keywordIndex]]&&void 0===t[z$t[this.keywordIndex]]&&void 0===t[_$t[this.keywordIndex]]||(e.writeStartElement(void 0,i,this.wNamespace),je(t[H$t[this.keywordIndex]])||(i=Math.round(20*t[H$t[this.keywordIndex]]),e.writeStartElement(void 0,"top",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,i.toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa"),e.writeEndElement()),je(t[V$t[this.keywordIndex]])||(i=Math.round(20*t[V$t[this.keywordIndex]]),e.writeStartElement(void 0,"left",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,i.toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa"),e.writeEndElement()),je(t[z$t[this.keywordIndex]])||(i=Math.round(20*t[z$t[this.keywordIndex]]),e.writeStartElement(void 0,"bottom",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,i.toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa"),e.writeEndElement()),je(t[_$t[this.keywordIndex]])||(i=Math.round(20*t[_$t[this.keywordIndex]]),e.writeStartElement(void 0,"right",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,i.toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa"),e.writeEndElement()),e.writeEndElement())},Hui.prototype.serializeShading=function(e,t){e.writeStartElement(void 0,"shd",this.wNamespace),t[Aei[this.keywordIndex]]&&"empty"!==t[Aei[this.keywordIndex]]?e.writeAttributeString(void 0,"fill",this.wNamespace,this.getColor(t[Aei[this.keywordIndex]])):e.writeAttributeString(void 0,"fill",this.wNamespace,"auto"),"empty"===t[xei[this.keywordIndex]]||je(t[xei[this.keywordIndex]])?e.writeAttributeString(void 0,"color",this.wNamespace,"auto"):e.writeAttributeString(void 0,"color",this.wNamespace,this.getColor(t[xei[this.keywordIndex]])),je(t[Sei[this.keywordIndex]])||e.writeAttributeString("w","val",this.wNamespace,this.getTextureStyle(t[Sei[this.keywordIndex]])),e.writeEndElement()},Hui.prototype.getTextureStyle=function(e){switch(e){case"Texture5Percent":case"Texture2Pt5Percent":case"Texture7Pt5Percent":case 1:case 2:case 3:return"pct5";case"Texture10Percent":case 4:return"pct10";case"Texture12Pt5Percent":case 5:return"pct12";case"Texture15Percent":case"Texture17Pt5Percent":case 6:case 7:return"pct15";case"Texture20Percent":case"Texture22Pt5Percent":case 8:case 9:return"pct20";case"Texture25Percent":case"Texture27Pt5Percent":case 10:case 11:return"pct25";case"Texture30Percent":case"Texture32Pt5Percent":case 12:case 13:return"pct30";case"Texture35Percent":case 14:return"pct35";case"Texture37Pt5Percent":case 15:return"pct37";case"Texture40Percent":case"Texture42Pt5Percent":case 16:case 17:return"pct40";case"Texture45Percent":case"Texture47Pt5Percent":case 18:case 19:return"pct45";case"Texture50Percent":case"Texture52Pt5Percent":case 20:case 21:return"pct50";case"Texture55Percent":case"Texture57Pt5Percent":case 22:case 23:return"pct55";case"Texture60Percent":case 24:return"pct60";case"Texture62Pt5Percent":case 25:return"pct62";case"Texture65Percent":case"Texture67Pt5Percent":case 26:case 27:return"pct65";case"Texture70Percent":case"Texture72Pt5Percent":case 28:case 29:return"pct70";case"Texture75Percent":case"Texture77Pt5Percent":case 30:case 31:return"pct75";case"Texture80Percent":case"Texture82Pt5Percent":case 32:case 33:return"pct80";case"Texture85Percent":case 34:return"pct85";case"Texture87Pt5Percent":case 35:return"pct87";case"Texture90Percent":case"Texture92Pt5Percent":case 36:case 37:return"pct90";case"Texture95Percent":case"Texture97Pt5Percent":case 38:case 39:return"pct95";case 40:return"solid";case"TextureCross":return"thinHorzCross";case"TextureDarkCross":return"horzCross";case"TextureDarkDiagonalCross":return"diagCross";case"TextureDarkDiagonalDown":return"reverseDiagStripe";case"TextureDarkDiagonalUp":return"diagStripe";case"TextureDarkHorizontal":case 41:return"horzStripe";case"TextureDarkVertical":case 42:return"vertStripe";case 43:return"reverseDiagStripe";case 44:return"diagStripe";case 45:return"horzCross";case 46:return"diagCross";case"TextureDiagonalCross":return"thinDiagCross";case"TextureDiagonalDown":return"thinReverseDiagStripe";case"TextureDiagonalUp":return"thinDiagStripe";case"TextureHorizontal":case 47:return"thinHorzStripe";case"TextureSolid":return"solid";case"TextureVertical":case 48:return"thinVertStripe";case 49:return"thinReverseDiagStripe";case 50:return"thinDiagStripe";case 51:return"thinHorzCross";case 52:return"thinDiagCross";default:return"clear"}},Hui.prototype.serializeParagraphBorders=function(e,t){je(t[k$t[this.keywordIndex]])||(e.writeStartElement(void 0,"pBdr",this.wNamespace),this.serializeBorders(e,t[k$t[this.keywordIndex]],8,!0),e.writeEndElement())},Hui.prototype.serializeTableBorders=function(e,t){je(t[k$t[this.keywordIndex]])||(e.writeStartElement(void 0,"tblBorders",this.wNamespace),this.serializeBorders(e,t[k$t[this.keywordIndex]],8,!1),e.writeEndElement())},Hui.prototype.serializeBorders=function(e,t,i,n){this.serializeBorder(e,t[lii[this.keywordIndex]],"top",i),this.serializeBorder(e,t[pii[this.keywordIndex]],"left",i),this.serializeBorder(e,t[hii[this.keywordIndex]],"bottom",i),this.serializeBorder(e,t[dii[this.keywordIndex]],"right",i),n?(this.serializeBorder(e,t[Dei[this.keywordIndex]],"between",i),this.serializeBorder(e,t[Eei[this.keywordIndex]],"bar",i)):(this.serializeBorder(e,t[Dei[this.keywordIndex]],"insideH",i),this.serializeBorder(e,t[Eei[this.keywordIndex]],"insideV",i),this.serializeBorder(e,t[kei[this.keywordIndex]],"tl2br",i),this.serializeBorder(e,t[Mei[this.keywordIndex]],"tr2bl",i))},Hui.prototype.serializeTblLayout=function(e,t){(!Y.parseBoolValue(t[mei[this.keywordIndex]])||t[bei[this.keywordIndex]]>this.containerWidth)&&(e.writeStartElement(void 0,"tblLayout",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"fixed"),e.writeEndElement())},Hui.prototype.serializeBorder=function(e,t,i,n){var o=t[Pei[this.keywordIndex]],n=(t[Bei[this.keywordIndex]]||0)*n,r=t[Coi[this.keywordIndex]]||0;o===(1==this.keywordIndex?26:"Cleared")?(e.writeStartElement(void 0,i,this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,"nil"),e.writeEndElement()):(o===(1==this.keywordIndex?1:"None")||je(o))&&!Y.parseBoolValue(t[Tei[this.keywordIndex]])||n<0&&!Y.parseBoolValue(t[Tei[this.keywordIndex]])||(e.writeStartElement(void 0,i,this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,this.getBorderStyle(o)),t[tii[this.keywordIndex]]&&e.writeAttributeString(void 0,"color",this.wNamespace,this.getColor(t[tii[this.keywordIndex]])),e.writeAttributeString(void 0,"sz",this.wNamespace,this.roundToTwoDecimal(n).toString()),e.writeAttributeString(void 0,"space",this.wNamespace,r.toString()),Y.parseBoolValue(t[Iei[this.keywordIndex]])&&e.writeAttributeString(void 0,"shadow",this.wNamespace,"on"),e.writeEndElement())},Hui.prototype.getBorderStyle=function(e){switch(e){case"Cleared":return"cleared";case"None":case 1:return"none";case"DashSmallGap":return"dashSmallGap";case"Triple":return"triple";case"Dot":case 2:return"dotted";case 3:return"dashSmallGap";case"DashDot":return"dotDash";case"DashLargeGap":case 4:return"dashed";case 5:return"dotDash";case"DashDotDot":case 6:return"dotDotDash";case"Double":case 7:return"double";case 8:return"triple";case"ThinThickSmallGap":case 9:return"thinThickSmallGap";case"ThickThinSmallGap":case 10:return"thickThinSmallGap";case"ThinThickThinSmallGap":case 11:return"thinThickThinSmallGap";case"ThickThinMediumGap":case 12:return"thickThinMediumGap";case"ThinThickMediumGap":case 13:return"thinThickMediumGap";case"ThinThickThinMediumGap":case 14:return"thinThickThinMediumGap";case"ThickThinLargeGap":return"thickThinLargeGap";case"ThinThickLargeGap":case 15:return"thinThickLargeGap";case 16:return"thickThinLargeGap";case"ThinThickThinLargeGap":case 17:return"thinThickThinLargeGap";case"Thick":return"thick";case"SingleWavy":case 18:return"wave";case"DoubleWavy":case 19:return"doubleWave";case"DashDotStroked":case 20:return"dashDotStroked";case"Engrave3D":return"threeDEngrave";case"Emboss3D":case 21:return"threeDEmboss";case 22:return"threeDEngrave";case"Outset":case 23:return"outset";case"Inset":case 24:return"inset";case 25:return"thick";case 26:return"cleared";default:return"single"}},Hui.prototype.serializeTableIndentation=function(e,t){je(t[g$t[this.keywordIndex]])||(e.writeStartElement(void 0,"tblInd",this.wNamespace),t=Math.round(t[g$t[this.keywordIndex]]*this.twipsInOnePoint),e.writeAttributeString(void 0,"w",this.wNamespace,t.toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa"),e.writeEndElement())},Hui.prototype.serializeCellSpacing=function(e,t){!je(t[fei[this.keywordIndex]])&&0<t[fei[this.keywordIndex]]&&(e.writeStartElement(void 0,"tblCellSpacing",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,this.roundToTwoDecimal(t[fei[this.keywordIndex]]/2*this.twentiethOfPoint).toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa"),e.writeEndElement())},Hui.prototype.serializeTableWidth=function(e,t){var i;e.writeStartElement(void 0,"tblW",this.wNamespace),t[Dni[this.keywordIndex]][wei[this.keywordIndex]]===(1==this.keywordIndex?1:"Percent")?(i=Math.round(t[Dni[this.keywordIndex]][bei[this.keywordIndex]]*this.percentageFactor),e.writeAttributeString(void 0,"w",this.wNamespace,i.toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"pct")):t[Dni[this.keywordIndex]][wei[this.keywordIndex]]===(1==this.keywordIndex?2:"Point")?(i=Math.round(t[Dni[this.keywordIndex]][bei[this.keywordIndex]]*this.twipsInOnePoint),e.writeAttributeString(void 0,"w",this.wNamespace,i.toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa")):(e.writeAttributeString(void 0,"w",this.wNamespace,"0"),e.writeAttributeString(void 0,"type",this.wNamespace,"auto")),e.writeEndElement()},Hui.prototype.serializeTableAlignment=function(e,t){switch(e.writeStartElement(void 0,"jc",this.wNamespace),t[vei[this.keywordIndex]]){case"Right":e.writeAttributeString("w","val",this.wNamespace,"right");break;case"Center":case 1:e.writeAttributeString("w","val",this.wNamespace,"center");break;case 2:e.writeAttributeString("w","val",this.wNamespace,"right");break;default:e.writeAttributeString("w","val",this.wNamespace,"left")}e.writeEndElement()},Hui.prototype.serializeFieldCharacter=function(e,t){e.writeStartElement(void 0,"r",this.wNamespace),this.serializeCharacterFormat(e,t[aZt[this.keywordIndex]]),e.writeStartElement(void 0,"fldChar",this.wNamespace);var i=0===t[fii[this.keywordIndex]]?"begin":1===t[fii[this.keywordIndex]]?"end":"separate";if(e.writeAttributeString(void 0,"fldCharType",this.wNamespace,i),"begin"==i&&!je(t[mii[this.keywordIndex]])){var n=t[mii[this.keywordIndex]];if(e.writeStartElement(void 0,"ffData",this.wNamespace),e.writeStartElement(void 0,"name",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,n[BZt[this.keywordIndex]]),e.writeEndElement(),e.writeStartElement(void 0,"enabled",this.wNamespace),e.writeEndElement(),n.hasOwnProperty(wii[this.keywordIndex])){e.writeStartElement(void 0,"textInput",this.wNamespace);i=1==this.keywordIndex?this.getTextFormFieldType(n[wii[this.keywordIndex]][koi[this.keywordIndex]]):n[wii[this.keywordIndex]][koi[this.keywordIndex]].toString();e.writeStartElement(void 0,"type",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,"Calculation"==i?"calculated":i.toLowerCase()),e.writeEndElement(),e.writeStartElement(void 0,"default",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,n[wii[this.keywordIndex]][xii[this.keywordIndex]]),e.writeEndElement(),e.writeStartElement(void 0,"format",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,1==this.keywordIndex&&"Text"===i?this.getTextFormFieldFormat(n[wii[this.keywordIndex]][Iii[this.keywordIndex]]):n[wii[this.keywordIndex]][Iii[this.keywordIndex]]),e.writeEndElement()}else if(n.hasOwnProperty(Cii[this.keywordIndex]))e.writeStartElement(void 0,"checkBox",this.wNamespace),n[Cii[this.keywordIndex]][Tii[this.keywordIndex]]===(1==this.keywordIndex?0:"Auto")?e.writeStartElement(void 0,"sizeAuto",this.wNamespace):(e.writeStartElement(void 0,"size",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,this.roundToTwoDecimal(2*n[Cii[this.keywordIndex]][Eii[this.keywordIndex]]).toString())),e.writeEndElement(),e.writeStartElement(void 0,"defalut",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,n[Cii[this.keywordIndex]][xii[this.keywordIndex]]?"1":"0"),e.writeEndElement(),n[Cii[this.keywordIndex]][Dii[this.keywordIndex]]&&(e.writeStartElement(void 0,"checked",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,n[Cii[this.keywordIndex]][Dii[this.keywordIndex]]?"1":"0"),e.writeEndElement());else{e.writeStartElement(void 0,"ddList",this.wNamespace),0!==n[Sii[this.keywordIndex]][kii[this.keywordIndex]]&&(e.writeStartElement(void 0,"result",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,n[Sii[this.keywordIndex]][kii[this.keywordIndex]].toString()),e.writeEndElement());for(var o=0;o<n[Sii[this.keywordIndex]][Mii[this.keywordIndex]].length;o++)e.writeStartElement(void 0,"listEntry",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,n[Sii[this.keywordIndex]][Mii[this.keywordIndex]][o].toString()),e.writeEndElement()}e.writeEndElement(),e.writeEndElement()}e.writeEndElement(),e.writeEndElement(),0===t[fii[this.keywordIndex]]&&"FieldFormTextInput"===t[fii[this.keywordIndex]]&&(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())},Hui.prototype.serializeTextRange=function(e,t,i,n){e.writeStartElement("w","r",this.wNamespace),je(t[aZt[this.keywordIndex]])||this.serializeCharacterFormat(e,t[aZt[this.keywordIndex]]),"\t"===t[Bti[this.keywordIndex]]?e.writeElementString(void 0,"tab",this.wNamespace,void 0):"\v"===t[Bti[this.keywordIndex]]?e.writeElementString(void 0,"br",this.wNamespace,void 0):(je(t[$Zt[this.keywordIndex]])?"\f"===t[Bti[this.keywordIndex]]?(e.writeStartElement(void 0,"br",this.wNamespace),e.writeAttributeString("w","type",this.wNamespace,"page")):"\r"===t[Bti[this.keywordIndex]]?e.writeStartElement("w","cr",this.wNamespace):t[Bti[this.keywordIndex]]===String.fromCharCode(14)?(e.writeStartElement(void 0,"br",this.wNamespace),e.writeAttributeString("w","type",this.wNamespace,"column")):"%02"===encodeURI(t[Bti[this.keywordIndex]])?e.writeStartElement(void 0,"footnoteRef",this.wNamespace):"%02"===encodeURI(t[Bti[this.keywordIndex]])&&"endnote"===n?e.writeStartElement(void 0,"endnoteRef",this.wNamespace):"%03"===encodeURI(t[Bti[this.keywordIndex]])?e.writeStartElement(void 0,"separator",this.wNamespace):"%04"===encodeURI(t[Bti[this.keywordIndex]])?e.writeStartElement(void 0,"continuationSeparator",this.wNamespace):(n=this.retrieveDeleteRevision(t),i=!je(i)&&i.hasOwnProperty(fii[this.keywordIndex])&&2!==i[fii[this.keywordIndex]],e.writeStartElement(void 0,i?n?"delInstrText":"instrText":n?"delText":"t",this.wNamespace),e.writeAttributeString("xml","space",this.xmlNamespace,"preserve"),e.writeString(t[Bti[this.keywordIndex]])):(e.writeStartElement(void 0,"br",this.wNamespace),e.writeAttributeString("w","type",this.wNamespace,"textWrapping"),e.writeAttributeString("w","clear",this.wNamespace,this.getBreakClearType(t[$Zt[this.keywordIndex]]).toString().toLowerCase())),e.writeEndElement()),e.writeEndElement()},Hui.prototype.retrieveDeleteRevision=function(e){if(e.hasOwnProperty(h$t[this.keywordIndex])&&0<e[h$t[this.keywordIndex]].length)for(var t=0;t<e[h$t[this.keywordIndex]].length;t++)if("Deletion"===this.retrieveRevision(e[h$t[this.keywordIndex]][t]).revisionType)return!0;return!1},Hui.prototype.serializeParagraphFormat=function(e,t,i,n){je(t)||(je(this.keywordIndex)&&(this.keywordIndex=n),this.serializeParagraphBorders(e,t),je(t[KZt[this.keywordIndex]])||(e.writeStartElement(void 0,"pStyle",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,t[KZt[this.keywordIndex]]),e.writeEndElement()),je(i)?this.serializeListFormat(e,t[x$t[this.keywordIndex]]):this.serializeListFormat(e,i[lZt[this.keywordIndex]][x$t[this.keywordIndex]]),Y.parseBoolValue(t[JZt[this.keywordIndex]])&&(e.writeStartElement(void 0,"bidi",this.wNamespace),e.writeEndElement()),je(t[I$t[this.keywordIndex]])||(e.writeStartElement(void 0,"keepNext",this.wNamespace),Y.parseBoolValue(t[I$t[this.keywordIndex]])||e.writeAttributeString("w","val",this.wNamespace,"0"),e.writeEndElement()),je(t[E$t[this.keywordIndex]])||(e.writeStartElement(void 0,"keepLines",this.wNamespace),Y.parseBoolValue(t[E$t[this.keywordIndex]])||e.writeAttributeString("w","val",this.wNamespace,"0"),e.writeEndElement()),je(t[D$t[this.keywordIndex]])||(e.writeStartElement(void 0,"outlineLvl",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,this.getOutlineLevelValue(t[D$t[this.keywordIndex]]).toString()),e.writeEndElement()),this.serializeParagraphSpacing(e,t),je(t[M$t[this.keywordIndex]])||(e.writeStartElement("w","contextualSpacing",this.wNamespace),Y.parseBoolValue(t[M$t[this.keywordIndex]])||e.writeAttributeString("w","val",this.wNamespace,"0"),e.writeEndElement()),je(t[T$t[this.keywordIndex]])||(e.writeStartElement("w","widowControl",this.wNamespace),Y.parseBoolValue(t[T$t[this.keywordIndex]])?e.writeAttributeString("w","val",this.wNamespace,"1"):e.writeAttributeString("w","val",this.wNamespace,"0"),e.writeEndElement()),this.serializeIndentation(e,t),this.serializeParagraphAlignment(e,t[y$t[this.keywordIndex]],Y.parseBoolValue(t[JZt[this.keywordIndex]])),!je(t[P$t[this.keywordIndex]])&&0<t[P$t[this.keywordIndex]].length&&this.serializeTabs(e,t[P$t[this.keywordIndex]]))},Hui.prototype.getOutlineLevelValue=function(e){if(1==this.keywordIndex){if(0<e)return e-1}else if(-1!==e.toString().indexOf("Level")){e=parseInt(e.toString().substring(5),10);if(0<e)return e-1}return 9},Hui.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()},Hui.prototype.serializeTab=function(e,t){var i=0;e.writeStartElement("w","tab",this.wNamespace),0===t[coi[this.keywordIndex]]&&0!==t[uoi[this.keywordIndex]]?(i=t[uoi[this.keywordIndex]]*this.twentiethOfPoint,e.writeAttributeString("w","val",this.wNamespace,"clear")):(i=t[coi[this.keywordIndex]]*this.twentiethOfPoint,e.writeAttributeString("w","val",this.wNamespace,this.getTabJustification(t[poi[this.keywordIndex]]))),je(t[goi[this.keywordIndex]])||t[goi[this.keywordIndex]]===(1==this.keywordIndex?0:"None")||e.writeAttributeString("w","leader",this.wNamespace,this.getTabLeader(t[goi[this.keywordIndex]])),isNaN(i)||e.writeAttributeString("w","pos",this.wNamespace,i.toString()+""),e.writeEndElement()},Hui.prototype.getTextWrappingType=function(e){switch(e){case 0:return"bothSides";case 1:return"left";case 2:return"right";case 3:return"largest";default:return"bothSides"}},Hui.prototype.getTextWrappingStyle=function(e){switch(e){case 1:return"InFrontOfText";case 2:return"Square";case 3:return"TopAndBottom";case 4:return"Behind";default:return"Inline"}},Hui.prototype.getDateStorageFormat=function(e){switch(e){case 2:return"DateStorageDateTime";case 3:return"DateStorageText";default:return"DateStorageDate"}},Hui.prototype.getDateCalendarType=function(e){switch(e){case 1:return"GregorianArabic";case 2:return"GregorianEnglish";case 3:return"GregorianMiddleEastFrench";case 4:return"GregorianTransliteratedEnglish";case 5:return"GregorianTransliteratedFrench";case 6:return"Hebrew";case 7:return"Hijri";case 8:return"Japan";case 9:return"Korean";case 10:return"Saka";case 11:return"Taiwan";case 12:return"Thai";default:return"Gregorian"}},Hui.prototype.getContentControlAppearance=function(e){switch(e){case 2:return"Hidden";case 3:return"Tags";default:return"BoundingBox"}},Hui.prototype.getTextFormFieldFormat=function(e){switch(e){case 1:return"FirstCapital";case 2:return"Lowercase";case 3:return"Uppercase";case 4:return"Titlecase";default:return"None"}},Hui.prototype.getTextFormFieldType=function(e){switch(e){case 1:return"Number";case 2:return"Date";case 3:return"Calculation";default:return"Text"}},Hui.prototype.getTabLeader=function(e){switch(e){case"Dot":case 2:return"dot";case"Hyphen":case 3:return"hyphen";case"Underscore":case 4:return"underscore";default:return"none"}},Hui.prototype.getTabJustification=function(e){switch(e){case"Bar":case 0:return"left";case 1:return"bar";case"Center":case 2:return"center";case"Decimal":case 3:return"decimal";case"Left":return"left";case"List":case 4:return"num";case"Right":case 5:return"right";default:return"clear"}},Hui.prototype.getTableVerticalAlignment=function(e){switch(e){case 1:return"top";case 2:return"center";case 3:return"bottom";case 4:return"inside";case 5:return"outside";default:return"none"}},Hui.prototype.getTableHorizontalAlignment=function(e){switch(e){case 1:return"center";case 2:return"inside";case 3:return"outside";case 4:return"right";default:return"left"}},Hui.prototype.getTableVerticalRelationEnumValue=function(e){switch(e){case"Paragraph":return 0;case"Margin":return 1;case"Page":return 2;default:return 0}},Hui.prototype.getTableVerticalRelation=function(e){switch(e){case 1:return"Margin";case 2:return"Page";default:return"Paragraph"}},Hui.prototype.getTableHorizontalRelation=function(e){switch(e){case 1:return"Margin";case 2:return"Page";default:return"Column"}},Hui.prototype.getVerticalOrigin=function(e){switch(e){case 1:return"BottomMargin";case 2:return"InsideMargin";case 3:return"Line";case 4:return"Margin";case 5:return"OutsideMargin";case 6:return"Page";case 7:return"TopMargin";default:return"Paragraph"}},Hui.prototype.getHorizontalOrigin=function(e){switch(e){case 1:return"Character";case 2:return"InsideMargin";case 3:return"LeftMargin";case 4:return"Margin";case 5:return"OutsideMargin";case 6:return"Page";case 7:return"RightMargin";default:return"Column"}},Hui.prototype.getShapeVerticalAlignment=function(e){switch(e){case 1:return"Top";case 2:return"Center";case 3:return"Bottom";case 4:return"Inline";case 5:return"Inside";case 6:return"Outside";default:return"None"}},Hui.prototype.getShapeHorizontalAlignment=function(e){switch(e){case 1:return"Center";case 2:return"Inside";case 3:return"Left";case 4:return"Outside";case 5:return"Right";default:return"None"}},Hui.prototype.getBiDirectionalOverride=function(e){switch(e){case 1:return"LTR";case 2:return"RTL";default:return"None"}},Hui.prototype.getBreakClearType=function(e){switch(e){case 0:return"None";case 1:return"Left";case 2:return"Right";case 3:return"All";default:return e}},Hui.prototype.serializeListFormat=function(e,t){je(t[d$t[this.keywordIndex]])&&je(t[u$t[this.keywordIndex]])||(e.writeStartElement(void 0,"numPr",this.wNamespace),je(t[u$t[this.keywordIndex]])||-1===t[u$t[this.keywordIndex]]||(e.writeStartElement(void 0,"ilvl",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,t[u$t[this.keywordIndex]].toString()),e.writeEndElement()),je(t[d$t[this.keywordIndex]])||(e.writeStartElement(void 0,"numId",this.wNamespace),t=(t[d$t[this.keywordIndex]]+1).toString(),e.writeAttributeString("w","val",this.wNamespace,t),e.writeEndElement()),e.writeEndElement())},Hui.prototype.serializeParagraphAlignment=function(e,t,i){if(!je(t)){e.writeStartElement(void 0,"jc",this.wNamespace);var n=void 0;switch(t){case"Center":case 1:n="center";break;case"Right":case 2:n="right";break;case"Justify":case 3:n="both";break;default:n="left"}e.writeAttributeString("w","val",this.wNamespace,n),e.writeEndElement()}},Hui.prototype.serializeParagraphSpacing=function(e,t){var i;e.writeStartElement(void 0,"spacing",this.wNamespace),je(t[b$t[this.keywordIndex]])||e.writeAttributeString(void 0,"before",this.wNamespace,this.roundToTwoDecimal(t[b$t[this.keywordIndex]]*this.twentiethOfPoint).toString()),je(t[C$t[this.keywordIndex]])||(i=1==this.keywordIndex?t[C$t[this.keywordIndex]].toString():t[C$t[this.keywordIndex]]?"1":"0",e.writeAttributeString(void 0,"beforeAutospacing",this.wNamespace,i)),je(t[v$t[this.keywordIndex]])||e.writeAttributeString(void 0,"after",this.wNamespace,this.roundToTwoDecimal(t[v$t[this.keywordIndex]]*this.twentiethOfPoint).toString()),je(t[w$t[this.keywordIndex]])||(i=1==this.keywordIndex?t[w$t[this.keywordIndex]].toString():t[w$t[this.keywordIndex]]?"1":"0",e.writeAttributeString(void 0,"afterAutospacing",this.wNamespace,i)),je(t[S$t[this.keywordIndex]])||(i=t[A$t[this.keywordIndex]]===(1==this.keywordIndex?1:"AtLeast")||t[A$t[this.keywordIndex]]===(1==this.keywordIndex?2:"Exactly")?this.roundToTwoDecimal(t[S$t[this.keywordIndex]]*this.twentiethOfPoint):this.roundToTwoDecimal(240*t[S$t[this.keywordIndex]]),e.writeAttributeString(void 0,"line",this.wNamespace,i.toString())),je(t[A$t[this.keywordIndex]])||(i="auto",t[A$t[this.keywordIndex]]===(1==this.keywordIndex?1:"AtLeast")?i="atLeast":t[A$t[this.keywordIndex]]===(1==this.keywordIndex?2:"Exactly")&&(i="exact"),e.writeAttributeString(void 0,"lineRule",this.wNamespace,i)),e.writeEndElement()},Hui.prototype.serializeIndentation=function(e,t){e.writeStartElement(void 0,"ind",this.wNamespace),je(t[g$t[this.keywordIndex]])||e.writeAttributeString(void 0,"left",this.wNamespace,this.roundToTwoDecimal(t[g$t[this.keywordIndex]]*this.twipsInOnePoint).toString()),je(t[m$t[this.keywordIndex]])||e.writeAttributeString(void 0,"right",this.wNamespace,this.roundToTwoDecimal(t[m$t[this.keywordIndex]]*this.twipsInOnePoint).toString()),je(t[f$t[this.keywordIndex]])||(t[f$t[this.keywordIndex]]<0?e.writeAttributeString(void 0,"hanging",this.wNamespace,this.roundToTwoDecimal(-1*t[f$t[this.keywordIndex]]*this.twipsInOnePoint).toString()):e.writeAttributeString(void 0,"firstLine",this.wNamespace,this.roundToTwoDecimal(t[f$t[this.keywordIndex]]*this.twipsInOnePoint).toString())),e.writeEndElement()},Hui.prototype.serializeCustomXMLMapping=function(e,t){if(0<e.length)for(var i=e.keys,n=0;n<i.length;n++){var o=new Ol,r=(o.writeStartElement(void 0,"Relationships",this.rpNamespace),this.mCustomXML.get(i[n])),s=i[n],a=this.getNextRelationShipID(),l=n+1,r=this.createXMLItem(r,a,l),s=this.createXMLItemProps(s,l),a=(this.serializeRelationShip(t,a,this.customXmlRelType,"../"+r),this.customXMLRelation(o,l,s),o.writeEndElement(),new ih(o.buffer,this.customXMLRelPath+l+".xml.rels"));this.mArchive.addItem(a)}},Hui.prototype.customXMLRelation=function(e,t,i){this.serializeRelationShip(e,"rId1",this.wordMLCustomXmlPropsRelType,i)},Hui.prototype.createXMLItem=function(e,t,i){e=new Blob([e],{type:"text/plain"}),i=this.customXMLItemsPath+i+".xml",e=new ih(e,i);return this.mArchive.addItem(e),i},Hui.prototype.createXMLItemProps=function(e,t){var i=new Ol,n=this.customXMLItemsPropspath+t+".xml",t=this.itemPropsPath+t+".xml",e=(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),new ih(i.buffer,n));return this.mArchive.addItem(e),t},Hui.prototype.serializeStyles=function(){var e=new Ol,e=(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(),new ih(e.buffer,this.stylePath));this.mArchive.addItem(e)},Hui.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),je(this.defParagraphFormat)||(e.writeStartElement(void 0,"pPr",this.wNamespace),this.serializeParagraphFormat(e,this.defParagraphFormat,void 0),e.writeEndElement()),e.writeEndElement(),e.writeEndElement()},Hui.prototype.serializeDocumentStyles=function(e){for(var t=0;t<this.mStyles.length;t++){var i=this.mStyles[t],n=(e.writeStartElement(void 0,"style",this.wNamespace),this.getStyleType(i[koi[this.keywordIndex]]));e.writeAttributeString("w","type",this.wNamespace,n),e.writeAttributeString("w","styleId",this.wNamespace,i[BZt[this.keywordIndex]]),e.writeStartElement(void 0,"name",this.wNamespace);-1!=["TOC 1","TOC 2","TOC 3","TOC 4","TOC 5","TOC 6","TOC 7","TOC 8","TOC 9"].indexOf(i[BZt[this.keywordIndex]])?e.writeAttributeString("w","val",this.wNamespace,i[BZt[this.keywordIndex]].toLowerCase()):e.writeAttributeString("w","val",this.wNamespace,i[BZt[this.keywordIndex]]),e.writeEndElement(),je(i[FZt[this.keywordIndex]])||(e.writeStartElement(void 0,"basedOn",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,i[FZt[this.keywordIndex]]),e.writeEndElement()),je(i[LZt[this.keywordIndex]])||(e.writeStartElement(void 0,"next",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,i[LZt[this.keywordIndex]]),e.writeEndElement()),je(i[RZt[this.keywordIndex]])||(e.writeStartElement(void 0,"link",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,i[RZt[this.keywordIndex]]),e.writeEndElement()),i[koi[this.keywordIndex]]===(1==this.keywordIndex?0:"Paragraph")&&(e.writeStartElement(void 0,"pPr",this.wNamespace),this.serializeParagraphFormat(e,i[lZt[this.keywordIndex]],void 0),e.writeEndElement()),i[koi[this.keywordIndex]]!==(1==this.keywordIndex?2:"Table")&&this.serializeCharacterFormat(e,i[aZt[this.keywordIndex]]),e.writeEndElement()}},Hui.prototype.serializeCharacterFormat=function(e,t){var i;if(je(this.keywordIndex)&&(this.keywordIndex=0),e.writeStartElement(void 0,"rPr",this.wNamespace),je(t[KZt[this.keywordIndex]])||(e.writeStartElement(void 0,"rStyle",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,t[KZt[this.keywordIndex]]),e.writeEndElement()),je(t[XZt[this.keywordIndex]])&&je(t[t$t[this.keywordIndex]])&&je(t[a$t[this.keywordIndex]])||(e.writeStartElement(void 0,"rFonts",this.wNamespace),je(t[s$t[this.keywordIndex]])||(i=Y.isThemeFont(t[s$t[this.keywordIndex]])?"asciiTheme":"ascii",e.writeAttributeString(void 0,i,this.wNamespace,t[s$t[this.keywordIndex]])),je(t[a$t[this.keywordIndex]])||(i=Y.isThemeFont(t[a$t[this.keywordIndex]])?"eastAsiaTheme":"eastAsia",e.writeAttributeString(void 0,i,this.wNamespace,t[a$t[this.keywordIndex]])),je(t[l$t[this.keywordIndex]])||(i=Y.isThemeFont(t[l$t[this.keywordIndex]])?"hAnsiTheme":"hAnsi",e.writeAttributeString(void 0,i,this.wNamespace,t[l$t[this.keywordIndex]])),je(t[t$t[this.keywordIndex]])||(i=Y.isThemeFont(t[t$t[this.keywordIndex]])?"cstheme":"cs",e.writeAttributeString(void 0,i,this.wNamespace,t[t$t[this.keywordIndex]])),je(t[WZt[this.keywordIndex]])||e.writeAttributeString(void 0,"hint",this.wNamespace,this.getFontHintType(t[WZt[this.keywordIndex]])),e.writeEndElement()),je(t[_Zt[this.keywordIndex]])||this.serializeBoolProperty(e,"b",Y.parseBoolValue(t[_Zt[this.keywordIndex]])),Y.parseBoolValue(t[i$t[this.keywordIndex]])&&this.serializeBoolProperty(e,"bCs",Y.parseBoolValue(t[i$t[this.keywordIndex]])),je(t[HZt[this.keywordIndex]])||this.serializeBoolProperty(e,"i",Y.parseBoolValue(t[HZt[this.keywordIndex]])),je(t[n$t[this.keywordIndex]])||this.serializeBoolProperty(e,"iCs",Y.parseBoolValue(t[n$t[this.keywordIndex]])),!je(t[nri[this.keywordIndex]])&&Y.parseBoolValue(t[nri[this.keywordIndex]])&&this.serializeBoolProperty(e,"vanish",Y.parseBoolValue(t[nri[this.keywordIndex]])),Y.parseBoolValue(t[JZt[this.keywordIndex]])&&(e.writeStartElement(void 0,"rtl",this.wNamespace),e.writeEndElement()),je(t[o$t[this.keywordIndex]])||this.serializeBoolProperty(e,"caps",Y.parseBoolValue(t[o$t[this.keywordIndex]])),Y.parseBoolValue(t[r$t[this.keywordIndex]])&&this.serializeBoolProperty(e,"cs",Y.parseBoolValue(t[r$t[this.keywordIndex]])),!je(t[UZt[this.keywordIndex]]))switch(t[UZt[this.keywordIndex]]){case"SingleStrike":case 1:this.serializeBoolProperty(e,"strike",!0);break;case"DoubleStrike":case 2:this.serializeBoolProperty(e,"dstrike",!0);break;default:this.serializeBoolProperty(e,"strike",!1),this.serializeBoolProperty(e,"dstrike",!1)}if(je(t[YZt[this.keywordIndex]])||(e.writeStartElement(void 0,"color",this.wNamespace),"empty"===t[YZt[this.keywordIndex]]||"#00000000"===t[YZt[this.keywordIndex]]?e.writeAttributeString("w","val",this.wNamespace,"auto"):e.writeAttributeString("w","val",this.wNamespace,this.getColor(t[YZt[this.keywordIndex]])),e.writeEndElement()),je(t[GZt[this.keywordIndex]])||(e.writeStartElement(void 0,"sz",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,this.roundToTwoDecimal(2*t[GZt[this.keywordIndex]]).toString()),e.writeEndElement()),je(t[p$t[this.keywordIndex]])||(e.writeStartElement(void 0,"spacing",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,(20*t[p$t[this.keywordIndex]]).toString()),e.writeEndElement()),je(t[c$t[this.keywordIndex]])||(e.writeStartElement(void 0,"w",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,t[c$t[this.keywordIndex]].toString()),e.writeEndElement()),je(t[e$t[this.keywordIndex]])||(e.writeStartElement(void 0,"szCs",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,this.roundToTwoDecimal(2*t[e$t[this.keywordIndex]]).toString()),e.writeEndElement()),je(t[qZt[this.keywordIndex]])||t[qZt[this.keywordIndex]]===(1==this.keywordIndex?0:"NoColor")||(e.writeStartElement(void 0,"highlight",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,this.getHighlightColor(t[qZt[this.keywordIndex]])),e.writeEndElement()),!je(t[h$t[this.keywordIndex]])&&0<t[h$t[this.keywordIndex]].length&&(this.serializeRevisionStart(e,t,void 0),this.serializeRevisionEnd(e,t,void 0)),je(t[zZt[this.keywordIndex]])||(e.writeStartElement(void 0,"u",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,this.getUnderlineStyle(t[zZt[this.keywordIndex]])),je(t[jZt[this.keywordIndex]])||e.writeAttributeString("w","color",this.wNamespace,this.getColor(t[jZt[this.keywordIndex]])),e.writeEndElement()),!je(t[QZt[this.keywordIndex]])){switch(e.writeStartElement(void 0,"vertAlign",this.wNamespace),t[QZt[this.keywordIndex]]){case"Superscript":case 1:e.writeAttributeString("w","val",this.wNamespace,"superscript");break;case"Subscript":case 2:e.writeAttributeString("w","val",this.wNamespace,"subscript");break;default:e.writeAttributeString("w","val",this.wNamespace,"baseline")}e.writeEndElement()}e.writeEndElement()},Hui.prototype.getColor=function(e){return e=0<e.length&&6<(e="#"===e[0]?e.substr(1):e).length?e.substr(0,6):e},Hui.prototype.getStyleType=function(e){switch(e){case"Character":case 1:return"character";case"Table":case 2:return"table";default:return"paragraph"}},Hui.prototype.getUnderlineStyle=function(e){switch(e){case"None":case 0:return"none";case"Single":case 1:return"single";case"Words":case 2:return"words";case"Double":case 3:return"double";case"Dotted":case 4:return"dotted";case"Thick":case 5:return"thick";case 6:return"dash";case"DashLong":case 7:return"dashLong";case"DotDash":case 8:return"dotDash";case"DotDotDash":case 9:return"dotDotDash";case"Wavy":case 10:return"wave";case"DottedHeavy":case 11:return"dottedHeavy";case"DashHeavy":case 12:return"dashedHeavy";case"DashLongHeavy":case 13:return"dashLongHeavy";case"DotDashHeavy":case 14:return"dashDotHeavy";case"DotDotDashHeavy":case 15:return"dashDotDotHeavy";case"WavyHeavy":case 16:return"wavyHeavy";case"WavyDouble":case 17:return"wavyDouble";default:return"dash"}},Hui.prototype.getFontHintType=function(e){switch(e){case"EastAsia":case 1:return"eastAsia";case"CS":case 2:return"cs";default:return"default"}},Hui.prototype.getHighlightColor=function(e){switch(e){case"BrightGreen":case 2:return"green";case"Turquoise":case 3:return"cyan";case"Pink":case 4:return"magenta";case"Blue":case 5:return"blue";case"Red":case 6:return"red";case"DarkBlue":case 7:return"darkBlue";case"Teal":case 8:return"darkCyan";case"Green":case 9:return"darkGreen";case"Violet":case 10:return"darkMagenta";case"DarkRed":case 11:return"darkRed";case"DarkYellow":case 12:return"darkYellow";case"Gray50":case 13:return"darkGray";case"Gray25":case 14:return"lightGray";case"Black":case 15:return"black";default:return"yellow"}},Hui.prototype.serializeBoolProperty=function(e,t,i){e.writeStartElement(void 0,t,this.wNamespace),i||e.writeAttributeString(void 0,"val",this.wNamespace,"0"),e.writeEndElement()},Hui.prototype.serializeNumberings=function(){var e;0!==this.document[hZt[this.keywordIndex]].length&&((e=new Ol).writeStartElement("w","numbering",this.wNamespace),this.writeCommonAttributeStrings(e),this.serializeAbstractListStyles(e,this.document[dZt[this.keywordIndex]]),this.serializeListInstances(e,this.document[hZt[this.keywordIndex]]),e.writeEndElement(),e=new ih(e.buffer,this.numberingPath),this.mArchive.addItem(e))},Hui.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[toi[this.keywordIndex]].toString()),e.writeStartElement(void 0,"nsid",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,Y.numberToHexDecimal(n.nsid)),e.writeEndElement();for(var o=0,r=n[noi[this.keywordIndex]].length;o<r;o++)this.serializeListLevel(e,n[noi[this.keywordIndex]][o],o);e.writeEndElement()}},Hui.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[d$t[this.keywordIndex]]+1).toString()),e.writeStartElement(void 0,"abstractNumId",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,n[toi[this.keywordIndex]].toString()),e.writeEndElement();for(var o=0,r=n[roi[this.keywordIndex]].length;o<r;o++)this.serializeLevelOverrides(e,n[roi[this.keywordIndex]][o],n[roi[this.keywordIndex]][o][Zni[this.keywordIndex]]);e.writeEndElement()}},Hui.prototype.roundToTwoDecimal=function(e){return Math.round(e)},Hui.prototype.serializeListLevel=function(e,t,i){e.writeStartElement(void 0,"lvl",this.wNamespace),e.writeAttributeString(void 0,"ilvl",this.wNamespace,i.toString()),!je(t[Tni[this.keywordIndex]])&&t[Tni[this.keywordIndex]]&&e.writeElementString(void 0,"isLgl",this.wNamespace,void 0),e.writeStartElement(void 0,"start",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,t[Kni[this.keywordIndex]].toString()),e.writeEndElement(),e.writeStartElement(void 0,"numFmt",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,this.getLevelPattern(t[Yni[this.keywordIndex]])),e.writeEndElement(),je(t[eoi[this.keywordIndex]])||""===t[eoi[this.keywordIndex]].toString()||(e.writeStartElement(void 0,"pStyle",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,t[eoi[this.keywordIndex]].toString()),e.writeEndElement()),this.serializeLevelFollow(e,t),this.serializeLevelText(e,t,i+1),e.writeStartElement(void 0,"pPr",this.wNamespace),this.serializeParagraphFormat(e,t[lZt[this.keywordIndex]],void 0),e.writeEndElement(),this.serializeCharacterFormat(e,t[aZt[this.keywordIndex]]),e.writeEndElement()},Hui.prototype.serializeLevelOverrides=function(e,t,i){e.writeStartElement(void 0,"lvlOverride",this.wNamespace),e.writeAttributeString(void 0,"ilvl",this.wNamespace,i.toString()),je(t[ooi[this.keywordIndex]])||this.serializeListLevel(e,t[ooi[this.keywordIndex]],i),je(t[Kni[this.keywordIndex]])||(e.writeStartElement(void 0,"startOverride",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,t[Kni[this.keywordIndex]].toString()),e.writeEndElement()),e.writeEndElement()},Hui.prototype.getLevelPattern=function(e){var t;switch(e){case"None":case 0:t="none";break;case"Arabic":case 1:t="decimal";break;case"UpRoman":case 2:t="upperRoman";break;case"LowRoman":case 3:t="lowerRoman";break;case"UpLetter":case 4:t="upperLetter";break;case"LowLetter":case 5:t="lowerLetter";break;case"Ordinal":case 6:t="ordinal";break;case"Number":case 7:t="cardinalText";break;case"OrdinalText":case 8:t="ordinalText";break;case"LeadingZero":case 9:t="decimalZero";break;case"FarEast":case 11:t="aiueoFullWidth";break;case"Special":case 12:t="russianLower";break;default:t="bullet"}return t},Hui.prototype.serializeLevelText=function(e,t,i){e.writeStartElement(void 0,"lvlText",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,t[$ni[this.keywordIndex]]),e.writeEndElement()},Hui.prototype.serializeLevelFollow=function(e,t){t=t[Xni[this.keywordIndex]]===(1==this.keywordIndex?0:"Tab")?"tab":t[Xni[this.keywordIndex]]===(1==this.keywordIndex?1:"Space")?"space":"nothing";e.writeStartElement(void 0,"suff",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,t),e.writeEndElement()},Hui.prototype.serializeThemeFontLang=function(e){var t=0<this.themeFontLang[VZt[this.keywordIndex]],i=0<this.themeFontLang[OZt[this.keywordIndex]],n=0<this.themeFontLang[NZt[this.keywordIndex]];(i||n||t)&&(e.writeStartElement("w","themeFontLang",void 0),i&&(i=hJt[this.themeFontLang[OZt[this.keywordIndex]]],e.writeAttributeString("w","val",void 0,i.replace("_","-"))),t&&(i=hJt[this.themeFontLang[VZt[this.keywordIndex]]],e.writeAttributeString("w","bidi",void 0,i.replace("_","-"))),n&&(t=hJt[this.themeFontLang[NZt[this.keywordIndex]]],e.writeAttributeString("w","eastAsia",void 0,t.replace("_","-"))),e.writeEndElement())},Hui.prototype.serializeDocumentProtectionSettings=function(e){if(e.writeStartElement("w","documentProtection",this.wNamespace),this.formatting&&e.writeAttributeString("w","formatting",this.wNamespace,"1"),this.protectionType&&0!==this.protectionType){var t=void 0;switch(this.protectionType){case"ReadOnly":case 1:t="readOnly";break;case"FormFieldsOnly":case 2:t="forms";break;case"CommentsOnly":case 3:t="comments";break;case"RevisionsOnly":case 4:t="trackedChanges"}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()},Hui.prototype.serializeSettings=function(){var e=new Ol,t=(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(),this.serializeThemeFontLang(e),e.writeStartElement(void 0,"displayBackgroundShape",this.wNamespace),e.writeEndElement(),e.writeStartElement(void 0,"defaultTabStop",this.wNamespace),Math.round(this.defaultTabWidthValue*this.twipsInOnePoint)),t=(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),this.allowSpaceOfSameStyleInTable&&this.serializeBoolProperty(e,"allowSpaceOfSameStyleInTable",this.allowSpaceOfSameStyleInTable),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"),1===this.keywordIndex?Y.getCompatibilityModeValue(this.compatibilityMode):Y.getCompatibilityModeValue(this.getCompatibilityModeEnumValue(this.compatibilityMode.toString()))),t=(e.writeAttributeString(void 0,"val",this.wNamespace,t),e.writeEndElement(),e.writeEndElement(),this.document[EZt[this.keywordIndex]]&&(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[DZt[this.keywordIndex]]&&(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(),new ih(e.buffer,this.settingsPath));this.mArchive.addItem(t)},Hui.prototype.serializeCoreProperties=function(){},Hui.prototype.serializeAppProperties=function(){},Hui.prototype.serializeFontTable=function(e){},Hui.prototype.serializeSettingsRelation=function(){},Hui.prototype.getCompatibilityModeEnumValue=function(e){switch(e){case"Word2013":return 0;case"Word2003":return 1;case"Word2007":return 2;case"Word2010":return 3}},Hui.prototype.serializeHeaderFooters=function(){this.isHeaderFooter=!0,this.serializeHeaderFooter("EvenFooter"),this.serializeHeaderFooter("EvenHeader"),this.serializeHeaderFooter("FirstPageFooter"),this.serializeHeaderFooter("FirstPageHeader"),this.serializeHeaderFooter("OddFooter"),this.serializeHeaderFooter("OddHeader"),this.isHeaderFooter=!1},Hui.prototype.serializeHeaderFooter=function(e){var t,i;if(0!==this.headersFooters.length&&this.headersFooters.containsKey(e))for(var n=this.headersFooters.get(e),o=0;o<n.keys.length;o++){var r=n.keys[o],s=n.get(r);"EvenHeader"===e||"FirstPageHeader"===e||"OddHeader"===e?(t=this.headerPath+r.replace("rId","")+".xml",i=this.headerRelationPath+r.replace("rId","")+".xml.rels",this.serializeHeader(s,r,t,i)):(t=this.footerPath+r.replace("rId","")+".xml",i=this.footerRelationPath+r.replace("rId","")+".xml.rels",this.serializeFooter(s,r,t,i))}},Hui.prototype.serializeHeader=function(e,t,i,n){this.headerFooter=e;var o=new Ol,r=(o.writeStartElement("w","hdr",this.wNamespace),this.writeHFCommonAttributes(o),this.blockOwner),e=(this.blockOwner=e,this.serializeBodyItems(o,e[_ni[this.keywordIndex]],!0),this.blockOwner=r,o.writeEndElement(),new ih(o.buffer,i));this.mArchive.addItem(e),this.serializeHFRelations(t,n),this.headerFooter=void 0},Hui.prototype.serializeHFRelations=function(e,t){var i;this.headerFooterImages.containsKey(e)&&((i=new Ol).writeStartElement(void 0,"Relationships",this.rpNamespace),this.serializeImagesRelations(this.headerFooterImages.get(e),i,!1),this.headerFooterSvgImages.containsKey(e)&&this.serializeSvgImageRelation(this.headerFooterSvgImages.get(e),i),i.writeEndElement(),e=new ih(i.buffer,t),this.mArchive.addItem(e))},Hui.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")},Hui.prototype.serializeFooter=function(e,t,i,n){this.headerFooter=e;var o=new Ol,e=(o.writeStartElement("w","ftr",this.wNamespace),this.writeHFCommonAttributes(o),this.serializeBodyItems(o,e[_ni[this.keywordIndex]],!0),o.writeEndElement(),new ih(o.buffer,i));this.mArchive.addItem(e),this.serializeHFRelations(t,n)},Hui.prototype.serializeDocumentRelations=function(){var e=new Ol,e=(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[DZt[this.keywordIndex]]&&this.serializeRelationShip(e,this.getNextRelationShipID(),this.endnoteRelType,"endnotes.xml"),this.document[EZt[this.keywordIndex]]&&this.serializeRelationShip(e,this.getNextRelationShipID(),this.footnoteRelType,"footnotes.xml"),0<this.mComments.length&&(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"))),je(this.mThemes)||this.serializeRelationShip(e,this.getNextRelationShipID(),this.ThemeRelType,"theme/theme1.xml"),0<this.document[hZt[this.keywordIndex]].length&&this.serializeRelationShip(e,this.getNextRelationShipID(),this.numberingRelType,"numbering.xml"),this.serializeHeaderFooterRelations(e),this.serializeImagesRelations(this.documentImages,e,!1),this.serializeSvgImageRelation(this.svgImages,e),this.serializeCustomXMLMapping(this.mCustomXML,e),this.serializeChartDocumentRelations(this.documentCharts,e),this.serializeExternalLinkImages(e),e.writeEndElement(),new ih(e.buffer,this.wordRelationPath));this.mArchive.addItem(e),this.headerFooter=void 0},Hui.prototype.serializeChartDocumentRelations=function(e,t){if(0<e.length)for(var i=e.keys,n=1;n<=i.length;n++)this.serializeRelationShip(t,i[n-1],this.chartRelType,"charts/chart"+n+".xml")},Hui.prototype.serializeChartRelations=function(){var e=new Ol,t=(this.resetChartRelationShipId(),e.writeStartElement(void 0,"Relationships",this.rpNamespace),"colors"+this.chartCount+".xml"),i=this.chartPath+"/_rels/chart"+this.chartCount+".xml.rels",n="../embeddings/Microsoft_Excel_Worksheet"+this.chartCount+".xlsx",n=(this.serializeRelationShip(e,this.getNextChartRelationShipID(),this.packageRelType,n),this.serializeRelationShip(e,this.getNextChartRelationShipID(),this.chartColorStyleRelType,t),e.writeEndElement(),new ih(e.buffer,i));this.mArchive.addItem(n)},Hui.prototype.serializeImagesRelations=function(e,t,i){if(0<e.length)for(var n="",o=void 0,r=e.keys,s=0;s<r.length;s++){var a,l,h=e.get(r[s]);"string"==typeof h&&this.startsWith(h,"data")?o=h:(o=(a=this.getBase64ImageString(h)).imageString,Y.parseBoolValue(h[aii[this.keywordIndex]])&&(".svg"!==Y.formatClippedString(a.metaFileImageString).extension||i)&&(o=a.metaFileImageString)),je(o)?(n=this.imagePath+"/0.jpeg",this.serializeRelationShip(t,r[s],this.imageRelType,n.replace("word/",""))):(a=(h=Y.formatClippedString(o)).extension,h=h.formatClippedString,n=this.imagePath+r[s]+a,l=void this.serializeRelationShip(t,r[s],this.imageRelType,n.replace("word/","")),l=this.startsWith(o,"data:image/svg+xml;utf8,")?new Blob([h]):new Blob([this.encodedString(h)]),h=new ih(l,n),this.mArchive.addItem(h))}},Hui.prototype.serializeSvgImageRelation=function(e,t){this.serializeImagesRelations(e,t,!0)},Hui.prototype.encodedString=function(e){var t,i,n,o,r,s,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=0,h=0,d=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===a.charAt(64)&&d--,e.charAt(e.length-2)===a.charAt(64)&&d--,d%1!=0)throw new Error("Invalid base64 input, bad content length.");for(var p=new Uint8Array(0|d);l<e.length;)n=a.indexOf(e.charAt(l++)),t=(15&(o=a.indexOf(e.charAt(l++))))<<4|(r=a.indexOf(e.charAt(l++)))>>2,i=(3&r)<<6|(s=a.indexOf(e.charAt(l++))),p[h++]=n<<2|o>>4,64!==r&&(p[h++]=t),64!==s&&(p[h++]=i);return p},Hui.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]))},Hui.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")},Hui.prototype.serializeHFRelation=function(e,t){var i="";if(this.headersFooters.containsKey(t))for(var n=this.headersFooters.get(t),o=0;o<n.keys.length;o++){var r=n.keys[o],s="EvenHeader"===t||"FirstPageHeader"===t||"OddHeader"===t?(i="header"+r.replace("rId","")+".xml",this.headerRelType):(i="footer"+r.replace("rId","")+".xml",this.footerRelType);this.serializeRelationShip(e,r,s,i)}},Hui.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()},Hui.prototype.getNextRelationShipID=function(){return"rId"+ ++this.mRelationShipID},Hui.prototype.getEFNextRelationShipID=function(){return(++this.efRelationShipId).toString()},Hui.prototype.serializeGeneralRelations=function(){var e=new Ol,e=(this.resetRelationShipID(),e.writeStartElement(void 0,"Relationships",this.rpNamespace),this.serializeRelationShip(e,this.getNextRelationShipID(),this.documentRelType,this.documentPath),e.writeEndElement(),new ih(e.buffer,this.generalRelationPath));this.mArchive.addItem(e)},Hui.prototype.serializeContentTypes=function(e,t){var i=new Ol;if(i.writeStartElement(void 0,"Types","http://schemas.openxmlformats.org/package/2006/content-types"),this.serializeDefaultContentType(i,"rels",this.relationContentType),this.serializeDefaultContentType(i,"xml",this.xmlContentType),(0<this.documentImages.length||0<this.externalImages.length||0<this.headerFooterImages.length)&&(this.serializeDefaultContentType(i,"png","image/png"),this.serializeDefaultContentType(i,"bmp","image/bmp"),this.serializeDefaultContentType(i,"emf","image/x-emf"),this.serializeDefaultContentType(i,"wmf","image/x-wmf"),this.serializeDefaultContentType(i,"gif","image/gif"),this.serializeDefaultContentType(i,"ico","image/x-icon"),this.serializeDefaultContentType(i,"tif","image/tiff"),this.serializeDefaultContentType(i,"tiff","image/tiff"),this.serializeDefaultContentType(i,"jpeg","image/jpeg"),this.serializeDefaultContentType(i,"jpg","image/jpeg"),this.serializeDefaultContentType(i,"svg","image/svg+xml")),"Docx"==t?this.serializeOverrideContentType(i,this.documentPath,this.documentContentType):"Dotx"==t&&this.serializeOverrideContentType(i,this.documentPath,this.TemplateContentType),this.serializeOverrideContentType(i,this.numberingPath,this.numberingContentType),this.serializeOverrideContentType(i,this.stylePath,this.stylesContentType),this.serializeOverrideContentType(i,this.settingsPath,this.settingsContentType),this.serializeOverrideContentType(i,this.commentsPath,this.commentsContentType),this.serializeOverrideContentType(i,this.themePath,this.themeContentType),this.serializeOverrideContentType(i,this.commentsExtendedPath,this.commentsExContentType),0<this.chartCount){var n=1;for(this.serializeDefaultContentType(i,"xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");n<=this.chartCount;)this.serializeOverrideContentType(i,"word/charts/chart"+n+".xml",this.chartsContentType),this.serializeOverrideContentType(i,"word/charts/colors"+n+".xml",this.chartColorStyleContentType),n++}if(0<this.customXMLProps.length)for(var o=0;o<this.customXMLProps.length;o++)this.serializeOverrideContentType(i,this.customXMLProps[o],this.customXmlContentType);this.serializeHFContentTypes(i),this.SerializeEFContentTypes(i),i.writeEndElement();t=new ih(i.buffer,this.contentTypesPath);this.mArchive.addItem(t)},Hui.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")},Hui.prototype.serializeHeaderFootersContentType=function(e,t){var i;if(this.headersFooters.containsKey(t))for(var n=this.headersFooters.get(t),o=0;o<n.keys.length;o++){var r=n.keys[o],r="EvenHeader"===t||"FirstPageHeader"===t||"OddHeader"===t?(i=this.headerPath+r.replace("rId","")+".xml",this.headerContentType):(i=this.footerPath+r.replace("rId","")+".xml",this.footerContentType);this.serializeOverrideContentType(e,i,r)}},Hui.prototype.SerializeEFContentTypes=function(e){this.serializeEFContentType(e)},Hui.prototype.serializeEFContentType=function(e){var t=this.endnotesPath,i=this.endnoteContentType;this.serializeOverrideContentType(e,t,i),t=this.footnotesPath,i=this.footnoteContentType,this.serializeOverrideContentType(e,t,i)},Hui.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()},Hui.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()},Hui.prototype.resetRelationShipID=function(){this.mRelationShipID=0},Hui.prototype.resetExcelRelationShipId=function(){this.eRelationShipId=0},Hui.prototype.resetChartRelationShipId=function(){this.cRelationShipId=0},Hui.prototype.close=function(){},Hui.prototype.getExportAutoShapeType=function(e){switch(e){case 1:return"rect";case 2:return"roundRect";case 3:return"straightConnector1";case 4:return"ellipse";case 5:return"triangle";case 6:return"rtTriangle";case 7:return"parallelogram";case 8:return"trapezoid";case 9:return"diamond";case 10:return"pentagon";case 11:return"hexagon";case 12:return"heptagon";case 13:return"octagon";case 14:return"decagon";case 15:return"dodecagon";case 16:return"chord";case 17:return"teardrop";case 18:return"frame";case 19:return"halfFrame";case 20:return"corner";case 21:return"pie";case 22:return"diagStripe";case 23:return"plus";case 24:return"plaque";case 25:return"can";case 26:return"cube";case 27:return"bevel";case 28:return"donut";case 29:return"noSmoking";case 30:return"blockArc";case 31:return"foldedCorner";case 32:return"smileyFace";case 33:return"heart";case 34:return"lightningBolt";case 35:return"sun";case 36:return"moon";case 37:return"cloud";case 38:return"arc";case 39:return"bracketPair";case 40:return"bracePair";case 41:return"leftBracket";case 42:return"rightBracket";case 43:return"leftBrace";case 44:return"rightBrace";case 45:return"flowChartProcess";case 46:return"flowChartAlternateProcess";case 47:return"flowChartDecision";case 48:return"flowChartInputOutput";case 49:return"flowChartPredefinedProcess";case 50:return"flowChartInternalStorage";case 51:return"flowChartDocument";case 52:return"flowChartMultidocument";case 53:return"flowChartTerminator";case 54:return"flowChartPreparation";case 55:return"flowChartManualInput";case 56:return"flowChartManualOperation";case 57:return"flowChartConnector";case 58:return"flowChartOffpageConnector";case 59:return"flowChartPunchedCard";case 60:return"flowChartPunchedTape";case 61:return"flowChartSummingJunction";case 62:return"flowChartOr";case 63:return"flowChartCollate";case 64:return"flowChartSort";case 65:return"flowChartExtract";case 66:return"flowChartMerge";case 67:return"flowChartOnlineStorage";case 68:return"flowChartDelay";case 69:return"flowChartMagneticTape";case 70:return"flowChartMagneticDisk";case 71:return"flowChartMagneticDrum";case 72:return"flowChartDisplay";case 73:return"rightArrow";case 74:return"leftArrow";case 75:return"upArrow";case 76:return"downArrow";case 77:return"leftRightArrow";case 78:return"upDownArrow";case 79:return"quadArrow";case 80:return"leftRightUpArrow";case 81:return"bentArrow";case 82:return"uturnArrow";case 83:return"leftUpArrow";case 84:return"bentUpArrow";case 85:return"curvedRightArrow";case 86:return"curvedLeftArrow";case 87:return"curvedUpArrow";case 88:return"curvedDownArrow";case 89:return"stripedRightArrow";case 90:return"notchedRightArrow";case 91:return"homePlate";case 92:return"chevron";case 93:return"rightArrowCallout";case 94:return"downArrowCallout";case 95:return"leftArrowCallout";case 96:return"upArrowCallout";case 97:return"leftRightArrowCallout";case 98:return"quadArrowCallout";case 99:return"circularArrow";case 100:return"mathPlus";case 101:return"mathMinus";case 102:return"mathMultiply";case 103:return"mathDivide";case 104:return"mathEqual";case 105:return"mathNotEqual";case 106:return"irregularSeal1";case 107:return"irregularSeal2";case 108:return"star4";case 109:return"star5";case 110:return"star6";case 111:return"star7";case 112:return"star8";case 113:return"star10";case 114:return"star12";case 115:return"star16";case 116:return"star24";case 117:return"star32";case 118:return"ribbon2";case 119:return"ribbon";case 120:return"ellipseRibbon2";case 121:return"ellipseRibbon";case 122:return"verticalScroll";case 123:return"horizontalScroll";case 124:return"wave";case 125:return"doubleWave";case 126:return"snip1Rect";case 127:return"snip2SameRect";case 128:return"snip2DiagRect";case 129:return"snipRoundRect";case 130:return"round1Rect";case 131:return"round2SameRect";case 132:return"round2DiagRect";case 133:return"textNoShape";case 134:return"bentConnector3";case 135:return"curvedConnector3";default:return e}},Hui.prototype.getAutoShapeTypeEnumValue=function(e){switch(e){case"Rectangle":return 1;case"RoundedRectangle":return 2;case"StraightConnector":return 3;case"Oval":return 4;case"IsoscelesTriangle":return 5;case"RightTriangle":return 6;case"Parallelogram":return 7;case"Trapezoid":return 8;case"Diamond":return 9;case"RegularPentagon":return 10;case"Hexagon":return 11;case"Heptagon":return 12;case"Octagon":return 13;case"Decagon":return 14;case"Dodecagon":return 15;case"Chord":return 16;case"Teardrop":return 17;case"Frame":return 18;case"HalfFrame":return 19;case"L_Shape":return 20;case"Pie":return 21;case"DiagonalStripe":return 22;case"Cross":return 23;case"Plaque":return 24;case"Can":return 25;case"Cube":return 26;case"Bevel":return 27;case"Donut":return 28;case"NoSymbol":return 29;case"BlockArc":return 30;case"FoldedCorner":return 31;case"SmileyFace":return 32;case"Heart":return 33;case"LightningBolt":return 34;case"Sun":return 35;case"Moon":return 36;case"Cloud":return 37;case"Arc":return 38;case"DoubleBracket":return 39;case"DoubleBrace":return 40;case"LeftBracket":return 41;case"RightBracket":return 42;case"LeftBrace":return 43;case"RightBrace":return 44;case"FlowChartProcess":return 45;case"FlowChartAlternateProcess":return 46;case"FlowChartDecision":return 47;case"FlowChartData":return 48;case"FlowChartPredefinedProcess":return 49;case"FlowChartInternalStorage":return 50;case"FlowChartDocument":return 51;case"FlowChartMultiDocument":return 52;case"FlowChartTerminator":return 53;case"FlowChartPreparation":return 54;case"FlowChartManualInput":return 55;case"FlowChartManualOperation":return 56;case"FlowChartConnector":return 57;case"FlowChartOffPageConnector":return 58;case"FlowChartCard":return 59;case"FlowChartPunchedTape":return 60;case"FlowChartSummingJunction":return 61;case"FlowChartOr":return 62;case"FlowChartCollate":return 63;case"FlowChartSort":return 64;case"FlowChartExtract":return 65;case"FlowChartMerge":return 66;case"FlowChartStoredData":return 67;case"FlowChartDelay":return 68;case"FlowChartSequentialAccessStorage":return 69;case"FlowChartMagneticDisk":return 70;case"FlowChartDirectAccessStorage":return 71;case"FlowChartDisplay":return 72;case"RightArrow":return 73;case"LeftArrow":return 74;case"UpArrow":return 75;case"DownArrow":return 76;case"LeftRightArrow":return 77;case"UpDownArrow":return 78;case"QuadArrow":return 79;case"LeftRightUpArrow":return 80;case"BentArrow":return 81;case"UTurnArrow":return 82;case"LeftUpArrow":return 83;case"BentUpArrow":return 84;case"CurvedRightArrow":return 85;case"CurvedLeftArrow":return 86;case"CurvedUpArrow":return 87;case"CurvedDownArrow":return 88;case"StripedRightArrow":return 89;case"NotchedRightArrow":return 90;case"Pentagon":return 91;case"Chevron":return 92;case"RightArrowCallout":return 93;case"DownArrowCallout":return 94;case"LeftArrowCallout":return 95;case"UpArrowCallout":return 96;case"LeftRightArrowCallout":return 97;case"QuadArrowCallout":return 98;case"CircularArrow":return 99;case"MathPlus":return 100;case"MathMinus":return 101;case"MathMultiply":return 102;case"MathDivision":return 103;case"MathEqual":return 104;case"MathNotEqual":return 105;case"Explosion1":return 106;case"Explosion2":return 107;case"Star4Point":return 108;case"Star5Point":return 109;case"Star6Point":return 110;case"Star7Point":return 111;case"Star8Point":return 112;case"Star10Point":return 113;case"Star12Point":return 114;case"Star16Point":return 115;case"Star24Point":return 116;case"Star32Point":return 117;case"UpRibbon":return 118;case"DownRibbon":return 119;case"CurvedUpRibbon":return 120;case"CurvedDownRibbon":return 121;case"VerticalScroll":return 122;case"HorizontalScroll":return 123;case"Wave":return 124;case"DoubleWave":return 125;case"SnipSingleCornerRectangle":return 126;case"SnipSameSideCornerRectangle":return 127;case"SnipDiagonalCornerRectangle":return 128;case"SnipAndRoundSingleCornerRectangle":return 129;case"RoundSingleCornerRectangle":return 130;case"RoundSameSideCornerRectangle":return 131;case"RoundDiagonalCornerRectangle":return 132;case"Unknown":return 133;case"ElbowConnector":return 134;case"CurvedConnector":return 135;default:return 0}};var _ui=Hui;function Hui(){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.themePath="word/theme/theme1.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.TemplateContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.template.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.themeContentType="application/vnd.openxmlformats-officedocument.theme+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.ThemeRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",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.svgNamespace="http://schemas.microsoft.com/office/drawing/2016/SVG/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,this.isBookmarkAtEnd=!1,this.isBookmarkAtRowEnd=!1,this.isVerticalMergeCell=!1,this.keywordIndex=void 0,this.isHeaderFooter=!1,this.isSerializeFootEndNote=void 0,this.containerWidth=0}jui.prototype.getModuleName=function(){return"TextExport"},jui.prototype.save=function(e,t){this.serialize(e);e=new Gl;this.writeInternal(e),e.save(t+".txt")},jui.prototype.saveAsBlob=function(e){this.serialize(e);var e=new Gl,i=(this.writeInternal(e),e.buffer);return e.destroy(),new Promise(function(e,t){e(i)})},jui.prototype.serialize=function(e){e=e.owner.sfdtExportModule.write(0);this.setDocument(e)},jui.prototype.setDocument=function(e){this.document=e,this.mSections=e.sections},jui.prototype.writeInternal=function(e){var t,i=void 0,n=this.document.sections.length-1;this.updateLastParagraph();for(var o=0;o<=n;o++)i=this.document.sections[o],t=o===n,this.writeBody(e,i.blocks,!1),this.writeNewLine(e),this.writeSectionEnd(i,t);for(var r=0;r<=n;r++)i=this.document.sections[r],this.writeHeadersFooters(e,i)},jui.prototype.writeBody=function(e,t,i){for(var n,o=t.length-1,r=void 0,s=0;s<=o;s++)(r=t[s]).hasOwnProperty("inlines")?(n=r===this.lastPara,this.writeParagraph(e,r,n,i)):r.blocks?this.writeBody(e,r.blocks,i):this.writeTable(e,r)},jui.prototype.writeParagraph=function(e,t,i,n){for(var o=0;o<t.inlines.length;o++){var r=t.inlines[o];r.hasOwnProperty("fieldType")?this.inField=0===r.fieldType:r.hasOwnProperty("text")&&!this.inField&&this.writeText(e,r.text)}n&&!(0<t.inlines.length)||i||this.writeNewLine(e)},jui.prototype.writeTable=function(e,t){for(var i=0;i<t.rows.length;i++)for(var n=t.rows[i],o=0;o<n.cells.length;o++){var r=n.cells[o];this.writeBody(e,r.blocks,!1)}},jui.prototype.writeHeadersFooters=function(e,t){je(t.headersFooters)||(this.writeHeaderFooter(e,t.headersFooters.header),this.writeHeaderFooter(e,t.headersFooters.footer),this.writeHeaderFooter(e,t.headersFooters.evenFooter),this.writeHeaderFooter(e,t.headersFooters.evenHeader),this.writeHeaderFooter(e,t.headersFooters.firstPageHeader),this.writeHeaderFooter(e,t.headersFooters.firstPageFooter))},jui.prototype.writeHeaderFooter=function(e,t){t&&t.blocks&&this.writeBody(e,t.blocks,!0)},jui.prototype.writeSectionEnd=function(e,t){this.curSectionIndex++},jui.prototype.writeNewLine=function(e){je(e)?this.pageContent=this.pageContent+" ":e.writeLine("")},jui.prototype.writeText=function(e,t){je(e)?this.pageContent+=t:e.write(t)},jui.prototype.updateLastParagraph=function(){var e,t=this.document.sections.length;if(!je(e=0<t?this.document.sections[t-1]:e)){for(var i=[],n=0;n<e.blocks.length;n++)e.blocks[n].hasOwnProperty("inlines")&&i.push(e.blocks[n]);t=i.length;0<t&&(this.lastPara=i[t-1])}},jui.prototype.destroy=function(){this.document=void 0,this.lastPara=void 0,this.mSections=void 0,this.sections=[],this.sections=void 0,this.pageContent=void 0};var zui=jui;function jui(){this.pageContent="",this.curSectionIndex=0,this.inField=!1}Object.defineProperty(Qui.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),Object.defineProperty(Qui.prototype,"owner",{get:function(){return this.documentHelper.owner},enumerable:!0,configurable:!0}),Qui.prototype.getModuleName=function(){return"SfdtExport"},Qui.prototype.clear=function(){this.writeInlineStyles=void 0,this.startLine=void 0,this.endLine=void 0,this.lists=void 0,this.images=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,this.keywordIndex=void 0},Qui.prototype.serialize=function(){return this.seralizeInternal(this.owner.documentEditorSettings.optimizeSfdt?1:0)},Qui.prototype.seralizeInternal=function(e){return JSON.stringify(this.write(e))},Qui.prototype.saveAsBlobNonOptimized=function(e){var i=new Blob([this.serialize()],{type:"text/plain"});return new Promise(function(e,t){e(i)})},Qui.prototype.saveAsBlob=function(e){var t=this.serialize(),t=new Blob([t],{type:"application/json"}),t=new ih(t,"sfdt"),i=new Zl;return i.addItem(t),i.saveAsBlob()},Qui.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 o=this.documentHelper.editRanges.get(i[t]),r=0;r<o.length;r++)o[r].editRangeId=++e,je(o[r].editRangeEnd)||(o[r].editRangeEnd.editRangeId=e)},Qui.prototype.write=function(e,t,i,n,o,r,s){if(r&&(this.writeInlineStyles=!0),je(e)?this.keywordIndex=this.owner.documentEditorSettings.optimizeSfdt?1:0:this.keywordIndex=e,this.Initialize(),this.updateEditRangeId(),t instanceof Gai&&n instanceof Gai){this.isExport=!1,je(s)||(this.isExport=s);var r=t.paragraph,a=n.paragraph,l=(this.isPartialExport&&(this.startBlock=this.getParentBlock(r),this.endBlock=this.getParentBlock(a)),r.associatedCell),e=a.associatedCell,h=(r.bodyWidget,this.createSection(t.paragraph.bodyWidget)),s=(this.document[rZt[this.keywordIndex]].push(h),l),d=e,s=(l instanceof Uai&&(s=this.getParentCell(s)),e instanceof Uai&&(d=this.getParentCell(d)),s instanceof Uai&&d instanceof Uai&&s.equals(d)),p=(s||je(e)?(this.startLine=t,this.endLine=n,this.endOffset=o):l instanceof Uai?(m=l.getContainerTable(),d=e.getContainerTable(),m.tableFormat===d.tableFormat&&(this.endCell=e,this.endCell.ownerTable!==l.ownerTable&&l.ownerTable.associatedCell&&l.ownerTable.associatedCell.ownerTable===this.endCell.ownerTable&&0===l.ownerTable.associatedCell.childWidgets.indexOf(l.ownerTable)&&(l=l.ownerTable.associatedCell),this.endColumnIndex=this.endCell.columnIndex+this.endCell.cellFormat.columnSpan,this.startColumnIndex=l.columnIndex)):this.endCell=e,void 0);if(s&&!this.isPartialExport||je(l)){var c,u=t.paragraph,g=this.owner.selection.getLineLength(a.lastChild),n=r===a&&this.endOffset===g+1;for(!this.owner.documentHelper.isCopying||je(r.contentControlProperties)||0!==i&&1!==i||r===a&&!n?(y=this.createParagraph(t.paragraph),h[_ni[this.keywordIndex]].push(y),p=this.writeParagraph(t.paragraph,y,h[_ni[this.keywordIndex]],t.indexInOwner,i)):(this.isContentControl=!0,p=this.writeBlock(u,0,h[_ni[this.keywordIndex]]),n&&(y=this.createParagraph(t.paragraph),h[_ni[this.keywordIndex]].push(y)),this.isContentControl=!1),this.isPartialExport&&(p=this.getNextBlock(p,u),h=this.document[rZt[this.keywordIndex]][this.document[rZt[this.keywordIndex]].length-1]);p;)p.containerWidget instanceof Sai&&u.containerWidget instanceof Sai&&p.containerWidget.sectionIndex!==u.containerWidget.sectionIndex?(h=this.createSection(p.containerWidget),this.document[rZt[this.keywordIndex]].push(h),y=this.createParagraph(p),h[_ni[this.keywordIndex]].push(y),u=p,p=this.writeParagraph(u,y,h[_ni[this.keywordIndex]],t.indexInOwner,i)):(u=p,this.owner.documentHelper.isCopying&&p instanceof Lai&&!je(p.contentControlProperties)&&p===a&&this.endOffset!==g+1?(this.isContentControl=!0,y=this.createParagraph(p),h[_ni[this.keywordIndex]].push(y),c=p.isEmpty()?0:this.owner.selection.getNextValidOffset(p.firstChild,0),p=this.writeParagraph(p,y,h[_ni[this.keywordIndex]],0,c),this.isContentControl=!1):p=this.writeBlock(p,0,h[_ni[this.keywordIndex]]),this.isPartialExport&&je(p)&&(p=this.getNextBlock(p,u),h=this.document[rZt[this.keywordIndex]][this.document[rZt[this.keywordIndex]].length-1]))}else{if(je(e)&&l.ownerTable.associatedCell){var m,o=(m=l.getContainerTable()).childWidgets[m.childWidgets.length-1],f=o.childWidgets[o.childWidgets.length-1];if(f.ownerTable!==l.ownerTable&&l.ownerTable.associatedCell&&0===l.ownerTable.associatedCell.childWidgets.indexOf(l.ownerTable))for(;l.ownerTable!==f.ownerTable;)l=l.ownerTable.associatedCell;this.endColumnIndex=f.columnIndex+f.cellFormat.columnSpan,this.startColumnIndex=l.columnIndex}var y,d=this.createTable(l.ownerTable),u=(h[_ni[this.keywordIndex]].push(d),l.ownerTable);for(p=this.writeTable(l.ownerTable,d,l.ownerRow.indexInOwner,h[_ni[this.keywordIndex]]),this.isPartialExport&&(p=this.getNextBlock(p,u),h=this.document[rZt[this.keywordIndex]][this.document[rZt[this.keywordIndex]].length-1]);p;)p.containerWidget instanceof Sai&&u.containerWidget instanceof Sai&&p.containerWidget.sectionIndex!==u.containerWidget.sectionIndex?(h=this.createSection(p.containerWidget),this.document[rZt[this.keywordIndex]].push(h),y=this.createParagraph(p),h[_ni[this.keywordIndex]].push(y),u=p,p=this.writeParagraph(u,y,h[_ni[this.keywordIndex]],t.indexInOwner,i)):(u=p,p=this.writeBlock(p,0,h[_ni[this.keywordIndex]]),this.isPartialExport&&(p=this.getNextBlock(p,u),h=this.document[rZt[this.keywordIndex]][this.document[rZt[this.keywordIndex]].length-1]))}}else this.isExport=!0,0<this.documentHelper.pages.length?(s=this.documentHelper.pages[0],this.writePage(s,!1)):this.serializeMinimal();this.document[pZt[this.keywordIndex]]=((r={})[tii[this.keywordIndex]]=this.documentHelper.backgroundColor,r),this.writeStyles(this.documentHelper),this.writeLists(this.documentHelper),this.writeComments(this.documentHelper),this.writeRevisions(this.documentHelper),this.writeCustomXml(this.documentHelper),this.writeImages(this.documentHelper),this.footnotes(this.documentHelper),this.endnotes(this.documentHelper);n=this.document;return this.clear(),n},Qui.prototype.serializeMinimal=function(){var e={},t=(e[Gni[this.keywordIndex]]={},e[_ni[this.keywordIndex]]=[],{});t[qii[this.keywordIndex]]=[],e[_ni[this.keywordIndex]].push(t),e[qni[this.keywordIndex]]={},this.document[rZt[this.keywordIndex]].push(e)},Qui.prototype.getNextBlock=function(e,t){return je(e)&&this.isPartialExport&&this.endBlock&&!this.endBlock.equals(t)&&((e=t.getSplitWidgets().pop().nextRenderedWidget)&&t.bodyWidget.index!==e.bodyWidget.index?(t=this.createSection(e.bodyWidget),this.document[rZt[this.keywordIndex]].push(t)):e=void 0),e},Qui.prototype.Initialize=function(){this.lists=[],this.images=[],this.document={},this.document.optimizeSfdt=this.owner.documentEditorSettings.optimizeSfdt,this.document[rZt[this.keywordIndex]]=[],this.document[aZt[this.keywordIndex]]=this.writeCharacterFormat(this.documentHelper.characterFormat,this.keywordIndex),this.document[lZt[this.keywordIndex]]=this.writeParagraphFormat(this.documentHelper.paragraphFormat,this.keywordIndex),je(this.documentHelper.fontSubstitutionTable)||(this.document[sZt[this.keywordIndex]]=this.writeFontSubsitutionTable(this.documentHelper)),this.document[kZt[this.keywordIndex]]=this.writeCharacterFormat(this.documentHelper.themeFontLanguage,this.keywordIndex),this.document[fZt[this.keywordIndex]]=this.documentHelper.defaultTabWidth,this.document[vZt[this.keywordIndex]]=Y.getBoolInfo(this.owner.enableTrackChanges,this.keywordIndex),this.document[wZt[this.keywordIndex]]=Y.getBoolInfo(this.documentHelper.isDocumentProtected,this.keywordIndex),this.document[CZt[this.keywordIndex]]=this.documentHelper.hashValue,this.document[SZt[this.keywordIndex]]=this.documentHelper.saltValue,this.document[yZt[this.keywordIndex]]=Y.getBoolInfo(this.documentHelper.restrictFormatting,this.keywordIndex),this.document[bZt[this.keywordIndex]]=1==this.keywordIndex?this.getProtectionTypeEnumValue(this.documentHelper.protectionType):this.documentHelper.protectionType,this.document[AZt[this.keywordIndex]]=Y.getBoolInfo(this.documentHelper.dontUseHtmlParagraphAutoSpacing,this.keywordIndex),this.document[IZt[this.keywordIndex]]=Y.getBoolInfo(this.documentHelper.owner.documentEditorSettings.formFieldSettings.applyShading,this.keywordIndex),this.document[MZt[this.keywordIndex]]=1==this.keywordIndex?this.getCompatibilityModeEnumValue(this.documentHelper.compatibilityMode):this.documentHelper.compatibilityMode,this.document[Woi[this.keywordIndex]]=Y.getBoolInfo(this.documentHelper.allowSpaceOfSameStyleInTable,this.keywordIndex),this.documentHelper.hasThemes&&(this.document[PZt[this.keywordIndex]]=this.writeThemes(this.documentHelper.themes))},Qui.prototype.writeFontSubsitutionTable=function(e){for(var t={},i=0;i<e.fontSubstitutionTable.length;i++){var n=e.fontSubstitutionTable.keys[i];t[n]=this.documentHelper.fontSubstitutionTable.get(n)}return t},Qui.prototype.writePage=function(e,t){if(this.skipExporting=t,0<e.bodyWidgets.length)for(var i=e.bodyWidgets[0];!je(i=this.writeBodyWidget(i,0)););return this.skipExporting=!1,this.document},Qui.prototype.writeBodyWidget=function(e,t){if(e instanceof Sai){var i=this.createSection(e),n=(this.document[rZt[this.keywordIndex]].push(i),this.writeHeaderFooters(this.documentHelper.headersFooters[e.index],i),e.childWidgets[t]);for(je(n)&&e.nextRenderedWidget&&(n=e.nextRenderedWidget.childWidgets[t]);n=this.writeBlock(n,0,i[_ni[this.keywordIndex]]););for(var o=e;(o=!je(o=(e=o).nextRenderedWidget)||je(e.page.nextPage)||je(e.page.nextPage)?o:e.page.nextPage.bodyWidgets[0])instanceof Sai&&o.index===e.index;);return o}},Qui.prototype.writeHeaderFooters=function(e,t){je(e)||(t=t[qni[this.keywordIndex]],je(e[0])||e[0].isEmpty||(t[Hni[this.keywordIndex]]=this.writeHeaderFooter(e[0]),"{}"==JSON.stringify(t[Hni[this.keywordIndex]])&&delete t[Hni[this.keywordIndex]]),je(e[1])||e[1].isEmpty||(t[zni[this.keywordIndex]]=this.writeHeaderFooter(e[1]),"{}"==JSON.stringify(t[zni[this.keywordIndex]])&&delete t[zni[this.keywordIndex]]),je(e[2])||e[2].isEmpty||(t[jni[this.keywordIndex]]=this.writeHeaderFooter(e[2]),"{}"==JSON.stringify(t[jni[this.keywordIndex]])&&delete t[jni[this.keywordIndex]]),je(e[3])||e[3].isEmpty||(t[Wni[this.keywordIndex]]=this.writeHeaderFooter(e[3]),"{}"==JSON.stringify(t[Wni[this.keywordIndex]])&&delete t[Wni[this.keywordIndex]]),je(e[4])||e[4].isEmpty||(t[Qni[this.keywordIndex]]=this.writeHeaderFooter(e[4]),"{}"==JSON.stringify(t[Qni[this.keywordIndex]])&&delete t[Qni[this.keywordIndex]]),je(e[5]))||e[5].isEmpty||(t[Uni[this.keywordIndex]]=this.writeHeaderFooter(e[5]),"{}"==JSON.stringify(t[Uni[this.keywordIndex]])&&delete t[Uni[this.keywordIndex]])},Qui.prototype.writeHeaderFooter=function(e){if(!je(e)&&!e.isEmpty){var t={};if(e&&e.childWidgets&&0<e.childWidgets.length){t[_ni[this.keywordIndex]]=[];for(var i=e.firstChild;i=this.writeBlock(i,0,t[_ni[this.keywordIndex]]););}return t}},Qui.prototype.createSection=function(e){var t={};return t[Gni[this.keywordIndex]]={},t[Gni[this.keywordIndex]]=this.writeSectionFormat(e.sectionFormat,t[Gni[this.keywordIndex]],this.keywordIndex),t[_ni[this.keywordIndex]]=[],t[qni[this.keywordIndex]]={},t},Qui.prototype.writeSectionFormat=function(e,t,i){if(!this.skipExporting&&(t[O$t[i]]=e.pageWidth,t[N$t[i]]=e.pageHeight,t[V$t[i]]=e.leftMargin,t[_$t[i]]=e.rightMargin,t[H$t[i]]=e.topMargin,t[z$t[i]]=e.bottomMargin,t[B$t[i]]=e.headerDistance,t[F$t[i]]=e.footerDistance,t[L$t[i]]=Y.getBoolInfo(e.differentFirstPage,i),t[R$t[i]]=Y.getBoolInfo(e.differentOddAndEvenPages,i),t[JZt[i]]=Y.getBoolInfo(e.bidi,i),je(e.breakCode)||(t[tei[i]]=e.breakCode),e.restartPageNumbering&&(t[j$t[i]]=Y.getBoolInfo(e.restartPageNumbering,i),t[W$t[i]]=e.pageStartingNumber),t[Q$t[i]]=1==i?this.getFootEndNoteNumberFormatEnumValue(e.endnoteNumberFormat):e.endnoteNumberFormat,t[U$t[i]]=1==i?this.getFootEndNoteNumberFormatEnumValue(e.footNoteNumberFormat):e.footNoteNumberFormat,t[q$t[i]]=1==i?this.getFootnoteRestartIndexEnumValue(e.restartIndexForFootnotes):e.restartIndexForFootnotes,t[G$t[i]]=1==i?this.getFootnoteRestartIndexEnumValue(e.restartIndexForEndnotes):e.restartIndexForEndnotes,t[Y$t[i]]=e.initialFootNoteNumber,t[X$t[i]]=e.initialEndNoteNumber,je(e.pageNumberStyle)||(t[K$t[i]]=e.pageNumberStyle),!je(e.columns))&&!je(e.numberOfColumns&&1<e.numberOfColumns)){var n=e.columns;t[Z$t[i]]=e.numberOfColumns,t[$$t[i]]=Y.getBoolInfo(e.equalWidth,i),t[eei[i]]=Y.getBoolInfo(e.lineBetweenColumns,i),t[J$t[i]]=[];for(var o=0;o<n.length;o++){var r={};r[Vti[i]]=Y.convertPixelToPoint(n[o].width),r[Coi[i]]=Y.convertPixelToPoint(n[o].space),t[J$t[i]].push(r)}}return t},Qui.prototype.writeBlock=function(e,t,i){var n,o;if(e instanceof Dai)return e instanceof Lai?e.hasOwnProperty("contentControlProperties")&&e.contentControlProperties&&"BuildingBlockGallery"!==e.contentControlProperties.type?(o=this.blockContentControl(e),this.blockContent=!1,je(o)||!this.isBlockClosed&&this.nestedBlockContent||(this.nestedBlockEnabled=!1,i.push(o),this.blocks=[]),this.nextBlock):(n=this.createParagraph(e),i.push(n),this.writeParagraph(e,n,i)):(n=e).hasOwnProperty("contentControlProperties")&&n.contentControlProperties&&"BuildingBlockGallery"!==n.contentControlProperties.type?(!je(o=this.tableContentControl(n))&&this.isBlockClosed&&i.push(o),this.nextBlock):(e=this.createTable(n),i.push(e),this.writeTable(n,e,0,i))},Qui.prototype.writeParagraphs=function(e){var t=this.blocks,i=e.childWidgets[0],n=i.children[0],o=i.children[1];return(n instanceof lhi||o instanceof lhi)&&(n=i.children[2],o=i.children[3]),this.nestedBlockEnabled&&(t=[]),(n instanceof Pli&&o instanceof Pli&&!this.nestedBlockContent||this.blockContent&&n instanceof Pli&&!this.nestedBlockContent)&&(i=!1,(i=o instanceof Pli&&"Block"===o.contentControlWidgetType?!0:i)||this.blockContent&&n instanceof Pli&&!this.nestedBlockContent&&0===n.type&&o instanceof Pli&&"Block"===n.contentControlWidgetType)?(this.nestedBlockContent=!0,this.nestedBlockEnabled=!0,je(i=this.blockContentControl(e))||this.blocks.push(i)):(o=this.createParagraph(e),t.push(o),this.nextBlock=this.writeParagraph(e,o,t)),!this.nestedBlockContent&&this.nestedBlockEnabled&&(this.nestedBlockEnabled=!1),t},Qui.prototype.contentControlProperty=function(e,t){je(t)&&(t=this.keywordIndex);var i,n,o={},r=[];if(o[Yii[t]]=Y.getBoolInfo(e.lockContentControl,t),o[Xii[t]]=Y.getBoolInfo(e.lockContents,t),o[Kii[t]]=e.tag,o[tii[t]]=e.color,o[Jii[t]]=e.title,je(e.appearance)||(o[zoi[t]]=1==t?this.getContentControlAppearanceEnumValue(e.appearance):e.appearance),o[koi[t]]=1==t?this.getContentControlTypeEnumValue(e.type):e.type,o[Zii[t]]=Y.getBoolInfo(e.hasPlaceHolderText,t),o[$ii[t]]=Y.getBoolInfo(e.multiline,t),o[eni[t]]=Y.getBoolInfo(e.isTemporary,t),je(e.isChecked)||(o[rni[t]]=Y.getBoolInfo(e.isChecked,t)),je(e.uncheckedState)||(o[sni[t]]=this.tounCheckedState(e.uncheckedState)),je(e.checkedState)||(o[ani[t]]=this.toCheckedState(e.checkedState)),je(e.dateCalendarType)||(o[tni[t]]=1==t?this.getDateCalendarTypeEnumValue(e.dateCalendarType):e.dateCalendarType),je(e.dateStorageFormat)||(o[ini[t]]=1==t?this.getDateStorageFormatEnumValue(e.dateStorageFormat):e.dateStorageFormat),je(e.dateDisplayLocale)||(o[nni[t]]=e.dateDisplayLocale),je(e.dateDisplayFormat)||(o[oni[t]]=e.dateDisplayFormat),je(e.xmlMapping)||(n={},(i={})[uni[t]]=Y.getBoolInfo(e.xmlMapping.isMapped,t),i[gni[t]]=Y.getBoolInfo(e.xmlMapping.isWordMl,t),je(e.xmlMapping.prefixMapping)||(i[mni[t]]=e.xmlMapping.prefixMapping),i[fni[t]]=e.xmlMapping.xPath,i[yni[t]]=e.xmlMapping.storeItemId,je(e.xmlMapping.customXmlPart)||(n[bni[t]]=e.xmlMapping.customXmlPart.id,n[zii[t]]=e.xmlMapping.customXmlPart.xml,i[vni[t]]=n),o[hni[t]]=i),je(e.characterFormat)||(o[aZt[t]]=this.writeCharacterFormat(e.characterFormat,t)),!je(e.contentControlListItems))for(var s=0;s<e.contentControlListItems.length;s++){var a={};a[cni[t]]=e.contentControlListItems[s].displayText,a[pni[t]]=e.contentControlListItems[s].value,r.push(a)}return o[lni[t]]=r,o},Qui.prototype.tounCheckedState=function(e){var t={};return t[dni[this.keywordIndex]]=e.font,t[pni[this.keywordIndex]]=e.value,t},Qui.prototype.toCheckedState=function(e){var t={};return t[dni[this.keywordIndex]]=e.font,t[pni[this.keywordIndex]]=e.value,t},Qui.prototype.blockContentControl=function(e){var t={};if(0===e.childWidgets.length)this.nextBlock=e.nextWidget;else{if(this.isBlockClosed||!this.nestedBlockContent||je(e.associatedCell)||je(e.associatedCell.ownerTable)||je(e.associatedCell.ownerTable.contentControlProperties)||(this.nestedBlockEnabled=!0),t[_ni[this.keywordIndex]]=this.writeParagraphs(e),!je(this.nextBlock)&&e.contentControlProperties===this.nextBlock.contentControlProperties)return this.isBlockClosed=!1,this.nestedBlockContent=!0,this.blocks=t[_ni[this.keywordIndex]];if(this.isBlockClosed=!0,!je(t[_ni[this.keywordIndex]])){var i=e.childWidgets[0],n=i.children[0],o=i.children[1];if((n instanceof lhi||o instanceof lhi)&&(n=i.children[2],o=i.children[3]),n instanceof Pli&&o instanceof Pli&&!this.nestedBlockContent||this.blockContent&&n instanceof Pli&&!this.nestedBlockContent){if(!(o instanceof Pli))return t[Gii[this.keywordIndex]]=this.contentControlProperty(n.contentControlProperties),t;"Block"===o.contentControlWidgetType?t[Gii[this.keywordIndex]]=this.contentControlProperty(o.contentControlProperties):t[Gii[this.keywordIndex]]=this.contentControlProperty(e.contentControlProperties)}else t[Gii[this.keywordIndex]]=this.contentControlProperty(e.contentControlProperties);return t}}},Qui.prototype.tableContentControl=function(e){var t={};if(t[_ni[this.keywordIndex]]=this.tableContentControls(e),!je(this.nextBlock)){if(e.contentControlProperties===this.nextBlock.contentControlProperties)return this.isBlockClosed=!1,this.blocks=t[_ni[this.keywordIndex]];this.isBlockClosed=!0}return t[Gii[this.keywordIndex]]=this.contentControlProperty(e.contentControlProperties),t},Qui.prototype.tableContentControls=function(e){var t=[],i=(this.isBlockClosed||(t=this.blocks),this.createTable(e));return t.push(i),this.nextBlock=this.writeTable(e,i,0,t),t},Qui.prototype.writeParagraph=function(e,t,i,n,o){je(n)&&(n=0),je(o)&&(o=0);for(var r,s,a=e;a instanceof Lai;){if(this.writeLines(a,n,o,t[qii[this.keywordIndex]]))return void(this.endLine!==a.lastChild||this.endOffset!==this.owner.selection.getLineLength(a.lastChild)+1||-1!==a.paragraphFormat.listFormat.listId||this.isContentControl||i.push(this.createParagraph(a)));o=n=0,a=(e=a).nextSplitWidget}return a=e.nextRenderedWidget,"Continuous"!==this.documentHelper.owner.layoutType&&je(a)&&e.containerWidget instanceof Sai&&!je(e.containerWidget.page)&&!je(e.containerWidget.page.nextPage)&&!je(e.containerWidget.page.nextPage.bodyWidgets)&&(a=e.containerWidget.page.nextPage.bodyWidgets[0].childWidgets[0]),!this.isExport||(r=a instanceof Dai&&e.containerWidget.index===a.containerWidget.index,s=a instanceof Dai&&a.containerWidget instanceof Uai,r)||s?a:void 0},Qui.prototype.writeInlines=function(e,t,i){for(var n=t,o=!(this.contentInline=[]),r=0;r<n.children.length;r++){var s,a=n.children[r];if(this.isExport&&this.checkboxOrDropdown){if(o&&a instanceof pli)continue;a instanceof Zai&&2===a.fieldType&&(o=!0)}a instanceof lhi||(a instanceof fli?i.push(this.writeInlinesFootNote(a)):(a instanceof Pli||this.startContent&&!this.blockContent?this.writeInlinesContentControl(a,t,i,r):!this.skipExporting&&a instanceof pli&&!je(a.previousNode)&&a.previousNode instanceof pli&&!this.isSpecialCharacter(a.text)&&!this.isSpecialCharacter(a.previousNode.text)&&a.previousNode.characterFormat.isEqualFormat(a.characterFormat)&&a.previousNode.scriptType===a.scriptType&&0===a.revisions.length&&0===a.previousNode.revisions.length&&0<a.previousNode.text.length&&"-"!==a.previousNode.text[a.previousNode.text.length-1]&&0<i.length?(s=a.text,this.isWriteEndFootNote||!je(this.owner.editorModule)&&this.owner.editorModule.isPaste||(s=Y.removeInvalidXmlChars(s)),-1!==(s=this.isWriteInlinesFootNote&&0===a.indexInOwner&&0===a.line.indexInOwner&&0==a.paragraph.indexInOwner&&Y.checkTextFormat(s)?"":s).indexOf(String.fromCharCode(30))?s.replace(/\u001e/g,"-"):-1!==s.indexOf(String.fromCharCode(31))&&s.replace(/\u001f/g,""),i[i.length-1][Bti[this.keywordIndex]]+=s):je(s=this.writeInline(a))||i.push(s),this.isExport&&a instanceof Zai&&1===a.fieldType&&(this.checkboxOrDropdown=o=!1)))}},Qui.prototype.isSpecialCharacter=function(e){return-1!==["\t","\v","\f","\r",String.fromCharCode(14),String.fromCharCode(31),String.fromCharCode(8194)].indexOf(e)},Qui.prototype.inlineContentControl=function(e,t,i){var n={},o=[];if(je(i)?this.nestedContent?(n[qii[this.keywordIndex]]=this.inlineContentControls(e,void 0,o),je(this.nestedContentProperty(t,n))&&!this.multipleLineContent||(this.contentInline.push(n),o=[])):n[qii[this.keywordIndex]]=this.inlineContentControls(e,this.contentInline):this.nestedContent?(null==(i=i[i.length-1][qii[this.keywordIndex]])[i.length-1][qii[this.keywordIndex]]&&(i[i.length-1][qii[this.keywordIndex]]=[]),n=this.inlineContentControls(e,i[i.length-1][qii[this.keywordIndex]]),je(this.nestedContentProperty(t,i[i.length-1]))||(this.contentInline.push(n),o=[])):this.inlineContentControls(e,i[i.length-1][qii[this.keywordIndex]]),t instanceof Pli&&1===t.type&&!this.nestedContent){if(!this.multipleLineContent||je(i))return n[Gii[this.keywordIndex]]=this.contentControlProperty(t.contentControlProperties),n;i[i.length-1][Gii[this.keywordIndex]]=this.contentControlProperty(t.contentControlProperties),this.multipleLineContent=!1}else if(this.startContent)return this.multipleLineContent=!0,n},Qui.prototype.nestedContentProperty=function(e,t,i){return!je(e)&&1===e.type?(t[Gii[this.keywordIndex]]=this.contentControlProperty(e.contentControlProperties),t):this.startContent?(this.multipleLineContent=!0,t):void 0},Qui.prototype.inlineContentControls=function(e,t,i){e=this.writeInline(e);return je(i)?(t.push(e),t):(i.push(e),i)},Qui.prototype.writeInline=function(e){var t,i={};if(0<e.removedIds.length)for(var n=0;n<e.removedIds.length;n++)e.revisions[n]=this.documentHelper.revisionsInternal.get(e.removedIds[n]);if(i[aZt[this.keywordIndex]]=this.writeCharacterFormat(e.characterFormat,this.keywordIndex),e instanceof Zai)i[fii[this.keywordIndex]]=e.fieldType,0===e.fieldType&&(i[gii[this.keywordIndex]]=e.hasFieldEnd,e.formFieldData)&&(i[mii[this.keywordIndex]]={},i[mii[this.keywordIndex]][BZt[this.keywordIndex]]=e.formFieldData.name,i[mii[this.keywordIndex]][yii[this.keywordIndex]]=Y.getBoolInfo(e.formFieldData.enabled,this.keywordIndex),i[mii[this.keywordIndex]][vii[this.keywordIndex]]=e.formFieldData.helpText,i[mii[this.keywordIndex]][bii[this.keywordIndex]]=e.formFieldData.statusText,e.formFieldData instanceof ili?(i[mii[this.keywordIndex]][wii[this.keywordIndex]]={},i[mii[this.keywordIndex]][wii[this.keywordIndex]][koi[this.keywordIndex]]=1==this.keywordIndex?this.getTextFormFieldTypeEnumValue(e.formFieldData.type):e.formFieldData.type,i[mii[this.keywordIndex]][wii[this.keywordIndex]][Aii[this.keywordIndex]]=e.formFieldData.maxLength,i[mii[this.keywordIndex]][wii[this.keywordIndex]][xii[this.keywordIndex]]=e.formFieldData.defaultValue,i[mii[this.keywordIndex]][wii[this.keywordIndex]][Iii[this.keywordIndex]]=1==this.keywordIndex&&"Text"===e.formFieldData.type?this.getTextFormFieldFormatEnumValue(e.formFieldData.format):e.formFieldData.format):e.formFieldData instanceof rli?(i[mii[this.keywordIndex]][Cii[this.keywordIndex]]={},this.checkboxOrDropdown=!0,i[mii[this.keywordIndex]][Cii[this.keywordIndex]][Tii[this.keywordIndex]]=1==this.keywordIndex?this.getCheckBoxSizeTypeEnumValue(e.formFieldData.sizeType):e.formFieldData.sizeType,i[mii[this.keywordIndex]][Cii[this.keywordIndex]][Eii[this.keywordIndex]]=e.formFieldData.size,i[mii[this.keywordIndex]][Cii[this.keywordIndex]][xii[this.keywordIndex]]=Y.getBoolInfo(e.formFieldData.defaultValue,this.keywordIndex),i[mii[this.keywordIndex]][Cii[this.keywordIndex]][Dii[this.keywordIndex]]=Y.getBoolInfo(e.formFieldData.checked,this.keywordIndex)):(i[mii[this.keywordIndex]][Sii[this.keywordIndex]]={},this.checkboxOrDropdown=!0,i[mii[this.keywordIndex]][Sii[this.keywordIndex]][Mii[this.keywordIndex]]=e.formFieldData.dropdownItems,i[mii[this.keywordIndex]][Sii[this.keywordIndex]][kii[this.keywordIndex]]=e.formFieldData.selectedIndex)),e.fieldCodeType&&""!==e.fieldCodeType&&(i.fieldCodeType=e.fieldCodeType);else if(e instanceof yhi)this.writeChart(e,i);else if(e instanceof rhi)i[oii[this.keywordIndex]]=e.imageString,this.images.push(parseInt(e.imageString,10)),i[rii[this.keywordIndex]]=e.metaFileImageString,i[aii[this.keywordIndex]]=Y.getBoolInfo(e.isMetaFile,this.keywordIndex),i[Goi[this.keywordIndex]]=e.isCompressed,i[Vti[this.keywordIndex]]=Y.convertPixelToPoint(e.width),i[_ti[this.keywordIndex]]=Y.convertPixelToPoint(e.height),e.isCrop&&(i[hii[this.keywordIndex]]=e.bottom,i[dii[this.keywordIndex]]=e.right,i[pii[this.keywordIndex]]=e.left,i[lii[this.keywordIndex]]=e.top,i[uii[this.keywordIndex]]=e.cropWidthScale,i[cii[this.keywordIndex]]=e.cropHeightScale),i[BZt[this.keywordIndex]]=e.name,i[Lti[this.keywordIndex]]=e.alternateText,i[Jii[this.keywordIndex]]=e.title,i[Rti[this.keywordIndex]]=Y.getBoolInfo(e.visible,this.keywordIndex),i[Hti[this.keywordIndex]]=e.widthScale,i[zti[this.keywordIndex]]=e.heightScale,i[Rni[this.keywordIndex]]=Y.convertPixelToPoint(e.verticalPosition),i[Lni[this.keywordIndex]]=1==this.keywordIndex?this.getVerticalOriginEnumValue(e.verticalOrigin):e.verticalOrigin,i[rei[this.keywordIndex]]=1==this.keywordIndex?this.getShapeVerticalAlignmentEnumValue(e.verticalAlignment):e.verticalAlignment,i[Vni[this.keywordIndex]]=Y.convertPixelToPoint(e.horizontalPosition),i[Oni[this.keywordIndex]]=1==this.keywordIndex?this.getHorizontalOriginEnumValue(e.horizontalOrigin):e.horizontalOrigin,i[Nni[this.keywordIndex]]=1==this.keywordIndex?this.getShapeHorizontalAlignmentEnumValue(e.horizontalAlignment):e.horizontalAlignment,i[Mni[this.keywordIndex]]=Y.getBoolInfo(e.allowOverlap,this.keywordIndex),i[Qti[this.keywordIndex]]=1==this.keywordIndex?this.getTextWrappingStyleEnumValue(e.textWrappingStyle):e.textWrappingStyle,i[Uti[this.keywordIndex]]=1==this.keywordIndex?this.getTextWrappingTypeEnumValue(e.textWrappingType):e.textWrappingType,i[Oti[this.keywordIndex]]=Y.getBoolInfo(e.isBelowText,this.keywordIndex),je(e.distanceBottom)||(i[Fni[this.keywordIndex]]=Y.convertPixelToPoint(e.distanceBottom)),je(e.distanceLeft)||(i[Bni[this.keywordIndex]]=Y.convertPixelToPoint(e.distanceLeft)),je(e.distanceRight)||(i[Pni[this.keywordIndex]]=Y.convertPixelToPoint(e.distanceRight)),je(e.distanceTop)||(i[kni[this.keywordIndex]]=Y.convertPixelToPoint(e.distanceTop)),i[Jti[this.keywordIndex]]=Y.getBoolInfo(e.layoutInCell,this.keywordIndex),i[Kti[this.keywordIndex]]=e.zOrderPosition;else if(e instanceof Dli)i[hoi[this.keywordIndex]]=e.bookmarkType,i[BZt[this.keywordIndex]]=e.name,je(e.properties)||(t={},je(e.properties.isAfterParagraphMark)||(t[Koi[this.keywordIndex]]=Y.getBoolInfo(e.properties.isAfterParagraphMark,this.keywordIndex)),je(e.properties.isAfterTableMark)||(t[tri[this.keywordIndex]]=Y.getBoolInfo(e.properties.isAfterTableMark,this.keywordIndex)),je(e.properties.isAfterRowMark)||(t[Zoi[this.keywordIndex]]=Y.getBoolInfo(e.properties.isAfterRowMark,this.keywordIndex)),je(e.properties.isAfterCellMark)||(t[Joi[this.keywordIndex]]=Y.getBoolInfo(e.properties.isAfterCellMark,this.keywordIndex)),je(e.properties.columnFirst)||(t[foi[this.keywordIndex]]=e.properties.columnFirst),je(e.properties.columnLast)||(t[yoi[this.keywordIndex]]=e.properties.columnLast),i[doi[this.keywordIndex]]=t);else if(e instanceof pdi)i[$Zt[this.keywordIndex]]=1==this.keywordIndex?Y.getBreakClearType(e.breakClearType):e.breakClearType;else if(e instanceof fli)i=this.writeInlinesFootNote(e);else if(e instanceof pli){var o=e.text;if(this.isWriteEndFootNote||!je(this.owner.editorModule)&&this.owner.editorModule.isPaste||(o=Y.removeInvalidXmlChars(o)),-1!==(o=this.isWriteInlinesFootNote&&0===e.indexInOwner&&0===e.line.indexInOwner&&0==e.paragraph.indexInOwner&&Y.checkTextFormat(o)?"":o).indexOf(String.fromCharCode(30)))i[Bti[this.keywordIndex]]=o.replace(/\u001e/g,"-");else if(-1!==o.indexOf(String.fromCharCode(31)))i[Bti[this.keywordIndex]]=o.replace(/\u001f/g,"");else if(e instanceof mdi)i[Bti[this.keywordIndex]]="";else if(0!==e.revisions.length)if(this.isExport||!this.owner.enableTrackChanges||this.isPartialExport)i[Bti[this.keywordIndex]]=o;else{this.copyWithTrackChange=!0;for(var r=0;r<e.revisions.length;r++){var s=e.revisions[r];-1===this.selectedRevisionId.indexOf(s.revisionID)&&this.selectedRevisionId.push(s.revisionID),"Deletion"!==e.revisions[r].revisionType&&(i[Bti[this.keywordIndex]]=o)}}else i[Bti[this.keywordIndex]]=o}else if(e instanceof ghi)""!==e.user&&(i[voi[this.keywordIndex]]=e.user),i[boi[this.keywordIndex]]=e.group,i[foi[this.keywordIndex]]=e.columnFirst,i[yoi[this.keywordIndex]]=e.columnLast,i[moi[this.keywordIndex]]=e.editRangeId.toString();else if(e instanceof phi)i[woi[this.keywordIndex]]={},i[woi[this.keywordIndex]][voi[this.keywordIndex]]=e.editRangeStart.user,i[woi[this.keywordIndex]][boi[this.keywordIndex]]=e.editRangeStart.group,i[woi[this.keywordIndex]][foi[this.keywordIndex]]=e.editRangeStart.columnFirst,i[woi[this.keywordIndex]][yoi[this.keywordIndex]]=e.editRangeStart.columnLast,i[moi[this.keywordIndex]]=e.editRangeId.toString();else if(e instanceof Khi){if(!this.iscontentInsert)return;this.isExport||0!==e.commentType||this.selectedCommentsId.push(e.commentId),i[Bii[this.keywordIndex]]=e.commentType,i[Pii[this.keywordIndex]]=e.commentId}else e instanceof Xli?this.writeShape(e,i):i=void 0;return this.writeInlineRevisions(i,e),i},Qui.prototype.writeInlineRevisions=function(e,t){if(0<t.revisions.length&&(this.isExport||!this.isExport&&!this.owner.enableTrackChanges)){e[h$t[this.keywordIndex]]=[];for(var i=0;i<t.revisions.length;i++)-1===this.selectedRevisionId.indexOf(t.revisions[i].revisionID)&&this.selectedRevisionId.push(t.revisions[i].revisionID),e[h$t[this.keywordIndex]].push(t.revisions[i].revisionID)}},Qui.prototype.writeShape=function(e,t){if(t[Fti[this.keywordIndex]]=e.shapeId,t[BZt[this.keywordIndex]]=e.name,t[Lti[this.keywordIndex]]=e.alternateText,t[Jii[this.keywordIndex]]=e.title,t[Rti[this.keywordIndex]]=Y.getBoolInfo(e.visible,this.keywordIndex),t[Vti[this.keywordIndex]]=Y.convertPixelToPoint(e.width),t[_ti[this.keywordIndex]]=Y.convertPixelToPoint(e.height),e.isZeroHeight?t[_ti[this.keywordIndex]]=0:t[_ti[this.keywordIndex]]=Y.convertPixelToPoint(e.height),t[Hti[this.keywordIndex]]=e.widthScale,t[zti[this.keywordIndex]]=e.heightScale,t[Rni[this.keywordIndex]]=Y.convertPixelToPoint(e.verticalPosition),t[Lni[this.keywordIndex]]=1==this.keywordIndex?this.getVerticalOriginEnumValue(e.verticalOrigin):e.verticalOrigin,t[rei[this.keywordIndex]]=1==this.keywordIndex?this.getShapeVerticalAlignmentEnumValue(e.verticalAlignment):e.verticalAlignment,t[qti[this.keywordIndex]]=e.verticalRelativePercent,t[Vni[this.keywordIndex]]=Y.convertPixelToPoint(e.horizontalPosition),t[Oni[this.keywordIndex]]=1==this.keywordIndex?this.getHorizontalOriginEnumValue(e.horizontalOrigin):e.horizontalOrigin,t[Nni[this.keywordIndex]]=1==this.keywordIndex?this.getShapeHorizontalAlignmentEnumValue(e.horizontalAlignment):e.horizontalAlignment,t[Gti[this.keywordIndex]]=e.horizontalRelativePercent,t[Yti[this.keywordIndex]]=e.heightRelativePercent,t[Xti[this.keywordIndex]]=e.widthRelativePercent,t[Kti[this.keywordIndex]]=e.zOrderPosition,t[Mni[this.keywordIndex]]=Y.getBoolInfo(e.allowOverlap,this.keywordIndex),t[Qti[this.keywordIndex]]=1==this.keywordIndex?this.getTextWrappingStyleEnumValue(e.textWrappingStyle):e.textWrappingStyle,t[Uti[this.keywordIndex]]=1==this.keywordIndex?this.getTextWrappingTypeEnumValue(e.textWrappingType):e.textWrappingType,t[Oti[this.keywordIndex]]=Y.getBoolInfo(e.isBelowText,this.keywordIndex),t[Nti[this.keywordIndex]]=Y.getBoolInfo(e.isHorizontalRule,this.keywordIndex),je(e.distanceBottom)||(t[Fni[this.keywordIndex]]=Y.convertPixelToPoint(e.distanceBottom)),je(e.distanceLeft)||(t[Bni[this.keywordIndex]]=Y.convertPixelToPoint(e.distanceLeft)),je(e.distanceRight)||(t[Pni[this.keywordIndex]]=Y.convertPixelToPoint(e.distanceRight)),je(e.distanceTop)||(t[kni[this.keywordIndex]]=Y.convertPixelToPoint(e.distanceTop)),t[Jti[this.keywordIndex]]=Y.getBoolInfo(e.layoutInCell,this.keywordIndex),t[Zti[this.keywordIndex]]=Y.getBoolInfo(e.lockAnchor,this.keywordIndex),t[$ti[this.keywordIndex]]=1==this.keywordIndex?this.getAutoShapeTypeEnumValue(e.autoShapeType):e.autoShapeType,e.fillFormat&&(t[Wti[this.keywordIndex]]={},t[Wti[this.keywordIndex]][tii[this.keywordIndex]]=e.fillFormat.color,t[Wti[this.keywordIndex]][iii[this.keywordIndex]]=Y.getBoolInfo(e.fillFormat.fill,this.keywordIndex)),e.lineFormat&&(t[jti[this.keywordIndex]]={},t[jti[this.keywordIndex]][joi[this.keywordIndex]]=1==this.keywordIndex?this.getLineFormatTypeEnumValue(e.lineFormat.lineFormatType):e.lineFormat.lineFormatType,t[jti[this.keywordIndex]][tii[this.keywordIndex]]=e.lineFormat.color,t[jti[this.keywordIndex]][Qoi[this.keywordIndex]]=e.lineFormat.weight,t[jti[this.keywordIndex]][Pei[this.keywordIndex]]=1==this.keywordIndex?this.getLineDashStyleEnumValue(e.lineFormat.dashStyle):e.lineFormat.dashStyle,t[jti[this.keywordIndex]][Vei[this.keywordIndex]]=Y.getBoolInfo(e.lineFormat.line,this.keywordIndex)),e.textFrame){t[eii[this.keywordIndex]]={},t[eii[this.keywordIndex]][nii[this.keywordIndex]]=1==this.keywordIndex?this.getTextVerticalAlignmentEnumValue(e.textFrame.textVerticalAlignment):e.textFrame.textVerticalAlignment,t[eii[this.keywordIndex]][V$t[this.keywordIndex]]=Y.convertPixelToPoint(e.textFrame.marginLeft),t[eii[this.keywordIndex]][_$t[this.keywordIndex]]=Y.convertPixelToPoint(e.textFrame.marginRight),t[eii[this.keywordIndex]][H$t[this.keywordIndex]]=Y.convertPixelToPoint(e.textFrame.marginTop),t[eii[this.keywordIndex]][z$t[this.keywordIndex]]=Y.convertPixelToPoint(e.textFrame.marginBottom),t[eii[this.keywordIndex]][_ni[this.keywordIndex]]=[];for(var i=0;i<e.textFrame.childWidgets.length;i++){var n=e.textFrame.childWidgets[i];n.hasOwnProperty("contentControlProperties")&&!je(e.paragraph)&&e.paragraph.hasOwnProperty("contentControlProperties")&&(this.blocks=[]),this.writeBlock(n,0,t[eii[this.keywordIndex]][_ni[this.keywordIndex]])}}},Qui.prototype.writeChart=function(e,t){t[xti[this.keywordIndex]]={},t[Sti[this.keywordIndex]]={},t[Cti[this.keywordIndex]]={},t[Ati[this.keywordIndex]]={},t[bti[this.keywordIndex]]=[],t[wti[this.keywordIndex]]=[],t[Iti[this.keywordIndex]]={},t[Tti[this.keywordIndex]]={},this.writeChartTitleArea(e.chartTitleArea,t[Sti[this.keywordIndex]]),this.writeChartArea(e.chartArea,t[Cti[this.keywordIndex]]),this.writeChartArea(e.chartPlotArea,t[Ati[this.keywordIndex]]),this.writeChartCategory(e,t[bti[this.keywordIndex]]),this.createChartSeries(e,t[wti[this.keywordIndex]]),this.writeChartLegend(e.chartLegend,t[xti[this.keywordIndex]]),this.writeChartCategoryAxis(e.chartPrimaryCategoryAxis,t[Iti[this.keywordIndex]]),this.writeChartCategoryAxis(e.chartPrimaryValueAxis,t[Tti[this.keywordIndex]]),void 0!==e.chartDataTable.showSeriesKeys&&(t[Pti[this.keywordIndex]]={},this.writeChartDataTable(e.chartDataTable,t[Pti[this.keywordIndex]])),t[Eti[this.keywordIndex]]=e.title,t[Dti[this.keywordIndex]]=e.type,t[Mti[this.keywordIndex]]=e.chartGapWidth,t[kti[this.keywordIndex]]=e.chartOverlap,t[_ti[this.keywordIndex]]=Y.convertPixelToPoint(e.height),t[Vti[this.keywordIndex]]=Y.convertPixelToPoint(e.width)},Qui.prototype.writeChartTitleArea=function(e,t){t[qoi[this.keywordIndex]]=e.chartfontName,t[GZt[this.keywordIndex]]=e.chartFontSize,t[Fei[this.keywordIndex]]={},t[Lei[this.keywordIndex]]=this.writeChartDataFormat(e.dataFormat),this.writeChartLayout(e.layout,t[Fei[this.keywordIndex]])},Qui.prototype.writeChartDataFormat=function(e){var t={};return t[iii[this.keywordIndex]]={},t[Vei[this.keywordIndex]]={},je(e.id)||(t[bni[this.keywordIndex]]=e.id),je(e.fill.color)||(6<e.fill.color.length?t[iii[this.keywordIndex]][_ei[this.keywordIndex]]=e.fill.color.substring(2):t[iii[this.keywordIndex]][_ei[this.keywordIndex]]=e.fill.color),t[iii[this.keywordIndex]][Hoi[this.keywordIndex]]=e.fill.rgb,t[Vei[this.keywordIndex]][tii[this.keywordIndex]]=e.line.color,t[Vei[this.keywordIndex]][Hoi[this.keywordIndex]]=e.line.rgb,t},Qui.prototype.writeChartLayout=function(e,t){t[Hei[this.keywordIndex]]=e.chartLayoutLeft,t[zei[this.keywordIndex]]=e.chartLayoutTop},Qui.prototype.writeChartArea=function(e,t){t[_ei[this.keywordIndex]]=e.chartForeColor},Qui.prototype.writeChartLegend=function(e,t){t[coi[this.keywordIndex]]=e.chartLegendPostion,t[Sti[this.keywordIndex]]={},this.writeChartTitleArea(e.chartTitleArea,t[Sti[this.keywordIndex]])},Qui.prototype.writeChartCategoryAxis=function(e,t){t[Eti[this.keywordIndex]]=e.categoryAxisTitle,t[Sti[this.keywordIndex]]={},this.writeChartTitleArea(e.chartTitleArea,t[Sti[this.keywordIndex]]),t[vti[this.keywordIndex]]=e.categoryAxisType,t[GZt[this.keywordIndex]]=e.axisFontSize,t[qoi[this.keywordIndex]]=e.axisFontName,t[$ni[this.keywordIndex]]=e.categoryNumberFormat,t[Foi[this.keywordIndex]]=e.max,t[Loi[this.keywordIndex]]=e.min,t[Boi[this.keywordIndex]]=Y.getBoolInfo(e.isAutoInternal,this.keywordIndex),t[Poi[this.keywordIndex]]=e.interval,t[Roi[this.keywordIndex]]=Y.getBoolInfo(e.majorGridLines,this.keywordIndex),t[Ooi[this.keywordIndex]]=Y.getBoolInfo(e.minorGridLines,this.keywordIndex),t[Noi[this.keywordIndex]]=e.majorTick,t[Voi[this.keywordIndex]]=e.minorTick,t[_oi[this.keywordIndex]]=e.tickPosition},Qui.prototype.writeChartDataTable=function(e,t){t[gti[this.keywordIndex]]=Y.getBoolInfo(e.showSeriesKeys,this.keywordIndex),t[mti[this.keywordIndex]]=Y.getBoolInfo(e.hasHorzBorder,this.keywordIndex),t[fti[this.keywordIndex]]=Y.getBoolInfo(e.hasVertBorder,this.keywordIndex),t[yti[this.keywordIndex]]=Y.getBoolInfo(e.hasBorders,this.keywordIndex)},Qui.prototype.writeChartCategory=function(e,t){var i=e.chartCategory;t[Oei[this.keywordIndex]]=[];for(var n=0;n<i.length;n++){var o=i[n],o=this.createChartCategory(o,e.chartType);t.push(o)}},Qui.prototype.createChartCategory=function(e,t){var i={};return i[Oei[this.keywordIndex]]=[],this.writeChartData(e,i[Oei[this.keywordIndex]],t),i[Nei[this.keywordIndex]]=e.categoryXName,i},Qui.prototype.writeChartData=function(e,t,i){for(var n=e.chartData,o=0;o<n.length;o++){var r=n[o],r=this.createChartData(r,i);t.push(r)}},Qui.prototype.createChartData=function(e,t){var i={};return i[Rei[this.keywordIndex]]=e.yValue,"Bubble"===t&&(i[Eii[this.keywordIndex]]=e.size),i},Qui.prototype.createChartSeries=function(e,t){for(var i=e.chartSeries,n=e.chartType,o=0;o<i.length;o++){var r=i[o],r=this.writeChartSeries(r,n);t.push(r)}},Qui.prototype.writeChartSeries=function(e,t){var i="Pie"===t||"Doughnut"===t,n={},o={},r=e.errorBar;if(n[oti[this.keywordIndex]]=[],n[$ei[this.keywordIndex]]=e.seriesName,i&&(je(e.firstSliceAngle)||(n[rti[this.keywordIndex]]=e.firstSliceAngle),"Doughnut"===t)&&(n[sti[this.keywordIndex]]=e.doughnutHoleSize),je(e.dataLabels.labelPosition)||(i=this.writeChartDataLabels(e.dataLabels),n[eti[this.keywordIndex]]=i),je(e.seriesFormat.markerStyle)||(l=e.seriesFormat,(t={})[Uei[this.keywordIndex]]=l.markerStyle,t[Gei[this.keywordIndex]]=l.numberValue,t[qei[this.keywordIndex]]=l.markerColor,n[iti[this.keywordIndex]]=t),je(r.type)||(o[koi[this.keywordIndex]]=r.type,o[jei[this.keywordIndex]]=r.direction,o[Wei[this.keywordIndex]]=r.endStyle,o[Qei[this.keywordIndex]]=r.numberValue,n[tti[this.keywordIndex]]=o),0<e.trendLines.length){n[nti[this.keywordIndex]]=[];for(var s=0;s<e.trendLines.length;s++){var a=this.writeChartTrendLines(e.trendLines[s]);n[nti[this.keywordIndex]].push(a)}}for(s=0;s<e.chartDataFormat.length;s++){var l=this.writeChartDataFormat(e.chartDataFormat[s]);n[oti[this.keywordIndex]].push(l)}return n},Qui.prototype.writeChartDataLabels=function(e){var t={};return t[coi[this.keywordIndex]]=e.position,t[qoi[this.keywordIndex]]=e.fontName,t[YZt[this.keywordIndex]]=Y.convertArgbToRgb(e.fontColor),t[GZt[this.keywordIndex]]=e.fontSize,t[ati[this.keywordIndex]]=Y.getBoolInfo(e.isLegendKey,this.keywordIndex),t[lti[this.keywordIndex]]=Y.getBoolInfo(e.isBubbleSize,this.keywordIndex),t[hti[this.keywordIndex]]=Y.getBoolInfo(e.isCategoryName,this.keywordIndex),t[dti[this.keywordIndex]]=Y.getBoolInfo(e.isSeriesName,this.keywordIndex),t[pti[this.keywordIndex]]=Y.getBoolInfo(e.isValue,this.keywordIndex),t[cti[this.keywordIndex]]=Y.getBoolInfo(e.isPercentage,this.keywordIndex),t[uti[this.keywordIndex]]=Y.getBoolInfo(e.isLeaderLines,this.keywordIndex),t},Qui.prototype.writeChartTrendLines=function(e){var t={};return t[BZt[this.keywordIndex]]=e.trendLineName,t[koi[this.keywordIndex]]=e.trendLineType,t[Yei[this.keywordIndex]]=e.forwardValue,t[Xei[this.keywordIndex]]=e.backwardValue,t[Kei[this.keywordIndex]]=e.interceptValue,t[Zei[this.keywordIndex]]=Y.getBoolInfo(e.isDisplayEquation,this.keywordIndex),t[Jei[this.keywordIndex]]=Y.getBoolInfo(e.isDisplayRSquared,this.keywordIndex),t},Qui.prototype.writeLines=function(e,t,i,n){for(var o=t,r=this.endLine instanceof Gai&&this.endLine.paragraph===e,s=r?this.endLine.indexInOwner:e.childWidgets.length-1,a=o;a<=s;a++){var l=e.childWidgets[a];this.endLine===l||t===a&&0!==i?(this.endLine===l&&e.paragraphFormat.bidi&&this.startLine!==this.endLine&&(this.endOffset=l.getEndOffset()),this.writeLine(l,this.startLine===this.endLine||l===this.startLine||this.isContentControl?i:0,n)):this.writeInlines(e,l,n)}return r},Qui.prototype.writeLine=function(e,t,i){this.contentInline=[];for(var n,o=e===this.endLine,r=e,s=0,a=0;a<r.children.length;a++){var l=r.children[a];if(!(l instanceof lhi)){var h,d=void 0;if(s+=l.length,n=o&&s>=this.endOffset,t<s)if(l instanceof Pli||this.startContent||this.blockContent){if(n){this.startContent=!1;break}this.writeInlinesContentControl(l,e,i,a)}else if(!je(d=this.writeInline(l))&&(i[i.length]=d,t<s||n)&&(d.hasOwnProperty(Bti[this.keywordIndex])&&(h=s-l.length,l=n?this.endOffset-h:l.length,d[Bti[this.keywordIndex]]=d[Bti[this.keywordIndex]].substring(t-h,l)),t=-1),n)break}}},Qui.prototype.writeInlinesFootNote=function(e){this.isWriteInlinesFootNote=!0;for(var t={},i=(t[jii[this.keywordIndex]]=1==this.keywordIndex?this.getFootnoteTypeEnumValue(e.footnoteType):e.footnoteType,t[aZt[this.keywordIndex]]={},t[aZt[this.keywordIndex]]=this.writeCharacterFormat(e.characterFormat,this.keywordIndex),t[_ni[this.keywordIndex]]=[],e.bodyWidget);i;){for(var n=0;n<i.childWidgets.length;n++)i.childWidgets[n].previousSplitWidget||this.writeBlock(i.childWidgets[n],0,t[_ni[this.keywordIndex]]);if(je(i.containerWidget)||!(i.containerWidget instanceof Pai)||"Endnote"!==i.containerWidget.footNoteType)break;i=i.nextSplitWidget}return t[Wii[this.keywordIndex]]=e.symbolCode,t[Qii[this.keywordIndex]]=e.symbolFontName,t[Uii[this.keywordIndex]]=e.customMarker,this.writeInlineRevisions(t,e),this.isWriteInlinesFootNote=!1,t},Qui.prototype.writeInlinesContentControl=function(e,t,i,n){if(e instanceof Pli&&"Block"===e.contentControlWidgetType)return this.isBlockClosed=!1,this.blockContent&&0===e.type?this.nestedBlockContent=!0:this.nestedBlockContent&&1===e.type?!(this.nestedBlockContent=!1):(this.blockContent=0===e.type,t.children[n-1]instanceof Pli&&"Block"===t.children[n-1].contentControlWidgetType&&(this.blockContent=!0),je(t.children[n+1]&&t.children[n+1]instanceof Pli)||"Inline"===t.children[n+1].contentControlWidgetType&&(this.blockContent=!1),this.blockContent||(this.isBlockClosed=!0),!0);if(e instanceof Pli)return this.startContent&&0===e.type?this.nestedContent=!0:this.startContent&&this.nestedContent?((o={})[qii[this.keywordIndex]]=this.contentInline,0<this.contentInline.length&&(r=this.nestedContentProperty(t.children[n+1],o),i.push(r),this.contentInline=[]),this.multipleLineContent&&(o=i[i.length-1],this.nestedContentProperty(t.children[n+1],o),this.multipleLineContent=!1),!(this.nestedContent=!1)):(this.contentType=e.contentControlWidgetType,this.startContent=0===e.type,!0);if(this.startContent&&"Inline"===this.contentType)if(this.multipleLineContent&&!je(i)&&0<i.length)this.inlineContentControl(e,e.nextNode,i),this.contentInline=[];else{var o,r=this.inlineContentControl(e,e.nextNode);if(!je(r)){if(!this.nestedContent||!this.multipleLineContent)return i.push(r),!(this.contentInline=[]);(o={})[qii[this.keywordIndex]]=this.contentInline,i.push(o),this.contentInline=[]}}else je(o=this.writeInline(e))||i.push(o)},Qui.prototype.createParagraph=function(e){var t,i,n={},o=!1,r=!1;return o=!(this.documentHelper.selection&&!this.documentHelper.selection.isEmpty&&!this.isExport)||(t=this.documentHelper.selection.end,i=(t=this.documentHelper.selection.isForward?t:this.documentHelper.selection.start).paragraph.childWidgets[t.paragraph.childWidgets.length-1],r=!je(e.paragraphFormat.listFormat.list),this.documentHelper.selection.isParagraphLastLine(i)&&t.currentWidget===i&&(t.offset===this.documentHelper.selection.getLineLength(i)+1||!(e.indexInOwner==t.paragraph.indexInOwner)&&r)),n[lZt[this.keywordIndex]]=this.writeParagraphFormat(o?e.paragraphFormat:new bri(e),this.keywordIndex),n[aZt[this.keywordIndex]]=this.writeCharacterFormat(o?e.characterFormat:new Eri(e),this.keywordIndex),n[qii[this.keywordIndex]]=[],n},Qui.prototype.writeCharacterFormat=function(e,t,i){var n={};if(!this.skipExporting){if(Y.writeCharacterFormat(n,i,e,t),n[i$t[t]]=i?Y.getBoolInfo(e.boldBidi,t):e.getValue("boldBidi"),n[n$t[t]]=i?Y.getBoolInfo(e.italicBidi,t):e.getValue("italicBidi"),0<e.revisions.length){n[h$t[t]]=[];for(var o=0;o<e.revisions.length;o++)n[h$t[t]].push(e.revisions[o].revisionID)}this.writeInlineStyles&&!i&&(n[Uoi[t]]=this.writeCharacterFormat(e,t,!0))}return n},Qui.prototype.writeParagraphFormat=function(e,t,i){var n={};return this.skipExporting||(this.keywordIndex=je(this.keywordIndex)?0:this.keywordIndex,Y.writeParagraphFormat(n,i,e,t),n[x$t[t]]=this.writeListFormat(e.listFormat,i),n[P$t[t]]=this.writeTabs(e.tabs),this.writeInlineStyles&&!i&&(n[Uoi[t]]=this.writeParagraphFormat(e,t,!0))),n},Qui.prototype.writeThemes=function(e){var t={};return t[Soi[this.keywordIndex]]={},t[Soi[this.keywordIndex]][Aoi[this.keywordIndex]]=e.fontScheme.fontSchemeName,t[Soi[this.keywordIndex]][xoi[this.keywordIndex]]=this.writeMajorMinorFontScheme(e.fontScheme.majorFontScheme),t[Soi[this.keywordIndex]][Ioi[this.keywordIndex]]=this.writeMajorMinorFontScheme(e.fontScheme.minorFontScheme),t},Qui.prototype.writeMajorMinorFontScheme=function(e){var t={};t[Toi[this.keywordIndex]]=this.writeFontSchemeList(e.fontSchemeList);for(var i={},n=0,o=e.fontTypeface.keys;n<o.length;n++){var r=o[n];i[r]=e.fontTypeface.get(r)}return t[Eoi[this.keywordIndex]]=i,t},Qui.prototype.writeFontSchemeList=function(e){var i=this,n=[];return e.forEach(function(e){var t={};t[BZt[i.keywordIndex]]=e.name,t[Doi[i.keywordIndex]]=e.typeface,t[Moi[i.keywordIndex]]=e.panose,n.push(t)}),n},Qui.prototype.writeTabs=function(e){if(!(je(e)||e.length<1)){for(var t=[],i=0;i<e.length;i++){var n=e[i],o={};o[coi[this.keywordIndex]]=n.position,o[uoi[this.keywordIndex]]=n.deletePosition,o[poi[this.keywordIndex]]=1==this.keywordIndex?this.getTabJustificationEnumValue(n.tabJustification):n.tabJustification,o[goi[this.keywordIndex]]=1==this.keywordIndex?this.getTabLeaderEnumValue(n.tabLeader):n.tabLeader,t.push(o)}return t}},Qui.prototype.writeListFormat=function(e,t){var i={},n=e.getValue("listId"),n=(je(n)||(i[d$t[this.keywordIndex]]=n,je(this.lists)&&(this.lists=[]),this.lists.indexOf(e.listId)<0&&this.lists.push(e.listId)),e.getValue("listLevelNumber")),n=(je(n)||(i[u$t[this.keywordIndex]]=n),e.getValue("nsid"));return je(n)||(i.nsid=n),i},Qui.prototype.writeTable=function(e,t,i,n){i=e.childWidgets[i];if(!(i instanceof jai&&this.writeRow(i,t[Ani[this.keywordIndex]]))){for(var o=e;(o=(e=o).nextSplitWidget)instanceof Dai;);return(o=e.nextRenderedWidget)instanceof Dai&&o.containerWidget.index===e.containerWidget.index?o:void 0}},Qui.prototype.writeRow=function(e,t){var i=e;do{if((e=i)===(i=this.writeRowInternal(i,t)))return!0}while(i instanceof jai);return!1},Qui.prototype.writeRowInternal=function(e,t){if(!(e instanceof jai))return e;e.isCellsHaveSameWidthUnit()||e.updateUniformWidthUnitForCells();var i=this.createRow(e);t.push(i);for(var n=0;n<e.childWidgets.length;n++){var o=e.childWidgets[n];if(o instanceof Uai&&e.index===o.rowIndex&&(je(this.startColumnIndex)||o.columnIndex>=this.startColumnIndex)&&(je(this.endColumnIndex)||o.columnIndex<this.endColumnIndex)&&this.writeCell(o,i[Sni[this.keywordIndex]]))return e}for(var r=e;r=(e=r).nextRenderedWidget,(r=!je(e.ownerTable.bodyWidget)&&r&&(e.ownerTable.index!==r.ownerTable.index&&e.ownerTable.bodyWidget.sectionIndex===r.ownerTable.bodyWidget.sectionIndex||e.ownerTable.bodyWidget.sectionIndex!==r.ownerTable.bodyWidget.sectionIndex)?void 0:r)instanceof jai&&r.index===e.index;);return r},Qui.prototype.writeCell=function(e,t){for(var i=this.createCell(e),n=(t.push(i),e.firstChild);n=this.writeBlock(n,0,i[_ni[this.keywordIndex]]););return this.endCell instanceof Uai&&this.endCell.cellFormat===e.cellFormat},Qui.prototype.createTable=function(e){var t={};je(this.keywordIndex)&&(this.keywordIndex=0),t[Ani[this.keywordIndex]]=[],t[$oi[this.keywordIndex]]=[];for(var i=0;i<e.tableHolder.columns.length;i++)t[$oi[this.keywordIndex]][i]=e.tableHolder.columns[i].preferredWidth;return t[Dni[this.keywordIndex]]=this.writeTableFormat(e.tableFormat,this.keywordIndex),t[xni[this.keywordIndex]]=e.tableFormat.description,t[Jii[this.keywordIndex]]=e.tableFormat.title,t[eri[this.keywordIndex]]=e.tableHolder.columns.length,this.writeTablePositioning(t,e),t},Qui.prototype.writeTablePositioning=function(e,t){t.wrapTextAround&&(e[Ini[this.keywordIndex]]=Y.getBoolInfo(t.wrapTextAround,this.keywordIndex),e[Eni[this.keywordIndex]]={},e[Eni[this.keywordIndex]][Mni[this.keywordIndex]]=Y.getBoolInfo(t.positioning.allowOverlap,this.keywordIndex),je(t.positioning.distanceBottom)||(e[Eni[this.keywordIndex]][Fni[this.keywordIndex]]=Y.convertPixelToPoint(t.positioning.distanceBottom)),je(t.positioning.distanceLeft)||(e[Eni[this.keywordIndex]][Bni[this.keywordIndex]]=Y.convertPixelToPoint(t.positioning.distanceLeft)),je(t.positioning.distanceRight)||(e[Eni[this.keywordIndex]][Pni[this.keywordIndex]]=Y.convertPixelToPoint(t.positioning.distanceRight)),je(t.positioning.distanceTop)||(e[Eni[this.keywordIndex]][kni[this.keywordIndex]]=Y.convertPixelToPoint(t.positioning.distanceTop)),je(t.positioning.verticalAlignment)||(e[Eni[this.keywordIndex]][rei[this.keywordIndex]]=1==this.keywordIndex?this.getTableVerticalPositionEnumValue(t.positioning.verticalAlignment):t.positioning.verticalAlignment),je(t.positioning.verticalOrigin)||(e[Eni[this.keywordIndex]][Lni[this.keywordIndex]]=1==this.keywordIndex?this.getTableVerticalRelationEnumValue(t.positioning.verticalOrigin):t.positioning.verticalOrigin),e[Eni[this.keywordIndex]][Rni[this.keywordIndex]]=t.positioning.verticalPosition,je(t.positioning.horizontalAlignment)||(e[Eni[this.keywordIndex]][Nni[this.keywordIndex]]=1==this.keywordIndex?this.getTableHorizontalPositionEnumValue(t.positioning.horizontalAlignment):t.positioning.horizontalAlignment),je(t.positioning.horizontalOrigin)||(e[Eni[this.keywordIndex]][Oni[this.keywordIndex]]=1==this.keywordIndex?this.getTableHorizontalRelationEnumValue(t.positioning.horizontalOrigin):t.positioning.horizontalOrigin),e[Eni[this.keywordIndex]][Vni[this.keywordIndex]]=t.positioning.horizontalPosition)},Qui.prototype.createRow=function(e){var t={};return t[Sni[this.keywordIndex]]=[],t[Cni[this.keywordIndex]]=this.writeRowFormat(e.rowFormat,this.keywordIndex),e.hasOwnProperty("contentControlProperties")&&(t[Gii[this.keywordIndex]]=this.contentControlProperty(e.contentControlProperties)),t},Qui.prototype.createCell=function(e){var t={};return t[_ni[this.keywordIndex]]=[],t[wni[this.keywordIndex]]=this.writeCellFormat(e.cellFormat,this.keywordIndex),t[Yoi[this.keywordIndex]]=e.columnIndex,e.hasOwnProperty("contentControlProperties")&&(t[Gii[this.keywordIndex]]=this.contentControlProperty(e.contentControlProperties)),t},Qui.prototype.writeShading=function(e,t){var i={};return i[Aei[t]]=e.hasValue("backgroundColor")?e.backgroundColor:void 0,i[xei[t]]=e.hasValue("foregroundColor")?e.foregroundColor:void 0,i[Sei[t]]=e.hasValue("textureStyle")?1==t?this.getTextureStyleEnumValue(e.textureStyle):e.textureStyle:void 0,i},Qui.prototype.writeBorders=function(e,t){var i={};return i[lii[t]]=Y.writeBorder(e.top,t),i[pii[t]]=Y.writeBorder(e.left,t),i[dii[t]]=Y.writeBorder(e.right,t),i[hii[t]]=Y.writeBorder(e.bottom,t),i[kei[t]]=Y.writeBorder(e.diagonalDown,t),i[Mei[t]]=Y.writeBorder(e.diagonalUp,t),i[Dei[t]]=Y.writeBorder(e.horizontal,t),i[Eei[t]]=Y.writeBorder(e.vertical,t),i},Qui.prototype.writeCellFormat=function(e,t){var i={};return i[k$t[t]]=this.writeBorders(e.borders,t),i[yei[t]]=this.writeShading(e.shading,t),i[H$t[t]]=e.hasValue("topMargin")?e.topMargin:void 0,i[_$t[t]]=e.hasValue("rightMargin")?e.rightMargin:void 0,i[V$t[t]]=e.hasValue("leftMargin")?e.leftMargin:void 0,i[z$t[t]]=e.hasValue("bottomMargin")?e.bottomMargin:void 0,i[bei[t]]=e.hasValue("preferredWidth")?e.preferredWidth:void 0,i[wei[t]]=e.hasValue("preferredWidthType")?1==t?this.getWidthTypeEnumValue(e.preferredWidthType):e.preferredWidthType:void 0,i[iei[t]]=e.hasValue("cellWidth")?e.cellWidth:void 0,i[nei[t]]=e.columnSpan,i[oei[t]]=e.rowSpan,i[rei[t]]=e.hasValue("verticalAlignment")?1==t?this.getCellVerticalAlignmentEnumValue(e.verticalAlignment):e.verticalAlignment:void 0,i},Qui.prototype.writeRowFormat=function(e,t){var i={},n=[];this.assignRowFormat(i,e,t);for(var o=0;o<e.revisions.length;o++)i[h$t[t]]=this.writeRowRevisions(e.revisions[o],n);return i},Qui.prototype.assignRowFormat=function(e,t,i){e[_ti[i]]=t.hasValue("height")?t.height:void 0,e[sei[i]]=t.hasValue("allowBreakAcrossPages")?Y.getBoolInfo(t.allowBreakAcrossPages,this.keywordIndex):void 0,e[lei[i]]=t.hasValue("heightType")?1==this.keywordIndex?this.getHeighTypeEnumValue(t.heightType):t.heightType:void 0,e[aei[i]]=t.hasValue("isHeader")?Y.getBoolInfo(t.isHeader,this.keywordIndex):void 0,e[k$t[i]]=this.writeBorders(t.borders,i),e[hei[i]]=t.gridBefore,e[dei[i]]=t.hasValue("gridBeforeWidth")?t.gridBeforeWidth:void 0,e[pei[i]]=t.hasValue("gridBeforeWidthType")?1==this.keywordIndex?this.getWidthTypeEnumValue(t.gridBeforeWidthType):t.gridBeforeWidthType:void 0,e[cei[i]]=t.gridAfter,e[uei[i]]=t.hasValue("gridAfterWidth")?t.gridAfterWidth:void 0,e[gei[i]]=t.hasValue("gridAfterWidthType")?1==this.keywordIndex?this.getWidthTypeEnumValue(t.gridAfterWidthType):t.gridAfterWidthType:void 0,e[V$t[i]]=t.hasValue("leftMargin")?t.leftMargin:void 0,e[H$t[i]]=t.hasValue("topMargin")?t.topMargin:void 0,e[_$t[i]]=t.hasValue("rightMargin")?t.rightMargin:void 0,e[z$t[i]]=t.hasValue("bottomMargin")?t.bottomMargin:void 0,e[g$t[i]]=t.hasValue("leftIndent")?t.leftIndent:void 0},Qui.prototype.writeRowRevisions=function(e,t){return-1===this.selectedRevisionId.indexOf(e.revisionID)&&this.selectedRevisionId.push(e.revisionID),t.push(e.revisionID),t},Qui.prototype.writeTableFormat=function(e,t){var i={};return i[k$t[t]]=this.writeBorders(e.borders,t),i[yei[t]]=this.writeShading(e.shading,t),i[fei[t]]=e.hasValue("cellSpacing")?e.cellSpacing:void 0,i[g$t[t]]=e.hasValue("leftIndent")?e.leftIndent:void 0,i[vei[t]]=e.hasValue("tableAlignment")?1==this.keywordIndex?this.getTableAlignmentEnumValue(e.tableAlignment):e.tableAlignment:void 0,i[H$t[t]]=e.hasValue("topMargin")?e.topMargin:void 0,i[_$t[t]]=e.hasValue("rightMargin")?e.rightMargin:void 0,i[V$t[t]]=e.hasValue("leftMargin")?e.leftMargin:void 0,i[z$t[t]]=e.hasValue("bottomMargin")?e.bottomMargin:void 0,i[bei[t]]=e.hasValue("preferredWidth")?e.preferredWidth:void 0,i[wei[t]]=e.hasValue("preferredWidthType")?1==this.keywordIndex?this.getWidthTypeEnumValue(e.preferredWidthType):e.preferredWidthType:void 0,i[JZt[t]]=e.hasValue("bidi")?Y.getBoolInfo(e.bidi,this.keywordIndex):void 0,i[mei[t]]=e.hasValue("allowAutoFit")?Y.getBoolInfo(e.allowAutoFit,this.keywordIndex):void 0,i[KZt[t]]=je(e.styleName)?void 0:e.styleName,i},Qui.prototype.footnotes=function(e){this.isWriteEndFootNote=!0;for(var t=0;t<e.footnotes.separator.length;t++)this.seprators(e);this.isWriteEndFootNote=!1},Qui.prototype.seprators=function(e){if(0<e.footnotes.separator.length){this.document[EZt[this.keywordIndex]]={},this.document[EZt[this.keywordIndex]][soi[this.keywordIndex]]=[];for(var t=0;t<e.footnotes.separator.length;t++)this.writeBlock(e.footnotes.separator[t],0,this.document[EZt[this.keywordIndex]][soi[this.keywordIndex]])}if(0<e.footnotes.continuationSeparator.length){this.document[EZt[this.keywordIndex]][aoi[this.keywordIndex]]=[];for(t=0;t<e.footnotes.continuationSeparator.length;t++)this.writeBlock(e.footnotes.continuationSeparator[t],0,this.document[EZt[this.keywordIndex]][aoi[this.keywordIndex]])}if(0<e.footnotes.continuationNotice.length){this.document[EZt[this.keywordIndex]][loi[this.keywordIndex]]=[];for(t=0;t<e.footnotes.continuationNotice.length;t++)this.writeBlock(e.footnotes.continuationNotice[t],0,this.document[EZt[this.keywordIndex]][loi[this.keywordIndex]])}},Qui.prototype.endnotes=function(e){this.isWriteEndFootNote=!0;for(var t=0;t<this.documentHelper.endnotes.separator.length;t++)this.endnoteSeparator(e);this.isWriteEndFootNote=!1},Qui.prototype.endnoteSeparator=function(e){if(0<e.endnotes.separator.length){this.document[DZt[this.keywordIndex]]={},this.document[DZt[this.keywordIndex]][soi[this.keywordIndex]]=[];for(var t=0;t<e.endnotes.separator.length;t++)this.writeBlock(e.endnotes.separator[t],0,this.document[DZt[this.keywordIndex]][soi[this.keywordIndex]])}if(0<e.endnotes.continuationSeparator.length){this.document[DZt[this.keywordIndex]][aoi[this.keywordIndex]]=[];for(t=0;t<e.endnotes.continuationSeparator.length;t++)this.writeBlock(e.endnotes.continuationSeparator[t],0,this.document[DZt[this.keywordIndex]][aoi[this.keywordIndex]])}if(0<e.endnotes.continuationNotice.length){this.document[DZt[this.keywordIndex]][loi[this.keywordIndex]]=[];for(t=0;t<e.endnotes.continuationNotice.length;t++)this.writeBlock(e.endnotes.continuationNotice[t],0,this.document[DZt[this.keywordIndex]][loi[this.keywordIndex]])}},Qui.prototype.writeStyles=function(e){this.document[cZt[this.keywordIndex]]=[];for(var t=0;t<e.styles.length;t++)this.document[cZt[this.keywordIndex]].push(this.writeStyle(e.styles.getItem(t)))},Qui.prototype.writeStyle=function(e){var t={};return t[BZt[this.keywordIndex]]=e.name,"Paragraph"===e.type&&(t[koi[this.keywordIndex]]=1==this.keywordIndex?this.getStyleTypeEnumValue(e.type):e.type,t[lZt[this.keywordIndex]]=this.writeParagraphFormat(e.paragraphFormat,this.keywordIndex),t[aZt[this.keywordIndex]]=this.writeCharacterFormat(e.characterFormat,this.keywordIndex)),"Character"===e.type&&(t[koi[this.keywordIndex]]=1==this.keywordIndex?this.getStyleTypeEnumValue(e.type):e.type,t[aZt[this.keywordIndex]]=this.writeCharacterFormat(e.characterFormat,this.keywordIndex)),"Table"===e.type&&(t[koi[this.keywordIndex]]=1==this.keywordIndex?this.getStyleTypeEnumValue(e.type):e.type),je(e.basedOn)||(t[FZt[this.keywordIndex]]=e.basedOn.name),je(e.link)||(t[RZt[this.keywordIndex]]=e.link.name),je(e.next)||(t[LZt[this.keywordIndex]]=e.next.name),t},Qui.prototype.writeRevisions=function(e){this.document[gZt[this.keywordIndex]]=[];for(var t=0;t<e.owner.revisions.changes.length;t++)!this.isExport&&(this.isExport||this.owner.enableTrackChanges||-1===this.selectedRevisionId.indexOf(e.owner.revisions.changes[t].revisionID))||this.document[gZt[this.keywordIndex]].push(this.writeRevision(e.owner.revisions.changes[t]))},Qui.prototype.writeRevision=function(e){var t={};return t[Fii[this.keywordIndex]]=e.author,t[Rii[this.keywordIndex]]=e.date,t[Vii[this.keywordIndex]]=1==this.keywordIndex?this.getRevisionTypeEnumValue(e.revisionType):e.revisionType,t[_ii[this.keywordIndex]]=e.revisionID,t},Qui.prototype.writeComments=function(e){this.document[uZt[this.keywordIndex]]=[];for(var t=0;t<e.comments.length;t++)(this.isExport||!this.isExport&&-1!==this.selectedCommentsId.indexOf(this.documentHelper.comments[t].commentId))&&this.document[uZt[this.keywordIndex]].push(this.writeComment(this.documentHelper.comments[t]))},Qui.prototype.writeCustomXml=function(e){this.document[mZt[this.keywordIndex]]=[];for(var t=0;t<e.customXmlData.length;t++){var i={},n=e.customXmlData.keys[t],n=(i[Hii[this.keywordIndex]]=n,this.documentHelper.customXmlData.get(n));i[zii[this.keywordIndex]]=n,this.document[mZt[this.keywordIndex]].push(i)}},Qui.prototype.writeImages=function(e){this.document[Xoi[this.keywordIndex]]={};for(var t=0;t<this.images.length;t++){var i=this.images[t],n=e.images.get(i);this.document[Xoi[this.keywordIndex]][i]=n}},Qui.prototype.writeComment=function(e){var t={};t[Pii[this.keywordIndex]]=e.commentId,t[Fii[this.keywordIndex]]=e.author,t[Rii[this.keywordIndex]]=e.date,t[_ni[this.keywordIndex]]=Y.commentInlines(e.text,e.mentions,this.keywordIndex),t[Oii[this.keywordIndex]]=Y.getBoolInfo(e.isResolved,this.keywordIndex),t[Nii[this.keywordIndex]]=[];for(var i=0;i<e.replyComments.length;i++)t[Nii[this.keywordIndex]].push(this.writeComment(e.replyComments[i]));return t},Qui.prototype.writeLists=function(e){var t=[];this.document[hZt[this.keywordIndex]]=[];for(var i=0;i<e.lists.length;i++){var n=e.lists[i];-1<this.lists.indexOf(n.listId)&&(this.document[hZt[this.keywordIndex]].push(this.writeList(n)),t.indexOf(n.abstractListId)<0)&&t.push(n.abstractListId)}this.document[dZt[this.keywordIndex]]=[];for(i=0;i<e.abstractLists.length;i++){var o=e.abstractLists[i];-1<t.indexOf(o.abstractListId)&&this.document[dZt[this.keywordIndex]].push(this.writeAbstractList(o))}},Qui.prototype.writeAbstractList=function(e){var t={};t[toi[this.keywordIndex]]=e.abstractListId,t.nsid=e.nsid,t[noi[this.keywordIndex]]=[];for(var i=0;i<e.levels.length;i++)t[noi[this.keywordIndex]][i]=this.writeListLevel(e.levels[i]);return t},Qui.prototype.writeList=function(e){var t={};if(!je(e)){t[toi[this.keywordIndex]]=e.abstractListId,t[roi[this.keywordIndex]]=[];for(var i=0;i<e.levelOverrides.length;i++)t[roi[this.keywordIndex]].push(this.writeLevelOverrides(e.levelOverrides[i]));t[d$t[this.keywordIndex]]=e.listId,t.nsid=e.nsid}return t},Qui.prototype.writeLevelOverrides=function(e){var t={};return t[Zni[this.keywordIndex]]=e.levelNumber,e.overrideListLevel&&(t[ooi[this.keywordIndex]]=this.writeListLevel(e.overrideListLevel)),t[Kni[this.keywordIndex]]=e.startAt,t},Qui.prototype.writeListLevel=function(e){var t={};return t[aZt[this.keywordIndex]]=this.writeCharacterFormat(e.characterFormat,this.keywordIndex),t[lZt[this.keywordIndex]]=this.writeParagraphFormat(e.paragraphFormat,this.keywordIndex),t[Tni[this.keywordIndex]]=Y.getBoolInfo(e.isLegalStyleNumbering,this.keywordIndex),t[Xni[this.keywordIndex]]=1==this.keywordIndex?this.getFollowCharacterType(e.followCharacter):e.followCharacter,t[Yni[this.keywordIndex]]=1==this.keywordIndex?this.getListLevelPatternEnumValue(e.listLevelPattern):e.listLevelPattern,t[$ni[this.keywordIndex]]=e.numberFormat,t[eoi[this.keywordIndex]]=e.paraStyleName,t[Jni[this.keywordIndex]]=e.restartLevel,t[Kni[this.keywordIndex]]=e.startAt,t},Qui.prototype.getParentBlock=function(e){return e=e.isInsideTable?this.owner.documentHelper.layout.getParentTable(e):e},Qui.prototype.getParentCell=function(e){for(;e.ownerTable.isInsideTable;)e=e.ownerTable.associatedCell;return e},Qui.prototype.getWidthTypeEnumValue=function(e){switch(e){case"Auto":return 0;case"Percent":return 1;case"Point":return 2}},Qui.prototype.getTableAlignmentEnumValue=function(e){switch(e){case"Left":return 0;case"Center":return 1;case"Right":return 2}},Qui.prototype.getTextureStyleEnumValue=function(e){switch(e){case"TextureNone":return 0;case"Texture2Pt5Percent":return 1;case"Texture5Percent":return 2;case"Texture7Pt5Percent":return 3;case"Texture10Percent":return 4;case"Texture12Pt5Percent":return 5;case"Texture15Percent":return 6;case"Texture17Pt5Percent":return 7;case"Texture20Percent":return 8;case"Texture22Pt5Percent":return 9;case"Texture25Percent":return 10;case"Texture27Pt5Percent":return 11;case"Texture30Percent":return 12;case"Texture32Pt5Percent":return 13;case"Texture35Percent":return 14;case"Texture37Pt5Percent":return 15;case"Texture40Percent":return 16;case"Texture42Pt5Percent":return 17;case"Texture45Percent":return 18;case"Texture47Pt5Percent":return 19;case"Texture50Percent":return 20;case"Texture52Pt5Percent":return 21;case"Texture55Percent":return 22;case"Texture57Pt5Percent":return 23;case"Texture60Percent":return 24;case"Texture62Pt5Percent":return 25;case"Texture65Percent":return 26;case"Texture67Pt5Percent":return 27;case"Texture70Percent":return 28;case"Texture72Pt5Percent":return 29;case"Texture75Percent":return 30;case"Texture77Pt5Percent":return 31;case"Texture80Percent":return 32;case"Texture82Pt5Percent":return 33;case"Texture85Percent":return 34;case"Texture87Pt5Percent":return 35;case"Texture90Percent":return 36;case"Texture92Pt5Percent":return 37;case"Texture95Percent":return 38;case"Texture97Pt5Percent":return 39;case"TextureSolid":return 40;case"TextureDarkHorizontal":return 41;case"TextureDarkVertical":return 42;case"TextureDarkDiagonalDown":return 43;case"TextureDarkDiagonalUp":return 44;case"TextureDarkCross":return 45;case"TextureDarkDiagonalCross":return 46;case"TextureHorizontal":return 47;case"TextureVertical":return 48;case"TextureDiagonalDown":return 49;case"TextureDiagonalUp":return 50;case"TextureCross":return 51;case"TextureDiagonalCross":return 52}},Qui.prototype.getHeighTypeEnumValue=function(e){switch(e){case"AtLeast":return 0;case"Exactly":return 1;default:return 0}},Qui.prototype.getCellVerticalAlignmentEnumValue=function(e){switch(e){case"Top":return 0;case"Center":return 1;case"Bottom":return 2}},Qui.prototype.getListLevelPatternEnumValue=function(e){switch(e){case"None":return 0;case"KanjiDigit":case"Arabic":return 1;case"UpRoman":return 2;case"LowRoman":return 3;case"UpLetter":return 4;case"LowLetter":return 5;case"Ordinal":return 6;case"Number":return 7;case"OrdinalText":return 8;case"LeadingZero":return 9;case"Bullet":return 10;case"FarEast":return 11;case"Special":return 12}},Qui.prototype.getStyleTypeEnumValue=function(e){switch(e){case"Paragraph":return 0;case"Character":return 1;case"Table":return 2}},Qui.prototype.getProtectionTypeEnumValue=function(e){switch(e){case"NoProtection":return 0;case"ReadOnly":return 1;case"FormFieldsOnly":return 2;case"CommentsOnly":return 3;case"RevisionsOnly":return 4}},Qui.prototype.getRevisionTypeEnumValue=function(e){switch(e){case"Insertion":return 1;case"Deletion":return 2;case"MoveTo":return 3;case"MoveFrom":return 4}},Qui.prototype.getFootnoteTypeEnumValue=function(e){switch(e){case"Footnote":return 0;case"Endnote":return 1}},Qui.prototype.getFootnoteRestartIndexEnumValue=function(e){switch(e){case"DoNotRestart":return 0;case"RestartForEachSection":return 1;case"RestartForEachPage":return 2}},Qui.prototype.getFootEndNoteNumberFormatEnumValue=function(e){switch(e){case"Arabic":return 0;case"UpperCaseRoman":return 1;case"LowerCaseRoman":return 2;case"UpperCaseLetter":return 3;case"LowerCaseLetter":return 4}},Qui.prototype.getTextVerticalAlignmentEnumValue=function(e){switch(e){case"Top":return 0;case"Middle":case"Center":return 1;case"Bottom":return 2;default:return 0}},Qui.prototype.getShapeVerticalAlignmentEnumValue=function(e){switch(e){case"None":return 0;case"Top":return 1;case"Center":return 2;case"Bottom":return 3;case"Inline":return 4;case"Inside":return 5;case"Outside":return 6;default:return 0}},Qui.prototype.getShapeHorizontalAlignmentEnumValue=function(e){switch(e){case"None":return 0;case"Center":return 1;case"Inside":return 2;case"Left":return 3;case"Outside":return 4;case"Right":return 5}},Qui.prototype.getVerticalOriginEnumValue=function(e){switch(e){case"Paragraph":return 0;case"BottomMargin":return 1;case"InsideMargin":return 2;case"Line":return 3;case"Margin":return 4;case"OutsideMargin":return 5;case"Page":return 6;case"TopMargin":return 7}},Qui.prototype.getHorizontalOriginEnumValue=function(e){switch(e){case"Column":return 0;case"Character":return 1;case"InsideMargin":return 2;case"LeftMargin":return 3;case"Margin":return 4;case"OutsideMargin":return 5;case"Page":return 6;case"RightMargin":return 7}},Qui.prototype.getTableVerticalRelationEnumValue=function(e){switch(e){case"Paragraph":return 0;case"Margin":return 1;case"Page":return 2;default:return 0}},Qui.prototype.getTableHorizontalRelationEnumValue=function(e){switch(e){case"Column":return 0;case"Margin":return 1;case"Page":return 2;default:return 0}},Qui.prototype.getTableVerticalPositionEnumValue=function(e){switch(e){case"None":return 0;case"Top":return 1;case"Center":return 2;case"Bottom":return 3;case"Inside":return 4;case"Outside":return 5;default:return 0}},Qui.prototype.getTableHorizontalPositionEnumValue=function(e){switch(e){case"Left":return 0;case"Center":return 1;case"Inside":return 2;case"Outside":return 3;case"Right":return 4;default:return 0}},Qui.prototype.getLineDashStyleEnumValue=function(e){switch(e){case"Solid":return 0;case"Dash":return 1;case"DashDot":return 2;case"DashDotDot":return 3;case"DashDotGEL":return 4;case"DashGEL":return 5;case"Dot":return 6;case"DotGEL":return 7;case"LongDashDotDotGEL":return 8;case"LongDashDotGEL":return 9;case"LongDashGEL":return 10}},Qui.prototype.getHorizontalPositionAbsEnumValue=function(e){switch(e){case"Left":return 0;case"Center":return 1;case"Right":return 2;case"Inside":return 3;case"Outside":return 4;default:return 0}},Qui.prototype.getTabJustificationEnumValue=function(e){switch(e){case"Left":return 0;case"Bar":return 1;case"Center":return 2;case"Decimal":return 3;case"List":return 4;case"Right":return 5}},Qui.prototype.getTabLeaderEnumValue=function(e){switch(e){case"None":return 0;case"Single":return 1;case"Dot":return 2;case"Hyphen":return 3;case"Underscore":return 4}},Qui.prototype.getTextFormFieldTypeEnumValue=function(e){switch(e){case"Text":return 0;case"Number":return 1;case"Date":return 2;case"Calculation":return 3}},Qui.prototype.getTextFormFieldFormatEnumValue=function(e){switch(e){case"None":return 0;case"FirstCapital":return 1;case"Lowercase":return 2;case"Uppercase":return 3;case"Titlecase":return 4;default:return 0}},Qui.prototype.getCheckBoxSizeTypeEnumValue=function(e){switch(e){case"Auto":return 0;case"Exactly":return 1}},Qui.prototype.getContentControlAppearanceEnumValue=function(e){switch(e){case"BoundingBox":return 1;case"Hidden":return 2;case"Tags":return 3;default:return 1}},Qui.prototype.getContentControlTypeEnumValue=function(e){switch(e){case"RichText":return 0;case"BuildingBlockGallery":return 1;case"CheckBox":return 2;case"ComboBox":return 3;case"Date":return 4;case"DropDownList":return 5;case"Group":return 6;case"Picture":return 7;case"RepeatingSection":return 8;case"Text":return 9}},Qui.prototype.getDateCalendarTypeEnumValue=function(e){switch(e){case"Gregorian":return 0;case"GregorianArabic":return 1;case"GregorianEnglish":return 2;case"GregorianMiddleEastFrench":return 3;case"GregorianTransliteratedEnglish":return 4;case"GregorianTransliteratedFrench":return 5;case"Hebrew":return 6;case"Hijri":return 7;case"Japan":return 8;case"Korean":return 9;case"Saka":return 10;case"Taiwan":return 11;case"Thai":return 12;default:return 0}},Qui.prototype.getDateStorageFormatEnumValue=function(e){switch(e){case"DateStorageDate":return 1;case"DateStorageDateTime":return 2;case"DateStorageText":return 3;default:return 0}},Qui.prototype.getTextWrappingStyleEnumValue=function(e){switch(e){case"Inline":return 0;case"InFrontOfText":return 1;case"Square":return 2;case"TopAndBottom":return 3;case"Behind":return 4;default:return 0}},Qui.prototype.getTextWrappingTypeEnumValue=function(e){switch(e){case"Both":return 0;case"Left":return 1;case"Right":return 2;case"Largest":return 3}},Qui.prototype.getCompatibilityModeEnumValue=function(e){switch(e){case"Word2013":return 0;case"Word2003":return 1;case"Word2007":return 2;case"Word2010":return 3}},Qui.prototype.getLineFormatTypeEnumValue=function(e){switch(e){case"Solid":return 0;case"Patterned":return 1;case"Gradient":return 2;case"None":return 3}},Qui.prototype.getAutoShapeTypeEnumValue=function(e){switch(e){case"Rectangle":return 1;case"RoundedRectangle":return 2;case"StraightConnector":return 3;case"Oval":return 4;case"IsoscelesTriangle":return 5;case"RightTriangle":return 6;case"Parallelogram":return 7;case"Trapezoid":return 8;case"Diamond":return 9;case"RegularPentagon":return 10;case"Hexagon":return 11;case"Heptagon":return 12;case"Octagon":return 13;case"Decagon":return 14;case"Dodecagon":return 15;case"Chord":return 16;case"Teardrop":return 17;case"Frame":return 18;case"HalfFrame":return 19;case"L_Shape":return 20;case"Pie":return 21;case"DiagonalStripe":return 22;case"Cross":return 23;case"Plaque":return 24;case"Can":return 25;case"Cube":return 26;case"Bevel":return 27;case"Donut":return 28;case"NoSymbol":return 29;case"BlockArc":return 30;case"FoldedCorner":return 31;case"SmileyFace":return 32;case"Heart":return 33;case"LightningBolt":return 34;case"Sun":return 35;case"Moon":return 36;case"Cloud":return 37;case"Arc":return 38;case"DoubleBracket":return 39;case"DoubleBrace":return 40;case"LeftBracket":return 41;case"RightBracket":return 42;case"LeftBrace":return 43;case"RightBrace":return 44;case"FlowChartProcess":return 45;case"FlowChartAlternateProcess":return 46;case"FlowChartDecision":return 47;case"FlowChartData":return 48;case"FlowChartPredefinedProcess":return 49;case"FlowChartInternalStorage":return 50;case"FlowChartDocument":return 51;case"FlowChartMultiDocument":return 52;case"FlowChartTerminator":return 53;case"FlowChartPreparation":return 54;case"FlowChartManualInput":return 55;case"FlowChartManualOperation":return 56;case"FlowChartConnector":return 57;case"FlowChartOffPageConnector":return 58;case"FlowChartCard":return 59;case"FlowChartPunchedTape":return 60;case"FlowChartSummingJunction":return 61;case"FlowChartOr":return 62;case"FlowChartCollate":return 63;case"FlowChartSort":return 64;case"FlowChartExtract":return 65;case"FlowChartMerge":return 66;case"FlowChartStoredData":return 67;case"FlowChartDelay":return 68;case"FlowChartSequentialAccessStorage":return 69;case"FlowChartMagneticDisk":return 70;case"FlowChartDirectAccessStorage":return 71;case"FlowChartDisplay":return 72;case"RightArrow":return 73;case"LeftArrow":return 74;case"UpArrow":return 75;case"DownArrow":return 76;case"LeftRightArrow":return 77;case"UpDownArrow":return 78;case"QuadArrow":return 79;case"LeftRightUpArrow":return 80;case"BentArrow":return 81;case"UTurnArrow":return 82;case"LeftUpArrow":return 83;case"BentUpArrow":return 84;case"CurvedRightArrow":return 85;case"CurvedLeftArrow":return 86;case"CurvedUpArrow":return 87;case"CurvedDownArrow":return 88;case"StripedRightArrow":return 89;case"NotchedRightArrow":return 90;case"Pentagon":return 91;case"Chevron":return 92;case"RightArrowCallout":return 93;case"DownArrowCallout":return 94;case"LeftArrowCallout":return 95;case"UpArrowCallout":return 96;case"LeftRightArrowCallout":return 97;case"QuadArrowCallout":return 98;case"CircularArrow":return 99;case"MathPlus":return 100;case"MathMinus":return 101;case"MathMultiply":return 102;case"MathDivision":return 103;case"MathEqual":return 104;case"MathNotEqual":return 105;case"Explosion1":return 106;case"Explosion2":return 107;case"Star4Point":return 108;case"Star5Point":return 109;case"Star6Point":return 110;case"Star7Point":return 111;case"Star8Point":return 112;case"Star10Point":return 113;case"Star12Point":return 114;case"Star16Point":return 115;case"Star24Point":return 116;case"Star32Point":return 117;case"UpRibbon":return 118;case"DownRibbon":return 119;case"CurvedUpRibbon":return 120;case"CurvedDownRibbon":return 121;case"VerticalScroll":return 122;case"HorizontalScroll":return 123;case"Wave":return 124;case"DoubleWave":return 125;case"SnipSingleCornerRectangle":return 126;case"SnipSameSideCornerRectangle":return 127;case"SnipDiagonalCornerRectangle":return 128;case"SnipAndRoundSingleCornerRectangle":return 129;case"RoundSingleCornerRectangle":return 130;case"RoundSameSideCornerRectangle":return 131;case"RoundDiagonalCornerRectangle":return 132;case"Unknown":return 133;case"ElbowConnector":return 134;case"CurvedConnector":return 135;default:return 0}},Qui.prototype.getFollowCharacterType=function(e){switch(e){case"Tab":return 0;case"Space":return 1;case"None":return 2}},Qui.prototype.destroy=function(){this.lists=void 0,this.images=void 0,this.endLine=void 0,this.startLine=void 0,this.endOffset=void 0,this.documentHelper=void 0};var Wui=Qui;function Qui(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.images=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.isWriteInlinesFootNote=!1,this.isWriteEndFootNote=!1,this.skipExporting=!1,this.iscontentInsert=!0,this.keywordIndex=void 0,this.isExport=!0,this.isPartialExport=!1,this.checkboxOrDropdown=!1,this.copyWithTrackChange=!1,this.documentHelper=e}Uui.prototype.getModuleName=function(){return"CollaborativeEditingHandler"},Uui.prototype.updateRoomInfo=function(e,t,i){this.roomName=e,this.serviceUrl=i,this.version=t},Uui.prototype.sendActionToServer=function(e){var t;!je(e)&&0===e.length||((t=this.pendingOps[this.pendingOps.length-1])&&this.checkAndCombineOperation(t,e)||this.pendingOps.push(e),this.isAcknowledgePending()||this.sendLocalOperation(),this.transformRemoteCursor(this.connectionId,e[0],e[0].offset))},Uui.prototype.checkAndCombineOperation=function(e,t){if(1===e.length&&1===t.length){e=e[0],t=t[0];if(this.isSameOperation(e,t)&&this.canCombineOperation(e,t)){if("Insert"===e.action&&e.offset+e.length===t.offset||"Delete"===e.action&&e.offset===t.offset)return e.length+=t.length,e.text+=t.text,!0;if("Delete"===e.action&&t.offset+t.length===e.offset)return e.text=t.text+e.text,e.offset=t.offset,e.length+=t.length,!0}}return!1},Uui.prototype.canCombineOperation=function(e,t){return e.format===t.format&&!this.isControlCharacter(e.text)&&!this.isControlCharacter(t.text)&&je(e.markerData)&&je(t.markerData)},Uui.prototype.isSameOperation=function(e,t){return e.action===t.action},Uui.prototype.isControlCharacter=function(e){return-1!==[pJt.Table,pJt.Row,pJt.Cell,pJt.Image,pJt.PageBreak,pJt.ColumnBreak,pJt.Section_Break,pJt.Table,pJt.Field_Separator,pJt.Marker_Start,pJt.Marker_End,pJt.Tab,pJt.LineBreak].indexOf(e)},Uui.prototype.applyRemoteAction=function(e,t){switch(e){case"connectionId":this.connectionId=t;break;case"removeUser":this.removeCarets(t);break;case"action":this.dataReceived(t)}},Uui.prototype.isAcknowledgePending=function(){return!je(this.acknowledgmentPending)},Uui.prototype.handleAcknowledgementReceived=function(e){var t=this.getVersionDifference(e);1<t?this.checkAndRetriveChangesFromServer():(this.logMessage("Ack received: "+e.version),this.logMessage("Ack version diff: "+t),e.version>this.version&&(this.updateVersion(e.version),this.acknowledgementReceived(),this.sendLocalOperation()))},Uui.prototype.updateVersion=function(e){e>this.version&&(this.version=e)},Uui.prototype.acknowledgementReceived=function(){this.acknowledgmentPending=void 0},Uui.prototype.sendLocalOperation=function(){var e,t,i,n=this;0<this.pendingOps.length&&(e=this.pendingOps.shift(),(t={}).currentUser=this.documentEditor.currentUser,t.roomName=this.roomName,t.connectionId=this.connectionId,t.version=this.version,this.acknowledgmentPending=t.operations=e,(i=new XMLHttpRequest).open("Post",this.serviceUrl+"UpdateAction",!0),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),this.setCustomAjaxHeaders(i),i.onreadystatechange=function(){var e;4===i.readyState&&(200===i.status||304===i.status?(e=JSON.parse(i.responseText),n.isSyncServerChanges||n.handleAcknowledgementReceived(e)):(e={status:i.status.toString(),statusText:i.statusText,url:n.serviceUrl+"UpdateAction"},n.documentEditor.fireServiceFailure(e)))},this.logMessage("Sent: "+JSON.stringify(t)),i.send(JSON.stringify(t)))},Uui.prototype.dataReceived=function(e){var t;e.connectionId===this.connectionId&&!this.documentEditor.editor.isIncrementalSave||this.isSyncServerChanges?this.logMessage(this.isSyncServerChanges?"SignalR Server sync"+e.version:"SignalR Same user sync:"+e.version):(t=this.getVersionDifference(e))<=0&&!this.documentEditor.editor.isIncrementalSave?this.logMessage("SignalR return diff:<=0"+e.version):1<t&&!this.documentEditor.editor.isIncrementalSave?(this.logMessage("SignalR return diff:>=1"+e.version),this.checkAndRetriveChangesFromServer()):(this.logMessage("SignalR ack: "+e.version),this.logMessage("Received: "+JSON.stringify(e)),this.handleRemoteOperation(e))},Uui.prototype.getVersionDifference=function(e){return e.version-this.version},Uui.prototype.handleRemoteOperation=function(e){this.documentEditor.editorModule.isRemoteAction=!0;var t=this.documentEditor.selectionModule.getAbsolutePositionFromRelativePosition(this.documentEditor.selectionModule.start),i=this.documentEditor.selectionModule.getAbsolutePositionFromRelativePosition(this.documentEditor.selectionModule.end)-t;je(this.acknowledgmentPending)||(this.logMessage("Acknowledge transform:"+this.acknowledgmentPending[0].text+"version:"+e.version),this.transform([this.acknowledgmentPending],e.operations)),0<this.pendingOps.length&&this.logMessage("Pending transform:"+this.pendingOps.length+"version:"+e.version),this.transform(this.pendingOps,e.operations),this.applyRemoteOperation(e,t,i),this.updateVersion(e.version),this.documentEditor.editorModule.isRemoteAction=!1,this.documentEditor.editorHistoryModule.canUndo()&&(this.documentEditor.editorHistoryModule.undoStack.length=0),this.documentEditor.editorHistoryModule.canRedo()&&(this.documentEditor.editorHistoryModule.redoStack.length=0)},Uui.prototype.transform=function(e,t){for(var i=0;i<t.length;i++){var n=t[i];if(0<e.length)for(var o=0;o<e.length;o++)for(var r=0;r<e[o].length;r++){var s=e[o][r],a=(this.transformSelectionOperation(s,n),n.offset);this.transformOperation(s,n,t),this.logMessage("Transformed offset:"+(n.offset-a))}}},Uui.prototype.skipAction=function(e){for(var t=0;t<e.length;t++){var i=e[t];i.length=0,i.skipOperation=!0}},Uui.prototype.handleAcceptReject=function(e,t){for(var i=0;i<e.length;i++){var n=e[i];n.author===t.markerData.author&&n.revisionType===t.markerData.revisionType&&this.documentEditor.editorModule.getRevision(n.revisionID)&&("Accept"===t.markerData.isAcceptOrReject?n.accept():"Reject"===t.markerData.isAcceptOrReject&&n.reject())}},Uui.prototype.applyRemoteOperation=function(e,t,O){var N,i,V=this.documentEditor.currentUser,_=this.documentEditor.commentReviewPane.commentPane.isEditMode,H=this.documentEditor.editorHistoryModule.lastOperation;je(this.documentEditor.commentReviewPane.commentPane.currentEditingComment)||(N=this.documentEditor.commentReviewPane.commentPane.currentEditingComment.textArea);for(var n,o=0;o<e.operations.length;o++){var r=e.operations[o].markerData,s=void 0,a=this.documentEditor.enableTrackChanges;if(je(r)||je(r.author)||(this.documentEditor.currentUser=r.author),!je(r)&&!je(r.isSkipTracking)&&r.isSkipTracking&&this.documentEditor.enableTrackChanges&&(this.documentEditor.skipSettingsOps=!0,this.documentEditor.enableTrackChanges=!1),!(e.operations[o].skipOperation||!je(e.operations[o].markerData)&&e.operations[o].markerData.skipOperation))if("Update"===e.operations[o].action)je(e.operations[o].styleData)||(b=JSON.parse(e.operations[o].styleData),this.documentEditor.editor.updateStyleObject(b));else{var l,h,d,p,c,u,g,m,f,y,v,b=this.getRelativePositionFromAbsolutePosition(e.operations[o].offset,!1,!1,!1),w=e.operations[o],C=b;if(je(e.operations[o].action))this.documentSettings(e.operations[o]);else if("Delete"!==e.operations[o].action&&"Format"!==e.operations[o].action||("Format"===w.action&&0===w.length||(this.documentEditor.selectionModule.isEndOffset=!0),C=this.getRelativePositionFromAbsolutePosition(e.operations[o].offset+e.operations[o].length,!1,!1,!1),this.documentEditor.selectionModule.isEndOffset=!1),("Insert"===w.action&&w.text!==pJt.Row&&w.text!==pJt.Cell&&(je(w.markerData)||je(w.markerData.isAcceptOrReject))||"Delete"===w.action&&w.text!==pJt.Cell&&(je(w.markerData)||je(w.markerData.isAcceptOrReject))||"Format"===w.action&&(je(w.markerData)||je(w.markerData.isAcceptOrReject)))&&this.documentEditor.selectionModule.select(b,C),je(w.markerData)||(je(w.markerData.revisionForFootnoteEndnoteContent)&&je(w.markerData.revisionId)||(this.documentEditor.editorModule.revisionData=[]),je(w.markerData.revisionForFootnoteEndnoteContent)||this.documentEditor.editorModule.revisionData.push(w.markerData.revisionForFootnoteEndnoteContent),je(w.markerData.revisionId)||this.documentEditor.editorModule.revisionData.push(w.markerData),!je(w.markerData.splittedRevisions)&&0<w.markerData.splittedRevisions.length&&(this.documentEditor.editorModule.revisionData=this.documentEditor.editorModule.revisionData.concat(w.markerData.splittedRevisions))),je(w.markerData)||je(w.markerData.isAcceptOrReject)||""===w.markerData.isAcceptOrReject){if("Insert"===w.action)if("Paste"===w.type)this.documentEditor.editorModule.isPasteListUpdated=!1,this.documentEditor.editorModule.pasteContents(Y.getSfdtDocument(w.pasteContent));else if("PasteToc"===w.type)this.documentEditor.editorModule.isInsertingTOC=!0,this.documentEditor.editorModule.pasteContents(Y.getSfdtDocument(w.pasteContent)),this.documentEditor.editorModule.isInsertingTOC=!1;else if(w.text===pJt.Image.toString())this.insertImage(w.imageData);else if(w.text===pJt.Section_Break.toString()&&"NewPage"===w.type)this.documentEditor.editorModule.insertSectionBreak();else if(w.text===pJt.Section_Break.toString()&&"Continuous"===w.type)this.documentEditor.editorModule.insertSectionBreak(dJt.Continuous);else if(!r||w.text!==pJt.Marker_Start&&w.text!==pJt.Marker_End&&w.text!==pJt.Field_Separator)r&&!je(r.dropDownIndex)&&"DropDown"===w.type?(I=this.documentEditor.selectionModule.start.currentWidget.getInline(this.documentEditor.selectionModule.start.offset,0).element)instanceof Zai&&this.documentEditor.editorModule.updateFormField(I,r.dropDownIndex,!1):w.text===pJt.Section_Break.toString()&&"NewPage"===w.type?this.documentEditor.editorModule.insertSectionBreak():w.text===pJt.Section_Break.toString()&&"Continuous"===w.type?this.documentEditor.editorModule.insertSectionBreak(dJt.Continuous):w.text===pJt.Table?(o=e.operations.length,this.buildTable(e.operations),s=this.getOperationLength(e.operations)):w.text===pJt.Row?(o=e.operations.length,je(w.format)&&e.operations.reverse(),this.buildRow(e.operations),s=this.getOperationLength(e.operations)):w.text===pJt.Cell?(S=l=void 0,"CellFormat"===w.type&&(0<w.length&&(l=e.operations[o-1].format,S=e.operations[o-2].format),this.buildCell(w,l,S))):w.text===pJt.PageBreak.toString()?this.documentEditor.editorModule.insertPageBreak():w.text===pJt.ColumnBreak.toString()?this.documentEditor.editorModule.insertColumnBreak():(w.format&&(A=new Eri,l=JSON.parse(w.format),this.documentEditor.parser.parseCharacterFormat(0,l,A),this.documentEditor.selectionModule.isRetrieveFormatting=!0,this.documentEditor.selectionModule.characterFormat.copyFormat(A),this.documentEditor.selectionModule.isRetrieveFormatting=!1),this.documentEditor.editorModule.insertText(w.text));else{var S,A,x,I,T,E,D,M,k=void 0;if(r.type&&"Bookmark"===r.type)w.text===pJt.Marker_Start?(k=this.documentEditor.editorModule.createBookmarkElements(r.bookmarkName)[0],this.documentEditor.documentHelper.isBookmarkInserted=!1,this.documentEditor.editorModule.insertElementsInternal(this.documentEditor.selectionModule.start,[k])):this.documentEditor.documentHelper.bookmarks.containsKey(r.bookmarkName)&&(S=this.documentEditor.documentHelper.bookmarks.get(r.bookmarkName))&&(k=S.reference,this.documentEditor.documentHelper.isBookmarkInserted=!0,this.documentEditor.editorModule.insertElementsInternal(this.documentEditor.selectionModule.start,[k]),this.documentEditor.selectionModule.selectBookmark(r.bookmarkName),S.properties=this.documentEditor.selectionModule.getBookmarkProperties(S),k.properties=this.documentEditor.selectionModule.getBookmarkProperties(k),this.documentEditor.editorModule.fireContentChange());else if(r.type&&"EditRange"===r.type){var P=r.user,z=r.editRangeId;if(w.text===pJt.Marker_Start)this.documentEditor.documentHelper.restrictEditingPane&&this.documentEditor.documentHelper.restrictEditingPane.addUserDialog.bindListData(P),(k=this.documentEditor.editorModule.addEditElement(P,z)).columnFirst=parseInt(r.columnFirst),k.columnLast=parseInt(r.columnLast),k.line=this.documentEditor.selectionModule.start.currentWidget;else for(var B=0,j=this.documentEditor.documentHelper.editRanges.get(P);B<j.length;B++){var W=j[B];if(W.editRangeId===z){(k=W.editRangeEnd).line=this.documentEditor.selectionModule.start.currentWidget;break}}this.documentEditor.editorModule.insertElementsInternal(this.documentEditor.selectionModule.start,[k]),this.documentEditor.editorModule.fireContentChange()}else r.type&&"Field"===r.type?(this.documentEditor.editor.isFieldOperation=!0,!je(P=w.text===pJt.Marker_Start?0:w.text===pJt.Marker_End?1:w.text===pJt.Field_Separator?2:void 0)&&je(r.checkBoxValue)?(T=new Zai(P),0!==P||je(r.formFieldData)||(x=this.documentEditor.editor.getFormFieldData(w.type),this.documentEditor.parser.parseFormFieldData(0,JSON.parse(r.formFieldData),x),T.formFieldData=x),A=new Eri,w.format&&(x=JSON.parse(w.format),this.documentEditor.parser.parseCharacterFormat(0,x,A)),T.characterFormat.copyFormat(A),this.documentEditor.editorModule.initInsertInline(T)):(I=this.documentEditor.selectionModule.start.currentWidget.getInline(this.documentEditor.selectionModule.start.offset,0).element)instanceof Zai&&this.documentEditor.editorModule.toggleCheckBoxFormField(I,!0,r.checkBoxValue)):je(r)||je(r.commentId)?je(w.markerData.type)||"Footnote"!==w.markerData.type&&"Endnote"!==w.markerData.type?r.type&&"ContentControl"===r.type&&(w.text===pJt.Marker_Start&&(i=new Fli(r.text),je(r.contentControlProperties)||this.documentEditor.editorModule.assignContentControl(i,JSON.parse(r.contentControlProperties))),(T=new Pli(i.contentControlWidgetType)).contentControlProperties=i,T.type=w.text===pJt.Marker_Start?0:1,this.documentEditor.editorModule.insertElementsInternal(this.documentEditor.selectionModule.start,[T]),w.text===pJt.Marker_End)&&T.reference&&this.documentEditor.editorModule.updatePropertiesToBlock(T.reference,!0):"Footnote"===w.markerData.type?this.documentEditor.editorModule.insertFootnote():"Endnote"===w.markerData.type&&this.documentEditor.editorModule.insertEndnote():(E=w.text===pJt.Marker_Start?0:1,M=void 0,je(D=this.documentEditor.documentHelper.layout.getCommentById(this.deletedComments,r.commentId))&&je(D=this.documentEditor.documentHelper.layout.getCommentById(this.documentEditor.documentHelper.comments,r.commentId))&&!je(r.ownerCommentId)&&!je(M=this.documentEditor.documentHelper.layout.getCommentById(this.documentEditor.documentHelper.comments,r.ownerCommentId))&&(D=this.documentEditor.documentHelper.layout.getCommentById(M.replyComments,r.commentId)),je(D)?((R=new Khi(E)).commentId=r.commentId,this.documentEditor.editorModule.insertElementsInternal(this.documentEditor.selectionModule.start,[R]),(0===E?this.commentsStart:this.commentsEnd).push(R)):((R=new Khi(E)).commentId=r.commentId,this.documentEditor.editorModule.insertElementsInternal(this.documentEditor.selectionModule.start,[R]),R.comment=D,M=this.documentEditor.selectionModule.start.currentWidget.children.indexOf(R),D.commentStart=this.documentEditor.selectionModule.start.currentWidget.children[M]))}else if("Delete"===w.action)w.text===pJt.Marker_Start||w.text===pJt.Marker_End?je(r)||je(r.commentId)?(M=(h=this.documentEditor.selectionModule).start.offset-1,this.documentEditor.editorModule.removeAtOffset(h.start.currentWidget,this.documentEditor.selectionModule,M)):(h=this.documentEditor.selectionModule,E=w.text===pJt.Marker_Start?0:1,D=void 0,this.documentEditor.selection.getElementInfo(this.documentEditor.selection.end.currentWidget,this.documentEditor.selection.end.offset).element instanceof Khi&&(D=this.documentEditor.selection.getElementInfo(this.documentEditor.selection.end.currentWidget,this.documentEditor.selection.end.offset).element),1===E?-1!==D.indexInOwner&&this.documentEditor.editorModule.removeAtOffset(h.start.currentWidget,this.documentEditor.selectionModule,h.start.offset):(-1!==(d=D).indexInOwner&&this.documentEditor.editorModule.removeAtOffset(h.start.currentWidget,this.documentEditor.selectionModule,h.start.offset),d.removeCommentMark())):w.text===pJt.Cell?this.buildDeleteCells(w):this.documentEditor.editorModule.onBackSpace();else if("Format"===w.action)if(w.text===pJt.Marker_Start.toString()+pJt.Marker_End.toString())this.updateOperation(w);else if(w.text!==pJt.Marker_Start||je(w.format))if(w.text!==pJt.Marker_Start||je(w.markerData)||"ContentControlCheckBox"!==w.markerData.type){if(je(w.markerData)||je(w.markerData.revisionId))w.text===pJt.Row?je((d=this.getRelativePositionFromAbsolutePosition(w.offset,!1,!0,!1)).rowWidget)||(p=d.rowWidget.ownerTable,c=JSON.parse(w.format),this.documentEditor.documentHelper.owner.parser.parseRowFormat(c,d.rowWidget.rowFormat,0),p.calculateGrid(!1),this.documentEditor.documentHelper.layout.reLayoutTable(p)):w.text===pJt.Cell?("TableFormat"===w.type&&(u=this.getRelativePositionFromAbsolutePosition(w.offset,!0,!1,!1),p=JSON.parse(w.format),this.documentEditor.documentHelper.owner.parser.parseTableFormat(p,u.tableWidget.tableFormat,0),u.tableWidget.calculateGrid(!1),this.documentEditor.documentHelper.layout.reLayoutTable(u.tableWidget)),"RowFormat"===w.type&&(c=this.getRelativePositionFromAbsolutePosition(w.offset,!1,!0,!1),L=JSON.parse(w.format),this.documentEditor.documentHelper.owner.parser.parseRowFormat(L,c.rowWidget.rowFormat,0)),"CellFormat"===w.type&&(u=this.getRelativePositionFromAbsolutePosition(w.offset,!1,!1,!0),g=JSON.parse(w.format),this.documentEditor.documentHelper.owner.parser.parseCellFormat(g,u.cellWidget.cellFormat,0))):w.text===pJt.Image?(I=this.documentEditor.selectionModule.end.currentWidget.getInline(this.documentEditor.selectionModule.end.offset,0).element)instanceof rhi&&this.documentEditor.editorModule.onImageFormat(I,Y.convertPointToPixel(w.imageData.width),Y.convertPointToPixel(w.imageData.height),w.imageData.alternativeText):"ListFormat"===w.type?(m=JSON.parse(w.format),f=new bri(void 0),this.documentEditor.parser.parseParagraphFormat(0,m,f),this.updateList(w,f),je(y=this.documentEditor.documentHelper.getListById(m.listFormat.nsid,!0))||(f.listFormat.listId=y.listId,f.listFormat.list=y),this.documentEditor.editorModule.onApplyParagraphFormat(w.text,f.listFormat,!1,!1)):"RestartNumbering"===w.type?(g=this.updateList(w),y=this.documentEditor.documentHelper.getListById(g,!0),this.documentEditor.editorModule.restartListAtInternal(this.documentEditor.selectionModule,y.listId,y.nsid)):"ContinueNumbering"===w.type?(m=JSON.parse(w.format),f=new bri(void 0),this.documentEditor.parser.parseParagraphFormat(0,m,f),je(y=this.documentEditor.documentHelper.getListById(f.listFormat.nsid,!0))||(f.listFormat.listId=y.listId,f.listFormat.list=y),this.documentEditor.editorModule.applyContinueNumberingInternal(this.documentEditor.selectionModule,f)):"CharacterFormat"===w.type?this.insertCharaterFormat(w.type,w.format):"ParagraphFormat"===w.type?this.insertParagraphFormat(w,w.format):"TableFormat"===w.type?this.insertTableFormat(w.text,w.format,w.offset):"SectionFormat"===w.type?this.insertSectionFormat(w.text,w.format):"RowFormat"===w.type?this.insertRowFormat(w.text,w.format):"CellFormat"===w.type&&this.insertCellFormat(w.format);else if(!je(w.markerData.revisionType)&&"Deletion"===w.markerData.revisionType){if(w.text===pJt.Row){var F=this.getRelativePositionFromAbsolutePosition(w.offset,!1,!0,!1);if(!je(F.rowWidget)){var L=F.rowWidget;this.documentEditor.editorModule.trackRowDeletion(L),this.documentEditor.trackChangesPane.updateTrackChanges();continue}}this.documentEditor.editorModule.onBackSpace()}}else(v=this.documentEditor.selection.currentContentControl)&&"CheckBox"===v.contentControlProperties.type&&this.documentEditor.editorModule.toggleContentControlCheckBox(v,r.checkBoxValue);else(v=this.documentEditor.selection.currentContentControl)&&this.documentEditor.editorModule.assignContentControl(v.contentControlProperties,JSON.parse(w.format));this.documentEditor.editor.revisionData=void 0,this.documentEditor.enableTrackChanges!=a&&(this.documentEditor.skipSettingsOps=!0,this.documentEditor.enableTrackChanges=a),this.documentEditor.currentUser=V;F=this.documentEditor.selectionModule.startOffset,a=(this.updateRemoteSelection(e,this.documentEditor.selectionModule.getAbsolutePositionFromRelativePosition(F)),je(s)||(r=w.length,w.length=s,s=r),this.transformSection(w.action,w,t)[1]),r=this.transformSection(w.action,w,t+O)[1];this.documentEditor.selectionModule.select(this.getRelativePositionFromAbsolutePosition(t=a,!1,!1,!1),this.getRelativePositionFromAbsolutePosition(r,!1,!1,!1)),je(s)||(w.length=s),this.transformRemoteCursor(e.connectionId,w,w.offset),!je(this.documentEditor.searchModule)&&!je(this.documentEditor.optionsPaneModule)&&0<this.documentEditor.searchModule.searchResults.length&&this.documentEditor.optionsPaneModule.isOptionsPaneShow&&this.documentEditor.optionsPaneModule.searchIconClickInternal()}else{var R,a=this.documentEditor.editorModule.getRevision(w.markerData.revisionId);a?"Accept"===w.markerData.isAcceptOrReject?a.accept():"Reject"===w.markerData.isAcceptOrReject&&a.reject():w.text===pJt.Row?(r=this.getRelativePositionFromAbsolutePosition(w.offset,!1,!0,!1))&&r.rowWidget&&this.handleAcceptReject(r.rowWidget.rowFormat.revisions,w):(this.documentEditor.selectionModule.select(b,C),R=void 0,je(R=this.documentEditor.selection.start.isAtParagraphEnd?this.documentEditor.selection.start.currentWidget.paragraph.characterFormat:this.documentEditor.selectionModule.start.currentWidget.getInline(this.documentEditor.selectionModule.start.offset+1,0).element)||this.handleAcceptReject(R.revisions,w))}}}i=void 0,this.documentEditor.editor.isFieldOperation&&(this.documentEditor.editorModule.layoutWholeDocument(),this.documentEditor.editor.isFieldOperation=!1),je(this.rowWidget)||((n=this.rowWidget.ownerTable.combineWidget(this.documentEditor.viewer)).updateRowIndex(0),n.calculateGrid(!0),this.documentEditor.documentHelper.layout.reLayoutTable(n),this.documentEditor.editorModule.reLayout(this.documentEditor.selectionModule),this.rowWidget=void 0),je(this.table)||(this.table.calculateGrid(),this.documentEditor.editorModule.updateTable(this.table),this.documentEditor.editorModule.reLayout(this.documentEditor.selectionModule,!0),this.table=void 0),this.documentEditor.currentUser=V,this.documentEditor.commentReviewPane.commentPane.isEditMode=_,this.documentEditor.editorHistoryModule.lastOperation=H,je(this.documentEditor.commentReviewPane.commentPane.currentEditingComment)||(this.documentEditor.commentReviewPane.commentPane.currentEditingComment.textArea=N)},Uui.prototype.updateOperation=function(e){var t=e.markerData;if(e.text===pJt.Marker_Start.toString()+pJt.Marker_End.toString()){var i,n,o,r,s=void 0;if(this.documentEditor.selection.getElementInfo(this.documentEditor.selection.end.currentWidget,this.documentEditor.selection.end.offset).element instanceof Khi&&0<e.offset&&(e=this.documentEditor.selection.getElementInfo(this.documentEditor.selection.end.currentWidget,this.documentEditor.selection.end.offset).element.commentId,s=this.getComment(e)),!je(s)&&(je(t.done)||!je(t.date))&&je(t.isReply))if(s.text!==t.text)return(i=this.documentEditor.commentReviewPane.commentPane.comments.get(s)).commentText.innerText=t.text,void(s.text=t.text);je(s)?((n=new $hi(t.date)).commentId=t.commentId,o=this.getObjectByCommentId(this.commentsStart,n.commentId),r=this.getObjectByCommentId(this.commentsEnd,n.commentId),je(o)||je(r)||(this.documentEditor.editorModule.updateCommentElement(n,o,r,t),this.documentEditor.editorModule.addCommentWidget(n,!0,!0,!1),this.commentsStart.splice(this.commentsStart.indexOf(o),1),this.commentsEnd.splice(this.commentsEnd.indexOf(r),1),this.documentEditor.commentReviewPane.commentPane.comments.get(n).postComment())):!je(t.done)&&je(t.commentAction)?t.done?this.documentEditor.editorModule.resolveComment(s):this.documentEditor.editorModule.reopenComment(s):"remove"===t.commentAction?((i=this.documentEditor.commentReviewPane.commentPane.comments.get(s)).showDrawer(),this.documentEditor.editorModule.deleteCommentWidget(s),this.deletedComments.push(s),i.hideDrawer()):((n=new $hi(t.date)).commentId=t.commentId,o=this.getObjectByCommentId(this.commentsStart,n.commentId),r=this.getObjectByCommentId(this.commentsEnd,n.commentId),je(o)||je(r)||(this.documentEditor.editorModule.updateCommentElement(n,o,r,t),(n.ownerComment=s).replyComments.splice(t.commentIndex,0,n),this.documentEditor.commentReviewPane.addReply(n,!1,!1)))}},Uui.prototype.getComment=function(e){for(var t=this.documentEditor.documentHelper.comments,i=0;i<t.length;i++){var n=this.documentEditor.documentHelper.layout.getCommentById(t,e);if(!je(n))return n;for(var o=0;o<t[i].replyComments.length;o++){var r=this.documentEditor.documentHelper.layout.getCommentById(t[i].replyComments,e);if(!je(r))return r}}return null},Uui.prototype.updateList=function(e,t){var i=-1;if(e.listData){e=JSON.parse(e.listData);if(e.hasOwnProperty("optimizeSfdt")&&(this.documentEditor.parser.keywordIndex=e.optimizeSfdt?1:0),je(t))e.hasOwnProperty(ioi)&&(i=e.nsid),this.updateListCollection(e,this.documentEditor.parser.keywordIndex);else{var n=this.documentEditor.documentHelper.getListById(t.listFormat.nsid,!0);if(je(n))this.updateListCollection(e,this.documentEditor.parser.keywordIndex);else{var o=[];if(this.documentEditor.parser.parseAbstractList(e,o),!je(n.abstractList)&&n.abstractList.levels.length<t.listFormat.listLevelNumber){n.abstractList.levels=[];for(var r=0;r<o[0].levels.length;r++)n.abstractList.levels.push(o[0].levels[r])}}}}return i},Uui.prototype.getOperationLength=function(e){for(var t=0,i=0;i<e.length;i++)e[parseInt(i.toString(),10)].text!==pJt.Table&&e[parseInt(i.toString(),10)].text!==pJt.Row&&e[parseInt(i.toString(),10)].text!==pJt.Cell||(t+=e[parseInt(i.toString(),10)].length);return t},Uui.prototype.updateListCollection=function(i,n){for(var o=this.documentEditor.editorModule.getUniqueListOrAbstractListId(!0),r=this.documentEditor.editorModule.getUniqueListOrAbstractListId(!1),e=0;e<i[hZt[n]].length;e++)!function(e){var t=i[hZt[n]][e],e=i[dZt[n]].filter(function(e){return e[toi[n]]===t[toi[n]]})[0];je(e)||(e[toi[n]]=r,t[d$t[n]]=o,t[toi[n]]=r,o++,r++)}(e);this.documentEditor.parser.parseAbstractList(i,this.documentEditor.documentHelper.abstractLists),this.documentEditor.parser.parseList(i,this.documentEditor.documentHelper.lists)},Uui.prototype.getObjectByCommentId=function(e,t){for(var i=0,n=e;i<n.length;i++){var o=n[i];if(o.commentId===t)return o}},Uui.prototype.transformOperation=function(e,t,i){if("Insert"!==e.action||"Insert"!==t.action&&"Format"!==t.action)if("Delete"!==e.action||"Delete"!==t.action&&"Format"!==t.action)if("Insert"!==e.action||"Delete"!==t.action&&"Format"!==t.action){if("Delete"===e.action&&("Insert"===t.action||"Format"===t.action))if(e.offset<=t.offset&&e.offset+e.length<=t.offset)t.offset=t.offset-e.length;else if(e.offset<t.offset&&e.offset+e.length>=t.offset+t.length)if(je(t.markerData)||je(t.markerData.type)||"Field"===t.markerData.type||t.text!==pJt.Marker_End&&t.text!==pJt.Marker_Start)t.length=0,t.skipOperation=!0,je(t.markerData)||je(t.markerData.type)||"Field"!==t.markerData.type||t.text!==pJt.Marker_Start&&t.text!==pJt.Marker_End||this.skipAction(i);else{if(!je(t.markerData.commentId)&&t.text===pJt.Marker_End)return this.skipAction(i),[e,t];var n=t.offset-e.offset;t.offset-=n}else e.offset<=t.offset&&"Insert"==t.action&&e.offset+e.length>=t.offset?this.skipAction(i):e.offset>t.offset&&"Format"!==t.action&&(e.offset=e.offset+t.length)}else{if(e.offset<=t.offset)return t.offset=t.offset+e.length,[e,t];if(e.offset>=t.offset+t.length&&"Format"!==t.action)return e.offset=e.offset-t.length,[e,t];e.offset>t.offset&&e.offset<t.offset+t.length&&(t.length+=e.length)}else{if(e.offset<t.offset)return t.offset=t.offset-e.length,[e,t];if(e.offset>t.offset&&"Format"!==t.action)e.offset=e.offset-t.length}else{if(e.offset<t.offset)return t.offset=t.offset+e.length,[e,t];if(e.offset>=t.offset&&"Format"!==t.action)e.offset=e.offset+t.length}return[e,t]},Uui.prototype.transformSection=function(e,t,i){if("Insert"===e){if(t.offset<i)return[t.offset,i+t.length]}else if("Delete"===e&&t.offset<=i)return[t.offset,i-t.length];return[t.offset,i]},Uui.prototype.transformRemoteCursor=function(e,t,i){this.documentEditor.editorModule.isIncrementalSave||this.updateCaretPosition(e,t)},Uui.prototype.updateCaretPosition=function(e,t){if(!je(this.userMap))for(var i=Object.keys(this.userMap),n=0;n<i.length;n++){var o,r,s=i[n];s!==e&&(je(t)?r=this.userMap[s].offset:(o=this.userMap[s].offset,r=this.transformSection(t.action,t,o)[1],this.userMap[s].offset=r),this.updateCaretPositionInteral(this.userMap[s].caret,r))}},Uui.prototype.updateRemoteSelection=function(e,t){var i,n;this.documentEditor.editorModule.isIncrementalSave||e.connectionId&&(i="",(n=void 0)!==this.userMap[e.connectionId]?(i=this.userMap[e.connectionId].color,n=this.userMap[e.connectionId].caret):(n=Q("div",{className:"e-de-blink-cursor",styles:"position:absolute;border-left: 2px solid "+(i=this.getColorForMember(100*Math.random()))}),this.userMap[e.connectionId]=new qui(i,n,t,e.currentUser)),this.userMap[e.connectionId].offset=t,this.updateCaretPositionInteral(n,t))},Uui.prototype.removeCarets=function(e){void 0!==this.userMap[e]&&(this.userMap[e].caret.remove(),delete this.userMap[e])},Uui.prototype.getColorForMember=function(e){return"hsl("+360*(e%20)/7%360+", 100%, 35%)"},Uui.prototype.updateCaretPositionInteral=function(e,t){var i,n=this.documentEditor.zoomFactor,o=this.documentEditor.selectionModule,t=o.getTextPosBasedOnLogicalIndex(this.getRelativePositionFromAbsolutePosition(t,!1,!1,!1)),r=t.location,s=(e.style.display="block",e.parentElement||this.documentEditor.documentHelper.viewerContainer.appendChild(e),o.getSelectionPage(t));s&&(e.style.left=s.boundingRectangle.x+Math.round(r.x)*n+"px",i=(t=o.updateCaretSize(t,!0)).topMargin,e.style.height=t.height*n+"px",t=o.getPageTop(s),e.style.top=t+Math.round(r.y+i)*n+"px","Subscript"===o.characterFormat.baselineAlignment)&&(e.style.top=parseFloat(e.style.top)+parseFloat(e.style.height)/2+"px")},Uui.prototype.getBlockPosition=function(e,t,i,n,o,r,s){var a;if(i instanceof Lai){var l=this.getBlockTotalLength(e,t,i,n,o,r,s);if(n.done)return n.done=!0,l;t=l.currentLength,e=l.offset,a=l.paragraph}else if(i instanceof _ai){if(--e===t&&(o||this.documentEditor.selectionModule.isEndOffset))return n.done=!0,{offset:e,currentLength:t,paragraph:a,tableWidget:i};for(var h=i.firstChild;h;){if(--e===t){if(r||this.documentEditor.selectionModule.isEndOffset)return n.done=!0,{offset:e,currentLength:t,paragraph:a,rowOrCellIndex:h.index,rowWidget:h};if(s)return n.done=!0,{offset:e,currentLength:t,paragraph:a,rowOrCellIndex:(u=a.associatedCell).cellIndex+1,cellWidget:u}}for(var d=h.firstChild;d;){if(--e===t)if(s)return n.done=!0,{offset:e,currentLength:t,paragraph:a,rowOrCellIndex:d.cellIndex,cellWidget:d};for(var p=d.firstChild;p;){var c,u,g=this.getBlockPosition(e,t,p,n,o,r,s);if(n.done)return r&&je(g.rowWidget)?(n.done=!0,{offset:e,currentLength:t,paragraph:a,rowOrCellIndex:(c=d.ownerRow).index+1,rowWidget:c}):s&&je(g.cellWidget)?(n.done=!0,{offset:e,currentLength:t,paragraph:a,rowOrCellIndex:(u=d).cellIndex+1,cellWidget:u}):g;e=g.offset,t=g.currentLength,a=g.paragraph,p=p.getSplitWidgets().pop().nextRenderedWidget}d=d.nextWidget}var m=h.ownerTable.index;(h=h.getSplitWidgets().pop().nextRenderedWidget)&&h.ownerTable.index!==m&&(h=void 0)}}return{offset:e,currentLength:t,paragraph:a}},Uui.prototype.getBlockTotalLength=function(e,t,i,n,o,r,s){var a=i.getSplitWidgets(),l=0;if(e<=t+1)return n.done=!0,{offset:e-1,currentLength:t,paragraph:i};for(var h=0,d=0;d<a.length;d++)for(var p=0;p<a[d].childWidgets.length;p++)for(var c=a[d].childWidgets[p],u=0;u<c.children.length;u++){var g=c.children[u];if(!(g instanceof lhi)){if(g instanceof Xli&&!je(g.textFrame)&&0<g.textFrame.childWidgets.length||g instanceof fli){var m=void 0;if(g instanceof Xli)for(var f=t+h+l+1,y=0;y<g.textFrame.childWidgets.length;y++)f=(m=this.getBlockPosition(e,f,g.textFrame.childWidgets[y],n,o,r,s)).currentLength,e=m.offset;else for(var f=t+h+l+1,v=0;v<g.bodyWidget.childWidgets.length&&!n.done;v++)f=(m=this.getBlockPosition(e,f,g.bodyWidget.childWidgets[v],n,o,r,s)).currentLength,e=m.offset;if(e=m.offset,h+=m.currentLength-(t+l+1+h),n.done)return t=m.currentLength,m}if(l+=g.length,(e+=g.skipformFieldLength?g.length:0)<=t+h+l+1)return n.done=!0,{offset:e-1,currentLength:t+h,paragraph:i}}}return t+h+l+1+1==e&&this.documentEditor.selection.isEndOffset&&!this.documentEditor.selection.isFootEndNoteParagraph(i)?(n.done=!0,{offset:e-1,currentLength:t+h,paragraph:i}):{offset:e,currentLength:t+=l+h+1,paragraph:i}},Uui.prototype.getRelativePositionFromAbsolutePosition=function(e,t,i,n){var o,r,s=this.documentEditor,a=this.documentEditor.documentHelper.pages[0].bodyWidgets[0].childWidgets[0],l=0,h={done:!1},a=this.getBlockByIndex(a,e,0,h,t,i,n);return h.done?(o=a.offset-a.currentLength,r={paragraph:a.paragraph,offset:o=o<0?0:o},t||i||n?a:s.selectionModule.getHierarchicalIndex(r.paragraph,r.offset.toString())):a.offset===a.currentLength+1&&this.documentEditor.selection.isEndOffset?(e=this.documentEditor.selection.getParagraphLength(a.paragraph),l=a.currentLength-e,s.selection.getHierarchicalIndex(a.paragraph,(a.offset-l).toString())):(e=this.getBlockIndexFromHeaderFooter(a.offset,a.currentLength,h,t,i,n),h.done?(o=e.offset-e.currentLength,r={paragraph:e.paragraph,offset:o=o<0?0:o},t||i||n?e:s.selectionModule.getHierarchicalIndex(r.paragraph,r.offset.toString())):"")},Uui.prototype.getBlockIndexFromHeaderFooter=function(e,t,i,n,o,r){for(var s,a=0,l=this.documentEditor.documentHelper.headersFooters;a<l.length;a++)for(var h=l[a],d=0;d<6;d++){var p=h[d];if(p){if(t=(s=this.getBlockByIndex(p.childWidgets[0],e,t,i,n,o,r)).currentLength,e=s.offset,i.done)return s}else{if(e<=t+1)return i.done=!0,s;t++,s.currentLength=t}}return s},Uui.prototype.getBlockByIndex=function(e,t,i,n,o,r,s){var a;do{if(i=(a=this.getBlockPosition(t,i,e,n,o,r,s)).currentLength,t=a.offset,n.done)return a}while(e=e.getSplitWidgets().pop().nextRenderedWidget);return a},Uui.prototype.insertImage=function(e){je(e.metaString)?this.documentEditor.editorModule.insertImageInternal(e.imageString,!0,Y.convertPointToPixel(e.width),Y.convertPointToPixel(e.height),e.alternativeText):(this.documentEditor.editorModule.isImageInsert=!0,this.documentEditor.editorModule.insertImageInternal(e.metaString,!0,Y.convertPointToPixel(e.width),Y.convertPointToPixel(e.height),e.alternativeText))},Uui.prototype.buildTable=function(e){for(var t=0,i=0,n=0;n<e.length;n++)e[n].text===pJt.Row&&(je(e[n].markerData)||(je(this.documentEditor.editorModule.revisionData)&&(this.documentEditor.editorModule.revisionData=[]),this.documentEditor.editorModule.revisionData.push(e[n].markerData)),t++);for(n=0;n<e.length&&(e[n].text===pJt.Cell&&(n+=2,i++),e[n].text===pJt.Table||!je(e[n+1])&&e[n+1].text!==pJt.Row);n++);this.documentEditor.editorModule.insertTable(t,i),this.documentEditor.editorModule.revisionData=void 0},Uui.prototype.buildRow=function(e){var t,i=[],n=[],o=[],r=0,s=0,a=this.getRelativePositionFromAbsolutePosition(e[0].offset,!1,!0,!1),l=a.rowWidget.ownerTable.combineWidget(this.documentEditor.viewer);if(!je(e[0].markerData)&&je(e[0].format)){var h=a.rowWidget;if(0<h.rowFormat.revisions.length)return void h.rowFormat.revisions[0].accept()}for(var d=0;d<e.length;d++){var p=e[d];if(p.text===pJt.Cell&&(r++,i.push(JSON.parse(p.format)),n.push(JSON.parse(e[d+1].format)),o.push(JSON.parse(e[d+2].format)),d+=2),je(e[d+1])||e[d+1].text===pJt.Row)break}for(d=0;d<e.length;d++)e[d].text===pJt.Row&&(je(e[d].markerData)||(je(this.documentEditor.editorModule.revisionData)&&(this.documentEditor.editorModule.revisionData=[]),this.documentEditor.editorModule.revisionData.push(e[d].markerData)),s++,t=JSON.parse(e[d].format));this.documentEditor.editorModule.rowInsertionForCE(a.rowOrCellIndex,r,s,l,t,i,n,o),i=[],n=[],o=[],this.documentEditor.editorModule.revisionData=void 0},Uui.prototype.buildCell=function(e,t,i){var n=this.getRelativePositionFromAbsolutePosition(e.offset,!1,!1,!0);0<e.length?(this.rowWidget=n.cellWidget.ownerRow,this.documentEditor.editorModule.cellInsertionForCE(n.rowOrCellIndex,this.rowWidget,JSON.parse(e.format),JSON.parse(t),JSON.parse(i))):this.documentEditor.documentHelper.owner.parser.parseCellFormat(JSON.parse(e.format),n.cellWidget.cellFormat,0)},Uui.prototype.buildDeleteCells=function(e){var t,i,n=this.getRelativePositionFromAbsolutePosition(e.offset,!1,!1,!0);je(n.cellWidget)||(t=this.documentEditor.selectionModule.getFirstParagraph(n.cellWidget),i=this.documentEditor.selectionModule.getLastParagraph(n.cellWidget),je(t)||je(i)||(this.documentEditor.selectionModule.start.setPosition(t.firstChild,!0),this.documentEditor.selectionModule.end.setPositionParagraph(i.lastChild,i.lastChild.getEndOffset()+1)),this.documentEditor.editorModule.checkAndRemoveComments(),t=void(this.table=n.cellWidget.ownerTable.combineWidget(this.documentEditor.viewer)),n.cellWidget.nextWidget?(i=n.cellWidget.nextWidget,t=this.documentEditor.selectionModule.getFirstParagraph(i)):n.cellWidget.previousWidget&&(i=n.cellWidget.previousWidget,t=this.documentEditor.selectionModule.getFirstParagraph(i)),je(t)&&(t=this.documentEditor.editorModule.getParagraphForSelection(this.table)),e.length+=this.documentEditor.editorModule.onDeleteColumn(this.table,[n.cellWidget]),this.table.updateRowIndex(0),this.documentEditor.selectionModule.selectParagraphInternal(t,!0))},Uui.prototype.transformSelectionOperation=function(e,t){var i,n;"Delete"!==e.action||"Delete"!==t.action&&"Format"!=t.action||(i=t.offset,e.offset+e.length<=(n=t).offset)||e.offset>=n.offset+n.length||(e.offset>=n.offset&&e.offset+e.length<=n.offset+n.length?(t.offset=t.offset,t.length-=e.length,t.length<=0&&(t.skipOperation=!0)):e.offset<n.offset&&e.offset+e.length<=n.offset+n.length?(t.offset=e.offset+e.length,t.length-=t.offset-i):e.offset>=n.offset&&e.offset+e.length>n.offset+n.length?t.length-=t.offset+t.length-e.offset:e.offset<n.offset&&e.offset+e.length>n.offset+n.length&&(n.offset=e.offset,n.length=0,t.skipOperation=!0))},Uui.prototype.documentSettings=function(e){switch(this.documentEditor.skipSettingsOps=!0,e.text){case"enableTrackChanges":this.documentEditor.enableTrackChanges=e.enableTrackChanges;break;case"protection":this.documentEditor.documentHelper.restrictEditingPane.showHideRestrictPane(this.documentEditor.documentHelper.restrictEditingPane.isShowRestrictPane),je(e.protectionData.saltValue)?je(e.protectionData.hashValue)?this.documentEditor.editorModule.unProtectDocument():this.documentEditor.editorModule.validateHashValue(e.protectionData.hashValue):""===e.protectionData.hashValue&&""===e.protectionData.saltValue?this.documentEditor.editorModule.protectDocument(e.protectionData.protectionType):this.documentEditor.editorModule.enforceProtectionAssign(e.protectionData.saltValue,e.protectionData.hashValue,e.protectionData.protectionType)}},Uui.prototype.checkAndRetriveChangesFromServer=function(){var e,t,i=this;this.isSyncServerChanges||(e={version:this.version,connectionId:this.connectionId,roomName:this.roomName},(t=new XMLHttpRequest).open("Post",this.serviceUrl+"GetActionsFromServer",!0),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),this.setCustomAjaxHeaders(t),t.onreadystatechange=function(){var e;4===t.readyState&&(200===t.status||304===t.status?i.applyChangesFromServer(t.responseText):(e={status:t.status.toString(),statusText:t.statusText,url:i.serviceUrl+"GetActionsFromServer"},i.documentEditor.fireServiceFailure(e)))},t.send(JSON.stringify(e)),this.isSyncServerChanges=!0)},Uui.prototype.applyChangesFromServer=function(e){var t=JSON.parse(e);if(0<t.length){for(var i=0;i<t.length;i++){var n=t[i];n.connectionId===this.connectionId?(this.acknowledgementReceived(),this.logMessage(this.isSyncServerChanges?"SignalR Server sync"+n.version:"SignalR Same user sync:"+n.version)):(this.handleRemoteOperation(n),this.logMessage("Received: "+JSON.stringify(JSON.stringify(n)))),this.updateVersion(n.version),this.logMessage("Server sync ack:"+n.version)}this.updateVersion(t[t.length-1].version)}this.isSyncServerChanges=!1,this.isAcknowledgePending()||this.acknowledgementReceived(),this.sendLocalOperation()},Uui.prototype.insertCharaterFormat=function(e,t){var i=new Eri(void 0),t=JSON.parse(t),n=Object.keys(t);this.documentEditor.documentHelper.owner.parser.parseCharacterFormat(0,t,i),1<n.length?(this.documentEditor.documentHelper.owner.fontDialogModule.onCharacterFormat(this.documentEditor.selectionModule,i),this.documentEditor.editorModule.onApplyCharacterFormat("CharacterFormat",i)):1===n.length?-1!==n.indexOf("styleName")?je(t.styleName)?this.documentEditor.editorModule.onApplyCharacterFormat("styleName",null,!1,!0):this.documentEditor.editorModule.applyStyle(t.styleName):-1!==n.indexOf("Uppercase")||-1!==n.indexOf("Lowercase")||-1!==n.indexOf("SentenceCase")||-1!==n.indexOf("ToggleCase")||-1!==n.indexOf("CapitalizeEachWord")?this.documentEditor.editorModule.changeCase(n[0]):"increment"===e||"decrement"===e?this.documentEditor.editorModule.onApplyCharacterFormat(n[0],e,!0):this.documentEditor.editorModule.onApplyCharacterFormat(n[0],t[n[0]]):this.documentEditor.editorModule.clearFormatting()},Uui.prototype.insertParagraphFormat=function(e,t){var i=new bri(void 0),t=JSON.parse(t),n=!1,o=(je(t.isFirstParaForList)||(delete t.isFirstParaForList,n=!0),Object.keys(t));this.documentEditor.documentHelper.owner.parser.parseParagraphFormat(0,t,i),1===o.length?-1!==o.indexOf("styleName")?this.documentEditor.editorModule.applyStyle(t.styleName):"borders"===o[0]?this.documentEditor.editorModule.onApplyParagraphFormat(o[0],i.borders,!1,!1):"listFormat"===o[0]?(this.updateList(e,i),je(e=this.documentEditor.documentHelper.getListById(t.listFormat.nsid,!0))||(i.listFormat.listId=e.listId,i.listFormat.list=e),this.documentEditor.editorModule.onApplyParagraphFormat("listFormat",i.listFormat,!1,!1)):this.documentEditor.editorModule.onApplyParagraphFormat(o[0],t[o[0]],n,!1):this.documentEditor.documentHelper.owner.paragraphDialogModule.onParagraphFormat(i)},Uui.prototype.insertTableFormat=function(e,t,i){var n=new Jri(void 0),t=JSON.parse(t),o=Object.keys(t);this.documentEditor.documentHelper.owner.parser.parseTableFormat(t,n,0);i=this.getRelativePositionFromAbsolutePosition(i,!0,!1,!1).tableWidget;je(e)?1===o.length?this.documentEditor.editorModule.onApplyTableFormat(o[0],t[o[0]],i):-1!==o.indexOf("borders")||-1!==o.indexOf("shading")?(this.documentEditor.editorModule.isBordersAndShadingDialog=!0,this.documentEditor.editorModule.onTableFormat(n,!0,i),this.documentEditor.editorModule.isBordersAndShadingDialog=!1):-1!==o.indexOf("cellSpacing")||-1!==o.indexOf("leftMargin")||-1!==o.indexOf("topMargin")||-1!==o.indexOf("rightMargin")||-1!==o.indexOf("bottomMargin")?this.documentEditor.documentHelper.owner.tableOptionsDialogModule.applySubTableOptions(n,i):this.documentEditor.editorModule.onTableFormat(n,!1,i):this.documentEditor.editorModule.insertAutoFitTable("TableAutoFitToContents"===e?"FitToContents":"TableAutoFitToWindow"===e?"FitToWindow":"FixedColumnWidth",i)},Uui.prototype.insertRowFormat=function(e,t){var i=new Cri(void 0),t=JSON.parse(t),n=Object.keys(t);this.documentEditor.documentHelper.owner.parser.parseRowFormat(t,i,0),1===n.length?this.documentEditor.editorModule.onApplyTableRowFormat(n[0],t[n[0]]):this.documentEditor.editorModule.onRowFormat(i)},Uui.prototype.insertCellFormat=function(e){var t,i,n;this.documentEditor.selectionModule.start.paragraph.isInsideTable&&(t=new $ri(void 0),e=JSON.parse(e),i=Object.keys(e),this.documentEditor.documentHelper.owner.parser.parseCellFormat(e,t,0),n=this.documentEditor.selectionModule.start.paragraph.associatedCell.cellFormat,1===i.length?("shading"===i[0]?this.documentEditor.editorModule.applyCellPropertyValue(this.documentEditor.selectionModule,i[0],t.shading,n):"borders"===i[0]?this.documentEditor.editorModule.applyCellPropertyValue(this.documentEditor.selectionModule,i[0],t.borders,n):this.documentEditor.editorModule.applyCellPropertyValue(this.documentEditor.selectionModule,i[0],e[i[0]],n),this.rowWidget=this.documentEditor.selectionModule.start.paragraph.associatedCell.ownerRow):-1!==i.indexOf("preferredWidth")||-1!==i.indexOf("preferredWidthType")||-1!==i.indexOf("verticalAlignment")||-1!==i.indexOf("borders")||-1!==i.indexOf("shading")?(-1===i.indexOf("borders")&&-1===i.indexOf("shading")||(this.documentEditor.editorModule.isBordersAndShadingDialog=!0),this.documentEditor.editorModule.applyCellPropertyValue(this.documentEditor.selectionModule,void 0,t,n),this.rowWidget=this.documentEditor.selectionModule.start.paragraph.associatedCell.ownerRow,this.documentEditor.editorModule.isBordersAndShadingDialog=!1):this.documentEditor.documentHelper.owner.cellOptionsDialogModule.applySubCellOptions(t))},Uui.prototype.insertSectionFormat=function(e,t){var i,n,t=JSON.parse(t),o=Object.keys(t);"linkToPrevious"===o[0]?(n=(i=this.documentEditor.selectionModule.start.paragraph.bodyWidget).sectionIndex,i=i.headerFooterType,this.documentEditor.editorModule.removeInlineHeaderFooterWidget(n,i,e,t.linkToPrevious)):1<o.length?(n=new ari,this.documentEditor.documentHelper.owner.parser.parseSectionFormat(0,t,n),this.documentEditor.editorModule.onApplySectionFormat(void 0,n)):this.documentEditor.editorModule.onApplySectionFormat(Object.keys(t)[0],t[Object.keys(t)[0]])},Uui.prototype.logMessage=function(e){this.logEventEnabled&&(this.message+=e+" \n")},Uui.prototype.setCustomAjaxHeaders=function(e){for(var t=0;t<this.documentEditor.headers.length;t++)for(var i=this.documentEditor.headers[t],n=0,o=Object.keys(i);n<o.length;n++){var r=o[n];e.setRequestHeader(r,i[r])}},Uui.prototype.destroy=function(){this.version=void 0,this.documentEditor=void 0,this.roomName=void 0,this.userMap=void 0,this.connectionId=void 0,this.acknowledgmentPending=void 0,this.pendingOps=void 0,this.serviceUrl=void 0,this.isSyncServerChanges=void 0,this.message=void 0,this.rowWidget=void 0};tn=Uui;function Uui(e){this.version=0,this.userMap={},this.connectionId="",this.pendingOps=[],this.commentsStart=[],this.commentsEnd=[],this.deletedComments=[],this.serviceUrl="",this.isSyncServerChanges=!1,this.logEventEnabled=!0,this.message="",this.documentEditor=e}Gui.prototype.initializeElement=function(){this.hoverDiv=Q("div",{className:"e-de-user-info e-de-user-name-collapse",styles:"z-index: 1; visibility: hidden;left:-4px;position:absolute;width:20px;height:20px;pointer-events:all;"}),this.userViewContainer=Q("div"),this.spanViewContainer=Q("div",{styles:"background-color:"+this.color+";left: 0px; top: 15px; visibility: visible;"}),this.spanView=Q("span",{styles:"background-color:"+this.color+"; left: 0px;top:-4px;pointer:default"}),this.spanViewContainer.appendChild(this.spanView),this.userViewContainer.appendChild(this.spanViewContainer),this.hoverDiv.appendChild(this.userViewContainer),this.caret.appendChild(this.hoverDiv),this.hoverDiv.addEventListener("mouseenter",this.onMouseEnter.bind(this)),this.hoverDiv.addEventListener("mouseleave",this.onMouseLeave.bind(this))},Gui.prototype.onMouseEnter=function(){this.hoverDiv.classList.remove("e-de-user-name-collapse"),this.hoverDiv.classList.add("e-de-user-name-expended"),this.spanView.innerText=this.userName},Gui.prototype.onMouseLeave=function(){this.hoverDiv.classList.add("e-de-user-name-collapse"),this.hoverDiv.classList.remove("e-de-user-name-expended"),this.spanView.innerText=""};var qui=Gui;function Gui(e,t,i,n){this.color=e,this.caret=t,this.offset=i,this.userName=n,this.initializeElement()}Xui.prototype.getModuleName=function(){return"FootNotesDialog"},Xui.prototype.notesDialog=function(e,t){var i=this.documentHelper.owner.containerId+"_insert_Footnote";this.target=Q("div",{id:i,className:"e-de-insert-footnote"}),this.firstDiv=Q("div"),this.startatValue=Q("div"),this.footCount=Q("input",{attrs:{type:"text"},id:this.documentHelper.owner.containerId+"row"}),this.startatValue.appendChild(this.footCount),this.numberFormatDiv=Q("div",{className:"e-de-container-row"}),this.formatType=Q("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>"}),this.numberFormatDiv.appendChild(this.formatType),this.notesList=new qz({enableRtl:t,placeholder:e.getConstant("Number format"),floatLabelType:"Always",htmlAttributes:{"aria-labelledby":e.getConstant("Number format")}}),this.notesList.appendTo(this.formatType),this.firstDiv.appendChild(this.numberFormatDiv),this.firstDiv.appendChild(this.startatValue),this.target.appendChild(this.firstDiv),this.startValueTextBox=new NL({format:"#",min:1,max:99999,enablePersistence:!1,placeholder:e.getConstant("Start at"),floatLabelType:"Always"}),this.startValueTextBox.appendTo(this.footCount),this.footCount.setAttribute("aria-labelledby",e.getConstant("Start at"))},Xui.prototype.show=function(){var e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);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&&(e=this.endnoteListValue(this.list),this.notesList.index=e)},Xui.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"}},Xui.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, ..."}},Xui.prototype.endnoteListValue=function(e){e="A, B, C, ..."===e?0:"1, 2, 3, ..."===e?1:"a, b, c, ..."===e?2:3;return e},Xui.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.removeElements(),this.footCount=void 0,this.documentHelper=void 0},Xui.prototype.removeElements=function(){this.firstDiv&&(this.firstDiv.remove(),this.firstDiv=void 0),this.startatValue&&(this.startatValue.remove(),this.startatValue=void 0),this.numberFormatDiv&&(this.numberFormatDiv.remove(),this.numberFormatDiv=void 0),this.formatType&&(this.formatType.remove(),this.formatType=void 0),this.target&&(this.target.remove(),this.target=void 0)};var Yui=Xui;function Xui(e){var o=this;this.list=void 0,this.noteNumberFormat=void 0,this.sectionFormat=void 0,this.onCancelButtonClick=function(){o.documentHelper.dialog.hide(),o.documentHelper.updateFocus(),o.unWireEventsAndBindings()},this.loadFontDialog=function(){var e,t,i,n;o.documentHelper.updateFocus(),e=o.sectionFormat||o.documentHelper.owner.selectionModule.sectionFormat,o.documentHelper.selection.isinFootnote?(t=e.footNoteNumberFormat,n=e.initialFootNoteNumber,t=o.reversetype(t)):(i=e.endnoteNumberFormat,t=o.reversetype(i),n=e.initialEndNoteNumber),o.notesList.value=t,o.startValueTextBox.value=n},this.onInsertFootnoteClick=function(){var e,t,i=new ari(void 0);je(o.notesList)||(e=o.notesList.value.toString(),e=o.types(e),t=o.startValueTextBox.value,je(o.notesList))||(o.documentHelper.selection.isinFootnote?(i.footNoteNumberFormat=e,i.initialFootNoteNumber=t):(i.endnoteNumberFormat=e,i.initialEndNoteNumber=t),o.documentHelper.owner.editorModule.onApplySectionFormat(void 0,i)),o.documentHelper.hideDialog()},this.unWireEventsAndBindings=function(){o.notesList.value=void 0},this.documentHelper=e}Jui.prototype.isEmpty=function(){return 0===this.height&&0===this.width},Jui.prototype.clone=function(){return new Jui(this.width,this.height)};var Kui=Jui;function Jui(e,t){this.width=e,this.height=t}$ui.prototype.appendTo=function(){this.preRender(),this.render()},$ui.prototype.preRender=function(){this.unWireEvents(),this.wireEvents()},$ui.prototype.render=function(){this.updateRulerGeometry()},$ui.prototype.getModuleName=function(){return"Ruler"},$ui.prototype.destroy=function(){var t=this;this.unWireEvents(),this.rulerSpacediv&&(this.rulerSpacediv.remove(),this.rulerSpacediv=null),this.rulerSVGElement&&(this.rulerSVGElement.childNodes.forEach(function(e){t.rulerSVGElement.removeChild(e)}),this.rulerSVGElement.innerHTML="",this.rulerSVGElement.remove(),this.rulerSVGElement=null),this.element.classList.remove("e-ruler")},$ui.prototype.showHideRuler=function(e){this.element.style.display=e?"block":"none"},$ui.prototype.updateRulerGeometry=function(){this.element.style.textAlign="left",this.renderRulerSpace(),this.updateRuler()},$ui.prototype.renderRulerSpace=function(){var e=this.getRulerGeometry();return this.rulerSpacediv=document.getElementById(this.element.id+"_ruler_space"),this.rulerSpacediv||(this.rulerSpacediv=this.rulerHelper.createHtmlElement("div",{id:this.element.id+"_ruler_space",style:"height:"+e.height+"px;width:"+e.width+"px;cssFloat:left;"}),this.element.appendChild(this.rulerSpacediv)),this.rulerSpacediv},$ui.prototype.updateRuler=function(){var e=this.getRulerSize(),t=this.getRulerGeometry(),i=0,n=new Kui;this.rulerSVGElement=this.getRulerSVG(t),this.rulerSVGElement&&(i=this.length,n.height=e,t=this.offset,i)&&i!==1/0&&this.updateSegments(t,i+Math.abs(t),this.rulerSVGElement,e)},$ui.prototype.updateSegments=function(e,t,i,n){var o=e,r={trans:0};for(this.rulerStartValue=Y.convertPixelToPoint(this.zeroPosition);o<t;){var s=this.getNewSegment(o,i);s&&(i.appendChild(s.segment),o=this.updateSegment(e,t,s,o,r,n))}this.addSegmentWidth=!1},$ui.prototype.updateSegment=function(e,t,i,n,o,r){var s=this.updateSegmentWidth(this.scale),e=(n===e?(this.startValue=Math.floor(e/s)*s/this.scale,this.startValue=this.startValue%1!=0?Number(this.startValue.toFixed(1)):this.startValue,i.label.textContent=this.rulerStartValue.toString(),this.defStartValue=n=this.startValue*this.scale,"Horizontal"===this.orientation?this.hRulerOffset=e-n:this.vRulerOffset=e-n):(this.startValue=Y.convertPixelToPoint(n),this.startValue=this.startValue%1!=0?Number(this.startValue.toFixed(1)):this.startValue,e=void 0,0===this.rulerStartValue&&(this.addSegmentWidth=!0),e=this.addSegmentWidth?Math.abs(this.rulerStartValue+36):Math.abs(this.rulerStartValue-36),i.label.textContent=e.toString(),this.rulerStartValue=e),this.updateTickLabel(i,r),"Horizontal"===this.orientation?o.trans+.5+",0.5":"0.5,"+(o.trans+.5));return i.segment.setAttribute("transform","translate("+e+") scale(1,1)"),o.trans+=s*this.scale,n+=s},$ui.prototype.updateTickLabel=function(e,t){var i=e.segment.lastChild.getBBox(),n="Horizontal"===this.orientation,o="RightOrBottom"===this.tickAlignment,r=n?-4:0,s=n?o?t/2+5.5-5.5:t/2+5.5:i.height,o=(n&&(s+=2),n||(r+=10,s+=2),o?-(i.width+2)+","+(t/2-i.height):-(i.width+2)+","+(t/2-i.height/2));this.rulerHelper.setAttributeSvg(e.segment.lastChild,n?{x:r,y:s}:{x:r,y:s,transform:"rotate(270)translate("+o+")"})},$ui.prototype.getNewSegment=function(e,t){e=this.createNewTicks(e,t);return{segment:e,label:this.createTickLabel(t,e)}},$ui.prototype.createNewTicks=function(e,t){var i,n=this.updateSegmentWidth(this.scale),o=this.rulerHelper.createSvgElement("g",{class:"e-de-ruler-segment"}),r=this.rulerHelper.createSvgElement("rect",{class:"e-de-ruler-segment1"}),s="Horizontal"===this.orientation?n*this.scale:15,a="Horizontal"===this.orientation?15:n;r.setAttribute("x","0"),r.setAttribute("y","0"),r.setAttribute("width",s.toString()),r.setAttribute("height",a.toString()),r.setAttribute("fill","lightgrey");for(var l=0;l<this.interval;l++)i=n/this.interval,(i=this.createTick(t,i,l+1,e))&&o.appendChild(i);return o},$ui.prototype.getLinePoint=function(e,t,i){var n=this.updateSegmentWidth(this.scale),o=this.getRulerSize();return i=(t*=i-1)%n==0?o:.3*o},$ui.prototype.createTick=function(e,t,i,n){var o,e=this.getLinePoint(e,t,i),r=this.getRulerSize(),s="Horizontal"===this.orientation,a="RightOrBottom"===this.tickAlignment,t=t*(i-1)*this.scale,i=s?t:a?r:0,l=s?t:a?r-e:r-(r-e),h=s?a?r:r-(r-e):t,a=s?a?r-e:0:t;return 0!=a&&(s||(i-=6,l-=6),(o=this.rulerHelper.createSvgElement("line",{x1:i,y1:h-=6,x2:l,y2:a-=6,"stroke-width":"0.25",stroke:"black"})).setAttribute("class","e-de-ruler-tick")),o},$ui.prototype.createTickLabel=function(e,t){var i;return t&&(i=this.rulerHelper.createSvgElement("text",{class:"e-de-ruler-tick-label",style:"font-weight: 400"}),t.appendChild(i)),i},$ui.prototype.updateSegmentWidth=function(e){if(100!==this.segmentWidth)return this.segmentWidth;var t=1,i=100;for(i=100/Math.pow(2,Math.round(Math.log(e)/Math.log(2)));100<i;)t/=10,i/=10;for(;i<25;)t*=10,i*=10;return(i=25<=i&&i%25!=0?25*Math.round(i/25):i)*e/t},$ui.prototype.getRulerGeometry=function(){return"Horizontal"===this.orientation?new Kui(this.length,this.element?this.element.getBoundingClientRect().height:0):new Kui(this.element?this.element.getBoundingClientRect().width:0,this.length)},$ui.prototype.getRulerSize=function(){return this.thickness},$ui.prototype.getRulerSVG=function(e){var t,i=this.getRulerSize();if(this.element&&(t=document.getElementById(this.element.id+"_ruler_space"))){var i={id:this.element.id+"_Ruler_svg",width:"Horizontal"===this.orientation?this.length:i+"px",height:"Horizontal"===this.orientation?i:e.height+"px",style:"position:inherit;"},n=this.rulerHelper.createSvgElement("svg",i);if(0<t.childNodes.length)for(var o=t.childNodes.length-1;0<=o;o--)t.childNodes[parseInt(o.toString(),10)].parentNode.removeChild(t.childNodes[parseInt(o.toString(),10)]);t.appendChild(n)}return n},$ui.prototype.wireEvents=function(){},$ui.prototype.unWireEvents=function(){};var Zui=$ui;function $ui(e,t){this.interval=4,this.segmentWidth=47.9988,this.orientation="Horizontal",this.tickAlignment="RightOrBottom",this.markerColor="red",this.thickness=15,this.arrangeTick=null,this.length=400,this.offset=0,this.scale=1,this.rulerStartValue=1584,this.zeroPosition=Y.convertPointToPixel(1584),this.addSegmentWidth=!1,this.element=e,this.rulerHelper=t}tgi.prototype.onMarkIndicatorClick=function(){for(var e=document.querySelector(".e-de-ruler-markIndicator"),t=0;t<e.childNodes.length;t++){var i=e.childNodes[parseInt(t.toString(),10)];if("block"===i.style.display){i.style.display="none";i=(t+1)%e.childNodes.length;e.childNodes[parseInt(i.toString(),10)].style.display="block";break}}},tgi.prototype.onHRulerMouseEnter=function(){je(this.currentTabStopElement)||(this.currentTabStopElement.style.display="block")},tgi.prototype.onHRulerMouseLeave=function(){je(this.currentTabStopElement)||(this.currentTabStopElement.style.display="none")},tgi.prototype.onRulerDblClick=function(){this.documentEditor.showDialog("PageSetup")},tgi.prototype.onHRulerMouseDown=function(e){this.resizerEnabled&&!this.documentEditor.isTableMarkerDragging&&(this.isDraggingRender=!0,0<this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.columns.length&&(this.isLeftMultiColumn?this.columnInitialValue=this.multiColumnElement.getBoundingClientRect().left:this.isRightMultiColumn&&(this.columnInitialValue=this.multiColumnElement.getBoundingClientRect().left+this.multiColumnElement.getBoundingClientRect().width)),n=this.hRuler.getBoundingClientRect(),this.renderInitialValue=Y.convertPixelToPoint(Math.round(e.clientX-n.left)),this.currentScrollLeft=this.hRuler.scrollLeft,t=document.getElementById(this.documentEditor.element.id+"_rightIndent"),this.initialRightMargin=Y.getNumberFromString(t.style.left),t=Math.round(e.clientX-n.left),n=this.documentEditor.documentHelper.currentPage.boundingRectangle.x+t,(t=document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg")).style.left=n+"px",t.style.display="block");var t,i,n=this.hRuler.getBoundingClientRect();n.y+n.height/2<=e.clientY&&(this.mouseDownTabValue=e.clientX-this.hRuler.getBoundingClientRect().left,"Pages"===this.documentEditor.layoutType?(this.mouseDownTabValue=Y.convertPixelToPoint(this.mouseDownTabValue-Y.convertPointToPixel(this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin)*this.documentEditor.zoomFactor),this.position.paragraph.paragraphFormat.bidi&&(i=je(this.position.paragraph.absoluteXPosition)?this.position.paragraph.width:parseFloat(this.position.paragraph.absoluteXPosition.width.toString()),i=Y.convertPixelToPoint(i*this.documentEditor.zoomFactor),this.mouseDownTabValue=i-this.mouseDownTabValue)):"Continuous"===this.documentEditor.layoutType&&(this.position.paragraph.paragraphFormat.bidi?(this.mouseDownTabValue=Y.convertPixelToPoint(this.mouseDownTabValue-20),i=je(this.position.paragraph.absoluteXPosition)?this.position.paragraph.width:parseFloat(this.position.paragraph.absoluteXPosition.width.toString()),i=Y.convertPixelToPoint(i*this.documentEditor.zoomFactor),this.mouseDownTabValue=i-this.mouseDownTabValue):this.mouseDownTabValue=Y.convertPixelToPoint(this.mouseDownTabValue-20)))},tgi.prototype.onHRulerMouseUp=function(e){var t,i=document.getElementById(this.documentEditor.element.id+"_markIndicator"),n=this.hRuler.getBoundingClientRect();n.y+n.height/2<=e.clientY&&(this.mouseUpTabValue=e.clientX-this.hRuler.getBoundingClientRect().left,"Pages"===this.documentEditor.layoutType?(this.mouseUpTabValue=Y.convertPixelToPoint(this.mouseUpTabValue-Y.convertPointToPixel(this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin)*this.documentEditor.zoomFactor),this.position.paragraph.paragraphFormat.bidi&&(t=je(this.position.paragraph.absoluteXPosition)?this.position.paragraph.width:parseFloat(this.position.paragraph.absoluteXPosition.width.toString()),t=Y.convertPixelToPoint(t*this.documentEditor.zoomFactor),this.mouseUpTabValue=t-this.mouseUpTabValue)):"Continuous"===this.documentEditor.layoutType&&(this.position.paragraph.paragraphFormat.bidi?(this.mouseUpTabValue=Y.convertPixelToPoint(this.mouseUpTabValue-20),t=je(this.position.paragraph.absoluteXPosition)?this.position.paragraph.width:parseFloat(this.position.paragraph.absoluteXPosition.width.toString()),t=Y.convertPixelToPoint(t*this.documentEditor.zoomFactor),this.mouseUpTabValue=t-this.mouseUpTabValue):this.mouseUpTabValue=Y.convertPixelToPoint(this.mouseUpTabValue-20)),n=document.getElementById(this.documentEditor.element.id+"_rightIndent"),e=Y.getNumberFromString(n.style.left),0<this.mouseUpTabValue)&&this.mouseUpTabValue<e&&this.mouseDownTabValue===this.mouseUpTabValue&&(je(i)||je(t=i.querySelector('.e-de-ruler-marker[style*="display: block;"]'))||(this.mouseUpTabValue/=this.documentEditor.zoomFactor,"LeftTab"===(n=t.getAttribute("data-name"))||"CenterTab"===n||"RightTab"===n||"DecimalTab"===n||"BarTab"===n?((e=new yri).position=this.mouseUpTabValue,e.tabJustification=this.getTabJustification(n),e.deletePosition=0,e.tabLeader="None",this.documentEditor.editorModule.onApplyParagraphFormat("tabStop",[e],!1,!1)):"FirstLineIndent"!==n&&"HangingIndent"!==n||("HangingIndent"===n?(i=this.documentEditor.selectionModule.paragraphFormat.firstLineIndent,t=this.mouseUpTabValue+i,e=this.documentEditor.selectionModule.start.paragraph.paragraphFormat.firstLineIndent,this.documentEditor.editorModule.onApplyParagraphFormat("firstLineIndent",e-t,!1,!1),n=this.documentEditor.selectionModule.start.paragraph.paragraphFormat.leftIndent+e,this.documentEditor.editorModule.onApplyParagraphFormat("leftIndent",n-(e-=t),!1,!1,!0)):this.documentEditor.editorModule.onApplyParagraphFormat("firstLineIndent",this.mouseDownTabValue,!1,!1))))},tgi.prototype.onRularMouseUp=function(e){if(this.isDraggingRender&&!this.documentEditor.isTableMarkerDragging){this.hRuler.getBoundingClientRect();var t=this.finalmouseXRelativeToDiv;if(this.isLeftMultiColumn||this.isRightMultiColumn){for(var e=e.clientX-this.columnInitialValue,i=this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.cloneFormat(),n=this.documentEditor.selectionModule.sectionFormat.pageWidth-this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin-this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.rightMargin,o=this.isLeftMultiColumn?i.columns[0].space+Y.convertPixelToPoint(e):i.columns[0].space-Y.convertPixelToPoint(e),r=0;r<i.columns.length;r++){var s,a=i.columns[parseInt(r.toString(),10)];0<=o&&36<=a.width?(s=Y.convertPointToPixel((n-Y.convertPixelToPoint(o)*(i.numberOfColumns-1))/i.numberOfColumns),a.width=s,r<i.columns.length-1&&(a.space=o)):a[0].space=a[1].space}this.documentEditor.editorModule.onApplySectionFormat(void 0,i),this.isLeftMultiColumn=!1,this.isRightMultiColumn=!1}else this.isLeftRulerMargin?(this.documentEditor.hRuler.startMargin=t/this.documentEditor.zoomFactor,this.documentEditor.selectionModule.sectionFormat.leftMargin=t/this.documentEditor.zoomFactor):(e=Y.convertPixelToPoint(this.rulerGeometry.width)-t/this.documentEditor.zoomFactor,this.documentEditor.selectionModule.sectionFormat.rightMargin=e);this.resizerEnabled=!1,this.isDraggingRender=!1,this.isLeftRulerMargin=void 0,document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg").style.display="none"}},tgi.prototype.onVMouseMove=function(e){var t,i,n,o,r,s,a;!this.documentEditor.isDestroyed&&this.documentEditor.documentEditorSettings.showRuler&&(t=this.vRuler.getBoundingClientRect(),n=this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.topMargin*this.documentEditor.zoomFactor,a=Y.convertPixelToPoint(t.height)-this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.bottomMargin*this.documentEditor.zoomFactor,o=Y.convertPixelToPoint(Math.round(e.clientY-t.top)),i=Math.round(e.clientY-t.top),this.isDraggingRender||(n-3<=o&&o<=3+n?(this.vRuler.style.cursor="n-resize",this.vRuler.setAttribute("title",this.locale.getConstant("Top Margin")),this.resizerEnabled=!0,this.isTopRulerMargin=!0):a-3<=o&&o<=3+a?(this.vRuler.style.cursor="n-resize",this.vRuler.setAttribute("title",this.locale.getConstant("Bottom Margin")),this.resizerEnabled=!0,this.isTopRulerMargin=!1):(this.vRuler.style.cursor="default",this.vRuler.hasAttribute("title")&&this.vRuler.removeAttribute("title"),this.resizerEnabled=!1)),this.isDraggingRender)&&(n=Y.convertPixelToPoint(Math.round(e.clientY-t.top)),o=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.topMargin)*this.documentEditor.zoomFactor,a=this.documentEditor.selectionModule.sectionFormat.pageHeight,e=this.documentEditor.selectionModule.sectionFormat.bottomMargin,s=this.documentEditor.selectionModule.sectionFormat.topMargin,this.isTopRulerMargin?(e=(r=o)+Y.convertPointToPixel(a-e-12)*this.documentEditor.zoomFactor)<i+o?n=Y.convertPixelToPoint(i=e-o):i+o<r&&(n=Y.convertPixelToPoint(i=r-o)):(e=o+Y.convertPointToPixel(s+12)*this.documentEditor.zoomFactor,(r=o+Y.convertPointToPixel(a)*this.documentEditor.zoomFactor)<i+o?n=Y.convertPixelToPoint(i=r-o):i+o<e&&(n=Y.convertPixelToPoint(i=e-o))),s=Y.convertPixelToPoint(t.height)-this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.bottomMargin*this.documentEditor.zoomFactor,this.resizeVRulerMargins(this.isTopRulerMargin,this.initialYValue,this.currentScrollTop,s,this.vRuler,n,this.documentEditor),a=this.documentEditor.documentHelper.currentPage.boundingRectangle.y*this.documentEditor.zoomFactor+i,document.getElementById(this.documentEditor.element.id+"_vRuler_indicator_svg").style.top=a+"px")},tgi.prototype.onVMouseDown=function(e){var t,i;this.resizerEnabled&&(this.isDraggingRender=!0,t=this.vRuler.getBoundingClientRect(),this.initialYValue=Y.convertPixelToPoint(Math.round(e.clientY-t.top)),this.currentScrollTop=this.vRuler.scrollTop,e=Math.round(e.clientY-t.top),t=document.getElementById(this.documentEditor.element.id+"_vRuler_indicator_svg"),i=this.documentEditor.documentHelper.currentPage.boundingRectangle.y*this.documentEditor.zoomFactor,t.style.top=i+e+"px",t.style.display="block")},tgi.prototype.onVMouseUp=function(e){var t;this.isDraggingRender&&(t=this.vRuler.getBoundingClientRect(),e=Y.convertPixelToPoint(Math.round(e.clientY-t.top)),this.isTopRulerMargin?(this.documentEditor.vRuler.startMargin=e/this.documentEditor.zoomFactor,this.documentEditor.selectionModule.sectionFormat.topMargin=e/this.documentEditor.zoomFactor):(t=Y.convertPixelToPoint(this.rulerGeometry.height)-e/this.documentEditor.zoomFactor,this.documentEditor.vRuler.endMargin=t,this.documentEditor.selectionModule.sectionFormat.bottomMargin=t),this.resizerEnabled=!1,this.isDraggingRender=!1,document.getElementById(this.documentEditor.element.id+"_vRuler_indicator_svg").style.display="none",this.isTopRulerMargin=void 0)},tgi.prototype.onDocumentIntentTrue=function(){this.documentEditor.isOnIndent=!0},tgi.prototype.onDocumentIntentFalse=function(){this.documentEditor.isOnIndent=!1},tgi.prototype.onDoubleClick=function(e){this.documentEditor.showDialog("Paragraph"),e.stopPropagation()},tgi.prototype.onFirstLineIndentMouseDown=function(e){this.isDraggingIndents1=!0,this.firstLineOffset=e.clientX-this.firstLineIndent.getBoundingClientRect().left,this.indentInitialValue=Y.getNumberFromString(this.firstLineIndent.style.left);var t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin)*this.documentEditor.zoomFactor,i=(this.documentEditor.selectionModule.paragraphFormat.bidi&&(t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin-(this.documentEditor.selectionModule.sectionFormat.pageWidth-this.documentEditor.selectionModule.sectionFormat.leftMargin-this.documentEditor.selectionModule.sectionFormat.rightMargin))*this.documentEditor.zoomFactor),(t="Continuous"===this.documentEditor.layoutType&&(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20,this.documentEditor.selectionModule.paragraphFormat.bidi)?this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20-this.documentEditor.viewer.clientArea.width*this.documentEditor.zoomFactor:t)+e.clientX-this.firstLineOffset-this.hRuler.getBoundingClientRect().left),n=this.documentEditor.documentHelper.currentPage.boundingRectangle.x,n=("Continuous"===this.documentEditor.layoutType?0:n)+(i-t)+6,i=document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg");i.style.left=n+"px",i.style.display="block",e.stopPropagation()},tgi.prototype.onIndentMouseMove=function(e){var t,i,n,o;this.isDraggingIndents1&&(o=i=t=void 0,n=document.getElementById(this.documentEditor.element.id+"_rightIndent"),n=Y.getNumberFromString(n.style.left),"Pages"===this.documentEditor.layoutType?this.documentEditor.selectionModule.paragraphFormat.bidi?(i=(t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin-(this.documentEditor.selectionModule.sectionFormat.pageWidth-this.documentEditor.selectionModule.sectionFormat.leftMargin-this.documentEditor.selectionModule.sectionFormat.rightMargin))*this.documentEditor.zoomFactor)-6+Y.convertPointToPixel(this.documentEditor.selectionModule.sectionFormat.pageWidth)*this.documentEditor.zoomFactor,o=n+Y.convertPointToPixel(42)*this.documentEditor.zoomFactor):(o=(t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin)*this.documentEditor.zoomFactor)-6,i=n-Y.convertPointToPixel(42)*this.documentEditor.zoomFactor):"Continuous"===this.documentEditor.layoutType&&(this.position.paragraph.paragraphFormat.bidi?(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20-this.documentEditor.viewer.clientArea.width*this.documentEditor.zoomFactor,i=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20+40-6,o=n+Y.convertPointToPixel(42)*this.documentEditor.zoomFactor):(o=(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20)-6,i=n-Y.convertPointToPixel(42)*this.documentEditor.zoomFactor)),(n=t+e.clientX-this.firstLineOffset-this.hRuler.getBoundingClientRect().left)<o?n=o:i<n&&(n=i),this.firstLineIndent.style.left=n+"px",e=this.documentEditor.documentHelper.currentPage.boundingRectangle.x,o=(e="Continuous"===this.documentEditor.layoutType?0:e)+(n-t)+6,document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg").style.left=o+"px")},tgi.prototype.onIndentMouseUp=function(e){var t;this.isDraggingIndents1&&(this.isDraggingIndents1=!1,t=Y.getNumberFromString(this.firstLineIndent.style.left),parseInt(this.firstLineIndent.style.left.replace("px",""),10)<0&&(t*=-1),this.documentEditor.selectionModule.paragraphFormat.bidi?this.documentEditor.editorModule.applyRulerMarkerValues("firstLineIndent",t,this.indentInitialValue):this.documentEditor.editorModule.applyRulerMarkerValues("firstLineIndent",this.indentInitialValue,t),this.indentInitialValue=t,document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg").style.display="none")},tgi.prototype.onHangIndentMouseDown=function(e){this.isDraggingIndents2=!0,this.hangingLineOffset=e.clientX-this.hangingIndent.getBoundingClientRect().left,this.hangingIndentInitialValue=Y.getNumberFromString(this.hangingIndent.style.left);var t,i=document.getElementById(this.documentEditor.element.id+"_rightIndent"),i=Y.getNumberFromString(i.style.left),i=("Pages"===this.documentEditor.layoutType?this.documentEditor.selectionModule.paragraphFormat.bidi?(t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin-(this.documentEditor.selectionModule.sectionFormat.pageWidth-this.documentEditor.selectionModule.sectionFormat.leftMargin-this.documentEditor.selectionModule.sectionFormat.rightMargin))*this.documentEditor.zoomFactor,this.minLimit1=i+Y.convertPointToPixel(42)*this.documentEditor.zoomFactor,this.maxLimit1=t-6+Y.convertPointToPixel(this.documentEditor.selectionModule.sectionFormat.pageWidth)*this.documentEditor.zoomFactor):(t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin)*this.documentEditor.zoomFactor,this.minLimit1=t-6,this.maxLimit1=i-Y.convertPointToPixel(42)*this.documentEditor.zoomFactor):"Continuous"===this.documentEditor.layoutType&&(this.position.paragraph.paragraphFormat.bidi?(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20-this.documentEditor.viewer.clientArea.width*this.documentEditor.zoomFactor,this.maxLimit1=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20+40-6,this.minLimit1=i+Y.convertPointToPixel(42)*this.documentEditor.zoomFactor):(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20,this.minLimit1=t-6,this.maxLimit1=i-Y.convertPointToPixel(42)*this.documentEditor.zoomFactor)),this.leftIndent1=document.getElementById(this.documentEditor.element.id+"_leftIndent"),t+e.clientX-this.hangingLineOffset-this.hRuler.getBoundingClientRect().left),n=this.documentEditor.documentHelper.currentPage.boundingRectangle.x,n=("Continuous"===this.documentEditor.layoutType?0:n)+(i-t)+6,i=document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg");i.style.left=n+"px",i.style.display="block",e.stopPropagation()},tgi.prototype.onHangIndentMouseMove=function(e){var t,i;this.isDraggingIndents2&&(t=void 0,"Pages"===this.documentEditor.layoutType?t=this.documentEditor.selectionModule.paragraphFormat.bidi?Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin-(this.documentEditor.selectionModule.sectionFormat.pageWidth-this.documentEditor.selectionModule.sectionFormat.leftMargin-this.documentEditor.selectionModule.sectionFormat.rightMargin))*this.documentEditor.zoomFactor:Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin)*this.documentEditor.zoomFactor:"Continuous"===this.documentEditor.layoutType&&(t=this.position.paragraph.paragraphFormat.bidi?this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20-this.documentEditor.viewer.clientArea.width*this.documentEditor.zoomFactor:this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20),(e=t+e.clientX-this.hangingLineOffset-this.hRuler.getBoundingClientRect().left)>this.maxLimit1?e=this.maxLimit1:e<this.minLimit1&&(e=this.minLimit1),this.leftIndent1.style.left=e+"px",this.hangingIndent.style.left=e+"px",i=this.documentEditor.documentHelper.currentPage.boundingRectangle.x,i=(i="Continuous"===this.documentEditor.layoutType?0:i)+(e-t)+6,document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg").style.left=i+"px")},tgi.prototype.onHangIndentMouseUp=function(e){var t;this.isDraggingIndents2&&(this.isDraggingIndents2=!1,t=Y.getNumberFromString(this.hangingIndent.style.left),parseInt(this.hangingIndent.style.left.replace("px",""),10)<0&&(t*=-1),this.documentEditor.selectionModule.paragraphFormat.bidi?this.documentEditor.editorModule.applyRulerMarkerValues("hangingIndent",t,this.hangingIndentInitialValue):this.documentEditor.editorModule.applyRulerMarkerValues("hangingIndent",this.hangingIndentInitialValue,t),this.hangingIndentInitialValue=t,document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg").style.display="none")},tgi.prototype.onLeftIndentMouseDown=function(e){this.isDraggingIndents3=!0,this.leftLineOffset=e.clientX-this.leftIndent.getBoundingClientRect().left,this.indentInitialValue=Y.getNumberFromString(this.leftIndent.style.left),this.firstIndentInitialValue=Y.getNumberFromString(this.firstLineIndent.style.left),this.diff=this.firstIndentInitialValue-this.indentInitialValue,this.firstLineIndent=document.getElementById(this.documentEditor.element.id+"_firstLineIndent");var t,i=document.getElementById(this.documentEditor.element.id+"_rightIndent"),i=Y.getNumberFromString(i.style.left),i=("Pages"===this.documentEditor.layoutType?this.documentEditor.selectionModule.paragraphFormat.bidi?(t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin-(this.documentEditor.selectionModule.sectionFormat.pageWidth-this.documentEditor.selectionModule.sectionFormat.leftMargin-this.documentEditor.selectionModule.sectionFormat.rightMargin))*this.documentEditor.zoomFactor,this.minLimit2=i+Y.convertPointToPixel(42)*this.documentEditor.zoomFactor,this.maxLimit2=t-6+Y.convertPointToPixel(this.documentEditor.selectionModule.sectionFormat.pageWidth)*this.documentEditor.zoomFactor,this.isHangingIndent=Y.getNumberFromString(this.hangingIndent.style.left)-i<=Y.getNumberFromString(this.firstLineIndent.style.left)-i):(t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin)*this.documentEditor.zoomFactor,this.minLimit2=t-6,this.maxLimit2=i-Y.convertPointToPixel(42)*this.documentEditor.zoomFactor,this.isHangingIndent=i-Y.getNumberFromString(this.hangingIndent.style.left)<=i-Y.getNumberFromString(this.firstLineIndent.style.left)):"Continuous"===this.documentEditor.layoutType&&(this.position.paragraph.paragraphFormat.bidi?(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20-this.documentEditor.viewer.clientArea.width*this.documentEditor.zoomFactor,this.maxLimit2=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20+40-6,this.minLimit2=i+Y.convertPointToPixel(42)*this.documentEditor.zoomFactor,this.isHangingIndent=Y.getNumberFromString(this.hangingIndent.style.left)-i<=Y.getNumberFromString(this.firstLineIndent.style.left)-i):(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20,this.minLimit2=t-6,this.maxLimit2=i-Y.convertPointToPixel(42)*this.documentEditor.zoomFactor,this.isHangingIndent=i-Y.getNumberFromString(this.hangingIndent.style.left)<=i-Y.getNumberFromString(this.firstLineIndent.style.left))),t+e.clientX-this.leftLineOffset-this.hRuler.getBoundingClientRect().left),n=this.documentEditor.documentHelper.currentPage.boundingRectangle.x,n=("Continuous"===this.documentEditor.layoutType?0:n)+(i-t)+6,i=document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg");i.style.left=n+"px",i.style.display="block",e.stopPropagation()},tgi.prototype.onLeftIndentMouseMove=function(e){var t,i;this.isDraggingIndents3&&(i=t=void 0,this.documentEditor.selectionModule.paragraphFormat.bidi?("Pages"===this.documentEditor.layoutType?t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin-(this.documentEditor.selectionModule.sectionFormat.pageWidth-this.documentEditor.selectionModule.sectionFormat.leftMargin-this.documentEditor.selectionModule.sectionFormat.rightMargin))*this.documentEditor.zoomFactor:"Continuous"===this.documentEditor.layoutType&&(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20-this.documentEditor.viewer.clientArea.width*this.documentEditor.zoomFactor),i=t+e.clientX-this.leftLineOffset-this.hRuler.getBoundingClientRect().left,this.isHangingIndent?i+this.diff>this.maxLimit2&&(i=this.maxLimit2-this.diff):i>this.maxLimit2&&(i=this.maxLimit2),this.isHangingIndent?i<this.minLimit2&&(i=this.minLimit2):i+this.diff<this.minLimit2&&(i=this.minLimit2-this.diff)):("Pages"===this.documentEditor.layoutType?t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin)*this.documentEditor.zoomFactor:"Continuous"===this.documentEditor.layoutType&&(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20),i=t+e.clientX-this.leftLineOffset-this.hRuler.getBoundingClientRect().left,this.isHangingIndent?i>this.maxLimit2&&(i=this.maxLimit2):i+this.diff>this.maxLimit2&&(i=this.maxLimit2-this.diff),this.isHangingIndent?i+this.diff<this.minLimit2&&(i=this.minLimit2-this.diff):i<this.minLimit2&&(i=this.minLimit2)),this.hangingIndent.style.left=i+"px",this.leftIndent.style.left=i+"px",this.firstLineIndent.style.left=this.firstIndentInitialValue+(i-this.indentInitialValue)+"px",e=this.documentEditor.documentHelper.currentPage.boundingRectangle.x,e=(e="Continuous"===this.documentEditor.layoutType?0:e)+(i-t)+6,document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg").style.left=e+"px")},tgi.prototype.onLeftIndentMouseUp=function(e){var t;this.isDraggingIndents3&&(this.isDraggingIndents3=!1,t=Y.getNumberFromString(this.leftIndent.style.left),parseInt(this.leftIndent.style.left.replace("px",""),10)<0&&(t*=-1),this.documentEditor.selectionModule.paragraphFormat.bidi?this.documentEditor.editorModule.applyRulerMarkerValues("leftIndent",t,this.indentInitialValue):this.documentEditor.editorModule.applyRulerMarkerValues("leftIndent",this.indentInitialValue,t),this.indentInitialValue=t,document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg").style.display="none")},tgi.prototype.onRightIndentMouseDown=function(e){this.isDraggingIndents4=!0,this.rightLineOffset=e.clientX-this.rightIndent.getBoundingClientRect().left,this.indentInitialValue=Y.getNumberFromString(this.rightIndent.style.left);var t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin)*this.documentEditor.zoomFactor,i=(this.documentEditor.selectionModule.paragraphFormat.bidi&&(t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin-(this.documentEditor.selectionModule.sectionFormat.pageWidth-this.documentEditor.selectionModule.sectionFormat.leftMargin-this.documentEditor.selectionModule.sectionFormat.rightMargin))*this.documentEditor.zoomFactor),(t="Continuous"===this.documentEditor.layoutType&&(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20,this.documentEditor.selectionModule.paragraphFormat.bidi)?this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20-this.documentEditor.viewer.clientArea.width*this.documentEditor.zoomFactor:t)+e.clientX-this.rightLineOffset-this.hRuler.getBoundingClientRect().left),n=this.documentEditor.documentHelper.currentPage.boundingRectangle.x,n=("Continuous"===this.documentEditor.layoutType?0:n)+(i-t)+6,i=document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg");i.style.left=n+"px",i.style.display="block",e.stopPropagation()},tgi.prototype.onRightIndentMouseMove=function(e){var t,i,n,o,r,s,a,l;this.isDraggingIndents4&&(n=t=void 0,l=document.getElementById(this.documentEditor.element.id+"_leftIndent"),i=document.getElementById(this.documentEditor.element.id+"_firstLineIndent"),r=o=void 0,r=this.documentEditor.selectionModule.paragraphFormat.bidi?("Pages"===this.documentEditor.layoutType?t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin-(this.documentEditor.selectionModule.sectionFormat.pageWidth-this.documentEditor.selectionModule.sectionFormat.leftMargin-this.documentEditor.selectionModule.sectionFormat.rightMargin))*this.documentEditor.zoomFactor:"Continuous"===this.documentEditor.layoutType&&(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20-this.documentEditor.viewer.clientArea.width*this.documentEditor.zoomFactor),n=t+e.clientX-this.rightLineOffset-this.hRuler.getBoundingClientRect().left,s=Y.getNumberFromString(l.style.left)-n<=Y.getNumberFromString(i.style.left)-n?l:i,o=(a=Y.getNumberFromString(s.style.left))-Y.convertPointToPixel(42)*this.documentEditor.zoomFactor,t-6):("Pages"===this.documentEditor.layoutType?t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin)*this.documentEditor.zoomFactor:"Continuous"===this.documentEditor.layoutType&&(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20),s=(n=t+e.clientX-this.rightLineOffset-this.hRuler.getBoundingClientRect().left)-Y.getNumberFromString(l.style.left)<=n-Y.getNumberFromString(i.style.left)?l:i,a=Y.getNumberFromString(s.style.left),o=t+this.documentEditor.documentHelper.currentPage.boundingRectangle.width*this.documentEditor.zoomFactor-6,a+Y.convertPointToPixel(42)*this.documentEditor.zoomFactor),n<r?n=r:o<n&&(n=o),this.rightIndent.style.left=n+"px",e=this.documentEditor.documentHelper.currentPage.boundingRectangle.x,l=(e="Continuous"===this.documentEditor.layoutType?0:e)+(n-t)+6,document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg").style.left=l+"px")},tgi.prototype.onRightIndentMouseUp=function(e){var t;this.isDraggingIndents4&&(this.isDraggingIndents4=!1,t=Y.getNumberFromString(this.rightIndent.style.left),this.documentEditor.selectionModule.paragraphFormat.bidi?this.documentEditor.editorModule.applyRulerMarkerValues("rightIndent",this.indentInitialValue,t):this.documentEditor.editorModule.applyRulerMarkerValues("rightIndent",t,this.indentInitialValue),this.indentInitialValue=t,document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg").style.display="none")},tgi.prototype.onTabStopMouseDown=function(e){e.stopPropagation(),this.isDraggingForTab=!0,this.tabStopOffset=e.clientX-this.tabStopElement.getBoundingClientRect().left,this.tabInitialValue=Y.getNumberFromString(this.tabStopElement.style.left),this.tabIndex=parseInt(this.tabStopElement.id.split("_")[this.tabStopElement.id.split("_").length-1],10),this.currentTabStop=this.currrentParagraph.paragraphFormat.tabs[parseInt(this.tabIndex.toString(),10)],this.currentTabStopElement=this.tabStopElement;var t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin)*this.documentEditor.zoomFactor,e=(t="Continuous"===this.documentEditor.layoutType&&(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20,this.position.paragraph.paragraphFormat.bidi)?this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20-this.documentEditor.viewer.clientArea.width*this.documentEditor.zoomFactor:t)+e.clientX-this.tabStopOffset-this.hRuler.getBoundingClientRect().left,i=this.documentEditor.documentHelper.currentPage.boundingRectangle.x,i=("Continuous"===this.documentEditor.layoutType?0:i)+(e-t),e=document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg");e.style.left=i+"px",e.style.display="block"},tgi.prototype.onTabStopMouseUp=function(e){je(this.currentTabStopElement)||(this.currentTabStopElement=void 0)},tgi.prototype.onTabStopMouseMove=function(e){var t,i,n,o,r;this.isDraggingForTab&&(t=void 0,"Continuous"===this.documentEditor.layoutType?(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20,this.position.paragraph.paragraphFormat.bidi&&(t=this.documentEditor.hRuler.zeroPosition*this.documentEditor.zoomFactor-20-this.documentEditor.viewer.clientArea.width*this.documentEditor.zoomFactor)):"Pages"===this.documentEditor.layoutType&&(t=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin)*this.documentEditor.zoomFactor,this.position.paragraph.bidi)&&(t=Y.convertPointToPixel(1584+this.documentEditor.selectionModule.sectionFormat.rightMargin-this.documentEditor.selectionModule.sectionFormat.pageWidth)*this.documentEditor.zoomFactor),e=t+e.clientX-this.tabStopOffset-this.hRuler.getBoundingClientRect().left,n=t,o=document.getElementById(this.documentEditor.element.id+"_rightIndent"),i=o=Y.getNumberFromString(o.style.left),r=document.getElementById(this.documentEditor.element.id+"_leftIndent"),n=r=Y.getNumberFromString(r.style.left),this.position.paragraph.paragraphFormat.bidi&&(n=o,i=r),"CenterTab"===this.justification||"DecimalTab"===this.justification?i+=4:"RightTab"===this.justification?i+=5.5:i+=1.5,e<n?e=n:i<e&&(e=i),this.tabStopElement.style.left=e+"px",o=this.documentEditor.documentHelper.currentPage.boundingRectangle.x,r=(o="Continuous"===this.documentEditor.layoutType?0:o)+(e-t)+6,document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg").style.left=r+"px")},tgi.prototype.onRenderTabStopMouseUp=function(e){var t;this.isDraggingForTab&&!je(this.currentTabStop)&&(je(this.currentTabStopElement)||"none"!==this.currentTabStopElement.style.display?(t=Y.getNumberFromString(this.tabStopElement.style.left),this.tabInitialValue=t,this.documentEditor.editorModule.removeTabStops([this.currrentParagraph],[this.currentTabStop]),t=Y.convertPixelToPoint(t/this.documentEditor.zoomFactor)-1584,t=this.currrentParagraph.paragraphFormat.bidi?-1*t:t,this.currentTabStop.position=t,this.documentEditor.editorModule.updateTabStopCollection(this.currrentParagraph,[this.currentTabStop])):(this.documentEditor.editorModule.removeTabStops([this.currrentParagraph],[this.currentTabStop]),this.currentTabStopElement.parentNode.removeChild(this.currentTabStopElement)),this.updateTabStopMarkers(this.documentEditor),this.isDraggingForTab=!1,document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg").style.display="none",this.currentTabStopElement=void 0)},tgi.prototype.onTabStopDblClick=function(e){this.documentEditor.showTabDialog(),e.stopPropagation()},tgi.prototype.hideTabStopSwitch=function(e){this.tabStopStwitch&&this.showHideElement(e,this.tabStopStwitch)},tgi.prototype.hideRulerBottom=function(e){this.hRulerBottom&&this.showHideElement(e,this.hRulerBottom),this.vRulerBottom&&this.showHideElement(e,this.vRulerBottom)},tgi.prototype.showHideElement=function(e,t){t.style.display=e?"block":"none"},tgi.prototype.createHtmlElement=function(e,t){e=Q(e,t);return this.setAttributeHtml(e,t),e},tgi.prototype.createSvgElement=function(e,t){e=document.createElementNS("http://www.w3.org/2000/svg",e);return this.setAttributeSvg(e,t),e},tgi.prototype.applyStyleAgainstCsp=function(e,t){for(var i=t.split(";"),n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)].split(":");2===o.length&&(e.style[o[0].trim()]=o[1].trim())}},tgi.prototype.setAttributeSvg=function(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++)e&&"style"!==i[parseInt(n.toString(),10)]?e.setAttribute(i[parseInt(n.toString(),10)],t[i[parseInt(n.toString(),10)]]):this.applyStyleAgainstCsp(e,t[i[parseInt(n.toString(),10)]])},tgi.prototype.setAttributeHtml=function(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++)"style"!==i[parseInt(n.toString(),10)]?e.setAttribute(i[parseInt(n.toString(),10)],t[i[parseInt(n.toString(),10)]]):this.applyStyleAgainstCsp(e,t[i[parseInt(n.toString(),10)]])},tgi.prototype.renderOverlapElement=function(e){var t=this.getRulerSize(e),t={id:e.element.id+"_overlapRuler",style:"height:"+t.height+"px;width:"+t.width+"px;position:absolute;margin-left:0;margin-top:0;diplay:none",class:"e-ruler-overlap"},t=(this.overlap=this.createHtmlElement("div",t),document.getElementById(e.element.id+"_viewerContainer"));return t.insertBefore(this.overlap,t.firstChild),this.overlap},tgi.prototype.renderRulerMarkerIndicatorElement=function(e){if(e.enableSelection){var t=this.getRulerSize(e),i={id:e.element.id+"_markIndicator",style:"height:"+t.height+"px;width:"+t.width+"px;position:absolute;margin-left:0;margin-top:0;z-index:5;border:1px solid #ccc;display:"+("Pages"===e.layoutType?"block;":"none;"),class:"e-de-ruler-markIndicator"},i=(this.markIndicator=this.createHtmlElement("div",i),this.tabStopStwitch=this.markIndicator,document.getElementById(e.element.id+"_viewerContainer")),i=(i.insertBefore(this.markIndicator,i.firstChild),e.element.id),n=(this.firstLineIndentRuler=document.getElementById(i+"_firstLineIndent").cloneNode(!0),this.hangingIndentRuler=document.getElementById(i+"_hangingIndent").cloneNode(!0),this.firstLineIndentRuler.style.left="1px",this.firstLineIndentRuler.style.top=t.height/2-3+"px",this.firstLineIndentRuler.style.display="none",this.firstLineIndentRuler.classList.add("e-de-ruler-marker"),this.firstLineIndentRuler.setAttribute("id",i+"_firstLineIndent_-1"),this.hangingIndentRuler.style.left="1px",this.hangingIndentRuler.style.top=t.height/2-3+"px",this.hangingIndentRuler.style.display="none",this.hangingIndentRuler.classList.add("e-de-ruler-marker"),this.hangingIndentRuler.setAttribute("id",i+"_hangingIndent_-1"),this.markIndicator.appendChild(this.hangingIndentRuler),this.markIndicator.appendChild(this.firstLineIndentRuler),["Left","Center","Right","Decimal","Bar"]),o=new Cn("documenteditor",e.defaultLocale);o.setLocale(e.locale);for(var r=0;r<5;r++){this.renderTab(e,t,void 0,n[parseInt(r.toString(),10)],-1,o);var s=document.getElementById(e.element.id+"_"+n[parseInt(r.toString(),10)]+"Tab_-1");je(s)||(s.classList.remove("e-de-ruler-tab"),s.classList.add("e-de-ruler-marker"),s.style.display=0===r?"block":"none",s.style.position="absolute",s.style.margin="4px 3px",this.markIndicator.appendChild(s))}this.markIndicator.addEventListener("click",this.onmarkIndicatorClickHandler)}},tgi.prototype.renderRuler=function(e,t){var i,n,o;(this.documentEditor=e).enableSelection&&(this.rulerDiv=document.getElementById(e.element.id+(t?"_hRuler":"_vRuler")),i=this.getRulerSize(e),this.rulerGeometry=this.getRulerGeometry(e),n=t?e.selectionModule.end.paragraph.bodyWidget.page.boundingRectangle.x:e.selectionModule.getPageTop(e.selectionModule.end.paragraph.bodyWidget.page),n=t?"margin-left:"+n+"px;":"margin-top:"+n+"px;",e.selectionModule.isForward?this.position=e.selectionModule.start:this.position=e.selectionModule.end,this.rulerDiv||(n="height:"+(t?i:this.rulerGeometry).height+"px;overflow:hidden;width:"+(t?this.rulerGeometry:i).width+"px;position:absolute;font-size:9px;text-align: left;z-index: 4;user-select:none;"+n,n={id:e.element.id+(t?"_hRuler":"_vRuler"),style:n,class:t?"e-de-hRuler":"e-de-vRuler"},this.rulerDiv=this.createHtmlElement("div",n)),this.rulerDiv.addEventListener("dblclick",this.onRulerDblClickHandler),n=document.getElementById(e.element.id+"_pageContainer"),n="height:"+(t?i:n.getBoundingClientRect()).height+"px;overflow:hidden;width:"+(t?n.getBoundingClientRect():i).width+"px;position:absolute;z-index: 3;",n={id:e.element.id+(t?"_hRulerBottom":"_vRulerBottom"),style:n,class:t?"e-de-hRuler":"e-de-vRuler"},this.rulerOverlap=this.createHtmlElement("div",n),t?this.hRulerBottom=this.rulerOverlap:this.vRulerBottom=this.rulerOverlap,(n=document.getElementById(e.element.id+"_viewerContainer")).insertBefore(this.rulerOverlap,n.firstChild),(n=t?document.getElementById(e.element.id+"_hRulerBottom"):document.getElementById(e.element.id+"_vRulerBottom")).insertBefore(this.rulerDiv,n.firstChild),this.renderRulerMargins(e,t,this.rulerDiv),(n=new Zui(this.rulerDiv,this)).orientation=t?"Horizontal":"Vertical",this.updateMargin(n,e,t),n.length=2*n.zeroPosition,n.appendTo(),t?e.hRuler=n:e.vRuler=n,this.updateRulerPosition(e,t),o=document.getElementById(e.element.id+(t?"_hRuler":"_vRuler")),t?e.hRuler.element=o:e.vRuler.element=o,o&&(t?o.scrollLeft=n.zeroPosition-Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin):o.scrollTop=n.zeroPosition-Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.topMargin)),this.locale=new Cn("documenteditor",e.defaultLocale),t&&this.renderIndents(e,t,i,this.rulerGeometry,this.locale),this.hRuler=document.getElementById(e.element.id+"_hRuler"),t&&(document.addEventListener("mousemove",this.onHorizontalRulerMouseMoveHandler),this.hRuler.addEventListener("mouseenter",this.onHRulerMouseEnterHandler),this.hRuler.addEventListener("mouseleave",this.onHRulerMouseLeaveHandler),this.hRuler.addEventListener("mousedown",this.onHRulerMouseDownHandler),this.hRuler.addEventListener("mouseup",this.onHRulerMouseUpHandler),document.addEventListener("mouseup",this.onRulerMouseUpHandler)),this.vRuler=document.getElementById(e.element.id+"_vRuler"),this.isTopRulerMargin=!1,t||(document.addEventListener("mousemove",this.onVMouseMoveHandler),this.vRuler.addEventListener("mousedown",this.onVMouseDownHandler),document.addEventListener("mouseup",this.onVMouseUpHandler)))},tgi.prototype.onHorizontalRulerMouseMoved=function(e){if(!this.documentEditor.isDestroyed&&this.documentEditor.documentEditorSettings.showRuler){var t,i,n,o,r,s,a,l=this.hRuler.getBoundingClientRect(),h=this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin*this.documentEditor.zoomFactor,d=Y.convertPixelToPoint(l.width)-this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.rightMargin*this.documentEditor.zoomFactor,p=Math.round(e.clientX-l.left),c=Y.convertPixelToPoint(p);if(!this.isDraggingRender)if(this.documentEditor.isOnIndent)this.hRuler.style.cursor="default",this.hRuler.hasAttribute("title")&&this.hRuler.removeAttribute("title"),this.resizerEnabled=!1;else if(h-3<=c&&c<=3+h)"Pages"===this.documentEditor.layoutType&&(this.hRuler.style.cursor="e-resize",this.hRuler.setAttribute("title",this.locale.getConstant("Left Margin")),this.resizerEnabled=!0,this.isLeftRulerMargin=!0);else if(d-3<=c&&c<=3+d)"Pages"===this.documentEditor.layoutType&&(this.hRuler.style.cursor="e-resize",this.hRuler.setAttribute("title",this.locale.getConstant("Right Margin")),this.resizerEnabled=!0,this.isLeftRulerMargin=!1);else if(0<this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.columns.length){var u=this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.columns;if("Pages"===this.documentEditor.layoutType)for(var g=1;g<=u.length;g++){var m=document.getElementById(this.documentEditor.element.id+"_hRuler_Margin"+g),f=m.getBoundingClientRect().left,y=m.getBoundingClientRect().width;if(f-3<=e.clientX&&f+3>=e.clientX){this.hRuler.style.cursor="e-resize",this.multiColumnElement=m,this.hRuler.setAttribute("title",this.locale.getConstant("Left Margin")),this.isLeftMultiColumn=!0,this.resizerEnabled=!0;break}if(f+y-3<=e.clientX&&f+y+3>=e.clientX){this.hRuler.style.cursor="e-resize",this.multiColumnElement=m,this.hRuler.setAttribute("title",this.locale.getConstant("Right Margin")),this.isRightMultiColumn=!0,this.resizerEnabled=!0;break}this.hRuler.style.cursor="default",this.hRuler.hasAttribute("title")&&this.hRuler.removeAttribute("title"),this.isLeftMultiColumn=!1,this.isRightMultiColumn=!1,this.resizerEnabled=!1}}else this.hRuler.style.cursor="default",this.hRuler.hasAttribute("title")&&this.hRuler.removeAttribute("title"),this.resizerEnabled=!1;this.isDraggingRender&&(h=Y.convertPointToPixel(1584-this.documentEditor.selectionModule.sectionFormat.leftMargin)*this.documentEditor.zoomFactor,d=this.documentEditor.selectionModule.sectionFormat.pageWidth,i=this.documentEditor.selectionModule.sectionFormat.rightMargin,t=0<(t=this.documentEditor.selectionModule.paragraphFormat.rightIndent)?t:0,a=this.documentEditor.selectionModule.paragraphFormat.firstLineIndent,o=this.documentEditor.selectionModule.sectionFormat.leftMargin,a=0<=a?a:0,r=this.documentEditor.selectionModule.paragraphFormat.leftIndent,this.isLeftRulerMargin?(i=h+Y.convertPointToPixel(d-i-t-42-a-r)*this.documentEditor.zoomFactor)<p+(n=h)?c=Y.convertPixelToPoint(p=i-h):p+h<n&&(c=Y.convertPixelToPoint(p=n-h)):(i=h+Y.convertPointToPixel(o+r+a+42+t)*this.documentEditor.zoomFactor,(n=h+Y.convertPointToPixel(d)*this.documentEditor.zoomFactor)<p+h?c=Y.convertPixelToPoint(p=n-h):p+h<i&&(c=Y.convertPixelToPoint(p=i-h))),this.finalmouseXRelativeToDiv=c,o=Y.convertPixelToPoint(l.width)-this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.rightMargin*this.documentEditor.zoomFactor,this.documentEditor.selectionModule.end.paragraph.bodyWidget.sectionFormat.numberOfColumns<=1&&this.resizeRulerMargins(this.isLeftRulerMargin,this.renderInitialValue,this.currentScrollLeft,o,this.hRuler,c,!0,this.documentEditor),r=document.getElementById(this.documentEditor.element.id+"_rightIndent"),this.isLeftRulerMargin?(s=c-this.renderInitialValue,r.style.left=this.initialRightMargin-Y.convertPointToPixel(s)+"px"):(s=c-this.renderInitialValue,r.style.left=this.initialRightMargin+Y.convertPointToPixel(s)+"px"),a=this.documentEditor.documentHelper.currentPage.boundingRectangle.x+p,document.getElementById(this.documentEditor.element.id+"_hRuler_indicator_svg").style.left=a+"px")}},tgi.prototype.updateRulerPosition=function(e,t){var i=document.getElementById(e.element.id+(t?"_hRuler":"_vRuler"));t?e.hRuler.element=i:e.vRuler.element=i,i&&(i.scrollLeft=2112-Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin))},tgi.prototype.updateIndicatorLines=function(e){var t=document.getElementById(e.element.id+"_hRuler_indicator_svg"),i=document.getElementById(e.element.id+"_hRuler_indicator"),n=document.getElementById(e.element.id+"_vRuler_indicator_svg"),o=document.getElementById(e.element.id+"_vRuler_indicator"),e=document.getElementById(e.element.id+"_pageContainer").getBoundingClientRect(),r=e.height,e=e.width;t.style.height=r+"px",i.setAttribute("y2",""+r),n.style.width=e+"px",o.setAttribute("x2",""+e)},tgi.prototype.createIndicatorLines=function(e){var t,i,n,o;e.enableSelection&&(t=document.getElementById(e.element.id+"_viewerContainer"),i=document.getElementById(e.element.id+"_pageContainer"),t.getBoundingClientRect(),n=(i=i.getBoundingClientRect()).height,i=i.width,this.hRuler=document.getElementById(e.element.id+"_hRuler"),o={id:e.element.id+"_hRuler_indicator_svg",width:"0.5px",height:n+"px",style:"position:absolute;z-index:1;display:none;"},this.hSvg=this.createSvgElement("svg",o),o={x1:0,y1:this.hRuler.getBoundingClientRect().height+5,x2:0,y2:n,"stroke-width":.5,stroke:"black"},this.vLine=this.createSvgElement("line",o),this.vLine.setAttribute("id",e.element.id+"_hRuler_indicator"),this.hSvg.appendChild(this.vLine),t.insertBefore(this.hSvg,t.firstChild),n=document.getElementById(e.element.id+"_vRuler"),o={id:e.element.id+"_vRuler_indicator_svg",width:i+"px",height:"0.5px",style:"position:absolute;z-index:1;display:none;"},this.vSvg=this.createSvgElement("svg",o),o={x1:n.getBoundingClientRect().width+5,y1:0,x2:i,y2:0,"stroke-width":.5,stroke:"black"},this.hLine=this.createSvgElement("line",o),this.hLine.setAttribute("id",e.element.id+"_vRuler_indicator"),this.vSvg.appendChild(this.hLine),t.insertBefore(this.vSvg,t.firstChild))},tgi.prototype.updateIndentMarkers=function(e){var t,i,n,o,r,s,a;je(e)||je(e.element)||je(e.element.id)||je(e.hRuler)||je(e.hRuler.zeroPosition)||(a=void 0,t=e.element.id,i=Y.convertPointToPixel(1584-e.selectionModule.sectionFormat.leftMargin),n=this.getRulerGeometry(e),(this.position.paragraph.paragraphFormat.bidi||this.position.paragraph.isInsideTable&&this.position.paragraph.associatedCell.ownerTable.tableFormat.bidi)&&(i-=n.width/e.zoomFactor-Y.convertPointToPixel(this.position.paragraph.bodyWidget.sectionFormat.rightMargin+this.position.paragraph.bodyWidget.sectionFormat.leftMargin)),n=je(this.position.paragraph.absoluteXPosition)?this.position.paragraph.x:parseFloat(this.position.paragraph.absoluteXPosition.x.toString()),o=je(this.position.paragraph.absoluteXPosition)?this.position.paragraph.width:parseFloat(this.position.paragraph.absoluteXPosition.width.toString()),this.position.paragraph.paragraphFormat.bidi&&(i=Y.convertPointToPixel(1584-e.selectionModule.sectionFormat.leftMargin-(e.selectionModule.sectionFormat.pageWidth-e.selectionModule.sectionFormat.leftMargin-e.selectionModule.sectionFormat.rightMargin))),r=document.getElementById(e.element.id+"_leftIndent"),s=document.getElementById(e.element.id+"_rightIndent"),r=this.position.paragraph.paragraphFormat.bidi?(r.setAttribute("title",this.locale.getConstant("Right Indent")),s.setAttribute("title",this.locale.getConstant("Left Indent")),i+n+o):(r.setAttribute("title",this.locale.getConstant("Left Indent")),s.setAttribute("title",this.locale.getConstant("Right Indent")),i+n),s=this.position.paragraph.paragraphFormat.firstLineIndent,je(a=document.getElementById(t+"_leftIndent"))||("Pages"===e.layoutType?a.style.left=r*e.zoomFactor-6+"px":"Continuous"===e.layoutType&&(this.position.paragraph.paragraphFormat.bidi?(i=e.hRuler.zeroPosition*e.zoomFactor-20-e.viewer.clientArea.width,a.style.left=(r=i+n+o)+"px"):(r=(i=e.hRuler.zeroPosition*e.zoomFactor-20)+n*e.zoomFactor,a.style.left=r+"px"))),je(a=document.getElementById(t+"_hangingIndent"))||("Pages"===e.layoutType?a.style.left=r*e.zoomFactor-6+"px":"Continuous"===e.layoutType&&(this.position.paragraph.paragraphFormat.bidi?(i=e.hRuler.zeroPosition*e.zoomFactor-20-e.viewer.clientArea.width,a.style.left=(r=i+n+o)+"px"):(r=(i=e.hRuler.zeroPosition*e.zoomFactor-20)+n*e.zoomFactor,a.style.left=r+"px"))),a=document.getElementById(t+"_firstLineIndent"),"Pages"===e.layoutType?je(a)||(this.position.paragraph.paragraphFormat.bidi?a.style.left=(r-Y.convertPointToPixel(s))*e.zoomFactor-6+"px":a.style.left=(r+Y.convertPointToPixel(s))*e.zoomFactor-6+"px"):"Continuous"===e.layoutType&&(r=this.position.paragraph.paragraphFormat.bidi?(i=e.hRuler.zeroPosition*e.zoomFactor-20-e.viewer.clientArea.width)+n+o-Y.convertPointToPixel(s)*e.zoomFactor:(i=e.hRuler.zeroPosition*e.zoomFactor-20)+(n+Y.convertPointToPixel(s))*e.zoomFactor,a.style.left=r+"px"),a=document.getElementById(t+"_rightIndent"),"Pages"===e.layoutType?(r=this.position.paragraph.paragraphFormat.bidi?i+n:i+n+o,je(a)||(a.style.left=r*e.zoomFactor-6+"px")):"Continuous"===e.layoutType&&(this.position.paragraph.paragraphFormat.bidi?(i=e.hRuler.zeroPosition*e.zoomFactor-20-e.viewer.clientArea.width*e.zoomFactor,a.style.left=(r=i+n)+"px"):(r=(i=e.hRuler.zeroPosition*e.zoomFactor-20)+(n+o)*e.zoomFactor,a.style.left=r+"px")))},tgi.prototype.updateTabStopMarkers=function(e){if(!(je(e)||je(e.element)||je(e.element.id)||je(e.hRuler)||je(e.hRuler.zeroPosition))){var t=new Cn("documenteditor",e.defaultLocale),i=(t.setLocale(e.locale),e.element.id);this.markIndicator=document.getElementById(i+"_markIndicator"),this.markIndicator.style.display="Pages"===e.layoutType?"block":"none";for(var n=this.position.paragraph.paragraphFormat.tabs,o=e.zoomFactor,r=this.getRulerSize(e),s=Y.convertNodeListToArray(document.querySelectorAll(".e-de-ruler-tab")),a=0;a<n.length;a++){var l=n[parseInt(a.toString(),10)],h=l.tabJustification,d=e.element.id+"_"+h+"Tab_"+a.toString(),d=document.getElementById(d);je(d)?"List"===h||je(h)||this.renderTab(e,r,l,h,a,t):(!je(s)&&0<s.length&&s.splice(s.indexOf(d),1),l=this.position.paragraph.paragraphFormat.bidi?Y.convertPointToPixel(1584-l.position):Y.convertPointToPixel(1584+l.position),d.style.left="Center"===h||"Decimal"===h?l*o-4+"px":"Right"===h?l*o-5.5+"px":l*o-1.5+"px")}if(!je(s))for(a=0;a<s.length;a++){var p=s[parseInt(a.toString(),10)];je(p)||p.parentNode.removeChild(p)}}},tgi.prototype.renderRulerMargins=function(e,t,i){var n=this.getRulerSize(e),o=this.getRulerGeometry(e),r=(t?e.selectionModule.end.paragraph.bodyWidget.page.boundingRectangle.x:(e.selectionModule.end.paragraph.bodyWidget.page.boundingRectangle.y,n.height),2112*e.zoomFactor),s=t?"margin-left:"+r+"px;":"margin-top:"+r+"px;",a=t?n.height:o.height-Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.topMargin+e.selectionModule.end.paragraph.bodyWidget.sectionFormat.bottomMargin)*e.zoomFactor;if(t)for(var l,h,d=1;d<=13;d++)this.rulerMarginDiv=document.getElementById(e.element.id+"_hRuler_Margin"+d),this.rulerMarginDiv||(l="height:"+a+"px;overflow:hidden;width:"+(o.width-Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.rightMargin+e.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin)*e.zoomFactor)+"px;position:absolute;font-size:9px;text-align: left;z-index: -1;display: block"+s,h={id:e.element.id+"_hRuler_Margin"+d,style:l,class:"e-de-ruler-margin"},this.rulerMarginDiv=this.createHtmlElement("div",h)),i.appendChild(this.rulerMarginDiv);else this.verticalRulerMarginDiv||(this.verticalRulerMarginDiv=document.getElementById(e.element.id+"_vRuler_Margin"),l="height:"+a+"px;overflow:hidden;width:"+n.width+"px;position:absolute;font-size:9px;text-align: left;z-index: -1;"+s,h={id:e.element.id+"_vRuler_Margin",style:l,class:"e-de-ruler-margin"},this.verticalRulerMarginDiv=this.createHtmlElement("div",h)),i.appendChild(this.verticalRulerMarginDiv)},tgi.prototype.updateRulerMargins=function(e){var t=this.getRulerGeometry(e),i=e.hRuler.zeroPosition*e.zoomFactor,n=(this.updateHorizontalRulerMargin(e),document.getElementById(e.element.id+"_vRuler_Margin")),t=t.height-Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.bottomMargin*e.zoomFactor+e.selectionModule.end.paragraph.bodyWidget.sectionFormat.topMargin*e.zoomFactor);n.style.marginTop=i+"px",n.style.height=t+"px"},tgi.prototype.updateHorizontalRulerMargin=function(e){var t=e.selectionModule.end.paragraph.bodyWidget.sectionFormat.columns,i=e.hRuler.zeroPosition*e.zoomFactor,n=!1,o=this.position.paragraph.paragraphFormat.bidi,r=!1,s=Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin-72),a=Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.rightMargin-72),l=(this.position.paragraph.isInsideTable&&(r=this.position.paragraph.associatedCell.ownerTable.tableFormat.bidi),this.getRulerGeometry(e).width-Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.rightMargin*e.zoomFactor+e.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin*e.zoomFactor));(o||r)&&(i=e.hRuler.zeroPosition*e.zoomFactor-l);for(var h=0;h<13;h++){var d,p=document.getElementById(e.element.id+"_hRuler_Margin"+(h+1));p&&(0===t.length&&!n||"Continuous"===e.layoutType&&!n?(o||r?(d=e.hRuler.zeroPosition*e.zoomFactor-l,p.style.marginLeft=d+"px"):p.style.marginLeft=i+"px",p.style.display="block","Continuous"===e.layoutType?(d=je(this.position.paragraph.absoluteXPosition)?this.position.paragraph.width:parseFloat(this.position.paragraph.absoluteXPosition.width.toString()),p.style.width=d*e.zoomFactor+"px"):p.style.width=l+"px",n=!0):t.length>=h+1&&"Pages"===e.layoutType?(i=(p.style.marginLeft=i+"px",(i-=(s+a)/t.length*e.zoomFactor)+(t[parseInt(h.toString(),10)].width+t[parseInt(h.toString(),10)].space)*e.zoomFactor),p.style.display="block",p.style.width=(t[parseInt(h.toString(),10)].width-(s+a)/t.length)*e.zoomFactor+"px"):p.style.display="none")}},tgi.prototype.resizeVRulerMargins=function(e,t,i,n,o,r,s){var a=document.getElementById(s.element.id+"_vRuler_Margin"),l=this.getRulerGeometry(s);e?(a.style.height=(l.height-Y.convertPointToPixel(s.selectionModule.end.paragraph.bodyWidget.sectionFormat.bottomMargin*s.zoomFactor+r)).toString()+"px",o.scrollTop=t<r?i-Y.convertPointToPixel(r-t):i+Y.convertPointToPixel(t-r)):(e=Y.convertPixelToPoint(l.height)-r,a.style.height=(l.height-Y.convertPointToPixel(s.selectionModule.end.paragraph.bodyWidget.sectionFormat.topMargin*s.zoomFactor+e)).toString()+"px")},tgi.prototype.resizeRulerMargins=function(e,t,i,n,o,r,s,a){var s=document.getElementById(a.element.id+(s?"_hRuler_Margin1":"_vRuler_Margin")),l=this.getRulerGeometry(a);!je(e)&&e?(s.style.width=(l.width-Y.convertPointToPixel(a.selectionModule.end.paragraph.bodyWidget.sectionFormat.rightMargin*a.zoomFactor+r)).toString()+"px",o.scrollLeft=t<r?i-Y.convertPointToPixel(r-t):i+Y.convertPointToPixel(t-r)):(e=Y.convertPixelToPoint(l.width)-r,s.style.width=(l.width-Y.convertPointToPixel(a.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin*a.zoomFactor+e)).toString()+"px")},tgi.prototype.getRulerOrigin=function(){Y.convertPointToPixel(1584)},tgi.prototype.renderIndents=function(e,t,i,n,o){var r,s,a,l;this.hRuler=document.getElementById(e.element.id+"_hRuler"),this.firstLineIndent=document.getElementById(e.element.id+"_firstLineIndent"),this.firstLineIndent||(r="left:"+(Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin)-6)*e.zoomFactor+"px;",s="height:"+(i.height-3)/2+"px;overflow:hidden;width:12px;position:absolute;font-size:11px;text-align: left;z-index: 5;"+r,a={id:e.element.id+"_firstLineIndent",style:s,"data-name":"FirstLineIndent",class:"e-de-ruler-indent"},this.firstLineIndent=this.createHtmlElement("div",a),this.firstLineIndent.setAttribute("title",o.getConstant("First Line Indent")),l={id:e.element.id+"_firstLineIndent_svg",width:i.width+"px",height:(i.height-3)/2+"px",style:"position:inherit;left:0px"},this.firstLineIndentSvg=this.createSvgElement("svg",l),this.firstLineIndentSvg.setAttribute("fill","none"),this.firstLineIndentPath=this.createSvgElement("path",{style:"position:inherit;left:0px"}),this.firstLineIndentPath.setAttribute("class","e-de-ruler-indent-svg"),this.firstLineIndentPath.setAttribute("d","M 0.5 0.5 H 11.5 V 2.7128 L 6 5.4211 L 0.5 2.7128 V 0.5 Z"),this.firstLineIndentPath.setAttribute("fill","white"),this.firstLineIndentPath.setAttribute("stroke","#A1A1A1"),this.firstLineIndentSvg.appendChild(this.firstLineIndentPath),this.firstLineIndent.appendChild(this.firstLineIndentSvg),this.hRuler.append(this.firstLineIndent),this.firstLineIndent.addEventListener("dblclick",this.onDoubleClickHandler),this.isDraggingIndents1=!1,this.indentInitialValue=Y.getNumberFromString(this.firstLineIndent.style.left),Y.getNumberFromString(this.firstLineIndent.style.left),this.firstLineIndent.addEventListener("mouseenter",this.onDocumentIntentTrueChangeHandler),this.firstLineIndent.addEventListener("mouseleave",this.onDocumentIntentFalseChangeHandler),this.firstLineIndent.addEventListener("mousedown",this.onFirstLineIndentMouseDownHandler),document.addEventListener("mousemove",this.onIndentMouseMoveHandler),document.addEventListener("mouseup",this.onIndentMouseUpHandler)),this.hangingIndent=document.getElementById(e.element.id+"_hangingIndent"),this.hangingIndent||(r="left:"+(Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin)-6)+"px;",s="height:"+i.height/2+"px;top:"+((i.height-3)/2+1)+"px;overflow:hidden;width:12px;position:absolute;font-size:11px;text-align: left;z-index: 5;"+r,a={id:e.element.id+"_hangingIndent",style:s,"data-name":"HangingIndent",class:"e-de-ruler-indent"},this.hangingIndent=this.createHtmlElement("div",a),this.hangingIndent.setAttribute("title",o.getConstant("Hanging Indent")),l={id:e.element.id+"_hangingIndent_svg",width:i.width+"px",height:(i.height-3)/2+"px",style:"position:inherit;left:0px"},this.hangingIndentSvg=this.createSvgElement("svg",l),this.hangingIndentSvg.setAttribute("fill","none"),this.hangingIndentPath=this.createSvgElement("path",{style:"position:inherit;left:0px"}),this.hangingIndentPath.setAttribute("class","e-de-ruler-indent-svg"),this.hangingIndentPath.setAttribute("d","M 0.5 5.3211 H 11.5 V 3.1083 L 6 0.4 L 0.5 3.1083 V 5.3211 Z"),this.hangingIndentPath.setAttribute("fill","white"),this.hangingIndentPath.setAttribute("stroke","#A1A1A1"),this.hangingIndentSvg.appendChild(this.hangingIndentPath),this.hangingIndent.appendChild(this.hangingIndentSvg),this.hRuler.append(this.hangingIndent),this.hangingIndent.addEventListener("dblclick",this.onDoubleClickHandler),this.hangingIndentInitialValue=Y.getNumberFromString(this.hangingIndent.style.left),Y.getNumberFromString(this.hangingIndent.style.left),this.hangingIndent.addEventListener("mouseenter",this.onDocumentIntentTrueChangeHandler),this.hangingIndent.addEventListener("mouseleave",this.onDocumentIntentFalseChangeHandler),this.hangingIndent.addEventListener("mousedown",this.onHangIndentMouseDownHandler),document.addEventListener("mousemove",this.onHangIndentMouseMoveHandler),document.addEventListener("mouseup",this.onHangIndentMouseUpHandler)),this.leftIndent=document.getElementById(e.element.id+"_leftIndent"),this.leftIndent||(s="height:4px;top:11px;overflow:hidden;width:12px;position:absolute;font-size:11px;text-align: left;z-index: 5;"+(r="left:"+(Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin)-6)+"px;"),a={id:e.element.id+"_leftIndent",style:s,class:"e-de-ruler-indent"},this.leftIndent=this.createHtmlElement("div",a),this.leftIndent.setAttribute("title",o.getConstant("Left Indent")),l={id:e.element.id+"_leftIndent_svg",width:i.width+"px",height:"4px",style:"position:inherit;left:0px"},this.leftIndentSvg=this.createSvgElement("svg",l),this.leftIndentSvg.setAttribute("fill","none"),this.leftIndentPath=this.createSvgElement("path",{style:"position:inherit;left:0px"}),this.leftIndentPath.setAttribute("class","e-de-ruler-indent-svg"),this.leftIndentPath.setAttribute("d","M 0.5 3.5 H 11.5 V 0.5 H 0.5 V 3.5 Z"),this.leftIndentPath.setAttribute("fill","white"),this.leftIndentPath.setAttribute("stroke","#A1A1A1"),this.leftIndentSvg.appendChild(this.leftIndentPath),this.leftIndent.appendChild(this.leftIndentSvg),this.hRuler.append(this.leftIndent),this.leftIndent.addEventListener("dblclick",this.onDoubleClickHandler),this.indentInitialValue=Y.getNumberFromString(this.leftIndent.style.left),Y.getNumberFromString(this.leftIndent.style.left),this.leftIndent.addEventListener("mouseenter",this.onDocumentIntentTrueChangeHandler),this.leftIndent.addEventListener("mouseleave",this.onDocumentIntentFalseChangeHandler),this.leftIndent.addEventListener("mousedown",this.onLeftIndentMouseDownHandler),document.addEventListener("mousemove",this.onLeftIndentMouseMoveHandler),document.addEventListener("mouseup",this.onLeftIndentMouseUpHandler)),this.rightIndent=document.getElementById(e.element.id+"_rightIndent"),this.rightIndent||(s="height:7px;top:8px;overflow:hidden;width:12px;position:absolute;font-size:11px;text-align: left;z-index: 4;"+(r="left:"+(e.selectionModule.end.paragraph.bodyWidget.page.boundingRectangle.width-Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.rightMargin)-6)+"px;"),a={id:e.element.id+"_rightIndent",style:s,class:"e-de-ruler-indent"},this.rightIndent=this.createHtmlElement("div",a),this.rightIndent.setAttribute("title",o.getConstant("Right Indent")),l={id:e.element.id+"_rightIndent_svg",width:i.width+"px",height:"7px",style:"position:inherit;left:0px"},this.rightIndentSvg=this.createSvgElement("svg",l),this.rightIndentSvg.setAttribute("fill","none"),this.rightIndentPath=this.createSvgElement("path",{style:"position:inherit;left:0px"}),this.rightIndentPath.setAttribute("class","e-de-ruler-indent-svg"),this.rightIndentPath.setAttribute("d","M 0.5 6.5 H 11.5 V 4.2872 L 6 1.5789 L 0.5 4.2872 V 6.5 Z"),this.rightIndentPath.setAttribute("fill","white"),this.rightIndentPath.setAttribute("stroke","#A1A1A1"),this.rightIndentSvg.appendChild(this.rightIndentPath),this.rightIndent.appendChild(this.rightIndentSvg),this.hRuler.append(this.rightIndent),this.rightIndent.addEventListener("dblclick",this.onDoubleClickHandler),this.indentInitialValue=Y.getNumberFromString(this.rightIndent.style.left),Y.getNumberFromString(this.rightIndent.style.left),this.rightIndent.addEventListener("mouseenter",this.onDocumentIntentTrueChangeHandler),this.rightIndent.addEventListener("mouseleave",this.onDocumentIntentFalseChangeHandler),this.rightIndent.addEventListener("mousedown",this.onRightIndentMouseDownHandler),document.addEventListener("mousemove",this.onRightIndentMouseMoveHandler),document.addEventListener("mouseup",this.onRightIndentMouseUpHandler)),this.updateIndentMarkers(e)},tgi.prototype.updateRuler=function(e,t){e.isDestroyed||e.rulerHelper&&e.documentEditorSettings&&!e.documentEditorSettings.showRuler||e.isReadOnlyMode||je(e.hRuler)&&je(e.vRuler)||(e.selectionModule.isForward?this.position=e.selectionModule.start:this.position=e.selectionModule.end,this.updateRulerDimension(e,e.hRuler,0,t),this.updateRulerDimension(e,e.vRuler,0,t),this.updateRulerMargins(e),this.updateIndentMarkers(e),this.updateTabStopMarkers(e),this.position.paragraph.isInsideTable?this.updateTableMarkers(e,e.hRuler):this.removeTableMarkers(e,e.hRuler),this.updateIndicatorLines(e))},tgi.prototype.removeTableMarkers=function(e,t){var i=Y.convertNodeListToArray(document.querySelectorAll(".e-de-ruler-table-marker"));if(!je(i))for(var n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)];je(o)||o.parentNode.removeChild(o)}},tgi.prototype.updateTableMarkers=function(e,t){(je(Y.convertNodeListToArray(document.querySelectorAll(".e-de-ruler-table-marker")))||this.position.paragraph.isInsideTable)&&this.renderTableMarkers(e,t)},tgi.prototype.renderTableMarkers=function(s,i){for(var n,a=this,l=(this.removeTableMarkers(s,s.hRuler),this.position.paragraph.containerWidget.ownerTable,this.position.paragraph.associatedCell.ownerRow.clone().childWidgets),h=this.position.paragraph.associatedCell.ownerTable.tableFormat.bidi?l.length:0,d=(this.position.paragraph.associatedCell.ownerTable.tableFormat.bidi&&l.reverse(),this.hRuler=document.getElementById(s.element.id+"_hRuler"),this),e=0;e<=l.length;e++)!function(e){var o,r=document.getElementById(s.element.id+"_tableMarker_"+h),t=void 0,t=0===e?"left:"+((n=(l[parseInt(e.toString(),10)].x-l[parseInt(e.toString(),10)].margin.left)*s.zoomFactor+d.hRuler.scrollLeft)-4)+"px;":"left:"+((n+=(l[e-1].width+l[e-1].margin.left+l[e-1].margin.right)*s.zoomFactor)-4)+"px;",t="height:"+i.thickness+"px;overflow:hidden;width:10px;position:absolute;font-size:11px;text-align: left;z-index: 4;"+t,t={id:s.element.id+"_tableMarker_"+h,class:"e-de-ruler-table-marker",style:t},r=d.createHtmlElement("div",t),t=new Cn("documenteditor",s.defaultLocale),t=(r.setAttribute("title",t.getConstant("Move Table Column")),{id:s.element.id+"_tableMarker_svg"+e,width:"9px",height:"11px",style:"position:inherit;left:0px;top:3px;"}),e=d.createSvgElement("svg",t),t=(e.setAttribute("fill","none"),d.createSvgElement("path",{style:"position:inherit;left:0px;"}));t.setAttribute("class","e-de-ruler-table-svg"),t.setAttribute("d","M1 1V0H2V1H3V0H4V1H5V0H6V1H7V2H6V3H7V4H6V5H7V6H6V7H7V8H0V7H1V6H0V5H1V4H0V3H1V2H0V1H1ZM2 2V3H3V2H2ZM4 2V3H5V2H4ZM5 4H4V5H5V4ZM5 6H4V7H5V6ZM3 7V6H2V7H3ZM2 5H3V4H2V5Z"),t.setAttribute("fill","#A1A1A1"),e.appendChild(t),r.appendChild(e),d.hRuler.append(r),d.position.paragraph.associatedCell.ownerTable.tableFormat.bidi?h--:h++,r.addEventListener("dblclick",function(e){s.showDialog("TableProperties"),e.stopPropagation()}),r.addEventListener("mousedown",function(e){o=e.clientX-r.getBoundingClientRect().left,s.startXPosition=Y.convertPixelToPoint(e.clientX),s.isTableMarkerDragging=!0;var t=new kri(e.clientX,e.clientY),t=s.viewer.findFocusedPage(t,!0,!0),i=(e.currentTarget instanceof HTMLElement&&(n=(n=e.currentTarget.id.split("_"))[n.length-1],n=parseInt(n,10)),s.selectionModule.end.paragraph.containerWidget.ownerTable),i=(s.editorModule.tableResize.currentResizingTable=i,s.editorModule.tableResize.resizeNode=0,s.editorModule.tableResize.resizerPosition=n,s.editorModule.tableResize.startingPoint.x=t.x,s.editorModule.tableResize.startingPoint.y=t.y,s.editorHistoryModule.initResizingHistory(t,s.editorModule.tableResize),Y.convertPointToPixel(1584-s.selectionModule.sectionFormat.leftMargin)*s.zoomFactor),n=i+e.clientX-o-a.hRuler.getBoundingClientRect().left,t=s.documentHelper.currentPage.boundingRectangle.x+(n-i)+6,e=document.getElementById(s.element.id+"_hRuler_indicator_svg");e.style.left=t-6+"px",e.style.display="block"}),document.addEventListener("mousemove",function(e){var t;!s.isDestroyed&&s.documentEditorSettings.showRuler&&s.isTableMarkerDragging&&(a.hRuler=document.getElementById(s.element.id+"_hRuler"),t=Y.convertPointToPixel(1584-s.selectionModule.sectionFormat.leftMargin)*s.zoomFactor,s.selectionModule.end.paragraph.associatedCell.ownerTable.tableFormat.bidi&&(t-=a.getRulerGeometry(s).width-Y.convertPointToPixel(s.selectionModule.end.paragraph.bodyWidget.sectionFormat.rightMargin*s.zoomFactor+s.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin*s.zoomFactor)),e=t+e.clientX-o-a.hRuler.getBoundingClientRect().left,r.style.left=e+"px",e=s.documentHelper.currentPage.boundingRectangle.x+(e-t)+6,document.getElementById(s.element.id+"_hRuler_indicator_svg").style.left=e-6+"px")}),document.addEventListener("mouseup",function(e){var t;!s.isDestroyed&&s.documentEditorSettings.showRuler&&s.isTableMarkerDragging&&(t=new kri(e.clientX,e.clientY),e=a.position.paragraph.associatedCell.ownerTable.tableFormat.bidi?s.startXPosition-Y.convertPixelToPoint(e.clientX):Y.convertPixelToPoint(e.clientX)-s.startXPosition,s.editorModule.tableResize.handleResizing(t,!0,e/s.zoomFactor),s.editorModule.tableResize.updateResizingHistory(s.viewer.findFocusedPage(t,!0,!0)),s.isTableMarkerDragging=!1,document.getElementById(s.element.id+"_hRuler_indicator_svg").style.display="none")})}(e)},tgi.prototype.updateRulerDimension=function(e,t,i,n){var o,r,s="Horizontal"===t.orientation,a=(this.getRulerSize(e),this.getRulerGeometry(e)),l=(this.updateRulerDiv(e,a,s,t),this.updateRulerSpace(e,a,s,t),this.updateMargin(t,e,s),t.length=e.zoomFactor<1?2*t.zeroPosition/e.zoomFactor:2*t.zeroPosition*e.zoomFactor,t.element);s?l.style.marginLeft=("Pages"===e.layoutType?e.selectionModule.end.paragraph.bodyWidget.page.boundingRectangle.x:0)+"px":(l.parentElement.style.display="Pages"===e.layoutType?"block":"none",l.style.marginTop=e.selectionModule.getPageTop(e.selectionModule.end.paragraph.bodyWidget.page)+"px"),n&&(t.offset=i,t.scale=e.zoomFactor,t.length=e.zoomFactor<1?2*t.zeroPosition/e.zoomFactor:2*t.zeroPosition*e.zoomFactor,t.updateRuler()),s?"Pages"===e.layoutType?(o=this.position.paragraph.paragraphFormat.bidi,r=!1,this.position.paragraph.isInsideTable&&(r=this.position.paragraph.associatedCell.ownerTable.tableFormat.bidi),o||r?(n=a.width-Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.rightMargin*e.zoomFactor),l.scrollLeft=e.hRuler.zeroPosition*e.zoomFactor-n):l.scrollLeft=(t.zeroPosition-Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin))*e.zoomFactor):(o=this.position.paragraph.paragraphFormat.bidi,r=!1,this.position.paragraph.isInsideTable&&(r=this.position.paragraph.associatedCell.ownerTable.tableFormat.bidi),l.scrollLeft=o||r?(t.zeroPosition-e.viewer.clientActiveArea.width)*e.zoomFactor-20:t.zeroPosition*e.zoomFactor-20):l.scrollTop=(t.zeroPosition-Y.convertPointToPixel(e.selectionModule.end.paragraph.bodyWidget.sectionFormat.topMargin))*e.zoomFactor},tgi.prototype.updateRulerSpace=function(e,t,i,n){this.rulerSpaceDiv=document.getElementById(e.element.id+(i?"_hRuler_ruler_space":"_vRuler_ruler_space")),this.rulerSpaceDiv&&e&&t&&(this.rulerSpaceDiv.style.width=(i?t.width+2*n.segmentWidth:n.thickness)+"px",this.rulerSpaceDiv.style.height=(i?n.thickness:t.height+2*n.segmentWidth)+"px")},tgi.prototype.updateRulerDiv=function(e,t,i,n){this.parentRulerDiv=document.getElementById(e.element.id+(i?"_hRuler":"_vRuler")),this.parentRulerDiv&&e&&t&&(this.parentRulerDiv.style.width=(i?"Continuous"===e.layoutType?t.width/e.zoomFactor:t.width:n.thickness)+"px",this.parentRulerDiv.style.height=(i?n.thickness:t.height)+"px",this.parentRulerDiv=document.getElementById(e.element.id+"_overlapRuler"),this.parentRulerDiv)&&(i?this.parentRulerDiv.style.height:this.parentRulerDiv.style.width,n.thickness),i&&this.hRulerBottom&&(t=document.getElementById(e.element.id+"_pageContainer"),this.hRulerBottom.style.width=t.getBoundingClientRect().width+"px")},tgi.prototype.getRulerGeometry=function(e){this.getRulerSize(e);var t=e.selectionModule.end.paragraph.bodyWidget.page.boundingRectangle.height*e.zoomFactor,e=e.selectionModule.end.paragraph.bodyWidget.page.boundingRectangle.width*e.zoomFactor;return new Kui(e,t)},tgi.prototype.getVerticalHeight=function(e){var t=Y.convertPixelToPoint(e.selectionModule.end.paragraph.bodyWidget.page.boundingRectangle.height),i=e.element.getBoundingClientRect().height;return t<i?t:i-e.documentHelper.pages[0].boundingRectangle.y},tgi.prototype.renderTab=function(e,t,i,n,o,r){this.hRuler=document.getElementById(e.element.id+"_hRuler");var s,a,l,h,d,p=e.documentHelper.zoomFactor;switch(n){case"Left":this.leftTab=document.getElementById(e.element.id+"_LeftTab_"+o),this.leftTab||(s="",je(i)||(s="height:9px;overflow:hidden;top:7px;width:12px;position:absolute;font-size:11px;text-align: left;z-index: 4;"+("left:"+((this.position.paragraph.paragraphFormat.bidi?Y.convertPointToPixel(1584-i.position):Y.convertPointToPixel(1584+i.position))-1.5)*p+"px;")),a={id:e.element.id+"_LeftTab_"+o,class:"e-de-ruler-tab e-de-ruler-tab-left",style:s,"data-name":"LeftTab"},this.leftTab=this.createHtmlElement("div",a),this.leftTab.setAttribute("title",r.getConstant("Left Tab")),l={id:e.element.id+"_leftTab_svg",width:t.width/2+"px",height:t.height/2+"px",style:"position:inherit;left:0px"},(h=this.createSvgElement("svg",l)).setAttribute("fill","none"),(d=this.createSvgElement("path",{style:"position:inherit;left:0px"})).setAttribute("class","e-de-ruler-tab-svg"),d.setAttribute("d","M3 5H7V7H1V1H3V5Z"),d.setAttribute("fill","#605E5C"),d.setAttribute("stroke","#A1A1A1"),h.appendChild(d),this.leftTab.appendChild(h),this.hRuler.append(this.leftTab));break;case"Center":this.centerTab=document.getElementById(e.element.id+"_CenterTab_"+o),this.centerTab||(s="",je(i)||(s="height:9px;overflow:hidden;top:7px;width:12px;position:absolute;font-size:11px;text-align: left;z-index: 4;"+("left:"+((this.position.paragraph.paragraphFormat.bidi?Y.convertPointToPixel(1584-i.position):Y.convertPointToPixel(1584+i.position))-4)*p+"px;")),a={id:e.element.id+"_CenterTab_"+o,class:"e-de-ruler-tab e-de-ruler-tab-center",style:s,"data-name":"CenterTab"},this.centerTab=this.createHtmlElement("div",a),this.centerTab.setAttribute("title",r.getConstant("Center Tab")),l={id:e.element.id+"_centerTab_svg",width:t.width/2+"px",height:t.height/2+"px",style:"position:inherit;left:0px"},(h=this.createSvgElement("svg",l)).setAttribute("fill","none"),(d=this.createSvgElement("path",{style:"position:inherit;left:0px"})).setAttribute("class","e-de-ruler-tab-svg"),d.setAttribute("d","M5 5H8V7H0V5H3V1H5V5Z"),d.setAttribute("fill","#605E5C"),d.setAttribute("stroke","#A1A1A1"),h.appendChild(d),this.centerTab.appendChild(h),this.hRuler.append(this.centerTab));break;case"Right":this.rightTab=document.getElementById(e.element.id+"_RightTab_"+o),this.rightTab||(s="",je(i)||(s="height:9px;overflow:hidden;top:7px;width:12px;position:absolute;font-size:11px;text-align: left;z-index: 4;"+("left:"+((this.position.paragraph.paragraphFormat.bidi?Y.convertPointToPixel(1584-i.position):Y.convertPointToPixel(1584+i.position))-5.5)*p+"px;")),a={id:e.element.id+"_RightTab_"+o,class:"e-de-ruler-tab e-de-ruler-tab-right",style:s,"data-name":"RightTab"},this.rightTab=this.createHtmlElement("div",a),this.rightTab.setAttribute("title",r.getConstant("Right Tab")),l={id:e.element.id+"_rightTab_svg",width:t.width/2+"px",height:t.height/2+"px",style:"position:inherit;left:0px"},(h=this.createSvgElement("svg",l)).setAttribute("fill","none"),(d=this.createSvgElement("path",{style:"position:inherit;left:0px"})).setAttribute("class","e-de-ruler-tab-svg"),d.setAttribute("d","M5 5V1H7V7H1V5H5Z"),d.setAttribute("fill","#605E5C"),d.setAttribute("stroke","#A1A1A1"),h.appendChild(d),this.rightTab.appendChild(h),this.hRuler.append(this.rightTab));break;case"Decimal":this.decimalTab=document.getElementById(e.element.id+"_DecimalTab_"+o),this.decimalTab||(s="",je(i)||(s="height:9px;overflow:hidden;top:7px;width:12px;position:absolute;font-size:11px;text-align: left;z-index: 4;"+("left:"+((this.position.paragraph.paragraphFormat.bidi?Y.convertPointToPixel(1584-i.position):Y.convertPointToPixel(1584+i.position))*p-4)+"px;")),a={id:e.element.id+"_DecimalTab_"+o,class:"e-de-ruler-tab e-de-ruler-tab-decimal",style:s,"data-name":"DecimalTab"},this.decimalTab=this.createHtmlElement("div",a),this.decimalTab.setAttribute("title",r.getConstant("Decimal Tab")),l={id:e.element.id+"_decimalTab_svg",width:t.width/2+"px",height:t.height/2+"px",style:"position:inherit;left:0px"},(h=this.createSvgElement("svg",l)).setAttribute("fill","none"),(d=this.createSvgElement("path",{style:"position:inherit;left:0px"})).setAttribute("class","e-de-ruler-tab-svg"),d.setAttribute("d","M6 0H4V6H0V8H4H6H10V6H6V0Z"),d.setAttribute("fill","#605E5C"),d.setAttribute("clip-rule","evenodd"),d.setAttribute("fill-rule","evenodd"),d.setAttribute("stroke","#A1A1A1"),h.appendChild(d),this.decimalTab.appendChild(h),this.hRuler.append(this.decimalTab));break;case"Bar":this.barTab=document.getElementById(e.element.id+"_BarTab_"+o),this.barTab||(s="",je(i)||(s="height:9px;overflow:hidden;top:7px;width:12px;position:absolute;font-size:11px;text-align: left;z-index: 4;"+("left:"+((this.position.paragraph.paragraphFormat.bidi?Y.convertPointToPixel(1584-i.position):Y.convertPointToPixel(1584+i.position))-1.5)*p+"px;")),a={id:e.element.id+"_BarTab_"+o,class:"e-de-ruler-tab e-de-ruler-tab-bar",style:s,"data-name":"BarTab"},this.barTab=this.createHtmlElement("div",a),this.barTab.setAttribute("title",r.getConstant("Bar Tab")),l={id:e.element.id+"_barTab_svg",width:t.width/2+"px",height:t.height/2+"px",style:"position:inherit;left:0px"},(h=this.createSvgElement("svg",l)).setAttribute("fill","none"),(d=this.createSvgElement("rect",{style:"position:inherit;left:0px"})).setAttribute("width","2"),d.setAttribute("height","8"),d.setAttribute("fill","#605E5C"),d.setAttribute("stroke","#A1A1A1"),h.appendChild(d),this.barTab.appendChild(h),this.hRuler.append(this.barTab))}je(i)||(this.tabStopElement=document.getElementById(e.element.id+"_"+n+"Tab_"+o),je(i)||this.tabStopElement.addEventListener("dblclick",this.onTabStopDblClickHandler),this.tabInitialValue=Y.getNumberFromString(this.tabStopElement.style.left),Y.getNumberFromString(this.tabStopElement.style.left),this.justification=this.tabStopElement.getAttribute("data-name"),this.currrentParagraph=this.position.paragraph,this.tabStopElement.addEventListener("mousedown",this.onTabStopMouseDownHandler),this.tabStopElement.addEventListener("mouseup",this.onTabStopMouseUpHandler),document.addEventListener("mousemove",this.onTabStopMouseMoveHandler),document.addEventListener("mouseup",this.onRenderTabStopMouseUpHandler))},tgi.prototype.updateMargin=function(e,t,i){i?(e.startMargin=t.selectionModule.end.paragraph.bodyWidget.sectionFormat.leftMargin,e.endMargin=t.selectionModule.end.paragraph.bodyWidget.sectionFormat.rightMargin):(e.startMargin=t.selectionModule.end.paragraph.bodyWidget.sectionFormat.topMargin,e.endMargin=t.selectionModule.end.paragraph.bodyWidget.sectionFormat.bottomMargin)},tgi.prototype.getTabJustification=function(e){switch(e){case"LeftTab":return"Left";case"CenterTab":return"Center";case"RightTab":return"Right";case"DecimalTab":return"Decimal";case"BarTab":return"Bar"}return"Left"},tgi.prototype.getRulerSize=function(e){return new Kui(15,15)},tgi.prototype.destroy=function(){this.unWireEvents(),this.removeHTMLElements(),this.removeSvgElements()},tgi.prototype.removeHTMLElements=function(){var t=this;this.tabStopStwitch&&(this.tabStopStwitch.remove(),this.tabStopStwitch=null),this.hRulerBottom&&(this.hRulerBottom.remove(),this.hRulerBottom=null),this.vRulerBottom&&(this.vRulerBottom.remove(),this.vRulerBottom=null),this.overlap&&(this.overlap.remove(),this.overlap=null),this.markIndicator&&(this.markIndicator.remove(),this.markIndicator=null),this.rulerDiv&&(this.rulerDiv.remove(),this.rulerDiv=null),this.rulerOverlap&&(this.rulerOverlap.remove(),this.rulerOverlap=null),this.rulerMarginDiv&&(this.rulerMarginDiv.remove(),this.rulerMarginDiv=null),this.verticalRulerMarginDiv&&(this.verticalRulerMarginDiv.remove(),this.verticalRulerMarginDiv=null),this.firstLineIndent&&(this.firstLineIndent.remove(),this.firstLineIndent=null),this.hangingIndent&&(this.hangingIndent.remove(),this.hangingIndent=null),this.leftIndent&&(this.leftIndent.remove(),this.leftIndent=null),this.rightIndent&&(this.rightIndent.remove(),this.rightIndent=null),this.parentRulerDiv&&(this.parentRulerDiv.remove(),this.parentRulerDiv=null),this.rulerSpaceDiv&&(this.rulerSpaceDiv.remove(),this.rulerSpaceDiv=null),this.firstLineIndentRuler&&(this.firstLineIndentRuler.remove(),this.firstLineIndentRuler=null),this.hangingIndentRuler&&(this.hangingIndentRuler.remove(),this.hangingIndentRuler=null),this.leftTab&&(this.leftTab.childNodes.forEach(function(e){t.leftTab.removeChild(e)}),this.leftTab.innerHTML="",this.leftTab.remove(),this.leftTab=null),this.rightTab&&(this.rightTab.childNodes.forEach(function(e){t.rightTab.removeChild(e)}),this.rightTab.innerHTML="",this.rightTab.remove(),this.rightTab=null),this.centerTab&&(this.centerTab.childNodes.forEach(function(e){t.centerTab.removeChild(e)}),this.centerTab.innerHTML="",this.centerTab.remove(),this.centerTab=null),this.decimalTab&&(this.decimalTab.childNodes.forEach(function(e){t.decimalTab.removeChild(e)}),this.decimalTab.innerHTML="",this.decimalTab.remove(),this.decimalTab=null),this.barTab&&(this.barTab.childNodes.forEach(function(e){t.barTab.removeChild(e)}),this.barTab.innerHTML="",this.barTab.remove(),this.barTab=null),this.vRuler&&(this.vRuler.childNodes.forEach(function(e){t.vRuler.removeChild(e)}),this.vRuler.innerHTML="",this.vRuler.remove(),this.vRuler=null),this.hRuler&&(this.hRuler.childNodes.forEach(function(e){t.hRuler.removeChild(e)}),this.hRuler.innerHTML="",this.hRuler.remove(),this.hRuler=null)},tgi.prototype.removeSvgElements=function(){this.hSvg&&(this.hSvg.remove(),this.hSvg=null),this.vLine&&(this.vLine.remove(),this.vLine=null),this.vSvg&&(this.vSvg.remove(),this.vSvg=null),this.hLine&&(this.hLine.remove(),this.hLine=null),this.firstLineIndentSvg&&(this.firstLineIndentSvg.remove(),this.firstLineIndentSvg=null),this.firstLineIndentPath&&(this.firstLineIndentPath.remove(),this.firstLineIndentPath=null),this.hangingIndentSvg&&(this.hangingIndentSvg.remove(),this.hangingIndentSvg=null),this.hangingIndentPath&&(this.hangingIndentPath.remove(),this.hangingIndentPath=null),this.rightIndentSvg&&(this.rightIndentSvg.remove(),this.rightIndentSvg=null),this.rightIndentPath&&(this.rightIndentPath.remove(),this.rightIndentPath=null),this.leftIndentSvg&&(this.leftIndentSvg.remove(),this.leftIndentSvg=null),this.leftIndentPath&&(this.leftIndentPath.remove(),this.leftIndentPath=null)},tgi.prototype.unWireEvents=function(){this.markIndicator&&this.markIndicator.removeEventListener("click",this.onmarkIndicatorClickHandler),this.rulerDiv&&this.rulerDiv.removeEventListener("dblclick",this.onRulerDblClickHandler),this.hRuler&&(this.hRuler.removeEventListener("mouseenter",this.onHRulerMouseEnterHandler),this.hRuler.removeEventListener("mouseleave",this.onHRulerMouseLeaveHandler),this.hRuler.removeEventListener("mousedown",this.onHRulerMouseDownHandler),this.hRuler.removeEventListener("mouseup",this.onHRulerMouseUpHandler)),this.vRuler&&this.vRuler.removeEventListener("mousedown",this.onVMouseDownHandler),this.firstLineIndent&&(this.firstLineIndent.removeEventListener("dblclick",this.onDoubleClickHandler),this.firstLineIndent.removeEventListener("mouseenter",this.onDocumentIntentTrueChangeHandler),this.firstLineIndent.removeEventListener("mouseleave",this.onDocumentIntentFalseChangeHandler),this.firstLineIndent.removeEventListener("mousedown",this.onFirstLineIndentMouseDownHandler)),document.removeEventListener("mousemove",this.onHorizontalRulerMouseMoveHandler),document.removeEventListener("mouseup",this.onRulerMouseUpHandler),document.removeEventListener("mousemove",this.onVMouseMoveHandler),document.removeEventListener("mouseup",this.onVMouseUpHandler),document.removeEventListener("mousemove",this.onIndentMouseMoveHandler),document.removeEventListener("mouseup",this.onIndentMouseUpHandler),this.leftIndent&&(this.leftIndent.removeEventListener("dblclick",this.onDoubleClickHandler),this.leftIndent.removeEventListener("mouseenter",this.onDocumentIntentTrueChangeHandler),this.leftIndent.removeEventListener("mouseleave",this.onDocumentIntentFalseChangeHandler),this.leftIndent.removeEventListener("mousedown",this.onLeftIndentMouseDownHandler)),document.removeEventListener("mousemove",this.onLeftIndentMouseMoveHandler),document.removeEventListener("mouseup",this.onLeftIndentMouseUpHandler),this.hangingIndent&&(this.hangingIndent.removeEventListener("dblclick",this.onDoubleClickHandler),this.hangingIndent.removeEventListener("mouseenter",this.onDocumentIntentTrueChangeHandler),this.hangingIndent.removeEventListener("mouseleave",this.onDocumentIntentFalseChangeHandler),this.hangingIndent.removeEventListener("mousedown",this.onHangIndentMouseDownHandler)),document.removeEventListener("mousemove",this.onHangIndentMouseMoveHandler),document.removeEventListener("mouseup",this.onHangIndentMouseUpHandler),this.rightIndent&&(this.rightIndent.removeEventListener("dblclick",this.onDoubleClickHandler),this.rightIndent.removeEventListener("mouseenter",this.onDocumentIntentTrueChangeHandler),this.rightIndent.removeEventListener("mouseleave",this.onDocumentIntentFalseChangeHandler),this.rightIndent.removeEventListener("mousedown",this.onRightIndentMouseDownHandler)),document.removeEventListener("mousemove",this.onRightIndentMouseMoveHandler),document.removeEventListener("mouseup",this.onRightIndentMouseUpHandler),this.tabStopElement&&(this.tabStopElement.removeEventListener("dblclick",this.onTabStopDblClickHandler),this.tabStopElement.removeEventListener("mousedown",this.onTabStopMouseDownHandler),this.tabStopElement.removeEventListener("mouseup",this.onTabStopMouseUpHandler)),document.removeEventListener("mousemove",this.onTabStopMouseMoveHandler),document.removeEventListener("mouseup",this.onRenderTabStopMouseUpHandler),this.onmarkIndicatorClickHandler=void 0};var egi=tgi;function tgi(){this.resizerEnabled=!1,this.isDraggingRender=!1,this.isDraggingIndents1=!1,this.isDraggingIndents2=!1,this.isDraggingIndents3=!1,this.isDraggingIndents4=!1,this.isDraggingForTab=!1,this.currentTabStop=void 0,this.tabIndex=0,this.isLeftRulerMargin=void 0,this.isLeftMultiColumn=!1,this.isRightMultiColumn=!1,this.onmarkIndicatorClickHandler=this.onMarkIndicatorClick.bind(this),this.onHorizontalRulerMouseMoveHandler=this.onHorizontalRulerMouseMoved.bind(this),this.onHRulerMouseEnterHandler=this.onHRulerMouseEnter.bind(this),this.onHRulerMouseLeaveHandler=this.onHRulerMouseLeave.bind(this),this.onHRulerMouseDownHandler=this.onHRulerMouseDown.bind(this),this.onHRulerMouseUpHandler=this.onHRulerMouseUp.bind(this),this.onRulerDblClickHandler=this.onRulerDblClick.bind(this),this.onDoubleClickHandler=this.onDoubleClick.bind(this),this.onRulerMouseUpHandler=this.onRularMouseUp.bind(this),this.onVMouseMoveHandler=this.onVMouseMove.bind(this),this.onVMouseDownHandler=this.onVMouseDown.bind(this),this.onVMouseUpHandler=this.onVMouseUp.bind(this),this.onDocumentIntentTrueChangeHandler=this.onDocumentIntentTrue.bind(this),this.onDocumentIntentFalseChangeHandler=this.onDocumentIntentFalse.bind(this),this.onFirstLineIndentMouseDownHandler=this.onFirstLineIndentMouseDown.bind(this),this.onIndentMouseMoveHandler=this.onIndentMouseMove.bind(this),this.onIndentMouseUpHandler=this.onIndentMouseUp.bind(this),this.onHangIndentMouseDownHandler=this.onHangIndentMouseDown.bind(this),this.onHangIndentMouseMoveHandler=this.onHangIndentMouseMove.bind(this),this.onHangIndentMouseUpHandler=this.onHangIndentMouseUp.bind(this),this.onLeftIndentMouseDownHandler=this.onLeftIndentMouseDown.bind(this),this.onLeftIndentMouseMoveHandler=this.onLeftIndentMouseMove.bind(this),this.onLeftIndentMouseUpHandler=this.onLeftIndentMouseUp.bind(this),this.onRightIndentMouseDownHandler=this.onRightIndentMouseDown.bind(this),this.onRightIndentMouseMoveHandler=this.onRightIndentMouseMove.bind(this),this.onRightIndentMouseUpHandler=this.onRightIndentMouseUp.bind(this),this.onTabStopMouseDownHandler=this.onTabStopMouseDown.bind(this),this.onTabStopMouseUpHandler=this.onTabStopMouseUp.bind(this),this.onTabStopMouseMoveHandler=this.onTabStopMouseMove.bind(this),this.onRenderTabStopMouseUpHandler=this.onRenderTabStopMouseUp.bind(this),this.onTabStopDblClickHandler=this.onTabStopDblClick.bind(this),this.isTopRulerMargin=!1}ngi.prototype.getModuleName=function(){return"DateContentDialog"},ngi.prototype.initDateContentDialog=function(e){this.target=Q("div"),this.parentDiv=Q("div"),this.target.appendChild(this.parentDiv);var t=new V7({change:this.valueChange.bind(this)});this.documentHelper.owner.editor.dateValue&&(t.value=new Date(this.documentHelper.owner.editor.dateValue)),t.appendTo(this.parentDiv),this.documentHelper.owner.editor.dateValue&&(t.value=new Date(this.documentHelper.owner.editor.dateValue))},ngi.prototype.valueChange=function(e){var t;e.event&&(e=e.value.toLocaleDateString(),t=this.documentHelper.owner.selection.currentContentControl,this.documentHelper.owner.editor.dropDownChange(t,e),this.documentHelper.hideDialog())},ngi.prototype.show=function(){var e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.localeValue=e,this.target||this.initDateContentDialog(e),"none"!==this.documentHelper.selection.caret.style.display&&(this.documentHelper.selection.caret.style.display="none"),this.documentHelper.dialog.header=e.getConstant("Datepicker Content Control"),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.dataBind(),this.documentHelper.dialog.show()},ngi.prototype.destroy=function(){if(this.calendar&&(this.calendar.destroy(),this.calendar=void 0),this.documentHelper=void 0,this.parentDiv&&(this.parentDiv.remove(),this.parentDiv=void 0),!je(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[parseInt(e.toString(),10)]),e--;this.target=void 0}};var igi=ngi;function ngi(e){var t=this;this.onCancelButtonClick=function(){t.documentHelper.dialog.hide(),t.documentHelper.updateFocus()},this.documentHelper=e}rgi.prototype.getModuleName=function(){return"ContentControlPropertiesDialog"},rgi.prototype.createInputElement=function(e,t,i){return Q("input",{attrs:{type:e},id:t,className:i})},rgi.prototype.initContentControlPropertiesDialog=function(e,t){var i=this,n=(this.target=Q("div",{className:"e-de-cont-cntr"}),this.container=Q("div"),this.generalDiv=Q("div"),this.genLabel=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("General")}),this.generalDiv.appendChild(this.genLabel),this.displayText=Q("div",{className:"e-de-dlg-container"}),this.titleText=Q("input",{className:"e-input"}),this.displayText.appendChild(this.titleText),this.generalDiv.appendChild(this.displayText),this.tagText=Q("input",{className:"e-input"}),this.generalDiv.appendChild(this.tagText),this.colorDiv=Q("div",{className:"e-de-container-row"}),this.colorDiv.style.paddingTop="10px",this.fontColorDiv=Q("div",{className:"e-de-font-dlg-display"}),this.fontColorLabel=Q("label",{className:"e-de-font-dlg-header-font-color e-de-font-color-margin",innerHTML:e.getConstant("Color")}),this.fontColorDiv.appendChild(this.fontColorLabel),this.fontColorElement=this.createInputElement("color",this.target.id+"_ColorDiv","e-de-font-dlg-color"),this.fontColorDiv.appendChild(this.fontColorElement),this.colorDiv.appendChild(this.fontColorDiv),this.generalDiv.appendChild(this.colorDiv),this.documentHelper.owner.documentEditorSettings.colorPickerSettings),o=n.columns,r=n.createPopupOnClick,s=n.cssClass,a=n.disabled,l=n.enablePersistence,h=n.inline,d=n.mode,p=n.modeSwitcher,c=n.noColor,u=n.presetColors,n=n.showButtons;this.colorPicker=new cV({change:this.fontColorUpdate,value:"#000000",locale:this.documentHelper.owner.locale,enableOpacity:!1,mode:d,modeSwitcher:p,showButtons:n,columns:o,createPopupOnClick:r,cssClass:s,disabled:a,enablePersistence:l,inline:h,noColor:c,presetColors:u}),this.colorPicker.appendTo(this.fontColorElement),this.style=Q("div",{styles:"display:block"}),this.generalDiv.appendChild(this.style),this.remove=Q("div",{styles:"display:block"}),this.generalDiv.appendChild(this.remove),this.removeContent=Q("input",{attrs:{type:"checkbox"}}),this.remove.appendChild(this.removeContent),this.removeCheckBox=new ib({label:e.getConstant("Remove content control when contents are edited"),cssClass:"e-de-para-dlg-cs-check-box"}),this.removeCheckBox.appendTo(this.removeContent),this.removeContent.setAttribute("aria-label",e.getConstant("Remove content control when contents are edited")),this.container.appendChild(this.generalDiv),this.lockedDiv=Q("div"),this.lockedDiv.style.paddingTop="10px",this.lockedLabel=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Locking")}),this.lockedDiv.appendChild(this.lockedLabel),this.contentDelete=Q("div",{styles:"display:block"}),this.lockedDiv.appendChild(this.contentDelete),this.contentDeleted=Q("input",{attrs:{type:"checkbox"}}),this.contentDelete.appendChild(this.contentDeleted),this.contentDeletedCheckBox=new ib({label:e.getConstant("Content control cannot be deleted"),cssClass:"e-de-para-dlg-cs-check-box",change:function(e){e.checked?i.removeCheckBox.disabled=!0:i.removeCheckBox.disabled=!1,i.removeCheckBox.dataBind()}}),this.contentDeletedCheckBox.appendTo(this.contentDeleted),this.contentDeleted.setAttribute("aria-label",e.getConstant("Content control cannot be deleted")),this.contentEdit=Q("div",{styles:"display:block"}),this.lockedDiv.appendChild(this.contentEdit),this.contentEdited=Q("input",{attrs:{type:"checkbox"}}),this.contentEdit.appendChild(this.contentEdited),this.contentEditedCheckBox=new ib({label:e.getConstant("Contents cannot be edited"),cssClass:"e-de-para-dlg-cs-check-box"}),this.contentEditedCheckBox.appendTo(this.contentEdited),this.contentEdited.setAttribute("aria-label",e.getConstant("Contents cannot be edited")),this.container.appendChild(this.lockedDiv),this.plainTextPropertiesDiv=Q("div"),this.plainTextPropertiesDiv.style.marginTop="10px",this.plainTextPropertiesDiv.style.display="none",this.plainTextLabel=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Plain Text properties")}),this.plainTextPropertiesDiv.appendChild(this.plainTextLabel),this.multiline=Q("input",{attrs:{type:"checkbox"}}),this.plainTextPropertiesDiv.appendChild(this.multiline),this.multilineCheckBox=new ib({label:e.getConstant("Allow carriage returns"),cssClass:"e-de-para-dlg-cs-check-box"}),this.multilineCheckBox.appendTo(this.multiline),this.multiline.setAttribute("aria-label",e.getConstant("Allow carriage returns")),this.container.appendChild(this.plainTextPropertiesDiv),this.dropDownPropertiesDiv=Q("div"),this.dropDownPropertiesDiv.style.marginTop="10px",this.dropDownPropertiesDiv.style.display="none",this.lockedcontentLabel=Q("div",{className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Drop_Down List properties")}),this.dropDownPropertiesDiv.appendChild(this.lockedcontentLabel),this.commonDiv=Q("div",{className:"e-bookmark-common"}),this.dropDownPropertiesDiv.appendChild(this.commonDiv),this.searchDiv=Q("div",{className:"e-bookmark-list"}),this.commonDiv.appendChild(this.searchDiv),this.textBoxDiv=Q("div",{className:"e-bookmark-textboxdiv"}),this.searchDiv.appendChild(this.textBoxDiv),this.textBoxInput=Q("input",{className:"e-input e-bookmark-textbox-input",id:"bookmark_text_box"}),this.textBoxInput.setAttribute("type","text"),this.textBoxInput.addEventListener("keyup",this.keyUpOnTextBoxClickHandler),this.textBoxInput.setAttribute("aria-label",e.getConstant("Display Text")),this.textBoxDiv.appendChild(this.textBoxInput),this.valueBoxDiv=Q("div",{className:"e-bookmark-textboxdiv"}),this.searchDiv.appendChild(this.valueBoxDiv),this.valueBoxInput=Q("input",{className:"e-input e-bookmark-textbox-input",id:"bookmark_text_box"}),this.valueBoxInput.setAttribute("type","text"),this.valueBoxInput.addEventListener("keyup",this.keyUpOnTextBoxClickHandler),this.valueBoxInput.setAttribute("aria-label",e.getConstant("Value")),this.valueBoxDiv.appendChild(this.valueBoxInput),this.listviewDiv=Q("div",{className:"e-bookmark-listViewDiv",id:"bookmark_listview",attrs:{tabindex:"-1",role:"listbox"}}),this.searchDiv.appendChild(this.listviewDiv),this.listviewInstance=new MH({cssClass:"e-bookmark-listview",select:this.selectHandler,fields:{text:"value"}}),this.listviewInstance.appendTo(this.listviewDiv),this.buttonDiv=Q("div",{className:"e-bookmark-button"}),this.commonDiv.appendChild(this.buttonDiv),this.addbuttonDiv=Q("div",{className:"e-bookmark-addbutton"}),this.buttonDiv.appendChild(this.addbuttonDiv),this.addButtonElement=Q("button",{innerHTML:"Add",id:"add",attrs:{type:"button"}}),this.addButtonElement.setAttribute("aria-label",e.getConstant("Add")),this.addbuttonDiv.appendChild(this.addButtonElement),this.addButton=new zv({cssClass:"e-button-custom"}),this.addButton.disabled=!0,this.addButton.appendTo(this.addButtonElement),this.addButtonElement.addEventListener("click",this.setButtonClickHandler),this.deleteButtonDiv=Q("div",{className:"e-bookmark-deletebutton"}),this.buttonDiv.appendChild(this.deleteButtonDiv),this.deleteButtonElement=Q("button",{innerHTML:"Delete",id:"delete",attrs:{type:"button"}}),this.deleteButtonElement.setAttribute("aria-label","Delete"),this.deleteButtonDiv.appendChild(this.deleteButtonElement),this.deleteButton=new zv({cssClass:"e-button-custom"}),this.deleteButton.appendTo(this.deleteButtonElement),this.deleteButtonElement.addEventListener("click",this.clearButtonClickHandler),this.container.appendChild(this.dropDownPropertiesDiv),this.target.appendChild(this.container),new fV({placeholder:e.getConstant("Title"),floatLabelType:"Always"},this.titleText),new fV({placeholder:e.getConstant("Tag"),floatLabelType:"Always"},this.tagText),new fV({placeholder:e.getConstant("Display Text"),floatLabelType:"Always"},this.textBoxInput),new fV({placeholder:e.getConstant("Value"),floatLabelType:"Always"},this.valueBoxInput)},rgi.prototype.show=function(){var e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.localeValue=e,this.target||this.initContentControlPropertiesDialog(e,!1),"none"!==this.documentHelper.selection.caret.style.display&&(this.documentHelper.selection.caret.style.display="none"),"none"===this.dropDownPropertiesDiv.style.display&&"none"===this.plainTextPropertiesDiv.style.display||(this.dropDownPropertiesDiv.style.display="none",this.plainTextPropertiesDiv.style.display="none"),this.documentHelper.dialog.header=e.getConstant("Content Control Properties"),this.documentHelper.dialog.height="auto",this.documentHelper.dialog.width="auto",this.documentHelper.dialog.beforeOpen=this.loadPropertiesdialog,this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.buttons=[{click:this.applyProperties,buttonModel:{content:this.localeValue.getConstant("Ok"),cssClass:"e-flat e-para-okay",isPrimary:!0}},{click:this.closePropertiesDialog,buttonModel:{content:this.localeValue.getConstant("Cancel"),cssClass:"e-flat e-para-cancel"}}],this.documentHelper.dialog.close=this.documentHelper.updateFocus,this.documentHelper.dialog.dataBind(),this.documentHelper.dialog.show()},rgi.prototype.onClearButtonClick=function(e){this.clearButtonClick(e)},rgi.prototype.onSetButtonClick=function(e){this.setButtonClick(e)},rgi.prototype.onKeyUpOnTextBoxClicked=function(){this.onKeyUpOnTextBox()},rgi.prototype.enableOrDisableButton=function(){je(this.addButton)||(this.addButton.disabled=""===this.textBoxInput.value||""===this.valueBoxInput.value)},rgi.prototype.unWireEventsAndBindings=function(){this.fontColor=void 0,this.currentContentControl=void 0,this.currentSelectedItem=void 0,this.convertedItems=[]},rgi.prototype.destroy=function(){if(this.contentDeletedCheckBox&&(this.contentDeletedCheckBox.destroy(),this.contentDeletedCheckBox=void 0),this.contentEditedCheckBox&&(this.contentEditedCheckBox.destroy(),this.contentEditedCheckBox=void 0),this.removeCheckBox&&(this.removeCheckBox.destroy(),this.removeCheckBox=void 0),this.multilineCheckBox&&(this.multilineCheckBox.destroy(),this.multilineCheckBox=void 0),this.listviewInstance&&(this.listviewInstance.destroy(),this.listviewInstance=void 0),this.textBoxInput&&(this.textBoxInput.remove(),this.textBoxInput=void 0),this.valueBoxInput&&(this.valueBoxInput.remove(),this.valueBoxInput=void 0),this.titleText&&(this.titleText.remove(),this.titleText=void 0),this.tagText&&(this.tagText.remove(),this.tagText=void 0),this.colorPicker&&this.colorPicker.destroy(),this.colorPicker=void 0,this.documentHelper=void 0,this.removeEvents(),this.removeElements(),!je(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[parseInt(e.toString(),10)]),e--;this.target=void 0}},rgi.prototype.removeEvents=function(){this.addButtonElement&&this.addButtonElement.removeEventListener("click",this.setButtonClickHandler),this.deleteButtonElement&&this.deleteButtonElement.removeEventListener("click",this.clearButtonClickHandler),this.textBoxInput&&this.textBoxInput.removeEventListener("keyup",this.keyUpOnTextBoxClickHandler),this.valueBoxInput&&this.valueBoxInput.removeEventListener("keyup",this.keyUpOnTextBoxClickHandler)},rgi.prototype.removeElements=function(){this.generalDiv&&(this.generalDiv.remove(),this.generalDiv=void 0),this.genLabel&&(this.genLabel.remove(),this.genLabel=void 0),this.displayText&&(this.displayText.remove(),this.displayText=void 0),this.colorDiv&&(this.colorDiv.remove(),this.colorDiv=void 0),this.fontColorDiv&&(this.fontColorDiv.remove(),this.fontColorDiv=void 0),this.fontColorLabel&&(this.fontColorLabel.remove(),this.fontColorLabel=void 0),this.fontColorElement&&(this.fontColorElement.remove(),this.fontColorElement=void 0),this.style&&(this.style.remove(),this.style=void 0),this.remove&&(this.remove.remove(),this.remove=void 0),this.removeContent&&(this.removeContent.remove(),this.removeContent=void 0),this.lockedDiv&&(this.lockedDiv.remove(),this.lockedDiv=void 0),this.lockedLabel&&(this.lockedLabel.remove(),this.lockedLabel=void 0),this.contentDelete&&(this.contentDelete.remove(),this.contentDelete=void 0),this.contentDeleted&&(this.contentDeleted.remove(),this.contentDeleted=void 0),this.contentEdit&&(this.contentEdit.remove(),this.contentEdit=void 0),this.contentEdited&&(this.contentEdited.remove(),this.contentEdited=void 0),this.plainTextLabel&&(this.plainTextLabel.remove(),this.plainTextLabel=void 0),this.multiline&&(this.multiline.remove(),this.multiline=void 0),this.lockedcontentLabel&&(this.lockedcontentLabel.remove(),this.lockedcontentLabel=void 0),this.commonDiv&&(this.commonDiv.remove(),this.commonDiv=void 0),this.searchDiv&&(this.searchDiv.remove(),this.searchDiv=void 0),this.textBoxDiv&&(this.textBoxDiv.remove(),this.textBoxDiv=void 0),this.valueBoxDiv&&(this.valueBoxDiv.remove(),this.valueBoxDiv=void 0),this.listviewDiv&&(this.listviewDiv.remove(),this.listviewDiv=void 0),this.buttonDiv&&(this.buttonDiv.remove(),this.buttonDiv=void 0),this.addbuttonDiv&&(this.addbuttonDiv.remove(),this.addbuttonDiv=void 0),this.addButtonElement&&(this.addButtonElement.remove(),this.addButtonElement=void 0),this.deleteButtonDiv&&(this.deleteButtonDiv.remove(),this.deleteButtonDiv=void 0),this.deleteButtonElement&&(this.deleteButtonElement.remove(),this.deleteButtonElement=void 0)};var ogi=rgi;function rgi(e){var o=this;this.colorPicker=void 0,this.fontColor=void 0,this.keyUpOnTextBoxClickHandler=this.onKeyUpOnTextBoxClicked.bind(this),this.setButtonClickHandler=this.onSetButtonClick.bind(this),this.clearButtonClickHandler=this.onClearButtonClick.bind(this),this.characterFormat=void 0,this.clearButtonClick=function(e){o.textBoxInput.value="",o.valueBoxInput.value="";for(var t=0;t<o.convertedItems.length;t++)o.convertedItems[parseInt(t.toString(),10)].value===o.currentSelectedItem&&(o.currentContentControl.contentControlProperties.contentControlListItems.splice(t,1),o.convertedItems.splice(t,1));o.listviewInstance.dataSource=o.convertedItems.slice(),o.listviewInstance.dataBind()},this.setButtonClick=function(e){var t;je(o.textBoxInput.value)&&je(o.valueBoxInput.value)||((t=new Rli).displayText=o.textBoxInput.value||"",t.value=o.valueBoxInput.value||"",o.currentContentControl.contentControlProperties.contentControlListItems.push(t),t={displayText:t.displayText,value:t.value},o.convertedItems.push(t),o.listviewInstance.addItem([t])),o.textBoxInput.value="",o.valueBoxInput.value=""},this.onKeyUpOnTextBox=function(){o.enableOrDisableButton()},this.loadPropertiesdialog=function(){o.currentContentControl=o.documentHelper.owner.selection.currentContentControl,je(o.currentContentControl)||(o.contentEditedCheckBox.checked=o.currentContentControl.contentControlProperties.lockContents,o.contentDeletedCheckBox.checked=o.currentContentControl.contentControlProperties.lockContentControl,o.removeCheckBox.checked=o.currentContentControl.contentControlProperties.isTemporary,o.multilineCheckBox.checked=o.currentContentControl.contentControlProperties.multiline,o.colorPicker.value=o.currentContentControl.contentControlProperties.color,o.removeCheckBox.checked&&(o.contentEditedCheckBox.checked=!1),o.titleText.value=o.currentContentControl.contentControlProperties.title||"",o.tagText.value=o.currentContentControl.contentControlProperties.tag||"",o.fontColor=o.currentContentControl.contentControlProperties.color,"Text"===o.currentContentControl.contentControlProperties.type?o.plainTextPropertiesDiv.style.display="block":o.plainTextPropertiesDiv.style.display="none","ComboBox"===o.currentContentControl.contentControlProperties.type||"DropDownList"===o.currentContentControl.contentControlProperties.type?o.dropDownPropertiesDiv.style.display="block":o.dropDownPropertiesDiv.style.display="none",je(void 0!==o.currentContentControl.contentControlProperties.contentControlListItems))||(o.convertedItems=o.currentContentControl.contentControlProperties.contentControlListItems.map(function(e){var t,i={};for(t in e)i[""+t]=e[""+t];return i}),o.listviewInstance.dataSource=o.convertedItems,o.listviewInstance.dataBind()),o.documentHelper.updateFocus()},this.applyProperties=function(){var e=o.documentHelper.selection.start.clone(),t=o.documentHelper.selection.end.clone(),i=o.currentContentControl.line.getOffset(o.currentContentControl,1),i=(o.documentHelper.selection.start.setPositionParagraph(o.currentContentControl.line,i),o.documentHelper.selection.end.setPositionParagraph(o.currentContentControl.line,i+1),o.documentHelper.owner.editorModule.initHistory("UpdateContentControl"),o.documentHelper.owner.editor.getContentControlPropObject(o.currentContentControl.contentControlProperties)),n=(je(o.fontColor)||(o.currentContentControl.contentControlProperties.color=o.fontColor),o.documentHelper.owner.getImageContentControl());n instanceof Pli&&"Picture"==n.contentControlProperties.type&&(n.contentControlProperties.lockContents=o.contentEditedCheckBox.checked,n.contentControlProperties.lockContentControl=o.contentDeletedCheckBox.checked,n.contentControlProperties.isTemporary=o.removeCheckBox.checked,o.removeCheckBox.checked&&(n.contentControlProperties.lockContents=!1),n.contentControlProperties.title=void 0!==o.titleText.value?o.titleText.value:"",n.contentControlProperties.tag=void 0!==o.tagText.value?o.tagText.value:"",n.contentControlProperties.multiline=o.multilineCheckBox.checked),je(o.currentContentControl)||(o.currentContentControl.contentControlProperties.lockContents=o.contentEditedCheckBox.checked,o.currentContentControl.contentControlProperties.lockContentControl=o.contentDeletedCheckBox.checked,o.currentContentControl.contentControlProperties.isTemporary=o.removeCheckBox.checked,o.removeCheckBox.checked&&(o.currentContentControl.contentControlProperties.lockContents=!1),o.currentContentControl.contentControlProperties.title=void 0!==o.titleText.value?o.titleText.value:"",o.currentContentControl.contentControlProperties.tag=void 0!==o.tagText.value?o.tagText.value:"",o.currentContentControl.contentControlProperties.multiline=o.multilineCheckBox.checked),o.documentHelper.owner.editorHistoryModule&&(o.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo&&(o.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo.modifiedProperties.push(i),n=o.documentHelper.owner.editor.getContentControlPropObject(o.currentContentControl.contentControlProperties),o.documentHelper.owner.editorHistoryModule.currentBaseHistoryInfo.format=JSON.stringify(n)),o.documentHelper.owner.editorHistoryModule.updateHistory()),o.documentHelper.selection.selectRange(e,t),o.unWireEventsAndBindings(),o.documentHelper.dialog.hide(),o.documentHelper.viewer.updateScrollBars(),o.documentHelper.updateFocus(),o.documentHelper.owner.editorModule.fireContentChange()},this.closePropertiesDialog=function(){o.documentHelper.dialog.hide(),o.unWireEventsAndBindings(),o.documentHelper.updateFocus()},this.fontColorUpdate=function(e){je(e.currentValue)||(o.fontColor=e.currentValue.hex)},this.selectHandler=function(e){o.currentSelectedItem=e.text},this.documentHelper=e}agi.prototype.getModuleName=function(){return"PicContentControlDialog"},agi.prototype.show=function(){var e=new Cn("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.localeValue=e,this.documentHelper.dialog2.header=e.getConstant("Insert Pictures"),this.documentHelper.dialog2.showCloseIcon=!0,this.documentHelper.dialog2.allowDragging=!0,this.documentHelper.dialog2.position={X:"center",Y:"center"},this.documentHelper.dialog2.width="auto",this.documentHelper.dialog2.beforeOpen=this.documentHelper.updateFocus,this.documentHelper.dialog2.buttons=[{click:this.onInsertPicClick,buttonModel:{content:e.getConstant("Upload from computer"),iconCss:"e-icons e-de-ctnr-upload",iconPosition:"Left"}}],this.documentHelper.dialog2.dataBind(),this.documentHelper.dialog2.show()},agi.prototype.onImageChange=function(){var e=this,t=this.imagePicker.files[0],i=new FileReader;i.onload=function(){e.insertImage(i.result)},i.readAsDataURL(t)},agi.prototype.insertImage=function(e){this.image=document.createElement("img");var t=this.documentHelper;this.container;this.image.addEventListener("load",function(){t.owner.editorModule.insertImageInternal(e,!0,this.width,this.height,this.alt),t.owner.selection.isImageSelected||(t.owner.selection.handleShiftLeftKey(),t.owner.editor.insertContentControl("Picture"))}),this.image.src=e},agi.prototype.destroy=function(){this.documentHelper=void 0,this.imagePicker&&(this.imagePicker.remove(),this.imagePicker=void 0),this.image&&(this.image.remove(),this.image=void 0)};var sgi=agi;function agi(e){var t=this;this.onCancelButtonClick=function(){t.documentHelper.dialog2.hide(),t.documentHelper.updateFocus()},this.onInsertPicClick=function(){t.documentHelper.dialog2.hide(),t.imagePicker=Q("input",{attrs:{type:"file",accept:".jpg,.jpeg,.png,.bmp,.svg"},className:"e-de-ctnr-file-picker"}),F.isIE&&document.body.appendChild(t.imagePicker),t.imagePicker.value="",t.imagePicker.click(),E.add(t.imagePicker,"change",t.onImageChange,t)},this.documentHelper=e}lgi=function(e,t){return(lgi=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])}))(e,t)};var lgi,hgi,Kmt=function(e,t){function i(){this.constructor=e}lgi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},HOt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},dgi=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},pgi=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},WOt=(Kmt(cgi,hgi=n),HOt([e(null)],cgi.prototype,"popupTarget",void 0),HOt([e("#FFE97F")],cgi.prototype,"searchHighlightColor",void 0),HOt([e(["Algerian","Arial","Calibri","Cambria","Cambria Math","Candara","Courier New","Georgia","Impact","Segoe Print","Segoe Script","Segoe UI","Symbol","Times New Roman","Verdana","Wingdings"])],cgi.prototype,"fontFamilies",void 0),HOt([e({shadingColor:"#cfcfcf",applyShading:!0,selectionColor:"#cccccc",formFillingMode:"Popup"})],cgi.prototype,"formFieldSettings",void 0),HOt([e({interval:2e3,itertationCount:5})],cgi.prototype,"autoResizeSettings",void 0),HOt([e({roomName:"",editableRegionColor:"#22b24b",lockedRegionColor:"#f44336"})],cgi.prototype,"collaborativeEditingSettings",void 0),HOt([e(1)],cgi.prototype,"printDevicePixelRatio",void 0),HOt([e(!0)],cgi.prototype,"enableOptimizedTextMeasuring",void 0),HOt([e(!0)],cgi.prototype,"allowDragAndDrop",void 0),HOt([e(32767)],cgi.prototype,"maximumRows",void 0),HOt([e(63)],cgi.prototype,"maximumColumns",void 0),HOt([e(!1)],cgi.prototype,"showHiddenMarks",void 0),HOt([e(!1)],cgi.prototype,"showBookmarks",void 0),HOt([e(!0)],cgi.prototype,"highlightEditableRanges",void 0),HOt([e(!0)],cgi.prototype,"optimizeSfdt",void 0),HOt([e(!1)],cgi.prototype,"showRuler",void 0),HOt([e({mode:"Picker",modeSwitcher:!0,showButtons:!0})],cgi.prototype,"colorPickerSettings",void 0),HOt([e(!1)],cgi.prototype,"showNavigationPane",void 0),HOt([e({mentionChar:"@"})],cgi.prototype,"mentionSettings",void 0),HOt([e(!1)],cgi.prototype,"pasteAsNewParagraph",void 0),cgi);function cgi(){return null!==hgi&&hgi.apply(this,arguments)||this}Kmt(ggi,ugi=n),HOt([e("Word2013")],ggi.prototype,"compatibilityMode",void 0);var ugi,dNt=ggi;function ggi(){return null!==ugi&&ugi.apply(this,arguments)||this}Kmt(fgi,mgi=n),HOt([e(2e3)],fgi.prototype,"interval",void 0),HOt([e(5)],fgi.prototype,"iterationCount",void 0);var mgi,uNt=fgi;function fgi(){return null!==mgi&&mgi.apply(this,arguments)||this}Kmt(wgi,ygi=Ji),vgi=wgi,Object.defineProperty(wgi.prototype,"enableHeaderAndFooter",{get:function(){return this.enableHeaderFooterIn},set:function(e){!(this.enableHeaderFooterIn=e)&&this.selectionModule&&this.selectionModule.isWebLayout&&(this.selectionModule.isWebLayout=!1),this.viewer.updateScrollBars()},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"pageCount",{get:function(){return!this.isDocumentLoaded||je(this.viewer)||this.viewer instanceof sai?1:this.documentHelper.pages.length},enumerable:!0,configurable:!0}),wgi.prototype.getComments=function(){var e=[];if(0<this.documentHelper.comments.length)for(var t=[],i=0,n=this.documentHelper.comments;i<n.length;i++){for(var o=n[i],t=[],r={author:o.author,isResolved:o.isResolved||!1,dateTime:this.editor.parseDateTime(o.createdDate)},s=0,a=o.replyComments;s<a.length;s++){var l=a[s],h={author:l.author,isResolved:!!l.isResolved&&o.isResolved,dateTime:this.editor.parseDateTime(l.createdDate)},d=Y.parseCommentAsText(l),l=new cJt(l.commentId,h,d);t.push(l)}r={id:o.commentId,text:Y.parseCommentAsText(o),commentProperties:r,replies:t};e.push(r)}return e},Object.defineProperty(wgi.prototype,"selection",{get:function(){return this.selectionModule||this.checkModuleInjection("Selection",this.enableSelection),this.selectionModule},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"editor",{get:function(){return this.editorModule||this.checkModuleInjection("Editor",this.enableEditor),this.editorModule},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"editorHistory",{get:function(){return this.editorHistoryModule||this.checkModuleInjection("EditorHistory",this.enableEditorHistory),this.editorHistoryModule},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"search",{get:function(){return this.searchModule||this.checkModuleInjection("Search",this.enableSearch),this.searchModule},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"contextMenu",{get:function(){return this.contextMenuModule||this.checkModuleInjection("ContextMenu",this.enableContextMenu),this.contextMenuModule},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"spellCheckDialog",{get:function(){return this.spellCheckDialogModule||this.checkModuleInjection("SpellCheck",this.enableSpellCheck),this.spellCheckDialogModule},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"spellChecker",{get:function(){return this.spellCheckerModule||this.checkModuleInjection("SpellCheck",this.enableSpellCheck),this.spellCheckerModule},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"containerId",{get:function(){return this.element.id},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"isDocumentLoaded",{get:function(){return this.isDocumentLoadedIn},set:function(e){this.isDocumentLoadedIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"isDocumentEmpty",{get:function(){if(1===this.documentHelper.pages.length){var e=this.documentHelper.pages[0],t=e.headerWidget,i=e.footerWidget,n=!0,o=!0;if(je(t)||je(t.firstChild)||t.firstChild instanceof Lai&&t.firstChild.isEmpty()||(n=!1),je(i)||je(i.firstChild)||i.firstChild instanceof Lai&&i.firstChild.isEmpty()||(o=!1),n&&o){t=e.bodyWidgets[0];if(je(t.nextWidget)){i=t.firstChild;if(i instanceof Lai&&i.isEmpty()&&je(i.nextWidget))return!0}}}return!1},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"revisions",{get:function(){return je(this.revisionsInternal)&&(this.revisionsInternal=new Iri(this)),this.revisionsInternal},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"enableHistoryMode",{get:function(){return this.enableEditorHistory&&!je(this.editorHistoryModule)},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"documentStart",{get:function(){if(!je(this.selectionModule))return this.selectionModule.getDocumentStart();this.checkModuleInjection("Selection",this.enableSelection)},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"documentEnd",{get:function(){if(!je(this.selectionModule))return this.selectionModule.getDocumentEnd();this.checkModuleInjection("Selection",this.enableSelection)},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"isReadOnlyMode",{get:function(){return this.isReadOnly||je(this.editorModule)||je(this.selectionModule)||!je(this.editorModule)&&this.editorModule.restrictEditing},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"isSpellCheck",{get:function(){return this.enableSpellCheck&&this.spellCheckerModule.enableSpellCheck},enumerable:!0,configurable:!0}),Object.defineProperty(wgi.prototype,"enableImageResizerMode",{get:function(){return this.enableImageResizer&&!je(this.imageResizerModule)},enumerable:!0,configurable:!0}),wgi.prototype.preRender=function(){var e=this;this.documentEditorSettings&&this.documentEditorSettings.enableOptimizedTextMeasuring?vgi.Inject(Fui):vgi.Inject(Rui),this.findResultsList=[],setTimeout(function(){je(e.documentEditorSettings.popupTarget)&&(e.documentEditorSettings.popupTarget=document.body)},0),je(this.element)||""!==this.element.id||(this.element.id=Y.getUniqueElementId()),this.refreshing&&this.initHelper()},wgi.prototype.updateExternalStyle=function(){var e,t,i=this;this.externalFonts&&0<this.externalFonts.length&&(this.clearExistingStyles(),(e=document.createElement("style")).type="text/css",e.id="e-de-custom-font-styles",t="",this.externalFonts.forEach(function(e){e.src&&e.fontFamily&&!i.parser.isFontInstalled(e.fontFamily)&&(t+="@font-face {font-family: '"+e.fontFamily+"'; src: "+e.src+"}")}),t)&&(e.appendChild(document.createTextNode(t)),document.head.appendChild(e),e.onload=function(){var i=this;this.externalFonts.forEach(function(e){var t;e.src&&e.fontFamily&&!i.parser.isFontInstalled(e.fontFamily)&&(rt(t=document.createElement("div"),"position:absolute;top:-1000px;left:-1000px;opacity:0;font-size:0px;line-height:normal;"),t.textContent="test font",t.style.fontFamily='"'+e.fontFamily+'"',document.body.appendChild(t))})}.bind(this))},wgi.prototype.clearExistingStyles=function(){var t=document.head;t.querySelectorAll("style#e-de-custom-font-styles").forEach(function(e){t.removeChild(e)})},wgi.prototype.initHelper=function(){this.documentHelper=new Zsi(this),"Pages"===this.layoutType?this.viewer=new nai(this):this.viewer=new sai(this),this.parser=new Nui(this.documentHelper)},wgi.prototype.render=function(){var e;je(this.element)||((e=this.element).style.minHeight="200px",e.style.minWidth="200px",""!==this.height&&(this.element.style.height=T(this.height)),""!==this.width&&(this.element.style.width=T(this.width))),this.textMeasureHelper=this.optimizedModule||this.regularModule,je(this.textMeasureHelper)&&(this.textMeasureHelper=new Fui(this.documentHelper)),this.documentHelper.initializeComponents(),this.openBlank(),this.renderComplete(),this.renderRulers(),this.renderNavigationPane(),this.createdTriggered=!0},wgi.prototype.renderRulers=function(){this.rulerHelper=new egi,this.rulerContainer=this.rulerHelper.renderOverlapElement(this),this.rulerHelper.renderRuler(this,!0),this.rulerHelper.renderRuler(this,!1),this.rulerHelper.renderRulerMarkerIndicatorElement(this),this.rulerHelper.createIndicatorLines(this),this.showHideRulers()},wgi.prototype.showHideRulers=function(){var e;this.rulerHelper&&this.documentEditorSettings&&!je(!this.documentEditorSettings.showRuler)&&(e=this.documentEditorSettings.showRuler&&!this.isReadOnlyMode,this.rulerHelper.hideTabStopSwitch(e),this.rulerHelper.hideRulerBottom(e),this.vRuler&&this.vRuler.showHideRuler(e),this.hRuler)&&this.hRuler.showHideRuler(e)},wgi.prototype.renderNavigationPane=function(){!this.isReadOnly&&this.optionsPaneModule&&this.optionsPaneModule.showHideOptionsPane(this.documentEditorSettings.showNavigationPane)},wgi.prototype.getModuleName=function(){return"DocumentEditor"},wgi.prototype.onPropertyChanged=function(e,t){for(var i,n,o=this,r=0,s=Object.keys(e);r<s.length;r++)switch(s[r]){case"enableTrackChanges":this.notify(iZt,e),this.getSettingData("enableTrackChanges",e.enableTrackChanges),this.documentHelper.isTrackedOnlyMode&&!e.enableTrackChanges&&(this.enableTrackChanges=!0);break;case"autoResizeOnVisibilityChange":e.autoResizeOnVisibilityChange&&this.documentHelper.triggerAutoResizeInterval();break;case"zoomFactor":this.viewer&&t.zoomFactor!==e.zoomFactor&&(this.documentHelper.zoomFactor=e.zoomFactor,this.rulerHelper&&this.documentEditorSettings&&this.documentEditorSettings.showRuler&&this.rulerHelper.updateRuler(this,!0),this.enableCollaborativeEditing)&&this.collaborativeEditingHandlerModule&&this.collaborativeEditingHandlerModule.updateCaretPosition();break;case"layoutType":this.selectionModule&&this.selectionModule.isWebLayout||(this.viewer.destroy(),"Pages"===this.layoutType?this.viewer=new nai(this):(!0===this.enableHeaderAndFooter&&this.selectionModule.closeHeaderFooter(),this.viewer=new sai(this)),this.selectionModule.start.paragraph.containerWidget instanceof Pai&&(this.selectionModule.clearSelectionHighlightInSelectedWidgets(),this.selectionModule.selectContent(this.documentStart,!0)),this.editorModule.layoutWholeDocument(!0),this.selectionModule.onHighlight(),setTimeout(function(){o.fireViewChange()},200));break;case"locale":this.localizeDialogs();break;case"isReadOnly":!je(this.optionsPaneModule)&&this.optionsPaneModule.isOptionsPaneShow&&(this.optionsPaneModule.showHideOptionsPane(!1),this.documentHelper.updateFocus()),this.showComments&&this.commentReviewPane.showHidePane(!0,"Comments"),this.commentReviewPane.enableDisableItems(),this.trackChangesPane.enableDisableButton(!this.isReadOnly&&!this.documentHelper.isDocumentProtected),this.showHideRulers();break;case"currentUser":case"userColor":this.selectionModule&&this.documentHelper.isDocumentProtected&&this.selectionModule.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&&e.showComments!==t.showComments&&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.documentHelper.showRevisions(!1):this.viewer&&this.documentHelper.showRevisions(e.showRevisions),this.viewer.updateScrollBars();break;case"documentSettings":je(e.documentSettings.compatibilityMode)||(i=t.documentSettings.compatibilityMode,n=e.documentSettings.compatibilityMode,("Word2013"==i&&"Word2013"!=n||"Word2013"!=i&&"Word2013"==n)&&this.documentHelper.compatibilityMode!==n&&(this.documentHelper.compatibilityMode=n,this.editorModule.layoutWholeDocument(!0))),this.viewer.updateScrollBars();break;case"documentEditorSettings":je(e.documentEditorSettings.enableOptimizedTextMeasuring)||(this.documentHelper.heightInfoCollection={},e.documentEditorSettings.enableOptimizedTextMeasuring?this.textMeasureHelper=this.optimizedModule:this.textMeasureHelper=this.regularModule,this.viewer.updateScrollBars()),(!je(e.documentEditorSettings.showHiddenMarks)&&e.documentEditorSettings.showHiddenMarks!==t.documentEditorSettings.showHiddenMarks||!je(e.documentEditorSettings.showBookmarks)&&e.documentEditorSettings.showBookmarks!==t.documentEditorSettings.showBookmarks)&&(this.trackChangesPane&&this.trackChangesPane.showHiddenParaMark(),this.viewer.updateScrollBars()),je(e.documentEditorSettings.highlightEditableRanges)||this.documentHelper&&this.documentHelper.restrictEditingPane&&(this.documentHelper.restrictEditingPane.highlightCheckBox.checked=e.documentEditorSettings.highlightEditableRanges,this.documentHelper.selection.isHighlightEditRegion=e.documentEditorSettings.highlightEditableRanges),je(e.documentEditorSettings.colorPickerSettings)||e.documentEditorSettings.colorPickerSettings&&this.applyColorPickerProperties(e),je(e.documentEditorSettings.showRuler)||(this.showHideRulers(),e.documentEditorSettings.showRuler&&this.rulerHelper.updateRuler(this,!0)),je(e.documentEditorSettings.showNavigationPane)||!this.isReadOnly&&this.optionsPaneModule&&this.optionsPaneModule.showHideOptionsPane(this.documentEditorSettings.showNavigationPane),this.enableCollaborativeEditing&&this.collaborativeEditingHandlerModule&&this.collaborativeEditingHandlerModule.updateCaretPosition(),je(e.documentEditorSettings.pasteAsNewParagraph)||(this.documentEditorSettings.pasteAsNewParagraph=e.documentEditorSettings.pasteAsNewParagraph);break;case"height":this.element.style.height=T(this.height),this.resize();break;case"width":this.element.style.width=T(this.width),this.resize();break;case"enableAutoFocus":this.enableAutoFocus=e.enableAutoFocus}},wgi.prototype.applyColorPickerProperties=function(e){var t;e.documentEditorSettings.colorPickerSettings&&(t=e.documentEditorSettings.colorPickerSettings,!this.isReadOnly&&!je(t)&&this.bordersAndShadingDialogModule&&this.documentHelper.borderColorPicker&&this.documentHelper.shadingColorPicker&&(je(t.mode)||(this.documentHelper.borderColorPicker.mode=e.documentEditorSettings.colorPickerSettings.mode,this.documentHelper.shadingColorPicker.mode=e.documentEditorSettings.colorPickerSettings.mode),je(t.showButtons)||(this.documentHelper.borderColorPicker.showButtons=e.documentEditorSettings.colorPickerSettings.showButtons,this.documentHelper.shadingColorPicker.showButtons=e.documentEditorSettings.colorPickerSettings.showButtons),je(t.modeSwitcher)||(this.documentHelper.borderColorPicker.modeSwitcher=e.documentEditorSettings.colorPickerSettings.modeSwitcher,this.documentHelper.shadingColorPicker.modeSwitcher=e.documentEditorSettings.colorPickerSettings.modeSwitcher)),!this.isReadOnly&&!je(t)&&this.fontDialogModule&&this.documentHelper.fontColor&&(je(t.mode)||(this.documentHelper.fontColor.mode=e.documentEditorSettings.colorPickerSettings.mode),je(t.showButtons)||(this.documentHelper.fontColor.showButtons=e.documentEditorSettings.colorPickerSettings.showButtons),je(t.modeSwitcher)||(this.documentHelper.fontColor.modeSwitcher=e.documentEditorSettings.colorPickerSettings.modeSwitcher)),!this.isReadOnly&&!je(t)&&this.styleDialogModule&&this.documentHelper.colorPicker&&(je(t.mode)||(this.documentHelper.colorPicker.mode=e.documentEditorSettings.colorPickerSettings.mode),je(t.showButtons)||(this.documentHelper.colorPicker.showButtons=e.documentEditorSettings.colorPickerSettings.showButtons),je(t.modeSwitcher)||(this.documentHelper.colorPicker.modeSwitcher=e.documentEditorSettings.colorPickerSettings.modeSwitcher)),je(t)||(je(t.mode)||(this.documentHelper.fontColorInputElement.mode=e.documentEditorSettings.colorPickerSettings.mode,this.documentHelper.shadingBtn.mode=e.documentEditorSettings.colorPickerSettings.mode,this.documentHelper.borderBtn.mode=e.documentEditorSettings.colorPickerSettings.mode),je(t.showButtons)||(this.documentHelper.fontColorInputElement.showButtons=e.documentEditorSettings.colorPickerSettings.showButtons,this.documentHelper.shadingBtn.showButtons=e.documentEditorSettings.colorPickerSettings.showButtons,this.documentHelper.borderBtn.showButtons=e.documentEditorSettings.colorPickerSettings.showButtons),je(t.modeSwitcher))||(this.documentHelper.fontColorInputElement.modeSwitcher=e.documentEditorSettings.colorPickerSettings.modeSwitcher,this.documentHelper.shadingBtn.modeSwitcher=e.documentEditorSettings.colorPickerSettings.modeSwitcher,this.documentHelper.borderBtn.modeSwitcher=e.documentEditorSettings.colorPickerSettings.modeSwitcher))},wgi.prototype.localizeDialogs=function(e){var t;""!==this.locale&&((t=new Cn("documenteditor",this.defaultLocale)).setLocale(this.locale),je(e)||(this.documentHelper.dialog.enableRtl=e,this.documentHelper.dialog2.enableRtl=e),this.optionsPaneModule&&this.optionsPaneModule.initOptionsPane(t,e),this.paragraphDialogModule&&this.paragraphDialogModule.initParagraphDialog(t),this.footNotesDialogModule&&this.footNotesDialogModule.notesDialog(t,e),this.pageSetupDialogModule&&this.pageSetupDialogModule.initPageSetupDialog(t,e),this.columnsDialogModule&&this.columnsDialogModule.initColumnsDialog(t,e),this.fontDialogModule&&this.fontDialogModule.initFontDialog(t,e),this.hyperlinkDialogModule&&this.hyperlinkDialogModule.initHyperlinkDialog(t,e),this.contextMenuModule&&(this.contextMenuModule.contextMenuInstance.destroy(),this.contextMenuModule.initContextMenu(t,e)),this.listDialogModule&&this.listDialogModule.initListDialog(t,e),this.tablePropertiesDialogModule&&this.tablePropertiesDialogModule.initTablePropertyDialog(t,e),this.bordersAndShadingDialogModule&&this.bordersAndShadingDialogModule.initBordersAndShadingsDialog(t,e),this.cellOptionsDialogModule&&this.cellOptionsDialogModule.initCellMarginsDialog(t,e),this.tableOptionsDialogModule&&this.tableOptionsDialogModule.initTableOptionsDialog(t,e),this.tableDialogModule&&this.tableDialogModule.initTableDialog(t),this.styleDialogModule&&this.styleDialogModule.initStyleDialog(t,e),this.tabDialogModule&&this.tabDialogModule.initTabsDialog(t,e),this.tableOfContentsDialogModule&&this.tableOfContentsDialogModule.initTableOfContentDialog(t,e),this.commentReviewPane)&&this.commentReviewPane.parentPaneElement&&(this.enableRtl?mt(this.commentReviewPane.parentPaneElement,["e-rtl"],[]):mt(this.commentReviewPane.parentPaneElement,[],["e-rtl"]))},wgi.prototype.setDefaultCharacterFormat=function(e){this.characterFormat=JSON.parse(Y.sanitizeString(JSON.stringify(e))),this.documentHelper.setDefaultDocumentFormat(),je(this.selectionModule)||this.selectionModule.retrieveCurrentFormatProperties()},wgi.prototype.setDefaultParagraphFormat=function(e){this.paragraphFormat=JSON.parse(Y.sanitizeString(JSON.stringify(e))),this.documentHelper.setDefaultDocumentFormat(),je(this.selectionModule)||this.selectionModule.retrieveCurrentFormatProperties()},wgi.prototype.setDefaultSectionFormat=function(e){this.sectionFormat=JSON.parse(Y.sanitizeString(JSON.stringify(e))),this.documentHelper.setDefaultDocumentFormat(),je(this.selectionModule)||this.selectionModule.retrieveCurrentFormatProperties()},wgi.prototype.getPersistData=function(){return"documenteditor"},wgi.prototype.clearPreservedCollectionsInViewer=function(){this.viewer instanceof eai&&this.documentHelper.clearDocumentItems()},wgi.prototype.getDocumentEditorElement=function(){return this.element},wgi.prototype.fireContentChange=function(){if(!this.enableEditor||!this.editorModule.isIncrementalSave){this.enableLockAndEdit&&this.collaborativeEditingModule&&this.collaborativeEditingModule.saveContent();var e,t={source:this};if(this.enableCollaborativeEditing)if(t.operations=[],this.isSettingOp)t.operations=this.documentSettingOps,this.documentSettingOps=[],this.isSettingOp=!1;else if(!je(this.editorHistoryModule))if(je(this.editorHistoryModule.currentHistoryInfo)||"IMEInput"!==this.editorHistoryModule.currentHistoryInfo.action?je(this.editorHistoryModule.lastOperation)||("IMEInput"===(e=this.editorHistoryModule.lastOperation).action?t.operations=e.getActionInfo(!0):t.operations=e.getActionInfo(),this.editorHistoryModule.lastOperation=void 0):t.operations=this.editorHistoryModule.currentHistoryInfo.getActionInfo(),this.enableTrackChanges&&0<t.operations.length)for(var i=0;i<t.operations.length;i++)je(t.operations[i].markerData)&&(t.operations[i].markerData={}),!je(t.operations[i].markerData.author)&&""!==t.operations[i].markerData.author||(t.operations[i].markerData.author=this.currentUser);this.trigger(CJt,t)}},wgi.prototype.fireDocumentChange=function(){this.enableLockAndEdit&&this.enableEditor&&this.editorModule.enforceProtection("",!1,!0),this.trigger(SJt,{source:this})},wgi.prototype.fireSelectionChange=function(){var e;this.enableEditor&&this.editorModule.isIncrementalSave||(!this.documentHelper.isCompositionStart&&F.isDevice&&this.editorModule&&this.editorModule.predictText(),e={source:this,isCompleted:this.documentHelper.isCompleted},this.trigger(AJt,e),this.documentHelper.isSelectionCompleted=this.documentHelper.isCompleted,this.documentHelper.isCompleted=!0)},wgi.prototype.fireZoomFactorChange=function(){var e={source:this};this.trigger(xJt,e),this.notify(wJt,e)},wgi.prototype.fireOptionPaneChange=function(e){this.notify(nZt,{show:e})},wgi.prototype.fireBeformFieldFill=function(){this.trigger(IJt,{})},wgi.prototype.fireAfterFormFieldFill=function(){this.trigger(TJt,{})},wgi.prototype.fireBeforeContentControlFill=function(){this.trigger(LJt,{})},wgi.prototype.fireAfterContentControlFill=function(){this.trigger(RJt,{})},wgi.prototype.fireServiceFailure=function(e){this.trigger(MJt,e)},wgi.prototype.fireViewChange=function(){var e;this.viewer&&0<this.documentHelper.pages.length&&0<this.viewer.visiblePages.length&&(e={startPage:(e=this.viewer.visiblePages)[0].index+1,endPage:e[e.length-1].index+1,source:this},this.trigger(kJt,e),this.notify(YJt,e))},wgi.prototype.fireCustomContextMenuSelect=function(e){this.trigger(PJt,{id:e})},wgi.prototype.fireCustomContextMenuBeforeOpen=function(e){this.trigger(BJt,{ids:e})},wgi.prototype.showParagraphDialog=function(e){this.paragraphDialogModule&&!this.isReadOnlyMode&&this.viewer?this.paragraphDialogModule.show(e):this.checkModuleInjection("ParagraphDialog",this.enableParagraphDialog)},wgi.prototype.showPageSetupDialog=function(){this.pageSetupDialogModule&&!this.isReadOnlyMode&&this.viewer?this.pageSetupDialogModule.show():this.checkModuleInjection("PageSetupDialog",this.enablePageSetupDialog)},wgi.prototype.showColumnsDialog=function(){this.columnsDialogModule&&!this.isReadOnlyMode&&this.viewer?this.columnsDialogModule.show():this.checkModuleInjection("ColumnsDialog",this.enableColumnsDialog)},wgi.prototype.showFootNotesDialog=function(){this.footNotesDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.footNotesDialogModule.show()},wgi.prototype.showFontDialog=function(e){this.fontDialogModule&&!this.isReadOnlyMode&&this.viewer?this.fontDialogModule.showFontDialog(e):this.checkModuleInjection("FontDialog",this.enableFontDialog)},wgi.prototype.showCellOptionsDialog=function(){this.cellOptionsDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.cellOptionsDialogModule.show()},wgi.prototype.showTableOptionsDialog=function(){this.tableOptionsDialogModule&&!this.isReadOnlyMode&&this.viewer?this.tableOptionsDialogModule.show():this.checkModuleInjection("TableOptionsDialog",this.enableTableOptionsDialog)},wgi.prototype.showTableDialog=function(){this.tableDialogModule&&!this.isReadOnlyMode&&this.viewer?this.tableDialogModule.show():this.checkModuleInjection("TableDialog",this.enableTableDialog)},wgi.prototype.showDateContentDialog=function(){this.dateContentDialogModule&&!this.isReadOnlyMode&&this.viewer?this.dateContentDialogModule.show():this.checkModuleInjection("DateContentDialog",this.enableDateContentDialog)},wgi.prototype.showPicContentControlDialog=function(){var e=this.getImageContentControl(),t=this.picturePositionY;this.selection.isEmpty&&this.renderPictureContentControlElement(this,!0,!0,t),this.selection.isImageSelected&&(this.renderPictureContentControlElement(this,!0,!0,t),e instanceof Pli&&"Picture"!=e.contentControlProperties.type||this.editor.insertContentControl("Picture"))},wgi.prototype.showpicContentControlDialogModule=function(){this.picContentControlDialogModule&&!this.isReadOnlyMode&&this.viewer?this.picContentControlDialogModule.show():this.checkModuleInjection("PicContentControlDialog",this.enablePicContentControlDialog)},wgi.prototype.renderPictureContentControlElement=function(e,t,i,n){var o,r,s,a,l=this;this.enableSelection&&(o={id:this.element.id+"PICTURE_CONTENT_CONTROL",innerHTML:"Picture",class:"e-btn-icon e-icons e-de-ctnr-image e-icon-left",style:"height:20px;width:70px;z-index:5;position:absolute;background-color:#ccc;border:1px solid #ccc;display:"},a=document.getElementById(this.element.id+"_viewerContainer"),je(s=document.getElementById(this.element.id+"PICTURE_CONTENT_CONTROL"))&&t||i?(o=this.rulerHelper.createHtmlElement("div",o),this.setPictureContentControlPositions(o),a.insertBefore(o,a.firstChild),o.style.display="block",o.addEventListener("click",function(e){!je(r=l.getImageContentControl())&&"Picture"==r.contentControlProperties.type||l.picContentControlDialogModule.show()})):je(s)||!t||i?je(s)||t||i||(s.style.display="none"):(s.style.display="block",this.setPictureContentControlPositions(s),s.addEventListener("click",function(e){(r=l.getImageContentControl())instanceof Pli&&!r.contentControlProperties.lockContentControl&&"Picture"==r.contentControlProperties.type&&!l.documentHelper.owner.isReadOnlyMode&&l.picContentControlDialogModule.show()})),(a=new Cn("documenteditor",this.defaultLocale)).setLocale(this.locale),a.getConstant("Picture"))},wgi.prototype.setPictureContentControlPositions=function(e){var t=(this.selection.isForward?this.selection.start:this.selection.end).location.x,i=this.selection.getTop(this.documentHelper.selection.start.currentWidget);e.style.left=(t*this.documentHelper.zoomFactor+this.documentHelper.pages[0].boundingRectangle.x).toString()+"px",e.style.top=(i*this.documentHelper.zoomFactor).toString()+"px"},wgi.prototype.getImageContentControl=function(){for(var e,t=this.documentHelper.owner.selectionModule.start.currentWidget.paragraph,i=0;i<t.childWidgets.length;i++)for(var n=0;n<t.childWidgets[i].children.length;n++){var o=t.childWidgets[i].children[n];if(o instanceof Pli&&0==o.type&&"Picture"==o.contentControlProperties.type){e=t.childWidgets[i].children[n];break}}return e},wgi.prototype.showContentPropertiesDialog=function(){this.contentControlPropertiesDialogModule&&!this.isReadOnlyMode&&this.viewer?this.contentControlPropertiesDialogModule.show():this.checkModuleInjection("ContentControlPropertiesDialog",this.enableContentControlPropertiesDialog)},wgi.prototype.showTableOfContentsDialog=function(){this.tableOfContentsDialogModule&&!this.isReadOnlyMode&&this.viewer?this.tableOfContentsDialogModule.show():this.checkModuleInjection("TableOfContentsDialog",this.enableTableOfContentsDialog)},wgi.prototype.showStyleDialog=function(){this.styleDialogModule&&!this.isReadOnlyMode&&this.viewer?this.styleDialogModule.show():this.checkModuleInjection("StyleDialog",this.enableStyleDialog)},wgi.prototype.showHyperlinkDialog=function(){this.hyperlinkDialogModule&&!this.isReadOnlyMode&&this.viewer?this.hyperlinkDialogModule.show():this.checkModuleInjection("HyperlinkDialog",this.enableHyperlinkDialog)},wgi.prototype.showBookmarkDialog=function(){this.bookmarkDialogModule&&!this.isReadOnlyMode&&this.viewer?this.bookmarkDialogModule.show():this.checkModuleInjection("BookmarkDialog",this.enableBookmarkDialog)},wgi.prototype.showStylesDialog=function(){this.stylesDialogModule&&!this.isReadOnlyMode&&this.viewer?this.stylesDialogModule.show():this.checkModuleInjection("StylesDialog",this.enableStyleDialog)},wgi.prototype.showListDialog=function(){this.listDialogModule&&!this.isReadOnlyMode&&this.viewer?this.listDialogModule.showListDialog():this.checkModuleInjection("ListDialog",this.enableListDialog)},wgi.prototype.showTablePropertiesDialog=function(){this.tablePropertiesDialogModule&&!this.isReadOnlyMode&&this.viewer?this.tablePropertiesDialogModule.show():this.checkModuleInjection("TablePropertiesDialog",this.enableTablePropertiesDialog)},wgi.prototype.showBordersAndShadingDialog=function(){this.bordersAndShadingDialogModule&&!this.isReadOnlyMode&&this.viewer?this.bordersAndShadingDialogModule.show():this.checkModuleInjection("BordersAndShadingDialog",this.enableBordersAndShadingDialog)},wgi.prototype.requiredModules=function(){var e=[];return this.enableCollaborativeEditing&&e.push({member:"CollaborativeEditingHandler",args:[this]}),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.documentEditorSettings&&this.documentEditorSettings.enableOptimizedTextMeasuring?(vgi.Inject(Fui),e.push({member:"Optimized",args:[this.documentHelper]})):(vgi.Inject(Rui),e.push({member:"Regular",args:[this.documentHelper]})),this.enableEditor&&(e.push({member:"Editor",args:[this.documentHelper]}),e.push({member:"XmlPane",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.enableDateContentDialog&&e.push({member:"DateContentDialog",args:[this.documentHelper]}),this.enablePicContentControlDialog&&e.push({member:"PicContentControlDialog",args:[this.documentHelper]}),this.enableContentControlPropertiesDialog&&e.push({member:"ContentControlPropertiesDialog",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.enableColumnsDialog&&e.push({member:"ColumnsDialog",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]}),e.push({member:"TabDialog",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},wgi.prototype.checkModuleInjection=function(e,t){if(!t&&!this.isReadOnly)throw console.warn('[WARNING] :: Module "'+e+'" is not available in Document Editor component! You either misspelled the module name or forgot to load it.'),new Error("Inject "+e+" module")},wgi.prototype.open=function(e){kA(this.element);try{je(e)||this.openInternal(e,!1)}catch(e){this.failureHandler("onError")}},wgi.prototype.openAsync=function(e){kA(this.element);try{je(e)||this.openInternal(e,!0)}catch(e){this.failureHandler("onError")}},wgi.prototype.openInternal=function(t,e){var i=this,n=this.isValidUrl(t);null!==n?this.getSfdtFromUrl(t,n).then(function(e){t=e,i.processSfdt(t)}).catch(function(e){console.error(e)}):this.isValidBase64(t)?this.getSfdtFromBase64string(t).then(function(e){t=e,i.processSfdt(t)}).catch(function(e){console.error(e)}):t instanceof File?this.convertToSfdt(t).then(function(e){t=e,i.processSfdt(t)}).catch(function(e){console.error(e)}):t instanceof Blob?"sfdt"===(n=t.type.split("/"))[n.length-1]?this.convertFromSfdtBlob(t).then(function(e){t=e,i.processSfdt(t)}).catch(function(e){console.error(e)}):this.convertFromBlob(t).then(function(e){t=e,i.processSfdt(t)}).catch(function(e){console.error(e)}):e?setTimeout(function(){try{i.processSfdt(t)}catch(e){i.failureHandler("onError")}},50):this.processSfdt(t)},wgi.prototype.processSfdt=function(e){var t;je(this.viewer)||je(e)||(this.clearPreservedCollectionsInViewer(),this.documentHelper.userCollection.push("Everyone"),this.documentHelper.lists=[],this.documentHelper.abstractLists=[],this.documentHelper.styles=new Gri,this.documentHelper.cachedPages=[],this.clearSpellCheck(),this.isSpellCheck&&this.isSpellCheck&&!this.spellCheckerModule.enableOptimizedSpellCheck&&(this.documentHelper.triggerElementsOnLoading=!0,this.documentHelper.triggerSpellCheck=!0),!je(e)&&this.viewer&&(t=this.parser.convertJsonToDocument(e,e={}),this.documentHelper.setDefaultDocumentFormat(),this.documentHelper.onDocumentChanged(t,e)),this.isSpellCheck&&this.isSpellCheck&&!this.spellCheckerModule.enableOptimizedSpellCheck&&(this.documentHelper.triggerElementsOnLoading=!1,this.documentHelper.triggerSpellCheck=!1)),BA(this.element)},wgi.prototype.isValidUrl=function(e){try{return new URL(e).pathname.split("/").pop()||null}catch(e){return null}},wgi.prototype.isValidBase64=function(e){try{var t=atob(e);return btoa(t)===e}catch(e){return!1}},wgi.prototype.getSfdtFromUrl=function(t,s){return dgi(this,void 0,void 0,function(){var r;return pgi(this,function(e){return r=this,[2,new Promise(function(n,e){var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(){return dgi(this,void 0,void 0,function(){var t,i;return pgi(this,function(e){switch(e.label){case 0:return 200!==o.status?[3,2]:(i=o.response,(t=new FormData).append("file",i,s),[4,r.send(t)]);case 1:i=e.sent(),n(i),e.label=2;case 2:return[2]}})})},o.onerror=function(){e(null)},o.send()})]})})},wgi.prototype.convertToSfdt=function(i){return dgi(this,void 0,void 0,function(){var t;return pgi(this,function(e){switch(e.label){case 0:return(t=new FormData).append("files",i),[4,this.send(t)];case 1:return[2,e.sent()]}})})},wgi.prototype.getSfdtFromBase64string=function(s){return dgi(this,void 0,void 0,function(){var t,i,n,o,r;return pgi(this,function(e){switch(e.label){case 0:for(t=atob(s),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[parseInt(n.toString(),10)]=t.charCodeAt(parseInt(n.toString(),10));return o=new Blob([i],{type:"application/octet-stream"}),(r=new FormData).append("file",o),[4,this.send(r)];case 1:return[2,e.sent()]}})})},wgi.prototype.convertFromBlob=function(n){return dgi(this,void 0,void 0,function(){var t,i;return pgi(this,function(e){switch(e.label){case 0:return t=new FormData,i=""===(i=this.getBlobType(n.type))?n.type:i,t.append("files",n,i),[4,this.send(t)];case 1:return[2,e.sent()]}})})},wgi.prototype.getBlobType=function(e){var t="";switch(e){case"text/html":t=".html";break;case"text/plain":t=".txt";break;case"application/rtf":t=".rtf";break;case"application/xml":t=".xml";break;case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":t=".dotx";break;case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":t=".docx";break;case"application/msword":t=".doc";break;case"application/vnd.ms-word.document.macroEnabled.12":t=".docm";break;case"application/vnd.ms-word.template.macroenabled.12":t=".dotm";break;case"application/vnd.oasis.opendocument.text":t=".odt"}return t},wgi.prototype.send=function(o){var r=this,s=this.serviceUrl+this.serverActionSettingsImport;return new Promise(function(t,e){var i=new vJt,n=(i.url=s,i.onSuccess=function(e){t(e.data)},i.onFailure=r.failureHandler.bind(r),i.onError=r.failureHandler.bind(r),i.customHeaders=r.headers,{serverActionType:r.serverActionSettingsImport,headers:r.headers,timeout:0,cancel:!1,withCredentials:!1});r.trigger(XJt,n),n.cancel?e(null):i.send(o,n)})},wgi.prototype.convertFromSfdtBlob=function(i){return new Promise(function(t){var e=new FileReader;e.onload=function(e){e=e.target.result;t(e)},e.readAsText(i)})},wgi.prototype.failureHandler=function(e){BA(this.element);var t=new Cn("documenteditor",this.defaultLocale),i={status:"onError"===e.name?t.getConstant("Error in establishing connection with web server"):t.getConstant("Failed to load the file"),hideOpenFailedPopup:!1};this.trigger(oZt,i),i.hideOpenFailedPopup||("onError"===e.name?WC.alert({content:t.getConstant("Error in establishing connection with web server"),closeOnEscape:!0,showCloseIcon:!0,position:{X:"center",Y:"center"}}).enableRtl=this.enableRtl:"onError"===e&&alert(t.getConstant("Failed to load the file")))},wgi.prototype.scrollToPage=function(e){return!(je(this.viewer)||e<1||e>this.documentHelper.pages.length||(this.viewer.scrollToPage(e-1),0))},wgi.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.enableDateContentDialog=this.enablePicContentControlDialog=this.enableContentControlPropertiesDialog=this.enableListDialog=this.enableParagraphDialog=this.enableFontDialog=this.enableTablePropertiesDialog=this.enableBordersAndShadingDialog=this.enableTableOptionsDialog=this.enableSpellCheck=this.enableComment=this.enableFormField=this.enableColumnsDialog=!0,vgi.Inject(rri,Wui,_ui,zui,kui,iui,Nci,Vci,Pci,opi,oui,cpi,gpi,Yui,fpi,vpi,wpi,kpi,Dpi,Spi,nci,igi,sgi,ogi,Bpi,Lpi,Opi,Vpi,Hpi,jpi,Qpi,Pui,qpi,Ypi,Kpi,Zpi,tci,Qci)},wgi.prototype.resize=function(e,t){this.element&&(!je(e)&&200<e&&(this.element.style.width=e+"px"),!je(t)&&200<t&&(this.element.style.height=t+"px"),this.viewer&&this.documentHelper.updateViewerSize(),this.trackChangesPane.toolbar&&this.trackChangesPane.toolbar.refreshOverflow(),this.optionsPaneModule)&&this.optionsPaneModule.refreshHeadingPaneHeight(),this.rulerHelper&&this.documentEditorSettings&&this.documentEditorSettings.showRuler&&this.rulerHelper.updateRuler(this,!1),this.enableCollaborativeEditing&&this.collaborativeEditingHandlerModule&&this.collaborativeEditingHandlerModule.updateCaretPosition()},wgi.prototype.triggerResize=function(){var e=this;this&&setTimeout(function(){e&&e.resize()},10)},wgi.prototype.getFormFieldNames=function(){for(var e=[],t=this.documentHelper.formFields,i=0;i<t.length;i++)""!==t[parseInt(i.toString(),10)].formFieldData.name&&e.push(t[parseInt(i.toString(),10)].formFieldData.name);return e},wgi.prototype.getFormFieldInfo=function(e){for(var t=this.documentHelper.formFields,i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].formFieldData.name===e&&""!==t[parseInt(i.toString(),10)].formFieldData.name)return t[parseInt(i.toString(),10)].formFieldData.getFormFieldInfo()},wgi.prototype.setFormFieldInfo=function(e,t){e=Y.sanitizeString(e);for(var i,n=this.documentHelper.formFields,o=0;o<n.length;o++)if(n[parseInt(o.toString(),10)].formFieldData.name===e&&""!==n[parseInt(o.toString(),10)].formFieldData.name)return i=n[parseInt(o.toString(),10)],void(this.selectionModule?(this.selectionModule.selectFieldInternal(i),this.editorModule?this.editorModule.setFormField(i,t):this.checkModuleInjection("Editor",this.enableEditor)):this.checkModuleInjection("Selection",this.enableSelection))},wgi.prototype.resetFormFields=function(e){this.editorModule||this.checkModuleInjection("Editor",this.enableEditor),je(e)||(e=Y.sanitizeString(e));for(var t=this.documentHelper.formFields,i=0;i<t.length;i++)!je(e)&&e!==t[parseInt(i.toString(),10)].formFieldData.name||(t[parseInt(i.toString(),10)].formFieldData instanceof ili?this.editorModule.updateFormField(t[parseInt(i.toString(),10)],t[parseInt(i.toString(),10)].formFieldData.defaultValue,!0):t[parseInt(i.toString(),10)].formFieldData instanceof rli?this.editorModule.toggleCheckBoxFormField(t[parseInt(i.toString(),10)],!0,t[parseInt(i.toString(),10)].formFieldData.defaultValue):t[parseInt(i.toString(),10)].formFieldData instanceof lli&&this.editorModule.updateFormField(t[parseInt(i.toString(),10)],0,!0))},wgi.prototype.importFormData=function(e){this.editorModule||this.checkModuleInjection("Editor",this.enableEditor);for(var t=this.documentHelper.formFields,i=0;i<e.length;i++)for(var n=e[parseInt(i.toString(),10)],o=n.fieldName,r=0;r<t.length;r++)t[parseInt(r.toString(),10)].formFieldData.name===o&&(t[parseInt(r.toString(),10)].formFieldData instanceof rli?this.editorModule.toggleCheckBoxFormField(t[parseInt(r.toString(),10)],!0,n.value):(t[parseInt(r.toString(),10)].formFieldData instanceof ili||t[parseInt(r.toString(),10)].formFieldData instanceof lli)&&this.editorModule.updateFormField(t[parseInt(r.toString(),10)],n.value))},wgi.prototype.exportFormData=function(){for(var e,t,i,n=[],o=this.documentHelper.formFields,r=0;r<o.length;r++)""!==o[parseInt(r.toString(),10)].formFieldData.name&&((e={fieldName:"",value:""}).fieldName=o[parseInt(r.toString(),10)].formFieldData.name,o[parseInt(r.toString(),10)].formFieldData instanceof rli?e.value=o[parseInt(r.toString(),10)].formFieldData.checked:o[parseInt(r.toString(),10)].formFieldData instanceof ili?(t="",t=this.documentHelper.isInlineFormFillProtectedMode?this.editorModule.getFieldResultText(o[parseInt(r.toString(),10)]):o[parseInt(r.toString(),10)].resultText,i=RegExp(this.documentHelper.textHelper.getEnSpaceCharacter(),"gi"),""===t.replace(i,"")&&(t=""),e.value=t):o[parseInt(r.toString(),10)].formFieldData instanceof lli&&(e.value=o[parseInt(r.toString(),10)].formFieldData.selectedIndex),n.push(e));return n},wgi.prototype.importContentControlData=function(e){for(var t=0;t<e.length;t++)for(var i=e[parseInt(t.toString(),10)],n=0;n<this.documentHelper.contentControlCollection.length;n++){var o=this.documentHelper.contentControlCollection[parseInt(n.toString(),10)];i.type===o.contentControlProperties.type&&i.title===o.contentControlProperties.title&&this.editorModule.updateContentControl(o,i.value)}return[]},wgi.prototype.exportContentControlData=function(){this.selection.contentControleditRegionHighlighters.clear(),this.selection.onHighlightContentControl();for(var e=[],t=0,i=this.documentHelper.contentControlCollection;t<i.length;t++){var n,o,r=i[t];r instanceof Pli&&((n={title:"",tag:"",value:"",canDelete:!1,canEdit:!1,type:r.contentControlProperties.type}).title=r.contentControlProperties.title,n.tag=r.contentControlProperties.tag,r.contentControlProperties.lockContentControl&&(n.canDelete=!0),r.contentControlProperties.lockContents&&(n.canEdit=!0),o=r.nextElement,"Picture"===r.contentControlProperties.type?o instanceof rhi&&(n.value=this.documentHelper.getImageString(o)):"CheckBox"===r.contentControlProperties.type?n.value=String(r.contentControlProperties.isChecked):"Date"===r.contentControlProperties.type?n.value=o.text:"ComboBox"===r.contentControlProperties.type||"DropDownList"===r.contentControlProperties.type?n.value=this.getContentControlValue(o):n.value=this.getContentControlValueForText(r),e.push(n))}return e},wgi.prototype.resetContentControlData=function(e){for(var t=0;t<e.length;t++)for(var i=e[parseInt(t.toString(),10)],n=0;n<this.documentHelper.contentControlCollection.length;n++){var o=this.documentHelper.contentControlCollection[parseInt(n.toString(),10)];i.title===o.contentControlProperties.title&&this.editorModule.updateContentControl(o,i.value,!0)}},wgi.prototype.getContentControlValue=function(e){for(var t="";e&&!(e instanceof Pli);)e instanceof pli&&(t+=e.text),e=e.nextElement;return t},wgi.prototype.getContentControlValueForText=function(e){var t="",i=e.line.children.indexOf(e)+1,n=!1;if(this.selection.contentControleditRegionHighlighters.containsKey(e))for(var o=this.selection.contentControleditRegionHighlighters.get(e),r=0;r<o.keys.length;r++){var s=o.keys[parseInt(r.toString(),10)];0<r&&s.paragraph!==o.keys[r-1].paragraph&&(t+="/n");for(var a=i;a<s.children.length;a++){var i=0,l=s.children[parseInt(a.toString(),10)];if(l instanceof pli&&(t+=l.text),l instanceof Pli){n=!0;break}}if(n)break}return t},wgi.prototype.updateFields=function(){this.selectionModule||this.checkModuleInjection("Selection",this.enableSelection);for(var e=0;e<this.documentHelper.fields.length;e++){var t,i=this.documentHelper.fields[parseInt(e.toString(),10)];0!==this.selectionModule.getFieldCode(i).toLowerCase().trim().indexOf("ref ")||je(t=i.line.paragraph)||je(this.selectionModule)||je(this.selectionModule.getPage(t))||this.selectionModule.updateRefField(i)}},wgi.prototype.focusIn=function(){this.viewer&&this.documentHelper.updateFocus()},wgi.prototype.fitPage=function(e){je(e)&&(e="None"),this.viewer&&(this.viewer.pageFitType=e)},wgi.prototype.exportAsImage=function(e,t){if(je(this.viewer))throw new Error("Invalid operation.");if(this.printModule)return this.printModule.exportAsImage(this.documentHelper,e,"Png"===t?"image/png":"image/jpeg");this.checkModuleInjection("Print",this.enablePrint)},wgi.prototype.exportAsPath=function(e){if(!je(e)&&e<=this.documentHelper.pages.length&&1<=e)return e=this.documentHelper.pages[e-1],this.documentHelper.render.isExporting=!0,this.documentHelper.render.renderWidgets(e,0,0,0,0),e=this.documentHelper.render.pageCanvas.toDataURL(),this.documentHelper.render.pageCanvas.getContext("2d").renderedPath="",this.documentHelper.render.isExporting=!1,e},wgi.prototype.print=function(e){if(je(this.viewer))throw new Error("Invalid operation.");this.printModule?"Continuous"===this.layoutType?(this.documentHelper.isWebPrinting=!0,this.viewer=new nai(this),this.editorModule.layoutWholeDocument(),this.printModule.print(this.documentHelper,e),this.viewer=new sai(this),this.editorModule.layoutWholeDocument(),this.documentHelper.isWebPrinting=!1):this.printModule.print(this.documentHelper,e):this.checkModuleInjection("Print",this.enablePrint)},wgi.prototype.serialize=function(){var e="";return this.enableSfdtExport&&this.sfdtExportModule instanceof Wui?e=this.sfdtExportModule.serialize():this.checkModuleInjection("SfdtExport",this.enableSfdtExport),e},wgi.prototype.save=function(t,e){var i,n,o,r=this;if(t=(t=je(t)?t:Y.sanitizeString(t))||"Untitled",je(this.documentHelper))throw new Error("Invalid operation.");if("Docx"===e||"Dotx"===e)this.wordExportModule?this.wordExportModule.save(this.documentHelper,t,e):this.checkModuleInjection("WordExport",this.enableWordExport);else if("Txt"===e)this.textExportModule?this.textExportModule.save(this.documentHelper,t):this.checkModuleInjection("TextExport",this.enableTextExport);else{if("Sfdt"!==e)throw new Error("Invalid operation. Specified export is not enabled.");this.sfdtExportModule?this.documentEditorSettings.optimizeSfdt?(n=this.serialize(),o=new Blob([n],{type:"application/json"}),e=new ih(o,"sfdt"),(i=new Zl).addItem(e),i.saveAsBlob().then(function(e){r.zipArchiveBlobToSfdtFile(e,t)})):(n=this.serialize(),o=new Blob([n],{type:"application/json"}),Ll.save(t+".sfdt",o)):this.checkModuleInjection("SfdtExport",this.enableSfdtExport)}},wgi.prototype.zipArchiveBlobToSfdtFile=function(e,i){var n=new FileReader;n.readAsDataURL(e),n.onload=function(){var e=n.result.split(",")[1],t={},e=(t.sfdt=e,new Blob([JSON.stringify(t)],{type:"application/json"}));Ll.save(i+".sfdt",e)}},wgi.prototype.saveAsBlob=function(e){var t=this;if(je(this.viewer))throw new Error("Invalid operation");return new Promise(function(i){"Docx"===e||"Dotx"===e?t.wordExportModule?i(t.wordExportModule.saveAsBlob(t.documentHelper,e)):t.checkModuleInjection("WordExport",t.enableWordExport):"Txt"===e?t.textExportModule?i(t.textExportModule.saveAsBlob(t.documentHelper)):t.checkModuleInjection("TextExport",t.enableTextExport):"Sfdt"===e&&(t.sfdtExportModule?t.documentEditorSettings.optimizeSfdt?t.sfdtExportModule.saveAsBlob(t.documentHelper).then(function(e){t.getBase64StringFromBlob(e).then(function(e){var t={},e=(t.sfdt=e,new Blob([JSON.stringify(t)],{type:"application/json"}));i(e)})}):i(t.sfdtExportModule.saveAsBlobNonOptimized(t.documentHelper)):t.checkModuleInjection("SfdtExport",t.enableSfdtExport))})},wgi.prototype.getBase64StringFromBlob=function(n){return new Promise(function(t,e){var i=new FileReader;i.readAsDataURL(n),i.onload=function(){var e=i.result.split(",")[1];t(e)}})},wgi.prototype.openBlank=function(){var e=[],t=(e.push(this.createNewBodyWidget()),this.parser.parseHeaderFooter({header:{},footer:{},evenHeader:{},evenFooter:{},firstPageHeader:{},firstPageFooter:{}},void 0));if(this.viewer){if(this.clearPreservedCollectionsInViewer(),this.documentHelper.userCollection.push("Everyone"),this.documentHelper.cachedPages=[],this.clearSpellCheck(),this.documentHelper.setDefaultDocumentFormat(),this.documentHelper.headersFooters.push(t),this.editorModule){this.editorModule.intializeDefaultStyles();for(var i=this.documentHelper.styles.findByName("Normal"),n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)].childWidgets[0];o.paragraphFormat.baseStyle=i,o.paragraphFormat.listFormat.baseStyle=i}}this.documentHelper.onDocumentChanged(e)}},wgi.prototype.getStyleNames=function(e){return this.viewer?this.documentHelper.styles.getStyleNames(e):[]},wgi.prototype.getStyles=function(e){return this.viewer?this.documentHelper.styles.getStyles(e):[]},wgi.prototype.getBookmarks=function(){var e=[];return e=this.viewer?this.documentHelper.getBookmarks(!0):e},wgi.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"Columns":this.showColumnsDialog();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();break;case"DatepickerContentControl":this.showDateContentDialog();break;case"PictureContentControl":this.showPicContentControlDialog();break;case"ContentControlProperties":this.showContentPropertiesDialog()}},wgi.prototype.toggleShowHiddenMarksInternal=function(){this.documentEditorSettings.showHiddenMarks=!this.documentEditorSettings.showHiddenMarks,this.notify(JJt,this.documentEditorSettings)},wgi.prototype.showOptionsPane=function(){je(this.optionsPaneModule)||je(this.viewer)?this.checkModuleInjection("OptionsPane",this.enableOptionsPane):this.optionsPaneModule.showHideOptionsPane(!0)},wgi.prototype.showXmlPane=function(){!je(this.xmlPaneModule)&&je(this.xmlPaneModule.element)?this.xmlPaneModule.showXmlProperties(!0):this.checkModuleInjection("XmlPane",this.enableXMLPane)},wgi.prototype.showRestrictEditingPane=function(e){e=!!je(e)||e,this.documentHelper&&this.documentHelper.restrictEditingPane&&this.documentHelper.restrictEditingPane.showHideRestrictPane(e)},wgi.prototype.showSpellCheckDialog=function(){var e;this.spellCheckDialogModule&&this.spellCheckerModule?je(e=this.spellCheckerModule.retriveText())||this.spellCheckDialogModule.show(e.text,e.element):this.checkModuleInjection("SpellCheck",this.enableSpellCheck)},wgi.prototype.showTabDialog=function(){this.tabDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.tabDialogModule.show()},wgi.prototype.destroy=function(){ygi.prototype.destroy.call(this),this.destroyDependentModules(),je(this.documentHelper)||this.documentHelper.destroy(),this.viewer&&this.viewer.componentDestroy(),this.viewer=void 0,je(this.element)||(this.element.classList.remove("e-documenteditor"),this.element.innerHTML=""),this.refreshing||(this.element=void 0,this.rulerHelper.destroy()),this.parser&&(this.parser.destroy(),this.parser=void 0),this.revisionsInternal&&(this.revisionsInternal.destroy(),this.revisionsInternal=void 0),this.findResultsList=[],this.findResultsList=void 0,this.documentHelper=void 0},wgi.prototype.updateStyle=function(e,t){var i,n;je(this.styleDialogModule)||(i="Paragraph"===t.type?je(t.link)?"Paragraph":"Linked Style":"Character",e.type=this.styleDialogModule.getTypeValue(i),e.basedOn=t.basedOn,"Paragraph"==i||"Linked Style"==i?(e.next=t.next,e.characterFormat.destroy(),e.characterFormat.copyFormat(t.characterFormat),n=e.paragraphFormat.listFormat.listId,e.paragraphFormat.destroy(),e.paragraphFormat.copyFormat(t.paragraphFormat),e.link=t.link,!je(n)&&-1<n&&(je(n=this.documentHelper.getListById(n))||this.documentHelper.lists.splice(this.documentHelper.lists.indexOf(n),1))):"Character"==i&&(e.characterFormat.destroy(),e.characterFormat.copyFormat(t.characterFormat)),e.name=t.name)},wgi.prototype.createNewBodyWidget=function(){var e=new Sai,t=(e.index=0,e.sectionFormat=new ari(e),this.sectionFormat&&this.parser.parseSectionFormat(0,this.sectionFormat,e.sectionFormat),new Lai);return t.index=0,t.paragraphFormat=new bri(t),t.characterFormat=new Eri(t),e.childWidgets.push(t),t.containerWidget=e},wgi.prototype.clearSpellCheck=function(){je(this.spellCheckerModule)||(je(this.spellCheckerModule.errorWordCollection)||this.spellCheckerModule.errorWordCollection.clear(),je(this.spellCheckerModule.uniqueWordsCollection))||this.spellCheckerModule.uniqueWordsCollection.clear()},wgi.prototype.setStyleData=function(e,t){this.enableCollaborativeEditing&&(this.isSettingOp=!0,je(e)||je(this.documentHelper.owner.sfdtExportModule)||je(e=this.documentHelper.styles.findByName(e))||(t=this.getStyleObject(e,t),!je(e)&&this.enableCollaborativeEditing&&(e={action:"Update",styleData:JSON.stringify(t)},this.documentSettingOps.push(e))),this.fireContentChange())},wgi.prototype.setCustomFonts=function(e){var t,i=this;if(this.externalFonts=[],"string"==typeof e)try{t=JSON.parse(e)}catch(e){return void console.error("Failed to parse JSON string:",e)}else{if(!Array.isArray(e))return void console.error("Invalid input type");t=e}t.forEach(function(e){i.externalFonts.push({fontFamily:e.fontFamily,src:e.src})}),this.updateExternalStyle()},wgi.prototype.getStyleObject=function(e,t){var i,n;if(!je(e))return i=this.documentHelper.owner.sfdtExportModule.keywordIndex,this.documentHelper.owner.sfdtExportModule.keywordIndex=1,n={optimizeSfdt:!0,sty:[this.documentHelper.owner.sfdtExportModule.writeStyle(e)]},this.editorModule.isLinkedStyle(e.name)&&(e=this.documentHelper.styles.findByName(e.name+" Char"),e=this.documentHelper.owner.sfdtExportModule.writeStyle(e),n.sty.push(e)),!je(t)&&-1<t&&(e=this.documentHelper.getListById(t),n[hZt[1]]=[],n[hZt[1]].push(this.sfdtExportModule.writeList(e)),n[dZt[1]]=[],n[dZt[1]].push(this.sfdtExportModule.writeAbstractList(e.abstractList))),this.documentHelper.owner.sfdtExportModule.keywordIndex=i,n},wgi.prototype.getSettingData=function(e,t,i,n,o){this.enableCollaborativeEditing&&!this.editorModule.isRemoteAction&&(this.isSettingOp=!0,n="protection"===e?{text:e,protectionData:{saltValue:n,hashValue:i,protectionType:o}}:{text:e,enableTrackChanges:t},this.skipSettingsOps||(this.documentSettingOps.push(n),this.fireContentChange()),this.skipSettingsOps=!1,this.isSettingOp=!1)},HOt([e(!(wgi.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.xmlPaneModule&&(this.xmlPaneModule.destroy(),this.xmlPaneModule=void 0),this.commentReviewPane&&(this.commentReviewPane.destroy(),this.commentReviewPane=void 0),this.trackChangesPane&&(this.trackChangesPane.destroy(),this.trackChangesPane=void 0),je(this.hyperlinkDialogModule)||(this.hyperlinkDialogModule.destroy(),this.hyperlinkDialogModule=void 0),this.searchModule&&(this.searchModule.destroy(),this.searchModule=void 0),this.contextMenuModule&&(this.contextMenuModule.componentDestroy(),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),je(this.paragraphDialogModule)||(this.paragraphDialogModule.destroy(),this.paragraphDialogModule=void 0),this.tabDialogModule&&(this.tabDialogModule.destroy(),this.tabDialogModule=void 0),this.pageSetupDialogModule&&(this.pageSetupDialogModule.destroy(),this.pageSetupDialogModule=void 0),this.columnsDialogModule&&(this.columnsDialogModule.destroy(),this.columnsDialogModule=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.contentControlPropertiesDialogModule&&(this.contentControlPropertiesDialogModule.destroy(),this.contentControlPropertiesDialogModule=void 0),this.picContentControlDialogModule&&(this.picContentControlDialogModule.destroy(),this.picContentControlDialogModule=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.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),this.checkBoxFormFieldDialogModule&&(this.checkBoxFormFieldDialogModule.destroy(),this.checkBoxFormFieldDialogModule=void 0),this.dropDownFormFieldDialogModule&&(this.dropDownFormFieldDialogModule.destroy(),this.dropDownFormFieldDialogModule=void 0),this.textFormFieldDialogModule&&(this.textFormFieldDialogModule.destroy(),this.textFormFieldDialogModule=void 0),this.spellCheckDialogModule&&(this.spellCheckDialogModule.destroy(),this.spellCheckDialogModule=void 0),this.stylesDialogModule&&(this.stylesDialogModule.destroy(),this.stylesDialogModule=void 0),this.optimizedModule&&(this.optimizedModule.destroy(),this.optimizedModule=void 0),this.regularModule&&(this.regularModule.destroy(),this.regularModule=void 0),this.hRuler&&(this.hRuler.destroy(),this.hRuler=void 0),this.vRuler&&(this.vRuler.destroy(),this.vRuler=void 0),this.rulerContainer&&(this.rulerContainer.remove(),this.rulerContainer=null)}))],wgi.prototype,"enableCollaborativeEditing",void 0),HOt([e("KeepSourceFormatting")],wgi.prototype,"defaultPasteOption",void 0),HOt([e("Pages")],wgi.prototype,"layoutType",void 0),HOt([e("")],wgi.prototype,"currentUser",void 0),HOt([e("#FFFF00")],wgi.prototype,"userColor",void 0),HOt([e(20)],wgi.prototype,"pageGap",void 0),HOt([e("")],wgi.prototype,"documentName",void 0),HOt([e("100%")],wgi.prototype,"width",void 0),HOt([e("200px")],wgi.prototype,"height",void 0),HOt([e("")],wgi.prototype,"serviceUrl",void 0),HOt([e(1)],wgi.prototype,"zoomFactor",void 0),HOt([e(2e3)],wgi.prototype,"zIndex",void 0),HOt([e(!0)],wgi.prototype,"isReadOnly",void 0),HOt([e(!1)],wgi.prototype,"enablePrint",void 0),HOt([e(!1)],wgi.prototype,"enableSelection",void 0),HOt([e(!1)],wgi.prototype,"enableEditor",void 0),HOt([e(!1)],wgi.prototype,"enableEditorHistory",void 0),HOt([e(!1)],wgi.prototype,"enableSfdtExport",void 0),HOt([e(!1)],wgi.prototype,"enableWordExport",void 0),HOt([e(!0)],wgi.prototype,"enableAutoFocus",void 0),HOt([e(!1)],wgi.prototype,"enableTextExport",void 0),HOt([e(!1)],wgi.prototype,"enableOptionsPane",void 0),HOt([e(!1)],wgi.prototype,"enableContextMenu",void 0),HOt([e(!1)],wgi.prototype,"enableHyperlinkDialog",void 0),HOt([e(!1)],wgi.prototype,"enableBookmarkDialog",void 0),HOt([e(!1)],wgi.prototype,"enableTableOfContentsDialog",void 0),HOt([e(!1)],wgi.prototype,"enableSearch",void 0),HOt([e(!1)],wgi.prototype,"enableParagraphDialog",void 0),HOt([e(!1)],wgi.prototype,"enableListDialog",void 0),HOt([e(!1)],wgi.prototype,"enableTablePropertiesDialog",void 0),HOt([e(!1)],wgi.prototype,"enableBordersAndShadingDialog",void 0),HOt([e(!1)],wgi.prototype,"enableFootnoteAndEndnoteDialog",void 0),HOt([e(!1)],wgi.prototype,"enableColumnsDialog",void 0),HOt([e(!1)],wgi.prototype,"enablePageSetupDialog",void 0),HOt([e(!1)],wgi.prototype,"enableStyleDialog",void 0),HOt([e(!1)],wgi.prototype,"enableFontDialog",void 0),HOt([e(!1)],wgi.prototype,"enableTableOptionsDialog",void 0),HOt([e(!1)],wgi.prototype,"enableTableDialog",void 0),HOt([e(!1)],wgi.prototype,"enableImageResizer",void 0),HOt([e(!1)],wgi.prototype,"enableSpellCheck",void 0),HOt([e(!1)],wgi.prototype,"enableComment",void 0),HOt([e(!1)],wgi.prototype,"enableTrackChanges",void 0),HOt([e(!0)],wgi.prototype,"enableFormField",void 0),HOt([e(!1)],wgi.prototype,"acceptTab",void 0),HOt([e(!0)],wgi.prototype,"useCtrlClickToFollowHyperlink",void 0),HOt([e("#000000")],wgi.prototype,"pageOutline",void 0),HOt([e(!1)],wgi.prototype,"enableCursorOnReadOnly",void 0),HOt([e(!1)],wgi.prototype,"enableLocalPaste",void 0),HOt([e(!1)],wgi.prototype,"enableLockAndEdit",void 0),HOt([t({},WOt)],wgi.prototype,"documentEditorSettings",void 0),HOt([t({},dNt)],wgi.prototype,"documentSettings",void 0),HOt([e({systemClipboard:"SystemClipboard",spellCheck:"SpellCheck",spellCheckByPage:"SpellCheckByPage",restrictEditing:"RestrictEditing",canLock:"CanLock",getPendingActions:"GetPendingActions"})],wgi.prototype,"serverActionSettings",void 0),HOt([e([])],wgi.prototype,"headers",void 0),HOt([e(!1)],wgi.prototype,"showComments",void 0),HOt([e(!1)],wgi.prototype,"showRevisions",void 0),HOt([e(!1)],wgi.prototype,"autoResizeOnVisibilityChange",void 0),HOt([i()],wgi.prototype,"documentChange",void 0),HOt([i()],wgi.prototype,"viewChange",void 0),HOt([i()],wgi.prototype,"zoomFactorChange",void 0),HOt([i()],wgi.prototype,"selectionChange",void 0),HOt([i()],wgi.prototype,"requestNavigate",void 0),HOt([i()],wgi.prototype,"contentChange",void 0),HOt([i()],wgi.prototype,"keyDown",void 0),HOt([i()],wgi.prototype,"searchResultsChange",void 0),HOt([i()],wgi.prototype,"created",void 0),HOt([i()],wgi.prototype,"destroyed",void 0),HOt([i()],wgi.prototype,"customContextMenuSelect",void 0),HOt([i()],wgi.prototype,"customContextMenuBeforeOpen",void 0),HOt([i()],wgi.prototype,"beforePaneSwitch",void 0),HOt([i()],wgi.prototype,"commentBegin",void 0),HOt([i()],wgi.prototype,"commentEnd",void 0),HOt([i()],wgi.prototype,"beforeFileOpen",void 0),HOt([i()],wgi.prototype,"commentDelete",void 0),HOt([i()],wgi.prototype,"beforeAcceptRejectChanges",void 0),HOt([i()],wgi.prototype,"beforeCommentAction",void 0),HOt([i()],wgi.prototype,"trackChange",void 0),HOt([i()],wgi.prototype,"beforeFormFieldFill",void 0),HOt([i()],wgi.prototype,"serviceFailure",void 0),HOt([i()],wgi.prototype,"afterFormFieldFill",void 0),HOt([i()],wgi.prototype,"actionComplete",void 0),HOt([i()],wgi.prototype,"contentControl",void 0),HOt([i()],wgi.prototype,"beforeXmlHttpRequestSend",void 0),HOt([i()],wgi.prototype,"documentLoadFailed",void 0);var ygi,vgi,bgi=vgi=HOt([Bt],wgi);function wgi(e,t){e=ygi.call(this,e,t)||this;return e.enableHeaderFooterIn=!1,e.isShiftingEnabled=!1,e.isContainerResize=!1,e.enableXMLPane=!1,e.isLayoutEnabled=!0,e.isPastingContent=!1,e.isOnIndent=!1,e.isTableMarkerDragging=!1,e.startXPosition=0,e.parser=void 0,e.isUpdateTrackChanges=!1,e.disableHistoryIn=!1,e.documentSettingOps=[],e.skipSettingsOps=!1,e.isSettingOp=!1,e.findResultsList=void 0,e.tablePropertiesDialogModule=void 0,e.bordersAndShadingDialogModule=void 0,e.cellOptionsDialogModule=void 0,e.tableOptionsDialogModule=void 0,e.paragraphDialogModule=void 0,e.imageResizerModule=void 0,e.createdTriggered=!1,e.serverActionSettingsImport="Import",e.isXmlPaneTool=!1,e.isXmlMapCC=!1,e.defaultLocale={Table:"Table",Row:"Row",Cell:"Cell",Ok:"OK",Apply:"Apply","Alt Text":"Alt Text",Title:"Title",Description:"Description",Cancel:"Cancel",Size:"Size","Preferred Width":"Preferred width",Points:"Points",Percent:"Percent","Measure in":"Measure in",Alignment:"Alignment",OutlineLevel:"Outline Level",BodyText:"Body Text",Level1:"Level 1",Level2:"Level 2",Level3:"Level 3",Level4:"Level 4",Level5:"Level 5",Level6:"Level 6",Level7:"Level 7",Level8:"Level 8",Level9:"Level 9",Left:"Left",Center:"Center",Right:"Right",Decimal:"Decimal",Bar:"Bar",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","First Page Header":"First Page Header","First Page Footer":"First Page Footer","Even Page Header":"Even Page Header","Even Page Footer":"Even Page Footer","Odd Page Header":"Odd Page Header","Odd Page Footer":"Odd Page Footer","Same as Previous":"Same as Previous",Section:"Section",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",Leader:"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","Heading 7":"Heading 7","Heading 8":"Heading 8","Heading 9":"Heading 9","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","ScreenTip text":"ScreenTip text",Address:"Address","Insert Hyperlink":"Insert Hyperlink","Edit Hyperlink":"Edit Hyperlink",Insert:"Insert",General:"General","The number must be between":"The number must be between 1 and 9","The Invalid number":"This is not a valid number",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","Remove Content Control":"Remove Content Control","Content Control Properties":"Content Control Properties","Remove content control when contents are edited":"Remove content control when contents are edited","Content control cannot be deleted":"Content control cannot be deleted","Contents cannot be edited":"Contents cannot be edited","Plain Text properties":"Plain Text properties","Allow carriage returns":"Allow carriage returns","Drop_Down List properties":"Drop_Down List properties","Display Text":"Display Text",Locking:"Locking",Tag:"Tag",Value:"Value",PictureContentControl:"PictureContentControl","Upload from computer":"Upload from computer",Picture:"Picture","Choose an item":"Choose an item","Insert Pictures":"Insert Pictures","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",Tab:"Tab","Tab stop position":"Tab stop position",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 paragraphs of the same style","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.",FormFieldsOnly:"You may only fill in forms in this region.",CommentsOnly:"You may only insert comments into this region.",ReadOnlyProtection:"You may edit in this region.","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","Failed to load the file":"Failed to load the file","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","XML Mapping":"XML Mapping","Custom XML Part":"Custom XML Part:","Discard Comment":"Added comments not posted. If you continue, that comment will be discarded.","Discard Content Control":"You can not insert a content control when the selection includes another content control.","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","Keep With Next":"Keep with next","Keep Lines Together":"Keep lines together",WidowControl:"Widow/Orphan control","Indents and Spacing":"Indents and Spacing","Line and Page Breaks":"Line and Page Breaks",Pagination:"Pagination",Single:"Single",DashSmallGap:"DashSmallGap",DashDot:"DashDot",Double:"Double",ThinThickSmallGap:"ThinThickSmallGap",ThickThinSmallGap:"ThickThinSmallGap",ThickThinMediumGap:"ThickThinMediumGap",ThickThinLargeGap:"ThickThinLargeGap",SingleWavy:"SingleWavy",DoubleWavy:"DoubleWavy",Inset:"Inset",DashLargeGap:"DashLargeGap",Dot:"Dot",DashDotDot:"DashDotDot",Triple:"Triple",ThinThickThinSmallGap:"ThinThickThinSmallGap",ThinThickThinMediumGap:"ThinThickThinMediumGap",ThinThickThinLargeGap:"ThinThickThinLargeGap",DashDotStroked:"DashDotStroked",Engrave3D:"Engrave3D",Thick:"Thick",Outset:"Outset",Emboss3D:"Emboss3D",ThinThickLargeGap:"ThinThickLargeGap",ThinThickMediumGap:"ThinThickMediumGap","Number of rows must be between":"Number of rows must be between","Number of columns must be between":"Number of columns must be between",and:"and",Unlimited:"Unlimited","Regular text":"Regular text",Date:"Date",Uppercase:"Uppercase",Lowercase:"Lowercase",FirstCapital:"FirstCapital",TitleCase:"Titlecase","Filling in forms":"Filling in forms",px:"px","Tracked changes":"Tracked changes",TrackChangesOnly:"You may edit in this region, but all change will be tracked.",RemovedIgnoreExceptions:"If you make this change in document protection, Word will ignore all the exceptions in this document.",RemovedIgnore:"Do you want to remove the ignored exceptions?",Information:"Information",Yes:"Yes",No:"No","Page Break":"Page Break","Column Break":"Column Break","Section Break Next Page":"Section Break (Next Page)","Section Break Continuous":"Section Break (Continuous)","Unsupported format":"The file format you have selected isn't supported. Please choose valid format.",One:"One",Two:"Two",Three:"Three",Presets:"Presets",Columns:"Columns","Split your text into two or more columns":"Split your text into two or more columns","Line between column":"Line between column","Width and Spacing":"Width and Spacing","Equal column width":"Equal column width",Column:"Column","Paste Content Dialog":"Due to browser’s security policy, paste from system clipboard is restricted. Alternatively use the keyboard shortcut","Paste Content CheckBox":"Don’t show again",BookMarkList:"List of bookmarks in the document",TabMarkList:"List of tab stops in the paragraph","Default tab stops":"Default tab stops","Tab stops to be cleared":"Tab stops to be cleared",Tabs:"Tabs",Set:"Set",Clear:"Clear","Clear All":"Clear All",Discard:"Discard","The top/bottom margins are too large for the page height in some sections.":"The top/bottom margins are too large for the page height in some sections.","Column width cannot be less than 36 pt.":"Column width cannot be less than 36 pt.","Left and right margins.":"Settings you chose for the left and right margins, column spacing, or pargraph indents are too large for the page width in same secitions.","Left Indent":"Left Indent","Right Indent":"Right Indent","Hanging Indent":"Hanging Indent","First Line Indent":"First Line Indent","Left Margin":"Left Margin","Right Margin":"Right Margin","Top Margin":"Top Margin","Bottom Margin":"Bottom Margin","Left Tab":"Left Tab","Right Tab":"Right Tab","Center Tab":"Center Tab","Decimal Tab":"Decimal Tab","Bar Tab":"Bar Tab","Move Table Column":"Move Table Column","Default Content Control Text":"Click here or tap to insert text","Default Date Picker":"Click or tap enter the date","Rich text Controls":"Rich text controls cannot be applied here.","Plain text Controls":"Plain text controls cannot be applied here."},e.initHelper(),e}Kmt(Sgi,Cgi=n),HOt([e("SystemClipboard")],Sgi.prototype,"systemClipboard",void 0),HOt([e("SpellCheck")],Sgi.prototype,"spellCheck",void 0),HOt([e("SpellCheckByPage")],Sgi.prototype,"spellCheckByPage",void 0),HOt([e("RestrictEditing")],Sgi.prototype,"restrictEditing",void 0),HOt([e("CanLock")],Sgi.prototype,"canLock",void 0),HOt([e("GetPendingActions")],Sgi.prototype,"getPendingActions",void 0);var Cgi,fNt=Sgi;function Sgi(){return null!==Cgi&&Cgi.apply(this,arguments)||this}Kmt(xgi,Agi=n),HOt([e("#cfcfcf")],xgi.prototype,"shadingColor",void 0),HOt([e(!0)],xgi.prototype,"applyShading",void 0),HOt([e("#cccccc")],xgi.prototype,"selectionColor",void 0),HOt([e("Popup")],xgi.prototype,"formFillingMode",void 0),HOt([e([])],xgi.prototype,"formattingExceptions",void 0);var Agi,bNt=xgi;function xgi(){return null!==Agi&&Agi.apply(this,arguments)||this}Kmt(Tgi,Igi=n),HOt([e("")],Tgi.prototype,"roomName",void 0),HOt([e("#22b24b")],Tgi.prototype,"editableRegionColor",void 0),HOt([e("#f44336")],Tgi.prototype,"lockedRegionColor",void 0),HOt([e(3e3)],Tgi.prototype,"saveTimeout",void 0);var Igi,SNt=Tgi;function Tgi(){return null!==Igi&&Igi.apply(this,arguments)||this}Kmt(Dgi,Egi=fNt),HOt([e("Import")],Dgi.prototype,"import",void 0);var Egi,INt=Dgi;function Dgi(){return null!==Egi&&Egi.apply(this,arguments)||this}var Mgi="_toolbar",kgi="_new",Pgi="_open",Bgi="_undo",Fgi="_redo",Lgi="_image",Rgi="_image_local",Ogi="_table",Ngi="_link",Vgi="_bookmark",_gi="_comment",Hgi="_track",zgi="_toc",jgi="_header",Wgi="_footer",Qgi="_page_setup",Ugi="_page_number",qgi="_break",Ggi="_listView",Ygi="_use_local_clipboard",Xgi="_restrict_edit",Kgi="_page_break",Jgi="_section_break",Zgi="_section_break_continuous",$gi="_column_break",emi="_read_only",tmi="_protections",imi="_form_fields",nmi="_update_fields",omi="_text_form",rmi="_footnote",smi="_endnote",ami="_content_control",lmi="_richtext_content_control",hmi="_plaintext_content_control",dmi="_combobox_content_control",pmi="_dropdown_content_control",cmi="_datepicker_content_control",umi="_checkbox_content_control",gmi="_picture_content_control",mmi="_xmlmapping",DNt=(Object.defineProperty(fmi.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),fmi.prototype.getModuleName=function(){return"toolbar"},fmi.prototype.enableItems=function(e,t){this.toolbar.enableItems(e,t)},fmi.prototype.initToolBar=function(e){this.toolbarItems=e,this.renderToolBar(),this.wireEvent()},fmi.prototype.renderToolBar=function(){var e,t,i,n,o,r;je(this.container)||(e=this.container.toolbarContainer,i=Q("div",{className:"e-de-tlbr-wrapper"}),t=Q("div",{className:"e-de-toolbar"}),this.initToolbarItems(),i.appendChild(t),e.appendChild(i),i=this.container.localObj,n=Q("div",{className:"e-de-ctnr-properties-pane-btn"}),this.buttonElement=Q("button",{attrs:{type:"button","aria-label":i.getConstant("Hide properties pane"),"aria-pressed":"true"}}),n.appendChild(this.buttonElement),o="e-tbar-btn e-tbtn-txt e-control e-btn e-de-showhide-btn",r="e-icons e-de-ctnr-showhide",this.container.enableRtl&&(o+="-rtl",r="e-icons e-de-ctnr-showhide e-de-flip"),this.propertiesPaneButton=new zv({cssClass:o,iconCss:r}),this.container.showPropertiesPane?this.buttonElement.title=i.getConstant("Hide properties pane"):(this.buttonElement.title=i.getConstant("Show properties pane"),mt(n,this.container.restrictEditing?["e-de-overlay"]:[],this.container.restrictEditing?[]:["e-de-overlay"]),n.classList.add("e-de-pane-disable-clr")),this.propertiesPaneButton.appendTo(this.buttonElement),E.add(this.buttonElement,"click",this.showHidePropertiesPane,this),e.appendChild(n),this.toolbar.appendTo(t),this.initToolbarDropdown(t))},fmi.prototype.initToolbarDropdown=function(e){var t,i,n,o=this;this.container&&(t=this.container.localObj,i=this.container.element.id+Mgi,0<=this.toolbarItems.indexOf("Image")&&(this.imgDropDwn=new u2({items:[{text:t.getConstant("Upload from computer"),iconCss:"e-icons e-de-ctnr-upload",id:i+Rgi}],cssClass:"e-de-toolbar-btn-first e-caret-hide",select:this.onDropDownButtonSelect.bind(this)}),this.imgDropDwn.appendTo("#"+i+Lgi)),0<=this.toolbarItems.indexOf("PageSetup")&&(this.PageSetUpDropDwn=new u2({items:[{text:t.getConstant("Page Setup"),iconCss:"e-icons e-de-ctnr-page-size",id:i+"_page_set"},{text:t.getConstant("Columns"),iconCss:"e-icons e-de-ctnr-columns",id:i+"_columns"}],cssClass:"e-de-toolbar-btn-first e-caret-hide",select:this.onDropDownButtonSelect.bind(this)}),this.PageSetUpDropDwn.appendTo("#"+i+Qgi)),0<=this.toolbarItems.indexOf("ContentControl")&&(this.ContentControlDropDwn=new u2({items:[{text:t.getConstant("Rich Text Content Control"),iconCss:"e-icons e-de-ctnr-change-case",id:i+lmi},{text:t.getConstant("Plain Text Content Control"),iconCss:"e-icons e-de-ctnr-change-case",id:i+hmi},{text:t.getConstant("Picture Content Control"),iconCss:"e-icons e-de-ctnr-image",id:i+gmi},{text:t.getConstant("Combo Box Content Control"),iconCss:"e-icons e-de-combo-box",id:i+dmi},{text:t.getConstant("Drop-Down List Content Control"),iconCss:"e-icons e-de-dropdown-list",id:i+pmi},{text:t.getConstant("Date Picker Content Control"),iconCss:"e-icons e-timeline-today",id:i+cmi},{text:t.getConstant("Check Box Content Control"),iconCss:"e-icons e-check-box",id:i+umi}],cssClass:"e-de-toolbar-btn-first e-caret-hide",select:this.onDropDownButtonSelect.bind(this)}),this.ContentControlDropDwn.appendTo("#"+i+ami)),0<=this.toolbarItems.indexOf("Break")&&(n=[{text:t.getConstant("Page"),iconCss:"e-de-listview e-de-listview-icon e-icons e-de-ctnr-page-break",id:Kgi,category:t.getConstant("Page Breaks")},{text:t.getConstant("Column"),iconCss:"e-de-listview e-de-listview-icon e-icons e-de-ctnr-page-break-column",id:$gi,category:t.getConstant("Page Breaks")},{text:t.getConstant("Next Page"),iconCss:"e-de-listview e-de-listview-icon e-icons e-de-ctnr-section-break",id:Jgi,category:t.getConstant("Section Breaks")},{text:t.getConstant("Continuous"),iconCss:"e-de-listview e-de-listview-icon e-icons e-de-ctnr-section-break-continuous",id:Zgi,category:t.getConstant("Section Breaks")}],this.breakDropDwn=new u2({target:"#"+i+qgi+Ggi,cssClass:"e-caret-hide"},"#"+i+qgi),this.breakListView=new MH({dataSource:n,width:"170px",fields:{iconCss:"iconCss",groupBy:"category"},showIcon:!0,select:this.onListViewSelection.bind(this)}),this.breakListView.appendTo("#"+i+qgi+Ggi)),this.filePicker=Q("input",{attrs:{type:"file",accept:".doc,.docx,.rtf,.txt,.htm,.html,.sfdt"},className:"e-de-ctnr-file-picker"}),F.isIE&&document.body.appendChild(this.filePicker),this.imagePicker=Q("input",{attrs:{type:"file",accept:".jpg,.jpeg,.png,.bmp,.svg"},className:"e-de-ctnr-file-picker"}),F.isIE&&document.body.appendChild(this.imagePicker),0<=this.toolbarItems.indexOf("LocalClipboard")&&this.toggleButton(i+Ygi,this.container.enableLocalPaste),0<=this.toolbarItems.indexOf("TrackChanges")&&this.toggleButton(i+Hgi,this.container.enableTrackChanges),0<=this.toolbarItems.indexOf("RestrictEditing")&&(this.toggleButton(i+Xgi,this.container.restrictEditing),n="",this.container.restrictEditing&&(n=" e-de-selected-item"),this.restrictDropDwn=new u2({items:[{text:t.getConstant("Read only"),id:i+emi,iconCss:"e-icons"+n},{text:t.getConstant("Protections"),id:i+tmi,iconCss:"e-icons"}],cssClass:"e-de-toolbar-btn-first e-caret-hide",select:this.onDropDownButtonSelect.bind(this),beforeItemRender:function(e){o.onBeforeRenderRestrictDropdown(e,i)}}),this.restrictDropDwn.appendTo("#"+i+Xgi)),0<=this.toolbarItems.indexOf("FormFields"))&&(this.formFieldDropDown=new u2({items:[{text:t.getConstant("Text Form"),iconCss:"e-icons e-de-textform",id:i+omi},{text:t.getConstant("Check Box"),iconCss:"e-icons e-de-checkbox-form",id:i+"_checkbox"},{text:t.getConstant("DropDown"),iconCss:"e-icons e-de-dropdownform",id:i+"_dropdown"}],cssClass:"e-de-toolbar-btn-first e-caret-hide",select:this.onDropDownButtonSelect.bind(this)}),this.formFieldDropDown.appendTo("#"+i+imi))},fmi.prototype.onListViewSelection=function(e){var t=this.container.element.id+Mgi,i=e.item.id;i===t+qgi+Ggi+"_"+Kgi?this.container.documentEditor.editorModule.insertPageBreak():i===t+qgi+Ggi+"_"+Jgi?this.container.documentEditor.editorModule.insertSectionBreak():i===t+qgi+Ggi+"_"+Zgi?this.container.documentEditor.editorModule.insertSectionBreak(dJt.Continuous):i===t+qgi+Ggi+"_"+$gi&&this.container.documentEditor.editorModule.insertColumnBreak(),e.item.classList.remove("e-active")},fmi.prototype.onBeforeRenderRestrictDropdown=function(e,t){var i=e.element.getElementsByClassName("e-menu-icon")[0];je(i)||(e.item.id===t+emi&&this.toggleRestrictIcon(i,this.container.restrictEditing),e.item.id!==t+tmi)||je(e=document.getElementsByClassName("e-de-restrict-pane")[0])||(t=!("none"===e.style.display),this.toggleRestrictIcon(i,t))},fmi.prototype.toggleRestrictIcon=function(e,t){t?e.classList.add("e-de-selected-item"):e.classList.remove("e-de-selected-item")},fmi.prototype.showHidePropertiesPane=function(){var e=document.getElementsByClassName("e-de-ctnr-properties-pane-btn")[0],t=this.container.localObj;"none"===this.container.propertiesPaneContainer.style.display?(this.container.showPropertiesPane=!0,e.classList.remove("e-de-pane-disable-clr"),this.buttonElement.title=t.getConstant("Hide properties pane"),this.buttonElement.setAttribute("aria-label",t.getConstant("Hide properties pane")),this.buttonElement.setAttribute("aria-pressed","true"),mt(e,["e-de-pane-enable-clr"],[]),this.container.trigger(zJt,{type:"PropertiesPane"})):0<=this.container.previousContext.indexOf("Header")||0<=this.container.previousContext.indexOf("Footer")?this.container.showHeaderProperties=!this.container.showHeaderProperties:(this.container.showPropertiesPane=!1,e.classList.remove("e-de-pane-enable-clr"),this.buttonElement.title=t.getConstant("Show properties pane"),this.buttonElement.setAttribute("aria-label",t.getConstant("Show properties pane")),this.buttonElement.setAttribute("aria-pressed","false"),mt(e,["e-de-pane-disable-clr"],[])),this.enableDisablePropertyPaneButton(this.container.showPropertiesPane),this.container.showPropertiesPaneOnSelection(),this.documentEditor.focusIn()},fmi.prototype.onWrapText=function(e){var t="",i=e.lastIndexOf(" ");return-1!==i?(t=e.slice(0,i),e.slice(i),t+='<div class="e-de-text-wrap">'+e.slice(i)+"</div>"):t=e,t},fmi.prototype.wireEvent=function(){this.propertiesPaneButton.on("click",this.togglePropertiesPane.bind(this)),E.add(this.filePicker,"change",this.onFileChange,this),E.add(this.imagePicker,"change",this.onImageChange,this)},fmi.prototype.initToolbarItems=function(){this.toolbar=new U3({enableRtl:this.container.enableRtl,clicked:this.clickHandler.bind(this),items:this.getToolbarItems()})},fmi.prototype.reInitToolbarItems=function(e){for(var t=this,i=0;i<e.length;i++)switch(e[parseInt(i.toString(),10)]){case"RestrictEditing":je(this.restrictDropDwn)||this.restrictDropDwn.destroy();break;case"Break":je(this.breakDropDwn)||this.breakDropDwn.destroy();break;case"PageSetup":je(this.PageSetUpDropDwn)||this.PageSetUpDropDwn.destroy();break;case"Image":je(this.imgDropDwn)||this.imgDropDwn.destroy();break;case"FormFields":je(this.formFieldDropDown)||this.formFieldDropDown.destroy()}this.toolbarItems=e;var n=this.container.toolbarContainer;this.toolbar.items=this.getToolbarItems(),this.toolbarTimer=Number(setTimeout(function(){t.toolbarTimer&&clearTimeout(t.toolbarTimer),t.initToolbarDropdown(n),0<=e.indexOf("Open")&&E.add(t.filePicker,"change",t.onFileChange,t),0<=e.indexOf("Image")&&E.add(t.imagePicker,"change",t.onImageChange,t)},200))},fmi.prototype.getToolbarItems=function(){for(var e,t=this.container.localObj,i=this.container.element.id+Mgi,n=[],o=this.toolbarItems,r=0;r<this.toolbarItems.length;r++)switch(e=0===r?"e-de-toolbar-btn-start":"Separator"===o[r+1]&&"Separator"===o[r-1]?"e-de-toolbar-btn":"Separator"===o[r+1]?"e-de-toolbar-btn-last":"Separator"===o[r-1]?"e-de-toolbar-btn-first":r===this.toolbarItems.length-1?"e-de-toolbar-btn-end":"e-de-toolbar-btn-middle",o[parseInt(r.toString(),10)]){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+kgi,text:t.getConstant("New"),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Create a new document")}});break;case"Open":n.push({prefixIcon:"e-de-ctnr-open",tooltipText:t.getConstant("Open a document"),id:i+Pgi,text:t.getConstant("Open"),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Open a document")}});break;case"Undo":n.push({prefixIcon:"e-de-ctnr-undo",tooltipText:t.getConstant("Undo Tooltip"),id:i+Bgi,text:t.getConstant("Undo"),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Undo Tooltip")}});break;case"Redo":n.push({prefixIcon:"e-de-ctnr-redo",tooltipText:t.getConstant("Redo Tooltip"),id:i+Fgi,text:t.getConstant("Redo"),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Redo Tooltip")}});break;case"Comments":n.push({prefixIcon:"e-de-cnt-cmt-add",tooltipText:t.getConstant("Show comments"),id:i+_gi,text:t.getConstant("Comments"),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Show comments")}});break;case"TrackChanges":n.push({prefixIcon:"e-de-cnt-track",tooltipText:t.getConstant("Track Changes"),id:i+Hgi,text:this.onWrapText(t.getConstant("TrackChanges")),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("TrackChanges"),"aria-pressed":this.container.enableTrackChanges,role:"button","aria-hidden":"true"}});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+Lgi+'"><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>',id:i+Lgi,htmlAttributes:{"aria-label":t.getConstant("Insert inline picture from a file"),"aria-haspopup":!1}});break;case"Table":n.push({prefixIcon:"e-de-ctnr-table",tooltipText:t.getConstant("Insert a table into the document"),id:i+Ogi,text:t.getConstant("Table"),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Insert a table into the document"),"aria-haspopup":!0}});break;case"Hyperlink":n.push({prefixIcon:"e-de-ctnr-link",tooltipText:t.getConstant("Create Hyperlink"),id:i+Ngi,text:t.getConstant("Link"),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Create Hyperlink"),"aria-haspopup":!0}});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+Vgi,text:t.getConstant("Bookmark"),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Insert a bookmark in a specific place in this document"),"aria-haspopup":!0}});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+zgi,text:this.onWrapText(t.getConstant("Table of Contents")),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Table of Contents")}});break;case"Header":n.push({prefixIcon:"e-de-ctnr-header",tooltipText:t.getConstant("Add or edit the header"),id:i+jgi,text:t.getConstant("Header"),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Add or edit the header")}});break;case"Footer":n.push({prefixIcon:"e-de-ctnr-footer",tooltipText:t.getConstant("Add or edit the footer"),id:i+Wgi,text:t.getConstant("Footer"),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Add or edit the footer")}});break;case"PageSetup":n.push({template:'<button title="'+t.getConstant("Page Setup")+'" class="e-tbar-btn e-tbtn-txt e-control e-btn e-lib e-dropdown-btn e-caret-hide" type="button" id="'+i+Qgi+'"><span class="e-btn-icon e-icons e-de-ctnr-pagesetup e-icon-left"></span><span class="e-tbar-btn-text">'+this.onWrapText(t.getConstant("Page Setup"))+'</span><span class="e-btn-icon e-icons e-icon-right e-caret"></span></button>',id:i+Qgi,htmlAttributes:{"aria-label":t.getConstant("Page Setup")}});break;case"PageNumber":n.push({prefixIcon:"e-de-ctnr-pagenumber",tooltipText:t.getConstant("Add page numbers"),id:i+Ugi,text:this.onWrapText(t.getConstant("Page Number")),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Page Number")}});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+qgi+'"><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><div id="'+i+qgi+Ggi+'"></div>',id:i+qgi,htmlAttributes:{"aria-label":t.getConstant("Break")}});break;case"Find":n.push({prefixIcon:"e-de-ctnr-find",tooltipText:t.getConstant("Find Text"),id:i+"_find",text:t.getConstant("Find"),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Find Text")}});break;case"LocalClipboard":n.push({prefixIcon:"e-de-ctnr-paste",tooltipText:t.getConstant("Toggle between the internal clipboard and system clipboard"),id:i+Ygi,text:this.onWrapText(t.getConstant("Local Clipboard")),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Local Clipboard"),"aria-pressed":this.container.enableLocalPaste,role:"button","aria-hidden":"true"}});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+Xgi+'"><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>',htmlAttributes:{"aria-label":t.getConstant("Restrict editing")}});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+imi+'"><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>',id:i+imi,htmlAttributes:{"aria-label":t.getConstant("Form Fields")}});break;case"UpdateFields":n.push({prefixIcon:"e-de-update-field",tooltipText:t.getConstant("Update cross reference fields"),id:i+nmi,text:this.onWrapText(t.getConstant("Update Fields")),cssClass:e+" e-de-formfields",htmlAttributes:{"aria-label":t.getConstant("Update cross reference fields")}});break;case"InsertFootnote":n.push({prefixIcon:"e-de-footnote",tooltipText:t.getConstant("Footnote Tooltip"),text:this.onWrapText(t.getConstant("Insert Footnote")),id:i+rmi,cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Insert Footnote")}});break;case"InsertEndnote":n.push({prefixIcon:"e-de-endnote",tooltipText:t.getConstant("Endnote Tooltip"),text:this.onWrapText(t.getConstant("Insert Endnote")),id:i+smi,cssClass:e,htmlAttributes:{"aria-label":t.getConstant("Insert Endnote")}});break;case"ContentControl":n.push({template:'<button title="'+t.getConstant("Content Control")+'" class="e-tbar-btn e-tbtn-txt e-control e-btn e-lib e-dropdown-btn e-caret-hide" type="button" id="'+i+ami+'"><span class="e-btn-icon e-icons e-de-ctnr-content-control e-icon-left"></span><span class="e-tbar-btn-text">'+this.onWrapText(t.getConstant("Content Control"))+'</span><span class="e-btn-icon e-icons e-icon-right e-caret"></span></button>',id:i+ami,htmlAttributes:{"aria-label":t.getConstant("Content Control")}});break;case"XML Mapping":n.push({prefixIcon:"e-de-ctnr-xml-mapping",tooltipText:t.getConstant("XML Mapping Pane"),id:i+mmi,text:this.onWrapText(t.getConstant("XML Mapping Pane")),cssClass:e,htmlAttributes:{"aria-label":t.getConstant("XML Mapping Pane")}});break;default:n.push(o[parseInt(r.toString(),10)])}for(r=0;r<n.length;r++){var s;"Separator"!==n[r].text&&(s=r.toString(),n[r].htmlattributes={tabindex:s})}return n},fmi.prototype.clickHandler=function(e){var t=this.container.element.id+Mgi;switch(e.item.id){case t+kgi:this.container.documentEditor.openBlank(),this.documentEditor.focusIn();break;case t+Pgi:this.filePicker.value="",this.filePicker.click(),this.documentEditor.focusIn();break;case t+Bgi:this.container.documentEditor.editorHistoryModule.undo();break;case t+Fgi:this.container.documentEditor.editorHistoryModule.redo();break;case t+Ogi:this.container.documentEditor.showDialog("Table");break;case t+Ngi:this.container.documentEditor.showDialog("Hyperlink");break;case t+Vgi:this.container.documentEditor.showDialog("Bookmark");break;case t+_gi:this.documentEditor.editorModule.isUserInsert=!0,this.documentEditor.editorModule.insertComment(""),this.documentEditor.editorModule.isUserInsert=!1;break;case t+Hgi:this.toggleTrackChangesInternal(e.item.id);break;case t+jgi:this.container.documentEditor.selectionModule.goToHeader(),this.container.statusBar.toggleWebLayout();break;case t+zgi:this.onToc();break;case t+mmi:this.container.documentEditor.isXmlPaneTool||this.container.documentEditor.showXmlPane(),this.container.statusBar.toggleWebLayout();break;case t+Wgi:this.container.documentEditor.selectionModule.goToFooter(),this.container.statusBar.toggleWebLayout();break;case t+Ugi:this.container.documentEditor.editorModule.insertPageNumber();break;case t+"_find":this.container.documentEditor.showOptionsPane();break;case t+Ygi:this.toggleLocalPaste(e.item.id);break;case t+nmi:this.documentEditor.updateFields();break;case t+rmi:this.documentEditor.editorModule.insertFootnote();break;case t+smi:this.documentEditor.editorModule.insertEndnote();break;default:this.container.trigger(qJt,e)}e.item.id!==t+kgi&&e.item.id!==t+Pgi&&e.item.id!==t+Bgi&&e.item.id!==Fgi&&e.item.id!==t+mmi&&e.item.id!==t+_gi&&e.item.id!==t+Hgi&&e.item.id!==t+jgi&&e.item.id!==t+zgi&&e.item.id!==t+Wgi&&e.item.id!==t+Ugi&&e.item.id!==t+Ygi&&e.item.id!==t+nmi&&e.item.id!==t+rmi&&e.item.id!==t+smi&&e.item.id!==t+Qgi&&e.item.id!==t+qgi&&e.item.id!==t+Xgi&&e.item.id!==t+imi||this.documentEditor.focusIn()},fmi.prototype.toggleLocalPaste=function(e){this.container.enableLocalPaste=!this.container.enableLocalPaste,this.toggleButton(e,this.container.enableLocalPaste)},fmi.prototype.toggleEditing=function(){this.container.restrictEditing=!this.container.restrictEditing,this.container.showPropertiesPane=!this.container.restrictEditing},fmi.prototype.toggleRestrictEditing=function(e){var t=this.container.element.id+Mgi+Xgi;document.getElementById(t)&&this.toggleButton(t,e)},fmi.prototype.toggleButton=function(e,t){e=document.getElementById(e);t?(mt(e,["e-btn-toggle"],[]),e.setAttribute("aria-pressed","true")):(mt(e,[],["e-btn-toggle"]),e.setAttribute("aria-pressed","false"))},fmi.prototype.toggleTrackChangesInternal=function(e,t){je(t)||(this.container.enableTrackChanges=!t),this.container.enableTrackChanges=!this.container.enableTrackChanges,this.toggleButton(e,this.container.enableTrackChanges)},fmi.prototype.togglePropertiesPane=function(){this.container.showPropertiesPane=!this.container.showPropertiesPane},fmi.prototype.onDropDownButtonSelect=function(e){var t=this,i=this.container.element.id+Mgi,e=e.item.id;e===i+Rgi?(this.imagePicker.value="",this.imagePicker.click()):e===i+"_page_set"?this.container.documentEditor.showDialog("PageSetup"):e===i+"_columns"?this.container.documentEditor.showDialog("Columns"):e===i+cmi?this.container.documentEditor.editor.insertContentControl("Date"):e===i+umi?this.container.documentEditor.editor.insertContentControl("CheckBox"):e===i+dmi?this.container.documentEditor.editor.insertContentControl("ComboBox"):e===i+lmi?this.container.documentEditor.editor.insertContentControl("RichText"):e===i+hmi?this.container.documentEditor.editor.insertContentControl("Text"):e===i+gmi?this.container.documentEditor.showDialog("PictureContentControl"):e===i+pmi?this.container.documentEditor.editor.insertContentControl("DropDownList"):e!==i+"_image_url"&&(e===i+emi?this.toggleEditing():e===i+tmi?this.documentEditor.documentHelper.restrictEditingPane.showHideRestrictPane(!0):e===i+"_checkbox"?this.documentEditor.editorModule.insertFormField("CheckBox"):e===i+"_dropdown"?this.documentEditor.editorModule.insertFormField("DropDown"):e===i+omi&&this.documentEditor.editorModule.insertFormField("Text")),setTimeout(function(){t.documentEditor.focusIn()},30)},fmi.prototype.onFileChange=function(){var e,t,i=this,n=this.filePicker.files[0],o={fileSize:n.size,isCanceled:void 0};this.documentEditor.trigger(GJt,o),o.isCanceled||n&&(".sfdt"===(e=n.name.substr(n.name.lastIndexOf(".")))||".txt"===e?((t=new FileReader).onload=function(){".txt"===e?i.container.documentEditor.documentHelper.openTextFile(t.result):i.container.documentEditor.openAsync(t.result)},t.readAsText(n)):this.isSupportedFormatType(e.toLowerCase())?this.documentEditor.open(n):(o=new Cn("documenteditor",this.documentEditor.defaultLocale),WC.alert({content:o.getConstant("Unsupported format"),closeOnEscape:!0,showCloseIcon:!0,position:{X:"center",Y:"center"}}).enableRtl=this.container.enableRtl),this.container.documentEditor.documentName=n.name.substr(0,n.name.lastIndexOf(".")))},fmi.prototype.isSupportedFormatType=function(e){switch(e){case".dotx":case".docx":case".docm":case".dotm":case".dot":case".doc":case".rtf":case".txt":case".xml":case".html":return!0;default:return!1}},fmi.prototype.failureHandler=function(e){"onError"===e.name?WC.alert({content:this.container.localObj.getConstant("Error in establishing connection with web server"),closeOnEscape:!0,showCloseIcon:!0,position:{X:"center",Y:"center"}}).enableRtl=this.container.enableRtl:(alert("Failed to load the file"),this.documentEditor.fireServiceFailure(e)),BA(this.container.containerTarget)},fmi.prototype.successHandler=function(e){this.container.documentEditor.open(e.data),BA(this.container.containerTarget)},fmi.prototype.onImageChange=function(){var e=this,t=this.imagePicker.files[0],i=new FileReader;i.onload=function(){e.insertImage(i.result)},i.readAsDataURL(t)},fmi.prototype.insertImage=function(e){var t=document.createElement("img"),i=this.container;t.addEventListener("load",function(){i.documentEditor.editorModule.insertImageInternal(e,!0,this.width,this.height,this.alt)}),t.src=e},fmi.prototype.enableDisableFormField=function(e){var t=document.getElementById("container_toolbar_form_fields");je(t)||this.toolbar.enableItems(t.parentElement,e)},fmi.prototype.enableDisableInsertComment=function(e){this.isCommentEditing=!e;var t=this.container.element.id+Mgi,t=document.getElementById(t+_gi);!this.container.enableComment&&t?this.toolbar.removeItems(t.parentElement):t&&(je(this.documentEditor)||!this.documentEditor.isReadOnly&&!this.documentEditor.documentHelper.isDocumentProtected||(e=this.documentEditor.documentHelper.isCommentOnlyMode||!this.documentEditor.isReadOnlyMode),this.toolbar.enableItems(t.parentElement,e))},fmi.prototype.toggleTrackChanges=function(e){var t=this.container.element.id+Mgi+Hgi;document.getElementById(t)&&this.toggleTrackChangesInternal(t,e)},fmi.prototype.enableDisableToolBarItem=function(e,t){if(!je(this.container.element)){for(var i=this.container.element.id+Mgi,n=0,o=this.toolbar.items;n<o.length;n++){var r=o[n],s=r.id;s===i+kgi||s===i+Pgi||s===i+"_find"||s===i+Ygi||s===i+Xgi||"Separator"===r.type||e&&this.isCommentEditing&&s===i+_gi||s!==i+Bgi&&s!==i+Fgi&&s!==i+Ogi&&s!==i+Ngi&&s!==i+Vgi&&s!==i+_gi&&s!==i+jgi&&s!==i+mmi&&s!==i+zgi&&s!==i+Wgi&&s!==i+Qgi&&s!==i+ami&&s!==i+Ugi&&s!==i+Lgi&&s!==i+imi&&s!==i+qgi&&s!==i+Hgi&&s!==i+rmi&&s!==i+smi&&s!==i+nmi||t&&this.documentEditor.documentHelper.isFormFillProtectedMode&&s===i+nmi||je(s=document.getElementById(r.id))||je(s.parentElement)||this.toolbar.enableItems(s.parentElement,e)}je(this.documentEditor)||this.enableDisableFormField(!this.documentEditor.enableHeaderAndFooter&&e&&!this.documentEditor.isReadOnlyMode);var a=this.documentEditor.selectionModule.isPlainContentControl(),a=((this.documentEditor.selectionModule.isinFootnote||this.documentEditor.selectionModule.isinEndnote||this.documentEditor.enableHeaderAndFooter||a)&&(this.containsItem(i+smi)&&this.toolbar.enableItems(document.getElementById(i+smi).parentElement,!1),this.containsItem(i+rmi)&&this.toolbar.enableItems(document.getElementById(i+rmi).parentElement,!1),this.containsItem(i+qgi)&&this.toolbar.enableItems(document.getElementById(i+qgi).parentElement,!1),a)&&(this.containsItem(i+Ogi)&&this.toolbar.enableItems(document.getElementById(i+Ogi).parentElement,!1),this.containsItem(i+Lgi)&&this.toolbar.enableItems(document.getElementById(i+Lgi).parentElement,!1),this.containsItem(i+_gi)&&this.toolbar.enableItems(document.getElementById(i+_gi).parentElement,!1),this.containsItem(i+Vgi)&&this.toolbar.enableItems(document.getElementById(i+Vgi).parentElement,!1),this.containsItem(i+Ngi)&&this.toolbar.enableItems(document.getElementById(i+Ngi).parentElement,!1),this.containsItem(i+imi)&&this.toolbar.enableItems(document.getElementById(i+imi).parentElement,!1),this.containsItem(i+ami))&&this.toolbar.enableItems(document.getElementById(i+ami).parentElement,!1),t&&!this.container.showPropertiesPane||(t&&(e=this.container.showPropertiesPane),mt(this.propertiesPaneButton.element.parentElement,e?[]:["e-de-overlay"],e?["e-de-overlay"]:[])),this.documentEditor.documentHelper.protectionType);(e||this.documentEditor.documentHelper.isDocumentProtected&&("FormFieldsOnly"===a||"CommentsOnly"===a))&&this.enableDisableUndoRedo(),this.documentEditor.documentHelper.isTrackedOnlyMode&&this.containsItem(i+Hgi)&&this.toolbar.enableItems(document.getElementById(i+Hgi).parentElement,!1)}},fmi.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},fmi.prototype.enableDisableUndoRedo=function(){var e,t=this.container.element.id+Mgi;0<=this.toolbarItems.indexOf("Undo")&&(je(e=document.getElementById(t+Bgi))||this.toolbar.enableItems(e.parentElement,this.container.documentEditor.editorHistoryModule.canUndo())),0<=this.toolbarItems.indexOf("Redo")&&(je(e=document.getElementById(t+Fgi))||this.toolbar.enableItems(e.parentElement,this.container.documentEditor.editorHistoryModule.canRedo()))},fmi.prototype.onToc=function(){"TableOfContents"===this.container.previousContext&&"none"===this.container.propertiesPaneContainer.style.display?(this.container.showPropertiesPane=!1,this.documentEditor.focusIn()):("block"===this.container.headerFooterProperties.element.style.display&&this.documentEditor.selectionModule.closeHeaderFooter(),this.enableDisablePropertyPaneButton(!1),this.container.showProperties("toc"))},fmi.prototype.enableDisablePropertyPaneButton=function(e){e?mt(this.propertiesPaneButton.element.firstChild,["e-pane-enabled"],["e-pane-disabled"]):mt(this.propertiesPaneButton.element.firstChild,["e-pane-disabled"],["e-pane-enabled"])},fmi.prototype.destroy=function(){var e;this.restrictDropDwn&&(this.restrictDropDwn.destroy(),this.restrictDropDwn=void 0),this.imgDropDwn&&(this.imgDropDwn.destroy(),this.imgDropDwn=void 0),this.PageSetUpDropDwn&&(this.PageSetUpDropDwn.destroy(),this.PageSetUpDropDwn=void 0),this.breakDropDwn&&(this.breakDropDwn.destroy(),this.breakDropDwn=void 0),this.formFieldDropDown&&(this.formFieldDropDown.destroy(),this.formFieldDropDown=void 0),this.ContentControlDropDwn&&(this.ContentControlDropDwn.destroy(),this.ContentControlDropDwn=void 0),this.toolbar&&(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.propertiesPaneButton&&this.propertiesPaneButton.destroy(),this.breakListView&&(this.breakListView.destroy(),this.breakListView=void 0),this.propertiesPaneButton=void 0,this.toolbarItems=[],this.toolbarItems=void 0,this.container=void 0},fmi);function fmi(e){this.isCommentEditing=!1,this.container=e,this.importHandler=new vJt}Object.defineProperty(vmi.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),Object.defineProperty(vmi.prototype,"toolbar",{get:function(){return this.container.toolbarModule},enumerable:!0,configurable:!0}),vmi.prototype.enableDisableElements=function(e){e?mt(this.element,[],["e-de-overlay"]):mt(this.element,["e-de-overlay"],[])},vmi.prototype.initHeaderFooterPane=function(){this.initializeHeaderFooter(),this.element.style.display="none",this.container.propertiesPaneContainer.appendChild(this.element)},vmi.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())},vmi.prototype.initializeHeaderFooter=function(){var e=this,t=(this.localObj=new Cn("documenteditorcontainer",this.container.defaultLocale,this.container.locale),this.elementId="header_footer_properties",this.element=Q("div",{id:this.documentEditor.element.id+this.elementId,className:"e-de-prop-pane"}),this.headerDiv=this.createDivTemplate("_header_footer",this.element,"padding-bottom:0"),mt(this.headerDiv,["e-de-cntr-pane-padding"],[]),this.headerLabel=Q("label",{className:"e-de-prop-header-label"}),this.headerLabel.innerHTML=this.localObj.getConstant("Header And Footer"),t=this.isRtl?"float:left;":"float:right;",this.closeIcon=Q("span",{id:"_header_footer_close",className:"e-de-ctnr-close e-de-close-icon e-icons",styles:"display:inline-block;cursor:pointer;"+t}),this.closeIcon.addEventListener("click",function(){e.onClose()}),this.headerDiv.appendChild(this.headerLabel),this.headerDiv.appendChild(this.closeIcon),this.optionsLabelDiv=this.createDivTemplate(this.elementId+"_options",this.element),mt(this.optionsLabelDiv,["e-de-cntr-pane-padding","e-de-prop-separator-line"],[]),this.optionsLabel=Q("label",{className:"e-de-ctnr-prop-label",styles:"height:20px;"}),this.optionsLabel.innerHTML=this.localObj.getConstant("Options"),this.optionsLabelDiv.appendChild(this.optionsLabel),this.optionsDiv=this.createDivTemplate(this.elementId+"_optionsDiv",this.optionsLabelDiv),this.firstPageDiv=this.createDivTemplate(this.elementId+"_firstPageDiv",this.optionsDiv),mt(this.firstPageDiv,["e-de-hdr-ftr-frst-div"],[]),Q("input",{id:"firstPage",className:"e-de-prop-sub-label"})),t=(this.firstPageDiv.appendChild(t),this.firstPage=new ib({label:this.localObj.getConstant("Different First Page"),change:this.changeFirstPageOptions.bind(this),cssClass:"e-de-prop-sub-label",enableRtl:this.isRtl}),this.firstPage.appendTo(t),this.firstPageDiv.children[0].setAttribute("title",this.localObj.getConstant("Different header and footer for first page")),this.oddOrEvenDiv=this.createDivTemplate(this.elementId+"_oddOrEvenDiv",this.optionsDiv),mt(this.oddOrEvenDiv,["e-de-hdr-ftr-frst-div"],[]),Q("input",{id:"oddOrEven",className:"e-de-sub-prop-label"})),t=(this.oddOrEvenDiv.appendChild(t),this.oddOrEven=new ib({label:this.localObj.getConstant("Different Odd And Even Pages"),change:this.changeoddOrEvenOptions.bind(this),cssClass:"e-de-prop-sub-label",enableRtl:this.isRtl}),this.oddOrEven.appendTo(t),this.oddOrEvenDiv.children[0].setAttribute("title",this.localObj.getConstant("Different header and footer for odd and even pages")),this.linkToPreviousDiv=this.createDivTemplate(this.elementId+"_linkToPreviousDiv",this.optionsDiv),Q("input",{id:"linkToPrevious",className:"e-de-sub-prop-label"})),t=(this.linkToPreviousDiv.appendChild(t),this.linkToPrevious=new ib({label:this.localObj.getConstant("Link to Previous"),change:this.changeLinkToPreviousOptions.bind(this),cssClass:"e-de-prop-sub-label",enableRtl:this.isRtl,checked:!0}),this.linkToPrevious.appendTo(t),this.linkToPreviousDiv.children[0].setAttribute("title",this.localObj.getConstant("Link to the previous Title")),this.positionLabelDiv=this.createDivTemplate(this.elementId+"_positionLabelDiv",this.element),mt(this.positionLabelDiv,["e-de-cntr-pane-padding","e-de-prop-separator-line"],[]),this.positionLabel=Q("label",{className:"e-de-ctnr-prop-label",styles:"height:20px;"}),this.positionLabel.innerHTML=this.localObj.getConstant("Position"),this.positionLabelDiv.appendChild(this.positionLabel),this.positionDiv=this.createDivTemplate(this.elementId+"_positionDiv",this.positionLabelDiv),this.headerTopDiv=this.createDivTemplate(this.elementId+"_headerTopDiv",this.positionDiv),mt(this.headerTopDiv,["e-de-hdr-ftr-top-div"],[]),this.headerTopLabel=Q("label",{className:"e-de-prop-sub-label",styles:"display:block"}),this.headerTopLabel.innerHTML=this.localObj.getConstant("Header from Top"),this.headerTopDiv.appendChild(this.headerTopLabel),Q("input",{id:this.documentEditor.element.id+"_headerFromTop",className:"e-de-prop-sub-label"})),t=(t.setAttribute("aria-label",this.localObj.getConstant("Header from Top")),this.headerTopDiv.appendChild(t),this.headerFromTop=new NL({value:36,cssClass:"e-de-prop-header-numeric",showSpinButton:!1,format:"n0",decimals:2,max:1584,min:0,enableRtl:this.isRtl}),this.headerFromTop.appendTo(t),this.headerFromTop.element.parentElement.setAttribute("title",this.localObj.getConstant("Distance from top of the page to top of the header")),this.footerBottomDiv=this.createDivTemplate(this.elementId+"_footerBottomDiv",this.positionDiv),this.footerBottomLabel=Q("label",{className:"e-de-prop-sub-label",styles:"display:block"}),this.footerBottomLabel.innerHTML=this.localObj.getConstant("Footer from Bottom"),this.footerBottomDiv.appendChild(this.footerBottomLabel),Q("input",{id:this.documentEditor.element.id+"_footerFromTop",className:"e-de-prop-sub-label"}));t.setAttribute("aria-label",this.localObj.getConstant("Footer from Bottom")),this.footerBottomDiv.appendChild(t),this.footerFromTop=new NL({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",this.localObj.getConstant("Distance from bottom of the page to bottom of the footer"))},vmi.prototype.createDivTemplate=function(e,t,i){return this.divElement=Q("div",i?{id:e,styles:i}:{id:e}),t.appendChild(this.divElement),this.divElement},vmi.prototype.wireEvents=function(){this.headerFromTop.element.addEventListener("click",this.HeaderTopApplyClickHook),this.footerFromTop.element.addEventListener("click",this.FooterTopApplyClickHook),this.headerFromTop.element.addEventListener("keydown",this.OnHeaderValueKeyDownHook),this.footerFromTop.element.addEventListener("keydown",this.OnFooterValueKeyDownHook),this.headerFromTop.element.addEventListener("blur",this.ChangeHeaderBlurHook),this.footerFromTop.element.addEventListener("blur",this.ChangeFooterBlurHook)},vmi.prototype.headerTopApply=function(){this.isHeaderTopApply=!0},vmi.prototype.footerTopapply=function(){this.isFooterTopApply=!0},vmi.prototype.changeHeaderBlur=function(){this.changeHeaderValue(),this.isHeaderTopApply=!1},vmi.prototype.changeFooterBlur=function(){this.changeFooterValue(),this.isFooterTopApply=!1},vmi.prototype.onClose=function(){this.container.showHeaderProperties=!0,this.container.documentEditor.selectionModule.closeHeaderFooter()},vmi.prototype.changeFirstPageOptions=function(){var e=this;this.documentEditor.isReadOnly||(this.documentEditor.selectionModule.sectionFormat.differentFirstPage=this.firstPage.checked,setTimeout(function(){e.documentEditor.focusIn()},10))},vmi.prototype.changeoddOrEvenOptions=function(){var e=this;this.documentEditor.isReadOnly||(this.documentEditor.selectionModule.sectionFormat.differentOddAndEvenPages=this.oddOrEven.checked,setTimeout(function(){e.documentEditor.focusIn()},10))},vmi.prototype.changeLinkToPreviousOptions=function(){var e=this;if(!this.documentEditor.isReadOnly){var t=this.documentEditor.selectionModule.start.paragraph.containerWidget.headerFooterType,i=this.linkToPrevious.checked;switch(t){case"OddHeader":this.documentEditor.selectionModule.sectionFormat.oddPageHeader.linkToPrevious=i;break;case"OddFooter":this.documentEditor.selectionModule.sectionFormat.oddPageFooter.linkToPrevious=i;break;case"EvenHeader":this.documentEditor.selectionModule.sectionFormat.evenPageHeader.linkToPrevious=i;break;case"EvenFooter":this.documentEditor.selectionModule.sectionFormat.evenPageFooter.linkToPrevious=i;break;case"FirstPageHeader":this.documentEditor.selectionModule.sectionFormat.firstPageHeader.linkToPrevious=i;break;case"FirstPageFooter":this.documentEditor.selectionModule.sectionFormat.firstPageFooter.linkToPrevious=i}setTimeout(function(){e.documentEditor.focusIn()},10)}},vmi.prototype.changeHeaderValue=function(){var e;this.isHeaderTopApply&&!this.documentEditor.isReadOnly&&((e=this.headerFromTop.value)>this.headerFromTop.max&&(e=this.headerFromTop.max),this.documentEditor.selectionModule.sectionFormat.headerDistance=e)},vmi.prototype.onHeaderValue=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.changeHeaderValue(),t.isHeaderTopApply=!1},30)},vmi.prototype.onFooterValue=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.changeFooterValue(),t.isFooterTopApply=!1},30)},vmi.prototype.changeFooterValue=function(){var e;this.isFooterTopApply&&!this.documentEditor.isReadOnly&&((e=this.footerFromTop.value)>this.footerFromTop.max&&(e=this.footerFromTop.max),this.documentEditor.selectionModule.sectionFormat.footerDistance=e)},vmi.prototype.onSelectionChange=function(){if(this.headerFromTop.value=this.documentEditor.selectionModule.sectionFormat.headerDistance,this.footerFromTop.value=this.documentEditor.selectionModule.sectionFormat.footerDistance,this.documentEditor.selectionModule.sectionFormat.differentFirstPage?this.firstPage.checked=!0:this.firstPage.checked=!1,this.documentEditor.selectionModule.sectionFormat.differentOddAndEvenPages?this.oddOrEven.checked=!0:this.oddOrEven.checked=!1,0===this.documentEditor.selectionModule.start.paragraph.bodyWidget.sectionIndex)this.linkToPrevious.disabled=!0;else switch(this.linkToPrevious.disabled=!1,this.documentEditor.selectionModule.start.paragraph.containerWidget.headerFooterType){case"OddHeader":this.linkToPrevious.checked=this.documentEditor.selectionModule.sectionFormat.oddPageHeader.linkToPrevious;break;case"OddFooter":this.linkToPrevious.checked=this.documentEditor.selectionModule.sectionFormat.oddPageFooter.linkToPrevious;break;case"EvenHeader":this.linkToPrevious.checked=this.documentEditor.selectionModule.sectionFormat.evenPageHeader.linkToPrevious;break;case"EvenFooter":this.linkToPrevious.checked=this.documentEditor.selectionModule.sectionFormat.evenPageFooter.linkToPrevious;break;case"FirstPageHeader":this.linkToPrevious.checked=this.documentEditor.selectionModule.sectionFormat.firstPageHeader.linkToPrevious;break;case"FirstPageFooter":this.linkToPrevious.checked=this.documentEditor.selectionModule.sectionFormat.firstPageFooter.linkToPrevious}},vmi.prototype.destroy=function(){this.unWireEvents(),this.removeHTMLDOM(),this.element&&(this.element.innerHTML="",this.element.parentElement)&&this.element.parentElement.removeChild(this.element),this.element=void 0,this.firstPage&&this.firstPage.destroy(),this.firstPage=void 0,this.oddOrEven&&this.oddOrEven.destroy(),this.oddOrEven=void 0,this.linkToPrevious&&this.linkToPrevious.destroy(),this.linkToPrevious=void 0,this.headerFromTop&&(this.headerFromTop.destroy(),this.headerFromTop=void 0),this.footerFromTop&&(this.footerFromTop.destroy(),this.footerFromTop=void 0),this.container=void 0,this.localObj=void 0,this.elementId=void 0},vmi.prototype.unWireEvents=function(){this.headerFromTop.element.removeEventListener("click",this.HeaderTopApplyClickHook),this.footerFromTop.element.removeEventListener("click",this.FooterTopApplyClickHook),this.headerFromTop.element.removeEventListener("keydown",this.OnHeaderValueKeyDownHook),this.footerFromTop.element.removeEventListener("keydown",this.OnFooterValueKeyDownHook),this.headerFromTop.element.removeEventListener("blur",this.ChangeHeaderBlurHook),this.footerFromTop.element.removeEventListener("blur",this.ChangeFooterBlurHook),this.HeaderTopApplyClickHook=void 0,this.FooterTopApplyClickHook=void 0,this.OnHeaderValueKeyDownHook=void 0,this.OnFooterValueKeyDownHook=void 0,this.ChangeHeaderBlurHook=void 0,this.ChangeFooterBlurHook=void 0},vmi.prototype.removeHTMLDOM=function(){this.headerDiv.remove(),this.headerLabel.remove(),this.closeIcon.remove(),this.optionsLabelDiv.remove(),this.optionsLabel.remove(),this.optionsDiv.remove(),this.firstPageDiv.remove(),this.oddOrEvenDiv.remove(),this.linkToPreviousDiv.remove(),this.positionLabelDiv.remove(),this.positionLabel.remove(),this.positionDiv.remove(),this.headerTopDiv.remove(),this.headerTopLabel.remove(),this.footerBottomDiv.remove(),this.footerBottomLabel.remove(),this.divElement.remove()};var ymi=vmi;function vmi(e,t){this.isHeaderTopApply=!1,this.isFooterTopApply=!1,this.HeaderTopApplyClickHook=this.headerTopApply.bind(this),this.FooterTopApplyClickHook=this.footerTopapply.bind(this),this.OnHeaderValueKeyDownHook=this.onHeaderValue.bind(this),this.OnFooterValueKeyDownHook=this.onFooterValue.bind(this),this.ChangeHeaderBlurHook=this.changeHeaderBlur.bind(this),this.ChangeFooterBlurHook=this.changeFooterBlur.bind(this),this.container=e,this.isRtl=t,this.initHeaderFooterPane(),this.wireEvents()}Object.defineProperty(wmi.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),wmi.prototype.enableDisableElements=function(e){e?mt(this.element,[],["e-de-overlay"]):mt(this.element,["e-de-overlay"],[])},wmi.prototype.initializeImageProperties=function(){this.element=Q("div",{id:this.elementId+"_imageProperties",className:"e-de-prop-pane"}),this.element.style.display="none",this.container.propertiesPaneContainer.appendChild(this.element),this.initImageProp(),this.initImageAltProp(),this.wireEvents()},wmi.prototype.initImageProp=function(){var e=new Cn("documenteditorcontainer",this.container.defaultLocale,this.container.locale);this.imageDiv=Q("div",{id:this.elementId+"_imageDiv",className:"e-de-cntr-pane-padding e-de-prop-separator-line"}),this.element.appendChild(this.imageDiv),this.label=Q("label",{className:"e-de-ctnr-prop-label"}),this.label.textContent=e.getConstant("Image"),this.imageDiv.appendChild(this.label),this.outerDiv=Q("div"),this.imageDiv.appendChild(this.outerDiv),this.widthElement=this.createImagePropertiesDiv("_widthDiv",this.outerDiv,"_widthInput",e.getConstant("W"),e.getConstant("Width")),this.widthNumericBox=new NL({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",this.outerDiv,"_heightInput",e.getConstant("H"),e.getConstant("Height")),this.heightNumericBox=new NL({min:0,max:23500,cssClass:"e-de-image-property",showSpinButton:!1,format:"n0",decimals:2}),this.heightNumericBox.appendTo(this.heightElement),this.aspectRatioDiv=Q("div",{id:this.elementId+"_aspectRatioDiv"}),this.aspectRatioDiv.setAttribute("title",e.getConstant("Aspect ratio")),this.outerDiv.appendChild(this.aspectRatioDiv),this.aspectRatio=Q("input",{id:this.elementId+"_aspectRatio",className:"e-de-ctnr-prop-label"}),this.aspectRatioDiv.appendChild(this.aspectRatio),this.aspectRatioBtn=new ib({label:e.getConstant("Aspect ratio"),enableRtl:this.isRtl},this.aspectRatio)},wmi.prototype.initImageAltProp=function(){var e=new Cn("documenteditorcontainer",this.container.defaultLocale,this.container.locale);this.altDiv=Q("div",{id:this.elementId+"_altDiv",className:"e-de-cntr-pane-padding e-de-prop-separator-line"}),this.element.appendChild(this.altDiv),this.alabel=Q("label",{className:"e-de-ctnr-prop-label"}),this.alabel.textContent=e.getConstant("Alternate Text"),this.altDiv.appendChild(this.alabel),this.textArea=Q("textarea",{id:this.elementId+"_textarea",className:"e-de-ctnr-prop-label "}),this.altDiv.appendChild(this.textArea),this.textareaObj=new fV({floatLabelType:"Never"}),this.textareaObj.appendTo(this.textArea)},wmi.prototype.createImagePropertiesDiv=function(e,t,i,n,o){e=Q("div",{id:this.elementId+e,styles:"position: relative;width: 100%;",className:"e-de-ctnr-segment"}),e.setAttribute("title",o),t.appendChild(e),o=Q("input",{id:this.elementId+i,className:"e-textbox",styles:"width:100%;"}),e.appendChild(o),t=Q("span",{className:"e-de-img-prty-span"});return t.textContent=n,e.appendChild(t),o},wmi.prototype.wireEvents=function(){this.aspectRatioBtn.element.addEventListener("change",this.onAspectRatioBtnClickHook),this.widthNumericBox.element.addEventListener("click",this.widthBlurHook),this.heightNumericBox.element.addEventListener("click",this.heightBlurHook),this.widthNumericBox.element.addEventListener("keydown",this.onImageWidthHook),this.heightNumericBox.element.addEventListener("keydown",this.onImageHeightHook),this.widthNumericBox.element.addEventListener("blur",this.widthNumericBlurHook),this.heightNumericBox.element.addEventListener("blur",this.heightNumericBlurHook),this.textArea.addEventListener("blur",this.altTextAreaBlurHook)},wmi.prototype.altTextAreaBlur=function(){this.documentEditor.selectionModule.imageFormat.alternateText!==this.textArea.value&&this.applyImageAlternativeText()},wmi.prototype.heightNumericBlur=function(){this.applyImageHeight(),this.isHeightApply=!1},wmi.prototype.widthNumericBlur=function(){this.applyImageWidth(),this.isWidthApply=!1},wmi.prototype.widthBlur=function(){this.isWidthApply=!0},wmi.prototype.heightBlur=function(){this.isHeightApply=!0},wmi.prototype.applyImageAlternativeText=function(){var e=go.sanitize(this.textArea.value);je(e)||this.documentEditor.selectionModule.imageFormat.applyImageAlternativeText(e)},wmi.prototype.onImageWidth=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.applyImageWidth(),t.isWidthApply=!1},30)},wmi.prototype.onImageHeight=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.applyImageHeight(),t.isHeightApply=!1},30)},wmi.prototype.applyImageWidth=function(){var e,t;this.isMaintainAspectRatio?this.isMaintainAspectRatio&&(t=(e=(e=this.widthNumericBox.value)>this.widthNumericBox.max?this.widthNumericBox.max:e)/this.documentEditor.selectionModule.imageFormat.width,t=this.heightNumericBox.value*t,this.heightNumericBox.value=t,null!==e)&&null!==t&&this.documentEditor.selectionModule.imageFormat.resize(e,t):(e=this.widthNumericBox.value,t=this.heightNumericBox.value,e>this.widthNumericBox.max&&(e=this.widthNumericBox.max),t>this.heightNumericBox.max&&(t=this.heightNumericBox.max),null!==e&&null!==t&&this.documentEditor.selectionModule.imageFormat.resize(e,t))},wmi.prototype.applyImageHeight=function(){var e,t;this.isMaintainAspectRatio?this.isMaintainAspectRatio&&(e=(t=this.heightNumericBox.value)/this.documentEditor.selectionModule.imageFormat.height,e=this.widthNumericBox.value*e,null!==(this.widthNumericBox.value=e))&&null!==t&&this.documentEditor.selectionModule.imageFormat.resize(e,t):(e=this.widthNumericBox.value,t=this.heightNumericBox.value,null!==e&&null!==t&&this.documentEditor.selectionModule.imageFormat.resize(e,t))},wmi.prototype.onAspectRatioBtnClick=function(){this.isMaintainAspectRatio?this.isMaintainAspectRatio=!1:this.isMaintainAspectRatio=!0},wmi.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())},wmi.prototype.updateImageProperties=function(){this.widthNumericBox.value=this.documentEditor.selectionModule.imageFormat.width,this.heightNumericBox.value=this.documentEditor.selectionModule.imageFormat.height,je(this.documentEditor.selectionModule.imageFormat.alternateText)?this.textArea.value="":this.textArea.value=this.documentEditor.selectionModule.imageFormat.alternateText},wmi.prototype.destroy=function(){this.unWireEvents(),this.removeHTMLDom(),this.widthNumericBox&&this.widthNumericBox.destroy(),this.widthNumericBox=void 0,this.heightNumericBox&&this.heightNumericBox.destroy(),this.heightNumericBox=void 0,this.aspectRatioBtn&&this.aspectRatioBtn.destroy(),this.aspectRatioBtn=void 0,this.textareaObj&&(this.textareaObj.destroy(),this.textArea.remove(),this.textArea=void 0),this.element&&(this.element.innerHTML="",this.element=void 0),this.container=void 0},wmi.prototype.removeHTMLDom=function(){this.outerDiv.remove(),this.label.remove(),this.imageDiv.remove(),this.aspectRatioDiv.remove(),this.aspectRatio.remove(),this.alabel.remove(),this.textArea.remove(),this.altDiv.remove(),this.element.remove()},wmi.prototype.unWireEvents=function(){this.aspectRatioBtn.element.removeEventListener("change",this.onAspectRatioBtnClickHook),this.widthNumericBox.element.removeEventListener("click",this.widthBlurHook),this.heightNumericBox.element.removeEventListener("click",this.heightBlurHook),this.widthNumericBox.element.removeEventListener("keydown",this.onImageWidthHook),this.heightNumericBox.element.removeEventListener("keydown",this.onImageHeightHook),this.widthNumericBox.element.removeEventListener("blur",this.widthNumericBlurHook),this.heightNumericBox.element.removeEventListener("blur",this.heightNumericBlurHook),this.textArea.removeEventListener("blur",this.altTextAreaBlurHook),this.onAspectRatioBtnClickHook=void 0,this.widthBlurHook=void 0,this.heightBlurHook=void 0,this.onImageWidthHook=void 0,this.onImageHeightHook=void 0,this.widthNumericBlurHook=void 0,this.heightNumericBlurHook=void 0,this.altTextAreaBlurHook=void 0};var bmi=wmi;function wmi(e,t){this.isWidthApply=!1,this.isHeightApply=!1,this.onAspectRatioBtnClickHook=this.onAspectRatioBtnClick.bind(this),this.widthBlurHook=this.widthBlur.bind(this),this.heightBlurHook=this.heightBlur.bind(this),this.onImageWidthHook=this.onImageWidth.bind(this),this.onImageHeightHook=this.onImageHeight.bind(this),this.widthNumericBlurHook=this.widthNumericBlur.bind(this),this.heightNumericBlurHook=this.heightNumericBlur.bind(this),this.altTextAreaBlurHook=this.altTextAreaBlur.bind(this),this.container=e,this.elementId=this.documentEditor.element.id,this.isMaintainAspectRatio=!1,this.isRtl=t,this.initializeImageProperties()}Object.defineProperty(Smi.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),Object.defineProperty(Smi.prototype,"toolbar",{get:function(){return this.container.toolbarModule},enumerable:!0,configurable:!0}),Smi.prototype.enableDisableElements=function(e){e?mt(this.element,[],["e-de-overlay"]):mt(this.element,["e-de-overlay"],[])},Smi.prototype.initializeTocPane=function(){this.localObj=new Cn("documenteditorcontainer",this.container.defaultLocale,this.container.locale),this.element=Q("div",{id:this.elementId+"_tocProperties",className:"e-de-prop-pane"});var e=Q("div",{className:"e-de-cntr-pane-padding e-de-prop-separator-line"});this.tocHeaderDiv(e),this.initTemplates(e),e=Q("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)},Smi.prototype.updateTocProperties=function(){this.rightalignPageNumber.checked=!0,this.showPageNumber.checked=!0,this.hyperlink.checked=!0},Smi.prototype.wireEvents=function(){this.cancelBtn.element.addEventListener("click",this.onCloseClickHook),this.updateBtn.element.addEventListener("click",this.onInsertToClickHook),this.closeButton.addEventListener("click",this.onCloseClickHook)},Smi.prototype.onCloseClick=function(){this.onClose()},Smi.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)},Smi.prototype.tocHeaderDiv=function(e){var t,i=this.isRtl?(t="float:left;","margin-left:7px;"):(t="float:right;","margin-right:7px;");this.headerDiv=Q("div",{id:this.elementId+"toc_id",styles:"display: block;"}),e.appendChild(this.headerDiv),this.element.appendChild(e),this.title=Q("label",{className:"e-de-ctnr-prop-label"}),this.title.textContent=this.localObj.getConstant("Table of Contents"),this.headerDiv.appendChild(this.title),this.closeButton=Q("span",{className:"e-de-ctnr-close e-icons",styles:"cursor: pointer;display:inline-block;color: #4A4A4A;"+t+i}),this.headerDiv.appendChild(this.closeButton)},Smi.prototype.initTemplates=function(e){this.template1(e)},Smi.prototype.template1=function(e){this.template1Div=Q("div",{className:"e-de-toc-template1"}),this.isRtl&&this.template1Div.classList.add("e-de-rtl"),e.appendChild(this.template1Div),this.templateContent1=Q("div",{className:"e-de-toc-template1-content1"}),this.templateContent1.textContent=this.localObj.getConstant("HEADING - - - - 1"),this.template1Div.appendChild(this.templateContent1),this.templateContent2=Q("div",{className:"e-de-toc-template1-content2"}),this.templateContent2.textContent=this.localObj.getConstant("HEADING - - - - 2"),this.template1Div.appendChild(this.templateContent2),this.templateContent3=Q("div",{className:"e-de-toc-template1-content3"}),this.templateContent3.textContent=this.localObj.getConstant("HEADING - - - - 3"),this.template1Div.appendChild(this.templateContent3)},Smi.prototype.tocOptionsDiv=function(e){this.optionsDiv=Q("div"),e.appendChild(this.optionsDiv),this.element.appendChild(e),this.isRtl&&this.optionsDiv.classList.add("e-de-rtl"),this.label=Q("label",{className:"e-de-ctnr-prop-label"}),this.label.textContent=this.localObj.getConstant("Options"),this.optionsDiv.appendChild(this.label)},Smi.prototype.createDropDownButton=function(e,t,i,n,o){e=Q("input",{id:e});return t.appendChild(e),new qz({index:o,dataSource:n,popupHeight:"150px",cssClass:"e-de-prop-font-button",placeholder:this.localObj.getConstant("Levels")},e)},Smi.prototype.contentStylesDropdown=function(e){var t=this;this.isRtl,this.contentStyleElement=Q("div",{id:"contentstyle_div"}),this.contentStyleElement.setAttribute("title",this.localObj.getConstant("Number of heading or outline levels to be shown in table of contents")),e.appendChild(this.contentStyleElement),this.isRtl,this.dropDownLabel=Q("label",{className:"e-de-prop-sub-label",styles:"display:block"}),this.dropDownLabel.textContent=this.localObj.getConstant("Levels"),this.contentStyleElement.appendChild(this.dropDownLabel),e.appendChild(this.contentStyleElement);this.borderLevelStyle=this.createDropDownButton(this.elementId+"_borderLevelDiv",this.contentStyleElement,"",["1","2","3","4","5","6","7","8","9"],2),this.borderLevelStyle.change=function(e){t.borderLevelStyle.value=e.item.value},e.appendChild(this.contentStyleElement)},Smi.prototype.checkboxContent=function(e){this.isRtl,this.checkboxElement=Q("div",{id:"toc_checkboxDiv",styles:"margin-bottom:36px;"}),e.appendChild(this.checkboxElement),this.showPageNumberDiv=Q("div",{className:"e-de-toc-checkbox1"}),this.showPageNumberDiv.setAttribute("title",this.localObj.getConstant("Show page numbers in table of contents")),this.checkboxElement.appendChild(this.showPageNumberDiv),this.showpagenumberCheckboxElement=Q("input",{id:"showpagenumber",styles:"width:12px;height:12px;margin-bottom:8px",className:"e-de-prop-sub-label"}),this.showPageNumberDiv.appendChild(this.showpagenumberCheckboxElement),this.showPageNumber=new ib({label:this.localObj.getConstant("Show page numbers"),enableRtl:this.isRtl}),this.showPageNumber.appendTo(this.showpagenumberCheckboxElement),this.rightAlignDiv=Q("div",{className:"e-de-toc-checkbox2"}),this.rightAlignDiv.setAttribute("title",this.localObj.getConstant("Right align page numbers in table of contents")),this.checkboxElement.appendChild(this.rightAlignDiv),this.rightalignpagenumberCheckboxElement=Q("input",{id:"rightalignpagenumber",styles:"width:12px;height:12px",className:"e-de-prop-sub-label"}),this.rightAlignDiv.appendChild(this.rightalignpagenumberCheckboxElement),this.rightalignPageNumber=new ib({label:this.localObj.getConstant("Right align page numbers"),enableRtl:this.isRtl}),this.rightalignPageNumber.appendTo(this.rightalignpagenumberCheckboxElement),this.hyperlinkDiv=Q("div",{className:"e-de-toc-checkbox3"}),this.hyperlinkDiv.setAttribute("title",this.localObj.getConstant("Use hyperlinks instead of page numbers")),this.checkboxElement.appendChild(this.hyperlinkDiv),this.hyperlinkCheckboxElement=Q("input",{id:"hyperlinkdiv",styles:"width:12px;height:12px",className:"e-de-prop-sub-label"}),this.hyperlinkDiv.appendChild(this.hyperlinkCheckboxElement),this.hyperlink=new ib({label:this.localObj.getConstant("Use hyperlinks"),enableRtl:this.isRtl}),this.hyperlink.appendTo(this.hyperlinkCheckboxElement)},Smi.prototype.buttonDiv=function(e){var t=this.isRtl?"float:left":"float:right";this.footerElement=Q("div",{id:"footerDiv",styles:t}),e.appendChild(this.footerElement),this.updatebuttoncontentStyleElement=Q("button",{id:"footerupdatebuttonDiv",attrs:{type:"button"}}),this.footerElement.appendChild(this.updatebuttoncontentStyleElement),this.updateBtn=new zv({content:this.localObj.getConstant("Update"),cssClass:"btn-update",isPrimary:!0}),this.updateBtn.appendTo(this.updatebuttoncontentStyleElement),this.cancelbuttoncontentStyleElement=Q("button",{id:"footercancelbuttonDiv",attrs:{type:"button"}}),this.footerElement.appendChild(this.cancelbuttoncontentStyleElement),this.cancelBtn=new zv({content:this.localObj.getConstant("Cancel"),cssClass:this.isRtl?"e-de-btn-cancel-rtl":"e-de-btn-cancel"}),this.cancelbuttoncontentStyleElement.setAttribute("aria-label",this.cancelBtn.content),this.cancelBtn.appendTo(this.cancelbuttoncontentStyleElement)},Smi.prototype.enableDisableInsertButton=function(e){"Text"===this.prevContext?this.updateBtn.disabled=e:this.updateBtn.disabled=!1},Smi.prototype.showTocPane=function(e,t){var i,n;!e&&"none"===this.element.style.display||e&&"block"===this.element.style.display?this.updateBtn&&this.enableDisableInsertButton(!1):(this.element.style.display=e?"block":"none",this.updateBtn.content="TableOfContents"===this.documentEditor.selectionModule.contextType?this.localObj.getConstant("Update"):this.localObj.getConstant("Insert"),this.updateBtn.element.setAttribute("aria-label",this.updateBtn.content),this.prevContext=this.documentEditor.selectionModule.contextType,"TableOfContents"===this.documentEditor.selectionModule.contextType?(i=this.documentEditor.selectionModule.getTocFieldInternal(),-1===(n=this.documentEditor.selectionModule.getFieldCode(i)).toLocaleLowerCase().indexOf("toc")||je(this.documentEditor.editorModule)||(n=this.documentEditor.editorModule.getTocSettings(n,i),this.borderLevelStyle.value=n.endLevel.toString())):this.borderLevelStyle.value="3",this.enableDisableInsertButton(this.documentEditor.selectionModule.isPlainContentControl()),this.documentEditor.resize(),e&&this.documentEditor.enableAutoFocus&&this.updateBtn.element.focus())},Smi.prototype.onInsertToc=function(){var e={startLevel:1,endLevel:parseInt(this.borderLevelStyle.value,0),includeHyperlink:this.hyperlink.checked,includeOutlineLevels:!0,includePageNumber:this.showPageNumber.checked,rightAlign:this.rightalignPageNumber.checked};e.rightAlign&&(e.tabLeader="Dot"),this.documentEditor.editorModule.insertTableOfContents(e),this.documentEditor.focusIn()},Smi.prototype.destroy=function(){this.container=void 0,this.removeHTMLDOM(),this.unWireEvents(),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),this.hyperlink&&this.hyperlink.destroy(),this.hyperlink=void 0,this.updateBtn&&this.updateBtn.destroy(),this.updateBtn=void 0,this.cancelBtn&&this.cancelBtn.destroy(),this.cancelBtn=void 0,this.localObj=void 0,this.isRtl=void 0,this.element&&(this.element.innerHTML="",this.element=void 0)},Smi.prototype.unWireEvents=function(){this.cancelBtn.element.removeEventListener("click",this.onCloseClickHook),this.updateBtn.element.removeEventListener("click",this.onInsertToClickHook),this.closeButton.removeEventListener("click",this.onCloseClickHook),this.onCloseClickHook=void 0,this.onInsertToClickHook=void 0},Smi.prototype.removeHTMLDOM=function(){this.template1Div.remove(),this.headerDiv.remove(),this.closeButton.remove(),this.title.remove(),this.templateContent1.remove(),this.templateContent2.remove(),this.templateContent3.remove(),this.optionsDiv.remove(),this.label.remove(),this.contentStyleElement.remove(),this.checkboxElement.remove(),this.showPageNumberDiv.remove(),this.showpagenumberCheckboxElement.remove(),this.rightAlignDiv.remove(),this.rightalignpagenumberCheckboxElement.remove(),this.hyperlinkDiv.remove(),this.hyperlinkCheckboxElement.remove(),this.footerElement.remove(),this.updatebuttoncontentStyleElement.remove(),this.cancelbuttoncontentStyleElement.remove()};var Cmi=Smi;function Smi(e,t){this.onCloseClickHook=this.onCloseClick.bind(this),this.onInsertToClickHook=this.onInsertToc.bind(this),this.container=e,this.elementId=this.documentEditor.element.id,this.isRtl=t,this.initializeTocPane()}Object.defineProperty(xmi.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),xmi.prototype.initializeTextPropertiesDiv=function(e,t){this.localObj=new Cn("documenteditorcontainer",this.container.defaultLocale,this.container.locale),this.textProperties=e;var i=this.documentEditor.element.id+"_font_properties",e=this.createDiv(i+"_text",e),n=(mt(e,["e-de-cntr-pane-padding","e-de-prop-separator-line"],[]),this.createDiv(i+"_sizeStyle",e,"display:inline-flex;")),o=(mt(n,["e-de-ctnr-segment"],[]),t&&mt(n,["e-de-ctnr-segment-rtl"],[]),this.createDiv(i+"_fontFamilyDiv",n)),r=Q("input",{id:i+"_fontFamily",className:"e-prop-font-style"}),o=(o.appendChild(r),mt(o,["e-de-panel-left-width"],[]),this.createDropDownListForFamily(r),this.createDiv(i+"_fontSizeDiv",n)),r="e-de-ctnr-group-btn e-de-char-fmt-btn-left e-btn-group",n=(t&&(r="e-rtl "+r),Q("input",{id:i+"_fontSize",innerHTML:"type:number",className:"e-prop-font-style"})),o=(o.appendChild(n),mt(o,["e-de-panel-right-width"],[]),this.createDropDownListForSize(n),Q("div",{id:i+"_properties",styles:"display:inline-flex;",className:"e-de-ctnr-segment"})),n=(t&&mt(o,["e-de-ctnr-segment-rtl"],[]),e.appendChild(o),Q("div",{id:i+"_leftDiv",className:r,styles:"display:inline-flex;"})),n=(o.appendChild(n),this.bold=this.createButtonTemplate(i+"_bold","e-de-ctnr-bold e-icons",n,"e-de-prop-font-button","40.5","Bold Tooltip"),this.italic=this.createButtonTemplate(i+"_italic","e-de-ctnr-italic e-icons",n,"e-de-prop-font-button","40.5","Italic Tooltip"),this.underline=this.createButtonTemplate(i+"_underline","e-de-ctnr-underline e-icons",n,"e-de-prop-font-button","40.5","Underline Tooltip"),this.strikethrough=this.createButtonTemplate(i+"_strikethrough","e-de-ctnr-strikethrough e-icons",n,"e-de-prop-font-last-button","40.5","Strikethrough"),r="e-de-ctnr-group-btn e-de-char-fmt-btn-right e-btn-group",Q("div",{id:i+"_rightDiv",className:r=t?"e-rtl "+r:r,styles:"display:inline-flex;"})),n=(o.appendChild(n),this.superscript=this.createButtonTemplate(i+"_superscript","e-de-ctnr-superscript e-icons",n,"e-de-prop-font-button","38.5","Superscript Tooltip"),this.subscript=this.createButtonTemplate(i+"_subscript","e-de-ctnr-subscript e-icons",n,"e-de-prop-font-last-button","38.5","Subscript Tooltip"),Q("div",{id:i+"_colorDiv",styles:"display:inline-flex;",className:"e-de-ctnr-segment"})),o=(t&&mt(o,["e-de-ctnr-segment-rtl"],[]),Q("div",{id:i+"_color",className:"e-de-font-clr-picker e-de-ctnr-group-btn",styles:"display:inline-flex;"})),n=(t&&mt(o,["e-rtl"],[]),n.appendChild(o),e.appendChild(n),this.fontColor=this.createFontColorPicker(i+"_textColor",40.5,o,this.localObj.getConstant("Font color")),mt(o.firstElementChild.lastElementChild.lastElementChild.firstChild,["e-de-ctnr-fontcolor","e-icons"],["e-caret"]),this.initializeHighlightColorElement(),this.highlightColor=this.createHighlightColorSplitButton(i+"_highlightColor",34.5,o,this.localObj.getConstant("Text highlight color")),mt(this.highlightColor.element.nextElementSibling.firstElementChild,["e-de-ctnr-highlight","e-icons"],["e-caret"]),this.highlightColorInputElement=this.highlightColor.element.firstChild,this.clearFormat=this.createButtonTemplate(i+"_clearFormat","e-de-ctnr-clearall e-icons",o,"e-de-prop-font-last-button","40.5","Clear all formatting"),Q("div",{id:i+"_rightDiv2",className:r.replace("e-btn-group",""),styles:"display:inline-flex;"}));t&&mt(n,["e-rtl"],[]),n.setAttribute("title",this.container.localObj.getConstant("Change case Tooltip")),e.appendChild(n),this.createChangecase(n)},xmi.prototype.createHighlightColorSplitButton=function(e,t,i,n){var o=this,e=Q("button",{id:e,attrs:{type:"button"}}),i=(i.appendChild(e),new b2({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 i.appendTo(e),i.click=function(){o.applyHighlightColor(o.highlightColorInputElement.style.backgroundColor)},i.element.firstChild.style.backgroundColor="rgb(255, 255, 0)",i.element.parentElement.setAttribute("title",n),i.element.parentElement.setAttribute("aria-label",n),i},xmi.prototype.openPopup=function(){this.highlightColorElement.style.display="block"},xmi.prototype.closePopup=function(){this.highlightColorElement.style.display="none"},xmi.prototype.initializeHighlightColorElement=function(){this.highlightColorElement=Q("div",{styles:"display:none;width:157px",className:"e-de-cntr-highlight-pane"});var e=this.createHightlighColorPickerDiv("#ffff00","yellowDiv"),t=this.createHightlighColorPickerDiv("#00ff00","brightGreenDiv"),i=this.createHightlighColorPickerDiv("#00ffff","turquoiseDiv"),n=this.createHightlighColorPickerDiv("#ff00ff","hotPinkDiv"),o=this.createHightlighColorPickerDiv("#0000ff","blueDiv"),r=this.createHightlighColorPickerDiv("#ff0000","redDiv"),s=this.createHightlighColorPickerDiv("#000080","darkBlueDiv"),a=this.createHightlighColorPickerDiv("#008080","tealDiv"),l=this.createHightlighColorPickerDiv("#008000","greenDiv"),h=this.createHightlighColorPickerDiv("#800080","violetDiv"),d=this.createHightlighColorPickerDiv("#800000","darkRedDiv"),p=this.createHightlighColorPickerDiv("#808000","darkYellowDiv"),c=this.createHightlighColorPickerDiv("#808080","gray50Div"),u=this.createHightlighColorPickerDiv("#c0c0c0","gray25Div"),g=this.createHightlighColorPickerDiv("#000000","blackDiv"),m=Q("div",{className:"e-hglt-no-color"}),f=(this.highlightColorElement.appendChild(m),Q("div",{styles:"width:24px;height:24px;background-color:#ffffff;margin:3px;",id:"noColorDiv"})),y=(m.appendChild(f),Q("div",{innerHTML:this.localObj.getConstant("No color"),className:"e-de-ctnr-hglt-no-color"}));f.appendChild(y),e.addEventListener("click",this.onHighLightColor.bind(this)),t.addEventListener("click",this.onHighLightColor.bind(this)),i.addEventListener("click",this.onHighLightColor.bind(this)),n.addEventListener("click",this.onHighLightColor.bind(this)),o.addEventListener("click",this.onHighLightColor.bind(this)),r.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)),h.addEventListener("click",this.onHighLightColor.bind(this)),d.addEventListener("click",this.onHighLightColor.bind(this)),p.addEventListener("click",this.onHighLightColor.bind(this)),c.addEventListener("click",this.onHighLightColor.bind(this)),u.addEventListener("click",this.onHighLightColor.bind(this)),g.addEventListener("click",this.onHighLightColor.bind(this)),m.addEventListener("click",this.onHighLightColor.bind(this))},xmi.prototype.createHightlighColorPickerDiv=function(e,t){t=Q("div",{className:"e-de-ctnr-hglt-btn",id:t});return t.style.backgroundColor=e,this.highlightColorElement.appendChild(t),t},xmi.prototype.onHighLightColor=function(e){this.documentEditor.selectionModule&&(this.applyHighlightColor(e.currentTarget.style.backgroundColor),this.highlightColor.toggle())},xmi.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")},xmi.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")},xmi.prototype.applyHighlightColor=function(e){this.appliedHighlightColor=e;e=this.getHighLightColor(e);"NoColor"===e&&(this.documentEditor.selectionModule.characterFormat.highlightColor=null),this.documentEditor.selectionModule.characterFormat.highlightColor=e,this.documentEditor.focusIn()},xmi.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"}},xmi.prototype.createDiv=function(e,t,i){i=Q("div",i?{id:e,styles:i}:{id:e});return t.appendChild(i),i},xmi.prototype.createButtonTemplate=function(e,t,i,n,o,r){var e=Q("Button",{id:e,attrs:{type:"button"}}),s=(i.appendChild(e),new zv({cssClass:n,iconCss:t,enableRtl:this.isRtl}));switch(s.appendTo(e),e.setAttribute("title",this.localObj.getConstant(r)),e.setAttribute("aria-label",this.localObj.getConstant(r)),e.setAttribute("aria-pressed","false"),r){case"Bold Tooltip":this.boldBtn=s;break;case"Italic Tooltip":this.italicBtn=s;break;case"Underline Tooltip":this.underlineBtn=s;break;case"Strikethrough":this.strikethroughBtn=s;break;case"Superscript Tooltip":this.superscriptBtn=s;break;case"Subscript Tooltip":this.subscriptBtn=s;break;default:this.clearFormatBtn=s}return e},xmi.prototype.createFontColorPicker=function(e,t,i,n){var o=this.documentEditor.documentEditorSettings.colorPickerSettings,r=o.columns,s=o.createPopupOnClick,a=o.cssClass,l=o.disabled,h=o.enablePersistence,d=o.inline,p=o.mode,c=o.modeSwitcher,u=o.noColor,g=o.presetColors,o=o.showButtons,e=Q("input",{id:e,attrs:{type:"color"}});return e.style.width=t+"px",i.appendChild(e),this.fontColorInputElement=new cV({value:"#000000",enableRtl:this.isRtl,locale:this.container.locale,enableOpacity:!1,mode:p,modeSwitcher:c,showButtons:o,columns:r,createPopupOnClick:s,cssClass:a,disabled:l,enablePersistence:h,inline:d,noColor:u,presetColors:g},e),this.fontColorInputElement.element.parentElement.setAttribute("title",n),this.fontColorInputElement.element.parentElement.setAttribute("aria-label",n),this.documentEditor.documentHelper.fontColorInputElement=this.fontColorInputElement,e},xmi.prototype.createDropDownListForSize=function(e){var t=this,i=(this.fontSize=new oU({dataSource:["8","9","10","11","12","14","16","18","20","22","24","26","28","36","48","72","96"],popupHeight:"180px",popupWidth:"80px",cssClass:"e-de-prop-dropdown",allowCustom:!0,showClearButton:!1,enableRtl:this.isRtl}),this.fontSize.focus=function(){t.isRetrieving=!1,t.fontSize.element.select()},this.documentEditor.selectionModule.characterFormat);this.fontSize.value=(i.bidi||i.complexScript?i.fontSizeBidi:i.fontSize).toString(),this.fontSize.appendTo(e),this.fontSize.element.parentElement.setAttribute("title",this.localObj.getConstant("Font Size"))},xmi.prototype.createDropDownListForFamily=function(e){for(var t=this,i=!1,n="",o=(this.container.enableCsp||(n=ao(function(e){return'<span style="font-family: '+e.FontName+';">'+e.FontName+"</span>"}),i=!0),this.fontFamily=new oU({dataSource:void 0,query:(new ya).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,this.container.documentEditorSettings.fontFamilies),r=0;r<o.length;r++){var s=o[r];this.fontFamily.addItem({FontName:s,FontValue:s},r)}this.fontFamily.focus=function(){t.isRetrieving=!1,t.fontFamily.element.select()},this.fontFamily.element.parentElement.setAttribute("title",this.localObj.getConstant("Font"))},xmi.prototype.wireEvent=function(){var t=this;this.fontFamily.addEventListener("change",function(){t.changeFontFamily()}),this.fontSize.addEventListener("change",function(){t.changeFontSize()}),this.bold.addEventListener("click",function(){t.isRetrieving=!1,t.boldAction()}),this.italic.addEventListener("click",function(){t.isRetrieving=!1,t.italicAction()}),this.underline.addEventListener("click",function(){t.isRetrieving=!1,t.underlineAction()}),this.strikethrough.addEventListener("click",function(){t.isRetrieving=!1,t.strikethroughAction()}),this.superscript.addEventListener("click",function(){t.isRetrieving=!1,t.superscriptAction()}),this.subscript.addEventListener("click",function(){t.isRetrieving=!1,t.subscriptAction()}),this.fontColorInputElement.addEventListener("change",function(e){t.isRetrieving=!1,t.changeFontColor(e)}),this.clearFormat.addEventListener("click",function(){t.isRetrieving=!1,t.clearFormatAction()}),this.changeCaseDropdown.addEventListener("select",function(e){t.isRetrieving=!1,t.changeCase(e)})},xmi.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},xmi.prototype.boldAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editorModule&&(this.documentEditor.editorModule.toggleBold(),this.documentEditor.focusIn())},xmi.prototype.italicAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editorModule&&(this.documentEditor.editorModule.toggleItalic(),this.documentEditor.focusIn())},xmi.prototype.underlineAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editorModule&&(this.documentEditor.editorModule.toggleUnderline("Single"),this.documentEditor.focusIn())},xmi.prototype.strikethroughAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editorModule&&(this.documentEditor.editorModule.toggleStrikethrough(),this.documentEditor.focusIn())},xmi.prototype.clearFormatAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editorModule&&this.documentEditor.editorModule.clearFormatting()},xmi.prototype.subscriptAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editorModule&&(this.documentEditor.editorModule.toggleSubscript(),this.documentEditor.focusIn())},xmi.prototype.superscriptAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editorModule&&(this.documentEditor.editorModule.toggleSuperscript(),this.documentEditor.focusIn())},xmi.prototype.changeFontColor=function(e){var t=this;this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.selectionModule&&(this.documentEditor.selectionModule.characterFormat.fontColor=e.currentValue.hex,setTimeout(function(){t.documentEditor.focusIn()},30))},xmi.prototype.changeFontFamily=function(){var e=this;this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.selectionModule&&""!==this.fontFamily.value&&(setTimeout(function(){e.documentEditor.selectionModule.characterFormat.fontFamily=go.sanitize(e.fontFamily.value)},10),this.documentEditor.focusIn())},xmi.prototype.changeFontSize=function(){var e=this;this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.selectionModule&&""!==this.fontSize.value&&(setTimeout(function(){e.documentEditor.selectionModule.characterFormat.fontSize=e.fontSize.value},10),this.documentEditor.focusIn())},xmi.prototype.onSelectionChange=function(){var e;this.isRetrieving=!0,this.documentEditor.selectionModule&&(this.documentEditor.selectionModule.characterFormat.fontFamily?(e=void 0,e=je(this.documentEditor.selectionModule.characterFormat.renderedFontFamily)||je(this.documentEditor.selectionModule.characterFormat.fontFamily)?this.documentEditor.selectionModule.characterFormat.fontFamily:this.documentEditor.selectionModule.characterFormat.renderedFontFamily,this.fontFamily.value=e,this.fontFamily.dataBind(),je(this.fontFamily.getDataByValue(e))&&this.fontFamily.addItem({FontName:e,FontValue:e})):this.fontFamily.value="",this.documentEditor.selectionModule.characterFormat.fontSize?(e=this.documentEditor.selectionModule.characterFormat,this.fontSize.value=e.bidi||e.complexScript?je(e.fontSizeBidi)?"":e.fontSizeBidi.toString():e.fontSize.toString(),this.fontSize.dataBind()):this.fontSize.value="",this.documentEditor.selectionModule.characterFormat.bold?this.bold.classList.contains("e-btn-toggle")||(this.bold.classList.add("e-btn-toggle"),this.bold.setAttribute("aria-pressed","true")):this.bold.classList.contains("e-btn-toggle")&&(this.bold.classList.remove("e-btn-toggle"),this.bold.setAttribute("aria-pressed","false")),this.documentEditor.selectionModule.characterFormat.italic?this.italic.classList.contains("e-btn-toggle")||(this.italic.classList.add("e-btn-toggle"),this.italic.setAttribute("aria-pressed","true")):this.italic.classList.contains("e-btn-toggle")&&(this.italic.classList.remove("e-btn-toggle"),this.italic.setAttribute("aria-pressed","false")),this.documentEditor.selectionModule.characterFormat.underline&&"None"!==this.documentEditor.selectionModule.characterFormat.underline?this.underline.classList.contains("e-btn-toggle")||(this.underline.classList.add("e-btn-toggle"),this.underline.setAttribute("aria-pressed","true")):this.underline.classList.contains("e-btn-toggle")&&(this.underline.classList.remove("e-btn-toggle"),this.underline.setAttribute("aria-pressed","false")),this.documentEditor.selectionModule.characterFormat.strikethrough&&"None"!==this.documentEditor.selectionModule.characterFormat.strikethrough?this.strikethrough.classList.contains("e-btn-toggle")||(this.strikethrough.classList.add("e-btn-toggle"),this.strikethrough.setAttribute("aria-pressed","true")):this.strikethrough.classList.contains("e-btn-toggle")&&(this.strikethrough.classList.remove("e-btn-toggle"),this.strikethrough.setAttribute("aria-pressed","false")),this.documentEditor.selectionModule.characterFormat.baselineAlignment&&"Subscript"===this.documentEditor.selectionModule.characterFormat.baselineAlignment?this.subscript.classList.contains("e-btn-toggle")||(this.subscript.classList.add("e-btn-toggle"),this.subscript.setAttribute("aria-pressed","true")):this.subscript.classList.contains("e-btn-toggle")&&(this.subscript.classList.remove("e-btn-toggle"),this.subscript.setAttribute("aria-pressed","false")),this.documentEditor.selectionModule.characterFormat.baselineAlignment&&"Superscript"===this.documentEditor.selectionModule.characterFormat.baselineAlignment?this.superscript.classList.contains("e-btn-toggle")||(this.superscript.classList.add("e-btn-toggle"),this.superscript.setAttribute("aria-pressed","true")):this.superscript.classList.contains("e-btn-toggle")&&(this.superscript.classList.remove("e-btn-toggle"),this.superscript.setAttribute("aria-pressed","false")),this.documentEditor.selectionModule.characterFormat.fontColor&&(e=this.documentEditor.selectionModule.characterFormat.fontColor,this.fontColorInputElement.value=e="empty"!==e&&"#00000000"!==e?e:"#000000"),this.documentEditor.selectionModule.characterFormat.highlightColor)&&(this.highlightColorInputElement.style.backgroundColor=this.appliedHighlightColor,this.applyHighlightColorAsBackground(this.documentEditor.selectionModule.characterFormat.highlightColor))},xmi.prototype.removeHTMLElement=function(){var t=this;this.bold.remove(),this.bold=null,this.italic.remove(),this.italic=null,this.underline.remove(),this.underline=null,this.strikethrough.remove(),this.strikethrough=null,this.subscript.remove(),this.subscript=null,this.superscript.remove(),this.superscript=null,this.clearFormat.remove(),this.clearFormat=null,this.fontColor.remove(),this.fontColor=null,this.highlightColorInputElement.childNodes.forEach(function(e){t.highlightColorInputElement.removeChild(e)}),this.highlightColorInputElement.remove(),this.highlightColorInputElement=null,this.highlightColorElement.childNodes.forEach(function(e){t.highlightColorElement.removeChild(e)}),this.highlightColorElement.remove(),this.highlightColorElement=null},xmi.prototype.destroy=function(){this.unwireEvents(),this.removeHTMLElement(),this.highlightColor&&(this.highlightColor.destroy(),this.highlightColor=void 0),this.fontColorInputElement&&(this.fontColorInputElement.destroy(),this.fontColorInputElement.element.remove(),this.fontColorInputElement.element=null,this.fontColorInputElement=void 0),this.fontSize&&(this.fontSize.destroy(),this.fontSize.element&&(this.fontSize.element.remove(),this.fontSize.element=void 0),this.fontSize=void 0),this.fontFamily&&(this.fontFamily.destroy(),this.fontFamily.element&&(this.fontFamily.element.remove(),this.fontFamily.element=void 0),this.fontFamily=void 0),this.changeCaseDropdown&&(this.changeCaseDropdown.destroy(),this.changeCaseDropdown=void 0),this.boldBtn&&(this.boldBtn.destroy(),this.boldBtn=void 0),this.italicBtn&&(this.italicBtn.destroy(),this.italicBtn=void 0),this.underlineBtn&&(this.underlineBtn.destroy(),this.underlineBtn=void 0),this.strikethroughBtn&&(this.strikethroughBtn.destroy(),this.strikethroughBtn=void 0),this.subscriptBtn&&(this.subscriptBtn.destroy(),this.subscriptBtn=void 0),this.superscriptBtn&&(this.superscriptBtn.destroy(),this.superscriptBtn=void 0),this.clearFormatBtn&&(this.clearFormatBtn.destroy(),this.clearFormatBtn=void 0),this.container=void 0};var Ami=xmi;function xmi(e,t){var n=this;this.isRetrieving=!1,this.appliedHighlightColor="rgb(255, 255, 0)",this.createChangecase=function(e){var t=[{text:n.localObj.getConstant("SentenceCase"),id:"sentencecase"},{text:n.localObj.getConstant("UPPERCASE"),id:"uppercase"},{text:n.localObj.getConstant("Lowercase"),id:"lowercase"},{text:n.localObj.getConstant("CapitalizeEachWord"),id:"capitalizeEachWord"},{text:n.localObj.getConstant("ToggleCase"),id:"togglecase"}],t=(n.changeCaseDropdown=new u2({items:t,iconCss:"e-icons e-de-ctnr-change-case",enableRtl:n.isRtl}),Q("div",{id:e.id+"_changeCase",className:"e-de-ctnr-group-btn"})),i=Q("button",{id:t.id+"_dropdownBtn",attrs:{type:"button"}});t.appendChild(i),e.appendChild(t),n.changeCaseDropdown.appendTo(i)},this.changeCase=function(e){if(!n.isRetrieving)switch(e.item.id){case"sentencecase":!n.documentEditor.isReadOnly&&n.documentEditor.editorModule&&n.documentEditor.editorModule.changeCase("SentenceCase");break;case"uppercase":!n.documentEditor.isReadOnly&&n.documentEditor.editorModule&&n.documentEditor.editorModule.changeCase("Uppercase");break;case"lowercase":!n.documentEditor.isReadOnly&&n.documentEditor.editorModule&&n.documentEditor.editorModule.changeCase("Lowercase");break;case"capitalizeEachWord":!n.documentEditor.isReadOnly&&n.documentEditor.editorModule&&n.documentEditor.editorModule.changeCase("CapitalizeEachWord");break;case"togglecase":!n.documentEditor.isReadOnly&&n.documentEditor.editorModule&&n.documentEditor.editorModule.changeCase("ToggleCase")}},this.container=e,this.isRtl=t}Object.defineProperty(Tmi.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),Tmi.prototype.initializeParagraphPropertiesDiv=function(e,t){this.localObj=new Cn("documenteditorcontainer",this.container.defaultLocale,this.container.locale),this.isRtl=t,this.isRtl&&(this.splitButtonClass="e-rtl "+this.splitButtonClass),this.textProperties=e;var i=this.documentEditor.element.id+"_font_properties",e=(this.paragraphDiv=this.createDivElement(i+"_paragraph",e,""),mt(this.paragraphDiv,["e-de-cntr-pane-padding"],[]),this.label=Q("label",{className:"e-de-ctnr-prop-label"}),this.label.innerHTML=this.localObj.getConstant("Paragraph"),this.paragraphDiv.appendChild(this.label),this.styleDiv=this.createDivElement(i+"_styleDiv",this.paragraphDiv),this.styleDiv.classList.add("e-de-ctnr-segment","e-de-ctnr-style-div"),this.styleSelect=Q("input",{id:i+"_style",styles:"width:248px;letter-spacing: 0.05px;"}),this.styleDiv.appendChild(this.styleSelect),this.createStyleDropDownList(this.styleSelect),this.indentWholeDiv=this.createDivElement(i+"_indentWholeDiv",this.paragraphDiv),this.indentWholeDiv.style.display="flex",this.indentWholeDiv.classList.add("e-de-ctnr-segment"),t&&mt(this.indentWholeDiv,["e-de-ctnr-segment-rtl"],[]),this.indentDiv=this.createDivElement(i+"_indentDiv",this.indentWholeDiv,"display:flex;"),"e-de-ctnr-group-btn e-de-char-fmt-btn-left e-btn-group"),n=(this.indentDiv.className=e=t?"e-rtl "+e:e,this.leftAlignment=this.createButtonTemplate(i+"_leftIndent","e-de-ctnr-alignleft e-icons",this.indentDiv,"e-de-prop-indent-button","40.5","Align left Tooltip"),this.centerAlignment=this.createButtonTemplate(i+"_centerIndent","e-de-ctnr-aligncenter e-icons",this.indentDiv,"e-de-prop-indent-button","40.5","Center Tooltip"),this.rightAlignment=this.createButtonTemplate(i+"_rightIndent","e-de-ctnr-alignright e-icons",this.indentDiv,"e-de-prop-indent-button","40.5","Align right Tooltip"),this.justify=this.createButtonTemplate(i+"_justify","e-de-ctnr-justify e-icons",this.indentDiv,"e-de-prop-indent-last-button","40.5","Justify Tooltip"),"e-de-ctnr-increaseindent e-icons"),o="e-de-ctnr-decreaseindent e-icons",e=(this.incDecIndentDiv=this.createDivElement(i+"_lineindentDiv",this.indentWholeDiv,"display:flex;"),e="e-de-ctnr-group-btn e-de-char-fmt-btn-right e-btn-group",t&&(e="e-rtl "+e,n+=" e-de-flip",o+=" e-de-flip"),this.incDecIndentDiv.className=e,this.decreaseIndent=this.createButtonTemplate(i+"_decreaseIndent",o,this.incDecIndentDiv,"e-de-prop-indent-button","37","Decrease indent"),this.increaseIndent=this.createButtonTemplate(i+"_increaseIndent",n,this.incDecIndentDiv,"e-de-prop-indent-last-button","37","Increase indent"),this.listDiv=this.createDivElement(i+"_listDiv",this.paragraphDiv,"display:flex;"),this.paraDiv=this.createDivElement(i+"_paraDiv",this.paragraphDiv,"display:flex"),mt(this.listDiv,["e-de-ctnr-segment","e-de-ctnr-group-btn"],[]),mt(this.paraDiv,["e-de-ctnr-segment","e-de-ctnr-group-btn"],[]),t&&(mt(this.listDiv,["e-de-ctnr-segment-rtl","e-de-ctnr-group-btn"],[]),mt(this.paraDiv,["e-de-ctnr-segment-rtl","e-de-ctnr-group-btn"],[])),this.lineHeight=Q("button",{id:i+"_lineHeight",attrs:{type:"button"}}),this.listDiv.appendChild(this.lineHeight),this.lineSpacing=this.createLineSpacingDropdown(this.lineHeight),this.listDropDown=this.createDivElement(i+"_listDropDiv",this.listDiv),mt(this.listDropDown,["de-split-button","e-de-ctnr-segment-list"],[]),t&&mt(this.listDropDown,["e-de-ctnr-segment-list-rtl"],[]),this.bulletButton=Q("button",{id:i+"_bullet",attrs:{type:"button"}}),this.listDropDown.appendChild(this.bulletButton),this.numberingList=Q("button",{id:i+"_numberingList",attrs:{type:"button"}}),this.listDropDown.appendChild(this.numberingList),"e-de-ctnr-bullets e-icons"),o="e-de-ctnr-numbering e-icons";t&&(e+=" e-de-flip",o+=" e-de-flip"),this.createBulletListDropButton(e,this.bulletButton),this.createNumberListDropButton(o,this.numberingList),this.borders=this.createButtonTemplate(i+"_borders","e-de-ctnr-borders e-icons",this.paraDiv,"e-de-ctnr-group-btn","37","Borders"),this.showHiddenMarks=this.createButtonTemplate(i+"_paraMark","e-de-e-paragraph-mark e-icons",this.paraDiv,"e-de-ctnr-group-btn","37","ShowHiddenMarks Tooltip")},Tmi.prototype.createSeparator=function(e){var t=Q("div",{className:"e-de-prop-vline"});e.appendChild(t)},Tmi.prototype.createDivElement=function(e,t,i){i=Q("div",i?{id:e,styles:i}:{id:e});return t.appendChild(i),i},Tmi.prototype.createButtonTemplate=function(e,t,i,n,o,r){var e=Q("Button",{id:e,attrs:{type:"button"}}),s=(i.appendChild(e),new zv({cssClass:n,iconCss:t}));switch(s.appendTo(e),e.setAttribute("title",this.localObj.getConstant(r)),e.setAttribute("aria-label",this.localObj.getConstant(r)),"Decrease indent"!==this.localObj.getConstant(r)&&"Increase indent"!==this.localObj.getConstant(r)&&"Borders"!==this.localObj.getConstant(r)&&e.setAttribute("aria-pressed","false"),r){case"Align left Tooltip":this.leftAlignmentBtn=s;break;case"Align right Tooltip":this.rightAlignmentBtn=s;break;case"Justify Tooltip":this.justifyBtn=s;break;case"Decrease indent":this.decreaseIndentBtn=s;break;case"Increase indent":this.increaseIndentBtn=s;break;case"Borders":this.bordersBtn=s;break;case"ShowHiddenMarks Tooltip":this.showHiddenMarksBtn=s;break;default:this.centerAlignmentBtn=s}return e},Tmi.prototype.createLineSpacingDropdown=function(e){var i=this,t=[{text:this.localObj.getConstant("Single")},{text:"1.15"},{text:"1.5"},{text:this.localObj.getConstant("Double")}],t=new u2({items:t,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 t=e.element.children[0];e.item.text===i.appliedLineSpacing?(t.style.marginRight="10px",t.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 t.appendTo(e),e.setAttribute("title",this.localObj.getConstant("Line spacing")),t},Tmi.prototype.createNumberListDropButton=function(e,t){var i=this,e=(this.numberListDropDiv=Q("div",{id:"target",styles:"width: 211px;height: auto;display:none"}),this.numberListDropUlTag=Q("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"}),this.numberListDropDiv.appendChild(this.numberListDropUlTag),this.noneNumberTag=this.createNumberNoneListTag(this.numberListDropUlTag),this.noneNumberTag.addEventListener("click",this.numberedAndBulletNoneClickHandler),this.numberList=this.createNumberListTag(this.numberListDropUlTag,"1.","2.","3."),this.numberList.addEventListener("click",this.numberedNumberDotClickHandler),this.lowLetter=this.createNumberListTag(this.numberListDropUlTag,"a.","b.","c."),this.lowLetter.addEventListener("click",this.numberedLowLetterClickHandler),this.upLetter=this.createNumberListTag(this.numberListDropUlTag,"A.","B.","C."),this.upLetter.addEventListener("click",this.numberedUpLetterClickHandler),this.lowRoman=this.createNumberListTag(this.numberListDropUlTag,"i.","ii.","iii."),this.lowRoman.addEventListener("click",this.numberedLowRomanClickHandler),this.upRoman=this.createNumberListTag(this.numberListDropUlTag,"I.","II.","III."),this.upRoman.addEventListener("click",this.numberedUpRomanClickHandler),{target:this.numberListDropDiv,iconCss:e,cssClass:this.splitButtonClass,beforeOpen:this.numberSplitButtonBeforeOpen.bind(this),beforeClose:this.numberSplitButtonBeforeClose.bind(this)});this.numberedListBtn=new b2(e),this.numberedListBtn.click=function(){i.applyLastAppliedNumbering()},this.numberedListBtn.appendTo(t),t.parentElement.setAttribute("title",this.localObj.getConstant("Numbering")),t.parentElement.setAttribute("aria-label",this.localObj.getConstant("Numbering"))},Tmi.prototype.numberSplitButtonBeforeClose=function(){this.numberListDropDiv.style.display="none",this.removeSelectedList()},Tmi.prototype.numberSplitButtonBeforeOpen=function(){this.numberListDropDiv.style.display="block";var e,t,i="None";je(this.documentEditor.selectionModule.paragraphFormat)||(i=je(this.documentEditor.selectionModule.paragraphFormat.listId)||-1===this.documentEditor.selectionModule.paragraphFormat.listId?"None":(e=this.documentEditor.documentHelper.getListById(this.documentEditor.selectionModule.paragraphFormat.listId),e=this.documentEditor.documentHelper.getAbstractListById(e.abstractListId),t=(this.documentEditor.selectionModule.isForward?this.documentEditor.selectionModule.start:this.documentEditor.selectionModule.end).paragraph,e.levels[t.paragraphFormat.listFormat.listLevelNumber].listLevelPattern)),this.updateSelectedNumberedListType(i)},Tmi.prototype.updateSelectedBulletListType=function(e){switch(e){case String.fromCharCode(61623):this.dotBullet.classList.add("de-list-item-selected");break;case String.fromCharCode(61551)+String.fromCharCode(32):this.circleBullet.classList.add("de-list-item-selected");break;case String.fromCharCode(61607):this.squareBullet.classList.add("de-list-item-selected");break;case String.fromCharCode(61558):this.flowerBullet.classList.add("de-list-item-selected");break;case String.fromCharCode(61656):this.arrowBullet.classList.add("de-list-item-selected");break;case String.fromCharCode(61692):this.tickBullet.classList.add("de-list-item-selected");break;default:this.noneBulletTag.classList.add("de-list-item-selected")}},Tmi.prototype.updateSelectedNumberedListType=function(e){switch(e){case"Arabic":this.numberList.classList.add("de-list-item-selected");break;case"UpRoman":this.upRoman.classList.add("de-list-item-selected");break;case"UpLetter":this.upLetter.classList.add("de-list-item-selected");break;case"LowLetter":this.lowLetter.classList.add("de-list-item-selected");break;case"LowRoman":this.lowRoman.classList.add("de-list-item-selected");break;default:this.noneNumberTag.classList.add("de-list-item-selected")}},Tmi.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)},Tmi.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()}},Tmi.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()}},Tmi.prototype.createBulletListDropButton=function(e,t){var i=this,n=Q("div",{id:"bullet_list",styles:"width: 196px;height: auto;display:none"}),o=Q("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"}),o=(n.appendChild(o),this.noneBulletTag=this.createBulletListTag(o,"e-de-ctnr-bullet-none e-icons e-de-ctnr-list",!0),this.noneBulletTag.addEventListener("click",this.numberedAndBulletNoneClickHandler),this.dotBullet=this.createBulletListTag(o,"e-de-ctnr-bullet-dot e-icons e-de-ctnr-list",!1),this.dotBullet.addEventListener("click",this.bulletDotClickHandler),this.circleBullet=this.createBulletListTag(o,"e-de-ctnr-bullet-circle e-icons e-de-ctnr-list",!1),this.circleBullet.addEventListener("click",this.bulletCircleClickHandler),this.squareBullet=this.createBulletListTag(o,"e-de-ctnr-bullet-square e-icons e-de-ctnr-list",!1),this.squareBullet.addEventListener("click",this.bulletSquareClickHandler),this.flowerBullet=this.createBulletListTag(o,"e-de-ctnr-bullet-flower e-icons e-de-ctnr-list",!1),this.flowerBullet.addEventListener("click",this.bulletFlowerClickHandler),this.arrowBullet=this.createBulletListTag(o,"e-de-ctnr-bullet-arrow e-icons e-de-ctnr-list",!1),this.arrowBullet.addEventListener("click",this.bulletArrowClickHandler),this.tickBullet=this.createBulletListTag(o,"e-de-ctnr-bullet-tick e-icons e-de-ctnr-list",!1),this.tickBullet.addEventListener("click",this.bulletTickClickHandler),{target:n,iconCss:e,cssClass:this.splitButtonClass,beforeOpen:function(){var e;n.style.display="block",je(i.documentEditor.selectionModule.paragraphFormat.listId)||-1===i.documentEditor.selectionModule.paragraphFormat.listId?i.updateSelectedBulletListType(i.documentEditor.selectionModule.paragraphFormat.listText):(e=(i.documentEditor.selectionModule.isForward?i.documentEditor.selectionModule.start:i.documentEditor.selectionModule.end).paragraph,i.updateSelectedBulletListType(e.paragraphFormat.listFormat.listLevel.numberFormat))},beforeClose:function(){n.style.display="none",i.removeSelectedList()}});this.bulletListBtn=new b2(o),this.bulletListBtn.click=function(){i.applyLastAppliedBullet()},this.bulletListBtn.appendTo(t),t.parentElement.setAttribute("title",this.localObj.getConstant("Bullets")),t.parentElement.setAttribute("aria-label",this.localObj.getConstant("Bullets"))},Tmi.prototype.createNumberListTag=function(e,t,i,n){var o=Q("li",{styles:"display:block",className:"e-de-floating-menuitem e-de-floating-menuitem-md e-de-list-items  e-de-list-item-size"}),e=(e.appendChild(o),"<div>"+t+'<span class="e-de-list-line"></span></div><div>'+i+'<span class="e-de-list-line">'),t=Q("div",{className:"e-de-list-header-presetmenu",innerHTML:e+="</span></div><div>"+n+'<span class="e-de-list-line"> </span></div >'});return o.appendChild(t),o},Tmi.prototype.createNumberNoneListTag=function(e){var t=Q("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(t);e=Q("div",{className:"e-de-list-header-presetmenu",styles:"position:relative;left:11px;top:13px",innerHTML:'<div><span class="e-de-bullets">'+this.localObj.getConstant("None")+"</span></div>"});return t.appendChild(e),t},Tmi.prototype.createBulletListTag=function(e,t,i){var n=Q("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=(e.appendChild(n),Q("div",{className:"e-de-bullet-list-header-presetmenu"})),o=Q("div",{styles:i?"font-size:8px;text-align: center;top: 8px;line-height:normal":""}),t=(e.appendChild(o),Q("span",{className:i?"":t}));return o.appendChild(t),i&&(e.style.display="inline-table",t.textContent=this.localObj.getConstant("None")),n.appendChild(e),n},Tmi.prototype.createStyleDropDownList=function(e){var t=this,i=(this.style=new oU({dataSource:[{StyleName:"Normal",IconClass:"e-de-e-paragraph-mark e-icons"}],cssClass:"e-de-prop-dropdown",popupHeight:"240px",enableRtl:this.isRtl,allowFiltering:!0,query:(new ya).select(["StyleName","Style","IconClass"]),fields:{text:"StyleName",value:"StyleName"},showClearButton:!1,change:this.selectStyleValue.bind(this)}),"");this.style.open=this.updateOptions.bind(this),this.container.enableCsp||(i=this.isRtl?ao(function(e){return'<span style="'+e.Style+'">'+e.StyleName+'</span><span class="'+e.IconClass+'"></span>'}):ao(function(e){return'<span class="'+e.IconClass+'"></span><span style="'+e.Style+'">'+e.StyleName+"</span>"}),this.style.itemTemplate=i,this.style.isStringTemplate=!0),this.style.footerTemplate=ao(function(e){return'<span class="e-de-ctnr-dropdown-ftr">\n                '+t.localObj.getConstant("Manage Styles")+"...</span>"}),this.style.appendTo(e),this.style.focus=function(){t.isRetrieving=!1,t.style.element.select()},e.parentElement.setAttribute("title",this.localObj.getConstant("Styles"))},Tmi.prototype.updateOptions=function(e){e.popup.element.getElementsByClassName("e-de-ctnr-dropdown-ftr")[0].addEventListener("click",this.createStyle.bind(this))},Tmi.prototype.updateStyleNames=function(){this.styleName=je(this.style.itemData)?void 0:this.style.itemData.StyleName;for(var e=this.documentEditor.documentHelper.stylesMap,t=e.get("Paragraph")?e.get("Paragraph"):[],i=e.get("Linked")?e.get("Linked"):[],n=e.get("Character")?e.get("Character"):[],o=0,r=i;o<r.length;o++)for(var s=r[o],a=0;a<n.length;a++){var l=n[a];if(s.StyleName+" Char"===l.StyleName){n.splice(a,1);break}}this.style.dataSource=t.concat(i,n),this.onSelectionChange()},Tmi.prototype.createStyle=function(){this.style.hidePopup(),this.documentEditor.isReadOnly||this.documentEditor.showDialog("Styles")},Tmi.prototype.constructStyleDropItems=function(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i],r={},s=this.localObj.getConstant(o.name);r.StyleName=""===s?o.name:s,r.Style=this.parseStyle(o.style),"Paragraph"==o.type?r.IconClass="e-list-icon e-de-listview-icon e-de-e-paragraph-style-mark e-icons":"Character"==o.type?r.IconClass="e-list-icon e-de-listview-icon e-de-e-character-style-mark e-icons":r.IconClass="e-list-icon e-de-listview-icon e-de-e-linked-style-mark e-icons",t.push(r)}return t},Tmi.prototype.parseStyle=function(e){var t="",e=JSON.parse(e),i="";if(!je(e.characterFormat.baselineAlignment)&&"Normal"!==e.characterFormat.baselineAlignment){var n="";switch(e.characterFormat.baselineAlignment){case"Superscript":n="super";break;case"Subscript":n="sub"}1<n.length&&(t+="vertical-align:"+n+";")}return je(e.characterFormat.underline)||"None"===e.characterFormat.underline||(i+="underline "),je(e.characterFormat.strikethrough)||"None"===e.characterFormat.strikethrough||(i+="line-through "),je(e.characterFormat.fontSize)||(t+="font-size:"+e.characterFormat.fontSize+"px;"),je(e.characterFormat.fontFamily)||(t+="font-family:"+e.characterFormat.fontFamily+";"),!je(e.characterFormat.bold)&&e.characterFormat.bold&&(t+="font-weight:bold;"),!je(e.characterFormat.italic)&&e.characterFormat.italic&&(t+="font-style:italic;"),1<i.length&&(t+="text-decoration:"+i+";"),t},Tmi.prototype.onrightAlignmentClick=function(){this.leftAlignmentAction()},Tmi.prototype.wireEvent=function(){var t=this;this.leftAlignment.addEventListener("click",this.onrightAlignmentClickHandler),this.rightAlignment.addEventListener("click",function(){t.rightAlignmentAction()}),this.centerAlignment.addEventListener("click",function(){t.centerAlignmentAction()}),this.justify.addEventListener("click",function(){t.justifyAction()}),this.increaseIndent.addEventListener("click",function(){t.increaseIndentAction()}),this.showHiddenMarks.addEventListener("click",function(){t.container.documentEditorSettings.showHiddenMarks=!t.container.documentEditorSettings.showHiddenMarks,t.toggleHiddenMarks(),setTimeout(function(){t.documentEditor.focusIn()},30)}),this.decreaseIndent.addEventListener("click",function(){t.decreaseIndentAction()}),this.lineSpacing.addEventListener("select",function(e){t.lineSpacingAction(e)}),this.borders.addEventListener("click",function(){t.documentEditor.showBordersAndShadingDialog()})},Tmi.prototype.unwireEvents=function(){this.leftAlignment.removeEventListener("click",this.onrightAlignmentClickHandler),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},Tmi.prototype.toggleHiddenMarks=function(){this.container.documentEditorSettings.showHiddenMarks?(mt(this.showHiddenMarks,["e-btn-toggle"],[]),this.showHiddenMarks.setAttribute("aria-pressed","true")):(mt(this.showHiddenMarks,[],["e-btn-toggle"]),this.showHiddenMarks.setAttribute("aria-pressed","false"))},Tmi.prototype.leftAlignmentAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editorModule&&(this.documentEditor.editorModule.toggleTextAlignment("Left"),this.documentEditor.focusIn())},Tmi.prototype.lineSpacingAction=function(e){var t=this;if(!this.isRetrieving){switch(e.item.text){case this.localObj.getConstant("Single"):this.documentEditor.selectionModule.paragraphFormat.lineSpacing=1;break;case"1.15":this.documentEditor.selectionModule.paragraphFormat.lineSpacing=1.15;break;case"1.5":this.documentEditor.selectionModule.paragraphFormat.lineSpacing=1.5;break;case this.localObj.getConstant("Double"):this.documentEditor.selectionModule.paragraphFormat.lineSpacing=2}setTimeout(function(){t.documentEditor.focusIn()},30)}},Tmi.prototype.setLineSpacing=function(){var e=this.documentEditor.selectionModule.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"):""},Tmi.prototype.selectStyleValue=function(e){var t=this;this.container&&!this.isRetrieving&&e.isInteracted&&setTimeout(function(){t.applyStyleValue(e)},10)},Tmi.prototype.applyStyleValue=function(e){!this.documentEditor.isReadOnly&&this.documentEditor.editorModule&&(e=this.documentEditor.stylesDialogModule.getStyleName(go.sanitize(e.itemData.StyleName)),je(this.documentEditor.documentHelper.styles.findByName(e))||(this.documentEditor.editorModule.applyStyle(e,!0),!je(e=document.getElementById(this.documentEditor.containerId+"_treeDiv"))&&!je(this.documentEditor.optionsPaneModule)&&this.documentEditor.optionsPaneModule.isOptionsPaneShow&&this.documentEditor.optionsPaneModule.isHeadingTab&&(e.innerHTML="",this.documentEditor.optionsPaneModule.data=this.documentEditor.optionsPaneModule.dataForTreeview(),this.documentEditor.optionsPaneModule.initHeadingTab())))},Tmi.prototype.rightAlignmentAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editorModule&&(this.documentEditor.editorModule.toggleTextAlignment("Right"),this.documentEditor.focusIn())},Tmi.prototype.centerAlignmentAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editorModule&&(this.documentEditor.editorModule.toggleTextAlignment("Center"),this.documentEditor.focusIn())},Tmi.prototype.justifyAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editorModule&&(this.documentEditor.editorModule.toggleTextAlignment("Justify"),this.documentEditor.focusIn())},Tmi.prototype.increaseIndentAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editorModule&&(this.documentEditor.editorModule.increaseIndent(),this.documentEditor.focusIn())},Tmi.prototype.decreaseIndentAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editorModule&&(this.documentEditor.editorModule.decreaseIndent(),this.documentEditor.focusIn())},Tmi.prototype.numberedNoneClick=function(){var e=this;this.isRetrieving||this.documentEditor.editorModule&&(this.documentEditor.editorModule.clearList(),setTimeout(function(){e.documentEditor.focusIn()},30))},Tmi.prototype.numberedNumberDotClick=function(){var e=this;this.isRetrieving||this.documentEditor.editorModule&&(this.appliedNumberingStyle="arabic",this.documentEditor.editorModule.applyNumbering(this.getLevelFormatNumber(),"Arabic"),setTimeout(function(){e.documentEditor.focusIn()},30))},Tmi.prototype.numberedUpRomanClick=function(){var e=this;this.isRetrieving||this.documentEditor.editorModule&&(this.appliedNumberingStyle="uproman",this.documentEditor.editorModule.applyNumbering(this.getLevelFormatNumber(),"UpRoman"),setTimeout(function(){e.documentEditor.focusIn()},30))},Tmi.prototype.numberedUpLetterClick=function(){var e=this;this.isRetrieving||this.documentEditor.editorModule&&(this.appliedNumberingStyle="upletter",this.documentEditor.editorModule.applyNumbering(this.getLevelFormatNumber(),"UpLetter"),setTimeout(function(){e.documentEditor.focusIn()},30))},Tmi.prototype.numberedLowLetterClick=function(){var e=this;this.isRetrieving||this.documentEditor.editorModule&&(this.appliedNumberingStyle="lowletter",this.documentEditor.editorModule.applyNumbering(this.getLevelFormatNumber(),"LowLetter"),setTimeout(function(){e.documentEditor.focusIn()},30))},Tmi.prototype.numberedLowRomanClick=function(){var e=this;this.isRetrieving||this.documentEditor.editorModule&&(this.appliedNumberingStyle="lowroman",this.documentEditor.editorModule.applyNumbering(this.getLevelFormatNumber(),"LowRoman"),setTimeout(function(){e.documentEditor.focusIn()},30))},Tmi.prototype.getLevelFormatNumber=function(){return"%"+((this.documentEditor.selectionModule.paragraphFormat.listLevelNumber<=0?0:this.documentEditor.selectionModule.paragraphFormat.listLevelNumber)+1)+"."},Tmi.prototype.bulletDotClick=function(){var e=this;this.isRetrieving||this.documentEditor.editorModule&&(this.appliedBulletStyle="dot",this.documentEditor.editorModule.applyBullet(String.fromCharCode(61623),"Symbol"),setTimeout(function(){e.documentEditor.focusIn()},30))},Tmi.prototype.bulletCircleClick=function(){var e=this;this.isRetrieving||this.documentEditor.editorModule&&(this.appliedBulletStyle="circle",this.documentEditor.editorModule.applyBullet(String.fromCharCode(61551)+String.fromCharCode(32),"Symbol"),setTimeout(function(){e.documentEditor.focusIn()},30))},Tmi.prototype.bulletSquareClick=function(){var e=this;this.isRetrieving||this.documentEditor.editorModule&&(this.appliedBulletStyle="square",this.documentEditor.editorModule.applyBullet(String.fromCharCode(61607),"Wingdings"),setTimeout(function(){e.documentEditor.focusIn()},30))},Tmi.prototype.bulletFlowerClick=function(){var e=this;this.isRetrieving||this.documentEditor.editorModule&&(this.appliedBulletStyle="flower",this.documentEditor.editorModule.applyBullet(String.fromCharCode(61558),"Wingdings"),setTimeout(function(){e.documentEditor.focusIn()},30))},Tmi.prototype.bulletArrowClick=function(){var e=this;this.isRetrieving||this.documentEditor.editorModule&&(this.appliedBulletStyle="arrow",this.documentEditor.editorModule.applyBullet(String.fromCharCode(61656),"Wingdings"),setTimeout(function(){e.documentEditor.focusIn()},30))},Tmi.prototype.bulletTickClick=function(){var e=this;this.isRetrieving||this.documentEditor.editorModule&&(this.appliedBulletStyle="tick",this.documentEditor.editorModule.applyBullet(String.fromCharCode(61692),"Wingdings"),setTimeout(function(){e.documentEditor.focusIn()},30))},Tmi.prototype.onSelectionChange=function(){var e,t;this.isRetrieving=!0,this.documentEditor.editorModule&&(e=this.documentEditor.selectionModule.characterFormat.styleName,(e="Default Paragraph Font"===this.documentEditor.selectionModule.characterFormat.styleName?this.documentEditor.selectionModule.paragraphFormat.styleName:e)?(t=this.localObj.getConstant(e),this.style.value=je(t)||""==t?e:t):this.style.value=null,mt(this.leftAlignment,[],["e-btn-toggle"]),mt(this.rightAlignment,[],["e-btn-toggle"]),mt(this.centerAlignment,[],["e-btn-toggle"]),mt(this.justify,[],["e-btn-toggle"]),"Left"===this.documentEditor.selectionModule.paragraphFormat.textAlignment?(mt(this.leftAlignment,["e-btn-toggle"],[]),this.leftAlignment.setAttribute("aria-pressed","true"),this.rightAlignment.setAttribute("aria-pressed","false"),this.centerAlignment.setAttribute("aria-pressed","false"),this.justify.setAttribute("aria-pressed","false")):"Right"===this.documentEditor.selectionModule.paragraphFormat.textAlignment?(mt(this.rightAlignment,["e-btn-toggle"],[]),this.leftAlignment.setAttribute("aria-pressed","false"),this.rightAlignment.setAttribute("aria-pressed","true"),this.centerAlignment.setAttribute("aria-pressed","false"),this.justify.setAttribute("aria-pressed","false")):"Center"===this.documentEditor.selectionModule.paragraphFormat.textAlignment?(mt(this.centerAlignment,["e-btn-toggle"],[]),this.leftAlignment.setAttribute("aria-pressed","false"),this.rightAlignment.setAttribute("aria-pressed","false"),this.centerAlignment.setAttribute("aria-pressed","true"),this.justify.setAttribute("aria-pressed","false")):"Justify"===this.documentEditor.selectionModule.paragraphFormat.textAlignment&&(mt(this.justify,["e-btn-toggle"],[]),this.leftAlignment.setAttribute("aria-pressed","false"),this.rightAlignment.setAttribute("aria-pressed","false"),this.centerAlignment.setAttribute("aria-pressed","false"),this.justify.setAttribute("aria-pressed","true")),this.toggleHiddenMarks()),this.setLineSpacing(),this.isRetrieving=!1},Tmi.prototype.removeHTMLElements=function(){this.leftAlignment.remove(),this.leftAlignment=null,this.rightAlignment.remove(),this.rightAlignment=null,this.centerAlignment.remove(),this.centerAlignment=null,this.justify.remove(),this.justify=null,this.increaseIndent.remove(),this.increaseIndent=null,this.decreaseIndent.remove(),this.decreaseIndent=null,this.showHiddenMarks.remove(),this.showHiddenMarks=null,this.noneNumberTag.remove(),this.noneNumberTag=null,this.numberList.remove(),this.numberList=null,this.lowLetter.remove(),this.lowLetter=null,this.upLetter.remove(),this.upLetter=null,this.lowRoman.remove(),this.lowRoman=null,this.upRoman.remove(),this.upRoman=null,this.noneBulletTag.remove(),this.noneBulletTag=null,this.dotBullet.remove(),this.dotBullet=null,this.circleBullet.remove(),this.circleBullet=null,this.squareBullet.remove(),this.squareBullet=null,this.flowerBullet.remove(),this.flowerBullet=null,this.arrowBullet.remove(),this.arrowBullet=null,this.tickBullet.remove(),this.tickBullet=null,this.borders.remove(),this.borders=null,this.paragraphDiv.remove(),this.paragraphDiv=null,this.label.remove(),this.label=null,this.indentWholeDiv.remove(),this.indentWholeDiv=null,this.indentDiv.remove(),this.indentDiv=null,this.incDecIndentDiv.remove(),this.incDecIndentDiv=null,this.listDiv.remove(),this.listDiv=null,this.paraDiv.remove(),this.paraDiv=null,this.lineHeight.remove(),this.lineHeight=null,this.listDropDown.remove(),this.listDropDown=null,this.bulletButton.remove(),this.bulletButton=null,this.numberingList.remove(),this.numberingList=null,this.numberListDropDiv.remove(),this.numberListDropDiv=null,this.numberListDropUlTag.remove(),this.numberListDropUlTag=null},Tmi.prototype.destroy=function(){this.container=void 0,this.unwireEvents(),this.removeHTMLElements(),this.lineSpacing&&(this.lineSpacing.destroy(),this.lineSpacing=void 0),this.bulletListBtn&&(this.bulletListBtn.destroy(),this.bulletListBtn=void 0),this.numberedListBtn&&(this.numberedListBtn.destroy(),this.numberedListBtn=void 0),this.leftAlignmentBtn&&(this.leftAlignmentBtn.destroy(),this.leftAlignmentBtn=void 0),this.rightAlignmentBtn&&(this.rightAlignmentBtn.destroy(),this.rightAlignmentBtn=void 0),this.centerAlignmentBtn&&(this.centerAlignmentBtn.destroy(),this.centerAlignmentBtn=void 0),this.showHiddenMarksBtn&&(this.showHiddenMarksBtn.destroy(),this.showHiddenMarksBtn=void 0),this.justifyBtn&&(this.justifyBtn.destroy(),this.justifyBtn=void 0),this.decreaseIndentBtn&&(this.decreaseIndentBtn.destroy(),this.decreaseIndentBtn=void 0),this.increaseIndentBtn&&(this.increaseIndentBtn.destroy(),this.increaseIndentBtn=void 0),this.bordersBtn&&(this.bordersBtn.destroy(),this.bordersBtn=void 0),this.showHiddenMarksBtn&&(this.showHiddenMarksBtn.destroy(),this.showHiddenMarksBtn=void 0)};var Imi=Tmi;function Tmi(e){this.numberedAndBulletNoneClickHandler=this.numberedNoneClick.bind(this),this.numberedNumberDotClickHandler=this.numberedNumberDotClick.bind(this),this.numberedLowLetterClickHandler=this.numberedLowLetterClick.bind(this),this.numberedUpLetterClickHandler=this.numberedUpLetterClick.bind(this),this.numberedLowRomanClickHandler=this.numberedLowRomanClick.bind(this),this.numberedUpRomanClickHandler=this.numberedUpRomanClick.bind(this),this.numberSplitButtonBeforeOpenHandler=this.numberSplitButtonBeforeOpen.bind(this),this.bulletDotClickHandler=this.bulletDotClick.bind(this),this.bulletCircleClickHandler=this.bulletCircleClick.bind(this),this.bulletSquareClickHandler=this.bulletSquareClick.bind(this),this.bulletFlowerClickHandler=this.bulletFlowerClick.bind(this),this.bulletArrowClickHandler=this.bulletArrowClick.bind(this),this.bulletTickClickHandler=this.bulletTickClick.bind(this),this.onrightAlignmentClickHandler=this.onrightAlignmentClick.bind(this),this.isRetrieving=!1,this.appliedBulletStyle="dot",this.appliedNumberingStyle="arabic",this.appliedLineSpacing="",this.splitButtonClass="e-de-prop-splitbutton",this.container=e}Dmi.prototype.initializeTextProperties=function(e,t,i){this.element=Q("div",{className:"e-de-prop-pane e-de-scrollbar-hide"}),this.element.setAttribute("tabindex","0"),this.text.initializeTextPropertiesDiv(this.element,i),this.paragraph.initializeParagraphPropertiesDiv(this.element,i),this.paragraph.updateStyleNames(),t||this.container.propertiesPaneContainer.appendChild(this.element)},Dmi.prototype.wireEvents=function(){this.text.wireEvent(),this.paragraph.wireEvent()},Dmi.prototype.onSelectionChange=function(){this.text.onSelectionChange(),this.paragraph.onSelectionChange()},Dmi.prototype.destroy=function(){this.text&&(this.text.destroy(),this.text=void 0),this.paragraph&&(this.paragraph.destroy(),this.paragraph=void 0),this.container=void 0};var Emi=Dmi;function Dmi(e,t,i,n){this.container=e,this.text=new Ami(e,n),this.paragraph=new Imi(e),this.initializeTextProperties(t,i,n),this.wireEvents()}Object.defineProperty(kmi.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),kmi.prototype.initializeTablePropPane=function(){this.localObj=new Cn("documenteditorcontainer",this.container.defaultLocale,this.container.locale),this.tableProperties=Q("div",{className:"e-de-scrollbar-hide",styles:"overflow: auto"}),this.initFillColorDiv(),this.initBorderStylesDiv(),this.initCellDiv(),this.initInsertOrDelCell(),this.initCellMargin(),this.initAlignText(),this.addTablePropertyTab(),this.wireEvent()},kmi.prototype.enableDisableElements=function(e){e?mt(this.element,[],["e-de-overlay"]):mt(this.element,["e-de-overlay"],[])},kmi.prototype.addTablePropertyTab=function(){var e=Q("div",{innerHTML:this.localObj.getConstant("Table")}),t=Q("div",{innerHTML:this.localObj.getConstant("Text")}),t=(this.parentElement=Q("div",{styles:"height:100%;overflow:auto;display:none",className:"e-de-prop-pane e-de-scrollbar-hide"}),this.element=Q("div",{id:this.elementId+"_propertyTabDiv",className:"e-de-property-tab"}),[{header:{text:t},content:this.tableTextProperties.element},{header:{text:e},content:this.tableProperties}]);this.propertiesTab=new k5({items:t,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)},kmi.prototype.onTabSelection=function(e){e.preventFocus=!0,this.documentEditor.resize(),this.documentEditor.enableAutoFocus&&this.documentEditor.focusIn()},kmi.prototype.wireEvent=function(){var t=this;this.shadingBtn.addEventListener("change",this.changeBackgroundColor.bind(this)),this.borderBtn.addEventListener("change",function(e){setTimeout(function(){t.borderColor=e.currentValue.hex,t.tableOutlineBorder.element.focus()},10)}),this.tableOutlineBorder.element.addEventListener("click",this.onOutlineBorderClickHandler),this.tableAllBorder.element.addEventListener("click",this.onAllBorderHandler),this.tableCenterBorder.element.addEventListener("click",this.onInsideBorderHandler),this.tableLeftBorder.element.addEventListener("click",this.onLeftBorderHandler),this.tableCenterVerticalBorder.element.addEventListener("click",this.onVerticalBorderHandler),this.tableRightBorder.element.addEventListener("click",this.onRightBorderHandler),this.tableTopBorder.element.addEventListener("click",this.onTopBorderHandler),this.tableCenterHorizontalBorder.element.addEventListener("click",this.onHorizontalBorderHandler),this.tableBottomBorder.element.addEventListener("click",this.onBottomBorderHandler),this.insertRowAbove.element.addEventListener("click",this.onInsertRowAboveHandler),this.insertRowBelow.element.addEventListener("click",this.onInsertRowBelowHandler),this.insertColumnLeft.element.addEventListener("click",this.onInsertColumnLeftHandler),this.insertColumnRight.element.addEventListener("click",this.onInsertColumnRightHandler),this.deleteRow.element.addEventListener("click",this.onDeleteRowHandler),this.deleteColumn.element.addEventListener("click",this.onDeleteColumnHandler),this.horizontalMerge.element.addEventListener("click",this.onMergeCellHandler),this.alignTop.element.addEventListener("click",this.applyAlignTopHandler),this.alignBottom.element.addEventListener("click",this.applyAlignBottomHandler),this.alignCenterHorizontal.element.addEventListener("click",this.applyAlignCenterHorizontalHandler),this.topMargin.htmlAttributes={"aria-label":"top-margin"},this.bottomMargin.htmlAttributes={"aria-label":"bottom-margin"},this.leftMargin.htmlAttributes={"aria-label":"left-margin"},this.rightMargin.htmlAttributes={"aria-label":"right-Margin"},this.topMargin.element.addEventListener("click",this.onTopMarginClickHandler),this.rightMargin.element.addEventListener("click",this.onRightMarginClickHandler),this.leftMargin.element.addEventListener("click",this.onLeftMarginClickHandler),this.bottomMargin.element.addEventListener("click",this.onBottomMarginClickHandler),this.topMargin.element.addEventListener("keydown",this.onTopMarginHandler),this.rightMargin.element.addEventListener("keydown",this.onRightMarginHandler),this.leftMargin.element.addEventListener("keydown",this.onLeftMarginHandler),this.bottomMargin.element.addEventListener("keydown",this.onBottomMarginHandler),this.topMargin.element.addEventListener("blur",this.onTopMarginBlurHandler),this.rightMargin.element.addEventListener("blur",this.onRightMarginBlurHandler),this.leftMargin.element.addEventListener("blur",this.onLeftMarginBlurHandler),this.bottomMargin.element.addEventListener("blur",this.onBottomMarginBlurHandler)},kmi.prototype.unWireEvent=function(){this.shadingBtn.removeEventListener("change",this.changeBackgroundColor),this.tableOutlineBorder.element.removeEventListener("click",this.onOutlineBorderClickHandler),this.tableAllBorder.element.removeEventListener("click",this.onAllBorderHandler),this.tableCenterBorder.element.removeEventListener("click",this.onInsideBorderHandler),this.tableLeftBorder.element.removeEventListener("click",this.onLeftBorderHandler),this.tableCenterVerticalBorder.element.removeEventListener("click",this.onVerticalBorderHandler),this.tableRightBorder.element.removeEventListener("click",this.onRightBorderHandler),this.tableTopBorder.element.removeEventListener("click",this.onTopBorderHandler),this.tableCenterHorizontalBorder.element.removeEventListener("click",this.onHorizontalBorderHandler),this.tableBottomBorder.element.removeEventListener("click",this.onBottomBorderHandler),this.insertRowAbove.element.removeEventListener("click",this.onInsertRowAboveHandler),this.insertRowBelow.element.removeEventListener("click",this.onInsertRowBelowHandler),this.insertColumnLeft.element.removeEventListener("click",this.onInsertColumnLeftHandler),this.insertColumnRight.element.removeEventListener("click",this.onInsertColumnRightHandler),this.deleteRow.element.removeEventListener("click",this.onDeleteRowHandler),this.deleteColumn.element.removeEventListener("click",this.onDeleteColumnHandler),this.horizontalMerge.element.removeEventListener("click",this.onMergeCellHandler),this.alignTop.element.removeEventListener("click",this.applyAlignTopHandler),this.alignBottom.element.removeEventListener("click",this.applyAlignBottomHandler),this.alignCenterHorizontal.element.removeEventListener("click",this.applyAlignCenterHorizontalHandler),this.topMargin.element.removeEventListener("click",this.onTopMarginClickHandler),this.rightMargin.element.removeEventListener("click",this.onRightMarginClickHandler),this.leftMargin.element.removeEventListener("click",this.onLeftMarginClickHandler),this.bottomMargin.element.removeEventListener("click",this.onBottomMarginClickHandler),this.topMargin.element.removeEventListener("keydown",this.onTopMarginHandler),this.rightMargin.element.removeEventListener("keydown",this.onRightMarginHandler),this.leftMargin.element.removeEventListener("keydown",this.onLeftMarginHandler),this.bottomMargin.element.removeEventListener("keydown",this.onBottomMarginHandler),this.topMargin.element.removeEventListener("blur",this.onTopMarginBlurHandler),this.rightMargin.element.removeEventListener("blur",this.onRightMarginBlurHandler),this.leftMargin.element.removeEventListener("blur",this.onLeftMarginBlurHandler),this.bottomMargin.element.removeEventListener("blur",this.onBottomMarginBlurHandler)},kmi.prototype.onTopMarginClick=function(){this.isTopMarginApply=!0},kmi.prototype.onTopMarginBlur=function(){this.applyTopMargin(),this.isTopMarginApply=!1},kmi.prototype.onRightMarginClick=function(){this.isRightMarginApply=!0},kmi.prototype.onRightMarginBlur=function(){this.applyRightMargin(),this.isRightMarginApply=!1},kmi.prototype.onLeftMarginClick=function(){this.isLeftMarginApply=!0},kmi.prototype.onLeftMarginBlur=function(){this.applyLeftMargin(),this.isLeftMarginApply=!1},kmi.prototype.onBottomMarginClick=function(){this.isBottomMarginApply=!0},kmi.prototype.onBottomMarginBlur=function(){this.applyBottomMargin(),this.isBottomMarginApply=!1},kmi.prototype.getBorder=function(e){var t=0<=this.borderSize.content.indexOf("No Border")?0:parseFloat(this.borderSize.content);return{type:e,borderColor:this.borderColor,lineWidth:t,borderStyle:0===t?"Cleared":"Single"}},kmi.prototype.onOutlineBorder=function(){this.documentEditor.editorModule.applyBorders(this.getBorder("OutsideBorders"))},kmi.prototype.onAllBorder=function(){this.documentEditor.editorModule.applyBorders(this.getBorder("AllBorders"))},kmi.prototype.onInsideBorder=function(){this.documentEditor.editorModule.applyBorders(this.getBorder("InsideBorders"))},kmi.prototype.onLeftBorder=function(){this.documentEditor.editorModule.applyBorders(this.getBorder("LeftBorder"))},kmi.prototype.onVerticalBorder=function(){this.documentEditor.editorModule.applyBorders(this.getBorder("InsideVerticalBorder"))},kmi.prototype.onRightBorder=function(){this.documentEditor.editorModule.applyBorders(this.getBorder("RightBorder"))},kmi.prototype.onTopBorder=function(){this.documentEditor.editorModule.applyBorders(this.getBorder("TopBorder"))},kmi.prototype.onHorizontalBorder=function(){this.documentEditor.editorModule.applyBorders(this.getBorder("InsideHorizontalBorder"))},kmi.prototype.onBottomBorder=function(){this.documentEditor.editorModule.applyBorders(this.getBorder("BottomBorder"))},kmi.prototype.onTopMargin=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.applyTopMargin(),t.isTopMarginApply=!1},30)},kmi.prototype.onBottomMargin=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.applyBottomMargin(),t.isBottomMarginApply=!1},30)},kmi.prototype.onLeftMargin=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.applyLeftMargin(),t.isLeftMarginApply=!1},30)},kmi.prototype.onRightMargin=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.applyRightMargin(),t.isRightMarginApply=!1},30)},kmi.prototype.applyTopMargin=function(){this.isTopMarginApply&&(this.documentEditor.selectionModule.cellFormat.topMargin=this.topMargin.value>this.topMargin.max?this.topMargin.max:this.topMargin.value)},kmi.prototype.applyBottomMargin=function(){this.isBottomMarginApply&&(this.documentEditor.selectionModule.cellFormat.bottomMargin=this.bottomMargin.value>this.bottomMargin.max?this.bottomMargin.max:this.bottomMargin.value)},kmi.prototype.applyLeftMargin=function(){this.isLeftMarginApply&&(this.documentEditor.selectionModule.cellFormat.leftMargin=this.leftMargin.value>this.leftMargin.max?this.leftMargin.max:this.leftMargin.value)},kmi.prototype.applyRightMargin=function(){this.isRightMarginApply&&(this.documentEditor.selectionModule.cellFormat.rightMargin=this.rightMargin.value>this.rightMargin.max?this.rightMargin.max:this.rightMargin.value)},kmi.prototype.applyAlignTop=function(){this.documentEditor.selectionModule.cellFormat.verticalAlignment="Top"},kmi.prototype.applyAlignBottom=function(){this.documentEditor.selectionModule.cellFormat.verticalAlignment="Bottom"},kmi.prototype.applyAlignCenterHorizontal=function(){this.documentEditor.selectionModule.cellFormat.verticalAlignment="Center"},kmi.prototype.onMergeCell=function(){this.documentEditor.editorModule.mergeCells()},kmi.prototype.onInsertRowAbove=function(){this.documentEditor.editorModule.insertRow(!0)},kmi.prototype.onInsertRowBelow=function(){this.documentEditor.editorModule.insertRow(!1)},kmi.prototype.onInsertColumnLeft=function(){this.documentEditor.editorModule.insertColumn(!0)},kmi.prototype.onInsertColumnRight=function(){this.documentEditor.editorModule.insertColumn(!1)},kmi.prototype.onDeleteRow=function(){this.documentEditor.editorModule.deleteRow(),this.documentEditor.focusIn()},kmi.prototype.onDeleteColumn=function(){this.documentEditor.editorModule.deleteColumn(),this.documentEditor.focusIn()},kmi.prototype.onSelectionChange=function(){this.documentEditor.selectionModule&&(this.documentEditor.editorModule&&this.documentEditor.editorModule.canMergeCells()?this.horizontalMerge.disabled=!1:this.horizontalMerge.disabled=!0,"TableText"!==this.documentEditor.selectionModule.contextType&&"TableImage"!==this.documentEditor.selectionModule.contextType||(this.shadingBtn.value=this.documentEditor.selectionModule.cellFormat.background||""),this.topMargin.value=this.documentEditor.selectionModule.cellFormat.topMargin||0,this.bottomMargin.value=this.documentEditor.selectionModule.cellFormat.bottomMargin||0,this.rightMargin.value=this.documentEditor.selectionModule.cellFormat.rightMargin||0,this.leftMargin.value=this.documentEditor.selectionModule.cellFormat.leftMargin||0)},kmi.prototype.changeBackgroundColor=function(e){var t=this;this.documentEditor.isReadOnly||(this.documentEditor.selectionModule.cellFormat.background=e.currentValue.hex,setTimeout(function(){t.documentEditor.focusIn()},10))},kmi.prototype.initFillColorDiv=function(){var e=Q("div",{id:this.elementId+"_fillColorDiv",className:"e-de-property-div-padding de-tbl-fill-clr"}),t=(this.tableProperties.appendChild(e),Q("label",{className:"e-de-prop-sub-label"}));t.classList.add("e-de-prop-fill-label"),this.isRtl&&t.classList.add("e-de-rtl"),t.textContent=this.localObj.getConstant("Fill"),e.appendChild(t),this.shadingBtn=this.createColorPickerTemplate(this.elementId+"_tableShading",e,this.localObj.getConstant("Fill color"),!1),mt(e.lastElementChild.lastElementChild.lastElementChild.firstChild,["e-de-ctnr-cellbg-clr-picker"],["e-caret"]),this.documentEditor.documentHelper.shadingBtn=this.shadingBtn},kmi.prototype.initBorderStylesDiv=function(){this.borderStyleDiv=Q("div",{className:"e-de-property-div-padding"}),this.tableProperties.appendChild(this.borderStyleDiv);var e=Q("label",{className:"e-de-ctnr-prop-label"}),t=(e.textContent=this.localObj.getConstant("Border Style"),this.borderStyleDiv.appendChild(e),Q("div",{styles:"display:inline-flex;"})),i=Q("div",{styles:"width:min-content;height:126px",className:"e-de-grp-btn-ctnr"}),n=Q("div",{className:this.groupButtonClass+" e-de-ctnr-group-btn-top"}),o=(i.appendChild(n),Q("div",{className:this.groupButtonClass+" e-de-ctnr-group-btn-middle"})),r=(i.appendChild(o),Q("div",{className:this.groupButtonClass+" e-de-ctnr-group-btn-bottom"})),e=(i.appendChild(r),this.isRtl&&(n.classList.add("e-de-rtl"),r.classList.add("e-de-rtl"),t.classList.add("e-de-rtl"),e.classList.add("e-de-rtl")),this.tableOutlineBorder=this.createButtonTemplate(this.elementId+"_tableOutlineBorder","e-de-ctnr-outsideborder e-icons",n,"e-de-prop-font-button","",this.localObj.getConstant("Outside borders")),this.tableAllBorder=this.createButtonTemplate(this.elementId+"_tableAllBorder","e-de-ctnr-allborders e-icons",n,"e-de-prop-font-button","",this.localObj.getConstant("All borders")),this.tableCenterBorder=this.createButtonTemplate(this.elementId+"_tableCenterBorder","e-de-ctnr-insideborders e-icons",n,"e-de-prop-font-button","",this.localObj.getConstant("Inside borders")),this.tableLeftBorder=this.createButtonTemplate(this.elementId+"_tableLeftBorder","e-de-ctnr-leftborders e-icons",o,"e-de-prop-font-button","",this.localObj.getConstant("Left border")),this.tableCenterVerticalBorder=this.createButtonTemplate(this.elementId+"_tableCenterVBorder","e-de-ctnr-insideverticalborder e-icons",o,"e-de-prop-font-button","",this.localObj.getConstant("Inside vertical border")),this.tableRightBorder=this.createButtonTemplate(this.elementId+"_tableRightBorder","e-de-ctnr-rightborder e-icons",o,"e-de-prop-font-button","",this.localObj.getConstant("Right border")),this.tableTopBorder=this.createButtonTemplate(this.elementId+"_tableTopBorder","e-de-ctnr-topborder e-icons",r,"e-de-prop-font-button","",this.localObj.getConstant("Top border")),this.tableCenterHorizontalBorder=this.createButtonTemplate(this.elementId+"_tableCenterHBorder","e-de-ctnr-insidehorizondalborder e-icons",r,"e-de-prop-font-button","",this.localObj.getConstant("Inside horizontal border")),this.tableBottomBorder=this.createButtonTemplate(this.elementId+"_tableBottomBorder","e-de-ctnr-bottomborder e-icons",r,"e-de-prop-font-button","",this.localObj.getConstant("Bottom border")),t.appendChild(i),Q("div",{className:"de-tbl-fill-clr"}));this.isRtl?e.classList.add("e-de-stylediv-rtl"):e.classList.add("e-de-stylediv"),this.borderBtn=this.createColorPickerTemplate(this.elementId+"_tableBorderColor",e,this.localObj.getConstant("Border color"),!0),this.documentEditor.documentHelper.borderBtn=this.borderBtn,this.borderBtn.value="#000000",e.firstElementChild.lastElementChild.lastElementChild.style.width="30px",e.firstElementChild.lastElementChild.firstElementChild.firstElementChild.style.width="100%",mt(e.lastElementChild.lastElementChild.lastElementChild.firstChild,["e-de-ctnr-highlightcolor"],["e-caret"]),this.borderSizeButton=Q("button",{id:this.elementId+"_tableBorderSize",className:"e-de-border-size-button",styles:"font-size:10px;padding:0px;",attrs:{type:"button"}}),e.appendChild(this.borderSizeButton),this.borderSize=this.createBorderSizeDropDown("e-de-ctnr-strokesize e-icons",this.borderSizeButton),t.appendChild(e),this.borderSizeColorElement=document.getElementsByClassName("e-de-border-width"),this.borderStyleDiv.appendChild(t)},kmi.prototype.initCellDiv=function(){var e=Q("div",{className:"e-de-property-div-padding"}),t=(this.tableProperties.appendChild(e),Q("label",{className:"e-de-ctnr-prop-label"})),i=(t.textContent=this.localObj.getConstant("Cell"),e.appendChild(t),Q("div",{className:"e-de-ctnr-group-btn"}));i.classList.add("e-de-cell-div"),this.isRtl&&(i.classList.add("e-de-rtl"),t.classList.add("e-de-rtl"));this.horizontalMerge=this.createButtonTemplate(this.elementId+"_tableOutlineBorder","e-de-ctnr-mergecell e-icons",i,"e-de-prop-font-button","",this.localObj.getConstant("Merge cells")),e.appendChild(i)},kmi.prototype.initInsertOrDelCell=function(){var e=Q("div",{className:"e-de-property-div-padding"}),t=(this.tableProperties.appendChild(e),Q("label",{className:"e-de-ctnr-prop-label"})),i=(t.textContent=this.localObj.getConstant("Insert Or Delete"),e.appendChild(t),Q("div",{className:"e-de-insert-del-cell",styles:"display:inline-flex"})),n=Q("div",{className:this.groupButtonClass}),o=(i.appendChild(n),Q("div",{className:this.groupButtonClass}));this.isRtl?(o.style.marginRight="12px",i.classList.add("e-de-rtl"),t.classList.add("e-de-rtl")):o.style.marginLeft="12px",i.appendChild(o);this.insertColumnLeft=this.createButtonTemplate(this.elementId+"_insertColumnLeft","e-de-ctnr-insertleft e-icons",n,"e-de-prop-font-button","",this.localObj.getConstant("Insert columns to the left")),this.insertColumnRight=this.createButtonTemplate(this.elementId+"_insertColumnRight","e-de-ctnr-insertright e-icons",n,"e-de-prop-font-button","",this.localObj.getConstant("Insert columns to the right")),this.insertRowAbove=this.createButtonTemplate(this.elementId+"_insertRowAbove","e-de-ctnr-insertabove e-icons",n,"e-de-prop-font-button","",this.localObj.getConstant("Insert rows above")),this.insertRowBelow=this.createButtonTemplate(this.elementId+"_insertRowBelow","e-de-ctnr-insertbelow e-icons",n,"e-de-prop-font-button","",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","",this.localObj.getConstant("Delete rows")),this.deleteColumn=this.createButtonTemplate(this.elementId+"_deleteColumn","e-de-ctnr-deletecolumns e-icons",o,"e-de-prop-font-button","",this.localObj.getConstant("Delete columns")),e.appendChild(i)},kmi.prototype.initCellMargin=function(){var e=Q("div",{className:"e-de-property-div-padding e-de-cellmargin-text"}),t=(this.tableProperties.appendChild(e),Q("label",{className:"e-de-ctnr-prop-label"})),i=(t.textContent=this.localObj.getConstant("Cell Margin"),e.appendChild(t),Q("div",{styles:"display:inline-flex"})),t=(this.isRtl&&t.classList.add("e-de-rtl"),"width:48px"),n="width:50px;float:left;";this.topMargin=this.createCellMarginTextBox(this.localObj.getConstant("Top"),this.elementId+"_topMargin",i,t,n,500,this.localObj.getConstant("Top margin")),this.bottomMargin=this.createCellMarginTextBox(this.localObj.getConstant("Bottom"),this.elementId+"_bottomMargin",i,t,n,500,this.localObj.getConstant("Bottom margin")),this.leftMargin=this.createCellMarginTextBox(this.localObj.getConstant("Left"),this.elementId+"_leftMargin",i,t,n,500,this.localObj.getConstant("Left margin")),this.rightMargin=this.createCellMarginTextBox(this.localObj.getConstant("Right"),this.elementId+"_rightMargin",i,t,n,500,this.localObj.getConstant("Right margin"),!0),e.appendChild(i)},kmi.prototype.initAlignText=function(){var e=Q("div",{className:"e-de-property-div-padding",styles:"border-bottom-width:0px"}),t=(this.tableProperties.appendChild(e),Q("label",{className:"e-de-ctnr-prop-label"})),i=(t.textContent=this.localObj.getConstant("Align Text"),e.appendChild(t),Q("div")),t=(this.isRtl&&(i.classList.add("e-de-rtl"),t.classList.add("e-de-rtl")),Q("div",{className:this.groupButtonClass}));i.appendChild(t);this.alignTop=this.createButtonTemplate(this.elementId+"_alignTop","e-de-ctnr-aligntop e-icons",t,"e-de-prop-font-button","",this.localObj.getConstant("Align top")),this.alignBottom=this.createButtonTemplate(this.elementId+"_alignBottom","e-de-ctnr-alignbottom e-icons",t,"e-de-prop-font-button","",this.localObj.getConstant("Align bottom")),this.alignCenterHorizontal=this.createButtonTemplate(this.elementId+"_alignCenterHorizontal","e-de-ctnr-aligncenter-table e-icons",t,"e-de-prop-font-button","",this.localObj.getConstant("Align center")),this.alignCenterHorizontal.addEventListener("click",this.applyAlignCenterHorizontal.bind(this)),e.appendChild(i)},kmi.prototype.createCellMarginTextBox=function(e,t,i,n,o,r,s,a){o=Q("div",{styles:o}),a||o.classList.add("e-de-cell-text-box"),a=Q("label",{className:"e-de-prop-sub-label"}),a.textContent=e,o.appendChild(a),e=Q("input",{className:"e-textbox",id:t,styles:n}),o.appendChild(e),a=new NL({showSpinButton:!1,min:0,format:"n0",max:r,enableRtl:this.isRtl},e);return i.appendChild(o),e.setAttribute("title",s),a},kmi.prototype.createBorderSizeDropDown=function(e,t){var i=this,n=Q("div",{id:"borderSizeTarget",styles:"display:none"}),o=Q("ul",{styles:"display: block; outline: 0px; width: 126px; height: auto;",id:"borderSizeListMenu"});n.appendChild(o);this.createDropdownOption(o,this.localObj.getConstant("No Border")).addEventListener("click",function(){i.onBorderSizeChange("No Border")});var r=this.localObj.getConstant("px");this.createDropdownOption(o,".25"+r).addEventListener("click",function(){i.onBorderSizeChange(".25px")}),this.createDropdownOption(o,".5"+r).addEventListener("click",function(){i.onBorderSizeChange(".5px")}),this.createDropdownOption(o,".75"+r).addEventListener("click",function(){i.onBorderSizeChange(".75px")}),this.createDropdownOption(o,"1"+r).addEventListener("click",function(){i.onBorderSizeChange("1px")}),this.createDropdownOption(o,"1.5"+r).addEventListener("click",function(){i.onBorderSizeChange("1.5px")}),this.createDropdownOption(o,"2"+r).addEventListener("click",function(){i.onBorderSizeChange("2px")}),this.createDropdownOption(o,"3"+r).addEventListener("click",function(){i.onBorderSizeChange("3px")}),this.createDropdownOption(o,"4"+r).addEventListener("click",function(){i.onBorderSizeChange("4px")}),this.createDropdownOption(o,"5"+r).addEventListener("click",function(){i.onBorderSizeChange("5px")});this.createDropdownOption(o,"6"+r).addEventListener("click",function(){i.onBorderSizeChange("6px")});o={target:n,iconCss:e,cssClass:"e-de-prop-bordersize",enableRtl:this.isRtl,content:"1.5px"},r=new u2(o);return r.beforeOpen=function(){n.style.display="block";for(var e=0;e<i.borderSizeColorElement.length;e++)i.borderSizeColorElement[parseInt(e.toString(),10)].style.borderBottomColor=i.borderColor},r.beforeClose=function(){n.style.display="none"},r.appendTo(t),r.element.setAttribute("title",this.localObj.getConstant("Border width")),r},kmi.prototype.onBorderSizeChange=function(e){var t=this;this.borderSize.content=e,setTimeout(function(){t.tableOutlineBorder.element.focus()},10)},kmi.prototype.createDropdownOption=function(e,t){var i=Q("li",{styles:"display:block",className:"e-de-floating-menuitem e-de-floating-menuitem-md e-de-list-items  e-de-list-item-size"}),e=(e.appendChild(i),Q("div",{className:"e-de-list-header-presetmenu",innerHTML:"No Border"===t?"<div>"+t+"</div>":"1.5px"===t?"<div>"+t+'<span class="e-de-list-line e-de-border-width"  style="margin-left:10px;border-bottom-width:'+t+';"></span></div>':"<div>"+t+'<span class="e-de-list-line e-de-border-width" style="margin-left:20px;border-bottom-width:'+t+';"></span></div>'}));return i.appendChild(e),i},kmi.prototype.createDropDownButton=function(e,t,i,n,o,r,s){e=Q("button",{id:e,styles:t,attrs:{type:"button"}}),i.appendChild(e),t="e-de-prop-splitbutton",this.isRtl&&(t="e-rtl "+t),i=new u2({iconCss:n,content:o,enableRtl:this.isRtl,cssClass:t},e);return r&&(i.items=r),s&&(i.target=s),i},kmi.prototype.createButtonTemplate=function(e,t,i,n,o,r,s,a){e=Q("Button",{id:e,styles:o,attrs:{type:"button"}}),i.appendChild(e),o=new zv({cssClass:n,iconCss:t,enableRtl:this.isRtl,iconPosition:a||"Left",content:s||""});return o.appendTo(e),e.setAttribute("title",r),e.setAttribute("aria-label",r),o},kmi.prototype.createColorPickerTemplate=function(e,t,i,n){var o=this.documentEditor.documentEditorSettings.colorPickerSettings,r=o.columns,s=o.createPopupOnClick,a=o.disabled,l=o.enablePersistence,h=o.inline,d=o.mode,p=o.modeSwitcher,c=o.noColor,u=o.presetColors,o=o.showButtons,e=Q("input",{id:e}),t=(t.appendChild(e),"e-de-prop-font-button e-de-prop-font-colorpicker"),n=(n&&(t+=" e-de-border-clr-picker"),new cV({cssClass:t,enableRtl:this.isRtl,locale:this.container.locale,enableOpacity:!1,mode:d,modeSwitcher:p,showButtons:o,columns:r,createPopupOnClick:s,disabled:a,enablePersistence:l,inline:h,noColor:c,presetColors:u},e));return e.parentElement.setAttribute("title",i),e.parentElement.setAttribute("aria-label",i),n},kmi.prototype.showTableProperties=function(e,t){e&&("text"===t?this.propertiesTab.hideTab(1,!0):(this.propertiesTab.hideTab(1,!1),this.prevContext!==this.documentEditor.selectionModule.contextType&&(this.propertiesTab.selectedItem=1)),this.prevContext=this.documentEditor.selectionModule.contextType,this.onSelectionChange(),this.tableTextProperties.onSelectionChange()),!e&&"none"===this.parentElement.style.display||e&&"block"===this.parentElement.style.display||(this.parentElement.style.display=e?"block":"none",e&&this.updateTabContainerHeight(),this.documentEditor.resize(),this.prevContext=this.documentEditor.selectionModule.contextType)},kmi.prototype.updateTabContainerHeight=function(){var e;this.parentElement&&"block"===this.parentElement.style.display&&(e=this.parentElement.getElementsByClassName("e-tab-header")[0])&&(e=this.parentElement.offsetHeight-e.offsetHeight,this.tableProperties.style.height=e+"px",this.tableTextProperties.element.style.height=e+"px")},kmi.prototype.removeHTMLDomElement=function(){var t=this;this.borderSizeButton&&(this.borderSizeButton.remove(),this.borderSizeButton=null),this.borderStyleDiv&&(this.borderStyleDiv.childNodes.forEach(function(e){t.borderStyleDiv.removeChild(e)}),this.borderStyleDiv.innerHTML="",this.borderStyleDiv.remove(),this.borderStyleDiv=null),this.tableProperties&&(this.tableProperties.childNodes.forEach(function(e){t.tableProperties.removeChild(e)}),this.tableProperties.innerHTML="",this.tableProperties.remove(),this.tableProperties=null)},kmi.prototype.destroy=function(){this.unWireEvent(),this.container=void 0,this.shadingBtn&&(this.shadingBtn.destroy(),this.shadingBtn.element.remove(),this.shadingBtn.element=null,this.shadingBtn=void 0),this.borderBtn&&(this.borderBtn.destroy(),this.borderBtn.element.remove(),this.borderBtn.element=null,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&&(ue(this.rightMargin.element),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),this.imageProperty&&(this.imageProperty=null),this.tableOutlineBorder&&this.tableOutlineBorder.destroy(),this.tableOutlineBorder=void 0,this.tableAllBorder&&this.tableAllBorder.destroy(),this.tableAllBorder=void 0,this.tableCenterBorder&&this.tableCenterBorder.destroy(),this.tableCenterBorder=void 0,this.tableLeftBorder&&this.tableLeftBorder.destroy(),this.tableLeftBorder=void 0,this.tableCenterVerticalBorder&&this.tableCenterVerticalBorder.destroy(),this.tableCenterVerticalBorder=void 0,this.tableRightBorder&&this.tableRightBorder.destroy(),this.tableRightBorder=void 0,this.tableTopBorder&&this.tableTopBorder.destroy(),ue(this.tableTopBorder.element),this.tableTopBorder=void 0,this.tableCenterHorizontalBorder&&this.tableCenterHorizontalBorder.destroy(),ue(this.tableCenterHorizontalBorder.element),this.tableCenterHorizontalBorder=void 0,this.tableBottomBorder&&this.tableBottomBorder.destroy(),ue(this.tableBottomBorder.element),this.tableBottomBorder=void 0,this.horizontalMerge&&this.horizontalMerge.destroy(),ue(this.horizontalMerge.element),this.horizontalMerge=void 0,this.insertRowAbove&&this.insertRowAbove.destroy(),ue(this.insertRowAbove.element),this.insertRowAbove=void 0,this.insertRowBelow&&this.insertRowBelow.destroy(),ue(this.insertRowBelow.element),this.insertRowBelow=void 0,this.insertColumnLeft&&this.insertColumnLeft.destroy(),ue(this.insertColumnLeft.element),this.insertColumnLeft=void 0,this.insertColumnRight&&this.insertColumnRight.destroy(),ue(this.insertColumnRight.element),this.insertColumnRight=void 0,this.deleteRow&&this.deleteRow.destroy(),ue(this.deleteRow.element),this.deleteRow=void 0,this.deleteColumn&&this.deleteColumn.destroy(),ue(this.deleteColumn.element),this.deleteColumn=void 0,this.alignBottom&&this.alignBottom.destroy(),this.alignBottom=void 0,this.alignCenterHorizontal&&this.alignCenterHorizontal.destroy(),this.alignCenterHorizontal=void 0,this.alignTop&&this.alignTop.destroy(),this.removeHTMLDomElement(),this.alignTop=void 0,this.groupButtonClass=void 0,this.borderColor=void 0,this.elementId=void 0};var Mmi=kmi;function kmi(e,t,i){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.onOutlineBorderClickHandler=this.onOutlineBorder.bind(this),this.onAllBorderHandler=this.onAllBorder.bind(this),this.onInsideBorderHandler=this.onInsideBorder.bind(this),this.onLeftBorderHandler=this.onLeftBorder.bind(this),this.onVerticalBorderHandler=this.onVerticalBorder.bind(this),this.onRightBorderHandler=this.onRightBorder.bind(this),this.onTopBorderHandler=this.onTopBorder.bind(this),this.onHorizontalBorderHandler=this.onHorizontalBorder.bind(this),this.onBottomBorderHandler=this.onBottomBorder.bind(this),this.onInsertRowAboveHandler=this.onInsertRowAbove.bind(this),this.onInsertRowBelowHandler=this.onInsertRowBelow.bind(this),this.onInsertColumnLeftHandler=this.onInsertColumnLeft.bind(this),this.onInsertColumnRightHandler=this.onInsertColumnRight.bind(this),this.onDeleteRowHandler=this.onDeleteRow.bind(this),this.onDeleteColumnHandler=this.onDeleteColumn.bind(this),this.onMergeCellHandler=this.onMergeCell.bind(this),this.applyAlignTopHandler=this.applyAlignTop.bind(this),this.applyAlignBottomHandler=this.applyAlignBottom.bind(this),this.applyAlignCenterHorizontalHandler=this.applyAlignCenterHorizontal.bind(this),this.onTopMarginHandler=this.onTopMargin.bind(this),this.onRightMarginHandler=this.onRightMargin.bind(this),this.onLeftMarginHandler=this.onLeftMargin.bind(this),this.onBottomMarginHandler=this.onBottomMargin.bind(this),this.onTopMarginClickHandler=this.onTopMarginClick.bind(this),this.onTopMarginBlurHandler=this.onTopMarginBlur.bind(this),this.onRightMarginClickHandler=this.onRightMarginClick.bind(this),this.onRightMarginBlurHandler=this.onRightMarginBlur.bind(this),this.onLeftMarginClickHandler=this.onLeftMarginClick.bind(this),this.onLeftMarginBlurHandler=this.onLeftMarginBlur.bind(this),this.onBottomMarginClickHandler=this.onBottomMarginClick.bind(this),this.onBottomMarginBlurHandler=this.onBottomMarginBlur.bind(this),this.container=e,this.isRtl=i,this.isRtl&&(this.groupButtonClass="e-rtl "+this.groupButtonClass),this.tableTextProperties=new Emi(e,"textProperties",!0,this.isRtl),this.imageProperty=t,this.elementId=this.documentEditor.element.id,this.initializeTablePropPane(),this.prevContext=this.documentEditor.selectionModule.contextType}Bmi.prototype.onPageLayoutClick=function(){this.documentEditor.layoutType="Pages",this.addRemoveClass(this.pageButton,this.webButton),this.documentEditor.focusIn()},Bmi.prototype.onWebLayoutClick=function(){this.documentEditor.layoutType="Continuous",this.addRemoveClass(this.webButton,this.pageButton),this.documentEditor.focusIn()},Bmi.prototype.onPageNumberKeyDown=function(e){13===e.which&&(e.preventDefault(),parseInt(this.pageNumberInput.value,10)>this.editorPageCount?this.updatePageNumber():this.documentEditor.selectionModule?(this.documentEditor.selectionModule.goToPage(parseInt(this.pageNumberInput.value,10)),this.documentEditor.focusIn()):this.documentEditor.scrollToPage(parseInt(this.pageNumberInput.value,10)),this.pageNumberInput.contentEditable="false",""===this.pageNumberInput.value)&&this.updatePageNumber(),64<e.which&&e.preventDefault()},Bmi.prototype.onPageNumberKeyUp=function(){this.updatePageNumberWidth()},Bmi.prototype.onPageNumberBlur=function(){(""===this.pageNumberInput.value||parseInt(this.pageNumberInput.value,10)>this.editorPageCount)&&this.updatePageNumber(),this.pageNumberInput.contentEditable="false"},Bmi.prototype.onPageNumberFocus=function(){this.pageNumberInput.select()},Object.defineProperty(Bmi.prototype,"documentEditor",{get:function(){return this.container?this.container.documentEditor:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(Bmi.prototype,"editorPageCount",{get:function(){return this.documentEditor?this.documentEditor.pageCount:1},enumerable:!0,configurable:!0}),Bmi.prototype.initializeStatusBar=function(){var e=this.container.enableRtl,t=(this.documentEditor.enableSpellCheck=!!this.container.enableSpellCheck,this.localObj=new Cn("documenteditorcontainer",this.container.defaultLocale,this.container.locale),e?"padding-right:16px":"padding-left:16px"),t=(this.pageNumDiv=Q("div",{className:this.container.enableSpellCheck?"e-de-ctnr-pg-no":"e-de-ctnr-pg-no-spellout",styles:t}),this.statusBarDiv.appendChild(this.pageNumDiv),this.pageLabel=Q("span"),this.pageLabel.textContent=this.localObj.getConstant("Page")+" ",this.pageNumDiv.appendChild(this.pageLabel),this.pageNumberInput=Q("input",{styles:"text-transform:capitalize;white-space:pre;overflow:hidden;user-select:none;cursor:text",attrs:{type:"text","aria-label":this.localObj.getConstant("Current Page Number")},className:"e-de-pagenumber-input"}),this.editablePageNumber=Q("div",{styles:"display: inline-flex",className:"e-input e-de-pagenumber-text"}),this.editablePageNumber.appendChild(this.pageNumberInput),""),t=e?(this.pageLabel.style.marginLeft="6px",this.editablePageNumber.style.marginLeft="6px","padding-left:5px"):(this.pageLabel.style.marginRight="6px",this.editablePageNumber.style.marginRight="6px","padding-right:5px"),e=(this.updatePageNumber(),this.pageNumDiv.appendChild(this.editablePageNumber),this.editablePageNumber.setAttribute("title",this.localObj.getConstant("Current Page Number")),this.ofLabel=Q("span",{styles:t}),this.ofLabel.textContent=" "+this.localObj.getConstant("of")+" ",this.pageNumDiv.appendChild(this.ofLabel),this.pageCount=Q("span"),this.pageNumDiv.appendChild(this.pageCount),this.updatePageCount(),this.documentEditor.enableSpellCheck&&(this.verticalLine=Q("div",{className:"e-de-statusbar-separator"}),this.statusBarDiv.appendChild(this.verticalLine),this.spellCheckBtn=this.addSpellCheckElement(),this.spellCheckButton.appendTo(this.spellCheckBtn)),this.pageButton=this.createButtonTemplate(this.container.enableSpellCheck?"e-de-statusbar-pageweb e-btn-pageweb-spellcheck":"e-de-statusbar-pageweb","e-de-printlayout e-icons","Print layout",this.statusBarDiv,this.pageButton,"Pages"===this.documentEditor.layoutType),this.webButton=this.createButtonTemplate("e-de-statusbar-pageweb","e-de-weblayout e-icons","Web layout",this.statusBarDiv,this.webButton,"Continuous"===this.documentEditor.layoutType),this.pageButton.addEventListener("click",this.onPageLayoutClickHandler),this.webButton.addEventListener("click",this.onWebLayoutClickHandler),this.zoomBtn=Q("button",{className:"e-de-statusbar-zoom",attrs:{type:"button"}}),this.statusBarDiv.appendChild(this.zoomBtn),this.zoomBtn.setAttribute("title",this.localObj.getConstant("ZoomLevelTooltip")),[{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 u2({content:"100%",items:e,enableRtl:this.container.enableRtl,select:this.onZoom.bind(this)}),this.zoom.isStringTemplate=!0,this.zoom.appendTo(this.zoomBtn)},Bmi.prototype.addSpellCheckElement=function(){var i=this,e=Q("button",{className:"e-de-statusbar-spellcheck"}),t=(this.statusBarDiv.appendChild(e),e.setAttribute("title","Spell Checker options"),[{text:this.localObj.getConstant("Spell Check")},{text:this.localObj.getConstant("Underline errors")}]);return this.spellCheckButton=new u2({content:this.localObj.getConstant("Spelling"),items:t,enableRtl:this.container.enableRtl,select:this.onSpellCheck.bind(this),beforeItemRender:function(e){e.element.innerHTML="<span></span>"+e.item.text,je(i.currentLanguage)&&(i.currentLanguage=i.documentEditor.spellCheckerModule.languageID),je(i.allowSuggestion)&&(i.allowSuggestion=i.documentEditor.spellCheckerModule.allowSpellCheckAndSuggestion);var t=e.element.children[0];e.item.text===i.localObj.getConstant("Spell Check")&&i.documentEditor.enableSpellCheck&&i.documentEditor.spellCheckerModule.enableSpellCheck?(t.style.marginRight="10px",t.setAttribute("class","e-de-selected-spellcheck-item")):e.item.text===i.localObj.getConstant("Underline errors")&&i.documentEditor.enableSpellCheck&&i.documentEditor.spellCheckerModule.enableSpellCheck&&!i.documentEditor.spellCheckerModule.removeUnderline?(t.style.marginRight="10px",t.setAttribute("class","e-de-selected-underline-item")):(t.style.marginRight="25px",e.element.children[0].classList.remove("e-de-selected-spellcheck-item"),e.element.children[0].classList.remove("e-de-selected-underline-item"))}}),e},Bmi.prototype.onZoom=function(e){this.setZoomValue(e.item.text),this.updateZoomContent()},Bmi.prototype.onSpellCheck=function(e){this.setSpellCheckValue(e.item.text)},Bmi.prototype.updateZoomContent=function(){this.zoom.content=Math.round(100*this.documentEditor.zoomFactor)+"%"},Bmi.prototype.setSpellCheckValue=function(e){this.spellCheckButton.content=this.localObj.getConstant("Spelling"),e.match(this.localObj.getConstant("Spell Check"))?(this.documentEditor.spellCheckerModule.enableSpellCheck=!this.documentEditor.spellCheckerModule.enableSpellCheck,this.documentEditor.documentHelper.triggerSpellCheck=!1,this.documentEditor.documentHelper.triggerElementsOnLoading=!1):e.match(this.localObj.getConstant("Underline errors"))&&this.documentEditor.enableSpellCheck&&this.documentEditor.spellCheckerModule.enableSpellCheck&&(this.documentEditor.spellCheckerModule.removeUnderline=!this.documentEditor.spellCheckerModule.removeUnderline)},Bmi.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},Bmi.prototype.updatePageCount=function(){this.pageCount.textContent=this.editorPageCount.toString()},Bmi.prototype.updatePageNumber=function(){this.pageNumberInput.value=this.startPage.toString(),this.updatePageNumberWidth()},Bmi.prototype.updatePageNumberOnViewChange=function(e){this.documentEditor.selectionModule&&this.documentEditor.selectionModule.startPage>=e.startPage&&this.documentEditor.selectionModule.startPage<=e.endPage?this.startPage=this.documentEditor.selectionModule.startPage:this.startPage=e.startPage,this.updatePageNumber(),this.updatePageCount()},Bmi.prototype.wireEvents=function(){this.pageNumberInput.addEventListener("keydown",this.onPageNumberKeyDownHandler),this.pageNumberInput.addEventListener("keyup",this.onPageNumberKeyUpHandler),this.pageNumberInput.addEventListener("blur",this.onPageNumberBlurHandler),this.pageNumberInput.addEventListener("focus",this.onPageNumberFocusHandler)},Bmi.prototype.unWireEvents=function(){this.pageButton.removeEventListener("click",this.onPageLayoutClickHandler),this.webButton.removeEventListener("click",this.onWebLayoutClickHandler),this.pageNumberInput.removeEventListener("keydown",this.onPageNumberKeyDownHandler),this.pageNumberInput.removeEventListener("keyup",this.onPageNumberKeyUpHandler),this.pageNumberInput.removeEventListener("blur",this.onPageNumberBlurHandler),this.pageNumberInput.removeEventListener("focus",this.onPageNumberFocusHandler)},Bmi.prototype.updatePageNumberWidth=function(){this.pageNumberInput&&(this.pageNumberInput.style.width=3<=this.pageNumberInput.value.length?"30px":"22px")},Bmi.prototype.toggleWebLayout=function(){this.addRemoveClass(this.pageButton,this.webButton)},Bmi.prototype.togglePageLayout=function(){this.addRemoveClass(this.webButton,this.pageButton)},Bmi.prototype.addRemoveClass=function(e,t){e.classList.add("e-btn-toggle"),t.classList.contains("e-btn-toggle")&&t.classList.remove("e-btn-toggle")},Bmi.prototype.createButtonTemplate=function(e,t,i,n,o,r){o=Q("Button",{className:e,attrs:{type:"button"}}),n.appendChild(o);n=new zv({cssClass:e,iconCss:t,enableRtl:this.container.enableRtl});return!0===r&&o.classList.add("e-btn-toggle"),n.appendTo(o),o.setAttribute("title",this.localObj.getConstant(i)),"Web layout"===i?this.webBtn=n:this.pageBtn=n,o},Bmi.prototype.destroy=function(){this.unWireEvents(),this.removeHTMLDom(),this.dependentComponentsDestroy(),this.pageButton=void 0,this.webButton=void 0,this.pageNumberInput=void 0,this.statusBarDiv=void 0,this.pageCount=void 0,this.editablePageNumber=void 0,this.localObj=void 0,this.container=void 0},Bmi.prototype.dependentComponentsDestroy=function(){this.zoom&&(this.zoom.destroy(),this.zoom=void 0),this.spellCheckButton&&(this.spellCheckButton.destroy(),this.spellCheckButton=void 0),this.pageBtn&&(this.pageBtn.destroy(),this.pageBtn=void 0),this.webBtn&&(this.webBtn.destroy(),this.webBtn=void 0)},Bmi.prototype.removeHTMLDom=function(){this.pageNumDiv.remove(),this.statusBarDiv.remove(),this.pageCount.remove(),this.pageLabel.remove(),this.pageNumberInput.remove(),this.editablePageNumber.remove(),this.ofLabel.remove(),this.zoomBtn.remove(),this.pageButton.remove(),this.webButton.remove(),je(this.verticalLine)||this.verticalLine.remove(),je(this.spellCheckBtn)||this.spellCheckBtn.remove()};var Pmi=Bmi;function Bmi(e,t){this.startPage=1,this.onPageLayoutClickHandler=this.onPageLayoutClick.bind(this),this.onWebLayoutClickHandler=this.onWebLayoutClick.bind(this),this.onPageNumberKeyDownHandler=this.onPageNumberKeyDown.bind(this),this.onPageNumberKeyUpHandler=this.onPageNumberKeyUp.bind(this),this.onPageNumberBlurHandler=this.onPageNumberBlur.bind(this),this.onPageNumberFocusHandler=this.onPageNumberFocus.bind(this),this.statusBarDiv=e,this.container=t,this.initializeStatusBar(),this.wireEvents()}Fmi=function(e,t){return(Fmi=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])}))(e,t)};var Fmi,Lmi,PNt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},LNt=(function(e,t){function i(){this.constructor=e}Fmi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Rmi,Lmi=Ji),Object.defineProperty(Rmi.prototype,"documentEditor",{get:function(){return this.documentEditorInternal},enumerable:!0,configurable:!0}),Object.defineProperty(Rmi.prototype,"toolbar",{get:function(){return this.toolbarModule},enumerable:!0,configurable:!0}),Rmi.prototype.getModuleName=function(){return"DocumentEditorContainer"},Rmi.prototype.onPropertyChanged=function(e,t){for(var i,n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"restrictEditing":this.restrictEditingToggleHelper(e.restrictEditing);break;case"showPropertiesPane":this.showHidePropertiesPane(e.showPropertiesPane);break;case"enableTrackChanges":this.documentEditor.documentHelper.isTrackedOnlyMode&&!e.enableTrackChanges&&e.enableTrackChanges!==this.enableTrackChanges&&(this.enableTrackChanges=!0),this.documentEditor&&(this.documentEditor.enableTrackChanges=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"documentSettings":this.documentEditor&&(this.documentEditor.documentSettings.compatibilityMode=this.documentSettings.compatibilityMode);break;case"documentEditorSettings":this.documentEditor&&this.customizeDocumentEditorSettings(),je(e.documentEditorSettings.fontFamilies)||(i=e.documentEditorSettings.fontFamilies,this.refreshFontFamilies(i));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,"Continuous"===e.layoutType?this.statusBar.togglePageLayout():this.statusBar.toggleWebLayout());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(this.height),this.documentEditor&&this.documentEditor.resize(),this.resize();break;case"width":this.element.style.width=T(this.width),this.documentEditor&&this.documentEditor.resize();break;case"enableAutoFocus":this.documentEditor&&(this.documentEditor.enableAutoFocus=e.enableAutoFocus);break;case"autoResizeOnVisibilityChange":this.documentEditor&&(this.documentEditor.autoResizeOnVisibilityChange=e.autoResizeOnVisibilityChange)}},Rmi.prototype.preRender=function(){this.localObj=new Cn("documenteditorcontainer",this.defaultLocale,this.locale),je(this.element)||""!==this.element.id||(this.element.id=Y.getUniqueElementId()),this.initContainerElement()},Rmi.prototype.render=function(){this.toolbarModule&&(this.toolbarModule.initToolBar(this.toolbarItems),this.toolbarModule.enableDisableInsertComment(this.enableComment)),""!==this.height&&(this.element.style.height=T(this.height)),""!==this.width&&(this.element.style.width=T(this.width)),this.element.style.minHeight="320px",this.initializeDocumentEditor(),this.restrictEditing&&this.restrictEditingToggleHelper(this.restrictEditing),this.headerFooterProperties=new ymi(this,this.enableRtl),this.imageProperties=new bmi(this,this.enableRtl),this.tocProperties=new Cmi(this,this.enableRtl),this.tableProperties=new Mmi(this,this.imageProperties,this.enableRtl),this.statusBar=new Pmi(this.statusBarElement,this),mA({target:this.containerTarget,cssClass:"e-spin-overlay"}),this.setserverActionSettings(),this.renderComplete()},Rmi.prototype.restrictEditingToggleHelper=function(e){this.documentEditor.isReadOnly=e,this.toolbarModule&&(this.toolbarModule.enableDisableToolBarItem(!e,!1),this.toolbarModule.toggleRestrictEditing(e)),this.showPropertiesPane=!e,this.showHidePropertiesPane(!e),this.documentEditor.trackChangesPane.enableDisableButton(!e&&!this.documentEditor.documentHelper.isDocumentProtected)},Rmi.prototype.setFormat=function(){this.characterFormat&&this.documentEditor&&this.documentEditor.setDefaultCharacterFormat(this.characterFormat),this.paragraphFormat&&this.documentEditor&&this.documentEditor.setDefaultParagraphFormat(this.paragraphFormat),this.sectionFormat&&this.documentEditor&&this.documentEditor.setDefaultSectionFormat(this.sectionFormat)},Rmi.prototype.setserverActionSettings=function(){this.serviceUrl&&(this.documentEditor.serviceUrl=Y.sanitizeString(this.serviceUrl)),this.serverActionSettings.spellCheck&&(this.documentEditor.serverActionSettings.spellCheck=Y.sanitizeString(this.serverActionSettings.spellCheck)),this.serverActionSettings.spellCheckByPage&&(this.documentEditor.serverActionSettings.spellCheckByPage=Y.sanitizeString(this.serverActionSettings.spellCheckByPage)),this.serverActionSettings.restrictEditing&&(this.documentEditor.serverActionSettings.restrictEditing=Y.sanitizeString(this.serverActionSettings.restrictEditing)),this.serverActionSettings.systemClipboard&&(this.documentEditor.serverActionSettings.systemClipboard=Y.sanitizeString(this.serverActionSettings.systemClipboard)),this.serverActionSettings.import&&(this.documentEditor.serverActionSettingsImport=Y.sanitizeString(this.serverActionSettings.import)),this.headers&&(this.documentEditor.headers=JSON.parse(Y.sanitizeString(JSON.stringify(this.headers))))},Rmi.prototype.customizeDocumentEditorSettings=function(){var e,t;this.documentEditorSettings.formFieldSettings&&(e=this.documentEditorSettings.formFieldSettings,t=this.documentEditor,je(e.applyShading)||(t.documentEditorSettings.formFieldSettings.applyShading=e.applyShading),je(e.formFillingMode)||(t.documentEditorSettings.formFieldSettings.formFillingMode=e.formFillingMode),je(e.formattingExceptions)||(t.documentEditorSettings.formFieldSettings.formattingExceptions=e.formattingExceptions),je(e.selectionColor)||(t.documentEditorSettings.formFieldSettings.selectionColor=e.selectionColor),je(e.shadingColor)||(t.documentEditorSettings.formFieldSettings.shadingColor=e.shadingColor)),this.documentEditorSettings.searchHighlightColor&&(this.documentEditor.documentEditorSettings.searchHighlightColor=Y.sanitizeString(this.documentEditorSettings.searchHighlightColor)),this.documentEditorSettings.fontFamilies&&(this.documentEditor.documentEditorSettings.fontFamilies=JSON.parse(Y.sanitizeString(JSON.stringify(this.documentEditorSettings.fontFamilies)))),this.documentEditorSettings.collaborativeEditingSettings&&(this.documentEditor.documentEditorSettings.collaborativeEditingSettings=this.documentEditorSettings.collaborativeEditingSettings),this.documentEditorSettings.printDevicePixelRatio&&(this.documentEditor.documentEditorSettings.printDevicePixelRatio=this.documentEditorSettings.printDevicePixelRatio),je(this.documentEditorSettings.enableOptimizedTextMeasuring)||(this.documentEditor.documentEditorSettings.enableOptimizedTextMeasuring=this.documentEditorSettings.enableOptimizedTextMeasuring),je(this.documentEditorSettings.maximumRows)||(this.documentEditor.documentEditorSettings.maximumRows=this.documentEditorSettings.maximumRows),je(this.documentEditorSettings.maximumColumns)||(this.documentEditor.documentEditorSettings.maximumColumns=this.documentEditorSettings.maximumColumns),je(this.documentEditorSettings.showHiddenMarks)||(this.documentEditor.documentEditorSettings.showHiddenMarks=this.documentEditorSettings.showHiddenMarks),je(this.documentEditorSettings.showBookmarks)||(this.documentEditor.documentEditorSettings.showBookmarks=this.documentEditorSettings.showBookmarks),je(this.documentEditorSettings.highlightEditableRanges)||(this.documentEditor.documentEditorSettings.highlightEditableRanges=this.documentEditorSettings.highlightEditableRanges),je(this.documentEditorSettings.allowDragAndDrop)||(this.documentEditor.documentEditorSettings.allowDragAndDrop=this.documentEditorSettings.allowDragAndDrop),je(this.documentEditorSettings.optimizeSfdt)||(this.documentEditor.documentEditorSettings.optimizeSfdt=this.documentEditorSettings.optimizeSfdt),je(this.documentEditorSettings.autoResizeSettings)||(this.documentEditor.documentEditorSettings.autoResizeSettings=this.documentEditorSettings.autoResizeSettings),je(this.documentEditorSettings.showRuler)||(this.documentEditor.documentEditorSettings.showRuler=this.documentEditorSettings.showRuler),je(this.documentEditorSettings.colorPickerSettings)||(this.documentEditor.documentEditorSettings.colorPickerSettings=this.documentEditorSettings.colorPickerSettings),je(this.documentEditorSettings.popupTarget)||(this.documentEditor.documentEditorSettings.popupTarget=this.documentEditorSettings.popupTarget),je(this.documentEditorSettings.showNavigationPane)||(this.documentEditor.documentEditorSettings.showNavigationPane=this.documentEditorSettings.showNavigationPane),je(this.documentEditorSettings.mentionSettings)||(this.documentEditor.documentEditorSettings.mentionSettings=this.documentEditorSettings.mentionSettings),je(this.documentEditorSettings.pasteAsNewParagraph)||(this.documentEditor.documentEditorSettings.pasteAsNewParagraph=this.documentEditorSettings.pasteAsNewParagraph)},Rmi.prototype.getPersistData=function(){return"documenteditor-container"},Rmi.prototype.requiredModules=function(){var e=[];return this.enableToolbar&&e.push({member:"toolbar",args:[this]}),e},Rmi.prototype.initContainerElement=function(){var e=this.enableRtl;this.containerTarget=this.createElement("div",{className:"e-de-ctn"}),this.containerTarget.contentEditable="false",this.createToolbarContainer(e),this.propertiesPaneContainer=this.createElement("div",{className:e?"e-de-pane-rtl":"e-de-pane",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)},Rmi.prototype.createToolbarContainer=function(e,t){je(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":"")}),t?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"))},Rmi.prototype.initializeDocumentEditor=function(){var e=this.element.id+"_editor",e=this.createElement("div",{id:e,styles:"width:100%;height:100%"});this.documentEditorInternal=new bgi({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),beforeAcceptRejectChanges:this.onBeforeAcceptRejectChanges.bind(this),beforeCommentAction:this.onCommentAction.bind(this),trackChange:this.onTrackChange.bind(this),serviceFailure:this.fireServiceFailure.bind(this),beforeXmlHttpRequestSend:this.beforeXmlHttpSend.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:!0,showComments:!0,enableLockAndEdit:this.enableLockAndEdit,enableAutoFocus:this.enableAutoFocus}),this.wireEvents(),this.customizeDocumentEditorSettings(),this.documentEditor.enableAllModules(),this.documentEditor.enableComment=this.enableComment,this.editorContainer.insertBefore(e,this.editorContainer.firstChild),this.setFormat(),this.documentEditor.appendTo(e),this.documentEditor.resize()},Rmi.prototype.wireEvents=function(){window.addEventListener("resize",this.onWindowResize.bind(this)),this.documentEditor.on(wJt,this.onZoomFactorChange,this),this.documentEditor.on(YJt,this.onViewChange,this),this.documentEditor.on(KJt,this.showPropertiesPaneOnSelection,this),this.documentEditor.on(JJt,this.updateShowHiddenMarks,this),this.documentEditor.on(ZJt,this.updateStyleCollection,this),this.documentEditor.on(eZt,this.triggerAutoResize,this),this.documentEditor.on(tZt,this.onBeforeAutoResize,this),this.documentEditor.on(iZt,this.onEnableTrackChanges,this),this.documentEditor.on(nZt,this.onOptionPaneChange,this)},Rmi.prototype.onWindowResize=function(){je(this.documentEditor)||(this.documentEditor.isContainerResize=!0,this.resize())},Rmi.prototype.onOptionPaneChange=function(e){},Rmi.prototype.onEnableTrackChanges=function(e){e.enableTrackChanges!==this.enableTrackChanges&&(this.enableTrackChanges=e.enableTrackChanges)},Rmi.prototype.triggerAutoResize=function(e){e.cancel=!0,this.resize()},Rmi.prototype.onBeforeAutoResize=function(e){e.element=this.element},Rmi.prototype.unWireEvents=function(){je(this.documentEditor)||this.documentEditor.isDestroyed||(this.documentEditor.off(wJt,this.onZoomFactorChange),this.documentEditor.off(YJt,this.onViewChange),this.documentEditor.off(KJt,this.showPropertiesPaneOnSelection),this.documentEditor.off(JJt,this.updateShowHiddenMarks),this.documentEditor.off(ZJt,this.updateStyleCollection))},Rmi.prototype.onCommentBegin=function(){this.toolbarModule&&this.toolbarModule.enableDisableInsertComment(!1)},Rmi.prototype.onCommentEnd=function(){this.toolbarModule&&this.toolbarModule.enableDisableInsertComment(this.enableComment)},Rmi.prototype.beforeXmlHttpSend=function(e){this.trigger(XJt,e)},Rmi.prototype.onCommentDelete=function(e){this.trigger(_Jt,e)},Rmi.prototype.onBeforeAcceptRejectChanges=function(e){this.trigger(HJt,e)},Rmi.prototype.onCommentAction=function(e){this.trigger(VJt,e)},Rmi.prototype.onTrackChange=function(e){this.trigger(QJt,e),this.toolbarModule&&this.toolbarModule.toggleTrackChanges(e.isTrackChangesEnabled)},Rmi.prototype.onBeforePaneSwitch=function(e){this.trigger(zJt,e)},Rmi.prototype.fireServiceFailure=function(e){this.trigger(MJt,e)},Rmi.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()},Rmi.prototype.updateStyleCollection=function(){je(this.tableProperties)||je(this.tableProperties.tableTextProperties)||je(this.tableProperties.tableTextProperties.paragraph)||this.tableProperties.tableTextProperties.paragraph.updateStyleNames()},Rmi.prototype.resize=function(e,t){this.element&&(this.documentEditor.isContainerResize||(je(t)&&this.element&&this.element.parentElement&&(t=this.element.parentElement.clientHeight),je(e)&&this.element&&this.element.parentElement&&(e=this.element.parentElement.clientWidth),!je(e)&&200<e&&(this.width=e.toString(),this.element.style.width=e+"px"),!je(t)&&200<t&&(this.height=t.toString(),this.element.style.height=t+"px")),this.documentEditor&&this.documentEditor.resize(),this.toolbarModule&&this.toolbarModule.toolbar.refreshOverflow(),this.showPropertiesPane)&&this.tableProperties.updateTabContainerHeight()},Rmi.prototype.refreshFontFamilies=function(e){if(!je(this.tableProperties)&&!je(this.tableProperties.tableTextProperties)&&!je(this.tableProperties.tableTextProperties.text)){var t=this.tableProperties.tableTextProperties.text;t.fontFamily.refresh();for(var i=0;i<e.length;i++){var n=e[i];t.fontFamily.addItem({FontName:n,FontValue:n},i)}}},Rmi.prototype.onContentChange=function(e){this.toolbarModule&&this.toolbarModule.enableDisableUndoRedo(),this.statusBar&&this.statusBar.updatePageCount();e={source:this,operations:e.operations};this.trigger(CJt,e)},Rmi.prototype.onDocumentChange=function(){this.enableTrackChanges=this.documentEditor.enableTrackChanges,je(this.documentSettings)||je(this.documentEditor)||je(this.documentEditor.documentSettings)||(this.documentSettings.compatibilityMode=this.documentEditor.documentSettings.compatibilityMode),je(this.documentEditorSettings)||je(this.documentEditorSettings.fontFamilies)||(e=this.documentEditorSettings.fontFamilies,this.refreshFontFamilies(e)),this.toolbarModule&&(this.toolbarModule.isCommentEditing=!1,this.toolbarModule.enableDisableInsertComment(!0),this.toolbarModule.enableDisableUndoRedo()),this.statusBar&&this.statusBar.updatePageCount();var e={source:this};this.trigger(SJt,e),this.updateStyleCollection()},Rmi.prototype.onSelectionChange=function(){var t=this;setTimeout(function(){var e;je(t.documentEditor)||(t.showPropertiesPaneOnSelection(),e={source:t,isCompleted:t.documentEditor.documentHelper.isSelectionCompleted},t.trigger(AJt,e),t.documentEditor.documentHelper.isSelectionCompleted=!0)})},Rmi.prototype.onZoomFactorChange=function(){this.statusBar&&this.statusBar.updateZoomContent()},Rmi.prototype.updateShowHiddenMarks=function(e){this.documentEditorSettings.showHiddenMarks=e.showHiddenMarks,this.tableProperties.tableTextProperties.paragraph.toggleHiddenMarks()},Rmi.prototype.onRequestNavigate=function(e){var t,i;"Bookmark"!==e.linkType&&(t=e.navigationLink,i=go.sanitize(t),0<e.localReference.length&&(i+="#"+e.localReference),"file:///"===t.substring(0,8)||"http://"===t.substring(0,7)&&7<t.length||"https://"===t.substring(0,8)&&8<t.length||"www."===t.substring(0,4)&&4<t.length||"mailto:"===t.substring(0,7)&&7<t.length?window.open(i):WC.alert({title:this.localObj.getConstant("Information"),content:this.localObj.getConstant("The address of this site is not valid. Check the address and try again."),okButton:{text:this.localObj.getConstant("OK")},closeOnEscape:!0}),e.isHandled=!0)},Rmi.prototype.onViewChange=function(e){this.statusBar&&this.statusBar.updatePageNumberOnViewChange(e)},Rmi.prototype.onCustomContextMenuSelect=function(e){this.trigger(PJt,e)},Rmi.prototype.onCustomContextMenuBeforeOpen=function(e){this.trigger(BJt,e)},Rmi.prototype.showPropertiesPaneOnSelection=function(){var e,t,i;this.restrictEditing&&!this.showPropertiesPane||je(this.tableProperties)||(t=(e="NoProtection"!==this.documentEditor.documentHelper.protectionType)&&this.documentEditor.documentHelper.restrictFormatting,i=this.documentEditor.editorModule.restrictEditing,e?(this.toolbarModule&&this.toolbarModule.enableDisableToolBarItem(!i,!0),this.tableProperties.enableDisableElements(!t&&!i),this.tocProperties.enableDisableElements(!i),this.headerFooterProperties.enableDisableElements(!i),this.imageProperties.enableDisableElements(!i)):(e=!this.documentEditor.isReadOnly,this.toolbarModule&&this.toolbarModule.enableDisableToolBarItem(e,!0),this.tableProperties.enableDisableElements(!0),this.tocProperties.enableDisableElements(!0),this.headerFooterProperties.enableDisableElements(!0),this.imageProperties.enableDisableElements(!0)),(i=0<=(t=this.documentEditor.selectionModule.contextType).indexOf("Header")||0<=t.indexOf("Footer"))||(this.showHeaderProperties=!0),this.showPropertiesPane?(this.propertiesPaneContainer.style.display="block",i&&this.showHeaderProperties?this.showProperties("headerfooter"):0<=t.indexOf("List")||0<=t.indexOf("Text")&&t.indexOf("Table")<0?this.showProperties("text"):0<=t.indexOf("Image")?this.showProperties("image"):0<=t.indexOf("TableOfContents")?this.showProperties("toc"):0<=t.indexOf("Table")&&this.showProperties("table")):(this.showHidePropertiesPane(!1),this.propertiesPaneContainer.style.display="none"),this.previousContext=this.documentEditor.selectionModule.contextType,this.toolbarModule&&this.toolbarModule.toolbar&&this.toolbarModule.enableDisableInsertComment(!this.documentEditor.enableHeaderAndFooter&&this.enableComment&&!this.documentEditor.isReadOnlyMode&&!this.documentEditor.selectionModule.isinFootnote&&!this.documentEditor.selectionModule.isinEndnote&&!this.documentEditor.selectionModule.isPlainContentControl()))},Rmi.prototype.showProperties=function(e){this.toolbarModule&&"headerfooter"!==e&&"toc"!==e&&this.toolbarModule.enableDisablePropertyPaneButton(!0),this.tableProperties.showTableProperties("table"===e||"text"===e,e),this.imageProperties.showImageProperties("image"===e),this.headerFooterProperties.showHeaderFooterPane("headerfooter"===e),this.tocProperties.showTocPane("toc"===e)},Rmi.prototype.setDefaultCharacterFormat=function(e){this.characterFormat=e,this.setFormat()},Rmi.prototype.setDefaultParagraphFormat=function(e){this.paragraphFormat=e,this.setFormat()},Rmi.prototype.setDefaultSectionFormat=function(e){this.sectionFormat=e,this.setFormat()},Rmi.prototype.destroy=function(){Lmi.prototype.destroy.call(this),this.element&&(this.refreshing||this.element.classList.remove("e-documenteditorcontainer"),this.element.innerHTML=""),this.refreshing||(this.element=void 0,this.paragraphFormat=void 0,this.sectionFormat=void 0,this.characterFormat=void 0),this.toolbarContainer&&this.toolbarContainer.parentElement&&(this.toolbarContainer.innerHTML="",this.toolbarContainer.parentElement.removeChild(this.toolbarContainer)),this.toolbarContainer=void 0,this.documentEditorInternal&&(this.unWireEvents(),this.documentEditorInternal.destroy(),this.documentEditorInternal=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.propertiesPaneContainer.parentElement&&this.propertiesPaneContainer.remove(),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.statusBar=void 0,this.previousContext=void 0},PNt([e(!0)],Rmi.prototype,"showPropertiesPane",void 0),PNt([e(!0)],Rmi.prototype,"enableToolbar",void 0),PNt([e(!1)],Rmi.prototype,"restrictEditing",void 0),PNt([e(!1)],Rmi.prototype,"enableSpellCheck",void 0),PNt([e(!1)],Rmi.prototype,"enableTrackChanges",void 0),PNt([e("Pages")],Rmi.prototype,"layoutType",void 0),PNt([e("")],Rmi.prototype,"currentUser",void 0),PNt([e("#FFFF00")],Rmi.prototype,"userColor",void 0),PNt([e(!1)],Rmi.prototype,"enableLocalPaste",void 0),PNt([e()],Rmi.prototype,"serviceUrl",void 0),PNt([e(2e3)],Rmi.prototype,"zIndex",void 0),PNt([e(!1)],Rmi.prototype,"enableCsp",void 0),PNt([e(!0)],Rmi.prototype,"enableComment",void 0),PNt([e("100%")],Rmi.prototype,"width",void 0),PNt([e("320px")],Rmi.prototype,"height",void 0),PNt([e(!0)],Rmi.prototype,"enableAutoFocus",void 0),PNt([e(!1)],Rmi.prototype,"enableLockAndEdit",void 0),PNt([e(!1)],Rmi.prototype,"autoResizeOnVisibilityChange",void 0),PNt([i()],Rmi.prototype,"created",void 0),PNt([i()],Rmi.prototype,"destroyed",void 0),PNt([i()],Rmi.prototype,"contentChange",void 0),PNt([i()],Rmi.prototype,"selectionChange",void 0),PNt([i()],Rmi.prototype,"documentChange",void 0),PNt([i()],Rmi.prototype,"toolbarClick",void 0),PNt([i()],Rmi.prototype,"customContextMenuSelect",void 0),PNt([i()],Rmi.prototype,"customContextMenuBeforeOpen",void 0),PNt([i()],Rmi.prototype,"beforePaneSwitch",void 0),PNt([i()],Rmi.prototype,"commentDelete",void 0),PNt([i()],Rmi.prototype,"beforeAcceptRejectChanges",void 0),PNt([i()],Rmi.prototype,"beforeCommentAction",void 0),PNt([i()],Rmi.prototype,"serviceFailure",void 0),PNt([i()],Rmi.prototype,"trackChange",void 0),PNt([i()],Rmi.prototype,"contentControl",void 0),PNt([i()],Rmi.prototype,"beforeXmlHttpRequestSend",void 0),PNt([t({},WOt)],Rmi.prototype,"documentEditorSettings",void 0),PNt([t({},dNt)],Rmi.prototype,"documentSettings",void 0),PNt([e({import:"Import",systemClipboard:"SystemClipboard",spellCheck:"SpellCheck",spellCheckByPage:"SpellCheckByPage",restrictEditing:"RestrictEditing",canLock:"CanLock",getPendingActions:"GetPendingActions"})],Rmi.prototype,"serverActionSettings",void 0),PNt([e(["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","ContentControl","XML Mapping"])],Rmi.prototype,"toolbarItems",void 0),PNt([e([])],Rmi.prototype,"headers",void 0),PNt([Bt],Rmi));function Rmi(e,t){e=Lmi.call(this,e,t)||this;return e.previousContext="",e.showHeaderProperties=!0,e.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","XML Mapping Pane":"XML Mapping Pane","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:"Page","Show properties pane":"Show properties pane","Hide properties pane":"Hide properties pane","Next Page":"Next Page",Continuous:"Continuous","Header And Footer":"Header & Footer",Options:"Options","XML Mapping":"XML Mapping","Custom XML Part:":"Custom XML Part:","Core Properties":"Core Properties",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",of:"of","Fit one page":"Fit one page","Spell Check":"Spell Check",Spelling:"Spelling","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.","Content Control":"Content Control","Insert Content Control":"Insert Content Control","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",SentenceCase:"Sentence case",Lowercase:"Lowercase",CapitalizeEachWord:"Capitalize each word",ToggleCase:"tOGGLE cASE","No color":"No color","Top margin":"Top margin","Bottom margin":"Bottom margin","Left margin":"Left margin","Right margin":"Right margin",Normal:"Normal",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","Heading 7":"Heading 7","Heading 8":"Heading 8","Heading 9":"Heading 9",ZoomLevelTooltip:"Zoom level. Click or tap to open the Zoom options.",None:"None",Borders:"Borders","ShowHiddenMarks Tooltip":"Show the hidden characters like spaces, tab, paragraph marks, and breaks.(Ctrl + *)",Columns:"Columns",Column:"Column","Page Breaks":"Page Breaks","Section Breaks":"Section Breaks","Link to Previous":"Link to Previous","Link to PreviousTooltip":"Link this section with previous section header or footer","Alternate Text":"Alternate Text","The address of this site is not valid. Check the address and try again.":"The address of this site is not valid. Check the address and try again.",OK:"OK",Information:"Information","Rich Text Content Control":"Rich Text Content Control","Plain Text Content Control":"Plain Text Content Control","Picture Content Control":"Picture Content Control","Combo Box Content Control":"Combo Box Content Control","Drop-Down List Content Control":"Drop-Down List Content Control","Date Picker Content Control":"Date Picker Content Control","Check Box Content Control":"Check Box Content Control"},e}bgi.Inject(rri,Wui,_ui,zui,kui,iui,Nci,Pci,oui,opi,Vci,cpi,gpi,fpi,vpi,wpi,Spi,Dpi,kpi,Qpi,Bpi,Lpi,Opi,Vpi,Hpi,jpi,Pui,qpi,set,tci,tn,Fui,nci,Kpi,Zpi,Ypi),LNt.Inject(DNt);var NNt=Object.freeze({__proto__:null,get CharacterRangeType(){return aJt},get FontScriptType(){return lJt},get LocaleId(){return hJt},get SectionBreakType(){return dJt},CONTROL_CHARACTERS:pJt,Comment:cJt,Dictionary:uJt,WUniqueFormat:mJt,WUniqueFormats:Det,XmlHttpRequestHandler:vJt,internalZoomFactorChange:wJt,contentChangeEvent:CJt,documentChangeEvent:SJt,selectionChangeEvent:AJt,zoomFactorChangeEvent:xJt,beforeFieldFillEvent:IJt,afterFieldFillEvent:TJt,afterFormFieldFillEvent:EJt,beforeFormFieldFillEvent:DJt,serviceFailureEvent:MJt,viewChangeEvent:kJt,customContextMenuSelectEvent:PJt,customContextMenuBeforeOpenEvent:BJt,contentControlEvent:FJt,beforecontentControlFillEvent:LJt,aftercontentControlFillEvent:RJt,commentBeginEvent:OJt,commentEndEvent:NJt,beforeCommentActionEvent:VJt,commentDeleteEvent:_Jt,revisionActionEvent:HJt,beforePaneSwitchEvent:zJt,requestNavigateEvent:jJt,actionCompleteEvent:WJt,trackChangeEvent:QJt,searchResultsChangeEvent:UJt,keyDownEvent:"keyDown",toolbarClickEvent:qJt,beforeFileOpenEvent:GJt,internalviewChangeEvent:YJt,beforeXmlHttpRequestSend:XJt,protectionTypeChangeEvent:KJt,internalDocumentEditorSettingsChange:JJt,internalStyleCollectionChange:ZJt,defaultFont:$Jt,internalAutoResize:eZt,beforeAutoResize:tZt,trackChanges:iZt,internalOptionPaneChange:nZt,documentLoadFailedEvent:oZt,sectionsProperty:rZt,fontSubstitutionTableProperty:sZt,characterFormatProperty:aZt,paragraphFormatProperty:lZt,listsProperty:hZt,abstractListsProperty:dZt,backgroundProperty:pZt,stylesProperty:cZt,commentsProperty:uZt,revisionsProperty:gZt,customXmlProperty:mZt,defaultTabWidthProperty:fZt,formattingProperty:yZt,trackChangesProperty:vZt,protectionTypeProperty:bZt,enforcementProperty:wZt,hashValueProperty:CZt,saltValueProperty:SZt,cryptProviderTypeProperty:["cryptProviderType","cpt"],cryptAlgorithmClassProperty:["cryptAlgorithmClass","cac"],cryptAlgorithmTypeProperty:["cryptAlgorithmType","cat"],cryptAlgorithmSidProperty:["cryptAlgorithmSid","cas"],cryptSpinCountProperty:["cryptSpinCount","csc"],doNotUseHTMLParagraphAutoSpacingProperty:AZt,alignTablesRowByRowProperty:xZt,formFieldShadingProperty:IZt,lastParagraphMarkCopiedProperty:TZt,footnotesProperty:EZt,endnotesProperty:DZt,compatibilityModeProperty:MZt,themeFontLanguagesProperty:kZt,themesProperty:PZt,nameProperty:BZt,basedOnProperty:FZt,nextProperty:LZt,linkProperty:RZt,localeIdProperty:OZt,localeIdFarEastProperty:NZt,localeIdBidiProperty:VZt,boldProperty:_Zt,italicProperty:HZt,underlineProperty:zZt,underlineColorProperty:jZt,fontHintTypeProperty:WZt,baselineAlignmentProperty:QZt,strikethroughProperty:UZt,highlightColorProperty:qZt,fontSizeProperty:GZt,fontColorProperty:YZt,fontFamilyProperty:XZt,styleNameProperty:KZt,bidiProperty:JZt,bdoProperty:ZZt,breakClearTypeProperty:$Zt,fontSizeBidiProperty:e$t,fontFamilyBidiProperty:t$t,boldBidiProperty:i$t,italicBidiProperty:n$t,allCapsProperty:o$t,complexScriptProperty:r$t,fontFamilyAsciiProperty:s$t,fontFamilyFarEastProperty:a$t,fontFamilyNonFarEastProperty:l$t,revisionIdsProperty:h$t,listIdProperty:d$t,characterSpacingProperty:p$t,scalingProperty:c$t,listLevelNumberProperty:u$t,leftIndentProperty:g$t,rightIndentProperty:m$t,firstLineIndentProperty:f$t,textAlignmentProperty:y$t,afterSpacingProperty:v$t,beforeSpacingProperty:b$t,spaceAfterAutoProperty:w$t,spaceBeforeAutoProperty:C$t,lineSpacingProperty:S$t,lineSpacingTypeProperty:A$t,listFormatProperty:x$t,keepWithNextProperty:I$t,widowControlProperty:T$t,keepLinesTogetherProperty:E$t,outlineLevelProperty:D$t,contextualSpacingProperty:M$t,bordersProperty:k$t,tabsProperty:P$t,headerDistanceProperty:B$t,footerDistanceProperty:F$t,differentFirstPageProperty:L$t,differentOddAndEvenPagesProperty:R$t,pageWidthProperty:O$t,pageHeightProperty:N$t,leftMarginProperty:V$t,rightMarginProperty:_$t,topMarginProperty:H$t,bottomMarginProperty:z$t,restartPageNumberingProperty:j$t,pageStartingNumberProperty:W$t,endnoteNumberFormatProperty:Q$t,footNoteNumberFormatProperty:U$t,restartIndexForFootnotesProperty:q$t,restartIndexForEndnotesProperty:G$t,initialFootNoteNumberProperty:Y$t,initialEndNoteNumberProperty:X$t,pageNumberStyleProperty:K$t,columnsProperty:J$t,numberOfColumnsProperty:Z$t,equalWidthProperty:$$t,lineBetweenColumnsProperty:eei,breakCodeProperty:tei,cellWidthProperty:iei,columnSpanProperty:nei,rowSpanProperty:oei,verticalAlignmentProperty:rei,allowBreakAcrossPagesProperty:sei,isHeaderProperty:aei,heightTypeProperty:lei,beforeWidthProperty:["beforeWidth","bw"],afterWidthProperty:["afterWidth","aw"],gridBeforeProperty:hei,gridBeforeWidthProperty:dei,gridBeforeWidthTypeProperty:pei,gridAfterProperty:cei,gridAfterWidthProperty:uei,gridAfterWidthTypeProperty:gei,allowAutoFitProperty:mei,cellSpacingProperty:fei,shadingProperty:yei,tableAlignmentProperty:vei,preferredWidthProperty:bei,preferredWidthTypeProperty:wei,horizontalPositionAbsProperty:Cei,textureProperty:Sei,backgroundColorProperty:Aei,foregroundColorProperty:xei,shadowProperty:Iei,hasNoneStyleProperty:Tei,verticalProperty:Eei,horizontalProperty:Dei,diagonalUpProperty:Mei,diagonalDownProperty:kei,lineStyleProperty:Pei,lineWidthProperty:Bei,layoutProperty:Fei,dataFormatProperty:Lei,yValueProperty:Rei,chartDataProperty:Oei,categoryXNameProperty:Nei,lineProperty:Vei,foreColorProperty:_ei,patternProperty:["pattern","pt"],layoutXProperty:Hei,layoutYProperty:zei,directionProperty:jei,endStyleProperty:Wei,numberValueProperty:Qei,markerStyleProperty:Uei,markerColorProperty:qei,markerSizeProperty:Gei,forwardProperty:Yei,backwardProperty:Xei,interceptProperty:Kei,isDisplayRSquaredProperty:Jei,isDisplayEquationProperty:Zei,seriesNameProperty:$ei,dataLabelProperty:eti,errorBarProperty:tti,seriesFormatProperty:iti,trendLinesProperty:nti,dataPointsProperty:oti,firstSliceAngleProperty:rti,holeSizeProperty:sti,isLegendKeyProperty:ati,isBubbleSizeProperty:lti,isCategoryNameProperty:hti,isSeriesNameProperty:dti,isValueProperty:pti,isPercentageProperty:cti,isLeaderLinesProperty:uti,showSeriesKeysProperty:gti,hasHorizontalBorderProperty:mti,hasVerticalBorderProperty:fti,hasBordersProperty:yti,categoryTypeProperty:vti,chartCategoryProperty:bti,chartSeriesProperty:wti,chartAreaProperty:Cti,chartTitleAreaProperty:Sti,plotAreaProperty:Ati,chartLegendProperty:xti,chartPrimaryCategoryAxisProperty:Iti,chartPrimaryValueAxisProperty:Tti,chartTitleProperty:Eti,chartTypeProperty:Dti,gapWidthProperty:Mti,overlapProperty:kti,chartDataTableProperty:Pti,textProperty:Bti,shapeIdProperty:Fti,alternativeTextProperty:Lti,visibleProperty:Rti,belowTextProperty:Oti,horizontalRuleProperty:Nti,widthProperty:Vti,heightProperty:_ti,widthScaleProperty:Hti,heightScaleProperty:zti,lineFormatProperty:jti,fillFormatProperty:Wti,textWrappingStyleProperty:Qti,textWrappingTypeProperty:Uti,verticalRelativePercentProperty:qti,horizontalRelativePercentProperty:Gti,heightRelativePercentProperty:Yti,widthRelativePercentProperty:Xti,zOrderPositionProperty:Kti,layoutInCellProperty:Jti,lockAnchorProperty:Zti,autoShapeTypeProperty:$ti,textFrameProperty:eii,colorProperty:tii,fillProperty:iii,textVerticalAlignmentProperty:nii,imageStringProperty:oii,metaFileImageStringProperty:rii,lengthProperty:["length","l"],isInlineImageProperty:sii,isMetaFileProperty:aii,topProperty:lii,bottomProperty:hii,rightProperty:dii,leftProperty:pii,getImageHeightProperty:cii,getImageWidthProperty:uii,hasFieldEndProperty:gii,formFieldDataProperty:mii,fieldTypeProperty:fii,isCreatedUsingHtmlSpanTagProperty:["isCreatedUsingHtmlSpanTag","ishst"],enabledProperty:yii,helpTextProperty:vii,statusTextProperty:bii,textInputProperty:wii,checkBoxProperty:Cii,dropDownListProperty:Sii,maxLengthProperty:Aii,defaultValueProperty:xii,formatProperty:Iii,sizeTypeProperty:Tii,sizeProperty:Eii,checkedProperty:Dii,dropDownItemsProperty:Mii,selectedIndexProperty:kii,commentIdProperty:Pii,commentCharacterTypeProperty:Bii,authorProperty:Fii,initialProperty:Lii,dateProperty:Rii,doneProperty:Oii,replyCommentsProperty:Nii,revisionTypeProperty:Vii,revisionIdProperty:_ii,itemIDProperty:Hii,xmlProperty:zii,footnoteTypeProperty:jii,symbolCodeProperty:Wii,symbolFontNameProperty:Qii,customMarkerProperty:Uii,inlinesProperty:qii,contentControlPropertiesProperty:Gii,lockContentControlProperty:Yii,lockContentsProperty:Xii,tagProperty:Kii,titleProperty:Jii,hasPlaceHolderTextProperty:Zii,multiLineProperty:$ii,isTemporaryProperty:eni,dateCalendarTypeProperty:tni,dateStorageFormatProperty:ini,dateDisplayLocaleProperty:nni,dateDisplayFormatProperty:oni,isCheckedProperty:rni,uncheckedStateProperty:sni,checkedStateProperty:ani,contentControlListItemsProperty:lni,xmlMappingProperty:hni,fontProperty:dni,valueProperty:pni,displayTextProperty:cni,isMappedProperty:uni,isWordMlProperty:gni,prefixMappingProperty:mni,xPathProperty:fni,storeItemIdProperty:yni,customXmlPartProperty:vni,idProperty:bni,cellFormatProperty:wni,rowFormatProperty:Cni,cellsProperty:Sni,rowsProperty:Ani,descriptionProperty:xni,wrapTextAroundProperty:Ini,isLegalStyleNumberingProperty:Tni,positioningProperty:Eni,tableFormatProperty:Dni,allowOverlapProperty:Mni,distanceTopProperty:kni,distanceRightProperty:Pni,distanceLeftProperty:Bni,distanceBottomProperty:Fni,verticalOriginProperty:Lni,verticalPositionProperty:Rni,horizontalOriginProperty:Oni,horizontalAlignmentProperty:Nni,horizontalPositionProperty:Vni,blocksProperty:_ni,headerProperty:Hni,footerProperty:zni,evenHeaderProperty:jni,evenFooterProperty:Wni,firstPageHeaderProperty:Qni,firstPageFooterProperty:Uni,headersFootersProperty:qni,sectionFormatProperty:Gni,listLevelPatternProperty:Yni,followCharacterProperty:Xni,startAtProperty:Kni,restartLevelProperty:Jni,levelNumberProperty:Zni,numberFormatProperty:$ni,paraStyleNameProperty:eoi,abstractListIdProperty:toi,nsidProperty:ioi,levelsProperty:noi,overrideListLevelProperty:ooi,levelOverridesProperty:roi,separatorProperty:soi,continuationSeparatorProperty:aoi,continuationNoticeProperty:loi,bookmarkTypeProperty:hoi,propertiesProperty:doi,tabJustificationProperty:poi,positionProperty:coi,deletePositionProperty:uoi,leaderProperty:["leader","l"],tabLeaderProperty:goi,editRangeIdProperty:moi,columnFirstProperty:foi,columnLastProperty:yoi,userProperty:voi,groupProperty:boi,editableRangeStartProperty:woi,spaceProperty:Coi,fontSchemeProperty:Soi,fontSchemeNameProperty:Aoi,majorFontSchemeProperty:xoi,minorFontSchemeProperty:Ioi,fontSchemeListProperty:Toi,fontTypefaceProperty:Eoi,typefaceProperty:Doi,panoseProperty:Moi,typeProperty:koi,majorUnitProperty:Poi,isAutoMajorProperty:Boi,maximumValueProperty:Foi,minimumValueProperty:Loi,hasMajorGridLinesProperty:Roi,hasMinorGridLinesProperty:Ooi,majorTickMarkProperty:Noi,minorTickMarkProperty:Voi,tickLabelPositionProperty:_oi,rgbProperty:Hoi,appearanceProperty:zoi,lineFormatTypeProperty:joi,allowSpaceOfSameStyleInTableProperty:Woi,weightProperty:Qoi,inlineFormatProperty:Uoi,fontNameProperty:qoi,isCompressedProperty:Goi,columnIndexProperty:Yoi,imagesProperty:Xoi,isAfterParagraphMarkProperty:Koi,isAfterCellMarkProperty:Joi,isAfterRowMarkProperty:Zoi,gridProperty:$oi,columnCountProperty:eri,isAfterTableMarkProperty:tri,incrementalOps:iri,hiddenProperty:nri,editingPointsProperty:ori,Print:rri,ContextMenu:opi,CommentReviewPane:spi,CommentPane:lpi,CommentView:dpi,HyperlinkDialog:cpi,TableDialog:gpi,BookmarkDialog:fpi,TableOfContentsDialog:vpi,PageSetupDialog:wpi,ParagraphDialog:Spi,ListDialog:Dpi,StyleDialog:kpi,BulletsAndNumberingDialog:Bpi,FontDialog:Lpi,TablePropertiesDialog:Opi,BordersAndShadingDialog:Vpi,TableOptionsDialog:Hpi,CellOptionsDialog:jpi,StylesDialog:Qpi,SpellCheckDialog:qpi,CheckBoxFormFieldDialog:Ypi,TextFormFieldDialog:Kpi,DropDownFormFieldDialog:Zpi,FormFieldPopUp:Fsi,ColumnsDialog:tci,TabDialog:nci,Editor:Nci,ImageResizer:Vci,ImageResizingPoints:Hci,SelectedImageInfo:zci,TableResizer:Fci,HelperMethods:Y,Point:kri,Base64:Bri,WrapPosition:Lri,CollaborativeEditing:set,XmlPane:Qci,EditorHistory:Pci,BaseHistoryInfo:Ici,HistoryInfo:Mci,ModifiedLevel:uci,ModifiedParagraphFormat:mci,RowHistoryFormat:yci,TableHistoryInfo:bci,TableFormatHistoryInfo:Sci,RowFormatHistoryInfo:Aci,CellFormatHistoryInfo:xci,CellHistoryFormat:Cci,WSectionFormat:ari,WColumnFormat:hri,WStyle:Ori,WParagraphStyle:_ri,WCharacterStyle:jri,WTableStyle:Uri,WStyles:Gri,WCharacterFormat:Eri,WListFormat:mri,WTabStop:yri,WParagraphFormat:bri,WTableFormat:Jri,WRowFormat:Cri,WCellFormat:$ri,WBorder:pri,WBorders:uri,WShading:Xri,WList:xpi,WAbstractList:tsi,WListLevel:rsi,WLevelOverride:nsi,AddUserDialog:Isi,EnforceProtectionDialog:Esi,UnProtectDocumentDialog:Msi,RestrictEditing:Psi,Search:iui,OptionsPane:oui,TextSearch:qci,SearchWidgetInfo:Yci,TextSearchResult:Kci,TextSearchResults:Zci,Selection:kui,SelectionCharacterFormat:sui,SelectionBorder:lui,SelectionBorders:dui,SelectionParagraphFormat:cui,SelectionHeaderFooter:gui,SelectionSectionFormat:fui,SelectionTableFormat:vui,SelectionCellFormat:wui,SelectionRowFormat:Sui,SelectionImageFormat:xui,SelectionColumnFormat:Tui,TextPosition:rci,SelectionWidgetInfo:aci,Hyperlink:hci,ImageSizeInfo:pci,SpellChecker:Pui,Optimized:Fui,Regular:Rui,Revision:Ari,RevisionCollection:Iri,TrackChangesPane:Nsi,ChangesSingleView:_si,DocumentHelper:Zsi,LayoutViewer:eai,PageLayoutViewer:nai,WebLayoutViewer:sai,ColumnLayout:lai,Rect:pai,Padding:uai,Margin:gai,Widget:fai,BlockContainer:bai,BodyWidget:Sai,HeaderFooterWidget:Iai,BlockWidget:Dai,FootNoteWidget:Pai,ParagraphWidget:Lai,TablePosition:Oai,TableWidget:_ai,TableRowWidget:jai,TableCellWidget:Uai,LineWidget:Gai,ElementBox:Xai,FieldElementBox:Zai,FormField:P$e,TextFormField:ili,CheckBoxFormField:rli,DropDownFormField:lli,TextElementBox:pli,Footnote:uli,FootnoteElementBox:fli,ErrorTextElementBox:bli,FieldTextElementBox:Sli,TabElementBox:Ili,BookmarkElementBox:Dli,ContentControl:Pli,ContentControlProperties:Fli,ContentControlListItems:Rli,CheckBoxState:Nli,XmlMapping:_li,CustomXmlPart:zli,ShapeCommon:H$e,ShapeBase:qli,ShapeElementBox:Xli,TextFrame:Zli,LineFormat:ehi,FillFormat:ihi,ImageElementBox:rhi,ListTextElementBox:lhi,EditRangeEndElementBox:phi,EditRangeStartElementBox:ghi,ChartElementBox:yhi,ChartArea:bhi,ChartCategory:Chi,ChartData:Ahi,ChartLegend:Ihi,ChartSeries:Ehi,ChartErrorBar:Mhi,ChartSeriesFormat:Phi,ChartDataLabels:Fhi,ChartTrendLines:Rhi,ChartTitleArea:Nhi,ChartDataFormat:_hi,ChartFill:zhi,ChartLayout:Whi,ChartCategoryAxis:Uhi,ChartDataTable:Ghi,CommentCharacterElementBox:Khi,CommentElementBox:$hi,Page:tdi,WTableHolder:ndi,WColumn:rdi,ColumnSizeInfo:ddi,CommentEditInfo:adi,MentionDataEditInfo:ldi,BreakElementBox:pdi,TabStopListInfo:udi,FootnoteEndnoteMarkerElementBox:mdi,Layout:dsi,Renderer:Csi,SfdtReader:Nui,TextHelper:lsi,Zoom:Asi,WordExport:_ui,TextExport:zui,SfdtExport:Wui,HtmlExport:Dui,FontScheme:Wsi,FontSchemeStruct:Usi,Themes:Gsi,MajorMinorFontScheme:zsi,CollaborativeEditingHandler:tn,DocumentEditorSettings:WOt,DocumentSettings:dNt,AutoResizeSettings:uNt,DocumentEditor:bgi,ServerActionSettings:fNt,FormFieldSettings:bNt,CollaborativeEditingSettings:SNt,ContainerServerActionSettings:INt,Toolbar:DNt,DocumentEditorContainer:LNt}),Omi=(Nmi.prototype.isEmpty=function(){return 0===this.height&&0===this.width},Nmi.prototype.clone=function(){return new Nmi(this.width,this.height)},Nmi);function Nmi(e,t){this.width=e,this.height=t}Vmi=function(e,t){return(Vmi=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])}))(e,t)};var Vmi,_mi,HNt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Hmi=(function(e,t){function i(){this.constructor=e}Vmi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(zmi,_mi=n),zmi.equals=function(e,t){return e===t||!(!e||!t||e&&t&&(e.x!==t.x||e.y!==t.y))},zmi.isEmptyPoint=function(e){return!e.x||!e.y},zmi.transform=function(e,t,i){var n={x:0,y:0};return n.x=Math.round(100*(e.x+i*Math.cos(t*Math.PI/180)))/100,n.y=Math.round(100*(e.y+i*Math.sin(t*Math.PI/180)))/100,n},zmi.findLength=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},zmi.findAngle=function(e,t){t=180*(t=Math.atan2(t.y-e.y,t.x-e.x))/Math.PI;return(t%=360)<0&&(t+=360),t},zmi.distancePoints=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},zmi.getLengthFromListOfPoints=function(e){for(var t=0,i=0;i<e.length-1;i++)t+=this.distancePoints(e[parseInt(i.toString(),10)],e[i+1]);return t},zmi.adjustPoint=function(e,t,i,n){var o,r=i?{x:e.x,y:e.y}:{x:t.x,y:t.y};return e.x===t.x?e.y<t.y&&i||e.y>t.y&&!i?r.y+=n:r.y-=n:e.y===t.y?e.x<t.x&&i||e.x>t.x&&!i?r.x+=n:r.x-=n:r=i?(o=this.findAngle(e,t),this.transform(e,o,n)):(o=this.findAngle(t,e),this.transform(t,o,n)),r},zmi.direction=function(e,t){return Math.abs(t.x-e.x)>Math.abs(t.y-e.y)?e.x<t.x?"Right":"Left":e.y<t.y?"Bottom":"Top"},zmi.prototype.getClassName=function(){return"Point"},HNt([e(0)],zmi.prototype,"x",void 0),HNt([e(0)],zmi.prototype,"y",void 0),zmi);function zmi(){return null!==_mi&&_mi.apply(this,arguments)||this}function jmi(e){var t,i=[],n=Wmi(e);if(0<n.length)for(var o=0;o<n.length;o++){var r=n[parseInt(o.toString(),10)],s="";switch((s=r[0]).toLowerCase()){case"m":for(t=1;t<r.length;t++)i.push({command:s,x:r[parseInt(t.toString(),10)],y:r[t+1]}),t+=1,"m"===s?s="l":"M"===s&&(s="L");break;case"l":case"t":for(t=1;t<r.length;t++)i.push({command:s,x:r[parseInt(t.toString(),10)],y:r[t+1]}),t+=1;break;case"h":for(t=1;t<r.length;t++)i.push({command:s,x:r[parseInt(t.toString(),10)]});break;case"v":for(t=1;t<r.length;t++)i.push({command:s,y:r[parseInt(t.toString(),10)]});break;case"z":i.push({command:s});break;case"c":for(t=1;t<r.length;t++)i.push({command:s,x1:r[parseInt(t.toString(),10)],y1:r[t+1],x2:r[t+2],y2:r[t+3],x:r[t+4],y:r[t+5]}),t+=5;break;case"s":for(t=1;t<r.length;t++)i.push({command:s,x2:r[parseInt(t.toString(),10)],y2:r[t+1],x:r[t+2],y:r[t+3]}),t+=3;break;case"q":for(t=1;t<r.length;t++)i.push({command:s,x1:r[parseInt(t.toString(),10)],y1:r[t+1],x:r[t+2],y:r[t+3]}),t+=3;break;case"a":for(t=1;t<r.length;t++)i.push({command:s,r1:r[parseInt(t.toString(),10)],r2:r[t+1],angle:r[t+2],largeArc:r[t+3],sweep:r[t+4],x:r[t+5],y:r[t+6]}),t+=6}}return i}function Wmi(e){for(var t=/([a-z]+)|([+-]?(?:\d+\.?\d*|\.\d+))/gi,i=[],n=[],o={},r=(t.lastIndex=0,!1),o=t.exec(e);o;)r="e"===o[1]||(o[1]?i="zm"===o[1].toLowerCase()?(i.length&&n.push(i),n.push(["Z"]),[o[1].substring(1,2)]):(i.length&&n.push(i),[o[1]]):(i.length||(i=[]),r||i.push(Number(o[2]))),!1),o=t.exec(e);return i.length&&n.push(i),n}function Qmi(e,t,i){for(var n,o="",r=[{x:0+e,y:0},{x:0+i-e,y:0},{x:0+i,y:0+e},{x:0+i,y:0+t-e},{x:0+i-e,y:0+t},{x:0+e,y:0+t},{x:0,y:0+t-e},{x:0,y:0+e}],s=[{x:0+i,y:0},{x:0+i,y:0+t},{x:0,y:0+t},{x:0,y:0}],a=0,o="M"+r[0].x+" "+r[0].y,l=0;l<r.length;l+=2)o+="L"+(n=r[l+1]).x+" "+n.y,n=r[l+2]||r[0],o+="Q"+s[parseInt(a.toString(),10)].x+" "+s[parseInt(a.toString(),10)].y+" "+n.x+" "+n.y,a++;return o}function Umi(e){for(var t,i="",i="M"+e[0].x+" "+e[0].y,n=1;n<e.length;n++)i+="L"+(t=e[parseInt(n.toString(),10)]).x+" "+t.y;return i+="Z"}function qmi(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].x=Math.round(e[parseInt(t.toString(),10)].x),e[parseInt(t.toString(),10)].y=Math.round(e[parseInt(t.toString(),10)].y);for(var i,n="",n="M"+e[0].x+" "+e[0].y,o=1;o<e.length;o++)n+="L"+(i=e[parseInt(o.toString(),10)]).x+" "+i.y;return n}function Gmi(e){for(var t,i,n,o,r,s,a=[],l=0,h=0,d=0,p=e.length;d<p;++d){var c,u,g=e[d],m=g.command,f=("y1"in g&&(o=g.y1),"y2"in g&&(s=g.y2),"x1"in g&&(n=g.x1),"x2"in g&&(r=g.x2),"x"in g&&(l=g.x),"y"in g&&(h=g.y),a[a.length-1]);switch(m){case"M":a.push({command:"M",x:l,y:h});break;case"L":a.push({command:"L",x0:t,y0:i,x:l,y:h});break;case"H":a.push({command:"L",x0:t,y0:i,x:l,y:i});break;case"V":a.push({command:"L",x0:t,y0:i,x:t,y:h});break;case"C":a.push({command:"C",x0:t,y0:i,x1:n,y1:o,x2:r,y2:s,x:l,y:h});break;case"S":f&&(c=void 0,u={x:2*t-(c="C"===f.command||"S"===f.command?{x:f.x2,y:f.y2}:{x:t,y:i}).x,y:2*i-c.y},a.push({command:"C",x0:t,y0:i,x1:u.x,y1:u.y,x2:r,y2:s,x:l,y:h}));break;case"Q":a.push({command:"Q",x0:t,y0:i,x1:n,y1:o,x:l,y:h});break;case"T":f&&(c=void 0,u={x:2*t-(c="Q"===f.command?{x:f.x1,y:f.y1}:{x:t,y:i}).x,y:2*i-c.y},a.push({command:"Q",x0:t,y0:i,x1:u.x,y1:u.y,x:l,y:h}));break;case"A":var y=g;y.command="A",a.push(y);break;case"Z":case"z":a.push({command:"Z"}),l=t,h=i}t=l,i=h}return a}function Ymi(e,t,i,n,o,r,s,a){for(var l,h,d,p,c=0,u=0,g=0,m=e.length;g<m;++g){var f=e[g],y=f.command;"x"in f&&(c=f.x),"y"in f&&(u=f.y),"y1"in f&&(h=f.y1),"y2"in f&&(p=f.y2),"x1"in f&&(l=f.x1),"x2"in f&&(d=f.x2),n?(void 0!==c&&(c=Kmi(c,t,o,s)),void 0!==u&&(u=Kmi(u,i,r,a)),void 0!==l&&(l=Kmi(l,t,o,s)),void 0!==h&&(h=Kmi(h,i,r,a)),void 0!==d&&(d=Kmi(d,t,o,s)),void 0!==p&&(p=Kmi(p,i,r,a))):(void 0!==c&&(c=Number((c+t).toFixed(2))),void 0!==u&&(u=Number((u+i).toFixed(2))),void 0!==l&&(l=Number((l+t).toFixed(2))),void 0!==h&&(h=Number((h+i).toFixed(2))),void 0!==d&&(d=Number((d+t).toFixed(2))),void 0!==p&&(p=Number((p+i).toFixed(2)))),(y=Xmi(f,y,{x:c,y:u,x1:l,y1:h,x2:d,y2:p,r1:f.r1,r2:f.r2},n,t,i))&&(e[g]=y)}return Zmi(e)}function Xmi(e,t,i,n,o,r){switch(t){case"M":case"L":e.x=i.x,e.y=i.y;break;case"H":e.x=i.x;break;case"V":e.y=i.y;break;case"C":e.x=i.x,e.y=i.y,e.x1=i.x1,e.y1=i.y1,e.x2=i.x2,e.y2=i.y2;break;case"S":e.x=i.x,e.y=i.y,e.x2=i.x2,e.y2=i.y2;break;case"Q":e.x=i.x,e.y=i.y,e.x1=i.x1,e.y1=i.y1;break;case"T":e.x=i.x,e.y=i.y;break;case"A":var s=i.r1,a=i.r2;n&&(i.r1=s*=o,i.r2=a*=r),e.x=i.x,e.y=i.y,e.r1=i.r1,e.r2=i.r2;break;case"z":case"Z":e={command:"Z"}}return e}function Kmi(e,t,i,n){return e!==i?e=n!==i?e*t-(Number(i)*t-Number(i))+(n-Number(i)):Number(e)*t-(Number(i)*t-Number(i)):n!==i&&(e=n),Number(e.toFixed(2))}function Jmi(e){for(var t,i,n,o,r,s,a=0,l=0,h=0,d=e.length;h<d;++h){var p=e[parseInt(h.toString(),10)],c=p.command;if(/[MLHVCSQTA]/.test(c))"x"in p&&(p.x=a=p.x),"y"in p&&(p.y=l=p.y);else{"x1"in p&&(p.x1=n=a+p.x1),"x2"in p&&(p.x2=r=a+p.x2),"y1"in p&&(p.y1=o=l+p.y1),"y2"in p&&(p.y2=s=l+p.y2),"x"in p&&(p.x=a+=p.x),"y"in p&&(p.y=l+=p.y);var u=void 0;switch(c){case"m":case"M":u={command:"M",x:a,y:l};break;case"l":case"L":u={command:"L",x:a,y:l};break;case"h":case"H":u={command:"H",x:a};break;case"v":case"V":u={command:"V",y:l};break;case"c":case"C":u={command:"C",x:a,y:l,x1:n,y1:o,x2:r,y2:s};break;case"s":case"S":u={command:"S",x:a,y:l,x2:r,y2:s};break;case"q":case"Q":u={command:"Q",x:a,y:l,x1:n,y1:o};break;case"t":case"T":u={command:"T",x:a,y:l};break;case"a":case"A":(u={command:"A",x:a,y:l}).r1=p.r1,u.r2=p.r2,u.angle=p.angle,u.largeArc=p.largeArc,u.sweep=p.sweep;break;case"z":case"Z":u={command:"Z"},a=t,l=i,u=e[parseInt(h.toString(),10)]}u&&(e[parseInt(h.toString(),10)]=u)}"M"!==c&&"m"!==c||(t=a,i=l)}return e}function Zmi(e){for(var t="",i=0;i<e.length;i++)t+=0===i?$mi(e[parseInt(i.toString(),10)]):" "+$mi(e[parseInt(i.toString(),10)]);return t}function $mi(e){var t="";switch(e.command){case"Z":case"z":t=e.command;break;case"M":case"m":case"L":case"l":t=e.command+" "+e.x+" "+e.y;break;case"C":case"c":t=e.command+" "+e.x1+" "+e.y1+" "+e.x2+" "+e.y2+" "+e.x+" "+e.y;break;case"Q":case"q":t=e.command+" "+e.x1+" "+e.y1+" "+e.x+" "+e.y;break;case"A":case"a":var i=e.command,n=e.angle,o=e.largeArc?"1":"0",r=e.sweep?"1":"0",t=i+" "+e.r1+" "+e.r2+" "+n+" "+o+" "+r+" "+e.x+" "+e.y;break;case"H":case"h":t=e.command+" "+e.x;break;case"V":case"v":t=e.command+" "+e.y;break;case"S":case"s":t=e.command+" "+e.x2+" "+e.y2+" "+e.x+" "+e.y;break;case"T":case"t":t=e.command+" "+e.x+" "+e.y}return t}Object.defineProperty(ifi.prototype,"left",{get:function(){return this.x},enumerable:!0,configurable:!0}),Object.defineProperty(ifi.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(ifi.prototype,"top",{get:function(){return this.y},enumerable:!0,configurable:!0}),Object.defineProperty(ifi.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),Object.defineProperty(ifi.prototype,"topLeft",{get:function(){return{x:this.left,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(ifi.prototype,"topRight",{get:function(){return{x:this.right,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(ifi.prototype,"bottomLeft",{get:function(){return{x:this.left,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(ifi.prototype,"bottomRight",{get:function(){return{x:this.right,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(ifi.prototype,"middleLeft",{get:function(){return{x:this.left,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),Object.defineProperty(ifi.prototype,"middleRight",{get:function(){return{x:this.right,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),Object.defineProperty(ifi.prototype,"topCenter",{get:function(){return{x:this.x+this.width/2,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(ifi.prototype,"bottomCenter",{get:function(){return{x:this.x+this.width/2,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(ifi.prototype,"center",{get:function(){return{x:this.x+this.width/2,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),ifi.prototype.equals=function(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},ifi.prototype.uniteRect=function(e){var t=Math.max((isNaN(this.right)||this.x===Number.MAX_VALUE?e:this).right,e.right),i=Math.max((isNaN(this.bottom)||this.y===Number.MAX_VALUE?e:this).bottom,e.bottom);return this.x=Math.min(this.left,e.left),this.y=Math.min(this.top,e.top),this.width=t-this.x,this.height=i-this.y,this},ifi.prototype.unitePoint=function(e){var t,i,n;this.x===Number.MAX_VALUE?(this.x=e.x,this.y=e.y):(t=Math.min(this.left,e.x),i=Math.min(this.top,e.y),n=Math.max(this.right,e.x),e=Math.max(this.bottom,e.y),this.x=t,this.y=i,this.width=n-this.x,this.height=e-this.y)},ifi.prototype.Inflate=function(e){return this.x-=e,this.y-=e,this.width+=2*e,this.height+=2*e,this},ifi.prototype.intersects=function(e){return!(this.right<e.left||this.left>e.right||this.top>e.bottom||this.bottom<e.top)},ifi.prototype.containsRect=function(e){return this.left<=e.left&&this.right>=e.right&&this.top<=e.top&&this.bottom>=e.bottom},ifi.prototype.containsPoint=function(e,t){return this.left-(t=void 0===t?0:t)<=e.x&&this.right+t>=e.x&&this.top-t<=e.y&&this.bottom+t>=e.y},ifi.toBounds=function(e){for(var t=new ifi,i=0,n=e;i<n.length;i++){var o=n[i];t.unitePoint(o)}return t},ifi.empty=new ifi(Number.MAX_VALUE,Number.MIN_VALUE,0,0);var efi,tfi=ifi;function ifi(e,t,i,n){this.x=Number.MAX_VALUE,this.y=Number.MAX_VALUE,this.width=0,void(this.height=0)===e||void 0===t?(e=t=Number.MAX_VALUE,i=n=0):(void 0===i&&(i=0),void 0===n&&(n=0)),this.x=e,this.y=t,this.width=i,this.height=n}(WNt=efi=efi||{})[WNt.Identity=0]="Identity",WNt[WNt.Translation=1]="Translation",WNt[WNt.Scaling=2]="Scaling",WNt[WNt.Unknown=4]="Unknown";var nfi=function(e,t,i,n,o,r,s){this.m11=e,this.m12=t,this.m21=i,this.m22=n,this.offsetX=o,this.offsetY=r,this.type=s};function ofi(){return new nfi(1,0,0,1,0,0,efi.Identity)}function rfi(e,t){e=function(e,t,i){{var n,o;i=e.type===(efi.Translation|efi.Scaling)?(t=(t*=e.m11)+e.offsetX,(i*=e.m22)+e.offsetY):(n=i*e.m21+e.offsetX,o=t*e.m12+e.offsetY,t=(t*=e.m11)+n,(i*=e.m22)+o)}return{x:t,y:i}}(e,t.x,t.y);return{x:Math.round(100*e.x)/100,y:Math.round(100*e.y)/100}}function sfi(e,t){for(var i=[],n=0,o=t;n<o.length;n++){var r=o[n];i.push(rfi(e,r))}return i}function afi(e,t,i,n){var o,r;dfi(e,(e=.017453292519943295*(t%=360),t=i||0,i=n||0,n=ofi(),o=Math.sin(e),e=Math.cos(e),r=t*(1-e)+i*o,i=i*(1-e)-t*o,n.type=efi.Unknown,pfi(n,e,o,-o,e,r,i),n))}function lfi(e,t,i,n,o){dfi(e,(e=t,t=i,i=n=void 0===n?0:n,n=o=void 0===o?0:o,(o=ofi()).type=i||n?efi.Scaling|efi.Translation:efi.Scaling,pfi(o,e,0,0,t,i-e*i,n-t*n),o))}function hfi(e,t,i){e.offsetX+=t,e.offsetY+=i,e.type|=efi.Translation}function dfi(e,t){var i=e.type,n=t.type;if(i===efi.Identity)cfi(e,t),e.type=t.type;else if(i!==efi.Translation){var o=i<<4|n;switch(o){case 50:return e.m11*=t.m11,e.m22*=t.m22,e.offsetX*=t.m11,void(e.offsetY*=t.m22);case 51:return e.m11*=t.m11,e.m22*=t.m22,e.offsetX=t.m11*e.offsetX+t.offsetX,void(e.offsetY=t.m22*e.offsetY+t.offsetY);case 52:break;default:switch(o){case 66:case 67:case 68:break;default:return}}i=ofi();pfi(i,e.m11*t.m11+e.m12*t.m21,e.m11*t.m12+e.m12*t.m22,e.m21*t.m11+e.m22*t.m21,e.m21*t.m12+e.m22*t.m22,e.offsetX*t.m11+e.offsetY*t.m21+t.offsetX,e.offsetX*t.m12+e.offsetY*t.m22+t.offsetY),i.m21||i.m12?i.type=efi.Unknown:((i.m11&&1!==i.m11||i.m22&&1!==i.m22)&&(i.type=efi.Scaling),(i.offsetX||i.offsetY)&&(i.type|=efi.Translation),(i.type&(efi.Translation|efi.Scaling))===efi.Identity&&(i.type=efi.Identity),i.type=efi.Scaling|efi.Translation),cfi(e,i),e.type=i.type}else{var i=e.offsetX,r=e.offsetY;e.offsetX=i*t.m11+r*t.m21+t.offsetX,e.offsetY=i*t.m12+r*t.m22+t.offsetY,n===efi.Unknown?e.type=efi.Unknown:e.type=efi.Translation|efi.Scaling}}function pfi(e,t,i,n,o,r,s){e.m11=t,e.m12=i,e.m21=n,e.m22=o,e.offsetX=r,e.offsetY=s}function cfi(e,t){e.m11=t.m11,e.m12=t.m12,e.m21=t.m21,e.m22=t.m22,e.offsetX=t.offsetX,e.offsetY=t.offsetY,e.type=t.type}function ufi(e){if(e)switch(e.type){case"Linear":return Dfi;case"Radial":return Pfi;default:return Dfi}return Dfi}gfi=function(e,t){return(gfi=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])}))(e,t)};var gfi,mfi,qOt=function(e,t){function i(){this.constructor=e}gfi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},XOt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},ffi=function(e,t,i,n){this.left=e,this.right=t,this.top=i,this.bottom=n},ZOt=(qOt(yfi,mfi=n),XOt([e(0)],yfi.prototype,"left",void 0),XOt([e(0)],yfi.prototype,"right",void 0),XOt([e(0)],yfi.prototype,"top",void 0),XOt([e(0)],yfi.prototype,"bottom",void 0),yfi);function yfi(){return null!==mfi&&mfi.apply(this,arguments)||this}qOt(bfi,vfi=n),XOt([e(45)],bfi.prototype,"angle",void 0),XOt([e(5)],bfi.prototype,"distance",void 0),XOt([e(.7)],bfi.prototype,"opacity",void 0),XOt([e("lightgrey")],bfi.prototype,"color",void 0);var vfi,tNt=bfi;function bfi(){return null!==vfi&&vfi.apply(this,arguments)||this}qOt(Sfi,wfi=n),Sfi.prototype.getClassName=function(){return"Stop"},XOt([e("")],Sfi.prototype,"color",void 0),XOt([e(0)],Sfi.prototype,"offset",void 0),XOt([e(1)],Sfi.prototype,"opacity",void 0);var wfi,Cfi=Sfi;function Sfi(){return null!==wfi&&wfi.apply(this,arguments)||this}qOt(xfi,Afi=n),XOt([kt([],Cfi)],xfi.prototype,"stops",void 0),XOt([e("None")],xfi.prototype,"type",void 0),XOt([e("")],xfi.prototype,"id",void 0);var Afi,oNt=xfi;function xfi(){return null!==Afi&&Afi.apply(this,arguments)||this}qOt(Tfi,Ifi=oNt),XOt([e(0)],Tfi.prototype,"x1",void 0),XOt([e(0)],Tfi.prototype,"x2",void 0),XOt([e(0)],Tfi.prototype,"y1",void 0),XOt([e(0)],Tfi.prototype,"y2",void 0),XOt([e(0)],Tfi.prototype,"cx",void 0),XOt([e(0)],Tfi.prototype,"cy",void 0),XOt([e(0)],Tfi.prototype,"fx",void 0),XOt([e(0)],Tfi.prototype,"fy",void 0),XOt([e(50)],Tfi.prototype,"r",void 0);var Ifi,aNt=Tfi;function Tfi(){return null!==Ifi&&Ifi.apply(this,arguments)||this}qOt(Mfi,Efi=oNt),XOt([e(0)],Mfi.prototype,"x1",void 0),XOt([e(0)],Mfi.prototype,"x2",void 0),XOt([e(0)],Mfi.prototype,"y1",void 0),XOt([e(0)],Mfi.prototype,"y2",void 0);var Efi,Dfi=Mfi;function Mfi(){return null!==Efi&&Efi.apply(this,arguments)||this}qOt(Bfi,kfi=oNt),XOt([e(0)],Bfi.prototype,"cx",void 0),XOt([e(0)],Bfi.prototype,"cy",void 0),XOt([e(0)],Bfi.prototype,"fx",void 0),XOt([e(0)],Bfi.prototype,"fy",void 0),XOt([e(50)],Bfi.prototype,"r",void 0);var kfi,Pfi=Bfi;function Bfi(){return null!==kfi&&kfi.apply(this,arguments)||this}qOt(Lfi,Ffi=n),XOt([e("white")],Lfi.prototype,"fill",void 0),XOt([e("black")],Lfi.prototype,"strokeColor",void 0),XOt([e("")],Lfi.prototype,"strokeDashArray",void 0),XOt([e(1)],Lfi.prototype,"strokeWidth",void 0),XOt([e(1)],Lfi.prototype,"opacity",void 0),XOt([Mt(ufi)],Lfi.prototype,"gradient",void 0);var Ffi,XNt=Lfi;function Lfi(){return null!==Ffi&&Ffi.apply(this,arguments)||this}qOt(Nfi,Rfi=XNt),XOt([e("transparent")],Nfi.prototype,"fill",void 0);var Rfi,Ofi=Nfi;function Nfi(){return null!==Rfi&&Rfi.apply(this,arguments)||this}qOt(_fi,Vfi=XNt),XOt([e("black")],_fi.prototype,"color",void 0),XOt([e("Arial")],_fi.prototype,"fontFamily",void 0),XOt([e(12)],_fi.prototype,"fontSize",void 0),XOt([e(!1)],_fi.prototype,"italic",void 0),XOt([e(!1)],_fi.prototype,"bold",void 0),XOt([e("CollapseSpace")],_fi.prototype,"whiteSpace",void 0),XOt([e("WrapWithOverflow")],_fi.prototype,"textWrapping",void 0),XOt([e("Center")],_fi.prototype,"textAlign",void 0),XOt([e("None")],_fi.prototype,"textDecoration",void 0),XOt([e("Wrap")],_fi.prototype,"textOverflow",void 0),XOt([e("transparent")],_fi.prototype,"fill",void 0);var Vfi,ZNt=_fi;function _fi(){return null!==Vfi&&Vfi.apply(this,arguments)||this}qOt(cyi,Hfi=n),XOt([e("white")],cyi.prototype,"fill",void 0),XOt([e("Wrap")],cyi.prototype,"textOverflow",void 0),XOt([e(1)],cyi.prototype,"strokeWidth",void 0),XOt([Mt(ufi)],cyi.prototype,"gradient",void 0),XOt([e(1)],cyi.prototype,"opacity",void 0),XOt([e(!1)],cyi.prototype,"italic",void 0),XOt([e("")],cyi.prototype,"strokeDashArray",void 0),XOt([e("black")],cyi.prototype,"color",void 0),XOt([e(12)],cyi.prototype,"fontSize",void 0),XOt([e("Arial")],cyi.prototype,"fontFamily",void 0),XOt([e("CollapseSpace")],cyi.prototype,"whiteSpace",void 0),XOt([e("Center")],cyi.prototype,"textAlign",void 0),XOt([e("None")],cyi.prototype,"textDecoration",void 0),XOt([e(!1)],cyi.prototype,"bold",void 0),XOt([e("black")],cyi.prototype,"strokeColor",void 0),XOt([e("WrapWithOverflow")],cyi.prototype,"textWrapping",void 0);var Hfi,zfi,jfi,Wfi,Qfi,Ufi,qfi,Gfi,Yfi,Xfi,Kfi,Jfi,Zfi,$fi,eyi,tyi,iyi,nyi,oyi,ryi,syi,ayi,lyi,hyi,dyi,pyi,t2t=cyi;function cyi(){return null!==Hfi&&Hfi.apply(this,arguments)||this}(B2t=zfi=zfi||{})[B2t.Default=0]="Default",B2t[B2t.expandNode=2]="expandNode",B2t[B2t.interaction=4]="interaction",B2t[B2t.GroupingInProgress=8]="GroupingInProgress",B2t[B2t.GroupClipboardInProcess=16]="GroupClipboardInProcess",B2t[B2t.ClearObject=32]="ClearObject",(V2t=jfi=jfi||{})[V2t.Horizontal=1]="Horizontal",V2t[V2t.Vertical=2]="Vertical",V2t[V2t.Both=3]="Both",V2t[V2t.None=0]="None",(W2t=Wfi=Wfi||{})[W2t.Visible=1]="Visible",W2t[W2t.Hidden=2]="Hidden",W2t[W2t.Hover=4]="Hover",W2t[W2t.Connect=8]="Connect",(Xet=Qfi=Qfi||{})[Xet.None=0]="None",Xet[Xet.ShowHorizontalLines=1]="ShowHorizontalLines",Xet[Xet.ShowVerticalLines=2]="ShowVerticalLines",Xet[Xet.ShowLines=3]="ShowLines",Xet[Xet.SnapToHorizontalLines=4]="SnapToHorizontalLines",Xet[Xet.SnapToVerticalLines=8]="SnapToVerticalLines",Xet[Xet.SnapToLines=12]="SnapToLines",Xet[Xet.SnapToObject=16]="SnapToObject",Xet[Xet.All=31]="All",(e_=Ufi=Ufi||{})[e_.None=1]="None",e_[e_.ConnectorSourceThumb=2]="ConnectorSourceThumb",e_[e_.ConnectorTargetThumb=4]="ConnectorTargetThumb",e_[e_.ResizeSouthEast=8]="ResizeSouthEast",e_[e_.ResizeSouthWest=16]="ResizeSouthWest",e_[e_.ResizeNorthEast=32]="ResizeNorthEast",e_[e_.ResizeNorthWest=64]="ResizeNorthWest",e_[e_.ResizeEast=128]="ResizeEast",e_[e_.ResizeWest=256]="ResizeWest",e_[e_.ResizeSouth=512]="ResizeSouth",e_[e_.ResizeNorth=1024]="ResizeNorth",e_[e_.Rotate=2048]="Rotate",e_[e_.UserHandle=4096]="UserHandle",e_[e_.ToolTip=8192]="ToolTip",e_[e_.ResizeAll=2046]="ResizeAll",e_[e_.All=16382]="All",(Qg=qfi=qfi||{}).SamePoint="SamePoint",Qg.DifferentPoint="DifferentPoint",($H=Gfi=Gfi||{}).Linear="Linear",$H.Nonlinear="Nonlinear",(dLi=Yfi=Yfi||{})[dLi.None=1]="None",dLi[dLi.Select=2]="Select",dLi[dLi.Delete=4]="Delete",dLi[dLi.Drag=8]="Drag",dLi[dLi.DragSourceEnd=16]="DragSourceEnd",dLi[dLi.DragTargetEnd=32]="DragTargetEnd",dLi[dLi.DragSegmentThumb=64]="DragSegmentThumb",dLi[dLi.AllowDrop=128]="AllowDrop",dLi[dLi.Bridging=256]="Bridging",dLi[dLi.BridgeObstacle=512]="BridgeObstacle",dLi[dLi.InheritBridging=1024]="InheritBridging",dLi[dLi.PointerEvents=2048]="PointerEvents",dLi[dLi.Tooltip=4096]="Tooltip",dLi[dLi.InheritTooltip=8192]="InheritTooltip",dLi[dLi.Interaction=4218]="Interaction",dLi[dLi.ReadOnly=16384]="ReadOnly",dLi[dLi.LineRouting=32768]="LineRouting",dLi[dLi.InheritLineRouting=65536]="InheritLineRouting",dLi[dLi.ConnectToNearByNode=131072]="ConnectToNearByNode",dLi[dLi.ConnectToNearByPort=262144]="ConnectToNearByPort",dLi[dLi.ConnectToNearByElement=393216]="ConnectToNearByElement",dLi[dLi.InheritSegmentThumbShape=524288]="InheritSegmentThumbShape",dLi[dLi.InheritSegmentThumbSize=1048576]="InheritSegmentThumbSize",dLi[dLi.Default=2043454]="Default",(v4=Xfi=Xfi||{})[v4.ReadOnly=2]="ReadOnly",v4[v4.InheritReadOnly=4]="InheritReadOnly",v4[v4.Select=8]="Select",v4[v4.Drag=16]="Drag",v4[v4.Resize=32]="Resize",v4[v4.Rotate=64]="Rotate",v4[v4.Tooltip=128]="Tooltip",v4[v4.Interaction=120]="Interaction",v4[v4.None=0]="None",(hft=Kfi=Kfi||{})[hft.None=0]="None",hft[hft.Select=2]="Select",hft[hft.Drag=4]="Drag",hft[hft.Rotate=8]="Rotate",hft[hft.Shadow=16]="Shadow",hft[hft.PointerEvents=32]="PointerEvents",hft[hft.Delete=64]="Delete",hft[hft.InConnect=128]="InConnect",hft[hft.OutConnect=256]="OutConnect",hft[hft.Individual=512]="Individual",hft[hft.Expandable=1024]="Expandable",hft[hft.AllowDrop=2048]="AllowDrop",hft[hft.Inherit=78]="Inherit",hft[hft.ResizeNorthEast=4096]="ResizeNorthEast",hft[hft.ResizeEast=8192]="ResizeEast",hft[hft.ResizeSouthEast=16384]="ResizeSouthEast",hft[hft.ResizeSouth=32768]="ResizeSouth",hft[hft.ResizeSouthWest=65536]="ResizeSouthWest",hft[hft.ResizeWest=131072]="ResizeWest",hft[hft.ResizeNorthWest=262144]="ResizeNorthWest",hft[hft.ResizeNorth=524288]="ResizeNorth",hft[hft.Resize=1044480]="Resize",hft[hft.AspectRatio=1048576]="AspectRatio",hft[hft.Tooltip=2097152]="Tooltip",hft[hft.InheritTooltip=4194304]="InheritTooltip",hft[hft.ReadOnly=8388608]="ReadOnly",hft[hft.HideThumbs=16777216]="HideThumbs",hft[hft.AllowMovingOutsideLane=33554432]="AllowMovingOutsideLane",hft[hft.Default=5240814]="Default",(NVt=Jfi=Jfi||{})[NVt.None=0]="None",NVt[NVt.ElementIsPort=2]="ElementIsPort",NVt[NVt.ElementIsGroup=4]="ElementIsGroup",NVt[NVt.HorizontalLaneHeader=8]="HorizontalLaneHeader",(iz=Zfi=Zfi||{})[iz.Rotate=2]="Rotate",iz[iz.ConnectorSource=4]="ConnectorSource",iz[iz.ConnectorTarget=8]="ConnectorTarget",iz[iz.ResizeNorthEast=16]="ResizeNorthEast",iz[iz.ResizeEast=32]="ResizeEast",iz[iz.ResizeSouthEast=64]="ResizeSouthEast",iz[iz.ResizeSouth=128]="ResizeSouth",iz[iz.ResizeSouthWest=256]="ResizeSouthWest",iz[iz.ResizeWest=512]="ResizeWest",iz[iz.ResizeNorthWest=1024]="ResizeNorthWest",iz[iz.ResizeNorth=2048]="ResizeNorth",iz[iz.Default=4094]="Default",(m4=$fi=$fi||{})[m4.None=1]="None",m4[m4.Bridging=2]="Bridging",m4[m4.UndoRedo=4]="UndoRedo",m4[m4.Tooltip=8]="Tooltip",m4[m4.UserInteraction=16]="UserInteraction",m4[m4.ApiUpdate=32]="ApiUpdate",m4[m4.PageEditable=48]="PageEditable",m4[m4.Zoom=64]="Zoom",m4[m4.PanX=128]="PanX",m4[m4.PanY=256]="PanY",m4[m4.Pan=384]="Pan",m4[m4.ZoomTextEdit=512]="ZoomTextEdit",m4[m4.Virtualization=1024]="Virtualization",m4[m4.LineRouting=2048]="LineRouting",m4[m4.AvoidLineOverlapping=4096]="AvoidLineOverlapping",m4[m4.Default=500]="Default",(Fm=eyi=eyi||{})[Fm.None=0]="None",Fm[Fm.SingleSelect=1]="SingleSelect",Fm[Fm.MultipleSelect=2]="MultipleSelect",Fm[Fm.ZoomPan=4]="ZoomPan",Fm[Fm.DrawOnce=8]="DrawOnce",Fm[Fm.ContinuousDraw=16]="ContinuousDraw",Fm[Fm.Default=3]="Default",(KH=tyi=tyi||{})[KH.Self=1]="Self",KH[KH.Parent=2]="Parent",(o2t=iyi=iyi||{})[o2t.Canvas=0]="Canvas",o2t[o2t.Svg=1]="Svg",(a2t=nyi=nyi||{})[a2t.None=0]="None",a2t[a2t.Control=1]="Control",a2t[a2t.Meta=1]="Meta",a2t[a2t.Alt=2]="Alt",a2t[a2t.Shift=4]="Shift",(Qmt=oyi=oyi||{})[Qmt.None=null]="None",Qmt[Qmt.Number0=0]="Number0",Qmt[Qmt.Number1=1]="Number1",Qmt[Qmt.Number2=2]="Number2",Qmt[Qmt.Number3=3]="Number3",Qmt[Qmt.Number4=4]="Number4",Qmt[Qmt.Number5=5]="Number5",Qmt[Qmt.Number6=6]="Number6",Qmt[Qmt.Number7=7]="Number7",Qmt[Qmt.Number8=8]="Number8",Qmt[Qmt.Number9=9]="Number9",Qmt[Qmt.A=65]="A",Qmt[Qmt.B=66]="B",Qmt[Qmt.C=67]="C",Qmt[Qmt.D=68]="D",Qmt[Qmt.E=69]="E",Qmt[Qmt.F=70]="F",Qmt[Qmt.G=71]="G",Qmt[Qmt.H=72]="H",Qmt[Qmt.I=73]="I",Qmt[Qmt.J=74]="J",Qmt[Qmt.K=75]="K",Qmt[Qmt.L=76]="L",Qmt[Qmt.M=77]="M",Qmt[Qmt.N=78]="N",Qmt[Qmt.O=79]="O",Qmt[Qmt.P=80]="P",Qmt[Qmt.Q=81]="Q",Qmt[Qmt.R=82]="R",Qmt[Qmt.S=83]="S",Qmt[Qmt.T=84]="T",Qmt[Qmt.U=85]="U",Qmt[Qmt.V=86]="V",Qmt[Qmt.W=87]="W",Qmt[Qmt.X=88]="X",Qmt[Qmt.Y=89]="Y",Qmt[Qmt.Z=90]="Z",Qmt[Qmt.Left=37]="Left",Qmt[Qmt.Up=38]="Up",Qmt[Qmt.Right=39]="Right",Qmt[Qmt.Down=40]="Down",Qmt[Qmt.Escape=27]="Escape",Qmt[Qmt.Space=32]="Space",Qmt[Qmt.PageUp=33]="PageUp",Qmt[Qmt.PageDown=34]="PageDown",Qmt[Qmt.End=35]="End",Qmt[Qmt.Home=36]="Home",Qmt[Qmt.Delete=46]="Delete",Qmt[Qmt.Tab=9]="Tab",Qmt[Qmt.Enter=13]="Enter",Qmt[Qmt.BackSpace=8]="BackSpace",Qmt[Qmt.F1=112]="F1",Qmt[Qmt.F2=113]="F2",Qmt[Qmt.F3=114]="F3",Qmt[Qmt.F4=115]="F4",Qmt[Qmt.F5=116]="F5",Qmt[Qmt.F6=117]="F6",Qmt[Qmt.F7=118]="F7",Qmt[Qmt.F8=119]="F8",Qmt[Qmt.F9=120]="F9",Qmt[Qmt.F10=121]="F10",Qmt[Qmt.F11=122]="F11",Qmt[Qmt.F12=123]="F12",Qmt[Qmt.Star=56]="Star",Qmt[Qmt.Plus=187]="Plus",Qmt[Qmt.Minus=189]="Minus",Qmt[Qmt.BracketLeft=219]="BracketLeft",Qmt[Qmt.BracketRight=221]="BracketRight",(ost=ryi=ryi||{})[ost.Render=2]="Render",ost[ost.PublicMethod=4]="PublicMethod",ost[ost.ToolAction=8]="ToolAction",ost[ost.UndoRedo=16]="UndoRedo",ost[ost.TextEdit=32]="TextEdit",ost[ost.Group=64]="Group",ost[ost.Clear=128]="Clear",ost[ost.PreventClearSelection=256]="PreventClearSelection",ost[ost.Interactions=512]="Interactions",ost[ost.PreventHistory=1024]="PreventHistory",ost[ost.PreventIconsUpdate=2048]="PreventIconsUpdate",ost[ost.PreventCollectionChangeOnDragOver=4096]="PreventCollectionChangeOnDragOver",ost[ost.PreventZIndexOnDragging=8192]="PreventZIndexOnDragging",ost[ost.isGroupDragging=16384]="isGroupDragging",ost[ost.DragUsingMouse=32768]="DragUsingMouse",ost[ost.DecoratorPropertyChange=65536]="DecoratorPropertyChange",ost[ost.PreventLaneContainerUpdate=131072]="PreventLaneContainerUpdate",(jee=syi=syi||{})[jee.None=2]="None",jee[jee.DrawSelectorBorder=4]="DrawSelectorBorder",jee[jee.PreventRenderSelector=8]="PreventRenderSelector",(f2t=ayi=ayi||{})[f2t.None=0]="None",f2t[f2t.PreventDrag=2]="PreventDrag",f2t[f2t.PreventScale=4]="PreventScale",f2t[f2t.PreventDataInit=8]="PreventDataInit",f2t[f2t.hScrollbarMoved=16]="hScrollbarMoved",f2t[f2t.vScrollbarMoved=32]="vScrollbarMoved",f2t[f2t.AnimationClick=64]="AnimationClick",f2t[f2t.EnableGroupAction=128]="EnableGroupAction",f2t[f2t.PanInProgress=256]="PanInProgress",f2t[f2t.OverViewAction=512]="OverViewAction",(b2t=lyi=lyi||{})[b2t.None=0]="None",b2t[b2t.PropertyChange=1024]="PropertyChange",b2t[b2t.Interaction=2048]="Interaction",(S2t=hyi=hyi||{})[S2t.Zero=0]="Zero",S2t[S2t.One=1]="One",S2t[S2t.Two=2]="Two",S2t[S2t.Three=3]="Three",S2t[S2t.Four=4]="Four",S2t[S2t.Five=5]="Five",(I2t=dyi=dyi||{})[I2t.collectionChange=0]="collectionChange",I2t[I2t.rotateChange=1]="rotateChange",I2t[I2t.positionChange=2]="positionChange",I2t[I2t.propertyChange=3]="propertyChange",I2t[I2t.selectionChange=4]="selectionChange",I2t[I2t.sizeChange=5]="sizeChange",I2t[I2t.drop=6]="drop",I2t[I2t.sourcePointChange=7]="sourcePointChange",I2t[I2t.targetPointChange=8]="targetPointChange",I2t[I2t.connectionChange=9]="connectionChange",I2t[I2t.animationComplete=10]="animationComplete",I2t[I2t.click=11]="click",I2t[I2t.doubleClick=12]="doubleClick",I2t[I2t.scrollChange=13]="scrollChange",I2t[I2t.dragEnter=14]="dragEnter",I2t[I2t.dragLeave=15]="dragLeave",I2t[I2t.dragOver=16]="dragOver",I2t[I2t.textEdit=17]="textEdit",I2t[I2t.paletteSelectionChange=18]="paletteSelectionChange",I2t[I2t.historyChange=19]="historyChange",I2t[I2t.mouseEnter=20]="mouseEnter",I2t[I2t.mouseLeave=21]="mouseLeave",I2t[I2t.mouseOver=22]="mouseOver",I2t[I2t.expandStateChange=23]="expandStateChange",I2t[I2t.segmentCollectionChange=24]="segmentCollectionChange",I2t[I2t.commandExecute=25]="commandExecute",I2t[I2t.historyStateChange=26]="historyStateChange",I2t[I2t.onUserHandleMouseDown=27]="onUserHandleMouseDown",I2t[I2t.onUserHandleMouseUp=28]="onUserHandleMouseUp",I2t[I2t.onUserHandleMouseEnter=29]="onUserHandleMouseEnter",I2t[I2t.onUserHandleMouseLeave=30]="onUserHandleMouseLeave",I2t[I2t.onImageLoad=31]="onImageLoad",I2t[I2t.onDoBindingInit=32]="onDoBindingInit",I2t[I2t.keyUp=33]="keyUp",I2t[I2t.keyDown=34]="keyDown",I2t[I2t.fixedUserHandleClick=35]="fixedUserHandleClick",I2t[I2t.elementDraw=36]="elementDraw",I2t[I2t.mouseWheel=37]="mouseWheel",I2t[I2t.segmentChange=38]="segmentChange",I2t[I2t.onFixedUserHandleMouseDown=39]="onFixedUserHandleMouseDown",I2t[I2t.onFixedUserHandleMouseUp=40]="onFixedUserHandleMouseUp",I2t[I2t.onFixedUserHandleMouseEnter=41]="onFixedUserHandleMouseEnter",I2t[I2t.onFixedUserHandleMouseLeave=42]="onFixedUserHandleMouseLeave",I2t[I2t.loaded=43]="loaded",I2t[I2t.layoutUpdated=44]="layoutUpdated",(D2t=pyi=pyi||{})[D2t.None=1]="None",D2t[D2t.Drag=2]="Drag",D2t[D2t.Draw=4]="Draw",D2t[D2t.InConnect=8]="InConnect",D2t[D2t.OutConnect=16]="OutConnect",D2t[D2t.ToolTip=32]="ToolTip",D2t[D2t.InheritTooltip=64]="InheritTooltip",D2t[D2t.Default=24]="Default";var uyi,gyi,myi="contextMenuClick",fyi="contextMenuOpen",yyi="contextMenuBeforeItemRender",vyi=((Bft=uyi=uyi||{})[Bft.None=1]="None",Bft[Bft.Source=2]="Source",Bft[Bft.Target=4]="Target",Bft[Bft.Intermediate=8]="Intermediate",Bft[Bft.All=14]="All",(d=gyi=gyi||{})[d.None=0]="None",d[d.SymmetricAngle=2]="SymmetricAngle",d[d.SymmetricDistance=4]="SymmetricDistance",d[d.Default=6]="Default",byi.prototype.setOffsetWithRespectToBounds=function(e,t,i){this.unitMode=i,this.position={x:e,y:t}},byi.prototype.getAbsolutePosition=function(e){if(void 0!==this.position)return"Absolute"===this.unitMode?this.position:{x:this.position.x*e.width,y:this.position.y*e.height}},Object.defineProperty(byi.prototype,"outerBounds",{get:function(){return this.floatingBounds||this.bounds},set:function(e){this.floatingBounds=e},enumerable:!0,configurable:!0}),byi.prototype.measure=function(e,t,i){var n=void 0!==this.width?this.width:(e.width||0)-this.margin.left-this.margin.right,o=void 0!==this.height?this.height:(e.height||0)-this.margin.top-this.margin.bottom;return this.id&&0===o&&this.elementActions&Jfi.HorizontalLaneHeader&&(o=this.actualSize.height),this.desiredSize=new Omi(n,o),this.isCalculateDesiredSize&&(this.desiredSize=this.validateDesiredSize(this.desiredSize,e)),this.desiredSize},byi.prototype.arrange=function(e){return this.actualSize=e,this.updateBounds(),this.actualSize},byi.prototype.updateBounds=function(){this.bounds=ETi(this)},byi.prototype.validateDesiredSize=function(e,t){return!this.isRectElement||this.width||this.minWidth||this.maxWidth||(e.width=50),!this.isRectElement||this.height||this.minHeight||this.maxHeight||(e.height=50),(void 0===e||void 0!==this.width&&void 0!==this.height)&&((e=e||new Omi).width=void 0===this.width?(t.width||0)-this.margin.left-this.margin.right:this.width,e.height=void 0===this.height?(t.height||0)-this.margin.top-this.margin.bottom:this.height),void 0!==this.minWidth&&(e.width=Math.max(e.width,this.minWidth)),void 0!==this.minHeight&&(e.height=Math.max(e.height,this.minHeight)),void 0!==this.maxWidth&&0!==this.maxWidth&&(e.width=Math.min(e.width,this.maxWidth)),void 0!==this.maxHeight&&0!==this.maxHeight&&(e.height=Math.min(e.height,this.maxHeight)),e},byi);function byi(){this.pivot={x:.5,y:.5},this.isDirt=!0,this.isExport=!1,this.exportScaleValue={x:0,y:0},this.exportScaleOffset={x:0,y:0},this.canApplyStyle=!0,this.visible=!0,this.offsetX=0,this.offsetY=0,this.cornerRadius=0,this.minHeight=void 0,this.minWidth=void 0,this.maxWidth=void 0,this.maxHeight=void 0,this.width=void 0,this.height=void 0,this.rotateAngle=0,this.margin={left:0,right:0,top:0,bottom:0},this.connectionDirection="Auto",this.horizontalAlignment="Auto",this.verticalAlignment="Auto",this.flip=jfi.None,this.flipMode="All",this.relativeMode="Point",this.transform=tyi.Self|tyi.Parent,this.style={fill:"white",strokeColor:"black",opacity:1,strokeWidth:1},this.desiredSize=new Omi,this.actualSize=new Omi,this.parentTransform=0,this.preventContainer=!1,this.isSvgRender=!1,this.bounds=new tfi(0,0,0,0),this.shadow=null,this.description="",this.staticSize=!1,this.shapeType="",this.isRectElement=!1,this.isCalculateDesiredSize=!0,this.flipOffset={x:0,y:0},this.elementActions=Jfi.None,this.inversedAlignment=!0,this.position=void 0,this.unitMode=void 0,this.float=!1,this.floatingBounds=void 0}wyi=function(e,t){return(wyi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}wyi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ayi,Cyi=vyi),Ayi.prototype.hasChildren=function(){return void 0!==this.children&&0<this.children.length},Ayi.prototype.measure=function(e,t,i){var n,o=this.desiredBounds=void 0;if(this.hasChildren()){for(var r,s=0;s<this.children.length;s++){"Stretch"!==(n=this.children[parseInt(s.toString(),10)]).horizontalAlignment||e.width||(e.width=n.bounds.width),"Stretch"!==n.verticalAlignment||e.height||(e.height=n.bounds.height);var a="Stretch"===n.horizontalAlignment||"Stretch"===n.verticalAlignment;(this.measureChildren||a||n instanceof Ayi&&void 0!==n.measureChildren)&&n.measure(e,t,i),a=this.GetChildrenBounds(n),"Stretch"!==n.horizontalAlignment&&"Stretch"!==n.verticalAlignment?void 0===this.desiredBounds?this.desiredBounds=a:this.desiredBounds.uniteRect(a):!this.actualSize||this.actualSize.width||this.actualSize.height||n.preventContainer||"Stretch"!==n.horizontalAlignment||"Stretch"!==n.verticalAlignment||(void 0===this.desiredBounds?this.desiredBounds=n.bounds:this.desiredBounds.uniteRect(n.bounds))}void 0!==this.desiredBounds&&0!==this.rotateAngle&&(r={x:this.desiredBounds.x+this.desiredBounds.width*this.pivot.x,y:this.desiredBounds.y+this.desiredBounds.height*this.pivot.y},r=HTi(this.rotateAngle,void 0,void 0,r),this.desiredBounds.x=r.x-this.desiredBounds.width*this.pivot.x,this.desiredBounds.y=r.y-this.desiredBounds.height*this.pivot.y),void 0!==this.desiredBounds&&(this.desiredBounds.width+=this.padding.left+this.padding.right,this.desiredBounds.height+=this.padding.top+this.padding.bottom,this.desiredBounds.x-=this.padding.left,this.desiredBounds.y-=this.padding.top),this.desiredBounds&&(o=new Omi(this.desiredBounds.width,this.desiredBounds.height))}return o=this.validateDesiredSize(o,e),this.stretchChildren(o),this.desiredSize=o},Ayi.prototype.arrange=function(e){var t=this.desiredBounds;if(t){this.offsetX,this.offsetY;if(this.offsetX=t.x+t.width*this.pivot.x,this.offsetY=t.y+t.height*this.pivot.y,this.hasChildren())for(var i=0;i<this.children.length;i++){var n,o=!1;"Stretch"===(n=this.children[parseInt(i.toString(),10)]).horizontalAlignment&&(n.offsetX=this.offsetX,n.parentTransform=this.parentTransform+this.rotateAngle,this.flip&&this.elementActions&Jfi.ElementIsGroup&&(n.parentTransform=this.flip===jfi.Horizontal||this.flip===jfi.Vertical?-n.parentTransform:n.parentTransform),o=!0),"Stretch"===n.verticalAlignment&&(n.offsetY=this.offsetY,n.parentTransform=this.parentTransform+this.rotateAngle,o=!0),(o||this.measureChildren||n instanceof Ayi&&void 0!==n.measureChildren)&&n.arrange(n.desiredSize),0===i?(o=n.outerBounds,this.outerBounds=new tfi(o.x,o.y,o.width,o.height)):this.outerBounds.uniteRect(n.outerBounds)}}return this.actualSize=e,this.updateBounds(),this.prevRotateAngle=this.rotateAngle,e},Ayi.prototype.stretchChildren=function(e){if(this.hasChildren())for(var t=0,i=this.children;t<i.length;t++){var n=i[t];"Stretch"!==n.horizontalAlignment&&void 0!==n.desiredSize.width||(n.desiredSize.width=e.width-n.margin.left-n.margin.right),"Stretch"!==n.verticalAlignment&&void 0!==n.desiredSize.height||(n.desiredSize.height=e.height-n.margin.top-n.margin.bottom),n instanceof Ayi&&n.stretchChildren(n.desiredSize)}},Ayi.prototype.applyPadding=function(e){e.width+=this.padding.left+this.padding.right,e.height+=this.padding.top+this.padding.bottom},Ayi.prototype.findChildOffsetFromCenter=function(e,t){var i=zTi({x:t.x-e.desiredSize.width/2,y:t.y-e.desiredSize.height/2},e),i=HTi(e.rotateAngle,t.x,t.y,i);i=HTi(this.rotateAngle+this.parentTransform,this.offsetX,this.offsetY,i),e.offsetX=i.x,e.offsetY=i.y},Ayi.prototype.GetChildrenBounds=function(e){var t=e.desiredSize.clone(),i=(e.rotateAngle,this.rotateAngle,e.offsetX),n=e.offsetY,i=i-t.width*e.pivot.x,n=n-t.height*e.pivot.y,o=i+t.width,t=n+t.height,r={x:i,y:n},n={x:o,y:n},i={x:i,y:t},o={x:o,y:t},r=HTi(e.rotateAngle,e.offsetX,e.offsetY,r),n=HTi(e.rotateAngle,e.offsetX,e.offsetY,n),i=HTi(e.rotateAngle,e.offsetX,e.offsetY,i),o=HTi(e.rotateAngle,e.offsetX,e.offsetY,o);return 0!==this.rotateAngle&&(r=HTi(-this.rotateAngle,void 0,void 0,r),n=HTi(-this.rotateAngle,void 0,void 0,n),i=HTi(-this.rotateAngle,void 0,void 0,i),o=HTi(-this.rotateAngle,void 0,void 0,o)),tfi.toBounds([r,n,i,o])};var wyi,Cyi,Syi=Ayi;function Ayi(){var e=null!==Cyi&&Cyi.apply(this,arguments)||this;return e.padding=new ffi(0,0,0,0),e.desiredBounds=void 0,e.measureChildren=!0,e.prevRotateAngle=0,e}xyi=function(e,t){return(xyi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}xyi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Eyi,Iyi=vyi),Object.defineProperty(Eyi.prototype,"content",{get:function(){return this.textContent},set:function(e){this.textContent!==e&&(this.textContent=e,this.isDirt=!0,this.doWrap=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(Eyi.prototype,"childNodes",{get:function(){return this.textNodes},set:function(e){this.textNodes=e},enumerable:!0,configurable:!0}),Object.defineProperty(Eyi.prototype,"wrapBounds",{get:function(){return this.textWrapBounds},set:function(e){this.textWrapBounds=e},enumerable:!0,configurable:!0}),Eyi.prototype.refreshTextElement=function(){this.isDirt=!0},Eyi.prototype.measure=function(e){var t=this.isDirt&&this.canMeasure?function(e,t,i){var n,o=new Omi(0,0),r=function(e,t){t={fill:e.style.fill,stroke:e.style.strokeColor,angle:e.rotateAngle+e.parentTransform,pivotX:e.pivot.x,pivotY:e.pivot.y,strokeWidth:e.style.strokeWidth,dashArray:e.style.strokeDashArray,opacity:e.style.opacity,shadow:e.shadow,gradient:e.style.gradient,visible:e.visible,id:e.id,description:e.description,width:t||e.actualSize.width,height:e.actualSize.height,x:e.offsetX-e.actualSize.width*e.pivot.x+.5,y:e.offsetY-e.actualSize.height*e.pivot.y+.5};return t.fontSize=e.style.fontSize,t.fontFamily=e.style.fontFamily,t.textOverflow=e.style.textOverflow,t.textDecoration=e.style.textDecoration,t.doWrap=e.doWrap,t.whiteSpace=VTi(e.style.whiteSpace,e.style.textWrapping),t.content=e.content,t.textWrapping=e.style.textWrapping,t.breakWord=LTi(e.style.textWrapping),t.textAlign=FTi(e.style.textAlign),t.color=e.style.color,t.italic=e.style.italic,t.bold=e.style.bold,t.dashArray="",t.strokeWidth=0,t.fill="",t}(e,t);e.childNodes=i=function(e,t,i){var n,o=[],r=0,s=t||e.content;if("nowrap"!==e.whiteSpace&&"pre"!==e.whiteSpace)if("breakall"===e.breakWord)for(n="",n+=s[0],r=0;r<s.length;r++){var a;(a=RTi(n,e))>=e.width&&0<n.length?(o[o.length]={text:n,x:0,dy:0,width:a},n=""):(-1<(n+=s[r+1]||"").indexOf("\n")&&(o[o.length]={text:n,x:0,dy:0,width:RTi(n,e)},n=""),a=RTi(n,e),Math.ceil(a)+2>=e.width&&0<n.length&&(o[o.length]={text:n,x:0,dy:0,width:a},n=""),r===s.length-1&&0<n.length&&(o[o.length]={text:n,x:0,dy:0,width:a},n=""))}else o=function(e,t,i){var n,o,r,s,a=[],l="",h=0,d=0,p="nowrap"!==e.whiteSpace,c=(t||e.content).split("\n");for(h=0;h<c.length;h++)for(n="NoWrap"!==e.textWrapping?c[parseInt(h.toString(),10)].split(" "):"NoWrap"===e.textWrapping?[c[parseInt(h.toString(),10)]]:c,d=0;d<n.length;d++){l+=((0!==d||1===n.length)&&p&&0<l.length?" ":"")+n[parseInt(d.toString(),10)];var u=RTi(o=n[d+1]?l+" "+n[d+1]:l,e);Math.floor(u)>(i||e.width)-2&&0<l.length?(a[a.length]={text:l,x:0,dy:0,width:o===l?u:l===s?r:RTi(l,e)},l=""):d===n.length-1&&(a[a.length]={text:l,x:0,dy:0,width:u},l=""),s=o,r=u}return a}(e,t,i);else o[o.length]={text:s,x:0,dy:0,width:RTi(s,e)};return o}(r,i,e.isLaneOrientation?t:void 0),e.wrapBounds=n=function(e,t){var i,n,o={x:0,width:0},r=0;for(r=0;r<t.length;r++)i=t[parseInt(r.toString(),10)].width,n=i,i="left"===e.textAlign||"justify"===e.textAlign?0:"center"===e.textAlign?i>e.width&&("Ellipsis"===e.textOverflow||"Clip"===e.textOverflow)?0:-i/2:"right"===e.textAlign?-i:1<t.length?0:-i/2,t[parseInt(r.toString(),10)].dy=1.2*e.fontSize,t[parseInt(r.toString(),10)].x=i,o.x=Math.min(o.x,i),o.width=Math.max(o.width,n);return o}(r,i),o.width=n.width,e.wrapBounds.width>=t&&"Wrap"!==r.textOverflow&&(o.width=t);return o.height=i.length*e.style.fontSize*1.2,o}(this,(this.style,this.content,this.isLaneOrientation?e.height:this.width||e.width)):this.desiredSize;return void 0===this.width||void 0===this.height?this.desiredSize=new Omi(t.width,t.height):this.desiredSize=new Omi(this.width,this.height),this.desiredSize=this.validateDesiredSize(this.desiredSize,e),this.desiredSize},Eyi.prototype.arrange=function(e){return e.width===this.actualSize.width&&e.height===this.actualSize.height&&!this.isDirt||(this.doWrap=!0),this.actualSize=e,this.updateBounds(),this.isDirt=!1,this.actualSize};var xyi,Iyi,Tyi=Eyi;function Eyi(){var e=Iyi.call(this)||this;return e.textContent="",e.canMeasure=!0,e.rotationReference="Parent",e.isLaneOrientation=!1,e.canConsiderBounds=!0,e.annotationVisibility="Visible",e.hyperlink={color:"blue"},e.doWrap=!0,e.textNodes=[],e.style={color:"black",fill:"transparent",strokeColor:"black",strokeWidth:1,fontFamily:"Arial",fontSize:12,whiteSpace:"CollapseSpace",textWrapping:"WrapWithOverflow",textAlign:"Center",italic:!1,bold:!1,textDecoration:"None",strokeDashArray:"",opacity:5,gradient:null,textOverflow:"Wrap"},e.style.fill="transparent",e.style.strokeColor="transparent",e}Dyi=function(e,t){return(Dyi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Dyi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Pyi,Myi=vyi),Object.defineProperty(Pyi.prototype,"data",{get:function(){return this.pathData},set:function(e){this.pathData!==e&&(this.pathData=e,this.isDirt=!0)},enumerable:!0,configurable:!0}),Pyi.prototype.getPoints=function(){for(var e=this,t=(this.pointTimer||(this.pointTimer=setTimeout(function(){e.points=null,e.pointTimer=null},200)),this.points=this.points||function(e){var t,i,n=[],o="measureElement";window[o].style.visibility="visible";var r=YIi(window[o].children[2])[0],s=(r.setAttributeNS(null,"d",e.data),e.absoluteBounds),e=JIi(e,s),a=(r.setAttributeNS(null,"d",e),r.getTotalLength()),s=dDi.prototype.getPathData(e);if(0===s.length){for(i=0;i<=a;i+=10)t=r.getPointAtLength(i),n.push({x:t.x,y:t.y});dDi.prototype.setPathData(e,n)}else n=s;return window[o].style.visibility="hidden",n}(this),this),i=this.points,n=[],o=t.offsetX-t.actualSize.width*t.pivot.x,r=t.offsetY-t.actualSize.height*t.pivot.y,s=0,a=i;s<a.length;s++){var l=a[s],h=void 0,d=o+l.x,p=r+l.y,c=o+t.actualSize.width-l.x,u=r+t.actualSize.height-l.y;switch(t.flip){case jfi.Both:h={x:c,y:u};break;case jfi.Horizontal:h={x:c,y:p};break;case jfi.Vertical:h={x:d,y:u};break;default:h={x:d,y:p}}var l=void 0,g=t.rotateAngle+t.parentTransform;g&&afi(l=ofi(),g,t.offsetX,t.offsetY),l&&(h=rfi(l,h)),n.push(h)}return n},Pyi.prototype.measure=function(e){return this.staticSize&&void 0!==this.width&&void 0!==this.height?this.absoluteBounds=new tfi(this.offsetX-this.width*this.pivot.x,this.offsetY-this.height*this.pivot.y,this.width,this.height):(!this.isDirt||!this.transformPath&&void 0!==this.width&&void 0!==this.height||this.absoluteBounds&&0!==this.absoluteBounds.height)&&!this.canMeasurePath||(this.absoluteBounds=XIi(this.data||"")),void 0===this.width?this.desiredSize=new Omi(this.absoluteBounds.width,this.height||this.absoluteBounds.height):void 0===this.height?this.desiredSize=new Omi(this.width||this.absoluteBounds.width,this.absoluteBounds.height):this.desiredSize=new Omi(this.width,this.height),this.desiredSize=this.validateDesiredSize(this.desiredSize,e),this.canMeasurePath=!1,this.desiredSize},Pyi.prototype.arrange=function(e){return!this.isDirt&&this.actualSize.width===e.width&&this.actualSize.height===e.height||(this.isDirt=!0,this.absolutePath=this.updatePath(this.data,this.absoluteBounds,e),this.staticSize)||(this.points=null),this.actualSize=this.desiredSize,this.updateBounds(),this.isDirt=!1,this.actualSize},Pyi.prototype.updatePath=function(e,t,i){var n=!1,o="",r=-t.x,s=-t.y;return i.width===t.width&&i.height===t.height||(r=i.width/Number(t.width||1),s=i.height/Number(t.height||1),n=!0),i=Jmi(jmi(e)),o=(n||this.isDirt)&&this.transformPath?Ymi(i,r,s,n,t.x,t.y,0,0):Zmi(i),n=!1,o};var Dyi,Myi,kyi=Pyi;function Pyi(){var e=Myi.call(this)||this;return e.pathData="",e.transformPath=!0,e.absolutePath="",e.canMeasurePath=!1,e.absoluteBounds=new tfi,e}Byi=function(e,t){return(Byi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Byi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ryi,Fyi=vyi),Object.defineProperty(Ryi.prototype,"source",{get:function(){return this.imageSource},set:function(e){this.imageSource=e,this.isDirt=!0},enumerable:!0,configurable:!0}),Ryi.prototype.measure=function(e,t,i){var n,o,r,s,a;return this.isDirt&&("Stretch"!==this.stretch||void 0===this.width&&void 0===this.height)&&(this.contentSize=(n=this.source,o=this.contentSize,r=t,s=i,t="measureElement",window[t].style.visibility="visible",(i=window[t].children[1]).setAttribute("src",n),i=i.getBoundingClientRect(),a=i.width,i=i.height,o=new Omi(a,i),window[t].style.visibility="hidden",(a=document.createElement("img")).setAttribute("src",n),wTi(a,{id:r+"sf-imageNode"}),a.style.display="none",document.body.appendChild(a),a.onload=function(e){e=e.currentTarget;s&&s(r,{width:e.width,height:e.height})},o),this.isDirt=!1),void 0!==this.width&&void 0!==this.height?(this.desiredSize=new Omi(this.width,this.height),this.contentSize=this.desiredSize):this.desiredSize=this.contentSize,this.desiredSize=this.validateDesiredSize(this.desiredSize,e),this.desiredSize},Ryi.prototype.arrange=function(e){return this.actualSize=new Omi(this.desiredSize.width,this.desiredSize.height),this.updateBounds(),this.actualSize};var Byi,Fyi,Lyi=Ryi;function Ryi(){var e=Fyi.call(this)||this;return e.imageSource="",e.imageScale="None",e.imageAlign="None",e.stretch="Stretch",e}Oyi=function(e,t){return(Oyi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}Oyi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(_yi,Nyi=Syi),_yi.prototype.measure=function(e,t,i){var n=void 0,o=void 0;if(this.hasChildren()){for(var r,s,a=0,l=this.children;a<l.length;a++){var h=l[a],d=(h instanceof Tyi?h.canMeasure&&(e.width=e.width||this.maxWidth||this.minWidth,h.measure(e)):h instanceof Tyi||h.measure(e,t,i),h.desiredSize.clone()),p=(d=0!==h.rotateAngle?_Ti(d,h.rotateAngle):d).width+h.margin.right,c=d.height+h.margin.bottom,p=new tfi(h.margin.left,h.margin.top,p,c);if(h.float)if(void 0!==h.getAbsolutePosition(d))continue;h instanceof Tyi&&!(h instanceof Tyi&&h.canConsiderBounds)||(void 0===o?o=p:o.uniteRect(p))}o&&(s=r=0,r=Math.max(o.left,0),s=Math.max(o.top,0),n=new Omi(o.width+r,o.height+s))}return n=Nyi.prototype.validateDesiredSize.call(this,n,e),Nyi.prototype.stretchChildren.call(this,n),n.width+=this.padding.left+this.padding.right,n.height+=this.padding.top+this.padding.bottom,this.desiredSize=n},_yi.prototype.arrange=function(e,t){if(this.outerBounds=new tfi,this.hasChildren())for(var i=this.offsetY-e.height*this.pivot.y+this.padding.top,n=this.offsetX-e.width*this.pivot.x+this.padding.left,o=0,r=this.children;o<r.length;o++){var s,a,l,h,d,p,c=r[o];0!=(c.transform&tyi.Parent)&&(c.parentTransform=this.parentTransform+this.rotateAngle,!(this.flip!==jfi.None||this.elementActions&Jfi.ElementIsGroup)||this.flip!==jfi.Horizontal&&this.flip!==jfi.Vertical||c.elementActions&Jfi.ElementIsPort||this.setParentTransform(c),s=c.desiredSize.clone(),a=void 0,l={x:0,y:0},h=n,d=i,"Point"===c.relativeMode&&void 0!==(p=c.getAbsolutePosition(e))&&(h+=p.x,d+=p.y),"Object"===c.relativeMode?(a=this.alignChildBasedOnParent(c,s,e,h,d),c.flip=this.flip):a=this.alignChildBasedOnaPoint(c,h,d),l={x:a.x+s.width/2,y:a.y+s.height/2},Nyi.prototype.findChildOffsetFromCenter.call(this,c,l)),!t||"Stretch"!==c.horizontalAlignment&&"Stretch"!==c.verticalAlignment?!(c instanceof Tyi&&c.canMeasure)&&c instanceof Tyi||(c.arrange(c.desiredSize),this.outerBounds.uniteRect(c.outerBounds)):c.arrange(e)}return this.actualSize=e,this.updateBounds(),this.outerBounds.uniteRect(this.bounds),e},_yi.prototype.setParentTransform=function(e){"All"===this.flipMode||e instanceof Lyi||!(e instanceof Lyi||e instanceof Tyi||e instanceof kyi)&&e instanceof vyi?0<e.parentTransform&&(e.parentTransform=-e.parentTransform):e instanceof Tyi&&void 0===e.position?e.parentTransform=-e.parentTransform:"None"===this.flipMode?!(e.elementActions&Jfi.ElementIsPort)&&e instanceof kyi&&0<e.parentTransform&&(e.parentTransform=-e.parentTransform):e instanceof kyi?0<e.parentTransform&&(e.parentTransform=-e.parentTransform):"LabelText"!==this.flipMode&&"LabelAndLabelText"!==this.flipMode&&"PortAndLabelText"!==this.flipMode||e instanceof Tyi&&0<e.parentTransform&&(e.parentTransform=-e.parentTransform)},_yi.prototype.alignChildBasedOnParent=function(e,t,i,n,o){switch(e.horizontalAlignment){case"Auto":case"Left":n+=e.margin.left;break;case"Right":n+=i.width-t.width-e.margin.right;break;case"Stretch":case"Center":n+=i.width/2-t.width/2}switch(e.verticalAlignment){case"Auto":case"Top":o+=e.margin.top;break;case"Bottom":o+=i.height-t.height-e.margin.bottom;break;case"Stretch":case"Center":o+=i.height/2-t.height/2}return{x:n,y:o}},_yi.prototype.alignChildBasedOnaPoint=function(e,t,i){switch(t+=e.margin.left-e.margin.right,i+=e.margin.top-e.margin.bottom,e.horizontalAlignment){case"Auto":case"Left":t=e.inversedAlignment?t:t-e.desiredSize.width;break;case"Stretch":case"Center":t-=e.desiredSize.width*e.pivot.x;break;case"Right":t=e.inversedAlignment?t-e.desiredSize.width:t}switch(e.verticalAlignment){case"Auto":case"Top":i=e.inversedAlignment?i:i-e.desiredSize.height;break;case"Stretch":case"Center":i-=e.desiredSize.height*e.pivot.y;break;case"Bottom":i=e.inversedAlignment?i-e.desiredSize.height:i}return{x:t,y:i}};var Oyi,Nyi,Vyi=_yi;function _yi(){var e=null!==Nyi&&Nyi.apply(this,arguments)||this;return e.measureChildren=void 0,e}function Hyi(e){return zyi[e.toString()]}var zyi={Rectangle:"M0,0 L50,0 L50,50 L0,50 z",Ellipse:"M80.5,12.5 C80.5,19.127417 62.59139,24.5 40.5,24.5 C18.40861,24.5 0.5,19.127417 0.5,12.5C0.5,5.872583 18.40861,0.5 40.5,0.5 C62.59139,0.5 80.5,5.872583 80.5,12.5 z",Hexagon:"M30,0 L60,0 L90,30 L60,60 L30,60 L0,30 L30,0 z",Parallelogram:"M30,0 L60,0 L45,30 L15,30 z",Triangle:"M45,0 L90,45 L0,45 L45,0 z",Plus:"M696.6084,158.2656 L674.8074,158.2656 L674.8074,136.4656 L658.4084,136.4656 L658.4084,158.2656 L636.6084,158.2656L636.6084,174.6646 L658.4084,174.6646 L658.4084,196.4656 L674.8074,196.4656 L674.8074,174.6646 L696.6084,174.6646L696.6084,158.2656 z",Star:"M540.3643,137.9336 L546.7973,159.7016 L570.3633,159.7296 L550.7723,171.9366 L558.9053,194.9966 L540.3643,179.4996L521.8223,194.9966 L529.9553,171.9366 L510.3633,159.7296 L533.9313,159.7016 L540.3643,137.9336 z",Pentagon:"M30,0 L60,30 L50,70 L10,70 L0,30 L30,0 z",Heptagon:"M223.7783,195.7134 L207.1303,174.8364 L213.0713,148.8034 L237.1303,137.2174 L261.1883,148.8034 L267.1303,174.8364L250.4813,195.7134 L223.7783,195.7134 z",Octagon:"M98.7319,196.4653 L81.1579,178.8923 L81.1579,154.0393 L98.7319,136.4653 L123.5849,136.4653L141.1579,154.0393 L141.1579,178.8923 L123.5849,196.4653 L98.7319,196.4653 z",Trapezoid:"M127.2842,291.4492 L95.0322,291.4492 L81.1582,256.3152 L141.1582,256.3152 L127.2842,291.4492 z",Decagon:"M657.3379,302.4141 L642.3369,291.5161 L636.6089,273.8821 L642.3369,256.2481 L657.3379,245.3511 L675.8789,245.3511L690.8789,256.2481 L696.6089,273.8821L690.8789,291.5161 L675.8789,302.4141 L657.3379,302.4141 z",RightTriangle:"M836.293,292.9238 L776.293,292.9238 L776.293,254.8408 L836.293,292.9238 z",Cylinder:"M 542.802,362.009C 542.802,368.452 525.341,373.676 503.802,373.676C 482.263,373.676 464.802,368.452 464.802,362.009L 464.802,466.484C 464.802,472.928 482.263,478.151 503.802,478.151C 525.341,478.151 542.802,472.928 542.802,466.484L 542.802,362.016C 542.802,368.459 525.341,373.534 503.802,373.534C 482.263,373.534 464.802,368.31 464.802,361.867L 464.802,362.016C 464.802,355.572 482.263,350.349 503.802,350.349C 525.341,350.349 542.802,355.572 542.802,362.016",Diamond:"M397.784,287.875 L369.5,316.159 L341.216,287.875 L369.5,259.591 L397.784,287.875 z"};jyi=function(e,t){return(jyi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}jyi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Uyi,Wyi=vyi),Object.defineProperty(Uyi.prototype,"content",{get:function(){return this.data},set:function(e){this.data=e,this.canReset||(this.canReset=!0,this.template=yTi(this,!1),this.canReset=!1,this.isDirt=!0)},enumerable:!0,configurable:!0}),Uyi.prototype.measure=function(e){var t,i,n,o,r,s;return this.isDirt&&(n=this.template,o="measureElement",window[o].style.visibility="visible",(t=window[o].children[2]).appendChild(n),s=n.getBoundingClientRect(),i=t.getBoundingClientRect(),(r=s).x=s.left-i.left,r.y=s.top-i.top,t.removeChild(n),window[o].style.visibility="hidden",s=r,this.contentSize=new Omi,this.contentSize.width=s.width,this.contentSize.height=s.height,i=s.x,t=s.y,this.templatePosition={x:i,y:t},this.isDirt=!1),void 0===this.width||void 0===this.height?(n=this.template,o="measureElement",window[o].style.visibility="visible",(r=window[o].children[2]).appendChild(n),s=r.getBoundingClientRect(),r.removeChild(n),window[o].style.visibility="hidden",this.desiredSize=new Omi(s.width,s.height)):this.desiredSize=new Omi(this.width,this.height),this.desiredSize=this.validateDesiredSize(this.desiredSize,e),this.desiredSize},Uyi.prototype.arrange=function(e){return this.actualSize=new Omi(this.desiredSize.width,this.desiredSize.height),this.updateBounds(),this.actualSize};var jyi,Wyi,Qyi=Uyi;function Uyi(e,t){var i=Wyi.call(this)||this;return i.data="",i.nodeId="",i.diagramId="",i.scale="Stretch",i.diagramId=t,i.nodeId=e,i}qyi=function(e,t){return(qyi=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])}))(e,t)};var qyi,Gyi,TH=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},O2t=(function(e,t){function i(){this.constructor=e}qyi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Yyi,Gyi=n),TH([e("")],Yyi.prototype,"content",void 0),TH([e("TopLeft")],Yyi.prototype,"position",void 0),TH([e("Mouse")],Yyi.prototype,"relativeMode",void 0),TH([e(!0)],Yyi.prototype,"showTipPointer",void 0),TH([e("auto")],Yyi.prototype,"width",void 0),TH([e("auto")],Yyi.prototype,"height",void 0),TH([e("Auto")],Yyi.prototype,"openOn",void 0),TH([e()],Yyi.prototype,"animation",void 0),TH([e(!1)],Yyi.prototype,"isSticky",void 0),Yyi);function Yyi(){return null!==Gyi&&Gyi.apply(this,arguments)||this}function Xyi(e){var t=new NS,t=$yi(e.tooltip,t),t=new NS(t);return t.beforeCollision=Jyi,t.beforeOpen=Kyi,t.cssClass="e-diagram-tooltip",t.opensOn="custom",t.appendTo("#"+e.element.id),t.close(),t}function Kyi(e){""!==this.content&&void 0!==this.content||(e.element.style.display="none")}function Jyi(e){e.collidedPosition&&e.collidedPosition!==this.position&&(e.element.style.display="none")}function Zyi(e,t){var i=e.tooltipObject;return $yi((t||e).tooltip,i),i}function $yi(e,t){return e.content?(t.content=e.content,"string"==typeof e.content&&(t.content=ao(function(){return e.content})),t.position=e.position,t.showTipPointer=e.showTipPointer,t.width=e.width,t.height=e.height,e.animation?t.animation=e.animation:t.animation={close:{effect:"None"}}):t.close(),t}e0i=function(e,t){return(e0i=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])}))(e,t)};var e0i,t0i,W$e=function(e,t){function i(){this.constructor=e}e0i(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},i0=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},i0i=(W$e(n0i,t0i=n),i0([e("")],n0i.prototype,"id",void 0),i0([e("Center")],n0i.prototype,"horizontalAlignment",void 0),i0([e("Center")],n0i.prototype,"verticalAlignment",void 0),i0([t({},ZOt)],n0i.prototype,"margin",void 0),i0([e(12)],n0i.prototype,"width",void 0),i0([e(12)],n0i.prototype,"height",void 0),i0([t({},XNt)],n0i.prototype,"style",void 0),i0([e("Square")],n0i.prototype,"shape",void 0),i0([e("Auto")],n0i.prototype,"connectionDirection",void 0),i0([e(Wfi.Connect)],n0i.prototype,"visibility",void 0),i0([e("")],n0i.prototype,"pathData",void 0),i0([e(pyi.Default)],n0i.prototype,"constraints",void 0),i0([e()],n0i.prototype,"addInfo",void 0),i0([e()],n0i.prototype,"outEdges",void 0),i0([e()],n0i.prototype,"inEdges",void 0),i0([t({},O2t)],n0i.prototype,"tooltip",void 0),n0i);function n0i(e,t,i,n){e=t0i.call(this,e,t,i,n)||this;return e.inEdges=[],e.outEdges=[],e}W$e(s0i,o0i=i0i),s0i.prototype.getClassName=function(){return"PointPort"},i0([t({x:.5,y:.5},Hmi)],s0i.prototype,"offset",void 0);var o0i,r0i=s0i;function s0i(e,t,i,n){return o0i.call(this,e,t,i,n)||this}W$e(h0i,a0i=i0i),h0i.prototype.getClassName=function(){return"PathPort"},i0([e(.5)],h0i.prototype,"offset",void 0),i0([t({x:0,y:0},Hmi)],h0i.prototype,"displacement",void 0),i0([e("Center")],h0i.prototype,"alignment",void 0);var a0i,l0i=h0i;function h0i(e,t,i,n){return a0i.call(this,e,t,i,n)||this}d0i=function(e,t){return(d0i=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])}))(e,t)};var d0i,p0i,_k=function(e,t){function i(){this.constructor=e}d0i(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},jk=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Yk=(_k(c0i,p0i=n),jk([e("blue")],c0i.prototype,"color",void 0),jk([e("")],c0i.prototype,"content",void 0),jk([e("")],c0i.prototype,"link",void 0),jk([e("None")],c0i.prototype,"textDecoration",void 0),jk([e("NewTab")],c0i.prototype,"hyperlinkOpenState",void 0),c0i);function c0i(){return null!==p0i&&p0i.apply(this,arguments)||this}_k(g0i,u0i=n),jk([e("")],g0i.prototype,"content",void 0),jk([e(void 0)],g0i.prototype,"template",void 0),jk([e("String")],g0i.prototype,"annotationType",void 0),jk([e(!0)],g0i.prototype,"visibility",void 0),jk([e(Xfi.InheritReadOnly)],g0i.prototype,"constraints",void 0),jk([t(void 0,Yk)],g0i.prototype,"hyperlink",void 0),jk([e("")],g0i.prototype,"id",void 0),jk([e()],g0i.prototype,"width",void 0),jk([e()],g0i.prototype,"height",void 0),jk([e(0)],g0i.prototype,"rotateAngle",void 0),jk([e("Parent")],g0i.prototype,"rotationReference",void 0),jk([t({strokeWidth:0,strokeColor:"transparent",fill:"transparent"},ZNt)],g0i.prototype,"style",void 0),jk([e("Center")],g0i.prototype,"horizontalAlignment",void 0),jk([e("Center")],g0i.prototype,"verticalAlignment",void 0),jk([t({},ZOt)],g0i.prototype,"margin",void 0),jk([t({top:void 0,bottom:void 0,left:void 0,right:void 0},ZOt)],g0i.prototype,"dragLimit",void 0),jk([e("Shape")],g0i.prototype,"type",void 0),jk([t({},O2t)],g0i.prototype,"tooltip",void 0),jk([e()],g0i.prototype,"addInfo",void 0);var u0i,Jk=g0i;function g0i(e,t,i,n){t=u0i.call(this,e,t,i,n)||this;return i.id||(e.parentObj&&e.parentObj.propName&&"phases"===e.parentObj.propName?t.id=e.parentObj.id:t.id=xTi()),t}_k(y0i,m0i=Jk),y0i.prototype.getClassName=function(){return"ShapeAnnotation"},jk([t({x:.5,y:.5},Hmi)],y0i.prototype,"offset",void 0);var m0i,f0i=y0i;function y0i(e,t,i,n){return m0i.call(this,e,t,i,n)||this}_k(w0i,v0i=Jk),w0i.prototype.getClassName=function(){return"PathAnnotation"},jk([e(.5)],w0i.prototype,"offset",void 0),jk([t({x:0,y:0},Hmi)],w0i.prototype,"displacement",void 0),jk([e("Center")],w0i.prototype,"alignment",void 0),jk([e(!1)],w0i.prototype,"segmentAngle",void 0);var v0i,b0i=w0i;function w0i(e,t,i,n){return v0i.call(this,e,t,i,n)||this}function C0i(e){return T0i[e.toString()]}function S0i(e,t){return"Custom"===e?t.pathData:E0i[""+e]}function A0i(e){return D0i[""+e]}function x0i(e){return M0i[""+e]}function I0i(e){var t;switch(e.shape){case"Minus":t="M0,50 L100,50";break;case"Plus":t="M0,-50 L0,50 M-50,0 L50,0";break;case"ArrowUp":t="M0,100 L50,0 L100,100 Z";break;case"ArrowDown":t="M0,0 L50,100 L100,0 Z";break;case"Path":t=e.pathData}return t}var T0i={X:"M14,14 L106,106 M106,14 L14,106",Circle:"M0,50 A50,50,0 1 1 100,50 A50,50,0 1 1 0,50 Z",Square:"M0,0 L10,0 L10,10 L0,10 z"},E0i={OpenArrow:"M15.9,23 L5,16 L15.9,9 L17,10.7 L8.7,16 L17,21.3Z",Square:"M0,0 L10,0 L10,10 L0,10 z",Fletch:"M14.8,10c0,0-3.5,6,0.2,12c0,0-2.5-6-10.9-6C4.1,16,11.3,16,14.8,10z",OpenFetch:"M6,17c-0.6,0-1-0.4-1-1s0.4-1,1-1c10.9,0,11-5,11-5c0-0.6,0.4-1,1-1s1,0.4,1,1C19,10.3,18.9,17,6,17C6,17,6,17,6,17z M18,23c-0.5,0-1-0.4-1-1c0-0.2-0.3-5-11-5c-0.6,0-1-0.5-1-1s0.4-1,1-1c0,0,0,0,0,0c12.9,0,13,6.7,13,7    C19,22.6,18.6,23,18,23z",IndentedArrow:"M17,10c0,0-4.5,5.5,0,12L5,16L17,10z",OutdentedArrow:"M14.6,10c0,0,5.4,6,0,12L5,16L14.6,10z",DoubleArrow:"M19,10 L19,22 L13,16Z M12,10 L12,22 L6,16Z",Arrow:"M15,10 L15,22 L5,16Z",Diamond:"M12,23l-7-7l7-7l6.9,7L12,23z",Circle:"M0,50 A50,50,0 1 1 100,50 A50,50,0 1 1 0,50 Z"},D0i={Square:"M0,0 L10,0 L10,10 L0,10 z",Rhombus:"M10,5 L5,10 L0,5 L5,0 L10,5 Z ",Rectangle:"M0,0 L15,0 L15,10 L0,10 z ",OpenArrow:"M15.9,23 L5,16 L15.9,9 L17,10.7 L8.7,16 L17,21.3Z",Fletch:"M9.82,0 C9.82,0,6.61,5,10,10 C10,10,7.71,5,0,5 C0,5,6.61,5,9.82,0 Z ",OpenFetch:"M0.71,5.71 C0.29,5.71,0,5.43,0,5 C0,4.57,0.29,4.29,0.71,4.29 C8.5,4.29,8.57,0.71,8.57,0.71 C8.57,0.29,8.86,0,9.29,0 C9.719999999999999,0,10,0.29,10,0.71 C10,0.93,9.93,5.71,0.71,5.71 C0.71,5.71,0.71,5.71,0.71,5.71 Z M9.29,10 C8.93,10,8.57,9.71,8.57,9.29 C8.57,9.14,8.36,5.71,0.71,5.71 C0.29,5.71,0,5.36,0,5 C0,4.64,0.29,4.29,0.71,4.29 C0.71,4.29,0.71,4.29,0.71,4.29 C9.93,4.29,10,9.07,10,9.29 C10,9.71,9.71,10,9.29,10 Z ",IndentedArrow:"M10,0 C10,0,6.25,4.58,10,10 L0,5 L10,0 Z ",OutdentedArrow:"M8,0 C8,0,12.5,5,8,10 L0,5 L8,0 Z ",DoubleArrow:"M19,10 L19,22 L13,16Z M12,10 L12,22 L6,16Z",Arrow:"M15,10 L15,22 L5,16Z",Diamond:"M10,5 L5,10 L0,5 L5,0 L10,5 Z  ",Circle:"M10,5 C10,7.76,7.76,10,5,10 C2.24,10,0,7.76,0,5 C0,2.24,2.24,0,5,0 C7.76,0,10,2.24,10,5 Z ",Ellipse:"M15,5 C15,7.76,11.64,10,7.5,10 C3.36,10,0,7.76,0,5 C0,2.24,3.36,0,7.5,0 C11.64,0,15,2.24,15,5 Z  "},M0i={Square:"M0,0 L10,0 L10,10 L0,10 z",Rhombus:"M10,5 L5,10 L0,5 L5,0 L10,5 Z ",Rectangle:"M0,0 L15,0 L15,10 L0,10 z",OpenArrow:"M23,15.9 L16,5 L9,15.9 L10.7,17 L16,8.7 L21,17.3Z",Fletch:"M9.82,0 C9.82,0,6.61,5,10,10 C10,10,7.71,5,0,5 C0,5,6.61,5,9.82,0 Z ",OpenFetch:"M0.71,5.71 C0.29,5.71,0,5.43,0,5 C0,4.57,0.29,4.29,0.71,4.29 C8.5,4.29,8.57,0.71,8.57,0.71 C8.57,0.29,8.86,0,9.29,0 C9.719999999999999,0,10,0.29,10,0.71 C10,0.93,9.93,5.71,0.71,5.71 C0.71,5.71,0.71,5.71,0.71,5.71 Z M9.29,10 C8.93,10,8.57,9.71,8.57,9.29 C8.57,9.14,8.36,5.71,0.71,5.71 C0.29,5.71,0,5.36,0,5 C0,4.64,0.29,4.29,0.71,4.29 C0.71,4.29,0.71,4.29,0.71,4.29 C9.93,4.29,10,9.07,10,9.29 C10,9.71,9.71,10,9.29,10 Z ",IndentedArrow:"M10,0 C10,0,6.25,4.58,10,10 L0,5 L10,0 Z ",OutdentedArrow:"M8,0 C8,0,12.5,5,8,10 L0,5 L8,0 Z ",DoubleArrow:"M10,19 L22,19 L16,13Z M10,12 L22,12 L16,6Z",Arrow:"M10,15 L22,15 L16,5Z",Diamond:"M10,5 L5,10 L0,5 L5,0 L10,5 Z ",Circle:"M10,5 C10,7.76,7.76,10,5,10 C2.24,10,0,7.76,0,5 C0,2.24,2.24,0,5,0 C7.76,0,10,2.24,10,5 Z ",Ellipse:"M15,5 C15,7.76,11.64,10,7.5,10 C3.36,10,0,7.76,0,5 C0,2.24,3.36,0,7.5,0 C11.64,0,15,2.24,15,5 Z   "};function k0i(e){return P0i[e.toString()]}var P0i={Process:"M419.511,76.687L359.511,76.687L359.511,43.086L419.511,43.086z",Decision:"M 253.005,115.687L 200.567,146.071L 148.097,115.687L 200.534,85.304L 253.005,115.687 Z",Document:"M 60 31.9 c 0 0 -11 -7.7 -30 0 s -30 0 -30 0 V 0 h 60 V 31.9 Z",PreDefinedProcess:"M 0,0 L 50,0 L 50,50 L 0,50 Z  M 8.334,0 L 8.334,50 M 41.667,0 L 41.667,50",Terminator:"M 269.711,29.33C 269.71,44.061 257.77,56 243.04,56L 158.058,56C 143.33,56 131.39,44.061 131.39,29.33L 131.39,29.33C 131.391,14.6057 143.33,2.669 158.058,2.669L 243.044,2.669C 257.772,2.669 269.711,14.6057 269.711,29.333 Z",PaperTap:"M0.0009,17.2042 L0.0009,47.165 C0.001,47.165 14.403,53.5455 25.00,47.165 C35.599,40.7852 44.403,43.5087 50.00,47.165L50.001,17.2042 M50.001,32.7987 L50.001,2.8405 C50.001,2.8405 35.599,-3.5427 25.001,2.8405C14.403,9.2237 5.599,6.494 0.0009,2.8405 L0.0009,32.7987",DirectData:"M 132.62 0 L 17.38 0 C 7.78 0 0 13.43 0 30 C 0 46.57 7.78 60 17.38 60 L 132.62 60 M 132.62 0C 123.02 0 115.24 13.43 115.24 30 C 115.24 46.57 123.02 60 132.62 60 C 142.22 60 150 46.57 150 30 C 150 13.43 142.22 0 132.62 0 z ",SequentialData:"M0.0029,24.999 C0.0029,11.1922 10.433,0.0021 23.295,0.0021 C36.159,0.00216 46.585,11.1922 46.585,24.999C46.585,38.8057 36.159,49.9979 23.295,49.9979 C10.433,49.9979 0.0029,38.8057 0.0029,24.999 z M23.294,49.999 L50.002,49.999",Sort:"M50.001,24.9971 L25.001,49.9971 L0.00097,24.9971 L25.001,-0.00286865 L50.001,24.9971 z M0.000976562,24.9971 L50.001,24.9971",MultiDocument:"M43.6826,40 C44.8746,40.6183 45.8586,41.3502 46.8366,42.1122 L46.8366,4.74487 L3.09857,4.74487 L3.09857,10.9544 M46.837,35.143 C48.027,35.765 49.025,36.604 50.003,37.369 L50.003,0.002 L6.264,0.002 L6.264,4.744 M43.682,47.113 L43.682,10.765 L0.0025,10.7652 L0.0025,47.1132 C0.0025,47.1132 12.5846,53.6101 21.8426,47.1132 C31.1006,40.6163 38.792,43.393 43.6826,47.1132 z",Collate:"M50.001,0.0028 L25.001,25.0029 L0.00097,0.0028 L50.001,0.002 z M0.0009,50.002 L25.001,25.002L50.001,50.002 L0.0009,50.0029 z",SummingJunction:"M7.3252,42.6768 L42.6772,7.3247 M42.6768,42.6768 L7.3248,7.3247 M0.0009,25.001 C0.0009,11.193 11.197,0.0009 25.001,0.0009 C38.809,0.0009 50.001,11.193 50.001,25.001 C50.001,38.809 38.809,50.001 25.001,50.001 C11.197,50.00 0.0009,38.809 0.0009,25.00 z",Or:"M 0 50 L 100 50 M 50 100 L 50 0.0 M 0 50 C 0 22.384 22.392 0 50 0 C 77.616 0 100 22.384 100 50 C 100 77.616 77.616 100 50 100 C 22.392 100 0 77.616 0 50 Z",InternalStorage:"M 0 3.81946A 2.5,3.81946 0 0,1 2.5,0L 47.5 0A 2.5,3.81946 0 0,1 50,3.81946L 50 45.836A 2.5,3.819446 0 0,1 47.5,49.652778L 2.5 49.652778A 2.5,3.819446 0 0,1 0,45.8336L 0 3.819446ZM 0 11.45834L 50 11.4583334M 12.5 0L 12.5 49.652778",Extract:"M0,35 L30,0 L60,35 Z",ManualOperation:"M46.4,28.8 L14.8,28.8 L0,0 L60,0 Z",Merge:"M60,0 L30,35 L0,0 Z",OffPageReference:"M60,33.3 L30.1,39 L0,33.3 L0,0 L60,0 Z",SequentialAccessStorage:"M 60 30 C 60 13.4 46.6 0 30 0 S 0 13.4 0 30 s 13.4 30 30 30 h 28.6 v -6.5 h -9.9C 55.5 48 60 39.5 60 30 Z",Annotation:"M49.9984,50.0029 L-0.00271199,50.0029 L-0.00271199,0.00286865 L49.9984,0.00286865",Annotation2:"M49.9977,50.0029 L25.416,50.0029 L25.416,0.00286865 L49.9977,0.00286865 M25.4166,25.0029 L-0.00227869,25.0029",Data:"M 10 0 L 40 0 L 30 40 L 0 40 Z",Card:"M275,60 L400,60 L400,110 L260,110 L260,75 Z",Delay:"M0,0 L12.029,0 C14.212999,0 16,1.7869979 16,3.9709952 C16,6.1549926 14.212999,7.9409904 12.029,7.9409904 L0,7.9409904 z",Preparation:"M 1048.17 572 C 1051.06 568.86 1055.17 567.05 1059.5 567 L 1094.51 567 C 1098.84 567.05 1102.95 568.86 1105.84 572 L 1126.43 595 C 1127.01 596.28 1127.01 597.72 1126.43 599 L 1105.84 622 C 1102.95 625.14 1098.84 626.95 1094.51 627 L 1059.5 627 C 1055.17 626.95 1051.06 625.14 1048.17 622 L 1027.58 599 C 1027 597.72 1027 596.28 1027.58 595 L 1048.17 572 Z",Display:"M47.8809,19.2914 L32.7968,-0.00594145 L11.3902,-0.00594145 C7.93166,-0.00594145 0.00124586,11.187 0.00124586,24.9968C0.00124586,38.8032 7.93166,49.9962 11.3902,49.9962 L32.7968,49.99 L47.615,31.038 C47.615,31.0388 52.798,24.9968 47.880,19.2914 z",ManualInput:"M 912 732 L 1006.85 707 C 1008.2 707 1009.5 707.53 1010.46 708.46 C 1011.41 709.4 1011.95 710.67 1011.95 712 L 1011.95 762C 1012 764.41 1010.28 766.52 1007.87 767 L 917.1 767 C 915.75 767 914.45 766.47 913.49 765.54 C 912.54 764.6 912 763.33 912 762 L 912 732 Z",LoopLimit:"M 8 9 L 27 9 L 33 15 L 33 26 C 33 27 33 27 32 27 L 4 27 C 3 27 2 27 2 26 L 2 15 L 8 9 Z",StoredData:"M 5.55 0L 50 0A 1.5,30 0 0,1 50,0A 5.555,25 0 0,0 50,50A 1.5,30 0 0,1 50,50L 5.555 50A 5.55,25 0 0,1 5.555,0Z"};function B0i(e,t,i){var n="Straight"!==e.type&&e.sourceWrapper?e.sourceWrapper.corners.center:function(e){{var t,i;t=e.sourcePortWrapper?(t=e.sourcePortWrapper,t={x:t.offsetX,y:t.offsetY},t):e.sourceID&&e.sourceWrapper&&e.targetWrapper?(t=e.sourceWrapper.corners.center,i=e.targetWrapper.corners.center,$0i(e,e.sourceWrapper,t,i,!1)):e.sourcePoint}return t}(e),n=function(e,t,i,n,o){var r,s,a=e.sourceWrapper,l=e.targetWrapper,h=e.sourcePortWrapper,d=e.targetPortWrapper,p=[],c=X0i(e),t={corners:void 0,point:t,direction:void 0,margin:{left:5,right:5,bottom:5,top:5}},i={corners:void 0,point:i,direction:void 0,margin:{left:5,right:5,bottom:5,top:5}};void 0!==a&&void 0!==l&&(r=TTi(a),s=TTi(l),t.corners=a.corners,i.corners=l.corners);void 0!==h&&(g={x:h.offsetX,y:h.offsetY},"Left"===h.connectionDirection||"Top"===h.connectionDirection||"Bottom"===h.connectionDirection||"Right"===h.connectionDirection?t.direction=h.connectionDirection:t.direction=uvi(g,r,a.bounds));void 0!==d&&(g={x:d.offsetX,y:d.offsetY},"Left"===d.connectionDirection||"Right"===d.connectionDirection||"Bottom"===d.connectionDirection||"Top"===d.connectionDirection?i.direction=d.connectionDirection:i.direction=uvi(g,s,l.bounds));if("Bezier"===e.type&&!e.isBezierEditing&&0<e.segments.length)for(var u=e.segments.length-1;0<=u;)e.segments[parseInt(u.toString(),10)].isInternalSegment&&e.segments.pop(),u--;if(void 0!==a&&void 0!==l)return void 0!==t.direction&&void 0!==i.direction||(n?function(e,t,i){"LeftToRight"===i?(e.direction=e.direction||"Right",t.direction=t.direction||"Left"):"RightToLeft"===i?(e.direction=e.direction||"Left",t.direction=t.direction||"Right"):"TopToBottom"===i?(e.direction=e.direction||"Bottom",t.direction=t.direction||"Top"):"BottomToTop"===i&&(e.direction=e.direction||"Top",t.direction=t.direction||"Bottom")}(t,i,n):t.corners.top>i.corners.bottom&&Math.abs(t.corners.top-i.corners.bottom)>c?(t.direction=t.direction||"Top",i.direction=i.direction||"Bottom"):t.corners.bottom<i.corners.top&&Math.abs(t.corners.bottom-i.corners.top)>c?(t.direction=t.direction||"Bottom",i.direction=i.direction||"Top"):t.corners.right<i.corners.left&&Math.abs(t.corners.right-i.corners.left)>c||t.corners.right+c<i.corners.left||i.corners.right>=t.corners.left-c&&t.corners.left>i.corners.left?(t.direction=t.direction||"Right",i.direction=i.direction||"Left"):t.corners.left>i.corners.right&&Math.abs(t.corners.left-i.corners.right)>t.margin.left+t.margin.right||i.corners.right+c<t.corners.left||t.corners.right>=i.corners.left-c&&t.corners.left<i.corners.left?(t.direction=t.direction||"Left",i.direction=i.direction||"Right"):a.id!==l.id&&!r.equals(r,s)&&s.containsPoint(r.topCenter,t.margin.top)?(t.direction=t.direction||"Bottom",i.direction=i.direction||"Top"):(t.direction=t.direction||"Top",i.direction=i.direction||"Bottom")),function(e,t,i,n,o,r){var s,a=e.sourceWrapper,l=e.targetWrapper,h=e.sourcePortWrapper,d=e.targetPortWrapper,p=[],c=a.corners,u=l.corners,g=(u.center,{corners:c,point:n,direction:t,margin:{left:5,right:5,bottom:5,top:5}}),m={corners:u,point:o,direction:i,margin:{left:5,right:5,bottom:5,top:5}},n=H0i(a,c,e.sourceWrapper.bounds),t=H0i(l,u,e.targetWrapper.bounds),o=!1;e.sourceWrapper&&e.targetWrapper&&(o=function(e,t,i){for(var n=_0i(e,i.sourcePadding),o=_0i(t,i.targetPadding),r=0;r<n.length-1;r++)for(var s=n[parseInt(r.toString(),10)],a=0;a<o.length-1;a++){var l=o[parseInt(a.toString(),10)];if(SAi(s,l).enabled)return!0}return!1}(e.sourceWrapper,e.targetWrapper,e));if(void 0!==h){switch(g.point={x:h.offsetX,y:h.offsetY},g.direction){case"Bottom":case"Top":g.point.y=g.point.y;break;case"Left":case"Right":g.point.x=g.point.x}e.sourcePadding&&!o&&(d&&(m.point={x:d.offsetX,y:d.offsetY}),g.point=V0i(e,g,m,!1))}else"Orthogonal"===e.type||"Bezier"===e.type?(e.segments&&0<e.segments.length&&e.segments[0].direction&&(g.direction=e.segments[0].direction),g.point=J0i(n,g.direction),s=J0i(n,mvi(g.direction)),g.point=$0i(e,0,g.point,s,!1)):g.point=a.corners.center;if(void 0!==d){switch(m.point={x:d.offsetX,y:d.offsetY},m.direction){case"Bottom":case"Top":m.point.y=m.point.y;break;case"Left":case"Right":m.point.x=m.point.x}e.targetPadding&&!o&&(m.point=V0i(e,g,m,!0))}else"Orthogonal"===e.type||"Bezier"===e.type?(m.point=J0i(t,m.direction),s=J0i(t,mvi(m.direction)),m.point=$0i(e,0,m.point,s,!0)):m.point=l.corners.center;if("Orthogonal"!==e.type){var f,y=void 0,i=void 0;if("Bezier"===e.type&&(e.bezierSettings.allowSegmentsReset||0===e.segments.length||!Hmi.isEmptyPoint(e.segments[e.segments.length-1].point)))return p=Y0i(e,g,m,void 0,r),p=z0i(e,g,m);W0i(e),void 0===e.sourcePortWrapper&&(g.point=g.corners.center,e.segments&&0<e.segments.length&&(i=e.segments[0],y=Hmi.isEmptyPoint(i.point)?void 0:i),c=(void 0!==y?y:m).point,"Bezier"===e.type&&0<e.segments.length&&e.segments[0].vector1.angle&&e.segments[0].vector1.distance&&(f=Math.max(g.corners.width,g.corners.height),c=Hmi.transform(g.point,e.segments[0].vector1.angle,f/2)),g.point=o?e.sourceWrapper.bounds.center:$0i(e,0,g.point,c,!1)),void 0===e.targetPortWrapper&&(m.point=m.corners.center,e.segments&&1<e.segments.length&&(i=e.segments[e.segments.length-2],y=Hmi.isEmptyPoint(i.point)?void 0:i),u=(y||g).point,"Bezier"===e.type&&0<e.segments.length&&e.segments[e.segments.length-1].vector2.angle&&e.segments[e.segments.length-1].vector2.distance&&(f=Math.max(g.corners.width,g.corners.height),u=Hmi.transform(m.point,e.segments[0].vector2.angle,f/2)),m.point=o?e.targetWrapper.bounds.center:$0i(e,0,u,m.point,!0)),p=z0i(e,g,m)}else"Orthogonal"===e.type&&e.segments&&0<e.segments.length&&null!==e.segments[0].direction?p=function(e,t,i,n,o,r){var s,a,l,h;W0i(e);for(var d=0;d<e.segments.length;d++){var p,c,u;if(a=e.segments[parseInt(d.toString(),10)],n&&t.direction===mvi(a.direction)&&(a.direction=t.direction),0<d&&e.segments[d-1].direction===a.direction?d=Q0i(e,d,t):a.direction?t.point=F0i(t,e.segments[parseInt(d.toString(),10)]):(c=e.segments[d-1])&&c.points&&0<c.points.length&&(t.point=c.points[c.points.length-1]),d===e.segments.length-1)if(U0i(e,t),N0i(s=(void 0===o?function(e,t,i){var n;{var o;e.sourcePortWrapper&&(o={x:e.sourcePortWrapper.offsetX,y:e.sourcePortWrapper.offsetY},o=uvi(o,TTi(e.sourceWrapper),e.sourceWrapper.bounds))}G0i(e.targetWrapper,t,i,e);var r=j0i(i.direction,t.point,i.point);{var s,a;n=void 0===e.sourcePortWrapper||t.direction!==i.direction||("Top"!==t.direction&&"Bottom"!==t.direction||t.corners.center.x!==i.corners.center.x)&&("Left"!==t.direction&&"Right"!==t.direction||t.corners.center.y!==i.corners.center.y)?i.point.x>=t.corners.left&&i.point.x<=t.corners.right&&t.point.y>=t.corners.top&&t.point.y<=t.corners.bottom?(t.direction=i.point.y>t.point.y?"Bottom":"Top",s="Top"===t.direction?t.point.y-t.corners.top+20:t.corners.bottom-t.point.y+20,rvi(e,t,i,s)):e.sourcePortWrapper&&o===mvi(r)?(("Left"===o||"Right"===o)&&t.point.y>=t.corners.top&&t.point.y<=t.corners.bottom?(t.direction=i.point.y>t.point.y?"Bottom":"Top",a=t.corners.height/2+20):("Top"===o||"Bottom"===o)&&t.point.x>=t.corners.left&&t.point.x<=t.corners.right&&(t.direction=i.point.x>t.point.x?"Right":"Left",a=t.corners.width/2+20),t.direction&&a?rvi(e,t,i,a,!0):(t.direction=r,ovi(t,i))):!e.sourcePortWrapper||o!==i.direction||"Top"!==o&&"Bottom"!==o||t.corners.center.x!==i.corners.center.x?t.direction===i.direction&&(("Left"===t.direction||"Right"===t.direction)&&i.point.y>t.corners.top-20&&i.point.y<t.corners.bottom+20||("Top"===t.direction||"Bottom"===t.direction)&&i.point.x>t.corners.left-20&&i.point.x<t.corners.right+20)?(s=t.direction,t.direction=r,svi(t,i,s,n,20,!1)):(t.direction=r,ovi(t,i)):(t.direction=i.point.y>t.point.y?"Bottom":"Top",a="Bottom"===t.direction?t.corners.bottom-t.point.y+20:t.point.y-t.corners.top+20,rvi(e,t,i,a)):(t.direction=r,n=rvi(e,t,i,"Top"===r||"Bottom"===r?e.sourceWrapper.height/2+20:e.sourceWrapper.width/2+20),t.point=n[1],"Left"===r||"Right"===r?(i.direction=r,i.point="Left"===r?i.corners.middleLeft:i.corners.middleRight):G0i(e.targetWrapper,t,i,e),rvi(e,t,i))}return n}:R0i)(e,t,i),e),a.points=[],2<=s.length)for(l=0;l<s.length;l++)e.selectedSegmentIndex&&l===s.length-1&&2<s.length&&2<e.segments.length?(p={x:s[parseInt(l.toString(),10)].x,y:t.point.y},a.points=[],a.points.push(p),a.points.push(s[parseInt(l.toString(),10)]),c=e.segments[d-1],e.segments.length<4&&c.points.pop(),c.points=c.points.concat(a.points)):a.points.push(s[parseInt(l.toString(),10)]);else h=d;void 0===h||e.selectedSegmentIndex||(h===e.segments.length-1&&(e.segments[h-1].direction=null,e.segments[h-1].length=null),e.segments.splice(h,1)),n&&0===d&&(u=O0i(e,n,r))&&(t.point=u)}return q0i(e,[])}(e,g,m,h,d,a):(e.segments[0]||(y=new sSi(e,"segments",{type:"Orthogonal"},!0),e.segments.push(y)),e.segments[0].points=p=Y0i(e,g,m,void 0,r));return p}(e,t.direction,i.direction,t.point,i.point,o);W0i(e),(e.sourceWrapper||e.targetWrapper)&&function(e,t,i){var n=e.sourcePortWrapper,o=e.targetPortWrapper,r=e.sourceWrapper,s=t.point,a={left:0,right:0,top:0,bottom:0},l={x:0,y:0},h="Top";a=(r?(s=i.point,t):(r=e.targetWrapper,i)).margin;{var d;"Orthogonal"===e.type?e.segments&&0<e.segments.length&&e.sourceWrapper&&e.segments[0].direction?(t.direction=e.segments[0].direction,l=J0i(r.corners,t.direction),d=J0i(r.corners,mvi(t.direction)),l=$0i(e,0,l,d,!1)):(G0i(r,{corners:null,direction:null,point:s,margin:a},d={corners:null,direction:null,point:null,margin:null},e),l=d.point,h=d.direction):(a=void 0,e.segments&&1<e.segments.length&&(a=(r===e.sourceWrapper?e.segments[0]:e.segments[e.segments.length-2]).point),l=$0i(e,0,r.bounds.center,e.segments&&1<e.segments.length?a:s,r===e.targetWrapper))}r===e.sourceWrapper?(t.direction=t.direction||h,t.point=l,e.sourcePortWrapper&&(t.point={x:n.offsetX,y:n.offsetY},e.sourcePadding)&&(t.point=V0i(e,t,i,!1))):(i.direction=i.direction||h,i.point=l,e.targetPortWrapper&&(i.point={x:o.offsetX,y:o.offsetY},e.targetPadding)&&(i.point=V0i(e,t,i,!0)))}(e,t,i);{var g;"Straight"===e.type||"Bezier"===e.type?p=z0i(e,t,i):"Orthogonal"===e.type&&e.segments&&0<e.segments.length&&null!==e.segments[0].length&&null!==e.segments[0].direction?p=function(e,t,i,n,o,r,s){var a,l,h,d=[];if(W0i(e),0<e.segments.length){for(var p=0;p<e.segments.length;p++){var c,u,g=e.segments[parseInt(p.toString(),10)];if(0===p&&void 0!==e.sourcePortWrapper&&(c={x:r.offsetX,y:r.offsetY},c=uvi(c,TTi(n),n.bounds),g.direction===mvi(c))&&(g.direction=c),0<p&&e.segments[p-1].direction===g.direction?p=Q0i(e,p,t):(c=e.segments[p-1],t.point=g.direction?F0i(t,g):c.points[c.points.length-1]),p===e.segments.length-1&&(l=(s||o?e.targetWrapper&&void 0===e.targetPortWrapper?(U0i(e,t),function(e,t,i){i.corners=e.targetWrapper.corners,G0i(e.targetWrapper,t,i,e);var n,o=j0i(i.direction,t.point,i.point);n=t.direction!==i.direction||"Left"!==t.direction&&"Right"!==t.direction?(t.direction=o,ovi(t,i)):(t.direction=o,n=rvi(e,t,i,e.targetWrapper.width/2+20),t.point=n[1],G0i(e.targetWrapper,t,i,e),rvi(e,t,i));return n}):R0i:function(e,t,i){var n,o,r;{var s;t.corners=e.sourceWrapper?e.sourceWrapper.corners:void 0,e.sourcePortWrapper&&(s={x:e.sourcePortWrapper.offsetX,y:e.sourcePortWrapper.offsetY},s=uvi(s,TTi(e.sourceWrapper),e.sourceWrapper.bounds),!t.corners||"Bottom"!==t.direction&&"Top"!==t.direction?!t.corners||"Left"!==t.direction&&"Right"!==t.direction||i.point.y>t.corners.top&&i.point.y<t.corners.bottom&&(o=t.point.x>i.point.x?"Left":"Right"):i.point.x>t.corners.left&&i.point.x<t.corners.right&&(o=t.point.y>i.point.y?"Top":"Bottom"))}e.sourcePortWrapper&&s===mvi(o)?(("Left"===s||"Right"===s)&&t.point.y>=t.corners.top&&t.point.y<=t.corners.center.y&&i.point.y>=t.corners.top&&i.point.y<=t.corners.center.y?(t.direction="Top",r=t.point.y-t.corners.top+20):("Left"===s||"Right"===s)&&t.point.y>t.corners.center.y&&t.point.y<=t.corners.bottom&&i.point.y>t.corners.center.y&&i.point.y<=t.corners.bottom?(t.direction="Bottom",r=t.corners.bottom-t.point.y+20):("Top"===s||"Bottom"===s)&&t.point.x>=t.corners.left&&t.point.x<=t.corners.center.x&&i.point.x>=t.corners.left&&i.point.x<=t.corners.center.x?(t.direction="Left",r=t.point.x-t.corners.left+20):("Top"===s||"Bottom"===s)&&t.point.x<=t.corners.right&&t.point.x>t.corners.center.x&&i.point.x<=t.corners.right&&i.point.x<t.corners.center.x&&(t.direction="Right",r=t.corners.right-t.point.x+20),t.direction&&r&&(n=rvi(e,t,i,r,!0))):(t.direction=o||j0i(t.direction,t.point,i.point),n=ovi(t,i));return n})(e,t,i)))if(N0i(l,e),g.points=[],2<=l.length)for(a=0;a<l.length;a++)g.points.push(l[parseInt(a.toString(),10)]);else h=p;r&&0===p&&(u=O0i(e,r,n))&&(t.point=u)}void 0!==h&&(h===e.segments.length-1&&(e.segments[h-1].direction=null,e.segments[h-1].length=null),e.segments.splice(h,1)),d=q0i(e,d)}return d}(e,t,i,a,l,h,d):(g=void 0,t.direction?g=nvi(a.bounds,t,20):t.direction=i.direction?void 0!==e.targetPortWrapper?i.direction:mvi(i.direction):Hmi.direction(t.point,i.point),e.segments[0].points=p=rvi(e,t,i,g))}return p}(e,n,e.targetPoint,t,i);return evi(e,n[0],!1),evi(e,n[n.length-1],!0),n}function F0i(e,t){e.direction=t.direction,t.points=[],t.points.push(e.point);var i="Left"===t.direction||"Top"===t.direction?-t.length:t.length,n="Left"===t.direction||"Right"===t.direction?0:90,e=Z0i(e.point,i,n);return t.points.push(e),e}function L0i(e,t,i){var n;i.corners=e.targetWrapper.corners,"Left"!==t.direction&&"Right"!==t.direction?i.corners.center.y!==t.point.y||i.corners.left<=t.point.x&&t.point.x<=i.corners.right?i.corners.center.y===t.point.y&&"Bottom"===e.segments[e.segments.length-2].direction||i.corners.center.y>t.point.y&&t.point.y>=i.corners.top?(n="Top",r=t.point.y-i.corners.top+20):i.corners.center.y===t.point.y&&"Top"===e.segments[e.segments.length-2].direction||i.corners.center.y<t.point.y&&t.point.y<=i.corners.bottom?(n="Bottom",r=i.corners.bottom-t.point.y+20):void 0!==e.sourcePortWrapper&&void 0!==e.targetPortWrapper&&t.corners.top<=t.point.y&&t.point.y<=t.corners.bottom&&(n=t.direction,r=t.point.y>i.point.y?t.point.y-t.corners.top+20:t.corners.bottom-t.point.y+20):(n="Top",r=i.corners.height/2+20):i.corners.center.x!==t.point.x||i.corners.top<t.point.y&&t.point.y<=i.corners.bottom?i.corners.center.x===t.point.x&&"Right"===e.segments[e.segments.length-2].direction||i.corners.center.x>t.point.x&&t.point.x>=i.corners.left?(n="Left",r=t.point.x-i.corners.left+20):i.corners.center.x===t.point.x&&"Left"===e.segments[e.segments.length-2].direction||i.corners.center.x<=t.point.x&&t.point.x<=i.corners.right?(n="Right",r=i.corners.right-t.point.x+20):void 0!==e.sourcePortWrapper&&void 0!==e.targetPortWrapper&&t.corners.left<=t.point.x&&t.point.x<=t.corners.right&&(n=t.direction,r=t.point.x>i.point.x?t.point.x-t.corners.left+20:t.corners.right-t.point.x+20):(n="Left",r=i.corners.width/2+20);var o=t.point,r=(t.point=Z0i(t.point,"Left"===n||"Top"===n?-r:r,"Left"===n||"Right"===n?0:90),t.direction=Hmi.direction(t.point,i.point),void 0===e.sourcePortWrapper||void 0===e.targetPortWrapper||t.corners.center.x!==i.corners.center.x&&t.corners.center.y!==i.corners.center.y||(t.direction=i.direction),rvi(e,t,i));return r.splice(0,0,o),r}function R0i(e,t,i){i.corners=e.targetWrapper.corners;var n=function(e,t,i,n){var o=!1;switch(i.direction){case"Left":void 0!==e.sourcePortWrapper&&void 0!==e.targetPortWrapper&&"Right"===n&&t.point.x>i.point.x&&t.point.y>=t.corners.top&&t.point.y<=t.corners.bottom||("Bottom"===n&&t.point.y>i.point.y||"Top"===n&&t.point.y<i.point.y)&&t.point.x>=t.corners.left&&t.point.x<=t.corners.right?(t.direction="Right"===n?t.point.y>i.point.y?"Top":"Bottom":t.point.x<i.point.x?"Right":"Left",o=!0):t.point.x>i.point.x&&(t.point.y>i.point.y||t.point.y<i.point.y)&&!(i.corners.top>t.point.y&&i.corners.bottom<t.point.y)?t.direction="Left":t.point.x<i.point.x&&t.point.y>i.point.y||t.point.x>i.point.x&&t.point.y<=i.point.y&&i.corners.top<t.point.y&&i.corners.center.y>=t.point.y?t.direction="Top":t.point.x<i.point.x&&t.point.y<i.point.y||t.point.x>i.point.x&&t.point.y>i.point.y&&i.corners.bottom<t.point.y&&i.corners.center.y>t.point.y?t.direction="Bottom":t.point.y===i.point.y&&t.point.x<i.point.x&&(t.direction="Right");break;case"Right":void 0!==e.sourcePortWrapper&&void 0!==e.targetPortWrapper&&("Bottom"===n&&t.point.y>i.point.y||"Top"===n&&t.point.y<i.point.y)&&t.point.x>i.point.x&&t.point.x>=t.corners.left&&t.point.x<=t.corners.right?(t.direction=t.point.x>i.point.x?"Left":"Right",o=!0):void 0!==e.sourcePortWrapper&&void 0!==e.targetPortWrapper&&"Left"===n&&t.point.x<i.point.x&&t.point.y>=t.corners.top&&t.point.y<=t.corners.bottom?(t.direction=t.point.y>i.point.y?"Top":"Bottom",o=!0):t.point.x<i.point.x&&i.corners.top<=t.point.y&&i.corners.bottom>=t.point.y&&t.point.y===i.point.y||t.point.y>i.point.y&&t.point.x>i.point.x?t.direction="Top":t.point.y<i.point.y&&t.point.x>i.point.x?t.direction="Bottom":t.point.x<i.point.x&&(t.point.y>i.point.y||t.point.y<i.point.y)?t.direction="Right":t.point.y===i.point.y&&t.point.x>i.point.x&&(t.direction="Left");break;case"Top":void 0!==e.sourcePortWrapper&&void 0!==e.targetPortWrapper&&"Bottom"===n&&t.point.y>i.point.y&&t.point.x>=t.corners.left&&t.point.x<=t.corners.right||("Right"===n&&t.point.x>i.point.x||"Left"===n&&i.point.y>t.point.y&&i.point.x>t.point.x)&&t.point.y>=t.corners.top&&t.point.y<=t.corners.bottom?(t.direction="Bottom"===n?t.point.x>i.point.x?"Left":"Right":t.point.y<i.point.y?"Bottom":"Top",o=!0):t.point.x===i.point.x&&t.point.y<i.point.y?t.direction="Bottom":t.point.y>i.point.y&&t.point.x>i.corners.left&&t.point.x<i.corners.right?t.direction="Left":t.point.y>=i.point.y?t.direction="Top":t.point.y<i.point.y&&t.point.x>i.point.x?t.direction="Left":t.point.y<i.point.y&&t.point.x<i.point.x&&(t.direction="Right");break;case"Bottom":void 0!==e.sourcePortWrapper&&void 0!==e.targetPortWrapper&&(("Right"===n||"Left"===n&&i.point.x>t.point.x)&&t.point.y>i.point.y&&t.point.y>=t.corners.top&&t.point.y<=t.corners.bottom||"Top"===n&&t.point.y<i.point.y&&t.point.x>=t.corners.left&&t.point.x<=t.corners.right)?(t.direction="Right"===n||"Left"===n?t.point.y>i.point.y?"Top":"Bottom":t.point.x>i.point.x?"Left":"Right",o=!0):t.point.y<i.point.y&&t.point.x>i.corners.left&&i.corners.right>t.point.x?t.point.y<i.point.y&&t.point.x>i.corners.left&&i.corners.center.x>=t.point.x?t.direction="Left":t.point.y<i.point.y&&t.point.x<i.corners.right&&i.corners.center.x<t.point.x&&(t.direction="Right"):t.point.y>i.point.y&&t.point.x>i.point.x?t.direction="Left":t.point.y>i.point.y&&t.point.x<i.point.x?t.direction="Right":t.point.y<=i.point.y&&(t.point.x>i.point.x||i.point.x>t.point.x)&&(t.direction="Bottom")}return o}(e,t,i,o=void 0!==e.sourcePortWrapper?uvi({x:e.sourcePortWrapper.offsetX,y:e.sourcePortWrapper.offsetY},TTi(e.sourceWrapper),e.sourceWrapper.bounds):o),o=!e.selectedSegmentIndex&&void 0!==e.sourcePortWrapper&&void 0!==e.targetPortWrapper&&i.direction===mvi(o)&&(("Left"===i.direction&&t.point.x>i.point.x||"Right"===i.direction&&t.point.x<i.point.x)&&t.point.y>=t.corners.top&&t.point.y<=t.corners.bottom||"Bottom"===i.direction&&t.point.y<i.point.y&&t.point.x>=t.corners.left&&t.point.x<=t.corners.right)?L0i(e,t,i):e.selectedSegmentIndex||t.direction!==i.direction?!e.selectedSegmentIndex&&("Left"===i.direction&&t.point.x>i.point.x||"Right"===i.direction&&t.point.x<i.point.x)&&("Top"===t.direction||"Bottom"===t.direction)&&t.point.y<=i.point.y&&i.corners.top<=t.point.y&&i.corners.bottom>=t.point.y||"Top"===i.direction&&t.point.y>i.point.y||"Bottom"===i.direction&&t.point.y<i.point.y&&i.corners.left<=t.point.x&&i.corners.right>=t.point.x?e.selectedSegmentIndex?ovi(t,i):L0i(e,t,i):!e.selectedSegmentIndex&&void 0!==e.sourceWrapper&&void 0!==e.targetWrapper&&void 0!==e.targetPortWrapper&&("Left"===t.direction||"Right"===t.direction)&&t.point.y>=t.corners.top&&t.point.y<=t.corners.bottom&&("Top"===i.direction||"Bottom"===i.direction)&&i.corners.center.x===t.corners.center.x?(t.direction="Top"===i.direction?"Bottom":"Top",rvi(e,t,i,"Top"===i.direction?t.corners.bottom-t.point.y+20:t.point.y-t.corners.top+20)):!e.selectedSegmentIndex&&void 0!==e.sourceWrapper&&void 0!==e.targetWrapper&&void 0!==e.targetPortWrapper&&("Top"===t.direction||"Bottom"===t.direction)&&t.point.x>=t.corners.left&&t.point.x<=t.corners.right&&("Left"===i.direction||"Right"===i.direction)&&i.corners.center.y===t.corners.center.y?(t.direction="Left"===i.direction?"Right":"Left",rvi(e,t,i,"Left"===i.direction?t.corners.right-t.point.x+20:t.point.x-t.corners.left+20)):n?rvi(e,t,i,"Left"===t.direction||"Right"===t.direction?"Left"===t.direction?t.point.x-t.corners.left+20:t.corners.right-t.point.x+20:"Top"===t.direction?t.point.y-t.corners.top+20:t.corners.bottom-t.point.y+20):ovi(t,i):rvi(e,t,i);return o}function O0i(e,t,i){var n,o,r,s,a,l,t={x:t.offsetX,y:t.offsetY},h=TTi(i),t=uvi(t,h,i.bounds),i=e.segments[0];return i.direction!==t&&(e=t,t=h,n=(h=i).points[0],o=i.points[i.points.length-1],r=!1,(l=[]).push(n),n.y===o.y&&("Left"===e&&o.x<n.x||"Right"===e&&o.x>n.x)||n.x===o.x&&("Top"===e&&o.y<n.y||"Bottom"===e&&o.y>n.y)||("Top"===e||"Bottom"===e?"Top"===e&&o.y<n.y&&o.y>n.y-13||"Bottom"===e&&o.y>n.y&&o.y<n.y+13?(a="Top"===e?t.top-13:t.bottom+13,l.push({x:n.x,y:a}),l.push({x:n.x+(o.x-n.x)/2,y:a}),l.push({x:n.x+(o.x-n.x)/2,y:o.y})):13<Math.abs(n.x-o.x)&&("Top"===e&&o.y<n.y||"Bottom"===e&&o.y>n.y)?l.push({x:n.x,y:o.y}):(a="Top"===e?t.top-13:t.bottom+13,s=o.x<n.x?t.left-13:t.right+13,l.push({x:n.x,y:a}),l.push({x:o.x,y:a})):"Left"===e&&o.x<n.x&&o.x>n.x-13||"right"===e&&o.x>n.x&&o.x<n.x+13?(s="Left"===e?t.left-13:t.right+13,l.push({x:s,y:n.y}),l.push({x:s,y:n.y+(o.y-n.y)/2}),l.push({x:o.x,y:n.y+(o.y-n.y)/2})):13<Math.abs(n.y-o.y)&&("Left"===e&&o.x<n.x||"Right"===e&&o.x>n.x)?l.push({x:o.x,y:n.y}):(s="Left"===e?t.left-13:t.right+13,l.push({x:s,y:n.y}),l.push({x:s,y:o.y})),r&&(l.push(h.points[0]),l.reverse()),h.points=l),a=i.points[i.points.length-1],i.direction=Hmi.direction(i.points[i.points.length-2],i.points[i.points.length-1])),a}function N0i(e,t){var i=t.segments[t.segments.length-2],n=i.points[i.points.length-1];("Top"!==i.direction&&"Bottom"!==i.direction||n.x!==e[1].x)&&("Left"!==i.direction&&"Right"!==i.direction||n.y!==e[1].y)||(i.points[i.points.length-1]=e[1],n=Hmi.direction(i.points[0],i.points[i.points.length-1]),void 0!==t.sourceWrapper&&void 0===t.sourcePortWrapper&&n===mvi(i.direction)&&("Left"===i.direction||"Right"===i.direction?i.points[0].x="Right"===i.direction?i.points[0].x-t.sourceWrapper.corners.width:i.points[0].x+t.sourceWrapper.corners.width:i.points[0].y="Bottom"===i.direction?i.points[0].y-t.sourceWrapper.corners.height:i.points[0].y+t.sourceWrapper.corners.height),i.direction=n,i.length=Hmi.distancePoints(i.points[0],i.points[i.points.length-1]),e.splice(0,1))}function V0i(e,t,i,n){var o=e.sourcePortWrapper,r=e.targetPortWrapper,e=n?e.targetPadding:e.sourcePadding,r=n?r:o,o=new tfi(r.bounds.x-e,r.bounds.y-e,r.actualSize.width+2*e,r.actualSize.height+2*e),r=[o.topLeft,o.topRight,o.bottomRight,o.bottomLeft],e=(r[r.length]=r[0],{x1:t.point.x,y1:t.point.y,x2:i.point.x,y2:i.point.y}),o=(n?i:t).point;return tvi(e,r,0,o)||o}function _0i(e,t){var i=[],n=IAi(0,e.corners,t);n.push(n[0]);for(var o,r,s=0;s<n.length-1;s++)i.push((o=n[parseInt(s.toString(),10)],r=n[s+1],{x1:o.x,y1:o.y,x2:r.x,y2:r.y}));return i}function H0i(e,t,i){var n,e=e.rotateAngle+e.parentTransform;if(e){if(e<45)return t;if(e<=135)n={width:t.width,height:t.height,topLeft:t.bottomLeft,topCenter:t.middleLeft,topRight:t.topLeft,middleLeft:t.bottomCenter,center:i.center,middleRight:t.topCenter,bottomLeft:t.bottomRight,bottomCenter:t.middleRight,bottomRight:t.topRight,left:i.left,right:i.right,top:i.top,bottom:i.bottom};else if(e<=225)n={width:t.width,height:t.height,topLeft:t.bottomLeft,topCenter:t.bottomCenter,topRight:t.bottomRight,middleLeft:t.middleRight,center:i.center,middleRight:t.middleLeft,bottomLeft:t.topLeft,bottomCenter:t.topCenter,bottomRight:t.topRight,left:i.left,right:i.right,top:i.top,bottom:i.bottom};else{if(!(e<=315))return t;n={width:t.width,height:t.height,topLeft:t.topRight,topCenter:t.middleRight,topRight:t.bottomRight,middleLeft:t.topCenter,center:i.center,middleRight:t.bottomCenter,bottomLeft:t.topLeft,bottomCenter:t.middleLeft,bottomRight:t.bottomLeft,left:i.left,right:i.right,top:i.top,bottom:i.bottom}}return n}return t}function z0i(e,t,i){var n=[];if(e.segments&&0<e.segments.length)for(var o=void 0,r=[],s=t.point,o=0;o<e.segments.length;o++){var a=e.segments[parseInt(o.toString(),10)];if((r=[]).push(s),o!==e.segments.length-1?(r.push(a.point),s=a.point):r.push(i.point),e.segments[parseInt(o.toString(),10)].points=r,1<e.segments.length&&Hmi.equals(a.points[0],a.points[1])&&e.segments.splice(o,1),a)for(var l=0;l<a.points.length;l++)(0<l||0===o)&&n.push(a.points[parseInt(l.toString(),10)])}return n}function j0i(e,t,i){return"Top"===e||"Bottom"===e?i.x>t.x?"Right":"Left":i.y>t.y?"Bottom":"Top"}function W0i(e){if("Straight"===e.type||"Bezier"===e.type)(0===e.segments.length||0<e.segments.length&&!Hmi.isEmptyPoint(e.segments[e.segments.length-1].point))&&(o="Bezier"===e.type?new nSi(e,"segments",{type:"Bezier",isInternalSegment:!0},!0):new eSi(e,"segments",{type:"Straight"},!0),e.segments.push(o));else{if(0<e.segments.length)for(var t=!1,i=0;i<e.segments.length;){var n=e.segments[parseInt(i.toString(),10)];t||n&&!(n instanceof sSi||n instanceof eSi||n instanceof nSi)?(e.segments.splice(i,1),t=!0):i++}var o;0!==e.segments.length&&!e.segments[e.segments.length-1].direction||(o=new sSi(e,"segments",{type:"Orthogonal"},!0),e.segments.push(o))}}function Q0i(e,t,i){var n=e.segments[parseInt(t.toString(),10)],o="Left"===n.direction||"Top"===n.direction?-n.length:n.length,r="Left"===n.direction||"Right"===n.direction?0:90,o=Z0i(i.point,o,r);return e.segments[t-1].length+=n.length,e.segments[t-1].points[1]=i.point=o,e.segments.splice(t,1),--t}function U0i(e,t){var i,n,o;void 0!==e.targetWrapper&&void 0===e.targetPortWrapper&&TTi(e.targetWrapper).containsPoint(t.point,1)&&(i=e.targetWrapper,n=(e=e.segments[e.segments.length-2]).points[e.points.length-1],"Bottom"===(o=mvi(e.direction))?n.y<i.corners.bottom+1&&(e.points[e.points.length-1].y=i.corners.bottom+20,e.length=Hmi.distancePoints(e.points[0],e.points[e.points.length-1])):"Top"===o?n.y>i.corners.top-1&&(e.points[e.points.length-1].y=i.corners.top-20,e.length=Hmi.distancePoints(e.points[0],e.points[e.points.length-1])):"Left"===o?n.x>i.corners.left-1&&(e.points[e.points.length-1].x=i.corners.left-20,e.length=Hmi.distancePoints(e.points[0],e.points[e.points.length-1])):"Right"===o&&n.x<i.corners.right+1&&(e.points[e.points.length-1].x=i.corners.right+20,e.length=Hmi.distancePoints(e.points[0],e.points[e.points.length-1])),t.point=e.points[e.points.length-1])}function q0i(e,t){for(var i=0;i<e.segments.length;i++)for(var n=e.segments[parseInt(i.toString(),10)],o=0;o<n.points.length;o++)(0<o||0===i)&&t.push(n.points[parseInt(o.toString(),10)]);return t}function G0i(e,t,i,n){var o,r,s,a,l={x:0,y:0},h=H0i(e,e.corners,e.bounds),d=t.margin,t=t.point,d=(h.bottomCenter.y+d.bottom<t.y?(a="Bottom",l=h.bottomCenter):h.topCenter.y-d.top>t.y?(a="Top",l=h.topCenter):h.middleLeft.x-d.left>t.x?(a="Left",l=h.middleLeft):h.middleRight.x+d.right<t.x?(a="Right",l=h.middleRight):(d=Math.abs(t.y-h.topCenter.y),o=Math.abs(t.x-h.middleRight.x),r=Math.abs(t.y-h.bottomCenter.y),t=Math.abs(t.x-h.middleLeft.x),s=Number.MAX_VALUE,a="Top",l=h.topCenter,o<(s=d)&&(s=o,a="Right",l=h.middleRight),r<s&&(s=r,a="Bottom",l=h.bottomCenter),t<s&&(a="Left",l=h.middleLeft)),i.point=l,i.direction=a,J0i(h,mvi(i.direction)));i.point=$0i(n,0,i.point,d,e===n.targetWrapper)}function Y0i(e,t,i,n,o){var r,s;if((l=function(e,t){var i=!1;switch(e){case"Left":switch(t){case"Right":case"Bottom":i=!0}break;case"Top":switch(t){case"Left":case"Right":case"Bottom":i=!0}break;case"Bottom":"Right"===t&&(i=!0)}return i}(t.direction,i.direction))&&cvi(t,i),"Right"===t.direction&&"Left"===i.direction?r=function(e,t,i,n){var o=e.sourcePortWrapper,r=Math.round(Math.abs(t.point.y-i.point.y)),s={x:Math.max(t.point.x,t.corners.right),y:t.point.y},a={x:Math.min(i.point.x,i.corners.left),y:i.point.y},l=X0i(e);{var h;n&&(h=a,a=s,s=h)}t.corners.bottom+l<i.corners.top-l||t.corners.top-l>i.corners.bottom+l||("Bezier"!==e.type||i.corners.left-t.corners.right<=2*l&&5<=i.corners.left-t.corners.right)&&(l=0);t.margin={left:l,right:l,top:l,bottom:l},i.margin={left:l,right:l,top:l,bottom:l},h=0===r&&(t.corners.right<i.corners.left||n&&t.corners.right<i.corners.left)?hyi.One:t.point.x+t.margin.right<i.point.x-i.margin.left||e.sourceWrapper!==e.targetWrapper&&(TTi(e.sourceWrapper).containsPoint(a)||TTi(e.targetWrapper).containsPoint(s))?hyi.Three:(t.corners.bottom<=i.corners.top||t.corners.top>=i.corners.top||void 0!==o&&o.offsetY<=i.corners.top||void 0===o&&t.corners.right<=i.corners.top||void 0!==o&&o.offsetY>=i.corners.bottom||void 0===o&&(t.corners.right,i.corners.bottom),hyi.Five);return h}(e,t,i,l):"Right"===t.direction&&"Right"===i.direction?r=function(e,t,i){var n=e.sourcePortWrapper,o=e.targetPortWrapper,r=t.point.x-i.point.x,s=t.point.y-i.point.y,e=X0i(e);i.margin={left:e,right:e,top:e,bottom:e},t.margin={left:e,right:e,top:e,bottom:e},e=t.corners.right>=i.corners.right?void 0!==n&&(n.offsetY<i.corners.top-i.margin.top||n.offsetY>i.corners.bottom+i.margin.bottom)||void 0===n&&t.corners.middleRight.y<i.corners.top||void 0!==n&&n.offsetY>i.corners.bottom+i.margin.bottom&&t.corners.top>i.corners.bottom||void 0===n&&t.corners.middleRight.y>i.corners.bottom||void 0!==n&&n.offsetY<i.corners.top-i.margin.top&&t.corners.bottom>i.corners.top||void 0===n&&t.corners.middleRight.y>i.corners.bottom?hyi.Three:t.corners.right<i.corners.left||i.corners.right<t.corners.left?hyi.Five:0==r||0==s?hyi.One:hyi.Three:void 0!==o&&t.corners.bottom<o.offsetY-i.margin.top||void 0===o&&t.corners.bottom<i.corners.middleRight.y||void 0!==o&&t.corners.top>o.offsetY+i.margin.right||void 0===o&&t.corners.top>i.corners.middleRight.y||void 0!==o&&(void 0!==n&&n.offsetX<i.corners.left&&n.offsetX!==o.offsetX&&Math.abs(t.corners.right-i.corners.left)<=20||void 0===n&&t.corners.right<i.corners.left&&t.corners.center.x!==i.corners.center.x&&t.corners.center.y!==i.corners.center.y)?hyi.Three:t.corners.right<i.corners.left?hyi.Five:0==r||0==s?hyi.One:hyi.Three;return e}(e,t,i):"Right"===t.direction&&"Top"===i.direction?r=function(e,t,i,n){var o=e.targetPortWrapper,r=e.sourcePortWrapper,s={x:Math.max(t.point.x,t.corners.right),y:t.point.y},a={x:i.point.x,y:Math.min(i.point.y,i.corners.top)},l=X0i(e);i.margin={left:l,right:l,top:l,bottom:l},t.margin={top:l,bottom:l,left:l,right:l},n&&(l=r,r=o,o=l,n=s,s=a,a=n);l=void 0!==r&&r.offsetY<i.corners.top-i.margin.top||void 0===r&&t.corners.bottom<i.corners.top-i.margin.top?t.corners.bottom<i.corners.top?void 0!==o&&t.corners.right+t.margin.right<o.offsetX||void 0===o&&t.corners.right+t.margin.right<i.corners.topCenter.x?hyi.Two:hyi.Four:void 0!==o&&t.corners.left>o.offsetX||void 0===o&&t.corners.left>i.corners.topCenter.x?hyi.Four:hyi.Two:void 0!==r&&Math.abs(t.corners.right-i.corners.left)<=5&&Math.abs(r.offsetY-i.corners.top)<=5||void 0!==o&&t.corners.right<i.corners.left&&25<=Math.abs(o.offsetX-t.corners.topCenter.x)&&t.corners.middleRight.y+t.margin.right<o.offsetY||!(t.corners.right<i.corners.left)&&e.sourceWrapper!==e.targetWrapper&&(TTi(e.sourceWrapper).containsPoint(a)||TTi(e.targetWrapper).containsPoint(s))?hyi.Two:hyi.Four;return l}(e,t,i,l):"Right"===t.direction&&"Bottom"===i.direction?r=function(e,t,i,n){var o=X0i(e),o=(t.margin={left:o,right:o,top:o,bottom:o},i.margin={left:o,right:o,top:o,bottom:o},e.sourcePortWrapper),e=e.targetPortWrapper;n&&(n=o,o=e,e=n);n=void 0!==o&&o.offsetY>i.corners.bottom+i.margin.bottom||void 0===o&&t.corners.middleRight.y>i.corners.bottom+i.margin.bottom?t.corners.top>i.corners.bottom?void 0!==e&&t.corners.right+t.margin.right<e.offsetX||void 0===e&&t.corners.right+t.margin.right<i.corners.bottomCenter.x?hyi.Two:hyi.Four:void 0!==e&&t.corners.left>e.offsetX||void 0===e&&t.corners.left>i.corners.bottomCenter.x?hyi.Four:hyi.Two:void 0!==o&&Math.abs(t.corners.right-i.corners.left)<=25&&Math.abs(o.offsetY-i.corners.bottom)<=25?hyi.Two:(t.corners.right,i.corners.left,hyi.Four);return n}(e,t,i,l):"Bottom"===t.direction&&"Top"===i.direction?r=function(e,t,i){var n=t.point.x-i.point.x,o=X0i(e);t.corners.right+o<i.corners.left-o||t.corners.left-o>i.corners.right+o||("Bezier"!==e.type||i.corners.top-t.corners.bottom<=2*o&&5<=i.corners.top-t.corners.bottom)&&(o=0);t.margin={left:o,right:o,top:o,bottom:o},i.margin={left:o,right:o,top:o,bottom:o},e=0==n&&t.corners.bottom<i.corners.top?hyi.One:t.corners.bottom+t.margin.bottom<i.corners.top-i.margin.top?hyi.Three:(t.corners.right+t.margin.right<i.corners.left-i.margin.left||(t.corners.left,t.margin.left,i.corners.right,i.margin.right),hyi.Five);return e}(e,t,i):"Bottom"===t.direction&&"Bottom"===i.direction?(s=X0i(e),t.margin={left:s,right:s,top:s,bottom:s},i.margin={left:s,right:s,top:s,bottom:s},r=function(e,t,i){var n=e.sourcePortWrapper,e=e.targetPortWrapper,o=Math.round(Math.abs(t.point.x-i.point.x)),r=Math.round(Math.abs(i.point.y-i.point.y));n=t.corners.bottom<i.corners.bottom?void 0!==n&&n.offsetX<i.corners.left-i.margin.left||void 0===n&&t.corners.bottomCenter.x<i.corners.left-i.margin.left||void 0!==n&&n.offsetX>i.corners.right+i.margin.right||void 0===n&&t.corners.bottomCenter.x>i.corners.right+i.margin.right?hyi.Three:t.corners.bottom<i.corners.top?hyi.Five:0===o||0===r?hyi.One:hyi.Three:void 0!==e&&t.corners.left-t.margin.left>e.offsetX||void 0===e&&t.corners.left>i.corners.left||void 0!==e&&t.corners.right+t.margin.right<e.offsetX||void 0===e&&t.corners.right<i.corners.right?hyi.Three:t.corners.top>i.corners.bottom?hyi.Five:0===o||0===r?hyi.One:hyi.Three;return n}(e,t,i)):"Bottom"===t.direction&&"Left"===i.direction?r=function(e,t,i,n){var o=e.sourcePortWrapper,r=e.targetPortWrapper,e=X0i(e);i.margin={left:e,right:e,top:e,bottom:e},t.margin={top:e,bottom:e,left:e,right:e},n&&(e=o,o=r,r=e);n=void 0!==o&&o.offsetX<i.corners.left-i.margin.left||void 0===o&&t.corners.bottomCenter.x<i.corners.bottomLeft.x-i.margin.left?t.corners.right<i.corners.left?void 0!==r&&t.corners.bottom+t.margin.bottom<r.offsetY||void 0===r&&t.corners.bottom+t.margin.bottom<i.corners.middleLeft.y?hyi.Two:hyi.Four:void 0!==r&&t.corners.top>r.offsetY||void 0===r&&t.corners.top>i.corners.middleLeft.y?hyi.Four:hyi.Two:void 0!==r&&Math.abs(t.corners.right-i.corners.left)<=25&&Math.abs(r.offsetY-t.corners.bottom)<=25?hyi.Two:hyi.Four;return n}(e,t,i,l):"Left"===t.direction&&"Left"===i.direction?r=function(e,t,i){var n=e.sourcePortWrapper,o=e.targetPortWrapper,e=X0i(e),e=(t.margin={left:e,right:e,top:e,bottom:e},i.margin={left:e,right:e,top:e,bottom:e},Math.round(Math.abs(t.point.x-i.point.x))),r=Math.round(Math.abs(t.point.y-i.point.y));o=t.corners.left<i.corners.left?void 0!==o&&t.corners.bottom+t.margin.bottom<o.offsetY||void 0===o&&t.corners.bottom+t.margin.bottom<i.corners.middleLeft.y||void 0!==o&&t.corners.top-t.margin.top>o.offsetY||void 0===o&&t.corners.top-t.margin.top>i.corners.middleLeft.y?hyi.Three:t.corners.right<i.corners.left||i.corners.right<t.corners.left?hyi.Five:0===e||0===r?hyi.One:hyi.Three:void 0!==n&&n.offsetY<i.corners.top-i.margin.top||void 0===n&&t.corners.middleLeft.y<i.corners.top||void 0!==n&&n.offsetY>i.corners.bottom+i.margin.bottom||void 0===n&&t.corners.middleLeft.y>i.corners.bottom+i.margin.bottom?hyi.Three:t.corners.left>i.corners.right?hyi.Five:0===e||0===r?hyi.One:hyi.Three;return o}(e,t,i):"Left"===t.direction&&"Top"===i.direction?r=function(e,t,i,n){var o=e.sourcePortWrapper,r=X0i(e),r=(i.margin={left:r,right:r,top:r,bottom:r},t.margin={top:r,bottom:r,left:r,right:r},e.targetPortWrapper),s={x:Math.min(t.point.x,t.corners.left),y:t.point.y},a={x:i.point.x,y:Math.min(i.point.y,i.corners.top)};n&&(n=o,o=r,r=n,n=s,s=a,a=n);n=void 0!==o&&o.offsetY<i.corners.top-i.margin.top||void 0===o&&(t.corners.bottom<i.corners.top-i.margin.top||t.corners.middleLeft.y<i.corners.top-i.margin.top)?t.corners.bottom<i.corners.top?void 0!==r&&t.corners.left-t.margin.left>r.offsetX||void 0===r&&t.corners.left-t.margin.left>i.corners.topCenter.x?hyi.Two:hyi.Four:void 0!==r&&t.corners.right<r.offsetX||void 0===r&&t.corners.right<i.corners.topCenter.x?hyi.Four:hyi.Two:void 0!==o&&Math.abs(t.corners.left-i.corners.right)<=25&&Math.abs(o.offsetY-i.corners.top)<=25||e.sourceWrapper!==e.targetWrapper&&(TTi(e.sourceWrapper).containsPoint(a)||TTi(e.targetWrapper).containsPoint(s))?hyi.Two:(t.corners.left,i.corners.right,hyi.Four);return n}(e,t,i,l):"Top"===t.direction&&"Top"===i.direction&&(r=function(e,t,i){var n=e.sourcePortWrapper,o=e.targetPortWrapper,r=Math.round(Math.abs(t.point.x-i.point.x)),s=Math.round(Math.abs(t.point.y-i.point.y)),e=X0i(e);i.margin={left:e,right:e,top:e,bottom:e},t.margin={top:e,bottom:e,left:e,right:e},e=t.corners.top<i.corners.top?void 0!==o&&t.corners.left-t.margin.left>o.offsetX||void 0===o&&t.corners.left>i.corners.left||void 0!==o&&t.corners.right+t.margin.right<o.offsetX||void 0===o&&t.corners.right<i.corners.right?hyi.Three:t.corners.bottom<i.corners.top?hyi.Five:0===r||0===s?hyi.One:hyi.Three:void 0!==n&&n.offsetX>i.corners.right+i.margin.right||void 0===n&&t.corners.left>i.corners.right||void 0!==n&&n.offsetX<i.corners.left-i.margin.left||void 0===n&&t.corners.bottomRight.x<i.corners.left?hyi.Three:t.corners.top>i.corners.bottom?hyi.Five:0===r||0===s?hyi.One:hyi.Three;return e}(e,t,i)),l&&cvi(t,i),s=function(e,t,i,n,o,r){var s,a,l=e.sourceWrapper,h=e.targetWrapper,d=l.corners,p=h.corners,c=20,l={corners:i.corners,point:i.point,direction:i.direction,margin:i.margin},h={corners:n.corners,point:n.point,direction:n.direction,margin:n.margin};if(!(l.direction===h.direction&&t!==hyi.Five||l.direction!==mvi(h.direction)&&t!==hyi.Three))switch(l.direction){case"Left":d.middleLeft.x>p.middleRight.x&&(a=(d.middleLeft.x-p.middleRight.x)/2,c=r?a:Math.min(c,a));break;case"Right":d.middleRight.x<p.middleLeft.x&&(a=(p.middleLeft.x-d.middleRight.x)/2,c=r?a:Math.min(c,a));break;case"Top":d.topCenter.y>p.bottomCenter.y&&(a=(d.topCenter.y-p.bottomCenter.y)/2,c=r?a:Math.min(c,a));break;case"Bottom":d.bottomCenter.y<p.topCenter.y&&(a=(p.topCenter.y-d.bottomCenter.y)/2,c=r?a:Math.min(c,a))}c=nvi(d,l,c);i="Bezier"===e.type;o&&(c=Math.max(c,o));t===hyi.One&&(s=[l.point,h.point]);t===hyi.Two&&(s=ovi(l,h));t===hyi.Three&&(s=rvi(e,l,h,c,void 0,i));t===hyi.Four&&(s=svi(l,h,void 0,s,c,i));t===hyi.Five&&(s=function(e,t,i,n){void 0===i&&(i=20);void 0===n&&(n=!1);n&&(i=20);var o,r,s=i,a=e.corners.left-e.margin.left,l=e.corners.right+e.margin.right,h=e.corners.bottom+e.margin.bottom,d=e.corners.top-e.margin.top,p=t.corners.left-t.margin.left,c=t.corners.right+t.margin.right,u=t.corners.bottom+t.margin.bottom,g=t.corners.top-t.margin.top;switch(e.direction){case"Left":(g<d&&d<u||h<u&&g<h)&&p<a&&a<=c&&20<=i&&(s=e.point.x-t.corners.left+s),n&&e.direction===t.direction&&e.corners.left>t.corners.left&&20<=e.corners.left-t.corners.right&&(s=(e.corners.left-t.corners.right)/2),r=Z0i(e.point,s,180);break;case"Top":(p<a&&a<c||l<c&&p<l)&&g<d&&d<=u&&20<=i&&(s=e.point.y-t.corners.top+s),n&&e.direction===t.direction&&e.corners.top>t.corners.top&&20<=e.corners.top-t.corners.bottom&&(s=(e.corners.top-t.corners.bottom)/2),r=Z0i(e.point,s,270);break;case"Right":(g<d&&d<u||h<u&&g<h)&&l<c&&p<=l&&20<=i&&(s=t.corners.right-e.point.x+s),n&&e.direction===t.direction&&e.corners.right<t.corners.right&&20<=t.corners.left-e.corners.right&&(s=(t.corners.left-e.corners.right)/2),r=Z0i(e.point,s,0);break;case"Bottom":(p<a&&a<c||l<c&&p<l)&&h<u&&g<=h&&20<=i&&(s=t.corners.bottom-e.point.y+s),n&&e.direction===t.direction&&e.corners.bottom<t.corners.bottom&&20<=t.corners.top-e.corners.bottom&&(s=(t.corners.top-e.corners.bottom)/2),r=Z0i(e.point,s,90)}o=[e.point,r];var m=void 0;{var f;o=(m="Top"===e.direction||"Bottom"===e.direction?(f=e.direction,e.direction=r.x>t.point.x?"Left":"Right",e.point=r,n?.5*Math.abs(r.x-t.point.x):m):(f=e.direction,e.direction=r.y>t.point.y?"Top":"Bottom",e.point=r,n?.5*Math.abs(r.y-t.point.y):m),svi(e,t,f,o,m,n))}return o}(l,h,c,i));return s}(e,r,t,i,n,o),"Bezier"===e.type){var a=e,l=r,t=s;if("Bezier"===a.type)if(0===a.segments.length){var h,d,p,c,u,g,m,f,y,v,b,w,C,S,A,x,I,T,E,D,i=t[0],n=t[t.length-1];l===hyi.One?(f=Math.min(20,.5*Hmi.findLength(i,n)),m={angle:K0i(i,n),distance:f},f={angle:K0i(n,i),distance:f},p=Hmi.direction(i,n),D=new nSi(a,"segments",{type:"Bezier",isInternalSegment:!0,vector1:m,vector2:f,orientation:"Left"===p||"Right"===p?"Horizontal":"Vertical"},!0),a.segments.push(D)):l===hyi.Two?(g=t[1],m={angle:K0i(i,g),distance:.5*Hmi.findLength(i,g)},f={angle:K0i(n,g),distance:.5*Hmi.findLength(n,g)},p=Hmi.direction(i,g),D=new nSi(a,"segments",{type:"Bezier",isInternalSegment:!0,vector1:m,vector2:f,orientation:"Left"===p||"Right"===p?"Horizontal":"Vertical"},!0),a.segments.push(D)):l===hyi.Three?(E=t[1],h=t[t.length-2],g={x:.5*(E.x+h.x),y:.5*(E.y+h.y)},m={angle:K0i(i,E),distance:.5*Hmi.findLength(i,E)},f={angle:K0i(g,E),distance:.5*Hmi.findLength(g,E)},y=Hmi.direction(i,E),v=new nSi(a,"segments",{type:"Bezier",isInternalSegment:!0,vector1:m,vector2:f,point:g,orientation:"Left"===y||"Right"===y?"Horizontal":"Vertical"},!0),a.segments.push(v),b={angle:K0i(g,h),distance:.5*Hmi.findLength(g,h)},w={angle:K0i(n,h),distance:.5*Hmi.findLength(n,h)},C=Hmi.direction(g,h),S=new nSi(a,"segments",{type:"Bezier",isInternalSegment:!0,vector1:b,vector2:w,orientation:"Left"===C||"Right"===C?"Horizontal":"Vertical"},!0),a.segments.push(S)):l===hyi.Four?(E=t[1],h=t[2],d=t[3],c={x:.5*(E.x+h.x),y:.5*(E.y+h.y)},u={x:.5*(h.x+d.x),y:.5*(h.y+d.y)},m={angle:K0i(i,E),distance:.5*Hmi.findLength(i,E)},f={angle:K0i(c,E),distance:.5*Hmi.findLength(c,E)},y=Hmi.direction(i,E),v=new nSi(a,"segments",{type:"Bezier",isInternalSegment:!0,vector1:m,vector2:f,point:c,orientation:"Left"===y||"Right"===y?"Horizontal":"Vertical"},!0),a.segments.push(v),b={angle:K0i(c,h),distance:.5*Hmi.findLength(c,h)},w={angle:K0i(u,h),distance:.5*Hmi.findLength(u,h)},C=Hmi.direction(c,h),S=new nSi(a,"segments",{type:"Bezier",isInternalSegment:!0,vector1:b,vector2:w,point:u,orientation:"Left"===C||"Right"===C?"Horizontal":"Vertical"},!0),a.segments.push(S),A={angle:K0i(u,d),distance:.5*Hmi.findLength(u,d)},x={angle:K0i(n,d),distance:.5*Hmi.findLength(n,d)},I=Hmi.direction(u,d),T=new nSi(a,"segments",{type:"Bezier",isInternalSegment:!0,vector1:A,vector2:x,orientation:"Left"===I||"Right"===I?"Horizontal":"Vertical"},!0),a.segments.push(T)):l===hyi.Five?(E=t[1],h=t[2],d=t[3],p=t[4],c={x:.5*(E.x+h.x),y:.5*(E.y+h.y)},u={x:.5*(h.x+d.x),y:.5*(h.y+d.y)},g={x:.5*(d.x+p.x),y:.5*(d.y+p.y)},m={angle:K0i(i,E),distance:.5*Hmi.findLength(i,E)},f={angle:K0i(c,E),distance:.5*Hmi.findLength(c,E)},y=Hmi.direction(i,E),v=new nSi(a,"segments",{type:"Bezier",isInternalSegment:!0,vector1:m,vector2:f,point:c,orientation:"Left"===y||"Right"===y?"Horizontal":"Vertical"},!0),a.segments.push(v),b={angle:K0i(c,h),distance:.5*Hmi.findLength(c,h)},w={angle:K0i(u,h),distance:.5*Hmi.findLength(u,h)},C=Hmi.direction(c,h),S=new nSi(a,"segments",{type:"Bezier",isInternalSegment:!0,vector1:b,vector2:w,point:u,orientation:"Left"===C||"Right"===C?"Horizontal":"Vertical"},!0),a.segments.push(S),A={angle:K0i(u,d),distance:.5*Hmi.findLength(u,d)},x={angle:K0i(g,d),distance:.5*Hmi.findLength(g,d)},I=Hmi.direction(u,d),T=new nSi(a,"segments",{type:"Bezier",isInternalSegment:!0,vector1:A,vector2:x,point:g,orientation:"Left"===I||"Right"===I?"Horizontal":"Vertical"},!0),a.segments.push(T),l={angle:K0i(g,p),distance:.5*Hmi.findLength(g,p)},t={angle:K0i(n,p),distance:.5*Hmi.findLength(n,p)},i=Hmi.direction(g,p),E=new nSi(a,"segments",{type:"Bezier",isInternalSegment:!0,vector1:l,vector2:t,orientation:"Left"===i||"Right"===i?"Horizontal":"Vertical"},!0),a.segments.push(E)):(D=new nSi(a,"segments",{type:"Bezier"},!0),a.segments.push(D))}else for(var M=0;M<a.segments.length;M++)a.bezierSettings.allowSegmentsReset&&(a.segments[parseInt(M.toString(),10)].isInternalSegment=!0)}return s}function X0i(e){e=13<=e.connectorSpacing?13:e.connectorSpacing<=1?1:e.connectorSpacing;return e}function K0i(e,t){var i={x:t.x,y:e.y},i=Hmi.findLength(i,t),n=Hmi.findLength(t,e),i=180*(i=Math.asin(i/n))/Math.PI;return e.x<t.x?e.y>t.y&&(i=360-i):i=e.y<t.y?180-i:180+i,i}function J0i(e,t){var i;switch(t){case"Left":i=e.middleLeft;break;case"Top":i=e.topCenter;break;case"Right":i=e.middleRight;break;case"Bottom":i=e.bottomCenter}return i}function Z0i(e,t,i){return Hmi.transform(e,i,t)}function $0i(e,t,i,n,o){i={x:i.x,y:i.y},n={x:n.x,y:n.y};var r,s,a,l=o?e.targetWrapper:e.sourceWrapper,h=o?e.targetPadding:e.sourcePadding,d=o||"Orthogonal"===e.type||"Bezier"===e.type?i:n,p=l,c=HTi(-l.parentTransform,l.offsetX,l.offsetY,i),u=HTi(-l.parentTransform,l.offsetX,l.offsetY,n);return"Orthogonal"===e.type||"Bezier"===e.type?(c.x===u.x&&(c.y<u.y?c.y-=5:c.y+=5),c.y===u.y&&(c.x<u.x?c.x-=5:c.x+=5),i=HTi(l.parentTransform,l.offsetX,l.offsetY,c)):o?(a=Hmi.findAngle(i,n),n=Hmi.transform({x:n.x,y:n.y},a,Math.max(l.actualSize.width,l.actualSize.height))):(a=Hmi.findAngle(n,i),i=Hmi.transform({x:i.x,y:i.y},a,Math.max(l.actualSize.width,l.actualSize.height))),(e.sourcePadding||e.targetPadding)&&(r=new tfi(l.bounds.x-h,l.bounds.y-h,l.actualSize.width+2*h,l.actualSize.height+2*h)),l instanceof kyi&&l.data?(s=r?[r.topLeft,r.topRight,r.bottomRight,r.bottomLeft]:p.getPoints(),p.data.split("m").length-1+(p.data.split("M").length-1)==1&&(s[s.length]=s[0])):(s=r?[r.topLeft,r.topRight,r.bottomRight,r.bottomLeft]:IAi(0,l.corners))[s.length]=s[0],tvi({x1:i.x,y1:i.y,x2:n.x,y2:n.y},s,0,d)||i}function evi(e,t,i){t.x=Math.round(100*t.x)/100,t.y=Math.round(100*t.y)/100,i?e.targetPoint=t:e.sourcePoint=t}function tvi(e,t,i,n){var o,r=t.length,s=ivi(e,{x1:t[0].x,y1:t[0].y,x2:t[1].x,y2:t[1].y});if(s&&(o=Hmi.distancePoints(s,n)),isNaN(o)||0<o)for(var a=1;a<r-1;a++){var l=ivi(e,{x1:t[parseInt(a.toString(),10)].x,y1:t[parseInt(a.toString(),10)].y,x2:t[a+1].x,y2:t[a+1].y});if(l){var h=Hmi.distancePoints(l,n);if((isNaN(o)||h<o)&&(o=h,s=l),0<=o&&o<=1)break}}return s}function ivi(e,t){var i=e.x1,n=e.y1,o=e.x2,e=e.y2,r=t.x1,s=t.y1,a=t.x2,t=t.y2,l=e-n,h=i-o,d=o*n-i*e,p=l*r+h*s+d,c=l*a+h*t+d;return 0!=p&&0!=c&&0<=p*c||(e=(p=t-s)*o+(c=r-a)*e+(o=a*s-r*t),0!=(a=p*i+c*n+o)&&0!=e&&0<=a*e)||0==(s=l*c-p*h)?null:(s<0?-s/2:s/2,{x:(r=h*o-c*d)<(t=0)?(r-t)/s:(r+t)/s,y:(r=p*d-l*o)<0?(r-t)/s:(r+t)/s})}function nvi(e,t,i){switch(t.direction){case"Left":t.point.x>e.left&&(i=t.point.x-e.left>i?t.point.x-e.left+i:i);break;case"Right":t.point.x<e.right&&(i=e.right-t.point.x>i?e.right-t.point.x+i:i);break;case"Top":t.point.y>e.top&&(i=t.point.y-e.top>i?t.point.y-e.top+i:i);break;case"Bottom":t.point.y<e.bottom&&(i=e.bottom-t.point.y>i?e.bottom-t.point.y+i:i)}return i}function ovi(e,t){switch(e.direction){case"Left":case"Right":var i={x:t.point.x,y:e.point.y},n=Hmi.equals(e.point,i)||Hmi.equals(t.point,i)?[e.point,t.point]:[e.point,i,t.point];break;case"Top":case"Bottom":i={x:e.point.x,y:t.point.y};n=Hmi.equals(e.point,i)||Hmi.equals(t.point,i)?[e.point,t.point]:[e.point,i,t.point]}return n}function rvi(e,t,i,n,o,r){n=n||20,(r=void 0===r?!1:r)&&t.direction!==i.direction&&(n="Left"===t.direction||"Right"===t.direction?Math.floor(.5*Math.abs(t.point.x-i.point.x)):Math.floor(.5*Math.abs(t.point.y-i.point.y)));var s,a,l,r=e.sourcePortWrapper,h=i.point.x-t.point.x,d=i.point.y-t.point.y;if(!o&&(Math.abs(h)<.001||Math.abs(d)<.001)&&void 0===i.direction)return[t.point,i.point];if(void 0===e.targetWrapper&&Math.abs(h)<=31&&Math.abs(d)<=31){if("Left"===t.direction||"Right"===t.direction?Math.abs(d)<12&&(t.direction=t.point.y>i.point.y?"Top":"Bottom"):Math.abs(h)<12&&(t.direction=t.point.x>i.point.x?"Left":"Right"),12<Math.abs(h)||12<Math.abs(d))return ovi(t,i);n+=5}return"Left"===t.direction||"Right"===t.direction?("Right"===t.direction?(void 0!==i.direction&&"Right"===i.direction&&(n=Math.max(t.point.x,i.point.x)-t.point.x+n),t.point.x>i.point.x&&void 0===r&&(n=-n)):(void 0!==i.direction&&"Left"===i.direction&&(n=t.point.x-Math.min(t.point.x,i.point.x)+n),(t.point.x>i.point.x||void 0!==r||"Left"===t.direction)&&(n=-n)),l=i.point.y-t.point.y,s=Z0i(t.point,n,0),0!==(l=i.point.y-s.y)&&(a=Z0i(s,i.point.y-s.y,90))):"Top"!==t.direction&&"Bottom"!==t.direction||("Bottom"===t.direction?void 0!==i.direction&&"Bottom"===i.direction&&(n=Math.max(t.point.y,i.point.y)-t.point.y+n):(void 0!==i.direction&&"Top"===i.direction&&(n=t.point.y-Math.min(t.point.y,i.point.y)+n),(t.point.y>i.point.y||void 0!==r||"Top"===t.direction)&&(n=-n)),l=i.point.x-t.point.x,s=(t.direction,Z0i(t.point,n,90)),0!==(l=i.point.x-s.x)&&(a=Z0i(s,i.point.x-s.x,0))),0===l?[t.point,i.point]:[t.point,s,a,i.point]}function svi(e,t,i,n,o,r){var s;switch(void 0===o&&(o=20),void 0===r&&(r=!1),void 0===i?(e.margin={left:2,right:2,top:2,bottom:2},t.margin={left:0,right:5,top:0,bottom:5},r&&(e.margin={left:10,right:10,top:10,bottom:10},t.margin={left:10,right:10,top:10,bottom:10},"Left"===e.direction?(o=hvi(e,t,i,o),5<=e.corners.left-t.corners.right&&(o=Math.abs(e.point.x-e.corners.left)+.5*Math.floor(e.corners.left-t.corners.right))):"Right"===e.direction?(o=dvi(e,t,o,i),5<=t.corners.left-e.corners.right&&(o=Math.abs(e.point.x-e.corners.right)+.5*Math.floor(t.corners.left-e.corners.right))):"Top"===e.direction?(o=lvi(e,t,i,o),5<=e.corners.top-t.corners.bottom&&(o=Math.abs(e.point.y-e.corners.top)+.5*Math.floor(e.corners.top-t.corners.bottom))):"Bottom"===e.direction&&(o=pvi(e,t,o,i),5<=t.corners.top-e.corners.bottom)&&(o=Math.abs(e.point.y-e.corners.bottom)+.5*Math.floor(t.corners.top-e.corners.bottom)))):("Bottom"===e.direction?r?t.corners.top-e.corners.bottom<20&&(o=t.corners.bottom-e.point.y+25):t.corners.top>e.corners.bottom&&t.corners.top-e.corners.bottom<20&&(o=(t.corners.top-e.corners.bottom)/2):"Top"===e.direction?r?e.corners.top-t.corners.bottom<20&&(o=e.point.y-t.corners.top+25):t.corners.bottom<e.corners.top&&e.corners.top-t.corners.bottom<20&&(o=(e.corners.top-t.corners.bottom)/2):"Right"===e.direction?r?t.corners.left-e.corners.right<20&&(o=t.corners.right-e.point.x+25):t.corners.left>e.corners.right&&t.corners.left-e.corners.right<20&&(o=(t.corners.left-e.corners.right)/2):"Left"===e.direction&&(r?e.corners.left-t.corners.right<20&&(o=e.point.x-t.corners.left+25):t.corners.right<e.corners.left&&e.corners.left-t.corners.right<20&&(o=(e.corners.left-t.corners.right)/2)),i===t.direction&&r&&("Bottom"===t.direction&&e.point.y>t.point.y||"Top"===t.direction&&e.point.y<t.point.y?"Left"===e.direction?o=hvi(e,t,i,20):"Right"===e.direction&&(o=dvi(e,t,20,i)):("Right"===t.direction&&e.point.x>t.point.x||"Left"===t.direction&&e.point.x<t.point.x)&&("Top"===e.direction?o=lvi(e,t,i,20):"Bottom"===e.direction&&(o=pvi(e,t,20,i))))),e.direction){case"Left":o=r?o:hvi(e,t,i,o),s=Z0i(e.point,o,180);break;case"Right":o=r?o:dvi(e,t,o,i),s=Z0i(e.point,o,0);break;case"Top":o=r?o:lvi(e,t,i,o),s=Z0i(e.point,o,270);break;case"Bottom":o=r?o:pvi(e,t,o,i),s=Z0i(e.point,o,90)}return void 0!==n?n.push(s):n=[e.point,s],"Top"===e.direction||"Bottom"===e.direction?avi(s,"horizontal",e,t,n,r):"Right"!==e.direction&&"Left"!==e.direction||avi(s,"vertical",e,t,n,r),n}function avi(e,t,i,n,o,r){"horizontal"===t?(i.margin={left:0,right:10,top:0,bottom:10},n.margin={left:0,right:10,top:0,bottom:10}):"vertical"===t&&(i.margin={left:10,right:0,top:10,bottom:0},n.margin={left:10,right:0,top:10,bottom:0});var s,a,l,h,d=20;if("horizontal"===t){switch(n.direction){case"Left":d=i.corners.right+i.margin.right<n.corners.left-n.margin.left&&(n.corners.left-i.margin.right-i.corners.right>d||i.corners.top-i.margin.top<=n.point.y&&i.corners.bottom+i.margin.bottom>=n.point.y)?(h=!r||"Top"!==i.direction&&"Bottom"!==i.direction?Math.min(Math.abs(n.corners.left-i.corners.right)/2,20):Math.abs(n.corners.left-i.corners.right)/2,i.corners.right-e.x+h):"Top"===i.direction&&e.y>n.point.y||"Bottom"===i.direction&&e.y<n.point.y?Math.min(n.corners.left,e.x)-e.x-20:e.x>=i.corners.left-i.margin.left&&e.x<=i.corners.right+i.margin.right?Math.min(n.corners.left,i.corners.left)-e.x-20:n.corners.left-e.x-20;break;case"Right":d=i.corners.left-i.margin.left>n.corners.right+n.margin.right&&(i.corners.left-i.margin.right-n.corners.right>d||i.corners.top-i.margin.top<=n.point.y&&i.corners.bottom+i.margin.bottom>=n.point.y)?(h=!r||"Top"!==i.direction&&"Bottom"!==i.direction?Math.min(Math.abs(i.corners.left-n.corners.right)/2,20):Math.abs(i.corners.left-n.corners.right)/2,i.corners.left-e.x-h):"Top"===i.direction&&e.y>n.point.y||"Bottom"===i.direction&&e.y<n.point.y?Math.max(n.corners.right,e.x)-e.x+20:e.x>=i.corners.left-i.margin.left&&e.x<=i.corners.right+i.margin.right?Math.max(n.corners.right,i.corners.right)-e.x+20:n.corners.right-e.x+20}s=Z0i(e,d,0),a=Z0i(s,n.point.y-e.y,90),l=n.point}else if("vertical"===t){switch(n.direction){case"Top":d=i.corners.bottom+i.margin.bottom<n.corners.top-n.margin.top&&(n.corners.top-i.margin.top-i.corners.bottom>d||i.corners.left-i.margin.left<=n.point.x&&i.corners.right+i.margin.right>=n.point.x)?(h=!r||"Right"!==i.direction&&"Left"!==i.direction?Math.min(Math.abs(n.corners.top-i.corners.bottom)/2,20):Math.abs(n.corners.top-i.corners.bottom)/2,i.corners.bottom-e.y+h):"Left"===i.direction&&e.x>n.point.x||"Right"===i.direction&&e.x<n.point.x?Math.min(n.corners.top,e.y)-e.y-20:e.y>=i.corners.top-i.margin.top&&e.y<=i.corners.bottom+i.margin.bottom?Math.min(n.corners.top,i.corners.top)-e.y-20:n.corners.top-e.y-20;break;case"Bottom":d=i.corners.top-i.margin.top>n.corners.bottom+n.margin.bottom&&(i.corners.top-i.margin.top-n.corners.bottom>d||i.corners.left-i.margin.left<=n.point.x&&i.corners.right+i.margin.right>=n.point.x)?(h=!r||"Right"!==i.direction&&"Left"!==i.direction?Math.min(Math.abs(i.corners.top-n.corners.bottom)/2,20):Math.abs(i.corners.top-n.corners.bottom)/2,i.corners.top-e.y-h):"Left"===i.direction&&e.x>n.point.x||"Right"===i.direction&&e.x<n.point.x?Math.max(n.corners.bottom,e.y)-e.y+20:e.y>=i.corners.top-i.margin.top&&e.y<=i.corners.bottom+i.margin.bottom?Math.max(n.corners.bottom,i.corners.bottom)-e.y+20:n.corners.bottom-e.y+20}s=Z0i(e,d,90),a=Z0i(s,n.point.x-e.x,0),l=n.point}o.push(s),o.push(a),o.push(l)}function lvi(e,t,i,n){return e.corners.top-e.margin.top>t.corners.top+t.margin.top&&e.corners.top-e.margin.top<=t.corners.bottom+t.margin.bottom?(("Right"===t.direction&&e.point.x<t.point.x||"Left"===t.direction&&e.point.x>t.point.x)&&(n+=e.corners.top-t.corners.top),n+=e.point.y-e.corners.top):void 0!==i&&"Left"!==i&&"Right"===t.direction&&e.point.x<t.point.x||void 0!==i&&"Right"!==i&&"Left"===t.direction&&t.point.x<e.point.x?n+=Math.abs(e.point.y-t.corners.bottom):n+=e.point.y-e.corners.top,n}function hvi(e,t,i,n){return e.corners.left-e.margin.left>t.corners.left-t.margin.left&&e.corners.left-e.margin.left<=t.corners.right+t.margin.right?(("Bottom"===t.direction&&e.point.y<t.point.y||"Top"===t.direction&&e.point.y>t.point.y)&&(n+=e.corners.left-t.corners.left),n+=e.point.x-e.corners.left):void 0!==i&&"Top"!==i&&"Bottom"===t.direction&&e.point.y<t.point.y||void 0!==i&&"Bottom"!==i&&"Top"===t.direction&&t.point.y<e.point.y?n+=Math.abs(e.point.x-t.corners.right):n+=e.point.x-e.corners.left,n}function dvi(e,t,i,n){return e.corners.right+e.margin.right<t.corners.right+t.margin.right&&e.corners.right+e.margin.right>=t.corners.left-t.margin.left?(("Bottom"===t.direction&&e.point.y<t.point.y||"Top"===t.direction&&e.point.y>t.point.y)&&(i+=t.corners.right-e.corners.right),i+=e.corners.right-e.point.x):void 0!==n&&"Top"!==n&&"Bottom"===t.direction&&e.point.y<t.point.y||void 0!==n&&"Bottom"!==n&&"Top"===t.direction&&t.point.y<e.point.y?i+=Math.abs(e.point.x-t.corners.right):i+=e.corners.right-e.point.x,i}function pvi(e,t,i,n){return e.corners.bottom+e.margin.bottom<t.corners.bottom+t.margin.bottom&&e.corners.bottom+e.margin.bottom>=t.corners.top-t.margin.top?(("Right"===t.direction&&e.point.x<t.point.x||"Left"===t.direction&&e.point.x>t.point.x)&&(i+=t.corners.bottom-e.corners.bottom),i+=e.corners.bottom-e.point.y):void 0!==n&&"Left"!==n&&"Right"===t.direction&&e.point.x<t.point.x||void 0!==n&&"Right"!==n&&"Left"===t.direction&&t.point.x<e.point.x?i+=Math.abs(e.point.y-t.corners.bottom):i+=e.corners.bottom-e.point.y,i}function cvi(e,t){var i=e.direction,i=(e.direction=t.direction,t.direction=i,e.point),i=(e.point=t.point,t.point=i,e.corners);e.corners=t.corners,t.corners=i}function uvi(e,t,i,n){var i=void 0===t?i:t,t=i.topLeft,o=i.topRight,r=i.bottomRight,s=i.bottomLeft,i=i.center,e=K0i(i,e),r=K0i(i,r),s=K0i(i,s),t=K0i(i,t),i=K0i(i,o),o=t<e&&e<i?"Top":r<=e&&e<s?"Bottom":s<=e&&e<=t?"Left":"Right";return o}function gvi(e){var t=e.wrapper.children[0].bounds;return"None"!==e.sourceDecorator.shape&&t.uniteRect(e.wrapper.children[1].bounds),"None"!==e.targetDecorator.shape&&t.uniteRect(e.wrapper.children[2].bounds),t}function mvi(e){switch(e){case"Top":return"Bottom";case"Bottom":return"Top";case"Left":return"Right";case"Right":return"Left"}return"auto"}fvi=function(e,t){return(fvi=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])}))(e,t)};var fvi,yvi,eP=function(e,t){function i(){this.constructor=e}fvi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},nP=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},sP=(eP(vvi,yvi=n),nP([e()],vvi.prototype,"width",void 0),nP([e()],vvi.prototype,"height",void 0),vvi);function vvi(){return null!==yvi&&yvi.apply(this,arguments)||this}eP(wvi,bvi=n),nP([e()],wvi.prototype,"width",void 0),nP([e()],wvi.prototype,"height",void 0),nP([e()],wvi.prototype,"fit",void 0),nP([e()],wvi.prototype,"description",void 0),nP([e()],wvi.prototype,"template",void 0),nP([e()],wvi.prototype,"tooltip",void 0);var bvi,hP=wvi;function wvi(){return null!==bvi&&bvi.apply(this,arguments)||this}Cvi=function(e,t){return(Cvi=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])}))(e,t)};var Cvi,Svi,cP=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},mP=(function(e,t){function i(){this.constructor=e}Cvi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(Avi,Svi=n),cP([e("")],Avi.prototype,"id",void 0),cP([e(Number.MIN_VALUE)],Avi.prototype,"zIndex",void 0),cP([t({},ZOt)],Avi.prototype,"margin",void 0),cP([e(!0)],Avi.prototype,"visible",void 0),cP([t({},O2t)],Avi.prototype,"tooltip",void 0),cP([e(!1)],Avi.prototype,"excludeFromLayout",void 0),cP([e()],Avi.prototype,"addInfo",void 0),cP([e(jfi.None)],Avi.prototype,"flip",void 0),cP([e("All")],Avi.prototype,"flipMode",void 0),cP([t({},hP)],Avi.prototype,"symbolInfo",void 0),Avi);function Avi(){return null!==Svi&&Svi.apply(this,arguments)||this}xvi=function(e,t){return(xvi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}xvi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Evi,Ivi=vyi),Evi.prototype.getNodeTemplate=function(){return this.templateFn},Object.defineProperty(Evi.prototype,"content",{get:function(){return this.data},set:function(e){this.data=e,this.canReset||(this.canReset=!0,this.isTemplate||(this.template=yTi(this,!0)),this.canReset=!1,this.isDirt=!0)},enumerable:!0,configurable:!0});var xvi,Ivi,Tvi=Evi;function Evi(e,t,i,n){var o=Ivi.call(this)||this;return o.data="",o.nodeId="",o.annotationId="",o.diagramId="",o.diagramId=t,o.nodeId=e,o.annotationId=i,o.templateFn=ITi(n),o}Dvi=function(e,t){return(Dvi=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])}))(e,t)};var Dvi,Mvi,vP=function(e,t){function i(){this.constructor=e}Dvi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},CP=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},YY=(vP(kvi,Mvi=n),CP([e("")],kvi.prototype,"id",void 0),CP([e("transparent")],kvi.prototype,"fill",void 0),CP([e("black")],kvi.prototype,"iconStrokeColor",void 0),CP([e(0)],kvi.prototype,"iconStrokeWidth",void 0),CP([e(!0)],kvi.prototype,"visibility",void 0),CP([e(10)],kvi.prototype,"width",void 0),CP([e(10)],kvi.prototype,"height",void 0),CP([e("transparent")],kvi.prototype,"handleStrokeColor",void 0),CP([e(1)],kvi.prototype,"handleStrokeWidth",void 0),CP([e("")],kvi.prototype,"pathData",void 0),CP([e(0)],kvi.prototype,"cornerRadius",void 0),CP([t({left:0,right:0,top:0,bottom:0},ZOt)],kvi.prototype,"padding",void 0),CP([t({},O2t)],kvi.prototype,"tooltip",void 0),kvi);function kvi(){return null!==Mvi&&Mvi.apply(this,arguments)||this}vP(Fvi,Pvi=YY),CP([t({x:0,y:0},Hmi)],Fvi.prototype,"offset",void 0),CP([t({},ZOt)],Fvi.prototype,"margin",void 0);var Pvi,Bvi=Fvi;function Fvi(){return null!==Pvi&&Pvi.apply(this,arguments)||this}vP(Ovi,Lvi=YY),CP([e(.5)],Ovi.prototype,"offset",void 0),CP([e("Center")],Ovi.prototype,"alignment",void 0),CP([t({x:0,y:0},Hmi)],Ovi.prototype,"displacement",void 0);var Lvi,Rvi=Ovi;function Ovi(){return null!==Lvi&&Lvi.apply(this,arguments)||this}function Nvi(e){return!e||(e instanceof f0i||e instanceof b0i?e.constraints&Xfi.Select:e instanceof ISi?e.constraints&Yfi.Select:e.constraints&Kfi.Select)}function Vvi(e){return e?e instanceof f0i||e instanceof b0i?e.constraints&Xfi.Drag:e instanceof ISi?e.constraints&Yfi.Drag:e instanceof qIi?1:e.constraints&Kfi.Drag:1}function _vi(e){return e instanceof ISi?e.constraints&Yfi.Delete:e.constraints&Kfi.Delete}function Hvi(e){return e.constraints&Yfi.DragSourceEnd}function zvi(e){return e.constraints&Yfi.DragTargetEnd}function jvi(e){return e.constraints&Yfi.DragSegmentThumb}function Wvi(e){return e instanceof f0i||e instanceof b0i?e.constraints&Xfi.Rotate:e.constraints&Kfi.Rotate}function Qvi(e){return e.constraints&Kfi.Shadow}function Uvi(e){return e instanceof MIi&&e.constraints&Kfi.InConnect&&e.constraints&Kfi.InConnect}function qvi(e){return e&&e.constraints&&!(e.constraints&pyi.None)&&e.constraints&pyi.InConnect&&e.constraints&pyi.InConnect}function Gvi(e){return e instanceof MIi&&e.constraints&Kfi.OutConnect&&e.constraints&Kfi.OutConnect}function Yvi(e){return e&&e.constraints&&!(e.constraints&pyi.None)&&e.constraints&pyi.OutConnect&&e.constraints&pyi.OutConnect}function Xvi(e,t){var i=0;return e instanceof f0i||e instanceof b0i?i=e.constraints&Xfi.Resize:e&&("SouthEast"===t?i=e.constraints&Kfi.ResizeSouthEast:"East"===t?i=e.constraints&Kfi.ResizeEast:"NorthEast"===t?i=e.constraints&Kfi.ResizeNorthEast:"South"===t?i=e.constraints&Kfi.ResizeSouth:"North"===t?i=e.constraints&Kfi.ResizeNorth:"SouthWest"===t?i=e.constraints&Kfi.ResizeSouthWest:"West"===t?i=e.constraints&Kfi.ResizeWest:"NorthWest"===t&&(i=e.constraints&Kfi.ResizeNorthWest)),i}function Kvi(e){return e instanceof ISi?e.constraints&Yfi.AllowDrop:e.constraints&Kfi.AllowDrop}function Jvi(e){return e.constraints&$fi.Virtualization}function Zvi(e){return e.tool&eyi.SingleSelect}function $vi(e){return e.tool&eyi.MultipleSelect}function ebi(e){return e.tool&eyi.ZoomPan}function tbi(e){return e.tool&eyi.ContinuousDraw}function ibi(e){return e.tool&eyi.DrawOnce}function nbi(e){return e.tool&eyi.SingleSelect||e.tool&eyi.MultipleSelect}function obi(e){return e.constraints&$fi.UserInteraction}function rbi(e){return e.constraints&$fi.ZoomTextEdit}function sbi(e){return e.constraints&$fi.ApiUpdate||e.diagramActions&ryi.ToolAction}function abi(e){return e.constraints&pyi.Draw}function lbi(e){return e.constraints&pyi.Drag}function hbi(e){return!(e&syi.DrawSelectorBorder)}function dbi(e){return!!(e&syi.PreventRenderSelector)}pbi=function(e,t){return(pbi=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])}))(e,t)};var pbi,cbi,pX=function(e,t){function i(){this.constructor=e}pbi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},ubi=(pX(gbi,cbi=Syi),gbi.prototype.rowDefinitions=function(){return this.rowDefns},gbi.prototype.columnDefinitions=function(){return this.colDefns},gbi.prototype.addObject=function(e,t,i,n,o){var r;this.rows.length>=t&&(r=this.rows[parseInt(t.toString(),10)]).cells.length>i&&(o=o||1,n=n||1,(r=r.cells[parseInt(i.toString(),10)]).columnSpan=Math.max(o,r.columnSpan),r.rowSpan=Math.max(n,r.rowSpan),n=new Sbi,(n=e).rowId=t,n.columnId=i,n.columnSpan=o,this.childTable[n.id]=n,this.addObjectToCell(n,r))},gbi.prototype.addObjectToCell=function(e,t){t.children||(t.children=[]),e.style.strokeColor="black",e.style.strokeWidth=1,t.children.push(e)},gbi.prototype.updateProperties=function(e,t,i,n){this.offsetX=e,this.offsetY=t,this.width=i,this.height=n},gbi.prototype.setDefinitions=function(e,t){this.rowDefns=e,this.colDefns=t,this.children=[],this.rows=this.rows||[];for(var i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)],o=new vbi,r=(o.cells=[],new ybi),s=(r.width=this.width,this.colDefns);(void 0===s||s.length<1)&&(s=[r]),this.addCellInRow(s,n,o),this.rows.push(o)}},gbi.prototype.addCellInRow=function(e,t,i){for(var n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)],r=new bbi;r.children=[],this.cellStyle.fill="none",this.cellStyle.strokeColor="none",r.id=xTi(),r.style=this.cellStyle,r.desiredCellWidth=r.minWidth=o.width,r.desiredCellHeight=r.minHeight=t.height,i.cells.push(r),this.children.push(r)}},gbi.prototype.calculateSize=function(){for(var e=this.rows||[],t=0,i=0,n=0;n<e.length;n++)for(var o=this.rows[parseInt(n.toString(),10)],i=0,r=0;r<o.cells.length;r++)if(i+=o.cells[parseInt(r.toString(),10)].desiredCellWidth,r===o.cells.length-1&&(this.width&&this.width!==i&&(o.cells[parseInt(r.toString(),10)].desiredCellWidth+=this.width-i,o.cells[parseInt(r.toString(),10)].minWidth=o.cells[parseInt(r.toString(),10)].desiredCellWidth,o.cells[parseInt(r.toString(),10)].children&&o.cells[parseInt(r.toString(),10)].children.length&&(o.cells[parseInt(r.toString(),10)].children[0].width=o.cells[parseInt(r.toString(),10)].desiredCellWidth),this.colDefns[parseInt(r.toString(),10)].width=o.cells[parseInt(r.toString(),10)].desiredCellWidth),t+=o.cells[parseInt(r.toString(),10)].desiredCellHeight,n===e.length-1)&&this.height&&this.height!==t){var s=this.height-t;if(0<s){for(var a=0;a<o.cells.length;a++)o.cells[parseInt(a.toString(),10)].desiredCellHeight+=s,o.cells[parseInt(a.toString(),10)].minHeight=o.cells[parseInt(a.toString(),10)].desiredCellHeight=o.cells[parseInt(a.toString(),10)].desiredCellHeight,o.cells[parseInt(a.toString(),10)].children&&o.cells[parseInt(a.toString(),10)].children.length&&(o.cells[parseInt(a.toString(),10)].children[0].height=o.cells[parseInt(a.toString(),10)].desiredCellHeight);this.rowDefns[parseInt(n.toString(),10)].height+=s}}},gbi.prototype.updateRowHeight=function(e,t,i,n,o){var r=this.rows[parseInt(e.toString(),10)];this.rowDefns[parseInt(e.toString(),10)].height=t,void 0!==this.height&&(this.height+=t-r.cells[0].desiredCellHeight);for(var s=0;s<r.cells.length;s++)r.cells[parseInt(s.toString(),10)].desiredCellHeight=r.cells[parseInt(s.toString(),10)].minHeight=t,r.cells[parseInt(s.toString(),10)].children&&r.cells[parseInt(s.toString(),10)].children.length&&(r.cells[parseInt(s.toString(),10)].children[0].height=t,this.setTextRefresh(r.cells[parseInt(s.toString(),10)].children[0]));this.desiredRowHeight[parseInt(e.toString(),10)]=t,this.measure(new Omi(this.width,this.height)),this.arrange(this.desiredSize),i&&t<(i=void 0!==n?this.calculateCellHeightBasedOnChildren(e,n):this.calculateCellHeight(e))&&!o&&this.updateRowHeight(e,i,!1)},gbi.prototype.setTextRefresh=function(e){if(e.children&&e.children.length)for(var t=e.children,i=0;i<t.length;i++)t[parseInt(i.toString(),10)]instanceof Tyi&&t[parseInt(i.toString(),10)].refreshTextElement(),t[parseInt(i.toString(),10)]instanceof Vyi&&this.setTextRefresh(t[parseInt(i.toString(),10)])},gbi.prototype.updateColumnWidth=function(e,t,i,n,o){this.colDefns[parseInt(e.toString(),10)].width=t,void 0!==this.width&&(this.width+=t-this.rows[this.rows.length-1].cells[parseInt(e.toString(),10)].desiredCellWidth);for(var r=0;r<this.rows.length;r++)this.setTextRefresh(this.rows[parseInt(r.toString(),10)].cells[0]),this.rows[parseInt(r.toString(),10)].cells[parseInt(e.toString(),10)].desiredCellWidth=this.rows[parseInt(r.toString(),10)].cells[parseInt(e.toString(),10)].minWidth=t,this.rows[parseInt(r.toString(),10)].cells[parseInt(e.toString(),10)].children&&this.rows[parseInt(r.toString(),10)].cells[parseInt(e.toString(),10)].children.length&&(this.rows[parseInt(r.toString(),10)].cells[parseInt(e.toString(),10)].children[0].width=t);this.desiredCellWidth[parseInt(e.toString(),10)]=t,this.measure(new Omi(this.width,this.height)),this.arrange(this.desiredSize),i&&t<(i=void 0!==n?this.calculateCellWidthBasedOnChildren(e,n):this.calculateCellWidth(e))&&!o&&this.updateColumnWidth(e,i,!1)},gbi.prototype.calculateCellWidth=function(e){for(var t,i,n=0;n<this.rows.length;n++)1===(i=this.rows[parseInt(n.toString(),10)].cells[parseInt(e.toString(),10)]).columnSpan&&(i=(i.outerBounds.width>i.bounds.width&&(0===i.children.length||void 0===i.children[0].maxWidth)?i.outerBounds:i.bounds).width,t=!t||t<i?i:t);return t},gbi.prototype.calculateCellHeight=function(e){for(var t,i,n=this.rows[parseInt(e.toString(),10)],o=0;o<n.cells.length;o++)i=((i=n.cells[parseInt(o.toString(),10)]).outerBounds.height>i.bounds.height?i.outerBounds:i.bounds).height,t=!t||t<i?i:t;return t},gbi.prototype.calculateCellSizeBasedOnChildren=function(e,t,i,n){var o,r=e&&0<e.children.length?e.children[0]:void 0;if(r&&1===e.columnSpan){o="Width"===t?r.bounds.right:r.bounds.bottom,n=n||("Width"===t?r.bounds.width:r.bounds.height);for(var s=0;s<r.children.length;s++){var a=r.children[parseInt(s.toString(),10)];a instanceof Vyi&&-1===a.id.indexOf("header")&&o<(a=("Width"===t?a.bounds.right:a.bounds.bottom)+i)&&(a=a-o+("Width"===t?r.bounds.width:r.bounds.height),n=n&&(n<a?a:n))}}return n},gbi.prototype.calculateCellWidthBasedOnChildren=function(e,t){for(var i,n,o=0;o<this.rows.length;o++)n=this.rows[parseInt(o.toString(),10)].cells[parseInt(e.toString(),10)],i=this.calculateCellSizeBasedOnChildren(n,"Width",t,i);return i},gbi.prototype.calculateCellHeightBasedOnChildren=function(e,t){for(var i,n,o=this.rows[parseInt(e.toString(),10)],r=0;r<o.cells.length;r++)n=o.cells[parseInt(r.toString(),10)],i=this.calculateCellSizeBasedOnChildren(n,"Height",t,i);return i},gbi.prototype.addRow=function(e,t,i){0<this.rowDefns.length?this.rowDefns.splice(e,0,t):this.rowDefns.push(t);var n=new vbi;n.cells=[];(new ybi).width=this.width;var o=this.colDefns;this.addCellInRow(o,t,n),e>this.rows.length-1?this.rows.push(n):this.rows.splice(e,0,n),i&&(this.measure(new Omi(this.width,this.height)),this.arrange(this.desiredSize))},gbi.prototype.addColumn=function(e,t,i){var n,o,r,s,a=this.rows;0<this.colDefns.length?this.colDefns.splice(e,0,t):this.colDefns.push(t),void 0!==this.width&&(this.width+=t.width);for(var l=0;l<a.length;l++)n=a[parseInt(l.toString(),10)],o=this.rowDefns[parseInt(l.toString(),10)],r=t,(s=new bbi).style=this.cellStyle,s.desiredCellWidth=s.minWidth=r.width,s.desiredCellHeight=s.minHeight=o.height,s.children=[],e>n.cells.length-1?n.cells.push(s):n.cells.splice(e,0,s),this.children.push(s);i&&(this.measure(new Omi(this.width,this.height)),this.arrange(this.desiredSize))},gbi.prototype.removeRow=function(e){var t,i=this.rows[parseInt(e.toString(),10)];this.height-=this.rowDefns[parseInt(e.toString(),10)].height;for(var n=0;n<i.cells.length;n++)t=i.cells[parseInt(n.toString(),10)],this.children.splice(this.children.indexOf(t),1),(t=document.getElementById(t.id+"_groupElement"))&&t.parentElement&&t.parentElement.removeChild(t);this.rows.splice(e,1),this.rowDefns.splice(e,1),this.measure(new Omi(this.width,this.height)),this.arrange(this.desiredSize)},gbi.prototype.removeColumn=function(e){var t,i=this.rows;this.width-=this.colDefns[parseInt(e.toString(),10)].width;for(var n=0;n<i.length;n++)t=i[parseInt(n.toString(),10)].cells[parseInt(e.toString(),10)],this.children.splice(this.children.indexOf(t),1),(t=document.getElementById(t.id+"_groupElement"))&&t.parentElement&&t.parentElement.removeChild(t),i[parseInt(n.toString(),10)].cells.splice(e,1);this.colDefns.splice(e,1),this.measure(new Omi(this.width,this.height)),this.arrange(this.desiredSize)},gbi.prototype.updateRowIndex=function(e,t){var i=this.rows[parseInt(e.toString(),10)],i=(this.rows.splice(e,1),this.rows.splice(t,0,i),this.rowDefns[parseInt(e.toString(),10)]);this.rowDefns.splice(e,1),this.rowDefns.splice(t,0,i),this.measure(new Omi(this.width,this.height)),this.arrange(this.desiredSize)},gbi.prototype.updateColumnIndex=function(e,t,i){for(var n,o,r=e;r<this.rows.length;r++)n=this.rows[parseInt(r.toString(),10)],o=this.rows[parseInt(r.toString(),10)].cells[parseInt(t.toString(),10)],n.cells.splice(t,1),n.cells.splice(i,0,o);e=this.colDefns[parseInt(t.toString(),10)],this.colDefns.splice(t,1),this.colDefns.splice(i,0,e),e=this.desiredCellWidth[parseInt(t.toString(),10)];this.desiredCellWidth.splice(t,1),this.desiredCellWidth.splice(i,0,e),this.measure(new Omi(this.width,this.height)),this.arrange(this.desiredSize)},gbi.prototype.measure=function(e){var t=void 0;if(void 0!==this.rows&&0<this.rows.length){var i=0,n=0,t=new Omi(0,0);this.calculateSize();for(var o=0,r=this.rows;o<r.length;o++){for(var n=0,s=0,a=(c=r[o]).cells;s<a.length;s++){var l=(u=a[s]).measure(new Omi(u.desiredCellWidth,u.desiredCellHeight));1===u.rowSpan&&(0===n||void 0===this.desiredRowHeight[parseInt(i.toString(),10)]?this.desiredRowHeight[parseInt(i.toString(),10)]=l.height:this.desiredRowHeight[parseInt(i.toString(),10)]=Math.max(l.height,this.desiredRowHeight[parseInt(i.toString(),10)])),1===u.columnSpan&&(0===i||void 0===this.desiredCellWidth[parseInt(n.toString(),10)]?this.desiredCellWidth[parseInt(n.toString(),10)]=l.width:this.desiredCellWidth[parseInt(n.toString(),10)]=Math.max(l.width,this.desiredCellWidth[parseInt(n.toString(),10)]),i===this.rows.length-1)&&(t.width+=this.desiredCellWidth[parseInt(n.toString(),10)]),n++}t.height+=this.desiredRowHeight[parseInt(i.toString(),10)],i++}for(var i=n=0,h=0,d=0,p=this.rows;d<p.length;d++){for(var c,u,g=n=0,m=0,f=(c=p[d]).cells;m<f.length;m++){if(1!==(u=f[m]).columnSpan){for(var y=u.desiredSize.width=0;y<u.columnSpan;y++)y+n<c.cells.length&&(u.desiredSize.width+=this.desiredCellWidth[y+n],u.minWidth=u.desiredSize.width,u.measure(u.desiredSize));n++}else u.desiredSize.width=this.desiredCellWidth[parseInt(g.toString(),10)],u.measure(u.desiredSize);if(1!==u.rowSpan)for(y=u.desiredSize.height=0;y<u.rowSpan;y++)y+h<this.rows.length&&(u.desiredSize.height+=this.desiredRowHeight[y+h],u.minHeight=u.desiredSize.height,u.measure(u.desiredSize));else u.desiredSize.height=this.desiredRowHeight[parseInt(h.toString(),10)],u.measure(u.desiredSize);i++,g++}h++}}return void 0===t&&(t=cbi.prototype.validateDesiredSize.call(this,t,e)),cbi.prototype.stretchChildren.call(this,t),this.desiredSize=t},gbi.prototype.arrange=function(e,t){var i=0,n=0;if(void 0!==this.rows&&0<this.rows.length){for(var o=this.offsetX-e.width*this.pivot.x,r=this.offsetY-e.height*this.pivot.y,s=o,a=0,l=this.rows;a<l.length;a++){for(var s=o,i=0,h=0,d=(m=l[a]).cells;h<d.length;h++){var p=d[h],c=Math.max(this.desiredCellWidth[parseInt(i.toString(),10)],p.desiredSize.width),u=Math.max(this.desiredRowHeight[parseInt(n.toString(),10)],p.desiredSize.height);p.offsetX=s+c*p.pivot.x,p.offsetY=r+u*p.pivot.y,s+=this.desiredCellWidth[parseInt(i.toString(),10)],p.arrange(new Omi(c,u)),i++}r+=this.desiredRowHeight[parseInt(n.toString(),10)],n++}if(t)for(var g,p=void 0,m=void 0,f=void 0,y=void 0,n=0;n<this.rows.length;n++)for(m=this.rows[parseInt(n.toString(),10)],i=0;i<m.cells.length;i++)if(1<(p=m.cells[parseInt(i.toString(),10)]).columnSpan&&this.children.splice(this.children.indexOf(p)+1,p.columnSpan-1),1<p.rowSpan)for(f=n,y=0;f+p.rowSpan-1<this.rows.length&&y<p.rowSpan-1;f++,y++)g=this.rows[f+1].cells[parseInt(i.toString(),10)],this.children.splice(this.children.indexOf(g),1)}return this.actualSize=e,this.updateBounds(),e},gbi);function gbi(){var e=null!==cbi&&cbi.apply(this,arguments)||this;return e.childTable=[],e.cellStyle={},e.desiredRowHeight=[],e.desiredCellWidth=[],e}var mbi,fbi=function(){this.height=void 0},ybi=function(){this.width=void 0},vbi=function(){this.cells=null},bbi=(pX(wbi,mbi=Vyi),wbi);function wbi(){var e=null!==mbi&&mbi.apply(this,arguments)||this;return e.columnSpan=1,e.rowSpan=1,e}pX(Abi,Cbi=vyi);var Cbi,Sbi=Abi;function Abi(){var e=null!==Cbi&&Cbi.apply(this,arguments)||this;return e.rowId=0,e.columnId=0,e.rowSpan=1,e.columnSpan=1,e}function xbi(e,t,i){i.width||0!==i.shape.phases.length||(i.width=100);var n,o=[],r=[],s=0,a=i.shape,l="Horizontal"===a.orientation,h=(a.header&&a.hasHeader&&Dbi(o,a.header.height),o),d=l,p=i,c=0,u=p.shape;if(0<h.length)for(var g=0;g<h.length;g++)c+=h[parseInt(g.toString(),10)].height;if(d){if(0<u.phases.length&&u.phaseSize&&(c+=u.phaseSize,Dbi(h,u.phaseSize)),0<u.lanes.length)for(g=0;g<u.lanes.length;g++)n=u.lanes[parseInt(g.toString(),10)].height,c+=n,g===u.lanes.length-1&&c<p.height&&(n+=p.height-c),Dbi(h,n)}else if(0<u.phases.length)for(var m=0,g=0;g<u.phases.length;g++){var f=u.phases[parseInt(g.toString(),10)].offset;m+=0===g?f:f-=m,c+=n=f,g===u.phases.length-1&&c<p.height&&(n+=p.height-c),Dbi(h,n)}else Dbi(h,p.height);var y,v,b,w,C=r,d=l,S=i,A=0,x=S.shape;if(0<x.phases.length&&"Horizontal"===x.orientation)for(w=0;w<x.phases.length;w++)y=x.phases[parseInt(w.toString(),10)].offset,A+=0===w?y:y-=A,v=Mbi(y),w===x.phases.length-1&&A<S.width&&(v.width+=S.width-A),C.push(v);else if(d)v=Mbi(S.width),C.push(v);else{for(x.phaseSize&&0<x.phases.length?x.lanes.length:x.lanes.length,x.phaseSize&&0<x.phases.length&&(A+=x.phaseSize,v=Mbi(x.phaseSize),C.push(v)),b=0;b<x.lanes.length;b++)A+=x.lanes[parseInt(b.toString(),10)].width,v=Mbi(x.lanes[parseInt(b.toString(),10)].width),b===x.lanes.length-1&&A<S.width&&(v.width+=S.width-A),C.push(v);0===x.phases.length&&0===x.lanes.length&&(v=Mbi(S.width),C.push(v))}if(e.setDefinitions(o,r),a.header&&a.hasHeader){for(var d=e,o=t,r=i,I=0,T=d.columnDefinitions(),E=r.shape,D=0;D<T.length;D++)I+=T[parseInt(D.toString(),10)].width;E.header.id=E.header.id||xTi(),E={id:r.id+E.header.id,annotations:[DTi(E.header.annotation)],style:E.header.style||void 0,offsetX:r.offsetX,offsetY:r.offsetY,rowIndex:0,columnIndex:0,maxWidth:I,container:{type:"Canvas",orientation:"Horizontal"}},Nvi(r)||(E.constraints&=~Kfi.Select),o=Ibi(o,0,r,E,!0),d.addObject(o,0,0,1,d.columnDefinitions().length),s++}if(0<a.phases.length&&a.phaseSize){for(var M=0;M<a.phases.length;M++)""===a.phases[parseInt(M.toString(),10)].id&&(a.phases[parseInt(M.toString(),10)].id=xTi()),Tbi(e,t,i,s,l,M);s++}if(0<a.lanes.length)for(M=0;M<a.lanes.length;M++)""===a.lanes[parseInt(M.toString(),10)].id&&(a.lanes[parseInt(M.toString(),10)].id=xTi()),Ebi(e,t,i,s,M,l),s++}function Ibi(e,t,i,n,o,r,s,a){var l=new MIi(e,"nodes",n,!0),n=(l.parentId=i.id,l.isHeader=!!o,l.isPhase=!!r,l.isLane=!!s,r?"PhaseHeaderParent":"LaneHeaderParent");if(a&&(l[n]=a),l.constraints&=~(Kfi.InConnect|Kfi.OutConnect),l.constraints|=Kfi.HideThumbs,e.initObject(l),e.nodes.push(l),0<l.wrapper.children.length){for(var h=0;h<l.wrapper.children.length;h++){var d=l.wrapper.children[parseInt(h.toString(),10)];d instanceof vyi&&(d.isCalculateDesiredSize=!1),d instanceof Tyi&&(d.canConsiderBounds=!1,!o&&"Vertical"===i.shape.orientation&&r||"Vertical"!==i.shape.orientation&&s)&&(d.isLaneOrientation=!0,d.refreshTextElement())}l.wrapper.measure(new Omi(void 0,void 0)),l.wrapper.arrange(l.wrapper.desiredSize)}return l.wrapper}function Tbi(e,t,i,n,o,r){var s=0,a=0,l=i.shape,n=(o?(a=r,s=n,h=e.columnDefinitions()[parseInt(r.toString(),10)].width):s=l.header&&l.hasHeader?r+1:r,{annotations:[DTi(l.phases[parseInt(r.toString(),10)].header.annotation)],maxWidth:h,id:i.id+l.phases[parseInt(r.toString(),10)].id+"_header",addInfo:l.phases[parseInt(r.toString(),10)].addInfo,offsetX:i.offsetX,offsetY:i.offsetY,style:l.phases[parseInt(r.toString(),10)].style,rowIndex:s,columnIndex:a,container:{type:"Canvas",orientation:o?"Horizontal":"Vertical"}}),h=(n.annotations[0].rotateAngle=o?0:270,Nvi(i)||(n.constraints&=~Kfi.Select),l.phases[parseInt(r.toString(),10)].header.id=n.id,Ibi(t,0,i,n,!1,!0,!1,l.phases[parseInt(r.toString(),10)].id));e.addObject(h,s,a)}function Ebi(e,t,i,n,o,r){for(var s,a=i.shape,l=a.phases.length||1,h=a.header&&a.hasHeader?1:0,d=r?n:h,p=a.phaseSize&&0<a.phases.length?1:0,c=0;c<l;c++){var u,g=r?c:o+p,m=e.rows[parseInt(d.toString(),10)].cells[parseInt(g.toString(),10)],m={id:i.id+a.lanes[parseInt(o.toString(),10)].id+c,rowIndex:d,columnIndex:g,width:m.minWidth,height:m.minHeight,offsetX:i.offsetX,offsetY:i.offsetY,style:a.lanes[parseInt(o.toString(),10)].style,addInfo:a.lanes[parseInt(o.toString(),10)].addInfo,constraints:Kfi.Default|Kfi.ReadOnly|Kfi.AllowDrop,container:{type:"Canvas",orientation:r?"Horizontal":"Vertical"}};Nvi(i)||(m.constraints&=~Kfi.Select),s=Ibi(t,0,i,m,!1,!1,!0),a.phases&&0<a.phases.length&&a.phases[parseInt(c.toString(),10)]&&(u=t.nameTable[a.phases[parseInt(c.toString(),10)].header.id])&&u.laneGrids.splice(o,0,m.id),s.children[0].isCalculateDesiredSize=!1,0===c&&((u={id:i.id+a.lanes[parseInt(o.toString(),10)].id+"_"+c+"_header",style:a.lanes[parseInt(o.toString(),10)].header.style,annotations:[DTi(a.lanes[parseInt(o.toString(),10)].header.annotation)],offsetX:i.offsetX,offsetY:i.offsetY,rowIndex:d,columnIndex:g,container:{type:"Canvas",orientation:r?"Horizontal":"Vertical"}}).annotations[0].rotateAngle=r?270:0,a.lanes[parseInt(o.toString(),10)].header.id=u.id,r?u.width=a.lanes[o].header.width:u.height=a.lanes[parseInt(o.toString(),10)].header.height,Nvi(i)||(u.constraints&=~Kfi.Select),m=Ibi(t,0,i,u,!1,!1,!0,a.lanes[parseInt(o.toString(),10)].id),r&&(m.children[0].elementActions=m.children[0].elementActions|Jfi.HorizontalLaneHeader),s.children.push(m)),e.addObject(s,d,g),r||d++,g=r?c:o+1}}function Dbi(e,t){var i=new fbi;i.height=t,e.push(i)}function Mbi(e){var t=new ybi;return t.width=e,t}function kbi(e,t){for(var i,n,o,r,s,a,l=[],h=0,d=t.rowDefinitions().length,p=0;p<d;p++)for(s=t.rows[parseInt(p.toString(),10)],o=0;o<s.cells.length;o++)if((r=s.cells[parseInt(o.toString(),10)].children[0])&&r.children&&r.children.length)for(n=1;n<r.children.length;n++)if(i=r.children[parseInt(n.toString(),10)],(i=e.getObject(i.id))&&(0<i.inEdges.length||0<i.outEdges.length))for(a=i.inEdges.concat(i.outEdges),h=0;h<a.length;h++)-1===l.indexOf(a[parseInt(h.toString(),10)])&&l.push(a[parseInt(h.toString(),10)]);return l}function Pbi(e){var t,i=e.wrapper;i.measure(new Omi(e.width,e.height)),i.children[0]instanceof ubi&&(e=!1,(t=i.children[0]).width&&t.width<t.desiredSize.width&&(e=!0,t.width=t.desiredSize.width),t.height&&t.height<t.desiredSize.height&&(e=!0,t.height=t.desiredSize.height),e)&&t.measure(new Omi(t.width,t.height)),i.arrange(i.desiredSize)}function Bbi(e,t,i){for(var n,o,r,s,a,l,h,d,p=t.wrapper.children[0],c=i;c<p.rows.length;c++)for(l=p.rows[parseInt(c.toString(),10)],n=0;n<l.cells.length;n++)if((h=l.cells[parseInt(n.toString(),10)]).children&&0<h.children.length)for(o=0;o<h.children.length;o++){if(d=h.children[parseInt(o.toString(),10)],(s=e.nameTable[d.id]).isLane&&1<d.children.length)for(r=1;r<d.children.length;r++)(a=e.nameTable[d.children[parseInt(r.toString(),10)].id])&&a.isLane&&(a.rowIndex=c,a.columnIndex=n);s.rowIndex=c,s.columnIndex=n}}function Fbi(e,t){var i,n,o,r,s,a,l,h,d=t.wrapper.children[0],p=t.shape,c=p.padding,u=p.lanes,g=d.bounds.y,m=0<p.phaseSize?p.phases.length:0,f="Horizontal"===p.orientation,y=f?p.phases.length||1:u.length+1,v=f?(p.header&&p.hasHeader?1:0)+(0<p.phases.length?1:0)+p.lanes.length:(p.header&&p.hasHeader?1:0)+p.phases.length;if(0===m&&!f&&p.lanes.length&&(v+=1),n=f?(i=(p.header&&p.hasHeader?1:0)+(0<m?1:0),0):(i=p.header&&p.hasHeader?1:0,0<m?1:0),0<u.length)for(g+=p.header&&p.hasHeader?p.header.height:0,a=0;a<u.length;a++){for(l=0;l<u[parseInt(a.toString(),10)].children.length;l++)if((o=u[parseInt(a.toString(),10)].children[parseInt(l.toString(),10)]).offsetX=u[parseInt(a.toString(),10)].width,o.offsetY=u[parseInt(a.toString(),10)].height,e.initObject(o),e.nodes.push(o),r=o.wrapper,f){for(h=n;h<y;h++)if(s=d.rows[parseInt(i.toString(),10)].cells[parseInt(h.toString(),10)],r.margin.left<s.bounds.right-d.bounds.x){o.parentId=s.children[0].id,n<h?r.margin.left=r.margin.left-(s.bounds.left-d.bounds.left):s.children[0].children[1].actualSize.width+c>=r.margin.left&&(r.margin.left=s.children[0].children[1].actualSize.width+c),r.margin.left<c&&(r.margin.left=c),r.margin.top<c&&(r.margin.top=c),Lbi(r,o,e);break}}else for(var b=i;b<v;b++)if(s=d.rows[parseInt(b.toString(),10)].cells[parseInt(n.toString(),10)],r.margin.top<s.bounds.bottom-g){o.parentId=s.children[0].id,i<b?r.margin.top=r.margin.top-(s.bounds.top-g):s.children[0].children[1].actualSize.height+c>=r.margin.top&&(r.margin.top=s.children[0].children[1].actualSize.height+c),r.margin.left<c&&(r.margin.left=c),r.margin.top<c&&(r.margin.top=c),Lbi(r,o,e);break}f?i++:n++}d.measure(new Omi(t.width,t.height)),d.arrange(d.desiredSize);var w,C,S,A,x,I,T=d,m=t,E=T.columnDefinitions(),D=T.rowDefinitions(),p=jbi(m),M=("Vertical"===m.shape.orientation&&0===p&&(p=m.shape.header&&m.shape.hasHeader?1:0),m.shape.padding);for(w=0;w<E.length;w++)T.updateColumnWidth(w,E[parseInt(w.toString(),10)].width,!0,M);for(w=p;w<D.length;w++)T.updateRowHeight(w,D[parseInt(w.toString(),10)].height,!0,M);for(C=0;C<D.length;C++)for(I=T.rows[parseInt(C.toString(),10)],w=0;w<E.length;w++)if((A=I.cells[parseInt(w.toString(),10)]).children&&0<A.children.length)for(S=0;S<A.children.length;S++)(x=A.children[parseInt(S.toString(),10)]).maxWidth&&(x.maxWidth=A.actualSize.width),x.maxHeight&&(x.maxHeight=A.actualSize.height);t.width=t.wrapper.width=d.width,t.height=t.wrapper.height=d.height,Qbi(e,t),t.wrapper.measure(new Omi(t.width,t.height)),t.wrapper.arrange(d.desiredSize);m=t;if("SwimLane"===m.shape.type)for(var k=m.shape.lanes,P=void 0,B=void 0,F=0;F<k.length;F++){P=k[parseInt(F.toString(),10)];for(var L=0;L<P.children.length;L++)(B=P.children[parseInt(L.toString(),10)]).offsetX=B.wrapper.offsetX,B.offsetY=B.wrapper.offsetY}Obi(t,e),Rbi(t)}function Lbi(e,t,i){e.measure(new Omi(t.width,t.height)),e.arrange(e.desiredSize);e=i.getObject(t.parentId);i.addChild(e,t.id)}function Rbi(e){if("SwimLane"===e.shape.type&&!e.shape.isLane&&!e.shape.isPhase)for(var t,i,n=void 0,o=void 0,r=void 0,s=void 0,a=void 0,l=e.shape.lanes,h=jbi(e),d=e.wrapper.children[0].rowDefinitions(),p=e.wrapper.children[0].columnDefinitions(),o=0;o<l.length;o++,h++)if(n=l[parseInt(o.toString(),10)],"Horizontal"===e.shape.orientation)for(a=d[parseInt(h.toString(),10)].height,n.height!==a&&(n.height=a),r=0;r<p.length;r++)t=p[parseInt(r.toString(),10)].width,n.width!==t&&(n.width=t);else for(a=p[parseInt(h.toString(),10)].width,n.width!==a&&(n.width=a),s=0;s<d.length;s++)i=d[parseInt(s.toString(),10)].height,n.height!==i&&(n.height=i)}function Obi(e,t){var i,n,o,r,s,a=e.shape,l=a.phases,h=a.header&&a.hasHeader?1:0,d=e.wrapper.children[0].bounds.y+(a.header&&a.hasHeader?a.header.height:0);if("SwimLane"===e.shape.type&&(e=t.getObject(e.id)||e,0<l.length))if(s=e.wrapper.children[0],"Horizontal"===a.orientation)for(o=a.header&&a.hasHeader?s.rows[1]:s.rows[0],i=0;i<l.length;i++)n=(r=o.cells[parseInt(i.toString(),10)].children[0]).bounds.right-s.bounds.x,l[parseInt(i.toString(),10)].offset!==n&&(l[parseInt(i.toString(),10)].offset=n),t.nameTable[r.id].maxWidth=r.maxWidth;else for(i=0;i<l.length;i++)n=(r=s.rows[h+i].cells[0].children[0]).bounds.bottom-d,l[parseInt(i.toString(),10)].offset!==n&&(l[parseInt(i.toString(),10)].offset=n),t.nameTable[r.id].maxWidth=r.maxWidth}function Nbi(e,t){if(e&&0<e.length){var i;t.lineRoutingModule&&t.constraints&$fi.LineRouting&&(t.avoidLineOverlappingModule&&t.avoidLineOverlappingModule.removeConnectors(e),t.lineRoutingModule.renderVirtualRegion(t,!0));for(var n=0;n<e.length;n++)i=t.getObject(e[parseInt(n.toString(),10)]),t.lineRoutingModule&&t.constraints&$fi.LineRouting&&"Orthogonal"===i.type?t.lineRoutingModule.refreshConnectorSegments(t,i,!0):t.connectorPropertyChange(i,{},{sourceID:i.sourceID,targetID:i.targetID})}}function Vbi(e,t,i,n){var o,r,s,a,l,h=e.getObject(t.parentId),d=h.shape,p=h.wrapper.children[0],c=d.lanes,u=kbi(e,p,t.rowIndex);if(("Horizontal"===d.orientation&&t.rowIndex!==i.rowIndex||"Vertical"===d.orientation&&t.columnIndex!==i.columnIndex)&&("Horizontal"===d.orientation?(o=t.rowIndex,r=i.rowIndex,s=(d.header&&d.hasHeader?1:0)+(d.phases.length&&d.phaseSize?1:0),a=t.rowIndex-s,l=i.rowIndex-s,c[parseInt(a.toString(),10)].canMove&&(a<l?n&&i.wrapper.offsetY>n.y&&(r+=0<l?-1:1,l+=0<l?-1:1):n&&i.wrapper.offsetY<n.y&&(r+=1,l+=1),o!==r)&&(p.updateRowIndex(o,r),_bi(a,l,h,e))):(o=t.columnIndex,r=i.columnIndex,s=d.phases.length&&d.phaseSize?1:0,a=t.columnIndex-s,l=i.columnIndex-s,d.header&&d.hasHeader,c[parseInt(a.toString(),10)].canMove&&(a<l?n&&i.wrapper.offsetX>n.x&&(r+=0<l?-1:1,l+=0<l?-1:1):n&&i.wrapper.offsetX<n.x&&(r+=1,l+=1),o!==r)&&(0!==d.phaseSize&&0!==d.phases.length||0!==r&&0!==o||d.header&&d.hasHeader&&(s=0===r?o:r,p.rows[0].cells[parseInt(s.toString(),10)].children=p.rows[0].cells[0].children,p.rows[0].cells[parseInt(s.toString(),10)].columnSpan=p.rows[0].cells[0].columnSpan,p.rows[0].cells[0].children=[]),p.updateColumnIndex(0,o,r),_bi(a,l,h,e))),o!==r&&c[parseInt(a.toString(),10)].canMove)){n={target:DTi(i),source:DTi(t)},d=c[parseInt(a.toString(),10)],c.splice(a,1),c.splice(l,0,d),s={target:DTi(n.source),source:DTi(n.target)},e.diagramActions&ryi.UndoRedo||e.commandHandler.addHistoryEntry({type:"LanePositionChanged",redoObject:s,undoObject:n,category:"Internal"}),Bbi(e,h,0),Nbi(u,e);for(var g,m,f=c,y=e,v=0;v<f.length;v++){g=f[parseInt(v.toString(),10)];for(var b=0;b<g.children.length;b++)(m=y.nameTable[g.children[parseInt(b.toString(),10)].id]).offsetX=m.wrapper.offsetX,m.offsetY=m.wrapper.offsetY}h.wrapper.measure(new Omi(h.width,h.height)),h.wrapper.arrange(h.wrapper.desiredSize),e.updateDiagramObject(h)}e.updateDiagramElementQuad()}function _bi(e,t,i,n){var o=i.shape.phases;if(o&&0<o.length)for(var r=0;r<o.length;r++){var s,a=i.id+o[parseInt(r.toString(),10)].id+"_header",a=n.nameTable[a];a&&a.laneGrids&&0<=e&&0<=t&&e<a.laneGrids.length&&t<a.laneGrids.length&&(s=a.laneGrids.splice(e,1)[0],a.laneGrids.splice(t,0,s))}}function Hbi(e,t,i,n,o,r){var s,a,i=e.getObject(i.id),l=i.shape,h=l.header&&l.hasHeader?1:0,d=l.lanes,p=l.phases,c=n.wrapper.actualSize.width,n=n.wrapper.actualSize.height,u=(t.wrapper.actualSize.width,t.wrapper.actualSize.height,!1),g=(e.diagramActions&ryi.UndoRedo&&(u=!0),i.wrapper.children[0]);if("SwimLane"===i.shape.type)if("Horizontal"===l.orientation)if(t.isPhase){for(var m,f=t.columnIndex;f<p.length;f++)p[parseInt(f.toString(),10)].offset+=o,(y=e.nameTable[p[parseInt(f.toString(),10)].header.id])&&(m=g.rows[y.rowIndex].cells[y.columnIndex].minWidth,p[parseInt(f.toString(),10)].offset<m)&&(p[parseInt(f.toString(),10)].offset=m);for(s=0;s<d.length;s++)d[parseInt(s.toString(),10)].width=u?c:t.wrapper.width}else h=l.phaseSize&&0<l.phases.length?h+1:h,d[t.rowIndex-h].height=u?n:t.wrapper.height;else if(t.isPhase){for(var y,v,f=t.rowIndex-h;f<p.length;f++)p[parseInt(f.toString(),10)].offset+=r,(y=e.nameTable[p[parseInt(f.toString(),10)].header.id])&&(v=g.rows[y.rowIndex].cells[y.columnIndex].minHeight,p[parseInt(f.toString(),10)].offset<v)&&(p[parseInt(f.toString(),10)].offset=v);for(a=0;a<d.length;a++)d[parseInt(a.toString(),10)].height=t.wrapper.height}else h=l.phaseSize&&0<l.phases.length?1:0,d[t.columnIndex-h].width=t.wrapper.width}function zbi(e,t){var e=e.shape,i=e.header&&e.hasHeader?1:0,i="Horizontal"===e.orientation?(i+=0<e.phases.length?1:0,t.rowIndex-i):t.columnIndex-(e.phaseSize&&0<e.phases.length?1:0);return i}function jbi(e){var t=0,e=e.shape;return"Horizontal"===e.orientation&&(t=e.header&&e.hasHeader?1:0),0<e.phases.length&&e.phaseSize&&(t+=1),t}function Wbi(e,t,i,n){e=e.shape;0<e.phases.length&&(t=t.nameTable[e.phases[parseInt(n.toString(),10)].header.id])&&t.maxWidth<i.outerBounds.width&&(t.maxWidth=i.outerBounds.width,t.wrapper.maxWidth=i.outerBounds.width)}function Qbi(e,t){var i;t.shape.header&&t.shape.hasHeader&&(i=t.wrapper.children[0].rows[0].cells[0].children[0].id,e=e.nameTable[""+i])&&e.isHeader&&(e.maxWidth<t.width||e.wrapper.maxWidth<t.width)&&(e.maxWidth=t.width,e.wrapper.maxWidth=t.width)}function Ubi(e,t,i,n,o){var r,s,a,l,h,d=!1;return t.children&&0<t.children.length&&(t=t.children[0],r=e.nameTable[t.id],t=t.bounds,i=i,a=(s=o).left||0,l=o.right||0,h=o.top||0,s=o.bottom||0,t.left-a<=i.x)&&t.right+l>=i.x&&t.top-h<=i.y&&t.bottom+s>=i.y&&(e.addChild(r,n),d=!0),d}function qbi(e,t,i){if("SwimLane"===t.shape.type){var n,o=void 0,r=void 0,s=void 0,a=void 0,l=void 0,O=t.wrapper.bounds.x,N=t.wrapper.bounds.y,h=t.shape,d=h.padding,p=h.phases,c=t.wrapper.children[0],u="Horizontal"===h.orientation,o=h.header&&h.hasHeader?0:-1,g=(0<h.phases.length&&(o+=1),u?h.lanes[0].header.width:h.lanes[0].header.height);if(i.offset>g){for(l=0;l<p.length;l++)if(n=p[parseInt(l.toString(),10)],m=0<l?p[l-1]:n,n.offset>i.offset){if(n=0<l?i.offset-m.offset:i.offset,u){var m=c.columnDefinitions()[parseInt(l.toString(),10)],m=(m.width-=n,(s=e.nameTable[h.phases[parseInt(l.toString(),10)].header.id]).maxWidth=s.wrapper.maxWidth=m.width,c.updateColumnWidth(l,m.width,!1),new ybi);m.width=n,a=l,c.addColumn(l,m,!1);break}m=c.rowDefinitions()[l+o],m=(m.height-=n,s=e.nameTable[h.phases[parseInt(l.toString(),10)].header.id],c.updateRowHeight(l+o,m.height,!1),new fbi);m.height=n,a=l,c.addRow(l+o,m,!1);break}if(e.diagramActions&ryi.UndoRedo&&void 0===a&&(f=e.historyManager.currentEntry.next).isLastPhase&&(g=a=p.length,y=f,k=c,B=u,D=(D=t).shape.phases[g-2],M=y.previousPhase.offset,B?(P=k.columnDefinitions()[g-1],B=new ybi,1<g?(B.width=P.width-(M-D.offset),P.width=M-D.offset):(B.width=P.width-M,P.width=M),k.updateColumnWidth(g-1,P.width,!1),k.addColumn(g,B,!1)):(P=k.rowDefinitions()[parseInt(g.toString(),10)],B=new fbi,1<g?(B.height=y.undoObject.offset-M,P.height=M-D.offset):(B.height=P.height-M,P.height=M),k.updateRowHeight(g,P.height,!1),k.addRow(1+g,B,!1))),0<=a){var f,y=new VIi(t.shape,"phases",i,!0);if(e.diagramActions&ryi.UndoRedo||(y.id+=xTi()),h.phases.splice(a,0,y),Tbi(c,e,t,o,u,a),u){if(r=e.nameTable[c.rows[parseInt(o.toString(),10)].cells[parseInt(a.toString(),10)].children[0].id],0===a&&h.header&&h.hasHeader){c.rows[0].cells[0].children=c.rows[0].cells[1].children,c.rows[0].cells[1].children=[];for(var v=c.rows[0],b=0;b<v.cells.length;b++)v.cells[parseInt(b.toString(),10)].minWidth=void 0,v.cells[parseInt(b.toString(),10)].columnSpan=0===b?c.rows[0].cells.length:1}var w,C,S,A,x=e,I=t,T=c,E=a,V=i,D=I.shape,M=jbi(I);for(D.header&&D.hasHeader&&(T.rows[0].cells[0].columnSpan=T.rows[0].cells.length),w=M;w<T.rows.length;w++)A=T.rows[parseInt(w.toString(),10)],C=A.cells[E-1],S=A.cells[parseInt(E.toString(),10)],A=A.cells[E+1],Gbi(x,I,C,S,A,w,E,V);Bbi(x,I,1);var k,P=c.columnDefinitions();c.updateColumnWidth(a,P[parseInt(a.toString(),10)].width,!0,d),r.maxWidth=r.wrapper.maxWidth=P[parseInt(a.toString(),10)].width,P.length>a+1&&(k=e.nameTable[c.rows[parseInt(o.toString(),10)].cells[a+1].children[0].id],c.updateColumnWidth(a+1,P[a+1].width,!0,d),k.maxWidth=k.wrapper.maxWidth=P[a+1].width),t.width=t.wrapper.width=t.wrapper.children[0].width=c.width}else{for(var _,H,z,r=e.nameTable[c.rows[o+a].cells[0].children[0].id],g=c.rowDefinitions(),B=g[o+a].height,j=e,W=t,F=c,L=o+a,Q=i,U=F.rows[parseInt(L.toString(),10)],q=F.rows[L+1],G=F.rows[L-1],R=1;R<U.cells.length;R++)H=U.cells[parseInt(R.toString(),10)],z=q?q.cells[parseInt(R.toString(),10)]:void 0,_=G?G.cells[parseInt(R.toString(),10)]:void 0,Gbi(j,W,_,H,z,L,R,Q);Bbi(j,W,1),c.updateRowHeight(o+a,B,!0,d),g.length>o+a+1&&(B=g[o+a+1].height,c.updateRowHeight(o+a+1,B,!0,d)),t.height=t.wrapper.height=t.wrapper.children[0].height=c.actualSize.height}Pbi(t),t.width=t.wrapper.actualSize.width,Qbi(e,t),e.drag(t,O-t.wrapper.bounds.x,N-t.wrapper.bounds.y),Obi(t,e),e.commandHandler.select(r),e.diagramActions&ryi.UndoRedo||(f={type:"PhaseCollectionChanged",changeType:"Insert",undoObject:DTi(y),redoObject:DTi(r),category:"Internal"},e.addHistoryEntry(f)),e.updateDiagramObject(t)}}}}function Gbi(e,t,i,n,o,r,s,a){for(var l,h=t.shape,d="Horizontal"===h.orientation,p=t.wrapper.children[0],c=n.desiredCellWidth,u=n.desiredCellHeight,g=d?t.shape.hasHeader?r:r+1:s,m=i?(f=d?i.bounds.x+i.bounds.width:i.bounds.x,d?i.bounds.y:i.bounds.y+i.bounds.height):(f=p.bounds.x,o.bounds.y),f=new tfi(f,m,c,u),y=t.shape.hasHeader?r-1:r,v=t.id+(d?h.lanes[g-2]:h.lanes[g-1]).id,b=(d?s-1:y-1).toString()+(d?s:y).toString(),w=v+b;Object.prototype.hasOwnProperty.call(e.nameTable,w);)w=v+(b=(d?s-1:y-1).toString()+b);var m={id:w,rowIndex:r,columnIndex:s,width:n.minWidth,height:n.minHeight,style:(d?h.lanes[g-2]:h.lanes[g-1]).style,constraints:Kfi.Default|Kfi.AllowDrop,container:{type:"Canvas",orientation:d?"Horizontal":"Vertical"}},c=h.hasHeader?0:-1,g=(a.laneGrids&&0<a.laneGrids.length&&(u=d?r-(2+c):s-1,e.nameTable[a.laneGrids[parseInt(u.toString(),10)]]||(m.id=a.laneGrids[parseInt(u.toString(),10)])),d?s:r-1),a=(h.phases[parseInt(g.toString(),10)]&&(c=e.nameTable[h.phases[parseInt(g.toString(),10)].header.id])&&c.laneGrids.push(m.id),Ibi(e,0,t,m,!1,!1,!0));if(a.children[0].isCalculateDesiredSize=!1,p.addObject(a,r,s),o&&o.children&&o.children.length)for(l=0;l<o.children.length;l++)d?e.nameTable[o.children[parseInt(l.toString(),10)].id].columnIndex+=1:e.nameTable[o.children[parseInt(l.toString(),10)].id].rowIndex+=1;var C,S,A,x=e,I=o,T=n,E=f,D=a,M=d,u=i,k=x.nameTable[D.id],P=I||u,B=x.nameTable[k.parentId].shape.padding;if(P.children&&1<P.children[0].children.length)for(var F=1;F<P.children[0].children.length;F++)C=P.children[0].children[parseInt(F.toString(),10)],A=x.nameTable[C.id],S=M?{x:C.bounds.x,y:C.bounds.center.y}:{x:C.bounds.center.x,y:C.bounds.top},E.containsPoint(S)?(T.children[0].children.push(C),P.children[0].children.splice(F,1),F--,x.deleteChild(A,void 0,!0),A.isLane||(A.parentId=D.id),k.children||(k.children=[]),I||(M?A.margin.left=A.wrapper.bounds.x-P.children[0].bounds.right:A.margin.top=A.wrapper.bounds.y-P.children[0].bounds.bottom),k.children.push(C.id),A.zIndex=k.zIndex+1,x.removeElements(A)):I&&(M?(A.margin.left-=T.desiredCellWidth,B>A.margin.left&&(A.margin.left=B)):(A.margin.top-=T.desiredCellHeight,B>A.margin.top&&(A.margin.top=B)))}function Ybi(e,t,i){var n,o,r;"SwimLane"!==t.shape.type||"ResizeSouth"!==i&&"ResizeEast"!==i||(n=t.shape,t=t.wrapper.children[0],o=r=void 0,r="ResizeSouth"===i?"Vertical"===n.orientation?t.rows[t.rows.length-1].cells[0]:(o=t.rows.length-1,t.rows[parseInt(o.toString(),10)].cells[t.rows[parseInt(o.toString(),10)].cells.length-1]):(o=n.header&&n.hasHeader?1:0,t.rows[parseInt(o.toString(),10)].cells[t.rows[parseInt(o.toString(),10)].cells.length-1]),e.commandHandler.select(e.nameTable[r.children[0].id]))}function Xbi(e,t,i,n,o,r){var s,a,l,h,d,p=xTi(),c=e.shape,u=c.phases,g=e.offsetX-e.wrapper.actualSize.width/2,m=e.offsetY-e.wrapper.actualSize.height/2,f=[];if("Vertical"===c.orientation&&(m+=c.header&&c.hasHeader?c.header.height:0),!r)for(o||(e.id+=p,c&&c.header&&c.hasHeader?c.header.id+=p:c.header=void 0),w=0;u&&w<u.length;w++)u[parseInt(w.toString(),10)].id+=p;for(var y,v,b=o?[i.childTable[n.id]]:c.lanes,w=0;b&&w<b.length;w++)for(a=b[parseInt(w.toString(),10)],r||(a.id+=p),s=0;a.children&&s<a.children.length;s++)l=a.children[parseInt(s.toString(),10)],f.push(l.id),h=l.wrapper.offsetX-l.width/2,d=l.wrapper.offsetY-l.height/2,l.zIndex=Number.MIN_VALUE,l.inEdges=l.outEdges=[],(r||i&&(1===i.pasteIndex||0===i.pasteIndex))&&("Vertical"===c.orientation?l.margin.top=d-m:l.margin.left=h-g),r||(l.id+=p);if(!r){if(o&&(v={shape:{lanes:b,phases:u,phaseSize:c.phaseSize,type:"SwimLane",orientation:c.orientation,header:{annotation:{content:"Title"},height:50}}},"Horizontal"===c.orientation?(y=0,c.hasHeader&&(y=c.header.height),v.width=e.wrapper.actualSize.width,v.height=n.wrapper.actualSize.height+y+c.phaseSize,v.offsetX=e.wrapper.offsetX+10*i.pasteIndex,v.offsetY=n.wrapper.offsetY+10*i.pasteIndex):(v.width=n.wrapper.actualSize.width,v.height=e.wrapper.actualSize.height,v.offsetX=n.wrapper.offsetX+10*i.pasteIndex,v.offsetY=e.wrapper.offsetY+10*i.pasteIndex),e=v),0!==i.pasteIndex&&(e.offsetX+=10,e.offsetY+=10),e.zIndex=Number.MIN_VALUE,e=t.add(e),!o)for(var C=0,S=Object.keys(i.childTable);C<S.length;C++){var A=S[C],A=i.childTable[""+A];A.parentSwimlaneId&&A.parentSwimlaneId+p===e.id?(A.id+=p,-1!==f.indexOf(A.sourceID)&&(A.sourceID+=p),-1!==f.indexOf(A.targetID)&&(A.targetID+=p),A.zIndex=Number.MIN_VALUE,t.add(A)):-1!==f.indexOf(A.sourceID)?A.sourceID+=p:-1!==f.indexOf(A.targetID)&&(A.targetID+=p)}"SVG"!==t.mode&&t.refreshDiagramLayer(),t.select([e])}}function Kbi(e,t,i,n){var o,r,s,a,l,t=t.nodes[0];return(n||pwi(e,t,!0))&&(a=s=r=void 0,l=new vyi,i&&(a=e.nameTable[""+i].parentId,r=t=e.nameTable[""+i]),i=(i?r:t).wrapper,e=e.nameTable[a||t.parentId])&&"Grid"===e.container.type&&((o=new Vyi).children=[],!n&&t.isHeader||("Horizontal"===e.container.orientation&&t.isPhase||"Vertical"===e.container.orientation&&(0<t.rowIndex&&0<t.columnIndex||t.isLane)?(s=lwi(e,(r||t).columnIndex,!(!e.shape.header||!e.shape.hasHeader)),o.offsetX=s.center.x,o.offsetY=s.center.y,l.width=s.width,l.height=s.height):(o.offsetX=e.offsetX,o.offsetY=i.offsetY,l.width=e.wrapper.actualSize.width,l.height=i.actualSize.height)),o.children.push(l),o.measure(new Omi),o.arrange(o.desiredSize)),o}function Jbi(e,t,i,n,o){o=void 0!==o?o:zbi(t,i);for(var r=!1,s=t.shape.lanes[parseInt(o.toString(),10)],a=s.children.length-1;0<=a;a--)n?n.id===s.children[parseInt(a.toString(),10)].id&&s.children.splice(a,1):(e.removeDependentConnector(s.children[parseInt(a.toString(),10)]),e.diagramActions&ryi.UndoRedo||(e.diagramActions=e.diagramActions|ryi.UndoRedo,r=!0),e.remove(s.children[parseInt(a.toString(),10)]),s.children.splice(a,1),r&&(e.diagramActions=e.diagramActions&~ryi.UndoRedo))}function Zbi(e,t){t&&(e.nodes.splice(e.nodes.indexOf(t),1),e.removeFromAQuad(t),e.removeObjectsFromLayer(t),delete e.nameTable[t.id],e.removeElements(t))}function $bi(e,t,i,n){if("SwimLane"===i.shape.type){var o=i.shape,r=void 0;if(1===o.lanes.length)e.remove(i);else{var s,a=i.wrapper.bounds.x,l=i.wrapper.bounds.y,h=void 0,d=void 0,p=void 0,c=void 0,u=i.wrapper.children[0],r=n?o.lanes.indexOf(n):zbi(i,t),n={element:t,cause:e.diagramActions,diagramAction:e.getDiagramAction(e.diagramActions),state:"Changing",type:"Removal",cancel:!1,laneIndex:r};if(e.triggerEvent(dyi.collectionChange,n),!n.cancel){var g=o.lanes[parseInt(r.toString(),10)],m=g.children;g.children=[];for(var f=0;f<m.length;f++){var y=e.getObject(m[parseInt(f.toString(),10)].id);y&&g.children.push(y)}var v=DTi(o.lanes[parseInt(r.toString(),10)]),b=(Jbi(e,i,t,void 0,r),e.diagramActions&ryi.UndoRedo||(v={type:"LaneCollectionChanged",changeType:"Remove",undoObject:v,redoObject:DTi(t),category:"Internal"},e.addHistoryEntry(v)),o.lanes.splice(r,1),t?"Horizontal"===o.orientation?t.rowIndex:t.columnIndex:jbi(i)+r);if("Horizontal"===o.orientation){for(s=u.rows[parseInt(b.toString(),10)],h=0;h<s.cells.length;h++)if((d=s.cells[parseInt(h.toString(),10)])&&0<d.children.length)for(p=0;p<d.children.length;p++)twi(e,c=d.children[parseInt(p.toString(),10)]),ewi(c,i,e);u.removeRow(b)}else{for(i.width=void 0!==i.width?i.width-u.rows[0].cells[parseInt(b.toString(),10)].actualSize.width:i.width,h=0;h<u.rows.length;h++)if((d=u.rows[parseInt(h.toString(),10)].cells[parseInt(b.toString(),10)])&&0<d.children.length)for(p=0;p<d.children.length;p++)twi(e,c=d.children[parseInt(p.toString(),10)]),ewi(c,i,e);u.removeColumn(b)}n={element:t,cause:e.diagramActions,diagramAction:e.getDiagramAction(e.diagramActions),state:"Changed",type:"Removal",cancel:!1,laneIndex:r},e.triggerEvent(dyi.collectionChange,n),i.width=i.wrapper.width=u.width,i.height=i.wrapper.height=u.height,Pbi(i),Bbi(e,i,b="Vertical"===i.shape.orientation?0:b),e.drag(i,a-i.wrapper.bounds.x,l-i.wrapper.bounds.y),e.updateDiagramObject(i)}}}}function ewi(e,t,i){var n=e.id,o=t.shape.phases;if(o&&0<o.length)for(var r=0;r<o.length;r++){var s=t.id+o[parseInt(r.toString(),10)].id+"_header",s=i.nameTable[s],a=s.laneGrids.indexOf(n);-1!==a&&s.laneGrids.splice(a,1)}}function twi(e,t){var i,n;if(t instanceof Vyi){if(0<t.children.length)for(i=0;i<t.children.length;i++)t.children[parseInt(i.toString(),10)]instanceof Vyi&&twi(e,t.children[parseInt(i.toString(),10)]);n=e.getObject(t.id),Zbi(e,n)}}function iwi(e,t,i,n){e.protectPropertyChange(!0);i.wrapper.bounds.x,i.wrapper.bounds.y;var o=!1,r=i.shape,O=i.wrapper.children[0],s=n?r.phases.indexOf(n):(n=t,a=(s=(s=i).shape).header&&s.hasHeader?1:0,"Horizontal"===s.orientation?n.columnIndex:n.rowIndex-a),n=r.phases.length;if(1<r.phases.length){s===n-1&&(o=!0,C=DTi(r.phases[s-1]));var a=DTi(r.phases[parseInt(s.toString(),10)]);if(r.phases.splice(s,1),e.diagramActions&ryi.UndoRedo||((n={type:"PhaseCollectionChanged",changeType:"Remove",undoObject:a,previousPhase:C,redoObject:DTi(t),category:"Internal",isLastPhase:o}).undoObject.laneGrids=t.laneGrids,n.redoObject.laneGrids=t.laneGrids,e.addHistoryEntry(n)),"Horizontal"===r.orientation){var l,h,d,p,c,u,g,m,f,y,N,v,b=e,w=O,C=t,S=s;for(S=void 0!==S?S:C.columnIndex,c=0;c<w.rows.length;c++)if(1<(l=w.rows[parseInt(c.toString(),10)]).cells.length&&(h=l.cells[parseInt(S.toString(),10)],v=l.cells.length-1===S?l.cells[S-1]:l.cells[S+1],p=v.children[0],0<h.children.length))if(d=h.children[0],f=b.nameTable[d.id],0===v.children.length&&0<h.children.length)v.children=h.children,v.columnSpan=h.columnSpan-1;else{for(u=0;u<d.children.length;u++)if((m=d.children[parseInt(u.toString(),10)])instanceof Vyi&&((y=b.nameTable[m.id]).isLane||(y.parentId=p.id),l.cells.length-1===S&&(y.margin.left=y.wrapper.bounds.x-p.bounds.x,m.margin.left=y.wrapper.bounds.x-p.bounds.x),p.children.push(m),b.nameTable[p.id]&&((N=b.nameTable[p.id]).children||(N.children=[]),N.children.push(m.id)),d.children.splice(u,1),u--,f)&&f.children&&-1!==f.children.indexOf(y.id)&&f.children.splice(f.children.indexOf(y.id),1),l.cells.length-1!==S)for(g=0;g<p.children.length;g++){var V,_=p.children[parseInt(g.toString(),10)];_ instanceof Vyi&&((V=b.nameTable[_.id]).margin.left=V.wrapper.bounds.x-d.bounds.x,_.margin.left=V.wrapper.bounds.x-d.bounds.x)}f&&f.isPhase&&(v=b.nameTable[p.id])&&(p.maxWidth=v.wrapper.maxWidth=v.wrapper.maxWidth+=f.wrapper.maxWidth),Zbi(b,f)}C=w.columnDefinitions()[parseInt(S.toString(),10)].width,w.removeColumn(S),S<w.columnDefinitions().length?(B=w.columnDefinitions()[parseInt(S.toString(),10)].width,B+=C,w.updateColumnWidth(S,B,!0)):(B=w.columnDefinitions()[S-1].width,B+=C,w.updateColumnWidth(S-1,B,!0))}else{var H,A,x,I,T,z,E,D,M,k=e,o=O,n=t,P=s,r=i,B=r.shape,n=void 0!==P?B.header?P+1:P:n.rowIndex,j=o.rows[parseInt(n.toString(),10)],F=r.wrapper.bounds.y,W=B.phases.length,Q=(void 0!==B.header&&B.hasHeader&&(F+=o.rowDefinitions()[0].height),P===W?o.rows[n-1]:o.rows[n+1]);for(x=0;x<j.cells.length;x++)if(H=j.cells[parseInt(x.toString(),10)],z=Q.cells[parseInt(x.toString(),10)],E=z.children[0],0<H.children.length){var L=H.children[0],R=k.nameTable[L.id];if(P<W)for(T=0;T<E.children.length;T++)(D=E.children[parseInt(T.toString(),10)])instanceof Vyi&&((M=k.nameTable[D.id]).margin.top=M.wrapper.bounds.y-(0===P?F:L.bounds.y),D.margin.top=M.wrapper.bounds.y-(0===P?F:L.bounds.y));for(I=0;I<L.children.length;I++)(D=L.children[parseInt(I.toString(),10)])instanceof Vyi&&((M=k.nameTable[D.id]).parentId=E.id,P===W&&(M.margin.top=M.wrapper.bounds.y-(0===P?F:E.bounds.y),D.margin.top=M.wrapper.bounds.y-(0===P?F:E.bounds.y)),E.children.push(D),L.children.splice(I,1),I--,R.children)&&-1!==R.children.indexOf(M.id)&&R.children.splice(R.children.indexOf(M.id),1);Zbi(k,R)}r=o.rowDefinitions()[parseInt(n.toString(),10)].height,o.removeRow(n),n<o.rowDefinitions().length?(A=o.rowDefinitions()[parseInt(n.toString(),10)].height,A+=r,o.updateRowHeight(n,A,!0)):(A=o.rowDefinitions()[n-1].height,A+=r,o.updateRowHeight(n-1,A,!0))}Qbi(e,i),Bbi(e,i,i.isHeader?1:0),Obi(i,e),e.protectPropertyChange(!1),e.updateDiagramObject(i)}}function nwi(e,t,i){var n=e.nameTable[t.parentId];if(n&&n.isLane){var o=e.nameTable[n.parentId],r=o.wrapper.children[0],s=(e.multiselect||(r.updateColumnWidth(n.columnIndex,r.columnDefinitions()[n.columnIndex].width,!0,i),r.updateRowHeight(n.rowIndex,r.rowDefinitions()[n.rowIndex].height,!0,i)),n.wrapper),a=void 0;t.diffX=t.diffX||0,t.diffY=t.diffY||0,0<t.diffX&&(t.margin.left+=t.diffX+i),0<t.diffY&&(t.margin.top+=t.diffY+i),t.margin.left<i&&(t.margin.left=i),t.margin.top<i&&(t.margin.top=i);for(var l=0;l<s.children.length;l++){var h=s.children[parseInt(l.toString(),10)];if(h instanceof Vyi){h=e.nameTable[h.id];if(h.isLane){a=h.wrapper;break}}}a&&("Horizontal"===o.shape.orientation?t.margin.left<i+a.actualSize.width&&(t.margin.left=i+a.actualSize.width):t.margin.top<i+a.actualSize.height&&(t.margin.top=i+a.actualSize.height)),o.wrapper.measure(new Omi(o.width,o.height)),o.wrapper.arrange(o.wrapper.desiredSize),t.offsetX=t.wrapper.offsetX,t.offsetY=t.wrapper.offsetY,e.nodePropertyChange(t,{},{margin:{left:t.margin.left,top:t.margin.top}}),t.isResized=!1,r.measure(new Omi(r.width,r.height)),r.arrange(r.desiredSize),o.width=o.wrapper.width=o.wrapper.children[0].actualSize.width,o.height=o.wrapper.height=o.wrapper.children[0].actualSize.height}}function owi(e,t){var i;return e.isLane&&(t=t.getObject(e.parentId))&&"SwimLane"===t.shape.type&&e.isLane&&(e=zbi(t,e),i=t.shape.lanes[parseInt(e.toString(),10)]),i}function rwi(e,t){if(e.isLane){e=owi(e,t);if(t.eventHandler.action.includes("Resize")||e.canMove)return 1}}function swi(e,t,i,n){var o,r,s,a,l,h=!1;return pwi(e,t,!0)&&(e.protectPropertyChange(!0),r=(o=e.nameTable[t.parentId]).wrapper,1<e.selectedItems.nodes.length?e.multiselect=!0:e.multiselect=!1,o&&"Canvas"===o.container.type&&((n||r.bounds.x<=i.x&&r.bounds.right>=i.x&&r.bounds.y<=i.y&&r.bounds.bottom>=i.y&&!e.multiselect)&&(n=void 0,i=r.bounds.y,s=r.bounds.x,"SwimLane"===(a=e.nameTable[o.parentId]||o).shape.type?h=vwi(o,a,t,e,!0):(l=(a=e.nameTable[o.parentId]||o).shape,n=a.wrapper,r.actualSize.width<r.outerBounds.width&&!(r.bounds.x>r.outerBounds.x)&&(void 0!==o.rowIndex?(n.updateColumnWidth(o.columnIndex,r.outerBounds.width,!0),"Horizontal"===l.orientation&&l.phaseSize&&Wbi(a,e,r,o.columnIndex),Qbi(e,a),e.drag(a,s-r.bounds.x,i-r.bounds.y)):e.scale(o,1+(r.outerBounds.width-r.actualSize.width)/r.actualSize.width,1,r.outerBounds.x<r.bounds.x?{x:1,y:.5}:{x:0,y:.5})),r.actualSize.height<r.outerBounds.height&&!(r.bounds.y>r.outerBounds.y)&&(void 0!==o.rowIndex?(n.updateRowHeight(o.rowIndex,r.outerBounds.height,!0),e.drag(a,s-r.bounds.x,i-r.bounds.y)):e.scale(o,1,1+(r.outerBounds.height-r.actualSize.height)/r.actualSize.height,r.outerBounds.y<r.bounds.y?{x:.5,y:1}:{x:.5,y:0})))),e.select([t]),Nbi([],e)),e.protectPropertyChange(!1)),h}function awi(e,t,i,n){var o,r,s;pwi(e,t,!0)&&!e.cancelPositionChange&&(o=e.isProtectedOnChange,e.protectPropertyChange(!0),r=(s=e.nameTable[t.parentId]).wrapper,!s||"Canvas"!==s.container.type||n||r.bounds.x<=i.x&&r.bounds.right>=i.x&&r.bounds.y<=i.y&&r.bounds.bottom>=i.y||t.constraints&Kfi.AllowMovingOutsideLane||(s=DTi(t),e.clearSelection(),uwi(e,t),t.parentId="",t.parentObj=e,t.propName="nodes",n={type:"ChildCollectionChanged",category:"Internal",undoObject:s,redoObject:DTi(t)},e.addHistoryEntry(n),e.commandHandler.isContainer&&(e.commandHandler.isContainer=!1,e.endGroupAction()),fwi(t,e)),e.protectPropertyChange(o))}function lwi(e,t,i){for(var n=new tfi,o=("SwimLane"===e.shape.type?e.wrapper.children[0]:e.wrapper).rows,r=i?1:0;r<o.length;r++)n.uniteRect(o[parseInt(r.toString(),10)].cells[parseInt(t.toString(),10)].bounds);return n}function hwi(e,t){for(var i,n={},o=0,r=Object.keys(t);o<r.length;o++){var s=r[o];n[""+s]=t[""+s]}return S1i(t)===MIi&&((i=new MIi(e,"nodes",n,!0)).id=t.id,e.initObject(i)),e.updateDiagramObject(i),i}function dwi(e,t){var i,n,o;return e.enableServerDataBinding(!1),N||(e.selectedObject.helperObject?o=e.selectedObject.helperObject:(0<e.selectedItems.nodes.length||0<e.selectedItems.connectors.length)&&(t=t instanceof qIi&&t.nodes.length+t.connectors.length===1?(i=(0<t.nodes.length?t.nodes:t.connectors)[0],e.selectedItems.wrapper.children[0]):(i=t,e.selectedItems.wrapper),n=(e.selectedObject.actualObject=i)instanceof qIi&&0<i.nodes.length?i.nodes[0]:i,e.selectedObject.actualObject=i,!e.currentSymbol)&&(n.isLane&&rwi(n,e)&&pwi(e,n)||!n.isLane&&pwi(e,n)||e.constraints&$fi.LineRouting&&0<e.selectedItems.nodes.length)&&(o=hwi(e,{id:"helper",rotateAngle:t.rotateAngle,offsetX:t.offsetX,offsetY:t.offsetY,minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight,width:t.actualSize.width,height:t.actualSize.height,style:{strokeDashArray:"2 2",fill:"transparent",strokeColor:"#7D7D7D",strokeWidth:2}}),e.selectedObject.helperObject=o)),e.enableServerDataBinding(!0),o}function pwi(e,t,i){i=i?e.nameTable[t.parentId]:e.nameTable[t.parentId]||t;return!(!i||!i.container)}function cwi(e,t){var i=e.nameTable[t.parentId];if(t.laneMargin={left:t.margin.left,right:t.margin.right,top:t.margin.top,bottom:t.margin.bottom},t.hasTextAnnotation)for(var n=0;n<t.outEdges.length;n++){var o,r,s,a=e.nameTable[t.outEdges[parseInt(n.toString(),10)]];a.isBpmnAnnotationConnector&&(a=e.nameTable[a.targetID],s={width:t.wrapper.actualSize.width,height:t.wrapper.actualSize.height,offsetX:t.wrapper.offsetX,offsetY:t.wrapper.offsetY},r=t.wrapper.offsetX,o=t.wrapper.offsetY,r=(s=e.getTextAnnotationOffset(t,a,s,r,o)).x-r,s=s.y-o,r||s||t.width!==t.wrapper.actualSize.width||t.height!==t.wrapper.actualSize.height)&&(t.isResized=!0,t.resizeDif||(t.resizeDif=[]),t.resizeDif[a.id]={x:r,y:s})}"Canvas"===i.container.type&&(t.margin.left=t.offsetX-i.wrapper.bounds.x-t.width/2,t.margin.top=t.offsetY-i.wrapper.bounds.y-t.height/2),e.nodePropertyChange(t,{},{width:t.width,height:t.height,offsetX:t.offsetX,offsetY:t.offsetY,margin:{left:t.margin.left,right:t.margin.right,top:t.margin.top,bottom:t.margin.bottom},rotateAngle:t.rotateAngle}),e.undoRedoModule&&i.isLane&&e.undoRedoModule.checkRedo&&(t.margin.left<0||t.margin.top<0)&&uwi(e,t),i.isLane||(i.wrapper.measure(new Omi),i.wrapper.arrange(i.wrapper.desiredSize))}function uwi(e,t){if(t.parentId&&""!==t.parentId){var i=e.nameTable[t.parentId];if(i.isLane&&i.parentId)for(var n=e.nameTable[i.parentId],i=i.id.slice(n.id.length),o=i.substring(0,i.length-1),r=n.shape.lanes,s=void 0,a=0;a<r.length;a++)if(o===(s=r[parseInt(a.toString(),10)]).id)for(var l=0;l<s.children.length;l++)s.children[parseInt(l.toString(),10)].id===t.id&&(s.children.splice(l,1),l--);e.deleteChild(t)}}function gwi(e,t,i){for(var i=i.commandHandler.getObjectLayer(e.id),n=i.zIndexTable,o=t.zIndex+1;void 0!==n[parseInt(o.toString(),10)];)o++;delete i.zIndexTable[e.zIndex],e.zIndex=o,i.zIndexTable[parseInt(o.toString(),10)]=e.id}function mwi(e,t,i,n,o,r){if(!e.currentSymbol){e.protectPropertyChange(!0);var s=e.nameTable[t.parentId],r=(i=e.getObject(i.id)||i,s&&s.zIndex>i.zIndex&&r&&gwi(i,s,e),-1!==e.nodes.indexOf(i)?i.id:i),a=("Canvas"!==t.container.type||o?s&&(l=s.wrapper.bounds,p=t.wrapper.bounds,"Horizontal"===s.shape.orientation?i.margin.left-=p.x-l.x:(h=t.parentId+s.shape.lanes[0].id+"_0_header",i.margin.top-=p.y-l.y-e.nameTable[h].wrapper.bounds.height)):(p=i.wrapper.offsetX-i.wrapper.actualSize.width/2-(t.wrapper.offsetX-t.wrapper.actualSize.width/2),l=i.wrapper.offsetY-i.wrapper.actualSize.height/2-(t.wrapper.offsetY-t.wrapper.actualSize.height/2),i.margin.left=p,i.margin.top=l),e.nameTable[t.id]);if(a.children||(a.children=[]),-1===a.children.indexOf(i.id)){uwi(e,i),e.getObject(i.id)&&e.removeElements(i);var l,h=DTi(i);if(e.addChild(a,r),i=e.getObject(i.id),a.isLane&&a.parentId)for(var d=(s=e.nameTable[a.parentId]).shape.lanes,p=a.id.slice(s.id.length),c=p.substring(0,p.length-1),u=0;u<d.length;u++)a.isLane&&c===d[parseInt(u.toString(),10)].id&&(i.parentObj instanceof dDi||(i.parentObj=d[parseInt(u.toString(),10)]),e.nameTable.hasOwnProperty(i.id)||d[parseInt(u.toString(),10)].children.push(i));e.updateDiagramObject(i),fwi(i,e),a.parentId?n||(e.multiselect?(nwi(e,i,20),e.updateDiagramElementQuad()):vwi(a,s,i,e)):e.updateDiagramObject(a),e.diagramActions&ryi.UndoRedo||(l={type:"ChildCollectionChanged",category:"Internal",undoObject:h,redoObject:DTi(i),historyAction:o?"AddNodeToLane":void 0},e.addHistoryEntry(l))}else!n&&e.multiselect&&(nwi(e,i,20),e.updateDiagramElementQuad());e.protectPropertyChange(!1)}}function fwi(e,t){var i=$Ii(e.id+"_groupElement",t.element.id),e=$Ii(e.parentId?e.parentId+"_groupElement":t.element.id+"_diagramLayer",t.element.id);i&&e&&e.appendChild(i)}function ywi(e,t,i,n){vwi(e,i.nameTable[e.parentId],t,i,n,!0)}function vwi(e,t,i,n,o,r){var s,a,l,h,d,p,c,u,g,m,f=DTi(e),y=!1,v=t.shape.padding,b=e.wrapper.bounds,w=e.wrapper.outerBounds,C=i.wrapper.bounds;return t&&"SwimLane"===t.shape.type&&(b.right<C.right+v||b.bottom<C.bottom+v||r&&b.top>C.top+v)&&(h=(l=t.wrapper.children[0]).bounds.x,d=l.bounds.y,c=p=void 0,u=e.wrapper.children.find(function(e){return e.id.includes("header")}),g="Horizontal"===t.shape.orientation,b.right<C.right+v&&w.x<=b.x&&(p=g&&u?(c=u?u.width:0,C.right-b.right+(b.left-C.left)+c+2*v):C.right-b.right+(b.left-C.left)+2*v,l.updateColumnWidth(e.columnIndex,b.width+p,a=!0,v)),b.bottom<C.bottom+v&&w.y<=b.y&&(p=!g&&u?(c=u?u.height:0,C.bottom-b.bottom+(b.top-C.top)+c+2*v):C.bottom-b.bottom+(b.top-C.top)+2*v,l.updateRowHeight(e.rowIndex,b.height+p,s=!0,v)),r&&b.top>C.top-v&&w.y<=b.y&&0<(p=!g&&u?(c=u?u.height:0,b.top-C.top+(C.bottom-b.bottom)+c+2*v):b.top-C.top+(C.bottom-b.bottom)+2*v)&&l.updateRowHeight(e.rowIndex,b.height+p,s=!0,v),n.diagramActions&ryi.UndoRedo||(o&&(n.startGroupAction(),y=!0),s&&(m={category:"Internal",type:"RowHeightChanged",undoObject:f,redoObject:DTi(e)},n.addHistoryEntry(m)),a&&(m={category:"Internal",type:"ColumnWidthChanged",undoObject:f,redoObject:DTi(e)},n.addHistoryEntry(m))),t.width=t.wrapper.width=l.width,t.height=t.wrapper.height=l.height,Pbi(t),"Horizontal"===t.shape.orientation&&Wbi(t,n,e.wrapper,e.columnIndex),Qbi(n,t),n.drag(t,h-l.bounds.x,d-l.bounds.y),Obi(t,n),Rbi(t)),r||nwi(n,i,v),n.updateDiagramElementQuad(),y}function bwi(e,t,i,n,o,r){var s=tTi(n.element.id);n.diagramRenderer.renderStackHighlighter(e,s,n.scroller.transform,t,i,o,r)}function wwi(e,t,i,n){var o,r=e,s=i.nameTable[r.parentId],a=i.nameTable[r.parentId];t&&a&&a.container&&"Stack"===a.container.type&&t.container&&"Stack"===t.container.type&&a.id!==t.parentId&&-1<(o=a.wrapper.children.indexOf(r.wrapper))&&(i.nameTable[r.id].parentId=t.id,a.wrapper.children.splice(o,1)),t&&t.parentId&&r.parentId&&"Drag"===n&&a.container&&"Stack"===a.container.type&&(a={targetIndex:o=s.wrapper.children.indexOf(t.wrapper),target:t,sourceIndex:n=s.wrapper.children.indexOf(r.wrapper),source:e},s.wrapper.children.splice(n,1),s.wrapper.children.splice(o,0,r.wrapper),i.commandHandler.addHistoryEntry({type:"StackChildPositionChanged",redoObject:{targetIndex:n,target:t,sourceIndex:o,source:e},undoObject:a,category:"Internal"}))}function Cwi(e,t,i,n,o,r,s){if(r&&1<r.length&&o&&1<o.length)return"PinchZoom";if(n.currentSymbol)return"Drag";if("PortDraw"===n.eventHandler.action&&(n.tool&=~eyi.DrawOnce),(ibi(n)||tbi(n))&&n.drawingObject)return"Draw";if(xwi(n)&&((d=n.selectedItems).wrapper&&o1i(d.constraints,"UserHandle")))for(var a=0,l=d.userHandles;a<l.length;a++){var h=l[a];if(h.visible)if(Awi(i,p=i1i(d,h,n.scroller.transform),h.size/(2*n.scroller.transform.scale)))return h.name}if(xwi(n)){var r=n.selectedItems.annotation?n.selectedItems.wrapper.children[0]:n.selectedItems.wrapper,o=r.bounds,d=n.selectedItems,p=new tfi(o.x,o.y,o.width,o.height);if(Iwi(n)&&!n.selectedItems.annotation){var o=n.selectedItems.connectors[0],c=n.selectedItems.handleSize/2/n.scrollSettings.currentZoom,u=n.selectedItems.handleSize/2/n.scrollSettings.currentZoom;if(o1i(d.constraints,"ResizeAll")){if(o1i(d.constraints,"ConnectorSourceThumb")&&Hvi(o)&&Awi(i,o.sourcePoint,c))return"ConnectorSourceEnd";if(o1i(d.constraints,"ConnectorTargetThumb")&&zvi(o)&&Awi(i,o.targetPoint,u))return"ConnectorTargetEnd";if("OrthoThumb"===(g=function(e,t,i,n){var o=t.handleSize/2/n.scrollSettings.currentZoom,r=t.handleSize/2/n.scrollSettings.currentZoom;if("Bezier"===e.type&&n.connectorEditingToolModule)for(var s=0;s<e.segments.length;s++){var a=e.segments[parseInt(s.toString(),10)];if(Awi(i,Hmi.isEmptyPoint(a.point1)?a.bezierPoint1:a.point1,r)&&(0===s&&r1i(e.bezierSettings.controlPointsVisibility,"Source")||0!==s&&r1i(e.bezierSettings.controlPointsVisibility,"Intermediate")))return"BezierSourceThumb";if(Awi(i,Hmi.isEmptyPoint(a.point2)?a.bezierPoint2:a.point2,o)&&(s===e.segments.length-1&&r1i(e.bezierSettings.controlPointsVisibility,"Target")||s!==e.segments.length-1&&r1i(e.bezierSettings.controlPointsVisibility,"Intermediate")))return"BezierTargetThumb"}if(n.connectorEditingToolModule&&jvi(e)){var t=(e.constraints&Yfi.InheritSegmentThumbSize?n:e).segmentThumbSize,l=20<t&&"Straight"!==e.type?t/2:10;if(l/=n.scrollSettings.currentZoom,"Straight"===e.type||"Bezier"===e.type)for(s=0;s<e.segments.length;s++){a=e.segments[parseInt(s.toString(),10)];if(Awi(i,a.point,l))return"SegmentEnd"}else for(s=0;s<e.segments.length;s++){var h={x:0,y:0};if((a=e.segments[parseInt(s.toString(),10)]).allowDrag)for(var d=0;d<a.points.length-1;d++){var p=Hmi.distancePoints(a.points[parseInt(d.toString(),10)],a.points[d+1]);if(50<=p&&(h.x=(a.points[parseInt(d.toString(),10)].x+a.points[d+1].x)/2,h.y=(a.points[parseInt(d.toString(),10)].y+a.points[d+1].y)/2,Awi(i,h,l)))return"OrthoThumb"}}}else jvi(e)&&console.warn('[WARNING] :: Module "ConnectorEditing" is not available in Diagram component! You either misspelled the module name or forgot to load it.');return null}(o,d,i,n)))return g;if(o1i(d.constraints,"ConnectorSourceThumb")&&Hvi(o)&&g)return g;if(o1i(d.constraints,"ConnectorTargetThumb")&&zvi(o)&&g)return g}}else{var g,c=n.selectedItems.handleSize/2/n.scroller.currentZoom,u=10/n.scroller.currentZoom,o=ofi(),m=(afi(o,r.rotateAngle+r.parentTransform,r.offsetX,r.offsetY),r.offsetX-r.pivot.x*r.actualSize.width),f=r.offsetY-r.pivot.y*r.actualSize.height,y=rfi(o,{x:m+(.5===r.pivot.x?2*r.pivot.x:r.pivot.x)*r.actualSize.width/2,y:f-30/n.scroller.currentZoom}),v=!!n.selectedItems.annotation,b=!(!v||!Wvi(n.selectedItems.annotation));if(o1i(d.constraints,"Rotate")&&Awi(i,y,u)&&n.selectedItems.thumbsConstraints&Zfi.Rotate){if(v&&b)return"LabelRotate";if(!v)return"Rotate"}if(p.Inflate(c),p.containsPoint(i))if(g=function(e,t,i,n,o,r){var s;1===e.selectedItems.nodes.length&&0===e.selectedItems.connectors.length&&e.selectedItems.nodes[0].container&&(s=function(e,t,i,n,o){var r=10/e.scroller.currentZoom,s=e.selectedItems,a=t.actualSize.width,l=t.actualSize.height,h=new tfi(n,o,t.style.strokeWidth,l),d=new tfi(n+a,o,t.style.strokeWidth,l),p=new tfi(n,o,a,t.style.strokeWidth),n=new tfi(n,o+l,a,t.style.strokeWidth),o=pwi(e,e.selectedItems.nodes[0],!0)?e.nameTable[e.selectedItems.nodes[0].parentId]:e.selectedItems.nodes[0];if(n1i(s.constraints,"ResizeEast",s.thumbsConstraints,s)&&d.containsPoint(i,r))return"ResizeEast";if(n1i(s.constraints,"ResizeSouth",s.thumbsConstraints,s)&&n.containsPoint(i,r))return"ResizeSouth";if("Grid"!==o.container.type){if(n1i(s.constraints,"ResizeWest",s.thumbsConstraints,s)&&h.containsPoint(i,r))return"ResizeWest";if(n1i(s.constraints,"ResizeNorth",s.thumbsConstraints,s)&&p.containsPoint(i,r))return"ResizeNorth"}return null}(e,t,i,o,r));s||e.selectedItems.nodes[0]&&(e.selectedItems.nodes[0].isPhase||e.selectedItems.nodes[0].isLane||"SwimLane"===e.selectedItems.nodes[0].shape.type)||(s=function(e,t,i,n,o,r){var s=40/e.scroller.currentZoom,a=e.selectedItems.handleSize/2/e.scroller.currentZoom,e=e.selectedItems,l=!!e.annotation;if(t.actualSize.width>=s&&t.actualSize.height>=s){if(n1i(e.constraints,"ResizeSouthEast",e.thumbsConstraints,e)&&Awi(i,rfi(n,{x:o+t.actualSize.width,y:r+t.actualSize.height}),a))return l?"LabelResizeSouthEast":"ResizeSouthEast";if(n1i(e.constraints,"ResizeSouthWest",e.thumbsConstraints,e)&&Awi(i,rfi(n,{x:o,y:r+t.actualSize.height}),a))return l?"LabelResizeSouthWest":"ResizeSouthWest";if(n1i(e.constraints,"ResizeNorthEast",e.thumbsConstraints,e)&&Awi(i,rfi(n,{x:o+t.actualSize.width,y:r}),a))return l?"LabelResizeNorthEast":"ResizeNorthEast";if(n1i(e.constraints,"ResizeNorthWest",e.thumbsConstraints,e)&&Awi(i,rfi(n,{x:o,y:r}),a))return l?"LabelResizeNorthWest":"ResizeNorthWest"}if(n1i(e.constraints,"ResizeEast",e.thumbsConstraints,e)&&Awi(i,rfi(n,{x:o+t.actualSize.width,y:r+t.actualSize.height/2}),a))return l?"LabelResizeEast":"ResizeEast";if(n1i(e.constraints,"ResizeWest",e.thumbsConstraints,e)&&Awi(i,rfi(n,{x:o,y:r+t.actualSize.height/2}),a))return l?"LabelResizeWest":"ResizeWest";if(n1i(e.constraints,"ResizeSouth",e.thumbsConstraints,e)&&Awi(i,rfi(n,{x:o+t.actualSize.width/2,y:r+t.actualSize.height}),a))return l?"LabelResizeSouth":"ResizeSouth";if(n1i(e.constraints,"ResizeNorth",e.thumbsConstraints,e)&&Awi(i,rfi(n,{x:o+t.actualSize.width/2,y:r}),a))return l?"LabelResizeNorth":"ResizeNorth";return null}(e,t,i,n,o,r));if(s)return s;return null}(n,r,i,o,m,f))return g}}if(ebi(n)&&!e)return"Pan";if((s instanceof r0i||s instanceof l0i)&&(!ebi(n)||Zvi(n)||$vi(n))&&"None"!==(g=Swi(n,s)))return g;if((s instanceof f0i||s instanceof b0i)&&!ebi(n)&&Nvi(s))return Twi(n,s,void 0,t)&&Vvi(s)?"LabelDrag":"LabelSelect";if(null!==e){if(!(e instanceof MIi||e instanceof ISi))return"Select";if(t&&t.id){y=t.id.split(e.id)[1];if(y&&y.match("^_icon"))return"LayoutAnimation"}if(t&&t.id)for(var w,C=0;C<e.fixedUserHandles.length;C++)if(w=e.fixedUserHandles[parseInt(C.toString(),10)].id,t.id&&-1<t.id.indexOf(w))return"FixedUserHandle";if(t instanceof Tyi&&t.hyperlink.link)return"Hyperlink";if(!Vvi(e)||!Twi(n,e,!1)||void 0!==n.selectedItems.annotation)return e&&ebi(n)&&!nbi(n)?"Pan":n.selectedItems.nodes.length&&n.selectedItems.nodes[0].isLane&&n.selectedItems.wrapper&&n.selectedItems.wrapper.bounds.containsPoint(i)?"Drag":"Select";if(e instanceof ISi&&!Awi(i,e.sourcePoint,e.hitPadding)&&!Awi(i,e.targetPoint,e.hitPadding)||!(e instanceof ISi))return"Drag"}return"Select"}function Swi(e,t,i,n){if(lbi(t)&&(s1i(t,Wfi.Hover)||s1i(t,Wfi.Visible))){if(t.constraints&pyi.Drag)return"PortDrag"}else if(abi(t)&&(s1i(t,Wfi.Hover)||s1i(t,Wfi.Visible)))if(t.constraints&pyi.Draw)return e.drawingObject={},t={type:"Orthogonal",sourcePortID:t.id},e.drawingObject=t,e.tool|=eyi.DrawOnce,e.currentDrawingObject=t,"PortDraw";return"None"}function Awi(e,t,i){return e.x>=t.x-i&&e.x<=t.x+i&&e.y>=t.y-i&&e.y<=t.y+i}function xwi(e){return 0<e.selectedItems.nodes.length||0<e.selectedItems.connectors.length}function Iwi(e){return 1===e.selectedItems.connectors.length&&!e.selectedItems.nodes.length}function Twi(e,t,i,n){if(void 0===i&&(i=!0),t instanceof qIi)return!0;if(t instanceof MIi)for(;t;){if(-1!==e.selectedItems.nodes.indexOf(t)&&void 0===e.selectedItems.annotation)return!0;if(i)break;t=e.nameTable[t.parentId]}else if(t instanceof ISi){if(-1!==e.selectedItems.connectors.indexOf(t)&&void 0===e.selectedItems.annotation)return!0}else if((t instanceof f0i||t instanceof b0i)&&e.selectedItems.annotation&&e.selectedItems.wrapper.children[0].id===n.id)return!0;return!1}function Ewi(e,t){var i;return t=(t+360)%360,-1===e.indexOf("Resize")?Mwi[""+e]:(i=Mwi[""+e],0<=t&&t<25||160<=t&&t<=205||340<=t&&t<=360?i:25<=t&&t<=70||205<=t&&t<=250?"n-resize"===i||"s-resize"===i?"ne-resize":"nw-resize"===i||"se-resize"===i?"n-resize":"e-resize"===i||"w-resize"===i?"nw-resize":"e-resize":70<=t&&t<=115||250<=t&&t<=295?"n-resize"===i||"s-resize"===i?"e-resize":"nw-resize"===i||"se-resize"===i?"ne-resize":"e-resize"===i||"w-resize"===i?"n-resize":"nw-resize":115<=t&&t<=155||295<=t&&t<=340?"n-resize"===i||"s-resize"===i?"nw-resize":"nw-resize"===i||"se-resize"===i?"e-resize":"e-resize"===i||"w-resize"===i?"ne-resize":Mwi[""+e]:"n-resize")}var Dwi,Mwi={None:"default",Rotate:"crosshair",Select:"default",Drag:"move",ResizeWest:"w-resize",ResizeEast:"e-resize",ResizeSouth:"s-resize",ResizeNorth:"n-resize",Draw:"crosshair",PortDraw:"crosshair",ResizeNorthEast:"ne-resize",ResizeNorthWest:"nw-resize",ResizeSouthEast:"se-resize",ResizeSouthWest:"sw-resize",ConnectorSourceEnd:"move",ConnectorTargetEnd:"move",BezierSourceThumb:"move",BezierTargetThumb:"move",OrthoThumb:"move",SegmentEnd:"move",Pan:"grab",Hyperlink:"pointer",PortDrag:"pointer",LabelSelect:"pointer",LabelDrag:"move",LabelRotate:"crosshair",LabelResizeWest:"w-resize",LabelResizeEast:"e-resize",LabelResizeSouth:"s-resize",LabelResizeNorth:"n-resize",LabelResizeNorthEast:"ne-resize",LabelResizeNorthWest:"nw-resize",LabelResizeSouthEast:"se-resize",LabelResizeSouthWest:"sw-resize"},Hr=(Dwi=function(e,t){return(Dwi=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])}))(e,t)},function(e,t){function i(){this.constructor=e}Dwi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),kwi=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},Pwi=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Wr=(Bwi.prototype.startAction=function(e){this.currentElement=e,this.inAction=!0},Bwi.prototype.mouseDown=function(e){this.currentElement=e.source,this.startPosition=this.currentPosition=this.prevPosition=e.position,this.isTooltipVisible=!0,this.startAction(e.source),this.checkProperty=!0,this.mouseDownElement=e.source},Bwi.prototype.checkPropertyValue=function(){this.checkProperty&&this.commandHandler.startTransaction(this.isProtectChange)},Bwi.prototype.mouseMove=function(e){return this.currentPosition=e.position,this.inAction&&(this.commandHandler.startTransaction(this.isProtectChange),this.checkProperty=!1),!this.blocked},Bwi.prototype.mouseUp=function(e){this.checkPropertyValue(),this.currentPosition=e.position,this.isTooltipVisible=!1,this.commandHandler.endTransaction(this.isProtectChange),this.endAction(),this.mouseDownElement=null},Bwi.prototype.endAction=function(){this.isTooltipVisible||this.commandHandler.closeTooltip(),this.commandHandler=null,this.currentElement=null,this.currentPosition=null,this.inAction=!1,this.blocked=!1},Bwi.prototype.mouseWheel=function(e){this.currentPosition=e.position},Bwi.prototype.mouseLeave=function(e){this.mouseUp(e)},Bwi.prototype.updateSize=function(e,t,i,n,o,r){e=this.commandHandler.renderContainerHelper(e)||e;var s,a={snapped:!1,offset:0,left:!1,right:!1},l={snapped:!1,offset:0,top:!1,bottom:!1},h=this.currentPosition.x-this.startPosition.x,d=this.currentPosition.y-this.startPosition.y,p=!(e instanceof Tyi)&&this.commandHandler.snappingModule&&this.commandHandler.snappingModule.canSnap(),c=p?this.commandHandler.snappingModule.getLayer():null,r=e instanceof Tyi?r:e.rotateAngle,u=ofi(),g=(afi(u,-r,0,0),e.offsetX,e.offsetY,e.width,e.height,e.pivot.x,e.pivot.y,0),m=0,f=(e instanceof Tyi?e.actualSize:e).width,y=(e instanceof Tyi?e.actualSize:e).height;switch(n){case"ResizeWest":h=(s=rfi(u,{x:h,y:d})).x,d=s.y,m=1,h=p?this.commandHandler.snappingModule.snapLeft(a,l,c,h,d,e,i===t,o):h,d=0,g=(o.width-h)/f;break;case"ResizeEast":h=(s=rfi(u,{x:h,y:d})).x,d=s.y,h=p?this.commandHandler.snappingModule.snapRight(a,l,c,h,d,e,i===t,o):h,d=0,g=(o.width+h)/f,m=1;break;case"ResizeNorth":g=1,h=(s=rfi(u,{x:h,y:d})).x,d=s.y,d=p?this.commandHandler.snappingModule.snapTop(a,l,c,h,d,e,i===t,o):d,m=(o.height-d)/y;break;case"ResizeSouth":g=1,h=(s=rfi(u,{x:h,y:d})).x,d=s.y,d=p?this.commandHandler.snappingModule.snapBottom(a,l,c,h,d,e,i===t,o):d,m=(o.height+d)/y;break;case"ResizeNorthEast":h=(s=rfi(u,{x:h,y:d})).x,d=s.y,h=p?this.commandHandler.snappingModule.snapRight(a,l,c,h,d,e,i===t,o):h,d=p?this.commandHandler.snappingModule.snapTop(a,l,c,h,d,e,i===t,o):d,g=(o.width+h)/f,m=(o.height-d)/y;break;case"ResizeNorthWest":h=(s=rfi(u,{x:h,y:d})).x,d=s.y,d=p?this.commandHandler.snappingModule.snapTop(a,l,c,h,d,e,i===t,o):d,h=p?this.commandHandler.snappingModule.snapLeft(a,l,c,h,d,e,i===t,o):h,g=(o.width-h)/f,m=(o.height-d)/y;break;case"ResizeSouthEast":h=(s=rfi(u,{x:h,y:d})).x,d=s.y,d=p?this.commandHandler.snappingModule.snapBottom(a,l,c,h,d,e,i===t,o):d,h=p?this.commandHandler.snappingModule.snapRight(a,l,c,h,d,e,i===t,o):h,m=(o.height+d)/y,g=(o.width+h)/f;break;case"ResizeSouthWest":h=(s=rfi(u,{x:h,y:d})).x,d=s.y,d=p?this.commandHandler.snappingModule.snapBottom(a,l,c,h,d,e,i===t,o):d,h=p?this.commandHandler.snappingModule.snapLeft(a,l,c,h,d,e,i===t,o):h,g=(o.width-h)/f,m=(o.height+d)/y}return{width:g,height:m}},Bwi.prototype.getPivot=function(e){switch(e){case"ResizeWest":return{x:1,y:.5};case"ResizeEast":return{x:0,y:.5};case"ResizeNorth":return{x:.5,y:1};case"ResizeSouth":return{x:.5,y:0};case"ResizeNorthEast":return{x:0,y:1};case"ResizeNorthWest":return{x:1,y:1};case"ResizeSouthEast":return{x:0,y:0};case"ResizeSouthWest":return{x:1,y:0}}return{x:.5,y:.5}},Bwi.prototype.getShapeType=function(){var e="Image"===this.commandHandler.diagram.drawingObject.shape.type||"HTML"===this.commandHandler.diagram.drawingObject.shape.type||"Native"===this.commandHandler.diagram.drawingObject.shape.type||"Path"===this.commandHandler.diagram.drawingObject.shape.type?this.commandHandler.diagram.drawingObject.shape.type:this.commandHandler.diagram.drawingObject.shape.shape;return e},Bwi.prototype.triggerElementDrawEvent=function(e,t,i,n,o){e={source:e,state:t,objectType:i,cancel:!1,elementType:n};this.commandHandler.triggerEvent(dyi.elementDraw,e),o&&e.cancel&&(this.commandHandler.diagram.resetTool(),this.inAction=!1)},Bwi);function Bwi(e,t){void 0===t&&(t=!1),this.commandHandler=null,this.inAction=!1,this.isProtectChange=!1,this.currentElement=null,this.blocked=!1,this.isTooltipVisible=!1,this.childTable={},this.undoElement={nodes:[],connectors:[]},this.checkProperty=!0,this.undoParentElement={nodes:[],connectors:[]},this.commandHandler=e,this.isProtectChange=t}Hr(Rwi,Fwi=Wr),Rwi.prototype.mouseDown=function(e){this.inAction=!0,Fwi.prototype.mouseDown.call(this,e)},Rwi.prototype.mouseMove=function(e){return Fwi.prototype.mouseMove.call(this,e),this.inAction&&!1===Hmi.equals(this.currentPosition,this.prevPosition)&&(e=tfi.toBounds([this.prevPosition,this.currentPosition]),this.mouseDownElement&&!Vvi(this.mouseDownElement)?this.commandHandler.clearObjectSelection(this.mouseDownElement):(this.commandHandler.clearSelectedItems(),this.commandHandler.drawSelectionRectangle(e.x,e.y,e.width,e.height))),!this.blocked},Rwi.prototype.mouseUp=function(e){var t;this.checkPropertyValue(),this.commandHandler.isUserHandle(this.currentPosition)||(!1===Hmi.equals(this.currentPosition,this.prevPosition)&&this.inAction?(t=tfi.toBounds([this.prevPosition,this.currentPosition]),this.commandHandler.doRubberBandSelection(t)):(t=this.commandHandler.getSelectedObject(),this.commandHandler.hasSelection()&&e.info&&e.info.ctrlKey?e&&e.source&&(this.commandHandler.isSelected(e.source)?1===e.clickCount&&this.commandHandler.unSelect(e.source):this.commandHandler.selectObjects([e.source],!0)):(this.commandHandler.clearSelection(null===e.source),"LabelSelect"===this.action?this.commandHandler.labelSelect(e.source,e.sourceWrapper,t):e.source&&this.commandHandler.selectObjects([e.source],!1,t)))),this.inAction=!1,Fwi.prototype.mouseUp.call(this,e)},Rwi.prototype.mouseLeave=function(e){this.inAction&&this.mouseUp(e)};var Fwi,Lwi=Rwi;function Rwi(e,t,i){e=Fwi.call(this,e,!0)||this;return e.action=i,e}Hr(Vwi,Owi=Wr),Vwi.prototype.mouseUp=function(e){this.checkPropertyValue(),this.inAction=!1;for(var t,i=e.source,n=e.sourceWrapper.id,o=0;o<i.fixedUserHandles.length;o++)-1<n.indexOf(i.fixedUserHandles[parseInt(o.toString(),10)].id)&&(t=i.fixedUserHandles[parseInt(o.toString(),10)]);var r={fixedUserHandle:t,element:e.source},s=dyi.fixedUserHandleClick;this.commandHandler.triggerEvent(s,r),Owi.prototype.mouseUp.call(this,e)};var Owi,Nwi=Vwi;function Vwi(){return null!==Owi&&Owi.apply(this,arguments)||this}Hr(zwi,_wi=Wr),zwi.prototype.mouseDown=function(s){return kwi(this,void 0,void 0,function(){var t,i,n,o,r;return Pwi(this,function(e){if(this.inAction=!0,this.undoElement=void 0,this instanceof tCi||(this.undoElement=DTi(s.source)),_wi.prototype.mouseDown.call(this,s),s.source&&s.source.connectors&&(this.prevPosition.x,this.prevPosition.y,t=s.source.connectors[0],this.oldConnector=DTi(t)),"BezierSourceThumb"===this.endPoint||"BezierTargetThumb"===this.endPoint)for(i=0;i<t.segments.length;i++)n=t.segments[parseInt(i.toString(),10)],o=Hmi.isEmptyPoint(n.point1)?n.bezierPoint1:n.point1,r=Hmi.isEmptyPoint(n.point2)?n.bezierPoint2:n.point2,this.currentElement.handleSize!==t.hitPadding&&(t.hitPadding=this.currentElement.handleSize),(Awi(this.currentPosition,o,t.hitPadding)||Awi(this.currentPosition,r,t.hitPadding))&&(this.selectedSegment=n);return this.currentPosition=s.position,[2]})})},zwi.prototype.mouseUp=function(d){return kwi(this,void 0,void 0,function(){var t,i,n,o,r,s,a,l,h;return Pwi(this,function(e){return!N&&this.isConnected&&d.source.connectors&&(h=d.source.connectors[0],t="ConnectorSourceEnd"===this.endPoint?"sourceID":"targetID",i="ConnectorSourceEnd"===this.endPoint?"sourcePortID":"targetPortID",r={connector:h,oldValue:{nodeId:this.oldConnector[t],portId:this.oldConnector[i]},newValue:{nodeId:h[t],portId:h[i]},cancel:!1,state:"Changed",connectorEnd:this.endPoint},h[t]===this.oldConnector[t]&&h[i]===this.oldConnector[i]||(this.commandHandler.triggerEvent(dyi.connectionChange,r),this.isConnected=!1)),this.checkPropertyValue(),this.commandHandler.updateSelector(),this.commandHandler.removeSnap(),this instanceof tCi||("ConnectorSourceEnd"!==this.endPoint||!d.source.connectors.length||Hmi.equals(d.source.connectors[0].sourcePoint,this.undoElement.connectors[0].sourcePoint)&&d.source.connectors[0].sourceID===this.undoElement.connectors[0].sourceID)&&("ConnectorTargetEnd"!==this.endPoint||Hmi.equals(d.source.connectors[0].targetPoint,this.undoElement.connectors[0].targetPoint)&&d.source.connectors[0].targetID===this.undoElement.connectors[0].targetID)?this instanceof tCi||"BezierTargetThumb"!==this.endPoint&&"BezierSourceThumb"!==this.endPoint||this.undoElement&&d.source&&(a=DTi(d.source),l={type:"SegmentChanged",redoObject:a,undoObject:this.undoElement,category:"Internal"},this.commandHandler.addHistoryEntry(l)):(h=i=t=void 0,d.source&&d.source.connectors&&"ConnectorSourceEnd"===this.endPoint?(t={x:this.oldConnector.sourcePoint.x,y:this.oldConnector.sourcePoint.y},h=d.source.connectors[0],i={x:h.sourcePoint.x,y:h.sourcePoint.y}):d.source&&d.source.connectors&&"ConnectorTargetEnd"===this.endPoint&&(t={x:this.oldConnector.targetPoint.x,y:this.oldConnector.targetPoint.y},h=d.source.connectors[0],i={x:h.targetPoint.x,y:h.targetPoint.y}),o=n=void 0,d.target&&(s=this.commandHandler.findTarget(d.targetWrapper,d.target,"ConnectorSourceEnd"===this.endPoint,!0),o=s.id,s instanceof r0i)&&(n=s.id,o=d.target.id),this.commandHandler.diagram.diagramActions&ryi.ToolAction&&(this.commandHandler.diagram.diagramActions&=~ryi.ToolAction),r={connector:h,state:"Completed",targetNode:o,oldValue:t,newValue:i,cancel:!1,targetPort:n},this.undoElement&&d.source&&(a=void 0,a=DTi(d.source),l={type:"ConnectionChanged",redoObject:DTi(a),undoObject:DTi(this.undoElement),category:"Internal"},this.commandHandler.addHistoryEntry(l)),s="ConnectorSourceEnd"===this.endPoint?dyi.sourcePointChange:dyi.targetPointChange,this.commandHandler.triggerEvent(s,r),this.commandHandler.removeTerminalSegment(h,!0)),this.canCancel=void 0,this.tempArgs=void 0,d.source&&d.source.connectors&&(h=d.source.connectors[0]).isBezierEditing&&(h.isBezierEditing=!1),_wi.prototype.mouseUp.call(this,d),[2]})})},zwi.prototype.mouseMove=function(e){var t,i,n,o,r,s,a,l,h,d,p,c,u,g;return _wi.prototype.mouseMove.call(this,e),this instanceof tCi||!("ConnectorSourceEnd"===this.endPoint&&Hmi.equals(e.source.connectors[0].sourcePoint,this.undoElement.connectors[0].sourcePoint)||"ConnectorTargetEnd"===this.endPoint&&Hmi.equals(e.source.connectors[0].targetPoint,this.undoElement.connectors[0].targetPoint))||(p=r=void 0,n=void(e.source&&e.source.connectors&&(r={x:this.prevPosition.x,y:this.prevPosition.y},p=e.source.connectors[0])),i=void 0,e.target&&(i=e.target.id,(u=this.commandHandler.findTarget(e.targetWrapper,e.target,"ConnectorSourceEnd"===this.endPoint,!0))instanceof r0i||u instanceof Oxi?n=u.id:i=u.id),c="ConnectorSourceEnd"===this.endPoint?dyi.sourcePointChange:dyi.targetPointChange,this.commandHandler.triggerEvent(c,p={connector:p,state:"Start",targetNode:i,oldValue:r,newValue:r,cancel:!1,targetPort:n})),this.currentPosition=e.position,this.currentPosition&&this.prevPosition&&(i=this.currentPosition.x-this.prevPosition.x,n=this.currentPosition.y-this.prevPosition.y,a=s=r=o=void 0,l=void(this.currentPosition=this.commandHandler.snapConnectorEnd(this.currentPosition)),h=void(e.source&&e.source.connectors&&(o={x:this.currentPosition.x,y:this.currentPosition.y},r={x:this.prevPosition.x,y:this.prevPosition.y},l=e.source.connectors[0])),d=void 0,e.target&&((u=this.commandHandler.findTarget(e.targetWrapper,e.target,"ConnectorSourceEnd"===this.endPoint,!0))instanceof r0i?h=u.id:d=u.id),p={connector:l,state:"Progress",targetNode:d,oldValue:r,newValue:o,cancel:!1,targetPort:h},this instanceof tCi||(c="ConnectorSourceEnd"===this.endPoint?dyi.sourcePointChange:dyi.targetPointChange,this.commandHandler.triggerEvent(c,p)),e.target&&(s=h1i(e.target,!0),a=h1i(e.target,!1)),(!p.cancel&&this.inAction&&void 0!==this.endPoint&&0!=i||0!=n)&&(p.cancel||(this.blocked=!this.commandHandler.dragConnectorEnds(this.endPoint,e.source,this.currentPosition,this.selectedSegment,e.target,h),this.commandHandler.updateSelector()),e.target&&("ConnectorSourceEnd"===this.endPoint&&(Gvi(e.target)||Yvi(a))||"ConnectorTargetEnd"===this.endPoint&&(Uvi(e.target)||qvi(s)))?(this.commandHandler.canDisconnect(this.endPoint,e,h,d)&&(t=this.commandHandler.disConnect(e.source,this.endPoint,this.canCancel),this.isConnected=!0),(u=this.commandHandler.findTarget(e.targetWrapper,e.target,"ConnectorSourceEnd"===this.endPoint,!0))instanceof MIi?(Uvi(u)&&"ConnectorTargetEnd"===this.endPoint||Gvi(u)&&"ConnectorSourceEnd"===this.endPoint)&&(t=this.commandHandler.connect(this.endPoint,e,this.canCancel),this.isConnected=!0):this.checkConnect(u)&&(this.isConnected=!0,t=this.commandHandler.connect(this.endPoint,e,this.canCancel))):-1===this.endPoint.indexOf("Bezier")&&(this.isConnected=!0,t=this.commandHandler.disConnect(e.source,this.endPoint,this.canCancel),this.commandHandler.updateSelector())),this.commandHandler.canEnableDefaultTooltip()&&(g=this.getTooltipContent(e.position),this.commandHandler.showTooltip(e.source,e.position,ao(function(){return g}),"ConnectTool",this.isTooltipVisible),this.isTooltipVisible=!1),t)&&(this.tempArgs=t),this.prevPosition=this.currentPosition,!this.blocked},zwi.prototype.mouseLeave=function(e){this.mouseUp(e)},zwi.prototype.getTooltipContent=function(e){return"X:"+Math.round(e.x)+" Y:"+Math.round(e.y)},zwi.prototype.checkConnect=function(e){return!(!qvi(e)||"ConnectorTargetEnd"!==this.endPoint)||!(!Yvi(e)||"ConnectorSourceEnd"!==this.endPoint)||!(e.constraints&pyi.None||qvi(e)||Yvi(e))&&(void 0===e.constraints||0<(e.constraints&(pyi.Default&~(pyi.InConnect|pyi.OutConnect))))},zwi.prototype.endAction=function(){_wi.prototype.endAction.call(this),this.prevPosition=null,this.endPoint=null};var _wi,Hwi=zwi;function zwi(e,t){e=_wi.call(this,e,!0)||this;return e.isConnected=!1,e.endPoint=t,e}Hr(Qwi,jwi=Wr),Qwi.prototype.mouseDown=function(e){var t;e.source instanceof MIi||e.source instanceof ISi?(t=this.commandHandler.getSelectedObject(),this.commandHandler.selectObjects([e.source],e.info&&e.info.ctrlKey,t),t={nodes:[],connectors:[]},(e.source instanceof MIi?t.nodes:t.connectors).push(DTi(e.source)),this.undoElement=DTi(t),t=e.source.wrapper,this.undoElement.offsetX=t.offsetX,this.undoElement.offsetY=t.offsetY):this.undoElement=DTi(e.source),this.undoParentElement=this.commandHandler.getSubProcess(e.source),"Port"===this.objectType&&(this.portId=e.sourceWrapper.id),this.commandHandler.insertBlazorConnector(e.source),jwi.prototype.mouseDown.call(this,e),this.initialOffset={x:0,y:0}},Qwi.prototype.getPort=function(e){for(var t,i=e.source.id,n=e.source.ports,o=0;o<n.length;o++)if(e.sourceWrapper.id===i+"_"+n[parseInt(o.toString(),10)].id){t=n[parseInt(o.toString(),10)];break}return t},Qwi.prototype.mouseUp=function(T,E){return kwi(this,void 0,void 0,function(){var t,i,n,o,r,s,a,l,h,d,p,c,u,g,m,f,y,v,b,w,C,S,A,x,I;return Pwi(this,function(e){if(this.checkPropertyValue(),o=!1,r={nodes:[],connectors:[]},"Port"!==this.objectType){if(T.source instanceof MIi||T.source instanceof ISi?((T.source instanceof MIi?r.nodes:r.connectors).push(DTi(T.source)),n=DTi(r),s=T.source.wrapper,n.offsetX=s.offsetX,n.offsetY=s.offsetY):n=DTi(T.source),"helper"===(s=this.commandHandler.renderContainerHelper(T.source)||T.source||this.commandHandler.renderContainerHelper(T.source)).id||"helper"!==s.id){if(a=!1,s instanceof qIi&&(l=DTi(s)).selectedObjects.length===this.undoElement.selectedObjects.length)for(x=0;x<l.selectedObjects.length;x++)if(l.selectedObjects[parseInt(x.toString(),10)].id!==this.undoElement.selectedObjects[parseInt(x.toString(),10)].id){a=!0;break}if(h=s instanceof qIi,b=s instanceof qIi&&s.selectedObjects&&1===s.selectedObjects.length,m=s instanceof qIi&&Math.round(s.width)===Math.round(this.undoElement.width)&&Math.round(s.height)===Math.round(this.undoElement.height),d=s.offsetX!==this.undoElement.offsetX||s.offsetY!==this.undoElement.offsetY,p=s.sourcePoint!==this.undoElement.sourcePoint,c=s.targetPoint!==this.undoElement.targetPoint,!a&&(h&&(m||b)||!h)&&(d||p||c)||this.isSelectionHasConnector(s)){if(T.source&&(i={offsetX:T.source.wrapper.offsetX,offsetY:T.source.wrapper.offsetY},t={offsetX:T.source.wrapper.offsetX,offsetY:T.source.wrapper.offsetY}),I={source:T.source,state:"Completed",oldValue:this.intialValue,newValue:i,target:this.currentTarget,targetPosition:this.currentPosition,allowDrop:!0,cancel:!1},I={source:T.source,state:"Completed",oldValue:this.intialValue,newValue:i,target:this.currentTarget,targetPosition:this.currentPosition,allowDrop:I.allowDrop,cancel:I.cancel},u=!0,"helper"===s.id)if(this.canTrigger){if((1<n.nodes.length||1<n.connectors.length)&&this.commandHandler.diagram.lineRoutingModule&&this.commandHandler.diagram.constraints&$fi.LineRouting){for(g=this.commandHandler.diagram.nameTable,x=0;x<n.nodes.length;x++)if(!g[n.nodes[parseInt(x.toString(),10)].parentId]||!g[n.nodes[parseInt(x.toString(),10)].parentId].isLane){u=!1;break}}else u=!0;this.commandHandler.triggerEvent(dyi.positionChange,I),this.connectorEndPointChangeEvent(I)}else u=!1;else this.commandHandler.triggerEvent(dyi.positionChange,I),this.connectorEndPointChangeEvent(I);!E&&u&&(this.commandHandler.startGroupAction(),o=!0,w={type:"PositionChanged",redoObject:DTi(n),undoObject:DTi(this.undoElement),category:"Internal"},n.nodes[0]&&n.nodes[0].processId&&(m={type:"SizeChanged",category:"Internal",undoObject:this.undoParentElement,redoObject:this.commandHandler.getSubProcess(T.source)},this.commandHandler.addHistoryEntry(m)),this.commandHandler.addHistoryEntry(w))}}if(this.commandHandler.snapPoint(this.prevPosition,this.currentPosition,0,0),this.commandHandler.removeSnap(),this.commandHandler.removeHighlighter(),T.source&&this.currentTarget&&Kvi(this.currentTarget)&&this.commandHandler.isDroppable(T.source,this.currentTarget)){if(f=!0,this.commandHandler.drop(this.currentElement,this.currentTarget,this.currentPosition),this.currentTarget&&this.currentTarget instanceof ISi&&!0===this.commandHandler.diagram.enableConnectorSplit)if(this.currentElement&&this.currentElement instanceof MIi){if(void 0!==this.currentElement.children)for(x=0;x<this.currentElement.children.length;x++)this.currentElement.children[parseInt(x.toString(),10)]!==this.currentTarget.sourceID&&this.currentElement.children[parseInt(x.toString(),10)]!==this.currentTarget.targetID||(f=!1);else this.currentElement.id!==this.currentTarget.sourceID&&this.currentElement.id!==this.currentTarget.targetID||(f=!1);f&&this.commandHandler.connectorSplit(this.currentElement,this.currentTarget)}else if(this.currentElement instanceof qIi&&!this.commandHandler.PreventConnectorSplit){if(this.currentElement.nodes[0].children)for(x=0;x<this.currentElement.nodes[0].children.length;x++)this.currentElement.nodes[0].children[parseInt(x.toString(),10)]!==this.currentTarget.sourceID&&this.currentElement.nodes[0].children[parseInt(x.toString(),10)]!==this.currentTarget.targetID||(f=!1);else this.currentElement.nodes[0].id!==this.currentTarget.sourceID&&this.currentElement.nodes[0].id!==this.currentTarget.targetID||(f=!1);f&&(this.commandHandler.connectorSplit(this.currentElement.nodes[0],this.currentTarget),this.commandHandler.PreventConnectorSplit=!1)}if(I={element:T.source,target:this.currentTarget,position:this.currentPosition,cancel:!1},this.commandHandler.triggerEvent(dyi.drop,I),!I.cancel&&T.source&&this.commandHandler.isParentAsContainer(this.currentTarget)&&!this.commandHandler.isTargetSubProcess(this.currentTarget)){for(y=T.source instanceof qIi?T.source.nodes:[T.source],v=!1,x=0;x<y.length&&y[0].parentId===y[parseInt(x.toString(),10)].parentId;x++);for(this.commandHandler.diagram.selectedItems.nodes.length!==y.length&&(y=this.commandHandler.diagram.selectedItems.nodes),1<this.commandHandler.diagram.selectedItems.nodes.length?(y=this.calculateDiff(this.commandHandler.diagram.selectedItems,this.currentTarget,this.commandHandler.diagram),this.commandHandler.diagram.multiselect=!0):this.commandHandler.diagram.multiselect=!1,x=0;x<y.length;x++)y[parseInt(x.toString(),10)].container||this.commandHandler.diagram.cancelPositionChange||(v=!0,this.commandHandler.updateLaneChildrenZindex(y[parseInt(x.toString(),10)],this.currentTarget),this.commandHandler.dropChildToContainer(this.currentTarget,y[parseInt(x.toString(),10)]),this.commandHandler.renderContainerHelper(y[parseInt(x.toString(),10)]));1<y.length&&(b=this.commandHandler.diagram.nameTable.helper)&&ywi(this.currentTarget,b,this.commandHandler.diagram),o&&this.commandHandler.isContainer&&v&&this.commandHandler.endGroupAction()}}T.source&&this.currentTarget&&this.commandHandler.dropAnnotation(T.source,this.currentTarget),this.commandHandler.updateSelector(),o&&!this.commandHandler.isContainer&&this.commandHandler.endGroupAction()}else{if(r.nodes.push(DTi(T.source)),T.portId=this.portId,n=DTi(r),w={type:"PortPositionChanged",objectId:this.portId,redoObject:DTi(n),undoObject:DTi(this.undoElement),category:"Internal"},this.commandHandler.addHistoryEntry(w),C=this.getPort(T)){for(S=0<this.undoElement.nodes.length?this.undoElement.nodes[0].ports:[],A=0<this.undoElement.connectors.length?this.undoElement.connectors[0].ports:[],x=0;x<S.length;x++)if(C.id===S[parseInt(x.toString(),10)].id){t={offsetX:S[parseInt(x.toString(),10)].offset.x,offsetY:S[parseInt(x.toString(),10)].offset.y},i={offsetX:C.offset.x,offsetY:C.offset.y};break}for(x=0;x<A.length;x++)if(C.id===A[parseInt(x.toString(),10)].id){t={offset:A[parseInt(x.toString(),10)].offset},i={offset:C.offset};break}}I={source:C,state:"Completed",oldValue:t,newValue:i,target:this.currentTarget,targetPosition:this.currentPosition,allowDrop:!0,cancel:!1},this.commandHandler.triggerEvent(dyi.positionChange,I)}return jwi.prototype.mouseUp.call(this,T),[2]})})},Qwi.prototype.clearDiff=function(e){e.forEach(function(e,t){delete e.diffX,delete e.diffY})},Qwi.prototype.calculateDiff=function(e,t,i){this.clearDiff(e.nodes);var n,o,r=e.wrapper.bounds.left,s=e.wrapper.bounds.top,a=t.wrapper.bounds.left,l=t.wrapper.bounds.top,i=i.nameTable[t.parentId],t=(0===t.columnIndex&&i&&"Horizontal"===i.shape.orientation&&(a+=50),1===t.rowIndex&&i&&"Vertical"===i.shape.orientation&&(l+=50),n=r<a?a-r:0,o=s<l?l-s:0,e.nodes);return t.forEach(function(e,t){e.diffX=n,e.diffY=o}),t},Qwi.prototype.connectorEndPointChangeEvent=function(e,t){var i=e.source;if(i instanceof qIi&&0<i.nodes.length)for(var n=0;n<i.nodes.length;n++){var o=i.nodes[parseInt(n.toString(),10)];if(o&&0<o.inEdges.length)for(var r=0;r<o.inEdges.length;r++){var s=this.commandHandler.diagram.getObject(o.inEdges[parseInt(r.toString(),10)]);this.triggerEndPointEvent(s,e,t,"targetPointChange")}if(o&&0<o.outEdges.length)for(r=0;r<o.outEdges.length;r++){s=this.commandHandler.diagram.getObject(o.outEdges[parseInt(r.toString(),10)]);this.triggerEndPointEvent(s,e,t,"sourcePointChange")}}},Qwi.prototype.triggerEndPointEvent=function(e,t,i,n){e={connector:e,state:t.state,targetNode:e.targetID,targetPort:e.targetPortID,sourceNode:e.sourceID,sourcePort:e.sourcePortID,oldValue:{x:e.targetPoint.x,y:e.targetPoint.y},newValue:{x:e.targetPoint.x+(i?i.x:0),y:e.targetPoint.y+(i?i.y:0)},cancel:t.cancel};this.commandHandler.triggerEvent("targetPointChange"===n?dyi.targetPointChange:dyi.sourcePointChange,e)},Qwi.prototype.isSelectionHasConnector=function(e){return!(!(e.nodes&&e.connectors&&0<e.nodes.length&&0<e.connectors.length)||e.width===this.undoElement.width&&e.height===this.undoElement.height)},Qwi.prototype.mouseMove=function(e){jwi.prototype.mouseMove.call(this,e);var t,i=!1,n=this.commandHandler.renderContainerHelper(e.source)||e.source,o=(n instanceof MIi||n instanceof ISi?n instanceof MIi?n.offsetX===this.undoElement.nodes[0].offsetX&&n.offsetY===this.undoElement.nodes[0].offsetY&&(i=!0):Hmi.equals(n.sourcePoint,this.undoElement.connectors[0].sourcePoint)&&Hmi.equals(n.targetPoint,this.undoElement.connectors[0].targetPoint)&&(i=!0):n.wrapper.offsetX===this.undoElement.wrapper.offsetX&&n.wrapper.offsetY===this.undoElement.wrapper.offsetY&&(i=!0),{source:n,state:"Start",oldValue:t=n?{offsetX:n.wrapper.offsetX,offsetY:n.wrapper.offsetY}:t,newValue:t,target:e.target,targetPosition:e.position,allowDrop:!0,cancel:!1}),o={source:n,state:"Start",oldValue:t,newValue:t,target:e.target,targetPosition:e.position,allowDrop:o.allowDrop,cancel:o.cancel};if("Port"===this.objectType){if(f=this.getPort(e)){for(var r=0<this.undoElement.nodes.length?this.undoElement.nodes[0].ports:[],s=0<this.undoElement.connectors.length?this.undoElement.connectors[0].ports:[],a=0;a<r.length;a++)if(t={offsetX:f.offset.x,offsetY:f.offset.y},f.offset.x!==r[parseInt(a.toString(),10)].offset.x||f.offset.y!==r[parseInt(a.toString(),10)].offset.y){i=!1;break}for(a=0;a<s.length;a++)if(t={offset:f.offset},f.offset!==s[parseInt(a.toString(),10)].offset){i=!1;break}}o={source:f,state:"Start",oldValue:t,newValue:t,target:e.target,targetPosition:e.position,allowDrop:!0,cancel:!1}}if(!this.isStartAction&&(this.intialValue={offsetX:n.wrapper.offsetX,offsetY:n.wrapper.offsetY},this.commandHandler.diagram.lineRoutingModule)&&this.commandHandler.diagram.constraints&$fi.LineRouting&&"ComplexHierarchicalTree"!==this.commandHandler.diagram.layout.type){var l=ETi(n.wrapper);l.Inflate(40);for(var h=0,d=this.commandHandler.diagram.spatialSearch.findObjects(l);h<d.length;h++){var p=d[h];p instanceof ISi&&this.commandHandler.diagram.routedConnectors.indexOf(p.id)}}if(i&&!N&&(this.commandHandler.triggerEvent(dyi.positionChange,o),this.connectorEndPointChangeEvent(o),this.isStartAction=!0),this.commandHandler.diagram.cancelPositionChange=o.cancel,this.currentPosition=e.position,"Port"!==this.objectType){this.currentPosition.x,this.prevPosition.x,this.currentPosition.y,this.prevPosition.y;var c,l=this.initialOffset.x+(this.currentPosition.x-this.prevPosition.x),o=this.initialOffset.y+(this.currentPosition.y-this.prevPosition.y),u=(this.commandHandler.dragOverElement(e,this.currentPosition),this.commandHandler.disConnect(e.source),this.commandHandler.removeSnap(),void 0),g=this.commandHandler.snapPoint(this.prevPosition,this.currentPosition,l,o),l=(this.initialOffset.x=l-g.x,this.initialOffset.y=o-g.y,n&&(y={offsetX:n.wrapper.offsetX,offsetY:n.wrapper.offsetY},u={offsetX:n.wrapper.offsetX+g.x,offsetY:n.wrapper.offsetY+g.y}),this.currentTarget&&e.target!==this.currentTarget&&this.commandHandler.removeChildFromBPmn(e.source,e.target,this.currentTarget),this.currentTarget=e.target,{source:n,state:"Progress",oldValue:y,newValue:u,target:e.target,targetPosition:e.position,allowDrop:!0,cancel:!1});this.commandHandler.triggerEvent(dyi.positionChange,l),this.commandHandler.diagram.cancelPositionChange=l.cancel,this.canTrigger=!0,this.connectorEndPointChangeEvent(l,g),l.cancel||this.canCancel||(this.blocked=!this.commandHandler.dragSelectedObjects(g.x,g.y),o=!this.commandHandler.mouseOver(this.currentElement,this.currentTarget,this.currentPosition),this.blocked=this.blocked||o),this.commandHandler.removeStackHighlighter(),this.commandHandler.renderStackHighlighter(e),this.currentTarget&&e.source!==this.currentTarget&&this.commandHandler.isDroppable(e.source,this.currentTarget)&&"helper"!==e.source.id?(n=e.source instanceof qIi?e.source.nodes[0]:e.source,this.commandHandler.isParentAsContainer(n,!0)||"SwimLane"===n.shape.type||n.shape.isPhase||(this.currentTarget.isLane?this.commandHandler.renderStackHighlighter(e,this.currentTarget):this.commandHandler.drawHighlighter(this.currentTarget))):this.commandHandler.removeHighlighter(),this.commandHandler.canEnableDefaultTooltip()&&(c=this.getTooltipContent(e.source),this.commandHandler.showTooltip(e.source,e.position,ao(function(){return c}),"MoveTool",this.isTooltipVisible),this.isTooltipVisible=!1)}else{var m,f,y=ofi(),l=e.source,u=void 0,r=0<this.undoElement.nodes.length?this.undoElement.nodes[0].ports:[],s=0<this.undoElement.connectors.length?this.undoElement.connectors[0].ports:[];if(f=this.getPort(e)){for(a=0;a<r.length;a++){m={offsetX:f.offset.x,offsetY:f.offset.y};break}for(a=0;a<s.length;a++){m={offset:f.offset};break}}afi(y,-l.rotateAngle||-l.wrapper.rotateAngle,l.offsetX||l.wrapper.offsetX,l.offsetY||l.wrapper.offsetY);g=rfi(y,{x:this.prevPosition.x,y:this.prevPosition.y}),o=rfi(y,{x:e.position.x,y:e.position.y});if(this.commandHandler.portDrag(e.source,e.sourceWrapper,o.x-g.x,o.y-g.y),f){for(a=0;a<r.length;a++){u={offsetX:f.offset.x,offsetY:f.offset.y};break}for(a=0;a<s.length;a++){u={offset:f.offset};break}}n={source:f,state:"Progress",oldValue:m,newValue:u,target:e.target,targetPosition:e.position,allowDrop:!0,cancel:!1};this.commandHandler.triggerEvent(dyi.positionChange,n)}return this.prevPosition=this.currentPosition,!this.blocked},Qwi.prototype.getTooltipContent=function(e){return"X:"+Math.round(e.wrapper.bounds.x)+" Y:"+Math.round(e.wrapper.bounds.y)},Qwi.prototype.mouseLeave=function(e){this.mouseUp(e)},Qwi.prototype.endAction=function(){jwi.prototype.endAction.call(this),this.currentTarget=null,this.prevPosition=null};var jwi,Wwi=Qwi;function Qwi(e,t){e=jwi.call(this,e,!0)||this;return e.currentTarget=null,e.isStartAction=!1,e.canCancel=!1,e.canTrigger=!1,e.objectType=t,e}Hr(Gwi,Uwi=Wr),Gwi.prototype.mouseDown=function(e){if(this.undoElement=DTi(e.source),this.undoElement.nodes[0]&&this.undoElement.nodes[0].children)for(var t=this.commandHandler.getAllDescendants(this.undoElement.nodes[0],[]),i=0;i<t.length;i++){var n=this.commandHandler.cloneChild(t[parseInt(i.toString(),10)].id);this.childTable[t[parseInt(i.toString(),10)].id]=DTi(n)}Uwi.prototype.mouseDown.call(this,e)},Gwi.prototype.mouseUp=function(n){return kwi(this,void 0,void 0,function(){var t,i;return Pwi(this,function(e){return this.checkPropertyValue(),t=this.commandHandler.renderContainerHelper(n.source)||n.source,this.undoElement.rotateAngle!==t.wrapper.rotateAngle&&(i={rotateAngle:this.undoElement.rotateAngle},t={rotateAngle:t.wrapper.rotateAngle},i={source:n.source,state:"Completed",oldValue:i,newValue:t,cancel:!1},this.commandHandler.triggerEvent(dyi.rotateChange,i),t=DTi(n.source),i={type:"RotationChanged",redoObject:DTi(t),undoObject:DTi(this.undoElement),category:"Internal",childTable:this.childTable},this.commandHandler.addHistoryEntry(i),this.commandHandler.updateSelector(),this.rotateStart=!1),this.canCancel=void 0,this.tempArgs=void 0,Uwi.prototype.mouseUp.call(this,n),[2]})})},Gwi.prototype.mouseMove=function(e){Uwi.prototype.mouseMove.call(this,e),t=this.commandHandler.renderContainerHelper(e.source)||e.source,this.undoElement.rotateAngle!==t.wrapper.rotateAngle||this.rotateStart||(n={rotateAngle:t.wrapper.rotateAngle},n={source:e.source,state:"Start",oldValue:n,newValue:n,cancel:!1},this.commandHandler.triggerEvent(dyi.rotateChange,n),this.rotateStart=!0),this.currentPosition=e.position;var t,i,n={x:t.wrapper.offsetX,y:t.wrapper.offsetY},n=Hmi.findAngle(n,this.currentPosition)+90,o=this.commandHandler.snapAngle(n),r={rotateAngle:t.wrapper.rotateAngle},o={rotateAngle:n=((0!==o?o:n)+360)%360},s=(e.source,!1),r={source:e.source,state:"Progress",oldValue:r,newValue:o,cancel:s};return this.commandHandler.triggerEvent(dyi.rotateChange,r),r.cancel||(this.blocked=!this.commandHandler.rotateSelectedItems(n-t.wrapper.rotateAngle)),this.commandHandler.canEnableDefaultTooltip()&&(i=this.getTooltipContent(e.source),this.commandHandler.showTooltip(e.source,e.position,ao(function(){return i}),"RotateTool",this.isTooltipVisible),this.isTooltipVisible=!1),!this.blocked},Gwi.prototype.getTooltipContent=function(e){return Math.round(e.rotateAngle%360).toString()+"°"},Gwi.prototype.mouseLeave=function(e){this.mouseUp(e)},Gwi.prototype.endAction=function(){Uwi.prototype.endAction.call(this)};var Uwi,qwi=Gwi;function Gwi(e){e=Uwi.call(this,e,!0)||this;return e.rotateStart=!1,e}Hr(Kwi,Ywi=Wr),Kwi.prototype.mouseDown=function(e){if(this.undoElement=DTi(e.source),this.undoParentElement=this.commandHandler.getSubProcess(e.source),Ywi.prototype.mouseDown.call(this,e),this.undoElement.nodes[0]&&this.undoElement.nodes[0].children)for(var t=this.commandHandler.getAllDescendants(this.undoElement.nodes[0],[]),i=0;i<t.length;i++){var n=this.commandHandler.cloneChild(t[parseInt(i.toString(),10)].id);this.childTable[t[parseInt(i.toString(),10)].id]=DTi(n)}this.commandHandler.checkSelection(e.source,this.corner),Ywi.prototype.mouseDown.call(this,e),this.initialBounds.x=e.source.wrapper.offsetX,this.initialBounds.y=e.source.wrapper.offsetY,this.initialBounds.height=e.source.wrapper.actualSize.height,this.initialBounds.width=e.source.wrapper.actualSize.width},Kwi.prototype.mouseUp=function(n,o){return kwi(this,void 0,void 0,function(){var t,i;return Pwi(this,function(e){return this.checkPropertyValue(),this.commandHandler.removeSnap(),this.commandHandler.updateSelector(),i=this.commandHandler.renderContainerHelper(n.source)||n.source,this.undoElement.offsetX===i.wrapper.offsetX&&this.undoElement.offsetY===i.wrapper.offsetY&&this.undoElement.width===i.wrapper.bounds.width&&this.undoElement.height===i.wrapper.bounds.height||(t=this.updateSize(n.source,this.currentPosition,this.prevPosition,this.corner,this.initialBounds),this.blocked=this.scaleObjects(t.width,t.height,this.corner,this.currentPosition,this.prevPosition,i),t={width:n.source.wrapper.actualSize.width,height:n.source.wrapper.actualSize.height},i={source:n.source,state:"Completed",oldValue:this.startValues,newValue:t,cancel:!1},this.commandHandler.triggerEvent(dyi.sizeChange,i),t=DTi(n.source),i={type:"SizeChanged",redoObject:DTi(t),undoObject:DTi(this.undoElement),category:"Internal",childTable:this.childTable},this.resizeStart=!1,o)||(this.commandHandler.startGroupAction(),this.commandHandler.addHistoryEntry(i),t.nodes[0]&&t.nodes[0].processId&&(i={type:"SizeChanged",redoObject:this.commandHandler.getSubProcess(n.source),undoObject:this.undoParentElement,category:"Internal"},this.commandHandler.addHistoryEntry(i)),this.commandHandler.endGroupAction()),Ywi.prototype.mouseUp.call(this,n),[2,!this.blocked]})})},Kwi.prototype.mouseMove=function(e){Ywi.prototype.mouseMove.call(this,e),t=this.commandHandler.renderContainerHelper(e.source)||e.source,this.undoElement.offsetX!==t.wrapper.offsetX||this.undoElement.offsetY!==t.wrapper.offsetY||this.resizeStart||(n={width:e.source.wrapper.actualSize.width,height:e.source.wrapper.actualSize.height},this.startValues=n,n={source:e.source,state:"Start",oldValue:n,newValue:this.currentElement,cancel:!1},this.commandHandler.triggerEvent(dyi.sizeChange,n),this.resizeStart=!0),this.currentPosition=e.position;var t,i,n=this.currentPosition.x-this.startPosition.x,o=this.currentPosition.y-this.startPosition.y,n=HTi(-this.currentElement.wrapper.rotateAngle,void 0,void 0,{x:n,y:o}),o=(this.currentElement.wrapper.actualSize.width,n.x,this.currentElement.wrapper.actualSize.width,this.currentElement.wrapper.actualSize.height,n.y,this.currentElement.wrapper.actualSize.height,this.getChanges(n),this.commandHandler.removeSnap(),this.updateSize(e.source,this.startPosition,this.currentPosition,this.corner,this.initialBounds));return this.blocked=!this.scaleObjects(o.width,o.height,this.corner,this.startPosition,this.currentPosition,t),this.commandHandler.canEnableDefaultTooltip()&&(i=this.getTooltipContent(e.source),this.commandHandler.showTooltip(e.source,e.position,ao(function(){return i}),"ResizeTool",this.isTooltipVisible),this.isTooltipVisible=!1),this.prevPosition=this.currentPosition,!this.blocked},Kwi.prototype.mouseLeave=function(e){this.mouseUp(e)},Kwi.prototype.getTooltipContent=function(e){return"W:"+Math.round(e.wrapper.bounds.width)+" H:"+Math.round(e.wrapper.bounds.height)},Kwi.prototype.getChanges=function(e){switch(this.corner){case"ResizeEast":return{x:e.x,y:0};case"ResizeSouthEast":return e;case"ResizeSouth":return{x:0,y:e.y};case"ResizeNorth":return{x:0,y:-e.y};case"ResizeNorthEast":return{x:e.x,y:-e.y};case"ResizeNorthWest":return{x:-e.x,y:-e.y};case"ResizeWest":return{x:-e.x,y:0};case"ResizeSouthWest":return{x:-e.x,y:e.y}}return e},Kwi.prototype.scaleObjects=function(e,t,i,n,o,r){r instanceof qIi&&1===r.nodes.length&&r.nodes[0].constraints&Kfi.AspectRatio&&("ResizeWest"===i||"ResizeEast"===i||"ResizeNorth"===i||"ResizeSouth"===i?1===t&&1===e||(t=e=Math.max(1===t?0:t,1===e?0:e)):t=e=Math.max(t,e));var i={width:r.width,height:r.height},s=(this.blocked=this.commandHandler.scaleSelectedItems(e,t,this.getPivot(this.corner)),{width:r.width,height:r.height}),r={source:r,state:"Progress",oldValue:i,newValue:s,cancel:{source:r,state:"Progress",oldValue:i,newValue:s,cancel:!1}.cancel};return this.commandHandler.triggerEvent(dyi.sizeChange,r),(r.cancel||this.canCancel)&&this.commandHandler.scaleSelectedItems(1/e,1/t,this.getPivot(this.corner)),this.blocked};var Ywi,Xwi=Kwi;function Kwi(e,t){e=Ywi.call(this,e,!0)||this;return e.resizeStart=!1,e.initialBounds=new tfi,e.canCancel=!1,e.corner=t,e}Hr($wi,Jwi=Wr),$wi.prototype.mouseDown=function(e){Jwi.prototype.mouseDown.call(this,e),this.inAction=!0,this.commandHandler.setFocus(),this.triggerElementDrawEvent(e.source,"Start","Node",this.getShapeType(),!0)},$wi.prototype.mouseMove=function(e){Jwi.prototype.mouseMove.call(this,e);var t,e={offsetX:this.currentPosition.x,width:3,height:3,offsetY:this.currentPosition.y};return this.drawingObject||(this.drawingObject=this.commandHandler.drawObject(e)),this.triggerElementDrawEvent(this.drawingObject,"Progress","Node",this.getShapeType(),!1),this.inAction&&!1===Hmi.equals(this.currentPosition,this.prevPosition)&&(e=tfi.toBounds([this.prevPosition,this.currentPosition]),t=this.commandHandler.checkBoundaryConstraints(void 0,void 0,e))&&this.commandHandler.updateNodeDimension(this.drawingObject,e),t},$wi.prototype.mouseUp=function(e){this.checkPropertyValue();var t=tfi.toBounds([this.prevPosition,this.currentPosition]);this.commandHandler.checkBoundaryConstraints(void 0,void 0,t);this.drawingObject&&this.drawingObject instanceof MIi&&(this.commandHandler.addObjectToDiagram(this.drawingObject),this.triggerElementDrawEvent(this.drawingObject,"Completed","Node",this.getShapeType(),!1),this.drawingObject=null),Jwi.prototype.mouseUp.call(this,e),this.inAction=!1},$wi.prototype.endAction=function(){Jwi.prototype.endAction.call(this)},$wi.prototype.mouseLeave=function(e){this.inAction&&this.mouseUp(e)};var Jwi,Zwi=$wi;function $wi(e,t){e=Jwi.call(this,e,!0)||this;return e.sourceObject=t,e}Hr(iCi,eCi=Hwi),iCi.prototype.mouseDown=function(t){return kwi(this,void 0,void 0,function(){return Pwi(this,function(e){return eCi.prototype.mouseDown.call(this,t),this.inAction=!0,this.commandHandler.setFocus(),this.triggerElementDrawEvent(t.source,"Start","Connector",this.commandHandler.diagram.drawingObject.type,!0),[2]})})},iCi.prototype.mouseMove=function(e){var t;return this.commandHandler.enableServerDataBinding(!1),this.inAction&&(t={sourcePoint:this.currentPosition,targetPoint:this.currentPosition},this.drawingObject||(this.drawingObject=this.commandHandler.drawObject(t)),e.source=this.drawingObject,this.triggerElementDrawEvent(e.source,"Progress","Connector",this.drawingObject.type,!1),e.actualObject&&(e.actualObject.parentId||e.actualObject.children)&&""===this.drawingObject.sourceID&&this.setTarget(e),(e.target&&e.target instanceof MIi||e.actualObject&&e.sourceWrapper&&E1i(e.actualObject,e.sourceWrapper))&&("ConnectorTargetEnd"!==this.endPoint||Uvi(e.target))&&this.commandHandler.connect(this.endPoint,e),this.endPoint="ConnectorTargetEnd"),this.inAction||(this.commandHandler.updateSelector(),e.source&&!e.source.isLane&&e.sourceWrapper&&this.commandHandler.renderHighlighter(e,!0)),eCi.prototype.mouseMove.call(this,e),this.commandHandler.enableServerDataBinding(!0),!this.blocked},iCi.prototype.setTarget=function(e){e.target?e.sourceWrapper.id.includes(e.target.id)||e.target.parentId&&e.sourceWrapper.id.includes(e.target.parentId)&&(e.target=this.commandHandler.diagram.nameTable[e.target.parentId]):e.sourceWrapper.id.includes(e.actualObject.id)?e.target=e.actualObject:e.actualObject.parentId&&e.sourceWrapper.id.includes(e.actualObject.parentId)&&(e.target=this.commandHandler.diagram.nameTable[e.actualObject.parentId])},iCi.prototype.mouseUp=function(t){return kwi(this,void 0,void 0,function(){return Pwi(this,function(e){return this.commandHandler.enableServerDataBinding(!1),this.checkPropertyValue(),this.drawingObject&&this.drawingObject instanceof ISi&&(this.commandHandler.addObjectToDiagram(this.drawingObject),this.triggerElementDrawEvent(this.drawingObject,"Completed","Connector",this.drawingObject.type,!1),this.drawingObject=null),this.inAction=!1,this.commandHandler.enableServerDataBinding(!0),eCi.prototype.mouseUp.call(this,t),[2]})})},iCi.prototype.endAction=function(){eCi.prototype.endAction.call(this)},iCi.prototype.mouseLeave=function(e){this.inAction&&this.mouseUp(e)};var eCi,tCi=iCi;function iCi(e,t,i){e=eCi.call(this,e,t)||this;return e.sourceObject=i,e}Hr(rCi,nCi=Wr),rCi.prototype.mouseDown=function(e){nCi.prototype.mouseDown.call(this,e),this.commandHandler.clearSelection();var t={shape:{type:"Text"},offsetX:this.currentPosition.x,offsetY:this.currentPosition.y};e.source||(this.drawingNode=this.commandHandler.drawObject(t))},rCi.prototype.mouseMove=function(e){return nCi.prototype.mouseMove.call(this,e),this.drawingNode?this.drawingNode.style.strokeColor="black":(e={shape:{type:"Text"},offsetX:this.currentPosition.x,width:30,height:30,offsetY:this.currentPosition.y},this.drawingNode=this.commandHandler.drawObject(e)),this.drawingNode.style.strokeDashArray="2 2",this.drawingNode.style.fill="transparent",this.inAction&&!1===Hmi.equals(this.currentPosition,this.prevPosition)&&(e=tfi.toBounds([this.prevPosition,this.currentPosition]),this.commandHandler.updateNodeDimension(this.drawingNode,e)),!this.blocked},rCi.prototype.mouseUp=function(e){this.checkPropertyValue(),this.drawingNode?(this.drawingNode.style.strokeColor="none",this.drawingNode.style.fill="none"):this.drawingNode=e.source,this.drawingNode&&this.drawingNode instanceof MIi&&this.commandHandler.addText(this.drawingNode,this.currentPosition),nCi.prototype.mouseUp.call(this,e),this.inAction=!1},rCi.prototype.endAction=function(){nCi.prototype.endAction.call(this)};var nCi,oCi=rCi;function rCi(e){return nCi.call(this,e,!0)||this}Hr(lCi,sCi=Wr),lCi.prototype.mouseDown=function(e){sCi.prototype.mouseDown.call(this,e),this.inAction=!0,this.commandHandler.setBlazorDiagramProps(!0)},lCi.prototype.mouseMove=function(e){var t,i,n,o,r;return sCi.prototype.mouseMove.call(this,e),this.inAction&&(this.zooming||!1!==Hmi.equals(this.currentPosition,this.prevPosition)?e.moveTouches&&e.moveTouches.length&&2<=e.moveTouches.length&&(t=e.startTouches[0],i=e.startTouches[1],n=e.moveTouches[0],o=e.moveTouches[1],r=this.getDistance(n,o)/this.getDistance(t,i),e=e.position,1!=r&&this.commandHandler.zoom(r,0,0,e),this.updateTouch(t,n),this.updateTouch(i,o)):(r=this.currentPosition.x-this.prevPosition.x,e=this.currentPosition.y-this.prevPosition.y,this.commandHandler.scroll(r,e,this.currentPosition))),this.commandHandler.dataBinding(),!this.blocked},lCi.prototype.mouseUp=function(e){this.commandHandler.setBlazorDiagramProps(!1),this.checkPropertyValue(),this.commandHandler.updatePanState(!1),sCi.prototype.mouseUp.call(this,e),this.inAction=!1},lCi.prototype.endAction=function(){sCi.prototype.endAction.call(this)},lCi.prototype.getDistance=function(e,t){var i=t.pageX-e.pageX,t=t.pageY-e.pageY;return Math.sqrt(i*i+t*t)},lCi.prototype.updateTouch=function(e,t){e.pageX=t.pageX,e.pageY=t.pageY};var sCi,aCi=lCi;function lCi(e,t){e=sCi.call(this,e)||this;return e.zooming=t,e}Hr(pCi,hCi=Wr),pCi.prototype.mouseUp=function(e){this.checkPropertyValue(),this.commandHandler.initExpand(e),hCi.prototype.mouseUp.call(this,e)};var hCi,dCi=pCi;function pCi(e){return hCi.call(this,e,!0)||this}Hr(gCi,cCi=Wr),gCi.prototype.mouseUp=function(e){this.checkPropertyValue();var t="_blank",i="",n=window.innerHeight,o=window.innerWidth,r=window.screenTop,s=window.screenLeft;"CurrentTab"===e.sourceWrapper.hyperlink.hyperlinkOpenState?t="_self":"NewWindow"===e.sourceWrapper.hyperlink.hyperlinkOpenState&&(i="height="+n+",width="+o+",top="+r+",left="+s),window.open(e.sourceWrapper.hyperlink.link,t,i).focus(),cCi.prototype.mouseUp.call(this,e)};var cCi,uCi=gCi;function gCi(e){return cCi.call(this,e,!0)||this}Hr(yCi,mCi=Wr),yCi.prototype.mouseDown=function(e){var t,i;mCi.prototype.mouseDown.call(this,e),this.inAction=!0,this.drawingObject?(t=void 0,t={x:(t=(i=this.drawingObject.shape).points[i.points.length-1]).x,y:t.y},this.drawingObject.shape.points.push(t)):(this.startPoint={x:this.startPosition.x,y:this.startPosition.y},i={offsetX:this.currentPosition.x,offsetY:this.currentPosition.y,width:5,height:5,shape:{type:"Basic",shape:"Polygon",points:[{x:this.startPoint.x,y:this.startPoint.y},{x:this.currentPosition.x,y:this.currentPosition.y}]}},this.triggerElementDrawEvent(e.source,"Start","Node",this.getShapeType(),!0),this.drawingObject=this.commandHandler.drawObject(i))},yCi.prototype.mouseMove=function(e){return mCi.prototype.mouseMove.call(this,e),this.inAction&&((e=this.drawingObject.shape).points[e.points.length-1].x=this.currentPosition.x,e.points[e.points.length-1].y=this.currentPosition.y,this.drawingObject.wrapper.children[0].data=Umi(this.drawingObject.shape.points),this.triggerElementDrawEvent(this.drawingObject,"Progress","Node",this.getShapeType(),!1),this.inAction)&&!1===Hmi.equals(this.currentPosition,this.prevPosition)&&(e=tfi.toBounds(this.drawingObject.shape.points),this.commandHandler.updateNodeDimension(this.drawingObject,e)),!0},yCi.prototype.mouseUp=function(e,t){this.checkPropertyValue(),mCi.prototype.mouseMove.call(this,e),this.inAction&&(this.inAction=!1,this.commandHandler.addObjectToDiagram(this.drawingObject),this.triggerElementDrawEvent(this.drawingObject,"Completed","Node",this.getShapeType(),!1)),this.endAction()},yCi.prototype.mouseWheel=function(e){mCi.prototype.mouseWheel.call(this,e),this.mouseMove(e)},yCi.prototype.endAction=function(){this.inAction=!1,this.drawingObject=null};var mCi,fCi=yCi;function yCi(e){return mCi.call(this,e,!0)||this}Hr(wCi,vCi=Wr),wCi.prototype.mouseMove=function(e){return vCi.prototype.mouseMove.call(this,e),this.inAction&&((e=this.drawingObject).targetPoint=this.currentPosition,this.triggerElementDrawEvent(this.drawingObject,"Progress","Connector",this.commandHandler.diagram.drawingObject.type,!1),this.commandHandler.updateConnectorPoints(e)),!0},wCi.prototype.mouseDown=function(e){var t,i;vCi.prototype.mouseDown.call(this,e),this.inAction=!0,this.drawingObject?(i=this.drawingObject,(t=new eSi(i,"segments",{type:"Straight"},!(t=void 0))).point=this.currentPosition,i.segments[i.segments.length-1]=t):(i={id:"Connector",type:"Straight",sourcePoint:this.currentPosition,targetPoint:this.currentPosition},this.triggerElementDrawEvent(e.source,"Start","Connector",this.commandHandler.diagram.drawingObject.type,!0),this.inAction&&(this.drawingObject=this.commandHandler.drawObject(i)))},wCi.prototype.mouseWheel=function(e){vCi.prototype.mouseWheel.call(this,e),this.mouseMove(e)},wCi.prototype.mouseUp=function(e){this.checkPropertyValue(),vCi.prototype.mouseMove.call(this,e),this.inAction&&this.drawingObject&&((e=this.drawingObject).segments[e.segments.length-1].point={x:0,y:0},this.commandHandler.addObjectToDiagram(this.drawingObject),this.triggerElementDrawEvent(this.drawingObject,"Completed","Connector",this.commandHandler.diagram.drawingObject.type,!1)),this.endAction()},wCi.prototype.endAction=function(){this.drawingObject=null,this.inAction=!1};var vCi,bCi=wCi;function wCi(e){return vCi.call(this,e,!0)||this}Hr(ACi,CCi=Wr),ACi.prototype.mouseDown=function(e){this.inAction=!0,this.undoElement=DTi(e.source),this.annotationId=e.sourceWrapper.id,CCi.prototype.mouseDown.call(this,e)},ACi.prototype.mouseMove=function(e){CCi.prototype.mouseMove.call(this,e);var t,i=this.currentPosition.x-this.prevPosition.x,n=this.currentPosition.y-this.prevPosition.y,o=e.source;return o instanceof MIi&&(afi(t=ofi(),-o.rotateAngle,0,0),i=(o=rfi(t,{x:i,y:n})).x,n=o.y),this.inAction&&(this.commandHandler.labelDrag(e.source,e.sourceWrapper,i,n),this.commandHandler.updateSelector()),this.prevPosition=this.currentPosition,!this.blocked},ACi.prototype.mouseUp=function(e){this.checkPropertyValue();var t=e.source,t=(this.inAction=!1,{type:"AnnotationPropertyChanged",objectId:this.annotationId,undoObject:DTi(this.undoElement),category:"Internal",redoObject:DTi(t)});this.commandHandler.addHistoryEntry(t),CCi.prototype.mouseUp.call(this,e)},ACi.prototype.mouseLeave=function(e){this.mouseUp(e)};var CCi,SCi=ACi;function ACi(e){return CCi.call(this,e,!0)||this}Hr(TCi,xCi=Wr),TCi.prototype.mouseDown=function(e){this.inAction=!0;var t=(e.source.nodes.length?e.source.nodes:e.source.connectors)[0],t=(this.annotationId=e.source.wrapper.children[0].id,this.undoElement=DTi(t),e.source.wrapper.children[0]);this.initialBounds={x:t.offsetX,y:t.offsetY,width:t.actualSize.width,height:t.actualSize.height},xCi.prototype.mouseDown.call(this,e)},TCi.prototype.mouseMove=function(e){return xCi.prototype.mouseMove.call(this,e),this.inAction&&this.resizeObject(e),!this.blocked},TCi.prototype.mouseUp=function(e){this.checkPropertyValue();var t=(e.source.nodes.length?e.source.nodes:e.source.connectors)[0],t=(this.inAction=!1,{type:"AnnotationPropertyChanged",objectId:this.annotationId,redoObject:DTi(t),undoObject:DTi(this.undoElement),category:"Internal"});this.commandHandler.addHistoryEntry(t),xCi.prototype.mouseUp.call(this,e)},TCi.prototype.mouseLeave=function(e){this.mouseUp(e)},TCi.prototype.resizeObject=function(e){var t=(e.source.nodes.length?e.source.nodes:e.source.connectors)[0],i=e.source.wrapper.children[0],n={x:i.offsetX,y:i.offsetY},o=i.rotateAngle,r=(o=((o+=t instanceof MIi?t.rotateAngle:0)+360)%360,ofi()),n=(afi(r,o,n.x,n.y),this.corner.slice(5)),o=this.updateSize(i,this.startPosition,this.currentPosition,n,this.initialBounds,o),s=i.offsetX-i.actualSize.width*i.pivot.x,a=i.offsetY-i.actualSize.height*i.pivot.y,n=this.getPivot(n),r=rfi(r,{x:s+i.actualSize.width*n.x,y:a+i.actualSize.height*n.y});o.x=r.x,o.y=r.y,s=o.width,a=o.height,this.commandHandler.labelResize(t,e.source.annotation,s<0?1:s,a<0?1:a,o,e.source),this.commandHandler.updateSelector()};var xCi,ICi=TCi;function TCi(e,t){e=xCi.call(this,e,!0)||this;return e.corner=t,e}Hr(MCi,ECi=Wr),MCi.prototype.mouseDown=function(e){this.inAction=!0,this.annotationId=e.source.wrapper.children[0].id;var t=(e.source.nodes.length?e.source.nodes:e.source.connectors)[0];this.undoElement=DTi(t),ECi.prototype.mouseDown.call(this,e)},MCi.prototype.mouseMove=function(e){var t,i;return ECi.prototype.mouseMove.call(this,e),e.source&&this.inAction&&(t=e.source.nodes[0]||e.source.connectors[0],i=void 0,i=e.source.annotation,this.commandHandler.labelRotate(t,i,this.currentPosition,e.source),this.commandHandler.updateSelector()),this.prevPosition=this.currentPosition,!this.blocked},MCi.prototype.mouseUp=function(e){this.checkPropertyValue(),this.inAction=!1;var t=(e.source.nodes.length?e.source.nodes:e.source.connectors)[0],t={type:"AnnotationPropertyChanged",objectId:this.annotationId,redoObject:DTi(t),undoObject:DTi(this.undoElement),category:"Internal"};this.commandHandler.addHistoryEntry(t),ECi.prototype.mouseUp.call(this,e)},MCi.prototype.mouseLeave=function(e){this.mouseUp(e)};var ECi,DCi=MCi;function MCi(e){return ECi.call(this,e,!0)||this}Hr(BCi,kCi=Wr),BCi.prototype.mouseMove=function(e){var t,i;return kCi.prototype.mouseMove.call(this,e),this.inAction&&(t=this.drawingObject.shape,i=this.currentPosition,t.points.push(i),this.drawingObject.wrapper.children[0].data=qmi(this.drawingObject.shape.points),t.data=qmi(t.points),this.triggerElementDrawEvent(e.source,"Progress","Connector",this.drawingObject.type,!1),this.inAction)&&!1===Hmi.equals(this.currentPosition,this.prevPosition)&&(i=tfi.toBounds(this.drawingObject.shape.points),this.commandHandler.updateNodeDimension(this.drawingObject,i)),!0},BCi.prototype.mouseDown=function(e){kCi.prototype.mouseDown.call(this,e),this.inAction=!0,this.startPoint={x:this.startPosition.x,y:this.startPosition.y};var t={offsetX:this.currentPosition.x,offsetY:this.currentPosition.y,width:5,height:5,style:{strokeColor:"black",strokeWidth:1,fill:"transparent"},shape:{type:"Path",points:[{x:this.startPoint.x,y:this.startPoint.y},{x:this.currentPosition.x,y:this.currentPosition.y}]}};this.triggerElementDrawEvent(e.source,"Start","Connector",this.commandHandler.diagram.drawingObject.type,!0),this.drawingObject=this.commandHandler.drawObject(t)},BCi.prototype.mouseUp=function(e){this.checkPropertyValue();var t,i,n;this.inAction&&(this.inAction=!1,i=(t=this.drawingObject.shape).points,this.commandHandler.addObjectToDiagram(this.drawingObject),n=this.drawingObject.id,n=this.commandHandler.diagram.nameTable[""+n],this.commandHandler.diagram.remove(n),i=this.pointReduction(i,10),n={},void 0===(n=this.commandHandler.diagram.drawingObject.bezierSettings?this.commandHandler.diagram.drawingObject.bezierSettings:n).allowSegmentsReset&&(n.allowSegmentsReset=!1),n={id:"newConnector"+xTi(),type:"Bezier",sourcePoint:{x:i[0].x,y:i[0].y},targetPoint:{x:i[i.length-1].x,y:i[i.length-1].y},segments:[],bezierSettings:n},this.drawingObject=this.commandHandler.drawObject(n),this.drawingObject=this.bezierCurveSmoothness(i,.5,this.drawingObject,t),this.commandHandler.updateConnectorPoints(this.drawingObject),this.commandHandler.addObjectToDiagram(this.drawingObject),this.triggerElementDrawEvent(this.drawingObject,"Completed","Connector",this.commandHandler.diagram.drawingObject.type,!1),kCi.prototype.mouseUp.call(this,e))},BCi.prototype.pointReduction=function(t,e){if(null===t||t.length<3)return t;var i=t.length-1,n=[];for(n.push(0),n.push(i);t[parseInt(0..toString(),10)]===t[parseInt(i.toString(),10)];)i--;this.reduction(t,0,i,e,n);var o=[];return n.sort(function(e,t){return e-t}),n.forEach(function(e){o.push(t[parseInt(e.toString(),10)])}),o},BCi.prototype.reduction=function(e,t,i,n,o){for(var r=0,s=0,a=t;a<i;a++){var l=this.perpendicularDistance(e[parseInt(t.toString(),10)],e[parseInt(i.toString(),10)],e[parseInt(a.toString(),10)]);r<l&&(r=l,s=a)}n<r&&0!==s&&(o.push(s),this.reduction(e,t,s,n,o),this.reduction(e,s,i,n,o))},BCi.prototype.perpendicularDistance=function(e,t,i){return Math.abs(.5*(e.x*t.y-t.x*e.y+(t.x*i.y-i.x*t.y)+(i.x*e.y-e.x*i.y)))/Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))*2},BCi.prototype.bezierCurveSmoothness=function(e,t,i,n){if(!(e.length<3))for(var o=0;o<e.length-1;o++){var r=e[parseInt(o.toString(),10)].x,s=e[parseInt(o.toString(),10)].y,a=e[o+1].x,l=e[o+1].y,h=void 0,d=void 0,p=(d=(0===o?(h=(p=e[parseInt(o.toString(),10)]).x,p):(h=e[o-1].x,e[o-1])).y,void 0),c=void 0,u=(c=(o===e.length-2?(p=(u=e[o+1]).x,u):(p=e[o+2].x,e[o+2])).y,(h+r)/2),g=(d+s)/2,m=(r+a)/2,f=(s+l)/2,y=(a+p)/2,v=(l+c)/2,b={},w={},C={},S={},h=(b.x=h,b.y=d,w.x=r,w.y=s,C.x=a,C.y=l,S.x=p,S.y=c,Hmi.findLength(b,w)),d=Hmi.findLength(w,C),c=h/(h+d),b=d/(d+Hmi.findLength(C,S)),w=u+(m-u)*c,h=g+(f-g)*c,d=m+(y-m)*b,C=f+(v-f)*b,S=w+(m-w)*t+r-w,g=h+(f-h)*t+s-h,c=d+(m-d)*t+a-d,y=C+(f-C)*t+l-C,v=new nSi(n,"segments",{type:"Bezier"},!0),b={x:S,y:g},w={x:c,y:y},h={x:r,y:s},m={x:a,y:l};v.type="Bezier",i.segments[parseInt(o.toString(),10)]=v,0===o&&(b={x:r,y:s}),o===e.length-2&&(w={x:a,y:l}),i.segments[parseInt(o.toString(),10)].vector1={angle:K0i(h,b),distance:Hmi.findLength(h,b)},i.segments[parseInt(o.toString(),10)].vector2={angle:K0i(m,w),distance:Hmi.findLength(m,w)},i.segments[parseInt(o.toString(),10)].point=m}return i};var kCi,PCi=BCi;function BCi(e){return kCi.call(this,e,!0)||this}function FCi(e){if(e)switch(e.type){case"Bpmn":return XCi;case"UmlActivity":return qCi;case"UmlClassifier":return wSi;default:return WCi}return WCi}function LCi(e){if(e)switch(e.type){case"Straight":return eSi;case"Bezier":return nSi;case"Orthogonal":return sSi;default:return eSi}}RCi=function(e,t){return(RCi=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])}))(e,t)};var RCi,OCi,qr=function(e,t){function i(){this.constructor=e}RCi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},l9=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},qY=(qr(NCi,OCi=n),l9([e(10)],NCi.prototype,"width",void 0),l9([e(10)],NCi.prototype,"height",void 0),l9([e("Arrow")],NCi.prototype,"shape",void 0),l9([t({fill:"black",strokeColor:"black",strokeWidth:1},XNt)],NCi.prototype,"style",void 0),l9([t({x:0,y:.5},Hmi)],NCi.prototype,"pivot",void 0),l9([e("")],NCi.prototype,"pathData",void 0),NCi);function NCi(){return null!==OCi&&OCi.apply(this,arguments)||this}qr(_Ci,VCi=n),l9([e(0)],_Ci.prototype,"angle",void 0),l9([e(0)],_Ci.prototype,"distance",void 0);var VCi,HY=_Ci;function _Ci(){return null!==VCi&&VCi.apply(this,arguments)||this}qr(zCi,HCi=n),l9([e(uyi.All)],zCi.prototype,"controlPointsVisibility",void 0),l9([e("FreeForm")],zCi.prototype,"segmentEditOrientation",void 0),l9([e(gyi.Default)],zCi.prototype,"smoothness",void 0),l9([e(!0)],zCi.prototype,"allowSegmentsReset",void 0);var HCi,jY=zCi;function zCi(){return null!==HCi&&HCi.apply(this,arguments)||this}qr(QCi,jCi=n),l9([e("None")],QCi.prototype,"type",void 0);var jCi,WCi=QCi;function QCi(){return null!==jCi&&jCi.apply(this,arguments)||this}qr(GCi,UCi=WCi),l9([e("Object")],GCi.prototype,"flow",void 0),l9([e(30)],GCi.prototype,"exceptionFlowHeight",void 0);var UCi,qCi=GCi;function GCi(){return null!==UCi&&UCi.apply(this,arguments)||this}qr(KCi,YCi=WCi),l9([e("Sequence")],KCi.prototype,"flow",void 0),l9([e("Normal")],KCi.prototype,"sequence",void 0),l9([e("Default")],KCi.prototype,"message",void 0),l9([e("Default")],KCi.prototype,"association",void 0);var YCi,XCi=KCi;function KCi(){return null!==YCi&&YCi.apply(this,arguments)||this}qr(ZCi,JCi=n),l9([e("Straight")],ZCi.prototype,"type",void 0),l9([e(!0)],ZCi.prototype,"allowDrag",void 0);var JCi,lX=ZCi;function ZCi(e,t,i,n){e=JCi.call(this,e,t,i,n)||this;return e.points=[],e}qr(tSi,$Ci=lX),tSi.prototype.getClassName=function(){return"StraightSegment"},l9([t({x:0,y:0},Hmi)],tSi.prototype,"point",void 0);var $Ci,eSi=tSi;function tSi(){return null!==$Ci&&$Ci.apply(this,arguments)||this}qr(oSi,iSi=eSi),oSi.prototype.getClassName=function(){return"BezierSegment"},oSi.prototype.getPoints=function(e,t){var i=[];return(0<i.length||null!=t)&&(t=0<i.length?i[i.length-1]:t,t=this.bezireToPoly(t,e),i.push.apply(i,t)),i},oSi.prototype.bezireToPoly=function(e,t){var i,n,o=[];return t&&(i=t.bezierPoint1,n=t.bezierPoint2,t={x:t.points[1].x,y:t.points[1].y},this.flattenCubicBezier(o,e,i,n,t,10)),o},oSi.prototype.flattenCubicBezier=function(e,t,i,n,o,r){for(var s=(Hmi.findLength(t,i)+Hmi.findLength(i,n)+Hmi.findLength(n,o))/r,a=0;a<=s;a++){var l=a/s,h=(1-l)*(1-l)*(1-l)*t.x+3*l*(1-l)*(1-l)*i.x+3*l*l*(1-l)*n.x+l*l*l*o.x,l=(1-l)*(1-l)*(1-l)*t.y+3*l*(1-l)*(1-l)*i.y+3*l*l*(1-l)*n.y+l*l*l*o.y;e.push({x:h,y:l})}},l9([e("Horizontal")],oSi.prototype,"orientation",void 0),l9([t({x:0,y:0},Hmi)],oSi.prototype,"point1",void 0),l9([t({x:0,y:0},Hmi)],oSi.prototype,"point2",void 0),l9([t({angle:0,distance:0},HY)],oSi.prototype,"vector1",void 0),l9([t({angle:0,distance:0},HY)],oSi.prototype,"vector2",void 0);var iSi,nSi=oSi;function oSi(){return null!==iSi&&iSi.apply(this,arguments)||this}qr(aSi,rSi=lX),aSi.prototype.getClassName=function(){return"OrthogonalSegment"},l9([e(null)],aSi.prototype,"length",void 0),l9([e(null)],aSi.prototype,"direction",void 0);var rSi,sSi=aSi;function aSi(){return null!==rSi&&rSi.apply(this,arguments)||this}qr(hSi,lSi=n),hSi.prototype.getClassName=function(){return"DiagramConnectorSegment"},l9([e("Straight")],hSi.prototype,"type",void 0),l9([e(!0)],hSi.prototype,"allowDrag",void 0),l9([t({x:0,y:0},Hmi)],hSi.prototype,"point",void 0),l9([t({x:0,y:0},Hmi)],hSi.prototype,"point1",void 0),l9([t({x:0,y:0},Hmi)],hSi.prototype,"point2",void 0),l9([t({angle:0,distance:0},HY)],hSi.prototype,"vector1",void 0),l9([t({angle:0,distance:0},HY)],hSi.prototype,"vector2",void 0),l9([e(null)],hSi.prototype,"length",void 0),l9([e(null)],hSi.prototype,"direction",void 0);var lSi,zK=hSi;function hSi(){return null!==lSi&&lSi.apply(this,arguments)||this}function dSi(e,t,i){var n=e.center,i=i?45:180/(2+2/(e.height/e.width)),e=i,o=180-i,r=o+2*i,i=360-i,t=K0i(t,n);return e<t&&t<o?"top":o<t&&t<r?"right":r<t&&t<i?"bottom":"left"}function pSi(e){return!e.distance&&!e.angle}function cSi(e,t,i){var n=60,o={x:0,y:0};switch(i=i||(Math.abs(t.x-e.x)>Math.abs(t.y-e.y)?e.x<t.x?"right":"left":e.y<t.y?"bottom":"top")){case"bottom":case"top":n=Math.min(.45*Math.abs(e.y-t.y),n),o={x:e.x,y:e.y+("bottom"===i?n:-n)};break;case"right":case"left":n=Math.min(.45*Math.abs(e.x-t.x),n),o={x:e.x+("right"===i?n:-n),y:e.y}}return o}function uSi(e,t,i,n,o){var r=0,s=0,a=0,l=0,h=Number((o.distance(t,e)+o.distance(i,t)+o.distance(n,i))/3);if(0!==h)for(var d=0;d<=h;d++){var p=d/h,c=(1-p)*(1-p)*(1-p)*e.x+3*p*(1-p)*(1-p)*t.x+3*p*p*(1-p)*i.x+p*p*p*n.x,p=(1-p)*(1-p)*(1-p)*e.y+3*p*(1-p)*(1-p)*t.y+3*p*p*(1-p)*i.y+p*p*p*n.y;0===d?(r=a=c,s=l=p):(r=Math.min(c,r),s=Math.min(p,s),a=Math.max(c,a),l=Math.max(p,l))}return{x:r,y:s,width:a-r,height:l-s,left:r,top:s,right:r+(a-r),bottom:s+(l-s),center:{x:(r+(a-r))/2,y:(s+(l-s))/2}}}function gSi(e,t,i,n,o,r,s){var a={x:0,y:0},r=r/s,s=(1-r)*(1-r)*(1-r)*t.x+3*r*(1-r)*(1-r)*i.x+3*r*r*(1-r)*n.x+r*r*r*o.x,s=(a.x=s,(1-r)*(1-r)*(1-r)*t.y+3*r*(1-r)*(1-r)*i.y+3*r*r*(1-r)*n.y+r*r*r*o.y);return a.y=s,a}qr(fSi,mSi=n),l9([e(!0)],fSi.prototype,"optional",void 0),l9([e(void 0)],fSi.prototype,"lowerBounds",void 0),l9([e(void 0)],fSi.prototype,"upperBounds",void 0);var mSi,UK=fSi;function fSi(){return null!==mSi&&mSi.apply(this,arguments)||this}qr(vSi,ySi=n),l9([e("OneToOne")],vSi.prototype,"type",void 0),l9([t({},UK)],vSi.prototype,"target",void 0),l9([t({},UK)],vSi.prototype,"source",void 0);var ySi,XK=vSi;function vSi(){return null!==ySi&&ySi.apply(this,arguments)||this}qr(CSi,bSi=WCi),l9([e("UmlClassifier")],CSi.prototype,"type",void 0),l9([e("Aggregation")],CSi.prototype,"relationship",void 0),l9([e("Directional")],CSi.prototype,"associationType",void 0),l9([t({},XK)],CSi.prototype,"multiplicity",void 0);var bSi,wSi=CSi;function CSi(){return null!==bSi&&bSi.apply(this,arguments)||this}qr(ASi,SSi=n),l9([e("None")],ASi.prototype,"type",void 0),l9([e("Directional")],ASi.prototype,"associationType",void 0),l9([e("Aggregation")],ASi.prototype,"relationship",void 0),l9([t({},XK)],ASi.prototype,"multiplicity",void 0),l9([e("Sequence")],ASi.prototype,"bpmnFlow",void 0),l9([e("Default")],ASi.prototype,"message",void 0),l9([e("Normal")],ASi.prototype,"sequence",void 0),l9([e("Default")],ASi.prototype,"association",void 0),l9([e("Object")],ASi.prototype,"umlActivityFlow",void 0),l9([e(30)],ASi.prototype,"exceptionFlowHeight",void 0);var SSi,$K=ASi;function ASi(){return null!==SSi&&SSi.apply(this,arguments)||this}qr(TSi,xSi=mP),TSi.prototype.setPortID=function(e,t){if(this.targetID&&this.sourceID)for(var i,n=e.nameTable[this.targetID],e=e.nameTable[this.sourceID],o=t?n&&n.ports:e&&e.ports,r=0;o&&r<o.length;r++)i=o[parseInt(r.toString(),10)],this.targetPortID===i.id&&t?!(i.constraints&pyi.None)&&i.constraints&pyi.InConnect||(this.targetPortID=""):this.sourcePortID!==i.id||t||!(i.constraints&pyi.None)&&i.constraints&pyi.OutConnect||(this.sourcePortID="")},TSi.prototype.init=function(e){this.id||(this.id=xTi()),this.sourcePortID&&this.setPortID(e),this.targetPortID&&this.setPortID(e,!0);var t,i=new Vyi,n=((r=new kyi).id=this.id+"_path",new kyi),o=new kyi,r=this.getSegmentElement(this,r),s="Bezier"===this.type?this.intermediatePoints:this.getConnectorPoints(this.type),a=(s=this.clipDecorators(this,s),tfi.toBounds(s));switch(i.width=a.width,i.height=a.height,i.offsetX=a.x+i.pivot.x*a.width,i.offsetY=a.y+i.pivot.y*a.height,this.shape.type){case"Bpmn":switch(this.shape.flow){case"Sequence":t=this.getBpmnSequenceFlow();break;case"Association":(t=new kyi).visible=!1,this.getBpmnAssociationFlow();break;case"Message":t=this.getBpmnMessageFlow(),r=this.getSegmentElement(this,r),this.updateShapePosition(this,t)}break;case"UmlActivity":switch(this.shape.flow){case"Object":this.getUMLObjectFlow();break;case"Exception":this.getUMLExceptionFlow(r)}break;case"UmlClassifier":this.getConnectorRelation()}var l,h,d=this.intermediatePoints,p=("Bezier"===this.type&&(l=this.segments[0],h=this.segments[this.segments.length-1],d=[Hmi.isEmptyPoint(h.point2)?h.bezierPoint2:h.point2,Hmi.isEmptyPoint(l.point1)?l.bezierPoint1:l.point1]),e.getDescription),n=this.getDecoratorElement(s[0],d[1],this.sourceDecorator,!0,p),o=this.getDecoratorElement(s[s.length-1],d[d.length-2],this.targetDecorator,!1,p);n.id=this.id+"_srcDec",o.id=this.id+"_tarDec",r.style=this.style,r.style.fill="transparent",void 0!==p&&(h=p(this,e),r.description=h||this.id),i.style.strokeColor="transparent",i.style.fill="transparent",i.style.strokeWidth=0,i.children=[r,n,o],i.id=this.id,void 0!==t&&i.children.push(t),i.offsetX=r.offsetX,i.offsetY=r.offsetY,i.width=r.width,i.height=r.height;for(var c=0;this.annotations,c<this.annotations.length;c++)i.children.push(this.getAnnotationElement(this.annotations[parseInt(c.toString(),10)],this.intermediatePoints,a,p,e.element.id,e.annotationTemplate));for(c=0;this.fixedUserHandles,c<this.fixedUserHandles.length;c++)i.children.push(this.getFixedUserHandle(this.fixedUserHandles[parseInt(c.toString(),10)],this.intermediatePoints,a,e.fixedUserHandleTemplate,e.element.id));return this.initPorts(p,i,a),this.wrapper=i},TSi.prototype.initPorts=function(e,t,i){for(var n=0;this.ports,n<this.ports.length;n++)t.children.push(this.initPort(this.ports[parseInt(n.toString(),10)],this.intermediatePoints,i,e))},TSi.prototype.initPort=function(e,t,i,n){var o,r=new kyi,s=(r.height=e.height,r.width=e.width,r.margin=e.margin,e.shape=e.shape||"Square","Custom"===e.shape?e.pathData:C0i(e.shape)),s=(r.data=s,r.horizontalAlignment=e.horizontalAlignment,r.verticalAlignment=e.verticalAlignment,r=this.initPortWrapper(e,t,i,r,this),jTi(n));return s&&(o=s(r,this)),r.description=o||r.id,r.elementActions=r.elementActions|Jfi.ElementIsPort,r.isPathPort=!0,r},TSi.prototype.initPortWrapper=function(e,t,i,n,o){e.id=e.id||xTi();var r={x:0,y:0},s=PAi(t,e),a=s.point,l=(n.id=this.id+"_"+e.id,e.style);n.style={fill:l.fill,strokeColor:l.strokeColor,gradient:null,opacity:l.opacity,strokeDashArray:l.strokeDashArray,strokeWidth:l.strokeWidth},0===i.width&&(i.width=this.style.strokeWidth),0===i.height&&(i.height=this.style.strokeWidth);var h,d,l=(a.x-i.x)/i.width,a=(a.y-i.y)/i.height,l=(r.x=i.width*l,r.y=i.height*a,OAi(e,s.angle,t)),i=l.hAlign,a=l.vAlign;return"left"===i?(h="Left",r.x+=e.displacement.x):"right"===i?(h="Right",r.x-=e.displacement.x):"center"===i&&(h="Center"),"top"===a?(d="Top",r.y+=e.displacement.y):"bottom"===a?(d="Bottom",r.y-=e.displacement.y):"center"===a&&(d="Center"),n.horizontalAlignment=h,n.verticalAlignment=d,(n=o&&"Label"!==o.flipMode&&"None"!==o.flipMode?x1i(n,this.flip,e):x1i(n,"None",e)).float=!0,n.connectionDirection=e.connectionDirection,n.setOffsetWithRespectToBounds(r.x,r.y,"Absolute"),n.relativeMode="Point",n.visible=!(!s1i(e,Wfi.Visible)||s1i(e,Wfi.Hover)||s1i(e,Wfi.Connect)),n.elementActions=n.elementActions|Jfi.ElementIsPort,n},TSi.prototype.getConnectorRelation=function(){var e=this.shape,t=("Association"===e.relationship?(this.segments[0].type="Straight",this.sourceDecorator.shape="None",this.targetDecorator.shape="Arrow"):"Inheritance"===e.relationship?(this.segments[0].type="Orthogonal",this.sourceDecorator.shape="None",this.targetDecorator.shape="Arrow"):"Composition"===e.relationship||"Aggregation"===e.relationship?(this.segments[0].type="Orthogonal",this.sourceDecorator.shape="Diamond",this.targetDecorator.shape="None"):"Dependency"===e.relationship?(this.segments[0].type="Orthogonal",this.sourceDecorator.shape="None",this.targetDecorator.shape="OpenArrow"):"Realization"===e.relationship&&(this.segments[0].type="Orthogonal",this.sourceDecorator.shape="None",this.targetDecorator.shape="Arrow"),"BiDirectional"===e.associationType&&(this.sourceDecorator.shape="None",this.targetDecorator.shape="None"),""),i="",n=(e.multiplicity.source&&(e.multiplicity.source.lowerBounds=e.multiplicity.source.lowerBounds,e.multiplicity.source.upperBounds=e.multiplicity.source.upperBounds),e.multiplicity.target&&(e.multiplicity.target.lowerBounds=e.multiplicity.target.lowerBounds,e.multiplicity.target.upperBounds=e.multiplicity.target.upperBounds),e.multiplicity.source),o=e.multiplicity.target,n=n.upperBounds?n.lowerBounds+"..."+n.upperBounds:n.lowerBounds,o=o.upperBounds?o.lowerBounds+"..."+o.upperBounds:o.lowerBounds;"ManyToOne"===e.multiplicity.type&&(e.multiplicity.target.optional=!1,t=n||"*",i="1"),"OneToMany"===e.multiplicity.type&&(e.multiplicity.source.optional=!1,i=o||"*",t="1"),"ManyToMany"===e.multiplicity.type&&(t=n||"*",i=o||"*"),"OneToOne"===e.multiplicity.type&&(e.multiplicity.target.optional=!1,e.multiplicity.source.optional=!1,i=t="1"),this.annotations=[{id:this.id+"sourcelabel",content:t,offset:0,alignment:"Before",margin:{right:5,bottom:5}},{id:this.id+"targetlabel",content:i,offset:1,alignment:"Before",margin:{right:5,bottom:5}}]},TSi.prototype.getBpmnSequenceFlow=function(){var e=new kyi,t=new kyi;return"Normal"===this.shape.sequence&&"Bezier"!==this.type&&(this.targetDecorator.shape="Arrow"),"Default"===this.shape.sequence&&(e=this.getSegmentElement(this,e),e=this.intermediatePoints,t=I1i(e,this),this.targetDecorator.shape="Arrow"),"Conditional"===this.shape.sequence&&(this.targetDecorator.shape="Arrow",this.sourceDecorator.shape="Diamond",t.id=this.id+this.shape.type),t},TSi.prototype.getUMLObjectFlow=function(){if(this.annotations)for(var e=0;e<this.annotations.length;e++)this.annotations[parseInt(e.toString(),10)].content="["+this.annotations[parseInt(e.toString(),10)].content+"]"},TSi.prototype.getUMLExceptionFlow=function(e){this.type="Straight";var t=this.shape.exceptionFlowHeight/2,i={x:(this.targetPoint.x+this.sourcePoint.x)/2,y:(this.targetPoint.y+this.sourcePoint.y)/2},n=i.x-this.sourcePoint.x,o=i.y-this.sourcePoint.y,t=t/Math.sqrt(n*n+o*o),r={x:i.x-n*t,y:i.y-o*t},n={x:i.x+n*t,y:i.y+o*t},o=ofi(),t=(afi(o,315,i.x,i.y),this.segments=[],new eSi(this,"segments",{type:"Straight",point:rfi(o,n)},!0));this.segments.push(t),t=new eSi(this,"segments",{type:"Straight",point:rfi(o,r)},!0),this.segments.push(t),this.getSegmentElement(this,e)},TSi.prototype.getBpmnAssociationFlow=function(){"Default"===this.shape.association&&(this.targetDecorator.shape="None",this.style.strokeDashArray="2 2"),"Directional"===this.shape.association&&(this.targetDecorator.shape="OpenArrow",this.style.strokeDashArray="2 2"),"BiDirectional"===this.shape.association&&(this.targetDecorator.shape="OpenArrow",this.sourceDecorator.shape="OpenArrow",this.style.strokeDashArray="2 2")},TSi.prototype.getFixedUserHandle=function(e,t,i,n,o){var r;return""===e.pathData&&n?((r=new Tvi(this.id,o,void 0,n)).isTemplate=!0,r.template=yTi(r,!0,e),e.id=e.id||xTi(),r.id=this.id+"_"+e.id):((r=new Vyi).children=[],e.id=e.id||xTi(),r.id=this.id+"_"+e.id,o=DAi(e,r),r.children.push(o)),r.float=!0,r.visible=e.visibility,r.width=e.width,r.height=e.height,r.style.strokeWidth=e.handleStrokeWidth,r.style.fill=e.fill,r.style.strokeColor=e.handleStrokeColor,r.cornerRadius=e.cornerRadius,this.updateAnnotation(e,t,i,r),r.description=r.id,r},TSi.prototype.getBpmnMessageFlow=function(){var e=new kyi;return this.targetDecorator.shape="Arrow",this.targetDecorator.width=10,this.targetDecorator.height=10,this.sourceDecorator.shape="Circle",this.sourceDecorator.style.fill="white",this.targetDecorator.style.fill="white","InitiatingMessage"!==this.shape.message&&"NonInitiatingMessage"!==this.shape.message||(e.id=this.id+"_"+this.shape.message,e.width=25,e.height=15,e.data="M0,0 L19.8,12.8 L40,0 L0, 0 L0, 25.5 L40, 25.5 L 40, 0",e.horizontalAlignment="Center",e.verticalAlignment="Center",e.transform=tyi.Self,e.style.fill="NonInitiatingMessage"===this.shape.message?"lightgrey":"white"),e},TSi.prototype.distance=function(e,t){return M1i(e,t)},TSi.prototype.findPath=function(e,t){return D1i(e,t)},TSi.prototype.getAnnotationElement=function(e,t,i,n,o,r){e.content=e.content||"",e.id=e.id||xTi(),o&&(e.template||"Template"===e.annotationType||r&&""===e.content)?(s=document.getElementById(o).ej2_instances[0],a=new Tvi(this.id,o,e.id,r),e.template&&"function"==typeof e.template&&s.isReact&&(a.templateFn=oo(e.template),a.isTemplate=!0),void 0!==e.height||"String"!==e.annotationType||!e.template&&""!==e.content||(e.height=i.height),a=ATi(a,e,r,s)):(a=new Tyi,o=e.hyperlink.link?e.hyperlink:void 0,a.style=e.style,a.style.color=o?o.color||a.hyperlink.color:e.style.color,a.hyperlink.link=e.hyperlink.link||void 0,a.hyperlink.hyperlinkOpenState=e.hyperlink.hyperlinkOpenState||void 0,a.hyperlink.textDecoration=e.hyperlink.textDecoration||void 0,a.content=o?o.content||a.hyperlink.link:e.content),a.constraints=e.constraints,a.visible=e.visibility,a.annotationVisibility=a.visible?"Visible":"Collapsed",a.rotateAngle=e.rotateAngle,a.horizontalAlignment=e.horizontalAlignment,a.verticalAlignment=e.verticalAlignment,a.width=e.width,a.height=e.height,void 0===i.width||e.template||(a.width=(e.width||i.width)-e.margin.left-e.margin.right),a.margin=e.margin,a.id=this.id+"_"+e.id,0===i.width&&(i.width=this.style.strokeWidth),0===i.height&&(i.height=this.style.strokeWidth);var s,a,l,r=jTi(n);return r&&(l=r(e,this)),a.description=l||a.id,this.updateAnnotation(e,t,i,a),a},TSi.prototype.updateAnnotation=function(e,t,i,n,o){var r={x:0,y:0},o=(n instanceof Tyi&&!o&&n.refreshTextElement(),n.width=e.width||i.width,kAi(t,e)),s=o.point;e instanceof b0i&&e.segmentAngle&&(n.rotateAngle=e.rotateAngle+o.angle,n.rotateAngle=(n.rotateAngle+360)%360),0===i.width&&(i.width=this.style.strokeWidth),0===i.height&&(i.height=this.style.strokeWidth);var a,l,h=(s.x-i.x)/i.width,s=(s.y-i.y)/i.height,h=(r.x=i.width*h,r.y=i.height*s,OAi(e,o.angle,t)),i=h.hAlign,s=h.vAlign;"left"===i?(a="Left",r.x+=e.displacement.x):"right"===i?(a="Right",r.x-=e.displacement.x):"center"===i&&(a="Center"),"top"===s?(l="Top",r.y+=e.displacement.y):"bottom"===s?(l="Bottom",r.y-=e.displacement.y):"center"===s&&(l="Center"),n.horizontalAlignment=a,n.verticalAlignment=l,n.setOffsetWithRespectToBounds(r.x,r.y,"Absolute"),n.relativeMode="Point"},TSi.prototype.getConnectorPoints=function(e,t,i,n){i=B0i(this,i,n).slice(0);return i&&0<i.length&&(this.sourcePoint=i[0],this.targetPoint=i[i.length-1]),i},TSi.prototype.clipDecorator=function(e,t,i,n){var o={x:0,y:0},r=t.length,s=i?t[0]:t[r-1],t=i?t[1]:t[r-2],r=0===(r=Hmi.distancePoints(s,t))?1:r,a=1,l=i?e.sourceWrapper:e.targetWrapper,l=(a=l&&(a=l.style.strokeWidth,n)&&n&ryi.DecoratorPropertyChange?1:a)-1;return o.x=Math.round(s.x+l*(t.x-s.x)/r),o.y=Math.round(s.y+l*(t.y-s.y)/r),o=i&&"None"!==e.sourceDecorator.shape||!i&&"None"!==e.targetDecorator.shape?Hmi.adjustPoint(o,t,!0,n&ryi.DecoratorPropertyChange?0:a/2):o},TSi.prototype.clipDecorators=function(e,t,i){return"None"!==e.sourceDecorator.shape&&(t[0]=this.clipDecorator(e,t,!0,i)),"None"!==e.targetDecorator.shape&&(t[t.length-1]=this.clipDecorator(e,t,!1,i)),t},TSi.prototype.updateSegmentElement=function(e,t,i,n){var o=new tfi,n=this.getSegmentPath(e,t,n);if("Bezier"===e.type){if(0<this.segments.length)for(var r=0;r<this.segments.length;r++){var s=this.segments[parseInt(r.toString(),10)],a=e.segments[parseInt(r.toString(),10)],l=Hmi.isEmptyPoint(s.point1)?a.bezierPoint1:a.point1,a=Hmi.isEmptyPoint(s.point2)?a.bezierPoint2:a.point2;o.uniteRect(uSi(s.points[0],l,a,s.points[1],e))}}else o=tfi.toBounds(t);return i.width=o.width,i.height=o.height,i.offsetX=o.x+i.width/2,i.offsetY=o.y+i.height/2,i.data=n,e.wrapper&&(e.wrapper.offsetX=i.offsetX,e.wrapper.offsetY=i.offsetY,e.wrapper.width=o.width,e.wrapper.height=o.height),i},TSi.prototype.getSegmentElement=function(e,t,i,n,o){return(o=void 0===o?!0:o)&&A1i(e),o=this.getConnectorPoints(e.type,void 0,i),this.intermediatePoints=o,t.staticSize=!0,t=this.updateSegmentElement(e,o,t,n)},TSi.prototype.getDecoratorElement=function(e,t,i,n,o){var r=new kyi;return r.transform=tyi.Self,this.updateDecoratorElement(r,e,t,i),void 0!==o&&(e=o(i,this),r.description=e||"source"),r},TSi.prototype.bridgePath=function(e,t,i){var n=t;if(0<e.bridges.length)if("Straight"===e.type&&e.segments.length<2)for(var o=0;o<e.bridges.length;o++)(r=e.bridges[parseInt(o.toString(),10)]).rendered||(n=(n+=" L"+r.startPoint.x+" "+r.startPoint.y)+r.path,r.rendered=!0);else if("Orthogonal"===e.type||"Straight"===e.type&&1<e.segments.length)for(var r,o=0;o<e.bridges.length;o++)(r=e.bridges[parseInt(o.toString(),10)]).segmentPointIndex!==i||r.rendered||r.segmentPointIndex===i&&(n=(n+=" L"+r.startPoint.x+" "+r.startPoint.y)+r.path,r.rendered=!0);return n},TSi.prototype.updateDecoratorElement=function(e,t,i,n){e.offsetX=t.x,e.offsetY=t.y;var t=Hmi.findAngle(t,i),i=S0i(n.shape,n),o=new Omi(n.width,n.height);e.pivot.x=n.pivot.x,e.pivot.y=n.pivot.y,e.style=n.style,e.rotateAngle=t,e.data=i,e.canMeasurePath=!0,e.width=o.width,e.height=o.height},TSi.prototype.getSegmentPath=function(e,t,i){for(var n,o,r,s="",a=[],l=0;l<t.length;)a.push({x:t[parseInt(l.toString(),10)].x,y:t[parseInt(l.toString(),10)].y}),l++;for(var h=0;h<e.bridges.length;h++)e.bridges[parseInt(h.toString(),10)].rendered=!1;if(a=this.clipDecorators(e,a,i),0<this.cornerRadius&&"Bezier"!==this.type)for(var d=0;d<a.length-1;d++){n=a[parseInt(d.toString(),10)],0===d&&(s="M"+n.x+" "+n.y);var p=Hmi.distancePoints(a[parseInt(d.toString(),10)],a[d+1]);0<p&&(o=d<a.length-2?p<2*this.cornerRadius?Hmi.adjustPoint(a[parseInt(d.toString(),10)],a[d+1],!1,p/2):Hmi.adjustPoint(a[parseInt(d.toString(),10)],a[d+1],!1,this.cornerRadius):a[d+1],0<d&&(p<2*this.cornerRadius?(r=Hmi.adjustPoint(a[parseInt(d.toString(),10)],a[d+1],!0,p/2),d<a.length-2&&(o=null)):r=Hmi.adjustPoint(a[parseInt(d.toString(),10)],a[d+1],!0,this.cornerRadius)),r&&(s+="Q"+n.x+" "+n.y+" "+r.x+" "+r.y),o)&&(0<e.bridges.length&&(s=this.bridgePath(e,s,d),"Orthogonal"===e.type)&&(s=this.bridgePath(e,s,d+1)),s+=" L"+o.x+" "+o.y)}else if("Bezier"===this.type){for(var c,u=void 0,g=void 0,m=(this.parentObj.element&&(c=this.parentObj.element.ej2_instances[0].eventHandler.action,u=this.parentObj.element.ej2_instances[0].eventHandler.tool instanceof Xwi,g=c.includes("PortDraw")||c.includes("Drag")),void 0),f=this.segments,y=0;y<f.length;y++)2<a.length&&(f[parseInt(y.toString(),10)].bezierPoint1={x:0,y:0},f[parseInt(y.toString(),10)].bezierPoint2={x:0,y:0}),!Hmi.isEmptyPoint(f[parseInt(y.toString(),10)].point1)||f[parseInt(y.toString(),10)].vector1.angle||f[parseInt(y.toString(),10)].vector1.distance?f[parseInt(y.toString(),10)].vector1.angle||f[parseInt(y.toString(),10)].vector1.distance?f[parseInt(y.toString(),10)].bezierPoint1=Hmi.transform(a[parseInt(y.toString(),10)],f[parseInt(y.toString(),10)].vector1.angle,f[parseInt(y.toString(),10)].vector1.distance):f[parseInt(y.toString(),10)].bezierPoint1={x:f[parseInt(y.toString(),10)].point1.x||f[parseInt(y.toString(),10)].bezierPoint1.x,y:f[parseInt(y.toString(),10)].point1.y||f[parseInt(y.toString(),10)].bezierPoint1.y}:(!e.sourceID&&!this.sourcePortID||!this.sourceWrapper||g||u||(m=dSi(this.sourceWrapper.bounds,a[parseInt(y.toString(),10)],!0)),f[parseInt(y.toString(),10)].bezierPoint1=cSi(a[parseInt(y.toString(),10)],a[y+1],m)),!Hmi.isEmptyPoint(f[parseInt(y.toString(),10)].point2)||f[parseInt(y.toString(),10)].vector2.angle||f[parseInt(y.toString(),10)].vector2.distance?f[parseInt(y.toString(),10)].vector2.angle||f[parseInt(y.toString(),10)].vector2.distance?f[parseInt(y.toString(),10)].bezierPoint2=Hmi.transform(a[y+1],f[parseInt(y.toString(),10)].vector2.angle,f[parseInt(y.toString(),10)].vector2.distance):f[parseInt(y.toString(),10)].bezierPoint2={x:f[parseInt(y.toString(),10)].point2.x||f[parseInt(y.toString(),10)].bezierPoint2.x,y:f[parseInt(y.toString(),10)].point2.y||f[parseInt(y.toString(),10)].bezierPoint2.y}:(!e.targetID&&!this.targetPortID||!this.targetWrapper||g||u||(m=dSi(this.targetWrapper.bounds,a[y+1],!0)),f[parseInt(y.toString(),10)].bezierPoint2=cSi(a[y+1],a[parseInt(y.toString(),10)],m));a.splice(1,0,{x:f[0].bezierPoint1.x,y:f[0].bezierPoint1.y}),a.splice(a.length-1,0,{x:f[f.length-1].bezierPoint2.x,y:f[f.length-1].bezierPoint2.y});for(var a=this.clipDecorators(e,a,i),v=0;v<f.length;v++){0===v&&(s="M"+a[0].x+" "+a[0].y);var b=v===f.length-1?a[a.length-1].x+" "+a[a.length-1].y:f[parseInt(v.toString(),10)].points[f[parseInt(v.toString(),10)].points.length-1].x+" "+f[parseInt(v.toString(),10)].points[f[parseInt(v.toString(),10)].points.length-1].y;s+="C"+f[parseInt(v.toString(),10)].bezierPoint1.x+" "+f[parseInt(v.toString(),10)].bezierPoint1.y+" "+f[parseInt(v.toString(),10)].bezierPoint2.x+" "+f[parseInt(v.toString(),10)].bezierPoint2.y+" "+b}}else for(var w=0;w<a.length;w++)n=a[parseInt(w.toString(),10)],0===w&&(s="M"+n.x+" "+n.y),0<w&&(s=this.bridgePath(e,s,w),s+=" L"+n.x+" "+n.y);return s},TSi.prototype.updateShapeElement=function(e){var t;switch(e.shape.type){case"Bpmn":e.wrapper.children[3]instanceof kyi&&(t=e.wrapper.children[3]),"Message"===e.shape.flow&&this.updateShapePosition(e,t);break;case"UmlActivity":"Exception"===e.shape.flow&&this.getUMLExceptionFlow(e.wrapper.children[0])}},TSi.prototype.updateShapePosition=function(e,t){var i=this.intermediatePoints,i=T1i(i,t,.5);t.offsetX=i.x,t.offsetY=i.y},TSi.prototype.scale=function(e,t,i,n,o){var r,s,a=0,l=0,h=(this.wrapper&&this.wrapper.outerBounds&&(h=gvi(this),r=Math.abs((this.wrapper.bounds.width||this.style.strokeWidth||1)-2),s=Math.abs((this.wrapper.bounds.height||this.style.strokeWidth||1)-2),a=h.width-r,l=h.height-s,e=Math.abs((i-Math.max(a,l))/r),t=Math.abs((n-Math.max(a,l))/s),a=l=Math.min(a,l)),e=t=Math.min(e,t),ofi()),i=(afi(h,-(o=o||this.wrapper).rotateAngle,o.offsetX,o.offsetY),lfi(h,e,t,o.offsetX,o.offsetY),afi(h,o.rotateAngle,o.offsetX,o.offsetY),sfi(h,this.intermediatePoints));return this.sourcePoint=i[0],this.targetPoint=i[i.length-1],i=this.intermediatePoints=B0i(this),t1i(this,i),{x:a,y:l}},TSi.prototype.getClassName=function(){return"Connector"},l9([Mt(FCi)],TSi.prototype,"shape",void 0),l9([e(Yfi.Default)],TSi.prototype,"constraints",void 0),l9([e(10)],TSi.prototype,"bridgeSpace",void 0),l9([kt([],b0i)],TSi.prototype,"annotations",void 0),l9([t({},Hmi)],TSi.prototype,"sourcePoint",void 0),l9([t({},Hmi)],TSi.prototype,"targetPoint",void 0),l9([kt([],Rvi)],TSi.prototype,"fixedUserHandles",void 0),l9([Pt(LCi)],TSi.prototype,"segments",void 0),l9([e("")],TSi.prototype,"sourceID",void 0),l9([e("")],TSi.prototype,"targetID",void 0),l9([e(10)],TSi.prototype,"hitPadding",void 0),l9([e(0)],TSi.prototype,"connectionPadding",void 0),l9([e("Straight")],TSi.prototype,"type",void 0),l9([e("Circle")],TSi.prototype,"segmentThumbShape",void 0),l9([e(10)],TSi.prototype,"segmentThumbSize",void 0),l9([e(0)],TSi.prototype,"cornerRadius",void 0),l9([t({shape:"None"},qY)],TSi.prototype,"sourceDecorator",void 0),l9([t({shape:"Arrow"},qY)],TSi.prototype,"targetDecorator",void 0),l9([t({},O2t)],TSi.prototype,"tooltip",void 0),l9([e("")],TSi.prototype,"sourcePortID",void 0),l9([e("")],TSi.prototype,"targetPortID",void 0),l9([e(0)],TSi.prototype,"sourcePadding",void 0),l9([t({},sP)],TSi.prototype,"previewSize",void 0),l9([t({},sP)],TSi.prototype,"dragSize",void 0),l9([e(0)],TSi.prototype,"targetPadding",void 0),l9([e(13)],TSi.prototype,"connectorSpacing",void 0),l9([t({strokeWidth:1,strokeColor:"black"},Ofi)],TSi.prototype,"style",void 0),l9([e(null)],TSi.prototype,"maxSegmentThumb",void 0),l9([e(!1)],TSi.prototype,"allowNodeOverlap",void 0),l9([t({},jY)],TSi.prototype,"bezierSettings",void 0),l9([kt([],l0i)],TSi.prototype,"ports",void 0),l9([e(null)],TSi.prototype,"wrapper",void 0);var xSi,ISi=TSi;function TSi(e,t,i,n){e=xSi.call(this,e,t,i,n)||this;return e.parentId="",e.bridges=[],e.status="None",e.outEdges=[],e.inEdges=[],e.shape&&"UmlActivity"===e.shape.type&&gAi(i,e),i&&i.shape&&"None"!==i.shape.type&&mAi(i,e),e}ESi=function(e,t){return(ESi=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])}))(e,t)};var ESi,DSi,nJ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},MSi=(function(e,t){function i(){this.constructor=e}ESi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(kSi,DSi=Ji),kSi.prototype.preRender=function(){this.unWireEvents(),this.wireEvents()},kSi.prototype.render=function(){this.updateRulerGeometry(),this.renderComplete()},kSi.prototype.getModuleName=function(){return"Ruler"},kSi.prototype.destroy=function(){this.unWireEvents(),this.notify("destroy",{}),DSi.prototype.destroy.call(this),this.element.classList.remove("e-ruler")},kSi.prototype.getPersistData=function(){return this.addOnPersist(["loaded"])},kSi.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"length":case"interval":case"segmentWidth":case"tickAlignment":case"markerColor":case"thickness":this.updateRuler()}},kSi.prototype.updateRulerGeometry=function(){this.element.style.textAlign="left",this.renderRulerSpace(),this.updateRuler()},kSi.prototype.renderRulerSpace=function(){var e=this.getRulerGeometry(),t=document.getElementById(this.element.id+"_ruler_space");return t||(t=pTi("div",{id:this.element.id+"_ruler_space",style:"height:"+e.height+"px;width:"+e.width+"px;cssFloat:left;"}),this.element.appendChild(t)),t},kSi.prototype.updateRuler=function(){var e=this.getRulerSize(),t=this.getRulerGeometry(),i=0,n=new Omi,t=this.getRulerSVG(t);t&&(i=this.length,n.height=e,n=this.offset,i)&&i!==1/0&&(i=i+this.segmentWidth,this.updateSegments(n,i+Math.abs(n),t,e))},kSi.prototype.updateSegments=function(e,t,i,n){for(var o=e,r={trans:0};o<t;){var s=this.getNewSegment(o,i);s&&(i.appendChild(s.segment),o=this.updateSegment(e,t,s,o,r,n))}},kSi.prototype.updateSegment=function(e,t,i,n,o,r){var s=this.updateSegmentWidth(this.scale),e=(n===e?(this.startValue=Math.floor(e/s)*s/this.scale,this.startValue=this.startValue%1!=0?Number(this.startValue.toFixed(1)):this.startValue,i.label.textContent=this.startValue.toString(),this.defStartValue=n=this.startValue*this.scale,"Horizontal"===this.orientation?this.hRulerOffset=e-n:this.vRulerOffset=e-n):(this.startValue=n/this.scale,this.startValue=this.startValue%1!=0?Number(this.startValue.toFixed(1)):this.startValue,i.label.textContent=this.startValue.toString()),this.updateTickLabel(i,r),"Horizontal"===this.orientation?o.trans+.5+",0.5":"0.5,"+(o.trans+.5));return i.segment.setAttribute("transform","translate("+e+")"),o.trans+=s,n+=s},kSi.prototype.updateTickLabel=function(e,t){var i=e.segment.lastChild.getBBox(),n="Horizontal"===this.orientation,o="RightOrBottom"===this.tickAlignment,r=n?2:0,s=n?o?t/2+5.5-5.5:t/2+5.5:i.height,o=o?-(i.width+2)+","+(t/2-i.height):-(i.width+2)+","+(t/2-i.height/2);vTi(e.segment.lastChild,n?{x:r,y:s}:{x:r,y:s,transform:"rotate(270)translate("+o+")"})},kSi.prototype.getNewSegment=function(e,t){e=this.createNewTicks(e,t);return{segment:e,label:this.createTickLabel(t,e)}},kSi.prototype.createNewTicks=function(e,t){for(var i,n=this.updateSegmentWidth(this.scale),o=cTi("g",{class:"e-ruler-segment"}),r=0;r<this.interval;r++)i=n/this.interval,i=this.createTick(t,i,r+1,e),o.appendChild(i);return o},kSi.prototype.getLinePoint=function(e,t,i){var n=this.updateSegmentWidth(this.scale),o=this.getRulerSize();return i=(t*=i-1)%n==0?o:.3*o},kSi.prototype.createTick=function(e,t,i,n){var e=this.getLinePoint(e,t,i),o=this.getRulerSize(),r="Horizontal"===this.orientation,s="RightOrBottom"===this.tickAlignment,a=jTi(this.arrangeTick),l={ruler:void 0,tickLength:e,tickInterval:this.segmentWidth/this.interval*(i-1)},a=(a&&a(l),e=l.tickLength,t*(i-1)),l=cTi("line",{x1:r?a:s?o:0,y1:r?s?o:o-(o-e):a,x2:r?a:s?o-e:o-(o-e),y2:r?s?o-e:0:a,"stroke-width":"1",stroke:"black"});return l.setAttribute("class","e-ruler-tick"),l},kSi.prototype.createTickLabel=function(e,t){var i;return t&&(i=cTi("text",{class:"e-ruler-tick-label"}),t.appendChild(i)),i},kSi.prototype.updateSegmentWidth=function(e){if(100!==this.segmentWidth)return this.segmentWidth;var t=1,i=100;for(i=100/Math.pow(2,Math.round(Math.log(e)/Math.log(2)));100<i;)t/=10,i/=10;for(;i<25;)t*=10,i*=10;return(i=25<=i&&i%25!=0?25*Math.round(i/25):i)*e/t},kSi.prototype.createMarkerLine=function(e,t,i){var n;return t&&((n=e.getElementById(t.id+"_marker"))&&n.parentNode.removeChild(n),n=cTi("line",i)),n},kSi.prototype.drawRulerMarker=function(e,t,i){for(var n,o,r,s="Horizontal"===this.orientation,a=e.getElementsByTagName("svg"),l=0;l<a.length;l++){a[parseInt(l.toString(),10)]&&(n=a[parseInt(l.toString(),10)]);break}n&&(o=this.getRulerSize(),o={id:e.id+"_marker",x1:0,y1:0,x2:s?0:o,y2:s?o:0,stroke:this.markerColor,"stroke-width":1.5,class:"e-d-ruler-marker"},e=this.createMarkerLine(n,e,o),o=this.scale,r=this.offset-this.defStartValue,t=(s?t.x:t.y)*o+i+r,e.setAttribute("transform","translate("+(s?t+.5+" 0.5":"0.5 "+(t+.5))+")"),n.appendChild(e))},kSi.prototype.getRulerGeometry=function(){return new Omi(this.element?this.element.getBoundingClientRect().width:0,this.element?this.element.getBoundingClientRect().height:0)},kSi.prototype.getRulerSize=function(){return this.thickness},kSi.prototype.getRulerSVG=function(e){var t,i=this.getRulerSize();if(this.element&&(t=document.getElementById(this.element.id+"_ruler_space"))){var n=cTi("svg",{id:this.element.id+"_Ruler_svg",width:"Horizontal"===this.orientation?e.width+200:i+"px",height:"Horizontal"===this.orientation?i:e.height+200+"px",style:"position:inherit;"});if(0<t.childNodes.length)for(var o=t.childNodes.length-1;0<=o;o--)t.childNodes[parseInt(o.toString(),10)].parentNode.removeChild(t.childNodes[parseInt(o.toString(),10)]);t.appendChild(n)}return n},kSi.prototype.wireEvents=function(){},kSi.prototype.unWireEvents=function(){},nJ([e(5)],kSi.prototype,"interval",void 0),nJ([e(100)],kSi.prototype,"segmentWidth",void 0),nJ([e("Horizontal")],kSi.prototype,"orientation",void 0),nJ([e("RightOrBottom")],kSi.prototype,"tickAlignment",void 0),nJ([e("red")],kSi.prototype,"markerColor",void 0),nJ([e(25)],kSi.prototype,"thickness",void 0),nJ([e(null)],kSi.prototype,"arrangeTick",void 0),nJ([e(400)],kSi.prototype,"length",void 0),kSi);function kSi(e,t){e=DSi.call(this,e,t)||this;return e.offset=0,e.scale=1,e}function PSi(e,t){var i=document.getElementById(e.element.id+(t?"_hRuler":"_vRuler")),n=LSi(e),o=RSi(e),r=t?"margin-left:"+n.width+"px;":"margin-top:"+n.height+"px;",r=(i||(n="height:"+(t?n.height:o.height+100)+"px;overflow:hidden;width:"+(t?o.width+100:n.width)+"px;position:absolute;font-size:11px;"+r,i=pTi("div",{id:e.element.id+(t?"_hRuler":"_vRuler"),style:n})),e.element.insertBefore(i,e.element.firstChild),t?e.rulerSettings.horizontalRuler:e.rulerSettings.verticalRuler),n=new MSi(r),i=(n.orientation=t?"Horizontal":"Vertical",n.length=(t?o.width:o.height)+r.segmentWidth,n.appendTo("#"+e.element.id+(t?"_hRuler":"_vRuler")),t?e.hRuler=n:e.vRuler=n,document.getElementById(e.element.id+(t?"_hRuler":"_vRuler")));t?e.hRuler.element=i:e.vRuler.element=i}function BSi(e){var t=-e.scroller.horizontalOffset,i=-e.scroller.verticalOffset;e&&e.rulerSettings.showRulers?(e.hRuler.length=0,e.vRuler.length=0,e.hRuler.element&&OSi(e,e.hRuler,t,!0),e.vRuler.element&&OSi(e,e.vRuler,i,!1)):FSi(e)}function FSi(e){fTi(e.element.id+"_hRuler"),fTi(e.element.id+"_vRuler"),fTi(e.element.id+"_overlapRuler")}function LSi(e){var t=0,i=0;return e.rulerSettings.showRulers&&(t=e.rulerSettings.horizontalRuler.thickness,i=e.rulerSettings.verticalRuler.thickness),new Omi(i,t)}function RSi(e){var t=LSi(e),i=e.scroller.viewPortHeight,n=e.scroller.viewPortWidth;return n<e.element.clientWidth-t.width&&(n=e.element.clientWidth-t.width),i<e.element.clientHeight-t.height&&(i=e.element.clientHeight-t.height),e.hRuler&&e.hRuler.length&&(n=e.hRuler.length),e.vRuler&&e.vRuler.length&&(i=e.vRuler.length),new Omi(n,i)}function OSi(e,t,i,n){var o,r,s,a,l=LSi(e),h=RSi(e),d=n?e.rulerSettings.horizontalRuler:e.rulerSettings.verticalRuler,p=(o=e,p=h,r=n,s=document.getElementById(o.element.id+(r?"_hRuler":"_vRuler")),a=r?o.hRuler:o.vRuler,s&&o&&p&&(s.style.width=(r?p.width+a.segmentWidth:a.thickness)+"px",s.style.height=(r?a.thickness:p.height+a.segmentWidth)+"px",s=document.getElementById(o.element.id+"_overlapRuler"))&&(r?s.style.height=a.thickness+"px":s.style.width=a.thickness+"px"),p=e,o=h,r=n,s=document.getElementById(p.element.id+(r?"_hRuler_ruler_space":"_vRuler_ruler_space")),a=r?p.hRuler:p.vRuler,s&&p&&o&&(s.style.width=(r?o.width+2*a.segmentWidth:a.thickness)+"px",s.style.height=(r?a.thickness:o.height+2*a.segmentWidth)+"px"),t.offset=i,t.scale=e.scroller.currentZoom,t.length=(n?h.width:h.height)+100,t.arrangeTick=jTi(d.arrangeTick),t.dataBind(),(n?e.hRuler:e.vRuler).element);n?p.style.marginLeft=l.width-t.hRulerOffset+"px":p.style.marginTop=l.height-t.vRulerOffset+"px"}NSi=function(e,t){return(NSi=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])}))(e,t)};var NSi,VSi,aJ=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},_Si=(function(e,t){function i(){this.constructor=e}NSi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(HSi,VSi=n),HSi.prototype.getClassName=function(){return"UserHandle"},aJ([e("")],HSi.prototype,"name",void 0),aJ([e("")],HSi.prototype,"pathData",void 0),aJ([e("")],HSi.prototype,"content",void 0),aJ([e("")],HSi.prototype,"source",void 0),aJ([e("#000000")],HSi.prototype,"backgroundColor",void 0),aJ([e("Top")],HSi.prototype,"side",void 0),aJ([e("")],HSi.prototype,"borderColor",void 0),aJ([e(.5)],HSi.prototype,"borderWidth",void 0),aJ([e(25)],HSi.prototype,"size",void 0),aJ([e("white")],HSi.prototype,"pathColor",void 0),aJ([e(10)],HSi.prototype,"displacement",void 0),aJ([e(!0)],HSi.prototype,"visible",void 0),aJ([e(0)],HSi.prototype,"offset",void 0),aJ([t({},ZOt)],HSi.prototype,"margin",void 0),aJ([e("Center")],HSi.prototype,"horizontalAlignment",void 0),aJ([e("Center")],HSi.prototype,"verticalAlignment",void 0),aJ([e(!1)],HSi.prototype,"disableNodes",void 0),aJ([e(!1)],HSi.prototype,"disableConnectors",void 0),aJ([t({},O2t)],HSi.prototype,"tooltip",void 0),aJ([e("")],HSi.prototype,"template",void 0),HSi);function HSi(){return null!==VSi&&VSi.apply(this,arguments)||this}function zSi(e){return QSi[e.toString()]}var jSi,WSi,QSi={Action:"M 90 82.895 C 90 86.819 86.776 90 82.8 90 H 7.2 C 3.224 90 0 86.819 0 82.895 V 7.105 C 0 3.181 3.224 0 7.2 0 h 75.6 C 86.776 0 90 3.181 90 7.105 V 82.895 Z",Decision:"M10,19.707L0.293,10L10,0.293L19.707,10L10,19.707z",MergeNode:"M10,19.707L0.293,10L10,0.293L19.707,10L10,19.707z",InitialNode:"M10,19.5c-5.238,0-9.5-4.262-9.5-9.5S4.762,0.5,10,0.5s9.5,4.262,9.5,9.5S15.238,19.5,10,19.5z",ForkNode:"m0.75,0.75l636.00002,0l0,290l-636.00002,0l0,-290z",JoinNode:"m0.75,0.75l636.00002,0l0,290l-636.00002,0l0,-290z",TimeEvent:"M50.001,0.00286865 L25.001,25.0029 L0.000976562,0.00286865 L50.001,0.00286865 z M0.000976562,50.0029 L25.001,25.0029 L50.001,50.0029 L0.000976562,50.0029 z",AcceptingEvent:"M17.8336 32.164 L29.64 24 L17.32 16 L48.1664 16 L48.5 32 Z",SendSignal:"M48.164 31.8336 L56 23.832 L47.836 16 L16.168 16 L16.1668 31.8336 Z",ReceiveSignal:"M48.1664 31.8336 L39.836 24 L47.836 16 L16.168 16 L16.168 31.836 Z",StructuredNode:"M0,0 L50,0 L50,50 L0,50 z",Note:"M20 12 L4 12 L4 22 L22 22 L22 14 L20 14 L20 12 L22 14 Z"},f7=(jSi=function(e,t){return(jSi=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])}))(e,t)},function(e,t){function i(){this.constructor=e}jSi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),gg=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},vg=(f7(USi,WSi=n),gg([e()],USi.prototype,"key",void 0),gg([e()],USi.prototype,"keyModifiers",void 0),USi);function USi(){return null!==WSi&&WSi.apply(this,arguments)||this}f7(YSi,qSi=n),YSi.prototype.getClassName=function(){return"Command"},gg([e("")],YSi.prototype,"name",void 0),gg([e()],YSi.prototype,"canExecute",void 0),gg([e()],YSi.prototype,"execute",void 0),gg([t({},vg)],YSi.prototype,"gesture",void 0),gg([e("")],YSi.prototype,"parameter",void 0);var qSi,GSi=YSi;function YSi(){return null!==qSi&&qSi.apply(this,arguments)||this}f7(KSi,XSi=n),gg([kt([],GSi)],KSi.prototype,"commands",void 0);var XSi,Pc=KSi;function KSi(){return null!==XSi&&XSi.apply(this,arguments)||this}f7(ZSi,JSi=n),gg([e()],ZSi.prototype,"show",void 0),gg([e()],ZSi.prototype,"showCustomMenuOnly",void 0),gg([e()],ZSi.prototype,"items",void 0);var JSi,s=ZSi;function ZSi(){return null!==JSi&&JSi.apply(this,arguments)||this}eAi.prototype.renderShadow=function(e,t,i,n){void 0===i&&(i=null);var o,r=Hmi.transform({x:0,y:0},e.shadow.angle,e.shadow.distance),r=((o=n?n.getElementById(t.id+"_shadow"):o)||(o=document.createElementNS("http://www.w3.org/2000/svg",i?"path":"rect"),t.appendChild(o)),{id:t.id+"_shadow",fill:e.shadow.color,stroke:e.shadow.color,opacity:e.shadow.opacity.toString(),transform:"rotate("+e.angle+","+(e.x+e.width*e.pivotX)+","+(e.y+e.height*e.pivotY)+")translate("+(e.x+r.x)+","+(e.y+r.y)+")"});n&&(n=n.getElementById(t.id))&&n.insertBefore(o,n.firstChild),vTi(o,r),i?this.renderPath(o,e,i):vTi(o,{width:e.width,height:e.height})},eAi.prototype.parseDashArray=function(e){return[]},eAi.prototype.drawRectangle=function(e,t,i,n,o,r,s,a,l){t.shadow&&!n&&this.renderShadow(t,e,void 0,r),n=t.id===e.id?t.id+"_container":t.id,(h=r?r.getElementById(n):h)&&!o||(h=document.createElementNS("http://www.w3.org/2000/svg","rect"),e.appendChild(h)),r&&!t.shadow&&(d=r.getElementById(t.id+"_groupElement_shadow"))&&d.parentNode.removeChild(d),r&&(d=r.getElementById(t.id+"_groupElement_shadow"))&&(d.style.visibility=t.visible?"visible":"hidden"),o=a?{id:n,x:t.x.toString(),y:t.y.toString(),width:t.width.toString(),height:t.height.toString(),visibility:t.visible?"visible":"hidden",transform:"rotate("+t.angle+","+(t.x+t.width/2)+","+(t.y+t.height/2)+")",rx:t.cornerRadius||0,ry:t.cornerRadius||0,opacity:t.opacity}:{id:n,x:t.x.toString(),y:t.y.toString(),width:t.width.toString(),height:t.height.toString(),visibility:t.visible?"visible":"hidden",transform:"rotate("+t.angle+","+(t.x+t.width*t.pivotX)+","+(t.y+t.height*t.pivotY)+")",rx:t.cornerRadius||0,ry:t.cornerRadius||0,opacity:t.opacity},s&&(o.role="img",o["aria-label"]=s);var h,d,e=t.class||"";l||(e.includes("e-diagram-resize-handle")||e.includes("e-diagram-endpoint-handle")||e.includes("e-diagram-bezier-control-handle"))&&(e+=" e-disabled"),t.class&&(o.class=e);s||(o["pointer-events"]="none"),vTi(h,o),this.setSvgStyle(h,t,i)},eAi.prototype.updateSelectionRegion=function(e,t){var i=e.parentNode.getElementById(t.id),n={id:t.id,x:t.x.toString(),y:t.y.toString(),width:t.width.toString(),height:t.height.toString(),transform:"rotate("+t.angle+","+(t.x+t.width*t.pivotX)+","+(t.y+t.height*t.pivotY)+")",class:"e-diagram-selected-region"};i||(i=document.createElementNS("http://www.w3.org/2000/svg","rect"),e.appendChild(i)),this.setSvgStyle(i,t),vTi(i,n)},eAi.prototype.createGElement=function(e,t){return cTi(e,t)},eAi.prototype.drawLine=function(e,t){var i=document.createElementNS("http://www.w3.org/2000/svg","line"),n=(this.setSvgStyle(i,t),t.x+t.width*t.pivotX),o=t.y+t.height*t.pivotY,n={id:t.id,x1:t.startPoint.x+t.x,y1:t.startPoint.y+t.y,x2:t.endPoint.x+t.x,y2:t.endPoint.y+t.y,stroke:t.stroke,"stroke-width":t.strokeWidth.toString(),opacity:t.opacity.toString(),transform:"rotate("+t.angle+" "+n+" "+o+")",visibility:t.visible?"visible":"hidden"};t.class&&(n.class=t.class),vTi(i,n),e.appendChild(i)},eAi.prototype.drawCircle=function(e,t,i,n){var o=document.createElementNS("http://www.w3.org/2000/svg","circle"),r=(this.setSvgStyle(o,t),t.class||""),i=(i||(r+=" e-disabled"),{id:t.id,cx:t.centerX,cy:t.centerY,r:t.radius,visibility:t.visible?"visible":"hidden",class:r});n&&(i.role="img",i["aria-label"]=n),o.style.display=t.visible?"block":"none",vTi(o,i),e.appendChild(o)},eAi.prototype.drawPath=function(e,t,i,n,o,r,s){h=Gmi(jmi(t.data)),t.shadow&&this.renderShadow(t,e,h,o),o&&!t.shadow&&(a=o.getElementById(t.id+"_groupElement_shadow"))&&a.parentNode.removeChild(a),o&&(a=o.getElementById(t.id+"_groupElement_shadow"))&&(a.style.visibility=t.visible?"visible":"hidden"),(l=o?o.getElementById(t.id):l)&&!n||(l=document.createElementNS("http://www.w3.org/2000/svg","path"),(e.parentElement&&"diagram_nativeLayer"===e.parentElement.id?((a=document.createElementNS("http://www.w3.org/2000/svg","g")).id=t.id+"_groupElement",e.appendChild(a),a):e).appendChild(l)),this.renderPath(l,t,h);var a,l,h,o={},o=s?{id:t.id,transform:"rotate("+t.angle+","+(t.x+t.width*t.pivotX)+","+(t.y+t.height*t.pivotY)+")translate("+t.x+","+t.y+"),scale("+s+")",visibility:t.visible?"visible":"hidden",opacity:t.opacity}:{id:t.id,transform:"rotate("+t.angle+","+(t.x+t.width*t.pivotX)+","+(t.y+t.height*t.pivotY)+")translate("+t.x+","+t.y+")",visibility:t.visible?"visible":"hidden",opacity:t.opacity};r&&(o.role="img",o["aria-label"]=r),t.class&&(o.class=t.class),vTi(l,o),this.setSvgStyle(l,t,i)},eAi.prototype.renderPath=function(e,t,i){for(var n,o,r,s,a=i,l="",h=0,d=0,p=0,c=a.length;p<c;++p){var u=a[parseInt(p.toString(),10)],g=u.command;switch("x1"in u&&(n=u.x1),"x2"in u&&(r=u.x2),"y1"in u&&(o=u.y1),"y2"in u&&(s=u.y2),"x"in u&&(h=u.x),"y"in u&&(d=u.y),g){case"M":l=l+"M"+h.toString()+","+d.toString()+" ";break;case"L":l=l+"L"+h.toString()+","+d.toString()+" ";break;case"C":l=l+"C"+n.toString()+","+o.toString()+","+r.toString()+","+s.toString()+",",l+=h.toString()+","+d.toString()+" ";break;case"Q":l=l+"Q"+n.toString()+","+o.toString()+","+h.toString()+","+d.toString()+" ";break;case"A":l=l+"A"+u.r1.toString()+","+u.r2.toString()+","+u.angle.toString()+",",l+=u.largeArc.toString()+","+u.sweep+","+h.toString()+","+d.toString()+" ";break;case"Z":case"z":l+="Z "}}e.setAttribute("d",l)},eAi.prototype.setSvgFontStyle=function(e,t){e.style.fontStyle=t.italic?"italic":"normal",e.style.fontWeight=t.bold?"bold":"normal",e.style.fontSize=t.fontSize.toString()+"px",e.style.fontFamily=t.fontFamily},eAi.prototype.drawText=function(e,t,i,n,o,r,s){if(void 0!==t.content){var a,l,h,d,p=s.groupElement,c=void 0,u=void 0,g=void 0,m=0,f=0,y=void 0,s=void 0;if(y=i?i.getElementById(t.id+"_text"):y){if(t.doWrap)for(;y.firstChild;)y.removeChild(y.firstChild)}else t.doWrap=!0,y=document.createElementNS("http://www.w3.org/2000/svg","text"),"pre-wrap"===t.whiteSpace&&y.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),((s=p?document.getElementById(p.id+"_content_groupElement"):s)&&p&&p.children&&p.children[0]instanceof Qyi?(i=this.createGElement("g",{id:n+"_groupElement"}),s.appendChild(i),i):e).appendChild(y);var s=t.x+t.width*t.pivotX,i=t.y+t.height*t.pivotY,v=0;if(t.doWrap||"Wrap"!==t.textOverflow){for(;y.firstChild;)y.removeChild(y.firstChild);for(this.setSvgStyle(y,t,o),this.setSvgFontStyle(y,t),c=document.createTextNode(t.content),u=t.childNodes,a=t.wrapBounds,l=this.svgLabelAlign(t,a,u),a.width>t.width&&"Wrap"!==t.textOverflow&&"NoWrap"===t.textWrapping&&(u[0].text=NTi(t.content,t)),f=0;f<u.length;f++)if(h=document.createElementNS("http://www.w3.org/2000/svg","tspan"),c=document.createTextNode(u[parseInt(f.toString(),10)].text),(g=u[parseInt(f.toString(),10)]).x=STi(g,u,f,t),m="justify"===t.textAlign||"left"===t.textAlign?0:l.x+g.x-a.x,d=l.y+g.dy*f+.8*t.fontSize,"Clip"!==t.textOverflow&&"Ellipsis"!==t.textOverflow||"WrapWithOverflow"!==t.textWrapping&&"Wrap"!==t.textWrapping||!p)this.alignText(y,h,g,c,m,d,f,t,u);else{var b,w=t.isHorizontalLane?p.actualSize.width:p.actualSize.height;if(!(d<w))break;"Ellipsis"===t.textOverflow&&u[f+1]&&(b=u[f+1],w<l.y+b.dy*(f+1)+.8*t.fontSize)&&(g.text=g.text.slice(0,g.text.length-3),g.text=g.text.concat("..."),c.data=g.text),this.alignText(y,h,g,c,m,d,f,t,u),v+=g.dy}}v&&t.isHorizontalLane&&(s=t.parentOffsetX+t.pivotX,i=t.parentOffsetY+t.pivotY,t.y=t.parentOffsetY-v*t.pivotY+.5),t.textDecoration&&"LineThrough"===t.textDecoration&&(t.textDecoration=LTi(t.textDecoration));e={id:t.id+"_text",fill:t.color,visibility:t.visible?"visible":"hidden","text-decoration":t.textDecoration,transform:"rotate("+t.angle+","+s+","+i+")translate("+t.x+","+t.y+")",opacity:t.opacity};n&&(e.role="img",e["aria-label"]=n),vTi(y,e)}},eAi.prototype.alignText=function(e,t,i,n,o,r,s,a,l){"justify"===a.textAlign&&s!==l.length-1?(s=a.width,this.setText(e,t,i,n,o,r,a,s,"spacing")):this.setText(e,t,i,n,o,r,a)},eAi.prototype.setText=function(e,t,i,n,o,r,s,a,l){"justify"!==s.textAlign?vTi(t,{x:o.toString(),y:r.toString()}):vTi(t,{x:o.toString(),y:r.toString(),textLength:a||0,lengthAdjust:l||"spacing"}),e.setAttribute("fill",i.text),t.appendChild(n),e.appendChild(t)},eAi.prototype.drawImage=function(e,t,i,n){(o=i?i.getElementById(t.id+"image"):o)||(o=document.createElementNS("http://www.w3.org/2000/svg","image"),e.appendChild(o));var o,i=new Image,e=(i.src=t.source,"None"!==t.scale?t.scale:""),r=t.alignment,r=r.charAt(0).toLowerCase()+r.slice(1);"Stretch"!==e&&(r+=" "+e.charAt(0).toLowerCase()+e.slice(1)),vTi(o,{id:t.id+"image",x:t.x.toString(),y:t.y.toString(),transform:"rotate("+t.angle+","+(t.x+t.width*t.pivotX)+","+(t.y+t.height*t.pivotY)+")",width:t.width.toString(),visibility:t.visible?"visible":"hidden",height:t.height.toString(),preserveAspectRatio:r,opacity:t.opacity.toString()}),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i.src.toString())},eAi.prototype.drawHTMLContent=function(t,e,i,n,o){(s=e?e.querySelector("#"+t.id+"_html_element"):s)||(r=(r=e.querySelector("#"+t.id+"_html_element")||e.querySelector("#"+t.nodeId+"_html_element"))||pTi("div",{id:t.nodeId+"_html_element",class:"foreign-object"}),a={id:t.id+"_html_element",class:"foreign-object"},s=pTi("div",a),a=document.getElementById(t.diagramId).ej2_instances[0],l=!1,(l=e.parentNode&&e.parentNode.parentNode&&e.parentNode.parentNode.parentNode&&e.parentNode.parentNode.parentNode.classList.contains("e-overview")?!0:l)?a.isReact?a.renderReactTemplates(function(){s.appendChild(t.template.cloneNode(!0))}):s.appendChild(t.template.cloneNode(!0)):("string"==typeof t.template&&((l=document.createElement("div")).innerHTML=t.template,t.template=l,a.selectedItems.userHandles.filter(function(e){return e.name===t.id.split("_shape")[0]&&""!==e.template})[0].template=t.template),t.isTemplate&&t.template?s.appendChild(t.template):t.template&&s.appendChild(t.template.cloneNode(!0))),void 0!==o&&e.childNodes.length>o&&e.insertBefore(s,e.childNodes[parseInt(o.toString(),10)]),r.appendChild(s),e.appendChild(r));var r,s,a,l=TTi(t).topLeft;s.style.height=t.actualSize.height+"px",s.style.width=t.actualSize.width+"px",s.style.left=l.x+"px",s.style.top=l.y+"px",s.style.position="absolute",s.style.transform="rotate("+(t.rotateAngle+t.parentTransform)+"deg)",s.style.pointerEvents=n?"all":"none",s.style.visibility=t.visible?"visible":"hidden",s.style.opacity=t.style.opacity.toString()},eAi.prototype.drawNativeContent=function(e,t,i,n,o){var r,s,a;o&&(r=o.getElementById(e.id+"_native_element"),s=o.getElementById(e.id+"_clip")),r||((r=document.createElementNS("http://www.w3.org/2000/svg","g")).setAttribute("id",e.id+"_native_element"),r.appendChild(e.template.cloneNode(!0)),(a=this.createGElement("g",{id:e.id+"_inner_native_element"})).appendChild(r),t.appendChild(a)),s&&r.removeChild(s),r.style.visibility=e.visible?"visible":"hidden",r.style.opacity=e.style.opacity?e.style.opacity.toString():"1",this.setNativTransform(e,r,i,n),"Slice"===e.scale&&this.drawClipPath(e,r,i,n,o),vTi(r,e.description?{role:"img","aria-label":e.description}:{})},eAi.prototype.setNativTransform=function(e,t,i,n){var o=0!==e.contentSize.width?e.contentSize.width:1,r=0!==e.contentSize.height?e.contentSize.height:1,s=e.templatePosition.x*n/o,a=e.templatePosition.y*i/r;t.setAttribute("transform","rotate("+e.parentTransform+","+e.offsetX+","+e.offsetY+") translate("+(e.offsetX-s-n*e.pivot.x)+","+(e.offsetY-a-i*e.pivot.y)+") scale("+n/o+","+i/r+")")},eAi.prototype.drawClipPath=function(e,t,i,n,o){var r=e.contentSize.width,s=e.contentSize.height,n=e.width/(n/r),i=e.height/(i/s),r=e.templatePosition.x+(e.width>=e.height?0:(r-n)/2),s=e.templatePosition.y+(e.height>=e.width?0:(s-i)/2),a=o.getElementById(e.id+"_clip"),o=((a=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id",e.id+"_clip"),t.appendChild(a),o.getElementById(e.id+"_clip_rect"),document.createElementNS("http://www.w3.org/2000/svg","rect"));return a.appendChild(o),vTi(o,{id:e.id+"_clip_rect",width:n.toString(),height:i.toString(),x:r.toString(),y:s.toString()}),P1i()?t.setAttribute("clip-path","url("+location.protocol+"//"+location.host+location.pathname+"#"+e.id+"_clip)"):t.setAttribute("clip-path","url(#"+e.id+"_clip)"),t},eAi.prototype.renderGradient=function(e,t,i){var n,o,r,s=aTi(i),a=s.getElementById(i+"gradient_pattern");if(a||(a=cTi("defs",{id:i+"gradient_pattern"}),s.insertBefore(a,s.firstChild)),$Ai(t.id),"None"!==e.gradient.type){for(var l=0;l<e.gradient.stops.length;l++)n=n?Math.max(n,e.gradient.stops[parseInt(l.toString(),10)].offset):e.gradient.stops[parseInt(l.toString(),10)].offset,o=o?Math.min(o,e.gradient.stops[parseInt(l.toString(),10)].offset):e.gradient.stops[parseInt(l.toString(),10)].offset;r="Linear"===e.gradient.type?((i=e.gradient).id=t.id+"_linear",this.createLinearGradient(i)):((s=e.gradient).id=t.id+"_radial",this.createRadialGradient(s)),a.appendChild(r);for(l=0;l<e.gradient.stops.length;l++){var h=e.gradient.stops[parseInt(l.toString(),10)],d=o<0?(n+h.offset)/(2*n):h.offset/n,p=document.createElementNS("http://www.w3.org/2000/svg","stop");vTi(p,{offset:d.toString(),style:"stop-color:"+h.color}),r.appendChild(p)}}return r},eAi.prototype.createLinearGradient=function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");return vTi(t,{id:e.id,x1:e.x1+"%",y1:e.y1+"%",x2:e.x2+"%",y2:e.y2+"%"}),t},eAi.prototype.createRadialGradient=function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","radialGradient");return vTi(t,{id:e.id,cx:e.cx+"%",cy:e.cy+"%",r:e.r+"%",fx:e.fx+"%",fy:e.fy+"%"}),t},eAi.prototype.setSvgStyle=function(e,t,i){var n,o;(t.canApplyStyle||void 0===t.canApplyStyle)&&("none"===t.fill&&(t.fill="transparent"),"none"===t.stroke&&(t.stroke="transparent"),n=[],o=void 0,t.dashArray&&(n=(new WTi).parseDashArray(t.dashArray)),o=t.gradient&&"None"!==t.gradient.type&&i?(i=this.renderGradient(t,e,i),P1i()?"url("+location.protocol+"//"+location.host+location.pathname+"#"+i.id+")":"url(#"+i.id+")"):t.fill,t.stroke&&e.setAttribute("stroke",t.stroke),void 0!==t.strokeWidth&&null!==t.strokeWidth&&e.setAttribute("stroke-width",t.strokeWidth.toString()),n&&e.setAttribute("stroke-dasharray",n.toString()||"none"),o)&&e.setAttribute("fill",o)},eAi.prototype.svgLabelAlign=function(e,t,i){var i=new Omi(t.width,i.length*(1.2*e.fontSize)),n={x:0,y:0},o=.5*e.width,r=.5*e.height;return"left"===e.textAlign||"justify"===e.textAlign?o=0:"center"===e.textAlign?o=t.width>e.width&&("Ellipsis"===e.textOverflow||"Clip"===e.textOverflow)&&"NoWrap"===e.textWrapping?0:.5*e.width:"right"===e.textAlign&&(o=+e.width),n.x=0+o+(t?t.x:0),n.y=1.2+r-i.height/2,n};var $Si=eAi;function eAi(){}iAi.prototype.setCursor=function(e,t){e.style.cursor=t},iAi.prototype.setLayers=function(){this.iconSvgLayer=this.element.getElementsByClassName("e-ports-expand-layer")[0],this.adornerSvgLayer=this.element.getElementsByClassName("e-adorner-layer")[0],this.nativeSvgLayer=this.element.getElementsByClassName("e-native-layer")[0],this.diagramSvgLayer=this.element.getElementsByClassName("e-diagram-layer")[0]},iAi.prototype.getAdornerLayer=function(){return nTi(this.diagramId)},iAi.prototype.getParentSvg=function(e,t,i){return this.diagramId&&e&&e.id?1<e.id.split("_icon_content").length||1<e.id.split("_nodeport").length||e.elementActions&Jfi.ElementIsPort?this.iconSvgLayer:t&&"selector"===t?this.adornerSvgLayer:e instanceof Qyi?this.nativeSvgLayer:this.diagramSvgLayer:i},iAi.prototype.getParentElement=function(e,t,i,n){var o=t;return i&&this.diagramId&&e&&e.id&&(1<e.id.split("_icon_content").length?(o=i.getElementById(this.diagramId+"_diagramExpander"),t=null):1<e.id.split("_nodeport").length?o=i.getElementById(this.diagramId+"_diagramPorts"):e instanceof Qyi?(o=i.getElementById(this.diagramId+"_nativeLayer"),t=null):e.elementActions&Jfi.ElementIsPort?(o=i.getElementById(this.diagramId+"_diagramPorts"),t=null):o=i.getElementById(this.diagramId+"_diagramLayer"),o=(e=this.getGroupElement(e,t||o,n)).g,e.svg)&&(i=e.svg),{g:o,svg:i}},iAi.prototype.getGroupElement=function(e,t,i){var n,o,r=this.getParentSvg(e);return t&&r&&(r&&!(n=r.getElementById(e.id+"_groupElement"))&&r!==this.nativeSvgLayer&&(n=(r=this.nativeSvgLayer).getElementById(e.id+"_groupElement"),o=r),n||(n=this.svgRenderer.createGElement("g",{id:e.id+"_groupElement"}),void 0!==i&&t.childNodes.length>i?t.insertBefore(n,t.childNodes[parseInt(i.toString(),10)]):t.appendChild(n))),{g:n,svg:o}},iAi.prototype.renderElement=function(e,t,i,n,o,r,s,a,l,h,d){e instanceof Syi?(e.id=e.id||xTi(),this.renderContainer(e,t,i,n,o,r,s,a,l,h,d)):e instanceof Lyi?this.renderImageElement(e,t,n,o,s):e instanceof kyi?this.renderPathElement(e,t,n,o,s,l,d):e instanceof Tyi?this.renderTextElement(e,t,n,o,s,h):e instanceof Qyi?this.renderNativeElement(e,t,n,o,s):e instanceof Tvi?this.renderHTMLElement(e,t,i,n,o,s,a):this.renderRect(e,t,n,o,l)},iAi.prototype.drawSelectionRectangle=function(e,t,i,n,o,r){e=(e+r.tx)*r.scale,t=(t+r.ty)*r.scale;i={width:i*r.scale,height:n*r.scale,x:e+.5,y:t+.5,fill:"transparent",stroke:"gray",angle:0,pivotX:.5,pivotY:.5,strokeWidth:1,dashArray:"6 3",opacity:1,visible:!0,id:o.id+"_selected_region"},n=this.getAdornerLayer();this.svgRenderer.updateSelectionRegion(n,i)},iAi.prototype.renderHighlighter=function(e,t,i){var n=e.actualSize.width||2,o=e.actualSize.height||2,r=e.offsetX-n*e.pivot.x,s=e.offsetY-o*e.pivot.y,r=(r+i.tx)*i.scale,s=(s+i.ty)*i.scale,n={width:n*i.scale,height:o*i.scale,x:r,y:s,fill:"transparent",stroke:"#8CC63F",angle:e.rotateAngle,pivotX:e.pivot.x,pivotY:e.pivot.y,strokeWidth:4,dashArray:"",opacity:1,cornerRadius:0,visible:!0,id:t.id+"_highlighter",class:"e-diagram-highlighter"};this.svgRenderer.drawRectangle(t,n,this.diagramId,void 0,void 0,t)},iAi.prototype.renderSelectionRectangle=function(e,t,i,n){var o=e.actualSize.width||2,r=e.actualSize.height||2,s=e.offsetX-o*e.pivot.x,a=e.offsetY-r*e.pivot.y,s=(s+i.tx)*i.scale,a=(a+i.ty)*i.scale,o={width:o*i.scale,height:r*i.scale,x:s,y:a,fill:"transparent",stroke:"#00cc00",angle:e.rotateAngle,pivotX:e.pivot.x,pivotY:e.pivot.y,strokeWidth:n?2:1,dashArray:"",opacity:1,cornerRadius:0,visible:!0,id:e.id+"_highlighter",class:n?"e-diagram-first-selection-indicator e-diagram-selection-indicator":"e-diagram-selection-indicator"},r=this.getParentSvg(e,"selector");this.svgRenderer.drawRectangle(t,o,this.diagramId,void 0,void 0,r)},iAi.prototype.renderSelectionLine=function(e,t,i,n){var o=this.getBaseAttributes(e,i),r=(o.data=e.absolutePath,o.id=o.id+"_highlighter",e.description||e.id),n=(this.isSvgMode||(o.x=e.flipOffset.x||o.x,o.y=e.flipOffset.y||o.y),i&&(o.x=o.x*i.scale,o.y=o.y*i.scale),o.stroke="#00cc00",o.strokeWidth=n?2:1,o.class=n?"e-diagram-first-selection-indicator e-diagram-selection-indicator":"e-diagram-selection-indicator",this.getParentSvg(e,"selector"));this.svgRenderer.drawPath(t,o,this.diagramId,void 0,n,r,i.scale)},iAi.prototype.renderStackHighlighter=function(e,t,i,n,o,r,s){var a,l,h=e.actualSize.width||2,d=e.offsetX-h*e.pivot.x,p=e.actualSize.height||2,c=e.offsetY-p*e.pivot.y,d=(d+i.tx)*i.scale,u=e.bounds,g="",c=(c+i.ty)*i.scale,n=(n?r?(l="M 0 0 L "+((a=h*i.scale)+2)+" 0 Z",n=-u.x,r=-u.y,n=e.actualSize.width/Number(u.width||1)*i.scale,r=e.actualSize.height/Number(u.height||1)*i.scale,g=Ymi(Jmi(jmi("M7,4 L8,4 8,7 11,7 11,8 8,8 8,11 7,11 7,8 4,8 4,7 7,7 z M7.5,0.99999994C3.9160004,1 1,3.9160004 0.99999994,7.5 1,11.084 3.9160004,14 7.5,14 11.084,14 14,11.084 14,7.5 14,3.9160004 11.084,1 7.5,0.99999994 z M7.5,0 C11.636002,0 15,3.3639984 15,7.5 15,11.636002 11.636002,15 7.5,15 3.3640003,15 0,11.636002 0,7.5 0,3.3639984 3.3640003,0 7.5,0 z")),n+a+2,r-8,!1,u.x,u.y,0,0),o.y>=e.offsetY&&(c+=p)):(s&&o.y>=e.offsetY&&(c+=p*i.scale),l="M -10 -10 L 0 0 Z M -10 10 L 0 0 Z M 0 0 L "+(a=h*i.scale)+" 0 Z M "+a+" 0 L "+(a+10)+" 10 Z L "+(a+10)+" -10 Z"):(l="M 10 -10 L 0 0 Z M -10 -10 L 0 0 Z M 0 0 L 0 "+(a=p*i.scale)+" Z M 0  "+a+" L -10  "+(a+10)+" Z L 10  "+(a+10)+" Z",o.x>=e.offsetX&&(d+=h*i.scale)),{data:l+g,width:h*i.scale,height:p*i.scale,x:d,y:c,fill:"transparent",stroke:"#8CC63F",angle:e.rotateAngle,pivotX:e.pivot.x,pivotY:e.pivot.y,strokeWidth:1,dashArray:"",opacity:1,visible:!0,id:t.id+"_stack_highlighter",class:"e-diagram-highlighter"});this.svgRenderer.drawPath(t,n,this.diagramId)},iAi.prototype.drawLine=function(e,t){this.svgRenderer.drawLine(e,t)},iAi.prototype.drawPath=function(e,t){this.svgRenderer.drawPath(e,t,this.diagramId)},iAi.prototype.renderResizeHandle=function(e,t,i,n,o,r,s,a,l,h,d){var p=e.offsetX-e.actualSize.width*e.pivot.x,c=e.offsetY-e.actualSize.height*e.pivot.y,u=e.actualSize.height,g=e.actualSize.width,m=(!h&&i&Zfi.Rotate&&hbi(this.rendererActions)&&!dbi(this.rendererActions)?(this.renderPivotLine(e,t,r,o,s),this.renderRotateThumb(e,t,r,o,s)):this.touchMove&&(m=document.getElementById("rotateThumb"))&&m.setAttribute("visibility","hidden"),this.renderBorder(e,t,r,a,l,h),e.actualSize.width*n),a=e.actualSize.height*n;l||!hbi(this.rendererActions)||dbi(this.rendererActions)||e.isTextAnnotation||(40<=m&&40<=a&&(o&Ufi.ResizeNorthWest&&this.renderCircularHandle("resizeNorthWest",e,p,c,t,o1i(o,"ResizeNorthWest"),i&Zfi.ResizeNorthWest,r,void 0,s,{"aria-label":"Thumb to resize the selected object on top left side direction"},void 0,"e-diagram-resize-handle e-northwest",d),o&Ufi.ResizeNorthEast&&this.renderCircularHandle("resizeNorthEast",e,p+g,c,t,o1i(o,"ResizeNorthEast"),i&Zfi.ResizeNorthEast,r,void 0,s,{"aria-label":"Thumb to resize the selected object on top right side direction"},void 0,"e-diagram-resize-handle e-northeast",d),o&Ufi.ResizeSouthWest&&this.renderCircularHandle("resizeSouthWest",e,p,c+u,t,o1i(o,"ResizeSouthWest"),i&Zfi.ResizeSouthWest,r,void 0,s,{"aria-label":"Thumb to resize the selected object on bottom left side direction"},void 0,"e-diagram-resize-handle e-southwest",d),o&Ufi.ResizeSouthEast)&&this.renderCircularHandle("resizeSouthEast",e,p+g,c+u,t,o1i(o,"ResizeSouthEast"),i&Zfi.ResizeSouthEast,r,void 0,s,{"aria-label":"Thumb to resize the selected object on bottom right side direction"},void 0,"e-diagram-resize-handle e-southeast",d),o&Ufi.ResizeNorth&&this.renderCircularHandle("resizeNorth",e,p+g/2,c,t,o1i(o,"ResizeNorth"),i&Zfi.ResizeNorth,r,void 0,s,{"aria-label":"Thumb to resize the selected object on top side direction"},void 0,"e-diagram-resize-handle e-north",d),o&Ufi.ResizeSouth&&this.renderCircularHandle("resizeSouth",e,p+g/2,c+u,t,o1i(o,"ResizeSouth"),i&Zfi.ResizeSouth,r,void 0,s,{"aria-label":"Thumb to resize the selected object on bottom side direction"},void 0,"e-diagram-resize-handle e-south",d),o&Ufi.ResizeWest&&this.renderCircularHandle("resizeWest",e,p,c+u/2,t,o1i(o,"ResizeWest"),i&Zfi.ResizeWest,r,void 0,s,{"aria-label":"Thumb to resize the selected object on left side direction"},void 0,"e-diagram-resize-handle e-west",d),o&Ufi.ResizeEast&&this.renderCircularHandle("resizeEast",e,p+g,c+u/2,t,o1i(o,"ResizeEast"),i&Zfi.ResizeEast,r,void 0,s,{"aria-label":"Thumb to resize the selected object on right side direction"},void 0,"e-diagram-resize-handle e-east",d))},iAi.prototype.renderEndPointHandle=function(e,t,i,n,o,r,s,a,l,h){var d=e.sourcePoint,p=e.targetPoint,c=e.wrapper;if(this.renderCircularHandle("connectorSourceThumb",c,d.x,d.y,t,o1i(n,"ConnectorSourceThumb"),i&Zfi.ConnectorSource,o,r,void 0,{"aria-label":"Thumb to move the source point of the connector"},void 0,"e-diagram-endpoint-handle e-sourceend",h),this.renderCircularHandle("connectorTargetThumb",c,p.x,p.y,t,o1i(n,"ConnectorTargetThumb"),i&Zfi.ConnectorTarget,o,s,void 0,{"aria-label":"Thumb to move the target point of the connector"},void 0,"e-diagram-endpoint-handle e-targetend",h),a)if("Straight"===e.type&&0<e.segments.length)for(b=0;b<e.segments.length-1;b++){var u=e.segments[parseInt(b.toString(),10)],g="e-diagram-straight-segment-handle";this.renderCircularHandle("segementThumb_"+(b+1),c,u.point.x,u.point.y,t,!0,i&Zfi.ConnectorSource,o,r,null,null,b,g,h)}else if("Bezier"===e.type&&0<e.segments.length)for(b=0;b<e.segments.length-1;b++){u=e.segments[parseInt(b.toString(),10)];g="e-diagram-bezier-segment-handle";this.renderBezierHandle("segementThumb_"+(b+1),c,u.point.x,u.point.y,t,!0,e,o,r,null,b,g,h)}else if(e.maxSegmentThumb){var d=e.segments.length<=e.maxSegmentThumb?0:1,m=e.segments.length<=e.maxSegmentThumb?e.segments.length:e.segments.length-1;for(3<=e.maxSegmentThumb&&3===e.segments.length&&(m=e.segments.length-(d=1)),d=e.segments.length>e.maxSegmentThumb+2?2:d,m=e.segments.length>e.maxSegmentThumb+2?e.segments.length-2:m,1===e.segments.length&&e.segments[0].points.length<=2&&(d=1,m=e.segments.length),b=d;b<m;b++){f=e.segments[parseInt(b.toString(),10)];this.renderOrthogonalThumbs("orthoThumb_"+(b+1),c,f,t,o1i(n,"ConnectorSourceThumb"),o,e)}}else for(b=0;b<e.segments.length;b++){var f=e.segments[parseInt(b.toString(),10)];this.renderOrthogonalThumbs("orthoThumb_"+(b+1),c,f,t,o1i(n,"ConnectorSourceThumb"),o,e)}if("Bezier"===e.type&&l)for(var y=e.segments.length-1,v=null!=e.bezierSettings?e.bezierSettings.controlPointsVisibility:null,b=0;b<=y;b++){var w=e.segments[parseInt(b.toString(),10)],C=Hmi.isEmptyPoint(w.point1)?w.bezierPoint1:w.point1;(null!=v&&0===b&&r1i(v,"Source")||0!==b&&r1i(v,"Intermediate"))&&(this.renderCircularHandle("bezierPoint_"+(b+1)+"_1",c,C.x,C.y,t,o1i(n,"ConnectorSourceThumb"),i&Zfi.ConnectorSource,o,void 0,void 0,{"aria-label":"Thumb to move the source point of the connector"},void 0,"e-diagram-bezier-control-handle e-source",h),o1i(n,"ConnectorSourceThumb"))&&this.renderBezierLine("bezierLine_"+(b+1)+"_1",c,t,w.points[0],Hmi.isEmptyPoint(w.point1)?w.bezierPoint1:w.point1,o),C=Hmi.isEmptyPoint(w.point2)?w.bezierPoint2:w.point2,(null!=v&&b===y&&r1i(v,"Target")||b!==y&&r1i(v,"Intermediate"))&&(this.renderCircularHandle("bezierPoint_"+(b+1)+"_2",c,C.x,C.y,t,o1i(n,"ConnectorTargetThumb"),i&Zfi.ConnectorTarget,o,void 0,void 0,{"aria-label":"Thumb to move the target point of the connector"},void 0,"e-diagram-bezier-control-handle e-target",h),o1i(n,"ConnectorTargetThumb"))&&this.renderBezierLine("bezierLine_"+(b+1)+"_2",c,t,w.points[1],Hmi.isEmptyPoint(w.point2)?w.bezierPoint2:w.point2,o)}},iAi.prototype.renderOrthogonalThumbs=function(e,t,i,n,o,r,s){var a,l,h,d,p=0;if(s.maxSegmentThumb)for(var c=i.points.length<3?0:1,u=i.points.length<3?i.points.length-1:i.points.length-2,c=1===s.segments.length?c:0,u=1===s.segments.length?u:i.points.length-1,p=c;p<u;p++)h=Hmi.distancePoints(i.points[parseInt(p.toString(),10)],i.points[p+1]),a=i.points[parseInt(p.toString(),10)].y.toFixed(2)===i.points[p+1].y.toFixed(2)?"horizontal":"vertical",l=!!(50<=h&&i.allowDrag),this.renderOrthogonalThumb(e+"_"+(p+1),t,(i.points[parseInt(p.toString(),10)].x+i.points[p+1].x)/2,(i.points[parseInt(p.toString(),10)].y+i.points[p+1].y)/2,n,l,a,r,s,d);else for(p=0;p<i.points.length-1;p++)h=Hmi.distancePoints(i.points[parseInt(p.toString(),10)],i.points[p+1]),a=i.points[parseInt(p.toString(),10)].y.toFixed(2)===i.points[p+1].y.toFixed(2)?"horizontal":"vertical",d=Hmi.direction(i.points[parseInt(p.toString(),10)],i.points[p+1]),l=!!(50<=h&&i.allowDrag),this.renderOrthogonalThumb(e+"_"+(p+1),t,(i.points[parseInt(p.toString(),10)].x+i.points[p+1].x)/2,(i.points[parseInt(p.toString(),10)].y+i.points[p+1].y)/2,n,l,a,r,s,d)},iAi.prototype.renderOrthogonalThumb=function(e,t,i,n,o,r,s,a,l,h){var d=0,p=document.getElementById(this.diagramId);p&&(c=p.ej2_instances[0]);var p=(l.constraints&Yfi.InheritSegmentThumbShape?c:l).segmentThumbShape,c=(l.constraints&Yfi.InheritSegmentThumbSize?c:l).segmentThumbSize,l=("horizontal"===s?A0i:x0i)(p);if("Arrow"===p||"DoubleArrow"===p||"OpenArrow"===p)switch(h){case"Bottom":case"Right":d=180;break;default:d=0}else if("Fletch"===p||"OpenFetch"===p||"IndentedArrow"===p||"OutdentedArrow"===p)switch(h){case"Bottom":d=-90;break;case"Top":d=90;break;case"Right":d=180;break;default:d=0}s={x:(i+a.tx)*a.scale-c/2,y:(n+a.ty)*a.scale-c/2,angle:d,fill:"#e2e2e2",stroke:"black",strokeWidth:1,dashArray:"",data:l,width:c,height:c,pivotX:.5,pivotY:.5,opacity:1,visible:r,id:e,class:"e-diagram-ortho-segment-handle"},p=XIi(s.data),h=new Omi(s.width,s.height),i=new kyi;s.data=i.updatePath(s.data,p,h),this.touchMove&&(n=document.getElementById(e))?this.updateSegmentPosition(n,s):this.svgRenderer.drawPath(o,s,this.diagramId)},iAi.prototype.renderPivotLine=function(e,t,i,n,o){n=!!(n&Ufi.Rotate),o&&(n=!1),o=this.getBaseAttributes(e,i),o.fill="None",o.stroke="black",o.strokeWidth=1,o.dashArray="2,3",o.visible=n,n=i.scale,o.x*=n,o.y*=n,o.width*=n,o.height*=n,o.id="pivotLine",o.class="e-diagram-pivot-line",i={x:e.actualSize.width*e.pivot.x*n,y:-20},e={x:e.actualSize.width*e.pivot.x*n,y:0};o.startPoint=i,o.endPoint=e,this.svgRenderer.drawLine(t,o)},iAi.prototype.renderBezierLine=function(e,t,i,n,o,r){var t=this.getBaseAttributes(t,r),e=(t.id=e,t.stroke="black",t.strokeWidth=1,t.dashArray="3,3",t.fill="None",t.class="e-diagram-bezier-control-line",t.x=0,t.y=0,r.scale),s=(n.x+r.tx)*e,n=(n.y+r.ty)*e,o={x:(o.x+r.tx)*e,y:(o.y+r.ty)*e};t.startPoint={x:s,y:n},t.endPoint=o,this.svgRenderer.drawLine(i,t)},iAi.prototype.renderCircularHandle=function(e,t,i,n,o,r,s,a,l,h,d,p,c,u){var g=t,i={x:i,y:n},n=(0===g.rotateAngle&&0===g.parentTransform||(afi(n=ofi(),g.rotateAngle+g.parentTransform,g.offsetX,g.offsetY),i=rfi(n,i)),this.getBaseAttributes(g));n.stroke="black",n.strokeWidth=1,void 0!==p?(n.id="segmentEnd_"+p,n.fill="#e2e2e2"):n.fill=l?"#8CC63F":"white",n.cornerRadius=u/2,n.angle=t.rotateAngle,n.id=e,n.visible=r,n.class=c,n.width=u,n.height=u,n.x=(i.x+a.tx)*a.scale,n.y=(i.y+a.ty)*a.scale,n.x=n.x-n.width/2,n.y=n.y-n.height/2,l&&(n.class+=" e-connected"),h&&(n.visible=!1),this.touchMove&&(g=document.getElementById(e))?this.updateResizeHandle(g,n):(p=this.getParentSvg(t,"selector"),this.svgRenderer.drawRectangle(o,n,this.diagramId,!0,!0,p,d,!0,s))},iAi.prototype.updateResizeHandle=function(e,t){vTi(e,{id:t.id,x:t.x.toString(),y:t.y.toString(),width:t.width.toString(),height:t.height.toString(),visibility:t.visible?"visible":"hidden",transform:"rotate("+t.angle+","+(t.x+t.width/2)+","+(t.y+t.height/2)+")",rx:t.cornerRadius||0,ry:t.cornerRadius||0,opacity:t.opacity})},iAi.prototype.renderBezierHandle=function(e,t,i,n,o,r,s,a,l,h,d,p,c){var u=document.getElementById(this.diagramId),u=(u&&(g=u.ej2_instances[0]),t),i={x:i,y:n};0===u.rotateAngle&&0===u.parentTransform||(afi(n=ofi(),u.rotateAngle+u.parentTransform,u.offsetX,u.offsetY),i=rfi(n,i));var n=(s.constraints&Yfi.InheritSegmentThumbShape?g:s).segmentThumbShape,g=(s.constraints&Yfi.InheritSegmentThumbSize?g:s).segmentThumbSize,s=x0i(n),n=this.getBaseAttributes(u),u=(n.stroke="black",n.strokeWidth=1,void 0!==d?(n.id="segmentEnd_"+d,n.fill="#e2e2e2"):n.fill=l?"#8CC63F":"white",n.angle=t.rotateAngle,n.id=e,n.visible=r,n.class=p,n.width=g,n.height=g,n.data=s,n.x=(i.x+a.tx)*a.scale,n.y=(i.y+a.ty)*a.scale,n.x=n.x-n.width/2,n.y=n.y-n.height/2,l&&(n.class+=" e-connected"),h&&(n.visible=!1),XIi(n.data)),d=new Omi(n.width,n.height),r=new kyi;n.data=r.updatePath(n.data,u,d),this.touchMove&&(p=document.getElementById(e))?this.updateSegmentPosition(p,n):(g=this.getParentSvg(t,"selector"),this.svgRenderer.drawPath(o,n,this.diagramId,!0,g))},iAi.prototype.updateSegmentPosition=function(e,t){vTi(e,{id:t.id,transform:"rotate("+t.angle+","+(t.x+t.width*t.pivotX)+","+(t.y+t.height*t.pivotY)+")translate("+t.x+","+t.y+")",visibility:t.visible?"visible":"hidden",opacity:t.opacity})},iAi.prototype.renderBorder=function(e,t,i,n,o,r){var s=this.getBaseAttributes(e,i),i=(s.x*=i.scale,s.y*=i.scale,s.width*=i.scale,s.height*=i.scale,s.fill="transparent",s.stroke="#097F7F",s.strokeWidth=1.2,s.gradient=null,s.dashArray="6,3",s.class="e-diagram-selector",r&&(s.class+=" e-diagram-lane"),s.id="borderRect",s.id=this.rendererActions&syi.DrawSelectorBorder?"borderRect_symbol":"borderRect",n||(s.class+=" e-disabled"),o&&(s.class+=" e-thick-border"),s.cornerRadius=0,this.getParentSvg(e,"selector"));this.svgRenderer.drawRectangle(t,s,this.diagramId,void 0,!0,i)},iAi.prototype.renderUserHandler=function(e,t,i,n,o,r){for(var s=e.wrapper,a=0,l=e.userHandles;a<l.length;a++){var h,d=l[a],p=!0,c=((d.disableConnectors&&0<e.connectors.length||d.disableNodes&&0<e.nodes.length||"Drag"===o&&r)&&(p=!1),document.getElementById(d.name+"_template_hiddenUserHandle")),c=(c&&(d.template=c.childNodes[0].cloneNode(!0)),i1i(e,d,i));c.x=(c.x+i.tx)*i.scale,c.y=(c.y+i.ty)*i.scale,d.visible&&(d.visible=!!(e.constraints&Ufi.UserHandle)),p&&(d.pathData?(p=d.pathData||d.content,(h=this.getBaseAttributes(s)).id=d.name+"_userhandle",h.fill=d.backgroundColor,h.stroke=d.borderColor,h.strokeWidth=d.borderWidth,h.centerX=c.x,h.centerY=c.y,h.radius=.5*d.size,h.class="e-diagram-userhandle-circle",h.angle=0,h.visible=d.visible,h.opacity=1,this.svgRenderer.drawCircle(t,h,1,{"aria-label":d.name+"user handle"}),h=[],h=Jmi(h=jmi(p)),p=XIi(p),p=XIi(h=Ymi(h,(d.size-.45*d.size)/p.width,(d.size-.45*d.size)/p.height,!0,p.x,p.y,0,0)),h={x:c.x-p.width/2,y:c.y-p.height/2,angle:0,id:"",class:"e-diagram-userhandle-path",fill:d.pathColor,stroke:d.backgroundColor,strokeWidth:.5,dashArray:"",data:h,width:d.size-5,height:d.size-5,pivotX:0,pivotY:0,opacity:1,visible:d.visible},this.svgRenderer.drawPath(t,h,this.diagramId,void 0,void 0,{"aria-label":d.name+"user handle"})):d.content?((p=new Qyi(d.name,this.diagramId)).content=d.content,p.offsetX=c.x,p.offsetY=c.y,p.id=d.name+"_shape",p.horizontalAlignment="Center",p.verticalAlignment="Center",p.visible=d.visible,p.setOffsetWithRespectToBounds(c.x,c.y,"Fraction"),p.relativeMode="Object",p.description=d.name||"User handle",p.measure(new Omi(d.size,d.size)),p.arrange(p.desiredSize),this.svgRenderer.drawNativeContent(p,t,d.size,d.size,this.adornerSvgLayer)):d.source?(p=new Lyi,(h=this.getBaseAttributes(p,i)).width=d.size,h.height=d.size,h.x=c.x-d.size/2,h.y=c.y-d.size/2,h.sourceWidth=d.size,h.sourceHeight=d.size,h.alignment=p.imageAlign,h.source=d.source,h.scale=p.imageScale,h.visible=d.visible,h.description=d.name||"User handle",h.id=d.name+"_",this.renderer.drawImage(t,h,this.adornerSvgLayer,!1)):((p=new Tvi(d.name,this.diagramId)).offsetX=c.x,p.offsetY=c.y,p.id=d.name+"_shape",p.visible=d.visible,p.relativeMode="Object",p.template=d.template,p.measure(new Omi(d.size,d.size)),p.arrange(p.desiredSize),this.svgRenderer.drawHTMLContent(p,n,void 0,!0,void 0)))}},iAi.prototype.renderRotateThumb=function(e,t,i,n,o){new kyi;var r=new Omi,s=(r.width=18,r.height=16,e.offsetY-e.actualSize.height*e.pivot.y),a=e.offsetX-e.actualSize.width*e.pivot.x,n=!!(n&Ufi.Rotate),o=(o&&(n=!1),(a+e.pivot.x*e.actualSize.width+i.tx)*i.scale),a=(s+i.ty)*i.scale,s={x:o-.5*r.width,y:a-30-.5*r.height},a=(0===e.rotateAngle&&0===e.parentTransform||(afi(o=ofi(),e.rotateAngle+e.parentTransform,(i.tx+e.offsetX)*i.scale,(i.ty+e.offsetY)*i.scale),s=rfi(o,s)),{x:s.x,y:s.y,angle:e.rotateAngle+e.parentTransform,fill:"#231f20",stroke:"black",strokeWidth:.5,dashArray:"",data:"M 16.856144362449648 10.238890446662904 L 18.000144362449646 3.437890446662903L 15.811144362449646 4.254890446662903 C 14.837144362449646 2.5608904466629028 13.329144362449647  1.2598904466629026 11.485144362449645 0.5588904466629026 C 9.375144362449646 - 0.24510955333709716 7.071144362449646  - 0.18010955333709716 5.010144362449646 0.7438904466629028 C 2.942144362449646 1.6678904466629028 1.365144362449646 3.341890446662903 0.558144362449646 5.452890446662903 C - 0.244855637550354 7.567890446662903 - 0.17985563755035394 9.866890446662904 0.7431443624496461 11.930890446662904 C 1.6681443624496461 13.994890446662904 3.343144362449646 15.575890446662903 5.457144362449647 16.380890446662903 C 6.426144362449647 16.7518904466629 7.450144362449647 16.9348904466629 8.470144362449647 16.9348904466629 C 9.815144362449647 16.9348904466629 11.155144362449647 16.6178904466629 12.367144362449647 15.986890446662901 L 11.351144362449647 14.024890446662901 C 9.767144362449647 14.8468904466629 7.906144362449647 14.953890446662902 6.237144362449647 14.3178904466629 C 4.677144362449647 13.7218904466629 3.444144362449647 12.5558904466629 2.758144362449647 11.028890446662901 C 2.078144362449646 9.501890446662903 2.031144362449646 7.802890446662903 2.622144362449646 6.243890446662903 C 3.216144362449646 4.6798904466629025 4.387144362449646 3.442890446662903 5.914144362449646 2.760890446662903 C 7.437144362449646 2.078890446662903 9.137144362449646 2.0298904466629026 10.700144362449645 2.6258904466629027 C 11.946144362449646 3.100890446662903 12.971144362449646 3.9538904466629026 13.686144362449646 5.049890446662903 L 11.540144362449645 5.850890446662903 L 16.856144362449648 10.238890446662904 Z",width:20,height:20,pivotX:0,pivotY:0,opacity:1,visible:n,id:e.id,class:"e-diagram-rotate-handle"});a.id="rotateThumb",this.touchMove&&(r=document.getElementById("rotateThumb"))?this.updateSegmentPosition(r,a):this.svgRenderer.drawPath(t,a,this.diagramId,!0,void 0,{"aria-label":"Thumb to rotate the selected object"})},iAi.prototype.renderPathElement=function(e,t,i,n,o,r,s){var a,i=this.getBaseAttributes(e,i,r),s=(i.data=e.absolutePath,i.data=e.absolutePath,e.isPathPort&&s&&(i.x=s[e.id]?s[e.id].cx:i.x,i.y=s[e.id]?s[e.id].cy:i.y,e.bounds.x=i.x,e.bounds.y=i.y,r=document.getElementById(this.diagramId))&&"PortDrag"!==r.ej2_instances[0].eventHandler.currentAction&&(e.offsetX=i.x+e.width/2,e.offsetY=i.y+e.height/2),e.description||e.id);e.isExport&&(r=e.absoluteBounds,a=jmi(i.data),a=this.findAndStoreArcValues(a),i.arc=a,i.data=JIi(e,r,0,i)),this.renderer.drawPath(t,i,this.diagramId,void 0,n,s,void 0,this,e)},iAi.prototype.findAndStoreArcValues=function(e){var t=[];return e.forEach(function(e){"A"===e.command&&(e={r1:e.r1/2,r2:e.r2/2},t.push(e))}),t},iAi.prototype.renderSvgGridlines=function(e,t,i,n,o,r){var s=document.createElementNS("http://www.w3.org/2000/svg","pattern"),a=document.createElementNS("http://www.w3.org/2000/svg","defs"),l=(a.setAttribute("id",this.diagramId+"_grid_pattern_defn"),(e.constraints&Qfi.ShowHorizontalLines||e.constraints&Qfi.ShowVerticalLines)&&s.setAttribute("id",this.diagramId+"_pattern"),0),h=0,d=0,p=0,c=1,u=!1,g="Lines"===e.gridType,m=g?e.verticalGridlines.lineIntervals:e.verticalGridlines.dotIntervals,f=g?e.horizontalGridlines.lineIntervals:e.horizontalGridlines.dotIntervals;if(n.showRulers&&n.dynamicGrid&&o&&r)d=r.updateSegmentWidth(i.scale),p=o.updateSegmentWidth(i.scale),e.horizontalGridlines.scaledIntervals=[d/o.interval],e.verticalGridlines.scaledIntervals=[p/r.interval],u=!0;else{for(var y=0;y<m.length;y+=1)l+=m[parseInt(y.toString(),10)];for(y=0;y<f.length;y+=1)h+=f[parseInt(y.toString(),10)];c=this.scaleSnapInterval(e,i.scale)}l=u?p:l*c,h=u?d:h*c;vTi(s,{id:this.diagramId+"_pattern",x:0,y:0,width:l,height:h,patternUnits:"userSpaceOnUse"}),this.horizontalSvgGridlines(s,l,h,c,e,n,r,u,g,f),this.verticalSvgGridlines(s,l,h,c,e,n,o,u,g,m),a.appendChild(s),t.appendChild(a)},iAi.prototype.horizontalSvgGridlines=function(e,t,i,n,o,r,s,a,l,h){var d=0,p=[];if(o.constraints&Qfi.ShowHorizontalLines){o.horizontalGridlines.lineDashArray&&(p=this.renderer.parseDashArray(o.horizontalGridlines.lineDashArray)),h=cAi(h=r.showRulers&&r.dynamicGrid&&s?this.updateLineIntervals(h,r,s,i,l):h,l);for(var c=0;c<h.length;c+=2){var d=pAi(h,l,c,d),u=document.createElementNS("http://www.w3.org/2000/svg",l?"path":"circle"),g=l?d+h[parseInt(c.toString(),10)]/2:d,g=a?g:g*n;l?(vTi(u,""===p.toString()?{"stroke-width":h[parseInt(c.toString(),10)],d:"M0,"+g+" L"+t+","+g+" Z",class:1.25===h[parseInt(c.toString(),10)]?"e-diagram-thick-grid":"e-diagram-thin-grid",stroke:o.horizontalGridlines.lineColor}:{"stroke-width":h[parseInt(c.toString(),10)],stroke:o.horizontalGridlines.lineColor,d:"M0,"+g+" L"+t+","+g+" Z",class:1.25===h[parseInt(c.toString(),10)]?"e-diagram-thick-grid":"e-diagram-thin-grid",dashArray:p.toString()}),e.appendChild(u),d+=h[c+1]+h[parseInt(c.toString(),10)]):(this.renderDotGrid(c,e,o,0,g,n,!0),d+=h[parseInt(c.toString(),10)])}}},iAi.prototype.renderDotGrid=function(e,t,i,n,o,r,s){for(var a,l,h,d=cAi((s?i.verticalGridlines:i.horizontalGridlines).dotIntervals,!1),p=1;p<d.length;p+=2)a=p===d.length-1?d[0]:d[p-1],h=n,h*=r,vTi(l=document.createElementNS("http://www.w3.org/2000/svg","circle"),{cx:s?h:o,cy:s?o:h,fill:i.horizontalGridlines.lineColor,r:a}),t.appendChild(l),n+=d[parseInt(p.toString(),10)]+d[p-1]},iAi.prototype.verticalSvgGridlines=function(e,t,i,n,o,r,s,a,l,h){var d=0,p=[];if(o.constraints&Qfi.ShowVerticalLines){o.verticalGridlines.lineDashArray&&(p=this.renderer.parseDashArray(o.verticalGridlines.lineDashArray));h=cAi(h=r.showRulers&&r.dynamicGrid&&s?this.updateLineIntervals(h,r,s,t,l):h,l);for(var c=0;c<h.length;c+=2){var d=pAi(h,l,c,d),u=l?d+h[parseInt(c.toString(),10)]/2:d,u=a?u:u*n,g=document.createElementNS("http://www.w3.org/2000/svg",l?"path":"circle");l?(vTi(g,""===p.toString()?{"stroke-width":h[parseInt(c.toString(),10)],d:"M"+u+",0 L"+u+","+i+" Z",class:1.25===h[parseInt(c.toString(),10)]?"e-diagram-thick-grid":"e-diagram-thin-grid",stroke:o.verticalGridlines.lineColor}:{"stroke-width":h[parseInt(c.toString(),10)],class:1.25===h[parseInt(c.toString(),10)]?"e-diagram-thick-grid":"e-diagram-thin-grid",stroke:o.verticalGridlines.lineColor,d:"M"+u+",0 L"+u+","+i+" Z",dashArray:p.toString()}),e.appendChild(g),d+=h[c+1]+h[parseInt(c.toString(),10)]):(this.renderDotGrid(c,e,o,0,u,n,!1),d+=h[parseInt(c.toString(),10)])}}},iAi.prototype.updateGrid=function(e,t,i,n,o,r){var s=t.getElementById(this.diagramId+"_grid_rect"),a=!1;if(s){for(var l=t.getElementById(this.diagramId+"_pattern"),h=(l&&l.parentNode.removeChild(l),0),d=0,p=1,c="Lines"===e.gridType,u=c?e.verticalGridlines.lineIntervals:e.verticalGridlines.dotIntervals,g=c?e.horizontalGridlines.lineIntervals:e.horizontalGridlines.dotIntervals,m=(n.showRulers&&n.dynamicGrid&&r&&o?(h=r.updateSegmentWidth(i.scale),d=o.updateSegmentWidth(i.scale),a=!0,e.horizontalGridlines.scaledIntervals=[h/o.interval],e.verticalGridlines.scaledIntervals=[d/r.interval]):p=this.scaleSnapInterval(e,i.scale),0),f=0;f<g.length;f+=1)m+=g[parseInt(f.toString(),10)];for(var y=0,f=0;f<u.length;f+=1)y+=u[parseInt(f.toString(),10)];vTi(s,{x:-i.tx*i.scale,y:-i.ty*i.scale}),s={id:this.diagramId+"_pattern",x:0,y:0,width:y=a?d:y*p,height:m=a?h:m*p,patternUnits:"userSpaceOnUse"},vTi(l=document.createElementNS("http://www.w3.org/2000/svg","pattern"),s),this.horizontalSvgGridlines(l,y,m,p,e,n,r,a,c,g),this.verticalSvgGridlines(l,y,m,p,e,n,o,a,c,u);i=t.getElementById(this.diagramId+"_grid_pattern_defn");i&&i.appendChild(l)}},iAi.prototype.updateLineIntervals=function(e,t,i,n,o){for(var r=[],s=n/i.interval,a=o?i.interval:i.interval+1,l=0;l<2*a;l++)r[parseInt(l.toString(),10)]=l%2==0?o?0===l?1.25:.25:0:o?s-r[l-1]:s;return r},iAi.prototype.scaleSnapInterval=function(e,t){if(2<=t)for(;2<=t;)t/=2;else if(t<=.5)for(;t<=.5;)t*=2;var i;if(e.horizontalGridlines.scaledIntervals=e.horizontalGridlines.snapIntervals,e.verticalGridlines.scaledIntervals=e.verticalGridlines.snapIntervals,1!==t){var n=e.horizontalGridlines;for(n.scaledIntervals=[],i=0;i<n.snapIntervals.length;i++)n.scaledIntervals[parseInt(i.toString(),10)]=n.snapIntervals[parseInt(i.toString(),10)]*t;for((n=e.verticalGridlines).scaledIntervals=[],i=0;i<n.snapIntervals.length;i++)n.scaledIntervals[parseInt(i.toString(),10)]=n.snapIntervals[parseInt(i.toString(),10)]*t}return t},iAi.prototype.renderTextElement=function(e,t,i,n,o,r){i=this.getBaseAttributes(e,i),r&&(i.x=r[e.id]?r[e.id].cx:i.x,i.y=r[e.id]?r[e.id].cy:i.y,e.bounds.x=i.x,e.bounds.y=i.y,e.isExport)&&(i.x=i.x*Math.min(e.exportScaleValue.x||e.exportScaleValue.y),i.y=i.y*Math.min(e.exportScaleValue.x||e.exportScaleValue.y)),i.cornerRadius=0,i.whiteSpace=VTi(e.style.whiteSpace,e.style.textWrapping),i.content=e.content,i.breakWord=LTi(e.style.textWrapping),i.textAlign=FTi(e.style.textAlign),i.color=e.style.color,i.italic=e.style.italic,i.bold=e.style.bold,i.fontSize=e.style.fontSize,i.fontFamily=e.style.fontFamily,i.textOverflow=e.style.textOverflow,i.textWrapping=e.style.textWrapping,i.textDecoration=e.style.textDecoration,i.doWrap=e.doWrap,i.wrapBounds=e.wrapBounds,i.childNodes=e.childNodes,i.isHorizontalLane=e.isLaneOrientation,i.id=e.id||xTi(),e.isLaneOrientation&&(i.parentOffsetX=this.groupElement.offsetX,i.parentOffsetY=this.groupElement.offsetY,i.parentWidth=this.groupElement.actualSize.width,i.parentHeight=this.groupElement.actualSize.height),i.dashArray="",i.strokeWidth=0,i.fill=e.style.fill,r=e.description||e.content||e.id;("Wrap"===e.style.textWrapping||"WrapWithOverflow"===e.style.textWrapping)&&this.groupElement&&i.height>this.groupElement.actualSize.height&&("Clip"===e.style.textOverflow||"Ellipsis"===e.style.textOverflow)&&(i.y=i.y+(i.height-this.groupElement.actualSize.height)/2),this.renderer.drawRectangle(t,i,this.diagramId,void 0,void 0,n),this.renderer.drawText(t,i,n,r,this.diagramId,e.isExport&&Math.min(e.exportScaleValue.x||e.exportScaleValue.y),this,e),this.isSvgMode&&(e.doWrap=!1)},iAi.prototype.renderNativeElement=function(e,t,i,n,o){var r,s,a=this.getParentSvg(e,void 0,t)||n,l=this.getParentElement(e,t,a).g||t,i=this.getBaseAttributes(e,i);switch(i.fill="transparent",i.cornerRadius=e.cornerRadius,i.stroke="transparent",this.renderer.drawRectangle(t,i,this.diagramId,void 0,void 0,n),e.scale){case"None":r=e.contentSize.width,s=e.contentSize.height;break;case"Stretch":r=e.actualSize.width,s=e.actualSize.height;break;case"Meet":r=s=e.actualSize.width<=e.actualSize.height?e.actualSize.width:e.actualSize.height;break;case"Slice":r=s=e.actualSize.width>=e.actualSize.height?e.actualSize.width:e.actualSize.height}this.svgRenderer&&this.svgRenderer.drawNativeContent(e,l,s,r,a)},iAi.prototype.renderHTMLElement=function(e,t,i,n,o,r,s){var a=this.getBaseAttributes(e,n);a.fill="transparent",a.cornerRadius=e.cornerRadius,a.stroke="transparent",this.renderer.drawRectangle(t,a,this.diagramId,void 0,void 0,o),this.svgRenderer&&this.svgRenderer.drawHTMLContent(e,i.children[0],n,yAi(i),s)},iAi.prototype.renderImageElement=function(e,t,i,n,o){var r,s,a,l,h,d=this.getBaseAttributes(e,i),p=(d.cornerRadius=0,this.renderer.drawRectangle(t,d,this.diagramId,void 0,void 0,n),e.contentSize.width),c=e.contentSize.height,u=d.width/p,g=d.height/c;if("Stretch"===e.stretch)r=p*(h=Math.min(u,g)),s=c*h;else switch(e.stretch){case"Meet":r=p*(h=Math.min(u,g)),s=c*h,d.x+=Math.abs(d.width-r)/2,d.y+=Math.abs(d.height-s)/2;break;case"Slice":h=Math.max(u,g),a=d.width/(r=p*h)*p,l=d.height/(s=c*h)*c;break;case"None":r=p,s=c}d.width=r,d.height=s,d.sourceWidth=a,d.sourceHeight=l,d.source=e.source,d.alignment=e.imageAlign,d.scale=e.imageScale,d.description=e.description||e.id,this.renderer.drawImage(t,d,n,o,this,e)},iAi.prototype.renderContainer=function(e,t,i,n,o,r,s,a,l,h,d){var p,c={svg:o,g:t},u=document.getElementById(this.diagramId);if(u&&(p=u.ej2_instances[0]),this.diagramId&&(o=this.getParentSvg(e)||o,this.isSvgMode)&&(u=this.getParentElement(e,t,o,a).g||t,o=this.getParentSvg(this.hasNativeParent(e.children))||o,b=this.getParentElement(this.hasNativeParent(e.children),u,o,a),c.svg=b.svg||o,c.g=b.g||u,t=(r&&o&&!o.getElementById(c.g.id)&&t.appendChild(c.g),c.g)),this.renderRect(e,t,n,o),(this.groupElement=e).hasChildren()){for(var g=void 0,m=0,f=e.children;m<f.length;m++){var y=f[m],v=(this.groupElement=e,o=this.getParentSvg(this.hasNativeParent(e.children)||y)||o,this.isSvgMode&&(g=(v=this.getParentElement(this.hasNativeParent(e.children)||y,t,o)).g||t,v.svg)&&(o=v.svg),this.isSvgMode||"Object"===y.relativeMode&&(y.flip=e.flip,y.id)&&(y.id.includes("_0_compensation")||y.id.includes("_0_adhoc"))&&e.children[0].flip&&(y.flip=e.children[0].flip),g);this.renderElement(y,g||t,i,n,o,!0,s,a,l,h,d),e.children&&e.children[0]instanceof Qyi&&(y instanceof Tyi||y.elementActions&Jfi.ElementIsPort)&&(v=document.getElementById(y.id+"_groupElement")),y instanceof Tyi&&v&&this.renderFlipTextElement(e,v,y,y.flip,y.flipMode)}var b=void 0,u=(p&&p.selectedItems&&p.selectedItems.nodes&&0<p.selectedItems.nodes.length&&(b=p.selectedItems.nodes[0]),void 0),r=!1,c=e.id.includes("group_container")?e.id.split("group_container")[0]:e.id,w=((b=w=p&&p.selectedItems?p.getObject(c):w)&&b.flipMode&&(r=!0),"");b&&(w=b.children?b.id+"group_container":b.id+"_content_groupElement"),p instanceof dDi&&p.nameTable[""+c]&&"connectors"!==p.nameTable[""+c].propName&&r&&b&&(u=e.children&&e.children[0]instanceof Qyi?document.getElementById(b.id+"_content_inner_native_element"):e.children&&e.children[0]instanceof Tvi&&(u=document.getElementById(b.id+"_content_html_element"))||document.getElementById(w),this.renderFlipElement(e,u,e.flip))}},iAi.prototype.renderFlipTextElement=function(e,t,i,n,o,r){var s,a,l,h={},d=1,p=1,c=0,u=0,g=0,m=0;return n!==jfi.None?(a=e.rotateAngle,0===e.rotateAngle&&e.id.includes("group_container")&&(a=e.parentTransform),(s=(s=i.getAbsolutePosition(i.desiredSize))?s:{x:.5*(l=i.desiredSize).width,y:.5*l.height})&&""!==i.content&&("All"===o||"LabelAndLabelText"===o?(n!==jfi.Horizontal&&n!==jfi.Both||(c=e.bounds.center.x,g=-e.bounds.center.x,d=-1),n!==jfi.Vertical&&n!==jfi.Both||(u=e.bounds.center.y,m=-e.bounds.center.y,p=-1),n!==jfi.Horizontal&&n!==jfi.Vertical||(l=Math.sin(a*Math.PI/180),void 0===s.y||isNaN(s.y)||(a=s.y/i.desiredSize.height,isNaN(a))||(g+=-e.desiredSize.height*l*(-2*a+1)),void 0===s.x)||isNaN(s.x)||(a=s.x/i.desiredSize.width,isNaN(a))||(m+=e.desiredSize.width*l*(-2*a+1)),h={transform:"translate("+c+","+u+") scale("+d+","+p+") translate("+g+","+m+")"}):"LabelText"===o||"PortAndLabelText"===o?(n!==jfi.Horizontal&&n!==jfi.Both||(c=i.offsetX,g=-i.offsetX,d=-1),n!==jfi.Vertical&&n!==jfi.Both||(u=i.offsetY,m=-i.offsetY,p=-1),h={transform:"translate("+c+","+u+") scale("+d+","+p+") translate("+g+","+m+")"}):"PortAndLabel"!==o&&"Label"!==o||(0,h={transform:"translate("+((l=this.flipLabel(e,i,s,n)).x-i.offsetX)+","+(l.y-i.offsetY)+")"}))):h={transform:"translate(0,0)"},r?h:(this.setFlipAttributes(e,t,h,d,p,!1),{})},iAi.prototype.renderFlipElement=function(e,t,i,n){var o={},r=1,s=1,a=0,l=0,h=0,d=0,o=i!==jfi.None?(i!==jfi.Horizontal&&i!==jfi.Both||(a=e.bounds.center.x,h=-e.bounds.center.x,r=-1),i!==jfi.Vertical&&i!==jfi.Both||(l=e.bounds.center.y,d=-e.bounds.center.y,s=-1),{transform:"translate("+a+","+l+") scale("+r+","+s+") translate("+h+","+d+")"}):{transform:"translate(0,0)"},i=e&&e.children&&e.children.length&&e.children[0]instanceof Tvi;return n?o:(this.setFlipAttributes(e,t,o,r,s,i),{})},iAi.prototype.setFlipAttributes=function(e,t,i,n,o,r){i&&(r?(r=t.id.split("_preview"),t=(document.getElementById(r[0]+"_html_div")||dTi(this.diagramId).children[0]).querySelector("#"+e.id+"_content_html_element"),r=e.flip===jfi.None||e.flip===jfi.Both?1:-1,t&&(t.style.transform="scale("+n+","+o+")rotate("+(r*e.rotateAngle+e.parentTransform)+"deg)")):vTi(t,i))},iAi.prototype.flipLabel=function(e,t,i,n){var o,r,s,a;return n!==jfi.None&&(a=s=void 0,o=e.offsetX-e.desiredSize.width/2,r=e.offsetY-e.desiredSize.height/2,s=o+e.desiredSize.width*(i.x/t.desiredSize.width),a=r+e.desiredSize.height*(i.y/t.desiredSize.height),n!==jfi.Both&&n!==jfi.Horizontal||(s=o+e.desiredSize.width*(1-i.x/t.desiredSize.width)),n!==jfi.Both&&n!==jfi.Vertical||(a=r+e.desiredSize.height*(1-i.y/t.desiredSize.height)),o=HTi(e.rotateAngle+e.parentTransform,e.offsetX,e.offsetY,o={x:s,y:a})),o},iAi.prototype.hasNativeParent=function(e,t){if(e&&0<e.length){e=e[0];if(e instanceof Qyi)return e;e.children&&e.children.length&&this.hasNativeParent(e.children,t++||0)}},iAi.prototype.renderRect=function(e,t,i,n,o){i=this.getBaseAttributes(e,i,o),i.cornerRadius=e.cornerRadius||0,e.isExport&&(i.cornerRadius*=e.exportScaleValue.x),o=e.description||e.id;this.renderer.drawRectangle(t,i,this.diagramId,e.isExport,void 0,n,o,void 0,void 0,this,e)},iAi.prototype.drawRect=function(e,t){t.cornerRadius=0,this.svgRenderer.drawRectangle(e,t,this.diagramId)},iAi.prototype.getBaseAttributes=function(e,t,i){var n={width:e.actualSize.width,height:e.actualSize.height,x:e.offsetX-e.actualSize.width*e.pivot.x,y:e.offsetY-e.actualSize.height*e.pivot.y,fill:e.style.fill,stroke:e.style.strokeColor,angle:e.rotateAngle+e.parentTransform,pivotX:e.pivot.x,pivotY:e.pivot.y,strokeWidth:e.style.strokeWidth,dashArray:e.style.strokeDashArray||"",opacity:e.style.opacity,shadow:e.shadow,gradient:e.style.gradient,visible:e.visible,id:e.id,description:e.description,canApplyStyle:e.canApplyStyle,shapeType:e.shapeType};return"Page"===e.rotationReference&&(n.angle=e.rotateAngle),i&&(n.x=n.x-.5,n.y=n.y-.5),e.isExport&&(n.width*=e.exportScaleValue.x,n.height*=e.exportScaleValue.y,n.x*=e.exportScaleValue.x,n.y*=e.exportScaleValue.y,n.strokeWidth*=e.exportScaleValue.x),e.flip&&(n.flip=e.flip,e.flip===jfi.Horizontal||e.flip===jfi.Vertical)&&e instanceof Lyi&&!this.isSvgMode&&(n.isImage=!0),e.flipMode&&(n.flipMode=e.flipMode),t&&(n.x+=t.tx,n.y+=t.ty),n},iAi.renderSvgBackGroundImage=function(e,t,i,n,o,r){var s,a;e.source&&((s=aTi(t.id).getElementById(t.id+"_image"))||(a=function(e){e=$Ii(e).getElementsByClassName("e-background-image-layer");return e[0]}(t.id),(s=document.createElementNS("http://www.w3.org/2000/svg","image")).setAttribute("id",t.id+"_image"),a.appendChild(s)),(a=new Image).src=e.source,s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a.src.toString()),a="None"!==e.scale?e.scale:"",e=(e=e.align).charAt(0).toLowerCase()+e.slice(1),a&&(e+=" "+a.charAt(0).toLowerCase()+a.slice(1)),vTi(s,{id:t.id+"_image",x:i,y:n,width:o,height:r,preserveAspectRatio:e}))},iAi.prototype.transformLayers=function(e,t){var i=e.tx*e.scale,n=e.ty*e.scale,o="domTable";return(i!==this.transform.x||n!==this.transform.y||0==i||0==n)&&(t&&(window[o][this.diagramId+"_diagramLayer"]||(window[o][this.diagramId+"_diagramLayer"]=this.diagramSvgLayer.getElementById(this.diagramId+"_diagramLayer")),window[o][this.diagramId+"_diagramLayer"].setAttribute("transform","translate("+e.tx*e.scale+","+e.ty*e.scale+"),scale("+e.scale+")")),function(e){var t="domTable",i=null;{var n;window[t][e+"_gridline"]?i=window[t][e+"_gridline"]:(n=sTi(e),i=n.getElementById(e+"_gridline"),window[t][e+"_gridline"]=i)}return i}(this.diagramId).setAttribute("transform","translate("+e.tx*e.scale+","+e.ty*e.scale+")"),window[o][this.diagramId+"_diagramPorts"]||(window[o][this.diagramId+"_diagramPorts"]=this.iconSvgLayer.getElementById(this.diagramId+"_diagramPorts")),window[o][this.diagramId+"_diagramPorts"].setAttribute("transform","translate("+e.tx*e.scale+","+e.ty*e.scale+"),scale("+e.scale+")"),window[o][this.diagramId+"_diagramExpander"]||(window[o][this.diagramId+"_diagramExpander"]=this.iconSvgLayer.getElementById(this.diagramId+"_diagramExpander")),window[o][this.diagramId+"_diagramExpander"].setAttribute("transform","translate("+e.tx*e.scale+","+e.ty*e.scale+"),scale("+e.scale+")"),window[o][this.diagramId+"_nativeLayer"]||(window[o][this.diagramId+"_nativeLayer"]=this.nativeSvgLayer.getElementById(this.diagramId+"_nativeLayer")),window[o][this.diagramId+"_nativeLayer"].setAttribute("transform","translate("+e.tx*e.scale+","+e.ty*e.scale+"),scale("+e.scale+")"),dTi(this.diagramId).children[0].style.transform="translate("+e.tx*e.scale+"px,"+e.ty*e.scale+"px)scale("+e.scale+")",this.transform={x:e.tx*e.scale,y:e.ty*e.scale},!0)},iAi.prototype.updateNode=function(e,t,i,n,o,r,s){this.renderElement(e,t,i,n,this.getParentSvg(e),void 0,void 0,o,null,r,s)};var tAi=iAi;function iAi(e,t,i){this.renderer=null,this.isSvgMode=!0,this.touchMove=void 0,this.transform={x:0,y:0},this.diagramId=e,this.element=$Ii(this.diagramId),this.svgRenderer=t,this.isSvgMode=i,this.renderer=new(i?$Si:WTi)}nAi=function(e,t){return(nAi=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])}))(e,t)};var nAi,oAi,af=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},rAi=(function(e,t){function i(){this.constructor=e}nAi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(sAi,oAi=Ji),sAi.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"sourceID":this.setParent(e.sourceID);break;case"width":case"height":this.renderCanvas(),this.setParent(this.sourceID)}},sAi.prototype.getPersistData=function(){return this.addOnPersist(["loaded"])},sAi.prototype.preRender=function(){var e;""===this.element.id&&(e=document.getElementsByClassName("e-overview").length,this.element.id="overview_"+this.overviewid+"_"+e),this.id=this.element.id||this.id,this.element.style.background="transparent",this.unWireEvents(),this.wireEvents(),this.element.classList.add("e-overview")},sAi.prototype.render=function(){this.diagramRenderer=new tAi(this.element.id,new $Si,!1),this.renderCanvas(),this.setParent(this.sourceID),this.renderComplete()},sAi.prototype.getSizeValue=function(e){e=0<e.toString().indexOf("px")||0<e.toString().indexOf("%")?e.toString():e.toString()+"px";return e},sAi.prototype.renderCanvas=function(e){var t=document.getElementById(this.element.id+"_canvas"),i=(t||(t=pTi("div",{}),this.element.appendChild(t)),{id:this.element.id+"_canvas",class:"drawing",style:"position:relative; height:"+this.getSizeValue(this.model.height)+"; width:"+this.getSizeValue(this.model.width)+";style:-ms-touch-action: none;touch-action: none;"});wTi(t,i),this.element.setAttribute("tabindex",String(-1)),this.element.style.overflow="hidden",this.element.style.height=String(this.model.height),this.element.style.width=String(this.model.width),this.canvas=t},sAi.prototype.setParent=function(e){var t,e=document.getElementById(e);this.parent&&(t=this.parent,this.parent=null,t.setOverview(null,this.element.id),this.removeDocument(this)),this.parent=this.getDiagram(e,"ej2_instances"),this.parent&&this.parent.setOverview(this)},sAi.prototype.getDiagram=function(e,t){for(var i,n=e[""+t].length,o=0;o<n;o++)if(gTi(e[""+t][parseInt(o.toString(),10)].element,"e-diagram")){i=e[""+t][parseInt(o.toString(),10)];break}return i},sAi.prototype.unWireEvents=function(){var e=F.touchStartEvent,t=F.touchMoveEvent,i=F.isPointer?"pointerleave":"mouseleave",n=F.touchEndEvent,e=(E.remove(this.element,e,this.mouseDown),E.remove(this.element,t,this.mouseMove),E.remove(this.element,n,this.mouseUp),E.remove(this.element,i,this.documentMouseUp),E.remove(window,"resize",this.windowResize),document.getElementById(this.sourceID+"content"));e&&E.remove(e,"scroll",this.scrolled)},sAi.prototype.wireEvents=function(){var e=F.touchStartEvent,t=F.touchEndEvent,i=F.touchMoveEvent,n=F.isPointer?"pointerleave":"mouseleave",e=(E.add(this.element,e,this.mouseDown,this),E.add(this.element,i,this.mouseMove,this),E.add(this.element,t,this.mouseUp,this),E.add(this.element,n,this.documentMouseUp,this),E.add(window,"resize",this.windowResize,this),document.getElementById(this.sourceID+"content"));e&&E.add(e,"scroll",this.scrolled,this)},sAi.prototype.renderDocument=function(e){e.canvas=this.canvas;var t=document.getElementById(this.canvas.id+"_svg");t&&t.parentNode.removeChild(t);t=cTi("svg",{id:this.canvas.id+"_svg",version:"1.1",class:"overview_svg"});this.svg=t,e.svg=t,e.canvas.appendChild(t);var i=document.getElementById(this.element.id),n=i.clientWidth||i.offsetWidth,o=i.clientHeight||i.offsetHeight,i=i.getBoundingClientRect(),r=window.screenX<0?-1*window.screenX:window.screenX,s=window.screenY<0?-1*window.screenY:window.screenY,s=(0===n&&(n=0<(r=Math.floor(window.innerWidth-r-Math.floor(i.left)))?r:Math.floor(window.innerWidth)),0===o&&(o=0<(r=Math.floor(window.innerHeight-s-Math.floor(i.top)))?r:Math.floor(window.innerHeight)),0<n&&(t.setAttribute("width",String(n)),this.model.height=o),0<o&&(t.setAttribute("height",String(o)),this.model.width=n),e.diagramLayerDiv||(e.diagramLayerDiv=pTi("div",{}),e.diagramLayer=WTi.createCanvas(this.element.id+"_diagramLayer",this.model.width,this.model.height),e.diagramLayer.style.position="absolute",e.diagramLayer.style.left="0px",e.diagramLayer.style.top="0px",e.diagramLayerDiv.appendChild(e.diagramLayer),e.canvas.appendChild(e.diagramLayerDiv)),{id:this.element.id+"_diagramLayer_div",style:"width:"+this.model.width+"px; height:"+this.model.height+"px;position:absolute;top:0px;left:0px"});wTi(e.diagramLayerDiv,s),this.renderHtmlLayer(e.canvas),this.renderNativeLayer(e.canvas,e),this.addOverviewRectPanel(e)},sAi.prototype.removeDocument=function(e){var t=document.getElementById(this.canvas.id+"_svg"),t=(this.canvas.removeChild(t),document.getElementById(this.element.id+"_htmlLayer")),t=(this.canvas.removeChild(t),document.getElementById(this.element.id+"_diagramLayer_div"));this.canvas.removeChild(t),e.diagramLayerDiv=null,e.diagramLayer=null;window.domTable[this.id+"html_layer"]=null},sAi.prototype.renderHtmlLayer=function(e){var t=pTi("div",{id:this.element.id+"_htmlLayer",class:"e-html-layer",style:"pointer-events:none;position:absolute;top:0px;left:0px;"}),i=pTi("div",{id:this.element.id+"_htmlLayer_div",style:"position:absolute;top:0px;left:0px;"});return t.appendChild(i),e.appendChild(t),t},sAi.prototype.renderNativeLayer=function(e,t){var i,n;document.getElementById(this.element.id+"_nativeLayer_svg")||(i=this.parent.createSvg(this.element.id+"_nativeLayer_svg",this.model.width,this.model.height),n=cTi("g",{id:this.element.id+"_nativeLayer"}),i.appendChild(n),t.diagramLayerDiv.appendChild(i),vTi(i,{class:"e-native-layer"}))},sAi.prototype.addOverviewRectPanel=function(e){(t=document.getElementById(this.canvas.id+"_overviewsvg"))&&t.parentNode.removeChild(t);var t=cTi("svg",{id:this.canvas.id+"_overviewsvg",class:"overviewsvg",version:"1.1",style:"position:absolute;left:0px;top:0px; aria-label:Specifies overview",width:this.model.width,height:this.model.height}),e=(e.canvas.appendChild(t),cTi("g",{id:this.element.id+"_overviewlayer",style:"pointer-events:none"})),t=(t.appendChild(e),cTi("rect",{fill:"transparent",width:"100%",height:"100%",class:"overviewbackrect",id:this.canvas.id+"overviewbackrect"})),t=(t.style.pointerEvents="none",e.appendChild(t),cTi("g",{id:this.canvas.id+"overviewhandle",style:"pointer-events:all"})),e=(e.appendChild(t),cTi("rect",{id:this.canvas.id+"overviewrect",fill:"transparent"}));t.appendChild(e),this.renderOverviewCorner("left",t),this.renderOverviewCorner("right",t),this.renderOverviewCorner("top",t),this.renderOverviewCorner("bottom",t),this.renderOverviewCorner("topleft",t),this.renderOverviewCorner("topright",t),this.renderOverviewCorner("bottomleft",t),this.renderOverviewCorner("bottomright",t)},sAi.prototype.renderOverviewCorner=function(e,t){this.svg;var i="top"===e||"bottom"===e||"right"===e||"left"===e?"rect":"circle",n=cTi(i,{id:this.canvas.id+"visible"+e,class:"overview-resizer"}),n=(t.appendChild(n),cTi(i,{id:this.canvas.id+e,class:"overviewresizer",fill:"transparent"}));t.appendChild(n)},sAi.prototype.updateOverviewRectangle=function(){var e=this.currentPoint.x-this.prevPoint.x,t=this.currentPoint.y-this.prevPoint.y,i=new Omi,n=(i.width=0,i.height=0),o=0;switch(this.resizeDirection){case"left":i.width-=e,i.height-=e/this.viewPortRatio,o=(n=e)/this.viewPortRatio,o/=2;break;case"right":i.width+=e,i.height+=e/this.viewPortRatio,o=e/this.viewPortRatio,o/=-2;break;case"top":i.height-=t,i.width-=t*this.viewPortRatio,n=(o=t)*this.viewPortRatio,n/=2;break;case"bottom":i.height+=t,i.width+=t*this.viewPortRatio,n=t*this.viewPortRatio,n/=-2;break;case"topleft":Math.abs(t)>Math.abs(e)?e=t*this.viewPortRatio:t=e/this.viewPortRatio,i.width-=e,i.height-=t,n=e,o=t;break;case"topright":Math.abs(t)>Math.abs(e)?e=-t*this.viewPortRatio:t=-(e/this.viewPortRatio),o=t,i.width+=e,i.height-=t;break;case"bottomleft":Math.abs(t)>Math.abs(e)?e=-t*this.viewPortRatio:t=-e/this.viewPortRatio,n=e,i.width-=e,i.height+=t;break;case"bottomright":Math.abs(t)>Math.abs(e)?e=t*this.viewPortRatio:t=e/this.viewPortRatio,i.width+=e,i.height+=t}this.updateHelper(n,o,i,void 0,void 0)},sAi.prototype.updateHelper=function(e,t,i,n,o){var r,s,a,l=this.element.getElementsByTagName("svg")[2].getElementById("helper");o=i?(r=(a=l.getBBox()).x+e,s=a.y+t,n=a.width+i.width,a.height+i.height):(e=this.currentPoint.x>this.startPoint.x?this.currentPoint.x-this.prevPoint.x:this.prevPoint.x-this.currentPoint.x,t=this.currentPoint.y>this.startPoint.y?this.currentPoint.y-this.prevPoint.y:this.prevPoint.y-this.currentPoint.y,Math.abs(t)>Math.abs(e)?e=this.viewPortRatio*t:t=e/this.viewPortRatio,a=l.getBBox(),r=this.startPoint.x>this.currentPoint.x?a.x-e:a.x,s=this.startPoint.y>this.currentPoint.y?a.y-t:a.y,n=a.width+e,a.height+t),vTi(this.helper,{id:this.helper.id,x:r,y:s,width:Math.max(0,n),height:Math.max(0,o)})},sAi.prototype.updateOverviewrect=function(e,t,i,n){wTi(document.getElementById(this.canvas.id+"overviewrect"),{x:e,y:t,width:Math.max(1,i),height:Math.max(1,n)}),this.updateOverviewCorner("top",e+8,t+1,Math.max(0,i-16),2),this.updateOverviewCorner("bottom",e+8,t+n+3,Math.max(0,i-16),2),this.updateOverviewCorner("left",e-2,t+11,2,Math.max(0,n-16)),this.updateOverviewCorner("right",e+i,t+11,2,Math.max(0,n-16)),this.updateOverviewCorner("topleft",e,t+3,5,5),this.updateOverviewCorner("topright",e+i,t+3,5,5),this.updateOverviewCorner("bottomleft",e,t+n+3,5,5),this.updateOverviewCorner("bottomright",e+i,t+n+3,5,5)},sAi.prototype.updateOverviewCorner=function(e,t,i,n,o){var r,n="top"===e||"bottom"===e||"right"===e||"left"===e?(r={x:t,y:i,width:n,height:o,fill:"#ED1C24"},{x:t-2,y:i-2,width:2===n?4:n,height:2===o?4:o}):(r={cx:t,cy:i,r:4,fill:"#ED1C24"},{cx:t,cy:i,r:6,fill:"transparent"});wTi(document.getElementById(this.canvas.id+("visible"+e)),r),wTi(document.getElementById(this.canvas.id+e),n)},sAi.prototype.translateOverviewRectangle=function(){Number(this.model.width),Number(this.model.height);var e=this.currentPoint.x-this.prevPoint.x,t=this.currentPoint.y-this.prevPoint.y,i=this.element.getElementsByClassName("overviewsvg")[0].getElementById(this.canvas.id+"overviewrect").getBBox(),e=i.x+e,t=i.y+t,n=i.width,i=i.height;this.updateOverviewrect(e,t,n,i),this.updateParentView(this.parent.scroller.currentZoom,e,t,n,i,null)},sAi.prototype.renderOverviewRect=function(e,t,i,n){var o=Number(this.model.width),r=Number(this.model.height),o=i/o*this.contentWidth,r=n/r*this.contentHeight,o=Math.max(this.parent.scroller.viewPortWidth/o,this.parent.scroller.viewPortHeight/r);.25<=o&&o<=30&&(this.updateParentView(o,e,t,i,n,{x:0,y:0}),r=this.scrollOverviewRect(this.parent.scroller.horizontalOffset,this.parent.scroller.verticalOffset,this.parent.scroller.currentZoom,!0),this.helper&&(o=this.element.getElementsByTagName("rect")[10].getBBox(),r.x=o.x,r.y=o.y),"pan"===this.actionName?this.updateOverviewrect(-r.x,-r.y,r.width,r.height):this.updateOverviewrect(r.x,r.y,r.width,r.height))},sAi.prototype.scrollOverviewRect=function(e,t,i,n){if(!this.actionName||n){var o=Number(this.model.width),r=Number(this.model.height),o=Math.min(this.contentWidth/o,this.contentHeight/r),r=new tfi,e=r.x=e/i/o,t=r.y=t/i/o,s=0,a=(this.parent.rulerSettings.showRulers&&(s=25),document.getElementById(this.parent.element.id+"content")),l=0,h=0,a=(a&&(l=a.offsetWidth-a.clientWidth,h=a.offsetHeight-a.clientHeight),r.width=(this.parent.scroller.viewPortWidth-s-l)/i/o),l=r.height=(this.parent.scroller.viewPortHeight-s-h)/i/o;if(n)return(r=new tfi).x=e,r.y=t,r.width=a,r.height=l,r;this.updateOverviewrect(-e,-t,a,l)}return null},sAi.prototype.updateParentView=function(e,t,i,n,o,r){var s,a,l=Number(this.model.width),h=Number(this.model.height),t=t*(this.contentWidth/l)*e,l=i*(this.contentHeight/h)*e;this.parent.scroller.getPageBounds(),1===e&&"pan"!==this.actionName||(s=-t-this.parent.scroller.horizontalOffset,a=-l-this.parent.scroller.verticalOffset),this.parent.setBlazorDiagramProps(!0),this.parent.realActions|=ayi.OverViewAction;"scale"===this.actionName||"draw"===this.actionName?this.parent.scroller.zoom(e/this.parent.scroller.currentZoom,s,a,r):N?this.parent.scroller.zoom(1,s,a,r):this.parent.pan(s,a,r,!0)},sAi.prototype.updateHtmlLayer=function(e){var e=dTi(e.element.id),t=this.parent.scroller.getPageBounds(!0),i=t.width,t=t.height,i=Math.max(i,this.parent.scroller.viewPortWidth),t=Math.max(t,this.parent.scroller.viewPortHeight/this.parent.scroller.currentZoom),i=Math.min(Number(this.model.width)/i,Number(this.model.height)/t);e.style.transform="scale("+i+") translate("+this.parent.scroller.transform.tx+"px,"+this.parent.scroller.transform.ty+"px)"},sAi.prototype.updateView=function(e){var t=this.parent.scroller.getPageBounds(),i=t.width,n=t.height,o=Number(this.model.width),r=Number(this.model.height),i=Math.max(i,this.parent.scroller.viewPortWidth),n=Math.max(n,this.parent.scroller.viewPortHeight),o=(this.contentWidth=i=Math.max(i,o/r*n),this.contentHeight=n=Math.max(n,r/o*i),Math.min(o/i,r/n)),i=document.getElementById(this.element.id+"_htmlLayer");i.style.webkitTransform="scale("+o+") translate("+-t.x+"px,"+-t.y+"px)",i.style.transform="scale("+o+") translate("+-t.x+"px,"+-t.y+"px)";document.getElementById(this.element.id+"_overviewlayer").setAttribute("transform","translate("+-t.x*o+","+-t.y*o+")"),this.horizontalOffset=t.x*o,this.verticalOffset=t.y*o;var r=document.getElementById(this.element.id+"_diagramLayer"),n=hTi(this.element.id),i=r.getContext("2d"),t=Number(this.model.width)/this.contentWidth,o=Number(this.model.height)/this.contentHeight,t=Math.min(t,o),r=this.parent.scroller.transform,s=r.tx,r=r.ty;n.setAttribute("transform","translate("+s*t+","+r*o+"),scale("+t+")"),i.setTransform(t,0,0,t,0,0),i.fillStyle="red",this.scrollOverviewRect(this.parent.scroller.horizontalOffset,this.parent.scroller.verticalOffset,this.parent.scroller.currentZoom)},sAi.prototype.scrolled=function(e){var t;this.event&&(t=this.scrollOverviewRect(this.parent.scroller.horizontalOffset,this.parent.scroller.verticalOffset,this.parent.scroller.currentZoom,!0),this.updateOverviewrect(-t.x,-t.y,t.width,t.height),this.updateView(this))},sAi.prototype.updateCursor=function(e){if(gTi(e.target,"overviewresizer"))switch(e.target.id){case this.canvas.id+"left":this.canvas.style.cursor="w-resize";break;case this.canvas.id+"right":this.canvas.style.cursor="e-resize";break;case this.canvas.id+"top":this.canvas.style.cursor="n-resize";break;case this.canvas.id+"bottom":this.canvas.style.cursor="s-resize";break;case this.canvas.id+"topleft":this.canvas.style.cursor="nw-resize";break;case this.canvas.id+"topright":this.canvas.style.cursor="ne-resize";break;case this.canvas.id+"bottomleft":this.canvas.style.cursor="sw-resize";break;case this.canvas.id+"bottomright":this.canvas.style.cursor="se-resize"}else this.canvas.style.cursor="default"},sAi.prototype.mouseMove=function(e){if(this.event=!1,this.updateCursor(e),this.currentPoint=this.mousePosition(e),this.actionName)switch(this.actionName){case"draw":this.inAction||this.startPoint.x===this.currentPoint.x&&this.startPoint.y===this.currentPoint.y||(this.initHelper(),this.inAction=!0),this.inAction&&this.updateHelper();break;case"scale":this.inAction||(this.initHelper(),this.inAction=!0),this.updateOverviewRectangle();break;case"pan":this.startPoint.x===this.currentPoint.x&&this.startPoint.y!==this.currentPoint.y&&!this.inAction||(this.inAction=!0,this.translateOverviewRectangle())}this.prevPoint=this.currentPoint},sAi.prototype.documentMouseUp=function(e){this.inAction=!1,this.actionName="",this.helper&&(this.helper.parentNode.removeChild(this.helper),this.helper=null),this.event=!0,document.getElementById(this.canvas.id+"overviewhandle").style.pointerEvents="all"},sAi.prototype.windowResize=function(e){var t=this;return this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=setTimeout(function(){var e=document.getElementById(t.element.id).getBoundingClientRect();t.model.width=(0<e.width?e:t.model).width,t.model.height=(0<e.height?e:t.model).height,t.renderCanvas(),t.setParent(t.sourceID)},10),!1},sAi.prototype.mouseDown=function(e){if(e.target.id===this.canvas.id+"_overviewsvg"&&(this.actionName="draw"),e.target.id===this.canvas.id+"overviewrect"&&(this.actionName="pan"),gTi(e.target,"overviewresizer"))switch(this.actionName="scale",e.target.id){case this.canvas.id+"left":this.resizeDirection="left";break;case this.canvas.id+"right":this.resizeDirection="right";break;case this.canvas.id+"top":this.resizeDirection="top";break;case this.canvas.id+"bottom":this.resizeDirection="bottom";break;case this.canvas.id+"topleft":this.resizeDirection="topleft";break;case this.canvas.id+"topright":this.resizeDirection="topright";break;case this.canvas.id+"bottomleft":this.resizeDirection="bottomleft";break;case this.canvas.id+"bottomright":this.resizeDirection="bottomright"}this.startPoint=this.prevPoint=this.mousePosition(e),this.viewPortRatio=this.parent.scroller.viewPortWidth/this.parent.scroller.viewPortHeight,document.getElementById(this.canvas.id+"overviewhandle").style.pointerEvents="none"},sAi.prototype.mouseUp=function(e){var t,i,n,o,r;this.currentPoint=this.mousePosition(e),this.actionName&&(this.startPoint.x!==this.currentPoint.x||this.startPoint.y!==this.currentPoint.y?"pan"!==this.actionName&&this.helper&&(n=this.element.getElementsByTagName("rect")[10].getBBox(),this.resizeDirection=this.resizeDirection||"",t=n.x,i=n.y,o=n.width,r=n.height,"topleft"!==this.resizeDirection&&"topright"!==this.resizeDirection&&"bottomleft"!==this.resizeDirection&&this.resizeDirection,this.renderOverviewRect(t,i,o,r)):e.target.id!==this.canvas.id+"_overviewsvg"&&"helper"!==e.target.id||(o=(n=this.element.getElementsByTagName("svg")[2].getElementById(this.canvas.id+"overviewrect").getBBox()).width,r=n.height,this.inAction=!0,this.actionName="pan",this.renderOverviewRect(this.currentPoint.x-o/2,this.currentPoint.y-r/2,o,r),this.inAction=!1)),this.helper&&(this.helper.parentNode.removeChild(this.helper),this.helper=null),this.actionName="",this.startPoint=null,this.currentPoint=null,this.prevPoint=null,this.helper=null,this.viewPortRatio=1,this.resizeDirection="",this.inAction=!1,this.event=!0,document.getElementById(this.canvas.id+"overviewhandle").style.pointerEvents="all"},sAi.prototype.initHelper=function(){var e=this.element.getElementsByTagName("svg")[2],t=this.startPoint.x,i=this.startPoint.y,n=1,o=1,r=("scale"===this.actionName&&(t=(r=e.getElementById(this.canvas.id+"overviewrect").getBBox()).x,i=r.y,n=r.width,o=r.height),cTi("rect",{id:"helper",x:t,y:i,width:n,height:o,fill:"transparent",stroke:"gray","stroke-dasharray":"2 2","shape-rendering":"crispEdges"}));e.getElementById(this.element.id+"_overviewlayer").appendChild(r),this.helper=r},sAi.prototype.mousePosition=function(e){i=-1!==e.type.indexOf("touch")?(t=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY,t=t-this.element.offsetLeft,i-this.element.offsetTop):(t=e.clientX,e.clientY);var t,i,e=this.element.getBoundingClientRect();return t-=e.left,i-=e.top,{x:t+this.horizontalOffset,y:i+this.verticalOffset}},sAi.prototype.destroy=function(){var e;this.unWireEvents(),this.notify("destroy",{}),oAi.prototype.destroy.call(this),document.getElementById(this.element.id)&&(this.element.classList.remove("e-overview"),e=document.getElementById(this.element.id+"_canvas"))&&this.element.removeChild(e),this.parent.views.splice(this.parent.views.indexOf(this.element.id),1),this.diagramLayerDiv=null,this.canvas=null,this.parent=null},sAi.prototype.getModuleName=function(){return"Overview"},af([e("100%")],sAi.prototype,"width",void 0),af([e("100%")],sAi.prototype,"height",void 0),af([e("")],sAi.prototype,"sourceID",void 0),af([i()],sAi.prototype,"created",void 0),sAi);function sAi(e,t){e=oAi.call(this,e,t)||this;return e.mode="Canvas",e.id="overview",e.actionName="",e.startPoint=null,e.currentPoint=null,e.prevPoint=null,e.scale=null,e.inAction=!1,e.viewPortRatio=1,e.horizontalOffset=0,e.verticalOffset=0,e.model={},e.event=!0,e.overviewid=88123,e.model={width:e.width,height:e.height},e}function aAi(e,t){for(var i=[],n=0;n<t.length;n++){var o=t[parseInt(n.toString(),10)];e.containsRect(o.wrapper.bounds)&&i.push(o)}return i}function lAi(e,t){for(var i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].id===t)return!0;return!1}function hAi(e){var t;return e&&(e.type?t="Connector":e.shape&&!e.type&&(t="Node")),t}function dAi(e,t){t instanceof MIi&&(e.shape.header||(t.shape.hasHeader=!1))}function pAi(e,t,i,n){return n=t?n:void 0!==e[i-1]?e[i-1]+n:0}function cAi(e,t){var i=[];if(t)i=e;else{for(var n=0;n<e.length;n++)i.push(e[parseInt(n.toString(),10)]);i.push(e[i.length-2]),i.push(e[i.length-2])}return i}function uAi(e){for(var t=0;t<e.ports.length;t++)e.ports[parseInt(t.toString(),10)].inEdges=[],e.ports[parseInt(t.toString(),10)].outEdges=[];return e}function gAi(e,t){if(t instanceof MIi)switch(e.shape.shape){case"JoinNode":e.width||(t.width=20),e.height||(t.height=90),e.style&&e.style.fill||(t.style.fill="black");break;case"ForkNode":e.width||(t.width=90),e.height||(t.height=20),e.style&&e.style.fill||(t.style.fill="black");break;case"InitialNode":case"FinalNode":e.style&&e.style.fill||(t.style.fill="black")}else switch(e.shape.flow){case"Object":e.style&&e.style.strokeDashArray||(t.style.strokeDashArray="8 4"),e.style&&e.style.strokeWidth||(t.style.strokeWidth=2),e.targetDecorator&&e.targetDecorator.shape||(t.targetDecorator.shape="OpenArrow");break;case"Control":e.style&&e.style.strokeWidth||(t.style.strokeWidth=2),e.targetDecorator&&e.targetDecorator.shape||(t.targetDecorator.shape="OpenArrow"),e.sourceDecorator&&e.sourceDecorator.shape||(t.sourceDecorator.shape="None")}}function mAi(e,t){switch(e.shape.type){case"Bpmn":switch(e.shape.flow){case"Sequence":("Normal"===e.shape.sequence&&"Bezier"!==e.type||"Default"===e.shape.sequence||"Conditional"===e.shape.sequence)&&(t.targetDecorator&&t.targetDecorator.style&&(t.targetDecorator.style.fill=e.targetDecorator&&e.targetDecorator.style&&e.targetDecorator.style.fill||"black"),"Conditional"===e.shape.sequence)&&t.sourceDecorator&&(t.sourceDecorator.style&&(t.sourceDecorator.style.fill=e.sourceDecorator&&e.sourceDecorator.style&&e.sourceDecorator.style.fill||"white"),t.sourceDecorator.width=e.sourceDecorator&&e.sourceDecorator.width||20,t.sourceDecorator.height=e.sourceDecorator&&e.sourceDecorator.width||10);break;case"Association":"Default"!==e.shape.association&&"Directional"!==e.shape.association&&"BiDirectional"!==e.shape.association||(t.targetDecorator&&t.targetDecorator.style&&(t.targetDecorator.style.fill=e.targetDecorator&&e.targetDecorator.style&&e.targetDecorator.style.fill||"black"),"BiDirectional"===e.shape.association&&t.sourceDecorator&&t.sourceDecorator.style&&(t.sourceDecorator.style.fill=e.sourceDecorator&&e.sourceDecorator.style&&e.sourceDecorator.style.fill||"white",t.sourceDecorator.width=e.sourceDecorator&&e.sourceDecorator.width||5,t.sourceDecorator.height=e.sourceDecorator&&e.sourceDecorator.height||10));break;case"Message":t.style&&!t.style.strokeDashArray&&(t.style.strokeDashArray=e.style&&e.style.strokeDashArray||"4 4")}break;case"UmlActivity":"Exception"!==e.shape.flow||"Directional"!==e.shape.association&&"BiDirectional"!==e.shape.association||(t.style.strokeDashArray=e.style&&e.style.strokeDashArray||"2 2");break;case"UmlClassifier":var i=!1;"Association"===e.shape.relationship?i=!0:"Inheritance"===e.shape.relationship?(t.targetDecorator&&t.targetDecorator.style&&(t.targetDecorator.style.fill=e.targetDecorator&&e.targetDecorator.style&&e.targetDecorator.style.fill||"white"),t.style&&(i=!0,t.style.strokeDashArray=e.style&&e.style.strokeDashArray||"4 4")):"Composition"===e.shape.relationship?(t.sourceDecorator&&t.sourceDecorator.style&&(t.sourceDecorator.style.fill=e.sourceDecorator&&e.sourceDecorator.style&&e.sourceDecorator.style.fill||"black"),i=!0):"Aggregation"===e.shape.relationship||void 0===e.shape.relationship?(t.sourceDecorator&&t.sourceDecorator.style&&(t.sourceDecorator.style.fill=e.sourceDecorator&&e.sourceDecorator.style&&e.sourceDecorator.style.fill||"white"),i=!0):"Dependency"===e.shape.relationship?(t.sourceDecorator&&t.sourceDecorator.style&&(t.sourceDecorator.style.fill=e.sourceDecorator&&e.sourceDecorator.style&&e.sourceDecorator.style.fill||"white"),i=!0,t.style.strokeDashArray="4 4"):"Realization"===e.shape.relationship&&(t.sourceDecorator&&t.sourceDecorator.style&&(t.sourceDecorator.style.fill=e.sourceDecorator&&e.sourceDecorator.style&&e.sourceDecorator.style.fill||"white"),i=!0),i&&(t.style.strokeWidth=e.style&&e.style.strokeWidth||2)}}function fAi(e,t,i){var n=Hmi.findLength(t,e),n=Hmi.findLength(i,e)<n?i:t,t=Hmi.findAngle(t,i),i=Hmi.findAngle(n,e),e=Hmi.findLength(n,e),t=i+2*(t-i);return{x:n.x+e*Math.cos(t*Math.PI/180),y:n.y+e*Math.sin(t*Math.PI/180)}}function yAi(e){var t=e.parentElement;do{if(gTi(t,"e-diagram"))return!0}while(t=t.parentElement);return!1}function vAi(e,t,i){if(e&&e.children&&0<e.children.length){var n=0;if(n<e.children.length)return(e=i[e.children[parseInt(n.toString(),10)]]).shape.type===t||vAi(e,t,i)}return!1}function bAi(e,t,i,n,o){if(i&&(e instanceof ISi||e&&(e.shape&&"SwimLane"!==e.shape.type||void 0===e.shape)))for(var r=0,s=Object.keys(i);r<s.length;r++){var a=s[r],l=i[""+a];if("shape"===a&&l.type&&(e.shape={type:l.type}),l)if(Array.isArray(l)&&l.length&&0<l.length&&"annotations"!==o&&"ports"!==o)if(0<e[""+a].length)for(var h=0;h<=e[""+a].length;h++)bAi(e[""+a],t?t[""+a]:void 0,i[""+a],"annotations"===a||"ports"===a?e:void 0,a);else bAi(e[""+a],t?t[""+a]:void 0,i[""+a],"annotations"===a||"ports"===a?e:void 0,a);else l instanceof Object&&t&&"annotations"!==o&&"ports"!==o?bAi(e[""+a],t[""+a],i[""+a]):"annotations"!==o&&"ports"!==o&&t&&!t[""+a]||!t&&e&&(e[""+a]||void 0!==e[""+a])?e[""+a]=i[""+a]:(l=void 0,"annotations"!==o&&"ports"!==o||("annotations"===o?(e[""+a]&&bAi(e[""+a],t[""+a],i[""+a]),e[""+a]||(l=new(S1i(n)===ISi?b0i:f0i)(n,"annotations",i[""+a]),n.annotations.push(l))):e[""+a]?bAi(e[""+a],t[""+a],i[""+a]):(l=new r0i(n,"ports",i[""+a]),n.ports.push(l))))}}function wAi(e,t,i,n){if(t)for(var o=0,r=Object.keys(t);o<r.length;o++){var s=r[o],a=t[""+s];if("getAssistantDetails"===s){if(n.data.Role===t[""+s].root)for(var l=t[""+s].assistants,h=0;h<l.length;h++)for(var d=0;d<i.length;d++)i[parseInt(d.toString(),10)].data.Role===l[parseInt(h.toString(),10)]&&(e.assistants.push(i[parseInt(d.toString(),10)].id),e.children.splice(0,1))}else a&&(e[""+s]=t[""+s])}!e.hasSubTree&&t.canEnableSubTree&&(e.orientation=n.layoutInfo.orientation,e.type=n.layoutInfo.type,n.layoutInfo.offset!==e.offset)&&void 0!==n.layoutInfo.offset&&(e.offset=n.layoutInfo.offset),n.layoutInfo.hasSubTree=e.hasSubTree}function CAi(e,t){for(var i="Bezier"===e.type?function(e){var t=[];if("Bezier"===e.type)for(var i=0,n=0;n<e.segments.length;n++)for(var o=e.segments[parseInt(n.toString(),10)],r=Hmi.isEmptyPoint(o.point1)?o.bezierPoint1:o.point1,s=Hmi.isEmptyPoint(o.point2)?o.bezierPoint2:o.point2,a=Number((e.distance(r,o.points[0])+e.distance(s,r)+e.distance(o.points[1],s))/1.5),l=0;l<a-1;l+=10)t[parseInt(i.toString(),10)]=gSi(0,o.points[0],Hmi.isEmptyPoint(o.point1)?o.bezierPoint1:o.point1,Hmi.isEmptyPoint(o.point2)?o.bezierPoint2:o.point2,o.points[1],l,a),i++;return t}(e):e.intermediatePoints,n=0;n<i.length-1;n++){var o=i[parseInt(n.toString(),10)],r=i[n+1],s=tfi.toBounds([o,r]);if(s.Inflate(e.hitPadding),s.containsPoint(t)){var s=fAi(t,o,r),a=SAi({x1:o.x,x2:r.x,y1:o.y,y2:r.y},{x1:t.x,x2:s.x,y1:t.y,y2:s.y});if(a.enabled){a=Hmi.findLength(t,a.intersectPt);if(Math.abs(a)<e.hitPadding)return!0}else{a=tfi.toBounds([t,t]);if(a.Inflate(3),a.containsPoint(o)||a.containsPoint(r))return!0}if(Hmi.equals(t,s))return!0}}if(0<e.annotations.length||0<e.ports.length)for(var l=e.wrapper.children,n=3;n<l.length;n++)if(l[parseInt(n.toString(),10)].bounds.containsPoint(t))return!0;return!1}function SAi(e,t){var i={x:0,y:0},n=e,o=(t.y2-t.y1)*(n.x2-n.x1)-(t.x2-t.x1)*(n.y2-n.y1),r=(t.x2-t.x1)*(n.y1-t.y1)-(t.y2-t.y1)*(n.x1-t.x1),s=(n.x2-n.x1)*(n.y1-t.y1)-(n.y2-n.y1)*(n.x1-t.x1);return 0!=o&&(e.x1!==t.x1&&e.y1!==t.y1||e.x2!==t.x2&&e.y2!==t.y2||0!=r&&0!=s||!(0<o))&&(e=s/o,0<=(t=r/o))&&t<=1&&0<=e&&e<=1?(i.x=n.x1+t*(n.x2-n.x1),i.y=n.y1+t*(n.y2-n.y1),{enabled:!0,intersectPt:i}):{enabled:!1,intersectPt:i}}function AAi(e,t,i,n){e=SAi(xAi(e.x,e.y,t.x,t.y),xAi(i.x,i.y,n.x,n.y));return e.enabled?e.intersectPt:{x:0,y:0}}function xAi(e,t,i,n){return{x1:Number(e)||0,y1:Number(t)||0,x2:Number(i)||0,y2:Number(n)||0}}function IAi(e,t,i){var n=[],o={x:t.topLeft.x-(i=i||0),y:t.topLeft.y},r={x:t.topRight.x+i,y:t.topRight.y},s={x:t.bottomRight.x,y:t.bottomRight.y-i},t={x:t.bottomLeft.x,y:t.bottomLeft.y+i};return n.push(o),n.push(r),n.push(s),n.push(t),n}function TAi(e,t,i,n){var o=i instanceof MIi?i.constraints&Kfi.InheritTooltip:i instanceof ISi?i.constraints&Yfi.InheritTooltip:i.constraints&pyi.InheritTooltip,r=i instanceof MIi?i.constraints&Kfi.Tooltip:i instanceof ISi?i.constraints&Yfi.Tooltip:i.constraints&pyi.ToolTip,o="Mouse"===(!o&&r?i:e).tooltip.relativeMode,r=("Mouse"===n?o=!0:"Object"===n&&(o=!1),function(e,t,i,n){var o,r={},s=document.getElementById(i.element.id);o=(e instanceof MIi||e instanceof ISi?e.wrapper:(e=i.findObjectsUnderMouse(t),e=i.findObjectUnderMouse(e,"Select",!1),e=i.findElementUnderMouse(e,t,i),e)).bounds;var a=s.getBoundingClientRect();switch(i.tooltipObject.position){case"BottomCenter":r=EAi(t,o.bottomCenter,i,n,a.width/2,a.height);break;case"BottomLeft":case"LeftBottom":r=EAi(t,o.bottomLeft,i,n,0,a.height);break;case"BottomRight":case"RightBottom":r=EAi(t,o.bottomRight,i,n,a.width,a.height);break;case"LeftCenter":r=EAi(t,o.middleLeft,i,n,0,a.height/2);break;case"LeftTop":case"TopLeft":r=EAi(t,o.topLeft,i,n,0,0);break;case"RightCenter":r=EAi(t,o.middleRight,i,n,a.width,a.height/2);break;case"RightTop":case"TopRight":r=EAi(t,o.topRight,i,n,a.width,0);break;case"TopCenter":r=EAi(t,o.topCenter,i,n,a.width/2,0)}return r}(i,t,e,o)),n=LSi(e);return{x:r.x+n.width,y:r.y+n.height}}function EAi(e,t,i,n,o,r){var s={},a=i.scroller.transform.scale,l=i.scroller.horizontalOffset,h=i.scroller.verticalOffset,l=i.modifyClientOffset(l,!0),h=i.modifyClientOffset(h,!0);return s.x=(n?e:t).x*a+l-o,s.y=(n?e:t).y*a+h-r,s}function DAi(e,t){var i=new kyi;return i.data=e.pathData,i.height=10<e.height?e.height-(e.padding.bottom+e.padding.top):e.height,i.width=10<e.width?e.width-(e.padding.left+e.padding.right):e.width,i.visible=e.visibility,i.id=t.id+"_shape",i.inversedAlignment=!1,i.horizontalAlignment="Center",i.verticalAlignment="Center",i.style={fill:e.iconStrokeColor,strokeColor:e.iconStrokeColor,strokeWidth:e.iconStrokeWidth},i.setOffsetWithRespectToBounds(.5,.5,"Fraction"),i.relativeMode="Object",i.description=t.description||"",i}function MAi(e,t){for(var i,n=0,o=0,n=0;n<e.length;n++)for(var r=ETi(e[parseInt(n.toString(),10)].wrapper),o=n+1;o<e.length;o++){var s=ETi(e[parseInt(o.toString(),10)].wrapper);"Top"===t||"Bottom"===t||"BottomToTop"===t||"Middle"===t?r.center.y>s.center.y&&(i=e[parseInt(n.toString(),10)],e[parseInt(n.toString(),10)]=e[parseInt(o.toString(),10)],e[parseInt(o.toString(),10)]=i):r.center.x>s.center.x&&(i=e[parseInt(n.toString(),10)],e[parseInt(n.toString(),10)]=e[parseInt(o.toString(),10)],e[parseInt(o.toString(),10)]=i)}return e}function kAi(e,t,i){var n=LAi(e,t),e=Hmi.findAngle(e[n.index],e[n.index+1]),t=RAi(t),t=Hmi.transform(n.point,e+45,t);return n.point=t,n.angle=e,n}function PAi(e,t,i){var n=BAi(e,t),e=Hmi.findAngle(e[n.index],e[n.index+1]),t=FAi(t),t=Hmi.transform(n.point,e+45,t);return n.point=t,n.angle=e,n}function BAi(e,t){for(var i,n,o,r,s=0,t=t.offset,a=[],l=0;l<e.length-1;l++)s+=Hmi.distancePoints(e[parseInt(l.toString(),10)],e[l+1]),a.push(s);for(var h=t*s,d=0;d<a.length;d++){if(a[parseInt(d.toString(),10)]>=h)return n=Hmi.findAngle(e[parseInt(d.toString(),10)],e[d+1]),{point:i=Hmi.transform(e[parseInt(d.toString(),10)],n,h-(o||0)),index:r=d};o=a[parseInt(d.toString(),10)]}return{point:i,index:r}}function FAi(e){var t=0;switch(e.alignment){case"Center":t=0;break;case"Before":t=-0;break;case"After":t=0}return t}function LAi(e,t){for(var i,n,o,r,s=0,t=t.offset,a=[],l=0;l<e.length-1;l++)s+=Hmi.distancePoints(e[parseInt(l.toString(),10)],e[l+1]),a.push(s);for(var h=t*s,d=0;d<a.length;d++){if(a[parseInt(d.toString(),10)]>=h)return n=Hmi.findAngle(e[parseInt(d.toString(),10)],e[d+1]),{point:i=Hmi.transform(e[parseInt(d.toString(),10)],n,h-(o||0)),index:r=d};o=a[parseInt(d.toString(),10)]}return{point:i,index:r}}function RAi(e){var t=!(e instanceof Rvi)&&void 0===e.content?10:0,i=0;switch(e.alignment){case"Center":i=0;break;case"Before":i=-(0+t);break;case"After":i=0+t}return i}function OAi(e,t,i){t%=360;var n,o;switch(e.alignment){case"Before":45<=t&&t<=135?(o="right",n=.5===e.offset?"center":"top"):225<=t&&t<=315?(o="left",n=.5===e.offset?"center":"bottom"):o=45<t&&t<225?(n="top",.5===e.offset?"center":"right"):(n="bottom",.5===e.offset?"center":"left");break;case"After":45<=t&&t<=135?(o="left",n=.5===e.offset?"center":"top"):225<=t&&t<=315?(o="right",n=.5===e.offset?"center":"bottom"):o=45<t&&t<225?(n="bottom",.5===e.offset?"center":"right"):(n="top",.5===e.offset?"center":"left");break;case"Center":o=je(e.horizontalAlignment)?"center":e.horizontalAlignment.toLowerCase(),n=je(e.verticalAlignment)?"center":e.verticalAlignment.toLowerCase()}if(0===e.offset||1===e.offset)switch(NAi(i[0],i[1])){case"left":o=0===e.offset?"right":"left";break;case"right":o=0===e.offset?"left":"right";break;case"bottom":n=0===e.offset?"top":"bottom";break;case"top":n=0===e.offset?"bottom":"top"}return{hAlign:o,vAlign:n}}function NAi(e,t){return Math.abs(t.x-e.x)>Math.abs(t.y-e.y)?e.x<t.x?"right":"left":e.y<t.y?"bottom":"top"}function VAi(e,t){if(e instanceof MIi&&e.children)for(var i=0;i<e.children.length;i++)t.nameTable[e.children[parseInt(i.toString(),10)]].children&&VAi(e,t),t.removeFromAQuad(t.nameTable[e.children[parseInt(i.toString(),10)]]),t.removeObjectsFromLayer(t.nameTable[e.children[parseInt(i.toString(),10)]]),delete t.nameTable[e.children[parseInt(i.toString(),10)]]}function _Ai(e,t){if(e&&e.children&&0<e.children.length)for(var i=0;i<e.children.length;i++){var n=e.children[parseInt(i.toString(),10)];n instanceof Vyi&&_Ai(n,t)}return-1===t.indexOf(e.id)&&t.push(e.id),t}function HAi(i){var n=function(e){for(var t,i=[],n=0;n<e.length;n++)if("SwimLane"===(t=e[parseInt(n.toString(),10)]).shape.type)for(var o=t.wrapper.children[0].childTable,r=0,s=Object.keys(o);r<s.length;r++)i=_Ai(o[""+s[r]],i);return i}(i.nodes),o=DTi(i,i.getCustomProperty),e=(o.selectedItems.nodes=[],o.selectedItems.connectors=[],o.selectedItems.wrapper=null,i.serializationSettings.preventDefaults&&(o=zAi(o,i)),i.nodes.forEach(function(e){var t;"SwimLane"===e.shape.type&&((t=i.commandHandler.findProcesses(e)).forEach(function(i){o.nodes.forEach(function(e){var t;e.id===i&&(t=e.wrapper,e.offsetX=t.offsetX,e.offsetY=t.offsetY)})}),0<t.length)&&(n=n.filter(function(e){return!t.includes(e)}))}),n),t=o.nodes;if(t)for(var r=0;r<t.length;r++)-1!==e.indexOf(t[parseInt(r.toString(),10)].id)&&(t.splice(r,1),r--);return JSON.stringify(o)}function zAi(e,t,i,n){i=function(e,t){var i,n=[],o="getClassName";if(e[o]){var r=new dDi;switch(e[o]()){case"Diagram":i=r;break;case"Node":i=new MIi(r,"",n);break;case"Path":i=new oxi(r,"",n);break;case"Native":i=new axi(r,"",n);break;case"Html":i=new dxi(r,"",n);break;case"Image":i=new uxi(r,"",n);break;case"Text":i=new fxi(r,"",n);break;case"BasicShape":i=new bxi(r,"",n);break;case"FlowShape":i=new Sxi(r,"",n);break;case"BpmnShape":i=new Jxi(r,"",n);break;case"UmlActivityShape":i=new eIi(r,"",n);break;case"UmlClassifierShape":i=new xIi(r,"",n);break;case"SwimLane":i=new zIi(r,"",n),e.header&&(i.header=new BIi(r,"",n),i.header.style.fill="");break;case"ShapeAnnotation":i=new f0i(r,"",n);break;case"PointPort":i=new r0i(r,"",n);break;case"BpmnGateway":i=new Ixi(r,"",n);break;case"BpmnDataObject":i=new Dxi(r,"",n);break;case"BpmnEvent":i=new Fxi(r,"",n);break;case"BpmnSubEvent":i=new Oxi(r,"",n);break;case"BpmnActivity":i=new Wxi(r,"",n);break;case"BpmnAnnotation":i=new qxi(r,"",n);break;case"MethodArguments":i=new nIi(r,"",n);break;case"UmlClassAttribute":i=new sIi(r,"",n);break;case"UmlClassMethod":i=new hIi(r,"",n);break;case"UmlClass":i=new cIi(r,"",n);break;case"UmlInterface":i=new mIi(r,"",n);break;case"UmlEnumerationMember":i=new vIi(r,"",n);break;case"UmlEnumeration":i=new CIi(r,"",n);break;case"Lane":i=new RIi(r,"",n);break;case"Phase":i=new VIi(r,"",n);break;case"ChildContainer":i=new WIi;break;case"Connector":i=new ISi(r,"",n);break;case"StraightSegment":i=new eSi(r,"",n);break;case"BezierSegment":i=new nSi(r,"",n);break;case"OrthogonalSegment":i=new sSi(r,"",n);break;case"PathAnnotation":i=new b0i(r,"",n);break;case"Stop":i=new Cfi(r,"",n);break;case"Point":i=t||new Hmi(r,"",n);break;case"UserHandle":i=new _Si(r,"",n);break;case"Command":i=new GSi(r,"",n)}}else i=t;return parent=void 0,t=void 0,i}(t,i);for(var o=0,r=[].concat(Object.keys(e));o<r.length;o++){var s=r[o];if(t instanceof MIi&&(n="shape"===s),e[""+s]instanceof Array){c=p=d=h=l=a=void 0;var a=e,l=i,h=t,d=s;if(0===a[""+d].length)delete a[""+d];else if(a[d].every(function(e){return"number"==typeof e})){var p=void 0,c=!0;for(p=0;p<a[""+d].length;p++)c=!(!c||a[""+d][parseInt(p.toString(),10)]!==l[""+d][parseInt(p.toString(),10)]);c&&delete a[""+d]}else{p=void 0;if(a[""+d]&&"layers"!==d)for(p=a[""+d].length-1;0<=p;p--)"nodes"!==d&&"connectors"!==d||(a[""+d][parseInt(p.toString(),10)].wrapper=null),"dataManager"!==d&&(a[""+d][parseInt(p.toString(),10)]=zAi(a[""+d][parseInt(p.toString(),10)],h[""+d][parseInt(p.toString(),10)],void 0!==l[""+d]?l[""+d][parseInt(p.toString(),10)]:[]),"[]"!==JSON.stringify(a[""+d][parseInt(p.toString(),10)])&&"{}"!==JSON.stringify(a[""+d][parseInt(p.toString(),10)])&&void 0!==a[""+d][parseInt(p.toString(),10)]||a[""+d].splice(p,1))}a=void 0}else e[""+s]instanceof Object&&i&&i[""+s]?"wrapper"!==s&&(e[""+s]=zAi(e[""+s],t[""+s],i[""+s],n)):!(i&&e[""+s]===i[""+s]||void 0===e[""+s])||n&&"type"===s||t instanceof zIi&&"orientation"===s||delete e[""+s];"[]"!==JSON.stringify(e[""+s])&&"{}"!==JSON.stringify(e[""+s])&&void 0!==e[""+s]||delete e[""+s]}return i=void 0,e}function jAi(e,t){t.enableServerDataBinding(!1);for(var i=t.blazorActions,n=(t.blazorActions=t.addConstraints(i,zfi.ClearObject),t.clear(),t.blazorActions=t.removeConstraints(i,zfi.ClearObject),t.protectPropertyChange(!0),t.dataSourceSettings.doBinding),o=t.setNodeTemplate,r=t.getDescription,s=t.getCustomProperty,a={},l=0,h=t.commandManager.commands;l<h.length;l++){var d=h[l];a[d.name]={execute:d.execute,canExecute:d.canExecute}}var p=t.rulerSettings.horizontalRuler.arrangeTick,c=t.rulerSettings.verticalRuler.arrangeTick,u=t.layout.getLayoutInfo,g=t.layout.getBranch,m=t.getNodeDefaults,f=t.getConnectorDefaults,y=e instanceof Object?e:JSON.parse(e);if(y=QAi(y),t.contextMenuSettings=y.contextMenuSettings||{},t.constraints=y.constraints||$fi.Default,t.tool=y.tool||eyi.Default,t.bridgeDirection=y.bridgeDirection||"Top",t.pageSettings=y.pageSettings||{},t.drawingObject=y.drawingObject||void 0,t.tooltip=y.tooltip||{},t.addInfo=y.addInfo||void 0,t.getDescription=r,t.scrollSettings=y.scrollSettings||{},t.commandManager=y.commandManager||{},y.layers&&0<y.layers.length){var v,b,w,C=y,S=[];for(v=0;v<C.layers.length;v++){for(b=0;b<C.layers[v].objects.length;b++)if(C.nodes)for(w=0;w<C.nodes.length;w++)C.layers[v].objects[b]===C.nodes[w].id&&S.push(C.layers[v].objects[b]);for(b=0;b<C.layers[v].objects.length;b++)if(C.connectors)for(w=0;w<C.connectors.length;w++)C.layers[v].objects[b]===C.connectors[w].id&&S.push(C.layers[v].objects[b]);C.layers[v].objects=S,S=[]}}t.layers=y.layers||[],t.rulerSettings.horizontalRuler.arrangeTick=p,t.rulerSettings.verticalRuler.arrangeTick=c;for(var A,x=0,I=t.commandManager.commands;x<I.length;x++){var T=I[x];a[T.name]&&(T.execute=a[T.name].execute,T.canExecute=a[T.name].canExecute)}if(t.backgroundColor=y.backgroundColor||"transparent",t.basicElements=y.basicElements||[],y.connectors)for(var E=0;E<y.connectors.length;E++)"Bezier"===y.connectors[E].type&&0<y.connectors[E].segments.length&&y.connectors[E].bezierSettings&&y.connectors[E].bezierSettings.allowSegmentsReset&&(y.connectors[E].segments=[]);if(t.connectors=y.connectors||[],t.dataSourceSettings=y.dataSourceSettings||{},t.dataSourceSettings.doBinding=n,t.height=y.height||"100%",t.setNodeTemplate=o,t.getConnectorDefaults=f,t.getNodeDefaults=m,t.getCustomProperty=s,t.mode=y.mode||"SVG",y.nodes)for(E=0;E<y.nodes.length;E++)y.nodes[E].shape&&"SwimLane"===y.nodes[E].shape.type&&(null==y.nodes[E].wrapper&&(y.nodes[E].wrapper={actualSize:{width:y.nodes[E].width,height:y.nodes[E].height},offsetX:y.nodes[E].offsetX,offsetY:y.nodes[E].offsetY}),Xbi(y.nodes[E],void 0,void 0,void 0,void 0,!0));t.nodes=y.nodes||[],WAi(t.nodes),WAi(t.connectors),t.rulerSettings=y.rulerSettings||{},t.snapSettings=y.snapSettings||{},t.width=y.width||"100%",t.layout=y.layout||{},y.layout&&"None"!==y.layout.type&&(t.canLayout=!1),t.layout.getLayoutInfo=jTi(u),t.layout.getBranch=jTi(g),t.diagramActions=0,t.isLoading=!0,t.protectPropertyChange(!1);for(E=0;E<t.views.length;E++)A=t.views[t.views[E]],t.blazorActions=t.addConstraints(i,zfi.ClearObject),A.refresh(),A instanceof rAi&&A.onPropertyChanged({sourceID:A.sourceID},{}),t.blazorActions=t.removeConstraints(i,zfi.ClearObject),A instanceof dDi&&t.element.classList.add("e-diagram");return t.triggerEvent(dyi.loaded,{name:"loaded",diagram:t}),y.selectedItems&&(y.selectedItems.nodes=[],y.selectedItems.connectors=[],y.selectedItems.selectedObjects=[]),t.selectedItems=y.selectedItems,t.enableServerDataBinding(!0),t.canLayout=!0,t.swimlaneChildTable={},t.swimlaneZIndexTable={},t.nodes.forEach(function(e){"SwimLane"===e.shape.type&&t.commandHandler.findProcesses(e).forEach(function(e){e=t.nameTable[e];e&&t.nameTable[e.processId]&&t.nameTable[e.processId].wrapper.children.push(e.wrapper)})}),y}function WAi(e){for(var t=0,i=e.filter(function(e){return"string"==typeof e.flip});t<i.length;t++){var n=i[t];switch(n.flip){case"Horizontal":n.flip=jfi.Horizontal;break;case"Vertical":n.flip=jfi.Vertical;break;case"Both":n.flip=jfi.Both;break;case"None":n.flip=jfi.None}}}function QAi(e){if(e&&(void 0===e.version||e.version<17.1)&&e.nodes)for(var t=0,i=e.nodes;t<i.length;t++){var n=i[t];if(n&&n.ports&&0<n.ports.length)for(var o=0,r=n.ports;o<r.length;o++){var s=r[o];s&&s.constraints&&s.constraints===pyi.None&&(s.constraints=pyi.Default)}}return e}function UAi(e,t){var i=t.style,n=t;t.canApplyStyle=!0;for(var o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"fill":i.fill=e.fill,i instanceof Ofi&&(i.fill="transparent");break;case"textOverflow":i.textOverflow=e.textOverflow;break;case"opacity":i.opacity=e.opacity;break;case"strokeColor":i.strokeColor=e.strokeColor;break;case"strokeDashArray":i.strokeDashArray=e.strokeDashArray;break;case"strokeWidth":i.strokeWidth=e.strokeWidth;break;case"bold":i.bold=e.bold;break;case"color":i.color=e.color;break;case"textWrapping":i.textWrapping=e.textWrapping;break;case"fontFamily":i.fontFamily=e.fontFamily;break;case"fontSize":i.fontSize=e.fontSize;break;case"italic":i.italic=e.italic;break;case"textAlign":i.textAlign=e.textAlign;break;case"whiteSpace":i.whiteSpace=e.whiteSpace;break;case"textDecoration":i.textDecoration=e.textDecoration;break;case"gradient":if(i.gradient){h=l=a=s=void 0;for(var s=e.gradient,a=i.gradient,l=0,h=Object.keys(s);l<h.length;l++)switch(h[l]){case"type":a.type=s.type;break;case"x1":a.x1=s.x1;break;case"x2":a.x2=s.x2;break;case"y1":a.y1=s.y1;break;case"y2":a.y2=s.y2;break;case"cx":a.cx=s.cx;break;case"cy":a.cy=s.cy;break;case"fx":a.fx=s.fx;break;case"fy":a.fy=s.fy;break;case"r":a.r=s.r;break;case"stops":a.stops=s.stops}}}t instanceof Tyi&&n.refreshTextElement()}function qAi(e,t,i){for(var n=t,o=n.hyperlink,r=0,s=Object.keys(e);r<s.length;r++)switch(s[r]){case"color":n.style.color=o.color=e.color;break;case"content":n.content=o.content=e.content||o.link;break;case"link":var a=i.style;n.style.color=(e.link?o:a).color,n.style.textDecoration=(e.link?o:i.style).textDecoration,n.content=e.link?o.content||e.link:i.content,o.link=e.link;break;case"textDecoration":n.style.textDecoration=o.textDecoration=e.textDecoration;break;case"hyperlinkOpenState":o.hyperlinkOpenState=e.hyperlinkOpenState}}function GAi(e,t,i){e.width=t.width,e.height=t.height,e.minHeight=t.minHeight,e.maxHeight=t.maxHeight,e.minWidth=t.minWidth,e.maxWidth=t.maxWidth,e.horizontalAlignment=t.wrapper.children[0].horizontalAlignment,e.verticalAlignment=t.wrapper.children[0].verticalAlignment,e.relativeMode=t.wrapper.children[0].relativeMode,e.visible=t.wrapper.children[0].visible,t.shape instanceof fxi&&(e.margin=t.shape.margin),e.id=t.wrapper.children[0].id,e.style=t.style;for(var n=0,o=i.views;n<o.length;n++){var r=o[n];fTi(t.id+"_groupElement",r),fTi(t.id+"_content_groupElement",r),fTi(t.id+"_html_element",r)}t.wrapper.children.splice(0,1),t.wrapper.children.splice(0,0,e)}function YAi(e,t,i,n){var o=new vyi;switch(e.shape.type){case"Path":var r=new kyi;r.data=t.shape.data,GAi(o=r,t,n);break;case"Image":r=new Lyi;r.source=t.shape.source,r.imageAlign=t.shape.align,r.imageScale=t.shape.scale,GAi(o=r,t,n);break;case"Text":GAi(o=new Tyi,t,n);break;case"Basic":r=new("Rectangle"===t.shape.shape?vyi:kyi);N||"Polygon"!==t.shape.shape?r.data=Hyi(t.shape.shape):r.data=Umi(t.shape.points),N||"Rectangle"!==t.shape.shape||(r.cornerRadius=t.shape.cornerRadius),GAi(o=r,t,n);break;case"Flow":var r=new kyi,s=t.shape.shape;r.data=k0i(s),GAi(o=r,t,n);break;case"Native":s=new Qyi(e.id,n.element.id);s.content=t.shape.content,s.scale=t.shape.scale,GAi(o=s,t,n);break;case"HTML":r=new Tvi(t.id,n.element.id);r.content=t.shape.content,GAi(o=r,t,n)}void 0===e.shape.type||e.shape.type===i.shape.type?XAi(e,t,n,i):(o.width=t.wrapper.children[0].width,o.height=t.wrapper.children[0].height,t.shape instanceof fxi&&(o.margin=t.shape.margin),o.style=t.style,t.wrapper.children[0]=o)}function XAi(e,t,i,n){if(0<Object.keys(e.shape).length)if("Path"===t.shape.type&&void 0!==e.shape.data)t.wrapper.children[0].data=e.shape.data;else if("Text"===t.shape.type&&void 0!==e.shape.content)t.wrapper.children[0].content=e.shape.content;else if("Image"===t.shape.type&&void 0!==e.shape.source)t.wrapper.children[0].source=e.shape.source;else if("Native"===t.shape.type){for(var o=void 0,r=0;r<i.views.length;r++)o=$Ii(t.wrapper.children[0].id+"_native_element",i.views[parseInt(r.toString(),10)]),void 0!==e.shape.content&&o&&(o.removeChild(o.children[0]),t.wrapper.children[0].content=e.shape.content,o.appendChild(yTi(t.wrapper.children[0],!1)));t.wrapper.children[0].scale=e.shape.scale||t.wrapper.children[0].scale}else if("HTML"===t.shape.type)for(var s=void 0,r=0;r<i.views.length;r++)(s=$Ii(t.wrapper.children[0].id+"_html_element",i.views[parseInt(r.toString(),10)]))&&(s.removeChild(s.children[0]),t.wrapper.children[0].content=e.shape.content,s.appendChild(yTi(t.wrapper.children[0],!0)));else{var a;"Flow"===t.shape.type&&void 0!==e.shape.shape?(t.shape.shape=e.shape.shape,a=k0i(t.shape.shape.toString()),t.wrapper.children[0].data=a):"UmlActivity"!==t.shape.type||N||void 0===e.shape.shape?void 0!==e.shape.cornerRadius?t.wrapper.children[0].cornerRadius=e.shape.cornerRadius:"Basic"===t.shape.type&&n&&"Rectangle"===n.shape.shape?(a=new kyi,n=Hyi(t.shape.shape),a.data=n,GAi(a,t,i)):void 0!==e.shape.shape&&(t.shape.shape=e.shape.shape,n=Hyi(t.shape.shape.toString()),t.wrapper.children[0].data=n):KAi(t,e)}t.wrapper.children[0].canMeasurePath=!0}function KAi(e,t){N?e.shape.umlActivityShape=t.shape.umlActivityShape:e.shape.shape=t.shape.shape;t=zSi((N?e.shape.umlActivityShape:e.shape.shape).toString());(N||"InitialNode"!==e.shape.shape)&&(N||"ForkNode"!==e.shape.shape&&"JoinNode"!==e.shape.shape)?N||"FinalNode"!==e.shape.shape||e instanceof MIi&&(e.wrapper=JAi(e)):e.wrapper.children[0].style.fill="black",t&&(e.wrapper.children[0].data=t)}function JAi(e){var t=new Vyi,i=(t.style.fill="transparent","M 25 50 C 11.21 50 0 38.79 0 25 C 0 11.21 11.21 0 25 0 C 38.78 0 50 11.21 50 25 C 50 38.79 38.78 50 25 50"),n=new kyi,o=(n.data=i,n.id=e.id+"_0_finalNode",n.horizontalAlignment="Center",n.verticalAlignment="Center",n.relativeMode="Object",n.style.strokeColor=e.style.strokeColor,n.style.strokeWidth=e.style.strokeWidth,new kyi);return o.data=i,o.id=e.id+"_1_finalNode",o.horizontalAlignment="Center",o.verticalAlignment="Center",o.relativeMode="Object",o.style.fill=e.style.fill,o.style.strokeColor=e.style.strokeColor,o.style.strokeWidth=e.style.strokeWidth,t.children=[n,o],t.children[0].width=e.width,t.children[0].height=e.height,t.children[1].height=e.height/1.5,t.children[1].width=e.width/1.5,t.style.strokeWidth=0,t.style.strokeColor="transparent",t}function ZAi(e,t,i){var n=i.shape.shape,o=zSi(n);switch(e.data=o,t=e,n){case"StructuredNode":if(i.annotations)for(var r=0;r<i.annotations.length;r++)i.annotations[parseInt(r.toString(),10)].content="<<"+i.annotations[parseInt(r.toString(),10)].content+">>";t=e;break;case"FinalNode":t=JAi(i)}return t}function $Ai(e){fTi(e+"_linear"),fTi(e+"_radial")}function e1i(e,t){t=e.indexOf(t);0<=t&&e.splice(t,1)}function t1i(e,t,i){e.intermediatePoints=t,e.updateSegmentElement(e,t,e.wrapper.children[0],i);var n,o=e.sourceDecorator;n="Bezier"===e.type?(r=e.segments[0],n=e.segments[e.segments.length-1],[Hmi.isEmptyPoint(n.point2)?n.bezierPoint2:n.point2,Hmi.isEmptyPoint(r.point1)?r.bezierPoint1:r.point1]):e.intermediatePoints,t=e.clipDecorators(e,t,i);(r=e.wrapper.children[0]).canMeasurePath=!0,r=e.wrapper.children[1],e.updateDecoratorElement(r,t[0],n[1],o);var i=e.targetDecorator,r=e.wrapper.children[2];e.updateDecoratorElement(r,t[t.length-1],n[n.length-2],i),e.updateShapeElement(e)}function i1i(e,t,i){var n,o,r,s,a=e.wrapper,l=(a.bounds,t.offset),h=t.size/i.scale,d=t.margin,p=a.offsetX-a.actualSize.width*a.pivot.x,c=a.offsetY-a.actualSize.height*a.pivot.y;if(o={x:0,y:0},0<e.nodes.length){switch(t.side){case"Top":o.x+=p+l*a.actualSize.width,o.y+=c-h;break;case"Bottom":o.x+=p+l*a.actualSize.width,o.y+=c+a.actualSize.height+h;break;case"Left":o.x+=p-h,o.y+=c+l*a.actualSize.height;break;case"Right":o.x+=p+a.actualSize.width+h,o.y+=c+l*a.actualSize.height}o.x+=(d.left-d.right)/i.scale+h/2*("Center"===t.horizontalAlignment?0:"Right"===t.horizontalAlignment?-1:1),o.y+=(d.top-d.bottom)/i.scale+h/2*("Center"===t.verticalAlignment?0:"Top"===t.verticalAlignment?-1:1)}else 0<e.connectors.length&&(n=(r=LAi((i=e.connectors[0]).intermediatePoints,e={offset:l})).index,o=r.point,r=kAi(i.intermediatePoints,e).angle,afi(s=ofi(),-r,i.intermediatePoints[parseInt(n.toString(),10)].x,i.intermediatePoints[parseInt(n.toString(),10)].y),(o=rfi(s,o)).x+=d.left-d.right+h/2*("Center"===t.horizontalAlignment?0:"Right"===t.horizontalAlignment?-1:1),o.y+=d.top-d.bottom+h/2*("Center"===t.verticalAlignment?0:"Top"===t.verticalAlignment?-1:1),afi(s=ofi(),r,i.intermediatePoints[parseInt(n.toString(),10)].x,i.intermediatePoints[parseInt(n.toString(),10)].y),o=rfi(s,o));return 0===a.rotateAngle&&0===a.parentTransform||(afi(s=ofi(),a.rotateAngle+a.parentTransform,a.offsetX,a.offsetY),o=rfi(s,o)),o}function n1i(e,t,i,n){if(n.annotation){if(Xvi(n.annotation))return!0}else if(Ufi[""+t]&e&&Zfi[""+t]&i)return!0;return!1}function o1i(e,t){return!!(Ufi[""+t]&e)}function r1i(e,t){return!!(uyi[""+t]&e)}function s1i(e,t){return e.visibility&t}function a1i(e,t){var i;if("Text"===e.shape.type)i=e.shape;else{var n=t.split("_");t=n[n.length-1];for(var o=0;o<e.annotations.length;o++)t===e.annotations[parseInt(o.toString(),10)].id&&(i=e.annotations[parseInt(o.toString(),10)])}return i}function l1i(e,t){var i;if(t&&(t=(i=t.split("_"))[i.length-1]),e)for(var n=0;n<e.ports.length;n++)if(t===e.ports[parseInt(n.toString(),10)].id)return e.ports[parseInt(n.toString(),10)]}function h1i(e,t){var i={},n=0;if(e.ports)for(var o=e.ports,n=0;n<o.length;n++)t?o[parseInt(n.toString(),10)].constraints&pyi.InConnect&&(i=o[parseInt(n.toString(),10)]):o[parseInt(n.toString(),10)].constraints&pyi.OutConnect&&(i=o[parseInt(n.toString(),10)]);return i}function d1i(e,t,i){for(var n=i?e.annotations:e.ports,o=0;o<n.length;o++)if(n[parseInt(o.toString(),10)].id===t)return o.toString();return"-1"}function p1i(e,t,i){for(var n=e.ports,o=0;o<n.length;o++)if(n[parseInt(o.toString(),10)].id===t)return o.toString();return"-1"}function c1i(e,t){for(var i=0;i<e.length;i++)if(t===e[parseInt(i.toString(),10)].id)return!0;return!1}function u1i(e,t,i,n){if(void 0!==e.width&&void 0!==e.height&&(e.width*=t,e.height*=i),e instanceof Syi){var o=ofi(),r=n.width||n.actualSize.width,s=n.height||n.actualSize.height;if(void 0!==r&&void 0!==s){var a=n.offsetX-r*n.pivot.x,l=n.offsetY-s*n.pivot.y,a={x:a+r*n.pivot.x,y:l+s*n.pivot.y},a=HTi(n.rotateAngle,n.offsetX,n.offsetY,a);afi(o,-n.rotateAngle,a.x,a.y),lfi(o,t,i,a.x,a.y),afi(o,n.rotateAngle,a.x,a.y);for(var h=0,d=e.children;h<d.length;h++){var p,c=d[h];void 0!==c.width&&void 0!==c.height&&(p=rfi(o,{x:c.offsetX,y:c.offsetY}),c.offsetX=p.x,c.offsetY=p.y,u1i(c,t,i,n))}}}}function g1i(e,t,i,n,o,r){for(var s,a,l,h=e.children,d=0;d<h.length;d++)(l=n[h[parseInt(d.toString(),10)]])&&(l.children?g1i(l,t,i,n,o,r):(l.offsetX-=t,l.offsetY-=i,o||((s=(n[l.id]=l).initContainer()).children||(s.children=[]),a=l.init(r),s.children.push(a),s.measure(new Omi(l.width,l.height)),s.arrange(s.desiredSize))))}function m1i(e,t,i){if(0===i.length)i.push(e);else if(1===i.length)i[0][""+t]>e[""+t]?i.splice(0,0,e):i.push(e);else if(1<i.length){for(var n=0,o=i.length-1,r=Math.floor((n+o)/2);r!==n;){if(i[parseInt(r.toString(),10)][""+t]<e[""+t])n=r;else{if(!(i[parseInt(r.toString(),10)][""+t]>e[""+t]))break;o=r}r=Math.floor((n+o)/2)}i[parseInt(o.toString(),10)][""+t]<e[""+t]?i.push(e):i[parseInt(n.toString(),10)][""+t]>e[""+t]?i.splice(n,0,e):i[parseInt(n.toString(),10)][""+t]<e[""+t]&&i[parseInt(o.toString(),10)][""+t]>e[""+t]&&i.splice(o,0,e)}}function f1i(e){for(var t=document.getElementById(e.diagramId),i="ej2_instances",n=t[i][0].nodes,o=(void 0===n&&(n=function(e){for(var t=[],i=0;i<e.palettes.length;i++)for(var n=e.palettes[parseInt(i.toString(),10)].symbols,o=0;o<n.length;o++)n[parseInt(o.toString(),10)]instanceof MIi&&t.push(n[parseInt(o.toString(),10)]);return t}(t[i][0])),0);n&&o<n.length;o++)if(n[parseInt(o.toString(),10)].id===e.nodeId)return y1i(n[parseInt(o.toString(),10)],e);for(var r=t[i][0].connectors,o=0;r&&o<r.length;o++)if(r[parseInt(o.toString(),10)].id===e.nodeId)return y1i(r[parseInt(o.toString(),10)],e);var s=t[i][0].enterObject;return s&&(s.id===e.nodeId||s.children)?s.children&&vAi(s,"HTML",t[i][0].enterTable)?t[i][0].enterTable[e.nodeId]:s:null}function y1i(e,t){for(var i=e.annotations,n=0;i&&n<i.length;n++)if(t.annotationId&&i[parseInt(n.toString(),10)].id===t.annotationId)return i[parseInt(n.toString(),10)];return e}function v1i(e,t,i,n,o,r,s,a){var l={x:0,y:0},h=ofi();switch(afi(h,o,r,s),a.x){case 0:switch(a.y){case 0:l=rfi(h,{x:e,y:t});break;case.5:l=rfi(h,{x:e,y:t+n/2});break;case 1:l=rfi(h,{x:e,y:t+n})}break;case.5:switch(a.y){case 0:l=rfi(h,{x:e+i/2,y:t});break;case.5:l=rfi(h,{x:e+i/2,y:t+n/2});break;case 1:l=rfi(h,{x:e+i/2,y:t+n})}break;case 1:switch(a.y){case 0:l=rfi(h,{x:e+i,y:t});break;case.5:l=rfi(h,{x:e+i,y:t+n/2});break;case 1:l=rfi(h,{x:e+i,y:t+n})}}return{x:l.x,y:l.y}}function b1i(e,t,i,n,o,r,s,a){if(e.hasChildren())for(var l=0,h=e.children;l<h.length;l++){var d=h[l],p=void 0,c=(d instanceof Vyi&&(p=n.nameTable[d.id])&&(r&&(p.flip^=jfi.Horizontal),s)&&(p.flip^=jfi.Vertical),t-d.offsetX+t),u=i-d.offsetY+i,c=(d instanceof Tyi||d.elementActions&Jfi.ElementIsPort||(o!==jfi.Horizontal&&!r||(d.offsetX=c,p&&(p.offsetX=c),d.flipOffset.x=c-d.desiredSize.width/2),o===jfi.Vertical||s?(d.offsetY=u,p&&(p.offsetY=u),d.flipOffset.y=u-d.desiredSize.height/2):o===jfi.Both&&(d.offsetX=c,d.flipOffset.x=c-d.desiredSize.width/2,d.offsetY=u,d.flipOffset.y=u-d.desiredSize.height/2,p)&&(p.offsetX=c,p.offsetY=u)),a||(d instanceof Vyi||d instanceof Syi)&&(r&&(d.flip^=jfi.Horizontal),s&&(d.flip^=jfi.Vertical),!d.id.includes("group_container")&&d.children&&(r&&(d.children[0].flip^=jfi.Horizontal),s)&&(d.children[0].flip^=jfi.Vertical),b1i(d,t,i,n,o,r,s,a)),d.measure(new Omi(d.bounds.width,d.bounds.height)),d.arrange(d.desiredSize),n.nameTable[d.id]);c&&n.updateConnectorEdges(c)}}function w1i(e){for(var t=e.selectedItems.nodes,i=e.selectedItems.connectors,n=e.allowServerDataBinding,o=e.isProtectedOnChange,n=(e.protectPropertyChange(!0),e.allowServerDataBinding=!1,e.selectedItems.nodes=[],e.selectedItems.connectors=[],e.allowServerDataBinding=n,e.protectPropertyChange(o),DTi(e.selectedItems)),r=0;r<t.length;r++)e.selectedItems.nodes.push(e.nameTable[t[r].id]);for(r=0;r<i.length;r++)e.selectedItems.connectors.push(e.nameTable[i[r].id]);return n}function C1i(e,t){return Math.abs(t.x-e.x)>Math.abs(t.y-e.y)?e.x<t.x?"Right":"Left":e.y<t.y?"Bottom":"Top"}var S1i=function(e){return e=e&&(void 0!==e.sourceID||void 0!==e.sourcePoint||void 0!==e.targetID||void 0!==e.targetPoint||void 0!==e.type?ISi:MIi)},A1i=function(e){var t,i;e.sourceID||e.targetID||(t={x:e.sourcePoint.x,y:e.sourcePoint.y},i={x:e.targetPoint.x,y:e.targetPoint.y},e.flip===jfi.Horizontal?(e.sourcePoint.x=i.x,e.targetPoint.x=t.x):e.flip===jfi.Vertical?(e.sourcePoint.y=i.y,e.targetPoint.y=t.y):e.flip===jfi.Both&&(e.sourcePoint=i,e.targetPoint=t))},x1i=function(e,t,i){var n=i.offset.x,o=i.offset.y;return t===jfi.Horizontal?(n=1-i.offset.x,o=i.offset.y):t===jfi.Vertical?(n=i.offset.x,o=1-i.offset.y):t===jfi.Both&&(n=1-i.offset.x,o=1-i.offset.y),e.setOffsetWithRespectToBounds(n,o,"Fraction"),e},I1i=function(e,t){for(var i=new kyi,n=0;n<e.length-1;n++){o=D1i(e[n],e[n+1]),i.data=o[0],i.id=t.id+"_"+t.shape.sequence;var o=T1i(e);i.offsetX=o.x,i.offsetY=o.y,i.rotateAngle=45,i.transform=tyi.Self;break}return i},T1i=function(e,t,i){for(var n=0,o=0;o<e.length-1;o++)n+=M1i(e[parseInt(o.toString(),10)],e[o+1]);for(var r=i?n*i:30<n/2?10:n/2,s=0,a=0;a<e.length-1;a++){var l=M1i(e[parseInt(a.toString(),10)],e[a+1]);if(r<=s+l){var h=r-s,d=K0i(e[a],e[a+1]),p=Hmi.transform(e[a],d,h);break}s+=l}return p},E1i=function(e,t){if(e instanceof MIi||e instanceof ISi)for(var i=0;i<e.ports.length;i++)if(e.ports[i].id===t.id.split("_").splice(1).join("_"))return!0;return!1},D1i=function(e,t){var i={x:e.x,y:e.y},n=M1i(e,t),n=Math.min(10,n/2),e=K0i(e,t),t=Hmi.transform({x:i.x,y:i.y},e,n),i=Hmi.transform({x:t.x,y:t.y},e,-11),n=Hmi.transform({x:i.x,y:i.y},e,22);return["M"+i.x+" "+i.y+" L"+n.x+" "+n.y,t]},M1i=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function k1i(e){return e}function P1i(){return(0<=navigator.platform.indexOf("Mac")||0<=navigator.platform.indexOf("iPad")||0<=navigator.platform.indexOf("iPhone")||0<=navigator.platform.indexOf("MacIntel"))&&("safari"===F.info.name||"webkit"===F.info.name)}function B1i(e){return-1!==e.indexOf("shape")||-1!==e.indexOf("pathData")||-1!==e.indexOf("width")||-1!==e.indexOf("height")}function F1i(e,t,i){var n=L1i(e,t,i,"width"),e=L1i(e,t,i,"height");return new Omi(n,e)}function L1i(e,t,i,n){return void 0!==t.previewSize[""+n]?t.previewSize[""+n]:void 0!==e.symbolPreview[""+n]?e.symbolPreview[""+n]:t[""+n]||i.actualSize[""+n]}function R1i(e,t,i){return i=e&&e.parentId?(e=t.nameTable[e.parentId]).parentId?R1i(e,t,i):e.id:i}function O1i(e,t){return 1<e.selectedItems.connectors.length&&0===e.selectedItems.nodes.length&&0!==t.rotateAngle}function N1i(e){if(e.arrowType&&""!==e.arrowType.trim())switch(e.arrowType){case"single-line-arrow":return{targetDecorator:"Arrow",strokeWidth:1};case"double-line-arrow":return{targetDecorator:"Arrow",strokeWidth:2};case"dotted-arrow":return{targetDecorator:"Arrow",strokeDashArray:"2,2"};case"single-line":return{targetDecorator:"None",strokeWidth:1};case"double-line":return{targetDecorator:"None",strokeWidth:2};case"dotted":return{targetDecorator:"None",strokeDashArray:"2,2"};case"wiggly-arrow":return{targetDecorator:"None",strokeWidth:1,opacity:0};default:return{targetDecorator:"Arrow",strokeWidth:1}}return{targetDecorator:"Arrow",strokeWidth:1}}V1i=function(e,t){return(V1i=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])}))(e,t)};var V1i,_1i,Uk=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},ey=(function(e,t){function i(){this.constructor=e}V1i(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(H1i,_1i=n),Uk([e("None")],H1i.prototype,"shape",void 0),Uk([e("white")],H1i.prototype,"fill",void 0),Uk([e("Auto")],H1i.prototype,"horizontalAlignment",void 0),Uk([e("Auto")],H1i.prototype,"verticalAlignment",void 0),Uk([e(10)],H1i.prototype,"width",void 0),Uk([e(10)],H1i.prototype,"height",void 0),Uk([t({x:.5,y:1},Hmi)],H1i.prototype,"offset",void 0),Uk([e("#1a1a1a")],H1i.prototype,"borderColor",void 0),Uk([e(1)],H1i.prototype,"borderWidth",void 0),Uk([t({},ZOt)],H1i.prototype,"margin",void 0),Uk([e("")],H1i.prototype,"pathData",void 0),Uk([e("")],H1i.prototype,"content",void 0),Uk([e(0)],H1i.prototype,"cornerRadius",void 0),Uk([t({left:2,right:2,top:2,bottom:2},ZOt)],H1i.prototype,"padding",void 0),Uk([e("#1a1a1a")],H1i.prototype,"iconColor",void 0),H1i);function H1i(){return null!==_1i&&_1i.apply(this,arguments)||this}z1i=function(e,t){return(z1i=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}z1i(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Q1i,j1i=Syi),Q1i.prototype.measure=function(e){var t="Horizontal"===this.orientation?this.updateHorizontalStack:this.updateVerticalStack;return this.desiredSize=this.measureStackPanel(e,t),this.desiredSize},Q1i.prototype.arrange=function(e){var t="Horizontal"===this.orientation?this.arrangeHorizontalStack:this.arrangeVerticalStack;return this.actualSize=this.arrangeStackPanel(e,t),this.updateBounds(),this.actualSize},Q1i.prototype.measureStackPanel=function(e,t){var i=void 0;if(void 0!==this.children&&0<this.children.length)for(var n=0,o=this.children;n<o.length;n++){var r=o[n],s=(r.parentTransform=this.rotateAngle+this.parentTransform,this.measureChildren?r.measure(r.desiredSize):r.measure(e),r.desiredSize.clone());this.applyChildMargin(r,s),0!==r.rotateAngle&&(s=_Ti(s,r.rotateAngle)),void 0===i?i=s:r.preventContainer||t(s,i)}return i=j1i.prototype.validateDesiredSize.call(this,i,e),this.stretchChildren(i),this.considerPadding&&this.applyPadding(i),i},Q1i.prototype.arrangeStackPanel=function(e,t){if(void 0!==this.children&&0<this.children.length)for(var i=void 0,n=void 0,i=this.offsetX-e.width*this.pivot.x+this.padding.left,n=this.offsetY-e.height*this.pivot.y+this.padding.top,o=0,r=this.children;o<r.length;o++){var s=r[o],a=s.desiredSize.clone(),l=a,h=("Vertical"===this.orientation?n+=s.margin.top:i+=s.margin.left,t(i,n,s,this,e,l=0!==s.rotateAngle?_Ti(a,s.rotateAngle):l));j1i.prototype.findChildOffsetFromCenter.call(this,s,h),s.arrange(a,!0),"Vertical"===this.orientation?n+=l.height+s.margin.bottom:i+=l.width+s.margin.right}return e},Q1i.prototype.updateHorizontalStack=function(e,t){t.height=Math.max(e.height,t.height),t.width+=e.width},Q1i.prototype.updateVerticalStack=function(e,t){t.width=Math.max(e.width,t.width),t.height+=e.height},Q1i.prototype.arrangeHorizontalStack=function(e,t,i,n,o,r){var s=0;return"Top"===i.verticalAlignment?s=t+i.margin.top+r.height/2:"Bottom"===i.verticalAlignment?s=n.offsetY+o.height*(1-n.pivot.y)-n.padding.bottom-i.margin.bottom-r.height/2:(s=n.offsetY-o.height*n.pivot.y+o.height/2,i.margin.top&&(s=t+i.margin.top+r.height/2)),{x:e+r.width/2,y:s}},Q1i.prototype.arrangeVerticalStack=function(e,t,i,n,o,r){var s=0;return"Left"===i.horizontalAlignment?s=e+i.margin.left+r.width/2:"Right"===i.horizontalAlignment?s=n.offsetX+o.width*(1-n.pivot.x)-n.padding.right-i.margin.right-r.width/2:(s=n.offsetX-o.width*n.pivot.x+o.width/2,i.margin.left&&(s=e+i.margin.left+r.width/2)),{x:s,y:t+r.height/2}},Q1i.prototype.stretchChildren=function(e){if(void 0!==this.children&&0<this.children.length)for(var t=0,i=this.children;t<i.length;t++){var n=i[t];"Vertical"===this.orientation?"Stretch"===n.horizontalAlignment&&(n.desiredSize.width=e.width-(n.margin.left+n.margin.right)):"Stretch"===n.verticalAlignment&&(n.desiredSize.height=e.height-(n.margin.top+n.margin.bottom))}},Q1i.prototype.applyChildMargin=function(e,t){t.height+=e.margin.top+e.margin.bottom,t.width+=e.margin.left+e.margin.right};var z1i,j1i,W1i=Q1i;function Q1i(){var e=null!==j1i&&j1i.apply(this,arguments)||this;return e.orientation="Vertical",e.measureChildren=void 0,e.considerPadding=!0,e}function U1i(e,t,i){var n,o="NoWrap",r=("Class"===t.shape.classifier?n=t.shape.classShape:"Enumeration"===t.shape.classifier?n=t.shape.enumerationShape:"Interface"===t.shape.classifier&&(n=t.shape.interfaceShape),t.container={type:"Stack",orientation:"Vertical"},t.constraints=(Kfi.Default|Kfi.HideThumbs)&~(Kfi.Rotate|Kfi.Resize),t.style={fill:t.style.fill,strokeColor:t.style.strokeColor,strokeWidth:1.5},t.children=[],t.maxWidth&&(o="Wrap"),new MIi(i,"nodes",{id:t.id+"_umlClass_header",annotations:[{id:"name",content:n.name,offset:{x:.5,y:.65},margin:{left:10,right:10},style:{bold:!0,fontSize:14,color:n.style.color,fill:n.style.fill,textWrapping:o}},{content:"<<"+t.shape.classifier+">>",margin:{left:10,right:10},id:"class",style:{fontSize:n.style.fontSize,color:n.style.color,fill:n.style.fill,textWrapping:o},offset:{x:.5,y:.3},constraints:Xfi.ReadOnly}],constraints:(Kfi.Default|Kfi.HideThumbs)&~(Kfi.Rotate|Kfi.Drag|Kfi.Resize),verticalAlignment:"Stretch",horizontalAlignment:"Stretch",style:{fill:t.style.fill,strokeColor:"black"===t.style.strokeColor?"#ffffff00":t.style.strokeColor}},!0)),s=(i.initObject(r),i.nodes.push(r),i.UpdateBlazorDiagramModel(r,"Node"),t.children.push(r.id),t),a=i,r=n,l=o;if("Enumeration"===s.shape.classifier){var h=r.members;if(h&&h.length){q1i(s,a);for(var d="",p=0;p<h.length;p++){var c=h[parseInt(p.toString(),10)];""!==c.name&&(d+=c.name),p!==h.length&&(m=Y1i(s,c),f=new MIi(a,"nodes",{id:xTi()+"_umlMember",annotations:[{id:"name",content:d,offset:{x:0,y:.5},style:{bold:!0,fontSize:m.fontSize,color:m.color,fill:m.fill,textWrapping:l,italic:m.italic,fontFamily:m.fontFamily,whiteSpace:m.whiteSpace,textAlign:m.textAlign,textDecoration:m.textDecoration,textOverflow:m.textOverflow},margin:{left:14,right:5},horizontalAlignment:"Left"}],verticalAlignment:"Stretch",horizontalAlignment:"Stretch",style:{fill:s.style.fill,strokeColor:"black"===s.style.strokeColor?"#ffffff00":s.style.strokeColor,textWrapping:l},constraints:(Kfi.Default|Kfi.HideThumbs)&~(Kfi.Rotate|Kfi.Drag|Kfi.Resize),minHeight:25},!0),a.initObject(f),a.nodes.push(f),a.UpdateBlazorDiagramModel(f,"Node"),s.children.push(f.id),d="",c.isSeparator&&p!==h.length-1&&q1i(s,a,c.separatorStyle),c.isSeparator)&&p===h.length-1&&(c.isSeparator=!1)}}}else{var u=r.attributes;if(u.length){var g="";q1i(s,a);for(p=0;p<u.length;p++){var m,f,y=void 0,v=u[parseInt(p.toString(),10)];y=v.scope&&"Public"===v.scope?" +":v.scope&&"Private"===v.scope?"-":v.scope&&"Protected"===v.scope?"#":"~",""!==v.name&&y&&(g+=y+" "+v.name+" : "+v.type),p!==u.length&&(m=Y1i(s,v),f=new MIi(a,"nodes",{id:xTi()+"_umlProperty",style:{fill:s.style.fill,strokeColor:"black"===s.style.strokeColor?"#ffffff00":s.style.strokeColor},annotations:[{id:"name",content:g,offset:{x:0,y:.5},style:{bold:!0,fontSize:m.fontSize,color:m.color,fill:m.fill,textWrapping:l,italic:m.italic,fontFamily:m.fontFamily,whiteSpace:m.whiteSpace,textAlign:m.textAlign,textDecoration:m.textDecoration,textOverflow:m.textOverflow},margin:{left:14,right:5},horizontalAlignment:"Left"}],verticalAlignment:"Stretch",horizontalAlignment:"Stretch",constraints:(Kfi.Default|Kfi.HideThumbs)&~(Kfi.Rotate|Kfi.Drag|Kfi.Resize),minHeight:25},!0),a.initObject(f),a.nodes.push(f),a.UpdateBlazorDiagramModel(f,"Node"),s.children.push(f.id),g="",v.isSeparator&&p!==u.length-1&&q1i(s,a,v.separatorStyle),v.isSeparator)&&p===u.length-1&&(v.isSeparator=!1)}}}var b=t,w=i,r=n,C=o;if(r.methods&&r.methods.length)for(var S=r.methods,A=(q1i(b,w),""),x="",I=void 0,T=0;T<S.length;T++){var E,D=S[parseInt(T.toString(),10)];if(I=D.scope&&"Public"===D.scope?" +":D.scope&&"Private"===D.scope?"-":D.scope&&"Protected"===D.scope?"#":"~",D.parameters)for(var M=0;M<D.parameters.length;M++)D.parameters[parseInt(M.toString(),10)].type?A+=D.parameters[parseInt(M.toString(),10)].name+":"+D.parameters[parseInt(M.toString(),10)].type:A+=D.parameters[parseInt(M.toString(),10)].name,M!==D.parameters.length-1&&(A+=",");""!==D.name&&(I&&(x+=I+" "+D.name+"("+A+") : "+D.type),A=""),T!==S.length&&(E=Y1i(b,D),E=new MIi(w,"nodes",{id:xTi()+"_umlMethods",verticalAlignment:"Stretch",horizontalAlignment:"Stretch",annotations:[{id:"name",content:x,offset:{x:0,y:.5},style:{bold:!0,fontSize:E.fontSize,color:E.color,fill:E.fill,textWrapping:C,italic:E.italic,fontFamily:E.fontFamily,whiteSpace:E.whiteSpace,textAlign:E.textAlign,textDecoration:E.textDecoration,textOverflow:E.textOverflow},margin:{left:14,right:5},horizontalAlignment:"Left"}],style:{fill:b.style.fill,strokeColor:"black"===b.style.strokeColor?"#ffffff00":b.style.strokeColor},minHeight:25,constraints:(Kfi.Default|Kfi.HideThumbs)&~(Kfi.Rotate|Kfi.Drag|Kfi.Resize)},!0),w.initObject(E),w.nodes.push(E),w.UpdateBlazorDiagramModel(E,"Node"),b.children.push(E.id),x="",D.isSeparator&&T!==S.length-1&&q1i(b,w,D.separatorStyle),D.isSeparator)&&T===S.length-1&&(D.isSeparator=!1)}return t.offsetX=t.offsetX,t.offsetY=t.offsetY,t.style.fill=t.style.fill,t.borderColor=t.borderColor,i.initObject(t),e}function q1i(e,t,i){i=new MIi(t,"nodes",{id:xTi()+"_path",height:1,constraints:Kfi.Default&~Kfi.Select,verticalAlignment:"Stretch",horizontalAlignment:"Stretch",style:{strokeColor:"black"===e.style.strokeColor?"#ffffff00":e.style.strokeColor,fill:i?i.fill:"white"}},!0);t.initObject(i),t.nodes.push(i),e.children.push(i.id)}function G1i(e,t,i){var n=new MIi(t,"nodes",{id:xTi()+"_path",height:1,constraints:Kfi.Default&~Kfi.Select,verticalAlignment:"Stretch",horizontalAlignment:"Stretch",style:{strokeColor:"black"===e.style.strokeColor?"#ffffff00":e.style.strokeColor,fill:"white"}},!0);n.parentId=e.id,n.umlIndex=i,t.add(n)}function Y1i(e,t){var i={},t=t.style;return i.fill=("transparent"!==t.fill?t:e.style).fill,i.color=t.color,i.fontFamily=("Arial"!==t.fontFamily?t:e.style).fontFamily,i.italic=t.italic,i.bold=t.bold,i.whiteSpace=t.whiteSpace,i.textAlign=t.textAlign,i.textWrapping=t.textWrapping,i.textDecoration=t.textDecoration,i.textOverflow=t.textOverflow,i.fontSize=(12!==t.fontSize?t:e.style).fontSize,i.strokeColor=("black"!==t.strokeColor?t:e.style).strokeColor,i.strokeWidth=(1!==t.strokeWidth?t:e.style).strokeWidth,i}X1i=function(e,t){return(X1i=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])}))(e,t)};var X1i,K1i,h3=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},rz=(function(e,t){function i(){this.constructor=e}X1i(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(J1i,K1i=n),h3([e("Horizontal")],J1i.prototype,"orientation",void 0),h3([e("Center")],J1i.prototype,"type",void 0),h3([e(void 0)],J1i.prototype,"offset",void 0),h3([e(!1)],J1i.prototype,"enableRouting",void 0),h3([e([])],J1i.prototype,"children",void 0),h3([e("")],J1i.prototype,"assistants",void 0),h3([e("")],J1i.prototype,"level",void 0),h3([e("")],J1i.prototype,"hasSubTree",void 0),h3([e("")],J1i.prototype,"rows",void 0),J1i);function J1i(){return null!==K1i&&K1i.apply(this,arguments)||this}function Z1i(e){if(e)switch(e.type){case"Basic":return bxi;case"Flow":return Sxi;case"Path":return oxi;case"Image":return uxi;case"Text":return fxi;case"Bpmn":return Jxi;case"Native":return axi;case"HTML":return dxi;case"UmlActivity":return eIi;case"UmlClassifier":return xIi;case"SwimLane":return zIi;default:return bxi}return bxi}$1i=function(e,t){return($1i=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])}))(e,t)};var $1i,exi,n3=function(e,t){function i(){this.constructor=e}$1i(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},qo=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},txi=(n3(ixi,exi=n),qo([e("Basic")],ixi.prototype,"type",void 0),ixi);function ixi(){return null!==exi&&exi.apply(this,arguments)||this}n3(rxi,nxi=txi),rxi.prototype.getClassName=function(){return"Path"},qo([e("Path")],rxi.prototype,"type",void 0),qo([e("")],rxi.prototype,"data",void 0);var nxi,oxi=rxi;function rxi(){return null!==nxi&&nxi.apply(this,arguments)||this}n3(lxi,sxi=txi),lxi.prototype.getClassName=function(){return"Native"},qo([e("Native")],lxi.prototype,"type",void 0),qo([e("")],lxi.prototype,"content",void 0),qo([e("Stretch")],lxi.prototype,"scale",void 0);var sxi,axi=lxi;function lxi(){return null!==sxi&&sxi.apply(this,arguments)||this}n3(pxi,hxi=txi),pxi.prototype.getClassName=function(){return"Html"},qo([e("HTML")],pxi.prototype,"type",void 0),qo([e("")],pxi.prototype,"content",void 0);var hxi,dxi=pxi;function pxi(){return null!==hxi&&hxi.apply(this,arguments)||this}n3(gxi,cxi=txi),gxi.prototype.getClassName=function(){return"Image"},qo([e("Image")],gxi.prototype,"type",void 0),qo([e("")],gxi.prototype,"source",void 0),qo([e("None")],gxi.prototype,"scale",void 0),qo([e("None")],gxi.prototype,"align",void 0);var cxi,uxi=gxi;function gxi(){return null!==cxi&&cxi.apply(this,arguments)||this}n3(yxi,mxi=txi),yxi.prototype.getClassName=function(){return"Text"},qo([e("Text")],yxi.prototype,"type",void 0),qo([e("")],yxi.prototype,"content",void 0),qo([t({},ZOt)],yxi.prototype,"margin",void 0);var mxi,fxi=yxi;function yxi(){return null!==mxi&&mxi.apply(this,arguments)||this}n3(wxi,vxi=txi),wxi.prototype.getClassName=function(){return"BasicShape"},qo([e("Basic")],wxi.prototype,"type",void 0),qo([e("Rectangle")],wxi.prototype,"shape",void 0),qo([e(0)],wxi.prototype,"cornerRadius",void 0),qo([kt([],Hmi)],wxi.prototype,"points",void 0);var vxi,bxi=wxi;function wxi(){return null!==vxi&&vxi.apply(this,arguments)||this}n3(Axi,Cxi=txi),Axi.prototype.getClassName=function(){return"FlowShape"},qo([e("Flow")],Axi.prototype,"type",void 0),qo([e("Terminator")],Axi.prototype,"shape",void 0);var Cxi,Sxi=Axi;function Axi(){return null!==Cxi&&Cxi.apply(this,arguments)||this}n3(Txi,xxi=n),Txi.prototype.getClassName=function(){return"BpmnGateway"},qo([e("None")],Txi.prototype,"type",void 0);var xxi,Ixi=Txi;function Txi(){return null!==xxi&&xxi.apply(this,arguments)||this}n3(Mxi,Exi=n),Mxi.prototype.getClassName=function(){return"BpmnDataObject"},qo([e("None")],Mxi.prototype,"type",void 0),qo([e(!1)],Mxi.prototype,"collection",void 0);var Exi,Dxi=Mxi;function Mxi(){return null!==Exi&&Exi.apply(this,arguments)||this}n3(Pxi,kxi=n),qo([e("None")],Pxi.prototype,"type",void 0),qo([e("None")],Pxi.prototype,"loop",void 0),qo([e(!1)],Pxi.prototype,"call",void 0),qo([e(!1)],Pxi.prototype,"compensation",void 0);var kxi,d2=Pxi;function Pxi(){return null!==kxi&&kxi.apply(this,arguments)||this}n3(Lxi,Bxi=n),Lxi.prototype.getClassName=function(){return"BpmnEvent"},qo([e("Start")],Lxi.prototype,"event",void 0),qo([e("None")],Lxi.prototype,"trigger",void 0);var Bxi,Fxi=Lxi;function Lxi(){return null!==Bxi&&Bxi.apply(this,arguments)||this}n3(Nxi,Rxi=n),Nxi.prototype.getClassName=function(){return"BpmnSubEvent"},qo([e("None")],Nxi.prototype,"trigger",void 0),qo([e("Start")],Nxi.prototype,"event",void 0),qo([e("")],Nxi.prototype,"id",void 0),qo([t({},Hmi)],Nxi.prototype,"offset",void 0),qo([kt([],f0i)],Nxi.prototype,"annotations",void 0),qo([kt([],r0i)],Nxi.prototype,"ports",void 0),qo([e()],Nxi.prototype,"width",void 0),qo([e()],Nxi.prototype,"height",void 0),qo([t({},ZOt)],Nxi.prototype,"margin",void 0),qo([e("Center")],Nxi.prototype,"horizontalAlignment",void 0),qo([e("Center")],Nxi.prototype,"verticalAlignment",void 0),qo([e(!0)],Nxi.prototype,"visible",void 0);var Rxi,Oxi=Nxi;function Nxi(){return null!==Rxi&&Rxi.apply(this,arguments)||this}n3(_xi,Vxi=n),qo([t({id:"success",event:"End",offset:{x:1,y:.5}},Oxi)],_xi.prototype,"success",void 0),qo([t({id:"failure",event:"Intermediate",trigger:"Error",offset:{x:.25,y:1}},Oxi)],_xi.prototype,"failure",void 0),qo([t({id:"cancel",event:"Intermediate",trigger:"Cancel",offset:{x:.75,y:1}},Oxi)],_xi.prototype,"cancel",void 0);var Vxi,CW=_xi;function _xi(){return null!==Vxi&&Vxi.apply(this,arguments)||this}n3(zxi,Hxi=n),qo([e("None")],zxi.prototype,"type",void 0),qo([e(!1)],zxi.prototype,"adhoc",void 0),qo([e("Default")],zxi.prototype,"boundary",void 0),qo([e(!1)],zxi.prototype,"compensation",void 0),qo([e("None")],zxi.prototype,"loop",void 0),qo([e(!0)],zxi.prototype,"collapsed",void 0),qo([kt([],Oxi)],zxi.prototype,"events",void 0),qo([t({},CW)],zxi.prototype,"transaction",void 0),qo([e(void 0)],zxi.prototype,"processes",void 0);var Hxi,c8=zxi;function zxi(){return null!==Hxi&&Hxi.apply(this,arguments)||this}n3(Qxi,jxi=n),Qxi.prototype.getClassName=function(){return"BpmnActivity"},qo([e("Task")],Qxi.prototype,"activity",void 0),qo([t({},d2)],Qxi.prototype,"task",void 0),qo([t({},c8)],Qxi.prototype,"subProcess",void 0);var jxi,Wxi=Qxi;function Qxi(){return null!==jxi&&jxi.apply(this,arguments)||this}n3(Gxi,Uxi=n),Gxi.prototype.getClassName=function(){return"BpmnAnnotation"},qo([e("")],Gxi.prototype,"text",void 0),qo([e("")],Gxi.prototype,"id",void 0),qo([e(0)],Gxi.prototype,"angle",void 0),qo([e()],Gxi.prototype,"height",void 0),qo([e()],Gxi.prototype,"width",void 0),qo([e(0)],Gxi.prototype,"length",void 0);var Uxi,qxi=Gxi;function Gxi(e,t,i,n){return Uxi.call(this,e,t,i,n)||this}n3(Xxi,Yxi=n),qo([e("")],Xxi.prototype,"textAnnotationTarget",void 0),qo([e("Auto")],Xxi.prototype,"textAnnotationDirection",void 0);var Yxi,$8=Xxi;function Xxi(){return null!==Yxi&&Yxi.apply(this,arguments)||this}n3(Zxi,Kxi=txi),Zxi.prototype.getClassName=function(){return"BpmnShape"},qo([e("Bpmn")],Zxi.prototype,"type",void 0),qo([e("Event")],Zxi.prototype,"shape",void 0),qo([t({},Fxi)],Zxi.prototype,"event",void 0),qo([t({},Ixi)],Zxi.prototype,"gateway",void 0),qo([t({},Dxi)],Zxi.prototype,"dataObject",void 0),qo([t({},Wxi)],Zxi.prototype,"activity",void 0),qo([t({},qxi)],Zxi.prototype,"annotation",void 0),qo([kt([],qxi)],Zxi.prototype,"annotations",void 0),qo([t({},$8)],Zxi.prototype,"textAnnotation",void 0);var Kxi,Jxi=Zxi;function Zxi(){return null!==Kxi&&Kxi.apply(this,arguments)||this}n3(tIi,$xi=txi),tIi.prototype.getClassName=function(){return"UmlActivityShape"},qo([e("UmlActivity")],tIi.prototype,"type",void 0),qo([e("Action")],tIi.prototype,"shape",void 0);var $xi,eIi=tIi;function tIi(){return null!==$xi&&$xi.apply(this,arguments)||this}n3(oIi,iIi=n),oIi.prototype.getClassName=function(){return"MethodArguments"},qo([e("")],oIi.prototype,"name",void 0),qo([e("")],oIi.prototype,"type",void 0),qo([t({},ZNt)],oIi.prototype,"style",void 0);var iIi,nIi=oIi;function oIi(){return null!==iIi&&iIi.apply(this,arguments)||this}n3(aIi,rIi=nIi),aIi.prototype.getClassName=function(){return"UmlClassAttribute"},qo([e("Public")],aIi.prototype,"scope",void 0),qo([e(!1)],aIi.prototype,"isSeparator",void 0),qo([t({fill:"#F9F9F9",strokeColor:"#CCCCCC"},XNt)],aIi.prototype,"separatorStyle",void 0);var rIi,sIi=aIi;function aIi(){return null!==rIi&&rIi.apply(this,arguments)||this}n3(dIi,lIi=sIi),dIi.prototype.getClassName=function(){return"UmlClassMethod"},qo([kt([],nIi)],dIi.prototype,"parameters",void 0);var lIi,hIi=dIi;function dIi(){return null!==lIi&&lIi.apply(this,arguments)||this}n3(uIi,pIi=n),uIi.prototype.getClassName=function(){return"UmlClass"},qo([e("")],uIi.prototype,"name",void 0),qo([kt([],sIi)],uIi.prototype,"attributes",void 0),qo([kt([],hIi)],uIi.prototype,"methods",void 0),qo([t({},ZNt)],uIi.prototype,"style",void 0);var pIi,cIi=uIi;function uIi(){return null!==pIi&&pIi.apply(this,arguments)||this}n3(fIi,gIi=cIi),qo([e(!(fIi.prototype.getClassName=function(){return"UmlInterface"}))],fIi.prototype,"isSeparator",void 0),qo([t({fill:"#F9F9F9",strokeColor:"#CCCCCC"},XNt)],fIi.prototype,"separatorStyle",void 0);var gIi,mIi=fIi;function fIi(){return null!==gIi&&gIi.apply(this,arguments)||this}n3(bIi,yIi=n),bIi.prototype.getClassName=function(){return"UmlEnumerationMember"},qo([e("")],bIi.prototype,"name",void 0),qo([e("")],bIi.prototype,"value",void 0),qo([e(!1)],bIi.prototype,"isSeparator",void 0),qo([t({fill:"#F9F9F9",strokeColor:"#CCCCCC"},XNt)],bIi.prototype,"separatorStyle",void 0),qo([t({},ZNt)],bIi.prototype,"style",void 0);var yIi,vIi=bIi;function bIi(){return null!==yIi&&yIi.apply(this,arguments)||this}n3(SIi,wIi=n),SIi.prototype.getClassName=function(){return"UmlEnumeration"},qo([e("")],SIi.prototype,"name",void 0),qo([kt([],vIi)],SIi.prototype,"members",void 0),qo([t({},ZNt)],SIi.prototype,"style",void 0);var wIi,CIi=SIi;function SIi(){return null!==wIi&&wIi.apply(this,arguments)||this}n3(IIi,AIi=txi),IIi.prototype.getClassName=function(){return"UmlClassifierShape"},qo([e("UmlClassifier")],IIi.prototype,"type",void 0),qo([t({},cIi)],IIi.prototype,"classShape",void 0),qo([t({},mIi)],IIi.prototype,"interfaceShape",void 0),qo([t({},CIi)],IIi.prototype,"enumerationShape",void 0),qo([e("Class")],IIi.prototype,"classifier",void 0);var AIi,xIi=IIi;function IIi(){return null!==AIi&&AIi.apply(this,arguments)||this}n3(EIi,TIi=n),EIi.prototype.getClassName=function(){return"DiagramShape"},qo([e("Basic")],EIi.prototype,"type",void 0),qo([e("Rectangle")],EIi.prototype,"basicShape",void 0),qo([e("Terminator")],EIi.prototype,"flowShape",void 0),qo([e("Event")],EIi.prototype,"bpmnShape",void 0),qo([e("Action")],EIi.prototype,"umlActivityShape",void 0),qo([e("")],EIi.prototype,"data",void 0),qo([e("")],EIi.prototype,"content",void 0),qo([e("")],EIi.prototype,"textContent",void 0),qo([e("Stretch")],EIi.prototype,"scale",void 0),qo([e("")],EIi.prototype,"source",void 0),qo([e("None")],EIi.prototype,"align",void 0),qo([t({},ZOt)],EIi.prototype,"margin",void 0),qo([e(0)],EIi.prototype,"cornerRadius",void 0),qo([kt([],Hmi)],EIi.prototype,"points",void 0),qo([t({},Dxi)],EIi.prototype,"dataObject",void 0),qo([t({},Fxi)],EIi.prototype,"event",void 0),qo([t({},Ixi)],EIi.prototype,"gateway",void 0),qo([kt([],qxi)],EIi.prototype,"annotations",void 0),qo([t({},Wxi)],EIi.prototype,"activity",void 0),qo([t({},qxi)],EIi.prototype,"annotation",void 0),qo([t({},CIi)],EIi.prototype,"enumerationShape",void 0),qo([e("Class")],EIi.prototype,"classifier",void 0),qo([t({},cIi)],EIi.prototype,"classShape",void 0),qo([t({},mIi)],EIi.prototype,"interfaceShape",void 0);var TIi,s6=EIi;function EIi(){return null!==TIi&&TIi.apply(this,arguments)||this}n3(kIi,DIi=mP),Object.defineProperty(kIi.prototype,"actualSize",{get:function(){return null!==this.wrapper?this.wrapper.actualSize:new Omi(this.width||0,this.height||0)},enumerable:!0,configurable:!0}),kIi.prototype.init=function(e){t=new("SwimLane"!==this.shape.type?vyi:ubi);switch(this.shape.changedProperties={},this.shape.oldProperties={},this.shape.type){case"Path":var t=N||"Freehand"!==this.type?((i=new kyi).data=this.shape.data,i):((l=new kyi).data=qmi(this.shape.points),l);break;case"Image":var i=new Lyi;i.source=this.shape.source,i.imageAlign=this.shape.align,i.imageScale=this.shape.scale,t=i;break;case"Text":var i=new Tyi;i.content=this.shape.content,n=this.style,(t=i).style=n;break;case"Basic":N||"Rectangle"!==this.shape.shape?t=N||"Polygon"!==this.shape.shape?(h=new kyi,i=Hyi(this.shape.shape),h.data=i,h):((l=new kyi).data=Umi(this.shape.points),l):(t=h=new vyi).cornerRadius=this.shape.cornerRadius;break;case"Flow":var n=new kyi,i=k0i(this.shape.shape);n.data=i,t=n;break;case"UmlActivity":t=ZAi(new kyi,t,this);break;case"Bpmn":if(e.bpmnModule){t=e.bpmnModule.initBPMNContent(t,this,e),this.wrapper.elementActions=this.wrapper.elementActions|Jfi.ElementIsGroup;var o=this.shape.activity.subProcess;if(o.processes&&o.processes.length)for(var r=0,s=this.shape.activity.subProcess.processes;r<s.length;r++){var a=s[r];!e.nameTable[""+a]||e.nameTable[""+a].processId&&e.nameTable[""+a].processId!==this.id||(e.nameTable[""+a].processId=this.id,o.collapsed&&e.updateElementVisibility(e.nameTable[""+a].wrapper,e.nameTable[""+a],!o.collapsed),t.children.push(e.nameTable[""+a].wrapper))}}else console.warn('[WARNING] :: Module "BpmnDiagrams" is not available in Diagram component! You either misspelled the module name or forgot to load it.');break;case"Native":var l=new Qyi(this.id,e.element.id);l.content=this.shape.content,l.scale=this.shape.scale,t=l;break;case"HTML":var h=new Tvi(this.id,e.element.id,void 0,e.nodeTemplate);!this.shape.content||"string"!=typeof this.shape.content&&e.isReact?e.nodeTemplate&&(h.isTemplate=!0,h.template=h.content=yTi(h,!0,this)):h.content=this.shape.content,this.shape.content&&"function"==typeof this.shape.content&&e.isReact&&(h.isTemplate=!0,h.templateFn=oo(this.shape.content),h.template=h.content=yTi(h,!0,this)),t=h;break;case"UmlClassifier":t=U1i(t,this,e);break;case"SwimLane":this.annotations=[],this.ports=[],t.cellStyle.fill="none",t.cellStyle.strokeColor="none",this.container={type:"Grid",orientation:this.shape.orientation},t.id=this.id,this.container.orientation=this.shape.orientation,this.constraints|=Kfi.HideThumbs,xbi(t,e,this)}return t.id=this.id+"_content",t.relativeMode="Object","Basic"===this.shape.type&&"Rectangle"===this.shape.shape?t.shapeType="Rectangle":t.shapeType="Others",void 0!==this.width&&(t.width=this.width),t.horizontalAlignment="Stretch",void 0!==this.height&&(t.height=this.height),void 0!==this.minHeight&&(t.minHeight=this.minHeight),void 0!==this.maxHeight&&(t.maxHeight=this.maxHeight),void 0!==this.minWidth&&(t.minWidth=this.minWidth),void 0!==this.maxWidth&&(t.maxWidth=this.maxWidth),N||"Rectangle"!==this.shape.shape||this.shape.cornerRadius||(t.isRectElement=!0),t.verticalAlignment="Stretch",this.shape instanceof fxi&&(t.margin=this.shape.margin),!Qvi(this)||"Freehand"===this.type||"Bpmn"===this.shape.type&&"TextAnnotation"!==this.shape.shape||0!=(this.constraints&Kfi.Shadow)&&this.visible&&(t.shadow=this.shadow),"Bpmn"===this.shape.type&&(N||"Message"!==this.shape.shape)&&(N||"DataSource"!==this.shape.shape)||"UmlActivity"===this.shape.type&&(N||"FinalNode"===this.shape.shape)||"Text"!==this.shape.type&&(t.style=this.style,this.oldGradientValue=this.style.gradient?DTi(this.style.gradient):null),(this.wrapper.elementActions&Jfi.ElementIsGroup||this.flip!==jfi.Horizontal)&&this.flip!==jfi.Vertical||(t.flip=this.flip,t.flipMode=this.flipMode),t},kIi.prototype.initContainer=function(){var e;if(this.id||(this.id=xTi()),!this.container||this.shape instanceof zIi)e=new(this.children?Syi:Vyi);else switch(this.container.type){case"Canvas":e=new Vyi;break;case"Stack":e=new W1i;break;case"Grid":(e=new ubi).setDefinitions(this.rows,this.columns)}return e.id=this.id,e.offsetX=this.offsetX,e.offsetY=this.offsetY,e.visible=this.visible,e.horizontalAlignment=this.horizontalAlignment,e.verticalAlignment=this.verticalAlignment,this.container&&"SwimLane"!==this.shape.type&&(e.width=this.width,e.height=this.height,"Stack"===this.container.type)&&(e.orientation=this.container.orientation),e.style.fill=this.backgroundColor,e.style.strokeColor=this.borderColor,e.style.strokeWidth=this.borderWidth,e.rotateAngle=this.rotateAngle,e.minHeight=this.minHeight,e.minWidth=this.minWidth,e.maxHeight=this.maxHeight,e.maxWidth=this.maxWidth,e.pivot=this.pivot,e.margin=this.margin,e.flip=this.flip,e.flipMode=this.flipMode,this.wrapper=e},kIi.prototype.initPorts=function(e,t){for(var i=0;this.ports,i<this.ports.length;i++)this.initPort(e,t,this.ports[parseInt(i.toString(),10)])},kIi.prototype.initPort=function(e,t,i){var n,o=this.wrapper,i=this.initPortWrapper(i,this),e=jTi(e);e&&(n=e(i,this)),i.description=n||i.id,i.inversedAlignment=o.inversedAlignment,i.elementActions=i.elementActions|Jfi.ElementIsPort,t.children.push(i)},kIi.prototype.getIconOffet=function(e,t){var i,e="BottomToTop"===e.orientation?(i=t.offset.x,1-t.offset.y):"LeftToRight"===e.orientation?(i=t.offset.y,t.offset.x):"RightToLeft"===e.orientation?(i=1-t.offset.y,t.offset.x):(i=t.offset.x,t.offset.y);return{x:i,y:e}},kIi.prototype.initIcons=function(e,t,i,n){var o,r=this.wrapper,s=this.isExpanded?this.expandIcon:this.collapseIcon;"None"!==s.shape&&((o=new Vyi).float=!0,o.id=this.id+"_icon_content",o.children=[],o.height=s.height,o.width=s.width,o.style.strokeColor="transparent",o.margin=s.margin,o.horizontalAlignment="Center",o.verticalAlignment="Center",o.visible=this.visible,o.cornerRadius=s.cornerRadius,t=this.getIconOffet(t,s),o.setOffsetWithRespectToBounds(t.x,t.y,"Fraction"),o.relativeMode="Point",t=void this.initIconSymbol(s,o,e,n),(n=jTi(e))&&(t=n(s,this)),o.description=t||o.id,o.inversedAlignment=r.inversedAlignment,i.children.push(o))},kIi.prototype.initFixedUserHandles=function(e,t,i){""===e.pathData&&t?((n=new Tvi(this.id,i,void 0,t)).isTemplate=!0,n.template=yTi(n,!0,e),e.id=e.id||xTi(),n.id=this.id+"_"+e.id):(i=this.wrapper,(n=new Vyi).children=[],e.id=e.id||xTi(),n.id=this.id+"_"+e.id,t=DAi(e,n),n.children.push(t),n.inversedAlignment=i.inversedAlignment),n.float=!0,n.height=e.height,n.width=e.width,n.style.strokeColor=e.handleStrokeColor,n.style.fill=e.fill,n.style.strokeWidth=e.handleStrokeWidth,n.margin=e.margin,n.visible=e.visibility,n.cornerRadius=e.cornerRadius,n.horizontalAlignment="Center",n.verticalAlignment="Center";var n,t=this.getfixedUserHandleOffet(e);return n.setOffsetWithRespectToBounds(t.x,t.y,"Fraction"),n.relativeMode="Point",n.description=n.id,n},kIi.prototype.getfixedUserHandleOffet=function(e){return{x:e.offset.x,y:e.offset.y}},kIi.prototype.initAnnotations=function(e,t,i,n,o){for(var r=0;this.annotations,r<this.annotations.length;r++){var s=this.initAnnotationWrapper(this.annotations[parseInt(r.toString(),10)],i,n,r,o),a=void 0,l=jTi(e);l&&(a=l(s,this)),s.description=a||s.id,s.inversedAlignment=t.inversedAlignment,t.children.push(s)}},kIi.prototype.initPortWrapper=function(e,t){e.id=e.id||xTi();var i=new kyi,n=(i.height=e.height,i.width=e.width,i.connectionDirection=e.connectionDirection,e.shape=e.shape||"Square","Custom"===e.shape?e.pathData:C0i(e.shape)),n=(i.id=this.id+"_"+e.id,i.margin=e.margin,i.data=n,t&&"Bpmn"===t.shape.type&&(i.flip=this.flip),e.style);return i.style={fill:n.fill,strokeColor:n.strokeColor,gradient:null,opacity:n.opacity,strokeDashArray:n.strokeDashArray,strokeWidth:n.strokeWidth},i.horizontalAlignment=e.horizontalAlignment,i.verticalAlignment=e.verticalAlignment,i="None"!==this.flipMode&&"Label"!==this.flipMode&&"LabelText"!==this.flipMode&&"LabelAndLabelText"!==this.flipMode?x1i(i,this.flip,e):x1i(i,jfi.None,e),void 0===this.width&&void 0===this.height||(i.float=!0),i.relativeMode="Point",i.visible=!(!s1i(e,Wfi.Visible)||s1i(e,Wfi.Hover)||s1i(e,Wfi.Connect)),i.elementActions=i.elementActions|Jfi.ElementIsPort,i},kIi.prototype.initAnnotationWrapper=function(e,t,i,n,o){e.content=e.content||"",e.id=e.id||n+"annotation"||xTi();var r,n=e;return t&&(e.template||"Template"===e.annotationType||o&&""===e.content)?(r=new Tvi(this.id,t,e.id,o),t=document.getElementById(t).ej2_instances[0],e.template&&"function"==typeof e.template&&t.isReact&&(r.templateFn=oo(e.template),r.isTemplate=!0),r=ATi(r,e,o,t)):((r=new Tyi).canMeasure=!i,o=e.style,t=e.hyperlink.link?e.hyperlink:void 0,r.style={fill:o.fill,strokeColor:o.strokeColor,strokeWidth:o.strokeWidth,bold:o.bold,textWrapping:o.textWrapping,color:t?t.color||r.hyperlink.color:o.color,whiteSpace:o.whiteSpace,fontFamily:o.fontFamily,fontSize:o.fontSize,italic:o.italic,gradient:null,opacity:o.opacity,strokeDashArray:o.strokeDashArray,textAlign:o.textAlign,textOverflow:e.style.textOverflow,textDecoration:t?t.textDecoration||r.hyperlink.textDecoration:o.textDecoration},r.hyperlink.link=e.hyperlink.link||void 0,r.hyperlink.hyperlinkOpenState=e.hyperlink.hyperlinkOpenState||void 0,r.hyperlink.content=e.hyperlink.content||void 0,r.hyperlink.textDecoration=e.hyperlink.textDecoration||void 0,r.content=t?t.content||r.hyperlink.link:e.content),r.constraints=e.constraints,r.height=e.height,r.width=e.width,r.visible=e.visibility,r.annotationVisibility=r.visible?"Visible":"Collapsed",r.rotateAngle=e.rotateAngle,r.rotationReference=e.rotationReference,r.id=this.id+"_"+e.id,void 0===this.width||e.template||void 0!==e.width||"Wrap"!==e.style.textWrapping&&"WrapWithOverflow"!==e.style.textWrapping||(r.width=this.width),r.margin=e.margin,r.horizontalAlignment=e.horizontalAlignment,r.verticalAlignment=e.verticalAlignment,r.setOffsetWithRespectToBounds(n.offset.x,n.offset.y,"Fraction"),void 0===this.width&&void 0===this.height||(r.float=!0),r.relativeMode="Point",r},kIi.prototype.initIconContainer=function(e,t){var i=new vyi;return i.id=t.id+"_rect",i.height=e.height,i.width=e.width,i.visible=t.visible,i.margin=e.margin,i.cornerRadius=e.cornerRadius,i.style={fill:e.fill,strokeColor:e.borderColor,strokeWidth:e.borderWidth},i.setOffsetWithRespectToBounds(.5,.5,"Fraction"),i.horizontalAlignment="Center",i.verticalAlignment="Center",i.relativeMode="Object",i.description=i.description||"Click here to expand or collapse",i},kIi.prototype.initIconSymbol=function(e,t,i,n){var o;t.children.push(this.initIconContainer(e,t)),"Template"===e.shape?((o=new Qyi(this.id,n)).content=e.content,o.height=10,o.width=10):((o=new kyi).data=I0i(e),n=XIi(o.data),o.height=n.height<10?n.height:10-(e.padding.bottom+e.padding.top),o.width=n.width<10?n.width:10-(e.padding.left+e.padding.right)),o.id=t.id+"_shape",o.horizontalAlignment="Center",o.verticalAlignment="Center",o.visible=t.visible,o.visible=t.visible,o.style={fill:"black",strokeColor:e.iconColor,strokeWidth:e.borderWidth},o.setOffsetWithRespectToBounds(.5,.5,"Fraction"),o.relativeMode="Object",o.description=t.description||"Click here to expand or collapse",t.children.push(o)},kIi.prototype.getClassName=function(){return"Node"},qo([kt([],f0i)],kIi.prototype,"annotations",void 0),qo([e(0)],kIi.prototype,"offsetX",void 0),qo([t({},rz)],kIi.prototype,"layoutInfo",void 0),qo([e(0)],kIi.prototype,"offsetY",void 0),qo([kt([],r0i)],kIi.prototype,"ports",void 0),qo([e(!0)],kIi.prototype,"isExpanded",void 0),qo([kt([],Bvi)],kIi.prototype,"fixedUserHandles",void 0),qo([t({},ey)],kIi.prototype,"expandIcon",void 0),qo([t({},ey)],kIi.prototype,"collapseIcon",void 0),qo([t({x:.5,y:.5},Hmi)],kIi.prototype,"pivot",void 0),qo([e()],kIi.prototype,"width",void 0),qo([e()],kIi.prototype,"height",void 0),qo([e()],kIi.prototype,"minWidth",void 0),qo([e()],kIi.prototype,"minHeight",void 0),qo([e()],kIi.prototype,"maxWidth",void 0),qo([e()],kIi.prototype,"maxHeight",void 0),qo([e(0)],kIi.prototype,"rotateAngle",void 0),qo([t({fill:"white"},ZNt)],kIi.prototype,"style",void 0),qo([e("transparent")],kIi.prototype,"backgroundColor",void 0),qo([e("none")],kIi.prototype,"borderColor",void 0),qo([e(0)],kIi.prototype,"borderWidth",void 0),qo([e()],kIi.prototype,"data",void 0),qo([Mt(Z1i)],kIi.prototype,"shape",void 0),qo([t({},sP)],kIi.prototype,"previewSize",void 0),qo([t({},sP)],kIi.prototype,"dragSize",void 0),qo([e(null)],kIi.prototype,"wrapper",void 0),qo([e(Kfi.Default)],kIi.prototype,"constraints",void 0),qo([t({},tNt)],kIi.prototype,"shadow",void 0),qo([e()],kIi.prototype,"children",void 0),qo([t({left:0,right:0,top:0,bottom:0},ZOt)],kIi.prototype,"padding",void 0),qo([e(null)],kIi.prototype,"container",void 0),qo([e("Left")],kIi.prototype,"horizontalAlignment",void 0),qo([e("Top")],kIi.prototype,"verticalAlignment",void 0),qo([e()],kIi.prototype,"rows",void 0),qo([e()],kIi.prototype,"columns",void 0),qo([e()],kIi.prototype,"rowIndex",void 0),qo([e()],kIi.prototype,"columnIndex",void 0),qo([e()],kIi.prototype,"rowSpan",void 0),qo([e()],kIi.prototype,"columnSpan",void 0),qo([e("")],kIi.prototype,"branch",void 0);var DIi,MIi=kIi;function kIi(e,t,i,n){e=DIi.call(this,e,t,i,n)||this;return e.isCanvasUpdate=!1,e.status="None",e.parentId="",e.processId="",e.umlIndex=-1,e.outEdges=[],e.inEdges=[],e.isHeader=!1,e.isLane=!1,e.isPhase=!1,e.laneGrids=[],e.children&&0<e.children.length&&((t=i).style&&t.style.fill||(e.style.fill="transparent"),t.style&&t.style.strokeColor||(e.style.strokeColor="transparent")),e.shape&&"UmlActivity"===e.shape.type&&gAi(i,e),e.shape&&"SwimLane"===e.shape.type&&dAi(i,e),e.ports&&e.ports.length&&uAi(e),e}n3(FIi,PIi=n),qo([e("")],FIi.prototype,"id",void 0),qo([t({},f0i)],FIi.prototype,"annotation",void 0),qo([t({fill:"#FFFFFF",strokeColor:"#CCCCCC"},XNt)],FIi.prototype,"style",void 0),qo([e(50)],FIi.prototype,"height",void 0),qo([e(50)],FIi.prototype,"width",void 0);var PIi,BIi=FIi;function FIi(){return null!==PIi&&PIi.apply(this,arguments)||this}n3(OIi,LIi=n),OIi.prototype.getClassName=function(){return"Lane"},qo([e("")],OIi.prototype,"id",void 0),qo([t({fill:"#F9F9F9",strokeColor:"#CCCCCC"},XNt)],OIi.prototype,"style",void 0),qo([kt([],MIi)],OIi.prototype,"children",void 0),qo([e(100)],OIi.prototype,"height",void 0),qo([e(100)],OIi.prototype,"width",void 0),qo([t({style:{fill:"#E7F4FF",strokeColor:"#CCCCCC"},annotation:{content:"Function"}},BIi)],OIi.prototype,"header",void 0),qo([e(!0)],OIi.prototype,"canMove",void 0),qo([e()],OIi.prototype,"addInfo",void 0);var LIi,RIi=OIi;function OIi(){return null!==LIi&&LIi.apply(this,arguments)||this}n3(_Ii,NIi=n),_Ii.prototype.getClassName=function(){return"Phase"},qo([e("")],_Ii.prototype,"id",void 0),qo([t({fill:"#FFFFFF",strokeColor:"#CCCCCC"},XNt)],_Ii.prototype,"style",void 0),qo([t({annotation:{content:"Phase"}},BIi)],_Ii.prototype,"header",void 0),qo([e(100)],_Ii.prototype,"offset",void 0),qo([e()],_Ii.prototype,"addInfo",void 0);var NIi,VIi=_Ii;function _Ii(){return null!==NIi&&NIi.apply(this,arguments)||this}n3(jIi,HIi=txi),jIi.prototype.getClassName=function(){return"SwimLane"},qo([e("SwimLane")],jIi.prototype,"type",void 0),qo([e(20)],jIi.prototype,"phaseSize",void 0),qo([kt([],VIi)],jIi.prototype,"phases",void 0),qo([e("Horizontal")],jIi.prototype,"orientation",void 0),qo([kt([],RIi)],jIi.prototype,"lanes",void 0),qo([t({style:{fill:"#E7F4FF",strokeColor:"#CCCCCC"},annotation:{content:"Function"}},BIi)],jIi.prototype,"header",void 0),qo([e(!1)],jIi.prototype,"isLane",void 0),qo([e(!1)],jIi.prototype,"isPhase",void 0);var HIi,zIi=jIi;function jIi(){var e=null!==HIi&&HIi.apply(this,arguments)||this;return e.padding=20,e.hasHeader=!0,e}QIi.prototype.getClassName=function(){return"ChildContainer"},qo([e("Canvas")],QIi.prototype,"type",void 0),qo([e("Vertical")],QIi.prototype,"orientation",void 0);var WIi=QIi;function QIi(){}n3(GIi,UIi=n),GIi.prototype.init=function(e){var t=new Syi;if(t.measureChildren=!1,t.children=[],this.annotation){var i=(0<this.nodes.length?e.nameTable[this.nodes[0].id]:e.nameTable[this.connectors[0].id]).wrapper,n=e.getWrapper(i,this.annotation.id);t.children.push(n)}else if(this.nodes||this.connectors){for(var o=0;o<this.nodes.length;o++){n=e.nameTable[this.nodes[parseInt(o.toString(),10)].id].wrapper;t.children.push(n)}for(var r=0;r<this.connectors.length;r++){n=e.nameTable[this.connectors[parseInt(r.toString(),10)].id].wrapper;t.children.push(n)}}i=e.isProtectedOnChange;return e.protectPropertyChange(!1),this.wrapper=t,e.protectPropertyChange(i),t},qo([e(null)],GIi.prototype,"wrapper",void 0),qo([e(14)],GIi.prototype,"handleSize",void 0),qo([kt([],MIi)],GIi.prototype,"nodes",void 0),qo([kt([],ISi)],GIi.prototype,"connectors",void 0),qo([e()],GIi.prototype,"width",void 0),qo([e()],GIi.prototype,"height",void 0),qo([e(0)],GIi.prototype,"rotateAngle",void 0),qo([e(0)],GIi.prototype,"offsetX",void 0),qo([e(0)],GIi.prototype,"offsetY",void 0),qo([t({x:.5,y:.5},Hmi)],GIi.prototype,"pivot",void 0),qo([e("CompleteIntersect")],GIi.prototype,"rubberBandSelectionMode",void 0),qo([kt([],_Si)],GIi.prototype,"userHandles",void 0),qo([e(Ufi.All)],GIi.prototype,"constraints",void 0),qo([e()],GIi.prototype,"setTooltipTemplate",void 0),qo([kt([],MIi)],GIi.prototype,"selectedObjects",void 0),qo([e(!1)],GIi.prototype,"canToggleSelection",void 0);var UIi,qIi=GIi;function GIi(){return null!==UIi&&UIi.apply(this,arguments)||this}function YIi(e){var t,i=[];if("msie"===F.info.name||"edge"===F.info.name)for(var n=0;n<e.childNodes.length;n++)1===(t=e.childNodes[parseInt(n.toString(),10)]).nodeType&&i.push(t);else i=e.children;return i}function XIi(e){var t,i;return e?(t="measureElement",window[t].style.visibility="visible",(i=YIi(window[t].children[2])[0]).setAttribute("d",e),e=i.getBBox(),i=new tfi(e.x,e.y,e.width,e.height),window[t].style.visibility="hidden",i):new tfi(0,0,0,0)}function KIi(e,t,i,n,o){var r=new Omi,s=pTi("span",{style:"display:inline-block; line-height: normal"});return e.bold&&(s.style.fontWeight="bold"),e.italic&&(s.style.fontStyle="italic"),void 0!==i&&(s.style.width=i.toString()+"px"),void 0!==n&&(s.style.height=n.toString()+"px"),void 0!==o&&(s.style.maxWidth=o.toString()+"px"),s.style.fontFamily=e.fontFamily,s.style.fontSize=e.fontSize+"px",s.style.color=e.color,s.textContent=t,s.style.whiteSpace=VTi(e.whiteSpace,e.textWrapping),s.style.wordBreak=void 0!==o?"break-word":LTi(e.textWrapping),document.body.appendChild(s),r.width=s.offsetWidth,r.height=s.offsetHeight,document.body.removeChild(s),r}function JIi(e,t,i,n){var o=0,r=0,s=!1;return 0===t.x&&0===t.y||(o=0-Number(t.x),r=0-Number(t.y)),e.actualSize.width===t.width&&e.actualSize.height===t.height&&!n||(o=(n&&n.width||e.actualSize.width)/Number(t.width||1),r=(n&&n.height||e.actualSize.height)/Number(t.height||1),s=!0),n=Ymi(Jmi(jmi(e.data)),o,r,s,t.x,t.y,0,0),s=!1,n}function ZIi(e){return $Ii(e).getElementsByClassName("e-diagram-layer")[0]}function $Ii(e,t){var i;return t&&(i=document.getElementById(t)),"msie"===F.info.name||"edge"===F.info.name?i?i.querySelector("#"+e):document.getElementById(e):i?i.querySelector("#"+CSS.escape(e)):document.getElementById(e)}function eTi(e,t,i){for(var n,o,r=void 0,s="",s="native"===i?(n=hTi(e),"_content_groupElement"):"html"===i?(n=dTi(e).childNodes[0],"_html_element"):(n=ZIi(i=e).getElementById(i+"_diagramLayer"),"_groupElement"),a=0;n.childNodes&&a<n.childNodes.length;a++)if((o=n.childNodes[a])&&o.id===t+s){r=a;break}return r}function tTi(e){return $Ii(e).getElementsByClassName("e-adorner-layer")[0]}function iTi(e){return tTi(e).getElementById(e+"_SelectorElement")}function nTi(e){return tTi(e).getElementById(e+"_diagramAdorner")}function oTi(e){return $Ii(e).getElementsByClassName("e-userHandle-layer")[0]}function rTi(e){return $Ii(e).getElementsByClassName("e-native-layer")[0]}function sTi(e){return $Ii(e).getElementsByClassName("e-grid-layer")[0]}function aTi(e){return $Ii(e).getElementsByClassName("e-background-layer")[0].parentNode}function lTi(e){return $Ii(e).getElementsByClassName("e-background-layer")[0]}function hTi(e){return rTi(e).getElementById(e+"_nativeLayer")}function dTi(e){var t=null,i="domTable";return window[i][e+"html_layer"]?t=window[i][e+"html_layer"]:(t=$Ii(e).getElementsByClassName("e-html-layer")[0],window[i][e+"html_layer"]=t),t}function pTi(e,t){e=Q(e);return wTi(e,t),e}function cTi(e,t){e=document.createElementNS("http://www.w3.org/2000/svg",e);return vTi(e,t),e}function uTi(e,t,i){for(var n=e;n&&(i?n.id!==t:!gTi(n,t));)n=n.parentNode;return n}function gTi(e,t){return-1<(" "+("object"==typeof e.className?e.className.animVal:e.className)+" ").indexOf(" "+t+" ")}function mTi(e,t,i){e=[];for(var n=0,o=i.length;n<o;n++)e.push({pageX:i[parseInt(n.toString(),10)].clientX,pageY:i[parseInt(n.toString(),10)].clientY,pointerId:null});return e}function fTi(e,t){e=$Ii(e,t);e&&e.parentNode.removeChild(e)}function yTi(e,t,i){n=t?pTi("div",{style:"height: 100%; width: 100%"}):document.createElementNS("http://www.w3.org/2000/svg","g");var n,o,t=f1i(e),r={},s=t instanceof MIi?("Native"===(r=t).shape.type&&(s=void 0,a=document.createElementNS("http://www.w3.org/2000/svg","svg"),document.body.appendChild(a),a.innerHTML=t.shape.content,s=0<a.getElementsByTagName("svg").length?a.getElementsByTagName("svg")[0].outerHTML:0<a.getElementsByTagName("g").length?a.getElementsByTagName("g")[0].outerHTML:"",t.shape.content=s,e.content=s,a.parentElement.removeChild(a)),"nodeTemplate"):(r=t,"annotationTemplate"),a=document.getElementById(e.diagramId).ej2_instances[0];if("string"!=typeof e.content&&"function"!=typeof e.content||e.isTemplate)if(e.isTemplate){h=void 0;if(h=a.isReact?e.getNodeTemplate()(DTi(i),a,s+"_"+("nodeTemplate"===s?i.id:e.nodeId+i.id),void 0,void 0,!1,n):a.isVue||a.isVue3?(e.getNodeTemplate()?e.getNodeTemplate():h=oo("nodeTemplate"===s?a.nodeTemplate:a.annotationTemplate))(DTi(i),a,s+"_"+("nodeTemplate"===s?i.id:e.nodeId+i.id),void 0,void 0,!1,n):e.getNodeTemplate()(DTi(i),a,s+"_"+("nodeTemplate"===s?i.id:e.nodeId+i.id),void 0,void 0,!1))for(var l=0;l<h.length;l++)n.appendChild(h[parseInt(l.toString(),10)])}else e.content&&e.content.outerHTML&&n.appendChild(e.content);else{t=document.getElementById(e.content);if(t)n.appendChild(t);else for(var h=void 0,d=0,p=(h=oo(e.content))(r,a,s,"");d<p.length;d++)o=p[d],n.appendChild(o)}return e.isTemplate?n:n.cloneNode(!0)}function vTi(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++)e&&"style"!==i[parseInt(n.toString(),10)]?e.setAttribute(i[parseInt(n.toString(),10)],t[i[parseInt(n.toString(),10)]]):bTi(e,t[i[parseInt(n.toString(),10)]])}function bTi(e,t){for(var i=t.split(";"),n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)].split(":");2===o.length&&(e.style[o[0].trim()]=o[1].trim())}}function wTi(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++)"style"!==i[parseInt(n.toString(),10)]?e.setAttribute(i[parseInt(n.toString(),10)],t[i[parseInt(n.toString(),10)]]):bTi(e,t[i[parseInt(n.toString(),10)]])}function CTi(){var e,t,i,n="measureElement";window[n]?window[n].usageCount+=1:(e=pTi("div",{id:"measureElement",style:"visibility:hidden ; height: 0px ; width: 0px; overflow: hidden;"}),i=pTi("span",{style:"display:inline-block ; line-height: normal"}),e.appendChild(i),i=pTi("img",{alt:"measureElementImage",src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"}),e.appendChild(i),(i=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),e.appendChild(i),(t=document.createElementNS("http://www.w3.org/2000/svg","path")).setAttribute("d",""),i.appendChild(t),document.createTextNode(""),(t=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.appendChild(t),window[n]=e,window[n].usageCount=1,document.body.appendChild(e),i="measureElementCount",window[i]?window[i]++:window[i]=1)}function STi(e,t,i,n){return!(1<=t.length&&0===e.x)||"Clip"!==n.textOverflow&&"Ellipsis"!==n.textOverflow||"Wrap"!==n.textWrapping&&"WrapWithOverflow"!==n.textWrapping||(e.x=t[i-1]?t[i-1].x:-e.width/2),e.x}function ATi(e,t,i,n){return i&&!t.template||t.template&&"function"==typeof t.template&&n.isReact?(e.isTemplate=!0,e.template=e.content=yTi(e,!0,t)):e.content=t.template,e}function xTi(){for(var e,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",i="",n=0;n<5;n++)e="undefined"!=typeof window&&"crypto"in window&&"getRandomValues"in crypto?(e=new Uint16Array(1),(window.msCrypto||window.crypto).getRandomValues(e)[0]%(t.length-1)):Math.floor(Math.random()*t.length),0===n&&e<10?n--:i+=t.substring(e,e+1);return i}function ITi(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?oo(document.querySelector(t).innerHTML.trim()):oo(t)}catch(e){return oo(t)}}function TTi(e){new tfi;var t=e.offsetY-e.actualSize.height*e.pivot.y,i=e.offsetY+e.actualSize.height*(1-e.pivot.y),n=e.offsetX-e.actualSize.width*e.pivot.x,e=e.offsetX+e.actualSize.width*(1-e.pivot.x);return tfi.toBounds([{x:n,y:t},{x:e,y:t},{x:n,y:i},{x:e,y:i}])}function ETi(e){new tfi;var t,i=TTi(e),n=i.middleLeft,o=i.topCenter,r=i.bottomCenter,s=i.middleRight,a=i.topLeft,l=i.topRight,h=i.bottomLeft,i=i.bottomRight;return e.corners={topLeft:a,topCenter:o,topRight:l,middleLeft:n,middleRight:s,bottomLeft:h,bottomCenter:r,bottomRight:i},0===e.rotateAngle&&0===e.parentTransform||(afi(t=ofi(),e.rotateAngle+e.parentTransform,e.offsetX,e.offsetY),e.corners.topLeft=a=rfi(t,a),e.corners.topCenter=rfi(t,o),e.corners.topRight=l=rfi(t,l),e.corners.middleLeft=rfi(t,n),e.corners.middleRight=rfi(t,s),e.corners.bottomLeft=h=rfi(t,h),e.corners.bottomCenter=rfi(t,r),e.corners.bottomRight=i=rfi(t,i)),o=tfi.toBounds([a,l,h,i]),e.corners.left=o.left,e.corners.right=o.right,e.corners.top=o.top,e.corners.bottom=o.bottom,e.corners.center=o.center,e.corners.width=o.width,e.corners.height=o.height,o}function DTi(e,t,i,n){var o={},r="properties";if(e){i=e.propName;for(var s=e[r]||e,a=[],l=[],h=((a=a.concat(Object.keys(s))).push("version"),i&&(l=(s=jTi(t))?s(i):[],a=a.concat(l)),MTi(i)),d=0,p=a=a.concat(h);d<p.length;d++){var c=p[d];"historyManager"!==c&&("wrapper"!==c?e[""+c]&&e.hasOwnProperty("observers")||(e[""+c]instanceof Array?o[""+c]=kTi((-1===h.indexOf(c)&&e[r]?e[r]:e)[""+c],t):e[""+c]instanceof Array==!1&&e[""+c]instanceof HTMLElement?o[""+c]=e[""+c].cloneNode(!0).innerHTML:e[""+c]instanceof Array==!1&&e[""+c]instanceof Object?o[""+c]=DTi((-1===h.indexOf(c)&&e[r]?e[r]:e)[""+c],void 0):o[""+c]=e[""+c]):e[""+c]&&(o[""+c]={actualSize:{width:e[""+c].actualSize.width,height:e[""+c].actualSize.height},offsetX:e[""+c].offsetX,offsetY:e[""+c].offsetY}))}}return o}function MTi(e){switch(e){case"nodes":case"children":return["inEdges","outEdges","parentId","processId","nodeId","umlIndex","isPhase","isLane"];case"connectors":return["parentId"];case"annotation":case"annotations":return["nodeId"];case"shape":return["hasHeader"];case"layers":return["objectZIndex"]}return[]}function kTi(e,t,i,n){if(e)for(var o=[],r=0;r<e.length;r++)!(e[parseInt(r.toString(),10)]instanceof Array)&&e[parseInt(r.toString(),10)]instanceof Object?o.push(DTi(e[parseInt(r.toString(),10)],t)):o.push(e[parseInt(r.toString(),10)]);return o}function PTi(e,t){var i="properties";if(e){t=t||{properties:{}};for(var n=0,o=Object.keys(e);n<o.length;n++){var r,s=o[n];e[""+s]instanceof Array?(r=BTi(e[""+s],t[i][""+s]),t[i][""+s]&&t[i][""+s].length||(t[""+s]=r)):e[""+s]instanceof Array==!1&&e[""+s]instanceof HTMLElement?t[""+s]=e[""+s].cloneNode(!0).innerHtml:e[""+s]instanceof Array==!1&&e[""+s]instanceof Object?((r=PTi(e[""+s],t[i][""+s]))[i]&&!Object.keys(r[i]).length&&delete r[i],t[""+s]=r):t[""+s]=(void 0!==t[i][""+s]?t:e)[""+s]}}return t}function BTi(e,t){var i=[],n=!1;(t=t||[]).length||(n=!0);for(var o,r=0;r<e.length;r++)e[parseInt(r.toString(),10)]instanceof Array?(BTi(e[parseInt(r.toString(),10)],t[parseInt(r.toString(),10)]),n&&i.push(BTi)):e[parseInt(r.toString(),10)]instanceof Object?(o=PTi(e[parseInt(r.toString(),10)],t[parseInt(r.toString(),10)]),n&&i.push(o)):i.push(e[parseInt(r.toString(),10)]);return i}function FTi(e){var t="";switch(e){case"Center":t="center";break;case"Left":t="left";break;case"Right":t="right";break;case"Justify":t="justify"}return t}function LTi(e){var t="";switch(e){case"Wrap":t="breakall";break;case"NoWrap":t="keepall";break;case"WrapWithOverflow":t="normal";break;case"LineThrough":t="line-through"}return t}function RTi(e,t){var i="measureElement";window[i].style.visibility="visible";var n=YIi(window[i].children[2])[1],e=(n.textContent=e,bTi(n,"font-size:"+t.fontSize+"px; font-family:"+t.fontFamily+";font-weight:"+(t.bold?"bold":"normal")),n.getBBox().width);return window[i].style.visibility="hidden",e}function OTi(e,t){return(e+t)/2}function NTi(e,t){for(var i=0,n=0,o=0,r="",s=e.length,a=0;0<o&&(i=n),n=Math.floor(OTi(i,s)),(o=RTi(r+=e.substr(i,n),t))<=t.width;);for(r=r.substr(0,i),a=i;a<s;a++)if((o=RTi(r+=e[parseInt(a.toString(),10)],t))>=t.width){e=e.substr(0,r.length-1);break}return"Ellipsis"===t.textOverflow?(e=e.substr(0,e.length-3),e+="..."):e=e.substr(0,e.length),e}function VTi(e,t){if("NoWrap"===t&&"PreserveAll"===e)return"pre";var i="";switch(e){case"CollapseAll":i="nowrap";break;case"CollapseSpace":i="pre-line";break;case"PreserveAll":i="pre-wrap"}return i}function _Ti(e,t){var i=ofi(),t=(afi(i,t,0,0),rfi(i,{x:0,y:0})),n=rfi(i,{x:e.width,y:0}),o=rfi(i,{x:0,y:e.height}),i=rfi(i,{x:e.width,y:e.height}),e=Math.min(t.x,n.x,o.x,i.x),r=Math.min(t.y,n.y,o.y,i.y),s=Math.max(t.x,n.x,o.x,i.x),t=Math.max(t.y,n.y,o.y,i.y);return new Omi(s-e,t-r)}function HTi(e,t,i,n){var o;return 0!==e?(afi(o=ofi(),e,t,i),rfi(o,n)):n}function zTi(e,t){return{x:e.x+t.desiredSize.width*t.pivot.x,y:e.y+t.desiredSize.height*t.pivot.y}}function jTi(e){return e=void 0!==e&&"string"==typeof e?R(e,window):e}QTi.getContext=function(e){return e.getContext("2d")},QTi.setCanvasSize=function(e,t,i){e&&(e.setAttribute("width",t.toString()),e.setAttribute("height",i.toString()))},QTi.prototype.renderGradient=function(e,t,i,n){var o,r;if("None"!==e.gradient.type){for(var s,a,l=0;l<e.gradient.stops.length;l++)o=void 0!==o?e.gradient.stops[parseInt(l.toString(),10)].offset:Math.max(o,e.gradient.stops[parseInt(l.toString(),10)].offset),r=void 0!==r?e.gradient.stops[parseInt(l.toString(),10)].offset:Math.min(r,e.gradient.stops[parseInt(l.toString(),10)].offset);s="Linear"===e.gradient.type?(a=e.gradient,t.createLinearGradient(i+a.x1,n+a.y1,i+a.x2,n+a.y2)):(a=e.gradient,t.createRadialGradient(i+a.fx,n+a.fy,0,i+a.cx,n+a.cy,a.r));for(l=0;l<e.gradient.stops.length;l++){var h=e.gradient.stops[parseInt(l.toString(),10)],d=r<0?(o+h.offset)/(2*o):h.offset/o;s.addColorStop(d,h.color)}t.fillStyle=s}return t},QTi.prototype.renderShadow=function(e,t,i){void 0===i&&(i=null);var n=QTi.getContext(t),o=(n.save(),n.beginPath(),n.strokeStyle=n.fillStyle=e.shadow.color,n.globalAlpha=e.shadow.opacity,Hmi.transform({x:0,y:0},e.shadow.angle,e.shadow.distance)),r=e.x+o.x,o=e.y+o.y,s=r+e.width*e.pivotX,a=o+e.height*e.pivotY;this.rotateContext(t,e.angle,s,a),i?(n.translate(r,o),this.renderPath(t,e,i),n.translate(-r,-o)):(n.rect(r,o,e.width,e.height),n.fillRect(r,o,e.width,e.height)),n.fill(),n.stroke(),n.closePath(),n.restore()},QTi.createCanvas=function(e,t,i){e=pTi("canvas",{id:e});return this.setCanvasSize(e,t,i),e},QTi.prototype.setStyle=function(e,t){var e=QTi.getContext(e),i=("none"===t.fill&&(t.fill="transparent"),"none"===t.stroke&&(t.stroke="transparent"),e.strokeStyle=t.stroke,e.lineWidth=t.strokeWidth,0===t.strokeWidth&&(e.strokeStyle="transparent"),e.globalAlpha=t.opacity,[]);t.dashArray&&(i=this.parseDashArray(t.dashArray)),e.setLineDash(i),t.gradient&&"None"!==t.gradient.type?"Rectangle"===t.shapeType?this.renderGradient(t,e,t.x,t.y):this.renderGradient(t,e,0,0):e.fillStyle=t.fill},QTi.prototype.rotateContext=function(e,t,i,n){e=QTi.getContext(e);e.translate(i,n),e.rotate(t*Math.PI/180),e.translate(-i,-n)},QTi.prototype.setFontStyle=function(e,t){var e=QTi.getContext(e),i="";t.italic&&(i+="italic "),t.bold&&(i+="bold "),i=(i+=t.fontSize+"px ")+t.fontFamily,e.font=i},QTi.prototype.parseDashArray=function(e){for(var t=[],i=-1!==e.indexOf(" ")?" ":",",n=0,o=e.split(i);n<o.length;n++){var r=o[n];t.push(Number(r))}return t},QTi.prototype.drawRoundedRect=function(e,t){var i=QTi.getContext(e),n=(i.beginPath(),t.x),o=t.y,r=t.width,s=t.height,a=n+r/2,l=o+s/2;i.beginPath(),this.setStyle(e,t),i.moveTo(n,l),i.quadraticCurveTo(n,o,a,o),i.quadraticCurveTo(n+r,o,n+r,l),i.quadraticCurveTo(n+r,o+s,a,o+s),i.quadraticCurveTo(n,o+s,n,l),i.fill(),i.stroke()},QTi.prototype.drawRectangle=function(e,t,i,n,o,r,s,a,l,h,d){!0===t.visible&&(t.cornerRadius?!n&&(t.width<30||t.height<30)?this.drawRoundedRect(e,t):(t.data=Qmi(t.cornerRadius,t.height,t.width),this.drawPath(e,t,i,o,r,s,void 0,h,d)):(n=QTi.getContext(e),t.shadow&&this.renderShadow(t,e),n.save(),n.beginPath(),t.cornerRadius,i=t.x+t.width*t.pivotX,o=t.y+t.height*t.pivotY,r=t.isImage?-t.angle:t.angle,this.rotateContext(e,r,i,o),this.setStyle(e,t),n.rect(t.x,t.y,t.width,t.height),n.fillRect(t.x,t.y,t.width,t.height),n.fill(),n.stroke(),n.closePath(),n.restore()))},QTi.prototype.drawPath=function(e,t,i,n,o,r,s,a,l){h=Gmi(jmi(t.data)),t.shadow&&this.renderShadow(t,e,h);var h,d=QTi.getContext(e),p=(d.save(),d.beginPath(),t.y+t.height*t.pivotY),c=t.x+t.width*t.pivotX;this.applyFlipAndRotate(d,t,e,c,p,a,l),this.setStyle(e,t),d.translate(t.x,t.y),this.renderPath(e,t,h),d.fill(),d.translate(-t.x,-t.y),d.stroke(),d.restore()},QTi.prototype.renderPath=function(e,t,i){if(!0===t.visible)for(var n=0,o=QTi.getContext(e),r=void 0,s=void 0,a=void 0,l=void 0,h=void 0,d=void 0,p=void 0,c=void 0,u=void 0,g=i,p=0,c=0,u=0,m=g.length;u<m;++u){var f=g[parseInt(u.toString(),10)],y=f.command;switch("x1"in f&&(a=f.x1),"x2"in f&&(h=f.x2),"y1"in f&&(l=f.y1),"y2"in f&&(d=f.y2),"x"in f&&(p=f.x),"y"in f&&(c=f.y),y){case"M":o.moveTo(p,c),f.x=p,f.y=c;break;case"L":o.lineTo(p,c),f.x=p,f.y=c;break;case"C":o.bezierCurveTo(a,l,h,d,p,c),f.x=p,f.y=c,f.x1=a,f.y1=l,f.x2=h,f.y2=d;break;case"Q":o.quadraticCurveTo(a,l,p,c),f.x=p,f.y=c,f.x1=a,f.y1=l;break;case"A":var v=r,b=s,w=void 0,C=void 0,S=(t.arc&&0<t.arc.length?(w=(0===f.r1?t.arc[parseInt(n.toString(),10)]:f).r1,C=(0===f.r2?t.arc[parseInt(n.toString(),10)]:f).r2,n++):(w=f.r1,C=f.r2),f.angle*(Math.PI/180)),A=f.largeArc,x=f.sweep,I=p,T=c,E={x:Math.cos(S)*(v-I)/2+Math.sin(S)*(b-T)/2,y:-Math.sin(S)*(v-I)/2+Math.cos(S)*(b-T)/2},D=Math.pow(E.x,2)/Math.pow(w,2)+Math.pow(E.y,2)/Math.pow(C,2),D=(1<D&&(w*=Math.sqrt(D),C*=Math.sqrt(D)),Math.pow(C,2)*Math.pow(E.x,2)),A=(A===x?-1:1)*Math.sqrt((Math.pow(w,2)*Math.pow(C,2)-Math.pow(w,2)*Math.pow(E.y,2)-D)/(Math.pow(w,2)*Math.pow(E.y,2)+Math.pow(C,2)*Math.pow(E.x,2))),D=(A=isNaN(A)?0:A)*w*E.y/C,A=A*-C*E.x/w,v={x:(v+I)/2+Math.cos(S)*D-Math.sin(S)*A,y:(b+T)/2+Math.sin(S)*D+Math.cos(S)*A},I=this.a([1,0],[(E.x-D)/w,(E.y-A)/C]),b=[(E.x-D)/w,(E.y-A)/C],T=[(-E.x-D)/w,(-E.y-A)/C],D=this.a(b,T),E=(this.r(b,T)<=-1&&(D=Math.PI),x?1:-1),A=I+(D=1<=this.r(b,T)?0:D)/2*E;Math.cos(A),Math.sin(A);f.centp=v,f.xAxisRotation=S,f.rx=w,f.ry=C,f.a1=I,f.ad=D,f.sweep=x,null!=o&&(b=C<w?w:C,T=C<w?1:w/C,E=C<w?C/w:1,o.save(),o.translate(v.x,v.y),o.rotate(S),o.scale(T,E),o.arc(0,0,b,I,I+D,!x),o.scale(1/T,1/E),o.rotate(-S),o.translate(-v.x,-v.y),o.restore());break;case"Z":case"z":o.closePath(),p=r,c=s}r=p,s=c}},QTi.prototype.drawText=function(e,t,i,n,o,r,s,a){if(t.content&&!0===t.visible){var l=s.groupElement,h=QTi.getContext(e),d=(h.save(),this.setStyle(e,t),r&&(t.fontSize*=r),t.x+t.width*t.pivotX),p=t.y+t.height*t.pivotY,c=(this.applyFlipAndRotate(h,t,e,d,p,s,a),this.setFontStyle(e,t),0),u=t.childNodes,g=t.wrapBounds;if(h.fillStyle=t.color,g)for(var m=this.labelAlign(t,g,u),c=0;c<u.length;c++){var f=u[parseInt(c.toString(),10)],y=(f.x=STi(f,u,c,t),m.x+(r?f.x*r:f.x)-g.x),v=m.y+(r?f.dy*r:f.dy)*c+.8*t.fontSize;if(g.width>t.width&&"Wrap"!==t.textOverflow&&"NoWrap"===t.textWrapping&&(f.text=NTi(f.text,t)),"Clip"!==t.textOverflow&&"Ellipsis"!==t.textOverflow||"Wrap"!==t.textWrapping?h.fillText(f.text,y,v):v<l.actualSize.height+l.bounds.y&&("Ellipsis"===t.textOverflow&&u[c+1]&&(b=u[c+1],m.y+b.dy*(c+1)+.8*t.fontSize>l.actualSize.height+l.bounds.y)&&(f.text=f.text.slice(0,f.text.length-3),f.text=f.text.concat("...")),h.fillText(f.text,y,v)),"Underline"===t.textDecoration||"Overline"===t.textDecoration||"LineThrough"===t.textDecoration){var b=y,w=void 0,y=y+h.measureText(f.text).width,C=void 0;switch(t.textDecoration){case"Underline":C=w=v+2;break;case"Overline":w=m.y+f.dy*c,C=m.y+f.dy*c;break;case"LineThrough":w=(v+m.y+f.dy*c)/2+2,C=(v+m.y+f.dy*c)/2+2}h.beginPath(),h.moveTo(b,w),h.lineTo(y,C),h.strokeStyle=t.color,h.lineWidth=.08*t.fontSize,h.globalAlpha=t.opacity,h.stroke()}}h.restore()}},QTi.prototype.applyFlipAndRotate=function(e,t,i,n,o,r,s){if(t.flip!==jfi.None&&r&&s&&!(s.elementActions&Jfi.ElementIsPort)){var a=r.groupElement,l=s,h=void 0;if(s instanceof Tyi&&s.position?h=r.renderFlipTextElement(a,i,l,t.flip,t.flipMode,!0):(s instanceof kyi||s instanceof Lyi||s instanceof Tyi&&!s.position||s instanceof vyi)&&(h=r.renderFlipElement(a,i,t.flip,!0)),h&&h.transform)for(var d=/(translate|scale|rotate)\(([^)]+)\)/g,p=void 0;null!==(p=d.exec(h.transform));){var c=p[1],u=p[2].split(",").map(function(e){return parseFloat(e.trim())});switch(c){case"translate":var g=u[0]||0,m=u[1]||0;e.translate(g,m);break;case"scale":g=u[0]||1,m=u[1]||g;e.scale(g,m)}}}this.rotateContext(i,t.angle,n,o)},QTi.prototype.loadImage=function(e,t,i,n,o){var r=new Image;r.src=t.source,this.image(e,r,t.x,t.y,t.width,t.height,t)},QTi.prototype.drawImage=function(e,t,i,n,o,r){var s,a,l,h,d,p=this;t.visible&&((s=QTi.getContext(e)).save(),a=t.x+t.width*t.pivotX,l=t.y+t.height*t.pivotY,(h=new Image).src=t.source,this.setStyle(e,t),(d=s.canvas.id.split("_"))[d.length-1],this.applyFlipAndRotate(s,t,e,a,l,o,r),n?h.onload=function(){p.loadImage(s,t,e,a,l)}:this.loadImage(s,t,e,a,l),s.restore())},QTi.prototype.image=function(e,t,i,n,o,r,s){e.beginPath();var a,l,h,d,p,c,u,g,m,f=t.width,y=t.height,v=o,b=r,w=0,C=0;s&&"None"!==s.alignment?(a=s.alignment.toLowerCase().substr(1,3),l=s.alignment.toLowerCase().substr(5,3),"Slice"===s.scale?(m=function(){C=y*(w=v)/f},g=function(){w=f*b/y,C=b},b<v?(m(),C<b&&g()):v===b?(y<f?g:m)():(g(),w<v&&m()),g=this.getSliceOffset(a,w,v,f),m=this.getSliceOffset(l,C,b,y),h=f-g,d=y-m,p=w-g*(w/f),c=C-m*(C/y),(u=pTi("canvas",{width:o.toString(),height:r.toString()})).getContext("2d").drawImage(t,g,m,h,d,0,0,p,c),e.drawImage(u,i,n,o,r)):"Meet"===s.scale?(w=(g=y/f)<(m=b/v)?v:b/g,C=g<m?v*g:b,i+=this.getMeetOffset(a,w,v),n+=this.getMeetOffset(l,C,b),e.drawImage(t,0,0,f,y,i,n,w,C)):e.drawImage(t,i,n,o,r)):e.drawImage(t,i,n,o,r),e.closePath()},QTi.prototype.getSliceOffset=function(e,t,i,n){switch(e){case"min":return 0;case"mid":return(t-i)/2*n/t;case"max":return(t-i)*n/t;default:return 0}},QTi.prototype.getMeetOffset=function(e,t,i){var n=Math.max(t,i),o=Math.min(t,i);switch(e){case"min":return 0;case"mid":return(n-o)/2;case"max":return n-o;default:return 0}},QTi.prototype.m=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2))},QTi.prototype.r=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(this.m(e)*this.m(t))},QTi.prototype.a=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(this.r(e,t))},QTi.prototype.labelAlign=function(e,t,i){var i=new Omi(t.width,i.length*(1.2*e.fontSize)),n={x:0,y:0},o=e.x,r=e.y,s=.5*e.width,a=.5*e.height;return"left"===e.textAlign?s=0:"center"===e.textAlign?s=t.width>e.width&&("Ellipsis"===e.textOverflow||"Clip"===e.textOverflow)&&"NoWrap"===e.textWrapping?0:.5*e.width:"right"===e.textAlign&&(s=+e.width),n.x=o+s+(t?t.x:0),n.y=r+a-i.height/2,n};var WTi=QTi;function QTi(){}UTi=function(e,t){return(UTi=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])}))(e,t)};var UTi,qTi,xW=function(e,t){function i(){this.constructor=e}UTi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},wH=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},h6=(xW(GTi,qTi=n),wH([e("")],GTi.prototype,"source",void 0),wH([e("transparent")],GTi.prototype,"color",void 0),wH([e("None")],GTi.prototype,"scale",void 0),wH([e("None")],GTi.prototype,"align",void 0),GTi);function GTi(){return null!==qTi&&qTi.apply(this,arguments)||this}xW(XTi,YTi=n),wH([e("Page")],XTi.prototype,"mode",void 0),wH([e("PageSettings")],XTi.prototype,"region",void 0),wH([t({top:25,bottom:25,left:25,right:25},ZOt)],XTi.prototype,"margin",void 0),wH([e(!1)],XTi.prototype,"canZoomIn",void 0),wH([e(void 0)],XTi.prototype,"customBounds",void 0),wH([e(!1)],XTi.prototype,"canFit",void 0);var YTi,Gmt=XTi;function XTi(){return null!==YTi&&YTi.apply(this,arguments)||this}xW(JTi,KTi=n),wH([e(null)],JTi.prototype,"width",void 0),wH([e(null)],JTi.prototype,"height",void 0),wH([t({},ZOt)],JTi.prototype,"margin",void 0),wH([e("Landscape")],JTi.prototype,"orientation",void 0),wH([e("Infinity")],JTi.prototype,"boundaryConstraints",void 0),wH([t({},h6)],JTi.prototype,"background",void 0),wH([e(!1)],JTi.prototype,"multiplePage",void 0),wH([e(!1)],JTi.prototype,"showPageBreaks",void 0),wH([t({},Gmt)],JTi.prototype,"fitOptions",void 0);var KTi,zmt=JTi;function JTi(){return null!==KTi&&KTi.apply(this,arguments)||this}xW($Ti,ZTi=n),wH([e(0)],$Ti.prototype,"horizontalOffset",void 0),wH([e(0)],$Ti.prototype,"verticalOffset",void 0),wH([e(1)],$Ti.prototype,"currentZoom",void 0),wH([e(0)],$Ti.prototype,"viewPortWidth",void 0),wH([e(0)],$Ti.prototype,"viewPortHeight",void 0),wH([e(.2)],$Ti.prototype,"minZoom",void 0),wH([e(30)],$Ti.prototype,"maxZoom",void 0),wH([e("Diagram")],$Ti.prototype,"scrollLimit",void 0),wH([e()],$Ti.prototype,"scrollableArea",void 0),wH([e(!1)],$Ti.prototype,"canAutoScroll",void 0),wH([e(100)],$Ti.prototype,"autoScrollFrequency",void 0),wH([t({left:15,right:15,top:15,bottom:15},ZOt)],$Ti.prototype,"autoScrollBorder",void 0),wH([t({left:0,right:0,top:0,bottom:0},ZOt)],$Ti.prototype,"padding",void 0),wH([e(.2)],$Ti.prototype,"zoomFactor",void 0);var ZTi,Cet=$Ti;function $Ti(){return null!==ZTi&&ZTi.apply(this,arguments)||this}tEi.prototype.register=function(e,t){this.services[""+e]=t},tEi.prototype.getService=function(e){return this.services[""+e]};var eEi=tEi;function tEi(){this.services={}}iEi=function(e,t){return(iEi=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])}))(e,t)};var iEi,nEi,mft=function(e,t){function i(){this.constructor=e}iEi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Dg=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},bk=(mft(oEi,nEi=n),Dg([e("lightgray")],oEi.prototype,"lineColor",void 0),Dg([e("")],oEi.prototype,"lineDashArray",void 0),Dg([e([1.25,18.75,.25,19.75,.25,19.75,.25,19.75,.25,19.75])],oEi.prototype,"lineIntervals",void 0),Dg([e([1,19,.5,19.5,.5,19.5,.5,19.5,.5,19.5])],oEi.prototype,"dotIntervals",void 0),Dg([e([20])],oEi.prototype,"snapIntervals",void 0),oEi);function oEi(){return null!==nEi&&nEi.apply(this,arguments)||this}mft(sEi,rEi=n),Dg([t({},bk)],sEi.prototype,"horizontalGridlines",void 0),Dg([t({},bk)],sEi.prototype,"verticalGridlines",void 0),Dg([e(Qfi.All)],sEi.prototype,"constraints",void 0),Dg([e(5)],sEi.prototype,"snapAngle",void 0),Dg([e("Lines")],sEi.prototype,"gridType",void 0),Dg([e(5)],sEi.prototype,"snapObjectDistance",void 0),Dg([e("#07EDE1")],sEi.prototype,"snapLineColor",void 0);var rEi,Hg=sEi;function sEi(){return null!==rEi&&rEi.apply(this,arguments)||this}aEi=function(e,t){return(aEi=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])}))(e,t)};var aEi,lEi,u2t=function(e,t){function i(){this.constructor=e}aEi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},ts=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},det=(u2t(hEi,lEi=n),ts([e(5)],hEi.prototype,"interval",void 0),ts([e(100)],hEi.prototype,"segmentWidth",void 0),ts([e("Horizontal")],hEi.prototype,"orientation",void 0),ts([e("RightOrBottom")],hEi.prototype,"tickAlignment",void 0),ts([e("red")],hEi.prototype,"markerColor",void 0),ts([e(25)],hEi.prototype,"thickness",void 0),ts([e(null)],hEi.prototype,"arrangeTick",void 0),hEi);function hEi(){return null!==lEi&&lEi.apply(this,arguments)||this}u2t(pEi,dEi=n),ts([e(!1)],pEi.prototype,"showRulers",void 0),ts([e(!0)],pEi.prototype,"dynamicGrid",void 0),ts([t({orientation:"Horizontal"},det)],pEi.prototype,"horizontalRuler",void 0),ts([t({orientation:"Vertical"},det)],pEi.prototype,"verticalRuler",void 0);var dEi,q$e=pEi;function pEi(){return null!==dEi&&dEi.apply(this,arguments)||this}cEi=function(e,t){return(cEi=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])}))(e,t)};var cEi,uEi,h=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},d2t=(function(e,t){function i(){this.constructor=e}cEi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(gEi,uEi=n),h([e("")],gEi.prototype,"property",void 0),h([e("")],gEi.prototype,"field",void 0),gEi);function gEi(){return null!==uEi&&uEi.apply(this,arguments)||this}mEi=function(e,t){return(mEi=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])}))(e,t)};var mEi,fEi,cft=function(e,t){function i(){this.constructor=e}mEi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},SOt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},IOt=(cft(yEi,fEi=n),SOt([e("")],yEi.prototype,"read",void 0),SOt([e("")],yEi.prototype,"create",void 0),SOt([e("")],yEi.prototype,"update",void 0),SOt([e("")],yEi.prototype,"destroy",void 0),SOt([e()],yEi.prototype,"customFields",void 0),yEi);function yEi(){return null!==fEi&&fEi.apply(this,arguments)||this}cft(bEi,vEi=n),SOt([e("")],bEi.prototype,"id",void 0),SOt([e("")],bEi.prototype,"sourceID",void 0),SOt([e("")],bEi.prototype,"targetID",void 0),SOt([e(null)],bEi.prototype,"sourcePointX",void 0),SOt([e(null)],bEi.prototype,"sourcePointY",void 0),SOt([e(null)],bEi.prototype,"targetPointX",void 0),SOt([e(null)],bEi.prototype,"targetPointY",void 0),SOt([e(null)],bEi.prototype,"dataManager",void 0),SOt([t({},IOt)],bEi.prototype,"crudAction",void 0);var vEi,DOt=bEi;function bEi(){return null!==vEi&&vEi.apply(this,arguments)||this}cft(CEi,wEi=n),SOt([e("")],CEi.prototype,"id",void 0),SOt([e(null)],CEi.prototype,"dataManager",void 0),SOt([e(null)],CEi.prototype,"dataSource",void 0),SOt([e("")],CEi.prototype,"root",void 0),SOt([e("")],CEi.prototype,"parentId",void 0),SOt([e()],CEi.prototype,"doBinding",void 0),SOt([kt([],d2t)],CEi.prototype,"dataMapSettings",void 0),SOt([t({},IOt)],CEi.prototype,"crudAction",void 0),SOt([t({},DOt)],CEi.prototype,"connectionDataSource",void 0);var wEi,vft=CEi;function CEi(){return null!==wEi&&wEi.apply(this,arguments)||this}SEi=function(e,t){return(SEi=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])}))(e,t)};var SEi,AEi,Rft=function(e,t){function i(){this.constructor=e}SEi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Wo=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},wk=(Rft(xEi,AEi=n),Wo([e("LeftInFlow")],xEi.prototype,"yesBranchDirection",void 0),Wo([e("RightInFlow")],xEi.prototype,"noBranchDirection",void 0),Wo([e(["Yes","True"])],xEi.prototype,"yesBranchValues",void 0),Wo([e(["No","False"])],xEi.prototype,"noBranchValues",void 0),xEi);function xEi(){return null!==AEi&&AEi.apply(this,arguments)||this}Rft(TEi,IEi=n),Wo([e("")],TEi.prototype,"fixedNode",void 0),Wo([e(30)],TEi.prototype,"horizontalSpacing",void 0),Wo([e("SamePoint")],TEi.prototype,"connectionPointOrigin",void 0),Wo([e("Nonlinear")],TEi.prototype,"arrangement",void 0),Wo([e(30)],TEi.prototype,"verticalSpacing",void 0),Wo([e(30)],TEi.prototype,"maxIteration",void 0),Wo([e(40)],TEi.prototype,"springFactor",void 0),Wo([e(50)],TEi.prototype,"springLength",void 0),Wo([t({left:50,top:50,right:0,bottom:0},ZOt)],TEi.prototype,"margin",void 0),Wo([e("Auto")],TEi.prototype,"horizontalAlignment",void 0),Wo([e("Auto")],TEi.prototype,"verticalAlignment",void 0),Wo([e("TopToBottom")],TEi.prototype,"orientation",void 0),Wo([e("Auto")],TEi.prototype,"connectionDirection",void 0),Wo([e("Default")],TEi.prototype,"connectorSegments",void 0),Wo([e("None")],TEi.prototype,"type",void 0),Wo([e()],TEi.prototype,"getLayoutInfo",void 0),Wo([e()],TEi.prototype,"layoutInfo",void 0),Wo([e()],TEi.prototype,"getBranch",void 0),Wo([e()],TEi.prototype,"bounds",void 0),Wo([e(!0)],TEi.prototype,"enableAnimation",void 0),Wo([e(!1)],TEi.prototype,"enableRouting",void 0),Wo([e("")],TEi.prototype,"root",void 0),Wo([t({},wk)],TEi.prototype,"flowchartLayoutSettings",void 0);var IEi,Ir=TEi;function TEi(){return null!==IEi&&IEi.apply(this,arguments)||this}EEi=function(e,t){return(EEi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}EEi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(kEi,DEi=Wr),kEi.prototype.mouseDown=function(e){var t,i=!0;if(e.source&&e.source.connectors&&(t=e.source.connectors[0]),e.info&&e.actualObject&&(i=e.info.ctrlKey&&"Orthogonal"!==e.actualObject.type),t&&i){this.inAction=!0,this.undoElement=DTi(e.source),DEi.prototype.mouseDown.call(this,e);var i=(t.constraints&Yfi.InheritSegmentThumbSize?this.commandHandler.diagram:t).segmentThumbSize,n=20<i&&"Straight"!==t.type?i/2:10;n/=this.commandHandler.diagram.scrollSettings.currentZoom;for(var o=0;o<t.segments.length;o++){var r=t.segments[parseInt(o.toString(),10)];if("OrthoThumb"===this.endPoint)for(var s=0;s<r.points.length-1;s++){var a={x:0,y:0};a.x=(r.points[parseInt(s.toString(),10)].x+r.points[s+1].x)/2,a.y=(r.points[parseInt(s.toString(),10)].y+r.points[s+1].y)/2,Awi(this.currentPosition,a,n)&&(this.selectedSegment=r,this.segmentIndex=s)}else Awi(this.currentPosition,r.point,n)&&(this.selectedSegment=r)}}},kEi.prototype.mouseMove=function(e){var t,i,n,o,r,s;return DEi.prototype.mouseMove.call(this,e),this.currentPosition=e.position,this.currentPosition&&this.prevPosition&&(o=this.currentPosition.y-this.prevPosition.y,n=this.currentPosition.x-this.prevPosition.x,t=void(this.currentPosition=this.commandHandler.snapConnectorEnd(this.currentPosition)),r=void 0,i=!1,e.source&&e.source.connectors&&(t=e.source.connectors[0]),Hmi.equals(this.startPosition,this.prevPosition)&&(i=!0),null===this.oldValue&&(this.oldValue=DTi(this.selectedSegment)),s={source:t,state:"Start",oldValue:this.oldValue,newValue:this.oldValue,segment:this.selectedSegment,cancel:!1},s={source:t,state:"Start",oldValue:this.oldValue,newValue:this.oldValue,segment:this.selectedSegment,cancel:!1},i&&!N&&this.commandHandler.triggerEvent(dyi.segmentChange,s),s.cancel&&this.commandHandler.diagram.resetTool(),!this.inAction||void 0===this.selectedSegment||void 0===this.endPoint||0==n&&0==o||s.cancel||("OrthoThumb"===this.endPoint?(this.blocked=!this.dragOrthogonalSegment(t,this.selectedSegment,this.currentPosition,this.segmentIndex),null===this.oldValue.length&&null===this.oldValue.direction&&(this.oldValue=DTi(this.selectedSegment))):(i=this.currentPosition.x-this.selectedSegment.point.x,n=this.currentPosition.y-this.selectedSegment.point.y,o=t.segments.indexOf(this.selectedSegment),this.blocked=!this.commandHandler.dragControlPoint(t,i,n,!1,o)),r=DTi(this.selectedSegment),this.commandHandler.updateSelector(),this.currentPosition=e.position,s={source:t,state:"Progress",oldValue:this.oldValue,newValue:r,segment:this.selectedSegment,cancel:!1},this.commandHandler.triggerEvent(dyi.segmentChange,s))),this.prevPosition=this.currentPosition,!this.blocked},kEi.prototype.mouseUp=function(e){var t,i,n,o,r;e.source&&e.source.connectors&&(i={segments:(t=e.source.connectors[0]).segments}),e&&e.source&&e.info&&e.info.ctrlKey&&e.info.shiftKey&&"Straight"===t.type?this.addOrRemoveSegment(t,this.currentPosition):"OrthoThumb"===this.endPoint&&this.selectedSegment&&(n=t.segments.indexOf(this.selectedSegment),o=t.segments[n-1],r=t.segments[n+1],n===t.segments.length-2&&this.updateLastSegment(t,this.selectedSegment)?t.segments.splice(t.segments.length-2,1):o&&Math.abs(o.length)<5&&0<o.length?1!==n&&this.removePrevSegment(t,n):r&&(o=Hmi.distancePoints(r.points[0],r.points[1]),r=r.length||0===r.length?r.length:o,Math.abs(r)<=5)&&this.removeNextSegment(t,n),this.commandHandler.updateEndPoint(t,i),t.selectedSegmentIndex=0),this.undoElement&&(o={type:"SegmentChanged",redoObject:DTi(e.source),undoObject:this.undoElement,category:"Internal"},this.commandHandler.addHistoryEntry(o)),t.isBezierEditing&&(t.isBezierEditing=!1),this.prevPosition!==this.startPosition&&(r={source:t,state:"Completed",oldValue:this.oldValue,newValue:DTi(this.selectedSegment),cancel:!1,segment:this.selectedSegment},this.commandHandler.triggerEvent(dyi.segmentChange,r)),DEi.prototype.mouseUp.call(this,e)},kEi.prototype.removePrevSegment=function(e,t){var i=e.segments[t-2],n=e.segments[t+1];!n||(n.length||0===n.length?n.length:Hmi.distancePoints(n.points[0],n.points[1]))<=5||(n=e.segments.slice(t-1,t+1),this.commandHandler.triggerEvent(dyi.segmentCollectionChange,n={element:e,removeSegments:n,type:"Removal",cancel:!1}),n.cancel)||(n=e.segments[t+1],e.segments.splice(t-1,2),"Left"===(e=this.selectedSegment).direction||"Right"===e.direction?(i.points[i.points.length-1].x=n.points[0].x,n.points[0].y=i.points[i.points.length-1].y):(i.points[i.points.length-1].y=n.points[0].y,n.points[0].x=i.points[i.points.length-1].x),!e.length&&0!==e.length||this.findSegmentDirection(i),this.findSegmentDirection(n))},kEi.prototype.findSegmentDirection=function(e){e.direction&&(e.length||0===e.length)&&(e.length=Hmi.distancePoints(e.points[0],e.points[e.points.length-1]),e.direction=Hmi.direction(e.points[0],e.points[e.points.length-1]))},kEi.prototype.removeNextSegment=function(e,t){var i,n,o=this.selectedSegment,r=e.segments[t-1],s=e.segments[t+2],a=e.segments[t+1];a.length||0===a.length?(n=e.segments.slice(t,2),this.commandHandler.triggerEvent(dyi.segmentCollectionChange,i={element:e,removeSegments:n,type:"Removal",cancel:!(i={element:e,removeSegments:n,type:"Removal",cancel:!1})}),i.cancel||(e.segments.splice(t,2),"Top"===o.direction||"Bottom"===o.direction?(s.points[0].y=o.points[0].y,r.points[r.points.length-1].x=s.points[0].x):(s.points[0].x=o.points[0].x,r.points[r.points.length-1].y=s.points[0].y))):(n=e.segments.slice(t+1,1),this.commandHandler.triggerEvent(dyi.segmentCollectionChange,i={element:e,removeSegments:n,type:"Removal",cancel:!1}),i.cancel||(e.segments.splice(t+1,1),"Top"===o.direction||"Bottom"===o.direction?r.points[r.points.length-1].x=a.points[a.points.length-1].x:r.points[r.points.length-1].y=a.points[a.points.length-1].y,this.findSegmentDirection(r),o.length=o.direction=null)),r&&s&&!i.cancel&&(r.length=Hmi.distancePoints(r.points[0],s.points[0]),r.direction=Hmi.direction(r.points[0],s.points[0]),!s.length&&0!==s.length||(s.length=Hmi.distancePoints(r.points[r.points.length-1],s.points[s.points.length-1]),n=r.points,e=s.points,s.direction=Hmi.direction(n[n.length-1],e[e.length-1])))},kEi.prototype.addOrRemoveSegment=function(e,t,i){for(var n,o,r,s,a,l,h=[],d={segments:e.segments},p=0;p<e.segments.length;p++)Awi(t,(s=e.segments[parseInt(p.toString(),10)]).point,e.hitPadding)&&(o=p,n=!0,h.push(s),l={element:e,removeSegments:h,type:"Removal",cancel:!1},i)&&i.triggerEvent(dyi.segmentCollectionChange,l);this.commandHandler||(this.commandHandler=i),n&&void 0!==o?e.segments&&e.segments[parseInt(o.toString(),10)]&&"Straight"===e.segments[parseInt(o.toString(),10)].type&&(s=e.segments[parseInt(o.toString(),10)],r=e.segments[o+1])&&(e.segments.splice(o,1),r.points[0]=s.points[0]):(this.commandHandler.enableServerDataBinding(!1),r=this.findIndex(e,t),e.segments&&e.segments[parseInt(r.toString(),10)]&&"Straight"===e.segments[parseInt(r.toString(),10)].type&&(s=e.segments[parseInt(r.toString(),10)],(a=new eSi(e,"segments",{type:"Straight",point:t},!0)).points[0]=s.points[0],a.points[1]=t,s.points[0]=t,e.segments.splice(r,0,a),n=!0,h.push(s),this.commandHandler.triggerEvent(dyi.segmentCollectionChange,l={element:e,addSegments:h,type:"Addition",cancel:!1})),this.commandHandler.enableServerDataBinding(!0)),n&&this.commandHandler.updateEndPoint(e,d)},kEi.prototype.findIndex=function(e,t){for(var i=[],n=0;n<e.segments.length;n++){var o=e.segments[parseInt(n.toString(),10)],r=tfi.toBounds([o.points[0],o.points[1]]);r.Inflate(e.hitPadding),r.containsPoint(t)&&i.push(o)}if(1===i.length)return e.segments.indexOf(i[0]);for(var s,a,l=void 0,h=void 0,n=0;n<i.length;n++)a=i[parseInt(n.toString(),10)],s=(t.y-a.points[0].y)/(a.points[1].y-t.y),a=(t.x-a.points[0].x)/(a.points[1].x-t.x),s=Math.abs(s-a),0===n&&(l=s,h=0),s<l&&(l=s,h=n);return e.segments.indexOf(i[parseInt(h.toString(),10)])},kEi.prototype.dragOrthogonalSegment=function(e,t,i,n){var o={x:0,y:0},r={segments:e.segments},s=(o.x=(t.points[parseInt(n.toString(),10)].x+t.points[n+1].x)/2,o.y=(t.points[parseInt(n.toString(),10)].y+t.points[n+1].y)/2,i.y-o.y),i=i.x-o.x,o=e.segments.indexOf(t),a=!1;return e.allowNodeOverlap&&(e.selectedSegmentIndex=o||n),-1!==o&&(0===o&&1===e.segments.length&&2===t.points.length?(o=this.addSegments(e,t,i,s,o),a=!0):o!==e.segments.length-1||null!==t.direction&&null!==t.length?0===o&&(o=this.insertFirstSegment(e,t,i,s,o),a=!0):(o=this.addTerminalSegment(e,t,i,s,n),a=!0),o)&&(a&&(this.selectedSegment=t=e.segments[parseInt(o.toString(),10)],this.segmentIndex=0),this.updateAdjacentSegments(e,o,i,s),this.commandHandler.updateEndPoint(e,r)),!0},kEi.prototype.addSegments=function(e,t,i,n,o){var r,s=[],a=Hmi.distancePoints(t.points[0],t.points[1]),l=Hmi.direction(t.points[0],t.points[1]),h=(s.push(new sSi(e,"segments",{type:"Orthogonal",direction:l,length:a/4},!0)),t.points[0].y===t.points[1].y?0<n?"Bottom":"Top":0<i?"Right":"Left"),t=t.points[0].x===t.points[1].x?n:i,n=(s.push(new sSi(e,"segments",{type:"Orthogonal",direction:h,length:t},!0)),s.push(new sSi(e,"segments",{type:"Orthogonal",direction:l,length:a/2},!0)),{element:e,addSegments:s,type:"Addition",cancel:!1});return this.commandHandler.triggerEvent(dyi.segmentCollectionChange,n),n.cancel||(e.segments=s.concat(e.segments),r=o+2),r},kEi.prototype.insertFirstSegment=function(e,t,i,n,o){var r,s,a,l=[];if(e.sourcePortID&&t.length&&2<e.segments[0].points.length)for(var h=void 0,d=0;d<t.points.length-1;d++){var p,c=Hmi.distancePoints(t.points[parseInt(d.toString(),10)],t.points[d+1]),u=Hmi.direction(t.points[parseInt(d.toString(),10)],t.points[d+1]);0===(p=new sSi(e,"segments",{type:"Orthogonal",direction:u,length:c},!0)).length&&(!h||"Top"!==h.direction&&"Bottom"!==h.direction?p.direction=0<n?"Bottom":"Top":p.direction=0<i?"Right":"Left"),h=p,l.push(p)}else s={type:"Orthogonal",direction:t.direction,length:t.length/3},l.push(new sSi(e,"segments",s,!0)),s="Bottom"===t.direction||"Top"===t.direction?(r=Math.abs(i),0<i?"Right":"Left"):(r=Math.abs(n),0<n?"Bottom":"Top"),p=new sSi(e,"segments",{type:"Orthogonal",direction:s,length:r},!0),l.push(p);var g={element:e,addSegments:l,type:"Addition",cancel:!1};return this.commandHandler.triggerEvent(dyi.segmentCollectionChange,g),g.cancel||(e.sourcePortID&&t.length&&2<e.segments[0].points.length?(e.segments.splice(0,1),a=1):((g=e.segments[1])&&g.length&&(g.length=s!==g.direction?g.length+r:g.length-r),t.length=(a=2)*t.length/3),e.segments=l.concat(e.segments)),a},kEi.prototype.updateAdjacentSegments=function(e,t,i,n){var o=e.segments[parseInt(t.toString(),10)],r=o.points[o.points.length-1],s=o.points[0],a=!0;"Orthogonal"===o.type&&(o.points[0]=s,o.points[o.points.length-1]=r,e.segments[t-1]&&(a=this.updatePreviousSegment(i,n,e,t)),e.segments.length-1>t)&&a&&(s=e.segments[t+1],this.updateNextSegment(e,o,s,i,n))},kEi.prototype.addTerminalSegment=function(e,t,i,n,o){for(var r,s=e.segments.indexOf(t),a=[],l=e.segments.pop(),h=e.segments[e.segments.length-1],d=h&&"Orthogonal"===h.type?h:null,p=0;p<t.points.length-2;p++)c=Hmi.distancePoints(t.points[parseInt(p.toString(),10)],t.points[p+1]),u=Hmi.direction(t.points[parseInt(p.toString(),10)],t.points[p+1]),r=new sSi(e,"segments",{type:"Orthogonal",length:c,direction:u},!0),a.push(r),d=r;var c,u,h=o,h=(2!==t.points.length&&h!==t.points.length-2||(d&&(d.length+=5),void 0!==h&&(c=2*Hmi.distancePoints(t.points[t.points.length-2],t.points[t.points.length-1])/3,u=Hmi.direction(t.points[t.points.length-2],t.points[t.points.length-1]),h=new sSi(e,"segments",{type:"Orthogonal",length:c,direction:u}),a.push(h))),new sSi(e,"segments",{type:"Orthogonal"},!0));a.push(h);h={element:e,addSegments:a,type:"Addition",cancel:!1};return this.commandHandler.triggerEvent(dyi.segmentCollectionChange,h),h.cancel?e.segments.push(l):(e.segments=e.segments.concat(a),s+=o),this.commandHandler.updateEndPoint(e),s},kEi.prototype.updatePortSegment=function(e,t,i,n,o){var r,s,a,l,h;1===i&&2===e.points.length&&e.length<0&&(r=t.sourceWrapper.corners,s=t.segments[parseInt(i.toString(),10)],i=t.segments[i+1],l=void 0,a=[],l=new sSi(t,"segments",{type:"Orthogonal",length:13,direction:e.direction}),h=void a.push(l),h="Left"===s.direction?s.points[0].x-(r.middleLeft.x-20):"Right"===s.direction?r.middleRight.x+20-s.points[0].x:"Bottom"===s.direction?r.bottomCenter.y+20-s.points[0].y:s.points[0].y-(r.topCenter.y-20),l=new sSi(t,"segments",{type:"Orthogonal",length:h,direction:s.direction}),a.push(l),s.length=s.length-h,i&&i.length&&i.direction&&(i.direction===e.direction?i.length-=13:i.direction===mvi(e.direction)&&(i.length+=13)),t.segments=a.concat(t.segments),this.selectedSegment=t.segments[3])},kEi.prototype.updatePreviousSegment=function(e,t,i,n){var o=i.segments[parseInt(n.toString(),10)],r=i.segments[n-1],s=(r.points[r.points.length-1]=o.points[0],!i.sourceID||""!==i.sourcePortID),a=!0;return"Orthogonal"===r.type&&("Bottom"===r.direction?r.length+=t:"Top"===r.direction?r.length-=t:"Right"===r.direction?r.length+=e:r.length-=e,""!==i.sourcePortID&&r.length<0&&!i.allowNodeOverlap?this.updatePortSegment(r,i,n,e,t):i.sourceID&&""===i.sourcePortID&&r.length<0&&1===n&&(a=!1,this.updateFirstSegment(i,o)),s)&&this.changeSegmentDirection(r,i),a},kEi.prototype.changeSegmentDirection=function(e,t){t.maxSegmentThumb||e.length<0&&(e.direction=mvi(e.direction),e.length*=-1)},kEi.prototype.updateNextSegment=function(e,t,i,n,o){i.points[0]=t.points[t.points.length-1],i&&"Orthogonal"===i.type&&(i.length||0===i.length)&&("Left"===i.direction||"Right"===i.direction?0!==n&&(i.length="Right"===i.direction?i.length-n:i.length+n,!i.length&&0!==i.length||this.changeSegmentDirection(i,e)):0!==o&&(i.length="Bottom"===i.direction?i.length-o:i.length+o,!i.length&&0!==i.length||this.changeSegmentDirection(i,e)))},kEi.prototype.updateFirstSegment=function(e,t){var i,t=e.segments.indexOf(t),n=!1,o=e.segments[parseInt(t.toString(),10)],r=e.segments[t-1],s={segments:e.segments};if(r.length<0&&e.sourceID){var a,l=e.sourceWrapper.corners,h=[],d=!1,p=(this.changeSegmentDirection(o,e),e.segments[t+1]),c=e.segments[t+2];switch(p&&this.changeSegmentDirection(p,e),c&&this.changeSegmentDirection(c,e),r.direction){case"Top":case"Bottom":i=0<o.length&&"Left"===o.direction?l.middleLeft:l.middleRight,o.length>l.width/2?Math.abs(r.length)<l.height/2&&(r.length=Hmi.distancePoints(l.center,r.points[r.points.length-1]),o.points[0].x=i.x,o.length=Hmi.distancePoints(o.points[0],o.points[o.points.length-1]),o.length-=20,n=!0):(p&&p.direction&&p.length&&(p.points[0].y=i.y,p.points[0].x=p.points[p.points.length-1].x="Right"===o.direction?i.x+20:i.x-20),d=n=!0);break;case"Left":case"Right":i=0<o.length&&"Top"===o.direction?l.topCenter:l.bottomCenter,o.length>l.height/2?Math.abs(r.length)<l.width/2&&(r.length=Hmi.distancePoints(l.center,r.points[r.points.length-1]),o.points[0].y=i.y,o.length=Hmi.distancePoints(o.points[0],o.points[o.points.length-1]),o.length-=20,n=!0):(p&&p.direction&&p.length&&(p.points[0].x=i.x,p.points[0].y=p.points[p.points.length-1].y="Bottom"===o.direction?i.y+20:i.y-20),d=n=!0)}this.changeSegmentDirection(r,e),this.changeSegmentDirection(o,e),n&&(a={type:"Orthogonal",direction:o.direction,length:20},h.push(new sSi(e,"segments",a,!0)),d&&(p&&p.direction&&p.length&&(p.length=Hmi.distancePoints(p.points[0],p.points[p.points.length-1])),c&&c.direction&&c.length&&(c.length=Hmi.distancePoints(p.points[p.points.length-1],c.points[c.points.length-1])),e.segments.splice(t-1,2)),e.segments=h.concat(e.segments)),this.selectedSegment=d?e.segments[t-1]:e.segments[t+1],this.commandHandler.updateEndPoint(e,s)}},kEi.prototype.updateLastSegment=function(e,t){var i,n,o,r,s,a;return!(!e.targetID||""!==e.targetPortID)&&(a=o=n=i=void 0,e=e.targetWrapper.corners,r=t.points[0],s=t.points[t.points.length-1],a="Right"===t.direction||"Left"===t.direction?(i={x:r.x,y:r.y},n={x:"Left"===t.direction?s.x-e.width/2:s.x+e.width/2,y:s.y},o={x:e.center.x,y:e.center.y-e.height},{x:e.center.x,y:e.center.y+e.height}):(i={x:r.x,y:r.y},n={x:s.x,y:"Bottom"===t.direction?s.y+e.height/2:s.y-e.height/2},o={x:e.center.x-e.width,y:e.center.y},{x:e.center.x+e.width,y:e.center.y}),SAi({x1:i.x,y1:i.y,x2:n.x,y2:n.y},{x1:o.x,y1:o.y,x2:a.x,y2:a.y}).enabled)},kEi.prototype.destroy=function(){},kEi.prototype.getModuleName=function(){return"ConnectorEditingTool"};var EEi,DEi,MEi=kEi;function kEi(e,t){e=DEi.call(this,e,!0)||this;return e.oldValue=null,e.endPoint=t,e}Object.defineProperty(BEi.prototype,"action",{get:function(){return this.currentAction},set:function(e){e!==this.currentAction&&("PortDraw"===this.currentAction&&(this.diagram.tool&=~eyi.DrawOnce,this.diagram.currentDrawingObject&&(this.diagram.currentDrawingObject=null),this.tool&&this.tool.mouseUp({position:this.currentPosition}),this.tool=null),"Rotate"===e||"LabelRotate"===e?this.diagram.diagramCanvas.classList.add("e-diagram-rotate"):"Rotate"!==this.currentAction&&"LabelRotate"!==this.currentAction||this.diagram.diagramCanvas.classList.remove("e-diagram-rotate"),this.currentAction=e,"None"===this.currentAction||"Select"===this.currentAction||this.diagram.diagramActions&ryi.TextEdit||this.currentPosition&&this.commandHandler.isUserHandle(this.currentPosition)||"FixedUserHandle"===this.currentAction?this.diagram.diagramActions=this.diagram.diagramActions&~ryi.ToolAction:this.diagram.diagramActions=this.diagram.diagramActions|ryi.ToolAction,this.diagram.setCursor(this.diagram.getCursor(e,this.inAction)))},enumerable:!0,configurable:!0}),Object.defineProperty(BEi.prototype,"blocked",{get:function(){return this.isBlocked},set:function(e){this.isBlocked=e,this.blocked?this.diagram.setCursor("not-allowed"):this.diagram.setCursor(this.diagram.getCursor(this.action,this.inAction))},enumerable:!0,configurable:!0}),BEi.prototype.getMousePosition=function(e){var e=(-1!==e.type.indexOf("touch")?(t=e.changedTouches[0].clientX,e.changedTouches[0]):(t=e.clientX,e)).clientY,t=this.diagram.modifyClientOffset(t),i=(e=this.diagram.modifyClientOffset(e),new Omi,LSi(this.diagram)),n=this.diagram.element.getBoundingClientRect();return this.diagram.modifyBounds(n),t=t+this.diagram.diagramCanvas.scrollLeft-n.left-i.width,e=e+this.diagram.diagramCanvas.scrollTop-n.top-i.height,t/=this.diagram.scroller.transform.scale,e/=this.diagram.scroller.transform.scale,{x:t-=this.diagram.scroller.transform.tx,y:e-=this.diagram.scroller.transform.ty}},BEi.prototype.windowResize=function(e){var t=this;return this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=setTimeout(function(){t.updateViewPortSize(t.diagram.element)},300),!1},BEi.prototype.updateViewPortSize=function(e){e=document.getElementById(e.id);if(e){var e=e.getBoundingClientRect(),e=(this.diagram.modifyBounds(e),this.diagram.scroller.setViewPortSize(e.width,e.height),new Omi,LSi(this.diagram)),t=this.diagram.getSizeValue(this.diagram.width,e.width),e=this.diagram.getSizeValue(this.diagram.height,e.height);if(this.diagram.diagramCanvas.style.width=t,this.diagram.diagramCanvas.style.height=e,this.diagram.scroller.setSize(),this.diagram.transformLayers(),this.diagram.rulerSettings.showRulers&&BSi(this.diagram),1<this.diagram.views.length)for(var i=0,n=this.diagram.views;i<n.length;i++){var o=n[i],o=this.diagram.views[""+o];o instanceof rAi&&o.onPropertyChanged({sourceID:o.sourceID},{})}}},BEi.prototype.canHideResizers=function(){return(this.tool instanceof Wwi||this.tool instanceof qwi)&&this.isMouseDown},BEi.prototype.updateCursor=function(){var e;1!==this.diagram.selectedItems.nodes.length&&1!==this.diagram.selectedItems.connectors.length||(e=(e=[]).concat(this.diagram.selectedItems.nodes,this.diagram.selectedItems.connectors),this.blocked=!(this.eventArgs&&this.eventArgs.source&&!Vvi(this.eventArgs.source))&&this.isMouseDown&&1===e.length&&this.tool instanceof Lwi&&!Vvi(e[0]))},BEi.prototype.isForeignObject=function(e,t){var i=e;if(i)for(;null!==i.parentNode;){if("string"==typeof i.className&&(!t&&-1!==i.className.indexOf("foreign-object")||t&&-1!==i.className.indexOf("e-diagram-text-edit")))return i;i=i.parentNode}return null},BEi.prototype.isMetaKey=function(e){return"mousewheel"!==e.type&&navigator.platform.match("Mac")?e.metaKey:e.ctrlKey},BEi.prototype.renderUmlHighLighter=function(e){this.diagram.commandHandler.removeStackHighlighter();var t,i=this.diagram.selectedItems.nodes[0];i&&i.container&&"Stack"===i.container.type&&"UmlClassifier"===i.shape.type&&(i.wrapper.bounds.containsPoint(this.currentPosition)||(t=this.diagram.findObjectsUnderMouse({x:this.currentPosition.x-20,y:this.currentPosition.y}),(t=this.diagram.findObjectUnderMouse(t,this.action,this.inAction))&&t.parentId&&t.parentId===i.id&&(i="Vertical"===this.diagram.nameTable[t.parentId].container.orientation,bwi(t.wrapper,i,e.position,this.diagram,!0))))},BEi.prototype.isDeleteKey=function(e,t){return navigator.platform.match("Mac")&&"Backspace"===e&&"delete"===t},BEi.prototype.isMouseOnScrollBar=function(e){var t,i=e.offsetX,e=e.offsetY,n=this.diagram.diagramCanvas,o=n.offsetHeight,r=n.offsetWidth;return!!(o<n.scrollHeight&&(t=tfi.toBounds([{x:r-17,y:0},{x:r,y:0},{x:r-17,y:o},{x:r,y:o}]),0!==this.diagram.scroller.verticalOffset&&(t.x=t.x-this.diagram.scroller.horizontalOffset,t.y=t.y-this.diagram.scroller.verticalOffset),t.containsPoint({x:i,y:e})))||!!(r<n.scrollWidth&&(t=tfi.toBounds([{x:0,y:o-17},{x:r,y:o-17},{x:0,y:o},{x:r,y:o}]),0!==this.diagram.scroller.horizontalOffset&&(t.x=t.x-this.diagram.scroller.horizontalOffset,t.y=t.y-this.diagram.scroller.verticalOffset),t.containsPoint({x:i,y:e})))},BEi.prototype.updateVirtualization=function(){var t=this,i=setInterval(function(e){t.diagram.removeVirtualObjects(i)},50);setTimeout(function(){t.diagram.deleteVirtualObject=!0},50)},BEi.prototype.checkPreviousAction=function(){if(this.action!==this.previousAction&&this.diagram.selectedItems.userHandles.length)for(var e=0;e<this.diagram.selectedItems.userHandles.length;e++)this.previousAction&&this.diagram.selectedItems.userHandles[parseInt(e.toString(),10)]&&(this.checkUserHandleEvent(dyi.onUserHandleMouseLeave),this.previousAction="None");this.action!==this.previousAction&&(this.checkFixedUserHandleEvent(dyi.onFixedUserHandleMouseLeave,this.targetItem,this.previousTarget),this.previousTarget=null,this.targetItem=null)},BEi.prototype.checkUserHandleEvent=function(e){if(this.diagram.selectedItems&&0<this.diagram.selectedItems.userHandles.length)for(var t=e===dyi.onUserHandleMouseLeave?this.previousAction:this.action,i={element:void 0},n=0;n<this.diagram.selectedItems.userHandles.length;n++)(t===this.diagram.selectedItems.userHandles[parseInt(n.toString(),10)].name||e===dyi.onUserHandleMouseUp&&"Select"===t)&&(i.element=this.diagram.selectedItems.userHandles[parseInt(n.toString(),10)],this.userHandle(e,n,i,null))},BEi.prototype.userHandle=function(e,t,i,n){var o;e!==dyi.onUserHandleMouseEnter&&e!==dyi.onFixedUserHandleMouseEnter||(this.previousAction=this.action,i.element.tooltip&&"Auto"===i.element.tooltip.openOn&&""!==i.element.tooltip.content&&(Zyi(this.diagram,i.element),o=void 0,i.element.pathData?e===dyi.onUserHandleMouseEnter?o=document.getElementById(this.diagram.selectedItems.userHandles[parseInt(t.toString(),10)].name+"_userhandle"):e===dyi.onFixedUserHandleMouseEnter&&(o=document.getElementById(n.id+"_"+n.fixedUserHandles[parseInt(t.toString(),10)].id+"_groupElement")):o=i.element.source?document.getElementById(this.diagram.selectedItems.userHandles[parseInt(t.toString(),10)].name+"_image"):i.element.content?document.getElementById(this.diagram.selectedItems.userHandles[parseInt(t.toString(),10)].name+"_shape_native_element"):document.getElementById(this.diagram.selectedItems.userHandles[parseInt(t.toString(),10)].name+"_shape_html_element"),"Auto"===i.element.tooltip.openOn)&&i.element!==this.isUserHandleHover&&(this.isUserHandleHover=i.element,this.diagram.tooltipObject.open(o)),this.diagram.triggerEvent(e,i)),e===dyi.onUserHandleMouseDown?(this.userHandleObject=this.diagram.selectedItems.userHandles[parseInt(t.toString(),10)].name,this.diagram.triggerEvent(e,i)):e===dyi.onFixedUserHandleMouseDown&&this.diagram.triggerEvent(e,i),e===dyi.onUserHandleMouseUp?(n=document.getElementById(this.diagram.selectedItems.userHandles[parseInt(t.toString(),10)].name+"_userhandle"),this.commandHandler.isUserHandle(this.currentPosition)&&n&&n.id===this.userHandleObject+"_userhandle"&&this.diagram.triggerEvent(e,i)):e===dyi.onFixedUserHandleMouseUp&&this.diagram.triggerEvent(e,i),e!==dyi.onUserHandleMouseLeave&&e!==dyi.onFixedUserHandleMouseLeave||(this.diagram.tooltipObject&&"Custom"!==this.diagram.tooltipObject.openOn&&(this.isUserHandleHover=null,this.diagram.tooltipObject.close()),this.diagram.triggerEvent(e,i))},BEi.prototype.checkFixedUserHandleEvent=function(e,t,i){if(t&&0<t.fixedUserHandles.length)for(var n,o={element:void 0},r=void 0,s=0;s<t.fixedUserHandles.length;s++)n=t.fixedUserHandles[parseInt(s.toString(),10)].id,i&&i.id&&-1<i.id.indexOf(n)&&(r=n,this.previousTarget=i,this.targetItem=t),r===t.fixedUserHandles[parseInt(s.toString(),10)].id&&(o.element=t.fixedUserHandles[parseInt(s.toString(),10)],this.userHandle(e,s,o,t))},BEi.prototype.mouseDown=function(e){var t=this;if("touchstart"===e.type&&(this.timeOutTapHold=setTimeout(function(){"Select"!==t.action&&"Drag"!==t.action||t.mouseMove(e,void 0)},500)),!(!0===this.inAction&&(this.tool instanceof Zwi||this.tool instanceof tCi)||!0===this.inAction&&e.buttons&&0!=(e.buttons&e.buttons-1))){this.focus=!0;var i=e.touches,n=!!document.getElementsByClassName("e-dragclone")[0];if(this.isMouseOnScrollBar(e)&&!n)this.isScrolling=!0,e.preventDefault();else{if(this.checkFixedUserHandleEvent(dyi.onFixedUserHandleMouseDown,this.targetItem,this.previousTarget),this.checkUserHandleEvent(dyi.onUserHandleMouseDown),!this.checkEditBoxAsTarget(e)&&obi(this.diagram)||ebi(this.diagram)&&!nbi(this.diagram))if("Select"!==this.action&&"Drag"!==this.action||this.diagram.updatePortVisibility(this.hoverElement,Wfi.Hover,!0),!(this.tool instanceof fCi||this.tool instanceof bCi)||2!==e.button&&2!==e.buttons)if(!0===this.inAction&&!0===this.isMouseDown&&(this.tool instanceof fCi||this.tool instanceof bCi))this.isMouseDown=!0,this.eventArgs={},this.getMouseEventArgs(this.currentPosition,this.eventArgs),this.eventArgs.position=this.currentPosition,this.tool.mouseDown(this.eventArgs);else{this.isMouseDown=!0,this.currentPosition=this.prevPosition=this.getMousePosition(e),this.eventArgs={},this.diagram.textEditing&&!this.isMouseOnScrollBar(e)&&(this.diagram.endEdit(),this.diagram.textEditing=!1,"Canvas"===this.diagram.mode)&&1!==this.diagram.scroller.currentZoom&&this.diagram.refreshDiagramLayer();var n=this.getTargetElement(),n=(this.action=this.diagram.findActionToBeDone(n.obj,n.sourceElement,this.currentPosition,n.target),this.isMetaKey(e)),o=(n&&e.shiftKey&&this.diagram.connectorEditingToolModule?this.action="SegmentEnd":(n||e.shiftKey)&&(Zvi(this.diagram)||$vi(this.diagram))&&(this.action="Select"),this.tool=this.diagram.getTool(this.action),this.tool||(this.action="Select",this.tool=this.diagram.getTool(this.action)),this.getMouseEventArgs(this.currentPosition,this.eventArgs),(n||e.shiftKey)&&(n=n&&e.shiftKey?{ctrlKey:n,shiftKey:e.shiftKey}:{ctrlKey:!0},this.eventArgs.info=n),this.eventArgs.position=this.currentPosition,this.diagram.selectedItems.nodes);if(this.tool.mouseDown(this.eventArgs),this.diagram.selectedItems.canToggleSelection&&o&&this.diagram.selectedItems.nodes&&this.tool instanceof Wwi)for(var r=0;r<o.length;r++)o[parseInt(r.toString(),10)].id!==this.diagram.selectedItems.nodes[parseInt(r.toString(),10)].id&&(this.isSwimlaneSelected=!0);this.initialEventArgs={source:this.eventArgs.source,sourceWrapper:this.eventArgs.sourceWrapper},this.initialEventArgs.position=this.currentPosition,this.initialEventArgs.info=this.eventArgs.info,this.inAction=!1,"touchstart"===e.type&&(i&&2<=i.length&&(this.touchStartList=mTi(this.touchStartList,0,i)),i||e.preventDefault())}else{this.diagram,this.currentPosition,e.buttons,this.eventArgs.actualObject,0===e.button||e.button;this.inAction=!1,this.tool.mouseUp(this.eventArgs)}this.isForeignObject(e.target)||this.isForeignObject(e.target,!0)||i||e.preventDefault()}}},BEi.prototype.mouseMoveExtend=function(e,t){(this.tool instanceof fCi||this.tool instanceof bCi)&&this.tool.mouseMove(this.eventArgs),this.diagram.scrollSettings.canAutoScroll?this.checkAutoScroll(e):this.blocked||this.tool.mouseMove(this.eventArgs),this.eventArgs.target&&(this.hoverElement=this.eventArgs.target);e=!(this.eventArgs.target instanceof MIi||this.eventArgs.target instanceof ISi)||!(t instanceof MIi||t instanceof ISi);this.tool instanceof Hwi&&this.diagram.updatePortVisibility(this.hoverElement instanceof MIi||this.hoverElement instanceof ISi?this.hoverElement:this.hoverNode,Wfi.Connect|Wfi.Hover,e),this.hoverElement instanceof MIi&&this.hoverNode instanceof MIi&&this.hoverNode&&this.hoverNode.id!==this.hoverElement.id&&this.diagram.updatePortVisibility(this.hoverNode,Wfi.Connect|Wfi.Hover,!0),this.hoverElement instanceof ISi&&0<this.hoverElement.ports.length&&this.diagram.updatePortVisibility(this.hoverElement,Wfi.Connect|Wfi.Hover,!0),this.previousElement instanceof MIi&&this.hoverElement&&this.previousElement.id!==this.hoverElement.id&&this.diagram.updatePortVisibility(this.previousElement,Wfi.Connect|Wfi.Hover,!0),this.previousElement=this.hoverElement,""!==this.diagram.tooltip.content&&(this.hoverElement=null),this.hoverNode=e?null:t},BEi.prototype.checkAction=function(e){var t;"LabelSelect"===this.action&&this.eventArgs.sourceWrapper&&(this.eventArgs.sourceWrapper instanceof Tyi||this.eventArgs.sourceWrapper instanceof Tvi)?(t=this.commandHandler.findTarget(this.eventArgs.sourceWrapper,this.eventArgs.source),!Twi(this.diagram,t,!1,this.eventArgs.sourceWrapper)&&Vvi(t)&&(this.action="LabelDrag",this.tool=this.getTool(this.action),this.tool.mouseDown(this.initialEventArgs))):Vvi(e)&&Nvi(e)&&this.initialEventArgs&&this.initialEventArgs.source&&"Select"===this.action&&(!Twi(this.diagram,this.eventArgs.source,!1)&&this.eventArgs.source instanceof qIi&&this.getMouseEventArgs(this.currentPosition,this.eventArgs),e instanceof ISi&&(!(e instanceof ISi)||Awi(this.currentPosition,e.sourcePoint,e.hitPadding)||Awi(this.currentPosition,e.targetPoint,e.hitPadding))||(this.action="Drag"),this.tool=this.getTool(this.action),this.tool.mouseDown(this.initialEventArgs))},BEi.prototype.isSwimlaneElements=function(e){return!e||!(e.isLane||e.isPhase||e.isHeader)},BEi.prototype.canShowTouchTooltip=function(e){return!!("touchstart"===e.type&&this.diagram.tool&eyi.SingleSelect&&this.diagram.tool&eyi.ZoomPan)&&!(this.isMouseDown=!1)},BEi.prototype.mouseMove=function(e,t){var i,n,o,r,s,a,l,h;this.focus=!0,"touchmove"===e.type&&(this.touchArgs={target:e.target,type:"touchmove"}),this.isScrolling?e.preventDefault():(obi(this.diagram)||ebi(this.diagram)&&!nbi(this.diagram))&&(this.currentPosition=this.getMousePosition(e),i=this.diagram.findObjectsUnderMouse(this.currentPosition),i=this.diagram.findObjectUnderMouse(i,this.action,this.inAction),l=this.diagram,h=this.currentPosition,l.rulerSettings.showRulers&&(l.hRuler.drawRulerMarker(l.hRuler.element,h,l.scroller.horizontalOffset),l.vRuler.drawRulerMarker(l.vRuler.element,h,l.scroller.verticalOffset)),h=!1,l=void 0,"touchmove"===e.type&&(t=e.touches)&&1<t.length&&(this.touchMoveList=mTi(this.touchMoveList,0,t),"PinchZoom"!==this.action)&&(h=!0),!1===Hmi.equals(this.currentPosition,this.prevPosition)||this.inAction||this.canShowTouchTooltip(e))&&(!1===this.isMouseDown||h?(this.eventArgs={},s=void 0,(a=null)!==i&&((s=!((s=(a=this.diagram.findElementUnderMouse(i,this.currentPosition,this.diagram))?this.commandHandler.findTarget(a,i):s)instanceof f0i||s instanceof b0i)||s.tooltip&&""!==s.tooltip.content?s:i)!==this.hoverElement?(r=this.getContent(),this.hoverElement&&"Auto"===this.hoverElement.tooltip.openOn&&""!==r&&this.elementLeave(),this.diagram.updatePortVisibility(this.hoverElement,Wfi.Hover,!0),i instanceof MIi&&(this.hoverNode=i),r=!0,!this.isSwimlaneElements(i)&&this.hoverElement&&this.isSwimlaneElements(this.hoverElement)&&(r=!1),this.hoverElement=r?i:this.hoverElement,n=null,o=void 0,o=void((n=this.diagram.findElementUnderMouse(i,this.currentPosition,this.diagram))instanceof kyi&&((o=this.commandHandler.findTarget(n,i))instanceof r0i||o instanceof l0i)&&this.hoverElement.constraints&pyi.ToolTip&&(this.hoverElement=o)),n instanceof Tyi&&((o=this.commandHandler.findTarget(n,i))instanceof f0i||o instanceof b0i)&&o.constraints&Xfi.Tooltip&&(this.hoverElement=o),r?this.elementEnter(this.currentPosition,!1):this.hoverElement=i):this.hoverElement&&this.hoverElement===s&&this.hoverElement.tooltip.content&&void 0!==this.diagram.tooltipObject&&"Mouse"===this.hoverElement.tooltip.relativeMode&&this.setTooltipOffset(this.currentPosition),a)&&(l=this.commandHandler.findTarget(a,i)),this.action=this.diagram.findActionToBeDone(i,a,this.currentPosition,l),this.checkFixedUserHandleEvent(dyi.onFixedUserHandleMouseEnter,i,a),this.checkUserHandleEvent(dyi.onUserHandleMouseEnter),this.checkPreviousAction(),this.getMouseEventArgs(this.currentPosition,this.eventArgs),this.tool=this.getTool(this.action),this.mouseEvents(),this.tool instanceof tCi||this.tool instanceof bCi||this.tool instanceof fCi?this.tool.mouseMove(this.eventArgs):t&&this.tool instanceof aCi&&this.tool.mouseDown(this.eventArgs),this.updateCursor(),this.renderUmlHighLighter(this.eventArgs),n=!1,this.hoverElement&&!(this.tool instanceof aCi)&&i instanceof MIi&&this.isSwimlaneElements(i)&&(0===this.diagram.selectedItems.nodes.length||!Twi(this.diagram,this.hoverElement))||this.hoverElement instanceof ISi||(n=!0),this.hoverElement&&!(this.tool instanceof aCi)&&i instanceof ISi&&(0===this.diagram.selectedItems.connectors.length||!Twi(this.diagram,this.hoverElement))||this.hoverElement instanceof MIi||(n=!0),this.diagram.updatePortVisibility(this.hoverElement,Wfi.Hover,n),o=this.getContent(),null===i&&this.hoverElement&&"Auto"===this.hoverElement.tooltip.openOn&&o&&(this.hoverElement=null,this.elementLeave()),h=!1):(this.eventArgs.position=this.currentPosition,"Drag"===this.action&&!Twi(this.diagram,this.eventArgs.source,!1)&&this.eventArgs.source instanceof qIi&&this.getMouseEventArgs(this.currentPosition,this.eventArgs),this.mouseEvents(),(e.ctrlKey||e.shiftKey)&&(r=e.ctrlKey&&e.shiftKey?{ctrlKey:e.ctrlKey,shiftKey:e.shiftKey}:{ctrlKey:!0},this.eventArgs.info=r),this.checkAction(i),s=this.getConnectorPadding(this.eventArgs),this.getMouseEventArgs(this.currentPosition,this.eventArgs,this.eventArgs.source,s),this.updateCursor(),this.inAction=!0,this.initialEventArgs=null,"Drag"!==this.action&&"Rotate"!==this.action||(this.diagram.diagramActions=this.diagram.diagramActions|ryi.Interactions),l=this.diagram.scroller.getPageBounds(),this.mouseMoveExtend(e,i),a=this.diagram.scroller.getPageBounds(),!i||l.width===a.width&&l.height===a.height&&l.x===a.x&&l.y===a.y||this.diagram.views&&this.diagram.views.overview&&(t=this.diagram.views.overview).updateView(t)),this.prevPosition=this.currentPosition,this.isForeignObject(e.target,!0)||e.preventDefault())},BEi.prototype.getContent=function(){var e,t=this.hoverElement instanceof MIi&&this.hoverElement.constraints&Kfi.Tooltip||this.hoverElement instanceof ISi&&this.hoverElement.constraints&Yfi.Tooltip||(this.hoverElement instanceof r0i||this.hoverElement instanceof l0i)&&this.hoverElement.constraints&pyi.ToolTip||(this.hoverElement instanceof f0i||this.hoverElement instanceof b0i)&&this.hoverElement.constraints&Xfi.Tooltip,i=this.hoverElement,i=(i instanceof MIi&&i.children&&0<i.children.length&&(e=this.findIntersectChild(i)),(t?this.hoverElement:this.diagram).tooltip.content);return e?e.tooltip.content:i},BEi.prototype.findIntersectChild=function(e){for(var t,i=new tfi(this.currentPosition.x,this.currentPosition.y,8,8),n=0;n<e.children.length;n++)if((t=this.diagram.getObject(e.children[parseInt(n.toString(),10)])).wrapper.outerBounds.intersects(i))return t;return null},BEi.prototype.checkAutoScroll=function(t){var i,n,o=this.startAutoScroll(t);!o&&this.doingAutoScroll?(this.doingAutoScroll=!1,clearInterval(this.timeOutValue)):o?(this.tool instanceof Zwi||this.tool instanceof tCi||this.tool instanceof Wwi||this.tool instanceof Xwi||this.tool instanceof Lwi||this.tool instanceof Hwi)&&this.inAction&&(((n=(i=this).diagram.scrollSettings.autoScrollFrequency)<10||isNaN(n))&&(n=100),this.diagram.scrollSettings.canAutoScroll)&&o&&!this.doingAutoScroll&&(this.doingAutoScroll=!0,this.timeOutValue=setInterval(function(e){i.doAutoScroll(o,t,n)},n)):this.blocked=!this.tool.mouseMove(this.eventArgs)},BEi.prototype.mouseUp=function(e){clearTimeout(this.timeOutTapHold),this.touchArgs=void 0,this.diagram.diagramRenderer.touchMove=void 0,this.eventArgs&&this.eventArgs.target&&this.eventArgs.target!==this.hoverNode&&this.eventArgs.target!==this.lastObjectUnderMouse&&(this.hoverNode=this.eventArgs.target,this.lastObjectUnderMouse=this.eventArgs.target);var t=!1,i=((this.tool instanceof Wwi||this.tool instanceof qwi)&&(t=!0),this.checkFixedUserHandleEvent(dyi.onFixedUserHandleMouseUp,this.targetItem,this.previousTarget),this.checkUserHandleEvent(dyi.onUserHandleMouseUp),"SVG"===this.diagram.mode&&Jvi(this.diagram)&&this.updateVirtualization(),this.diagram.selectedItems.nodes),n=this.diagram.selectedItems.connectors,o=(this.diagram.previousSelectedObject=null,this.diagram.diagramRenderer.rendererActions=this.diagram.removeConstraints(this.diagram.diagramRenderer.rendererActions,syi.DrawSelectorBorder),e.touches);if(this.isScrolling)this.isScrolling=!1,e.preventDefault();else{if(!this.checkEditBoxAsTarget(e)&&obi(this.diagram)||ebi(this.diagram)&&!nbi(this.diagram)){if(this.tool&&(!(this.tool instanceof fCi||this.tool instanceof bCi)||(this.tool instanceof fCi||this.tool instanceof bCi)&&2===e.detail)){!this.isForeignObject(e.target)&&this.isMouseDown&&document.getElementById(this.diagram.element.id+"content").focus(),this.inAction||3===e.which||"Drag"===this.action&&(this.action="Select",s=this.diagram.selectedItems.nodes.concat(this.diagram.selectedItems.connectors),r=this.diagram.findObjectsUnderMouse(this.currentPosition),r=this.diagram.findObjectUnderMouse(r,this.action,this.inAction),a=!0,!e.ctrlKey&&this.isMouseDown&&1<this.diagram.selectedItems.nodes.length+this.diagram.selectedItems.connectors.length&&1===e.which&&!(this.diagram.diagramActions&ryi.PreventClearSelection)&&(a=!1,this.commandHandler.clearSelection()),Twi(this.diagram,r)&&a||(this.commandHandler.selectObjects([r],void 0,s),this.diagram.selectedItems.canToggleSelection&&((a=this.diagram.selectedItems.nodes)?a[0].parentObj instanceof RIi&&(g=!0):0<this.diagram.selectedItems.connectors.length&&(g=!0))));var r=!1,s=this.updateContainerProperties(),a=void 0;if(this.addUmlNode(),this.inAction=!1,this.isMouseDown=!1,this.diagram.selectedObject.helperObject&&(a=this.updateContainerBounds()),this.tool&&(this.tool.prevPosition||this.tool instanceof uCi)){this.eventArgs.position=this.currentPosition;var l=this.getConnectorPadding(this.eventArgs),l=(this.getMouseEventArgs(this.currentPosition,this.eventArgs,this.eventArgs.source,l),this.isMetaKey(e));if((l||e.shiftKey)&&(l=l&&e.shiftKey?{ctrlKey:l,shiftKey:e.shiftKey}:{ctrlKey:!0},this.eventArgs.info=l),this.diagram.diagramActions&ryi.Interactions&&(this.diagram.diagramActions=this.diagram.diagramActions&~ryi.Interactions),this.eventArgs.clickCount=e.detail,this.diagram.selectedObject.helperObject&&(this.tool instanceof Wwi||this.tool instanceof Xwi))this.diagram.selectedObject.actualObject&&""!==this.diagram.selectedObject.actualObject.parentId&&(l=this.diagram.getObject(this.diagram.selectedObject.actualObject.parentId))&&l.isLane&&(this.commandHandler.isContainer=!0),(r=this.diagram.lineRoutingModule&&this.diagram.nameTable.helper&&this.eventArgs.target&&this.eventArgs.target.isLane&&(this.eventArgs.source instanceof qIi&&0<this.eventArgs.source.nodes.length&&""===this.eventArgs.source.nodes[0].parentId||""===this.eventArgs.source.parentId))&&(this.diagram.diagramActions=this.diagram.diagramActions|ryi.PreventLaneContainerUpdate),this.tool.mouseUp(this.eventArgs,s.isPreventHistory);else{if(this.diagram.selectedItems.canToggleSelection){var h=void 0,d=void 0;if(0<this.diagram.selectedItems.nodes.length)for(var p=0;p<this.diagram.selectedItems.nodes.length;p++)this.diagram.selectedItems.nodes[parseInt(p.toString(),10)].isLane||this.diagram.selectedItems.nodes[parseInt(p.toString(),10)].isPhase||this.diagram.selectedItems.nodes[parseInt(p.toString(),10)].parentObj instanceof RIi||this.diagram.selectedItems.nodes[parseInt(p.toString(),10)].parentObj instanceof VIi||(h=""!==this.diagram.selectedItems.nodes[parseInt(p.toString(),10)].parentId);for(var c=this.diagram.selectedItems.nodes,p=0;p<i.length;p++)(1<i.length&&c[0].id===i[parseInt(p.toString(),10)].id||0<n.length)&&(d=!0);!this.isSwimlaneSelected&&!g&&!d&&this.tool instanceof Wwi&&"Select"===this.currentAction&&(!h||0<this.diagram.selectedItems.connectors.length)&&this.commandHandler.clearSelection(!0)}this.isSwimlaneSelected=!1,this.tool.mouseUp(this.eventArgs),!this.diagram.checkMenu||-1===window.navigator.userAgent.indexOf("Linux")&&-1===window.navigator.userAgent.indexOf("X11")||(!e.pageY&&e instanceof TouchEvent&&e.changedTouches?(window.getSelection().removeAllRanges(),this.diagram.contextMenuModule.contextMenu.open(e.changedTouches[0].pageY,e.changedTouches[0].pageX,this.diagram.element),e.preventDefault()):this.diagram.contextMenuModule.contextMenu.open(e.pageY,e.pageX,this.diagram.element),this.diagram.checkMenu=!1)}s.hasStack&&this.diagram.endGroupAction()}if(a&&this.diagram.endGroupAction(),this.updateContainerBounds(!0),2!==this.eventArgs.clickCount&&(this.commandHandler.updateSelectedNodeProperties(this.eventArgs.source),r)){this.diagram.diagramActions=this.diagram.diagramActions&~ryi.PreventLaneContainerUpdate;var u=this.eventArgs.source instanceof qIi?this.eventArgs.source.nodes:[this.eventArgs.source];if(u)for(p=0;p<u.length;p++)u[parseInt(p.toString(),10)].container||(this.commandHandler.dropChildToContainer(this.eventArgs.target,u[parseInt(p.toString(),10)]),this.commandHandler.renderContainerHelper(u[parseInt(p.toString(),10)]))}this.diagram.selectedObject&&this.diagram.selectedObject.helperObject&&(l=this.isSwimlaneChild(this.diagram.selectedObject.actualObject),g=this.diagram.selectedObject.actualObject&&this.diagram.selectedObject.actualObject.width===this.diagram.selectedObject.helperObject.width&&this.diagram.selectedObject.actualObject.height===this.diagram.selectedObject.helperObject.height,this.diagram.remove(this.diagram.selectedObject.helperObject),this.commandHandler.isTargetSubProcess(this.diagram.selectedObject.actualObject)&&""===this.diagram.selectedObject.actualObject.parentId&&this.swapProcessChildInDom(this.diagram.element.id+"_diagramLayer",this.diagram.selectedObject.actualObject),this.diagram.selectedObject={helperObject:void 0,actualObject:void 0},this.diagram.diagramActions&ryi.PublicMethod&&this.diagram.constraints&$fi.LineRouting||l&&g)&&(this.diagram.diagramActions=this.diagram.diagramActions&~ryi.PublicMethod),this.blocked=!1,this.hoverElement&&(s=Wfi.Connect,Twi(this.diagram,this.hoverElement)&&(s|=Wfi.Hover),this.diagram.updatePortVisibility(this.hoverElement,s,!0),this.hoverElement=null),this.touchStartList=null,this.touchMoveList=null,this.tool instanceof oCi||(this.tool=null)}o||e.preventDefault(),this.diagram.currentDrawingObject=void 0;var g,a=this.diagram.selectedItems,r=!1;this.commandHandler.isUserHandle(this.currentPosition)&&this.isForeignObject(e.target)&&(r=!0),!this.inAction&&a.wrapper&&0<a.userHandles.length&&!r&&this.diagram.renderSelector(!0),this.inAction||this.diagram.currentSymbol||!this.eventArgs||(g={element:(l=this.getTargetElement()).target instanceof r0i||l.target instanceof l0i||l.target instanceof _Si||l.target instanceof Bvi||l.target instanceof Rvi?l.target:this.eventArgs.source||this.diagram,position:this.eventArgs.position,count:e.detail,actualObject:this.eventArgs.actualObject,button:0===e.button?"Left":1===e.button?"Middle":"Right"},this.diagram.tool!==eyi.ZoomPan&&this.diagram.triggerEvent(dyi.click,g)),this.eventArgs={}}this.diagram.diagramActions=this.diagram.diagramActions&~ryi.PreventLaneContainerUpdate,t&&this.updateAnnotation(this.diagram.selectedItems),this.previousElement=null,this.eventArgs={},this.diagram.commandHandler.removeStackHighlighter()}},BEi.prototype.isSwimlaneChild=function(e){return!(!e.shape||"SwimLane"===e.shape.type)&&!!(e=this.diagram.nameTable[e.parentId])&&(e=e.parentId?this.diagram.nameTable[e.parentId]:e)&&e.shape&&"SwimLane"===e.shape.type},BEi.prototype.updateAnnotation=function(e){var t=e.nodes;if(0<t.length)for(var i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];this.diagram.updateConnectorEdges(n)}},BEi.prototype.swapProcessChildInDom=function(e,t){var i=document.getElementById(e);if(t.shape.activity.subProcess.processes)for(var n=0;n<t.shape.activity.subProcess.processes.length;n++){var o=document.getElementById(t.shape.activity.subProcess.processes[parseInt(n.toString(),10)]+"_groupElement");o&&i.appendChild(o)}},BEi.prototype.getTargetElement=function(){var e,t=this.objectFinder.findObjectsUnderMouse(this.currentPosition,this.diagram,this.eventArgs,null,this.action),t=this.objectFinder.findObjectUnderMouse(this.diagram,t,this.action,this.inAction,this.eventArgs,this.currentPosition);if("None"!==this.previousAction&&this.diagram.selectedItems.userHandles)for(var i=0;i<this.diagram.selectedItems.userHandles.length;i++){var n=this.diagram.selectedItems.userHandles[parseInt(i.toString(),10)];this.previousAction===n.name&&(e=n)}var o=null;return null!==t&&(o=this.diagram.findElementUnderMouse(t,this.currentPosition,this.diagram))&&(e=this.commandHandler.findTarget(o,t)),{obj:t,sourceElement:o,target:e}},BEi.prototype.getConnectorPadding=function(e){var t,e=e.source;return e&&e instanceof qIi&&e.connectors.length?t=(t=e.connectors[0]).constraints&Yfi.ConnectToNearByPort?t.connectionPadding:0:e&&e instanceof ISi&&"PortDraw"===this.action&&this.tool instanceof tCi&&e.constraints&Yfi.ConnectToNearByPort&&(t=e.connectionPadding),t||0},BEi.prototype.addSwimLaneObject=function(e){var t,i,n,o=0,r=e.shape,s=this.objectFinder.findObjectsUnderMouse(this.currentPosition,this.diagram,this.eventArgs,null,this.action),a=a||this.diagram.findObjectUnderMouse(s,this.action,this.inAction);if(this.diagram.clearSelectorLayer(),a&&!(a.isLane||a.isPhase||a.isHeader))for(var l=0;l<s.length;l++){var h=this.diagram.nameTable[s[parseInt(l.toString(),10)].id];(h.isLane||h.isPhase||h.isHeader)&&(a=h)}a&&(r.isPhase||r.isLane&&a.isLane)&&(n=a.parentId,n=this.diagram.nameTable[""+n]);var d,p,c=null;n&&(t=n.shape,d=r.isLane?r.orientation===t.orientation:r.orientation!==t.orientation,r.isLane)&&r.orientation!==t.orientation&&(d=!0,c="Horizontal"===r.orientation?"height":"width"),d&&a?(t&&t.header&&t.hasHeader&&"Horizontal"===t.orientation&&(o=1),0<t.phases.length&&(o+=1),r.isPhase?(d="Horizontal"===t.orientation?this.currentPosition.x-n.wrapper.bounds.x:this.currentPosition.y-(n.wrapper.bounds.y+(t.hasHeader?t.header.height:0)),d={id:xTi(),offset:d,header:{annotation:{content:void 0===r.phases[0].header?"Phase":r.phases[0].header.annotation.content,style:void 0===r.phases[0].header?{}:r.phases[0].header.annotation.style}},style:void 0===r.phases[0]?{}:r.phases[0].style},this.diagram.addPhases(n,[d])):(d={id:xTi(),style:r.lanes[0].style,canMove:r.lanes[0].canMove,header:{annotation:{content:r.lanes[0].header.annotation.content,style:r.lanes[0].header.annotation.style},style:r.lanes[0].header.style}},"Horizontal"===r.orientation?d.height=r.lanes[0].height:d.width=r.lanes[0].width,"Horizontal"===t.orientation?(i=a.rowIndex||this.diagram.nameTable[a.parentId].rowIndex,a.wrapper.offsetY<this.currentPosition.y&&(i+=1)):(i=a.columnIndex||this.diagram.nameTable[a.parentId].columnIndex,this.currentPosition.x<a.wrapper.bounds.center.x&&--i),t.lanes.length>i?(d.header.width=t.lanes[parseInt(i.toString(),10)].header.width,d.header.height=t.lanes[parseInt(i.toString(),10)].header.height):(p=void 0,p="Horizontal"===t.orientation?a.rowIndex<3?0:i-o-1:i-1,d.header.width=t.lanes[parseInt(p.toString(),10)].header.width,d.header.height=t.lanes[parseInt(p.toString(),10)].header.height),c&&("height"===c?(d.width=d.height,delete d.height):(d.height=d.width,delete d.width)),this.diagram.addLanes(n,[d],"Horizontal"===t.orientation?i-o:i)),this.commandHandler.select(n)):r.isLane&&(p={id:xTi(),width:e.width,height:e.height,addInfo:e.addInfo,shape:{type:"SwimLane",header:{annotation:{content:void 0===r.header?"Header":r.header.annotation.content,style:void 0===r.header?{}:r.header.annotation.style},height:50,style:(r.header?r:r.lanes[0]).header.style},phases:[{id:xTi(),header:{annotation:{content:void 0===r.phases||void 0===r.phases[0].header?"Phase":r.phases[0].header.annotation.content,style:void 0===r.phases||void 0===r.phases[0].header?{}:r.phases[0].header.annotation.style},style:void 0===r.phases||void 0===r.phases[0].header?{}:r.phases[0].header.style},style:void 0===r.phases?{}:r.phases[0].style}],lanes:[{id:xTi(),height:e.height,width:e.width,style:r.lanes[0].style,canMove:r.lanes[0].canMove,header:{annotation:{content:r.lanes[0].header.annotation.content,style:r.lanes[0].header.annotation.style},style:r.lanes[0].header.style}}],orientation:r.orientation}},"Vertical"===r.orientation&&(p.width+=20),p.offsetX=this.currentPosition.x+p.width/2,p.offsetY=this.currentPosition.y+p.height/2,p.style=e.style,this.diagram.add(p))},BEi.prototype.mouseLeave=function(e){this.tool&&this.inAction&&this.tool.mouseLeave(this.eventArgs),this.diagram.selectedObject.helperObject&&(this.updateContainerProperties(),this.updateContainerBounds())&&this.diagram.endGroupAction(),this.eventArgs&&this.eventArgs.source&&(this.diagram.updatePortVisibility(this.eventArgs.source,Wfi.Hover,!0),this.hoverElement=null),this.eventArgs&&!this.eventArgs.source&&this.hoverElement&&(this.hoverElement=null),this.tool instanceof Hwi&&this.eventArgs&&this.eventArgs.target&&this.eventArgs.target instanceof MIi&&(this.diagram.updatePortVisibility(this.eventArgs.target,Wfi.Hover|Wfi.Connect,!0),this.hoverElement=null);var t=this.diagram.selectedItems;t&&t.wrapper&&(O1i(this.diagram,t)||this.diagram.renderSelector(!0)),(this.diagram.diagramActions&ryi.Interactions||this.diagram.diagramActions&ryi.ToolAction)&&(this.diagram.diagramActions=this.diagram.diagramActions&~ryi.ToolAction),this.isMouseDown=!1,this.focus=!1,this.touchStartList=null,this.touchMoveList=null,this.elementLeave(),this.commandHandler.removeSnap(),this.inAction=!1,this.eventArgs={},this.diagram.selectedObject&&this.diagram.selectedObject.helperObject&&(this.diagram.remove(this.diagram.selectedObject.helperObject),this.diagram.selectedObject={helperObject:void 0,actualObject:void 0}),this.tool=null;var i,n,o=document.getElementsByClassName("e-d-ruler-marker");if(o&&0<o.length)for(n=o.length-1;0<=n;n--)(i=o[parseInt(n.toString(),10)])&&i.parentNode.removeChild(i);"Rotate"===this.action&&this.diagram.diagramCanvas.classList.remove("e-diagram-rotate"),e.preventDefault()},BEi.prototype.mouseWheel=function(e){this.diagram.blazorActions|=zfi.interaction;var t,i,n,o,r,s={event:e,cancel:!1};this.diagram.triggerEvent(dyi.mouseWheel,s),s.cancel||(s=0<e.wheelDelta||0<-40*e.detail,t=this.getMousePosition(e),this.diagram.tooltipObject.close(),this.isMetaKey(e)?(i=this.diagram.scrollSettings.zoomFactor,s?this.diagram.zoomTo({type:"ZoomIn",zoomFactor:i,focusPoint:t}):this.diagram.zoomTo({type:"ZoomOut",zoomFactor:i,focusPoint:t}),e.preventDefault()):(i=this.diagram.scroller.horizontalOffset,n=this.diagram.scroller.verticalOffset,s=s?10:-10,this.tool&&(this.tool instanceof fCi||this.tool instanceof bCi)&&(this.eventArgs={},this.getMouseEventArgs(t,this.eventArgs),this.eventArgs.position=t,this.tool.mouseWheel(this.eventArgs)),this.diagram.scrollActions|=lyi.Interaction,e.isTrusted?(o=!1,(Math.abs(e.deltaY)<100&&-0===Math.abs(e.deltaX)||Math.abs(e.deltaX)<100&&-0===Math.abs(e.deltaY))&&(o=!0),r=!1,(r=0===e.deltaX&&0===e.deltaY?r:navigator.userAgent.includes("Macintosh"))?Math.abs(e.deltaX)>Math.abs(e.deltaY)?(e.shiftKey||e.deltaX&&-0!==e.deltaX&&(o||!r))&&this.diagram.scroller.zoom(1,s,0,t,!0,void 0,o):!e.deltaY||-0===e.deltaY||!o&&r||this.diagram.scroller.zoom(1,0,s,t,!0,void 0,o):e.shiftKey||e.deltaX&&-0!==e.deltaX&&(o||!r)?this.diagram.scroller.zoom(1,s,0,t,!0,void 0,o):!e.deltaY||-0===e.deltaY||!o&&r||this.diagram.scroller.zoom(1,0,s,t,!0,void 0,o)):e.shiftKey||e.deltaX&&-0!==e.deltaX?this.diagram.scroller.zoom(1,s,0,t,!0):this.diagram.scroller.zoom(1,0,s,t,!0),this.diagram.scrollActions&=~lyi.Interaction,i===this.diagram.scroller.horizontalOffset&&n===this.diagram.scroller.verticalOffset||e.preventDefault()),this.diagram.textEditing&&(this.diagram.isTriggerEvent=!0,this.diagram.activeLabel.parentId&&(r=this.diagram.getObject(this.diagram.activeLabel.parentId),this.diagram.startTextEdit(r,this.diagram.activeLabel.id)),this.diagram.isTriggerEvent=!1),this.diagram.blazorActions=this.diagram.blazorActions&~zfi.interaction)},BEi.prototype.keyDown=function(e){if(e.fromMouseEvents&&(e.ctrlKey&&(this.keyArgs.keyModifiers=1),e.shiftKey&&(this.keyArgs.keyModifiers=4),e.shiftKey)&&e.ctrlKey&&(this.keyArgs.keyModifiers=5),!(this.diagram.diagramActions&ryi.TextEdit)&&!this.checkEditBoxAsTarget(e)||"Escape"===e.key||27===e.keyCode){var t=e.keyCode||e.which,i=e.key,n=("ArrowDown"!==i&&"ArrowUp"!==i&&"ArrowLeft"!==i&&"ArrowRight"!==i||(this.isNudgeKey=!0),this.isMetaKey(e));if(this.diagram.commandManager&&this.diagram.commands)for(var o=this.diagram.commands,r=0,s=Object.keys(o);r<s.length;r++){var a=s[r],l=this.diagram.commands[""+a];if(l&&(l.gesture.keyModifiers||l.gesture.key)&&(t===l.gesture.key||oyi[l.gesture.key]&&i===oyi[l.gesture.key]||i===oyi[l.gesture.key].split("Number")[1]||this.isDeleteKey(i,a))&&(!l.gesture.keyModifiers&&!e.altKey&&!e.shiftKey&&!n||l.gesture.keyModifiers&&(n||e.altKey||e.shiftKey)&&this.altKeyPressed(l.gesture.keyModifiers)&&e.altKey||this.shiftKeyPressed(l.gesture.keyModifiers)&&e.shiftKey||this.ctrlKeyPressed(l.gesture.keyModifiers)&&n&&this.keyArgs.keyModifiers===l.gesture.keyModifiers)){var a=jTi(l.canExecute);if(N||a&&a({keyDownEventArgs:KeyboardEvent,parameter:l.parameter})){e.preventDefault(),"Escape"===e.key&&(this.checkEditBoxAsTarget(e)?document.getElementById(this.diagram.diagramCanvas.id).focus():this.diagram.currentSymbol?(this.diagram.removeFromAQuad(this.diagram.currentSymbol),this.diagram.removeObjectsFromLayer(this.diagram.nameTable[this.diagram.currentSymbol.id]),this.diagram.removeElements(this.diagram.currentSymbol),(a=this.diagram.currentSymbol)instanceof MIi&&"Bpmn"===a.shape.type&&"TextAnnotation"===a.shape.shape&&this.diagram.removeDependentConnector(a),VAi(this.diagram.currentSymbol,this.diagram),delete this.diagram.nameTable[this.diagram.currentSymbol.id],this.diagram.droppable.sourceElement.draggable.intDestroy(),(a=this.diagram.droppable.selectedSymbols).parentNode.removeChild(a),a=this.diagram.diagramActions,this.diagram.diagramActions=this.diagram.addConstraints(a,ryi.PreventClearSelection),this.tool.mouseUp(this.eventArgs),this.diagram.diagramRenderer.rendererActions=this.diagram.removeConstraints(this.diagram.diagramRenderer.rendererActions,syi.DrawSelectorBorder),this.diagram.previousSelectedObject&&this.diagram.select(this.diagram.previousSelectedObject),this.action="Select",this.diagram.previousSelectedObject=null,this.diagram.currentSymbol=null,this.diagram.diagramActions=this.diagram.removeConstraints(a,ryi.PreventClearSelection),this.isMouseDown=!1):this.inAction&&this.diagram.drawingObject&&this.tool&&this.tool.inAction&&(this.tool.mouseUp(this.eventArgs),this.tool=null,this.isMouseDown=!1)),l.execute&&(this.commandObj=l,this.diagram.tool!==eyi.ZoomPan)&&(a=jTi(l.execute),this.isNudgeKey?(this.isKeyUp||(this.keyArgs.oldValue={offsetX:this.diagram.selectedItems.offsetX,offsetY:this.diagram.selectedItems.offsetY},this.keyCount++,4<this.keyCount&&(a({keyDownEventArgs:KeyboardEvent,parameter:l.parameter,type:"KEYDOWN"}),this.keyCount=0,this.keyArgs.newValue={offsetX:this.diagram.selectedItems.offsetX,offsetY:this.diagram.selectedItems.offsetY},this.diagram.triggerEvent(dyi.positionChange,this.keyArgs))),this.isKeyUp=!1):a({keyDownEventArgs:KeyboardEvent,parameter:l.parameter}));break}}}}this.diagram.selectedItems.nodes.length?this.diagram.selectedItems.nodes:this.diagram.selectedItems.connectors;o=this.diagram.selectedItems;this.keyArgs={element:o,key:e.key,keyCode:e.keyCode||e.which},this.getKeyModifier(this.keyArgs,e),this.diagram.diagramActions&ryi.TextEdit&&this.getlabel(this.keyArgs,e),this.diagram.triggerEvent(dyi.keyDown,this.keyArgs)},BEi.prototype.getlabel=function(e,t){var i=this.diagram.activeLabel,n=(e.target=this.diagram.element.id+"_editBox",this.diagram.nameTable[i.parentId]);if(document.getElementById(this.diagram.element.id+"_editBox")){e.text=document.getElementById(this.diagram.element.id+"_editBox").value;for(var o=0;o<n.annotations.length;o++)if(n.annotations[parseInt(o.toString(),10)].id===i.id){e.label=n.annotations[parseInt(o.toString(),10)];break}}},BEi.prototype.getKeyModifier=function(e,t){e.keyModifiers=nyi.None,t.ctrlKey&&(e.keyModifiers|=nyi.Control),t.shiftKey&&(e.keyModifiers|=nyi.Shift),t.altKey&&(e.keyModifiers|=nyi.Alt),this.isMetaKey(t)&&(e.keyModifiers|=nyi.Meta)},BEi.prototype.keyUp=function(e){var t=this.diagram.selectedItems;this.keyArgs={element:t,key:e.key,keyCode:e.keyCode||e.which,oldValue:{offsetX:t.offsetX,offsetY:t.offsetY},newValue:{offsetX:t.offsetX,offsetY:t.offsetY}},this.diagram.selectedItems.nodes.length?this.diagram.selectedItems.nodes:this.diagram.selectedItems.connectors;this.getKeyModifier(this.keyArgs,e),this.diagram.diagramActions&ryi.TextEdit&&this.getlabel(this.keyArgs,e),this.diagram.triggerEvent(dyi.keyUp,this.keyArgs),!this.isKeyUp&&this.isNudgeKey&&(jTi(this.commandObj.execute)({keyDownEventArgs:KeyboardEvent,parameter:this.commandObj.parameter,type:"KEYUP"}),this.keyArgs.newValue={offsetX:this.diagram.selectedItems.offsetX,offsetY:this.diagram.selectedItems.offsetY},this.diagram.triggerEvent(dyi.positionChange,this.keyArgs),this.isNudgeKey=!1,this.keyCount=0)},BEi.prototype.startAutoScroll=function(e){var t,i,e=this.getMousePosition(e),n=(e.x*=this.diagram.scroller.currentZoom,e.y*=this.diagram.scroller.currentZoom,LSi(this.diagram)),o=this.diagram.scrollSettings.autoScrollBorder;return"mozilla"===F.info.name&&0===this.diagram.scroller.viewPortWidth&&(i=document.getElementById(this.diagram.element.id).getBoundingClientRect()).width!==this.diagram.scroller.viewPortWidth&&this.diagram.scroller.setViewPortSize(i.width,i.height),this.diagram.scrollSettings.canAutoScroll&&(e.x+this.diagram.scroller.horizontalOffset+o.right+n.width>=this.diagram.scroller.viewPortWidth-18?t="right":e.x+this.diagram.scroller.horizontalOffset<o.left?t="left":e.y+this.diagram.scroller.verticalOffset+o.bottom+n.height>this.diagram.scroller.viewPortHeight-18?t="bottom":e.y+this.diagram.scroller.verticalOffset<o.top&&(t="top")),t},BEi.prototype.doAutoScroll=function(e,t,i,n){if((this.tool instanceof Zwi||this.tool instanceof tCi||this.tool instanceof Wwi||this.tool instanceof Xwi||this.tool instanceof Lwi||this.tool instanceof Hwi)&&this.inAction){var o=this.getMousePosition(t),r=(this.diagram.scrollSettings.autoScrollBorder,0),s=0,a=!1,l="",h={x:o.x,y:o.y};switch(this.tool instanceof Xwi&&("ResizeSouthEast"===this.tool.corner||"ResizeSouthWest"===this.tool.corner||"ResizeNorthWest"===this.tool.corner||"ResizeNorthEast"===this.tool.corner)&&(a=!0,l=this.tool.corner),e){case"right":h.x=o.x+10,r=10,a&&(s="ResizeSouthEast"===l?(h.y=o.y+10,10):(h.y=o.y-10,-10));break;case"left":h.x=o.x-10,r=-10,a&&(s="ResizeNorthWest"===l?(h.y=o.y-10,-10):(h.y=o.y+10,10));break;case"bottom":h.y=o.y+10,s=10,a&&(r="ResizeSouthEast"===l?(h.x=o.x+10,10):(h.x=o.x-10,-10));break;case"top":h.y=o.y-10,s=-10,a&&(r="ResizeNorthEast"===l?(h.x=o.x+10,10):(h.x=o.x-10,-10))}this.eventArgs.position={x:h.x,y:h.y},this.currentPosition=this.eventArgs.position;t=this.objectFinder.findObjectsUnderMouse(this.currentPosition,this.diagram,this.eventArgs,null,this.action);this.eventArgs.target=this.diagram.findObjectUnderMouse(t,this.action,this.inAction),this.tool.mouseMove(this.eventArgs),this.diagram.scrollActions|=lyi.Interaction,this.diagram.scroller.zoom(1,-r,-s,o,!0),this.diagram.scrollActions&=~lyi.Interaction}},BEi.prototype.mouseEvents=function(){for(var e=this.diagram.findObjectsUnderMouse(this.currentPosition),t=0;t<e.length;t++)this.eventArgs.actualObject===e[parseInt(t.toString(),10)]&&e.splice(t,1);var i,n={targets:{}};N||(n={targets:e,element:this.eventArgs.source===this.eventArgs.actualObject?void 0:this.eventArgs.source,actualObject:this.eventArgs.actualObject}),!this.lastObjectUnderMouse||!this.diagram.mouseLeave||this.eventArgs.actualObject&&this.lastObjectUnderMouse===this.eventArgs.actualObject||(i={targets:void 0,element:this.lastObjectUnderMouse,actualObject:void 0},this.diagram.triggerEvent(dyi.mouseLeave,i),this.lastObjectUnderMouse=null),(!this.lastObjectUnderMouse&&this.eventArgs.source||this.lastObjectUnderMouse!==this.eventArgs.actualObject)&&(this.lastObjectUnderMouse=this.eventArgs.actualObject,void 0!==this.eventArgs.actualObject)&&this.diagram.triggerEvent(dyi.mouseEnter,n),this.eventArgs.actualObject&&this.diagram.triggerEvent(dyi.mouseOver,n)},BEi.prototype.elementEnter=function(e,t){var i,n;t||(t=this.hoverElement instanceof MIi&&this.hoverElement.constraints&Kfi.Tooltip||this.hoverElement instanceof ISi&&this.hoverElement.constraints&Yfi.Tooltip||(this.hoverElement instanceof r0i||this.hoverElement instanceof l0i)&&this.hoverElement.constraints&pyi.ToolTip||(this.hoverElement instanceof f0i||this.hoverElement instanceof b0i)&&this.hoverElement.constraints&Xfi.Tooltip,n=this.getContent(),i=void 0,this.hoverElement&&this.hoverElement.children&&0<this.hoverElement.children.length&&(i=this.findIntersectChild(this.hoverElement)),"Auto"===this.hoverElement.tooltip.openOn&&""!==n&&Zyi(this.diagram,i||(t?this.hoverElement:void 0)),this.hoverElement.tooltip.content&&("Mouse"===this.hoverElement.tooltip.relativeMode?this.setTooltipOffset(e):(this.diagram.tooltipObject.offsetX=0,this.diagram.tooltipObject.offsetY=0)),t=this.diagram.findObjectsUnderMouse(this.currentPosition),null!==(e=this.diagram.findObjectUnderMouse(t,this.action,this.inAction))&&(t=void 0,this.hoverElement.tooltip.isSticky&&(this.diagram.tooltipObject.isSticky=!0),t=(e=e instanceof MIi&&e.children&&0<e.children.length?i||e:e).ports&&(this.hoverElement instanceof r0i||this.hoverElement instanceof l0i)||e.annotations&&(this.hoverElement instanceof f0i||this.hoverElement instanceof b0i)?document.getElementById(e.id+"_"+this.hoverElement.id):(i=e.shape&&e.shape instanceof axi?"_content_native_element":"_groupElement",document.getElementById(e.id+i)),"Auto"===this.hoverElement.tooltip.openOn&&""!==n&&(this.diagram.tooltipObject.close(),this.diagram.tooltipObject.openOn=this.hoverElement.tooltip.openOn,this.diagram.tooltipObject.dataBind()),e=this.hoverElement,i=this.diagram,n=0,e instanceof ISi?e.constraints&Yfi.Tooltip?n=e.constraints&Yfi.Tooltip:e.constraints&Yfi.InheritTooltip&&(n=i.constraints&$fi.Tooltip):e instanceof r0i||e instanceof l0i?e.constraints&pyi.ToolTip?n=e.constraints&pyi.ToolTip:e.constraints&pyi.InheritTooltip&&(n=i.constraints&$fi.Tooltip):e instanceof f0i||e instanceof b0i?e.constraints&Xfi.Tooltip&&(n=e.constraints&Xfi.Tooltip):e.constraints&Kfi.Tooltip?n=e.constraints&Kfi.Tooltip:e.constraints&Kfi.InheritTooltip&&(n=i.constraints&$fi.Tooltip),n)&&"Auto"===this.hoverElement.tooltip.openOn&&(this.diagram.tooltipObject.target=this.hoverElement.id,"Mouse"===this.hoverElement.tooltip.relativeMode?this.diagram.tooltipObject.open(this.diagram.element):this.diagram.tooltipObject.open(t)))},BEi.prototype.elementLeave=function(){this.diagram.tooltipObject&&!this.diagram.tooltipObject.isSticky&&"Custom"!==this.diagram.tooltipObject.openOn&&this.diagram.tooltipObject.close()},BEi.prototype.setTooltipOffset=function(e){e=this.updatePointBasedOnScale(e),e=TAi(this.diagram,e,this.hoverElement);this.diagram.tooltipObject.offsetX=e.x,this.diagram.tooltipObject.offsetY=e.y},BEi.prototype.updatePointBasedOnScale=function(e){var t=this.diagram.scaleValue;return{x:e.x*t,y:e.y*t}},BEi.prototype.altKeyPressed=function(e){return!!(e&nyi.Alt)},BEi.prototype.ctrlKeyPressed=function(e){return!!(e&nyi.Control)},BEi.prototype.shiftKeyPressed=function(e){return!!(e&nyi.Shift)},BEi.prototype.scrolled=function(e){this.diagram.updateScrollOffset()},BEi.prototype.isMobileOrIPadDevice=function(){var e=navigator.userAgent||navigator.vendor||window.opera;return"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints?"iOS (iPad)":/iPhone|iPad|iPod/.test(e)&&!window.MSStream?"iOS":/android/i.test(e)?"Android":/Mobile|Tablet/.test(e)?"Mobile":"Desktop"},BEi.prototype.doubleClick=function(e){var t,i,n;obi(this.diagram)&&(i=this.isMobileOrIPadDevice(),n=this.diagram.tool,i=void("Desktop"!==i&&this.tool&&(this.tool instanceof fCi||this.tool instanceof bCi)&&(this.diagram.tool=0)),t=this.diagram.findObjectsUnderMouse(this.currentPosition),null!==(t=this.diagram.findObjectUnderMouse(t,this.action,this.inAction))&&obi(this.diagram)&&(i=this.diagram.findElementUnderMouse(t,this.currentPosition,this.diagram),this.tool&&(this.tool instanceof fCi||this.tool instanceof bCi)?(this.currentPosition,e.detail,this.diagram.tool=n,this.tool.mouseUp(this.eventArgs),this.isMouseDown=!1,this.eventArgs={},this.tool=null,e.preventDefault()):!(n=this.diagram.commandHandler.getObjectLayer(t.id))||n.lock||!n.visible||this.diagram.diagramActions&ryi.TextEdit||this.diagram.startTextEdit(t,i instanceof Tyi?i.id.split(t.id+"_")[1]:void 0)),n={source:t||this.diagram,position:this.currentPosition,count:e.detail},this.diagram.triggerEvent(dyi.doubleClick,n))},BEi.prototype.itemClick=function(e,t){return pwi(this.diagram,e,!0)?e:null},BEi.prototype.inputChange=function(e){var t,i,n=document.getElementById(this.diagram.element.id+"_editBox"),o=document.getElementById(this.diagram.element.id+"_editTextBoxDiv"),r=n.value,s=r.split("\n"),a=this.diagram.selectedItems.nodes[0]||this.diagram.selectedItems.connectors[0];(a=!a&&this.tool instanceof oCi||a&&"SwimLane"===a.shape.type?this.diagram.nameTable[this.diagram.activeLabel.parentId]:a)&&("Text"!==a.shape.type&&0<a.annotations.length||"Text"===a.shape.type)&&(t=this.diagram.getWrapper(a.wrapper,this.diagram.activeLabel.id),a=(a.wrapper.bounds.width<t.bounds.width?a.wrapper:t).bounds.width,r=KIi(t.style,r,void 0,void 0,90<a?a:90),a=Number(n.style.fontSize.split("px")[0]),1<s.length&&""===s[s.length-1]&&(r.height=r.height+a),s=this.diagram.scroller.transform,a=rbi(this.diagram)?s.scale:1,i=r.width,r=(r.height<12?12:r.height)*a,o.style.left=(t.bounds.center.x+s.tx)*s.scale-(i=(i<90?90:i)*a)/2-2.5+"px",o.style.top=(t.bounds.center.y+s.ty)*s.scale-r/2-3+"px",o.style.width=i+"px",o.style.height=r+"px",n.style.minHeight="12px",n.style.minWidth="90px",n.style.width=i+"px",n.style.height=r+"px")},BEi.prototype.isAddTextNode=function(e,t){return!!(this.tool instanceof oCi||t)&&(this.tool=null,e&&!tbi(this.diagram)&&(this.diagram.drawingObject=void 0,this.diagram.currentDrawingObject=void 0),!c1i(this.diagram.nodes,e.id))&&!c1i(this.diagram.connectors,e.id)},BEi.prototype.checkEditBoxAsTarget=function(e){return!(!e.target||e.target.id!==this.diagram.element.id+"_editBox")},BEi.prototype.getMouseEventArgs=function(e,t,i,n){var o,r;if(t.position=e,i?(r=this.diagram.findObjectsUnderMouse(this.currentPosition,i),o=this.diagram.findTargetObjectUnderMouse(r,this.action,this.inAction,t.position,i)):("Drag"!==this.action&&"ConnectorSourceEnd"!==this.action&&"SegmentEnd"!==this.action&&"OrthoThumb"!==this.action&&"BezierSourceThumb"!==this.action&&"BezierTargetThumb"!==this.action&&"ConnectorTargetEnd"!==this.action&&-1===this.action.indexOf("Rotate")&&-1===this.action.indexOf("Resize")||(o=this.diagram.selectedItems,!this.diagram.currentSymbol&&"Drag"===this.action&&o&&0<this.diagram.selectedItems.nodes.length&&"SwimLane"===this.diagram.selectedItems.nodes[0].shape.type))&&(r=this.diagram.findObjectsUnderMouse(this.currentPosition),o=this.diagram.findObjectUnderMouse(r,this.action,this.inAction)),o&&o.isHeader&&(o=this.diagram.nameTable[o.parentId],this.eventArgs.actualObject=o),o){var s,a,l=void 0,h=void 0;if(((s=this.diagram.findElementUnderMouse(o,this.currentPosition,this.diagram,n))&&o.ports&&o.ports.length&&!E1i(o,s)||!s||!o)&&r&&r.length&&i instanceof qIi)for(a=i.connectors[0],h=r.length-1;0<=h;h--)if(((l=r[parseInt(h.toString(),10)])instanceof MIi||l instanceof ISi)&&a&&a.connectionPadding){if(o=l,s=this.diagram.findElementUnderMouse(o,this.currentPosition,this.diagram,n),a.constraints&Yfi.ConnectToNearByPort&&o&&o.ports&&o.ports.length&&E1i(o,s))break;if((l instanceof MIi||l instanceof ISi)&&a&&a.connectionPadding&&l.wrapper.outerBounds.containsPoint(this.currentPosition)&&a.constraints&Yfi.ConnectToNearByNode&&!(a.constraints&Yfi.ConnectToNearByPort)){o=l,s=this.diagram.findElementUnderMouse(o,this.currentPosition,this.diagram,0);break}}}return i?(t.target=o,t.targetWrapper=s):(t.source=o,t.sourceWrapper=s),t.actualObject=this.eventArgs.actualObject,t.source instanceof qIi&&void 0===t.actualObject&&(0<t.source.nodes.length||0<t.source.connectors.length)&&(t.actualObject=0<t.source.nodes.length?this.diagram.nameTable[t.source.nodes[0].id]:this.diagram.nameTable[t.source.connectors[0].id]),t.startTouches=this.touchStartList,t.moveTouches=this.touchMoveList,t},BEi.prototype.resetTool=function(){this.action="Select",this.hoverElement=null,this.hoverNode=null,this.tool=this.diagram.getTool(this.action),this.updateCursor()},BEi.prototype.updateTool=function(){var e,t,i;this.currentPosition?(e=this.diagram.findObjectsUnderMouse(this.currentPosition),i=void 0,(t=(t=null)!==(e=this.diagram.findObjectUnderMouse(e,this.action,this.inAction))?this.diagram.findElementUnderMouse(e,this.currentPosition,this.diagram):t)&&(i=this.commandHandler.findTarget(t,e)),this.action=this.diagram.findActionToBeDone(e,t,this.currentPosition,i)):this.action="Select"},BEi.prototype.getTool=function(e){switch(e){case"Select":return new Lwi(this.commandHandler,!0);case"Drag":return new Wwi(this.commandHandler);case"Rotate":return new qwi(this.commandHandler);case"LayoutAnimation":return new dCi(this.commandHandler);case"FixedUserHandle":return new Nwi(this.commandHandler,!0);case"Hyperlink":return new uCi(this.commandHandler);case"ResizeSouthEast":case"ResizeSouthWest":case"ResizeNorthEast":case"ResizeNorthWest":case"ResizeSouth":case"ResizeNorth":case"ResizeWest":case"ResizeEast":return new Xwi(this.commandHandler,e);case"ConnectorSourceEnd":case"ConnectorTargetEnd":case"BezierSourceThumb":case"BezierTargetThumb":return new Hwi(this.commandHandler,e);case"SegmentEnd":case"OrthoThumb":return new MEi(this.commandHandler,e);case"Draw":var t=hAi(this.diagram.drawingObject);if("Node"===t&&"Text"===this.diagram.drawingObject.shape.type)return new oCi(this.commandHandler);if("Connector"===t&&"Freehand"===this.diagram.drawingObject.type)return new PCi(this.commandHandler);if("Node"===t&&"Polygon"===this.diagram.drawingObject.shape.shape&&!this.diagram.drawingObject.shape.points)return new fCi(this.commandHandler);if("Node"===t)return new Zwi(this.commandHandler,this.diagram.drawingObject);if("Connector"===t&&"Polyline"===this.diagram.drawingObject.type)return new bCi(this.commandHandler);if("Connector"===t)return new tCi(this.commandHandler,"ConnectorSourceEnd",this.diagram.drawingObject);break;case"Pan":return new aCi(this.commandHandler,!1);case"PinchZoom":return new aCi(this.commandHandler,!0);case"PortDrag":return new Wwi(this.commandHandler,"Port");case"PortDraw":return new tCi(this.commandHandler,"ConnectorSourceEnd",this.diagram.drawingObject);case"LabelSelect":return new Lwi(this.commandHandler,!0,"LabelSelect");case"LabelDrag":return new SCi(this.commandHandler);case"LabelResizeSouthEast":case"LabelResizeSouthWest":case"LabelResizeNorthEast":case"LabelResizeNorthWest":case"LabelResizeSouth":case"LabelResizeNorth":case"LabelResizeWest":case"LabelResizeEast":return new ICi(this.commandHandler,e);case"LabelRotate":return new DCi(this.commandHandler)}return null},BEi.prototype.getCursor=function(e){var t=this.diagram.selectedItems.annotation?this.diagram.selectedItems.wrapper.children[0]:this.diagram.selectedItems;return Ewi(e,this.diagram.selectedItems.annotation?t.rotateAngle+t.parentTransform:t.rotateAngle)},BEi.prototype.findElementUnderMouse=function(e,t,i,n){return this.objectFinder.findElementUnderSelectedItem(e,t,i,n)},BEi.prototype.findObjectsUnderMouse=function(e,t){return this.objectFinder.findObjectsUnderMouse(e,this.diagram,this.eventArgs,t)},BEi.prototype.findObjectUnderMouse=function(e,t,i){return this.objectFinder.findObjectUnderMouse(this.diagram,e,t,i,this.eventArgs,this.currentPosition)},BEi.prototype.findTargetUnderMouse=function(e,t,i,n,o){return this.objectFinder.findObjectUnderMouse(this.diagram,e,t,i,this.eventArgs,n,o)},BEi.prototype.findActionToBeDone=function(e,t,i,n){return Cwi(e,t,this.currentPosition,this.diagram,this.touchStartList,this.touchMoveList,n)},BEi.prototype.updateContainerBounds=function(e){var t=!1;if(this.diagram.selectedObject.helperObject&&this.diagram.selectedObject.actualObject)for(var i=this.diagram.selectedObject.actualObject,n=this.diagram.selectedObject.actualObject instanceof qIi?i.nodes:[i],o=0;o<n.length;o++){var r=n[parseInt(o.toString(),10)],s=this.tool instanceof Xwi,a=this.diagram.nameTable[r.parentId];e?awi(this.diagram,r,this.currentPosition,s):(a&&"SwimLane"===a.shape.type||this.diagram.updateDiagramObject(r),t=swi(this.diagram,r,this.currentPosition,s),this.diagram.updateSelector(),(r.isLane||r.isPhase)&&(this.diagram.clearSelection(),this.commandHandler.selectObjects([r])))}return t},BEi.prototype.updateContainerProperties=function(){var e,t=!1,i=!1,n={hasStack:!1,isPreventHistory:!1};if(this.diagram.selectedObject.helperObject){var o,r=this.diagram.findObjectsUnderMouse(this.currentPosition),r=this.diagram.findObjectUnderMouse(r,this.action,this.inAction),s=this.diagram.selectedObject.helperObject;if((o=this.diagram.selectedObject.actualObject)instanceof MIi){if("SwimLane"===o.shape.type&&(e=kbi(this.diagram,o.wrapper.children[0])),"SwimLane"!==o.shape.type&&o.parentId&&"SwimLane"===this.diagram.getObject(o.parentId).shape.type&&r instanceof MIi&&this.diagram.getObject(r.parentId)&&"SwimLane"!==this.diagram.getObject(r.parentId).shape.type&&(r=this.diagram.getObject(r.parentId)),"Drag"===this.currentAction&&o.container&&"Canvas"===o.container.type&&o.parentId&&"SwimLane"===this.diagram.getObject(o.parentId).shape.type&&r&&r.container&&"Canvas"===r.container.type&&r.isLane&&o.isLane&&r.parentId===o.parentId)r!==o&&Vbi(this.diagram,o,r,this.currentPosition),n.isPreventHistory=!0;else{if(!(A=this.diagram.nameTable[o.parentId])||"SwimLane"!==A.shape.type)if(A&&A.isLane&&o.constraints&Kfi.AllowMovingOutsideLane){var a=this.diagram.getObject(A.parentId),l=void 0,h=void 0,d=(h="Vertical"===a.shape.orientation?(l=a.wrapper.bounds.x+a.shape.phaseSize,a.wrapper.bounds.y+a.shape.header.height):(y=a.shape.header.height+a.shape.phaseSize,l=a.wrapper.bounds.x,a.wrapper.bounds.y+y),a.wrapper.bounds.bottomRight.x-l),p=a.wrapper.bounds.bottomRight.y-h;new tfi(l,h,d,p).containsPoint(this.currentPosition)&&(o.offsetX=s.offsetX,o.offsetY=s.offsetY,o.width=s.width,o.height=s.height,o.rotateAngle=s.rotateAngle)}else if(1===this.diagram.selectedItems.nodes.length)o.offsetX=s.offsetX,o.offsetY=s.offsetY,o&&o.shape&&"UmlClassifier"!==o.shape.type&&(o.width=s.width,o.height=s.height),o.rotateAngle=s.rotateAngle;else if(1<this.diagram.selectedItems.nodes.length)for(var c=s.offsetX-this.diagram.selectedItems.offsetX,u=s.offsetY-this.diagram.selectedItems.offsetY,g=s.rotateAngle-this.diagram.selectedItems.rotateAngle,m=0;m<this.diagram.selectedItems.nodes.length;m++)this.diagram.selectedItems.nodes[parseInt(m.toString(),10)].offsetX+=c,this.diagram.selectedItems.nodes[parseInt(m.toString(),10)].offsetY+=u,this.diagram.selectedItems.nodes[parseInt(m.toString(),10)].rotateAngle+=g;var f,y=void 0;if(A&&A.container&&"Stack"===A.container.type&&(this.diagram.startGroupAction(),i=!0),!r&&A&&A.container&&"Stack"===A.container.type&&"Drag"===this.action&&(y={targetIndex:void 0,target:void 0,sourceIndex:a=A.wrapper.children.indexOf(o.wrapper),source:DTi(o)},-1<a)&&((f=A.children).splice(f.indexOf(o.id),1),f=!(this.diagram.nameTable[o.id].parentId=""),A.wrapper.children.splice(a,1)),wwi(o,r,this.diagram,this.action),(A=pwi(this.diagram,o)?this.diagram.nameTable[o.parentId]:this.diagram.nameTable[o.parentId]||o)&&A.container&&"Canvas"===A.container.type&&(A.wrapper.maxWidth=A.maxWidth=A.wrapper.actualSize.width,A.wrapper.maxHeight=A.maxHeight=A.wrapper.actualSize.height,t=!0),pwi(this.diagram,o,!0)&&A&&"Canvas"===A.container.type)if(1<this.diagram.selectedItems.nodes.length)for(m=0;m<this.diagram.selectedItems.nodes.length;m++)cwi(this.diagram,this.diagram.selectedItems.nodes[parseInt(m.toString(),10)]);else cwi(this.diagram,o);else n=this.updateContainerPropertiesExtend(A,o,e,s,n);this.diagram.lineRoutingModule&&this.diagram.constraints&$fi.LineRouting&&!pwi(this.diagram,o,!0)&&(o.children&&(this.diagram.realActions|=ayi.EnableGroupAction),this.diagram.nodePropertyChange(o,{},{width:o.width,height:o.height,offsetX:o.offsetX,offsetY:o.offsetY}),o.children)&&(this.diagram.realActions&=~ayi.EnableGroupAction),o.shape.lanes&&this.updateLaneChildNode(o),t&&(A.maxWidth=A.wrapper.maxWidth=void 0,A.maxHeight=A.wrapper.maxHeight=void 0),f&&(this.diagram.nodePropertyChange(A,{},{offsetX:A.offsetX,offsetY:A.offsetY,width:A.width,height:A.height,rotateAngle:A.rotateAngle}),a={redoObject:{sourceIndex:void 0,source:y.source},type:"StackChildPositionChanged",undoObject:y,category:"Internal"},this.diagram.diagramActions&ryi.UndoRedo||this.diagram.addHistoryEntry(a)),o&&o.container&&("Stack"===o.container.type||"Canvas"===o.container.type&&""===o.parentId)&&(o&&o.shape&&"UmlClassifier"===o.shape.type&&(o.wrapper.measureChildren=!0),this.diagram.nodePropertyChange(o,{},{offsetX:o.offsetX,offsetY:o.offsetY,width:o.width,height:o.height,rotateAngle:o.rotateAngle}),o)&&o.shape&&"UmlClassifier"===o.shape.type&&(o.wrapper.measureChildren=!1)}Nbi(e,this.diagram),n.hasStack=i}else if(o instanceof qIi){var c=s.offsetX-o.offsetX,u=s.offsetY-o.offsetY,g=s.rotateAngle-o.rotateAngle,d=s.width-o.width,p=s.height-o.height,v=s.width/o.width,b=s.height/o.height;if(this.tool.corner)for(var w=this.tool.getPivot(this.tool.corner),m=0;m<o.nodes.length;m++){var C=(x=o.nodes[parseInt(m.toString(),10)]).wrapper,S=o.wrapper,S=v1i(l=S.offsetX-S.actualSize.width*S.pivot.x,h=S.offsetY-S.actualSize.height*S.pivot.y,S.actualSize.width,S.actualSize.height,S.rotateAngle,S.offsetX,S.offsetY,w);this.diagram.commandHandler.scaleObject(v,b,S,x,C,o)}else for(m=0;m<o.nodes.length;m++){var A,x=o.nodes[parseInt(m.toString(),10)];(A=this.diagram.nameTable[x.parentId])&&"SwimLane"!==A.shape.type&&pwi(this.diagram,x,!0)&&"Canvas"===A.container.type&&(x.offsetX+=c,x.offsetY+=u,x&&x.shape&&"UmlClassifier"!==x.shape.type&&(x.width+=d,x.height+=p),x.rotateAngle+=g,cwi(this.diagram,x))}}}return o&&(o.isPhase||o.isLane||o.shape&&"SwimLane"===o.shape.type)&&this.diagram.updateDiagramElementQuad(),n},BEi.prototype.updateLaneChildNode=function(e){for(var t=0;t<e.shape.lanes.length;t++)if(e.shape.lanes[parseInt(t.toString(),10)].children&&0<e.shape.lanes[parseInt(t.toString(),10)].children.length)for(var i=0;i<e.shape.lanes[parseInt(t.toString(),10)].children.length;i++){var n=e.shape.lanes[parseInt(t.toString(),10)].children[parseInt(i.toString(),10)].id,n=this.diagram.nameTable[""+n];n&&(n.offsetX=n.wrapper.offsetX,n.offsetY=n.wrapper.offsetY)}},BEi.prototype.updateContainerPropertiesExtend=function(e,t,i,n,o){var r,s,a,l,h,d,p;return"ResizeEast"!==this.currentAction&&"ResizeSouth"!==this.currentAction&&"SwimLane"!==t.shape.type||(r=DTi(t),h=!1,e&&e.container&&"Grid"===e.container.type?(s=(d="SwimLane"===e.shape.type)?e.wrapper.children[0]:e.wrapper,p=d?e.shape.padding:void 0,a=e.wrapper.bounds.x,l=e.wrapper.bounds.y,void 0!==t.columnIndex&&"Horizontal"===e.container.orientation&&(d&&t.isPhase||!d&&1===t.rowIndex)||"Vertical"===e.container.orientation&&(!d&&0<t.rowIndex&&0<t.columnIndex||d&&t.isLane)?("Horizontal"===e.container.orientation&&t.isPhase&&t.wrapper.width>t.maxWidth&&(t.maxWidth=t.wrapper.width,t.wrapper.maxWidth=t.wrapper.width),d=n.wrapper.actualSize.width-t.wrapper.actualSize.width,s.updateColumnWidth(t.columnIndex,n.width,!0,p),Hbi(this.diagram,t,e,n,d),t.isPhase&&(d=e.shape.phases[t.columnIndex].header.id,(d=this.diagram.nameTable[""+d]).maxWidth<n.width)&&(d.maxWidth=n.width,d.wrapper.maxWidth=n.width),"SwimLane"===e.shape.type&&(e.width=e.width&&s.width,Qbi(this.diagram,e),e.wrapper.width=e.width,i=kbi(this.diagram,s,t.rowIndex))):void 0!==t.rowIndex&&(d=n.wrapper.actualSize.height-t.wrapper.actualSize.height,s.updateRowHeight(t.rowIndex,n.height,h=!0,p),Hbi(this.diagram,t,e,n,void 0,d),"SwimLane"===e.shape.type)&&(e.height=e.height&&s.height,e.wrapper.height=e.height,i=kbi(this.diagram,s,t.rowIndex)),"SwimLane"===e.shape.type&&(o.isPreventHistory=!0),this.diagram.nodePropertyChange(e,{},{offsetX:e.offsetX,offsetY:e.offsetY,rotateAngle:e.rotateAngle}),this.diagram.drag(e,a-e.wrapper.bounds.x,l-e.wrapper.bounds.y)):(t&&t.shape&&"UmlClassifier"===t.shape.type&&(t.wrapper.measureChildren=!0),this.diagram.nodePropertyChange(t,{},{offsetX:t.offsetX,offsetY:t.offsetY,width:t.width,height:t.height,rotateAngle:t.rotateAngle}),t.wrapper.measureChildren=!1),t.wrapper.measure(new Omi(t.wrapper.width,t.wrapper.height)),t.wrapper.arrange(t.wrapper.desiredSize),"ResizeEast"!==this.currentAction&&"ResizeSouth"!==this.currentAction)||(p=DTi(t),this.diagram.addHistoryEntry({category:"Internal",type:h?"RowHeightChanged":"ColumnWidthChanged",undoObject:r,redoObject:p})),Nbi(i,this.diagram),o},BEi.prototype.addUmlNode=function(){var e,t,i,n,o=this.diagram.selectedItems.nodes[0],r=this.diagram.findObjectsUnderMouse({x:this.currentPosition.x+20,y:this.currentPosition.y}),s=this.diagram.findObjectUnderMouse(r,this.action,this.inAction);s||(r=this.diagram.findObjectsUnderMouse({x:this.currentPosition.x-20,y:this.currentPosition.y}),s=this.diagram.findObjectUnderMouse(r,this.action,this.inAction)),o&&o.container&&"Stack"===o.container.type&&s&&s.parentId&&s.parentId===o.id&&(r=s,(n=tTi(this.diagram.element.id)).getElementById(n.id+"_stack_highlighter"))&&(n=o.wrapper.children.indexOf(s.wrapper)+1,this.diagram.enableServerDataBinding(!1),(i=new MIi(this.diagram,"nodes",{style:{fill:o.style.fill,strokeColor:"black"===o.style.strokeColor?"#ffffff00":o.style.strokeColor},annotations:s.annotations,verticalAlignment:"Stretch",horizontalAlignment:"Stretch",constraints:(Kfi.Default|Kfi.HideThumbs)&~(Kfi.Rotate|Kfi.Drag|Kfi.Resize),minHeight:25},!0)).annotations[0].content=" + Name : Type",r.id.split("_"),i.id=xTi()+i.id,i.parentId=o.id,i.zIndex=-1,i.umlIndex=n,this.diagram.startGroupAction(),r={name:"Name",type:"Type"},"Class"===o.shape.classifier&&(s.id.includes("_umlProperty")&&0<o.shape.classShape.attributes.length?(e=new sIi(o,"",r),o.shape.classShape.attributes.push(e)):s.id.includes("_umlMethods")&&0<o.shape.classShape.methods.length&&(t=new hIi(o,"",r),o.shape.classShape.methods.push(t))),"Interface"===o.shape.classifier&&(s.id.includes("_umlProperty")&&0<o.shape.interfaceShape.attributes.length?(e=new sIi(o,"",r),o.shape.classShape.attributes.push(e)):s.id.includes("_umlMethods")&&0<o.shape.interfaceShape.methods.length&&(t=new hIi(o,"",r),o.shape.interfaceShape.methods.push(t))),"Enumeration"===o.shape.classifier&&s.id.includes("_umlMember")&&0<o.shape.enumerationShape.members.length&&(n=new vIi(o,"",r),o.shape.enumerationShape.members.push(n)),o.wrapper.children.indexOf(i.wrapper),this.diagram.enableServerDataBinding(!0),this.diagram.add(i),this.diagram.updateConnectorEdges(o),this.diagram.clearSelection(),this.diagram.select([this.diagram.nameTable[i.id]]),this.diagram.endGroupAction(),this.diagram.startTextEdit())};var PEi=BEi;function BEi(e,t){this.currentAction="None",this.previousAction="None",this.previousTarget=null,this.touchArgs=void 0,this.focus=!1,this.isBlocked=!1,this.isMouseDown=!1,this.inAction=!1,this.doingAutoScroll=!1,this.diagram=null,this.objectFinder=null,this.tool=null,this.eventArgs=null,this.previousElement=null,this.isKeyUp=!0,this.keyCount=0,this.isNudgeKey=!1,this.commandObj={},this.keyArgs={},this.diagram=e,this.objectFinder=new FEi,this.commandHandler=t}LEi.prototype.findObjectsUnderMouse=function(e,t,i,n,o){for(var r,s,a,l=[],h=(n&&n instanceof qIi&&n.nodes.length+n.connectors.length===1&&(n=n.nodes[0]||n.connectors[0]).children&&0===n.children.length&&(i.actualObject=n),n&&n instanceof ISi&&(n.constraints&Yfi.ConnectToNearByNode||n.constraints&Yfi.ConnectToNearByPort)&&n.connectionPadding||0),d={},p=0,c=t.spatialSearch.findObjects(new tfi(e.x-50-h,e.y-50-h,100+h,100+h));p<c.length;p++){var u=e,g=(f=(x=c[p]).wrapper.outerBounds,!x.rotateAngle&&f.containsPoint(u,h));if((x!==n||t.currentDrawingObject instanceof ISi)&&x instanceof ISi?x!==t.currentDrawingObject:x.wrapper.visible)if((C=t.commandHandler.getObjectLayer(x.id))&&!C.lock&&C.visible){if(a=d[C.zIndex]=d[C.zIndex]||[],x.rotateAngle)for(var m,f=TTi(m=x.wrapper),y=0,v=m.children;y<v.length;y++)r=v[y],afi(s=ofi(),-(r.rotateAngle+r.parentTransform),r.offsetX,r.offsetY),u=rfi(s,e),TTi(r).containsPoint(u,h)&&(g=!0);n&&!1!==Twi(t,x)||((f=x)instanceof ISi?f.constraints&Yfi.PointerEvents:f.constraints&Kfi.PointerEvents)&&(x instanceof ISi?CAi(x,e):g)&&(m=x instanceof ISi&&x.hitPadding||0,this.findElementUnderMouse(x,e,t,h||m))&&"helper"!==x.id&&m1i(x,"zIndex",a)}}for(var b=0,w=t.layers;b<w.length;b++)for(var C=w[b],S=0,A=l=l.concat(d[C.zIndex]||[]);S<A.length;S++){var x,I="eventHandler";"Bpmn"!==(x=A[S]).shape.type||!x.processId||t[I].tool instanceof Wwi&&!(t[I].tool instanceof Wwi&&Kvi(x))||-1<(E=l.indexOf(t.nameTable[x.processId]))&&l.splice(E,1),"UmlClassifier"===x.shape.type&&x.container&&"Stack"===x.container.type&&-1<(E=l.indexOf(t.nameTable[t.nameTable[x.id].wrapper.children[0].id]))&&l.splice(E,1)}for(var T=0;T<l.length;T++){var E,D=t.nameTable[l[parseInt(T.toString(),10)].parentId];if(D)for(var M=this.findElementUnderMouse(D,e,t),k=0;k<D.ports.length;k++)if(M&&M.id.match("_"+D.ports[parseInt(k.toString(),10)].id+"$")){var P=D.ports[parseInt(k.toString(),10)];if(lbi(P)||abi(P))return l}for(;D;){if(-1===(E=l.indexOf(D)))break;l.splice(E,1),D=t.nameTable[D.parentId]}}if(this.checkSwimlane(l,t),i&&!i.source)for(T=0;T<l.length;T++){var B=t.nameTable[l[parseInt(T.toString(),10)].parentId];if(B&&"SwimLane"===B.shape.type)for(k=0;k<l.length;k++)l[parseInt(k.toString(),10)]instanceof ISi&&l.splice(T,1)}return l},LEi.prototype.checkSwimlane=function(e,t){for(var i,n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)],r=void 0,s=void 0,r=(o instanceof MIi&&(r=e[parseInt(n.toString(),10)].parentId,s=o),""===r&&(i="SwimLane"!==s.shape.type),t.nameTable[""+r]);r&&r.isLane&&t.nameTable[r.parentId].zIndex>o.zIndex&&(e[parseInt(n.toString(),10)]=r),0<n&&i&&s&&(s.isLane||s.isPhase||s.isHeader)&&e[parseInt(n.toString(),10)].zIndex<e[n-1].zIndex&&(o=e[parseInt(n.toString(),10)],e[parseInt(n.toString(),10)]=e[n-1],e[n-1]=o)}if(2<=e.length)for(var a,l,h,d,p=e.length-1;0<=p;p--)e[parseInt(p.toString(),10)].parentId&&(a=R1i(e[parseInt(p.toString(),10)],t,""),l=R1i(e[p-1],t,""),h=t.nameTable[""+a],d=t.nameTable[""+l])&&a!==l&&h.zIndex<d.zIndex&&e.splice(p,1)},LEi.prototype.isTarget=function(e,t,i){var n,o,r=t.selectedItems.connectors[0],s="ConnectorSourceEnd"===i?t.nameTable[r.targetID]:t.nameTable[r.sourceID];return!s||s.processId&&!e.processId||s.processId!==e.processId||(e=s.processId!==e.processId?null:e)&&e.parentId&&"UmlClassifier"===t.nameTable[e.parentId].shape.type&&(e=t.nameTable[e.parentId]),e=(e="ConnectorSourceEnd"===i&&r.targetID&&(n=t.nameTable[r.targetID])&&n.shape&&"TextAnnotation"===n.shape.shape&&(o=r.id.split("_"),e="Bpmn"===n.shape.type&&"Bpmn"!==e.shape.type||o[0]===e.id||"TextAnnotation"===e.shape.shape?null:e)&&e.parentId&&"UmlClassifier"===t.nameTable[e.parentId].shape.type?t.nameTable[e.parentId]:e)&&(s&&e.id===s.processId||("ConnectorSourceEnd"===i||"ConnectorTargetEnd"===i)&&e.id===r.parentId)?null:e},LEi.prototype.findObjectUnderMouse=function(e,t,i,n,o,r,s){var a="eventHandler",l="endPoint",h=null;if(0!==t.length)if(s&&s instanceof qIi&&s.nodes.length+s.connectors.length===1&&(s=s.nodes[0]||s.connectors[0]),"ConnectorSourceEnd"===i&&s||"PortDraw"===i||(ibi(e)||tbi(e))&&S1i(e.drawingObject)===ISi)for(var d=e.selectedItems.connectors[0],p=t.length-1;0<=p;p--){var c=h1i(t[parseInt(p.toString(),10)],!1),u=h1i(t[parseInt(p.toString(),10)],!0),g=e[a].tool,m=this.findTargetElement(t[parseInt(p.toString(),10)].wrapper,r,e,void 0);if("Draw"===i&&m&&(t[parseInt(p.toString(),10)]instanceof MIi||t[parseInt(p.toString(),10)]instanceof ISi)&&!E1i(t[parseInt(p.toString(),10)],m)&&(g&&"ConnectorSourceEnd"===g[l]&&!Gvi(t[parseInt(p.toString(),10)])||g&&"ConnectorTargetEnd"===g[l]&&!Uvi(t[parseInt(p.toString(),10)])))return h;if(t[parseInt(p.toString(),10)]instanceof MIi||t[parseInt(p.toString(),10)]instanceof ISi&&(Gvi(t[parseInt(p.toString(),10)])||Yvi(c)||Uvi(t[parseInt(p.toString(),10)])||qvi(u)||"PortDraw"===i&&g instanceof Hwi&&"ConnectorTargetEnd"===g[l]&&(Uvi(t[parseInt(p.toString(),10)])||qvi(u))))return h=t[parseInt(p.toString(),10)],d&&(h=this.isTarget(h,e,i)),o.actualObject=h}else if("ConnectorTargetEnd"===i&&s){for(p=t.length-1;0<=p;p--)if(u=h1i(t[parseInt(p.toString(),10)],!0),(t[parseInt(p.toString(),10)]instanceof MIi||t[parseInt(p.toString(),10)]instanceof ISi)&&(Uvi(t[parseInt(p.toString(),10)])||qvi(u)))return h=t[parseInt(p.toString(),10)],h=this.isTarget(h,e,i),o.actualObject=h}else{if(s&&("Drag"===i||e[a].tool instanceof Wwi)){for(var f=0,p=0;p<t.length;p++){var y=t[parseInt(p.toString(),10)];s!==y&&(y instanceof ISi||!r||y.wrapper.bounds.containsPoint(r))&&Kvi(y)&&(f=h?(h=f>=y.zIndex?h:y,Math.max(f,y.zIndex)):(h=y).zIndex)}return(h=!h||"Bpmn"!==h.shape.type||0<e.selectedItems.nodes.length&&"Bpmn"===e.selectedItems.nodes[0].shape.type?h:null)&&(o.actualObject=h),h}if("Select"!==i&&"Pan"!==i||!e[a].tool)if("Pan"===i||"LayoutAnimation"===i){for(p=t.length-1;0<=p;p--)if(t[parseInt(p.toString(),10)]instanceof MIi||t[parseInt(p.toString(),10)]instanceof ISi){m=this.findTargetElement(t[parseInt(p.toString(),10)].wrapper,r,e,void 0);if("Pan"===i||m&&(m.id.match("_icon_content_shape$")||m.id.match("_icon_content_rect$")))return t[parseInt(p.toString(),10)]}}else h=t[t.length-1],o&&h&&(o.actualObject=h);else{for(p=t.length-1;0<=p;p--)if(t[parseInt(p.toString(),10)]instanceof ISi){var v=t[p-1];if(t[p-1]instanceof MIi&&v.ports){if((m=this.findTargetElement(v.wrapper,r,e,void 0))&&(m.id.match("_icon_content_shape$")||m.id.match("_icon_content_rect$")))return v;for(var b=0;b<v.ports.length;b++)if(m&&m.id.match("_"+v.ports[parseInt(b.toString(),10)].id+"$")&&abi(v.ports[parseInt(b.toString(),10)]))return v}}if(h=t[t.length-1],o.actualObject=h,!e[a].itemClick(h,!0)&&h.parentId)for(var w=h,C=Twi(e,w);w&&(!Twi(e,w)||C)&&""===(h=w).tooltip.content;)w=e.nameTable[w.parentId]}}return h},LEi.prototype.findElementUnderSelectedItem=function(e,t,i,n){return e instanceof qIi?1!==e.nodes.length||e.connectors&&e.connectors.length?e.nodes&&!e.nodes.length||1!==e.connectors.length?null:this.findElementUnderMouse(e.connectors[0],t,i):this.findElementUnderMouse(e.nodes[0],t,i):this.findElementUnderMouse(e,t,i,n)},LEi.prototype.findElementUnderMouse=function(e,t,i,n){return this.findTargetElement(e.wrapper,t,i,n)},LEi.prototype.findTargetElement=function(e,t,i,n){for(var o=e.children.length-1;0<=o;o--){var r=e.children[parseInt(o.toString(),10)];if(r&&r.outerBounds.containsPoint(t,n||0))if(r.visible){if(r instanceof Syi){var s=this.findTargetElement(r,t,i);if(s)return s}s="Clip"===r.style.textOverflow||"Ellipsis"===r.style.textOverflow;if(r.bounds.containsPoint(t,n||0)&&!s)return r;if(e.bounds.containsPoint(t,n||0)&&s)return r}else if(r instanceof kyi&&e&&e.id){var a;if(l1i(e.id.includes("group_container")?(a=e.id.slice(0,-15),i.getObject(a)):i.getObject(e.id),r.id))return r}}return e.bounds.containsPoint(t,n)&&"none"!==e.style.fill?e:null};var FEi=LEi;function LEi(){}REi=function(e,t){return(REi=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])}))(e,t)};var REi,OEi,QR=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},NEi=(function(e,t){function i(){this.constructor=e}REi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(VEi,OEi=n),QR([e("")],VEi.prototype,"id",void 0),QR([e(!0)],VEi.prototype,"visible",void 0),QR([e(!1)],VEi.prototype,"lock",void 0),QR([e()],VEi.prototype,"objects",void 0),QR([e()],VEi.prototype,"addInfo",void 0),QR([e(-1)],VEi.prototype,"zIndex",void 0),VEi);function VEi(e,t,i,n){e=OEi.call(this,e,t,i,n)||this;return e.objectZIndex=-1,e.zIndexTable={},e.objects=[],e}var _Ei=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},HEi=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},zEi=(Object.defineProperty(jEi.prototype,"snappingModule",{get:function(){return this.diagram.snappingModule},enumerable:!0,configurable:!0}),Object.defineProperty(jEi.prototype,"layoutAnimateModule",{get:function(){return this.diagram.layoutAnimateModule},enumerable:!0,configurable:!0}),jEi.prototype.startTransaction=function(e){this.state={element:this.diagram.selectedItems,backup:null},e&&this.diagram.protectPropertyChange(!0),nTi(this.diagram.element.id).style.pointerEvents="none"},jEi.prototype.endTransaction=function(e){this.state=null,e&&this.diagram.protectPropertyChange(!1),nTi(this.diagram.element.id).style.pointerEvents="all"},jEi.prototype.setFocus=function(){document.getElementById(this.diagram.element.id).focus()},jEi.prototype.showTooltip=function(e,t,i,n,o){var r,s,a=this,l=!1;e instanceof qIi?1===e.nodes.length&&0===e.connectors.length?(s=e.nodes[0].id,e.nodes[0].shape&&e.nodes[0].shape instanceof axi&&(l=!0)):0===e.nodes.length&&1===e.connectors.length?s=e.connectors[0].id:r=document.getElementById(this.diagram.element.id+"_SelectorElement"):e instanceof MIi?(s=e.id,e.shape&&e.shape instanceof axi&&(l=!0)):s=e.id,je(r)&&!je(s)&&(r=document.getElementById(s+(l?"_content_native_element":"_groupElement"))),o&&(this.diagram.tooltipObject.position="BottomCenter",this.diagram.tooltipObject.animation={open:{delay:0,duration:0}},this.diagram.tooltipObject.openDelay=0,this.diagram.tooltipObject.closeDelay=0),this.diagram.selectedItems.setTooltipTemplate&&(s=void 0,(l=jTi(this.diagram.selectedItems.setTooltipTemplate))&&(s=l(e,this.diagram)),i=s instanceof HTMLElement?s.cloneNode(!0):s||i),this.diagram.tooltipObject.isSticky=!1,e.tooltip&&(this.diagram.tooltipObject.openOn=e.tooltip.openOn),this.diagram.tooltipObject.content="string"==typeof i?ao(function(){return i}):i,this.diagram.tooltipObject.offsetX=0,this.diagram.tooltipObject.offsetY=0,this.diagram.tooltipObject.refresh(r),o&&setTimeout(function(){a.diagram.tooltipObject.open(r)},1)},jEi.prototype.connectorSplit=function(e,t){var i=e.id,n=DTi(t),o=this.diagram.connectors.indexOf(t),r=this.diagram.nodes.indexOf(e),s=DTi(e),a={},l={},h={offsetX:s.offsetX,offsetY:s.offsetY},d={sourceID:n.sourceID,sourcePoint:n.sourcePoint,sourcePortID:n.sourcePortID,targetID:n.targetID,targetPoint:n.targetPoint,targetPortID:n.targetPortID},p=(a[parseInt(o.toString(),10)]=d,l[parseInt(r.toString(),10)]=h,{}),c={},u={},g={},o=(""!==n.sourceID&&""!==n.targetID?g.targetID=this.ConnectorTargetChange(t,i):""!==n.sourceID&&""===n.targetID?(this.nodeOffsetChange(u,s,t.targetPoint),g.targetID=this.ConnectorTargetChange(t,i)):(""===n.sourceID&&""===n.targetID||""===n.sourceID&&""!==n.targetID)&&(this.nodeOffsetChange(u,s,t.sourcePoint),g.sourceID=this.ConnectorSourceChange(t,i)),p[parseInt(o.toString(),10)]=g,c[parseInt(r.toString(),10)]=u,this.diagram.nodePropertyChange(e,h,u),this.diagram.updateSelector(),this.diagram.connectorPropertyChange(t,d,g),""!==n.sourceID&&""!==n.targetID&&((s={id:"connector "+i,constraints:Yfi.Default|Yfi.AllowDrop,sourceID:i}).type=n.type,s.style=n.style,s.sourceDecorator=n.sourceDecorator,s.targetDecorator=n.targetDecorator,s.targetID=n.targetID,""!==n.targetPortID&&(s.targetPortID=n.targetPortID),this.diagram.add(s)),{type:"PropertyChanged",redoObject:{nodes:c},undoObject:{nodes:l},category:"Internal"}),r=(this.diagram.addHistoryEntry(o),{type:"PropertyChanged",redoObject:{connectors:p},undoObject:{connectors:a},category:"Internal"});this.diagram.addHistoryEntry(r)},jEi.prototype.nodeOffsetChange=function(e,t,i){e.offsetX=t.offsetX=i.x,e.offsetY=t.offsetY=i.y},jEi.prototype.ConnectorTargetChange=function(e,t){return e.targetID=t},jEi.prototype.ConnectorSourceChange=function(e,t){return e.sourceID=t},jEi.prototype.closeTooltip=function(){this.diagram.tooltipObject.close()},jEi.prototype.canEnableDefaultTooltip=function(){return!!(this.diagram.selectedItems.constraints&Ufi.ToolTip)},jEi.prototype.updateSelector=function(){this.diagram.updateSelector()},jEi.prototype.triggerEvent=function(t,i){return _Ei(this,void 0,void 0,function(){return HEi(this,function(e){switch(e.label){case 0:return t!==dyi.drop&&t!==dyi.positionChange&&t!==dyi.connectionChange?[3,3]:this.diagram.currentSymbol?[2]:(t===dyi.drop&&(i.source=this.diagram),this.diagram.currentDrawingObject instanceof ISi&&t!==dyi.positionChange?[4,this.diagram.triggerEvent(t,i)]:[3,2]);case 1:return[2,e.sent()];case 2:if(this.diagram.currentDrawingObject&&t!==dyi.positionChange)return[2];e.label=3;case 3:return[4,this.diagram.triggerEvent(t,i)];case 4:return[2,e.sent()]}})})},jEi.prototype.dragOverElement=function(e,t){this.diagram.currentSymbol&&(e={element:e.source,target:e.target,mousePosition:t,diagram:this.diagram},this.triggerEvent(dyi.dragOver,e))},jEi.prototype.disConnect=function(e,t,i){var n,o,r,s={},a={};return e instanceof qIi?o=e.connectors[0]:e instanceof ISi&&this.diagram.currentDrawingObject&&(o=this.diagram.currentDrawingObject),e&&o&&(Iwi(this.diagram)||this.diagram.currentDrawingObject)&&(!t||"ConnectorSourceEnd"!==t&&"ConnectorTargetEnd"!==t?"OrthoThumb"!==t&&"SegmentEnd"!==t&&(o.sourceID||o.targetID)&&(s={sourceID:o.sourceID,sourcePortID:o.sourcePortID,targetID:o.targetID,targetPortID:o.targetPortID},o.sourceID="",o.sourcePortID="",o.targetID="",o.targetPortID="",e={connector:o,oldValue:s,newValue:a={sourceID:o.sourceID,sourcePortID:o.sourcePortID,targetID:o.targetID,targetPortID:o.targetPortID},cancel:!1,state:"Changing",connectorEnd:t},this.triggerEvent(dyi.connectionChange,e),e.cancel?(o.sourceID=s.sourceID,o.sourcePortID=s.sourcePortID,o.targetID=s.targetID,o.targetPortID=s.targetPortID):(this.diagram.connectorPropertyChange(o,s,a),this.diagram.updateDiagramObject(o),this.triggerEvent(dyi.connectionChange,e={connector:o,oldValue:s,newValue:a,cancel:!1,state:"Changed",connectorEnd:t}))):(e="ConnectorSourceEnd"===t?"sourcePortID":"targetPortID",o[r="ConnectorSourceEnd"===t?"sourceID":"targetID"]&&(s[r]=o[r],o[r]="",a[r]=o[r],(o.sourcePortID||o.targetPortID)&&(s[e]=o[e],o[e]="",a[e]=o[e]),n=this.connectionEventChange(o,s,a,t,i)))),n},jEi.prototype.connectionEventChange=function(e,t,i,n,o){var r,s,a="ConnectorSourceEnd"===n?"sourceID":"targetID",l="ConnectorSourceEnd"===n?"sourcePortID":"targetPortID",n=(this.enableCloneObject&&(s=DTi(r=this.diagram.nameTable[i[a]]),this.diagram.insertValue(s,!0)),{cancel:!1,state:"Changing",connectorEnd:n,connector:e,oldValue:{nodeId:t[a],portId:t[l]},newValue:{nodeId:i[a],portId:i[l]}});this.triggerEvent(dyi.connectionChange,n),n.cancel&&(e[a]=t[a],e[l]=t[l],i=t),this.diagram.connectorPropertyChange(e,t,i),this.diagram.updateDiagramObject(e),t[a],t[l],i[a],i[l],this.enableCloneObject&&void 0===r&&(s=DTi(r=this.diagram.nameTable[t[a]]),this.diagram.insertValue(s,!0)),this.diagram.bpmnModule&&e.isBpmnAnnotationConnector&&(this.diagram.nameTable[e.targetID].shape.textAnnotation.textAnnotationTarget=e.sourceID)},jEi.prototype.findTarget=function(e,t,i,n){if(t instanceof MIi){if(e&&e.id===t.id+"_content")return t;if(i&&"Bpmn"===t.shape.type&&!N&&"Activity"===t.shape.shape&&"Transaction"===t.shape.activity.subProcess.type){i=t.shape.activity.subProcess.transaction;if(i.success.visible&&0===e.id.indexOf(t.id+"_success"))return i.success;if(i.cancel.visible&&0===e.id.indexOf(t.id+"_cancel"))return i.cancel;if(i.failure.visible&&0===e.id.indexOf(t.id+"_failure"))return i.failure}if(e instanceof kyi||e instanceof Tvi){i=this.findMatch(t.ports,t.id,e.id);if(i)return i;i=this.findMatch(t.fixedUserHandles,t.id,e.id);if(i)return i}}if(t instanceof ISi){if(e&&e.id===t.id+"_path")return t;if(e instanceof kyi||e instanceof Tvi){i=this.findMatch(t.ports,t.id,e.id);if(i)return i;i=this.findMatch(t.fixedUserHandles,t.id,e.id);if(i)return i}}if(!n)for(var o,r=0;r<t.annotations.length;r++)if(o=t.annotations[parseInt(r.toString(),10)],e.id===t.id+"_"+o.id)return o;return t},jEi.prototype.findMatch=function(e,t,i){for(var n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)];if(i===t+"_"+o.id||i===t+"_"+o.id+"_shape")return o}},jEi.prototype.canDisconnect=function(e,t,i,n){var o;t.source instanceof qIi?o=t.source.connectors[0]:t.source instanceof ISi&&this.diagram.currentDrawingObject&&(o=this.diagram.currentDrawingObject),this.findTarget(t.targetWrapper,t.target,"ConnectorSourceEnd"===e,!0);return o["ConnectorSourceEnd"===e?"sourceID":"targetID"]!==n||o["ConnectorSourceEnd"===e?"sourcePortID":"targetPortID"]!==i},jEi.prototype.connect=function(e,t,i){var n,o,r,s={},a={},l=(t.source instanceof qIi?o=t.source.connectors[0]:t.source instanceof ISi&&this.diagram.currentDrawingObject&&(o=this.diagram.currentDrawingObject),this.findTarget(t.targetWrapper||t.sourceWrapper,t.target||t.actualObject,"ConnectorSourceEnd"===e,!0)),h="ConnectorSourceEnd"===e?"sourceID":"targetID",d="ConnectorSourceEnd"===e?"sourcePortID":"targetPortID";return l instanceof MIi?(a[h]=o[h],o[h]=l.id,s[h]=o[h],a[d]=o[d],r=this.connectionEventChange(o,a,s,e,i)):(l instanceof i0i||l instanceof Oxi)&&(i=o[h],n=o[d],o[d]=l.id,o[h]=t.target&&t.target.id||t.actualObject.id,s[h]=o[h],s[d]=o[d],this.triggerEvent(dyi.connectionChange,l={connector:o,oldValue:{nodeId:i,portId:n},newValue:{nodeId:s[h],portId:s[d]},cancel:!1,state:"Changing",connectorEnd:e}),l.cancel?(o[h]=i,o[d]=n,s[h]=i,s[d]=n):(this.diagram.connectorPropertyChange(o,a,s),this.diagram.updateDiagramObject(o),l={connector:o,oldValue:{nodeId:i,portId:n},newValue:{nodeId:s[h],portId:s[d]},cancel:!1,state:"Changing",connectorEnd:e})),this.renderHighlighter(t,void 0,"ConnectorSourceEnd"===e),r},jEi.prototype.cut=function(){this.clipboardData.pasteIndex=0,this.diagram.undoRedoModule&&this.diagram.historyManager.startGroupAction(),this.clipboardData.clipObject=this.copyObjects(),this.diagram.undoRedoModule&&this.diagram.historyManager.endGroupAction(),"SVG"!==this.diagram.mode&&this.diagram.refreshDiagramLayer()},jEi.prototype.addLayer=function(e,t,i){e.id=e.id||xTi(),e.zIndex=this.diagram.layers.length;var n=this.diagram.allowServerDataBinding;this.diagram.enableServerDataBinding(!1),e=new NEi(this.diagram,"layers",e,!0),this.diagram.enableServerDataBinding(n),e.objectZIndex=-1,e.zIndexTable={},this.diagram.layers.push(e),this.diagram.layerZIndexTable[e.zIndex]=e.id,(this.diagram.activeLayer=e).objects;if(t)for(var o=0;o<t.length;o++)this.diagram.add(t[parseInt(o.toString(),10)])},jEi.prototype.getObjectLayer=function(e){var t=this.diagram.layers;if(1<t.length)for(var i=0;i<t.length;i++)if(-1<t[parseInt(i.toString(),10)].objects.indexOf(e))return t[parseInt(i.toString(),10)];return this.diagram.activeLayer},jEi.prototype.getLayer=function(e){for(var t=this.diagram.layers,i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].id===e)return t[parseInt(i.toString(),10)]},jEi.prototype.removeLayer=function(e,t){var i=this.getLayer(e);if(i){for(var n=this.diagram.layers.indexOf(i),o=i.objects,r=o.length-1;0<=r;r--)this.diagram.unSelect(this.diagram.nameTable[o[parseInt(r.toString(),10)]]),this.diagram.remove(this.diagram.nameTable[o[parseInt(r.toString(),10)]]),"default_layer"!==i.id&&this.diagram.activeLayer.id===e&&(this.diagram.activeLayer=this.diagram.layers[this.diagram.layers.length-1]);delete this.diagram.layerZIndexTable[i.zIndex],this.diagram.layers.splice(n,1),"SVG"!==this.diagram.mode&&this.diagram.refreshDiagramLayer()}},jEi.prototype.moveObjects=function(e,t){this.diagram.startGroupAction();for(var i={},n=[],o=0;o<e.length;o++){var r,s=this.diagram.nameTable[e[parseInt(o.toString(),10)]];s instanceof MIi?(r={inEdges:s.inEdges,outEdges:s.outEdges},i[""+s.id]=DTi(r)):s instanceof ISi&&(r={sourceID:s.sourceID,targetID:s.targetID,sourcePortID:s.sourcePortID,targetPortID:s.targetPortID},i[""+s.id]=DTi(r))}var a,t=this.getLayer(t)||this.diagram.activeLayer;this.diagram.setActiveLayer(t.id);for(var l=0,h=e;l<h.length;l++){var d,o=h[l];if(-1<this.getObjectLayer(o).objects.indexOf(o)){if(n=[],(a=this.diagram.nameTable[""+o]).children)for(var p=0,c=a.children;p<c.length;p++){var u=c[p];n.push(this.diagram.nameTable[""+u])}if(this.diagram.unSelect(a),this.diagram.deleteDependentConnector=!1,this.diagram.remove(this.diagram.nameTable[""+o]),this.diagram.deleteDependentConnector=!0,0<n.length){for(var g=void 0,m=0,f=n;m<f.length;m++){u=f[m];g=this.diagram.add(u),this.setConnectorDetails(g||u,i),a.children.push(g.id)}g=this.diagram.add(a)}else g=this.diagram.add(a);this.setConnectorDetails(g||a,i),a.parentId&&(d=a.parentId,d=this.diagram.nameTable[""+d],this.diagram.addChildToGroup(d,a.id))}}this.diagram.endGroupAction()},jEi.prototype.setConnectorDetails=function(e,t){var i=t[e.id];if(e instanceof MIi){if(i){if(i.inEdges&&0<i.inEdges.length)for(var n=0;n<i.inEdges.length;n++)this.diagram.nameTable[i.inEdges[parseInt(n.toString(),10)]].targetID=e.id;if(i.outEdges&&0<i.outEdges.length)for(n=0;n<i.outEdges.length;n++)this.diagram.nameTable[i.outEdges[parseInt(n.toString(),10)]].sourceID=e.id}}else e instanceof ISi&&i&&(e.sourceID=i.sourceID,e.targetID=i.targetID,e.sourcePortID=i.sourcePortID,e.targetPortID=i.targetPortID)},jEi.prototype.cloneLayer=function(e){this.diagram.layers;var t=this.getLayer(e);if(t){for(var i=[],e={id:e+"_"+xTi(),objects:[],visible:!0,lock:!1},n=(this.addLayer(e,null,!0),e.zIndex=this.diagram.layers.length-1,0),o=t.objects;n<o.length;n++){var r=o[n];i.push(this.diagram.nameTable[""+r])}this.paste(i)}},jEi.prototype.copy=function(){return this.clipboardData.pasteIndex=1,this.clipboardData.clipObject=this.copyObjects(),this.clipboardData.clipObject},jEi.prototype.copyObjects=function(){var e,t,i=[],n=[];if(this.clipboardData.childTable={},0<this.diagram.selectedItems.connectors.length)for(var i=i.concat(this.diagram.selectedItems.connectors),o=0;o<i.length;o++){var r=void 0,r=this.diagram.bpmnModule&&i[parseInt(o.toString(),10)].isBpmnAnnotationConnector?DTi(this.diagram.nameTable[i[parseInt(o.toString(),10)].targetID]):DTi(i[parseInt(o.toString(),10)]);n.push(r)}if(0<this.diagram.selectedItems.nodes.length){i=i.concat(this.diagram.selectedItems.nodes);for(o=0;o<this.diagram.selectedItems.nodes.length;o++)if(!this.diagram.selectedItems.nodes[parseInt(o.toString(),10)].isPhase){var s=DTi(this.diagram.selectedItems.nodes[parseInt(o.toString(),10)]),a=n.filter(function(e){return e.isLane}),l=!1;if(s.isLane)for(var h=0,d=a;h<d.length;h++){var p=d[h];if(p=p,e=s,t=this.diagram,!(!p.isLane||!e.isLane||p.id===e.id||p.parentId!==e.parentId||owi(p,t)!==owi(e,t))){l=!0;break}}if(!((s.isLane||s.isHeader)&&this.checkSwimlaneInSelection(s,n)||(a=s,c=this.diagram,a.parentId&&-1!==c.selectedItems.nodes.indexOf(c.nameTable[a.parentId]))||l)){s.wrapper&&s.offsetX!==s.wrapper.offsetX&&(s.offsetX=s.wrapper.offsetX),s.wrapper&&s.offsetY!==s.wrapper.offsetY&&(s.offsetY=s.wrapper.offsetY),this.copyProcesses(s),n.push(DTi(s));var c,u=ofi();if(afi(u,-s.rotateAngle,s.offsetX,s.offsetY),s.children){for(var g=this.clipboardData.childTable,m=this.getAllDescendants(s,[],!0),f=0;f<m.length;f++){var y,v=g[(y=this.diagram.nameTable[m[parseInt(f.toString(),10)].id]).id]=DTi(y),b=rfi(u,{x:v.wrapper.offsetX,y:v.wrapper.offsetY});y instanceof MIi&&(v.offsetX=b.x,v.offsetY=b.y,v.rotateAngle-=s.rotateAngle)}this.clipboardData.childTable=g}if("SwimLane"===s.shape.type)for(var w=this.diagram.getObject(this.diagram.selectedItems.nodes[parseInt(o.toString(),10)].id),g=this.clipboardData.childTable,C=kbi(this.diagram,w.wrapper.children[0]),f=0;f<C.length;f++){var S=this.diagram.getObject(C[parseInt(f.toString(),10)]);g[S.id]=DTi(S),g[S.id].parentSwimlaneId=s.id}s&&s.isLane&&(g=this.clipboardData.childTable,w=this.diagram.getObject(s.parentId),c=owi(s,this.diagram),g[s.id]=DTi(c),g[s.id].width=w.wrapper.actualSize.width)}}}if(this.sortByZIndex(n,"zIndex"),this.diagram.selectedItems.nodes.some(function(e){return"SwimLane"===e.shape.type})&&(n=this.removeDuplicateObjects(n)),0===this.clipboardData.pasteIndex){this.startGroupAction();for(var A=0,x=i;A<x.length;A++){var I=x[A];this.diagram.nameTable[I.id]&&this.diagram.remove(I)}this.endGroupAction()}return n},jEi.prototype.findProcesses=function(e){var t=[];return e.shape.lanes.forEach(function(e){e.children.forEach(function(e){e=e.shape.activity;e&&e.subProcess.processes&&e.subProcess.processes.forEach(function(e){t.push(e)})})}),t},jEi.prototype.removeDuplicateObjects=function(e){for(var t={},i=0;i<e.length;i++)t[e[parseInt(i.toString(),10)].id]=e[parseInt(i.toString(),10)];var n,o=[];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&o.push(t[""+n]);for(var r,s=this,i=0;i<o.length;i++)!function(e){var t;o[parseInt(e.toString(),10)].parentId&&(t=s.diagram.getObject(o[parseInt(e.toString(),10)].parentId))&&t.isLane&&t.parentId&&o.some(function(e){return e.id===t.parentId})&&(o.splice(e,1),e--),r=e}(i),i=r;var a=Object.keys(this.clipboardData.childTable);return o.filter(function(e){return-1===a.indexOf(e.id)||e.isLane})},jEi.prototype.checkSwimlaneInSelection=function(t,e){return this.diagram.selectedItems.nodes.some(function(e){return e.id===t.parentId})},jEi.prototype.copyProcesses=function(e){if("Bpmn"===e.shape.type&&e.shape.activity&&e.shape.activity.subProcess.processes&&0<e.shape.activity.subProcess.processes.length){for(var t=0,i=e.shape.activity.subProcess.processes;t<i.length;t++){var n=i[t];this.processTable[""+n]=DTi(this.diagram.nameTable[""+n]),this.processTable[""+n].shape.activity.subProcess.processes&&0<this.processTable[""+n].shape.activity.subProcess.processes.length&&this.copyProcesses(this.processTable[""+n])}this.clipboardData.processTable=this.processTable}},jEi.prototype.group=function(){var n=this,e=(this.oldSelectedObjects=w1i(this.diagram),this.diagram.isProtectedOnChange),o=(this.diagram.protectPropertyChange(!0),this.diagram.diagramActions=this.diagram.diagramActions|ryi.Group,[]),t={};t.id="group"+xTi(),(t=new MIi(this.diagram,"nodes",t,!0)).children=[];for(var i,o=(o=this.diagram.selectedItems.nodes).concat(this.diagram.selectedItems.connectors),r=(this.diagram.connectors.forEach(function(t){var e=n.diagram.nameTable[t.sourceID],i=n.diagram.nameTable[t.targetID],e=e&&e.processId&&Twi(n.diagram,n.diagram.nameTable[e.processId]),i=i&&i.processId&&Twi(n.diagram,n.diagram.nameTable[i.processId]);o.some(function(e){return e.id===t.id})||!e&&!i||o.push(t)}),o.sort(function(e,t){return e.zIndex-t.zIndex})),s=0;s<r.length;s++)r[parseInt(s.toString(),10)].parentId||t.children.push(r[parseInt(s.toString(),10)].id);0<t.children.length&&((i=this.diagram.add(t))&&this.select(i),t.annotations=i.annotations,t.ports=i.ports,t.style=i.style,this.addHistoryEntry({type:"Group",undoObject:t,redoObject:t,category:"Internal"}),this.diagram.diagramActions=this.diagram.diagramActions&~ryi.Group,this.diagram.protectPropertyChange(e))},jEi.prototype.unGroup=function(e){var t=this.diagram.isProtectedOnChange,i=(this.diagram.protectPropertyChange(!0),this.diagram.diagramActions=this.diagram.diagramActions|ryi.Group,[]);e?i.push(e):i=this.diagram.selectedItems.nodes,this.diagram.startGroupAction();for(var n=0;n<i.length;n++){for(var o=i[parseInt(n.toString(),10)],r=DTi(o),s=[],a=0;a<o.children.length;a++)s.push(o.children[parseInt(a.toString(),10)]);if(o.children){o.ports&&0<o.ports.length&&this.diagram.removePorts(o,o.ports),o.annotations&&0<o.annotations.length&&!N&&this.diagram.removeLabels(o,o.annotations);for(var l=this.diagram.nameTable[o.parentId],h=o.children.length-1;0<=h;h--){this.diagram.nameTable[o.children[parseInt(h.toString(),10)]].parentId="";var d=o.children[parseInt(h.toString(),10)];this.diagram.deleteChild(this.diagram.nameTable[o.children[parseInt(h.toString(),10)]],o),o.parentId&&d&&this.diagram.addChild(l,d)}this.resetDependentConnectors(o.inEdges,!0),this.resetDependentConnectors(o.outEdges,!1),this.diagram.diagramActions&ryi.UndoRedo||this.addHistoryEntry({type:"UnGroup",undoObject:r,redoObject:r,category:"Internal"}),o.parentId&&this.diagram.deleteChild(o,l)}this.diagram.removeNode(o,s),this.clearSelection()}this.diagram.endGroupAction(),this.diagram.diagramActions=this.diagram.diagramActions&~ryi.Group,this.diagram.protectPropertyChange(t)},jEi.prototype.resetDependentConnectors=function(e,t){for(var i=0;i<e.length;i++){var n=this.diagram.nameTable[e[parseInt(i.toString(),10)]],o=DTi(n),r=void 0,r=t?(n.targetID="",n.targetPortID="",{targetID:n.targetID,targetPortID:n.targetPortID}):(n.sourceID="",n.sourcePortID="",{sourceID:n.sourceID,sourcePortID:n.sourcePortID}),r=(this.diagram.connectorPropertyChange(n,{},r),{type:"ConnectionChanged",undoObject:{connectors:[o],nodes:[]},redoObject:{connectors:[DTi(n)],nodes:[]},category:"Internal"});this.diagram.diagramActions&ryi.UndoRedo||this.addHistoryEntry(r)}},jEi.prototype.paste=function(e){if(e||this.clipboardData.clipObject){this.diagram.protectPropertyChange(!0);var t=e?this.getNewObject(e):this.clipboardData.clipObject;if(t){var i=1!==t.length,e=!1,n={},o={};0!==this.clipboardData.pasteIndex&&this.clearSelection(),this.diagram.undoRedoModule&&(e=!0,this.diagram.historyManager.startGroupAction());for(var r=0,s=t;r<s.length;r++)n[(l=s[r]).id]=l;var a=[];i&&(this.diagram.isServerUpdate=!0);for(var l,h=0;h<t.length;h++)if((l=t[parseInt(h.toString(),10)]).parentId&&"SwimLane"!==this.diagram.getObject(l.parentId).shape.type&&l.parentId&&(l.parentId=""),S1i(l)===ISi){var d,p=DTi(l),c=p.sourceID,c=(n[(p.sourceID="")+c]&&o[""+c]&&(p.sourceID=o[""+c]),c=p.targetID,n[(p.targetID="")+c]&&o[""+c]&&(p.targetID=o[""+c]),!0);(c=p.targetID&&"TextAnnotation"===(d=this.diagram.nameTable[p.targetID]).shape.shape&&d.inEdges&&0<d.inEdges.length?!1:c)&&(d=this.cloneConnector(p,i),a.push(d),o[l.id]=d.id)}else{l.shape&&"Bpmn"===l.shape.type&&(l.processId=""),this.cloningInProgress=!0;c=this.cloneNode(l,i);if(this.cloningInProgress=!1,a.push(c),c){o[l.id]=c.id;p=l.inEdges;if(p)for(var u=0,g=p;u<g.length;u++)n[""+(m=g[u])]&&o[""+m]&&((f=this.diagram.nameTable[o[""+m]]).targetID=o[l.id],this.diagram.connectorPropertyChange(f,{targetID:"",targetPortID:""},{targetID:f.targetID,targetPortID:f.targetPortID}));if(p=l.outEdges)for(var m,f,y=0,v=p;y<v.length;y++)n[""+(m=v[y])]&&o[""+m]&&((f=this.diagram.nameTable[o[""+m]]).sourceID=o[l.id],this.diagram.connectorPropertyChange(f,{sourceID:"",sourcePortID:""},{sourceID:f.sourceID,sourcePortID:f.sourcePortID}))}}i&&(this.diagram.isServerUpdate=!1,this.diagram.select(a,!0)),!0===e&&(this.diagram.historyManager.endGroupAction(),e=!1),"SVG"!==this.diagram.mode&&this.diagram.refreshDiagramLayer(),this.clipboardData.pasteIndex++,this.diagram.protectPropertyChange(!1)}}},jEi.prototype.getNewObject=function(e){var t,i=[];this.clipboardData.pasteIndex=1;for(var n=0;n<e.length;n++)t=DTi(e[parseInt(n.toString(),10)]),i.push(t);return i},jEi.prototype.cloneConnector=function(e,t){e=DTi(e),this.translateObject(e),e.zIndex=Number.MIN_VALUE,e=this.diagram.add(e);return this.diagram.isServerUpdate||this.selectObjects([e],t),e},jEi.prototype.cloneNode=function(e,t,i,n){var o,r,s={},a=DTi(e),l=this.diagram.nameTable[e.parentId];e.shape&&"Bpmn"===e.shape.type&&e.shape.activity&&e.shape.activity.subProcess.processes&&e.shape.activity.subProcess.processes.length&&(r=a.shape.activity.subProcess.processes,a.zIndex=Number.MIN_VALUE,a.shape.activity.subProcess.processes=void 0),e.shape&&"SwimLane"===e.shape.type?Xbi(e,this.diagram,this.clipboardData):l&&"SwimLane"===l.shape.type?Xbi(DTi(l),this.diagram,this.clipboardData,e,!0):o=!e.children||!e.children.length||i&&i.length?(this.translateObject(a,n),a.zIndex=Number.MIN_VALUE,i&&(a.children=i),a.shape&&"TextAnnotation"===a.shape.shape&&(a.isTextAnnotationCopied=!0),this.diagram.add(a)):this.cloneGroup(e,t);for(var h=0,d=Object.keys(s);h<d.length;h++){var p=d[h];this.diagram.add(s[""+p])}return r&&r.length&&(o.shape.activity.subProcess.processes=r,this.cloneSubProcesses(o)),o&&!this.diagram.isServerUpdate&&this.selectObjects([o],t),o},jEi.prototype.cloneSubProcesses=function(e){var t=[],i={};if("Bpmn"===e.shape.type&&e.shape.activity&&e.shape.activity.subProcess.processes&&e.shape.activity.subProcess.processes.length)for(var n=e.shape.activity.subProcess.processes,o=0;o<n.length;o++){for(var r=this.diagram.nameTable[n[parseInt(o.toString(),10)]]||this.clipboardData.processTable[n[parseInt(o.toString(),10)]],s=0,a=r.outEdges;s<a.length;s++){var l=a[s];t.indexOf(l)<0&&t.push(l)}for(var h=0,d=r.inEdges;h<d.length;h++){l=d[h];t.indexOf(l)<0&&t.push(l)}r=DTi(this.clipboardData.processTable[n[parseInt(o.toString(),10)]]),r=(r.processId=e.id,this.cloneNode(r,!1));i[n[parseInt(o.toString(),10)]]=r.id,n[parseInt(o.toString(),10)]=r.id,this.diagram.addProcess(r,e.id);for(var p=0,c=t;p<c.length;p++){var u=c[p],g=DTi(this.diagram.nameTable[""+u]||this.diagram.connectorTable[""+u]);i[g.sourceID]&&i[g.targetID]&&(g.zIndex=-1,g.id+=xTi(),g.sourceID=i[g.sourceID],g.targetID=i[g.targetID],t.splice(t.indexOf(u),1),g.zIndex=Number.MIN_VALUE,this.diagram.add(g))}}},jEi.prototype.cloneGroup=function(e,t){var i,n,o,r=[],s=[],a=[],l=(l=[]).concat(e.children),h=xTi(),d=[];if(this.diagram.blazorActions|=zfi.GroupClipboardInProcess,this.clipboardData.childTable||0<e.children.length)for(var p=0;p<l.length;p++){var c=void 0;(c=this.clipboardData.childTable&&(c=this.clipboardData.childTable[l[parseInt(p.toString(),10)]])||this.diagram.nameTable[l[parseInt(p.toString(),10)]]).parentId="",c&&(S1i(c)===ISi?s.push(c):(o=this.cloneNode(c,t,void 0,h),a.push(c.id),r.push(o.id),d.push(o)))}for(var u=0;u<s.length;u++){if(s[parseInt(u.toString(),10)].sourceID||s[parseInt(u.toString(),10)].targetID)for(var g=0;g<a.length;g++)s[parseInt(u.toString(),10)].sourceID===a[parseInt(g.toString(),10)]&&(i=s[parseInt(u.toString(),10)].sourceID,s[parseInt(u.toString(),10)].sourceID+=h),s[parseInt(u.toString(),10)].targetID===a[parseInt(g.toString(),10)]&&(n=s[parseInt(u.toString(),10)].targetID,s[parseInt(u.toString(),10)].targetID+=h);o=this.cloneConnector(s[parseInt(u.toString(),10)],t),s[parseInt(u.toString(),10)].sourceID=i,s[parseInt(u.toString(),10)].targetID=n,r.push(o.id),d.push(o)}e=this.cloneNode(e,t,r);return d.push(e),e&&e.container&&e.shape&&"UmlClassifier"===e.shape.type&&(this.diagram.updateDiagramObject(e),e.wrapper.measure(new Omi)),this.diagram.blazorActions&=~zfi.GroupClipboardInProcess,this.diagram.isServerUpdate?this.cloneGroupChildCollection=d:this.diagram.UpdateBlazorDiagramModelCollection(void 0,d,void 0,!0),e},jEi.prototype.translateObject=function(e,t){e.id+=t||xTi();var i=10*this.clipboardData.pasteIndex;if(S1i(e)===ISi){if(e.sourcePoint={x:e.sourcePoint.x+i,y:e.sourcePoint.y+i},e.targetPoint={x:e.targetPoint.x+i,y:e.targetPoint.y+i},"Bezier"===e.type)for(var n=e.segments,o=0;o<n.length;o++)Hmi.isEmptyPoint(n[parseInt(o.toString(),10)].point1)||(n[parseInt(o.toString(),10)].point1={x:n[parseInt(o.toString(),10)].point1.x+i,y:n[parseInt(o.toString(),10)].point1.y+i}),Hmi.isEmptyPoint(n[parseInt(o.toString(),10)].point2)||(n[parseInt(o.toString(),10)].point2={x:n[parseInt(o.toString(),10)].point2.x+i,y:n[parseInt(o.toString(),10)].point2.y+i});if(("Straight"===e.type||"Bezier"===e.type)&&e.segments&&0<e.segments.length)for(n=e.segments,o=0;o<n.length-1;o++)n[parseInt(o.toString(),10)].point.x+=i,n[parseInt(o.toString(),10)].point.y+=i}else e.offsetX+=i,e.offsetY+=i},jEi.prototype.drawObject=function(e){e&&e.shape&&"Text"===e.shape.type&&(e.width=this.diagram.drawingObject.width||50,e.height=this.diagram.drawingObject.height||20);for(var t,i=DTi(this.diagram.drawingObject),n=0,o=Object.keys(e);n<o.length;n++){var r=o[n];i[""+r]=e[""+r]}return S1i(this.diagram.drawingObject)===MIi||S1i(this.diagram.drawingObject)===ISi&&"Freehand"===this.diagram.drawingObject.type&&"Bezier"!==e.type?(t=new MIi(this.diagram,"nodes",i,!0)).id=(this.diagram.drawingObject.id||"node")+xTi():(t=new ISi(this.diagram,"connectors",i,!0)).id=(this.diagram.drawingObject&&this.diagram.drawingObject.id||"connector")+xTi(),this.diagram.initObject(t),this.diagram.updateDiagramObject(t),this.diagram.currentDrawingObject=t},jEi.prototype.addObjectToDiagram=function(e){this.diagram.removeFromAQuad(e),this.diagram.removeObjectsFromLayer(this.diagram.nameTable[e.id]),delete this.diagram.nameTable[e.id],e instanceof ISi&&"Bezier"===e.type&&0<e.segments.length&&this.diagram.drawingObject&&"Bezier"===this.diagram.drawingObject.type&&(e.segments=[]);var t=this.diagram.add(e);"SVG"!==this.diagram.mode&&this.diagram.refreshDiagramLayer(),this.selectObjects([t]),e&&!tbi(this.diagram)&&(this.diagram.tool&=~eyi.DrawOnce,this.diagram.currentDrawingObject=void 0)},jEi.prototype.enableServerDataBinding=function(e){this.diagram.enableServerDataBinding(e)},jEi.prototype.addText=function(e,t){t=this.diagram.findElementUnderMouse(e,t,this.diagram);this.diagram.startTextEdit(e,t instanceof Tyi?t.id.split("_")[1]:void 0)},jEi.prototype.isUserHandle=function(e){var t=this.diagram.selectedItems;if(t.wrapper&&o1i(t.constraints,"UserHandle"))for(var i=0,n=t.userHandles;i<n.length;i++){var o=n[i];if(o.visible)if(Awi(e,i1i(t,o,this.diagram.scroller.transform),o.size/(2*this.diagram.scroller.transform.scale)))return!0}return!1},jEi.prototype.selectObjects=function(c,u,g){return _Ei(this,void 0,void 0,function(){var t,i,n,o,r,s,a,l,h,d,p;return HEi(this,function(e){if(t={oldValue:g||this.getSelectedObject(),newValue:c,cause:this.diagram.diagramActions,state:"Changing",type:"Addition",cancel:!1},0<c.length&&c[0]&&c[0].isLane)for(i=this.diagram.getObject(c[0].parentId),c[0].shape.header=[],n=0;n<c.length;n++)for(l=0;l<i.shape.lanes.length;l++)o=c[0].id.split(c[0].parentId),o[1].slice(0,-1)===i.shape.lanes[parseInt(l.toString(),10)].id&&c[0].shape.header.push(i.shape.lanes[parseInt(l.toString(),10)].header);if(this.diagram.enableServerDataBinding(!1),N?this.oldSelectedObjects=w1i(this.diagram):this.diagram.triggerEvent(dyi.selectionChange,t),r=this.diagram.selectedItems.annotation?[this.diagram.selectedItems.annotation]:this.diagram.selectedItems.nodes.concat(this.diagram.selectedItems.connectors),s=$vi(this.diagram),(a=Zvi(this.diagram))||s){if(!s&&(1<c.length||u&&1===c.length)){if(1!==c.length)return[2];this.clearSelection()}if(!(a||s||1!==c.length||u&&xwi(this.diagram)))return this.clearSelection(),[2]}if(!t.cancel){for(l=0;l<c.length;l++)if(h=c[parseInt(l.toString(),10)])if(xwi(this.diagram)){if((0<l||u)&&h.children&&!h.parentId)for(d=0;d<this.diagram.selectedItems.nodes.length;d++)(p=(p=this.diagram.nameTable[this.diagram.selectedItems.nodes[parseInt(d.toString(),10)].parentId])&&this.findParent(p))&&h.id===p.id&&this.selectGroup(h);this.selectProcesses(h),this.selectBpmnSubProcesses(h)&&this.select(h,0<l||u,!0)}else this.select(h,0<l||u,!0);t={oldValue:(g=void 0===g?r:g)||[],newValue:this.getSelectedObject(),cause:this.diagram.diagramActions,state:"Changed",type:"Addition",cancel:!1},this.diagram.renderSelector(u||c&&1<c.length),N||this.diagram.triggerEvent(dyi.selectionChange,t),this.diagram.enableServerDataBinding(!0)}return[2]})})},jEi.prototype.findParent=function(e){return e.parentId&&(e=this.diagram.nameTable[e.parentId],this.findParent(e)),e},jEi.prototype.selectProcesses=function(e){if(this.hasProcesses(e))for(var t=e.shape.activity.subProcess.processes,i=0;i<t.length;i++){var n=this.diagram.nameTable[t[parseInt(i.toString(),10)]];this.hasProcesses(n)&&this.selectObjects([n],!0),this.unSelect(n)}},jEi.prototype.selectGroup=function(e){for(var t=0;t<e.children.length;t++){var i=this.diagram.nameTable[e.children[parseInt(t.toString(),10)]];i.children&&this.selectGroup(i),this.unSelect(this.diagram.nameTable[e.children[parseInt(t.toString(),10)]])}},jEi.prototype.selectBpmnSubProcesses=function(e){var t,i=!0;if(e.processId)i=!Twi(this.diagram,this.diagram.nameTable[e.processId])&&this.selectBpmnSubProcesses(this.diagram.nameTable[e.processId]);else if(e instanceof ISi){if(e.sourceID&&this.diagram.nameTable[e.sourceID]&&this.diagram.nameTable[e.sourceID].processId&&(t=this.diagram.nameTable[e.sourceID].processId),t=e.targetID&&this.diagram.nameTable[e.targetID]&&this.diagram.nameTable[e.targetID].processId?this.diagram.nameTable[e.targetID].processId:t){if(Twi(this.diagram,this.diagram.nameTable[""+t]))return!1;i=this.selectBpmnSubProcesses(this.diagram.nameTable[""+t])}}else e.parentId&&this.diagram.nameTable[e.parentId]&&"UmlClassifier"===this.diagram.nameTable[e.parentId].shape.type&&Twi(this.diagram,this.diagram.nameTable[e.parentId])&&(i=!1);return i},jEi.prototype.hasProcesses=function(e){return!!(e&&"Bpmn"===e.shape.type&&e.shape.activity&&e.shape.activity.subProcess.processes&&0<e.shape.activity.subProcess.processes.length)},jEi.prototype.select=function(e,t,i){var n,o=this.getObjectLayer(e.id);!Nvi(e)||e instanceof qIi||Twi(this.diagram,e)||!o||o.lock||!o.visible||!e.wrapper.visible||((t=!!xwi(this.diagram)&&t)||this.clearSelection(),this.diagram.enableServerDataBinding(!1),o=this.diagram.selectedItems,e instanceof MIi?e.isHeader?(n=this.diagram.nameTable[e.parentId],o.nodes.push(n)):o.nodes.push(e):o.connectors.push(e),o.selectedObjects.push(e),t?(o.wrapper.rotateAngle=o.rotateAngle=0,o.wrapper.children.push(e.wrapper)):(o.init(this.diagram),1===o.nodes.length&&0===o.connectors.length&&((n=Kbi(this.diagram,o))&&(o.wrapper.children[0]=n),o.rotateAngle=o.nodes[0].rotateAngle,o.wrapper.rotateAngle=o.nodes[0].rotateAngle,o.wrapper.pivot=o.nodes[0].pivot)),i||this.diagram.renderSelector(t),this.diagram.enableServerDataBinding(!0))},jEi.prototype.labelSelect=function(e,t,i){this.oldSelectedObjects=w1i(this.diagram);var n,o,t=this.findTarget(t,e),r={oldValue:i||this.getSelectedObject(),newValue:[t],cause:this.diagram.diagramActions,state:"Changing",type:"Addition",cancel:!1};N?this.oldSelectedObjects=w1i(this.diagram):this.diagram.triggerEvent(dyi.selectionChange,r),r.cancel||(n=this.diagram.selectedItems,o=this.diagram.allowServerDataBinding,this.diagram.allowServerDataBinding=!1,n.nodes=n.connectors=[],this.diagram.allowServerDataBinding=o,e instanceof MIi?n.nodes[0]=e:n.connectors[0]=e,n.annotation=t,n.init(this.diagram),this.diagram.renderSelector(!1),r={oldValue:i||[],newValue:[n.annotation],cause:this.diagram.diagramActions,state:"Changed",type:"Addition",cancel:!1},N)||this.diagram.triggerEvent(dyi.selectionChange,r)},jEi.prototype.unSelect=function(t){var e,i,n=this.diagram.selectedItems.nodes.concat(this.diagram.selectedItems.connectors),o=n.filter(function(e){return e.id!==t.id}),r={oldValue:n,newValue:o,cause:this.diagram.diagramActions,state:"Changing",type:"Removal",cancel:!1};this.diagram.currentSymbol||N||this.diagram.triggerEvent(dyi.selectionChange,r),Twi(this.diagram,t)&&(e=this.diagram.selectedItems,i=void 0,(t instanceof MIi?(i=e.nodes.indexOf(t,0),e.nodes):(i=e.connectors.indexOf(t,0),e.connectors)).splice(i,1),i=e.selectedObjects.indexOf(t,0),e.selectedObjects.splice(i,1),r={oldValue:n,newValue:o,cause:this.diagram.diagramActions,state:"Changed",type:"Removal",cancel:!1},(r={oldValue:n,newValue:o,cause:this.diagram.diagramActions,state:"Changed",type:"Removal",cancel:r.cancel}).cancel||(i=e.wrapper.children.indexOf(t.wrapper,0),e.wrapper.children.splice(i,1),this.diagram.updateSelector(),this.diagram.currentSymbol)||this.diagram.triggerEvent(dyi.selectionChange,r))},jEi.prototype.moveSvgNode=function(e,t){var i=this.diagram.nameTable[""+t];"Native"===i.shape.type||"HTML"===i.shape.type?this.updateNativeNodeIndex(e,t):(i=$Ii(t+"_groupElement",this.diagram.element.id),t=$Ii(e+"_groupElement",this.diagram.element.id),i.parentNode.insertBefore(t,i))},jEi.prototype.moveAfterSvgNode=function(e,t){var i=this.diagram.nameTable[""+t];if(!i||"HTML"!==i.shape.type&&"Native"!==i.shape.type){s=$Ii(t+"_groupElement",this.diagram.element.id),r=$Ii(e+"_groupElement",this.diagram.element.id);s.insertAdjacentElement("afterend",r)}else for(var n=0;n<this.diagram.views.length;n++){var o="HTML"===i.shape.type?"_html_element":"_content_groupElement",r=$Ii(e+o,this.diagram.views[parseInt(n.toString(),10)]),s=t?$Ii(t+o,this.diagram.views[parseInt(n.toString(),10)]):r.parentElement.firstChild;r&&s&&r.parentNode.id===s.parentNode.id&&s.insertAdjacentElement("afterend",r)}},jEi.prototype.sendLayerBackward=function(e){e=this.getLayer(e);if(e&&0!==e.zIndex){var t=e.zIndex;if("SVG"===this.diagram.mode){var i=e.objects,n=this.getLayer(this.diagram.layerZIndexTable[t-1]).objects[0];if(n)for(var o=0,r=i;o<r.length;o++){var s=r[o];this.moveSvgNode(s,n)}}i=this.getLayer(this.diagram.layerZIndexTable[t-1]),i=(i.zIndex=i.zIndex+1,e.zIndex=e.zIndex-1,this.diagram.layerZIndexTable[parseInt(t.toString(),10)]);this.diagram.layerZIndexTable[parseInt(t.toString(),10)]=this.diagram.layerZIndexTable[t-1],this.diagram.layerZIndexTable[t-1]=i,"Canvas"===this.diagram.mode&&this.diagram.refreshDiagramLayer()}},jEi.prototype.bringLayerForward=function(e){e=this.getLayer(e);if(e&&e.zIndex<this.diagram.layers.length-1){var t=e.zIndex,i=this.getLayer(this.diagram.layerZIndexTable[t+1]);if("SVG"===this.diagram.mode)for(var n=e.objects[0],o=0,r=i.objects;o<r.length;o++){var s=r[o];s&&this.moveSvgNode(s,n)}i.zIndex=i.zIndex-1,e.zIndex=e.zIndex+1;i=this.diagram.layerZIndexTable[parseInt(t.toString(),10)];this.diagram.layerZIndexTable[parseInt(t.toString(),10)]=this.diagram.layerZIndexTable[t+1],this.diagram.layerZIndexTable[t+1]=i,"Canvas"===this.diagram.mode&&this.diagram.refreshDiagramLayer()}},jEi.prototype.sendToBack=function(e){if(this.diagram.protectPropertyChange(!0),xwi(this.diagram)||e){for(var t=this.diagram.selectedItems,i=[],t=(e&&e.id?i.push(e):i=(i=i.concat(t.nodes)).concat(t.connectors),e&&e.id,DTi(this.diagram.selectedItems)),n=(i=i.slice().sort(function(e,t){return e.zIndex-t.zIndex})).length-1;0<=n;n--){DTi(i[parseInt(n.toString(),10)]);for(var o=i[parseInt(n.toString(),10)].id,r=this.diagram.nameTable[""+o].zIndex,s=this.diagram.layers.indexOf(this.getObjectLayer(o)),a=(this.updateLayerZindexTable(s),this.diagram.layers[parseInt(s.toString(),10)].zIndexTable),l=this.diagram.layers[parseInt(s.toString(),10)].objects,h=null,d=0;d<l.length;d++){var p=this.diagram.nameTable[l[parseInt(d.toString(),10)]];(null===h||p.zIndex<h)&&(h=p.zIndex,p.id)}var c,u,g=JSON.parse(JSON.stringify(a)),m=0;if(1!==this.diagram.nodes.length&&(void 0===this.diagram.nameTable[""+o].children||this.checkObjectBehind(o,a,r))){if((p=this.diagram.nameTable[""+o]).zIndex>h&&"SwimLane"!==p.shape.type?(c=DTi(p),u=null,p.children?(u=this.findMaxZIndex(p)-p.zIndex,p.zIndex=h-1-u,this.updateGroupZindex(p,"SendToBack",h)):p.zIndex=h-1,this.triggerOrderCommand(c,p,p)):"SwimLane"===p.shape.type&&(m=this.swapZIndexObjects(r,a,o,g)),"SVG"===this.diagram.mode){for(var f="SwimLane"!==this.diagram.nameTable[""+o].shape.type?h:m,y=a[parseInt(f.toString(),10)];!y&&f<r;)y=a[++f];(y=this.resetTargetNode(o,y,f,a))&&(y=this.diagram.nameTable[""+y].parentId?this.checkParentExist(y):y,this.moveSvgNode(o,y)),this.updateNativeNodeIndex(o)}else this.diagram.refreshCanvasLayers();this.updateLayerZindexTable(s)}}e=DTi(this.diagram.selectedItems);this.diagram.diagramActions&ryi.UndoRedo||this.addHistoryEntry({type:"SendToBack",category:"Internal",undoObject:t,redoObject:e})}this.diagram.protectPropertyChange(!1)},jEi.prototype.findMaxZIndex=function(e){function n(e){for(var t=0;t<e.children.length;t++){var i=o.diagram.nameTable[e.children[parseInt(t.toString(),10)]];(null===r||i.zIndex>r)&&(r=i.zIndex),i.children&&n(i)}}var o=this,r=null;return n(e),r},jEi.prototype.updateGroupZindex=function(e,t,i){function n(e){for(var t=0;t<e.children.length;t++){var i=r.diagram.nameTable[e.children[parseInt(t.toString(),10)]];i.children?(i.zIndex=o++,n(i)):i.zIndex=o++}}var o,r=this;void 0===o&&(o=e.zIndex+1);n(e)},jEi.prototype.updateLayerZindexTable=function(e){var t=this.diagram.layers[parseInt(e.toString(),10)];t.zIndexTable={};for(var i=0;i<t.objects.length;i++){var n=this.diagram.nameTable[t.objects[parseInt(i.toString(),10)]];t.zIndexTable[n.zIndex]=n.id}},jEi.prototype.swapZIndexObjects=function(e,t,i,n){for(var o=0,r=0,s=-1,a=1,l=0;l<=e;l++)t[parseInt(l.toString(),10)]&&this.diagram.nameTable[t[parseInt(l.toString(),10)]].parentId===i&&(-1===s&&(s=l),r++);for(l=0;l<=e;l++)if(t[parseInt(l.toString(),10)]&&a<=r){for(;!t[parseInt(s.toString(),10)];)s++;t[parseInt(l.toString(),10)]=t[parseInt(s.toString(),10)],this.diagram.nameTable[t[parseInt(l.toString(),10)]].zIndex=l,s++,a++}for(var h=0,l=0;l<r;l++){for(;!t[parseInt(h.toString(),10)];)h++;o=this.diagram.nameTable[t[parseInt(h.toString(),10)]].zIndex,h++}for(o+=1;!t[parseInt(o.toString(),10)];)++o;h=0,t[parseInt(o.toString(),10)]=this.diagram.nameTable[""+i].id,this.diagram.nameTable[""+i].zIndex=o;for(l=o+=1;l<=e;l++)if(t[parseInt(l.toString(),10)]){for(;!n[parseInt(h.toString(),10)];)h++;t[parseInt(l.toString(),10)]=n[parseInt(h.toString(),10)],this.diagram.nameTable[t[parseInt(l.toString(),10)]].zIndex=l,h++}return o},jEi.prototype.resetTargetNode=function(e,t,i,n){return"SwimLane"===this.diagram.nameTable[""+e].shape.type&&void 0!==this.diagram.nameTable[""+t].parentId&&""!==this.diagram.nameTable[""+t].parentId&&this.diagram.nameTable[this.diagram.nameTable[""+t].parentId].isLane&&(i+=1,n[parseInt(i.toString(),10)])?(t=n[parseInt(i.toString(),10)],this.resetTargetNode(e,t,i,n)):t},jEi.prototype.checkParentExist=function(e){for(var t=e;this.diagram.nameTable[""+t].parentId;)t=this.diagram.nameTable[""+t].parentId;return t},jEi.prototype.checkObjectBehind=function(e,t,i){return!0},jEi.prototype.bringToFront=function(e){if(this.diagram.protectPropertyChange(!0),xwi(this.diagram)||e){e&&e.id;for(var t=this.diagram.selectedItems,i=[],e=(e&&e.id?i.push(e):i=(i=i.concat(t.nodes)).concat(t.connectors),DTi(this.diagram.selectedItems)),i=i.slice().sort(function(e,t){return e.zIndex-t.zIndex}),n=0;n<i.length;n++){DTi(i[parseInt(n.toString(),10)]);for(var o=i[parseInt(n.toString(),10)].id,r=this.diagram.layers.indexOf(this.getObjectLayer(o)),s=(this.updateLayerZindexTable(r),this.diagram.layers[parseInt(r.toString(),10)].zIndexTable),a=this.diagram.layers[parseInt(r.toString(),10)].objects,l=null,h=0;h<a.length;h++){var d=this.diagram.nameTable[a[parseInt(h.toString(),10)]];(null===l||d.zIndex>l)&&(l=d.zIndex)}for(var p=JSON.parse(JSON.stringify(s)),c=Number(Object.keys(s).sort(function(e,t){return Number(e)-Number(t)}).reverse()[0]),u=this.diagram.nameTable[""+o].zIndex,g=[],m=0;m<=c;m++)g.push(s[parseInt(m.toString(),10)]);if("SwimLane"===this.diagram.nameTable[""+o].shape.type)for(var f=c;u<=f;f--)if(s[parseInt(f.toString(),10)]&&this.diagram.nameTable[s[parseInt(f.toString(),10)]].parentId!==o){c=f;break}var y=this.diagram.nameTable[""+o];if(y.zIndex<l&&"SwimLane"!==y.shape.type){var v=DTi(y);y.children?this.findMaxZIndex(y)<l&&(y.zIndex=l+1,this.updateGroupZindex(y,"BringToFront",l)):y.zIndex=l+1,this.triggerOrderCommand(v,y,y)}else if("SwimLane"===y.shape.type){for(var b=0,w=-1,C=0,S=0,A=JSON.parse(JSON.stringify(s)),x=0;x<=u;x++)if(s[parseInt(x.toString(),10)]&&this.diagram.nameTable[s[parseInt(x.toString(),10)]].parentId===o&&-1===w){C=w=x;break}for(var I,T,E=0;E<=c;E++)p[parseInt(E.toString(),10)]&&p[parseInt(E.toString(),10)]!==o&&this.diagram.nameTable[p[parseInt(E.toString(),10)]].parentId!==o&&(I=this.diagram.nameTable[p[parseInt(E.toString(),10)]],T=this.diagram.nameTable[""+o],I.zIndex>=T.zIndex)&&b++;for(var D=w,M=0;M<=b;M++){for(;!s[parseInt(D.toString(),10)];)D++;S=this.diagram.nameTable[s[parseInt(D.toString(),10)]].zIndex,D++}for(var k=S;k<=c;k++){for(;!A[parseInt(w.toString(),10)];)w++;for(;!s[parseInt(k.toString(),10)];)k++;s[parseInt(k.toString(),10)]=A[parseInt(w.toString(),10)],this.diagram.nameTable[s[parseInt(k.toString(),10)]].zIndex=k,w++}s[parseInt(c.toString(),10)]=this.diagram.nameTable[""+o].id,this.diagram.nameTable[""+o].zIndex=c;for(var D=u+1,P=C,B=0;B<b;B++){for(;!p[parseInt(D.toString(),10)];)D++;for(;this.diagram.nameTable[p[parseInt(D.toString(),10)]].parentId===o;)D++;for(;!s[parseInt(P.toString(),10)];)P++;s[parseInt(P.toString(),10)]=p[parseInt(D.toString(),10)],this.diagram.nameTable[s[parseInt(P.toString(),10)]].zIndex=P,D++,P++}}if("SVG"===this.diagram.mode){var v="SwimLane"!==this.diagram.nameTable[""+o].shape.type?l:0,y=s[parseInt(v.toString(),10)],y=((y=this.resetTargetNode(o,y,v,s))&&(y=this.diagram.nameTable[""+y].parentId?this.checkParentExist(y):y,this.moveAfterSvgNode(o,y)),this.diagram.diagramLayer),F=$Ii(o+"_groupElement",this.diagram.element.id),L=this.diagram.selectedItems.nodes;if(0<L.length&&("Native"===L[0].shape.type||"HTML"===L[0].shape.type)){F.parentNode.removeChild(F);for(P=0;P<this.diagram.views.length;P++){var R=(F=$Ii(o+("HTML"===L[0].shape.type?"_html_element":"_content_groupElement"),this.diagram.views[parseInt(P.toString(),10)])).parentNode.lastChild;R.parentNode.insertBefore(F,R.nextSibling)}var O=dTi(this.diagram.element.id);this.diagram.diagramRenderer.renderElement(this.diagram.nameTable[""+o].wrapper,y,O)}}else this.diagram.refreshCanvasLayers();this.updateLayerZindexTable(r)}t=DTi(this.diagram.selectedItems);this.diagram.diagramActions&ryi.UndoRedo||this.addHistoryEntry({type:"BringToFront",category:"Internal",undoObject:e,redoObject:t})}this.diagram.protectPropertyChange(!1)},jEi.prototype.triggerOrderCommand=function(e,t,i){e={zIndex:DTi(e).zIndex},t={zIndex:t.zIndex},i={element:i,cause:this.diagram.diagramActions,diagramAction:this.diagram.getDiagramAction(this.diagram.diagramActions),oldValue:e,newValue:t};this.diagram.triggerEvent(dyi.propertyChange,i)},jEi.prototype.checkGroupNode=function(e,t,i){return i[""+t].parentId===i[""+e].parentId},jEi.prototype.sortByZIndex=function(e,t,i){var n,o;return e="BringForward"===i?(n=t||"zIndex",e.sort(function(e,t){return t[""+n]-e[""+n]})):(o=t||"zIndex",e.sort(function(e,t){return e[""+o]-t[""+o]}))},jEi.prototype.orderCommands=function(e,n,t){var o=this;if(d=(d=n.nodes).concat(n.connectors),e){var i=(i=n.selectedObjects).slice().sort(function(e,t){return e.zIndex-t.zIndex});if("SendBackward"===t)for(var r=0;r<i.length;r++)this.sendBackward(i[parseInt(r.toString(),10)]);else if("SendForward"===t)for(r=i.length-1;0<=r;r--)this.sendForward(i[parseInt(r.toString(),10)]);else if("BringToFront"===t)for(r=0;r<i.length;r++)this.bringToFront(i[parseInt(r.toString(),10)]);else if("SendToBack"===t)for(r=i.length-1;0<=r;r--)this.sendToBack(i[parseInt(r.toString(),10)])}else{var e=d[0],s=this.getObjectLayer(e.id),a=s.zIndex,l=s.zIndexTable,h=void 0;if("SendBackward"===t||"SendToBack"===t)for(var d=d.slice().sort(function(e,t){return e.zIndex-t.zIndex}),r=0;r<d.length;r++){var p=d[parseInt(r.toString(),10)];if((w=this.diagram.nameTable[d[parseInt(r.toString(),10)].id]).zIndex=p.zIndex,this.diagram.layers[parseInt(a.toString(),10)].zIndexTable[p.zIndex]=p.id,h=p.id,"SendToBack"===t&&("SwimLane"===d[0].shape.type&&this.bringToFront(d[0]),w.children&&this.updateGroupZindex(w,"",null),this.updateLayerZindexTable(s.zIndex)),"SVG"===this.diagram.mode){for(var c=(C=this.diagram.nameTable[""+h]).zIndex,u=this.diagram.layers.indexOf(this.getObjectLayer(h)),g=this.diagram.layers[parseInt(u.toString(),10)].objects,m=null,f=this,y=0;y<g.length;y++)!function(e){var t=f.diagram.nameTable[g[parseInt(e.toString(),10)]],i=!0;n.selectedObjects.forEach(function(e){i=o.notChildOfSelectedNode(t,e)}),i&&t.zIndex<c&&(null===m||t.zIndex>m)&&(m=t.zIndex)}(y);var v=0,b=void 0;(b=je(I="SwimLane"!==this.diagram.nameTable[""+h].shape.type?m:v)?b:l[parseInt(I.toString(),10)])&&(b=this.diagram.nameTable[""+b].parentId?this.checkParentExist(b):b,"SendBackward"===t?(C.parentId&&this.notChildOfSelectedNode(C,this.diagram.nameTable[""+b])||""===C.parentId)&&this.moveAfterSvgNode(h,b):"SendToBack"===t&&"SwimLane"!==d[0].shape.type&&this.moveAfterSvgNode(h,b))}else this.diagram.refreshCanvasLayers()}else if("SendForward"===t||"BringToFront"===t){d=d.slice().sort(function(e,t){return e.zIndex-t.zIndex});for(r=0;r<d.length;r++){var w,p=d[parseInt(r.toString(),10)];if((w=this.diagram.nameTable[d[parseInt(r.toString(),10)].id]).zIndex=p.zIndex,this.diagram.layers[parseInt(a.toString(),10)].zIndexTable[p.zIndex]=p.id,h=p.id,"BringToFront"===t&&("SwimLane"===d[0].shape.type&&this.sendToBack(d[0]),w.children&&this.updateGroupZindex(w,"",null),this.updateLayerZindexTable(s.zIndex)),"SVG"===this.diagram.mode){for(var C,c=(C=this.diagram.nameTable[""+h]).zIndex,u=this.diagram.layers.indexOf(this.getObjectLayer(h)),g=this.diagram.layers[parseInt(u.toString(),10)].objects,S=null,A=this,x=g.length-1;0<=x;x--)!function(e){var t=A.diagram.nameTable[g[parseInt(e.toString(),10)]],i=!0;n.selectedObjects.forEach(function(e){i=o.notChildOfSelectedNode(t,e)}),!n.selectedObjects.some(function(e){return e.id===t.id})&&i&&t.zIndex>c&&(null===S||t.zIndex<S)&&(S=t.zIndex)}(x);var I,v=0,b=void 0;(b=je(I="SwimLane"!==this.diagram.nameTable[""+h].shape.type?S:v)?b:l[parseInt(I.toString(),10)])&&(b=this.diagram.nameTable[""+b].parentId?this.checkParentExist(b):b,"SendForward"===t?""===C.parentId&&this.moveSvgNode(h,b):"BringToFront"===t&&"SwimLane"!==d[0].shape.type&&this.moveSvgNode(h,b))}else this.diagram.refreshCanvasLayers()}}}},jEi.prototype.sendForward=function(e){var f=this;if(this.diagram.protectPropertyChange(!0),xwi(this.diagram)||e){for(var t=this.diagram.selectedItems,y=[],v=(e&&e.id?y.push(e):y=(y=y.concat(t.nodes)).concat(t.connectors),this.sortByZIndex(y),e&&e.id),b=DTi(this.diagram.selectedItems),w=(this.diagram.startGroupAction(),[]),i=function(e){DTi(y[parseInt(e.toString(),10)]);v=y[parseInt(e.toString(),10)].id;for(var n=C.diagram.layers.indexOf(C.getObjectLayer(v)),t=DTi(C.diagram.nameTable),e=C.diagram.layers[parseInt(n.toString(),10)].zIndexTable,o=C.diagram.nameTable[""+v],r=[],i=C.diagram.spatialSearch.findObjects(o.wrapper.bounds),s=0,a=i=2<i.length?C.sortByZIndex(i,void 0,"BringForward"):i;s<a.length;s++)!function(t){var e,i;o.id!==t.id&&(e=C.getObjectLayer(t.id).zIndex,i=C.diagram.selectedItems.selectedObjects.some(function(e){return e.id===t.id}),1===C.diagram.selectedItems.selectedObjects.length||!i)&&n===e&&Number(C.diagram.nameTable[""+v].zIndex)<Number(t.zIndex)&&""===t.parentId&&o.wrapper.bounds.intersects(t.wrapper.bounds)&&r.push(t)}(l=a[s]);for(var l=r.length-1;0<=l;l--)C.diagram.nameTable[r[parseInt(l.toString(),10)].id].parentId===v&&r.splice(l,1);if(0<r.length){for(var i=C.diagram.nameTable[r[r.length-1].id],l=(i.parentId&&(i=R1i(i,C.diagram,""),(i=C.diagram.nameTable[""+i]).id!==v)&&(r[0]=i),0);l<C.diagram.nodes.length;l++){var h=C.diagram.nodes[parseInt(l.toString(),10)];h.id,h.zIndex}for(var d=0;d<C.diagram.connectors.length;d++){var p=C.diagram.connectors[parseInt(d.toString(),10)];p.id,p.zIndex}var c,i=r[0].zIndex,u=(e[parseInt(i.toString(),10)],{}),g=(r.forEach(function(e){u[e.id]=e.zIndex}),[]),m=(o&&(c=o.zIndex,0<Object.keys(u).length)&&(Object.values(u).forEach(function(e){c<=e&&g.push(e)}),0!==g.length)&&C.updateZIndexBySendForward(o,g,n),[]);Object.keys(C.changedNodeZIndexes).forEach(function(e){(t[""+e]?t[""+e].zIndex:null)!==f.changedNodeZIndexes[""+e]&&(e=DTi(t[""+e]),m.push(e))}),C.updateLayerZindexTable(n),m.forEach(function(t){var e;b.nodes.some(function(e){return e.id===t.id})||(e=DTi(t),b.nodes.push(e))}),"SVG"===C.diagram.mode?(e=r[r.length-1].id,C.moveAfterSvgNode(v,e),C.updateNativeNodeIndex(e,v)):C.diagram.refreshCanvasLayers(),Object.keys(C.changedNodeZIndexes).forEach(function(e){(t[""+e]?t[""+e].zIndex:null)!==f.changedNodeZIndexes[""+e]&&(e=DTi(f.diagram.nameTable[""+e]),w.push(e))})}},C=this,n=y.length-1;0<=n;n--)i(n);var o=DTi(this.diagram.selectedItems);w.forEach(function(t){var e;o.nodes.some(function(e){return e.id===t.id})||(e=DTi(t),o.nodes.push(e))}),this.diagram.diagramActions&ryi.UndoRedo||this.addHistoryEntry({type:"SendForward",category:"Internal",undoObject:b,redoObject:o}),this.diagram.endGroupAction()}this.diagram.protectPropertyChange(!1)},jEi.prototype.updateZIndexBySendForward=function(t,e,i){var n=DTi(t),o=Math.min.apply(Math,e),e=this.diagram.layers[parseInt(i.toString(),10)].zIndexTable[parseInt(o.toString(),10)],r=(this.diagram.nameTable[""+e].children&&(o=this.findGreatestChildZIndex(this.diagram.nameTable[""+e])),this.diagram.layers[parseInt(i.toString(),10)].objects),s=this.diagram.nodes.filter(function(e){return-1!==r.indexOf(e.id)}),a=(this.diagram.connectors.filter(function(e){return-1!==r.indexOf(e.id)}).forEach(function(e){s.push(e)}),s.filter(function(e){return e.zIndex===o&&e.id!==t.id})),l=t.children?(t.zIndex=o+1,this.updateGroupZindex(t,"BringForward",t.zIndex),this.findGreatestChildZIndex(t)):(t.zIndex=o+1,t.zIndex);this.triggerOrderCommand(n,t,t);for(var h=s.slice().sort(function(e,t){return e.zIndex-t.zIndex}),d=!0,p=0;p<h.length;p++){var c=h[parseInt(p.toString(),10)];if(t.children&&(d=this.notChildOfSelectedNode(c,t)),c.zIndex>o&&c!==t&&c.parentId!==t.id&&d&&a&&0<a.length&&c.parentId!==a[0].id){var u=DTi(c);if(!(c.zIndex<=l+1))break;c.zIndex=l+1,l++,this.triggerOrderCommand(u,c,c)}u=c.zIndex;this.changedNodeZIndexes.hasOwnProperty(c.id),this.changedNodeZIndexes[c.id]=u}},jEi.prototype.findGreatestChildZIndex=function(e){function n(e){for(var t=0;t<e.children.length;t++){var i=o.diagram.nameTable[e.children[parseInt(t.toString(),10)]];i.children?n(i):i.zIndex>r&&(r=i.zIndex)}}var o=this,r=e.zIndex;return n(e),r},jEi.prototype.notChildOfSelectedNode=function(e,t){function o(e,t){for(var i=0;i<t.children.length;i++){var n=r.diagram.nameTable[t.children[parseInt(i.toString(),10)]];if(n.id===e.id)return s=!1;n.children&&o(e,n)}}var r=this,s=!0;return t.children&&o(e,t),s},jEi.prototype.sendBackward=function(e){var y=this;if(this.diagram.protectPropertyChange(!0),xwi(this.diagram)||e){for(var t=this.diagram.selectedItems,v=[],b=(e&&e.id?v.push(e):v=(v=v.concat(t.nodes)).concat(t.connectors),this.sortByZIndex(v),e&&e.id),w=DTi(this.diagram.selectedItems),C=(this.diagram.startGroupAction(),[]),i=function(e){DTi(v[parseInt(e.toString(),10)]);b=v[parseInt(e.toString(),10)].id;for(var n=S.diagram.layers.indexOf(S.getObjectLayer(b)),t=DTi(S.diagram.nameTable),e=S.diagram.layers[parseInt(n.toString(),10)].zIndexTable,o=S.diagram.nameTable[""+b],r=[],i=S.diagram.spatialSearch.findObjects(o.wrapper.bounds),s=0,a=i=2<i.length?S.sortByZIndex(i):i;s<a.length;s++)!function(t){var e,i;o.id!==t.id&&(e=S.getObjectLayer(t.id).zIndex,i=S.diagram.selectedItems.selectedObjects.some(function(e){return e.id===t.id}),1===S.diagram.selectedItems.selectedObjects.length||!i)&&n===e&&Number(S.diagram.nameTable[""+b].zIndex)>Number(t.zIndex)&&""===t.parentId&&o.wrapper.bounds.intersects(t.wrapper.bounds)&&r.push(t)}(l=a[s]);for(var l=r.length-1;0<=l;l--)(h=S.diagram.nameTable[r[parseInt(l.toString(),10)].id]).parentId===b&&r.splice(l,1);if(0<r.length){(h=S.diagram.nameTable[r[r.length-1].id]).parentId&&(i=R1i(h,S.diagram,""),i=S.diagram.nameTable[""+i],b!==i.id)&&(r[r.length-1]=i);for(var h,l=0;l<S.diagram.nodes.length;l++){var d=S.diagram.nodes[parseInt(l.toString(),10)];d.id,d.zIndex}for(var p=0;p<S.diagram.connectors.length;p++){var c=S.diagram.connectors[parseInt(p.toString(),10)];c.id,c.zIndex}var u,i=r[r.length-1].zIndex,g=(e[parseInt(i.toString(),10)],{}),m=(r.forEach(function(e){g[e.id]=e.zIndex}),[]),f=(o&&(u=o.zIndex,0<Object.keys(g).length)&&(Object.values(g).forEach(function(e){e<=u&&m.push(e)}),0!==m.length)&&S.updateZIndexBySendBackward(o,m,n),[]);Object.keys(S.changedNodeZIndexes).forEach(function(e){(t[""+e]?t[""+e].zIndex:null)!==y.changedNodeZIndexes[""+e]&&(e=DTi(t[""+e]),f.push(e))}),S.updateLayerZindexTable(n),f.forEach(function(t){var e;w.nodes.some(function(e){return e.id===t.id})||(e=DTi(t),w.nodes.push(e))}),"SVG"===S.diagram.mode?(e=r[r.length-1].id,(i=r[r.length-1])&&"HTML"!==i.shape.type&&"Native"!==i.shape.type&&S.moveSvgNode(b,e),(i=S.diagram.nameTable[""+e]).children&&0<i.children.length?S.updateNativeNodeIndex(b):S.updateNativeNodeIndex(b,e)):S.diagram.refreshCanvasLayers(),Object.keys(S.changedNodeZIndexes).forEach(function(e){(t[""+e]?t[""+e].zIndex:null)!==y.changedNodeZIndexes[""+e]&&(e=DTi(y.diagram.nameTable[""+e]),C.push(e))})}},S=this,n=0;n<v.length;n++)i(n);var o=DTi(this.diagram.selectedItems);C.forEach(function(t){var e;o.nodes.some(function(e){return e.id===t.id})||(e=DTi(t),o.nodes.push(e))}),this.diagram.diagramActions&ryi.UndoRedo||this.addHistoryEntry({type:"SendBackward",category:"Internal",undoObject:w,redoObject:o}),this.diagram.endGroupAction()}this.diagram.protectPropertyChange(!1)},jEi.prototype.updateZIndexBySendBackward=function(t,e,i){var n=DTi(t),o=Math.max.apply(Math,e),r=this.diagram.layers[parseInt(i.toString(),10)].objects,s=this.diagram.nodes.filter(function(e){return-1!==r.indexOf(e.id)}),a=(this.diagram.connectors.filter(function(e){return-1!==r.indexOf(e.id)}).forEach(function(e){s.push(e)}),s.filter(function(e){return e.zIndex===o&&e.id!==t.id})),l=t.children?(e=this.findMaxZIndex(t)-t.zIndex,t.zIndex=o-1-e,this.updateGroupZindex(t,"SendBackward",t.zIndex),this.findLowestChildZIndex(t)):(t.zIndex=o-1,t.zIndex);this.triggerOrderCommand(n,t,t);for(var h=s.slice().sort(function(e,t){return t.zIndex-e.zIndex}),d=!0,p=0;p<h.length;p++){var c=h[parseInt(p.toString(),10)];if(t.children&&(d=this.notChildOfSelectedNode(c,t)),c.zIndex<o&&c!==t&&c.parentId!==t.id&&d&&a&&0<a.length&&c.parentId!==a[0].id){var u=DTi(c);if(!(c.zIndex>=l-1))break;c.zIndex=l-1,l--,this.triggerOrderCommand(u,c,c)}u=c.zIndex;this.changedNodeZIndexes.hasOwnProperty(c.id),this.changedNodeZIndexes[""+c.id]=u}},jEi.prototype.findLowestChildZIndex=function(e){for(var t=e.zIndex,i=0;i<e.children.length;i++){var n=this.diagram.nameTable[e.children[parseInt(i.toString(),10)]];n.zIndex<t&&(t=n.zIndex)}return t},jEi.prototype.updateNativeNodeIndex=function(e,t){for(var i,n,o=this.diagram.selectedItems.nodes[0]||this.diagram.getObject(t),r=0;r<this.diagram.views.length;r++)!o||"HTML"!==o.shape.type&&"Native"!==o.shape.type||(i=$Ii(e+(n="HTML"===o.shape.type?"_html_element":"_content_groupElement"),this.diagram.views[parseInt(r.toString(),10)]),n=t?$Ii(t+n,this.diagram.views[parseInt(r.toString(),10)]):i.parentElement.firstChild,i&&n&&i.parentNode.id===n.parentNode.id&&n.parentNode.insertBefore(i,n))},jEi.prototype.initSelectorWrapper=function(){var e=this.diagram.selectedItems;e.init(this.diagram),1===e.nodes.length&&0===e.connectors.length&&(e.rotateAngle=e.nodes[0].rotateAngle,e.wrapper.rotateAngle=e.nodes[0].rotateAngle,e.wrapper.pivot=e.nodes[0].pivot)},jEi.prototype.doRubberBandSelection=function(e){this.clearSelectionRectangle();var t=[],i=this.diagram.getNodesConnectors([]);(t="CompleteIntersect"===this.diagram.selectedItems.rubberBandSelectionMode?aAi(e,i):this.diagram.spatialSearch.findObjects(e)).length&&this.selectObjects(t,!0)},jEi.prototype.clearSelectionRectangle=function(){var e=tTi(this.diagram.element.id).getElementById(this.diagram.element.id+"_diagramAdorner_selected_region");e&&ue(e)},jEi.prototype.dragConnectorEnds=function(e,t,i,n,o,r){var s,a,l,h=!1;return t instanceof qIi?s=t.connectors[0]:t instanceof ISi&&this.diagram.currentDrawingObject&&(this.clearSelection(),s=this.diagram.currentDrawingObject),"BezierSourceThumb"!==e&&"BezierTargetThumb"!==e||(s.isBezierEditing=h=!0),"ConnectorSourceEnd"===e||"BezierSourceThumb"===e?(a=i.x-(h?n.bezierPoint1:s.sourcePoint).x,l=i.y-(h?n.bezierPoint1:s.sourcePoint).y,this.dragSourceEnd(s,a,l,null,i,e,void 0,o,r,void 0,n)):(a=i.x-(h?n.bezierPoint2:s.targetPoint).x,l=i.y-(h?n.bezierPoint2:s.targetPoint).y,this.dragTargetEnd(s,a,l,null,i,e,void 0,n))},jEi.prototype.getSelectedObject=function(){var e=this.diagram.selectedItems;return e.annotation?[e.annotation]:e.nodes.concat(e.connectors)},jEi.prototype.enableCloneObject=function(e){},jEi.prototype.getBlazorOldValues=function(e,t){},jEi.prototype.clearObjectSelection=function(e){var t=this.diagram.selectedItems,i=[];-1===(i=i.concat(t.nodes,t.connectors)).indexOf(e)&&(this.clearSelection(0<i.length),this.selectObjects([e],!0))},jEi.prototype.clearSelection=function(r,e){return _Ei(this,void 0,void 0,function(){var t,i,n,o;return HEi(this,function(e){return t=this.diagram.allowServerDataBinding,this.diagram.enableServerDataBinding(!1),xwi(this.diagram)&&(i=this.diagram.selectedItems,n=this.getSelectedObject(),this.diagram.currentSymbol&&(this.diagram.previousSelectedObject=n),o={oldValue:n,newValue:[],cause:this.diagram.diagramActions,state:"Changing",type:"Removal",cancel:!1},r&&!N&&this.diagram.triggerEvent(dyi.selectionChange,o),o.cancel||(i.offsetX=0,i.offsetY=0,i.width=0,i.height=0,i.rotateAngle=0,i.nodes=[],i.connectors=[],i.wrapper=null,i.annotation=void 0,i.selectedObjects=[],this.diagram.clearSelectorLayer(),r&&(o={oldValue:n,newValue:[],cause:this.diagram.diagramActions,state:"Changed",type:"Removal",cancel:!1},N||this.diagram.triggerEvent(dyi.selectionChange,o))),this.diagram.enableServerDataBinding(t)),[2]})})},jEi.prototype.clearSelectedItems=function(){var e=this.diagram.selectedItems.nodes?this.diagram.selectedItems.nodes.length:0,t=this.diagram.selectedItems.connectors?this.diagram.selectedItems.connectors.length:0;this.clearSelection(0<e+t)},jEi.prototype.removeStackHighlighter=function(){var e=tTi(this.diagram.element.id),e=e.getElementById(e.id+"_stack_highlighter");e&&e.parentNode.removeChild(e)},jEi.prototype.renderStackHighlighter=function(e,t){var i,n,o,r,s,a=this.diagram.selectedItems.nodes[0];if(!t){var l=this.diagram.findObjectsUnderMouse(e.position);if((t=this.diagram.findObjectUnderMouse(l,"Drag",!0))&&!(t.isLane||t.isPhase||t.isHeader))for(var h=0;h<l.length;h++){var d=this.diagram.nameTable[l[parseInt(h.toString(),10)].id];d.isLane&&!d.isPhase&&!d.isHeader||(this.diagram.parentObject=t=d)}}a&&t&&t.isLane&&a.shape&&!a.shape.isPhase&&(o=this.diagram.nameTable[t.parentId],this.diagram.currentSymbol&&"SwimLane"===o.shape.type&&(i=!0),a&&!a.parentId&&"SwimLane"!==a.shape.type||a&&a.parentId&&this.diagram.nameTable[a.parentId]&&this.diagram.nameTable[a.parentId].isLane&&a.parentId!==t.parentId&&a.parentId!==t.id)&&(n=this.diagram.selectedItems,r=Kbi(this.diagram,n,t.id,!0),this.diagram.renderSelector(!1,!0,r),n.wrapper.children[0]=n.nodes[0].wrapper),a&&t&&t.parentId&&a.shape&&a.shape.isPhase&&"SwimLane"===this.diagram.nameTable[t.parentId].shape.type&&(r=this.diagram.nameTable[t.parentId].wrapper,this.diagram.renderSelector(!1,!0,r)),(i&&this.diagram.currentSymbol.shape.isLane||a&&t&&a.parentId&&t.parentId&&!a.isPhase&&a.parentId===t.parentId&&a.id!==t.id&&o&&o.container&&("Stack"===o.container.type||"Grid"===o.container.type))&&(r=void 0,s="Vertical"===o.container.orientation,s="Stack"===o.container?s:!s,"Grid"===o.container.type&&t.isLane&&("Horizontal"===o.shape.orientation&&t.rowIndex!==a.rowIndex||"Vertical"===o.shape.orientation&&t.columnIndex!==a.columnIndex||this.diagram.currentSymbol&&this.diagram.currentSymbol.shape.orientation===o.container.orientation)&&(n=this.diagram.selectedItems,a.isLane&&rwi(a,this.diagram)||!a.isLane)&&(r=Kbi(this.diagram,n,t.id,i)),a="Stack"===o.container.type?t.wrapper:r)&&bwi(a,s,e.position,this.diagram,!1,!0)},jEi.prototype.insertBlazorConnector=function(e){if(e instanceof qIi)for(var t=0;t<e.connectors.length;t++)this.diagram.insertBlazorConnector(e.connectors[parseInt(t.toString(),10)]);else this.diagram.insertBlazorConnector(e)},jEi.prototype.drag=function(e,t,i){var n;if(!this.diagram.rotateUsingButton&&e.shape&&"SwimLane"!==e.shape.type&&(this.diagram.eventHandler.currentAction="Drag"),Vvi(e)&&this.checkBoundaryConstraints(t,i,e.wrapper.bounds)&&sbi(this.diagram))if(e instanceof MIi){var o={offsetX:e.offsetX,offsetY:e.offsetY};if(e.offsetX+=t,e.offsetY+=i,e.children&&!e.container){pwi(this.diagram,e,!0)||(this.diagram.diagramActions=this.diagram.diagramActions|ryi.isGroupDragging);for(var r=this.getAllDescendants(e,[]),s=0;s<r.length;s++)n=this.diagram.nameTable[r[parseInt(s.toString(),10)].id],this.drag(n,t,i);this.updateInnerParentProperties(e),this.diagram.diagramActions=this.diagram.diagramActions&~ryi.isGroupDragging}pwi(this.diagram,e,!0)?cwi(this.diagram,e):(e&&e.shape&&"UmlClassifier"===e.shape.type&&(e.wrapper.measureChildren=!0),this.diagram.nodePropertyChange(e,o,{offsetX:e.offsetX,offsetY:e.offsetY},void 0,void 0,!1),e.wrapper.measureChildren=!1),"SwimLane"!==e.shape.type||this.diagram.currentSymbol||(a=e.wrapper.children[0],Nbi(kbi(this.diagram,a),this.diagram))}else{var a=e,l=DTi(e),o={sourcePoint:l.sourcePoint,targetPoint:l.targetPoint},l="Bezier"===a.type,h=!1,l=(a.sourceWrapper?h=!0:this.dragSourceEnd(a,t,i,!0,null,"",l),a.targetWrapper?h=!0:this.dragTargetEnd(a,t,i,!0,null,"",l),!1);e instanceof ISi&&(l=!0),h&&!l||(this.dragControlPoint(a,t,i,!0),e={sourcePoint:a.sourcePoint,targetPoint:a.targetPoint},this.diagram.connectorPropertyChange(a,o,e))}for(var d=0,p=this.diagram.views;d<p.length;d++){var c=p[d],c=this.diagram.views[c];c instanceof rAi&&this.diagram.refreshCanvasDiagramLayer(c)}},jEi.prototype.connectorSegmentChange=function(e,t,i){var n,o,r=!0;if(!1===t.equals(t,e.wrapper.bounds)&&0<e.outEdges.length)for(var s=0;s<e.outEdges.length;s++){var a=this.diagram.nameTable[e.outEdges[parseInt(s.toString(),10)]],r=""!==a.targetID?!this.isSelected(this.diagram.nameTable[a.targetID]):!this.isSelected(this.diagram.nameTable[a.id]);if("Orthogonal"===a.type&&a.segments&&1<a.segments.length)if(i){var l=a.segments[0],h=a.segments[1],d=J0i(H0i(e.wrapper,e.wrapper.corners,e.wrapper.bounds),l.direction),d=ovi({corners:void 0,point:$0i(a,a.sourceWrapper,d,{x:a.sourceWrapper.offsetX,y:a.sourceWrapper.offsetY},!1),margin:void 0,direction:l.direction},{corners:void 0,point:h.points[1],margin:void 0,direction:void 0});l.length=Hmi.distancePoints(d[0],d[1]),h.direction&&h.length&&(h.length=Hmi.distancePoints(d[1],d[2]))}else if(r){switch(a.segments[0].direction){case"Bottom":n=e.wrapper.bounds.bottomCenter.x-t.bottomCenter.x,o=e.wrapper.bounds.bottomCenter.y-t.bottomCenter.y;break;case"Top":n=e.wrapper.bounds.topCenter.x-t.topCenter.x,o=e.wrapper.bounds.topCenter.y-t.topCenter.y;break;case"Left":n=e.wrapper.bounds.middleLeft.x-t.middleLeft.x,o=e.wrapper.bounds.middleLeft.y-t.middleLeft.y;break;case"Right":n=e.wrapper.bounds.middleRight.x-t.middleRight.x,o=e.wrapper.bounds.middleRight.y-t.middleRight.y}this.dragSourceEnd(a,n,o,!0,null,"ConnectorSourceEnd",void 0,void 0,void 0,!(e.parentId&&this.diagram.diagramActions&ryi.isGroupDragging))}}},jEi.prototype.updateEndPoint=function(e,t){e.sourcePoint,e.targetPoint,e.sourceID,e.targetID,e.sourcePortID,e.targetPortID,e.segments;var i={sourcePoint:e.sourcePoint,targetPoint:e.targetPoint};e.sourceID&&(i.sourceID=e.sourceID),e.targetID&&(i.targetID=e.targetID),e.sourcePortID&&(i.sourcePortID=e.sourcePortID),e.targetPortID&&(i.targetPortID=e.targetPortID),e.segments&&(i.segments=e.segments),this.diagram.connectorPropertyChange(e,t||{},i),this.diagram.updateSelector()},jEi.prototype.dragSourceEnd=function(e,t,i,n,o,r,s,a,l,h,d){var p=this.diagram.nameTable[e.id],c={},u=this.checkBoundaryConstraints(t,i,p.wrapper.bounds);if(Hvi(p)&&u&&"BezierSourceThumb"!==r&&sbi(this.diagram)&&(c=DTi(c={sourcePoint:p.sourcePoint}),p.sourcePoint.x+=t,p.sourcePoint.y+=i,"ConnectorSourceEnd"===r&&"Orthogonal"===p.type&&this.changeSegmentLength(p,a,l,h),"Bpmn"===p.shape.type)&&"Default"===p.shape.sequence&&"Sequence"===p.shape.flow&&this.updatePathElementOffset(p),"Bezier"===p.type)if(c={sourcePoint:p.sourcePoint},d)this.translateBezierPoints(e,""===r?"ConnectorSourceEnd":r,t,i,d,o,!s);else for(var g=0;g<e.segments.length;g++)this.translateBezierPoints(e,""===r?"ConnectorSourceEnd":r,t,i,e.segments[parseInt(g.toString(),10)],o,!s);return n||this.updateEndPoint(p,c),this.diagram.realActions&ayi.AnimationClick||this.diagram.refreshCanvasLayers(),u},jEi.prototype.updatePathElementOffset=function(e){e.wrapper.children.splice(3,1);new kyi;var t=e.intermediatePoints,t=I1i(t,e);e.wrapper.children.splice(3,0,t)},jEi.prototype.changeSegmentLength=function(e,t,i,n){var o,r,s,a,l,h=!t||this.canConnect(e,t);e.segments&&null!==e.segments[0].direction&&(!t&&""===e.sourceID||n)&&h?(n=e.segments[0],o=e.segments[1],r=this.diagram.nameTable[e.sourceID],s=void 0,n.points[0]=e.sourcePoint,"Top"===n.direction||"Bottom"===n.direction?(n.points[n.points.length-1].x=e.sourcePoint.x,o.points[0].y=n.points[n.points.length-1].y):(n.points[n.points.length-1].y=e.sourcePoint.y,o.points[0].x=n.points[n.points.length-1].x),n.direction&&(n.length||0===n.length)&&(n.length=Hmi.distancePoints(n.points[0],n.points[n.points.length-1])),o.direction&&(o.length||0===o.length)&&(o.length=Hmi.distancePoints(n.points[n.points.length-1],o.points[o.points.length-1]),o.direction=Hmi.direction(n.points[n.points.length-1],o.points[o.points.length-1])),""!==e.sourcePortID&&n.length<10?2<e.segments.length?(l=e.segments[2],a=Hmi.direction(l.points[0],l.points[1]),n.direction===mvi(a)?("Right"===n.direction?l.points[0].x=n.points[n.points.length-1].x=r.wrapper.corners.middleRight.x+20:"Left"===n.direction?l.points[0].x=n.points[n.points.length-1].x=r.wrapper.corners.middleLeft.x-20:"Top"===n.direction?l.points[0].y=n.points[n.points.length-1].y=r.wrapper.corners.topCenter.y-20:l.points[0].y=n.points[n.points.length-1].y=r.wrapper.corners.bottomCenter.y+20,l.direction&&l.length&&(l.length=Hmi.distancePoints(l.points[0],l.points[l.points.length-1])),n.length=Hmi.distancePoints(n.points[0],n.points[n.points.length-1])):n.direction===a&&l.direction&&l.length?("Top"===n.direction||"Bottom"===n.direction?(l.points[0]=n.points[0],l.points[l.points.length-1].x=l.points[0].x):(l.points[0]=n.points[0],l.points[l.points.length-1].y=l.points[0].y),l.length=Hmi.distancePoints(l.points[0],l.points[l.points.length-1]),e.segments.splice(0,2)):n.length=20):n.length=20:n.length<1&&(""!==e.sourceID&&("Right"===o.direction?(s=r.wrapper.corners.middleRight,o.points[o.points.length-1].y=s.y):"Left"===o.direction?(s=r.wrapper.corners.middleLeft,o.points[o.points.length-1].y=s.y):(s="Top"===o.direction?r.wrapper.corners.topCenter:r.wrapper.corners.bottomCenter,o.points[o.points.length-1].x=s.x),o.length=Hmi.distancePoints(s,o.points[o.points.length-1]),2<e.segments.length)&&(l=e.segments[2]).direction&&l.length&&(l.length=Hmi.distancePoints(o.points[o.points.length-1],l.points[l.points.length-1])),e.segments.splice(0,1))):(t&&!i&&e.sourceID!==t.id&&e.segments&&null!==e.segments[0].direction&&t&&t instanceof MIi&&h&&this.changeSourceEndToNode(e,t),t&&i&&e.sourcePortID!==i&&e.segments&&null!==e.segments[0].direction&&t&&t instanceof MIi&&h&&this.changeSourceEndToPort(e,t,i))},jEi.prototype.canConnect=function(e,t){return!(!Uvi(t)||!Gvi(t))},jEi.prototype.changeSourceEndToPort=function(e,t,i){var n,o,r,i=this.diagram.getWrapper(t.wrapper,i),i={x:i.offsetX,y:i.offsetY},t=uvi(i,TTi(t.wrapper),t.wrapper.bounds),s=e.segments[0],a=e.segments[1];s.direction!==t?(n=[],o={},s.direction===mvi(t)?(o={},r=void 0,o="Top"===t||"Bottom"===t?(r="Top"===t?{type:"Orthogonal",isTerminal:!0,direction:t,length:Math.abs(s.points[0].y-i.y)}:{type:"Orthogonal",isTerminal:!0,direction:t,length:Math.abs(i.y-s.points[0].y)},s.points[0].x>i.x?{type:"Orthogonal",isTerminal:!0,direction:"Right",length:s.points[0].x-i.x}:{type:"Orthogonal",isTerminal:!0,direction:"Left",length:i.x-s.points[0].x}):(r="Right"===t?{type:"Orthogonal",isTerminal:!0,direction:t,length:Math.abs(s.points[0].x-i.x)}:{type:"Orthogonal",isTerminal:!0,direction:t,length:Math.abs(i.x-s.points[0].x)},s.points[0].y>i.y?{type:"Orthogonal",direction:"Top",isTerminal:!0,length:s.points[0].y-i.y}:{type:"Orthogonal",direction:"Bottom",isTerminal:!0,length:i.y-s.points[0].y}),n.push(new sSi(e,"segments",r,!0)),n.push(new sSi(e,"segments",o,!0))):n.push(new sSi(e,"segments",o={type:"Orthogonal",direction:t,length:20,isTerminal:!0},!0)),s.direction!==mvi(t)&&("Top"===t||"Bottom"===t?(s.points[0].x=i.x,s.points[0].y=s.points[s.points.length-1].y="Top"===t?i.y-20:i.y+20):(s.points[0].y=i.y,s.points[0].x=s.points[s.points.length-1].x="Right"===t?i.x+20:i.x-20),s.length=Hmi.distancePoints(s.points[0],s.points[s.points.length-1]),a.length=Hmi.distancePoints(s.points[s.points.length-1],a.points[a.points.length-1])),e.segments=n.concat(e.segments)):(s.points[0]=i,"Top"===t||"Bottom"===t?s.points[s.points.length-1].x=i.x:s.points[s.points.length-1].y=i.y,s.length=Hmi.distancePoints(s.points[0],s.points[s.points.length-1]),a.length=Hmi.distancePoints(s.points[s.points.length-1],a.points[a.points.length-1]))},jEi.prototype.removeTerminalSegment=function(e,t){for(var i=0;i<e.segments.length-2;i++){var n=e.segments[0];n.isTerminal&&(t?n.isTerminal=!1:(e.segments.splice(i,1),i--))}},jEi.prototype.changeSourceEndToNode=function(e,t){this.removeTerminalSegment(e);var i,n,o,t=t.wrapper.children[0].corners,r=e.segments[0],s=e.segments[1],a=[];"Right"===r.direction||"Left"===r.direction?(i="Left"===r.direction?t.middleLeft:t.middleRight,r.length>t.width||"Left"===r.direction&&i.x>=r.points[0].x||"Right"===r.direction&&i.x<=r.points[0].x?(r.points[0].y=r.points[r.points.length-1].y=i.y,r.points[0].x=i.x,r.length=Hmi.distancePoints(r.points[0],r.points[r.points.length-1]),s.length=Hmi.distancePoints(r.points[r.points.length-1],s.points[s.points.length-1])):(o=void 0,n="Bottom"===(o=s.direction||Hmi.direction(s.points[0],s.points[s.points.length-1]))?t.bottomCenter:t.topCenter,s.length&&s.direction&&(s.length="Top"===o?r.points[r.points.length-1].y-(n.y+20):n.y+20-r.points[r.points.length-1].y),r.length=r.points[r.points.length-1].x-n.x,r.direction=0<r.length?"Right":"Left",a.push(new sSi(e,"segments",{type:"Orthogonal",direction:o,length:20},!0)),e.segments=a.concat(e.segments))):(i="Bottom"===r.direction?t.bottomCenter:t.topCenter,r.length>t.height||"Top"===r.direction&&i.y>=r.points[0].y||"Bottom"===r.direction&&i.y<=r.points[0].y?(r.points[0].x=r.points[r.points.length-1].x=i.x,r.points[0].y=i.y,r.length=Hmi.distancePoints(r.points[0],r.points[r.points.length-1]),s.length=Hmi.distancePoints(r.points[r.points.length-1],s.points[s.points.length-1])):(n="Left"===s.direction?t.middleLeft:t.middleRight,o=void 0,o=s.direction||Hmi.direction(s.points[0],s.points[s.points.length-1]),s.length&&s.direction&&(s.length="Left"===o?r.points[r.points.length-1].x-(n.x+20):n.x+20-r.points[r.points.length-1].x),r.length=r.points[r.points.length-1].y-n.y,r.direction=0<r.length?"Bottom":"Top",a.push(new sSi(e,"segments",{type:"Orthogonal",direction:o,length:20},!0)),e.segments=a.concat(e.segments)))},jEi.prototype.translateBezierPoints=function(e,t,i,n,o,r,s){var a,l,h,d,p=e.segments.indexOf(o),c=e.segments[parseInt(p.toString(),10)],u=0<p?e.segments[p-1]:null,u=null!==u?u.point:e.sourcePoint,p=p===e.segments.length-1?e.targetPoint:c.point;c&&("BezierSourceThumb"===t&&(c.vector1.angle||c.vector1.distance)?(a=c.vector1.distance,l=c.vector1.angle,c.vector1={distance:e.distance(u,r),angle:Hmi.findAngle(u,r)},h=c.vector1.distance-a,d=c.vector1.angle-l,this.translateSubsequentSegment(e,o,!0,h,d)):"BezierTargetThumb"===t&&(c.vector2.angle||c.vector2.distance)?(a=c.vector2.distance,l=c.vector2.angle,c.vector2={distance:e.distance(p,r),angle:Hmi.findAngle(p,r)},h=c.vector2.distance-a,d=c.vector2.angle-l,this.translateSubsequentSegment(e,o,!1,h,d)):("ConnectorSourceEnd"===t&&!e.sourceID||"ConnectorTargetEnd"===t&&!e.targetID)&&s&&pSi(c.vector1)&&pSi(c.vector2)?(Hmi.isEmptyPoint(c.point1)&&(c.bezierPoint1=cSi(e.sourcePoint,e.targetPoint)),Hmi.isEmptyPoint(c.point2)&&(c.bezierPoint2=cSi(e.targetPoint,e.sourcePoint))):"BezierSourceThumb"===t||"ConnectorSourceEnd"===t&&!s&&pSi(c.vector1)?(c.bezierPoint1.x+=i,c.bezierPoint1.y+=n,Hmi.isEmptyPoint(c.point1)&&!s||(c.point1={x:c.bezierPoint1.x,y:c.bezierPoint1.y}),0===i&&0===n||!0!==o.isInternalSegment||(o.isInternalSegment=!1)):("BezierTargetThumb"===t||"ConnectorTargetEnd"===t&&!s&&pSi(c.vector2))&&(c.bezierPoint2.x+=i,c.bezierPoint2.y+=n,Hmi.isEmptyPoint(c.point2)&&!s||(c.point2={x:c.bezierPoint2.x,y:c.bezierPoint2.y}),0===i&&0===n||!0!==o.isInternalSegment||(o.isInternalSegment=!1)))},jEi.prototype.translateSubsequentSegment=function(e,t,i,n,o){t=e.segments.indexOf(t);e.segments[parseInt(t.toString(),10)];e.bezierSettings.smoothness&gyi.SymmetricAngle||(o=null),null==(n=e.bezierSettings.smoothness&gyi.SymmetricDistance?n:null)&&null==o||(i?0!==t&&this.updatePreviousBezierSegment(e,t,n,o):t!==e.segments.length-1&&this.updateNextBezierSegment(e,t,n,o))},jEi.prototype.updatePreviousBezierSegment=function(e,t,i,n){e=e.segments[t-1],t=e.vector2.distance+i,i=(e.vector2.angle+n)%360;i<0&&(i+=360),e.vector2={distance:t,angle:i}},jEi.prototype.updateNextBezierSegment=function(e,t,i,n){e=e.segments[t+1],t=e.vector1.distance+i,i=(e.vector1.angle+n)%360;i<0&&(i+=360),e.vector1={distance:t,angle:i}},jEi.prototype.dragTargetEnd=function(e,t,i,n,o,r,s,a){var l,h,d=this.diagram.nameTable[e.id],p=this.checkBoundaryConstraints(t,i,d.wrapper.bounds);if(zvi(d)&&"BezierTargetThumb"!==r&&p&&sbi(this.diagram)&&(h=DTi(h={targetPoint:d.targetPoint}),d.targetPoint.x+=t,d.targetPoint.y+=i,"ConnectorTargetEnd"===r&&"Orthogonal"===d.type&&d.segments&&0<d.segments.length&&(l=d.segments[d.segments.length-2])&&2===d.segments[d.segments.length-1].points.length&&("Left"===l.direction||"Right"===l.direction?l.points[l.points.length-1].x=d.targetPoint.x:l.points[l.points.length-1].y=d.targetPoint.y,l.length=Hmi.distancePoints(l.points[0],l.points[l.points.length-1]),l.direction=Hmi.direction(l.points[0],l.points[l.points.length-1])),"Bpmn"===d.shape.type)&&"Default"===d.shape.sequence&&"Sequence"===d.shape.flow&&this.updatePathElementOffset(d),"Bezier"===d.type)if(h={targetPoint:d.targetPoint},a)this.translateBezierPoints(e,""===r?"ConnectorTargetEnd":r,t,i,a,o,!s);else for(var c=0;c<e.segments.length;c++)this.translateBezierPoints(e,""===r?"ConnectorTargetEnd":r,t,i,e.segments[parseInt(c.toString(),10)],o,!s);return n||this.updateEndPoint(d,h),this.diagram.realActions&ayi.AnimationClick||this.diagram.refreshCanvasLayers(),p},jEi.prototype.dragControlPoint=function(e,t,i,n,o){var r,s=this.diagram.nameTable[e.id];if(("Straight"===s.type||"Bezier"===s.type)&&0<s.segments.length){if(void 0!==o&&s.segments[parseInt(o.toString(),10)])"Bezier"===s.type?((r=(e=s.segments[parseInt(o.toString(),10)]).isInternalSegment)&&null!==s.bezierSettings&&"FreeForm"!==s.bezierSettings.segmentEditOrientation?("Horizontal"===e.orientation?e.point.x+=t:e.point.y+=i,this.updateDirectionalBezierCurve(s)):(e.point.x+=t,e.point.y+=i),r&&(s.isBezierEditing=!0)):(s.segments[parseInt(o.toString(),10)].point.x+=t,s.segments[parseInt(o.toString(),10)].point.y+=i);else for(var a=0;a<s.segments.length-1;a++)s.segments[parseInt(a.toString(),10)].point.x+=t,s.segments[parseInt(a.toString(),10)].point.y+=i;n||this.updateEndPoint(s)}return!0},jEi.prototype.updateDirectionalBezierCurve=function(e){var t=[];t.push(e.sourcePoint);for(var i=0;i<e.segments.length-1;i++){var n=e.segments[parseInt(i.toString(),10)];"Horizontal"===n.orientation?t.push({x:n.point.x,y:t[t.length-1].y}):t.push({x:t[t.length-1].x,y:n.point.y}),i===e.segments.length-2&&("Horizontal"===n.orientation?t.push({x:n.point.x,y:e.targetPoint.y}):t.push({x:e.targetPoint.x,y:n.point.y}))}t.push(e.targetPoint);var o,r,s,a,l,h,d=t[0],p=t[t.length-1];1<e.segments.length&&(s={x:.5*((r=t[1]).x+(o=t[2]).x),y:.5*(r.y+o.y)},(a=e.segments[0]).vector1.angle=K0i(d,r),a.vector1.distance=.5*Hmi.findLength(d,r),a.vector2.angle=K0i(s,r),a.vector2.distance=.5*Hmi.findLength(s,r),a.point=s,(d=e.segments[1]).vector1.angle=K0i(s,o),d.vector1.distance=.5*Hmi.findLength(s,o),2<e.segments.length?(a={x:.5*(o.x+(r=t[3]).x),y:.5*(o.y+r.y)},d.vector2.angle=K0i(a,o),d.vector2.distance=.5*Hmi.findLength(a,o),d.point=a,(s=e.segments[2]).vector1.angle=K0i(a,r),s.vector1.distance=.5*Hmi.findLength(a,r),3<e.segments.length?(l={x:.5*(r.x+(a=t[4]).x),y:.5*(r.y+a.y)},s.vector2.angle=K0i(l,r),s.vector2.distance=.5*Hmi.findLength(l,r),s.point=l,(h=e.segments[3]).vector1.angle=K0i(l,a),h.vector1.distance=.5*Hmi.findLength(l,a),h.vector2.angle=K0i(p,a),h.vector2.distance=.5*Hmi.findLength(p,a)):(s.vector2.angle=K0i(p,r),s.vector2.distance=.5*Hmi.findLength(p,r))):(d.vector2.angle=K0i(p,o),d.vector2.distance=.5*Hmi.findLength(p,o)))},jEi.prototype.rotateObjects=function(e,t,i,n,o){n=n||{};var r=ofi();afi(r,i,n.x,n.y);for(var s=0,a=t;s<a.length;s++){var l,h,d=a[s];d instanceof MIi?Wvi(d)&&sbi(this.diagram)&&(!1===o&&e===d||(h={offsetX:d.wrapper.offsetX,offsetY:d.wrapper.offsetY,rotateAngle:d.rotateAngle},d.rotateAngle=(d.rotateAngle+i+360)%360,l=rfi(r,{x:d.wrapper.offsetX,y:d.wrapper.offsetY}),d.offsetX=l.x,d.offsetY=l.y,this.diagram.nodePropertyChange(d,h,{offsetX:d.offsetX,offsetY:d.offsetY,rotateAngle:d.rotateAngle})),d.processId&&(l=this.diagram.nameTable[d.processId],h=this.diagram.bpmnModule.getChildrenBound(l,d.id,this.diagram),this.diagram.bpmnModule.updateSubProcessess(h,d,this.diagram)),d.children)&&d.children.length&&!d.container&&this.getChildren(d,t):this.rotatePoints(d,i,n||{x:d.wrapper.offsetX,y:d.wrapper.offsetY}),this.diagram.updateDiagramObject(d)}this.diagram.refreshCanvasLayers(),this.diagram.updateSelector()},jEi.prototype.snapConnectorEnd=function(e){return this.diagram.snapSettings.constraints&Qfi.SnapToLines&&this.snappingModule&&this.diagram.snappingModule.snapConnectorEnd(e),e},jEi.prototype.snapAngle=function(e){return this.diagram.snapSettings.constraints&Qfi.SnapToLines&&this.snappingModule?this.snappingModule.snapAngle(this.diagram,e):0},jEi.prototype.rotatePoints=function(e,t,i){var n;e.sourceWrapper&&e.targetWrapper||(afi(n=ofi(),t,i.x,i.y),e.sourcePoint=rfi(n,e.sourcePoint),e.targetPoint=rfi(n,e.targetPoint),"Bpmn"===e.shape.type&&"Default"===e.shape.sequence&&"Sequence"===e.shape.flow&&this.updatePathElementOffset(e),t={sourcePoint:e.sourcePoint,targetPoint:e.targetPoint},this.diagram.connectorPropertyChange(e,{},t),e.segments&&0<e.segments.length&&(this.diagram.protectPropertyChange(!0),(i=e).segments=[],this.diagram.connectorPropertyChange(i,{},{segments:i.segments}),this.diagram.protectPropertyChange(!1)))},jEi.prototype.updateInnerParentProperties=function(e){for(var t=this.diagram.isProtectedOnChange,i=(this.diagram.protectPropertyChange(!0),this.getAllDescendants(e,[],!1,!0)),n=0;n<i.length;n++){var o=this.diagram.nameTable[i[parseInt(n.toString(),10)].id];o.offsetX=o.wrapper.offsetX,o.offsetY=o.wrapper.offsetY,o.width=o.wrapper.width,o.height=o.wrapper.height}this.diagram.protectPropertyChange(t)},jEi.prototype.scale=function(e,t,i,n,o,r){var s=this.diagram.nameTable[e.id],a=s,l=s.wrapper,h=(o=o||e).wrapper,d=v1i(h.offsetX-h.actualSize.width*h.pivot.x,h.offsetY-h.actualSize.height*h.pivot.y,h.actualSize.width,h.actualSize.height,h.rotateAngle,h.offsetX,h.offsetY,n);if(void 0!==l.actualSize.width&&void 0!==l.actualSize.height&&sbi(this.diagram)){if(a.children&&!a.container){for(var p=0,c=this.getAllDescendants(a,[]);p<c.length;p++){var u=c[p];this.scaleObject(t,i,d,u,l,o)}e.wrapper.measure(new Omi),e.wrapper.arrange(e.wrapper.desiredSize),this.diagram.updateGroupOffset(s),this.updateInnerParentProperties(a)}else this.scaleObject(t,i,d,s,l,o);h=ETi(e.wrapper);if(!this.checkBoundaryConstraints(void 0,void 0,h)&&r)return this.scale(e,1/t,1/i,n,void 0,!0),!1;this.diagram.updateDiagramObject(e)}return!0},jEi.prototype.getAllDescendants=function(e,t,i,n){for(var o=e,r=[],s=0;s<o.children.length;s++)(e=this.diagram.nameTable[o.children[parseInt(s.toString(),10)]])&&(e.children?(i&&t.push(e),n&&r.push(e),t=this.getAllDescendants(e,t)):t.push(e));return n?r:t},jEi.prototype.getChildren=function(e,t){var i=e;if(e.children&&e.children.length)for(var n=0;n<i.children.length;n++)(e=this.diagram.nameTable[i.children[parseInt(n.toString(),10)]])&&t.push(e);return t},jEi.prototype.cloneChild=function(e){return this.diagram.nameTable[""+e]},jEi.prototype.scaleObject=function(e,t,i,n,o,r,s){t=t<0?1:t;var a,l,h,d,p,c,u,g,m,f,y={};(1!==(e=e<0?1:e)||1!==t)&&(m=g=void 0,n instanceof MIi&&(f=u=void 0,y={width:(l=n).wrapper.actualSize.width,height:n.wrapper.actualSize.height,offsetX:n.wrapper.offsetX,offsetY:n.wrapper.offsetY,margin:{top:l.margin.top,left:l.margin.left}},"Bpmn"===l.shape.type&&l.shape.activity.subProcess.processes&&0<l.shape.activity.subProcess.processes.length&&(f=this.diagram.bpmnModule.getChildrenBound(l,l.id,this.diagram),u=l.wrapper.bounds.containsRect(f)),g=l.wrapper.actualSize.width*e,m=l.wrapper.actualSize.height*t,a=(l.constraints&Kfi.AspectRatio)===Kfi.AspectRatio,h=void 0!==l.minWidth&&0!==l.minWidth,c=void 0!==l.maxWidth&&0!==l.maxWidth,d=void 0!==l.minHeight&&0!==l.minHeight,p=void 0!==l.maxHeight&&0!==l.maxHeight,a?(a=l.wrapper.actualSize,h&&d?m/l.minHeight<g/l.minWidth?m<l.minHeight&&(m=l.minHeight,g=l.minHeight*(a.width/a.height)):g<l.minWidth&&(g=l.minWidth,m=l.minWidth*(a.height/a.width)):h?g<l.minWidth&&(g=l.minWidth,m=l.minWidth*(a.height/a.width)):d&&m<l.minHeight&&(m=l.minHeight,g=l.minHeight*(a.width/a.height)),c&&p?m/l.maxHeight>g/l.maxWidth?m>l.maxHeight&&(m=l.maxHeight,g=l.maxHeight*(a.width/a.height)):g>l.maxWidth&&(g=l.maxWidth,m=l.maxWidth*(a.height/a.width)):c?g>l.maxWidth&&(g=l.maxWidth,m=l.maxWidth*(a.height/a.width)):p&&m>l.maxHeight&&(m=l.maxHeight,g=l.maxHeight*(a.width/a.height))):(c&&(g=Math.min(l.maxWidth,g)),h&&(g=Math.max(l.minWidth,g)),d&&(m=Math.max(l.minHeight,m)),p&&(m=Math.min(l.maxHeight,m))),u&&(g=Math.max(g,f.right-l.wrapper.bounds.x),m=Math.max(m,f.bottom-l.wrapper.bounds.y)),e=g/l.actualSize.width,t=m/l.actualSize.height),afi(a=ofi(),-(c=(r=r||n).wrapper).rotateAngle,i.x,i.y),lfi(a,e,t,i.x,i.y),afi(a,c.rotateAngle,i.x,i.y),n instanceof MIi?(h=rfi(a,{x:(l=n).wrapper.offsetX,y:l.wrapper.offsetY}),d=l.wrapper.offsetX-l.wrapper.actualSize.width*l.pivot.x,p=l.wrapper.offsetY-l.wrapper.actualSize.height*l.pivot.y,0<g&&(l.processId&&(u=this.diagram.nameTable[l.processId]).maxWidth&&!(l.margin.left+g<u.maxWidth)||(l.width=g,l.offsetX=h.x)),0<m&&(l.processId&&(r=this.diagram.nameTable[l.processId]).maxHeight&&!(l.margin.top+m<r.maxHeight)||(l.height=m,l.offsetY=h.y)),c=l.wrapper.offsetX-l.wrapper.actualSize.width*l.pivot.x,u=l.wrapper.offsetY-l.wrapper.actualSize.height*l.pivot.y,(g=this.diagram.nameTable[l.processId])&&(c=l.offsetX-l.width*l.pivot.x,u=l.offsetY-l.height*l.pivot.y),g&&(l.margin.top+(u-p)<=0||l.margin.left+(c-d)<=0)?"Drag"!==this.diagram.eventHandler.currentAction?this.diagram.nodePropertyChange(n,{},{margin:{top:l.margin.top,left:l.margin.left}}):this.diagram.nodePropertyChange(n,{},{width:l.width,height:l.height,margin:{top:l.margin.top,left:l.margin.left}}):pwi(this.diagram,n,!0)?cwi(this.diagram,n):s||this.diagram.nodePropertyChange(n,y,{width:l.width,height:l.height,offsetX:l.offsetX,offsetY:l.offsetY,margin:{top:l.margin.top+(u-p),left:l.margin.left+(c-d)}})):(r={sourcePoint:n.sourcePoint,targetPoint:n.targetPoint},n.sourceWrapper&&n.targetWrapper||this.scaleConnector(n,a,r,e,t,i)),m=this.diagram.nameTable[n.processId])&&(m.wrapper.bounds,n.wrapper.bounds,f=this.diagram.bpmnModule.getChildrenBound(m,n.id,this.diagram),this.diagram.bpmnModule.updateSubProcessess(f,n,this.diagram))},jEi.prototype.scaleConnector=function(e,t,i,n,o,r){e.sourcePoint=rfi(t,e.sourcePoint),e.targetPoint=rfi(t,e.targetPoint),"Bpmn"===e.shape.type&&"Default"===e.shape.sequence&&"Sequence"===e.shape.flow&&this.updatePathElementOffset(e);var s,t={sourcePoint:e.sourcePoint,targetPoint:e.targetPoint},i=(this.diagram.connectorPropertyChange(e,i,t),this.diagram.selectedItems);O1i(this.diagram,i)&&(s={offsetX:(t=DTi(this.diagram.selectedItems)).offsetX,offsetY:t.offsetY,height:t.height,width:t.width,rotateAngle:t.rotateAngle},(s=new MIi(this.diagram,"nodes",s,!0)).wrapper=t.wrapper,s.wrapper.rotateAngle=i.rotateAngle,this.scaleObject(n,o,r,s,s.wrapper,s,!0),i.wrapper.actualSize.width=s.width,i.wrapper.actualSize.height=s.height,i.wrapper.offsetX=s.offsetX,i.wrapper.offsetY=s.offsetY,this.diagram.selectedItems.connectors[0].id!==e.id)&&this.measureSelector(i)},jEi.prototype.measureSelector=function(e){for(var t=void 0,i=[],i=DTi(this.diagram.selectedItems).connectors,n={x:this.diagram.selectedItems.offsetX,y:this.diagram.selectedItems.offsetY},o=0;o<i.length;o++){var r=ofi(),r=(afi(r,-e.rotateAngle,n.x,n.y),i[parseInt(o.toString(),10)].sourcePoint=rfi(r,i[parseInt(o.toString(),10)].sourcePoint),i[parseInt(o.toString(),10)].targetPoint=rfi(r,i[parseInt(o.toString(),10)].targetPoint),{x:i[parseInt(o.toString(),10)].sourcePoint.x,y:i[parseInt(o.toString(),10)].sourcePoint.y}),s={x:i[parseInt(o.toString(),10)].targetPoint.x,y:i[parseInt(o.toString(),10)].targetPoint.y},r=this.calculateBounds(r,s);void 0===t?t=r:t.uniteRect(r)}var a={},a={offsetX:(a=void 0!==t?{x:t.x+t.width*e.wrapper.pivot.x,y:t.y+t.height*e.wrapper.pivot.y}:a).x,offsetY:a.y,height:t.height,width:t.width,rotateAngle:0},a=new MIi(this.diagram,"nodes",a,!0),l=ofi(),l=(afi(l,e.rotateAngle,n.x,n.y),a.rotateAngle+=e.rotateAngle,a.rotateAngle=(a.rotateAngle+360)%360,rfi(l,{x:a.offsetX,y:a.offsetY})),l=(a.offsetX=l.x,a.offsetY=l.y,e.wrapper.actualSize.width=t.width,e.wrapper.actualSize.height=t.height,e.wrapper.offsetX=a.offsetX,e.wrapper.offsetY=a.offsetY,iTi(this.diagram.element.id));this.diagram.diagramRenderer.renderResizeHandle(e.wrapper,l,e.thumbsConstraints,this.diagram.scroller.currentZoom,e.constraints,this.diagram.scroller.transform,!1,Vvi(e),null,null,e.handleSize)},jEi.prototype.calculateBounds=function(e,t){var i=Math.min(e.x,t.x),n=Math.max(e.x,t.x),o=Math.min(e.y,t.y),e=Math.max(e.y,t.y);return new tfi(i,o,n-i,e-o)},jEi.prototype.portDrag=function(e,t,i,n){var o,r,t=this.findTarget(t,e),s=ETi(e.wrapper);t&&lbi(t,this.diagram)&&(e instanceof MIi?(o=this.getPortChanges(e,t),t.offset.x+=i/s.width,t.offset.y+=n/s.height,t.offset.x=Math.max(0,Math.min(1,t.offset.x)),t.offset.y=Math.max(0,Math.min(1,t.offset.y)),r=this.getPortChanges(e,t),this.diagram.nodePropertyChange(e,o,r)):(o=this.getConnectorPortChanges(e,t),this.updatePortOffset(e,t,i,n),t.alignment="Center",r=this.getConnectorPortChanges(e,t),this.diagram.connectorPropertyChange(e,o,r)),this.diagram.updateDiagramObject(e))},jEi.prototype.labelDrag=function(e,t,i,n){var o=this.findTarget(t,e),r=TTi(e.wrapper),s=this.getAnnotationChanges(e,o),a=this.getSelectedObject(),r=(o instanceof f0i?(o.offset.x+=i/r.width,o.offset.y+=n/r.height):(this.updatePathAnnotationOffset(e,o,i,n),o instanceof b0i&&(o.alignment="Center")),this.getAnnotationChanges(e,o));e instanceof MIi?this.diagram.nodePropertyChange(e,s,r):this.diagram.connectorPropertyChange(e,s,r),this.diagram.updateDiagramObject(e),Twi(this.diagram,o,!1,t)||this.labelSelect(e,t,a);for(var l=0,h=this.diagram.views;l<h.length;l++){var d=h[l],d=this.diagram.views[d];d instanceof dDi||this.diagram.refreshCanvasDiagramLayer(d)}},jEi.prototype.updatePathAnnotationOffset=function(e,t,i,n,o,r){var s,a,l,h=this.diagram.getWrapper(e.wrapper,t.id),d=h.offsetX,p=h.offsetY,c=e.intermediatePoints,u=0;switch(t.verticalAlignment){case"Center":"Center"===t.horizontalAlignment?l=o||{x:d+i,y:p+n}:"Right"===t.horizontalAlignment?l=o||{x:d+h.actualSize.width/2+i,y:p+n}:"Left"===t.horizontalAlignment&&(l=o||{x:d-h.actualSize.width/2+i,y:p+n});break;case"Top":"Center"===t.horizontalAlignment?l=o||{x:d+i,y:p-h.actualSize.height/2+n}:"Right"===t.horizontalAlignment?l=o||{x:d+h.actualSize.width/2+i,y:p-h.actualSize.height/2+n}:"Left"===t.horizontalAlignment&&(l=o||{x:d-h.actualSize.width/2+i,y:p-h.actualSize.height/2+n});break;case"Bottom":"Center"===t.horizontalAlignment?l=o||{x:d+i,y:p+h.actualSize.height/2+n}:"Right"===t.horizontalAlignment?l=o||{x:d+h.actualSize.width/2+i,y:p+h.actualSize.height/2+n}:"Left"===t.horizontalAlignment&&(l=o||{x:d-h.actualSize.width/2+i,y:p+h.actualSize.height/2+n})}var g,m,f,y=this.getInterceptWithSegment(l,c),v=c[c.length-1],b=Hmi.getLengthFromListOfPoints(c);if(0<y.length){if(t.dragLimit=t.dragLimit||{},v=t.dragLimit.top||t.dragLimit.bottom||t.dragLimit.left||t.dragLimit.right?(v=this.getRelativeOffset(l,c,g={minDistance:null}),f=this.getRelativeOffset(l,y,m={minDistance:null}),null!=g&&m.minDistance<g.minDistance?f:LAi(e.intermediatePoints,t).point):f=y[y.length-1]){for(var w=void 0,w=0;w<c.length;w++){if(null!=a){if(tfi.toBounds([a,c[parseInt(w.toString(),10)]]).containsPoint(v)){u+=Hmi.findLength(a,v);break}u+=Hmi.findLength(a,c[parseInt(w.toString(),10)])}a=c[parseInt(w.toString(),10)]}s={x:u/b,y:0}}this.updateLabelMargin(e,t,s,l,r,i,n)}else this.updateLabelMargin(e,t,null,l,r,i,n)},jEi.prototype.updatePortOffset=function(e,t,i,n,o,r){var s,a,l,h=this.diagram.getWrapper(e.wrapper,t.id),d=h.offsetX,p=h.offsetY,c=e.intermediatePoints,u=0;switch(t.verticalAlignment){case"Center":"Center"===t.horizontalAlignment?l=o||{x:d+i,y:p+n}:"Right"===t.horizontalAlignment?l=o||{x:d+h.actualSize.width/2+i,y:p+n}:"Left"===t.horizontalAlignment&&(l=o||{x:d-h.actualSize.width/2+i,y:p+n});break;case"Top":"Center"===t.horizontalAlignment?l=o||{x:d+i,y:p-h.actualSize.height/2+n}:"Right"===t.horizontalAlignment?l=o||{x:d+h.actualSize.width/2+i,y:p-h.actualSize.height/2+n}:"Left"===t.horizontalAlignment&&(l=o||{x:d-h.actualSize.width/2+i,y:p-h.actualSize.height/2+n});break;case"Bottom":"Center"===t.horizontalAlignment?l=o||{x:d+i,y:p+h.actualSize.height/2+n}:"Right"===t.horizontalAlignment?l=o||{x:d+h.actualSize.width/2+i,y:p+h.actualSize.height/2+n}:"Left"===t.horizontalAlignment&&(l=o||{x:d-h.actualSize.width/2+i,y:p+h.actualSize.height/2+n})}var g=this.getInterceptWithSegment(l,c),m=c[c.length-1],f=Hmi.getLengthFromListOfPoints(c);if(0<g.length){m=g[g.length-1];var y={minDistance:null},v=(m=this.getRelativeOffset(l,c,y),{minDistance:null}),g=this.getRelativeOffset(l,g,v);if(m=null!=y&&v.minDistance<y.minDistance?g:LAi(e.intermediatePoints,t).point){for(var b=void 0,b=0;b<c.length;b++){if(null!=a){if(tfi.toBounds([a,c[parseInt(b.toString(),10)]]).containsPoint(m)){u+=Hmi.findLength(a,m);break}u+=Hmi.findLength(a,c[parseInt(b.toString(),10)])}a=c[parseInt(b.toString(),10)]}s={x:u/f,y:0}}this.updateLabelMargin(e,t,s,l,r,i,n)}else this.updateLabelMargin(e,t,null,l,r,i,n)},jEi.prototype.getRelativeOffset=function(e,t,i){for(var n,o,r,s=0;s<t.length;s++)r=t[parseInt(s.toString(),10)],o=Math.round(Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))),null!==i.minDistance&&Math.min(Math.abs(i.minDistance),Math.abs(o))!==Math.abs(o)||(n=r,i.minDistance=o);return n},jEi.prototype.dragLimitValue=function(e,t,i,n){var o=!1,r=!1;return{x:o=i.x>=t.x-e.left-n.width/2&&i.x<=t.x+e.right+n.width/2?!0:o,y:r=i.y>=t.y-e.top-n.height/2&&i.y<=t.y+e.bottom+n.height/2?!0:r}},jEi.prototype.updateLabelMargin=function(e,t,i,n,o,r,s){if(i=i||{x:t.offset,y:0},t&&i&&0<i.x&&i.x<1){var a=Hmi.getLengthFromListOfPoints(e.intermediatePoints),a=this.getPointAtLength(a*i.x,e.intermediatePoints,0),l=this.diagram.scrollSettings.currentZoom,h=t.dragLimit||{left:0,right:0,top:0,bottom:0};if(h.top||h.bottom||h.left||h.right||t instanceof l0i){this.diagram.getWrapper(e.wrapper,t.id);var d=new tfi(0,0,0,0),e=this.diagram.getWrapper(e.wrapper,t.id),r=(d.x=e.offsetX/l+r,d.y=e.offsetY/l+s,d.width=t instanceof l0i?0:e.bounds.width/l,d.height=t instanceof l0i?0:e.bounds.height/l,new tfi(a.x-(h.left||0)-d.width/2,a.y-(h.top||0)-d.height/2,(h.left||0)+(h.right||0)+d.width,(h.top||0)+(h.bottom||0)+d.height));if(!r.containsPoint(n))for(var p=0,c=this.boundsInterSects([a,n],r,!1);p<c.length;p++)n=c[p];s=this.dragLimitValue(h,a,n,d);t.margin={left:s.x?n.x-a.x:t.margin.left,top:s.y?n.y-a.y:t.margin.top,right:0,bottom:0}}else t.margin={left:n.x-a.x,top:n.y-a.y,right:0,bottom:0};t.offset=i.x,o&&(t.width=o.width,t.height=o.height)}},jEi.prototype.boundsInterSects=function(e,t,i){var n;return t&&(t=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height},{x:t.x,y:t.y}],n=this.intersect(e,t,i)),n},jEi.prototype.intersect=function(e,t,i){for(var n=[],o=0;o<e.length-1;o++)for(var r=0;r<t.length-1;r++){var s=AAi(e[o],e[o+1],t[r],t[r+1]);0!==s.x&&0!==s.y&&n.push(s)}return n},jEi.prototype.getPointAtLength=function(e,t,i){for(var n,o,r=0,s={x:0,y:0},a=0;a<t.length;a++){if(o=t[a],n){var l,h,d,p=Hmi.findLength(n,o);if(e<=r+p){d=e-r,l=Hmi.findAngle(n,o),h=d*Math.cos(l*Math.PI/180),d=d*Math.sin(l*Math.PI/180),s={x:n.x+h,y:n.y+d};break}r+=p}n=o}return s},jEi.prototype.getInterceptWithSegment=function(e,t){for(var i=[],n=[],o=Hmi.findLength({x:0,y:0},{x:this.diagram.scroller.viewPortWidth,y:this.diagram.scroller.viewPortHeight}),r=1;r<t.length;r++){var s=[t[r-1],t[r]],n=[],a=Math.round(Hmi.findAngle(s[0],s[1])%360),l=Math.round(Hmi.findAngle(s[1],s[0])%360),h=0<a&&a<=90||180<a&&a<=270?90:-90;n.push(Hmi.transform(e,a+h,o)),n.push(Hmi.transform(e,l+h,o));a=SAi({x1:s[0].x,y1:s[0].y,x2:s[1].x,y2:s[1].y},{x1:n[0].x,y1:n[0].y,x2:n[1].x,y2:n[1].y});a.enabled&&i.push(a.intersectPt)}return i},jEi.prototype.getAnnotationChanges=function(e,t){var i={};return i[d1i(e,t.id,!0)]={width:t.width,height:t.height,offset:e instanceof MIi?{x:t.offset.x,y:t.offset.y}:t.offset,rotateAngle:t.rotateAngle,margin:{left:t.margin.left,right:t.margin.right,top:t.margin.top,bottom:t.margin.bottom},horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,alignment:e instanceof ISi?t.alignment:void 0},{annotations:i}},jEi.prototype.getConnectorPortChanges=function(e,t){var i={};return i[p1i(e,t.id)]={width:t.width,height:t.height,offset:t.offset,margin:{left:t.margin.left,right:t.margin.right,top:t.margin.top,bottom:t.margin.bottom},horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,alignment:e instanceof ISi?t.alignment:void 0},{ports:i}},jEi.prototype.getPortChanges=function(e,t){var i={};return i[d1i(e,t.id,!1)]={offset:t.offset},{ports:i}},jEi.prototype.labelRotate=function(e,t,i,n){var o=this.getAnnotationChanges(e,t),r=(ofi(),t.rotateAngle,this.diagram.getWrapper(e.wrapper,t.id)),i=K0i({x:r.offsetX,y:r.offsetY},i)+90,s=this.snapAngle(i),i=0!==s?s:i;t instanceof b0i&&t.segmentAngle&&(i-=kAi(e.intermediatePoints,t,e.wrapper.bounds).angle),t.rotateAngle+=(i=(i+360)%360)-(t.rotateAngle+r.parentTransform),t instanceof b0i&&(t.alignment="Center"),n.wrapper.rotateAngle=n.rotateAngle=t.rotateAngle,s=this.getAnnotationChanges(e,t),e instanceof MIi?this.diagram.nodePropertyChange(e,o,s):this.diagram.connectorPropertyChange(e,o,s),this.diagram.updateDiagramObject(e);for(var a=0,l=this.diagram.views;a<l.length;a++){var h=l[a],h=this.diagram.views[h];h instanceof dDi||this.diagram.refreshCanvasDiagramLayer(h)}},jEi.prototype.labelResize=function(e,t,i,n,o,r){var s,a,l,h=this.getAnnotationChanges(e,t),r=r.wrapper.children[0];(i&&1!==i||n&&1!==n)&&(l=ofi(),s=ofi(),afi(l,-e.rotateAngle,e.offsetX,e.offsetY),afi(s,-(a=(r.rotateAngle+(e instanceof MIi?e.rotateAngle:0)+360)%360),o.x,o.y),lfi(s,i,n,o.x,o.y),afi(s,a,o.x,o.y),a=rfi(s,{x:r.offsetX,y:r.offsetY}),o=r.actualSize.height*n,s=r.actualSize.width*i,(n=this.findTarget(r,e))instanceof b0i&&(a.y+="Top"===n.verticalAlignment?-o/2:"Bottom"===n.verticalAlignment?o/2:0,a.x+="Left"===n.horizontalAlignment?-s/2:"Right"===n.horizontalAlignment?s/2:0),n instanceof b0i?this.updatePathAnnotationOffset(e,t,0,0,a,new Omi(s,o)):(i=TTi(e.wrapper),(a=rfi(l,a)).x=a.x-r.margin.left+r.margin.right,a.y=a.y-r.margin.top+r.margin.bottom,a.y+="Top"===n.verticalAlignment?-o/2:"Bottom"===n.verticalAlignment?o/2:0,a.x+="Left"===n.horizontalAlignment?-s/2:"Right"===n.horizontalAlignment?s/2:0,l=i.width/(a.x-i.x),r=i.height/(a.y-i.y),1<s&&(n.width=s,n.offset.x=1/l),1<o&&(n.height=o,n.offset.y=1/r))),t instanceof b0i&&(t.alignment="Center"),a=this.getAnnotationChanges(e,t),e instanceof MIi?this.diagram.nodePropertyChange(e,h,a):this.diagram.connectorPropertyChange(e,h,a),this.diagram.updateDiagramObject(e);for(var d=0,p=this.diagram.views;d<p.length;d++){var c=p[d],c=this.diagram.views[c];c instanceof dDi||this.diagram.refreshCanvasDiagramLayer(c)}},jEi.prototype.getSubProcess=function(e){var t,i={nodes:[],connectors:[]};return e instanceof MIi?t=e.processId:e&&e.nodes&&e.nodes.length&&e.nodes[0].processId&&(t=e.nodes[0].processId),t&&i.nodes.push(DTi(this.diagram.nameTable[t])),i},jEi.prototype.checkBoundaryConstraints=function(e,t,i,n){var o,r,s=this.diagram.pageSettings,a=this.diagram.pageSettings.boundaryConstraints,l=this.diagram.scroller;return"Page"!==a&&"Diagram"!==a||(o=i?void 0:this.diagram.selectedItems.wrapper.bounds,r="Page"===a?s.width:l.viewPortWidth,a="Page"===a?s.height:l.viewPortHeight,s=(i?i:o).right+(e||0),l=(i?i:o).left+(e||0),e=(i?i:o).top+(t||0),i=(i?i:o).bottom+(t||0),!!(s<=r&&0<=l&&i<=a&&0<=e||"None"!==this.diagram.layout.type&&n))},jEi.prototype.dragSelectedObjects=function(e,t){var i=this,n=this.diagram.selectedItems,o=(this.state&&!this.state.backup&&(this.state.backup={},this.state.backup.offsetX=n.offsetX,this.state.backup.offsetY=n.offsetY),n=dwi(this.diagram,n)||n,this.diagram.selectedItems.nodes.filter(function(e){return"SwimLane"===e.shape.type})),r=[];if(0<o.length&&!this.diagram.currentSymbol&&1<this.diagram.selectedItems.nodes.length+this.diagram.selectedItems.connectors.length){var s=this.diagram.selectedItems.nodes.filter(function(e){return""===e.parentId||"SwimLane"!==i.diagram.nameTable[e.parentId].shape.type});if(0<s.length){for(var a=0;a<s.length;a++)(this.diagram.nameTable[s[parseInt(a.toString(),10)].parentId]&&this.diagram.nameTable[s[parseInt(a.toString(),10)].parentId].isLane||"SwimLane"===s[parseInt(a.toString(),10)].shape.type)&&(s.splice(a,1),a--);for(var l=o.filter(function(t,e,i){return e===i.findIndex(function(e){return e.id===t.id})}),a=0;a<l.length;a++)r=r.concat(kbi(this.diagram,l[a].wrapper.children[0]));(0<s.length||1<l.length||0<this.diagram.selectedItems.connectors.length)&&(s=s.concat(l),this.diagram.selectedItems.nodes.splice(0,this.diagram.selectedItems.nodes.length),s.forEach(function(e){i.diagram.selectedItems.nodes.push(e)}),n=this.diagram.selectedItems,this.diagram.selectedObject.helperObject=void 0)}}return!!this.checkBoundaryConstraints(e,t)&&(this.diagram.diagramActions=this.diagram.diagramActions|(ryi.PreventZIndexOnDragging|ryi.DragUsingMouse),!((o=this.diagram.selectedObject.actualObject)&&o instanceof MIi&&o.isLane&&rwi(o,this.diagram))&&o&&o.isLane||(this.diagram.drag(n,e,t),Nbi(r,this.diagram)),this.diagram.diagramActions=this.diagram.diagramActions&~(ryi.PreventZIndexOnDragging|ryi.DragUsingMouse),this.diagram.refreshCanvasLayers(),this.checkHtmlObjectDrag(n),!0)},jEi.prototype.checkHtmlObjectDrag=function(e){var t=!1;this.diagram.views&&1<this.diagram.views.length&&(e instanceof qIi?t=e.nodes.some(function(e){return e.shape&&"HTML"===e.shape.type}):e.shape&&"HTML"===e.shape.type&&(t=!0),t)&&this.resetOverviewCanvas()},jEi.prototype.resetOverviewCanvas=function(){for(var e=0,t=this.diagram.views;e<t.length;e++){var i,n,o,r,s=t[e],s=this.diagram.views[s];s instanceof dDi||(s=document.getElementById(s.canvas.id+"overviewrect"),i=Number(s.getAttribute("x")),n=Number(s.getAttribute("y")),o=Number(s.getAttribute("width")),r=Number(s.getAttribute("height")),wTi(s,{x:i,y:n,width:Math.max(1,o),height:Math.max(1,r)}))}},jEi.prototype.scaleSelectedItems=function(e,t,i){var n=this.diagram.selectedItems;return this.state&&!this.state.backup&&(this.state.backup={},this.state.backup.offsetX=n.offsetX,this.state.backup.offsetY=n.offsetY,this.state.backup.width=n.width,this.state.backup.height=n.height,this.state.backup.pivot=i),n=dwi(this.diagram,n)||n,this.diagram.scale(n,e,t,i)},jEi.prototype.rotateSelectedItems=function(e){var t=this.diagram.selectedItems;return this.state&&!this.state.backup&&(this.state.backup={},this.state.backup.angle=t.rotateAngle),t=dwi(this.diagram,t)||t,this.diagram.rotate(t,e,void 0,!0)},jEi.prototype.hasSelection=function(){return xwi(this.diagram)},jEi.prototype.isSelected=function(e){return Twi(this.diagram,e)},jEi.prototype.initExpand=function(e){var t=this.diagram.isProtectedOnChange,e=(this.diagram.protectPropertyChange(!0),e.target||e.source),i={isExpanded:e.isExpanded};e.isExpanded=!e.isExpanded,this.diagram.preventNodesUpdate=!0,this.diagram.diagramActions|=ryi.PreventIconsUpdate,this.diagram.nodePropertyChange(e,i,{isExpanded:e.isExpanded}),this.diagram.diagramActions=this.diagram.diagramActions&~ryi.PreventIconsUpdate,this.diagram.preventNodesUpdate=!1;for(var n=0,o=this.diagram.views;n<o.length;n++){var r=o[n],r=this.diagram.views[r];r instanceof dDi||this.diagram.refreshCanvasDiagramLayer(r)}this.diagram.protectPropertyChange(t)},jEi.prototype.expandNode=function(e,t,i){var n=this.diagram.preventNodesUpdate,o=e.isExpanded,o=(this.diagram.preventNodesUpdate=!0,this.expandCollapse(e,o,this.diagram,void 0),e.isExpanded=o,this.diagram.layout.fixedNode),r=(this.diagram.layout.fixedNode=e.id,this.diagram.diagramActions!=ryi.Render&&this.diagram.layoutAnimateModule&&this.diagram.layout.enableAnimation&&this.diagram.organizationalChartModule&&(this.diagram.organizationalChartModule.isAnimation=!0),this.diagram.blazorActions|=zfi.expandNode,{});return i||(this.layoutAnimateModule&&0<this.layoutAnimateModule.setIntervalObject.length&&(this.layoutAnimateModule.stopCurrentAnimation(this.objectStore[0],t,e),this.objectStore=[]),r=this.diagram.doLayout(),this.objectStore.push(r)),this.canUpdateTemplate=!1,this.diagram.blazorActions&=~zfi.expandNode,this.diagram.preventNodesUpdate=n,this.diagram.layoutAnimateModule&&this.diagram.organizationalChartModule&&!i?(this.diagram.allowServerDataBinding=!1,this.layoutAnimateModule.expand(this.diagram.layout.enableAnimation,r,e,this.diagram)):(t={element:DTi(e),state:!!e.isExpanded},this.triggerEvent(dyi.expandStateChange,t),this.diagram.lineRoutingModule&&this.diagram.constraints&$fi.LineRouting&&"ComplexHierarchicalTree"!==this.diagram.layout.type&&this.diagram.resetSegments()),this.diagram.layout.fixedNode=""===o?"":this.diagram.layout.fixedNode,r},jEi.prototype.getparentexpand=function(e,t,i,n){for(var o,r=0;r<e.inEdges.length;r++){var s=t.nameTable[e.inEdges[r]],a=t.nameTable[s.sourceID];if(a.isExpanded&&!i&&a.id!==n.sourceID&&s.visible)return!1;o=!0}return o},jEi.prototype.expandCollapse=function(t,e,i,n){if(!(n=n&&0!==n.length?n:[]).some(function(e){return e.id===t.id})){n.push(t);for(var o=0;o<t.outEdges.length;o++){var r=i.nameTable[t.outEdges[o]],s=i.nameTable[r.targetID],a=this.getparentexpand(s,i,e,r),l=(r.visible=e,{visible:s.visible,style:{opacity:s.wrapper.style.opacity}}),h={visible:s.visible,style:{opacity:s.wrapper.style.opacity}};a&&(s.isExpanded&&this.expandCollapse(s,e,i,n),s.visible=e,s.style.opacity=this.diagram.layoutAnimateModule&&this.diagram.layout.enableAnimation&&e?.1:s.style.opacity,i.nodePropertyChange(s,l,h)),i.connectorPropertyChange(r,l,h)}}},jEi.prototype.updateNodeDimension=function(e,t){e instanceof MIi&&(e.offsetX=t.x+t.width/2,e.offsetY=t.y+t.height/2,e.width=t.width,e.height=t.height,e.wrapper.children[0].canMeasurePath=!0,this.diagram.nodePropertyChange(e,{},{width:t.width,height:t.height,offsetX:e.offsetX,offsetY:e.offsetY}),"SVG"!==this.diagram.mode)&&this.diagram.refreshDiagramLayer()},jEi.prototype.updateConnectorPoints=function(e,t){e instanceof ISi&&"Bezier"!==e.type?this.diagram.connectorPropertyChange(e,{},{targetPoint:e.targetPoint}):this.diagram.connectorPropertyChange(e,{},{segments:e.segments}),this.diagram.updateDiagramObject(e)},jEi.prototype.updateSelectedNodeProperties=function(e){if(this.diagram.lineRoutingModule&&this.diagram.constraints&$fi.LineRouting){this.diagram.protectPropertyChange(!0);var t=[],i=[],n=this.diagram.selectedObject.actualObject,o=this.diagram.selectedObject.helperObject,r=n instanceof qIi?DTi(n):void 0;if(o&&n){var s=o.offsetX-n.offsetX,a=o.offsetY-n.offsetY,l=o.width-n.width,h=o.height-n.height,d=o.rotateAngle-n.rotateAngle;if(0<this.diagram.selectedItems.nodes.length+this.diagram.selectedItems.connectors.length&&(this.diagram.selectedItems.wrapper.rotateAngle=this.diagram.selectedItems.rotateAngle=o.rotateAngle),!(n instanceof MIi&&"SwimLane"!==n.shape.type)||n.isLane||n.isPhase||n.isHeader||pwi(this.diagram,n)){if(n instanceof qIi){var p=o.width/n.width,c=o.height/n.height,u=this.diagram.eventHandler.tool.getPivot(this.diagram.eventHandler.tool.corner);if(this.diagram.eventHandler.tool.corner)for(var g=0;g<n.nodes.length;g++){var m=(y=n.nodes[parseInt(g.toString(),10)]).wrapper,f=n.wrapper,f=v1i(f.offsetX-f.actualSize.width*f.pivot.x,f.offsetY-f.actualSize.height*f.pivot.y,f.actualSize.width,f.actualSize.height,f.rotateAngle,f.offsetX,f.offsetY,u);this.diagram.commandHandler.scaleObject(p,c,f,y,m,n)}else for(var y,g=0;g<n.nodes.length;g++)!((y=n.nodes[g])instanceof MIi&&"SwimLane"!==y.shape.type)||pwi(this.diagram,y)||y.isLane||y.isPhase||y.isHeader||(y.offsetX+=s,y.offsetY+=a,y.width+=l,y.height+=h,y.rotateAngle+=d,this.diagram.nodePropertyChange(y,{},{offsetX:y.offsetX,offsetY:y.offsetY,width:y.width,height:y.height,rotateAngle:y.rotateAngle}),t=t.concat(this.diagram.spatialSearch.findObjects(n.wrapper.outerBounds)))}}else n.offsetX===n.wrapper.offsetX&&n.offsetY===n.wrapper.offsetY&&n.width===n.wrapper.width&&n.height===n.wrapper.height&&n.rotateAngle===n.wrapper.rotateAngle||(n.offsetX+=s,n.offsetY+=a,n.width+=l,n.height+=h,n.rotateAngle+=d,this.diagram.nodePropertyChange(n,{},{offsetX:n.offsetX,offsetY:n.offsetY,width:n.width,height:n.height,rotateAngle:n.rotateAngle},!1,!0)),t=this.diagram.spatialSearch.findObjects(n.wrapper.outerBounds)}else e instanceof ISi?t.push(e):e instanceof qIi&&e.connectors.length&&(t=t.concat(e.connectors)),e instanceof qIi&&(-1===this.diagram.nodes.indexOf(e.nodes[0])||!((y=n||e.nodes[0])instanceof MIi&&"SwimLane"!==y.shape.type)||pwi(this.diagram,y)||y.isLane||y.isPhase||y.isHeader||(t=t.concat(this.diagram.spatialSearch.findObjects(y.wrapper.outerBounds))));for(g=0;g<t.length;g++)t[g]instanceof ISi&&-1===i.indexOf(t[g].id)&&i.push(t[g].id);(0<i.length||0<this.diagram.routedConnectors.length)&&(this.diagram.avoidLineOverlappingModule&&(this.diagram.avoidLineOverlappingModule.removeConnectors(i),this.diagram.avoidLineOverlappingModule.removeConnectors(this.diagram.routedConnectors)),this.diagram.lineRoutingModule.renderVirtualRegion(this.diagram,!0)),this.diagram.lineRoutingModule.skipObstacleCheck=!0;for(g=0;g<this.diagram.routedConnectors.length;g++){var v=this.diagram.nameTable[this.diagram.routedConnectors[g]];this.ReRouteConnector(v)}this.diagram.lineRoutingModule.skipObstacleCheck=!1;for(g=0;g<i.length;g++){v=this.diagram.nameTable[i[g]];-1===this.diagram.routedConnectors.indexOf(v.id)&&this.ReRouteConnector(v)}if(this.diagram.routedConnectors=[],o&&n&&r&&"Drag"===this.diagram.eventHandler.currentAction){for(var b=!1,w=this.diagram.nameTable,g=0;g<n.nodes.length;g++)w[n.nodes[g].parentId]&&w[n.nodes[g].parentId].isLane||(b=!0);b&&(e=DTi(n),this.diagram.startGroupAction(),o={type:"PositionChanged",redoObject:DTi(e),undoObject:r,category:"Internal"},this.diagram.addHistoryEntry(o),this.diagram.endGroupAction())}this.updateSelector(),this.diagram.protectPropertyChange(!1)}},jEi.prototype.drawSelectionRectangle=function(e,t,i,n){this.diagram.drawSelectionRectangle(e,t,i,n)},jEi.prototype.ReRouteConnector=function(e){var t,i,n;e instanceof ISi&&"Orthogonal"===e.type&&e.sourceID&&e.targetID&&e.sourceID!=e.targetID&&"ComplexHierarchicalTree"!==this.diagram.layout.type&&(n=this.diagram.getObject(e.sourceID),i=(t=this.diagram.getObject(e.targetID)).offsetX>n.offsetX?t.wrapper.outerBounds.middleLeft.x-n.wrapper.outerBounds.middleRight.x:n.wrapper.outerBounds.middleLeft.x-t.wrapper.outerBounds.middleRight.x,n=t.offsetY>n.offsetY?t.wrapper.outerBounds.topCenter.y-n.wrapper.outerBounds.bottomCenter.y:n.wrapper.outerBounds.topCenter.y-t.wrapper.outerBounds.bottomCenter.y,30<i||30<n)&&this.diagram.lineRoutingModule.refreshConnectorSegments(this.diagram,e,!0)},jEi.prototype.startGroupAction=function(){this.diagram.startGroupAction()},jEi.prototype.endGroupAction=function(){this.diagram.endGroupAction()},jEi.prototype.removeChildFromBPmn=function(e,t,i){e=this.diagram.nameTable[e.id]||e.nodes[0];i&&e&&e.processId&&e.processId===i.wrapper.id&&(DTi(e).processId=e.processId,(i=this.diagram.nameTable[e.processId].shape.activity.subProcess.processes||[]).splice(i.indexOf(e.id),1),this.diagram.bpmnModule.removeChildFromBPMN(this.diagram.nameTable[e.processId].wrapper,e.id,this.diagram),this.diagram.nameTable[e.id].processId="",e.offsetX=e.wrapper.offsetX,e.offsetY=e.wrapper.offsetY)},jEi.prototype.isDroppable=function(e,t){e=this.diagram.nameTable[e.id]||e.nodes[0];return e instanceof MIi&&(!N&&"TextAnnotation"===e.shape.shape||("Group"===t.shape.shape&&(t.shape.activity.subProcess.collapsed=!1),!e)||"Bpmn"!==e.shape.type||e.processId!==t.id&&e.id!==t.processId&&("Bpmn"!==t.shape.type||t instanceof ISi||!t.shape.activity||!t.shape.activity.subProcess||!t.shape.activity.subProcess.collapsed))},jEi.prototype.renderHighlighter=function(e,t,i){new tfi;if(e.target instanceof MIi||e.target instanceof ISi||t&&(e.source instanceof MIi||e.source instanceof ISi)){var n=t?e.source:e.target,o=t?e.sourceWrapper:e.targetWrapper,o=this.findTarget(o,n,i,!0),r=void 0;if(o instanceof Oxi)for(var s=o.id,a=e.target,l=0,h=a.wrapper.children[0].children[0].children[2].children;l<h.length;l++){var d=h[l];if(d.id===a.id+"_"+s){r=d.children[0];break}}else r=o instanceof MIi?o.wrapper:t?e.sourceWrapper:e.targetWrapper;!r||o instanceof ISi||this.diagram.renderHighlighter(r)}},jEi.prototype.mouseOver=function(e,t,i){return!0},jEi.prototype.snapPoint=function(e,t,i,n){var o=this.diagram.selectedItems,r=t.x<e.x,s=t.y<e.y,i={x:i,y:n},n=i;return n=this.snappingModule&&(0<o.nodes.length&&o.nodes[0].constraints&Kfi.Drag||0<o.connectors.length&&o.connectors[0].constraints&Yfi.Drag)?this.diagram.snappingModule.snapPoint(this.diagram,o,r,s,i,e,t):n},jEi.prototype.removeSnap=function(){this.diagram.snapSettings.constraints&Qfi.SnapToObject&&this.snappingModule&&this.snappingModule.removeGuidelines(this.diagram)},jEi.prototype.dropAnnotation=function(e,t){(e instanceof MIi||e instanceof qIi)&&(e=e instanceof MIi?e:e.nodes[0],this.diagram.bpmnModule)&&"Bpmn"===t.shape.type&&!N&&"TextAnnotation"===e.shape.shape&&(e.hasTarget=t.id,e.shape.annotation.nodeId=t.id,this.diagram.currentSymbol||(this.diagram.addTextAnnotation(e.shape.annotation,t),e.shape.annotation.nodeId="",this.diagram.remove(e)),this.diagram.refreshDiagramLayer())},jEi.prototype.drop=function(e,t,i){if(this.diagram.bpmnModule){for(var n=e instanceof MIi?[e]:e.nodes,o=0;o<n.length;o++){var r=n[o];r&&"Bpmn"===r.shape.type&&t instanceof MIi&&"Bpmn"===t.shape.type&&!(t instanceof ISi)&&this.diagram.bpmnModule.dropBPMNchild(t,r,this.diagram)}this.diagram.refreshDiagramLayer()}},jEi.prototype.addHistoryEntry=function(e){this.diagram.addHistoryEntry(e)},jEi.prototype.align=function(e,t,i){if(0<e.length){for(var n=0,o=(e[0]=this.diagram.nameTable[e[0].id]||e[0],"Object"===i?ETi(e[0].wrapper):this.diagram.selectedItems.wrapper.bounds),r={nodes:[],connectors:[]},s={nodes:[],connectors:[]},n="Object"===i?n+1:n;n<e.length;n++){var a=0,l=0,h=(e[n]=this.diagram.nameTable[e[n].id]||e[n],ETi(e[n].wrapper));"Left"===t?a=o.left+h.width/2-h.center.x:"Right"===t?a=o.right-h.width/2-h.center.x:"Top"===t?l=o.top+h.height/2-h.center.y:"Bottom"===t?l=o.bottom-h.height/2-h.center.y:"Center"===t?a=o.center.x-h.center.x:"Middle"===t&&(l=o.center.y-h.center.y),r=this.storeObject(r,e[n]),this.drag(e[n],a,l),this.diagram.updateSelector(),s=this.storeObject(s,e[n])}r=DTi(r),s=DTi(s),i={type:"Align",category:"Internal",undoObject:DTi(r),redoObject:DTi(s)};this.addHistoryEntry(i)}},jEi.prototype.distribute=function(e,t){if(0<e.length){for(var i=0,n=0,o=0,r=0,s=0,a=0,l=0,h=0,d=0,p={nodes:[],connectors:[]},c={nodes:[],connectors:[]},i=0;i<e.length;i++)e[i]=this.diagram.nameTable[e[i].id]||e[i];for(e=MAi(e,t),i=1;i<e.length;i++)n=n+e[i].wrapper.bounds.topRight.x-e[i-1].wrapper.bounds.topRight.x,o=o+e[i].wrapper.bounds.topLeft.x-e[i-1].wrapper.bounds.topLeft.x,r=r+e[i].wrapper.bounds.topRight.y-e[i-1].wrapper.bounds.topRight.y,s=s+e[i].wrapper.bounds.bottomRight.y-e[i-1].wrapper.bounds.bottomRight.y,a=a+e[i].wrapper.bounds.center.x-e[i-1].wrapper.bounds.center.x,l=l+e[i].wrapper.bounds.center.y-e[i-1].wrapper.bounds.center.y,h=h+e[i].wrapper.bounds.topRight.y-e[i-1].wrapper.bounds.bottomRight.y,d=d+e[i].wrapper.bounds.middleLeft.x-e[i-1].wrapper.bounds.middleRight.x;for(i=1;i<e.length-1;i++){var u=0,g=0,m=ETi(e[i-1].wrapper),f=ETi(e[i].wrapper);"Center"===t?u=m.center.x-f.center.x+a/(e.length-1):"RightToLeft"===t?u=m.middleRight.x-f.middleLeft.x+d/(e.length-1):"Right"===t?u=m.topRight.x-f.topRight.x+n/(e.length-1):"Left"===t?u=m.topLeft.x-f.topLeft.x+o/(e.length-1):"Middle"===t?g=m.center.y-f.center.y+l/(e.length-1):"Top"===t?g=m.topRight.y-f.topRight.y+r/(e.length-1):"Bottom"===t?g=m.bottomRight.y-f.bottomRight.y+s/(e.length-1):"BottomToTop"===t&&(g=m.bottomRight.y-f.topRight.y+h/(e.length-1)),p=this.storeObject(p,e[i]),this.drag(e[i],u,g),this.diagram.updateSelector(),c=this.storeObject(c,e[i])}var p=DTi(p),c=DTi(c),y={type:"Distribute",category:"Internal",undoObject:DTi(p),redoObject:DTi(c)};this.addHistoryEntry(y)}},jEi.prototype.sameSize=function(e,t){if(0<e.length){for(var i=0,n={x:.5,y:.5},o=(e[0]=this.diagram.nameTable[e[0].id]||e[0],ETi(e[0].wrapper)),r={nodes:[],connectors:[]},s={nodes:[],connectors:[]},i=1;i<e.length;i++){e[parseInt(i.toString(),10)]=this.diagram.nameTable[e[parseInt(i.toString(),10)].id]||e[0];var a=ETi(e[parseInt(i.toString(),10)].wrapper),l=1,h=1;"Width"===t?l=o.width/a.width:"Height"===t?h=o.height/a.height:"Size"===t&&(l=o.width/a.width,h=o.height/a.height),r=this.storeObject(r,e[parseInt(i.toString(),10)]),this.scale(e[parseInt(i.toString(),10)],l,h,n),s=this.storeObject(s,e[parseInt(i.toString(),10)])}this.diagram.updateSelector();var r=DTi(r),s=DTi(s),d={type:"Sizing",category:"Internal",undoObject:DTi(r),redoObject:DTi(s)};this.addHistoryEntry(d)}},jEi.prototype.storeObject=function(e,t){return(t instanceof MIi?e.nodes:e.connectors).push(DTi(t)),e},jEi.prototype.updatePanState=function(e){e?this.diagram.realActions=this.diagram.realActions|ayi.PanInProgress:(this.diagram.dataBind(),e=this.diagram.scrollSettings,this.diagram.realActions=this.diagram.realActions&~ayi.PanInProgress,e={oldValue:e={VerticalOffset:e.verticalOffset,HorizontalOffset:e.horizontalOffset,ViewportHeight:e.viewPortHeight,ViewportWidth:e.viewPortWidth,CurrentZoom:e.currentZoom},newValue:e,source:this.diagram,panState:"Completed"},this.triggerEvent(dyi.scrollChange,e))},jEi.prototype.dataBinding=function(){this.diagram.dataBind()},jEi.prototype.setBlazorDiagramProps=function(e){this.diagram.setBlazorDiagramProps(e)},jEi.prototype.scroll=function(e,t,i){var n=this.diagram.constraints&$fi.PanX,o=this.diagram.constraints&$fi.PanY;this.diagram.pan((e=n?e:0)*this.diagram.scroller.currentZoom,(t=o?t:0)*this.diagram.scroller.currentZoom,i,!0)},jEi.prototype.drawHighlighter=function(e){this.diagram.renderHighlighter(e.wrapper)},jEi.prototype.removeHighlighter=function(){this.diagram.clearHighlighter()},jEi.prototype.renderContainerHelper=function(e){return dwi(this.diagram,e)},jEi.prototype.isParentAsContainer=function(e,t){return pwi(this.diagram,e,t)},jEi.prototype.isTargetSubProcess=function(e){return!!(e&&e.shape&&"Bpmn"===e.shape.type&&e.shape.activity&&"SubProcess"===e.shape.activity.activity)},jEi.prototype.dropChildToContainer=function(e,t){if(!(this.diagram.diagramActions&ryi.PreventLaneContainerUpdate)&&(mwi(this.diagram,e,t),t.hasTextAnnotation))for(var i=0;i<t.outEdges.length;i++){var n=this.diagram.nameTable[t.outEdges[parseInt(i.toString(),10)]];n.isBpmnAnnotationConnector&&(n=this.diagram.nameTable[n.targetID],mwi(this.diagram,e,n))}},jEi.prototype.updateLaneChildrenZindex=function(e,t){var e=this.findLeastIndexObject(e,t),i=this.diagram.nameTable[t.parentId];if(i&&i.zIndex>e.zIndex){for(var n=this.diagram.layers.indexOf(this.diagram.getActiveLayer()),o=this.diagram.layers[parseInt(n.toString(),10)].zIndexTable,r=JSON.parse(JSON.stringify(o)),s=e.zIndex,a=i.zIndex,l=a;s<=l;l--)s!==l?o[l-1]?(o[parseInt(l.toString(),10)]=o[l-1],this.diagram.nameTable[o[parseInt(l.toString(),10)]].zIndex=l):(o[l-1]=o[parseInt(l.toString(),10)],this.diagram.nameTable[o[l-1]].zIndex=l,delete o[parseInt(l.toString(),10)]):this.swapZIndexObjects(a,o,i.id,r);"SVG"===this.diagram.mode?(this.moveSvgNode(t.parentId,e.id),this.updateNativeNodeIndex(t.parentId,e.id)):this.diagram.refreshCanvasLayers()}},jEi.prototype.findLeastIndexConnector=function(e,t,i){for(var n=0;n<e.length;n++){var o=this.diagram.nameTable[e[parseInt(n.toString(),10)]];i.zIndex>o.zIndex&&(i=o)}return i},jEi.prototype.findLeastIndexObject=function(e,t){var i=e;return e instanceof MIi&&(i=this.findLeastIndexConnector(e.inEdges,t,i),i=this.findLeastIndexConnector(e.outEdges,t,i)),i},jEi.prototype.checkSelection=function(e,t){if(1===e.nodes.length&&0===e.connectors.length)if(pwi(this.diagram,e.nodes[0],!0)){var i="SwimLane"===e.nodes[0].shape?e.nodes[0]:this.diagram.nameTable[e.nodes[0].parentId],n=e.nodes[0];if("SwimLane"===i.shape.type){var o="Horizontal"===i.shape.orientation;(n.isPhase&&(o&&"ResizeSouth"===t||!o&&"ResizeEast"===t)||n.isLane&&(o&&"ResizeEast"===t||!o&&"ResizeSouth"===t))&&Ybi(this.diagram,i,t)}else if("Grid"===i.container.type)if("Horizontal"===i.container.orientation&&1===n.rowIndex||"Vertical"===i.container.orientation&&0<n.rowIndex&&0<n.columnIndex){if("ResizeSouth"===t)for(var r=0;r<this.diagram.nodes.length;r++)if((s=this.diagram.nodes[parseInt(r.toString(),10)]).rowIndex===i.rows.length-1&&0===s.columnIndex){this.select(s);break}}else if("ResizeEast"===t)for(var s,r=0;r<this.diagram.nodes.length;r++)if(1===(s=this.diagram.nodes[parseInt(r.toString(),10)]).rowIndex&&s.columnIndex===i.columns.length-1){this.select(s);break}}else Ybi(this.diagram,e.nodes[0],t)},jEi.prototype.zoom=function(e,t,i,n){this.diagram.scroller.zoom(e,t*this.diagram.scroller.currentZoom,i*this.diagram.scroller.currentZoom,n)},jEi);function jEi(e){this.clipboardData={},this.diagramObject={},this.newSelectedObjects={},this.oldSelectedObjects={},this.changedNodeZIndexes={},this.connectorsTable=[],this.PreventConnectorSplit=!1,this.processTable={},this.isContainer=!1,this.canUpdateTemplate=!1,this.cloningInProgress=!1,this.childTable={},this.objectStore=[],this.parentTable={},this.blazor="Blazor",this.blazorInterop="sfBlazor",this.cloneGroupChildCollection=[],this.diagram=e}Object.defineProperty(QEi.prototype,"viewPortHeight",{get:function(){return this.vPortHeight},set:function(e){this.vPortHeight=e,this.diagram.scrollSettings.viewPortHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(QEi.prototype,"currentZoom",{get:function(){return this.currentZoomFActor||1},set:function(e){this.currentZoomFActor=e,this.diagram.scrollSettings.currentZoom=e},enumerable:!0,configurable:!0}),Object.defineProperty(QEi.prototype,"viewPortWidth",{get:function(){return this.vPortWidth},set:function(e){this.vPortWidth=e,this.diagram.scrollSettings.viewPortWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(QEi.prototype,"horizontalOffset",{get:function(){return this.hOffset},set:function(e){this.hOffset=e,1<Math.abs(this.hOffset-this.diagram.scrollSettings.horizontalOffset)&&(this.diagram.realActions=this.diagram.realActions|ayi.hScrollbarMoved,this.scrolled=!0),this.diagram.scrollSettings.horizontalOffset=e},enumerable:!0,configurable:!0}),Object.defineProperty(QEi.prototype,"verticalOffset",{get:function(){return this.vOffset},set:function(e){this.vOffset=e,1<Math.abs(this.vOffset-this.diagram.scrollSettings.verticalOffset)&&(this.diagram.realActions=this.diagram.realActions|ayi.vScrollbarMoved,this.scrolled=!0),this.diagram.scrollSettings.verticalOffset=e},enumerable:!0,configurable:!0}),QEi.prototype.getBounds=function(){var e=this.diagram.spatialSearch.getPageBounds(0,0),e=(e.x<0||e.y<0)&&!this.diagram.pageSettings.multiplePage?this.getPageBounds(void 0,void 0,!0,!0):this.getPageBounds(void 0,void 0,!0);return e},QEi.prototype.updateScrollOffsets=function(e,t){var i,n,o=this.getBounds();o.x*=this.currentZoom,o.y*=this.currentZoom,o.width*=this.currentZoom,o.height*=this.currentZoom,i=Math.max(0,e-o.left),n=Math.max(0,t-o.top),void 0!==e&&void 0!==t?(this.horizontalOffset=i,this.verticalOffset=n,this.diagram.setOffset(i,n)):this.diagram.setOffset(-this.horizontalOffset-o.x,-this.verticalOffset-o.y),this.transform={tx:Math.max(this.horizontalOffset,-o.left)/this.currentZoom,ty:Math.max(this.verticalOffset,-o.top)/this.currentZoom,scale:this.currentZoom}},QEi.prototype.setScrollOffset=function(e,t){this.scrolled=!1;var i,n=this.getBounds(),o=(n.x*=this.currentZoom,n.y*=this.currentZoom,n.width*=this.currentZoom,n.height*=this.currentZoom,-n.left),r=-n.top,s=!1,a=this.viewPortWidth*this.currentZoom,l=this.viewPortHeight*this.currentZoom,h=o-e,d=(h!==this.horizontalOffset&&(o<this.horizontalOffset&&(this.horizontalOffset>h?this.horizontalOffset-=e:this.horizontalOffset=h,s=!0),d=Math.max(n.right+this.vScrollSize,a),!s&&d<-h+this.viewPortWidth&&((d=a-h-this.vScrollSize)<(i=-this.horizontalOffset+a-this.vScrollSize)||d-n.right>d-i?this.horizontalOffset=h:this.horizontalOffset=-(n.right+this.vScrollSize-a),s=!0),s||(this.horizontalOffset=o-e)),s=!1,r-t);d!==this.verticalOffset&&(r<this.verticalOffset&&(this.verticalOffset>d?this.verticalOffset-=t:this.verticalOffset=d,s=!0),i=Math.max(n.bottom+this.hScrollSize,l),!s&&i<l-d&&((h=l-d-this.hScrollSize)<(a=-this.verticalOffset+l-this.hScrollSize)||h-n.bottom>h-a?this.verticalOffset=d:this.verticalOffset=-(n.bottom+this.hScrollSize-l),s=!0),s||(this.verticalOffset=r-t)),this.transform={tx:Math.max(this.horizontalOffset,-n.left)/this.currentZoom,ty:Math.max(this.verticalOffset,-n.top)/this.currentZoom,scale:this.currentZoom},this.setSize()},QEi.prototype.getObjects=function(e,t){for(var i=[],n=0;n<e.length;n++){for(var o=!1,r=0;r<t.length;r++)if(e[parseInt(n.toString(),10)]===t[parseInt(r.toString(),10)]){o=!0;break}o||i.push(e[parseInt(n.toString(),10)])}return i},QEi.prototype.virtualizeElements=function(){for(var e=this.viewPortWidth/this.currentZoom,t=this.viewPortHeight/this.currentZoom,i=this.diagram.spatialSearch.findObjects(new tfi(-this.horizontalOffset/this.currentZoom,-this.verticalOffset/this.currentZoom,e,t)),n=[],o=0;o<i.length;o++){var r=i[parseInt(o.toString(),10)].shape;if("Bpmn"===r.type&&r&&r.activity&&r.activity.subProcess&&r.activity.subProcess.processes&&0<r.activity.subProcess.processes.length){for(var s=0;s<r.activity.subProcess.processes.length;s++)n.push(r.activity.subProcess.processes[parseInt(s.toString(),10)]);n.push(i[parseInt(o.toString(),10)].id)}else""!==i[parseInt(o.toString(),10)].processId&&void 0!==i[parseInt(o.toString(),10)].processId||n.push(i[parseInt(o.toString(),10)].id)}for(var e=n,a=[],o=0;o<i.length;o++){var l=i[parseInt(o.toString(),10)].shape;if("Bpmn"===l.type&&l&&l.activity&&l.activity.subProcess&&l.activity.subProcess.processes&&0<l.activity.subProcess.processes.length){a.push(i[parseInt(o.toString(),10)].id);for(var h=0;h<l.activity.subProcess.processes.length;h++)a.push(l.activity.subProcess.processes[parseInt(h.toString(),10)])}else""!==i[parseInt(o.toString(),10)].processId&&void 0!==i[parseInt(o.toString(),10)].processId||a.push(i[parseInt(o.toString(),10)].id)}for(o=0;o<i.length;o++)for(s=0;s<a.length;s++)if(i[parseInt(o.toString(),10)].id===a[parseInt(s.toString(),10)]){i[parseInt(o.toString(),10)].zIndex=s;break}var t=this.getObjects(e,this.oldCollectionObjects),d=(0===this.oldCollectionObjects.length&&(this.oldCollectionObjects=e),this.getObjects(this.oldCollectionObjects,e));this.diagram.updateVirtualObjects(t,!1,d),this.oldCollectionObjects=e},QEi.prototype.setSize=function(e){var t=this.getPageBounds(void 0,void 0,!0),i=(t.x*=this.currentZoom,t.y*=this.currentZoom,t.width*=this.currentZoom,t.height*=this.currentZoom,Math.min(t.x,-this.horizontalOffset)),n=Math.min(t.y,-this.verticalOffset),o=(this.horizontalOffset,this.viewPortWidth,t.right,this.verticalOffset,this.viewPortHeight,t.bottom,this.scrollerWidth),r=this.scrollerWidth,s=(-this.verticalOffset<=t.y&&-this.verticalOffset+this.viewPortHeight>=t.bottom&&(r=0),-this.horizontalOffset<=t.x&&-this.horizontalOffset+this.viewPortWidth>=t.right&&(o=0),this.hScrollSize=o,this.vScrollSize=r,this.diagramWidth),a=this.diagramHeight;this.diagramWidth=Math.max(t.right,-this.horizontalOffset+this.viewPortWidth-r)-i,this.diagramHeight=Math.max(t.bottom,-this.verticalOffset+this.viewPortHeight-o)-n,s===this.diagramWidth&&a===this.diagramHeight||"Diagram"===this.diagram.scrollSettings.scrollLimit||this.diagram.setSize(this.diagramWidth,this.diagramHeight),"Diagram"===this.diagram.scrollSettings.scrollLimit&&(s===this.diagramWidth&&a===this.diagramHeight&&1===this.currentZoom||this.diagram.diagramActions&&e&&(!this.diagram.diagramActions||!e||0===this.verticalOffset&&this.verticalOffset!==e.y||0===this.horizontalOffset&&this.horizontalOffset!==e.x)?e&&s===this.diagramWidth&&a===this.diagramHeight&&(this.diagram.diagramCanvas.scrollHeight>this.viewPortHeight&&e.y<0&&this.horizontalOffset===e.x&&0===this.verticalOffset||this.diagram.diagramCanvas.scrollWidth>this.viewPortWidth&&e.x<0&&this.verticalOffset===e.y&&0===this.horizontalOffset)&&(this.verticalOffset=e.y,this.horizontalOffset=e.x,this.transform={tx:Math.max(e.x,-t.left)/this.currentZoom,ty:Math.max(e.y,-t.top)/this.currentZoom,scale:this.currentZoom}):(this.diagram.scrollActions&lyi.Interaction&&e&&(this.transform={tx:Math.max(e.x,-(t.left/this.currentZoom))/this.currentZoom,ty:Math.max(e.y,-(t.top/this.currentZoom))/this.currentZoom,scale:this.currentZoom},this.horizontalOffset=e.x,this.verticalOffset=e.y),this.diagram.setSize(this.diagramWidth,this.diagramHeight),this.diagram.scrollActions&lyi.PropertyChange||!e||(this.horizontalOffset=e.x,this.verticalOffset=e.y,this.transform={tx:Math.max(e.x,-t.left)/this.currentZoom,ty:Math.max(e.y,-t.top)/this.currentZoom,scale:this.currentZoom}))),this.diagram.transformLayers(),this.diagram.element.style.overflow="hidden"},QEi.prototype.setViewPortSize=function(e,t){this.viewPortWidth=e,this.viewPortHeight=t},QEi.prototype.getPageBounds=function(e,t,i,n){var o,r,s;new tfi;return r="Content"===t||n||null===this.diagram.pageSettings.width||null===this.diagram.pageSettings.height?this.diagram.spatialSearch.getPageBounds(t=e?void 0:0,t):(n=this.diagram.pageSettings.width,e=this.diagram.pageSettings.height,o=t=0,this.diagram.pageSettings.multiplePage&&((r=this.diagram.spatialSearch.getPageBounds(0,0)).right>n&&(n*=s=Math.ceil(r.right/n)),r.bottom>e&&(e*=s=Math.ceil(r.bottom/e)),r.left<0&&Math.abs(r.left)>t&&(s=Math.ceil(Math.abs(r.left)/this.diagram.pageSettings.width),t=this.diagram.pageSettings.width*s),r.top<0)&&Math.abs(r.top)>o&&(s=Math.ceil(Math.abs(r.top)/this.diagram.pageSettings.height),o=this.diagram.pageSettings.height*s),new tfi(-t,-o,n+t,e+o)),i&&(s=this.diagram.scrollSettings.padding,r.x-=s.left,r.y-=s.top,r.width+=s.left+s.right,r.height+=s.top+s.bottom),r},QEi.prototype.getPageBreak=function(e){for(var t=0,i=0,n=-1,o=[],r=0,s=0,a=0,l=0,h=this.diagram.pageSettings.margin.left,d=this.diagram.pageSettings.margin.right,p=this.diagram.pageSettings.margin.top,c=this.diagram.pageSettings.margin.bottom,u=1,g=1,m={x1:r,y1:a,x2:s,y2:l};e.width>t;)(t+=this.diagram.pageSettings.width||e.width)===this.diagram.pageSettings.width&&(m={x1:e.left+h,y1:e.top+p,x2:e.left+h,y2:e.bottom-c},o[++n]=m),t<e.width&&(r=e.topLeft.x+this.diagram.pageSettings.width*u,a=e.topLeft.y+p,s=e.bottomLeft.x+this.diagram.pageSettings.width*u,l=e.bottomLeft.y-c,o[++n]=m={x1:r,y1:a,x2:s,y2:l},u++),e.width===t&&(m={x1:e.right-d,y1:e.top+p,x2:e.right-d,y2:e.bottom-c},o[++n]=m);for(;e.height>i;)(i+=this.diagram.pageSettings.height||e.height)===this.diagram.pageSettings.height&&(m={x1:e.left+h,y1:e.top+p,x2:e.right-d,y2:e.top+p},o[++n]=m),i<e.height&&(r=e.topLeft.x+h,a=e.topLeft.y+this.diagram.pageSettings.height*g,s=e.topRight.x-d,l=e.topRight.y+this.diagram.pageSettings.height*g,o[++n]=m={x1:r,y1:a,x2:s,y2:l},g++),e.height===i&&(m={x1:e.left+h,y1:e.bottom-c,x2:e.right-d,y2:e.bottom-c},o[++n]=m);return o},QEi.prototype.zoom=function(e,t,i,n,o,r,s,a){var l,h;(this.diagram.constraints&$fi.Zoom&&1!==e||this.diagram.constraints&$fi.Pan&&1===e)&&(lfi(l=ofi(),this.currentZoom,this.currentZoom),hfi(l,this.horizontalOffset,this.verticalOffset),n=rfi(l,n=n||{x:(this.viewPortWidth/2-this.horizontalOffset)/this.currentZoom,y:(this.viewPortHeight/2-this.verticalOffset)/this.currentZoom}),this.currentZoom*e<=this.diagram.scrollSettings.maxZoom)&&(this.currentZoom*e>=this.diagram.scrollSettings.minZoom||a||1<=e)&&(this.currentZoom*=e,(a=this.getPageBounds(void 0,void 0,!0)).x*=this.currentZoom,a.y*=this.currentZoom,lfi(h=ofi(),e,e,n.x,n.y),hfi(h,t||0,i||0),dfi(l,h),n=rfi(l,{x:0,y:0}),1===e&&(n=this.applyScrollLimit(n.x,n.y,o,r,s)),s=-a.y>=n.y&&-a.x>=n.x&&s,!(this.diagram.scrollActions&lyi.PropertyChange)&&this.diagram.scrollActions&lyi.Interaction&&"Diagram"===this.diagram.scrollSettings.scrollLimit&&!s||(this.transform={tx:Math.max(n.x,-a.left)/this.currentZoom,ty:Math.max(n.y,-a.top)/this.currentZoom,scale:this.currentZoom},this.horizontalOffset=n.x,this.verticalOffset=n.y),this.setSize(n),"SVG"!==this.diagram.mode&&Jvi(this.diagram)&&this.diagram.scroller.virtualizeElements(),"SVG"===this.diagram.mode||Jvi(this.diagram)||this.diagram.refreshDiagramLayer(),this.diagram.setOffset(-this.horizontalOffset-a.x,-this.verticalOffset-a.y),BSi(this.diagram),this.diagram.views)&&this.diagram.views.overview&&(i=(t=this.diagram.views.overview).scrollOverviewRect(t.parent.scroller.horizontalOffset,t.parent.scroller.verticalOffset,t.parent.scroller.currentZoom,!0),t.updateOverviewrect(-i.x,-i.y,i.width,i.height),t.updateView(t))},QEi.prototype.fitToPage=function(e){var t,i=(e=e||{}).mode,n=e.region,o=e.margin||{},r=e.canZoomIn,s=e.customBounds,e=e.canZoomOut,a=(o.bottom=o.bottom||25,o.top=o.top||25,o.left=o.left||25,o.right=o.right||25,s),l=-this.horizontalOffset,h=-this.verticalOffset;if("PageSettings"===(n=n||"PageSettings")&&this.diagram.pageSettings.width&&this.diagram.pageSettings.height||0<this.diagram.nodes.length||0<this.diagram.connectors.length){i=i||"Page","CustomBounds"!==n&&(a=this.getPageBounds(!0,n,!0));var d={x:0,y:0},p=(o.left+o.right>this.viewPortWidth&&(this.viewPortWidth<=100?(o.left=5,o.right=5):(o.left=25,o.right=25)),o.top+o.bottom>this.viewPortHeight&&(this.viewPortHeight<=100?(o.top=5,o.bottom=5):(o.top=25,o.bottom=25)),d.x=(this.viewPortWidth-(o.left+o.right))/a.width,d.y=(this.viewPortHeight-(o.top+o.bottom))/a.height,!r&&a.width-this.horizontalOffset<this.viewPortWidth&&a.height-this.verticalOffset<this.viewPortHeight&&(d.x=Math.min(this.currentZoom,d.x),d.y=Math.min(this.currentZoom,d.y)),void 0),c=void 0,u=void 0;switch(i){case"Width":t=(p=d.x)/this.currentZoom,l+=(c=(this.viewPortWidth-a.width*p)/2-a.x*p)+(o.left-o.right)/2*p,h-=-this.verticalOffset*t,h="CustomBounds"!==n?h:h-this.verticalOffset*t;break;case"Height":t=(p=d.y)/this.currentZoom,c=(this.viewPortWidth-a.width*p)/2-a.x*p,u=(this.viewPortHeight-a.height*p)/2-a.y*p,l+=c+(o.left-o.right)/2*p,h+=u+(o.top-o.bottom)/2*p;break;case"Page":t=(p=Math.min(d.x,d.y))/this.currentZoom,c=(this.viewPortWidth-a.width*p)/2-a.x*p,u=(this.viewPortHeight-a.height*p)/2-a.y*p,l+=c+(o.left-o.right)/2*p,h+=u+(o.top-o.bottom)/2*p}}else t=1/this.currentZoom;this.zoom(t,l,h,{x:0,y:0},!0,void 0,void 0,e)},QEi.prototype.bringIntoView=function(e,t){var i=0,n=0,o=this.currentZoom,r=-this.horizontalOffset,s=-this.verticalOffset,e=new tfi(e.x*o,e.y*o,e.width*o,e.height*o);new tfi(r,s,this.viewPortWidth,this.viewPortHeight).containsRect(e)||(e.right>-r+this.viewPortWidth&&(i=e.right-this.viewPortWidth,i+=20),e.x<-r&&(i=e.x),e.bottom>-s+this.viewPortHeight&&(n=e.bottom-this.viewPortHeight,n+=20),e.y<-s&&(n=e.y),this.zoom(1,-this.horizontalOffset-i,-this.verticalOffset-n,null,void 0,t))},QEi.prototype.bringToCenter=function(e){var t=this.currentZoom,e=new tfi(e.x*t,e.y*t,e.width*t,e.height*t),t=e.x+e.width/2-this.viewPortWidth/2,e=e.y+e.height/2-this.viewPortHeight/2;this.zoom(1,-this.horizontalOffset-(t*=-1),-this.verticalOffset-(e*=-1),null)},QEi.prototype.applyScrollLimit=function(e,t,i,n,o){var r,s,a;return"Infinity"!==this.diagram.scrollSettings.scrollLimit||void 0!==i||n||(e=-e,t=-t),"Infinity"!==this.diagram.scrollSettings.scrollLimit&&(r=void 0,"Limited"===this.diagram.scrollSettings.scrollLimit&&(s=this.diagram.scrollSettings.scrollableArea,r=new tfi(s.x,s.y,s.width,s.height)),r=r||(o?this.getPageBounds(!1,void 0,!0):this.getPageBounds(!0,void 0,!0)),(r="Pan"===this.diagram[s="eventHandler"].currentAction&&this.diagram[s].inAction?this.getPageBounds(!1,void 0,!0):r).x*=this.currentZoom,r.y*=this.currentZoom,r.width*=this.currentZoom,r.height*=this.currentZoom,void 0!==i&&(e*=-1,t*=-1),n&&(e*=-1,t*=-1),o=Math.max(r.right,this.viewPortWidth),n||e<=r.x&&(e+this.viewPortWidth>=r.right||e>=r.right-this.viewPortWidth)||e>=r.x&&e+this.viewPortWidth<=o||(e=e>=r.x?Math.max(r.x,Math.min(e,e-(e+this.viewPortWidth-this.vScrollSize-o))):(a=r.right-this.viewPortWidth,Math.min(a,r.x))),s=Math.max(r.bottom,this.viewPortHeight),n||t<=r.y&&t+this.viewPortHeight>=r.bottom||t>=r.y&&t+this.viewPortHeight<=s||(t=t>=r.y?Math.max(r.y,Math.min(t,t-(t+this.viewPortHeight-this.hScrollSize-s))):(a=r.bottom-this.viewPortHeight,Math.min(r.y,a))),e*=-1,t*=-1),{x:e,y:t}};var WEi=QEi;function QEi(e){this.transform={tx:0,ty:0,scale:1},this.oldCollectionObjects=[],this.removeCollection=[],this.vPortWidth=0,this.vPortHeight=0,this.currentZoomFActor=1,this.hOffset=0,this.vOffset=0,this.scrolled=!1,this.hScrollSize=0,this.vScrollSize=0,this.diagram=e,this.objects=[],this.transform=e.scroller?e.scroller.transform:{tx:0,ty:0,scale:1},this.vPortWidth=e.scrollSettings.viewPortWidth,this.vPortHeight=e.scrollSettings.viewPortHeight,this.currentZoomFActor=e.scrollSettings.currentZoom,this.hOffset=e.scrollSettings.horizontalOffset,this.vOffset=e.scrollSettings.verticalOffset}qEi.prototype.findQuads=function(e,t){null!=this.first&&this.first.isIntersect(e)&&this.first.findQuads(e,t),null!=this.second&&this.second.isIntersect(e)&&this.second.findQuads(e,t),null!=this.third&&this.third.isIntersect(e)&&this.third.findQuads(e,t),null!=this.fourth&&this.fourth.isIntersect(e)&&this.fourth.findQuads(e,t),0<this.objects.length&&t.push(this)},qEi.prototype.isIntersect=function(e){return!(this.left+this.width<e.left||this.top+this.height<e.top||this.left>e.right||this.top>e.bottom)},qEi.prototype.selectQuad=function(){for(var e,t=null,i=this;null!=i;)i=(e=i.getQuad(t)).source,t=e.target||t;return t},qEi.prototype.getQuad=function(e){var t=this.width/2,i=this.height/2;if(1e3<=t&&1e3<=i){var n,o=this.left+t,r=this.top+i;if(this.spatialSearch.childRight<=o){if(this.spatialSearch.childBottom<=r)return this.first||(((n=new qEi(this.left,this.top,t,i,this.spatialSearch)).parent=this).first=n),{source:this.first};if(this.spatialSearch.childTop>=r)return this.third||(((n=new qEi(this.left,r,t,i,this.spatialSearch)).parent=this).third=n),{source:this.third}}else if(this.spatialSearch.childLeft>=o){if(this.spatialSearch.childBottom<=r)return this.second||(((n=new qEi(o,this.top,t,i,this.spatialSearch)).parent=this).second=n),{source:this.second};if(this.spatialSearch.childTop>=r)return this.fourth||(((n=new qEi(o,r,t,i,this.spatialSearch)).parent=this).fourth=n),{source:this.fourth}}}return this.objects.push(this.spatialSearch.childNode),{target:this}},qEi.prototype.isContained=function(){return this.spatialSearch.childLeft>=this.left&&this.spatialSearch.childRight<=this.left+this.width&&this.spatialSearch.childTop>=this.top&&this.spatialSearch.childBottom<=this.top+this.height},qEi.prototype.addIntoAQuad=function(e){for(var t={},i=(this.spatialSearch.setCurrentNode(e),null);!t.isAdded;)i=(t=this.spatialSearch.parentQuad.add(i)).quad;return i},qEi.prototype.add=function(e){var t,i,n,o;return e=null,this.isContained()?{isAdded:!0,quad:e=this.selectQuad()}:(t=void 0,i=!(0!==this.objects.length||this.first||this.second||this.third||this.fourth),n=2*this.width,o=2*this.height,this.spatialSearch.childLeft<this.left?this.spatialSearch.childTop<this.top?(t=new qEi(this.left-this.width,this.top-this.height,n,o,this.spatialSearch),i||(t.fourth=this)):(t=new qEi(this.left-this.width,this.top,n,o,this.spatialSearch),i||(t.second=this)):this.spatialSearch.childTop<this.top?(t=new qEi(this.left,this.top-this.height,n,o,this.spatialSearch),i||(t.third=this)):(t=new qEi(this.left,this.top,n,o,this.spatialSearch),i||(t.first=this)),this.parent=t,this.spatialSearch.parentQuad=t,{isAdded:!1,quad:e})};var UEi=qEi;function qEi(e,t,i,n,o){this.objects=[],this.left=e,this.top=t,this.width=i,this.height=n,this.spatialSearch=o}YEi.prototype.removeFromAQuad=function(e){var t,i;this.quadTable[e.id]&&(t=this.quadTable[e.id],-1!==(i=this.objectIndex(t.objects,e)))&&(t.objects.splice(i,1),this.update(t),delete this.quadTable[e.id])},YEi.prototype.update=function(e){var t;e.parent&&0===e.objects.length&&null==e.first&&null==e.second&&null==e.third&&null==e.fourth?((t=e.parent).first===e?t.first=null:t.second===e?t.second=null:t.third===e?t.third=null:t.fourth===e&&(t.fourth=null),this.update(e.parent)):e!==this.parentQuad||e.first||e.second||e.third||e.fourth||(e.left=0,e.width=1e3,e.top=0,e.height=1e3)},YEi.prototype.addIntoAQuad=function(e){var t=this.parentQuad.addIntoAQuad(e);this.quadTable[e.id]=t},YEi.prototype.objectIndex=function(e,t){for(var i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].id===t.id)return i;return-1},YEi.prototype.updateQuad=function(e){this.setCurrentNode(e);var t=e.outerBounds;if(!(isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height))){if(this.quadTable[e.id]?this.quadTable[e.id].isContained()||(this.removeFromAQuad(e),this.addIntoAQuad(e)):this.addIntoAQuad(e),!this.isWithinPageBounds(t)||this.leftElement===e||this.topElement===e||this.rightElement===e||this.bottomElement===e)return t=!1,this.pageLeft===this.childLeft&&e===this.leftElement||(this.pageLeft>=this.childLeft?(this.pageLeft=this.childLeft,this.leftElement=e,t=!0):e===this.leftElement&&(this.pageLeft=Number.MAX_VALUE,this.findLeft(this.parentQuad),t=!0)),this.pageTop===this.childTop&&e===this.topElement||(this.pageTop>=this.childTop?(this.pageTop=this.childTop,this.topElement=e,t=!0):e===this.topElement&&(this.pageTop=Number.MAX_VALUE,this.findTop(this.parentQuad),t=!0)),this.pageBottom===this.childBottom&&e===this.bottomElement||(this.pageBottom<=this.childBottom?(t=!0,this.pageBottom=this.childBottom,this.bottomElement=e):e===this.bottomElement&&(this.pageBottom=-Number.MAX_VALUE,this.findBottom(this.parentQuad),t=!0)),this.pageRight===this.childRight&&e===this.rightElement||(this.pageRight<=this.childRight?(this.pageRight=this.childRight,this.rightElement=e,t=!0):e===this.rightElement&&(this.pageRight=-Number.MAX_VALUE,this.findRight(this.parentQuad),t=!0)),t;this.setCurrentNode(null)}return!1},YEi.prototype.isWithinPageBounds=function(e){return e.left>=this.pageLeft&&e.right<=this.pageRight&&e.top>=this.pageTop&&e.bottom<=this.pageBottom},YEi.prototype.findQuads=function(e){var t=[];return this.parentQuad.findQuads(e,t),t},YEi.prototype.findObjects=function(e){for(var t=[],i=0,n=this.findQuads(e);i<n.length;i++)for(var o=0,r=n[i].objects;o<r.length;o++){var s=r[o];s.outerBounds.intersects(e)&&t.push(this.objectTable[s.id])}return t},YEi.prototype.updateBounds=function(e,t){var i=!1;return t?(this.topElement&&e.id===this.topElement.id&&(i=this.updateTop()),this.leftElement&&e.id===this.leftElement.id&&(i=this.updateLeft()),this.rightElement&&e.id===this.rightElement.id&&(i=this.updateRight()),this.bottomElement&&e.id===this.bottomElement.id&&(i=this.updateBottom())):(e===this.topElement&&(i=this.updateTop()),e===this.leftElement&&(i=this.updateLeft()),e===this.rightElement&&(i=this.updateRight()),e===this.bottomElement&&(i=this.updateBottom())),i},YEi.prototype.updateTop=function(){return this.pageTop=Number.MAX_VALUE,this.topElement=null,this.findTop(this.parentQuad),!0},YEi.prototype.updateBottom=function(){return this.pageBottom=-Number.MAX_VALUE,this.bottomElement=null,this.findBottom(this.parentQuad),!0},YEi.prototype.updateLeft=function(){return this.pageLeft=Number.MAX_VALUE,this.leftElement=null,this.findLeft(this.parentQuad),!0},YEi.prototype.updateRight=function(){return this.pageRight=-Number.MAX_VALUE,this.rightElement=null,this.findRight(this.parentQuad),!0},YEi.prototype.findBottom=function(e){e.third||e.fourth?(e.third&&this.findBottom(e.third),e.fourth&&this.findBottom(e.fourth)):(e.second&&this.findBottom(e.second),e.first&&this.findBottom(e.first));for(var t=0,i=e.objects;t<i.length;t++){var n=i[t];this.pageBottom<=n.outerBounds.bottom&&(this.pageBottom=n.outerBounds.bottom,this.bottomElement=n)}},YEi.prototype.findRight=function(e){(e.second||e.fourth)&&(e.second&&this.findRight(e.second),e.fourth)&&this.findRight(e.fourth),e.first&&this.findRight(e.first),e.third&&this.findRight(e.third);for(var t=0,i=e.objects;t<i.length;t++){var n=i[t];this.pageRight<=n.outerBounds.right&&(this.pageRight=n.outerBounds.right,this.rightElement=n)}},YEi.prototype.findLeft=function(e){e.first||e.third?(e.first&&this.findLeft(e.first),e.third&&this.findLeft(e.third)):(e.second&&this.findLeft(e.second),e.fourth&&this.findLeft(e.fourth));for(var t=0,i=e.objects;t<i.length;t++){var n=i[t];this.pageLeft>=n.outerBounds.left&&(this.pageLeft=n.outerBounds.left,this.leftElement=n)}},YEi.prototype.findTop=function(e){e.first||e.second?(e.first&&this.findTop(e.first),e.second&&this.findTop(e.second)):(e.third&&this.findTop(e.third),e.fourth&&this.findTop(e.fourth));for(var t=0,i=e.objects;t<i.length;t++){var n=i[t];this.pageTop>=n.outerBounds.top&&(this.pageTop=n.outerBounds.top,this.topElement=n)}},YEi.prototype.setCurrentNode=function(e){(this.childNode=e)?(e=e.outerBounds,this.childLeft=Number(e.left),this.childTop=Number(e.top),this.childRight=Number(e.right),this.childBottom=Number(e.bottom)):(this.childLeft=Number.MAX_VALUE,this.childTop=Number.MAX_VALUE,this.childRight=-Number.MAX_VALUE,this.childBottom=-Number.MAX_VALUE)},YEi.prototype.getPageBounds=function(e,t){return this.pageLeft===Number.MAX_VALUE?new tfi(0,0,0,0):(e=void 0!==e?Math.min(this.pageLeft,0):this.pageLeft,t=void 0!==t?Math.min(this.pageTop,0):this.pageTop,new tfi(Math.round(e),Math.round(t),Math.round(this.pageRight-e),Math.round(this.pageBottom-t)))},YEi.prototype.getQuad=function(e){return this.quadTable[e.id]};var GEi=YEi;function YEi(e){this.quadSize=500,this.objectTable=e,this.parentQuad=new UEi(0,0,2*this.quadSize,2*this.quadSize,this),this.pageLeft=Number.MAX_VALUE,this.pageRight=-Number.MAX_VALUE,this.pageTop=Number.MAX_VALUE,this.pageBottom=-Number.MAX_VALUE,this.quadTable={}}XEi=function(e,t){return(XEi=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])}))(e,t)};var XEi,KEi,Ck=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Tg=(function(e,t){function i(){this.constructor=e}XEi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(JEi,KEi=n),Ck([e(!1)],JEi.prototype,"preventDefaults",void 0),JEi);function JEi(){return null!==KEi&&KEi.apply(this,arguments)||this}ZEi=function(e,t){return(ZEi=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])}))(e,t)};var ZEi,$Ei,Xd=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},nf=(function(e,t){function i(){this.constructor=e}ZEi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(eDi,$Ei=n),Xd([e("")],eDi.prototype,"action",void 0),Xd([e("")],eDi.prototype,"cursor",void 0),eDi);function eDi(){return null!==$Ei&&$Ei.apply(this,arguments)||this}iDi.prototype.lineRouting=function(e){var t=e.connectors.length;if(this.renderVirtualRegion(e),0<t)for(var i=0;i<t;i++){var n=e.connectors[parseInt(i.toString(),10)];"Orthogonal"===n.type&&n.visible&&this.refreshConnectorSegments(e,n,!0)}},iDi.prototype.renderVirtualRegion=function(e,t){var i=this.size,n=((e.spatialSearch.pageTop<0||e.spatialSearch.pageLeft<0)&&(i=this.size+this.size/2),e.spatialSearch.pageRight+i),o=e.spatialSearch.pageBottom+i,r=(r=e.spatialSearch.pageLeft-i)<0?r-20:0,i=(i=e.spatialSearch.pageTop-i)<0?i-20:0;if(t&&(this.width!==n-r||this.height!==o-i||this.diagramStartX!==r||this.diagramStartY!==i)||void 0===t){this.width=n-r,this.height=o-i,this.diagramStartX=r,this.diagramStartY=i,this.gridCollection=[],this.noOfRows=this.width/this.size,this.noOfCols=this.height/this.size;for(var s=this.size,a=this.diagramStartX<0?this.diagramStartX:0,l=this.diagramStartY<0?this.diagramStartY:0,h=0;h<this.noOfCols;h++){for(var d=0;d<this.noOfRows;d++){0===h&&this.gridCollection.push([0]);var p={x:a,y:l,width:s,height:s,gridX:d,gridY:h,walkable:!0,tested:void 0,nodeId:[]};this.gridCollection[parseInt(d.toString(),10)][parseInt(h.toString(),10)]=p,a+=s}a=this.diagramStartX<0?this.diagramStartX:0,l+=s}}t=this.findNodes(e.nodes);this.updateNodesInVirtualRegion(t)},iDi.prototype.findNodes=function(e){for(var t,i=[],n=0;n<e.length;n++)"SwimLane"===(t=e[parseInt(n.toString(),10)]).shape.type||t.isLane||t.isPhase||t.isHeader||!t.visible||i.push(t);return i},iDi.prototype.updateNodesInVirtualRegion=function(e){for(var t=this.size,i=this.diagramStartX<0?this.diagramStartX:0,n=this.diagramStartY<0?this.diagramStartY:0,o=0;o<this.noOfCols;o++){for(var r=0;r<this.noOfRows;r++){var s=this.gridCollection[parseInt(r.toString(),10)][parseInt(o.toString(),10)],a=new tfi(i,n,this.size,this.size),l=void 0,h=void 0;for(s.walkable=!0,s.tested=void 0,s.nodeId=[],h=0;h<e.length;h++)(l=e[parseInt(h.toString(),10)].wrapper.bounds?this.intersectRect(a,e[parseInt(h.toString(),10)].wrapper.bounds):l)&&(s.nodeId.push(e[parseInt(h.toString(),10)].id),s.walkable=!1,""!==e[parseInt(h.toString(),10)].parentId)&&(s.parentNodeId=e[parseInt(h.toString(),10)].parentId);i+=t}i=this.diagramStartX<0?this.diagramStartX:0,n+=t}},iDi.prototype.intersectRect=function(e,t){return!(t.left>=e.right||t.right<=e.left||t.top>=e.bottom||t.bottom<=e.top)},iDi.prototype.findEndPoint=function(e,t,i){var n,o;return t&&""!==e.sourcePortID&&e.sourcePortWrapper||!t&&""!==e.targetPortID&&e.targetPortWrapper?(n=uvi(t?{x:e.sourcePortWrapper.offsetX,y:e.sourcePortWrapper.offsetY}:{x:e.targetPortWrapper.offsetX,y:e.targetPortWrapper.offsetY},void 0,(t?e.sourceWrapper:e.targetWrapper).bounds),o=(t?e.sourcePortWrapper:e.targetPortWrapper).bounds,i?"Top"===n?{x:o.topCenter.x,y:o.topCenter.y}:"Left"===n?{x:o.middleLeft.x,y:o.middleLeft.y}:"Right"===n?{x:o.middleRight.x,y:o.middleRight.y}:{x:o.bottomCenter.x,y:o.bottomCenter.y}:{x:o.center.x,y:o.center.y}):t&&this.startNode||!t&&this.targetNode?t?{x:this.startNode.wrapper.offsetX,y:this.startNode.wrapper.offsetY}:{x:this.targetNode.wrapper.offsetX,y:this.targetNode.wrapper.offsetY}:t?{x:e.sourcePoint.x,y:e.sourcePoint.y}:{x:e.targetPoint.x,y:e.targetPoint.y}},iDi.prototype.getGridsIntersect=function(e,t){var i=[],n=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x,t.x),e=Math.max(e.y,t.y),t=this.size,s=Math.floor((n-this.diagramStartX)/t),a=Math.floor((o-this.diagramStartY)/t),l=Math.floor((r-this.diagramStartX)/t),h=Math.floor((e-this.diagramStartY)/t);if(e-o<r-n)for(var d=s;d<=l;d++)(p=this.gridCollection[parseInt(d.toString(),10)])&&(c=p[parseInt(a.toString(),10)])&&-1===i.indexOf(c)&&i.push(c);else for(var p,c,u=a;u<=h;u++)(p=this.gridCollection[parseInt(s.toString(),10)])&&(c=p[parseInt(u.toString(),10)])&&-1===i.indexOf(c)&&i.push(c);return i},iDi.prototype.isPathWalkable=function(e,t,i,n){for(var o=Math.min(e.x,t.x),r=Math.min(e.y,t.y),s=Math.max(e.x,t.x),a=Math.max(e.y,t.y),l=this.getGridsIntersect(e,t),h=0;h<l.length;h++){var d=l[parseInt(h.toString(),10)];if((!n||-1===d.nodeId.indexOf(n.sourceID)&&-1===d.nodeId.indexOf(n.targetID))&&!d.walkable)for(var p=a-r<s-o,c=0,u=d.nodeId;c<u.length;c++){var g=u[c],g=i.nameTable[""+g];if(g){g=g.wrapper.bounds;if(p){if(g.top-5<r&&g.bottom+5>a)return!1}else if(g.left-5<o&&g.right+5>s)return!1}}}return!0},iDi.prototype.checkObstaclesIntersect=function(e,t,i){for(var n=1;n<e.length;n++){var o=e[n-1],r=e[parseInt(n.toString(),10)];if(!this.isPathWalkable(o,r,i,t))return!1}return!0},iDi.prototype.refreshConnectorSegments=function(e,t,i,n){if(t.sourceID&&t.targetID&&t.sourceID!==t.targetID)if(!this.skipObstacleCheck&&t.segments&&t.segments.length<2&&t.intermediatePoints&&this.checkObstaclesIntersect(t.intermediatePoints,t,e))e.avoidLineOverlappingModule&&i&&(e.avoidLineOverlappingModule.addConnector(t),e.avoidLineOverlappingModule.refreshModifiedConnectors(e));else{var o,r,s,a,l,h,d,p,c,u,g,m=t.sourceID,f=t.targetID,y=t.sourcePortID,v=t.targetPortID;if(u=e,g=0,(c=t).constraints&Yfi.LineRouting?g=c.constraints&Yfi.LineRouting:c.constraints&Yfi.InheritLineRouting&&(g=u.constraints&$fi.LineRouting),g||n){this.startNode=e.nameTable[""+m],this.targetNode=e.nameTable[""+f],this.intermediatePoints=[],this.startArray=[],this.targetGridCollection=[],this.sourceGridCollection=[],this.startGrid=void 0,this.targetGrid=void 0;for(var b=0;b<this.noOfCols;b++)for(var w=0;w<this.noOfRows;w++)this.gridCollection[parseInt(w.toString(),10)][parseInt(b.toString(),10)].tested=this.gridCollection[parseInt(w.toString(),10)][parseInt(b.toString(),10)].parent=void 0,this.gridCollection[parseInt(w.toString(),10)][parseInt(b.toString(),10)].previousDistance=this.gridCollection[parseInt(w.toString(),10)][parseInt(b.toString(),10)].afterDistance=void 0,this.gridCollection[parseInt(w.toString(),10)][parseInt(b.toString(),10)].totalDistance=void 0;for(var C=this.findEndPoint(t,!0),S=this.findEndPoint(t,!1),b=0;b<this.noOfRows;b++)for(w=0;w<this.noOfCols;w++){var A,x=this.gridCollection[parseInt(b.toString(),10)][parseInt(w.toString(),10)],I=new tfi(x.x,x.y,x.width,x.height);!I.containsPoint(C)||this.startGrid||-1===x.nodeId.indexOf(m)&&""!==m||(this.startGrid=(y&&this.startGrid,x)),!I.containsPoint(S)||this.targetGrid||-1===x.nodeId.indexOf(f)&&""!==f||(this.targetGrid=(v&&this.targetGrid,x)),!y&&this.startNode&&(A=this.startNode.wrapper.bounds,I.containsPoint(A.topCenter)&&!o&&(o=x),I.containsPoint(A.middleLeft)&&!s&&(s=x),I.containsPoint(A.middleRight)&&!a&&(a=x),I.containsPoint(A.bottomCenter))&&!r&&(r=x),!v&&this.targetNode&&(A=this.targetNode.wrapper.bounds,I.containsPoint(A.topCenter)&&!h&&(h=x),I.containsPoint(A.middleLeft)&&!p&&(p=x),I.containsPoint(A.middleRight)&&!l&&(l=x),I.containsPoint({x:A.bottomCenter.x,y:A.bottomCenter.y}))&&!d&&(d=x)}this.findEdgeBoundary(y,s,a,o,r,!0),this.findEdgeBoundary(v,p,l,h,d,!1),this.startGrid.totalDistance=0,this.startGrid.previousDistance=0,this.intermediatePoints.push({x:this.startGrid.gridX,y:this.startGrid.gridY}),this.startArray.push(this.startGrid),t&&p&&l&&h&&d&&this.checkObstacles(t,e,p,l,h,d);e:for(;0<this.startArray.length;){var T=this.startArray.pop();if(T){for(b=0;b<this.targetGridCollection.length;b++){var E=this.targetGridCollection[parseInt(b.toString(),10)];if(T&&T.gridX===E.gridX&&T.gridY===E.gridY){if(this.getIntermediatePoints(T),this.optimizeIntermediatePoints(),T.nodeId&&1<T.nodeId.length&&(t.segments=[]),this.updateConnectorSegments(e,this.intermediatePoints,this.gridCollection,t,i)){this.considerWalkable=[];break e}this.targetGridCollection.splice(this.targetGridCollection.indexOf(E),1),T=this.startArray.pop()}}T&&this.findPath(T)}}}}},iDi.prototype.checkChildNodes=function(e,t){var i=!1,n=!1;if(1<=e.nodeId.length&&!t)for(var o=0;o<e.nodeId.length;o++){for(var r=e.nodeId[parseInt(o.toString(),10)],s=0;s<e.nodeId.length;s++)this.targetNode.parentId===e.nodeId[parseInt(s.toString(),10)]&&(n=!0);i=!n&&this.targetNode.id===r}else 1===e.nodeId.length&&(i=!0);return i},iDi.prototype.findEdgeBoundary=function(e,t,i,n,o,r){var s,a=r?this.sourceGridCollection:this.targetGridCollection;if(!e&&(r?this.startNode:this.targetNode)){for(var l=t.gridX;l<=i.gridX;l++)s=this.gridCollection[parseInt(l.toString(),10)][t.gridY],(this.checkChildNodes(s,r)&&(l===t.gridX||l===i.gridX)||l!==t.gridX&&l!==i.gridX)&&a.push(s);for(l=n.gridY;l<=o.gridY;l++)s=this.gridCollection[n.gridX][parseInt(l.toString(),10)],(this.checkChildNodes(s,r)&&(l===n.gridY||l===o.gridY)||l!==n.gridY&&l!==o.gridY)&&-1===a.indexOf(s)&&a.push(s)}else a.push(r?this.startGrid:this.targetGrid)},iDi.prototype.checkObstacles=function(e,t,i,n,o,r){var s;if(0===this.findNearestNeigbours(this.startGrid,this.gridCollection,!0).length&&(""!==e.sourcePortID?"Top"===(s=uvi({x:e.sourcePortWrapper.offsetX,y:e.sourcePortWrapper.offsetY},void 0,e.sourceWrapper.bounds))?this.resetGridColl(this.startGrid,"top",!0):"Right"===s?this.resetGridColl(this.startGrid,"right",!0):"Bottom"===s?this.resetGridColl(this.startGrid,"bottom",!0):this.resetGridColl(this.startGrid,"left",!0):(this.resetGridColl(this.startGrid,"top",!0),this.resetGridColl(this.startGrid,"right",!0),this.resetGridColl(this.startGrid,"bottom",!0),this.resetGridColl(this.startGrid,"left",!0))),0===this.findNearestNeigbours(this.targetGrid,this.gridCollection,!1).length&&(""!==e.targetPortID?"Top"===(s=uvi({x:e.targetPortWrapper.offsetX,y:e.targetPortWrapper.offsetY},void 0,e.targetWrapper.bounds))?this.resetGridColl(this.targetGrid,"top",!0):"Right"===s?this.resetGridColl(this.targetGrid,"right",!0):"Bottom"===s?this.resetGridColl(this.targetGrid,"bottom",!0):this.resetGridColl(this.targetGrid,"left",!0):(this.resetGridColl(this.targetGrid,"top",!1),this.resetGridColl(this.targetGrid,"right",!1),this.resetGridColl(this.targetGrid,"bottom",!1),this.resetGridColl(this.targetGrid,"left",!1))),1<this.targetGridCollection.length&&1<this.targetGridCollection[0].nodeId.length)for(var a=0;a<=1;a++){for(var l=this.targetGridCollection[parseInt(a.toString(),10)].gridX,h=this.targetGridCollection[parseInt(a.toString(),10)].gridY,d=this.targetGridCollection[parseInt(a.toString(),10)].nodeId,p=void 0,c=0;c<d.length;c++)if(this.targetNode.id!==d[parseInt(c.toString(),10)]){p=d[parseInt(c.toString(),10)];break}for(var u=void 0,g=void 0,m=void 0,f=(t.nameTable[this.targetNode.id]&&(u=t.nameTable[this.targetNode.id].wrapper),t.nameTable[""+p]&&(g=t.nameTable[""+p].wrapper),u&&g&&(m=this.contains(g.bounds,u.bounds)),void 0),y=0;y<d.length;y++)this.targetNode.parentId===d[parseInt(y.toString(),10)]&&(f=!0);this.gridCollection[parseInt(l.toString(),10)][parseInt(h.toString(),10)].walkable||!m||f||(u=g=void 0,g=this.getEndvalue(i,"left"),u=i.gridX-g.gridX,this.changeValue(i,u,"left"),u=(g=this.getEndvalue(n,"right")).gridX-n.gridX,this.changeValue(n,u,"right"),g=this.getEndvalue(o,"top"),u=o.gridY-g.gridY,this.changeValue(o,u,"top"),g=this.getEndvalue(r,"bottom"),u=r.gridY-g.gridY,this.changeValue(r,u,"top"))}},iDi.prototype.contains=function(e,t){return e.left<=t.left&&e.right>=t.right&&e.top<=t.top&&e.bottom>=t.bottom},iDi.prototype.getEndvalue=function(e,t){return this.gridCollection[e.gridX][e.gridY].walkable?e:"left"===t?this.getEndvalue(this.gridCollection[e.gridX-1][e.gridY],t):"right"===t?this.getEndvalue(this.gridCollection[e.gridX+1][e.gridY],t):"top"===t?this.getEndvalue(this.gridCollection[e.gridX][e.gridY-1],t):"bottom"===t?this.getEndvalue(this.gridCollection[e.gridX][e.gridY+1],t):e},iDi.prototype.changeValue=function(e,t,i){var n;e.walkable||this.considerWalkable.push(e);for(var o=0;o<=t;o++)"left"===i?n=this.gridCollection[e.gridX-o][e.gridY]:"right"===i?n=this.gridCollection[e.gridX+o][e.gridY]:"top"===i?n=this.gridCollection[e.gridX][e.gridY-o]:"bottom"===i&&(n=this.gridCollection[e.gridX][e.gridY+o]),n.walkable||this.considerWalkable.push(n)},iDi.prototype.getIntermediatePoints=function(e){var t;for(this.intermediatePoints=[];e;)this.intermediatePoints.push({x:e.gridX,y:e.gridY}),e=e.parent;this.intermediatePoints.reverse(),1<=this.intermediatePoints.length&&void 0!==this.intermediatePoints[0]&&void 0!==this.intermediatePoints[1]&&(this.intermediatePoints[0].x===this.intermediatePoints[1].x?this.intermediatePoints[0].y<this.intermediatePoints[1].y?(t=this.neigbour(this.startGrid,"bottom",void 0,!0),this.intermediatePoints[0].y+=t-1):(t=this.neigbour(this.startGrid,"top",void 0,!0),this.intermediatePoints[0].y-=t-1):this.intermediatePoints[0].x<this.intermediatePoints[1].x?(t=this.neigbour(this.startGrid,"right",void 0,!0),this.intermediatePoints[0].x+=t-1):(t=this.neigbour(this.startGrid,"left",void 0,!0),this.intermediatePoints[0].x-=t-1))},iDi.prototype.optimizeIntermediatePoints=function(){this.intermediatePoints=this.removePointsInSameLine(this.intermediatePoints),this.intermediatePoints=this.getValidPoints(this.intermediatePoints)},iDi.prototype.removePointsInSameLine=function(e){if(e.length<3)return e;for(var t=[e[0]],i=1;i<e.length-1;i++){var n=t[t.length-1],o=e[parseInt(i.toString(),10)],r=e[i+1];this.arePointsInSameLine(n,o,r)||t.push(o)}return t.push(e[e.length-1]),t},iDi.prototype.arePointsInSameLine=function(e,t,i){return(t.x-e.x)*(i.y-e.y)==(i.x-e.x)*(t.y-e.y)},iDi.prototype.getValidPoints=function(e){if(!(e.length<4))for(var t=1;t<e.length-3;){var i=e[parseInt(t.toString(),10)],n=e[t+1],o=e[t+2],r=e[t+3];if(i.x===n.x){if(n.y<i.y&&r.y<o.y||n.y>i.y&&r.y>o.y){for(var s=i.x<o.x?1:-1,a=n.y<i.y?-1:1,l=i.x+s,h=i.y,d=!1;l!==r.x||h!==r.y;){if(!this.isWalkable(l,h)){d=!1;break}d=!0,l!==o.x?l+=s:h+=a}if(d){i.x=o.x,e.splice(t+1,2);continue}}}else if(i.y===n.y&&(n.x<i.x&&r.x<o.x||n.x>i.x&&r.x>o.x)){for(var p=i.y<o.y?1:-1,c=n.x<i.x?-1:1,u=i.y+p,g=i.x,m=!1;g!==r.x||u!==r.y;){if(!this.isWalkable(g,u)){m=!1;break}m=!0,u!==o.y?u+=p:g+=c}if(m){i.y=o.y,e.splice(t+1,2);continue}}t++}return e},iDi.prototype.updateConnectorSegments=function(e,t,i,n,o){var r,s,a,l,h,d,p=[],c=[],u=n.targetWrapper,g=n.sourceWrapper,m=this.findEndPoint(n,!0);""===n.targetPortID&&n.targetWrapper||(r=this.findEndPoint(n,!1,!0));for(var f=0;f<t.length;f++)(a=i[t[parseInt(f.toString(),10)].x][t[parseInt(f.toString(),10)].y])&&(s=a.x+a.width/2,a=a.y+a.height/2,c.push({x:s,y:a}),1<=f&&1<c.length&&(h=c[c.length-2].x!==c[c.length-1].x?c[c.length-2].x>c[c.length-1].x?"Left":"Right":c[c.length-2].y>c[c.length-1].y?"Top":"Bottom"),2<=f&&d===h&&1<c.length&&c.splice(c.length-2,1),d=h);if(c&&1<c.length){for(var y=0;y<c.length-1;y++){var v,b=c[parseInt(y.toString(),10)],w=c[y+1];b.x!==w.x?(0===y&&""===n.sourcePortID&&g&&(m=b.x>w.x?g.bounds.middleLeft:g.bounds.middleRight),y===c.length-2&&""===n.targetPortID&&u&&(r=b.x>w.x?u.bounds.middleRight:u.bounds.middleLeft),0===y&&m&&(b.x=m.x,b.y=w.y=m.y,""===n.sourcePortID&&(v=b.x>w.x?"Left":"Right",m=$0i(n,0,m,J0i(g.bounds,mvi(v)),!1)),b.x=m.x),y===c.length-2&&r&&(0<y&&n.targetDecorator&&r.x-w.x<0&&Math.abs(r.x-b.x)<n.targetDecorator.width+1&&(b.x=c[y-1].x-=this.size/2),0<y&&n.targetDecorator&&0<r.x-w.x&&Math.abs(r.x-b.x)<n.targetDecorator.width+1&&(b.x=c[y-1].x+=this.size/2),w.x=r.x,b.y=w.y=r.y)):(0===y&&""===n.sourcePortID&&g&&(m=b.y>w.y?g.bounds.topCenter:g.bounds.bottomCenter),y===c.length-2&&""===n.targetPortID&&u&&(r=b.y>w.y?u.bounds.bottomCenter:u.bounds.topCenter),0===y&&m&&(b.y=m.y,b.x=w.x=m.x,""===n.sourcePortID&&(v=b.y>w.y?"Top":"Bottom",m=$0i(n,0,m,J0i(g.bounds,mvi(v)),!1)),b.y=m.y),y===c.length-2&&r&&(0<y&&n.targetDecorator&&r.y-w.y<0&&Math.abs(r.y-b.y)<n.targetDecorator.height+1&&(b.y=c[y-1].y-=this.size/2),0<y&&n.targetDecorator&&0<r.y-w.y&&Math.abs(r.y-b.y)<n.targetDecorator.height+1&&(b.y=c[y-1].y+=this.size/2),w.y=r.y,b.x=w.x=r.x))}if(e.avoidLineOverlappingModule&&o&&(e.avoidLineOverlappingModule.addConnector(n,c),(S=e.avoidLineOverlappingModule.getModifiedConnector()).has(n)&&(p=e.avoidLineOverlappingModule.getModifiedConnectorSegments(n),S.delete(n)),0<S.size)&&e.avoidLineOverlappingModule.refreshModifiedConnectors(e),0===p.length)for(y=0;y<c.length-1;y++){var b=c[parseInt(y.toString(),10)],w=c[y+1],C=b.x!==w.x?b.x>w.x?(l="Left",b.x-w.x):(l="Right",w.x-b.x):b.y>w.y?(l="Top",b.y-w.y):(l="Bottom",w.y-b.y);p.push({type:"Orthogonal",length:C,direction:l})}}if(p&&0<p.length){var S=p[p.length-1];if(1===p.length&&(S.length-=20),S.length<10&&2===p.length&&(p.pop(),0<p.length)&&(p[0].length-=20,S=p[0]),n.targetDecorator&&("Top"===S.direction||"Bottom"===S.direction)&&S.length>n.targetDecorator.height+1||("Right"===S.direction||"Left"===S.direction)&&S.length>n.targetDecorator.width+1)return!o&&e.avoidLineOverlappingModule||(n.segments=p),o&&e.connectorPropertyChange(n,{},{type:"Orthogonal",segments:p}),!0}return!1},iDi.prototype.findPath=function(e){for(var t,i,n=[],o=this.findNearestNeigbours(e,this.gridCollection,!0),r=0;r<o.length;r++)null!==(i=this.findIntermediatePoints(o[parseInt(r.toString(),10)].gridX,o[parseInt(r.toString(),10)].gridY,e.gridX,e.gridY,this.targetGrid.gridX,this.targetGrid.gridY))&&(s=this.gridCollection[i.x][i.y],t=this.octile(Math.abs(i.x-e.gridX),Math.abs(i.y-e.gridY)),e.parent&&e.parent.parent&&s.gridX!==e.parent.gridX&&s.gridY!==e.parent.gridY&&(t+=.1),t=e.previousDistance+t,s.previousDistance&&!(s.previousDistance>t)||i.x===e.gridX&&i.y===e.gridY||(n.push(i),s.previousDistance=t,s.afterDistance=s.afterDistance||this.manhattan(Math.abs(i.x-this.targetGrid.gridX),Math.abs(i.y-this.targetGrid.gridY)),s.totalDistance=s.previousDistance+s.afterDistance,s.parent=e));if(0<n.length)for(r=0;r<n.length;r++){var s=this.gridCollection[n[parseInt(r.toString(),10)].x][n[parseInt(r.toString(),10)].y];-1===this.startArray.indexOf(s)&&this.startArray.push(s)}this.sorting(this.startArray)},iDi.prototype.sorting=function(e){for(var t=!1;!t;){t=!0;for(var i,n=1;n<e.length;n+=1)e[n-1].totalDistance<e[parseInt(n.toString(),10)].totalDistance&&(t=!1,i=e[n-1],e[n-1]=e[parseInt(n.toString(),10)],e[parseInt(n.toString(),10)]=i)}return e},iDi.prototype.octile=function(e,t){var i=Math.SQRT2-1;return e<t?i*e+t:i*t+e},iDi.prototype.manhattan=function(e,t){return e+t},iDi.prototype.findNearestNeigbours=function(e,t,i){var n,o=[],r=e.parent;return r?(n=(e.gridX-r.gridX)/Math.max(Math.abs(e.gridX-r.gridX),1),r=(e.gridY-r.gridY)/Math.max(Math.abs(e.gridY-r.gridY),1),0!=n?(this.isWalkable(e.gridX,e.gridY-1,!0)&&-1===this.sourceGridCollection.indexOf(t[e.gridX][e.gridY-1])&&o.push(t[e.gridX][e.gridY-1]),this.isWalkable(e.gridX,e.gridY+1,!0)&&this.sourceGridCollection.indexOf(t[e.gridX][e.gridY+1])&&o.push(t[e.gridX][e.gridY+1]),this.isWalkable(e.gridX+n,e.gridY,!0)&&-1===this.sourceGridCollection.indexOf(t[e.gridX+n][e.gridY])&&o.push(t[e.gridX+n][e.gridY])):0!=r&&(this.isWalkable(e.gridX-1,e.gridY,!0)&&-1===this.sourceGridCollection.indexOf(t[e.gridX-1][e.gridY])&&o.push(t[e.gridX-1][e.gridY]),this.isWalkable(e.gridX+1,e.gridY,!0)&&-1===this.sourceGridCollection.indexOf(t[e.gridX+1][e.gridY])&&o.push(t[e.gridX+1][e.gridY]),this.isWalkable(e.gridX,e.gridY+r,!0))&&-1===this.sourceGridCollection.indexOf(t[e.gridX][e.gridY+r])&&o.push(t[e.gridX][e.gridY+r])):(this.neigbour(e,"top",o,i),this.neigbour(e,"right",o,i),this.neigbour(e,"bottom",o,i),this.neigbour(e,"left",o,i)),o},iDi.prototype.neigbour=function(e,t,i,n){for(var o=1;0<o;){var r,s="top"===t||"bottom"===t?e.gridX:"left"===t?e.gridX-o:e.gridX+o,a="right"===t||"left"===t?e.gridY:"top"===t?e.gridY-o:e.gridY+o;if((r=this.gridCollection[parseInt(s.toString(),10)][parseInt(a.toString(),10)])&&(n&&-1===this.sourceGridCollection.indexOf(r)||!n&&-1===this.targetGridCollection.indexOf(r)))return i&&this.isWalkable(s,a)&&i.push(r),o;if(!(0<s&&0<a))break;o++}return null},iDi.prototype.resetGridColl=function(e,t,i){for(var n=1;0<n;){var o="top"===t||"bottom"===t?e.gridX:"left"===t?e.gridX-n:e.gridX+n,r="right"===t||"left"===t?e.gridY:"top"===t?e.gridY-n:e.gridY+n;if((s=this.gridCollection[parseInt(o.toString(),10)][parseInt(r.toString(),10)])&&(i&&-1===this.sourceGridCollection.indexOf(s)||!i&&-1===this.targetGridCollection.indexOf(s))){if(this.isWalkable(o,r))break;var s=this.gridCollection[parseInt(o.toString(),10)][parseInt(r.toString(),10)];this.considerWalkable.push(s)}if(!(0<o&&0<r))break;"top"===t||"left"===t?n--:n++}return null},iDi.prototype.isWalkable=function(e,t,i){if(0<=e&&e<this.noOfRows&&0<=t&&t<this.noOfCols){e=this.gridCollection[parseInt(e.toString(),10)][parseInt(t.toString(),10)];if(e&&(e.walkable||(1===e.nodeId.length||2===e.nodeId.length&&e.parentNodeId||-1!==this.considerWalkable.indexOf(e))&&(-1!==this.sourceGridCollection.indexOf(e)||-1!==this.targetGridCollection.indexOf(e)||-1!==this.considerWalkable.indexOf(e)))&&(i&&!e.parent||!i))return!0}return!1},iDi.prototype.findIntermediatePoints=function(e,t,i,n,o,r){for(var i=e-i,n=t-n,s=e,a=t,l=0;l<this.targetGridCollection.length;l++)if(e===this.targetGridCollection[parseInt(l.toString(),10)].gridX&&t===this.targetGridCollection[parseInt(l.toString(),10)].gridY)return{x:e,y:t};if(!this.isWalkable(e,t))return null;var h=this.gridCollection[parseInt(e.toString(),10)][parseInt(t.toString(),10)];if(h.tested)return{x:e,y:t};if(h.tested=!0,0!==i&&(i=0<i?1:-1,this.isWalkable(s,a-1)&&!this.isWalkable(s-i,a-1)||this.isWalkable(s,a+1)&&!this.isWalkable(s-i,a+1)))return{x:e,y:t};if(0!==n){if(n=0<n?1:-1,this.isWalkable(s-1,a)&&!this.isWalkable(s-1,a-n)||this.isWalkable(s+1,a)&&!this.isWalkable(s+1,a-n))return{x:e,y:t};if(this.findIntermediatePoints(s+1,a,s,a,o,r)||this.findIntermediatePoints(s-1,a,s,a,o,r))return{x:e,y:t}}return this.findIntermediatePoints(s+i,a+n,s,a,o,r)},iDi.prototype.destroy=function(){},iDi.prototype.getModuleName=function(){return"LineRouting"};var tDi=iDi;function iDi(){this.size=20,this.intermediatePoints=[],this.gridCollection=[],this.startArray=[],this.targetGridCollection=[],this.sourceGridCollection=[],this.considerWalkable=[],this.skipObstacleCheck=!1}nDi=function(e,t){return(nDi=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])}))(e,t)};var nDi,oDi,sf=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},qf=(function(e,t){function i(){this.constructor=e}nDi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(rDi,oDi=n),sf([e(!0)],rDi.prototype,"inversedAlignment",void 0),rDi);function rDi(){return null!==oDi&&oDi.apply(this,arguments)||this}sDi=function(e,t){return(sDi=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])}))(e,t)};var sDi,aDi,C4=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},lDi=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},hDi=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},dDi=(function(e,t){function i(){this.constructor=e}sDi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(X,aDi=Ji),X.prototype.updateAnnotationText=function(e){},X.prototype.clearCollection=function(e){for(var t=[],i=0,n=Object.keys(this.nameTable);i<n.length;i++){var o=n[i];(o=this.nameTable[""+o])&&(e&&o instanceof ISi||!e&&o instanceof MIi)&&t.push(o)}this.clearObjects(t)},X.prototype.onPropertyChanged=function(e,t){var O=this;if(this.rotateUsingButton)this.rotateUsingButton=!1;else{var i=!0,n=!1,o=!1,r=void 0;if(this.diagramActions&ryi.Render){for(var s=0,a=Object.keys(e);s<a.length;s++)switch(a[s]){case"width":case"height":this.element.style.width=this.getSizeValue(this.width),this.element.style.height=this.getSizeValue(this.height),this.eventHandler.updateViewPortSize(this.element);for(var l=0,h=this.views;l<h.length;l++){var d=h[l];(R=this.views[""+d])instanceof X||R.updateView(R)}break;case"nodes":if(0<e.nodes.length&&0===t.nodes.length)this.clearCollection(),o=!0;else{for(var p=0,c=Object.keys(e.nodes);p<c.length;p++){var u=c[p],g=Number(u),m=this.nodes[parseInt(g.toString(),10)],f=e.nodes[parseInt(g.toString(),10)],y=(e.nodes[parseInt(g.toString(),10)].style&&e.nodes[parseInt(g.toString(),10)].style.gradient&&(this.updateGradient(e.nodes[parseInt(g.toString(),10)],t.nodes[parseInt(g.toString(),10)],this.nodes[parseInt(g.toString(),10)]),this.nodes[parseInt(g.toString(),10)].oldGradientValue=DTi(e.nodes[parseInt(g.toString(),10)].style.gradient)),n=n||void 0!==f.excludeFromLayout,e.nodes[g]&&e.nodes[g].shape&&e.nodes[g].shape.textAnnotation&&""!==e.nodes[g].shape.textAnnotation.textAnnotationTarget&&(r=DTi(this.nameTable[m.inEdges[0]])),this.nodePropertyChange(m,t.nodes[parseInt(g.toString(),10)],f,void 0,!0,!0),{element:m,cause:this.diagramActions,diagramAction:this.getDiagramAction(this.diagramActions),oldValue:t.nodes[parseInt(g.toString(),10)],newValue:e.nodes[parseInt(g.toString(),10)]});this.triggerEvent(dyi.propertyChange,y),i=i&&!1}"Canvas"===this.mode&&this.refreshDiagramLayer()}break;case"connectors":if(0<e.connectors.length&&0===t.connectors.length)this.clearCollection(!0),o=!0;else{for(var v=0,b=Object.keys(e.connectors);v<b.length;v++){var u=b[v],g=Number(u),m=this.connectors[parseInt(g.toString(),10)],f=e.connectors[parseInt(g.toString(),10)],w={sourcePoint:{x:m.sourcePoint.x,y:m.sourcePoint.y},targetPoint:{x:m.targetPoint.x,y:m.targetPoint.y}},y=(f&&(f.sourceDecorator||f.targetDecorator)&&(this.diagramActions|=ryi.DecoratorPropertyChange),this.connectorPropertyChange(m,t.connectors[parseInt(g.toString(),10)],f,!0,!0),e.connectors[parseInt(g.toString(),10)].sourceID&&!e.connectors[parseInt(g.toString(),10)].sourcePoint&&(t.connectors[parseInt(g.toString(),10)].sourcePoint={x:w.sourcePoint.x,y:w.sourcePoint.y},e.connectors[parseInt(g.toString(),10)].sourcePoint={x:m.sourcePoint.x,y:m.sourcePoint.y}),e.connectors[parseInt(g.toString(),10)].targetID&&!e.connectors[parseInt(g.toString(),10)].targetPoint&&(t.connectors[parseInt(g.toString(),10)].targetPoint={x:w.targetPoint.x,y:w.targetPoint.y},e.connectors[parseInt(g.toString(),10)].targetPoint={x:m.targetPoint.x,y:m.targetPoint.y}),f&&(f.sourceDecorator||f.targetDecorator)&&(this.diagramActions=this.diagramActions&~ryi.DecoratorPropertyChange),{element:m,cause:this.diagramActions,diagramAction:this.getDiagramAction(this.diagramActions),oldValue:t.connectors[parseInt(g.toString(),10)],newValue:e.connectors[parseInt(g.toString(),10)]});this.triggerEvent(dyi.propertyChange,y),m&&m.parentId&&"UmlClassifier"===this.nameTable[m.parentId].shape.type&&this.updateConnectorEdges(this.nameTable[m.parentId]||m),i=i&&!1}this.updateBridging(),"Canvas"===this.mode&&this.refreshDiagramLayer()}break;case"bridgeDirection":this.updateBridging(),"Canvas"===this.mode&&this.refreshDiagramLayer();break;case"backgroundColor":this.intOffPageBackground();break;case"pageSettings":this.validatePageSize(),this.updatePage();break;case"selectedItems":e.selectedItems.userHandles&&this.selectedItems.wrapper&&this.selectedItems.userHandles&&0<this.selectedItems.userHandles.length?this.renderSelector(!0):e.selectedItems.constraints&&this.renderSelector(!0);break;case"snapSettings":this.updateSnapSettings(e);break;case"commandManager":this.initCommands();break;case"layout":n=!0;break;case"segmentThumbShape":this.updateSelector();break;case"dataSourceSettings":this.clear(),"None"===this.layout.type?o=!0:(this.initObjects(),n=!0);break;case"tooltip":Xyi(this);break;case"rulerSettings":this.updateRulerSettings(e);break;case"layers":this.updateLayer(e);break;case"scrollSettings":this.scrollActions|=lyi.PropertyChange,this.updateScrollSettings(e),this.scrollActions&=~lyi.PropertyChange,this.scrollSettings.horizontalOffset=-this.scroller.horizontalOffset||0,this.scrollSettings.verticalOffset=-this.scroller.verticalOffset||0;break;case"locale":e.locale!==t.locale&&aDi.prototype.refresh.call(this);break;case"contextMenuSettings":if(void 0!==e.contextMenuSettings.showCustomMenuOnly&&(this.contextMenuSettings.showCustomMenuOnly=e.contextMenuSettings.showCustomMenuOnly),void 0!==e.contextMenuSettings.show&&(this.contextMenuSettings.show=e.contextMenuSettings.show),e.contextMenuSettings.items){for(var C=e.contextMenuSettings.items,S=0,A=Object.keys(C);S<A.length;S++){u=A[S],g=Number(u);this.contextMenuSettings.items[parseInt(g.toString(),10)]=C[parseInt(g.toString(),10)]}this.contextMenuModule?this.contextMenuModule.refreshItems():console.warn('[WARNING] :: Module "DiagramContextMenu" is not available in Diagram component! You either misspelled the module name or forgot to load it.')}break;case"serializationSettings":void 0!==e.serializationSettings.preventDefaults&&(this.serializationSettings.preventDefaults=e.serializationSettings.preventDefaults);break;case"tool":this.eventHandler.updateTool()}if(n&&!o){if(t.layout&&"DifferentPoint"===t.layout.connectionPointOrigin&&"SamePoint"===e.layout.connectionPointOrigin||t.layout&&e.layout&&!e.layout.enableRouting&&t.layout.enableRouting){for(var x=0;x<this.nodes.length;x++){var I=this.nodes[parseInt(x.toString(),10)];if(I.ports&&0<I.ports.length){for(var N=[],T=I.ports.length-1;0<=T;T--)"LineDistribution"===I.ports[parseInt(T.toString(),10)].id.split("_")[1]&&N.push(I.ports[parseInt(T.toString(),10)]);this.removePorts(I,N)}}for(T=0;T<this.connectors.length;T++){var E=this.connectors[parseInt(T.toString(),10)],V=E.sourcePortID,_=E.targetPortID;E.sourcePortID="",E.targetPortID="",E.sourcePortWrapper=void 0,E.targetPortWrapper=void 0,E.segments=[],this.connectorPropertyChange(E,{sourcePortID:V,targetPortID:_},{sourcePortID:"",targetPortID:""})}}this.doLayout(),this.renderReactTemplates()}if(i&&this.propertyChange&&(y={element:this,cause:this.diagramActions,diagramAction:this.getDiagramAction(this.diagramActions),oldValue:t,newValue:e},this.triggerEvent(dyi.propertyChange,y)),!o&&this.canLogChange()&&this.modelChanged(e,t)){var H=[],D=[],M=void 0;if(e.nodes&&0<Object.keys(e.nodes).length)for(var k=0,z=Object.keys(e.nodes);k<z.length;k++){u=z[k],M=parseInt(u,10);H.push(this.nodes[parseInt(M.toString(),10)].id)}if(e.connectors&&0<Object.keys(e.connectors).length)for(var P=0,j=Object.keys(e.connectors);P<j.length;P++){var u=j[P],W=parseInt(u,10);D.push(this.connectors[parseInt(W.toString(),10)].id)}var B,F,Q=H.concat(D);0===D.filter(function(e){return O.nameTable[""+e].isBpmnAnnotationConnector}).length&&(e.nodes&&e.nodes[M]&&e.nodes[M].shape&&e.nodes[M].shape.textAnnotation&&""!==e.nodes[M].shape.textAnnotation.textAnnotationTarget?(B=this.nameTable[this.nodes[parseInt(M.toString(),10)].inEdges[0]],this.startGroupAction(),B={type:"ConnectionChanged",undoObject:r,redoObject:DTi(B),category:"Internal"},F={type:"PropertyChanged",undoObject:t,redoObject:e,category:"Internal"},this.historyManager&&(this.addHistoryEntry(B),this.addHistoryEntry(F,Q)),this.endGroupAction()):(F={type:"PropertyChanged",undoObject:t,redoObject:e,category:"Internal"},this.historyManager&&this.addHistoryEntry(F,Q)))}this.resetDiagramActions(),o&&(this.initObjects(!0),this.refreshDiagramLayer(),n)&&this.doLayout();var U=1===Object.keys(e).length&&void 0!==e.scrollSettings;if(!o)for(var L=0,q=this.views;L<q.length;L++){var R=q[L];(d=this.views[""+R])instanceof X||(e.scrollSettings&&(e.scrollSettings.currentZoom,t.scrollSettings.currentZoom),U)||this.refreshCanvasDiagramLayer(d)}}}},X.prototype.updateSnapSettings=function(e){(void 0!==e.snapSettings.constraints||e.snapSettings.horizontalGridlines||e.snapSettings.verticalGridlines||e.snapSettings.gridType)&&this.diagramRenderer.updateGrid(this.snapSettings,sTi(this.element.id),this.scroller.transform,this.rulerSettings,this.hRuler,this.vRuler)},X.prototype.updateGradient=function(e,t,i){if(i.oldGradientValue)for(var n,o=i,r=i,s=t.style.gradient,a=t.style.gradient,l=0,h=Object.keys(e.style.gradient);l<h.length;l++)switch(h[l]){case"type":o.type&&(s.type=o.type);break;case"x1":o.x1&&(s.x1=o.x1);break;case"x2":o.x2&&(s.x2=o.x2);break;case"y1":o.y1&&(s.y1=o.y1);break;case"y2":o.y2&&(s.y2=o.y2);break;case"cx":r.cx&&(a.cx=r.cx);break;case"cy":r.cy&&(a.cy=r.cy);break;case"fx":r.fx&&(a.fx=r.fx);break;case"fy":r.fy&&(a.fy=r.fy);break;case"r":r.r&&(a.r=r.r);break;case"stops":i.oldGradientValue.stops&&((n=Object.values(DTi(i.oldGradientValue.stops))).pop(),t.style.gradient.stops=n)}},X.prototype.updateRulerSettings=function(e){void 0!==e.rulerSettings.dynamicGrid&&this.diagramRenderer.updateGrid(this.snapSettings,sTi(this.element.id),this.scroller.transform,this.rulerSettings,this.hRuler,this.vRuler),void 0!==e.rulerSettings.showRulers?(this.intOffPageBackground(),this.scroller.setSize(),this.renderRulers()):void 0===e.rulerSettings.horizontalRuler&&void 0===e.rulerSettings.verticalRuler||(void 0!==e.rulerSettings.horizontalRuler.thickness||void 0!==e.rulerSettings.verticalRuler.thickness?(FSi(this),this.intOffPageBackground(),this.scroller.setSize(),this.renderRulers()):BSi(this)),this.diagramRenderer.updateGrid(this.snapSettings,sTi(this.element.id),this.scroller.transform,this.rulerSettings,this.hRuler,this.vRuler)},X.prototype.getPersistData=function(){return this.addOnPersist(["loaded"])},X.prototype.preRender=function(){this.initializePrivateVariables(),this.isProtectedOnChange=!0,this.serviceLocator=new eEi,this.initializeServices(),this.setCulture();var e="measureElement";window[e]&&(window[e]=null),this.initDiagram(),this.initViews(),this.unWireEvents(),this.wireEvents(),this.element.classList.add("e-diagram")},X.prototype.initializePrivateVariables=function(){var e;""===this.element.id&&(e=document.getElementsByClassName("e-diagram").length,this.element.id="diagram_"+this.diagramid+"_"+e),this.defaultLocale={Copy:"Copy",Cut:"Cut",Paste:"Paste",Undo:"Undo",Redo:"Redo",SelectAll:"Select All",Grouping:"Grouping",Group:"Group",UnGroup:"Un Group",Order:"Order",BringToFront:"Bring To Front",MoveForward:"Move Forward",SendToBack:"Send To Back",SendBackward:"Send Backward"},this.layerZIndex=-1,this.layerZIndexTable={},void 0===this.swimlaneChildTable&&void 0===this.swimlaneZIndexTable&&(this.swimlaneChildTable={},this.swimlaneZIndexTable={}),this.nameTable={},this.pathTable={},this.groupTable={},this.commands={},this.isLoading||(this.views=[]),this.commandHandler=new zEi(this),this.eventHandler=new PEi(this,this.commandHandler),this.spatialSearch=new GEi(this.nameTable),this.scroller=new WEi(this)},X.prototype.initializeServices=function(){this.serviceLocator.register("localization",this.localeObj=new Cn(this.getModuleName(),this.defaultLocale,this.locale))},X.prototype.setCulture=function(){this.localeObj=new Cn(this.getModuleName(),this.defaultLocale,this.locale)},X.prototype.render=function(){this.refreshing&&this.dataSourceSettings.dataSource&&!this.isLoading&&(this.nodes=[],this.connectors=[]),this.refreshing||this.trigger("load",{diagram:this,name:"load"}),this.isRefreshed=!1,this.ignoreCollectionWatch=!0;window.domTable={};for(var e=[],t=(this.dataSourceSettings.crudAction.read&&this.renderInitialCrud(),this.initHistory(),this.diagramRenderer=new tAi(this.element.id,new $Si,"SVG"===this.mode),this.initLayers(),this.initializeDiagramLayers(),this.diagramRenderer.setLayers(),this.initObjects(!0),this.nodes),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].isExpanded||e.push(t[parseInt(i.toString(),10)]);if(e.length)for(i=e.length-1;0<=i;i--)0===i?this.commandHandler.expandNode(e[parseInt(i.toString(),10)],this,!1):this.commandHandler.expandNode(e[parseInt(i.toString(),10)],this,!0);this.canLayout&&this.doLayout(),this.lineRoutingModule?this.lineRoutingModule.lineRouting(this):this.constraints&$fi.LineRouting&&console.warn('[WARNING] :: Module "LineRouting" is not available in Diagram component! You either misspelled the module name or forgot to load it.'),this.validatePageSize(),this.renderPageBreaks(),this.diagramRenderer.renderSvgGridlines(this.snapSettings,sTi(this.element.id),this.scroller.transform,this.rulerSettings,this.hRuler,this.vRuler),this.commandHandler.initSelectorWrapper(),this.notify("initial-load",{}),this.trigger("load"),this.scroller.setSize(),this.scroller.updateScrollOffsets(),this.isRefreshed||this.refreshDiagramLayer(),(0<this.scrollSettings.verticalOffset||0<this.scrollSettings.horizontalOffset)&&this.updateScrollOffset(),F.isDevice&&(this.tool=eyi.ZoomPan|eyi.SingleSelect),this.notify("initial-end",{}),this.isProtectedOnChange=!1,this.tooltipObject=Xyi(this),this.diagramActions=ryi.Render,this.initCommands();var n,o,r,s=document.getElementsByClassName(this.element.id+"_hiddenUserHandleTemplate"),a=this.userHandleTemplate,l=s,s=this.selectedItems,h=this.element.id,d=document.getElementById(h).ej2_instances[0];if(a&&l)for(var p,c=ITi(a),u=0,g=s.userHandles;u<g.length;u++)if(n=g[u],c){for(o=c(DTi(n),d,"userHandleTemplate_"+n.name,void 0,void 0,!1),r=0;r<o.length;r++)(p=pTi("div",{style:"height: 100%; width: 100%; pointer-events: all",id:n.name+"_template_hiddenUserHandle"})).appendChild(o[r]);l[0].appendChild(p)}this.isLoading=!1,this.refreshRoutingConnectors(),this.renderComplete(),this.updateFitToPage(),this.refreshing&&this.renderReactTemplates()},X.prototype.updateFitToPage=function(){this.pageSettings&&this.pageSettings.fitOptions&&this.pageSettings.fitOptions.canFit&&this.fitToPage(this.pageSettings.fitOptions)},X.prototype.updateTemplate=function(){},X.prototype.renderInitialCrud=function(){var e,t=this;t.dataSourceSettings.crudAction.read&&((e=new Qe(t.dataSourceSettings.crudAction.read,"GET")).onSuccess=function(e){t.dataSourceSettings.dataManager?t.dataSourceSettings.dataManager=JSON.parse(e):t.dataSourceSettings.dataSource=JSON.parse(e),t.dataBind()},e.send().then()),t.dataSourceSettings.connectionDataSource.crudAction.read&&((e=new Qe(t.dataSourceSettings.connectionDataSource.crudAction.read,"GET")).onSuccess=function(e){t.dataSourceSettings.connectionDataSource.dataManager=JSON.parse(e),t.dataBind()},e.send().then())},X.prototype.getModuleName=function(){return"diagram"},X.prototype.getClassName=function(){return"Diagram"},X.prototype.requiredModules=function(){var e=[];return e.push({member:"Bpmn",args:[]}),e.push({member:"Bridging",args:[]}),e.push({member:"ConnectorEditingTool",args:[]}),this.constraints&$fi.UndoRedo&&e.push({member:"UndoRedo",args:[]}),"OrganizationalChart"!==this.layout.type&&"HierarchicalTree"!==this.layout.type&&!this.layout.enableAnimation||e.push({member:"LayoutAnimate",args:[]}),this.snapSettings.constraints&&e.push({member:"Snapping",args:[this]}),e.push({member:"Ej1Serialization",args:[this]}),e.push({member:"PrintandExport",args:[this]}),this.contextMenuSettings.show&&e.push({member:"contextMenu",args:[this,this.serviceLocator]}),"OrganizationalChart"!==this.layout.type&&"HierarchicalTree"!==this.layout.type||e.push({member:"OrganizationalChart",args:[this]}),"ComplexHierarchicalTree"===this.layout.type&&e.push({member:"ComplexHierarchicalTree",args:[]}),"MindMap"===this.layout.type&&e.push({member:"MindMapChart",args:[]}),"RadialTree"===this.layout.type&&e.push({member:"RadialTree",args:[]}),"SymmetricalLayout"===this.layout.type&&e.push({member:"SymmetricalLayout",args:[]}),"Flowchart"===this.layout.type&&e.push({member:"FlowchartLayout",args:[]}),(this.dataSourceSettings.dataManager||this.dataSourceSettings.dataSource||this.dataSourceSettings.crudAction.read||this.dataSourceSettings.connectionDataSource.crudAction.read)&&e.push({member:"DataBinding",args:[]}),this.constraints&$fi.LineRouting&&e.push({member:"LineRouting",args:[]}),this.constraints&$fi.AvoidLineOverlapping&&e.push({member:"AvoidLineOverlapping",args:[this]}),(this.layout&&("ComplexHierarchicalTree"===this.layout.type||"HierarchicalTree"===this.layout.type)||"Linear"===this.layout.arrangement||this.layout.enableRouting)&&e.push({member:"LineDistribution",args:[]}),e},X.prototype.removeUserHandlesTemplate=function(){if(this.selectedItems.userHandles.length)for(var e=0;e<this.selectedItems.userHandles.length;e++)for(var t=0,i=this.views;t<i.length;t++){var n=i[t];fTi(this.selectedItems.userHandles[parseInt(e.toString(),10)].name+"_template_hiddenUserHandle",n)}},X.prototype.destroy=function(){if(clearInterval(this.renderTimer),this.renderTimer=null,this.hRuler&&this.vRuler&&(this.hRuler.destroy(),this.vRuler.destroy()),this.tooltipObject.destroy(),this.droppable.destroy(),this.unWireEvents(),this.notify("destroy",{}),aDi.prototype.destroy.call(this),this.removeUserHandlesTemplate(),this.clearTemplate(),document.getElementById(this.element.id)){this.element.classList.remove("e-diagram");for(var e=document.getElementsByClassName("e-diagram-tooltip");0<e.length;)e[0].parentNode.removeChild(e[0]);var t,i=document.getElementById(this.element.id+"content"),i=(i&&this.element.removeChild(i),"measureElement");window[i]&&(--window[i].usageCount,t="measureElementCount",window[t]--,0===window[t])&&(window[i].parentNode.removeChild(window[i]),window[i]=null)}window.domTable={};for(var n=0;n<this.layers.length;n++)this.layers[parseInt(n.toString(),10)].zIndexTable={};this.diagramActions=void 0},X.prototype.wireEvents=function(){var e=F.touchStartEvent,t=F.touchEndEvent,i=F.touchMoveEvent,n=F.isPointer?"pointerleave":"mouseleave",o=F.isPointer,o="mozilla"!==F.info.name||o?"mousewheel":"DOMMouseScroll";E.add(this.diagramCanvas,e,this.eventHandler.mouseDown,this.eventHandler),E.add(this.diagramCanvas,i,this.eventHandler.mouseMove,this.eventHandler),E.add(this.diagramCanvas,t,this.eventHandler.mouseUp,this.eventHandler),E.add(this.diagramCanvas,n,this.eventHandler.mouseLeave,this.eventHandler),E.add(this.diagramCanvas,"keydown",this.eventHandler.keyDown,this.eventHandler),E.add(this.diagramCanvas,"keyup",this.eventHandler.keyUp,this.eventHandler),E.add(this.diagramCanvas,"dblclick",this.eventHandler.doubleClick,this.eventHandler),E.add(this.diagramCanvas,"scroll",this.eventHandler.scrolled,this.eventHandler),E.add(this.diagramCanvas,o,this.eventHandler.mouseWheel,this.eventHandler),E.add(window,"resize",this.eventHandler.windowResize,this.eventHandler),this.initDroppables()},X.prototype.unWireEvents=function(){var e=F.touchStartEvent,t=F.touchMoveEvent,i=F.isPointer?"pointerleave":"mouseleave",n=F.isPointer,n="mozilla"!==F.info.name||n?"mousewheel":"DOMMouseScroll",o=F.touchEndEvent;E.remove(this.diagramCanvas,e,this.eventHandler.mouseDown),E.remove(this.diagramCanvas,t,this.eventHandler.mouseMove),E.remove(this.diagramCanvas,o,this.eventHandler.mouseUp),E.remove(this.diagramCanvas,i,this.eventHandler.mouseLeave),E.remove(this.diagramCanvas,"keydown",this.eventHandler.keyDown),E.remove(this.diagramCanvas,"keyup",this.eventHandler.keyUp),E.remove(this.diagramCanvas,"dblclick",this.eventHandler.doubleClick),E.remove(this.diagramCanvas,"scroll",this.eventHandler.scrolled),E.remove(this.diagramCanvas,n,this.eventHandler.mouseWheel),E.remove(window,"resize",this.eventHandler.windowResize)},X.prototype.select=function(e,t,i){null!=e&&this.commandHandler.selectObjects(e,t,i)},X.prototype.getDiagramAction=function(e){var t;return 2===e&&ryi.Render?t="Render":e&ryi.UndoRedo?t="UndoRedo":e&ryi.PublicMethod?t="PublicMethod":e&ryi.ToolAction?t="ToolAction":e&ryi.TextEdit?t="TextEdit":e&ryi.Group?t="Group":e&ryi.Interactions?t="Interactions":e&ryi.PreventHistory?t="PreventHistory":e&ryi.DecoratorPropertyChange?t="DecoratorPropertyChange":e&ryi.PreventZIndexOnDragging?t="PreventZIndexOnDragging":e&ryi.isGroupDragging?t="isGroupDragging":e&ryi.DragUsingMouse&&(t="DragUsingMouse"),t},X.prototype.selectAll=function(){var e=this.getObjectsOfLayer(this.activeLayer.objects);this.select(e)},X.prototype.unSelect=function(e){e&&Twi(this,e)&&this.commandHandler.unSelect(e)},X.prototype.clearSelection=function(){this.commandHandler.clearSelection(!0)},X.prototype.updateViewPort=function(){var e=this.getZoomingAttribute();this.updateBlazorDiagramProperties(e),this.eventHandler.updateViewPortSize(this.element),this.updateBlazorDiagramProperties(e,!0)},X.prototype.cutCommand=function(){this.cut()},X.prototype.cut=function(){this.commandHandler.cut()},X.prototype.addProcess=function(e,t){this.bpmnModule&&this.bpmnModule.addProcess(e,t,this)},X.prototype.removeProcess=function(e){this.bpmnModule&&this.bpmnModule.removeProcess(e,this)},X.prototype.pasteCommand=function(){this.paste()},X.prototype.paste=function(e){this.commandHandler.paste(e)},X.prototype.fitToPage=function(e){var t=this.getZoomingAttribute();this.updateBlazorDiagramProperties(t),this.scroller.fitToPage(e),this.updateBlazorDiagramProperties(t,!0)},X.prototype.bringIntoView=function(e){var t=this.getZoomingAttribute();this.updateBlazorDiagramProperties(t),this.scroller.bringIntoView(e,!0),this.updateBlazorDiagramProperties(t,!0)},X.prototype.bringToCenter=function(e){var t=this.getZoomingAttribute();this.updateBlazorDiagramProperties(t),this.scroller.bringToCenter(e),this.updateBlazorDiagramProperties(t,!0)},X.prototype.copyCommand=function(){this.copy()},X.prototype.copy=function(){return this.commandHandler.copy()},X.prototype.group=function(){1<this.selectedItems.nodes.concat(this.selectedItems.connectors).length&&(this.callBlazorModel=!1,this.insertBlazorDiagramObjects(this.selectedItems),this.commandHandler.group(),this.callBlazorModel=!0,this.commandHandler.getBlazorOldValues())},X.prototype.unGroup=function(){this.callBlazorModel=!1,this.insertBlazorDiagramObjects(this.selectedItems),this.commandHandler.unGroup(),this.callBlazorModel=!0,this.commandHandler.getBlazorOldValues()},X.prototype.sendToBack=function(){this.commandHandler.sendToBack()},X.prototype.setActiveLayer=function(e){e=this.commandHandler.getLayer(e);this.activeLayer=e},X.prototype.addLayer=function(e,t){this.commandHandler.addLayer(e,t)},X.prototype.removeLayer=function(e){this.commandHandler.removeLayer(e,N)},X.prototype.moveObjects=function(e,t){DTi(this.layers);this.enableServerDataBinding(!1),this.commandHandler.moveObjects(e,t)},X.prototype.layerObjectUpdate=function(){},X.prototype.sendLayerBackward=function(e){this.layerObjectUpdate(),this.commandHandler.sendLayerBackward(e)},X.prototype.bringLayerForward=function(e){this.layerObjectUpdate(),this.commandHandler.bringLayerForward(e)},X.prototype.cloneLayer=function(e){this.commandHandler.cloneLayer(e)},X.prototype.bringToFront=function(){this.commandHandler.bringToFront()},X.prototype.moveForward=function(){this.commandHandler.sendForward()},X.prototype.sendBackward=function(){this.commandHandler.sendBackward()},X.prototype.getObject=function(e){return this.nameTable[""+e]},X.prototype.getNodeObject=function(e){return DTi(this.nameTable[""+e])},X.prototype.getConnectorObject=function(e){return DTi(this.nameTable[""+e])},X.prototype.getActiveLayer=function(){return this.activeLayer},X.prototype.nudgeCommand=function(e,t,i){var n;"object"!=typeof e&&0<(this.selectedItems.nodes.length||this.selectedItems.connectors.length)&&(n=void 0,t.type&&"KEYDOWN"===t.type&&(n=t.type),this.nudge(e,void 0,void 0,n))},X.prototype.nudge=function(e,t,i,n){var o=0,r=0,t=("Left"===e||"Right"===e?o=("Left"===e?-1:1)*(t||1):r=("Up"===e?-1:1)*(i||1),"KEYDOWN"===n&&(o*=5,r*=5),this.selectedItems),e=this.selectedItems.wrapper.children[0];e instanceof Tyi?this.commandHandler.labelDrag(t.nodes[0],e,o,r):(i=DTi(this.selectedItems),this.protectPropertyChange(!0),this.drag(t,o,r),this.protectPropertyChange(!1),n={type:"PositionChanged",redoObject:DTi(this.selectedItems),undoObject:i,category:"Internal"},this.addHistoryEntry(n)),this.refreshCanvasLayers()},X.prototype.insertBlazorDiagramObjects=function(e){},X.prototype.drag=function(e,t,i){if((this.insertBlazorDiagramObjects(e),this.bpmnModule&&e instanceof MIi)&&this.bpmnModule.updateAnnotationDrag(e,this,t,i))return;if(e instanceof qIi){if(this.preventConnectorsUpdate=!0,e.nodes&&e.nodes.length){for(var n=0,o=e.nodes;n<o.length;n++){var r,s=o[n];this.callBlazorModel=!1,this.drag(s,t,i),s.parentId&&(r=this.nameTable[s.parentId]).isLane&&(1<e.nodes.length&&(this.preventConnectorsUpdate=!1),vwi(r,this.nameTable[r.parentId],s,this))}this.callBlazorModel=!0}if(e.connectors&&e.connectors.length){this.callBlazorModel=!1;for(var a=0,l=e.connectors;a<l.length;a++){var h=l[a];this.drag(h,t,i),-1===this.selectionConnectorsList.indexOf(h)&&this.selectionConnectorsList.push(h)}this.callBlazorModel=!0}this.updateSelector(),this.diagramActions&ryi.DragUsingMouse&&this.updatePage()}else e instanceof MIi&&this.bpmnModule&&this.bpmnModule.updateAnnotationDrag(e,this,t,i),this.commandHandler.drag(e,t,i);if(e instanceof qIi){this.preventConnectorsUpdate=!1;for(var d=0,p=this.selectionConnectorsList;d<p.length;d++){var c=p[d];this.updateConnectorProperties(this.nameTable[c.id]),"Bpmn"===c.shape.type&&"Default"===c.shape.sequence&&"Sequence"===c.shape.flow&&this.commandHandler.updatePathElementOffset(c)}this.selectionConnectorsList=[]}!this.callBlazorModel||this.blazorActions&zfi.interaction||this.blazorActions&zfi.GroupClipboardInProcess||this.commandHandler.getBlazorOldValues()},X.prototype.disableStackContainerPadding=function(e,t){if(e instanceof W1i&&(e.considerPadding=t),e.children)for(var i=0,n=e.children;i<n.length;i++){var o=n[i];this.disableStackContainerPadding(o,!1)}},X.prototype.scale=function(e,t,i,n){this.disableStackContainerPadding(e.wrapper,!1),this.insertBlazorDiagramObjects(e);var o=!0;if((e=e.id?this.nameTable[e.id]||e:e)instanceof qIi){if(e.nodes&&e.nodes.length){this.callBlazorModel=!1;for(var r=0,s=e.nodes;r<s.length;r++){var a=s[r],o=this.commandHandler.scale(a,t,i,n,e);this.commandHandler.checkBoundaryConstraints(void 0,void 0,e.wrapper.bounds)||this.commandHandler.scale(a,1/t,1/i,n,e)}this.callBlazorModel=!0}if(e.connectors&&e.connectors.length){this.callBlazorModel=!1;for(var l=0,h=e.connectors;l<h.length;l++){var d=h[l];this.commandHandler.scale(d,t,i,n,e),this.commandHandler.checkBoundaryConstraints(void 0,void 0,e.wrapper.bounds)||this.commandHandler.scale(d,1/t,1/i,n,e)}this.callBlazorModel=!0}O1i(this,this.selectedItems)||this.updateSelector(),this.refreshCanvasLayers()}else this.commandHandler.scale(e,t,i,n,e.children?e:void 0);return!this.callBlazorModel||this.blazorActions&zfi.interaction||this.blazorActions&zfi.GroupClipboardInProcess||this.commandHandler.getBlazorOldValues(),this.disableStackContainerPadding(e.wrapper,!0),o},X.prototype.rotate=function(e,t,i,n){var o,r=[];if(!n){if((o=DTi(e)).nodes&&0<o.nodes.length&&o.nodes[0].children){this.fromUndo||(this.rotateUsingButton=!0);for(var s=this.commandHandler.getAllDescendants(o.nodes[0],[]),a=0;a<s.length;a++){var l=this.commandHandler.cloneChild(s[parseInt(a.toString(),10)].id);r[s[parseInt(a.toString(),10)].id]=DTi(l)}}t<0&&(t=(t+360)%360)}if(this.insertBlazorDiagramObjects(e),e=e.id?this.nameTable[e.id]||e:e)if(i=i||{x:e.wrapper.offsetX,y:e.wrapper.offsetY},e instanceof qIi){this.callBlazorModel=!1,e.rotateAngle+=t,e.wrapper.rotateAngle+=t;var h=ETi(e.wrapper);if(!(h=this.commandHandler.checkBoundaryConstraints(void 0,void 0,h)))return e.rotateAngle-=t,e.wrapper.rotateAngle-=t,h;var d=[];d=(d=d.concat(e.nodes)).concat(e.connectors),this.commandHandler.rotateObjects(e,d,t,i),this.callBlazorModel=!0}else this.commandHandler.rotateObjects(e,[e],t,i);return!this.callBlazorModel||this.blazorActions&zfi.interaction||this.commandHandler.getBlazorOldValues(),n||this.fromUndo||o.nodes&&0<o.nodes.length&&o.nodes[0].children&&(d={type:"RotationChanged",redoObject:DTi(e),undoObject:DTi(o),category:"Internal",childTable:r},this.commandHandler.addHistoryEntry(d),this.commandHandler.updateSelector()),h},X.prototype.dragSourceEnd=function(e,t,i){this.insertBlazorDiagramObjects(e),this.commandHandler.dragSourceEnd(e,t,i),this.callBlazorModel&&this.commandHandler.getBlazorOldValues()},X.prototype.dragTargetEnd=function(e,t,i){this.insertBlazorDiagramObjects(e),this.commandHandler.dragTargetEnd(e,t,i),this.callBlazorModel&&this.commandHandler.getBlazorOldValues()},X.prototype.findObjectsUnderMouse=function(e,t){return this.eventHandler.findObjectsUnderMouse(e,t)},X.prototype.findObjectUnderMouse=function(e,t,i){return this.eventHandler.findObjectUnderMouse(e,t,i)},X.prototype.findTargetObjectUnderMouse=function(e,t,i,n,o){return this.eventHandler.findTargetUnderMouse(e,t,i,n,o)},X.prototype.findElementUnderMouse=function(e,t,i,n){return this.eventHandler.findElementUnderMouse(e,t,i,n)},X.prototype.findActionToBeDone=function(e,t,i,n){return this.eventHandler.findActionToBeDone(e,t,i,n)},X.prototype.updateConnectorPort=function(e){if(e.ports.length)for(var t=0,i=e.ports;t<i.length;t++){var n=i[t],o=this.getWrapper(e.wrapper,n.id);e.initPortWrapper(n,e.intermediatePoints,e.wrapper.bounds,o)}e.wrapper.measure(new Omi(e.wrapper.width,e.wrapper.height)),e.wrapper.arrange(e.wrapper.desiredSize)},X.prototype.getTool=function(e){var t=jTi(this.getCustomTool);return t&&(t=t(e))?t:this.eventHandler.getTool(e)},X.prototype.getCursor=function(e,t){var i=jTi(this.getCustomCursor);if(i&&(i=i(e,t)))return i;if(this.customCursor.length)for(var n=0;n<this.customCursor.length;n++)if(this.customCursor[parseInt(n.toString(),10)].action===e)return this.customCursor[parseInt(n.toString(),10)].cursor;return this.eventHandler.getCursor(e)},X.prototype.initHistory=function(){this.undoRedoModule&&this.undoRedoModule.initHistory(this)},X.prototype.addHistoryEntry=function(e,t){var i;!(this.undoRedoModule&&this.constraints&$fi.UndoRedo)||this.currentSymbol&&!this.checkCurrentSymbol(this.currentSymbol,e)||e.undoObject&&"helper"===e.undoObject.id||(i=this.undoRedoModule.addHistoryEntry(e,this),"StartGroup"!==e.type&&"EndGroup"!==e.type&&i&&this.historyChangeTrigger(e,"CustomAction",t))},X.prototype.checkCurrentSymbol=function(e,t){var i,n=!1;return t.undoObject&&t.redoObject&&(i=t.undoObject,!(!(t=t.undoObject).id||!i.id||t.id===e.id||i.id===e.id))||n},X.prototype.addCustomHistoryEntry=function(e){},X.prototype.historyChangeTrigger=function(e,t,i){var n={},o="oldValue",r="newValue",s=[];if("Internal"===e.category){switch(e&&e.redoObject&&e.redoObject.nodes instanceof Array&&e.redoObject.connectors instanceof Array?s=e.redoObject.nodes.concat(e.redoObject.connectors):e.redoObject&&s.push(e.redoObject),n.type=e.type,e.type){case"PositionChanged":"Undo"===t?(n[o]={offsetX:e.redoObject.offsetX,offsetY:e.redoObject.offsetY},n[r]={offsetX:e.undoObject.offsetX,offsetY:e.undoObject.offsetY}):(n[o]={offsetX:e.undoObject.offsetX,offsetY:e.undoObject.offsetY},n[r]={offsetX:e.redoObject.offsetX,offsetY:e.redoObject.offsetY});break;case"RotationChanged":"Undo"===t?(n[o]={rotateAngle:e.redoObject.rotateAngle},n[r]={rotateAngle:e.undoObject.rotateAngle}):(n[o]={rotateAngle:e.undoObject.rotateAngle},n[r]={rotateAngle:e.redoObject.rotateAngle});break;case"SizeChanged":"Undo"===t?(n[o]={offsetX:e.redoObject.offsetX,offsetY:e.redoObject.offsetY,width:e.redoObject.width,height:e.redoObject.height},n[r]={offsetX:e.undoObject.offsetX,offsetY:e.undoObject.offsetY,width:e.undoObject.width,height:e.undoObject.height}):(n[o]={offsetX:e.undoObject.offsetX,offsetY:e.undoObject.offsetY,width:e.undoObject.width,height:e.undoObject.height},n[r]={offsetX:e.redoObject.offsetX,offsetY:e.redoObject.offsetY,width:e.redoObject.width,height:e.redoObject.height});break;case"CollectionChanged":n[e.changeType]=s;break;case"ConnectionChanged":"Undo"===t?(n[o]={offsetX:e.redoObject.offsetX,offsetY:e.redoObject.offsetY},n[r]={offsetX:e.undoObject.offsetX,offsetY:e.undoObject.offsetY}):(n[o]={offsetX:e.undoObject.offsetX,offsetY:e.undoObject.offsetY},n[r]={offsetX:e.redoObject.offsetX,offsetY:e.redoObject.offsetY})}var a=[],l=[];if(void 0===i&&"PropertyChanged"===e.type){for(var h=0;h<Object.keys(e.undoObject).length;h++)if("nodes"===Object.keys(e.undoObject)[parseInt(h.toString(),10)])for(var d=0,p=Object.keys(e.undoObject.nodes);d<p.length;d++){var c=p[d],u=parseInt(c,10);a.push(this.nodes[parseInt(u.toString(),10)].id)}for(h=0;h<Object.keys(e.undoObject).length;h++)if("connectors"===Object.keys(e.undoObject)[parseInt(h.toString(),10)])for(var g=0,m=Object.keys(e.undoObject.connectors);g<m.length;g++){c=m[g],u=parseInt(c,10);l.push(this.connectors[parseInt(u.toString(),10)].id)}i=a.concat(l)}i={cause:e.category,source:s,change:n,action:t,sourceId:i};s.length&&this.triggerEvent(dyi.historyChange,i)}},X.prototype.startGroupAction=function(){this.diagramActions&ryi.UndoRedo||this.addHistoryEntry({type:"StartGroup",category:"Internal"})},X.prototype.endGroupAction=function(){this.diagramActions&ryi.UndoRedo||this.addHistoryEntry({type:"EndGroup",category:"Internal"})},X.prototype.undo=function(){this.canEnableBlazorObject=!0,this.callBlazorModel=!1,this.undoRedoModule&&this.constraints&$fi.UndoRedo?(this.isUndo=!0,this.undoRedoModule.undo(this),this.isUndo=!1):this.constraints&$fi.UndoRedo&&console.warn('[WARNING] :: Module "UndoRedo" is not available in Diagram component! You either misspelled the module name or forgot to load it.'),this.commandHandler.getBlazorOldValues(),this.callBlazorModel=!0,this.canEnableBlazorObject=!1},X.prototype.redo=function(){this.canEnableBlazorObject=!0,this.callBlazorModel=!1,this.undoRedoModule&&this.constraints&$fi.UndoRedo?this.undoRedoModule.redo(this):this.constraints&$fi.UndoRedo&&console.warn('[WARNING] :: Module "UndoRedo" is not available in Diagram component! You either misspelled the module name or forgot to load it.'),this.commandHandler.getBlazorOldValues(),this.callBlazorModel=!0,this.canEnableBlazorObject=!1},X.prototype.getBlazorDiagramObjects=function(e){if(e)for(var t=0;t<e.length;t++)this.insertBlazorDiagramObjects(e[parseInt(t.toString(),10)]);else this.insertBlazorDiagramObjects(this.selectedItems);this.callBlazorModel=!1,this.canEnableBlazorObject=!0},X.prototype.align=function(e,t,i){this.getBlazorDiagramObjects(t),t=t||(t=[]).concat(this.selectedItems.nodes,this.selectedItems.connectors),this.diagramActions=this.diagramActions|ryi.PublicMethod,this.commandHandler.align(t,e,i||"Object"),this.commandHandler.getBlazorOldValues(),this.callBlazorModel=!0,this.canEnableBlazorObject=!1},X.prototype.distribute=function(e,t){this.getBlazorDiagramObjects(t),t=t||(t=[]).concat(this.selectedItems.nodes,this.selectedItems.connectors),this.diagramActions=this.diagramActions|ryi.PublicMethod,this.commandHandler.distribute(t,e),this.commandHandler.getBlazorOldValues(),this.canEnableBlazorObject=!1,this.callBlazorModel=!0},X.prototype.sameSize=function(e,t){this.getBlazorDiagramObjects(t),t=t||(t=[]).concat(this.selectedItems.nodes,this.selectedItems.connectors),this.diagramActions=this.diagramActions|ryi.PublicMethod,this.commandHandler.sameSize(t,e),this.commandHandler.getBlazorOldValues(),this.canEnableBlazorObject=!1,this.callBlazorModel=!0},X.prototype.updateBlazorDiagramProperties=function(e,t){},X.prototype.getZoomingAttribute=function(){var e=[];return e.push("scrollSettings"),e.push("snapSettings"),e},X.prototype.zoom=function(e,t){var i=this.getZoomingAttribute();this.updateBlazorDiagramProperties(i),this.scroller.zoom(e,0,0,t),this.blazorActions&zfi.interaction||this.updateBlazorDiagramProperties(i,!0)},X.prototype.zoomTo=function(e){var t=this.getZoomingAttribute(),i=(this.updateBlazorDiagramProperties(t),e.zoomFactor||.2),i="ZoomOut"===e.type?1/(1+i):1+i;this.scroller.zoom(i,0,0,e.focusPoint),this.updateBlazorDiagramProperties(t,!0)},X.prototype.pan=function(e,t,i,n){var o=this.getZoomingAttribute();this.updateBlazorDiagramProperties(o),this.setCursor("grabbing"),this.scroller.zoom(1,e,t,i,n),this.updateBlazorDiagramProperties(o,!0)},X.prototype.reset=function(){var e=this.getZoomingAttribute();this.updateBlazorDiagramProperties(e),this.scroller.zoom(1/this.scroller.currentZoom,-this.scroller.horizontalOffset,-this.scroller.verticalOffset,{x:0,y:0}),this.updateBlazorDiagramProperties(e,!0)},X.prototype.resetSegments=function(){if(this.constraints&$fi.LineRouting&&this.lineRoutingModule)this.lineRoutingModule.lineRouting(this);else{this.protectPropertyChange(!0);for(var e=void 0,t=0;t<this.connectors.length;t++)(e=this.connectors[parseInt(t.toString(),10)]).segments=[],this.connectorPropertyChange(e,{},{segments:e.segments}),this.avoidLineOverlappingModule&&this.avoidLineOverlappingModule.removeConnector(e);this.protectPropertyChange(!1)}},X.prototype.setBlazorDiagramProps=function(e){var t=this.getZoomingAttribute();e?this.updateBlazorDiagramProperties(t):this.updateBlazorDiagramProperties(t,!0)},X.prototype.triggerEvent=function(t,i){return lDi(this,void 0,void 0,function(){return hDi(this,function(e){switch(e.label){case 0:return i&&this.updateEventValue(i),[4,this.trigger(dyi[""+t],i)];case 1:return[2,e.sent()]}})})},X.prototype.updateEventValue=function(e){var t=e.element;e.element&&t instanceof qIi&&t.nodes.length+t.connectors.length===1&&(e.element=(1===t.nodes.length?t.nodes:t.connectors)[0])},X.prototype.addNodeToLane=function(e,t,i){if(this.nameTable[""+t]){var n=this.nameTable[""+t];if(this.protectPropertyChange(!0),this.undoRedoModule&&this.historyManager.startGroupAction(),this.nameTable[e.id]||(e.offsetX=n.wrapper.bounds.width+n.wrapper.bounds.x,e.offsetY=n.wrapper.bounds.height+n.wrapper.bounds.y,e=this.add(e)),e.parentId="",n.shape.phases.length)for(var o=0;o<n.shape.phases.length;o++){l=t+i+o;if(this.nameTable[""+l]&&this.nameTable[""+l].isLane){var r,s=this.nameTable[""+l].wrapper.bounds,a={x:s.x+(s.x-n.wrapper.bounds.x+e.margin.left+e.wrapper.bounds.width/2),y:s.y+n.wrapper.bounds.y-e.margin.top};if("Horizontal"===n.shape.orientation?a.y=s.y:(a.x=s.x,r=this.nameTable[""+l].parentId+n.shape.lanes[0].id+"_0_header",a.y=s.y+(n.wrapper.bounds.y-this.nameTable[r].wrapper.bounds.height+e.margin.top+e.wrapper.bounds.height/2)),l===t+i+(n.shape.phases.length-1)||s.containsPoint(a)){this.commandHandler.updateLaneChildrenZindex(e,this.nameTable[""+l]),mwi(this,this.nameTable[""+l],e,void 0,!0),vwi(this.nameTable[""+l],n,e,this);break}}}else{var l=t+i+"0";this.nameTable[""+l]&&(this.commandHandler.updateLaneChildrenZindex(e,this.nameTable[""+l]),mwi(this,this.nameTable[""+l],e,void 0,!0),vwi(this.nameTable[""+l],n,e,this))}this.undoRedoModule&&this.historyManager.endGroupAction(),this.protectPropertyChange(!1)}this.updateDiagramElementQuad()},X.prototype.showTooltip=function(e){var t=ETi((e=e&&e.id&&!e.wrapper?this.nameTable[e.id]:e).wrapper),i={x:0,y:0},t=e.tooltip.content||"X:"+Math.round(t.x)+" Y:"+Math.round(t.y);e&&"Custom"===e.tooltip.openOn&&(i=e instanceof MIi?{x:e.offsetX+e.width/2,y:e.offsetY+e.height/2}:{x:e.targetPoint.x,y:e.targetPoint.x},this.commandHandler.showTooltip(e,i,t,"SelectTool",!0))},X.prototype.hideTooltip=function(e){e&&"Custom"===e.tooltip.openOn&&this.tooltipObject.close()},X.prototype.addNode=function(e,t){return this.add(e,t)},X.prototype.addChildToGroup=function(e,t){var i=this.allowServerDataBinding,n=(this.enableServerDataBinding(!1),this.isProtectedOnChange),o=(this.protectPropertyChange(!0),e=this.getObject(e.id),!(this.diagramActions&ryi.UndoRedo||this.diagramActions&ryi.Group||this.diagramActions&ryi.PreventHistory)),r=(o&&this.startGroupAction(),this.addChild(e,t)),o=(o&&((o={})[""+r]=DTi(this.getObject(r)),r={type:"AddChildToGroupNode",changeType:"Insert",undoObject:DTi(e),redoObject:DTi(e),category:"Internal",objectId:r,childTable:o},this.addHistoryEntry(r),this.endGroupAction()),this.nameTable[t]||t),r=document.getElementById(o.id+"_groupElement"),t=document.getElementById(e.id+"_groupElement");t&&r&&t.appendChild(r),this.protectPropertyChange(n),this.enableServerDataBinding(i),this.updateSelector()},X.prototype.removeChildFromGroup=function(e,t){var i=this.allowServerDataBinding,n=(this.enableServerDataBinding(!1),this.isProtectedOnChange),o=(this.protectPropertyChange(!0),DTi(e=this.getObject(e.id))),r=!(this.diagramActions&ryi.UndoRedo||this.diagramActions&ryi.Group||this.diagramActions&ryi.PreventHistory),s=(r&&this.startGroupAction(),this.removeChild(e,t)),s=(r&&((r={})[""+s]=DTi(this.getObject(s)),o={type:"RemoveChildFromGroupNode",changeType:"Remove",undoObject:DTi(o),redoObject:DTi(e),category:"Internal",objectId:s,childTable:r},this.addHistoryEntry(o),this.endGroupAction()),this.nameTable[t]||t),r=s.zIndex,o=this.layers.indexOf(this.commandHandler.getObjectLayer(s.id)),t=this.layers[parseInt(o.toString(),10)].objects[r+1],o=document.getElementById(t+"_groupElement"),r=document.getElementById(s.id+"_groupElement"),s=document.getElementById(e.id+"_groupElement");s&&r&&(t&&o?s.contains(o)?s.insertBefore(r,o):s.parentNode.contains(o)&&o.parentElement===s.parentElement?s.parentNode.insertBefore(r,o):s.parentNode.appendChild(r):s.parentNode.appendChild(r)),this.protectPropertyChange(n),this.enableServerDataBinding(i),this.updateSelector()},X.prototype.getHistoryStack=function(e){var t=[],i=e?this.historyManager.undoStack:this.historyManager.redoStack;if(void 0!==this.historyManager.stackLimit){for(var n=i.length-1;0<=n;n--)if(t.push(i[parseInt(n.toString(),10)]),t.length>this.historyManager.stackLimit)return t}else t=i;return t},X.prototype.getEdges=function(e){return e.outEdge?this.nameTable[e.id].outEdges:this.nameTable[e.id].inEdges},X.prototype.getParentId=function(e){return this.nameTable[""+e].parentId},X.prototype.addConnector=function(e){return this.add(e)},X.prototype.UpdateBlazorDiagramModelCollection=function(e,t,i,n){},X.prototype.UpdateBlazorDiagramModel=function(e,t,i,n){},X.prototype.UpdateBlazorLabelOrPortObjects=function(e,t,i,n){},X.prototype.addBlazorDiagramObjects=function(){},X.prototype.removeNodeEdges=function(e,t,i){var e=this.nameTable[""+e],n=i?e.outEdges:e.inEdges;if(0<n.length)for(var o=0;o<n.length;o++)n[parseInt(o.toString(),10)]===t&&n.splice(o,1)},X.prototype.insertBlazorConnector=function(e){},X.prototype.add=function(e,t){var i,n=this.isProtectedOnChange,o=(this.protectPropertyChange(!0),!1);if(e){var r=void 0;if(r={element:e=DTi(e),cause:this.diagramActions,diagramAction:this.getDiagramAction(this.diagramActions),state:"Changing",type:"Addition",cancel:!1},this.parentObject&&(r.parentId=this.parentObject.id),"helper"===e.id||this.diagramActions&ryi.PreventCollectionChangeOnDragOver||this.triggerEvent(dyi.collectionChange,r),r.cancel&&this.drawingObject){this.removeElements(r.element),this.tooltipObject.close();var s=this.getObject(r.element.sourceID),a=void 0;if(S1i(r.element)===ISi){if(r.element.sourceID&&(this.removeNodeEdges(r.element.sourceID,r.element.id,!0),0<s.ports.length)){for(var l=0;l<s.ports.length;l++){var h=s.ports[parseInt(l.toString(),10)];h.id===r.element.sourcePortID&&(a=!(0<h.outEdges.length))}this.removePortEdges(s,r.element.sourcePortID,r.element.id,a)}r.element.targetID&&this.removeNodeEdges(r.element.targetID,r.element.id,!1)}}this.diagramActions=this.diagramActions|ryi.PublicMethod,e.id=e.id||xTi();var d=this.activeLayer;if(!r.cancel&&d&&!d.lock){if(d.objects.indexOf(e.id)<0&&!d.lock&&(d.visible||(d.visible=!0,this.dataBind()),d.objects.push(e.id)),S1i(e)===ISi)(i=new ISi(this,"connectors",e,!0)).status="New",this.nameTable[i.targetID]&&"TextAnnotation"===this.nameTable[i.targetID].shape.shape&&(i.isBpmnAnnotationConnector=!0,i.constraints=i.constraints&~Yfi.Delete),bAi(i,e,this.connectorDefaults),this.connectors.push(i),this.initObject(i),!1===e.visible&&this.updateElementVisibility(i.wrapper,i,e.visible),this.updateEdges(i),this.insertBlazorConnector(i);else{if(bAi(i=new MIi(this,"nodes",e,!0),e,this.nodeDefaults),i.parentId=e.parentId||i.parentId,i.umlIndex=e.umlIndex,i.status="New",(o="TextAnnotation"===i.shape.shape)&&!e.isTextAnnotationCopied&&(i.inEdges=e.inEdges||i.inEdges),this.nodes.push(i),this.initObject(i,d,void 0,t),o&&this.bpmnModule)for(l=0;l<this.bpmnModule.bpmnTextAnnotationConnector.length;l++)null===this.bpmnModule.bpmnTextAnnotationConnector[parseInt(l.toString(),10)].wrapper&&this.initConnectors(this.bpmnModule.bpmnTextAnnotationConnector[parseInt(l.toString(),10)],void 0,!0);if(this.updateTemplate(),this.bpmnModule&&i.shape.activity&&i.shape.activity.subProcess.processes&&i.shape.activity.subProcess.processes.length&&this.bpmnModule.updateDocks(i,this),this.lineRoutingModule&&this.constraints&$fi.LineRouting)for(var p=this.spatialSearch.findObjects(i.wrapper.outerBounds),l=0;l<p.length;l++){var c=p[parseInt(l.toString(),10)];c instanceof ISi&&this.connectorPropertyChange(c,{},{sourceID:c.sourceID,targetID:c.targetID,sourcePortID:c.sourcePortID,targetPortID:c.targetPortID,sourcePoint:c.sourcePoint,targetPoint:c.targetPoint})}else this.constraints&$fi.LineRouting&&console.warn('[WARNING] :: Module "LineRouting" is not available in Diagram component! You either misspelled the module name or forgot to load it.');-1<i.umlIndex&&e.parentId&&this.nameTable[e.parentId]&&"UmlClassifier"===this.nameTable[e.parentId].shape.type&&((d=this.nameTable[e.parentId]).children.splice(i.umlIndex,0,i.id),d.wrapper.children.splice(i.umlIndex,0,i.wrapper),d.wrapper.measure(new Omi),d.wrapper.arrange(d.wrapper.desiredSize),this.updateDiagramObject(d))}r={element:i,cause:this.diagramActions,diagramAction:this.getDiagramAction(this.diagramActions),state:"Changed",type:"Addition",cancel:!1};this.parentObject&&(r.parentId=this.parentObject.id),"helper"===e.id||this.diagramActions&ryi.PreventCollectionChangeOnDragOver||this.triggerEvent(dyi.collectionChange,r),this.diagramActions&ryi.UndoRedo||this.diagramActions&ryi.Group||this.diagramActions&ryi.PreventHistory||(t={type:"CollectionChanged",changeType:"Insert",undoObject:DTi(e),redoObject:DTi(e),category:"Internal"},this.addHistoryEntry(t)),this.parentObject=void 0,"SVG"===this.mode&&(this.updateSvgNodes(i),this.updateTextElementValue(i),this.updateDiagramObject(i),o&&(d=this.nameTable[i.inEdges[0]],this.updateDiagramObject(d)),i.shape.activity&&i.shape.activity.subProcess.processes&&i.shape.activity.subProcess.processes.length&&this.updateProcesses(i),this.updateBridging())}}if(this.protectPropertyChange(n),this.resetDiagramActions(ryi.PublicMethod),i&&1<this.layers.length&&this.moveNode(i),this.views)for(var u=0,g=this.views;u<g.length;u++){var m=g[u],m=this.views[""+m];m instanceof X||this.refreshCanvasDiagramLayer(m)}return this.renderReactTemplates(),i},X.prototype.addElements=function(e){for(var t=0;t<e.length;t++)this.add(e[parseInt(t.toString(),10)]);this.pathDataStorage&&this.pathDataStorage.clear()},X.prototype.getPathData=function(e){return this.pathDataStorage||(this.pathDataStorage=new Map),this.pathDataStorage.has(e)?this.pathDataStorage.get(e):[]},X.prototype.setPathData=function(e,t){0===(this.pathDataStorage.get(e)||[]).length&&this.pathDataStorage.set(e,t)},X.prototype.updateSvgNodes=function(e){if(e.children)for(var t=0,i=e.children;t<i.length;t++){var n=i[t];this.nameTable[""+n]&&this.nameTable[""+n].parentId&&(n=$Ii(n+"_groupElement",this.element.id))&&n.parentNode.removeChild(n)}},X.prototype.updateProcesses=function(e){if(this.bpmnModule&&e&&e.shape&&e.shape.activity&&e.shape.activity.subProcess.processes&&e.shape.activity.subProcess.processes.length){var t=e.shape.activity.subProcess.processes;this.moveSvgNode(e.id);for(var i=0,n=t;i<n.length;i++)for(var o=n[i],r=(this.moveSvgNode(o),[]),s=(r=r.concat(this.nameTable[""+o].outEdges,this.nameTable[""+o].inEdges)).length-1;0<=s;s--)this.moveSvgNode(r[parseInt(s.toString(),10)]);for(var a=0,l=t;a<l.length;a++){o=l[a];this.nameTable[""+o].shape.activity.subProcess.processes&&this.nameTable[""+o].shape.activity.subProcess.processes.length&&this.updateProcesses(this.nameTable[""+o])}}else this.moveSvgNode(e.id)},X.prototype.moveSvgNode=function(e){var e=$Ii(e+"_groupElement",this.element.id),t=e.parentElement;e.parentNode.removeChild(e),t.appendChild(e)},X.prototype.addTextAnnotation=function(e,t){this.bpmnModule&&this.getBPMNTextAnnotation(t,this,e,!0)},X.prototype.spliceConnectorEdges=function(e,t){var i=[],n=t?this.nameTable[e.sourceID]:this.nameTable[e.targetID];if(n){for(var o=(i=t?n.outEdges:n.inEdges).length-1;0<=o;o--)i[parseInt(o.toString(),10)]===e.id&&i.splice(o,1);for(var r=0;n.ports&&r<n.ports.length;r++){var s=!t;this.removePortEdges(n,n.ports[parseInt(r.toString(),10)].id,e.id,s)}}},X.prototype.removeDependentConnector=function(e){if(e)for(var t,i,n,o,r=[],s=(r=r.concat(e.outEdges,e.inEdges)).length-1;0<=s;s--)(o=this.nameTable[r[parseInt(s.toString(),10)]])&&(this.connectorTable[o.id]=DTi(o),o.isBpmnAnnotationConnector?(t=this.nameTable[o.targetID],this.removeObjectsFromLayer(o),-1!==(i=this.connectors.indexOf(o))&&this.connectors.splice(i,1),this.removeElements(o),this.removeFromAQuad(o),delete this.nameTable[o.id],(i=this.nameTable[o.sourceID])&&-1!==(n=i.outEdges.indexOf(o.id))&&i.outEdges.splice(n,1),e.id!==o.targetID&&this.remove(t)):this.remove(o))},X.prototype.removeObjectsFromLayer=function(e){if(e.children)for(var t=0;t<e.children.length;t++){var i=this.nameTable[e.children[parseInt(t.toString(),10)]];i&&this.removeObjectsFromLayer(i)}var n=this.layers.indexOf(this.commandHandler.getObjectLayer(e.id)),o=this.layers[parseInt(n.toString(),10)].objects.indexOf(e.id);-1<o&&(Twi(this,e)&&this.unSelect(e),this.layers[parseInt(n.toString(),10)].objects.splice(o,1),delete this.layers[parseInt(n.toString(),10)].zIndexTable[this.nameTable[e.id].zIndex])},X.prototype.removeElements=function(e){if("SVG"===this.mode||"Canvas"===this.mode&&"Native"===e.shape.type){var t=$Ii(e.id+"_groupElement",this.element.id),i=e;if(i.ports&&0<i.ports.length)for(var n=0;n<i.ports.length;n++){var o=i.ports[parseInt(n.toString(),10)],o=$Ii(i.id+"_"+o.id+"_groupElement",this.element.id);o&&o.parentNode.removeChild(o)}t&&t.parentNode.removeChild(t)}if(this.refreshCanvasLayers(),e.wrapper){var r=e.wrapper.children,s=void 0;if(r)for(n=0;n<r.length;n++){if(r[parseInt(n.toString(),10)]instanceof Qyi||r[parseInt(n.toString(),10)].id&&0<r[parseInt(n.toString(),10)].id.indexOf("icon_content")){0<r[parseInt(n.toString(),10)].id.indexOf("icon_content")&&"SVG"===this.mode&&((s=$Ii(r[parseInt(n.toString(),10)].id+"_shape_groupElement",this.element.id))&&s.parentNode.removeChild(s),s=$Ii(r[parseInt(n.toString(),10)].id+"_rect_groupElement",this.element.id))&&s.parentNode.removeChild(s);for(var a=0,l=this.views;a<l.length;a++){var h=l[a],d=(fTi(r[parseInt(n.toString(),10)].id+"_groupElement",h),this.scroller.removeCollection.indexOf(e.id));this.scroller.removeCollection.splice(d,1)}}else if(r[parseInt(n.toString(),10)]instanceof Tvi)for(var p=0,c=this.views;p<c.length;p++){var h=c[p],u=(fTi(e.id+"_html_element",h),fTi(r[parseInt(n.toString(),10)].id+"_html_element",h),!0),g=this.nameTable[e.parentId];(u=(this.isAngular||this.isReact||this.isVue)&&(g&&g.isLane||this.constraints&$fi.Virtualization)?!1:u)&&(this.clearTemplate(["nodeTemplate_"+e.id]),r[parseInt(n.toString(),10)].annotationId)&&this.clearTemplate(["annotationTemplate_"+e.id+r[parseInt(n.toString(),10)].annotationId])}$Ai(r[parseInt(n.toString(),10)].id)}}},X.prototype.removeCommand=function(){this.remove()},X.prototype.remove=function(e){var t,i=(i=[]).concat(this.selectedItems.nodes,this.selectedItems.connectors),n=!1;if(e){if(e=this.nameTable[e.id],this.insertBlazorConnector(e),e&&(_vi(e)||this.diagramActions&ryi.Clear)&&(t={element:e,cause:this.diagramActions,diagramAction:this.getDiagramAction(this.diagramActions),state:"Changing",type:"Removal",cancel:!1},this.diagramActions&ryi.Clear||"helper"===e.id||this.triggerEvent(dyi.collectionChange,t),!t.cancel)){if(_vi(e)&&e&&e.shape&&"SwimLane"===e.shape.type)for(var o,r,s,a,l,h=this,d=e.wrapper.children[0].rows,p=0;p<d.length;p++)for(r=0;r<d[parseInt(p.toString(),10)].cells.length;r++){if((a=d[parseInt(p.toString(),10)].cells[parseInt(r.toString(),10)].children[0])&&a.children)for(s=a.children.length-1;0<=s;s--)a.children[parseInt(s.toString(),10)].children&&(l=h.nameTable[a.children[parseInt(s.toString(),10)].id])&&(l.isLane?Zbi(h,l):(h.removeDependentConnector(l),h.diagramActions|=ryi.PreventHistory,l.constraints&Kfi.Delete?h.remove(l):awi(h,l,{},!1),h.diagramActions&=~ryi.PreventHistory));a&&(o=h.nameTable[a.id])&&Zbi(h,o)}this.diagramActions&ryi.UndoRedo||this.diagramActions&ryi.PreventHistory||!(e instanceof MIi||e instanceof ISi)||(c={type:"CollectionChanged",changeType:"Remove",undoObject:DTi(e),redoObject:DTi(e),category:"Internal"},this.diagramActions&ryi.Clear||e.children&&!e.isLane&&!e.isPhase&&0<e.children.length&&this.undoRedoModule&&"None"===this.layout.type&&(this.historyManager.startGroupAction(),n=!0),(e instanceof MIi||e instanceof ISi)&&this.deleteDependentConnector&&this.removeDependentConnector(e),e.isLane)||e.isPhase||this.diagramActions&ryi.Clear||this.isStackChild(e)||this.addHistoryEntry(c),"TextAnnotation"===e.shape.shape&&this.removeDependentConnector(e),!e.children||e.isLane||e.isPhase||this.diagramActions&ryi.UndoRedo&&N||this.deleteGroup(e),e.parentId&&(this.deleteChild(e,void 0,!0),this.nameTable[e.parentId])&&"UmlClassifier"===this.nameTable[e.parentId].shape.type&&(this.updateDiagramObject(this.nameTable[e.parentId]),this.updateConnectorEdges(this.nameTable[e.parentId]));var c,u=void 0,g=(this.diagramActions=this.diagramActions|ryi.PublicMethod,this.nameTable[e.id]);g instanceof MIi?("Bpmn"===g.shape.type&&this.bpmnModule&&this.bpmnModule.removeBpmnProcesses(g,this),(g.isLane||g.isPhase||"SwimLane"===g.shape.type)&&((v=g.isLane||g.isPhase?this.nameTable[g.parentId]:this.nameTable[g.id]).wrapper.children[0],g.isLane?$bi(this,g,v):g.isPhase&&iwi(this,g,v)),-1!==(u=this.nodes.indexOf(g))&&(this.crudDeleteNodes.push(this.nameTable[g.id]),this.nodes.splice(u,1),this.updateNodeEdges(g))):(-1!==(u=this.connectors.indexOf(g))&&(this.crudDeleteNodes.push(this.nameTable[g.id]),this.connectors.splice(u,1)),this.updateEdges(g),this.spliceConnectorEdges(e,!0),this.spliceConnectorEdges(e,!1)),this.isServerUpdate||this.blazorActions&zfi.GroupClipboardInProcess||this.commandHandler.getBlazorOldValues(),n&&this.historyManager.endGroupAction(),Twi(this,g)&&this.unSelect(g),g.isPhase||(this.removeObjectsFromLayer(e),this.currentDrawingObject&&(this.currentDrawingObject.wrapper=void 0),delete this.nameTable[e.id],0<i.length&&i[0].id===g.id&&g.parentId&&(u=this.nameTable[g.parentId])&&u.isLane&&"SwimLane"===this.nameTable[u.parentId].shape.type&&Jbi(this,v=this.nameTable[u.parentId],u,g),this.removeElements(g),this.updateBridging(),"SVG"!==this.mode&&this.refreshDiagramLayer(),this.diagramActions&ryi.Clear)||(this.removeFromAQuad(g),t={element:e,cause:this.diagramActions,diagramAction:this.getDiagramAction(this.diagramActions),state:"Changed",type:"Removal",cancel:!1},"helper"!==e.id&&this.triggerEvent(dyi.collectionChange,t),this.resetTool())}}else if(0<i.length){this.undoRedoModule&&(this.historyManager.startGroupAction(),this.blazorActions|=zfi.GroupingInProgress,n=!0);for(var m=0;m<i.length;m++){var f=i[parseInt(m.toString(),10)],y=this.nameTable[f.parentId];this.nameTable[i[parseInt(m.toString(),10)].id]&&(!(y&&y.shape instanceof zIi)||f.isPhase||f.isLane&&(f=y.shape.header.id?y.shape.header.height:0,this.selectedItems.wrapper.bounds.x<=y.wrapper.bounds.x&&this.selectedItems.wrapper.bounds.width>=y.wrapper.bounds.width&&"Horizontal"===y.shape.orientation||this.selectedItems.wrapper.bounds.y<=y.wrapper.bounds.y+f&&this.selectedItems.wrapper.bounds.height>=y.wrapper.bounds.height-f&&"Vertical"===y.shape.orientation)&&(_vi(y)||1<y.shape.lanes.length))&&this.remove(i[parseInt(m.toString(),10)])}n&&(this.blazorActions&=~zfi.GroupingInProgress,this.isServerUpdate=!0,this.commandHandler.getBlazorOldValues(),this.UpdateBlazorDiagramModelCollection(void 0,void 0,void 0,!0),this.historyManager.endGroupAction(),this.isServerUpdate=!1),this.clearSelection()}if(e&&(_vi(e)||this.diagramActions&ryi.Clear)||this.diagramActions&ryi.UndoRedo||this.diagramActions&ryi.PreventHistory||!(e instanceof MIi||e instanceof ISi)||(c={type:"ConnectionChanged",undoObject:DTi(e),redoObject:DTi(e),category:"Internal"},e.isLane)||e.isPhase||this.diagramActions&ryi.Clear||this.isStackChild(e)||this.addHistoryEntry(c),this.tooltipObject.close(),e&&"helper"!==e.id&&this.lineRoutingModule&&this.constraints&$fi.LineRouting&&e instanceof MIi&&"ComplexHierarchicalTree"!==this.layout.type){var v=ETi(e.wrapper),u=(v.Inflate(40),this.spatialSearch.findObjects(v));this.avoidLineOverlappingModule&&this.avoidLineOverlappingModule.removeConnectors(u),this.lineRoutingModule.renderVirtualRegion(this,!0);for(var b=0,w=u;b<w.length;b++){var C=w[b];C instanceof ISi&&"Orthogonal"===C.type&&this.lineRoutingModule.refreshConnectorSegments(this,C,!0)}}},X.prototype.isStackChild=function(e){var t,i=this.nameTable[e.parentId];return e&&e.parentId&&i.container&&"Stack"===i.container.type&&"UmlClassifier"!==this.nameTable[e.parentId].shape.type&&(t=!0,i={sourceIndex:i.wrapper.children.indexOf(e.wrapper),source:e,target:void 0,targetIndex:void 0},this.diagramActions&ryi.UndoRedo||this.addHistoryEntry({type:"StackChildPositionChanged",redoObject:{sourceIndex:void 0,source:e,target:void 0,targetIndex:void 0},undoObject:i,category:"Internal"})),t},X.prototype.deleteChild=function(e,t,i){var n;if(t=t?this.nameTable[t.id]:this.nameTable[e.parentId],n="string"==typeof e?e:e.id,t&&t.children){for(var o=0;o<t.children.length;o++)if(t.children[parseInt(o.toString(),10)]===n){t.children.splice(o,1);for(var r=0;r<t.wrapper.children.length;r++)t.wrapper.children[parseInt(r.toString(),10)].id===n&&t.wrapper.children.splice(r,1);if(!i){var s=this.getObject(t.parentId);if(s&&s.shape instanceof zIi)for(var a=0;a<s.shape.lanes.length;a++){var l=e.parentId.split(s.id);if(s.shape.lanes[parseInt(a.toString(),10)].id===l[1].slice(0,-1))for(var h=0;h<s.shape.lanes[parseInt(a.toString(),10)].children.length;h++)if(e.id===s.shape.lanes[parseInt(a.toString(),10)].children[parseInt(h.toString(),10)].id){s.shape.lanes[parseInt(a.toString(),10)].children.splice(h,1);break}}}}t.wrapper.measure(new Omi),t.wrapper.arrange(t.wrapper.desiredSize)}},X.prototype.addChild=function(e,t,i){var n,o=this.nameTable[e.id];if(o.children||(o.children=[]),o.children&&("string"==typeof t?this.nameTable[""+t]&&(n=t):(n=t.id=t.id||xTi(),this.add(t)),n)&&(!t.umlIndex||-1===t.umlIndex)){var r=this.nameTable[""+n];if(r.parentId=o.id,o.container&&"Stack"===o.container.type&&this.updateStackProperty(o,r),i)o.children.splice(i,0,n),o.wrapper.children.splice(i,0,r.wrapper);else{o.children.push(n),o.wrapper.children.push(r.wrapper);var s=this.getObject(e.parentId),a=!1;if(s&&s.shape instanceof zIi)for(var l=0;l<s.shape.lanes.length;l++){var h=owi(o,this);if(s.shape.lanes[parseInt(l.toString(),10)].id===h.id){for(var d=0;d<s.shape.lanes[parseInt(l.toString(),10)].children.length;d++)if(s.shape.lanes[parseInt(l.toString(),10)].children[parseInt(d.toString(),10)].id===r.id){a=!0;break}a||s.shape.lanes[parseInt(l.toString(),10)].children.push(r);break}}}o.wrapper.measure(new Omi),o.wrapper.arrange(o.wrapper.desiredSize),o.isLane||(this.nameTable[e.id].width=o.wrapper.actualSize.width,this.nameTable[e.id].height=o.wrapper.actualSize.height,this.nameTable[e.id].offsetX=o.wrapper.offsetX,this.nameTable[e.id].offsetY=o.wrapper.offsetY),void 0!==o.container&&(r.offsetX=r.wrapper.offsetX,r.offsetY=r.wrapper.offsetY),(!o.parentId||this.nameTable[o.parentId]&&"SwimLane"!==this.nameTable[o.parentId].shape.type)&&this.updateDiagramObject(o)}return n},X.prototype.removeChild=function(e,t){var i,n=this.nameTable[e.id];if(n.children||(n.children=[]),n.children&&("string"==typeof t?this.nameTable[""+t]&&(i=t):i=t.id=t.id||xTi(),i)&&(!t.umlIndex||-1===t.umlIndex)){var o=this.nameTable[""+i];o.parentId="",n.container&&"Stack"===n.container.type&&this.updateStackProperty(n,o);for(var r=0;r<n.children.length;r++)if(n.children[parseInt(r.toString(),10)]===i){n.children.splice(r,1);for(var s=0;s<n.wrapper.children.length;s++)n.wrapper.children[parseInt(s.toString(),10)]===o.wrapper&&n.wrapper.children.splice(s,1)}n.wrapper.measure(new Omi),n.wrapper.arrange(n.wrapper.desiredSize),n.isLane||(this.nameTable[e.id].width=n.wrapper.actualSize.width,this.nameTable[e.id].height=n.wrapper.actualSize.height,this.nameTable[e.id].offsetX=n.wrapper.offsetX,this.nameTable[e.id].offsetY=n.wrapper.offsetY),(!n.parentId||this.nameTable[n.parentId]&&"SwimLane"!==this.nameTable[n.parentId].shape.type)&&this.updateDiagramObject(n)}return i},X.prototype.clear=function(){this.clearObjects(),this.clearLayers()},X.prototype.clearLayers=function(){for(var e=this.layers.length-1;0<=e;e--)this.removeLayer(this.layers[parseInt(e.toString(),10)].id);this.commandHandler.addLayer({id:"default_layer",visible:!0,lock:!1,objects:[],zIndex:0,objectZIndex:-1,zIndexTable:{}},null,!0),this.setActiveLayer(this.layers[this.layers.length-1].id)},X.prototype.clearObjects=function(e){var t=[],t=e||(t=t.concat(this.nodes)).concat(this.connectors);this.diagramActions=this.diagramActions|ryi.Clear;for(var i=0,n=t;i<n.length;i++){var o=n[i];this.nameTable[o.id]&&this.remove(o)}this.diagramActions=this.diagramActions&~ryi.Clear,this.spatialSearch=new GEi(this.nameTable),this.initHistory()},X.prototype.startEditCommad=function(){var e,t=this.selectedItems.nodes[0]||void 0;if(t&&t instanceof MIi)if(t.isLane&&t.parentId)for(var i=this.nameTable[t.parentId],n=i.shape.lanes,i=t.id.slice(i.id.length),o=i.substring(0,i.length-1),r=0;r<n.length;r++)t.isLane&&o===n[parseInt(r.toString(),10)].id&&(e=this.nameTable[n[parseInt(r.toString(),10)].header.id]);else"SwimLane"===t.shape.type&&t.shape.header&&t.shape.hasHeader&&(i=t.wrapper.children[0].rows[0].cells[0].children[0].id,e=this.nameTable[""+i]);this.startTextEdit(e)},X.prototype.startTextEdit=function(e,t){if(!ebi(this)&&!$vi(this)||Zvi(this)){this.textEditing=!0;var i=this.scroller.transform,n=rbi(this)?i.scale:1,o=void 0,r=void 0,s=void 0,a=void 0,l=void 0;if(e=e||this.selectedItems.nodes[0]||this.selectedItems.connectors[0]){!e.shape||"UmlClassifier"!==e.shape.type||e instanceof ISi||(e=this.nameTable[e.children[0]]);var h=!1;if(l)h=!0;else{if("Text"===e.shape.type||0!==e.annotations.length||e.constraints&Kfi.ReadOnly||(this.activeLabel.isGroup=!0,this.startGroupAction(),this.addLabels(e,[{id:xTi(),content:""}])),!t&&("Text"!==e.shape.type&&0<e.annotations.length||"Text"===e.shape.type))if("Text"===e.shape.type)t=e.wrapper.children[0].id.split("_")[1];else for(var d=e.annotations.length-1;0<=d;d--)e.annotations[parseInt(d.toString(),10)].visibility&&(t=e.annotations[parseInt(d.toString(),10)].id);t&&(l=this.getWrapper(e.wrapper,t))}!e||!l||l instanceof Tvi||(p=l,u=((c=e)instanceof ISi?Yfi:Kfi).ReadOnly,("Text"===c.shape.type?c.constraints&Kfi.ReadOnly:c.constraints&u?!!(p.constraints&Xfi.InheritReadOnly):!!(p.constraints&Xfi.ReadOnly))&&!h)||(c=l.style,u=void 0,u=(u=(l.bounds.width<e.wrapper.bounds.width?l:e.wrapper).bounds.width)<90?90:u,p=document.getElementById(this.element.id+"_editTextBoxDiv"),o=(h=document.getElementById(this.element.id+"_editBox"))?h.value:l.content,this.activeLabel.text=o,p||h||(p=pTi("div",{}),h=pTi("textarea",{}),this.diagramCanvas.appendChild(p),p.appendChild(h),h.appendChild(document.createTextNode(o))),(r=KIi(l.style,o,void 0,void 0,u)).isEmpty()&&(r="Text"!==e.shape.type?new Omi(a1i(e,l.id.split(e.id+"_")[1]).width||50,l.style.fontSize):new Omi(50<e.width?50:e.width,l.style.fontSize)),e.parentId&&"UmlClassifier"===this.nameTable[e.parentId].shape.type?(r.width=e.wrapper.bounds.width-20,s=(e.wrapper.bounds.center.x+i.tx)*i.scale-r.width/2*n-2.5,a=(e.wrapper.bounds.center.y+i.ty)*i.scale-r.height/2*n-3,l.style.textAlign="Left"):(r.width=Math.max(r.width,50),s=(l.bounds.center.x+i.tx)*i.scale-r.width/2*n-2.5,a=(l.bounds.center.y+i.ty)*i.scale-r.height/2*n-3),wTi(p,{id:this.element.id+"_editTextBoxDiv",style:"position: absolute;left:"+s+"px;top:"+a+"px;width:"+(r.width+1)*n+"px;height:"+r.height*n+"px; containerName:"+e.id+";"}),wTi(h,{"aria-label":o,id:this.element.id+"_editBox",style:"width:"+(r.width+1)*n+"px;height:"+r.height*n+"px;resize: none;outline: none;overflow: hidden;;font-family:"+c.fontFamily+";font-size:"+c.fontSize*n+"px;text-align:"+l.style.textAlign.toLocaleLowerCase()+";",class:"e-diagram-text-edit"}),h.style.fontWeight=c.bold?"bold":"",h.style.fontStyle=c.italic?"italic":"",h.style.lineHeight=(1.2*c.fontSize+"px;").toString(),h.style.textDecoration=c.textDecoration||"",this.activeLabel.parentId=e.id,this.activeLabel.id=t,l.visible=!1,this.updateDiagramObject(e),this.diagramActions=this.diagramActions|ryi.TextEdit,this.isTriggerEvent||(E.add(h,"input",this.eventHandler.inputChange,this.eventHandler),E.add(h,"focusout",this.focusOutEdit,this),h.select()))}}var p,c,u},X.prototype.updateConnectorfixedUserHandles=function(e){if(e.fixedUserHandles.length)for(var t=0,i=e.fixedUserHandles;t<i.length;t++){var n=i[t],o=this.getWrapper(e.wrapper,n.id);e.updateAnnotation(n,e.intermediatePoints,e.wrapper.bounds,o)}e.wrapper.measure(new Omi(e.wrapper.width,e.wrapper.height)),e.wrapper.arrange(e.wrapper.desiredSize)},X.prototype.updateNodeExpand=function(e,t){for(var i=0;i<e.outEdges.length;i++){var n=this.nameTable[e.outEdges[parseInt(i.toString(),10)]],o=this.nameTable[n.targetID];n.visible=t,!o||(t||(this.updateElementVisibility(n.wrapper,n,!1),o.isExpanded=t),this.updateNodeExpand(o,o.isExpanded),o.visible=t)||this.updateElementVisibility(o.wrapper,o,!1)}},X.prototype.updateConnectorAnnotation=function(e){if(e.annotations.length)for(var t=0,i=e.annotations;t<i.length;t++){var n=i[t],o=this.getWrapper(e.wrapper,n.id);e.updateAnnotation(n,e.intermediatePoints,e.wrapper.bounds,o,this.diagramActions&ryi.Interactions)}e.wrapper.measure(new Omi(e.wrapper.width,e.wrapper.height)),e.wrapper.arrange(e.wrapper.desiredSize)},X.prototype.removeChildrenFromLayout=function(e){for(var t,i=[],n=0;n<e.length;n++)(t=e[parseInt(n.toString(),10)]).parentId||t.processId||i.push(t);return i},X.prototype.doLayout=function(){var e,t,i,n=!1,o="ComplexHierarchicalTree"===this.layout.type||"HierarchicalTree"===this.layout.type,r=this.isProtectedOnChange,s=(this.protectPropertyChange(!0),this.removeChildrenFromLayout(this.nodes)),a=this.layout.enableRouting&&"ComplexHierarchicalTree"===this.layout.type,l={x:this.scroller.viewPortWidth,y:this.scroller.viewPortHeight};if("None"!==this.layout.type){if((this.organizationalChartModule||this.mindMapChartModule||this.radialTreeModule||this.symmetricalLayoutModule||this.complexHierarchicalTreeModule||this.flowchartLayoutModule)&&(i={state:"Started",type:this.layout.type},this.triggerEvent(dyi.layoutUpdated,i)),this.organizationalChartModule?(e=this.organizationalChartModule.updateLayout(s,this.nameTable,this.layout,l,this.dataSourceSettings.id,this.diagramActions),n=!0,this.canDistribute(a,o)&&this.lineDistributionModule.initLineDistribution(this.layout,this),(this.layoutAnimateModule&&e.rootNode&&!this.diagramActions||!this.layoutAnimateModule&&e.rootNode&&!e.rootNode.isExpanded&&!this.canExpand)&&this.updateNodeExpand(e.rootNode,e.rootNode.isExpanded)):this.mindMapChartModule?(s&&0<s.length&&this.mindMapChartModule.updateLayout(s,this.nameTable,this.layout,l,this.dataSourceSettings.id,this.dataSourceSettings.root),n=!0):this.radialTreeModule?(this.radialTreeModule.updateLayout(s,this.nameTable,this.layout,l),n=!0):this.symmetricalLayoutModule?(this.symmetricalLayoutModule.maxIteration=this.layout.maxIteration,this.symmetricalLayoutModule.springLength=this.layout.springLength,this.symmetricalLayoutModule.springFactor=this.layout.springFactor,this.symmetricalLayoutModule.updateLayout(s,this.connectors,this.symmetricalLayoutModule,this.nameTable,this.layout,l),n=!0):this.complexHierarchicalTreeModule?(this.canDistribute(a,o)&&(this.lineDistributionModule.diagram=this,this.connectors.forEach(function(e){e.obstaclePointCollection=[]})),0<(t=this.complexHierarchicalTreeModule.getLayoutNodesCollection(this.nodes)).length&&this.complexHierarchicalTreeModule.doLayout(t,this.nameTable,this.layout,l,this),n=!0,this.canDistribute(a,o)&&this.lineDistributionModule.initLineDistribution(this.layout,this)):this.flowchartLayoutModule?(this.flowchartLayoutModule.updateLayout(this.nodes,this),n=!0):(t="OrganizationalChart"===this.layout.type?"HierarchicalTree":this.layout.type,console.warn("[WARNING] :: Module "+t+" is not available in Diagram component! You either misspelled the module name or forgot to load it.")),n){this.preventDiagramUpdate=!0;for(var h={},d=0,p=s;d<p.length;d++){var c=p[d];if(this.preventNodesUpdate||this.diagramActions&&this.diagramActions&ryi.PreventIconsUpdate||(this.updateIcon(c),this.updateDefaultLayoutIcons(c)),this.preventNodesUpdate=!0,this.nodePropertyChange(c,{},{offsetX:c.offsetX,offsetY:c.offsetY},!0),this.preventNodesUpdate=!1,c.wrapper.measure(new Omi(c.wrapper.width,c.wrapper.height)),c.wrapper.arrange(c.wrapper.desiredSize),this.updateDiagramObject(c,!0),0<c.inEdges.length)for(var u=0;u<c.inEdges.length;u++)h[(b=this.nameTable[c.inEdges[parseInt(u.toString(),10)]]).id]=b;if(0<c.outEdges.length)for(var g=0;g<c.outEdges.length;g++){var m=this.nameTable[c.outEdges[parseInt(g.toString(),10)]];h[m.id]=m}}for(var f=0,y=Object.keys(h);f<y.length;f++){var v=y[f],b=(a&&this.lineDistributionModule.resetConnectorSegments(this.nameTable[""+v]),h[""+v]),v=this.getPoints(b);a&&this.lineDistributionModule.resetRoutingSegments(b,this,v),t1i(b,v),"Bpmn"===b.shape.type&&"Default"===b.shape.sequence&&"Sequence"===b.shape.flow&&this.commandHandler.updatePathElementOffset(b),b.wrapper.measure(new Omi(void 0,void 0)),b.wrapper.arrange(b.wrapper.desiredSize),this.updateConnectorAnnotation(b),this.updateConnectorfixedUserHandles(b),this.updateQuad(b),this.updateDiagramObject(b,!0)}(a||"DifferentPoint"===this.layout.connectionPointOrigin&&this.lineDistributionModule&&o)&&this.lineDistributionModule.distributeLines(this.layout,this),this.refreshFlowChartConnectors(),this.preventDiagramUpdate=!1,this.updatePage(),this.diagramActions&ryi.Render&&"Canvas"!==this.mode||(this.refreshDiagramLayer(),this.isRefreshed=!0)}r||this.protectPropertyChange(r)}return n&&this.updateDiagramElementQuad(),this.diagramActions&ryi.Render&&this.layout.enableRouting&&this.refreshRoutingConnectors(),n&&(i={state:"Completed",type:this.layout.type},this.triggerEvent(dyi.layoutUpdated,i)),!(this.blazorActions&zfi.expandNode)||e},X.prototype.refreshRoutingConnectors=function(){if(this.isProtectedOnChange=!0,this.routingConnectors)for(var e=0;e<this.routingConnectors.length;e++){var t=this.routingConnectors[parseInt(e.toString(),10)],i=this.nameTable[t.sourceID],n=this.nameTable[t.targetID],o=new tDi;i.visible&&n.visible&&(o.renderVirtualRegion(this,!0),o.refreshConnectorSegments(this,t,!1,!0),t1i(t,this.getPoints(t)),t.wrapper.measure(new Omi(void 0,void 0)),t.wrapper.arrange(t.wrapper.desiredSize),this.updateDiagramObject(t,!0),this.routingConnectors.splice(e,1),e--)}this.isProtectedOnChange=!1},X.prototype.refreshFlowChartConnectors=function(){if(this.flowchartLayoutModule){this.flowchartLayoutModule.reRouteFlowChartConnectors(this.layout.flowChartData,this);for(var e=0;e<this.connectors.length;e++){var t=this.connectors[parseInt(e.toString(),10)];t1i(t,this.getPoints(t)),t.wrapper.measure(new Omi(void 0,void 0)),t.wrapper.arrange(t.wrapper.desiredSize),this.updateConnectorAnnotation(t),this.updateConnectorfixedUserHandles(t),this.updateQuad(t),this.updateDiagramObject(t,!0)}}},X.prototype.canDistribute=function(e,t){return!!(e&&this.lineDistributionModule||"DifferentPoint"===this.layout.connectionPointOrigin&&this.lineDistributionModule&&t||"Linear"===this.layout.arrangement&&this.lineDistributionModule)||((e||"DifferentPoint"===this.layout.connectionPointOrigin&&t||"Linear"===this.layout.arrangement)&&console.warn('[WARNING] :: Module "LineDistribution" is not available in Diagram component! You either misspelled the module name or forgot to load it.'),!1)},X.prototype.saveDiagram=function(){for(var e,t=[],i=0;i<this.nodes.length;i++)if("SwimLane"===(e=this.nodes[parseInt(i.toString(),10)]).shape.type){for(var n=e.wrapper.children[0].childTable,o=0,r=Object.keys(n);o<r.length;o++)t=_Ai(n[""+r[o]],t);for(var s=0;s<t.length;s++)this.nameTable[t[parseInt(s.toString(),10)]]&&(this.swimlaneChildTable[t[parseInt(s.toString(),10)]]=this.nameTable[t[parseInt(s.toString(),10)]].zIndex);this.swimlaneZIndexTable[e.id]=e.zIndex}return HAi(this)},X.prototype.loadDiagram=function(e,t){var i;return t&&this.ej1SerializationModule?(i=JSON.parse(e),e=this.ej1SerializationModule.getSerializedData(i)):t&&console.warn('[WARNING] :: Module "Ej1Serialization" is not available in Diagram component! You either misspelled the module name or forgot to load it.'),jAi(e,this)},X.prototype.saveDiagramAsMermaid=function(){return this.layout&&"Flowchart"===this.layout.type?this.saveFlowDiagramInMermaidFormat():this.saveMindmapDiagramInMermaidFormat()},X.prototype.saveMindmapDiagramInMermaidFormat=function(){var e,t,i="",n=[];return this.layout&&"MindMap"===this.layout.type&&(n.push("mindmap"),0<this.nodes.length)&&(e=this.nodes.filter(function(e){return 0===e.inEdges.length})[0],t=this.convertMindmapToMermaid(e,0),n.push(t),t=e.outEdges,this.updateTextDataSource(n,t,1),i=(n=n.filter(function(e){return""!==e.trim()})).join("\n")),i},X.prototype.updateTextDataSource=function(e,t,i){for(var n=0;n<t.length;){var o=this.getObject(t[parseInt(n.toString(),10)]),o=this.getObject(o.targetID),r=this.convertMindmapToMermaid(o,i),r=(e.push(r),o.outEdges);0<r.length&&this.updateTextDataSource(e,r,i+1),n++}},X.prototype.convertMindmapToMermaid=function(e,t){var i=e.id,t=" ".repeat(2*(t+1)),n=0<e.annotations.length?e.annotations[0].content.replace(/\n/g," "):"",o=t+n,t=t+i;return e.shape&&"Basic"===e.shape.type?"Rectangle"===(i=e.shape).shape?o=t+"["+n+"]":"Ellipse"===i.shape?o=t+"(("+n+"))":"Hexagon"===i.shape&&(o=t+"{{"+n+"}}"):e.shape&&"Flow"===e.shape.type?"Terminator"===e.shape.shape&&(o=t+"("+n+")"):e.shape&&"Path"===e.shape.type&&((i=e.shape).data===this.bangShape?o=t+"))"+n+"((":i.data===this.cloudShape&&(o=t+")"+n+"(")),o},X.prototype.saveFlowDiagramInMermaidFormat=function(){var s=this,a=[],l="graph TD\n",e={nodes:this.nodes,edges:this.connectors},h=e.nodes.reduce(function(e,t){return e[t.id]=t.annotations.length?t.annotations[0].content:"",e},{});return e.edges.forEach(function(e){var t=e.sourceID,i=e.targetID,n=(h[""+t],h[""+i],s.nameTable[""+t]),o=s.nameTable[""+i],n=s.getNodeShape(n),o=s.getNodeShape(o),r=e.annotations[0]&&""!==e.annotations[0].content?"|"+e.annotations[0].content+"|":"",e=(-1===a.indexOf(t)?a.push(t):n="",-1===a.indexOf(i)?a.push(i):o="",s.arrowType(e));l+="    "+t+n+" "+e+r+" "+i+o+"\n"}),e.nodes.forEach(function(e){var t=e.id,i=e.style.fill,n=e.style.strokeColor,e=e.style.strokeWidth+"px";l+="    style "+t+" fill:"+i+",stroke:"+n+",stroke-width:"+e+";\n"}),l},X.prototype.arrowType=function(e){var t=e.targetDecorator.shape,i=e.style.strokeDashArray,n=e.style.strokeWidth;return e.style.opacity<1?"~~~":""!==i?"-.->":"Arrow"===t?1<n?"==>":"--\x3e":"None"===t?"---":"--\x3e"},X.prototype.getNodeShape=function(e){var t=0<e.annotations.length?e.annotations[0].content:"",i=e.shape.shape;if(!i)return"M 0 0 A 1 1 0 0 0 7 0 A 1 1 0 0 0 0 0 M -1 0 A 1 1 0 0 0 8 0 A 1 1 0 0 0 -1 0"===(e=e.shape.data)?"((("+t+")))":"M 0 0 L 1 -1 L 5 -1 L 6 0 L 0 0"===e?"[/"+t+"\\]":"M 0 1 L 0 6 C 2 7 4 7 6 6 L 6 1 C 5 0 1 0 0 1 C 1 2 5 2 6 1"===e?"[("+t+")]":"M 0 0 L 12 0 L 14 2 L 2 2 L 0 0"===e?"[\\"+t+"\\]":"M 0 0 L 5 0 L 4 1 L 1 1 L 0 0"===e?"[\\"+t+"/]":"M 0 0 L 2 -2 L 11 -2 L 13 0 L 11 2 L 2 2 L 0 0"===e?"{{"+t+"}}":">"+t+"]";switch(i){case"Terminator":return"(["+t+"])";case"Process":return"["+t+"]";case"Decision":return"{"+t+"}";case"Parallelogram":return"[/"+t+"/]";case"Ellipse":return"(("+t+"))";case"PreDefinedProcess":return"[["+t+"]]";default:return"["+t+"]"}},X.prototype.loadDiagramFromMermaid=function(e){this.layout&&"Flowchart"===this.layout.type&&this.flowchartLayoutModule?this.convertMermaidToFlowChart(e):this.layout&&"MindMap"===this.layout.type&&this.mindMapChartModule?this.convertMermaidToMindmap(e):console.warn('[WARNING] :: Module "FlowchartLayout" or "MindMap" is not available in Diagram component! You either misspelled the module name or forgot to load it.')},X.prototype.countLeadingSpaces=function(e){for(var t=0,i=e.length;t<i&&" "===e.charAt(t);)t++;return t},X.prototype.convertMermaidToMindmap=function(e){if(e&&this.layout&&"MindMap"===this.layout.type&&this.mindMapChartModule){var d=e.split(/\r?\n/).filter(function(e){return 0<e.trim().length}),p=(this.clear(),this.mermaidNodeBaseCollection=[],[]),c={text:"",children:[],currentLevel:0,branch:"Left"},u=[],g=1,m=!1,f=!1,y=!1;if(0<d.length){for(var v=this,t=0;t<d.length;t++)!function(e){var t=d[parseInt(e.toString(),10)],i=0,n="",o=v.countLeadingSpaces(t),r=t.includes('"`');if(f=t.includes('`"'),y=(m=!!r||m)||y?y:0===o&&0<e,m&&f&&!r)return c.text+="\n"+t,m=!1;if(!r&&m)return c.text+="\n"+t;if(m=!f&&m,0<t.length&&(/\s/.test(t[0])&&0<e||0===o)){if(-1!==u.findIndex(function(e){return e.space===o.toString()}))for(var s=u.length-1;0<=s;s--){var a=u[parseInt(s.toString(),10)],l=parseFloat(a.space);if(o<l)u.splice(s,1);else{if(l<o){u.push({space:o.toString(),level:a.level+1}),i=a.level+1;break}if(l===o){i=a.level;break}}}else if(0===u.length)u.push({space:o.toString(),level:g}),i=g;else{for(s=u.length-1;0<=s;s--){var h=u[parseInt(s.toString(),10)],l=parseFloat(h.space);if(!(o<l)){h=u[u.length-1];u.push({space:o.toString(),level:h.level+1});break}u.splice(s,1)}i=u[u.length-1].level}n=t.trim().replace(/^[+-]/,"")}r={text:n,branch:void 0,children:[],currentLevel:0===e?0:i-1};if(0<p.length){for(;p.length>=i&&0!==p.length;)p.pop();0<p.length&&p[p.length-1].children.push(r)}p.push(r),c=r}(t);var i,e=p[0];"mindmap"!==e.text&&!y||(y?(i={id:(i=this.getNodeDetails(e)).nodeId,shape:i.nodeShapeData,annotations:[{content:i.annotationContent}]},this.mermaidNodeBaseCollection.push(i),this.createDataSource(e.children,e,i.id)):(i=e.children[0],e={id:(e=this.getNodeDetails(i)).nodeId,shape:e.nodeShapeData,annotations:[{content:e.annotationContent}]},this.mermaidNodeBaseCollection.push(e),this.createDataSource(i.children,i,e.id)),this.addElements(this.mermaidNodeBaseCollection),this.doLayout())}}},X.prototype.createDataSource=function(e,t,i){for(var n=0;n<e.length;){var o=e[parseInt(n.toString(),10)],r=this.getNodeDetails(o),r={id:r.nodeId,shape:r.nodeShapeData,annotations:[{content:r.annotationContent}]},s={sourceID:i,targetID:r.id};this.mermaidNodeBaseCollection.push(r),this.mermaidNodeBaseCollection.push(s),this.createDataSource(o.children,o,r.id),n++}},X.prototype.getNodeDetails=function(e){var t,i=e.text.match(/^(.*?)\s*([\\[\\(\\{][\s\S]*?[\]\\)\\}]|[)\\(][\s\S]*|[)\\{][\s\S]*|[)\\(][^{}()\\[\]]*$)/),n=xTi(),e=e.text,o={type:"Basic",shape:"Rectangle"};return i&&(n=i[1]||n,"["===(t=(i=i[2].trim().replace(/["`]/g,"")).charAt(0))?e=i.slice(1,-1):"("===t?(e=i.startsWith("((")?i.slice(2,-1):i.slice(1,-1),o=i.startsWith("((")?{type:"Basic",shape:"Ellipse"}:{type:"Flow",shape:"Terminator"}):")"===t?(e=i.startsWith("))")?i.slice(2,-2):i.slice(1,-1),o=i.startsWith("))")?{type:"Path",data:this.bangShape}:{type:"Path",data:this.cloudShape}):"{"===t&&(e=i.slice(2,-1),o={type:"Basic",shape:"Hexagon"})),{nodeId:n,annotationContent:e,nodeShapeData:o}},X.prototype.convertMermaidToFlowChart=function(e){for(var t=[],i=(this.clear(),e.trim().split("\n")),n=1;n<i.length;n++){var o,r,s=i[parseInt(n.toString(),10)];""!==(s=s.trim())&&(s.startsWith("style")?this.parseStyle(s,t):(o=[(s=this.getLineSplitting(s))[0],s[1]],0<(o=this.getNodeData(o,t,s[2])).length&&((r=o[o.length-1]).arrowType=s[2],""!==s[3])&&(r.label&&r.label.some(function(e){return 0<e.trim().length})?r.label.push(s[3]):(r.label=[],r.label[r.parentId.length-1]=s[3])),o.filter(function(e){return e.parentId&&0===e.parentId.length}).forEach(function(e){e.parentId=null}),t=t.concat(o)))}this.createFlowChart(t),this.doLayout(),this.clearHistory()},X.prototype.createFlowChart=function(e){for(var t=[],i=0;i<e.length;i++){var n={id:(r=e[parseInt(i.toString(),10)]).id,shape:r.shape,annotations:[{content:r.name}],style:{fill:r.color,strokeColor:r.stroke,strokeWidth:r.strokeWidth}};t.push(n)}for(var o=0;o<e.length;o++){var r,s=N1i(r=e[parseInt(o.toString(),10)]);if(r.parentId&&1<r.parentId.length)for(var a=0;a<r.parentId.length;a++){var l={id:xTi(),sourceID:r.parentId[parseInt(a.toString(),10)],targetID:r.id,annotations:[{content:r.label?r.label[parseInt(a.toString(),10)]:""}],style:{strokeWidth:s.strokeWidth||1,strokeDashArray:s.strokeDashArray||"",opacity:void 0!==s.opacity?s.opacity:1},targetDecorator:{shape:s.targetDecorator}};t.push(l)}else r.parentId&&1===r.parentId.length&&(l={id:xTi(),sourceID:r.parentId[0],targetID:r.id,annotations:[{content:r.label?r.label[0]:""}],style:{strokeWidth:s.strokeWidth||1,strokeDashArray:s.strokeDashArray||"",opacity:void 0!==s.opacity?s.opacity:1},targetDecorator:{shape:s.targetDecorator}},t.push(l))}this.addElements(t)},X.prototype.getLineSplitting=function(e){var t,i,n,o,r,s="",e=e.match(/^(.*?)\s*(-->|---|--\s*.*?\s*-->|~~~|==>|===|==\s*.*?\s*==>|\s*-\.\s*->|\s*-\.\s*-|\s*-\.\s*.*?\s*\.\s*->|\s*-\..*?\.\s*->)(.*)$/);return e&&(t=e[1].trim(),i=e[2].trim(),n=e[3].trim(),e=void 0,o="",s=null!==(e=(r=i.match(/(-\.|\\-\\-|==|--|~~)(.*?)(\1>|\.->|==>|\\->|~~>)/))?{text:r[2].trim()||null,arrowType:r[1]+r[3]}:{text:null,arrowType:i}).text?e.text:"",r=(o=e.arrowType).includes("--\x3e")?"single-line-arrow":o.includes("---")?"single-line":o.includes("==>")?"double-line-arrow":o.includes("==")?"double-line":o.includes("~~~")?"wiggly-arrow":o.includes("-.->")||o.includes(".->")?"dotted-arrow":o.includes("-.-")||o.includes(".-")?"dotted":"single-line-arrow"),[t,n,r,s]},X.prototype.parseStyle=function(e,t){var i;e.startsWith("style")&&(e=e.match(/^style\s+(\w+)\s+fill:([^,]+),stroke:([^,]+),stroke-width:(\d+)px;/))&&(i={id:e[1],fill:e[2],stroke:e[3],strokeWidth:parseInt(e[4],10)},(e=t.filter(function(e){return e.id===i.id}))[0].color=i.fill,e[0].stroke=i.stroke,e[0].strokeWidth=i.strokeWidth)},X.prototype.getNodeData=function(o,r,e){for(var t,i,s=[],a=null,l=null,h=0,d="",p=this,n=0;n<o.length;n++)!function(e){var t,i=o[parseInt(e.toString(),10)],i=p.splitNested(i),n=(i[0].includes("|")&&((t=i[0].match(/\|([^|]*)\|/))&&(d=t[1]),3<=(t=i[0].split("|")).length)&&(i[0]=t[2].trim()),i[0].trim());0===e?a=n:l=n,r.find(function(e){return e.id===n})?h++:(t=1<i.length?i[1]:i[0],e=p.getShape(t),i=t.replace(/[\\[\]\\(\\)\\{\\}\\{\\}\\/>]/g,""),s.push({id:n,name:i,shape:e,color:"white",parentId:[]}))}(n);return s.length?(t=s[s.length-1]).id!==a?(t.parentId.push(a),t.label?t.label.push(d):t.label=[d]):((t=r.find(function(e){return e.id===l})).parentId?t.parentId.push(a):t.parentId=[a],t.label?t.label.push(d):t.label=[d]):2===h&&((i=r.filter(function(e){return e.id===l})[0]).parentId=i.parentId||[],i.parentId.push(a),i.label=i.label||[],i.label[i.parentId.length-1]=d),e&&(i=r.filter(function(e){return e.id===l})[0])&&(i.arrowType=e),s},X.prototype.splitNested=function(e){for(var t=[],i="",n=0,o="",r=0,s=e;r<s.length;r++){var a=s[r];"["===a||"{"===a||"("===a||">"===a?(0===n?(0<i.trim().length&&t.push(i.trim()),o=i=a):i+=a,n++):"]"===a||"}"===a||")"===a?1===n&&a===o?(t.push((i+=a).trim()),i="",n--):1<n?(i+=a,n--):i+=a:i+=a}return 0<i.trim().length&&t.push(i.trim()),t},X.prototype.getShape=function(e){var t={};return e.startsWith("(((")?t={type:"Path",data:"M 0 0 A 1 1 0 0 0 7 0 A 1 1 0 0 0 0 0 M -1 0 A 1 1 0 0 0 8 0 A 1 1 0 0 0 -1 0"}:e.startsWith("((")?t={shape:"Ellipse",type:"Basic"}:e.startsWith("([")?t={type:"Flow",shape:"Terminator"}:e.startsWith("(")?t={type:"Flow",shape:"Process"}:e.startsWith("[[")?t={type:"Flow",shape:"PreDefinedProcess"}:e.startsWith("[/")?t=e.endsWith("/]")?{type:"Basic",shape:"Parallelogram"}:{type:"Path",data:"M 0 0 L 1 -1 L 5 -1 L 6 0 L 0 0"}:e.startsWith("[(")?t={type:"Path",data:"M 0 1 L 0 6 C 2 7 4 7 6 6 L 6 1 C 5 0 1 0 0 1 C 1 2 5 2 6 1"}:e.startsWith("[\\")?t=e.endsWith("\\]")?{type:"Path",data:"M 0 0 L 12 0 L 14 2 L 2 2 L 0 0"}:{type:"Path",data:"M 0 0 L 5 0 L 4 1 L 1 1 L 0 0"}:e.startsWith("[")?t={type:"Basic",shape:"Rectangle"}:e.startsWith("{{")?t={type:"Path",data:"M 0 0 L 2 -2 L 11 -2 L 13 0 L 11 2 L 2 2 L 0 0"}:e.startsWith("{")?t={type:"Flow",shape:"Decision"}:e.startsWith(">")&&(t={type:"Path",data:"M 0 0 L 8 0 L 8 2 L 0 2 L 2 1 L 0 0"}),t},X.prototype.getDiagramContent=function(e){return this.printandExportModule?this.printandExportModule.getDiagramContent(e):(console.warn('[WARNING] :: Module "PrintAndExport" is not available in Diagram component! You either misspelled the module name or forgot to load it.'),"")},X.prototype.exportImage=function(e,t){this.printandExportModule?this.printandExportModule.exportImages(e,t):console.warn('[WARNING] :: Module "PrintAndExport" is not available in Diagram component! You either misspelled the module name or forgot to load it.')},X.prototype.printImage=function(e,t){this.printandExportModule?(t.printOptions=!0,this.printandExportModule.exportImages(e,t)):console.warn('[WARNING] :: Module "PrintAndExport" is not available in Diagram component! You either misspelled the module name or forgot to load it.')},X.prototype.setStackLimit=function(e){this.undoRedoModule&&e&&(this.historyManager.stackLimit=e,this.undoRedoModule.applyLimit(this.historyManager.currentEntry,e,this,!0))},X.prototype.clearHistory=function(){this.undoRedoModule&&this.undoRedoModule.clearHistory(this)},X.prototype.getDiagramBounds=function(){var e;return this.printandExportModule?((e=this.printandExportModule.getDiagramBounds("",{})).width=e.width>this.scrollSettings.viewPortWidth?e.width+(0<e.x?e.x:0):this.scrollSettings.viewPortWidth,e.height=e.height>this.scrollSettings.viewPortHeight?e.height+(0<e.y?e.y:0):this.scrollSettings.viewPortHeight,e.x=0<e.x?0:e.x,e.y=0<e.y?0:e.y,e):(console.warn('[WARNING] :: Module "PrintAndExport" is not available in Diagram component! You either misspelled the module name or forgot to load it.'),new tfi)},X.prototype.exportDiagram=function(e){return this.printandExportModule?this.printandExportModule.exportDiagram(e):(console.warn('[WARNING] :: Module "PrintAndExport" is not available in Diagram component! You either misspelled the module name or forgot to load it.'),"")},X.prototype.print=function(e){this.printandExportModule?this.printandExportModule.print(e):console.warn('[WARNING] :: Module "PrintAndExport" is not available in Diagram component! You either misspelled the module name or forgot to load it.')},X.prototype.addPorts=function(a,l){this.protectPropertyChange(!0);a=this.nameTable[a.id]||a,1<l.length&&this.startGroupAction();for(var h,d=this,e=0;e<l.length;e++)!function(t){if(a.ports.some(function(e){return e.id===l[parseInt(t.toString(),10)].id}))return;if(a instanceof MIi?(h=new r0i(a,"ports",l[parseInt(t.toString(),10)],!0),a.ports.push(h)):a instanceof ISi&&(h=new l0i(a,"ports",l[parseInt(t.toString(),10)],!0),a.ports.push(h)),a.children)for(var e=a.wrapper,i=0;i<e.children.length;i++){var n=e.children[parseInt(i.toString(),10)];if(n.id.match(e.id)){a.initPort(d.getDescription,n,h);break}}else{var o,r,s=a.wrapper;a instanceof MIi?s.children.push(a.initPortWrapper(a.ports[a.ports.length-1])):a instanceof ISi&&(o="Bezier"===a.type?a.intermediatePoints:a.getConnectorPoints(a.type),o=a.clipDecorators(a,o),r=tfi.toBounds(o),s.children.push(a.initPort(a.ports[a.ports.length-1],o,r,void 0)))}d.diagramActions&ryi.UndoRedo||d.diagramActions&ryi.Group||(s={type:"PortCollectionChanged",changeType:"Insert",undoObject:DTi(h),redoObject:DTi(a),category:"Internal"},d.addHistoryEntry(s))}(e);1<l.length&&this.endGroupAction(),a.wrapper.measure(new Omi(a.width,a.height)),a.wrapper.arrange(a.wrapper.desiredSize),this.updateDiagramObject(a),this.protectPropertyChange(!1)},X.prototype.addConstraints=function(e,t){return e|t},X.prototype.removeConstraints=function(e,t){return e&~t},X.prototype.addNodeLabels=function(e,t){this.addLabels(e,t)},X.prototype.addConnectorLabels=function(e,t){this.addLabels(e,t)},X.prototype.addLabels=function(e,t){this.protectPropertyChange(!0);var i,n=(e=this.nameTable[e.id]||e).wrapper;1<t.length&&this.startGroupAction();for(var o,r=0;r<t.length;r++){if(e instanceof MIi)if(i=new f0i(e,"annotations",t[parseInt(r.toString(),10)],!0),e.annotations.push(i),e.children)for(var s=e,a=0;a<s.wrapper.children.length;a++)s.wrapper.children[parseInt(a.toString(),10)].id===s.id+"group_container"&&s.wrapper.children[parseInt(a.toString(),10)].children.push(e.initAnnotationWrapper(e.annotations[e.annotations.length-1],this.element.id));else n.children.push(e.initAnnotationWrapper(e.annotations[e.annotations.length-1],this.element.id));else e instanceof ISi&&(i=new b0i(e,"annotations",t[parseInt(r.toString(),10)],!0),e.annotations.push(i),o=n.children[0],o=new tfi(o.offsetX-o.width/2,o.offsetY-o.height/2,o.width,o.height),n.children.push(e.getAnnotationElement(e.annotations[e.annotations.length-1],e.intermediatePoints,o,this.getDescription,this.element.id)));this.diagramActions&ryi.UndoRedo||this.diagramActions&ryi.Group||(o={type:"LabelCollectionChanged",changeType:"Insert",undoObject:DTi(i),redoObject:DTi(e),category:"Internal"},this.addHistoryEntry(o))}1<t.length&&this.endGroupAction(),e.wrapper.measure(new Omi(n.width,n.height)),e.wrapper.arrange(n.desiredSize),this.updateDiagramObject(e),this.protectPropertyChange(!1),this.refreshCanvasLayers()},X.prototype.addChildToUmlNode=function(e,t,i){var n="NoWrap";if("Class"===e.shape.classifier||"Interface"===e.shape.classifier){if("Method"===i){d=new hIi(e,"",t),"Class"===e.shape.classifier?(e.shape.classShape.methods.push(d),E=e.shape.classShape):"Interface"===e.shape.classifier&&(e.shape.interfaceShape.methods.push(d),E=e.shape.interfaceShape);var o=e,r=this,O=n;if((d=E).methods&&d.methods.length){var s=d.methods,a="",l="",h=void 0,d=1,p=void 0,c=0,u=o.shape,g="Class"===u.classifier,g=(u.classifier,g?u.classShape:u.interfaceShape);1===s.length?0<g.attributes.length?(c=g.attributes.filter(function(e){return e.isSeparator}).length,p=(d=2+g.attributes.length+c)+1,G1i(o,r,d)):p=d+1:(c=g.attributes.filter(function(e){return e.isSeparator}).length,u=g.methods.filter(function(e){return e.isSeparator}).length,p=(d=2+g.attributes.length+c+g.methods.length+u)+1);for(var m=0;m<s.length;m++){var f,y=s[s.length-1],h=y.scope&&"Public"===y.scope?" +":y.scope&&"Private"===y.scope?"-":y.scope&&"Protected"===y.scope?"#":"~";if(y.parameters)for(var v=0;v<y.parameters.length;v++)y.parameters[parseInt(v.toString(),10)].type?a+=y.parameters[parseInt(v.toString(),10)].name+":"+y.parameters[parseInt(v.toString(),10)].type:a+=y.parameters[parseInt(v.toString(),10)].name,v!==y.parameters.length-1&&(a+=",");""!==y.name&&h&&(l+=h+" "+y.name+"("+a+") : "+y.type),m!==s.length&&(f=Y1i(o,y),(f=new MIi(r,"nodes",{id:xTi()+"_umlMethods",verticalAlignment:"Stretch",horizontalAlignment:"Stretch",annotations:[{id:"name",content:l,offset:{x:0,y:.5},style:{bold:!0,fontSize:f.fontSize,color:f.color,fill:f.fill,textWrapping:O,italic:f.italic,fontFamily:f.fontFamily,whiteSpace:f.whiteSpace,textAlign:f.textAlign,textDecoration:f.textDecoration,textOverflow:f.textOverflow},margin:{left:14,right:5},horizontalAlignment:"Left"}],style:{fill:o.style.fill,strokeColor:"black"===o.style.strokeColor?"#ffffff00":o.style.strokeColor},minHeight:25,constraints:(Kfi.Default|Kfi.HideThumbs)&~(Kfi.Rotate|Kfi.Drag|Kfi.Resize)},!0)).parentId=o.id,f.umlIndex=p,r.add(f),l="");break}}}else if("Attribute"===i){c=new sIi(e,"",t),"Class"===e.shape.classifier?(e.shape.classShape.attributes.push(c),E=e.shape.classShape):"Interface"===e.shape.classifier&&(e.shape.interfaceShape.attributes.push(c),E=e.shape.interfaceShape);var b=e,w=this,g=E,N=n;if(g.attributes&&g.attributes.length){for(var C=g.attributes,S="",A=void 0,x=(1===C.length&&G1i(b,w,C.length),0),I=0;I<C.length-1;I++)!0===C[parseInt(I.toString(),10)].isSeparator&&x++;for(var V=C.length+x+1,I=0;I<C.length;I++){var T=C[C.length-1],A=T.scope&&"Public"===T.scope?" +":T.scope&&"Private"===T.scope?"-":T.scope&&"Protected"===T.scope?"#":"~";""!==T.name&&A&&(S+=A+" "+T.name+" : "+T.type),I!==C.length&&(T=Y1i(b,T),(T=new MIi(w,"nodes",{id:xTi()+"_umlProperty",style:{fill:b.style.fill,strokeColor:"black"===b.style.strokeColor?"#ffffff00":b.style.strokeColor},annotations:[{id:"name",content:S,offset:{x:0,y:.5},style:{bold:!0,fontSize:T.fontSize,color:T.color,fill:T.fill,textWrapping:N,italic:T.italic,fontFamily:T.fontFamily,whiteSpace:T.whiteSpace,textAlign:T.textAlign,textDecoration:T.textDecoration,textOverflow:T.textOverflow},margin:{left:14,right:5},horizontalAlignment:"Left"}],verticalAlignment:"Stretch",horizontalAlignment:"Stretch",constraints:(Kfi.Default|Kfi.HideThumbs)&~(Kfi.Rotate|Kfi.Drag|Kfi.Resize),minHeight:25},!0)).parentId=b.id,T.umlIndex=V,w.add(T),S="");break}}}}else if("Enumeration"===e.shape.classifier&&"Member"===i){u=new vIi(e,"",t),e.shape.enumerationShape.members.push(u);var E=e.shape.enumerationShape,D=e,M=this,d=E,k=n;if("Enumeration"===D.shape.classifier){for(var P=d.members,B="",F=(1===P.length&&G1i(D,M,P.length),0),L=0;L<P.length-1;L++)!0===P[parseInt(L.toString(),10)].isSeparator&&F++;for(var _=P.length+F+1,L=0;L<P.length;L++){var R=P[P.length-1];""!==R.name&&(B+=R.name),L!==P.length&&(R=Y1i(D,R),(R=new MIi(M,"nodes",{id:xTi()+"_umlMember",annotations:[{id:"name",content:B,offset:{x:0,y:.5},style:{bold:!0,fontSize:R.fontSize,color:R.color,fill:R.fill,textWrapping:k,italic:R.italic,fontFamily:R.fontFamily,whiteSpace:R.whiteSpace,textAlign:R.textAlign,textDecoration:R.textDecoration,textOverflow:R.textOverflow},margin:{left:14,right:5},horizontalAlignment:"Left"}],verticalAlignment:"Stretch",horizontalAlignment:"Stretch",style:{fill:D.style.fill,strokeColor:"black"===D.style.strokeColor?"#ffffff00":D.style.strokeColor,textWrapping:k},constraints:(Kfi.Default|Kfi.HideThumbs)&~(Kfi.Rotate|Kfi.Drag|Kfi.Resize),minHeight:25},!0)).parentId=D.id,R.umlIndex=_,M.add(R),B="");break}}}this.clearSelection(),this.updateSelector()},X.prototype.addLanes=function(e,t,i){e=this.nameTable[e.id]||e;for(var n=0;n<t.length;n++){I=x=w=b=v=y=A=S=f=m=g=l=u=c=p=d=h=C=a=s=r=o=void 0;var o=this,r=e,s=t[parseInt(n.toString(),10)],a=i;if("SwimLane"===(r=o.nameTable[r.id]).shape.type){o.protectPropertyChange(!0);var l,h=r.wrapper.children[0],d=h.bounds,p=r.shape,c=!1,u=void 0,g=void 0,m=void 0,f=void 0,y=new RIi(p,"lanes",s,!0),v=(s.height=s.height||y.height,s.width=s.width||y.width,u="Vertical"===p.orientation||p.header&&p.hasHeader?1:0,"Horizontal"===p.orientation&&(c=!0,u=0<p.phases.length?u+1:u),kbi(o,h)),b=void 0!==a?a:p.lanes.length;if(u+=b,C={element:y,cause:o.diagramActions,diagramAction:o.getDiagramAction(o.diagramActions),state:"Changing",type:"Addition",cancel:!1,laneIndex:b},o.triggerEvent(dyi.collectionChange,C),!C.cancel){c?((w=new fbi).height=s.height,h.addRow(u,w,!1),r.height=void 0!==r.height?r.height+s.height:r.height,r.wrapper.height=h.height=r.height):((w=new ybi).width=s.width,h.addColumn(b+1,w,!1),r.width&&(r.width+=s.width,r.wrapper.width=h.width=r.width),p.hasHeader&&(h.rows[0].cells[0].columnSpan+=1)),o.diagramActions&ryi.UndoRedo||(y.id=""===y.id?xTi():y.id),void 0!==a?p.lanes.splice(a,0,y):p.lanes.push(y),C={element:y,cause:o.diagramActions,diagramAction:o.getDiagramAction(o.diagramActions),state:"Changed",type:"Addition",cancel:!1,laneIndex:b},o.triggerEvent(dyi.collectionChange,C),Ebi(h,o,r,u,b,c),w="Horizontal"===p.orientation?o.nameTable[h.rows[parseInt(u.toString(),10)].cells[0].children[0].id]:p.header&&p.hasHeader?o.nameTable[h.rows[1].cells[parseInt(u.toString(),10)].children[0].id]:o.nameTable[h.rows[0].cells[parseInt(u.toString(),10)].children[0].id],o.diagramActions&ryi.UndoRedo||(a={type:"LaneCollectionChanged",changeType:"Insert",undoObject:DTi(y),redoObject:DTi(w),category:"Internal"},o.addHistoryEntry(a));var w,C="Horizontal"===p.orientation?u:p.header&&p.hasHeader?1:0;Bbi(o,r,C),Pbi(r),Qbi(o,r);if((l=s.children)&&0<l.length)for(g=0;g<l.length;g++){var S,A={x:(S=l[parseInt(g.toString(),10)]).wrapper.offsetX,y:S.wrapper.offsetY},x={left:0,right:0,top:0,bottom:0};if("Horizontal"===p.orientation)for(x.bottom=d.y-h.bounds.y,h.rows[parseInt(u.toString(),10)].cells[parseInt(g.toString(),10)],m=0;m<h.rows[parseInt(u.toString(),10)].cells.length;m++)Ubi(o,h.rows[parseInt(u.toString(),10)].cells[parseInt(m.toString(),10)],A,S,x);else e:for(var I=0;I<=h.rows.length;I++)for(f=0;f<h.rows[parseInt(I.toString(),10)].cells.length;f++)if(x.right=d.x-h.bounds.x,Ubi(o,h.rows[parseInt(I.toString(),10)].cells[parseInt(f.toString(),10)],A,S,x))break e}Nbi(v,o),o.drag(r,d.x-h.bounds.x,d.y-h.bounds.y)}o.protectPropertyChange(!1)}void 0!==i&&(i+=1)}this.updateDiagramElementQuad()},X.prototype.addPhases=function(e,t){e=this.nameTable[e.id]||e;for(var i=0;i<t.length;i++)this.protectPropertyChange(!0),qbi(this,e,t[parseInt(i.toString(),10)]),this.protectPropertyChange(!1);this.updateDiagramElementQuad()},X.prototype.removeLane=function(e,t){t&&(t=this.nameTable[t.header.id],this.diagramActions=this.diagramActions|ryi.PublicMethod,$bi(this,t,e,void 0),this.updateDiagramElementQuad())},X.prototype.removePhase=function(e,t){t=t.header.id;iwi(this,this.nameTable[""+t],e),this.updateDiagramElementQuad()},X.prototype.editSegment=function(e){if("Straight"===e.connector.type){for(var t=e.connector,i=e&&e.SegmentEditing?e.SegmentEditing:"Toggle",n=e.point,o=void 0,e=void 0,r=0;r<t.segments.length;r++)if(Awi(n,t.segments[parseInt(r.toString(),10)].point,t.hitPadding)){o=!0;break}(o&&"Remove"===i||!o&&"Add"===i)&&(e=!0),"Straight"!==t.type||!e&&"Toggle"!==i||this.connectorEditingToolModule.addOrRemoveSegment(t,n,this.commandHandler)}},X.prototype.removelabelExtension=function(e,t,i,n){for(var o=0;o<n.children.length;o++){var r=n.children[parseInt(o.toString(),10)];if((r instanceof Tyi||r instanceof Tvi)&&r.id.match("_"+t[parseInt(i.toString(),10)].id+"$")){for(var s,a,l,h=0;h<e.annotations.length;h++)r.id.match("_"+e.annotations[parseInt(h.toString(),10)].id+"$")&&(this.diagramActions&ryi.UndoRedo||(s={type:"LabelCollectionChanged",changeType:"Remove",undoObject:DTi(e.annotations[parseInt(h.toString(),10)]),redoObject:DTi(e),category:"Internal"},this.addHistoryEntry(s)),e.annotations.splice(h,1));n.children.splice(o,1),"SVG"===this.mode?((a=$Ii(r.id,this.element.id))&&(l=$Ii(r.id,this.element.id)).parentNode.removeChild(l),$Ii(r.id+"_text",this.element.id)&&(a=$Ii(r.id+"_text",this.element.id)).parentNode.removeChild(a),(l=$Ii(r.id+"_html_element",this.element.id))&&l.parentNode.removeChild(l)):this.refreshCanvasLayers()}}},X.prototype.removeLabels=function(t,e){t=this.nameTable[t.id]||t,1<e.length&&this.startGroupAction();for(var i,n=e.length-1;0<=n;n--)t.children&&0<t.children.length?(i=t.wrapper.children.filter(function(e){return e.id===t.id+"group_container"}))&&0<i.length&&this.removelabelExtension(t,e,n,i[0]):this.removelabelExtension(t,e,n,t.wrapper);1<e.length&&this.endGroupAction(),this.refreshCanvasLayers()},X.prototype.removePortsExtenion=function(e,t,i,n){for(var o=0;o<n.children.length;o++){var r=n.children[parseInt(o.toString(),10)];if(r instanceof kyi&&r.id.match("_"+t[parseInt(i.toString(),10)].id+"$")){for(var s,a,l=0;l<e.ports.length;l++)r.id.match("_"+e.ports[parseInt(l.toString(),10)].id+"$")&&(this.diagramActions&ryi.UndoRedo||(s={type:"PortCollectionChanged",changeType:"Remove",undoObject:DTi(e.ports[parseInt(l.toString(),10)]),redoObject:DTi(e),category:"Internal"},this.addHistoryEntry(s)),e.ports.splice(l,1));n.children.splice(o,1),"SVG"===this.mode?(a=$Ii(r.id,this.element.id))&&a.parentNode.removeChild(a):this.refreshCanvasLayers()}}},X.prototype.removePorts=function(e,t){e=this.nameTable[e.id]||e;var i=t.length;1<i&&this.startGroupAction();for(var n=t.length-1;0<=n;n--)if(e.children&&0<e.children.length)for(var o=0;o<e.wrapper.children.length;o++)e.wrapper.children[parseInt(o.toString(),10)].id.match(e.wrapper.id)&&this.removePortsExtenion(e,t,n,e.wrapper.children[parseInt(o.toString(),10)]);else this.removePortsExtenion(e,t,n,e.wrapper);1<i&&this.endGroupAction()},X.prototype.getSizeValue=function(e,t){return e=0<e.toString().indexOf("px")?e.toString():0<e.toString().indexOf("%")?void 0!==t?"100%":e.toString():e.toString()+"px",t&&(LSi(this),e="calc("+e+" - "+t+"px)"),e},X.prototype.renderRulers=function(){var e,t;this.rulerSettings.showRulers?(t=LSi(e=this),t=pTi("div",{id:e.element.id+"_overlapRuler",style:"height:"+t.height+"px;width:"+t.width+"px;position:absolute;left:0;top:0",class:"e-ruler-overlap"}),e.element.insertBefore(t,e.element.firstChild),PSi(this,!0),PSi(this,!1)):FSi(this)},X.prototype.intOffPageBackground=function(){new Omi;var e=LSi(this),t=document.getElementById(this.element.id+"content"),i=(this.width||(this.width="100%"),this.height||(this.height="100%"),this.getSizeValue(this.width,e.width)),n=this.getSizeValue(this.height,e.height),e=this.rulerSettings.showRulers?"width:"+i+"; height:"+n+";top:"+e.height+"px;left:"+e.width+"px;overflow: scroll;position:absolute;overflow:auto;":"width:"+i+"; height:"+n+";position:absolute; left:0px;  top:0px;overflow: auto;",i={id:this.element.id+"content",tabindex:"0",style:e};t?(this.diagramCanvas=t,bTi(this.diagramCanvas,e)):(this.diagramCanvas=pTi("div",i),this.element.appendChild(this.diagramCanvas)),this.diagramCanvas.style.background=this.backgroundColor},X.prototype.initDiagram=function(){this.intOffPageBackground(),wTi(this.element,{style:"width:"+this.getSizeValue(this.width)+"; height:"+this.getSizeValue(this.height)+";position:relative;overflow:hidden;"})},X.prototype.renderHiddenUserHandleTemplateLayer=function(e){e=pTi("div",{class:this.element.id+"_hiddenUserHandleTemplate",style:"width:"+e.width+"px; height:"+e.height+"px;visibility:hidden ;  overflow: hidden;"});this.element.appendChild(e)},X.prototype.renderBackgroundLayer=function(e,t){e=this.createSvg(this.element.id+"_backgroundLayer_svg",e.width,e.height),bTi(e,t),t=cTi("g",{id:this.element.id+"_backgroundImageLayer",class:"e-background-image-layer"});e.appendChild(t);t=cTi("g",{id:this.element.id+"_backgroundLayer",class:"e-background-layer"});e.appendChild(t),this.diagramCanvas.appendChild(e)},X.prototype.renderGridLayer=function(e,t){var e=this.createSvg(this.element.id+"_gridline_svg",e.width,e.height),i=(e.setAttribute("class","e-grid-layer"),cTi("g",{id:this.element.id+"_gridline"})),n=cTi("rect",{id:this.element.id+"_grid_rect",x:"0",y:"0",width:"100%",height:"100%"});!P1i()||""!==new URL(window.location.href).search?n.setAttribute("fill","url(#"+this.element.id+"_pattern)"):n.setAttribute("fill","url("+location.protocol+"//"+location.host+location.pathname+"#"+this.element.id+"_pattern)"),i.appendChild(n),e.appendChild(i),this.diagramCanvas.appendChild(e),vTi(e,{style:t})},X.prototype.renderDiagramLayer=function(e,t){var i,n,t={id:this.element.id+"_diagramLayer_div",style:"width:"+e.width+"px; height:"+e.height+"px;"+t};this.diagramLayerDiv=pTi("div",t),"SVG"===this.mode?((t=this.createSvg(this.element.id+"_diagramLayer_svg",e.width,e.height)).style["pointer-events"]="none",t.setAttribute("class","e-diagram-layer"),i=cTi("g",{id:this.element.id+"_diagramLayer"}),n=cTi("g",{}),this.diagramLayer=i,t.style["pointer-events"]="all",n.appendChild(i),t.appendChild(n),this.diagramLayerDiv.appendChild(t)):(this.diagramLayer=WTi.createCanvas(this.element.id+"_diagram",e.width,e.height),bTi(this.diagramLayer,"position:absolute;left:0px;top:0px;"),this.diagramLayerDiv.appendChild(this.diagramLayer)),this.diagramCanvas.appendChild(this.diagramLayerDiv)},X.prototype.initLayers=function(){var e,t="position:absolute;top:0px;left:0px;overflow:hidden;pointer-events:none;",i=document.getElementById(this.element.id),n=i.getBoundingClientRect(),i=(this.setScaleFromElement(n,i),this.modifyBounds(n),i=pTi("div",{style:"visibility:hidden; width: 100px"}),document.body.appendChild(i),o=i.getBoundingClientRect().width,i.style.overflow="scroll",e=pTi("div",{style:"width:100%"}),i.appendChild(e),e=e.getBoundingClientRect().width,i.parentNode.removeChild(i),o-e),o=(this.scroller.scrollerWidth=i,this.scroller.setViewPortSize(n.width,n.height),this.renderRulers(),"measureElement");window[o]&&(window[o]=null,document.getElementById("measureElement").remove()),CTi(),this.renderBackgroundLayer(n,t),this.renderGridLayer(n,t),this.renderDiagramLayer(n,t),this.renderHTMLLayer(n,t),this.renderPortsExpandLayer(n,t),this.renderNativeLayer(n,t),this.renderAdornerLayer(n,t),this.renderHiddenUserHandleTemplateLayer(n)},X.prototype.setScaleFromElement=function(e,t){e=e.width/t.clientWidth;this.scaleValue=e},X.prototype.modifyBounds=function(e){var t=this.scaleValue;e.x=e.x/t,e.y=e.y/t,e.width=e.width/t,e.height=e.height/t},X.prototype.modifyClientOffset=function(e,t){var i=this.scaleValue;return t?e*i:e/i},X.prototype.renderAdornerLayer=function(e,t){var i=pTi("div",{id:this.element.id+"_diagramAdornerLayer",style:"width:"+e.width+"px;height:"+e.height+"px;"+t}),t=pTi("div",{id:this.element.id+"_diagramUserHandleLayer",style:"width:"+e.width+"px;height:"+e.height+"px;"+t}),t=(t.setAttribute("class","e-userHandle-layer"),i.appendChild(t),this.createSvg(this.element.id+"_diagramAdorner_svg",e.width,e.height)),e=(t.setAttribute("class","e-adorner-layer"),t.style["pointer-events"]="none",this.adornerLayer=cTi("g",{id:this.element.id+"_diagramAdorner"}),this.adornerLayer.style[" pointer-events"]="all",t.appendChild(this.adornerLayer),i.appendChild(t),this.diagramCanvas.appendChild(i),cTi("g",{id:this.element.id+"_SelectorElement"}));this.adornerLayer.appendChild(e),vTi(t,{style:"pointer-events:none;"})},X.prototype.renderPortsExpandLayer=function(e,t){var e=this.createSvg(this.element.id+"_diagramPorts_svg",e.width,e.height),i=(e.setAttribute("class","e-ports-expand-layer"),cTi("g",{id:this.element.id+"_diagramPorts",class:"e-ports-layer",style:"pointer-events: all;"})),i=(e.appendChild(i),cTi("g",{id:this.element.id+"_diagramExpander",class:"e-expand-layer",style:"pointer-events: all;"}));e.appendChild(i),this.diagramCanvas.appendChild(e),vTi(e,{style:t})},X.prototype.renderHTMLLayer=function(e,t){this.htmlLayer=pTi("div",{id:this.element.id+"_htmlLayer",style:"width:"+e.width+"px; height:"+e.height+"px;position:absolute;top:0px;left:0px;overflow:hidden;pointer-events:none;",class:"e-html-layer"});e=pTi("div",{id:this.element.id+"_htmlLayer_div",style:"position:absolute;top:0px;left:0px;pointer-events:all;"});this.htmlLayer.appendChild(e),this.diagramCanvas.appendChild(this.htmlLayer)},X.prototype.renderNativeLayer=function(e,t){var e=this.createSvg(this.element.id+"_nativeLayer_svg",e.width,e.height),i=cTi("g",{id:this.element.id+"_nativeLayer",style:"pointer-events:all;"});e.appendChild(i),this.diagramLayerDiv.appendChild(e),vTi(e,{class:"e-native-layer",style:t})},X.prototype.createSvg=function(e,t,i){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return vTi(n,{id:e,width:t,height:i}),n},X.prototype.updateBazorShape=function(){for(var e=0;e<this.nodes.length;e++){var t=this.nodes[parseInt(e.toString(),10)];switch(t.shape.type){case"Bpmn":t.shape.bpmnShape=t.shape.shape;break;case"UmlActivity":t.shape.umlActivityShape=t.shape.shape;break;case"Flow":t.shape.flowShape=t.shape.shape;break;case"Basic":t.shape.basicShape=t.shape.shape;break;case"Text":t.shape.textContent=t.shape.content}}},X.prototype.initObjects=function(e){this.updateBazorShape(),this.isLoading||this.initData(),this.initLayerObjects(),this.updateBridging(e)},X.prototype.initLayerObjects=function(){for(var e=1<this.layers.length,t=[],i={},n={},o=[],r=0,s=this.nodes;r<s.length;r++)(v=s[r]).id=v.id||xTi(),this.addToLayer(v,e),i[v.id]=v;for(var a=0,l=this.connectors;a<l.length;a++)(v=l[a]).id=v.id||xTi(),this.addToLayer(v,e),i[v.id]=v;for(var h=0,d=this.layers;h<d.length;h++){for(var p,c,u,g=0,m=(A=d[h]).objects;g<m.length;g++)i[""+(v=m[g])]&&(i[""+v]instanceof ISi?(T=i[""+v]).sourceID&&T.targetID?(c=i[T.sourceID],u=i[T.targetID],p=!0,this.isLoading&&(c&&c.children&&0<c.children.length||u&&u.children&&0<u.children.length)&&(p=!1),c&&c.wrapper&&u&&u.wrapper&&p?this.initConnectors(i[""+v],A):t.push(i[""+v])):(c=i[T.sourceID],u=i[T.targetID],c&&c.children&&0<c.children.length||u&&u.children&&0<u.children.length?t.push(i[""+v]):this.initConnectors(i[""+v],A)):i[""+v].children?o.push(v):i[""+v].shape instanceof Jxi&&i[""+v].shape.activity.subProcess.processes&&0<i[""+v].shape.activity.subProcess.processes.length?n[i[""+v].id]=v:this.initNodes(i[""+v],A));if(this.pathDataStorage&&this.pathDataStorage.clear(),this.bpmnModule)for(var f=0,y=this.bpmnModule.bpmnTextAnnotationConnector;f<y.length;f++){var v=y[f];this.initConnectors(v,void 0,!0)}}for(var b=0,w=Object.keys(n);b<w.length;b++){v=w[b];this.initObject(i[""+v]),this.bpmnModule.updateDocks(i[""+v],this)}for(var C=0,S=this.alignGroup(o,i);C<S.length;C++){var v=S[C],A=this.commandHandler.getObjectLayer(v);this.initNodes(i[""+v],A)}for(var x=0,I=t;x<I.length;x++){var T=I[x],A=this.commandHandler.getObjectLayer(T.id);this.initConnectors(T,A)}},X.prototype.alignGroup=function(e,t){for(var i,n=[],o=[],r=0;r<e.length;r++){var s,a,l;if((a=t[""+(s=e[parseInt(r.toString(),10)])])&&a.children.length)for(i=0;i<a.children.length;i++)l=a.children[parseInt(i.toString(),10)],-1<e.indexOf(l)&&-1===n.indexOf(l)&&-1===o.indexOf(l)&&n.splice(0,0,l);-1===n.indexOf(s)&&o.push(s)}return n=n.concat(o)},X.prototype.addToLayer=function(e,t){var i,n;t&&(i=this.commandHandler.getObjectLayer(e.id)),t&&i||-1===this.activeLayer.objects.indexOf(e.id)&&this.activeLayer.objects.push(e.id),(e instanceof MIi||e instanceof ISi)&&("SwimLane"!==e.shape.type||e.children&&0<e.children.length)&&(e.parentId&&(t=this.swimlaneZIndexTable[e.parentId],n=this.swimlaneChildTable[e.id],t&&-1!==t||n&&-1!==n)&&(e.zIndex=this.swimlaneChildTable[e.id]),!(e instanceof ISi&&e.sourceID&&e.targetID)||-1!==this.activeLayer.objects.indexOf(e.sourceID)&&-1!==this.activeLayer.objects.indexOf(e.targetID))&&this.setZIndex(i||this.activeLayer,e)},X.prototype.updateLayer=function(e){for(var t=0,i=Object.keys(e.layers);t<i.length;t++){for(var n=i[t],o=0,r=this.layers[""+n].objects;o<r.length;o++){var s=r[o],s=this.nameTable[""+s];void 0!==e.layers[""+n].visible?this.updateElementVisibility(s.wrapper,s,e.layers[""+n].visible):!0===e.layers[""+n].lock&&this.unSelect(s)}void 0!==e.layers[""+n].lock&&(this.layers[""+n].lock=e.layers[""+n].lock)}"SVG"!==this.mode&&this.refreshDiagramLayer()},X.prototype.updateScrollSettings=function(e){var t=-this.scroller.horizontalOffset+e.scrollSettings.horizontalOffset||0,e=-this.scroller.verticalOffset+e.scrollSettings.verticalOffset||0,i={VerticalOffset:this.scrollSettings.verticalOffset,HorizontalOffset:this.scrollSettings.horizontalOffset,ViewportHeight:this.scrollSettings.viewPortHeight,ViewportWidth:this.scrollSettings.viewPortWidth,CurrentZoom:this.scroller.currentZoom};0===t&&0===e||this.pan(t,e);t="Start",e={oldValue:i,newValue:{VerticalOffset:this.scrollSettings.verticalOffset,HorizontalOffset:this.scrollSettings.horizontalOffset,ViewportHeight:this.scrollSettings.viewPortHeight,ViewportWidth:this.scrollSettings.viewPortWidth,CurrentZoom:this.scroller.currentZoom},source:this,panState:t=this.realActions&ayi.PanInProgress?"Progress":t};this.triggerEvent(dyi.scrollChange,e),this.commandHandler.updatePanState(!0),"Canvas"===this.mode&&this.constraints&$fi.Virtualization&&this.refreshDiagramLayer()},X.prototype.initData=function(){var e,t=this.dataSourceSettings.dataManager||this.dataSourceSettings.dataSource;!this.dataBindingModule||this.realActions&ayi.PreventDataInit?t&&!this.dataBindingModule&&console.warn('[WARNING] :: Module "DataBinding" is not available in Diagram component! You either misspelled the module name or forgot to load it.'):t&&this.dataSourceSettings.connectionDataSource.dataManager?(e=this.dataSourceSettings.dataManager||this.dataSourceSettings.dataSource,this.nodes=this.generateData(e,!0),this.connectors=this.generateData(this.dataSourceSettings.connectionDataSource.dataManager,!1)):t&&t.dataSource&&(t.dataSource.url||"BlazorAdaptor"===t.adaptorName&&!t.dataSource.url)?this.dataBindingModule.initSource(this.dataSourceSettings,this):this.dataBindingModule.initData(this.dataSourceSettings,this)},X.prototype.generateData=function(e,t){for(var i=[],n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)],o=t?this.makeData(o,!0):this.makeData(o,!1);o&&o.id&&!lAi(i,o.id)&&i.push(o)}return i},X.prototype.makeData=function(e,t){var i,n=t?this.dataSourceSettings:this.dataSourceSettings.connectionDataSource,o={};if(o.id=e[n.id]||xTi(),n.sourceID&&(o.sourceID=e[n.sourceID]),n.targetID&&(o.targetID=e[n.targetID]),e[n.sourcePointX]&&e[n.sourcePointY]&&(o.sourcePoint={x:Number(e[n.sourcePointX]),y:Number(e[n.sourcePointY])}),e[n.targetPointX]&&e[n.targetPointY]&&(o.targetPoint={x:Number(e[n.targetPointX]),y:Number(e[n.targetPointY])}),n.crudAction.customFields&&0<n.crudAction.customFields.length)for(i=0;i<n.crudAction.customFields.length;i++)o[n.crudAction.customFields[parseInt(i.toString(),10)]]=e[n.crudAction.customFields[parseInt(i.toString(),10)]];return o},X.prototype.initNodes=function(e,t){this.preventDiagramUpdate=!0,this.initObject(e,t),this.preventDiagramUpdate=!1},X.prototype.initConnectors=function(e,t,i){this.preventDiagramUpdate=!0,this.initObject(e,t,i),this.updateEdges(e),this.preventDiagramUpdate=!1},X.prototype.setZIndex=function(e,t){var i=e;if(t.zIndex===Number.MIN_VALUE){for(;i.zIndexTable[i.objectZIndex+1];)e.objectZIndex++;this.setIndex(e,t)}else{var n=null!==t.zIndex?t.zIndex:i.objectZIndex+1;if(i.zIndexTable[parseInt(n.toString(),10)])for(var o=Object.keys(i.zIndexTable).length,r=0;r<o;r++)if(r===n){for(var s=o;n<s;s--)i.zIndexTable[parseInt(s.toString(),10)]=i.zIndexTable[s-1],this.nameTable[i.zIndexTable[parseInt(s.toString(),10)]]&&(this.nameTable[i.zIndexTable[parseInt(s.toString(),10)]].zIndex=s);i.zIndexTable[parseInt(r.toString(),10)]=t.id}}},X.prototype.setIndex=function(n,t){var o=this,r=function(e){e.zIndex=++n.objectZIndex,"Bpmn"===e.shape.type&&e.shape.activity&&e.shape.activity.subProcess&&e.shape.activity.subProcess.processes&&e.shape.activity.subProcess.processes.length&&e.shape.activity.subProcess.processes.forEach(function(e){e=o.nameTable[""+e];e&&(e.zIndex=++n.objectZIndex)})};if(n.objects.find(function(e){return e===t.id}))if(t instanceof MIi){if(r(t),"SwimLane"!==t.shape.type&&t.children&&0<t.children.length)for(var e=0;e<t.children.length;e++)!function(t){var e=o.nodes.find(function(e){return e.id===t}),i=o.connectors.find(function(e){return e.id===t});e?e.children&&0<e.children.length?o.setIndex(n,e):r(e):i&&r(i)}(t.children[parseInt(e.toString(),10)])}else r(t)},X.prototype.initializeDiagramLayers=function(){for(var e=0;e<this.layers.length;e++)-1!==this.layers[parseInt(e.toString(),10)].zIndex&&(o=this.layers[parseInt(e.toString(),10)],this.layers[parseInt(e.toString(),10)]=this.layers[this.layers[parseInt(e.toString(),10)].zIndex],this.layers[o.zIndex]=o);for(var t=0,i=this.layers;t<i.length;t++){var n=i[t];n.zIndex=-1!==n.zIndex?n.zIndex:this.layers.indexOf(n),this.layerZIndexTable[n.zIndex]=n.id}for(e=0;e<this.layers.length;e++)for(var o,r=e+1;r<this.layers.length;r++)this.layers[parseInt(e.toString(),10)].zIndex>this.layers[parseInt(r.toString(),10)].zIndex&&(o=this.layers[parseInt(e.toString(),10)],this.layers[parseInt(e.toString(),10)]=this.layers[parseInt(r.toString(),10)],this.layers[parseInt(r.toString(),10)]=o);0===this.layers.length&&this.commandHandler.addLayer({id:"default_layer",visible:!0,lock:!1,objects:[],zIndex:0,objectZIndex:-1,zIndexTable:{}},null,!0),this.setActiveLayer(this.layers[this.layers.length-1].id)},X.prototype.resetTool=function(){this.eventHandler.resetTool()},X.prototype.initObjectExtend=function(e,t,i){if(i){i=this.commandHandler.checkBoundaryConstraints(void 0,void 0,e.wrapper.bounds,!0);if("SwimLane"===e.shape.type)for(var n=0,o=Object.keys(t.zIndexTable);n<o.length;n++)t.zIndexTable[o[parseInt(n.toString(),10)]]&&t.zIndexTable[o[parseInt(n.toString(),10)]]===e.id&&delete t.zIndexTable[o[parseInt(n.toString(),10)]];if(t.zIndexTable[e.zIndex]=e.id,!i){for(var r=e instanceof MIi?this.nodes:this.connectors,n=0;n<=r.length;n++)r[parseInt(n.toString(),10)]&&e.id===r[parseInt(n.toString(),10)].id&&r.splice(n,1);delete t.zIndexTable[e.zIndex]}}},X.prototype.initObject=function(e,t,i,n){if(void 0===i&&(i=!0),void 0!==e){if(i&&(t||(this.addToLayer(e,!1),t=this.activeLayer),e instanceof MIi||e instanceof ISi)&&("SwimLane"!==e.shape.type||e.children&&0<e.children.length)&&this.setZIndex(t,e),e instanceof MIi){if(i){if("helper"!==e.id&&!(this.diagramActions&ryi.UndoRedo))if(s=jTi(this.getNodeDefaults)){if((r=s(e,this))&&r.ports)for(var o=0;o<r.ports.length;o++)r.ports[parseInt(o.toString(),10)].inEdges=[],r.ports[parseInt(o.toString(),10)].outEdges=[];r&&r!==e&&PTi(r,e)}this.initNode(e,this.element.id)}}else if(e instanceof ISi){(s=jTi(this.getConnectorDefaults))&&((r=s(e,this))&&r!==e&&PTi(r,e),e.segments.length)&&e.type!==e.segments[0].type&&(e.segments=[]);var r,s=this.nameTable[e.sourceID],a=this.nameTable[e.targetID],l=this.getConnectedPort(s,e,!0),h=this.getConnectedPort(a,e),d=this.findInOutConnectPorts(s,!1),p=this.findInOutConnectPorts(a,!0);(void 0!==s&&Gvi(s)||""!==e.sourcePortID&&Yvi(d))&&(e.sourceWrapper=this.getEndNodeWrapper(s,e,!0),e.sourcePortID)&&l&&l.constraints&&!(l.constraints&pyi.None)&&l.constraints&pyi.OutConnect&&(e.sourcePortWrapper=this.getWrapper(s.wrapper,e.sourcePortID)),(void 0!==a&&Uvi(a)||""!==e.targetPortID&&qvi(p))&&(e.targetWrapper=this.getEndNodeWrapper(a,e,!1),e.targetPortID)&&h&&h.constraints&&!(h.constraints&pyi.None)&&h.constraints&pyi.InConnect&&(e.targetPortWrapper=this.getWrapper(a.wrapper,e.targetPortID)),i||(d=e.getConnectorPoints(e.type),t1i(e,d)),i&&e.init(this);for(var c=0;c<e.wrapper.children.length;c++)this.pathTable[e.wrapper.children[parseInt(c.toString(),10)].data]&&(e.wrapper.children[parseInt(c.toString(),10)].absoluteBounds=this.pathTable[e.wrapper.children[parseInt(c.toString(),10)].data].absoluteBounds);e.wrapper.measure(new Omi(void 0,void 0)),e.wrapper.arrange(e.wrapper.desiredSize),e instanceof ISi&&"Bezier"===e.type&&(this.updateConnectorAnnotation(e),this.updateConnectorfixedUserHandles(e));for(var u=0;u<e.wrapper.children.length;u++)this.pathTable[e.wrapper.children[parseInt(u.toString(),10)].data]={},this.pathTable[e.wrapper.children[parseInt(u.toString(),10)].data].absoluteBounds=e.wrapper.children[parseInt(u.toString(),10)].absoluteBounds}if(e instanceof MIi&&e.children&&e.container)for(o=0;o<e.children.length;o++)this.nameTable[e.children[parseInt(o.toString(),10)]].offsetX=this.nameTable[e.children[parseInt(o.toString(),10)]].wrapper.offsetX,this.nameTable[e.children[parseInt(o.toString(),10)]].offsetY=this.nameTable[e.children[parseInt(o.toString(),10)]].wrapper.offsetY;if(e instanceof MIi&&e.shape&&"Activity"===e.shape.shape&&"SubProcess"===e.shape.activity.activity&&e.shape.activity.subProcess.processes)for(var g=e.shape.activity.subProcess.processes,o=0;o<g.length;o++)this.nameTable[g[parseInt(o.toString(),10)]]&&(this.nameTable[g[parseInt(o.toString(),10)]].offsetX=this.nameTable[g[parseInt(o.toString(),10)]].wrapper.offsetX,this.nameTable[g[parseInt(o.toString(),10)]].offsetY=this.nameTable[g[parseInt(o.toString(),10)]].wrapper.offsetY);if(this.initObjectExtend(e,t,i),this.nameTable[e.id]=e,!this.refreshing&&e.shape.annotations&&0<e.shape.annotations.length)for(o=0;o<e.shape.annotations.length&&e.shape.annotations[parseInt(o.toString(),10)].text;o++)this.getBPMNTextAnnotation(e,this,e.shape.annotations[parseInt(o.toString(),10)],!1);if(e instanceof MIi&&e.children){this.preventNodesUpdate=!0,this.preventConnectorsUpdate=!0,n||e.container||this.updateGroupOffset(e,!0),this.groupTable[e.id]=e.children;for(o=0;o<e.children.length;o++){var m=this.nameTable[e.children[parseInt(o.toString(),10)]];m&&(m.parentId=e.id)}this.isLoading||!e.rotateAngle||e.container||this.isUndo||this.commandHandler.rotateObjects(e,[e],e.rotateAngle,{x:e.offsetX,y:e.offsetY},!1),this.preventNodesUpdate=!1,this.preventConnectorsUpdate=!1}void 0===this.enterObject&&this.updateQuad(e)}!1===e.visible&&this.updateElementVisibility(e.wrapper,e,!1)},X.prototype.getConnectedPort=function(e,t,i){if(e&&e.ports)for(var n=0,o=e.ports;n<o.length;n++){var r=o[n];if(r.id===t.sourcePortID&&i)return r;if(r.id===t.targetPortID&&!i)return r}return null},X.prototype.scaleObject=function(e,t,i){var n=i?e.wrapper.actualSize.width:e.wrapper.actualSize.height,o=i?1+(t-n)/n:1,i=i?1:1+(t-n)/n;this.realActions|=ayi.PreventDrag,this.scale(e,o,i,{x:.5,y:.5}),this.realActions&=~ayi.PreventDrag},X.prototype.updateDefaultLayoutIcons=function(e){"OrganizationalChart"!==this.layout.type&&"HierarchicalTree"!==this.layout.type&&"ComplexHierarchicalTree"!==this.layout.type||(this.updateDefaultLayoutIcon(e,e.expandIcon),this.updateDefaultLayoutIcon(e,e.collapseIcon))},X.prototype.updateDefaultLayoutIcon=function(e,t){var i,n;"None"!==t.shape&&"Auto"===t.horizontalAlignment&&"Auto"===t.verticalAlignment&&.5===t.offset.x&&1===t.offset.y&&(t=this.getWrapper(e.wrapper,"icon_content"),n=i=void 0,"TopToBottom"===this.layout.orientation||"BottomToTop"===this.layout.orientation?(i=.5,n="TopToBottom"===this.layout.orientation?1:0):"RightToLeft"!==this.layout.orientation&&"LeftToRight"!==this.layout.orientation||(i="LeftToRight"===this.layout.orientation?1:0,n=.5),t.setOffsetWithRespectToBounds(i,n,"Fraction"),t.horizontalAlignment="Center",t.verticalAlignment="Center",e.wrapper.measure(new Omi(e.wrapper.width,e.wrapper.height)),e.wrapper.arrange(e.wrapper.desiredSize))},X.prototype.updateGroupOffset=function(e,t){var i,n,o;(e.children&&0<e.children.length&&!e.container||e.processId)&&(i=this.nameTable[e.id],this.realActions&ayi.PreventScale||this.realActions&ayi.PreventDrag||(i.offsetX&&(this.realActions&ayi.EnableGroupAction||!(this.diagramActions&ryi.UndoRedo||this.diagramActions&ryi.ToolAction||this.diagramActions&ryi.PublicMethod))?(this.realActions|=ayi.PreventScale,n=i.offsetX-e.wrapper.offsetX,i.offsetX=e.wrapper.offsetX,o=i.offsetY-e.wrapper.offsetY,i.offsetY=e.wrapper.offsetY,n+o!==0&&this.drag(i,n,o),this.realActions&=~ayi.PreventScale):i.offsetX=e.wrapper.offsetX,i.offsetY&&(this.realActions&ayi.EnableGroupAction||!(this.diagramActions&ryi.UndoRedo||this.diagramActions&ryi.ToolAction||this.diagramActions&ryi.PublicMethod))?(this.realActions|=ayi.PreventScale,o=i.offsetY-e.wrapper.offsetY,i.offsetY=e.wrapper.offsetY,this.drag(i,0,o),this.realActions&=~ayi.PreventScale):i.offsetY=e.wrapper.offsetY,this.diagramActions&&(i.width=e.wrapper.actualSize.width,i.height=e.wrapper.actualSize.height))),e&&e.annotations&&0<e.annotations.length&&(e.wrapper.children.forEach(function(e){e instanceof Vyi&&e.children.forEach(function(e){e&&e instanceof Tyi&&e.refreshTextElement()})}),e.wrapper.measure(new Omi(e.width,e.height),e.id,this.onLoadImageSize.bind(this)),e.wrapper.arrange(e.wrapper.desiredSize)),t&&e.children&&0<e.children.length&&(void 0!==this.nameTable[e.id].width?this.scaleObject(e,this.nameTable[e.id].width,!0):this.nameTable[e.id].width=e.wrapper.actualSize.width,void 0!==this.nameTable[e.id].height?this.scaleObject(e,this.nameTable[e.id].height,!1):this.nameTable[e.id].height=e.wrapper.actualSize.height)},X.prototype.initNode=function(e,t,i){var n=e.initContainer(),o=new Vyi;if(this.diagramSettings.inversedAlignment||(n.inversedAlignment=!1),n.children||(n.children=[]),e.children){if(n.measureChildren=!1,o.id=e.id+"group_container",e.shape&&"SwimLane"===e.shape.type?o.style.fill=e.style.fill:o.style.fill="none",o.style.strokeColor="none",o.horizontalAlignment="Stretch",o.verticalAlignment="Stretch",o.pivot=e.pivot,n.style=e.style,n.padding.left=e.padding.left,n.padding.right=e.padding.right,n.padding.top=e.padding.top,n.padding.bottom=e.padding.bottom,o.children=[],o.preventContainer=!0,e.container&&(o.relativeMode="Object"),e.container&&"Grid"===e.container.type)for(var r=0;r<e.children.length;r++){var s=new Vyi,a=this.nameTable[e.children[r]];s.children=[],s.children.push(a.wrapper),a&&n.addObject(a.wrapper,a.rowIndex,a.columnIndex,a.rowSpan,a.columnSpan)}else for(r=0;r<e.children.length;r++)this.nameTable[e.children[r]]&&(a=this.nameTable[e.children[r]],this.updateStackProperty(e,a,r),n.children.push(a.wrapper),n.elementActions=n.elementActions|Jfi.ElementIsGroup,a.wrapper.flip=a.wrapper.flip^=e.wrapper.flip);(je(e.container)||e.container&&"Grid"!==e.container.type)&&n.children.push(o)}else{var l=jTi(this.setNodeTemplate),h=(h=l&&"helper"!==e.id?l(e,this):h)||e.init(this);n.children.push(h)}l=jTi(this.getDescription),(e.children?n:h).description=l||(e.annotations.length?e.annotations[0].content:e.id);var d=e.children?o:n;e.initAnnotations(this.getDescription,d,this.element.id,!!Jvi(this),this.annotationTemplate),e.initPorts(this.getDescription,d),e.initIcons(this.getDescription,this.layout,d,t);for(r=0;e.fixedUserHandles,r<e.fixedUserHandles.length;r++){var p=e.initFixedUserHandles(e.fixedUserHandles[r],this.fixedUserHandleTemplate,this.element.id);d.children.push(p)}if("SwimLane"===e.shape.type&&e.wrapper&&0<e.wrapper.children.length&&e.wrapper.children[0]instanceof ubi){if(this.setZIndex(this.activeLayer,e),0<this.connectors.length)for(r=0;r<this.connectors.length;r++){var c=this.connectors[r];c.sourceID&&c.targetID&&-1===this.activeLayer.objects.indexOf(c.sourceID)&&-1===this.activeLayer.objects.indexOf(c.targetID)&&this.setZIndex(this.activeLayer,c)}Pbi(e),Fbi(this,e),this.updateDiagramElementQuad()}else n.measure(new Omi(e.width,e.height),e.id,this.onLoadImageSize.bind(this)),n instanceof ubi?n.arrange(n.desiredSize,!0):n.arrange(n.desiredSize);if(e.wrapper.flip!==jfi.None)if(e.children&&0<e.children.length){for(r=0;r<e.children.length;r++){var u=this.nameTable[e.children[r]];u&&(this.refreshing||this.commandHandler.cloningInProgress||this.diagramActions&ryi.UndoRedo||(u.flip^=e.flip,u.flipMode=e.flipMode),"None"!==u.flipMode&&"Label"!==u.flipMode&&"LabelText"!==u.flipMode&&"LabelAndLabelText"!==u.flipMode?this.updatePorts(u,u.flip):this.updatePorts(u,jfi.None),this.applyWrapperFlip(u),u.wrapper.measure(new Omi(u.wrapper.bounds.width,u.wrapper.bounds.height),u.id,this.onLoadImageSize.bind(this)),u.wrapper.arrange(u.wrapper.desiredSize))}var g=e.wrapper.children[e.wrapper.children.length-1];g.flip=e.wrapper.flip,g.flipMode=e.wrapper.flipMode;for(var m=0;m<g.children.length;m++){var f=g.children[m];f instanceof Tyi&&"Port"!==e.flipMode&&"None"!==e.flipMode&&(f.flip=e.wrapper.flip,f.flipMode=e.wrapper.flipMode)}this.refreshing||this.commandHandler.cloningInProgress||this.diagramActions&ryi.UndoRedo||b1i(e.wrapper,e.wrapper.offsetX,e.wrapper.offsetY,this,e.wrapper.flip,void 0,void 0,!0)}else this.applyWrapperFlip(e);if("Bpmn"===e.shape.type&&"TextAnnotation"===e.shape.shape){for(var y=!1,r=0;r<this.connectors.length;r++)if(this.connectors[parseInt(r.toString(),10)].id===e.id+"_connector"){y=this.connectors[parseInt(r.toString(),10)].isBpmnAnnotationConnector=!0;break}y||this.addBpmnAnnotationConnector(e,n)}e instanceof MIi&&e.container&&(e.width<n.outerBounds.width||e.height<n.outerBounds.height)&&n.bounds.x<=n.outerBounds.x&&n.bounds.y<=n.outerBounds.y&&(e.width=n.width=n.outerBounds.width,e.height=n.height=n.outerBounds.height,n.measure(new Omi(e.width,e.height)),n.arrange(n.desiredSize)),e.container&&"Grid"===e.container.type&&e.children&&0<e.children.length&&this.updateChildPosition(e)},X.prototype.applyWrapperFlip=function(e){e.wrapper.flip=e.flip,e.wrapper.flipMode=e.flipMode,e.wrapper.children[0].flip=e.flip,e.wrapper.children[0].flipMode=e.flipMode;for(var t=0;t<e.wrapper.children.length;t++){var i=e.wrapper.children[t];i instanceof Vyi?this.applyWrapperCanvasFlip(i,e):(i.flip=e.flip,i.flipMode=e.flipMode)}},X.prototype.applyWrapperCanvasFlip=function(e,t){for(var i=0;i<e.children.length;i++){var n=e.children[parseInt(i.toString(),10)];n instanceof Vyi?this.applyWrapperCanvasFlip(n,t):"None"!==t.flipMode&&(n.flip=t.flip,n.flipMode=t.flipMode)}},X.prototype.addBpmnAnnotationConnector=function(e,t){if(e.parentObj instanceof X||e.parentObj instanceof RIi){var i=e.shape,n=i.textAnnotation.textAnnotationDirection,o=""!==i.textAnnotation.textAnnotationTarget&&this.nameTable[i.textAnnotation.textAnnotationTarget],r=o?this.nameTable[i.textAnnotation.textAnnotationTarget]:null,s=null!=r?r.wrapper:null,a=e.ports[0],l={x:0,y:0};switch(n){case"Left":a.offset={x:0,y:.5},l.x=t.bounds.left-40,l.y=t.bounds.bottom+30;break;case"Right":a.offset={x:1,y:.5},l.x=t.bounds.right+40,l.y=t.bounds.bottom+30;break;case"Top":a.offset={x:.5,y:0},l.x=t.bounds.right+30,l.y=t.bounds.top-40;break;case"Bottom":a.offset={x:.5,y:1},l.x=t.bounds.right+30,l.y=t.bounds.bottom+40;break;default:a.offset={x:0,y:.5},l.x=t.bounds.left-40,l.y=t.bounds.bottom+30,o&&null!=t&&null!=s&&(t.bounds.left>s.bounds.right?a.offset={x:0,y:.5}:t.bounds.right<s.bounds.left?a.offset={x:1,y:.5}:t.bounds.bottom>s.bounds.top?a.offset={x:.5,y:0}:t.bounds.top<s.bounds.bottom&&(a.offset={x:.5,y:1}))}r=new ISi(this,"connectors",{id:e.id+"_connector",targetID:e.id,targetPortID:a.id,type:"Straight",shape:{type:"Bpmn",flow:"Association"},constraints:Yfi.Default&~(Yfi.DragTargetEnd|Yfi.Delete),isBpmnAnnotationConnector:!0},!0),n=(o?r.sourceID=i.textAnnotation.textAnnotationTarget:r.sourcePoint=l,this.isProtectedOnChange),i=(this.isProtectedOnChange=!0,e.constraints|=Kfi.InConnect,this.connectors.push(r),this.bpmnModule.bpmnTextAnnotationConnector||(this.bpmnModule.bpmnTextAnnotationConnector=[]),this.bpmnModule.bpmnTextAnnotationConnector.push(r),0!=(e.constraints&Kfi.Shadow)),r=0!=(e.constraints&Kfi.AllowMovingOutsideLane);e.constraints=Kfi.Default&~(Kfi.OutConnect|Kfi.InConnect),i&&(e.constraints|=Kfi.Shadow),r&&(e.constraints|=Kfi.AllowMovingOutsideLane),this.isProtectedOnChange=n}},X.prototype.getBPMNTextAnnotation=function(e,t,i,n){var o,r={id:i.id||xTi(),height:i.height||100,width:i.width||100,annotations:[{id:(i.id||xTi())+i.text,content:i.text}],offsetX:e.offsetX+i.length*Math.cos(i.angle*(Math.PI/180)),offsetY:e.offsetY+i.length*Math.sin(i.angle*(Math.PI/180)),shape:{type:"Bpmn",shape:"TextAnnotation",textAnnotation:{textAnnotationDirection:"Auto",textAnnotationTarget:e.id}},constraints:Kfi.Default&~(Kfi.OutConnect|Kfi.InConnect)},s=e.wrapper.bounds,e={x:r.offsetX,y:r.offsetY},a=uvi(e,s,s);switch(a){case"Right":o={x1:s.right,y1:s.top,x2:s.right,y2:s.bottom};break;case"Left":o={x1:s.left,y1:s.top,x2:s.left,y2:s.bottom};break;case"Bottom":o={x1:s.right,y1:s.bottom,x2:s.left,y2:s.bottom};break;case"Top":o={x1:s.right,y1:s.top,x2:s.left,y2:s.top}}var l=s.center,e=tvi(o,[l,Hmi.transform(e,i.angle,Math.max(s.width,s.height))],0,l);void 0!==i.length&&void 0!==i.angle&&e&&(e=Hmi.transform(e,i.angle,i.length),r.offsetX=e.x,r.offsetY=e.y),"Right"===a?r.offsetX+=r.width/2:"Left"===a?r.offsetX-=r.width/2:"Bottom"===a?r.offsetY+=r.height/2:r.offsetY-=r.height/2,n?this.add(r):(l=new MIi(this,"nodes",r,!0),t.initObject(l,void 0,void 0,!0),t.nodes.push(l))},X.prototype.updateDiagramElementQuad=function(){for(var e=0;e<this.nodes.length;e++)this.nodes[parseInt(e.toString(),10)].wrapper&&this.nodes[parseInt(e.toString(),10)].wrapper instanceof Syi&&this.updateQuad(this.nodes[parseInt(e.toString(),10)])},X.prototype.onLoadImageSize=function(e,t){var i=this.getObject(e),e=document.getElementById(e+"sf-imageNode"),e=(e&&e.parentNode.removeChild(e),this.nodePropertyChange(i,{},{width:t.width,height:t.height}),{element:DTi(i),size:t});this.triggerEvent(dyi.onImageLoad,e)},X.prototype.updateChildPosition=function(e){for(var t=0;t<e.children.length;t++){var i=this.getObject(e.children[parseInt(t.toString(),10)]);i.offsetX=i.wrapper.offsetX,i.offsetY=i.wrapper.offsetY,i.children&&0<i.children.length&&this.updateChildPosition(i)}},X.prototype.canExecute=function(){return!0},X.prototype.updateStackProperty=function(e,t,i){e.container&&"Stack"===e.container.type&&(t.width||(t.wrapper.horizontalAlignment="Stretch",t.horizontalAlignment="Stretch"),t.height||(t.verticalAlignment="Stretch",t.wrapper.verticalAlignment="Stretch"),i)&&"UmlClassifier"===e.shape.type&&(t.umlIndex=i)},X.prototype.initViews=function(){this.isLoading||(this.views.push(this.element.id),this.views[this.element.id]=this)},X.prototype.initCommands=function(){var e=this.commandManager.commands,t={copy:{execute:this.copyCommand.bind(this),canExecute:this.canExecute.bind(this),gesture:{key:oyi.C,keyModifiers:nyi.Control}},paste:{execute:this.pasteCommand.bind(this),canExecute:this.canExecute.bind(this),gesture:{key:oyi.V,keyModifiers:nyi.Control}},cut:{execute:this.cutCommand.bind(this),canExecute:this.canExecute.bind(this),gesture:{key:oyi.X,keyModifiers:nyi.Control}},delete:{execute:this.removeCommand.bind(this),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Delete}},selectAll:{execute:this.selectAll.bind(this),canExecute:this.canExecute.bind(this),gesture:{key:oyi.A,keyModifiers:nyi.Control}},undo:{execute:this.undo.bind(this),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Z,keyModifiers:nyi.Control}},redo:{execute:this.redo.bind(this),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Y,keyModifiers:nyi.Control}},nudgeUp:{execute:this.nudgeCommand.bind(this,"Up"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Up},parameter:"up"},nudgeRight:{execute:this.nudgeCommand.bind(this,"Right"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Right},parameter:"right"},nudgeDown:{execute:this.nudgeCommand.bind(this,"Down"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Down},parameter:"down"},nudgeLeft:{execute:this.nudgeCommand.bind(this,"Left"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Left},parameter:"left"},startEdit:{execute:this.startEditCommad.bind(this),canExecute:this.canExecute.bind(this),gesture:{key:oyi.F2}},endEdit:{execute:this.endEditCommand.bind(this),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Escape}},focusToNextItem:{execute:this.navigateItems.bind(this,!0),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Tab}},focusToPreviousItem:{execute:this.navigateItems.bind(this,!1),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Tab,keyModifiers:nyi.Shift}},selectFocusedItem:{execute:this.startEditCommad.bind(this),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Enter}},bold:{execute:this.fontStyleCommand.bind(this,"bold"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.B,keyModifiers:nyi.Control}},italic:{execute:this.fontStyleCommand.bind(this,"italic"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.I,keyModifiers:nyi.Control}},underline:{execute:this.fontStyleCommand.bind(this,"underline"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.U,keyModifiers:nyi.Control}},duplicate:{execute:this.duplicateCommand.bind(this),canExecute:this.canExecute.bind(this),gesture:{key:oyi.D,keyModifiers:nyi.Control}},group:{execute:this.groupCommand.bind(this,"group"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.G,keyModifiers:nyi.Control}},ungroup:{execute:this.groupCommand.bind(this,"ungroup"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.U,keyModifiers:nyi.Control|nyi.Shift}},rotateClockwise:{execute:this.rotateCommand.bind(this,"clockwise"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.R,keyModifiers:nyi.Control}},rotateAntiClockwise:{execute:this.rotateCommand.bind(this,"antiClockwise"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.L,keyModifiers:nyi.Control}},flipHorizontal:{execute:this.flipCommand.bind(this,"horizontal"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.H,keyModifiers:nyi.Control}},flipVertical:{execute:this.flipCommand.bind(this,"vertical"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.J,keyModifiers:nyi.Control}},pointerTool:{execute:this.toolCommand.bind(this,"pointer"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Number1,keyModifiers:nyi.Control}},textTool:{execute:this.toolCommand.bind(this,"text"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Number2,keyModifiers:nyi.Control}},connectTool:{execute:this.toolCommand.bind(this,"connect"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Number3,keyModifiers:nyi.Control}},freeForm:{execute:this.toolCommand.bind(this,"freeForm"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Number5,keyModifiers:nyi.Control}},lineTool:{execute:this.toolCommand.bind(this,"line"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Number6,keyModifiers:nyi.Control}},rectangleTool:{execute:this.toolCommand.bind(this,"rectangle"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Number8,keyModifiers:nyi.Control}},ellipseTool:{execute:this.toolCommand.bind(this,"ellipse"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Number9,keyModifiers:nyi.Control}},zoomIn:{execute:this.zoomCommand.bind(this,"zoomIn"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Plus,keyModifiers:nyi.Control}},zoomOut:{execute:this.zoomCommand.bind(this,"zoomOut"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Minus,keyModifiers:nyi.Control}},shiftUp:{execute:this.shiftCommand.bind(this,"Up"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Up,keyModifiers:nyi.Shift}},shiftDown:{execute:this.shiftCommand.bind(this,"Down"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Down,keyModifiers:nyi.Shift}},shiftLeft:{execute:this.shiftCommand.bind(this,"Left"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Left,keyModifiers:nyi.Shift}},shiftRight:{execute:this.shiftCommand.bind(this,"Right"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.Right,keyModifiers:nyi.Shift}},alignTextCenter:{execute:this.alignCommand.bind(this,"center"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.C,keyModifiers:nyi.Control|nyi.Shift}},alignTextLeft:{execute:this.alignCommand.bind(this,"right"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.L,keyModifiers:nyi.Control|nyi.Shift}},alignTextRight:{execute:this.alignCommand.bind(this,"left"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.R,keyModifiers:nyi.Control|nyi.Shift}},alignTextTop:{execute:this.alignCommand.bind(this,"top"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.E,keyModifiers:nyi.Control|nyi.Shift}},alignTextCenterVertical:{execute:this.alignCommand.bind(this,"centerVertical"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.M,keyModifiers:nyi.Control|nyi.Shift}},alignTextBottom:{execute:this.alignCommand.bind(this,"bottom"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.V,keyModifiers:nyi.Control|nyi.Shift}},alignJustify:{execute:this.alignCommand.bind(this,"justify"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.J,keyModifiers:nyi.Control|nyi.Shift}},sendToBack:{execute:this.orderCommand.bind(this,"sendToBack"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.B,keyModifiers:nyi.Control|nyi.Shift}},bringToFront:{execute:this.orderCommand.bind(this,"bringToFront"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.F,keyModifiers:nyi.Control|nyi.Shift}},sendBackward:{execute:this.orderCommand.bind(this,"sendBackward"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.BracketLeft,keyModifiers:nyi.Control}},bringForward:{execute:this.orderCommand.bind(this,"bringForward"),canExecute:this.canExecute.bind(this),gesture:{key:oyi.BracketRight,keyModifiers:nyi.Control}}};this.initCommandManager(e,t)},X.prototype.overrideCommands=function(e,t){for(var i=0,n=Object.keys(t);i<n.length;i++){var o=n[i],r=t[""+o];if(e.gesture.key===r.gesture.key&&e.gesture.keyModifiers===r.gesture.keyModifiers){delete t[""+o];break}}},X.prototype.initCommandManager=function(e,t){var i=0;if(e)for(i=0;i<e.length;i++)t[e[parseInt(i.toString(),10)].name]&&e[parseInt(i.toString(),10)]?(e[parseInt(i.toString(),10)].canExecute&&(t[e[parseInt(i.toString(),10)].name].canExecute=e[parseInt(i.toString(),10)].canExecute),e[parseInt(i.toString(),10)].execute&&(t[e[parseInt(i.toString(),10)].name].execute=e[parseInt(i.toString(),10)].execute),(e[parseInt(i.toString(),10)].gesture.key||e[parseInt(i.toString(),10)].gesture.keyModifiers)&&(t[e[parseInt(i.toString(),10)].name].gesture=e[parseInt(i.toString(),10)].gesture),""!==e[parseInt(i.toString(),10)].parameter&&(t[e[parseInt(i.toString(),10)].name].parameter=e[parseInt(i.toString(),10)].parameter)):(this.overrideCommands(e[parseInt(i.toString(),10)],t),t[e[parseInt(i.toString(),10)].name]={execute:e[parseInt(i.toString(),10)].execute,canExecute:e[parseInt(i.toString(),10)].canExecute,gesture:e[parseInt(i.toString(),10)].gesture,parameter:e[parseInt(i.toString(),10)].parameter});this.commands=t},X.prototype.updateNodeEdges=function(e){for(var t=0,i=e.inEdges;t<i.length;t++){var n=i[t];this.nameTable[""+n]&&(this.nameTable[""+n].targetID="")}for(var o=0,r=e.outEdges;o<r.length;o++){n=r[o];this.nameTable[""+n]&&(this.nameTable[""+n].sourceID="")}e.inEdges=[],e.outEdges=[]},X.prototype.updateIconVisibility=function(e,t){for(var i=0;i<e.wrapper.children.length;i++){var n,o=e.wrapper.children[parseInt(i.toString(),10)];o.id&&(n=o.id.split(e.id)[1])&&n.match("^_icon")&&(o.visible=t,this.updateDiagramContainerVisibility(o,t))}},X.prototype.updateEdges=function(e){var t;void 0!==e.sourceID&&""!==e.sourceID&&((t=this.nameTable[e.sourceID])&&t.outEdges&&0===t.outEdges.length&&(t.outEdges=[]),t&&t.outEdges&&-1===t.outEdges.indexOf(e.id)&&t.outEdges.push(e.id),this.updatePortEdges(t,e,!1)),void 0!==e.targetID&&""!==e.targetID&&((t=this.nameTable[e.targetID])&&t.inEdges&&0===t.inEdges.length&&(t.inEdges=[]),t&&t.inEdges&&-1===t.inEdges.indexOf(e.id)&&t.inEdges.push(e.id),this.updatePortEdges(t,e,!0),t)&&t.visible&&t.outEdges&&(e=0!==t.outEdges.length,this.updateIconVisibility(t,e))},X.prototype.updatePortEdges=function(e,t,i){if(e)for(var n=0;n<e.ports.length;n++){var o=e.ports[parseInt(n.toString(),10)],r=i?t.targetPortID:t.sourcePortID;o.id===r&&-1===(r=i?o.inEdges:o.outEdges).indexOf(t.id)&&r.push(t.id)}},X.prototype.refreshDiagram=function(){this.initLayerObjects(),this.doLayout(),this.updateBridging(),this.scroller.setSize(),this.addBlazorDiagramObjects(),this.updateFitToPage()},X.prototype.updateCanupdateStyle=function(e,t){for(var i=0;i<e.length;i++)e[parseInt(i.toString(),10)].children&&this.updateCanupdateStyle(e[parseInt(i.toString(),10)].children,t),e[parseInt(i.toString(),10)].canApplyStyle=t},X.prototype.getZindexPosition=function(e,t){var i,n,o=[],r=void 0;if(o=(o=o.concat(this.nodes)).concat(this.connectors),n=e.children?this.commandHandler.findMaxZIndex(e):e.zIndex,e.zIndex!==Number.MIN_VALUE)for(var s=0;s<o.length;s++)if(o[parseInt(s.toString(),10)].zIndex>n){"HTML"!==e.shape.type&&"Native"!==e.shape.type||(i="HTML"===e.shape.type?"html":"native"),r=eTi(t,o[parseInt(s.toString(),10)].id,i);break}return r},X.prototype.updateDiagramObject=function(e,t,i){for(var n="domTable",o=0,r=this.views;o<r.length;o++){var s,a,l,h=r[o],h=this.views[""+h];this.diagramActions&&"SVG"===h.mode&&((s=void 0)===(s=1<this.layers.length?this.commandHandler.getObjectLayer(e.id):s)||s&&s.visible||i)&&(s=dTi(this.element.id),window[n][h.element.id+"_diagramLayer"]||(window[n][h.element.id+"_diagramLayer"]=document.getElementById(h.element.id+"_diagramLayer")),a=window[n][h.element.id+"_diagramLayer"],this.diagramActions&ryi.Interactions&&this.updateCanupdateStyle(e.wrapper.children,!0),l=this.getMidPoint(e),this.diagramRenderer.updateNode(e.wrapper,a,s,void 0,t?void 0:this.getZindexPosition(e,h.element.id),l,this.portCenterPoint),this.updateCanupdateStyle(e.wrapper.children,!0))}},X.prototype.applyMarginBezier=function(e,t){t.cx=t.cx+e.margin.left,t.cx=t.cx-e.margin.right,t.cy=t.cy+e.margin.top,t.cy=t.cy-e.margin.bottom},X.prototype.getMidPoint=function(e){if(e instanceof ISi&&"Bezier"===e.type){for(var t=[],i=this.getBezierPoints(e),n=Hmi.getLengthFromListOfPoints(i),o=0;o<e.annotations.length;o++)for(var r=e.annotations[parseInt(o.toString(),10)].offset,r=this.commandHandler.getPointAtLength(r*n,i,0),s={cx:r.x,cy:r.y},a=0;a<e.wrapper.children.length;a++)e.wrapper&&e.wrapper.children[parseInt(a.toString(),10)]instanceof Tyi&&e.wrapper.children[parseInt(a.toString(),10)].id===e.id+"_"+e.annotations[parseInt(o.toString(),10)].id&&(this.applyMarginBezier(e.wrapper.children[parseInt(a.toString(),10)],s),t[e.id+"_"+e.annotations[parseInt(o.toString(),10)].id]=this.applyAlignment(e.wrapper.children[parseInt(a.toString(),10)],s,e.annotations[parseInt(o.toString(),10)].displacement));for(o=0;o<e.ports.length;o++)for(var l=e.ports[parseInt(o.toString(),10)].offset,l=this.commandHandler.getPointAtLength(l*n,i,0),h={cx:l.x,cy:l.y},a=0;a<e.wrapper.children.length;a++)e.wrapper&&e.wrapper.children[parseInt(a.toString(),10)]instanceof kyi&&e.wrapper.children[parseInt(a.toString(),10)].isPathPort&&e.wrapper.children[parseInt(a.toString(),10)].id===e.id+"_"+e.ports[parseInt(o.toString(),10)].id&&(this.applyMarginBezier(e.wrapper.children[parseInt(a.toString(),10)],h),this.portCenterPoint[e.id+"_"+e.ports[parseInt(o.toString(),10)].id]=this.applyAlignment(e.wrapper.children[parseInt(a.toString(),10)],h,e.ports[parseInt(o.toString(),10)].displacement))}return t},X.prototype.applyAlignment=function(e,t,i){switch(e.horizontalAlignment){case"Auto":case"Left":t.cx=e.inversedAlignment?t.cx:t.cx-e.desiredSize.width,t.cx+=i.x;break;case"Stretch":case"Center":t.cx-=e.desiredSize.width*e.pivot.x;break;case"Right":t.cx=e.inversedAlignment?t.cx-e.desiredSize.width:t.cx,t.cx-=i.x}switch(e.verticalAlignment){case"Auto":case"Top":t.cy=e.inversedAlignment?t.cy:t.cy-e.desiredSize.height,t.cy+=i.y;break;case"Stretch":case"Center":t.cy-=e.desiredSize.height*e.pivot.y;break;case"Bottom":t.cy=e.inversedAlignment?t.cy-e.desiredSize.height:t.cy,t.cy-=i.y}return t},X.prototype.getBezierPoints=function(e){var t,i=[],n={x:e.sourcePoint.x,y:e.sourcePoint.y};for(i.push(n),t=0;t<e.segments.length;t++){var o=e.segments[parseInt(t.toString(),10)].getPoints(e.segments[parseInt(t.toString(),10)],n);i.push.apply(i,o),n=i[i.length-1]}return i},X.prototype.updateGridContainer=function(e){for(var t=dTi(this.element.id),i=0,n=this.views;i<n.length;i++){var o,r=n[i];"SVG"===(r=this.views[""+r]).mode&&this.diagramActions?(o=document.getElementById(r.element.id+"_diagramLayer"),this.diagramRenderer.updateNode(e,o,t,void 0)):this.refreshCanvasDiagramLayer(r)}},X.prototype.getObjectsOfLayer=function(e){for(var t=[],i=0,n=e;i<n.length;i++){var o=n[i];this.nameTable[""+o]&&t.push(this.nameTable[""+o])}return t},X.prototype.refreshDiagramLayer=function(){for(var e=0,t=this.views;e<t.length;e++){var i,n=t[e];switch((i=this.views[""+n]).mode){case"SVG":this.refreshSvgDiagramLayer(i);break;case"Canvas":this.refreshCanvasLayers(i)}}},X.prototype.refreshCanvasLayers=function(e){if(e)this.refreshCanvasDiagramLayer(e);else for(var t=0,i=this.views;t<i.length;t++){var n=i[t],n=this.views[""+n];this.refreshCanvasDiagramLayer(n)}},X.prototype.renderBasicElement=function(e){for(var t=dTi(e.element.id),i=0;i<this.basicElements.length;i++){var n=this.basicElements[parseInt(i.toString(),10)];n instanceof Syi&&(n.prevRotateAngle=0),n.measure(new Omi(n.width,n.height)),n.arrange(n.desiredSize),e.diagramRenderer.renderElement(n,e.diagramLayer,t)}},X.prototype.refreshElements=function(e){var t=!1;if(!this.isDestroyed){this.clearCanvas(e),e instanceof X?(e.diagramLayer.getContext("2d").setTransform(e.scroller.currentZoom,0,0,e.scroller.currentZoom,0,0),e.diagramLayer.getContext("2d").scale(1.5,1.5)):(t=!0,0<(n=document.getElementById(e.element.id+"_nativeLayer")).children.length&&e.updateView(e));var i=dTi(e.element.id);this.renderDiagramElements(e.diagramLayer,e.diagramRenderer,i,void 0,void 0,t);for(var n,o=0;o<this.basicElements.length;o++)(n=this.basicElements[parseInt(o.toString(),10)]).measure(new Omi(n.width,n.height)),n.arrange(n.desiredSize),e.diagramRenderer.renderElement(n,e.diagramLayer,i);e instanceof X&&(e.diagramLayer.style.transform="scale("+2/3+")",e.diagramLayer.style.transformOrigin="0 0"),this.renderTimer=null}},X.prototype.refreshCanvasDiagramLayer=function(e){var t=this;"SVG"===e.mode||this.isDestroyed||(0<this.basicElements.length&&this.renderBasicElement(e),!this.diagramActions||0==(this.diagramActions&ryi.Render)||ryi.ToolAction&this.diagramActions||Jvi(this)||1!==this.scroller.currentZoom?this.refreshElements(e):this.renderTimer||(this.renderTimer=setTimeout(function(){t.refreshElements(e)},40)))},X.prototype.updatePortVisibility=function(e,t,i){var n,o=!this.drawingObject||!this.drawingObject.shape;if((e instanceof MIi||e instanceof ISi)&&o&&Vvi(e)){for(var r=e.ports,s=!1,a=0;a<r.length;a++)n=this.getWrapper(e.wrapper,r[parseInt(a.toString(),10)].id),(t&Wfi.Hover||t&Wfi.Connect)&&s1i(r[parseInt(a.toString(),10)],t)&&(n.visible=!i,s=!0);s&&this.updateDiagramObject(e),"Canvas"===this.mode&&this.refreshCanvasLayers()}},X.prototype.refreshSvgDiagramLayer=function(e){var t,i=document.getElementById(e.element.id+"_diagramLayer"),n=dTi(e.element.id);if(Jvi(this))this.scroller.virtualizeElements();else{for(var o=0;o<this.basicElements.length;o++)(t=this.basicElements[parseInt(o.toString(),10)]).measure(new Omi(t.width,t.height)),t.arrange(t.desiredSize,!(this.diagramActions&ryi.Render)),this.diagramRenderer.renderElement(t,i,n);this.renderDiagramElements(i,this.diagramRenderer,n)}},X.prototype.removeVirtualObjects=function(e){if(this.deleteVirtualObject){for(var t=0;t<this.scroller.removeCollection.length;t++){var i=this.nameTable[this.scroller.removeCollection[parseInt(t.toString(),10)]];void 0!==i&&this.removeElements(i)}this.deleteVirtualObject=!1}clearInterval(e)},X.prototype.updateTextElementValue=function(e){for(var t=0;t<e.wrapper.children.length;t++){var i,n,o,r=e.wrapper.children[parseInt(t.toString(),10)];r instanceof Tyi&&(r.canMeasure=!0,i=this.scroller.viewPortHeight,n=this.scroller.viewPortWidth,o=!1,(o=e.offsetX<n&&e.offsetY<i?!0:o)&&Jvi(this)&&void 0===r.actualSize.height&&void 0===r.actualSize.width&&(e.wrapper.measure(new Omi(e.width,e.height),e.id,this.onLoadImageSize.bind(this)),e.wrapper.arrange(e.wrapper.desiredSize)),r.measure(new Omi(e.width,e.height)),r.arrange(r.desiredSize))}},X.prototype.updateVirtualObjects=function(e,t,i){var n=document.getElementById(this.element.id+"_diagramLayer"),o=dTi(this.element.id);if("SVG"===this.mode){for(var r=0;r<e.length;r++){var s=this.scroller.removeCollection.indexOf(e[parseInt(r.toString(),10)]),s=(0<=s&&this.scroller.removeCollection.splice(s,1),this.nameTable[e[parseInt(r.toString(),10)]]);this.updateTextElementValue(s),this.diagramRenderer.renderElement(s.wrapper,n,o,void 0,void 0,void 0,void 0,s.zIndex)}for(var a=0;a<i.length;a++)this.scroller.removeCollection.push(i[parseInt(a.toString(),10)]);1!==this.scroller.currentZoom&&this.eventHandler.updateVirtualization()}else this.diagramActions&&this.refreshDiagramLayer()},X.prototype.renderDiagramElements=function(e,t,i,n,o,r){void 0===n&&(n=!0);for(var s,a=this.scroller.getPageBounds(),l=(a.x*=this.scroller.currentZoom,a.y*=this.scroller.currentZoom,a.width*=this.scroller.currentZoom,a.height*=this.scroller.currentZoom,-this.scroller.horizontalOffset-a.x),h=-this.scroller.verticalOffset-a.y,d=0,p=Object.keys(this.layerZIndexTable);d<p.length;d++){var c=p[d],u=this.commandHandler.getLayer(this.layerZIndexTable[""+c]),g=void 0,m=void 0,f=("Canvas"===this.mode&&Jvi(this)&&!this.diagramActions&&this.scroller.virtualizeElements(),"Canvas"===this.mode&&Jvi(this)&&0<this.scroller.oldCollectionObjects.length?this.scroller.oldCollectionObjects:void 0),c=Object.keys(f||u.zIndexTable);c.sort(function(e,t){return parseInt(""+e,10)-parseInt(""+t,10)});for(var y=0,v=c;y<v.length;y++){var b=v[y],w=f?this.nameTable[f[""+b]]:this.nameTable[u.zIndexTable[""+b]];if(w&&!w.parentId&&u.visible&&(!w.processId||this.refreshing)){var b=void 0,b=this.scroller.currentZoom<1&&"SVG"===this.mode?{tx:-a.x/this.scroller.currentZoom,ty:-a.y/this.scroller.currentZoom,scale:this.scroller.transform.scale}:{tx:this.scroller.transform.tx,ty:this.scroller.transform.ty,scale:this.scroller.transform.scale},C=(r&&(b={tx:-a.x/this.scroller.currentZoom,ty:-a.y/this.scroller.currentZoom,scale:this.scroller.transform.scale}),Jvi(this)&&(this.scroller.currentZoom<1?(m=a.x<0||this.scroller.horizontalOffset<0?(C=this.scroller.verticalOffset<0?this.scroller.verticalOffset:0,g=(0<l?l:0)+"px",(this.realActions&ayi.vScrollbarMoved?0:-C)+"px"):g="0px",this.realActions&ayi.hScrollbarMoved&&(this.realActions=this.realActions&~ayi.hScrollbarMoved),this.realActions&ayi.vScrollbarMoved&&(this.realActions=this.realActions&~ayi.vScrollbarMoved)):(g=(a.x<0?l:-this.scroller.horizontalOffset)+"px",m=(a.y<0?h:-this.scroller.verticalOffset)+"px"),this.diagramLayer.style.left=g,this.diagramLayer.style.top=m,b.tx=-a.x/b.scale,b.ty=-a.y/b.scale),o?!1:!0);if(this.updateTextElementValue(w),this.refreshing&&w.shape.activity&&w.shape.activity.subProcess&&w.shape.activity.subProcess.processes){for(var S=0;S<w.shape.activity.subProcess.processes.length;S++){var A=w.shape.activity.subProcess.processes[parseInt(S.toString(),10)];w.wrapper.children.push(this.nameTable[""+A].wrapper)}w.wrapper.measure(new Omi(w.wrapper.bounds.width,w.wrapper.bounds.height)),w.wrapper.arrange(w.wrapper.desiredSize)}w instanceof ISi&&"Bezier"===w.type?(s=this.getMidPoint(w),"Canvas"===this.mode&&n&&(s.cx+=b.tx,s.cy+=b.ty)):s=null,t.renderElement(w.wrapper,e,i,!t.isSvgMode&&n?b:void 0,void 0,void 0,C&&(!this.diagramActions||r),void 0,void 0,s,this.portCenterPoint)}}}},X.prototype.updateBridging=function(e){if(this.bridgingModule)for(var t=0;t<this.connectors.length;t++){var i,n,o=this.connectors[parseInt(t.toString(),10)],r=(this.bridgingModule.updateBridging(o,this),this.connectors[parseInt(t.toString(),10)].wrapper);r&&r.children&&0<r.children.length&&(n=(i=r.children[0]).data,(o.isBezierEditing&&this.selectedItems.connectors[0].id===o.id||"Bezier"!==o.type)&&o.getSegmentElement(o,i,"ComplexHierarchicalTree"===this.layout.type||"HierarchicalTree"===this.layout.type?this.layout.orientation:void 0,void 0,!1),i.data!==n)&&(r.measure(new Omi),r.arrange(r.desiredSize),"SVG"!==this.mode||e||this.updateDiagramObject(o))}else this.constraints&$fi.Bridging&&console.warn('[WARNING] :: Module "ConnectorBridging" is not available in Diagram component! You either misspelled the module name or forgot to load it.')},X.prototype.setCursor=function(e){this.diagramRenderer.setCursor(this.diagramCanvas,e)},X.prototype.clearCanvas=function(e){var t=e.contentWidth||e.diagramLayer.width/this.scroller.currentZoom,i=e.contentHeight||e.diagramLayer.height/this.scroller.currentZoom;"SVG"!==e.mode&&WTi.getContext(e.diagramLayer).clearRect(0,0,t,i)},X.prototype.updateScrollOffset=function(){this.scroller.setScrollOffset(this.diagramCanvas.scrollLeft,this.diagramCanvas.scrollTop),BSi(this),Jvi(this)&&this.scroller.virtualizeElements()},X.prototype.setOffset=function(e,t){var i="domTable",i=(window[i][this.element.id+"content"]||(window[i][this.element.id+"content"]=document.getElementById(this.element.id+"content")),window[i][this.element.id+"content"]);i&&(i.scrollLeft=e,i.scrollTop=t)},X.prototype.setSize=function(e,t){var i,n,o,r;this.diagramLayer&&!this.preventDiagramUpdate&&(e-=(o=LSi(this)).width,t-=o.height,(o=this.spatialSearch.getPageBounds()).x*=this.scroller.currentZoom,o.y*=this.scroller.currentZoom,o.width*=this.scroller.currentZoom,o.height*=this.scroller.currentZoom,o="SVG"===this.mode?1:1.5,n="SVG"===this.mode?ZIi(this.element.id):this.diagramLayer,i="Canvas"===this.mode&&this.constraints&$fi.Virtualization?this.scroller.viewPortWidth:e,r="Canvas"===this.mode&&this.constraints&$fi.Virtualization?this.scroller.viewPortHeight:t,n.setAttribute("width",(o*i).toString()),n.setAttribute("height",(o*r).toString()),(i=document.getElementById(this.element.id+"_diagramUserHandleLayer"))&&(i.style.width=e+"px",i.style.height=t+"px"),n={width:e.toString(),height:t.toString()},this.diagramLayerDiv.style.width=e+"px",this.diagramLayerDiv.style.height=t+"px",vTi(rTi(this.element.id),n),vTi($Ii(this.element.id).getElementsByClassName("e-ports-expand-layer")[0],n),vTi(o=tTi(this.element.id),n),o.parentNode.style.width=e+"px",o.parentNode.style.height=t+"px",vTi(r=sTi(this.element.id),n),this.diagramRenderer.updateGrid(this.snapSettings,r,this.scroller.transform,this.rulerSettings,this.hRuler,this.vRuler),vTi(aTi(this.element.id),n),this.htmlLayer.style.width=e+"px",this.htmlLayer.style.height=t+"px","SVG"===this.mode||Jvi(this)||this.refreshDiagramLayer(),"SVG"===this.mode)&&Jvi(this)&&this.scroller.virtualizeElements()},X.prototype.transformLayers=function(){var e=this.spatialSearch.getPageBounds();e.x*=this.scroller.currentZoom,e.y*=this.scroller.currentZoom,e.width*=this.scroller.currentZoom,e.height*=this.scroller.currentZoom,this.diagramRenderer.updateGrid(this.snapSettings,sTi(this.element.id),this.scroller.transform,this.rulerSettings,this.hRuler,this.vRuler),this.diagramRenderer.transformLayers(this.scroller.transform,"SVG"===this.mode),this.diagramActions&ryi.DragUsingMouse||this.updateSelector(),this.renderPageBreaks(e)},X.prototype.removePageBreaks=function(){if(this.diagramLayer){var e=lTi(this.element.id);if(e&&e.childNodes)for(var t=e.childNodes.length,i=0;i<t;i++)e.removeChild(e.childNodes[0])}},X.prototype.renderPageBreaks=function(e){this.removePageBreaks();var t=lTi(this.element.id);if(t){var i=0,n=(e=this.scroller.getPageBounds(!0),(this.scroller.transform.tx+e.x)*this.scroller.currentZoom),o=(this.scroller.transform.ty+e.y)*this.scroller.currentZoom,r=e.height*this.scroller.currentZoom,s=e.width*this.scroller.currentZoom,n=(tAi.renderSvgBackGroundImage(this.pageSettings.background,this.element,n,o,s,r),{id:t.id+"rect",x:n,y:o,height:r,width:s,angle:0,stroke:"",strokeWidth:1,fill:this.pageSettings.background.color,opacity:1,pivotX:0,pivotY:0,visible:!0,dashArray:"0"});if(this.diagramRenderer.drawRect(t,n),this.pageSettings.showPageBreaks)for(var a=this.scroller.getPageBreak(e),i=0;i<a.length;i++)this.diagramRenderer.drawLine(t,{class:"e-diagram-page-break",fill:"none",stroke:"#aaaaaa",strokeWidth:1,dashArray:"10 10",opacity:2,x:0,y:0,width:0,height:0,angle:0,pivotX:0,pivotY:0,visible:!0,startPoint:{x:(a[parseInt(i.toString(),10)].x1+this.scroller.transform.tx)*this.scroller.currentZoom,y:(a[parseInt(i.toString(),10)].y1+this.scroller.transform.ty)*this.scroller.currentZoom},endPoint:{x:(a[parseInt(i.toString(),10)].x2+this.scroller.transform.tx)*this.scroller.currentZoom,y:(a[parseInt(i.toString(),10)].y2+this.scroller.transform.ty)*this.scroller.currentZoom},id:a[parseInt(i.toString(),10)].y1===a[parseInt(i.toString(),10)].y2?"HorizontalLines":"VerticalLines"})}},X.prototype.validatePageSize=function(){var e=0;"Portrait"===this.pageSettings.orientation?this.pageSettings.width>this.pageSettings.height&&(e=this.pageSettings.height,this.pageSettings.height=this.pageSettings.width,this.pageSettings.width=e):this.pageSettings.height>this.pageSettings.width&&(e=this.pageSettings.width,this.pageSettings.width=this.pageSettings.height,this.pageSettings.height=e)},X.prototype.setOverview=function(e,t){if(e)this.views.push(e.id),(this.views[e.id]=e).renderDocument(e),e.diagramRenderer.setLayers(),e.updateView(e),this.renderNodes(e);else{for(var i=0;i<this.views.length;i++)this.views[parseInt(i.toString(),10)]===t&&(e=this.views[""+t]);this.views[""+t]=void 0;var n=this.views.indexOf(t);this.views.splice(n,1)}},X.prototype.renderNodes=function(e){var t,i,n;e&&(t=new tAi(e.id,new $Si,!1),i=document.getElementById(e.element.id+"_diagramLayer"),n=dTi(e.element.id),this.renderDiagramElements(i,e.diagramRenderer||t,n,void 0,void 0,!0))},X.prototype.updateThumbConstraints=function(e,t,i){for(var n=e.length,o=0;o<n;o++){var r=e[parseInt(o.toString(),10)],s=t.thumbsConstraints,a=!1;this.nameTable[r.parentId]&&(a=this.nameTable[r.parentId].isLane),r instanceof MIi?(a="Bpmn"===r.shape.type&&"Activity"===r.shape.shape&&!1===r.shape.activity.subProcess.collapsed||"SwimLane"===r.shape.type||a,Wvi(r)&&s&Zfi.Rotate&&!a||(s&=~Zfi.Rotate),Xvi(r,"SouthEast")&&s&Zfi.ResizeSouthEast||(s&=~Zfi.ResizeSouthEast),Xvi(r,"NorthWest")&&s&Zfi.ResizeNorthWest||(s&=~Zfi.ResizeNorthWest),Xvi(r,"East")&&s&Zfi.ResizeEast||(s&=~Zfi.ResizeEast),Xvi(r,"West")&&s&Zfi.ResizeWest||(s&=~Zfi.ResizeWest),Xvi(r,"North")&&s&Zfi.ResizeNorth||(s&=~Zfi.ResizeNorth),Xvi(r,"South")&&s&Zfi.ResizeSouth||(s&=~Zfi.ResizeSouth),Xvi(r,"NorthEast")&&s&Zfi.ResizeNorthEast||(s&=~Zfi.ResizeNorthEast),Xvi(r,"SouthWest")&&s&Zfi.ResizeSouthWest||(s&=~Zfi.ResizeSouthWest)):r instanceof ISi?(i||(s|=Zfi.Default),Hvi(r)?s|=Zfi.ConnectorSource:s&=~Zfi.ConnectorSource,zvi(r)?s|=Zfi.ConnectorTarget:s&=~Zfi.ConnectorTarget):(i||(s|=Zfi.Default),Xvi(r)||(s&=~(Zfi.ResizeSouthEast|Zfi.ResizeSouthWest|Zfi.ResizeSouth|Zfi.ResizeEast|Zfi.ResizeWest|Zfi.ResizeNorth|Zfi.ResizeNorthEast|Zfi.ResizeNorthWest)),Wvi(r)||(s&=~Zfi.Rotate)),t.thumbsConstraints=s}},X.prototype.renderSelector=function(e,t,i){var n=this.isProtectedOnChange,o=new Omi,r=this.selectedItems,s=(r.constraints,this.diagramRenderer.rendererActions);document.getElementsByClassName("blazor-inner-template");if(this.diagramRenderer.rendererActions=this.currentSymbol?this.addConstraints(s,syi.DrawSelectorBorder):this.removeConstraints(s,syi.DrawSelectorBorder),this.clearSelectorLayer(),this.commandHandler.hasSelection()){if(1===r.nodes.length&&0===r.connectors.length&&(r.rotateAngle=r.nodes[0].rotateAngle,r.pivot=r.nodes[0].pivot),r.wrapper.measure(o),r.wrapper.arrange(r.wrapper.desiredSize),r.width=r.wrapper.actualSize.width,r.height=r.wrapper.actualSize.height,r.offsetX=r.wrapper.offsetX,r.offsetY=r.wrapper.offsetY,0!==r.rotateAngle){for(var a=0,l=r.nodes;a<l.length;a++){var h=l[a];h.offsetX=h.wrapper.offsetX,h.offsetY=h.wrapper.offsetY}for(var d=0,p=r.connectors;d<p.length;d++)p[d]}this.spatialSearch.getPageBounds();var c,u,g,s=iTi(this.element.id),o=oTi(this.element.id);r.thumbsConstraints=Zfi.Default,r.annotation?this.updateThumbConstraints([r.annotation],r):(this.updateThumbConstraints(r.nodes,r),this.updateThumbConstraints(r.connectors,r,!0)),r.annotation?this.renderSelectorForAnnotation(r,s):r.nodes.length+r.connectors.length===1||this.nameTable.helper?r.nodes[0]instanceof MIi?(!pwi(this,c=r.nodes[0])||t||"UmlClassifier"===c.shape.type||c.parentId&&this.nameTable[c.parentId]&&"UmlClassifier"===this.nameTable[c.parentId].shape.type||(r.thumbsConstraints&=~Zfi.Rotate),u=!!t||!!(c.constraints&Kfi.HideThumbs),g=!!("SwimLane"===c.shape.type||c.isLane||c.isPhase||t),this.diagramRenderer.renderResizeHandle(t?i:r.wrapper.children[0],s,r.thumbsConstraints,this.scroller.currentZoom,r.constraints,this.scroller.transform,void 0,Vvi(c),u,g,r.handleSize)):r.connectors[0]instanceof ISi&&hbi(this.diagramRenderer.rendererActions)&&(t=r.connectors[0],this.diagramRenderer.renderEndPointHandle(t,s,r.thumbsConstraints,r.constraints,this.scroller.transform,void 0!==t.sourceWrapper,void 0!==t.targetWrapper,!(!this.connectorEditingToolModule||!jvi(t)),!!this.connectorEditingToolModule,r.handleSize)):this.diagramRenderer.renderResizeHandle(r.wrapper,s,r.thumbsConstraints,this.scroller.currentZoom,r.constraints,this.scroller.transform,void 0,Vvi(r),null,null,r.handleSize),r.annotation||this.currentSymbol||this.diagramRenderer.renderUserHandler(r,s,this.scroller.transform,o,this.eventHandler.currentAction,this.eventHandler.inAction)}1<this.selectedItems.selectedObjects.length&&this.updateSelectionRectangle(),this.isProtectedOnChange=n},X.prototype.updateSelectionRectangle=function(){for(var e,t=iTi(this.element.id),i=0;i<this.selectedItems.selectedObjects.length;i++)e=0===i,S1i(this.selectedItems.selectedObjects[parseInt(i.toString(),10)])===ISi?this.diagramRenderer.renderSelectionLine(this.selectedItems.selectedObjects[parseInt(i.toString(),10)].wrapper.children[0],t,this.scroller.transform,e):this.diagramRenderer.renderSelectionRectangle(this.selectedItems.selectedObjects[parseInt(i.toString(),10)].wrapper,t,this.scroller.transform,e)},X.prototype.updateSelector=function(){var e=this.allowServerDataBinding,t=(this.enableServerDataBinding(!1),new Omi),i=this.selectedItems,n=i.constraints;document.getElementsByClassName("blazor-inner-template");if(this.diagramActions&ryi.ToolAction||1!==this.selectedItems.nodes.length||(this.selectedItems.rotateAngle=this.selectedItems.nodes[0].rotateAngle,this.selectedItems.wrapper.rotateAngle=this.selectedItems.nodes[0].rotateAngle),void 0!==this.selectedItems&&(this.clearSelectorLayer(),null!==i.wrapper)&&i.wrapper.children&&i.wrapper.children.length){var o=!0,r=!0;if(O1i(this,i)&&(h=(d=this.eventHandler.action).includes("Rotate"),d=d.includes("None")||d.includes("Select")||d.includes("Drag"),(h||d)&&(r=!1),d||(o=!1)),o&&(i.wrapper.measure(t),i.wrapper.arrange(i.wrapper.desiredSize)),0!==i.rotateAngle||i.rotateAngle!==i.wrapper.prevRotateAngle)for(var s=0,a=i.nodes;s<a.length;s++){var l=a[s];l.offsetX=l.wrapper.offsetX,l.offsetY=l.wrapper.offsetY}i.width=i.wrapper.actualSize.width,i.height=i.wrapper.actualSize.height,i.offsetX=i.wrapper.offsetX,i.offsetY=i.wrapper.offsetY;var h=iTi(this.element.id),d=oTi(this.element.id),o=this.eventHandler.canHideResizers();i.thumbsConstraints=Zfi.Default,i.annotation?this.updateThumbConstraints([i.annotation],i):(this.updateThumbConstraints(i.nodes,i),this.updateThumbConstraints(i.connectors,i,!0)),this.selectedItems.constraints&Ufi.UserHandle&&!i.annotation&&!this.currentSymbol&&this.diagramRenderer.renderUserHandler(i,h,this.scroller.transform,d,this.eventHandler.currentAction,this.eventHandler.inAction),i.annotation?this.renderSelectorForAnnotation(i,h):i.nodes.length+i.connectors.length===1?i.connectors[0]instanceof ISi&&hbi(this.diagramRenderer.rendererActions)?(t=i.connectors[0],this.diagramRenderer.renderEndPointHandle(t,h,i.thumbsConstraints,n,this.scroller.transform,void 0!==t.sourceWrapper,void 0!==t.targetWrapper,!(!this.connectorEditingToolModule||!jvi(t)),!!this.connectorEditingToolModule,i.handleSize)):i.nodes[0]instanceof MIi&&(d=i.nodes[0],!pwi(this,i.nodes[0])||"UmlClassifier"===d.shape.type||d.parentId&&this.nameTable[d.parentId]&&"UmlClassifier"===this.nameTable[d.parentId].shape.type||(i.thumbsConstraints&=~Zfi.Rotate),n=!("SwimLane"!==d.shape.type&&!d.isLane&&!d.isPhase),this.diagramRenderer.renderResizeHandle(i.wrapper.children[0],h,i.thumbsConstraints,this.scroller.currentZoom,i.constraints,this.scroller.transform,o,Vvi(i.nodes[0]),!!(i.nodes[0].constraints&Kfi.HideThumbs),n,i.handleSize)):(this.diagramActions&ryi.Interactions&&(this.diagramRenderer.rendererActions=this.diagramRenderer.rendererActions|syi.PreventRenderSelector),O1i(this,i)&&r||this.diagramRenderer.renderResizeHandle(i.wrapper,h,i.thumbsConstraints,this.scroller.currentZoom,i.constraints,this.scroller.transform,o,Vvi(i),null,null,i.handleSize),this.diagramRenderer.rendererActions=this.diagramRenderer.rendererActions&~syi.PreventRenderSelector)}1<this.selectedItems.selectedObjects.length&&this.updateSelectionRectangle(),this.enableServerDataBinding(e)},X.prototype.renderSelectorForAnnotation=function(e,t){this.diagramRenderer.renderResizeHandle(e.wrapper.children[0],t,e.thumbsConstraints,this.scroller.currentZoom,e.constraints,this.scroller.transform,void 0,Vvi(e.annotation),void 0,void 0,e.handleSize)},X.prototype.drawSelectionRectangle=function(e,t,i,n){this.clearSelectorLayer(),this.diagramRenderer.drawSelectionRectangle(e,t,i,n,this.adornerLayer,this.scroller.transform)},X.prototype.renderHighlighter=function(e){var t=tTi(this.element.id);this.diagramRenderer.renderHighlighter(e,t,this.scroller.transform)},X.prototype.clearHighlighter=function(){var e=tTi(this.element.id),e=e.getElementById(e.id+"_highlighter");e&&e.parentNode.removeChild(e)},X.prototype.getNodesConnectors=function(e){for(var t=0;t<this.nodes.length;t++){var i=this.nodes[parseInt(t.toString(),10)];e.push(i)}for(t=0;t<this.connectors.length;t++){var n=this.connectors[parseInt(t.toString(),10)];e.push(n)}return e},X.prototype.clearSelectorLayer=function(){var e=tTi(this.element.id);document.getElementsByClassName("blazor-inner-template");if(this.currentSymbol){var t=e.getElementById("borderRect_symbol");t&&t.parentNode.removeChild(t)}else{var t=e.getElementById(this.adornerLayer.id+"_selected_region"),i=(t&&t.parentNode.removeChild(t),this.clearHighlighter(),iTi(this.element.id).childNodes),n=void 0,o=this.eventHandler.touchArgs?this.eventHandler.touchArgs.target.id:void 0;o&&o.includes("bezierLine")&&(o=void 0);for(var r=i.length;0<r;r--)this.eventHandler&&this.eventHandler.touchArgs&&"touchmove"===this.eventHandler.touchArgs.type&&(this.diagramRenderer.touchMove=!0,o)&&o===i[r-1].id||(n=i[r-1]).parentNode.removeChild(n);if(!N)for(var s=oTi(this.element.id).childNodes,a=s.length;0<a;a--)s[a-1].parentNode.removeChild(s[a-1])}},X.prototype.getWrapper=function(e,t){t=e.id+"_"+t;for(var i,n=e instanceof Vyi?e:this.getPortContainer(this.nameTable[e.id]),o=0;o<n.children.length;o++)t===n.children[parseInt(o.toString(),10)].id&&(i=n.children[parseInt(o.toString(),10)]);return i},X.prototype.getEndNodeWrapper=function(e,t,i){if("Bpmn"===e.shape.type&&e.wrapper.children[0]instanceof Vyi){if(N||"Activity"!==e.shape.shape)return("Group"===e.shape.shape?e.wrapper:e.wrapper.children[0]).children[0];if(i&&"Transaction"===e.shape.activity.subProcess.type&&t.sourcePortID){var n=t.sourcePortID,i=e.wrapper.children[0].children[0].children[2];if(i.children)for(var o=0,r=i.children;o<r.length;o++){var s=r[o];if(s.visible&&s.id===e.id+"_"+n)return s.children[0]}}return e.wrapper.children[0].children[0].children[0]}return this.containsMargin(e.wrapper.children[0])||e.children?e.wrapper:e.wrapper.children[0]},X.prototype.containsMargin=function(e){return e.margin&&(0!==e.margin.left||0!==e.margin.top||0!==e.margin.right||0!==e.margin.bottom)},X.prototype.focusOutEdit=function(){this.endEdit(),"Canvas"===this.mode&&1!==this.scroller.currentZoom&&this.refreshDiagramLayer()},X.prototype.endEditCommand=function(){this.endEdit(),this.textEditing=!1,"Canvas"===this.mode&&1!==this.scroller.currentZoom&&this.refreshDiagramLayer()},X.prototype.fontStyleCommand=function(e){for(var t=0;t<this.selectedItems.nodes.length;t++){var i,n=this.selectedItems.nodes[parseInt(t.toString(),10)];"SwimLane"===n.shape.type&&n.shape.hasHeader&&this.applyStyleText(e,n.shape.header.annotation),n.isLane&&(i=this.getObject(n.shape.header[0].id),this.applyStyle(e,i.annotations)),"Text"===n.shape.type&&this.applyStyleText(e,n),0<n.annotations.length&&(o=n.annotations,this.applyStyle(e,o))}for(var o,t=0;t<this.selectedItems.connectors.length;t++)0<this.selectedItems.connectors[parseInt(t.toString(),10)].annotations.length&&(o=this.selectedItems.connectors[parseInt(t.toString(),10)].annotations,this.applyStyle(e,o))},X.prototype.applyStyle=function(e,t){for(var i=0;i<t.length;i++)switch(e){case"bold":t[parseInt(i.toString(),10)].style.bold=!t[parseInt(i.toString(),10)].style.bold;break;case"italic":t[parseInt(i.toString(),10)].style.italic=!t[parseInt(i.toString(),10)].style.italic;break;case"underline":"None"===t[parseInt(i.toString(),10)].style.textDecoration?t[parseInt(i.toString(),10)].style.textDecoration="Underline":"Underline"===t[parseInt(i.toString(),10)].style.textDecoration&&(t[parseInt(i.toString(),10)].style.textDecoration="None")}this.dataBind()},X.prototype.applyStyleText=function(e,t){switch(e){case"bold":t.style.bold=!t.style.bold;break;case"italic":t.style.italic=!t.style.italic;break;case"underline":"None"===t.style.textDecoration?t.style.textDecoration="Underline":"Underline"===t.style.textDecoration&&(t.style.textDecoration="None")}this.dataBind()},X.prototype.duplicateCommand=function(){[].concat(this.selectedItems.nodes,this.selectedItems.connectors);this.copy(),this.paste()},X.prototype.groupCommand=function(e){switch(e){case"group":this.group();break;case"ungroup":this.unGroup()}},X.prototype.rotateCommand=function(e){var t=this.selectedItems;switch(e){case"clockwise":this.rotate(t,90);break;case"antiClockwise":this.rotate(t,-90)}},X.prototype.flipCommand=function(e){for(var t=(t=[]).concat(this.selectedItems.nodes,this.selectedItems.connectors),i=0;i<t.length;i++)switch(e){case"horizontal":t[parseInt(i.toString(),10)].flip=jfi.Horizontal;break;case"vertical":t[parseInt(i.toString(),10)].flip=jfi.Vertical}this.dataBind()},X.prototype.toolCommand=function(e){switch(e){case"pointer":this.tool=eyi.Default,this.dataBind();break;case"text":this.drawingObject={shape:{type:"Text"}},this.tool=eyi.DrawOnce,this.dataBind();break;case"connect":this.drawingObject={id:"connector1",type:"Straight"},this.tool=eyi.DrawOnce,this.dataBind();break;case"freeForm":this.drawingObject={id:"connector1",type:"Freehand"},this.tool=eyi.DrawOnce,this.dataBind();break;case"line":this.drawingObject={id:"connector1",type:"Polyline"},this.tool=eyi.DrawOnce,this.dataBind();break;case"rectangle":this.drawingObject={shape:{type:"Basic",shape:"Rectangle"}},this.tool=eyi.DrawOnce,this.dataBind();break;case"ellipse":this.drawingObject={shape:{type:"Basic",shape:"Ellipse"}},this.tool=eyi.DrawOnce,this.dataBind()}},X.prototype.zoomCommand=function(e){switch(e){case"zoomIn":this.zoomTo({type:"ZoomIn",zoomFactor:.2});break;case"zoomOut":this.zoomTo({type:"ZoomOut",zoomFactor:.2})}},X.prototype.shiftCommand=function(e){for(var t=0;t<this.selectedItems.nodes.length;t++)"Up"===e?this.selectedItems.nodes[parseInt(t.toString(),10)].offsetY=this.selectedItems.nodes[parseInt(t.toString(),10)].offsetY-5:"Down"===e?this.selectedItems.nodes[parseInt(t.toString(),10)].offsetY=this.selectedItems.nodes[parseInt(t.toString(),10)].offsetY+5:"Left"===e?this.selectedItems.nodes[parseInt(t.toString(),10)].offsetX=this.selectedItems.nodes[parseInt(t.toString(),10)].offsetX-5:"Right"===e&&(this.selectedItems.nodes[parseInt(t.toString(),10)].offsetX=this.selectedItems.nodes[parseInt(t.toString(),10)].offsetX+5);for(t=0;t<this.selectedItems.connectors.length;t++){var i=this.selectedItems;"Up"===e?this.drag(i,0,-5):"Down"===e?this.drag(i,0,5):"Left"===e?this.drag(i,-5,0):"Right"===e&&this.drag(i,5,0)}},X.prototype.alignCommand=function(e){if(0<this.selectedItems.nodes.length)for(var t=0;t<this.selectedItems.nodes.length;t++)this.updateNodesAndConnectorAnnotation(this.selectedItems.nodes[parseInt(t.toString(),10)],e)},X.prototype.updateNodesAndConnectorAnnotation=function(e,t){for(var i,n=0;n<e.annotations.length;n++){switch(i=e.annotations[parseInt(n.toString(),10)],t){case"left":i.horizontalAlignment="Left";break;case"center":i.horizontalAlignment="Center";break;case"right":i.horizontalAlignment="Right";break;case"justify":i.style.textAlign="Justify";break;case"top":i.verticalAlignment="Top";break;case"centerVertical":i.verticalAlignment="Center";break;case"bottom":i.verticalAlignment="Bottom"}this.dataBind()}},X.prototype.orderCommand=function(e){switch(e){case"sendToBack":this.sendToBack();break;case"bringToFront":this.bringToFront();break;case"sendBackward":this.sendBackward();break;case"bringForward":this.moveForward()}},X.prototype.navigateItems=function(e){var t=0,i=this.activeLayer.objectZIndex,n=[],o=(o=[]).concat(this.selectedItems.nodes,this.selectedItems.connectors),n=n.concat(this.nodes,this.connectors),r=((t=0<o.length?o[0].zIndex+(e?1:-1):e?0:i)<0?t=i:i<t&&(t=0),!1);do{for(var s=0;s<n.length;s++){var a=n[parseInt(s.toString(),10)];if(t===a.zIndex){this.clearSelection(),this.select([a]),r=!0;break}}}while(r||(e?t++:t--),!r)},X.prototype.endEdit=function(){return lDi(this,void 0,void 0,function(){var t,i,n,o,r,s,a,l,h,d,p,c,u,g;return hDi(this,function(e){if(this.diagramActions&ryi.TextEdit&&(c=h=void 0,r={},this.enableServerDataBinding(!1),s=document.getElementById(this.element.id+"_editBox"),!N)){if(t=s.value,E.remove(s,"input",this.eventHandler.inputChange),E.remove(s,"focusout",this.focusOutEdit),s=document.getElementById(this.element.id+"_editTextBoxDiv"),i=void 0,i=this.nameTable[this.activeLabel.parentId],n=a1i(i,this.activeLabel.id),d={oldValue:this.activeLabel.text,newValue:t,cancel:!1,element:i,annotation:n},s.parentNode.removeChild(s),o=void 0,h=!n||n instanceof fxi?{shape:{content:i.shape.content}}:(a=d1i(i,n.id,!0),r[""+a]={content:n.content},{annotations:r}),r=!1,(r="Draw"===this.eventHandler.currentAction?this.eventHandler.isAddTextNode(i,!0):r)||s.textContent===t&&t===this.activeLabel.text||this.triggerEvent(dyi.textEdit,d),o=o||this.getWrapper(i.wrapper,this.activeLabel.id),s=!1,n.content!==t&&!d.cancel&&(s=!0,this.activeLabel.isGroup||this.startGroupAction(),i.parentId&&"UmlClassifier"===this.nameTable[i.parentId].shape.type&&-1===t.indexOf("+")&&-1===t.indexOf("-")&&-1===t.indexOf("#")&&-1===t.indexOf("~")&&-1===i.id.indexOf("_umlClass_header")&&(t=" + "+t),(i.isLane||i.isPhase)&&this.protectPropertyChange(!0),c=n instanceof fxi?{shape:{content:t}}:(a=d1i(i,n.id,!0),(d={})[""+a]={content:t},{annotations:d}),(d=this.getIndex(i,i.id))&&((l={})[""+d]=h,(h={})[""+d]=c,S1i(i)===MIi?this.onPropertyChanged({nodes:h},{nodes:l}):this.onPropertyChanged({connectors:h},{connectors:l})),this.protectPropertyChange(!0),n.content=t,this.protectPropertyChange(!1),this.updateSelector(),i.isLane||i.isPhase)&&this.protectPropertyChange(!1),r&&(this.removeObjectsFromLayer(i),this.removeFromAQuad(i),delete this.nameTable[this.activeLabel.parentId],""!==t)&&(this.clearSelection(),d=DTi(i),i=this.add(d),this.updateDiagramObject(i),this.commandHandler.oldSelectedObjects=w1i(this),this.commandHandler.select(this.nameTable[i.id])),this.selectedItems.nodes.length){if(p=this.nameTable[this.activeLabel.parentId],(c=this.nameTable[p.parentId])&&"SwimLane"===c.shape.type||"SwimLane"===p.shape.type)if("SwimLane"===p.shape.type&&(c=this.nameTable[this.activeLabel.parentId],p=i),p.isLane||p.isPhase)for(u=p.isLane?c.shape.lanes:c.shape.phases,g=0;g<u.length;g++)u[parseInt(g.toString(),10)].id===(p.LaneHeaderParent||p.PhaseHeaderParent)&&(u[parseInt(g.toString(),10)].header.annotation.content=p.annotations[0].content);else p.isHeader&&c.shape.hasHeader&&(c.shape.header.annotation.content=p.annotations[0].content);this.dataBind()}o.visible=!0,this.updateDiagramObject(i),this.diagramActions=this.diagramActions&~ryi.TextEdit,(this.activeLabel.isGroup||s)&&this.endGroupAction(),this.activeLabel={id:"",parentId:"",isGroup:!1,text:void 0},this.commandHandler.getBlazorOldValues(),this.enableServerDataBinding(!0)}return[2]})})},X.prototype.getIndex=function(e,t){for(var i=S1i(e)===MIi?this.nodes:this.connectors,n=0;n<i.length;n++)if(i[parseInt(n.toString(),10)].id.toString()===t.toString())return n.toString();return null},X.prototype.canLogChange=function(){return!(!(this.diagramActions&ryi.Render)||this.diagramActions&ryi.ToolAction||this.diagramActions&ryi.UndoRedo||this.diagramActions&ryi.PublicMethod)},X.prototype.modelChanged=function(e,t){return!!(e.connectors||t.connectors||e.nodes||t.connectors||e.pageSettings||t.pageSettings||e.bridgeDirection||t.bridgeDirection)},X.prototype.resetDiagramActions=function(e){var t=!!e;this.diagramActions&ryi.UndoRedo&&(!t||e===ryi.UndoRedo)&&(this.diagramActions=this.diagramActions&~ryi.UndoRedo),this.diagramActions&ryi.PublicMethod&&(!t||e===ryi.PublicMethod)&&(this.diagramActions=this.diagramActions&~ryi.PublicMethod)},X.prototype.removeNode=function(e,t){this.removeObjectsFromLayer(e),this.removeFromAQuad(this.nameTable[e.id]);var i=document.getElementById(e.id+"_groupElement");if(delete this.nameTable[e.id],e.children&&delete this.groupTable[e.id],this.nodes.splice(this.nodes.indexOf(e),1),i&&i.children&&0<i.children.length)for(var n=void 0,o=i.children.length-1;0<=o;o--){var r=i.children[parseInt(o.toString(),10)];0<t.length&&-1!==t.indexOf(r.id.split("_groupElement")[0])&&(n?i.parentNode.insertBefore(r,n):i.parentNode.insertBefore(r,i),n=r)}i&&i.parentNode.removeChild(i)},X.prototype.deleteGroup=function(e){var t=[];e.children&&(t=this.commandHandler.getChildren(e,[])),this.UpdateBlazorDiagramModelCollection(e);for(var i=0,n=t;i<n.length;i++){var o=n[i];o&&this.nameTable[o.id]&&this.remove(o)}},X.prototype.updateObject=function(e,t,i){if(!(this.diagramActions&ryi.ToolAction)){var n=e.wrapper.children[0].bounds;if(!this.commandHandler.checkBoundaryConstraints(void 0,void 0,n,!0))if(e instanceof MIi){for(var o=t,r=0,s=Object.keys(i);r<s.length;r++)switch(h=s[r]){case"width":e.width=o.width;break;case"height":e.height=o.height;break;case"offsetX":e.offsetX=o.offsetX;break;case"offsetY":e.offsetY=o.offsetY;break;case"rotateAngle":e.rotateAngle=o.rotateAngle}this.nodePropertyChange(e,i,t)}else{for(var a=0,l=Object.keys(i);a<l.length;a++){var h=l[a],d=t,p=e.sourcePoint,c=e.targetPoint;switch(h){case"sourcePoint":p.x=d.sourcePoint.x||p.x,p.y=d.sourcePoint.y||p.y;break;case"targetPoint":c.x=d.targetPoint.x||c.x,c.y=d.targetPoint.y||c.y}}this.connectorPropertyChange(e,i,t)}}},X.prototype.nodePropertyChangeExtend=function(e,t,i,n){return void 0!==i.style&&"Bpmn"!==e.shape.type&&(UAi(i.style,e.wrapper.children[0]),n=!0),void 0!==i.shadow&&(this.updateShadow(e.shadow,i.shadow),n=!0),void 0!==i.constraints&&(t.constraints&Kfi.Select&&!(i.constraints&Kfi.Select)&&Twi(this,e)?this.clearSelection():(this.updateThumbConstraints(this.selectedItems.nodes,this.selectedItems),this.updateSelector(),n=!0)),this.updateTextAnnotationInSwimlane(e,i),this.swimLaneNodePropertyChange(e,t,i,n),n},X.prototype.updateTextAnnotationInSwimlane=function(e,t){if(e.hasTextAnnotation&&this.isPositionUndo)for(var i=0;i<e.outEdges.length;i++){var n,o,r=this.nameTable[e.outEdges[parseInt(i.toString(),10)]];r.isBpmnAnnotationConnector&&(r=this.nameTable[r.targetID],this.isProtectedOnChange=!0,e.laneMargin&&r&&(n=e.margin.left-e.laneMargin.left,o=e.margin.top-e.laneMargin.top,r.margin.left+=n,r.margin.top+=o,r.offsetX+=n,r.offsetY+=o,r.wrapper.offsetX+=n,r.wrapper.offsetY+=o,r.wrapper.measure(new Omi(r.wrapper.width,r.wrapper.height)),r.wrapper.arrange(r.wrapper.desiredSize),this.updateDiagramObject(r)),this.isProtectedOnChange=!1)}},X.prototype.swimLaneNodePropertyChange=function(e,t,i,n){if("SwimLane"===e.shape.type&&!this.currentSymbol){if(t.shape){var o=i.shape,r=e.shape,s="Horizontal"===r.orientation,a=r.padding,l=t.shape,h=e.wrapper.children[0],d=void 0,p=void 0,c=void 0;if(l.lanes||l.phases){if(l.lanes)for(var u=0,g=Object.keys(o.lanes);u<g.length;u++){var m=g[u],f=Number(m),y=l.lanes[parseInt(f.toString(),10)],m=void 0,v=o.lanes[parseInt(f.toString(),10)];if(v&&v.header&&(c=r.lanes[parseInt(f.toString(),10)].header.id,d=y.header,(p=v.header).annotation&&p.annotation.content&&(this.nameTable[""+c].annotations[0].content=p.annotation.content),p.annotation&&p.annotation.style&&(this.nameTable[""+c].annotations[0].style=p.annotation.style),p.annotation&&p.annotation.offset&&(this.nameTable[""+c].annotations[0].offset=p.annotation.offset),this.nodePropertyChange(this.nameTable[""+c],d,p)),y.children)for(var b=0,w=Object.keys(y.children);b<w.length;b++){var C=w[b],c=r.lanes[parseInt(f.toString(),10)].children[Number(C)].id,O=this.nameTable[""+c],d=y.children[Number(C)],p=v.children[Number(C)];this.nodePropertyChange(O,d,p)}y.width&&!s&&(m=r.phases&&r.phaseSize?f+1:f,h.updateColumnWidth(m,v.width,!0,a),this.updateDiagramElementQuad()),y.height&&s&&(m=r.header&&r.hasHeader?f+1:f,m+=r.phases&&r.phaseSize?1:0,h.updateRowHeight(m,v.height,!0,a),this.updateDiagramElementQuad())}if(o.phases)for(var S=0,A=Object.keys(o.phases);S<A.length;S++){var x,I=A[S],f=Number(I),I=o.phases[parseInt(f.toString(),10)],T=void 0,E=r.header&&r.hasHeader?1:0;I&&I.header&&(c=r.phases[parseInt(f.toString(),10)].header.id,d=l.phases[parseInt(f.toString(),10)].header,(p=I.header).annotation&&p.annotation.content&&(this.nameTable[""+c].annotations[0].content=p.annotation.content),p.annotation&&p.annotation.style&&(this.nameTable[""+c].annotations[0].style=p.annotation.style),p.annotation&&p.annotation.offset&&(this.nameTable[""+c].annotations[0].offset=p.annotation.offset),this.nodePropertyChange(this.nameTable[""+c],d,p)),I.offset&&((0===f||(x=r.phases[f-1],(T=I.offset-x.offset)<=0))&&(T=I.offset),s?(h.updateColumnWidth(f,T,!0,a),Wbi(e,this,h.rows[parseInt(E.toString(),10)].cells[parseInt(f.toString(),10)],f)):h.updateRowHeight(E+f,T,!0,a))}}if(void 0!==o.phaseSize&&r.phases.length)if(0===o.phaseSize||0===l.phaseSize)if(l.phaseSize)s?(h.removeRow(r.header&&r.hasHeader?1:0),e.height=e.wrapper.height=h.height):(r.header&&r.hasHeader&&(h.rows[0].cells[1].children=h.rows[0].cells[0].children,h.rows[0].cells[1].columnSpan=h.rows[0].cells[0].columnSpan-1,h.rows[0].cells[0].children=[]),h.removeColumn(0));else{s?((M=new fbi).height=o.phaseSize,h.addRow(r.header&&r.hasHeader?1:0,M,!0),e.height=e.wrapper.height+=o.phaseSize):((M=new ybi).width=o.phaseSize,h.addColumn(0,M,!0),r.header&&r.hasHeader&&(h.rows[0].cells[0].children=h.rows[0].cells[1].children,h.rows[0].cells[1].children=[],h.rows[0].cells[1].columnSpan=1,h.rows[0].cells[1].minWidth=void 0,h.rows[0].cells[0].columnSpan=r.lanes.length+1));for(var D=0;D<r.phases.length;D++)""===r.phases[parseInt(D.toString(),10)].id&&(r.phases[parseInt(D.toString(),10)].id=xTi()),Tbi(h,this,e,r.header&&r.hasHeader?1:0,s,D)}else s?h.updateRowHeight(r.header&&r.hasHeader?1:0,o.phaseSize,!1):h.updateColumnWidth(0,o.phaseSize,!1);r.header&&r.hasHeader&&l.header&&(M=h.rows[0].cells[0].children[0].id,p=o.header,d=l.header,p.annotation&&p.annotation.offset&&(this.nameTable[""+M].annotations[0].offset=p.annotation.offset),this.nodePropertyChange(this.nameTable[""+M],d,p)),e.height=e.wrapper.height=h.height,e.width=e.wrapper.width=h.width}else if(t.constraints){var M=t.constraints&Kfi.Select,k=i.constraints&Kfi.Select;if(M!=k){var o=e.shape,t=this.nameTable[e.id+o.header.id],P=(t.constraints=k?t.constraints|Kfi.Select:t.constraints&~Kfi.Select,void 0);if(0<o.phaseSize)for(var B=0;B<o.phases.length;B++)(P=this.nameTable[e.id+o.phases[parseInt(B.toString(),10)].id+"_header"]).constraints=k?P.constraints|Kfi.Select:P.constraints&~Kfi.Select;for(var F=void 0,L=void 0,N=o.phases.length||1,B=0;B<o.lanes.length;B++)for(var R=0;R<N;R++)(F=this.nameTable[e.id+o.lanes[parseInt(B.toString(),10)].id+R]).constraints=k?F.constraints|Kfi.Select:F.constraints&~Kfi.Select,0===R&&((L=this.nameTable[e.id+o.lanes[parseInt(B.toString(),10)].id+"_"+R+"_header"]).constraints=k?L.constraints|Kfi.Select:L.constraints&~Kfi.Select)}}n=!0}return n},X.prototype.insertValue=function(e,t){if(!(this.blazorActions&zfi.GroupClipboardInProcess)){for(var i=void 0,n=t?this.oldNodeObjects:this.oldConnectorObjects,o=0;o<n.length;o++)n[parseInt(o.toString(),10)].id===e.id&&(i=!0);i||(t?this.oldNodeObjects:this.oldConnectorObjects).push(e)}},X.prototype.nodePropertyChange=function(e,t,i,n,o,r){this.canEnableBlazorObject&&"helper"!==e.id&&(h=DTi(e),this.insertValue(h,!0));var s,a,l,h=e.wrapper.outerBounds,d=e.wrapper.bounds,p=!1,c=0,u=0,g=0,m=0,f=!1,y=!1,v=!1;if(void 0!==i.width&&(e.children?e.container?e.wrapper.width=i.width:this.scaleObject(e,i.width,!0):(e.wrapper.children[0].width=i.width,p=s=!0),f=!0),void 0!==i.height&&(e.children?e.container?e.wrapper.height=i.height:this.scaleObject(e,i.height,!1):(e.wrapper.children[0].height=i.height,p=s=!0),f=!0),s=this.nodePropertyChangeExtend(e,t,i,s),void 0!==i.constraints&&Qvi(t)!==Qvi(i)&&(e.wrapper.children[0].shadow=Qvi(e)?e.shadow:null),void 0!==i.offsetX&&(c=t.offsetX,u=i.offsetX,e.wrapper.flip!==jfi.None&&e.offsetX!==e.wrapper.offsetX&&void 0!==t.offsetX?(l=i.offsetX-t.offsetX,e.wrapper.offsetX=e.wrapper.offsetX+l,this.updateFlipOffset(e.wrapper,l,0,e.wrapper.flip)):e.wrapper.offsetX=i.offsetX,y=p=s=!0),void 0!==i.offsetY&&(g=t.offsetY,m=i.offsetY,e.wrapper.flip!==jfi.None&&e.offsetY!==e.wrapper.offsetY&&void 0!==t.offsetY?(l=i.offsetY-t.offsetY,e.wrapper.offsetY=e.wrapper.offsetY+l,this.updateFlipOffset(e.wrapper,0,l,e.wrapper.flip)):e.wrapper.offsetY=i.offsetY,y=p=s=!0),void 0!==i.padding&&(e.wrapper.padding.left=(void 0!==i.padding.left?i:e.wrapper).padding.left,e.wrapper.padding.right=(void 0!==i.padding.right?i:e.wrapper).padding.right,e.wrapper.padding.top=(void 0!==i.padding.top?i:e.wrapper).padding.top,e.wrapper.padding.bottom=(void 0!==i.padding.bottom?i:e.wrapper).padding.bottom,s=!0),void 0!==i.pivot&&(e.wrapper.pivot=i.pivot,s=!0),void 0!==i.minWidth&&(e.wrapper.minWidth=e.wrapper.children[0].minWidth=i.minWidth,f=p=s=!0),void 0!==i.minHeight&&(e.wrapper.minHeight=e.wrapper.children[0].minHeight=i.minHeight,f=p=s=!0),void 0!==i.maxWidth&&(e.wrapper.maxWidth=i.maxWidth,f=p=s=!0),void 0!==i.maxHeight&&(e.wrapper.maxHeight=i.maxHeight,f=p=s=!0),void 0!==i.flip&&(l=(i.flip&jfi.Horizontal^e.wrapper.flip&jfi.Horizontal)===jfi.Horizontal,a=(i.flip&jfi.Vertical^e.wrapper.flip&jfi.Vertical)===jfi.Vertical,l&&(e.wrapper.flip^=jfi.Horizontal),a&&(e.wrapper.flip^=jfi.Vertical),p=s=!0,b1i(e.wrapper,e.offsetX,e.offsetY,this,void 0,l,a),this.updateWrapperChildFlip(e)),void 0!==i.flipMode&&(l="",l=e.wrapper.flipMode=i.flipMode,p=s=!0,this.updateWrapperChildFlip(e,l)),void 0!==i.rotateAngle&&e.constraints&Kfi.Rotate&&(e.children&&o&&this.commandHandler.rotateObjects(e,[e],e.rotateAngle-e.wrapper.rotateAngle,{x:e.offsetX,y:e.offsetY},!1),e.wrapper.rotateAngle=i.rotateAngle,v=p=s=!0),void 0!==i.backgroundColor&&(e.wrapper.style.fill=i.backgroundColor),void 0!==i.visible&&this.updateElementVisibility(e.wrapper,e,e.visible),void 0!==i.shape&&"Bpmn"!==e.shape.type&&(s=!0,YAi(i,e,t,this),p=!0),i.margin&&(s=!0,this.updateMargin(e,i),y=p=!0),(void 0!==i.shape&&void 0===i.shape.type||void 0!==i.width||void 0!==i.height||void 0!==i.style)&&"Bpmn"===e.shape.type&&this.bpmnModule&&(p=s=!0,this.bpmnModule.updateBPMN(i,t,e,this)),"UmlActivity"!==e.shape.type||N||"FinalNode"!==e.shape.shape||(p=s=!0,this.updateUMLActivity(i,t,e,this)),(e.shape&&"UmlClassifier"===e.shape.type||e.parentId&&this.nameTable[e.parentId]&&"UmlClassifier"===this.nameTable[e.parentId].shape.type)&&(p=s=!0),void 0!==i.ports)for(var b=0,w=Object.keys(i.ports);b<w.length;b++){var C=w[b],S=Number(C),A=(s=!0,i.ports[""+C]),x=e.ports[parseInt(S.toString(),10)];this.updatePort(A,x,e.wrapper),e.flip===jfi.None||"Port"!==e.flipMode&&"PortAndLabel"!==e.flipMode&&"PortAndLabelText"!==e.flipMode&&"All"!==e.flipMode||this.updatePorts(e,e.flip),p=!0}if(void 0!==i.annotation||void 0!==i.annotations||void 0!==i.width)for(var I=0,T=Object.keys(i.annotations||e.annotations);I<T.length;I++){var C=T[I],S=Number(C),A=(s=!0,void 0),E=(A=i.annotation||(i.annotations?i.annotations[""+C]:e.annotations),e.annotations[parseInt(S.toString(),10)]);if(E){var O=!!e.width,E=(this.updateAnnotation(A,E,e.wrapper,e,O),this.nameTable[e.parentId]);if(E&&"SwimLane"===E.shape.type)if(e.isLane||e.isPhase)for(var D=e.isLane?E.shape.lanes:E.shape.phases,M=0;M<D.length;M++)if(D[parseInt(M.toString(),10)].id===(e.LaneHeaderParent||e.PhaseHeaderParent)){D[parseInt(M.toString(),10)].header.annotation.content=e.annotations[0].content,D[parseInt(M.toString(),10)].header.annotation.style=e.annotations[0].style;break}}}if(void 0===i.expandIcon&&void 0===i.collapseIcon&&void 0===i.isExpanded||(this.updateIcon(e),this.updateDefaultLayoutIcons(e),void 0!==i.isExpanded&&(this.canExpand=!0,this.diagramActions|=ryi.PreventIconsUpdate,this.commandHandler.expandNode(e,this),this.diagramActions=this.diagramActions&~ryi.PreventIconsUpdate),this.canExpand=!(s=!0)),void 0!==i.fixedUserHandles)for(var k,S=void 0,A=void 0,P=0,B=Object.keys(i.fixedUserHandles);P<B.length;P++){C=B[P];S=Number(C),s=!0,i.fixedUserHandles[parseInt(S.toString(),10)]&&(A=i.fixedUserHandles[parseInt(S.toString(),10)]),(k=e.fixedUserHandles[parseInt(S.toString(),10)])&&this.updateNodefixedUserHandle(A,k,e.wrapper,e)}if(void 0!==i.tooltip&&this.updateTooltip(e,i),s){if(void 0===this.bpmnModule||!y&&!f||v||this.updateBpmnAnnotationPosition(c,g,u,m,e,e.wrapper,e.shape,"TextAnnotation"===e.shape.shape,t,f,this.sizeUndo),this.checkSelectedItem(e)&&e.wrapper.children[0]instanceof Tyi&&e.wrapper.children[0].refreshTextElement(),e.wrapper.measure(new Omi(e.wrapper.bounds.width,e.wrapper.bounds.height),e.id,this.onLoadImageSize.bind(this)),e.wrapper.arrange(e.wrapper.desiredSize),this.updateObject(e,t,i),"SwimLane"!==e.shape.type||this.currentSymbol||this.diagramActions&ryi.ToolAction||(Qbi(this,e),a=e.wrapper.children[0],l=e.shape,o=a.columnDefinitions().length,"Horizontal"===l.orientation&&(S=l.header&&l.hasHeader?1:0,Wbi(e,this,a.rows[parseInt(S.toString(),10)].cells[o-1],o-1)),e.wrapper.measure(new Omi(e.wrapper.bounds.width,e.wrapper.bounds.height)),e.wrapper.arrange(e.wrapper.desiredSize)),this.diagramActions&ryi.ToolAction&&!(this.diagramActions&ryi.UndoRedo)||this.checkSelectedItem(e)&&this.updateSelector(),!1===h.equals(h,e.wrapper.outerBounds)&&(this.updateQuad(e),e.parentId)&&this.nameTable[e.parentId]&&(y=this.nameTable[e.parentId],this.updateQuad(y)),n?e&&e.visible&&e.outEdges&&this.updateIconVisibility(e,0!==e.outEdges.length):this.commandHandler.connectorSegmentChange(e,d,void 0!==i.rotateAngle),void 0!==this.bpmnModule&&this.bpmnModule.updateDocks(e,this),i.annotations&&e.processId||void 0!==i.flip||this.updateGroupOffset(e),e.parentId&&this.nameTable[e.parentId]&&((v=this.nameTable[e.parentId]).wrapper.measure(new Omi(v.wrapper.width,e.wrapper.height)),v.wrapper.arrange(v.wrapper.desiredSize),v.offsetX=v.wrapper.offsetX,v.offsetY=v.wrapper.offsetY),!1===d.equals(d,e.wrapper.bounds)&&("Drag"!==this.eventHandler.currentAction&&this.updateGroupSize(e),e.children)&&this.updateGroupOffset(e),"SwimLane"===e.shape.type&&!this.currentSymbol&&this.diagramActions&ryi.Render&&Nbi(kbi(this,e.wrapper.children[0]),this),!this.preventNodesUpdate)if((!Jvi(this)||Jvi(this)&&-1<this.scroller.oldCollectionObjects.indexOf(e.id))&&(this.diagramActions&ryi.PreventZIndexOnDragging?this.updateDiagramObject(e,!0):this.updateDiagramObject(e),e.parentId)&&"BPMN"!==(c=this.nameTable[e.parentId]).shape.type&&(this.diagramActions&ryi.PreventZIndexOnDragging?this.updateDiagramObject(c,!0):this.updateDiagramObject(c)),!n&&p&&(this.lineRoutingModule&&this.diagramActions&&this.constraints&$fi.LineRouting&&"helper"!==e.id?this.diagramActions&ryi.ToolAction||this.lineRoutingModule.renderVirtualRegion(this,!0):this.diagramActions&&this.constraints&$fi.LineRouting&&"helper"!==e.id&&console.warn('[WARNING] :: Module "LineRouting" is not available in Diagram component! You either misspelled the module name or forgot to load it.'),this.updateConnectorEdges(e),"helper"!==e.id)&&!(this.diagramActions&ryi.ToolAction))for(var F=this.spatialSearch.findObjects(e.wrapper.outerBounds),L=0;L<F.length;L++){var R=F[parseInt(L.toString(),10)];R instanceof ISi&&this.connectorPropertyChange(F[parseInt(L.toString(),10)],{},{sourceID:R.sourceID,targetID:R.targetID,sourcePortID:R.sourcePortID,targetPortID:R.targetPortID,sourcePoint:R.sourcePoint,targetPoint:R.targetPoint})}"New"!==e.status&&this.diagramActions&&(e.status="Update")}r||(g={element:e,cause:this.diagramActions,diagramAction:this.getDiagramAction(this.diagramActions),oldValue:t,newValue:i},this.triggerEvent(dyi.propertyChange,g))},X.prototype.updateWrapperChildFlip=function(e,t){if(e&&e.children&&0<e.children.length)for(var i=0;i<e.children.length;i++){var n=e.children[parseInt(i.toString(),10)],n=this.nameTable[""+n],o="";t?(o=t,n.wrapper.flipMode=o,n.flipMode=o):o=n.flipMode,"None"===o||"Label"===o||"LabelText"===o||"LabelAndLabelText"===o?this.updatePorts(n,jfi.None):this.updatePorts(n,n.wrapper.flip),this.updateWrapperFlip(n.wrapper,n)}var r;"None"===(t=e.flipMode)||"Label"===t||"LabelText"===t||"LabelAndLabelText"===t?this.updatePorts(e,jfi.None):this.updatePorts(e,e.wrapper.flip),(r=e.children?e.wrapper.children[e.wrapper.children.length-1]:e.wrapper).flip=e.wrapper.flip,r.flipMode=e.flipMode,this.updateWrapperFlip(r,e)},X.prototype.updateWrapperFlip=function(e,t){for(var i=0;i<e.children.length;i++){var n=e.children[parseInt(i.toString(),10)];n instanceof Tyi?"None"!==t.flipMode&&"Port"!==t.flipMode?(n.flip=t.wrapper.flip,n.flipMode=t.flipMode):n.flip=jfi.None:n instanceof Vyi&&this.applyWrapperCanvasFlip(n,t)}},X.prototype.getResizeHandle=function(e,t,i,n,o,r,s,a){o-=e,e=r-t,r=s-i,t=a-n;return 0==t&&(0<o&&0<r||o<0&&r<0)?"ResizeEast":0==t&&(0<o&&r<0||o<0&&0<r)?"ResizeWest":0==r&&(0<e&&t<0||e<0&&0<t)?"ResizeNorth":0==r&&(0<e&&0<t||e<0&&t<0)?"ResizeSouth":(0<o&&0<r||o<0&&r<0)&&(0<e&&0<t||e<0&&t<0)?"ResizeSouthEast":(0<o&&r<0||o<0&&0<r)&&(0<e&&0<t||e<0&&t<0)?"ResizeSouthWest":(0<o&&0<r||o<0&&r<0)&&(0<e&&t<0||e<0&&0<t)?"ResizeNorthEast":(0<o&&r<0||o<0&&0<r)&&(0<e&&t<0||e<0&&0<t)?"ResizeNorthWest":null},X.prototype.getTextAnnotationOffset=function(e,t,i,n,o){var r,s=e.width-i.width,a=e.height-i.height,t=this.getTextAnnotationQuadrant(e,t),i=this.getResizeHandle(i.offsetX,i.offsetY,i.width,i.height,e.offsetX,e.offsetY,e.width,e.height),e=0,l=0;return r=t,("ResizeEast"===i||"ResizeNorthEast"===i||"ResizeSouthEast"===i?r.includes("East"):("ResizeWest"===i||"ResizeNorthWest"===i||"ResizeSouthWest"===i)&&r.includes("West"))&&(e=i.includes("West")?-s:s),r=t,{x:n+e,y:o+(l=("ResizeSouth"===i||"ResizeSouthWest"===i||"ResizeSouthEast"===i?r.includes("South"):("ResizeNorth"===i||"ResizeNorthWest"===i||"ResizeNorthEast"===i)&&r.includes("North"))?i.includes("North")?-a:a:l)}},X.prototype.getTextAnnotationQuadrant=function(e,t){var i=e.wrapper.bounds.left,n=e.wrapper.bounds.right,o=e.wrapper.bounds.top,e=e.wrapper.bounds.bottom,r=t.wrapper.bounds.center.x,t=t.wrapper.bounds.center.y;if(i<=r&&r<=n){if(t<o)return"North";if(e<t)return"South"}if(o<=t&&t<=e){if(r<i)return"West";if(n<r)return"East"}return r<i&&t<o?"NorthWest":n<r&&t<o?"NorthEast":r<i&&e<t?"SouthWest":n<r&&e<t?"SouthEast":""},X.prototype.updateBpmnAnnotationPosition=function(e,t,i,n,o,r,s,a,l,h,d){var p,c,u=e<i?Math.abs(i-e):Math.abs(e-i),g=t<n?Math.abs(n-t):Math.abs(t-n),m=((0===u&&0===g||Number.isNaN(u)&&Number.isNaN(g))&&o.laneMargin&&(p=o.margin.left-o.laneMargin.left,c=o.margin.top-o.laneMargin.top),o.width),f=o.height,y=new tfi(0,0,0,0);if(0!==m&&0!==f&&(y=new tfi((0!==i?i:o.offsetX)-m/2,(0!==n?n:o.offsetY)-f/2,m,f)),a){var m=s,f=""!==m.textAnnotation.textAnnotationTarget&&this.nameTable[m.textAnnotation.textAnnotationTarget],a=this.selectedItems.nodes?this.selectedItems.nodes[0]:void 0,s=a&&a.shape&&"TextAnnotation"===a.shape.shape,v=(f?""===o.parentId||s?"Auto"===m.textAnnotation.textAnnotationDirection&&r.children[0]instanceof Vyi&&r.children[0].children[0]instanceof kyi&&(a=r.children[0],f=document.getElementById(a.id+"_groupElement"),s=document.getElementById(a.children[0].id+"_groupElement"),f.removeChild(s),a.children.splice(0,1),this.isProtectedOnChange=!0,this.bpmnModule.setAnnotationPath(y,a,o,m,m.textAnnotation.textAnnotationDirection,this),this.isProtectedOnChange=!1):(this.isPositionUndo=!0,this.updateTextAnnotationInSwimlane(o,o),this.isPositionUndo=!1):0<o.inEdges.length&&(r=o.inEdges[0],C=this.nameTable[""+r])&&C.isBpmnAnnotationConnector&&(C.sourcePoint={x:e<i?C.sourcePoint.x+u:C.sourcePoint.x-u,y:t<n?C.sourcePoint.y+g:C.sourcePoint.y-g}),{ports:[{offset:o.ports[0].offset}]});this.nodePropertyChange(o,{},v)}else for(var b=0,w=o.outEdges;b<w.length;b++){var C,S,A,x=w[b];(C=this.nameTable[""+x])&&C.isBpmnAnnotationConnector&&(A=(x=this.nameTable[C.targetID]).shape.textAnnotation.textAnnotationTarget,A=this.nameTable[""+A],h&&!d&&(i=(S=this.getTextAnnotationOffset(o,x,l,e,t)).x,n=S.y,u=e<i?Math.abs(i-e):Math.abs(e-i),g=t<n?Math.abs(n-t):Math.abs(t-n)),"TextAnnotation"===x.shape.shape)&&!Twi(this,x)&&Twi(this,A)&&(v=S=void 0,o.isResized?(S={margin:{left:x.margin.left,top:x.margin.top}},(A=o.resizeDif[x.id])&&(x.margin.left+=A.x,x.margin.top+=A.y,v={margin:{left:x.margin.left,top:x.margin.top}})):v=void 0!==p&&void 0!==c?x.parentId?(S={margin:{left:x.margin.left,top:x.margin.top}},x.margin.left+=p,x.margin.top+=c,{margin:{left:x.margin.left,top:x.margin.top}}):(S={offsetX:x.offsetX,offsetY:x.offsetY},x.offsetX+=p,x.offsetY+=c,{offsetX:x.offsetX,offsetY:x.offsetY}):(S={offsetX:x.offsetX,offsetY:x.offsetY},x.offsetX=e<i?x.offsetX+u:x.offsetX-u,x.offsetY=t<n?x.offsetY+g:x.offsetY-g,{offsetX:x.offsetX,offsetY:x.offsetY}),this.nodePropertyChange(x,S,v))}},X.prototype.updatePorts=function(e,t){if(e&&0<e.ports.length)for(var i=0,n=Object.keys(e.ports);i<n.length;i++){var o=n[i],o=Number(o),o=e.ports[parseInt(o.toString(),10)],r=this.getWrapper(e.wrapper,o.id);(r=x1i(r,t,o)).relativeMode="Point",void 0===e.wrapper.measureChildren&&(e.wrapper.measureChildren=!1),r.measure(new Omi(r.width,r.height)),r.arrange(r.desiredSize)}},X.prototype.updateFlipOffset=function(e,t,i,n){if(e.hasChildren())for(var o=0,r=e.children;o<r.length;o++){var s=r[o];n!==jfi.Horizontal&&n!==jfi.Both||(s.flipOffset.x=s.flipOffset.x+t),n!==jfi.Vertical&&n!==jfi.Both||(s.flipOffset.y=s.flipOffset.y+i),(s instanceof Vyi||s instanceof Syi)&&this.updateFlipOffset(s,t,i,n)}},X.prototype.updateUMLActivity=function(e,t,i,n){var o;void 0===e.width&&void 0===e.height||((o=i.wrapper.children[0].children[0]).width=e.width,o.height=e.height,(o=i.wrapper.children[0].children[1]).width=e.width/1.5,o.height=e.height/1.5)},X.prototype.updateConnectorProperties=function(e){var t;this.preventConnectorsUpdate?-1===this.selectionConnectorsList.indexOf(e)&&e&&this.selectionConnectorsList.push(e):(t={sourcePoint:e.sourcePoint,targetPoint:e.targetPoint,sourceID:e.sourceID,targetID:e.targetID,sourcePortID:e.sourcePortID,targetPortID:e.targetPortID},this.connectorPropertyChange(e,{},t,void 0,!0))},X.prototype.updateConnectorEdges=function(e){if(0<e.inEdges.length)for(var t=0;t<e.inEdges.length;t++)this.updateConnectorProperties(this.nameTable[e.inEdges[parseInt(t.toString(),10)]]);if(0<e.outEdges.length)for(var i=0;i<e.outEdges.length;i++)this.updateConnectorProperties(this.nameTable[e.outEdges[parseInt(i.toString(),10)]]);e instanceof ISi||!e.parentId||!this.nameTable[e.parentId]||this.updateConnectorEdges(this.nameTable[e.parentId])},X.prototype.connectorProprtyChangeExtend=function(e,t,i,n){return void 0!==i.type&&i.type!==t.type&&0<e.segments.length&&void 0===i.segments&&(e.segments=[]),void 0!==i.shape&&void 0!==e.shape&&e.shape&&"Bpmn"===e.shape.type&&this.bpmnModule&&this.bpmnModule.updateBPMNConnector(e,t,i,this),void 0!==e.constraints?(this.updateThumbConstraints(this.selectedItems.connectors,this.selectedItems),!0):n},X.prototype.connectorPropertyChange=function(e,t,i,n,o){this.canEnableBlazorObject&&(c=DTi(e),this.insertValue(c,!1));var r,s,a,l,h,d,p,c=e.wrapper.bounds,u=!1,g=[],u=this.connectorProprtyChangeExtend(e,t,i,u);void 0!==i.visible&&this.updateElementVisibility(e.wrapper,e,e.visible),void 0===i.sourcePoint&&void 0===i.targetPoint&&void 0===i.sourceID&&void 0===i.targetID&&void 0===i.targetPadding&&void 0===i.sourcePortID&&void 0===i.targetPortID&&void 0===i.sourcePadding&&void 0===i.type&&void 0===i.segments&&void 0===i.flip||((void 0!==i.sourceID&&i.sourceID!==t.sourceID||i.sourcePortID)&&(d=this.nameTable[e.sourceID],a=this.findInOutConnectPorts(d,!1),(!d||Gvi(d)||""!==e.sourcePortID&&Yvi(a))&&(e.sourceWrapper=d?this.getEndNodeWrapper(d,e,!0):void 0,e.sourcePortID&&void 0===i.sourcePortID&&(e.sourcePortWrapper=d?this.getWrapper(d.wrapper,e.sourcePortID):void 0),this.removePortEdges(this.nameTable[t.sourceID]||d,t.sourcePortID||e.sourcePortID,e.id,!1)),void 0!==i.sourceID&&void 0!==t.sourceID&&""!==t.sourceID&&void 0!==(l=this.nameTable[t.sourceID])&&l.outEdges&&-1!==l.outEdges.indexOf(e.id)&&e1i(l.outEdges,e.id),this.updateEdges(e)),void 0!==i.targetID&&i.targetID!==t.targetID&&(p=this.nameTable[i.targetID],h=this.findInOutConnectPorts(p,!0),(!p||Uvi(p)||""!==e.targetPortID&&qvi(h))&&(e.targetWrapper=p?this.getEndNodeWrapper(p,e,!1):void 0,e.targetPortID&&void 0===i.targetPortID&&(e.targetPortWrapper=p?this.getWrapper(p.wrapper,e.targetPortID):void 0),this.removePortEdges(this.nameTable[t.targetID]||p,t.targetPortID||e.targetPortID,e.id,!0)),void 0!==t&&void 0!==t.targetID&&""!==t.targetID&&void 0!==(l=this.nameTable[t.targetID])&&l.inEdges&&-1!==l.inEdges.indexOf(e.id)&&e1i(l.inEdges,e.id),this.updateEdges(e)),void 0!==i.sourcePortID&&i.sourcePortID!==t.sourcePortID&&(e.sourceID&&this.nameTable[e.sourceID]&&(r=this.nameTable[e.sourceID].wrapper),!(d=this.nameTable[e.sourceID])||Gvi(d)||""!==e.sourcePortID&&Yvi(a)?e.sourcePortWrapper=r?this.getWrapper(r,i.sourcePortID):void 0:""!==e.sourcePortID||Gvi(d)||(e.sourcePortWrapper=void 0)),void 0!==i.targetPortID&&i.targetPortID!==t.targetPortID&&(p=this.nameTable[e.targetID],e.targetID&&this.nameTable[e.targetID]&&(s=this.nameTable[e.targetID].wrapper),!p||Uvi(p)||""!==e.targetPortID&&qvi(h)?e.targetPortWrapper=s?this.getWrapper(s,i.targetPortID):void 0:""!==e.targetPortID||Uvi(p)||(e.targetPortWrapper=void 0)),void 0!==i.flip&&(e.flip=i.flip,A1i(e)),"Orthogonal"===e.type&&this.lineRoutingModule&&this.diagramActions&&this.constraints&$fi.LineRouting&&!(this.diagramActions&ryi.ToolAction)&&"ComplexHierarchicalTree"!==this.layout.type&&(this.lineRoutingModule.renderVirtualRegion(this,!0),e.sourceID!==e.targetID)&&1<e.segments.length&&this.lineRoutingModule.refreshConnectorSegments(this,e,!1),g=this.getPoints(e)),void 0!==i.style&&UAi(i.style,e.wrapper.children[0]),(0<g.length||void 0!==i.sourceDecorator||void 0!==i.targetDecorator&&B1i(Object.keys(i.targetDecorator))||void 0!==i.cornerRadius)&&(t1i(e,0<g.length?g:e.intermediatePoints,this.diagramActions),void 0!==i.type&&(u=!0),0<g.length)&&(e.wrapper.measure(new Omi(e.wrapper.width,e.wrapper.height)),e.wrapper.arrange(e.wrapper.desiredSize),this.updateConnectorAnnotation(e),this.updateConnectorPort(e),this.updateConnectorfixedUserHandles(e),this.updateObject(e,t,i)),(i.sourcePoint||i.targetPoint||i.segments)&&this.diagramActions===ryi.Render&&(u=!0),"Bpmn"===e.shape.type&&"Default"===e.shape.sequence&&"Sequence"===e.shape.flow&&this.commandHandler.updatePathElementOffset(e),n||this.updateBridging(),this.updateAnnotations(i,e),this.updateConnectorPorts(i,e),this.updatefixedUserHandle(i,e),e.wrapper.measure(new Omi(e.wrapper.width,e.wrapper.height)),e.wrapper.arrange(e.wrapper.desiredSize),!1===c.equals(c,e.wrapper.bounds)&&(this.updateQuad(e),"Drag"!==this.eventHandler.currentAction)&&this.updateGroupSize(e),!0!==u||!this.checkSelectedItem(e)||this.diagramActions&ryi.ToolAction&&!(this.diagramActions&ryi.UndoRedo)||this.updateSelector(),this.preventConnectorsUpdate||(!Jvi(this)||Jvi(this)&&-1<this.scroller.oldCollectionObjects.indexOf(e.id))&&(this.diagramActions&ryi.PreventZIndexOnDragging?this.updateDiagramObject(e,!0):this.updateDiagramObject(e)),this.updateConnectorEdges(e),this.diagramActions&&"New"!==e.status&&(e.status="Update"),this.triggerPropertyChange(o,e,t,i)},X.prototype.removePortEdges=function(e,t,i,n){if(e)for(var o=0;o<e.ports.length;o++){var r=e.ports[parseInt(o.toString(),10)];r.id===t&&e1i(n?r.inEdges:r.outEdges,i)}},X.prototype.updateConnectorPorts=function(e,t){if(void 0!==e.ports)for(var i=0,n=Object.keys(e.ports);i<n.length;i++){var o=n[i],r=Number(o),o=e.ports[""+o],r=t.ports[parseInt(r.toString(),10)];this.updatePort(o,r,t.wrapper,t)}},X.prototype.triggerPropertyChange=function(e,t,i,n){e||(e={element:t,cause:this.diagramActions,diagramAction:this.getDiagramAction(this.diagramActions),oldValue:i,newValue:n},this.triggerEvent(dyi.propertyChange,e))},X.prototype.findInOutConnectPorts=function(e,t){var i={};return i=e?h1i(e,t):i},X.prototype.getPoints=function(e,t){var i=!(!this.lineDistributionModule||"DifferentPoint"!==this.layout.connectionPointOrigin);return e.getConnectorPoints(e.type,t,"ComplexHierarchicalTree"===this.layout.type||"HierarchicalTree"===this.layout.type?this.layout.orientation:void 0,i)},X.prototype.updateNodeProperty=function(e,t,i){if(void 0===t)this.updateElementVisibility(e,this.nameTable[e.id],t);else{e.style.opacity=i;for(var n=0;n<e.children.length;n++)e.children[parseInt(n.toString(),10)]instanceof Syi&&this.updateNodeProperty(e.children[parseInt(n.toString(),10)],void 0,i),e.children[parseInt(n.toString(),10)].style.opacity=i}},X.prototype.checkSelectedItem=function(e){var t=this.selectedItems,i=!1,n=[];return i=0<(n=n.concat(t.nodes,t.connectors)).length&&e.id===n[n.length-1].id?!0:i},X.prototype.updateDiagramContainerVisibility=function(e,t){if(e instanceof Syi)for(var i=0;i<e.children.length;i++)this.updateDiagramContainerVisibility(e.children[parseInt(i.toString(),10)],t);e.visible=t},X.prototype.updateElementVisibility=function(e,t,i){if(void 0!==i){if(e.visible=i,t instanceof MIi){if(t.children)for(var n=0,o=t.children;n<o.length;n++){var r=o[n];this.updateElementVisibility(this.nameTable[""+r].wrapper,this.nameTable[""+r],i)}else e.children[0].visible=i,this.updateDiagramContainerVisibility(e.children[0],i),"Bpmn"===t.shape.type&&this.bpmnModule&&this.bpmnModule.updateElementVisibility(t,i,this);var s,a;if("Bpmn"===t.shape.type&&"TextAnnotation"===t.shape.shape&&this.diagramActions&&(a=(s=this.nameTable[t.inEdges[0]]).visible,s.visible=i,this.connectorPropertyChange(s,{visible:a},{visible:i})),t.ports)for(var l=0,h=t.ports;l<h.length;l++){var d=h[l];d.visibility&Wfi.Visible&&((y=this.getWrapper(e,d.id)).visible=i)}if(t.annotations)for(var p=0,c=t.annotations;p<c.length;p++){var u=c[p];(y=this.getWrapper(e,u.id)).visible=i&&"Visible"===y.annotationVisibility}}else if("Bpmn"===t.shape.type)for(var g=0;g<4;g++)e.children[parseInt(g.toString(),10)].visible=i;else for(g=0;g<3;g++)e.children[parseInt(g.toString(),10)].visible=i;if(t.annotations)for(var m=0,f=t.annotations;m<f.length;m++){u=f[m];(y=this.getWrapper(e,u.id)).visible=i&&"Visible"===y.annotationVisibility}if(t.expandIcon||t.collapseIcon){var y;if(y=this.getWrapper(e,"icon_content")){for(g=0;g<y.children.length;g++)y.children[parseInt(g.toString(),10)].visible=i;y.visible=i}t&&t.visible&&t.outEdges&&this.updateIconVisibility(t,0!==t.outEdges.length)}!1===i&&this.unSelect(this.nameTable[e.id]),(t instanceof MIi&&!this.preventNodesUpdate||t instanceof ISi&&!this.preventConnectorsUpdate)&&this.diagramActions&&this.updateDiagramObject(this.nameTable[e.id],void 0,!0)}},X.prototype.updateAnnotations=function(e,t){if(void 0!==e.annotations)for(var i=0,n=Object.keys(e.annotations);i<n.length;i++){var o=n[i],r=Number(o),o=e.annotations[""+o],r=t.annotations[parseInt(r.toString(),10)];this.updateAnnotation(o,r,t.wrapper,t)}},X.prototype.updatefixedUserHandle=function(e,t){if(void 0!==e.fixedUserHandles)for(var i=void 0,n=0,o=Object.keys(e.fixedUserHandles);n<o.length;n++){var r=o[n],i=Number(r),r=e.fixedUserHandles[""+r],s=t.fixedUserHandles[parseInt(i.toString(),10)];this.updateConnectorfixedUserHandle(r,s,t.wrapper,t)}},X.prototype.updateConnectorfixedUserHandle=function(e,t,i,n,o){var r=!1,s=this.getWrapper(i,t.id);void 0!==s&&(void 0!==e.width&&(s.width=e.width,r=!0),void 0!==e.height&&(s.height=e.height,r=!0),t instanceof Rvi&&void 0!==e.offset&&n.updateAnnotation(t,n.intermediatePoints,n.wrapper.bounds,s),t instanceof Rvi&&e.displacement&&(void 0===e.displacement.x&&void 0===e.displacement.y||(r=!0)),void 0!==e.fill&&(s.style.fill=e.fill),void 0!==e.handleStrokeColor&&(s.style.strokeColor=e.handleStrokeColor),void 0!==e.handleStrokeWidth&&(s.style.strokeWidth=e.handleStrokeWidth),void 0!==e.visibility&&(s.visible=e.visibility),void 0!==e.cornerRadius&&(s.cornerRadius=e.cornerRadius),this.updatefixedUserHandleContent(e,r,s,n,t,i),!0===r)&&(s.measure(new Omi(s.width,s.height)),s.arrange(s.desiredSize))},X.prototype.updateAnnotation=function(e,t,i,n,o){var r,s,a=!1,l=this.getWrapper(i,t.id);void 0!==l&&(void 0!==e.width&&void 0!==e.height&&(l.width=e.width,l.height=e.height,a=!0),void 0!==e.rotateAngle&&(l.rotateAngle=e.rotateAngle),!o||l instanceof Tvi||l.refreshTextElement(),t instanceof b0i&&void 0!==e.segmentAngle&&(l.rotateAngle=t.rotateAngle),void 0!==e.rotationReference&&(l.rotationReference=e.rotationReference),t instanceof f0i&&void 0!==e.offset?(a=!0,r=(void 0!==(s=e.offset).x?s:t.offset).x,s=(void 0!==s.y?s:t.offset).y,l.setOffsetWithRespectToBounds(r,s,"Fraction"),l.relativeMode="Point"):t instanceof b0i&&(void 0!==e.offset||void 0!==e.segmentAngle||void 0!==e.alignment)&&n.updateAnnotation(t,n.intermediatePoints,n.wrapper.bounds,l),t instanceof b0i&&e.displacement&&(void 0===e.displacement.x&&void 0===e.displacement.y||(a=!0,n.updateAnnotation(t,n.intermediatePoints,n.wrapper.bounds,l))),void 0!==e.margin&&(a=!0,void 0!==e.margin.bottom&&(l.margin.bottom=e.margin.bottom),void 0!==e.margin.top&&(l.margin.top=e.margin.top),void 0!==e.margin.left&&(l.margin.left=e.margin.left),void 0!==e.margin.right)&&(l.margin.right=e.margin.right),(a||o)&&(l.width=t.width||n.width,t.template)&&(l.width=l.width||l.actualSize.width,l.height=t.height||n.height||l.actualSize.height),void 0!==e.horizontalAlignment&&(l.horizontalAlignment=e.horizontalAlignment,a=!0),void 0!==e.verticalAlignment&&(l.verticalAlignment=e.verticalAlignment,a=!0),void 0!==e.visibility&&(l.visible=!(!i.visible||!e.visibility),l.annotationVisibility=l.visible?"Visible":"Collapsed"),void 0!==e.constraints&&(l.constraints&Xfi.Select&&!(e.constraints&Xfi.Select)&&Twi(this,n,!1,l),l.constraints=e.constraints),void 0!==e.style&&UAi(e.style,l),void 0!==e.hyperlink&&qAi(e.hyperlink,l,t),this.updateAnnotationContent(e,a,l,n,t,i),!0===a&&(l.measure(new Omi(l.width,l.height)),l.arrange(l.desiredSize)),l instanceof Tvi||l.refreshTextElement())},X.prototype.updatefixedUserHandleContent=function(e,t,i,n,o,r){void 0!==e&&this.updateConnectorfixedUserHandleWrapper(i,n,o,r)},X.prototype.updateConnectorfixedUserHandleWrapper=function(e,t,i,n){for(var o,r=0,s=this.views;r<s.length;r++){var a=s[r];fTi(e.id+"_groupElement",a),fTi(e.id+"_html_element",a)}t instanceof ISi&&(o=t.wrapper.children[0],o=new tfi(o.offsetX-o.width/2,o.offsetY-o.height/2,o.width,o.height),e=t.getFixedUserHandle(t.fixedUserHandles[t.fixedUserHandles.length-1],t.intermediatePoints,o,void 0,void 0));for(var l=0;l<n.children.length;l++)e.id===n.children[parseInt(l.toString(),10)].id&&n.children.splice(l,1,e)},X.prototype.updateAnnotationContent=function(e,t,i,n,o,r){void 0!==e.content&&(i&&("UmlActivity"!==n.shape.type||N||"StructuredNode"!==n.shape.shape?i.content=e.content:i.content="<<"+e.content+">>"),i instanceof Tvi)&&this.updateAnnotationWrapper(i,n,o,r),void 0!==e.template&&(i.content=e.template,this.updateAnnotationWrapper(i,n,o,r))},X.prototype.updateAnnotationWrapper=function(e,t,i,n){for(var o=0,r=this.views;o<r.length;o++){var s=r[o];fTi(e.id+"_groupElement",s),fTi(e.id+"_html_element",s)}t instanceof MIi?e=t.initAnnotationWrapper(i,this.element.id):t instanceof ISi&&(i=t.wrapper.children[0],i=new tfi(i.offsetX-i.width/2,i.offsetY-i.height/2,i.width,i.height),e=t.getAnnotationElement(t.annotations[t.annotations.length-1],t.intermediatePoints,i,this.getDescription,this.element.id));for(var a=0;a<n.children.length;a++)e.id===n.children[parseInt(a.toString(),10)].id&&n.children.splice(a,1,e)},X.prototype.updateNodefixedUserHandle=function(e,t,i,n){var o,r,s=!1,a=this.getWrapper(i,t.id);void 0!==a&&(void 0!==e.width&&(a.actualSize.width=e.width,s=!0),void 0!==e.height&&(a.height=e.height,s=!0),t instanceof Bvi&&void 0!==e.offset&&(s=!0,o=(void 0!==(r=e.offset).x?r:t.offset).x,r=(void 0!==r.y?r:t.offset).y,a.setOffsetWithRespectToBounds(o,r,"Fraction"),a.relativeMode="Point"),void 0!==e.margin&&(s=!0,void 0!==e.margin.bottom&&(a.margin.bottom=e.margin.bottom),void 0!==e.margin.top&&(a.margin.top=e.margin.top),void 0!==e.margin.left&&(a.margin.left=e.margin.left),void 0!==e.margin.right)&&(a.margin.right=e.margin.right),void 0!==e.visibility&&(a.visible=e.visibility),void 0!==e.fill&&(a.style.fill=e.fill),void 0!==e.handleStrokeColor&&(a.style.strokeColor=e.handleStrokeColor),void 0!==e.handleStrokeWidth&&(a.style.strokeWidth=e.handleStrokeWidth),void 0!==e.cornerRadius&&(a.cornerRadius=e.cornerRadius),this.updatefixedUserHandleWrapper(a,n,t,i),!0===s)&&(a.measure(new Omi(a.width,a.height)),a.arrange(a.desiredSize))},X.prototype.updatefixedUserHandleWrapper=function(e,t,i,n){for(var o=0,r=this.views;o<r.length;o++){var s=r[o];fTi(e.id+"_groupElement",s),fTi(e.id+"_html_element",s)}t instanceof MIi&&(e=t.initFixedUserHandles(i,void 0,void 0));for(var a=0;a<n.children.length;a++)e.id===n.children[parseInt(a.toString(),10)].id&&n.children.splice(a,1,e)},X.prototype.updatePort=function(e,t,i,n){var o,r=!1,s=this.getWrapper(i,t.id);void 0!==s&&(void 0!==e.offset&&(r=!0,n?void 0!==e.offset&&n.updateAnnotation(t,n.intermediatePoints,n.wrapper.bounds,s):(n=(void 0!==e.offset.x?e:t).offset.x,o=(void 0!==e.offset.y?e:t).offset.y,s.setOffsetWithRespectToBounds(n,o,"Fraction"),s.relativeMode="Point")),void 0!==e.width&&(r=!0,s.width=e.width),void 0!==e.height&&(r=!0,s.height=e.height),void 0!==e.connectionDirection&&(s.connectionDirection=e.connectionDirection),void 0!==e.visibility&&(s.visible=!(!i.visible||!s1i(t,Wfi.Visible))),void 0!==e.margin&&(r=!0,void 0!==e.margin.bottom&&(s.margin.bottom=e.margin.bottom),void 0!==e.margin.top&&(s.margin.top=e.margin.top),void 0!==e.margin.right&&(s.margin.right=e.margin.right),void 0!==e.margin.left)&&(s.margin.left=e.margin.left),void 0!==e.horizontalAlignment&&(r=!0,s.horizontalAlignment=e.horizontalAlignment),void 0!==e.verticalAlignment&&(r=!0,s.verticalAlignment=e.verticalAlignment),void 0!==e.style&&(void 0!==e.style.fill&&(s.style.fill=e.style.fill),void 0!==e.style.opacity&&(s.style.opacity=e.style.opacity),void 0!==e.style.strokeColor&&(s.style.strokeColor=e.style.strokeColor),void 0!==e.style.strokeWidth&&(s.style.strokeWidth=e.style.strokeWidth),void 0!==e.style.strokeDashArray)&&(s.style.strokeDashArray=e.style.strokeDashArray),void 0!==e.shape&&s&&(n=C0i(e.shape),s.data=n,s.canMeasurePath=!0),void 0!==e.pathData&&(s.data=String(e.pathData),r=!0),!0===r)&&(s.measure(new Omi(s.width,s.height)),s.arrange(s.desiredSize))},X.prototype.updateIcon=function(e){var t,i,n=this.getWrapper(e.wrapper,"icon_content"),o=this.diagramActions&ryi.Render?this.element.id:void 0,r=(n&&("SVG"===this.mode&&(t=$Ii(e.wrapper.id+"_icon_content",o))&&(i=$Ii(t.id+"_rect",o),r=$Ii(t.id+"_shape",o),(o=$Ii(r.id+"_native_element",o))&&o.parentNode.removeChild(o),r.parentNode.removeChild(r),i.parentNode.removeChild(i),t.parentNode.removeChild(t)),o=e.wrapper.children.indexOf(n),e.wrapper.children.splice(o,1)),this.getPortContainer(e));e.initIcons(this.getDescription,this.layout,r,this.element.id)},X.prototype.getPortContainer=function(e){if(e.children)for(var t=0;t<e.wrapper.children.length;t++)if(e.wrapper.children[parseInt(t.toString(),10)].id===e.id+"group_container")return e.wrapper.children[parseInt(t.toString(),10)];return e.wrapper},X.prototype.updateTooltip=function(e,t){void 0!==t.tooltip.content&&(e.tooltip.content=t.tooltip.content),void 0!==t.tooltip.position&&(e.tooltip.position=t.tooltip.position),void 0!==t.tooltip.height&&(e.tooltip.height=t.tooltip.height),void 0!==t.tooltip.width&&(e.tooltip.width=t.tooltip.width),void 0!==t.tooltip.showTipPointer&&(e.tooltip.showTipPointer=t.tooltip.showTipPointer),void 0!==t.tooltip.relativeMode&&(e.tooltip.relativeMode=t.tooltip.relativeMode)},X.prototype.updateQuad=function(e){this.spatialSearch.updateQuad(e.wrapper)&&!this.preventDiagramUpdate&&this.updatePage()},X.prototype.removeFromAQuad=function(e){if(e.children)for(var t,i=e.children,n=0;n<i.length;n++)(t=this.nameTable[i[parseInt(n.toString(),10)]])&&this.removeFromAQuad(t);this.spatialSearch.removeFromAQuad(e.wrapper);var o="SwimLane"===e.shape.type;this.spatialSearch.updateBounds(e.wrapper,o)&&!this.preventDiagramUpdate&&this.updatePage()},X.prototype.updateGroupSize=function(e){e.parentId&&(e=this.nameTable[e.parentId])&&(e.parentId?this.updateGroupSize(e):(e.wrapper.measure(new Omi),e.wrapper.arrange(e.wrapper.desiredSize),this.updateGroupOffset(e),this.updateDiagramObject(e)))},X.prototype.updatePage=function(){if(this.diagramActions&ryi.Render&&!(this.diagramActions&ryi.DragUsingMouse)){this.scroller.updateScrollOffsets(),this.scroller.setSize();for(var e=0,t=this.views;e<t.length;e++){var i=t[e],i=this.views[""+i];i instanceof X||i.updateView(i)}}this.diagramActions&ryi.DragUsingMouse&&(this.renderPageBreaks(),this.pageSettings.width&&this.pageSettings.height&&!this.pageSettings.multiplePage||(this.scroller.updateScrollOffsets(),this.scroller.setSize()))},X.prototype.protectPropertyChange=function(e){this.isProtectedOnChange=e},X.prototype.getProtectPropertyChangeValue=function(){return this.isProtectedOnChange},X.prototype.enableServerDataBinding=function(e){},X.prototype.updateShadow=function(e,t){void 0!==t.angle&&(e.angle=t.angle),void 0!==t.color&&(e.color=t.color),void 0!==t.distance&&(e.distance=t.distance),void 0!==t.opacity&&(e.opacity=t.opacity)},X.prototype.updateMargin=function(e,t){void 0!==t.margin.top&&(e.margin.top=t.margin.top),void 0!==t.margin.bottom&&(e.margin.bottom=t.margin.bottom),void 0!==t.margin.left&&(e.margin.left=t.margin.left),void 0!==t.margin.right&&(e.margin.right=t.margin.right)},X.prototype.removePreviewChildren=function(e){if(e.children&&e.children.length&&e.shape&&"SwimLane"===e.shape.type){for(var t=0;t<e.children.length;t++){var i=e.children[parseInt(t.toString(),10)],n=this.nodes.indexOf(this.nameTable[""+i]);0<=n&&this.nodes.splice(n,1),delete this.nameTable[""+i]}var o=this.nodes.indexOf(this.nameTable[this.currentSymbol.id]);0<=o&&this.nodes.splice(o,1)}},X.prototype.selectDragedNode=function(e,t,i){this.currentSymbol=e,"SVG"!==this.mode&&this.refreshDiagramLayer(),this.commandHandler.oldSelectedObjects=w1i(this),this.commandHandler.select(e),this.eventHandler.mouseDown(t.event),this.eventHandler.mouseMove(t.event,t),this.preventDiagramUpdate=!1,this.updatePage(),i.style.opacity="0"},X.prototype.initDroppables=function(){var f,y,v,b=this,w={},C="selectedSymbols",S=(this.droppable=new un(this.element),5);this.droppable.over=function(e){if(b.rulerSettings.showRulers&&(t=document.getElementById(b.element.id+"_vRuler"),t=parseFloat(t.style.width),S=t+1),0!==b.previousSelectedObjects.length||b.currentSymbol||(b.previousSelectedObjects=b.commandHandler.getSelectedObject()),b.commandHandler.PreventConnectorSplit=!0,b.currentSymbol)e.event.touches&&e.event.touches.length&&b.eventHandler.mouseMove(e.event,e.event.touches);else{var t=null;if(e.dragData||"drag"!==e.name||(i=document.getElementsByClassName("e-dragclone")[0])&&(t=i),e.dragData||t){var i=void 0,n=void 0,o=(document.getElementById(b.element.id+"content").focus(),b.eventHandler.getMousePosition(e.event)),r=void 0,t=t||e.dragData.helper,s=t.getAttribute("paletteId"),a=void 0,l=void 0,h=void 0;if(!s&&e.dragData&&(g={source:null,element:i,cancel:!1,diagram:b,dragData:e.dragData.draggedElement.ej2_instances[0].dragData,dragItem:i},p=void b.triggerEvent(dyi.dragEnter,g),c=void 0,g.dragItem)&&(g.dragItem.sourcePoint&&g.dragItem.targetPoint?c=new ISi(b,"connectors",g.dragItem,!0):p=new MIi(b,"nodes",g.dragItem,!0),b.initObject(i=p||c,void 0,void 0,!0),b.enterObject=i,b.enterTable=w,i instanceof MIi?(p.offsetX=o.x+5+p.width*p.pivot.x,p.offsetY=o.y+p.height*p.pivot.y):i instanceof ISi&&(c=tfi.toBounds([i.sourcePoint,i.targetPoint]),d=o.x-c.left,c=o.y-c.top,i.sourcePoint.x+=d,i.sourcePoint.y+=c,i.targetPoint.x+=d,i.targetPoint.y+=c),b.preventDiagramUpdate=!0,b.currentSymbol=i,"SVG"!==b.mode&&b.refreshDiagramLayer(),b.selectDragedNode(i,e,t),delete b.enterObject,delete b.enterTable,b.droppable[C]=t,b.allowServerDataBinding=!0),s){var d=document.getElementById(s).ej2_instances[0];if(b.droppable.sourceElement=d){var p,c=d[C],s=(b.allowServerDataBinding=!1,r=DTi(d[C]),f=d.childTable,c.wrapper.children[0].children[0]),u=F1i(d,r,s),g=(d[C]instanceof MIi?("TextAnnotation"===c.shape.shape?(r.offsetX=o.x+11+u.width*r.pivot.x,r.offsetY=o.y+11+u.height*r.pivot.y):(r.offsetX=o.x+5+u.width*r.pivot.x,r.offsetY=o.y+u.height*r.pivot.y),"Bpmn"===(p=new MIi(b,"nodes",r,!0)).shape.type&&p.shape.activity.subProcess.processes&&p.shape.activity.subProcess.processes.length&&(p.shape.activity.subProcess.processes=[]),a=p.dragSize,l=p.previewSize,h=d.symbolDragSize,c=d.symbolPreview,p.width=a.width||h.width||l.width||c.width||p.width,p.height=a.height||h.height||l.height||c.height||p.height,"SwimLane"===p.shape.type&&(b.diagramActions|=ryi.PreventHistory,p.shape.isLane&&(p.children=[],y={id:"header"+xTi()},"Horizontal"===p.shape.orientation?(y.width=p.shape.lanes[0].header.width,y.height=p.shape.lanes[0].height):(y.width=p.shape.lanes[0].width,y.height=p.shape.lanes[0].header.height),y.style=p.shape.lanes[0].header.style,y.offsetX=o.x+S+y.width/2,y.offsetY=o.y+y.height/2,b.diagramActions|=ryi.PreventCollectionChangeOnDragOver,y=b.add(y),v={id:"body"+xTi()},"Horizontal"===p.shape.orientation?(v.width=p.shape.lanes[0].width-y.width,v.height=p.shape.lanes[0].height,v.offsetX=o.x+S+(p.shape.lanes[0].header.width+v.width/2),v.offsetY=o.y+v.height/2):(v.width=p.shape.lanes[0].width,v.height=p.shape.lanes[0].height-y.height,v.offsetX=o.x+S+v.width/2,v.offsetY=o.y+(p.shape.lanes[0].header.height+v.height/2)),v.style=p.shape.lanes[0].style,v=b.add(v),(u={id:"group"+xTi(),children:[y.id,v.id]}).shape=p.shape,u.width=p.shape.lanes[0].width,u.height=p.shape.lanes[0].height,u.previewSize=p.previewSize,u.dragSize=p.dragSize,u.addInfo=p.addInfo,p=b.add(u),b.diagramActions&=~ryi.PreventCollectionChangeOnDragOver),b.diagramActions&=~ryi.PreventHistory),p.shape.isPhase&&((n="Horizontal"===p.shape.orientation)?(p.offsetX=o.x+S+(p.width||s.actualSize.width)/2,p.offsetY=o.y,p.shape.data="M20,"+p.height/2+" L"+(p.width-20)+","+p.height/2+"z",p.height=1):(p.offsetX=o.x+5,p.offsetY=o.y+(p.height||s.actualSize.height)/2,p.shape.data="M"+p.width/2+",20 L"+p.width/2+","+(p.height-20)+"z",p.width=1)),"UmlClassifier"===p.shape.type&&(p.children=p.width=p.height=void 0,r.children=void 0,"Class"===p.shape.classifier&&p.shape.classShape.methods.length<=0&&p.shape.classShape.attributes.length<=0&&(p.shape.classShape.attributes=[{name:"Name",type:"Type",style:{}}]),"Enumeration"===p.shape.classifier&&p.shape.enumerationShape.members.length<=0&&(p.shape.enumerationShape.members=[{name:"Name"}]),"Interface"===p.shape.classifier)&&p.shape.interfaceShape.methods.length<=0&&p.shape.interfaceShape.attributes.length<=0&&(p.shape.interfaceShape.attributes=[{name:"Name",type:"Type",style:{}}]),i=p,r.children&&(c=r,w=b.getChildren(c,{},f),g1i(c,-c.offsetX,-c.offsetY,w,!0,b))):d[C]instanceof ISi&&(i=new ISi(b,"connectors",r,!0),u=tfi.toBounds([i.sourcePoint,i.targetPoint]),s=o.x-u.left,p=o.y-u.top,i.sourcePoint.x+=s,i.sourcePoint.y+=p,i.targetPoint.x+=s,i.targetPoint.y+=p),i.shape.isLane||(i.id+=xTi()),{source:d,element:i,cancel:!1,diagram:b,dragData:null,dragItem:i});if(b.enterObject=i,b.enterTable=w,b.triggerEvent(dyi.dragEnter,g),i instanceof MIi&&"SwimLane"===i.shape.type&&i.shape.isLane&&(r=(c=g.element).shape.lanes[0],n="Horizontal"===c.shape.orientation,u=b.nameTable[i.children[0]],s=b.nameTable[i.children[1]],a=i.dragSize,l=i.previewSize,h=d.symbolDragSize,r.width=a.width||h.width||l.width||r.width,r.height=a.height||h.height||l.height||r.height,n?(y.width=r.header.width,y.height=r.height,v.width=r.width-y.width,v.height=r.height,v.offsetX=o.x+S+(r.header.width+s.width/2),v.offsetY=o.y+s.height/2):(y.width=r.width,y.height=r.header.height,v.width=r.width,v.height=r.height-y.height,v.offsetX=o.x+S+s.width/2,v.offsetY=o.y+(r.header.height+s.height/2)),y.offsetX=o.x+S+u.width/2,y.offsetY=o.y+u.height/2,i.width=r.width,i.height=r.height),i instanceof MIi&&i.shape.isPhase&&(n?i.height=1:i.width=1),!b.activeLayer.lock&&!g.cancel){if(b.preventDiagramUpdate=!0,i.children&&b.findChild(i,w),b.preventDiagramUpdate=!0,i.zIndex!==Number.MIN_VALUE&&(i.zIndex=Number.MIN_VALUE),b.initObject(i,void 0,void 0,!0),b.bpmnModule)for(var m=0;m<b.bpmnModule.bpmnTextAnnotationConnector.length;m++)null===b.bpmnModule.bpmnTextAnnotationConnector[parseInt(m.toString(),10)].wrapper&&b.initConnectors(b.bpmnModule.bpmnTextAnnotationConnector[parseInt(m.toString(),10)],void 0,!0);b.selectDragedNode(i,e,t)}delete b.enterObject,delete b.enterTable}b.droppable[C]=t,b.allowServerDataBinding=!0}}}},this.droppable.drop=function(c){return lDi(b,void 0,void 0,function(){var t,i,n,o,r,s,a,l,h,d,p;return hDi(this,function(e){if(this.allowServerDataBinding=!1,t="sourceElement",this.currentSymbol?(h=!1,o=this.currentSymbol instanceof ISi,c.event.touches&&this.eventHandler.mouseUp(c.event),s={source:this.droppable[t],element:this.currentSymbol,target:this.eventHandler.hoverNode||this.findObjectsUnderMouse(this.eventHandler.getMousePosition(c.event))[0]||this,cancel:!1,position:{x:this.currentSymbol.wrapper.offsetX,y:this.currentSymbol.wrapper.offsetY}},this.commandHandler.PreventConnectorSplit=!1,this.triggerEvent(dyi.drop,s),l="id",(a=DTi(this.currentSymbol)).hasTarget=this.currentSymbol.hasTarget,this.removeFromAQuad(this.currentSymbol),this.removeObjectsFromLayer(this.nameTable[this.currentSymbol.id]),this.removeElements(this.currentSymbol),(this.currentSymbol.shape.isLane||this.currentSymbol.shape.isPhase||"UmlClassifier"===this.currentSymbol.shape.type)&&this.removeChildInNodes(this.currentSymbol),s.cancel&&VAi(this.currentSymbol,this),this.currentSymbol.shape.isPhase&&(h=!0,n=this.currentSymbol.shape.orientation,a.shape.phases=this.currentSymbol.shape.phases),this.removePreviewChildren(this.currentSymbol),delete this.nameTable[this.currentSymbol.id],this.currentSymbol=null,this.protectPropertyChange(!0),s.cancel?this.clearSelectorLayer():(this.startGroupAction(),a&&(a.shape.isLane||h)&&(h&&(a.shape.isPhase=h,a.shape.orientation=n),this.eventHandler.addSwimLaneObject(a)),a&&"UmlClassifier"===a.shape.type&&!a.shape.relationship&&(a.children=void 0,this.clearSelectorLayer(),this.add(a)),"Bpmn"===a.shape.type&&a.shape.annotation&&a.hasTarget&&(r=a.shape.annotation.nodeId,a.shape.annotation.id=a.id,this.addTextAnnotation(a.shape.annotation,this.nameTable[""+r]),a.nodeId=""),a.shape.isLane||h||void 0===a.type&&"UmlClassifier"===a.shape.type||(a.children&&this.addChildNodes(a),s.target&&s.target instanceof MIi&&!o&&pwi(this,s.target)&&Kvi(s.target)&&!this.commandHandler.isTargetSubProcess(s.target)?mwi(this,s.target,a):("Bezier"===a.type&&0<a.segments.length&&(a.segments=[]),i=this.add(a,!0)),(a||i)&&(Zvi(this)||$vi(this))&&this.select([this.nameTable[a[""+l]]],!1,this.previousSelectedObjects),this.lineRoutingModule&&this.constraints&$fi.LineRouting&&this.commandHandler.updateSelectedNodeProperties(this.selectedItems),s.target&&s.target instanceof ISi&&!0===this.enableConnectorSplit&&this.nameTable[a[""+l]]instanceof MIi&&(this.commandHandler.connectorSplit(this.nameTable[a[""+l]],s.target),this.commandHandler.PreventConnectorSplit=!1))),this.protectPropertyChange(!1),r=this.nameTable[a[""+l]],a.hasTarget&&(a.nodeId=a.hasTarget,this.remove(a)),this.bpmnModule&&r instanceof MIi&&a.processId&&(r.processId=a.processId,this.bpmnModule.dropBPMNchild(this.nameTable[r.processId],r,this)),s.cancel||this.endGroupAction(),"SVG"!==this.mode&&this.refreshDiagramLayer(),delete this.droppable[t]):(s={source:c.droppedElement,element:void 0,target:this.eventHandler.hoverNode||this.eventHandler.lastObjectUnderMouse||this,cancel:!1,position:void 0},this.triggerEvent(dyi.drop,s),a=void 0,l="id"),h="selectedSymbols",this.droppable[h]&&this.droppable[h].parentNode)ue(this.droppable[h]);else for(d=document.getElementsByClassName("e-dragclone"),p=0;p<d.length;p++)d[parseInt(p.toString(),10)].remove();return this.allowServerDataBinding=!0,this.previousSelectedObjects=[],[2]})})},this.droppable.out=function(e){if("touchmove"===e.evt.type&&b.eventHandler.mouseLeave(e.evt),b.currentSymbol&&!b.eventHandler.focus){b.unSelect(b.currentSymbol),b.removeFromAQuad(b.currentSymbol),"SVG"!==b.mode&&"Native"===b.currentSymbol.shape.type&&b.removeElements(b.currentSymbol),b.removeObjectsFromLayer(b.nameTable[b.currentSymbol.id]),b.currentSymbol.shape&&"TextAnnotation"===b.currentSymbol.shape.shape&&(e=b.nameTable[b.currentSymbol.inEdges[0]],b.removeObjectsFromLayer(b.nameTable[e.id]),b.removeFromAQuad(e),b.removePreviewChildren(e),delete b.nameTable[e.id],t=b.connectors.indexOf(e),b.connectors.splice(t,1),b.removeElements(e)),b.removePreviewChildren(b.currentSymbol),delete b.nameTable[b.currentSymbol.id];var t={element:b.currentSymbol,diagram:b};if(b.triggerEvent(dyi.dragLeave,t),"SVG"!==b.mode)b.refreshDiagramLayer();else if(b.removeElements(b.currentSymbol),"SwimLane"!==b.currentSymbol.shape.type&&b.currentSymbol.children&&0<b.currentSymbol.children.length)for(var i=0;i<b.currentSymbol.children.length;i++){var n=b.nameTable[b.currentSymbol.children[parseInt(i.toString(),10)]];b.removeElements(n),delete b.nameTable[b.currentSymbol.children[parseInt(i.toString(),10)]]}b.currentSymbol=null;b.droppable.selectedSymbols.style.opacity="1";delete b.droppable.sourceElement,b.diagramRenderer.rendererActions=b.removeConstraints(b.diagramRenderer.rendererActions,syi.DrawSelectorBorder),b.previousSelectedObject&&b.select(b.previousSelectedObject,1<b.previousSelectedObject.length),b.previousSelectedObject=null}}},X.prototype.getDropEventArgs=function(e){var t;this.eventHandler.lastObjectUnderMouse||this.eventHandler.hoverNode?(t=this.eventHandler.lastObjectUnderMouse||this.eventHandler.hoverNode,e.target=S1i(t)===ISi?{connector:t}:{node:t}):e.target.diagramId=this.element.id},X.prototype.removeChildInNodes=function(e){if(e){if(e.children)for(var t=0;t<e.children.length;t++)this.removeChildInNodes(this.nameTable[e.children[parseInt(t.toString(),10)]]);var i=this.nodes.indexOf(e);-1!==i&&this.nodes.splice(i,1)}},X.prototype.getBlazorDragEventArgs=function(e){return e={source:e.source,element:S1i(e.element)===ISi?{connector:e.element}:{node:e.element},cancel:e.cancel,diagramId:this.element.id}},X.prototype.findChild=function(e,t){for(var i,n=0;n<e.children.length;n++)(i=t[e.children[parseInt(n.toString(),10)]])&&(i.children&&this.findChild(i,t),i.id=i.id+xTi(),t[i.id]=i,e.children[parseInt(n.toString(),10)]=i.id,i=new MIi(this,"nodes",i,!0),this.initObject(i,void 0,void 0,!0))},X.prototype.getChildren=function(e,t,i){for(var n,o=0;o<e.children.length;o++)(n=i[e.children[parseInt(o.toString(),10)]])&&((t=n.children?this.getChildren(n,t,i):t)[n.id]=DTi(n));return t},X.prototype.addChildNodes=function(e){for(var t,i=0;i<e.children.length;i++)(t=this.nameTable[e.children[parseInt(i.toString(),10)]])&&(t.children&&this.addChildNodes(t),this.add(t,!0))},X.prototype.moveNode=function(e){for(var t,i,n=this.commandHandler.getObjectLayer(e.id),o=n.zIndex,r=n.objects.length,s=0;s<this.layers.length;s++)o===this.layers[parseInt(s.toString(),10)].zIndex&&(t=this.layers[s+1]);if(1<r){var a=2;if(e.children&&0<e.children.length)for(;-1<e.children.indexOf(n.objects[r-a]);)a++;this.commandHandler.moveSvgNode(e.id,n.objects[r-a]),this.commandHandler.moveSvgNode(n.objects[r-a],e.id)}else t&&(i=this.commandHandler.getLayer(this.layerZIndexTable[t.zIndex]).objects[0])?(this.commandHandler.moveSvgNode(e.id,i),this.commandHandler.updateNativeNodeIndex(e.id,i)):this.moveObjectsUp(e,n)},X.prototype.moveObjectsUp=function(e,t){for(var i=this.layers.length-1;0<=i;i--)if(n=this.layers[parseInt(i.toString(),10)],t.id!==n.id){var n=this.commandHandler.getLayer(this.layerZIndexTable[n.zIndex]).objects[n.objects.length-1];if(n){this.commandHandler.moveSvgNode(e.id,n),this.commandHandler.moveSvgNode(n,e.id);break}}},X.prototype.insertData=function(e){return this.crudOperation(e,"create",this.getNewUpdateNodes("New"))},X.prototype.updateData=function(e){return this.crudOperation(e,"update",this.getNewUpdateNodes("Update"))},X.prototype.removeData=function(e){return this.crudOperation(e,"destroy",this.getDeletedNodes())},X.prototype.crudOperation=function(e,t,i){var n;return e?((n=this.parameterMap(e,!(e instanceof ISi)))&&(e=(e instanceof ISi?this.dataSourceSettings.connectionDataSource:this.dataSourceSettings).crudAction[""+t],this.raiseAjaxPost(JSON.stringify(n),e)),n):(this.processCrudCollection(e=i,this.dataSourceSettings.crudAction[""+t],this.dataSourceSettings.connectionDataSource.crudAction[""+t]),e)},X.prototype.processCrudCollection=function(e,t,i){if(e.nodes){var n=[],o=void 0;for(o=0;o<e.nodes.length;o++)n.push(this.parameterMap(e.nodes[parseInt(o.toString(),10)],!0));n&&0<n.length&&this.raiseAjaxPost(JSON.stringify(n),t)}if(e.connectors){n=[],o=void 0;for(o=0;o<e.connectors.length;o++)n.push(this.parameterMap(e.connectors[parseInt(o.toString(),10)],!1));n&&0<n.length&&this.raiseAjaxPost(JSON.stringify(n),i)}},X.prototype.parameterMap=function(e,t){var i,n={},o=t?this.dataSourceSettings:this.dataSourceSettings.connectionDataSource;if(o.id&&(n[o.id]=e.id),o.sourcePointX&&o.sourcePointY&&(n[o.sourcePointX]=e.sourcePoint.x,n[o.sourcePointY]=e.sourcePoint.y),o.targetPointX&&o.targetPointY&&(n[o.targetPointX]=e.targetPoint.x,n[o.targetPointY]=e.targetPoint.y),o.sourceID&&(n[o.sourceID]=e.sourceID),o.targetID&&(n[o.targetID]=e.targetID),o.crudAction&&o.crudAction.customFields&&0<o.crudAction.customFields.length)for(i=0;i<o.crudAction.customFields.length;i++)n[o.crudAction.customFields[parseInt(i.toString(),10)]]=e[o.crudAction.customFields[parseInt(i.toString(),10)]];return n},X.prototype.getNewUpdateNodes=function(e){var t,i=[],n=[];for(t in this.nameTable){var o=this.nameTable[""+t];o.status===e&&(o&&o instanceof ISi?(o.status="None",n):(o.status="None",i)).push(o)}return{nodes:i,connectors:n}},X.prototype.getDeletedNodes=function(){for(var e=[],t=[],i=0;i<this.crudDeleteNodes.length;i++){var n=this.crudDeleteNodes[parseInt(i.toString(),10)];n&&n.segments?t.push(n):n&&e.push(n)}return this.crudDeleteNodes=[],{nodes:e,connectors:t}},X.prototype.raiseAjaxPost=function(e,t){t=new Qe(t,"POST","application/json"),e=JSON.stringify(JSON.parse(e));t.send(e).then(),t.onSuccess=function(e){}},X.prototype.getHiddenItems=function(e){if(this.contextMenuModule){this.contextMenuModule.hiddenItems=[];for(var t=0,i=e.items;t<i.length;t++){var n=i[t];if(this.contextMenuModule.ensureItems(n,e.event),n.items&&n.items.length)for(var o=0,r=n.items;o<r.length;o++){var s=r[o];this.contextMenuModule.ensureItems(s,e.event)}}return this.contextMenuModule.hiddenItems}return[]},C4([e("100%")],X.prototype,"width",void 0),C4([e(!1)],X.prototype,"enableConnectorSplit",void 0),C4([e("SVG")],X.prototype,"mode",void 0),C4([e("100%")],X.prototype,"height",void 0),C4([e("Circle")],X.prototype,"segmentThumbShape",void 0),C4([e(10)],X.prototype,"segmentThumbSize",void 0),C4([t({},s)],X.prototype,"contextMenuSettings",void 0),C4([e($fi.Default)],X.prototype,"constraints",void 0),C4([e(eyi.Default)],X.prototype,"tool",void 0),C4([e("Top")],X.prototype,"bridgeDirection",void 0),C4([e("transparent")],X.prototype,"backgroundColor",void 0),C4([t({},Hg)],X.prototype,"snapSettings",void 0),C4([t({},q$e)],X.prototype,"rulerSettings",void 0),C4([t({},zmt)],X.prototype,"pageSettings",void 0),C4([t({},Tg)],X.prototype,"serializationSettings",void 0),C4([kt([],MIi)],X.prototype,"nodes",void 0),C4([e()],X.prototype,"drawingObject",void 0),C4([kt([],ISi)],X.prototype,"connectors",void 0),C4([e([])],X.prototype,"basicElements",void 0),C4([t({},O2t)],X.prototype,"tooltip",void 0),C4([t({},vft)],X.prototype,"dataSourceSettings",void 0),C4([e()],X.prototype,"addInfo",void 0),C4([e()],X.prototype,"historyManager",void 0),C4([e()],X.prototype,"nodeTemplate",void 0),C4([e()],X.prototype,"annotationTemplate",void 0),C4([e()],X.prototype,"userHandleTemplate",void 0),C4([e()],X.prototype,"fixedUserHandleTemplate",void 0),C4([e()],X.prototype,"getNodeDefaults",void 0),C4([e()],X.prototype,"nodeDefaults",void 0),C4([e()],X.prototype,"getConnectorDefaults",void 0),C4([e()],X.prototype,"connectorDefaults",void 0),C4([e()],X.prototype,"setNodeTemplate",void 0),C4([e()],X.prototype,"getDescription",void 0),C4([e()],X.prototype,"getCustomProperty",void 0),C4([e()],X.prototype,"getCustomTool",void 0),C4([e()],X.prototype,"getCustomCursor",void 0),C4([kt([],nf)],X.prototype,"customCursor",void 0),C4([e()],X.prototype,"updateSelection",void 0),C4([t({},qf)],X.prototype,"diagramSettings",void 0),C4([t({},qIi)],X.prototype,"selectedItems",void 0),C4([t({},Cet)],X.prototype,"scrollSettings",void 0),C4([t({},Ir)],X.prototype,"layout",void 0),C4([t({},Pc)],X.prototype,"commandManager",void 0),C4([i()],X.prototype,"dataLoaded",void 0),C4([i()],X.prototype,"dragEnter",void 0),C4([i()],X.prototype,"dragLeave",void 0),C4([i()],X.prototype,"dragOver",void 0),C4([i()],X.prototype,"click",void 0),C4([i()],X.prototype,"historyChange",void 0),C4([i()],X.prototype,"historyStateChange",void 0),C4([i()],X.prototype,"doubleClick",void 0),C4([i()],X.prototype,"textEdit",void 0),C4([i()],X.prototype,"scrollChange",void 0),C4([i()],X.prototype,"mouseWheel",void 0),C4([i()],X.prototype,"selectionChange",void 0),C4([i()],X.prototype,"sizeChange",void 0),C4([i()],X.prototype,"connectionChange",void 0),C4([i()],X.prototype,"sourcePointChange",void 0),C4([i()],X.prototype,"targetPointChange",void 0),C4([i()],X.prototype,"propertyChange",void 0),C4([i()],X.prototype,"positionChange",void 0),C4([i()],X.prototype,"keyUp",void 0),C4([i()],X.prototype,"keyDown",void 0),C4([i()],X.prototype,"animationComplete",void 0),C4([i()],X.prototype,"rotateChange",void 0),C4([i()],X.prototype,"collectionChange",void 0),C4([i()],X.prototype,"fixedUserHandleClick",void 0),C4([i()],X.prototype,"onUserHandleMouseDown",void 0),C4([i()],X.prototype,"onUserHandleMouseUp",void 0),C4([i()],X.prototype,"onUserHandleMouseEnter",void 0),C4([i()],X.prototype,"onUserHandleMouseLeave",void 0),C4([i()],X.prototype,"onFixedUserHandleMouseDown",void 0),C4([i()],X.prototype,"onFixedUserHandleMouseUp",void 0),C4([i()],X.prototype,"onFixedUserHandleMouseEnter",void 0),C4([i()],X.prototype,"onFixedUserHandleMouseLeave",void 0),C4([i()],X.prototype,"segmentCollectionChange",void 0),C4([i()],X.prototype,"onImageLoad",void 0),C4([i()],X.prototype,"expandStateChange",void 0),C4([i()],X.prototype,"load",void 0),C4([i()],X.prototype,"created",void 0),C4([i()],X.prototype,"mouseEnter",void 0),C4([i()],X.prototype,"mouseLeave",void 0),C4([i()],X.prototype,"mouseOver",void 0),C4([i()],X.prototype,"elementDraw",void 0),C4([i()],X.prototype,"contextMenuOpen",void 0),C4([i()],X.prototype,"contextMenuBeforeItemRender",void 0),C4([i()],X.prototype,"contextMenuClick",void 0),C4([i()],X.prototype,"commandExecute",void 0),C4([kt([],NEi)],X.prototype,"layers",void 0),C4([i()],X.prototype,"drop",void 0),C4([i()],X.prototype,"segmentChange",void 0),C4([i()],X.prototype,"loaded",void 0),C4([i()],X.prototype,"layoutUpdated",void 0),X);function X(e,t){var i,n,o=aDi.call(this,e,t)||this;o.version=17.1,o.checkMenu=!1,o.isServerUpdate=!1,o.oldNodeObjects=[],o.oldDiagramObject={},o.oldConnectorObjects=[],o.canEnableBlazorObject=!1,o.connectorTable={},o.groupTable={},o.scrollActions=lyi.None,o.blazorActions=zfi.Default,o.activeLabel={id:"",parentId:"",isGroup:!1,text:void 0},o.textEditing=!1,o.isTriggerEvent=!1,o.preventNodesUpdate=!1,o.preventConnectorsUpdate=!1,o.callBlazorModel=!0,o.selectionConnectorsList=[],o.deleteVirtualObject=!1,o.canLayout=!0,o.cancelPositionChange=!1,o.isRefreshed=!1,o.swimlaneChildTable={},o.swimlaneZIndexTable={},o.canExpand=!1,o.changedConnectorCollection=[],o.changedNodesCollection=[],o.previousNodeCollection=[],o.previousConnectorCollection=[],o.crudDeleteNodes=[],o.previousSelectedObjects=[],o.blazorAddorRemoveCollection=[],o.blazorRemoveIndexCollection=[],o.diagramid=88123,o.portCenterPoint=[],o.selectedObject={helperObject:void 0,actualObject:void 0},o.deleteDependentConnector=!0,o.scaleValue=1,o.routedConnectors=[],o.pathDataStorage=new Map,o.isUndo=!1,o.mermaidNodeBaseCollection=[],o.bangShape="M0 0 a15.470625686645507,15.470625686645507 1 0,0 25.78437614440918,-3.7200001525878905 a15.470625686645507,15.470625686645507 1 0,0 25.78437614440918,0 a15.470625686645507,15.470625686645507 1 0,0 25.78437614440918,0 a15.470625686645507,15.470625686645507 1 0,0 25.78437614440918,3.7200001525878905 a15.470625686645507,15.470625686645507 1 0,0 15.470625686645507,12.276000503540038 a12.376500549316406,12.376500549316406 1 0,0 0,12.648000518798828 a15.470625686645507,15.470625686645507 1 0,0 -15.470625686645507,12.276000503540038 a15.470625686645507,15.470625686645507 1 0,0 -25.78437614440918,5.580000228881835 a15.470625686645507,15.470625686645507 1 0,0 -25.78437614440918,0 a15.470625686645507,15.470625686645507 1 0,0 -25.78437614440918,0 a15.470625686645507,15.470625686645507 1 0,0 -25.78437614440918,-5.580000228881835 a15.470625686645507,15.470625686645507 1 0,0 -10.313750457763673,-12.276000503540038 a12.376500549316406,12.376500549316406 1 0,0 0,-12.648000518798828 a15.470625686645507,15.470625686645507 1 0,0 10.313750457763673,-12.276000503540038 H0 V0 Z",o.cloudShape="M0 0 a16.18875045776367,16.18875045776367 0 0,1 26.981250762939453,-10.792500305175782 a37.77375106811523,37.77375106811523 1 0,1 43.17000122070313,-10.792500305175782 a26.981250762939453,26.981250762939453 1 0,1 37.77375106811523,21.585000610351564 a16.18875045776367,16.18875045776367 1 0,1 16.18875045776367,13.020000534057615 a21.585000610351564,21.585000610351564 1 0,1 -16.18875045776367,24.180000991821288 a26.981250762939453,16.18875045776367 1 0,1 -26.981250762939453,16.18875045776367 a37.77375106811523,37.77375106811523 1 0,1 -53.962501525878906,0 a16.18875045776367,16.18875045776367 1 0,1 -26.981250762939453,-16.18875045776367 a16.18875045776367,16.18875045776367 1 0,1 -10.792500305175782,-13.020000534057615 a21.585000610351564,21.585000610351564 1 0,1 10.792500305175782,-24.180000991821288 H0 V0 Z",o.renderTimer=null,o.ignoreCollectionWatch=!0;for(var r=0;e&&e.nodes&&r<e.nodes.length;r++)i=e.nodes[parseInt(r.toString(),10)],n=o.nodes[parseInt(r.toString(),10)],i.children&&0<i.children.length&&(i.style&&i.style.fill||(n.style.fill="transparent"),i.style&&i.style.strokeColor||(n.style.strokeColor="transparent")),i.shape&&"UmlActivity"===i.shape.type&&gAi(i,n),i.shape&&"SwimLane"===i.shape.type&&dAi(i,n),o.nodeDefaults&&bAi(n,i,o.nodeDefaults),o.updateAnnotationText(n.annotations);if(e&&e.connectors)for(r=0;e&&e.connectors&&r<e.connectors.length;r++)i=e.connectors[parseInt(r.toString(),10)],n=o.connectors[parseInt(r.toString(),10)],o.connectorDefaults&&bAi(n,i,o.connectorDefaults),o.updateAnnotationText(n.annotations);for(r=0;e&&e.connectors&&r<e.connectors.length;r++){var s=e.connectors[parseInt(r.toString(),10)],a=o.connectors[parseInt(r.toString(),10)];s.shape&&"None"!==s.shape.type&&mAi(s,a)}return o}pDi.prototype.exportDiagram=function(e){var t,i,n="data",o=[],r=e.margin||{},s=e&&e.region?e.region:"Content",a=e&&e.mode?e.mode:"Download",l=this.getDiagramBounds(s,e),h=(e.bounds&&(i=!0,l.x=e.bounds.x||l.x,l.y=e.bounds.y||l.y,l.width=e.bounds.width||l.width,l.height=e.bounds.height||l.height),r={top:void 0!==r.top?r.top:25,bottom:void 0!==r.bottom?r.bottom:25,right:void 0!==r.right?r.right:25,left:void 0!==r.left?r.left:25},this.diagram.nodes,"PageSettings"!==s&&(l.x-=r.left,l.y-=r.top,l.width+=r.left+r.right,l.height+=r.top+r.bottom),e.fileName||"diagram");if("SVG"!==e.format){if(null!==(n=this.setCanvas(e,l,r,a,i,s,h)))return n}else{t=e.format,e.bounds=l,e.margin=r;s=i=this.diagramAsSvg(e,r);if("Data"===a)return i;l=(new XMLSerializer).serializeToString(s);o.push(l)}if("Download"===a&&null!==n)for(var d=0;d<o.length;d++){var p,c=new Blob([o[parseInt(d.toString(),10)]],{type:"application/octet-stream"});"msie"===F.info.name?window.navigator.msSaveOrOpenBlob(c,h+"."+t):(p=pTi("a",{download:h+"."+t}),c=URL.createObjectURL(c),p.href=c,(c=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),p.dispatchEvent(c))}return null},pDi.prototype.setCanvas=function(e,t,i,n,o,r,s){e.bounds=t,e.region=r;this.setScaleValueforCanvas(e,t);t=this.diagramAsCanvas({bounds:t,margin:i,region:r,scaleX:e.scaleX,scaleY:e.scaleY,scaleOffsetX:e.scaleOffsetX,scaleOffsetY:e.scaleOffsetY},o),o=r="JPG"===e.format?t.toDataURL("image/jpeg"):"BMP"===e.format?t.toDataURL("image/bmp"):t.toDataURL();return"Data"===n?r:(this.canvasMultiplePage(e,t,i,o,s),null)},pDi.prototype.canvasMultiplePage=function(e,t,i,n,o){var r,s=this,a=[],l=n.substring(n.indexOf(":")+1,n.indexOf(";")),l=l.substring(l.indexOf("/")+1),h=(l="jpeg"===l?void 0:l.toUpperCase())||"JPG";e.multiplePage?(e.pageHeight=e.pageHeight||this.diagram.pageSettings.height,e.pageWidth=e.pageWidth||this.diagram.pageSettings.width,e.pageHeight=e.pageHeight||t.width,e.pageWidth=e.pageWidth||t.height,i=e.margin||{},e.pageOrientation&&("Landscape"===e.pageOrientation&&e.pageHeight>e.pageWidth||"Portrait"===e.pageOrientation&&e.pageWidth>e.pageHeight)&&(l=e.pageWidth,e.pageWidth=e.pageHeight,e.pageHeight=l),e.margin={top:isNaN(i.top)?0:i.top,bottom:isNaN(i.bottom)?0:i.bottom,left:isNaN(i.left)?0:i.left,right:isNaN(i.right)?0:i.right},(r=pTi("img",{id:this.diagram.element.id+"_printImage",src:n})).onload=function(){a=s.getMultipleImage(r,e,!0),s.exportImage(a,o,h,n)}):(a=[n],this.exportImage(a,o,h,n))},pDi.prototype.exportImage=function(e,o,r,t){for(var s=[],i=e instanceof HTMLElement?0:e.length,n=0;n<i;n++){for(var a=e[parseInt(n.toString(),10)].replace(/^data:[a-z]*;,/,"").split(","),l=atob(a[1]),a=new ArrayBuffer(l.length),h=new Uint8Array(a),d=0;d<l.length;d++)h[parseInt(d.toString(),10)]=l.charCodeAt(d);s.push(a)}for(var p=0;p<s.length;p++)!function(e){var t,i,n=new Blob([s[parseInt(e.toString(),10)]],{type:"application/octet-stream"});"msie"===F.info.name?window.navigator.msSaveOrOpenBlob(n,o+"."+r):(t=pTi("a",{download:o+"."+r}),n=URL.createObjectURL(n),t.href=n,(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),setTimeout(function(){t.dispatchEvent(i)},5*(e+1)))}(p)},pDi.prototype.getObjectsBound=function(e){for(var t,i=0,n=this.diagram.nodes;i<n.length;i++){var o=n[i];!o.visible||("SVG"===e.format||o instanceof Qyi||o instanceof Tvi)&&("SVG"!==e.format||o instanceof Tvi)||(t=t?t.uniteRect(o.wrapper.outerBounds):o.wrapper.outerBounds)}for(var r=0,s=this.diagram.connectors;r<s.length;r++){var a=s[r];a.visible&&(t=t?t.uniteRect(a.wrapper.outerBounds):a.wrapper.outerBounds)}return t||new tfi(0,0,0,0)},pDi.prototype.getDiagramBounds=function(e,t){var t=this.getObjectsBound(t),i=t.left,n=t.top,o=t.right-t.left,r=t.bottom-t.top,t=("Content"!==e&&(this.diagram.pageSettings&&this.diagram.pageSettings.multiplePage?(i=t.left,n=t.top,this.diagram.pageSettings.width&&(i=Math.floor(i/this.diagram.pageSettings.width)*this.diagram.pageSettings.width,o=Math.ceil(t.right/this.diagram.pageSettings.width)*this.diagram.pageSettings.width-i),this.diagram.pageSettings.height&&(n=Math.floor(n/this.diagram.pageSettings.height)*this.diagram.pageSettings.height,r=Math.ceil(t.bottom/this.diagram.pageSettings.height)*this.diagram.pageSettings.height-n),0===t.width&&null!==this.diagram.pageSettings.width&&(o=this.diagram.pageSettings.width),0===t.height&&null!==this.diagram.pageSettings.height&&(r=this.diagram.pageSettings.height)):(this.diagram.pageSettings.width&&(i=0,o=this.diagram.pageSettings.width),this.diagram.pageSettings.height&&(n=0,r=this.diagram.pageSettings.height))),this.diagram.scrollSettings.padding&&(i-=(e=this.diagram.scrollSettings.padding).left,n-=e.top,o+=e.left+e.right,r+=e.top+e.bottom),new tfi);return t.x=i,t.y=n,t.width=o,t.height=r,t},pDi.prototype.setScaleValueforCanvas=function(e,t){var i="scaleX",n="scaleY",o="scaleOffsetX",r="scaleOffsetY";e[i]=1,e[n]=1,e[o]=0,e[r]=0,e.pageHeight=e.pageHeight||this.diagram.pageSettings.height,e.pageWidth=e.pageWidth||this.diagram.pageSettings.width;"Portrait"===(e.pageOrientation||this.diagram.pageSettings.orientation||"Portrait")?e.pageWidth>e.pageHeight&&(s=e.pageHeight,e.pageHeight=e.pageWidth,e.pageWidth=s):e.pageHeight>e.pageWidth&&(s=e.pageWidth,e.pageWidth=e.pageHeight,e.pageHeight=s),e.pageWidth&&e.pageHeight&&!e.multiplePage&&(e.stretch="Meet");var s=e.pageHeight||t.height,a=e.pageWidth||t.width;"Stretch"!==e.stretch&&"Meet"!==e.stretch&&"Slice"!==e.stretch||(e[i]=a/t.width,e[n]=s/t.height,"Meet"===e.stretch?(e[i]=e[n]=Math.min(e[i],e[n]),e[r]=(e.pageHeight-t.height*e[i])/2,e[o]=(e.pageWidth-t.width*e[i])/2):"Slice"===e.stretch&&(e[i]=e[n]=Math.max(e[i],e[n])),t.width=a,t.height=s),t.x*=e[i],t.y*=e[n]},pDi.prototype.diagramAsSvg=function(e,t){var i=this.diagram.createSvg(this.diagram.element.id+"_diagram_svg",e.bounds.width,e.bounds.height),n=(document.body.appendChild(i),cTi("g",{id:this.diagram.element.id+"_pageBackground"})),o=e&&e.region?e.region:"Content",r=this.getDiagramBounds(o,e),o=r.x,s=r.y,a=r.width,l=r.height;i.appendChild(n);vTi(n,{x:String(o),y:String(s),width:String(a),height:String(l)}),this.setTransform(n,e.bounds,t);var h=document.getElementById(this.diagram.element.id+"gradient_pattern"),o=(h&&i.appendChild(h.cloneNode(!0)),h={x:String(o),y:String(s),width:String(a+t.left+t.right),height:String(l+t.top+t.bottom)},document.getElementById(this.diagram.element.id+"_backgroundImageLayer").cloneNode(!0)),s=(vTi(o,h),i.appendChild(o),this.setTransform(o,r,t),document.getElementById(this.diagram.element.id+"_backgroundLayerrect").cloneNode(!0));if(vTi(s,h),i.appendChild(s),this.setTransform(s,r,t),"SVG"===this.diagram.mode){var d,p=void 0,a=ZIi(this.diagram.element.id);for(i.appendChild(a.getElementById(this.diagram.diagramLayer.id).cloneNode(!0)),p=0;p<i.childNodes.length;p++)(d=i.childNodes[parseInt(p.toString(),10)]).id===this.diagram.element.id+"_diagramLayer"&&this.setTransform(d,r,t)}else{n=cTi("g",{id:this.diagram.element.id+"_diagramLayer"}),i.appendChild(n),this.setTransform(n,e.bounds,t);l=new tAi("",null,!0),o=dTi(this.diagram.element.id);this.diagram.renderDiagramElements(i,l,o,!1)}return document.body.removeChild(i),i},pDi.prototype.setTransform=function(e,t,i){e.setAttribute("transform","translate("+(-t.x+i.left)+", "+(-t.y+i.top)+")")},pDi.prototype.diagramAsCanvas=function(e,t){var i,n,o,r,s="scaleX",a="scaleY",l="scaleOffsetX",h="scaleOffsetY",d=e.bounds,p=e.margin,c=e.region,u=this.getDiagramBounds(c,e),g=this.diagram.pageSettings.background.color,m=WTi.createCanvas(this.diagram.element.id+"_diagram",e.bounds.width,e.bounds.height),f=m.getContext("2d"),d=(f.translate(-d.x,-d.y),f.save(),f.fillStyle="transparent"===this.diagram.pageSettings.background.color?"white":this.diagram.pageSettings.background.color,f.fillRect((d="Content"===c?u:d).x,d.y,d.width,d.height),this.diagram.pageSettings.background),y=(d&&d.source?(u=this.getDiagramBounds(c,e),(c=new Image).src=d.source,r=u.width/c.width,y=u.height/c.height,i=u.x,n=u.y,v=u.width,b=u.height,o=this.isImageExportable(d),"None"!==d.scale&&"None"!==d.align?(v=(r="Meet"===d.scale?Math.min(r,y):Math.max(r,y))*c.width,b=r*c.height,-1<d.align.indexOf("xmid")?i+=(u.width-v)/2:-1<d.align.indexOf("xmax")&&(i=i+u.width-v),-1<d.align.indexOf("ymid")?n+=(u.height-b)/2:-1<d.align.indexOf("ymax")&&(n=n+u.height-b),"none"!==this.diagram.pageSettings.background.color&&"transparent"!==this.diagram.pageSettings.background.color||(f.fillStyle="white",f.fillRect(u.x*e[s],u.y*e[a],u.width*e[s],u.height*e[a])),o&&f.drawImage(c,i,n,r*c.width,r*c.height)):o&&f.drawImage(c,i,n,u.width,u.height)):(f.fillStyle="transparent"===g?"white":g,f.fillRect(u.x*e[s]-p.left,u.y*e[a]-p.top,u.width*e[s]+p.left+p.right,e[a]*u.height+p.top+p.bottom)),this.diagram.pageSettings.background.color),v=this.diagram.pageSettings.width,d=(v&&(f.strokeStyle="none"===y?"transparent":y,f.lineWidth=v,f.strokeRect(u.x*e[s],u.y*e[a],u.width*e[s],u.height*e[a])),f.restore(),dTi(this.diagram.element.id)),b=new tAi("",null,!1);return this.updateObjectValue(e[s],e[l],e[h],!0),this.diagram.renderDiagramElements(m,b,d,!1,!0),this.updateObjectValue(e[s],e[l],e[h],!1),m},pDi.prototype.updateWrapper=function(e,t,i,n,o){if(e&&0<e.length)for(var r=0;r<e.length;r++)e[parseInt(r.toString(),10)].children&&this.updateWrapper(e[parseInt(r.toString(),10)].children,t,i,n,o),e[parseInt(r.toString(),10)].exportScaleValue.x=t,e[parseInt(r.toString(),10)].exportScaleValue.y=t,e[parseInt(r.toString(),10)].exportScaleOffset.x=i,e[parseInt(r.toString(),10)].exportScaleOffset.y=n,e[parseInt(r.toString(),10)].isExport=o},pDi.prototype.scaleGradientValue=function(e,t,i){var n;0<e.style.gradient.stops.length&&(n=e.style.gradient,e.style.gradient instanceof Dfi?(n.x1=i?n.x1*t:n.x1/t,n.y1=i?n.y1*t:n.y1/t,n.x2=i?n.x2*t:n.x2/t,n.y2=i?n.y2*t:n.y2/t):(n.fx=i?n.fx*t:n.fx/t,n.fy=i?n.fy*t:n.fy/t,n.cx=i?n.cx*t:n.cx/t,n.cy=i?n.cy*t:n.cy/t,n.r=i?n.r*t:n.r/t))},pDi.prototype.updateObjectValue=function(e,t,i,n){for(var o=0;o<this.diagram.nodes.length;o++)s=this.diagram.nodes[parseInt(o.toString(),10)].wrapper,this.scaleGradientValue(this.diagram.nodes[parseInt(o.toString(),10)],e,n),this.updateWrapper(s.children,e,t,i,n),s.exportScaleValue.x=e,s.exportScaleValue.y=e,s.exportScaleOffset.x=t,s.exportScaleOffset.y=i,s.isExport=n;for(var r=0;r<this.diagram.connectors.length;r++)for(var s=this.diagram.connectors[parseInt(r.toString(),10)].wrapper,a=0;a<s.children.length;a++)(s.children[parseInt(a.toString(),10)].isExport=n)&&(s.children[parseInt(a.toString(),10)].exportScaleValue.x=e,s.children[parseInt(a.toString(),10)].exportScaleValue.y=e,s.children[parseInt(a.toString(),10)].exportScaleOffset.x=t,s.children[parseInt(a.toString(),10)].exportScaleOffset.y=i)},pDi.prototype.isImageExportable=function(e){var t=!0;if(e.source)try{var i,n=(i=WTi.createCanvas(this.diagram.element.id+"temp_canvas",100,100)).getContext("2d"),o=(n.save(),new Image);o.src=e.source,n.drawImage(o,0,0,100,100),n.restore(),i.toDataURL()}catch(e){t=!1}return t},pDi.prototype.getPrintCanvasStyle=function(e,t){var i=0,n=0,o=new Omi;return i=e.width,n=e.height,(t.pageHeight||t.pageWidth)&&(n=t.pageHeight||n,i=t.pageWidth||i),t.pageOrientation&&("Landscape"===t.pageOrientation&&i<n||"Portrait"===t.pageOrientation&&n<i)&&(e=i,i=n,n=e),o.height=n,o.width=i,o},pDi.prototype.getMultipleImage=function(e,t,i){var n=[],o=pTi("div",{}),r=this.getPrintCanvasStyle(e,t),s=t.margin,a=s.left,l=s.top,h=s.right,d=s.bottom,p=0,c=r.width+p,u=r.height+0,g=0,m=0;if(t&&t.multiplePage){o.style.height="auto",o.style.width="auto";var f=e.height,y=e.width,v=0,b=0,w=void 0,C=0,S=0,A=void 0,x=void 0;do{for(;C=r.width,S=r.height,g+r.width>=y&&(C=y-g),m+r.height>=f&&(S=f-m),(A=(x=WTi.createCanvas(this.diagram.element.id+"_multiplePrint",r.width,r.height)).getContext("2d")).drawImage(e,p+g+a,0+m+l,C-h-a,S-d-l,0+a,0+l,C-h-a,S-d-l),g+r.width>=y&&(g-=g-y),w=x.toDataURL(),A.restore(),g+=c,i?n.push(w):this.printImage(o,w,v+""+b,c+"px;",u+"px;"),v++,g<y;);}while(b++,v=p=g=0,m+r.height>=f&&(m-=m-f),(m+=u)<f)}else{s=this.getPrintCanvasStyle(e,t),t=s.width,s=s.height,w=((A=(x=WTi.createCanvas(this.diagram.element.id+"_diagram",t,s)).getContext("2d")).drawImage(e,0+a,0+l,e.width-(h+a),e.height-(l+d),0+a,0+l,t-(h+a),s-(l+d)),x.toDataURL());A.restore(),i?n.push(w):this.printImage(o,w,0)}return i?n:o},pDi.prototype.printImage=function(e,t,i,n,o){n={class:"e-diagram-print-page",style:"width:"+n+"height:"+o},o=pTi("img",n),n=pTi("div",n);wTi(o,{id:this.diagram.element.id+"_multiplePrint_img"+i,style:"float:left",src:t}),n.appendChild(o),e.appendChild(n)},pDi.prototype.print=function(e){e.mode="Data";var t=this.exportDiagram(e);this.printImages(t,e)},pDi.prototype.printImages=function(e,i){var n=this,e={id:this.diagram.element.id+"_printImage",src:e},o=(i.margin={top:0,bottom:0,right:0,left:0},pTi("img",e));o.onload=function(){var e=n.getMultipleImage(o,i),t=window.open("");null!=(n.printWindow=t)&&e instanceof HTMLElement&&(t.document.write("<html><head><style> body{margin:0px;}  @media print { .e-diagram-print-page{page-break-after: left; }.e-diagram-print-page:last-child {page-break-after: avoid;}}</style><title></title></head>"),window.addEventListener("beforeunload",n.closePrintWindow),t.addEventListener("load",function(){setTimeout(function(){t.window.print(),t.close()},3e3)}),t.document.write("<center>"+e.innerHTML+"</center>"),t.document.close())}},pDi.prototype.getContent=function(e){for(var t=this.diagram.snapSettings.constraints,i=(this.diagram.snapSettings.constraints=this.diagram.snapSettings.constraints&~Qfi.ShowLines,this.diagram.dataBind(),this.diagram.clearSelection(),e=e||document.styleSheets,""),n=0;n<e.length;n++)!e[parseInt(n.toString(),10)].href&&"string"!=typeof e[parseInt(n.toString(),10)]||(i+="<link href='"+(e[parseInt(n.toString(),10)].href||e[parseInt(n.toString(),10)])+"' rel='stylesheet' />");var o=document.getElementById(this.diagram.element.id+"content").innerHTML;return o=(o=i+"<body style=\"margin: 0px; padding: 0px\"><div style='margin-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;'>"+o+"</div></body>").replace(/ transform: t/g," -webkit-transform: t"),this.diagram.snapSettings.constraints=t,this.diagram.dataBind(),o},pDi.prototype.getDiagramContent=function(e){var t,i,n,o,r,s,a,l,h,d,p;return 1===this.diagram.scroller.currentZoom?p=this.getContent(e):(t=(a=document.getElementById(this.diagram.element.id+"content")).scrollLeft,i=a.scrollTop,n=this.diagram.scrollSettings.currentZoom,o=this.diagram.scroller.horizontalOffset,r=this.diagram.scroller.verticalOffset,s=Number(String(this.diagram.width).split("%")[0])?a.clientWidth:Number(String(this.diagram.width).split("px")[0]),a=Number(String(this.diagram.height).split("%")[0])?a.clientHeight:Number(String(this.diagram.height).split("px")[0]),l=this.getDiagramBounds("",{}),this.diagram.scroller.zoom(1/n),d=h=0,h=l.x,d=l.y,this.diagram.scroller.transform={tx:-h,ty:-d,scale:this.diagram.scroller.currentZoom},this.diagram.scroller.horizontalOffset=-h,this.diagram.scroller.verticalOffset=-d,this.diagram.scroller.setSize(),this.diagram.setSize(l.width,l.height),p=this.getContent(e),this.diagram.setSize(s,a),this.diagram.scroller.zoom(n/this.diagram.scrollSettings.currentZoom),this.diagram.dataBind(),t||i?this.diagram.setOffset(t,i):(this.diagram.scroller.transform={tx:o/this.diagram.scroller.currentZoom,ty:r/this.diagram.scroller.currentZoom,scale:this.diagram.scroller.currentZoom},this.diagram.scroller.horizontalOffset=o,this.diagram.scroller.verticalOffset=r),this.diagram.renderSelector(!1)),P1i()?p.replace("url("+location.protocol+"//"+location.host+location.pathname+"#diagram_pattern ","url(#diagram_pattern)"):p},pDi.prototype.exportImages=function(i,n){var o=this,e=n&&n.region?n.region:"Content",r=n.margin||{},r={top:isNaN(r.top)?0:r.top,bottom:isNaN(r.bottom)?0:r.bottom,left:isNaN(r.left)?0:r.left,right:isNaN(r.right)?0:r.right},s=this.getDiagramBounds(e,{}),a=(n.bounds&&(s.x=(isNaN(n.bounds.x)?s:n.bounds).x,s.y=(isNaN(n.bounds.y)?s:n.bounds).y,s.width=n.bounds.width||s.width,s.height=n.bounds.height||s.height),document.createElement("img")),l=(wTi(a,{src:i}),this);a.onload=function(){var e=WTi.createCanvas(l.diagram.element.id+"innerImage",s.width+(r.left+r.right),s.height+(r.top+r.bottom)),t=e.getContext("2d");t.fillStyle=l.diagram.pageSettings.background.color,t.fillRect(0,0,s.width+(r.left+r.right),s.height+(r.top+r.bottom)),t.drawImage(a,0,0,s.width,s.height,r.left,r.top,s.width,s.height),i=i&&"JPG"===n.format?e.toDataURL("image/jpeg"):e.toDataURL(),n.printOptions?l.printImages(i,n):(t.restore(),t=n.fileName||"diagram",o.canvasMultiplePage(n,e,r,i,t))},"SVG"===n.format&&this.exportDiagram(n)},pDi.prototype.destroy=function(){window.removeEventListener("beforeunload",this.closePrintWindow),this.printWindow=void 0},pDi.prototype.getModuleName=function(){return"PrintandExport"};C5=pDi;function pDi(e){var t=this;this.printWindow=void 0,this.closePrintWindow=function(){t.printWindow&&!t.printWindow.closed&&t.printWindow.close()},this.diagram=e}cDi.prototype.destroy=function(){},cDi.prototype.getModuleName=function(){return"DataBinding"},cDi.prototype.initData=function(e,t){var i=e.dataManager||e.dataSource||{},n=i.data||i.json||(i.dataSource?i.dataSource.json:void 0);(n=n&&0===n.length&&i.dataSource.data?i.dataSource.data:n)&&n.length&&(this.applyDataSource(e,n,t),t.trigger("dataLoaded",{diagram:N?null:t}))},cDi.prototype.initSource=function(t,i){var n,o=this,e=t,r=t;(e.dataManager instanceof me||e.dataSource instanceof me)&&(e=(r.dataManager||r.dataSource).defaultQuery||new ya,(t.dataManager||t.dataSource).executeQuery(e).then(function(e){n=e.result,i.isDestroyed||(i.protectPropertyChange(!0),o.applyDataSource(t,n,i),i.refreshDiagram(),i.protectPropertyChange(!1),i.trigger("dataLoaded",{diagram:N?null:i}))}))},cDi.prototype.applyDataSource=function(e,t,i){this.dataTable={};var n,o,r,s,a=[],l=[];if(void 0!==t){for(var h=0;h<t.length;h++)void 0===(n=t[parseInt(h.toString(),10)])[e.parentId]||null===n[e.parentId]||"object"!=typeof n[e.parentId]?isNaN(n[e.parentId])&&void 0!==n[e.parentId]?void 0!==a[n[e.parentId]&&n[e.parentId].toLowerCase()]?a[n[e.parentId].toLowerCase()].items.push(n):a[n[e.parentId]&&n[e.parentId].toLowerCase()]={items:[n]}:void 0!==a[n[e.parentId]]?a[n[e.parentId]].items.push(n):a[n[e.parentId]]={items:[n]}:a=this.updateMultipleRootNodes(n,a,e,t),e.root&&isNaN(e.root)&&n[e.id]&&isNaN(n[e.id])?e.root.toLowerCase()===n[e.id].toLowerCase()&&(o={items:[n]}):e.root===n[e.id]&&(o={items:[n]});if(o)l.push(o);else for(var d=0,p=Object.keys(a);d<p.length;d++){var c=p[d];c&&"undefined"!==c&&"''"!==c&&"null"!==c||l.push(a[""+c])}for(var u=0;u<l.length;u++)for(var g=0;g<l[parseInt(u.toString(),10)].items.length;g++)s=l[parseInt(u.toString(),10)].items[parseInt(g.toString(),10)],r=this.applyNodeTemplate(e,s,i),i.nodes.push(r),isNaN(s[e.id])&&void 0!==s[e.id]?this.dataTable[s[e.id].toLowerCase()]=r:this.dataTable[s[e.id]]=r,void 0!==(s=isNaN(r.data[e.id])&&void 0!==r.data[e.id]?a[r.data[e.id].toLowerCase()]:a[r.data[e.id]])&&this.renderChildNodes(e,s,r.id,a,i)}this.dataTable=null},cDi.prototype.updateMultipleRootNodes=function(e,t,i,n){for(var o,r=e[i.parentId],s=0;s<r.length;s++)r[parseInt(s.toString(),10)]?t[""+(o=isNaN(r[parseInt(s.toString(),10)])?r[parseInt(s.toString(),10)].toLowerCase():r[parseInt(s.toString(),10)])]?t[""+o].items.push(e):t[""+o]={items:[e]}:t[""+(o=r[parseInt(s.toString(),10)])]?t[""+o].items.push(e):t[""+o]={items:[e]};return t},cDi.prototype.applyNodeTemplate=function(e,t,i){var n,o={id:xTi(),data:t},r=("Flowchart"===i.layout.type&&(r=this.getFlowChartNodeShape(t),n={fill:t.color||"white",strokeColor:t.stroke||"black",strokeWidth:t.strokeWidth||1},o.shape=r,o.style=n,o.annotations=[{content:t.name||""}]),jTi(e.doBinding)),s=(r&&r(o,t,i),new MIi(i,"nodes",o,!0));if(bAi(s,o,i.nodeDefaults),e.dataMapSettings)for(var a=void 0,l=[],h=[],d=0;d<e.dataMapSettings.length;d++){if(-1!==e.dataMapSettings[parseInt(d.toString(),10)].property.indexOf(".")){for(var h=this.splitString(e.dataMapSettings[parseInt(d.toString(),10)].property),p=0;p<h.length;p++)-1!==h[parseInt(p.toString(),10)].indexOf("[")&&(a=h[parseInt(p.toString(),10)].indexOf("["),l=h[parseInt(p.toString(),10)].split("["));a?h[2]?s[l[0]][h[0].charAt(a+1)][h[1]][h[2]]=t[e.dataMapSettings[parseInt(d.toString(),10)].field]:(c=t[e.dataMapSettings[parseInt(d.toString(),10)].field],s[l[0]][h[0].charAt(a+1)][h[1]]=c):h[2]?s[h[0]][h[1]][h[2]]=t[e.dataMapSettings[parseInt(d.toString(),10)].field]:s[h[0]][h[1]]=t[e.dataMapSettings[parseInt(d.toString(),10)].field]}else{var c=e.dataMapSettings[parseInt(d.toString(),10)].property;s[""+(c=c.charAt(0).toLowerCase()+c.slice(1))]=t[e.dataMapSettings[parseInt(d.toString(),10)].field]}a=0,l=[],h=[]}return this.collectionContains(s,i,e.id,e.parentId)?t[e.id]&&isNaN(t[e.id])?this.dataTable[t[e.id].toLowerCase()]:this.dataTable[t[e.id]]:s},cDi.prototype.getFlowChartNodeShape=function(e){if(""!==e.shape)switch(e.shape){case"Rectangle":return{type:"Basic",shape:"Rectangle"};case"Decision":return{type:"Flow",shape:"Decision"};case"Hexagon":return{type:"Path",data:"M 0 0 L 2 -2 L 11 -2 L 13 0 L 11 2 L 2 2 L 0 0"};case"Ellipse":return{type:"Basic",shape:"Ellipse"};case"Terminator":return{type:"Flow",shape:"Terminator"};case"PredefinedProcess":return{type:"Flow",shape:"PreDefinedProcess"};case"Parallelogram":return{type:"Basic",shape:"Parallelogram"};case"ParallelogramAlt":return{type:"Path",data:"M 0 0 L 12 0 L 14 2 L 2 2 L 0 0"};case"Trapezoid":return{type:"Path",data:"M 0 0 L 1 -1 L 5 -1 L 6 0 L 0 0"};case"TrapezoidAlt":return{type:"Path",data:"M 0 0 L 5 0 L 4 1 L 1 1 L 0 0"};case"DataSource":return{type:"Path",data:"M 0 1 L 0 6 C 2 7 4 7 6 6 L 6 1 C 5 0 1 0 0 1 C 1 2 5 2 6 1"};case"Asymmetric":return{type:"Path",data:"M 0 0 L 8 0 L 8 2 L 0 2 L 2 1 L 0 0"};case"DoubleCircle":return{type:"Path",data:"M 0 0 A 1 1 0 0 0 7 0 A 1 1 0 0 0 0 0 M -1 0 A 1 1 0 0 0 8 0 A 1 1 0 0 0 -1 0"};case"Document":return{type:"Flow",shape:"Document"};case"PaperTap":return{type:"Flow",shape:"PaperTap"};case"DirectData":return{type:"Flow",shape:"DirectData"};case"SequentialData":return{type:"Flow",shape:"SequentialData"};case"Sort":return{type:"Flow",shape:"Sort"};case"MultiDocument":return{type:"Flow",shape:"MultiDocument"};case"Collate":return{type:"Flow",shape:"Collate"};case"SummingJunction":return{type:"Flow",shape:"SummingJunction"};case"Or":return{type:"Flow",shape:"Or"};case"InternalStorage":return{type:"Flow",shape:"InternalStorage"};case"Extract":return{type:"Flow",shape:"Extract"};case"ManualOperation":return{type:"Flow",shape:"ManualOperation"};case"Merge":return{type:"Flow",shape:"Merge"};case"OffPageReference":return{type:"Flow",shape:"OffPageReference"};case"SequentialAccessStorage":return{type:"Flow",shape:"SequentialAccessStorage"};case"Data":return{type:"Flow",shape:"Data"};case"Card":return{type:"Flow",shape:"Card"};case"Delay":return{type:"Flow",shape:"Delay"};case"Preparation":return{type:"Flow",shape:"Preparation"};case"Display":return{type:"Flow",shape:"Display"};case"ManualInput":return{type:"Flow",shape:"ManualInput"};case"LoopLimit":return{type:"Flow",shape:"LoopLimit"};case"StoredData":return{type:"Flow",shape:"StoredData"};case"Annotation":return{type:"Flow",shape:"Annotation"};case"Annotation2":return{type:"Flow",shape:"Annotation2"};default:return{type:"Flow",shape:"Process"}}return{type:"Flow",shape:"Process"}},cDi.prototype.splitString=function(e){for(var t=[],t=e.split("."),i=0;i<t.length;i++)t[parseInt(i.toString(),10)]=t[parseInt(i.toString(),10)].charAt(0).toLowerCase()+t[parseInt(i.toString(),10)].slice(1);return t},cDi.prototype.renderChildNodes=function(e,t,i,n,o){for(var r,s,a,l=0;l<t.items.length;l++)(a=t.items[parseInt(l.toString(),10)])[e.id]&&(r=this.applyNodeTemplate(e,a,o),s=!1,this.collectionContains(r,o,e.id,e.parentId)?s=!0:(a[e.id]&&isNaN(a[e.id])?this.dataTable[a[e.id].toLowerCase()]=r:this.dataTable[a[e.id]]=r,o.nodes.push(r)),this.containsConnector(o,i,r.id)||o.connectors.push(this.applyConnectorTemplate(i,r.id,o)),s||void 0!==(a=r.data[e.id]&&isNaN(r.data[e.id])?n[r.data[e.id].toLowerCase()]:n[r.data[e.id]])&&this.renderChildNodes(e,a,r.id,n,o))},cDi.prototype.containsConnector=function(e,t,i){return""!==t&&""!==i&&e.connectors.some(function(e){return void 0!==e&&e.sourceID===t&&e.targetID===i})},cDi.prototype.collectionContains=function(e,t,i,n){var o=isNaN(e.data[""+i])&&e.data[""+i]?this.dataTable[e.data[""+i].toLowerCase()]:this.dataTable[e.data[""+i]];return void 0!==o&&o.data[""+i]===e.data[""+i]&&o.data[""+n]===e.data[""+n]},cDi.prototype.applyConnectorTemplate=function(e,t,i){var n,o,e={id:xTi(),sourceID:e,targetID:t},r=("Flowchart"===i.layout.type&&("string"==typeof(n=i.nodes.find(function(e){return e.id===t})).data.label?e.annotations=[{content:n.data.label}]:Array.isArray(n.data.label)&&((r=0)<(o=i.connectors.filter(function(e){return e.targetID===t})).length&&(r=o.length),e.annotations=[{content:n.data.label[parseInt(r.toString(),10)]}]),o=this.getConnectorArrowType(n.data)),new ISi(i,"connectors",e,!0));return o&&(r.style.strokeWidth=o.strokeWidth,r.targetDecorator.shape=o.targetDecorator),bAi(r,e,i.connectorDefaults),r},cDi.prototype.getConnectorArrowType=function(e){if(""===e.arrowType)return{targetDecorator:"Arrow",strokeWidth:1};switch(e.arrowType){case"None":return{targetDecorator:"None",strokeWidth:1};case"Arrow":return{targetDecorator:"Arrow",strokeWidth:1};case"Diamond":return{targetDecorator:"Diamond",strokeWidth:1};case"Circle":return{targetDecorator:"Circle",strokeWidth:1};case"OpenArrow":return{targetDecorator:"OpenArrow",strokeWidth:1};case"Square":return{targetDecorator:"Square",strokeWidth:1};case"Fletch":return{targetDecorator:"Fletch",strokeWidth:1};case"OpenFetch":return{targetDecorator:"OpenFetch",strokeWidth:1};case"IndentedArrow":return{targetDecorator:"IndentedArrow",strokeWidth:1};case"OutdentedArrow":return{targetDecorator:"OutdentedArrow",strokeWidth:1};case"DoubleArrow":return{targetDecorator:"DoubleArrow",strokeWidth:1};default:return{targetDecorator:"Arrow",strokeWidth:1}}};Iz=cDi;function cDi(){this.dataTable={}}var uDi=function(r,s,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function n(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}o((l=l.apply(r,s||[])).next())})},gDi=function(n,o){var r,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=o.call(n,l)}catch(e){t=[6,e],s=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},mDi={content:".e-diagramcontent",copy:"e-copy",paste:"e-paste",undo:"e-undo",redo:"e-redo",cut:"e-cut",selectAll:"e-selectall",grouping:"e-grouping",group:"e-group",unGroup:"e-ungroup",bringToFront:"e-bringfront",sendToBack:"e-sendback",moveForward:"e-bringforward",sendBackward:"e-sendbackward",order:"e-order"},Jj=(fDi.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on("initial-load",this.render,this)},fDi.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("initial-load",this.render)},fDi.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.element=pTi("ul",{id:this.parent.element.id+"_contextMenu"}),this.parent.element.appendChild(this.element);var e="#"+this.parent.element.id;this.contextMenu=new D4({items:this.getMenuItems(),enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,target:e,select:this.contextMenuItemClick.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this),onOpen:this.contextMenuOpen.bind(this),beforeItemRender:this.BeforeItemRender.bind(this),onClose:this.contextMenuOnClose.bind(this),cssClass:"e-diagram-menu",animationSettings:{effect:"None"}}),this.contextMenu.appendTo(this.element)},fDi.prototype.getMenuItems=function(){var e=[],t=[],i=[];if(!this.parent.contextMenuSettings.showCustomMenuOnly){for(var n=0,o=this.getDefaultItems();n<o.length;n++){var r=o[n];-1!==r.toLocaleLowerCase().indexOf("group")?"grouping"!==r.toLocaleLowerCase()&&i.push(this.buildDefaultItems(r)):-1!==r.toLocaleLowerCase().indexOf("order")?"order"!==r.toLocaleLowerCase()&&t.push(this.buildDefaultItems(r)):e.push(this.buildDefaultItems(r))}var s=this.buildDefaultItems("grouping"),s=(s.items=i,e.push(s),this.buildDefaultItems("order"));s.items=t,e.push(s)}if(this.parent.contextMenuSettings.items)for(var a=0,l=this.parent.contextMenuSettings.items;a<l.length;a++){var h=l[a];e.push(h)}return e},fDi.prototype.contextMenuOpen=function(){this.isOpen=!0},fDi.prototype.BeforeItemRender=function(e){this.parent.trigger(yyi,e)},fDi.prototype.contextMenuItemClick=function(e){document.getElementById(this.parent.element.id+"content").focus(),this.parent.trigger(myi,e);var t=this.getKeyFromId(e.item.id);if(!e.cancel)switch(t){case"cut":this.parent.cut();break;case"copy":this.parent.copy();break;case"undo":this.parent.undo();break;case"redo":this.parent.redo();break;case"paste":this.parent.paste();break;case"selectAll":this.parent.selectAll();break;case"group":this.parent.group();break;case"unGroup":this.parent.unGroup();break;case"bringToFrontOrder":this.parent.bringToFront();break;case"moveForwardOrder":this.parent.moveForward();break;case"sendToBackOrder":this.parent.sendToBack();break;case"sendBackwardOrder":this.parent.sendBackward()}},fDi.prototype.contextMenuOnClose=function(e){0<e.items.length&&e.items[0].parentObj instanceof D4&&this.updateItemStatus()},fDi.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[""+e])},fDi.prototype.updateItemStatus=function(){this.contextMenu.showItems(this.hiddenItems,!0),this.contextMenu.enableItems(this.disableItems,!1,!0),this.hiddenItems=[],this.disableItems=[],this.isOpen=!1},fDi.prototype.ensureItems=function(e,t){var i=this.getKeyFromId(e.id);this.defaultItems[""+i];-1!==this.getDefaultItems().indexOf(i)&&e.target&&(t||this.parent.checkMenu)&&!this.ensureTarget(e)&&this.hiddenItems.push(e.id)},fDi.prototype.refreshItems=function(){this.updateItems(),this.contextMenu.refresh()},fDi.prototype.updateItems=function(){for(var e=!0,t=0;t<this.parent.contextMenuSettings.items.length;t++){for(var i=this.parent.contextMenuSettings.items[parseInt(t.toString(),10)],n=0;n<this.contextMenu.items.length;n++)this.contextMenu.items[parseInt(n.toString(),10)].text===this.parent.contextMenuSettings.items[parseInt(t.toString(),10)].text&&(e=!1);e&&this.contextMenu.insertAfter([i],this.contextMenu.items[this.contextMenu.items.length-1].text)}},fDi.prototype.contextMenuBeforeOpen=function(p){return uDi(this,void 0,void 0,function(){var t,i,n,o,r,s,a,l,h,d;return gDi(this,function(e){for(this.parent.checkMenu||-1===window.navigator.userAgent.indexOf("Linux")&&-1===window.navigator.userAgent.indexOf("X11")||(this.parent.checkMenu=p.cancel=!0),this.parent.checkMenu&&(this.hiddenItems=[]),(t=p).hiddenItems=[],i=0,n=p.items;i<n.length;i++)if(d=n[i],this.ensureItems(d,p.event),d.items.length)for(o=0,r=d.items;o<r.length;o++)s=r[o],this.ensureItems(s,p.event);for(this.eventArgs=p.event,this.parent.trigger(fyi,t),a=!0,this.hiddenItems=this.hiddenItems.concat(t.hiddenItems),this.contextMenu.enableItems(this.disableItems,!1,!0),l=this,h=0;h<p.items.length;h++)d=p.items[parseInt(h.toString(),10)],-1<l.hiddenItems.indexOf(d.id)&&l.contextMenu.hideItems([d.id],!0);for(h=0;h<l.contextMenu.items.length;h++)d=l.contextMenu.items[parseInt(h.toString(),10)],-1===l.hiddenItems.indexOf(d.id)&&(a=!1,l.contextMenu.showItems([d.id],!0));return a&&(t.cancel=a,this.hiddenItems=[]),this.parent.selectedItems.nodes.length&&this.parent.selectedItems.nodes[0].isPhase&&!this.parent.contextMenuSettings.showCustomMenuOnly&&(p.cancel=!0),[2]})})},fDi.prototype.ensureTarget=function(e){var t=this.parent.selectedItems.nodes.length+this.parent.selectedItems.connectors.length,i=!1;switch(this.getKeyFromId(e.id)){case"undo":i=!(!this.parent.historyManager||!this.parent.historyManager.canUndo);break;case"redo":i=!(!this.parent.historyManager||!this.parent.historyManager.canRedo);break;case"paste":i=!!this.parent.commandHandler.clipboardData.clipObject;break;case"selectAll":i=!!(this.parent.nodes.length+this.parent.connectors.length);break;case"grouping":i=!!(1<t||this.parent.selectedItems.nodes[0]&&this.parent.selectedItems.nodes[0].children&&1<this.parent.selectedItems.nodes[0].children.length);break;case"group":i=1<t;break;case"unGroup":i=!!(1===this.parent.selectedItems.nodes.length&&0===this.parent.selectedItems.connectors.length&&this.parent.selectedItems.nodes[0]&&this.parent.selectedItems.nodes[0].children&&1<this.parent.selectedItems.nodes[0].children.length);break;case"cut":case"copy":case"order":case"bringToFrontOrder":case"moveForwardOrder":case"sendToBackOrder":case"sendBackwardOrder":i=!!t}return i},fDi.prototype.destroy=function(){this.contextMenu.destroy(),ue(this.element),this.removeEventListener()},fDi.prototype.getModuleName=function(){return"contextMenu"},fDi.prototype.generateID=function(e){return this.parent.element.id+"_contextMenu_"+e},fDi.prototype.getKeyFromId=function(e){return e.replace(this.parent.element.id+"_contextMenu_","")},fDi.prototype.buildDefaultItems=function(e){var t;switch(e){case"copy":t={target:mDi.content,iconCss:mDi.copy};break;case"cut":t={target:mDi.content,iconCss:mDi.cut};break;case"paste":t={target:mDi.content,iconCss:mDi.paste};break;case"undo":t={target:mDi.content,iconCss:mDi.undo};break;case"redo":t={target:mDi.content,iconCss:mDi.redo};break;case"grouping":t={target:mDi.content};break;case"group":t={target:mDi.content,iconCss:mDi.group};break;case"unGroup":t={target:mDi.content,iconCss:mDi.unGroup};break;case"order":t={target:mDi.content,iconCss:mDi.order};break;case"bringToFrontOrder":t={target:mDi.content,iconCss:mDi.bringToFront};break;case"moveForwardOrder":t={target:mDi.content,iconCss:mDi.moveForward};break;case"sendToBackOrder":t={target:mDi.content,iconCss:mDi.sendToBack};break;case"sendBackwardOrder":t={target:mDi.content,iconCss:mDi.sendBackward};break;case"selectAll":t={target:mDi.content}}return this.defaultItems[""+e]={text:this.getLocaleText(e),id:this.generateID(e),target:t.target,iconCss:t.iconCss?"e-icons "+t.iconCss:""},this.defaultItems[""+e]},fDi.prototype.getDefaultItems=function(){return["copy","cut","paste","undo","redo","selectAll","grouping","group","unGroup","order","bringToFrontOrder","moveForwardOrder","sendToBackOrder","sendBackwardOrder"]},fDi.prototype.setLocaleKey=function(){return{copy:"Copy",cut:"Cut",paste:"Paste",undo:"Undo",redo:"Redo",selectAll:"SelectAll",grouping:"Grouping",group:"Group",unGroup:"UnGroup",order:"Order",bringToFrontOrder:"BringToFront",moveForwardOrder:"MoveForward",sendToBackOrder:"SendToBack",sendBackwardOrder:"SendBackward"}},fDi);function fDi(e,t){this.defaultItems={},this.disableItems=[],this.hiddenItems=[],this.localeText=this.setLocaleKey(),this.parent=e,this.serviceLocator=t,this.addEventListener()}yDi.prototype.getSize=function(e,t){var i=new Omi(e.width,e.height);if(void 0===i.width||void 0===i.height){if(t instanceof kyi||(i.width=i.width||50,i.height=i.height||50),t.actualSize.width&&t.actualSize.height)return t.actualSize;t.measure(new Omi),i.width=i.width||t.desiredSize.width,i.height=i.height||t.desiredSize.height,void 0!==e.maxWidth&&(i.width=Math.min(i.width,e.maxWidth)),void 0!==e.maxHeight&&(i.height=Math.min(i.height,e.maxHeight)),void 0!==e.minWidth&&(i.width=Math.max(i.width,e.minWidth)),void 0!==e.minHeight&&(i.height=Math.max(i.height,e.minHeight))}return i},yDi.prototype.initBPMNContent=function(e,t,i){var n=t.shape,o=t.shape.shape;return"Event"===o&&(e=this.getBPMNEventShape(t,n.event)),"Gateway"===o&&(e=this.getBPMNGatewayShape(t)),"DataObject"===o&&(e=this.getBPMNDataObjectShape(t)),"Message"!==o&&"DataSource"!==o||(e=this.getBPMNShapes(t)),"Group"===o&&((e=this.getBPMNGroup(t,i)).style.strokeDashArray=""!==t.style.strokeDashArray?t.style.strokeDashArray:"2 2 6 2",e.cornerRadius=10),"Activity"===o&&(e=this.getBPMNActivityShape(t)),e="TextAnnotation"===o?t.parentObj instanceof dDi||t.parentObj instanceof RIi?this.getBpmnTextAnnotationShape(t,t.shape,i):this.getBpmnTextAnnotationSymbol(t,t.shape,i):e},yDi.prototype.getBpmnTextAnnotationShape=function(e,t,i){var n=new Vyi,o=(n.measureChildren=!1,n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.float=!0,n.id=e.id+"_textannotation",n.style.strokeColor="transparent",n.style.fill="transparent",n.relativeMode="Object",n.rotateAngle=0,e.width),r=e.height,s=new tfi(0,0,0,0),o=(0!==o&&0!==r&&(s=new tfi(e.offsetX-o/2,e.offsetY-r/2,o,r)),i.isProtectedOnChange);return i.isProtectedOnChange=!1,this.setAnnotationPath(s,n,e,t,t.textAnnotation.textAnnotationDirection,i),i.isProtectedOnChange=o,n},yDi.prototype.getBpmnTextAnnotationSymbol=function(e,t,i){var n="M33.33,15 L0,43 M39.33,0 L33.33,0 L33.33,30 L39.33,30 M60,0",t=("Top"===t.textAnnotation.textAnnotationDirection?n="M15,33.33 L43,0 M0,39.33 L0,33.33 L30,33.33 L30,39.33 M0,60":"Right"===t.textAnnotation.textAnnotationDirection?n="M6,15 L39.33,43 M0,0 L6,0 L6,30 L0,30 M-20,0":"Bottom"===t.textAnnotation.textAnnotationDirection&&(n="M15,6 L43,39.33 M0,0 L0,6 L30,6 L30,0 M0,-20"),new kyi);return t.data=n,t.style.fill="white"===e.style.fill?"transparent":e.style.fill,t.style.strokeDashArray=e.style.strokeDashArray||"",t.style.strokeWidth=e.style.strokeWidth,t.style.strokeColor="transparent"===e.style.strokeColor?"black":e.style.strokeColor,t.style.opacity=e.style.opacity,t},yDi.prototype.getBPMNShapes=function(e){var t=new kyi,i=(this.setStyle(t,e),0!=(e.constraints&Kfi.Shadow)&&e.visible&&(t.shadow=e.shadow),vDi(e.shape.shape));return t.data=i,t.id=e.id+"_"+e.shape.shape,void 0!==e.width&&void 0!==e.height&&(t.width=e.width,t.height=e.height),t},yDi.prototype.getBPMNGroup=function(e,t){var i=new Vyi,n=(this.setStyle(i,e),i.id=e.id+"_group",i.children||(i.children=[]),e.shape.group);if(e.shape.group)for(var o=0;o<n.children.length;o++){var r=t.nameTable[n.children[parseInt(o.toString(),10)]];i.children.push(r.wrapper)}return i.width=e.width,i.height=e.height,i},yDi.prototype.getBPMNGatewayShape=function(e){var t=new Vyi,i=new kyi,n=(i.id=e.id+"_0_gateway",i.offsetX=e.offsetX,i.offsetY=e.offsetY,i.data="M 40 20 L 20 40 L 0 20 L 20 0 L 40 20 Z",this.setStyle(i,e),new kyi),o=(n.id=e.id+"_1_gatewayType",n.style.opacity=e.style.opacity,n.style.strokeColor=e.style.strokeColor,n.horizontalAlignment="Center",n.verticalAlignment="Center",n.relativeMode="Object",e.shape.gateway),r=wDi(o.type),o=("EventBased"===o.type||"ExclusiveEventBased"===o.type||"ParallelEventBased"===o.type?n.style.fill="white":n.style.fill="black",n.data=r,t.style.fill="transparent",t.style.strokeColor="transparent",t.style.strokeWidth=0,t.children=[i,n],this.getSize(e,i));return this.setSizeForBPMNGateway(e.shape.gateway,t,o.width,o.height),t},yDi.prototype.getBPMNDataObjectShape=function(e){var t=new Vyi,i=e.shape.dataObject,n=new kyi,o=(n.id=e.id+"_0_dataobj",n.data="M29.904,5 L7.853,5 L7.853,45 L42.147,45 L42.147,17.242,L29.932,5,L29.932,17.242,L42.147,17.242",this.getSize(e,n)),r=(n.width=o.width,n.height=o.height,this.setStyle(n,e),new kyi),o=(r.id=e.id+"_1_type",r.width=25,r.height=20,r.margin.left=5,r.margin.top=5,r.data="M 3 9.4 l 6 0 v 2.4 l 3.6 -4 L 9 4 v 2.5 H 3 V 9.4 Z",r.style.opacity=e.style.opacity,new kyi);switch(o.id=e.id+"_2_collection",o.width=7.5,o.height=15,o.style.fill="black",o.visible=!0,o.horizontalAlignment="Center",o.verticalAlignment="Bottom",o.relativeMode="Object",o.style.opacity=e.style.opacity,o.data="M 0 0 L 0.1 0 L 0.1 2 L 0 2 Z M 0.4 0 L 0.6 0 L 0.6 2 L0.4 2 Z M 0.9 0 L 1 0 L 1 2 L 0.9 2 Z",i.type){case"None":r.visible=!1;break;case"Input":r.style.fill="white";break;case"Output":r.style.fill="black"}return!1===i.collection&&(o.visible=!1),t.style.fill="transparent",t.style.strokeColor="transparent",t.style.strokeWidth=0,t.children=[n,r,o],t},yDi.prototype.getBPMNTaskShape=function(e){var t=e.shape.activity.task,i=new Vyi,n=new vyi,o=(n.cornerRadius=10,this.getSize(e,n)),r=(n.id=e.id+"_0_task",n.width=o.width,n.height=o.height,this.setStyle(n,e),void 0!==t.call&&!0===t.call&&(n.style.strokeWidth=4),i.width=o.width,i.height=o.height,this.getTaskChildCount(e)),o=o.width/2-12*r,s=1===r?8+o:o+8*(r-1),a=new kyi,l=("Receive"===t.type||"Send"===t.type?(a.width=18,a.height=16):"Manual"===t.type?(a.width=16,a.height=11):(a.width=20,a.height=20),a.id=e.id+"_1_tasktType",a.margin.left=5,a.margin.top=5,t.type=t.type||"None",CDi(t.type)),l=(a.data=l,a.style.fill="transparent",a.style.opacity=e.style.opacity,"Send"===t.type&&(a.style.fill="black"),i.style.fill="transparent",i.style.strokeColor="transparent",i.style.strokeWidth=0,i.children=[n,a],"Service"===t.type&&((n=new kyi).id=e.id+"_1_taskTypeService",n.data=l,n.margin.left=a.margin.left+9,n.margin.top=a.margin.top+9,n.style.fill="white",n.style.opacity=e.style.opacity,i.children.push(n)),t.loop),n=new kyi,h=SDi(l),h=(n.data=h,n.style.fill="black",n.visible="None"!==l,n.margin.left=(s=1===r?9+o:s)-3,!0===n.visible&&(s+=20),n.width=12,n.height=12,n.margin.bottom=5,n.id=e.id+"_2_loop",n.horizontalAlignment="Left",n.verticalAlignment="Bottom",n.setOffsetWithRespectToBounds(0,1,"Fraction"),n.relativeMode="Point",n.style.fill="transparent",a.style.opacity=e.style.opacity,i.children.push(n),new kyi),h=this.getBPMNCompensationShape(e,h);return!0===t.compensation?h.visible=!0:h.visible=!1,h.margin.left=(s=1===r?9+o:s)-3,s+=18,i.children.push(h),i},yDi.prototype.getBPMNEventShape=function(e,t,i,n){var o,r,s,a,l=new Vyi,h=(n=n||e.id,"M164.1884,84.6909000000001C156.2414,84.6909000000001,149.7764,78.2259000000001,149.7764,70.2769000000001C149.7764,62.3279000000001,156.2414,55.8629000000001,164.1884,55.8629000000001C172.1354,55.8629000000001,178.6024,62.3279000000001,178.6024,70.2769000000001C178.6024,78.2259000000001,172.1354,84.6909000000001,164.1884,84.6909000000001"),d=e.shape.event,i=(N||"Event"!==e.shape.shape||(s=d.event,a=d.trigger),o=t.width,r=t.height,i?(o=o||20,r=r||20):void 0!==t.width&&void 0!==t.height||((i=new kyi).data=h,o=(i=this.getSize(e,i)).width,r=i.height),e.shape.activity),p=(N||"Activity"!==e.shape.shape||(i.subProcess,s=t.event,a=t.trigger),new kyi),c=(p.data=h,p.id=n+"_0_event",p.width=o,p.height=r,p.horizontalAlignment="Center",p.verticalAlignment="Center",p.relativeMode="Object",this.setStyle(p,e),new kyi),u=(c.data=h,c.id=n+"_1_event",c.style.gradient=e.style.gradient,c.horizontalAlignment="Center",c.verticalAlignment="Center",c.relativeMode="Object",c.style.strokeColor=e.style.strokeColor,c.style.opacity=e.style.opacity,new kyi),i=bDi(a);switch(u.data=i,u.id=n+"_2_trigger",u.horizontalAlignment="Center",u.verticalAlignment="Center",u.relativeMode="Object",u.style.strokeColor=e.style.strokeColor,u.style.opacity=e.style.opacity,s){case"Start":c.visible=!1;break;case"NonInterruptingStart":p.style.strokeDashArray="2 3",c.visible=!1;break;case"Intermediate":p.style.fill=e.style.fill,p.style.gradient=null;break;case"NonInterruptingIntermediate":p.style.fill=e.style.fill,p.style.gradient=null,p.style.strokeDashArray="2 3",c.style.strokeDashArray="2 3";break;case"ThrowingIntermediate":case"End":p.style.fill="End"!==s||"white"!==e.style.fill?e.style.fill:"black",p.style.gradient=null,u.style.fill="black",u.style.strokeColor="white"}return l.style.fill="transparent",l.style.strokeColor="transparent",l.style.strokeWidth=0,l.children=[p,c,u],this.setSizeForBPMNEvents(d,l,o,r),l},yDi.prototype.setEventVisibility=function(e,t){var e=e.shape.event.event,i=t[0],n=t[1];t[2];switch(e){case"Start":n.visible=!1;break;case"NonInterruptingStart":i.style.strokeDashArray="2 3",n.visible=!1}},yDi.prototype.setSubProcessVisibility=function(e){var t=e.shape.activity.subProcess,i=t.events.length,n="Transaction"===e.shape.activity.subProcess.type?2:0,o=e.wrapper.children[0].children[0];if(!1===t.adhoc&&(o.children[3+n+i].visible=!1),!1===t.compensation&&(o.children[4+n+i].visible=!1),0<i)for(var r=0;r<i;r++)this.setEventVisibility(e,o.children[2+r].children)},yDi.prototype.getBPMNSubProcessShape=function(e){var t,i=new Vyi,n=new kyi,o=(new Vyi,new kyi),r=e.shape.activity,s=r.subProcess,a=this.getSubprocessChildCount(e),l=new vyi,h=(l.id=e.id+"_0_Subprocess",l.style.fill="transparent",l.cornerRadius=10,this.getSize(e,l)),r=(l.width=h.width,l.height=h.height,i.children=[l],"Transaction"===r.subProcess.type&&this.getBPMNSubProcessTransaction(e,e.shape,i),h.width/2),h=1===a?r-6:r-12*a/2-4*(a-1)/2,d=(this.setStyle(l,e),0!=(e.constraints&Kfi.Shadow)&&e.visible&&(i.shadow=e.shadow),new kyi);if(d.id=e.id+"_0_collapsed",d.width=12,d.height=12,d.style.fill="black",d.style.strokeColor=e.style.strokeColor,d.margin.bottom=5,d.style.opacity=e.style.opacity,d.horizontalAlignment="Left",d.verticalAlignment="Bottom",d.setOffsetWithRespectToBounds(0,1,"Fraction"),d.relativeMode="Point",d.data=vDi("collapsedShape"),d.margin.left=h,!0!==s.collapsed||s.processes?d.visible=!1:d.visible=!0,!0===d.visible&&(h+=16),i.children.push(d),"Event"===s.type){l.style.strokeWidth=1,l.style.strokeDashArray="2 2";for(var p=s.events,c=0;c<p.length;c++)t=p[parseInt(c.toString(),10)],this.getBPMNSubEvent(t,e,i)}(o=this.getBPMNSubProcessLoopShape(e)).margin.left=h=1===a?r-6:h,!0===o.visible&&(h+=16),o.style.opacity=e.style.opacity,i.children.push(o),l.id=e.id+"_boundary","Default"===s.boundary&&(l.style.strokeWidth=1,l.style.strokeDashArray="1 0"),"Call"===s.boundary&&(l.style.strokeWidth=4,l.style.strokeDashArray="1 0"),"Event"===s.boundary&&(l.style.strokeWidth=1,l.style.strokeDashArray="2 2"),(n=this.getBPMNAdhocShape(e,n,s)).margin.left=h=1===a?r-6:h,!0===n.visible&&(h+=16),n.style.opacity=e.style.opacity,i.children.push(n);d=new kyi;return!0===s.compensation?d.visible=!0:d.visible=!1,(d=this.getBPMNCompensationShape(e,d)).margin.left=h=1===a?r-6:h,!0===d.visible&&(h+=16),d.style.opacity=e.style.opacity,i.children.push(d),i.style.strokeColor="transparent",i.style.strokeWidth=0,i.style.fill="transparent",i},yDi.prototype.getBPMNSubEvent=function(e,t,i,n){i.children=i.children||[];var o=this.getBPMNEventShape(t,e,!0,n);this.getBPMNSubprocessEvent(t,o,e),o.id=n||t.id+"_subprocessEvents",o.width=e.width||20,o.height=e.height||20,o.setOffsetWithRespectToBounds(e.offset.x,e.offset.y,"Fraction"),o.relativeMode="Point",o.margin=e.margin,o.horizontalAlignment=e.horizontalAlignment,o.verticalAlignment=e.verticalAlignment,o.style.fill="transparent",o.style.strokeColor="transparent",o.style.strokeWidth=0,i.children.push(o)},yDi.prototype.getBPMNSubProcessTransaction=function(e,t,i){var n=i.children[0].width,o=i.children[0].height,r=new vyi,r=(r.margin={left:3,right:0,top:3,bottom:0},r.id=e.id+"_0_Subprocess_innnerRect",r.cornerRadius=10,r.width=n-6,r.style.fill="transparent",r.height=o-6,i.children.push(r),new Vyi),t=(r.id=e.id+"_transaction_events",r.style.gradient=e.style.gradient,t.activity.subProcess.transaction);this.getBPMNSubEvent(t.success,e,r,e.id+"_success"),this.getBPMNSubEvent(t.cancel,e,r,e.id+"_cancel"),this.getBPMNSubEvent(t.failure,e,r,e.id+"_failure"),this.updateDiagramContainerVisibility(r.children[0],t.success.visible),this.updateDiagramContainerVisibility(r.children[1],t.cancel.visible),this.updateDiagramContainerVisibility(r.children[2],t.failure.visible),r.float=!0,r.width=n,r.height=o,r.style.fill=r.style.strokeColor="transparent",i.children.push(r)},yDi.prototype.getBPMNSubProcessLoopShape=function(e){var t=e.shape.activity,i=new kyi,t=t.subProcess.loop,n=SDi(t);return i.visible="None"!==t,i.id=e.id+"_loop",i.data=n,i.style.fill="black",i.width=12,i.height=12,i.horizontalAlignment="Left",i.verticalAlignment="Bottom",i.setOffsetWithRespectToBounds(0,1,"Fraction"),i.relativeMode="Point",i.margin.bottom=5,i.style.fill="transparent",i.style.strokeColor=e.style.strokeColor,i},yDi.prototype.drag=function(e,t,i,n){var o=n.nameTable[e.processId],i=(0<=e.margin.top+i&&n.nodePropertyChange(e,{},{margin:{top:e.margin.top+i}}),0<=e.margin.left+t&&n.nodePropertyChange(e,{},{margin:{left:e.margin.left+t}}),this.getChildrenBound(o,e.id,n));this.updateSubProcessess(i,e,n),o.wrapper.measure(new Omi(void 0,void 0)),o.wrapper.arrange(o.wrapper.desiredSize),n.refreshCanvasLayers(),n.updateSelector(),n.updateDiagramObject(o),n.updateConnectorEdges(e),this.updateDocks(e,n)},yDi.prototype.dropBPMNchild=function(e,t,i){var n,o,r;t&&"Bpmn"===t.shape.type&&"Bpmn"===e.shape.type&&!N&&"TextAnnotation"!==t.shape.shape&&(n=i.nameTable[e.id].shape.activity.subProcess,i.currentSymbol&&"Bpmn"===e.shape.type&&!n.collapsed?t.processId=e.id:(n.processes=n.processes||[],n.processes&&-1===n.processes.indexOf(t.id)&&!n.collapsed&&(n.processes.push(t.id),1<n.processes.length&&this.sortProcessOrder(n.processes,i),n=DTi(t),r=i.nameTable[t.id].wrapper,o=i.nameTable[e.id].wrapper,r.margin.top=r.offsetY-r.actualSize.height/2-(e.offsetY-e.actualSize.height/2),r.margin.left=r.offsetX-r.actualSize.width/2-(e.offsetX-e.actualSize.width/2),r.margin.top=r.margin.top<0?0:r.margin.top,r.margin.left=r.margin.left<0?0:r.margin.left,i.nameTable[t.id].processId=e.id,o.children.push(i.nameTable[t.id].wrapper),r=this.getChildrenBound(e,t.id,i),this.updateSubProcessess(r,t,i),o.measure(new Omi(void 0,void 0)),o.arrange(o.desiredSize),i.refreshCanvasLayers(),i.updateSelector(),r=DTi(t),i.addHistoryEntry({type:"PositionChanged",undoObject:{nodes:[n]},redoObject:{nodes:[r]},category:"Internal"}),"SVG"===i.mode&&(t.zIndex<e.zIndex&&(i.updateProcesses(t),this.updateSubprocessNodeIndex(t,i,e)),$Ii(e.id+"_groupElement").appendChild($Ii(t.id+"_groupElement"))),this.updateDocks(t,i))))},yDi.prototype.sortProcessOrder=function(e,i){e.sort(function(e,t){return i.nameTable[""+e].zIndex-i.nameTable[""+t].zIndex})},yDi.prototype.updateIndex=function(e,t){var i=e.getIndex(t,t.id);e.nodes.splice(Number(i),1),t.zIndex=e.nodes[e.nodes.length-1].zIndex+1,e.nodes.push(t)},yDi.prototype.updateSubprocessNodeIndex=function(e,t,i){if(e.shape.activity.subProcess.processes&&0<e.shape.activity.subProcess.processes.length)for(var n=0;n<e.shape.activity.subProcess.processes.length;n++){this.updateIndex(t,e);var o=e.shape.activity.subProcess.processes[parseInt(n.toString(),10)];0<t.nameTable[""+o].shape.activity.subProcess.processes.length?this.updateSubprocessNodeIndex(t.nameTable[""+o],t,i):(o=t.nameTable[e.shape.activity.subProcess.processes[parseInt(n.toString(),10)]],this.updateIndex(t,o))}else this.updateIndex(t,e)},yDi.prototype.updateDocks=function(e,t){if("Bpmn"===e.shape.type&&e.shape.activity.subProcess.processes&&!e.shape.activity.subProcess.collapsed)for(var i=0,n=e.shape.activity.subProcess.processes;i<n.length;i++){var o=n[i],o=t.nameTable[""+o];o&&(t.updateConnectorEdges(o),o.wrapper.measure(new Omi(o.wrapper.width,o.wrapper.height)),o.wrapper.arrange(o.wrapper.desiredSize),o.shape.activity.subProcess.processes)&&o.shape.activity.subProcess.processes.length&&this.updateDocks(o,t)}},yDi.prototype.removeBpmnProcesses=function(e,t){var i=t.nameTable[e.processId];if("Bpmn"===e.shape.type&&e.shape.activity.subProcess.processes&&0<e.shape.activity.subProcess.processes.length)for(var n,o=(n=e.shape.activity.subProcess.processes).length-1;0<=o;o--)t.remove(t.nameTable[n[parseInt(o.toString(),10)]]);i&&(t.removeDependentConnector(e),n=i.shape.activity.subProcess.processes,this.removeChildFromBPMN(i.wrapper,e.id,t,!0),i=n.indexOf(e.id),n.splice(i,1))},yDi.prototype.removeChildFromBPMN=function(e,t,i,n){for(var o=0,r=e.children;o<r.length;o++){var s=r[o];s.id===t?(e.children.splice(e.children.indexOf(s),1),n||this.removeGElement(s.id,i)):s.children&&this.removeChildFromBPMN(s,t,i,n)}},yDi.prototype.removeGElement=function(e,t){var i,n=document.getElementById(e+"_groupElement"),o=document.getElementById(t.element.id+"_diagramLayer"),e=(n.parentElement.removeChild(n),o.appendChild(n),t.nameTable[""+e]),r=t.nameTable[""+e.processId],s=e.zIndex+1,s=this.getNode(s,t);0<s.length&&(i=document.getElementById(s[0].id+"_groupElement"),s=-1!==(t=Array.from(o.children).findIndex(function(e){return e===i}))?t:1,e.zIndex<r.zIndex)&&o.children[parseInt(s.toString(),10)].insertAdjacentElement("beforebegin",n)},yDi.prototype.getNode=function(t,e){var i=e.nodes.filter(function(e){return e.zIndex===t});return 0===i.length&&0<t?this.getNode(t-1,e):i},yDi.prototype.removeProcess=function(e,t){var i,n,o=t.nameTable[""+e];o&&(n=t.nameTable[o.processId])&&"Bpmn"===n.shape.type&&(i=n.shape.activity.subProcess.processes,t.removeDependentConnector(o),this.removeChildFromBPMN(n.wrapper,e,t,!0),n=i.indexOf(e),i.splice(n,1),o.processId="",t.refreshDiagramLayer(),t.updateSelector())},yDi.prototype.addProcess=function(e,t,i){e.id=e.id||xTi();var n=e.id,o=i.nameTable[""+n],r=DTi(o),s=(o||i.add(e),e.processId=t,i.nameTable[""+t]),a=s.shape.activity.subProcess;a.processes||(a.processes=[]),o&&s&&"Bpmn"===s.shape.type&&"Bpmn"===o.shape.type&&(o.processId=t,(a=s.shape.activity.subProcess.processes).indexOf(n)<0&&a.push(n),s.wrapper.children.push(o.wrapper),s.wrapper.measure(new Omi),s.wrapper.arrange(s.wrapper.desiredSize),i.bpmnModule.updateDocks(s,i),i.refreshDiagramLayer(),i.diagramActions&ryi.UndoRedo||i.historyManager.currentEntry&&"CollectionChanged"===i.historyManager.currentEntry.type||(a=DTi(o),i.addHistoryEntry({type:"PositionChanged",undoObject:{nodes:[r]},redoObject:{nodes:[a]},category:"Internal"})),"SVG"===i.mode)&&o.shape&&o.shape.activity&&!o.shape.activity.subProcess.processes&&$Ii(t+"_groupElement").appendChild($Ii(e.id+"_groupElement"))},yDi.prototype.getChildrenBound=function(e,t,i){var n,e=e.shape.activity.subProcess.processes;if(e&&e.length)for(var o=0,r=e;o<r.length;o++){var s=r[o];t!==s&&(n=n?i.nameTable[""+s].wrapper.bounds.uniteRect(n):i.nameTable[""+s].wrapper.bounds)}return n||i.nameTable[""+t].wrapper.bounds},yDi.prototype.updateSubProcessess=function(e,t,i){var n,o,r,s,a=i.nameTable[t.processId],l={x:.5,y:.5},a=(a.wrapper.bounds.left+t.margin.left+t.width>a.wrapper.bounds.right&&(r=!0),a.wrapper.bounds.top+t.margin.top+t.height>a.wrapper.bounds.bottom&&(s=!0),r&&(l.x=0),s&&(l.y=0),a.wrapper.actualSize);r&&(n=(t.wrapper.margin.left+t.wrapper.bounds.width)/a.width),s&&(o=(t.wrapper.margin.top+t.wrapper.bounds.height)/a.height),(0<n||0<o)&&i.commandHandler.scale(i.nameTable[t.processId],n||1,o||1,l)},yDi.prototype.getBPMNCompensationShape=function(e,t){return t.id=e.id+"_0_compensation",t.width=12,t.height=12,t.margin.bottom=5,t.style.fill="transparent",t.style.strokeColor=e.style.strokeColor,t.horizontalAlignment="Left",t.verticalAlignment="Bottom",t.relativeMode="Object",t.data="M 22.462 18.754 l -6.79 3.92 l 6.79 3.92 V 22.89 l 6.415 3.705 v -7.841 l -6.415 3.705 V 18.754 Z M 28.331 19.701 v 5.947 l -5.149 -2.973 L 28.331 19.701 Z M 21.916 25.647 l -5.15 -2.973 l 5.15 -2.973 V 25.647 Z M 22.275 12.674 c -5.513 0 -9.999 4.486 -9.999 9.999 c 0 5.514 4.486 10.001 9.999 10.001 c 5.514 0 9.999 -4.486 9.999 -10.001 C 32.274 17.16 27.789 12.674 22.275 12.674 Z M 22.275 32.127  c -5.212 0 -9.453 -4.241 -9.453 -9.454 c 0 -5.212 4.241 -9.453 9.453 -9.453 c 5.212 0 9.453 4.241 9.453 9.453 C 31.728 27.887 27.487 32.127 22.275 32.127 Z",t},yDi.prototype.getBPMNActivityShape=function(e){var t,i=new Vyi,n=e.shape.activity,o=n.activity,r=n.subProcess;n.activity;return"Task"===o&&(t=this.getBPMNTaskShape(e)),(t="SubProcess"===o&&r?this.getBPMNSubProcessShape(e):t).id=o+e.id,i.children=[t],i.style.fill="transparent",i.style.strokeColor="transparent",i.style.strokeWidth=0,i},yDi.prototype.getBPMNSubprocessEvent=function(e,t,i){if(0!==i.annotations.length)for(var n=0;n<i.annotations.length;n++){var o=i.annotations[parseInt(n.toString(),10)];(o=e.initAnnotationWrapper(o)).width=i.width,o.height=i.height,t.children.push(o)}if(0!==i.ports.length)for(n=0;n<i.ports.length;n++){var r=i.ports[parseInt(n.toString(),10)],r=e.initPortWrapper(r);t.children.push(r)}},yDi.prototype.getBPMNAdhocShape=function(e,t,i){return t.id=e.id+"_0_adhoc",t.width=12,t.height=8,t.style.fill="black",t.style.strokeColor=e.style.strokeColor,t.margin.bottom=5,t.horizontalAlignment="Left",t.verticalAlignment="Bottom",t.relativeMode="Object",t.data="M 49.832 76.811 v -2.906 c 0 0 0.466 -1.469 1.931 -1.5 c 1.465 -0.031 2.331 1.219 2.897 1.688 s 1.06 0.75 1.526 0.75 c 0.466 0 1.548 -0.521 1.682 -1.208 s 0.083 3.083 0.083 3.083 s -0.76 0.969 -1.859 0.969 c -1.066 0 -1.865 -0.625 -2.464 -1.438 s -1.359 -0.998 -2.064 -0.906 C 50.598 75.467 49.832 76.811 49.832 76.811 Z",i&&!0===i.adhoc?t.visible=!0:t.visible=!1,t},yDi.prototype.setAnnotationPath=function(e,t,i,n,o,r){var s,a,l,h,d=new kyi,p=(d.id=t.id+"_path",d.width=i.width,d.height=i.height,d.style.fill="transparent",d.style.strokeColor="transparent"===i.style.strokeColor?"black":i.style.strokeColor,d.style.opacity=i.style.opacity,d.relativeMode="Object",d.horizontalAlignment="Stretch",d.verticalAlignment="Stretch",0<i.ports.length?i.ports[0]:new r0i(i,"ports","",!0));switch(r.protectPropertyChange(!0),i.ports=[p],r.protectPropertyChange(!1),o){case"Left":d.data="M10,20 L0,20 L0,0 L10,0",d.width=10,d.horizontalAlignment="Left",p.offset={x:0,y:.5};break;case"Right":d.data="M0,0 L10,0 L10,20 L0,20",d.width=10,d.horizontalAlignment="Right",p.offset={x:1,y:.5};break;case"Top":d.data="M20,10 L20,0 L0,0 L0,10",d.height=10,d.verticalAlignment="Top",p.offset={x:.5,y:0};break;case"Bottom":d.data="M0,0 L0,10 L20,10 L20,0",d.height=10,d.verticalAlignment="Bottom",p.offset={x:.5,y:1};break;default:""!==n.textAnnotation.textAnnotationTarget?r.nameTable[n.textAnnotation.textAnnotationTarget]&&((s=r.nameTable[n.textAnnotation.textAnnotationTarget]).hasTextAnnotation=!0,null!==s.wrapper)&&(a=s.width,l=s.height,h=new tfi(0,0,0,0),0!==a&&0!==l&&(h=new tfi(s.offsetX-a/2,s.offsetY-l/2,a,l)),this.setAnnotationPosition(h,i,e,d)):""===n.textAnnotation.textAnnotationTarget&&(d.data="M10,20 L0,20 L0,0 L10,0",d.width=10,d.horizontalAlignment="Left",p.offset={x:0,y:.5})}t.children=[],t.children.push(d)},yDi.prototype.setAnnotationPosition=function(e,t,i,n){t=t.ports[0],i={x:i.x,y:i.y},i=this.getAnnotationPathAngle(i,e);90===i?(n.data="M20,10 L20,0 L0,0 L0,10",n.height=10,n.verticalAlignment="Top",t.offset={x:.5,y:0}):180===i?(n.data="M0,0 L10,0 L10,20 L0,20",n.width=10,n.horizontalAlignment="Right",t.offset={x:1,y:.5}):0===i?(n.data="M10,20 L0,20 L0,0 L10,0",n.width=10,n.horizontalAlignment="Left",t.offset={x:0,y:.5}):(n.data="M0,0 L0,10 L20,10 L20,0",n.height=10,n.verticalAlignment="Bottom",t.offset={x:.5,y:1})},yDi.prototype.getSubprocessChildCount=function(e){var t=0,e=e.shape.activity.subProcess,i=e.loop;return void 0!==i&&"None"!==i&&t++,void 0!==e.compensation&&!0===e.compensation&&t++,void 0!==e.collapsed&&!0===e.collapsed&&t++,void 0!==e.adhoc&&!0===e.adhoc&&t++,t},yDi.prototype.getTaskChildCount=function(e){var t=0,e=e.shape.activity.task;return void 0!==e.compensation&&!0===e.compensation&&t++,void 0!==e.loop&&"None"!==e.loop&&t++,t},yDi.prototype.setStyle=function(e,t){e.style.fill=t.style.fill,e.style.strokeColor=t.style.strokeColor,e.style.strokeWidth=t.style.strokeWidth,e.style.strokeDashArray=t.style.strokeDashArray,e.style.opacity=t.style.opacity,e.style.gradient=t.style.gradient,0!=(t.constraints&Kfi.Shadow)&&t.visible&&(e.shadow=t.shadow)},yDi.prototype.updateBPMN=function(e,t,i,n){var o,r,s=e.shape||{},a=i.wrapper.children[0],l=i.shape.shape||i.shape.bpmnShape,h=(s.textAnnotation&&"TextAnnotation"===l&&(void 0!==s.textAnnotation.textAnnotationDirection&&(this.setAnnotationPath(i.wrapper.bounds,i.wrapper.children[0],i,i.shape,i.shape.textAnnotation.textAnnotationDirection,n),i.wrapper.children[0].children[0].id=i.id+"_textannotation_path",h={ports:{0:{offset:i.ports[0].offset}}},n.nodePropertyChange(i,{},h)),void 0!==s.textAnnotation.textAnnotationTarget)&&((h=n.nameTable[s.textAnnotation.textAnnotationTarget])&&"Bpmn"===h.shape.type?(r=n.nameTable[i.inEdges[0]])&&(r.sourceID=h.id,n.connectorPropertyChange(r,{},{sourceID:h.id})):""===s.textAnnotation.textAnnotationTarget&&(r=n.nameTable[i.inEdges[0]])&&(o=(h=n.nameTable[t.shape.textAnnotation.textAnnotationTarget]).outEdges.indexOf(r.id),h.outEdges.splice(o,1),r.sourceID="",n.connectorPropertyChange(r,{},{sourceID:""}))),void 0!==e.width||void 0!==e.height);"Gateway"===s.shape&&s.gateway?(this.removeBPMNElementFromDOM(i,n),i.wrapper.children[0]=this.getBPMNGatewayShape(i)):"DataObject"===s.shape&&s.dataObject?(this.removeBPMNElementFromDOM(i,n),i.wrapper.children[0]=this.getBPMNDataObjectShape(i)):"Activity"===s.shape&&s.activity?(this.removeBPMNElementFromDOM(i,n),i.wrapper.children[0]=this.getBPMNActivityShape(i)):"Event"!==i.shape.bpmnShape&&"Event"!==i.shape.shape&&"Event"!==s.shape||!s.event?"Message"===s.shape||"DataSource"===s.shape?(this.removeBPMNElementFromDOM(i,n),i.wrapper.children[0]=this.getBPMNShapes(i)):void 0!==s.gateway||"Gateway"===l&&h?this.updateBPMNGateway(i,e):void 0!==s.dataObject||"DataObject"===l&&h?this.updateBPMNDataObject(i,e,t):void 0!==s.activity||"Activity"===l&&h?this.updateBPMNActivity(i,e,t,n):(void 0!==s.event||"Event"===l&&h)&&this.updateBPMNEvent(i,e,t):(this.removeBPMNElementFromDOM(i,n),o=s.event,i.wrapper.children[0]=this.getBPMNEventShape(i,o)),i.wrapper.children[0].id=i.wrapper.children[0].id||a.id,e.style&&((r=a)instanceof Syi&&(r=N||"Activity"!==i.shape.shape?N||"Group"!==i.shape.shape?a.children[0]:a:a.children[0].children[0]),UAi(e.style,r),e.style&&e.style.strokeColor&&a&&void 0!==a.children&&0<a.children.length&&(N||"Activity"!==i.shape.shape||"SubProcess"!==i.shape.activity.activity?(!N&&"Gateway"===i.shape.shape||!N&&"Event"===i.shape.shape)&&this.updateBPMNStyle(a,e.style.strokeColor):(l=a.children[0],this.updateBPMNStyle(l,e.style.strokeColor))),e.style)&&void 0!==e.style.opacity&&this.updateBpmnChildOpacity(i.wrapper,e.style.opacity)},yDi.prototype.updateBpmnChildOpacity=function(e,t){if(e.children&&0<e.children.length)for(var i=0;i<e.children.length;i++){var n=e.children[parseInt(i.toString(),10)];n.children&&this.updateBpmnChildOpacity(n,t),n instanceof Tyi||(n.style.opacity=t)}},yDi.prototype.removeBPMNElementFromDOM=function(e,t){for(var i=0,n=t.views;i<n.length;i++){var o=n[i];fTi(e.id+"_groupElement",o)}},yDi.prototype.updateBPMNStyle=function(e,t){for(var i=0;i<e.children.length;i++)UAi({strokeColor:t},e.children[parseInt(i.toString(),10)])},yDi.prototype.updateBPMNGateway=function(e,t){var i,n=e.shape,o=e.wrapper.children[0];n&&(UAi(e.style,o.children[0]),i=wDi(n.gateway.type),i=this.updateGatewaySubType(o,e,i),n=n.gateway.type,i.style.fill="None"===n||"EventBased"===n||"ExclusiveEventBased"===n||"ParallelEventBased"===n?"white":"black",fTi(o.children[1].id),o.children.splice(1,1),o.children.push(i)),void 0===t.width&&void 0===t.height||this.setSizeForBPMNGateway(e.shape.gateway,o,t.width||e.width,t.height||e.height)},yDi.prototype.updateGatewaySubType=function(e,t,i){var n=new kyi;return n.id=t.id+"_1_gatewayType",n.width=e.children[1].width,n.height=e.children[1].height,n.margin.left=e.children[1].margin.left,n.margin.top=e.children[1].margin.top,n.data=i,n.offsetX=e.children[1].offsetX,n.offsetY=e.children[1].offsetY,n.style=e.children[1].style,n.horizontalAlignment=e.children[1].horizontalAlignment,n.verticalAlignment=e.children[1].verticalAlignment,n.relativeMode=e.children[1].relativeMode,n.transform=e.children[1].transform,n},yDi.prototype.updateBPMNDataObject=function(e,t,i){var n=t.shape,o=e.wrapper.children[0];if(n){var r=o.children[1],s=o.children[2];if(void 0!==t.style&&(UAi(t.style,o.children[0]),r.style.opacity=e.style.opacity,s.style.opacity=e.style.opacity),n.dataObject){switch(n.dataObject.type){case"None":r.visible=!1;break;case"Input":r.style.fill="white";break;case"Output":r.style.fill="black"}"None"===i.shape.dataObject.type&&(r.visible=!0),void 0!==t.shape.dataObject.collection&&(s.visible=n.dataObject.collection)}}void 0===t.width&&void 0===t.height||this.setSizeForBPMNDataObjects(e.shape.dataObject,o,t.width||e.width,t.height||e.height)},yDi.prototype.getEvent=function(e,t,i,n,o,r){switch(i){case"Start":o.visible=!1,n.style.strokeDashArray="",r.style.fill="white",r.style.strokeColor="black",n.style.fill="white";break;case"NonInterruptingStart":n.style.strokeDashArray="2 3",r.style.fill="white",n.style.fill="white",r.style.strokeColor="black",o.visible=!1;break;case"Intermediate":n.style.strokeDashArray="",n.style.fill="white",o.style.strokeDashArray="",n.style.gradient=null,r.style.fill="white",r.style.strokeColor="black",this.updateEventVisibility(t,o);break;case"NonInterruptingIntermediate":n.style.fill="white",n.style.gradient=null,r.style.fill="white",r.style.strokeColor="black",n.style.strokeDashArray="2 3",o.style.strokeDashArray="2 3",this.updateEventVisibility(t,o);break;case"ThrowingIntermediate":case"End":n.style.fill="End"!==i?"white":"black",n.style.strokeDashArray="",o.style.strokeDashArray="",n.style.gradient=null,r.style.fill="black",this.updateEventVisibility(t,o)}},yDi.prototype.updateEventVisibility=function(e,t){var i,n;e.shape.activity&&e.shape.activity.subProcess&&e.shape.activity.subProcess.events&&void 0!==e.shape.activity.subProcess.events[0]&&void 0!==e.shape.activity.subProcess.events[0].event?"NonInterruptingStart"!==e.shape.activity.subProcess.events[0].event&&"Start"!==e.shape.activity.subProcess.events[0].event||(t.visible=!0):e.shape.activity&&e.shape.activity.subProcess&&e.shape.activity.subProcess.transaction?(i=e.shape.activity.subProcess.transaction,n=["success","failure","cancel"].some(function(e){var e=i[""+e];return!!e&&("Start"===(e=e.event)||"NonInterruptingStart"===e)}),t.visible=n||t.visible):void 0===e.shape.event||"NonInterruptingStart"!==e.shape.event.event&&"Start"!==e.shape.event.event||(t.visible=!0)},yDi.prototype.updateBPMNEvent=function(e,t,i){t.shape;var n=e.wrapper.children[0];void 0===t.width&&void 0===t.height||this.setSizeForBPMNEvents(e.shape.event,n,t.width||e.width,t.height||e.height)},yDi.prototype.updateBPMNActivity=function(e,t,i,n){var o,r,s,a,l,h=t.shape,d=e.wrapper.children[0];d&&d.children&&0<d.children.length&&d.children[0]&&(o=this.getSize(e,d.children[0].children[0]),h&&(s=i.shape.activity.activity,r=e.shape.activity.activity,"SubProcess"!==s&&"Task"!==s||"SubProcess"!==r&&"Task"!==r?("Task"===r&&void 0!==h.activity.task&&(this.updateBPMNActivityTask(e,t),s=this.getTaskChildCount(e),l=void 0,a=o.width/2-12*s,l=1===s?8+a:a+8*(s-1),void 0!==h.activity.task.loop)&&this.updateBPMNActivityTaskLoop(e,t,l,s,a,2),"SubProcess"===r&&void 0!==h.activity.subProcess&&this.updateBPMNActivitySubProcess(e,t,i,n)):(n.removeElements(e),e.wrapper.children[0]=this.getBPMNActivityShape(e)),this.setSizeForBPMNActivity(e.shape.activity,d,t.width||o.width,t.height||o.height,e)),void 0===t.width&&void 0===t.height||this.setSizeForBPMNActivity(e.shape.activity,d,t.width||o.width,t.height||o.height,e))},yDi.prototype.updateBPMNActivityTask=function(e,t){for(var t=t.shape,i=e.wrapper.children[0].children[0],n=t.activity.task,o=0;o<i.children.length;o++)i.children[parseInt(o.toString(),10)].id===e.id+"_2_loop"&&(s=document.getElementById(e.id+"_2_loop")).parentNode.removeChild(s);if(void 0!==n.type){n.type=n.type||"None";var r=CDi(n.type);i.children[1].data=r;for(var s,o=0;o<i.children.length;o++)i.children[parseInt(o.toString(),10)].id===e.id+"_1_tasktType"&&(i.children.splice(o,1),(s=document.getElementById(e.id+"_1_tasktType")).parentNode.removeChild(s)),i.children[parseInt(o.toString(),10)].id===e.id+"_1_taskTypeService"&&(i.children.splice(o,1),(s=document.getElementById(e.id+"_1_taskTypeService")).parentNode.removeChild(s));var a=new kyi;a.id=e.id+"_1_tasktType",a.margin.left=5,a.margin.top=5,a.data=r,a.style.fill="transparent",a.style.opacity=e.style.opacity,"Receive"===n.type||"Send"===n.type?(a.width=18,a.height=16,"Send"===n.type&&(a.style.fill="black"),i.children.splice(1,0,a)):"Manual"===n.type?(a.width=16,a.height=11,i.children.splice(1,0,a)):"Service"!==n.type?(a.width=20,a.height=20,i.children.splice(1,0,a)):(a.width=20,a.height=20,i.children.splice(1,0,a),(n=new kyi).id=e.id+"_1_taskTypeService",n.data=r,n.margin.left=i.children[1].margin.left+9,n.margin.top=i.children[1].margin.top+9,n.style.fill="white",n.style.opacity=e.style.opacity,i.children.splice(2,0,n))}void 0!==t.activity.task.call&&(!1!==t.activity.task.call?i.children[0].style.strokeWidth=4:i.children[0].style.strokeWidth=1),void 0!==t.activity.task.compensation&&(!0===t.activity.task.compensation?(a="Service"===e.shape.activity.task.type,i.children[a?4:3].visible=!0):i.children[3].visible=!1)},yDi.prototype.updateBPMNActivityTaskLoop=function(e,t,i,n,o,r){var s,a,t=t.shape,l=e.wrapper.children[0].children[0],t=t.activity,e=e.shape.activity.task.type,h=0;void 0!==t.subProcess?(s=t.subProcess,h="Transaction"===t.subProcess.type?2:0<t.subProcess.events.length?1:0,a=SDi(s=s.loop),l.children[2+h].data=a,l.children[2+h].visible="None"!==s):void 0!==t.task&&void 0!==t.task.loop&&"Service"!==e?(a=SDi(t.task.loop),l.children[2].data=a,l.children[2].visible="None"!==t.task.loop):void 0!==t.task&&void 0!==t.task.loop&&"Service"===e&&(a=SDi(t.task.loop),l.children[3].data=a,l.children[3].visible="None"!==t.task.loop),this.updateChildMargin(l,n,o,i,r+h)},yDi.prototype.updateChildMargin=function(e,t,i,n,o){if(1===t)for(var r=o;r<e.children.length;r++)2!==r&&!0===e.children[parseInt(r.toString(),10)].visible&&(e.children[parseInt(r.toString(),10)].margin.left=n,n=i+8);else{n=i+8*(t-1);for(r=o;r<e.children.length;r++)2!==r&&!0===e.children[parseInt(r.toString(),10)].visible&&(e.children[parseInt(r.toString(),10)].margin.left=n,n+=20)}},yDi.prototype.updateBPMNActivitySubProcess=function(e,t,i,n){var o=t.shape,r=e.wrapper.children[0],s=this.getSize(e,r.children[0].children[0]),o=o.activity.subProcess,a=this.getSubprocessChildCount(e),s=s.width/2-12*a,l=1===a?8+s:s+8*(a-1);UAi(e.style,r.children[0].children[0]),void 0!==o.events&&this.updateBPMNSubProcessEvent(e,t,i,n),void 0!==o.adhoc&&this.updateBPMNSubProcessAdhoc(e,i,o,l,a,s),void 0!==o.boundary&&this.updateBPMNSubProcessBoundary(e,o),void 0!==o.collapsed&&this.updateBPMNSubProcessCollapsed(e,i,o,l,a,s,n),void 0!==o.compensation&&this.updateBPMNSubProcessCompensation(e,i,o,l,a,s),void 0!==o.loop&&this.updateBPMNSubProcessLoop(e,i,o,l,a,s),void 0!==o.transaction&&this.updateBPMNSubProcessTransaction(e,t,i,n)},yDi.prototype.updateBPMNSubProcessEvent=function(e,t,i,n){for(var o=t.shape,r=e.wrapper.children[0],s=r.children[0],a=(r.children[0].children.length,o.activity.subProcess),l=0,h=Object.keys(a.events);l<h.length;l++){var d=h[l],d=Number(d),p=s.children[d+2],c=e.shape.activity.subProcess.events[parseInt(d.toString(),10)];this.updateBPMNSubEvent(e,a.events[parseInt(d.toString(),10)],c,p,t,i,n)}},yDi.prototype.updateBPMNSubEvent=function(e,t,i,n,o,r,s){var a,l,h,d,p,c=e.wrapper.children[0],u=o.shape;void 0!==n.children&&(p=n.children[0],a=n.children[1],l=n.children[2],h=d=void 0,!o.style||void 0===o.style.strokeColor&&void 0===o.style.opacity||(c.children[0].children[1].style.strokeColor=o.style.strokeColor,c.children[0].children[1].style.opacity=o.style.opacity),void 0!==u.activity.subProcess&&(d=t.event,h=t.trigger),void 0!==d&&this.getEvent(o,r,d,p,a,l),void 0!==h&&(o.style&&UAi(o.style,c.children[0]),this.removeBPMNElementFromDOM(e,s),e.wrapper.children[0]=this.getBPMNActivityShape(e)),void 0===t.height&&void 0===t.width||this.getEventSize(t,n),void 0!==t.id&&(n.id=t.id),void 0!==t.margin&&(n.margin=t.margin),void 0!==t.horizontalAlignment&&(n.horizontalAlignment=t.horizontalAlignment),void 0!==t.verticalAlignment&&(n.verticalAlignment=t.verticalAlignment),void 0!==t.offset&&(n.setOffsetWithRespectToBounds(i.offset.x,i.offset.y,"Fraction"),n.relativeMode="Point"),void 0!==t.annotations&&(u=void 0,r=c.children[0].children[2],n.children[3])&&3<n.children.length&&(u=n.children[3],s.updateAnnotation(t.annotations[0],u,r)),void 0!==t.ports&&(d=void 0,p=c.children[0].children[2],n.children[4])&&4<n.children.length&&(d=n.children[4],s.updatePort(t.ports[0],d,p)),void 0!==t.visible)&&"Event"!==e.shape.activity.subProcess.type&&this.updateDiagramContainerVisibility(n,t.visible)},yDi.prototype.updateBPMNSubProcessTransaction=function(e,t,i,n){var o,r=t.shape.activity.subProcess.transaction,s=e.wrapper.children[0].children[0].children[2];void 0!==r.success&&(o=e.shape.activity.subProcess.transaction.success,this.updateBPMNSubEvent(e,r.success,o,s.children[0],t,i,n)),void 0!==r.cancel&&(o=e.shape.activity.subProcess.transaction.cancel,this.updateBPMNSubEvent(e,r.cancel,o,s.children[1],t,i,n)),void 0!==r.failure&&(o=e.shape.activity.subProcess.transaction.failure,this.updateBPMNSubEvent(e,r.failure,o,s.children[2],t,i,n));for(var a=0,l=e.outEdges;a<l.length;a++){var h=l[a],d=n.nameTable[""+h];switch(d.sourcePortID){case"success":r.success&&void 0!==r.success.visible&&n.connectorPropertyChange(d,{},{sourcePortID:"success"});break;case"cancel":r.cancel&&void 0!==r.cancel.visible&&n.connectorPropertyChange(d,{},{sourcePortID:"cancel"});break;case"failure":r.failure&&void 0!==r.failure.visible&&n.connectorPropertyChange(d,{},{sourcePortID:"failure"})}}},yDi.prototype.getEventSize=function(e,t){void 0!==e.height&&(t.height=e.height,t.children[0].height=e.height,t.children[1].height=.85*e.height,t.children[2].height=.54*e.height),void 0!==e.width&&(t.width=e.width,t.children[0].width=e.width,t.children[1].width=.85*e.width,t.children[2].width=.54*e.width)},yDi.prototype.updateBPMNSubProcessAdhoc=function(e,t,i,n,o,r){e.shape;var s=e.wrapper.children[0].children[0],e="Transaction"===e.shape.activity.subProcess.type?2:0<e.shape.activity.subProcess.events.length?1:0;!1===i.adhoc?s.children[3+e].visible=!1:s.children[3+e].visible=!0,this.updateChildMargin(s,o,r,n,3+e)},yDi.prototype.updateBPMNSubProcessBoundary=function(e,t){e.shape;e=e.wrapper.children[0].children[0].children[0];"Default"===t.boundary&&(e.style.strokeWidth=1,e.style.strokeDashArray="1 0"),"Call"===t.boundary&&(e.style.strokeWidth=4,e.style.strokeDashArray="1 0"),"Event"===t.boundary&&(e.style.strokeWidth=1,e.style.strokeDashArray="2 2")},yDi.prototype.updateElementVisibility=function(e,t,i){if(e.shape.activity.subProcess.processes&&0<e.shape.activity.subProcess.processes.length)for(var n=e.shape.activity.subProcess.processes,o=n.length-1;0<=o;o--)for(var r=i.nameTable[n[parseInt(o.toString(),10)]],s=(r.visible=t,i.updateElementVisibility(r.wrapper,r,t),t&&(N||"Event"!==r.shape.shape||this.setEventVisibility(r,r.wrapper.children[0].children),"SubProcess"===r.shape.activity.activity)&&this.setSubProcessVisibility(r),r.inEdges.concat(r.outEdges)),a=s.length-1;0<=a;a--){var l=i.nameTable[s[parseInt(a.toString(),10)]];l.visible=t,i.updateElementVisibility(l.wrapper,l,t)}if(t&&(N||"Event"!==e.shape.shape||this.setEventVisibility(e,e.wrapper.children[0].children),"SubProcess"===e.shape.activity.activity&&this.setSubProcessVisibility(e),"Task"!==e.shape.activity.activity||N||"Activity"!==e.shape.shape||"None"!==e.shape.activity.subProcess.loop||(e.wrapper.children[0].children[0].children[3].visible=!1),"DataObject"===e.shape.shape))if(!1===e.shape.dataObject.collection&&"None"===e.shape.dataObject.type)for(a=e.wrapper.children[0].children.length-1;0<a;a--)e.wrapper.children[0].children[parseInt(a.toString(),10)].visible=!1;else!0===e.shape.dataObject.collection&&"None"===e.shape.dataObject.type?e.wrapper.children[0].children[1].visible=!1:!1!==e.shape.dataObject.collection||"Input"!==e.shape.dataObject.type&&"Output"!==e.shape.dataObject.type||(e.wrapper.children[0].children[2].visible=!1)},yDi.prototype.updateBPMNSubProcessCollapsed=function(e,t,i,n,o,r,s){var a=e.shape.activity.subProcess.events.length,l=e.wrapper.children[0].children[0],h="Transaction"===e.shape.activity.subProcess.type?3:0<e.shape.activity.subProcess.events.length?0:1;!1===i.collapsed?(this.updateElementVisibility(e,!0,s),l.children[h+a].visible=!1):(this.updateElementVisibility(e,!1,s),l.children[h+a].visible=!0),this.updateChildMargin(l,o,r,n,3+a)},yDi.prototype.updateBPMNSubProcessCompensation=function(e,t,i,n,o,r){var s=e.wrapper.children[0].children[0],e="Transaction"===e.shape.activity.subProcess.type?2:0<e.shape.activity.subProcess.events.length?1:0;!1===i.compensation?s.children[4+e].visible=!1:s.children[4+e].visible=!0,this.updateChildMargin(s,o,r,n,4+e)},yDi.prototype.updateBPMNSubProcessLoop=function(e,t,i,n,o,r){this.updateBPMNActivityTaskLoop(e,e,n,o,r,1)},yDi.prototype.updateBPMNConnector=function(e,t,i,n){var o=i.shape,r=e.shape.flow;return"Sequence"!==o.flow&&!o.sequence||"Sequence"!==r||(e=this.getSequence(e,t,i,n)),"Association"!==o.flow&&!o.association||"Association"!==r||(e=this.getAssociation(e,t,i,n)),e="Message"!==o.flow&&!o.message||"Message"!==r?e:this.getMessage(e,t,i,n)},yDi.prototype.getSequence=function(e,t,i,n){if("Normal"!==i.shape.sequence&&"Normal"!==e.shape.sequence||(e.targetDecorator.shape="Arrow",e.sourceDecorator.shape="None",e.style.strokeDashArray="None",e.targetDecorator.style.fill="black",e.targetDecorator.width=10,e.targetDecorator.height=10,n.connectorPropertyChange(e,t,{targetDecorator:{shape:"Arrow",style:{fill:"black"},height:10,width:10},sourceDecorator:{shape:"None"},style:{strokeDashArray:"None"}}),e.wrapper.children[3].visible=!1),"Default"===i.shape.sequence||"Default"===e.shape.sequence){e.targetDecorator.shape="Arrow",e.sourceDecorator.shape="None",e.style.strokeDashArray="None",e.targetDecorator.style.fill="black",e.targetDecorator.width=10,e.targetDecorator.height=10,n.connectorPropertyChange(e,t,{style:{strokeDashArray:"None"},targetDecorator:{shape:"Arrow",style:{fill:"black"},height:10,width:10},sourceDecorator:{shape:"None"}});for(var o=new kyi,r=(new kyi,void 0),s=(e.getSegmentElement(e,o),e.intermediatePoints),a=0;a<s.length-1;a++)length+=e.distance(s[parseInt(a.toString(),10)],s[a+1]),r=e.findPath(s[parseInt(a.toString(),10)],s[a+1]);o=new kyi;o.data=r[0],o.id=e.id+"_"+i.shape.sequence||e.shape.sequence,o.offsetX=r[1].x,o.offsetY=r[1].y,o.rotateAngle=45,o.transform=tyi.Self,this.removeDomElement(e,n,o)}return"Conditional"!==i.shape.sequence&&"Conditional"!==e.shape.sequence||(e.sourceDecorator.shape="Diamond",e.sourceDecorator.width=20,e.sourceDecorator.height=10,e.sourceDecorator.style.fill="white",e.targetDecorator.style.fill="black",e.style.strokeDashArray="None",e.targetDecorator.shape="Arrow",n.connectorPropertyChange(e,t,{style:{strokeDashArray:"None"},targetDecorator:{shape:"Arrow",style:{fill:"black"},height:10,width:10},sourceDecorator:{shape:"Diamond",width:20,height:10,style:{fill:"white"}}}),e.wrapper.children[3].visible=!1),e},yDi.prototype.getAssociation=function(e,t,i,n){return"Default"!==i.shape.association&&"Default"!==e.shape.association||(e.sourceDecorator.shape="None",e.targetDecorator.shape="None",e.style.strokeDashArray="2 2",n.connectorPropertyChange(e,t,{style:{strokeDashArray:"2 2"},targetDecorator:{shape:"None"},sourceDecorator:{shape:"None"}}),e.wrapper.children[3].visible=!1),"Directional"!==i.shape.association&&"Directional"!==e.shape.association||(e.sourceDecorator.shape="None",e.style.strokeDashArray="2 2",e.targetDecorator.shape="OpenArrow",e.targetDecorator.width=10,e.targetDecorator.height=10,n.connectorPropertyChange(e,t,{style:{strokeDashArray:"2 2"},targetDecorator:{shape:"OpenArrow",width:10,height:10},sourceDecorator:{shape:"None"}}),e.wrapper.children[3].visible=!1),"BiDirectional"!==i.shape.association&&"BiDirectional"!==e.shape.association||(e.sourceDecorator.shape="OpenArrow",e.targetDecorator.shape="OpenArrow",e.sourceDecorator.width=10,e.sourceDecorator.height=10,e.sourceDecorator.style.fill="black",n.connectorPropertyChange(e,t,{style:{strokeDashArray:"2 2"},targetDecorator:{shape:"OpenArrow",width:10,height:10},sourceDecorator:{shape:"OpenArrow",width:10,height:10,style:{fill:"black"}}}),e.wrapper.children[3].visible=!1),e},yDi.prototype.getMessage=function(e,t,i,n){e.sourceDecorator.shape="Circle",e.sourceDecorator.width=10,e.targetDecorator.shape="Arrow",e.sourceDecorator.height=10,e.sourceDecorator.style.fill="White",e.targetDecorator.style.fill="White",n.connectorPropertyChange(e,t,{sourceDecorator:{shape:"Circle",style:{fill:"White"},width:10,height:10},targetDecorator:{shape:"Arrow",style:{fill:"white"}}});for(var o,r,s=e.intermediatePoints,a=0,l=0;l<s.length-1;l++){var h=.5*(a+=e.distance(s[l],s[l+1]));h<=a&&(o=K0i(s[parseInt(l.toString(),10)],s[l+1]),r=Hmi.transform(s[parseInt(l.toString(),10)],o,h))}t=new kyi;return e.wrapper.children[0].style.strokeDashArray=" 4 4",e.style.strokeDashArray="4 4",t.id=e.id+"_"+i.shape.message||e.shape.message,t.width=25,t.height=15,t.data="M0,0 L19.8,12.8 L40,0 L0, 0 L0, 25.5 L40, 25.5 L 40, 0",t.horizontalAlignment="Center",t.verticalAlignment="Center",t.transform=tyi.Self,t.style.fill="NonInitiatingMessage"===i.shape.message?"lightgrey":"white",t.offsetX=r.x,t.offsetY=r.y,"Default"!==i.shape.message&&void 0!==i.shape.message||"Default"!==e.shape.message?t.style.fill="NonInitiatingMessage"===(i.shape.message||e.shape.message)?"lightgrey":"white":t.visible=!1,this.removeDomElement(e,n,t),e},yDi.prototype.removeDomElement=function(e,t,i){for(var n=0,o=t.views;n<o.length;n++){var r=o[n];fTi(e.id+"_groupElement",r),fTi(e.id+"_content_groupElement",r),fTi(e.id+"_html_element",r)}e.wrapper.children.splice(3,1),e.wrapper.children.splice(3,0,i)},yDi.prototype.setSizeForBPMNEvents=function(e,t,i,n){t.children[0].width=i,t.children[0].height=n;var o=t.children[1],o=(o.width=.85*i,o.height=.85*n,t.children[2]);"Message"===e.trigger?(o.width=.54*i,o.height=.4*n):(o.width=.5*i,o.height=.5*n)},yDi.prototype.updateAnnotationDrag=function(e,t,i,n){return!!e.processId&&(this.drag(e,i,n,t),!0)},yDi.prototype.getAnnotationPathAngle=function(e,t){var i=0;switch(uvi(e,t,t)){case"Right":i=0;break;case"Left":i=180;break;case"Bottom":i=90;break;case"Top":i=270}return i},yDi.prototype.setSizeForBPMNGateway=function(e,t,i,n){t.children[0].width=i,t.children[0].height=n,t.children[1].width=.45*i,t.children[1].height=.45*n},yDi.prototype.setSizeForBPMNDataObjects=function(e,t,i,n){t.children[0].width=i,t.children[0].height=n},yDi.prototype.setSizeForBPMNActivity=function(e,t,i,n,o){t.children[0].width=i,t.children[0].height=n,t.children[0].children[0].width=i,t.children[0].children[0].height=n,"Transaction"===e.subProcess.type&&(t.children[0].children[1].width=Math.max(i-6,1),t.children[0].children[1].height=Math.max(n-6,1),t.children[0].children[2].width=i,t.children[0].children[2].height=n);for(var n=new vyi,n=this.getSize(o,n),e="Task"===e.activity?this.getTaskChildCount(o):this.getSubprocessChildCount(o),o=(i||n.width)/2,r=1===e?o-6:o-12*e/2-4*(e-1)/2,s=0;s<t.children[0].children.length;s++)t.children[0].children[parseInt(s.toString(),10)].visible&&(-1<t.children[0].children[parseInt(s.toString(),10)].id.indexOf("_loop")||-1<t.children[0].children[parseInt(s.toString(),10)].id.indexOf("_0_compensation")||-1<t.children[0].children[parseInt(s.toString(),10)].id.indexOf("_0_adhoc")||-1<t.children[0].children[parseInt(s.toString(),10)].id.indexOf("_0_collapsed"))&&(t.children[0].children[parseInt(s.toString(),10)].margin.left=r,r+=t.children[0].children[parseInt(s.toString(),10)].actualSize.width+4)},yDi.prototype.updateDiagramContainerVisibility=function(e,t){if(e instanceof Syi)for(var i=0;i<e.children.length;i++)this.updateDiagramContainerVisibility(e.children[parseInt(i.toString(),10)],t);e.visible&&e.visible!==t&&(e.visible=t)},yDi.prototype.destroy=function(){},yDi.prototype.getModuleName=function(){return"Bpmn"};$$=yDi;function yDi(){this.bpmnTextAnnotationConnector=[]}function vDi(e){return ADi[e.toString()]}function bDi(e){return xDi[e.toString()]}function wDi(e){return IDi[e.toString()]}function CDi(e){return TDi[e.toString()]}function SDi(e){return EDi[e.toString()]}var ADi={Event:"M80.5,12.5 C80.5,19.127417 62.59139,24.5 40.5,24.5 C18.40861,24.5 0.5,19.127417 0.5,12.5C0.5,5.872583 18.40861,0.5 40.5,0.5 C62.59139,0.5 80.5,5.872583 80.5,12.5 z",Message:"M0,0L19.8,12.8L40,0L0,0L0,25.5L40,25.5L40,0z",DataSource:"M 0 10.6 c 0 5.9 16.8 10.6 37.5 10.6 S 75 16.4 75 10.6 v 0 v 68.9 v -0.1 C 75 85.3 58.2 90 37.5 90 S 0 85.3 0 79.4 l 0 0.1 V 56 V 40.6 L 0 10.6 C 0 4.7 16.8 0 37.5 0 S 75 4.7 75 10.6 S 58.2 21.2 37.5 21.2S 0 16.5 0 10.6 l 0 6.7 v -0.2 c 0 5.9 16.8 10.6 37.5 10.6 S 75 22.9 75 17.1 v 6.8 v -0.1 c 0 5.9 -16.8 10.6 -37.5 10.6 S 0 29.6 0 23.8",SubProcess:"M100,100 h200 a20,20 0 0 1 20,20 v200 a20,20 0 0 1 -20,20 h-200 a20,20 0 0 1 -20,-20 v-200 a20,20 0 0 1 20,-20 z",collapsedShape:"M 8.13789 15 H 0 V 0 H 8.13789 V 15 Z M 0.625991 13.75 H 7.51189 V 1.25 H 0.625991 V 13.75 Z M 2.18095 7.03125 L 5.95631 7.03125 L 5.95631 7.46875 L 2.18095 7.46875 Z M 3.8342 3.73 L 4.30369 3.73 L 4.30369 11.2687 L 3.8342 11.2687 Z"},xDi={Message:"M0,0 L19.8,12.8 L40,0 L0, 0 L0, 25.5 L40, 25.5 L 40, 0",Timer:"M40,20c0,8.654-5.496,16.024-13.189,18.81C24.685,39.58,22.392,40,20,40C8.954,40,0,31.046,0,20S8.954,0,20,0S40,8.954,40,20z M20,0 L20,2.583 L20,5.283 M10.027,2.681L11.659,5.507 L12.669,7.257 M2.731,9.989 L6.014,11.885 L7.307,12.631 M0.067,19.967 L2.667,19.967 L5.35,19.967M2.748,29.939 L5.731,28.217 L7.323,27.298 M10.056,37.236 L11.292,35.095 L12.698,32.66 M20.033,39.9 L20.033,36.417 L20.033,34.617M30.006,37.219 L28.893,35.292 L27.364,32.643 M37.302,29.911 L34.608,28.355 L32.727,27.269M39.967,19.933 L37.417,19.933 L34.683,19.933 M37.286,9.961 L34.583,11.521 L32.71,12.602 M29.977,2.664 L28.653,4.957 L27.336,7.24 M22.104,8.5 L19.688,20 L24.75,20 L31.604,20 L24.75,20 L19.688,20z",Error:"M 23.77 18.527 l -7.107 27.396 l 8.507 -17.247 L 36.94 40.073 l 6.394 -25.997 l -8.497 15.754 L 23.77 18.527 Z",Escalation:"M 30.001 8.098 L 11.842 43.543 l 18.159 -18.882 l 18.162 18.882 L 30.001 8.098 Z ",Cancel:"M 3.5 16 L 0 12.6 L 4.6 8 L 0 3.5 L 3.4 0 L 8 4.6 l 4.5 -4.5 L 16 3.5 L 11.5 8 l 4.5 4.5 l -3.4 3.5 L 8 11.4 L 3.5 16 Z",Compensation:"M 25.7086 0 L 0 25 L 25.7086 50 V 26.3752 L 50 50 V 0 L 25.7086 23.6248 V 0 Z ",Conditional:"M 0 0 H 16 V 16 H 0 z M 1.14 3.2 H 14.85 M 1.14 6.4 H 14.85 M 1.14 9.6 H 14.85 M 1.14 12.8 H 14.85",Link:"M 32.014 19.258 v 5.992 H 9.373 v 9.504 h 22.641 v 5.988 L 50.622 30 L 32.014 19.258 Z",Signal:"M 50 50 H 0 L 25.0025 0 L 50 50 Z",Terminate:"M 25 50 C 11.21 50 0 38.79 0 25 C 0 11.21 11.21 0 25 0 C 38.78 0 50 11.21 50 25 C 50 38.79 38.78 50 25 50",Multiple:"M 17.784 48.889 H 42.21 l 7.548 -23.23 L 29.997 11.303 L 10.236 25.658 L 17.784 48.889 Z",Parallel:"M 27.276 49.986 h 5.58 v -17.15 h 17.146 V 27.17 h -17.15 l 0.004 -17.15 h -5.58 l -0.004 17.15 H 9.994 v 5.666 h 17.278 L 27.276 49.986 Z"},IDi={None:"",Exclusive:"M 11.196 29.009 l 6.36 -9.712 l -5.764 -8.899 h 4.393 l 3.732 5.979 l 3.656 -5.979 h 4.354 l -5.789 9.039l 6.36 9.572 h -4.532 l -4.126 -6.437 l -4.139 6.437 H 11.196 Z",Inclusive:"M 20.323 31.333 c -6.625 0 -12.015 -5.39 -12.015 -12.015 s 5.39 -12.015 12.015 -12.015 s 12.016 5.39 12.016 12.015 S 26.948 31.333 20.323 31.333 Z M 20.323 9.303 c -5.522 0 -10.015 4.493 -10.015 10.015 s 4.492 10.015 10.015 10.015 s 10.016 -4.493 10.016 -10.015 S 25.846 9.303 20.323 9.303 Z",Parallel:"M 18.394 29.542 v -8.833 H 9.626 v -3.691 h 8.768 V 8.251 h 3.734 v 8.767 h 8.768 v 3.691 h -8.768 v 8.833 H 18.394 Z",Complex:"M29.198,19.063L23.089,19.063L27.794,14.358L26.38,12.944L21.223,18.101L21.223,10.443L19.223,10.443L19.223,17.976L14.022,12.776L12.608,14.19L17.48,19.063L10.365,19.063L10.365,21.063L18.261,21.063L12.392,26.932L13.806,28.346L19.223,22.929L19.223,30.225L21.223,30.225L21.223,22.805L25.925,27.507L27.339,26.093L22.309,21.063L29.198,21.063z",EventBased:"M 20.322 29.874 c -5.444 0 -9.873 -4.43 -9.873 -9.874 s 4.429 -9.874 9.873 -9.874 s 9.874 4.429 9.874 9.874 S 25.767 29.874 20.322 29.874 Z M 20.322 32.891 c -7.107 0 -12.89 -5.783 -12.89 -12.891 c 0 -7.107 5.782 -12.89 12.89 -12.89 c 7.108 0 12.891 5.783 12.891 12.89 C 33.213 27.108 27.431 32.891 20.322 32.891 Z M 24.191 25.386 h -7.984 l -2.469 -7.595 l 6.461 -4.693 l 6.461 4.693 L 24.191 25.386 Z",ExclusiveEventBased:"M 30 15 C 30 23.28 23.28 30 15 30 S 0 23.28 0 15 S 6.72 0 15 0 S 30 6.72 30 15 z M 15 5 L 5 12.5 L 8 22.5 H 22 L 25 12.5 z",ParallelEventBased:"M 35 17.5 C 35 27.16 27.16 35 17.5 35 S 0 27.16 0 17.5 S 7.84 0 17.5 0 S 35 7.84 35 17.5 z M 14.58 5.83 V 14.58 H 5.83 V 20.42 H 14.58 V 29.17 H 20.42 V 20.42 H 29.17 V 14.58 H 20.42 V 5.83 z"},TDi={None:"",Service:"M 32.699 20.187 v -4.005 h -3.32 c -0.125 -0.43 -0.292 -0.83 -0.488 -1.21 l 2.373 -2.375 l -2.833 -2.83 l -2.333 2.333 c -0.44 -0.253 -0.9 -0.448 -1.387 -0.595 v -3.32 h -4.003 v 3.32 c -0.46 0.137 -0.890.322 -1.3 0.537 l -2.285 -2.275 l -2.833 2.83 l 2.285 2.278 c -0.235 0.42 -0.41 0.847 -0.547 1.307 h -3.33 v 4.005 h 3.33 c 0.148 0.488 0.343 0.955 0.588 1.395 l -2.325 2.325 l 2.822 2.832 l 2.373 -2.382 c 0.392 0.205 0.792 0.37 1.212 0.497 v 3.33 h 4.003 v -3.33 c 0.46 -0.138 0.89 -0.323 1.3 -0.547 l 2.43 2.432 l 2.822 -2.832 l -2.42 -2.422 c 0.222 -0.41 0.4 -0.85 0.535-1.297 H 32.699 Z M 22.699 21.987 c -2.1 0 -3.803 -1.703 -3.803 -3.803 c 0 -2.1 1.703 -3.803 3.803 -3.803 c 2.1 0 3.803 1.703 3.803 3.803 C 26.502 20.285 24.8 21.987 22.699 21.987 Z",Receive:"M 12.217 12.134 v 13.334 h 20 V 12.134 H 12.217 Z M 30.44 13.007 l -8.223 5.35 l -8.223 -5.35 H 30.44 Z M 13.09 24.594 V 13.459 l 9.127 5.94 l 9.127 -5.94 v 11.135 H 13.09 Z",Send:"M0,1.2260086 L8.0000002,8.3380068 16,1.2260086 16,12.000007 0,12.000007 z M1.6300015,0 L14.371001,0 8.0000055,5.662 z",InstantiatingReceive:"M 16.306 17.39 v 8.79 h 13.198 v -8.79 H 16.306 Z M 28.375 17.946 l -5.47 3.558 l -5.47 -3.558 H 28.375 Z M 28.948 25.625 H 16.861 v -7.389 l 6.043 3.931 l 6.043 -3.931 V 25.625 Z M 22.905 11.785c -5.514 0 -9.999 4.486 -9.999 10 c 0 5.514 4.485 10 9.999 10 s 9.999 -4.486 9.999 -10 C 32.904 16.272 28.419 11.785 22.905 11.785 Z M 22.905 31.239 c -5.212 0 -9.453 -4.241 -9.453 -9.454c 0 -5.212 4.241 -9.453 9.453 -9.453 s 9.452 4.241 9.452 9.453 C 32.357 26.998 28.117 31.239 22.905 31.239 Z",Manual:"M9.21 612 L5.82 612 L1.07 612 a1.07317 1 -180 0 1 -1.07317 -1 L0 604.75 A3.42007 1.59344 -180 0 0 1.61 604 L2.6 604 L5.99 604 a0.721171 0.672 0 0 1 0.721171 0.672 a0.721171 0.672 0 0 1 -0.721171 0.672 L2.6 605.34 a0.48818 0.183302 -90 0 0 0.0837073 0.342385 L5.63 605.69 a0.721171 0.672 0 0 1 0.184585 -0.0223847 L10.28 605.66 a0.721171 0.672 0 0 1 0.721171 0.672 a0.721171 0.672 0 0 1 -0.721171 0.672 L5.82 607.01 a0.721171 0.672 0 0 1 -0.184585 -0.0223847 L5.63 607.35 a0.721171 0.672 0 0 1 0.184585 -0.0223847 L10.01 607.33 a0.721171 0.672 0 0 1 0.721171 0.672 a0.721171 0.672 0 0 1 -0.721171 0.672 L5.82 608.67 a0.721171 0.672 0 0 1 -0.184585 -0.0223847 L5.63 609.01 a0.721171 0.672 0 0 1 0.184585 -0.0223847 L9.47 608.99 a0.721171 0.672 0 0 1 0.721171 0.672 a0.721171 0.672 0 0 1 -0.721171 0.672 L5.82 610.34 a0.721171 0.672 0 0 1 -0.184585 -0.0223847 L5.63 610.68 a0.721171 0.672 0 0 1 0.184585 -0.0223847 L9.21 610.66 a0.721171 0.672 0 0 1 0.721171 0.672 a0.721171 0.672 0 0 1 -0.721171 0.672",BusinessRule:"M 32.844 13.245 h -0.089 v 0 H 13.764 v -0.015 h -1.009 v 16.989 h 0.095 v 0.011 h 19.716 v -0.011 h 0.278 V 13.245 Z M 31.844 14.229 v 4.185 h -18.08 v -4.185 H 31.844 Z M 18.168 25.306 v 3.938 h -4.404 v -3.938 H 18.168 Z M 13.764 24.322 v -4.923 h 4.404 v 4.923 H 13.764 Z M 19.177 25.306 h 12.667 v 3.938 H 19.177 V 25.306 Z M 19.177 24.322v -4.923 h 12.667 v 4.923 H 19.177 Z",User:"M8.6751149,13.75 L10.79009,18.703003 11.664047,18.696991 13.792084,13.75 13.824066,13.75 C18.177001,13.75 21.709022,17.259003 21.748998,21.60199 21.748998,21.649994 21.743993,21.700012 21.735021,21.747009 21.137981,24.774994 18.775997,27.144989 15.74904,27.75 L6.7491024,27.75 C3.7231224,27.144989 1.3601628,24.774994 0.76312089,21.747009 0.75414884,21.700012 0.74914402,21.649994 0.75012076,21.60199 0.78912175,17.259003 4.3221171,13.75 8.6751149,13.75 z M11.249014,0.75 C14.287014,0.75 16.749015,3.2119999 16.749015,6.25 16.749015,9.2880001 14.287014,11.75 11.249014,11.75 8.211015,11.75 5.7490147,9.2880001 5.7490147,6.25 5.7490147,3.2119999 8.211015,0.75 11.249014,0.75 z",Script:"M22.3,80.4 A82.9529,77.0159,-180,0,0,10.3,46.7 A69.8467,64.8477,0,0,1,0,19.7 A27.6207,25.6439,0,0,1,12.1,0 L84.7,0 A37.4124,34.7347,-180,0,0,77.7,19.6 A82.8871,76.9547,-180,0,0,89.7,53.3 A69.8146,64.81790000000001,0,0,1,100,80.3 A27.603399999999997,25.6278,0,0,1,87.9,100 L15.3,100 A37.4265,34.7479,-180,0,0,22.3,80.4 M12.5,28.6 L67.3,28.6 M18.3,42.9 L72.1,42.9 M80.8,57.1 L26,57.1 M85.6,71.4 L32.6,71.4"},EDi={None:"",Standard:"M 52.002 73.379 c -2.494 -2.536 -6.55 -2.534 -9.043 0 c -1.208 1.228 -1.874 2.861 -1.874 4.598 c 0 1.225 0.337 2.395 0.957 3.411 l -1.167 1.186 l 2.071 0.458 l 2.071 0.458 l -0.45 -2.106 l -0.45 -2.106 l -1.292 1.314c -1.119 -2.065 -0.842 -4.709 0.877 -6.458 c 2.084 -2.119 5.475 -2.117 7.557 0 c 2.083 2.119 2.083 5.565 0 7.685c -0.976 0.992 -2.272 1.557 -3.65 1.59 l 0.025 1.068 c 1.65 -0.041 3.2 -0.716 4.368 -1.903 c 1.208 -1.228 1.874 -2.861 1.874 -4.597 C 53.875 76.24 53.209 74.607 52.002 73.379 Z",ParallelMultiInstance:"M 51.5,69.5 L52.5,69.5 L52.5,84.5 L51.5 84.5 Z M 46.5,69.5 L47.5,69.5 L47.5,84.5 L46.5 84.5 Z M 41.5,69.5 L42.5,69.5 L42.5,84.5 L41.5 84.5 Z  ",SequenceMultiInstance:"M 40.375,71.5 L 55.375,71.5 L 55.375,72.5 L 40.375,72.5 Z M 40.375,76.5 L 55.375,76.5 L 55.375,77.5 L 40.375,77.5 Z M 40.375,76.5 L 55.375,76.5 L 55.375,77.5 L 40.375,77.5 Z M 40.375,81.5 L 55.375,81.5L 55.375,82.5 L 40.375,82.5 Z"},M$=(DDi.prototype.updateBridging=function(e,t){var i,n,o=[];if(e.bridges=[],n=t,(i=e).constraints&Yfi.Bridging?i.constraints&Yfi.Bridging:i.constraints&Yfi.InheritBridging?n.constraints&$fi.Bridging:0){for(var r=this.getPoints(e),s=tfi.toBounds(r),a=e.bridgeSpace,l=t.bridgeDirection||"Top",h=-1,d=t.connectors,p=0;p<d.length;p++){var c=d[parseInt(p.toString(),10)];if(e&&c&&e.id!==c.id&&c.visible){var u=this.getPoints(c),g=tfi.toBounds(u);if(this.intersectsRect(s,g)){var m=this.intersect(r,u,!1,l,!0);if(0<m.length)for(var f=0;f<m.length;f++){var y=0,v=0,b=this.getLengthAtFractionPoint(e,m[parseInt(f.toString(),10)]);if(-1!==b.pointIndex){var w=b.lengthFractionIndex,y=(b.fullLength,b.segmentIndex),v=b.pointIndex,b=this.getPointAtLength(w-a/2,r),w=this.getPointAtLength(w+a/2,r),C=(this.isEmptyPoint(w)&&(w=b),void 0),S=e.sourcePoint,C="Straight"===e.type?e.targetPoint:e.intermediatePoints[parseInt(v.toString(),10)],S=this.angleCalculation(S,C);if(o.length){for(var A,x=e.sourcePoint,I=Math.abs(this.lengthCalculation(x,w)),T=-1,h=-1,E=0;E<o[parseInt(y.toString(),10)].bridges.length;E++){h++;var D=o[parseInt(y.toString(),10)].bridges[parseInt(E.toString(),10)];if(I<Math.abs(this.lengthCalculation(x,D.endPoint))){T=h;break}}0<=T?((A=this.createSegment(b,w,S,l,v,e,t)).target=c.id,o[parseInt(y.toString(),10)].bridges.splice(T,0,A),o[parseInt(y.toString(),10)].bridges.join(),o[parseInt(y.toString(),10)].bridgeStartPoint.splice(T,0,b),o[parseInt(y.toString(),10)].bridgeStartPoint.join()):((A=this.createSegment(b,w,S,l,v,e,t)).target=c.id,o[parseInt(y.toString(),10)].bridges.push(A),o[parseInt(y.toString(),10)].bridgeStartPoint.push(b)),o[parseInt(y.toString(),10)].segmentIndex=y}else isNaN(b.x)||isNaN(b.y)||this.isEmptyPoint(w)||(C={bridges:[],bridgeStartPoint:[],segmentIndex:y},(S=this.createSegment(b,w,S,l,v,e,t)).target=c.id,(v=[]).push(b),[].push(w),o[parseInt(y.toString(),10)]=C,o[parseInt(y.toString(),10)].bridges.push(S),o[parseInt(y.toString(),10)].bridgeStartPoint=v,o[parseInt(y.toString(),10)].segmentIndex=y)}}}}}0!==o.length&&this.firstBridge(o,e,a)}},DDi.prototype.firstBridge=function(e,t,i){for(var n=0;n<e.length;n++){for(var o,r=e[parseInt(n.toString(),10)],s=1;s<r.bridges.length;s++)Hmi.findLength(r.bridges[parseInt(s.toString(),10)].endPoint,r.bridges[s-1].endPoint)<i&&(r.bridges[s-1].endPoint=r.bridges[parseInt(s.toString(),10)].endPoint,l=r.bridges[s-1],o=this.createBridgeSegment(l.startPoint,l.endPoint,l.angle,i,l.sweep),r.bridges[s-1].path=o,r.bridges.splice(s,1),r.bridgeStartPoint.splice(s,1),s--);t.sourcePoint;for(var a=0;a<r.bridges.length;a++){var l;(l=r.bridges[parseInt(a.toString(),10)]).endPoint;t.bridges.push(l)}}},DDi.prototype.createSegment=function(e,t,i,n,o,r,s){var a={angle:0,endPoint:{x:0,y:0},target:"",path:"",segmentPointIndex:-1,startPoint:{x:0,y:0},sweep:1,rendered:!1},n=this.sweepDirection(i,n,r,s),s=this.createBridgeSegment(e,t,i,r.bridgeSpace,n);return a.path=s,a.startPoint=e,a.endPoint=t,a.angle=i,a.segmentPointIndex=o,a.sweep=n,a},DDi.prototype.createBridgeSegment=function(e,t,i,n,o){return"A "+n/2+" "+n/2+" "+i+" , 1 "+o+" "+t.x+","+t.y},DDi.prototype.sweepDirection=function(e,t,i,n){var o,r=Math.abs(e);switch(t){case"Top":case"Bottom":o=1,0<=r&&r<=90&&(o=0);break;case"Left":case"Right":o=1,e<0&&-180<=e&&(o=0)}return o="Right"!==t&&"Bottom"!==t?o:0===o?1:0},DDi.prototype.getPointAtLength=function(e,t){for(var i,n=0,o={x:0,y:0},r=0;r<t.length;r++){var s=t[parseInt(r.toString(),10)];if(i){var a=this.lengthCalculation(i,s);if(e<n+a){var l=e-n,h=Hmi.findAngle(i,s),d=l*Math.cos(h*Math.PI/180),l=l*Math.sin(h*Math.PI/180),o={x:i.x+d,y:i.y+l};break}n+=a}i=s}return o},DDi.prototype.getPoints=function(e){var t=[];if(e.intermediatePoints&&("Straight"===e.type||"Orthogonal"===e.type))for(var i=0;i<e.intermediatePoints.length;i++)t.push(e.intermediatePoints[parseInt(i.toString(),10)]);return t},DDi.prototype.intersectsRect=function(e,t){return t.x<e.x+e.width&&e.x<t.x+t.width&&t.y<e.y+e.height&&e.y<t.y+t.height},DDi.prototype.intersect=function(e,t,i,n,o){i&&2<=t.length&&(t.splice(0,1),t.splice(0,1));for(var r=[],s=0;s<e.length-1;s++){var a=this.inter1(e[parseInt(s.toString(),10)],e[s+1],t,o,n);if(0<a.length)for(var l=0;l<a.length;l++)r.push(a[parseInt(l.toString(),10)]);i&&1<=t.length&&t.splice(0,1)}return r},DDi.prototype.inter1=function(e,t,i,n,o){for(var r=[],s=0;s<i.length-1;s++){var a=AAi(e,t,i[parseInt(s.toString(),10)],i[s+1]);if(!this.isEmptyPoint(a)){var l=this.angleCalculation(e,t),h=this.angleCalculation(i[parseInt(s.toString(),10)],i[s+1]),l=this.checkForHorizontalLine(l),h=this.checkForHorizontalLine(h);switch(o){case"Left":case"Right":h<l&&r.push(a);break;case"Top":case"Bottom":l<h&&r.push(a)}l===h&&n&&r.push(a)}}return r},DDi.prototype.checkForHorizontalLine=function(e){e=Math.abs(e);return 90<e?180-e:e},DDi.prototype.isEmptyPoint=function(e){return 0===e.x&&0===e.y},DDi.prototype.getLengthAtFractionPoint=function(e,t){for(var i=100,n=-1,o=0,r=-1,s=0,a=0,l=e.sourcePoint,h=l,d=[],p=0;p<e.intermediatePoints.length;p++){var c=e.intermediatePoints[parseInt(p.toString(),10)];d.push(c)}for(var u=0;u<d.length;u++){var g=d[parseInt(u.toString(),10)],m=this.getSlope(g,l,t,e);m<i&&(i=m,a=o+this.lengthCalculation(t,h),r=s,n=u),o+=Hmi.findLength(g,l),h=l=g}return s++,{lengthFractionIndex:a,fullLength:o,segmentIndex:r,pointIndex:n}},DDi.prototype.getSlope=function(e,t,i,n){var o=Math.abs(e.x-t.x),r=Math.abs(e.y-t.y),s=(i.y-e.y)/(t.y-e.y),a=(i.x-e.x)/(t.x-e.x);if(!isFinite(s)||!isFinite(a)||isNaN(s)||isNaN(a)){if(e.x===t.x){if(e.y===t.y)return 1e4;if(e.y>i.y&&i.y>t.y||e.y<i.y&&i.y<t.y)return Math.abs(e.x-i.x)}else if(e.y===t.y&&(e.x>i.x&&i.x>t.x||e.x<i.x&&i.x<t.x))return Math.abs(e.y-i.y)}else if((e.x>=i.x&&i.x>=t.x||e.x<=i.x&&i.x<=t.x||o<3)&&(e.y>=i.y&&i.y>=t.y||e.y<=i.y&&i.y<=t.y||r<3))return Math.abs(s-a);return 1e4},DDi.prototype.angleCalculation=function(e,t){var i=e.x-t.x,e=e.y-t.y;return Math.atan2(e,i)*(180/Math.PI)},DDi.prototype.lengthCalculation=function(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))},DDi.prototype.destroy=function(){},DDi.prototype.getModuleName=function(){return"Bridging"},DDi);function DDi(){}MDi.prototype.canSnap=function(){return 0!=(this.diagram.snapSettings.constraints&(Qfi.SnapToObject|Qfi.SnapToLines))},MDi.prototype.getWrapperObject=function(e,t){if(e.nodes&&0<e.nodes.length&&(this.diagram.snapSettings.constraints&Qfi.SnapToLines||this.diagram.snapSettings.constraints&Qfi.SnapToObject)){var i=0;if(i<e.nodes.length)return(("SwimLane"===e.nodes[parseInt(i.toString(),10)].shape.type||e.nodes[parseInt(i.toString(),10)].isLane||""!==e.nodes[parseInt(i.toString(),10)].parentId&&t[e.nodes[parseInt(i.toString(),10)].parentId]&&t[e.nodes[parseInt(i.toString(),10)].parentId].isLane)&&t.helper?t.helper:e).wrapper}return e.wrapper},MDi.prototype.setSnapLineColor=function(){return this.diagram.snapSettings.snapLineColor},MDi.prototype.snapPoint=function(e,t,i,n,o,r,s){var a=this.diagram.snapSettings,l=this.diagram.scroller.currentZoom,h={x:0,y:0},d=ETi(this.getWrapperObject(t,e.nameTable)),p={snapped:!1,offset:0},c={snapped:!1,offset:0},e=(this.diagram.snapSettings.constraints&Qfi.SnapToObject&&((u=document.createElementNS("http://www.w3.org/2000/svg","g")).setAttribute("id","_SnappingLines"),u.setAttribute("shapeRendering","crispEdges"),this.getAdornerLayerSvg().appendChild(u),this.snapObject(e,t,u,p,c,o,r===s)),d.x+o.x),t=d.y+o.y,u=d.x+d.width+o.x,g=d.y+d.height+o.y,m=a.verticalGridlines.scaledIntervals,u=this.round(u,m,l),e=this.round(e,m,l),m=a.horizontalGridlines.scaledIntervals,a=this.round(t,m,l),t=this.round(g,m,l),g=d.x+d.width,m=d.y+d.height;return p.snapped?this.diagram.snapSettings.constraints&Qfi.SnapToObject?h.x=p.offset:h.x=s.x-r.x:this.diagram.snapSettings.constraints&Qfi.SnapToVerticalLines?1<=Math.abs(o.x)&&(i?Math.abs(u-g)>Math.abs(e-d.x)?h.x+=e-d.x:h.x+=u-g:Math.abs(u-g)<Math.abs(e-d.x)?h.x+=u-g:h.x+=e-d.x):h.x=s.x-r.x,c.snapped?h.y=c.offset:this.diagram.snapSettings.constraints&Qfi.SnapToHorizontalLines?1<=Math.abs(o.y)&&(n?Math.abs(t-m)>Math.abs(a-d.y)?h.y+=a-d.y:h.y+=t-m:Math.abs(t-m)<Math.abs(a-d.y)?h.y+=t-m:h.y+=a-d.y):h.y=s.y-r.y,h},MDi.prototype.round=function(e,t,i){1===i&&(i=Math.pow(2,Math.floor(Math.log(i)/Math.log(2))));for(var n=0,o=0,o=0;o<t.length;o++)n+=t[parseInt(o.toString(),10)];var r=e%(n/=i),s=Math.floor(Math.abs(e)/n)*n;if(s!==e)if(0<=e)for(o=0;o<t.length;o++){if(r<=t[parseInt(o.toString(),10)]/i)return s+(r<t[parseInt(o.toString(),10)]/(2*i)?0:t[parseInt(o.toString(),10)]/i);s+=t[parseInt(o.toString(),10)]/i,r-=t[parseInt(o.toString(),10)]/i}else for(s*=-1,o=t.length-1;0<=o;o--){if(Math.abs(r)<=t[parseInt(o.toString(),10)]/i)return s-(Math.abs(r)<t[parseInt(o.toString(),10)]/(2*i)?0:t[parseInt(o.toString(),10)]/i);s-=t[parseInt(o.toString(),10)]/i,r+=t[parseInt(o.toString(),10)]/i}return e},MDi.prototype.snapObject=function(e,t,i,n,o,r,s){for(var a,l,h,d,p,c=null,u=this.diagram.scroller,g=this.diagram.snapSettings,m=[],f=[],y=[],v=[],b=ETi(this.getWrapperObject(t,e.nameTable)),w=e.scroller.currentZoom,C=-u.horizontalOffset,S=-u.verticalOffset,A=g.snapObjectDistance/w,g=new tfi(0,0,u.viewPortWidth,u.viewPortHeight),u=new tfi(C/w,b.y-A-5,g.width/w,b.height+2*A+10),x=new tfi(b.x-A-5,S/w,b.width+2*A+10,g.height/w),g=new tfi(C/w,S/w,g.width/w,g.height/w),I=this.findNodes(e.spatialSearch,t,x,g),T=e.nameTable,E=0;E<I.length;E++)d=I[parseInt(E.toString(),10)],this.canBeTarget(e,d)&&!(this.diagram.nameTable[d.id]instanceof ISi)&&this.canConsider(T,t,d)&&((p=d.bounds).height+p.y<r.y+b.y?y.push({obj:d,distance:Math.abs(b.y+r.y-p.y-p.height)}):p.y>b.y+r.y+b.height&&v.push({obj:d,distance:Math.abs(b.y+r.y+b.height-p.y)}),null==c||c>Math.abs(p.y-b.y-r.y))&&(Math.abs(p.x+p.width/2-(b.x+b.width/2+r.x))<=A?(l=this.createSnapObject(p,b,"centerX"),c=Math.abs(p.y-b.y)):Math.abs(p.x+p.width-(b.x+b.width+r.x))<=A?(l=this.createSnapObject(p,b,"right"),c=Math.abs(p.y-b.y)):Math.abs(p.x-(b.x+r.x))<=A?(l=this.createSnapObject(p,b,"left"),c=Math.abs(p.y-b.y)):Math.abs(p.x-(b.x+b.width+r.x))<=A?(l=this.createSnapObject(p,b,"rightLeft"),c=Math.abs(p.y-b.y)):Math.abs(p.x+p.width-(b.x+r.x))<=A&&(l=this.createSnapObject(p,b,"leftRight"),c=Math.abs(p.y-b.y)));for(var I=this.findNodes(e.spatialSearch,t,u,g),D=0;D<I.length;D++)d=I[parseInt(D.toString(),10)],this.canBeTarget(e,d)&&!(this.diagram.nameTable[d.id]instanceof ISi)&&this.canConsider(T,t,d)&&((p=d.bounds).x+p.width<b.x+r.x&&(m[m.length]={obj:d,distance:Math.abs(b.x+r.x-p.x-p.width)}),p.x>b.x+r.x+b.width&&(f[f.length]={obj:d,distance:Math.abs(b.x+r.x+b.width-p.x)}),null==a||a>Math.abs(p.x-b.x-r.x))&&(Math.abs(p.y+p.height/2-(b.y+b.height/2+r.y))<=A?(h=this.createSnapObject(p,b,"centerY"),a=Math.abs(p.x-b.x)):Math.abs(p.y-b.y-r.y)<=A?(h=this.createSnapObject(p,b,"top"),a=Math.abs(p.x-b.x)):Math.abs(p.y+p.height-(b.y+b.height+r.y))<=A?(h=this.createSnapObject(p,b,"bottom"),a=Math.abs(p.x-b.x)):Math.abs(p.y+p.height-b.y-r.y)<=A?(h=this.createSnapObject(p,b,"topBottom"),a=Math.abs(p.x-b.x)):Math.abs(p.y-(b.y+b.height+r.y))<=A&&(h=this.createSnapObject(p,b,"bottomTop"),a=Math.abs(p.x-b.x)));this.createGuidelines(e,l,h,i,n,o,s),n.snapped||this.createHSpacingLines(e,i,t,m,f,n,o,s,r,A),o.snapped||this.createVSpacingLines(e,i,t,y,v,n,o,s,r,A)},MDi.prototype.snapConnectorEnd=function(e){var t=this.diagram.snapSettings,i=this.diagram.scroller.currentZoom;return t.constraints&Qfi.SnapToLines&&(e.x=this.round(e.x,t.verticalGridlines.scaledIntervals,i),e.y=this.round(e.y,t.horizontalGridlines.scaledIntervals,i)),e},MDi.prototype.canBeTarget=function(e,t){return t=this.diagram.nameTable[t.id],!Twi(this.diagram,t,!1)},MDi.prototype.snapSize=function(e,t,i,n,o,r,s,a){for(var l,h,d,p,c,u=this.diagram.snapSettings,g=this.diagram.scroller,m=ETi(s.wrapper),f=e.nameTable,y=[],v=[],b=e.scroller.currentZoom,w=-g.horizontalOffset,C=-g.verticalOffset,S=u.snapObjectDistance/b,u=new tfi(0,0,g.viewPortWidth,g.viewPortHeight),g=new tfi(w/b,(m.y-5)/b,u.width/b,(m.height+10)/b),A=new tfi((m.x-5)/b,C/b,(m.width+10)/b,u.height/b),u=new tfi(w/b,C/b,u.width/b,u.height/b),x=[],I=this.findNodes(e.spatialSearch,s,A,u,x),T=0;T<I.length;T++)F=I[parseInt(T.toString(),10)],this.canConsider(f,s,F)&&!(this.diagram.nameTable[F.id]instanceof ISi)&&(c=F.bounds,null==l||l>Math.abs(c.y-m.y))&&(t.left?Math.abs(m.x+o-c.x)<=S?(d=this.createSnapObject(c,m,"left"),l=Math.abs(c.y-m.y)):Math.abs(m.x+o-c.x-c.width)<=S&&(d=this.createSnapObject(c,m,"leftRight"),l=Math.abs(c.y-m.y)):t.right&&(Math.abs(m.x+o+m.width-c.x-c.width)<=S?(d=this.createSnapObject(c,m,"right"),l=Math.abs(c.y-m.y)):Math.abs(m.x+o+m.width-c.x)<=S&&(d=this.createSnapObject(c,m,"rightLeft"),l=Math.abs(c.y-m.y))));for(var I=this.findNodes(e.spatialSearch,s,g,u),E=0;E<I.length;E++){var D=I[parseInt(E.toString(),10)];this.canConsider(f,s,D)&&!(this.diagram.nameTable[D.id]instanceof ISi)&&(D=D.bounds,null==h||h>Math.abs(D.x-m.x))&&(i.top?Math.abs(m.y+r-D.y)<=S?(p=this.createSnapObject(D,m,"top"),h=Math.abs(D.x-m.x)):Math.abs(m.y+r-D.y-D.height)<=S&&(p=this.createSnapObject(D,m,"topBottom"),h=Math.abs(D.x-m.x)):i.bottom&&(Math.abs(m.y+m.height+r-D.y-D.height)<=S?(p=this.createSnapObject(D,m,"bottom"),h=Math.abs(D.x-m.x)):Math.abs(m.y+m.height+r-D.y)<=S&&(p=this.createSnapObject(D,m,"bottomTop"),h=Math.abs(D.x-m.x))))}for(T=0;T<x.length;T++){var M,k,P,B,F=x[parseInt(T.toString(),10)];this.canConsider(f,s,F)&&(M=F.bounds,k=t.left?-o:o,P=void 0,(B=Math.abs(m.width+k-M.width))<=S&&(P=t.left?-M.width+m.width:M.width-m.width,y[y.length]={source:F,difference:B,offset:P}),k=i.top?-r:r,(B=Math.abs(m.height+k-M.height))<=S)&&(P=i.top?-M.height+m.height:M.height-m.height,v[v.length]={source:F,difference:B,offset:P})}e.getTool||this.createGuidelines(e,d,p,n,t,i,a),!t.snapped&&0<y.length&&(t.left||t.right)&&this.addSameWidthLines(e,n,y,t,a,s),!i.snapped&&0<v.length&&(i.top||i.bottom)&&this.addSameHeightLines(e,n,v,i,a,s)},MDi.prototype.snapTop=function(e,t,i,n,o,r,s,a){var l,h=o,d=(t.top=!0,e.left=e.right=!1,this.diagram.scroller.currentZoom);return this.diagram.snapSettings.constraints&Qfi.SnapToObject&&!r.rotateAngle&&(l=a.y-a.height*r.pivot.y+o-(r.offsetY-r.height*r.pivot.y),this.snapSize(this.diagram,e,t,i,n,l,this.diagram.selectedItems,s)),t.snapped?h=o-l+t.offset:this.diagram.snapSettings.constraints&Qfi.SnapToHorizontalLines&&(e=a.y-a.height*r.pivot.y,h=this.round(e+o,this.diagram.snapSettings.horizontalGridlines.scaledIntervals,d)-e),h},MDi.prototype.snapRight=function(e,t,i,n,o,r,s,a){var l,h=n,d=(e.right=!0,t.top=t.bottom=!1,this.diagram.scroller.currentZoom);return this.diagram.snapSettings.constraints&Qfi.SnapToObject&&!r.rotateAngle&&(l=a.x+a.width*(1-r.pivot.x)+n-(r.offsetX+r.width*(1-r.pivot.x)),this.snapSize(this.diagram,e,t,i,l,o,this.diagram.selectedItems,s)),e.snapped?h=n-l+e.offset:this.diagram.snapSettings.constraints&Qfi.SnapToVerticalLines&&(t=a.x+a.width*(1-r.pivot.x),h=this.round(t+n,this.diagram.snapSettings.verticalGridlines.scaledIntervals,d)-t),h},MDi.prototype.snapLeft=function(e,t,i,n,o,r,s,a){var l=n,h=0,d=(e.left=!0,t.top=t.bottom=!1,this.diagram.scroller.currentZoom);return this.diagram.snapSettings.constraints&Qfi.SnapToObject&&!r.rotateAngle&&(h=a.x-a.width*r.pivot.x+n-(r.offsetX-r.width*r.pivot.x),this.snapSize(this.diagram,e,t,i,h,o,this.diagram.selectedItems,s)),e.snapped?l=n-h+e.offset:this.diagram.snapSettings.constraints&Qfi.SnapToVerticalLines&&(t=a.x-a.width*r.pivot.x,l=this.round(t+n,this.diagram.snapSettings.horizontalGridlines.scaledIntervals,d)-t),l},MDi.prototype.snapBottom=function(e,t,i,n,o,r,s,a){var l=o,h=(t.bottom=!0,e.left=e.right=!1,this.diagram.scroller.currentZoom),d=0;this.diagram.snapSettings.constraints&Qfi.SnapToObject&&!r.rotateAngle&&(d=a.y+a.height*(1-r.pivot.y)+o-(r.offsetY+r.height*(1-r.pivot.y)),this.snapSize(this.diagram,e,t,i,n,d,this.diagram.selectedItems,s)),r instanceof Tyi||r instanceof Tvi?ETi(r):ETi(r.wrapper);return t.snapped?l=o-d+t.offset:this.diagram.snapSettings.constraints&Qfi.SnapToHorizontalLines&&(e=a.y+a.height*(1-r.pivot.y),l=this.round(e+o,this.diagram.snapSettings.horizontalGridlines.scaledIntervals,h)-e),l},MDi.prototype.createGuidelines=function(e,t,i,n,o,r,s){return t&&(o.offset=t.offsetX,o.snapped=!0,s||(t.type,this.renderAlignmentLines(t.start,t.end,n,e.scroller.transform))),i&&(r.offset=i.offsetY,r.snapped=!0,s||(i.type,this.renderAlignmentLines(i.start,i.end,n,e.scroller.transform))),n},MDi.prototype.renderAlignmentLines=function(e,t,i,n){e={x:(e.x+n.tx)*n.scale,y:(e.y+n.ty)*n.scale},t={x:(t.x+n.tx)*n.scale,y:(t.y+n.ty)*n.scale};var n={stroke:this.setSnapLineColor(),strokeWidth:1,startPoint:{x:e.x,y:e.y},endPoint:{x:t.x,y:t.y},fill:this.setSnapLineColor(),dashArray:"",width:1,x:0,y:0,height:0,angle:0,pivotX:0,pivotY:0,visible:!0,opacity:1,id:xTi()},o=0;for(this.line.push(n),o=0;o<this.line.length;o++)this.diagram.diagramRenderer.drawLine(i,this.line.pop())},MDi.prototype.createHSpacingLines=function(e,t,i,n,o,r,s,a,l,h){var d,p,c,u,g,m=0,f=(this.sortByDistance(n,"distance",!0),this.sortByDistance(o,"distance",!0),[]),y=e.selectedObject.helperObject?ETi(e.selectedObject.helperObject.wrapper):ETi(i.wrapper);0<n.length&&(f[f.length]=n[0],m=(d=n[0].obj.bounds).y,1<n.length&&(p=n[1].obj.bounds,c=d.x-p.x-p.width,Math.abs(c-n[0].distance)<=h)?m=this.findEquallySpacedNodesAtLeft(n,c,m,f):c=n[0].distance),this.sortByDistance(f,"distance"),f[f.length]={obj:i,distance:0},m=y.y<m||!m?y.y:m,0<o.length&&(i=void 0,m=(u=o[0].obj.bounds).y<m?u.y:m,1<o.length&&(i=(p=o[1].obj.bounds).x-u.x-u.width),0<n.length?Math.abs(o[0].distance-n[0].distance)<=h?(g=Math.abs(o[0].distance-n[0].distance)/2,o[0].distance<n[0].distance?c-=g:c+=g,f[f.length]=o[0]):1===n.length&&(d=void 0,f.splice(0,1),f[f.length]=o[0],c=i):(c=i,f[f.length]=o[0]),1<o.length)&&u.x+u.width<p.x&&(m=this.findEquallySpacedNodesAtRight(o,i,m,f,h)),2<f.length&&(this.addHSpacingLines(e,t,f,a,m),g=0,a&&(g=l.x),d?r.offset=c-Math.abs(y.x+g-d.x-d.width)+g:u&&(r.offset=Math.abs(y.x+y.width+g-u.x)-c+g),r.snapped=!0)},MDi.prototype.createVSpacingLines=function(e,t,i,n,o,r,s,a,l,h){var d,p,c,u,g,m=0,f=(this.sortByDistance(n,"distance",!0),this.sortByDistance(o,"distance",!0),[]),y=ETi(this.getWrapperObject(i,e.nameTable));0<n.length&&(f[f.length]=n[0],m=(d=n[0].obj.bounds).x+d.width,1<n.length&&(p=n[1].obj.bounds,c=d.y-p.y-p.height,Math.abs(c-n[0].distance)<=h)?m=this.findEquallySpacedNodesAtTop(n,c,m,f):c=n[0].distance),this.sortByDistance(f,"distance"),f[f.length]={obj:i,distance:0},m=y.x+y.width>m||!m?y.x+y.width:m,0<o.length&&(m=(g=o[0].obj.bounds).x+g.width>m?g.x+g.width:m,1<o.length&&(u=(p=o[1].obj.bounds).y-g.y-g.height),0<n.length?Math.abs(o[0].distance-n[0].distance)<=h?(i=Math.abs(o[0].distance-n[0].distance)/2,o[0].distance<n[0].distance?c-=i:c+=i,f[f.length]=o[0]):1===n.length&&(d=void 0,f.splice(0,1),f[f.length]=o[0],c=u):(c=u,f[f.length]=o[0]),1<o.length)&&p.y>g.y+g.height&&(m=this.findEquallySpacedNodesAtBottom(o,u,m,f,h)),2<f.length&&(this.addVSpacingLines(e,t,f,a,m),i=0,a&&(i=l.y),d?s.offset=c-Math.abs(y.y+i-d.y-d.height)+i:g&&(s.offset=Math.abs(y.y+y.height+i-g.y)-c+i),s.snapped=!0)},MDi.prototype.addHSpacingLines=function(e,t,i,n,o){var r;if(!n)for(r=0;r<i.length-1;r++){var s=i[parseInt(r.toString(),10)].obj instanceof qIi?ETi(i[parseInt(r.toString(),10)].obj.wrapper):i[parseInt(r.toString(),10)].obj.bounds,a=i[r+1].obj instanceof qIi?ETi(i[r+1].obj.wrapper):i[r+1].obj.bounds,s={x:s.x+s.width,y:o-15},a={x:a.x,y:o-15};this.renderSpacingLines(s,a,t,this.getAdornerLayerSvg(),e.scroller.transform)}},MDi.prototype.addVSpacingLines=function(e,t,i,n,o){if(!n)for(var r=0;r<i.length-1;r++){var s=i[parseInt(r.toString(),10)].obj instanceof qIi?ETi(i[parseInt(r.toString(),10)].obj.wrapper):i[parseInt(r.toString(),10)].obj.bounds,a=i[r+1].obj instanceof qIi?ETi(i[r+1].obj.wrapper):i[r+1].obj.bounds,s={x:o+15,y:s.y+s.height},a={x:o+15,y:a.y};this.renderSpacingLines(s,a,t,this.getAdornerLayerSvg(),e.scroller.transform)}},MDi.prototype.addSameWidthLines=function(e,t,i,n,o,r){this.sortByDistance(i,"offset");var s,a,l,h=ETi(r.wrapper),r=i[0],d=r.source.bounds,p=[];for(p.push(i[0]),l=1;l<i.length;l++)i[parseInt(l.toString(),10)].source.bounds.width===d.width&&p.push(i[parseInt(l.toString(),10)]);if(!o)for(s={x:h.x+r.offset,y:h.y-15},a={x:h.x+h.width+r.offset,y:h.y-15},this.renderSpacingLines(s,a,t,this.getAdornerLayerSvg(),e.scroller.transform),l=0;l<p.length;l++)s={x:(h=p[parseInt(l.toString(),10)].source.bounds).x,y:h.y-15},a={x:h.x+h.width,y:h.y-15},this.renderSpacingLines(s,a,t,this.getAdornerLayerSvg(),e.scroller.transform);n.offset=r.offset,n.snapped=!0},MDi.prototype.addSameHeightLines=function(e,t,i,n,o,r){this.sortByDistance(i,"offset");var s,a,l,h=ETi(r.wrapper),r=i[0],d=r.source.bounds,p=[];for(p.push(i[0]),l=0;l<i.length;l++)i[parseInt(l.toString(),10)].source.bounds.height===d.height&&p.push(i[parseInt(l.toString(),10)]);if(!o)for(s={x:h.x+h.width+15,y:h.y+r.offset},a={x:h.x+h.width+15,y:h.y+r.offset+h.height},this.renderSpacingLines(s,a,t,this.getAdornerLayerSvg(),e.scroller.transform),l=0;l<p.length;l++)s={x:(h=p[parseInt(l.toString(),10)].source.bounds).x+h.width+15,y:h.y},a={x:h.x+h.width+15,y:h.y+h.height},this.renderSpacingLines(s,a,t,this.getAdornerLayerSvg(),e.scroller.transform);n.offset=r.offset,n.snapped=!0},MDi.prototype.renderSpacingLines=function(e,t,i,n,o){var r,s,a=new kyi,l={};e={x:(e.x+o.tx)*o.scale,y:(e.y+o.ty)*o.scale},t={x:(t.x+o.tx)*o.scale,y:(t.y+o.ty)*o.scale},s=e.x===t.x?(r="M"+(e.x-5)+" "+(e.y+5)+"L"+e.x+" "+e.y+"L"+(e.x+5)+" "+(e.y+5)+"zM"+(t.x-5)+" "+(t.y-5)+" L"+t.x+" "+t.y+" L"+(t.x+5)+" "+(t.y-5)+"z",s={startPoint:{x:e.x-8,y:e.y-1},endPoint:{x:e.x+8,y:e.y-1},stroke:this.setSnapLineColor(),strokeWidth:1,fill:this.setSnapLineColor(),dashArray:"",width:1,x:0,y:0,height:0,angle:0,pivotX:0,pivotY:0,visible:!0,opacity:1,id:xTi()},a.data=r,l.data=a.data,l.angle=0,l.pivotX=0,l.pivotY=0,l.x=0,l.y=0,l.height=0,l.width=1,l.id=xTi(),this.diagram.diagramRenderer.drawPath(i,l),this.line.push(s),this.diagram.diagramRenderer.drawLine(i,this.line.pop()),{startPoint:{x:t.x-8,y:t.y+1},endPoint:{x:t.x+8,y:t.y+1},stroke:this.setSnapLineColor(),strokeWidth:1,fill:this.setSnapLineColor(),dashArray:"",width:1,x:0,y:0,height:0,angle:0,pivotX:0,pivotY:0,visible:!0,opacity:1,id:this.getAdornerLayerSvg().id+"spacing"}):(r="M"+(e.x+5)+" "+(e.y+5)+" L"+e.x+" "+e.y+" L"+(e.x+5)+" "+(e.y-5)+"zM"+(t.x-5)+" "+(t.y-5)+" L"+t.x+" "+t.y+" L"+(t.x-5)+" "+(t.y+5)+"z",a.data=r,l.data=r,l.angle=0,l.pivotX=0,l.pivotY=0,l.x=0,l.y=0,l.height=0,l.width=1,l.id=xTi(),this.diagram.diagramRenderer.drawPath(i,l),s={visible:!0,opacity:1,id:xTi(),startPoint:{x:e.x-1,y:e.y-8},endPoint:{x:e.x-1,y:e.y+8},stroke:this.setSnapLineColor(),strokeWidth:1,fill:this.setSnapLineColor(),dashArray:"0",width:1,x:0,y:0,height:0,angle:0,pivotX:0,pivotY:0},this.line.push(s),this.diagram.diagramRenderer.drawLine(i,this.line.pop()),{width:1,x:0,y:0,height:0,angle:0,pivotX:0,pivotY:0,visible:!0,opacity:1,id:xTi(),startPoint:{x:t.x+1,y:t.y-8},endPoint:{x:t.x+1,y:t.y+8},stroke:this.setSnapLineColor(),strokeWidth:1,fill:this.setSnapLineColor(),dashArray:"0"}),this.line.push(s),this.diagram.diagramRenderer.drawLine(i,this.line.pop()),s={startPoint:{x:e.x,y:e.y},endPoint:{x:t.x,y:t.y},stroke:this.setSnapLineColor(),strokeWidth:1,fill:this.setSnapLineColor(),dashArray:"0",width:1,x:0,y:0,height:0,angle:0,pivotX:0,pivotY:0,visible:!0,opacity:1,id:xTi()},this.line.push(s),this.diagram.diagramRenderer.drawLine(i,this.line.pop())},MDi.prototype.createSnapObject=function(e,t,i){var n;switch(i){case"left":n={start:{x:e.x,y:Math.min(e.y,t.y)},end:{x:e.x,y:Math.max(e.y+e.height,t.y+t.height)},offsetX:e.x-t.x,offsetY:0,type:"sideAlign"};break;case"right":n={type:"sideAlign",start:{x:e.x+e.width,y:Math.min(e.y,t.y)},offsetX:e.x+e.width-t.x-t.width,offsetY:0,end:{x:e.x+e.width,y:Math.max(e.y+e.height,t.y+t.height)}};break;case"top":n={offsetY:e.y-t.y,offsetX:0,type:"sideAlign",start:{x:Math.min(e.x,t.x),y:e.y},end:{x:Math.max(e.x+e.width,t.x+t.width),y:e.y}};break;case"bottom":n={type:"sideAlign",offsetY:e.y+e.height-t.y-t.height,offsetX:0,end:{x:Math.max(e.x+e.width,t.x+t.width),y:e.y+e.height},start:{x:Math.min(e.x,t.x),y:e.y+e.height}};break;case"topBottom":n={start:{x:Math.min(e.x,t.x),y:e.y+e.height},end:{x:Math.max(e.x+e.width,t.x+t.width),y:e.y+e.height},offsetY:e.y+e.height-t.y,offsetX:0,type:"sideAlign"};break;case"bottomTop":n={start:{x:Math.min(e.x,t.x),y:e.y},end:{x:Math.max(e.x+e.width,t.x+t.width),y:e.y},offsetY:e.y-t.y-t.height,offsetX:0,type:"sideAlign"};break;case"leftRight":n={start:{x:e.x+e.width,y:Math.min(e.y,t.y)},end:{x:e.x+e.width,y:Math.max(e.y+e.height,t.y+t.height)},offsetX:e.x+e.width-t.x,offsetY:0,type:"sideAlign"};break;case"rightLeft":n={start:{x:e.x,y:Math.min(e.y,t.y)},end:{x:e.x,y:Math.max(e.y+e.height,t.y+t.height)},offsetX:e.x-t.x-t.width,offsetY:0,type:"sideAlign"};break;case"centerX":n={start:{x:e.x+e.width/2,y:Math.min(e.y,t.y)},end:{x:e.x+e.width/2,y:Math.max(e.y+e.height,t.y+t.height)},offsetX:e.x+e.width/2-(t.x+t.width/2),offsetY:0,type:"centerAlign"};break;case"centerY":n={start:{x:Math.min(e.x,t.x),y:e.y+e.height/2},end:{x:Math.max(e.x+e.width,t.x+t.width),y:e.y+e.height/2},offsetY:e.y+e.height/2-(t.y+t.height/2),offsetX:0,type:"centerAlign"}}return n},MDi.prototype.snapAngle=function(e,t){var i=this.diagram.snapSettings.snapAngle,n=t%(i||0);return i/2<=n?t+i-n:t-n},MDi.prototype.canConsider=function(e,t,i){return!this.diagram.selectedItems.nodes.length||this.diagram.selectedItems.nodes[0].id!==i.id},MDi.prototype.findNodes=function(e,t,i,n,o){for(var r,s,a=[],l=e.findQuads(o?n:i),h=0;h<l.length;h++){var d=l[parseInt(h.toString(),10)];if(0<d.objects.length)for(var p=0;p<d.objects.length;p++)r=d.objects[parseInt(p.toString(),10)],this.diagram.nameTable[r.id]instanceof ISi||!r.visible||"SwimLane"===this.diagram.nameTable[r.id].shape.type||this.diagram.nameTable[r.id].isLane||this.diagram.nameTable[r.id].isPhase||this.diagram.nameTable[r.id].isHeader||"helper"===r.id||(s=ETi(r),-1===a.indexOf(r)&&this.intersectsRect(i,s)&&a.push(r),o&&o.indexOf(r)&&this.intersectsRect(n,s)&&o.push(r))}return a},MDi.prototype.intersectsRect=function(e,t){return t.x<e.x+e.width&&e.x<t.x+t.width&&t.y<e.y+e.height&&e.y<t.y+t.height},MDi.prototype.getAdornerLayerSvg=function(){return this.diagram.diagramRenderer.adornerSvgLayer},MDi.prototype.removeGuidelines=function(e){var t=this.getAdornerLayerSvg().getElementById("_SnappingLines"),i=this.getAdornerLayerSvg().getElementById("pivotLine");t&&t.parentNode.removeChild(t),i&&i.parentNode.removeChild(i)},MDi.prototype.sortByDistance=function(e,t,i){var n,o,r;if(i)for(n=0;n<e.length;n++)for(o=n+1;o<e.length;o++)e[parseInt(n.toString(),10)][""+t]>e[parseInt(o.toString(),10)][""+t]&&(r=e[parseInt(n.toString(),10)],e[parseInt(n.toString(),10)]=e[parseInt(o.toString(),10)],e[parseInt(o.toString(),10)]=r);else for(n=0;n<e.length;n++)for(o=n+1;o<e.length;o++)e[parseInt(n.toString(),10)][""+t]<e[parseInt(o.toString(),10)][""+t]&&(r=e[parseInt(n.toString(),10)],e[parseInt(n.toString(),10)]=e[parseInt(o.toString(),10)],e[parseInt(o.toString(),10)]=r)},MDi.prototype.findEquallySpacedNodesAtLeft=function(e,t,i,n){for(var o,r,s=1;s<e.length&&(r=e[s-1].obj.bounds,o=e[parseInt(s.toString(),10)].obj.bounds,r=r.x-o.x-o.width,Math.abs(r-t)<=1);s++)n[n.length]=e[parseInt(s.toString(),10)],o.y<i&&(i=o.y);return i},MDi.prototype.findEquallySpacedNodesAtRight=function(e,t,i,n,o){var r,s,a=e[0].distance;if(Math.abs(t-a)<=o)for(var l=0;l<e.length-1&&(r=e[parseInt(l.toString(),10)].obj,s=e[l+1].obj.bounds,r=r.bounds,s=s.x-r.x-r.width,Math.abs(s-t)<=1);l++)n[n.length]=e[l+1],r.y<i&&(i=r.y);return i},MDi.prototype.findEquallySpacedNodesAtTop=function(e,t,i,n){for(var o,r,s=1;s<e.length&&(r=e[s-1].obj.bounds,o=e[parseInt(s.toString(),10)].obj.bounds,r=r.y-o.y-o.height,Math.abs(r-t)<=1);s++)n[n.length]=e[parseInt(s.toString(),10)],o.x+o.width>i&&(i=o.x+o.width);return i},MDi.prototype.findEquallySpacedNodesAtBottom=function(e,t,i,n,o){var r,s,a=e[0].distance;if(Math.abs(t-a)<=o)for(var l=0;l<e.length-1&&(r=e[parseInt(l.toString(),10)].obj,s=e[l+1].obj.bounds,r=r.bounds,s=s.y-r.y-r.height,Math.abs(s-t)<=1);l++)n[n.length]=e[l+1],r.x+r.width>i&&(i=r.x+r.width);return i},MDi.prototype.getLayer=function(){var e;return this.diagram.snapSettings.constraints&Qfi.SnapToObject&&((e=document.createElementNS("http://www.w3.org/2000/svg","g")).setAttribute("id","_SnappingLines"),e.setAttribute("shapeRendering","crispEdges"),this.getAdornerLayerSvg().appendChild(e)),e},MDi.prototype.destroy=function(){},MDi.prototype.getModuleName=function(){return"Snapping"};EW=MDi;function MDi(e){this.line=[],this.diagram=e}kDi.prototype.initHistory=function(e){e.historyManager={canRedo:!1,canUndo:!1,currentEntry:null,push:e.addHistoryEntry.bind(e),undo:Function,redo:Function,startGroupAction:e.startGroupAction.bind(e),endGroupAction:e.endGroupAction.bind(e),canLog:null,undoStack:[],redoStack:[],stackLimit:e.historyManager?e.historyManager.stackLimit:void 0}},kDi.prototype.addHistoryEntry=function(e,t){if("EndGroup"===e.type&&"StartGroup"===t.historyManager.currentEntry.type)return t.historyManager.currentEntry.previous&&(t.historyManager.currentEntry.previous.next=void 0),t.historyManager.currentEntry=t.historyManager.currentEntry.previous,t.historyManager.currentEntry||(t.historyManager.canUndo=!1),!1;var i=null;if(t.historyManager.canLog&&!0===t.historyManager.canLog(e).cancel)return!1;return t.historyManager&&t.historyManager.canUndo&&t.historyManager.currentEntry&&((i=t.historyManager.currentEntry).next?i.previous&&(i.next.previous=null,(i.next=e).previous=i):(i.next=e).previous=i),t.historyManager.currentEntry=e,t.historyManager.stackLimit&&("StartGroup"!==e.type&&"EndGroup"!==e.type||(i="EndGroup"===e.type,this.setEntryLimit(i)),this.hasGroup||0!==this.groupCount||(this.historyCount<t.historyManager.stackLimit?this.historyCount++:this.applyLimit(t.historyManager.currentEntry,t.historyManager.stackLimit,t))),this.getHistoryList(t),t.historyManager.canUndo=!0,!(t.historyManager.canRedo=!1)},kDi.prototype.applyLimit=function(e,t,i,n){var o;e&&e.previous&&("StartGroup"!==e.type&&"EndGroup"!==e.type||(o="StartGroup"===e.type,this.setEntryLimit(o)),this.hasGroup||0!==this.groupCount||t--,0===t?(n&&this.limitHistoryStack(e.previous,i),i.historyManager.stackLimit<this.historyCount&&(this.historyCount=i.historyManager.stackLimit),delete e.previous):e.previous&&this.applyLimit(e.previous,t,i,n)),this.groupCount=0},kDi.prototype.clearHistory=function(e){var t=e.historyManager;t.currentEntry=void 0,t.canUndo=!1,t.canRedo=!1,this.historyCount=0,this.groupCount=0,e.historyManager.undoStack=[],e.historyManager.redoStack=[]},kDi.prototype.setEntryLimit=function(e){e?this.groupCount--:this.groupCount++,this.hasGroup=e&&!e},kDi.prototype.limitHistoryStack=function(e,t){"StartGroup"!==e.type&&"EndGroup"!==e.type&&(this.removeFromStack(t.historyManager.undoStack,e),this.removeFromStack(t.historyManager.redoStack,e)),e.previous&&this.limitHistoryStack(e.previous,t)},kDi.prototype.removeFromStack=function(e,t){if(e.length)for(var i=0;i<=e.length;i++)if(e[parseInt(i.toString(),10)].undoObject===t.undoObject&&e[parseInt(i.toString(),10)].redoObject===t.redoObject){e.splice(i,1);break}},kDi.prototype.undo=function(e){var t=this.getUndoEntry(e),i=0;t&&("Internal"===t.category?("EndGroup"===t.type?(i++,this.groupUndo=!0):this.undoEntry(t,e),this.groupUndo&&(this.undoGroupAction(t,e,i),this.groupUndo=!1)):(N||e.historyManager.undo(t),i={entryType:"undo",oldValue:t.undoObject,newValue:t.redoObject},e.triggerEvent(dyi.historyStateChange,i)))},kDi.prototype.getHistoryList=function(e){var t,i,n=[],o=[],r=e.historyManager.currentEntry,r=e.historyManager.currentEntry;for(e.historyManager.canUndo||0===e.historyManager.undoStack.length?this.getHistroyObject(n,r):this.getHistroyObject(o,r);r&&r.previous;)t=r.previous,this.getHistroyObject(n,t),r=r.previous;for(r=e.historyManager.currentEntry;r&&r.next;)i=r.next,this.getHistroyObject(o,i),r=r.next;e.historyManager.undoStack=n,e.historyManager.redoStack=o},kDi.prototype.getHistroyObject=function(e,t){t&&"StartGroup"!==t.type&&"EndGroup"!==t.type&&e.push({redoObject:t.redoObject||null,undoObject:t.undoObject||null,type:t.type||null,category:t.category||null})},kDi.prototype.undoGroupAction=function(e,t,i){for(;0!==i;)this.undoEntry(e,t),"StartGroup"===(e=this.getUndoEntry(t)).type?i--:"EndGroup"===e.type&&i++},kDi.prototype.undoEntry=function(e,t){var i,n,o,r;switch("PropertyChanged"!==e.type&&"CollectionChanged"!==e.type&&"LabelCollectionChanged"!==e.type&&(r=i=e.undoObject||e.previous.undoObject),"StartGroup"!==e.type&&"EndGroup"!==e.type&&0<t.historyManager.undoStack.length&&(o=t.historyManager.undoStack.splice(0,1),t.historyManager.redoStack.splice(0,0,o[0]),r=e.undoObject),t.protectPropertyChange(!0),t.diagramActions|=ryi.UndoRedo,e.type){case"PositionChanged":case"Align":case"Distribute":this.recordPositionChanged(i,t);break;case"SizeChanged":case"Sizing":this.recordSizeChanged(i,t,e);break;case"RotationChanged":this.recordRotationChanged(i,t,e,"undo");break;case"ConnectionChanged":this.recordConnectionChanged(i,t);break;case"PropertyChanged":this.recordPropertyChanged(e,t,!1);break;case"CollectionChanged":e&&e.next&&"AddChildToGroupNode"===e.next.type&&"Insert"===e.next.changeType&&(n=t.getObject(e.next.undoObject.id),t.insertValue(DTi(n),!0)),e.isUndo=!0,this.recordCollectionChanged(e,t),e.isUndo=!1,e&&e.next&&"AddChildToGroupNode"===e.next.type&&"Insert"===e.next.changeType&&((n=t.getObject(e.next.undoObject.id)).wrapper.measure(new Omi),n.wrapper.arrange(n.wrapper.desiredSize),t.updateDiagramObject(n));break;case"LabelCollectionChanged":e.isUndo=!0,this.recordLabelCollectionChanged(e,t),e.isUndo=!1;break;case"PortCollectionChanged":e.isUndo=!0,this.recordPortCollectionChanged(e,t),e.isUndo=!1;break;case"Group":this.unGroup(e,t);break;case"UnGroup":this.group(e,t);break;case"SegmentChanged":this.recordSegmentChanged(i,t);break;case"PortPositionChanged":this.recordPortChanged(e,t,!1);break;case"AnnotationPropertyChanged":this.recordAnnotationChanged(e,t,!1);break;case"ChildCollectionChanged":this.recordChildCollectionChanged(e,t,!1);break;case"StackChildPositionChanged":this.recordStackPositionChanged(e,t,!1);break;case"RowHeightChanged":this.recordGridSizeChanged(e,t,!1,!0);break;case"ColumnWidthChanged":this.recordGridSizeChanged(e,t,!1,!1);break;case"LanePositionChanged":this.recordLanePositionChanged(e,t,!1);break;case"LaneCollectionChanged":case"PhaseCollectionChanged":e.isUndo=!0,this.recordLaneOrPhaseCollectionChanged(e,t,!1),e.isUndo=!1;break;case"SendToBack":case"SendForward":case"SendBackward":case"BringToFront":this.recordOrderCommandChanged(e,t,!1);break;case"AddChildToGroupNode":this.recordAddChildToGroupNode(e,t,!1);break;case"RemoveChildFromGroupNode":this.recordRemoveChildFromGroupNode(e,t,!1);break;case"ExternalEntry":t.historyManager.undo(e)}t.diagramActions&=~ryi.UndoRedo,t.protectPropertyChange(!1),t.historyChangeTrigger(e,"Undo"),r&&(o=this.checkNodeObject(r,t))&&(r=jTi(t.updateSelection))&&r(o,t)},kDi.prototype.checkNodeObject=function(e,t){if(e.id)l=t.nameTable[e.id];else if(e.nodes&&0<e.nodes.length||e.connectors&&0<e.connectors.length)for(var i=0,n=0<e.nodes.length?e.nodes:e.connectors;i<n.length;i++)l=n[i],l=t.nameTable[l.id];else{var o=e.nodes||e.connectors;if(o)for(var r=0,s=Object.keys(o);r<s.length;r++)var a=s[r],a=Number(a),l=(e.nodes?t.nodes:t.connectors)[parseInt(a.toString(),10)]}return l},kDi.prototype.group=function(e,t){t.add(e.undoObject)},kDi.prototype.unGroup=function(e,t){e.redoObject=DTi(e.undoObject);e=e.undoObject;t.commandHandler.unGroup(e)},kDi.prototype.ignoreProperty=function(e){return"zIndex"===e||"wrapper"===e||"parentObj"===e||"controlParent"===e},kDi.prototype.getProperty=function(e,t){for(var i=0,n=Object.keys(t);i<n.length;i++){var o=n[i];!e||this.ignoreProperty(o)||(t[""+o]instanceof Object?this.getProperty(e[""+o],t[""+o]):e[""+o]=t[""+o])}},kDi.prototype.recordLaneOrPhaseCollectionChanged=function(e,t,i){var n,o=e.redoObject,r=e.undoObject,e=e.isUndo?"Insert"===e.changeType?"Remove":"Insert":e.changeType;"Remove"===e?t.remove(o):o.isPhase?(n=t.nameTable[o.parentId],t.addPhases(n,[r])):(e=zbi(n=t.nameTable[o.parentId],o),t.addLanes(n,[r],e)),t.clearSelection()},kDi.prototype.recordAnnotationChanged=function(e,t,i){var i=i?e.redoObject:e.undoObject,n=(t.canEnableBlazorObject&&(n=DTi(t.nameTable[i.id]),t.insertValue(n,n instanceof MIi)),a1i(i,e.objectId)),o=t.commandHandler.getAnnotationChanges(t.nameTable[i.id],n),i=t.nameTable[i.id],e=a1i(i,e.objectId);e.offset=n.offset,e.margin=n.margin,e.width=n.width,e.height=n.height,e.rotateAngle=n.rotateAngle,e.margin=n.margin,i instanceof MIi?t.nodePropertyChange(i,{},o):t.connectorPropertyChange(i,{},o)},kDi.prototype.recordChildCollectionChanged=function(e,t,i){var n=i?e.redoObject:e.undoObject,o=t.nameTable[n.parentId],r=t.nameTable[n.id];o?mwi(t,o,r,!i,"AddNodeToLane"===e.historyAction,i):(r.parentId&&(o=t.nameTable[r.parentId])&&(this.removeChildFromLane(t,o,r),o.children.splice(o.children.indexOf(r.id),1),o.wrapper.children.splice(o.wrapper.children.indexOf(r.wrapper),1)),n.parentId&&""!==n.parentId&&((o=t.nameTable[n.parentId]).children.push(n.id),o.wrapper.children.push(r.wrapper)),r.parentId=n.parentId,t.removeElements(r),t.updateDiagramObject(r))},kDi.prototype.removeChildFromLane=function(e,t,i){e=e.nameTable[t.parentId];if(e&&e.shape&&0<e.shape.lanes.length){var n="Horizontal"===e.shape.orientation,o=0,n=(0<e.shape.phases.length&&0<e.shape.phaseSize||(o=1),n?e.shape.hasHeader?t.rowIndex-(2-o):t.rowIndex-(1-o):t.columnIndex-(1-o)),r=e.shape.lanes[parseInt(n.toString(),10)];if(r&&r.children&&0<r.children.length)for(var s=r.children.length-1;0<=s;s--)r.children[parseInt(s.toString(),10)].id===i.id&&r.children.splice(s,1)}},kDi.prototype.recordStackPositionChanged=function(e,t,i){var n,e=i?e.redoObject:e.undoObject;e.source&&(n=t.nameTable[e.source.parentId])&&(e.target?(n.wrapper.children.splice(e.targetIndex,1),n.wrapper.children.splice(e.sourceIndex,0,e.source.wrapper)):void 0!==e.sourceIndex?(t.nameTable[e.source.id]||t.add(e.source),n.wrapper.children.splice(e.sourceIndex,0,t.nameTable[e.source.id].wrapper),t.nameTable[e.source.id].parentId=n.id):(n.wrapper.children.splice(n.wrapper.children.indexOf(t.nameTable[e.source.id].wrapper),1),t.nameTable[e.source.id].parentId=""),i&&"UmlClassifier"===n.shape.type&&t.remove(e.source),n.wrapper.measure(new Omi),n.wrapper.arrange(n.wrapper.desiredSize),t.updateDiagramObject(n),t.updateSelector())},kDi.prototype.recordGridSizeChanged=function(e,t,i,n){var o,r,s,a,l,h,d=i?e.redoObject:e.undoObject,i=i?e.undoObject:e.redoObject;d.parentId&&(e=t.nameTable[d.parentId],o=t.nameTable[d.id],r=e.wrapper.bounds.x,s=e.wrapper.bounds.y,"SwimLane"===e.shape.type)&&(a=e.wrapper.children[0],l=e.shape.padding,h=!1,t.diagramActions&ryi.UndoRedo&&(h=!0),Hbi(t,i,e,d),n?(a.updateRowHeight(d.rowIndex,d.wrapper.actualSize.height,!0,l,h),e.height=e.wrapper.height=a.height):(a.updateColumnWidth(d.columnIndex,d.wrapper.actualSize.width,!0,l,h),e.width=e.wrapper.width=a.width,d.isPhase&&(o.maxWidth=o.wrapper.maxWidth=d.wrapper.actualSize.width)),Pbi(e),i=r-e.wrapper.bounds.x,n=s-e.wrapper.bounds.y,t.drag(e,i,n),t.clearSelection(),t.updateDiagramObject(e))},kDi.prototype.recordLanePositionChanged=function(e,t,i){i=i?e.redoObject:e.undoObject;i.source&&(e=t.nameTable[i.source.parentId])&&"SwimLane"===e.shape.type&&(Vbi(t,i.target,i.source),t.clearSelection())},kDi.prototype.recordPortChanged=function(e,t,i){var i=(i?e.redoObject:e.undoObject).nodes[0],n=(t.canEnableBlazorObject&&(n=DTi(t.nameTable[i.id]),t.insertValue(n,!0)),l1i(i,e.objectId)),o=t.commandHandler.getPortChanges(t.nameTable[i.id],n),i=t.nameTable[i.id];l1i(i,e.objectId).offset=n.offset,t.nodePropertyChange(i,{},o),i.parentId&&t.updateConnectorEdges(t.nameTable[i.parentId])},kDi.prototype.recordPropertyChanged=function(e,t,i){var n=e.redoObject,e=e.undoObject;this.getProperty(t,i?n:e),i?t.onPropertyChanged(n,e):t.onPropertyChanged(e,n),t.diagramActions=t.diagramActions|ryi.UndoRedo},kDi.prototype.recordOrderCommandChanged=function(e,t,i){var n=e.redoObject,o=e.undoObject;t.commandHandler.orderCommands(i,i?n:o,e.type),t.diagramActions=t.diagramActions|ryi.UndoRedo},kDi.prototype.recordAddChildToGroupNode=function(e,t,i){var n=t.nameTable[e.undoObject.id],o=t.nameTable[e.objectId];i&&"Insert"===e.changeType?t.addChildToGroup(n,o.id):t.removeChildFromGroup(n,o.id)},kDi.prototype.recordRemoveChildFromGroupNode=function(e,t,i){var n=t.nameTable[e.undoObject.id],o=t.nameTable[e.objectId];i&&"Remove"===e.changeType?t.removeChildFromGroup(n,o.id):t.addChildToGroup(n,o.id)},kDi.prototype.recordSegmentChanged=function(e,t){var i,n=0;if(e.connectors&&0<e.connectors.length)for(n=0;n<e.connectors.length;n++)i=e.connectors[parseInt(n.toString(),10)],this.segmentChanged(i,t)},kDi.prototype.segmentChanged=function(e,t){var i=t.nameTable[e.id];i.segments=e.segments,t.commandHandler.updateEndPoint(i)},kDi.prototype.recordPositionChanged=function(e,t){var i,n,o=0;if(e.nodes&&0<e.nodes.length){for(o=0;o<e.nodes.length;o++)t.bpmnModule&&(t.isPositionUndo=!0),i=e.nodes[parseInt(o.toString(),10)],this.positionChanged(i,t);t.isPositionUndo=!1}if(e.connectors&&0<e.connectors.length)for(o=0;o<e.connectors.length;o++)n=e.connectors[parseInt(o.toString(),10)],this.segmentChanged(n,t),this.connectionChanged(n,t)},kDi.prototype.positionChanged=function(e,t){var i,n,o=t.nameTable[e.id];e.processId&&!o.processId&&t.addProcess(e,e.processId),!e.processId&&o.processId&&t.removeProcess(e.id),n=o.processId?(i=e.margin.left-o.margin.left,e.margin.top-o.margin.top):(o.parentId&&(n=t.nameTable[o.parentId]).isLane&&(e.wrapper.offsetX=e.width/2+(n.wrapper.bounds.x+e.margin.left),e.wrapper.offsetY=e.height/2+(n.wrapper.bounds.y+e.margin.top)),i=e.wrapper.offsetX-o.offsetX,e.wrapper.offsetY-o.offsetY),t.drag(o,i,n),t.bpmnModule&&t.bpmnModule.updateDocks(o,t)},kDi.prototype.recordSizeChanged=function(e,t,i){var n,o,r=0;if(e&&e.nodes&&0<e.nodes.length)for(r=0;r<e.nodes.length;r++)if((o=e.nodes[parseInt(r.toString(),10)]).children&&!o.container)for(var s=t.commandHandler.getAllDescendants(o,[]),a=0;a<s.length;a++){var l=i.childTable[s[parseInt(a.toString(),10)].id];S1i(l)===MIi?(this.sizeChanged(l,t,i),this.positionChanged(l,t)):this.connectionChanged(l,t,i)}else t.bpmnModule&&(t.sizeUndo=!0),this.sizeChanged(o,t),this.positionChanged(o,t),t.bpmnModule&&(t.sizeUndo=!1);if(e&&e.connectors&&0<e.connectors.length)for(var h=e.connectors,r=0;r<h.length;r++)n=h[parseInt(r.toString(),10)],this.connectionChanged(n,t)},kDi.prototype.sizeChanged=function(e,t,i){var n=t.nameTable[e.id],o=e.wrapper.actualSize.width/n.wrapper.actualSize.width,r=e.wrapper.actualSize.height/n.wrapper.actualSize.height;i&&i.childTable&&(i.childTable[e.id]=DTi(n)),t.scale(n,o,r,{x:e.wrapper.offsetX/n.wrapper.offsetX,y:e.wrapper.offsetY/n.wrapper.offsetY})},kDi.prototype.recordRotationChanged=function(e,t,i,n){var o,r=0,s=t.selectedItems;if(s.rotateAngle=e.rotateAngle,s&&s.wrapper&&(s.wrapper.rotateAngle=e.rotateAngle),t.fromUndo=!0,e&&e.nodes&&0<e.nodes.length)for(r=0;r<e.nodes.length;r++){var a,l=!1;if((a=e.nodes[parseInt(r.toString(),10)]).children&&0<a.children.length){for(var h=0;h<a.children.length;h++){var d=t.nameTable[a.children[parseInt(h.toString(),10)]];if(S1i(d)!==MIi&&(""===d.sourceID||""===d.targetID)){l=!0;break}}if(l&&0<Object.keys(i.childTable).length){for(var p=t.commandHandler.getAllDescendants(a,[]),c=0;c<p.length;c++){var u=i.childTable[p[parseInt(c.toString(),10)].id];if(S1i(u)===MIi){var g={id:"",rotateAngle:0,wrapper:{offsetX:0,offsetY:0}};if("redo"===n?(g.id=u.id,g.rotateAngle=a.rotateAngle):g=u,this.rotationChanged(g,t),"undo"===n){var m=t.nameTable[g.id];this.undoOffsets.push({id:m.id,offsetX:m.offsetX,offsetY:m.offsetY})}else{for(var f=-1,y=this.undoOffsets.length-1;0<=y;y--)if(this.undoOffsets[parseInt(y.toString(),10)].id===g.id){g.wrapper=this.undoOffsets[parseInt(y.toString(),10)],f=y;break}-1!==f&&this.undoOffsets.splice(f,1)}this.positionChanged(g,t)}else this.connectionChanged(u,t,i)}t.nameTable[a.id].rotateAngle=e.rotateAngle,t.updateSelector(),this.rotationChanged(a,t)}else this.rotationChanged(a,t),this.positionChanged(a,t)}else this.rotationChanged(a,t),this.positionChanged(a,t)}if(t.fromUndo=!1,e&&e.connectors&&0<e.connectors.length)for(r=0;r<e.connectors.length;r++)o=e.connectors[parseInt(r.toString(),10)],this.connectionChanged(o,t)},kDi.prototype.rotationChanged=function(e,t){var i=t.nameTable[e.id];t.rotate(i,e.rotateAngle-i.rotateAngle)},kDi.prototype.recordConnectionChanged=function(e,t){e=e&&e.connectors?e.connectors[0]:e;e.sourceID&&t.nameTable[e.sourceID]&&t.insertValue(t.nameTable[e.sourceID],!0),e.targetID&&t.nameTable[e.targetID]&&t.insertValue(t.nameTable[e.targetID],!0),(e instanceof ISi||"None"===e.shape.type||"Bpmn"===e.shape.type)&&this.connectionChanged(e,t)},kDi.prototype.connectionChanged=function(e,t,i){var n=t.nameTable[e.id],o=(e.sourcePortID!==n.sourcePortID&&(t.removePortEdges(t.nameTable[n.sourceID],n.sourcePortID,n.id,!1),n.sourcePortID=e.sourcePortID,t.connectorPropertyChange(n,{},{sourcePortID:e.sourcePortID})),e.targetPortID!==n.targetPortID&&(t.removePortEdges(t.nameTable[n.targetID],n.targetPortID,n.id,!0),n.targetPortID=e.targetPortID,t.connectorPropertyChange(n,{},{targetPortID:e.targetPortID})),e.sourceID!==n.sourceID&&(""===e.sourceID?e1i((o=t.nameTable[n.sourceID]).outEdges,e.id):((o=t.nameTable[e.sourceID]).outEdges.push(e.id),t.updatePortEdges(o,e,!1)),n.sourceID=e.sourceID,t.connectorPropertyChange(n,{},{sourceID:e.sourceID})),e.targetID!==n.targetID&&(""===e.targetID?e1i((o=t.nameTable[n.targetID]).inEdges,e.id):((o=t.nameTable[e.targetID]).inEdges.push(e.id),t.updatePortEdges(o,e,!0)),n.targetID=e.targetID,t.connectorPropertyChange(n,{},{targetID:e.targetID})),i&&i.childTable&&(i.childTable[e.id]=DTi(n)),e.sourcePoint.x-n.sourcePoint.x),i=e.sourcePoint.y-n.sourcePoint.y,o=(0==o&&0==i||t.dragSourceEnd(n,o,i),e.targetPoint.x-n.targetPoint.x),i=e.targetPoint.y-n.targetPoint.y;0==o&&0==i||t.dragTargetEnd(n,o,i),t.updateSelector(),"SVG"!==t.mode&&t.refreshDiagramLayer()},kDi.prototype.recordCollectionChanged=function(e,t){var i,n=e.undoObject;e&&e.changeType&&("Remove"===(e.isUndo?"Insert"===e.changeType?"Remove":"Insert":e.changeType)?n.nodeId?t.remove(t.nameTable[n.nodeId+"_textannotation_"+n.id]):(t.remove(n),n.parentId&&(i=t.nameTable[n.parentId])&&this.removeChildFromLane(t,i,n),t.clearSelectorLayer()):(t.clearSelectorLayer(),n.parentId?(i=t.nameTable[n.parentId])?t.addChild(i,n):t.add(n):n.nodeId?t.addTextAnnotation(n,t.nameTable[n.nodeId]):t.nameTable[n.id]||(n&&n.shape&&"SwimLane"===n.shape.type&&e.isUndo&&Xbi(n,void 0,void 0,void 0,void 0,!0),this.updateConnectorZindex(n,t),t.add(n)),n.processId&&t.nameTable[n.processId]&&t.addProcess(n,n.processId)),"SVG"!==t.mode)&&t.refreshDiagramLayer()},kDi.prototype.updateConnectorZindex=function(e,t){var i,n;(e.sourceID||e.targetID)&&(n=t.nameTable[e.sourceID],i=t.nameTable[e.targetID],n&&n.parentId?(n=t.nameTable[n.parentId])&&n.isLane&&gwi(e,t.nameTable[n.parentId],t):i&&i.parentId&&(n=t.nameTable[i.parentId])&&n.isLane&&gwi(e,t.nameTable[n.parentId],t))},kDi.prototype.recordLabelCollectionChanged=function(e,t){var i=e.undoObject,n=e.redoObject,n=t.nameTable[n.id];e&&e.changeType&&("Remove"===(e.isUndo?"Insert"===e.changeType?"Remove":"Insert":e.changeType)?(t.removeLabels(n,[i]),t.clearSelectorLayer()):(t.clearSelectorLayer(),t.addLabels(n,[i])),"SVG"!==t.mode)&&t.refreshDiagramLayer()},kDi.prototype.recordPortCollectionChanged=function(e,t){var i=e.undoObject,n=e.redoObject,n=t.nameTable[n.id];e&&e.changeType&&("Remove"===(e.isUndo?"Insert"===e.changeType?"Remove":"Insert":e.changeType)?(t.removePorts(n,[i]),t.clearSelectorLayer()):(t.clearSelectorLayer(),t.addPorts(n,[i])),"SVG"!==t.mode)&&t.refreshDiagramLayer()},kDi.prototype.redo=function(e){this.checkRedo=!0;var t=this.getRedoEntry(e),i=0;t&&("Internal"===t.category?("StartGroup"===t.type?(i++,this.groupUndo=!0):this.redoEntry(t,e),this.groupUndo&&(this.redoGroupAction(t,e,i),this.groupUndo=!1)):(N||e.historyManager.redo(t),i={entryType:"redo",oldValue:t.redoObject,newValue:t.undoObject},e.triggerEvent(dyi.historyStateChange,i))),this.checkRedo=!1},kDi.prototype.redoGroupAction=function(e,t,i){for(;0!==i;)this.redoEntry(e,t),"EndGroup"===(e=this.getRedoEntry(t)).type?i--:"StartGroup"===e.type&&i++},kDi.prototype.redoEntry=function(e,t){var i,n,o;switch("PropertyChanged"!==e.type&&"CollectionChanged"!==e.type&&(i=e.redoObject,o=e.redoObject),t.diagramActions|=ryi.UndoRedo,"StartGroup"!==e.type&&"EndGroup"!==e.type&&0<t.historyManager.redoStack.length&&(n=t.historyManager.redoStack.splice(0,1),t.historyManager.undoStack.splice(0,0,n[0]),o=e.redoObject),t.protectPropertyChange(!0),e.type){case"PositionChanged":case"Align":case"Distribute":this.recordPositionChanged(i,t);break;case"SizeChanged":case"Sizing":this.recordSizeChanged(i,t,e);break;case"RotationChanged":this.recordRotationChanged(i,t,e,"redo");break;case"ConnectionChanged":this.recordConnectionChanged(i,t);break;case"PropertyChanged":this.recordPropertyChanged(e,t,!0);break;case"CollectionChanged":this.recordCollectionChanged(e,t);break;case"LabelCollectionChanged":this.recordLabelCollectionChanged(e,t);break;case"PortCollectionChanged":this.recordPortCollectionChanged(e,t);break;case"Group":this.group(e,t);break;case"UnGroup":this.unGroup(e,t);break;case"SegmentChanged":this.recordSegmentChanged(i,t);break;case"PortPositionChanged":this.recordPortChanged(e,t,!0);break;case"AnnotationPropertyChanged":this.recordAnnotationChanged(e,t,!0);break;case"ChildCollectionChanged":this.recordChildCollectionChanged(e,t,!0);break;case"StackChildPositionChanged":this.recordStackPositionChanged(e,t,!0);break;case"RowHeightChanged":this.recordGridSizeChanged(e,t,!0,!0);break;case"ColumnWidthChanged":this.recordGridSizeChanged(e,t,!0,!1);break;case"LanePositionChanged":this.recordLanePositionChanged(e,t,!0);break;case"LaneCollectionChanged":case"PhaseCollectionChanged":this.recordLaneOrPhaseCollectionChanged(e,t,!0);break;case"SendToBack":case"SendForward":case"SendBackward":case"BringToFront":this.recordOrderCommandChanged(e,t,!0);break;case"AddChildToGroupNode":this.recordAddChildToGroupNode(e,t,!0);break;case"RemoveChildFromGroupNode":this.recordRemoveChildFromGroupNode(e,t,!0);break;case"ExternalEntry":t.historyManager.redo(e)}t.protectPropertyChange(!1),t.diagramActions&=~ryi.UndoRedo,t.historyChangeTrigger(e,"Redo"),o&&(n=this.checkNodeObject(o,t))&&(o=jTi(t.updateSelection))&&o(n,t)},kDi.prototype.getUndoEntry=function(e){var t,i=null,e=e.historyManager;return e.canUndo&&(i=e.currentEntry,(t=e.currentEntry.previous)?(e.currentEntry=t,e.canRedo||(e.canRedo=!0)):(e.canRedo=!0,e.canUndo=!1)),i},kDi.prototype.getRedoEntry=function(e){var t,i=null,e=e.historyManager;return e.canRedo&&((t=e.currentEntry.previous||e.canUndo?e.currentEntry.next:e.currentEntry)&&(e.currentEntry=t,e.canUndo||(e.canUndo=!0),t.next||(e.canRedo=!1,e.canUndo=!0)),i=e.currentEntry),i},kDi.prototype.destroy=function(){},kDi.prototype.getModuleName=function(){return"UndoRedo"};$W=kDi;function kDi(){this.groupUndo=!1,this.childTable=[],this.historyCount=0,this.hasGroup=!1,this.groupCount=0,this.undoOffsets=[],this.checkRedo=!1}PDi.prototype.expand=function(e,t,i,n){var o,r,s=this,a=0;n.realActions=n.realActions|ayi.AnimationClick,this.setIntervalObject[parseInt(0..toString(),10)]=setInterval(function(){return a++,s.layoutAnimation(t,s.setIntervalObject,6===a,n,i)},20),i.isExpanded&&(o=.2,n.protectPropertyChange(!1),r={},e)&&(this.updateOpacity(i,o,n),r[parseInt(0..toString(),10)]=setInterval(function(){n.allowServerDataBinding=!1,o<=1?s.updateOpacity(i,o,n):clearInterval(r[0]),o+=.2,n.allowServerDataBinding=!0},20))},PDi.prototype.stopCurrentAnimation=function(e,t,i){clearInterval(this.setIntervalObject[0]),this.setIntervalObject=[];for(var n=0;n<e.objects.length;n++){var o=t.nameTable[e.objects[parseInt(n.toString(),10)].id];o.offsetX+=e.objects[parseInt(n.toString(),10)].differenceX-e.objects[parseInt(n.toString(),10)].differenceX/5,o.offsetY+=e.objects[parseInt(n.toString(),10)].differenceY-e.objects[parseInt(n.toString(),10)].differenceY/5}t.realActions=t.realActions&ayi.AnimationClick,t.refreshCanvasLayers(),t.protectPropertyChange(!0),t.triggerEvent(dyi.animationComplete,void 0),t.layout.fixedNode="",t.protectPropertyChange(this.protectChange);i={element:DTi(i),state:!!i.isExpanded};t.triggerEvent(dyi.expandStateChange,i),t.lineRoutingModule&&t.constraints&$fi.LineRouting&&t.resetSegments()},PDi.prototype.layoutAnimation=function(e,t,i,n,o){if(!i)for(var r=0;r<e.objects.length;r++){var s=n.nameTable[e.objects[parseInt(r.toString(),10)].id];s.offsetX+=e.objects[parseInt(r.toString(),10)].differenceX/5,s.offsetY+=e.objects[parseInt(r.toString(),10)].differenceY/5}i&&(clearInterval(t[0]),this.setIntervalObject=[],n.realActions=n.realActions&~ayi.AnimationClick,n.refreshCanvasLayers(),n.protectPropertyChange(!0),n.triggerEvent(dyi.animationComplete,void 0),n.organizationalChartModule.isAnimation=!1,n.layout.fixedNode="",n.protectPropertyChange(this.protectChange),i={element:DTi(o),state:!!o.isExpanded},n.triggerEvent(dyi.expandStateChange,i),n.lineRoutingModule)&&n.constraints&$fi.LineRouting&&n.resetSegments()},PDi.prototype.updateOpacity=function(e,t,i){for(var n=0;n<e.outEdges.length;n++){var o=i.nameTable[e.outEdges[parseInt(n.toString(),10)]],r=i.nameTable[o.targetID];o.style.opacity=t;for(var s=0;s<o.wrapper.children.length;s++)o.wrapper.children[parseInt(s.toString(),10)].style.opacity=t,r.style.opacity=t,r.wrapper instanceof Syi&&i.updateNodeProperty(r.wrapper,void 0,t);this.updateOpacity(r,t,i)}},PDi.prototype.destroy=function(){},PDi.prototype.getModuleName=function(){return"LayoutAnimate"};IQ=PDi;function PDi(){this.protectChange=!1,this.setIntervalObject=[]}FDi.prototype.updateCoordinate=function(e){this.coordinate+=e;var e="Left"===this.direction||"Right"===this.direction,t=e?{x:this.startPoint.x,y:this.coordinate}:{x:this.coordinate,y:this.startPoint.y},e=e?{x:this.endPoint.x,y:this.coordinate}:{x:this.coordinate,y:this.endPoint.y};this.startPoint=t,this.previous&&this.previous.adjustEnd(t),this.endPoint=e,this.next&&this.next.adjustStart(e)},FDi.prototype.adjustStart=function(e){this.startPoint=e,this.updateSortedValues()},FDi.prototype.adjustEnd=function(e){this.endPoint=e,this.updateSortedValues()},FDi.prototype.updateSortedValues=function(){var e="Top"===this.direction||"Bottom"===this.direction;this.sortedStart=e?Math.min(this.startPoint.y,this.endPoint.y):Math.min(this.startPoint.x,this.endPoint.x),this.sortedEnd=e?Math.max(this.startPoint.y,this.endPoint.y):Math.max(this.startPoint.x,this.endPoint.x),this.startEvent.refresh(),this.endEvent.refresh()};var BDi=FDi;function FDi(e,t,i){this.startPoint=e,this.endPoint=t,(this.previous=i)&&(i.next=this);i=e.x===t.x;this.coordinate=i?e.x:e.y,this.sortedStart=i?Math.min(e.y,t.y):Math.min(e.x,t.x),this.sortedEnd=i?Math.max(e.y,t.y):Math.max(e.x,t.x),this.direction=i?e.y<t.y?"Bottom":"Top":e.x<t.x?"Right":"Left",this.startEvent=new LDi(this,!0),this.endEvent=new LDi(this,!1)}RDi.prototype.refresh=function(){this.value=this.isStart?this.segment.sortedStart:this.segment.sortedEnd},RDi.prototype.compareTo=function(e){return this.value!==e.value?this.value<e.value?-1:1:this.isStart?-1:e.isStart?1:0};var LDi=RDi;function RDi(e,t){this.segment=e,this.isStart=t,this.value=t?e.sortedStart:e.sortedEnd}NDi.prototype.addSegment=function(e){var t=this.getBranches(e.direction);this.addSegmentToBranch(t,e)},NDi.prototype.addSegmentToBranch=function(e,t){e.has(t.coordinate)||e.set(t.coordinate,new Set);e=e.get(t.coordinate);e&&(e.add(t.startEvent),e.add(t.endEvent))},NDi.prototype.removeSegment=function(e){var t=this.getBranches(e.direction);this.removeSegmentFromBranch(t,e)},NDi.prototype.removeSegmentFromBranch=function(e,t){var i=e.get(t.coordinate);i&&(i.delete(t.startEvent),i.delete(t.endEvent),0===i.size)&&e.delete(t.coordinate)},NDi.prototype.findOverlappingSegments=function(e){var t=this.getBranches(e.direction);return this.findOverlappingSegmentsInBranch(t,e)},NDi.prototype.findOverlappingSegmentsInBranch=function(e,t){var i=[],n=new Set,e=e.get(t.coordinate);if(e){var o=[];e.forEach(function(e){return o.push(e)});for(var r=0;r<o.length;r++){var s=o[parseInt(r.toString(),10)];!(s.segment.sortedStart<t.sortedStart&&s.segment.sortedEnd>t.sortedEnd)&&(s.value<t.sortedStart||s.value>t.sortedEnd)||s.segment===t||n.has(s.segment)||(n.add(s.segment),Math.max(t.sortedStart,s.segment.sortedStart)<Math.min(t.sortedEnd,s.segment.sortedEnd)&&i.push(s.segment))}}return i},NDi.prototype.getBranches=function(e){return"Left"===e||"Right"===e?this.horizontalBranches:this.verticalBranches};var ODi=NDi;function NDi(){this.horizontalBranches=new Map,this.verticalBranches=new Map}VDi.prototype.getModifiedConnector=function(){return this.modifiedConnector},VDi.prototype.getModifiedConnectorSegments=function(e){e=this.segmentMappings.get(e);return this.convertSegmentsToOrthogonal(e)},VDi.prototype.refreshModifiedConnectors=function(i){var n=this;this.modifiedConnector.forEach(function(e){var t=n.getModifiedConnectorSegments(e);t.length&&(e.segments=t,i.connectorPropertyChange(e,{},{type:"Orthogonal",segments:t}))}),this.modifiedConnector.clear()},VDi.prototype.removeConnectors=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)],n=void 0;"string"==typeof i?n=this.diagram.nameTable[i]:i instanceof ISi&&(n=i),n&&"Orthogonal"===n.type&&this.removeConnector(n)}},VDi.prototype.removeConnector=function(e){var t=this,i=this.segmentMappings.get(e);i&&i.forEach(function(e){t.segmentTree.removeSegment(e),t.connectorMappings.delete(e)}),this.segmentMappings.delete(e)},VDi.prototype.addConnector=function(e,t,i){var n=this;if(void 0===t&&(t=[]),!this.diagram.lineDistributionModule){0===t.length&&(t=e.intermediatePoints),this.removeConnector(e);var o=this.createLineSegments(t);if(this.mapSegmentsToConnector(e,o),3<t.length)this.adjustConnector(e);else{for(var r=new Set,s=0,a=o;s<a.length;s++)for(var l=a[s],h=0,d=this.segmentTree.findOverlappingSegments(l);h<d.length;h++){var p=d[h],p=this.connectorMappings.get(p);r.add(p)}r.forEach(function(e){return n.adjustConnector(e)})}}},VDi.prototype.createLineSegments=function(e){for(var t=[],i=0;i<e.length-1;i++){var n=new BDi(e[parseInt(i.toString(),10)],e[parseInt((i+1).toString(),10)],0===i?null:t[parseInt((i-1).toString(),10)]);t.push(n)}return t},VDi.prototype.mapSegmentsToConnector=function(t,e){var i=this;this.segmentMappings.set(t,e),e.forEach(function(e){i.segmentTree.addSegment(e),i.connectorMappings.has(e)||i.connectorMappings.set(e,t)})},VDi.prototype.convertSegmentsToOrthogonal=function(e){var t=[];return e&&e.forEach(function(e){e={type:"Orthogonal",direction:e.direction,length:Math.abs(e.sortedEnd-e.sortedStart)};t.push(e)}),t},VDi.prototype.adjustConnector=function(e){var t=this,i=(this.requireReroute=!1,this.segmentMappings.get(e));if(2<i.length){var n=i[0],o=this.diagram.nameTable[e.sourceID];if(o&&0<o.outEdges.length){for(var r,s,a,l=void 0,h=0;h<o.outEdges.length;h++){var d,p=this.diagram.nameTable[o.outEdges[parseInt(h.toString(),10)]];p!==e&&((p=this.segmentMappings.get(p))&&2<p.length&&(d=p[0]).direction===n.direction&&d.next.direction===n.next.direction&&(!l||Math.abs(n.coordinate-d.coordinate)<Math.abs(n.coordinate-l.coordinate)))&&(l=d)}l&&(r=l.next.coordinate-n.next.coordinate)&&(s=n.next.next,a=n.direction!==s.direction,n.direction===s.direction&&(s=this.calculateMaximumSegmentShift(n,s,s.direction),a=Math.abs(r)<=s),a)&&(this.modifiedSegments.clear(),this.segmentTree.removeSegment(n.next),n.next.updateCoordinate(r),this.segmentTree.addSegment(n.next),this.modifiedSegments.set(n.next,n.next.coordinate),this.modifiedConnector.add(e))}}for(var c=void 0,u=0;u<i.length-1;u++){var g=i[parseInt(u.toString(),10)];if(g.previous&&g.next){var m=this.segmentTree.findOverlappingSegments(g);if(0<m.length&&!this.resolveOverlappingSegments(g,m)&&this.requireReroute){c=g;break}}}if(c&&this.diagram.lineRoutingModule&&this.reRoutedCount<=VDi.maxReRouteLimit){for(;0<this.considerNonWalkable.length;)this.considerNonWalkable.pop().walkable=!0;this.diagram.lineRoutingModule.getGridsIntersect(c.startPoint,c.endPoint).forEach(function(e){e.walkable=!1,t.considerNonWalkable.push(e)}),this.reRoutedCount++,this.diagram.lineRoutingModule.refreshConnectorSegments(this.diagram,e,!1)}for(this.reRoutedCount=0;0<this.considerNonWalkable.length;)this.considerNonWalkable.pop().walkable=!0},VDi.prototype.resolveOverlappingSegments=function(e,t){this.modifiedSegments.clear(),this.currentSegments.clear(),this.rootShiftingSegment=e;var i=this.shouldAdjustSelfFirst(e,t),n=t[0],o=i?this.calculateShiftDirection(e,t):this.calculateShiftDirection(n,this.segmentTree.findOverlappingSegments(n)),r=!1;return i?(i=1===t.length?n:void 0,(r=this.attemptAdjustment(e,o,i))||(o=mvi(o),r=this.attemptAdjustment(e,o,i,!0))):(r=this.attemptAdjustment(n,o,e))||(o=mvi(o),r=this.attemptAdjustment(n,o,e,!0)),this.updateSegmentTreeWithModifiedSegments(),this.rootShiftingSegment=void 0,r},VDi.prototype.shouldAdjustSelfFirst=function(e,t){var i,n,o=1<t.length;return o=1!==t.length||(t=t[0]).previous&&t.next&&(i=Math.max(e.sortedStart,t.sortedStart),e=((n=Math.min(e.sortedEnd,t.sortedEnd))-i)/(e.sortedEnd-e.sortedStart),!((n-i)/(t.sortedEnd-t.sortedStart)<=e))?o:!0},VDi.prototype.attemptAdjustment=function(e,t,i,n){e=this.adjustSegment(e,t,n=void 0===n?!1:n);return this.updateModifiedSegments(e),e||i&&i.previous&&i.next&&(t=mvi(t),e=this.adjustSegment(i,t,n),this.updateModifiedSegments(e)),e},VDi.prototype.updateModifiedSegments=function(i){var n=this;i&&this.modifiedSegments.clear(),this.currentSegments.forEach(function(e,t){i&&n.modifiedSegments.set(t,t.coordinate),n.segmentTree.removeSegment(t),t.updateCoordinate(e-t.coordinate),n.segmentTree.addSegment(t)}),this.currentSegments.clear()},VDi.prototype.updateSegmentTreeWithModifiedSegments=function(){var i=this;0<this.modifiedSegments.size&&this.modifiedSegments.forEach(function(e,t){i.segmentTree.removeSegment(t),t.updateCoordinate(e-t.coordinate),i.segmentTree.addSegment(t);e=i.connectorMappings.get(t);i.modifiedConnector.has(e)||i.modifiedConnector.add(e)})},VDi.prototype.resolveOverlappingAtGivenDirection=function(e,t,i,n,o){if(o){for(var r=!1,s=0,a=t;s<a.length;s++){var l=a[s];if(l.previous&&l.next&&!(r=this.adjustSegment(l,i,n,o)))return!1}return r}var h,d=e;return 1===t.length&&(h=this.shouldAdjustSelfFirst(e,t),l=t[0],t=h?this.calculateShiftDirection(e,t):this.calculateShiftDirection(l,this.segmentTree.findOverlappingSegments(l)),n&&(t=mvi(t)),(d=h?t===i?e:l:t===i?l:e)!==l||l.previous&&l.next||(d=e)),this.adjustSegment(d,i,n)},VDi.prototype.calculateShiftDirection=function(e,t){var i,n,o,r,s,a,l,t=t[0],h=e.previous,d=e.next,p="Left"===e.direction||"Right"===e.direction?e.startPoint.x:e.startPoint.y,c="Left"===e.direction||"Right"===e.direction?e.endPoint.x:e.endPoint.y;e.direction;return h.direction===d.direction?(i=t.previous,n=t.next,o=t.sortedStart<=p&&p<=t.sortedEnd,r=t.sortedStart<=c&&c<=t.sortedEnd,o&&r&&(l="Left"===t.direction||"Right"===t.direction?t.startPoint.x:t.startPoint.y,s="Left"===t.direction||"Right"===t.direction?t.endPoint.x:t.endPoint.y,e.direction!==t.direction&&(a=l,l=s,s=a),a=Math.abs(p-l),Math.abs(c-s)<=a||d.next&&e.direction===d.next.direction&&0!==this.segmentTree.findOverlappingSegments(d).length?r=!1:o=!1),o?e.direction===t.direction&&n?mvi(n.direction):e.direction!==t.direction&&i?mvi(i.direction):mvi(h.direction):r?e.direction===t.direction&&i?i.direction:e.direction!==t.direction&&n?mvi(n.direction):mvi(h.direction):d.direction):(!t.previous||!t.next||t.previous.direction===t.next.direction||(p=Math.max(e.sortedStart,t.sortedStart),c=((l=Math.min(e.sortedEnd,t.sortedEnd))-p)/(e.sortedEnd-e.sortedStart),(l-p)/(t.sortedEnd-t.sortedStart)<=c)?d:h).direction},VDi.prototype.adjustSegment=function(e,t,i,n){void 0===n&&(n=!1);var o=e.coordinate,r=e.previous,s=e.next,r=this.calculateMaximumSegmentShift(r,s,t),s=("Right"===t||"Bottom"===t?1:-1)*VDi.ConnectorSpacing;if(Math.abs(s)<=r){if(this.segmentTree.removeSegment(e),e.updateCoordinate(s),this.segmentTree.addSegment(e),this.currentSegments.has(e)||this.currentSegments.set(e,o),this.diagram.lineRoutingModule){var r=e.startPoint,a=e.endPoint;if(!this.diagram.lineRoutingModule.isPathWalkable(r,a,this.diagram)){if(!n&&e===this.rootShiftingSegment){this.segmentTree.removeSegment(e),e.updateCoordinate(-1*s),this.segmentTree.addSegment(e);var l,r=this.segmentTree.findOverlappingSegments(e);if(0!==r.length)return l=mvi(t),this.resolveOverlappingAtGivenDirection(e,r,l,i,!0)}return!(this.requireReroute=!0)}}if(0!==(a=this.segmentTree.findOverlappingSegments(e)).length)return!(0!==this.modifiedSegments.size&&this.modifiedSegments.size>this.currentSegments.size+1)&&this.resolveOverlappingAtGivenDirection(e,a,t,i,n)}else if(!n&&e===this.rootShiftingSegment)if(0!==(a=this.segmentTree.findOverlappingSegments(e)).length)return l=mvi(t),this.resolveOverlappingAtGivenDirection(e,a,l,i,!0);return e.coordinate!==o},VDi.prototype.calculateMaximumSegmentShift=function(e,t,i){var n,o=Math.abs(e.sortedEnd-e.sortedStart),r=Math.abs(t.sortedEnd-t.sortedStart),s=this.connectorMappings.get(e);return s&&(e.previous||(n=5,o-=(n="None"!==s.sourceDecorator.shape?Math.max(s.sourceDecorator.width,s.sourceDecorator.height):n)+5),t.next||(n=5,r-=(n="None"!==s.targetDecorator.shape?Math.max(s.targetDecorator.width,s.targetDecorator.height):n)+5)),e.direction===t.direction?i===t.direction?r:o:i===t.direction?Math.min(o,r):Number.MAX_VALUE},VDi.prototype.destroy=function(){},VDi.prototype.getModuleName=function(){return"AvoidLineOverlapping"},VDi.ConnectorSpacing=5,VDi.maxReRouteLimit=5;b8=VDi;function VDi(e){this.requireReroute=!1,this.reRoutedCount=0,this.considerNonWalkable=[],this.diagram=e,this.segmentTree=new ODi,this.segmentMappings=new Map,this.connectorMappings=new Map,this.modifiedConnector=new Set,this.modifiedSegments=new Map,this.currentSegments=new Map}_Di.prototype.destroy=function(){},_Di.prototype.getModuleName=function(){return"LineDistribution"},_Di.prototype.initLineDistribution=function(e,t){var i="Bottom";if("DifferentPoint"===t.layout.connectionPointOrigin||t.layout.enableRouting){var n="Top",o=("BottomToTop"===e.orientation?(i="Top",n="Bottom"):"RightToLeft"===e.orientation?(i="Left",n="Right"):"LeftToRight"===e.orientation&&(i="Right",n="Left"),t.nodes);if(0<o.length)for(var r=0;r<o.length;r++){var s=t.nameTable[o[parseInt(r.toString(),10)].id];this.addDynamicPortandDistrrbuteLine(e,s,i,n,t)}}},_Di.prototype.ObstacleSegment=function(e){return e.direction=C1i(e.startpt,e.endpt),e.distance=Hmi.findLength(e.startpt,e.endpt),e.orientation="Left"===e.direction||"Right"===e.direction?"horizontal":"vertical",e.id=e.id,"horizontal"===e.orientation?(e.coord=e.startpt.y,"Left"===e.direction?(e.start=e.endpt.x,e.end=e.startpt.x):(e.start=e.startpt.x,e.end=e.endpt.x)):(e.coord=e.startpt.x,"Top"===e.direction?(e.start=e.endpt.y,e.end=e.startpt.y):(e.start=e.startpt.y,e.end=e.endpt.y)),e},_Di.prototype.distributeLines=function(e,t){for(var i="LeftToRight"===e.orientation||"RightToLeft"===e.orientation,n="obstaclePointCollection",o=(i?e.horizontalSpacing:e.verticalSpacing)-8-10,r=[],s=[],O=t.connectors,a=0;a<O.length;a++){for(var l=O[parseInt(a.toString(),10)],h=[],d=0;d<l.segments.length;d++)for(var N=l.segments[parseInt(d.toString(),10)],p=0;p<N.points.length;p++){var V=N.points[parseInt(p.toString(),10)];0!==h.length&&Hmi.equals(V,h[h.length-1])||h.push(V)}for(var _=[],c=1;c<h.length;c++){var u=this.ObstacleSegment({startpt:h[c-1],endpt:h[parseInt(c.toString(),10)],id:l.id});_.push(u)}var g={wrapper:l,segments:_},m=[];if(i)for(d=0;d<g.segments.length;d++)"vertical"===(u=g.segments[parseInt(d.toString(),10)]).orientation&&m.push(u);else for(var d=0;d<g.segments.length;d++)"horizontal"===(u=g.segments[parseInt(d.toString(),10)]).orientation&&m.push(u);for(c=0;c<m.length;c++){for(var f=m[parseInt(c.toString(),10)],y=(this.containsValue(r,f.coord)||r.push({key:f.coord,value:[]}),void 0),p=0;p<r.length;p++){d=r[parseInt(p.toString(),10)].key;if(Number(d)===f.coord){y=p;break}}r[parseInt(y.toString(),10)].value.push(f)}s.push(g)}this.sortConnectors(r,t);for(var v=[],b=0;b<r.length;b++){var H=r[parseInt(b.toString(),10)],w=H.value,C=(w.sort(),void 0),C=[],y=0,S=Number.MIN_VALUE;C.push([]);for(var A=0;A<w.length;A++)f=w[parseInt(A.toString(),10)],S=!(0<C[parseInt(y.toString(),10)].length)||S>=f.start?(C[parseInt(y.toString(),10)].push(f),Math.max(S,C[parseInt(y.toString(),10)][C[parseInt(y.toString(),10)].length-1].end)):(y++,C.push([]),C[parseInt(y.toString(),10)].push(f),C[parseInt(y.toString(),10)][C[parseInt(y.toString(),10)].length-1].end);for(A=0;A<C.length;A++){for(var z=C[parseInt(A.toString(),10)],x=[],c=0;c<z.length;c++)(T=z[parseInt(c.toString(),10)]).start&&x.push(T);for(var j=i?"Bottom":"Right",I=[],c=0;c<x.length;c++)(T=x[parseInt(c.toString(),10)]).direction===j&&I.push(T);for(var T,E=[],c=0;c<x.length;c++)(T=x[parseInt(c.toString(),10)]).direction!==j&&E.push(T);var D=[];if(0<I.length)for(var W=I[0].start,c=0;c<E.length;)E[parseInt(c.toString(),10)].end>W?(D.push(E[parseInt(c.toString(),10)]),E.splice(c,1)):c++;var M=[],M=this.updateSegmentRow(D,M),k=[],k=[],P=(k=this.updateSegmentRow(E,k),I.reverse(),k=this.updateSegmentRow(I,k),0<M[M.length-1].length||M.splice(M.length-1,1),0<k[k.length-1].length||k.splice(k.length-1,1),[]);if(0<D.length&&(x[x.length-1].direction===D[D.length-1].direction||x[0].direction===D[0].direction))for(var P=k,B=0;B<M.length;B++){var F=M[parseInt(B.toString(),10)];P[P.length]=F}else{P=M;for(B=0;B<k.length;B++){F=k[parseInt(B.toString(),10)];P[P.length]=F}}if(1<P.length)for(var L=1,Q=("BottomToTop"!==e.orientation&&"RightToLeft"!==e.orientation||(L=-1),H.key-L*o/2),U=o/P.length,a=0;a<P.length;a++)for(var q=Q+a*U*L,B=0;B<P[parseInt(a.toString(),10)].length;B++){(f=P[parseInt(a.toString(),10)][parseInt(B.toString(),10)]).coord=q,this.containsValue(v,f.coord)||v.push({key:f.coord,value:[]});for(var G=void 0,p=0;p<v.length;p++)if(v[parseInt(p.toString(),10)].key===f.coord){G=p;break}v[parseInt(G.toString(),10)].value.push(f)}}}for(b=0;b<s.length;b++){for(g=s[parseInt(b.toString(),10)],h=[],a=0;a<g.segments.length;a++)0===a?h.push(this.getObstacleStartPoint(g.segments[parseInt(a.toString(),10)])):i?"vertical"===g.segments[parseInt(a.toString(),10)].orientation&&(h[h.length-1]=this.getObstacleStartPoint(g.segments[parseInt(a.toString(),10)])):"horizontal"===g.segments[parseInt(a.toString(),10)].orientation&&(h[h.length-1]=this.getObstacleStartPoint(g.segments[parseInt(a.toString(),10)])),h.push(this.getObstacleEndPoint(g.segments[parseInt(a.toString(),10)]));g.wrapper[n]=[];for(c=0;c<h.length;c++){var R=h[parseInt(c.toString(),10)];(0===c||0<c&&!Hmi.equals(R,h[c-1]))&&g.wrapper[n].push(this.getPointvalue(R.x,R.y))}"Orthogonal"===g.wrapper.type&&this.resetConnectorPoints(g.wrapper,t)}},_Di.prototype.sortConnectors=function(e,i){for(var t=0;t<e.length;t++)for(var n=0;n<e[parseInt(t.toString(),10)].value.length;n++)1<e[parseInt(t.toString(),10)].value.length&&("LeftToRight"===i.layout.orientation||"RightToLeft"===i.layout.orientation?e[parseInt(t.toString(),10)].value.sort(function(e,t){e=i.nameTable[""+e.id],t=i.nameTable[""+t.id];return e.targetPoint.y-t.targetPoint.y}):"TopToBottom"!==i.layout.orientation&&"BottomToTop"!==i.layout.orientation||e[parseInt(t.toString(),10)].value.sort(function(e,t){e=i.nameTable[""+e.id],t=i.nameTable[""+t.id];return e.targetPoint.x-t.targetPoint.x}))},_Di.prototype.resetConnectorPoints=function(e,t){var i="obstaclePointCollection";if(e.segments[0].points&&0<e.segments[0].points.length&&e[i]){for(var n=e,o=(n.sourcePoint=e[i][0],n.targetPoint=e[i][e[i].length-1],void 0),o=[],r=0;r<e[i].length-1;r++){var s=e[i][parseInt(r.toString(),10)],a=e[i][r+1],l=M1i(s,a),s=C1i(s,a),a=(r===e[i].length-2&&("RightToLeft"===t.layout.orientation&&"Left"===s||"LeftToRight"===t.layout.orientation&&"Right"===s||"TopToBottom"===t.layout.orientation&&"Bottom"===s||"BottomToTop"===t.layout.orientation&&"Top"===s)&&(l/=2),new sSi(e,"segments",{type:"Orthogonal"},!0));a.length=l,a.direction=s,o.push(a)}n.segments=o,n.type="Orthogonal",t.connectorPropertyChange(n,{},{type:"Orthogonal",segments:n.segments})}},_Di.prototype.getObstacleEndPoint=function(e){return"horizontal"===e.orientation?"Left"===e.direction?this.getPointvalue(e.start,e.coord):this.getPointvalue(e.end,e.coord):"Top"===e.direction?this.getPointvalue(e.coord,e.start):this.getPointvalue(e.coord,e.end)},_Di.prototype.getObstacleStartPoint=function(e){return"horizontal"===e.orientation?"Left"===e.direction?this.getPointvalue(e.end,e.coord):this.getPointvalue(e.start,e.coord):"Top"===e.direction?this.getPointvalue(e.coord,e.end):this.getPointvalue(e.coord,e.start)},_Di.prototype.updateSegmentRow=function(e,t){var i=0;0<t.length||(t[0]=[]);for(var n=0;n<e.length;n++)for(var o=e[parseInt(n.toString(),10)];i<t.length;){if(i===t.length-1&&(t[i+1]=[]),!(0<t[parseInt(i.toString(),10)].length)||t[parseInt(i.toString(),10)][t[parseInt(i.toString(),10)].length-1].end<o.start){t[parseInt(i.toString(),10)].push(o);break}i++}return t},_Di.prototype.portOffsetCalculation=function(e,t,i,n){"Top"===i&&(e.offset={x:(n+1)*(1/(t+1)),y:0}),"Bottom"===i&&(e.offset={x:(n+1)*(1/(t+1)),y:1}),"Left"===i&&(e.offset={x:0,y:(n+1)*(1/(t+1))}),"Right"===i&&(e.offset={x:1,y:(n+1)*(1/(t+1))})},_Di.prototype.addDynamicPortandDistrrbuteLine=function(e,t,i,n,o){t.ports&&0<t.ports.length&&(r=t.ports,o.removePorts(t,r)),t.ports;var r=t.outEdges,s=t.inEdges;this.initPort(r,o,t,i,!1),this.initPort(s,o,t,n,!0)},_Di.prototype.initPort=function(e,t,i,n,o){var r=e;1<e.length&&o&&(e=this.sortObjects(r,o,t));for(var s=0;s<=e.length-1;s++){var a=t.nameTable[e[parseInt(s.toString(),10)]],l=(a.obstaclePointCollection=[],l1i(i,o?a.targetPortID:a.sourcePortID)),h=n,h=(void 0===l&&((l=new r0i(i,"ports","",!0)).id=xTi()+"_LineDistribution",o?a.targetPortID=l.id:a.sourcePortID=l.id),this.portOffsetCalculation(l,e.length,h,s),i.ports.push(l),i.initPortWrapper(i.ports[i.ports.length-1]));i.wrapper.children.push(h),i.wrapper.measure(new Omi(i.width,i.height),i.id),i.wrapper.arrange(i.wrapper.desiredSize),t.connectorPropertyChange(a,o?{targetPortID:""}:{sourcePortID:""},o?{targetPortID:l.id}:{sourcePortID:l.id})}},_Di.prototype.sortObjects=function(e,t,i){for(var n,o=0;o<e.length;o++)for(var r=o+1;r<e.length;r++){var s=i.nameTable[e[parseInt(o.toString(),10)]],a=i.nameTable[e[parseInt(r.toString(),10)]];t&&(s=i.nameTable[s.sourceID],a=i.nameTable[a.sourceID],"LeftToRight"===i.layout.orientation||"RightToLeft"===i.layout.orientation?s.offsetY>a.offsetY&&(n=e[parseInt(o.toString(),10)],e[parseInt(o.toString(),10)]=e[parseInt(r.toString(),10)],e[parseInt(r.toString(),10)]=n):s.offsetX>a.offsetX&&(n=e[parseInt(o.toString(),10)],e[parseInt(o.toString(),10)]=e[parseInt(r.toString(),10)],e[parseInt(r.toString(),10)]=n))}return e},_Di.prototype.resetConnectorSegments=function(e){for(var t=e.segments,i=t.length;0<i;i--)t.splice(i-1,1)},_Di.prototype.resetRoutingSegments=function(e,t,i){if(e.levelSkip){for(var n=void 0,o=void 0,r=t.layout.ranks.reverse(),s=0;s<r.length;s++)for(var a=0;a<r[parseInt(s.toString(),10)].length;a++)e.sourceID===r[parseInt(s.toString(),10)][parseInt(a.toString(),10)].id&&(n=s),e.targetID===r[parseInt(s.toString(),10)][parseInt(a.toString(),10)].id&&(o=s);var l=[];if(n<o)for(s=0;s<r.length;s++)n<s&&s<o&&l.push(r[parseInt(s.toString(),10)]);else for(s=0;s<r.length;s++)s<n&&o<s&&l.push(r[parseInt(s.toString(),10)]);for(var h=[],s=0;s<l.length;s++)for(var d,a=0;a<l[parseInt(s.toString(),10)].length;a++)void 0===l[parseInt(s.toString(),10)][parseInt(a.toString(),10)].edges&&(d=t.nameTable[l[parseInt(s.toString(),10)][parseInt(a.toString(),10)].id],h.push(d));t.routingConnectors||(t.routingConnectors=[]);e:for(var p=0;p<h.length;p++)for(var c=h[parseInt(p.toString(),10)].wrapper.bounds,s=0;s<e.segments.length;s++)for(var u=e.segments[parseInt(s.toString(),10)].points,a=0;a<u.length;a++){var g=u[parseInt(a.toString(),10)],m=u[a+1];if(m){g=this.pointsAlongLine(g,m);if(this.pointInsideBounds(g,c)){t.routingConnectors.push(e);break e}}}}},_Di.prototype.pointsAlongLine=function(e,t){for(var i=t.x-e.x,t=t.y-e.y,n=Math.sqrt(i*i+t*t),o=i/n*1,r=t/n*1,s=[],a=0;a<=n;a+=1)s.push({x:e.x+o*a,y:e.y+r*a});return s},_Di.prototype.pointInsideBounds=function(e,t){for(var i=0,n=e;i<n.length;i++){var o=n[i];if(t.right>o.x&&t.left<o.x&&t.top<o.y&&t.bottom>o.y)return!0}return!1},_Di.prototype.getPointvalue=function(e,t){return{x:Number(e)||0,y:Number(t)||0}},_Di.prototype.containsValue=function(e,t){for(var i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)]===t)return!0;return!1};DQ=_Di;function _Di(){}zDi.prototype.destroy=function(){},zDi.prototype.getModuleName=function(){return"OrganizationalChart"},zDi.prototype.updateLayout=function(e,t,i,n,o,r){t={type:i.type,connectionPointOrigin:i.connectionPointOrigin,nameTable:t,anchorX:0,anchorY:0,firstLevelNodes:[],centerNode:null,levels:[],maxLevel:0,graphNodes:{},orientation:i.orientation,horizontalSpacing:i.horizontalSpacing,verticalSpacing:i.verticalSpacing,verticalAlignment:i.verticalAlignment,horizontalAlignment:i.horizontalAlignment,fixedNode:i.fixedNode,getLayoutInfo:jTi(i.getLayoutInfo),layoutInfo:i.layoutInfo,margin:i.margin,bounds:i.bounds,objects:[],root:i.root};return this.doLayout(t,e,n,o,r),t},zDi.prototype.doLayout=function(e,t,i,n,o){var r,s=[];for(e.nameTable[e.root]&&e.firstLevelNodes.push(e.nameTable[e.root]),g=0;g<t.length;g++)(r=t[parseInt(g.toString(),10)]).excludeFromLayout||((e.graphNodes[r.id]=this.setUpLayoutInfo(e,r)).tree.hasSubTree=!1,e.nameTable[e.root])||r.inEdges&&r.inEdges.length||(r.parentId||r.processId||s.push(r),r.data&&String(r.data[""+n])===e.root&&e.firstLevelNodes.push(r));for(0===e.firstLevelNodes.length&&(e.firstLevelNodes=s),g=0;g<e.firstLevelNodes.length;g++)r=e.firstLevelNodes[parseInt(g.toString(),10)],this.updateEdges(e,r,1,o,t);if(0<e.firstLevelNodes.length){e.rootNode=e.firstLevelNodes[0];for(var a=0,l=0,h=void 0,d=void 0,p=void 0,c=void 0,u=void 0,g=0;g<e.firstLevelNodes.length;g++){var u=this.updateTree(e,a,l,e.firstLevelNodes[parseInt(g.toString(),10)],0,e.firstLevelNodes[g-1]),m=e.graphNodes[e.firstLevelNodes[parseInt(g.toString(),10)].id];u.y=Math.min(u.y,m.y),u.x=Math.min(u.x,m.x),-1!==e.orientation.indexOf("Left")?l=u.right+e.horizontalSpacing:a=u.right+e.horizontalSpacing,d=0===g?(h=u.x,c=u.y,p=u.right,u.bottom):(h=Math.min(h,u.x),c=Math.min(c,u.y),p=Math.max(p,u.right),Math.max(d,u.bottom)),e.levels=[],e.maxLevel=void 0}for(this.updateAnchor(e,{x:h,y:c,right:p,bottom:d},i),g=0;g<e.firstLevelNodes.length;g++)this.updateNodes(e,e.firstLevelNodes[parseInt(g.toString(),10)],0);for(g=0;g<e.firstLevelNodes.length;g++)this.updateConnectors(e,e.firstLevelNodes[parseInt(g.toString(),10)],1)}},zDi.prototype.getBounds=function(e){var t=e.offsetX-e.actualSize.width*e.pivot.x,i=e.offsetY-e.actualSize.height*e.pivot.y;return new tfi(t,i,e.actualSize.width,e.actualSize.height)},zDi.prototype.updateTree=function(e,t,i,n,o,r,s){var a,l,h,d,p,c,u,g,m={},i=this.getDimensions(e,n,t,i,o),m=e.graphNodes[n.id],f=(e.maxLevel=Math.max(e.maxLevel,o),o),y=this.hasChild(e,n);return y||m.tree.assistants.length?(u=c=p=d=h=g=l=void 0,u=i.y+i.height+e.verticalSpacing,m.tree.assistants.length&&(f=(a=this.setDepthSpaceForAssitants(e,n,u,i.height,o,e.verticalSpacing)).level,u=a.bottom),m.tree.assistants.length||"Horizontal"===m.tree.orientation||(u=i.y+i.height+e.verticalSpacing/2),m.tree.children.length&&(l="Horizontal"!==m.tree.orientation||"Balanced"===m.tree.type&&1!==m.tree.children.length?"Balanced"===m.tree.type?this.updateHorizontalTreeWithMultipleRows(e,n,r,i.x,u,f):this.updateVerticalTree(e,n,i.x,u,f,s):this.updateHorizontalTree(e,n,r,i.x,u,f)),m.y&&m.y>i.y||(m.y=i.y),void 0!==m.mid&&(t=m.mid),m.tree.assistants.length&&(c=void 0!==t?t:i.x,p=this.setBreadthSpaceForAssistants(e,n,i,c,u,o),y||(t=((h=l=p).x+h.right)/2-i.width/2,l=h),d=p?p.canMoveBy:void 0),m.x=t,m.translate||(m.treeWidth=l.right-l.x),g={x:t,y:i.y,right:t+i.width,bottom:i.y+i.height},this.translateSubTree({layout:e,shape:n,shapeBounds:g,treeBounds:l,dim:i,level:o},d,void 0!==r,s),m.firstChild&&"string"!=typeof m.firstChild&&(m.firstChild.x+=m.subTreeTranslation),n.treeBounds=l):(n.treeBounds=this.updateLeafNode(e,n,r,i,o,s),n.treeBounds)},zDi.prototype.updateLeafNode=function(e,t,i,n,o,r){var s=e.graphNodes[t.id],a=(s.x=n.x,s.y&&s.y>n.y||(s.y=n.y,s.maxLevel=Math.max(o,s.maxLevel||0)),{x:n.x,y:n.y,right:n.x+n.width,bottom:n.y+n.height});return s.maxLevel=Math.max(s.maxLevel||0,o),this.translateSubTree({layout:e,shape:t,shapeBounds:a,treeBounds:a,dim:n,level:o},void 0,void 0!==i,r),{x:s.x,y:s.y,right:s.x+n.width,bottom:s.y+n.height}},zDi.prototype.setUpLayoutInfo=function(e,t){var i={subTreeTranslation:0};return"OrganizationalChart"===e.type?i.tree={orientation:"Vertical",type:"Alternate",offset:20,enableRouting:!0}:i.tree={orientation:"Horizontal",type:"Center",enableRouting:!0},i.tree.children=[],i.tree.assistants=[],i.tree.level=0,i.translate=!0,i},zDi.prototype.translateSubTree=function(e,t,i,n){var o=e.layout,r=e.shape,s=e.shapeBounds,a=e.treeBounds,l=e.level,e=e.dim,h=o.graphNodes[r.id],d=o.nameTable[h.firstChild?h.firstChild.child:h.tree.children[0]],p=d?o.graphNodes[d.id]:null,c=this.hasChild(o,r),u=this.findIntersectingLevels(o,s,l,h.actualLevel),g=this.findIntersectingLevels(o,a,l,h.actualLevel),m=[];u.length&&h.translate?(h.intersect=u,this.spaceLeftFromPrevSubTree(o,r,s),h.canMoveBy=h.diff,void 0!==t&&(h.canMoveBy=Math.min(t,h.canMoveBy)),d&&void 0!==p.canMoveBy&&(p.canMoveBy>=h.canMoveBy&&(h.translated=!0),h.canMoveBy=Math.min(h.canMoveBy,p.canMoveBy)),i&&(h.x-=h.canMoveBy,h.subTreeTranslation-=h.canMoveBy,c&&(this.shiftSubordinates(o,g,h.canMoveBy),a.x=Math.min(a.x,h.x),a.right=Math.max(a.right,h.x+e.width),a.bottom=Math.max(a.bottom,h.y+e.height),a.x-=h.canMoveBy,a.right-=h.canMoveBy),d&&p.canMoveBy>h.canMoveBy?h.canMoveBy=p.canMoveBy-h.canMoveBy:d&&void 0!==h.canMoveBy&&(h.canMoveBy=0))):(c&&(a.x=Math.min(a.x,s.x),a.right=Math.max(a.right,s.x+e.width),a.bottom=Math.max(a.bottom,h.y+e.height)),h.translate||(h.canMoveBy=0,h.subTreeTranslation=0)),n||(s={x:h.x,y:e.y,right:h.x+e.width,bottom:e.y+e.height},m.push({rBounds:s}),this.updateRearBounds(o,r,m,l))},zDi.prototype.updateRearBounds=function(e,t,i,n,o){var r,s,a,l,h=!0,t=(t&&(o=(t=e.graphNodes[t.id]).intersect,h=!t.tree.children.length&&!t.tree.assistants.length),i[0].rBounds),d=i[i.length-1].rBounds;if(o&&o.length){for(l=(r=e.levels[o[0]].rBounds).bottom,r.y<t.y&&(r.bottom=t.y,i.splice(0,0,{rBounds:r})),l>d.bottom?i.push({rBounds:{x:r.x,right:r.right,y:t.bottom,bottom:l}}):(r=e.levels[o[o.length-1]].rBounds,h&&r.bottom>d.bottom&&(r.y=d.bottom,i.push({rBounds:r}))),s=o[0],a=i.length-1;0<=a;a--)e.levels.splice(s,0,i[parseInt(a.toString(),10)]);s+=i.length,e.levels.splice(s,o.length)}else for(s=this.findLevel(e,i[i.length-1].rBounds,n),a=i.length-1;0<=a;a--)e.levels.splice(s,0,i[parseInt(a.toString(),10)])},zDi.prototype.shiftSubordinates=function(e,t,i){var n;if(0!==i)for(n=0;n<t.length;n++)e.levels[t[parseInt(n.toString(),10)]].rBounds&&(e.levels[t[parseInt(n.toString(),10)]].rBounds.x-=i,e.levels[t[parseInt(n.toString(),10)]].rBounds.right-=i)},zDi.prototype.setDepthSpaceForAssitants=function(e,t,i,n,o,r){for(var s,a,l=e.graphNodes[t.id],h={},d=0;d<l.tree.assistants.length;d++)(h=e.graphNodes[l.tree.assistants[parseInt(d.toString(),10)]])&&(h.tree.children=h.tree.assistants=[],h.y=i,s=(a=e.nameTable[l.tree.assistants[parseInt(d.toString(),10)]]).actualSize.height,a=i+(s=-1!==e.orientation.indexOf("Left")?a.actualSize.width:s)+r/2,e.maxLevel=o+1,d%2==1)&&d!==l.tree.assistants.length-1&&(i=a,o++);return{level:e.maxLevel,bottom:i+s+r}},zDi.prototype.setBreadthSpaceForAssistants=function(e,t,i,n,o,r){for(var s,a,l,h,d=e.graphNodes[t.id],p=r,c={x:0,y:0,right:0,bottom:0},u=0;u<d.tree.assistants.length;u++)(s=e.graphNodes[d.tree.assistants[parseInt(u.toString(),10)]])&&(a=(h=e.nameTable[d.tree.assistants[parseInt(u.toString(),10)]]).actualSize.width,-1!==e.orientation.indexOf("Left")&&(a=h.actualSize.height),h=u%2==0?n+i.width/2-20-a:n+i.width/2+20,a=this.updateTree(e,h,s.y,e.nameTable[d.tree.assistants[parseInt(u.toString(),10)]],p+1),this.hasChild(e,t)||(0===u?c=a:this.uniteRects(c,a)),u%2==0&&s.prevBounds&&(l=void 0===l?s.canMoveBy:Math.min(l,s.canMoveBy)),u%2!=1&&u!==d.tree.assistants.length-1||(h=this.findIntersectingLevels(e,a,p+1),this.updateRearBounds(e,null,[{rBounds:a}],p+1,h),p++));return c&&(c.canMoveBy=l),c},zDi.prototype.getDimensions=function(e,t,i,n,o){var r=t.actualSize.width,s=t.actualSize.height;return e.orientation=e.orientation||"TopToBottom",-1!==e.orientation.indexOf("Left")&&(o||(e=i,i=n,n=e),s=t.actualSize.width,r=t.actualSize.height),{x:i,y:n,width:r,height:s}},zDi.prototype.hasChild=function(e,t){e=e.graphNodes[t.id];return e?e.tree.children&&e.tree.children.length:0},zDi.prototype.updateHorizontalTree=function(e,t,i,n,o,r){var s,a,l,h,d,p,c=this.getDimensions(e,t,n,o,r),u={},g=(u=e.graphNodes[t.id]).tree.type,m=r,f=0,f=n,y=o;e.levels.slice(0,e.levels.length);if(this.hasChild(e,t)){for(var v=-1!==e.orientation.indexOf("Left"),b=0;b<u.tree.children.length;b++){var w,C=(w=e.nameTable[u.tree.children[parseInt(b.toString(),10)]]).actualSize.width,S=w.actualSize.height,A=v?S:C,C=v?C:S,S=(e.levels[m+1]&&e.levels[m+1].rBounds,this.updateTree(e,f,y,w,m+1,e.nameTable[u.tree.children[b-1]])),x=e.graphNodes[w.id];u.maxLevel=Math.max(u.maxLevel||0,x.maxLevel||0),a={x:x.x,y:x.y,right:x.x+A,bottom:x.y+C},0===b&&(s={x:Math.min(x.x,S.x),y:Math.min(x.y,S.y),right:S.right,bottom:S.bottom},p=x),d?(d.x=a.x,d.y=a.y,a.right>d.right&&(d.right=a.right),d.bottom=a.bottom):d=a,0===b&&(u.firstChild={x:x.x,canMoveBy:x.canMoveBy,child:w.id}),this.hasChild(e,w)&&(!u.firstChild||u.firstChild.x>=x.firstChild.x?(x.firstChild&&u.firstChild.canMoveBy<x.canMoveBy&&(h=u.firstChild.canMoveBy,x.canMoveBy=h,e.graphNodes[u.firstChild.child].canMoveBy=h,u.firstChild.canMoveBy=h),A=void 0!==h?h:x.canMoveBy,u.firstChild={x:x.firstChild.x,canMoveBy:A,child:w.id}):x.firstChild&&x.translated&&u.firstChild.canMoveBy>x.canMoveBy&&(u.firstChild.canMoveBy=e.graphNodes[u.firstChild.child].canMoveBy=x.canMoveBy)),l=l?Math.max(x.maxLevel,l):x.maxLevel,this.uniteRects(s,S),f=0!==b&&!this.hasChild(e,w)&&x.subTreeTranslation<0?S.right-x.subTreeTranslation+e.horizontalSpacing:S.right+e.horizontalSpacing}isNaN(void 0)||(p.canMoveBy=void 0),u.mid=(p.x+d.right)/2-c.width/2,"Left"===g?u.mid=a.right-c.width:"Right"===g&&(u.mid=n)}return s},zDi.prototype.updateHorizontalTreeWithMultipleRows=function(e,t,i,n,o,r){var s,a,l,h,d,p,c,u=this.getDimensions(e,t,n,o,r),g=e.graphNodes[t.id],m=(g.tree.type,r),f=n,y=o,v=(e.levels.slice(0,e.levels.length),0);if(this.hasChild(e,t))for(var b=-1!==e.orientation.indexOf("Left"),w=void 0,C=this.splitChildrenInRows(e,t),S=5===g.tree.children.length&&3===C[0].length,A=[],x=[],I=(S?x=C:this.splitRows(C,A,x),{leftTree:A,rows:C,rightTree:x,dimensions:u}),r=this.updateLeftTree(e,I,t,n,y,m),T=I.bounds,E=void 0,D=(r||0)+(void 0!==r?e.horizontalSpacing/2:0),M=(void 0!==r&&(g.mid=D-u.width/2,E=r+e.horizontalSpacing),y=o,void 0),M=[],k=0;k<x.length;k++)for(f=!(C[k].length%2==1&&k===x.length-1||S)&&E||n,0!==k&&(y=M[k-1].bottom+e.verticalSpacing),d=0;d<x[k].length;d++)l=(s=e.nameTable[x[k][d]]).actualSize.width,h=s.actualSize.height,h=b?h:l,(l=e.graphNodes[s.id]).actualLevel=m+1+k,0===d&&A[k]&&A[k].length&&(l.translate=!1),S&&1===k&&(0===d&&p+h+e.horizontalSpacing<=c&&(w=!0,f=p-h/2),w)&&1===d&&(f=c-h/2),a=this.updateTree(e,f,y,s,m+1,e.nameTable[x[k][d-1]]),S&&d<=2&&0===k&&1===d&&(p=a.x-e.horizontalSpacing/2,c=a.x+h+e.horizontalSpacing/2),0===d?M[k]={x:a.x,y:a.y,right:a.right,bottom:a.bottom}:this.uniteRects(M[k],a),T=T||{x:M[k].x,y:M[k].y,right:M[k].right,bottom:M[k].bottom},this.uniteRects(T,M[k]),f=a.right+e.horizontalSpacing,(!g.firstChild||(k===x.length-1&&C[k].length%2==1||S)&&0===d&&void 0!==l.canMoveBy&&v>l.canMoveBy)&&(v=Math.min(v,l.canMoveBy||0),g.firstChild={x:l.x,child:s.id,canMoveBy:l.canMoveBy}),I.leftCenter=p,I.rightCenter=c,I.align=w,I.level=m,I.rightBounds=M,this.alignRowsToCenter(e,k,t,I,E);return T},zDi.prototype.updateLeftTree=function(e,t,i,n,o,r){for(var s,a,l,h,d,p=t.leftTree,c=e.graphNodes[i.id],u=[],g=-1!==e.orientation.indexOf("Left"),m=0;m<p.length&&p[parseInt(m.toString(),10)].length;m++){s=n,u[m-1]&&(o=u[m-1].bottom+e.verticalSpacing);for(var f=0;f<p[parseInt(m.toString(),10)].length;f++){var y=e.nameTable[p[parseInt(m.toString(),10)][parseInt(f.toString(),10)]],v=(g?y.actualSize.height:y.actualSize.width,g?y.actualSize.width:y.actualSize.height,e.graphNodes[y.id]);v.actualLevel=r+1+m,h=this.updateTree(e,s,o,y,r+1,e.nameTable[p[parseInt(m.toString(),10)][f-1]]),0===f?u[parseInt(m.toString(),10)]={x:h.x,y:h.y,right:h.right,bottom:h.bottom}:this.uniteRects(u[parseInt(m.toString(),10)],h),0===m&&0===f?(a=v.canMoveBy,c.firstChild={x:v.x,child:y.id,canMoveBy:v.canMoveBy}):0===f&&void 0!==v.canMoveBy&&a>v.canMoveBy&&(a=Math.min(a,v.canMoveBy||0),c.firstChild={x:v.x,child:y.id,canMoveBy:v.canMoveBy}),s=h.right+e.horizontalSpacing}l=0===m?u[parseInt(m.toString(),10)].right:Math.max(l,u[parseInt(m.toString(),10)].right)}for(m=0;m<p.length&&p[parseInt(m.toString(),10)].length;m++){if(l!==u[parseInt(m.toString(),10)].right)for(var b=l-u[parseInt(m.toString(),10)].right,f=0;f<p[parseInt(m.toString(),10)].length;f++){e.nameTable[p[parseInt(m.toString(),10)][parseInt(f.toString(),10)]];e.graphNodes[p[parseInt(m.toString(),10)][parseInt(f.toString(),10)]].x+=b}0===m?d={x:u[0].x,y:u[0].y,right:u[0].right,bottom:u[0].bottom}:this.uniteRects(d,u[parseInt(m.toString(),10)])}return t.bounds=d,l},zDi.prototype.alignRowsToCenter=function(e,t,i,n,o){var r,s,a,l,i=e.graphNodes[i.id],h=n.rows,d=n.rightTree,p=n.leftCenter,c=n.rightCenter,u=n.align,g=n.rightBounds,m=n.dimensions,n=n.level,f=5===i.tree.children.length&&3===h[0].length;f&&1===t&&(r=g[0].right-g[0].x>=g[1].right-g[1].x?0:1),t===h.length-1&&(h[parseInt(t.toString(),10)].length%2==1||f&&1===t)&&(h=d[parseInt(t.toString(),10)][Math.floor(d[parseInt(t.toString(),10)].length/2)],a=e.nameTable[""+h],s=e.graphNodes[""+h].x,l=e.graphNodes[""+h].y,a=this.getDimensions(e,a,s,l,n+1),l=void 0,!u&&f?(1===r&&(t=0),l=(g[parseInt(r.toString(),10)].x+g[parseInt(r.toString(),10)].right)/2-(g[parseInt(t.toString(),10)].x+g[parseInt(t.toString(),10)].right)/2,0===t&&(i.mid+=l)):f||void 0===o||(l=o-e.horizontalSpacing/2-(s+a.width/2)),void 0!==l&&this.updateRearBoundsOfTree(e,d[parseInt(t.toString(),10)],l,m),f&&(i.mid=(c+p)/2+(0===t?l:0)-m.width/2),void 0===i.mid&&e.graphNodes[""+h]&&(i.mid=s),t++)},zDi.prototype.updateRearBoundsOfTree=function(e,t,i,n){for(var o=0;o<t.length;o++){var r,s,a=e.graphNodes[t[parseInt(o.toString(),10)]];a.x+=i,a.canMoveBy+=i,o===t.length-1&&(r={x:a.x,y:a.y,right:a.x+n.width,bottom:a.y+n.height},s=this.findIntersectingLevels(e,r,a.actualLevel),this.updateRearBounds(e,null,[{rBounds:r}],a.actualLevel,s))}},zDi.prototype.splitRows=function(e,t,i){for(var n=0;n<e.length;n++){t[parseInt(n.toString(),10)]=[],i[parseInt(n.toString(),10)]=[];if(e[parseInt(n.toString(),10)].length,e[parseInt(n.toString(),10)].length%2!=1)for(var o=Math.ceil(e[parseInt(n.toString(),10)].length/2),r=0;r<o;r++)t[parseInt(n.toString(),10)].push(e[parseInt(n.toString(),10)][parseInt(r.toString(),10)]);for(var s=t[parseInt(n.toString(),10)].length;s<e[parseInt(n.toString(),10)].length;s++)i[parseInt(n.toString(),10)].push(e[parseInt(n.toString(),10)][parseInt(s.toString(),10)])}},zDi.prototype.updateVerticalTree=function(e,t,i,n,o,r){for(var s,a,l,h,d,p,c,u,g,m,f,y,v=e.graphNodes[t.id],b=e.nameTable[v.tree.children[0]],w=-1!==e.orientation.indexOf("Left"),C="Left"===v.tree.type?-1:0,S=n,n=o,A=[],x=[],I=0;I<v.tree.children.length;I++)"Alternate"===v.tree.type&&(m=I%2==0&&2<v.tree.children.length?"Left":"Right",C=I%2==0&&2<v.tree.children.length?-1:0),y=i+this.findOffset(e,t,v,m),s=e.nameTable[v.tree.children[parseInt(I.toString(),10)]],l=w?s.actualSize.height:s.actualSize.width,h=w?s.actualSize.width:s.actualSize.height,y=this.updateTree(e,y+C*l,S,s,o+1,void 0,!0),c={x:(a=e.graphNodes[s.id]).x,y:a.y,right:a.x+l,bottom:a.y+h},0===I?(this.uniteRects(y,c),p=y):this.uniteRects(p,y),!a.prevBounds||"Alternate"===v.tree.type&&I%2==1&&2<v.tree.children.length||(f=void 0!==f?Math.min(a.canMoveBy,f):a.canMoveBy),v.maxLevel=Math.max(v.maxLevel||0,a.maxLevel||0),"Alternate"===v.tree.type&&2<v.tree.children.length&&I%2==0?(0!==I&&(S=d.bottom+e.verticalSpacing/2),x.push({rBounds:c}),a.levelBounds&&(x=x.concat(a.levelBounds))):(S="Alternate"===v.tree.type&&2<v.tree.children.length?Math.max(y.bottom,d.bottom)+e.verticalSpacing/2:y.bottom+e.verticalSpacing/2,o=v.maxLevel,A.push({rBounds:c}),u?this.uniteRects(u,c):u={x:a.x,y:a.y,right:a.x+l,bottom:a.y+h},a.levelBounds&&(A=A.concat(a.levelBounds))),0===I&&(v.firstChild={x:a.x,canMoveBy:a.canMoveBy,child:s.id}),this.hasChild(e,s)&&(!v.firstChild||v.firstChild.x>=a.firstChild.x?(a.firstChild&&v.firstChild.canMoveBy<a.canMoveBy&&(y=v.firstChild.canMoveBy,a.canMoveBy=y,e.graphNodes[v.firstChild.child].canMoveBy=y,v.firstChild.canMoveBy=y),v.firstChild={x:a.firstChild.x,canMoveBy:void 0!==f?f:a.canMoveBy,child:s.id}):a.firstChild&&a.translated&&v.firstChild.canMoveBy>a.canMoveBy&&(v.firstChild.canMoveBy=e.graphNodes[v.firstChild.child].canMoveBy=a.canMoveBy)),d=c;return r?v.levelBounds=A:("Alternate"===v.tree.type&&2<v.tree.children.length&&(r={x:x[0].rBounds.x,y:x[0].rBounds.y,right:x[x.length-1].rBounds.right,bottom:x[x.length-1].rBounds.bottom},g=this.findIntersectingLevels(e,r,n+1),this.updateRearBounds(e,null,x,n+1,g)),g=this.findIntersectingLevels(e,u||p,n+1),this.updateRearBounds(e,null,u?A:[{rBounds:p}],n+1,g)),isNaN(f)||(e.graphNodes[b.id].canMoveBy=f),v.childBounds=p,v.mid=i,p},zDi.prototype.splitChildrenInRows=function(e,t){var i,e=e.graphNodes[t.id],n=(i=4,[]),o=e.tree.children.length,r=this.extend(e.tree.children);for(e.tree.rows?(e.tree.children.length,i=(t=e.tree.rows)%2==0?t:t-1):3===e.tree.children.length||4===e.tree.children.length?i=2:5===e.tree.children.length&&(i=3);0<o;)n[n.length]=r.splice(0,i),(o-=i)<i&&(o%2==0?i=o:1!==o&&(i=o-1),o<i)&&(i=o);return n},zDi.prototype.extend=function(e){for(var t=[],i=0;i<e.length;i++)t[parseInt(i.toString(),10)]=e[parseInt(i.toString(),10)];return t},zDi.prototype.findOffset=function(e,t,i,n){var o=0,r=-1!==e.orientation.indexOf("Left")?t.actualSize.height:t.actualSize.width,t=n||i.tree.type,o=i.tree.offset||20;switch("Alternate"===i.tree.type&&o>=e.horizontalSpacing&&(o=e.horizontalSpacing/2),t){case"Left":o=r/2-o;break;case"Right":o+=r/2}return o},zDi.prototype.uniteRects=function(e,t){e.x=Math.min(e.x,t.x),e.right=Math.max(e.right,t.right),e.bottom=Math.max(e.bottom,t.bottom)},zDi.prototype.spaceLeftFromPrevSubTree=function(e,t,i){for(var n,o=e.graphNodes[t.id],r=e.horizontalSpacing,s=0;s<o.intersect.length;s++)n=e.levels[o.intersect[parseInt(s.toString(),10)]].rBounds,n=i.x-(n.right+r),(void 0===o.diff||n<o.diff)&&(o.diff=n,o.prevBounds=e.levels[o.intersect[parseInt(s.toString(),10)]].rBounds)},zDi.prototype.findIntersectingLevels=function(e,t,i,n){var o={x:t.x,y:t.y,right:t.right,bottom:t.bottom},r=(o.y-=e.verticalSpacing/2,o.bottom+=e.verticalSpacing/2,[]),s=void 0!==n?n:i,a=e.levels[parseInt(s.toString(),10)]?e.levels[parseInt(s.toString(),10)].rBounds:null;do{if(a&&(o.y<a.y&&o.bottom>a.y||o.y<a.bottom&&a.bottom<o.bottom||o.y>=a.y&&o.bottom<=a.bottom||o.y<a.y&&o.bottom>a.bottom))r.splice(0,0,s);else if(a&&a.bottom<o.y)break}while(s--,a=e.levels[parseInt(s.toString(),10)]?e.levels[parseInt(s.toString(),10)].rBounds:null,0<=s);s=(void 0!==n?n:i)+1,a=e.levels[parseInt(s.toString(),10)]?e.levels[parseInt(s.toString(),10)].rBounds:null;do{if(a&&(o.y<a.y&&o.bottom>a.y||o.y<a.bottom&&a.bottom<o.bottom||o.y>=a.y&&o.bottom<=a.bottom||o.y<a.y&&o.bottom>a.bottom))r.push(s);else if(a&&a.y>o.bottom)break}while(s++,a=e.levels[parseInt(s.toString(),10)]?e.levels[parseInt(s.toString(),10)].rBounds:null,s<=e.levels.length);return r},zDi.prototype.findLevel=function(e,t,i){for(var n=t,o=0,r=e.levels[parseInt(o.toString(),10)]?e.levels[parseInt(o.toString(),10)].rBounds:null;o<e.levels.length;){if(r&&n.bottom<r.y)return o;o++,r=e.levels[parseInt(o.toString(),10)]?e.levels[parseInt(o.toString(),10)].rBounds:null}return o},zDi.prototype.getParentNode=function(e,t){return e.nameTable[e.nameTable[t.inEdges[0]].sourceID]},zDi.prototype.updateEdges=function(e,t,i,n,o){var r,s=e.graphNodes[t.id];if(t.outEdges&&t.outEdges.length&&(t.isExpanded||n===ryi.Render))for(r=0;r<t.outEdges.length;r++){var a=e.nameTable[e.nameTable[t.outEdges[parseInt(r.toString(),10)]].targetID];a&&!a.excludeFromLayout&&(-1===s.tree.children.indexOf(a.id)&&s.tree.children.push(a.id),a.outEdges&&a.outEdges.length&&a.isExpanded&&(s.tree.hasSubTree=!0),this.updateEdges(e,a,i+1,n,o))}s.tree.level=i,s.tree.hasSubTree&&(s.tree.orientation="Horizontal",s.tree.type="Center"),(e.getLayoutInfo||e.layoutInfo)&&"OrganizationalChart"===e.type&&(e.getLayoutInfo?e.getLayoutInfo(t,s.tree):wAi(s.tree,e.layoutInfo,o,t),"Balanced"===s.tree.type)&&s.tree.hasSubTree&&(s.tree.type="Center",s.tree.orientation="Horizontal"),e.level&&"Alternate"!==s.tree.type&&i>=e.level&&(s.tree.hasSubTree=!1)},zDi.prototype.updateAnchor=function(e,t,i){var n,o,r,s=0,a=0,i=new tfi(0,0,i.x,i.y),l=e.bounds||i,h=e.orientation;if(e.fixedNode){o=(i=e.nameTable[e.fixedNode]).actualSize.width,r=i.actualSize.height,e.anchorX=i.offsetX,e.anchorY=i.offsetY;var d=i.pivot;for(e.anchorX+="RightToLeft"===e.orientation?o*d.x:-o*d.x,e.anchorY+="BottomToTop"===e.orientation?r*d.y:-r*d.y,n=i,s=0;n.inEdges.length;)n=this.getParentNode(e,n),s+=e.graphNodes[n.id].subTreeTranslation||0;-1!==e.orientation.indexOf("Left")?(a=e.graphNodes[i.id].y,"LeftToRight"===h?e.anchorX-=a:e.anchorX+=a,e.anchorY-=e.graphNodes[i.id].x+s):(a=e.graphNodes[i.id].y,e.anchorX-=e.graphNodes[i.id].x+s,"TopToBottom"===h?e.anchorY-=a:e.anchorY+=a)}else if("TopToBottom"===h||"BottomToTop"===h){switch(e.horizontalAlignment){case"Left":e.anchorX=l.x-t.x+e.margin.left;break;case"Right":e.anchorX=l.x+l.width-e.margin.right-t.right;break;case"Auto":case"Center":e.anchorX=l.x+l.width/2-(t.x+t.right)/2}switch(e.verticalAlignment){case"Auto":case"Top":var p=l.y+e.margin.top;e.anchorY="TopToBottom"===h?p:t.bottom+p;break;case"Bottom":p=l.y+l.height-e.margin.bottom;e.anchorY="TopToBottom"===h?p-t.bottom:p;break;case"Center":var c=void 0;c=l.y+l.height/2,e.anchorY="TopToBottom"===e.orientation?c-(t.y+t.bottom)/2:c+(t.y+t.bottom)/2}}else{switch(e.horizontalAlignment){case"Auto":case"Left":var u=l.x+e.margin.left;e.anchorX="LeftToRight"===h?u:t.bottom+u;break;case"Right":u=l.x+l.width-e.margin.right;e.anchorX="LeftToRight"===h?u-t.bottom:u;break;case"Center":c=void 0;c=l.width/2+l.x,e.anchorX="LeftToRight"===e.orientation?c-(t.y+t.bottom)/2:c+(t.y+t.bottom)/2}switch(e.verticalAlignment){case"Top":e.anchorY=l.y+e.margin.top-t.x;break;case"Auto":case"Center":e.anchorY=l.y+l.height/2-(t.right+t.x)/2;break;case"Bottom":e.anchorY=l.y+l.height-e.margin.bottom-t.right}}},zDi.prototype.updateConnectors=function(e,t,i){var n,o,r,s=e.graphNodes[t.id];if(t.outEdges.length)for(n=0;n<t.outEdges.length;n++)(r=e.nameTable[t.outEdges[parseInt(n.toString(),10)]]).points=[],o=e.nameTable[r.targetID],r.visible&&(r.visited=!0,e.getConnectorSegments?e.getConnectorSegments(r):s&&-1!==s.tree.children.indexOf(r.targetID)&&(r.segments=[],"Bezier"===r.type&&"SamePoint"===e.connectionPointOrigin&&r.segments.push(new nSi(r,"segments",{type:"Bezier"},!0)),"OrganizationalChart"===e.type)&&"Orthogonal"===r.type&&this.updateSegments(e,r,t,o,n),o)&&(o.isExpanded||this.hasChild(e,o))&&this.updateConnectors(e,o,i+1);if(s&&s.tree.assistants.length)for(n=0;n<s.tree.assistants.length;n++)o=e.nameTable[s.tree.assistants[parseInt(n.toString(),10)]],r=e.nameTable[o.inEdges[0]],this.get3Points(e,t,o,r),(o.isExpanded||this.hasChild(e,o))&&this.updateConnectors(e,o,i+1)},zDi.prototype.updateSegments=function(e,t,i,n,o){var r=e.graphNodes[i.id];r.tree.assistants.length?this.updateSegmentsForHorizontalOrientation(e,i,n,t):"Horizontal"===r.tree.orientation&&"Balanced"===r.tree.type?this.updateSegmentsForBalancedTree(e,t,i,n,o):"Horizontal"===r.tree.orientation?this.updateSegmentsForHorizontalOrientation(e,i,n,t):r.tree.offset<5?this.get5Points(e,i,n,t):this.get3Points(e,i,n,t)},zDi.prototype.updateSegmentsForBalancedTree=function(e,t,i,n,o){var r,s,a=e.graphNodes[i.id];5===a.tree.children.length&&2<o?(r=a.tree.children[1],isNaN(e.graphNodes[""+r].treeWidth)&&(e.graphNodes[""+r].treeWidth=e.nameTable[""+r].actualSize.width),s=3!==o?1:-1,-1!==e.orientation.indexOf("Left")?(e.nameTable[""+r].offsetY,e.graphNodes[""+r].treeWidth,e.verticalSpacing):(e.nameTable[""+r].offsetX,e.graphNodes[""+r].treeWidth,e.horizontalSpacing),this.getSegmentsForMultipleRows(e,i,n,t)):5<a.tree.children.length?o<4||o<a.tree.rows?this.getSegmentsForMultipleRows(e,i,n,t):this.updateSegmentsForHorizontalOrientation(e,i,n,t):4!==a.tree.children.length||o<2||o<a.tree.rows?this.getSegmentsForMultipleRows(e,i,n,t):this.updateSegmentsForHorizontalOrientation(e,i,n,t)},zDi.prototype.get3Points=function(e,t,i,n){var o,r,s=[],a=this.getBounds(t),l=this.getBounds(i);-1!==e.orientation.indexOf("Top")?(o=0===e.orientation.indexOf("Top")?a.bottomCenter:a.topCenter,r=t.offsetX>i.offsetX?l.middleRight:l.middleLeft,s.push(o,{x:a.bottomCenter.x,y:r.y},r)):(o=0===e.orientation.indexOf("Left")?a.middleRight:a.middleLeft,r=t.offsetY>i.offsetY?l.bottomCenter:l.topCenter,s.push(o,{x:l.bottomCenter.x,y:a.middleRight.y},r)),this.getSegmentsFromPoints(s,n)},zDi.prototype.get5Points=function(e,t,i,n){var o,r,s,a,l=[],h=this.getBounds(t),d=this.getBounds(i);-1!==e.orientation.indexOf("Top")?(o=t.offsetY<i.offsetY?h.bottomCenter:h.topCenter,a=e.verticalSpacing/4*(t.offsetY<i.offsetY?1:-1),s=e.horizontalSpacing/2*(t.offsetX>i.offsetX?1:-1),r=t.offsetX>i.offsetX?d.middleRight:d.middleLeft,l.push(o,{x:o.x,y:o.y+a},{x:r.x+s,y:o.y+a},{x:r.x+s,y:r.y},r)):(o=t.offsetX>i.offsetX?h.middleLeft:h.middleRight,r=t.offsetY>i.offsetY?d.bottomCenter:d.topCenter,s=e.horizontalSpacing/4*(t.offsetX<i.offsetX?1:-1),a=e.verticalSpacing/2*(t.offsetY>i.offsetY?1:-1),l.push(o,{x:o.x+s,y:o.y},{x:o.x+s,y:o.y+a},{x:r.x,y:o.y+a},r)),this.getSegmentsFromPoints(l,n)},zDi.prototype.getSegmentsFromPoints=function(e,t){for(var i,n=[],o=0;o<e.length-2;o++)(i=new sSi(t,"segments",{type:"Orthogonal"},!0)).direction=Hmi.direction(e[parseInt(o.toString(),10)],e[o+1]),i.length=Hmi.distancePoints(e[parseInt(o.toString(),10)],e[o+1]),n.push(i);t.segments=n},zDi.prototype.getSegmentsForMultipleRows=function(e,t,i,n){var o=[],r=this.getBounds(i),s=this.getBounds(t);switch(e.orientation){case"TopToBottom":h={x:s.bottomCenter.x,y:s.bottomCenter.y+e.verticalSpacing/4},(l=new sSi(n,"segments",{type:"Orthogonal"},!0)).direction=Hmi.direction(s.bottomCenter,h),l.length=Hmi.distancePoints(s.bottomCenter,h),o.push(l);break;case"BottomToTop":h={x:s.bottomCenter.x,y:s.topCenter.y-e.verticalSpacing/4},(l=new sSi(n,"segments",{type:"Orthogonal"},!0)).direction=Hmi.direction(s.topCenter,h),l.length=Hmi.distancePoints(s.topCenter,h),o.push(l);break;case"LeftToRight":var a,l,h={x:s.middleRight.x+e.verticalSpacing/4,y:s.middleRight.y};(l=new sSi(n,"segments",{type:"Orthogonal"},!0)).direction=Hmi.direction(s.middleRight,h),l.length=Hmi.distancePoints(s.middleRight,h),o.push(l),r.center.y!==s.center.y&&(a={x:s.middleRight.x+e.verticalSpacing/4,y:r.middleLeft.y},(l=new sSi(n,"segments",{type:"Orthogonal"},!0)).direction=Hmi.direction(h,a),l.length=Hmi.distancePoints(h,a),o.push(l));break;case"RightToLeft":h={x:s.middleLeft.x-e.verticalSpacing/4,y:s.middleRight.y},(l=new sSi(n,"segments",{type:"Orthogonal"},!0)).direction=Hmi.direction(s.middleLeft,h),l.length=Hmi.distancePoints(s.middleLeft,h),o.push(l),r.center.y!==s.center.y&&(a={x:s.middleLeft.x-e.verticalSpacing/4,y:r.middleLeft.y},(l=new sSi(n,"segments",{type:"Orthogonal"},!0)).direction=Hmi.direction(a,a),l.length=Hmi.distancePoints(a,a),o.push(l))}n.segments=o},zDi.prototype.updateSegmentsForHorizontalOrientation=function(e,t,i,n){var o=[],r=this.getBounds(t),s=this.getBounds(i);switch(e.orientation){case"TopToBottom":h={x:r.bottomCenter.x,y:s.topCenter.y-e.verticalSpacing/2},(l=new sSi(n,"segments",{type:"Orthogonal"},!0)).direction=Hmi.direction(r.bottomCenter,h),l.length=Hmi.distancePoints(r.bottomCenter,h),o.push(l);break;case"BottomToTop":h={x:r.topCenter.x,y:s.bottomCenter.y+e.verticalSpacing/2},(l=new sSi(n,"segments",{type:"Orthogonal"},!0)).direction=Hmi.direction(r.topCenter,h),l.length=Hmi.distancePoints(r.topCenter,h),o.push(l);break;case"LeftToRight":var a,l,h={x:s.middleLeft.x-e.verticalSpacing/2,y:r.middleRight.y};(l=new sSi(n,"segments",{type:"Orthogonal"},!0)).direction=Hmi.direction(r.middleRight,h),l.length=Hmi.distancePoints(r.middleRight,h),o.push(l),s.center.y!==r.center.y&&(a={x:s.middleLeft.x-e.verticalSpacing/2,y:s.middleLeft.y},(l=new sSi(n,"segments",{type:"Orthogonal"},!0)).direction=Hmi.direction(h,a),l.length=Hmi.distancePoints(h,a),o.push(l));break;case"RightToLeft":h={x:s.middleRight.x+e.verticalSpacing/2,y:r.middleRight.y},(l=new sSi(n,"segments",{type:"Orthogonal"},!0)).direction=Hmi.direction(r.middleLeft,h),l.length=Hmi.distancePoints(r.middleLeft,h),o.push(l),s.center.y!==r.center.y&&(a={x:s.middleRight.x+e.verticalSpacing/2,y:s.middleLeft.y},(l=new sSi(n,"segments",{type:"Orthogonal"},!0)).direction=Hmi.direction(h,a),l.length=Hmi.distancePoints(h,a),o.push(l))}return n.segments=o,[]},zDi.prototype.updateNodes=function(e,t,i,n,o,r){var s,a,l,h,d;if(t&&!t.excludeFromLayout){p=t.actualSize.width,l=t.actualSize.height,h=e.anchorX,d=e.anchorY,"LeftToRight"===e.orientation?(h+=e.graphNodes[t.id].y+p/2,d+=e.graphNodes[t.id].x+i+l/2):"RightToLeft"===e.orientation?(h-=e.graphNodes[t.id].y+p/2,d+=e.graphNodes[t.id].x+i+l/2):"TopToBottom"===e.orientation?(h+=e.graphNodes[t.id].x+i+p/2,d+=e.graphNodes[t.id].y+l/2):(h+=e.graphNodes[t.id].x+i+p/2,d-=e.graphNodes[t.id].y+l/2),e.graphNodes&&(h+=o=o||0,d+=r=r||0,this.isAnimation||(t.offsetX=h,t.offsetY=d));var p={id:t.id,differenceX:h-t.offsetX,differenceY:d-t.offsetY},c=(e.objects.push(p),[]);if(this.hasChild(e,t))for(s=0;s<e.graphNodes[t.id].tree.children.length;s++)a=e.nameTable[e.graphNodes[t.id].tree.children[parseInt(s.toString(),10)]],this.updateNodes(e,a,i+(e.graphNodes[t.id].subTreeTranslation||0),n,o,r),c.push(a);if(e.graphNodes[t.id].tree.assistants.length)for(s=0;s<e.graphNodes[t.id].tree.assistants.length;s++)a=e.nameTable[e.graphNodes[t.id].tree.assistants[parseInt(s.toString(),10)]],this.updateNodes(e,a,i+(e.graphNodes[t.id].subTreeTranslation||0),null,o,r)}};var HDi=zDi;function zDi(){this.isAnimation=!1}jDi.prototype.destroy=function(){},jDi.prototype.getModuleName=function(){return"MindMapChart"},jDi.prototype.updateLayout=function(e,t,i,n,o,r){r=this.checkRoot(e,i,o,r,t);if(r)i.fixedNode=r;else for(var s=0,a=e;s<a.length;s++){var l=a[s];if(!(l.excludeFromLayout||l.inEdges&&l.inEdges.length)){i.fixedNode=l.id;break}}for(var r=t[i.fixedNode],h=this.findFirstLevelNodes(r,i,t),d=[],p=[],c=(c=jTi(i.getBranch))||jTi(this.getBranch),u=0,g=h;u<g.length;u++){var m=c(l=g[u],h);("Left"===(l&&l.branch?l.branch:m)?d:p).push(l)}r=new tfi(0,0,n.x,n.y);t[i.fixedNode].offsetX=r.x+r.width/2,t[i.fixedNode].offsetY=r.y+r.height/2,d.length&&this.updateMindMapBranch(e,p,t,i,n,o,"Left"),p.length&&this.updateMindMapBranch(e,d,t,i,n,o,"Right")},jDi.prototype.checkRoot=function(e,t,i,n,o){for(var r=0,s=e;r<s.length;r++){var a=s[r];if(!a.excludeFromLayout){if(a.data&&(a.data[""+i].toString()===n||a.data[""+i].toString()===t.root))return a.id;if(!a.data&&a.id===t.root)return a.id}}return""},jDi.prototype.updateMindMapBranch=function(e,t,i,n,o,r,s){n={type:"HierarchicalTree",horizontalSpacing:n.verticalSpacing,verticalSpacing:n.horizontalSpacing,verticalAlignment:n.verticalAlignment,horizontalAlignment:n.horizontalAlignment,fixedNode:n.fixedNode,getLayoutInfo:jTi(n.getLayoutInfo),layoutInfo:n.layoutInfo,margin:n.margin,orientation:n.orientation,root:n.fixedNode};n.orientation="Vertical"===n.orientation?"Left"===s?"TopToBottom":"BottomToTop":"Left"===s?"LeftToRight":"RightToLeft",this.excludeFromLayout(t,i,!0),(new HDi).updateLayout(e,i,n,o,r),this.excludeFromLayout(t,i,!1)},jDi.prototype.getBranch=function(e,t){t=t.indexOf(e)%2==0?"Left":"Right";return t},jDi.prototype.excludeFromLayout=function(e,t,i){for(var n=0,o=e;n<o.length;n++)t[o[n].id].excludeFromLayout=i},jDi.prototype.findFirstLevelNodes=function(e,t,i){var n=[];if(e&&e.outEdges.length)for(var o=0,r=e.outEdges;o<r.length;o++){var s=r[o];n.push(i[i[""+s].targetID])}return n};Wz=jDi;function jDi(){this.isAnimation=!1}WDi.prototype.destroy=function(){},WDi.prototype.getModuleName=function(){return"RadialTree"},WDi.prototype.updateLayout=function(e,t,i,n){i={type:i.type,nameTable:t,anchorX:0,anchorY:0,firstLevelNodes:[],centerNode:null,levels:[],maxLevel:0,graphNodes:{},layoutNodes:[],orientation:i.orientation,horizontalSpacing:i.horizontalSpacing,verticalSpacing:i.verticalSpacing,verticalAlignment:i.verticalAlignment,horizontalAlignment:i.horizontalAlignment,fixedNode:i.fixedNode,margin:i.margin,bounds:i.bounds,objects:[],root:i.root};this.doLayout(i,e,t,n)},WDi.prototype.doLayout=function(e,t,i,n){for(var o,r=0;r<t.length;r++)(o=t[parseInt(r.toString(),10)]).excludeFromLayout||(e.graphNodes[o.id]=this.setUpLayoutInfo(e,o),o.inEdges&&o.inEdges.length)||e.firstLevelNodes.push(o);e.root&&i[e.root]?e.centerNode=i[e.root]:e.firstLevelNodes.length&&(e.centerNode=e.firstLevelNodes[0],e.root=e.centerNode.id),e.centerNode&&(this.updateEdges(e,e.centerNode,0,i),this.depthFirstAllignment(e,e.centerNode,0,0),this.populateLevels(e),this.transformToCircleLayout(e),this.updateAnchor(e,n),this.updateNodes(e,e.centerNode,i))},WDi.prototype.updateEdges=function(e,t,i,n){var o=e.graphNodes[t.id];e.layoutNodes.push(o),o.level=i,o.visited=!0,e.maxLevel=Math.max(e.maxLevel,i);for(var r=0;r<t.outEdges.length;r++){var s=n[n[t.outEdges[parseInt(r.toString(),10)]].targetID];s.excludeFromLayout||s.visited||(o.children.push(s),this.updateEdges(e,s,i+1,n))}},WDi.prototype.depthFirstAllignment=function(i,e,t,n){var o,r=i.graphNodes[e.id];if(r.children.length){n+=300;for(var s=0;s<r.children.length;s++)t=(o=this.depthFirstAllignment(i,r.children[parseInt(s.toString(),10)],t,n)).x,n=o.y;r.children=r.children.sort(function(e,t){return i.graphNodes[e.id].x-i.graphNodes[t.id].x});var e=i.graphNodes[r.children[0].id].min,a=i.graphNodes[r.children[r.children.length-1].id].max;if(r.x=e+(a-e)/2,t=a+i.horizontalSpacing,r.segmentOffset=a+i.horizontalSpacing,r.x-=r.width/2,r.y-=r.height/2,r.min=e,r.max=a,r.x<e&&r.visited){r.x=e,t=r.x+r.width/2-(a-e)/2,r.visited=!1;for(s=0;s<r.children.length;s++)o=this.depthFirstAllignment(i,r.children[parseInt(s.toString(),10)],t,n);r.visited=!0,t=r.x+r.width+i.horizontalSpacing}t=t<(a=i.graphNodes[r.children[r.children.length-1].id].segmentOffset)?a:t,r.y=n-=300}else r.x=t,r.y=n,r.min=t,r.max=t+r.width,t+=r.width+i.horizontalSpacing;return{x:t,y:n}},WDi.prototype.populateLevels=function(o){for(var r=[],s=Math.min.apply(Math,o.layoutNodes.map(function(e){return e.x})),a=Math.max.apply(Math,o.layoutNodes.map(function(e){return e.x+e.width+o.horizontalSpacing}))-s,e=(o.levels=[],0);e<=o.maxLevel;e++)!function(t){var e={};r=(r=o.layoutNodes.filter(function(e){return e.level===t?e:null})).sort(function(e,t){return e.x-t.x}),e.min=r[0].x,e.max=r[r.length-1].x+r[r.length-1].width+o.horizontalSpacing,e.actualCircumference=0;for(var i=e.height=0;i<r.length;i++)r[parseInt(i.toString(),10)].height>e.height&&(e.height=r[parseInt(i.toString(),10)].height),e.actualCircumference+=Math.max(r[parseInt(i.toString(),10)].width,r[parseInt(i.toString(),10)].height),i!==r.length-1&&(e.actualCircumference+=o.horizontalSpacing);e.circumference=e.max-e.min,e.actualCircumference<e.circumference&&(e.circumference=(e.circumference+e.actualCircumference)/2),e.radius=e.circumference/(2*Math.PI)+e.height,e.nodes=[],1<t&&o.levels[t-1].radius+o.levels[t-1].height>=e.radius&&(e.radius=o.levels[t-1].radius+o.levels[t-1].height);for(var n=0;n<r.length;n++)r[parseInt(n.toString(),10)].ratio=Math.abs(r[parseInt(n.toString(),10)].x+r[parseInt(n.toString(),10)].width/2-s)/a,e.nodes.push(r[parseInt(n.toString(),10)]);o.levels.push(e)}(e)},WDi.prototype.transformToCircleLayout=function(e){var t=e.graphNodes[e.centerNode.id];t.x=0,t.y=0;for(var i=1;i<e.levels.length;i++)for(var n=0;n<e.levels[parseInt(i.toString(),10)].nodes.length;n++){var o=e.levels[parseInt(i.toString(),10)].nodes[parseInt(n.toString(),10)];o.x=Math.cos(360*o.ratio*Math.PI/180)*(e.levels[parseInt(i.toString(),10)].radius+e.verticalSpacing*i),o.y=Math.sin(360*o.ratio*Math.PI/180)*(e.levels[parseInt(i.toString(),10)].radius+e.verticalSpacing*i),e.anchorX=Math.min(e.anchorX,o.x),e.anchorY=Math.min(e.anchorY,o.y)}},WDi.prototype.updateAnchor=function(e,t){e.anchorX=e.centerNode.offsetX||t.x/2,e.anchorY=e.centerNode.offsetY||t.y/2},WDi.prototype.updateNodes=function(e,t,i){var n=e.graphNodes[t.id],o=n.x+e.anchorX,r=n.y+e.anchorY;t.offsetX=o,t.offsetY=r;for(var s=0;s<n.children.length;s++){var a=n.children[parseInt(s.toString(),10)];this.updateNodes(e,i[a.id],i)}},WDi.prototype.setUpLayoutInfo=function(e,t){var i={};return i.name=t.id,i.x=0,i.y=0,i.min=0,i.max=0,i.width=t.actualSize.width,i.height=t.actualSize.height,i.children=[],i.level=0,i.ratio=0,i.visited=!1,i};Tft=WDi;function WDi(){}UDi.prototype.applyChanges=function(){this.graphNode.treeInfo.center=this.location};var QDi=UDi;function UDi(e){this.velocityX=0,this.velocityY=0,this.nodes=[],this.graphNode=e;var t=XDi(this.graphNode);this.location=t.center,this.nodes=[],e.treeInfo.parents||(e.treeInfo.parents=[]),e.treeInfo.children||(e.treeInfo.children=[]),this.nodes=e.treeInfo.parents.concat(e.treeInfo.children)}qDi.prototype.destroy=function(){},qDi.prototype.getModuleName=function(){return"SymmetricalLayout"},qDi.prototype.doGraphLayout=function(e){var t=this.selectedNode,e=(t.treeInfo.Bounds=e.getModelBounds(e.nodes),t.treeInfo.GraphNodes),i=this.convertGraphNodes(e),e=i.length,e=Math.min(this.maxIteration,e*e*e);this.preLayoutNodes(i,t.treeInfo.Bounds);for(var n=0,o=e;n<o;n++)this.makeSymmetricLayout(i),this.appendForces(i);this.resetGraphPosition(i,t)},qDi.prototype.preLayoutNodes=function(e,t){for(var i=Math.max(t.width,t.height),n=i/2,o=i/2,r=2*Math.PI/e.length,s=r,a=0;a<e.length;a++){var l=e[parseInt(a.toString(),10)];this.getForceNode(l).location={x:n+i*Number(Math.cos(s).toFixed(2)),y:o+i*Number(Math.sin(s).toFixed(2))},s-=r}},qDi.prototype.doLayout=function(e){this.selectedNode=e.selectedNode,this.doGraphLayout(e)},qDi.prototype.makeSymmetricLayout=function(e){for(var t,i=0;i<e.length;i++){for(var n,o=e[parseInt(i.toString(),10)],r=(n=this.getForceNode(o)).nodes,s=0;s<r.length;s++){var a=r[parseInt(s.toString(),10)];this.calcNodesForce(n,this.getForceNode(a))}for(var l=0,h=r.length;l<h&&!(h<2);l++){var d=this.getForceNode(r[parseInt(l.toString(),10)]),p=h<=l+1?this.getForceNode(r[0]):this.getForceNode(r[l+1]),c=360/r.length/2*Math.PI/180,c=2*this.springLength*Math.sin(c);this.calcRelatesForce(d,p,c)}for(var u=0;u<e.length;u++)KDi((a=e[parseInt(u.toString(),10)]).id,r)||a.id===o.id||(t=this.getForceNode(a),this.updateNeigbour(n,t))}},qDi.prototype.appendForces=function(e){for(var t=null,i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)],n=(t=this.getForceNode(n)).location;n.x+=Math.min(t.velocityX,this.mszMaxForceVelocity.width),n.y+=Math.min(t.velocityY,this.mszMaxForceVelocity.height),t.velocityX=0,t.velocityY=0,t.location=n}},qDi.prototype.resetGraphPosition=function(e,t){for(var i={width:Number.MAX_VALUE,height:Number.MAX_VALUE},n=null,o=0;o<e.length;o++){var r=e[parseInt(o.toString(),10)],s={x:(n=this.getForceNode(r)).location.x-r.actualSize.width/2,y:n.location.y-r.actualSize.height/2};i.width=Math.min(i.width,s.x),i.height=Math.min(i.height,s.y)}for(o=0;o<e.length;o++)r=e[parseInt(o.toString(),10)],(s=(n=this.getForceNode(r)).location).x-=i.width-(t.treeInfo.location?t.treeInfo.location.x:0),s.y-=i.height-(t.treeInfo.location?t.treeInfo.location.y:0),n.location=s,n.applyChanges()},qDi.prototype.convertGraphNodes=function(e){for(var t=[],i=0,n=Object.keys(e);i<n.length;i++){var o=e[""+n[i]],r=new QDi(o);o.treeInfo.tag=r,t.push(o)}return t},qDi.prototype.getForceNode=function(e){return e.treeInfo.tag},qDi.prototype.updateNeigbour=function(e,t){var i,n;null!=t&&null!=e&&(i=this.pointDistance(e.location,t.location),e=this.lineAngle(e.location,t.location),i<(n=.9*this.springLength))&&this.calcForce(i,n,e,t)},qDi.prototype.lineAngle=function(e,t){var i=0,n=t.x-e.x,t=t.y-e.y;return 0==n?i=t<=0?3*Math.PI/2:Math.PI/2:0==t?i=n<0?Math.PI:0:(i=Math.atan(t/n),n<0&&0<t||n<0&&t<0?i=Math.PI+i:0<n&&t<0&&(i=2*Math.PI+i)),i},qDi.prototype.pointDistance=function(e,t){var i=t.x-e.x,t=t.y-e.y;return Math.sqrt(i*i+t*t)},qDi.prototype.calcRelatesForce=function(e,t,i){var n=this.pointDistance(e.location,t.location),e=this.lineAngle(e.location,t.location);n<i&&this.calcForce(n,i,e,t)},qDi.prototype.updateLayout=function(e,t,i,n,o,r){(new GDi).updateLayout(e,t,i,n,o,r)},qDi.prototype.calcNodesForce=function(e,t){var i=this.pointDistance(e.location,t.location),e=this.lineAngle(e.location,t.location);(i>this.springLength||i<this.springLength)&&this.calcForce(i,this.springLength,e,t)},qDi.prototype.calcForce=function(e,t,i,n){var o=n.nodes.length,e=(e-t)*(this.springFactor/(o*o)*Math.sqrt(o)),t=Math.cos(i)*e,o=Math.sin(i)*e;n.velocityX-=t,n.velocityY-=o};X$e=qDi;function qDi(){this.cdCOEF=.442,this.cfMAXVELOCITY=50,this.cnMAXITERACTION=1e3,this.cnSPRINGLENGTH=100,this.mszMaxForceVelocity={width:this.cfMAXVELOCITY,height:this.cfMAXVELOCITY},this.springLength=0,this.springFactor=this.cdCOEF,this.maxIteration=this.cnMAXITERACTION,this.springLength=this.cnSPRINGLENGTH}YDi.prototype.updateLayout=function(e,t,i,n,o,r){this.nameTable=n,this.nodes=e,this.connectors=t;var s=e;0<s.length&&(this.mhelperSelectedNode=DTi(s[0]));for(var a=0,l=e;a<l.length;a++){var h=m=l[a];h.treeInfo={},h.treeInfo.graphType="Node",this.graphObjects.push(h)}for(var d=0,p=t;d<p.length;d++){var c=p[d];c.treeInfo={},c.treeInfo.graphType="Connector",this.graphObjects.push(c)}this.updateLayout1(this.graphObjects,i);for(var u=this.getModelBounds(s),g=0;g<s.length;g++){var m=s[parseInt(g.toString(),10)],f=(r.x-u.width)/2,y=o.margin,f=m.treeInfo.tag.location.x-(m.offsetX-m.actualSize.width/2)-u.x+f+y.left,y=m.treeInfo.tag.location.y-(m.offsetY-m.actualSize.height/2)-u.y+y.top;m.offsetX+=f,m.offsetY+=y,delete m.treeInfo}return!0},YDi.prototype.getModelBounds=function(e){e=e.slice();for(var t=null,i=0;i<e.length;i++)var n,o=XDi(n=e[parseInt(i.toString(),10)]),o=new tfi((n.treeInfo.tag?n.treeInfo.tag.location:o).x,(n.treeInfo.tag?n.treeInfo.tag.location:o).y,n.actualSize.width,n.actualSize.height),t=t?t.uniteRect(o):o;return t},YDi.prototype.updateLayout1=function(e,t){this.detectCyclesInGraph(e);var i=e.length;if(0<i){for(var n=[],o=[],r=[],s=0;s<e.length;s++){var a=e[parseInt(s.toString(),10)];void 0===a.treeInfo.isCycleEdge&&(a.treeInfo.isCycleEdge=!1),("Connector"!==a.treeInfo.graphType||a.treeInfo.isCycleEdge?"Connector"===a.treeInfo.graphType?n:r:o).push(a)}for(o=o.concat(r),o=n.concat(o);i>this.dictionaryLength(this.passedNodes);)this.getNodesToPosition(o),null!=this.selectedNode&&(t.doLayout(this),this.selectedNode=null,this.visitedStack=[]);this.passedNodes=null,this.selectedNode=null}return!1},YDi.prototype.getNodesToPosition=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];this.selectNodes(i);break}},YDi.prototype.selectNodes=function(e){var t=e;"Connector"===e.treeInfo.graphType?this.exploreGraphEdge(e):null!=t&&this.addNode(e,"passed")&&(this.addNode(e,"selected"),this.isConnectedToAnotherNode(t))&&(this.selectedNode={treeInfo:{}},this.selectedNode.treeInfo.LeftMargin=10,this.selectedNode.treeInfo.TopMargin=10,this.selectConnectedNodes(t))},YDi.prototype.selectConnectedNodes=function(e){var t=this.selectedNode,i=(t.treeInfo.GraphNodes||(t.treeInfo.GraphNodes={}),e),n=(this.addNode(i,"passed"),i.id);this.dictionaryContains(t.treeInfo.GraphNodes,i)?(t=t.treeInfo.GraphNodes[""+n]).treeInfo.Added&&(t.treeInfo.Added=!1,this.getConnectedRelatives(t),this.exploreRelatives(e)):(n=this.addGraphNode(i),this.getConnectedRelatives(n),this.exploreRelatives(e))},YDi.prototype.exploreRelatives=function(e){this.exploreRelatives1(e,"Parents"),this.exploreRelatives1(e,"Children")},YDi.prototype.exploreRelatives1=function(e,t){for(var i=[],i="Parents"===t?e.inEdges:e.outEdges,n=0;n<i.length;n++){var o,r,s=this.nameTable[i[parseInt(n.toString(),10)]];this.addNode(s,"passed")&&(o=this.nameTable[s.sourceID],r=this.nameTable[s.targetID],"Parents"===t&&null!=o&&KDi(o.id,this.nodes)?this.selectConnectedNodes(this.nameTable[s.sourceID]):"Children"===t&&null!=r&&KDi(r.id,this.nodes)&&this.selectConnectedNodes(this.nameTable[s.targetID]))}},YDi.prototype.getConnectedRelatives=function(e){this.getConnectedParents(e),this.getConnectedChildren(e)},YDi.prototype.dictionaryContains=function(e,t){for(var i=Object.keys(e),n=0;n<i.length;n++)if(i[parseInt(n.toString(),10)]===t.id)return!0;return!1},YDi.prototype.dictionaryLength=function(e){return Object.keys(e).length},YDi.prototype.getConnectedChildren=function(e){for(var t=this.selectedNode,i=e,n=0;n<i.outEdges.length;n++){var o,r=this.nameTable[i.outEdges[parseInt(n.toString(),10)]];r.treeInfo.isCycleEdge||KDi((r=this.nameTable[r.targetID]).id,this.nodes)&&null!=r&&r.visible&&(o=void 0,this.dictionaryContains(t.treeInfo.GraphNodes,r)?o=t.treeInfo.GraphNodes[r.id]:(o=this.addGraphNode(r)).treeInfo.Added=!0,e.treeInfo.children||(e.treeInfo.children=[]),o.treeInfo.parents||(o.treeInfo.parents=[]),this.setNode(o.treeInfo.parents,e),this.findNode(e.treeInfo.children,o.id)<0)&&e.treeInfo.children.push(o)}},YDi.prototype.getConnectedParents=function(e){for(var t=this.selectedNode,i=e,n=0;n<i.inEdges.length;n++){var o,r=this.nameTable[i.inEdges[parseInt(n.toString(),10)]];r.treeInfo.isCycleEdge||KDi((r=this.nameTable[r.sourceID]).id,this.nodes)&&null!=r&&r.visible&&(o=void 0,this.dictionaryContains(t.treeInfo.GraphNodes,r)?o=t.treeInfo.GraphNodes[r.id]:(o=this.addGraphNode(r)).treeInfo.Added=!0,e.treeInfo.parents||(e.treeInfo.parents=[]),o.treeInfo.children||(o.treeInfo.children=[]),this.setNode(o.treeInfo.children,e),this.findNode(e.treeInfo.parents,o.id)<0)&&e.treeInfo.parents.push(o)}},YDi.prototype.setNode=function(e,t){var i=this.findNode(e,t.id);0<=i&&i<e.length?e[parseInt(i.toString(),10)]=t:e.push(t)},YDi.prototype.findNode=function(e,t){var i=-1;if(null!=e&&""!==t)for(var n=0,o=e.length;n<o;n++){var r=e[parseInt(n.toString(),10)];if(null!=r&&r.id===t){i=n;break}}return i},YDi.prototype.addGraphNode=function(e){var t=e,i=(this.selectedNode.treeInfo.GraphNodes[t.id]=t,this.mhelperSelectedNode);return null!=i&&e.id===i.id&&(this.mhelperSelectedNode=t),t},YDi.prototype.isConnectedToAnotherNode=function(e){var t=!1;return t=0<e.inEdges.concat(e.outEdges).length&&!(t=null!=e.inEdges&&0<e.inEdges.length?this.searchEdgeCollection(e.inEdges,"FromNode"):t)&&null!=e.outEdges&&0<e.outEdges.length?this.searchEdgeCollection(e.outEdges,"ToNode"):t},YDi.prototype.searchEdgeCollection=function(e,t){for(var i=!1,n=0;n<e.length-1;n++){var o=this.nameTable[e[parseInt(n.toString(),10)]];if(this.addNode(o,"passed")&&(!o.treeInfo.isCycleEdge&&("FromNode"===t&&null!=this.nameTable[o.sourceID]||"ToNode"===t&&null!=this.nameTable[o.targetID]))){i=!0;break}}return i},YDi.prototype.exploreGraphEdge=function(e){var t=e;null!=t&&!t.treeInfo.isCycleEdge&&this.addNode(e,"passed")&&(this.addNode(e,"selected"),e=this.nameTable[t.sourceID],this.nameTable[t.targetID],null!=e)&&this.selectNodes(e)},YDi.prototype.addNode=function(e,t){return"passed"!==t&&e.visible||this.dictionaryContains(this.passedNodes,e)||(this.passedNodes[e.id]=e),!!e.visible},YDi.prototype.detectCyclesInGraph=function(e){for(var t=[],i=[],n=0;n<e.length;n++)"Connector"!==e[parseInt(n.toString(),10)].treeInfo.graphType&&t.push(e[parseInt(n.toString(),10)]);if(0<t.length)for(i.push(t[0]),this.visitedStack.push(t[0]);0<i.length;){var o,r=this.getUnVisitedChildNodes(i[i.length-1]);0<r.length?(o=r[0],r=r[r.length-1],KDi(o.id,this.visitedStack)?(r.treeInfo.isCycleEdge=!0,this.cycleEdgesCollection.push(r)):(i.push(o),this.visitedStack.splice(0,0,o))):i.pop()}},YDi.prototype.getUnVisitedChildNodes=function(e){var t=[];if(0<e.outEdges.length)for(var i=0;i<e.outEdges.length;i++){var n,o=this.nameTable[e.outEdges[parseInt(i.toString(),10)]];if(!KDi(o.id,this.visitedStack))return null!=(n=this.nameTable[o.targetID])&&t.push(n),t.push(o),this.visitedStack.splice(0,0,o),t}return t};var GDi=YDi;function YDi(){this.visitedStack=[],this.cycleEdgesCollection=[],this.graphObjects=[],this.passedNodes=[]}function XDi(e){var t=e.offsetX-e.actualSize.width*e.pivot.x,i=e.offsetY-e.actualSize.height*e.pivot.y;return new tfi(t,i,e.actualSize.width,e.actualSize.height)}function KDi(e,t){for(var i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].id===e)return 1}JDi.prototype.destroy=function(){},JDi.prototype.getModuleName=function(){return"ComplexHierarchicalTree"},JDi.prototype.doLayout=function(e,t,i,n,o){(new ZDi).doLayout(e,t,i,n,o)},JDi.prototype.getLayoutNodesCollection=function(e){for(var t,i=[],n=0;n<e.length;n++)(t=e[parseInt(n.toString(),10)]).excludeFromLayout||!(0<t.inEdges.length+t.outEdges.length||0===t.offsetX&&0===t.offsetY)||t.parentId||t.processId||i.push(t);return i};Met=JDi;function JDi(){}$Di.prototype.createVertex=function(e,t,i,n,o,r){return{value:t,geometry:{x:i,y:n,width:o,height:r},name:t,vertex:!0,inEdges:e.inEdges.slice(),outEdges:e.outEdges.slice()}},$Di.prototype.getEdges=function(e){var t=[],i=this.nameTable[e.name];if(e&&!i.excludeFromLayout){for(var n=0;0<e.inEdges.length&&n<e.inEdges.length;n++){var o=this.nameTable[e.inEdges[parseInt(n.toString(),10)]];this.nameTable[o.sourceID].excludeFromLayout||t.push(o)}for(n=0;0<e.outEdges.length&&n<e.outEdges.length;n++){o=this.nameTable[e.outEdges[parseInt(n.toString(),10)]];this.nameTable[o.targetID].excludeFromLayout||t.push(o)}}return t},$Di.prototype.findRoots=function(e){for(var t=[],i=null,n=-1e5,o=0,r=Object.keys(e);o<r.length;o++){for(var s=e[""+r[o]],a=this.getEdges(s),l=0,h=0,d=0;d<a.length;d++)this.getVisibleTerminal(a[parseInt(d.toString(),10)],!0).name===s.name?l++:h++;0===h&&0<l&&t.push(s);var p=l-h;n<p&&(n=p,i=s)}return 0===t.length&&null!=i&&t.push(i),t},$Di.prototype.getVisibleTerminal=function(e,t){var i=this.nameTable[e.targetID];t&&(i=this.nameTable[e.sourceID]);for(var n=0;n<this.vertices.length;n++)if(this.vertices[parseInt(n.toString(),10)].name===i.id)return this.vertices[parseInt(n.toString(),10)];return null},$Di.prototype.traverse=function(e,t,i,n,o,r){if(null!=e){var s=e.name;if(null==r||null!=r[""+s]){null==n[""+s]&&(n[""+s]=e),null!=r&&delete r[""+s];for(var a=this.getEdges(e),l=[],h=0;h<a.length;h++)l[parseInt(h.toString(),10)]=this.getVisibleTerminal(a[parseInt(h.toString(),10)],!0)===e;for(h=0;h<a.length;h++)if(!t||l[parseInt(h.toString(),10)]){for(var d,p=this.getVisibleTerminal(a[parseInt(h.toString(),10)],!l[parseInt(h.toString(),10)]),c=1,u=0;u<a.length;u++)u!==h&&(d=l[parseInt(u.toString(),10)],this.getVisibleTerminal(a[parseInt(u.toString(),10)],!d)===p)&&(d?c++:c--);0<=c&&(n=this.traverse(p,t,a[parseInt(h.toString(),10)],n,o,r))}}else if(null==n[""+s])for(h=0;h<o.length;h++){var g=o[parseInt(h.toString(),10)];if(null!=g[""+s]){for(var m=0,f=Object.keys(g);m<f.length;m++){var y=f[m];n[""+y]=g[""+y]}return o.splice(h,1),n}}}return n},$Di.prototype.getModelBounds=function(e){e=e.slice();for(var t=null,i=0;i<e.length;i++){var n,o,r=e[parseInt(i.toString(),10)].geometry;t?(n=Math.max(t.x+t.width,r.x+r.width),o=Math.max(t.y+t.height,r.y+r.height),t.x=Math.min(t.x,r.x),t.y=Math.min(t.y,r.y),t.width=n-t.x,t.height=o-t.y):t={x:r.x,y:r.y,width:r.width,height:r.height}}return t},$Di.prototype.doLayout=function(e,t,i,n,O){this.nameTable=t;for(var o,r=i.enableRouting,s={horizontalSpacing:i.horizontalSpacing,verticalSpacing:i.verticalSpacing,orientation:i.orientation,marginX:i.margin.left,marginY:i.margin.top,enableLayoutRouting:r},a=new oMi,l=(a.edgeMapper=[],a.diagram=O,[]),h=(this.vertices=[],{}),d=0;d<e.length;d++)if(!this.nameTable[e[parseInt(d.toString(),10)].id].excludeFromLayout){var p=this.createVertex(e[parseInt(d.toString(),10)],e[parseInt(d.toString(),10)].id,0,0,e[parseInt(d.toString(),10)].actualSize.width,e[parseInt(d.toString(),10)].actualSize.height);if(this.vertices.push(p),(0<e[parseInt(d.toString(),10)].inEdges.length||0<e[parseInt(d.toString(),10)].outEdges.length)&&l.push(e[parseInt(d.toString(),10)]),h[p.name]=p,a)for(var c=e[parseInt(d.toString(),10)].outEdges.slice(),u=0;u<c.length;u++){var N=t[c[parseInt(u.toString(),10)]];a.setEdgeMapper({key:N,value:[]})}}for(var g=[],m=this.findRoots(h),d=0;d<m.length;d++){var f={};g.push(f),this.traverse(m[parseInt(d.toString(),10)],!0,null,f,g,h)}for(var y,v={marginX:0,marginY:0},b=[],w=!1,d=0;d<g.length;d++){for(var f=g[parseInt(d.toString(),10)],C=0,S=Object.keys(f);C<S.length;C++){var A=S[C];b.push(f[""+A])}("Linear"===i.arrangement&&d===g.length-1||r)&&(w=!0),o=new eMi(this,b,m,s),this.cycleStage(o),this.layeringStage(o),a&&"DifferentPoint"===i.connectionPointOrigin||w?(a.arrangeElements(y={model:o,matrix:[],rowOffset:[],roots:[]},i),i.ranks=y.model.ranks):"Nonlinear"===i.arrangement&&(this.crossingStage(o),v=this.placementStage(o,v.marginX,v.marginY),b=[])}var x=this.getModelBounds(this.vertices);this.updateMargin(i,s,x,n);for(var I,V,T,E,D,d=0;d<this.vertices.length;d++)(R=this.vertices[parseInt(d.toString(),10)])&&((I=this.nameTable[R.name]).offsetX=0,I.offsetY=0,E=V=R.geometry.x-(I.offsetX-I.actualSize.width/2)+s.marginX,D=T=R.geometry.y-(I.offsetY-I.actualSize.height/2)+s.marginY,"BottomToTop"===s.orientation?(r&&(R.geometry.y=x.height-T-I.actualSize.height/2),D=x.height-T):"RightToLeft"===s.orientation&&(E=x.width-V),I.offsetX+=E-I.offsetX,I.offsetY+=D-I.offsetY,"Stretch"===i.horizontalAlignment&&"Stretch"===i.verticalAlignment||a.nodePropertyChange(I));if(!w)for(d=0;d<this.vertices.length;d++)this.isNodeOverLap(this.nameTable[this.vertices[parseInt(d.toString(),10)].name],i);if(a.updateLayout(n,x,i,s,l,t),r){for(var M={},k=0;k<y.matrix.length;k++)for(var _=y.matrix[parseInt(k.toString(),10)].value,P=0;P<_.length;P++)for(var H=_[parseInt(P.toString(),10)],B=0;B<H.cells.length;B++){var F=H.cells[parseInt(B.toString(),10)];"internalVertex"===this.getType(F.type)&&(M[F.id]=F)}this.updateRankValuess(o);for(var d=0,z=Object.keys(M);d<z.length;d++){A=z[parseInt(d.toString(),10)];this.setVertexLocationValue(M[""+A],i.orientation,x)}this.localEdgeProcessing(o,M),this.assignRankOffset(o),this.updateEdgeSetXYValue(o);for(var L=this.getValues(o.edgeMapper),d=0;d<L.length;d++){if(0<L[parseInt(d.toString(),10)].x.length)for(u=0;u<L[parseInt(d.toString(),10)].x.length;u++)"RightToLeft"!==i.orientation&&"LeftToRight"!==i.orientation?L[parseInt(d.toString(),10)].x[parseInt(u.toString(),10)]=L[parseInt(d.toString(),10)].x[parseInt(u.toString(),10)]+s.marginX:(i.orientation,L[parseInt(d.toString(),10)].x[parseInt(u.toString(),10)]=L[parseInt(d.toString(),10)].x[parseInt(u.toString(),10)]+i.verticalSpacing/2);this.setEdgePosition(L[parseInt(d.toString(),10)],o,s)}for(var R,k=0;k<this.vertices.length;k++)1<(R=this.vertices[parseInt(k.toString(),10)]).outEdges.length&&this.updateMultiOutEdgesPoints(R)}},$Di.prototype.setEdgeXY=function(e,t,i,n){if(e&&t.source.id){for(var o=void 0,r=void 0,s=0;s<e.length;s++)for(var a=0;a<e[parseInt(s.toString(),10)].length;a++)e[parseInt(s.toString(),10)][parseInt(a.toString(),10)].id!==t.target.id&&e[parseInt(s.toString(),10)][parseInt(a.toString(),10)].id!==t.source.id||(e[parseInt(s.toString(),10)][parseInt(a.toString(),10)].id===t.target.id&&void 0===o&&(o=s),e[parseInt(s.toString(),10)][parseInt(a.toString(),10)].id===t.source.id&&void 0===r&&(r=s));for(var l=void 0,h=o;h<=r;h++)void 0!==(l=void 0===l?this[h+"_RankOffset"]:l)&&l<this[h+"_RankOffset"]&&(l=this[h+"_RankOffset"]);void 0===this.edges&&(this.edges={}),this.edges[t.ids[0]]={x:t.x,y:0};i=this.resetOffsetXValue(l,i/10);t.x[n-t.minRank-1]=i;for(a=0;a<t.edges.length;a++)t.edges[parseInt(a.toString(),10)].levelSkip=!0}},$Di.prototype.resetOffsetXValue=function(e,t){for(var i=0,n=Object.keys(this.edges);i<n.length;i++)for(var o=n[parseInt(i.toString(),10)],r=this.edges[""+o].x,s=0;s<r.length;s++)if(this.edges[""+o].x[parseInt(s.toString(),10)]===e)return this.resetOffsetXValue(e+t,t);return e},$Di.prototype.setEdgePosition=function(e,t,i){var n=0;if(101207!==e.temp[0]){void 0===e.maxRank&&(e.maxRank=-1),void 0===e.minRank&&(e.minRank=-1);var o=e.maxRank,r=e.minRank,s=(o===r&&(o=e.source.maxRank,r=e.target.minRank),0),a=this.jettyPositions[e.ids[0]],l=(void 0===e.isReversed?e.isReversed=!1:e.isReversed=!0,(e.isReversed?e.target:e.source).cell),h=!1;"TopToBottom"===t.layout.orientation||"LeftToRight"===t.layout.orientation?("TopToBottom"===t.layout.orientation&&(h=!1),"LeftToRight"===t.layout.orientation&&(h=(e.isReversed,!1))):e.isReversed||(h=!0);for(var d=0;d<e.edges.length;d++){var p=e.edges[parseInt(d.toString(),10)],c=this.getVisibleTerminal(p,!0),u=[],g=e.isReversed,c=(c!==l&&(g=!g),null!=a&&(v=g?2:0,w=g?(h?this.rankBottomY:this.rankTopY)[parseInt(r.toString(),10)]:(h?this.rankTopY:this.rankBottomY)[parseInt(o.toString(),10)],b=a[4*s+1+v],g!==h&&(b=-b),"TopToBottom"!==i.orientation&&"BottomToTop"!==i.orientation||(w+=b),C=a[4*s+v],"TopToBottom"===i.orientation||"BottomToTop"===i.orientation?u.push(this.getPointvalue(C,w+i.marginY)):"LeftToRight"===i.orientation?u.push(this.getPointvalue(w+b,C+i.marginY)):u.push(this.getPointvalue(w,C+i.marginY))),e.x.length-1),m=-1,f=-1,y=e.maxRank-1;g&&(c=0,m=e.x.length,y=e.minRank+(f=1));for(var v,b,w,C,S=c;e.maxRank!==e.minRank&&S!==m;S+=f){var A,x=e.x[parseInt(S.toString(),10)]+n,I=(this.rankTopY[parseInt(y.toString(),10)]+this.rankBottomY[y+1])/2,T=(this.rankTopY[y-1]+this.rankBottomY[parseInt(y.toString(),10)])/2;g&&(A=I,I=T,T=A),"TopToBottom"===i.orientation||"BottomToTop"===i.orientation?(u.push(this.getPointvalue(x,I+i.marginY)),u.push(this.getPointvalue(x,T+i.marginY))):(u.push(this.getPointvalue(I,x+i.marginY)),u.push(this.getPointvalue(T,x+i.marginY))),this.limitX=Math.max(this.limitX,x),y+=f}null!=a&&(v=g?2:0,c=g?(h?this.rankTopY:this.rankBottomY)[parseInt(o.toString(),10)]:(h?this.rankBottomY:this.rankTopY)[parseInt(r.toString(),10)],b=a[4*s+3-v],w=c-(b=g!==h?-b:b),C=a[4*s+2-v],"TopToBottom"===i.orientation||"BottomToTop"===i.orientation?u.push(this.getPointvalue(C,w+i.marginY)):u.push(this.getPointvalue(w,C+i.marginY))),this.setEdgePoints(p,u,t),n=0===n?this.parallelEdgeSpacing:0<n?-n:-n+this.parallelEdgeSpacing,s++}e.temp[0]=101207}},$Di.prototype.getPointvalue=function(e,t){return{x:Number(e)||0,y:Number(t)||0}},$Di.prototype.updateEdgeSetXYValue=function(e){if(e.layout.enableLayoutRouting){var t=!1;"LeftToRight"!==e.layout.orientation&&"RightToLeft"!==e.layout.orientation||(t=!0);for(var i=0;i<e.ranks.length;i++)for(var n=e.ranks[parseInt(i.toString(),10)],o=0;o<n.length;o++){var r,s,a=n[parseInt(o.toString(),10)];a.edges&&0<a.edges.length&&(r=0<e.layout.horizontalSpacing?e.layout.horizontalSpacing/2:15,s=!0,s=(a.minRank===i-1||a.maxRank===i-1)&&s)&&this.setXY(a,i,void 0,!!t,e.ranks,r)}}},$Di.prototype.getPreviousLayerConnectedCells=function(e,t){if(null==t.previousLayerConnectedCells){t.previousLayerConnectedCells=[],t.previousLayerConnectedCells[0]=[];for(var i=0;i<t.connectsAsSource.length;i++){var n=t.connectsAsSource[parseInt(i.toString(),10)];-1===n.minRank||n.minRank===e-1?t.previousLayerConnectedCells[0].push(n.target):t.previousLayerConnectedCells[0].push(n)}}return t.previousLayerConnectedCells[0]},$Di.prototype.compare=function(e,t){if(null!=e&&null!=t){if(t.weightedValue>e.weightedValue)return-1;if(t.weightedValue<e.weightedValue)return 1}return 0},$Di.prototype.localEdgeProcessing=function(e,t){for(var i=0;i<e.ranks.length;i++)for(var n=e.ranks[parseInt(i.toString(),10)],o=0;o<n.length;o++){var r=n[parseInt(o.toString(),10)];if(this.crossReduction.isVertex(r))for(var s=this.getPreviousLayerConnectedCells(i,r),a=i-1,l=0;l<2;l++){if(-1<a&&a<e.ranks.length&&null!=s&&0<s.length){for(var h=[],d=0;d<s.length;d++){var p=this.weightedCellSorter(s[parseInt(d.toString(),10)],this.getX(a,s[parseInt(d.toString(),10)]));h.push(p)}h.sort(this.compare),r.width=t[r.id].cell.geometry.width,r.height=t[r.id].cell.geometry.height;for(var c=void 0,u=(c="TopToBottom"===e.layout.orientation||"BottomToTop"===e.layout.orientation?(r.x[0]=t[r.id].cell.geometry.x+t[r.id].cell.geometry.width/2,r.x[0]-r.width/2+t[r.id].cell.geometry.height/2):(r.x[0]=t[r.id].cell.geometry.y,r.x[0]))+r.width,g=0,m=[],d=0;d<h.length;d++){var f=h[parseInt(d.toString(),10)].cell,y=void 0;if(this.crossReduction.isVertex(f))for(var y=0===l?r.connectsAsSource:r.connectsAsTarget,v=0;v<y.length;v++)y[parseInt(v.toString(),10)].source!==f&&y[parseInt(v.toString(),10)].target!==f||(g+=y[parseInt(v.toString(),10)].edges.length,m.push(y[parseInt(v.toString(),10)]));else g+=f.edges.length,m.push(f)}var b=(g+1)*this.previousEdgeDistance;r.width>b+2*this.previousEdgeDistance&&(c+=this.previousEdgeDistance,u-=this.previousEdgeDistance);for(var w=(u-c)/g,C=c+w/2,S=this.minEdgeJetty-this.previousEdgeOffset,d=0;d<m.length;d++){var A=m[parseInt(d.toString(),10)].edges.length,x=(void 0===this.jettyPositions&&(this.jettyPositions={}),this.jettyPositions[m[parseInt(d.toString(),10)].ids[0]]);null==x&&(x=[],this.jettyPositions[m[parseInt(d.toString(),10)].ids[0]]=x),d<g/2?S+=this.previousEdgeOffset:g/2<d&&(S-=this.previousEdgeOffset);for(var I=0;I<A;I++)x[4*I+2*l]=C,C+=w,x[4*I+2*l+1]=S}}s=this.getNextLayerConnectedCells(i,r),a=i+1}}},$Di.prototype.updateMultiOutEdgesPoints=function(e){for(var t=0;t<e.outEdges.length/2;t++){var i=this.nameTable[e.outEdges[parseInt(t.toString(),10)]],n=this.nameTable[e.outEdges[e.outEdges.length-(t+1)]];i.sourceID!==n.targetID&&i.targetID!==n.sourceID&&(n.geometry.points[0].y=i.geometry.points[0].y)}},$Di.prototype.getNextLayerConnectedCells=function(e,t){if(null==t.nextLayerConnectedCells){t.nextLayerConnectedCells=[],t.nextLayerConnectedCells[0]=[];for(var i=0;i<t.connectsAsTarget.length;i++){var n=t.connectsAsTarget[parseInt(i.toString(),10)];-1===n.maxRank||n.maxRank===e+1?t.nextLayerConnectedCells[0].push(n.source):t.nextLayerConnectedCells[0].push(n)}}return t.nextLayerConnectedCells[0]},$Di.prototype.getX=function(e,t){return this.crossReduction.isVertex(t)?t.x[0]:this.crossReduction.isVertex(t)?0:t.x[e-t.minRank-1]||t.temp[e-t.minRank-1]},$Di.prototype.getGeometry=function(e){return e.geometry},$Di.prototype.setEdgePoints=function(e,t,i){if(null!=e){var n=this.getGeometry(e);if(null!=t)for(var o=0;o<t.length;o++)t[o].x=t[o].x,t[o].y=t[o].y;n.points=t,e.geometry=n}},$Di.prototype.assignRankOffset=function(e){if(e)for(var t=0;t<e.ranks.length;t++)this.rankCoordinatesAssigment(t,e)},$Di.prototype.rankCoordinatesAssigment=function(e,t){for(var i,n=t.ranks[parseInt(e.toString(),10)],o=t.layout.horizontalSpacing,r=0;r<n.length;r++)void 0===this[e+"_RankOffset"]&&(this[e+"_RankOffset"]=0),i=n[parseInt(r.toString(),10)].x[0],this[e+"_RankOffset"]<i&&(this[e+"_RankOffset"]=i+n[parseInt(r.toString(),10)].width/2+o)},$Di.prototype.getType=function(e){return"internalVertex"===e?"internalVertex":"internalEdge"},$Di.prototype.updateRankValuess=function(e){this.rankTopY=[],this.rankBottomY=[];for(var t=0;t<e.ranks.length;t++)this.rankTopY[parseInt(t.toString(),10)]=Number.MAX_VALUE,this.rankBottomY[parseInt(t.toString(),10)]=-Number.MAX_VALUE},$Di.prototype.setVertexLocationValue=function(e,t,i){var n=e.cell.geometry,o="TopToBottom"===t||"BottomToTop"===t?(n.x,n.y):(n.y,n.x);"RightToLeft"===t?(n.y,o=i.width-n.x-n.height,this.rankBottomY[e.minRank]=Math.max(this.rankBottomY[e.minRank],o),this.rankTopY[e.minRank]=Math.min(this.rankTopY[e.minRank],o+n.height)):(this.rankTopY[e.minRank]=Math.min(this.rankTopY[e.minRank],o),this.rankBottomY[e.minRank]=Math.max(this.rankBottomY[e.minRank],o+n.height))},$Di.prototype.calculateRectValue=function(e){var t={x:0,y:0,right:0,bottom:0,height:0,width:0};return t.x=e.offsetX-e.actualSize.width/2,t.right=e.offsetX+e.actualSize.width/2,t.y=e.offsetY-e.actualSize.height/2,t.bottom=e.offsetY+e.actualSize.height/2,t},$Di.prototype.isNodeOverLap=function(e,t){for(var i,n=0;n<this.vertices.length;n++){var o=this.nameTable[this.vertices[parseInt(n.toString(),10)].value];e.id!==o.id&&0!==o.offsetX&&0!==o.offsetY&&(i=this.calculateRectValue(e),o=this.calculateRectValue(o),this.isIntersect(o,i,t))&&("TopToBottom"===t.orientation||"BottomToTop"===t.orientation?e.offsetX+=t.horizontalSpacing:e.offsetY+=t.verticalSpacing,this.isNodeOverLap(e,t))}},$Di.prototype.isIntersect=function(e,t,i){return!(Math.floor(e.right+i.horizontalSpacing)<=Math.floor(t.x)||Math.floor(e.x-i.horizontalSpacing)>=Math.floor(t.right)||Math.floor(e.y-i.verticalSpacing)>=Math.floor(t.bottom)||Math.floor(e.bottom+i.verticalSpacing)<=Math.floor(t.y))},$Di.prototype.updateMargin=function(e,t,i,n){var n={x:0,y:0,width:n.x,height:n.y},o=i.x,r=i.y,s=i.x+i.width,a=i.y+i.height,l=e.bounds||n;if("TopToBottom"===t.orientation||"BottomToTop"===t.orientation){switch(e.horizontalAlignment){case"Auto":case"Left":t.marginX=l.x-o+e.margin.left;break;case"Right":t.marginX=l.x+l.width-e.margin.right-s;break;case"Center":t.marginX=l.x+l.width/2-(o+s)/2}switch(e.verticalAlignment){case"Top":var h=l.y+e.margin.top;t.marginY="TopToBottom"===t.orientation?h:-h;break;case"Bottom":h=l.y+l.height-e.margin.bottom;t.marginY="TopToBottom"===t.orientation?h-a:-(h-a);break;case"Auto":case"Center":var d=l.y+l.height/2;t.marginY="TopToBottom"===t.orientation?d-(r+a)/2:(r+a)/2-d}}else{switch(e.horizontalAlignment){case"Auto":case"Left":var p=l.x+e.margin.left;t.marginX="LeftToRight"===t.orientation?p:-p;break;case"Right":p=l.x+l.width-e.margin.right;t.marginX="LeftToRight"===t.orientation?p-s:s-p;break;case"Center":d=void 0;d=l.width/2+l.x,t.marginX="LeftToRight"===t.orientation?d-(r+a)/2:(o+s)/2-d}switch(e.verticalAlignment){case"Top":t.marginY=l.y+e.margin.top-r;break;case"Auto":case"Center":t.marginY=l.y+l.height/2-(r+a)/2;break;case"Bottom":t.marginY=l.y+l.height-e.margin.bottom-a}}},$Di.prototype.placementStage=function(e,t,i){t=this.coordinateAssignment(t,i,parent,e);return t.model=e,t.widestRankValue=null,this.placementStageExecute(t),{marginX:t.marginX+e.layout.horizontalSpacing,marginY:t.marginY+e.layout.verticalSpacing}},$Di.prototype.coordinateAssignment=function(e,t,i,n){var o={};return"TopToBottom"===n.layout.orientation||"BottomToTop"===n.layout.orientation?(o.horizontalSpacing=n.layout.horizontalSpacing,o.verticalSpacing=n.layout.verticalSpacing):(o.horizontalSpacing=n.layout.verticalSpacing,o.verticalSpacing=n.layout.horizontalSpacing),o.orientation="north",o.marginX=o.marginX=e,o.marginY=o.marginY=t,o},$Di.prototype.calculateWidestRank=function(e,t,i){var n=!1,o=("LeftToRight"!==e.model.layout.orientation&&"RightToLeft"!==e.model.layout.orientation||(n=!0),-e.verticalSpacing),r=0;e.rankSizes=[],e.rankOffset=[];for(var s=i.maxRank;0<=s;s--){for(var a=0,l=i.ranks[parseInt(s.toString(),10)],h=n?e.marginY:e.marginX,d=0;d<l.length;d++){var p,c,u=l[parseInt(d.toString(),10)];this.crossReduction.isVertex(u)?(p=u).cell&&(p.cell.inEdges||p.cell.outEdges)&&(c=this.nameTable[p.cell.name],p.width=c.actualSize.width,p.height=c.actualSize.height,a=Math.max(a,n?p.width:p.height)):u&&(c=1,null!=u.edges&&(c=u.edges.length),u.width=10*(c-1)),!n||u.height||(u.height=0),h+=(n?u.height:u.width)/2,this.setXY(u,s,h,!!n),this.setTempVariable(u,s,h),(h+=(n?u.height:u.width)/2+e.horizontalSpacing)>e.widestRankValue&&(e.widestRankValue=h,e.widestRank=s),e.rankSizes[parseInt(s.toString(),10)]=h}e.rankOffset[parseInt(s.toString(),10)]=o;var g=a/2+r/2+e.verticalSpacing,r=a;"north"===e.orientation||"west"===e.orientation?o+=g:o-=g;for(d=0;d<l.length;d++){var m=l[parseInt(d.toString(),10)];this.setXY(m,s,o,!n)}}},$Di.prototype.setTempVariable=function(e,t,i){this.crossReduction.isVertex(e)?e.temp[0]=i:e.temp[t-e.minRank-1]=i},$Di.prototype.setXY=function(e,t,i,n,o,r){e&&e.cell?0<e.cell.inEdges.length||0<e.cell.outEdges.length?n?e.y[0]=i:e.x[0]=i:n?e.y[t-e.minRank-1]=i:e.x[t-e.minRank-1]=i:this.setEdgeXY(o,e,r,t)},$Di.prototype.rankCoordinates=function(e,t,i,n){for(var o=!1,r=("LeftToRight"!==e.model.layout.orientation&&"RightToLeft"!==e.model.layout.orientation||(o=!0),n.ranks[parseInt(t.toString(),10)]),s=0,a=(o?e.marginY:e.marginX)+(e.widestRankValue-e.rankSizes[parseInt(t.toString(),10)])/2,l=0;l<r.length;l++){var h,d=r[parseInt(l.toString(),10)],p=(this.crossReduction.isVertex(d)?(h=this.nameTable[d.cell.name],d.width=h.actualSize.width,d.height=h.actualSize.height,s=Math.max(s,d.height)):(h=1,null!=d.edges&&(h=d.edges.length),o?d.height=10*(h-1):d.width=10*(h-1)),(o?d.height:d.width)/2);a+=p,this.setXY(d,t,a,!!o),this.setTempVariable(d,t,a),a+=p+e.horizontalSpacing}},$Di.prototype.initialCoords=function(e,t,i){this.calculateWidestRank(e,t,i);for(var n=e.widestRank;0<=n;n--)n<i.maxRank&&this.rankCoordinates(e,n,t,i);for(n=e.widestRank+1;n<=i.maxRank;n++)0<n&&this.rankCoordinates(e,n,t,i)},$Di.prototype.isAncestor=function(e,t){if(null!=t&&null!=e.hashCode&&null!=t.hashCode&&e.hashCode.length<t.hashCode.length){if(e.hashCode!==t.hashCode){if(null==e.hashCode||null==e.hashCode)return!1;for(var i=0;i<e.hashCode.length;i++)if(e.hashCode[parseInt(i.toString(),10)]!==t.hashCode[parseInt(i.toString(),10)])return!1}return!0}return!1},$Di.prototype.weightedCellSorter=function(e,t){var i={};return i.cell=e||null,i.weightedValue=t||0,i.visited=!1,i.rankIndex=null,i},$Di.prototype.minNode=function(e,t){for(var i=[],n={map:{}},o=[],r=0;r<=t.maxRank;r++){o[parseInt(r.toString(),10)]=t.ranks[parseInt(r.toString(),10)];for(var s=0;s<o[parseInt(r.toString(),10)].length;s++){var a=o[parseInt(r.toString(),10)][parseInt(s.toString(),10)],l=this.weightedCellSorter(a,r);l.rankIndex=s,l.visited=!0,i.push(l),t.setDictionaryForSorter(n,a,l,!0)}}for(var h=10*i.length,d=0;0<i.length&&d<=h;){var p=i.shift(),c=p.cell,u=p.weightedValue,g=p.rankIndex,m=this.crossReduction.getConnectedCellsOnLayer(c,u),f=this.crossReduction.getConnectedCellsOnLayer(c,u,!0),y=m?m.length:0,v=f?f.length:0,b=this.medianXValue(e,m,u+1),w=this.medianXValue(e,f,u-1),C=y+v,S=this.crossReduction.getTempVariable(c,u),C=0<C?(b*y+w*v)/C:S,w=(1===y&&1===v?C=w*v/v:1===y&&(C=b*y/y),!1),v=void 0;C<S-1?0===g||(b=o[parseInt(u.toString(),10)][g-1],(y=this.crossReduction.getTempVariable(b,u)+b.width/2+e.intraCellSpacing+c.width/2)<C)?(v=C,w=!0):y<this.crossReduction.getTempVariable(c,u)-1&&(v=y,w=!0):S+1<C&&(g===o[parseInt(u.toString(),10)].length-1||(b=o[parseInt(u.toString(),10)][g+1],C<(y=this.crossReduction.getTempVariable(b,u)-b.width/2-e.intraCellSpacing-c.width/2))?(v=C,w=!0):y>this.crossReduction.getTempVariable(c,u)+1&&(v=y,w=!0)),w&&(this.setTempVariable(c,u,v),this.updateNodeList(i,n,m,t),this.updateNodeList(i,n,f,t)),this.crossReduction.isVertex(p.cell)&&(p.visited=!1),d++}},$Di.prototype.updateNodeList=function(e,t,i,n){for(var o=0;o<i.length;o++){var r=i[parseInt(o.toString(),10)],r=n.getDictionaryForSorter(t,r);null!=r&&!1===r.visited&&(r.visited=!0,e.push(r))}},$Di.prototype.medianXValue=function(e,t,i){if(!t||0===t.length)return 0;for(var n,o=[],r=0;r<t.length;r++)o[parseInt(r.toString(),10)]=this.crossReduction.getTempVariable(t[parseInt(r.toString(),10)],i);return o.sort(function(e,t){return e-t}),t.length%2==1?o[Math.floor(t.length/2)]:(o[(n=t.length/2)-1]+o[parseInt(n.toString(),10)])/2},$Di.prototype.placementStageExecute=function(e){var t=!1,i=("LeftToRight"!==e.model.layout.orientation&&"RightToLeft"!==e.model.layout.orientation||(t=!0),e.jettyPositions={},e.model),n=(t?e.currentYDelta=0:e.currentXDelta=0,this.initialCoords(e,{model:i},i),this.minNode(e,i),1e8);e.maxIterations||(e.maxIterations=8);for(var o=0;o<e.maxIterations;o++){if((t?e.currentYDelta:e.currentXDelta)<n){for(var r=0;r<i.ranks.length;r++)for(var s=i.ranks[parseInt(r.toString(),10)],a=0;a<s.length;a++){var l=s[parseInt(a.toString(),10)];this.setXY(l,r,this.crossReduction.getTempVariable(l,r),!!t)}n=t?e.currentYDelta:e.currentXDelta}t?e.currentYDelta=0:e.currentXDelta=0}this.setCellLocations(e,i)},$Di.prototype.setCellLocations=function(e,t){for(var i=this.getValues(t.vertexMapper),n=0;n<i.length;n++)this.setVertexLocation(e,i[parseInt(n.toString(),10)])},$Di.prototype.garphModelsetVertexLocation=function(e,t,i,n){var o=t.geometry,r=null;return null!=o&&(r={x:i,y:n,width:o.width,height:o.height},o.x===i&&o.y===n||(t.geometry=r)),r},$Di.prototype.setVertexLocation=function(e,t){var i=!1,n=("LeftToRight"!==e.model.layout.orientation&&"RightToLeft"!==e.model.layout.orientation||(i=!0),t.cell),o=t.x[0]-t.width/2,r=t.y[0]-t.height/2;this.garphModelsetVertexLocation(e,n,o,r),i?(e.marginY||(e.marginY=0),e.marginY=Math.max(e.marginY,r+t.height)):(e.marginX||(e.marginX=0),e.marginX=Math.max(e.marginX,o+t.width))},$Di.prototype.getValues=function(e){var t=[];if(e.map)for(var i=0,n=Object.keys(e.map);i<n.length;i++){var o=n[i];t.push(e.map[""+o])}return t},$Di.prototype.crossingStage=function(e){this.crossReduction.execute(e)},$Di.prototype.layeringStage=function(e){this.initialRank(e),this.fixRanks(e)},$Di.prototype.initialRank=function(e){for(var t=e.startNodes,i=e.getDictionaryValues(e.vertexMapper),n=t.slice();0<t.length;){for(var o=(p=t[0]).connectsAsTarget,r=p.connectsAsSource,s=!0,a=1e8,l=0;l<o.length;l++){if(5270620!==(g=o[parseInt(l.toString(),10)]).temp[0]){s=!1;break}var h=g.source,a=Math.min(a,h.temp[0]-1)}if(s){if(p.temp[0]=a,e.maxRank||(e.maxRank=1e8),e.maxRank=Math.min(e.maxRank,a),null!=r)for(l=0;l<r.length;l++)(g=r[parseInt(l.toString(),10)]).temp[0]=5270620,-1===(h=g.target).temp[0]&&(t.push(h),h.temp[0]=-2);t.shift()}else{var d=t.shift();if(t.push(p),d===p&&1===t.length)break}}for(l=0;l<i.length;l++)i[parseInt(l.toString(),10)].temp[0]-=e.maxRank;for(l=0;l<n.length;l++)for(var p,c=0,o=(p=n[parseInt(l.toString(),10)]).connectsAsSource,u=0;u<o.length;u++){var g,h=(g=o[parseInt(u.toString(),10)]).target;p.temp[0]=Math.max(c,h.temp[0]+1),c=p.temp[0]}e.maxRank=1e8-e.maxRank},$Di.prototype.fixRanks=function(e){e.fixRanks()},$Di.prototype.cycleStage=function(e){for(var t={},i=(e.startNodes=[],e.getDictionaryValues(e.vertexMapper)),n=[],o=0;o<i.length;o++)i[parseInt(o.toString(),10)].temp[0]=-1,n[i[parseInt(o.toString(),10)].id]=i[parseInt(o.toString(),10)];var r=null;if(null!=e.roots)for(var s=e.roots,r=[],o=0;o<s.length;o++)r[parseInt(o.toString(),10)]=e.getDictionary(e.vertexMapper,s[parseInt(o.toString(),10)]),null!=r[parseInt(o.toString(),10)]&&e.startNodes.push(r[parseInt(o.toString(),10)]);e.visit("removeParentConnection",r,!0,null,{seenNodes:t,unseenNodes:n});var a=e.clone(t,null,!0);e.visit("removeNodeConnection",n,!0,a,{seenNodes:t,unseenNodes:n})},$Di.prototype.remove=function(e,t){var i=t.indexOf(e);return-1!==i&&t.splice(i,1),e},$Di.prototype.invert=function(e,t){var i=e.source;e.source=e.target,e.target=i,e.isReversed=!e.isReversed},$Di.prototype.getEdgesBetween=function(e,t,i){for(var n=this.getEdges(e),o=[],r=0;r<n.length;r++){var s=this.getVisibleTerminal(n[parseInt(r.toString(),10)],!0),a=this.getVisibleTerminal(n[parseInt(r.toString(),10)],!1);(s===e&&a===t||!i&&s===t&&a===e)&&o.push(n[parseInt(r.toString(),10)])}return o};var ZDi=$Di;function $Di(){this.nameTable={},this.crossReduction=new iMi,this.previousEdgeOffset=6,this.previousEdgeDistance=5,this.jettyPositions={},this.rankBottomY=null,this.limitX=null,this.rankTopY=null,this.parallelEdgeSpacing=10,this.minEdgeJetty=12}tMi.prototype.resetEdge=function(e){return e.geometry={x:0,y:0,width:0,height:0,relative:!0},e},tMi.prototype.createInternalCells=function(e,t,i,n){for(var o=0;o<t.length;o++){i[parseInt(o.toString(),10)]={x:[],y:[],temp:[],cell:t[parseInt(o.toString(),10)],id:t[parseInt(o.toString(),10)].name,connectsAsTarget:[],connectsAsSource:[],type:"internalVertex"},this.setDictionary(this.vertexMapper,t[parseInt(o.toString(),10)],i[parseInt(o.toString(),10)]);var r=e.getEdges(t[parseInt(o.toString(),10)]);i[parseInt(o.toString(),10)].connectsAsSource=[];for(var s=0;s<r.length;s++){var a=e.getVisibleTerminal(r[parseInt(s.toString(),10)],!1);if(a!==t[parseInt(o.toString(),10)]){var l=e.getEdgesBetween(t[parseInt(o.toString(),10)],a,!1),a=e.getEdgesBetween(t[parseInt(o.toString(),10)],a,!0);if(null!=l&&0<l.length&&2*a.length>=l.length){var h={x:[],y:[],temp:[],edges:l,ids:[]};if(n.enableLayoutRouting)for(var d=0;d<l.length;d++){var p=l[parseInt(d.toString(),10)];this.setDictionary(this.edgeMapper,void 0,h,p.id),this.resetEdge(p)}h.source=i[parseInt(o.toString(),10)];for(var c=0;c<l.length;c++)h.ids.push(l[parseInt(c.toString(),10)].id);h.source=i[parseInt(o.toString(),10)],i[parseInt(o.toString(),10)].connectsAsSource||(i[parseInt(o.toString(),10)].connectsAsSource=[]),i[parseInt(o.toString(),10)].connectsAsSource.indexOf(h)<0&&i[parseInt(o.toString(),10)].connectsAsSource.push(h)}}}i[parseInt(o.toString(),10)].temp[0]=0}},tMi.prototype.fixRanks=function(){var e=[];this.ranks=[];for(var t=0;t<this.maxRank+1;t++)e[parseInt(t.toString(),10)]=[],this.ranks[parseInt(t.toString(),10)]=e[parseInt(t.toString(),10)];var i=null;if(null!=this.roots)for(var n=this.roots,i=[],t=0;t<n.length;t++){var o=n[parseInt(t.toString(),10)],o=this.getDictionary(this.vertexMapper,o);i[parseInt(t.toString(),10)]=o}this.visit("updateMinMaxRank",i,!1,null,{seenNodes:null,unseenNodes:null,rankList:e})},tMi.prototype.updateMinMaxRank=function(e,t,i){var n=i.parent,o=i.root,r=i.edge,s=i.rankList;if((o.maxRank||0===o.maxRank||(o.maxRank=-1),o.minRank||0===o.minRank||(o.minRank=-1),0===t&&o.maxRank<0&&o.minRank<0&&(s[o.temp[0]].push(o),o.maxRank=o.temp[0],o.minRank=o.temp[0],o.temp[0]=s[o.maxRank].length-1),null!=n&&null!=r)&&1<n.maxRank-o.maxRank){r.maxRank=n.maxRank,r.minRank=o.maxRank,r.temp=[],r.x=[],r.y=[];for(var a=r.minRank+1;a<r.maxRank;a++)s[parseInt(a.toString(),10)].push(r),this.hierarchicalUtil.setTempVariable(r,a,s[parseInt(a.toString(),10)].length-1)}},tMi.prototype.setDictionary=function(e,t,i,n){var o;return n?(o=e.map[""+n],e.map[""+n]=i):(n=t.name,o=e.map[""+n],e.map[""+n]=i),o},tMi.prototype.setDictionaryForSorter=function(e,t,i,n){var t=t.id,o=e.map[""+t];return e.map[""+t]=i,o},tMi.prototype.getDictionary=function(e,t){this.multiObjectIdentityCounter||0===this.multiObjectIdentityCounter||(this.multiObjectIdentityCounter=0);var i=t.name;return i?e.map[""+i]:t.layoutObjectId?e.map[t.layoutObjectId]:(t.layoutObjectId="graphHierarchyNode#"+this.multiObjectIdentityCounter++,t.layoutObjectId)},tMi.prototype.getDictionaryForSorter=function(e,t){this.multiObjectIdentityCounter||0===this.multiObjectIdentityCounter||(this.multiObjectIdentityCounter=0);var i=t.id;return i?e.map[""+i]:t.layoutObjectId?e.map[t.layoutObjectId]:(t.layoutObjectId="graphHierarchyNode#"+this.multiObjectIdentityCounter++,t.layoutObjectId)},tMi.prototype.getDictionaryValues=function(e){for(var t=[],i=0,n=Object.keys(e.map);i<n.length;i++){var o=n[i];t.push(e.map[""+o])}return t},tMi.prototype.visit=function(e,t,i,n,o){if(null!=t){for(var r=0;r<t.length;r++){var s=t[parseInt(r.toString(),10)];null!=s&&(null==n&&(n=new Object),o.parent=null,o.root=s,o.edge=null,i?(s.hashCode=[],s.hashCode[0]=this.dfsCount,s.hashCode[1]=r,this.extendedDfs(e,n,r,0,o)):this.depthFirstSearch(e,n,0,o))}this.dfsCount++}},tMi.prototype.depthFirstSearch=function(e,t,i,n){var o=n.root;if(null!=o){var r=o.id;if(null==t[""+r]){t[""+r]=o,this.updateConnectionRank(e,i,0,n);for(var s=o.connectsAsSource.slice(),a=0;a<s.length;a++){var l=s[parseInt(a.toString(),10)],h=l.target;n.parent=o,n.root=h,n.edge=l,this.depthFirstSearch(e,t,i+1,n)}}else this.updateConnectionRank(e,i,1,n)}},tMi.prototype.updateConnectionRank=function(e,t,i,n){var o=n.parent,r=n.root,s=n.edge;"removeParentConnection"!==e&&"removeNodeConnection"!==e||this.removeConnectionEdge(o,r,s,t,n,"removeNodeConnection"===e),"updateMinMaxRank"===e&&this.updateMinMaxRank(t,i,n)},tMi.prototype.removeConnectionEdge=function(e,t,i,n,o,r){var s=o.seenNodes,o=o.unseenNodes;this.hierarchicalUtil.isAncestor(t,e)&&(this.hierarchicalUtil.invert(i,0),this.hierarchicalUtil.remove(i,e.connectsAsSource),r?(t.connectsAsSource.push(i),e.connectsAsTarget.push(i),this.hierarchicalUtil.remove(i,t.connectsAsTarget)):(e.connectsAsTarget.push(i),this.hierarchicalUtil.remove(i,t.connectsAsTarget),t.connectsAsSource.push(i))),delete o[(s[t.id]=t).id]},tMi.prototype.extendedDfs=function(e,t,i,n,o){var r=o.parent,s=o.root;o.edge;if(null!=s){null==r||null!=s.hashCode&&s.hashCode[0]===r.hashCode[0]||(a=r.hashCode.length+1,s.hashCode=r.hashCode.slice(),s.hashCode[a-1]=i);var a,r=s.id;if(null==t[""+r]){t[""+r]=s,this.updateConnectionRank(e,n,0,o);for(var l=s.connectsAsSource.slice(),h=0;h<l.length;h++){var d=l[parseInt(h.toString(),10)],p=d.target;o.parent=s,o.root=p,o.edge=d,this.extendedDfs(e,t,h,n+1,o)}}else this.updateConnectionRank(e,n,1,o)}},tMi.prototype.clone=function(e,t,i){if(null==e||"function"!=typeof e.constructor)return null;for(var n=e.constructor(),o=0,r=Object.keys(e);o<r.length;o++){var s=r[o];"layoutObjectId"!==s&&(null==t||t.indexOf(s)<0)&&i&&(n[""+s]=e[""+s])}return n};var eMi=tMi;function tMi(e,t,i,n){this.multiObjectIdentityCounter=0,this.dfsCount=0,this.hierarchicalUtil=new ZDi,this.roots=i,this.vertexMapper={map:{}};var o=[];this.layout=n,this.maxRank=1e8,this.edgeMapper={map:{}},this.hierarchicalLayout=e,this.createInternalCells(e,t,o,n);for(var r=0;r<t.length;r++){for(var s=o[parseInt(r.toString(),10)].connectsAsSource,a=0;a<s.length;a++){var l,h,d=s[parseInt(a.toString(),10)],p=d.edges;null!=p&&0<p.length&&(p=p[0],l=e.getVisibleTerminal(p,!1),h=this.getDictionary(this.vertexMapper,l),o[parseInt(r.toString(),10)]===h&&(l=e.getVisibleTerminal(p,!0),h=this.getDictionary(this.vertexMapper,l)),null!=h)&&o[parseInt(r.toString(),10)]!==h&&(0===(d.target=h).connectsAsTarget.length&&(h.connectsAsTarget=[]),h.connectsAsTarget.indexOf(d)<0)&&h.connectsAsTarget.push(d)}o[parseInt(r.toString(),10)].temp[0]=1}}nMi.prototype.calculateCrossings=function(e){for(var t=e.ranks.length,i=0,n=1;n<t;n++)i+=this.calculateRankCrossing(n,e);return i},nMi.prototype.getTempVariable=function(e,t){return e?this.isVertex(e)?e.temp[0]:e.temp[t-e.minRank-1]:0},nMi.prototype.calculateRankCrossing=function(e,t){for(var i=0,n=t.ranks[parseInt(e.toString(),10)],o=t.ranks[e-1],r=[],s=0;s<n.length;s++){for(var a=n[parseInt(s.toString(),10)],l=this.getTempVariable(a,e),h=this.getConnectedCellsOnLayer(a,e,!0),d=[],p=0;p<h.length;p++){var c=h[parseInt(p.toString(),10)],c=this.getTempVariable(c,e-1);d.push(c)}d.sort(function(e,t){return e-t}),r[parseInt(l.toString(),10)]=d}for(var u=[],s=0;s<r.length;s++)u=u.concat(r[parseInt(s.toString(),10)]);for(var g=1;g<o.length;)g<<=1;for(var m=2*g-1,f=(--g,[]),s=0;s<m;++s)f[parseInt(s.toString(),10)]=0;for(s=0;s<u.length;s++){var y=u[parseInt(s.toString(),10)]+g;for(++f[parseInt(y.toString(),10)];0<y;)y%2&&(i+=f[y+1]),y=y-1>>1,++f[parseInt(y.toString(),10)]}return i},nMi.prototype.execute=function(e){this.nestedBestRanks=[];for(var t=0;t<e.ranks.length;t++)this.nestedBestRanks[parseInt(t.toString(),10)]=e.ranks[parseInt(t.toString(),10)].slice();for(var i=0,n=this.calculateCrossings(e),t=0;t<24&&i<2;t++){this.weightedMedian(t,e);var o=this.calculateCrossings(e);if(o<n)for(var n=o,i=0,r=0;r<this.nestedBestRanks.length;r++)for(var s=e.ranks[parseInt(r.toString(),10)],a=0;a<s.length;a++){var l=s[parseInt(a.toString(),10)],h=this.nestedBestRanks[parseInt(r.toString(),10)][l.temp[0]],d=!0;l.edges&&h&&!h.edges&&(d=!1),h&&d&&(this.nestedBestRanks[parseInt(r.toString(),10)][l.temp[0]]=l)}else{i++;for(r=0;r<this.nestedBestRanks.length;r++)for(s=e.ranks[parseInt(r.toString(),10)],a=0;a<s.length;a++){l=s[parseInt(a.toString(),10)];this.setTempVariable(l,r,a)}}if(0===n)break}for(var p=[],c=[],t=0;t<e.maxRank+1;t++)c[parseInt(t.toString(),10)]=[],p[parseInt(t.toString(),10)]=c[parseInt(t.toString(),10)];for(t=0;t<this.nestedBestRanks.length;t++)for(r=0;r<this.nestedBestRanks[parseInt(t.toString(),10)].length;r++)c[parseInt(t.toString(),10)].push(this.nestedBestRanks[parseInt(t.toString(),10)][parseInt(r.toString(),10)]);e.ranks=p},nMi.prototype.isVertex=function(e){return!!(e&&e.cell&&(e.cell.inEdges&&e.cell.inEdges.length||e.cell.outEdges&&e.cell.outEdges.length))},nMi.prototype.weightedMedian=function(e,t){var i=e%2==0;if(i)for(var n=t.maxRank-1;0<=n;n--)this.medianRank(n,i);else for(n=1;n<t.maxRank;n++)this.medianRank(n,i)},nMi.prototype.getConnectedCellsOnLayer=function(e,t,i){var n="nextLayerConnectedCells",o="connectsAsTarget";if((i=void 0===i?!1:i)&&(n="previousLayerConnectedCells",o="connectsAsSource"),e){if(this.isVertex(e)){if(null==e[""+n]){e[""+n]=[],e[""+n][0]=[];for(var r=0;r<e[""+o].length;r++){var s=e[""+o][parseInt(r.toString(),10)];void 0===s.maxRank&&(s.maxRank=-1),-1===s.maxRank||(i?s.minRank===t-1:s.maxRank===t+1)?e[""+n][0].push(i?s.target:s.source):e[""+n][0].push(s)}}return e[""+n][0]}if(null==e[""+n]){e[""+n]=[];for(r=0;r<e.temp.length;r++)e[""+n][parseInt(r.toString(),10)]=[],r===(i?0:e.temp.length-1)?e[""+n][parseInt(r.toString(),10)].push(i?e.target:e.source):e[""+n][parseInt(r.toString(),10)].push(e)}return e[""+n][t-e.minRank-1]}return null},nMi.prototype.medianValue=function(e,t){for(var i,n,o,r=[],s=0,a=0;a<e.length;a++){var l=e[parseInt(a.toString(),10)];r[s++]=this.getTempVariable(l,t)}return r.sort(function(e,t){return e-t}),s%2==1?r[Math.floor(s/2)]:2===s?(r[0]+r[1])/2:(n=r[(i=s/2)-1]-r[0],o=r[s-1]-r[parseInt(i.toString(),10)],(r[i-1]*o+r[parseInt(i.toString(),10)]*n)/(n+o))},nMi.prototype.setTempVariable=function(e,t,i){e&&(e.temp[0]=i)},nMi.prototype.medianRank=function(e,t){for(var i=this.nestedBestRanks[parseInt(e.toString(),10)].length,n=[],o=[],r=0;r<i;r++){var s=this.nestedBestRanks[parseInt(e.toString(),10)][parseInt(r.toString(),10)],a={medianValue:0},l=(a.cell=s,void 0),h=void 0,h=t?e+1:e-1;null!=(l=t?this.getConnectedCellsOnLayer(s,e):this.getConnectedCellsOnLayer(s,e,!0))&&0!==l.length?(a.medianValue=this.medianValue(l,h),n.push(a)):o[this.getTempVariable(s,e)]=!0}n.sort(this.compare);for(r=0;r<i;r++)null==o[parseInt(r.toString(),10)]&&0<n.length&&(s=n.shift().cell,this.setTempVariable(s,e,r))},nMi.prototype.compare=function(e,t){if(null!=e&&null!=t){if(t.medianValue>e.medianValue)return-1;if(t.medianValue<e.medianValue)return 1}return 0};var iMi=nMi;function nMi(){}rMi.prototype.arrangeElements=function(i,e){var t=i.model.layout,e="LeftToRight"===e.orientation||"RightToLeft"===e.orientation,n=e?t.verticalSpacing:t.horizontalSpacing;this.groupLayoutCells(i),this.createMatrixCells(i);for(var o=0;o<i.matrix.length;o++)for(var r=i.matrix[parseInt(o.toString(),10)].key,s=i.matrix[parseInt(r.toString(),10)].value,a=1;a<s.length;a++){var l=s[parseInt(a.toString(),10)],h=s[a-1];l.offset+=h.offset+h.size/2+n+l.size/2}i.roots.sort(function(e,t){return e.cells[0]&&t.cells[0]?i.model.roots.indexOf(e.cells[0].cell)-i.model.roots.indexOf(t.cells[0].cell):0});for(o=0;o<i.roots.length;o++){var d=i.roots[parseInt(o.toString(),10)];this.arrangeMatrix(d,null,i)}for(var p=0;p<i.matrix.length;p++)for(var c=i.matrix[parseInt(p.toString(),10)].value,a=0;a<c.length;a++){for(var u,g,m,f,y=(l=c[parseInt(a.toString(),10)]).visitedParents.slice(),v=0;v<l.visitedParents.length;v++){var b=l.visitedParents[parseInt(v.toString(),10)];b&&this.containsValue(b.ignoredChildren,l)&&y.splice(y.indexOf(b),1)}1<y.length&&(u=y[0],f=y[y.length-1],m=this.findParentVertexCellGroup(u),g=this.findParentVertexCellGroup(f),u!==m&&m.offset<u.offset&&(u=m),g=((f=f!==g&&g.offset>f.offset?m:f).offset+.5*f.size+u.offset-.5*u.size)/2,m=l.initialOffset,(f=l.offset)!==m)&&(this.seenCells=[],m<=g&&g<=f?this.translateMatrixCells(g-l.offset,l):g<m&&this.translateMatrixCells(m-l.offset,l),this.seenCells=[])}this.setXYforMatrixCell(i)},rMi.prototype.groupLayoutCells=function(e){for(var t=e.model.ranks,i=t.length-1;0<=i;i--){for(var n=[],o=0;o<t[parseInt(i.toString(),10)].length;o++){var r=t[parseInt(i.toString(),10)][parseInt(o.toString(),10)];"internalVertex"===this.getType(r.type)&&n.push(t[parseInt(i.toString(),10)][parseInt(o.toString(),10)])}for(var s=[],a=0;a<t[parseInt(i.toString(),10)].length;a++){r=t[parseInt(i.toString(),10)][parseInt(a.toString(),10)];"internalEdge"===this.getType(r.type)&&s.push(r)}for(;1<n.length;){for(var l=n[0],h=this.selectIds(l.connectsAsTarget,!0),d=this.selectIds(l.connectsAsSource,!1);1<n.length;){var p=n[1],c=this.selectIds(p.connectsAsTarget,!0),u=this.selectIds(p.connectsAsSource,!1),c=this.compareLists(h,c),u=this.compareLists(d,u);if(!c||!u)break;this.updateMutualSharing(n[0],p.id),this.updateMutualSharing(n[1],l.id),n.splice(1,1)}n.splice(0,1)}for(;1<s.length;){var g=s[0],m=g.source,f=g.target;if(null!=m.identicalSibiling){for(var y=[],v=0;v<s.length;v++){var b=s[parseInt(v.toString(),10)];b.target===f&&y.push(b)}for(v=0;v<y.length;v++){var w=y[parseInt(v.toString(),10)];this.containsValue(m.identicalSibiling,w.source.id)&&(w.source.identicalSibiling=null)}g.source.identicalSibiling=null}s.splice(0,1)}}},rMi.prototype.createMatrixCells=function(i){for(var e=i.model.layout,t="LeftToRight"===e.orientation||"RightToLeft"===e.orientation,n=t?e.verticalSpacing:e.horizontalSpacing,o=t?e.horizontalSpacing:e.verticalSpacing,r=i.model.ranks,s=[],a=-o,l=r.length-1;0<=l;l--){var h=0,d=r.length-1-l,p=r[parseInt(l.toString(),10)].slice(),c=[],u=(i.matrix.push({key:d,value:c}),[]);for(s.push({index:d,value:u});0<p.length;){var g=p[0],m={level:d,parents:[],children:[],visitedParents:[],visitedChildren:[],ignoredChildren:[],cells:[],size:0,offset:0,initialOffset:0},f=(c.push(m),this.getType(g.type));if("internalVertex"===f){if(m.cells.push(g),null!=g.identicalSibiling)for(var y=0;y<p.length;y++){var v=p[parseInt(y.toString(),10)],b=this.getType(v.type);if("internalVertex"===b&&this.containsValue(g.identicalSibiling,v.id)&&(m.cells.push(v),m.cells.length>g.identicalSibiling.length))break}for(y=0;y<m.cells.length;y++){v=m.cells[parseInt(y.toString(),10)];if("internalVertex"===this.getType(v.type)){var w=v.cell.geometry;if(m.size+=t?w.height:w.width,h=Math.max(h,t?w.width:w.height),u.push({key:v.id,value:m}),0<v.connectsAsTarget.length)for(var C=0;C<v.connectsAsTarget.length;C++){var S=v.connectsAsTarget[parseInt(C.toString(),10)],A=null;if(this.containsValue(s[d-1].value,S.ids)?A=S.ids:this.containsValue(s[d-1].value,S.source.id)&&(A=S.source.id),null!=A){for(var x=s[d-1].value,I=void 0,T=0;T<x.length;T++)if(x[parseInt(T.toString(),10)].key===A){I=x[parseInt(T.toString(),10)].value;break}this.containsValue(m.parents,I)||m.parents.push(I),this.containsValue(I.children,m)||I.children.push(m)}}var E=m.cells[parseInt(y.toString(),10)];-1!==p.indexOf(E)&&p.splice(p.indexOf(E),1)}}m.size+=(m.cells.length-1)*n}else if("internalEdge"===f){m.cells.push(g);for(y=0;y<m.cells.length;y++){var D=m.cells[parseInt(y.toString(),10)];if("internalEdge"===this.getType(D.type)&&null!=D.edges){for(var M=-5,C=0;C<D.edges.length;C++)M+=6;m.size+=M}u.push({key:D.ids,value:m});A=null;if(this.containsValue(s[d-1].value,D.ids)?A=D.ids:this.containsValue(s[d-1].value,D.source.id)&&(A=D.source.id),null!=A){for(var k=s[d-1].value,I=void 0,T=0;T<k.length;T++)if(k[parseInt(T.toString(),10)].key===A){I=k[parseInt(T.toString(),10)].value;break}this.containsValue(m.parents,I)||m.parents.push(I),this.containsValue(I.children,m)||I.children.push(m)}E=m.cells[parseInt(y.toString(),10)];-1!==p.indexOf(E)&&p.splice(p.indexOf(E),1)}m.size+=(m.cells.length-1)*n}if(m.cells.length){f=m.cells.filter(function(e){return"internalVertex"===e.type});if(0<f.length)for(var P=0,B=f;P<B.length;P++)if("break"===function(e){var t=e.cell;if(i.model.roots.some(function(e){return e===t}))return i.roots.push(m),"break"}(B[P]))break}}i.rowOffset.push(a+h/2+o),a+=h+o}},rMi.prototype.arrangeMatrix=function(e,t,i){var n=i.model.layout,n="LeftToRight"===n.orientation||"RightToLeft"===n.orientation?n.verticalSpacing:n.horizontalSpacing,o=i.matrix,r=o[e.level].value,s=r.indexOf(e);if(0<e.visitedParents.length&&(1===e.visitedParents.length&&(e.initialOffset=e.offset),!this.containsValue(e.visitedParents,t))){var a=e.visitedParents[e.visitedParents.length-1],o=o[a.level].value,l=o.indexOf(a),o=o.indexOf(t),h=s+1<r.length?r[s+1]:void 0;if(-1!==a.ignoredChildren.indexOf(e)||o-l!=1||h&&0<h.visitedParents.length)return e.visitedParents.push(t),void t.ignoredChildren.push(e)}if(0<e.children.length){for(var d=0;d<e.children.length;d++){var p=e.children[parseInt(d.toString(),10)];this.containsValue(e.visitedChildren,p)||(this.arrangeMatrix(p,e,i),e.visitedChildren.push(p))}if(0<e.visitedChildren.length){for(var c=e.visitedChildren.slice(),d=0;d<e.ignoredChildren.length;d++){var u=e.ignoredChildren[parseInt(d.toString(),10)];this.containsValue(c,u)&&c.splice(c.indexOf(u),1)}0<c.length&&(a=c[0],o=c[c.length-1],(l=(a.offset-a.size/2+(o.offset+o.size/2))/2)<e.offset?this.shiftMatrixCells(e.offset-l,a,!0,e,i):l>e.offset&&this.shiftMatrixCells(l-e.offset,e,!1,null,i))}}else{h=e.offset;0<s&&(h=(o=r[s-1]).offset+o.size/2+n+e.size/2),this.shiftMatrixCells(h-e.offset,e,!1,null,i)}this.containsValue(e.visitedParents,t)||e.visitedParents.push(t)},rMi.prototype.findParentVertexCellGroup=function(e){return!e.cells[0]&&0<e.parents.length?this.findParentVertexCellGroup(e.parents[0]):e},rMi.prototype.translateMatrixCells=function(e,t){if(0!==e&&-1===this.seenCells.indexOf(t)&&(this.seenCells.push(t),t.offset+=e,0<t.visitedChildren.length))for(var i=0;i<t.visitedChildren.length;i++){var n=t.visitedChildren[parseInt(i.toString(),10)];-1===t.ignoredChildren.indexOf(n)&&this.translateMatrixCells(e,n)}},rMi.prototype.setXYforMatrixCell=function(e){for(var t=e.model.layout,i="LeftToRight"===t.orientation||"RightToLeft"===t.orientation,n=i?t.verticalSpacing:t.horizontalSpacing,o=0;o<e.matrix.length;o++)for(var r=e.matrix[parseInt(o.toString(),10)].value,s=0;s<r.length;s++)for(var a=r[parseInt(s.toString(),10)],l=a.offset-a.size/2,h=0;h<a.cells.length;h++){var d=a.cells[parseInt(h.toString(),10)],p=this.getType(d.type);if("internalVertex"===p){var c=d,u=c.cell.geometry.width,g=c.cell.geometry.height;c.cell.geometry=i?new tfi(e.rowOffset[a.level]-u/2,l,u,g):new tfi(l,e.rowOffset[a.level]-g/2,u,g),l+=(i?g:u)+n}else if("internalEdge"===p){var m=d,f=a.visitedParents[0];if(f)for(var y=0;y<f.visitedChildren.length;y++){for(var v=f.visitedChildren[parseInt(y.toString(),10)],b=[],w=0;w<v.cells.length;w++){var C=v.cells[parseInt(w.toString(),10)];"internalVertex"===this.getType(C.type)&&b.push(C)}if(0<b.length)break}for(w=0;w<m.edges.length;w++){var S=m.edges[parseInt(w.toString(),10)],A=this.getPointvalue(l+.5,e.rowOffset[a.level]);if(i&&(A=this.getPointvalue(e.rowOffset[a.level],l+.5)),this.containsValue(this.getEdgeMapper(),S)){for(var x=void 0,y=0;y<this.getEdgeMapper().length;y++)if(this.getEdgeMapper()[parseInt(y.toString(),10)].key===S){x=y;break}this.getEdgeMapper()[parseInt(x.toString(),10)].value.push(A)}l+=6}l+=n}}},rMi.prototype.getType=function(e){return"internalVertex"===e?"internalVertex":"internalEdge"},rMi.prototype.selectIds=function(e,t){for(var i=[],n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)];i.push((t?o.source:o.target).id)}return i},rMi.prototype.compareLists=function(e,t){var i=e.slice(),n=t.slice();if(i.length!==n.length)return!1;if(0===i.length)return!0;for(var o=!0,r=0;r<n.length;r++){var s=n[parseInt(r.toString(),10)];if(-1===i.indexOf(s)){o=!1;break}}return o},rMi.prototype.updateMutualSharing=function(e,t){null!=e.identicalSibiling||(e.identicalSibiling=[]),e.identicalSibiling.push(t)},rMi.prototype.containsValue=function(e,t){for(var i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].key===t||e[parseInt(i.toString(),10)]===t)return!0;return!1},rMi.prototype.shiftMatrixCells=function(e,t,i,n,o){if(0!==e){for(var r=o.matrix[t.level].value,s=r.indexOf(t),a=s;a<r.length;a++)r[parseInt(a.toString(),10)].offset+=e;if(i)if(0<t.visitedChildren.length){for(var l=void 0,a=0;a<t.visitedChildren.length;a++){var h=t.visitedChildren[parseInt(a.toString(),10)];if(-1===t.ignoredChildren.indexOf(h)){l=h;break}}l&&this.shiftMatrixCells(e,l,!0,t,o)}else{for(var a=1,d=null;s+a<r.length;){var p=r[s+a];if(0<p.visitedChildren.length&&p.visitedChildren.length>p.ignoredChildren.length){d=p;break}a++}if(null!=d){for(var l=void 0,c=0;c<d.visitedChildren.length;c++){h=d.visitedChildren[parseInt(c.toString(),10)];if(-1===d.ignoredChildren.indexOf(h)){l=h;break}}l&&this.shiftMatrixCells(e,l,!0,d,o)}}}},rMi.prototype.getPointvalue=function(e,t){return{x:Number(e)||0,y:Number(t)||0}},rMi.prototype.getEdgeMapper=function(){return this.edgeMapper},rMi.prototype.setEdgeMapper=function(e){this.edgeMapper.push(e)},rMi.prototype.updateLayout=function(e,t,i,n,o,r){for(var s=(e.x-t.width)/2-t.x,e=(e.y-t.height)/2-t.y,s=Math.round(s),e=Math.round(e),a=[],l=new tfi(t.x+s,t.y+e,t.width,t.height),h=(i.margin,"RightToLeft"===n.orientation||"LeftToRight"===n.orientation?n.horizontalSpacing:n.verticalSpacing),d=0;d<o.length;d++){var p=o[parseInt(d.toString(),10)];if(null!=p.outEdges&&0<p.outEdges.length)for(var c=p.outEdges.length,u=0;u<c;u++){if((I=r[p.outEdges[parseInt(u.toString(),10)]]).pointCollection=[],1<c){for(var g,m,f=h/2,y=null,v=-1,b=this.getEdgeMapper(),w=0;w<b.length;w++)if(b[parseInt(w.toString(),10)].key===I){v=w;break}-1!==v&&0<b[parseInt(v.toString(),10)].value.length&&(D=g=(m=b[parseInt(v.toString(),10)].value[0]).x+n.marginX,M=m=m.y+n.marginY,"BottomToTop"===n.orientation?M=t.height-m:"RightToLeft"===n.orientation&&(D=t.width-g),y=this.getPointvalue(D,M),I.segments=[],this.diagram.connectorPropertyChange(I,{},{type:"Orthogonal",segments:I.segments}));for(var C=[],S=0;S<I.segments.length;S++)for(k in x=I.segments[parseInt(S.toString(),10)].points)C.push(x[parseInt(k.toString(),10)]);if(C=this.updateConnectorPoints(C,f,y,l,n.orientation),null!=y&&"DifferentPoint"!==this.diagram.layout.connectionPointOrigin)for(var A=0;A<C.length;A++){var x=C[parseInt(A.toString(),10)];I.pointCollection.push(this.getPointvalue(x.x,x.y))}this.resetConnectorPoints(I)}a.push(I)}if(null!=p.inEdges&&1<p.inEdges.length)for(c=p.inEdges.length,b=this.getEdgeMapper(),u=0;u<c;u++){var I=r[p.inEdges[parseInt(u.toString(),10)]];if(this.containsValue(a,I)||(I.pointCollection=[]),1<c){for(var T,E,D,M,f=h/2,y=null,v=-1,w=0;w<b.length;w++)if(b[parseInt(w.toString(),10)].key===I){v=w;break}-1!==v&&0<b[parseInt(v.toString(),10)].value.length&&!this.containsValue(a,I)&&(D=T=(E=b[parseInt(v.toString(),10)].value[0]).x+n.marginX,M=E=E.y+n.marginY,"BottomToTop"===n.orientation?M=t.height-E:"RightToLeft"===n.orientation&&(D=t.width-T),y=this.getPointvalue(D,M),I.segments=[],this.diagram.connectorPropertyChange(I,{},{type:"Orthogonal",segments:I.segments}));for(var k,C=[],A=0;A<I.segments.length;A++)for(k in x=I.segments[parseInt(A.toString(),10)].points)C.push(x[parseInt(k.toString(),10)]);if(C.reverse(),(C=this.updateConnectorPoints(C,f,y,l,i.orientation)).reverse(),I.pointCollection=[],null!=y&&"DifferentPoint"!==this.diagram.layout.connectionPointOrigin)for(A=0;A<C.length;A++){x=C[parseInt(A.toString(),10)];I.pointCollection.push(this.getPointvalue(x.x,x.y))}this.resetConnectorPoints(I)}}}},rMi.prototype.inflate=function(e,t,i){return e.x-=t,e.y-=i,e.width+=2*t,e.height+=2*i,e},rMi.prototype.updateConnectorPoints=function(e,t,i,n,o){var r,s,a,l,o="LeftToRight"===o||"RightToLeft"===o,h=e[0],d=e[e.length-1];return null!=i?(a=Hmi.transform(h,Hmi.findAngle(h,e[1]),t),r=Hmi.transform(d,Hmi.findAngle(d,e[e.length-2]),t),l=this.getPointvalue(i.x,a.y),s=this.getPointvalue(i.x,r.y),o&&(l.x=a.x,l.y=i.y,s.x=r.x,s.y=i.y),0===Math.abs(Hmi.findLength(s,r))?[h,a,l,d]:[h,a,l,s,r,d]):4===e.length?(a=Hmi.transform(h,Hmi.findAngle(h,e[1]),t),l=this.getPointvalue(e[2].x,a.y),o&&(l.x=a.x,l.y=e[2].y),[h,a,l,d]):e},rMi.prototype.resetConnectorPoints=function(e){if(e.pointCollection&&0<e.pointCollection.length){(l=e).sourcePoint=e.pointCollection[0],l.targetPoint=e.pointCollection[e.pointCollection.length-1];for(var t=[],i=0;i<e.pointCollection.length-1;i++){var n=e.pointCollection[parseInt(i.toString(),10)],o=e.pointCollection[i+1],r=M1i(n,o),s=C1i(n,o);i===e.pointCollection.length-2&&("RightToLeft"===this.diagram.layout.orientation&&"Left"===s||"LeftToRight"===this.diagram.layout.orientation&&"Right"===s||"TopToBottom"===this.diagram.layout.orientation&&"Bottom"===s||"BottomToTop"===this.diagram.layout.orientation&&"Top"===s)&&(r/=2),(h=new sSi(e,"segments",{type:"Orthogonal"},!0)).length=r,h.direction=s,t.push(h)}l.segments=t,l.type="Orthogonal",this.diagram.connectorPropertyChange(l,{},{type:"Orthogonal",segments:l.segments})}else if("DifferentPoint"===this.diagram.layout.connectionPointOrigin){var a="obstaclePointCollection";if(e.segments[0].points&&0<e.segments[0].points.length&&e[a]){(l=e).sourcePoint=e[a][0],l.targetPoint=e[a][e[a].length-1];for(var l,t=[],i=0;i<e[a].length-1;i++){var h,n=e[a][parseInt(i.toString(),10)],o=e[a][i+1],d=M1i(n,o),s=C1i(n,o);i===e[a].length-2&&("RightToLeft"===this.diagram.layout.orientation&&"Left"===s||"LeftToRight"===this.diagram.layout.orientation&&"Right"===s||"TopToBottom"===this.diagram.layout.orientation&&"Bottom"===s||"BottomToTop"===this.diagram.layout.orientation&&"Top"===s)&&(d/=2),(h=new sSi(e,"segments",{type:"Orthogonal"},!0)).length=d,h.direction=s,t.push(h)}l.segments=t,l.type="Orthogonal",this.diagram.connectorPropertyChange(l,{},{type:"Orthogonal",segments:l.segments})}}},rMi.prototype.nodePropertyChange=function(e){this.diagram.nodePropertyChange(e,{},{offsetX:e.offsetX,offsetY:e.offsetY})};var oMi=rMi;function rMi(){this.edgeMapper=[]}aMi.prototype.createInternalCells=function(e,t){for(var i=0;i<e.length;i++)for(var n=e[parseInt(i.toString(),10)],o={tempRank:-1,cell:n,hashCode:[],maxRank:null,minRank:null,id:n.id,internalOutEdges:[],internalInEdges:[],identicalSibling:[]},r=(t.push(o),this.vertexMapper.set(n.id,o),this.layout.getEdges(n)),s=0;s<r.length;){var a=r[parseInt(s.toString(),10)],a=this.layout.getVisibleTerminal(a,!1);if(a!==n){var l=this.layout.getEdgesBetween(n,a,!0);if(0<l.length){for(var h={connectorIds:[],edges:l,ids:[],isReversed:!1,source:null,target:null,tempRank:0,maxRank:null,minRank:null},d=0;d<l.length;d++){var p=l[parseInt(d.toString(),10)];h.ids.push(p.id),-1!==r.indexOf(p)&&(r.indexOf(p)<s&&s--,r.splice(r.indexOf(p),1))}-1===(h.source=o).internalOutEdges.indexOf(h)&&o.internalOutEdges.push(h)}}else s++}},aMi.prototype.layeringStage=function(){this.recycleConnectors(),this.initialRank(),this.fixRanks()},aMi.prototype.recycleConnectors=function(){var e=[this.rootNode];this.visit(e,!0)},aMi.prototype.initialRank=function(){for(var e=[this.rootNode],t=Array.from(this.vertexMapper.values());0<e.length;){for(var i,n=e[0],o=n.internalOutEdges,r=n.internalInEdges,s=!0,a=1e8,l=0;l<r.length;l++){if(5270620!==(u=r[parseInt(l.toString(),10)]).tempRank){s=!1;break}a=(g=u.source).tempRank?Math.min(a,g.tempRank-1):a}if(s){if(n.tempRank=a,this.maxRank=Math.min(this.maxRank,a),o.length){n.cell.isDecisionNode&&(i=o.find(function(e){return e.target.cell.isYesChild}),h=o.find(function(e){return e.target.cell.isDecisionNode}),-1===o.indexOf(h)&&0!==o.indexOf(i)&&o.reverse(),"RightInFlow"===this.layout.yesBranchDirection||"SameAsFlow"===this.layout.yesBranchDirection&&"LeftInFlow"===this.layout.noBranchDirection)&&o.reverse();for(l=0;l<o.length;l++)(u=o[parseInt(l.toString(),10)]).tempRank=5270620,-1===(g=u.target).tempRank&&(g.tempRank=-2,e.push(g))}e.shift()}else{var h=e.shift();if(e.push(n),h===n&&1===e.length)break}}for(l=0;l<t.length;l++)t[parseInt(l.toString(),10)].tempRank-=this.maxRank;for(var d=0,p=this.rootNode.internalOutEdges,c=0;c<p.length;c++){var u,g=(u=p[parseInt(c.toString(),10)]).target;this.rootNode.tempRank=void 0!==g.tempRank&&null!==g.tempRank?Math.max(d,g.tempRank+1):d,d=this.rootNode.tempRank}this.maxRank=1e8-this.maxRank},aMi.prototype.fixRanks=function(){var e=new Map;this.ranks=new Map;for(var t=0;t<=this.maxRank;t++)e.set(t,[]),this.ranks.set(t,e.get(t));var i=[this.rootNode];this.visit(i,!1,e)},aMi.prototype.visit=function(e,t,i){if(void 0===i&&(i=null),e){for(var n=0;n<e.length;n++){var o,r=e[parseInt(n.toString(),10)];r&&(o=new Map,t?(r.hashCode=[this.dfsCount,n],this.extendedDfs(null,r,null,o,n)):this.depthFirstSearch(null,r,null,o,i))}this.dfsCount++}},aMi.prototype.extendedDfs=function(e,n,t,o,i){var r=this,i=(!e||n.hashCode&&n.hashCode[0]===e.hashCode[0]||(n.hashCode=e.hashCode.concat([i])),n.id);o.has(i)?this.removeConnectionEdge(e,n,t):(o.set(i,n),this.removeConnectionEdge(e,n,t),n.internalOutEdges.slice().forEach(function(e,t){var i=e.target;r.extendedDfs(n,i,e,o,t)}))},aMi.prototype.removeConnectionEdge=function(e,t,i){e&&this.isAncestor(t,e)&&(this.invert(i),this.remove(i,e.internalOutEdges),e.internalInEdges.push(i),this.remove(i,t.internalInEdges),t.internalOutEdges.push(i))},aMi.prototype.invert=function(e){var t=e.source;e.source=e.target,e.target=t,e.isReversed=!e.isReversed},aMi.prototype.remove=function(e,t){e=t.indexOf(e);t.splice(e,1)},aMi.prototype.isAncestor=function(e,t){if(null!==t&&null!==e.hashCode&&null!==t.hashCode&&e.hashCode.length<t.hashCode.length){if(e.hashCode!==t.hashCode)for(var i=0;i<e.hashCode.length;i++)if(e.hashCode[parseInt(i.toString(),10)]!==t.hashCode[parseInt(i.toString(),10)])return!1;return!0}return!1},aMi.prototype.depthFirstSearch=function(e,i,t,n,o){var r=this,s=i.id;n.has(s)?this.updateMinMaxRank(e,i,t,1,o):(n.set(s,i),this.updateMinMaxRank(e,i,t,0,o),i.internalOutEdges.slice().forEach(function(e){var t=e.target;r.depthFirstSearch(i,t,e,n,o)}))},aMi.prototype.updateMinMaxRank=function(e,t,i,n,o){var r=Array.from(o.values());if(null==t.maxRank&&0!==t.maxRank&&(t.maxRank=-1),null==t.minRank&&0!==t.minRank&&(t.minRank=-1),0===n&&t.maxRank<0&&t.minRank<0&&0<=t.tempRank&&(o=t.tempRank,r[parseInt(o.toString(),10)].push(t),t.maxRank=o,t.minRank=o,t.tempRank=r[t.maxRank].length-1),null!==e&&null!==i)if(1<e.maxRank-t.maxRank){i.maxRank=e.maxRank,i.minRank=t.maxRank;for(var s=i.minRank+1;s<i.maxRank;s++)r[parseInt(s.toString(),10)].push(i)}else if(i.isReversed){i.maxRank=e.maxRank,i.minRank=t.maxRank;for(s=i.minRank;s<=i.maxRank;s++)r[parseInt(s.toString(),10)].push(i)}};var sMi=aMi;function aMi(e,t,i){var r=this,e=(this.dfsCount=0,this.maxRank=1e8,this.layout=e,this.vertexMapper=new Map,this.ranks=new Map,[]);this.createInternalCells(i,e),e.forEach(function(o){o.internalOutEdges.forEach(function(e){var t,i,n=e.edges;n&&0<n.length&&(n=n[0],t=r.layout.getVisibleTerminal(n,!1),i=r.vertexMapper.get(t.id),o===i&&(t=r.layout.getVisibleTerminal(n,!0),i=r.vertexMapper.get(t.id)),i)&&o!==i&&(e.target=i,-1===o.internalInEdges.indexOf(e))&&i.internalInEdges.push(e)})}),this.rootNode=this.vertexMapper.get(t.id)}hMi.prototype.arrangeElements=function(){if(null!==this.flowchartModel){var e=this.flowchartModel.layout,t="LeftToRight"===e.orientation?e.verticalSpacing:e.horizontalSpacing;this.groupLayoutCells(),this.createMatrixCells();for(var i=0,n=this.matrix;i<n.length;i++)for(var o=n[i],r=1;r<o.length;r++){var s=o[parseInt(r.toString(),10)],a=o[r-1];s.offset+=a.offset+a.size/2+t+s.size/2}for(var l=0,h=this.matrix[0];l<h.length;l++){var d=h[l];this.arrangeMatrix(d,null)}for(var p=0,c=this.matrix;p<c.length;p++)for(var u=c[p],r=0;r<u.length;r++)if(1<(s=u[parseInt(r.toString(),10)]).visitedParents.length){var g=s.visitedParents[0],m=s.visitedParents[s.visitedParents.length-1],f=this.findParentVertexCellGroup(g),y=this.findParentVertexCellGroup(m),v=(g!==f&&f.offset<g.offset&&(g=f),m!==y&&y.offset>m.offset&&(m=f),(g.offset+m.offset)/2),y=s.cells.find(function(e){return"internalInEdges"in e&&"internalOutEdges"in e});if("SameAsFlow"===this.flowchartModel.layout.yesBranchDirection){var b=s.visitedParents.slice();if(y&&y.cell.isYesChild){for(var w=0,C=b;w<C.length;w++)if(!(D=(E=C[w]).cells.find(function(e){return"internalInEdges"in e&&"internalOutEdges"in e}))){v=E.offset;break}}else{"LeftInFlow"===this.flowchartModel.layout.noBranchDirection&&b.reverse();for(var S=0,A=b;S<A.length;S++)if(D=(E=A[S]).cells.find(function(e){return"internalInEdges"in e&&"internalOutEdges"in e})){if(D.cell.isYesChild){v=E.offset;break}}else{var x=this.findParentVertexCellGroup(E);if(x)if((P=x.cells.find(function(e){return"internalInEdges"in e&&"internalOutEdges"in e}))&&P.cell.isYesChild){v=E.offset;break}}}}else if("SameAsFlow"===this.flowchartModel.layout.noBranchDirection){b=s.visitedParents.slice();if(y&&y.cell.isNoChild){for(var I=0,T=b;I<T.length;I++)if(!(D=(E=T[I]).cells.find(function(e){return"internalInEdges"in e&&"internalOutEdges"in e}))){v=E.offset;break}}else{"LeftInFlow"===this.flowchartModel.layout.yesBranchDirection&&b.reverse();for(var E,D,M=0,k=b;M<k.length;M++)if(D=(E=k[M]).cells.find(function(e){return"internalInEdges"in e&&"internalOutEdges"in e})){if(D.cell.isNoChild){v=E.offset;break}}else{var P,x=this.findParentVertexCellGroup(E);if(x)if((P=x.cells.find(function(e){return"internalInEdges"in e&&"internalOutEdges"in e}))&&P.cell.isNoChild){v=E.offset;break}}}}f=s.initialOffset,g=s.offset;g!==f&&(f<=v&&v<=g?this.translateMatrixCells(v-s.offset,s):v<f&&this.translateMatrixCells(f-s.offset,s))}this.setXYForMatrixCell()}},hMi.prototype.arrangeMatrix=function(e,t){var i=this.flowchartModel.layout,i="LeftToRight"===i.orientation?i.verticalSpacing:i.horizontalSpacing,n=this.matrix[e.level],o=n.indexOf(e);if(e.visitedParents.length&&(1===e.visitedParents.length&&(e.initialOffset=e.offset),o+1<n.length)){var r=n[o+1];if(r.visitedParents.length&&-1===e.visitedParents.indexOf(t))return void(e.level!==t.level&&(e.visitedParents.push(t),t.ignoredChildren.push(e)))}if(e.children.length){for(var s=0,a=e.children;s<a.length;s++){var l=a[s];e.visitedChildren.indexOf(l)&&(this.arrangeMatrix(l,e),(e.level!==l.level?e.visitedChildren:e.loopChildren).push(l))}if(e.visitedChildren.length){for(var h,d,p,c=e.visitedChildren.slice(),u=0,g=e.ignoredChildren;u<g.length;u++)!function(t){c=c.filter(function(e){return e!==t})}(g[u]);c.length&&(r=c[0],h=c[c.length-1],d=(r.offset+h.offset)/2,e.cells.length&&(f=e.cells.filter(function(e){return"internalInEdges"in e&&"internalOutEdges"in e})[0],m=r.cells.filter(function(e){return"internalInEdges"in e&&"internalOutEdges"in e})[0],p=h.cells.filter(function(e){return"internalInEdges"in e&&"internalOutEdges"in e})[0],f)&&f.cell.isDecisionNode&&("SameAsFlow"===this.flowchartModel.layout.yesBranchDirection?m?d=(m.cell.isYesChild?r:h).offset:p&&(d=(p.cell.isYesChild?h:r).offset):"SameAsFlow"===this.flowchartModel.layout.noBranchDirection&&(m?d=(m.cell.isNoChild?r:h).offset:p&&(d=(p.cell.isNoChild?h:r).offset))),d<e.offset?this.shiftMatrixCells(e.offset-d,r,!0,e):d>e.offset&&this.shiftMatrixCells(d-e.offset,e))}}else{var m,f=e.offset;0<o&&(f=(m=n[o-1]).offset+m.size/2+i+e.size/2),this.shiftMatrixCells(f-e.offset,e)}-1===e.visitedParents.indexOf(t)&&null!==t&&e.level!==t.level&&e.visitedParents.push(t)},hMi.prototype.shiftMatrixCells=function(e,t,i,n){if(void 0===i&&(i=!1),void 0===n&&(n=null),0!==e){for(var o=this.matrix[t.level],r=o.indexOf(t),s=r;s<o.length;s++)o[parseInt(s.toString(),10)].offset+=e;if(i)if(t.visitedChildren.length)this.shiftMatrixCells(e,t.visitedChildren[0],!0,t);else{for(var s=1,a=null;r+s<o.length;){var l=o[r+s];if(null!==n&&-1!==l.visitedParents.indexOf(n)){if(!l.visitedChildren.length){s++;continue}a=l}break}null!==a&&this.shiftMatrixCells(e,a.visitedChildren[0],!0,a)}}},hMi.prototype.findParentVertexCellGroup=function(e){return!("internalInEdges"in e.cells[0]&&"internalOutEdges"in e.cells[0])&&e.parents.length?this.findParentVertexCellGroup(e.parents[0]):e},hMi.prototype.translateMatrixCells=function(e,t){if(0!==e&&(t.offset+=e,t.visitedChildren.length)){for(var i=0,n=t.visitedChildren;i<n.length;i++){var o=n[i];this.translateMatrixCells(e,o)}for(var r=0,s=t.loopChildren;r<s.length;r++){var a=s[r];this.translateMatrixCells(e,a)}}},hMi.prototype.getObjectValues=function(e){var t,i=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&i.push(e[""+t]);return i},hMi.prototype.setXYForMatrixCell=function(){var e=this.flowchartModel.layout,t="LeftToRight"===e.orientation,i=t?e.verticalSpacing:e.horizontalSpacing,n=0;this.siblingModel&&(e=this.getObjectValues(this.rowMaxDimension),e=Math.max.apply(Math,e),n=this.siblingModel.getSiblingDimension(e));for(var o=0,r=this.getObjectValues(this.matrix);o<r.length;o++)for(var s=0,a=r[o];s<a.length;s++){var l=a[s],h=l.offset-l.size/2;0!==n&&(h+=n+i);for(var d=0,p=l.cells;d<p.length;d++){var c=p[d];if("internalInEdges"in c&&"internalOutEdges"in c){var u=c,g=u.cell.geometry.width,m=u.cell.geometry.height;u.cell.geometry=t?new tfi(this.rowOffset[l.level]-g/2,h,g,m):new tfi(h,this.rowOffset[l.level]-m/2,g,m),h+=(t?m:g)+i}else if("edges"in c){var f=c,y=f.isReversed;if(!y){u=l.visitedParents[0];if(u)for(var v=0,b=u.visitedChildren;v<b.length;v++)if(b[v].cells.some(function(e){return"internalInEdges"in e&&"internalOutEdges"in e})){y=!0;break}}for(var w=0,C=f.edges;w<C.length;w++){var S,A=C[w];y&&(S={x:h+.5,y:this.rowOffset[l.level]},t&&(S={x:this.rowOffset[l.level],y:h+.5}),this.flowchartModel.layout.edgesMapper.has(A))&&(this.flowchartModel.layout.edgesMapper.get(A).push(S),this.flowchartModel.layout.loopedgesMapper.set(A,f.isReversed)),h+=6}h+=i}}}},hMi.prototype.getSiblingDimension=function(e){var t=this.flowchartModel.layout,i="LeftToRight"===t.orientation,t=i?t.horizontalSpacing:t.verticalSpacing,n=0;for(r in this.rowMaxDimension)if(Object.prototype.hasOwnProperty.call(this.rowMaxDimension,r)){if(!(this.rowMaxDimension[""+r]<e))break;n=parseInt(r,10)}this.rowMaxDimension[parseInt(n.toString(),10)]+t<=e&&this.rowMaxDimension[n+1]&&n++;var o=[];for(r in this.matrix)Object.prototype.hasOwnProperty.call(this.matrix,r)&&parseInt(r,10)<=n&&(o[""+r]=this.matrix[""+r]);var r,s,a,l,h,d,p,c=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(a=o[""+r]).length&&((h=a[s=0].cells[0])&&"cell"in h?(l=h.cell.geometry,s=i?l.y:l.x):h&&"edges"in h&&(d=h.edges[h.edges.length-1],(p=this.flowchartModel.layout.edgesMapper.get(d)).length)&&(s=i?p[0].y:p[0].x),h=0,(a=a[a.length-1].cells[a[a.length-1].cells.length-1])&&"cell"in a?(l=a.cell.geometry,h=i?l.y+l.height:l.x+l.width):a&&"edges"in a&&(d=a.edges[a.edges.length-1],(p=this.flowchartModel.layout.edgesMapper.get(d)).length)&&(h=i?p[0].y:p[0].x),c=Math.max(c,h-s));return c},hMi.prototype.createMatrixCells=function(){for(var e=this.flowchartModel.layout,t="LeftToRight"===e.orientation,i=t?e.verticalSpacing:e.horizontalSpacing,n=t?e.horizontalSpacing:e.verticalSpacing,e=this.flowchartModel.ranks,o=Array.from(e.values()),r={},s=-n,a=o.length-1;0<=a;a--){var l=0,h=o.length-1-a,d=o[parseInt(a.toString(),10)].slice(),p=[],c=(this.matrix[parseInt(h.toString(),10)]=p,{});for(r[parseInt(h.toString(),10)]=c;0<d.length;){var u=d[0],g={parents:[],children:[],visitedParents:[],visitedChildren:[],ignoredChildren:[],loopChildren:[],cells:[],level:h,initialOffset:0,size:0,offset:0};if(p.push(g),"internalInEdges"in u&&"internalOutEdges"in u){if(g.cells.push(u),u.identicalSibling)for(var m=0;m<d.length;m++){var f=d[parseInt(m.toString(),10)];if("internalInEdges"in f&&"internalOutEdges"in f&&-1!==u.identicalSibling.indexOf(f.id)&&(g.cells.push(f),g.cells.length>u.identicalSibling.length))break}for(var y=g.cells,m=0;m<y.length;m++)if("internalInEdges"in(f=y[parseInt(m.toString(),10)])&&"internalOutEdges"in f){var v=f.cell.geometry;if(g.size+=t?v.height:v.width,l=Math.max(l,t?v.width:v.height),c[f.id]=g,f.internalInEdges.length)for(var b=f.internalInEdges,w=0;w<b.length;w++){var C=b[parseInt(w.toString(),10)];C.isReversed||(T=null,r[h-1]&&Object.prototype.hasOwnProperty.call(r[h-1],C.ids)?T=C.ids:r[h-1]&&Object.prototype.hasOwnProperty.call(r[h-1],C.source.id)&&(T=C.source.id),null!==T&&(I=r[h-1][""+T],-1===g.parents.indexOf(I)&&g.parents.push(I),-1===I.children.indexOf(g))&&(I.children.length&&I.children[0].level===I.level?I.children.unshift(g):I.children.push(g)))}d.splice(d.indexOf(f),1)}g.size+=(g.cells.length-1)*i}else if("edges"in u){g.cells.push(u);for(y=g.cells,m=0;m<y.length;m++){var S=y[parseInt(m.toString(),10)];if("edges"in S&&S.edges){for(var A=-5,x=0;x<S.edges.length;x++){S.edges[parseInt(x.toString(),10)];A+=6}g.size+=A}var I,T=null;S.isReversed?r[parseInt(h.toString(),10)][S.ids]?T=S.ids:r[parseInt(h.toString(),10)][S.source.id]&&(T=S.source.id):r[h-1][S.ids]?T=S.ids:r[h-1][S.source.id]&&(T=S.source.id),null!==T&&(I=r[S.isReversed?h:h-1][""+T],-1===g.parents.indexOf(I)&&g.parents.push(I),-1===I.children.indexOf(g))&&I.children.push(g),c[S.ids]=g,d.splice(d.indexOf(S),1)}g.size+=(g.cells.length-1)*i}}this.rowOffset[parseInt(h.toString(),10)]=s+l/2+n,this.rowMaxDimension[parseInt(h.toString(),10)]=this.rowOffset[parseInt(h.toString(),10)]+l/2,s+=l+n}},hMi.prototype.groupLayoutCells=function(){var e=this.flowchartModel.ranks,t=Array.from(e.values());t.reverse();for(var i=t.length-1;0<=i;i--){for(var n=t[parseInt(i.toString(),10)].filter(function(e){return"internalInEdges"in e&&"internalOutEdges"in e}),s=t[parseInt(i.toString(),10)].filter(function(e){return"edges"in e&&"edges"in e});1<n.length;){var o=n[0];if(o.cell.isYesChild||o.cell.isNoChild);else for(var r=o.internalInEdges.map(function(e){return e.source.id}),a=o.internalOutEdges.map(function(e){return e.target.id});1<n.length;){var l=n[1],h=l.internalInEdges.map(function(e){return e.source.id}),d=l.internalOutEdges.map(function(e){return e.target.id}),h=this.compareLists(r,h),d=this.compareLists(a,d);if(!h||!d)break;this.updateMutualSharing(n[0],l.id),this.updateMutualSharing(n[1],o.id),n.splice(1,1)}n.shift()}for(;1<s.length;)!function(){var e=s[0],t=e.source,i=e.target;if(t.identicalSibling){for(var n=0,o=s.filter(function(e){return e.target===i});n<o.length;n++){var r=o[n];-1!==t.identicalSibling.indexOf(r.source.id)&&(r.source.identicalSibling=null)}e.source.identicalSibling=null}s.shift()}()}},hMi.prototype.updateMutualSharing=function(e,t){e.identicalSibling?e.identicalSibling.push(t):e.identicalSibling=[t]},hMi.prototype.compareLists=function(e,t){var i=e.slice(),e=t.slice();if(i.length!==e.length)return!1;if(0!==i.length)for(var n=0,o=e;n<o.length;n++){var r=o[n];if(-1===i.indexOf(r))return!1}return!0};var lMi=hMi;function hMi(e){this.flowchartModel=e,this.matrix=[],this.rowOffset=[],this.rowMaxDimension=[],this.siblingModel=null}dMi.prototype.updateLayout=function(e,t){this.diagram=t,this.yesBranchDirection=this.diagram.layout.flowchartLayoutSettings.yesBranchDirection,this.noBranchDirection=this.diagram.layout.flowchartLayoutSettings.noBranchDirection,this.yesBranchValues=this.diagram.layout.flowchartLayoutSettings.yesBranchValues||["Yes","True"],this.noBranchValues=this.diagram.layout.flowchartLayoutSettings.noBranchValues||["No","False"],this.orientation="TopToBottom"===this.diagram.layout.orientation||"BottomToTop"===this.diagram.layout.orientation?"TopToBottom":"LeftToRight",this.horizontalAlignment=this.diagram.layout.horizontalAlignment,this.verticalAlignment=this.diagram.layout.verticalAlignment,this.verticalSpacing=this.diagram.layout.verticalSpacing,this.horizontalSpacing=this.diagram.layout.horizontalSpacing,this.margin=this.diagram.layout.margin;var i=[],n=[];this.rootNodes=[],this.vertexMapper.clear(),this.edgesMapper.clear(),this.loopedgesMapper.clear();for(var o=0,r=e;o<r.length;o++){var s=r[o];s.excludeFromLayout||(u=this.createVertex(s),this.vertexMapper.set(u.id,u),n.push(u),u.inEdges&&0!==u.inEdges.length)||(i.push(u),this.rootNodes.push(s))}for(var a=null,l=0,h=i;l<h.length;l++){var d=h[l],p=[],d=(this.getTreeVertices(d,p,n),new sMi(this,d,p)),p=(d.layeringStage(),new lMi(d));p.siblingModel=a,p.arrangeElements(),a=p}var e=Array.from(this.vertexMapper.values()),c=this.getModelBounds(e);this.updateAnchor(c);for(var u,g,m="LeftToRight"===this.orientation?this.horizontalSpacing:this.verticalSpacing,f=[],y=0,v=e;y<v.length;y++)(u=v[y])&&((g=u.item)&&(g.offsetX=u.geometry.x+u.geometry.width/2+this.anchorX,g.offsetY=u.geometry.y+u.geometry.height/2+this.anchorY,u.inEdges&&0<u.inEdges.length||u.outEdges&&0<u.outEdges.length)&&f.push(g),t.dataBind());e=new tfi(c.x+this.anchorX,c.y+this.anchorY,c.width,c.height);this.nodeWithMultiEdges=f,this.inverseSpacing=m,this.transModelBounds=e,this.diagram.layout.flowChartData=this},dMi.prototype.reRouteFlowChartConnectors=function(e,t){this.diagram=t;for(var t=e.nodeWithMultiEdges,i=e.inverseSpacing,n=(this.orientation=e.orientation,"TopToBottom"===this.orientation),o=e.transModelBounds,r=(this.vertexMapper=e.vertexMapper,this.loopedgesMapper=e.loopedgesMapper,this.edgesMapper=e.edgesMapper,this.anchorX=e.anchorX,this.anchorY=e.anchorY,[]),s=0,a=t;s<a.length;s++){var l=a[s];if(l.outEdges&&0<l.outEdges.length)for(var h=0,d=l.outEdges;h<d.length;h++){var p,c,u,g=d[h],m=this.diagram.nameTable[""+g];this.loopedgesMapper.has(m)&&this.loopedgesMapper.get(m)?-1===r.indexOf(m)&&(this.updateLoopConnector(m),r.push(m)):(S=[],1<l.outEdges.length?(v=i/2,b=null,this.edgesMapper.has(m)&&(w=this.edgesMapper.get(m)[0])&&(b={x:w.x+this.anchorX,y:w.y+this.anchorY}),m.segments=[],m.intermediatePoints=[],C=[m.sourcePoint,m.targetPoint],2<(C=n?(S=this.updateVerticalConnectorSegments(m,C),p=this.diagram.nameTable[m.sourceID],!this.vertexMapper.get(p.id).isDecisionNode&&S.length<=2?this.updateConnectorPoints(S,v,b,o):S):S=this.updateHorizontalSegments(m,C)).length&&this.updatePoints(C,m),r.push(m)):4===m.intermediatePoints.length&&(p=m.intermediatePoints[0],c=m.intermediatePoints[3],u=n?{x:p.x,y:c.y-20}:{x:c.x-20,y:p.y},this.updatePoints([p,u,c],m),r.push(m)))}if(l.inEdges&&1<l.inEdges.length)for(var f=0,y=l.inEdges;f<y.length;f++){var v,b,w,C,S,g=y[f],m=this.diagram.nameTable[""+g];-1===r.indexOf(m)&&(m.segments[0].points=[],this.loopedgesMapper.has(m)&&this.loopedgesMapper.get(m)?(this.updateLoopConnector(m),r.push(m)):1<l.inEdges.length&&(v=i/2,b=null,this.edgesMapper.has(m)&&-1===r.indexOf(m)&&(w=this.edgesMapper.get(m)[0])&&(b={x:w.x+this.anchorX,y:w.y+this.anchorY}),m.segments=[],C=[m.targetPoint,m.sourcePoint],S=[],S=n?this.updateVerticalConnectorSegments(m,C):this.updateHorizontalSegments(m,C),(C=this.updateConnectorPoints(S,v,b,o)).reverse(),2<C.length)&&this.updatePoints(C,m))}}},dMi.prototype.updateAnchor=function(e){var t=this.diagram.scrollSettings.viewPortWidth,i=this.diagram.scrollSettings.viewPortHeight;"TopToBottom"===this.orientation?(this.anchorX=t/2-e.width/2-e.x,this.anchorY=this.margin.top):(this.anchorX=this.margin.left,this.anchorY=i/2-e.height/2-e.y),1===this.rootNodes.length&&(t=this.rootNodes[0],t=(i=this.vertexMapper.get(t.id).geometry).x+i.width/2,i=i.y+i.height/2,t=t-(e.x+e.width/2),i=i-(e.y+e.height/2),"TopToBottom"===this.orientation?this.anchorX-=t:this.anchorY-=i)},dMi.prototype.updateConnectorPoints=function(e,t,i,n){var o,r="LeftToRight"===this.orientation,s=e.slice();function a(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*(180/Math.PI)}function l(e,t,i){i*=Math.PI/180;return{x:e.x+t*Math.cos(i),y:e.y+t*Math.sin(i)}}if(2<s.length){var e=l(s[0],t,a(s[0],s[1])),h=l(e,(d=s[1],h=d.x-e.x,d=d.y-e.y,Math.sqrt(h*h+d*d)),a(e,s[2]));if(s.splice(1,0,h),s.splice(1,0,e),s.splice(3,2),null!=i){var d=s.length,p=l(s[d-1],t,a(s[d-1],s[d-2]));for(s.splice(d-1,0,p);2<s.length-2;)s.splice(2,1);var c,u,d,h=i;this.inflate(n,n.width,n.height),d=(d=(e=r?(c=[{x:n.left,y:h.y},{x:n.right,y:h.y}],u=[{x:s[1].x,y:n.top},{x:s[1].x,y:n.bottom}],[{x:p.x,y:n.top},{x:p.x,y:n.bottom}]):(c=[{x:h.x,y:n.top},{x:h.x,y:n.bottom}],u=[{x:n.left,y:s[1].y},{x:n.right,y:s[1].y}],[{x:n.left,y:p.y},{x:n.right,y:p.y}]),[]),this.diagram.commandHandler.intersect(c,u,!(h=[]))),(h=this.diagram.commandHandler.intersect(c,e,!1)).length&&s.splice(2,0,h[0]),d.length&&s.splice(2,0,d[0])}}else 2===s.length&&null!=i&&(n=s[0],u=s[1],p=l(n,t,c=a(s[0],s[1])),e=l(u,t,(c+180)%360),s.splice(1,0,e),h=r?(o={x:p.x,y:i.y},{x:e.x,y:i.y}):(o={x:i.x,y:p.y},{x:i.x,y:e.y}),s.splice(1,0,h),s.splice(1,0,o),s.splice(1,0,p));return s},dMi.prototype.inflate=function(e,t,i){e.x-=t,e.y-=i,e.width+=2*t,e.height+=2*i},dMi.isBranchConnector=function(e,t){var i;return!!(0<e.annotations.length&&e.annotations[0].content)&&(i=e.annotations[0].content,t.some(function(e){return 0===i.localeCompare(e,void 0,{sensitivity:"accent"})}))},dMi.prototype.isYesBranchConnector=function(e){return dMi.isBranchConnector(e,this.yesBranchValues)},dMi.prototype.isNoBranchConnector=function(e){return dMi.isBranchConnector(e,this.noBranchValues)},dMi.prototype.updateHorizontalSegments=function(e,t){var i,n,o,r,s=[],a=this.diagram.nameTable[e.sourceID],l=this.diagram.nameTable[e.targetID],h=this.vertexMapper.get(a.id).isDecisionNode,d=this.horizontalSpacing/2,p=this.verticalSpacing/2;return h?(h=this.isYesBranchConnector(e),e=this.isNoBranchConnector(e),l.wrapper.bounds.containsPoint({x:l.offsetX,y:a.offsetY})||a.offsetY!==l.offsetY&&(h&&"SameAsFlow"===this.yesBranchDirection||e&&"SameAsFlow"===this.noBranchDirection&&"SameAsFlow"!==this.yesBranchDirection)?h&&"LeftInFlow"===this.yesBranchDirection||e&&("SameAsFlow"===this.yesBranchDirection&&("SameAsFlow"===this.noBranchDirection||"LeftInFlow"===this.noBranchDirection)||"RightInFlow"===this.yesBranchDirection&&("LeftInFlow"===this.noBranchDirection||"RightInFlow"===this.noBranchDirection))?(i=a.offsetX,n=a.wrapper.bounds.top,o=l.wrapper.bounds.left,r=l.wrapper.bounds.center.y,s.push({x:i,y:n}),s.push({x:i,y:n-p}),s.push({x:o-d,y:n-p}),s.push({x:o-d,y:r}),s.push({x:o,y:r})):a.offsetY!==l.offsetY&&(h&&"SameAsFlow"===this.yesBranchDirection||e&&"SameAsFlow"===this.noBranchDirection&&"SameAsFlow"!==this.yesBranchDirection)&&(i=a.wrapper.bounds.right,n=a.offsetY,o=l.wrapper.bounds.left,r=l.wrapper.bounds.center.y,s.push({x:i,y:n}),s.push({x:o-d,y:n}),s.push({x:o-d,y:r}),s.push({x:o,y:r})):a.wrapper.bounds.bottom<l.wrapper.bounds.center.y?(i=a.wrapper.bounds.bottom,n=a.offsetX,o=l.wrapper.bounds.left,r=l.offsetY,s.push({x:n,y:i}),s.push({x:n,y:r}),s.push({x:o,y:r})):a.wrapper.bounds.top>l.wrapper.bounds.center.y?(i=a.wrapper.bounds.top,n=a.offsetX,o=l.wrapper.bounds.left,r=l.offsetY,s.push({x:n,y:i}),s.push({x:n,y:r}),s.push({x:o,y:r})):(h&&"RightInFlow"===this.yesBranchDirection||e&&("SameAsFlow"===this.yesBranchDirection&&("RightInFlow"===this.noBranchDirection||"SameAsFlow"===this.noBranchDirection)||"LeftInFlow"===this.yesBranchDirection&&("LeftInFlow"===this.noBranchDirection||"RightInFlow"===this.noBranchDirection)))&&(i=a.offsetX,n=a.wrapper.bounds.bottom,o=l.wrapper.bounds.left,r=l.wrapper.bounds.center.y,s.push({x:i,y:n}),s.push({x:i,y:n+p}),s.push({x:o-d,y:n+p}),s.push({x:o-d,y:r}),s.push({x:o,y:r}))):s=t,s},dMi.prototype.updateVerticalConnectorSegments=function(e,t){var i,n,o,r,s,a,l,h,d,p=[],c=this.diagram.nameTable[e.sourceID],u=this.diagram.nameTable[e.targetID],g=this.vertexMapper.get(c.id).isDecisionNode,m=this.horizontalSpacing/2,f=this.verticalSpacing/2;return g?(g=this.isYesBranchConnector(e),e=this.isNoBranchConnector(e),c.wrapper.bounds.right<u.wrapper.bounds.center.x&&(g&&"RightInFlow"===this.yesBranchDirection||e&&("SameAsFlow"===this.yesBranchDirection&&("RightInFlow"===this.noBranchDirection||"SameAsFlow"===this.noBranchDirection)||"LeftInFlow"===this.yesBranchDirection&&("LeftInFlow"===this.noBranchDirection||"RightInFlow"===this.noBranchDirection)))?(a=c.wrapper.bounds.right,l=c.offsetY,h=u.wrapper.bounds.top,d=u.offsetY,p.push({x:a,y:l}),0===(r=(r=this.diagram.nodes.filter(function(e){return e.wrapper.bounds.containsPoint({x:u.offsetX,y:c.offsetY})})).sort(function(e,t){return t.wrapper.bounds.left-e.wrapper.bounds.left})).length?p.push({x:u.offsetX,y:l}):(s=r[0].wrapper.bounds,p.push({x:s.left-m,y:r[0].offsetY}),p.push({x:s.left-m,y:s.bottom+f})),p.push({x:h,y:d})):c.wrapper.bounds.left>u.wrapper.bounds.center.x&&(g&&"LeftInFlow"===this.yesBranchDirection||e&&("SameAsFlow"===this.yesBranchDirection&&("SameAsFlow"===this.noBranchDirection||"LeftInFlow"===this.noBranchDirection)||"RightInFlow"===this.yesBranchDirection&&("LeftInFlow"===this.noBranchDirection||"RightInFlow"===this.noBranchDirection)))?(a=c.wrapper.bounds.left,l=c.offsetY,h=u.wrapper.bounds.top,d=u.offsetY,p.push({x:a,y:l}),i=tfi.toBounds([p[0],{x:u.offsetX,y:l}]),0===(r=(r=this.diagram.nodes.filter(function(e){return e.wrapper.bounds.intersects(i)&&e.id!==c.id&&e.id!==u.id})).sort(function(e,t){return t.wrapper.bounds.right-e.wrapper.bounds.right})).length?p.push({x:u.offsetX,y:l}):(s=r[0].wrapper.bounds,p.push({x:s.right+m,y:r[0].offsetY}),p.push({x:s.right+m,y:s.bottom+f})),p.push({x:h,y:d})):g&&"RightInFlow"===this.yesBranchDirection||e&&("SameAsFlow"===this.yesBranchDirection&&("RightInFlow"===this.noBranchDirection||"SameAsFlow"===this.noBranchDirection)||"LeftInFlow"===this.yesBranchDirection&&("LeftInFlow"===this.noBranchDirection||"RightInFlow"===this.noBranchDirection))?(a=c.wrapper.bounds.right,l=c.offsetY,h=u.wrapper.bounds.topCenter.x,d=u.wrapper.bounds.topCenter.y,p.push({x:a,y:l}),p.push({x:a+m,y:l}),p.push({x:a+m,y:d-f}),p.push({x:h,y:d-f}),p.push({x:h,y:d}),n=tfi.toBounds([p[1],p[2]]),0<(r=(r=this.diagram.nodes.filter(function(e){return e.wrapper.bounds.intersects(n)})).sort(function(e,t){return t.wrapper.bounds.right-e.wrapper.bounds.right})).length&&r[0].wrapper.bounds.intersects(n)&&(s=r[0].wrapper.bounds,p[1].x=s.right+m,p[2].x=s.right+m)):g&&"LeftInFlow"===this.yesBranchDirection||e&&("SameAsFlow"===this.yesBranchDirection&&("SameAsFlow"===this.noBranchDirection||"LeftInFlow"===this.noBranchDirection)||"RightInFlow"===this.yesBranchDirection&&("LeftInFlow"===this.noBranchDirection||"RightInFlow"===this.noBranchDirection))?(a=c.wrapper.bounds.left,l=c.offsetY,h=u.wrapper.bounds.topCenter.x,d=u.wrapper.bounds.topCenter.y,p.push({x:a,y:l}),p.push({x:a-m,y:l}),p.push({x:a-m,y:d-f}),p.push({x:h,y:d-f}),p.push({x:h,y:d}),o=tfi.toBounds([p[1],p[2]]),0<(r=(r=this.diagram.nodes.filter(function(e){return e.wrapper.bounds.intersects(o)})).sort(function(e,t){return t.wrapper.bounds.left-e.wrapper.bounds.left})).length&&r[0].wrapper.bounds.intersects(o)&&(s=r[0].wrapper.bounds,p[1].x=s.left-m,p[2].x=s.left-m)):c.offsetX!==u.offsetX&&(g&&"SameAsFlow"===this.yesBranchDirection||e&&"SameAsFlow"===this.noBranchDirection&&"SameAsFlow"!==this.yesBranchDirection)?(a=c.offsetX,l=c.wrapper.bounds.bottom,h=u.wrapper.bounds.topCenter.x,d=u.wrapper.bounds.topCenter.y,p.push({x:a,y:l}),p.push({x:a,y:d-f}),p.push({x:h,y:d-f}),p.push({x:h,y:d})):p=t):p=t,p},dMi.prototype.getModelBounds=function(e){var t=new tfi(0,0,0,0);return(e=Array.from(e)).forEach(function(e){e=e.geometry;t.uniteRect(e)}),t},dMi.prototype.createVertex=function(e){var t=this,i=(isNaN(e.width)?e.wrapper.bounds:e).width,n=(isNaN(e.height)?e.wrapper.bounds:e).height,i=new tfi(0,0,i,n),o=[],r=[],s={isYesBranch:!1,isNoBranch:!1};if(null!=e.inEdges)for(var a=0,l=e.inEdges;a<l.length;a++){var h=l[a];(c=this.diagram.nameTable[""+h])&&o.push(c)}if(null!=e.outEdges)for(var d=0,p=e.outEdges;d<p.length;d++){var c,h=p[d];(c=this.diagram.nameTable[""+h])&&r.push(c)}var u=s.isYesBranch,g=s.isNoBranch;return null!=o&&o.forEach(function(e){s=t.checkForYesOrNoBranch(e,u,g)}),null!=r&&r.forEach(function(e){t.edgesMapper.set(e,[]),t.loopedgesMapper.set(e,!1)}),{id:e.id,geometry:i,inEdges:o,layoutObjectId:{},outEdges:r,item:e,isDecisionNode:!1,isYesChild:s.isYesBranch,isNoChild:s.isNoBranch}},dMi.prototype.updatePoints=function(e,t){for(var i,n=[],o=[],r=0;r<e.length;r++)e[r+2]&&(n.push(e[parseInt(r.toString(),10)]),n.push(e[r+1]),i={type:"Orthogonal",points:n,length:n[0].x===n[1].x?Math.abs(n[0].y-n[1].y):Math.abs(n[0].x-n[1].x),direction:n[0].x===n[1].x?n[0].y>n[1].y?"Top":"Bottom":n[0].x>n[1].x?"Left":"Right"},n=[],o.push(i));t.segments=o},dMi.prototype.contains=function(e,t){return e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom},dMi.prototype.updateLoopConnector=function(e){var t=[];if(this.edgesMapper.has(e)){var i=this.edgesMapper.get(e);if(i)for(var n=0,o=i;n<o.length;n++){var r=o[n],s=r.x+this.anchorX,r=r.y+this.anchorY;t.push({x:s,y:r})}}t.reverse();var a,l,h,d,p,c,u,g,m,f,y,i=[],v=this.diagram.nameTable[e.sourceID],b=this.diagram.nameTable[e.targetID],w=v.wrapper.bounds,C=b.wrapper.bounds,S=v,A=b,v=this.vertexMapper.get(e.sourceID).isDecisionNode,b=this.isYesBranchConnector(e),x=this.isNoBranchConnector(e),b=b&&"LeftInFlow"===this.yesBranchDirection,x=x&&("RightInFlow"===this.yesBranchDirection&&("RightInFlow"===this.noBranchDirection||"SameAsFlow"===this.noBranchDirection)||"LeftInFlow"===this.noBranchDirection&&("RightInFlow"===this.yesBranchDirection||"SameAsFlow"===this.yesBranchDirection)),I=this.horizontalSpacing/2,T=this.verticalSpacing/2,E=(new tfi).uniteRect(S.wrapper.bounds).uniteRect(A.wrapper.bounds),D=this.diagram.nodes.filter(function(e){return e.id!==A.id&&e.id!==S.id&&e.wrapper.bounds.intersects(E)});"TopToBottom"===this.orientation?(d=Array.from(this.vertexMapper.values()).filter(function(e){return e.item.wrapper.bounds.containsPoint({x:e.item.wrapper.bounds.x,y:S.offsetY})&&S.id!==e.item.id}),p=Array.from(this.vertexMapper.values()).filter(function(e){return e.item.wrapper.bounds.containsPoint({x:e.item.wrapper.bounds.x,y:A.offsetY})&&A.id!==e.item.id}),c=Math.max.apply(Math,t.map(function(e){return e.x})),a=!1,v?(b||x)&&(a=!0):a=0<d.length&&d[0].item.wrapper.bounds.x>w.x,0===p.length||!a&&0<p.length&&0<p.filter(function(e){return e.item.wrapper.bounds.right<C.left}).length?(h=(g=!a&&c>w.right?w.right:w.left)+(a?-I:I),u=!a&&c>C.right?C.right:C.left,i.push({x:g,y:S.offsetY}),i.push({x:h,y:S.offsetY}),i.push({x:h,y:A.offsetY}),i.push({x:u,y:A.offsetY})):(g=p[0].item.wrapper.bounds.bottom+T,u=(h=a?w.left:w.right)+(a?-I:I),y=!a&&c>C.right?C.right+I:C.left-I,l=!a&&c>C.right?C.right:C.left,i.push({x:h,y:S.offsetY}),i.push({x:u,y:S.offsetY}),i.push({x:u,y:g}),i.push({x:y,y:g}),i.push({x:y,y:A.offsetY}),i.push({x:l,y:A.offsetY})),0<D.length&&(f=a?Math.min.apply(Math,D.map(function(e){return e.wrapper.bounds.left})):Math.max.apply(Math,D.map(function(e){return e.wrapper.bounds.right})),a&&f<i[1].x||!a&&f>i[1].x)&&(i[1].x=h=f+(a?-I:I),i[2].x=h)):(d=Array.from(this.vertexMapper.values()).filter(function(e){return e.item.wrapper.bounds.containsPoint({y:e.item.wrapper.bounds.y,x:S.offsetX})&&S.id!==e.item.id}),p=Array.from(this.vertexMapper.values()).filter(function(e){return e.item.wrapper.bounds.containsPoint({y:e.item.wrapper.bounds.y,x:A.offsetX})&&A.id!==e.item.id}),c=Math.max.apply(Math,t.map(function(e){return e.y})),u=!1,v?(b||x)&&(u=!0):u=0<d.length&&d[0].item.wrapper.bounds.y>w.y,0===p.length||!u&&0<p.length&&p.some(function(e){return e.item.wrapper.bounds.bottom<C.top})?(i.push({x:S.offsetX,y:!u&&c>w.bottom?w.bottom:w.top}),m=i[0].y+(u?-T:T),i.push({x:S.offsetX,y:m})):(g=p[0].item.wrapper.bounds.right+I,m=!u&&c>C.bottom?C.bottom+T:C.top-T,i.push({x:S.offsetX,y:u?w.top:w.bottom}),i.push({x:S.offsetX,y:i[0].y+(u?-T:T)}),i.push({x:g,y:i[1].y}),i.push({x:g,y:m})),i.push({x:A.offsetX,y:m}),i.push({x:A.offsetX,y:!u&&c>C.bottom?C.bottom:C.top}),0<D.length&&(f=u?Math.min.apply(Math,D.map(function(e){return e.wrapper.bounds.top})):Math.max.apply(Math,D.map(function(e){return e.wrapper.bounds.bottom})),u&&i[1].y>f||!u&&i[1].y<f)&&(i[1].y=f+(y=u?-T:T),i[2].y=f+y)),this.updatePoints(i,e)},dMi.prototype.checkForYesOrNoBranch=function(e,i,n){var o=this;return e.annotations&&e.annotations.length&&e.annotations.forEach(function(e){var t;"string"==typeof e.content&&(t=e.content.toString(),o.yesBranchValues.forEach(function(e){0===t.localeCompare(e,void 0,{sensitivity:"accent"})&&(i=!0)}),o.noBranchValues.forEach(function(e){0===t.localeCompare(e,void 0,{sensitivity:"accent"})&&(n=!0)}))}),{isYesBranch:i,isNoBranch:n}},dMi.prototype.getTreeVertices=function(t,i,n){var e,o,r,s,a=this;null!=t&&-1===i.indexOf(t)&&(i.push(t),n=n.filter(function(e){return e!==t}),2===(o=t.item.outEdges).length&&(e=this.diagram.nameTable[this.diagram.nameTable[o[0]].targetID],o=this.diagram.nameTable[this.diagram.nameTable[o[1]].targetID],e=this.vertexMapper.get(e.id),o=this.vertexMapper.get(o.id),e)&&o&&(r=e.isYesChild||o.isYesChild,s=e.isNoChild||o.isNoChild,r&&!s?(e.isYesChild?o.isNoChild=!0:e.isNoChild=!0,s=!0):!r&&s&&(e.isNoChild?o.isYesChild=!0:e.isYesChild=!0,r=!0),t.isDecisionNode=r),t.outEdges.forEach(function(e){e=a.diagram.nameTable[e.targetID],e=a.vertexMapper.get(e.id);null!=e&&(t.isDecisionNode||(e.isYesChild=!1,e.isNoChild=!1),a.getTreeVertices(e,i,n))}))},dMi.prototype.getEdges=function(e){var t=[];if(null!=e){for(var i=0,n=e.inEdges;i<n.length;i++){var o=n[i];t.push(o)}for(var r=0,s=e.outEdges;r<s.length;r++){var a=s[r];t.push(a)}}return t},dMi.prototype.getVisibleTerminal=function(e,t){t=t?e.sourceID:e.targetID;return this.vertexMapper.get(t)},dMi.prototype.getEdgesBetween=function(e,t,i){for(var n=this.getEdges(e),o=[],r=0;r<n.length;r++){var s=this.getVisibleTerminal(n[parseInt(r.toString(),10)],!0),a=this.getVisibleTerminal(n[parseInt(r.toString(),10)],!1);s.id===e.id&&a.id===t.id&&o.push(n[parseInt(r.toString(),10)])}return o},dMi.prototype.destroy=function(){},dMi.prototype.getModuleName=function(){return"FlowchartLayout"};k$=dMi;function dMi(){this.rootNodes=[],this.vertexMapper=new Map,this.edgesMapper=new Map,this.loopedgesMapper=new Map,this.anchorX=0,this.anchorY=0,this.verticalSpacing=50,this.horizontalSpacing=50,this.horizontalAlignment="Center",this.verticalAlignment="Top",this.margin={top:50,right:50,bottom:50,left:50},this.orientation="TopToBottom",this.yesBranchDirection="SameAsFlow",this.noBranchDirection="RightInFlow",this.yesBranchValues=["Yes","True"],this.noBranchValues=["No","False"],this.diagram=new dDi}cMi.prototype.renderConnectorsCollection=function(e,t){e.connectors=[];for(var i=[],n=0;n<t.connectors.length;n++){var o=t.connectors[parseInt(n.toString(),10)],o=this.convertToConnector(o);i.push(o)}e.connectors=i},cMi.prototype.convertToConnector=function(e){var t={style:{}};return e.name&&(t.id=e.name),e.addInfo&&(t.addInfo=e.addInfo),e.bridgeSpace&&(t.bridgeSpace=e.bridgeSpace),e.constraints&&(t.constraints=this.setConnectorConstraints(e.constraints)),e.cornerRadius&&(t.cornerRadius=e.cornerRadius),e.labels&&(t.annotations=this.labelProperties.setLabelProperties(e.labels,e)),e.lineColor&&(t.style.fill=e.lineColor),e.lineWidth&&(t.style.strokeWidth=e.lineWidth),e.lineDashArray&&(t.style.strokeDashArray=e.lineDashArray),e.opacity&&(t.style.opacity=e.opacity),e.lineHitPadding&&(t.hitPadding=e.lineHitPadding),e.margin&&(t.margin={left:e.margin.left,right:e.margin.right,top:e.margin.top,bottom:e.margin.bottom}),e.segments&&(t.type=e.segments[0].type.charAt(0).toUpperCase()+e.segments[0].type.slice(1),t.segments=this.setConnectorSegments(e.segments)),e.shape&&(t.shape=this.getConnectorShape(e.shape)),e.sourceDecorator&&(t.sourceDecorator={height:e.sourceDecorator.height,width:e.sourceDecorator.width,shape:this.getDecoratorShape(e.sourceDecorator.shape),pathData:e.sourceDecorator.pathData,style:{fill:e.sourceDecorator.fillColor,strokeColor:e.sourceDecorator.lineColor,strokeWidth:e.sourceDecorator.lineWidth}}),e.targetDecorator&&(t.targetDecorator={height:e.targetDecorator.height,width:e.targetDecorator.width,shape:this.getDecoratorShape(e.targetDecorator.shape),pathData:e.targetDecorator.pathData,style:{fill:e.targetDecorator.fillColor,strokeColor:e.targetDecorator.lineColor,strokeWidth:e.targetDecorator.lineWidth}}),e.sourceNode&&(t.sourceID=e.sourceNode),e.targetNode&&(t.targetID=e.targetNode),e.sourcePoint&&(t.sourcePoint={x:e.sourcePoint.x,y:e.sourcePoint.y}),e.targetPoint&&(t.targetPoint={x:e.targetPoint.x,y:e.targetPoint.y}),e.sourcePort&&(t.sourcePortID=e.sourcePort),e.targetPort&&(t.targetPortID=e.targetPort),e.tooltip&&(t.tooltip={content:e.tooltip.content,relativeMode:e.tooltip.relativeMode}),e.visible&&(t.visible=e.visible),e.zOrder&&(t.zIndex=e.zOrder),t},cMi.prototype.getConnectorShape=function(e){var t=null;return t=e&&("bpmn"===e.type&&(t={type:"Bpmn",flow:e.flow.charAt(0).toUpperCase()+e.flow.slice(1)},"sequence"===e.flow?t.sequence=e.sequence.charAt(0).toUpperCase()+e.sequence.slice(1):"association"===e.flow?t.association=e.association.charAt(0).toUpperCase()+e.association.slice(1):t.message=e.message.charAt(0).toUpperCase()+e.message.slice(1)),"umlclassifier"===e.type&&(t={type:"UmlClassifier",relationship:e.relationship.charAt(0).toUpperCase()+e.relationship.slice(1),multiplicity:{type:e.multiplicity.type.charAt(0).toUpperCase()+e.multiplicity.type.slice(1),source:{upperBounds:e.multiplicity.source.upperBounds,optional:e.multiplicity.source.optional,lowerBounds:e.multiplicity.source.lowerBounds},target:{upperBounds:e.multiplicity.target.upperBounds,optional:e.multiplicity.target.optional,lowerBounds:e.multiplicity.target.lowerBounds}}}),"umlactivity"===e.type)?{type:"UmlActivity",flow:e.flow.charAt(0).toUpperCase()+e.flow.slice(1)}:t},cMi.prototype.getDecoratorShape=function(e){return"path"===e?"Custom":e.charAt(0).toUpperCase()+e.slice(1)},cMi.prototype.setConnectorSegments=function(e){var t=[];if(0<e.length)for(var i=0;i<e.length;i++){var n={},o=e[parseInt(i.toString(),10)];n.direction=o.direction?o.direction.charAt(0).toUpperCase()+o.direction.slice(1):o._direction?o._direction.charAt(0).toUpperCase()+o._direction.slice(1):null,n.length=o.length||o._length||null,n.point=o.point?{x:o.point.x,y:o.point.y}:null,n.point1=o.point1?{x:o.point1.x,y:o.point1.y}:null,n.point2=o.point2?{x:o.point2.x,y:o.point2.y}:null,n.vector1=o.vector1?{angle:o.vector1.angle,distance:o.vector1.distance}:null,n.vector2=o.vector2?{angle:o.vector2.angle,distance:o.vector2.distance}:null,o.points&&(n.points=this.getSegmentPoints(o.points)),o.type&&(n.type=o.type.charAt(0).toUpperCase()+o.type.slice(1)),t.push(n)}return t},cMi.prototype.getSegmentPoints=function(e){var t=[];if(0<e.length)for(var i=0;i<e.length;i++){var n={},o=e[parseInt(i.toString(),10)];n.x=o.x,n.y=o.y,t.push(n)}return t},cMi.prototype.setConnectorConstraints=function(e){var t=Yfi.None;return e&Yfi.Select&&(t|=Yfi.Select),e&Yfi.Delete&&(t|=Yfi.Delete),e&Yfi.Drag&&(t|=Yfi.Drag),e&Yfi.DragSourceEnd&&(t|=Yfi.DragSourceEnd),e&Yfi.DragTargetEnd&&(t|=Yfi.DragTargetEnd),e&Yfi.DragSegmentThumb&&(t|=Yfi.DragSegmentThumb),e&Yfi.Bridging&&(t|=Yfi.Bridging),e&Yfi.InheritBridging&&(t|=Yfi.InheritBridging),e&Yfi.AllowDrop&&(t|=Yfi.AllowDrop),e&Yfi.InheritTooltip&&(t|=Yfi.InheritTooltip),e&Yfi.PointerEvents&&(t|=Yfi.PointerEvents),e&Yfi.BridgeObstacle&&(t|=Yfi.BridgeObstacle),e&Yfi.Interaction&&(t|=Yfi.Interaction),e&Yfi.Default&&(t|=Yfi.Default),t},cMi.prototype.getModuleName=function(){return"ConnectorProperties"};var pMi=cMi;function cMi(e){this.labelProperties=e}gMi.prototype.setLabelProperties=function(e,t){var i=[];if(0<e.length)for(var n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)],r={style:{}};if(o.name&&(s=(s=o.name.split("_"))[s.length-1],r.id=s),o.addInfo&&(r.addInfo=o.addInfo),o.text&&(r.content=o.text),o.constraints&&(r.constraints=this.setLabelConstraints(o.constraints)),o.readOnly&&(r.constraints=r.constraints|Xfi.ReadOnly),o.dragLimit&&(r.dragLimit={left:o.dragLimit.left,right:o.dragLimit.right,top:o.dragLimit.top,bottom:o.dragLimit.bottom}),o.height&&(r.height=o.height),o.horizontalAlignment&&(r.horizontalAlignment=o.horizontalAlignment.charAt(0).toUpperCase()+o.horizontalAlignment.slice(1).toLowerCase()),o.verticalAlignment&&(r.verticalAlignment=o.verticalAlignment.charAt(0).toUpperCase()+o.verticalAlignment.slice(1).toLowerCase()),o.hyperlink&&(r.hyperlink={link:o.hyperlink,color:"blue"}),o.margin&&(r.margin={left:o.margin.left,right:o.margin.right,top:o.margin.top,bottom:o.margin.bottom}),r.rotateAngle=o.rotateAngle,o.offset&&(r.offset=t?o.offset.x:{x:o.offset.x,y:o.offset.y}),r.style.color=o.fontColor,r.style.fontFamily=o.fontFamily,r.style.fontSize=o.fontSize,r.style.italic=o.italic,r.style.bold=o.bold,o.borderColor&&(r.style.strokeColor=o.borderColor),o.borderWidth&&(r.style.strokeWidth=o.borderWidth),o.wrapping)switch(o.wrapping){case"wrap":r.style.textWrapping="Wrap";break;case"nowrap":r.style.textWrapping="NoWrap";break;case"wrapwithoverflow":r.style.textWrapping="WrapWithOverflow"}o.textOverflow&&o.overflowType&&(r.style.textOverflow=o.overflowType.charAt(0).toUpperCase()+o.overflowType.slice(1)),o.textAlign&&(r.style.textAlign=o.textAlign.charAt(0).toUpperCase()+o.textAlign.slice(1).toLowerCase()),o.textDecoration&&(r.style.textDecoration=o.textDecoration.charAt(0).toUpperCase()+o.textDecoration.slice(1).toLowerCase(),"Linethrough"===r.style.textDecoration)&&(r.style.textDecoration="LineThrough");var s=this.setLabelAppearance(r,o);r.style.fill=s.fill,r.style.opacity=s.opacity,r.visibility=s.visibility,o.width&&(r.width=o.width),i.push(r)}return i},gMi.prototype.setLabelAppearance=function(e,t){var i={};return t.fillColor&&(i.fill="white"===t.fillColor?"transparent":t.fillColor),t.opacity&&(i.opacity=t.opacity),t.visible&&(i.visibility=t.visible),i},gMi.prototype.setLabelConstraints=function(e){var t=Xfi.None;return e&Xfi.Select&&(t|=Xfi.Select),e&Xfi.Drag&&(t|=Xfi.Drag),e&Xfi.Resize&&(t|=Xfi.Resize),e&Xfi.Rotate&&(t|=Xfi.Rotate),t},gMi.prototype.getModuleName=function(){return"LabelProperties"};var uMi=gMi;function gMi(e){this.modelProperties=e}fMi.prototype.renderNodesCollection=function(e,t){e.nodes=[];for(var i=[],n=0;n<t.nodes.length;n++){var o=t.nodes[parseInt(n.toString(),10)],r=[],s=this.convertToNode(o);if(s.shape&&s.shape.activity&&s.shape.activity.subProcess&&s.shape.activity.subProcess.processes&&0<s.shape.activity.subProcess.processes.length){for(var a=[],l=0;l<s.shape.activity.subProcess.processes.length;l++){var h=s.shape.activity.subProcess.processes[parseInt(l.toString(),10)];h.margin.right=0,h.margin.bottom=0,h.processId=s.id,a.push(h.id),r.push(h)}s.shape.activity.subProcess.processes=a}if("group"===o.type&&!o.isSwimlane){var d=[];if(s.children&&0<s.children.length){for(var p=0;p<s.children.length;p++){var c=s.children[parseInt(p.toString(),10)];i.push(c),d.push(c.id)}s.children=d}}i.push(s),r&&0<r.length&&(i=i.concat(r))}return e.nodes=i,e.nodes},fMi.prototype.convertToNode=function(e){var t={style:{},margin:{}};return e.name&&(t.id=e.name),e.fillColor&&(t.style.fill=e.fillColor),e.borderColor&&(t.style.strokeColor=e.borderColor),e.borderWidth&&(t.style.strokeWidth=e.borderWidth),e.borderDashArray&&(t.style.strokeDashArray=e.borderDashArray),e.opacity&&(t.style.opacity=e.opacity),e.gradient&&(t.style.gradient=this.setGradient(e.gradient)),e.isExpanded&&(t.isExpanded=e.isExpanded),e.width&&(t.width=e.width),e.height&&(t.height=e.height),e.offsetX&&(t.offsetX=e.offsetX),e.offsetY&&(t.offsetY=e.offsetY),e.visible&&(t.visible=e.visible),t.zIndex=-1===e.zOrder?-1:e.zOrder,e.excludeFromLayout&&(t.excludeFromLayout=e.excludeFromLayout),e.rotateAngle&&(t.rotateAngle=e.rotateAngle),e.pivot&&(t.pivot=e.pivot),e.addInfo&&(t.addInfo=e.addInfo),e.marginLeft&&(t.margin.left=e.marginLeft),e.marginRight&&(t.margin.right=e.marginRight),e.marginTop&&(t.margin.top=e.marginTop),e.marginBottom&&(t.margin.bottom=e.marginBottom),e.horizontalAlign&&(t.horizontalAlignment=e.horizontalAlign),e.verticalAlign&&(t.verticalAlignment=e.verticalAlign),e.constraints&&(t.constraints=this.setNodeConstraints(e.constraints)),e.labels&&(t.annotations=this.labelProperties.setLabelProperties(e.labels,void 0)),e.shadow&&(t.shadow={angle:e.shadow.angle,opacity:e.shadow.opacity,distance:e.shadow.distance}),e.tooltip&&(t.tooltip={relativeMode:e.tooltip.relativeMode}),e.expandIcon&&(t.expandIcon={shape:e.expandIcon.shape.charAt(0).toUpperCase()+e.expandIcon.shape.slice(1),width:e.expandIcon.width,height:e.expandIcon.height,margin:{left:e.expandIcon.margin.left,right:e.expandIcon.margin.right,top:e.expandIcon.margin.top,bottom:e.expandIcon.margin.bottom},offset:{x:e.expandIcon.offset.x,y:e.expandIcon.offset.y},borderColor:e.expandIcon.borderColor,borderWidth:e.expandIcon.borderWidth,cornerRadius:e.expandIcon.cornerRadius,pathData:e.expandIcon.pathData},"Arrowup"===t.expandIcon.shape?t.expandIcon.shape="ArrowUp":"Arrowdown"===t.expandIcon.shape&&(t.expandIcon.shape="ArrowDown")),e.collapseIcon&&(t.collapseIcon={shape:e.collapseIcon.shape.charAt(0).toUpperCase()+e.collapseIcon.shape.slice(1),width:e.collapseIcon.width,height:e.collapseIcon.height,margin:{left:e.collapseIcon.margin.left,right:e.collapseIcon.margin.right,top:e.collapseIcon.margin.top,bottom:e.collapseIcon.margin.bottom},offset:{x:e.collapseIcon.offset.x,y:e.collapseIcon.offset.y},borderColor:e.collapseIcon.borderColor,borderWidth:e.collapseIcon.borderWidth,cornerRadius:e.collapseIcon.cornerRadius,pathData:e.collapseIcon.pathData},"Arrowup"===t.collapseIcon.shape?t.collapseIcon.shape="ArrowUp":"Arrowdown"===t.collapseIcon.shape&&(t.collapseIcon.shape="ArrowDown")),e.ports&&(t.ports=this.portProperties.setPortProperties(e.ports)),e.children&&"bpmn"!==e.type&&!e.isSwimlane&&(t.children=this.getChildren(t,e)),e.children&&0<e.children.length||(t.maxWidth=e.maxWidth,t.maxHeight=e.maxHeight,t.minWidth=e.minWidth,t.minHeight=e.minHeight),t=e.shape||e.type?this.setShape(t,e):t},fMi.prototype.getChildren=function(e,t){if(t.children&&0<t.children.length){for(var i=[],n=0;n<t.children.length;n++){var o=this.convertToNode(t.children[parseInt(n.toString(),10)]);o.children&&this.getChildren(e,o),i.push(o)}e.children=i}return e.children},fMi.prototype.setShape=function(e,t){switch(t.type){case"basic":var i=t.shape.charAt(0).toUpperCase()+t.shape.slice(1);"path"===t.shape?e.shape={type:"Path",data:t.pathData}:e.shape={type:"Basic",shape:i,cornerRadius:t.cornerRadius,points:t.points};break;case"flow":i=t.shape.charAt(0).toUpperCase()+t.shape.slice(1);e.shape={type:"Flow",shape:i};break;case"umlactivity":e.shape={type:"UmlActivity",shape:t.shape.charAt(0).toUpperCase()+t.shape.slice(1)};break;case"image":e.shape={type:"Image",source:t.source,align:this.getImageContentAlignment(t.contentAlignment),scale:t.scale.charAt(0).toUpperCase()+t.scale.slice(1)};break;case"html":e.shape={type:"HTML"};break;case"native":e.shape={type:"Native"};break;case"text":e.shape={type:"Text",content:t.textBlock.text};break;case"bpmn":e.shape=this.renderBpmnShape(e,t);break;case"group":t.isSwimlane&&(e.shape=this.renderSwimlaneShape(e,t))}return e},fMi.prototype.getImageContentAlignment=function(e){if(e)switch(e){case"xminymin":return"XMinYMin";case"xminymid":return"XMinYMid";case"xminymax":return"XMinYMax";case"xmidymin":return"XMidYMin";case"xmidymid":return"XMidYMid";case"xmidymax":return"XMidYMax";case"xmaxymin":return"XMaxYMin";case"xmaxymid":return"XMaxYMid";case"xmaxymax":return"XMaxYMax";case"none":return"None"}return"None"},fMi.prototype.setNodeConstraints=function(e){var t=Kfi.None;return e&Kfi.Select&&(t|=Kfi.Select),e&Kfi.Delete&&(t|=Kfi.Delete),e&Kfi.Drag&&(t|=Kfi.Drag),e&Kfi.Rotate&&(t|=Kfi.Rotate),e&Kfi.ResizeNorthEast&&(t|=Kfi.ResizeNorthEast),e&Kfi.ResizeEast&&(t|=Kfi.ResizeEast),e&Kfi.OutConnect&&(t|=Kfi.ResizeSouthEast),e&Kfi.Expandable&&(t|=Kfi.ResizeSouth),e&Kfi.AllowDrop&&(t|=Kfi.ResizeSouthWest),e&Kfi.ResizeNorthEast&&(t|=Kfi.ResizeWest),e&Kfi.ResizeEast&&(t|=Kfi.ResizeNorthWest),e&Kfi.ResizeNorth&&(t|=Kfi.ResizeNorth),e&Kfi.Resize&&(t|=Kfi.Resize),e&Kfi.Shadow&&(t|=Kfi.Shadow),e&Kfi.AspectRatio&&(t|=Kfi.AspectRatio),e&Kfi.AllowDrop&&(t|=Kfi.AllowDrop),e&Kfi.InheritTooltip&&(t|=Kfi.InheritTooltip),e&Kfi.PointerEvents&&(t|=Kfi.PointerEvents),e&Kfi.Inherit&&(t|=Kfi.Inherit),e&Kfi.Default&&(t|=Kfi.Default),t},fMi.prototype.setGradient=function(e){var t={};return e&&("linear"===e.type?t={type:"Linear",x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,stops:this.getGradientStops(e.stops)}:"radial"===e.type&&(t={type:"Radial",cx:e.cx,cy:e.cy,fx:e.fx,fy:e.fy,stops:this.getGradientStops(e.stops)})),t},fMi.prototype.getGradientStops=function(e){for(var t=[],i=0;i<e.length;i++){var n={},o=e[parseInt(i.toString(),10)];n.color=o.color,n.offset=o.offset,t.push(n)}return t},fMi.prototype.renderBpmnShape=function(e,t){return"event"===t.shape?e.shape={type:"Bpmn",shape:t.shape.charAt(0).toUpperCase()+t.shape.slice(1),event:{event:t.event.charAt(0).toUpperCase()+t.event.slice(1),trigger:t.trigger.charAt(0).toUpperCase()+t.trigger.slice(1)}}:"gateway"===t.shape?e.shape={type:"Bpmn",shape:t.shape.charAt(0).toUpperCase()+t.shape.slice(1),gateway:{type:t.gateway.charAt(0).toUpperCase()+t.gateway.slice(1)}}:"activity"===t.shape?(e.shape={type:"Bpmn",shape:t.shape.charAt(0).toUpperCase()+t.shape.slice(1),activity:{activity:t.activity.charAt(0).toUpperCase()+t.activity.slice(1)}},e.shape.activity.activity="Subprocess"===e.shape.activity.activity?"SubProcess":e.shape.activity.activity,"task"===t.activity&&(e.shape.activity.task={type:t.task.type.charAt(0).toUpperCase()+t.task.type.slice(1),loop:t.task.loop.charAt(0).toUpperCase()+t.task.loop.slice(1),compensation:t.task.compensation,call:t.task.call}),"subprocess"===t.activity&&("event"===t.subProcess.type?e.shape.activity.subProcess={collapsed:t.subProcess.collapsed,compensation:t.subProcess.compensation,adhoc:t.subProcess.adhoc,loop:t.subProcess.loop.charAt(0).toUpperCase()+t.subProcess.loop.slice(1),boundary:t.subProcess.boundary.charAt(0).toUpperCase()+t.subProcess.boundary.slice(1),type:t.subProcess.type.charAt(0).toUpperCase()+t.subProcess.type.slice(1),event:{event:t.subProcess.event.charAt(0).toUpperCase()+t.subProcess.event.slice(1),trigger:t.subProcess.trigger.charAt(0).toUpperCase()+t.subProcess.trigger.slice(1)}}:"transaction"===t.subProcess.type&&(e.shape.activity.subProcess={collapsed:t.subProcess.collapsed,compensation:t.subProcess.compensation,adhoc:t.subProcess.adhoc,loop:t.subProcess.loop.charAt(0).toUpperCase()+t.subProcess.loop.slice(1),boundary:t.subProcess.boundary.charAt(0).toUpperCase()+t.subProcess.boundary.slice(1),type:t.subProcess.type.charAt(0).toUpperCase()+t.subProcess.type.slice(1),events:this.renderEventsCollection(t.subProcess.events),processes:this.renderProcessesCollection(t)}))):"dataobject"===t.shape?(e.shape={type:"Bpmn",shape:t.shape.charAt(0).toUpperCase()+t.shape.slice(1)},t.annotation&&(e.shape.annotation={text:t.annotation.text,angle:t.annotation.angle,width:t.annotation.width,height:t.annotation.height,length:t.annotation.length})):e.shape={type:"Bpmn",shape:t.shape.charAt(0).toUpperCase()+t.shape.slice(1)},e.shape},fMi.prototype.renderSwimlaneShape=function(e,t){e.shape={type:"SwimLane",orientation:t.orientation.charAt(0).toUpperCase()+t.orientation.slice(1),header:{annotation:{content:t.header.text},height:50,style:{fontSize:t.header.fontSize,color:t.header.fontColor,fill:t.header.fillColor}}};for(var i=[],n=[],o=0;o<t.lanes.length;o++){i[parseInt(o.toString(),10)]={header:{annotation:{content:t.lanes[parseInt(o.toString(),10)].header.text,width:t.lanes[parseInt(o.toString(),10)].header.width,style:{fontSize:t.lanes[parseInt(o.toString(),10)].header.fontSize,color:t.lanes[parseInt(o.toString(),10)].header.fontColor}}},style:{fill:t.lanes[parseInt(o.toString(),10)].fillColor},children:[]};for(var r=0;r<t.lanes[parseInt(o.toString(),10)].children.length;r++){var s=this.convertToNode(t.lanes[parseInt(o.toString(),10)].children[parseInt(r.toString(),10)]);null==s.wrapper&&(s.wrapper={actualSize:{width:s.width,height:s.height},offsetX:s.offsetX,offsetY:s.offsetY}),i[parseInt(o.toString(),10)].children.push(s)}}for(o=0;o<t.phases.length;o++)n[parseInt(o.toString(),10)]={header:{annotation:{content:t.phases[parseInt(o.toString(),10)].label.text,style:{fill:t.phases[parseInt(o.toString(),10)].label.fillColor,fontSize:t.phases[parseInt(o.toString(),10)].label.fontSize,color:t.phases[parseInt(o.toString(),10)].label.fontColor}}},offset:t.phases[parseInt(o.toString(),10)].offset,style:{fill:t.phases[parseInt(o.toString(),10)].fillColor,strokeColor:t.phases[parseInt(o.toString(),10)].lineColor,strokeDashArray:t.phases[parseInt(o.toString(),10)].lineDashArray}};return e.shape.lanes=i,e.shape.phases=n,e.shape},fMi.prototype.renderEventsCollection=function(e){var t=[];if(0<e.length)for(var i=0;i<e.length;i++){var n={},o=e[parseInt(i.toString(),10)];n.event=o.event.charAt(0).toUpperCase()+o.event.slice(1),n.trigger=o.trigger.charAt(0).toUpperCase()+o.trigger.slice(1),n.offset={x:o.offset.x,y:o.offset.y},t.push(n)}return t},fMi.prototype.renderProcessesCollection=function(e){var t=[];if(e.subProcess&&0<e.subProcess.processes.length)for(var i=0;i<e.subProcess.processes.length;i++){var n=e.subProcess.processes[parseInt(i.toString(),10)],n=this.convertToNode(n);t.push(n)}return t},fMi.prototype.getModuleName=function(){return"NodeProperties"};var mMi=fMi;function fMi(e,t){this.labelProperties=e,this.portProperties=t}vMi.prototype.setPortProperties=function(e){var t=[];if(0<e.length)for(var i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)],o={style:{}};o.id=n.name,n.addInfo&&(o.addInfo=n.addInfo),o.height=n.size,o.width=n.size,n.horizontalAlignment&&(o.horizontalAlignment=n.horizontalAlignment.charAt(0).toUpperCase()+n.horizontalAlignment.slice(1)),n.verticalAlignment&&(o.verticalAlignment=n.verticalAlignment.charAt(0).toUpperCase()+n.verticalAlignment.slice(1)),n.margin&&(o.margin={left:n.margin.left,right:n.margin.right,top:n.margin.top,bottom:n.margin.bottom}),o.offset={x:n.offset.x,y:n.offset.y},o.style.strokeColor=n.borderColor,o.style.strokeWidth=n.borderWidth,o.style.fill=n.fillColor,o.constraints=this.setPortConstraints(n.constraints),n.pathData&&(o.pathData=n.pathData),"path"===n.shape?o.shape="Custom":n.shape?o.shape=n.shape.charAt(0).toUpperCase()+n.shape.slice(1):o.shape="Square",o.visibility=this.setPortVisibility(n.visibility),t.push(o)}return t},vMi.prototype.setPortConstraints=function(e){var t=pyi.Default;return e&pyi.Draw&&(t|=pyi.Draw),t=e&pyi.None?pyi.None:t},vMi.prototype.setPortVisibility=function(e){var t;return e&Wfi.Visible&&(t|=Wfi.Visible),e&Wfi.Hidden&&(t|=Wfi.Hidden),e&Wfi.Hover&&(t|=Wfi.Hover),e&Wfi.Connect&&(t|=Wfi.Connect),t},vMi.prototype.getModuleName=function(){return"PortProperties"};var yMi=vMi;function vMi(e){this.modelProperties=e}bMi.prototype.getSerializedData=function(e){return this.convertedData.mode="SVG",this.convertedData.basicElements=[],this.convertedData.width=e.width,this.convertedData.height=e.height,e.nodes&&0<e.nodes.length?this.nodeProperties.renderNodesCollection(this.convertedData,e):this.convertedData.nodes=e.nodes,e.connectors&&0<e.connectors.length?this.connectorProperties.renderConnectorsCollection(this.convertedData,e):this.convertedData.connectors=e.connectors,void 0!==e.defaultSettings&&(this.convertedData.getNodeDefaults=this.getNodeDefaults(e.defaultSettings.node),this.convertedData.getConnectorDefaults=this.getConnectorDefaults(e.defaultSettings.connector)),this.setLayers(this.convertedData,e),this.setDataSourceSettings(this.convertedData,e),this.setRulerSettings(this.convertedData,e),this.setSnapSettings(this.convertedData,e),e.snapSettings.enableSnapToObject?this.convertedData.snapSettings.constraints=this.convertedData.snapSettings.constraints|Qfi.SnapToObject:this.convertedData.snapSettings.constraints=this.convertedData.snapSettings.constraints&~Qfi.SnapToObject,void 0===e.pageSettings.backgroundImage&&(e.pageSettings.pageBackgroundColor="transparent",e.pageSettings.backgroundImage={source:"",scale:"meet",alignment:"xmidymid"},e.pageSettings.showPageBreak=!1),this.setScrollSettings(this.convertedData,e),this.setPageSettings(this.convertedData,e),this.setContextMenu(this.convertedData,e),this.setTooltip(this.convertedData,e),this.setModelLayout(this.convertedData,e),this.setSelectedItems(this.convertedData,e),this.convertedData.constraints=this.setDiagramConstraints(e.constraints),this.convertedData.tool=this.setDiagramTool(e.tool),this.convertedData.drawType=e.drawType,this.convertedData.commandManager=e.commandManager,this.convertedData},bMi.prototype.getNodeDefaults=function(e){return e?this.nodeProperties.convertToNode(e):null},bMi.prototype.getConnectorDefaults=function(e){return e?this.connectorProperties.convertToConnector(e):null},bMi.prototype.setLayers=function(e,t){if(e.layers=[],0<t.layers.length)for(var i=0;i<t.layers.length;i++){var n={},o=t.layers[parseInt(i.toString(),10)];n.id=o.name,n.visible=o.visible,n.lock=o.lock,n.objects=o.objects,e.layers.push(n)}},bMi.prototype.setDataSourceSettings=function(e,t){e.dataSourceSettings={},e.dataSourceSettings.id=t.dataSourceSettings.id,e.dataSourceSettings.dataManager=t.dataSourceSettings.dataSource,e.dataSourceSettings.root=t.dataSourceSettings.root,e.dataSourceSettings.parentId=t.dataSourceSettings.parent,e.dataSourceSettings.crudAction={read:t.dataSourceSettings.crudAction.read,create:t.dataSourceSettings.crudAction.create,update:t.dataSourceSettings.crudAction.update,destroy:t.dataSourceSettings.crudAction.destroy,customFields:t.dataSourceSettings.customFields},t.dataSourceSettings.connectionDataSource&&(e.dataSourceSettings.connectionDataSource={},e.dataSourceSettings.connectionDataSource.id=t.dataSourceSettings.connectionDataSource.id,e.dataSourceSettings.connectionDataSource.dataManager=t.dataSourceSettings.connectionDataSource.dataSource,e.dataSourceSettings.connectionDataSource.sourceID=t.dataSourceSettings.connectionDataSource.sourceNode,e.dataSourceSettings.connectionDataSource.targetID=t.dataSourceSettings.connectionDataSource.targetNode,e.dataSourceSettings.connectionDataSource.sourcePointX=t.dataSourceSettings.connectionDataSource.sourcePointX,e.dataSourceSettings.connectionDataSource.sourcePointY=t.dataSourceSettings.connectionDataSource.sourcePointY,e.dataSourceSettings.connectionDataSource.targetPointX=t.dataSourceSettings.connectionDataSource.targetPointX,e.dataSourceSettings.connectionDataSource.targetPointY=t.dataSourceSettings.connectionDataSource.targetPointY,e.dataSourceSettings.connectionDataSource.crudAction={read:t.dataSourceSettings.connectionDataSource.crudAction.read,create:t.dataSourceSettings.connectionDataSource.crudAction.create,update:t.dataSourceSettings.connectionDataSource.crudAction.update,destroy:t.dataSourceSettings.connectionDataSource.crudAction.destroy,customFields:t.dataSourceSettings.connectionDataSource.customFields})},bMi.prototype.setRulerSettings=function(e,t){e.rulerSettings={},e.rulerSettings.showRulers=t.rulerSettings.showRulers,e.rulerSettings.horizontalRuler=this.setRulerProperties(t.rulerSettings.horizontalRuler),e.rulerSettings.verticalRuler=this.setRulerProperties(t.rulerSettings.verticalRuler)},bMi.prototype.setRulerProperties=function(e){var t={};return t.interval=e.interval,t.segmentWidth=e.segmentWidth,t.markerColor=e.markerColor,t.thickness=e.thickness,t.arrangeTick=e.arrangeTick,t},bMi.prototype.setSnapSettings=function(e,t){e.snapSettings={},t.snapSettings&&(e.snapSettings.horizontalGridLines=this.setGridLines(t.snapSettings.horizontalGridLines),e.snapSettings.verticalGridLines=this.setGridLines(t.snapSettings.verticalGridLines),e.snapSettings.snapAngle=t.snapSettings.snapAngle,e.snapSettings.snapObjectDistance=t.snapSettings.snapObjectDistance,e.snapSettings.constraints=this.setSnapConstraints(t.snapSettings.snapConstraints))},bMi.prototype.setSnapConstraints=function(e){var t=Qfi.None;return e&Qfi.ShowHorizontalLines&&(t|=Qfi.ShowHorizontalLines),e&Qfi.ShowVerticalLines&&(t|=Qfi.ShowVerticalLines),e&Qfi.ShowLines&&(t|=Qfi.ShowLines),e&Qfi.SnapToHorizontalLines&&(t|=Qfi.SnapToHorizontalLines),e&Qfi.SnapToVerticalLines&&(t|=Qfi.SnapToVerticalLines),e&Qfi.SnapToLines&&(t|=Qfi.SnapToLines),t},bMi.prototype.setGridLines=function(e){var t={};return t.lineColor=e.lineColor,t.lineDashArray=e.lineDashArray,t.lineIntervals=e.lineInterval,t.snapIntervals=e.snapInterval,t},bMi.prototype.setScrollSettings=function(e,t){e.scrollSettings={horizontalOffset:t.scrollSettings.horizontalOffset,verticalOffset:t.scrollSettings.verticalOffset,currentZoom:t.scrollSettings.currentZoom,viewPortWidth:t.scrollSettings.viewPortWidth,viewPortHeight:t.scrollSettings.viewPortHeight,minZoom:t.scrollSettings.minZoom,maxZoom:t.scrollSettings.maxZoom,scrollLimit:t.pageSettings.scrollLimit.charAt(0).toUpperCase()+t.pageSettings.scrollLimit.slice(1),scrollableArea:t.pageSettings.scrollableArea,canAutoScroll:t.enableAutoScroll,autoScrollBorder:t.pageSettings.autoScrollBorder}},bMi.prototype.setPageSettings=function(e,t){e.pageSettings={width:t.pageSettings.pageWidth,height:t.pageSettings.pageHeight,margin:{left:t.pageSettings.pageMargin,right:t.pageSettings.pageMargin,top:t.pageSettings.pageMargin,bottom:t.pageSettings.pageMargin},orientation:t.pageSettings.pageOrientation.charAt(0).toUpperCase()+t.pageSettings.pageOrientation.slice(1),boundaryConstraints:t.pageSettings.boundaryConstraints.charAt(0).toUpperCase()+t.pageSettings.boundaryConstraints.slice(1),background:{color:t.pageSettings.pageBackgroundColor,source:t.backgroundImage.source,scale:t.backgroundImage.scale,align:t.backgroundImage.align},multiplePage:t.pageSettings.multiplePage,showPageBreaks:t.pageSettings.showPageBreak}},bMi.prototype.setContextMenu=function(e,t){e.contextMenuSettings={},e.contextMenuSettings.show=t.enableContextMenu,void 0!==t.contextMenu&&(e.contextMenuSettings.showCustomMenuOnly=t.contextMenu.showCustomMenuItemsOnly,e.contextMenuSettings.items=this.getContextMenuItems(t.contextMenu.items))},bMi.prototype.getContextMenuItems=function(e){for(var t={},i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)];t.id=n.name,t.text=n.text,this.items.push(t),e.subItems&&0<e.subItems.length&&this.getContextMenuItems(e.subItems)}return this.items},bMi.prototype.setTooltip=function(e,t){e.tooltip={content:t.tooltip.templateId,relativeMode:t.tooltip.relativeMode}},bMi.prototype.setModelLayout=function(e,t){e.layout={fixedNode:t.layout.fixedNode,horizontalSpacing:t.layout.horizontalSpacing,verticalSpacing:t.layout.verticalSpacing,maxIteration:t.layout.maxIteration,springFactor:t.layout.springFactor,springLength:t.layout.springLength,margin:{left:t.layout.margin.left,right:t.layout.margin.right,top:t.layout.margin.top,bottom:t.layout.margin.bottom},horizontalAlignment:t.layout.horizontalAlignment.charAt(0).toUpperCase()+t.layout.horizontalAlignment.slice(1),verticalAlignment:t.layout.verticalAlignment.charAt(0).toUpperCase()+t.layout.verticalAlignment.slice(1),orientation:"toptobottom"===t.layout.orientation?"TopToBottom":"bottomtotop"===t.layout.orientation?"BottomToTop":"righttoleft"===t.layout.orientation?"RightToLeft":"LeftToRight",connectorSegments:t.layout.getConnectorSegments,type:t.layout.type.charAt(0).toUpperCase()+t.layout.type.slice(1),getLayoutInfo:t.layout.getLayoutInfo,bounds:t.layout.bounds,root:t.layout.root},e.layout&&"Hierarchicaltree"===e.layout.type?e.layout.type="HierarchicalTree":e.layout&&"Organizationalchart"===e.layout.type?e.layout.type="OrganizationalChart":e.layout&&"Radialtree"===e.layout.type&&(e.layout.type="RadialTree")},bMi.prototype.setSelectedItems=function(e,t){e.selectedItems={};e.selectedItems.nodes=[],e.selectedItems.connectors=[],e.selectedItems.offsetX=t.selectedItems.offsetX,e.selectedItems.offsetY=t.selectedItems.offsetY,e.selectedItems.width=t.selectedItems.width,e.selectedItems.height=t.selectedItems.height,e.selectedItems.rotateAngle=t.selectedItems.rotateAngle,e.selectedItems.constraints=this.setSelectorConstraints(t.selectedItems.constraints),e.selectedItems.userHandles=t.selectedItems.userHandles},bMi.prototype.setSelectorConstraints=function(e){var t=Ufi.None;return e&Ufi.ConnectorSourceThumb&&(t|=Ufi.Rotate),e&Ufi.ResizeAll&&(t|=Ufi.ResizeAll),e&Ufi.ResizeSouthEast&&(t|=Ufi.UserHandle),e&Ufi.ToolTip&&(t|=Ufi.ToolTip),e&Ufi.All&&(t|=Ufi.All),t},bMi.prototype.setDiagramConstraints=function(e){var t=$fi.None;return e&$fi.UserInteraction&&(t|=$fi.UserInteraction),e&$fi.ApiUpdate&&(t|=$fi.ApiUpdate),e&$fi.PageEditable&&(t|=$fi.PageEditable),e&$fi.LineRouting&&(t|=$fi.Bridging),e&$fi.Zoom&&(t|=$fi.Zoom),e&$fi.PanX&&(t|=$fi.PanX),e&$fi.PanY&&(t|=$fi.PanY),e&$fi.Pan&&(t|=$fi.Pan),e&$fi.UndoRedo&&(t|=$fi.UndoRedo),e&$fi.ZoomTextEdit&&(t|=$fi.ZoomTextEdit),t},bMi.prototype.setDiagramTool=function(e){var t=eyi.None;return e&eyi.MultipleSelect&&(t|=eyi.SingleSelect),e&eyi.ZoomPan&&(t|=eyi.MultipleSelect),e&eyi.DrawOnce&&(t|=eyi.ZoomPan),e&eyi.ContinuousDraw&&(t|=eyi.DrawOnce),e&eyi.ContinuousDraw&&(t|=eyi.ContinuousDraw),t},bMi.prototype.destroy=function(){},bMi.prototype.getModuleName=function(){return"Ej1Serialization"};nte=bMi;function bMi(e){this.labelProperties=new uMi(this),this.connectorProperties=new pMi(this.labelProperties),this.portProperties=new yMi(this),this.nodeProperties=new mMi(this.labelProperties,this.portProperties),this.convertedData={},this.items=[],this.diagram=e}function wMi(e){return e.sourcePoint||e.targetPoint||e.sourceID||e.targetID||e.sourcePortID||e.targetPortID||e.sourceDecorator||e.targetDecorator?ISi:(!e.shape||e.shape instanceof txi||e.shape.type,MIi)}CMi=function(e,t){return(CMi=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])}))(e,t)};var CMi,SMi,z$=function(e,t){function i(){this.constructor=e}CMi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ode=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},AMi=(z$(xMi,SMi=n),Ode([e("")],xMi.prototype,"id",void 0),Ode([e()],xMi.prototype,"height",void 0),Ode([e(!0)],xMi.prototype,"expanded",void 0),Ode([e("")],xMi.prototype,"iconCss",void 0),Ode([e("")],xMi.prototype,"title",void 0),Ode([Pt(wMi)],xMi.prototype,"symbols",void 0),xMi);function xMi(e,t,i,n){return SMi.call(this,e,t,i,n)||this}z$(TMi,IMi=n),Ode([e()],TMi.prototype,"width",void 0),Ode([e()],TMi.prototype,"height",void 0);var IMi,P2=TMi;function TMi(){return null!==IMi&&IMi.apply(this,arguments)||this}z$(DMi,EMi=n),Ode([e()],DMi.prototype,"width",void 0),Ode([e()],DMi.prototype,"height",void 0),Ode([t({},Hmi)],DMi.prototype,"offset",void 0);var EMi,D2=DMi;function DMi(){return null!==EMi&&EMi.apply(this,arguments)||this}z$(kMi,MMi=Ji),kMi.prototype.onPropertyChanged=function(e,t){for(var i,n=!1,o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"width":this.element.style.width=this.width.toString();break;case"height":this.element.style.height=this.height.toString();break;case"symbolPreview":break;case"symbolWidth":case"symbolHeight":case"getSymbolInfo":n=!this.isReact;break;case"enableSearch":e.enableSearch&&!N?this.createTextbox():(i=document.getElementById(this.element.id+"_search"))&&i.parentNode.removeChild(i);break;case"palettes":for(var s=0,a=Object.keys(e.palettes);s<a.length;s++){var l=a[s],l=Number(l);N||this.accordionElement.items[parseInt(l.toString(),10)]||(this.accordionElement.items[parseInt(l.toString(),10)]={header:e.palettes[parseInt(l.toString(),10)].title||"",expanded:e.palettes[parseInt(l.toString(),10)].expanded,iconCss:e.palettes[parseInt(l.toString(),10)].iconCss||""}),e.palettes[parseInt(l.toString(),10)].height&&(document.getElementById(this.palettes[parseInt(l.toString(),10)].id+"_content").style.height=e.palettes[parseInt(l.toString(),10)].height+"px"),void 0===e.palettes[parseInt(l.toString(),10)].iconCss||N||(this.accordionElement.items[parseInt(l.toString(),10)].iconCss=e.palettes[parseInt(l.toString(),10)].iconCss||"",n=!0),void 0===e.palettes[parseInt(l.toString(),10)].expanded||N||(this.palettes[parseInt(l.toString(),10)].isInteraction?this.palettes[parseInt(l.toString(),10)].isInteraction=!1:(this.accordionElement.items[parseInt(l.toString(),10)].expanded=e.palettes[parseInt(l.toString(),10)].expanded,this.isExpand=!0),this.isExpandMode)||this.isMethod||this.isExpand||(this.isExpand=!0)}break;case"enableAnimation":N||(this.enableAnimation?this.accordionElement.animation={expand:{duration:400},collapse:{duration:400}}:this.accordionElement.animation={expand:{duration:0},collapse:{duration:0}});break;case"expandMode":N||(this.accordionElement.expandMode=this.expandMode,this.isExpandMode=n=!0);break;case"allowDrag":this.allowDrag=e.allowDrag,this.allowDrag?(this.initDraggable(),this.draggable.helper=this.helper):this.draggable.helper=function(){return null}}if(n&&this.refreshPalettes(),this.isExpand&&!n){this.refresh(),this.isExpand=!1;for(var h=0;h<this.palettes.length;h++){var d=this.palettes[parseInt(h.toString(),10)].id;window[""+d]&&1<window[""+d].length&&(window[""+d][1].parentNode.removeChild(window[""+d][1]),window[""+d][1]=null)}}this.isMethod=!1},kMi.prototype.getPersistData=function(){return this.addOnPersist(["loaded"])},kMi.prototype.preRender=function(){var n=this,e=(this.l10n=new Cn(this.getModuleName(),this.defaultLocale(),this.locale),""===this.element.id&&(e=document.getElementsByClassName("e-symbolpalette").length,this.element.id="symbolpalette_"+this.paletteid+"_"+e),this.element.style.overflow="auto",this.element.style.height=this.height.toString(),this.element.style.width=this.width.toString(),this.enableSearch&&!N&&this.createTextbox(),N||(e=pTi("div",{id:this.element.id+"_container"}),this.accordionElement=new x4({expandMode:this.expandMode}),this.enableAnimation||(this.accordionElement.animation={expand:{duration:0},collapse:{duration:0}}),this.accordionElement.created=function(){n.checkOnRender=!0},this.accordionElement.expanded=function(e){var t=n.accordionElement.items.indexOf(e.item),i=n.allowServerDataBinding;n.allowServerDataBinding=!1,n.palettes[parseInt(t.toString(),10)].expanded=e.isExpanded,n.palettes[parseInt(t.toString(),10)].isInteraction=!0,n.allowServerDataBinding=i},this.accordionElement.expanding=function(e){var t;n.checkOnRender&&(t={element:e.element,content:e.content,index:e.index,cancel:!1,isExpanded:e.isExpanded,palette:n.palettes[e.index]},n.trigger("paletteExpanding",t),e.cancel=t.cancel)},this.element.appendChild(e)),"measureElement");window[e]&&(window[e]=null),CTi(),this.unWireEvents(),this.wireEvents()},kMi.prototype.defaultLocale=function(){return{SearchShapes:"Search Shapes"}},kMi.prototype.render=function(){this.diagramRenderer=new tAi(this.element.id,new $Si,!1),this.svgRenderer=new tAi(this.element.id,new $Si,!0),this.updatePalettes(),N||this.accordionElement.appendTo("#"+this.element.id+"_container"),this.renderComplete()},kMi.prototype.getModuleName=function(){return"SymbolPalette"},kMi.prototype.requiredModules=function(){var e=[];return e.push({member:"Bpmn",args:[]}),e},kMi.prototype.destroy=function(){var e,t,i;this.allowDrag&&(this.draggable.destroy(),this.unWireEvents(),this.notify("destroy",{}),MMi.prototype.destroy.call(this),(e=document.getElementById(this.element.id+"_container"))&&(this.element.removeChild(e),t="measureElement",window[t])&&(--window[t].usageCount,i="measureElementCount",window[i]--,0===window[i])&&(window[t].parentNode.removeChild(window[t]),window[t]=null),e=document.getElementById(this.element.id+"_search"))&&e.parentNode.removeChild(e)},kMi.prototype.addPalettes=function(e){for(var t,i=0;i<e.length;i++){var n=this.allowServerDataBinding;this.isProtectedOnChange=!0,this.allowServerDataBinding=!1,t=new AMi(this,"palettes",e[parseInt(i.toString(),10)],!0),this.palettes.push(t),this.initSymbols(t),this.allowServerDataBinding=n,this.isProtectedOnChange=!1,this.renderPalette(t)}this.bulkChanges={},N||this.accordionElement.refresh()},kMi.prototype.removePalette=function(e){for(var t=0;t<this.palettes.length;t++)if(this.palettes[parseInt(t.toString(),10)].id===e){this.palettes.splice(t,1),N||this.accordionElement.items.splice(t,1);break}},kMi.prototype.removePalettes=function(e){var t=this.allowServerDataBinding;this.allowServerDataBinding=!1;for(var i=0;i<e.length;i++)this.removePalette(e[parseInt(i.toString(),10)]);N?this.updatePalettes():this.accordionElement.refresh(),this.allowServerDataBinding=t},kMi.prototype.initSymbols=function(e){for(var t,i,n,o,r,s,a=[],l=0,h=0,d=0,p=e.symbols;d<p.length;d++)"SwimLane"===(b=p[d]).shape.type&&(s="Horizontal"===(o=(r=b).shape).orientation,o.isLane?(l=s?this.symbolHeight-this.symbolHeight/2:this.symbolHeight-this.symbolHeight/4,h=s?this.symbolWidth-this.symbolWidth/4:this.symbolWidth-this.symbolWidth/2,this.laneTable[b.id]={height:l,width:h},t=o.lanes[0].header,i=o.lanes[0].style,n=t.style,(n={id:"header"+xTi(),shape:{type:"Basic",shape:"Rectangle"},width:(s?t:r).width,height:(s?r:t).height,style:n,annotations:[{content:t.annotation.content}]}).offsetX=n.width/2,n.offsetY=n.height/2,this.addPaletteItem(e.id,n),(t={id:"lane"+xTi(),shape:{type:"Basic",shape:"Rectangle"},width:s?r.width-t.width:r.width,height:s?r.height:r.height-t.height,style:i}).offsetX=s?n.width+t.width/2:t.width/2,t.offsetY=s?t.height/2:n.height+t.height/2,this.addPaletteItem(e.id,t),r.children=[n.id,t.id]):o.isPhase&&(l=r.height||this.symbolHeight,h=r.width||this.symbolWidth,b.shape.type="Path",b.shape.data=s?"M0,0 L"+h+",0":"M0,0 L0,"+h)),"UmlClassifier"!==b.shape.type||b.shape.relationship||(n=i=void 0,n="white"===(t=b).style.fill?{fill:"#26A0DA"}:{fill:b.style.fill},"Class"===b.shape.classifier?(i={id:"node"+xTi(),shape:{type:"HTML",content:'<div id="parentDiv" style="width:100%; height:50%; border:1px solid #000; background:#6BA5D7; display: flex; align-items: center; justify-content: center;"><div id="textDiv" style="font-size:0.7vw;">class</div></div>'},width:t.width||100,height:t.height||100,style:n,offsetX:t.width?t.width/2:50,offsetY:t.height?t.height/2:50},this.addPaletteItem(e.id,i)):"Enumeration"===b.shape.classifier?(i={id:"node"+xTi(),shape:{type:"HTML",content:'<div id="parentDiv2" style="width:100%; height:50%; border:1px solid #000; background:#6BA5D7; display: flex; align-items: center; justify-content: center;"><div id="textDiv2" style="font-size:0.5vw;">Enumeration</div></div>'},width:t.width||100,height:t.height||100,style:n,offsetX:t.width?t.width/2:50,offsetY:t.height?t.height/2:50},this.addPaletteItem(e.id,i)):"Interface"===b.shape.classifier&&(i={id:"node"+xTi(),shape:{type:"HTML",content:'<div id="parentDiv3" style="width:100%; height:50%; border:1px solid #000; background:#6BA5D7; display: flex; align-items: center; justify-content: center;"><div id="textDiv3" style="font-size:0.7vw;">Interface</div></div>'},width:t.width||100,height:t.height||100,style:n,offsetX:t.width?t.width/2:50,offsetY:t.height?t.height/2:50},this.addPaletteItem(e.id,i)),o={id:"member"+xTi(),shape:{type:"HTML",content:'<div style="width:100%;height:100%;border:1px solid #000;background:white"></div>'},width:t.width||100,height:t.height||100,offsetX:t.width?t.width/2:50,offsetY:t.height?t.height/2+i.height/2:50+i.height/2},this.addPaletteItem(e.id,o),t.children=[i.id,o.id]),"UmlClassifier"===b.shape.type&&b.shape.relationship&&("Inheritance"===b.shape.relationship&&(b.style.strokeDashArray=b.style.strokeDashArray||"4 4"),"Dependency"===b.shape.relationship)&&(b.style.strokeDashArray=b.style.strokeDashArray||"4 4"),b instanceof MIi?(r=jTi(this.getNodeDefaults))&&r(b,this):b instanceof ISi&&(s=jTi(this.getConnectorDefaults))&&s(b,this),(this.symbolTable[b.id]=b)instanceof MIi&&b.children&&a.push(b);for(var c=0;c<a.length;c++)for(var u=void 0,g=0;g<a[parseInt(c.toString(),10)].children.length;g++)(u=this.symbolTable[a[parseInt(c.toString(),10)].children[parseInt(g.toString(),10)]])&&((this.childTable[u.id]=u).parentId=a[parseInt(c.toString(),10)].id);for(var m=0,f=e.symbols;m<f.length;m++)(b=f[m])instanceof MIi&&b.children||this.prepareSymbol(b);for(var y=0,v=a;y<v.length;y++){var b=v[y];this.prepareSymbol(b)}},kMi.prototype.renderPalette=function(e){var t,i="display:none;overflow:auto;",i=(e.height&&(i+="height:"+e.height+"px"),document.getElementById(e.id),pTi("div",{id:e.id,style:i,class:"e-remove-palette"}));this.element.appendChild(i),N||(t={header:e.title,expanded:e.expanded,content:"#"+e.id,iconCss:e.iconCss},this.accordionElement.items.push(t)),this.renderSymbols(e,i)},kMi.prototype.addPaletteItem=function(e,t,i){t=DTi(t);for(var n=0;n<this.palettes.length;n++){var o=this.palettes[parseInt(n.toString(),10)];if(-1!==o.id.indexOf(e)){for(var r=[void 0,o,"symbols",{},!0],s=new(Function.prototype.bind.apply(wMi(t),r)),a=0;a<Object.keys(t).length;a++){var l=this.allowServerDataBinding;this.allowServerDataBinding=!1,s[Object.keys(t)[parseInt(a.toString(),10)]]=t[Object.keys(t)[parseInt(a.toString(),10)]],this.allowServerDataBinding=l}bAi(s,t,s instanceof MIi?this.nodeDefaults:this.connectorDefaults),o.symbols.push(s);var r=this.allowServerDataBinding;this.allowServerDataBinding=!1,this.prepareSymbol(s),this.allowServerDataBinding=r,this.symbolTable[s.id]=s,i?this.childTable[s.id]=s:(r=document.getElementById(o.id))&&r.appendChild(this.getSymbolContainer(s,r));break}}},kMi.prototype.removePaletteItem=function(e,t){for(var i,n=0;n<this.palettes.length;n++){var o=this.palettes[parseInt(n.toString(),10)];if(-1!==o.id.indexOf(e))for(var r=0,s=o.symbols;r<s.length;r++){var a=s[r];if(-1!==a.id.indexOf(t)){var l=o.symbols.indexOf(a);if(o.symbols.splice(l,1),a.children)for(var h=a.children,d=0;d<h.length;d++)delete this.symbolTable[h[parseInt(d.toString(),10)]];delete this.symbolTable[a.id];l=document.getElementById(a.id+"_container");l.parentNode.removeChild(l),i=!0;break}}if(i)break}},kMi.prototype.prepareSymbol=function(e){var t,i,n,o,r,s,a=new W1i,l=e,h=new Vyi,d=e instanceof MIi?e.initContainer():null,p=(d&&!d.children&&(d.children=[]),jTi(this.getSymbolTemplate));if(!(c=p?p(e):c))if(l.children)c=this.getContainer(l,d);else{if(e instanceof ISi&&"UmlClassifier"===e.shape.type&&e.shape.relationship)for(var c,u=(c=e.init(this)).children.length-1;0<=u;u--)c.children[parseInt(u.toString(),10)]instanceof Tyi&&c.children.splice(u,1);else c=e.init(this);e instanceof MIi&&e.parentId&&d.children.push(c)}e.parentId||(p={width:this.symbolWidth,height:this.symbolHeight},p=(p=(n=jTi(this.getSymbolInfo))?n(e):p)||this.symbolInfo||{},e.shape&&e.shape.isPhase&&(p.width=p.width||this.symbolWidth,p.height=p.height||this.symbolHeight),c.relativeMode="Object",c.horizontalAlignment=c.verticalAlignment="Center",h.style.strokeColor=h.style.fill="none",h.children=[c],c.measure(new Omi),c.arrange(c.desiredSize),n=p.width=p.width||(void 0!==l.width?c.actualSize.width:void 0)||this.symbolWidth,i=p.height=p.height||(void 0!==l.height?c.actualSize.height:void 0)||this.symbolHeight,void 0!==n&&void 0!==i?(s=n,o=i,r=!!e.shape.isPhase,void 0!==this.symbolWidth?s=this.symbolWidth-this.symbolMargin.left-this.symbolMargin.right:n+=l.style.strokeWidth,void 0!==this.symbolHeight?o=this.symbolHeight-this.symbolMargin.top-this.symbolMargin.bottom:i+=l.style.strokeWidth,e.shape&&"Bpmn"!==e.shape.type&&p.description&&""!==p.description.text&&(o-=20),t=s/(!r&&c.width||n),r=o/(!r&&c.height||i),p.fit&&(t=s/p.width,r=o/p.height),n=s,i=o,t=r=Math.min(t,r),h.width=n,h.height=i,c.width=p.width,c.height=p.height,this.scaleSymbol(e,h,t,r,n,i)):(s=void 0,e instanceof ISi&&(s=gvi(e)),c.width=(e.width||s?s:c.actualSize).width,c.height=(e.height||s?s:c.actualSize).height),(e.wrapper=a).children=[h],c.pivot=a.pivot={x:0,y:0},a.id=c.id+"_symbol",a.style.fill=a.style.strokeColor="transparent",e instanceof MIi?(a.offsetX=e.style.strokeWidth/2,a.offsetY=e.style.strokeWidth/2):(a.offsetX=.5,a.offsetY=.5),this.getSymbolDescription(p,n,a,e),a.padding={left:1,right:1,bottom:1,top:1},a.measure(new Omi),a.arrange(a.desiredSize),p.width=p.width||c.actualSize.width,p.height=p.height||c.actualSize.height,e[this.info]=p),e.parentId&&(d.measure(new Omi(l.width,l.height)),d.arrange(d.desiredSize))},kMi.prototype.getContainer=function(e,t){t.measureChildren=!1;var i,n=e.children;t.children=[];for(var o=0;o<n.length;o++)this.symbolTable[n[parseInt(o.toString(),10)]]&&t.children.push(this.symbolTable[n[parseInt(o.toString(),10)]].wrapper);return t.measure(new Omi(e.width,e.height)),t.arrange(t.desiredSize),0===t.bounds.x&&0===t.bounds.y||(g1i(e,(i=t.bounds).x,i.y,this.symbolTable,!1,this),t=this.getContainer(e,t)),t},kMi.prototype.getSymbolDescription=function(e,t,i,n){var o;e&&e.description&&e.description.text&&(o=new Tyi,e.description.overflow=e.description.overflow||"Ellipsis",e.description.wrap=e.description.wrap||"WrapWithOverflow",o.id=i.id+"_text",o.content=e.description.text,o.width=t,o.height=20,o.style.strokeColor="transparent",o.style.color=e.description.color||"black",o.style.fill=e.description.fill||"transparent",o.style.fontFamily=e.description.fontFamily||"Arial",o.style.fontSize=e.description.fontSize||12,o.style.bold=e.description.bold||!1,o.style.italic=e.description.italic||!1,o.style.textDecoration=e.description.textDecoration||"None",o.style.strokeWidth=0,o.style.textWrapping=e.description.wrap,o.style.textOverflow=e.description.overflow,n.shape&&"Bpmn"===n.shape.type?o.margin={left:0,right:0,top:e.description.margin?e.description.margin.top:0,bottom:(e.description.margin||this.symbolMargin).bottom}:o.margin={left:0,right:0,top:e.description.margin?e.description.margin.top:0,bottom:e.description.margin?e.description.margin.bottom:5},i.children.push(o))},kMi.prototype.renderSymbols=function(e,t){for(var i=0,n=e.symbols;i<n.length;i++){var o=n[i];o.parentId||this.getSymbolContainer(o,t)}},kMi.prototype.getSymbolPreview=function(e,t,i){this.allowServerDataBinding=!1;var n,o,r,s=e.wrapper.children[0].desiredSize.width+e.style.strokeWidth,a=e.wrapper.children[0].desiredSize.height+e.style.strokeWidth,l=e.wrapper.children[0].children[0],h=e.previewSize,h=((e&&(h.width||h.height)||void 0!==this.symbolPreview.width||void 0!==this.symbolPreview.height)&&(s=(h.width||this.symbolPreview.width||s)-e.style.strokeWidth,a=(h.height||this.symbolPreview.height||a)-e.style.strokeWidth,e instanceof ISi&&(l.actualSize.width<=e.style.strokeWidth&&(l.actualSize.width=this.symbolWidth),l.actualSize.height<=e.style.strokeWidth)&&(l.actualSize.height=this.symbolHeight),h=s/l.actualSize.width,d=a/l.actualSize.height,h=d=Math.min(h,d),p=l.actualSize.width*h,r=l.actualSize.height*d,e.wrapper.children[0].width=s,e.wrapper.children[0].height=a,this.measureAndArrangeSymbol(l,e instanceof MIi),this.scaleSymbol(e,e.wrapper.children[0],h,d,p,r,!0),s=p,a=r),{x:l.offsetX,y:l.offsetY}),d=(l.offsetX=l.offsetY=e.style.strokeWidth/2,l.pivot={x:0,y:0},this.measureAndArrangeSymbol(l,e instanceof MIi),pTi("div",{draggable:"true",class:"e-dragclone",style:"pointer-events:none"})),p=(document.body.appendChild(d),"margin:5px;");return"Native"===e.shape.type?(o=cTi("svg",{id:e.id+"_preview",width:Math.ceil(s)+1,height:Math.ceil(a)+1}),r=cTi("g",{id:e.id+"_g"}),o.appendChild(r),d.appendChild(o),this.svgRenderer.renderElement(l,r,void 0,void 0,o),this.prepareSymbol(e)):"HTML"===e.shape.type?(n=this.getHtmlSymbol(e,o,d,a,s,!0),this.prepareSymbol(e)):"UmlClassifier"!==e.shape.type||e.shape.relationship?(e.children&&0<e.children.length&&vAi(e,"HTML",this.childTable)?n=this.getGroupParent(e,o,d,e.wrapper.actualSize.height,e.wrapper.actualSize.width,!0):(o=WTi.createCanvas(e.id+"_preview",2*(Math.ceil(s)+e.style.strokeWidth+1),2*(Math.ceil(a)+e.style.strokeWidth+1)),d.appendChild(o),"Basic"===e.shape.type||"Flow"===e.shape.type?p+="transform: scale(0.5) translate(-"+o.width/2+"px, -"+o.height/2+"px);":p+="transform:scale(0.5);",o.setAttribute("transform-origin","0 0"),r=2,e instanceof ISi&&(r=1.9),o.getContext("2d").setTransform(r,0,0,r,0,0),this.diagramRenderer.renderElement(l,o,void 0)),this.prepareSymbol(e)):e.children&&0<e.children.length&&vAi(e,"HTML",this.childTable)&&(n=this.getHtmlSymbol(e,o,d,e.wrapper.actualSize.height,e.wrapper.actualSize.width,!0),this.prepareSymbol(e)),bTi(n&&("HTML"===e.shape.type||e.children&&0<e.children.length)?n:o,p),l.offsetX=h.x,l.offsetY=h.y,this.allowServerDataBinding=!0,d},kMi.prototype.measureAndArrangeSymbol=function(e,t){e.children&&!t&&(e.children[0].transform=tyi.Self),e.measure(new Omi),e.arrange(e.desiredSize),e.children&&0<e.children.length&&(e.children[0].transform=tyi.Parent)},kMi.prototype.updateSymbolSize=function(e,t,i){var n=e.wrapper.children[0].children[0],o=e.style.strokeWidth;n.width=(t||n.width)-(o+1),n.height=(i||n.height)-(o+1),e.wrapper.measure(new Omi),e.wrapper.arrange(e.wrapper.desiredSize)},kMi.prototype.getSymbolContainer=function(e,t,i){var n,o,r,s=this.symbolTable[e.id][this.info],s=this.getSymbolSize(e,s),a=s.width+1,l=s.height+1,h="SearchPalette"===t.id?e.id+"SearchSymbol":e.id,d=pTi("div",{id:h+"_container",style:"width:"+a+"px;height:"+l+"px;float:left;overflow:hidden"});return t.appendChild(d),"Native"===e.shape.type?(n=cTi("svg",{id:h,width:Math.ceil(e.wrapper.actualSize.width)+1,height:Math.ceil(e.wrapper.actualSize.height)+1}),r=cTi("g",{id:h+"_g"}),n.appendChild(r),d.appendChild(n),this.updateSymbolSize(e),this.svgRenderer.renderElement(e.wrapper,r,void 0,void 0,n)):"HTML"===e.shape.type?o=this.getHtmlSymbol(e,n,d,e.wrapper.actualSize.height,e.wrapper.actualSize.width,!1,"SearchPalette"===t.id):"UmlClassifier"!==e.shape.type||e.shape.relationship?e.children&&0<e.children.length&&vAi(e,"HTML",this.childTable)?o=this.getGroupParent(e,n,d,e.wrapper.actualSize.height,e.wrapper.actualSize.width,!1):(n=WTi.createCanvas(h,Math.ceil(2*(e.wrapper.actualSize.width+e.style.strokeWidth))+1,Math.ceil(2*(e.wrapper.actualSize.height+e.style.strokeWidth))+1),d.appendChild(n),t=2,e instanceof ISi&&(t=1.9),n.getContext("2d").setTransform(t,0,0,t,0,0),this.diagramRenderer.renderElement(e.wrapper,r||n,void 0,void 0,void 0,void 0,!0,void 0,!0)):e.children&&0<e.children.length&&vAi(e,"HTML",this.childTable)&&(o=this.getHtmlSymbol(e,n,d,e.wrapper.actualSize.height,e.wrapper.actualSize.width,!1)),i?n:(h=e.wrapper.actualSize.width+e.style.strokeWidth,t=e.wrapper.actualSize.height+e.style.strokeWidth,r="pointer-events:none;transform-origin:0 0;overflow:hidden;",e.shape.isPhase?"Horizontal"===e.shape.orientation?r+="margin-left:"+Math.max(this.symbolMargin.left,(a-h)/2)+"px;margin-top:"+s.height/2+"px;":r+="margin-left:"+s.width/2+"px;margin-top:"+Math.max(this.symbolMargin.top,(l-t)/2)+"px;":r+="margin-left:"+Math.max(this.symbolMargin.left,(a-h)/2)+"px;margin-top:"+Math.max(this.symbolMargin.top,(l-t)/2)+"px;",n instanceof HTMLCanvasElement&&(r+="transform:scale(.5,.5);"),bTi(o&&("HTML"===e.shape.type||e.children&&0<e.children.length)?o:n,r),d.classList.add("e-symbol-draggable"),d)},kMi.prototype.getGroupParent=function(e,t,i,n,o,r){var s=pTi("div",{id:e.id+(r?"_html_div_preview":"_html_div")}),a=pTi("div",{id:e.id+(r?"_htmlLayer_preview":"_htmlLayer"),style:"width:"+Math.ceil(o+1)+"px;height:"+Math.ceil(n+1)+"px;position:absolute",class:"e-html-layer"}),l=pTi("div",{id:e.id+(r?"_htmlLayer_div_preview":"_htmlLayer_div"),style:"width:"+Math.ceil(o+1)+"px;height:"+Math.ceil(n+1)+"px;position:absolute"});return a.appendChild(l),s.appendChild(a),t=WTi.createCanvas(r?e.id+"_preview":e.id,Math.ceil(o)+1,Math.ceil(n)+1),s.appendChild(t),i.appendChild(s),this.diagramRenderer.renderElement(e.wrapper.children[0].children[0],t,a),s},kMi.prototype.getHtmlSymbol=function(e,t,i,n,o,r,s){var s=s?e.id+"SearchSymbol":e.id,a=pTi("div",{id:s+(r?"_html_div_preview":"_html_div")}),l=pTi("div",{id:s+(r?"_htmlLayer_preview":"_htmlLayer"),style:"width:"+Math.ceil(o+1)+"px;height:"+Math.ceil(n+1)+"px;position:absolute",class:"e-html-layer"}),h=pTi("div",{id:s+(r?"_htmlLayer_div_preview":"_htmlLayer_div"),style:"width:"+Math.ceil(o+1)+"px;height:"+Math.ceil(n+1)+"px;position:absolute"}),h=(l.appendChild(h),a.appendChild(l),e.wrapper.actualSize.width+e.style.strokeWidth),d=e.wrapper.actualSize.height+e.style.strokeWidth,p=(p="pointer-events:none;transform-origin:0 0;overflow:hidden;")+("margin-left:"+Math.max(this.symbolMargin.left,(o-h)/2)+"px;margin-top:"+Math.max(this.symbolMargin.top,(n-d)/2)+"px;")+"transform:scale(.5,.5);position:absolute";return t=WTi.createCanvas(s,Math.ceil(2*(e.wrapper.actualSize.width+e.style.strokeWidth))+1,Math.ceil(2*(e.wrapper.actualSize.height+e.style.strokeWidth))+1),i.appendChild(t),t.getContext("2d").setTransform(2,0,0,2,0,0),bTi(t,p),i.appendChild(a),r?("UmlClassifier"===e.shape.type&&("Class"===e.shape.classifier?e.wrapper.children[0].children[0].children[0].content='<div id="parentDiv" style="width:100%; height:50%; border:1px solid #000; background:#6BA5D7; display: flex; align-items: center; justify-content: center;"><div id="textDiv" style="font-size:1vw;">class</div></div>':"Enumeration"===e.shape.classifier?e.wrapper.children[0].children[0].children[0].content='<div id="parentDiv2" style="width:100%; height:50%; border:1px solid #000; background:#6BA5D7; display: flex; align-items: center; justify-content: center;"><div id="textDiv2" style="font-size:0.8vw;">Enumeration</div></div>':"Interface"===e.shape.classifier&&(e.wrapper.children[0].children[0].children[0].content='<div id="parentDiv3" style="width:100%; height:50%; border:1px solid #000; background:#6BA5D7; display: flex; align-items: center; justify-content: center;"><div id="textDiv3" style="font-size:0.9vw;">Interface</div></div>')),this.diagramRenderer.renderElement(e.wrapper.children[0].children[0],t,l)):this.diagramRenderer.renderElement(e.wrapper,t,l),a},kMi.prototype.getSymbolSize=function(e,t){var i=e.wrapper.actualSize.width,n=e.wrapper.actualSize.height;return this.symbolWidth||this.symbolHeight?(i=this.symbolWidth,n=Math.max(this.symbolHeight,n)):(i+=this.symbolMargin.left+this.symbolMargin.right+e.style.strokeWidth,n+=this.symbolMargin.top+this.symbolMargin.bottom+e.style.strokeWidth),new Omi(i,n)},kMi.prototype.getMousePosition=function(e){var t,i;return{x:-1!==e.type.indexOf("touch")?(i=e.changedTouches[0].clientY,t=e.changedTouches[0].clientX,i=i-this.element.offsetTop,t-this.element.offsetLeft):(i=e.clientY-this.element.offsetTop,e.clientX-this.element.offsetLeft),y:i}},kMi.prototype.getContent=function(e){return this.hoverElement instanceof MIi&&this.hoverElement.constraints&Kfi.Tooltip||this.hoverElement instanceof ISi&&this.hoverElement.constraints&Yfi.Tooltip?this.hoverElement.tooltip.content:e.id},kMi.prototype.initTooltip=function(e){var t;return N||(t=new NS,t=this.updateTooltipContent(this.hoverElement.tooltip,t),(t=new NS(t)).cssClass="e-symbolPalette-tooltip",t.opensOn="custom",t.appendTo("#"+e.id),t.close()),t},kMi.prototype.updateTooltipContent=function(e,t){return t.content=e.content,t.position="BottomRight",t.showTipPointer=e.showTipPointer,t.width=e.width,t.height=e.height,e.animation?t.animation=e.animation:t.animation={close:{effect:"None"}},t},kMi.prototype.elementEnter=function(e,t,i){t||(this.symbolTooltipObject.windowCollision=!0,this.hoverElement.tooltip.isSticky&&(this.symbolTooltipObject.isSticky=!0),this.hoverElement instanceof MIi?this.hoverElement.constraints&(Kfi.Default&&Kfi.Tooltip)||(this.hoverElement.tooltip.content=this.hoverElement.id,this.symbolTooltipObject.content=ao(function(){return this.hoverElement.id},this)):this.hoverElement instanceof ISi&&(this.hoverElement.constraints&(Yfi.Default&&Yfi.Tooltip)||(this.hoverElement.tooltip.content=this.hoverElement.id,this.symbolTooltipObject.content=ao(function(){return this.hoverElement.id},this))),this.hoverElement.tooltip.content&&("Mouse"===this.hoverElement.tooltip.relativeMode&&(this.hoverElement.tooltip.relativeMode="Object"),this.symbolTooltipObject.offsetX=0,this.symbolTooltipObject.offsetY=0),t=i?this.hoverElement.id+"SearchSymbol":this.hoverElement.id,i=document.getElementById(t),"Auto"===this.hoverElement.tooltip.openOn&&""!==this.hoverElement.tooltip.content&&(this.symbolTooltipObject.close(),this.symbolTooltipObject.opensOn=this.hoverElement.tooltip.openOn,this.symbolTooltipObject.dataBind()),"Auto"===this.hoverElement.tooltip.openOn&&(this.symbolTooltipObject.target=this.hoverElement.id,this.symbolTooltipObject.open(i)))},kMi.prototype.mouseMove=function(e,t){!this.highlightedSymbol||this.selectedSymbol&&this.selectedSymbol.id+"_container"===this.highlightedSymbol.id||(this.highlightedSymbol.classList.remove("e-symbol-hover"),this.highlightedSymbol.style.backgroundColor="",this.highlightedSymbol=null);var i=e.target.id.split("_container")[0],n=((this.symbolTable[""+i]||"SearchPalette"!==i&&e.target&&e.target.id.includes("SearchSymbol"))&&((n=document.getElementById(i+"_container")).classList.add("e-symbol-hover"),this.highlightedSymbol=n),e.preventDefault(),!1),o=(e.target&&e.target.id.includes("SearchSymbol")&&(n=!0,i=i.split("SearchSymbol")[0]),this.symbolTable[""+i]);this.symbolTable[""+i]&&o!==this.hoverElement&&(this.currentPosition=this.getMousePosition(e),i=this.getContent(o),this.hoverElement&&"Auto"===this.hoverElement.tooltip.openOn&&""!==i&&this.elementLeave(),this.hoverElement=o,this.symbolTooltipObject=this.initTooltip(this.hoverElement),""===i&&(i=this.hoverElement.id),this.hoverElement.tooltip)&&""!==i&&this.elementEnter(this.currentPosition,!1,n),void 0===o&&this.hoverElement&&!this.hoverElement.tooltip.isSticky&&"Auto"===this.hoverElement.tooltip.openOn&&(this.hoverElement=null,this.elementLeave())},kMi.prototype.elementLeave=function(){this.symbolTooltipObject&&"Custom"!==this.symbolTooltipObject.opensOn&&this.symbolTooltipObject.close()},kMi.prototype.mouseLeave=function(e){this.elementLeave(),e.preventDefault()},kMi.prototype.mouseUp=function(e){var t,i;this.isMethod=!0,e&&e.target&&("iconSearch"===e.srcElement.id?(t=document.getElementById("iconSearch")).classList.contains("e-clear-searchtext")&&(t.className="e-input-group-icon e-search e-icons",document.getElementById("textEnter").value="",this.searchPalette("")):(t=e.target.id.split("_container")[0])&&this.selectedSymbol?(i={oldValue:this.oldObject,newValue:t},this.trigger("paletteSelectionChange",i),this.oldObject=t,e.preventDefault()):""!==this.oldObject&&(this.oldObject=""))},kMi.prototype.keyUp=function(e){var t,i=this;this.enableSearch&&(t=this,document.getElementById("iconSearch").className="e-input-group-icon e-clear-searchtext e-icons",!e||"Enter"!==e.key&&13!==e.keyCode?(this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){e.target instanceof HTMLInputElement&&(t.searchPalette(e.target.value),i.timer=null)},500)):e.target instanceof HTMLInputElement&&this.searchPalette(e.target.value))},kMi.prototype.mouseDown=function(e){var t,i,n=e.target.id.split("_container")[0],o=!1;n.includes("SearchSymbol")&&(n=n.split("SearchSymbol")[0],o=!0),this.selectedSymbol&&(i=document.getElementById(this.selectedSymbol.id+"_container"),t=document.getElementById(this.selectedSymbol.id+"SearchSymbol_container"),(i||t)&&(i.classList.remove("e-symbol-selected"),t)&&t.classList.remove("e-symbol-selected"),(i=document.getElementById(this.selectedSymbol.id+"_container"))&&(i.style.backgroundColor=""),this.selectedSymbol=null),this.symbolTable[""+n]&&((i=document.getElementById((o?n+"SearchSymbol":n)+"_container")).classList.add("e-symbol-selected"),this.selectedSymbol=this.symbolTable[""+n],e.preventDefault())},kMi.prototype.keyDown=function(e){e&&"Escape"===e.key&&(e=this.draggable.helperElement)&&e.parentNode&&(e.parentNode.removeChild(e),this.draggable.intDestroy())},kMi.prototype.initDraggable=function(){this.allowDrag&&(this.draggable=new hn(this.element,{dragTarget:".e-symbol-draggable",helper:this.helper,dragStart:this.dragStart,preventDefault:!1,dragStop:this.dragStop,drag:function(e){var t=uTi(e.target,"e-droppable");t&&t.classList.contains("e-diagram")&&t.ej2_instances[0].droppable.over(e)},cursorAt:{left:this.symbolPreview.offset.x,top:this.symbolPreview.offset.y}}))},kMi.prototype.dragStart=function(e){var t=this.helper[0];t&&t.setAttribute("paletteId",this.element.id)},kMi.prototype.dragStop=function(e){uTi(e.target,"e-diagram")||ue(e.helper)},kMi.prototype.scaleSymbol=function(e,t,i,n,o,r,s){if(e instanceof ISi){for(var a=e.wrapper,l=(e.wrapper=t.children[0],e.scale(i,n,o,r,t.children[0])),h=o/2-t.children[0].children[0].offsetX+l.x/2,d=r/2-t.children[0].children[0].offsetY+l.y/2,p=0,c=t.children[0].children;p<c.length;p++){var u=c[p];u.offsetX+=h,u.offsetY+=d,u.staticSize=!1}e.wrapper=a}else if("Bpmn"===e.shape.type&&this.bpmnModule){a=e.wrapper;(e.wrapper=t).children[0].width=o,t.children[0].height=r,this.bpmnModule.updateBPMN({width:o,height:r},e,e,null),e.wrapper=a}else if(e.children){var g,m,f=e.children;if(!s)for(var y,v=void 0,b=0;b<f.length;b++)(v=t.children[0].children[parseInt(b.toString(),10)])&&(v.children[0].children&&this.measureChild(v),y=this.symbolTable[v.id],v.width=y.width,v.height=y.height,v.measure(new Omi),v.arrange(v.children[0].desiredSize));if(g=o/t.children[0].desiredSize.width,m=r/t.children[0].desiredSize.height,t.children[0].measure(new Omi),t.children[0].arrange(t.children[0].desiredSize),!s)for(var w=void 0,b=0;b<f.length;b++)(w=t.children[0].children[parseInt(b.toString(),10)])&&(w.children[0].children&&this.scaleChildren(w,g,m,e),this.scaleGroup(w,g,m,e));if(s){for(var C,S,w=void 0,b=0;b<f.length;b++)C=o/e.wrapper.children[0].desiredSize.width,S=r/e.wrapper.children[0].desiredSize.height,(w=t.children[0].children[parseInt(b.toString(),10)])&&(w.children[0].children&&this.scaleChildren(w,C,S,e,!0),this.scaleGroup(w,C,S,e,!0));e.wrapper.children[0].measure(new Omi),e.wrapper.children[0].arrange(e.wrapper.children[0].desiredSize)}}else u1i(t.children[0],i,n,t)},kMi.prototype.scaleChildren=function(e,t,i,n,o){for(var r,s=0;s<e.children.length;s++)(r=e.children[parseInt(s.toString(),10)]).children[0].children?this.scaleChildren(r,t,i,n,o):this.scaleGroup(r,t,i,n,o)},kMi.prototype.measureChild=function(e){for(var t,i,n=0;n<e.children.length;n++)(t=e.children[parseInt(n.toString(),10)]).children[0].children?this.measureChild(t):(i=this.symbolTable[t.id],t.width=i.width,t.height=i.height,t.measure(new Omi),t.arrange(t.children[0].desiredSize))},kMi.prototype.scaleGroup=function(e,t,i,n,o){e.width=e.width*t,e.height=e.height*i,e.offsetX=o?e.offsetX*t-n.style.strokeWidth:e.offsetX*t+n.style.strokeWidth/2,e.offsetY=o?e.offsetY*i-n.style.strokeWidth:e.offsetY*i+n.style.strokeWidth/2,e.measure(new Omi),e.arrange(e.children[0].desiredSize)},kMi.prototype.refreshPalettes=function(){N||(this.accordionElement.items=[]);for(var e="e-remove-palette",t=this.element.id,i=(t&&document.getElementById(t).classList.contains(e)?document.getElementById(t):document).getElementsByClassName(e);0<i.length;)i[0].parentNode.removeChild(i[0]);this.updatePalettes(),N||this.accordionElement.dataBind()},kMi.prototype.updatePalettes=function(){for(var e=0;e<this.palettes.length;e++){var t=this.palettes[parseInt(e.toString(),10)];"search_palette"===t.id?(this.palettes.splice(e,1),e--):(this.initSymbols(t),this.renderPalette(t))}},kMi.prototype.createTextbox=function(){var e=pTi("div",{id:this.element.id+"_search"}),t=(bTi(e,"height:30px"),e.className="e-input-group",this.element.appendChild(e),pTi("input",{})),t=(t.placeholder=this.l10n.getConstant("SearchShapes"),t.id="textEnter",bTi(t,"width:100%;height:auto"),t.className="e-input",e.appendChild(t),pTi("span",{id:"iconSearch",className:"e-input-group-icon e-search e-icons"}));e.appendChild(t)},kMi.prototype.getFilterSymbol=function(e){var t=this;return e.filter(function(e){return!t.ignoreSymbolsOnSearch.includes(e.id)})},kMi.prototype.searchPalette=function(e){var t,i=[],n=document.getElementById("SearchPalette");if(n){for(var o=n.children.length-1;0<=o;o--)n.removeChild(n.children[parseInt(o.toString(),10)]);this.palettes.splice(0,1)}for(o=0;o<this.palettes.length;o++)for(var r=this.palettes[parseInt(o.toString(),10)],s=0;s<r.symbols.length;s++){var a=r.symbols[parseInt(s.toString(),10)];""!==e&&-1!==a.id.toLowerCase().indexOf(e.toLowerCase())&&i.push(a)}var l,h=jTi(this.filterSymbols);if(h&&(i=h(i)||[]),this.ignoreSymbolsOnSearch&&0<this.ignoreSymbolsOnSearch.length&&(i=this.getFilterSymbol(i)),""!==e&&(h=new AMi(this,"palettes",l={id:"search_palette",expanded:!0,symbols:i,title:"Search Shapes"},!0),this.palettes.splice(0,0,h)),n||N||(n=t=this.createSearchPalette(t)),0<i.length)for(var d=0,p=i;d<p.length;d++){var c=p[d];""===c.parentId&&this.getSymbolContainer(c,n)}else""!==e?((h=pTi("div",{id:"EmptyDiv",style:"text-align:center;font-style:italic"})).innerHTML="No Items To Display",n.appendChild(h)):(document.getElementById("iconSearch").className="e-input-group-icon e-search e-icons",!N&&(this.accordionElement.removeItem(0),l=document.getElementById("SearchPalette"))&&l.remove())},kMi.prototype.createSearchPalette=function(e){e=pTi("div",{id:"SearchPalette",style:"display:none;overflow:auto;"}),this.element.appendChild(e);return this.accordionElement.addItem({header:"Search Results",expanded:!0,content:"#SearchPalette"},0),e},kMi.prototype.wireEvents=function(){var e=F.touchStartEvent,t=F.touchEndEvent,i=F.touchMoveEvent;E.add(this.element,e,this.mouseDown,this),E.add(this.element,i,this.mouseMove,this),E.add(this.element,t,this.mouseUp,this),E.add(this.element,"mouseleave",this.mouseLeave,this),E.add(this.element,"keyup",this.keyUp,this),E.add(document,"keydown",this.keyDown,this),this.initDraggable()},kMi.prototype.unWireEvents=function(){var e=F.touchStartEvent,t=F.touchEndEvent,i=F.touchMoveEvent,n=F.isPointer?"pointerleave":"mouseleave";E.remove(this.element,e,this.mouseDown),E.remove(this.element,i,this.mouseMove),E.remove(this.element,t,this.mouseUp),E.remove(this.element,n,this.mouseLeave),E.remove(this.element,"keyup",this.keyUp),E.remove(document,"keydown",this.keyDown)},Ode([e("S")],kMi.prototype,"accessKey",void 0),Ode([e("100%")],kMi.prototype,"width",void 0),Ode([e("100%")],kMi.prototype,"height",void 0),Ode([kt([],AMi)],kMi.prototype,"palettes",void 0),Ode([e()],kMi.prototype,"getSymbolInfo",void 0),Ode([e({fit:!0})],kMi.prototype,"symbolInfo",void 0),Ode([e()],kMi.prototype,"filterSymbols",void 0),Ode([e()],kMi.prototype,"ignoreSymbolsOnSearch",void 0),Ode([e()],kMi.prototype,"getSymbolTemplate",void 0),Ode([e()],kMi.prototype,"symbolWidth",void 0),Ode([e()],kMi.prototype,"symbolHeight",void 0),Ode([t({left:10,right:10,top:10,bottom:10},ZOt)],kMi.prototype,"symbolMargin",void 0),Ode([e(!0)],kMi.prototype,"allowDrag",void 0),Ode([t({},D2)],kMi.prototype,"symbolPreview",void 0),Ode([t({},P2)],kMi.prototype,"symbolDragSize",void 0),Ode([e(!1)],kMi.prototype,"enableSearch",void 0),Ode([e(!0)],kMi.prototype,"enableAnimation",void 0),Ode([e("Multiple")],kMi.prototype,"expandMode",void 0),Ode([i()],kMi.prototype,"paletteSelectionChange",void 0),Ode([i()],kMi.prototype,"paletteExpanding",void 0),Ode([e()],kMi.prototype,"getNodeDefaults",void 0),Ode([e()],kMi.prototype,"nodeDefaults",void 0),Ode([e()],kMi.prototype,"getConnectorDefaults",void 0),Ode([e()],kMi.prototype,"connectorDefaults",void 0);var MMi,aN=kMi;function kMi(e,t){var i,n,o=MMi.call(this,e,t)||this;o.symbolTable={},o.childTable={},o.info="info",o.oldObject=null,o.laneTable={},o.isExpand=!1,o.isExpandMode=!1,o.isMethod=!1,o.paletteid=88123,o.checkOnRender=!1,o.symbolTooltipObject=null,o.helper=function(e){var t,i=o.selectedSymbol&&o.selectedSymbol.id||e.sender.target.id.split("_container")[0],i=o.symbolTable[""+i];return i&&o.selectedSymbol&&(o.selectedSymbols=o.selectedSymbol.id===i.id?i:o.selectedSymbol,(t=o.getSymbolPreview(o.selectedSymbols,e.sender,o.element)).setAttribute("paletteId",o.element.id)),t};for(var r=0;o&&o.palettes&&r<o.palettes.length;r++)for(var s=0;s<o.palettes[parseInt(r.toString(),10)].symbols.length;s++)i=o.palettes[parseInt(r.toString(),10)].symbols[parseInt(s.toString(),10)],n=e.palettes[parseInt(r.toString(),10)].symbols[parseInt(s.toString(),10)],i&&"UmlActivity"===i.shape.type&&gAi(n,i),(o.nodeDefaults||o.connectorDefaults)&&bAi(i,n,i instanceof MIi?o.nodeDefaults:o.connectorDefaults);return o}dDi.Inject(HDi,Wz,Tft,Met,Iz,EW,C5,$$,X$e,M$,$W,IQ,Jj,tDi,b8,MEi,DQ,nte,k$),aN.Inject($$);var PMi,Xo=Object.freeze({__proto__:null,Diagram:dDi,PrintAndExport:C5,Size:Omi,Rect:tfi,get MatrixTypes(){return efi},Matrix:nfi,identityMatrix:ofi,transformPointByMatrix:rfi,transformPointsByMatrix:sfi,rotateMatrix:afi,scaleMatrix:lfi,translateMatrix:hfi,multiplyMatrix:dfi,Point:Hmi,get BlazorAction(){return zfi},get FlipDirection(){return jfi},get PortVisibility(){return Wfi},get SnapConstraints(){return Qfi},get SelectorConstraints(){return Ufi},get ConnectionPointOrigin(){return qfi},get ChildArrangement(){return Gfi},get ConnectorConstraints(){return Yfi},get AnnotationConstraints(){return Xfi},get NodeConstraints(){return Kfi},get ElementAction(){return Jfi},get ThumbsConstraints(){return Zfi},get DiagramConstraints(){return $fi},get DiagramTools(){return eyi},get Transform(){return tyi},get RenderMode(){return iyi},get KeyModifiers(){return nyi},get Keys(){return oyi},get DiagramAction(){return ryi},get RendererAction(){return syi},get RealAction(){return ayi},get ScrollActions(){return lyi},get NoOfSegments(){return hyi},get DiagramEvent(){return dyi},get PortConstraints(){return pyi},contextMenuClick:myi,contextMenuOpen:fyi,contextMenuBeforeItemRender:yyi,get ControlPointsVisibility(){return uyi},get BezierSmoothness(){return gyi},Thickness:ffi,Margin:ZOt,Shadow:tNt,Stop:Cfi,Gradient:oNt,DiagramGradient:aNt,LinearGradient:Dfi,RadialGradient:Pfi,ShapeStyle:XNt,StrokeStyle:Ofi,TextStyle:ZNt,DiagramShapeStyle:t2t,DiagramElement:vyi,PathElement:kyi,ImageElement:Lyi,TextElement:Tyi,Container:Syi,Canvas:Vyi,GridPanel:ubi,RowDefinition:fbi,ColumnDefinition:ybi,GridRow:vbi,GridCell:bbi,StackPanel:W1i,findConnectorPoints:B0i,swapBounds:H0i,findMargin:X0i,findAngle:K0i,findPoint:J0i,getIntersection:$0i,getIntersectionPoints:tvi,orthoConnection2Segment:ovi,getPortDirection:uvi,getOuterBounds:gvi,getOppositeDirection:mvi,processPathData:jmi,parsePathData:Wmi,getRectanglePath:Qmi,getPolygonPath:Umi,getFreeHandPath:qmi,pathSegmentCollection:Gmi,transformPath:Ymi,updatedSegment:Xmi,scalePathData:Kmi,splitArrayCollection:Jmi,getPathString:Zmi,getString:$mi,randomId:xTi,getIndex:function(e,t){if(e.nodes&&0<e.nodes.length)for(var i=0;i<e.nodes.length;i++)if(e.nodes[parseInt(i.toString(),10)].id===t)return i;if(e.connectors&&0<e.connectors.length)for(i=0;i<e.connectors.length;i++)if(e.connectors[parseInt(i.toString(),10)].id===t)return i;return null},templateCompiler:ITi,cornersPointsBeforeRotation:TTi,getBounds:ETi,cloneObject:DTi,getInternalProperties:MTi,cloneArray:kTi,extendObject:PTi,extendArray:BTi,textAlignToString:FTi,wordBreakToString:LTi,bBoxText:RTi,middleElement:OTi,overFlow:NTi,whiteSpaceToString:VTi,rotateSize:_Ti,rotatePoint:HTi,getOffset:zTi,getFunction:jTi,completeRegion:aAi,findNodeByName:lAi,findObjectType:hAi,setSwimLaneDefaults:dAi,getSpaceValue:pAi,getInterval:cAi,setPortsEdges:uAi,setUMLActivityDefaults:gAi,setConnectorDefaults:mAi,findNearestPoint:fAi,isDiagramChild:yAi,groupHasType:vAi,updateDefaultValues:bAi,updateLayoutValue:wAi,isPointOverConnector:CAi,intersect3:SAi,intersect2:AAi,getLineSegment:xAi,getPoints:IAi,getTooltipOffset:TAi,initFixedUserHandlesSymbol:DAi,sort:MAi,getAnnotationPosition:kAi,getPortsPosition:PAi,getOffsetOfPorts:BAi,getAlignedPositionForPorts:FAi,getOffsetOfConnector:LAi,getAlignedPosition:RAi,alignLabelOnSegments:OAi,getBezierDirection:NAi,removeChildNodes:VAi,getChild:_Ai,serialize:HAi,deserialize:jAi,changeOldFlipDirectionType:WAi,upgrade:QAi,updateStyle:UAi,updateHyperlink:qAi,updateShapeContent:GAi,updateShape:YAi,updateContent:XAi,updateUmlActivityNode:KAi,getUMLFinalNode:JAi,getUMLActivityShapes:ZAi,removeGradient:$Ai,removeItem:e1i,updateConnector:t1i,getUserHandlePosition:i1i,canResizeCorner:n1i,canShowCorner:o1i,canShowControlPoints:r1i,checkPortRestriction:s1i,findAnnotation:a1i,findPort:l1i,getInOutConnectPorts:h1i,findObjectIndex:d1i,findPortIndex:p1i,getObjectFromCollection:c1i,scaleElement:u1i,arrangeChild:g1i,insertObject:m1i,getElement:f1i,getCollectionChangeEventArguements:function(e,t,i,n){return e},getDropEventArguements:function(e,t){return t},getPoint:v1i,getObjectType:S1i,flipConnector:A1i,updatePortEdges:x1i,alignElement:b1i,cloneSelectedObjects:w1i,updatePathElement:I1i,getPathOffset:T1i,checkPort:E1i,findPath:D1i,getConnectorDirection:C1i,findDistance:M1i,cloneBlazorObject:k1i,checkBrowserInfo:P1i,canMeasureDecoratorPath:B1i,getPreviewSize:F1i,getSymbolSize:L1i,findParentInSwimlane:R1i,selectionHasConnector:O1i,getConnectorArrowType:N1i,CanvasRenderer:WTi,DiagramRenderer:tAi,DataBinding:Iz,getBasicShape:Hyi,getPortShape:C0i,getDecoratorShape:S0i,getSegmentThumbShapeHorizontal:A0i,getSegmentThumbShapeVertical:x0i,getIconShape:I0i,getFlowShape:k0i,Hyperlink:Yk,Annotation:Jk,ShapeAnnotation:f0i,PathAnnotation:b0i,Port:i0i,PointPort:r0i,PathPort:l0i,menuClass:mDi,DiagramContextMenu:Jj,Shape:txi,Path:oxi,Native:axi,Html:dxi,Image:uxi,Text:fxi,BasicShape:bxi,FlowShape:Sxi,BpmnGateway:Ixi,BpmnDataObject:Dxi,BpmnTask:d2,BpmnEvent:Fxi,BpmnSubEvent:Oxi,BpmnTransactionSubProcess:CW,BpmnSubProcess:c8,BpmnActivity:Wxi,BpmnAnnotation:qxi,BpmnTextAnnotation:$8,BpmnShape:Jxi,UmlActivityShape:eIi,MethodArguments:nIi,UmlClassAttribute:sIi,UmlClassMethod:hIi,UmlClass:cIi,UmlInterface:mIi,UmlEnumerationMember:vIi,UmlEnumeration:CIi,UmlClassifierShape:xIi,DiagramShape:s6,Node:MIi,Header:BIi,Lane:RIi,Phase:VIi,SwimLane:zIi,ChildContainer:WIi,Selector:qIi,BpmnDiagrams:$$,getBpmnShapePathData:vDi,getBpmnTriggerShapePathData:bDi,getBpmnGatewayShapePathData:wDi,getBpmnTaskShapePathData:CDi,getBpmnLoopShapePathData:SDi,Decorator:qY,Vector:HY,BezierSettings:jY,ConnectorShape:WCi,ActivityFlow:qCi,BpmnFlow:XCi,ConnectorSegment:lX,StraightSegment:eSi,BezierSegment:nSi,OrthogonalSegment:sSi,DiagramConnectorSegment:zK,getDirection:dSi,isEmptyVector:pSi,getBezierPoints:cSi,getBezierBounds:uSi,bezierPoints:gSi,MultiplicityLabel:UK,ClassifierMultiplicity:XK,RelationShip:wSi,DiagramConnectorShape:$K,Connector:ISi,ConnectorBridging:M$,Snapping:EW,UndoRedo:$W,DiagramTooltip:O2t,initTooltip:Xyi,updateTooltip:Zyi,LayoutAnimation:IQ,SymbolSize:sP,SymbolPaletteInfo:hP,FixedUserHandle:YY,NodeFixedUserHandle:Bvi,ConnectorFixedUserHandle:Rvi,UserHandle:_Si,ToolBase:Wr,SelectTool:Lwi,FixedUserHandleTool:Nwi,ConnectTool:Hwi,MoveTool:Wwi,RotateTool:qwi,ResizeTool:Xwi,NodeDrawingTool:Zwi,ConnectorDrawingTool:tCi,TextDrawingTool:oCi,ZoomPanTool:aCi,ExpandTool:dCi,LabelTool:uCi,PolygonDrawingTool:fCi,PolyLineDrawingTool:bCi,LabelDragTool:SCi,LabelResizeTool:ICi,LabelRotateTool:DCi,FreeHandTool:PCi,DiagramEventHandler:PEi,CommandHandler:zEi,findToolToActivate:Cwi,findPortToolToActivate:Swi,contains:Awi,hasSelection:xwi,hasSingleConnection:Iwi,isSelected:Twi,getCursor:Ewi,ConnectorEditing:MEi,updateCanvasBounds:swi,removeChildInContainer:awi,findBounds:lwi,createHelper:hwi,renderContainerHelper:dwi,checkParentAsContainer:pwi,checkChildNodeInContainer:cwi,updateZindex:gwi,addChildToContainer:mwi,updateLaneBoundsWithSelector:ywi,updateLaneBoundsAfterAddChild:vwi,renderStackHighlighter:bwi,moveChildInStack:wwi,LineRouting:tDi,AvoidLineOverlapping:b8,LineDistribution:DQ,CrudAction:IOt,ConnectionDataSource:DOt,DataSource:vft,Gridlines:bk,SnapSettings:Hg,KeyGesture:vg,Command:GSi,CommandManager:Pc,ContextMenuSettings:s,CustomCursorAction:nf,DataMappingItems:d2t,FlowchartLayoutSettings:wk,Layout:Ir,MindMap:Wz,HierarchicalTree:HDi,RadialTree:Tft,GraphForceNode:QDi,SymmetricLayout:X$e,GraphLayoutManager:GDi,ComplexHierarchicalTree:Met,FlowchartLayout:k$,ConnectorProperties:pMi,LabelProperties:uMi,Ej1Serialization:nte,NodeProperties:mMi,PortProperties:yMi,Palette:AMi,SymbolDragSize:P2,SymbolPreview:D2,SymbolPalette:aN,Ruler:MSi,Overview:rAi}),x$=Object.freeze({__proto__:null,DataManager:me,Deferred:ll,Query:ya,Predicate:ba,Adaptor:Ta,JsonAdaptor:Ma,UrlAdaptor:Ba,ODataAdaptor:Ra,ODataV4Adaptor:Va,WebApiAdaptor:za,WebMethodAdaptor:Qa,RemoteSaveAdaptor:Ga,CustomDataAdaptor:Ka,GraphQLAdaptor:$a,CacheAdaptor:il,DataUtil:Sa}),D$=Object.freeze({__proto__:null,ZipArchive:Zl,ZipArchiveItemHelper:eh,ZipArchiveItem:ih,CompressedStreamWriter:lh,CompressorHuffmanTree:dh,ChecksumCalculator:ch,Utils:Xl,DecompressorHuffmanTree:gh,CompressedStreamReader:vh,Stream:wh}),_$=(PMi=function(e,t){return(PMi=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])}))(e,t)},function(e,t){function i(){this.constructor=e}PMi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});function BMi(e,t){var i=document.getElementById("gauge-measuretext"),t=(null===i&&(i=Q("text",{id:"gauge-measuretext"}),document.body.appendChild(i)),"position: absolute; visibility: hidden;;left: 0px; top: -100px; white-space: nowrap;"+LMi(t));return i.innerText=e,i.style.cssText=t,new cki(i.clientWidth,i.clientHeight)}function FMi(e,t){return-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10)}function LMi(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 RMi(e,t,i,n,o){var r=new fo(""),o=o+" font-size:"+t.size+"; font-style:"+t.fontStyle+" ; font-weight:"+t.fontWeight+"; font-family:"+t.fontFamily+";",i={id:e.id,x:e.x,y:e.y,fill:i,"text-anchor":e.anchor,transform:e.transform,opacity:t.opacity,"dominant-baseline":e.baseLine,style:o},t=r.createText(i,e.text);return n.appendChild(t),t}function OMi(e,t,i,n){i=i.renderer["draw"+(n=n||"Path")](e);return i.setAttribute("transform",e.transform),i.style.cssText=e.style,t.appendChild(i),i}function NMi(e,t){t=(t=t-e)<=0?360+t:t;return 0!==Math.floor(t/360)}function VMi(e,t){t-=e;return t<0?360+t:t}function _Mi(e,t,i,n,o,r){var s;return o-=NMi(n,o)?1e-4:0,n-=90,o-=90,s=r?(e-i)*(VMi(n,o)/(t-i))+n:(s=o-(e-i)*(VMi(n,o)/(t-i)))<0?360+s:s,s=360<=Math.round(s)?s-360:Math.round(s)<0?360+s:s}function HMi(e,t){t=Math.atan2(t.y-e.y,t.x-e.x),t=Math.round((t<0?6.283+t:t)*(180/Math.PI))-270;return t+=t<0?360:0}function zMi(e,t,i){e=e*Math.PI/180;return new uki(Math.cos(e)*t+i.x,Math.sin(e)*t+i.y)}function jMi(e,t,i,n,o,r,s,a){!je(s)&&s.start===s.end||(i-=NMi(t,i)?1e-4:0);var l=VMi(t,i),h=je(s)?n-o:"Outside"!==s.position||s.isLinearCircularGradient?"Cross"===s.position&&"AntiClockWise"===a.direction?n-(r+o)/2:n-o:n+o,d=je(s)?n-r:"Outside"!==s.position||s.isLinearCircularGradient?"Cross"===s.position&&"ClockWise"===a.direction?n-(r+o)/2:n-r:n+r,p=je(s)?n-(o+r)/2:"Outside"!==s.position||s.isLinearCircularGradient?"Cross"===s.position?n-(o+r)/4-("ClockWise"===a.direction?o:r)/2:n-(o+r)/2:n+(o+r)/2,c=je(s)||"Cross"!==s.position?n:n+(o+r)/4-("ClockWise"===a.direction?o:r)/2,u=je(s)||"Cross"!==s.position||"ClockWise"!==a.direction?n:n-(o-r)/2,g=je(s)||"Cross"!==s.position||"AntiClockWise"!==a.direction?n:n+(o-r)/2;return void 0!==o&&void 0!==r?(u="Cross"===s.position&&325<l?g:u,qMi(zMi(t,g,e),zMi(i,u,e),zMi(t,h,e),zMi(i,d,e),c,h,d,p,l<180?0:1,e,l,s,a)):KMi(zMi(t,n,e),zMi(i,n,e),n,l<180?0:1)}function WMi(e,t,i,n,o,r,s,a,l,h,d){return"M "+e.x+" "+e.y+" A "+i+" "+i+" 0 "+a+" 1 "+t.x+" "+t.y+" L "+h.x+" "+h.y+" A "+n+" "+o+" 0 "+a+" 0 "+d.x+" "+d.y+"  A "+r+" "+s+" 0 "+a+" 0 "+l.x+" "+l.y+" Z "}function QMi(e,t,i,n,o,r,s,a,l,h,d,p,c,u,g){i="M "+e.x+" "+e.y+" A "+i+" "+i+" 0 "+h+" 1 "+t.x+" "+t.y+" C "+n.x+" "+n.y+" "+o.x+" "+o.y+" "+p.x+" "+p.y;return je(a)&&je(l)?i+" A "+r+" "+s+" 0 "+h+" 0 "+d.x+" "+d.y+" C "+c.x+" "+c.y+" "+u.x+" "+u.y+" "+e.x+" "+e.y+" Z":i+" A "+r+" "+s+" 0 "+h+" 0 "+g.x+" "+g.y+"  A "+a+" "+l+" 0 "+h+" 0 "+d.x+" "+d.y+" C "+c.x+" "+c.y+" "+u.x+" "+u.y+" "+e.x+" "+e.y+" Z"}function UMi(e,t,i,n,o,r,s,a){return"M "+e.x+" "+e.y+" A "+o+" "+o+" 0 "+a+" 1 "+t.x+" "+t.y+" L "+n.x+" "+n.y+" A "+s+" "+r+" 0 "+a+" 0 "+i.x+" "+i.y+" Z"}function qMi(e,t,i,n,o,r,s,a,l,h,d,p,c){var u,g=p.startWidth,m=p.endWidth,f=Math.abs(g-m);return m<g&&d<=260&&"Cross"!==p.position&&"Outside"!==p.position?(u=s+("ClockWise"===c.direction?-f/2:f/2),UMi(e,t,i,n,o,r+("ClockWise"===c.direction?f/2:-f/2),u,l)):g<m&&d<=260&&"Cross"!==p.position&&"Outside"!==p.position?(u=r+("ClockWise"===c.direction?-f/2:f/2),UMi(e,t,i,n,o,s+("ClockWise"===c.direction?f/2:-f/2),u,l)):m!==g||0===c.startAngle&&0===c.endAngle?260<d||!p.isLinearCircularGradient&&0===c.startAngle&&0===c.endAngle?p.roundedCornerRadius<=0&&p.startWidth===p.endWidth?UMi(e,t,i,n,o,r,s,l):GMi(e,t,i,n,o,r,s,a,l,h,null,null,null,null,g,m,d,p,c):"Cross"===p.position||"Outside"===p.position?UMi(e,t,i,n,o,a,a,l):UMi(e,t,i,n,o,r,s,l):UMi(e,t,i,n,o,r,s,l)}function GMi(e,t,i,n,o,r,s,a,l,h,d,p,c,u,g,m,f,y,v){var b,w,C,S,A,x,I;return je(y)?YMi(e,t,i,n,o,r,s,l,d,p,c,u):(0,S=Math.abs(g-m),0,b=zMi(_Mi((y.start+y.end)/2,v.maximum,v.minimum,v.startAngle,v.endAngle,"ClockWise"===v.direction),g<m?s:r,h),w=Math.sqrt(Math.pow(n.x-b.x,2)+Math.pow(n.y-b.y,2))/2,C=Math.sqrt(Math.pow(h.x-i.x,2)+Math.pow(h.y-i.y,2)),h=Math.sqrt(Math.pow(h.x-b.x,2)+Math.pow(h.y-b.y,2)),y.roundedCornerRadius<=0?(S=0===S?1:S,n.y="Cross"===y.position&&"ClockWise"===v.direction&&325<f?n.y-S/2:n.y,("Cross"===y.position?330:325)<=f&&f<=360?WMi(e,t,o,w,w,"ClockWise"===v.direction?h/2:345<=f?r-S/2-m/2:"Cross"===y.position?r+S/4-g/2:r-S/2-g/2,"ClockWise"===v.direction?C/2:"Cross"===y.position?s+S/4-m/4:"Outside"===y.position&&"AntiClockWise"===v.direction?f<345?r-S-m/4:r-S/2:s+S/2-m/2,l,i,n,b):260<f&&f<325&&"Cross"!==y.position&&"Outside"!==y.position?(I=a-S/2,A="ClockWise"===v.direction?310<=f:f<345,f<310?UMi(e,t,i,n,o,I,I,l):310<=f||A?UMi(e,t,i,n,o,I,I=a-S,l):UMi(e,t,i,n,o,r,s,l)):"Cross"===y.position?(A="ClockWise"===v.direction?f<=300&&260<=f?s-S/2-g/4:s-S-g/2:f<=300&&260<=f?s+S/4-g/4:s+S/4-g/2,UMi(e,t,i,n,o,"ClockWise"===v.direction?325<f?340<f?r-g-S/4:r-S/4:r:r-S/4,A,l)):"Outside"===y.position?f<325&&285<f?(I=void 0,x=I=a+S/2+(A=g/2)+m/2,n.y="ClockWise"===v.direction&&g!==m&&S<g?n.y-S/2:n.y+A,UMi(e,t,i,n,o,x,I,l)):UMi(e,t,i,n,o,a,a,l):UMi(e,t,i,n,o,r,s,l)):(l=(A=v.endAngle<4?356:360)<f?0:l,x="ClockWise"===v.direction?327:322,I="ClockWise"===v.direction?328:325,m!==g||0===v.startAngle&&0===v.endAngle?f<=A&&x<f&&0<y.roundedCornerRadius?QMi(e,t,o,d,p,"ClockWise"===v.direction?f<334&&324<f?w-S/2:w-S/4:w,w,h/2,"ClockWise"===v.direction?C/2+S/2:C/2,l,i,n,u,c,b):270<f&&f<I?QMi(e,t,o,d,p,r-S/2-g/2,"ClockWise"===v.direction?s-S/2-m/2:s+S/2-m/2,null,null,l,i,n,u,c,null):YMi(e,t,i,n,o,r,s,l,d,p,c,u):YMi(e,t,i,n,o,r,s,l,d,p,c,u)))}function YMi(e,t,i,n,o,r,s,a,l,h,d,p){return"M "+e.x+" "+e.y+" A "+o+" "+o+" 0 "+a+" 1 "+t.x+" "+t.y+" C "+l.x+" "+l.y+" "+h.x+" "+h.y+" "+n.x+" "+n.y+" A "+s+" "+r+" 0 "+a+" 0 "+i.x+" "+i.y+" C "+p.x+" "+p.y+" "+d.x+" "+d.y+" "+e.x+" "+e.y+" Z"}function XMi(e,t,i,n,o,r,s,a,l,h){var d=VMi(t,i-=NMi(t,i)?1e-4:0),p=r-s,c=r-a,u=r-(s+a)/2;return GMi(zMi(t,r,e),zMi(i,r,e),zMi(t,p,e),zMi(i,c,e),r,u,u,u,d<180?0:1,e,zMi(o,r,e),zMi(o,c,e),zMi(n,r,e),zMi(n,p,e),s,a,d,l,h)}function KMi(e,t,i,n){return"M "+e.x+" "+e.y+" A "+i+" "+i+" 0 "+n+" 1 "+t.x+" "+t.y}function JMi(t,e){var i=null;try{"function"==typeof t?i=oo(t):isNaN(parseFloat(t))&&document.querySelectorAll(t).length?"a"===t.charAt(0)&&"A"===t.charAt(0)||1===t.length||(i=oo(document.querySelector(t).innerHTML.trim())):(e.isVue||e.isVue3)&&(i=oo(t))}catch(e){i=oo(t)}return i}function ZMi(e){e=$Mi(e);e&&ue(e)}function $Mi(e){return document.getElementById(e)}function eki(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function tki(e,t){e=e.replace(t.element.id,"").split("_Axis_")[1],t=-1<e.indexOf("_Range_")?e.split("_Range_"):-1<e.indexOf("_Pointer_NeedleCap_")?e.split("_Pointer_NeedleCap_"):-1<e.indexOf("_Pointer_NeedleTail_")?e.split("_Pointer_NeedleTail_"):-1<e.indexOf("_Pointer_NeedleRect_")?e.split("_Pointer_NeedleRect_"):-1<e.indexOf("_Pointer_Needle_")?e.split("_Pointer_Needle_"):-1<e.indexOf("_Pointer_RangeBar_")?e.split("_Pointer_RangeBar_"):-1<e.indexOf("_Pointer_Marker_")?e.split("_Pointer_Marker_"):-1<e.indexOf("_Pointer_")?e.split("_Pointer_"):e.split("_Annotation_");return{axisIndex:+t[0],pointerIndex:+t[t.length-1]}}function iki(e){return e&&null!==e.match("{value}")?"":e}function nki(e,t,i,n,o){var r,s="string"==typeof i.width?parseFloat(i.width):i.width,a="string"==typeof i.height?parseFloat(i.height):i.height,l=e.x,h=e.y,d=e.x+-s/2,p=e.y+-a/2,c=-1<o.id.indexOf("Shape");switch(t){case"Circle":I(o,{rx:s/2,ry:a/2,cx:l,cy:h});break;case"Diamond":I(o,{d:"M "+d+" "+h+" L "+l+" "+(h+-a/2)+" L "+(l+s/2)+" "+h+" L "+l+" "+(h+a/2)+" L "+d+" "+h+" Z"});break;case"Rectangle":I(o,{d:"M "+d+" "+(h+-a/2)+" L "+(l+s/2)+" "+(h+-a/2)+" L "+(l+s/2)+" "+(h+a/2)+" L "+d+" "+(h+a/2)+" L "+d+" "+(h+-a/2)+" Z"});break;case"Triangle":I(o,{d:c?"M "+(d+s/2)+" "+p+" L "+(d+s)+" "+(p+a)+"L "+d+" "+(p+a)+" Z":"M "+l+" "+h+" L "+(l-a)+" "+(h-s/2)+"L "+(l-a)+" "+(h+s/2)+" Z"});break;case"InvertedTriangle":I(o,{d:c?"M "+(d+s)+" "+p+" L "+(d+s/2)+" "+(p+a)+"L "+d+" "+p+" Z":"M "+l+" "+h+" L "+(l+a)+" "+(h-s/2)+"L "+(l+a)+" "+(h+s/2)+" Z"});break;case"Image":I(o,{href:n,height:a,width:s,x:d,y:p});break;case"RightArrow":I(o,{d:"M "+(l+-s/(r=2))+" "+(h-a/2)+" L "+(l+s/2)+" "+h+" L "+(l+-s/2)+" "+(h+a/2)+" L "+(l+-s/2)+" "+(h+a/2-r)+" L "+(l+s/2-2*r)+" "+h+" L"+(l+-s/2)+" "+(h-a/2+r)+" Z"});break;case"LeftArrow":o.fill=o.stroke,o.stroke="transparent",I(o,{d:"M "+(l+s/(r=2))+" "+(h-a/2)+" L "+(l+-s/2)+" "+h+" L "+(l+s/2)+" "+(h+a/2)+" L "+(l+s/2)+" "+(h+a/2-r)+" L "+(l+-s/2+2*r)+" "+h+" L"+(l+s/2)+" "+(h-a/2+r)+" Z"})}return o}function oki(e){this.id=e}_$(aki,rki=oki);var rki,ski=aki;function aki(e,t,i,n,o,r,s,a,l){void 0===a&&(a=""),void 0===l&&(l="");e=rki.call(this,e)||this;return e.opacity=o,e.fill=t,e.stroke=n,e["stroke-width"]=i,e["stroke-dasharray"]=r,e.d=s,e.transform=a,e.style=l,e}_$(dki,lki=oki);var lki,hki=dki;function dki(e,t,i,n,o){e=lki.call(this,e)||this;return e.y=o.y,e.x=o.x,e.height=o.height,e.width=o.width,e.opacity=n,e.fill=t,e.stroke=i.color,e["stroke-width"]=i.width,e["stroke-dasharray"]=i.dashArray,e}var pki,cki=function(e,t){this.width=e,this.height=t},uki=function(e,t){this.x=e,this.y=t},gki=function(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n},mki=(_$(fki,pki=oki),fki);function fki(e,t,i,n,o,r,s){void 0===r&&(r="");e=pki.call(this,e)||this;return e.transform="",e.baseLine="auto",e.x=t,e.y=i,e.anchor=n,e.text=o,e.transform=r,e.baseLine=s,e}var yki,vki=function(e,t,i){this.text=e,this.value=t,this.size=i};function bki(e,t,i){gt(e,{stroke:i.color,"stroke-width":i.width,fill:t})}function wki(e,t,i,n,o,r){return o-=NMi(n,o)?1e-4:0,e=e<n?e+360:e,r?(e-n)/VMi(n,o)*(t-i)+i:t-(e-n)/VMi(n,o)*(t-i)}function Cki(e,t){e=e.replace(t.element.id,"").split("_Axis_")[1];return{axisIndex:+e[0],rangeIndex:+e.split("Range_")[1]}}(H$=yki=yki||{}).axisLabelFont={size:null,fontWeight:null,color:null,fontStyle:"Normal",fontFamily:null},H$.legendLabelFont={size:null,fontWeight:null,color:null,fontStyle:"Normal",fontFamily:null};Ski=function(e,t){return(Ski=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])}))(e,t)};var Ski,Aki,mJ=function(e,t){function i(){this.constructor=e}Ski(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Oee=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},gRe=(mJ(xki,Aki=n),Oee([e("")],xki.prototype,"color",void 0),Oee([e(1)],xki.prototype,"width",void 0),Oee([e("")],xki.prototype,"dashArray",void 0),xki);function xki(){return null!==Aki&&Aki.apply(this,arguments)||this}mJ(Tki,Iki=n),Oee([e("16px")],Tki.prototype,"size",void 0),Oee([e("")],Tki.prototype,"color",void 0),Oee([e("segoe UI")],Tki.prototype,"fontFamily",void 0),Oee([e("Normal")],Tki.prototype,"fontWeight",void 0),Oee([e("Normal")],Tki.prototype,"fontStyle",void 0),Oee([e(1)],Tki.prototype,"opacity",void 0);var Iki,$V=Tki;function Tki(){return null!==Iki&&Iki.apply(this,arguments)||this}mJ(Dki,Eki=n),Oee([e(null)],Dki.prototype,"fill",void 0),Oee([t({size:null,fontFamily:null,opacity:null,fontWeight:null},$V)],Dki.prototype,"textStyle",void 0),Oee([e(null)],Dki.prototype,"format",void 0),Oee([e(null)],Dki.prototype,"template",void 0),Oee([e(!0)],Dki.prototype,"enableAnimation",void 0),Oee([t({color:null},gRe)],Dki.prototype,"border",void 0),Oee([e(!1)],Dki.prototype,"showAtMousePosition",void 0);var Eki,HH=Dki;function Dki(){return null!==Eki&&Eki.apply(this,arguments)||this}mJ(kki,Mki=n),Oee([e(null)],kki.prototype,"fill",void 0),Oee([t({size:"13px",fontFamily:null,opacity:null},$V)],kki.prototype,"textStyle",void 0),Oee([e(null)],kki.prototype,"format",void 0),Oee([e(null)],kki.prototype,"template",void 0),Oee([e(!0)],kki.prototype,"enableAnimation",void 0),Oee([t({color:null},gRe)],kki.prototype,"border",void 0);var Mki,Oz=kki;function kki(){return null!==Mki&&Mki.apply(this,arguments)||this}mJ(Bki,Pki=n),Oee([e(10)],Bki.prototype,"left",void 0),Oee([e(10)],Bki.prototype,"right",void 0),Oee([e(10)],Bki.prototype,"top",void 0),Oee([e(10)],Bki.prototype,"bottom",void 0);var Pki,q6=Bki;function Bki(){return null!==Pki&&Pki.apply(this,arguments)||this}mJ(Lki,Fki=n),Oee([e(!1)],Lki.prototype,"enable",void 0),Oee([e(null)],Lki.prototype,"fill",void 0),Oee([t({size:null,fontFamily:null,opacity:null,fontWeight:null},$V)],Lki.prototype,"textStyle",void 0),Oee([t({},HH)],Lki.prototype,"rangeSettings",void 0),Oee([t({},Oz)],Lki.prototype,"annotationSettings",void 0),Oee([e(null)],Lki.prototype,"format",void 0),Oee([e(null)],Lki.prototype,"template",void 0),Oee([e(!0)],Lki.prototype,"enableAnimation",void 0),Oee([t({color:null},gRe)],Lki.prototype,"border",void 0),Oee([e(!1)],Lki.prototype,"showAtMousePosition",void 0),Oee([e("Pointer")],Lki.prototype,"type",void 0);var Fki,X6=Lki;function Lki(){return null!==Fki&&Fki.apply(this,arguments)||this}mJ(Oki,Rki=n),Oee([e(0)],Oki.prototype,"x",void 0),Oee([e(0)],Oki.prototype,"y",void 0);var Rki,t7=Oki;function Oki(){return null!==Rki&&Rki.apply(this,arguments)||this}mJ(Vki,Nki=n),Oee([e(!1)],Vki.prototype,"visible",void 0),Oee([e(!0)],Vki.prototype,"toggleVisibility",void 0),Oee([e("Center")],Vki.prototype,"alignment",void 0),Oee([t({},gRe)],Vki.prototype,"border",void 0),Oee([t({},gRe)],Vki.prototype,"shapeBorder",void 0),Oee([e(8)],Vki.prototype,"padding",void 0),Oee([e(1)],Vki.prototype,"opacity",void 0),Oee([e("Auto")],Vki.prototype,"position",void 0),Oee([e("Circle")],Vki.prototype,"shape",void 0),Oee([e(null)],Vki.prototype,"height",void 0),Oee([e(null)],Vki.prototype,"width",void 0),Oee([t(yki.legendLabelFont,$V)],Vki.prototype,"textStyle",void 0),Oee([e(10)],Vki.prototype,"shapeHeight",void 0),Oee([e(10)],Vki.prototype,"shapeWidth",void 0),Oee([e(5)],Vki.prototype,"shapePadding",void 0),Oee([t({x:0,y:0},t7)],Vki.prototype,"location",void 0),Oee([e("transparent")],Vki.prototype,"background",void 0),Oee([t({left:0,right:0,top:0,bottom:0},q6)],Vki.prototype,"margin",void 0);var Nki,o7=Vki;function Vki(){return null!==Nki&&Nki.apply(this,arguments)||this}_ki=function(e,t){return(_ki=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])}))(e,t)};var _ki,Hki,wQ=function(e,t){function i(){this.constructor=e}_ki(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Vmt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},o=(wQ(zki,Hki=n),Vmt([e(2)],zki.prototype,"width",void 0),Vmt([e("")],zki.prototype,"dashArray",void 0),Vmt([e(null)],zki.prototype,"color",void 0),zki);function zki(){return null!==Hki&&Hki.apply(this,arguments)||this}wQ(Wki,jki=n),Vmt([t(yki.axisLabelFont,$V)],Wki.prototype,"font",void 0),Vmt([e("")],Wki.prototype,"format",void 0),Vmt([e("Inside")],Wki.prototype,"position",void 0),Vmt([e("None")],Wki.prototype,"hiddenLabel",void 0),Vmt([e(!1)],Wki.prototype,"autoAngle",void 0),Vmt([e(!1)],Wki.prototype,"useRangeColor",void 0),Vmt([e(0)],Wki.prototype,"offset",void 0),Vmt([e(!0)],Wki.prototype,"shouldMaintainPadding",void 0);var jki,Rmt=Wki;function Wki(){return null!==jki&&jki.apply(this,arguments)||this}wQ(Uki,Qki=n),Vmt([e(0)],Uki.prototype,"start",void 0),Vmt([e(0)],Uki.prototype,"end",void 0),Vmt([e(null)],Uki.prototype,"radius",void 0),Vmt([e(10)],Uki.prototype,"startWidth",void 0),Vmt([e(10)],Uki.prototype,"endWidth",void 0),Vmt([e(null)],Uki.prototype,"color",void 0),Vmt([e(0)],Uki.prototype,"roundedCornerRadius",void 0),Vmt([e(1)],Uki.prototype,"opacity",void 0),Vmt([e("")],Uki.prototype,"legendText",void 0),Vmt([e("Auto")],Uki.prototype,"position",void 0),Vmt([e(0)],Uki.prototype,"offset",void 0),Vmt([e(null)],Uki.prototype,"linearGradient",void 0),Vmt([e(null)],Uki.prototype,"radialGradient",void 0);var Qki,Vee=Uki;function Uki(){var e=null!==Qki&&Qki.apply(this,arguments)||this;return e.isLinearCircularGradient=!1,e}wQ(Gki,qki=n),Vmt([e(2)],Gki.prototype,"width",void 0),Vmt([e(null)],Gki.prototype,"height",void 0),Vmt([e(null)],Gki.prototype,"interval",void 0),Vmt([e(0)],Gki.prototype,"offset",void 0),Vmt([e(null)],Gki.prototype,"color",void 0),Vmt([e("Inside")],Gki.prototype,"position",void 0),Vmt([e(!1)],Gki.prototype,"useRangeColor",void 0),Vmt([e("0")],Gki.prototype,"dashArray",void 0);var qki,est=Gki;function Gki(){return null!==qki&&qki.apply(this,arguments)||this}wQ(Xki,Yki=n),Vmt([e(null)],Xki.prototype,"color",void 0),Vmt([e(null)],Xki.prototype,"linearGradient",void 0),Vmt([e(null)],Xki.prototype,"radialGradient",void 0),Vmt([t({color:null,width:8},gRe)],Xki.prototype,"border",void 0),Vmt([e(8)],Xki.prototype,"radius",void 0);var Yki,h0=Xki;function Xki(){return null!==Yki&&Yki.apply(this,arguments)||this}wQ(Jki,Kki=n),Vmt([e(null)],Jki.prototype,"color",void 0),Vmt([t({color:null,width:0},gRe)],Jki.prototype,"border",void 0),Vmt([e("0%")],Jki.prototype,"length",void 0),Vmt([e(null)],Jki.prototype,"linearGradient",void 0),Vmt([e(null)],Jki.prototype,"radialGradient",void 0);var Kki,x_=Jki;function Jki(){return null!==Kki&&Kki.apply(this,arguments)||this}wQ($ki,Zki=n),Vmt([e(!0)],$ki.prototype,"enable",void 0),Vmt([e(1e3)],$ki.prototype,"duration",void 0);var Zki,l=$ki;function $ki(){return null!==Zki&&Zki.apply(this,arguments)||this}wQ(tPi,ePi=n),Vmt([e(null)],tPi.prototype,"content",void 0),Vmt([e(90)],tPi.prototype,"angle",void 0),Vmt([e("50%")],tPi.prototype,"radius",void 0),Vmt([e("-1")],tPi.prototype,"zIndex",void 0),Vmt([e(!1)],tPi.prototype,"autoAngle",void 0),Vmt([t({size:"12px",color:"#686868"},$V)],tPi.prototype,"textStyle",void 0),Vmt([e(null)],tPi.prototype,"description",void 0);var ePi,k_=tPi;function tPi(){return null!==ePi&&ePi.apply(this,arguments)||this}wQ(nPi,iPi=n),Vmt([e(null)],nPi.prototype,"value",void 0),Vmt([e("Needle")],nPi.prototype,"type",void 0),Vmt([e("Auto")],nPi.prototype,"position",void 0),Vmt([e(0)],nPi.prototype,"roundedCornerRadius",void 0),Vmt([e(null)],nPi.prototype,"imageUrl",void 0),Vmt([e(null)],nPi.prototype,"radius",void 0),Vmt([e(20)],nPi.prototype,"pointerWidth",void 0),Vmt([t({},h0)],nPi.prototype,"cap",void 0),Vmt([t({},$V)],nPi.prototype,"textStyle",void 0),Vmt([t({},x_)],nPi.prototype,"needleTail",void 0),Vmt([e(null)],nPi.prototype,"color",void 0),Vmt([t({color:"#DDDDDD",width:0},gRe)],nPi.prototype,"border",void 0),Vmt([t(null,l)],nPi.prototype,"animation",void 0),Vmt([e("Circle")],nPi.prototype,"markerShape",void 0),Vmt([e(5)],nPi.prototype,"markerHeight",void 0),Vmt([e("")],nPi.prototype,"text",void 0),Vmt([e(null)],nPi.prototype,"description",void 0),Vmt([e(5)],nPi.prototype,"markerWidth",void 0),Vmt([e(0)],nPi.prototype,"offset",void 0),Vmt([e(null)],nPi.prototype,"needleStartWidth",void 0),Vmt([e(null)],nPi.prototype,"needleEndWidth",void 0),Vmt([e(!1)],nPi.prototype,"enableDrag",void 0),Vmt([e(null)],nPi.prototype,"linearGradient",void 0),Vmt([e(null)],nPi.prototype,"radialGradient",void 0);var iPi,wce=nPi;function nPi(){var e=null!==iPi&&iPi.apply(this,arguments)||this;return e.isPointerAnimation=!0,e}wQ(rPi,oPi=n),Vmt([e(null)],rPi.prototype,"minimum",void 0),Vmt([e(null)],rPi.prototype,"maximum",void 0),Vmt([e(!1)],rPi.prototype,"showLastLabel",void 0),Vmt([e(!1)],rPi.prototype,"hideIntersectingLabel",void 0),Vmt([e(null)],rPi.prototype,"roundingPlaces",void 0),Vmt([e(null)],rPi.prototype,"radius",void 0),Vmt([t({},o)],rPi.prototype,"lineStyle",void 0),Vmt([kt([{}],Vee)],rPi.prototype,"ranges",void 0),Vmt([kt([{}],wce)],rPi.prototype,"pointers",void 0),Vmt([kt([{}],k_)],rPi.prototype,"annotations",void 0),Vmt([t({width:2,height:10},est)],rPi.prototype,"majorTicks",void 0),Vmt([t({width:2,height:5},est)],rPi.prototype,"minorTicks",void 0),Vmt([e(200)],rPi.prototype,"startAngle",void 0),Vmt([e(160)],rPi.prototype,"endAngle",void 0),Vmt([e("ClockWise")],rPi.prototype,"direction",void 0),Vmt([e(null)],rPi.prototype,"background",void 0),Vmt([e(null)],rPi.prototype,"rangeGap",void 0),Vmt([e(!1)],rPi.prototype,"startAndEndRangeGap",void 0),Vmt([t({},Rmt)],rPi.prototype,"labelStyle",void 0);var oPi,tte=rPi;function rPi(){var e=null!==oPi&&oPi.apply(this,arguments)||this;return e.visibleLabels=[],e}var sPi="animationComplete",aPi="axisLabelRender",lPi="tooltipRender",hPi="gaugeMouseLeave",dPi="gaugeMouseUp",pPi="dragStart",cPi="dragMove",uPi="dragEnd",gPi=(mPi.prototype.renderAnnotation=function(e,i,n){var o=this,t=n.availableSize.width,r=Q("div",{id:n.element.id+"_Annotations_"+i}),s=(r.style.opacity=n.allowLoadingAnimation?"0":"1",$Mi(n.element.id+"_Secondary_Element"));je(document.getElementById(n.element.id+"_Secondary_Element"))||(document.getElementById(n.element.id+"_Secondary_Element").style.width=t+"px"),e.annotations.map(function(e,t){null!==e.content&&o.createTemplate(r,t,i,n)}),s&&r.childElementCount&&s.appendChild(r),n.renderReactTemplates()},mPi.prototype.annotationAnimation=function(e){for(var t=0;t<e.axes.length;t++){var i=document.getElementById(e.element.id+"_Annotations_"+t);je(i)||"0"===i.style.opacity&&this.annotationAnimate(i,e,t)}},mPi.prototype.annotationAnimate=function(t,e,i){var n;new Vt({}).animate(t,{duration:e.loadingAnimationDuration[i],progress:function(e){e.timeStamp>e.delay&&(n=(e.timeStamp-e.delay)/e.duration,t.style.opacity=n)},end:function(){t.style.opacity=1,e.isOverAllAnimationComplete=!0}})},mPi.prototype.createTemplate=function(r,s,a,l){var h=this,d=l.axes[a],p=d.annotations[s],c=Q("div",{id:l.element.id+"_Axis_"+a+"_Annotation_"+s}),u=(c.style.cssText="position: absolute; z-index:"+p.zIndex+";transform:"+(p.autoAngle?"rotate("+(p.angle-90)+"deg)":"rotate(0deg)")+";",{cancel:!1,name:"annotationRender",content:p.content,axis:d,annotation:p,textStyle:p.textStyle});l.trigger("annotationRender",u,function(e){if(!u.cancel){if((o=JMi(u.content,l))&&o(d,l,u.content,l.element.id+"_Axis"+a+"_ContentTemplate"+s).length)for(var t,i=(t=Array.prototype.slice.call(o(d,l,u.content,l.element.id+"_Axis"+a+"_ContentTemplate"+s))).length,n=0;n<i;n++)c.appendChild(t[n]);else{var o=Q("div",{innerHTML:je(u.content)?null:u.content.toString(),id:"StringTemplate"});o.style.cssText=LMi(u.textStyle),c.appendChild(o)}h.updateLocation(c,d,p,l),r.appendChild(c)}})},mPi.prototype.updateLocation=function(e,t,i,n){t=zMi(i.angle-90,eki(i.radius,t.currentRadius),n.midPoint),n=this.measureElementRect(e);e.style.left=t.x-n.width/2+"px",e.style.top=t.y-n.height/2+"px",e.setAttribute("aria-label",i.description||"Annotation"),e.setAttribute("role","region")},mPi.prototype.getModuleName=function(){return"Annotations"},mPi.prototype.destroy=function(){},mPi.prototype.measureElementRect=function(e){document.body.appendChild(e);var t=e.getBoundingClientRect();return ZMi(e.id),t},mPi);function mPi(e){}function fPi(e,t,i){var n=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,r=i.ownerDocument.defaultView.pageYOffset,s=i.ownerDocument.documentElement.clientTop,i=i.ownerDocument.documentElement.clientLeft,o=n.left+o-i,i=n.top+r-s;return new uki(e-o,t-i)}function yPi(e,t,i){var n,o,e=JMi(e,t),r=e?t.isVue||t.isVue3?e({},t,null,t.element.id+"Template"):e({},null,null,t.element.id+"Template"):[];if(e&&r.length){o=t.createElement("div",{id:t.element.id+"_Measure_Element"}),t.element.appendChild(o);for(var s=t.isVue||t.isVue3?e({},t,null,t.element.id+"Template"):e({},null,null,t.element.id+"Template"),a=s.length;0<a;)o.appendChild(s[0]),a--;i.appendChild(o),n=new cki(i.getBoundingClientRect().width,i.getBoundingClientRect().height),ue(o)}return n}function vPi(e,t,i){var n=t;if(e<BMi(t,i).width)for(var o=t.length-1;0<=o;--o)if(BMi(n=t.substring(0,o)+"...",i).width<=e)return n;return n}function bPi(e,t,i,n,o){var r,s,a,l=new gki(n.margin.left,n.margin.top+10,n.availableSize.width-(n.margin.left+n.margin.right),n.availableSize.height-(n.margin.top-n.margin.bottom));"Title"===o?(r=n.element.id+"_EJ2_Title_Tooltip",s=document.getElementById(r),a=BMi(e,{fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"Regular"}).width+5,l.width=a<l.width?a:l.width-10,s||CPi()):"LegendText"===o&&(r=n.element.id+"_EJ2_Legend_Tooltip",(s=document.getElementById(r))||CPi(),t=t+(a=BMi(e,{fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"Regular"}).width+5)>l.width?t-a:t,l.x=t<0?5:t,l.y=i,l.width=a),s?(s.innerText=e,s.style.top=(l.y+15).toString()+"px",s.style.left=l.x.toString()+"px"):((s=Q("div",{id:r,className:"EJ2-CircularGauge-Tooltip"})).innerText=e,s.style.cssText="top:"+(l.y+15).toString()+"px;left:"+l.x.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; text-align: center; font-family: "Segoe UI"; width:'+l.width+"px;",$Mi(n.element.id+"_Secondary_Element").appendChild(s))}function wPi(e,t,i,n,o){var r=e.target.id,s=document.getElementsByClassName("EJ2-CircularGauge-Tooltip");if(r===n.element.id+"_CircularGaugeTitle"&&-1<e.target.textContent.indexOf("..."))bPi(n.title,t,i,n,"Title");else if(-1<e.target.textContent.indexOf("...")&&-1<r.indexOf("_gauge_legend_")&&n.legendSettings.visible){for(var a=parseInt(r.split(n.element.id+"_gauge_legend_Axis_")[1].split("_text_")[0],10),l=parseInt(r.split(n.element.id+"_gauge_legend_Axis_")[1].split("_text_")[1],10),h="",d=0,p=n.legendModule.legendCollection;d<p.length;d++){var c=p[d];c.rangeIndex===l&&c.axisIndex===a&&(h=c.originalText)}bPi(h,t,i,n,"LegendText")}else 0<s.length&&(-1<s[0].id.indexOf("Title_Tooltip")||-1<s[0].id.indexOf("Legend_Tooltip"))&&CPi();o&&!je(this)&&(clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(CPi.bind(this),2e3))}function CPi(){0<document.getElementsByClassName("EJ2-CircularGauge-Tooltip").length&&document.getElementsByClassName("EJ2-CircularGauge-Tooltip")[0].remove()}APi.prototype.renderTooltip=function(e){var n,t,o,r,s,a,l,h,d,p,c=this,u=(this.gaugeId=this.gauge.element.getAttribute("id"),!1),i=!1,g=(-1!==e.type.indexOf("touch")?(t=e.target,n=e.changedTouches[0].pageX,e.changedTouches[0]):(t=e.target,n=e.pageX,e)).pageY;if(-1<this.tooltip.type.indexOf("Pointer")&&0<=t.id.indexOf("_Pointer_")&&0<=t.id.indexOf(this.gaugeId)){null!==this.pointerEle&&(u=this.pointerEle===t);var i=!0,m=this.gauge.svgObject.getBoundingClientRect(),f=this.gauge.element.getBoundingClientRect(),y=document.getElementById(this.gauge.element.id+"_AxesCollection").getBoundingClientRect(),v=new gki(Math.abs(f.left-m.left),Math.abs(f.top-m.top),m.width,m.height),f=tki(t.id,this.gauge),b=(this.currentAxis=this.gauge.axes[f.axisIndex],this.currentPointer=this.currentAxis.pointers[f.pointerIndex],_Mi(this.currentPointer.currentValue,this.currentAxis.visibleRange.max,this.currentAxis.visibleRange.min,this.currentAxis.startAngle,this.currentAxis.endAngle,"ClockWise"===this.currentAxis.direction)%360),f=this.gauge.tooltip.format||this.currentAxis.labelStyle.format,w=f&&null!==f.match("{value}"),C=this.gauge.intl.getNumberFormat({format:iki(f),useGrouping:this.gauge.useGroupingSeparator});if(this.tooltipElement(),0!==this.tooltipEle.childElementCount&&!this.gauge.enablePointerDrag&&!this.gauge.tooltip.showAtMousePosition)return null;var S=this.roundedValue(this.currentPointer.currentValue),f=w?f.replace(new RegExp("{value}","g"),C(S)):C(S),S=((C=zMi(b,this.currentAxis.currentRadius,this.gauge.midPoint)).x=this.tooltip.template&&(150<=b&&b<=250||330<=b&&b<=360||0<=b&&b<=45)?C.x+10:C.x,{name:lPi,cancel:!1,content:f,location:C,axis:this.currentAxis,tooltip:this.tooltip,pointer:this.currentPointer,event:e,gauge:this.gauge,appendInBodyTag:!1,type:"Pointer"});this.gauge.trigger(lPi,S,function(e){var t,i=e.tooltip.template;null!==i&&1===i.length&&"function"!=typeof i&&(i=i[i[0]]),e.tooltip.showAtMousePosition?(e.location=fPi(n,g,c.gauge.svgObject),c.tooltipRect=v):i?(t=yPi(i,c.gauge,c.tooltipEle),c.tooltipRect=Math.abs(y.left-m.left)>t.width?c.findPosition(v,b,e.location,!0):v):c.findPosition(v,b,e.location,!1),e.cancel||u||(t={color:e.tooltip.textStyle.color||c.gauge.themeStyle.tooltipFontColor,opacity:e.tooltip.textStyle.opacity||c.gauge.themeStyle.tooltipTextOpacity,fontFamily:e.tooltip.textStyle.fontFamily||c.gauge.themeStyle.fontFamily,fontWeight:e.tooltip.textStyle.fontWeight||c.gauge.themeStyle.fontWeight,fontStyle:e.tooltip.textStyle.fontStyle,size:e.tooltip.textStyle.size||c.gauge.themeStyle.tooltipFontSize},c.svgTooltip=c.svgTooltipCreate(c.svgTooltip,e,i,c.arrowInverted,c.tooltipRect,c.gauge,e.tooltip.fill,t,e.tooltip.border),c.svgTooltip.opacity=c.gauge.themeStyle.tooltipFillOpacity||c.svgTooltip.opacity,c.svgTooltip.appendTo(c.tooltipEle),!i||"LeftTop"!==c.tooltipPosition&&"LeftBottom"!==c.tooltipPosition||(c.tooltipEle.style.left=parseFloat(c.tooltipEle.style.left)-c.tooltipEle.getBoundingClientRect().width-20+"px"),i&&Math.abs(g-c.tooltipEle.getBoundingClientRect().top)<=0&&(c.tooltipEle.style.top=parseFloat(c.tooltipEle.style.top)+20+"px"))}),this.gauge.renderReactTemplates()}else-1<this.tooltip.type.indexOf("Range")&&0<=t.id.indexOf("_Range_")&&!this.gauge.isDrag&&0<=t.id.indexOf(this.gaugeId)?(i=!0,o=this.gauge.svgObject.getBoundingClientRect(),f=this.gauge.element.getBoundingClientRect(),r=document.getElementById(this.gauge.element.id+"_AxesCollection").getBoundingClientRect(),s=new gki(Math.abs(f.left-o.left),Math.abs(f.top-o.top),o.width,o.height),S=tki(t.id,this.gauge),this.currentAxis=this.gauge.axes[S.axisIndex],this.currentRange=this.currentAxis.ranges[S.pointerIndex],a=_Mi(this.currentRange.end-Math.abs((this.currentRange.end-this.currentRange.start)/2),this.currentAxis.visibleRange.max,this.currentAxis.visibleRange.min,this.currentAxis.startAngle,this.currentAxis.endAngle,"ClockWise"===this.currentAxis.direction)%360,w=(f=this.gauge.tooltip.rangeSettings.format||this.currentAxis.labelStyle.format)&&(null!==f.match("{end}")||null!==f.match("{start}")),S=this.gauge.intl.getNumberFormat({format:iki(f),useGrouping:this.gauge.useGroupingSeparator}),this.tooltipElement(),A=this.roundedValue(this.currentRange.start),x=this.roundedValue(this.currentRange.end),l=this.currentRange.start.toString(),h=this.currentRange.end.toString(),w=w?f.replace(/{start}/g,l).replace(/{end}/g,h):this.gauge.enableRtl?"Start:"+S(A)+" <br>End:"+S(x)+" ":"Start : "+S(A)+"<br>End : "+S(x),(C=zMi(a,this.currentRange.currentRadius,this.gauge.midPoint)).x=this.tooltip.rangeSettings.template&&(150<=a&&a<=250||330<=a&&a<=360||0<=a&&a<=45)?C.x+10:C.x,f={name:lPi,cancel:!1,content:w,location:C,axis:this.currentAxis,tooltip:this.tooltip,range:this.currentRange,event:e,gauge:this.gauge,appendInBodyTag:!1,type:"Range"},d={color:this.gauge.tooltip.rangeSettings.textStyle.color,opacity:this.gauge.tooltip.rangeSettings.textStyle.opacity,fontFamily:this.gauge.tooltip.rangeSettings.textStyle.fontFamily,fontStyle:this.gauge.tooltip.rangeSettings.textStyle.fontStyle,fontWeight:this.gauge.tooltip.rangeSettings.textStyle.fontWeight,size:this.gauge.tooltip.rangeSettings.textStyle.size},this.gauge.trigger(lPi,f,function(e){var t,i=e.tooltip.rangeSettings.template;"function"!=typeof(i=null!==i&&1===i.length&&"function"!=typeof i?i[i[0]]:i)&&(i=i&&(i=i.replace(/[$]{start}/g,l)).replace(/[$]{end}/g,h)),c.tooltip.rangeSettings.showAtMousePosition?(e.location=fPi(n,g,c.gauge.svgObject),c.tooltipRect=s):i?(t=yPi(i,c.gauge,c.tooltipEle),c.tooltipRect=Math.abs(r.left-o.left)>t.width?c.findPosition(s,a,e.location,!0):s):c.findPosition(s,a,e.location,!1),e.cancel||(d.color=e.tooltip.rangeSettings.textStyle.color||c.gauge.themeStyle.tooltipFontColor,d.fontFamily=e.tooltip.rangeSettings.textStyle.fontFamily||c.gauge.themeStyle.fontFamily,d.fontWeight=e.tooltip.rangeSettings.textStyle.fontWeight||c.gauge.themeStyle.fontWeight,d.opacity=e.tooltip.rangeSettings.textStyle.opacity||c.gauge.themeStyle.tooltipTextOpacity,d.size=e.tooltip.rangeSettings.textStyle.size||c.gauge.themeStyle.tooltipFontSize,c.svgTooltip=c.svgTooltipCreate(c.svgTooltip,e,i,c.arrowInverted,c.tooltipRect,c.gauge,e.tooltip.rangeSettings.fill,d,e.tooltip.rangeSettings.border),c.svgTooltip.opacity=c.gauge.themeStyle.tooltipFillOpacity||c.svgTooltip.opacity,c.svgTooltip.appendTo(c.tooltipEle),!i||"LeftTop"!==c.tooltipPosition&&"LeftBottom"!==c.tooltipPosition||(c.tooltipEle.style.left=parseFloat(c.tooltipEle.style.left)-c.tooltipEle.getBoundingClientRect().width-20+"px"),i&&Math.abs(g-c.tooltipEle.getBoundingClientRect().top)<=0&&(c.tooltipEle.style.top=parseFloat(c.tooltipEle.style.top)+20+"px"))}),this.gauge.renderReactTemplates()):-1<this.tooltip.type.indexOf("Annotation")&&this.checkParentAnnotationId(t)&&!this.gauge.isDrag&&0<=this.annotationTargetElement.id.indexOf(this.gaugeId)?(i=!0,A=this.gauge.svgObject.getBoundingClientRect(),S=this.gauge.element.getBoundingClientRect(),p=new gki(Math.abs(S.left-A.left),Math.abs(S.top-A.top),A.width,A.height),x=tki(this.annotationTargetElement.id,this.gauge),this.currentAxis=this.gauge.axes[x.axisIndex],this.currentAnnotation=this.currentAxis.annotations[x.pointerIndex],w=this.currentAnnotation.angle-90,this.tooltipElement(),document.getElementById(this.gauge.element.id+"_Secondary_Element").appendChild(this.tooltipEle),f=null!==this.gauge.tooltip.annotationSettings.format?this.gauge.tooltip.annotationSettings.format:"",(C=zMi(w,eki(this.currentAnnotation.radius,this.currentAxis.currentRadius),this.gauge.midPoint)).x=this.tooltip.annotationSettings.template&&(150<=w&&w<=250||330<=w&&w<=360||0<=w&&w<=45)?C.x+10:C.x,S={name:lPi,cancel:!1,content:f,location:C,axis:this.currentAxis,tooltip:this.tooltip,annotation:this.currentAnnotation,event:e,gauge:this.gauge,appendInBodyTag:!1,type:"Annotation"},this.gauge.trigger(lPi,S,function(e){var t=e.tooltip.annotationSettings.template,i=(null!==t&&1===t.length&&"function"!=typeof t&&(t=t[t[0]]),c.annotationTargetElement.getBoundingClientRect());c.tooltipPosition="RightTop",c.arrowInverted=!0,e.location.x=e.location.x+i.width/2,c.tooltipRect=new gki(p.x,p.y,p.width,p.height),e.cancel||null===c.gauge.tooltip.annotationSettings.format&&null===c.gauge.tooltip.annotationSettings.template||(i={color:e.tooltip.textStyle.color||c.gauge.themeStyle.tooltipFontColor,fontFamily:e.tooltip.textStyle.fontFamily||c.gauge.themeStyle.fontFamily,fontWeight:e.tooltip.textStyle.fontWeight||c.gauge.themeStyle.fontWeight,opacity:e.tooltip.textStyle.opacity||c.gauge.themeStyle.tooltipTextOpacity,fontStyle:e.tooltip.textStyle.fontStyle,size:e.tooltip.textStyle.size||c.gauge.themeStyle.tooltipFontSize},c.svgTooltip=c.svgTooltipCreate(c.svgTooltip,e,t,c.arrowInverted,c.tooltipRect,c.gauge,e.tooltip.annotationSettings.fill,i,e.tooltip.annotationSettings.border),c.svgTooltip.opacity=c.gauge.themeStyle.tooltipFillOpacity||c.svgTooltip.opacity,c.svgTooltip.appendTo(c.tooltipEle),t&&Math.abs(g-c.tooltipEle.getBoundingClientRect().top)<=0&&(c.tooltipEle.style.top=parseFloat(c.tooltipEle.style.top)+20+"px"))}),this.gauge.renderReactTemplates()):(t.id===this.gauge.element.id+"_CircularGaugeTitle"||-1<t.id.indexOf("_gauge_legend_"))&&-1<e.target.textContent.indexOf("...")?wPi(e,n,g,this.gauge,!1):this.removeTooltip()&&(this.gauge.isVue||this.gauge.isVue3?this.gauge.clearTemplate([this.tooltipEle.children[0].id],[0]):this.gauge.isAngular||this.gauge.clearTemplate());var A=document.getElementById(this.gaugeId).getBoundingClientRect(),x=i?this.tooltipEle.getBoundingClientRect():null;i&&this.tooltipEle.offsetLeft<0&&x.left-A.left<0&&(w=this.tooltipEle.style.left.split("px")[0],this.tooltipEle.style.left=parseInt(w,10)+(A.left-x.left)+"px"),i&&x.top<0&&(this.tooltipEle.style.top="0px")},APi.prototype.svgTooltipCreate=function(e,t,i,n,o,r,s,a,l){l={color:l.color||this.gauge.themeStyle.tooltipBorderColor||"",width:l.width,dashArray:l.dashArray};return e=new tr({theme:r.theme,enable:!0,data:{value:t.content},template:i,enableRTL:r.enableRtl,enableAnimation:t.tooltip.enableAnimation,content:[go.sanitize(t.content)],location:t.location,inverted:n,areaBounds:o,fill:s||r.themeStyle.tooltipFillColor,textStyle:a,availableSize:r.availableSize,border:l,enableShadow:!0}),(r.isVue||r.isVue3)&&(e.controlInstance=r),e},APi.prototype.tooltipElement=function(){document.getElementById(this.tooltipId)?this.tooltipEle=document.getElementById(this.tooltipId):(this.tooltipEle=Q("div",{id:this.tooltipId,className:"EJ2-CircularGauge-Tooltip"}),this.tooltipEle.style.cssText="position: absolute;pointer-events:none;",document.getElementById(this.gauge.element.id+"_Secondary_Element").appendChild(this.tooltipEle))},APi.prototype.checkParentAnnotationId=function(e){for(this.annotationTargetElement=e.parentElement;null!=this.annotationTargetElement;){if(0<=this.annotationTargetElement.id.indexOf("_Annotation_"))return e=this.annotationTargetElement,!0;this.annotationTargetElement=this.annotationTargetElement.parentElement}return!1},APi.prototype.roundedValue=function(e){return this.currentAxis.roundingPlaces?parseFloat(e.toFixed(this.currentAxis.roundingPlaces)):e},APi.prototype.findPosition=function(e,t,i,n){var o,r,s,a;switch(!0){case 0<=t&&t<45:this.arrowInverted=!0,o=15<=t&&t<=30?i.y:0,this.tooltipRect=new gki(e.x,e.y+r,e.width,e.height),this.tooltipPosition="RightBottom";break;case 45<=t&&t<90:this.arrowInverted=!1,this.tooltipRect=new gki(e.x,e.y+i.y,e.width,e.height),this.tooltipPosition="BottomRight";break;case 90<=t&&t<135:this.arrowInverted=!1,this.tooltipRect=new gki(e.x,e.y+i.y,e.width,e.height),this.tooltipPosition="BottomLeft";break;case 135<=t&&t<180:this.arrowInverted=n&&!0,r=150<=t&&t<=160&&n?i.y:0,this.tooltipRect=new gki(e.x,e.y+r,e.width,e.height),this.tooltipPosition="LeftBottom";break;case 180<=t&&t<225:this.arrowInverted=!0,s=200<=t&&t<=225?Math.abs(e.y-i.y):e.height,this.tooltipRect=new gki(e.x-i.x,e.y,e.width,s),this.tooltipPosition="LeftTop";break;case 225<=t&&t<270:this.arrowInverted=!1,a=250<=t&&t<=290?e.width:Math.abs(e.x-i.x),this.tooltipRect=new gki(e.x+10,e.y,a,e.height),this.tooltipPosition="TopLeft";break;case 270<=t&&t<315:this.arrowInverted=!1,o=270<=t&&290<t?i.x-10:0,this.tooltipRect=new gki(e.x+o,e.y,e.width,e.height),this.tooltipPosition="TopRight";break;case 315<=t&&t<=360:this.arrowInverted=!0,s=315<=t&&t<=340?Math.abs(e.y-i.y):e.height,this.tooltipRect=new gki(e.x,e.y,e.width,s),this.tooltipPosition="RightTop"}return this.tooltipRect},APi.prototype.removeTooltip=function(){var e,t=!1;return 0<document.getElementsByClassName("EJ2-CircularGauge-Tooltip").length&&((e=document.getElementsByClassName("EJ2-CircularGauge-Tooltip")[0])&&(ue(e),t=!0),this.pointerEle=null),t},APi.prototype.mouseUpHandler=function(e){this.removeTooltip(),this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},APi.prototype.addEventListener=function(){this.gauge.isDestroyed||(this.gauge.on(F.touchMoveEvent,this.renderTooltip,this),this.gauge.on(F.touchEndEvent,this.mouseUpHandler,this),this.gauge.element.addEventListener("contextmenu",this.removeTooltip))},APi.prototype.removeEventListener=function(){!this.gauge||this.gauge.isDestroyed||(this.gauge.off(F.touchMoveEvent,this.renderTooltip),this.gauge.off(F.touchEndEvent,this.mouseUpHandler),this.gauge.element.removeEventListener("contextmenu",this.removeTooltip))},APi.prototype.getModuleName=function(){return"Tooltip"},APi.prototype.destroy=function(){this.tooltipEle=null,this.currentAxis=null,this.tooltip=null,this.currentPointer=null,this.currentRange=null,this.currentAnnotation=null,je(this.svgTooltip)||(this.svgTooltip.destroy(),this.svgTooltip.controlInstance=null,ZMi(this.tooltipId)),this.svgTooltip=null,this.tooltipRect=null,this.pointerEle=null,this.annotationTargetElement=null,this.gauge=null};var SPi=APi;function APi(e){this.gauge=e,this.tooltipId=this.gauge.element.id+"_CircularGauge_Tooltip",this.tooltip=e.tooltip,this.addEventListener()}function xPi(e,t,i){for(var n=0,o=i.length;e<o;e++)n+=i[e];return n}function IPi(t,e,i){var n=0,o=0,e=e.filter(function(e){return n=Math.min(e.start,e.end),o=Math.max(e.start,e.end),n<=t&&t<=o});return e.length?e[0].rangeColor:i}EPi.prototype.drawAxisOuterLine=function(e,t,i,n){var o=e.background;this.setRangeColor(e),null!==o&&OMi(new ski(n.element.id+"_AxisOuterLine_"+t,o,0,"transparent",null,"0",jMi(n.midPoint,0,360,Math.min(e.rect.width,e.rect.height)/2),"","pointer-events:none;"),i,n)},EPi.prototype.checkAngles=function(e){e.startAngle=360<=e.startAngle?360:e.startAngle<=-360?-360:e.startAngle,e.endAngle=360<=e.endAngle?360:e.endAngle<=-360?-360:e.endAngle},EPi.prototype.drawAxisLine=function(e,t,i,n){var o=e.startAngle,r=e.endAngle,s=e.lineStyle.color||this.gauge.themeStyle.lineColor;0<e.lineStyle.width&&this.gauge.allowComponentRender&&(o=NMi(o,r)?[0,r=360][0]:o,OMi(new ski(n.element.id+"_AxisLine_"+t,"transparent",e.lineStyle.width,s,null,e.lineStyle.dashArray,jMi(n.midPoint,o-90,r-90,e.currentRadius),"",n.allowLoadingAnimation?"visibility: hidden; pointer-events:none;":"pointer-events:none;"),i,n))},EPi.prototype.drawAxisLabels=function(e,t,i,n){var o,r,s,a,l,h,d,p,c,u,g,m=n.renderer.createGroup({id:n.element.id+"_Axis_Labels_"+t,style:n.allowLoadingAnimation?"visibility: hidden;":"pointer-events:auto;"}),f=e.visibleRange.min,y=e.visibleRange.max,v=e.visibleLabels,b=!0,w=e.labelStyle,C=e.currentRadius,S="Inside"===w.position&&"Outside"===e.majorTicks.position&&"Outside"===e.minorTicks.position||"Outside"===w.position&&"Inside"===e.minorTicks.position&&"Inside"===e.majorTicks.position?e.lineStyle.width+e.currentRadius/20:w.position===e.majorTicks.position?e.currentRadius/20:e.currentRadius/40,S=e.labelStyle.shouldMaintainPadding?10:S,A=w.font.color||this.gauge.themeStyle.labelColor;"Outside"===w.position?C+=e.nearSize-(e.maxLabelSize.height+e.lineStyle.width/2)+S/2:"Cross"===w.position?C=C-e.maxLabelSize.height/4-e.labelStyle.offset:C-=e.farSize-(e.maxLabelSize.height+e.lineStyle.width/2)+(w.autoAngle?S:0),e.hideIntersectingLabel&&(d=zMi(S=Math.round(_Mi(v[v.length-1].value,y,f,e.startAngle,e.endAngle,"ClockWise"===e.direction)),C,n.midPoint),p=this.findAnchor(d,w,S,v[v.length-1]),c=(!e.showLastLabel&&NMi(e.startAngle,e.endAngle)&&"First"!==w.hiddenLabel?v[0]:v[v.length-1]).size.width,u=!e.showLastLabel&&NMi(e.startAngle,e.endAngle)&&"First"!==w.hiddenLabel?w.autoAngle?v[0].size.width:v[0].size.height:w.autoAngle?v[v.length-1].size.width:v[v.length-1].size.height,u-=this.offsetAxisLabelsize(S,u),d=this.getAxisLabelStartPosition(d,c,p));for(var x=0,I=v.length;x<I;x++){var T,E,D=v[x],M=zMi(g=Math.round(_Mi(D.value,y,f,e.startAngle,e.endAngle,"ClockWise"===e.direction)),C,n.midPoint),k=this.findAnchor(M,w,g,D);e.hideIntersectingLabel&&(h=zMi(g,C,n.midPoint),s=D.size.width,a=w.autoAngle?s:D.size.height,a-=this.offsetAxisLabelsize(g,a),h=this.getAxisLabelStartPosition(h,s,k),0===x)&&(l=zMi(g,C,n.midPoint),o=D.size.width,r=w.autoAngle?o:D.size.height,r-=this.offsetAxisLabelsize(g,r),l=this.getAxisLabelStartPosition(l,o,k)),0===x&&"First"===w.hiddenLabel||x===I-1&&"Last"===w.hiddenLabel||(T={size:w.font.size||this.gauge.themeStyle.fontSize,color:w.font.color,fontFamily:w.font.fontFamily||this.gauge.themeStyle.labelFontFamily,fontWeight:w.font.fontWeight||this.gauge.themeStyle.fontWeight,fontStyle:w.font.fontStyle,opacity:w.font.opacity},((b=!e.hideIntersectingLabel||0===x||(E=x===v.length-1||!NMi(e.startAngle,e.endAngle)&&!e.showLastLabel||this.FindAxisLabelCollision(d,c,u,h,s,a),this.FindAxisLabelCollision(l,o,r,h,s,a)&&E))||x===v.length-1)&&(D.text=!e.showLastLabel&&(NMi(e.startAngle,e.endAngle)&&"First"!==w.hiddenLabel||!b)&&e.hideIntersectingLabel&&x===I-1?"":D.text,D.text=e.showLastLabel&&e.hideIntersectingLabel&&NMi(e.startAngle,e.endAngle)&&0===x?"":D.text,(E=RMi(new mki(n.element.id+"_Axis_"+t+"_Label_"+x,M.x,M.y,k,D.text,w.autoAngle?"rotate("+(g+90)+","+M.x+","+M.y+")":"","auto"),T,w.useRangeColor?IPi(D.value,e.ranges,A):A,m,"pointer-events:auto;")).setAttribute("aria-label",D.text),E.setAttribute("role","region"),e.hideIntersectingLabel)&&(o=D.size.width,r=w.autoAngle?o:D.size.height,r-=this.offsetAxisLabelsize(g,r),l.x=h.x,l.y=h.y))}i.appendChild(m)},EPi.prototype.findAnchor=function(e,t,i,n){var o;return t.autoAngle?"middle":(o="Inside"===t.position?120<i&&i<240?"start":300<i||i<60?"end":"middle":120<i&&i<240?"end":300<i||i<60?"start":"middle",e.y+="Inside"===t.position?240<=i&&i<=300?n.size.height/2:60<=i&&i<=120?0:n.size.height/4:240<=i&&i<=300?0:60<=i&&i<=120?n.size.height/2:n.size.height/4,o)},EPi.prototype.FindAxisLabelCollision=function(e,t,i,n,o,r){return e.x>n.x+o||e.x+t<n.x||e.y+i<n.y||e.y>n.y+r},EPi.prototype.getAxisLabelStartPosition=function(e,t,i){return"end"===i?e.x=e.x-t:"middle"===i&&(e.x=e.x-t/2),e},EPi.prototype.offsetAxisLabelsize=function(e,t){return 20<=e&&e<=60||120<=e&&e<=160||200<=e&&e<=240||300<=e&&e<=340?t/5:0},EPi.prototype.drawMinorTickLines=function(e,t,i,n){var o=n.renderer.createGroup({id:n.element.id+"_Axis_MinorTickLines_"+t}),r=e.minorTicks,s=null!==r.interval?r.interval:e.visibleRange.interval/2,a=r.useRangeColor,l=r.color||this.gauge.themeStyle.minorTickColor;if(r.width&&r.height&&s){for(var h=0,d=e.visibleRange.min,p=e.visibleRange.max;d<=p;d+=s)this.majorValues.indexOf(+d.toFixed(3))<0&&OMi(new ski(n.element.id+"_Axis_Minor_TickLine_"+t+"_"+h++,"transparent",r.width,a?IPi(d,e.ranges,l):l,null,r.dashArray,this.calculateTicks(d,r,e),"",n.allowLoadingAnimation?"visibility: hidden;pointer-events: auto;":"pointer-events:auto;"),o,n).setAttribute("data-interval",d.toString());i.appendChild(o)}},EPi.prototype.drawMajorTickLines=function(e,t,i,n){var o=n.renderer.createGroup({id:n.element.id+"_Axis_MajorTickLines_"+t}),r=e.majorTicks,s=r.useRangeColor,a=(this.majorValues=[],r.color||this.gauge.themeStyle.majorTickColor);if(r.width&&r.height&&e.visibleRange.interval){for(var l=0,h=e.visibleRange.min,d=e.visibleRange.max,p=e.visibleRange.interval;h<=d;h+=p)this.majorValues.push(+h.toFixed(3)),OMi(new ski(n.element.id+"_Axis_Major_TickLine_"+t+"_"+l,"transparent",r.width,s?IPi(h,e.ranges,a):a,null,r.dashArray,this.calculateTicks(h,r,e),"",n.allowLoadingAnimation?"visibility: hidden;pointer-events:auto;":"pointer-events:auto;"),o,n).setAttribute("data-interval",h.toString()),l++;i.appendChild(o)}},EPi.prototype.calculateTicks=function(e,t,i){var n=i.lineStyle.width/2+t.offset,e=_Mi(e,i.visibleRange.max,i.visibleRange.min,i.startAngle,i.endAngle,"ClockWise"===i.direction),o=zMi(e,i.currentRadius+("Outside"===t.position?n:"Cross"===t.position?t.height/2-t.offset:-n),this.gauge.midPoint),e=zMi(e,i.currentRadius+("Outside"===t.position?n:"Cross"===t.position?t.height/2-t.offset:-n)+("Outside"===t.position?t.height:-t.height),this.gauge.midPoint);return"M "+o.x+" "+o.y+" L "+e.x+" "+e.y+" "},EPi.prototype.drawRangePath=function(e,t,i,n,o,r,s,a){var l,h,d,p,c,u,g,m,f,y=this.gauge.midPoint,v="ClockWise"===e.direction,b=e.visibleRange.min,w=e.visibleRange.max,C=(m=t.isLinearCircularGradient?(d=(t.end-t.start)/t.linearGradient.colorStop.length,m=1<t.linearGradient.colorStop.length?t.start+d*a:t.start,d=1<t.linearGradient.colorStop.length?m+d:t.end,p=Math.min(Math.max(m,b),d),Math.min(Math.max(m,d),w)):(p=Math.min(Math.max(t.start,b),t.end),Math.min(Math.max(t.start,t.end),w)),d=_Mi(p,w,b,e.startAngle,e.endAngle,v),(h=_Mi(m,w,b,e.startAngle,e.endAngle,v))<d);(null!=e.rangeGap&&0<e.rangeGap&&t.start!==t.end||!je(t.linearGradient)&&!t.isLinearCircularGradient&&a===(!je(t.linearGradient.colorStop)&&t.linearGradient.colorStop.length-1))&&(d=0===o&&!e.startAndEndRangeGap||(0!==a||!t.isLinearCircularGradient)&&t.isLinearCircularGradient?d:"AntiClockWise"===e.direction?d-e.rangeGap/Math.PI:d+e.rangeGap/Math.PI,h=o===e.ranges.length-1&&!e.startAndEndRangeGap||(je(t.linearGradient)||a!==t.linearGradient.colorStop.length-1||!t.isLinearCircularGradient)&&t.isLinearCircularGradient?h:"AntiClockWise"===e.direction?h+e.rangeGap/Math.PI:h-e.rangeGap/Math.PI),this.gauge.allowComponentRender&&(p!==m&&(C?d<h+360:d<h)&&(t.start>=b&&t.end<=w||t.end>=b&&t.start<=w)?(h=v?h:[d,d=h][0],n=v?n:[i,i=n][0],m=.25*(p="string"==typeof t.roundedCornerRadius?parseFloat(t.roundedCornerRadius):t.roundedCornerRadius),C=VMi(d,h),v=((t.currentRadius-i/2)*(d*Math.PI/180)-p/m)/(t.currentRadius-i/2)*180/Math.PI,m=((t.currentRadius-n/2)*(h*Math.PI/180)+p/m)/(t.currentRadius-n/2)*180/Math.PI,f=(t.currentRadius*(d*Math.PI/180)+(C<t.roundedCornerRadius/2&&t.isLinearCircularGradient?C<=1?0:p/4:p))/t.currentRadius*180/Math.PI,(C=(t.currentRadius*(h*Math.PI/180)-(C<t.roundedCornerRadius/2&&t.isLinearCircularGradient?C<=1?0:p/4:p))/t.currentRadius*180/Math.PI)<f&&f-C<=p&&(f=d,C=h),!this.gauge.gradientModule||(je(t.linearGradient)||je(t.linearGradient.colorStop))&&(je(t.radialGradient)||je(t.radialGradient.colorStop))||(t.isLinearCircularGradient&&(p=VMi(d,h-=NMi(d,h)?1e-4:0),c=t.linearGradient.colorStop.length,g=void 0,(u=(e.startAngle===e.endAngle?0===e.startAngle&&0===e.endAngle?360:e.startAngle:e.endAngle-e.startAngle)-p*(c-1))<=360&&270<=u?g=270:u<=270&&180<=u?g=180:u<=180&&90<=u?g=90:u<=90&&0<=u&&(g=0),u="AntiClockWise"===e.direction?(e.startAngle===e.endAngle?0:e.startAngle)+p*(c-1-a):e.startAngle+p*a,g=e.startAngle<e.endAngle?"AntiClockWise"===e.direction?1<e.ranges.length?0===o?360-(e.startAngle+p*a):e.startAngle+p*(a+1):e.startAngle+(g+p*(c-1-a)):e.startAngle+p*a:360===e.endAngle||e.startAngle===e.endAngle?"AntiClockWise"===e.direction?e.startAngle===e.endAngle?(0===e.startAngle&&0===e.endAngle?0:360)-e.startAngle+g+p*(c-1-a):p*(c-1-a):p*a:u<360?u:u-360,t.gradientAngle=0===o?e.rangeGap?g+e.rangeGap:g:0<e.rangeGap?e.ranges[o-1].gradientAngle+e.rangeGap:e.ranges[o-1].gradientAngle,"AntiClockWise"===e.direction&&(1<e.ranges.length?a===c-1:0===a)&&(t.gradientAntiAngle=g),0!==o&&(g="AntiClockWise"===e.direction?1<e.ranges.length?e.ranges[o-1].gradientAntiAngle-g+e.startAngle:e.ranges[o-1].gradientAntiAngle+g:t.gradientAngle+g-e.startAngle,t.gradientAngle=null!=e.rangeGap&&0<e.rangeGap&&a===c-1?g+e.ranges[o-1].gradientAngle:g,"AntiClockWise"===e.direction)&&(1<e.ranges.length?a===c-1:0===a)&&(t.gradientAntiAngle=g),45<g&&g<=115||0<=g&&g<=45&&c-1<=2?l="AntiClockWise"===e.direction?"bottom":"top":115<g&&g<170?l="AntiClockWise"===e.direction?"left":"right":170<=g&&g<=280?l="AntiClockWise"===e.direction?"top":"bottom":(280<g&&g<=360||0<=g&&g<=45&&2<=c-1)&&(l="AntiClockWise"===e.direction?"right":"left")),u=this.gauge.gradientModule.getGradientColorString(t,a,l,o)),t.rangeColor=u||t.rangeColor,t.roundedCornerRadius?t.isLinearCircularGradient&&1<t.linearGradient.colorStop.length?0===a||a===t.linearGradient.colorStop.length-1?"ClockWise"===e.direction?this.roundedRangeAppendPathCalculation(t,o,r,i,n,s,a===t.linearGradient.colorStop.length-1?Math.floor(d):Math.floor(f),0!==a?Math.ceil(C):Math.ceil(h),a===t.linearGradient.colorStop.length-1?d:v,0!==a?m:h,y,a):this.roundedRangeAppendPathCalculation(t,o,r,i,n,s,0===a?Math.floor(d):Math.floor(f),a===t.linearGradient.colorStop.length-1?Math.ceil(h):Math.ceil(C),0===a?d:v,a===t.linearGradient.colorStop.length-1?h:m,y,a):this.rangeAppendPathCalculation(t,o,r,i,n,s,Math.floor(d),Math.ceil(h),a):this.roundedRangeAppendPathCalculation(t,o,r,i,n,s,Math.floor(f),Math.ceil(C),v,m,y,a):this.rangeAppendPathCalculation(t,o,r,i,n,s,Math.floor(d),Math.ceil(h),a)):t.start===t.end&&(t.start>=b&&t.end<=w||t.end>=b&&t.start<=w)&&this.rangeAppendPathCalculation(t,o,r,i,n,s,Math.floor(d),Math.ceil(h),a))},EPi.prototype.roundedRangeAppendPathCalculation=function(e,t,i,n,o,r,s,a,l,h,d,p){e.pathElement.push(OMi(new ski(e.isLinearCircularGradient?this.gauge.element.id+"_Axis_"+i+"_Range_"+t+"_Circular_"+p:this.gauge.element.id+"_Axis_"+i+"_Range_"+t,e.rangeColor,0,e.rangeColor,e.opacity,"0",XMi(d,Math.floor(s),Math.ceil(a),l,h,e.currentRadius,n,o,e,this.gauge.axes[i]),"",""),r,this.gauge))},EPi.prototype.rangeAppendPathCalculation=function(e,t,i,n,o,r,s,a,l){e.pathElement.push(OMi(new ski(e.isLinearCircularGradient?this.gauge.element.id+"_Axis_"+i+"_Range_"+t+"_Circular_"+l:this.gauge.element.id+"_Axis_"+i+"_Range_"+t,e.rangeColor,0,e.rangeColor,e.opacity,"0",jMi(this.gauge.midPoint,Math.floor(s),Math.ceil(a),e.currentRadius,n,o,e,this.gauge.axes[i]),"",""),r,this.gauge))},EPi.prototype.drawAxisRange=function(n,o,e){var r,s,a,l,h,d=this,p=document.getElementById(this.gauge.element.id+"_Axis_Ranges_ "+o)?document.getElementById(this.gauge.element.id+"_Axis_Ranges_ "+o):this.gauge.renderer.createGroup({id:this.gauge.element.id+"_Axis_Ranges_"+o,style:this.gauge.allowLoadingAnimation?"opacity: 0;":""});n.ranges.map(function(e,t){if(e.isLinearCircularGradient=!je(d.gauge.gradientModule)&&!je(e.linearGradient)&&je(e.linearGradient.startValue)&&je(e.linearGradient.endValue)&&!je(e.linearGradient.colorStop),e.pathElement=[],!je(e.offset)&&0<e.offset.length?e.currentDistanceFromScale=eki(e.offset,n.currentRadius):e.currentDistanceFromScale=e.offset,d.calculateRangeRadius(n,e),r=!je(e.startWidth)&&0<e.startWidth.length?FMi(e.startWidth,e.currentRadius):e.startWidth,a=!je(e.endWidth)&&0<e.endWidth.length?FMi(e.endWidth,e.currentRadius):e.endWidth,e.currentRadius=d.calculateRangeRadiusWithPosition(n,e,r),e.isLinearCircularGradient)for(var i=0;i<e.linearGradient.colorStop.length;i++)a=i<=e.linearGradient.colorStop.length-1?(l=0===i?a:l,h=0===i?r:h,s=Math.abs(h-l)/e.linearGradient.colorStop.length,0<i&&(r=a),l<h?r-s:r+s):(r=l<h?r-s:r+s,l),d.drawRangePath(n,e,r,a,t,o,p,i);else e.start===e.end&&"AntiClockWise"===n.direction&&n.startAngle===n.endAngle||d.drawRangePath(n,e,r,a,t,o,p,null)}),e.appendChild(p)},EPi.prototype.calculateRangeRadius=function(e,t){var i=null!==t.radius?t.radius:"100%";t.currentRadius=eki(i,e.currentRadius)},EPi.prototype.calculateRangeRadiusWithPosition=function(e,t,i){return!je(t.position)&&"Auto"!==t.position&&je(t.radius)?"Outside"===t.position?t.currentRadius+e.lineStyle.width/2+t.currentDistanceFromScale:"Inside"===t.position?t.currentRadius-e.lineStyle.width/2-t.currentDistanceFromScale:t.currentRadius+i/2-t.currentDistanceFromScale:t.currentRadius},EPi.prototype.setRangeColor=function(e){var i=function(e){var t=["#50c917","#27d5ff","#fcde0b","#ffb133","#ff5985"];switch(e.toLowerCase()){case"tailwind":t=["#0369A1","#14B8A6","#15803D","#334155","#5A61F6","#65A30D","#8B5CF6","#9333EA","#F59E0B","#F97316"];break;case"tailwinddark":t=["#10B981","#22D3EE","#2DD4BF","#4ADE80","#8B5CF6","#E879F9","#F472B6","#F87171","#F97316","#FCD34D"];break;case"tailwind3":t=["#2F4074","#03B4B4","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];break;case"tailwind3dark":t=["#8029F1","#1ABC9C","#0D72DE","#FF5733","#D63384","#F39C12","#EF291F","#91C822"];break;case"fluent":t=["#614570","#4C6FB1","#CC6952","#3F579A","#4EA09B","#6E7A89","#D4515C","#E6AF5D","#639751","#9D4D69"];break;case"fluentdark":t=["#8AB113","#2A72D5","#43B786","#584EC6","#E85F9C","#6E7A89","#EA6266","#EBA844","#26BC7A","#BC4870"];break;case"material3":t=["#6200EE","#E77A16","#82C100","#7107DC","#05BB3D","#D21020","#FAD200","#0085FF","#9204EA","#08EE9B"];break;case"material3dark":t=["#4EAAFF","#FA4EAB","#FFF500","#17EA58","#38FFE7","#FF9E45","#B3F32F","#B93CE4","#FC5664","#9B55FF"];break;case"fluent2":t=["#6200EE","#09AF74","#0076E5","#CB3587","#E7910F","#0364DE","#66CD15","#F3A93C","#107C10","#C19C00"];break;case"fluent2dark":case"fluent2highcontrast":t=["#9BB449","#2A72D5","#43B786","#3F579A","#584EC6","#E85F9C","#6E7A89","#EA6266","#0B6A0B","#C19C00"];break;case"bootstrap5":case"bootstrap5dark":t=["#6610F2","#6f42C1","#D63384","#DC3545","#FD7E14","#FFC107","#198754","#0DCAF0"]}return t}(this.gauge.theme);e.ranges.map(function(e,t){e.rangeColor=e.color||i[t%i.length]})},EPi.prototype.destroy=function(){this.gauge=null,this.majorValues=[]};var TPi=EPi;function EPi(e){this.gauge=e}function DPi(e,t,i,n){return-i*Math.cos(e/n*(Math.PI/2))+i+t}function MPi(e,t,i,n,o,r){r=VMi(t,i-=NMi(t,i)&&!r?1e-4:0);return kPi(0,zMi(t,n,e),zMi(i,n,e),n,zMi(t,o,e),zMi(i,o,e),o,r<180?0:1)}function kPi(e,t,i,n,o,r,s,a){return"M "+t.x+" "+t.y+" A "+n+" "+n+" 0 "+a+" 1 "+i.x+" "+i.y+" L "+r.x+" "+r.y+" A "+s+" "+s+" 0 "+a+",0 "+o.x+" "+o.y+" Z"}BPi.prototype.drawPointers=function(i,n,e,o,r){var s,a=this,l=(void 0===r&&(r=!0),o.renderer.createGroup({id:o.element.id+"_Axis_Pointers_"+n}));this.gauge.allowComponentRender&&(i.pointers.map(function(e,t){!je(e.offset)&&0<e.offset.length?e.currentDistanceFromScale=eki(e.offset,i.currentRadius):e.currentDistanceFromScale=e.offset,e.pathElement=[],a.calculatePointerRadius(i,e),o.allowPointerDrag||(o.allowPointerDrag=e.enableDrag),s=o.renderer.createGroup({id:o.element.id+"_Axis_"+n+"_Pointer_"+t}),null!=e.value&&(s.setAttribute("aria-label",e.description||"Pointer:"+e.value.toString()),s.setAttribute("role","region")),a["draw"+e.type+"Pointer"](i,n,t,s,o),a.gauge.allowLoadingAnimation?s.style.visibility="hidden":a.setPointerValue(i,e,e.currentValue),l.appendChild(s),a.gauge.allowLoadingAnimation||!r&&!e.animation.enable&&"Enable"!==Ut||a.gauge.isPropertyChange&&!e.isPointerAnimation||(e.previousValue=a.gauge.isPropertyChange?e.previousValue:i.minimum,a.doPointerAnimation(s,e,i,n))}),e.appendChild(l))},BPi.prototype.calculatePointerRadius=function(e,t){t.currentRadius=je(t.radius)?"Auto"!==t.position?this.pointerRadiusForPosition(e,t):e.currentRadius-(e.farSize+5):eki(t.radius,e.currentRadius)},BPi.prototype.pointerRadiusForPosition=function(e,t){var i,n;return"Text"===t.markerShape?(i=parseInt(t.textStyle.size,10),n="Cross"===t.position?i/5:0,"Inside"===t.position?e.currentRadius-i/1.2-e.lineStyle.width/2-n-t.currentDistanceFromScale:"Outside"===t.position?e.currentRadius+e.lineStyle.width/2+i/4+n+t.currentDistanceFromScale:e.currentRadius-i/6-n-t.currentDistanceFromScale):(i="RangeBar"===t.type?t.pointerWidth:0,n="Marker"===t.type&&("InvertedTriangle"!==t.markerShape&&"Triangle"!==t.markerShape||"Cross"===t.position)?t.markerWidth/2:0,"Inside"===t.position?e.currentRadius-e.lineStyle.width/2-n-t.currentDistanceFromScale:"Outside"===t.position?e.currentRadius+i+e.lineStyle.width/2+n+t.currentDistanceFromScale:e.currentRadius+i/2-t.currentDistanceFromScale-("InvertedTriangle"===t.markerShape||"Triangle"===t.markerShape?n:0))},BPi.prototype.drawNeedlePointer=function(e,t,i,n,o){var r,s,a,e=e.pointers[i],l=e.needleTail,h=e.cap,d=e.needleStartWidth,p=e.needleEndWidth,c=o.midPoint,u=e.pointerWidth/2,g=zMi(0,e.currentRadius,c),d=0===d&&0===p&&u?"M "+c.x+" "+c.y+" L "+g.x+" "+c.y+" L "+c.x+" "+c.y+" Z":"M "+c.x+" "+(c.y-u-p)+" L "+g.x+" "+(c.y-d/2)+" L "+g.x+" "+(c.y+d/2)+" L "+c.x+" "+(c.y+u+p)+" Z";o.gradientModule&&(r=o.gradientModule.getGradientColorString(e)),e.pathElement.push(OMi(new ski(o.element.id+"_Axis_"+t+"_Pointer_Needle_"+i,r||e.color||this.gauge.themeStyle.needleColor,e.border.width,e.border.color,null,e.border.dashArray,d),n,o)),p=eki(e.needleTail.length,e.currentRadius),r="M "+c.x+" "+(c.y-u)+" L "+g.x+" "+(c.y-u)+" L "+g.x+" "+(c.y+u)+" L "+c.x+" "+(c.y+u),o.gradientModule&&(s=o.gradientModule.getGradientColorString(l)),p&&(g=zMi(180,p,o.midPoint),d="M "+c.x+" "+(c.y-u)+" L "+g.x+" "+(c.y-u)+" L "+g.x+" "+(c.y+u)+" L "+c.x+" "+(c.y+u)+" Z",e.pathElement.push(OMi(new ski(o.element.id+"_Axis_"+t+"_Pointer_NeedleTail_"+i,s||e.needleTail.color||this.gauge.themeStyle.needleTailColor,e.needleTail.border.width,e.needleTail.border.color,null,e.needleTail.border.dashArray,d),n,o)),r+=" L "+g.x+" "+(c.y+u)+" L "+g.x+" "+(c.y-u)),o.gradientModule&&(a=o.gradientModule.getGradientColorString(h)),e.cap.radius&&e.pathElement.push(OMi(nki(c,"Circle",new cki(2*e.cap.radius,2*e.cap.radius),"",new ski(o.element.id+"_Axis_"+t+"_Pointer_NeedleCap_"+i,a||e.cap.color||this.gauge.themeStyle.capColor,e.cap.border.width,e.cap.border.color,null,e.cap.border.dashArray,"","")),n,o,"Ellipse")),e.pathElement.push(OMi(new ski(o.element.id+"_Axis_"+t+"_Pointer_NeedleRect_"+i,"transparent",0,"transpanret",null,"0",r+" Z"),n,o))},BPi.prototype.setPointerValue=function(t,i,n){var o=this,r=n===t.visibleRange.min&&"RangeBar"===i.type,s=this.gauge.midPoint,a="ClockWise"===t.direction,l=i.roundedCornerRadius,e=.25*l,h=(0<l&&l<=5&&(e=.25*(l=6)),_Mi(t.visibleRange.min,t.visibleRange.max,t.visibleRange.min,t.startAngle,t.endAngle,a)),d=_Mi(n,t.visibleRange.max,t.visibleRange.min,t.startAngle,t.endAngle,a),d=a?d<h?Math.round(h)!==Math.round(d)||r?Math.round(d):Math.round(d)-(0<i.roundedCornerRadius?1.5:.5):h!==d||r?d:d+1:(Math.round(h)!==Math.round(d)||r?[h,h=d]:[h,h=h<d?d+(0<i.roundedCornerRadius?1.5:.5):d-1])[0],p=(n<=t.visibleRange.min+t.visibleRange.interval&&i.roundedCornerRadius&&(l=n===t.visibleRange.min||t.visibleRange.min+1?8:l,e=.25*(l/=2)),((i.currentRadius-i.pointerWidth/2)*(h*Math.PI/180)-l/e)/(i.currentRadius-i.pointerWidth/2)*180/Math.PI),c=((i.currentRadius-i.pointerWidth/2)*(d*Math.PI/180)+l/e)/(i.currentRadius-i.pointerWidth/2)*180/Math.PI,e=n!==t.maximum||t.startAngle!==t.endAngle&&360!==Math.abs(t.startAngle-t.endAngle)||"RangeBar"!==i.type?180:45,u=(i.currentRadius*(h*Math.PI/e)+l)/i.currentRadius*e/Math.PI,g=(i.currentRadius*(d*Math.PI/e)-l)/i.currentRadius*e/Math.PI;g<u&&u-g<=36&&"RangeBar"===i.type&&(u=h,g=d),je(i.currentRadius)&&this.calculatePointerRadius(t,i),i.pathElement.map(function(e){"RangeBar"===i.type?l&&!r?(e.setAttribute("d",XMi(s,Math.floor(u),Math.ceil(g),p,c,i.currentRadius,i.pointerWidth,i.pointerWidth)),l=0):e.setAttribute("d",MPi(s,h,d,i.currentRadius,i.currentRadius-i.pointerWidth,r)):"Marker"===i.type&&"Text"===i.markerShape?o.calculateTextElement(t,i,n,e):e.setAttribute("transform","rotate("+_Mi(n,t.visibleRange.max,t.visibleRange.min,t.startAngle,t.endAngle,a)+","+s.x+","+s.y+")")})},BPi.prototype.calculateTextElement=function(e,t,i,n){i=_Mi(i,e.visibleRange.max,e.visibleRange.min,e.startAngle,e.endAngle,"ClockWise"===e.direction),e=zMi(i,t.currentRadius,this.gauge.midPoint);n.setAttribute("transform","rotate("+(i+90)+","+e.x+","+e.y+")"),n.setAttribute("x",String(e.x)),n.setAttribute("y",String(e.y))},BPi.prototype.drawMarkerPointer=function(e,t,i,n,o){var r,s,a=e.pointers[i],l=e.visibleRange.min,h=e.visibleRange.max,h=Math.round(_Mi(a.value,h,l,e.startAngle,e.endAngle,"ClockWise"===e.direction)),l=a.markerShape,e=(o.gradientModule&&(r=o.gradientModule.getGradientColorString(a)),!je(a.radius)||je(a.position)||"InvertedTriangle"!==a.markerShape&&"Triangle"!==a.markerShape||(l="Outside"!==a.position&&"Cross"!==a.position||"Triangle"!==a.markerShape?"Inside"===a.position&&"InvertedTriangle"===a.markerShape?"Triangle":a.markerShape:"InvertedTriangle"),zMi("Text"===a.markerShape?h:0,a.currentRadius,o.midPoint));"Text"===a.markerShape?(s={size:a.textStyle.size,color:a.textStyle.color||this.gauge.themeStyle.pointerColor,fontFamily:a.textStyle.fontFamily,fontStyle:a.textStyle.fontStyle,fontWeight:a.textStyle.fontWeight||this.gauge.themeStyle.fontWeight,opacity:a.textStyle.opacity},(h=RMi(new mki(o.element.id+"_Axis_"+t+"_Pointer_Marker_"+i,e.x,e.y,"middle",a.text,"rotate("+(h+90)+","+e.x+","+e.y+")","auto"),s,s.color,n,"pointer-events : auto; ")).style.visibility=!a.animation.enable&&"Enable"!==Ut||this.gauge.isPropertyChange&&!a.isPointerAnimation||!this.gauge.animatePointer?"visible":"hidden",a.pathElement.push(h)):a.pathElement.push(OMi(nki(e,l,new cki(a.markerWidth,a.markerHeight),a.imageUrl,new ski(o.element.id+"_Axis_"+t+"_Pointer_Marker_"+i,r||a.color||this.gauge.themeStyle.pointerColor,a.border.width,a.border.color,null,a.border.dashArray,"","")),n,o,"Circle"===a.markerShape?"Ellipse":"Image"===a.markerShape?"Image":"Path"))},BPi.prototype.drawRangeBarPointer=function(e,t,i,n,o){var r,e=e.pointers[i];o.gradientModule&&(r=o.gradientModule.getGradientColorString(e)),e.pathElement.push(OMi(new ski(o.element.id+"_Axis_"+t+"_Pointer_RangeBar_"+i,r||e.color||this.gauge.themeStyle.pointerColor,e.border.width,e.border.color,1,e.border.dashArray,""),n,o))},BPi.prototype.doPointerAnimation=function(t,i,n,o){var r=this,s=je(i.previousValue)?n.visibleRange.min:i.previousValue,a=i.currentValue;((i.animation.enable||"Enable"===Ut)&&s!==a&&this.gauge.animatePointer||!je(this.gauge.loadingAnimationDuration)&&0<this.gauge.loadingAnimationDuration[o])&&i.pathElement.map(function(e){"RangeBar"===i.type?r.performRangeBarAnimation(e,s,a,n,i,o):"Marker"===i.type&&"Text"===i.markerShape?r.performTextAnimation(t,s,a,n,i,o):r.performNeedleAnimation(e,s,a,n,i,o)})},BPi.prototype.performTextAnimation=function(t,i,n,o,r,e){var s,a,l=this,h="ClockWise"===o.direction,d=(i="string"==typeof i?parseInt(i,10):i,n="string"==typeof n?parseInt(n,10):n,t=je(t.children[0])?t:t.children[0],Math.abs(i-n));new Vt({}).animate(t,{duration:!this.gauge.isAnimationProgress||je(r.value)||r.value===o.minimum?0:"Enable"===Ut&&((!r.animation.enable||0===r.animation.duration)&&!this.gauge.allowLoadingAnimation||this.gauge.allowLoadingAnimation&&0===this.gauge.animationDuration&&r.animation.enable&&0===r.animation.duration)?1e3:!this.gauge.allowLoadingAnimation||r.animation.enable&&0<r.animation.duration?r.animation.duration:this.gauge.loadingAnimationDuration[e],progress:function(e){l.gauge.isAnimationProgress&&e.timeStamp>e.delay&&(a=e.timeStamp/r.animation.duration,a=_Mi(i<n?i+a*d:i-a*d,o.visibleRange.max,o.visibleRange.min,o.startAngle,o.endAngle,h),s=zMi(a,r.currentRadius,l.gauge.midPoint),t.setAttribute("transform","rotate("+(a+90)+","+s.x+","+s.y+")"),t.setAttribute("x",String(s.x)),t.setAttribute("y",String(s.y)),t.style.visibility="visible")},end:function(){l.gauge.isAnimationProgress&&(l.setPointerValue(o,r,n),r.isPointerAnimation=!1),l.gauge.trigger(sPi,{axis:o,pointer:r}),!je(l.gauge.loadingAnimationDuration)&&0<l.gauge.loadingAnimationDuration[e]&&!je(l.gauge.annotationsModule)?l.gauge.annotationsModule.annotationAnimation(l.gauge):l.gauge.isOverAllAnimationComplete=!0}})},BPi.prototype.performNeedleAnimation=function(t,i,n,e,o,r){var s,a=this,l="ClockWise"===e.direction,h=(i="string"==typeof i?parseInt(i,10):i,n="string"==typeof n?parseInt(n,10):n,_Mi(i,e.visibleRange.max,e.visibleRange.min,e.startAngle,e.endAngle,l)),d=_Mi(n,e.visibleRange.max,e.visibleRange.min,e.startAngle,e.endAngle,l),p=d<h?d+360:d;new Vt({}).animate(t,{duration:!this.gauge.isAnimationProgress||je(o.value)||o.value===e.minimum?0:"Enable"===Ut&&((!o.animation.enable||0===o.animation.duration)&&!this.gauge.allowLoadingAnimation||this.gauge.allowLoadingAnimation&&0===this.gauge.animationDuration&&o.animation.enable&&0===o.animation.duration)?1e3:!this.gauge.allowLoadingAnimation||o.animation.enable&&0<o.animation.duration?o.animation.duration:this.gauge.loadingAnimationDuration[r],progress:function(e){a.gauge.isAnimationProgress&&(s=i<n||Math.round(h)===Math.round(p)?l?p-h:p-h-360:l?p-h-360:p-h,t.style.animation="None",i!==n)&&(t.setAttribute("transform","rotate("+DPi(e.timeStamp,h,s,e.duration)+","+a.gauge.midPoint.x.toString()+","+a.gauge.midPoint.y.toString()+")"),t.style.visibility="visible")},end:function(){a.gauge.isAnimationProgress&&(a.setPointerValue(e,o,n),0<a.gauge.animationDuration&&(t.style.visibility="visible"),o.isPointerAnimation=!1),("Marker"===o.type||0<=t.id.indexOf("_Pointer_NeedleCap"))&&a.gauge.trigger(sPi,{axis:e,pointer:o}),!je(a.gauge.loadingAnimationDuration)&&0<a.gauge.loadingAnimationDuration[r]&&!je(a.gauge.annotationsModule)?a.gauge.annotationsModule.annotationAnimation(a.gauge):a.gauge.isOverAllAnimationComplete=!0}})},BPi.prototype.performRangeBarAnimation=function(e,t,i,n,o,r){var s,a=this,l=(t="string"==typeof t?parseInt(t,10):t,i="string"==typeof i?parseInt(i,10):i,e.style.visibility="visible",Math.abs(t-i));new Vt({}).animate(e,{duration:!this.gauge.isAnimationProgress||je(o.value)||o.value===n.minimum?0:"Enable"===Ut&&((!o.animation.enable||0===o.animation.duration)&&!this.gauge.allowLoadingAnimation||this.gauge.allowLoadingAnimation&&0===this.gauge.animationDuration&&o.animation.enable&&0===o.animation.duration)?1e3:!this.gauge.allowLoadingAnimation||o.animation.enable&&0<o.animation.duration?o.animation.duration:this.gauge.loadingAnimationDuration[r],progress:function(e){a.gauge.isAnimationProgress&&(e.duration=a.gauge.isAnimationProgress?e.duration:0,s=e.timeStamp/e.duration,s=t<i?t+s*l:t-s*l,a.setPointerValue(n,o,s))},end:function(){a.gauge.isAnimationProgress&&(a.setPointerValue(n,o,i),o.isPointerAnimation=!1),a.gauge.trigger(sPi,{axis:n,pointer:o}),!je(a.gauge.loadingAnimationDuration)&&0<a.gauge.loadingAnimationDuration[r]&&!je(a.gauge.annotationsModule)?a.gauge.annotationsModule.annotationAnimation(a.gauge):a.gauge.isOverAllAnimationComplete=!0}})},BPi.prototype.destroy=function(){this.gauge=null};var PPi=BPi;function BPi(e){this.gauge=e}LPi.prototype.measureAxis=function(e){this.measureAxisSize(this.gauge,e),this.calculateAxesRadius()},LPi.prototype.calculateAxesRadius=function(){for(var u,g,m=this,f=0,y=this.gauge.margin.left+this.gauge.margin.right,v=this.gauge.margin.top+this.gauge.margin.bottom,b=this,e=0,t=this.gauge.axes;e<t.length;e++)!function(e){u=Math.min(e.rect.width,e.rect.height)/2,g=null!=e.radius?eki(e.radius,u):u,f=Math.max.apply(Math,e.ranges.map(function(e){return e.radius?e.radius.indexOf("%")<0?100:parseInt(e.radius,10):0})),g=100<f&&null==e.radius?100*g/f:g,e.currentRadius=g-e.nearSize,b.gauge.moveToCenter&&1===b.gauge.axes.length&&je(b.gauge.centerXpoint)&&je(b.gauge.centerYpoint)&&(n=void 0,i=zMi((t=e.startAngle)-90,g,b.gauge.midPoint),n=e.endAngle,o=zMi((n-=NMi(t,n)?1e-4:0)-90,g,b.gauge.midPoint),p=d=h=l=a=s=r=void 0,n<t&&!(90<Math.abs(t-n))||(270<=t&&t<=360&&(270<n&&n<=360||0<=n&&n<=180)?(a=Math.abs(b.gauge.gaugeRect.x-Math.abs(i.x-b.gauge.gaugeRect.x)),p=n<=360&&270<=n?b.gauge.midPoint:n<=90?o:zMi(0,g,b.gauge.midPoint),l=Math.abs(p.x-b.gauge.gaugeRect.width),i=n<=360&&270<=n?o:zMi(270,g,b.gauge.midPoint),h=Math.abs(i.y-b.gauge.gaugeRect.y),o=n<=360&&270<=n||0<=n&&n<90?b.gauge.midPoint:90<=n&&n<=180?o:zMi(90,g,b.gauge.midPoint),d=Math.abs(o.y-(b.gauge.gaugeRect.y+b.gauge.gaugeRect.height))):0<=t&&t<90&&0<=n&&n<=270?(h=Math.abs(i.y-b.gauge.gaugeRect.y),p=180<=n?zMi(90,g,b.gauge.midPoint):o,d=Math.abs(p.y-(b.gauge.gaugeRect.y+b.gauge.gaugeRect.height)),i=180<=n?o:b.gauge.midPoint,a=Math.abs(b.gauge.gaugeRect.x-Math.abs(i.x-b.gauge.gaugeRect.x)),o=90<=n?zMi(0,g,b.gauge.midPoint):o,l=Math.abs(o.x-b.gauge.gaugeRect.width)):90<=t&&t<180&&90<n&&n<=360?(p=n<=180?b.gauge.midPoint:270<=n?zMi(180,g,b.gauge.midPoint):o,a=Math.abs(p.x-b.gauge.gaugeRect.x),l=Math.abs(i.x-b.gauge.gaugeRect.width),i=270<n?zMi(n-90,g,b.gauge.midPoint):b.gauge.midPoint,h=Math.abs(b.gauge.gaugeRect.y-i.y),o=180<=n?zMi(90,g,b.gauge.midPoint):o,d=Math.abs(o.y-(b.gauge.gaugeRect.y+b.gauge.gaugeRect.height))):180<=t&&t<=270&&(n<=360&&270<=n||n<=180&&0<=n)&&(p=180<n&&n<270?o:zMi(180,g,b.gauge.midPoint),a=Math.abs(b.gauge.gaugeRect.x-Math.abs(p.x-b.gauge.gaugeRect.x)),p=180<=n&&n<=360?b.gauge.midPoint:n<=90?o:zMi(0,g,b.gauge.midPoint),l=Math.abs(p.x-b.gauge.gaugeRect.width),p=180<n&&n<270?b.gauge.midPoint:270<=n&&n<=360?o:zMi(270,g,b.gauge.midPoint),h=Math.abs(p.y-b.gauge.gaugeRect.y),o=!(n<=360&&270<=n||0<=n&&n<90)&&270-t<n-90?o:i,d=Math.abs(o.y-(b.gauge.gaugeRect.y+b.gauge.gaugeRect.height))),je(a))||je(l)||je(h)||je(d)||!(0<a||0<l)||!(0<h||0<d)||(r=Math.abs(a+l-y),s=Math.abs(h+d-v),b.gauge.midPoint.x=b.gauge.midPoint.x-a/2+l/2,b.gauge.midPoint.y=b.gauge.midPoint.y-h/2+d/2,u=Math.min(b.gauge.gaugeRect.width,b.gauge.gaugeRect.height)/2+Math.min(r,s)/2,e.currentRadius=(null!=e.radius?eki(e.radius,u):u)-e.nearSize)),e.visibleRange.interval=b.calculateNumericInterval(e,e.rect);var t,i,n,o,r,s,a,l,h,d,p,c={cancel:!1,name:"radiusCalculate",currentRadius:e.currentRadius,gauge:b.gauge,midPoint:b.gauge.midPoint,axis:e};b.gauge.trigger("radiusCalculate",c,function(){e.currentRadius=c.currentRadius,m.gauge.midPoint=c.midPoint,m.calculateVisibleLabels(e)})}(t[e])},LPi.prototype.measureAxisSize=function(e,i){var n,o=this;this.computeSize(e.axes,i),e.axes.map(function(e,t){n=xPi(t,o.farSizes.length,o.farSizes),e.rect=new gki(i.x+n,i.y+n,i.width-2*n,i.height-2*n)})},LPi.prototype.calculateAxisValues=function(e){for(var t=0,i=this.gauge.axes;t<i.length;t++){var n=i[t];this.calculateVisibleRange(n,e),this.calculateVisibleLabels(n)}},LPi.prototype.calculateVisibleRange=function(t,e){var i=t.majorTicks.interval,n=Math.min(null===t.minimum?0:t.minimum,null!==t.maximum?t.maximum:100),o=Math.max(t.minimum,null===t.maximum?100:t.maximum);t.pointers.map(function(e){e.currentValue=null===e.value||e.value<n?n:e.value>o?o:e.value,n=null===t.minimum?Math.min(e.currentValue,n):n,o=null===t.maximum?Math.max(e.currentValue,o):o}),n=n===o?null!==i?n-i:n-1:n,t.visibleRange={min:n,max:o,interval:i},t.visibleRange.interval=this.calculateNumericInterval(t,e)},LPi.prototype.calculateNumericInterval=function(e,t){var i;return!je(e.minimum)&&!je(e.maximum)&&e.minimum!==e.maximum||je(e.minimum)||je(e.maximum)?null!==e.majorTicks.interval?e.majorTicks.interval:(i=e.endAngle-e.startAngle,this.calculateNiceInterval(e.visibleRange.max,e.visibleRange.min,e.currentRadius||t.width/2,i=i<=0?360+i:i)):0},LPi.prototype.calculateNiceInterval=function(e,t,i,n){for(var o=e-t,e=2*Math.PI*i*(n/360),r=Math.max(.01599*e,1),s=o/r,a=Math.pow(10,Math.floor(Math.log(s)/Math.log(10))),l=0,h=[10,5,2,1];l<h.length;l++){var d=a*h[l];if(r<o/d)break;s=d}return s},LPi.prototype.calculateVisibleLabels=function(i){var n,o=i.labelStyle,r=o.format&&null!==o.format.match("{value}"),s=this.gauge.intl.getNumberFormat({format:iki(o.format),useGrouping:this.gauge.useGroupingSeparator}),e=(i.visibleLabels=[],i.visibleRange.interval),t=i.visibleRange.max;if(je(i.minimum)&&je(i.maximum)||i.minimum!==i.maximum)for(var a=function(t){n=i.roundingPlaces?parseFloat(t.toFixed(i.roundingPlaces)):t,d={cancel:!1,name:aPi,axis:i,text:r?o.format.replace(new RegExp("{value}","g"),s(n)):s(n),value:n};function e(e){e.cancel||i.visibleLabels.push(new vki(e.text,t))}e.bind(l),l.gauge.trigger(aPi,d,e)},l=this,h=i.visibleRange.min;h<=t&&e;h+=e)a(h);var d,p=i.visibleLabels.length?i.visibleLabels[i.visibleLabels.length-1].value:null,c=i.visibleRange.max;je(p)||p===c||!0!==i.showLastLabel||(d={cancel:!1,name:aPi,axis:i,text:r?o.format.replace(new RegExp("{value}","g"),s(c)):s(c),value:c},(p=function(e){e.cancel||i.visibleLabels.push(new vki(e.text,c))}).bind(this),this.gauge.trigger(aPi,d,p)),this.getMaxLabelWidth(this.gauge,i)},LPi.prototype.computeSize=function(e,t){var i,n,o,r;this.farSizes=[],this.calculateAxisValues(t);for(var s=0,a=e;s<a.length;s++){var l=a[s],h=l.lineStyle.width/2,d=0,p=0,c="Cross"===l.majorTicks.position?l.majorTicks.height/2:c;c="Cross"===l.minorTicks.position&&c<l.minorTicks.height/2?l.minorTicks.height/2:c,h=h<(c="Cross"===l.labelStyle.position&&c<l.maxLabelSize.height/2?l.maxLabelSize.height/2:c)?c:h,i=l.majorTicks.offset,n=l.minorTicks.offset,o=l.labelStyle.offset,r=l.labelStyle.shouldMaintainPadding?10:0,d=(d=(d+="Outside"!==l.majorTicks.position||"Outside"!==l.minorTicks.position||"Outside"!==l.labelStyle.position?5:0)+(("Outside"===l.majorTicks.position?l.majorTicks.height+h:0)+("Outside"===l.labelStyle.position?l.maxLabelSize.height+o+r:0)+("Outside"===l.minorTicks.position&&"Outside"!==l.majorTicks.position?l.minorTicks.height+h:0)+h))+("Outside"===l.majorTicks.position&&"Outside"===l.minorTicks.position?Math.max(i,n):"Outside"===l.majorTicks.position?i:"Outside"===l.minorTicks.position?n:0),p=(p+=("Inside"===l.majorTicks.position?l.majorTicks.height+h:0)+("Inside"===l.labelStyle.position?l.maxLabelSize.height+o+r:0)+("Inside"===l.minorTicks.position&&"Outside"===l.majorTicks.position?l.minorTicks.height+h:0)+h)+("Inside"===l.majorTicks.position&&"Inside"===l.minorTicks.position?Math.max(i,n):"Inside"===l.majorTicks.position?i:"Inside"===l.minorTicks.position?n:0),this.farSizes[this.farSizes.length-1]&&(this.farSizes[this.farSizes.length-1]+=p+d),l.nearSize=d-5,l.farSize=p,d=this.gauge.axes.length===this.farSizes.length+1?0:d,this.farSizes.push(d)}},LPi.prototype.renderAxes=function(i){var n,o=this,r=(void 0===i&&(i=!0),this.gauge),s=this.axisRenderer,a=r.renderer.createGroup({id:r.element.id+"_AxesCollection","clip-path":"url(#"+r.element.id+"_GaugeAreaClipRect_)"}),e=Q("div",{id:r.element.id+"_Secondary_Element"});e.style.position="relative",r.element.appendChild(e),r.axes.map(function(e,t){n=r.renderer.createGroup({id:r.element.id+"_Axis_Group_"+t}),o.gauge.allowComponentRender=!je(e.minimum)&&!je(e.maximum)&&e.minimum!==e.maximum||je(e.minimum)||je(e.maximum),s.checkAngles(e),s.drawAxisOuterLine(e,t,n,r),r.allowRangePreRender&&s.drawAxisRange(e,t,n),s.drawAxisLine(e,t,n,r),r.allowRangePreRender||s.drawAxisRange(e,t,n),s.drawMajorTickLines(e,t,n,r),s.drawMinorTickLines(e,t,n,r),s.drawAxisLabels(e,t,n,r),o.pointerRenderer.drawPointers(e,t,n,r,i),r.annotationsModule&&r.annotationsModule.renderAnnotation(e,t,r),a.appendChild(n)}),r.svgObject.appendChild(r.renderer.drawClipPath({id:r.element.id+"_GaugeAreaClipRect_",x:0,y:0,width:r.availableSize.width,height:r.availableSize.height,fill:"transparent",stroke:"transparent"})),r.svgObject.appendChild(a),r.allowLoadingAnimation&&this.durationSplitUp(0===r.animationDuration&&"Enable"===Ut?3e3:r.animationDuration,a)},LPi.prototype.labelElementAnimation=function(t,i){var n=this;t&&new Vt({}).animate(t,{duration:this.gauge.loadingAnimationDuration[i],progress:function(){t.style.visibility="visible"},end:function(){t.style.visibility="visible";var e=document.getElementById(n.gauge.element.id+"_Axis_Labels_"+i);n.gauge.axes[i].showLastLabel&&parseInt(t.id.split("Label_")[1],10)===e.childElementCount-2&&(e.style.visibility="visible",t=document.getElementById(n.gauge.element.id+"_Axis_"+i+"_Label_"+(e.childElementCount-1)))&&(t.style.visibility="visible")}})},LPi.prototype.elementLabelAnimation=function(t,i,n,o){var r=this;t&&new Vt({}).animate(t,{duration:null==o.axes[i].labelStyle.font.size||"0px"!==o.axes[i].labelStyle.font.size&&"0"!==o.axes[i].labelStyle.font.size?o.loadingAnimationDuration[i]/this.axisOption[i].axisLabelCount:0,progress:function(){t.style.visibility="visible"},end:function(){n+=1,r.elementLabelAnimation(document.getElementById(o.element.id+"_Axis_"+i+"_Label_"+n),i,n,o);var e=document.getElementById(r.gauge.element.id+"_Axis_Labels_"+i);r.gauge.axes[i].showLastLabel&&parseInt(t.id.split("Label_")[1],10)===e.childElementCount-2&&((t=document.getElementById(r.gauge.element.id+"_Axis_"+i+"_Label_"+(e.childElementCount-1)))&&(t.style.visibility="visible"),e.style.visibility="visible"),0===r.rangeAnimationCount&&r.axisOption[i].axisLabelCount-1===n&&(e.style.visibility="visible",r.rangeAnimationCount++,r.rangeAnimation(o))}})},LPi.prototype.axisLineCalculation=function(e,t,i,n){var o=i===t.visibleRange.min,n=n.midPoint,r="ClockWise"===t.direction,s=t.lineStyle.width/2,a=_Mi(t.visibleRange.min,t.visibleRange.max,t.visibleRange.min,t.startAngle,t.endAngle,r),i=_Mi(i,t.visibleRange.max,t.visibleRange.min,t.startAngle,t.endAngle,r),i=r?i<a?Math.round(a)!==Math.round(i)||o?Math.round(i):Math.round(i)-.5:a!==i||o?i:i+1:(Math.round(a)!==Math.round(i)||o?[a,a=i]:[a,a=a<i?i+.5:i-1])[0];e.setAttribute("d",MPi(n,a,i,t.currentRadius+s,t.currentRadius-s,o))},LPi.prototype.axisLineAnimation=function(e,t,i){var n,o,r,s,a,l=this,h=i.axes[e];this.prevAnimatedMajorTickValue.push(h.minimum),this.prevAnimatedMinorTickValue.push(h.minimum),this.prevAnimatedMinorTickIndex.push(0),this.prevAnimatedMajorTickIndex.push(0),this.prevAnimatedTickType="major",this.axisOption[e].isAxisLine?(n=document.getElementById(i.element.id+"_AxisLine_"+e),o=h.visibleRange.min,r=h.visibleRange.max,a=Math.abs(o-r),new Vt({}).animate(n,{duration:t,progress:function(e){n.style.visibility="visible",n.setAttribute("fill",h.lineStyle.color),n.setAttribute("stroke-width","0"),s=e.timeStamp/e.duration,s=o<r?o+s*a:o-s*a,l.axisLineCalculation(n,h,s,i)},end:function(){n.setAttribute("fill","transparent"),n.setAttribute("stroke-width",h.lineStyle.width.toString()),n.setAttribute("d",jMi(i.midPoint,h.startAngle-90,h.endAngle-90,h.currentRadius)),n.style.visibility="visible",l.axisAnimation(e,t,i)}})):this.axisOption[e].isMajorTick||this.axisOption[e].isMinorTick?this.axisOption[e].isMajorTick||this.axisOption[e].isMajorTick&&this.axisOption[e].isMinorTick?this.tickElementAnimation(document.getElementById(i.element.id+"_Axis_Major_TickLine_"+e+"_0"),document.getElementById(i.element.id+"_Axis_"+e+"_Label_0"),t,e,this.axisOption[e].isMajorTick&&this.axisOption[e].isMinorTick?0:-1,"major",this.axisOption[e],i):this.axisOption[e].isMinorTick&&this.tickElementAnimation(document.getElementById(i.element.id+"_Axis_Minor_TickLine_"+e+"_0"),document.getElementById(i.element.id+"_Axis_"+e+"_Label_0"),t,e,-1,"minor",this.axisOption[e],i):this.axisOption[e].isAxisLine||this.labelRangeAnimation(i,e)},LPi.prototype.axisAnimation=function(e,t,i){var n=this,o=document.getElementById(i.element.id+"_AxisLine_"+e),r=this.axisOption[e];new Vt({}).animate(o,{duration:0===this.axisOption[e].majorTickCount?0:t/this.axisOption[e].majorTickCount,progress:function(){o.style.visibility="visible"},end:function(){r.isMajorTick?n.tickElementAnimation(document.getElementById(i.element.id+"_Axis_Major_TickLine_"+e+"_0"),document.getElementById(i.element.id+"_Axis_"+e+"_Label_0"),t,e,r.isMajorTick&&r.isMinorTick?0:-1,"major",r,i):r.isMinorTick&&n.tickElementAnimation(document.getElementById(i.element.id+"_Axis_Minor_TickLine_"+e+"_0"),document.getElementById(i.element.id+"_Axis_"+e+"_Label_0"),t,e,-1,"minor",r,i),n.labelRangeAnimation(i,e)}})},LPi.prototype.tickElementAnimation=function(n,o,r,s,a,l,h,d){var p=this;n&&this.gauge.isAnimationProgress&&new Vt({}).animate(n,{duration:h.isMinorTick?0===h.minorTickCount?0:r/h.minorTickCount/this.allowAxisCount[s]:0===h.majorTickCount?0:r/h.majorTickCount/this.allowAxisCount[s],progress:function(){n.style.visibility="visible"},end:function(){var e,t,i;h.isMajorTick&&h.isMinorTick&&d.allowLoadingAnimation&&p.gauge.isAnimationProgress?(n.style.visibility="visible",e=parseFloat(n.getAttribute("data-interval")),"major"===(p.prevAnimatedTickType=l)?(p.prevAnimatedMajorTickValue[s]=e,p.prevAnimatedMajorTickIndex[s]=a):(p.prevAnimatedMinorTickValue[s]=e,p.prevAnimatedMinorTickIndex[s]=a),t=(t=null!=d.axes[s].minorTicks.interval?d.axes[s].minorTicks.interval:d.axes[s].visibleRange.interval/2)<d.axes[s].visibleRange.interval?e+t:p.prevAnimatedMinorTickValue[s]+t,i=p.prevAnimatedMajorTickValue[s]+d.axes[s].visibleRange.interval,"major"===(l=t<i?"minor":"major")&&h.majorTickCount!==h.minorTickCount&&0!==a&&"minor"===p.prevAnimatedTickType&&(a=p.prevAnimatedMajorTickIndex[s]),"minor"===l&&h.majorTickCount!==h.minorTickCount&&0!==a&&"major"===p.prevAnimatedTickType&&(a=p.prevAnimatedMinorTickIndex[s]),a="minor"===l&&(h.majorTickCount===h.minorTickCount||e===p.prevAnimatedMajorTickValue[s])?a:a+1,n="minor"===l?document.getElementById(d.element.id+"_Axis_Minor_TickLine_"+s+"_"+a):document.getElementById(d.element.id+"_Axis_Major_TickLine_"+s+"_"+a),o="minor"===l?null:document.getElementById(d.element.id+"_Axis_"+s+"_Label_"+a),"major"!==l&&0!==a||p.labelElementAnimation(document.getElementById(d.element.id+"_Axis_"+s+"_Label_"+a),s),p.tickElementAnimation(n,o,r,s,a,l,h,d),0!==p.rangeAnimationCount||"minor"!==l||a!==h.minorTickCount-1&&a!==h.minorTickCount||d.axes.length-1!==s||(p.rangeAnimationCount++,p.rangeAnimation(d))):d.allowLoadingAnimation&&h.isMajorTick&&p.gauge.isAnimationProgress?(n.style.visibility="visible",l="major",a+=1,n=document.getElementById(d.element.id+"_Axis_Major_TickLine_"+s+"_"+a),o=document.getElementById(d.element.id+"_Axis_"+s+"_Label_"+a),p.tickElementAnimation(n,o,r,s,a,l,h,d),"major"!==l&&0!==a||p.labelElementAnimation(document.getElementById(d.element.id+"_Axis_"+s+"_Label_"+a),s),0===p.rangeAnimationCount&&"major"===l&&a===h.majorTickCount-1&&d.axes.length-1===s&&(p.rangeAnimationCount++,p.rangeAnimation(d))):d.allowLoadingAnimation&&p.gauge.isAnimationProgress&&h.isMinorTick&&(n.style.visibility="visible",l="minor",a+=1,n=document.getElementById(d.element.id+"_Axis_Minor_TickLine_"+s+"_"+a),o=document.getElementById(d.element.id+"_Axis_"+s+"_Label_"+a),p.tickElementAnimation(n,o,r,s,a,l,h,d),"minor"===l&&p.labelElementAnimation(document.getElementById(d.element.id+"_Axis_"+s+"_Label_"+a),s),0===p.rangeAnimationCount)&&"minor"===l&&a===h.minorTickCount-1&&d.axes.length-1===s&&(p.rangeAnimationCount++,p.rangeAnimation(d))}}),this.labelRangeAnimation(d,s)},LPi.prototype.labelRangeAnimation=function(e,t){var i=this.axisOption[t];je(i)||(i.isMajorTick||i.isMinorTick||!i.isAxisLabel?(0!==this.rangeAnimationCount||i.isMajorTick||i.isMinorTick||i.isAxisLabel||!i.isRange)&&(0!==this.rangeAnimationCount||!this.gauge.isAnimationProgress||i.isMajorTick||i.isMinorTick||i.isAxisLabel||!i.isRange)||(this.rangeAnimationCount++,this.rangeAnimation(e)):0<i.axisLabelCount&&("First"===e.axes[t].labelStyle.hiddenLabel?this.elementLabelAnimation(document.getElementById(e.element.id+"_Axis_"+t+"_Label_1"),t,0,e):this.elementLabelAnimation(document.getElementById(e.element.id+"_Axis_"+t+"_Label_0"),t,0,e)))},LPi.prototype.rangeAnimation=function(e){for(var t=0;t<e.axes.length;t++){var i=document.getElementById(e.element.id+"_Axis_Ranges_"+t);!je(i)&&e.allowLoadingAnimation&&this.rangeElementAnimation(i,t,e)}},LPi.prototype.rangeElementAnimation=function(t,o,r){var i,s=this,e=0<t.childElementCount&&r.axes[o].ranges[0].start!==r.axes[o].ranges[0].end;new Vt({}).animate(t,{duration:e?r.loadingAnimationDuration[o]:0,progress:function(e){e.timeStamp>e.delay&&(i=(e.timeStamp-e.delay)/e.duration,t.style.opacity=i)},end:function(){t.style.opacity=1;var e=document.getElementById(s.gauge.element.id+"_Axis_Labels_"+o);je(e)||(e.style.visibility="visible"),r.allowLoadingAnimation&&0===o&&(s.axisOption=[],r.axes.map(function(i,n){i.pointers.map(function(e,t){t=document.getElementById(r.element.id+"_Axis_"+n+"_Pointer_"+t);!je(t)&&s.gauge.isAnimationProgress&&(e.previousValue=s.gauge.isPropertyChange?e.previousValue:i.minimum,r.gaugeAxisLayoutPanel.pointerRenderer.doPointerAnimation(t,e,i,o))}),0===i.pointers.length&&s.gauge.isAnimationProgress?0<s.gauge.loadingAnimationDuration[o]&&!je(s.gauge.annotationsModule)&&s.gauge.annotationsModule.annotationAnimation(s.gauge):s.gauge.isOverAllAnimationComplete=!0}))}})},LPi.prototype.durationSplitUp=function(e,t){var i=0;this.gauge.loadingAnimationDuration=[];for(var n=0;n<t.childElementCount;n++){for(var i=0,o=0,r=t.children[n],s=!1,a=!1,l=0,h=0,d=!1,p=0,c=!1,u=!1,g=!1,m=0;m<r.childElementCount;m++){var f=r.children[m].id;0<f.indexOf("_AxisLine_")?(s=!0,i++):0<f.indexOf("MajorTickLines")?(a=!0,o++,l=r.children[m].childElementCount,i++):0<f.indexOf("MinorTickLines")?(d=!0,o++,p=r.children[m].childElementCount,a||i++):0<f.indexOf("_Axis_Labels_")?(c=!0,o++,h=r.children[m].childElementCount,a||d||null==this.gauge.axes[n].labelStyle.font.size||"0px"===this.gauge.axes[n].labelStyle.font.size||"0"===this.gauge.axes[n].labelStyle.font.size||i++):0<f.indexOf("_Axis_Ranges_")?(u=!0,1!==this.gauge.axes[n].ranges.length||je(this.gauge.axes[n].ranges)||0!==this.gauge.axes[n].ranges[0].start||0!==this.gauge.axes[n].ranges[0].end||i++):0<f.indexOf("_Axis_Pointers_")&&(g=!0,0<this.gauge.axes[n].pointers.length)&&1!==this.gauge.axes[n].pointers.length&&this.gauge.axes[n].pointers[0].value!==this.gauge.axes[n].minimum&&i++}this.allowAxisCount.push(0===o?1:o),this.axisOption.push({isAxisLine:s,isMajorTick:a,isMinorTick:d,isAxisLabel:c,isPointer:g,isRange:u,axisLabelCount:h,majorTickCount:l,minorTickCount:p}),g=u=c=d=a=s=!1,null!=this.gauge.axes[n].annotations&&0<this.gauge.axes[n].annotations.length&&!je(this.gauge.annotationsModule)&&i++,this.gauge.loadingAnimationDuration.push((p=h=l=0)===i?e:e/i)}},LPi.prototype.getMaxLabelWidth=function(e,t){t.maxLabelSize=new cki(0,0);for(var i={size:t.labelStyle.font.size||this.gauge.themeStyle.fontSize,color:t.labelStyle.font.color||this.gauge.themeStyle.labelColor,fontFamily:t.labelStyle.font.fontFamily||this.gauge.themeStyle.labelFontFamily,fontWeight:t.labelStyle.font.fontWeight||this.gauge.themeStyle.fontWeight,fontStyle:t.labelStyle.font.fontStyle,opacity:t.labelStyle.font.opacity},n=0,o=t.visibleLabels;n<o.length;n++){var r=o[n];r.size=BMi(r.text,i),t.maxLabelSize.width=(r.size.width>t.maxLabelSize.width?r.size:t.maxLabelSize).width,t.maxLabelSize.height=(r.size.height>t.maxLabelSize.height?r.size:t.maxLabelSize).height}},LPi.prototype.destroy=function(){this.gauge=null,this.farSizes=[],je(this.axisRenderer)||this.axisRenderer.destroy(),this.axisRenderer=null,je(this.pointerRenderer)||this.pointerRenderer.destroy(),this.pointerRenderer=null,this.axisOption=null,this.prevAnimatedMajorTickValue=null,this.prevAnimatedMajorTickIndex=null,this.prevAnimatedMinorTickIndex=null,this.prevAnimatedMinorTickValue=null,this.allowAxisCount=null};var FPi=LPi;function LPi(e){this.axisOption=[],this.prevAnimatedMajorTickValue=[],this.prevAnimatedMajorTickIndex=[],this.prevAnimatedMinorTickValue=[],this.prevAnimatedMinorTickIndex=[],this.allowAxisCount=[],this.rangeAnimationCount=0,this.gauge=e,this.axisRenderer=new TPi(e),this.pointerRenderer=new PPi(e)}OPi.prototype.addEventListener=function(){this.gauge.isDestroyed||this.gauge.on("click",this.click,this)},OPi.prototype.removeEventListener=function(){this.gauge.isDestroyed||this.gauge.off("click",this.click)},OPi.prototype.getLegendOptions=function(e){this.legendCollection=[];for(var t,i,n=0;n<e.length;n++)for(var o=0;o<e[n].ranges.length;o++)je((t=e[n].ranges[o]).start)||je(t.end)||t.start===t.end||(i=t.legendText||t.start+" - "+t.end,this.legendCollection.push(new VPi(i,i,t.color,this.legend.shape,this.legend.visible,this.legend.border,this.legend.shapeBorder,this.legend.shapeWidth,this.legend.shapeHeight,o,n)))},OPi.prototype.calculateLegendBounds=function(e,t){var i=this.legend;this.position="Auto"!==i.position?i.position:t.width>t.height?"Right":"Bottom",this.legendBounds="Custom"===this.position?new gki(i.location.x,i.location.y,0,0):new gki(e.x,e.y,0,0),this.isVertical="Left"===this.position||"Right"===this.position,this.isVertical?(this.legendBounds.height=eki(i.height,t.height-(e.y-this.gauge.margin.top))||e.height,this.legendBounds.width=eki(i.width||"20%",t.width)):(this.legendBounds.width=eki(i.width,t.width)||e.width,this.legendBounds.height=eki(i.height||"20%",t.height)),this.getLegendBounds(t,this.legendBounds,i),this.getLocation(this.position,i.alignment,this.legendBounds,e,t)},OPi.prototype.alignLegend=function(e,t,i,n){switch(n){case"Far":e=t-i-e;break;case"Center":e=(t-i)/2}return e},OPi.prototype.getLocation=function(e,t,i,n,o){var r=this.legend.border.width,s=i.height+r+this.legend.margin.top+this.legend.margin.bottom,a=i.width+r+this.legend.margin.left+this.legend.margin.right,l=this.gauge.margin.bottom;"Bottom"===e?(i.x=this.alignLegend(i.x,o.width,i.width,t),i.y=n.y+(n.height-s)+r+this.legend.margin.top,this.subtractThickness(n,0,0,0,s)):"Top"===e?(i.x=this.alignLegend(i.x,o.width,i.width,t),i.y=n.y+r+this.legend.margin.top,this.subtractThickness(n,0,0,s,0)):"Right"===e?(i.x=n.x+(n.width-i.width)+this.legend.margin.right,i.y=n.y+this.alignLegend(0,o.height-(n.y+l),i.height,t),this.subtractThickness(n,0,a,0,0)):"Custom"===e?this.subtractThickness(n,0,0,0,0):(i.x=i.x+this.legend.margin.left,i.y=n.y+this.alignLegend(0,o.height-(n.y+l),i.height,t),this.subtractThickness(n,a,0,0,0))},OPi.prototype.renderLegend=function(e,t){var i=this.findFirstLegendPosition(this.legendCollection),n=e.padding,o=(this.legendRegions=[],this.maxItemHeight=Math.max(this.legendCollection[0].textSize.height,e.shapeHeight),this.gauge.renderer.createGroup({id:this.legendID+"_g"})),r=this.createLegendElements(t,o,e,this.legendID);if(i!==this.legendCollection.length){for(var s=void(this.totalPages=0),a=new uki(this.gauge.enableRtl?this.isVertical?t.x+this.maxWidth-n-e.shapeWidth/2:t.width+t.x-n-e.shapeWidth:t.x+n+e.shapeWidth/2,t.y+n+this.maxItemHeight/2),l=new mki("",a.x,a.y,"start"),h=2*e.shapePadding+2*n+e.shapeWidth,d=0,p=(this.pageXCollections=[],this.legendCollection[i].location=a,this.legendCollection[i]),c=0,u=this.legendCollection;c<u.length;c++){var g=u[c];g.render&&""!==g.text&&(s=this.gauge.renderer.createGroup({id:this.legendID+"_g_"+d}),this.getRenderPoint(g,a,h,p,t,d,i),this.renderSymbol(g,s,g.axisIndex,g.rangeIndex),this.renderText(g,s,l,g.axisIndex,g.rangeIndex),s&&(s.style.cursor=e.toggleVisibility?"pointer":"auto"),r&&r.appendChild(s),p=g),d++}this.isPaging?this.renderPagingElements(t,l,o):this.totalPages=1}this.appendChildElement(this.gauge.svgObject,o),this.setStyles(this.toggledIndexes)},OPi.prototype.renderPagingElements=function(e,t,i){var n=this.gauge.renderer.createGroup({id:this.legendID+"_navigation"}),i=(this.pagingRegions=[],i.appendChild(n),this.gauge.themeStyle.labelColor),o=this.gauge.legendSettings,r=(this.isVertical?this.totalPages=Math.ceil(this.totalPages/this.maxColumns):this.totalPages=Math.ceil(this.totalPages/Math.max(1,this.rowCount-1)),new ski(this.legendID+"_pageup","transparent",5,i,1,"","")),s=this.pageButtonSize,a=(n&&(n.style.cursor="pointer"),{size:o.textStyle.size||this.gauge.themeStyle.fontSize,color:o.textStyle.color||this.gauge.themeStyle.labelColor,fontFamily:o.textStyle.fontFamily||this.gauge.themeStyle.labelFontFamily,fontWeight:o.textStyle.fontWeight||this.gauge.themeStyle.fontWeight,fontStyle:o.textStyle.fontStyle,opacity:o.textStyle.opacity}),l=(this.clipPathHeight=(this.rowCount-1)*(this.maxItemHeight+o.padding),this.clipRect.setAttribute("height",this.clipPathHeight.toString()),e.x+s/2),h=e.y+this.clipPathHeight+(e.height-this.clipPathHeight)/2,d=BMi(this.totalPages+"/"+this.totalPages,a),a=(OMi(nki({x:l,y:h},"LeftArrow",new cki(s,s),"",r),n,this.gauge,"Path"),this.pagingRegions.push(new gki(this.gauge.enableRtl?l:l+e.width-(2*(s+8)+8+d.width)-.5*s,h-.5*s,s,s)),t.x=l+s/2+8,t.y=h+d.height/4,t.id=this.legendID+"_pagenumber",t.text=this.gauge.enableRtl?this.totalPages+"/1":"1/"+this.totalPages,RMi(t,a,i,n)),l=t.x+8+s/2+d.width,i=(r.id=this.legendID+"_pagedown",OMi(nki({x:l,y:h},"RightArrow",new cki(s,s),"",r),n,this.gauge,"Path"),this.pagingRegions.push(new gki(this.gauge.enableRtl?l:l+(e.width-(2*(s+8)+8+d.width)-.5*s),h-.5*s,s,s)),this.gauge.enableRtl?o.border.width+s/2:e.width-(2*(s+8)+8+d.width));n.setAttribute("transform","translate("+i+", 0)"),this.translatePage(a,this.currentPage-1,this.currentPage)},OPi.prototype.translatePage=function(e,t,i){var n=this.clipPathHeight*t,o="translate(0,-"+n+")";return this.isVertical&&(t=this.pageXCollections[t*this.maxColumns],n=this.gauge.enableRtl?this.legendBounds.x+this.maxWidth-t:t-this.legendBounds.x,o=(this.gauge.enableRtl?"translate(":"translate(-")+(n=n<0?0:n)+",0)"),this.legendTranslateGroup.setAttribute("transform",o),e.textContent=this.gauge.enableRtl?this.totalPages+"/"+i:i+"/"+this.totalPages,this.currentPage=i,n},OPi.prototype.renderText=function(e,t,i,n,o){var r=this.gauge.legendSettings,n=(i.id=this.legendID+"_Axis_"+n+"_text_"+o,e.visible?r.textStyle.color||this.gauge.themeStyle.labelColor:"#D3D3D3"),o={size:r.textStyle.size||this.gauge.themeStyle.fontSize,color:n,fontFamily:r.textStyle.fontFamily||this.gauge.themeStyle.labelFontFamily,fontWeight:r.textStyle.fontWeight||this.gauge.themeStyle.fontWeight,fontStyle:r.textStyle.fontStyle,opacity:r.textStyle.opacity},r=(i.text=e.text,i.x=this.gauge.enableRtl?e.location.x-(BMi(e.text,o).width+r.shapeWidth/2+r.shapePadding):e.location.x+r.shapeWidth/2+r.shapePadding,i.y=e.location.y+this.maxItemHeight/4,RMi(i,o,n,t,""));r.setAttribute("aria-label",i.text),r.setAttribute("role","region")},OPi.prototype.renderSymbol=function(e,t,i,n){e.fill=e.fill||this.gauge.axes[i].ranges[n].rangeColor,OMi(nki(e.location,e.shape,new cki(e.shapeWidth,e.shapeHeight),"",new ski(this.legendID+"_Axis_"+i+"_Shape_"+n,e.fill,e.shapeBorder.width,e.shapeBorder.color,null,e.shapeBorder.dashArray,"","")),t,this.gauge,"Circle"===e.shape?"Ellipse":"Path")},OPi.prototype.getRenderPoint=function(e,t,i,n,o,r,s){var a,l=this.legend.padding,h={size:this.legend.textStyle.size||this.gauge.themeStyle.fontSize,color:this.legend.textStyle.color||this.gauge.themeStyle.labelColor,fontFamily:this.legend.textStyle.fontFamily||this.gauge.themeStyle.labelFontFamily,fontWeight:this.legend.textStyle.fontWeight||this.gauge.themeStyle.fontWeight,fontStyle:this.legend.textStyle.fontStyle,opacity:this.legend.textStyle.opacity},i=(this.isVertical?r===s||n.location.y+1.5*this.maxItemHeight+2*l>o.y+o.height?(e.location.x=n.location.x+(r===s?0:this.gauge.enableRtl?-this.maxColumnWidth-4*this.legend.shapePadding/3:this.maxColumnWidth),e.location.y=t.y,a=this.legend.shapeWidth/2+l,this.pageXCollections.push(e.location.x+(this.gauge.enableRtl?a:-a)),this.totalPages++):(e.location.x=n.location.x,e.location.y=n.location.y+this.maxItemHeight+l):(a=n.location.x+(this.gauge.enableRtl?-n.textSize.width-i:n.textSize.width+i),this.isWithinBounds(a,e.textSize.width+i-l,o,this.legend.shapeWidth/2)?(e.location.y=r===s?n.location.y:n.location.y+this.maxItemHeight+l,e.location.x=t.x):(e.location.y=n.location.y,e.location.x=r===s?n.location.x:a),this.totalPages=this.totalRowCount),this.getAvailWidth(e.location.x,this.legendBounds.width));e.text=vPi(+i.toFixed(4),e.text,h)},OPi.prototype.isWithinBounds=function(e,t,i,n){return this.gauge.enableRtl?e-t<i.x-n:e+t>i.x+i.width+n},OPi.prototype.click=function(e){var t=e.target.id,i=-1;if(-1<t.indexOf(this.legendID))for(var n=0,o=["_text_","_Shape_"];n<o.length;n++){var r=o[n];if(-1<t.indexOf(r)){var s=parseInt(t.split(this.legendID+"_Axis_")[1].split(r)[0],10),r=parseInt(t.split(this.legendID+"_Axis_")[1].split(r)[1],10);if(this.gauge.legendSettings.toggleVisibility&&!isNaN(r)){var a=this.legendByIndex(s,r,this.legendCollection),l=new NPi(s,r,!a.render);if(0===this.toggledIndexes.length)this.toggledIndexes.push(l);else{for(var h=0;h<this.toggledIndexes.length;h++){if(this.toggledIndexes[h].axisIndex===l.axisIndex&&this.toggledIndexes[h].rangeIndex===l.rangeIndex){i=h;break}i=-1}-1===i?this.toggledIndexes.push(l):this.toggledIndexes[i].isToggled=!this.toggledIndexes[i].isToggled}this.setStyles(this.toggledIndexes)}}}-1<t.indexOf(this.legendID+"_pageup")?this.changePage(e,!this.gauge.enableRtl):-1<t.indexOf(this.legendID+"_pagedown")&&this.changePage(e,!!this.gauge.enableRtl)},OPi.prototype.setStyles=function(e){for(var t=0;t<e.length;t++){for(var i=0,n=0;n<e[t].rangeIndex;n++)this.gauge.axes[e[t].axisIndex].ranges[n].start===this.gauge.axes[e[t].axisIndex].ranges[n].end&&i++;var o=this.gauge.element.id+"_Axis_"+e[t].axisIndex+"_Range_"+e[t].rangeIndex,r=this.legendID+"_Axis_"+e[t].axisIndex+"_Shape_"+e[t].rangeIndex,s=this.legendID+"_Axis_"+e[t].axisIndex+"_text_"+e[t].rangeIndex,o=this.gauge.svgObject.querySelector("#"+o),r=this.gauge.svgObject.querySelector("#"+r),s=this.gauge.svgObject.querySelector("#"+s);e[t].isToggled?je(o)||(o.style.visibility="visible",r.setAttribute("fill",this.legendCollection[e[t].rangeIndex-i].fill),s.setAttribute("fill",this.legend.textStyle.color||this.gauge.themeStyle.labelColor)):je(o)||(o.style.visibility="hidden",r.setAttribute("fill","#D3D3D3"),s.setAttribute("fill","#D3D3D3"))}},OPi.prototype.legendByIndex=function(e,t,i){for(var n=0,o=i;n<o.length;n++){var r=o[n];if(r.axisIndex===e&&r.rangeIndex===t)return r}return null},OPi.prototype.changePage=function(e,t){var i=document.getElementById(this.legendID+"_pagenumber"),n=parseInt(i.textContent.split("/")[this.gauge.enableRtl?1:0],10);t&&1<n?this.translatePage(i,n-2,n-1):!t&&n<this.totalPages&&this.translatePage(i,n,n+1)},OPi.prototype.getAvailWidth=function(e,t){return(t=this.isVertical?this.maxWidth:t)-(2*this.legend.padding+this.legend.shapeWidth+this.legend.shapePadding)},OPi.prototype.createLegendElements=function(e,t,i,n){var o=i.padding,r={color:i.border.color||this.gauge.themeStyle.legendBorderColor||"",width:i.border.width||this.gauge.themeStyle.legendBorderWidth||1,dashArray:i.border.dashArray},r=new hki(n+"_element",i.background,r,i.opacity,e),i=(r.width=this.isVertical?this.maxWidth:e.width,t?t.appendChild(this.gauge.renderer.drawRectangle(r)):this.gauge.renderer.drawRectangle(r),this.gauge.renderer.createGroup({id:n+"_collections"})),e=(t.appendChild(i),this.legendTranslateGroup=this.gauge.renderer.createGroup({id:n+"_translate_g"}),i.appendChild(this.legendTranslateGroup),this.gauge.renderer.createClipPath({id:n+"_clipPath"}));return r.id+="_clipPath_rect",r.width=this.isVertical?r.width-o:r.width,this.clipRect=this.gauge.renderer.drawRectangle(r),e.appendChild(this.clipRect),this.appendChildElement(this.gauge.svgObject,e),i.style.cssText="clip-path:url(#"+e.id+")",this.legendTranslateGroup},OPi.prototype.appendChildElement=function(e,t){var i=e.querySelector("#"+t.id),n=i||$Mi(t.id);i?e.replaceChild(t,n):e.appendChild(t)},OPi.prototype.findFirstLegendPosition=function(e){for(var t=0,i=0,n=e;i<n.length;i++){var o=n[i];if(o.render&&""!==o.text)break;t++}return t},OPi.prototype.getLegendBounds=function(e,t,i){for(var n=0,o=0,r=i.padding,s=(this.isVertical?n=i.width?0:e.width/100*5:o=i.height?0:e.height/100*5,t.width+=n,t.height+=o,{size:i.textStyle.size||this.gauge.themeStyle.fontSize,color:this.legend.textStyle.color||this.gauge.themeStyle.labelColor,fontFamily:i.textStyle.fontFamily||this.gauge.themeStyle.labelFontFamily,fontWeight:i.textStyle.fontWeight||this.gauge.themeStyle.fontWeight,fontStyle:i.textStyle.fontStyle,opacity:i.textStyle.opacity}),a=0,l=0,h=0,d=[],p=0,c=(this.maxItemHeight=Math.max(BMi("MeasureText",s).height,i.shapeHeight),!1),u=0,g=this.legendCollection;u<g.length;u++){var m=g[u],f={fill:m.fill,text:m.text,shape:m.shape,name:"legendRender",cancel:!1};this.gauge.trigger("legendRender",f),m.render=!f.cancel,m.text=f.text,m.fill=f.fill,m.shape=f.shape,m.textSize=BMi(m.text,s),m.render&&""!==m.text&&(c=!0,f=i.shapeWidth+2*i.shapePadding+m.textSize.width+2*r,this.isVertical?(p=++h*(this.maxItemHeight+r)+r,h*(this.maxItemHeight+r)+r>t.height&&(p=Math.max(p,h*(this.maxItemHeight+r)+r),l+=a,d.push(a),this.totalPages=Math.max(h,this.totalPages||1),a=0,h=1),a=Math.max(f,a)):(l+=f,t.width<r+l&&(a=Math.max(a,l+r-f),0===h&&f!==l&&(h=1),l=f,p=++h*(this.maxItemHeight+r)+r)))}this.isVertical?(this.isPaging=t.width<(l+=a)+r,p=Math.max(p,(this.totalPages||1)*(this.maxItemHeight+r)+r),this.isPaging=this.isPaging&&1<this.totalPages,d[d.length-1]!==a&&d.push(a)):(this.isPaging=t.height<p,this.totalPages=this.totalRowCount=h,p=Math.max(p,this.maxItemHeight+r+r)),this.maxColumns=0;e=this.isVertical?this.getMaxColumn(d,t.width,r,l+r):Math.max(l+r,a);c?this.setBounds(e,p,i,t):this.setBounds(0,0,i,t)},OPi.prototype.subtractThickness=function(e,t,i,n,o){return e.x+=t,e.y+=n,e.width-=t+i,e.height-=n+o,e},OPi.prototype.setBounds=function(e,t,i,n){e=e<n.width?e:n.width,t=t<n.height?t:n.height,n.width=i.width?n.width:e,n.height=i.height?n.height:t,this.rowCount=Math.max(1,Math.ceil((n.height-i.padding)/(this.maxItemHeight+i.padding))),1===this.rowCount&&("Bottom"===i.position||"Top"===i.position)&&!je(i.width)&&-1<i.width.indexOf("%")&&(n.width=e)},OPi.prototype.getMaxColumn=function(e,t,i,n){var o=i;this.maxColumnWidth=Math.max.apply(null,e);for(var r=0;r<e.length;r++)if(o+=this.maxColumnWidth,this.maxColumns++,t<o+i){o-=this.maxColumnWidth,this.maxColumns--;break}return this.isPaging=o<n&&1<this.totalPages,o===i&&(o=t),this.maxColumns=Math.max(1,this.maxColumns),this.maxWidth=o},OPi.prototype.getModuleName=function(){return"Legend"},OPi.prototype.destroy=function(){this.legendCollection=[],this.legendRenderingCollections=[],this.legendRegions=[],this.titleRect=null,this.pageXCollections=[],this.clipRect=null,this.legendTranslateGroup=null,this.legend=null,this.pagingRegions=[],this.toggledIndexes=[],this.legendBounds=null,this.removeEventListener(),this.gauge=null};var RPi=OPi;function OPi(e){this.legendRegions=[],this.rowCount=0,this.pageButtonSize=8,this.pageXCollections=[],this.maxColumns=0,this.maxWidth=0,this.currentPage=1,this.pagingRegions=[],this.position="Auto",this.gauge=e,this.toggledIndexes=[],this.legend=this.gauge.legendSettings,this.legendID=this.gauge.element.id+"_gauge_legend",this.addEventListener()}var NPi=function(e,t,i){this.axisIndex=e,this.rangeIndex=t,this.isToggled=i},VPi=function(e,t,i,n,o,r,s,a,l,h,d){this.location={x:0,y:0},this.text=e,this.originalText=t,this.fill=i,this.shape=n,this.visible=o,this.border=r,this.shapeBorder=s,this.shapeWidth=a,this.shapeHeight=l,this.rangeIndex=h,this.axisIndex=d},_Pi=(HPi.prototype.export=function(l,e,h,d,p){return new Promise(function(i,e){var n=Q("canvas",{id:"ej2-canvas",attrs:{width:l.availableSize.width.toString(),height:l.availableSize.height.toString()}}),t=(d=je(d)?up.Landscape:d,l.svgObject.cloneNode(!0)),o=t.childNodes[0].getAttribute("fill"),r=("Tailwind"!==l.theme&&"Tailwind3"!==l.theme&&"Bootstrap5"!==l.theme&&"Fluent"!==l.theme&&"Material3"!==l.theme&&"Fluent2"!==l.theme||"rgba(255,255,255, 0.0)"!==o&&"transparent"!==o?"TailwindDark"!==l.theme&&"Tailwind3Dark"!==l.theme&&"Bootstrap5Dark"!==l.theme&&"FluentDark"!==l.theme&&"Material3Dark"!==l.theme&&"Fluent2Dark"!==l.theme&&"Fluent2HighContrast"!==l.theme||"rgba(255,255,255, 0.0)"!==o&&"transparent"!==o||t.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):t.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)"),window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(t)],{type:"image/svg+xml"}))),s=new Image,a=n.getContext("2d");s.onload=function(){a.drawImage(s,0,0),window.URL.revokeObjectURL(r);var e=new sg,t=n.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");e.pageSettings.orientation=d,t=t.slice(t.indexOf(",")+1),e.pages.add().graphics.drawImage(new oc(t),0,0,l.availableSize.width,l.availableSize.height),p?(e.save(h+".pdf"),e.destroy()):i(null)},s.src=r})},HPi.prototype.getModuleName=function(){return"PdfExport"},HPi.prototype.destroy=function(){},HPi);function HPi(e){}jPi.prototype.export=function(h,d,p,c){var u=this;return new Promise(function(e,t){var i,n,o=!(-1<F.userAgent.toString().indexOf("HeadlessChrome")),r=Q("canvas",{id:"ej2-canvas",attrs:{width:h.availableSize.width.toString(),height:h.availableSize.height.toString()}}),s=h.svgObject.cloneNode(!0),a=s.childNodes[0].getAttribute("fill"),a=("Tailwind"!==h.theme&&"Tailwind3"!==h.theme&&"Bootstrap5"!==h.theme&&"Fluent"!==h.theme&&"Material3"!==h.theme&&"Fluent2"!==h.theme||"rgba(255,255,255, 0.0)"!==a&&"transparent"!==a?"TailwindDark"!==h.theme&&"Tailwind3Dark"!==h.theme&&"Bootstrap5Dark"!==h.theme&&"FluentDark"!==h.theme&&"Material3Dark"!==h.theme&&"Fluent2Dark"!==h.theme&&"Fluent2HighContrast"!==h.theme||"rgba(255,255,255, 0.0)"!==a&&"transparent"!==a||s.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):s.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)"),'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+s.outerHTML+"</svg>"),l=window.URL.createObjectURL(new Blob("SVG"===d?[a]:[(new XMLSerializer).serializeToString(s)],{type:"image/svg+xml"}));"SVG"===d?c?u.triggerDownload(p,d,l,o):e(null):(i=new Image,n=r.getContext("2d"),i.onload=function(){n.drawImage(i,0,0),window.URL.revokeObjectURL(l),c?u.triggerDownload(p,d,r.toDataURL("image/png").replace("image/png","image/octet-stream"),o):"JPEG"===d?e(r.toDataURL("image/jpeg")):"PNG"===d&&e(r.toDataURL("image/png"))},i.src=l)})},jPi.prototype.getModuleName=function(){return"ImageExport"},jPi.prototype.destroy=function(){},jPi.prototype.triggerDownload=function(e,t,i,n){Q("a",{attrs:{download:e+"."+t.toLocaleLowerCase(),href:i}}).dispatchEvent(new MouseEvent(n?"click":"move",{view:window,bubbles:!1,cancelable:!0}))};var zPi=jPi;function jPi(e){}QPi.prototype.print=function(e,t){var i=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),n=(i.moveTo(0,0),i.resizeTo(screen.availWidth,screen.availHeight),{cancel:!1,htmlContent:this.getHTMLContent(e,t),name:"beforePrint"});e.trigger("beforePrint",n,function(e){n.cancel||V(n.htmlContent,i)})},QPi.prototype.getHTMLContent=function(e,t){var i,n,o=Q("div");return t?t instanceof Array?t.forEach(function(e){o.appendChild($Mi(e).cloneNode(!0))}):t instanceof Element?o.appendChild(t.cloneNode(!0)):o.appendChild($Mi(t).cloneNode(!0)):(je(n=(t=e.element.cloneNode(!0)).getElementsByTagName("svg")[0])||je(n=n.childNodes[0])||(i=n.getAttribute("fill"),"Tailwind"!==e.theme&&"Tailwind3"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==i&&"transparent"!==i?"TailwindDark"!==e.theme&&"Tailwind3Dark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==i&&"transparent"!==i||n.setAttribute("fill","rgba(0, 0, 0, 1)"):n.setAttribute("fill","rgba(255,255,255, 1)")),o.appendChild(t)),o},QPi.prototype.getModuleName=function(){return"Print"},QPi.prototype.destroy=function(){};var WPi=QPi;function QPi(e){}UPi=function(e,t){return(UPi=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])}))(e,t)};var UPi,qPi,pJ=function(e,t){function i(){this.constructor=e}UPi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Kmt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},HOt=(pJ(GPi,qPi=n),Kmt([e("#000000")],GPi.prototype,"color",void 0),Kmt([e(1)],GPi.prototype,"opacity",void 0),Kmt([e("0%")],GPi.prototype,"offset",void 0),Kmt([e("")],GPi.prototype,"style",void 0),GPi);function GPi(){return null!==qPi&&qPi.apply(this,arguments)||this}pJ(XPi,YPi=n),Kmt([e("0%")],XPi.prototype,"x",void 0),Kmt([e("0%")],XPi.prototype,"y",void 0);var YPi,PNt=XPi;function XPi(){return null!==YPi&&YPi.apply(this,arguments)||this}pJ(JPi,KPi=n),Kmt([e(null)],JPi.prototype,"startValue",void 0),Kmt([e(null)],JPi.prototype,"endValue",void 0),Kmt([kt([{color:"#000000",opacity:1,offset:"0%",style:""}],HOt)],JPi.prototype,"colorStop",void 0);var KPi,Det=JPi;function JPi(){return null!==KPi&&KPi.apply(this,arguments)||this}pJ($Pi,ZPi=n),Kmt([e("0%")],$Pi.prototype,"radius",void 0),Kmt([t({x:"0%",y:"0%"},PNt)],$Pi.prototype,"outerPosition",void 0),Kmt([t({x:"0%",y:"0%"},PNt)],$Pi.prototype,"innerPosition",void 0),Kmt([kt([{color:"#000000",opacity:1,offset:"0%",style:""}],HOt)],$Pi.prototype,"colorStop",void 0);var ZPi,set=$Pi;function $Pi(){return null!==ZPi&&ZPi.apply(this,arguments)||this}tBi.prototype.calculateLinearGradientPosition=function(e,t,i){return{id:t,x1:je(e.linearGradient.startValue)&&-1!==t.indexOf("range")?"right"===i?"100%":"0%":je(e.linearGradient.startValue)?"0%":(-1===e.linearGradient.startValue.indexOf("%")?e.linearGradient.startValue:parseFloat(e.linearGradient.startValue).toString())+"%",x2:je(e.linearGradient.endValue)&&-1!==t.indexOf("range")?"left"===i?"100%":"0%":je(e.linearGradient.endValue)?"100%":(-1===e.linearGradient.endValue.indexOf("%")?e.linearGradient.endValue:parseFloat(e.linearGradient.endValue).toString())+"%",y1:je(e.linearGradient.startValue)&&-1!==t.indexOf("range")&&"bottom"===i?"100%":"0%",y2:je(e.linearGradient.endValue)&&-1!==t.indexOf("range")&&"top"===i?"100%":"0%"}},tBi.prototype.getLinearGradientColor=function(e,t,i,n){var o=new fo(""),r=je(e.linearGradient.startValue)&&je(e.linearGradient.endValue)&&!je(n)?this.getCircularGradientColor(e.linearGradient.colorStop,t):this.getGradientColor(e.linearGradient.colorStop),n=je(e.linearGradient.startValue)&&je(e.linearGradient.endValue)&&!je(n)?"_"+this.gauge.svgObject.id+"_range_"+n+"_color_"+t+"_linearGradient":"_"+this.gauge.svgObject.id+"_"+this.gauge.gradientCount+"_linearGradient",t={id:(t=this.calculateLinearGradientPosition(e,n,i)).id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2},e=o.drawGradient("linearGradient",t,r);return this.gauge.svgObject.appendChild(e),"url(#"+n+")"},tBi.prototype.getCircularGradientColor=function(e,t){for(var i=[],n=t,o=n;o<(t===e.length-1?t+1:t+2);o++){var r={color:e[o].color,colorStop:e[o].offset,opacity:e[o].opacity?e[o].opacity.toString():"1",style:e[o].style};i.push(r),n++}return i},tBi.prototype.getRadialGradientColor=function(e){var t=new fo(""),i=this.getGradientColor(e.radialGradient.colorStop),n="_"+this.gauge.svgObject.id+"_"+this.gauge.gradientCount+"_radialGradient",e={id:n,r:je(e.radialGradient.radius)?"0%":(-1===e.radialGradient.radius.indexOf("%")?e.radialGradient.radius:parseFloat(e.radialGradient.radius).toString())+"%",cx:je(e.radialGradient.outerPosition)||je(e.radialGradient.outerPosition.x)?"0%":(-1===e.radialGradient.outerPosition.x.indexOf("%")?e.radialGradient.outerPosition.x:parseFloat(e.radialGradient.outerPosition.x).toString())+"%",cy:je(e.radialGradient.outerPosition)||je(e.radialGradient.outerPosition.y)?"0%":(-1===e.radialGradient.outerPosition.y.indexOf("%")?e.radialGradient.outerPosition.y:parseFloat(e.radialGradient.outerPosition.y).toString())+"%",fx:je(e.radialGradient.innerPosition)||je(e.radialGradient.innerPosition.x)?"0%":(-1===e.radialGradient.innerPosition.x.indexOf("%")?e.radialGradient.innerPosition.x:parseFloat(e.radialGradient.innerPosition.x).toString())+"%",fy:je(e.radialGradient.innerPosition)||je(e.radialGradient.innerPosition.y)?"0%":(-1===e.radialGradient.innerPosition.y.indexOf("%")?e.radialGradient.innerPosition.y:parseFloat(e.radialGradient.innerPosition.y).toString())+"%"},t=t.drawGradient("radialGradient",e,i);return this.gauge.svgObject.appendChild(t),"url(#"+n+")"},tBi.prototype.getGradientColor=function(e){for(var t=[],i=0;i<e.length;i++){var n={color:e[i].color,colorStop:e[i].offset,opacity:e[i].opacity?e[i].opacity.toString():"1",style:e[i].style};t.push(n)}return t},tBi.prototype.getGradientColorString=function(e,t,i,n){return e.linearGradient&&!je(e.linearGradient.colorStop)||e.radialGradient&&!je(e.radialGradient.colorStop)?(t=e.linearGradient?this.getLinearGradientColor(e,t,i,n):this.getRadialGradientColor(e),this.gauge.gradientCount=this.gauge.gradientCount+1,t):null},tBi.prototype.getModuleName=function(){return"Gradient"},tBi.prototype.destroy=function(){this.gauge=null};var eBi=tBi;function tBi(e){this.gauge=e}iBi=function(e,t){return(iBi=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])}))(e,t)};var iBi,nBi,oBi,P$e=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},H$e=(function(e,t){function i(){this.constructor=e}iBi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(rBi,nBi=Ji),(oBi=rBi).prototype.preRender=function(){je(this.element)||(this.unWireEvents(),this.trigger("load",{gauge:this}),this.initPrivateVariable(),this.setCulture(),this.createSvg(),this.wireEvents())},rBi.prototype.render=function(){je(this.element)||(this.setTheme(),this.calculateBounds(),this.isPropertyChange=!1,this.allowLoadingAnimation=(0===this.animationDuration&&"Enable"===Ut||0<this.animationDuration)&&!this.isOverAllAnimationComplete,this.renderElements(!0),this.renderAnimation(),this.renderComplete())},rBi.prototype.setTheme=function(){this.themeStyle=function(e){var t;switch(e.toLowerCase()){case"materialdark":case"fabricdark":case"bootstrapdark":t={backgroundColor:"#333232",titleFontColor:"#ffffff",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#000000",tooltipFontSize:"13px",tooltipTextOpacity:1,labelColor:"#DADADA",lineColor:"#C8C8C8",majorTickColor:"#C8C8C8",minorTickColor:"#9A9A9A",pointerColor:"#9A9A9A",capColor:"#9A9A9A",needleColor:"#9A9A9A",needleTailColor:"#9A9A9A",fontSize:"12px",titleFontSize:"15px",labelFontFamily:"Segoe UI",fontFamily:"Segoe UI",fontWeight:"Normal",titleFontWeight:"Normal"};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",tooltipFillColor:"#ffffff",tooltipFontColor:"#000000",tooltipFontSize:"13px",tooltipTextOpacity:1,labelColor:"#FFFFFF",lineColor:"#FFFFFF",majorTickColor:"#FFFFFF",minorTickColor:"#FFFFFF",pointerColor:"#FFFFFF",capColor:"#FFFFFF",needleColor:"#FFFFFF",needleTailColor:"#FFFFFF",fontSize:"12px",titleFontSize:"15px",labelFontFamily:"Segoe UI",fontFamily:"Segoe UI",fontWeight:"Normal",titleFontWeight:"Normal"};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"13px",labelColor:"#212529",lineColor:"#DEE2E6",majorTickColor:"#ADB5BD",minorTickColor:"#CED4DA",pointerColor:"#6C757D",capColor:"#6C757D",needleColor:"#6C757D",needleTailColor:"#6C757D",fontFamily:"HelveticaNeue-Medium",fontSize:"12px",titleFontSize:"16px",labelFontFamily:"HelveticaNeue",tooltipFillOpacity:1,tooltipTextOpacity:.9,fontWeight:"Normal",titleFontWeight:"Normal"};break;case"tailwind":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#374151",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"13px",labelColor:"#6B7280",lineColor:"#E5E7EB",majorTickColor:"#9CA3AF",minorTickColor:"#9CA3AF",pointerColor:"#1F2937",capColor:"#1F2937",needleColor:"#1F2937",needleTailColor:"#1F2937",fontFamily:"Inter",fontSize:"12px",titleFontSize:"14px",labelFontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:.9,fontWeight:"Normal",titleFontWeight:"500"};break;case"tailwinddark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#D1D5DB",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"13px",labelColor:"#9CA3AF",lineColor:"#374151",majorTickColor:"#6B7280",minorTickColor:"#6B7280",pointerColor:"#9CA3AF",capColor:"#9CA3AF",needleColor:"#9CA3AF",needleTailColor:"#9CA3AF",fontFamily:"Inter",fontSize:"12px",titleFontSize:"14px",labelFontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:.9,fontWeight:"Normal",titleFontWeight:"500"};break;case"tailwind3":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#111827",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"12px",labelColor:"#4B5563",lineColor:"#E5E7EB",majorTickColor:"#D1D5DB",minorTickColor:"#D1D5DB",pointerColor:"#1F2937",capColor:"#1F2937",needleColor:"#1F2937",needleTailColor:"#1F2937",fontFamily:"Inter",fontSize:"12px",titleFontSize:"14px",labelFontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:1,fontWeight:"400",titleFontWeight:"600"};break;case"tailwind3dark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#FFFFFF",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"12px",labelColor:"#D1D5DB",lineColor:"#282F3C",majorTickColor:"#374151",minorTickColor:"#374151",pointerColor:"#6B7280",capColor:"#6B7280",needleColor:"#6B7280",needleTailColor:"#6B7280",fontFamily:"Inter",fontSize:"12px",titleFontSize:"14px",labelFontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:1,fontWeight:"400",titleFontWeight:"600"};break;case"bootstrap5":t={backgroundColor:"transparent",titleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",fontSize:"10px",tooltipFontSize:"12px",labelColor:"#212529",lineColor:"#E9ECEF",majorTickColor:"#CED4DA",minorTickColor:"#CED4DA",pointerColor:"#343A40",capColor:"#343A40",needleColor:"#343A40",needleTailColor:"#343A40",fontFamily:"Segoe UI",titleFontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:.9,fontWeight:"400",titleFontWeight:"400"};break;case"bootstrap5dark":t={backgroundColor:"transparent",titleFontColor:"#DEE2E6",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#212529",fontSize:"10px",tooltipFontSize:"12px",labelColor:"#DEE2E6",lineColor:"#343A40",majorTickColor:"#6C757D",minorTickColor:"#6C757D",pointerColor:"#ADB5BD",capColor:"#ADB5BD",needleColor:"#ADB5BD",needleTailColor:"#ADB5BD",fontFamily:"Segoe UI",titleFontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:.9,fontWeight:"400",titleFontWeight:"400"};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#323130",tooltipFontSize:"13px",labelColor:"#3B3A39",lineColor:"#EDEBE9",majorTickColor:"#C8C6C4",minorTickColor:"#C8C6C4",pointerColor:"#A19F9D",capColor:"#A19F9D",needleColor:"#A19F9D",needleTailColor:"#A19F9D",fontFamily:"Segoe UI",fontSize:"12px",titleFontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,fontWeight:"Normal",titleFontWeight:"600"};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",tooltipFillColor:"#252423",tooltipFontColor:"#F3F2F1",tooltipFontSize:"13px",labelColor:"#C8C6C4",lineColor:"#292827",majorTickColor:"#484644",minorTickColor:"#484644",pointerColor:"#797775",capColor:"#797775",needleColor:"#797775",needleTailColor:"#797775",fontFamily:"Segoe UI",fontSize:"12px",titleFontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,fontWeight:"Normal",titleFontWeight:"600"};break;case"material3":t={backgroundColor:"transparent",titleFontColor:"#1C1B1F",tooltipFillColor:"#313033",tooltipFontColor:"#F4EFF4",tooltipFontSize:"14px",labelColor:" #1E192B",lineColor:"#E7E0EC",majorTickColor:"#C4C7C5",minorTickColor:"#C4C7C5",pointerColor:"#49454E",capColor:"#49454E",needleColor:"#49454E",needleTailColor:"#49454E",fontFamily:"Roboto",fontSize:"12px",titleFontSize:"16px",labelFontFamily:"Roboto",tooltipFillOpacity:1,tooltipTextOpacity:1,fontWeight:"400",titleFontWeight:"500"};break;case"material3dark":t={backgroundColor:"transparent",titleFontColor:"#E6E1E5",tooltipFillColor:"#E6E1E5",tooltipFontColor:"#313033",tooltipFontSize:"14px",labelColor:"#E6E1E5",lineColor:"#49454F",majorTickColor:"#444746",minorTickColor:"#444746",pointerColor:"#CAC4D0",capColor:"#CAC4D0",needleColor:"#CAC4D0",needleTailColor:"#CAC4D0",fontFamily:"Roboto",fontSize:"12px",titleFontSize:"16px",labelFontFamily:"Roboto",tooltipFillOpacity:1,tooltipTextOpacity:1,fontWeight:"400",titleFontWeight:"500"};break;case"fluent2":t={backgroundColor:"transparent",titleFontColor:"#242424",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#242424",tooltipFontSize:"12px",labelColor:"#242424",lineColor:"#EDEBE9",majorTickColor:"#C8C6C4",minorTickColor:"#C8C6C4",pointerColor:"#A19F9D",capColor:"#A19F9D",needleColor:"#A19F9D",needleTailColor:"#A19F9D",fontFamily:"Segoe UI",fontSize:"12px",titleFontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,fontWeight:"400",titleFontWeight:"600"};break;case"fluent2dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",tooltipFillColor:"#292929",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",labelColor:"#FFFFFF",lineColor:"#292827",majorTickColor:"#484644",minorTickColor:"#484644",pointerColor:"#8A8886",capColor:"#8A8886",needleColor:"#8A8886",needleTailColor:"#8A8886",fontFamily:"Segoe UI",fontSize:"12px",titleFontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,fontWeight:"400",titleFontWeight:"600"};break;case"fluent2highcontrast":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",labelColor:"#FFFFFF",lineColor:"#292827",majorTickColor:"#484644",minorTickColor:"#484644",pointerColor:"#8A8886",capColor:"#8A8886",needleColor:"#8A8886",needleTailColor:"#8A8886",fontFamily:"Segoe UI",fontSize:"12px",titleFontSize:"14px",labelFontFamily:"Segoe UI",tooltipFillOpacity:1,tooltipTextOpacity:1,fontWeight:"400",titleFontWeight:"600",tooltipBorderColor:"#FFF",legendBorderColor:"#FFF",legendBorderWidth:1};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",tooltipTextOpacity:1,labelColor:"#212121",lineColor:"#E0E0E0",majorTickColor:"#9E9E9E",minorTickColor:"#9E9E9E",pointerColor:"#757575",capColor:"#757575",needleColor:"#757575",needleTailColor:"#757575",fontSize:"12px",titleFontSize:"15px",labelFontFamily:"Segoe UI",fontFamily:"Segoe UI",fontWeight:"Normal",titleFontWeight:"Normal"}}return t}(this.theme)},rBi.prototype.unWireEvents=function(){E.remove(this.element,F.touchStartEvent,this.gaugeOnMouseDown),E.remove(this.element,F.touchMoveEvent,this.mouseMove),E.remove(this.element,F.touchEndEvent,this.mouseEnd),E.remove(this.element,"click",this.gaugeOnMouseClick),E.remove(this.element,"contextmenu",this.gaugeRightClick),E.remove(this.element,F.isPointer?"pointerleave":"mouseleave",this.mouseLeave),window.removeEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeEvent)},rBi.prototype.wireEvents=function(){E.add(this.element,F.touchStartEvent,this.gaugeOnMouseDown,this),E.add(this.element,F.touchMoveEvent,this.mouseMove,this),E.add(this.element,F.touchEndEvent,this.mouseEnd,this),E.add(this.element,"click",this.gaugeOnMouseClick,this),E.add(this.element,"contextmenu",this.gaugeRightClick,this),E.add(this.element,F.isPointer?"pointerleave":"mouseleave",this.mouseLeave,this),this.resizeEvent=this.gaugeResize.bind(this),window.addEventListener(F.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeEvent),this.setGaugeStyle(this.element)},rBi.prototype.gaugeOnMouseClick=function(e){return this.setMouseXY(e),this.legendModule&&this.legendSettings.visible&&this.legendModule.click(e),!1},rBi.prototype.mouseMove=function(s){var a=this,l=(this.setMouseXY(s),this.getMouseArgs(s,"touchmove","gaugeMouseMove"));return this.trigger("gaugeMouseMove",l,function(e){var t,i,n,o,r=!1;!je(a.activePointer)&&a.activePointer.pathElement[0].id!==l.target.id||(t=-1<l.target.id.indexOf("_Pointer_")?parseInt(l.target.id.slice(-1),10):null,o=-1<l.target.id.indexOf("_Axis_")?parseInt(l.target.id.split("_Axis_")[1],10):null,r=!a.allowPointerDrag||je(o)||je(t)?a.enablePointerDrag:a.axes[o].pointers[t].enableDrag,a.isPointerDragged=r),l.cancel||((a.isPointerDragged||a.enableRangeDrag)&&"grabbing"!==a.svgObject.getAttribute("cursor")?-1!==l.target.id.indexOf("_Pointer_")&&a.isPointerDragged||a.enableRangeDrag&&-1!==l.target.id.indexOf("_Range_")?a.svgObject.setAttribute("cursor","pointer"):a.svgObject.setAttribute("cursor","auto"):"grabbing"!==a.svgObject.getAttribute("cursor")&&a.svgObject.setAttribute("cursor","auto"),o=$Mi(a.element.id+"_svg"),t=a.element.getBoundingClientRect().left-o.getBoundingClientRect().left,a.isPointerDragged&&a.activePointer?(a.isDrag=!0,s.preventDefault(),r=parseInt(a.activePointer.pathElement[0].id.slice(-1),10),n=parseInt(a.activePointer.pathElement[0].id.split("_Axis_")[1],10),i={axis:a.activeAxis,pointer:a.activePointer,previousValue:a.activePointer.currentValue,name:cPi,type:"pointerMove",currentValue:null,axisIndex:n,pointerIndex:r},a.pointerDrag(new uki(l.x+t,l.y),n,r),i.currentValue=a.activePointer.currentValue,a.trigger(cPi,i),a.activeRange=null):a.enableRangeDrag&&a.activeRange&&(a.isDrag=!0,s.preventDefault(),n=parseInt(a.activeRange.pathElement[0].id.split("_Axis_")[1],10),o=parseInt(a.activeRange.pathElement[0].id.split("Range_")[1],10),i={axis:a.activeAxis,name:cPi,type:"rangeMove",range:a.activeRange,axisIndex:n,rangeIndex:o},a.rangeDrag(new uki(l.x+t,l.y),n,o),a.trigger(cPi,i)))}),this.notify(F.touchMoveEvent,s),wPi(s,s.clientX,s.clientY,this,!1),!1},rBi.prototype.mouseLeave=function(e){this.setMouseXY(e),this.activeAxis=null,this.activePointer=null,this.activeRange=null,this.svgObject.setAttribute("cursor","auto");e=this.getMouseArgs(e,"touchmove",hPi);return this.trigger(hPi,e),!1},rBi.prototype.gaugeRightClick=function(e){return 2!==e.buttons&&"touch"!==e.pointerType||(e.preventDefault(),e.stopPropagation(),!1)},rBi.prototype.pointerDrag=function(e,t,i){var n=this.activeAxis,o=n.visibleRange,e=wki(HMi(this.midPoint,e),o.max,o.min,n.startAngle,n.endAngle,"ClockWise"===n.direction);e>=o.min&&e<=o.max&&(this.axes[t].pointers[i].value=e,this.activePointer.currentValue=e,this.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(n,this.activePointer,e))},rBi.prototype.rangeDrag=function(e,t,i){var n,o,r,s;this.activeAxis&&(o=(n=this.activeAxis).visibleRange,(e=wki(HMi(this.midPoint,e),o.max,o.min,n.startAngle,n.endAngle,"ClockWise"===n.direction))>=o.min)&&e<=o.max&&(n=this.activeRange.currentValue,this.activeRange.currentValue=e,o=(this.activeRange.end-this.activeRange.start)/2,o=parseFloat(this.activeRange.start.toString())+o,r="string"==typeof this.activeRange.start?parseFloat(this.activeRange.start):this.activeRange.start,s="string"==typeof this.activeRange.end?parseFloat(this.activeRange.end):this.activeRange.end,this.startValue=e<o?e:n<o?n:r<s?this.activeRange.start:this.activeRange.end,this.endValue=e<o?o<n?n:r<s?this.activeRange.end:this.activeRange.start:e,this.axes[t].ranges[i].start=this.startValue,this.axes[t].ranges[i].end=this.endValue,this.isTouch)&&this.setRangeValue(t,i,this.startValue,this.endValue)},rBi.prototype.gaugeOnMouseDown=function(n){var o,r=this,s=(this.setMouseXY(n),this.getMouseArgs(n,"touchstart","gaugeMouseDown")),a=!1,e=-1<s.target.id.indexOf("_Pointer_")?parseInt(s.target.id.slice(-1),10):null,t=-1<s.target.id.indexOf("_Axis_")?parseInt(s.target.id.split("_Axis_")[1],10):null;return je(t)||je(e)||(a=this.allowPointerDrag?this.axes[t].pointers[e].enableDrag:this.enablePointerDrag),this.trigger("gaugeMouseDown",s,function(e){var t,i;!s.cancel&&0<=s.target.id.indexOf(r.element.id+"_Axis_")&&0<=s.target.id.indexOf("_Pointer_")?(o=tki(s.target.id,r),r.activeAxis=r.axes[o.axisIndex],r.activePointer=r.activeAxis.pointers[o.pointerIndex],je(r.activePointer.pathElement)&&(r.activePointer.pathElement=[n.target]),"Marker"===r.activePointer.type&&"Text"===r.activePointer.markerShape&&0===r.activePointer.pathElement.length&&(r.activePointer.pathElement=[n.target]),t=parseInt(r.activePointer.pathElement[0].id.slice(-1),10),i=parseInt(r.activePointer.pathElement[0].id.split("_Axis_")[1],10),r.trigger(pPi,{axis:r.activeAxis,name:pPi,type:"pointerStart",pointer:r.activePointer,currentValue:r.activePointer.currentValue,pointerIndex:t,axisIndex:i}),a&&r.svgObject.setAttribute("cursor","grabbing")):!s.cancel&&0<=s.target.id.indexOf(r.element.id+"_Axis_")&&0<=s.target.id.indexOf("_Range_")&&(o=Cki(s.target.id,r),r.activeAxis=r.axes[o.axisIndex],r.activeRange=r.activeAxis.ranges[o.rangeIndex],je(r.activeRange.pathElement)&&(r.activeRange.pathElement=[n.target]),t=parseInt(r.activeRange.pathElement[0].id.split("Range_")[1],10),i=parseInt(r.activeRange.pathElement[0].id.split("_Axis_")[1],10),r.trigger(pPi,{axis:r.activeAxis,name:pPi,type:"rangeStart",range:r.activeRange,axisIndex:i,rangeIndex:t}),r.enableRangeDrag)&&r.svgObject.setAttribute("cursor","grabbing")}),!1},rBi.prototype.mouseEnd=function(e){this.setMouseXY(e);var t,i,n=this.getMouseArgs(e,"touchend",dPi),o=(this.isTouch="touch"===e.pointerType||"2"===e.pointerType||"touchend"===e.type,this.trigger(dPi,n),!1);return this.activeAxis&&this.activePointer?(t=parseInt(this.activePointer.pathElement[0].id.slice(-1),10),(o=je(i=parseInt(this.activePointer.pathElement[0].id.split("_Axis_")[1],10))||je(t)?o:this.allowPointerDrag?this.axes[i].pointers[t].enableDrag:this.enablePointerDrag)&&(this.svgObject.setAttribute("cursor","auto"),this.trigger(uPi,{name:uPi,type:"pointerEnd",axis:this.activeAxis,pointer:this.activePointer,currentValue:this.activePointer.currentValue,axisIndex:i,pointerIndex:t}),this.activeAxis=null,this.activePointer=null,this.isPointerDragged=!1)):this.activeAxis&&this.activeRange&&this.enableRangeDrag&&(this.svgObject.setAttribute("cursor","auto"),o=parseInt(this.activeRange.pathElement[0].id.slice(-1),10),i=parseInt(this.activeRange.pathElement[0].id.split("_Axis_")[1],10),this.trigger(uPi,{name:uPi,type:"rangeEnd",axis:this.activeAxis,range:this.activeRange,axisIndex:i,rangeIndex:o}),this.activeAxis=null,this.activeRange=null),je(this.activePointer)||(this.activePointer=null),this.isDrag=!1,this.svgObject.setAttribute("cursor","auto"),this.notify(F.touchEndEvent,e),-1<e.type.indexOf("touch")&&(n.target.id===this.element.id+"_CircularGaugeTitle"||-1<n.target.id.indexOf("_gauge_legend_"))&&wPi(e,e.changedTouches[0].pageX,e.changedTouches[0].pageY,this,!0),!1},rBi.prototype.getMouseArgs=function(e,t,i){var n=this.element.getBoundingClientRect(),n=new uki(-n.left,-n.top),t=e.type===t;return n.x+=(t?e.changedTouches[0]:e).clientX,n.y+=(t?e.changedTouches[0]:e).clientY,{cancel:!1,name:i,x:n.x,y:n.y,target:e.target}},rBi.prototype.gaugeResize=function(e){var t,i=this;return this.isDestroyed||(t={gauge:this,previousSize:this.availableSize,name:"resized",cancel:!1,currentSize:this.calculateSvgSize()},this.trigger("resized",t),t.cancel)||(this.resizeTo&&clearTimeout(this.resizeTo),!je(this.element)&&this.element.classList.contains("e-circulargauge")&&(this.animatePointer=!1,this.resizeTo=window.setTimeout(function(){i.isResize=!0,i.isPropertyChange=!0,i.createSvg(),i.calculateBounds(),i.allowLoadingAnimation=!1,i.isOverAllAnimationComplete&&(i.loadingAnimationDuration=[]),i.renderElements(),i.isResize=!1},500))),!1},rBi.prototype.setGaugeStyle=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"},rBi.prototype.setCulture=function(){this.intl=new Ti},rBi.prototype.createSvg=function(){this.removeSvg(),je(this.renderer)&&(this.renderer=new fo(this.element.id)),je(this.gaugeAxisLayoutPanel)&&(this.gaugeAxisLayoutPanel=new FPi(this)),this.availableSize=this.calculateSvgSize(),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},rBi.prototype.removeSvg=function(){if(!je(this.element)){if(ZMi(this.element.id+"_Secondary_Element"),this.svgObject){for(;0<this.svgObject.childNodes.length;){for(;0<this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&ue(this.svgObject)}!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&ue(this.svgObject)}ZMi(this.element.id+"_svg"),this.clearTemplate()}},rBi.prototype.initPrivateVariable=function(){var e;""===this.element.id&&(e=document.getElementsByClassName("e-circulargauge").length,this.element.id="circulargauge_control_"+e),this.renderer=new fo(this.element.id),this.gaugeAxisLayoutPanel=new FPi(this),this.animatePointer=!0},rBi.prototype.calculateSvgSize=function(){var e=this.element.offsetWidth,t=this.element.offsetHeight,i=2*parseInt(this.element.style.borderWidth.split("px").join(""),10),e=eki(this.width,e)||e||600,t=eki(this.height,t)||t||450,e=isNaN(i)?e:e-i,t=isNaN(i)?t:t-i;return new cki(e,t)},rBi.prototype.radiusAndCenterCalculation=function(e,t,i,n,o,r,s,a,l,h,d,p){var c,u,g,m,f,y=this.margin.bottom+this.border.width;g=this.moveToCenter&&1===this.axes.length&&je(this.centerXpoint)&&je(this.centerYpoint)?new gki(t,e,i,n):this.allowMargin?new gki(t+i/2-o,e+n/2-o,2*o,2*o):!je(this.legendModule)&&n<i&&("Top"===this.legendSettings.position||"Bottom"===this.legendSettings.position)?(m=Math.min(i,n)/2,new gki(t+i/2-m,e+n/2-m,2*m,2*m)):n<i&&(a&&p||s&&d)?new gki(t+i/2-(g=(m=d&&p?n/2:.75*n)<(g=i/2)?m:g),e+n/2-g,2*g,2*g):i<n?new gki(t+i/2-o,e+(m=n/2)-m,2*o,2*m):new gki(t+i/2-o,e+n/2-o,2*o,2*o),this.gaugeRect=g,this.legendModule&&this.legendSettings.visible&&(this.legendModule.getLegendOptions(this.axes),this.legendModule.calculateLegendBounds(this.gaugeRect,this.availableSize)),this.allowMargin?(c=null!==this.centerXpoint?eki(this.centerXpoint,this.availableSize.width):this.gaugeRect.x+this.gaugeRect.width/2,u=null!==this.centerYpoint?eki(this.centerYpoint,this.availableSize.height):this.gaugeRect.y+this.gaugeRect.height/2):(!je(this.legendModule)&&(s||a)&&n<i&&("Top"===this.legendSettings.position||"Bottom"===this.legendSettings.position)?(f=n-this.gaugeRect.height,this.gaugeRect.width=i-(this.availableSize.width-this.gaugeRect.width)/2,this.gaugeRect.y=this.gaugeRect.y-f,this.gaugeRect.height=this.gaugeRect.height+f+(this.availableSize.height-this.gaugeRect.height)/2):!je(this.legendModule)&&(s||a)&&n<i&&("Left"===this.legendSettings.position||"Right"===this.legendSettings.position)&&(f=this.gaugeRect.height-this.gaugeRect.width,this.gaugeRect.x="Right"===this.legendSettings.position?this.gaugeRect.x+this.margin.right:this.gaugeRect.x,this.gaugeRect.width="Left"===this.legendSettings.position?Math.abs(i-(this.availableSize.width-this.gaugeRect.width+f)/2):Math.abs(i-(this.availableSize.width-this.gaugeRect.width)/2-10)),c=null!==this.centerXpoint?eki(this.centerXpoint,this.availableSize.width):this.gaugeRect.x+this.gaugeRect.width/2,!s&&!a||je(this.legendModule)||(c="Top"===this.legendSettings.position||"Bottom"===this.legendSettings.position?this.availableSize.width/2:"Right"===this.legendSettings.position?this.gaugeRect.width/2+this.margin.right:c),u=s||a?s?.75*this.gaugeRect.height+this.gaugeRect.y-y:.25*this.gaugeRect.height+this.gaugeRect.y:this.gaugeRect.y+this.gaugeRect.height/2,u=l||!s&&!a?u:this.gaugeRect.height/2+this.gaugeRect.y+.75*h*.5,!je(this.axes)&&1<this.axes.length&&!je(this.midPoint)&&(p=a||p,d=s||d)&&p&&(u=this.availableSize.height/2-y)),this.midPoint=new uki(c,u)},rBi.prototype.calculateBounds=function(){var e=this.margin,t=0,i=(this.title&&(t=BMi(this.title,this.titleStyle).height+5),e.top+t+this.border.width),n=e.left+this.border.width,o=!1,r=!1,s=this.availableSize.width-n-e.right-this.border.width,a=this.availableSize.height-i-this.border.width-e.bottom,l=Math.min(s,a)/2;if(this.centerXpoint=""===this.centerX?null:this.centerX,this.centerYpoint=""===this.centerY?null:this.centerY,this.moveToCenter&&1===this.axes.length&&je(this.centerXpoint)&&je(this.centerYpoint),this.allowMargin)this.radiusAndCenterCalculation(i,n,s,a,l,t,!1,!1,null,null,!1,!1);else for(var h=0;h<this.axes.length;h++){var d=270<=this.axes[h].startAngle&&this.axes[h].startAngle<=360&&0<=this.axes[h].endAngle&&this.axes[h].endAngle<=90,p=this.axes[h].startAngle<=90&&this.axes[h].startAngle<=180&&180<=this.axes[h].endAngle&&270<=this.axes[h].endAngle&&0!==this.axes[h].startAngle&&360!==this.axes[h].endAngle,o=d||o,r=p||r,c=null===this.axes[h].radius||100<=parseInt(this.axes[0].radius.split("%")[0],10),u=null!==this.axes[h].radius?l*(parseInt(this.axes[0].radius.split("%")[0],10)/100):l;this.radiusAndCenterCalculation(i,n,s,a,l,t,d,p,c,u,o,r)}this.gaugeAxisLayoutPanel.measureAxis(this.gaugeRect)},rBi.prototype.renderElements=function(e){void 0===e&&(e=!0),this.renderBorder(),this.renderTitle(),this.gaugeAxisLayoutPanel.renderAxes(e),this.renderLegend(),this.element.appendChild(this.svgObject),this.trigger("loaded",{gauge:this}),ZMi("gauge-measuretext")},rBi.prototype.renderAnimation=function(){if(this.allowLoadingAnimation)for(var e=0;e<this.axes.length;e++)this.gaugeAxisLayoutPanel.axisLineAnimation(e,this.loadingAnimationDuration[e],this)},rBi.prototype.renderLegend=function(){if(!this.legendModule||!this.legendSettings.visible)return null;this.legendModule.legendCollection.length&&this.legendModule.renderLegend(this.legendSettings,this.legendModule.legendBounds)},rBi.prototype.renderTitle=function(){var e,t,i;this.title&&(t=(e={color:this.titleStyle.color,size:this.titleStyle.size||this.themeStyle.titleFontSize,fontFamily:this.titleStyle.fontFamily||this.themeStyle.fontFamily,fontStyle:this.titleStyle.fontStyle,fontWeight:this.titleStyle.fontWeight||this.themeStyle.titleFontWeight,opacity:this.titleStyle.opacity}).size,isNaN(Number(t))||(e.size=t+"px"),i=BMi(t=vPi(Math.abs(this.margin.left+this.margin.right-this.availableSize.width),this.title,e),e),(i=RMi(new mki(this.element.id+"_CircularGaugeTitle",this.availableSize.width/2,this.margin.top+i.height/4*3,"middle",t),e,e.color||this.themeStyle.titleFontColor,this.svgObject,"")).setAttribute("aria-label",this.description||this.title),i.setAttribute("role","region"),i.setAttribute("tabindex",this.tabIndex.toString()))},rBi.prototype.renderBorder=function(){var e=this.border.width;(0<e||this.background||this.themeStyle.backgroundColor)&&this.svgObject.appendChild(this.renderer.drawRectangle(new hki(this.element.id+"_CircularGaugeBorder",this.background||this.themeStyle.backgroundColor,this.border,null,new gki(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e))))},rBi.prototype.setPointerValue=function(t,e,i){var n,o=this,r=this.axes[t],s=r.pointers[e];s.currentRadius;this.allowLoadingAnimation=!1,this.isDestroyed||s.currentValue===i||(n=s.animation.enable||"Enable"===Ut,i=(i=i<r.visibleRange.min?r.visibleRange.min:i)>r.visibleRange.max?r.visibleRange.max:i,s.isPointerAnimation=!0,document.getElementById(this.element.id+"_Axis_"+t+"_Pointer_"+e).style.visibility="visible",je(s.pathElement)||s.pathElement.map(function(e){"RangeBar"===s.type?(bki(e,s.color,s.border),n?o.gaugeAxisLayoutPanel.pointerRenderer.performRangeBarAnimation(e,s.currentValue,i,r,s,t):(o.isAnimationProgress=!1,o.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(r,s,i))):(0<=e.id.indexOf("_Pointer_NeedleCap_")?bki(e,s.cap.color,s.cap.border):0<=e.id.indexOf("_Pointer_NeedleTail_")?bki(e,s.needleTail.color,s.needleTail.border):0<=e.id.indexOf("_Pointer_NeedleRect_")?bki(e,"transparent",{color:"transparent",width:0}):"Marker"===s.type&&"Text"!==s.markerShape&&bki(e,s.color,s.border),n?"Marker"===s.type&&"Text"===s.markerShape?o.gaugeAxisLayoutPanel.pointerRenderer.performTextAnimation(e,s.currentValue,i,r,s,t):o.gaugeAxisLayoutPanel.pointerRenderer.performNeedleAnimation(e,s.currentValue,i,r,s,t):o.gaugeAxisLayoutPanel.pointerRenderer.setPointerValue(r,s,i))}),this.allowLoadingAnimation&&!s.animation.enable&&(this.allowLoadingAnimation=!1,s.value=i)),this.isProtectedOnChange=!0,s.previousValue=s.currentValue,s.currentValue=i,s.value=i,this.isProtectedOnChange=!1},rBi.prototype.setAnnotationValue=function(e,t,i){var n,o,r;this.isDestroyed||(this.allowLoadingAnimation=!1,n=null!==$Mi(this.element.id+"_Annotations_"+e),o=$Mi(this.element.id+"_Annotations_"+e)||Q("div",{id:this.element.id+"_Annotations_"+e,styles:0<this.animationDuration?"opacity: 0":"opacity: 1"}),r=this.axes[e].annotations[t],null!==i&&(ZMi(this.element.id+"_Axis_"+e+"_Annotation_"+t),r.content=i,this.annotationsModule.createTemplate(o,t,e,this),r=$Mi(this.element.id+"_Secondary_Element"),n||je(r)||r.appendChild(o)))},rBi.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},rBi.prototype.export=function(i,n,o,r){var s=this;return je(r)&&(r=!0),"PDF"===i&&this.allowPdfExport&&this.pdfExportModule?new Promise(function(e,t){e(s.pdfExportModule.export(s,i,n,o,r))}):this.allowImageExport&&"PDF"!==i&&this.imageExportModule?new Promise(function(e,t){e(s.imageExportModule.export(s,i,n,r))}):null},rBi.prototype.setMouseXY=function(e){var t,i,n=$Mi(this.element.id+"_svg").getBoundingClientRect(),o=this.element.getBoundingClientRect();-1<e.type.indexOf("touch")?(this.isTouch=!0,t=e.changedTouches[0].clientY,i=e.changedTouches[0].clientX):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType,i=e.clientX,t=e.clientY),this.mouseY=t-o.top-Math.max(n.top-o.top,0),this.mouseX=i-o.left-Math.max(n.left-o.left,0)},rBi.prototype.setRangeValue=function(e,t,i,n){this.allowLoadingAnimation=!1;var o=$Mi(this.element.id+"_Axis_"+e+"_Range_"+t),e=this.axes[e],t=e.ranges[t],r=e.visibleRange,s="ClockWise"===e.direction,a=Math.min(Math.max(i,r.min),n),l=Math.min(Math.max(i,n),r.max),h=t.start,d=t.end,i=(t.start=i,t.end=n,t.start!==t.end&&h===d&&this.legendModule&&this.legendSettings.visible&&(this.legendModule.getLegendOptions(this.axes),i=this.legendModule.legendBounds.height+this.legendSettings.margin.top+this.legendSettings.margin.bottom+this.legendSettings.border.width,n=this.legendModule.legendBounds.width+this.legendSettings.margin.left+this.legendSettings.margin.right+this.legendSettings.border.width,h=this.gaugeRect,"Bottom"===(d=this.legendModule.position)&&(h.height=h.height+i),"Top"===d&&(h.height=h.height+i,h.y=h.y-i),"Left"===d&&(h.width=h.width+n,h.x=h.x-n),"Right"===d&&(h.width=h.width+n),this.legendModule.calculateLegendBounds(h,this.availableSize),this.legendModule.legendCollection.length)&&this.legendModule.renderLegend(this.legendSettings,this.legendModule.legendBounds),this.isRangeUpdate=!0,_Mi(a,r.max,r.min,e.startAngle,e.endAngle,s)),d=_Mi(l,r.max,r.min,e.startAngle,e.endAngle,s),n=!je(t.startWidth)&&0<t.startWidth.length?FMi(t.startWidth,t.currentRadius):t.startWidth,h=!je(t.endWidth)&&0<t.endWidth.length?FMi(t.endWidth,t.currentRadius):t.endWidth,d=s?d:[i,i=d][0];h=s?h:[n,n=h][0],o.setAttribute("d",jMi(this.midPoint,Math.round(i),Math.round(d),t.currentRadius,n,h,t,e)),bki(o,t.color||t.rangeColor,{color:t.color||t.rangeColor,width:0})},rBi.prototype.destroy=function(){je(this.element)||this.unWireEvents(),je(this.tooltipModule)||this.tooltipModule.removeEventListener(),nBi.prototype.destroy.call(this),je(this.gaugeAxisLayoutPanel)||this.gaugeAxisLayoutPanel.destroy(),this.availableSize=null,this.midPoint=null,this.activePointer=null,this.activeAxis=null,this.activeRange=null,this.gaugeRect=null,this.gaugeAxisLayoutPanel=null,this.themeStyle=null,this.loadingAnimationDuration=null,this.intl=null,this.removeSvg(),this.resizeEvent=null,this.svgObject=null,this.renderer=null},rBi.prototype.requiredModules=function(){var e=[],t=!1;return this.axes.map(function(e){e.annotations.map(function(e){t=t||!je(e.content)&&0!==e.content.length||"function"==typeof e.content})}),t&&e.push({member:"Annotations",args:[this,gPi],name:"Annotations"}),this.tooltip.enable&&e.push({member:"Tooltip",args:[this,SPi],name:"Tooltip"}),this.allowPrint&&e.push({member:"Print",args:[this,WPi],name:"Print"}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,zPi],name:"ImageExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,_Pi],name:"PdfExport"}),this.legendSettings.visible&&e.push({member:"Legend",args:[this,RPi],name:"Legend"}),e.push({member:"Gradient",args:[this,eBi],name:"Gradient"}),e},rBi.prototype.getPersistData=function(){return this.addOnPersist([])},rBi.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){for(var i=!(this.isPropertyChange=!0),n=(this.allowLoadingAnimation=0<this.animationDuration&&!this.isOverAllAnimationComplete,!1),o=!1,r=1===Object.keys(e).length&&e instanceof Object&&!je(this.activePointer),s=0,a=Object.keys(e);s<a.length;s++)switch(a[s]){case"height":case"width":case"centerX":case"centerY":case"margin":this.createSvg(),n=!0;break;case"animationDuration":this.allowLoadingAnimation=!0;break;case"title":n=""===e.title||""===t.title,i=!(""===e.title||""===t.title);break;case"titleStyle":e.titleStyle&&e.titleStyle.size?n=!0:i=!0;break;case"border":case"background":i=!0;break;case"legendSettings":o=!0;break;case"axes":for(var l=this.axes.length,h=0;h<l;h++)if(!je(e.axes[h]))for(var d=0,p=Object.keys(e.axes[h]);d<p.length;d++)if("pointers"===p[d])for(var c=Object.keys(e.axes[h].pointers).length,u=0;u<c;u++){var g=parseInt(Object.keys(e.axes[h].pointers)[u],10);je(Object.keys(e.axes[h].pointers[g]))||(this.allowLoadingAnimation=!1,this.loadingAnimationDuration=[],this.isAnimationProgress=this.axes[h].pointers[g].animation.enable,this.axes[h].pointers[g].previousValue=this.axes[h].pointers[g].currentValue,this.axes[h].pointers[g].isPointerAnimation=-1<Object.keys(e.axes[h].pointers[g]).indexOf("value"))}o=!0}r||this.isRangeUpdate||(!n&&i&&(this.removeSvg(),this.renderElements()),(n||this.allowLoadingAnimation)&&(this.removeSvg(),this.calculateBounds(),this.renderElements(),this.allowLoadingAnimation)&&(this.allowLoadingAnimation=0<this.animationDuration&&!this.isOverAllAnimationComplete,this.renderAnimation()),!o)||i||n||this.allowLoadingAnimation||(this.removeSvg(),this.calculateBounds(),this.renderElements(!1)),this.isRangeUpdate=!1}},rBi.prototype.getModuleName=function(){return"circulargauge"},P$e([e(null)],rBi.prototype,"width",void 0),P$e([e(null)],rBi.prototype,"height",void 0),P$e([t({color:"transparent",width:0},gRe)],rBi.prototype,"border",void 0),P$e([e(null)],rBi.prototype,"background",void 0),P$e([e("")],rBi.prototype,"title",void 0),P$e([e(0)],rBi.prototype,"animationDuration",void 0),P$e([t({size:null,color:null,fontWeight:null,fontFamily:null},$V)],rBi.prototype,"titleStyle",void 0),P$e([t({},q6)],rBi.prototype,"margin",void 0),P$e([kt([{}],tte)],rBi.prototype,"axes",void 0),P$e([t({},X6)],rBi.prototype,"tooltip",void 0),P$e([e(!1)],rBi.prototype,"enablePointerDrag",void 0),P$e([e(!1)],rBi.prototype,"enableRangeDrag",void 0),P$e([e(!1)],rBi.prototype,"allowPrint",void 0),P$e([e(!1)],rBi.prototype,"allowImageExport",void 0),P$e([e(!1)],rBi.prototype,"allowPdfExport",void 0),P$e([e(!0)],rBi.prototype,"allowRangePreRender",void 0),P$e([e(null)],rBi.prototype,"centerX",void 0),P$e([e(null)],rBi.prototype,"centerY",void 0),P$e([e(!1)],rBi.prototype,"moveToCenter",void 0),P$e([e("Material")],rBi.prototype,"theme",void 0),P$e([e(!1)],rBi.prototype,"useGroupingSeparator",void 0),P$e([e(null)],rBi.prototype,"description",void 0),P$e([e(0)],rBi.prototype,"tabIndex",void 0),P$e([e(!0)],rBi.prototype,"allowMargin",void 0),P$e([t({},o7)],rBi.prototype,"legendSettings",void 0),P$e([i()],rBi.prototype,"loaded",void 0),P$e([i()],rBi.prototype,"load",void 0),P$e([i()],rBi.prototype,"animationComplete",void 0),P$e([i()],rBi.prototype,"axisLabelRender",void 0),P$e([i()],rBi.prototype,"radiusCalculate",void 0),P$e([i()],rBi.prototype,"annotationRender",void 0),P$e([i()],rBi.prototype,"legendRender",void 0),P$e([i()],rBi.prototype,"tooltipRender",void 0),P$e([i()],rBi.prototype,"dragStart",void 0),P$e([i()],rBi.prototype,"dragMove",void 0),P$e([i()],rBi.prototype,"dragEnd",void 0),P$e([i()],rBi.prototype,"gaugeMouseMove",void 0),P$e([i()],rBi.prototype,"gaugeMouseLeave",void 0),P$e([i()],rBi.prototype,"gaugeMouseDown",void 0),P$e([i()],rBi.prototype,"gaugeMouseUp",void 0),P$e([i()],rBi.prototype,"resized",void 0),P$e([i()],rBi.prototype,"beforePrint",void 0),oBi=P$e([Bt],rBi));function rBi(e,t){e=nBi.call(this,e,t)||this;return e.allowLoadingAnimation=!1,e.isRangeUpdate=!1,e.isAnimationProgress=!0,e.isResize=!1,e.isOverAllAnimationComplete=!1,e.isDrag=!1,e.gradientCount=0,oBi.Inject(eBi),t&&e.appendTo(t),e}H$e.Inject(SPi,gPi,RPi,WPi,_Pi,zPi,eBi);var sBi,aBi,lBi,hBi,dBi,tn=Object.freeze({__proto__:null,CircularGauge:H$e,Annotations:gPi,Line:o,Label:Rmt,Range:Vee,Tick:est,Cap:h0,NeedleTail:x_,Animation:l,Annotation:k_,Pointer:wce,Axis:tte,Border:gRe,Font:$V,RangeTooltip:HH,AnnotationTooltip:Oz,Margin:q6,TooltipSettings:X6,Location:t7,LegendSettings:o7,GaugeTooltip:SPi,measureText:BMi,toPixel:FMi,getFontStyle:LMi,textElement:RMi,appendPath:OMi,isCompleteAngle:NMi,getDegree:VMi,getAngleFromValue:_Mi,getAngleFromLocation:HMi,getLocationFromAngle:zMi,getPathArc:jMi,arcPath:WMi,arcRoundedPath:QMi,arcWidthPath:UMi,getRangePath:qMi,arcWidthPathCalculation:GMi,roundedArcWidthPathCalculation:YMi,getRoundedPathArc:XMi,getCirclePath:KMi,getTemplateFunction:JMi,removeElement:ZMi,getElement:$Mi,stringToNumber:eki,getPointer:tki,getLabelFormat:iki,calculateShapes:nki,CustomizeOption:oki,PathOption:ski,RectOption:hki,Size:cki,GaugeLocation:uki,Rect:gki,TextOption:mki,VisibleLabels:vki,getRangeColor:IPi,calculateSum:xPi,setStyles:bki,getValueFromAngle:wki,getRange:Cki,textTrim:vPi,showTooltip:bPi,titleTooltip:wPi,removeTooltip:CPi,linear:DPi,getCompleteArc:MPi,getCompletePath:kPi,getMousePosition:fPi,getElementSize:yPi,Legend:RPi,Index:NPi,LegendOptions:VPi,ImageExport:zPi,PdfExport:_Pi,Print:WPi,ColorStop:HOt,GradientPosition:PNt,LinearGradient:Det,RadialGradient:set,Gradient:eBi}),WOt=(twe.Inject(Ewe,OCe,Fwe,wSe,DSe,Cwe,zwe,C1e,vCe,SCe,gCe,LCe,TCe,kCe,Uwe,aCe,HCe,fSe,FAe,bAe,pwe,Ube,mwe,JAe,NAe,UAe,IAe,n1e,ZCe,iSe,YCe,sSe,QCe,gSe,Xwe,$we,nCe,Awe,jSe,VSe,qSe,dSe,KSe,oAe,eAe,lAe,cAe,a1e,xSe,GAe,yAe,bwe,m1e,p1e,y1e,I1e,M1e,_Ae,WAe),oxe.Inject(exe,pxe,mxe,Exe,bxe,F1e,Afe,Axe,$Ae,M1e),bIe.Inject(LTe,mIe,zwe,vCe,Ube,mwe,M1e,bwe),nke.Inject(cPe),oMe.Inject(ZMe,KMe),BTe.Inject(Ewe,Fwe,wSe,DSe,Cwe,zwe,sSe,FAe,bAe,Ube,NAe,UAe,IAe,n1e,ZCe,iSe,Xwe,Awe,jSe,VSe,qSe,dSe,KSe,oAe,eAe,lAe,cAe,yAe,LTe,M1e,MIe,bwe),WTe.Inject(uEe,yEe),tFe.Inject(AFe,IFe,MFe,EFe,hFe,uFe,yFe,CFe,hBe,MAe,PFe,RFe,zFe,_Fe),XLe.Inject(oLe,Gve,RLe,tRe,UFe,rRe,JLe),Object.freeze({__proto__:null,RangeColorSetting:qbe,CrosshairSettings:Xbe,ZoomSettings:Zbe,Chart:twe,Row:Zfe,Column:tye,MajorGridLines:oye,MinorGridLines:aye,AxisLine:dye,MajorTickLines:uye,MinorTickLines:fye,CrosshairTooltip:bye,Axis:Sye,VisibleLabels:Iye,Double:Fme,DateTime:Ube,Category:pwe,Logarithmic:mwe,DateTimeCategory:bwe,NiceInterval:Vbe,StripLine:Cwe,Connector:Lue,Location:yge,Accessibility:wge,SeriesAccessibility:Age,Font:Tge,StackLabelsFont:Mge,CenterLabel:Bge,Border:Rge,Offset:Vge,Margin:zge,Animation:Qge,TooltipSettings:Gge,EmptyPointSettings:Kge,Indexes:$ge,CornerRadius:ime,ContainerPadding:rme,titleBorder:lme,titleSettings:pme,TitleStyleSettings:gme,ChartArea:yme,DragSettings:wme,Periods:Ame,PeriodSelectorSettings:Tme,StockTooltipSettings:Rue,Index:kme,LineSeries:Ewe,ColumnSeries:Fwe,AreaSeries:zwe,BarSeries:Uwe,PolarSeries:$we,RadarSeries:nCe,StackingBarSeries:aCe,CandleSeries:Xwe,StackingColumnSeries:gCe,StepLineSeries:vCe,StepAreaSeries:SCe,StackingAreaSeries:TCe,StackingStepAreaSeries:kCe,StackingLineSeries:LCe,ScatterSeries:OCe,RangeColumnSeries:HCe,RangeStepAreaSeries:QCe,WaterfallSeries:YCe,HiloSeries:ZCe,HiloOpenCloseSeries:iSe,RangeAreaSeries:sSe,SplineRangeAreaSeries:gSe,BubbleSeries:fSe,SplineSeries:wSe,HistogramSeries:xSe,SplineAreaSeries:DSe,TechnicalIndicator:_be,SmaIndicator:Awe,EmaIndicator:VSe,TmaIndicator:jSe,AccumulationDistributionIndicator:qSe,AtrIndicator:KSe,MomentumIndicator:eAe,RsiIndicator:oAe,StochasticIndicator:lAe,BollingerBands:cAe,MacdIndicator:dSe,Trendlines:yAe,sort:Tye,isBreakLabel:Eye,getVisiblePoints:Dye,calculateScrollbarOffset:Mye,rotateTextSize:kye,removeElement:Pye,logBase:Bye,showTooltip:Fye,inside:Lye,withIn:Rye,logWithIn:Oye,withInRange:Nye,sum:Vye,subArraySum:_ye,subtractThickness:Hye,subtractRect:zye,degreeToLocation:jye,degreeToRadian:Wye,getRotatedRectangleCoordinates:Qye,isRotatedRectIntersect:Uye,getAngle:qye,subArray:Gye,valueToCoefficient:Yye,TransformToVisible:Xye,indexFinder:Kye,CoefficientToVector:Jye,valueToPolarCoefficient:Zye,Mean:$ye,PolarArc:e0e,createTooltip:t0e,createZoomingLabels:i0e,findCrosshairDirection:n0e,withInBounds:o0e,getValueXByPoint:r0e,getValueYByPoint:s0e,findClipRect:a0e,firstToLowerCase:l0e,getTransform:h0e,getMinPointsDelta:d0e,getAnimationFunction:p0e,linear:c0e,markerAnimate:u0e,animateRectElement:g0e,pathAnimation:m0e,animateAddPoints:f0e,appendClipElement:y0e,triggerLabelRender:v0e,setRange:b0e,isZoomSet:w0e,getActualDesiredIntervalsCount:C0e,templateAnimate:S0e,drawSymbol:A0e,calculateShapes:x0e,getRectLocation:I0e,minMax:T0e,getElement:ie,getTemplateFunction:E0e,accReactTemplate:D0e,chartReactTemplate:M0e,createTemplate:k0e,getFontStyle:P0e,measureElementRect:B0e,findlElement:F0e,getPoint:L0e,appendElement:R0e,appendChildElement:O0e,getDraggedRectLocation:N0e,checkBounds:V0e,getLabelText:_0e,stopTimer:H0e,isCollide:z0e,isOverlap:j0e,containsRect:W0e,calculateRect:Q0e,convertToHexCode:U0e,componentToHex:q0e,convertHexToColor:G0e,colorNameToHex:Y0e,checkColorFormat:X0e,getSaturationColor:K0e,applyZLight:J0e,getMedian:Z0e,calculateLegendShapes:$0e,textTrim:eve,lineBreakLabelTrim:tve,stringToNumber:ive,redrawElement:nve,animateRedrawElement:ove,animateTextElement:rve,textElement:sve,calculateSize:ave,createSvg:lve,getTitle:hve,titlePositionX:dve,textWrap:pve,textWrapAnyWhere:cve,getUnicodeText:uve,blazorTemplatesReset:gve,CustomizeOption:mve,StackValues:yve,RectOption:vve,ImageOption:Cve,CircleOption:Sve,PolygonOption:Ive,ChartLocation:Tve,LabelLocation:xve,Thickness:Eve,ColorValue:Dve,PointData:Mve,AccPointData:kve,Point3D:Pve,ControlPoints:Bve,getColorByValue:Fve,getGradientColor:Lve,getPercentageColor:Rve,getPercentage:Ove,getTextAnchor:Nve,Crosshair:bAe,Tooltip:FAe,Zoom:NAe,Selection:IAe,DataEditing:_Ae,Highlight:WAe,DataLabel:UAe,ErrorBar:GAe,DataLabelSettings:Yve,MarkerSettings:Jve,ParetoOptions:ebe,Points:nbe,Trendline:obe,ErrorBarCapSettings:abe,ChartSegment:dbe,ErrorBarSettings:ube,SeriesBase:fbe,Series:bbe,Legend:JAe,ChartAnnotation:n1e,ChartAnnotationSettings:xfe,LabelBorder:Efe,MultiLevelCategories:kfe,StripLineSettings:Ffe,MultiLevelLabels:Ofe,ScrollbarSettingsRange:_fe,ScrollbarSettings:jfe,ToolbarPosition:Ufe,StackLabelSettings:bce,BoxAndWhiskerSeries:a1e,MultiColoredAreaSeries:p1e,MultiColoredLineSeries:m1e,MultiColoredSeries:Nwe,MultiLevelLabel:y1e,ScrollBar:C1e,ParetoSeries:I1e,Export:M1e,AccumulationChart:oxe,AccumulationAnnotationSettings:L1e,AccumulationDataLabelSettings:N1e,PieCenter:H1e,AccPoints:W1e,AccumulationSeries:Mwe,getSeriesFromIndex:U1e,pointByIndex:q1e,PieSeries:exe,FunnelSeries:pxe,PyramidSeries:mxe,AccumulationLegend:bxe,AccumulationDataLabel:Axe,AccumulationTooltip:Exe,AccumulationSelection:F1e,AccumulationHighlight:Afe,AccumulationAnnotation:$Ae,StockChart:BTe,StockChartFont:kIe,StockChartBorder:FIe,StockChartArea:OIe,StockMargin:_Ie,StockChartStripLineSettings:jIe,StockEmptyPointSettings:UIe,StockChartConnector:YIe,StockSeries:JIe,StockChartIndicator:eTe,StockChartAxis:nTe,StockChartRow:sTe,StockChartTrendline:hTe,StockChartAnnotationSettings:cTe,StockChartIndexes:mTe,StockEventsSettings:tIe,StockChartLegendSettings:ITe,StockLegend:MIe,loaded:"loaded",legendClick:Nme,load:Vme,animationComplete:_me,legendRender:Hme,textRender:zme,pointRender:jme,sharedTooltipRender:Wme,seriesRender:Qme,axisLabelRender:Ume,axisLabelClick:qme,axisRangeCalculated:Gme,axisMultiLabelRender:Yme,tooltipRender:Xme,chartMouseMove:Kme,chartMouseClick:Jme,chartDoubleClick:Zme,pointClick:$me,pointDoubleClick:efe,pointMove:tfe,chartMouseLeave:ife,chartMouseDown:nfe,chartMouseUp:ofe,zoomComplete:rfe,dragComplete:sfe,selectionComplete:afe,resized:lfe,beforeResize:hfe,beforePrint:dfe,annotationRender:pfe,scrollStart:cfe,scrollEnd:ufe,scrollChanged:gfe,stockEventRender:mfe,multiLevelLabelClick:ffe,dragStart:"dragStart",drag:"drag",dragEnd:"dragEnd",regSub:yfe,regSup:vfe,beforeExport:bfe,afterExport:wfe,bulletChartMouseClick:Cfe,onZooming:Sfe,stockEventFont:Jfe,getSeriesColor:Vve,getThemeColor:_ve,getScrollbarThemeColor:Hve,PeriodSelector:mIe,RangeNavigator:bIe,rangeValueToCoefficient:Vxe,getXLocation:_xe,getRangeValueXByPoint:Hxe,getExactData:zxe,getNearestValue:jxe,DataPoint:Wxe,getRangeThemeColor:gIe,RangeNavigatorAxis:Kxe,RangeSeries:qxe,RangeSlider:cIe,RangeNavigatorSeries:iIe,ThumbSettings:rIe,StyleSettings:lIe,RangeTooltipSettings:eIe,RangeTooltip:LTe,BulletChart:WTe,Range:QTe,MajorTickLinesSettings:GTe,MinorTickLinesSettings:KTe,BulletLabelStyle:$Te,BulletTooltipSettings:iEe,BulletDataLabel:rEe,BulletChartLegendSettings:jTe,getBulletThemeColor:hEe,BulletTooltip:uEe,BulletChartLegend:yEe,Smithchart:oMe,SmithchartMajorGridLines:_De,SmithchartMinorGridLines:jDe,SmithchartAxisLine:UDe,SmithchartAxis:bDe,LegendTitle:wDe,LegendLocation:ADe,LegendItemStyleBorder:TDe,LegendItemStyle:MDe,LegendBorder:BDe,SmithchartLegendSettings:CEe,SeriesTooltipBorder:rMe,SeriesTooltip:lMe,SeriesMarkerBorder:pMe,SeriesMarkerDataLabelBorder:gMe,SeriesMarkerDataLabelConnectorLine:yMe,SeriesMarkerDataLabel:wMe,SeriesMarker:AMe,SmithchartSeries:JDe,TooltipRender:KMe,Subtitle:ZDe,Title:VDe,SmithchartFont:AEe,SmithchartMargin:TEe,SmithchartBorder:SEe,SmithchartRect:FEe,LabelCollection:kEe,LegendSeries:PEe,LabelRegion:LEe,HorizontalLabelCollection:REe,RadialLabelCollections:VEe,LineSegment:zEe,PointRegion:jEe,Point:WEe,ClosestPoint:QEe,MarkerOptions:UEe,SmithchartLabelPosition:qEe,Direction:GEe,DataLabelTextOptions:YEe,LabelOption:XEe,SmithchartSize:KEe,GridArcPoints:JEe,smithchartBeforePrint:QMe,SmithchartLegend:ZMe,Sparkline:nke,SparklineTooltip:cPe,SparklineBorder:oke,SparklineFont:ake,TrackLineSettings:dke,SparklineTooltipSettings:uke,ContainerArea:fke,LineSettings:bke,RangeBandSettings:Ske,AxisSettings:Ike,Padding:Dke,SparklineMarkerSettings:Pke,LabelOffset:Lke,SparklineDataLabelSettings:ike,Chart3D:tFe,Chart3DRender:kPe,Vector3D:BPe,Matrix3D:LPe,ChartTransform3D:OPe,Graphics3D:VPe,BinaryTreeBuilder:HPe,Svg3DRenderer:jPe,Polygon3D:QPe,getMinPointsDeltaValue:JPe,valueToCoefficients:ZPe,WallRenderer:$Pe,AxisRenderer:tBe,Chart3DRow:dBe,Chart3DColumn:uBe,Chart3DMajorGridLines:fBe,Chart3DMinorGridLines:bBe,Chart3DMajorTickLines:SBe,Chart3DMinorTickLines:IBe,Chart3DAxis:yPe,Visible3DLabels:MBe,NiceIntervals:rFe,CartesianAxisLayoutPanel:IPe,Category3D:hFe,DateTime3D:uFe,DateTimeCategory3D:yFe,Double3D:rBe,Logarithmic3D:CFe,Chart3DDataLabelSettings:FBe,Chart3DEmptyPointSettings:OBe,Chart3DPoint:_Be,Chart3DSeries:HBe,ColumnSeries3D:AFe,StackingColumnSeries3D:IFe,StackingBarSeries3D:EFe,BarSeries3D:MFe,DataLabel3D:PFe,Chart3DLegendSettings:XBe,Legend3D:MAe,Chart3DTooltipSettings:BBe,Tooltip3D:hBe,Selection3D:RFe,Highlight3D:_Fe,Export3D:zFe,Chart3DTextFont:vPe,TitleBorder:CPe,TitleSettings:fPe,get3DThemeColor:EPe,get3DSeriesColor:DPe,CircularChart3D:XLe,CircularChart3DLegendSettings:OLe,CircularChartLegend3D:RLe,CircularChartExport3D:JLe,CircularChart3DPoints:sLe,CircularChart3DEmptyPointSettings:aLe,CircularChart3DSeries:rLe,PieSeries3D:oLe,CircularChart3DDataLabelFont:GFe,CircularChart3DConnector:KFe,CircularChart3DDataLabelSettings:qFe,CircularChartDataLabel3D:UFe,CircularChartSelection3D:tRe,CircularChartHighlight3D:rRe,CircularChart3DPointData:WLe,CircularChart3DTooltipSettings:jLe,CircularChartTooltip3D:Gve})),dNt=(V7.Inject(bQ),o9.Inject(bQ,Yq),wq.Inject(Yq),jq.Inject(bQ,Yq),Object.freeze({__proto__:null,CalendarBase:R7,Calendar:V7,Islamic:bQ,DatePicker:o9,Presets:X9,DateRangePicker:Z9,get TimePickerBase(){return tq},TimeMaskPlaceholder:yq,TimePicker:wq,DateTimePicker:jq,MaskedDateTime:Yq})),uNt=Object.freeze({__proto__:null,wrapperInitialize:Tv,getTextNode:Ev,destroy:Dv,preRender:Mv,createCheckBox:kv,rippleMouseHandler:Pv,setHiddenInput:Bv,BeforeChangeEventArgs:Fv,get IconPosition(){return Rv},buttonObserver:o0,Button:zv,CheckBox:ib,RadioButton:cb,Switch:Ab,classNames:Db,ChipList:Nr,Chip:kb,get FabPosition(){return Bb},Fab:zb,get SpeedDialMode(){return Qb},get LinearDirection(){return Ub},get RadialDirection(){return qb},get SpeedDialAnimationEffect(){return Gb},SpeedDialAnimationSettings:Sr,RadialSettings:Zr,SpeedDialItem:Lr,SpeedDial:Xr,SmartPasteButton:s0}),fNt=Object.freeze({__proto__:null,get defaultCurrencyCode(){return oe},setDefaultCurrencyCode:he,setNumberFormat:de,setDateFormat:pe,blazorCultureFormats:Ae,get IntlBase(){return ce},Ajax:ze,Fetch:Qe,Animation:Vt,rippleEffect:Ht,get isRippleEnabled(){return Gt},enableRipple:Yt,get animationMode(){return Ut},setGlobalAnimation:function(e){Ut=e},get GlobalAnimationMode(){return qt},Base:Ct,getComponent:At,removeChildInstance:function(e){for(var t=[].slice.call(e.getElementsByClassName("e-control")),i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)].classList[1].split("e-")[1],n=At(t[parseInt(i.toString(),10)],n);ee(n)||n.destroy()}},get proxyToRaw(){return bt},setProxyToRaw:function(e){bt=e},Browser:F,get versionBasedStatePersistence(){return Xi},enableVersionBasedPersistence:function(e){Xi=e},Component:Ji,ChildProperty:n,Position:rn,Draggable:hn,Droppable:un,EventHandler:E,onIntlChange:Ci,get rightToLeft(){return Si},cldrData:Ai,get defaultCulture(){return xi},Internationalization:Ti,setCulture:Di,setCurrencyCode:function(e){he(e),Ci.notify("notifyExternalChange",{currencyCode:oe})},loadCldr:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var i=0,n=e;i<n.length;i++)Pe(Ai,n[i],{},!0)},enableRtl:function(e){Si=e=void 0===e?!0:e,Ci.notify("notifyExternalChange",{enableRtl:Si})},getNumericObject:Mi,getNumberDependable:ki,getDefaultDateObject:Pi,KeyboardEvents:bn,L10n:Cn,ModuleLoader:Xt,Property:e,Complex:t,ComplexFactory:Mt,Collection:kt,CollectionFactory:Pt,Event:i,NotifyPropertyChanges:Bt,CreateBuilder:function(t){function i(e){return this.element=e,this}return function(e){return Object.prototype.hasOwnProperty.call(i,"create")||((i.prototype=Lt(t)).create=function(){var e=Pe({},{},this.properties);return this.properties={},new t(e,this.element)}),new i(e)}},SwipeSettings:In,Touch:Mn,get HijriParser(){return Jt},blazorTemplates:io,getRandomId:no,compile:oo,updateBlazorTemplate:ro,resetBlazorTemplate:so,setTemplateEngine:function(e){ho.compile=e.compile},getTemplateEngine:function(){return ho.compile},initializeCSPTemplate:ao,disableBlazorMode:function(){N=!1},createInstance:y,setImmediate:v,getValue:R,setValue:x,deleteObject:b,containerObject:w,isObject:S,getEnumValue:M,merge:I,extend:Pe,isNullOrUndefined:je,isUndefined:ee,getUniqueID:D,debounce:P,queryParams:function(e){for(var t=[],i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];t.push(encodeURIComponent(o)+"="+encodeURIComponent(""+e[""+o]))}return t.join("&")},isObjectArray:B,compareElementParent:L,throwError:O,print:V,formatUnit:T,enableBlazorMode:function(){N=!0},isBlazor:_,getElement:H,getInstance:K,addInstance:function(e,t){(e="string"==typeof e?document.querySelector(e):e)[m]?e[m].push(t):e[m]=[t]},uniqueID:j,createElement:Q,updateCSSText:rt,addClass:U,removeClass:q,isVisible:at,prepend:lt,append:ht,detach:G,remove:ue,attributes:pt,select:ge,selectAll:ct,closest:z,siblings:function(e){for(var t=[],i=0,n=Array.prototype.slice.call(e.parentNode.childNodes);i<n.length;i++){var o=n[i];o.nodeType===Node.ELEMENT_NODE&&e!==o&&t.push(o)}return t},getAttributeOrDefault:function(e,t,i){var n=S(e),o=n?R("attributes."+t,e):e.getAttribute(t);return je(o)&&i&&(n?e.attributes[""+t]=i:e.setAttribute(t,i.toString()),o=i),o},setStyleAttribute:gt,classList:mt,matches:ft,includeInnerHTML:function(e,t){e.innerHTML=t},containsClass:function(e,t){return S(e)?new RegExp("\\b"+t+"\\b","i").test(e.attributes.className):e.classList.contains(t)},cloneNode:function(e,t){return S(e)?t?Pe({},{},e,!0):void 0:e.cloneNode(t)},Observer:yt,SanitizeHtmlHelper:go,componentList:Fi,registerLicense:_i,validateLicense:Hi,getVersion:function(){return Ni.version},createLicenseOverlay:zi}),pBi=(sBi=sBi||{},sBi[sBi.invalid=0]="invalid",aBi=aBi||{},aBi[aBi.All=2]="All",(bNt=lBi=lBi||{})[bNt.Auto=0]="Auto",bNt[bNt.Size10x10=1]="Size10x10",bNt[bNt.Size12x12=2]="Size12x12",bNt[bNt.Size14x14=3]="Size14x14",bNt[bNt.Size16x16=4]="Size16x16",bNt[bNt.Size18x18=5]="Size18x18",bNt[bNt.Size20x20=6]="Size20x20",bNt[bNt.Size22x22=7]="Size22x22",bNt[bNt.Size24x24=8]="Size24x24",bNt[bNt.Size26x26=9]="Size26x26",bNt[bNt.Size32x32=10]="Size32x32",bNt[bNt.Size36x36=11]="Size36x36",bNt[bNt.Size40x40=12]="Size40x40",bNt[bNt.Size44x44=13]="Size44x44",bNt[bNt.Size48x48=14]="Size48x48",bNt[bNt.Size52x52=15]="Size52x52",bNt[bNt.Size64x64=16]="Size64x64",bNt[bNt.Size72x72=17]="Size72x72",bNt[bNt.Size80x80=18]="Size80x80",bNt[bNt.Size88x88=19]="Size88x88",bNt[bNt.Size96x96=20]="Size96x96",bNt[bNt.Size104x104=21]="Size104x104",bNt[bNt.Size120x120=22]="Size120x120",bNt[bNt.Size132x132=23]="Size132x132",bNt[bNt.Size144x144=24]="Size144x144",bNt[bNt.Size8x18=25]="Size8x18",bNt[bNt.Size8x32=26]="Size8x32",bNt[bNt.Size12x26=27]="Size12x26",bNt[bNt.Size12x36=28]="Size12x36",bNt[bNt.Size16x36=29]="Size16x36",bNt[bNt.Size16x48=30]="Size16x48",(SNt=hBi=hBi||{})[SNt.Auto=0]="Auto",SNt[SNt.Version01=1]="Version01",SNt[SNt.Version02=2]="Version02",SNt[SNt.Version03=3]="Version03",SNt[SNt.Version04=4]="Version04",SNt[SNt.Version05=5]="Version05",SNt[SNt.Version06=6]="Version06",SNt[SNt.Version07=7]="Version07",SNt[SNt.Version08=8]="Version08",SNt[SNt.Version09=9]="Version09",SNt[SNt.Version10=10]="Version10",SNt[SNt.Version11=11]="Version11",SNt[SNt.Version12=12]="Version12",SNt[SNt.Version13=13]="Version13",SNt[SNt.Version14=14]="Version14",SNt[SNt.Version15=15]="Version15",SNt[SNt.Version16=16]="Version16",SNt[SNt.Version17=17]="Version17",SNt[SNt.Version18=18]="Version18",SNt[SNt.Version19=19]="Version19",SNt[SNt.Version20=20]="Version20",SNt[SNt.Version21=21]="Version21",SNt[SNt.Version22=22]="Version22",SNt[SNt.Version23=23]="Version23",SNt[SNt.Version24=24]="Version24",SNt[SNt.Version25=25]="Version25",SNt[SNt.Version26=26]="Version26",SNt[SNt.Version27=27]="Version27",SNt[SNt.Version28=28]="Version28",SNt[SNt.Version29=29]="Version29",SNt[SNt.Version30=30]="Version30",SNt[SNt.Version31=31]="Version31",SNt[SNt.Version32=32]="Version32",SNt[SNt.Version33=33]="Version33",SNt[SNt.Version34=34]="Version34",SNt[SNt.Version35=35]="Version35",SNt[SNt.Version36=36]="Version36",SNt[SNt.Version37=37]="Version37",SNt[SNt.Version38=38]="Version38",SNt[SNt.Version39=39]="Version39",SNt[SNt.Version40=40]="Version40",(INt=dBi=dBi||{})[INt.Low=7]="Low",INt[INt.Medium=15]="Medium",INt[INt.Quartile=25]="Quartile",INt[INt.High=30]="High",function(e,t){this.width=e,this.height=t});function cBi(e,t){e=Q(e);return t&&mBi(e,t),e}function uBi(e){var t,i=[];if("msie"===F.info.name||"edge"===F.info.name)for(var n=0;n<e.childNodes.length;n++)1===(t=e.childNodes[parseInt(n.toString(),10)]).nodeType&&i.push(t);else i=e.children;return i}function gBi(e){var t="barcodeMeasureElement";window[t].style.visibility="visible";var i=uBi(window[t].children[1])[0],e=(i.textContent=e.string,i.style.fontSize=e.stringSize+"px",i.style.fontFamily=e.fontStyle,i.style.fontWeight="",new pBi(0,0));return e.width=i.getBBox().width,e.height=i.getBBox().height,window[t].style.visibility="hidden",e}function mBi(i,n){for(var e=Object.keys(n),t=0;t<e.length;t++)e.forEach(function(e){var t=n[e];"style"===e&&"string"==typeof t?t.split(";").forEach(function(e){var e=e.split(":"),t=e[0],e=e[1];t&&e&&i.style.setProperty(t.trim(),e.trim())}):i.setAttribute(e,t)})}function fBi(e,t){e=document.createElementNS("http://www.w3.org/2000/svg",e);return mBi(e,t),e}function yBi(){var e,t,i,n="barcodeMeasureElement";window[n]?window[n].usageCount+=1:(e=cBi("div",{id:"barcodeMeasureElement",class:"barcodeMeasureElement",style:"visibility:hidden ; height: 0px ; width: 0px; overflow: hidden;"}),t=cBi("span",{style:"display:inline-block ; line-height: normal"}),e.appendChild(t),(t=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("xlink","http://www.w3.org/1999/xlink"),e.appendChild(t),(i=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),t.appendChild(i),window[n]=e,window[n].usageCount=1,document.body.appendChild(e))}bBi.getContext=function(e){return e.getContext("2d")},bBi.prototype.renderRootElement=function(e,t,i,n){var e=cBi("canvas",e),o=e.getContext("2d");return o.fillStyle=t,o.fillRect(0,0,i,n),e},bBi.prototype.renderRect=function(e,t){var i,n=e.getContext("2d");return t.imageSource?((i=new Image).src=t.imageSource,i.onload=function(){n.drawImage(i,t.x,t.y,t.width,t.height)}):(n.fillStyle=t.color,n.fillRect(t.x,t.y,t.width,t.height)),e},bBi.prototype.renderText=function(e,t){var i=e.getContext("2d");return i.save(),i.font=t.stringSize+"px "+t.fontStyle,i.fillStyle=t.color,i.fillText(t.string,t.x,t.y),e};var vBi=bBi;function bBi(){}CBi.prototype.renderRootElement=function(e,t){e=fBi("svg",e);return e.style.background=t,e},CBi.prototype.renderRect=function(e,t){var i;return t.imageSource?this.renderImage(e,t):((i=document.createElementNS("http://www.w3.org/2000/svg","rect")).setAttribute("x",t.x.toString()),i.setAttribute("y",t.y.toString()),i.setAttribute("width",t.width.toString()),i.setAttribute("height",t.height.toString()),i.setAttribute("fill",t.color),i.style.shapeRendering="crispEdges",e.appendChild(i),e)},CBi.prototype.renderText=function(e,t){var i=document.createElementNS("http://www.w3.org/2000/svg","text");return i.setAttribute("x",t.x.toString()),i.setAttribute("y",t.y.toString()),i.setAttribute("fill",t.color),i.style.fontSize=t.stringSize.toString()+"px",i.style.fontFamily=t.fontStyle,i.textContent=t.string,e.appendChild(i),e},CBi.prototype.renderImage=function(e,t){var i=document.createElementNS("http://www.w3.org/2000/svg","image");return i.setAttribute("x",t.x.toString()),i.setAttribute("y",t.y.toString()),i.setAttribute("width",t.width.toString()),i.setAttribute("height",t.height.toString()),i.setAttribute("href",t.imageSource),i.setAttribute("preserveAspectRatio","none"),e.appendChild(i),e};var wBi=CBi;function CBi(){}ABi.prototype.renderRootElement=function(e,t,i,n){return this.renderer.renderRootElement(e,t,i,n)},ABi.prototype.renderRectElement=function(e,t){return this.renderer.renderRect(e,t)},ABi.prototype.renderTextElement=function(e,t){return this.renderer.renderText(e,t)};var SBi=ABi;function ABi(e,t){this.renderer=null,this.isSvgMode=null,this.isSvgMode=t,this.renderer=new(t?wBi:vBi)}function xBi(){}var IBi=function(e,t,i,n){this.x=Number.MAX_VALUE,this.y=Number.MAX_VALUE,this.width=0,this.height=0,this.x=e,this.y=t,this.width=i,this.height=n};TBi=function(e,t){return(TBi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}TBi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(DBi,EBi=xBi),DBi.prototype.getInstance=function(e){e=document.getElementById(e);return new SBi(e.id,this.isSvgMode)},DBi.prototype.getDrawableSize=function(e,t,i){var n=(this.isSvgMode?e.bottom:1.5*e.bottom)+(this.isSvgMode?e.top:1.5*e.top),o=(this.isSvgMode?e.right:1.5*e.right)+(this.isSvgMode?e.left:1.5*e.left);return new IBi(e.left,e.top,t-o,i-n)},DBi.prototype.getBaseAttributes=function(e,t,i,n,o,r,s,a,l){e={width:e,height:t,x:i,y:n,color:o,string:r,stringSize:s,visibility:a,fontStyle:l};return this.isSvgMode||(e.height=e.height/1.5),r&&!this.isSvgMode&&(t=1.5*this.margin.bottom-this.margin.bottom,e.y+=t),e},DBi.prototype.getBarLineRatio=function(e,t){var i=this.type;if("Code39"===i||"Code32"===i||"Code39Extension"===i||"Code11"===i)return l=e.length*("Code39"===i||"Code32"===i||"Code39Extension"===i?6:3),t/(e.length*("Code39"===i||"Code32"===i||"Code39Extension"===i?3:2)*2+l+e.length-1);if("Code128A"===i||"Code128B"===i||"Code128C"===i||"Code128"===i)return t/((a=e[0].length)+e.length-1);if("Code93Extension"===i){for(var n=0,o=0;o<e.length;o++)for(var r=e[parseInt(o.toString(),10)],s=0;s<r.length;s++)n+=Number(r[parseInt(s.toString(),10)]);return t/n}for(var a=0,o=0;o<e.length;o++)a+=r=e[parseInt(o.toString(),10)].length;var l=void 0;return"Ean8"===i||"Ean13"===i||"UpcA"===i?l=2:"Code93"===i&&(l=1-e.length),t/(l?a+e.length-1+l:a+e.length-1)},DBi.prototype.multipleWidth=function(e,t,i){return"1"===e[parseInt(t.toString(),10)]&&"1"===e[t+1]?this.multipleWidth(e,t+1,i+1):i},DBi.prototype.barCodeType=function(e){return"Code39"===e||"UpcE"===e||"Code39Extension"===e?"twoBars":"UpcA"===e||"Ean13"===e||"Ean8"===e?"threeBars":"noBars"},DBi.prototype.checkStartValueCondition=function(e,t,i,n){return 1===e&&0===t&&"twoBars"===n&&"UpcE"!==this.type||(0===e&&t===i-1||2===e&&t===i-2)&&("Ean8"===this.type||"Ean13"===this.type)||"UpcE"===this.type&&2===e&&0===t||"UpcA"!==this.type&&"threeBars"===n&&2===e&&t===i-1||"UpcA"===this.type&&(1===e&&t===i-2||3===e&&t===i-2)||"noBars"===n&&0===e&&0===t},DBi.prototype.checkEndValueCondition=function(e,t,i,n,o,r){var s=this.type;return e===i&&t===n.length-2&&("Code39"===s||"Code39Extension"===s)||"Code11"===s&&t===n.length-1&&e===i-1||"Code93Extension"===s&&t===n.length-1&&e===i-1||"Ean8"===s&&(1===t&&e===i||t===n.length-2&&e===i)||"Ean13"===this.type&&(2===t&&1===e||t===n.length-2&&e===i)||"UpcA"===s&&(3===t&&0===e||5===t&&(o?e===r:1===e))||"UpcE"===s&&t===n.length-2&&1===e||"Code93"===s&&t===n.length-1&&e===i-1||"Code39"!==s&&"Code39Extension"!==s&&"Ean8"!==s&&"Ean13"!==s&&t===n.length-1&&e===i},DBi.prototype.getDisplayText=function(e,t){e="Ean8"===this.type?1===e?this.value.substring(0,4):this.value.substring(4,8):"Ean13"===this.type?2===e?this.value.substring(1,7):this.value.substring(7):"UpcA"===this.type?3===e?this.value.substring(0,6):this.value.substring(6,12):t.text||this.value;return e},DBi.prototype.checkExtraHeight=function(e,t,i){return!(0!==e&&e!==i.length-1||"Code39"!==t&&"Code39Extension"!==t)||!("Ean8"!==t&&"Ean13"!==t||0!==e&&2!==e&&e!==i.length-1)||"UpcA"===t&&(1===e||e===i.length-2||e===i.length-4)||"UpcE"===t&&(1===e||e===i.length-2||e===i.length-4)},DBi.prototype.getWidthValue=function(e,t,i){return"Code93Extension"!==this.type&&(t=!e||e%("Code32"===i?3:2)?1:2),t="Code93Extension"===this.type?!e||e%4?!e||e%2?!e||e%3?1:3:2:4:t},DBi.prototype.calculateBarCodeAttributes=function(e,t,i){var n,o=!1,r=this.getDrawableSize(this.margin,this.width,this.height);if(0<r.height&&0<r.width){for(var s=void 0,a=[],l=r.x,h=this.getBarLineRatio(e,r.width),h=this.isSvgMode?h:h/1.5,d=0,p=void 0,c=this.type,u=this.displayText.position,g=this.isSvgMode?1:1.5,m=void 0,f=void 0,y=void 0,v=void 0,b=0;b<e.length;b++)for(var w=e[parseInt(b.toString(),10)],C="UpcA"!==c&&"UpcE"!==c&&"Code11"!==c&&"Code93"!==c&&"Code93Extension"!==c,S=this.barCodeType(this.type),A=this.checkExtraHeight(b,c,e),x=w.length,o=!1,I=0;C?I<=x:I<x;I++){var T=!1;this.checkStartValueCondition(b,I,x,S)?d=l:this.checkEndValueCondition(I,b,x,e,o,n)&&(p=l,"UpcA"===this.type&&o&&n&&(p-=n*h),T=!0);var E,D,M="Code39"===c||"Code93Extension"===c||"Code32"===c||"Code11"===c||"Code39Extension"===c?!(I%2):"1"===w[parseInt(I.toString(),10)],k=w.toString(),k=Number(k[parseInt(I.toString(),10)]),P=void 0,P=this.getWidthValue(k,void 0,c),v=(P*=h,this.displayText),k=this.getDisplayText(b,v),m=this.getBaseAttributes(void 0,void 0,d,"Bottom"===u?r.y+r.height+2:r.y+y-2,this.foreColor,i||k,v.size,v.visibility,v.font);y||(yBi(),y=(f=gBi(m)).height/2+2),A&&(s=this.getBaseAttributes(P,"Top"===u&&"noBars"!==S?r.height-y-this.displayText.margin.top:r.height,l,"Bottom"===u?r.y:r.y+y+this.displayText.margin.top,this.foreColor)),"Ean13"===c&&0===I&&0===b&&v.visibility&&((m=this.getBaseAttributes(void 0,void 0,d,"Bottom"===u?r.y+r.height+2:r.y+y+this.displayText.margin.top-2-this.displayText.margin.bottom,this.foreColor,i||k,v.size,v.visibility,v.font)).string=this.value[0],this.drawText(t,m)),(!A||T||"UpcA"===c&&A)&&(k=0<(k=r.height)-y*g?k-y*g:0,!(D="Code39"===c||"Code32"===c||"Code93Extension"===c||"Code39Extension"===c||"Code11"===c)&&"Ean8"!==c&&"Ean13"!==c||(k="Top"===u&&"noBars"!==S?k-y:k,E=A?r.height:k,"Code39"!==this.type&&(E="Top"===u&&"noBars"!==S?E-this.displayText.margin.top-y:E),s=this.getBaseAttributes(P,E,l,"Bottom"===u?r.y:r.y+y+this.displayText.margin.top,this.foreColor)),D&&(T||D)||T&&"UpcE"===this.type||(I+=(n=this.multipleWidth(w,I,1))-1,1<n&&(o=!0),k=r.height-y*g,E=A?r.height:k,E="Top"===u&&"noBars"!==S?E-this.displayText.margin.top-y:E,s=this.getBaseAttributes(1<n?n*P:P,E,l,"Bottom"===u?r.y:r.y+y+this.displayText.margin.top,this.foreColor),l=1<n?l+n*P:l+P),!T&&A||this.verticalTextMargin(v,s,m),v.visibility)&&(p&&"Ean8"!==c&&"Ean13"!==c&&"UpcA"!==c&&"UpcE"!==c||("Ean8"===c||"UpcA"===c||"UpcE"===c||"Ean13"===c)&&T)&&(v.margin.left||v.margin.right||!v.text&&"UpcA"!==c?this.getAlignmentPosition(m,p,d,f):this.updateOverlappedTextPosition(p-d,m,f,d,v,p),"UpcA"===c&&(D=m.string===this.value.substr(0,6),m.string=D?this.value.substr(0,1):m.string.substr(0,5),k=D?a[0].x/2:a[a.length-1].x+m.stringSize,T=0,D?(D=m.x,m.x=k,T=m.y,this.drawText(t,m),m.x=D,this.isSvgMode||(m.y=T),m.string=this.value.substr(1,5),this.updateOverlappedTextPosition(p-d,m,f,d,v,p)):(this.updateOverlappedTextPosition(p-d,m,f,d,v,p),T=m.y,this.drawText(t,m),this.isSvgMode||(m.y=T),m.string=this.value.substr(11,12),m.x=k)),this.alignDisplayText(m,v,d,p,f),this.drawText(t,m)),M&&a.push(s),this.canIncrementCheck(c,b,e)&&(l+=P)}this.drawImage(t,a)}},DBi.prototype.canIncrementCheck=function(e,t,i){return"Code39"===e||"Code32"===e||"Code39Extension"===e||"Code93Extension"===e||"Code11"===e||"UpcE"===e&&(1===t||t===i.length-2)||!("Ean8"!==e&&"Ean13"!==e||0!==t&&t!==i.length-1&&2!==t)},DBi.prototype.verticalTextMargin=function(e,t,i){e.margin.top&&0<t.height-e.margin.top&&(0<e.margin.top&&"Bottom"===e.position?t.height-=e.margin.top:i.y+=e.margin.top),e.margin.bottom&&0<t.height-e.margin.bottom&&(0<e.margin.bottom?(i.y-=e.margin.bottom,"Bottom"===this.displayText.position&&(t.height-=e.margin.bottom)):i.y-=e.margin.bottom)},DBi.prototype.getAlignmentPosition=function(e,t,i,n){"Center"===this.displayText.alignment?e.x+=(t-i)/2-.5*n.width:"Left"===this.displayText.alignment?e.x=i:e.x=t-n.width},DBi.prototype.drawImage=function(e,t){for(var i=this.getInstance(e.id),n=0;n<t.length;n++)i.renderRectElement(e,t[parseInt(n.toString(),10)])},DBi.prototype.updateDisplayTextSize=function(e,t,i,n,o){var r;(e.x+t.width>i||e.x<n&&2<e.stringSize)&&(e.x<n&&o.margin.right,e.x<n)&&o.margin.right&&(e.stringSize-=2,r=gBi(e),e.x+=(i-n)/2-.5*r.width,t=o.margin.right-(i-(e.x+t.width)),e.x-=t,this.updateDisplayTextSize(e,r,i,n,o))},DBi.prototype.alignDisplayText=function(e,t,i,n,o){var r,s=!1;(t.margin.left||t.margin.right)&&(e.x-i<t.margin.left&&t.margin.left&&(s=!0,r=t.margin.left-(e.x-i),e.x+=r,this.updateDisplayTextSize(e,o,n,i,t)),n-(e.x+o.width)<t.margin.right&&t.margin.right&&!s?(r=t.margin.right-(n-(e.x+o.width)),e.x-=r,this.updateDisplayTextSize(e,o,n,i,t)):n-(e.x+o.width)<t.margin.right&&(s=gBi(e),this.updateOverlappedTextPosition(n-i,e,s,i,t,n),this.updateDisplayTextSize(e,s,n,i,t)))},DBi.prototype.updateOverlappedTextPosition=function(e,t,i,n,o,r){var s;(i.width>e||o)&&r-(t.x+i.width)<=o.margin.right&&2<t.stringSize?(t.stringSize-=o?.2:2,s=gBi(t),this.updateOverlappedTextPosition(e,t,s,n,o,r)):!o.margin.left&&!o.margin.right&&2<t.stringSize&&this.getAlignmentPosition(t,r,n,i)},DBi.prototype.drawText=function(e,t){this.isSvgMode||(t.y/=1.5),this.getInstance(e.id).renderTextElement(e,t)};var TBi,EBi,DNt=DBi;function DBi(){return null!==EBi&&EBi.apply(this,arguments)||this}MBi=function(e,t){return(MBi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}MBi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(BBi,kBi=DNt),BBi.prototype.validateInput=function(e){if(-1===e.search(/^[0-9A-Za-z\-\.\ \@\$\/\+\%\!\@\#\$\%\&\*\^\(\)\_\+\=\<\>\?\{\}\[\]\~\-\Ê]+$/))return"Supports only 128 characters of ASCII."},BBi.prototype.getCodeValue=function(){return[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},BBi.prototype.getBytes=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[parseInt(i.toString(),10)].charCodeAt(0));return t},BBi.prototype.appendStartStopCharacters=function(e){var t;return"Code128A"===this.type?t=String.fromCharCode(208):"Code128B"===this.type?t=String.fromCharCode(209):"Code128C"===this.type&&(t=String.fromCharCode(210)),t+e},BBi.prototype.check128C=function(e){return e.match(new RegExp("^(Ï*[0-9]{2}Ï*)*"))[0]},BBi.prototype.check128A=function(e){return e.match(new RegExp("^[\0-_È-Ï]*"))[0]},BBi.prototype.check128B=function(e){return e.match(new RegExp("^[ -È-Ï]*"))[0]},BBi.prototype.clipAB=function(e,t){var t=t?"[\0-_È-Ï]":"[ -È-Ï]",i=e.match(new RegExp("^("+t+"+?)(([0-9]{2}){2,})([^0-9]|$)"));return i?i[1]+String.fromCharCode(204)+this.clipC(e.substring(i[1].length)):(e.match(new RegExp("^"+t+"+"))[0].length,e.length,e)},BBi.prototype.code128Clip=function(){var e;return 2<=this.check128C(this.value).length?String.fromCharCode(210)+this.clipC(this.value):((e=this.check128A(this.value)>this.check128B(this.value))?String.fromCharCode(208):String.fromCharCode(209))+this.clipAB(this.value,e)},BBi.prototype.clipC=function(e){var t=this.check128C(e),i=t.length;if(i===e.length)return e;e=e.substring(i);i=this.check128A(e)>=this.check128B(e);return t+String.fromCharCode(i?206:205)+this.clipAB(e,i)},BBi.prototype.draw=function(e){this.code128(e)},BBi.prototype.code128=function(e){var t=this.value,t="Code128"!==this.type?this.appendStartStopCharacters(t):this.code128Clip(),t=this.getBytes(t),i=t.shift()-105,n=103==i?"0":104==i?"1":"2",t=this.encodeData(t,1,n),n=this.encode(i,t),i=[];i.push(n),this.calculateBarCodeAttributes(i,e)},BBi.prototype.encodeData=function(e,t,i){var n,o,r;return e.length?(200<=e[0]?(o=e.shift()-105,void 0!==(r=this.swap(o))&&(n=this.encodeData(e,t+1,r))):(o=this.correctIndex(e,i),n=this.encodeData(e,t+1,i)),{result:this.getCodes(o)+n.result,checksum:o*t+n.checksum}):{result:"",checksum:0}},BBi.prototype.swap=function(e){return 99===e?"2":100===e?"1":"0"},BBi.prototype.encode=function(e,t){var i=this.getCodes(e)+t.result;return this.enableCheckSum&&(i+=this.getCodes((t.checksum+e)%103)),i+=this.getCodes(106)},BBi.prototype.correctIndex=function(e,t){var i;return"0"===t?(i=e.shift())<32?i+64:i-32:"1"===t?e.shift()-32:10*(e.shift()-48)+e.shift()-48},BBi.prototype.getCodes=function(e){var t=this.getCodeValue();return t[parseInt(e.toString(),10)]?t[parseInt(e.toString(),10)].toString():""};var MBi,kBi,PBi=BBi;function BBi(){return null!==kBi&&kBi.apply(this,arguments)||this}FBi=function(e,t){return(FBi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}FBi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(OBi,LBi=PBi),OBi.prototype.validateInput=function(e){if(!new RegExp("^[ -È-Ï]+$").test(e))return"Supports only ASCII characters 32 to 127 (0–9, A–Z, a–z), and special characters."},OBi.prototype.draw=function(e){this.code128(e)};var FBi,LBi,RBi=OBi;function OBi(){return null!==LBi&&LBi.apply(this,arguments)||this}NBi=function(e,t){return(NBi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}NBi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(HBi,VBi=PBi),HBi.prototype.validateInput=function(e){if(!new RegExp("^(Ï*[0-9]{2}Ï*)+$").test(e))return"Supports even number of numeric characters (00-99)."},HBi.prototype.draw=function(e){this.code128(e)};var NBi,VBi,_Bi=HBi;function HBi(){return null!==VBi&&VBi.apply(this,arguments)||this}zBi=function(e,t){return(zBi=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])}))(e,t)};var zBi,jBi,LNt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},HNt=(function(e,t){function i(){this.constructor=e}zBi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(WBi,jBi=n),LNt([e(10)],WBi.prototype,"left",void 0),LNt([e(10)],WBi.prototype,"right",void 0),LNt([e(10)],WBi.prototype,"top",void 0),LNt([e(10)],WBi.prototype,"bottom",void 0),WBi);function WBi(){return null!==jBi&&jBi.apply(this,arguments)||this}QBi=function(e,t){return(QBi=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])}))(e,t)};var QBi,UBi,WNt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},qOt=(function(e,t){function i(){this.constructor=e}QBi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(qBi,UBi=n),WNt([e("")],qBi.prototype,"text",void 0),WNt([e(!0)],qBi.prototype,"visibility",void 0),WNt([e("monospace")],qBi.prototype,"font",void 0),WNt([e(20)],qBi.prototype,"size",void 0),WNt([t({left:0,right:0,top:0,bottom:0},HNt)],qBi.prototype,"margin",void 0),WNt([e("Center")],qBi.prototype,"alignment",void 0),WNt([e("Bottom")],qBi.prototype,"position",void 0),qBi);function qBi(){return null!==UBi&&UBi.apply(this,arguments)||this}GBi=function(e,t){return(GBi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}GBi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(KBi,YBi=DNt),KBi.prototype.getCodeValue=function(){return["111221211","211211112","112211112","212211111","111221112","211221111","112221111","111211212","211211211","112211211","211112112","112112112","212112111","111122112","211122111","112122111","111112212","211112211","112112211","111122211","211111122","112111122","212111121","111121122","211121121","112121121","111111222","211111221","112111221","111121221","221111112","122111112","222111111","121121112","221121111","122121111","121111212","221111211","122111211","121121211","121212111","121211121","121112121","111212121"]},KBi.prototype.getCharacter=function(){return"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%"},KBi.prototype.checkSum=function(e,t){for(var i=0,n=0;n<e.length;n++)i+=t.indexOf(e[parseInt(n.toString(),10)]);return i%=43},KBi.prototype.validateInput=function(e){if(-1===e.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/))return"Supports A-Z, 0-9, and symbols ( - . $ / + % SPACE)."},KBi.prototype.getPatternCollection=function(e,t){for(var i,n=[],o=this.getCodeValue(),r=0;r<e.length;r++)i=t.indexOf(e.charAt(r)),n.push(o[parseInt(i.toString(),10)]);return n},KBi.prototype.appendStartStopCharacters=function(e){return"*"+e+"*"},KBi.prototype.drawCode39Extension=function(e,t){this.draw(e,t)},KBi.prototype.draw=function(e,t){var t=t||this.value,i=this.getCharacter(),t=(this.enableCheckSum&&(t+=this.checkSum(t,i)),t=this.appendStartStopCharacters(t),this.getPatternCollection(t,i));this.calculateBarCodeAttributes(t,e)};var GBi,YBi,XBi=KBi;function KBi(){return null!==YBi&&YBi.apply(this,arguments)||this}JBi=function(e,t){return(JBi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}JBi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(eFi,ZBi=DNt),eFi.prototype.validateInput=function(e){if(-1===e.search(/^[0-9A-D\-\.\$\/\+\%\:]+$/))return"Supports 0-9, A-D and symbols (-,$, /, ., +)."},eFi.prototype.getCodeValue=function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"101100110011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}},eFi.prototype.appendStartStopCharacters=function(e){return"A"+e+"A"},eFi.prototype.getPatternCollection=function(e,t){for(var i=[],n=0;n<e.length;n++){var o=e[parseInt(n.toString(),10)];i.push(t[""+o])}return i},eFi.prototype.draw=function(e){var t=this.getCodeValue(),i=this.value,i=this.appendStartStopCharacters(i),i=this.getPatternCollection(i,t);this.calculateBarCodeAttributes(i,e)};var JBi,ZBi,$Bi=eFi;function eFi(){return null!==ZBi&&ZBi.apply(this,arguments)||this}tFi=function(e,t){return(tFi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}tFi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(oFi,iFi=PBi),oFi.prototype.validateInput=function(e){if(!new RegExp("^[\0-_È-Ï]+$").test(e))return"Supports only ASCII characters 00 to 95 (0–9, A–Z and control codes) and special characters."},oFi.prototype.draw=function(e){this.code128(e)};var tFi,iFi,nFi=oFi;function oFi(){return null!==iFi&&iFi.apply(this,arguments)||this}rFi=function(e,t){return(rFi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}rFi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(lFi,sFi=DNt),lFi.prototype.validateInput=function(e){if(-1===e.search(/^[0-9]{8}$/)||Number(e[7])!==this.checkSumData(e))return"Accepts 8 numeric characters."},lFi.prototype.getCodeValueRight=function(e){e=e?{0:"0001101",1:"0011001",2:"0010011",3:"0111101",4:"0100011",5:"0110001",6:"0101111",7:"0111011",8:"0110111",9:"0001011"}:{0:"1110010",1:"1100110",2:"1101100",3:"1000010",4:"1011100",5:"1001110",6:"1010000",7:"1000100",8:"1001000",9:"1110100"};return e},lFi.prototype.checkSumData=function(e){for(var t=0;t<e.length;t++){var i=10-(Number(e[1])+Number(e[3])+Number(e[5])+3*(Number(e[0])+Number(e[2])+Number(e[4])+Number(e[6])))%10;return 0===i?0:i}return 0},lFi.prototype.draw=function(e){var t=this.getCodeValueRight(!0),i=[];i.push("101"),i.push(this.leftValue(t,!0)),i.push("01010"),t=this.getCodeValueRight(!1),i.push(this.leftValue(t,!1)),i.push("101"),this.calculateBarCodeAttributes(i,e)},lFi.prototype.leftValue=function(e,t){for(var i,n=t?0:this.value.length-4;n<(t?this.value.length-4:this.value.length);n++)0===n||4===n?i=e[this.value[parseInt(n.toString(),10)]]:i+=e[this.value[parseInt(n.toString(),10)]];return i};var rFi,sFi,aFi=lFi;function lFi(){return null!==sFi&&sFi.apply(this,arguments)||this}hFi=function(e,t){return(hFi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}hFi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(cFi,dFi=DNt),cFi.prototype.validateInput=function(e){var t=this.checksumValue(e);if(-1===e.search(/^[0-9]{13}$/)||Number(e[12])!==this.checkSumData(e)&&Number(e[12])!==t){if(-1===e.search(/^[0-9]{12}$/))return"Accepts 12 numeric characters.";e+=this.checkSumData(e),this.value=e}},cFi.prototype.checksumValue=function(e){return(10-e.substr(0,12).split("").map(function(e){return+e}).reduce(function(e,t,i){return i%2?e+3*t:e+t},0)%10)%10},cFi.prototype.checkSumData=function(e){e=3*(Number(e[11])+Number(e[9])+Number(e[7])+Number(e[5])+Number(e[3])+Number(e[1]))+(Number(e[10])+Number(e[8])+Number(e[6])+Number(e[4])+Number(e[2])+Number(e[0]));return 10*Math.round(e/10)-e},cFi.prototype.getStructure=function(){return{0:"LLLLLL",1:"LLGLGG",2:"LLGGLG",3:"LLGGGL",4:"LGLLGG",5:"LGGLLG",6:"LGGGLL",7:"LGLGLG",8:"LGLGGL",9:"LGGLGL"}},cFi.prototype.getBinaries=function(){return{L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]}},cFi.prototype.draw=function(e){var t=[],i=this.getStructure()[this.value[0]],n=(t.push("101"),this.value.substr(1,6));t.push(this.leftValue(!0,i,n)),t.push("01010"),n=this.value.substr(7,6),t.push(this.leftValue(!1,"RRRRRR",n)),t.push("101"),this.calculateBarCodeAttributes(t,e)},cFi.prototype.leftValue=function(e,t,i){for(var n,o,r=this.getBinaries(),s=0;s<i.length;s++)o=r[t[parseInt(s.toString(),10)]],0===s?n=o[i[parseInt(s.toString(),10)]]:n+=o[i[parseInt(s.toString(),10)]];return n};var hFi,dFi,pFi=cFi;function cFi(){return null!==dFi&&dFi.apply(this,arguments)||this}uFi=function(e,t){return(uFi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}uFi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(fFi,gFi=DNt),fFi.prototype.validateInput=function(e){if(-1===e.search(/^[0-9]{6}$/))return"Accepts 6 numeric characters."},fFi.prototype.checkSum=function(e){for(var t=0,i=1;i<11;i+=2)t+=parseInt(e[i],void 0);for(i=0;i<11;i+=2)t+=3*parseInt(e[i],void 0);return(10-t%10)%10},fFi.prototype.getStructure=function(){return{0:"EEEOOO",1:"EEOEOO",2:"EEOOEO",3:"EEOOOE",4:"EOEEOO",5:"EOOEEO",6:"EOOOEE",7:"EOEOEO",8:"EOEOOE",9:"EOOEOE"}},fFi.prototype.getValue=function(){return["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"]},fFi.prototype.getExpansion=function(e){return this.getValue()[""+e]},fFi.prototype.getUpcValue=function(){for(var e=this.value[this.value.length-1],t=this.getExpansion(e),i="",n=0,o=0;o<t.length;o++){var r=t[parseInt(o.toString(),10)];i+="X"===r?this.value[n++]:r}e=""+(i="0"+i);return this.enableCheckSum&&(e+=this.checkSum(i)),e},fFi.prototype.getBinaries=function(){return{O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]}},fFi.prototype.encoding=function(e,t,i){for(var n,o,r=this.getBinaries(),s=0;s<t.length;s++)o=r[i[parseInt(s.toString(),10)]],0===s?n=o[t[parseInt(s.toString(),10)]]:n+=o[t[parseInt(s.toString(),10)]];return n},fFi.prototype.draw=function(e){var t=[],i=this.getUpcValue(),n=this.getStructure()[i[i.length-1]],n=(t.push("00000000"),t.push("101"),t.push(this.encoding(i,this.value,n)),t.push("010101"),t.push("00000000"),i[0]+this.value+i[i.length-1]);this.calculateBarCodeAttributes(t,e,""===this.displayText.text?n:void 0)};var uFi,gFi,mFi=fFi;function fFi(){return null!==gFi&&gFi.apply(this,arguments)||this}yFi=function(e,t){return(yFi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}yFi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(wFi,vFi=DNt),wFi.prototype.validateInput=function(e){if(-1!==e.search(/^[0-9]{11}$/)&&this.enableCheckSum&&(this.value+=this.checkSumData(this.value)),-1===this.value.search(/^[0-9]{12}$/)||Number(this.value[11])!==this.checkSumData(this.value))return"Accepts 11 numeric characters."},wFi.prototype.checkSumData=function(e){return(10-(3*(Number(e[0])+Number(e[2])+Number(e[4])+Number(e[6])+Number(e[8])+Number(e[10]))+(Number(e[9])+Number(e[7])+Number(e[5])+Number(e[3])+Number(e[1])))%10)%10},wFi.prototype.getBinaries=function(){return{L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"]}},wFi.prototype.draw=function(e){var t=[];t.push("00000000"),t.push("101"+this.leftValue(!0,"L",this.value[0])),t.push(this.leftValue(!0,"LLLLL",this.value.substr(1,5))),t.push("01010"),t.push(this.leftValue(!0,"RRRRR",this.value.substr(6,5))),t.push(this.leftValue(!0,"R",this.value[11])+"101"),t.push("00000000"),this.calculateBarCodeAttributes(t,e)},wFi.prototype.leftValue=function(e,t,i){for(var n,o,r=this.getBinaries(),s=0;s<i.length;s++)o=r[t[parseInt(s.toString(),10)]],0===s?n=o[i[parseInt(s.toString(),10)]]:n+=o[i[parseInt(s.toString(),10)]];return n};var yFi,vFi,bFi=wFi;function wFi(){return null!==vFi&&vFi.apply(this,arguments)||this}CFi=function(e,t){return(CFi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}CFi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(xFi,SFi=DNt),xFi.prototype.validateInput=function(e){if(-1===e.search(/^[0-9\-\*]+$/))return"This bar code support 0-9 , * , -"},xFi.prototype.getCodeValue=function(){return{0:"111121",1:"211121",2:"121121",3:"221111",4:"112121",5:"212111",6:"122111",7:"111221",8:"211211",9:"211111","-":"112111","*":"112211"}},xFi.prototype.getPatternCollection=function(e){for(var t=[],i=this.getCodeValue(),n=0;n<e.length;n++)t.push(i[e[parseInt(n.toString(),10)]]);return t},xFi.prototype.draw=function(e){var t="*"+this.value+"*",t=this.getPatternCollection(t);this.calculateBarCodeAttributes(t,e)};var CFi,SFi,AFi=xFi;function xFi(){return null!==SFi&&SFi.apply(this,arguments)||this}IFi=function(e,t){return(IFi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}IFi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(DFi,TFi=DNt),DFi.prototype.validateInput=function(e){if(-1===e.search(/^[0-9A-Z\-\.\*\$\/\+\ %\ ]+$/))return"Supports A-Z, 0-9, and symbols ( - . $ / + % SPACE)."},DFi.prototype.getCharacterWeight=function(){return{0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",A:"10",B:"11",C:"12",D:"13",E:"14",F:"15",G:"16",H:"17",I:"18",J:"19",K:"20",L:"21",M:"22",N:"23",O:"24",P:"25",Q:"26",R:"27",S:"28",T:"29",U:"30",V:"31",W:"32",X:"33",Y:"34",Z:"35","-":"36",".":"37"," ":"38",$:"39","/":"40","+":"41","%":"42","($)":"43","(/)":"44","(+)":"45","(%)":"46"}},DFi.prototype.getCodeValue=function(){return{0:"100010100",1:"101001000",2:"101000100",3:"101000010",4:"100101000",5:"100100100",6:"100100010",7:"101010000",8:"100010010",9:"100001010",A:"110101000",B:"110100100",C:"110100010",D:"110010100",E:"110010010",F:"110001010",G:"101101000",H:"101100100",I:"101100010",J:"100110100",K:"100011010",L:"101011000",M:"101001100",N:"101000110",O:"100101100",P:"100010110",Q:"110110100",R:"110110010",S:"110101100",T:"110100110",U:"110010110",V:"110011010",W:"101101100",X:"101100110",Y:"100110110",Z:"100111010","-":"100101110",".":"111010100"," ":"111010010",$:"111001010","/":"101101110","+":"101110110","%":"110101110","($)":"100100110","(/)":"111010110","(+)":"100110010","(%)":"111011010"}},DFi.prototype.getPatternCollection=function(e,t,i){for(var n=i,o=0;o<e.length;o++){var r=e[parseInt(o.toString(),10)];n.push(t[""+r])}},DFi.prototype.calculateCheckSum=function(e){for(var t=e,i=0,n=0,o=this.getCharacterWeight(),r=t.length;0<r;r--)i+=o[t[parseInt(n.toString(),10)]]*r,n++;e=i%47;return Object.keys(o)[parseInt(e.toString(),10)]},DFi.prototype.draw=function(e){var t=this.getCodeValue(),i=[],n=this.value;this.enableCheckSum&&(n=(n+=this.calculateCheckSum(n))+this.calculateCheckSum(n)),i.push("101011110"),this.getPatternCollection(n,t,i),i.push("101011110"),i.push("1"),this.calculateBarCodeAttributes(i,e)};var IFi,TFi,EFi=DFi;function DFi(){return null!==TFi&&TFi.apply(this,arguments)||this}MFi=function(e,t){return(MFi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}MFi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(BFi,kFi=EFi),BFi.prototype.validateInput=function(e){e=this.getValue(e);if(!e)return"Supports 128 characters of ASCII."},BFi.prototype.getValue=function(e){for(var t=0;t<e.length;t++)if(127<e.charCodeAt(t))return!1;return!0},BFi.prototype.getBars=function(){this.barcodeSymbols[0]={value:"",checkDigit:0,bars:"111213"},this.barcodeSymbols[1]={value:"1",checkDigit:1,bars:"111213"},this.barcodeSymbols[2]={value:"2",checkDigit:2,bars:"111312 "},this.barcodeSymbols[3]={value:"3",checkDigit:3,bars:"111411 "},this.barcodeSymbols[4]={value:"4",checkDigit:4,bars:"121113"},this.barcodeSymbols[5]={value:"5",checkDigit:5,bars:"121212"},this.barcodeSymbols[6]={value:"6",checkDigit:6,bars:"121311"},this.barcodeSymbols[7]={value:"7",checkDigit:7,bars:"111114"},this.barcodeSymbols[8]={value:"8",checkDigit:8,bars:"131211"},this.barcodeSymbols[9]={value:"9",checkDigit:9,bars:"141111"},this.barcodeSymbols[10]={value:"A",checkDigit:10,bars:"211113"},this.barcodeSymbols[11]={value:"B",checkDigit:11,bars:"211212"},this.barcodeSymbols[12]={value:"C",checkDigit:12,bars:"211311"},this.barcodeSymbols[13]={value:"D",checkDigit:13,bars:"221112"},this.barcodeSymbols[14]={value:"E",checkDigit:14,bars:"221211 "},this.barcodeSymbols[15]={value:"F",checkDigit:15,bars:"231111"},this.barcodeSymbols[16]={value:"G",checkDigit:16,bars:"112113"},this.barcodeSymbols[17]={value:"H",checkDigit:17,bars:"112212"},this.barcodeSymbols[18]={value:"I",checkDigit:18,bars:"112311"},this.barcodeSymbols[19]={value:"J",checkDigit:19,bars:"122112"},this.barcodeSymbols[20]={value:"K",checkDigit:20,bars:"132111 "},this.barcodeSymbols[21]={value:"L",checkDigit:21,bars:"111123"},this.barcodeSymbols[22]={value:"M",checkDigit:22,bars:"111222"},this.barcodeSymbols[23]={value:"N",checkDigit:23,bars:"111321"},this.barcodeSymbols[24]={value:"O",checkDigit:24,bars:"121122 "},this.barcodeSymbols[25]={value:"P",checkDigit:25,bars:"131121 "},this.barcodeSymbols[26]={value:"Q",checkDigit:26,bars:"212112 "},this.barcodeSymbols[27]={value:"R",checkDigit:27,bars:" 212211 "},this.barcodeSymbols[28]={value:"S",checkDigit:28,bars:"211122"},this.barcodeSymbols[29]={value:"T",checkDigit:29,bars:"211221"},this.barcodeSymbols[30]={value:"U",checkDigit:30,bars:"221121"},this.barcodeSymbols[31]={value:"V",checkDigit:31,bars:"222111"},this.barcodeSymbols[32]={value:"W",checkDigit:32,bars:"112122"},this.barcodeSymbols[33]={value:"X",checkDigit:33,bars:"112221"},this.barcodeSymbols[34]={value:"Y",checkDigit:34,bars:"122121"},this.barcodeSymbols[35]={value:"Z",checkDigit:35,bars:" 123111"},this.barcodeSymbols[36]={value:"-",checkDigit:36,bars:"121131"},this.barcodeSymbols[37]={value:".",checkDigit:37,bars:"311112"},this.barcodeSymbols[38]={value:" ",checkDigit:38,bars:"311211"},this.barcodeSymbols[39]={value:"$",checkDigit:39,bars:"321111"},this.barcodeSymbols[40]={value:"/",checkDigit:40,bars:"112131"},this.barcodeSymbols[41]={value:"+",checkDigit:41,bars:"113121"},this.barcodeSymbols[42]={value:"%",checkDigit:42,bars:"211131"},this.barcodeSymbols[43]={value:"*",checkDigit:42,bars:"111141"},this.barcodeSymbols[44]={value:"ÿ",checkDigit:47,bars:"1111411"},this.barcodeSymbols[45]={value:"û",checkDigit:43,bars:"121220"},this.barcodeSymbols[46]={value:"ü",checkDigit:44,bars:"312111 "},this.barcodeSymbols[47]={value:"ý",checkDigit:45,bars:"311121"},this.barcodeSymbols[48]={value:"þ",checkDigit:46,bars:"122211"}},BFi.prototype.GetExtendedText=function(e){var t,i=this.value;this.extendedText="";for(var n=0;n<i.length;n++){for(var o=e.length-1;0<o;o--)if(e[parseInt(o.toString(),10)]&&e[parseInt(o.toString(),10)].value&&e[parseInt(o.toString(),10)].character===i[parseInt(n.toString(),10)]){t=e[parseInt(o.toString(),10)];break}t.keyword&&t.value?this.extendedText+=t.keyword+t.value:t.value&&t.value&&(this.extendedText+=t.value)}},BFi.prototype.drawCode93=function(e){this.getBars();for(var t=[],i=this.getArrayValue(),n=(this.GetExtendedText(i),this.CalculateCheckDigit()),o=0;o<n.length;o++)this.extendedText+=n[parseInt(o.toString(),10)];t[0]="*"+this.extendedText+"ÿ";i=this.encoding(t);this.calculateBarCodeAttributes(i,e)},BFi.prototype.GetCheckSumSymbols=function(){for(var e,t=this.extendedText,i=[],n=0,o=t.length,r=0;r<o;r++){0===(d=(o-r)%20)&&(d=20);for(var s=0;s<this.barcodeSymbols.length;s++)t[parseInt(r.toString(),10)]===this.barcodeSymbols[parseInt(s.toString(),10)].value&&(e=this.barcodeSymbols[parseInt(s.toString(),10)].checkDigit);n+=e*d}n%=47;for(var a="",l=0;l<this.barcodeSymbols.length;l++)if(n===this.barcodeSymbols[parseInt(l.toString(),10)].checkDigit){a=this.barcodeSymbols[parseInt(l.toString(),10)].value;break}var h=this.extendedText;h+=a,i[0]=a;for(var d,n=0,o=(t=h).length,r=0;r<o;r++){0===(d=(o-r)%15)&&(d=15);for(var p=0;p<this.barcodeSymbols.length;p++)t[parseInt(r.toString(),10)]===this.barcodeSymbols[parseInt(p.toString(),10)].value&&(n+=this.barcodeSymbols[parseInt(p.toString(),10)].checkDigit*d)}n%=47;for(var c=" ",r=0;r<this.barcodeSymbols.length;r++)if(n===this.barcodeSymbols[parseInt(r.toString(),10)].checkDigit){c=this.barcodeSymbols[parseInt(r.toString(),10)].value;break}return h+=c,i[1]=c,i},BFi.prototype.CalculateCheckDigit=function(){for(var e=this.extendedText,t=0;t<e.length;t++)for(var i=0;i<this.barcodeSymbols.length;i++)e[parseInt(t.toString(),10)]===this.barcodeSymbols[parseInt(i.toString(),10)].value&&this.barcodeSymbols[i].checkDigit;return this.GetCheckSumSymbols()},BFi.prototype.getArrayValue=function(){var e=[];return e[0]={character:"\0",keyword:"ü",value:"U"},e[1]={character:"\x0001",keyword:"û",value:"A"},e[2]={character:"\x0002",keyword:"x00fb",value:"B"},e[3]={character:"\x0003",keyword:"û",value:"C"},e[4]={character:"\x0004",keyword:"û",value:"D"},e[5]={character:"\x0005",keyword:"û",value:"E"},e[6]={character:"\x0006",keyword:"û",value:"F"},e[7]={character:"a",keyword:"û",value:"G"},e[8]={character:"\b",keyword:"û",value:"H"},e[9]={character:"\t",keyword:"û",value:"I"},e[10]={character:"\n",keyword:"û",value:"J"},e[12]={character:"\v",keyword:"û",value:"K"},e[13]={character:"\f",keyword:"û",value:"L"},e[14]={character:"\r",keyword:"û",value:"M"},e[15]={character:"\x000e",keyword:"û",value:"N"},e[16]={character:"\x000f",keyword:"û",value:"O"},e[17]={character:"\x0010",keyword:"û",value:"P"},e[18]={character:"\x0011",keyword:"û",value:"Q"},e[19]={character:"\x0012",keyword:"û",value:"R"},e[20]={character:"\x0013",keyword:"û",value:"S"},e[21]={character:"\x0014",keyword:"û",value:"T"},e[22]={character:"\x0015",keyword:"û",value:"U"},e[23]={character:"\x0016",keyword:"û",value:"V"},e[24]={character:"\x0017",keyword:"û",value:"W"},e[25]={character:"\x0018",keyword:"û",value:"X"},e[26]={character:"\x0019",keyword:"û",value:"Y"},e[27]={character:"\x001a",keyword:"û",value:"Z"},e[28]={character:"\x001b",keyword:"ü",value:"A"},e[29]={character:"\x001c",keyword:"ü",value:"B"},e[30]={character:"\x001d",keyword:"ü",value:"C"},e[31]={character:"\x001e",keyword:"ü",value:"D"},e[32]={character:"\x001f",keyword:"ü",value:"E"},e[33]={character:" ",keyword:" "},e[34]={character:"!",keyword:"ý",value:"A"},e[35]={character:'"',keyword:"ý",value:"B"},e[36]={character:"#",keyword:"ý",value:"C"},e[37]={character:"$",keyword:"ý",value:"D"},e[38]={character:"%",keyword:"ý",value:"E"},e[39]={character:"&",keyword:"ý",value:"F"},e[40]={character:"'",keyword:"ý",value:"G"},e[41]={character:"(",keyword:"ý",value:"H"},e[42]={character:")",keyword:"ý",value:"I"},e[43]={character:"*",keyword:"ý",value:"J"},e[44]={character:"+",keyword:"ý",value:"K"},e[45]={character:",",keyword:"ý",value:"L"},e[46]={character:"-",keyword:"ý",value:"M"},e[47]={character:".",keyword:"ý",value:"N"},e[48]={character:"/",keyword:"ý",value:"O"},e[49]={character:"0",value:"0"},e[50]={character:"1",value:"1"},e[51]={character:"2",value:"2"},e[52]={character:"3",value:"3"},e[53]={character:"4",value:"4"},e[54]={character:"5",value:"5"},e[55]={character:"6",value:"6"},e[56]={character:"7",value:"7"},e[57]={character:"8",value:"8"},e[58]={character:"9",value:"9"},e[59]={character:":",keyword:"ý",value:"Z"},e[60]={character:";",keyword:"ü",value:"F"},e[61]={character:"<",keyword:"ü",value:"G"},e[62]={character:"=",keyword:"ü",value:"H"},e[63]={character:">",keyword:"ü",value:"I"},e[64]={character:"?",keyword:"ü",value:"J"},e[65]={character:"@",keyword:"ü",value:"V"},e[66]={character:"A",value:"A"},e[67]={character:"B",value:"B"},e[68]={character:"C",value:"C"},e[69]={character:"D",value:"D"},e[70]={character:"E",value:"E"},e[71]={character:"F",value:"F"},e[72]={character:"G",value:"G"},e[73]={character:"H",value:"H"},e[74]={character:"I",value:"I"},e[75]={character:"J",value:"J"},e[76]={character:"K",value:"K"},e[77]={character:"L",value:"L"},e[78]={character:"M",value:"M"},e[79]={character:"N",value:"N"},e[80]={character:"O",value:"O"},e[81]={character:"P",value:"P"},e[82]={character:"Q",value:"Q"},e[83]={character:"R",value:"R"},e[84]={character:"S",value:"S"},e[85]={character:"T",value:"T"},e[86]={character:"U",value:"U"},e[87]={character:"V",value:"V"},e[88]={character:"W",value:"W"},e[88]={character:"X",value:"X"},e[89]={character:"Y",value:"Y"},e[90]={character:"Z",value:"Z"},e[91]={character:"[",keyword:"ü",value:"K"},e[92]={character:"\\",keyword:"ü",value:"L"},e[93]={character:"]",keyword:"ü",value:"M"},e[94]={character:"^",keyword:"ü",value:"N"},e[95]={character:"_",keyword:"ü",value:"O"},e[96]={character:"`",keyword:"ü",value:"W"},e[97]={character:"a",keyword:"þ",value:"A"},e[98]={character:"b",keyword:"þ",value:"B"},e[99]={character:"c",keyword:"þ",value:"C"},e[100]={character:"d",keyword:"þ",value:"D"},e[101]={character:"e",keyword:"þ",value:"E"},e[102]={character:"f",keyword:"þ",value:"F"},e[103]={character:"g",keyword:"þ",value:"G"},e[104]={character:"h",keyword:"þ",value:"H"},e[105]={character:"i",keyword:"þ",value:"I"},e[106]={character:"j",keyword:"þ",value:"J"},e[107]={character:"k",keyword:"þ",value:"K"},e[108]={character:"l",keyword:"þ",value:"L"},e[109]={character:"m",keyword:"þ",value:"M"},e[110]={character:"n",keyword:"þ",value:"N"},e[111]={character:"o",keyword:"þ",value:"O"},e[112]={character:"p",keyword:"þ",value:"P"},e[113]={character:"q",keyword:"þ",value:"Q"},e[114]={character:"r",keyword:"þ",value:"R"},e[115]={character:"s",keyword:"þ",value:"S"},e[116]={character:"t",keyword:"þ",value:"T"},e[117]={character:"u",keyword:"þ",value:"U"},e[118]={character:"v",keyword:"þ",value:"V"},e[119]={character:"w",keyword:"þ",value:"W"},e[120]={character:"x",keyword:"þ",value:"X"},e[121]={character:"y",keyword:"þ",value:"Y"},e[122]={character:"z",keyword:"þ",value:"Z"},e[123]={character:"{",keyword:"ü",value:"P"},e[124]={character:"|",keyword:"ü",value:"Q"},e[125]={character:"}",keyword:"ü",value:"R"},e[126]={character:"~",keyword:"ü",value:"S"},e},BFi.prototype.encoding=function(e){for(var t=[],i=0;i<e.length;i++)for(var n=0;n<e[parseInt(i.toString(),10)].length;n++)for(var o=0;o<this.barcodeSymbols.length;o++)e[parseInt(i.toString(),10)][parseInt(n.toString(),10)]===this.barcodeSymbols[parseInt(o.toString(),10)].value&&(t[parseInt(n.toString(),10)]=this.barcodeSymbols[parseInt(o.toString(),10)].bars);return t};var MFi,kFi,PFi=BFi;function BFi(){var e=null!==kFi&&kFi.apply(this,arguments)||this;return e.barcodeSymbols=[],e}FFi=function(e,t){return(FFi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}FFi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(OFi,LFi=DNt),OFi.prototype.validateInput=function(e){if(8!==e.length||!e.match(/^[0-9]+$/))return"Accepts 9 numeric characters."},OFi.prototype.getCodeValue=function(){return[["0",0,["111331311"]],["1",1,["311311113"]],["2",2,["113311113"]],["3",3,["313311111"]],["4",4,["111331113"]],["5",5,["311331111"]],["6",6,["113331111"]],["7",7,["111311313"]],["8",8,["311311311"]],["9",9,["113311311"]],["A",10,["113113113"]],["B",11,["113113113"]],["C",12,["313113111"]],["D",13,["111133113"]],["E",14,["221211"]],["F",15,["113133111"]],["G",16,["111113313"]],["H",17,["311113311"]],["I",18,["112311"]],["J",19,["111133311"]],["K",20,["311111133"]],["L",21,["113111133"]],["M",22,["313111131"]],["N",23,["111131133"]],["O",24,["121122"]],["P",25,["113131131"]],["Q",26,["111111333"]],["R",27,["311111331"]],["S",28,["113111331"]],["T",29,["111131331"]],["U",30,["331111113"]],["V",31,["133111113"]],["W",32,["333111111"]],["X",33,["131131113"]],["Y",34,["331131111"]],["Z",35,["133131111"]],["*",0,["131131311"]]]},OFi.prototype.getPatternCollection=function(e){for(var t=[],i=this.getCodeValue(),n=0;n<=e.length;n++)for(var o=0;o<i.length;o++)e[parseInt(n.toString(),10)]===i[parseInt(o.toString(),10)][0]&&t.push(i[parseInt(o.toString(),10)][2][0]);return t},OFi.prototype.draw=function(e){var t=this.value,t=this.getPatternCollection("*"+t+"*");this.calculateBarCodeAttributes(t,e)};var FFi,LFi,RFi=OFi;function OFi(){return null!==LFi&&LFi.apply(this,arguments)||this}NFi=function(e,t){return(NFi=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])}))(e,t)};(function(e,t){function i(){this.constructor=e}NFi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(HFi,VFi=XBi),HFi.prototype.code39ExtensionValues=function(){return{0:"%U",1:"$A",2:"$B",3:"$C",4:"$D",5:"$E",6:"$F",7:"$G",8:"$H",9:"$I",10:"$J",11:"$K",12:"$L",13:"$M",14:"$N",15:"$O",16:"$P",17:"$Q",18:"$R",19:"$S",20:"$T",21:"$U",22:"$V",23:"$W",24:"$X",25:"$Y",26:"$Z",27:"%A",28:"%B",29:"%C",30:"%D",31:"%E",32:" ",33:"/A",34:"/B",35:"/C",36:"/D",37:"/E",38:"/F",39:"/G",40:"/H",41:"/I",42:"/J",43:"/K",44:"/L",45:"-",46:".",47:"/O",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",58:"/Z",59:"%F",60:"%G",61:"%H",62:"%I",63:"%J",64:"%V",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"%K",92:"%L",93:"%M",94:"%N",95:"%O",96:"%W",97:"+A",98:"+B",99:"+C",100:"+D",101:"+E",102:"+F",103:"+G",104:"+H",105:"+I",106:"+J",107:"+K",108:"+L",109:"+M",110:"+N",111:"+O",112:"+P",113:"+Q",114:"+R",115:"+S",116:"+T",117:"+U",118:"+V",119:"+W",120:"+X",121:"+Y",122:"+Z",123:"%P",124:"%Q",125:"\t%R",126:"%S",127:"%T"}},HFi.prototype.validateInput=function(e){e=this.checkText(e);if(!e)return"Supports 128 characters of ASCII."},HFi.prototype.checkText=function(e){for(var t=0;t<e.length;t++)if(127<e.charCodeAt(t))return!1;return!0},HFi.prototype.code39Extension=function(e){for(var t,i="",n=this.code39ExtensionValues(),o=0;o<e.length;o++)t=e[parseInt(o.toString(),10)].charCodeAt(0),i+=n[parseInt(t.toString(),10)];return i},HFi.prototype.drawCode39=function(e){var t=this.value,t=this.code39Extension(t);this.drawCode39Extension(e,t)};var NFi,VFi,_Fi=HFi;function HFi(){return null!==VFi&&VFi.apply(this,arguments)||this}function zFi(e,t,i,n){return"SVG"!==i||e.mode?e.mode&&t.parentNode.removeChild(t):t.innerHTML="",new SBi(n,"SVG"===i)}function jFi(e,t,i,n,o,r){return{width:e,height:t,x:i,y:n,color:o,strokeColor:r}}function WFi(e,t){var i,n;n=1.5*(i=e).element.offsetWidth,i=1.5*e.element.offsetHeight,vBi.getContext(t).clearRect(0,0,n,i)}function QFi(e,t,i,n,o){l=e,h=t,d=i,p=n,c=o;var l,h,d,p,c,e=new Promise(function(o,e){var t=d.children[0],r=document.createElement("canvas"),s=(r.height=d.clientHeight,r.width=d.clientWidth,r.getContext("2d")),a=new Image;a.onload=function(){var e,t,i,n;s.drawImage(a,0,0),p?(e="JPG"===l?r.toDataURL("image/jpg"):r.toDataURL("image/png"),o(e)):(e=l,t=h,i=r.toDataURL("image/png").replace("image/png","image/octet-stream"),(n=document.createElement("a")).download=t+"."+e.toLocaleLowerCase(),n.href=i,n.click(),o(null))},"Canvas"===c.mode?(a.src="JPG"===l?t.toDataURL("image/jpg"):t.toDataURL("image/png"),r.height=1.5*d.clientHeight,r.width=1.5*d.clientWidth,s.scale(2/3,2/3)):a.src=window.URL.createObjectURL(new Blob([(new window.XMLSerializer).serializeToString(d.children[0])],{type:"image/svg+xml"}))});return e instanceof Promise&&e.then(function(e){return e}),e}UFi=function(e,t){return(UFi=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])}))(e,t)};var UFi,qFi,XOt=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},B2t=(function(e,t){function i(){this.constructor=e}UFi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(GFi,qFi=Ji),GFi.prototype.triggerEvent=function(e,t){this.trigger(sBi[""+e],{message:t})},GFi.prototype.onPropertyChanged=function(e,t){"Canvas"===this.mode&&"Canvas"!==e.mode?this.refreshCanvasBarcode():this.barcodeRenderer=zFi(e,this.barcodeCanvas,this.mode,this.element.id),e.width&&this.barcodeCanvas.setAttribute("width",String(e.width));for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"width":this.element.style.width=this.getElementSize(this.width),this.barcodeCanvas.setAttribute("width",String(this.element.offsetWidth));break;case"height":this.element.style.height=this.getElementSize(this.height),this.barcodeCanvas.setAttribute("height",String(this.element.offsetHeight));break;case"backgroundColor":this.barcodeCanvas.style.background=e.backgroundColor;break;case"mode":this.initialize()}this.renderElements()},GFi.prototype.initialize=function(){this.height||(this.height="100px"),this.width||(this.width="100%"),this.element.style.display="block",this.element.style.height=this.getElementSize(this.height),this.element.style.width=this.getElementSize(this.width);var e="SVG"===this.mode?this.element.offsetHeight:1.5*this.element.offsetHeight,t="SVG"===this.mode?this.element.offsetWidth:1.5*this.element.offsetWidth;this.barcodeCanvas=this.barcodeRenderer.renderRootElement({id:this.element.id+"content",height:e,width:t},this.backgroundColor,t,e),this.element.appendChild(this.barcodeCanvas)},GFi.prototype.exportImage=function(e,t){QFi(t,e,this.element,!1,this)},GFi.prototype.exportAsBase64Image=function(e){return QFi(e,"",this.element,!0,this)},GFi.prototype.renderElements=function(){var e;switch(this.type=this.type||"Code128",this.type){case"Code39Extension":e=new _Fi;break;case"Code39":e=new XBi;break;case"Codabar":e=new $Bi;break;case"Code128A":e=new nFi;break;case"Code128B":e=new RBi;break;case"Code128C":e=new _Bi;break;case"Code128":e=new PBi;break;case"Ean8":e=new aFi;break;case"Ean13":e=new pFi;break;case"UpcA":e=new bFi;break;case"UpcE":e=new mFi;break;case"Code11":e=new AFi;break;case"Code93":e=new EFi;break;case"Code93Extension":e=new PFi;break;case"Code32":e=new RFi}"Canvas"===this.mode&&(this.barcodeCanvas.getContext("2d").setTransform(1,0,0,1,0,0),this.barcodeCanvas.getContext("2d").scale(1.5,1.5)),e.width=this.barcodeCanvas.getAttribute("width"),("Ean8"===this.type||"Ean13"===this.type||"UpcA"===this.type)&&0<this.displayText.text.length&&this.triggerEvent(sBi.invalid,"Invalid Display Text"),this.value=this.value||"",e.value=this.value,e.margin=this.margin,e.type=this.type,e.height=this.barcodeCanvas.getAttribute("height"),e.foreColor=this.foreColor,e.isSvgMode="SVG"===this.mode,e.displayText=this.displayText,e.enableCheckSum=this.enableCheckSum;var t=e.validateInput(this.value);void 0===t?"Code39Extension"===this.type?e.drawCode39(this.barcodeCanvas):"Code93Extension"===this.type?e.drawCode93(this.barcodeCanvas):e.draw(this.barcodeCanvas):this.triggerEvent(sBi.invalid,t),"Canvas"===this.mode&&(this.barcodeCanvas.style.transform="scale("+2/3+")",this.barcodeCanvas.style.transformOrigin="0 0")},GFi.prototype.refreshCanvasBarcode=function(){this.clearCanvas(this)},GFi.prototype.clearCanvas=function(e){var t=e.element.offsetWidth,i=e.element.offsetHeight;"SVG"!==e.mode&&vBi.getContext(this.barcodeCanvas).clearRect(0,0,t,i)},GFi.prototype.getPersistData=function(){return this.addOnPersist(["loaded"])},GFi.prototype.getElementSize=function(e,t){e=0<e.toString().indexOf("px")||0<e.toString().indexOf("%")?e.toString():e.toString()+"px";return e},GFi.prototype.preRender=function(){this.element.classList.add("e-barcode"),this.barcodeRenderer=new SBi(this.element.id,"SVG"===this.mode),this.initialize(),this.initializePrivateVariables(),this.setCulture();var e=document.getElementsByClassName("barcodeMeasureElement");if(0<e.length){for(var t=e.length-1;0<=t;t--)e[parseInt(t.toString(),10)].parentNode.removeChild(e[parseInt(t.toString(),10)]);window.barcodeMeasureElement=null}},GFi.prototype.initializePrivateVariables=function(){this.defaultLocale={}},GFi.prototype.setCulture=function(){this.localeObj=new Cn(this.getModuleName(),this.defaultLocale,this.locale)},GFi.prototype.render=function(){this.notify("initial-load",{}),this.trigger("load"),this.notify("initial-end",{}),this.renderElements(),this.renderComplete()},GFi.prototype.getModuleName=function(){return"barcode"},GFi.prototype.requiredModules=function(){return[]},GFi.prototype.destroy=function(){this.notify("destroy",{}),qFi.prototype.destroy.call(this);var e=document.getElementById(this.element.id+"content");e&&this.element.removeChild(e)},XOt([e("100%")],GFi.prototype,"width",void 0),XOt([e("100px")],GFi.prototype,"height",void 0),XOt([e("SVG")],GFi.prototype,"mode",void 0),XOt([e("Code128")],GFi.prototype,"type",void 0),XOt([e(void 0)],GFi.prototype,"value",void 0),XOt([e(!0)],GFi.prototype,"enableCheckSum",void 0),XOt([t({},qOt)],GFi.prototype,"displayText",void 0),XOt([t({},HNt)],GFi.prototype,"margin",void 0),XOt([e("white")],GFi.prototype,"backgroundColor",void 0),XOt([e("black")],GFi.prototype,"foreColor",void 0),XOt([i()],GFi.prototype,"invalid",void 0),GFi);function GFi(e,t){return qFi.call(this,e,t)||this}YFi=function(e,t){return(YFi=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])}))(e,t)};var YFi,XFi,V2t=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},W2t=(function(e,t){function i(){this.constructor=e}YFi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(KFi,XFi=n),V2t([e(0)],KFi.prototype,"x",void 0),V2t([e(0)],KFi.prototype,"y",void 0),KFi);function KFi(){return null!==XFi&&XFi.apply(this,arguments)||this}JFi.prototype.renderRootElement=function(e){return cBi("canvase",e)},JFi.prototype.renderRect=function(e,t){return cBi("canvase",t)},JFi.prototype.renderLine=function(e,t){return cBi("canvase",t)},JFi.prototype.renderText=function(e,t){return cBi("canvase",t)};Xet=JFi;function JFi(){}Object.defineProperty($Fi.prototype,"NumberOfDataCodeWord",{get:function(){return this.mNumberOfDataCodeWord},set:function(e){this.mNumberOfDataCodeWord=e},enumerable:!0,configurable:!0}),Object.defineProperty($Fi.prototype,"NumberOfErrorCorrectingCodeWords",{get:function(){return this.mNumberOfErrorCorrectingCodeWords},set:function(e){this.mNumberOfErrorCorrectingCodeWords=e},enumerable:!0,configurable:!0}),Object.defineProperty($Fi.prototype,"NumberOfErrorCorrectionBlocks",{get:function(){return this.mNumberOfErrorCorrectionBlocks},set:function(e){this.mNumberOfErrorCorrectionBlocks=e},enumerable:!0,configurable:!0}),Object.defineProperty($Fi.prototype,"End",{set:function(e){this.mEnd=e},enumerable:!0,configurable:!0}),Object.defineProperty($Fi.prototype,"DataCapacity",{get:function(){return this.mDataCapacity},set:function(e){this.mDataCapacity=e},enumerable:!0,configurable:!0}),Object.defineProperty($Fi.prototype,"FormatInformation",{get:function(){return this.mFormatInformation},set:function(e){this.mFormatInformation=e},enumerable:!0,configurable:!0}),Object.defineProperty($Fi.prototype,"VersionInformation",{get:function(){return this.mVersionInformation},set:function(e){this.mVersionInformation=e},enumerable:!0,configurable:!0}),$Fi.prototype.getAlphaNumericValues=function(e){var t=0;switch(e){case"0":t=0;break;case"1":t=1;break;case"2":t=2;break;case"3":t=3;break;case"4":t=4;break;case"5":t=5;break;case"6":t=6;break;case"7":t=7;break;case"8":t=8;break;case"9":t=9;break;case"A":t=10;break;case"B":t=11;break;case"C":t=12;break;case"D":t=13;break;case"E":t=14;break;case"F":t=15;break;case"G":t=16;break;case"H":t=17;break;case"I":t=18;break;case"J":t=19;break;case"K":t=20;break;case"L":t=21;break;case"M":t=22;break;case"N":t=23;break;case"O":t=24;break;case"P":t=25;break;case"Q":t=26;break;case"R":t=27;break;case"S":t=28;break;case"T":t=29;break;case"U":t=30;break;case"V":t=31;break;case"W":t=32;break;case"X":t=33;break;case"Y":t=34;break;case"Z":t=35;break;case" ":t=36;break;case"$":t=37;break;case"%":t=38;break;case"*":t=39;break;case"+":t=40;break;case"-":t=41;break;case".":t=42;break;case"/":t=43;break;case":":t=44}return t},$Fi.prototype.obtainNumberOfDataCodeWord=function(){var e=0;switch(this.mVersion){case 1:switch(this.mErrorCorrectionLevel){case 7:e=19;break;case 15:e=16;break;case 25:e=13;break;case 30:e=9}break;case 2:switch(this.mErrorCorrectionLevel){case 7:e=34;break;case 15:e=28;break;case 25:e=22;break;case 30:e=16}break;case 3:switch(this.mErrorCorrectionLevel){case 7:e=55;break;case 15:e=44;break;case 25:e=34;break;case 30:e=26}break;case 4:switch(this.mErrorCorrectionLevel){case 7:e=80;break;case 15:e=64;break;case 25:e=48;break;case 30:e=36}break;case 5:switch(this.mErrorCorrectionLevel){case 7:e=108;break;case 15:e=86;break;case 25:e=62;break;case 30:e=46}break;case 6:switch(this.mErrorCorrectionLevel){case 7:e=136;break;case 15:e=108;break;case 25:e=76;break;case 30:e=60}break;case 7:switch(this.mErrorCorrectionLevel){case 7:e=156;break;case 15:e=124;break;case 25:e=88;break;case 30:e=66}break;case 8:switch(this.mErrorCorrectionLevel){case 7:e=194;break;case 15:e=154;break;case 25:e=110;break;case 30:e=86}break;case 9:switch(this.mErrorCorrectionLevel){case 7:e=232;break;case 15:e=182;break;case 25:e=132;break;case 30:e=100}break;case 10:switch(this.mErrorCorrectionLevel){case 7:e=274;break;case 15:e=216;break;case 25:e=154;break;case 30:e=122}break;case 11:switch(this.mErrorCorrectionLevel){case 7:e=324;break;case 15:e=254;break;case 25:e=180;break;case 30:e=140}break;case 12:switch(this.mErrorCorrectionLevel){case 7:e=370;break;case 15:e=290;break;case 25:e=206;break;case 30:e=158}break;case 13:switch(this.mErrorCorrectionLevel){case 7:e=428;break;case 15:e=334;break;case 25:e=244;break;case 30:e=180}break;case 14:switch(this.mErrorCorrectionLevel){case 7:e=461;break;case 15:e=365;break;case 25:e=261;break;case 30:e=197}break;case 15:switch(this.mErrorCorrectionLevel){case 7:e=523;break;case 15:e=415;break;case 25:e=295;break;case 30:e=223}break;case 16:switch(this.mErrorCorrectionLevel){case 7:e=589;break;case 15:e=453;break;case 25:e=325;break;case 30:e=253}break;case 17:switch(this.mErrorCorrectionLevel){case 7:e=647;break;case 15:e=507;break;case 25:e=367;break;case 30:e=283}break;case 18:switch(this.mErrorCorrectionLevel){case 7:e=721;break;case 15:e=563;break;case 25:e=397;break;case 30:e=313}break;case 19:switch(this.mErrorCorrectionLevel){case 7:e=795;break;case 15:e=627;break;case 25:e=445;break;case 30:e=341}break;case 20:switch(this.mErrorCorrectionLevel){case 7:e=861;break;case 15:e=669;break;case 25:e=485;break;case 30:e=385}break;case 21:switch(this.mErrorCorrectionLevel){case 7:e=932;break;case 15:e=714;break;case 25:e=512;break;case 30:e=406}break;case 22:switch(this.mErrorCorrectionLevel){case 7:e=1006;break;case 15:e=782;break;case 25:e=568;break;case 30:e=442}break;case 23:switch(this.mErrorCorrectionLevel){case 7:e=1094;break;case 15:e=860;break;case 25:e=614;break;case 30:e=464}break;case 24:switch(this.mErrorCorrectionLevel){case 7:e=1174;break;case 15:e=914;break;case 25:e=664;break;case 30:e=514}break;case 25:switch(this.mErrorCorrectionLevel){case 7:e=1276;break;case 15:e=1e3;break;case 25:e=718;break;case 30:e=538}break;case 26:switch(this.mErrorCorrectionLevel){case 7:e=1370;break;case 15:e=1062;break;case 25:e=754;break;case 30:e=596}break;case 27:switch(this.mErrorCorrectionLevel){case 7:e=1468;break;case 15:e=1128;break;case 25:e=808;break;case 30:e=628}break;case 28:switch(this.mErrorCorrectionLevel){case 7:e=1531;break;case 15:e=1193;break;case 25:e=871;break;case 30:e=661}break;case 29:switch(this.mErrorCorrectionLevel){case 7:e=1631;break;case 15:e=1267;break;case 25:e=911;break;case 30:e=701}break;case 30:switch(this.mErrorCorrectionLevel){case 7:e=1735;break;case 15:e=1373;break;case 25:e=985;break;case 30:e=745}break;case 31:switch(this.mErrorCorrectionLevel){case 7:e=1843;break;case 15:e=1455;break;case 25:e=1033;break;case 30:e=793}break;case 32:switch(this.mErrorCorrectionLevel){case 7:e=1955;break;case 15:e=1541;break;case 25:e=1115;break;case 30:e=845}break;case 33:switch(this.mErrorCorrectionLevel){case 7:e=2071;break;case 15:e=1631;break;case 25:e=1171;break;case 30:e=901}break;case 34:switch(this.mErrorCorrectionLevel){case 7:e=2191;break;case 15:e=1725;break;case 25:e=1231;break;case 30:e=961}break;case 35:switch(this.mErrorCorrectionLevel){case 7:e=2306;break;case 15:e=1812;break;case 25:e=1286;break;case 30:e=986}break;case 36:switch(this.mErrorCorrectionLevel){case 7:e=2434;break;case 15:e=1914;break;case 25:e=1354;break;case 30:e=1054}break;case 37:switch(this.mErrorCorrectionLevel){case 7:e=2566;break;case 15:e=1992;break;case 25:e=1426;break;case 30:e=1096}break;case 38:switch(this.mErrorCorrectionLevel){case 7:e=2702;break;case 15:e=2102;break;case 25:e=1502;break;case 30:e=1142}break;case 39:switch(this.mErrorCorrectionLevel){case 7:e=2812;break;case 15:e=2216;break;case 25:e=1582;break;case 30:e=1222}break;case 40:switch(this.mErrorCorrectionLevel){case 7:e=2956;break;case 15:e=2334;break;case 25:e=1666;break;case 30:e=1276}}return e},$Fi.prototype.obtainNumberOfErrorCorrectingCodeWords=function(){var e=4*(this.mVersion-1);switch(this.mErrorCorrectionLevel){case 7:e+=0;break;case 15:e+=1;break;case 25:e+=2;break;case 30:e+=3}return this.numberOfErrorCorrectingCodeWords[parseInt(e.toString(),10)]},$Fi.prototype.obtainNumberOfErrorCorrectionBlocks=function(){var e=null;switch(this.mVersion){case 1:case 2:e=[1];break;case 3:switch(this.mErrorCorrectionLevel){case 7:case 15:e=[1];break;case 25:case 30:e=[2]}break;case 4:switch(this.mErrorCorrectionLevel){case 7:e=[1];break;case 15:case 25:e=[2];break;case 30:e=[4]}break;case 5:switch(this.mErrorCorrectionLevel){case 7:e=[1];break;case 15:e=[2];break;case 25:e=[2,33,15,2,34,16];break;case 30:e=[2,33,11,2,34,12]}break;case 6:switch(this.mErrorCorrectionLevel){case 7:e=[2];break;case 15:case 25:case 30:e=[4]}break;case 7:switch(this.mErrorCorrectionLevel){case 7:e=[2];break;case 15:e=[4];break;case 25:e=[2,32,14,4,33,15];break;case 30:e=[4,39,13,1,40,14]}break;case 8:switch(this.mErrorCorrectionLevel){case 7:e=[2];break;case 15:e=[2,60,38,2,61,39];break;case 25:e=[4,40,18,2,41,19];break;case 30:e=[4,40,14,2,41,15]}break;case 9:switch(this.mErrorCorrectionLevel){case 7:e=[2];break;case 15:e=[3,58,36,2,59,37];break;case 25:e=[4,36,16,4,37,17];break;case 30:e=[4,36,12,4,37,13]}break;case 10:switch(this.mErrorCorrectionLevel){case 7:e=[2,86,68,2,87,69];break;case 15:e=[4,69,43,1,70,44];break;case 25:e=[6,43,19,2,44,20];break;case 30:e=[6,43,15,2,44,16]}break;case 11:switch(this.mErrorCorrectionLevel){case 7:e=[4];break;case 15:e=[1,80,50,4,81,51];break;case 25:e=[4,50,22,4,51,23];break;case 30:e=[3,36,12,8,37,13]}break;case 12:switch(this.mErrorCorrectionLevel){case 7:e=[2,116,92,2,117,93];break;case 15:e=[6,58,36,2,59,37];break;case 25:e=[4,46,20,6,47,21];break;case 30:e=[7,42,14,4,43,15]}break;case 13:switch(this.mErrorCorrectionLevel){case 7:e=[4];break;case 15:e=[8,59,37,1,60,38];break;case 25:e=[8,44,20,4,45,21];break;case 30:e=[12,33,11,4,34,12]}break;case 14:switch(this.mErrorCorrectionLevel){case 7:e=[3,145,115,1,146,116];break;case 15:e=[4,64,40,5,65,41];break;case 25:e=[11,36,16,5,37,17];break;case 30:e=[11,36,12,5,37,13]}break;case 15:switch(this.mErrorCorrectionLevel){case 7:e=[5,109,87,1,110,88];break;case 15:e=[5,65,41,5,66,42];break;case 25:e=[5,54,24,7,55,25];break;case 30:e=[11,36,12,7,37,13]}break;case 16:switch(this.mErrorCorrectionLevel){case 7:e=[5,112,98,1,123,99];break;case 15:e=[7,73,45,3,74,46];break;case 25:e=[15,43,19,2,44,20];break;case 30:e=[3,45,15,13,46,16]}break;case 17:switch(this.mErrorCorrectionLevel){case 7:e=[1,135,107,5,136,108];break;case 15:e=[10,74,46,1,75,47];break;case 25:e=[1,50,22,15,51,23];break;case 30:e=[2,42,14,17,43,15]}break;case 18:switch(this.mErrorCorrectionLevel){case 7:e=[5,150,120,1,151,121];break;case 15:e=[9,69,43,4,70,44];break;case 25:e=[17,50,22,1,51,23];break;case 30:e=[2,42,14,19,43,15]}break;case 19:switch(this.mErrorCorrectionLevel){case 7:e=[3,141,113,4,142,114];break;case 15:e=[3,70,44,11,71,45];break;case 25:e=[17,47,21,4,48,22];break;case 30:e=[9,39,13,16,40,14]}break;case 20:switch(this.mErrorCorrectionLevel){case 7:e=[3,135,107,5,136,108];break;case 15:e=[3,67,41,13,68,42];break;case 25:e=[15,54,24,5,55,25];break;case 30:e=[15,43,15,10,44,16]}break;case 21:switch(this.mErrorCorrectionLevel){case 7:e=[4,144,116,4,145,117];break;case 15:e=[17];break;case 25:e=[17,50,22,6,51,23];break;case 30:e=[19,46,16,6,47,17]}break;case 22:switch(this.mErrorCorrectionLevel){case 7:e=[2,139,111,7,140,112];break;case 15:e=[17];break;case 25:e=[7,54,24,16,55,25];break;case 30:e=[34]}break;case 23:switch(this.mErrorCorrectionLevel){case 7:e=[4,151,121,5,152,122];break;case 15:e=[4,75,47,14,76,48];break;case 25:e=[11,54,24,14,55,25];break;case 30:e=[16,45,15,14,46,16]}break;case 24:switch(this.mErrorCorrectionLevel){case 7:e=[6,147,117,4,148,118];break;case 15:e=[6,73,45,14,74,46];break;case 25:e=[11,54,24,16,55,25];break;case 30:e=[30,46,16,2,47,17]}break;case 25:switch(this.mErrorCorrectionLevel){case 7:e=[8,132,106,4,133,107];break;case 15:e=[8,75,47,13,76,48];break;case 25:e=[7,54,24,22,55,25];break;case 30:e=[22,45,15,13,46,16]}break;case 26:switch(this.mErrorCorrectionLevel){case 7:e=[10,142,114,2,143,115];break;case 15:e=[19,74,46,4,75,47];break;case 25:e=[28,50,22,6,51,23];break;case 30:e=[33,46,16,4,47,17]}break;case 27:switch(this.mErrorCorrectionLevel){case 7:e=[8,152,122,4,153,123];break;case 15:e=[22,73,45,3,74,46];break;case 25:e=[8,53,23,26,54,24];break;case 30:e=[12,45,15,28,46,16]}break;case 28:switch(this.mErrorCorrectionLevel){case 7:e=[3,147,117,10,148,118];break;case 15:e=[3,73,45,23,74,46];break;case 25:e=[4,54,24,31,55,25];break;case 30:e=[11,45,15,31,46,16]}break;case 29:switch(this.mErrorCorrectionLevel){case 7:e=[7,146,116,7,147,117];break;case 15:e=[21,73,45,7,74,46];break;case 25:e=[1,53,23,37,54,24];break;case 30:e=[19,45,15,26,46,16]}break;case 30:switch(this.mErrorCorrectionLevel){case 7:e=[5,145,115,10,146,116];break;case 15:e=[19,75,47,10,76,48];break;case 25:e=[15,54,24,25,55,25];break;case 30:e=[23,45,15,25,46,16]}break;case 31:switch(this.mErrorCorrectionLevel){case 7:e=[13,145,115,3,146,116];break;case 15:e=[2,74,46,29,75,47];break;case 25:e=[42,54,24,1,55,25];break;case 30:e=[23,45,15,28,46,16]}break;case 32:switch(this.mErrorCorrectionLevel){case 7:e=[17];break;case 15:e=[10,74,46,23,75,47];break;case 25:e=[10,54,24,35,55,25];break;case 30:e=[19,45,15,35,46,16]}break;case 33:switch(this.mErrorCorrectionLevel){case 7:e=[17,145,115,1,146,116];break;case 15:e=[14,74,46,21,75,47];break;case 25:e=[29,54,24,19,55,25];break;case 30:e=[11,45,15,46,46,16]}break;case 34:switch(this.mErrorCorrectionLevel){case 7:e=[13,145,115,6,146,116];break;case 15:e=[14,74,46,23,75,47];break;case 25:e=[44,54,24,7,55,25];break;case 30:e=[59,46,16,1,47,17]}break;case 35:switch(this.mErrorCorrectionLevel){case 7:e=[12,151,121,7,152,122];break;case 15:e=[12,75,47,26,76,48];break;case 25:e=[39,54,24,14,55,25];break;case 30:e=[22,45,15,41,46,16]}break;case 36:switch(this.mErrorCorrectionLevel){case 7:e=[6,151,121,14,152,122];break;case 15:e=[6,75,47,34,76,48];break;case 25:e=[46,54,24,10,55,25];break;case 30:e=[2,45,15,64,46,16]}break;case 37:switch(this.mErrorCorrectionLevel){case 7:e=[17,152,122,4,153,123];break;case 15:e=[29,74,46,14,75,47];break;case 25:e=[49,54,24,10,55,25];break;case 30:e=[24,45,15,46,46,16]}break;case 38:switch(this.mErrorCorrectionLevel){case 7:e=[4,152,122,18,153,123];break;case 15:e=[13,74,46,32,75,47];break;case 25:e=[48,54,24,14,55,25];break;case 30:e=[42,45,15,32,46,16]}break;case 39:switch(this.mErrorCorrectionLevel){case 7:e=[20,147,117,4,148,118];break;case 15:e=[40,75,47,7,76,48];break;case 25:e=[43,54,24,22,55,25];break;case 30:e=[10,45,15,67,46,16]}break;case 40:switch(this.mErrorCorrectionLevel){case 7:e=[19,148,118,6,149,119];break;case 15:e=[18,75,47,31,76,48];break;case 25:e=[34,54,24,34,55,25];break;case 30:e=[20,45,15,61,46,16]}}return e},$Fi.prototype.obtainEnd=function(){return this.endValues[this.mVersion-1]},$Fi.prototype.obtainDataCapacity=function(){return this.dataCapacityValues[this.mVersion-1]},$Fi.prototype.obtainFormatInformation=function(){var e=null;switch(this.mErrorCorrectionLevel){case 7:e=[1,0,1,1,1,0,0,1,0,0,0,1,1,1,1];break;case 15:e=[1,1,0,1,0,0,1,0,1,1,0,1,1,0,1];break;case 25:e=[0,1,1,0,0,0,0,0,0,0,1,0,1,1,0];break;case 30:e=[0,0,0,0,1,0,1,1,1,0,0,1,1,0,0]}return e},$Fi.prototype.obtainVersionInformation=function(){var e=null;switch(this.mVersion){case 7:e=[0,0,1,0,1,0,0,1,0,0,1,1,1,1,1,0,0,0];break;case 8:e=[0,0,1,1,1,1,0,1,1,0,1,0,0,0,0,1,0,0];break;case 9:e=[1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,1,0,0];break;case 10:e=[1,1,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,0];break;case 11:e=[0,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,0,0];break;case 12:e=[0,1,0,0,0,1,1,0,1,1,1,0,0,0,1,1,0,0];break;case 13:e=[1,1,1,0,0,0,1,0,0,0,0,1,1,0,1,1,0,0];break;case 14:e=[1,0,1,1,0,0,0,0,0,1,1,0,0,1,1,1,0,0];break;case 15:e=[0,0,0,1,0,1,0,0,1,0,0,1,1,1,1,1,0,0];break;case 16:e=[0,0,0,1,1,1,1,0,1,1,0,1,0,0,0,0,1,0];break;case 17:e=[1,0,1,1,1,0,1,0,0,0,1,0,1,0,0,0,1,0];break;case 18:e=[1,1,1,0,1,0,0,0,0,1,0,1,0,1,0,0,1,0];break;case 19:e=[0,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,1,0];break;case 20:e=[0,1,1,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0];break;case 21:e=[1,1,0,0,0,0,0,1,0,1,1,0,1,0,1,0,1,0];break;case 22:e=[1,0,0,1,0,0,1,1,0,0,0,1,0,1,1,0,1,0];break;case 23:e=[0,0,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,0];break;case 24:e=[0,0,1,0,0,0,1,1,0,1,1,1,0,0,0,1,1,0];break;case 25:e=[1,0,0,0,0,1,1,1,1,0,0,0,1,0,0,1,1,0];break;case 26:e=[1,1,0,1,0,1,0,1,1,1,1,1,0,1,0,1,1,0];break;case 27:e=[0,1,1,1,0,0,0,1,0,0,0,0,1,1,0,1,1,0];break;case 28:e=[0,1,0,1,1,0,0,0,0,0,1,1,0,0,1,1,1,0];break;case 29:e=[1,1,1,1,1,1,0,0,1,1,0,0,1,0,1,1,1,0];break;case 30:e=[1,0,1,0,1,1,1,0,1,0,1,1,0,1,1,1,1,0];break;case 31:e=[0,0,0,0,1,0,1,0,0,1,0,0,1,1,1,1,1,0];break;case 32:e=[1,0,1,0,1,0,1,1,1,0,0,1,0,0,0,0,0,1];break;case 33:e=[0,0,0,0,1,1,1,1,0,1,1,0,1,0,0,0,0,1];break;case 34:e=[0,1,0,1,1,1,0,1,0,0,0,1,0,1,0,0,0,1];break;case 35:e=[1,1,1,1,1,0,0,1,1,1,1,0,1,1,0,0,0,1];break;case 36:e=[1,1,0,1,0,0,0,0,1,1,0,1,0,0,1,0,0,1];break;case 37:e=[0,1,1,1,0,1,0,0,0,0,1,0,1,0,1,0,0,1];break;case 38:e=[0,0,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,1];break;case 39:e=[1,0,0,0,0,0,1,0,1,0,1,0,1,1,1,0,0,1];break;case 40:e=[1,0,0,1,0,1,1,0,0,0,1,1,0,0,0,1,0,1]}return e},$Fi.prototype.getNumericDataCapacity=function(e,t){var i=null;switch(t){case 7:i=this.numericDataCapacityLow;break;case 15:i=this.numericDataCapacityMedium;break;case 25:i=this.numericDataCapacityQuartile;break;case 30:i=this.numericDataCapacityHigh}return i[e-1]},$Fi.prototype.getAlphanumericDataCapacity=function(e,t){var i=null;switch(t){case 7:i=this.alphanumericDataCapacityLow;break;case 15:i=this.alphanumericDataCapacityMedium;break;case 25:i=this.alphanumericDataCapacityQuartile;break;case 30:i=this.alphanumericDataCapacityHigh}return i[e-1]},$Fi.prototype.getBinaryDataCapacity=function(e,t){var i=null;switch(t){case 7:i=this.binaryDataCapacityLow;break;case 15:i=this.binaryDataCapacityMedium;break;case 25:i=this.binaryDataCapacityQuartile;break;case 30:i=this.binaryDataCapacityHigh}return i[e-1]};var ZFi=$Fi;function $Fi(e,t){this.numberOfErrorCorrectingCodeWords=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430],this.cp437CharSet=["2591","2592","2593","2502","2524","2561","2562","2556","2555","2563","2551","2557","255D","255C","255B","2510","2514","2534","252C","251C","2500","253C","255E","255F","255A","2554","2569","2566","2560","2550","256C","2567","2568","2564","2565","2559","2558","2552","2553","256B","256A","2518","250C","2588","2584","258C","2590","2580","25A0"],this.iso88592CharSet=["104","2D8","141","13D","15A","160","15E","164","179","17D","17B","105","2DB","142","13E","15B","2C7","161","15F","165","17A","2DD","17E","17C","154","102","139","106","10C","118","11A","10E","110","143","147","150","158","16E","170","162","155","103","13A","107","10D","119","11B","10F","111","144","148","151","159","16F","171","163","2D9"],this.iso88593CharSet=["126","124","130","15E","11E","134","17B","127","125","131","15F","11F","135","17C","10A","108","120","11C","16C","15C","10B","109","121","11D","16D","15D"],this.iso88594CharSet=["104","138","156","128","13B","160","112","122","166","17D","105","2DB","157","129","13C","2C7","161","113","123","167","14A","17E","14B","100","12E","10C","118","116","12A","110","145","14C","136","172","168","16A","101","12F","10D","119","117","12B","111","146","14D","137","173","169","16B"],this.windows1250CharSet=["141","104","15E","17B","142","105","15F","13D","13E","17C"],this.windows1251CharSet=["402","403","453","409","40A","40C","40B","40F","452","459","45A","45C","45B","45F","40E","45E","408","490","401","404","407","406","456","491","451","454","458","405","455","457"],this.windows1252CharSet=["20AC","201A","192","201E","2026","2020","2021","2C6","2030","160","2039","152","17D","2018","2019","201C","201D","2022","2013","2014","2DC","2122","161","203A","153","17E","178"],this.windows1256CharSet=["67E","679","152","686","698","688","6AF","6A9","691","153","6BA","6BE","6C1","644","645","646","647","648","649","64A","6D2"],this.cp437ReplaceNumber=[176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,254],this.iso88592ReplaceNumber=[161,162,163,165,166,169,170,171,172,174,175,177,178,179,181,182,183,185,186,187,188,189,190,191,192,195,197,198,200,202,204,207,208,209,210,213,216,217,219,222,224,227,229,230,232,234,236,239,240,241,242,245,248,249,251,254,255],this.iso88593ReplaceNumber=[161,166,169,170,171,172,175,177,182,185,186,187,188,191,197,198,213,216,221,222,229,230,245,248,253,254],this.iso88594ReplaceNumber=[161,162,163,165,166,169,170,171,172,174,177,178,179,181,182,183,185,186,187,188,189,190,191,192,199,200,202,204,207,208,209,210,211,217,221,222,224,231,232,234,236,239,240,241,242,243,249,253,254],this.windows1250ReplaceNumber=[163,165,170,175,179,185,186,188,190,191],this.windows1251ReplaceNumber=[128,129,131,138,140,141,142,143,144,154,156,157,158,159,161,162,163,165,168,170,175,178,179,180,184,186,188,189,190,191],this.windows1252ReplaceNumber=[128,130,131,132,133,134,135,136,137,138,139,140,142,145,146,147,148,149,150,151,152,153,154,155,156,158,159],this.windows1256ReplaceNumber=[129,138,140,141,142,143,144,152,154,156,159,170,192,225,227,228,229,230,236,237,255],this.endValues=[208,359,567,807,1079,1383,1568,1936,2336,2768,3232,3728,4256,4651,5243,5867,6523,7211,7931,8683,9252,10068,10916,11796,12708,13652,14628,15371,16411,17483,18587,19723,20891,22091,23008,24272,25568,26896,28256,29648],this.dataCapacityValues=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],this.numericDataCapacityLow=[41,77,127,187,255,322,370,461,552,652,772,883,1022,1101,1250,1408,1548,1725,1903,2061,2232,2409,2620,2812,3057,3283,3517,3669,3909,4158,4417,4686,4965,5253,5529,5836,6153,6479,6743,7089],this.numericDataCapacityMedium=[34,63,101,149,202,255,293,365,432,513,604,691,796,871,991,1082,1212,1346,1500,1600,1708,1872,2059,2188,2395,2544,2701,2857,3035,3289,3486,3693,3909,4134,4343,4588,4775,5039,5313,5596],this.numericDataCapacityQuartile=[27,48,77,111,144,178,207,259,312,364,427,489,580,621,703,775,876,948,1063,1159,1224,1358,1468,1588,1718,1804,1933,2085,2181,2358,2473,2670,2805,2949,3081,3244,3417,3599,3791,3993],this.numericDataCapacityHigh=[17,34,58,82,106,139,154,202,235,288,331,374,427,468,530,602,674,746,813,919,969,1056,1108,1228,1286,1425,1501,1581,1677,1782,1897,2022,2157,2301,2361,2524,2625,2735,2927,3057],this.alphanumericDataCapacityLow=[25,47,77,114,154,195,224,279,335,395,468,535,619,667,758,854,938,1046,1153,1249,1352,1460,1588,1704,1853,1990,2132,2223,2369,2520,2677,2840,3009,3183,3351,3537,3729,3927,4087,4296],this.alphanumericDataCapacityMedium=[20,38,61,90,122,154,178,221,262,311,366,419,483,528,600,656,734,816,909,970,1035,1134,1248,1326,1451,1542,1637,1732,1839,1994,2113,2238,2369,2506,2632,2780,2894,3054,3220,3391],this.alphanumericDataCapacityQuartile=[16,29,47,67,87,108,125,157,189,221,259,296,352,376,426,470,531,574,644,702,742,823,890,963,1041,1094,1172,1263,1322,1429,1499,1618,1700,1787,1867,1966,2071,2181,2298,2420],this.alphanumericDataCapacityHigh=[10,20,35,50,64,84,93,122,143,174,200,227,259,283,321,365,408,452,493,557,587,640,672,744,779,864,910,958,1016,1080,1150,1226,1307,1394,1431,1530,1591,1658,1774,1852],this.binaryDataCapacityLow=[17,32,53,78,106,134,154,192,230,271,321,367,425,458,520,586,644,718,792,858,929,1003,1091,1171,1273,1367,1465,1528,1628,1732,1840,1952,2068,2188,2303,2431,2563,2699,2809,2953],this.binaryDataCapacityMedium=[14,26,42,62,84,106,122,152,180,213,251,287,331,362,412,450,504,560,624,666,711,779,857,911,997,1059,1125,1190,1264,1370,1452,1538,1628,1722,1809,1911,1989,2099,2213,2331],this.binaryDataCapacityQuartile=[11,20,32,46,60,74,86,108,130,151,177,203,241,258,292,322,364,394,442,482,509,565,611,661,715,751,805,868,908,982,1030,1112,1168,1228,1283,1351,1423,1499,1579,1663],this.binaryDataCapacityHigh=[7,14,24,34,44,58,64,84,98,119,137,155,177,194,220,250,280,310,338,382,403,439,461,511,535,593,625,658,698,742,790,842,898,958,983,1051,1093,1139,1219,1273],this.mixedDataCapacityLow=[152,272,440,640,864,1088,1248,1552,1856,2192,2592,2960,3424,3688,4184,4712,5176,5768,6360,6888,7456,8048,8752,9392,10208,10960,11744,12248,13048,13880,4744,15640,16568,17528,18448,19472,20528,21616,22496,23648],this.mixedDataCapacityMedium=[128,244,352,512,688,864,992,1232,1456,1728,2032,2320,2672,2920,3320,3624,4056,4504,5016,5352,5712,6256,6880,7312,8e3,8496,9024,9544,10136,10984,1640,12328,13048,13800,14496,15312,15936,16816,17728,18672],this.mixedDataCapacityQuartile=[104,176,272,384,496,608,704,880,1056,1232,1440,1648,1952,2088,2360,2600,2936,3176,3560,3880,4096,4544,4912,5312,5744,6032,6464,6968,7288,7880,8264,8920,9368,9848,10288,10832,11408,12016,12656,13328],this.mixedDataCapacityHigh=[72,128,208,288,368,480,528,688,800,976,1120,1264,1440,1576,1784,2024,2264,2504,2728,3080,3248,3536,3712,4112,4304,4768,5024,5288,5608,5960,6344,6760,7208,7688,7888,8432,8768,9136,9776,10208],this.mVersion=e,this.mErrorCorrectionLevel=t,this.NumberOfDataCodeWord=this.obtainNumberOfDataCodeWord(),this.NumberOfErrorCorrectingCodeWords=this.obtainNumberOfErrorCorrectingCodeWords(),this.NumberOfErrorCorrectionBlocks=this.obtainNumberOfErrorCorrectionBlocks(),this.End=this.obtainEnd(),this.DataCapacity=this.obtainDataCapacity(),this.FormatInformation=this.obtainFormatInformation(),this.VersionInformation=this.obtainVersionInformation()}Object.defineProperty(tLi.prototype,"DC",{set:function(e){this.mDataCodeWord=e},enumerable:!0,configurable:!0}),Object.defineProperty(tLi.prototype,"DataBits",{set:function(e){this.databits=e},enumerable:!0,configurable:!0}),Object.defineProperty(tLi.prototype,"Eccw",{set:function(e){this.eccw=e},enumerable:!0,configurable:!0}),tLi.prototype.getErcw=function(){switch(this.decimalValue=[this.databits],this.eccw){case 7:this.gx=[0,87,229,146,149,238,102,21];break;case 10:this.gx=[0,251,67,46,61,118,70,64,94,32,45];break;case 13:this.gx=[0,74,152,176,100,86,100,106,104,130,218,206,140,78];break;case 15:this.gx=[0,8,183,61,91,202,37,51,58,58,237,140,124,5,99,105];break;case 16:this.gx=[0,120,104,107,109,102,161,76,3,91,191,147,169,182,194,225,120];break;case 17:this.gx=[0,43,139,206,78,43,239,123,206,214,147,24,99,150,39,243,163,136];break;case 18:this.gx=[0,215,234,158,94,184,97,118,170,79,187,152,148,252,179,5,98,96,153];break;case 20:this.gx=[0,17,60,79,50,61,163,26,187,202,180,221,225,83,239,156,164,212,212,188,190];break;case 22:this.gx=[0,210,171,247,242,93,230,14,109,221,53,200,74,8,172,98,80,219,134,160,105,165,231];break;case 24:this.gx=[0,229,121,135,48,211,117,251,126,159,180,169,152,192,226,228,218,111,0,117,232,87,96,227,21];break;case 26:this.gx=[0,173,125,158,2,103,182,118,17,145,201,111,28,165,53,161,21,245,142,13,102,48,227,153,145,218,70];break;case 28:this.gx=[0,168,223,200,104,224,234,108,180,110,190,195,147,205,27,232,201,21,43,245,87,42,195,212,119,242,37,9,123];break;case 30:this.gx=[0,41,173,145,152,216,31,179,182,50,48,110,86,239,96,222,125,42,173,226,193,224,130,156,37,251,216,238,40,192,180]}this.gx=this.getElement(this.gx,this.alpha),this.toDecimal(this.mDataCodeWord);var e=this.divide();return this.toBinary(e)},tLi.prototype.toDecimal=function(e){for(var t=0;t<e.length;t++)this.decimalValue[parseInt(t.toString(),10)]=parseInt(e[parseInt(t.toString(),10)],2)},tLi.prototype.toBinary=function(e){for(var t=[],i=0;i<this.eccw;i++){var n="",o=e[parseInt(i.toString(),10)].toString(2);if(o.length<8)for(var r=0;r<8-o.length;r++)n+="0";t[parseInt(i.toString(),10)]=n+o}return t},tLi.prototype.divide=function(){for(var e={},t=0;t<this.decimalValue.length;t++)e[this.decimalValue.length-1-t]=this.decimalValue[parseInt(t.toString(),10)];for(var i={},t=0;t<this.gx.length;t++)i[this.gx.length-1-t]=this.findElement(this.gx[parseInt(t.toString(),10)],this.alpha);for(var n={},o=0,r=Object.keys(e);o<r.length;o++){var s=r[o];n[Number(s)+this.eccw]=e[""+s]}for(var e=n,a=this.decimalValue.length+this.eccw-this.gx.length,n={},l=0,h=Object.keys(i);l<h.length;l++){s=h[l];n[Number(s)+a]=i[""+s]}for(var i=n,d=e,t=0;t<Object.keys(e).length;t++){var p=this.findLargestExponent(d);0===d[parseInt(p.toString(),10)]?delete d[parseInt(p.toString(),10)]:(p=this.convertToAlphaNotation(d),p=this.multiplyGeneratorPolynomByLeadterm(i,p[this.findLargestExponent(p)],t),p=this.convertToDecNotation(p),d=p=this.xORPolynoms(d,p))}this.eccw=Object.keys(d).length;for(var c=[],u=0,g=Object.keys(d);u<g.length;u++){var m=g[u];c.push(d[""+m])}return c.reverse()},tLi.prototype.xORPolynoms=function(e,t){for(var i={},n={},o={},o=Object.keys(e).length>=Object.keys(t).length?(n=e,t):(n=t,e),r=this.findLargestExponent(e),s=this.findLargestExponent(o),a=Object.keys(n).length-1,l=0,h=Object.keys(n);l<h.length;l++){var d=h[l];i[r-a]=n[""+d]^(Object.keys(o).length>a?o[s-a]:0),a--}t=this.findLargestExponent(i);return delete i[parseInt(t.toString(),10)],i},tLi.prototype.multiplyGeneratorPolynomByLeadterm=function(e,t,i){for(var n={},o=0,r=Object.keys(e);o<r.length;o++){var s=r[o];n[Number(s)-i]=(e[""+s]+t)%255}return n},tLi.prototype.convertToDecNotation=function(e){for(var t={},i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];t[""+o]=this.getIntValFromAlphaExp(e[""+o],this.alpha)}return t},tLi.prototype.convertToAlphaNotation=function(e){for(var t={},i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];0!==e[""+o]&&(t[""+o]=this.findElement(e[""+o],this.alpha))}return t},tLi.prototype.findLargestExponent=function(e){for(var t=0,i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];Number(o)>t&&(t=Number(o))}return t},tLi.prototype.getIntValFromAlphaExp=function(e,t){return 255<e&&(e-=255),t[parseInt(e.toString(),10)]},tLi.prototype.findElement=function(e,t){for(var i=0;i<t.length&&e!==t[parseInt(i.toString(),10)];i++);return i},tLi.prototype.getElement=function(e,t){for(var i=[e.length],n=0;n<e.length;n++)255<e[parseInt(n.toString(),10)]&&(e[parseInt(n.toString(),10)]=e[parseInt(n.toString(),10)]-255),i[parseInt(n.toString(),10)]=t[e[parseInt(n.toString(),10)]];return i};var eLi=tLi;function tLi(e,t){this.alpha=[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142],this.mQrBarcodeValues=new ZFi(e,t);this.mLength=this.mQrBarcodeValues.DataCapacity,this.eccw=this.mQrBarcodeValues.NumberOfErrorCorrectingCodeWords}Object.defineProperty(nLi.prototype,"XDimension",{get:function(){return this.mXDimension},set:function(e){this.mXDimension=e},enumerable:!0,configurable:!0}),Object.defineProperty(nLi.prototype,"inputMode",{get:function(){return this.mInputMode},set:function(e){this.mInputMode=e,this.mIsUserMentionedMode=!0},enumerable:!0,configurable:!0}),Object.defineProperty(nLi.prototype,"version",{get:function(){return this.mVersion},set:function(e){this.mVersion=e,this.mNoOfModules=4*(this.mVersion-1)+21,e!==hBi.Auto&&(this.mIsUserMentionedVersion=!0)},enumerable:!0,configurable:!0}),nLi.prototype.getBaseAttributes=function(e,t,i,n,o,r){return{width:e,height:t,x:i,y:n,color:o,strokeColor:r}},nLi.prototype.getInstance=function(e){e=document.getElementById(e);return new SBi(e.id,this.isSvgMode)},nLi.prototype.drawImage=function(e,t){for(var i=this.getInstance(e.id),n=0;n<t.length;n++)i.renderRectElement(e,t[parseInt(n.toString(),10)])},nLi.prototype.draw=function(e,t,i,n,o,r,s,a,l){if(this.isSvgMode=s,this.generateValues(),this.validInput){for(var h,d,p=n-(o.left+o.right),s=i-(o.top+o.bottom),c=(this.XDimension,aBi.All),u=(h=s<=p?s:p)<=p?(p-h)/2:0,g=h<=s?(s-h)/2:0,m=(g+=o.top,u+=o.left,this.drawDisplayText(t,u,g,h,s,r,e,o,a)),e=(s-=m.height,0<r.margin.bottom&&("Top"===r.position&&(g+=r.margin.bottom),s-=r.margin.bottom),0<r.margin.top&&("Top"===r.position&&(g+=r.margin.top),s-=r.margin.top),this.mNoOfModules+2*c+1),f=(h=s<=p?s:p)/e,y=null,s=null,v=(null!==l&&""!==l.imageSource&&(y={x:(s={x:(u=(h<=p?(p-h)/2:0)+o.left)+c*f+(e=h-(2*c+1)*f)/2-(d=l.width?Math.min(l.width,.3*e):.3*e)/2,y:g+c*f+e/2-(e=l.height?Math.min(l.height,.3*e):.3*e)/2,width:d,height:e,color:"transparent",imageSource:l.imageSource}).x,y:s.y,width:s.width,height:s.height}),this.isXdimension=!0,n=(this.mNoOfModules+2*c)*f,i=(this.mNoOfModules+2*c)*f,this.mNoOfModules+2*c),b=this.mNoOfModules+2*c,w=[],C=0;C<v;C++){for(var S=0;S<b;S++){var A,x=void 0,x=this.mModuleValue[parseInt(C.toString(),10)][parseInt(S.toString(),10)].isBlack?a:"white";"white"!==(x=this.mDataAllocationValues[parseInt(S.toString(),10)][parseInt(C.toString(),10)].isFilled&&this.mDataAllocationValues[parseInt(S.toString(),10)][parseInt(C.toString(),10)].isBlack?a:x)&&(A={x:(x=this.getBaseAttributes(f,f,u,"Bottom"===r.position?g:g+m.height/2,x)).x,y:x.y,width:f,height:f},null!=y&&this.containsRect(y,A)||w.push(x)),u+=f}g+=f,u=(h<=p?(p-h)/2:0)+o.left}return this.drawImage(t,w),s&&this.drawImage(t,[s]),this.mModuleValue=void 0,!(this.mDataAllocationValues=void 0)}return!1},nLi.prototype.containsRect=function(e,t){return e.x<=t.x&&e.x+e.width>=t.x+t.width&&e.y<=t.y&&e.y+e.height>=t.y+t.height},nLi.prototype.drawText=function(e,t){this.getInstance(e.id).renderTextElement(e,t)},nLi.prototype.drawDisplayText=function(e,t,i,n,o,r,s,a,l){var h=r,d=(yBi(),this.getBaseAttributes(n,o,t,i,"black")),s=(d.string=h.text||s,d.color=l,d.fontStyle=h.font,d.stringSize=h.size,d.visibility=h.visibility,gBi(d)),l=s.height/2+2;return d.height=l,d.x=t+n/2-s.width/2+h.margin.left-h.margin.right,"Bottom"===r.position?(0<r.margin.top&&(d.y=i+o),0<r.margin.bottom?d.y=i+o-h.margin.bottom:a.top<10?d.y=o+s.height/2:d.y=o+a.top):0<r.margin.top?d.y=i+r.margin.top+s.height/2:d.y=i+s.height/2,r.visibility&&this.drawText(e,d),d},nLi.prototype.generateValues=function(){this.mQrBarcodeValues=new ZFi(this.mVersion,this.mErrorCorrectionLevel),this.initialize(),this.mQrBarcodeValues=new ZFi(this.mVersion,this.mErrorCorrectionLevel);for(var e=0;e<this.mNoOfModules;e++){this.mModuleValue.push([0]);for(var t=0;t<this.mNoOfModules;t++)this.mModuleValue[parseInt(e.toString(),10)][parseInt(t.toString(),10)]=new oLi}if(this.drawPDP(0,0),this.drawPDP(this.mNoOfModules-7,0),this.drawPDP(0,this.mNoOfModules-7),this.drawTimingPattern(),1!==this.mVersion)for(var i=this.getAlignmentPatternCoOrdinates(),n=0,o=Object.keys(i);n<o.length;n++)for(var e=o[n],r=0,s=Object.keys(i);r<s.length;r++){t=s[r];this.mModuleValue[i[""+e]][i[""+t]].isPdp||this.drawAlignmentPattern(i[""+e],i[""+t])}this.allocateFormatAndVersionInformation();var a=this.encodeData();this.dataAllocationAndMasking(a),this.drawFormatInformation(),this.addQuietZone(),this.mQrBarcodeValues.FormatInformation=void 0,this.mQrBarcodeValues.NumberOfDataCodeWord=void 0,this.mQrBarcodeValues.NumberOfErrorCorrectingCodeWords=void 0,this.mQrBarcodeValues.VersionInformation=void 0,this.mQrBarcodeValues.alphanumericDataCapacityHigh=void 0,this.mQrBarcodeValues.alphanumericDataCapacityLow=void 0,this.mQrBarcodeValues.alphanumericDataCapacityMedium=void 0,this.mQrBarcodeValues.alphanumericDataCapacityQuartile=void 0,this.mQrBarcodeValues.binaryDataCapacityHigh=void 0,this.mQrBarcodeValues.dataCapacityValues=void 0,this.mQrBarcodeValues.endValues=void 0,this.mQrBarcodeValues.dataCapacityValues=void 0,this.mQrBarcodeValues=void 0,this.mIsUserMentionedVersion=void 0,this.mVersion=void 0},nLi.prototype.drawPDP=function(e,t){for(var i=e,n=t;i<e+7;i++,n++)this.mModuleValue[parseInt(i.toString(),10)][parseInt(t.toString(),10)].isBlack=!0,this.mModuleValue[parseInt(i.toString(),10)][parseInt(t.toString(),10)].isFilled=!0,this.mModuleValue[parseInt(i.toString(),10)][parseInt(t.toString(),10)].isPdp=!0,this.mModuleValue[parseInt(i.toString(),10)][t+6].isBlack=!0,this.mModuleValue[parseInt(i.toString(),10)][t+6].isFilled=!0,this.mModuleValue[parseInt(i.toString(),10)][t+6].isPdp=!0,t+7<this.mNoOfModules?(this.mModuleValue[parseInt(i.toString(),10)][t+7].isBlack=!1,this.mModuleValue[parseInt(i.toString(),10)][t+7].isFilled=!0,this.mModuleValue[parseInt(i.toString(),10)][t+7].isPdp=!0):0<=t-1&&(this.mModuleValue[parseInt(i.toString(),10)][t-1].isBlack=!1,this.mModuleValue[parseInt(i.toString(),10)][t-1].isFilled=!0,this.mModuleValue[parseInt(i.toString(),10)][t-1].isPdp=!0),this.mModuleValue[parseInt(e.toString(),10)][parseInt(n.toString(),10)].isBlack=!0,this.mModuleValue[parseInt(e.toString(),10)][parseInt(n.toString(),10)].isFilled=!0,this.mModuleValue[parseInt(e.toString(),10)][parseInt(n.toString(),10)].isPdp=!0,this.mModuleValue[e+6][parseInt(n.toString(),10)].isBlack=!0,this.mModuleValue[e+6][parseInt(n.toString(),10)].isFilled=!0,this.mModuleValue[e+6][parseInt(n.toString(),10)].isPdp=!0,e+7<this.mNoOfModules?(this.mModuleValue[e+7][parseInt(n.toString(),10)].isBlack=!1,this.mModuleValue[e+7][parseInt(n.toString(),10)].isFilled=!0,this.mModuleValue[e+7][parseInt(n.toString(),10)].isPdp=!0):0<=e-1&&(this.mModuleValue[e-1][parseInt(n.toString(),10)].isBlack=!1,this.mModuleValue[e-1][parseInt(n.toString(),10)].isFilled=!0,this.mModuleValue[e-1][parseInt(n.toString(),10)].isPdp=!0);for(e+7<this.mNoOfModules&&t+7<this.mNoOfModules?(this.mModuleValue[e+7][t+7].isBlack=!1,this.mModuleValue[e+7][t+7].isFilled=!0,this.mModuleValue[e+7][t+7].isPdp=!0):e+7<this.mNoOfModules&&t+7>=this.mNoOfModules?(this.mModuleValue[e+7][t-1].isBlack=!1,this.mModuleValue[e+7][t-1].isFilled=!0,this.mModuleValue[e+7][t-1].isPdp=!0):e+7>=this.mNoOfModules&&t+7<this.mNoOfModules&&(this.mModuleValue[e-1][t+7].isBlack=!1,this.mModuleValue[e-1][t+7].isFilled=!0,this.mModuleValue[e-1][t+7].isPdp=!0),i=++e,n=++t;i<e+5;i++,n++)this.mModuleValue[parseInt(i.toString(),10)][parseInt(t.toString(),10)].isBlack=!1,this.mModuleValue[parseInt(i.toString(),10)][parseInt(t.toString(),10)].isFilled=!0,this.mModuleValue[parseInt(i.toString(),10)][parseInt(t.toString(),10)].isPdp=!0,this.mModuleValue[parseInt(i.toString(),10)][t+4].isBlack=!1,this.mModuleValue[parseInt(i.toString(),10)][t+4].isFilled=!0,this.mModuleValue[parseInt(i.toString(),10)][t+4].isPdp=!0,this.mModuleValue[parseInt(e.toString(),10)][parseInt(n.toString(),10)].isBlack=!1,this.mModuleValue[parseInt(e.toString(),10)][parseInt(n.toString(),10)].isFilled=!0,this.mModuleValue[parseInt(e.toString(),10)][parseInt(n.toString(),10)].isPdp=!0,this.mModuleValue[e+4][parseInt(n.toString(),10)].isBlack=!1,this.mModuleValue[e+4][parseInt(n.toString(),10)].isFilled=!0,this.mModuleValue[e+4][parseInt(n.toString(),10)].isPdp=!0;for(i=++e,n=++t;i<e+3;i++,n++)this.mModuleValue[parseInt(i.toString(),10)][parseInt(t.toString(),10)].isBlack=!0,this.mModuleValue[parseInt(i.toString(),10)][parseInt(t.toString(),10)].isFilled=!0,this.mModuleValue[parseInt(i.toString(),10)][parseInt(t.toString(),10)].isPdp=!0,this.mModuleValue[parseInt(i.toString(),10)][t+2].isBlack=!0,this.mModuleValue[parseInt(i.toString(),10)][t+2].isFilled=!0,this.mModuleValue[parseInt(i.toString(),10)][t+2].isPdp=!0,this.mModuleValue[parseInt(e.toString(),10)][parseInt(n.toString(),10)].isBlack=!0,this.mModuleValue[parseInt(e.toString(),10)][parseInt(n.toString(),10)].isFilled=!0,this.mModuleValue[parseInt(e.toString(),10)][parseInt(n.toString(),10)].isPdp=!0,this.mModuleValue[e+2][parseInt(n.toString(),10)].isBlack=!0,this.mModuleValue[e+2][parseInt(n.toString(),10)].isFilled=!0,this.mModuleValue[e+2][parseInt(n.toString(),10)].isPdp=!0;this.mModuleValue[e+1][t+1].isBlack=!0,this.mModuleValue[e+1][t+1].isFilled=!0,this.mModuleValue[e+1][t+1].isPdp=!0},nLi.prototype.drawTimingPattern=function(){for(var e=8;e<this.mNoOfModules-8;e+=2)this.mModuleValue[parseInt(e.toString(),10)][6].isBlack=!0,this.mModuleValue[parseInt(e.toString(),10)][6].isFilled=!0,this.mModuleValue[e+1][6].isBlack=!1,this.mModuleValue[e+1][6].isFilled=!0,this.mModuleValue[6][parseInt(e.toString(),10)].isBlack=!0,this.mModuleValue[6][parseInt(e.toString(),10)].isFilled=!0,this.mModuleValue[6][e+1].isBlack=!1,this.mModuleValue[6][e+1].isFilled=!0;this.mModuleValue[this.mNoOfModules-8][8].isBlack=!0,this.mModuleValue[this.mNoOfModules-8][8].isFilled=!0},nLi.prototype.initialize=function(){this.mIsUserMentionedMode||(this.chooseDefaultMode=!0),this.mVersion=this.mVersion||1,this.mErrorCorrectionLevel=this.mErrorCorrectionLevel||7;for(var e,t,i,n,o="NumericMode",r=0;r<this.text.length;r++)if(!(this.text.charCodeAt(r)<58&&47<this.text.charCodeAt(r))){if(!(this.text.charCodeAt(r)<91&&64<this.text.charCodeAt(r)||"$"===this.text[parseInt(r.toString(),10)]||"%"===this.text[parseInt(r.toString(),10)]||"*"===this.text[parseInt(r.toString(),10)]||"+"===this.text[parseInt(r.toString(),10)]||"-"===this.text[parseInt(r.toString(),10)]||"."===this.text[parseInt(r.toString(),10)]||"/"===this.text[parseInt(r.toString(),10)]||":"===this.text[parseInt(r.toString(),10)]||" "===this.text[parseInt(r.toString(),10)])){if(65377<=this.text.charCodeAt(r)&&this.text.charCodeAt(r)<=65439||97<=this.text.charCodeAt(r)&&this.text.charCodeAt(r)<=122){o="BinaryMode";break}o="BinaryMode",this.mIsEci=!0;break}o="AlphaNumericMode"}if(this.mIsUserMentionedMode&&o!==this.mInputMode&&(("AlphaNumericMode"===o||"BinaryMode"===o)&&"NumericMode"===this.mInputMode||"BinaryMode"===o&&"AlphaNumericMode"===this.mInputMode)&&(this.validInput=!1,o!==this.mInputMode)&&(("AlphaNumericMode"===o||"BinaryMode"===o)&&"NumericMode"===this.mInputMode||"BinaryMode"===o&&"AlphaNumericMode"===this.mInputMode)&&(this.validInput=!1),this.inputMode=o,!0===this.mIsEci)for(r=0;r<this.text.length;r++)32<=this.text.charCodeAt(r)&&this.text.charCodeAt(r);if(this.mixVersionERC)if(!this.mIsUserMentionedVersion||this.mVersion&hBi.Auto){var s=null;if(this.mIsUserMentionedErrorCorrectionLevel)switch(this.mInputMode){case"NumericMode":switch(this.mErrorCorrectionLevel){case 7:s=this.mQrBarcodeValues.numericDataCapacityLow;break;case 15:s=this.mQrBarcodeValues.numericDataCapacityMedium;break;case 25:s=this.mQrBarcodeValues.numericDataCapacityQuartile;break;case 30:s=this.mQrBarcodeValues.numericDataCapacityHigh}break;case"AlphaNumericMode":switch(this.mErrorCorrectionLevel){case 7:s=this.mQrBarcodeValues.alphanumericDataCapacityLow;break;case 15:s=this.mQrBarcodeValues.alphanumericDataCapacityMedium;break;case 25:s=this.mQrBarcodeValues.alphanumericDataCapacityQuartile;break;case 30:s=this.mQrBarcodeValues.alphanumericDataCapacityHigh}break;case"BinaryMode":switch(this.mErrorCorrectionLevel){case 7:s=this.mQrBarcodeValues.binaryDataCapacityLow;break;case 15:s=this.mQrBarcodeValues.binaryDataCapacityMedium;break;case 25:s=this.mQrBarcodeValues.binaryDataCapacityQuartile;break;case 30:s=this.mQrBarcodeValues.binaryDataCapacityHigh}}else switch(this.mErrorCorrectionLevel=dBi.Medium,this.mInputMode){case"NumericMode":s=this.mQrBarcodeValues.numericDataCapacityMedium;break;case"AlphaNumericMode":s=this.mQrBarcodeValues.alphanumericDataCapacityMedium;break;case"BinaryMode":s=this.mQrBarcodeValues.binaryDataCapacityMedium}r=void 0;for(r=0;r<s.length&&!(s[parseInt(r.toString(),10)]>this.text.length);r++);this.version=r+1}else this.mIsUserMentionedVersion&&(this.mIsUserMentionedErrorCorrectionLevel?(e=0,"AlphaNumericMode"===this.mInputMode?e=this.mQrBarcodeValues.getAlphanumericDataCapacity(this.mVersion,this.mErrorCorrectionLevel):"NumericMode"===this.mInputMode&&(e=this.mQrBarcodeValues.getNumericDataCapacity(this.mVersion,this.mErrorCorrectionLevel)),(e="BinaryMode"===this.mInputMode?this.mQrBarcodeValues.getBinaryDataCapacity(this.mVersion,this.mErrorCorrectionLevel):e)<this.text.length&&(this.chooseDefaultMode?this.mixVersionERC=!1:this.validInput=!1)):(n=i=t=e=0,"AlphaNumericMode"===this.mInputMode?(e=this.mQrBarcodeValues.getAlphanumericDataCapacity(this.mVersion,dBi.Low),t=this.mQrBarcodeValues.getAlphanumericDataCapacity(this.mVersion,dBi.Medium),i=this.mQrBarcodeValues.getAlphanumericDataCapacity(this.mVersion,dBi.Quartile),n=this.mQrBarcodeValues.getAlphanumericDataCapacity(this.mVersion,dBi.High)):"NumericMode"===this.mInputMode?(e=this.mQrBarcodeValues.getNumericDataCapacity(this.mVersion,dBi.Low),t=this.mQrBarcodeValues.getNumericDataCapacity(this.mVersion,dBi.Medium),i=this.mQrBarcodeValues.getNumericDataCapacity(this.mVersion,dBi.Quartile),n=this.mQrBarcodeValues.getNumericDataCapacity(this.mVersion,dBi.High)):"BinaryMode"===this.mInputMode&&(e=this.mQrBarcodeValues.getBinaryDataCapacity(this.mVersion,dBi.Low),t=this.mQrBarcodeValues.getBinaryDataCapacity(this.mVersion,dBi.Medium),i=this.mQrBarcodeValues.getBinaryDataCapacity(this.mVersion,dBi.Quartile),n=this.mQrBarcodeValues.getBinaryDataCapacity(this.mVersion,dBi.High)),n>this.text.length?this.mErrorCorrectionLevel=dBi.High:i>this.text.length?this.mErrorCorrectionLevel=dBi.Quartile:t>this.text.length?this.mErrorCorrectionLevel=dBi.Medium:e>this.text.length?this.mErrorCorrectionLevel=dBi.Low:this.validInput=!1))},nLi.prototype.addQuietZone=function(){for(var e=aBi.All,t=this.mNoOfModules+2*e,i=this.mNoOfModules+2*e,n=[],o=[],r=0;r<t;r++){n.push([0]),o.push([0]);for(var s=0;s<i;s++)n[parseInt(r.toString(),10)][parseInt(s.toString(),10)]=new oLi,o[parseInt(r.toString(),10)][parseInt(s.toString(),10)]=new oLi}for(r=0;r<i;r++)n[0][parseInt(r.toString(),10)]=new oLi,n[0][parseInt(r.toString(),10)].isBlack=!1,n[0][parseInt(r.toString(),10)].isFilled=!1,n[0][parseInt(r.toString(),10)].isPdp=!1,o[0][parseInt(r.toString(),10)]=new oLi,o[0][parseInt(r.toString(),10)].isBlack=!1,o[0][parseInt(r.toString(),10)].isFilled=!1,o[0][parseInt(r.toString(),10)].isPdp=!1;for(r=e;r<t-e;r++){n[parseInt(r.toString(),10)][0]=new oLi,n[parseInt(r.toString(),10)][0].isBlack=!1,n[parseInt(r.toString(),10)][0].isFilled=!1,n[parseInt(r.toString(),10)][0].isPdp=!1,o[parseInt(r.toString(),10)][0]=new oLi,o[parseInt(r.toString(),10)][0].isBlack=!1,o[parseInt(r.toString(),10)][0].isFilled=!1,o[parseInt(r.toString(),10)][0].isPdp=!1;for(s=e;s<i-e;s++)n[parseInt(r.toString(),10)][parseInt(s.toString(),10)]=this.mModuleValue[r-e][s-e],o[parseInt(r.toString(),10)][parseInt(s.toString(),10)]=this.mDataAllocationValues[r-e][s-e];n[parseInt(r.toString(),10)][i-e]=new oLi,n[parseInt(r.toString(),10)][i-e].isBlack=!1,n[parseInt(r.toString(),10)][i-e].isFilled=!1,n[parseInt(r.toString(),10)][i-e].isPdp=!1,o[parseInt(r.toString(),10)][i-e]=new oLi,o[parseInt(r.toString(),10)][i-e].isBlack=!1,o[parseInt(r.toString(),10)][i-e].isFilled=!1,o[parseInt(r.toString(),10)][i-e].isPdp=!1}for(r=0;r<i;r++)n[t-e][parseInt(r.toString(),10)]=new oLi,n[t-e][parseInt(r.toString(),10)].isBlack=!1,n[t-e][parseInt(r.toString(),10)].isFilled=!1,n[t-e][parseInt(r.toString(),10)].isPdp=!1,o[t-e][parseInt(r.toString(),10)]=new oLi,o[t-e][parseInt(r.toString(),10)].isBlack=!1,o[t-e][parseInt(r.toString(),10)].isFilled=!1,o[t-e][parseInt(r.toString(),10)].isPdp=!1;this.mModuleValue=n,this.mDataAllocationValues=o},nLi.prototype.drawFormatInformation=function(){for(var e=this.mQrBarcodeValues.FormatInformation,t=0,i=0;i<7;i++)6===i?this.mModuleValue[i+1][8].isBlack=1===e[parseInt(t.toString(),10)]:this.mModuleValue[parseInt(i.toString(),10)][8].isBlack=1===e[parseInt(t.toString(),10)],this.mModuleValue[8][this.mNoOfModules-i-1].isBlack=1===e[t++];for(t=14,i=0;i<7;i++)6===i?this.mModuleValue[8][i+1].isBlack=1===e[parseInt(t.toString(),10)]:this.mModuleValue[8][parseInt(i.toString(),10)].isBlack=1===e[parseInt(t.toString(),10)],this.mModuleValue[this.mNoOfModules-i-1][8].isBlack=1===e[t--];this.mModuleValue[8][8].isBlack=1===e[7],this.mModuleValue[8][this.mNoOfModules-8].isBlack=1===e[7]},nLi.prototype.dataAllocationAndMasking=function(e){this.mDataAllocationValues=[];for(var t=0;t<this.mNoOfModules;t++){this.mDataAllocationValues.push([0]);for(var i=0;i<this.mNoOfModules;i++)this.mDataAllocationValues[parseInt(t.toString(),10)][parseInt(i.toString(),10)]=new oLi}for(var n=0,t=this.mNoOfModules-1;0<=t;t-=2){for(i=this.mNoOfModules-1;0<=i;i--)this.mModuleValue[parseInt(t.toString(),10)][parseInt(i.toString(),10)].isFilled&&this.mModuleValue[t-1][parseInt(i.toString(),10)].isFilled||(this.mModuleValue[parseInt(t.toString(),10)][parseInt(i.toString(),10)].isFilled||(n+1<e.length&&(this.mDataAllocationValues[parseInt(t.toString(),10)][parseInt(i.toString(),10)].isBlack=e[n++]),this.mDataAllocationValues[parseInt(t.toString(),10)][parseInt(i.toString(),10)].isBlack=(t+i)%3==0?!!this.mDataAllocationValues[parseInt(t.toString(),10)][parseInt(i.toString(),10)].isBlack:!this.mDataAllocationValues[parseInt(t.toString(),10)][parseInt(i.toString(),10)].isBlack,this.mDataAllocationValues[parseInt(t.toString(),10)][parseInt(i.toString(),10)].isFilled=!0),this.mModuleValue[t-1][parseInt(i.toString(),10)].isFilled)||(n+1<e.length&&(this.mDataAllocationValues[t-1][parseInt(i.toString(),10)].isBlack=e[n++]),this.mDataAllocationValues[t-1][parseInt(i.toString(),10)].isBlack=(t-1+i)%3==0?!!this.mDataAllocationValues[t-1][parseInt(i.toString(),10)].isBlack:!this.mDataAllocationValues[t-1][parseInt(i.toString(),10)].isBlack,this.mDataAllocationValues[t-1][parseInt(i.toString(),10)].isFilled=!0);6===(t-=2)&&t--;for(var o=0;o<this.mNoOfModules;o++)this.mModuleValue[parseInt(t.toString(),10)][parseInt(o.toString(),10)].isFilled&&this.mModuleValue[t-1][parseInt(o.toString(),10)].isFilled||(this.mModuleValue[parseInt(t.toString(),10)][parseInt(o.toString(),10)].isFilled||(n+1<e.length&&(this.mDataAllocationValues[parseInt(t.toString(),10)][parseInt(o.toString(),10)].isBlack=e[n++]),this.mDataAllocationValues[parseInt(t.toString(),10)][parseInt(o.toString(),10)].isBlack=(t+o)%3!=0?!this.mDataAllocationValues[parseInt(t.toString(),10)][parseInt(o.toString(),10)].isBlack:!!this.mDataAllocationValues[parseInt(t.toString(),10)][parseInt(o.toString(),10)].isBlack,this.mDataAllocationValues[parseInt(t.toString(),10)][parseInt(o.toString(),10)].isFilled=!0),this.mModuleValue[t-1][parseInt(o.toString(),10)].isFilled)||(n+1<e.length&&(this.mDataAllocationValues[t-1][parseInt(o.toString(),10)].isBlack=e[n++]),this.mDataAllocationValues[t-1][parseInt(o.toString(),10)].isBlack=(t-1+o)%3!=0?!this.mDataAllocationValues[t-1][parseInt(o.toString(),10)].isBlack:!!this.mDataAllocationValues[t-1][parseInt(o.toString(),10)].isBlack,this.mDataAllocationValues[t-1][parseInt(o.toString(),10)].isFilled=!0)}for(t=0;t<this.mNoOfModules;t++)for(var r,i=0;i<this.mNoOfModules;i++)this.mModuleValue[parseInt(t.toString(),10)][parseInt(i.toString(),10)].isFilled||(r=this.mDataAllocationValues[parseInt(t.toString(),10)][parseInt(i.toString(),10)].isBlack,this.mDataAllocationValues[parseInt(t.toString(),10)][parseInt(i.toString(),10)].isBlack=!r)},nLi.prototype.allocateFormatAndVersionInformation=function(){for(var e=0;e<9;e++)this.mModuleValue[8][parseInt(e.toString(),10)].isFilled=!0,this.mModuleValue[parseInt(e.toString(),10)][8].isFilled=!0;for(e=this.mNoOfModules-8;e<this.mNoOfModules;e++)this.mModuleValue[8][parseInt(e.toString(),10)].isFilled=!0,this.mModuleValue[parseInt(e.toString(),10)][8].isFilled=!0;if(6<this.mVersion)for(var t=this.mQrBarcodeValues.VersionInformation,i=0,e=0;e<6;e++)for(var n=2;0<=n;n--)this.mModuleValue[parseInt(e.toString(),10)][this.mNoOfModules-9-n].isBlack=1===t[parseInt(i.toString(),10)],this.mModuleValue[parseInt(e.toString(),10)][this.mNoOfModules-9-n].isFilled=!0,this.mModuleValue[this.mNoOfModules-9-n][parseInt(e.toString(),10)].isBlack=1===t[i++],this.mModuleValue[this.mNoOfModules-9-n][parseInt(e.toString(),10)].isFilled=!0},nLi.prototype.drawAlignmentPattern=function(e,t){for(var i=e-2,n=t-2;i<e+3;i++,n++)this.mModuleValue[parseInt(i.toString(),10)][t-2].isBlack=!0,this.mModuleValue[parseInt(i.toString(),10)][t-2].isFilled=!0,this.mModuleValue[parseInt(i.toString(),10)][t+2].isBlack=!0,this.mModuleValue[parseInt(i.toString(),10)][t+2].isFilled=!0,this.mModuleValue[e-2][parseInt(n.toString(),10)].isBlack=!0,this.mModuleValue[e-2][parseInt(n.toString(),10)].isFilled=!0,this.mModuleValue[e+2][parseInt(n.toString(),10)].isBlack=!0,this.mModuleValue[e+2][parseInt(n.toString(),10)].isFilled=!0;for(i=e-1,n=t-1;i<e+2;i++,n++)this.mModuleValue[parseInt(i.toString(),10)][t-1].isBlack=!1,this.mModuleValue[parseInt(i.toString(),10)][t-1].isFilled=!0,this.mModuleValue[parseInt(i.toString(),10)][t+1].isBlack=!1,this.mModuleValue[parseInt(i.toString(),10)][t+1].isFilled=!0,this.mModuleValue[e-1][parseInt(n.toString(),10)].isBlack=!1,this.mModuleValue[e-1][parseInt(n.toString(),10)].isFilled=!0,this.mModuleValue[e+1][parseInt(n.toString(),10)].isBlack=!1,this.mModuleValue[e+1][parseInt(n.toString(),10)].isFilled=!0;this.mModuleValue[parseInt(e.toString(),10)][parseInt(t.toString(),10)].isBlack=!0,this.mModuleValue[parseInt(e.toString(),10)][parseInt(t.toString(),10)].isFilled=!0},nLi.prototype.getAlignmentPatternCoOrdinates=function(){var e=null;switch(this.mVersion){case 2:e=[6,18];break;case 3:e=[6,22];break;case 4:e=[6,26];break;case 5:e=[6,30];break;case 6:e=[6,34];break;case 7:e=[6,22,38];break;case 8:e=[6,24,42];break;case 9:e=[6,26,46];break;case 10:e=[6,28,50];break;case 11:e=[6,30,54];break;case 12:e=[6,32,58];break;case 13:e=[6,34,62];break;case 14:e=[6,26,46,66];break;case 15:e=[6,26,48,70];break;case 16:e=[6,26,50,74];break;case 17:e=[6,30,54,78];break;case 18:e=[6,30,56,82];break;case 19:e=[6,30,58,86];break;case 20:e=[6,34,62,90];break;case 21:e=[6,28,50,72,94];break;case 22:e=[6,26,50,74,98];break;case 23:e=[6,30,54,78,102];break;case 24:e=[6,28,54,80,106];break;case 25:e=[6,32,58,84,110];break;case 26:e=[6,30,58,86,114];break;case 27:e=[6,34,62,90,118];break;case 28:e=[6,26,50,74,98,122];break;case 29:e=[6,30,54,78,102,126];break;case 30:e=[6,26,52,78,104,130];break;case 31:e=[6,30,56,82,108,134];break;case 32:e=[6,34,60,86,112,138];break;case 33:e=[6,30,58,86,114,142];break;case 34:e=[6,34,62,90,118,146];break;case 35:e=[6,30,54,78,102,126,150];break;case 36:e=[6,24,50,76,102,128,154];break;case 37:e=[6,28,54,80,106,132,158];break;case 38:e=[6,32,58,84,110,136,162];break;case 39:e=[6,26,54,82,110,138,166];break;case 40:e=[6,30,58,86,114,142,170]}return e},nLi.prototype.encodeData=function(){var e=[];switch(this.mInputMode){case"NumericMode":e.push(!1),e.push(!1),e.push(!1),e.push(!0);break;case"AlphaNumericMode":e.push(!1),e.push(!1),e.push(!0),e.push(!1);break;case"BinaryMode":if(this.mIsEci){e.push(!1),e.push(!0),e.push(!0),e.push(!0);for(var t=this.stringToBoolArray(this.mEciAssignmentNumber.toString(),8),i=0,n=Object.keys(t);i<n.length;i++){var o=n[i];e.push(t[""+o])}}e.push(!1),e.push(!0),e.push(!1),e.push(!1)}var r=0;if(this.mVersion<10)switch(this.mInputMode){case"NumericMode":r=10;break;case"AlphaNumericMode":r=9;break;case"BinaryMode":r=8}else if(this.mVersion<27)switch(this.mInputMode){case"NumericMode":r=12;break;case"AlphaNumericMode":r=11;break;case"BinaryMode":r=16}else switch(this.mInputMode){case"NumericMode":r=14;break;case"AlphaNumericMode":r=13;break;case"BinaryMode":r=16}for(var s=this.intToBoolArray(this.text.length,r),a=0;a<r;a++)e.push(s[parseInt(a.toString(),10)]);if("NumericMode"===this.mInputMode)for(var l=this.text.split(""),h="",a=0;a<l.length;a++){t=void 0;if(h+=l[parseInt(a.toString(),10)],a%3==2&&0!==a||a===l.length-1){t=3===h.toString().length?this.stringToBoolArray(h,10):2===h.toString().length?this.stringToBoolArray(h,7):this.stringToBoolArray(h,4),h="";for(var d=0,p=Object.keys(t);d<p.length;d++){o=p[d];e.push(t[""+o])}}}else if("AlphaNumericMode"===this.mInputMode)for(var l=this.text.split(""),c="",h=0,a=0;a<l.length;a++){t=void 0;if(c+=l[parseInt(a.toString(),10)],a%2==0&&a+1!==l.length&&(h=45*this.mQrBarcodeValues.getAlphaNumericValues(l[parseInt(a.toString(),10)])),a%2==1&&0!==a){h+=this.mQrBarcodeValues.getAlphaNumericValues(l[parseInt(a.toString(),10)]),t=this.intToBoolArray(h,11);for(var u=h=0,g=Object.keys(t);u<g.length;u++){o=g[u];e.push(t[""+o])}c=""}if(1!==a&&""!==c&&a+1===l.length&&1===c.length){h=this.mQrBarcodeValues.getAlphaNumericValues(l[parseInt(a.toString(),10)]),t=this.intToBoolArray(h,6);for(var m=h=0,f=Object.keys(t);m<f.length;m++){o=f[m];e.push(t[""+o])}}}else if("BinaryMode"===this.mInputMode)for(l=this.text.split(""),a=0;a<l.length;a++)for(var h=0,t=(32<=this.text.charCodeAt(a)&&this.text.charCodeAt(a)<=126||161<=this.text.charCodeAt(a)&&this.text.charCodeAt(a)<=255||10===this.text.charCodeAt(a)||13===this.text.charCodeAt(a)?h=l[parseInt(a.toString(),10)].charCodeAt(0):65377<=this.text.charCodeAt(a)&&this.text.charCodeAt(a)<=65439?h=l[parseInt(a.toString(),10)].charCodeAt(0)-65216:1025<=this.text.charCodeAt(a)&&this.text.charCodeAt(a)<=1119?h=l[parseInt(a.toString(),10)].charCodeAt(0)-864:this.validInput=!1,this.intToBoolArray(h,8)),y=0,v=Object.keys(t);y<v.length;y++){o=v[y];e.push(t[o])}if(0===this.mixDataCount){for(a=0;a<4&&e.length/8!==this.mQrBarcodeValues.NumberOfDataCodeWord;a++)e.push(!1);for(;e.length%8!=0;)e.push(!1);for(;e.length/8!==this.mQrBarcodeValues.NumberOfDataCodeWord&&(e.push(!0),e.push(!0),e.push(!0),e.push(!1),e.push(!0),e.push(!0),e.push(!1),e.push(!1),e.length/8!==this.mQrBarcodeValues.NumberOfDataCodeWord);)e.push(!1),e.push(!1),e.push(!1),e.push(!0),e.push(!1),e.push(!1),e.push(!1),e.push(!0);this.mQrBarcodeValues.NumberOfDataCodeWord;var b=this.mQrBarcodeValues.NumberOfErrorCorrectionBlocks,w=b[0],C=(6===b.length&&(w=b[0]+b[3]),[]),S=e;if(6===b.length)for(var A=b[0]*b[2]*8,S=[],a=0;a<A;a++)S.push(e[parseInt(a.toString(),10)]);for(var x=this.createBlocks(S,b[0]),a=0;a<b[0];a++)C[parseInt(a.toString(),10)]=this.splitCodeWord(x,a,S.length/8/b[0]);if(6===b.length){S=[];for(a=b[0]*b[2]*8;a<e.length;a++)S.push(e[parseInt(a.toString(),10)]);for(var I=this.createBlocks(S,b[3]),a=b[0],T=0;a<w;a++)C[parseInt(a.toString(),10)]=this.splitCodeWord(I,T++,S.length/8/b[3])}e=null;for(e=[],a=0;a<125;a++)for(var E=0;E<w;E++)for(var D=0;D<8;D++)a<C[parseInt(E.toString(),10)].length&&e.push("1"===C[parseInt(E.toString(),10)][parseInt(a.toString(),10)][parseInt(D.toString(),10)]);var M=new eLi(this.mVersion,this.mErrorCorrectionLevel),k=this.mQrBarcodeValues.NumberOfDataCodeWord,P=this.mQrBarcodeValues.NumberOfErrorCorrectingCodeWords;6===(b=this.mQrBarcodeValues.NumberOfErrorCorrectionBlocks).length?M.DataBits=(k-b[3]*b[5])/b[0]:M.DataBits=k/b[0],M.Eccw=P/w;for(var B=[],F=0,a=0;a<b[0];a++)M.DC=C[parseInt(F.toString(),10)],B[F++]=M.getErcw();if(6===b.length){M.DataBits=(k-b[0]*b[2])/b[3];for(a=0;a<b[3];a++)M.DC=C[parseInt(F.toString(),10)],B[F++]=M.getErcw()}if(6!==b.length)for(a=0;a<B[0].length;a++)for(E=0;E<b[0];E++)for(D=0;D<8;D++)a<B[parseInt(E.toString(),10)].length&&e.push("1"===B[parseInt(E.toString(),10)][parseInt(a.toString(),10)][parseInt(D.toString(),10)]);else for(a=0;a<B[0].length;a++)for(E=0;E<w;E++)for(D=0;D<8;D++)a<B[parseInt(E.toString(),10)].length&&e.push("1"===B[parseInt(E.toString(),10)][parseInt(a.toString(),10)][parseInt(D.toString(),10)])}return e},nLi.prototype.stringToBoolArray=function(e,t){for(var i=[],n=e.split(""),o=0,r=0;r<n.length;r++)o=10*o+n[parseInt(r.toString(),10)].charCodeAt(0)-48;for(r=0;r<t;r++)i[t-r-1]=1==(o>>r&1);return i},nLi.prototype.intToBoolArray=function(e,t){for(var i=[],n=0;n<t;n++)i[t-n-1]=1==(e>>n&1);return i},nLi.prototype.splitCodeWord=function(e,t,i){for(var n=[],o=0;o<i;o++)n.push(e[parseInt(t.toString(),10)][parseInt(o.toString(),10)]);return n},nLi.prototype.createBlocks=function(e,t){for(var i=[],n=e.length/8/t,o="",r=0,s=0,a=0;a<t;a++){i.push([0]);for(var l=0;l<n;l++)i[parseInt(a.toString(),10)][parseInt(l.toString(),10)]=""}for(l=0;l<e.length;l++)l%8==0&&0!==l&&(i[parseInt(s.toString(),10)][parseInt(r.toString(),10)]=o,o="",++r===e.length/t/8)&&(s++,r=0),o+=e[parseInt(l.toString(),10)]?"1":"0";return i[parseInt(s.toString(),10)][parseInt(r.toString(),10)]=o,i};var iLi=nLi;function nLi(){this.mVersion=hBi.Version01,this.mInputMode="NumericMode",this.validInput=!0,this.totalBits=0,this.mModuleValue=[],this.mDataAllocationValues=[[],[]],this.mixVersionERC=!0,this.mixExecutablePart=null,this.mixDataCount=0,this.mNoOfModules=21,this.mIsUserMentionedMode=!1,this.chooseDefaultMode=!1,this.mixRemainingPart=null,this.isXdimension=!1,this.mXDimension=1,this.mIsEci=!1,this.mIsUserMentionedErrorCorrectionLevel=!1,this.mEciAssignmentNumber=3,this.mIsUserMentionedVersion=!1,this.mErrorCorrectionLevel=dBi.Low,this.textList=[],this.mode=[]}var oLi=function(){this.isBlack=!1,this.isFilled=!1,this.isPdp=!1};rLi=function(e,t){return(rLi=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])}))(e,t)};var rLi,sLi,e_=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Qg=(function(e,t){function i(){this.constructor=e}rLi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(aLi,sLi=n),e_([e("")],aLi.prototype,"imageSource",void 0),e_([e(0)],aLi.prototype,"width",void 0),e_([e(0)],aLi.prototype,"height",void 0),aLi);function aLi(){return null!==sLi&&sLi.apply(this,arguments)||this}lLi=function(e,t){return(lLi=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])}))(e,t)};var lLi,hLi,$H=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},dLi=(function(e,t){function i(){this.constructor=e}lLi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(pLi,hLi=Ji),pLi.prototype.render=function(){this.notify("initial-load",{}),this.trigger("load"),this.notify("initial-end",{}),this.renderElements(),this.renderComplete()},pLi.prototype.triggerEvent=function(e,t){this.trigger(sBi[""+e],{message:t})},pLi.prototype.renderElements=function(){var e=new iLi,t=(this.value=this.value||"",e.text=this.value,e.XDimension=this.xDimension,e.mIsUserMentionedErrorCorrectionLevel=void 0!==this.errorCorrectionLevel,e.mErrorCorrectionLevel=void 0!==this.errorCorrectionLevel?this.errorCorrectionLevel:dBi.Medium,e.version=void 0!==this.version?this.version:void 0,e.mIsUserMentionedVersion=void 0!==this.version,"SVG"===this.mode),e=e.draw(this.value,this.barcodeCanvas,this.element.offsetHeight,this.element.offsetWidth,this.margin,this.displayText,t,this.foreColor,this.logo);"Canvas"===this.mode&&(this.barcodeCanvas.getContext("2d").setTransform(1,0,0,1,0,0),this.barcodeCanvas.getContext("2d").scale(1.5,1.5)),e||this.triggerEvent(sBi.invalid,"Invalid Input"),"Canvas"===this.mode&&(this.barcodeCanvas.style.transform="scale("+2/3+")",this.barcodeCanvas.style.transformOrigin="0 0")},pLi.prototype.setCulture=function(){this.localeObj=new Cn(this.getModuleName(),this.defaultLocale,this.locale)},pLi.prototype.getElementSize=function(e,t){e=0<e.toString().indexOf("px")||0<e.toString().indexOf("%")?e.toString():e.toString()+"px";return e},pLi.prototype.initialize=function(){this.width||(this.width="100px"),this.height&&"100%"!==this.height||(this.height="100px"),this.element.style.display="block",this.element.style.height=this.getElementSize(this.height),this.element.style.width=this.getElementSize(this.width),this.barcodeCanvas=this.barcodeRenderer.renderRootElement({id:this.element.id+"content",height:"SVG"===this.mode?this.element.offsetHeight:1.5*this.element.offsetHeight,width:"SVG"===this.mode?this.element.offsetWidth:1.5*this.element.offsetWidth},this.backgroundColor,this.element.offsetWidth,this.element.offsetHeight),this.element.appendChild(this.barcodeCanvas)},pLi.prototype.preRender=function(){this.element.classList.add("e-qrcode"),this.barcodeRenderer=new SBi(this.element.id,"SVG"===this.mode),this.initialize(),this.initializePrivateVariables(),this.setCulture()},pLi.prototype.getPersistData=function(){return this.addOnPersist(["loaded"])},pLi.prototype.getModuleName=function(){return"QRCodeGenerator"},pLi.prototype.destroy=function(){this.notify("destroy",{}),hLi.prototype.destroy.call(this);var e=document.getElementById(this.element.id+"content");e&&this.element.removeChild(e)},pLi.prototype.initializePrivateVariables=function(){this.defaultLocale={}},pLi.prototype.exportImage=function(e,t){QFi(t,e,this.element,!1,this)},pLi.prototype.exportAsBase64Image=function(e){return QFi(e,"",this.element,!0,this)},pLi.prototype.onPropertyChanged=function(e,t){var i,n;"Canvas"===this.mode&&"Canvas"!==e.mode?WFi(this,this.barcodeCanvas):this.barcodeRenderer=zFi(e,this.barcodeCanvas,this.mode,this.element.id),e.width&&("Canvas"===this.mode&&"Canvas"!==e.mode&&(this.widthChange=!0),i="Canvas"===this.mode&&"Canvas"!==e.mode?1.5*e.width:e.width,this.barcodeCanvas.setAttribute("width",String(i))),e.height&&("Canvas"===this.mode&&"Canvas"!==e.mode&&(this.heightChange=!0),n="Canvas"===this.mode&&"Canvas"!==e.mode?1.5*e.height:e.height,this.barcodeCanvas.setAttribute("height",String(n)));for(var o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"width":this.element.style.width=this.getElementSize(i),this.barcodeCanvas.setAttribute("width",String(this.element.offsetWidth));break;case"height":this.element.style.height=this.getElementSize(n),this.barcodeCanvas.setAttribute("height",String(this.element.offsetHeight));break;case"backgroundColor":this.barcodeCanvas.style.background=e.backgroundColor;break;case"mode":this.initialize()}this.renderElements()},$H([e("100%")],pLi.prototype,"height",void 0),$H([t({},Qg)],pLi.prototype,"logo",void 0),$H([e("100%")],pLi.prototype,"width",void 0),$H([e("SVG")],pLi.prototype,"mode",void 0),$H([e(1)],pLi.prototype,"xDimension",void 0),$H([e()],pLi.prototype,"errorCorrectionLevel",void 0),$H([t({},HNt)],pLi.prototype,"margin",void 0),$H([e("white")],pLi.prototype,"backgroundColor",void 0),$H([i()],pLi.prototype,"invalid",void 0),$H([e("black")],pLi.prototype,"foreColor",void 0),$H([t({},qOt)],pLi.prototype,"displayText",void 0),$H([e()],pLi.prototype,"version",void 0),$H([e(void 0)],pLi.prototype,"value",void 0),pLi);function pLi(e,t){e=hLi.call(this,e,t)||this;return e.widthChange=!1,e.heightChange=!1,e}Object.defineProperty(uLi.prototype,"XDimension",{set:function(e){this.mXDimension=e},enumerable:!0,configurable:!0}),uLi.prototype.GetData=function(){for(var e=this.value,t=[],i=0;i<e.length;i++)t.push(e.charCodeAt(i));return t},uLi.prototype.fillZero=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)]=0;return e},uLi.prototype.DataMatrixNumericEncoder=function(e){for(var t=e,i=!0,n=(t.length%2==1&&(i=!1,t=Array(e.length+1),t=this.fillZero(t),t=this.copy(e,0,t,0,e.length)),Array(t.length/2)),n=this.fillZero(n),o=0;o<n.length;o++)i||o!==n.length-1?n[parseInt(o.toString(),10)]=10*(t[2*o]-48)+(t[2*o+1]-48)+130:n[parseInt(o.toString(),10)]=t[2*o]+1;return n},uLi.prototype.ComputeBase256Codeword=function(e,t){e+=149*(t+1)%255+1;return e<=255?e:e-256},uLi.prototype.DataMatrixBaseEncoder=function(e){var t=1,i=(249<e.length&&t++,Array(1+t+e.length));(i=this.fillZero(i))[0]=231,e.length<=249?i[1]=e.length:(i[1]=e.length/250+249,i[2]=e.length%250),i=this.copy(e,0,i,1+t,e.length);for(var n=1;n<i.length;n++)i[parseInt(n.toString(),10)]=this.ComputeBase256Codeword(i[parseInt(n.toString(),10)],n);return i},uLi.prototype.copy=function(e,t,i,n,o){for(var r=0;r<o;r++)i[n+r]=e[t+r];return i},uLi.prototype.DataMatrixEncoder=function(e){for(var t,i,n,o=new Array(e.length),r=0,s=0;s<e.length;s++)48<=e[parseInt(s.toString(),10)]&&e[parseInt(s.toString(),10)]<=57?((t=0)!==s&&(t=r-1),i=o[parseInt(t.toString(),10)]-1,235!==(n=(n=0)!==s&&1!==r?o[t-1]:n)&&48<=i&&i<=57?o[parseInt(t.toString(),10)]=10*(i-48)+(e[parseInt(s.toString(),10)]-48)+130:(o[parseInt(r.toString(),10)]=e[parseInt(s.toString(),10)]+1,r++)):(e[parseInt(s.toString(),10)]<127?o[parseInt(r.toString(),10)]=e[parseInt(s.toString(),10)]+1:o[parseInt(r.toString(),10)]=e[parseInt(s.toString(),10)]-127,r++);for(var a=Array(r),a=this.fillZero(a),s=0;s<r;s++)a[parseInt(s.toString(),10)]=o[parseInt(s.toString(),10)];return a},uLi.prototype.PrepareDataCodeword=function(e){if("Auto"===this.encodingValue||"ASCIINumeric"===this.encodingValue){for(var t=!0,i=e,n="ASCII",o=0;o<i.length;o++)(i[parseInt(o.toString(),10)]<48||57<i[parseInt(o.toString(),10)])&&(t=!1);if(t&&(n="ASCIINumeric"),"ASCIINumeric"===this.encodingValue&&this.encodingValue!==n)return"Data contains invalid characters and cannot be encoded as ASCIINumeric.";this.encodingValue=n}var r=[];switch(this.encodingValue){case"ASCII":r=this.DataMatrixEncoder(e);break;case"ASCIINumeric":r=this.DataMatrixNumericEncoder(e);break;case"Base256":r=this.DataMatrixBaseEncoder(e)}return r},uLi.prototype.PdfDataMatrixSymbolAttribute=function(e,t,i,n,o,r,s,a){return{SymbolRow:e,SymbolColumn:t,HorizontalDataRegion:i,VerticalDataRegion:n,DataCodewords:o,CorrectionCodewords:r,InterleavedBlock:s,InterleavedDataBlock:a}},uLi.prototype.getmSymbolAttributes=function(){var e=[];return e.push(this.PdfDataMatrixSymbolAttribute(10,10,1,1,3,5,1,3)),e.push(this.PdfDataMatrixSymbolAttribute(12,12,1,1,5,7,1,5)),e.push(this.PdfDataMatrixSymbolAttribute(14,14,1,1,8,10,1,8)),e.push(this.PdfDataMatrixSymbolAttribute(16,16,1,1,12,12,1,12)),e.push(this.PdfDataMatrixSymbolAttribute(18,18,1,1,18,14,1,18)),e.push(this.PdfDataMatrixSymbolAttribute(20,20,1,1,22,18,1,22)),e.push(this.PdfDataMatrixSymbolAttribute(22,22,1,1,30,20,1,30)),e.push(this.PdfDataMatrixSymbolAttribute(24,24,1,1,36,24,1,36)),e.push(this.PdfDataMatrixSymbolAttribute(26,26,1,1,44,28,1,44)),e.push(this.PdfDataMatrixSymbolAttribute(32,32,2,2,62,36,1,62)),e.push(this.PdfDataMatrixSymbolAttribute(36,36,2,2,86,42,1,86)),e.push(this.PdfDataMatrixSymbolAttribute(40,40,2,2,114,48,1,114)),e.push(this.PdfDataMatrixSymbolAttribute(44,44,2,2,144,56,1,144)),e.push(this.PdfDataMatrixSymbolAttribute(48,48,2,2,174,68,1,174)),e.push(this.PdfDataMatrixSymbolAttribute(52,52,2,2,204,84,2,102)),e.push(this.PdfDataMatrixSymbolAttribute(64,64,4,4,280,112,2,140)),e.push(this.PdfDataMatrixSymbolAttribute(72,72,4,4,368,144,4,92)),e.push(this.PdfDataMatrixSymbolAttribute(80,80,4,4,456,192,4,114)),e.push(this.PdfDataMatrixSymbolAttribute(88,88,4,4,576,224,4,144)),e.push(this.PdfDataMatrixSymbolAttribute(96,96,4,4,696,272,4,174)),e.push(this.PdfDataMatrixSymbolAttribute(104,104,4,4,816,336,6,136)),e.push(this.PdfDataMatrixSymbolAttribute(120,120,6,6,1050,408,6,175)),e.push(this.PdfDataMatrixSymbolAttribute(132,132,6,6,1304,496,8,163)),e.push(this.PdfDataMatrixSymbolAttribute(144,144,6,6,1558,620,10,156)),e.push(this.PdfDataMatrixSymbolAttribute(8,18,1,1,5,7,1,5)),e.push(this.PdfDataMatrixSymbolAttribute(8,32,2,1,10,11,1,10)),e.push(this.PdfDataMatrixSymbolAttribute(12,26,1,1,16,14,1,16)),e.push(this.PdfDataMatrixSymbolAttribute(12,36,2,1,22,18,1,22)),e.push(this.PdfDataMatrixSymbolAttribute(16,36,2,1,32,24,1,32)),e.push(this.PdfDataMatrixSymbolAttribute(16,48,2,1,49,28,1,49)),e},uLi.prototype.PadCodewords=function(e,t,i){for(var n=t.length,o=[],r=0;r<n;r++)o.push(t[parseInt(r.toString(),10)]);for(n<e&&o.push(129),n=o.length;n<e;){var s=129+149*(n+1)%253+1;254<s&&(s-=254),o.push(s),n=o.length}return Array(o.length),o},uLi.prototype.EccProduct=function(e,t){var i;return 0===e||0===t?0:(i=Array(256),i=this.CreateLogArrays(!0),Array(256),this.CreateLogArrays(!1)[(i[parseInt(e.toString(),10)]+i[parseInt(t.toString(),10)])%255])},uLi.prototype.validateInput=function(e,t){return e},uLi.prototype.ComputeErrorCorrection=function(){var e=this.encodedCodeword.length,t=(this.mSymbolAttribute=this.PdfDataMatrixSymbolAttribute(0,0,0,0,0,0,0,0),this.getmSymbolAttributes());if(this.size)this.mSymbolAttribute=t[this.size-1];else for(var t=this.getmSymbolAttributes(),i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];if(n.DataCodewords>=e){this.mSymbolAttribute=n;break}}if(this.mSymbolAttribute.DataCodewords>e)o=this.PadCodewords(this.mSymbolAttribute.DataCodewords,this.encodedCodeword,o),this.encodedCodeword=Array(o.length),this.encodedCodeword=o,e=this.encodedCodeword.length;else{if(0===this.mSymbolAttribute.DataCodewords)return this.validateInput("Data cannot be encoded as barcode",void 0);if(this.mSymbolAttribute.DataCodewords<e)return this.mSymbolAttribute.SymbolRow.toString(),this.mSymbolAttribute.SymbolColumn.toString(),"Data too long for {0}x{1} barcode."}for(var o=this.mSymbolAttribute.CorrectionCodewords,r=[],s=(r=this.create1DMatrixArray(o+this.mSymbolAttribute.DataCodewords,r),this.mSymbolAttribute.InterleavedBlock),a=this.mSymbolAttribute.DataCodewords,l=this.mSymbolAttribute.CorrectionCodewords/s,h=a+l*s,d=this.CreateRSPolynomial(s,this.mSymbolAttribute),p=[],p=this.create1DMatrixArray(68,p),c=0;c<s;c++){for(var u=0;u<p.length;u++)p[parseInt(u.toString(),10)]=0;for(i=c;i<a;i+=s){for(var g=this.EccSum(p[l-1],this.encodedCodeword[parseInt(i.toString(),10)]),m=l-1;0<m;m--)p[parseInt(m.toString(),10)]=this.EccSum(p[m-1],this.EccProduct(d[parseInt(m.toString(),10)],g));p[0]=this.EccProduct(d[0],g)}if(8<=c&&this.size&lBi.Size144x144)this.mSymbolAttribute.DataCodewords;else{for(var f=l,i=c+s*this.mSymbolAttribute.InterleavedDataBlock;i<h;i+=s)r[parseInt(i.toString(),10)]=p[--f];if(0!==f)return"Error in error correction code generation!"}}if(r.length>o){var y=r,r=[];r=this.create1DMatrixArray(o,r);for(var v=0,i=y.length-1;i>this.mSymbolAttribute.DataCodewords;i--)r[v++]=y[parseInt(i.toString(),10)]}return r.reverse()},uLi.prototype.CreateLogArrays=function(e){var t=Array(256),i=Array(256);t[0]=-255;for(var n=i[0]=1;n<=255;n++)i[parseInt(n.toString(),10)]=2*i[n-1],256<=i[parseInt(n.toString(),10)]&&(i[parseInt(n.toString(),10)]=301^i[parseInt(n.toString(),10)]),t[i[parseInt(n.toString(),10)]]=n;return e?t:i},uLi.prototype.EccSum=function(e,t){return e^t},uLi.prototype.EccDoublify=function(e,t){var i;return 0===e?0:0===t?e:(i=Array(256),i=this.CreateLogArrays(!0),Array(256),this.CreateLogArrays(!1)[(i[parseInt(e.toString(),10)]+t)%255])},uLi.prototype.CreateRSPolynomial=function(e,t){for(var i=Array(69),n=t.CorrectionCodewords/e,o=0;o<i.length;o++)i[parseInt(o.toString(),10)]=1;for(o=1;o<=n;o++)for(var r=o-1;0<=r;r--)i[parseInt(r.toString(),10)]=this.EccDoublify(i[parseInt(r.toString(),10)],o),0<r&&(i[parseInt(r.toString(),10)]=this.EccSum(i[parseInt(r.toString(),10)],i[r-1]));return i},uLi.prototype.PrepareCodeword=function(e){if(this.encodedCodeword=this.PrepareDataCodeword(e),isNaN(this.encodedCodeword[0]))return this.encodedCodeword;e=this.ComputeErrorCorrection();if(isNaN(e[0]))return e;this.encodedCodeword=this.encodedCodeword;var t=Array(this.encodedCodeword.length+e.length);return this.copyArray(t,0,this.encodedCodeword),this.copyArray(t,this.encodedCodeword.length,e),t},uLi.prototype.copyArray=function(e,t,i){for(var n=0;n<i.length;n++)e[t+n]=i[parseInt(n.toString(),10)]},uLi.prototype.ecc200placementbit=function(e,t,i,n,o,r,s){n<0&&(n+=t,o+=4-(t+4)%8),o<0&&(o+=i,n+=4-(i+4)%8),e[n*i+o]=(r<<3)+s},uLi.prototype.ecc200placementblock=function(e,t,i,n,o,r){this.ecc200placementbit(e,t,i,n-2,o-2,r,7),this.ecc200placementbit(e,t,i,n-2,o-1,r,6),this.ecc200placementbit(e,t,i,n-1,o-2,r,5),this.ecc200placementbit(e,t,i,n-1,o-1,r,4),this.ecc200placementbit(e,t,i,n-1,+o,r,3),this.ecc200placementbit(e,t,i,+n,o-2,r,2),this.ecc200placementbit(e,t,i,+n,o-1,r,1),this.ecc200placementbit(e,t,i,+n,+o,r,0)},uLi.prototype.ecc200placementcornerD=function(e,t,i,n){this.ecc200placementbit(e,t,i,t-1,0,n,7),this.ecc200placementbit(e,t,i,t-1,i-1,n,6),this.ecc200placementbit(e,t,i,0,i-3,n,5),this.ecc200placementbit(e,t,i,0,i-2,n,4),this.ecc200placementbit(e,t,i,0,i-1,n,3),this.ecc200placementbit(e,t,i,1,i-3,n,2),this.ecc200placementbit(e,t,i,1,i-2,n,1),this.ecc200placementbit(e,t,i,1,i-1,n,0)},uLi.prototype.ecc200placementcornerA=function(e,t,i,n){this.ecc200placementbit(e,t,i,t-1,0,n,7),this.ecc200placementbit(e,t,i,t-1,1,n,6),this.ecc200placementbit(e,t,i,t-1,2,n,5);this.ecc200placementbit(e,t,i,0,i-2,n,4),this.ecc200placementbit(e,t,i,0,i-1,n,3);this.ecc200placementbit(e,t,i,1,i-1,n,2),this.ecc200placementbit(e,t,i,2,i-1,n,1),this.ecc200placementbit(e,t,i,3,i-1,n,0)},uLi.prototype.ecc200placementcornerB=function(e,t,i,n){this.ecc200placementbit(e,t,i,t-3,0,n,7),this.ecc200placementbit(e,t,i,t-2,0,n,6),this.ecc200placementbit(e,t,i,t-1,0,n,5),this.ecc200placementbit(e,t,i,0,i-4,n,4),this.ecc200placementbit(e,t,i,0,i-3,n,3),this.ecc200placementbit(e,t,i,0,i-2,n,2),this.ecc200placementbit(e,t,i,0,i-1,n,1),this.ecc200placementbit(e,t,i,1,i-1,n,0)},uLi.prototype.ecc200placementcornerC=function(e,t,i,n){this.ecc200placementbit(e,t,i,t-3,0,n,7),this.ecc200placementbit(e,t,i,t-2,0,n,6),this.ecc200placementbit(e,t,i,t-1,0,n,5),this.ecc200placementbit(e,t,i,0,i-2,n,4),this.ecc200placementbit(e,t,i,0,i-1,n,3),this.ecc200placementbit(e,t,i,1,i-1,n,2),this.ecc200placementbit(e,t,i,2,i-1,n,1),this.ecc200placementbit(e,t,i,3,i-1,n,0)},uLi.prototype.ecc200placement=function(e,t,i){for(var n,o,r,s=0;s<t;s++)for(var a=0;a<i;a++)e[s*i+a]=0;r=1,n=4,o=0;do{for(n===t&&0===o&&this.ecc200placementcornerA(e,t,i,r++),n===t-2&&0===o&&i%4!=0&&this.ecc200placementcornerB(e,t,i,r++),n===t-2&&0===o&&i%8==4&&this.ecc200placementcornerC(e,t,i,r++),n===t+4&&2===o&&i%8==0&&this.ecc200placementcornerD(e,t,i,r++);n<t&&0<=o&&0===e[n*i+o]&&this.ecc200placementblock(e,t,i,n,o,r++),o+=2,0<=(n-=2)&&o<i;);for(n++,o+=3;0<=n&&o<i&&0===e[n*i+o]&&this.ecc200placementblock(e,t,i,n,o,r++),o-=2,(n+=2)<t&&0<=o;);}while(o++,(n+=3)<t||o<i);0===e[t*i-1]&&(e[t*i-1]=e[t*i-i-2]=1)},uLi.prototype.getActualRows=function(){return this.mSymbolAttribute.SymbolRow+aBi.All},uLi.prototype.getActualColumns=function(){return this.mSymbolAttribute.SymbolColumn+aBi.All},uLi.prototype.AddQuiteZone=function(e){this.actualRows=this.getActualRows(),this.actualColumns=this.getActualColumns();var t=this.actualRows,i=this.actualColumns,n=aBi.All-1;this.mDataMatrixArray=this.create2DMartixArray(t,i,this.mDataMatrixArray);for(var o=0;o<i;o++)this.mDataMatrixArray[0][parseInt(o.toString(),10)]=0;for(o=n;o<t-n;o++){this.mDataMatrixArray[parseInt(o.toString(),10)][0]=0;for(var r=n;r<i-n;r++)this.mDataMatrixArray[parseInt(o.toString(),10)][parseInt(r.toString(),10)]=e[o-n][r-n];this.mDataMatrixArray[parseInt(o.toString(),10)][i-n]=0}for(o=0;o<i;o++)this.mDataMatrixArray[t-n][parseInt(o.toString(),10)]=0},uLi.prototype.drawImage=function(e,t){for(var i=this.getInstance(e.id),n=0;n<t.length;n++)i.renderRectElement(e,t[parseInt(n.toString(),10)])},uLi.prototype.CreateMatrix=function(e){for(var t,i,n=this.mSymbolAttribute.SymbolColumn,o=this.mSymbolAttribute.SymbolRow,r=n/this.mSymbolAttribute.HorizontalDataRegion,s=o/this.mSymbolAttribute.VerticalDataRegion,a=n-n/r*2,l=o-o/s*2,h=Array(a*l),d=(this.ecc200placement(h,l,a),[]),d=this.create1DMatrixArray(n*o,d),p=0;p<o;p+=s){for(var c=0;c<n;c++)d[p*n+c]=1;for(var u=0;u<n;u+=2)d[(p+s-1)*n+u]=1}for(t=0;t<n;t+=r){for(i=0;i<o;i++)d[i*n+t]=1;for(i=0;i<o;i+=2)d[i*n+t+r-1]=1}for(var g=0;g<l;g++)for(var m=0;m<a;m++){var f=h[(l-g-1)*a+m];(1===f||7<f&&0!=(e[(f>>3)-1]&1<<(7&f)))&&(d[(1+Math.floor(g)+2*Math.floor(Math.floor(g)/Math.floor(s-2)))*Math.floor(n)+1+Math.floor(m)+2*Math.floor(Math.floor(m)/Math.floor(r-2))]=1)}for(var y=this.mSymbolAttribute.SymbolColumn,v=this.mSymbolAttribute.SymbolRow,b=[],b=this.create2DMartixArray(y,v,b),w=0;w<y;w++)for(var C=0;C<v;C++)b[parseInt(w.toString(),10)][parseInt(C.toString(),10)]=d[y*C+w];for(var S=[],S=this.create2DMartixArray(y,v,S),A=0;A<v;A++)for(var x=0;x<y;x++)S[v-1-A][parseInt(x.toString(),10)]=b[parseInt(x.toString(),10)][parseInt(A.toString(),10)];this.AddQuiteZone(S)},uLi.prototype.create1DMatrixArray=function(e,t){for(var i=0;i<e;i++)t[parseInt(i.toString(),10)]=0;return t},uLi.prototype.create2DMartixArray=function(e,t,i){for(var n=0;n<e;n++){i.push([n]);for(var o=0;o<t;o++)i[parseInt(n.toString(),10)][parseInt(o.toString(),10)]=0}return i},uLi.prototype.BuildDataMatrix=function(){var e=this.PrepareCodeword(this.GetData());return isNaN(e[0])?e:(this.CreateMatrix(e),this.mDataMatrixArray[0])},uLi.prototype.drawText=function(e,t){this.getInstance(e.id).renderTextElement(e,t)},uLi.prototype.getInstance=function(e){e=document.getElementById(e);return new SBi(e.id,this.isSvgMode)},uLi.prototype.drawDisplayText=function(e,t,i,n,o,r,s){var a=this.displayText,l=(yBi(),jFi(n,o,t,i,"black")),s=(l.string=a.text||this.value,l.fontStyle=a.font,l.color=s,l.stringSize=a.size,l.visibility=a.visibility,gBi(l)),r=(s=this.isSvgMode?s:{width:s.width*r,height:s.height*r}).height/2+(this.isSvgMode?2:3);return l.height=r,n>s.width&&("Center"===this.displayText.alignment?l.x+=(t+n-t)/2-.5*s.width:"Left"===this.displayText.alignment?l.x=t+this.displayText.margin.left:l.x=this.width-this.margin.left-s.width-this.displayText.margin.right),l.x<t&&(l.x=t),"Bottom"===this.displayText.position?(0<this.displayText.margin.top&&(l.y=i+o),0<this.displayText.margin.bottom?l.y=i+o-a.margin.bottom:this.margin.top<10?l.y=o+s.height/2:l.y=o+this.margin.top):0<this.displayText.margin.top?l.y=i+this.displayText.margin.top+s.height/2:l.y=i+s.height/2,this.displayText.visibility&&(this.isSvgMode||(l.stringSize=1.5*l.stringSize),this.drawText(e,l)),l},uLi.prototype.getDrawableSize=function(e,t,i){return i<=t?i:t},uLi.prototype.draw=function(e){for(var t,i,n,o,r=this.isSvgMode,s=this.size<25,a=(this.mDataMatrixArray.length,this.width),l=this.height,h=this.margin.left,d=this.margin.right,p=this.margin.top,c=this.margin.bottom,u=a-((r?h:1.5*h)+(r?d:1.5*d)),a=l-((r?p:1.5*p)+(r?c:1.5*c)),g=(this.getDrawableSize(this.margin,u,a),(u-(o=a<=u?a:u))/2),m=(a-o)/2,f=(m+=r?this.margin.top:1.5*this.margin.top,g+=r?this.margin.left:1.5*this.margin.left,this.drawDisplayText(e,g,m,o,a,1.5,this.foreColor)),y=(a-=f.height,0<this.displayText.margin.bottom&&("Top"===this.displayText.position&&(m+=this.displayText.margin.bottom),a-=this.displayText.margin.bottom),0<this.displayText.margin.top&&("Top"===this.displayText.position&&(m+=this.displayText.margin.top),a-=this.displayText.margin.top),o=a<=u?a:u,s||(i=o/this.mDataMatrixArray[0].length,n=o/this.mDataMatrixArray.length),t=o/this.mDataMatrixArray.length,this.actualRows),v=this.actualColumns,b=[],w=0;w<y;w++){for(var C=0;C<v;C++){var S=void 0;"white"!==(S=1===this.mDataMatrixArray[parseInt(w.toString(),10)][parseInt(C.toString(),10)]?this.foreColor:"white")&&(S=jFi(s?t:i,s?t:n,g,"Bottom"===this.displayText.position?m:m+f.height/2,S),b.push(S)),g+=s?t:i}m+=s?t:n,g=(u-o)/2+(r?this.margin.left:1.5*this.margin.left)}this.drawImage(e,b),this.mDataMatrixArray=void 0};var cLi=uLi;function uLi(){this.mXDimension=1,this.mDataMatrixArray=[]}gLi=function(e,t){return(gLi=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])}))(e,t)};var gLi,mLi,v4=function(e,t,i,n){var o,r=arguments.length,s=r<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;0<=a;a--)(o=e[a])&&(s=(r<3?o(s):3<r?o(t,i,s):o(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},hft=(function(e,t){function i(){this.constructor=e}gLi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(fLi,mLi=Ji),fLi.prototype.destroy=function(){this.notify("destroy",{}),mLi.prototype.destroy.call(this);var e=document.getElementById(this.element.id+"content");e&&this.element.removeChild(e)},fLi.prototype.initializePrivateVariables=function(){this.defaultLocale={}},fLi.prototype.getPersistData=function(){return this.addOnPersist(["loaded"])},fLi.prototype.getModuleName=function(){return"DataMatrixGenerator"},fLi.prototype.setCulture=function(){this.localeObj=new Cn(this.getModuleName(),this.defaultLocale,this.locale)},fLi.prototype.getElementSize=function(e,t){e=0<e.toString().indexOf("px")||0<e.toString().indexOf("%")?e.toString():e.toString()+"px";return e},fLi.prototype.initialize=function(){this.width||(this.width="100%"),this.height||(this.height="100%"),this.element.style.display="block",this.element.style.width=this.getElementSize(this.width),this.element.style.height=this.getElementSize(this.height);var e="SVG"===this.mode?this.element.offsetHeight:1.5*this.element.offsetHeight,t="SVG"===this.mode?this.element.offsetWidth:1.5*this.element.offsetWidth;this.barcodeCanvas=this.barcodeRenderer.renderRootElement({id:this.element.id+"content",height:e,width:t},this.backgroundColor,t,e),this.element.appendChild(this.barcodeCanvas)},fLi.prototype.triggerEvent=function(e,t){this.trigger(sBi[""+e],{message:t})},fLi.prototype.preRender=function(){this.element.classList.add("e-datamatrix"),this.barcodeRenderer=new SBi(this.element.id,"SVG"===this.mode),this.initialize(),this.initializePrivateVariables(),this.setCulture()},fLi.prototype.onPropertyChanged=function(e,t){var i,n;"Canvas"===this.mode&&"Canvas"!==e.mode?WFi(this,this.barcodeCanvas):this.barcodeRenderer=zFi(e,this.barcodeCanvas,this.mode,this.element.id),e.width&&(i="Canvas"===this.mode&&"Canvas"!==e.mode?1.5*e.width:e.width,this.barcodeCanvas.setAttribute("width",String(i))),e.height&&(n="Canvas"===this.mode&&"Canvas"!==e.mode?1.5*e.height:e.height,this.barcodeCanvas.setAttribute("height",String(n)));for(var o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"mode":this.initialize();break;case"height":this.element.style.height=this.getElementSize(n),this.barcodeCanvas.setAttribute("height",String(this.element.offsetHeight));break;case"width":this.element.style.width=this.getElementSize(i),this.barcodeCanvas.setAttribute("width",String(this.element.offsetWidth));break;case"backgroundColor":this.barcodeCanvas.style.background=e.backgroundColor}this.renderElements()},fLi.prototype.checkdata=function(e){for(var t=!1,i=0;i<e.length;i++)(32<=e.charCodeAt(i)&&e.charCodeAt(i)<=126||10===e.charCodeAt(i)||13===e.charCodeAt(i))&&(t=!0);return t},fLi.prototype.exportImage=function(e,t){QFi(t,e,this.element,!1,this)},fLi.prototype.exportAsBase64Image=function(e){return QFi(e,"",this.element,!0,this)},fLi.prototype.renderElements=function(){var e=new cLi,t=(this.value=this.value||"",e.encodingValue=this.encoding,e.size=this.size,e.value=this.value,e.width=this.barcodeCanvas.getAttribute("width"),e.height=this.barcodeCanvas.getAttribute("height"),e.XDimension=this.xDimension,e.isSvgMode="SVG"===this.mode,e.margin=this.margin,e.displayText=this.displayText,e.foreColor=this.foreColor,this.checkdata(this.value)),i=e.BuildDataMatrix();isNaN(i[0])?this.triggerEvent(sBi.invalid,i):t?e.draw(this.barcodeCanvas):this.triggerEvent(sBi.invalid,"Invalid input"),"Canvas"===this.mode&&(this.barcodeCanvas.style.transform="scale("+2/3+")",this.barcodeCanvas.style.transformOrigin="0 0")},fLi.prototype.render=function(){this.notify("initial-load",{}),this.trigger("load"),this.notify("initial-end",{}),this.renderElements(),this.renderComplete()},v4([e("Auto")],fLi.prototype,"encoding",void 0),v4([e(lBi.Auto)],fLi.prototype,"size",void 0),v4([e("SVG")],fLi.prototype,"mode",void 0),v4([e(void 0)],fLi.prototype,"value",void 0),v4([e("100%")],fLi.prototype,"height",void 0),v4([e("100%")],fLi.prototype,"width",void 0),v4([t({},qOt)],fLi.prototype,"displayText",void 0),v4([t({},HNt)],fLi.prototype,"margin",void 0),v4([e("white")],fLi.prototype,"backgroundColor",void 0),v4([i()],fLi.prototype,"invalid",void 0),v4([e("black")],fLi.prototype,"foreColor",void 0),v4([e(1)],fLi.prototype,"xDimension",void 0),fLi);function fLi(e,t){return mLi.call(this,e,t)||this}NVt=Object.freeze({__proto__:null,BarcodeGenerator:B2t,BarcodeBase:xBi,OneDimension:DNt,get BarcodeEvent(){return sBi},get QuietZone(){return aBi},get DataMatrixSize(){return lBi},get QRCodeVersion(){return hBi},get ErrorCorrectionLevel(){return dBi},createHtmlElement:cBi,getChildNode:uBi,measureText:gBi,setAttribute:mBi,createSvgElement:fBi,createMeasureElements:yBi,Point:W2t,Rect:IBi,Size:pBi,DisplayText:qOt,Margin:HNt,BarcodeCanvasRenderer:vBi,BarcodeRenderer:SBi,BarcodeSVGRenderer:Xet,CodaBar:$Bi,Code128:PBi,Code128A:nFi,Code128B:RBi,Code128C:_Bi,Code39:XBi,Ean8:aFi,Ean13:pFi,UpcA:bFi,UpcE:mFi,QRCode:iLi,ModuleValue:oLi,QRCodeGenerator:dLi,PdfQRBarcodeValues:ZFi,ErrorCorrectionCodewords:eLi,DataMatrixGenerator:hft,DataMatrix:cLi});return g.barcodegenerator=NVt,g.base=fNt,g.buttons=uNt,g.calendars=dNt,g.charts=WOt,g.circulargauge=tn,g.compression=D$,g.data=x$,g.diagrams=Xo,g.documenteditor=NNt,g.drawings=w_,g.dropdowns=u_,g.excelexport=BV,g.filemanager=QN,g.fileutils=RV,g.gantt=zN,g.grids=Sg,g.heatmap=W,g.imageeditor=qNt,g.inplaceeditor=NOt,g.inputs=LOt,g.interactivechat=POt,g.kanban=Vft,g.layouts=E5,g.lineargauge=x5,g.lists=N$e,g.maps=Z$e,g.multicolumncombobox=d$,g.navigations=ist,g.notifications=sft,g.officechart=nft,g.pdf=Mft,g.pdfexport=Cft,g.pdfviewer=zVt,g.pivotview=zft,g.popups=Krt,g.progressbar=L$e,g.querybuilder=fJ,g.ribbon=Yrt,g.richtexteditor=tet,g.schedule=g$,g.splitbuttons=Zo,g.spreadsheet=yJ,g.svgbase=Pr,g.treegrid=Dr,g.treemap=$y,g}({});this.ejs=ej,"object"==typeof module&&"object"==typeof module.exports&&(module.exports={ej:ej}),"function"==typeof define&&define.amd&&define("ej",[],function(){return{ej:ej}}),window.ejsIntrop&&!window.BlazorAdaptor&&window.ejsIntrop.initBlazorAdaptor();
window.syncfusion={isLicValidated:true};
!function r(c,a,f){function o(n,t){if(!a[n]){if(!c[n]){var e="function"==typeof require&&require;if(!t&&e)return e(n,!0);if(s)return s(n,!0);var i=new Error("Cannot find module '"+n+"'");throw i.code="MODULE_NOT_FOUND",i}var u=a[n]={exports:{}};c[n][0].call(u.exports,function(t){return o(c[n][1][t]||t)},u,u.exports,r,c,a,f)}return a[n].exports}for(var s="function"==typeof require&&require,t=0;t<f.length;t++)o(f[t]);return o}({1:[function(t,n,r){"use strict";t(2);var e=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(t(15));e.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),e.default._babelPolyfill=!0},{15:15,2:2}],2:[function(t,n,r){"use strict";t(3),t(5),t(4),t(11),t(10),t(13),t(12),t(14),t(7),t(8),t(6),t(9),t(306),t(307)},{10:10,11:11,12:12,13:13,14:14,3:3,306:306,307:307,4:4,5:5,6:6,7:7,8:8,9:9}],3:[function(t,n,r){t(278),t(214),t(216),t(215),t(218),t(220),t(225),t(219),t(217),t(227),t(226),t(222),t(223),t(221),t(213),t(224),t(228),t(229),t(180),t(182),t(181),t(231),t(230),t(201),t(211),t(212),t(202),t(203),t(204),t(205),t(206),t(207),t(208),t(209),t(210),t(184),t(185),t(186),t(187),t(188),t(189),t(190),t(191),t(192),t(193),t(194),t(195),t(196),t(197),t(198),t(199),t(200),t(265),t(270),t(277),t(268),t(260),t(261),t(266),t(271),t(273),t(256),t(257),t(258),t(259),t(262),t(263),t(264),t(267),t(269),t(272),t(274),t(275),t(276),t(175),t(177),t(176),t(179),t(178),t(163),t(161),t(168),t(165),t(171),t(173),t(160),t(167),t(157),t(172),t(155),t(170),t(169),t(162),t(166),t(154),t(156),t(159),t(158),t(174),t(164),t(247),t(248),t(254),t(249),t(250),t(251),t(252),t(253),t(232),t(183),t(255),t(290),t(291),t(279),t(280),t(285),t(288),t(289),t(283),t(286),t(284),t(287),t(281),t(282),t(233),t(234),t(235),t(236),t(237),t(240),t(238),t(239),t(241),t(242),t(243),t(244),t(246),t(245),n.exports=t(52)},{154:154,155:155,156:156,157:157,158:158,159:159,160:160,161:161,162:162,163:163,164:164,165:165,166:166,167:167,168:168,169:169,170:170,171:171,172:172,173:173,174:174,175:175,176:176,177:177,178:178,179:179,180:180,181:181,182:182,183:183,184:184,185:185,186:186,187:187,188:188,189:189,190:190,191:191,192:192,193:193,194:194,195:195,196:196,197:197,198:198,199:199,200:200,201:201,202:202,203:203,204:204,205:205,206:206,207:207,208:208,209:209,210:210,211:211,212:212,213:213,214:214,215:215,216:216,217:217,218:218,219:219,220:220,221:221,222:222,223:223,224:224,225:225,226:226,227:227,228:228,229:229,230:230,231:231,232:232,233:233,234:234,235:235,236:236,237:237,238:238,239:239,240:240,241:241,242:242,243:243,244:244,245:245,246:246,247:247,248:248,249:249,250:250,251:251,252:252,253:253,254:254,255:255,256:256,257:257,258:258,259:259,260:260,261:261,262:262,263:263,264:264,265:265,266:266,267:267,268:268,269:269,270:270,271:271,272:272,273:273,274:274,275:275,276:276,277:277,278:278,279:279,280:280,281:281,282:282,283:283,284:284,285:285,286:286,287:287,288:288,289:289,290:290,291:291,52:52}],4:[function(t,n,r){t(292),n.exports=t(52).Array.flatMap},{292:292,52:52}],5:[function(t,n,r){t(293),n.exports=t(52).Array.includes},{293:293,52:52}],6:[function(t,n,r){t(294),n.exports=t(52).Object.entries},{294:294,52:52}],7:[function(t,n,r){t(295),n.exports=t(52).Object.getOwnPropertyDescriptors},{295:295,52:52}],8:[function(t,n,r){t(296),n.exports=t(52).Object.values},{296:296,52:52}],9:[function(t,n,r){"use strict";t(232),t(297),n.exports=t(52).Promise.finally},{232:232,297:297,52:52}],10:[function(t,n,r){t(298),n.exports=t(52).String.padEnd},{298:298,52:52}],11:[function(t,n,r){t(299),n.exports=t(52).String.padStart},{299:299,52:52}],12:[function(t,n,r){t(301),n.exports=t(52).String.trimRight},{301:301,52:52}],13:[function(t,n,r){t(300),n.exports=t(52).String.trimLeft},{300:300,52:52}],14:[function(t,n,r){t(302),n.exports=t(151).f("asyncIterator")},{151:151,302:302}],15:[function(t,n,r){t(32),n.exports=t(18).global},{18:18,32:32}],16:[function(t,n,r){n.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},{}],17:[function(t,n,r){var e=t(28);n.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},{28:28}],18:[function(t,n,r){var e=n.exports={version:"2.6.11"};"number"==typeof __e&&(__e=e)},{}],19:[function(t,n,r){var o=t(16);n.exports=function(e,i,t){if(o(e),void 0===i)return e;switch(t){case 1:return function(t){return e.call(i,t)};case 2:return function(t,n){return e.call(i,t,n)};case 3:return function(t,n,r){return e.call(i,t,n,r)}}return function(){return e.apply(i,arguments)}}},{16:16}],20:[function(t,n,r){n.exports=!t(23)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{23:23}],21:[function(t,n,r){var e=t(28),i=t(24).document,o=e(i)&&e(i.createElement);n.exports=function(t){return o?i.createElement(t):{}}},{24:24,28:28}],22:[function(t,n,r){var g=t(24),y=t(18),d=t(19),x=t(26),m=t(25),S="prototype",b=function(t,n,r){var e,i,o,u=t&b.F,c=t&b.G,a=t&b.S,f=t&b.P,s=t&b.B,l=t&b.W,h=c?y:y[n]||(y[n]={}),p=h[S],v=c?g:a?g[n]:(g[n]||{})[S];for(e in c&&(r=n),r)(i=!u&&v&&void 0!==v[e])&&m(h,e)||(o=i?v[e]:r[e],h[e]=c&&"function"!=typeof v[e]?r[e]:s&&i?d(o,g):l&&v[e]==o?function(e){function qb(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)}return qb[S]=e[S],qb}(o):f&&"function"==typeof o?d(Function.call,o):o,f&&((h.virtual||(h.virtual={}))[e]=o,t&b.R&&p&&!p[e]&&x(p,e,o)))};b.F=1,b.G=2,b.S=4,b.P=8,b.B=16,b.W=32,b.U=64,b.R=128,n.exports=b},{18:18,19:19,24:24,25:25,26:26}],23:[function(t,n,r){n.exports=function(t){try{return!!t()}catch(t){return!0}}},{}],24:[function(t,n,r){var e=n.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},{}],25:[function(t,n,r){var e={}.hasOwnProperty;n.exports=function(t,n){return e.call(t,n)}},{}],26:[function(t,n,r){var e=t(29),i=t(30);n.exports=t(20)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},{20:20,29:29,30:30}],27:[function(t,n,r){n.exports=!t(20)&&!t(23)(function(){return 7!=Object.defineProperty(t(21)("div"),"a",{get:function(){return 7}}).a})},{20:20,21:21,23:23}],28:[function(t,n,r){n.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],29:[function(t,n,r){var e=t(17),i=t(27),o=t(31),u=Object.defineProperty;r.f=t(20)?Object.defineProperty:function defineProperty(t,n,r){if(e(t),n=o(n,!0),e(r),i)try{return u(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},{17:17,20:20,27:27,31:31}],30:[function(t,n,r){n.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},{}],31:[function(t,n,r){var i=t(28);n.exports=function(t,n){if(!i(t))return t;var r,e;if(n&&"function"==typeof(r=t.toString)&&!i(e=r.call(t)))return e;if("function"==typeof(r=t.valueOf)&&!i(e=r.call(t)))return e;if(!n&&"function"==typeof(r=t.toString)&&!i(e=r.call(t)))return e;throw TypeError("Can't convert object to primitive value")}},{28:28}],32:[function(t,n,r){var e=t(22);e(e.G,{global:t(24)})},{22:22,24:24}],33:[function(t,n,r){arguments[4][16][0].apply(r,arguments)},{16:16}],34:[function(t,n,r){var e=t(48);n.exports=function(t,n){if("number"!=typeof t&&"Number"!=e(t))throw TypeError(n);return+t}},{48:48}],35:[function(t,n,r){var e=t(152)("unscopables"),i=Array.prototype;null==i[e]&&t(72)(i,e,{}),n.exports=function(t){i[e][t]=!0}},{152:152,72:72}],36:[function(t,n,r){"use strict";var e=t(129)(!0);n.exports=function(t,n,r){return n+(r?e(t,n).length:1)}},{129:129}],37:[function(t,n,r){n.exports=function(t,n,r,e){if(!(t instanceof n)||void 0!==e&&e in t)throw TypeError(r+": incorrect invocation!");return t}},{}],38:[function(t,n,r){arguments[4][17][0].apply(r,arguments)},{17:17,81:81}],39:[function(t,n,r){"use strict";var f=t(142),s=t(137),l=t(141);n.exports=[].copyWithin||function copyWithin(t,n){var r=f(this),e=l(r.length),i=s(t,e),o=s(n,e),u=2<arguments.length?arguments[2]:void 0,c=Math.min((void 0===u?e:s(u,e))-o,e-i),a=1;for(o<i&&i<o+c&&(a=-1,o+=c-1,i+=c-1);0<c--;)o in r?r[i]=r[o]:delete r[i],i+=a,o+=a;return r}},{137:137,141:141,142:142}],40:[function(t,n,r){"use strict";var c=t(142),a=t(137),f=t(141);n.exports=function fill(t){for(var n=c(this),r=f(n.length),e=arguments.length,i=a(1<e?arguments[1]:void 0,r),o=2<e?arguments[2]:void 0,u=void 0===o?r:a(o,r);i<u;)n[i++]=t;return n}},{137:137,141:141,142:142}],41:[function(t,n,r){var a=t(140),f=t(141),s=t(137);n.exports=function(c){return function(t,n,r){var e,i=a(t),o=f(i.length),u=s(r,o);if(c&&n!=n){for(;u<o;)if((e=i[u++])!=e)return!0}else for(;u<o;u++)if((c||u in i)&&i[u]===n)return c||u||0;return!c&&-1}}},{137:137,140:140,141:141}],42:[function(t,n,r){var m=t(54),S=t(77),b=t(142),w=t(141),e=t(45);n.exports=function(l,t){var h=1==l,p=2==l,v=3==l,g=4==l,y=6==l,d=5==l||y,x=t||e;return function(t,n,r){for(var e,i,o=b(t),u=S(o),c=m(n,r,3),a=w(u.length),f=0,s=h?x(t,a):p?x(t,0):void 0;f<a;f++)if((d||f in u)&&(i=c(e=u[f],f,o),l))if(h)s[f]=i;else if(i)switch(l){case 3:return!0;case 5:return e;case 6:return f;case 2:s.push(e)}else if(g)return!1;return y?-1:v||g?g:s}}},{141:141,142:142,45:45,54:54,77:77}],43:[function(t,n,r){var s=t(33),l=t(142),h=t(77),p=t(141);n.exports=function(t,n,r,e,i){s(n);var o=l(t),u=h(o),c=p(o.length),a=i?c-1:0,f=i?-1:1;if(r<2)for(;;){if(a in u){e=u[a],a+=f;break}if(a+=f,i?a<0:c<=a)throw TypeError("Reduce of empty array with no initial value")}for(;i?0<=a:a<c;a+=f)a in u&&(e=n(e,u[a],a,o));return e}},{141:141,142:142,33:33,77:77}],44:[function(t,n,r){var e=t(81),i=t(79),o=t(152)("species");n.exports=function(t){var n;return i(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!i(n.prototype)||(n=void 0),e(n)&&null===(n=n[o])&&(n=void 0)),void 0===n?Array:n}},{152:152,79:79,81:81}],45:[function(t,n,r){var e=t(44);n.exports=function(t,n){return new(e(t))(n)}},{44:44}],46:[function(t,n,r){"use strict";var o=t(33),u=t(81),c=t(76),a=[].slice,f={};n.exports=Function.bind||function bind(n){var r=o(this),e=a.call(arguments,1),i=function(){var t=e.concat(a.call(arguments));return this instanceof i?function(t,n,r){if(!(n in f)){for(var e=[],i=0;i<n;i++)e[i]="a["+i+"]";f[n]=Function("F,a","return new F("+e.join(",")+")")}return f[n](t,r)}(r,t.length,t):c(r,t,n)};return u(r.prototype)&&(i.prototype=r.prototype),i}},{33:33,76:76,81:81}],47:[function(t,n,r){var i=t(48),o=t(152)("toStringTag"),u="Arguments"==i(function(){return arguments}());n.exports=function(t){var n,r,e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,n){try{return t[n]}catch(t){}}(n=Object(t),o))?r:u?i(n):"Object"==(e=i(n))&&"function"==typeof n.callee?"Arguments":e}},{152:152,48:48}],48:[function(t,n,r){var e={}.toString;n.exports=function(t){return e.call(t).slice(8,-1)}},{}],49:[function(t,n,r){"use strict";function ag(t,n){var r,e=p(n);if("F"!==e)return t._i[e];for(r=t._f;r;r=r.n)if(r.k==n)return r}var u=t(99).f,c=t(98),a=t(117),f=t(54),s=t(37),l=t(68),e=t(85),i=t(87),o=t(123),h=t(58),p=t(94).fastKey,v=t(149),g=h?"_s":"size";n.exports={getConstructor:function(t,o,r,e){var i=t(function(t,n){s(t,i,o,"_i"),t._t=o,t._i=c(null),t._f=void 0,t._l=void 0,t[g]=0,null!=n&&l(n,r,t[e],t)});return a(i.prototype,{clear:function clear(){for(var t=v(this,o),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[g]=0},delete:function(t){var n=v(this,o),r=ag(n,t);if(r){var e=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=e),e&&(e.p=i),n._f==r&&(n._f=e),n._l==r&&(n._l=i),n[g]--}return!!r},forEach:function forEach(t){v(this,o);for(var n,r=f(t,1<arguments.length?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function has(t){return!!ag(v(this,o),t)}}),h&&u(i.prototype,"size",{get:function(){return v(this,o)[g]}}),i},def:function(t,n,r){var e,i,o=ag(t,n);return o?o.v=r:(t._l=o={i:i=p(n,!0),k:n,v:r,p:e=t._l,n:void 0,r:!1},t._f||(t._f=o),e&&(e.n=o),t[g]++,"F"!==i&&(t._i[i]=o)),t},getEntry:ag,setStrong:function(t,r,n){e(t,r,function(t,n){this._t=v(t,r),this._k=n,this._l=void 0},function(){for(var t=this,n=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?i(0,"keys"==n?r.k:"values"==n?r.v:[r.k,r.v]):(t._t=void 0,i(1))},n?"entries":"values",!n,!0),o(r)}}},{117:117,123:123,149:149,37:37,54:54,58:58,68:68,85:85,87:87,94:94,98:98,99:99}],50:[function(t,n,r){"use strict";function _g(t){return t._l||(t._l=new g)}function bh(t,n){return o(t.a,function(t){return t[0]===n})}var u=t(117),c=t(94).getWeak,i=t(38),a=t(81),f=t(37),s=t(68),e=t(42),l=t(71),h=t(149),o=e(5),p=e(6),v=0,g=function(){this.a=[]};g.prototype={get:function(t){var n=bh(this,t);if(n)return n[1]},has:function(t){return!!bh(this,t)},set:function(t,n){var r=bh(this,t);r?r[1]=n:this.a.push([t,n])},delete:function(n){var t=p(this.a,function(t){return t[0]===n});return~t&&this.a.splice(t,1),!!~t}},n.exports={getConstructor:function(t,r,e,i){var o=t(function(t,n){f(t,o,r,"_i"),t._t=r,t._i=v++,t._l=void 0,null!=n&&s(n,e,t[i],t)});return u(o.prototype,{delete:function(t){if(!a(t))return!1;var n=c(t);return!0===n?_g(h(this,r)).delete(t):n&&l(n,this._i)&&delete n[this._i]},has:function has(t){if(!a(t))return!1;var n=c(t);return!0===n?_g(h(this,r)).has(t):n&&l(n,this._i)}}),o},def:function(t,n,r){var e=c(i(n),!0);return!0===e?_g(t).set(n,r):e[t._i]=r,t},ufstore:_g}},{117:117,149:149,37:37,38:38,42:42,68:68,71:71,81:81,94:94}],51:[function(t,n,r){"use strict";var y=t(70),d=t(62),x=t(118),m=t(117),S=t(94),b=t(68),w=t(37),_=t(81),E=t(64),O=t(86),F=t(124),I=t(75);n.exports=function(e,t,n,r,i,o){function ci(t){var r=f[t];x(f,t,"delete"==t?function(t){return!(o&&!_(t))&&r.call(this,0===t?0:t)}:"has"==t?function has(t){return!(o&&!_(t))&&r.call(this,0===t?0:t)}:"get"==t?function get(t){return o&&!_(t)?void 0:r.call(this,0===t?0:t)}:"add"==t?function add(t){return r.call(this,0===t?0:t),this}:function set(t,n){return r.call(this,0===t?0:t,n),this})}var u=y[e],c=u,a=i?"set":"add",f=c&&c.prototype,s={};if("function"==typeof c&&(o||f.forEach&&!E(function(){(new c).entries().next()}))){var l=new c,h=l[a](o?{}:-0,1)!=l,p=E(function(){l.has(1)}),v=O(function(t){new c(t)}),g=!o&&E(function(){for(var t=new c,n=5;n--;)t[a](n,n);return!t.has(-0)});v||(((c=t(function(t,n){w(t,c,e);var r=I(new u,t,c);return null!=n&&b(n,i,r[a],r),r})).prototype=f).constructor=c),(p||g)&&(ci("delete"),ci("has"),i&&ci("get")),(g||h)&&ci(a),o&&f.clear&&delete f.clear}else c=r.getConstructor(t,e,i,a),m(c.prototype,n),S.NEED=!0;return F(c,e),s[e]=c,d(d.G+d.W+d.F*(c!=u),s),o||r.setStrong(c,e,i),c}},{117:117,118:118,124:124,37:37,62:62,64:64,68:68,70:70,75:75,81:81,86:86,94:94}],52:[function(t,n,r){arguments[4][18][0].apply(r,arguments)},{18:18}],53:[function(t,n,r){"use strict";var e=t(99),i=t(116);n.exports=function(t,n,r){n in t?e.f(t,n,i(0,r)):t[n]=r}},{116:116,99:99}],54:[function(t,n,r){arguments[4][19][0].apply(r,arguments)},{19:19,33:33}],55:[function(t,n,r){"use strict";function Qi(t){return 9<t?t:"0"+t}var e=t(64),i=Date.prototype.getTime,o=Date.prototype.toISOString;n.exports=e(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))})||!e(function(){o.call(new Date(NaN))})?function toISOString(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,n=t.getUTCFullYear(),r=t.getUTCMilliseconds(),e=n<0?"-":9999<n?"+":"";return e+("00000"+Math.abs(n)).slice(e?-6:-4)+"-"+Qi(t.getUTCMonth()+1)+"-"+Qi(t.getUTCDate())+"T"+Qi(t.getUTCHours())+":"+Qi(t.getUTCMinutes())+":"+Qi(t.getUTCSeconds())+"."+(99<r?r:"0"+Qi(r))+"Z"}:o},{64:64}],56:[function(t,n,r){"use strict";var e=t(38),i=t(143);n.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return i(e(this),"number"!=t)}},{143:143,38:38}],57:[function(t,n,r){n.exports=function(t){if(null==t)throw TypeError("Can't call method on  "+t);return t}},{}],58:[function(t,n,r){arguments[4][20][0].apply(r,arguments)},{20:20,64:64}],59:[function(t,n,r){arguments[4][21][0].apply(r,arguments)},{21:21,70:70,81:81}],60:[function(t,n,r){n.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],61:[function(t,n,r){var c=t(107),a=t(104),f=t(108);n.exports=function(t){var n=c(t),r=a.f;if(r)for(var e,i=r(t),o=f.f,u=0;i.length>u;)o.call(t,e=i[u++])&&n.push(e);return n}},{104:104,107:107,108:108}],62:[function(t,n,r){var g=t(70),y=t(52),d=t(72),x=t(118),m=t(54),S="prototype",b=function(t,n,r){var e,i,o,u,c=t&b.F,a=t&b.G,f=t&b.S,s=t&b.P,l=t&b.B,h=a?g:f?g[n]||(g[n]={}):(g[n]||{})[S],p=a?y:y[n]||(y[n]={}),v=p[S]||(p[S]={});for(e in a&&(r=n),r)o=((i=!c&&h&&void 0!==h[e])?h:r)[e],u=l&&i?m(o,g):s&&"function"==typeof o?m(Function.call,o):o,h&&x(h,e,o,t&b.U),p[e]!=o&&d(p,e,u),s&&v[e]!=o&&(v[e]=o)};g.core=y,b.F=1,b.G=2,b.S=4,b.P=8,b.B=16,b.W=32,b.U=64,b.R=128,n.exports=b},{118:118,52:52,54:54,70:70,72:72}],63:[function(t,n,r){var e=t(152)("match");n.exports=function(n){var r=/./;try{"/./"[n](r)}catch(t){try{return r[e]=!1,!"/./"[n](r)}catch(t){}}return!0}},{152:152}],64:[function(t,n,r){arguments[4][23][0].apply(r,arguments)},{23:23}],65:[function(t,n,r){"use strict";t(248);var s=t(118),l=t(72),h=t(64),p=t(57),v=t(152),g=t(120),y=v("species"),d=!h(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}),x=function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var r="ab".split(t);return 2===r.length&&"a"===r[0]&&"b"===r[1]}();n.exports=function(r,t,n){var e=v(r),o=!h(function(){var t={};return t[e]=function(){return 7},7!=""[r](t)}),i=o?!h(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===r&&(n.constructor={},n.constructor[y]=function(){return n}),n[e](""),!t}):void 0;if(!o||!i||"replace"===r&&!d||"split"===r&&!x){var u=/./[e],c=n(p,e,""[r],function maybeCallNative(t,n,r,e,i){return n.exec===g?o&&!i?{done:!0,value:u.call(n,r,e)}:{done:!0,value:t.call(r,n,e)}:{done:!1}}),a=c[0],f=c[1];s(String.prototype,r,a),l(RegExp.prototype,e,2==t?function(t,n){return f.call(t,this,n)}:function(t){return f.call(t,this)})}}},{118:118,120:120,152:152,248:248,57:57,64:64,72:72}],66:[function(t,n,r){"use strict";var e=t(38);n.exports=function(){var t=e(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},{38:38}],67:[function(t,n,r){"use strict";var p=t(79),v=t(81),g=t(141),y=t(54),d=t(152)("isConcatSpreadable");n.exports=function flattenIntoArray(t,n,r,e,i,o,u,c){for(var a,f,s=i,l=0,h=!!u&&y(u,c,3);l<e;){if(l in r){if(a=h?h(r[l],l,n):r[l],f=!1,v(a)&&(f=void 0!==(f=a[d])?!!f:p(a)),f&&0<o)s=flattenIntoArray(t,n,a,g(a.length),s,o-1)-1;else{if(9007199254740991<=s)throw TypeError();t[s]=a}s++}l++}return s}},{141:141,152:152,54:54,79:79,81:81}],68:[function(t,n,r){var h=t(54),p=t(83),v=t(78),g=t(38),y=t(141),d=t(153),x={},m={};(r=n.exports=function(t,n,r,e,i){var o,u,c,a,f=i?function(){return t}:d(t),s=h(r,e,n?2:1),l=0;if("function"!=typeof f)throw TypeError(t+" is not iterable!");if(v(f)){for(o=y(t.length);l<o;l++)if((a=n?s(g(u=t[l])[0],u[1]):s(t[l]))===x||a===m)return a}else for(c=f.call(t);!(u=c.next()).done;)if((a=p(c,s,u.value,n))===x||a===m)return a}).BREAK=x,r.RETURN=m},{141:141,153:153,38:38,54:54,78:78,83:83}],69:[function(t,n,r){n.exports=t(126)("native-function-to-string",Function.toString)},{126:126}],70:[function(t,n,r){arguments[4][24][0].apply(r,arguments)},{24:24}],71:[function(t,n,r){arguments[4][25][0].apply(r,arguments)},{25:25}],72:[function(t,n,r){arguments[4][26][0].apply(r,arguments)},{116:116,26:26,58:58,99:99}],73:[function(t,n,r){var e=t(70).document;n.exports=e&&e.documentElement},{70:70}],74:[function(t,n,r){arguments[4][27][0].apply(r,arguments)},{27:27,58:58,59:59,64:64}],75:[function(t,n,r){var o=t(81),u=t(122).set;n.exports=function(t,n,r){var e,i=n.constructor;return i!==r&&"function"==typeof i&&(e=i.prototype)!==r.prototype&&o(e)&&u&&u(t,e),t}},{122:122,81:81}],76:[function(t,n,r){n.exports=function(t,n,r){var e=void 0===r;switch(n.length){case 0:return e?t():t.call(r);case 1:return e?t(n[0]):t.call(r,n[0]);case 2:return e?t(n[0],n[1]):t.call(r,n[0],n[1]);case 3:return e?t(n[0],n[1],n[2]):t.call(r,n[0],n[1],n[2]);case 4:return e?t(n[0],n[1],n[2],n[3]):t.call(r,n[0],n[1],n[2],n[3])}return t.apply(r,n)}},{}],77:[function(t,n,r){var e=t(48);n.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},{48:48}],78:[function(t,n,r){var e=t(88),i=t(152)("iterator"),o=Array.prototype;n.exports=function(t){return void 0!==t&&(e.Array===t||o[i]===t)}},{152:152,88:88}],79:[function(t,n,r){var e=t(48);n.exports=Array.isArray||function isArray(t){return"Array"==e(t)}},{48:48}],80:[function(t,n,r){var e=t(81),i=Math.floor;n.exports=function isInteger(t){return!e(t)&&isFinite(t)&&i(t)===t}},{81:81}],81:[function(t,n,r){arguments[4][28][0].apply(r,arguments)},{28:28}],82:[function(t,n,r){var e=t(81),i=t(48),o=t(152)("match");n.exports=function(t){var n;return e(t)&&(void 0!==(n=t[o])?!!n:"RegExp"==i(t))}},{152:152,48:48,81:81}],83:[function(t,n,r){var o=t(38);n.exports=function(n,t,r,e){try{return e?t(o(r)[0],r[1]):t(r)}catch(t){var i=n.return;throw void 0!==i&&o(i.call(n)),t}}},{38:38}],84:[function(t,n,r){"use strict";var e=t(98),i=t(116),o=t(124),u={};t(72)(u,t(152)("iterator"),function(){return this}),n.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},{116:116,124:124,152:152,72:72,98:98}],85:[function(t,n,r){"use strict";function Qn(){return this}var x=t(89),m=t(62),S=t(118),b=t(72),w=t(88),_=t(84),E=t(124),O=t(105),F=t(152)("iterator"),I=!([].keys&&"next"in[].keys()),P="values";n.exports=function(t,n,r,e,i,o,u){_(r,n,e);function Yn(t){if(!I&&t in p)return p[t];switch(t){case"keys":return function keys(){return new r(this,t)};case P:return function values(){return new r(this,t)}}return function entries(){return new r(this,t)}}var c,a,f,s=n+" Iterator",l=i==P,h=!1,p=t.prototype,v=p[F]||p["@@iterator"]||i&&p[i],g=v||Yn(i),y=i?l?Yn("entries"):g:void 0,d="Array"==n&&p.entries||v;if(d&&(f=O(d.call(new t)))!==Object.prototype&&f.next&&(E(f,s,!0),x||"function"==typeof f[F]||b(f,F,Qn)),l&&v&&v.name!==P&&(h=!0,g=function values(){return v.call(this)}),x&&!u||!I&&!h&&p[F]||b(p,F,g),w[n]=g,w[s]=Qn,i)if(c={values:l?g:Yn(P),keys:o?g:Yn("keys"),entries:y},u)for(a in c)a in p||S(p,a,c[a]);else m(m.P+m.F*(I||h),n,c);return c}},{105:105,118:118,124:124,152:152,62:62,72:72,84:84,88:88,89:89}],86:[function(t,n,r){var o=t(152)("iterator"),u=!1;try{var e=[7][o]();e.return=function(){u=!0},Array.from(e,function(){throw 2})}catch(t){}n.exports=function(t,n){if(!n&&!u)return!1;var r=!1;try{var e=[7],i=e[o]();i.next=function(){return{done:r=!0}},e[o]=function(){return i},t(e)}catch(t){}return r}},{152:152}],87:[function(t,n,r){n.exports=function(t,n){return{value:n,done:!!t}}},{}],88:[function(t,n,r){n.exports={}},{}],89:[function(t,n,r){n.exports=!1},{}],90:[function(t,n,r){var e=Math.expm1;n.exports=!e||22025.465794806718<e(10)||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function expm1(t){return 0==(t=+t)?t:-1e-6<t&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},{}],91:[function(t,n,r){var o=t(93),e=Math.pow,u=e(2,-52),c=e(2,-23),a=e(2,127)*(2-c),f=e(2,-126);n.exports=Math.fround||function fround(t){var n,r,e=Math.abs(t),i=o(t);return e<f?i*(e/f/c+1/u-1/u)*f*c:a<(r=(n=(1+c/u)*e)-(n-e))||r!=r?i*(1/0):i*r}},{93:93}],92:[function(t,n,r){n.exports=Math.log1p||function log1p(t){return-1e-8<(t=+t)&&t<1e-8?t-t*t/2:Math.log(1+t)}},{}],93:[function(t,n,r){n.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},{}],94:[function(t,n,r){function tp(t){u(t,e,{value:{i:"O"+ ++c,w:{}}})}var e=t(147)("meta"),i=t(81),o=t(71),u=t(99).f,c=0,a=Object.isExtensible||function(){return!0},f=!t(64)(function(){return a(Object.preventExtensions({}))}),s=n.exports={KEY:e,NEED:!1,fastKey:function(t,n){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,e)){if(!a(t))return"F";if(!n)return"E";tp(t)}return t[e].i},getWeak:function(t,n){if(!o(t,e)){if(!a(t))return!0;if(!n)return!1;tp(t)}return t[e].w},onFreeze:function(t){return f&&s.NEED&&a(t)&&!o(t,e)&&tp(t),t}}},{147:147,64:64,71:71,81:81,99:99}],95:[function(t,n,r){var u=t(70),c=t(136).set,a=u.MutationObserver||u.WebKitMutationObserver,f=u.process,s=u.Promise,l="process"==t(48)(f);n.exports=function(){function Qp(){var t,n;for(l&&(t=f.domain)&&t.exit();r;){n=r.fn,r=r.next;try{n()}catch(t){throw r?i():e=void 0,t}}e=void 0,t&&t.enter()}var r,e,i;if(l)i=function(){f.nextTick(Qp)};else if(!a||u.navigator&&u.navigator.standalone)if(s&&s.resolve){var t=s.resolve(void 0);i=function(){t.then(Qp)}}else i=function(){c.call(u,Qp)};else{var n=!0,o=document.createTextNode("");new a(Qp).observe(o,{characterData:!0}),i=function(){o.data=n=!n}}return function(t){var n={fn:t,next:void 0};e&&(e.next=n),r||(r=n,i()),e=n}}},{136:136,48:48,70:70}],96:[function(t,n,r){"use strict";var i=t(33);function PromiseCapability(t){var r,e;this.promise=new t(function(t,n){if(void 0!==r||void 0!==e)throw TypeError("Bad Promise constructor");r=t,e=n}),this.resolve=i(r),this.reject=i(e)}n.exports.f=function(t){return new PromiseCapability(t)}},{33:33}],97:[function(t,n,r){"use strict";var h=t(58),p=t(107),v=t(104),g=t(108),y=t(142),d=t(77),i=Object.assign;n.exports=!i||t(64)(function(){var t={},n={},r=Symbol(),e="abcdefghijklmnopqrst";return t[r]=7,e.split("").forEach(function(t){n[t]=t}),7!=i({},t)[r]||Object.keys(i({},n)).join("")!=e})?function assign(t,n){for(var r=y(t),e=arguments.length,i=1,o=v.f,u=g.f;i<e;)for(var c,a=d(arguments[i++]),f=o?p(a).concat(o(a)):p(a),s=f.length,l=0;l<s;)c=f[l++],h&&!u.call(a,c)||(r[c]=a[c]);return r}:i},{104:104,107:107,108:108,142:142,58:58,64:64,77:77}],98:[function(e,t,n){function Pq(){}var i=e(38),o=e(100),u=e(60),c=e(125)("IE_PROTO"),a="prototype",f=function(){var t,n=e(59)("iframe"),r=u.length;for(n.style.display="none",e(73).appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),f=t.F;r--;)delete f[a][u[r]];return f()};t.exports=Object.create||function create(t,n){var r;return null!==t?(Pq[a]=i(t),r=new Pq,Pq[a]=null,r[c]=t):r=f(),void 0===n?r:o(r,n)}},{100:100,125:125,38:38,59:59,60:60,73:73}],99:[function(t,n,r){arguments[4][29][0].apply(r,arguments)},{143:143,29:29,38:38,58:58,74:74}],100:[function(t,n,r){var u=t(99),c=t(38),a=t(107);n.exports=t(58)?Object.defineProperties:function defineProperties(t,n){c(t);for(var r,e=a(n),i=e.length,o=0;o<i;)u.f(t,r=e[o++],n[r]);return t}},{107:107,38:38,58:58,99:99}],101:[function(t,n,r){var e=t(108),i=t(116),o=t(140),u=t(143),c=t(71),a=t(74),f=Object.getOwnPropertyDescriptor;r.f=t(58)?f:function getOwnPropertyDescriptor(t,n){if(t=o(t),n=u(n,!0),a)try{return f(t,n)}catch(t){}if(c(t,n))return i(!e.f.call(t,n),t[n])}},{108:108,116:116,140:140,143:143,58:58,71:71,74:74}],102:[function(t,n,r){var e=t(140),i=t(103).f,o={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];n.exports.f=function getOwnPropertyNames(t){return u&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return u.slice()}}(t):i(e(t))}},{103:103,140:140}],103:[function(t,n,r){var e=t(106),i=t(60).concat("length","prototype");r.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return e(t,i)}},{106:106,60:60}],104:[function(t,n,r){r.f=Object.getOwnPropertySymbols},{}],105:[function(t,n,r){var e=t(71),i=t(142),o=t(125)("IE_PROTO"),u=Object.prototype;n.exports=Object.getPrototypeOf||function(t){return t=i(t),e(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},{125:125,142:142,71:71}],106:[function(t,n,r){var u=t(71),c=t(140),a=t(41)(!1),f=t(125)("IE_PROTO");n.exports=function(t,n){var r,e=c(t),i=0,o=[];for(r in e)r!=f&&u(e,r)&&o.push(r);for(;n.length>i;)u(e,r=n[i++])&&(~a(o,r)||o.push(r));return o}},{125:125,140:140,41:41,71:71}],107:[function(t,n,r){var e=t(106),i=t(60);n.exports=Object.keys||function keys(t){return e(t,i)}},{106:106,60:60}],108:[function(t,n,r){r.f={}.propertyIsEnumerable},{}],109:[function(t,n,r){var i=t(62),o=t(52),u=t(64);n.exports=function(t,n){var r=(o.Object||{})[t]||Object[t],e={};e[t]=n(r),i(i.S+i.F*u(function(){r(1)}),"Object",e)}},{52:52,62:62,64:64}],110:[function(t,n,r){var a=t(58),f=t(107),s=t(140),l=t(108).f;n.exports=function(c){return function(t){for(var n,r=s(t),e=f(r),i=e.length,o=0,u=[];o<i;)n=e[o++],a&&!l.call(r,n)||u.push(c?[n,r[n]]:r[n]);return u}}},{107:107,108:108,140:140,58:58}],111:[function(t,n,r){var e=t(103),i=t(104),o=t(38),u=t(70).Reflect;n.exports=u&&u.ownKeys||function ownKeys(t){var n=e.f(o(t)),r=i.f;return r?n.concat(r(t)):n}},{103:103,104:104,38:38,70:70}],112:[function(t,n,r){var e=t(70).parseFloat,i=t(134).trim;n.exports=1/e(t(135)+"-0")!=-1/0?function parseFloat(t){var n=i(String(t),3),r=e(n);return 0===r&&"-"==n.charAt(0)?-0:r}:e},{134:134,135:135,70:70}],113:[function(t,n,r){var e=t(70).parseInt,i=t(134).trim,o=t(135),u=/^[-+]?0[xX]/;n.exports=8!==e(o+"08")||22!==e(o+"0x16")?function parseInt(t,n){var r=i(String(t),3);return e(r,n>>>0||(u.test(r)?16:10))}:e},{134:134,135:135,70:70}],114:[function(t,n,r){n.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},{}],115:[function(t,n,r){var e=t(38),i=t(81),o=t(96);n.exports=function(t,n){if(e(t),i(n)&&n.constructor===t)return n;var r=o.f(t);return(0,r.resolve)(n),r.promise}},{38:38,81:81,96:96}],116:[function(t,n,r){arguments[4][30][0].apply(r,arguments)},{30:30}],117:[function(t,n,r){var i=t(118);n.exports=function(t,n,r){for(var e in n)i(t,e,n[e],r);return t}},{118:118}],118:[function(t,n,r){var o=t(70),u=t(72),c=t(71),a=t(147)("src"),e=t(69),i="toString",f=(""+e).split(i);t(52).inspectSource=function(t){return e.call(t)},(n.exports=function(t,n,r,e){var i="function"==typeof r;i&&(c(r,"name")||u(r,"name",n)),t[n]!==r&&(i&&(c(r,a)||u(r,a,t[n]?""+t[n]:f.join(String(n)))),t===o?t[n]=r:e?t[n]?t[n]=r:u(t,n,r):(delete t[n],u(t,n,r)))})(Function.prototype,i,function toString(){return"function"==typeof this&&this[a]||e.call(this)})},{147:147,52:52,69:69,70:70,71:71,72:72}],119:[function(t,n,r){"use strict";var i=t(47),o=RegExp.prototype.exec;n.exports=function(t,n){var r=t.exec;if("function"==typeof r){var e=r.call(t,n);if("object"!=typeof e)throw new TypeError("RegExp exec method returned something other than an Object or null");return e}if("RegExp"!==i(t))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(t,n)}},{47:47}],120:[function(t,n,r){"use strict";var e,i,u=t(66),c=RegExp.prototype.exec,a=String.prototype.replace,o=c,f="lastIndex",s=(e=/a/,i=/b*/g,c.call(e,"a"),c.call(i,"a"),0!==e[f]||0!==i[f]),l=void 0!==/()??/.exec("")[1];(s||l)&&(o=function exec(t){var n,r,e,i,o=this;return l&&(r=new RegExp("^"+o.source+"$(?!\\s)",u.call(o))),s&&(n=o[f]),e=c.call(o,t),s&&e&&(o[f]=o.global?e.index+e[0].length:n),l&&e&&1<e.length&&a.call(e[0],r,function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(e[i]=void 0)}),e}),n.exports=o},{66:66}],121:[function(t,n,r){n.exports=Object.is||function is(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n}},{}],122:[function(n,t,r){function Wu(t,n){if(i(t),!e(n)&&null!==n)throw TypeError(n+": can't set as prototype!")}var e=n(81),i=n(38);t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,r,e){try{(e=n(54)(Function.call,n(101).f(Object.prototype,"__proto__").set,2))(t,[]),r=!(t instanceof Array)}catch(t){r=!0}return function setPrototypeOf(t,n){return Wu(t,n),r?t.__proto__=n:e(t,n),t}}({},!1):void 0),check:Wu}},{101:101,38:38,54:54,81:81}],123:[function(t,n,r){"use strict";var e=t(70),i=t(99),o=t(58),u=t(152)("species");n.exports=function(t){var n=e[t];o&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},{152:152,58:58,70:70,99:99}],124:[function(t,n,r){var e=t(99).f,i=t(71),o=t(152)("toStringTag");n.exports=function(t,n,r){t&&!i(t=r?t:t.prototype,o)&&e(t,o,{configurable:!0,value:n})}},{152:152,71:71,99:99}],125:[function(t,n,r){var e=t(126)("keys"),i=t(147);n.exports=function(t){return e[t]||(e[t]=i(t))}},{126:126,147:147}],126:[function(t,n,r){var e=t(52),i=t(70),o="__core-js_shared__",u=i[o]||(i[o]={});(n.exports=function(t,n){return u[t]||(u[t]=void 0!==n?n:{})})("versions",[]).push({version:e.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},{52:52,70:70,89:89}],127:[function(t,n,r){var i=t(38),o=t(33),u=t(152)("species");n.exports=function(t,n){var r,e=i(t).constructor;return void 0===e||null==(r=i(e)[u])?n:o(r)}},{152:152,33:33,38:38}],128:[function(t,n,r){"use strict";var e=t(64);n.exports=function(t,n){return!!t&&e(function(){n?t.call(null,function(){},1):t.call(null)})}},{64:64}],129:[function(t,n,r){var a=t(139),f=t(57);n.exports=function(c){return function(t,n){var r,e,i=String(f(t)),o=a(n),u=i.length;return o<0||u<=o?c?"":void 0:(r=i.charCodeAt(o))<55296||56319<r||o+1===u||(e=i.charCodeAt(o+1))<56320||57343<e?c?i.charAt(o):r:c?i.slice(o,o+2):e-56320+(r-55296<<10)+65536}}},{139:139,57:57}],130:[function(t,n,r){var e=t(82),i=t(57);n.exports=function(t,n,r){if(e(n))throw TypeError("String#"+r+" doesn't accept regex!");return String(i(t))}},{57:57,82:82}],131:[function(t,n,r){function Aw(t,n,r,e){var i=String(u(t)),o="<"+n;return""!==r&&(o+=" "+r+'="'+String(e).replace(c,"&quot;")+'"'),o+">"+i+"</"+n+">"}var e=t(62),i=t(64),u=t(57),c=/"/g;n.exports=function(n,t){var r={};r[n]=t(Aw),e(e.P+e.F*i(function(){var t=""[n]('"');return t!==t.toLowerCase()||3<t.split('"').length}),"String",r)}},{57:57,62:62,64:64}],132:[function(t,n,r){var s=t(141),l=t(133),h=t(57);n.exports=function(t,n,r,e){var i=String(h(t)),o=i.length,u=void 0===r?" ":String(r),c=s(n);if(c<=o||""==u)return i;var a=c-o,f=l.call(u,Math.ceil(a/u.length));return f.length>a&&(f=f.slice(0,a)),e?f+i:i+f}},{133:133,141:141,57:57}],133:[function(t,n,r){"use strict";var i=t(139),o=t(57);n.exports=function repeat(t){var n=String(o(this)),r="",e=i(t);if(e<0||e==1/0)throw RangeError("Count can't be negative");for(;0<e;(e>>>=1)&&(n+=n))1&e&&(r+=n);return r}},{139:139,57:57}],134:[function(t,n,r){function tx(t,n,r){var e={},i=c(function(){return!!a[t]()||"​"!="​"[t]()}),o=e[t]=i?n(s):a[t];r&&(e[r]=o),u(u.P+u.F*i,"String",e)}var u=t(62),e=t(57),c=t(64),a=t(135),i="["+a+"]",o=RegExp("^"+i+i+"*"),f=RegExp(i+i+"*$"),s=tx.trim=function(t,n){return t=String(e(t)),1&n&&(t=t.replace(o,"")),2&n&&(t=t.replace(f,"")),t};n.exports=tx},{135:135,57:57,62:62,64:64}],135:[function(t,n,r){n.exports="\t\n\v\f\r   ᠎             　\u2028\u2029\ufeff"},{}],136:[function(t,n,r){function Zx(){var t=+this;if(d.hasOwnProperty(t)){var n=d[t];delete d[t],n()}}function $x(t){Zx.call(t.data)}var e,i,o,u=t(54),c=t(76),a=t(73),f=t(59),s=t(70),l=s.process,h=s.setImmediate,p=s.clearImmediate,v=s.MessageChannel,g=s.Dispatch,y=0,d={},x="onreadystatechange";h&&p||(h=function setImmediate(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);return d[++y]=function(){c("function"==typeof t?t:Function(t),n)},e(y),y},p=function clearImmediate(t){delete d[t]},"process"==t(48)(l)?e=function(t){l.nextTick(u(Zx,t,1))}:g&&g.now?e=function(t){g.now(u(Zx,t,1))}:v?(o=(i=new v).port2,i.port1.onmessage=$x,e=u(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(e=function(t){s.postMessage(t+"","*")},s.addEventListener("message",$x,!1)):e=x in f("script")?function(t){a.appendChild(f("script"))[x]=function(){a.removeChild(this),Zx.call(t)}}:function(t){setTimeout(u(Zx,t,1),0)}),n.exports={set:h,clear:p}},{48:48,54:54,59:59,70:70,73:73,76:76}],137:[function(t,n,r){var e=t(139),i=Math.max,o=Math.min;n.exports=function(t,n){return(t=e(t))<0?i(t+n,0):o(t,n)}},{139:139}],138:[function(t,n,r){var e=t(139),i=t(141);n.exports=function(t){if(void 0===t)return 0;var n=e(t),r=i(n);if(n!==r)throw RangeError("Wrong length!");return r}},{139:139,141:141}],139:[function(t,n,r){var e=Math.ceil,i=Math.floor;n.exports=function(t){return isNaN(t=+t)?0:(0<t?i:e)(t)}},{}],140:[function(t,n,r){var e=t(77),i=t(57);n.exports=function(t){return e(i(t))}},{57:57,77:77}],141:[function(t,n,r){var e=t(139),i=Math.min;n.exports=function(t){return 0<t?i(e(t),9007199254740991):0}},{139:139}],142:[function(t,n,r){var e=t(57);n.exports=function(t){return Object(e(t))}},{57:57}],143:[function(t,n,r){arguments[4][31][0].apply(r,arguments)},{31:31,81:81}],144:[function(t,n,r){"use strict";if(t(58)){var y=t(89),d=t(70),x=t(64),m=t(62),S=t(146),e=t(145),h=t(54),b=t(37),i=t(116),w=t(72),o=t(117),u=t(139),_=t(141),E=t(138),c=t(137),a=t(143),f=t(71),O=t(47),F=t(81),p=t(142),v=t(78),I=t(98),P=t(105),A=t(103).f,g=t(153),s=t(147),l=t(152),M=t(42),k=t(41),N=t(127),j=t(164),R=t(88),T=t(86),L=t(123),C=t(40),G=t(39),D=t(99),U=t(101),W=D.f,V=U.f,B=d.RangeError,q=d.TypeError,Y=d.Uint8Array,z="ArrayBuffer",X="Shared"+z,$="BYTES_PER_ELEMENT",Q="prototype",Z=Array[Q],J=e.ArrayBuffer,H=e.DataView,K=M(0),tt=M(2),nt=M(3),rt=M(4),et=M(5),it=M(6),ot=k(!0),ut=k(!1),ct=j.values,at=j.keys,ft=j.entries,st=Z.lastIndexOf,lt=Z.reduce,ht=Z.reduceRight,pt=Z.join,vt=Z.sort,gt=Z.slice,yt=Z.toString,dt=Z.toLocaleString,xt=l("iterator"),mt=l("toStringTag"),St=s("typed_constructor"),bt=s("def_constructor"),wt=S.CONSTR,_t=S.TYPED,Et=S.VIEW,Ot="Wrong length!",Ft=M(1,function(t,n){return kt(N(t,t[bt]),n)}),It=x(function(){return 1===new Y(new Uint16Array([1]).buffer)[0]}),Pt=!!Y&&!!Y[Q].set&&x(function(){new Y(1).set({})}),At=function(t,n){var r=u(t);if(r<0||r%n)throw B("Wrong offset!");return r},Mt=function(t){if(F(t)&&_t in t)return t;throw q(t+" is not a typed array!")},kt=function(t,n){if(!(F(t)&&St in t))throw q("It is not a typed array constructor!");return new t(n)},Nt=function(t,n){return jt(N(t,t[bt]),n)},jt=function(t,n){for(var r=0,e=n.length,i=kt(t,e);r<e;)i[r]=n[r++];return i},Rt=function(t,n,r){W(t,n,{get:function(){return this._d[r]}})},Tt=function from(t){var n,r,e,i,o,u,c=p(t),a=arguments.length,f=1<a?arguments[1]:void 0,s=void 0!==f,l=g(c);if(null!=l&&!v(l)){for(u=l.call(c),e=[],n=0;!(o=u.next()).done;n++)e.push(o.value);c=e}for(s&&2<a&&(f=h(f,arguments[2],2)),n=0,r=_(c.length),i=kt(this,r);n<r;n++)i[n]=s?f(c[n],n):c[n];return i},Lt=function of(){for(var t=0,n=arguments.length,r=kt(this,n);t<n;)r[t]=arguments[t++];return r},Ct=!!Y&&x(function(){dt.call(new Y(1))}),Gt=function toLocaleString(){return dt.apply(Ct?gt.call(Mt(this)):Mt(this),arguments)},Dt={copyWithin:function copyWithin(t,n){return G.call(Mt(this),t,n,2<arguments.length?arguments[2]:void 0)},every:function every(t){return rt(Mt(this),t,1<arguments.length?arguments[1]:void 0)},fill:function fill(t){return C.apply(Mt(this),arguments)},filter:function filter(t){return Nt(this,tt(Mt(this),t,1<arguments.length?arguments[1]:void 0))},find:function find(t){return et(Mt(this),t,1<arguments.length?arguments[1]:void 0)},findIndex:function findIndex(t){return it(Mt(this),t,1<arguments.length?arguments[1]:void 0)},forEach:function forEach(t){K(Mt(this),t,1<arguments.length?arguments[1]:void 0)},indexOf:function indexOf(t){return ut(Mt(this),t,1<arguments.length?arguments[1]:void 0)},includes:function includes(t){return ot(Mt(this),t,1<arguments.length?arguments[1]:void 0)},join:function join(t){return pt.apply(Mt(this),arguments)},lastIndexOf:function lastIndexOf(t){return st.apply(Mt(this),arguments)},map:function map(t){return Ft(Mt(this),t,1<arguments.length?arguments[1]:void 0)},reduce:function reduce(t){return lt.apply(Mt(this),arguments)},reduceRight:function reduceRight(t){return ht.apply(Mt(this),arguments)},reverse:function reverse(){for(var t,n=this,r=Mt(n).length,e=Math.floor(r/2),i=0;i<e;)t=n[i],n[i++]=n[--r],n[r]=t;return n},some:function some(t){return nt(Mt(this),t,1<arguments.length?arguments[1]:void 0)},sort:function sort(t){return vt.call(Mt(this),t)},subarray:function subarray(t,n){var r=Mt(this),e=r.length,i=c(t,e);return new(N(r,r[bt]))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,_((void 0===n?e:c(n,e))-i))}},Ut=function slice(t,n){return Nt(this,gt.call(Mt(this),t,n))},Wt=function set(t){Mt(this);var n=At(arguments[1],1),r=this.length,e=p(t),i=_(e.length),o=0;if(r<i+n)throw B(Ot);for(;o<i;)this[n+o]=e[o++]},Vt={entries:function entries(){return ft.call(Mt(this))},keys:function keys(){return at.call(Mt(this))},values:function values(){return ct.call(Mt(this))}},Bt=function(t,n){return F(t)&&t[_t]&&"symbol"!=typeof n&&n in t&&String(+n)==String(n)},qt=function getOwnPropertyDescriptor(t,n){return Bt(t,n=a(n,!0))?i(2,t[n]):V(t,n)},Yt=function defineProperty(t,n,r){return!(Bt(t,n=a(n,!0))&&F(r)&&f(r,"value"))||f(r,"get")||f(r,"set")||r.configurable||f(r,"writable")&&!r.writable||f(r,"enumerable")&&!r.enumerable?W(t,n,r):(t[n]=r.value,t)};wt||(U.f=qt,D.f=Yt),m(m.S+m.F*!wt,"Object",{getOwnPropertyDescriptor:qt,defineProperty:Yt}),x(function(){yt.call({})})&&(yt=dt=function toString(){return pt.call(this)});var zt=o({},Dt);o(zt,Vt),w(zt,xt,Vt.values),o(zt,{slice:Ut,set:Wt,constructor:function(){},toString:yt,toLocaleString:Gt}),Rt(zt,"buffer","b"),Rt(zt,"byteOffset","o"),Rt(zt,"byteLength","l"),Rt(zt,"length","e"),W(zt,mt,{get:function(){return this[_t]}}),n.exports=function(t,l,n,o){function CC(t,i){W(t,i,{get:function(){return t=i,(n=this._d).v[r](t*l+n.o,It);var t,n},set:function(t){return n=i,r=t,e=this._d,o&&(r=(r=Math.round(r))<0?0:255<r?255:255&r),void e.v[u](n*l+e.o,r,It);var n,r,e},enumerable:!0})}var h=t+((o=!!o)?"Clamped":"")+"Array",r="get"+t,u="set"+t,p=d[h],c=p||{},e=p&&P(p),i=!p||!S.ABV,a={},f=p&&p[Q];i?(p=n(function(t,n,r,e){b(t,p,h,"_d");var i,o,u,c,a=0,f=0;if(F(n)){if(!(n instanceof J||(c=O(n))==z||c==X))return _t in n?jt(p,n):Tt.call(p,n);i=n,f=At(r,l);var s=n.byteLength;if(void 0===e){if(s%l)throw B(Ot);if((o=s-f)<0)throw B(Ot)}else if(s<(o=_(e)*l)+f)throw B(Ot);u=o/l}else u=E(n),i=new J(o=u*l);for(w(t,"_d",{b:i,o:f,l:o,e:u,v:new H(i)});a<u;)CC(t,a++)}),f=p[Q]=I(zt),w(f,"constructor",p)):x(function(){p(1)})&&x(function(){new p(-1)})&&T(function(t){new p,new p(null),new p(1.5),new p(t)},!0)||(p=n(function(t,n,r,e){var i;return b(t,p,h),F(n)?n instanceof J||(i=O(n))==z||i==X?void 0!==e?new c(n,At(r,l),e):void 0!==r?new c(n,At(r,l)):new c(n):_t in n?jt(p,n):Tt.call(p,n):new c(E(n))}),K(e!==Function.prototype?A(c).concat(A(e)):A(c),function(t){t in p||w(p,t,c[t])}),p[Q]=f,y||(f.constructor=p));var s=f[xt],v=!!s&&("values"==s.name||null==s.name),g=Vt.values;w(p,St,!0),w(f,_t,h),w(f,Et,!0),w(f,bt,p),(o?new p(1)[mt]==h:mt in f)||W(f,mt,{get:function(){return h}}),a[h]=p,m(m.G+m.W+m.F*(p!=c),a),m(m.S,h,{BYTES_PER_ELEMENT:l}),m(m.S+m.F*x(function(){c.of.call(p,1)}),h,{from:Tt,of:Lt}),$ in f||w(f,$,l),m(m.P,h,Dt),L(h),m(m.P+m.F*Pt,h,{set:Wt}),m(m.P+m.F*!v,h,Vt),y||f.toString==yt||(f.toString=yt),m(m.P+m.F*x(function(){new p(1).slice()}),h,{slice:Ut}),m(m.P+m.F*(x(function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()})||!x(function(){f.toLocaleString.call([1,2])})),h,{toLocaleString:Gt}),R[h]=v?s:g,y||v||w(f,xt,g)}}else n.exports=function(){}},{101:101,103:103,105:105,116:116,117:117,123:123,127:127,137:137,138:138,139:139,141:141,142:142,143:143,145:145,146:146,147:147,152:152,153:153,164:164,37:37,39:39,40:40,41:41,42:42,47:47,54:54,58:58,62:62,64:64,70:70,71:71,72:72,78:78,81:81,86:86,88:88,89:89,98:98,99:99}],145:[function(t,n,r){"use strict";var e=t(70),i=t(58),o=t(89),u=t(146),c=t(72),a=t(117),f=t(64),s=t(37),l=t(139),h=t(141),p=t(138),v=t(103).f,g=t(99).f,y=t(40),d=t(124),x="ArrayBuffer",m="DataView",S="prototype",b="Wrong index!",w=e[x],_=e[m],E=e.Math,O=e.RangeError,F=e.Infinity,I=w,P=E.abs,A=E.pow,M=E.floor,k=E.log,N=E.LN2,j="byteLength",R="byteOffset",T=i?"_b":"buffer",L=i?"_l":j,C=i?"_o":R;function packIEEE754(t,n,r){var e,i,o,u=new Array(r),c=8*r-n-1,a=(1<<c)-1,f=a>>1,s=23===n?A(2,-24)-A(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=P(t))!=t||t===F?(i=t!=t?1:0,e=a):(e=M(k(t)/N),t*(o=A(2,-e))<1&&(e--,o*=2),2<=(t+=1<=e+f?s/o:s*A(2,1-f))*o&&(e++,o/=2),a<=e+f?(i=0,e=a):1<=e+f?(i=(t*o-1)*A(2,n),e+=f):(i=t*A(2,f-1)*A(2,n),e=0));8<=n;u[l++]=255&i,i/=256,n-=8);for(e=e<<n|i,c+=n;0<c;u[l++]=255&e,e/=256,c-=8);return u[--l]|=128*h,u}function unpackIEEE754(t,n,r){var e,i=8*r-n-1,o=(1<<i)-1,u=o>>1,c=i-7,a=r-1,f=t[a--],s=127&f;for(f>>=7;0<c;s=256*s+t[a],a--,c-=8);for(e=s&(1<<-c)-1,s>>=-c,c+=n;0<c;e=256*e+t[a],a--,c-=8);if(0===s)s=1-u;else{if(s===o)return e?NaN:f?-F:F;e+=A(2,n),s-=u}return(f?-1:1)*e*A(2,s-n)}function unpackI32(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function packI8(t){return[255&t]}function packI16(t){return[255&t,t>>8&255]}function packI32(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function packF64(t){return packIEEE754(t,52,8)}function packF32(t){return packIEEE754(t,23,4)}function addGetter(t,n,r){g(t[S],n,{get:function(){return this[r]}})}function get(t,n,r,e){var i=p(+r);if(i+n>t[L])throw O(b);var o=t[T]._b,u=i+t[C],c=o.slice(u,u+n);return e?c:c.reverse()}function set(t,n,r,e,i,o){var u=p(+r);if(u+n>t[L])throw O(b);for(var c=t[T]._b,a=u+t[C],f=e(+i),s=0;s<n;s++)c[a+s]=f[o?s:n-s-1]}if(u.ABV){if(!f(function(){w(1)})||!f(function(){new w(-1)})||f(function(){return new w,new w(1.5),new w(NaN),w.name!=x})){for(var G,D=(w=function ArrayBuffer(t){return s(this,w),new I(p(t))})[S]=I[S],U=v(I),W=0;U.length>W;)(G=U[W++])in w||c(w,G,I[G]);o||(D.constructor=w)}var V=new _(new w(2)),B=_[S].setInt8;V.setInt8(0,2147483648),V.setInt8(1,2147483649),!V.getInt8(0)&&V.getInt8(1)||a(_[S],{setInt8:function setInt8(t,n){B.call(this,t,n<<24>>24)},setUint8:function setUint8(t,n){B.call(this,t,n<<24>>24)}},!0)}else w=function ArrayBuffer(t){s(this,w,x);var n=p(t);this._b=y.call(new Array(n),0),this[L]=n},_=function DataView(t,n,r){s(this,_,m),s(t,w,m);var e=t[L],i=l(n);if(i<0||e<i)throw O("Wrong offset!");if(e<i+(r=void 0===r?e-i:h(r)))throw O("Wrong length!");this[T]=t,this[C]=i,this[L]=r},i&&(addGetter(w,j,"_l"),addGetter(_,"buffer","_b"),addGetter(_,j,"_l"),addGetter(_,R,"_o")),a(_[S],{getInt8:function getInt8(t){return get(this,1,t)[0]<<24>>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var n=get(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function getUint16(t){var n=get(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function getInt32(t){return unpackI32(get(this,4,t,arguments[1]))},getUint32:function getUint32(t){return unpackI32(get(this,4,t,arguments[1]))>>>0},getFloat32:function getFloat32(t){return unpackIEEE754(get(this,4,t,arguments[1]),23,4)},getFloat64:function getFloat64(t){return unpackIEEE754(get(this,8,t,arguments[1]),52,8)},setInt8:function setInt8(t,n){set(this,1,t,packI8,n)},setUint8:function setUint8(t,n){set(this,1,t,packI8,n)},setInt16:function setInt16(t,n){set(this,2,t,packI16,n,arguments[2])},setUint16:function setUint16(t,n){set(this,2,t,packI16,n,arguments[2])},setInt32:function setInt32(t,n){set(this,4,t,packI32,n,arguments[2])},setUint32:function setUint32(t,n){set(this,4,t,packI32,n,arguments[2])},setFloat32:function setFloat32(t,n){set(this,4,t,packF32,n,arguments[2])},setFloat64:function setFloat64(t,n){set(this,8,t,packF64,n,arguments[2])}});d(w,x),d(_,m),c(_[S],u.VIEW,!0),r[x]=w,r[m]=_},{103:103,117:117,124:124,138:138,139:139,141:141,146:146,37:37,40:40,58:58,64:64,70:70,72:72,89:89,99:99}],146:[function(t,n,r){for(var e,i=t(70),o=t(72),u=t(147),c=u("typed_array"),a=u("view"),f=!(!i.ArrayBuffer||!i.DataView),s=f,l=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(e=i[h[l++]])?(o(e.prototype,c,!0),o(e.prototype,a,!0)):s=!1;n.exports={ABV:f,CONSTR:s,TYPED:c,VIEW:a}},{147:147,70:70,72:72}],147:[function(t,n,r){var e=0,i=Math.random();n.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+i).toString(36))}},{}],148:[function(t,n,r){var e=t(70).navigator;n.exports=e&&e.userAgent||""},{70:70}],149:[function(t,n,r){var e=t(81);n.exports=function(t,n){if(!e(t)||t._t!==n)throw TypeError("Incompatible receiver, "+n+" required!");return t}},{81:81}],150:[function(t,n,r){var e=t(70),i=t(52),o=t(89),u=t(151),c=t(99).f;n.exports=function(t){var n=i.Symbol||(i.Symbol=o?{}:e.Symbol||{});"_"==t.charAt(0)||t in n||c(n,t,{value:u.f(t)})}},{151:151,52:52,70:70,89:89,99:99}],151:[function(t,n,r){r.f=t(152)},{152:152}],152:[function(t,n,r){var e=t(126)("wks"),i=t(147),o=t(70).Symbol,u="function"==typeof o;(n.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},{126:126,147:147,70:70}],153:[function(t,n,r){var e=t(47),i=t(152)("iterator"),o=t(88);n.exports=t(52).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[e(t)]}},{152:152,47:47,52:52,88:88}],154:[function(t,n,r){var e=t(62);e(e.P,"Array",{copyWithin:t(39)}),t(35)("copyWithin")},{35:35,39:39,62:62}],155:[function(t,n,r){"use strict";var e=t(62),i=t(42)(4);e(e.P+e.F*!t(128)([].every,!0),"Array",{every:function every(t){return i(this,t,arguments[1])}})},{128:128,42:42,62:62}],156:[function(t,n,r){var e=t(62);e(e.P,"Array",{fill:t(40)}),t(35)("fill")},{35:35,40:40,62:62}],157:[function(t,n,r){"use strict";var e=t(62),i=t(42)(2);e(e.P+e.F*!t(128)([].filter,!0),"Array",{filter:function filter(t){return i(this,t,arguments[1])}})},{128:128,42:42,62:62}],158:[function(t,n,r){"use strict";var e=t(62),i=t(42)(6),o="findIndex",u=!0;o in[]&&Array(1)[o](function(){u=!1}),e(e.P+e.F*u,"Array",{findIndex:function findIndex(t){return i(this,t,1<arguments.length?arguments[1]:void 0)}}),t(35)(o)},{35:35,42:42,62:62}],159:[function(t,n,r){"use strict";var e=t(62),i=t(42)(5),o="find",u=!0;o in[]&&Array(1)[o](function(){u=!1}),e(e.P+e.F*u,"Array",{find:function find(t){return i(this,t,1<arguments.length?arguments[1]:void 0)}}),t(35)(o)},{35:35,42:42,62:62}],160:[function(t,n,r){"use strict";var e=t(62),i=t(42)(0),o=t(128)([].forEach,!0);e(e.P+e.F*!o,"Array",{forEach:function forEach(t){return i(this,t,arguments[1])}})},{128:128,42:42,62:62}],161:[function(t,n,r){"use strict";var h=t(54),e=t(62),p=t(142),v=t(83),g=t(78),y=t(141),d=t(53),x=t(153);e(e.S+e.F*!t(86)(function(t){Array.from(t)}),"Array",{from:function from(t){var n,r,e,i,o=p(t),u="function"==typeof this?this:Array,c=arguments.length,a=1<c?arguments[1]:void 0,f=void 0!==a,s=0,l=x(o);if(f&&(a=h(a,2<c?arguments[2]:void 0,2)),null==l||u==Array&&g(l))for(r=new u(n=y(o.length));s<n;s++)d(r,s,f?a(o[s],s):o[s]);else for(i=l.call(o),r=new u;!(e=i.next()).done;s++)d(r,s,f?v(i,a,[e.value,s],!0):e.value);return r.length=s,r}})},{141:141,142:142,153:153,53:53,54:54,62:62,78:78,83:83,86:86}],162:[function(t,n,r){"use strict";var e=t(62),i=t(41)(!1),o=[].indexOf,u=!!o&&1/[1].indexOf(1,-0)<0;e(e.P+e.F*(u||!t(128)(o)),"Array",{indexOf:function indexOf(t){return u?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},{128:128,41:41,62:62}],163:[function(t,n,r){var e=t(62);e(e.S,"Array",{isArray:t(79)})},{62:62,79:79}],164:[function(t,n,r){"use strict";var e=t(35),i=t(87),o=t(88),u=t(140);n.exports=t(85)(Array,"Array",function(t,n){this._t=u(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,i(1)):i(0,"keys"==n?r:"values"==n?t[r]:[r,t[r]])},"values"),o.Arguments=o.Array,e("keys"),e("values"),e("entries")},{140:140,35:35,85:85,87:87,88:88}],165:[function(t,n,r){"use strict";var e=t(62),i=t(140),o=[].join;e(e.P+e.F*(t(77)!=Object||!t(128)(o)),"Array",{join:function join(t){return o.call(i(this),void 0===t?",":t)}})},{128:128,140:140,62:62,77:77}],166:[function(t,n,r){"use strict";var e=t(62),i=t(140),o=t(139),u=t(141),c=[].lastIndexOf,a=!!c&&1/[1].lastIndexOf(1,-0)<0;e(e.P+e.F*(a||!t(128)(c)),"Array",{lastIndexOf:function lastIndexOf(t){if(a)return c.apply(this,arguments)||0;var n=i(this),r=u(n.length),e=r-1;for(1<arguments.length&&(e=Math.min(e,o(arguments[1]))),e<0&&(e=r+e);0<=e;e--)if(e in n&&n[e]===t)return e||0;return-1}})},{128:128,139:139,140:140,141:141,62:62}],167:[function(t,n,r){"use strict";var e=t(62),i=t(42)(1);e(e.P+e.F*!t(128)([].map,!0),"Array",{map:function map(t){return i(this,t,arguments[1])}})},{128:128,42:42,62:62}],168:[function(t,n,r){"use strict";var e=t(62),i=t(53);e(e.S+e.F*t(64)(function(){function F(){}return!(Array.of.call(F)instanceof F)}),"Array",{of:function of(){for(var t=0,n=arguments.length,r=new("function"==typeof this?this:Array)(n);t<n;)i(r,t,arguments[t++]);return r.length=n,r}})},{53:53,62:62,64:64}],169:[function(t,n,r){"use strict";var e=t(62),i=t(43);e(e.P+e.F*!t(128)([].reduceRight,!0),"Array",{reduceRight:function reduceRight(t){return i(this,t,arguments.length,arguments[1],!0)}})},{128:128,43:43,62:62}],170:[function(t,n,r){"use strict";var e=t(62),i=t(43);e(e.P+e.F*!t(128)([].reduce,!0),"Array",{reduce:function reduce(t){return i(this,t,arguments.length,arguments[1],!1)}})},{128:128,43:43,62:62}],171:[function(t,n,r){"use strict";var e=t(62),i=t(73),f=t(48),s=t(137),l=t(141),h=[].slice;e(e.P+e.F*t(64)(function(){i&&h.call(i)}),"Array",{slice:function slice(t,n){var r=l(this.length),e=f(this);if(n=void 0===n?r:n,"Array"==e)return h.call(this,t,n);for(var i=s(t,r),o=s(n,r),u=l(o-i),c=new Array(u),a=0;a<u;a++)c[a]="String"==e?this.charAt(i+a):this[i+a];return c}})},{137:137,141:141,48:48,62:62,64:64,73:73}],172:[function(t,n,r){"use strict";var e=t(62),i=t(42)(3);e(e.P+e.F*!t(128)([].some,!0),"Array",{some:function some(t){return i(this,t,arguments[1])}})},{128:128,42:42,62:62}],173:[function(t,n,r){"use strict";var e=t(62),i=t(33),o=t(142),u=t(64),c=[].sort,a=[1,2,3];e(e.P+e.F*(u(function(){a.sort(void 0)})||!u(function(){a.sort(null)})||!t(128)(c)),"Array",{sort:function sort(t){return void 0===t?c.call(o(this)):c.call(o(this),i(t))}})},{128:128,142:142,33:33,62:62,64:64}],174:[function(t,n,r){t(123)("Array")},{123:123}],175:[function(t,n,r){var e=t(62);e(e.S,"Date",{now:function(){return(new Date).getTime()}})},{62:62}],176:[function(t,n,r){var e=t(62),i=t(55);e(e.P+e.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},{55:55,62:62}],177:[function(t,n,r){"use strict";var e=t(62),i=t(142),o=t(143);e(e.P+e.F*t(64)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function toJSON(t){var n=i(this),r=o(n);return"number"!=typeof r||isFinite(r)?n.toISOString():null}})},{142:142,143:143,62:62,64:64}],178:[function(t,n,r){var e=t(152)("toPrimitive"),i=Date.prototype;e in i||t(72)(i,e,t(56))},{152:152,56:56,72:72}],179:[function(t,n,r){var e=Date.prototype,i="Invalid Date",o="toString",u=e[o],c=e.getTime;new Date(NaN)+""!=i&&t(118)(e,o,function toString(){var t=c.call(this);return t==t?u.call(this):i})},{118:118}],180:[function(t,n,r){var e=t(62);e(e.P,"Function",{bind:t(46)})},{46:46,62:62}],181:[function(t,n,r){"use strict";var e=t(81),i=t(105),o=t(152)("hasInstance"),u=Function.prototype;o in u||t(99).f(u,o,{value:function(t){if("function"!=typeof this||!e(t))return!1;if(!e(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},{105:105,152:152,81:81,99:99}],182:[function(t,n,r){var e=t(99).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||t(58)&&e(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},{58:58,99:99}],183:[function(t,n,r){"use strict";var e=t(49),i=t(149);n.exports=t(51)("Map",function(t){return function Map(){return t(this,0<arguments.length?arguments[0]:void 0)}},{get:function get(t){var n=e.getEntry(i(this,"Map"),t);return n&&n.v},set:function set(t,n){return e.def(i(this,"Map"),0===t?0:t,n)}},e,!0)},{149:149,49:49,51:51}],184:[function(t,n,r){var e=t(62),i=t(92),o=Math.sqrt,u=Math.acosh;e(e.S+e.F*!(u&&710==Math.floor(u(Number.MAX_VALUE))&&u(1/0)==1/0),"Math",{acosh:function acosh(t){return(t=+t)<1?NaN:94906265.62425156<t?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},{62:62,92:92}],185:[function(t,n,r){var e=t(62),i=Math.asinh;e(e.S+e.F*!(i&&0<1/i(0)),"Math",{asinh:function asinh(t){return isFinite(t=+t)&&0!=t?t<0?-asinh(-t):Math.log(t+Math.sqrt(t*t+1)):t}})},{62:62}],186:[function(t,n,r){var e=t(62),i=Math.atanh;e(e.S+e.F*!(i&&1/i(-0)<0),"Math",{atanh:function atanh(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},{62:62}],187:[function(t,n,r){var e=t(62),i=t(93);e(e.S,"Math",{cbrt:function cbrt(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},{62:62,93:93}],188:[function(t,n,r){var e=t(62);e(e.S,"Math",{clz32:function clz32(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},{62:62}],189:[function(t,n,r){var e=t(62),i=Math.exp;e(e.S,"Math",{cosh:function cosh(t){return(i(t=+t)+i(-t))/2}})},{62:62}],190:[function(t,n,r){var e=t(62),i=t(90);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},{62:62,90:90}],191:[function(t,n,r){var e=t(62);e(e.S,"Math",{fround:t(91)})},{62:62,91:91}],192:[function(t,n,r){var e=t(62),a=Math.abs;e(e.S,"Math",{hypot:function hypot(t,n){for(var r,e,i=0,o=0,u=arguments.length,c=0;o<u;)c<(r=a(arguments[o++]))?(i=i*(e=c/r)*e+1,c=r):i+=0<r?(e=r/c)*e:r;return c===1/0?1/0:c*Math.sqrt(i)}})},{62:62}],193:[function(t,n,r){var e=t(62),i=Math.imul;e(e.S+e.F*t(64)(function(){return-5!=i(4294967295,5)||2!=i.length}),"Math",{imul:function imul(t,n){var r=65535,e=+t,i=+n,o=r&e,u=r&i;return 0|o*u+((r&e>>>16)*u+o*(r&i>>>16)<<16>>>0)}})},{62:62,64:64}],194:[function(t,n,r){var e=t(62);e(e.S,"Math",{log10:function log10(t){return Math.log(t)*Math.LOG10E}})},{62:62}],195:[function(t,n,r){var e=t(62);e(e.S,"Math",{log1p:t(92)})},{62:62,92:92}],196:[function(t,n,r){var e=t(62);e(e.S,"Math",{log2:function log2(t){return Math.log(t)/Math.LN2}})},{62:62}],197:[function(t,n,r){var e=t(62);e(e.S,"Math",{sign:t(93)})},{62:62,93:93}],198:[function(t,n,r){var e=t(62),i=t(90),o=Math.exp;e(e.S+e.F*t(64)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function sinh(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},{62:62,64:64,90:90}],199:[function(t,n,r){var e=t(62),i=t(90),o=Math.exp;e(e.S,"Math",{tanh:function tanh(t){var n=i(t=+t),r=i(-t);return n==1/0?1:r==1/0?-1:(n-r)/(o(t)+o(-t))}})},{62:62,90:90}],200:[function(t,n,r){var e=t(62);e(e.S,"Math",{trunc:function trunc(t){return(0<t?Math.floor:Math.ceil)(t)}})},{62:62}],201:[function(t,n,r){"use strict";function EN(t){var n=s(t,!1);if("string"==typeof n&&2<n.length){var r,e,i,o=(n=x?n.trim():h(n,3)).charCodeAt(0);if(43===o||45===o){if(88===(r=n.charCodeAt(2))||120===r)return NaN}else if(48===o){switch(n.charCodeAt(1)){case 66:case 98:e=2,i=49;break;case 79:case 111:e=8,i=55;break;default:return+n}for(var u,c=n.slice(2),a=0,f=c.length;a<f;a++)if((u=c.charCodeAt(a))<48||i<u)return NaN;return parseInt(c,e)}}return+n}var e=t(70),i=t(71),o=t(48),u=t(75),s=t(143),c=t(64),a=t(103).f,f=t(101).f,l=t(99).f,h=t(134).trim,p="Number",v=e[p],g=v,y=v.prototype,d=o(t(98)(y))==p,x="trim"in String.prototype;if(!v(" 0o1")||!v("0b1")||v("+0x1")){v=function Number(t){var n=arguments.length<1?0:t,r=this;return r instanceof v&&(d?c(function(){y.valueOf.call(r)}):o(r)!=p)?u(new g(EN(n)),r,v):EN(n)};for(var m,S=t(58)?a(g):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),b=0;S.length>b;b++)i(g,m=S[b])&&!i(v,m)&&l(v,m,f(g,m));(v.prototype=y).constructor=v,t(118)(e,p,v)}},{101:101,103:103,118:118,134:134,143:143,48:48,58:58,64:64,70:70,71:71,75:75,98:98,99:99}],202:[function(t,n,r){var e=t(62);e(e.S,"Number",{EPSILON:Math.pow(2,-52)})},{62:62}],203:[function(t,n,r){var e=t(62),i=t(70).isFinite;e(e.S,"Number",{isFinite:function isFinite(t){return"number"==typeof t&&i(t)}})},{62:62,70:70}],204:[function(t,n,r){var e=t(62);e(e.S,"Number",{isInteger:t(80)})},{62:62,80:80}],205:[function(t,n,r){var e=t(62);e(e.S,"Number",{isNaN:function isNaN(t){return t!=t}})},{62:62}],206:[function(t,n,r){var e=t(62),i=t(80),o=Math.abs;e(e.S,"Number",{isSafeInteger:function isSafeInteger(t){return i(t)&&o(t)<=9007199254740991}})},{62:62,80:80}],207:[function(t,n,r){var e=t(62);e(e.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},{62:62}],208:[function(t,n,r){var e=t(62);e(e.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},{62:62}],209:[function(t,n,r){var e=t(62),i=t(112);e(e.S+e.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},{112:112,62:62}],210:[function(t,n,r){var e=t(62),i=t(113);e(e.S+e.F*(Number.parseInt!=i),"Number",{parseInt:i})},{113:113,62:62}],211:[function(t,n,r){"use strict";function XO(t,n){for(var r=-1,e=n;++r<6;)e+=t*u[r],u[r]=e%1e7,e=o(e/1e7)}function YO(t){for(var n=6,r=0;0<=--n;)r+=u[n],u[n]=o(r/t),r=r%t*1e7}function ZO(){for(var t=6,n="";0<=--t;)if(""!==n||0===t||0!==u[t]){var r=String(u[t]);n=""===n?r:n+l.call("0",7-r.length)+r}return n}var e=t(62),f=t(139),s=t(34),l=t(133),i=1..toFixed,o=Math.floor,u=[0,0,0,0,0,0],h="Number.toFixed: incorrect invocation!",p=function(t,n,r){return 0===n?r:n%2==1?p(t,n-1,r*t):p(t*t,n/2,r)};e(e.P+e.F*(!!i&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!t(64)(function(){i.call({})})),"Number",{toFixed:function toFixed(t){var n,r,e,i,o=s(this,h),u=f(t),c="",a="0";if(u<0||20<u)throw RangeError(h);if(o!=o)return"NaN";if(o<=-1e21||1e21<=o)return String(o);if(o<0&&(c="-",o=-o),1e-21<o)if(r=(n=function(t){for(var n=0,r=t;4096<=r;)n+=12,r/=4096;for(;2<=r;)n+=1,r/=2;return n}(o*p(2,69,1))-69)<0?o*p(2,-n,1):o/p(2,n,1),r*=4503599627370496,0<(n=52-n)){for(XO(0,r),e=u;7<=e;)XO(1e7,0),e-=7;for(XO(p(10,e,1),0),e=n-1;23<=e;)YO(1<<23),e-=23;YO(1<<e),XO(1,1),YO(2),a=ZO()}else XO(0,r),XO(1<<-n,0),a=ZO()+l.call("0",u);return a=0<u?c+((i=a.length)<=u?"0."+l.call("0",u-i)+a:a.slice(0,i-u)+"."+a.slice(i-u)):c+a}})},{133:133,139:139,34:34,62:62,64:64}],212:[function(t,n,r){"use strict";var e=t(62),i=t(64),o=t(34),u=1..toPrecision;e(e.P+e.F*(i(function(){return"1"!==u.call(1,void 0)})||!i(function(){u.call({})})),"Number",{toPrecision:function toPrecision(t){var n=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?u.call(n):u.call(n,t)}})},{34:34,62:62,64:64}],213:[function(t,n,r){var e=t(62);e(e.S+e.F,"Object",{assign:t(97)})},{62:62,97:97}],214:[function(t,n,r){var e=t(62);e(e.S,"Object",{create:t(98)})},{62:62,98:98}],215:[function(t,n,r){var e=t(62);e(e.S+e.F*!t(58),"Object",{defineProperties:t(100)})},{100:100,58:58,62:62}],216:[function(t,n,r){var e=t(62);e(e.S+e.F*!t(58),"Object",{defineProperty:t(99).f})},{58:58,62:62,99:99}],217:[function(t,n,r){var e=t(81),i=t(94).onFreeze;t(109)("freeze",function(n){return function freeze(t){return n&&e(t)?n(i(t)):t}})},{109:109,81:81,94:94}],218:[function(t,n,r){var e=t(140),i=t(101).f;t(109)("getOwnPropertyDescriptor",function(){return function getOwnPropertyDescriptor(t,n){return i(e(t),n)}})},{101:101,109:109,140:140}],219:[function(t,n,r){t(109)("getOwnPropertyNames",function(){return t(102).f})},{102:102,109:109}],220:[function(t,n,r){var e=t(142),i=t(105);t(109)("getPrototypeOf",function(){return function getPrototypeOf(t){return i(e(t))}})},{105:105,109:109,142:142}],221:[function(t,n,r){var e=t(81);t(109)("isExtensible",function(n){return function isExtensible(t){return!!e(t)&&(!n||n(t))}})},{109:109,81:81}],222:[function(t,n,r){var e=t(81);t(109)("isFrozen",function(n){return function isFrozen(t){return!e(t)||!!n&&n(t)}})},{109:109,81:81}],223:[function(t,n,r){var e=t(81);t(109)("isSealed",function(n){return function isSealed(t){return!e(t)||!!n&&n(t)}})},{109:109,81:81}],224:[function(t,n,r){var e=t(62);e(e.S,"Object",{is:t(121)})},{121:121,62:62}],225:[function(t,n,r){var e=t(142),i=t(107);t(109)("keys",function(){return function keys(t){return i(e(t))}})},{107:107,109:109,142:142}],226:[function(t,n,r){var e=t(81),i=t(94).onFreeze;t(109)("preventExtensions",function(n){return function preventExtensions(t){return n&&e(t)?n(i(t)):t}})},{109:109,81:81,94:94}],227:[function(t,n,r){var e=t(81),i=t(94).onFreeze;t(109)("seal",function(n){return function seal(t){return n&&e(t)?n(i(t)):t}})},{109:109,81:81,94:94}],228:[function(t,n,r){var e=t(62);e(e.S,"Object",{setPrototypeOf:t(122).set})},{122:122,62:62}],229:[function(t,n,r){"use strict";var e=t(47),i={};i[t(152)("toStringTag")]="z",i+""!="[object z]"&&t(118)(Object.prototype,"toString",function toString(){return"[object "+e(this)+"]"},!0)},{118:118,152:152,47:47}],230:[function(t,n,r){var e=t(62),i=t(112);e(e.G+e.F*(parseFloat!=i),{parseFloat:i})},{112:112,62:62}],231:[function(t,n,r){var e=t(62),i=t(113);e(e.G+e.F*(parseInt!=i),{parseInt:i})},{113:113,62:62}],232:[function(r,t,n){"use strict";function $R(){}function fS(t){var n;return!(!h(t)||"function"!=typeof(n=t.then))&&n}function gS(s,r){if(!s._n){s._n=!0;var e=s._c;x(function(){for(var a=s._v,f=1==s._s,t=0,n=function(t){var n,r,e,i=f?t.ok:t.fail,o=t.resolve,u=t.reject,c=t.domain;try{i?(f||(2==s._h&&R(s),s._h=1),!0===i?n=a:(c&&c.enter(),n=i(a),c&&(c.exit(),e=!0)),n===t.promise?u(E("Promise-chain cycle")):(r=fS(n))?r.call(n,o,u):o(n)):u(a)}catch(t){c&&!e&&c.exit(),u(t)}};e.length>t;)n(e[t++]);s._c=[],s._n=!1,r&&!s._h&&N(s)})}}function kS(t){var n=this;n._d||(n._d=!0,(n=n._w||n)._v=t,n._s=2,n._a||(n._a=n._c.slice()),gS(n,!0))}var e,i,o,u,c=r(89),a=r(70),f=r(54),s=r(47),l=r(62),h=r(81),p=r(33),v=r(37),g=r(68),y=r(127),d=r(136).set,x=r(95)(),m=r(96),S=r(114),b=r(148),w=r(115),_="Promise",E=a.TypeError,O=a.process,F=O&&O.versions,I=F&&F.v8||"",P=a[_],A="process"==s(O),M=i=m.f,k=!!function(){try{var t=P.resolve(1),n=(t.constructor={})[r(152)("species")]=function(t){t($R,$R)};return(A||"function"==typeof PromiseRejectionEvent)&&t.then($R)instanceof n&&0!==I.indexOf("6.6")&&-1===b.indexOf("Chrome/66")}catch(t){}}(),N=function(o){d.call(a,function(){var t,n,r,e=o._v,i=j(o);if(i&&(t=S(function(){A?O.emit("unhandledRejection",e,o):(n=a.onunhandledrejection)?n({promise:o,reason:e}):(r=a.console)&&r.error&&r.error("Unhandled promise rejection",e)}),o._h=A||j(o)?2:1),o._a=void 0,i&&t.e)throw t.v})},j=function(t){return 1!==t._h&&0===(t._a||t._c).length},R=function(n){d.call(a,function(){var t;A?O.emit("rejectionHandled",n):(t=a.onrejectionhandled)&&t({promise:n,reason:n._v})})},T=function(t){var r,e=this;if(!e._d){e._d=!0,e=e._w||e;try{if(e===t)throw E("Promise can't be resolved itself");(r=fS(t))?x(function(){var n={_w:e,_d:!1};try{r.call(t,f(T,n,1),f(kS,n,1))}catch(t){kS.call(n,t)}}):(e._v=t,e._s=1,gS(e,!1))}catch(t){kS.call({_w:e,_d:!1},t)}}};k||(P=function Promise(t){v(this,P,_,"_h"),p(t),e.call(this);try{t(f(T,this,1),f(kS,this,1))}catch(t){kS.call(this,t)}},(e=function Promise(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=r(117)(P.prototype,{then:function then(t,n){var r=M(y(this,P));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=A?O.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&gS(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new e;this.promise=t,this.resolve=f(T,t,1),this.reject=f(kS,t,1)},m.f=M=function(t){return t===P||t===u?new o(t):i(t)}),l(l.G+l.W+l.F*!k,{Promise:P}),r(124)(P,_),r(123)(_),u=r(52)[_],l(l.S+l.F*!k,_,{reject:function reject(t){var n=M(this);return(0,n.reject)(t),n.promise}}),l(l.S+l.F*(c||!k),_,{resolve:function resolve(t){return w(c&&this===u?P:this,t)}}),l(l.S+l.F*!(k&&r(86)(function(t){P.all(t).catch($R)})),_,{all:function all(t){var u=this,n=M(u),c=n.resolve,a=n.reject,r=S(function(){var e=[],i=0,o=1;g(t,!1,function(t){var n=i++,r=!1;e.push(void 0),o++,u.resolve(t).then(function(t){r||(r=!0,e[n]=t,--o||c(e))},a)}),--o||c(e)});return r.e&&a(r.v),n.promise},race:function race(t){var n=this,r=M(n),e=r.reject,i=S(function(){g(t,!1,function(t){n.resolve(t).then(r.resolve,e)})});return i.e&&e(i.v),r.promise}})},{114:114,115:115,117:117,123:123,124:124,127:127,136:136,148:148,152:152,33:33,37:37,47:47,52:52,54:54,62:62,68:68,70:70,81:81,86:86,89:89,95:95,96:96}],233:[function(t,n,r){var e=t(62),o=t(33),u=t(38),c=(t(70).Reflect||{}).apply,a=Function.apply;e(e.S+e.F*!t(64)(function(){c(function(){})}),"Reflect",{apply:function apply(t,n,r){var e=o(t),i=u(r);return c?c(e,n,i):a.call(e,n,i)}})},{33:33,38:38,62:62,64:64,70:70}],234:[function(t,n,r){var e=t(62),c=t(98),a=t(33),f=t(38),s=t(81),i=t(64),l=t(46),h=(t(70).Reflect||{}).construct,p=i(function(){function F(){}return!(h(function(){},[],F)instanceof F)}),v=!i(function(){h(function(){})});e(e.S+e.F*(p||v),"Reflect",{construct:function construct(t,n){a(t),f(n);var r=arguments.length<3?t:a(arguments[2]);if(v&&!p)return h(t,n,r);if(t==r){switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3])}var e=[null];return e.push.apply(e,n),new(l.apply(t,e))}var i=r.prototype,o=c(s(i)?i:Object.prototype),u=Function.apply.call(t,o,n);return s(u)?u:o}})},{33:33,38:38,46:46,62:62,64:64,70:70,81:81,98:98}],235:[function(t,n,r){var e=t(99),i=t(62),o=t(38),u=t(143);i(i.S+i.F*t(64)(function(){Reflect.defineProperty(e.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function defineProperty(t,n,r){o(t),n=u(n,!0),o(r);try{return e.f(t,n,r),!0}catch(t){return!1}}})},{143:143,38:38,62:62,64:64,99:99}],236:[function(t,n,r){var e=t(62),i=t(101).f,o=t(38);e(e.S,"Reflect",{deleteProperty:function deleteProperty(t,n){var r=i(o(t),n);return!(r&&!r.configurable)&&delete t[n]}})},{101:101,38:38,62:62}],237:[function(t,n,r){"use strict";function IU(t){this._t=i(t),this._i=0;var n,r=this._k=[];for(n in t)r.push(n)}var e=t(62),i=t(38);t(84)(IU,"Object",function(){var t,n=this._k;do{if(this._i>=n.length)return{value:void 0,done:!0}}while(!((t=n[this._i++])in this._t));return{value:t,done:!1}}),e(e.S,"Reflect",{enumerate:function enumerate(t){return new IU(t)}})},{38:38,62:62,84:84}],238:[function(t,n,r){var e=t(101),i=t(62),o=t(38);i(i.S,"Reflect",{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(t,n){return e.f(o(t),n)}})},{101:101,38:38,62:62}],239:[function(t,n,r){var e=t(62),i=t(105),o=t(38);e(e.S,"Reflect",{getPrototypeOf:function getPrototypeOf(t){return i(o(t))}})},{105:105,38:38,62:62}],240:[function(t,n,r){var o=t(101),u=t(105),c=t(71),e=t(62),a=t(81),f=t(38);e(e.S,"Reflect",{get:function get(t,n){var r,e,i=arguments.length<3?t:arguments[2];return f(t)===i?t[n]:(r=o.f(t,n))?c(r,"value")?r.value:void 0!==r.get?r.get.call(i):void 0:a(e=u(t))?get(e,n,i):void 0}})},{101:101,105:105,38:38,62:62,71:71,81:81}],241:[function(t,n,r){var e=t(62);e(e.S,"Reflect",{has:function has(t,n){return n in t}})},{62:62}],242:[function(t,n,r){var e=t(62),i=t(38),o=Object.isExtensible;e(e.S,"Reflect",{isExtensible:function isExtensible(t){return i(t),!o||o(t)}})},{38:38,62:62}],243:[function(t,n,r){var e=t(62);e(e.S,"Reflect",{ownKeys:t(111)})},{111:111,62:62}],244:[function(t,n,r){var e=t(62),i=t(38),o=Object.preventExtensions;e(e.S,"Reflect",{preventExtensions:function preventExtensions(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},{38:38,62:62}],245:[function(t,n,r){var e=t(62),i=t(122);i&&e(e.S,"Reflect",{setPrototypeOf:function setPrototypeOf(t,n){i.check(t,n);try{return i.set(t,n),!0}catch(t){return!1}}})},{122:122,62:62}],246:[function(t,n,r){var c=t(99),a=t(101),f=t(105),s=t(71),e=t(62),l=t(116),h=t(38),p=t(81);e(e.S,"Reflect",{set:function set(t,n,r){var e,i,o=arguments.length<4?t:arguments[3],u=a.f(h(t),n);if(!u){if(p(i=f(t)))return set(i,n,r,o);u=l(0)}if(s(u,"value")){if(!1===u.writable||!p(o))return!1;if(e=a.f(o,n)){if(e.get||e.set||!1===e.writable)return!1;e.value=r,c.f(o,n,e)}else c.f(o,n,l(0,r));return!0}return void 0!==u.set&&(u.set.call(o,r),!0)}})},{101:101,105:105,116:116,38:38,62:62,71:71,81:81,99:99}],247:[function(t,n,r){var e=t(70),o=t(75),i=t(99).f,u=t(103).f,c=t(82),a=t(66),f=e.RegExp,s=f,l=f.prototype,h=/a/g,p=/a/g,v=new f(h)!==h;if(t(58)&&(!v||t(64)(function(){return p[t(152)("match")]=!1,f(h)!=h||f(p)==p||"/a/i"!=f(h,"i")}))){f=function RegExp(t,n){var r=this instanceof f,e=c(t),i=void 0===n;return!r&&e&&t.constructor===f&&i?t:o(v?new s(e&&!i?t.source:t,n):s((e=t instanceof f)?t.source:t,e&&i?a.call(t):n),r?this:l,f)};function DW(n){n in f||i(f,n,{configurable:!0,get:function(){return s[n]},set:function(t){s[n]=t}})}for(var g=u(s),y=0;g.length>y;)DW(g[y++]);(l.constructor=f).prototype=l,t(118)(e,"RegExp",f)}t(123)("RegExp")},{103:103,118:118,123:123,152:152,58:58,64:64,66:66,70:70,75:75,82:82,99:99}],248:[function(t,n,r){"use strict";var e=t(120);t(62)({target:"RegExp",proto:!0,forced:e!==/./.exec},{exec:e})},{120:120,62:62}],249:[function(t,n,r){t(58)&&"g"!=/./g.flags&&t(99).f(RegExp.prototype,"flags",{configurable:!0,get:t(66)})},{58:58,66:66,99:99}],250:[function(t,n,r){"use strict";var l=t(38),h=t(141),p=t(36),v=t(119);t(65)("match",1,function(e,i,f,s){return[function match(t){var n=e(this),r=null==t?void 0:t[i];return void 0!==r?r.call(t,n):new RegExp(t)[i](String(n))},function(t){var n=s(f,t,this);if(n.done)return n.value;var r=l(t),e=String(this);if(!r.global)return v(r,e);for(var i,o=r.unicode,u=[],c=r.lastIndex=0;null!==(i=v(r,e));){var a=String(i[0]);""===(u[c]=a)&&(r.lastIndex=p(e,h(r.lastIndex),o)),c++}return 0===c?null:u}]})},{119:119,141:141,36:36,38:38,65:65}],251:[function(t,n,r){"use strict";var _=t(38),e=t(142),E=t(141),O=t(139),F=t(36),I=t(119),P=Math.max,A=Math.min,h=Math.floor,p=/\$([$&`']|\d\d?|<[^>]*>)/g,v=/\$([$&`']|\d\d?)/g;t(65)("replace",2,function(i,o,b,w){return[function replace(t,n){var r=i(this),e=null==t?void 0:t[o];return void 0!==e?e.call(t,r,n):b.call(String(r),t,n)},function(t,n){var r=w(b,t,this,n);if(r.done)return r.value;var e=_(t),i=String(this),o="function"==typeof n;o||(n=String(n));var u=e.global;if(u){var c=e.unicode;e.lastIndex=0}for(var a=[];;){var f=I(e,i);if(null===f)break;if(a.push(f),!u)break;""===String(f[0])&&(e.lastIndex=F(i,E(e.lastIndex),c))}for(var s,l="",h=0,p=0;p<a.length;p++){f=a[p];for(var v=String(f[0]),g=P(A(O(f.index),i.length),0),y=[],d=1;d<f.length;d++)y.push(void 0===(s=f[d])?s:String(s));var x=f.groups;if(o){var m=[v].concat(y,g,i);void 0!==x&&m.push(x);var S=String(n.apply(void 0,m))}else S=getSubstitution(v,i,g,y,x,n);h<=g&&(l+=i.slice(h,g)+S,h=g+v.length)}return l+i.slice(h)}];function getSubstitution(o,u,c,a,f,t){var s=c+o.length,l=a.length,n=v;return void 0!==f&&(f=e(f),n=p),b.call(t,n,function(t,n){var r;switch(n.charAt(0)){case"$":return"$";case"&":return o;case"`":return u.slice(0,c);case"'":return u.slice(s);case"<":r=f[n.slice(1,-1)];break;default:var e=+n;if(0==e)return t;if(l<e){var i=h(e/10);return 0===i?t:i<=l?void 0===a[i-1]?n.charAt(1):a[i-1]+n.charAt(1):t}r=a[e-1]}return void 0===r?"":r})}})},{119:119,139:139,141:141,142:142,36:36,38:38,65:65}],252:[function(t,n,r){"use strict";var a=t(38),f=t(121),s=t(119);t(65)("search",1,function(e,i,u,c){return[function search(t){var n=e(this),r=null==t?void 0:t[i];return void 0!==r?r.call(t,n):new RegExp(t)[i](String(n))},function(t){var n=c(u,t,this);if(n.done)return n.value;var r=a(t),e=String(this),i=r.lastIndex;f(i,0)||(r.lastIndex=0);var o=s(r,e);return f(r.lastIndex,i)||(r.lastIndex=i),null===o?-1:o.index}]})},{119:119,121:121,38:38,65:65}],253:[function(t,n,r){"use strict";var l=t(82),m=t(38),S=t(127),b=t(36),w=t(141),_=t(119),h=t(120),e=t(64),E=Math.min,p=[].push,u="split",v="length",g="lastIndex",O=4294967295,F=!e(function(){RegExp(O,"y")});t(65)("split",2,function(i,o,y,d){var x;return x="c"=="abbc"[u](/(b)*/)[1]||4!="test"[u](/(?:)/,-1)[v]||2!="ab"[u](/(?:ab)*/)[v]||4!="."[u](/(.?)(.?)/)[v]||1<"."[u](/()()/)[v]||""[u](/.?/)[v]?function(t,n){var r=String(this);if(void 0===t&&0===n)return[];if(!l(t))return y.call(r,t,n);for(var e,i,o,u=[],c=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),a=0,f=void 0===n?O:n>>>0,s=new RegExp(t.source,c+"g");(e=h.call(s,r))&&!(a<(i=s[g])&&(u.push(r.slice(a,e.index)),1<e[v]&&e.index<r[v]&&p.apply(u,e.slice(1)),o=e[0][v],a=i,u[v]>=f));)s[g]===e.index&&s[g]++;return a===r[v]?!o&&s.test("")||u.push(""):u.push(r.slice(a)),u[v]>f?u.slice(0,f):u}:"0"[u](void 0,0)[v]?function(t,n){return void 0===t&&0===n?[]:y.call(this,t,n)}:y,[function split(t,n){var r=i(this),e=null==t?void 0:t[o];return void 0!==e?e.call(t,r,n):x.call(String(r),t,n)},function(t,n){var r=d(x,t,this,n,x!==y);if(r.done)return r.value;var e=m(t),i=String(this),o=S(e,RegExp),u=e.unicode,c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(F?"y":"g"),a=new o(F?e:"^(?:"+e.source+")",c),f=void 0===n?O:n>>>0;if(0==f)return[];if(0===i.length)return null===_(a,i)?[i]:[];for(var s=0,l=0,h=[];l<i.length;){a.lastIndex=F?l:0;var p,v=_(a,F?i:i.slice(l));if(null===v||(p=E(w(a.lastIndex+(F?0:l)),i.length))===s)l=b(i,l,u);else{if(h.push(i.slice(s,l)),h.length===f)return h;for(var g=1;g<=v.length-1;g++)if(h.push(v[g]),h.length===f)return h;l=s=p}}return h.push(i.slice(s)),h}]})},{119:119,120:120,127:127,141:141,36:36,38:38,64:64,65:65,82:82}],254:[function(n,t,r){"use strict";n(249);function XZ(t){n(118)(RegExp.prototype,u,t,!0)}var e=n(38),i=n(66),o=n(58),u="toString",c=/./[u];n(64)(function(){return"/a/b"!=c.call({source:"a",flags:"b"})})?XZ(function toString(){var t=e(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)}):c.name!=u&&XZ(function toString(){return c.call(this)})},{118:118,249:249,38:38,58:58,64:64,66:66}],255:[function(t,n,r){"use strict";var e=t(49),i=t(149);n.exports=t(51)("Set",function(t){return function Set(){return t(this,0<arguments.length?arguments[0]:void 0)}},{add:function add(t){return e.def(i(this,"Set"),t=0===t?0:t,t)}},e)},{149:149,49:49,51:51}],256:[function(t,n,r){"use strict";t(131)("anchor",function(n){return function anchor(t){return n(this,"a","name",t)}})},{131:131}],257:[function(t,n,r){"use strict";t(131)("big",function(t){return function big(){return t(this,"big","","")}})},{131:131}],258:[function(t,n,r){"use strict";t(131)("blink",function(t){return function blink(){return t(this,"blink","","")}})},{131:131}],259:[function(t,n,r){"use strict";t(131)("bold",function(t){return function bold(){return t(this,"b","","")}})},{131:131}],260:[function(t,n,r){"use strict";var e=t(62),i=t(129)(!1);e(e.P,"String",{codePointAt:function codePointAt(t){return i(this,t)}})},{129:129,62:62}],261:[function(t,n,r){"use strict";var e=t(62),u=t(141),c=t(130),a="endsWith",f=""[a];e(e.P+e.F*t(63)(a),"String",{endsWith:function endsWith(t){var n=c(this,t,a),r=1<arguments.length?arguments[1]:void 0,e=u(n.length),i=void 0===r?e:Math.min(u(r),e),o=String(t);return f?f.call(n,o,i):n.slice(i-o.length,i)===o}})},{130:130,141:141,62:62,63:63}],262:[function(t,n,r){"use strict";t(131)("fixed",function(t){return function fixed(){return t(this,"tt","","")}})},{131:131}],263:[function(t,n,r){"use strict";t(131)("fontcolor",function(n){return function fontcolor(t){return n(this,"font","color",t)}})},{131:131}],264:[function(t,n,r){"use strict";t(131)("fontsize",function(n){return function fontsize(t){return n(this,"font","size",t)}})},{131:131}],265:[function(t,n,r){var e=t(62),o=t(137),u=String.fromCharCode,i=String.fromCodePoint;e(e.S+e.F*(!!i&&1!=i.length),"String",{fromCodePoint:function fromCodePoint(t){for(var n,r=[],e=arguments.length,i=0;i<e;){if(n=+arguments[i++],o(n,1114111)!==n)throw RangeError(n+" is not a valid code point");r.push(n<65536?u(n):u(55296+((n-=65536)>>10),n%1024+56320))}return r.join("")}})},{137:137,62:62}],266:[function(t,n,r){"use strict";var e=t(62),i=t(130),o="includes";e(e.P+e.F*t(63)(o),"String",{includes:function includes(t){return!!~i(this,t,o).indexOf(t,1<arguments.length?arguments[1]:void 0)}})},{130:130,62:62,63:63}],267:[function(t,n,r){"use strict";t(131)("italics",function(t){return function italics(){return t(this,"i","","")}})},{131:131}],268:[function(t,n,r){"use strict";var e=t(129)(!0);t(85)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,r=this._i;return r>=n.length?{value:void 0,done:!0}:(t=e(n,r),this._i+=t.length,{value:t,done:!1})})},{129:129,85:85}],269:[function(t,n,r){"use strict";t(131)("link",function(n){return function link(t){return n(this,"a","href",t)}})},{131:131}],270:[function(t,n,r){var e=t(62),u=t(140),c=t(141);e(e.S,"String",{raw:function raw(t){for(var n=u(t.raw),r=c(n.length),e=arguments.length,i=[],o=0;o<r;)i.push(String(n[o++])),o<e&&i.push(String(arguments[o]));return i.join("")}})},{140:140,141:141,62:62}],271:[function(t,n,r){var e=t(62);e(e.P,"String",{repeat:t(133)})},{133:133,62:62}],272:[function(t,n,r){"use strict";t(131)("small",function(t){return function small(){return t(this,"small","","")}})},{131:131}],273:[function(t,n,r){"use strict";var e=t(62),i=t(141),o=t(130),u="startsWith",c=""[u];e(e.P+e.F*t(63)(u),"String",{startsWith:function startsWith(t){var n=o(this,t,u),r=i(Math.min(1<arguments.length?arguments[1]:void 0,n.length)),e=String(t);return c?c.call(n,e,r):n.slice(r,r+e.length)===e}})},{130:130,141:141,62:62,63:63}],274:[function(t,n,r){"use strict";t(131)("strike",function(t){return function strike(){return t(this,"strike","","")}})},{131:131}],275:[function(t,n,r){"use strict";t(131)("sub",function(t){return function sub(){return t(this,"sub","","")}})},{131:131}],276:[function(t,n,r){"use strict";t(131)("sup",function(t){return function sup(){return t(this,"sup","","")}})},{131:131}],277:[function(t,n,r){"use strict";t(134)("trim",function(t){return function trim(){return t(this,3)}})},{134:134}],278:[function(t,n,r){"use strict";function B1(t){var n=W[t]=E(j[L]);return n._k=t,n}function E1(t,n){x(t);for(var r,e=y(n=b(n)),i=0,o=e.length;i<o;)Q(t,r=e[i++],n[r]);return t}function G1(t){var n=D.call(this,t=w(t,!0));return!(this===B&&u(W,t)&&!u(V,t))&&(!(n||!u(this,t)||!u(W,t)||u(this,C)&&this[C][t])||n)}function H1(t,n){if(t=b(t),n=w(n,!0),t!==B||!u(W,n)||u(V,n)){var r=M(t,n);return!r||!u(W,n)||u(t,C)&&t[C][n]||(r.enumerable=!0),r}}function I1(t){for(var n,r=N(b(t)),e=[],i=0;r.length>i;)u(W,n=r[i++])||n==C||n==a||e.push(n);return e}function J1(t){for(var n,r=t===B,e=N(r?V:b(t)),i=[],o=0;e.length>o;)!u(W,n=e[o++])||r&&!u(B,n)||i.push(W[n]);return i}var e=t(70),u=t(71),i=t(58),o=t(62),c=t(118),a=t(94).KEY,f=t(64),s=t(126),l=t(124),h=t(147),p=t(152),v=t(151),g=t(150),y=t(61),d=t(79),x=t(38),m=t(81),S=t(142),b=t(140),w=t(143),_=t(116),E=t(98),O=t(102),F=t(101),I=t(104),P=t(99),A=t(107),M=F.f,k=P.f,N=O.f,j=e.Symbol,R=e.JSON,T=R&&R.stringify,L="prototype",C=p("_hidden"),G=p("toPrimitive"),D={}.propertyIsEnumerable,U=s("symbol-registry"),W=s("symbols"),V=s("op-symbols"),B=Object[L],q="function"==typeof j&&!!I.f,Y=e.QObject,z=!Y||!Y[L]||!Y[L].findChild,X=i&&f(function(){return 7!=E(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a})?function(t,n,r){var e=M(B,n);e&&delete B[n],k(t,n,r),e&&t!==B&&k(B,n,e)}:k,$=q&&"symbol"==typeof j.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof j},Q=function defineProperty(t,n,r){return t===B&&Q(V,n,r),x(t),n=w(n,!0),x(r),u(W,n)?(r.enumerable?(u(t,C)&&t[C][n]&&(t[C][n]=!1),r=E(r,{enumerable:_(0,!1)})):(u(t,C)||k(t,C,_(1,{})),t[C][n]=!0),X(t,n,r)):k(t,n,r)};q||(c((j=function Symbol(){if(this instanceof j)throw TypeError("Symbol is not a constructor!");var n=h(0<arguments.length?arguments[0]:void 0),r=function(t){this===B&&r.call(V,t),u(this,C)&&u(this[C],n)&&(this[C][n]=!1),X(this,n,_(1,t))};return i&&z&&X(B,n,{configurable:!0,set:r}),B1(n)})[L],"toString",function toString(){return this._k}),F.f=H1,P.f=Q,t(103).f=O.f=I1,t(108).f=G1,I.f=J1,i&&!t(89)&&c(B,"propertyIsEnumerable",G1,!0),v.f=function(t){return B1(p(t))}),o(o.G+o.W+o.F*!q,{Symbol:j});for(var Z="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),J=0;Z.length>J;)p(Z[J++]);for(var H=A(p.store),K=0;H.length>K;)g(H[K++]);o(o.S+o.F*!q,"Symbol",{for:function(t){return u(U,t+="")?U[t]:U[t]=j(t)},keyFor:function keyFor(t){if(!$(t))throw TypeError(t+" is not a symbol!");for(var n in U)if(U[n]===t)return n},useSetter:function(){z=!0},useSimple:function(){z=!1}}),o(o.S+o.F*!q,"Object",{create:function create(t,n){return void 0===n?E(t):E1(E(t),n)},defineProperty:Q,defineProperties:E1,getOwnPropertyDescriptor:H1,getOwnPropertyNames:I1,getOwnPropertySymbols:J1});var tt=f(function(){I.f(1)});o(o.S+o.F*tt,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(t){return I.f(S(t))}}),R&&o(o.S+o.F*(!q||f(function(){var t=j();return"[null]"!=T([t])||"{}"!=T({a:t})||"{}"!=T(Object(t))})),"JSON",{stringify:function stringify(t){for(var n,r,e=[t],i=1;i<arguments.length;)e.push(arguments[i++]);if(r=n=e[1],(m(n)||void 0!==t)&&!$(t))return d(n)||(n=function(t,n){if("function"==typeof r&&(n=r.call(this,t,n)),!$(n))return n}),e[1]=n,T.apply(R,e)}}),j[L][G]||t(72)(j[L],G,j[L].valueOf),l(j,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0)},{101:101,102:102,103:103,104:104,107:107,108:108,116:116,118:118,124:124,126:126,140:140,142:142,143:143,147:147,150:150,151:151,152:152,38:38,58:58,61:61,62:62,64:64,70:70,71:71,72:72,79:79,81:81,89:89,94:94,98:98,99:99}],279:[function(t,n,r){"use strict";var e=t(62),i=t(146),o=t(145),f=t(38),s=t(137),l=t(141),u=t(81),c=t(70).ArrayBuffer,h=t(127),p=o.ArrayBuffer,v=o.DataView,a=i.ABV&&c.isView,g=p.prototype.slice,y=i.VIEW,d="ArrayBuffer";e(e.G+e.W+e.F*(c!==p),{ArrayBuffer:p}),e(e.S+e.F*!i.CONSTR,d,{isView:function isView(t){return a&&a(t)||u(t)&&y in t}}),e(e.P+e.U+e.F*t(64)(function(){return!new p(2).slice(1,void 0).byteLength}),d,{slice:function slice(t,n){if(void 0!==g&&void 0===n)return g.call(f(this),t);for(var r=f(this).byteLength,e=s(t,r),i=s(void 0===n?r:n,r),o=new(h(this,p))(l(i-e)),u=new v(this),c=new v(o),a=0;e<i;)c.setUint8(a++,u.getUint8(e++));return o}}),t(123)(d)},{123:123,127:127,137:137,141:141,145:145,146:146,38:38,62:62,64:64,70:70,81:81}],280:[function(t,n,r){var e=t(62);e(e.G+e.W+e.F*!t(146).ABV,{DataView:t(145).DataView})},{145:145,146:146,62:62}],281:[function(t,n,r){t(144)("Float32",4,function(e){return function Float32Array(t,n,r){return e(this,t,n,r)}})},{144:144}],282:[function(t,n,r){t(144)("Float64",8,function(e){return function Float64Array(t,n,r){return e(this,t,n,r)}})},{144:144}],283:[function(t,n,r){t(144)("Int16",2,function(e){return function Int16Array(t,n,r){return e(this,t,n,r)}})},{144:144}],284:[function(t,n,r){t(144)("Int32",4,function(e){return function Int32Array(t,n,r){return e(this,t,n,r)}})},{144:144}],285:[function(t,n,r){t(144)("Int8",1,function(e){return function Int8Array(t,n,r){return e(this,t,n,r)}})},{144:144}],286:[function(t,n,r){t(144)("Uint16",2,function(e){return function Uint16Array(t,n,r){return e(this,t,n,r)}})},{144:144}],287:[function(t,n,r){t(144)("Uint32",4,function(e){return function Uint32Array(t,n,r){return e(this,t,n,r)}})},{144:144}],288:[function(t,n,r){t(144)("Uint8",1,function(e){return function Uint8Array(t,n,r){return e(this,t,n,r)}})},{144:144}],289:[function(t,n,r){t(144)("Uint8",1,function(e){return function Uint8ClampedArray(t,n,r){return e(this,t,n,r)}},!0)},{144:144}],290:[function(t,n,r){"use strict";function R4(t){return function WeakMap(){return t(this,0<arguments.length?arguments[0]:void 0)}}var o,e=t(70),i=t(42)(0),u=t(118),c=t(94),a=t(97),f=t(50),s=t(81),l=t(149),h=t(149),p=!e.ActiveXObject&&"ActiveXObject"in e,v="WeakMap",g=c.getWeak,y=Object.isExtensible,d=f.ufstore,x={get:function get(t){if(s(t)){var n=g(t);return!0===n?d(l(this,v)).get(t):n?n[this._i]:void 0}},set:function set(t,n){return f.def(l(this,v),t,n)}},m=n.exports=t(51)(v,R4,x,f,!0,!0);h&&p&&(a((o=f.getConstructor(R4,v)).prototype,x),c.NEED=!0,i(["delete","has","get","set"],function(e){var t=m.prototype,i=t[e];u(t,e,function(t,n){if(!s(t)||y(t))return i.call(this,t,n);this._f||(this._f=new o);var r=this._f[e](t,n);return"set"==e?this:r})}))},{118:118,149:149,42:42,50:50,51:51,70:70,81:81,94:94,97:97}],291:[function(t,n,r){"use strict";var e=t(50),i=t(149),o="WeakSet";t(51)(o,function(t){return function WeakSet(){return t(this,0<arguments.length?arguments[0]:void 0)}},{add:function add(t){return e.def(i(this,o),t,!0)}},e,!1,!0)},{149:149,50:50,51:51}],292:[function(t,n,r){"use strict";var e=t(62),i=t(67),o=t(142),u=t(141),c=t(33),a=t(45);e(e.P,"Array",{flatMap:function flatMap(t){var n,r,e=o(this);return c(t),n=u(e.length),r=a(e,0),i(r,e,e,n,0,1,t,arguments[1]),r}}),t(35)("flatMap")},{141:141,142:142,33:33,35:35,45:45,62:62,67:67}],293:[function(t,n,r){"use strict";var e=t(62),i=t(41)(!0);e(e.P,"Array",{includes:function includes(t){return i(this,t,1<arguments.length?arguments[1]:void 0)}}),t(35)("includes")},{35:35,41:41,62:62}],294:[function(t,n,r){var e=t(62),i=t(110)(!0);e(e.S,"Object",{entries:function entries(t){return i(t)}})},{110:110,62:62}],295:[function(t,n,r){var e=t(62),a=t(111),f=t(140),s=t(101),l=t(53);e(e.S,"Object",{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(t){for(var n,r,e=f(t),i=s.f,o=a(e),u={},c=0;o.length>c;)void 0!==(r=i(e,n=o[c++]))&&l(u,n,r);return u}})},{101:101,111:111,140:140,53:53,62:62}],296:[function(t,n,r){var e=t(62),i=t(110)(!1);e(e.S,"Object",{values:function values(t){return i(t)}})},{110:110,62:62}],297:[function(t,n,r){"use strict";var e=t(62),i=t(52),o=t(70),u=t(127),c=t(115);e(e.P+e.R,"Promise",{finally:function(n){var r=u(this,i.Promise||o.Promise),t="function"==typeof n;return this.then(t?function(t){return c(r,n()).then(function(){return t})}:n,t?function(t){return c(r,n()).then(function(){throw t})}:n)}})},{115:115,127:127,52:52,62:62,70:70}],298:[function(t,n,r){"use strict";var e=t(62),i=t(132),o=t(148),u=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);e(e.P+e.F*u,"String",{padEnd:function padEnd(t){return i(this,t,1<arguments.length?arguments[1]:void 0,!1)}})},{132:132,148:148,62:62}],299:[function(t,n,r){"use strict";var e=t(62),i=t(132),o=t(148),u=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);e(e.P+e.F*u,"String",{padStart:function padStart(t){return i(this,t,1<arguments.length?arguments[1]:void 0,!0)}})},{132:132,148:148,62:62}],300:[function(t,n,r){"use strict";t(134)("trimLeft",function(t){return function trimLeft(){return t(this,1)}},"trimStart")},{134:134}],301:[function(t,n,r){"use strict";t(134)("trimRight",function(t){return function trimRight(){return t(this,2)}},"trimEnd")},{134:134}],302:[function(t,n,r){t(150)("asyncIterator")},{150:150}],303:[function(t,n,r){for(var e=t(164),i=t(107),o=t(118),u=t(70),c=t(72),a=t(88),f=t(152),s=f("iterator"),l=f("toStringTag"),h=a.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},v=i(p),g=0;g<v.length;g++){var y,d=v[g],x=p[d],m=u[d],S=m&&m.prototype;if(S&&(S[s]||c(S,s,h),S[l]||c(S,l,d),a[d]=h,x))for(y in e)S[y]||o(S,y,e[y],!0)}},{107:107,118:118,152:152,164:164,70:70,72:72,88:88}],304:[function(t,n,r){var e=t(62),i=t(136);e(e.G+e.B,{setImmediate:i.set,clearImmediate:i.clear})},{136:136,62:62}],305:[function(t,n,r){function y7(i){return function(t,n){var r=2<arguments.length,e=r&&u.call(arguments,2);return i(r?function(){("function"==typeof t?t:Function(t)).apply(this,e)}:t,n)}}var e=t(70),i=t(62),o=t(148),u=[].slice,c=/MSIE .\./.test(o);i(i.G+i.B+i.F*c,{setTimeout:y7(e.setTimeout),setInterval:y7(e.setInterval)})},{148:148,62:62,70:70}],306:[function(t,n,r){t(305),t(304),t(303),n.exports=t(52)},{303:303,304:304,305:305,52:52}],307:[function(t,n,r){var e=function(u){"use strict";var c,t=Object.prototype,f=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.asyncIterator||"@@asyncIterator",e=n.toStringTag||"@@toStringTag";function wrap(t,n,r,e){var i=n&&n.prototype instanceof Generator?n:Generator,o=Object.create(i.prototype),u=new Context(e||[]);return o._invoke=function makeInvokeMethod(o,u,c){var a=s;return function invoke(t,n){if(a===h)throw new Error("Generator is already running");if(a===p){if("throw"===t)throw n;return doneResult()}for(c.method=t,c.arg=n;;){var r=c.delegate;if(r){var e=maybeInvokeDelegate(r,c);if(e){if(e===v)continue;return e}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if(a===s)throw a=p,c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);a=h;var i=tryCatch(o,u,c);if("normal"===i.type){if(a=c.done?p:l,i.arg===v)continue;return{value:i.arg,done:c.done}}"throw"===i.type&&(a=p,c.method="throw",c.arg=i.arg)}}}(t,r,u),o}function tryCatch(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(t){return{type:"throw",arg:t}}}u.wrap=wrap;var s="suspendedStart",l="suspendedYield",h="executing",p="completed",v={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var o={};o[i]=function(){return this};var a=Object.getPrototypeOf,g=a&&a(a(values([])));g&&g!==t&&f.call(g,i)&&(o=g);var y=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(o);function defineIteratorMethods(t){["next","throw","return"].forEach(function(n){t[n]=function(t){return this._invoke(n,t)}})}function AsyncIterator(c,a){var t;this._invoke=function enqueue(r,e){function callInvokeWithMethodAndArg(){return new a(function(t,n){!function invoke(t,n,r,e){var i=tryCatch(c[t],c,n);if("throw"!==i.type){var o=i.arg,u=o.value;return u&&"object"==typeof u&&f.call(u,"__await")?a.resolve(u.__await).then(function(t){invoke("next",t,r,e)},function(t){invoke("throw",t,r,e)}):a.resolve(u).then(function(t){o.value=t,r(o)},function(t){return invoke("throw",t,r,e)})}e(i.arg)}(r,e,t,n)})}return t=t?t.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,n){var r=t.iterator[n.method];if(r===c){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=c,maybeInvokeDelegate(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=tryCatch(r,t.iterator,n.arg);if("throw"===e.type)return n.method="throw",n.arg=e.arg,n.delegate=null,v;var i=e.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=c),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function pushTryEntry(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function resetTryEntry(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,e=function next(){for(;++r<t.length;)if(f.call(t,r))return next.value=t[r],next.done=!1,next;return next.value=c,next.done=!0,next};return e.next=e}}return{next:doneResult}}function doneResult(){return{value:c,done:!0}}return GeneratorFunction.prototype=y.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunctionPrototype[e]=GeneratorFunction.displayName="GeneratorFunction",u.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===GeneratorFunction||"GeneratorFunction"===(n.displayName||n.name))},u.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,e in t||(t[e]="GeneratorFunction")),t.prototype=Object.create(y),t},u.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[r]=function(){return this},u.AsyncIterator=AsyncIterator,u.async=function(t,n,r,e,i){void 0===i&&(i=Promise);var o=new AsyncIterator(wrap(t,n,r,e),i);return u.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},defineIteratorMethods(y),y[e]="Generator",y[i]=function(){return this},y.toString=function(){return"[object Generator]"},u.keys=function(n){var r=[];for(var t in n)r.push(t);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in n)return next.value=t,next.done=!1,next}return next.done=!0,next}},u.values=values,Context.prototype={constructor:Context,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(resetTryEntry),!t)for(var n in this)"t"===n.charAt(0)&&f.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=c)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function handle(t,n){return i.type="throw",i.arg=r,e.next=t,n&&(e.method="next",e.arg=c),!!n}for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t],i=n.completion;if("root"===n.tryLoc)return handle("end");if(n.tryLoc<=this.prev){var o=f.call(n,"catchLoc"),u=f.call(n,"finallyLoc");if(o&&u){if(this.prev<n.catchLoc)return handle(n.catchLoc,!0);if(this.prev<n.finallyLoc)return handle(n.finallyLoc)}else if(o){if(this.prev<n.catchLoc)return handle(n.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return handle(n.finallyLoc)}}}},abrupt:function(t,n){for(var r=this.tryEntries.length-1;0<=r;--r){var e=this.tryEntries[r];if(e.tryLoc<=this.prev&&f.call(e,"finallyLoc")&&this.prev<e.finallyLoc){var i=e;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=n,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),v},finish:function(t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),v}},catch:function(t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var e=r.completion;if("throw"===e.type){var i=e.arg;resetTryEntry(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:values(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=c),v}},u}("object"==typeof n?n.exports:{});try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},{}]},{},[1]);

// Registering Syncfusion license key - 29.x.x
ej.base.registerLicense('ORg4AjUWIQA/Gnt2XFhhQlJHfV5AQmBIYVp/TGpJfl96cVxMZVVBJAtUQF1hTH5QdE1iW3pdc3JSRmZZWkd1');
function SetAcrcHomeTileCounts() {
    $.ajax({
        url: "Home.aspx/GetAcrcHomeTileCounts",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            SetAcrcHomeTileCountsSuccess(data);
        },
        error: function (xhr, status, error) {
            SetAcrcHomeTileCountsError(error);
        },
        cache: false
    });

    return false;
}

function SetAcrcHomeTileCountsSuccess(data) {
    if (data !== null) {
        for (k in data.d) {
            var countObj = document.getElementById(k);
            if (countObj != null) {
                countObj.innerHTML = data.d[k];
            }
        }
    }
    var acrcCountDiv = document.getElementById('acrcCountsDiv');
    acrcCountDiv.style.display = "block";
    var acrcCountWaitingMessageDiv = document.getElementById('acrcCountsWaitingMessage');
    acrcCountWaitingMessageDiv.style.display = "none";
}

function SetAcrcHomeTileCountsError(error) {
    var acrcCountDiv = document.getElementById('acrcCountsDiv');
    acrcCountDiv.style.display = "block";
    var acrcCountWaitingMessageDiv = document.getElementById('acrcCountsWaitingMessage');
    acrcCountWaitingMessageDiv.style.display = "none";
}

function SetAvsHomeTileCounts() {
    $.ajax({
        url: "Home.aspx/GetAvsHomeTileCounts",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            SetAvsHomeTileCountsSuccess(data);
        },
        error: function (xhr, status, error) {
            SetAvsHomeTileCountsError(error);
        },
        cache: false
    });

    return false;
}

function SetAvsHomeTileCountsSuccess(data) {
    if (data !== null) {
        for (k in data.d) {
            var countObj = document.getElementById(k);
            if (countObj != null) {
                countObj.innerHTML = data.d[k];
            }
        }
    }
    var avsCountDiv = document.getElementById('avsCountsDiv');
    avsCountDiv.style.display = "block";
    var avsCountWaitingMessageDiv = document.getElementById('avsCountsWaitingMessage');
    avsCountWaitingMessageDiv.style.display = "none";
}

function SetAvsHomeTileCountsError(error) {
    var avsCountDiv = document.getElementById('avsCountsDiv');
    avsCountDiv.style.display = "block";
    var avsCountWaitingMessageDiv = document.getElementById('avsCountsWaitingMessage');
    avsCountWaitingMessageDiv.style.display = "none";
}


function SetDenclassHomeTileCounts() {
    $.ajax({
        url: "Home.aspx/GetDenclassHomeTileCounts",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            SetDenclassHomeTileCountsSuccess(data);
        },
        error: function (xhr, status, error) {
            SetDenclassHomeTileCountsError(error);
        },
        cache: false
    });

    return false;
}

function SetDenclassHomeTileCountsSuccess(data) {
    if (data !== null) {
        for (k in data.d) {
            var countObj = document.getElementById(k);
            if (countObj != null) {
                countObj.innerHTML = data.d[k];
                if (data.d[k] == 0) {
                    countObj.setAttribute("disabled", "true");
                }
            }
        }
    }
    var denclassCountDiv = document.getElementById('denclassCountsDiv');
    denclassCountDiv.style.display = "block";
    var denclassCountWaitingMessageDiv = document.getElementById('denclassCountsWaitingMessage');
    denclassCountWaitingMessageDiv.style.display = "none";
}

function SetDenclassHomeTileCountsError(error) {
    var denclassCountDiv = document.getElementById('denclassCountsDiv');
    denclassCountDiv.style.display = "block";
    var denclassCountWaitingMessageDiv = document.getElementById('denclassCountsWaitingMessage');
    denclassCountWaitingMessageDiv.style.display = "none";
}
function SetEcaseHomeTileCounts() {
    $.ajax({
        url: "Home.aspx/GetEcaseHomeTileCounts",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            SetEcaseHomeTileCountsSuccess(data);
        },
        error: function (xhr, status, error) {
            SetEcaseHomeTileCountsError(error);
        },
        cache: false
    });

    return false;
}

function SetEcaseHomeTileCountsSuccess(data) {
    if (data !== null) {
        for (k in data.d) {
            var countObj = document.getElementById(k);
            if (countObj != null) {
                countObj.innerHTML = data.d[k];
            }

            if (k == 'DisallowedOwnersHyperlink' && data.d[k] == '0') {
                var hidePanel = document.getElementById('DisallowedOwnersPanel');
                if (hidePanel != null) {
                    hidePanel.style.display = "none";
                }
            }

        }
    }
    var ecaseGlanceCountDiv = document.getElementById('ecaseGlanceCountsDiv');
    ecaseGlanceCountDiv.style.display = "block";
    var ecaseGlanceCountWaitingMessageDiv = document.getElementById('ecaseGlanceCountsWaitingMessage');
    ecaseGlanceCountWaitingMessageDiv.style.display = "none";
}

function SetEcaseHomeTileCountsError(error) {
    var ecaseGlanceCountDiv = document.getElementById('ecaseGlanceCountsDiv');
    ecaseGlanceCountDiv.style.display = "block";
    var ecaseGlanceCountWaitingMessageDiv = document.getElementById('ecaseGlanceCountsWaitingMessage');
    ecaseGlanceCountWaitingMessageDiv.style.display = "none";
}

function SetEcaseTaskHomeTileCounts() {
    $.ajax({
        url: "Home.aspx/GetEcaseTaskHomeTileCounts",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            SetEcaseTaskHomeTileCountsSuccess(data);
        },
        error: function (xhr, status, error) {
            SetEcaseTaskHomeTileCountsError(error);
        },
        cache: false
    });

    return false;
}

function SetEcaseTaskHomeTileCountsSuccess(data) {
    if (data !== null) {
        for (k in data.d) {
            var countObj = document.getElementById(k);
            if (countObj != null) {
                countObj.innerHTML = data.d[k];
            }
        }
    }
    var ecaseTaskCountDiv = document.getElementById('ecaseTaskCountsDiv');
    ecaseTaskCountDiv.style.display = "block";
    var ecaseTaskCountWaitingMessageDiv = document.getElementById('ecaseTaskCountsWaitingMessage');
    ecaseTaskCountWaitingMessageDiv.style.display = "none";
}

function SetEcaseTaskHomeTileCountsError(error) {
    var ecaseTaskCountDiv = document.getElementById('ecaseTaskCountsDiv');
    ecaseTaskCountDiv.style.display = "block";
    var ecaseTaskCountWaitingMessageDiv = document.getElementById('ecaseTaskCountsWaitingMessage');
}

function SetEcaseReferralHomeTileCounts() {
    $.ajax({
        url: "Home.aspx/GetEcaseReferralHomeTileCounts",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            SetEcaseReferralHomeTileCountsSuccess(data);
        },
        error: function (xhr, status, error) {
            SetEcaseReferralHomeTileCountsError(error);
        },
        cache: false
    });

    return false;
}

function SetEcaseReferralHomeTileCountsSuccess(data) {
    if (data !== null) {
        for (k in data.d) {
            var countObj = document.getElementById(k);
            if (countObj != null) {
                countObj.innerHTML = data.d[k];
            }
        }
    }
    var ecaseTaskCountDiv = document.getElementById('ecaseReferralCountsDiv');
    ecaseTaskCountDiv.style.display = "block";
    var ecaseTaskCountWaitingMessageDiv = document.getElementById('ecaseReferralCountsWaitingMessage');
    ecaseTaskCountWaitingMessageDiv.style.display = "none";
}

function SetEcaseReferralHomeTileCountsError(error) {
    var ecaseTaskCountDiv = document.getElementById('ecaseReferralCountsDiv');
    ecaseTaskCountDiv.style.display = "block";
    var ecaseTaskCountWaitingMessageDiv = document.getElementById('ecaseReferralCountsWaitingMessage');
}
function SetEmmpsHomeTileCounts() {
    $.ajax({
        url: "Home.aspx/GetEmmpsHomeTileCounts",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            SetEmmpsHomeTileCountsSuccess(data);
        },
        error: function (xhr, status, error) {
            SetEmmpsHomeTileCountsError(error);
        },
        cache: false
    });

    return false;
}

function SetEmmpsHomeTileCountsSuccess(data) {
    if (data !== null) {
        for (k in data.d) {
            var countObj = document.getElementById(k);
            if (countObj != null) {
                countObj.innerHTML = data.d[k];
            }
        }
    }
    var emmpsCountDiv = document.getElementById('emmpsHomeTileCountsDiv');
    emmpsCountDiv.style.display = "block";
    var emmpsCountWaitingMessageDiv = document.getElementById('emmpsHomeTileCountsWaitingMessage');
    emmpsCountWaitingMessageDiv.style.display = "none";
}

function SetEmmpsHomeTileCountsError(error) {
    var emmpsCountDiv = document.getElementById('emmpsHomeTileCountsDiv');
    emmpsCountDiv.style.display = "block";
    var emmpsCountWaitingMessageDiv = document.getElementById('emmpsHomeTileCountsWaitingMessage');
    emmpsCountWaitingMessageDiv.style.display = "none";
}
$(document).ready(function () {

    if (document.getElementById('hidPerformanceTesting') != null && document.getElementById('hidPerformanceTesting').value == "0") {
        loadPage();
    }

});

function loadPage() {
    $("#PageLoading").css("display", "none");
    $("#PageLoaded").css("display", "block");
}

function SetHrrHomeTileCounts() {
    $.ajax({
        url: "Home.aspx/GetHrrHomeTileCounts",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            SetHrrHomeTileCountsSuccess(data);
        },
        error: function (xhr, status, error) {
            SetHrrHomeTileCountsError(error);
        },
        cache: false
    });

    return false;
}

function SetHrrHomeTileCountsSuccess(data) {
    if (data !== null) {
        for (k in data.d) {
            var countObj = document.getElementById(k);
            if (countObj != null) {
                countObj.innerHTML = data.d[k];
            }
        }
    }
    var hrrCountDiv = document.getElementById('hrrCountsDiv');
    hrrCountDiv.style.display = "block";
    var hrrCountWaitingMessageDiv = document.getElementById('hrrCountsWaitingMessage');
    hrrCountWaitingMessageDiv.style.display = "none";
}

function SetHrrHomeTileCountsError(error) {
    var hrrCountDiv = document.getElementById('hrrCountsDiv');
    hrrCountDiv.style.display = "block";
    var hrrCountWaitingMessageDiv = document.getElementById('hrrCountsWaitingMessage');
    hrrCountWaitingMessageDiv.style.display = "none";
}
function SetMatsHomeTileCounts() {
    $.ajax({
        url: "Home.aspx/GetMatsHomeTileCounts",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            SetMatsHomeTileCountsSuccess(data);
        },
        error: function (xhr, status, error) {
            SetMatsHomeTileCountsError(error);
        },
        cache: false
    });

    return false;
}

function SetMatsHomeTileCountsSuccess(data) {
    if (data !== null) {
        for (k in data.d) {
            var countObj = document.getElementById(k);
            if (countObj != null) {
                countObj.innerHTML = data.d[k];
            }
        }
    }
    var matsCountDiv = document.getElementById('matsCountsDiv');
    matsCountDiv.style.display = "block";
    var matsCountWaitingMessageDiv = document.getElementById('matsCountsWaitingMessage');
    matsCountWaitingMessageDiv.style.display = "none";
}

function SetMatsHomeTileCountsError(error) {
    var matsCountDiv = document.getElementById('matsCountsDiv');
    matsCountDiv.style.display = "block";
    var matsCountWaitingMessageDiv = document.getElementById('matsCountsWaitingMessage');
    matsCountWaitingMessageDiv.style.display = "none";
}
function ChartObj(x, y, text, fill, percentage) {
    this.x = x;
    this.y = y;
    this.text = text;
    this.fill = fill;
    this.percentage = percentage;
}
function DataSourceObj(x_axis, y_axis, color) {
    this.x = x_axis;
    this.y = y_axis;
    this.color = color
}

function DataLabelObj() {
    this.visible = true;
}

function MarkerObj() {
    this.dataLabel = new DataLabelObj();
}

function SeriesObj(stackName, dataSource, color, hasLabel,chartText) {
    this.type = "Spline";
    this.dataSource = dataSource;
    this.xName = 'x';
    this.yName = 'y';
    this.name = stackName;
    this.fill = color;
    this.chartText = chartText;
    if (hasLabel)
        this.marker = new MarkerObj();
}

function FrameworkProcessSplineChart(visualizationDataSet)
{ 
    
    var dataSource = [];
    var totalCount = 0;
    

    $.each(visualizationDataSet.VisualizationData, function (index, dataItems) {
        var itemCount = dataItems.GetValues[0] === null ? 0 : dataItems.GetValues[0];
        totalCount += itemCount;
    });
    
    if (totalCount === 0) { totalCount = 1; }
    $.each(visualizationDataSet.VisualizationData, function (index, dataItems) {
        var chartText = dataItems.Name + ": " + dataItems.GetValues[0];
    $.each(visualizationDataSet.Categories, function (i, category) {
        
            dataSource.push(new DataSourceObj(category, dataItems.GetValues[i]))
        });       
        
        dataSource.push(new SeriesObj(dataItems.Name, dataItems.GetValues,  chartText));
        
    });
   
    var splineChart = new ej.charts.Chart({
        primaryXAxis: {
            valueType: 'Category',         
            majorGridLines: { width: 0 },
            crosshair: true,
            labelRotation: -45,
            
        },
        primaryYAxis:
        {
            title: visualizationDataSet.YAxisTitle,
            minimum:-100            
        },
        
        tooltip: {            
            enable:true,
        },
        tooltipRender: function (args) {
            args.text =  args.point.x + ' <br/>' + args.point.y + '</b>';
        },
        series: [{            
            
            dataSource: dataSource,            
            xName: 'x',
            yName: 'y',
            border: { color: 'red', width: 1 },            
            fill: '#ff0000',           
            
            
            pointColorMapping: 'color',            
            dataLabel: {
                visible: true, position: 'Left',
                name: 'text',
                font: { fontWeight: 'bold', color: "#000000" },
                
            },
            marker: {
                visible: true,                
                width: 8, height: 8,
                shape: 'Circle',
                fill: '#ff0000',                                 
                               
                },
        }
        ],        
        title: visualizationDataSet.MainTitle
    });

    splineChart.appendTo('#' + visualizationDataSet.RenderToName);
    
}       
    
function FrameworkProcessPieChart(visualizationDataSet) {
    var dataSource = [];
    var chartColors = ["f45b5b", "8085e9"];

    
    var totalCount = 0;    

    $.each(visualizationDataSet.VisualizationData, function (index, dataItems) {
        var itemCount = dataItems.GetValues[0] === null ? 0 : dataItems.GetValues[0];
        totalCount += itemCount;
    });

    if (totalCount === 0) { totalCount = 1; }

    $.each(visualizationDataSet.VisualizationData, function (index, dataItems) {
        var chartText = dataItems.Name + ": " + dataItems.GetValues[0];
        var chartColor = chartColors[index];
        var chartPercentage = Math.floor((dataItems.GetValues[0] * 100) / totalCount);
        dataSource.push(new ChartObj(dataItems.Name, dataItems.GetValues[0], chartText, "#" + chartColor, chartPercentage));
    });

    var pie = new ej.charts.AccumulationChart({
        primaryXAxis: {
            valueType: 'Category',
            crosshair: true,
           dataSource: dataSource,

       },
       primaryYAxis:
       {
           title: visualizationDataSet.YAxisTitle,

       },
        series: [
            {
                dataSource: dataSource,
                dataLabel: {
                    visible: true,
                    name: 'text',
                    position: 'Outside',
                    font: {
                        fontWeight: '600'
                    }
                },
                innerRadius: '50%',
                radius:'50%',
                borderradius: '50 %',                
                pointColorMapping: 'fill',               
                xName: 'x',
                yName: 'y'
            }
        ],
        tooltip: { enable: true, format: '${point.x} : <b>${point.percentage}%</b>' },
        legendSettings: {
            visible: false
        },
        title: visualizationDataSet.MainTitle
    });

    pie.appendTo('#' + visualizationDataSet.RenderToName);
}
function SetMedchartHomeTilePendingApprovalUserCounts() {

    $.ajax({
        url: "Home.aspx/GetMedchartPendingApprovalUserCounts",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            SetMedchartHomeTilePendingApprovalUserCountsSuccess(data);
        },
        error: function (xhr, status, error) {
            SetMedchartHomeTilePendingApprovalUserCountsError(error);
        },
        cache: false
    });

    return false;
}

function SetMedchartHomeTilePendingApprovalUserCountsSuccess(data) {

    if (data !== null) {
        for (k in data.d) {
            var moduleId = k;
            var variables = (data.d[k]).split("%%||%%");
            var accountCountObj = document.getElementById(variables[0]);
            accountCountObj.innerHTML = variables[1];
            var hipaaCountObj = document.getElementById(variables[2]);
            hipaaCountObj.innerHTML = variables[3];
        }
    }
    var pendingApprovalCountDiv = document.getElementById('pendingApprovalCountDiv');
    pendingApprovalCountDiv.style.display = "block";
    var pendingApprovalCountWaitingMessageDiv = document.getElementById('pendingApprovalCountWaitingMessage');
    pendingApprovalCountWaitingMessageDiv.style.display = "none";
}

function SetMedchartHomeTilePendingApprovalUserCountsError(error) {
    var pendingApprovalCountDiv = document.getElementById('pendingApprovalCountDiv');
    pendingApprovalCountDiv.style.display = "block";
    var pendingApprovalCountWaitingMessageDiv = document.getElementById('pendingApprovalCountWaitingMessage');
    pendingApprovalCountWaitingMessageDiv.style.display = "none";
}


// For controlling the loading of previously loaded data based on according selection
var vizDataOpened = false;
var maintenanceModeOpened = false;

// Check the health of the Medchart dataebase and web services
function MedchartWcfHandshake() {
    MedchartDatabaseCheck();
    FrameworkWebServiceCheck();
    AvsWebServiceCheck();
    EcaseInternalWebServiceCheck();
    EcaseExternalWebServiceCheck();
    DenclassExportlWebServiceCheck();
    DenclassProcessDataWebServiceCheck();
    DenclassDataLoadWebServiceCheck();
    DenclassEProfileWebServiceCheck();
    //EmmpsDampsInterfaceWebServiceCheck();
    EmmpsMebPrepCbtWebServiceCheck();
    EmmpsMebPrepWebServiceCheck();
    //FrameworkWebApiWebServiceCheck();
    DocsWebServiceCheck();

    FirePostback();
    return false;
}

function MedchartDatabaseCheck() {
    AjaxServerBroker("DatabaseServiceCheckLabel",
        "Checking...Please wait...",
        "SystemAdministration.aspx/ExecuteDatabaseCheck",
        "DatabaseServiceCheckLabel");
}

function FrameworkWebServiceCheck() {
    AjaxServerBroker("FrameworkInternalWebServiceCheckLabel",
        "Checking...Please wait...",
        "SystemAdministration.aspx/ExecuteFrameworkWebServiceCheck",
        "FrameworkInternalWebServiceCheckLabel");
}

function AvsWebServiceCheck() {
    AjaxServerBroker("AvsExternalWebServiceCheckLabel",
        "Checking...Please wait...",
        "SystemAdministration.aspx/ExecuteAvsWebServiceCheck",
        "AvsExternalWebServiceCheckLabel");
}

function EcaseInternalWebServiceCheck() {
    AjaxServerBroker("EcaseInternalWebServiceCheckLabel",
        "Checking...Please wait...",
        "SystemAdministration.aspx/ExecuteEcaseInternalServiceCheck",
        "EcaseInternalWebServiceCheckLabel");
}

function EcaseExternalWebServiceCheck() {
    AjaxServerBroker("EcaseExternalWebServiceCheckLabel",
        "Checking...Please wait...",
        "SystemAdministration.aspx/ExecuteEcaseExternalServiceCheck",
        "EcaseExternalWebServiceCheckLabel");
}

function DenclassExportlWebServiceCheck() {
    AjaxServerBroker("DenclassExportWebServiceCheckLabel",
        "Checking...Please wait...",
        "SystemAdministration.aspx/ExecuteDenclassExportServiceCheck",
        "DenclassExportWebServiceCheckLabel");
}

function DenclassProcessDataWebServiceCheck() {
    AjaxServerBroker("DenclassProcessDataWebServiceCheckLabel",
        "Checking...Please wait...",
        "SystemAdministration.aspx/ExecuteDenclassProcessDataServiceCheck",
        "DenclassProcessDataWebServiceCheckLabel");
}

function DenclassDataLoadWebServiceCheck() {
    AjaxServerBroker("DenclassDataLoadWebServiceCheckLabel",
        "Checking...Please wait...",
        "SystemAdministration.aspx/ExecuteDenclassDataLoadServiceCheck",
        "DenclassDataLoadWebServiceCheckLabel");
}

function DenclassEProfileWebServiceCheck() {
    AjaxServerBroker("DenclassEProfileWebServiceCheckLabel",
        "Checking...Please wait...",
        "SystemAdministration.aspx/ExecuteDenclassEProfileServiceCheck",
        "DenclassEProfileWebServiceCheckLabel");
}

function EmmpsMebPrepCbtWebServiceCheck() {
    AjaxServerBroker("EmmpsMebPrepCbtWebServiceCheckLabel",
        "Checking...Please wait...",
        "SystemAdministration.aspx/ExecuteEmmpsMebPrepCbtServiceCheck",
        "EmmpsMebPrepCbtWebServiceCheckLabel");
}

function EmmpsMebPrepWebServiceCheck() {
    AjaxServerBroker("EmmpsMebPrepWebServiceCheckLabel",
        "Checking...Please wait...",
        "SystemAdministration.aspx/ExecuteEmmpsMebPrepServiceCheck",
        "EmmpsMebPrepWebServiceCheckLabel");
}

function FrameworkWebApiWebServiceCheck() {
    AjaxServerBroker("WebApiServiceCheckLabel",
        "Checking...Please wait...",
        "SystemAdministration.aspx/ExecuteFrameworkWebApiServiceCheck",
        "WebApiServiceCheckLabel"
    );
}

function DocsWebServiceCheck() {
    AjaxServerBroker("DocsWebServiceCheckLabel",
        "Checking...Please wait...",
        "SystemAdministration.aspx/ExecuteDocsWebServiceCheck",
        "DocsWebServiceCheckLabel");
}

// Manually run the Remove Orphan Users process
function MedchartRemoveOrphanUsers() {
    // Display the retrieval message
    var pageMessage = document.getElementById('RemoveOrphanUsersResult');
    pageMessage.innerHTML = "Processing...Please wait...";
    $.ajax({
        url: "SystemAdministration.aspx/ExecuteRemoveOrphanUsers",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            MedchartRemoveOrphanUsersSuccess(data);
        },
        error: function (xhr, status, error) {
            MedchartRemoveOrphanUsersError(error);
        },
        cache: false
    });

    FirePostback();
    return false;
}
function MedchartRemoveOrphanUsersSuccess(data) {
    var pageMessage = document.getElementById('RemoveOrphanUsersResult');
    var deserializedData = JSON.parse(data.d);
    pageMessage.innerHTML = deserializedData;
}
function MedchartRemoveOrphanUsersError(error) {
    var pageMessage = document.getElementById('RemoveOrphanUsersResult');
    pageMessage.innerHTML = error;
}

// Manually run the Remove Disapproved Users process
function MedchartRemoveDisapprovedUsers() {
    // Display the retrieval message
    var pageMessage = document.getElementById('RemoveDisapprovedUsersResult');
    pageMessage.innerHTML = "Processing...Please wait...";
    $.ajax({
        url: "SystemAdministration.aspx/ExecuteRemoveDisapprovedUsers",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            MedchartRemoveDisapprovedUsersSuccess(data);
        },
        error: function (xhr, status, error) {
            MedchartRemoveDisapprovedUsersError(error);
        },
        cache: false
    });

    FirePostback();
    return false;
}
function MedchartRemoveDisapprovedUsersSuccess(data) {
    var pageMessage = document.getElementById('RemoveDisapprovedUsersResult');
    var deserializedData = JSON.parse(data.d);
    pageMessage.innerHTML = deserializedData;
}
function MedchartRemoveDisapprovedUsersError(error) {
    var pageMessage = document.getElementById('RemoveDisapprovedUsersResult');
    pageMessage.innerHTML = error;
}

// Manually run the Resend Failed Documents process
function MedchartResendFailedDocuments() {
    // Display the retrieval message
    var pageMessage = document.getElementById('ResendFailedDocumentsResult');
    pageMessage.innerHTML = "Processing...Please wait...";
    $.ajax({
        url: "SystemAdministration.aspx/ExecuteResendFailedDocuments",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            MedchartResendFailedDocumentsSuccess(data);
        },
        error: function (xhr, status, error) {
            MedchartResendFailedDocumentsError(error);
        },
        cache: false
    });

    FirePostback();
    return false;
}
function MedchartResendFailedDocumentsSuccess(data) {
    var pageMessage = document.getElementById('ResendFailedDocumentsResult');
    var deserializedData = JSON.parse(data.d);
    pageMessage.innerHTML = deserializedData;
}
function MedchartResendFailedDocumentsError(error) {
    var pageMessage = document.getElementById('ResendFailedDocumentsResult');
    pageMessage.innerHTML = error;
}

// Manually run the process to send email notifications to users about to be disallowed
function MedchartSendDisallowedUsersEmail() {
    // Display the retrieval message
    var pageMessage = document.getElementById('SendDisallowedUsersEmailResult');
    pageMessage.innerHTML = "Processing...Please wait...";
    $.ajax({
        url: "SystemAdministration.aspx/ExecuteSendAutoDisallowedUsersEmail",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            MedchartSendDisallowedUsersEmailSuccess(data);
        },
        error: function (xhr, status, error) {
            MedchartSendDisallowedUsersEmailError(error);
        },
        cache: false
    });

    FirePostback();
    return false;
}
function MedchartSendDisallowedUsersEmailSuccess(data) {
    var pageMessage = document.getElementById('SendDisallowedUsersEmailResult');
    var deserializedData = JSON.parse(data.d);
    pageMessage.innerHTML = deserializedData;
}
function MedchartSendDisallowedUsersEmailError(error) {
    var pageMessage = document.getElementById('SendDisallowedUsersEmailResult');
    pageMessage.innerHTML = error;
}

function MedchartFrameworkHashCheck() {
    // Display the retrieval message
    var pageMessage = document.getElementById('ExecFwHashCheckResult');
    pageMessage.innerHTML = "Processing...Please wait...";
    $.ajax({
        url: "SystemAdministration.aspx/ExecuteFrameworkHashCheck",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            MedchartFrameworkHashCheckSuccess(data);
        },
        error: function (xhr, status, error) {
            MedchartFrameworkHashCheckError(error);
        },
        cache: false
    });

    FirePostback();
    return false;
}

function MedchartFrameworkHashCheckSuccess(data) {
    var pageMessage = document.getElementById('ExecFwHashCheckResult');
    var deserializedData = JSON.parse(data.d);
    pageMessage.innerHTML = deserializedData;
}
function MedchartFrameworkHashCheckError(error) {
    var pageMessage = document.getElementById('ExecFwHashCheckResult');
    pageMessage.innerHTML = error;
}

// Manually run the process to complete Ecase bulk reassignments for any left in the queue
function EcaseClearReassignQueue() {
    // Display the retrieval message
    var pageMessage = document.getElementById('ClearEcaseReassignQueueResult');
    pageMessage.innerHTML = "Processing...Please wait...";
    $.ajax({
        url: "SystemAdministration.aspx/ExecuteEcaseClearReassignQueue",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            EcaseCleanReassignQueueSuccess(data);
        },
        error: function (xhr, status, error) {
            EcaseCleanReassignQueueError(error);
        },
        cache: false
    });

    FirePostback();
    return false;
}
function EcaseCleanReassignQueueSuccess(data) {
    var pageMessage = document.getElementById('ClearEcaseReassignQueueResult');
    var deserializedData = JSON.parse(data.d);
    pageMessage.innerHTML = deserializedData;
}
function EcaseCleanReassignQueueError(error) {
    var pageMessage = document.getElementById('ClearEcaseReassignQueueResult');
    pageMessage.innerHTML = error;
}

// Manually run the process to process any Health Assessment referrals pending
function EcaseProcessPendingHAReferrals() {
    // Display the retrieval message
    var pageMessage = document.getElementById('ProcessPendingHAReferralsResult');
    pageMessage.innerHTML = "Processing...Please wait...";
    $.ajax({
        url: "SystemAdministration.aspx/ExecuteEcaseProcessPendingHAReferrals",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            EcaseProcessPendingHAReferralsSuccess(data);
        },
        error: function (xhr, status, error) {
            EcaseProcessPendingHAReferralsError(error);
        },
        cache: false
    });

    FirePostback();
    return false;
}
function EcaseProcessPendingHAReferralsSuccess(data) {
    var pageMessage = document.getElementById('ProcessPendingHAReferralsResult');
    var deserializedData = JSON.parse(data.d);
    pageMessage.innerHTML = deserializedData;
}
function EcaseProcessPendingHAReferralsError(error) {
    var pageMessage = document.getElementById('ProcessPendingHAReferralsResult');
    pageMessage.innerHTML = error;
}

// Manually run the process to reload data of RCaseOrganization
function EcaseReloadRCaseOrganization() {
    // Display the retrieval message
    var pageMessage = document.getElementById('EcaseReloadRCaseOrganizationResult');
    pageMessage.innerHTML = "Processing...Please wait...";
    $.ajax({
        url: "SystemAdministration.aspx/ExecuteEcaseReloadRCaseOrganization",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            EcaseReloadRCaseOrganizationSuccess(data);
        },
        error: function (xhr, status, error) {
            EcaseReloadRCaseOrganizationError(error);
        },
        cache: false
    });

    FirePostback();
    return false;
}
function EcaseReloadRCaseOrganizationSuccess(data) {
    var pageMessage = document.getElementById('EcaseReloadRCaseOrganizationResult');
    var deserializedData = JSON.parse(data.d);
    pageMessage.innerHTML = deserializedData;
}
function EcaseReloadRCaseOrganizationError(error) {
    var pageMessage = document.getElementById('EcaseReloadRCaseOrganizationResult');
    pageMessage.innerHTML = error;
}

// Change module availability
function ChangeModuleAvailability(moduleId, controlId) {
    if (document.getElementById(controlId + "_0").checked === true) {
        window.PageMethods.ExecuteModifyModuleAvailability(moduleId, "False", ChangeModuleAvailabilityHandler);
    }
    else if (document.getElementById(controlId + "_1").checked === true) {
        window.PageMethods.ExecuteModifyModuleAvailability(moduleId, "True", ChangeModuleAvailabilityHandler);
    }

    var moduleAvailabilityResult = document.getElementById('ModuleAvailabilitySuccessLabel');
    moduleAvailabilityResult.innerHTML = "";

    FirePostback();
    return false;
}

function ChangeModuleAvailabilityHandler(returnValue) {
    var moduleAvailabilityResult = document.getElementById('ModuleAvailabilitySuccessLabel');
    moduleAvailabilityResult.innerHTML = returnValue;
}

function GetDocumentTransferData() {
    if (!vizDataOpened) {
        GetTodaysDocumentTransferPerformance();
        GetDocumentPerformanceHistory();
        GetMhaImportLogStatus();
        vizDataOpened = true;
    }
    return false;
}

// Get the Document Transfer Performance for today
function GetTodaysDocumentTransferPerformance() {
    // Display the retrieval message
    var pageMessage = document.getElementById('TodaysTransferPerformanceMsg');
    pageMessage.innerHTML = "Getting data...";

    $.ajax({
        url: "SystemAdministration.aspx/GetTodaysDocumentTransferPerformanceData",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            GetTodaysDocumentTransferPerformanceSuccess(data);
        },
        error: function (xhr, status, error) {
            GetTodaysDocumentTransferPerformanceError(error);
        },
        cache: false
    });

    FirePostback();
}
// Document Transfer Performance for today SUCCESS
function GetTodaysDocumentTransferPerformanceSuccess(data) {
    var pageMessage = document.getElementById('TodaysTransferPerformanceMsg');
    var visualizationDataSet = JSON.parse(data.d);
    if (visualizationDataSet.NoRecords === true) {
        pageMessage.innerHTML = "No Records found";
    } else {
        pageMessage.innerHTML = "";
        FrameworkProcessPieChart(visualizationDataSet);
    }
}
// Document Transfer Performance for today ERROR
function GetTodaysDocumentTransferPerformanceError(error) {
    var pageMessage = document.getElementById('TodaysTransferPerformanceMsg');
    pageMessage.innerHTML = "Error: " + error;
}

// Document Transfer Performance history
function GetDocumentPerformanceHistory() {
    // Display the retrieval message
    var pageMessage = document.getElementById('TransferPerformanceHistoryMsg');
    pageMessage.innerHTML = "Getting data...";

    $.ajax({
        url: "SystemAdministration.aspx/GetDocumentTransferPerformanceData",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            GetDocumentTransferPerformanceSuccess(data);
        },
        error: function (xhr, status, error) {
            GetDocumentTransferPerformanceError(error);
        },
        cache: false
    });

    FirePostback();
}
// Document Transfer Performance history SUCCESS
function GetDocumentTransferPerformanceSuccess(data) {
    var transferHistoryMsg = document.getElementById('TransferPerformanceHistoryMsg');
    var visualizationDataSet = JSON.parse(data.d);
    if (visualizationDataSet.NoRecords === true) {
        transferHistoryMsg.innerHTML = "No Records found";
    } else {
        transferHistoryMsg.innerHTML = "";
        FrameworkProcessSplineChart(visualizationDataSet);
    }
}
// Document Transfer Performance history ERROR
function GetDocumentTransferPerformanceError(error) {
    var pageMessage = document.getElementById('TransferPerformanceHistoryMsg');
    pageMessage.innerHTML = "Error: " + error;
}

// MHA Import record log status
function GetMhaImportLogStatus() {
    // Display the retrival message
    var pageMessage = document.getElementById('MHAImportStatusMsg');
    pageMessage.innerHTML = "Getting data...";

    $.ajax({
        url: "SystemAdministration.aspx/GetMhaImportLogStatusData",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            GetMhaImportLogStatusSuccess(data);
        },
        error: function (xhr, status, error) {
            GetMhaImportLogStatusError(error);
        },
        cache: false
    });

    FirePostback();
}
// MHA Import record log status SUCCESS
function GetMhaImportLogStatusSuccess(data) {
    var pageMessage = document.getElementById('MHAImportStatusMsg');
    var visualizationDataSet = JSON.parse(data.d);
    if (visualizationDataSet.NoRecords === true) {
        pageMessage.innerHTML = "No Records found";
    } else {
        pageMessage.innerHTML = "";
        FrameworkProcessPieChart(visualizationDataSet);
    }
}
// MHA Import record log status ERROR
function GetMhaImportLogStatusError(error) {
    var pageMessage = document.getElementById('MHAImportStatusMsg');
    pageMessage.innerHTML = "Error: " + error;
}


function MedchartGetServiceMemberData(soldierParameter) {
    // Display the retrieval message
    var pageMessage = document.getElementById('MedchartGetServiceMemberDataResult');
    pageMessage.innerHTML = "Processing...Please wait...";
    $.ajax({
        url: "SystemAdministration.aspx/GetServiceMemberDataFromDMDC",
        data: "{'soldierParameter' : '" + soldierParameter + "'}",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            MedchartGetServiceMemberDataSuccess(data);
        },
        error: function (xhr, status, error) {
            MedchartGetServiceMemberDataError(error);
        },
        cache: false
    });

    FirePostback();
    return false;
}

function MedchartGetServiceMemberDataSuccess(data) {
    var pageMessage = document.getElementById('MedchartGetServiceMemberDataResult');
    var deserializedData = JSON.parse(data.d);
    pageMessage.innerHTML = deserializedData;
}

function MedchartGetServiceMemberDataError(error) {
    var pageMessage = document.getElementById('MedchartGetServiceMemberDataResult');
    pageMessage.innerHTML = error;
}




// MAINTENANCE MODE FUNCTIONS

// LOAD GUEST LIST AND RETURN MAINTENANCE MODE
function GetMaintenanceModeInfo() {
    if (!maintenanceModeOpened) {
        GetMaintenenModeGuests();
        GetMaintenanceMode();
        maintenanceModeOpened = true;
    }
    return false;
}
//FRAMEWORK APP SETTINGS
function GetFrameworkAppSettings() {
    $.ajax(
        {
            url: "SystemAdministration.aspx/GetFrameworkAppSettings",
            method: "POST",
            contentType: "application/json; charset-utf-8",
            dataType: "json",
            success: function (data) {
                GetFrameworkAppSettingsSuccess(data);
            },
            error: function (xhr, status, error) {
                GetFrameworkAppSettingserror(error);
            },
            cache: false
        });
}

function GetFrameworkAppSettingsSuccess(data) {
    pageMessage.innerHTML = "";
    var logListData = JSON.parse(data.d);

    if (logListData === null) {
        CleanupListTable("framework-app-settings-table");
        pageMessage.innerHTML = "No Records";
    }
    else {

        if (document.getElementById("framework-app-settings-table").ej2_instances == null) {
            // Create the Grid initially
            var grid = new ej.grids.Grid({
                width: '100%',
                height: 'auto',
                allowPaging: false,
                pageSettings: { pageSize: 15, pageCount: 5 },
                allowSorting: false,
                allowTextWrap: true,
                textWrapSettings: { wrapMode: 'Content, Header' },
                dataSource: logListData,
                editSettings: { allowEditing: true },
                actionBegin(args) {
                    console.log(args);
                    if (args.requestType === 'save') {
                        var appSetting = args.data;
                        appSetting.UserId = $('[id*=hidUserId]').val();
                        $.ajax(
                            {
                                url: "SystemAdministration.aspx/SetFrameworkAppSetting",
                                data: JSON.stringify(appSetting),
                                method: "POST",
                                contentType: "application/json; charset-utf-8",
                                dataType: "json",
                                success: function (response) {
                                    UpdateFrameworkAppSettingsSuccess(response);
                                },
                                error: function (xhr, status, error) {
                                    alert(error);
                                    UpdateFrameworkAppSettingsFailure(error);
                                },
                                cache: false
                            });
                        FirePostback();
                        return false;
                    }

                },
                columns: [
                    { field: "Name", headerTextAlign: 'center', width: 135, headerText: "Setting Name", allowEditing: false, customAttributes: { class: 'customcss' } },
                    { field: "Value", headerTextAlign: 'center', width: 50, headerText: "Setting Value", customAttributes: { class: 'customcss' } },
                    { field: "ValueType", headerTextAlign: 'center', width: 50, headerText: "Type", allowEditing: false, customAttributes: { class: 'customcss' } },
                    { field: "Description", headerTextAlign: 'center', width: 350, headerText: "Setting definition", customAttributes: { class: 'customcss' } },
                    { field: "ExpirationInMinutes", type: 'number', textAlign: 'right', headerTextAlign: 'center', width: 50, headerText: "Expiration in Minutes", customAttributes: { class: 'customcss' } },
                    {
                        textAlign: 'center', headerText: 'Action', width: 50, commands: [
                            { type: 'Edit', buttonOption: { cssClass: 'e-flat', iconCss: 'e-edit e-icons' } },
                            { type: 'Save', buttonOption: { cssClass: 'e-flat', iconCss: 'e-update e-icons' } },
                            { type: 'Cancel', buttonOption: { cssClass: 'e-flat', iconCss: 'e-cancel-icon e-icons' } }], customAttributes: { class: 'customcss' }
                    }
                ]
            });

            if (grid.dataSource.length >= grid.pageSettings.pageSize)
                grid.allowPaging = true;
            else
                grid.allowPaging = false;

            grid.appendTo('#framework-app-settings-table');
        }
        else {
            var grid = document.getElementById("framework-app-settings-table").ej2_instances[0];
            grid.dataSource = logListData;

            if (grid.dataSource.length >= grid.pageSettings.pageSize)
                grid.allowPaging = true;
            else
                grid.allowPaging = false;

            grid.refresh(); // refresh the Grid.
        }
    }

}

function GetFrameworkAppSettingserror(error) {
    var statusMsg = document.getElementById('framework-app-settings-status-msg');
    statusMsg.innerHTML = "An error occurred retrieving the application settings.";
}

function UpdateFrameworkAppSettingsSuccess(response) {
    var result = JSON.parse(response.d);
    if (result.success !== 1 && result.errors.length > 0) {
        ErrorUpdatingFrameworkSetting(result.errors);
    }
}

function ErrorUpdatingFrameworkSetting(errors) {
    GetFrameworkAppSettings();
}

function UpdateFrameworkAppSettingsFailure(response) {
    ErrorUpdatingFrameworkSetting();
}
// GET THE CURRENT MAINTENANCE MODE
function GetMaintenanceMode() {
    $.ajax({
        url: "SystemAdministration.aspx/GetMaintenanceMode",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            GetMaintenanceModeSuccess(data);
        },
        error: function (xhr, status, error) {
            GetMaintenanceModeError(error);
        },
        cache: false
    });

    FirePostback();
}

function GetMaintenanceModeSuccess(data) {
    var result = JSON.parse(data.d);
    if (result) {
        $('#MaintenanceMode_On').prop('checked', true);
        $('#MaintenanceMode_On').button('refresh');
    }
    else {
        $('#MaintenanceMode_Off').prop('checked', true);
        $('#MaintenanceMode_Off').button('refresh');
    }
}

function GetMaintenanceModeError(error) {
    var statusMsg = document.getElementById('MaintenanceModeStatusMsg');
    statusMsg.innerHTML = "An error occurred retrieving the Maintenance Mode status";
}

// Handles the change event for the Maintenance Mode ON/OFF radio buttons
$(function () {
    $("input[name=MaintenanceModeSwitch]:radio").change(function () {
        if ($(this).val() === "0") {
            // change maintenance mode to OFF
            MaintenanceModeOff();
        }
        else {
            // change maintenance mode to ON
            MaintenanceModeOn();
        }
    });
});

// SET THE MAINTENANCE MODE TO ON
function MaintenanceModeOn() {
    $.ajax({
        url: "SystemAdministration.aspx/MaintenanceModeTurnOn",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            MaintenanceModeOnSuccess(data);
        },
        error: function (xhr, status, error) {
            MaintenanceModeOnError(error);
        },
        cache: false
    });

    FirePostback();
    return false;
}

function MaintenanceModeOnSuccess(data) {
    var result = JSON.parse(data.d);
    var msg = document.getElementById('MaintenanceModeStatusMsg');
    if (!result) {
        msg.innerHTML = "Unable to turn Maintenance Mode ON";
    }
}

function MaintenanceModeOnError(error) {
    var msg = document.getElementById('MaintenanceModeStatusMsg');
    msg.innerHTML = "An error occurred trying to turn Maintenance Mode ON";
}

// SET THE MAINTENANCE MODE TO OFF
function MaintenanceModeOff() {
    $.ajax({
        url: "SystemAdministration.aspx/MaintenanceModeTurnOff",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            MaintenanceModeOffSuccess(data);
        },
        error: function (xhr, status, error) {
            MaintenanceModeOffError(error);
        },
        cache: false
    });

    FirePostback();
    return false;
}

function MaintenanceModeOffSuccess(data) {
    var result = JSON.parse(data.d);
    var msg = document.getElementById('MaintenanceModeStatusMsg');
    if (!result) {
        msg.innerHTML = "Unable to turn Maintenance Mode OFF";
    }
}

function MaintenanceModeOffError(error) {
    var msg = document.getElementById('MaintenanceModeStatusMsg');
    msg.innerHTML("An error occurred trying to turn Maintenance Mode OFF");
}

// LOAD ALL MAINTENANCE MODE GUESTS
function GetMaintenenModeGuests() {
    var pageMessage = document.getElementById('LoadingGuestListMsg');
    pageMessage.innerHTML = "Getting data...";

    $.ajax({
        url: "SystemAdministration.aspx/GetMaintenanceModeGuests",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            GetMaintenenModeGuestsSuccess(data);
        },
        error: function (xhr, status, error) {
            GetMaintenenModeGuestsError(xhr.responseJSON.Message);
        },
        cache: false
    });

    FirePostback();
}

function GetMaintenenModeGuestsSuccess(data) {
    var pageMessage = document.getElementById('LoadingGuestListMsg');
    pageMessage.innerHTML = "";
    $("#MaintenanceModeGuestListTable").empty();
    var guestListData = JSON.parse(data.d);
    if (guestListData === null) {
        pageMessage.innerHTML = "No one on the list. Please add users.";
    }
    else {
        $(guestListData).each(function () {
            var tRow = document.createElement("tr");
            $.each(this, function (name, value) {
                if (name.toLowerCase() === 'userid') {
                    $("<td></td>").html("<a href='#' onclick=RemoveMMGuest(" + value + ")>Remove</a>").appendTo(tRow);
                }
                else {
                    $("<td></td>").html(value).appendTo(tRow);
                }
            });
            document.getElementById("MaintenanceModeGuestListTable").appendChild(tRow);
        });
    }
}

function GetMaintenenModeGuestsError(error) {
    var pageMessage = document.getElementById('LoadingGuestListMsg');
    pageMessage.innerHTML = error;
}

// ADD NEW MAINTENACE MODE GUEST
function AddNewMMGuest() {
    var addUserMsg = document.getElementById('AddMMUserStatus');
    addUserMsg.innerHTML = "Adding new user to the Maintenance Mode Guest list...";

    var usersEdiPn = $('#NewUserEdiPn').val();

    $.ajax({
        url: "SystemAdministration.aspx/AddNewMMGuest",
        data: JSON.stringify({ ediPn: usersEdiPn }),
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            AddNewMMGuestSuccess(data);
        },
        error: function (xhr, status, error) {
            AddNewMMGuestError(error);
        },
        cache: false
    });

    FirePostback();
    return false;
}

function AddNewMMGuestSuccess(data) {
    var addUserMsg = document.getElementById('AddMMUserStatus');
    var result = JSON.parse(data.d);
    if (result) {
        addUserMsg.innerHTML = "";
        $('#NewUserEdiPn').val("");
        GetMaintenenModeGuests();
    }
    else {
        addUserMsg.innerHTML = "Failed to add new user. Please check the EDIPN value.";
    }
}

function AddNewMMGuestError(error) {
    var addUserMsg = document.getElementById('AddMMUserStatus');
    addUserMsg.innerHTML = "An error occurred attempting to add the user. Error: " + error;
}

// REMOVE MAINTENANCE MODE GUEST
function RemoveMMGuest(userId) {
    $.ajax({
        url: "SystemAdministration.aspx/RemoveMMGuest",
        data: JSON.stringify({ userId: userId }),
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            RemoveMMGuestSuccess();
        },
        error: function (xhr, status, error) {
            RemoveMMGuestError(error);
        },
        cache: false
    });

    FirePostback();
}

function RemoveMMGuestSuccess() {
    GetMaintenenModeGuests();
}

function RemoveMMGuestError() {
    var pageMessage = document.getElementById('LoadingGuestListMsg');
    pageMessage.innerHTML = error;
}

function FirePostback() {
    __doPostBack('SysAdminPostbackButton', '');
}

function MasAdminFirePostback() {
    __doPostBack('MasAdminPostbackButton', '');
}

function MedchartGetSchedulerStatus(version) {
    $.ajax({
        url: "MasManagement.aspx/GetSchedulerStatus",
        data: "{'version' : '" + version + "'}",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            MedchartGetSchedulerStatusSuccess(data);
        },
        error: function (xhr, status, error) {
            MedchartGetSchedulerStatusError(error);
        },
        cache: false
    });

    MasAdminFirePostback();
    return false;
}

function MedchartGetSchedulerStatusSuccess(data) {
    var schedulerStatusLabel = document.getElementById('SchedulerStatusResult');    
    var result = JSON.parse(data.d);
    if (result) {
        schedulerStatusLabel.innerHTML = "Scheduler is " + result.Result;
    }
    else {
        schedulerStatusLabel.innerHTML = "Failed to get Scheduler Status.";
    }
}

function MedchartGetSchedulerStatusError(error) {
    var statusMsg = document.getElementById('SchedulerStatusResult');
    statusMsg.innerHTML = "An error occurred attempting to get Scheduler Status. Error: " + error;
}


function MedchartResumeScheduler(userEdipi, version) {
    $.ajax({
        url: "MasManagement.aspx/ResumeScheduler",
        data: "{'userEdipi' : '" + userEdipi + "', 'version' : '" + version + "'}",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            MedchartResumeSchedulerSuccess(data);
        },
        error: function (xhr, status, error) {
            MedchartResumeSchedulerError(error);
        },
        cache: false
    });

    setTimeout(function () {
        MedchartGetSchedulerStatus(version);
    }, 2000);

    MasAdminFirePostback();
    return false;
}

function MedchartResumeSchedulerSuccess(data) {
    var statusMsg = document.getElementById('SchedulerStatusResult');
    statusMsg.innerHTML = data.d;
    var result = JSON.parse(data.d);
    if (result) {
        statusMsg.innerHTML = "Resume Scheduler...";
    }
    else {
        statusMsg.innerHTML = "Failed to Resume Scheduler.";
    }
}

function MedchartResumeSchedulerError(error) {
    var statusMsg = document.getElementById('SchedulerStatusResult');
    statusMsg.innerHTML = "An error occurred attempting to Resume Scheduler. Error: " + error;
}


function MedchartPauseScheduler(userEdipi, version) {
    $.ajax({
        url: "MasManagement.aspx/PauseScheduler",
        data: "{'userEdipi' : '" + userEdipi + "', 'version' : '" + version + "'}",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            MedchartPauseSchedulerSuccess(data);
        },
        error: function (xhr, status, error) {
            MedchartPauseSchedulerError(error);
        },
        cache: false
    });

    setTimeout(function () {
        MedchartGetSchedulerStatus(version);
    }, 2000);


    MasAdminFirePostback();
    return false;
}

function MedchartPauseSchedulerSuccess(data) {
    var statusMsg = document.getElementById('SchedulerStatusResult');
    statusMsg.innerHTML = data.d;
    var result = JSON.parse(data.d);
    if (result) {
        statusMsg.innerHTML = "Pause Scheduler...";
    }
    else {
        statusMsg.innerHTML = "Failed to Pause Scheduler.";
    }
}

function MedchartPauseSchedulerError(error) {
    var statusMsg = document.getElementById('SchedulerStatusResult');
    statusMsg.innerHTML = "An error occurred attempting to Pause Scheduler. Error: " + error;
}



function MedchartRebootScheduler(userEdipi, version) {
    $.ajax({
        url: "MasManagement.aspx/RebootScheduler",
        data: "{'userEdipi' : '" + userEdipi + "', 'version' : '" + version + "'}",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            MedchartRebootSchedulerSuccess(data);
        },
        error: function (xhr, status, error) {
            MedchartRebootSchedulerError(error);
        },
        cache: false
    });

    setTimeout(function () {
        MedchartGetSchedulerStatus(version);
    }, 2000);

    MasAdminFirePostback();
    return false;
}

function MedchartRebootSchedulerSuccess(data) {
    var statusMsg = document.getElementById('SchedulerStatusResult');
    statusMsg.innerHTML = data.d;
    var result = JSON.parse(data.d);
    if (result) {
        statusMsg.innerHTML = "Reboot Scheduler...";
    }
    else {
        statusMsg.innerHTML = "Failed to Reboot Scheduler.";
    }
}

function MedchartRebootSchedulerError(error) {
    var statusMsg = document.getElementById('SchedulerStatusResult');
    statusMsg.innerHTML = "An error occurred attempting to Reboot Scheduler. Error: " + error;
}



function MedchartGetSchedulerLogs(startTime, endTime, version) {

    var pageMessage = document.getElementById('LoadingSchedulerLogListMsg');
    pageMessage.innerHTML = "Loading Scheduler Log, please wait...";

    $.ajax({
        url: "MasManagement.aspx/GetSchedulerLogs",
        data: "{'startTime' : '" + startTime + "', 'endTime' : '" + endTime + "', 'version' : '" + version + "'}",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            GetSchedulerLogsSuccess(data);
        },
        error: function (xhr, status, error) {
            GetSchedulerLogsError(error);
        },
        cache: false
    });

    MasAdminFirePostback();
    return false;
}

function GetSchedulerLogsSuccess(data) {
    var pageMessage = document.getElementById('LoadingSchedulerLogListMsg');
    pageMessage.innerHTML = "";
    var logListData = JSON.parse(data.d);
    if (logListData == null) {
        CleanupListTable("SchedulerLogListTable");
        pageMessage.innerHTML = "No Records";
    }
    else {
        if (document.getElementById("SchedulerLogListTable").ej2_instances == null) {
            // Create the Grid initially
            var grid = new ej.grids.Grid({
                width: '100%',
                height: 'auto',
                allowPaging: true,
                pageSettings: { pageSize: 15, pageCount: 5 },
                allowSorting: true,
                dataSource: logListData,
                columns: [
                    { field: "Level", headerTextAlign: 'center', width: 55, headerText: "Level" },
                    { field: "LogTime", headerTextAlign: 'center', width: 150, headerText: "Log Time", type: 'date', format: 'yyyy-MM-dd hh:mm:ss' },
                    { field: "Message", headerTextAlign: 'center', width: 350, headerText: "Message" }]
            });

            if (grid.dataSource.length >= grid.pageSettings.pageSize)
                grid.allowPaging = true;
            else
                grid.allowPaging = false;

            grid.appendTo('#SchedulerLogListTable');
        }
        else {
            var grid = document.getElementById("SchedulerLogListTable").ej2_instances[0];
            grid.dataSource = logListData;

            if (grid.dataSource.length >= grid.pageSettings.pageSize)
                grid.allowPaging = true;
            else
                grid.allowPaging = false;

            grid.refresh(); // refresh the Grid.
        }
    }
}
function formatDate(value) {
    var date = new Date(value);
    var formatted = date.getFullYear() + "-" +
        ("0" + (date.getMonth() + 1)).slice(-2) + "-" +
        ("0" + date.getDate()).slice(-2) + " " +
        ("0" + date.getHours()).slice(-2) + ":" +
        ("0" + date.getMinutes()).slice(-2) + ":" +
        ("0" + date.getSeconds()).slice(-2);
    return formatted;
}

function pageMessage(elementId, message) {
    var pageMessage = document.getElementById(elementId);
    pageMessage.innerHTML = message;
}


function MedchartGetServiceBrokerLogs(startTime, endTime) {
    pageMessage('LoadingServiceBrokerLogMsg', 'Loading Service Broker Log, please wait...');
    $.ajax({
        url: "ServiceBrokerActivity.aspx/GetActivityLog",
        data: "{'startTime' : '" + startTime + "', 'endTime' : '" + endTime + "'}",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            GetServiceBrokerLogSuccess(data);
        },
        error: function (xhr, status, error) {
            GetJobLogsError(error);
        },
        cache: false
    });
    return false;
}

function CleanupListTable(elementId) {

    $("#" + elementId).html('');
    if (document.getElementById("ServiceBrokerLogTable").ej2_instances !== null)
        document.getElementById("ServiceBrokerLogTable").ej2_instances = null;
}

function GetServiceBrokerLogSuccess(data) {
    pageMessage('LoadingServiceBrokerLogMsg', '');
    
    var logListData = JSON.parse(data.d);
    if (logListData.length == 0) {
        CleanupListTable("ServiceBrokerLogTable");
        pageMessage('LoadingServiceBrokerLogMsg', 'No Records Found');        
    }
    else {

        if (document.getElementById("ServiceBrokerLogTable").ej2_instances == null) {
            // Create the Grid initially
            var grid = new ej.grids.Grid({
                width: '100%',
                height: 'auto',
                allowPaging: true,
                pageSettings: { pageSize: 15, pageCount: 5 },
                allowSorting: true,
                dataSource: logListData,
                columns: [
                    { field: "ProcedureName", headerTextAlign: 'center', width: 100, headerText: "Procedure Name" },
                    { field: "SubmitTime", headerTextAlign: 'center', width: 75, headerText: "Submit Time", type: 'date', format: 'yyyy-MM-dd hh:mm:ss' },
                    { field: "StartTime", headerTextAlign: 'center', width: 75, headerText: "Start Time", type: 'date', format: 'yyyy-MM-dd hh:mm:ss' },
                    { field: "FinishTime", headerTextAlign: 'center', width: 75, headerText: "Finish Time", type: 'date', format: 'yyyy-MM-dd hh:mm:ss' },
                    { field: "ErrorMessage", headerTextAlign: 'center', width: 130, headerText: "Error Message" }
                ]
            });

            if (grid.dataSource.length >= grid.pageSettings.pageSize)
                grid.allowPaging = true;
            else
                grid.allowPaging = false;

            grid.appendTo('#ServiceBrokerLogTable');
        }
        else {
            var grid = document.getElementById("ServiceBrokerLogTable").ej2_instances[0];
            grid.dataSource = logListData;

            if (grid.dataSource.length >= grid.pageSettings.pageSize)
                grid.allowPaging = true;
            else
                grid.allowPaging = false;

            grid.refresh(); // refresh the Grid.
        }
        
    }


}


function GetServiceBrokerLogError(error) {
    pageMessage('LoadingServiceBrokerLogMsg', error);
}

function MedchartGetJobLogs(group, level, startTime, endTime, version) {

    var pageMessage = document.getElementById('LoadingJobLogListMsg');
    pageMessage.innerHTML = "Loading Job Log, please wait...";

    $.ajax({
        url: "MasManagement.aspx/GetJobLogs",
        data: "{'group' : '" + group + "', 'level' : '" + level + "', 'startTime' : '" + startTime + "', 'endTime' : '" + endTime + "', 'version' : '" + version + "'}",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            GetJobLogsSuccess(data);
        },
        error: function (xhr, status, error) {
            GetJobLogsError(error);
        },
        cache: false
    });

    MasAdminFirePostback();
    return false;
}

function GetJobLogsSuccess(data) {
    var pageMessage = document.getElementById('LoadingJobLogListMsg');
    pageMessage.innerHTML = "";
    var logListData = JSON.parse(data.d);
    if (logListData == null) {
        CleanupListTable("JobLogListTable");
        pageMessage.innerHTML = "No Records";        
    }
    else {

        if (document.getElementById("JobLogListTable").ej2_instances == null) {
            // Create the Grid initially
            var grid = new ej.grids.Grid({
                width: '100%',
                height: 'auto',
                allowPaging: true,
                pageSettings: { pageSize: 15, pageCount: 5 },
                allowSorting: true,
                dataSource: logListData,
                columns: [
                    { field: "JobName", headerTextAlign: 'center', width: 95, headerText: "Job Name" },
                    { field: "LogTime", headerTextAlign: 'center', width: 75, headerText: "LogTime", type: 'date', format: 'yyyy-MM-dd hh:mm:ss' },
                    { field: "Group", headerTextAlign: 'center', width: 45, headerText: "Group" },
                    { field: "Level", headerTextAlign: 'center', width: 40, headerText: "Level" },
                    { field: "Message", headerTextAlign: 'center', width: 130, headerText: "Message" }
                ]
            });

            if (grid.dataSource.length >= grid.pageSettings.pageSize)
                grid.allowPaging = true;
            else
                grid.allowPaging = false;

            grid.appendTo('#JobLogListTable');
        }
        else {
            var grid = document.getElementById("JobLogListTable").ej2_instances[0];
            grid.dataSource = logListData;

            if (grid.dataSource.length >= grid.pageSettings.pageSize)
                grid.allowPaging = true;
            else
                grid.allowPaging = false;

            grid.refresh(); // refresh the Grid.
        }
    }
}

function GetJobLogsError(error) {
    var pageMessage = document.getElementById('LoadingJobLogListMsg');
    pageMessage.innerHTML = error;
}

function MedchartGetJobDetails(version) {

    var pageMessage = document.getElementById('LoadingJobDetailsListMsg');
    pageMessage.innerHTML = "Loading Scheduler Details, please wait...";

    $.ajax({
        url: "MasManagement.aspx/GetJobDetails",
        data: "{'version' : '" + version + "'}",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            GetJobDetailsSuccess(data);
        },
        error: function (xhr, status, error) {
            GetJobDetailsError(error);
        },
        cache: false
    });

    MasAdminFirePostback();
    return false;
}


function GetJobDetailsSuccess(data) {
    var pageMessage = document.getElementById('LoadingJobDetailsListMsg');
    pageMessage.innerHTML = "";
    var detailsListData = JSON.parse(data.d);
    if (detailsListData == null) {
        pageMessage.innerHTML = "";
    }
    else {
        $(detailsListData).each(function () {
            var tRow = document.createElement("tr");
            var jobId = '';
            $.each(this, function (name, value) {
                if (name.toLowerCase() == 'jobid') {
                    jobId = value;
                }
                if (name.toLowerCase() == 'jobtriggers') {
                    var trigger = "<input type='button' id='jobTriggerDataButton' value='View Triggers' onclick='return showJqSingleJobTriggersModalDialog(" + jobId + ");' class='jqbutton' />";
                    $("<td align='left'></td>").html(trigger).appendTo(tRow);
                }
                else {
                    $("<td align='left'></td>").html(value).appendTo(tRow);
                }
            });
            document.getElementById("JobDetailsListTable").appendChild(tRow);
        });
    }
}

function GetJobDetailsError(error) {
    var pageMessage = document.getElementById('LoadingJobDetailsListMsg');
    pageMessage.innerHTML = error;
}



function MedchartResumeJob(jobKey, userEdipi, version) {
    var statusMsg = document.getElementById('JobStatusResult');
    statusMsg.innerHTML = "Resume Job...";

    $.ajax({
        url: "MasManagement.aspx/ResumeJob",
        data: "{'jobKey' : '" + jobKey + "', 'userEdipi' : '" + userEdipi + "', 'version' : '" + version + "'}",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            MedchartResumeJobSuccess(data, jobKey);
        },
        error: function (xhr, status, error) {
            MedchartResumeJobError(error);
        },
        cache: false
    });

    MasAdminFirePostback();
    return false;
}

function MedchartResumeJobSuccess(data, jobKey) {
    var statusMsg = document.getElementById('result' + "'" + jobKey + "'");
    var result = JSON.parse(data.d);
    if (result) {
        statusMsg.innerHTML = "Job has successfully resumed.";
        statusMsg.style.color = "green";
    }
    else {
        statusMsg.innerHTML = "Failed to Resume Job.";
        statusMsg.style.color = "red";
    }
}

function MedchartResumeJobError(error) {
    var statusMsg = document.getElementById('JobStatusResult');
    statusMsg.innerHTML = "An error occurred attempting to Resume Job. Error: " + error;
    statusMsg.style.color = "red";
}

function MedchartPauseJob(jobKey, userEdipi, version) {
    var statusMsg = document.getElementById('JobStatusResult');
    statusMsg.innerHTML = "Pause Job...";

    $.ajax({
        url: "MasManagement.aspx/PauseJob",
        data: "{'jobKey' : '" + jobKey + "', 'userEdipi' : '" + userEdipi + "', 'version' : '" + version + "'}",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            MedchartPauseJobSuccess(data, jobKey);
        },
        error: function (xhr, status, error) {
            MedchartPauseJobError(error);
        },
        cache: false
    });

    MasAdminFirePostback();
    return false;
}

function MedchartPauseJobSuccess(data, jobKey) {
    var statusMsg = document.getElementById('result' + "'" + jobKey + "'");
    var result = JSON.parse(data.d);
    if (result) {
        statusMsg.innerHTML = "Job has successfully paused.";
        statusMsg.style.color = "green";
    }
    else {
        statusMsg.innerHTML = "Failed to Pause Job.";
        statusMsg.style.color = "red";
    }
}

function MedchartPauseJobError(error) {
    var statusMsg = document.getElementById('JobStatusResult');
    statusMsg.innerHTML = "An error occurred attempting to Pause Job. Error: " + error;
    statusMsg.style.color = "red";
}

function MedchartGetSchedulerErrors(startTime, endTime, version) {

    var pageMessage = document.getElementById('LoadingSchedulerErrorListMsg');
    pageMessage.innerHTML = "Loading Error Log, please wait...";

    $.ajax({
        url: "MasManagement.aspx/GetSchedulerErrors",
        data: "{'startTime' : '" + startTime + "', 'endTime' : '" + endTime + "', 'version' : '" + version + "'}",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            GetSchedulerErrorsSuccess(data);
        },
        error: function (xhr, status, error) {
            GetSchedulerErrorsError(error);
        },
        cache: false
    });

    MasAdminFirePostback();
    return false;
}

function GetSchedulerErrorsSuccess(data) {
    var pageMessage = document.getElementById('LoadingSchedulerErrorListMsg');
    pageMessage.innerHTML = "";
    var errorListData = JSON.parse(data.d);
    if (errorListData == null) {
        CleanupListTable("SchedulerErrorListTable");
        pageMessage.innerHTML = "No Records";
    }
    else {

        if (document.getElementById("SchedulerErrorListTable").ej2_instances == null) {
            // Create the Grid initially
            var grid = new ej.grids.Grid({
                width: '100%',
                height: 'auto',
                allowPaging: true,
                pageSettings: { pageSize: 15, pageCount: 5 },
                allowSorting: true,
                dataSource: logListData,
                columns: [
                    { field: "LogTime", headerTextAlign: 'center', width: 105, headerText: "Log Time", type: 'date', format: 'yyyy-MM-dd hh:mm:ss' },
                    { field: "Message", headerTextAlign: 'center', width: 350, headerText: "Message" }]
            });

            if (grid.dataSource.length >= grid.pageSettings.pageSize)
                grid.allowPaging = true;
            else
                grid.allowPaging = false;

            grid.appendTo('#SchedulerErrorListTable');
        }
        else {
            var grid = document.getElementById("SchedulerErrorListTable").ej2_instances[0];
            grid.dataSource = logListData;

            if (grid.dataSource.length >= grid.pageSettings.pageSize)
                grid.allowPaging = true;
            else
                grid.allowPaging = false;

            grid.refresh(); // refresh the Grid.
        }
    }
}

function GetSchedulerErrorsError(error) {
    var pageMessage = document.getElementById('LoadingSchedulerErrorListMsg');
    pageMessage.innerHTML = error;
}


function MedchartGetAuditLogs(edipi, startTime, endTime, version) {

    var pageMessage = document.getElementById('LoadingAuditLogListMsg');
    pageMessage.innerHTML = "Loading Audit Log, please wait...";

    $.ajax({
        url: "MasManagement.aspx/GetAuditLogs",
        data: "{'edipi' : '" + edipi + "','startTime' : '" + startTime + "','endTime' : '" + endTime + "', 'version' : '" + version + "'}",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            GetAuditLogsSuccess(data);
        },
        error: function (xhr, status, error) {
            GetAuditLogsError(error);
        },
        cache: false
    });

    MasAdminFirePostback();
    return false;
}

function GetAuditLogsSuccess(data) {
    var pageMessage = document.getElementById('LoadingAuditLogListMsg');
    pageMessage.innerHTML = "";
    var auditListData = JSON.parse(data.d);
    if (auditListData == null) {
        CleanupListTable("AuditLogListTable");
        pageMessage.innerHTML = "No Records";
    }
    else {
 
        if (document.getElementById("AuditLogListTable").ej2_instances == null) {
            // Create the Grid initially
            var grid = new ej.grids.Grid({
                width: '100%',
                height: 'auto',
                allowPaging: true,
                pageSettings: { pageSize: 15, pageCount: 5 },
                allowSorting: true,
                dataSource: auditListData,
                columns: [
                    { field: "Edipi", headerTextAlign: 'center', width: 85, headerText: "Edipi" },
                    { field: "LogTime", headerTextAlign: 'center', width: 105, headerText: "Log Time" },
                    { field: "Action", headerTextAlign: 'center', width: 350, headerText: "Message" }                ]
            });

            if (grid.dataSource.length >= grid.pageSettings.pageSize)
                grid.allowPaging = true;
            else
                grid.allowPaging = false;

            grid.appendTo('#AuditLogListTable');
        }
        else {
            var grid = document.getElementById("AuditLogListTable").ej2_instances[0];
            grid.dataSource = logListData;

            if (grid.dataSource.length >= grid.pageSettings.pageSize)
                grid.allowPaging = true;
            else
                grid.allowPaging = false;

            grid.refresh(); // refresh the Grid.
        }

    }
}

function GetAuditLogsError(error) {
    var pageMessage = document.getElementById('LoadingAuditLogListMsg');
    pageMessage.innerHTML = error;
}
function SetOcchealthHomeTileCounts() {
    $.ajax({
        url: "Home.aspx/GetOcchealthHomeTileCounts",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            SetOcchealthHomeTileCountsSuccess(data);
        },
        error: function (xhr, status, error) {
            SetOcchealthHomeTileCountsError(error);
        },
        cache: false
    });

    return false;
}

function SetOcchealthHomeTileCountsSuccess(data) {
    if (data !== null) {
        for (k in data.d) {
            var countObj = document.getElementById(k);
            if (countObj != null) {
                countObj.innerHTML = data.d[k];
            }
        }
    }
    var occhealthCountDiv = document.getElementById('occhealthCountsDiv');
    occhealthCountDiv.style.display = "block";
    var occhealthCountWaitingMessageDiv = document.getElementById('occhealthCountsWaitingMessage');
    occhealthCountWaitingMessageDiv.style.display = "none";
}

function SetOcchealthHomeTileCountsError(error) {
    var occhealthCountDiv = document.getElementById('occhealthCountsDiv');
    occhealthCountDiv.style.display = "block";
    var occhealthCountWaitingMessageDiv = document.getElementById('occhealthCountsWaitingMessage');
    occhealthCountWaitingMessageDiv.style.display = "none";
}

function SetOhrHomeTileCounts() {
    $.ajax({
        url: "Home.aspx/GetOhrHomeTileCounts",
        method: "POST",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            SetOhrHomeTileCountsSuccess(data);
        },
        error: function (xhr, status, error) {
            SetOhrHomeTileCountsError(error);
        },
        cache: false
    });

    return false;
}

function SetOhrHomeTileCountsSuccess(data) {
    if (data !== null) {
        for (k in data.d) {
            var countObj = document.getElementById(k);
            if (countObj != null) {
                countObj.innerHTML = data.d[k];
            }
        }
    }
    var ohrCountDiv = document.getElementById('ohrCountsDiv');
    ohrCountDiv.style.display = "block";
    var ohrCountDivCountWaitingMessageDiv = document.getElementById('ohrCountsWaitingMessage');
    ohrCountDivCountWaitingMessageDiv.style.display = "none";
}

function SetOhrHomeTileCountsError(error) {
    var ohrCountDiv = document.getElementById('ohrCountsDiv');
    ohrCountDiv.style.display = "block";
    var ohrCountDivCountWaitingMessageDiv = document.getElementById('ohrCountsWaitingMessage');
    ohrCountDivCountWaitingMessageDiv.style.display = "none";
}

function GetUserDetailsByEDI() {
    $('#SearchStatusLabelDefault').show();

    if (validateSearchForm()) {
        $.ajax({
            type: "POST",
            url: "UserLookup.aspx/GetUserDetailsByEDI",
            data: "{'edipi' : '" + document.getElementById('UserEdipi').value + "'}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (data) {
                GetUserDetailsByEDISuccess(data);
            },
            error: function (xhr, status, error) {
                GetUserDetailsByEDIError(error);
            },
            cache: false
        });
    }
    return false;
}

function GetUserDetailsByEDISuccess(data) {
    if (data.d != "null") {
        var deserializedData = JSON.parse(data.d);
        $('#FirstNameLabel')[0].innerText = deserializedData.FirstName;
        $('#LastNameLabel')[0].innerText = deserializedData.LastName;
        $('#LockedOutValueLabel')[0].innerText = deserializedData.LockedOut;
        $('#HipaaExpirationDateLabel')[0].innerHTML = deserializedData.HipaaExpirationDate;
        DisplayUsersRoles(deserializedData.UserRoles);
        $('#UserDetails').show();
    }
    else {       
        $('#SearchStatusLabelDefault').hide();
        $('#SearchStatusLabelNoResult').show();
        $('#EdiNoResult')[0].innerText = document.getElementById('UserEdipi').value;
        $('#UserDetails').hide();
    }
}

function GetUserDetailsByEDIError(error) {
    var pageMessage = document.getElementById('ProcessPendingHAReferralsResult');
    pageMessage.innerHTML = error;
}

function DisplayUsersRoles(roleListData) {
    var pageMessage = document.getElementById('LoadingUsersRolesListMsg');
    pageMessage.innerHTML = "";
    $("#UsersRolesListTable").empty();

    if (roleListData == null) {
        pageMessage.innerHTML = "No user roles.";
    }
    else {
        $(roleListData).each(function () {
            var tRow = document.createElement("tr");
            $.each(this, function (name, value) {
                if(name == "Module"){
                    $("<td style='text-align:left;padding-left: 40px;width: 20%;'></td>").html(value).appendTo(tRow);
                }
                else if(name == "Status"){
                    $("<td style='width: 20%;'></td>").html(value).appendTo(tRow);
                }
                else{
                    $("<td style='text-align:left;width: 20%;'></td>").html(value).appendTo(tRow);
                }
                
            });
            document.getElementById("UsersRolesListTable").appendChild(tRow);
        });
    }
}

function validateSearchForm() {
    var validForm = true;
    var validField = false;
    var edipn = document.getElementById('UserEdipi').value;

    // Hide all field alerts
    $("#edipin10DigitAlert").hide();
    $("#edipinRequiredAlert").hide();

    if (edipn == "") {
        $("#edipinRequiredAlert").show();
        validForm = false;
    }
    else if (edipn.length > 0) {
        if (edipn != "") {
            edipn = edipn.replace(/\D/g, "");
            validField = (edipn.length == 10);
            validForm = validForm && validField;

            // show field alert
            if (!validField) {
                $("#edipin10DigitAlert").show();
            }
        }
    }
    return validForm;
}

function removeNonNumericChars(element) {
    // Only remove if there are actually non-numeric values
    if ($(element).val().replace(/\d/g, "").length > 0) {
        $(element).val($(element).val().replace(/\D*/g, ""));
    }
}

function acceptOnlyControlKeystrokes(e) {
    return e.ctrlKey || e.altKey
        || (47 < e.keyCode && e.keyCode < 58 && e.shiftKey == false)
        || (95 < e.keyCode && e.keyCode < 106)
        || (e.keyCode == 8) || (e.keyCode == 9)
        || (e.keyCode > 34 && e.keyCode < 40)
        || (e.keyCode == 46);
}
var dhapEvents = ["8018", "8019", "8020", "8021", "8022", "8065", "8066", "8071"];
var permissionMatrix = createPermissionsMatrix();

function createPermissionsMatrix() {
    return {
        //eCase Re-Assign Cases
        "8": {
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: ["1007"] }
                ]
            }

        },
        //eCase View Medical Data
        "10": {
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: ["11"] }
                ]
            }
        },
        //eCase Add/Edit Medical Data
        "11": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["10"] }
                ]
            }
        },
        //eCase Administration Manage/Grant Sensitive Permissions
        "17": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["27", "28"] }
                ]
            }
        },
        //eCase Administration Approve eCase Users
        "26": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["27"] }
                ]
            },
        },
        //Manage eCase Users
        "27": {
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: ["17", "26", "28"] }
                ]
            }
        },
        //eCase Administration Manage eCase User Permissions
        "28": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["27"] }
                ]
            },
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: ["17"] }
                ]
            }
        },
        //eCase HA Referrals Permissions
        "1034": {
            onCheck: {
                actions: [
                    { action: checkTheBox, permissions: ["1025"] },
                    { action: disableBox, permissions: ["1025"] },

                ]
            },
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: ["1025"] },
                    { action: enableBox, permissions: ["1025"] },
                ]
            }
        },
        //Approve MRR Users
        "29": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["30"] }
                ]
            }
        },
        //Manage MRR Users
        "30": {
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: ["29", "31"] }
                ]
            }
        },
        //Manage MRR User Permissions
        "31": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["30"] }
                ]
            }
        },
        //Re-Assign Cases Organization-Wide
        "1007": {
            onCheck: {
                actions: [
                    { action: checkTheBox, permissions: ["8"] }
                ]
            }
        },
        "1018": {
            onCheck: {
                actions: [
                    { action: checkTheBox, permissions: ["1026"] },
                    { action: disableBox, permissions: ["1026"] },
                    { action: enableBox, permissions: ["1027"] }
                ]
            },
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: ["1027", "1026"] },
                    { action: disableBox, permissions: ["1026", "1027"] }
                ]
            }
        },
        "1026": {
            onCheck: {
                actions: [
                    { action: enableBox, permissions: ["1027"] }
                ]
            },
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: ["1027"] },
                    { action: disableBox, permissions: ["1027"] }
                ]
            }
        },
        //Approve OccHealth Users
        "2001": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["2002"] }
                ]
            }
        },
        //Manage OccHealth Users
        "2002": {
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: ["2001", "2003"] }
                ]
            }
        },
        //Manage OccHealth User Permissions
        "2003": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["2002"] }
                ]
            }
        },
        //Approve DenClass Users
        "3083": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["3084"] }
                ]
            }

        },
        //Manage DenClass Users
        "3084": {
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: ["3083", "3085"] }
                ]
            }
        },
        //Manage DenClass User Permissions
        "3085": {
            onCheck: {
                actions: [{ action: checkAndEnable, permissions: ["3084"] }
                ]
            },
        },
        //Approve Users(MATS)
        "5204": {
            onCheck: {
                actions: [{ action: checkAndEnable, permissions: ["5205"] }
                ]
            }
        },
        //Manage Users (MATS)
        "5205": {
            onUnCheck: {
                actions: [{ action: unCheck, permissions: ["5204", "5206"] }]
            }
        },
        //Manage User Permissions (MATS)
        "5206": {
            onCheck: {
                actions: [{ action: checkAndEnable, permissions: ["5205"] }]
            }
        },
        //Manage System Messages (MATS)
        "5207": {
            onUnCheck: {
                actions: [{ action: unCheck, permissions: ["5208", "5209"] }]
            }
        },
        //Message All Roles (MATS)
        "5208": {
            onCheck: {
                actions: [{ action: checkAndEnable, permissions: ["5207"] }]
            }
        },
        //Republish Any Message (MATS)
        "5209": {
            onCheck: {
                actions: [{ action: checkAndEnable, permissions: ["5207"] }]
            }
        },
        //Approve HRR Users
        "6001": {
            onCheck: {
                actions: [{ action: checkAndEnable, permissions: ["6002"] }]
            }
        },
        //Manage HRR Users
        "6002": {
            onUnCheck: {
                actions: [{ action: unCheck, permissions: ["6001", "6003"] }]
            }
        },
        //Manage HRR User Permissions
        "6003": {
            onCheck: {
                actions: [{ action: checkAndEnable, permissions: ["6002"] }]
            }
        },
        //Generate ARNG Full/Selected STR/Validation Memo
        "6016":
        {
            onCheck: {
                actions: [
                    { action: unCheckAndEnable, permissions: ["6035", "6061"] },
                    { action: checkAndEnable, permissions: ["6033", "6034"] }
                ]
            },
            onUnCheck: {
                actions: [{ action: unCheck, permissions: ["6033", "6034"] }
                ]
            }
        },
        //View ARNG Sensitive Document
        "6033": {
            onUnCheck: {
                actions: [
                    { action: unCheckAndEnable, permissions: ["6016"] }
                ]
            },
            onCheck: {
                actions: [
                    { action: unCheckAndEnable, permissions: ["6061"] }

                ]
            }
        },
        //View ARNG Behavioral Health Document
        "6034": {
            onUnCheck: {
                actions: [
                    { action: unCheckAndEnable, permissions: ["6016"] }
                ]
            },

             onCheck: {
                actions: [
                    { action: unCheckAndEnable, permissions: ["6035"] }

                ]
            }           
        },
        //Break the glass for ARNG Behavioral Health
        "6035": {
            onCheck: {
                actions: [
                    { action: unCheckAndEnable, permissions: ["6016", "6034"] }
                ]
            }             
        },
        //Generate USAR Full/Selected STR/Validation Memo
        "6054": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["6057", "6058"] },
                    { action: unCheckAndEnable, permissions: ["6060", "6062"] }
                ]
            },
            onUnCheck: {
                actions: [{ action: unCheck, permissions: ["6057", "6058"] }
                ]
            }
        },
        //View USAR Sensitive Document
        "6057": {
            onUnCheck: {
                actions: [
                    { action: unCheckAndEnable, permissions: ["6054"] }
                ]
            },
            onCheck: {
                actions: [
                    { action: unCheckAndEnable, permissions: ["6062"] }

                ]
            }               
            },        
        //View USAR Behavioral Health Document
        "6058": {
            onUnCheck: {
                actions: [
                    { action: unCheckAndEnable, permissions: ["6054"] }
                ]
            },
            onCheck: {
                actions: [
                    { action: unCheckAndEnable, permissions: ["6060"] }
                ]
            }
        },
        //Break the glass for USAR Behavioral Health
        "6060": {
            onCheck: {
                actions: [
                    { action: unCheckAndEnable, permissions: ["6054", "6058"] }
                ]
            }
        },
        //Break the glass for ARNG Sensitive
        "6061": {
            onCheck: {
                actions: [
                    { action: unCheckAndEnable, permissions: ["6016", "6033"] }
                ]
            }
        },
        //Break the glass for USAR Sensitive
        "6062": {
            onCheck: {
                actions: [
                    { action: unCheckAndEnable, permissions: ["6054", "6057" ] }
                ]
            }
        },
        //Approve eMMPS Users
        "7000": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["7001"] }
                ]
            }
        },
        //Manage eMMPS Users
        "7001": {
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: ["7000", "7002"] }
                ]
            }
        },
        //Manage eMMPS Permissions
        "7002": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["7001"] }
                ]
            }
        },
        //Approve AVS Users
        "8000": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["8001"] }
                ]
            }
        },
        //Manage AVS User Permissions
        "8001": {
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: ["8000", "8002"] }
                ]
            }
        },
        //Create DHAP Event
        "8018": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: dhapEvents }
                ]
            },
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: dhapEvents }
                ]
            }
        },
        //Search for DHAP Events
        "8019": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: dhapEvents }
                ]
            },
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: dhapEvents }
                ]
            }
        },
        //Approve DHAP Event
        "8020": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: dhapEvents }
                ]
            },
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: dhapEvents }
                ]
            }
        },
        //Accept DHAP Event
        "8021": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: dhapEvents }
                ]
            },
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: dhapEvents }
                ]
            }
        },
        //Edit DHAP Event
        "8022": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: dhapEvents }
                ]
            },
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: dhapEvents }
                ]
            }
        },
        //View DHAP Service Provider Details
        "8065": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: dhapEvents }
                ]
            },
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: dhapEvents }
                ]
            }
        },
        //DHAP Region View
        "8066": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: dhapEvents }
                ]
            },
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: dhapEvents }
                ]
            }
        },
        //Cancel DHAP Event
        "8071": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: dhapEvents }
                ]
            },
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: dhapEvents }
                ]
            }
        },
        //Approve Users (MATS-ACRC)
        "9200": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["9201"] }
                ]
            }
        },
        "9201": {
            onUnCheck: {
                actions: [
                    { action: unCheck, permissions: ["9200", "9202"] }
                ]
            }
        },
        //Manage User Permissions (MATS-ACRC)
        "9202": {
            onCheck: {
                actions: [{ action: checkAndEnable, permissions: ["9201"] }
                ]
            }
        },
        "9206": {
            onUnCheck: {
                actions: [{ action: unCheck, permissions: ["9207", "9208"] }
                ]
            }
        },
        //Message All Roles (MATS-ACRC)
        "9207": {
            onCheck: {
                actions: [{ action: checkAndEnable, permissions: ["9206"] }
                ]
            }
        },
        //Republish Any Message (MATS-ACRC)
        "9208": {
            onCheck: {
                actions: [
                    { action: checkAndEnable, permissions: ["9206"] }
                ]
            }
        }
    };
}

function checkAndEnable(className) {
    $('.' + className).prop("checked", true);
    enableBox(className);
}

function unCheckAndEnable(className) {
    unCheck(className);
    enableBox(className);
}

function checkTheBox(className) {
    $('.' + className).prop("checked", true);
}

function unCheck(className) {
    $('.' + className).prop("checked", false);
    $('.' + className).removeAttr('checked');
}

function enableBox(className) {
    disable(className, false);
}

function disableBox(className) {
    disable(className, true);
}

//To enable: set disabled to FALSE
//To disable: set disabled to TRUE
function disable(className, isDisabled) {
    $('.' + className).prop("disabled", isDisabled);
}

function performAction(func, permissions, permissionId) {
    for (var i = 0; i < permissions.length; i++) {
        func(permissions[i], permissionId);
    }
}

function processActions(actions, permissionId) {
    for (var i = 0; i < actions.length; i++) {
        performAction(actions[i].action, actions[i].permissions, permissionId);
    }
}

function alterCheckboxGroup(value) {
    var checkbox = $('.' + value)[0];
    alterCheckbox(checkbox.checked, value);
    RecordPermissions();
}

function alterCheckbox(shouldBeChecked, className) {
    if (permissionMatrix !== undefined) {
        if (!$('.' + className).prop("disabled")) {
            if (shouldBeChecked) {
                checkTheBox(className);
            } else {
                unCheck(className);
            }
            var instructions = permissionMatrix[className];
            if (instructions !== undefined) {
                processAction(shouldBeChecked, instructions, className);
            }
        }
    }
}

function processAction(checkIt, instructions, value) {
    if (checkIt) {
        if (instructions.onCheck !== undefined && instructions.onCheck.actions !== undefined) {
            processActions(instructions.onCheck.actions, value);
        }
    }
    else {
        if (instructions.onUnCheck !== undefined && instructions.onUnCheck.actions !== undefined) {
            processActions(instructions.onUnCheck.actions, value);
        }
    }
}

function exists(list, valueToFind) {
    for (var i = 0; i < list.length; i++) {
        if (list[i] === valueToFind) {
            return true;
        }
    }
    return false;
}
//Called from the Select All On Tab button in each Tab. eCase has a tab where they wish for a disabled checkbox to be checked
function setAllCheckboxesInCurrentTab(value, ignoreDisabledProp) {
    let checkboxes = $('div[class="ajax__tab_panel"] :visible div table input[type="checkbox"]');
    setCheckboxes(checkboxes, value, ignoreDisabledProp);
}

function clearAllCheckboxesInTabs() {
    let checkboxes = $('div[class="ajax__tab_panel"] div table input[type="checkbox"]');
    setCheckboxes(checkboxes, false, false);
}

function setCheckboxes(checkboxes, value, ignoreDisabledProp) {
    if (ignoreDisabledProp === undefined) {
        ignoreDisabledProp = false;
    }
    if (checkboxes !== undefined && checkboxes.length > 0 && (value !== undefined && (value === true || value === false))) {
        for (var i = 0; i < checkboxes.length; i++) {
            alterCheckbox(value, $(checkboxes[i]).prop("class"));
        }
    }
    RecordPermissions();
}










